From 883b0a5986e56ce9dd099f97679b1a5c853a9d15 Mon Sep 17 00:00:00 2001 From: Sepehr Rasouli Date: Wed, 26 Aug 2026 08:06:40 +0330 Subject: [PATCH 1/5] FIx translation artifacts --- glossary.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glossary.po b/glossary.po index 0fdf0a4f9..e4bfe397f 100644 --- a/glossary.po +++ b/glossary.po @@ -17,7 +17,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-08-25 20:53+0330\n" +"PO-Revision-Date: 2026-08-26 08:03+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -879,7 +879,7 @@ msgid "lock-free" msgstr "بدون قفل" msgid "An operation that does not acquire any :term:`lock` and uses atomic CPU instructions to ensure correctness. Lock-free operations can execute concurrently without blocking each other and cannot be blocked by operations that hold locks. In :term:`free-threaded ` Python, built-in types like :class:`dict` and :class:`list` provide lock-free read operations, which means other threads may observe intermediate states during multi-step modifications even when those modifications hold the :term:`per-object lock`." -msgstr "عملیاتی که هیچ :term:`قفل `\\ ای به‌دست نمی‌آورد و برای تضمین درستی از دستورهای اتمی CPU استفاده می‌کند. عملیات‌های بدون قفل می‌توانند به‌طور هم‌زمان و بدون مسدود کردن یکدیگر اجرا شوند و نمی‌توانند توسط عملیات‌هایی که قفل‌ها را در اختیار دارند مسدود شوند. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` عملیات‌های خواندن بدون قفل ارائه می‌کنند، یعنی نخ‌های دیگر ممکن است در طول تغییرات چندمرحله‌ای، حتی زمانی که آن تغییرات :term:`قفلِ هر شیء ` را نگه داشته‌اند، وضعیت‌های میانی را مشاهده کنند." +msgstr "عملیاتی که هیچ :term:`قفل‌ `\\ ای به‌دست نمی‌آورد و برای تضمین درستی از دستورهای اتمی CPU استفاده می‌کند. عملیات‌های بدون قفل می‌توانند به‌طور هم‌زمان و بدون مسدود کردن یکدیگر اجرا شوند و نمی‌توانند توسط عملیات‌هایی که قفل‌ها را در اختیار دارند مسدود شوند. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` عملیات‌های خواندن بدون قفل ارائه می‌کنند، یعنی نخ‌های دیگر ممکن است در طول تغییرات چندمرحله‌ای، حتی زمانی که آن تغییرات :term:`قفلِ هر شیء ` را نگه داشته‌اند، وضعیت‌های میانی را مشاهده کنند." msgid "loader" msgstr "بارگذار" From 5014379c16b362066e98f424ad9791e129b86928 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Aug 2026 14:32:15 +0000 Subject: [PATCH 2/5] Translation chore --- README.md | 2 +- STATUS.md | 10 +- library/ast.po | 159 +---- library/exceptions.po | 73 +- reference/grammar.po | 1574 +---------------------------------------- 5 files changed, 9 insertions(+), 1809 deletions(-) diff --git a/README.md b/README.md index 15a702418..d998d08b8 100644 --- a/README.md +++ b/README.md @@ -45,5 +45,5 @@ ### مشارکت‌های کاربران ![نمودار مشارکت‌های کاربران؛ Revisto 3984، sepehr-rs 2210، danialbehzadi 677، invincible627 358، khosro_o 63، ParhamF 41، Ariyan_Bolandi 37، nikovinix7878 13، thaghgoo 12، Ramiz_222 10](reports/contributor_stats_latest.png) -(به‌روزرسانی: 2026-08-26) +(به‌روزرسانی: 2026-09-05) \ No newline at end of file diff --git a/STATUS.md b/STATUS.md index c3f81ae45..808382db2 100644 --- a/STATUS.md +++ b/STATUS.md @@ -1,6 +1,6 @@ ### وضعیت ترجمه فایل‌ها -(به‌روزرسانی: 2026-08-26) +(به‌روزرسانی: 2026-09-05) | فایل | ترجمه‌شده | مبهم | تعداد ترجمه‌شده | تعداد ترجمه‌نشده | |:-----|:-----------:|:-----------:|:-----------:|:-----------:| @@ -179,7 +179,7 @@ | library/archiving.po | 0.0% | 0.0% | 0 | 2 | | library/argparse.po | 0.0% | 0.0% | 0 | 408 | | library/array.po | 0.0% | 0.0% | 0 | 89 | -| library/ast.po | 0.0% | 0.0% | 0 | 339 | +| library/ast.po | 0.0% | 0.0% | 0 | 338 | | library/asynchat.po | 0.0% | 0.0% | 0 | 4 | | library/asyncio-api-index.po | 0.0% | 0.0% | 0 | 100 | | library/asyncio-dev.po | 0.0% | 0.0% | 0 | 84 | @@ -280,7 +280,7 @@ | library/ensurepip.po | 0.0% | 0.0% | 0 | 40 | | library/enum.po | 0.0% | 0.0% | 0 | 257 | | library/errno.po | 0.0% | 0.0% | 0 | 161 | -| library/exceptions.po | 0.0% | 0.0% | 0 | 204 | +| library/exceptions.po | 0.0% | 0.0% | 0 | 203 | | library/faulthandler.po | 0.0% | 0.0% | 0 | 53 | | library/fcntl.po | 0.0% | 0.0% | 0 | 54 | | library/filecmp.po | 0.0% | 0.0% | 0 | 42 | @@ -500,7 +500,7 @@ | reference/datamodel.po | 0.0% | 0.0% | 0 | 913 | | reference/executionmodel.po | 0.0% | 0.0% | 0 | 145 | | reference/expressions.po | 0.0% | 0.0% | 0 | 595 | -| reference/grammar.po | 0.0% | 0.0% | 0 | 7 | +| reference/grammar.po | 0.0% | 0.0% | 0 | 6 | | reference/import.po | 0.0% | 0.0% | 0 | 202 | | reference/index.po | 0.0% | 0.0% | 0 | 2 | | reference/introduction.po | 0.0% | 0.0% | 0 | 56 | @@ -541,5 +541,5 @@ | whatsnew/3.9.po | 0.0% | 0.0% | 0 | 380 | | whatsnew/changelog.po | 0.0% | 0.0% | 0 | 1 | | whatsnew/index.po | 0.0% | 0.0% | 0 | 3 | -| **مجموع** | **3.9%** | **0.0%** | **2706** | **67536** | +| **مجموع** | **3.9%** | **0.0%** | **2706** | **67533** | diff --git a/library/ast.po b/library/ast.po index 18a1657c6..cf4ff928b 100644 --- a/library/ast.po +++ b/library/ast.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-26 07:47+0330\n" +"POT-Creation-Date: 2026-08-27 14:53+0000\n" "PO-Revision-Date: 2021-06-28 00:54+0000\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" @@ -41,163 +41,6 @@ msgstr "" msgid "The abstract grammar is currently defined as follows:" msgstr "" -msgid "" -"-- ASDL's 4 builtin types are:\n" -"-- identifier, int, string, constant\n" -"\n" -"module Python\n" -"{\n" -" mod = Module(stmt* body, type_ignore* type_ignores)\n" -" | Interactive(stmt* body)\n" -" | Expression(expr body)\n" -" | FunctionType(expr* argtypes, expr returns)\n" -"\n" -" stmt = FunctionDef(identifier name, arguments args,\n" -" stmt* body, expr* decorator_list, expr? returns,\n" -" string? type_comment, type_param* type_params)\n" -" | AsyncFunctionDef(identifier name, arguments args,\n" -" stmt* body, expr* decorator_list, expr? returns,\n" -" string? type_comment, type_param* type_params)\n" -"\n" -" | ClassDef(identifier name,\n" -" expr* bases,\n" -" keyword* keywords,\n" -" stmt* body,\n" -" expr* decorator_list,\n" -" type_param* type_params)\n" -" | Return(expr? value)\n" -"\n" -" | Delete(expr* targets)\n" -" | Assign(expr* targets, expr value, string? type_comment)\n" -" | TypeAlias(expr name, type_param* type_params, expr value)\n" -" | AugAssign(expr target, operator op, expr value)\n" -" -- 'simple' indicates that we annotate simple name without parens\n" -" | AnnAssign(expr target, expr annotation, expr? value, int simple)\n" -"\n" -" -- use 'orelse' because else is a keyword in target languages\n" -" | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" -" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n" -" | While(expr test, stmt* body, stmt* orelse)\n" -" | If(expr test, stmt* body, stmt* orelse)\n" -" | With(withitem* items, stmt* body, string? type_comment)\n" -" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" -"\n" -" | Match(expr subject, match_case* cases)\n" -"\n" -" | Raise(expr? exc, expr? cause)\n" -" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)\n" -" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)\n" -" | Assert(expr test, expr? msg)\n" -"\n" -" | Import(alias* names)\n" -" | ImportFrom(identifier? module, alias* names, int? level)\n" -"\n" -" | Global(identifier* names)\n" -" | Nonlocal(identifier* names)\n" -" | Expr(expr value)\n" -" | Pass | Break | Continue\n" -"\n" -" -- col_offset is the byte offset in the utf8 string the parser uses\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" -- BoolOp() can use left & right?\n" -" expr = BoolOp(boolop op, expr* values)\n" -" | NamedExpr(expr target, expr value)\n" -" | BinOp(expr left, operator op, expr right)\n" -" | UnaryOp(unaryop op, expr operand)\n" -" | Lambda(arguments args, expr body)\n" -" | IfExp(expr test, expr body, expr orelse)\n" -" | Dict(expr?* keys, expr* values)\n" -" | Set(expr* elts)\n" -" | ListComp(expr elt, comprehension* generators)\n" -" | SetComp(expr elt, comprehension* generators)\n" -" | DictComp(expr key, expr value, comprehension* generators)\n" -" | GeneratorExp(expr elt, comprehension* generators)\n" -" -- the grammar constrains where yield expressions can occur\n" -" | Await(expr value)\n" -" | Yield(expr? value)\n" -" | YieldFrom(expr value)\n" -" -- need sequences for compare to distinguish between\n" -" -- x < 4 < 3 and (x < 4) < 3\n" -" | Compare(expr left, cmpop* ops, expr* comparators)\n" -" | Call(expr func, expr* args, keyword* keywords)\n" -" | FormattedValue(expr value, int conversion, expr? format_spec)\n" -" | Interpolation(expr value, constant str, int conversion, expr? format_spec)\n" -" | JoinedStr(expr* values)\n" -" | TemplateStr(expr* values)\n" -" | Constant(constant value, string? kind)\n" -"\n" -" -- the following expression can appear in assignment context\n" -" | Attribute(expr value, identifier attr, expr_context ctx)\n" -" | Subscript(expr value, expr slice, expr_context ctx)\n" -" | Starred(expr value, expr_context ctx)\n" -" | Name(identifier id, expr_context ctx)\n" -" | List(expr* elts, expr_context ctx)\n" -" | Tuple(expr* elts, expr_context ctx)\n" -"\n" -" -- can appear only in Subscript\n" -" | Slice(expr? lower, expr? upper, expr? step)\n" -"\n" -" -- col_offset is the byte offset in the utf8 string the parser uses\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" expr_context = Load | Store | Del\n" -"\n" -" boolop = And | Or\n" -"\n" -" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" -" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" -"\n" -" unaryop = Invert | Not | UAdd | USub\n" -"\n" -" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" -"\n" -" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" -"\n" -" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" -" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" -"\n" -" arg = (identifier arg, expr? annotation, string? type_comment)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" -" keyword = (identifier? arg, expr value)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" -- import name with optional 'as' alias.\n" -" alias = (identifier name, identifier? asname)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)\n" -"\n" -" withitem = (expr context_expr, expr? optional_vars)\n" -"\n" -" match_case = (pattern pattern, expr? guard, stmt* body)\n" -"\n" -" pattern = MatchValue(expr value)\n" -" | MatchSingleton(constant value)\n" -" | MatchSequence(pattern* patterns)\n" -" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" -" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns)\n" -"\n" -" | MatchStar(identifier? name)\n" -" -- The optional \"rest\" MatchMapping parameter handles capturing extra mapping keys\n" -"\n" -" | MatchAs(pattern? pattern, identifier? name)\n" -" | MatchOr(pattern* patterns)\n" -"\n" -" attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)\n" -"\n" -" type_ignore = TypeIgnore(int lineno, string tag)\n" -"\n" -" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" -" | ParamSpec(identifier name, expr? default_value)\n" -" | TypeVarTuple(identifier name, expr? default_value)\n" -" attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)\n" -"}\n" -msgstr "" - msgid "Node classes" msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 09ae53398..d786c9a48 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-26 07:47+0330\n" +"POT-Creation-Date: 2026-08-27 14:53+0000\n" "PO-Revision-Date: 2021-06-28 01:05+0000\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" @@ -630,77 +630,6 @@ msgstr "" msgid "The class hierarchy for built-in exceptions is:" msgstr "" -msgid "" -"BaseException\n" -" ├── BaseExceptionGroup\n" -" ├── GeneratorExit\n" -" ├── KeyboardInterrupt\n" -" ├── SystemExit\n" -" └── Exception\n" -" ├── ArithmeticError\n" -" │ ├── FloatingPointError\n" -" │ ├── OverflowError\n" -" │ └── ZeroDivisionError\n" -" ├── AssertionError\n" -" ├── AttributeError\n" -" ├── BufferError\n" -" ├── EOFError\n" -" ├── ExceptionGroup [BaseExceptionGroup]\n" -" ├── ImportError\n" -" │ └── ModuleNotFoundError\n" -" ├── LookupError\n" -" │ ├── IndexError\n" -" │ └── KeyError\n" -" ├── MemoryError\n" -" ├── NameError\n" -" │ └── UnboundLocalError\n" -" ├── OSError\n" -" │ ├── BlockingIOError\n" -" │ ├── ChildProcessError\n" -" │ ├── ConnectionError\n" -" │ │ ├── BrokenPipeError\n" -" │ │ ├── ConnectionAbortedError\n" -" │ │ ├── ConnectionRefusedError\n" -" │ │ └── ConnectionResetError\n" -" │ ├── FileExistsError\n" -" │ ├── FileNotFoundError\n" -" │ ├── InterruptedError\n" -" │ ├── IsADirectoryError\n" -" │ ├── NotADirectoryError\n" -" │ ├── PermissionError\n" -" │ ├── ProcessLookupError\n" -" │ └── TimeoutError\n" -" ├── ReferenceError\n" -" ├── RuntimeError\n" -" │ ├── NotImplementedError\n" -" │ ├── PythonFinalizationError\n" -" │ └── RecursionError\n" -" ├── StopAsyncIteration\n" -" ├── StopIteration\n" -" ├── SyntaxError\n" -" │ └── IndentationError\n" -" │ └── TabError\n" -" ├── SystemError\n" -" ├── TypeError\n" -" ├── ValueError\n" -" │ └── UnicodeError\n" -" │ ├── UnicodeDecodeError\n" -" │ ├── UnicodeEncodeError\n" -" │ └── UnicodeTranslateError\n" -" └── Warning\n" -" ├── BytesWarning\n" -" ├── DeprecationWarning\n" -" ├── EncodingWarning\n" -" ├── FutureWarning\n" -" ├── ImportWarning\n" -" ├── PendingDeprecationWarning\n" -" ├── ResourceWarning\n" -" ├── RuntimeWarning\n" -" ├── SyntaxWarning\n" -" ├── UnicodeWarning\n" -" └── UserWarning\n" -msgstr "" - msgid "statement" msgstr "" diff --git a/reference/grammar.po b/reference/grammar.po index f2e2b13d9..30667794f 100644 --- a/reference/grammar.po +++ b/reference/grammar.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-26 07:47+0330\n" +"POT-Creation-Date: 2026-08-27 14:53+0000\n" "PO-Revision-Date: 2021-06-28 01:49+0000\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -38,1575 +38,3 @@ msgstr "" msgid "Cuts currently don't appear inside parentheses, brackets, lookaheads and similar. Their behavior in these contexts is deliberately left unspecified." msgstr "" - -msgid "" -"# PEG grammar for Python\n" -"\n" -"@trailer '''\n" -"void *\n" -"_PyPegen_parse(Parser *p)\n" -"{\n" -" // Initialize keywords\n" -" p->keywords = reserved_keywords;\n" -" p->n_keyword_lists = n_keyword_lists;\n" -" p->soft_keywords = soft_keywords;\n" -"\n" -" // Run parser\n" -" void *result = NULL;\n" -" if (p->start_rule == Py_file_input) {\n" -" result = file_rule(p);\n" -" } else if (p->start_rule == Py_single_input) {\n" -" result = interactive_rule(p);\n" -" } else if (p->start_rule == Py_eval_input) {\n" -" result = eval_rule(p);\n" -" } else if (p->start_rule == Py_func_type_input) {\n" -" result = func_type_rule(p);\n" -" }\n" -"\n" -" return result;\n" -"}\n" -"'''\n" -"\n" -"# ========================= START OF THE GRAMMAR =========================\n" -"\n" -"# General grammatical elements and rules:\n" -"#\n" -"# * Strings with double quotes (\") denote SOFT KEYWORDS\n" -"# * Strings with single quotes (') denote KEYWORDS\n" -"# * Upper case names (NAME) denote tokens in the Grammar/Tokens file\n" -"# * Rule names starting with \"invalid_\" are used for specialized syntax errors\n" -"# - These rules are NOT used in the first pass of the parser.\n" -"# - Only if the first pass fails to parse, a second pass including the invalid\n" -"# rules will be executed.\n" -"# - If the parser fails in the second phase with a generic syntax error, the\n" -"# location of the generic failure of the first pass will be used (this avoids\n" -"# reporting incorrect locations due to the invalid rules).\n" -"# - The order of the alternatives involving invalid rules matter\n" -"# (like any rule in PEG).\n" -"#\n" -"# Grammar Syntax (see PEP 617 for more information):\n" -"#\n" -"# rule_name: expression\n" -"# Optionally, a type can be included right after the rule name, which\n" -"# specifies the return type of the C or Python function corresponding to the\n" -"# rule:\n" -"# rule_name[return_type]: expression\n" -"# If the return type is omitted, then a void * is returned in C and an Any in\n" -"# Python.\n" -"# e1 e2\n" -"# Match e1, then match e2.\n" -"# e1 | e2\n" -"# Match e1 or e2.\n" -"# The first alternative can also appear on the line after the rule name for\n" -"# formatting purposes. In that case, a | must be used before the first\n" -"# alternative, like so:\n" -"# rule_name[return_type]:\n" -"# | first_alt\n" -"# | second_alt\n" -"# ( e )\n" -"# Match e (allows also to use other operators in the group like '(e)*')\n" -"# [ e ] or e?\n" -"# Optionally match e.\n" -"# e*\n" -"# Match zero or more occurrences of e.\n" -"# e+\n" -"# Match one or more occurrences of e.\n" -"# s.e+\n" -"# Match one or more occurrences of e, separated by s. The generated parse tree\n" -"# does not include the separator. This is otherwise identical to (e (s e)*).\n" -"# &e\n" -"# Succeed if e can be parsed, without consuming any input.\n" -"# !e\n" -"# Fail if e can be parsed, without consuming any input.\n" -"# ~\n" -"# Commit to the current alternative, even if it fails to parse.\n" -"# &&e\n" -"# Eager parse e. The parser will not backtrack and will immediately\n" -"# fail with SyntaxError if e cannot be parsed.\n" -"#\n" -"\n" -"# STARTING RULES\n" -"# ==============\n" -"\n" -"file[mod_ty]: a=[statements] ENDMARKER { _PyPegen_make_module(p, a) }\n" -"interactive[mod_ty]: a=statement_newline { _PyAST_Interactive(a, p->arena) }\n" -"eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { _PyAST_Expression(a, p->arena) }\n" -"func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { _PyAST_FunctionType(a, b, p->arena) }\n" -"\n" -"# GENERAL STATEMENTS\n" -"# ==================\n" -"\n" -"statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) }\n" -"\n" -"statement[asdl_stmt_seq*]:\n" -" | a=compound_stmt { _PyPegen_register_stmts(p ,\n" -" (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a)\n" -" ) }\n" -" | a[asdl_stmt_seq*]=simple_stmts { a }\n" -"\n" -"single_compound_stmt[asdl_stmt_seq*]:\n" -" | a=compound_stmt {\n" -" _PyPegen_register_stmts(p, (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a)) }\n" -"\n" -"statement_newline[asdl_stmt_seq*]:\n" -" | a=single_compound_stmt NEWLINE { a }\n" -" | simple_stmts\n" -" | NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, CHECK(stmt_ty, _PyAST_Pass(EXTRA))) }\n" -" | ENDMARKER { _PyPegen_interactive_exit(p) }\n" -"\n" -"simple_stmts[asdl_stmt_seq*]:\n" -" | a=simple_stmt !';' NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } # Not needed, there for speedup\n" -" | a[asdl_stmt_seq*]=';'.simple_stmt+ [';'] NEWLINE { a }\n" -"\n" -"# NOTE: assignment MUST precede expression, else parsing a simple assignment\n" -"# will throw a SyntaxError.\n" -"simple_stmt[stmt_ty] (memo):\n" -" | assignment\n" -" | &\"type\" type_alias\n" -" | e=star_expressions { _PyAST_Expr(e, EXTRA) }\n" -" | &'return' return_stmt\n" -" | &('import' | 'from') import_stmt\n" -" | &'raise' raise_stmt\n" -" | &'pass' pass_stmt\n" -" | &'del' del_stmt\n" -" | &'yield' yield_stmt\n" -" | &'assert' assert_stmt\n" -" | &'break' break_stmt\n" -" | &'continue' continue_stmt\n" -" | &'global' global_stmt\n" -" | &'nonlocal' nonlocal_stmt\n" -"\n" -"compound_stmt[stmt_ty]:\n" -" | &('def' | '@' | 'async') function_def\n" -" | &'if' if_stmt\n" -" | &('class' | '@') class_def\n" -" | &('with' | 'async') with_stmt\n" -" | &('for' | 'async') for_stmt\n" -" | &'try' try_stmt\n" -" | &'while' while_stmt\n" -" | match_stmt\n" -"\n" -"# SIMPLE STATEMENTS\n" -"# =================\n" -"\n" -"# NOTE: annotated_rhs may start with 'yield'; yield_expr must start with 'yield'\n" -"assignment[stmt_ty]:\n" -" | a=NAME ':' b=expression c=['=' d=annotated_rhs { d }] {\n" -" CHECK_VERSION(\n" -" stmt_ty,\n" -" 6,\n" -" \"Variable annotation syntax is\",\n" -" _PyAST_AnnAssign(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA)\n" -" ) }\n" -" | a=('(' b=single_target ')' { b }\n" -" | single_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] {\n" -" CHECK_VERSION(stmt_ty, 6, \"Variable annotations syntax is\", _PyAST_AnnAssign(a, b, c, 0, EXTRA)) }\n" -" | a[asdl_expr_seq*]=(z=star_targets '=' { z })+ b=annotated_rhs !'=' tc=[TYPE_COMMENT] {\n" -" _PyAST_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) }\n" -" | a=single_target b=augassign ~ c=annotated_rhs {\n" -" _PyAST_AugAssign(a, b->kind, c, EXTRA) }\n" -" | invalid_assignment\n" -"\n" -"annotated_rhs[expr_ty]: yield_expr | star_expressions\n" -"\n" -"augassign[AugOperator*]:\n" -" | '+=' { _PyPegen_augoperator(p, Add) }\n" -" | '-=' { _PyPegen_augoperator(p, Sub) }\n" -" | '*=' { _PyPegen_augoperator(p, Mult) }\n" -" | '@=' { CHECK_VERSION(AugOperator*, 5, \"The '@' operator is\", _PyPegen_augoperator(p, MatMult)) }\n" -" | '/=' { _PyPegen_augoperator(p, Div) }\n" -" | '%=' { _PyPegen_augoperator(p, Mod) }\n" -" | '&=' { _PyPegen_augoperator(p, BitAnd) }\n" -" | '|=' { _PyPegen_augoperator(p, BitOr) }\n" -" | '^=' { _PyPegen_augoperator(p, BitXor) }\n" -" | '<<=' { _PyPegen_augoperator(p, LShift) }\n" -" | '>>=' { _PyPegen_augoperator(p, RShift) }\n" -" | '**=' { _PyPegen_augoperator(p, Pow) }\n" -" | '//=' { _PyPegen_augoperator(p, FloorDiv) }\n" -"\n" -"return_stmt[stmt_ty]:\n" -" | 'return' a=[star_expressions] { _PyAST_Return(a, EXTRA) }\n" -"\n" -"raise_stmt[stmt_ty]:\n" -" | 'raise' a=expression b=['from' z=expression { z }] { _PyAST_Raise(a, b, EXTRA) }\n" -" | 'raise' { _PyAST_Raise(NULL, NULL, EXTRA) }\n" -"\n" -"pass_stmt[stmt_ty]:\n" -" | 'pass' { _PyAST_Pass(EXTRA) }\n" -"\n" -"break_stmt[stmt_ty]:\n" -" | 'break' { _PyAST_Break(EXTRA) }\n" -"\n" -"continue_stmt[stmt_ty]:\n" -" | 'continue' { _PyAST_Continue(EXTRA) }\n" -"\n" -"global_stmt[stmt_ty]: 'global' a[asdl_expr_seq*]=','.NAME+ {\n" -" _PyAST_Global(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) }\n" -"\n" -"nonlocal_stmt[stmt_ty]: 'nonlocal' a[asdl_expr_seq*]=','.NAME+ {\n" -" _PyAST_Nonlocal(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) }\n" -"\n" -"del_stmt[stmt_ty]:\n" -" | 'del' a=del_targets &(';' | NEWLINE) { _PyAST_Delete(a, EXTRA) }\n" -" | invalid_del_stmt\n" -"\n" -"yield_stmt[stmt_ty]: y=yield_expr { _PyAST_Expr(y, EXTRA) }\n" -"\n" -"assert_stmt[stmt_ty]: 'assert' a=expression b=[',' z=expression { z }] { _PyAST_Assert(a, b, EXTRA) }\n" -"\n" -"import_stmt[stmt_ty]:\n" -" | invalid_import\n" -" | import_name\n" -" | import_from\n" -"\n" -"# Import statements\n" -"# -----------------\n" -"\n" -"import_name[stmt_ty]: 'import' a=dotted_as_names { _PyAST_Import(a, EXTRA) }\n" -"# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS\n" -"import_from[stmt_ty]:\n" -" | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets {\n" -" _PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) }\n" -" | 'from' a=('.' | '...')+ 'import' b=import_from_targets {\n" -" _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) }\n" -"import_from_targets[asdl_alias_seq*]:\n" -" | '(' a=import_from_as_names [','] ')' { a }\n" -" | import_from_as_names !','\n" -" | '*' { (asdl_alias_seq*)_PyPegen_singleton_seq(p, CHECK(alias_ty, _PyPegen_alias_for_star(p, EXTRA))) }\n" -" | invalid_import_from_targets\n" -"import_from_as_names[asdl_alias_seq*]:\n" -" | a[asdl_alias_seq*]=','.import_from_as_name+ { a }\n" -"import_from_as_name[alias_ty]:\n" -" | invalid_import_from_as_name\n" -" | a=NAME b=['as' z=NAME { z }] { _PyAST_alias(\n" -" a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, EXTRA) }\n" -"\n" -"dotted_as_names[asdl_alias_seq*]:\n" -" | a[asdl_alias_seq*]=','.dotted_as_name+ { a }\n" -"dotted_as_name[alias_ty]:\n" -" | invalid_dotted_as_name\n" -" | a=dotted_name b=['as' z=NAME { z }] { _PyAST_alias(\n" -" a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, EXTRA) }\n" -"\n" -"dotted_name[expr_ty]:\n" -" | a=dotted_name '.' b=NAME { _PyPegen_join_names_with_dot(p, a, b) }\n" -" | NAME\n" -"\n" -"# COMPOUND STATEMENTS\n" -"# ===================\n" -"\n" -"# Common elements\n" -"# ---------------\n" -"\n" -"block[asdl_stmt_seq*] (memo):\n" -" | NEWLINE INDENT a=statements DEDENT { a }\n" -" | simple_stmts\n" -" | invalid_block\n" -"\n" -"decorators[asdl_expr_seq*]: a[asdl_expr_seq*]=('@' f=named_expression NEWLINE { f })+ { a }\n" -"\n" -"# Class definitions\n" -"# -----------------\n" -"\n" -"class_def[stmt_ty]:\n" -" | a=decorators b=class_def_raw { _PyPegen_class_def_decorators(p, a, b) }\n" -" | class_def_raw\n" -"\n" -"class_def_raw[stmt_ty]:\n" -" | invalid_class_def_raw\n" -" | 'class' a=NAME t=[type_params] b=['(' z=[arguments] ')' { z }] ':' c=block {\n" -" _PyAST_ClassDef(a->v.Name.id,\n" -" (b) ? ((expr_ty) b)->v.Call.args : NULL,\n" -" (b) ? ((expr_ty) b)->v.Call.keywords : NULL,\n" -" c, NULL, t, EXTRA) }\n" -"\n" -"# Function definitions\n" -"# --------------------\n" -"\n" -"function_def[stmt_ty]:\n" -" | d=decorators f=function_def_raw { _PyPegen_function_def_decorators(p, d, f) }\n" -" | function_def_raw\n" -"\n" -"function_def_raw[stmt_ty]:\n" -" | invalid_def_raw\n" -" | 'def' n=NAME t=[type_params] '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block {\n" -" _PyAST_FunctionDef(n->v.Name.id,\n" -" (params) ? params : CHECK(arguments_ty, _PyPegen_empty_arguments(p)),\n" -" b, NULL, a, NEW_TYPE_COMMENT(p, tc), t, EXTRA) }\n" -" | 'async' 'def' n=NAME t=[type_params] '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block {\n" -" CHECK_VERSION(\n" -" stmt_ty,\n" -" 5,\n" -" \"Async functions are\",\n" -" _PyAST_AsyncFunctionDef(n->v.Name.id,\n" -" (params) ? params : CHECK(arguments_ty, _PyPegen_empty_arguments(p)),\n" -" b, NULL, a, NEW_TYPE_COMMENT(p, tc), t, EXTRA)\n" -" ) }\n" -"\n" -"# Function parameters\n" -"# -------------------\n" -"\n" -"params[arguments_ty]:\n" -" | invalid_parameters\n" -" | parameters\n" -"\n" -"parameters[arguments_ty]:\n" -" | a=slash_no_default b[asdl_arg_seq*]=param_no_default* c=param_with_default* d=[star_etc] {\n" -" CHECK_VERSION(arguments_ty, 8, \"Positional-only parameters are\", _PyPegen_make_arguments(p, a, NULL, b, c, d)) }\n" -" | a=slash_with_default b=param_with_default* c=[star_etc] {\n" -" CHECK_VERSION(arguments_ty, 8, \"Positional-only parameters are\", _PyPegen_make_arguments(p, NULL, a, NULL, b, c)) }\n" -" | a[asdl_arg_seq*]=param_no_default+ b=param_with_default* c=[star_etc] {\n" -" _PyPegen_make_arguments(p, NULL, NULL, a, b, c) }\n" -" | a=param_with_default+ b=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)}\n" -" | a=star_etc { _PyPegen_make_arguments(p, NULL, NULL, NULL, NULL, a) }\n" -"\n" -"# Some duplication here because we can't write (',' | &')'),\n" -"# which is because we don't support empty alternatives (yet).\n" -"\n" -"slash_no_default[asdl_arg_seq*]:\n" -" | a[asdl_arg_seq*]=param_no_default+ '/' ',' { a }\n" -" | a[asdl_arg_seq*]=param_no_default+ '/' &')' { a }\n" -"slash_with_default[SlashWithDefault*]:\n" -" | a=param_no_default* b=param_with_default+ '/' ',' { _PyPegen_slash_with_default(p, (asdl_arg_seq *)a, b) }\n" -" | a=param_no_default* b=param_with_default+ '/' &')' { _PyPegen_slash_with_default(p, (asdl_arg_seq *)a, b) }\n" -"\n" -"star_etc[StarEtc*]:\n" -" | invalid_star_etc\n" -" | '*' a=param_no_default b=param_maybe_default* c=[kwds] {\n" -" _PyPegen_star_etc(p, a, b, c) }\n" -" | '*' a=param_no_default_star_annotation b=param_maybe_default* c=[kwds] {\n" -" _PyPegen_star_etc(p, a, b, c) }\n" -" | '*' ',' b=param_maybe_default+ c=[kwds] {\n" -" _PyPegen_star_etc(p, NULL, b, c) }\n" -" | a=kwds { _PyPegen_star_etc(p, NULL, NULL, a) }\n" -"\n" -"kwds[arg_ty]:\n" -" | invalid_kwds\n" -" | '**' a=param_no_default { a }\n" -"\n" -"# One parameter. This *includes* a following comma and type comment.\n" -"#\n" -"# There are three styles:\n" -"# - No default\n" -"# - With default\n" -"# - Maybe with default\n" -"#\n" -"# There are two alternative forms of each, to deal with type comments:\n" -"# - Ends in a comma followed by an optional type comment\n" -"# - No comma, optional type comment, must be followed by close paren\n" -"# The latter form is for a final parameter without trailing comma.\n" -"#\n" -"\n" -"param_no_default[arg_ty]:\n" -" | a=param ',' tc=TYPE_COMMENT? { _PyPegen_add_type_comment_to_arg(p, a, tc) }\n" -" | a=param tc=TYPE_COMMENT? &')' { _PyPegen_add_type_comment_to_arg(p, a, tc) }\n" -"param_no_default_star_annotation[arg_ty]:\n" -" | a=param_star_annotation ',' tc=TYPE_COMMENT? { _PyPegen_add_type_comment_to_arg(p, a, tc) }\n" -" | a=param_star_annotation tc=TYPE_COMMENT? &')' { _PyPegen_add_type_comment_to_arg(p, a, tc) }\n" -"param_with_default[NameDefaultPair*]:\n" -" | a=param c=default ',' tc=TYPE_COMMENT? { _PyPegen_name_default_pair(p, a, c, tc) }\n" -" | a=param c=default tc=TYPE_COMMENT? &')' { _PyPegen_name_default_pair(p, a, c, tc) }\n" -"param_maybe_default[NameDefaultPair*]:\n" -" | a=param c=default? ',' tc=TYPE_COMMENT? { _PyPegen_name_default_pair(p, a, c, tc) }\n" -" | a=param c=default? tc=TYPE_COMMENT? &')' { _PyPegen_name_default_pair(p, a, c, tc) }\n" -"param[arg_ty]: a=NAME b=annotation? { _PyAST_arg(a->v.Name.id, b, NULL, EXTRA) }\n" -"param_star_annotation[arg_ty]: a=NAME b=star_annotation { _PyAST_arg(a->v.Name.id, b, NULL, EXTRA) }\n" -"annotation[expr_ty]: ':' a=expression { a }\n" -"star_annotation[expr_ty]: ':' a=star_expression { a }\n" -"default[expr_ty]: '=' a=expression { a } | invalid_default\n" -"\n" -"# If statement\n" -"# ------------\n" -"\n" -"if_stmt[stmt_ty]:\n" -" | invalid_if_stmt\n" -" | 'if' a=named_expression ':' b=block c=elif_stmt {\n" -" _PyAST_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) }\n" -" | 'if' a=named_expression ':' b=block c=[else_block] { _PyAST_If(a, b, c, EXTRA) }\n" -"elif_stmt[stmt_ty]:\n" -" | invalid_elif_stmt\n" -" | 'elif' a=named_expression ':' b=block c=elif_stmt {\n" -" _PyAST_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) }\n" -" | 'elif' a=named_expression ':' b=block c=[else_block] { _PyAST_If(a, b, c, EXTRA) }\n" -"else_block[asdl_stmt_seq*]:\n" -" | invalid_else_stmt\n" -" | 'else' &&':' b=block { b }\n" -"\n" -"# While statement\n" -"# ---------------\n" -"\n" -"while_stmt[stmt_ty]:\n" -" | invalid_while_stmt\n" -" | 'while' a=named_expression ':' b=block c=[else_block] { _PyAST_While(a, b, c, EXTRA) }\n" -"\n" -"# For statement\n" -"# -------------\n" -"\n" -"for_stmt[stmt_ty]:\n" -" | invalid_for_stmt\n" -" | 'for' t=star_targets 'in' ~ ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] {\n" -" _PyAST_For(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) }\n" -" | 'async' 'for' t=star_targets 'in' ~ ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] {\n" -" CHECK_VERSION(stmt_ty, 5, \"Async for loops are\", _PyAST_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) }\n" -" | invalid_for_target\n" -"\n" -"# With statement\n" -"# --------------\n" -"\n" -"with_stmt[stmt_ty]:\n" -" | invalid_with_stmt_indent\n" -" | 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' tc=[TYPE_COMMENT] b=block {\n" -" _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) }\n" -" | 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {\n" -" _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) }\n" -" | 'async' 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block {\n" -" CHECK_VERSION(stmt_ty, 5, \"Async with statements are\", _PyAST_AsyncWith(a, b, NULL, EXTRA)) }\n" -" | 'async' 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {\n" -" CHECK_VERSION(stmt_ty, 5, \"Async with statements are\", _PyAST_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) }\n" -" | invalid_with_stmt\n" -"\n" -"with_item[withitem_ty]:\n" -" | e=expression 'as' t=star_target &(',' | ')' | ':') { _PyAST_withitem(e, t, p->arena) }\n" -" | invalid_with_item\n" -" | e=expression { _PyAST_withitem(e, NULL, p->arena) }\n" -"\n" -"# Try statement\n" -"# -------------\n" -"\n" -"try_stmt[stmt_ty]:\n" -" | invalid_try_stmt\n" -" | 'try' &&':' b=block f=finally_block { _PyAST_Try(b, NULL, NULL, f, EXTRA) }\n" -" | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_block+ el=[else_block] f=[finally_block] { _PyAST_Try(b, ex, el, f, EXTRA) }\n" -" | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_star_block+ el=[else_block] f=[finally_block] {\n" -" CHECK_VERSION(stmt_ty, 11, \"Exception groups are\",\n" -" _PyAST_TryStar(b, ex, el, f, EXTRA)) }\n" -"\n" -"\n" -"# Except statement\n" -"# ----------------\n" -"\n" -"except_block[excepthandler_ty]:\n" -" | invalid_except_stmt_indent\n" -" | 'except' e=expression ':' b=block {\n" -" _PyAST_ExceptHandler(e, NULL, b, EXTRA) }\n" -" | 'except' e=expression 'as' t=NAME ':' b=block {\n" -" _PyAST_ExceptHandler(e, ((expr_ty) t)->v.Name.id, b, EXTRA) }\n" -" | 'except' e=expressions ':' b=block {\n" -" CHECK_VERSION(\n" -" excepthandler_ty,\n" -" 14,\n" -" \"except expressions without parentheses are\",\n" -" _PyAST_ExceptHandler(e, NULL, b, EXTRA)) }\n" -" | 'except' ':' b=block { _PyAST_ExceptHandler(NULL, NULL, b, EXTRA) }\n" -" | invalid_except_stmt\n" -"except_star_block[excepthandler_ty]:\n" -" | invalid_except_star_stmt_indent\n" -" | 'except' '*' e=expression ':' b=block {\n" -" _PyAST_ExceptHandler(e, NULL, b, EXTRA) }\n" -" | 'except' '*' e=expression 'as' t=NAME ':' b=block {\n" -" _PyAST_ExceptHandler(e, ((expr_ty) t)->v.Name.id, b, EXTRA) }\n" -" | 'except' '*' e=expressions ':' b=block {\n" -" CHECK_VERSION(\n" -" excepthandler_ty,\n" -" 14,\n" -" \"except expressions without parentheses are\",\n" -" _PyAST_ExceptHandler(e, NULL, b, EXTRA)) }\n" -" | invalid_except_star_stmt\n" -"finally_block[asdl_stmt_seq*]:\n" -" | invalid_finally_stmt\n" -" | 'finally' &&':' a=block { a }\n" -"\n" -"# Match statement\n" -"# ---------------\n" -"\n" -"match_stmt[stmt_ty]:\n" -" | \"match\" subject=subject_expr ':' NEWLINE INDENT cases[asdl_match_case_seq*]=case_block+ DEDENT {\n" -" CHECK_VERSION(stmt_ty, 10, \"Pattern matching is\", _PyAST_Match(subject, cases, EXTRA)) }\n" -" | invalid_match_stmt\n" -"\n" -"subject_expr[expr_ty]:\n" -" | value=star_named_expression ',' values=star_named_expressions? {\n" -" _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, value, values)), Load, EXTRA) }\n" -" | named_expression\n" -"\n" -"case_block[match_case_ty]:\n" -" | invalid_case_block\n" -" | \"case\" pattern=patterns guard=guard? ':' body=block {\n" -" _PyAST_match_case(pattern, guard, body, p->arena) }\n" -"\n" -"guard[expr_ty]: 'if' guard=named_expression { guard }\n" -"\n" -"patterns[pattern_ty]:\n" -" | patterns[asdl_pattern_seq*]=open_sequence_pattern {\n" -" _PyAST_MatchSequence(patterns, EXTRA) }\n" -" | pattern\n" -"\n" -"pattern[pattern_ty]:\n" -" | as_pattern\n" -" | or_pattern\n" -"\n" -"as_pattern[pattern_ty]:\n" -" | pattern=or_pattern 'as' target=pattern_capture_target {\n" -" _PyAST_MatchAs(pattern, target->v.Name.id, EXTRA) }\n" -" | invalid_as_pattern\n" -"\n" -"or_pattern[pattern_ty]:\n" -" | patterns[asdl_pattern_seq*]='|'.closed_pattern+ {\n" -" asdl_seq_LEN(patterns) == 1 ? asdl_seq_GET(patterns, 0) : _PyAST_MatchOr(patterns, EXTRA) }\n" -"\n" -"closed_pattern[pattern_ty] (memo):\n" -" | literal_pattern\n" -" | capture_pattern\n" -" | wildcard_pattern\n" -" | value_pattern\n" -" | group_pattern\n" -" | sequence_pattern\n" -" | mapping_pattern\n" -" | class_pattern\n" -"\n" -"# Literal patterns are used for equality and identity constraints\n" -"literal_pattern[pattern_ty]:\n" -" | value=signed_number !('+' | '-') { _PyAST_MatchValue(value, EXTRA) }\n" -" | value=complex_number { _PyAST_MatchValue(value, EXTRA) }\n" -" | value=strings { _PyAST_MatchValue(value, EXTRA) }\n" -" | 'None' { _PyAST_MatchSingleton(Py_None, EXTRA) }\n" -" | 'True' { _PyAST_MatchSingleton(Py_True, EXTRA) }\n" -" | 'False' { _PyAST_MatchSingleton(Py_False, EXTRA) }\n" -"\n" -"# Literal expressions are used to restrict permitted mapping pattern keys\n" -"literal_expr[expr_ty]:\n" -" | signed_number !('+' | '-')\n" -" | complex_number\n" -" | &(STRING|FSTRING_START|TSTRING_START) strings\n" -" | 'None' { _PyAST_Constant(Py_None, NULL, EXTRA) }\n" -" | 'True' { _PyAST_Constant(Py_True, NULL, EXTRA) }\n" -" | 'False' { _PyAST_Constant(Py_False, NULL, EXTRA) }\n" -"\n" -"complex_number[expr_ty]:\n" -" | real=signed_real_number '+' imag=imaginary_number {\n" -" _PyAST_BinOp(real, Add, imag, EXTRA) }\n" -" | real=signed_real_number '-' imag=imaginary_number {\n" -" _PyAST_BinOp(real, Sub, imag, EXTRA) }\n" -"\n" -"signed_number[expr_ty]:\n" -" | NUMBER\n" -" | '-' number=NUMBER { _PyAST_UnaryOp(USub, number, EXTRA) }\n" -"\n" -"signed_real_number[expr_ty]:\n" -" | real_number\n" -" | '-' real=real_number { _PyAST_UnaryOp(USub, real, EXTRA) }\n" -"\n" -"real_number[expr_ty]:\n" -" | real=NUMBER { _PyPegen_ensure_real(p, real) }\n" -"\n" -"imaginary_number[expr_ty]:\n" -" | imag=NUMBER { _PyPegen_ensure_imaginary(p, imag) }\n" -"\n" -"capture_pattern[pattern_ty]:\n" -" | target=pattern_capture_target { _PyAST_MatchAs(NULL, target->v.Name.id, EXTRA) }\n" -"\n" -"pattern_capture_target[expr_ty]:\n" -" | !\"_\" name=NAME !('.' | '(' | '=') {\n" -" _PyPegen_set_expr_context(p, name, Store) }\n" -"\n" -"wildcard_pattern[pattern_ty]:\n" -" | \"_\" { _PyAST_MatchAs(NULL, NULL, EXTRA) }\n" -"\n" -"value_pattern[pattern_ty]:\n" -" | attr=attr !('.' | '(' | '=') { _PyAST_MatchValue(attr, EXTRA) }\n" -"\n" -"attr[expr_ty]:\n" -" | value=name_or_attr '.' attr=NAME {\n" -" _PyAST_Attribute(value, attr->v.Name.id, Load, EXTRA) }\n" -"\n" -"name_or_attr[expr_ty]:\n" -" | attr\n" -" | NAME\n" -"\n" -"group_pattern[pattern_ty]:\n" -" | '(' pattern=pattern ')' { pattern }\n" -"\n" -"sequence_pattern[pattern_ty]:\n" -" | '[' patterns=maybe_sequence_pattern? ']' { _PyAST_MatchSequence(patterns, EXTRA) }\n" -" | '(' patterns=open_sequence_pattern? ')' { _PyAST_MatchSequence(patterns, EXTRA) }\n" -"\n" -"open_sequence_pattern[asdl_seq*]:\n" -" | pattern=maybe_star_pattern ',' patterns=maybe_sequence_pattern? {\n" -" _PyPegen_seq_insert_in_front(p, pattern, patterns) }\n" -"\n" -"maybe_sequence_pattern[asdl_seq*]:\n" -" | patterns=','.maybe_star_pattern+ ','? { patterns }\n" -"\n" -"maybe_star_pattern[pattern_ty]:\n" -" | star_pattern\n" -" | pattern\n" -"\n" -"star_pattern[pattern_ty] (memo):\n" -" | '*' target=pattern_capture_target {\n" -" _PyAST_MatchStar(target->v.Name.id, EXTRA) }\n" -" | '*' wildcard_pattern {\n" -" _PyAST_MatchStar(NULL, EXTRA) }\n" -"\n" -"mapping_pattern[pattern_ty]:\n" -" | '{' '}' {\n" -" _PyAST_MatchMapping(NULL, NULL, NULL, EXTRA) }\n" -" | '{' rest=double_star_pattern ','? '}' {\n" -" _PyAST_MatchMapping(NULL, NULL, rest->v.Name.id, EXTRA) }\n" -" | '{' items=items_pattern ',' rest=double_star_pattern ','? '}' {\n" -" _PyAST_MatchMapping(\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_pattern_keys(p, items)),\n" -" CHECK(asdl_pattern_seq*, _PyPegen_get_patterns(p, items)),\n" -" rest->v.Name.id,\n" -" EXTRA) }\n" -" | '{' items=items_pattern ','? '}' {\n" -" _PyAST_MatchMapping(\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_pattern_keys(p, items)),\n" -" CHECK(asdl_pattern_seq*, _PyPegen_get_patterns(p, items)),\n" -" NULL,\n" -" EXTRA) }\n" -"\n" -"items_pattern[asdl_seq*]:\n" -" | ','.key_value_pattern+\n" -"\n" -"key_value_pattern[KeyPatternPair*]:\n" -" | key=(literal_expr | attr) ':' pattern=pattern {\n" -" _PyPegen_key_pattern_pair(p, key, pattern) }\n" -"\n" -"double_star_pattern[expr_ty]:\n" -" | '**' target=pattern_capture_target { target }\n" -"\n" -"class_pattern[pattern_ty]:\n" -" | cls=name_or_attr '(' ')' {\n" -" _PyAST_MatchClass(cls, NULL, NULL, NULL, EXTRA) }\n" -" | cls=name_or_attr '(' patterns=positional_patterns ','? ')' {\n" -" _PyAST_MatchClass(cls, patterns, NULL, NULL, EXTRA) }\n" -" | cls=name_or_attr '(' keywords=keyword_patterns ','? ')' {\n" -" _PyAST_MatchClass(\n" -" cls, NULL,\n" -" CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p,\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_pattern_keys(p, keywords)))),\n" -" CHECK(asdl_pattern_seq*, _PyPegen_get_patterns(p, keywords)),\n" -" EXTRA) }\n" -" | cls=name_or_attr '(' patterns=positional_patterns ',' keywords=keyword_patterns ','? ')' {\n" -" _PyAST_MatchClass(\n" -" cls,\n" -" patterns,\n" -" CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p,\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_pattern_keys(p, keywords)))),\n" -" CHECK(asdl_pattern_seq*, _PyPegen_get_patterns(p, keywords)),\n" -" EXTRA) }\n" -" | invalid_class_pattern\n" -"\n" -"positional_patterns[asdl_pattern_seq*]:\n" -" | args[asdl_pattern_seq*]=','.pattern+ { args }\n" -"\n" -"keyword_patterns[asdl_seq*]:\n" -" | ','.keyword_pattern+\n" -"\n" -"keyword_pattern[KeyPatternPair*]:\n" -" | arg=NAME '=' value=pattern { _PyPegen_key_pattern_pair(p, arg, value) }\n" -"\n" -"# Type statement\n" -"# ---------------\n" -"\n" -"type_alias[stmt_ty]:\n" -" | \"type\" n=NAME t=[type_params] '=' b=expression {\n" -" CHECK_VERSION(stmt_ty, 12, \"Type statement is\",\n" -" _PyAST_TypeAlias(CHECK(expr_ty, _PyPegen_set_expr_context(p, n, Store)), t, b, EXTRA)) }\n" -"\n" -"# Type parameter declaration\n" -"# --------------------------\n" -"\n" -"type_params[asdl_type_param_seq*]:\n" -" | invalid_type_params\n" -" | '[' t=type_param_seq ']' {\n" -" CHECK_VERSION(asdl_type_param_seq *, 12, \"Type parameter lists are\", t) }\n" -"\n" -"type_param_seq[asdl_type_param_seq*]: a[asdl_type_param_seq*]=','.type_param+ [','] { a }\n" -"\n" -"type_param[type_param_ty] (memo):\n" -" | a=NAME b=[type_param_bound] c=[type_param_default] { _PyAST_TypeVar(a->v.Name.id, b, c, EXTRA) }\n" -" | invalid_type_param\n" -" | '*' a=NAME b=[type_param_starred_default] { _PyAST_TypeVarTuple(a->v.Name.id, b, EXTRA) }\n" -" | '**' a=NAME b=[type_param_default] { _PyAST_ParamSpec(a->v.Name.id, b, EXTRA) }\n" -"\n" -"type_param_bound[expr_ty]: ':' e=expression { e }\n" -"type_param_default[expr_ty]: '=' e=expression {\n" -" CHECK_VERSION(expr_ty, 13, \"Type parameter defaults are\", e) }\n" -"type_param_starred_default[expr_ty]: '=' e=star_expression {\n" -" CHECK_VERSION(expr_ty, 13, \"Type parameter defaults are\", e) }\n" -"\n" -"# EXPRESSIONS\n" -"# -----------\n" -"\n" -"expressions[expr_ty]:\n" -" | a=expression b=(',' c=expression { c })+ [','] {\n" -" _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) }\n" -" | a=expression ',' { _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) }\n" -" | expression\n" -"\n" -"expression[expr_ty] (memo):\n" -" | invalid_expression\n" -" | invalid_legacy_expression\n" -" | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) }\n" -" | disjunction\n" -" | lambdef\n" -"\n" -"yield_expr[expr_ty]:\n" -" | 'yield' 'from' a=expression { _PyAST_YieldFrom(a, EXTRA) }\n" -" | 'yield' a=[star_expressions] { _PyAST_Yield(a, EXTRA) }\n" -"\n" -"star_expressions[expr_ty]:\n" -" | a=star_expression b=(',' c=star_expression { c })+ [','] {\n" -" _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) }\n" -" | a=star_expression ',' { _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) }\n" -" | star_expression\n" -"\n" -"star_expression[expr_ty] (memo):\n" -" | '*' a=bitwise_or { _PyAST_Starred(a, Load, EXTRA) }\n" -" | expression\n" -"\n" -"star_named_expressions[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_named_expression+ [','] { a }\n" -"\n" -"star_named_expression[expr_ty]:\n" -" | '*' a=bitwise_or { _PyAST_Starred(a, Load, EXTRA) }\n" -" | named_expression\n" -"\n" -"assignment_expression[expr_ty]:\n" -" | a=NAME ':=' ~ b=expression {\n" -" CHECK_VERSION(expr_ty, 8, \"Assignment expressions are\",\n" -" _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA)) }\n" -"\n" -"named_expression[expr_ty]:\n" -" | assignment_expression\n" -" | invalid_named_expression\n" -" | expression !':='\n" -"\n" -"disjunction[expr_ty] (memo):\n" -" | a=conjunction b=('or' c=conjunction { c })+ { _PyAST_BoolOp(\n" -" Or,\n" -" CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)),\n" -" EXTRA) }\n" -" | conjunction\n" -"\n" -"conjunction[expr_ty] (memo):\n" -" | a=inversion b=('and' c=inversion { c })+ { _PyAST_BoolOp(\n" -" And,\n" -" CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)),\n" -" EXTRA) }\n" -" | inversion\n" -"\n" -"inversion[expr_ty] (memo):\n" -" | 'not' a=inversion { _PyAST_UnaryOp(Not, a, EXTRA) }\n" -" | comparison\n" -"\n" -"# Comparison operators\n" -"# --------------------\n" -"\n" -"comparison[expr_ty]:\n" -" | a=bitwise_or b=compare_op_bitwise_or_pair+ {\n" -" _PyAST_Compare(\n" -" a,\n" -" CHECK(asdl_int_seq*, _PyPegen_get_cmpops(p, b)),\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_exprs(p, b)),\n" -" EXTRA) }\n" -" | bitwise_or\n" -"\n" -"compare_op_bitwise_or_pair[CmpopExprPair*]:\n" -" | eq_bitwise_or\n" -" | noteq_bitwise_or\n" -" | lte_bitwise_or\n" -" | lt_bitwise_or\n" -" | gte_bitwise_or\n" -" | gt_bitwise_or\n" -" | notin_bitwise_or\n" -" | in_bitwise_or\n" -" | isnot_bitwise_or\n" -" | is_bitwise_or\n" -"\n" -"eq_bitwise_or[CmpopExprPair*]: '==' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Eq, a) }\n" -"noteq_bitwise_or[CmpopExprPair*]:\n" -" | (tok='!=' { _PyPegen_check_barry_as_flufl(p, tok) ? NULL : tok}) a=bitwise_or {_PyPegen_cmpop_expr_pair(p, NotEq, a) }\n" -"lte_bitwise_or[CmpopExprPair*]: '<=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, LtE, a) }\n" -"lt_bitwise_or[CmpopExprPair*]: '<' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Lt, a) }\n" -"gte_bitwise_or[CmpopExprPair*]: '>=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, GtE, a) }\n" -"gt_bitwise_or[CmpopExprPair*]: '>' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Gt, a) }\n" -"notin_bitwise_or[CmpopExprPair*]: 'not' 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, NotIn, a) }\n" -"in_bitwise_or[CmpopExprPair*]: 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, In, a) }\n" -"isnot_bitwise_or[CmpopExprPair*]: 'is' 'not' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, IsNot, a) }\n" -"is_bitwise_or[CmpopExprPair*]: 'is' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Is, a) }\n" -"\n" -"# Bitwise operators\n" -"# -----------------\n" -"\n" -"bitwise_or[expr_ty]:\n" -" | a=bitwise_or '|' b=bitwise_xor { _PyAST_BinOp(a, BitOr, b, EXTRA) }\n" -" | bitwise_xor\n" -"\n" -"bitwise_xor[expr_ty]:\n" -" | a=bitwise_xor '^' b=bitwise_and { _PyAST_BinOp(a, BitXor, b, EXTRA) }\n" -" | bitwise_and\n" -"\n" -"bitwise_and[expr_ty]:\n" -" | a=bitwise_and '&' b=shift_expr { _PyAST_BinOp(a, BitAnd, b, EXTRA) }\n" -" | shift_expr\n" -"\n" -"shift_expr[expr_ty]:\n" -" | a=shift_expr '<<' b=sum { _PyAST_BinOp(a, LShift, b, EXTRA) }\n" -" | a=shift_expr '>>' b=sum { _PyAST_BinOp(a, RShift, b, EXTRA) }\n" -" | invalid_arithmetic\n" -" | sum\n" -"\n" -"# Arithmetic operators\n" -"# --------------------\n" -"\n" -"sum[expr_ty]:\n" -" | a=sum '+' b=term { _PyAST_BinOp(a, Add, b, EXTRA) }\n" -" | a=sum '-' b=term { _PyAST_BinOp(a, Sub, b, EXTRA) }\n" -" | term\n" -"\n" -"term[expr_ty]:\n" -" | a=term '*' b=factor { _PyAST_BinOp(a, Mult, b, EXTRA) }\n" -" | a=term '/' b=factor { _PyAST_BinOp(a, Div, b, EXTRA) }\n" -" | a=term '//' b=factor { _PyAST_BinOp(a, FloorDiv, b, EXTRA) }\n" -" | a=term '%' b=factor { _PyAST_BinOp(a, Mod, b, EXTRA) }\n" -" | a=term '@' b=factor { CHECK_VERSION(expr_ty, 5, \"The '@' operator is\", _PyAST_BinOp(a, MatMult, b, EXTRA)) }\n" -" | invalid_factor\n" -" | factor\n" -"\n" -"factor[expr_ty] (memo):\n" -" | '+' a=factor { _PyAST_UnaryOp(UAdd, a, EXTRA) }\n" -" | '-' a=factor { _PyAST_UnaryOp(USub, a, EXTRA) }\n" -" | '~' a=factor { _PyAST_UnaryOp(Invert, a, EXTRA) }\n" -" | power\n" -"\n" -"power[expr_ty]:\n" -" | a=await_primary '**' b=factor { _PyAST_BinOp(a, Pow, b, EXTRA) }\n" -" | await_primary\n" -"\n" -"# Primary elements\n" -"# ----------------\n" -"\n" -"# Primary elements are things like \"obj.something.something\", \"obj[something]\", \"obj(something)\", \"obj\" ...\n" -"\n" -"await_primary[expr_ty] (memo):\n" -" | 'await' a=primary { CHECK_VERSION(expr_ty, 5, \"Await expressions are\", _PyAST_Await(a, EXTRA)) }\n" -" | primary\n" -"\n" -"primary[expr_ty]:\n" -" | a=primary '.' b=NAME { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) }\n" -" | a=primary b=genexp { _PyAST_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) }\n" -" | a=primary '(' b=[arguments] ')' {\n" -" _PyAST_Call(a,\n" -" (b) ? ((expr_ty) b)->v.Call.args : NULL,\n" -" (b) ? ((expr_ty) b)->v.Call.keywords : NULL,\n" -" EXTRA) }\n" -" | a=primary '[' b=slices ']' { _PyAST_Subscript(a, b, Load, EXTRA) }\n" -" | atom\n" -"\n" -"slices[expr_ty]:\n" -" | a=slice !',' { a }\n" -" | a[asdl_expr_seq*]=','.(slice | starred_expression)+ [','] { _PyAST_Tuple(a, Load, EXTRA) }\n" -"\n" -"slice[expr_ty]:\n" -" | a=[expression] ':' b=[expression] c=[':' d=[expression] { d }] { _PyAST_Slice(a, b, c, EXTRA) }\n" -" | a=named_expression { a }\n" -"\n" -"atom[expr_ty]:\n" -" | NAME\n" -" | 'True' { _PyAST_Constant(Py_True, NULL, EXTRA) }\n" -" | 'False' { _PyAST_Constant(Py_False, NULL, EXTRA) }\n" -" | 'None' { _PyAST_Constant(Py_None, NULL, EXTRA) }\n" -" | &(STRING|FSTRING_START|TSTRING_START) strings\n" -" | NUMBER\n" -" | &'(' (tuple | group | genexp)\n" -" | &'[' (list | listcomp)\n" -" | &'{' (dict | set | dictcomp | setcomp)\n" -" | '...' { _PyAST_Constant(Py_Ellipsis, NULL, EXTRA) }\n" -"\n" -"group[expr_ty]:\n" -" | '(' a=(yield_expr | named_expression) ')' { a }\n" -" | invalid_group\n" -"\n" -"# Lambda functions\n" -"# ----------------\n" -"\n" -"lambdef[expr_ty]:\n" -" | 'lambda' a=[lambda_params] ':' b=expression {\n" -" _PyAST_Lambda((a) ? a : CHECK(arguments_ty, _PyPegen_empty_arguments(p)), b, EXTRA) }\n" -"\n" -"lambda_params[arguments_ty]:\n" -" | invalid_lambda_parameters\n" -" | lambda_parameters\n" -"\n" -"# lambda_parameters etc. duplicates parameters but without annotations\n" -"# or type comments, and if there's no comma after a parameter, we expect\n" -"# a colon, not a close parenthesis. (For more, see parameters above.)\n" -"#\n" -"lambda_parameters[arguments_ty]:\n" -" | a=lambda_slash_no_default b[asdl_arg_seq*]=lambda_param_no_default* c=lambda_param_with_default* d=[lambda_star_etc] {\n" -" CHECK_VERSION(arguments_ty, 8, \"Positional-only parameters are\", _PyPegen_make_arguments(p, a, NULL, b, c, d)) }\n" -" | a=lambda_slash_with_default b=lambda_param_with_default* c=[lambda_star_etc] {\n" -" CHECK_VERSION(arguments_ty, 8, \"Positional-only parameters are\", _PyPegen_make_arguments(p, NULL, a, NULL, b, c)) }\n" -" | a[asdl_arg_seq*]=lambda_param_no_default+ b=lambda_param_with_default* c=[lambda_star_etc] {\n" -" _PyPegen_make_arguments(p, NULL, NULL, a, b, c) }\n" -" | a=lambda_param_with_default+ b=[lambda_star_etc] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)}\n" -" | a=lambda_star_etc { _PyPegen_make_arguments(p, NULL, NULL, NULL, NULL, a) }\n" -"\n" -"lambda_slash_no_default[asdl_arg_seq*]:\n" -" | a[asdl_arg_seq*]=lambda_param_no_default+ '/' ',' { a }\n" -" | a[asdl_arg_seq*]=lambda_param_no_default+ '/' &':' { a }\n" -"\n" -"lambda_slash_with_default[SlashWithDefault*]:\n" -" | a=lambda_param_no_default* b=lambda_param_with_default+ '/' ',' { _PyPegen_slash_with_default(p, (asdl_arg_seq *)a, b) }\n" -" | a=lambda_param_no_default* b=lambda_param_with_default+ '/' &':' { _PyPegen_slash_with_default(p, (asdl_arg_seq *)a, b) }\n" -"\n" -"lambda_star_etc[StarEtc*]:\n" -" | invalid_lambda_star_etc\n" -" | '*' a=lambda_param_no_default b=lambda_param_maybe_default* c=[lambda_kwds] {\n" -" _PyPegen_star_etc(p, a, b, c) }\n" -" | '*' ',' b=lambda_param_maybe_default+ c=[lambda_kwds] {\n" -" _PyPegen_star_etc(p, NULL, b, c) }\n" -" | a=lambda_kwds { _PyPegen_star_etc(p, NULL, NULL, a) }\n" -"\n" -"lambda_kwds[arg_ty]:\n" -" | invalid_lambda_kwds\n" -" | '**' a=lambda_param_no_default { a }\n" -"\n" -"lambda_param_no_default[arg_ty]:\n" -" | a=lambda_param ',' { a }\n" -" | a=lambda_param &':' { a }\n" -"lambda_param_with_default[NameDefaultPair*]:\n" -" | a=lambda_param c=default ',' { _PyPegen_name_default_pair(p, a, c, NULL) }\n" -" | a=lambda_param c=default &':' { _PyPegen_name_default_pair(p, a, c, NULL) }\n" -"lambda_param_maybe_default[NameDefaultPair*]:\n" -" | a=lambda_param c=default? ',' { _PyPegen_name_default_pair(p, a, c, NULL) }\n" -" | a=lambda_param c=default? &':' { _PyPegen_name_default_pair(p, a, c, NULL) }\n" -"lambda_param[arg_ty]: a=NAME { _PyAST_arg(a->v.Name.id, NULL, NULL, EXTRA) }\n" -"\n" -"# LITERALS\n" -"# ========\n" -"\n" -"fstring_middle[expr_ty]:\n" -" | fstring_replacement_field\n" -" | t=FSTRING_MIDDLE { _PyPegen_constant_from_token(p, t) }\n" -"fstring_replacement_field[expr_ty]:\n" -" | '{' a=annotated_rhs debug_expr='='? conversion=[fstring_conversion] format=[fstring_full_format_spec] rbrace='}' {\n" -" _PyPegen_formatted_value(p, a, debug_expr, conversion, format, rbrace, EXTRA) }\n" -" | invalid_fstring_replacement_field\n" -"fstring_conversion[ResultTokenWithMetadata*]:\n" -" | conv_token=\"!\" conv=NAME { _PyPegen_check_fstring_conversion(p, conv_token, conv) }\n" -"fstring_full_format_spec[ResultTokenWithMetadata*]:\n" -" | colon=':' spec=fstring_format_spec* { _PyPegen_setup_full_format_spec(p, colon, (asdl_expr_seq *) spec, EXTRA) }\n" -"fstring_format_spec[expr_ty]:\n" -" | t=FSTRING_MIDDLE { _PyPegen_decoded_constant_from_token(p, t) }\n" -" | fstring_replacement_field\n" -"fstring[expr_ty]:\n" -" | a=FSTRING_START b=fstring_middle* c=FSTRING_END { _PyPegen_joined_str(p, a, (asdl_expr_seq*)b, c) }\n" -"\n" -"tstring_format_spec_replacement_field[expr_ty]:\n" -" | '{' a=annotated_rhs debug_expr='='? conversion=[fstring_conversion] format=[tstring_full_format_spec] rbrace='}' {\n" -" _PyPegen_formatted_value(p, a, debug_expr, conversion, format, rbrace, EXTRA) }\n" -" | invalid_tstring_replacement_field\n" -"tstring_format_spec[expr_ty]:\n" -" | t=TSTRING_MIDDLE { _PyPegen_decoded_constant_from_token(p, t) }\n" -" | tstring_format_spec_replacement_field\n" -"tstring_full_format_spec[ResultTokenWithMetadata*]:\n" -" | colon=':' spec=tstring_format_spec* { _PyPegen_setup_full_format_spec(p, colon, (asdl_expr_seq *) spec, EXTRA) }\n" -"tstring_replacement_field[expr_ty]:\n" -" | '{' a=annotated_rhs debug_expr='='? conversion=[fstring_conversion] format=[tstring_full_format_spec] rbrace='}' {\n" -" _PyPegen_interpolation(p, a, debug_expr, conversion, format, rbrace, EXTRA) }\n" -" | invalid_tstring_replacement_field\n" -"tstring_middle[expr_ty]:\n" -" | tstring_replacement_field\n" -" | t=TSTRING_MIDDLE { _PyPegen_constant_from_token(p, t) }\n" -"tstring[expr_ty] (memo):\n" -" | a=TSTRING_START b=tstring_middle* c=TSTRING_END {\n" -" CHECK_VERSION(\n" -" expr_ty,\n" -" 14,\n" -" \"t-strings are\",\n" -" _PyPegen_template_str(p, a, (asdl_expr_seq*)b, c)) }\n" -"\n" -"string[expr_ty]: s[Token*]=STRING { _PyPegen_constant_from_string(p, s) }\n" -"strings[expr_ty] (memo):\n" -" | invalid_string_tstring_concat\n" -" | a[asdl_expr_seq*]=(fstring|string)+ { _PyPegen_concatenate_strings(p, a, EXTRA) }\n" -" | a[asdl_expr_seq*]=tstring+ { _PyPegen_concatenate_tstrings(p, a, EXTRA) }\n" -"\n" -"list[expr_ty]:\n" -" | '[' a=[star_named_expressions] ']' { _PyAST_List(a, Load, EXTRA) }\n" -"\n" -"tuple[expr_ty]:\n" -" | '(' a=[y=star_named_expression ',' z=[star_named_expressions] { _PyPegen_seq_insert_in_front(p, y, z) } ] ')' {\n" -" _PyAST_Tuple(a, Load, EXTRA) }\n" -"\n" -"set[expr_ty]: '{' a=star_named_expressions '}' { _PyAST_Set(a, EXTRA) }\n" -"\n" -"# Dicts\n" -"# -----\n" -"\n" -"dict[expr_ty]:\n" -" | '{' a=[double_starred_kvpairs] '}' {\n" -" _PyAST_Dict(\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_keys(p, a)),\n" -" CHECK(asdl_expr_seq*, _PyPegen_get_values(p, a)),\n" -" EXTRA) }\n" -" | '{' invalid_double_starred_kvpairs '}'\n" -"\n" -"double_starred_kvpairs[asdl_seq*]: a=','.double_starred_kvpair+ [','] { a }\n" -"\n" -"double_starred_kvpair[KeyValuePair*]:\n" -" | '**' a=bitwise_or { _PyPegen_key_value_pair(p, NULL, a) }\n" -" | kvpair\n" -"\n" -"kvpair[KeyValuePair*]: a=expression ':' b=expression { _PyPegen_key_value_pair(p, a, b) }\n" -"\n" -"# Comprehensions & Generators\n" -"# ---------------------------\n" -"\n" -"for_if_clauses[asdl_comprehension_seq*]:\n" -" | a[asdl_comprehension_seq*]=for_if_clause+ { a }\n" -"\n" -"for_if_clause[comprehension_ty]:\n" -" | 'async' 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* {\n" -" CHECK_VERSION(comprehension_ty, 6, \"Async comprehensions are\", _PyAST_comprehension(a, b, c, 1, p->arena)) }\n" -" | 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* {\n" -" _PyAST_comprehension(a, b, c, 0, p->arena) }\n" -" | invalid_for_if_clause\n" -" | invalid_for_target\n" -"\n" -"listcomp[expr_ty]:\n" -" | '[' a=named_expression b=for_if_clauses ']' { _PyAST_ListComp(a, b, EXTRA) }\n" -" | invalid_comprehension\n" -"\n" -"setcomp[expr_ty]:\n" -" | '{' a=named_expression b=for_if_clauses '}' { _PyAST_SetComp(a, b, EXTRA) }\n" -" | invalid_comprehension\n" -"\n" -"genexp[expr_ty]:\n" -" | '(' a=( assignment_expression | expression !':=') b=for_if_clauses ')' { _PyAST_GeneratorExp(a, b, EXTRA) }\n" -" | invalid_comprehension\n" -"\n" -"dictcomp[expr_ty]:\n" -" | '{' a=kvpair b=for_if_clauses '}' { _PyAST_DictComp(a->key, a->value, b, EXTRA) }\n" -" | invalid_dict_comprehension\n" -"\n" -"# FUNCTION CALL ARGUMENTS\n" -"# =======================\n" -"\n" -"arguments[expr_ty] (memo):\n" -" | a=args [','] &')' { a }\n" -" | invalid_arguments\n" -"\n" -"args[expr_ty]:\n" -" | a[asdl_expr_seq*]=','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ b=[',' k=kwargs {k}] {\n" -" _PyPegen_collect_call_seqs(p, a, b, EXTRA) }\n" -" | a=kwargs { _PyAST_Call(_PyPegen_dummy_name(p),\n" -" CHECK_NULL_ALLOWED(asdl_expr_seq*, _PyPegen_seq_extract_starred_exprs(p, a)),\n" -" CHECK_NULL_ALLOWED(asdl_keyword_seq*, _PyPegen_seq_delete_starred_exprs(p, a)),\n" -" EXTRA) }\n" -"\n" -"kwargs[asdl_seq*]:\n" -" | a=','.kwarg_or_starred+ ',' b=','.kwarg_or_double_starred+ { _PyPegen_join_sequences(p, a, b) }\n" -" | ','.kwarg_or_starred+\n" -" | ','.kwarg_or_double_starred+\n" -"\n" -"starred_expression[expr_ty]:\n" -" | invalid_starred_expression_unpacking\n" -" | '*' a=expression { _PyAST_Starred(a, Load, EXTRA) }\n" -" | invalid_starred_expression\n" -"\n" -"kwarg_or_starred[KeywordOrStarred*]:\n" -" | invalid_kwarg\n" -" | a=NAME '=' b=expression {\n" -" _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(a->v.Name.id, b, EXTRA)), 1) }\n" -" | a=starred_expression { _PyPegen_keyword_or_starred(p, a, 0) }\n" -"\n" -"kwarg_or_double_starred[KeywordOrStarred*]:\n" -" | invalid_kwarg\n" -" | a=NAME '=' b=expression {\n" -" _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(a->v.Name.id, b, EXTRA)), 1) }\n" -" | '**' a=expression { _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(NULL, a, EXTRA)), 1) }\n" -"\n" -"# ASSIGNMENT TARGETS\n" -"# ==================\n" -"\n" -"# Generic targets\n" -"# ---------------\n" -"\n" -"# NOTE: star_targets may contain *bitwise_or, targets may not.\n" -"star_targets[expr_ty]:\n" -" | a=star_target !',' { a }\n" -" | a=star_target b=(',' c=star_target { c })* [','] {\n" -" _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Store, EXTRA) }\n" -"\n" -"star_targets_list_seq[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_target+ [','] { a }\n" -"\n" -"star_targets_tuple_seq[asdl_expr_seq*]:\n" -" | a=star_target b=(',' c=star_target { c })+ [','] { (asdl_expr_seq*) _PyPegen_seq_insert_in_front(p, a, b) }\n" -" | a=star_target ',' { (asdl_expr_seq*) _PyPegen_singleton_seq(p, a) }\n" -"\n" -"star_target[expr_ty] (memo):\n" -" | '*' a=(!'*' star_target) {\n" -" _PyAST_Starred(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), Store, EXTRA) }\n" -" | target_with_star_atom\n" -"\n" -"target_with_star_atom[expr_ty] (memo):\n" -" | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) }\n" -" | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) }\n" -" | star_atom\n" -"\n" -"star_atom[expr_ty]:\n" -" | a=NAME { _PyPegen_set_expr_context(p, a, Store) }\n" -" | '(' a=target_with_star_atom ')' { _PyPegen_set_expr_context(p, a, Store) }\n" -" | '(' a=[star_targets_tuple_seq] ')' { _PyAST_Tuple(a, Store, EXTRA) }\n" -" | '[' a=[star_targets_list_seq] ']' { _PyAST_List(a, Store, EXTRA) }\n" -"\n" -"single_target[expr_ty]:\n" -" | single_subscript_attribute_target\n" -" | a=NAME { _PyPegen_set_expr_context(p, a, Store) }\n" -" | '(' a=single_target ')' { a }\n" -"\n" -"single_subscript_attribute_target[expr_ty]:\n" -" | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) }\n" -" | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) }\n" -"\n" -"t_primary[expr_ty]:\n" -" | a=t_primary '.' b=NAME &t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) }\n" -" | a=t_primary '[' b=slices ']' &t_lookahead { _PyAST_Subscript(a, b, Load, EXTRA) }\n" -" | a=t_primary b=genexp &t_lookahead {\n" -" _PyAST_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) }\n" -" | a=t_primary '(' b=[arguments] ')' &t_lookahead {\n" -" _PyAST_Call(a,\n" -" (b) ? ((expr_ty) b)->v.Call.args : NULL,\n" -" (b) ? ((expr_ty) b)->v.Call.keywords : NULL,\n" -" EXTRA) }\n" -" | a=atom &t_lookahead { a }\n" -"\n" -"t_lookahead: '(' | '[' | '.'\n" -"\n" -"# Targets for del statements\n" -"# --------------------------\n" -"\n" -"del_targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.del_target+ [','] { a }\n" -"\n" -"del_target[expr_ty] (memo):\n" -" | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Del, EXTRA) }\n" -" | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Del, EXTRA) }\n" -" | del_t_atom\n" -"\n" -"del_t_atom[expr_ty]:\n" -" | a=NAME { _PyPegen_set_expr_context(p, a, Del) }\n" -" | '(' a=del_target ')' { _PyPegen_set_expr_context(p, a, Del) }\n" -" | '(' a=[del_targets] ')' { _PyAST_Tuple(a, Del, EXTRA) }\n" -" | '[' a=[del_targets] ']' { _PyAST_List(a, Del, EXTRA) }\n" -"\n" -"# TYPING ELEMENTS\n" -"# ---------------\n" -"\n" -"# type_expressions allow */** but ignore them\n" -"type_expressions[asdl_expr_seq*]:\n" -" | a=','.expression+ ',' '*' b=expression ',' '**' c=expression {\n" -" (asdl_expr_seq*)_PyPegen_seq_append_to_end(\n" -" p,\n" -" CHECK(asdl_seq*, _PyPegen_seq_append_to_end(p, a, b)),\n" -" c) }\n" -" | a=','.expression+ ',' '*' b=expression { (asdl_expr_seq*)_PyPegen_seq_append_to_end(p, a, b) }\n" -" | a=','.expression+ ',' '**' b=expression { (asdl_expr_seq*)_PyPegen_seq_append_to_end(p, a, b) }\n" -" | '*' a=expression ',' '**' b=expression {\n" -" (asdl_expr_seq*)_PyPegen_seq_append_to_end(\n" -" p,\n" -" CHECK(asdl_seq*, _PyPegen_singleton_seq(p, a)),\n" -" b) }\n" -" | '*' a=expression { (asdl_expr_seq*)_PyPegen_singleton_seq(p, a) }\n" -" | '**' a=expression { (asdl_expr_seq*)_PyPegen_singleton_seq(p, a) }\n" -" | a[asdl_expr_seq*]=','.expression+ {a}\n" -"\n" -"func_type_comment[Token*]:\n" -" | NEWLINE t=TYPE_COMMENT &(NEWLINE INDENT) { t } # Must be followed by indented block\n" -" | invalid_double_type_comments\n" -" | TYPE_COMMENT\n" -"\n" -"# ========================= END OF THE GRAMMAR ===========================\n" -"\n" -"\n" -"\n" -"# ========================= START OF INVALID RULES =======================\n" -"\n" -"# From here on, there are rules for invalid syntax with specialised error messages\n" -"invalid_arguments:\n" -" | ((','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) a=',' ','.(starred_expression !'=')+ {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"iterable argument unpacking follows keyword argument unpacking\") }\n" -" | a=expression b=for_if_clauses ',' [args | expression for_if_clauses] {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, _PyPegen_get_last_comprehension_item(PyPegen_last_item(b, comprehension_ty)), \"Generator expression must be parenthesized\") }\n" -" | a=NAME b='=' expression for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"invalid syntax. Maybe you meant '==' or ':=' instead of '='?\")}\n" -" | (args ',')? a=NAME b='=' &(',' | ')') {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"expected argument value expression\")}\n" -" | a=args b=for_if_clauses { _PyPegen_nonparen_genexp_in_call(p, a, b) }\n" -" | args ',' a=expression b=for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, _PyPegen_get_last_comprehension_item(PyPegen_last_item(b, comprehension_ty)), \"Generator expression must be parenthesized\") }\n" -" | a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }\n" -"invalid_kwarg:\n" -" | a[Token*]=('True'|'False'|'None') b='=' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"cannot assign to %s\", PyBytes_AS_STRING(a->bytes)) }\n" -" | a=NAME b='=' expression for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"invalid syntax. Maybe you meant '==' or ':=' instead of '='?\")}\n" -" | !(NAME '=') a=expression b='=' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(\n" -" a, b, \"expression cannot contain assignment, perhaps you meant \\\"==\\\"?\") }\n" -" | a='**' expression '=' b=expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"cannot assign to keyword argument unpacking\") }\n" -"\n" -"# IMPORTANT: Note that the \"_without_invalid\" suffix causes the rule to not call invalid rules under it\n" -"expression_without_invalid[expr_ty]:\n" -" | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) }\n" -" | disjunction\n" -" | lambdef\n" -"invalid_legacy_expression:\n" -" | a=NAME !'(' b=star_expressions {\n" -" _PyPegen_check_legacy_stmt(p, a) ? RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b,\n" -" \"Missing parentheses in call to '%U'. Did you mean %U(...)?\", a->v.Name.id, a->v.Name.id) : NULL}\n" -"\n" -"invalid_type_param:\n" -" | '*' a=NAME colon=':' e=expression {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind\n" -" ? \"cannot use constraints with TypeVarTuple\"\n" -" : \"cannot use bound with TypeVarTuple\")\n" -" }\n" -" | '**' a=NAME colon=':' e=expression {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(colon, e->kind == Tuple_kind\n" -" ? \"cannot use constraints with ParamSpec\"\n" -" : \"cannot use bound with ParamSpec\")\n" -" }\n" -"\n" -"invalid_expression:\n" -" | STRING a=(!STRING expression_without_invalid)+ STRING {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE( PyPegen_first_item(a, expr_ty), PyPegen_last_item(a, expr_ty),\n" -" \"invalid syntax. Is this intended to be part of the string?\") }\n" -" # !(NAME STRING) is not matched so we don't show this error with some invalid string prefixes like: kf\"dsfsdf\"\n" -" # Soft keywords need to also be ignored because they can be parsed as NAME NAME\n" -" | !(NAME STRING | SOFT_KEYWORD) a=disjunction b=expression_without_invalid {\n" -" _PyPegen_check_legacy_stmt(p, a) ? NULL : p->tokens[p->mark-1]->level == 0 ? NULL :\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"invalid syntax. Perhaps you forgot a comma?\") }\n" -" | a=disjunction 'if' b=disjunction !('else'|':') { RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"expected 'else' after 'if' expression\") }\n" -" | a=disjunction 'if' b=disjunction 'else' !expression {\n" -" RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"expected expression after 'else', but statement is given\") }\n" -" | a[stmt_ty]=(pass_stmt|break_stmt|continue_stmt) 'if' b=disjunction 'else' c=simple_stmt {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION (a, \"expected expression before 'if', but statement is given\") }\n" -" | a='lambda' [lambda_params] b=':' &FSTRING_MIDDLE {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"f-string: lambda expressions are not allowed without parentheses\") }\n" -" | a='lambda' [lambda_params] b=':' &TSTRING_MIDDLE {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"t-string: lambda expressions are not allowed without parentheses\") }\n" -"\n" -"invalid_named_expression(memo):\n" -" | a=expression ':=' expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a, \"cannot use assignment expressions with %s\", _PyPegen_get_expr_name(a)) }\n" -" | a=NAME '=' b=bitwise_or !('='|':=') {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"invalid syntax. Maybe you meant '==' or ':=' instead of '='?\") }\n" -" | !(list|tuple|genexp|'True'|'None'|'False') a=bitwise_or b='=' bitwise_or !('='|':=') {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"cannot assign to %s here. Maybe you meant '==' instead of '='?\",\n" -" _PyPegen_get_expr_name(a)) }\n" -"\n" -"invalid_assignment:\n" -" | a=invalid_ann_assign_target ':' expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a,\n" -" \"only single target (not %s) can be annotated\",\n" -" _PyPegen_get_expr_name(a)\n" -" )}\n" -" | a=star_named_expression ',' star_named_expressions* ':' expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"only single target (not tuple) can be annotated\") }\n" -" | a=expression ':' expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"illegal target for annotation\") }\n" -" | (star_targets '=')* a=star_expressions '=' {\n" -" RAISE_SYNTAX_ERROR_INVALID_TARGET(STAR_TARGETS, a) }\n" -" | (star_targets '=')* a=yield_expr '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"assignment to yield expression not possible\") }\n" -" | a=star_expressions augassign annotated_rhs {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a,\n" -" \"'%s' is an illegal expression for augmented assignment\",\n" -" _PyPegen_get_expr_name(a)\n" -" )}\n" -"invalid_ann_assign_target[expr_ty]:\n" -" | list\n" -" | tuple\n" -" | '(' a=invalid_ann_assign_target ')' { a }\n" -"invalid_del_stmt:\n" -" | 'del' a=star_expressions {\n" -" RAISE_SYNTAX_ERROR_INVALID_TARGET(DEL_TARGETS, a) }\n" -"invalid_block:\n" -" | NEWLINE !INDENT { RAISE_INDENTATION_ERROR(\"expected an indented block\") }\n" -"invalid_comprehension:\n" -" | ('[' | '(' | '{') a=starred_expression for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"iterable unpacking cannot be used in comprehension\") }\n" -" | ('[' | '{') a=star_named_expression ',' b=star_named_expressions for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, PyPegen_last_item(b, expr_ty),\n" -" \"did you forget parentheses around the comprehension target?\") }\n" -" | ('[' | '{') a=star_named_expression b=',' for_if_clauses {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"did you forget parentheses around the comprehension target?\") }\n" -"invalid_dict_comprehension:\n" -" | '{' a='**' bitwise_or for_if_clauses '}' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"dict unpacking cannot be used in dict comprehension\") }\n" -"invalid_parameters:\n" -" | a=\"/\" ',' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"at least one argument must precede /\") }\n" -" | (slash_no_default | slash_with_default) param_maybe_default* a='/' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"/ may appear only once\") }\n" -" | slash_no_default? param_no_default* invalid_parameters_helper a=param_no_default {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"parameter without a default follows parameter with a default\") }\n" -" | param_no_default* a='(' param_no_default+ ','? b=')' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"Function parameters cannot be parenthesized\") }\n" -" | (slash_no_default | slash_with_default)? param_maybe_default* '*' (',' | param_no_default) param_maybe_default* a='/' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"/ must be ahead of *\") }\n" -" | param_maybe_default+ '/' a='*' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"expected comma between / and *\") }\n" -"invalid_default:\n" -" | a='=' &(')'|',') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"expected default value expression\") }\n" -"invalid_star_etc:\n" -" | a='*' (')' | ',' (')' | '**')) { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"named arguments must follow bare *\") }\n" -" | '*' ',' TYPE_COMMENT { RAISE_SYNTAX_ERROR(\"bare * has associated type comment\") }\n" -" | '*' param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"var-positional argument cannot have default value\") }\n" -" | '*' (param_no_default | ',') param_maybe_default* a='*' (param_no_default | ',') {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"* argument may appear only once\") }\n" -"invalid_kwds:\n" -" | '**' param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"var-keyword argument cannot have default value\") }\n" -" | '**' param ',' a=param { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"arguments cannot follow var-keyword argument\") }\n" -" | '**' param ',' a[Token*]=('*'|'**'|'/') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"arguments cannot follow var-keyword argument\") }\n" -"invalid_parameters_helper: # This is only there to avoid type errors\n" -" | a=slash_with_default { _PyPegen_singleton_seq(p, a) }\n" -" | param_with_default+\n" -"invalid_lambda_parameters:\n" -" | a=\"/\" ',' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"at least one argument must precede /\") }\n" -" | (lambda_slash_no_default | lambda_slash_with_default) lambda_param_maybe_default* a='/' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"/ may appear only once\") }\n" -" | lambda_slash_no_default? lambda_param_no_default* invalid_lambda_parameters_helper a=lambda_param_no_default {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"parameter without a default follows parameter with a default\") }\n" -" | lambda_param_no_default* a='(' ','.lambda_param+ ','? b=')' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"Lambda expression parameters cannot be parenthesized\") }\n" -" | (lambda_slash_no_default | lambda_slash_with_default)? lambda_param_maybe_default* '*' (',' | lambda_param_no_default) lambda_param_maybe_default* a='/' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"/ must be ahead of *\") }\n" -" | lambda_param_maybe_default+ '/' a='*' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"expected comma between / and *\") }\n" -"invalid_lambda_parameters_helper:\n" -" | a=lambda_slash_with_default { _PyPegen_singleton_seq(p, a) }\n" -" | lambda_param_with_default+\n" -"invalid_lambda_star_etc:\n" -" | '*' (':' | ',' (':' | '**')) { RAISE_SYNTAX_ERROR(\"named arguments must follow bare *\") }\n" -" | '*' lambda_param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"var-positional argument cannot have default value\") }\n" -" | '*' (lambda_param_no_default | ',') lambda_param_maybe_default* a='*' (lambda_param_no_default | ',') {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"* argument may appear only once\") }\n" -"invalid_lambda_kwds:\n" -" | '**' lambda_param a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"var-keyword argument cannot have default value\") }\n" -" | '**' lambda_param ',' a=lambda_param { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"arguments cannot follow var-keyword argument\") }\n" -" | '**' lambda_param ',' a[Token*]=('*'|'**'|'/') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"arguments cannot follow var-keyword argument\") }\n" -"invalid_double_type_comments:\n" -" | TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT {\n" -" RAISE_SYNTAX_ERROR(\"Cannot have two type comments on def\") }\n" -"invalid_with_item:\n" -" | expression 'as' a=expression &(',' | ')' | ':') {\n" -" RAISE_SYNTAX_ERROR_INVALID_TARGET(STAR_TARGETS, a) }\n" -"\n" -"invalid_for_if_clause:\n" -" | 'async'? 'for' (bitwise_or (',' bitwise_or)* [',']) !'in' {\n" -" RAISE_SYNTAX_ERROR(\"'in' expected after for-loop variables\") }\n" -"\n" -"invalid_for_target:\n" -" | 'async'? 'for' a=star_expressions {\n" -" RAISE_SYNTAX_ERROR_INVALID_TARGET(FOR_TARGETS, a) }\n" -"\n" -"invalid_group:\n" -" | '(' a=starred_expression ')' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"cannot use starred expression here\") }\n" -" | '(' a='**' expression ')' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"cannot use double starred expression here\") }\n" -"invalid_import:\n" -" | a='import' ','.dotted_name+ 'from' dotted_name {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"Did you mean to use 'from ... import ...' instead?\") }\n" -" | 'import' token=NEWLINE {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(token, \"Expected one or more names after 'import'\") }\n" -"invalid_dotted_as_name:\n" -" | dotted_name 'as' !(NAME (',' | ')' | ';' | NEWLINE)) a=expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a,\n" -" \"cannot use %s as import target\", _PyPegen_get_expr_name(a)) }\n" -"invalid_import_from_as_name:\n" -" | NAME 'as' !(NAME (',' | ')' | ';' | NEWLINE)) a=expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a,\n" -" \"cannot use %s as import target\", _PyPegen_get_expr_name(a)) }\n" -"\n" -"invalid_import_from_targets:\n" -" | import_from_as_names ',' NEWLINE {\n" -" RAISE_SYNTAX_ERROR(\"trailing comma not allowed without surrounding parentheses\") }\n" -" | token=NEWLINE {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(token, \"Expected one or more names after 'import'\") }\n" -"\n" -"invalid_with_stmt:\n" -" | ['async'] 'with' ','.(expression ['as' star_target])+ NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | ['async'] 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -"invalid_with_stmt_indent:\n" -" | ['async'] a='with' ','.(expression ['as' star_target])+ ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'with' statement on line %d\", a->lineno) }\n" -" | ['async'] a='with' '(' ','.(expressions ['as' star_target])+ ','? ')' ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'with' statement on line %d\", a->lineno) }\n" -"\n" -"invalid_try_stmt:\n" -" | a='try' ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'try' statement on line %d\", a->lineno) }\n" -" | 'try' ':' block !('except' | 'finally') { RAISE_SYNTAX_ERROR(\"expected 'except' or 'finally' block\") }\n" -" | 'try' ':' block* except_block+ a='except' b='*' expression ['as' NAME] ':' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"cannot have both 'except' and 'except*' on the same 'try'\") }\n" -" | 'try' ':' block* except_star_block+ a='except' [expression ['as' NAME]] ':' {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"cannot have both 'except' and 'except*' on the same 'try'\") }\n" -"invalid_except_stmt:\n" -" | 'except' a=expression ',' expressions 'as' NAME ':' {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"multiple exception types must be parenthesized when using 'as'\") }\n" -" | a='except' expression ['as' NAME ] NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='except' NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | 'except' expression 'as' a=expression ':' block {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a, \"cannot use except statement with %s\", _PyPegen_get_expr_name(a)) }\n" -"invalid_except_star_stmt:\n" -" | 'except' '*' a=expression ',' expressions 'as' NAME ':' {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"multiple exception types must be parenthesized when using 'as'\") }\n" -" | a='except' '*' expression ['as' NAME ] NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='except' '*' (NEWLINE | ':') { RAISE_SYNTAX_ERROR(\"expected one or more exception types\") }\n" -" | 'except' '*' expression 'as' a=expression ':' block {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a, \"cannot use except* statement with %s\", _PyPegen_get_expr_name(a)) }\n" -"invalid_finally_stmt:\n" -" | a='finally' ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'finally' statement on line %d\", a->lineno) }\n" -"invalid_except_stmt_indent:\n" -" | a='except' expression ['as' NAME ] ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'except' statement on line %d\", a->lineno) }\n" -" | a='except' ':' NEWLINE !INDENT { RAISE_INDENTATION_ERROR(\"expected an indented block after 'except' statement on line %d\", a->lineno) }\n" -"invalid_except_star_stmt_indent:\n" -" | a='except' '*' expression ['as' NAME ] ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'except*' statement on line %d\", a->lineno) }\n" -"invalid_match_stmt:\n" -" | \"match\" subject_expr NEWLINE { CHECK_VERSION(void*, 10, \"Pattern matching is\", RAISE_SYNTAX_ERROR(\"expected ':'\") ) }\n" -" | a=\"match\" subject=subject_expr ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'match' statement on line %d\", a->lineno) }\n" -"invalid_case_block:\n" -" | \"case\" patterns guard? NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a=\"case\" patterns guard? ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'case' statement on line %d\", a->lineno) }\n" -"invalid_as_pattern:\n" -" | or_pattern 'as' a=\"_\" { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"cannot use '_' as a target\") }\n" -" | or_pattern 'as' a=expression {\n" -" RAISE_SYNTAX_ERROR_KNOWN_LOCATION(\n" -" a, \"cannot use %s as pattern target\", _PyPegen_get_expr_name(a)) }\n" -"invalid_class_pattern:\n" -" | name_or_attr '(' a=invalid_class_argument_pattern { RAISE_SYNTAX_ERROR_KNOWN_RANGE(\n" -" PyPegen_first_item(a, pattern_ty),\n" -" PyPegen_last_item(a, pattern_ty),\n" -" \"positional patterns follow keyword patterns\") }\n" -"invalid_class_argument_pattern[asdl_pattern_seq*]:\n" -" | [positional_patterns ','] keyword_patterns ',' a=positional_patterns { a }\n" -"invalid_if_stmt:\n" -" | 'if' named_expression NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='if' a=named_expression ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'if' statement on line %d\", a->lineno) }\n" -"invalid_elif_stmt:\n" -" | 'elif' named_expression NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='elif' named_expression ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'elif' statement on line %d\", a->lineno) }\n" -"invalid_else_stmt:\n" -" | a='else' ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'else' statement on line %d\", a->lineno) }\n" -" | 'else' ':' block 'elif' { RAISE_SYNTAX_ERROR(\"'elif' block follows an 'else' block\")}\n" -"invalid_while_stmt:\n" -" | 'while' named_expression NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='while' named_expression ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'while' statement on line %d\", a->lineno) }\n" -"invalid_for_stmt:\n" -" | ['async'] 'for' star_targets 'in' star_expressions NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | ['async'] a='for' star_targets 'in' star_expressions ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after 'for' statement on line %d\", a->lineno) }\n" -"invalid_def_raw:\n" -" | ['async'] a='def' NAME [type_params] '(' [params] ')' ['->' expression] ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after function definition on line %d\", a->lineno) }\n" -" | ['async'] 'def' NAME [type_params] &&'(' [params] ')' ['->' expression] &&':' [func_type_comment] block\n" -"invalid_class_def_raw:\n" -" | 'class' NAME [type_params] ['(' [arguments] ')'] NEWLINE { RAISE_SYNTAX_ERROR(\"expected ':'\") }\n" -" | a='class' NAME [type_params] ['(' [arguments] ')'] ':' NEWLINE !INDENT {\n" -" RAISE_INDENTATION_ERROR(\"expected an indented block after class definition on line %d\", a->lineno) }\n" -"\n" -"invalid_double_starred_kvpairs:\n" -" | ','.double_starred_kvpair+ ',' invalid_kvpair\n" -" | expression ':' a='*' bitwise_or { RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"cannot use a starred expression in a dictionary value\") }\n" -" | expression a=':' &('}'|',') { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"expression expected after dictionary key and ':'\") }\n" -"invalid_kvpair:\n" -" | a=expression !(':') {\n" -" RAISE_ERROR_KNOWN_LOCATION(p, PyExc_SyntaxError, a->lineno, a->end_col_offset - 1, a->end_lineno, -1, \"':' expected after dictionary key\") }\n" -" | expression ':' a='*' bitwise_or { RAISE_SYNTAX_ERROR_STARTING_FROM(a, \"cannot use a starred expression in a dictionary value\") }\n" -" | expression a=':' &('}'|',') {RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"expression expected after dictionary key and ':'\") }\n" -"invalid_starred_expression_unpacking:\n" -" | a='*' expression '=' b=expression { RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"cannot assign to iterable argument unpacking\") }\n" -"invalid_starred_expression:\n" -" | '*' { RAISE_SYNTAX_ERROR(\"Invalid star expression\") }\n" -"\n" -"invalid_fstring_replacement_field:\n" -" | '{' a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"f-string: valid expression required before '='\") }\n" -" | '{' a='!' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"f-string: valid expression required before '!'\") }\n" -" | '{' a=':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"f-string: valid expression required before ':'\") }\n" -" | '{' a='}' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"f-string: valid expression required before '}'\") }\n" -" | '{' !annotated_rhs { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting a valid expression after '{'\") }\n" -" | '{' annotated_rhs !('=' | '!' | ':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting '=', or '!', or ':', or '}'\") }\n" -" | '{' annotated_rhs '=' !('!' | ':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting '!', or ':', or '}'\") }\n" -" | '{' annotated_rhs '='? invalid_fstring_conversion_character\n" -" | '{' annotated_rhs '='? ['!' NAME] !(':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting ':' or '}'\") }\n" -" | '{' annotated_rhs '='? ['!' NAME] ':' fstring_format_spec* !'}' {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting '}', or format specs\") }\n" -" | '{' annotated_rhs '='? ['!' NAME] !'}' {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: expecting '}'\") }\n" -"\n" -"invalid_fstring_conversion_character:\n" -" | '!' &(':' | '}') { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: missing conversion character\") }\n" -" | '!' !NAME { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"f-string: invalid conversion character\") }\n" -"\n" -"invalid_tstring_replacement_field:\n" -" | '{' a='=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"t-string: valid expression required before '='\") }\n" -" | '{' a='!' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"t-string: valid expression required before '!'\") }\n" -" | '{' a=':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"t-string: valid expression required before ':'\") }\n" -" | '{' a='}' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, \"t-string: valid expression required before '}'\") }\n" -" | '{' !annotated_rhs { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting a valid expression after '{'\") }\n" -" | '{' annotated_rhs !('=' | '!' | ':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting '=', or '!', or ':', or '}'\") }\n" -" | '{' annotated_rhs '=' !('!' | ':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting '!', or ':', or '}'\") }\n" -" | '{' annotated_rhs '='? invalid_tstring_conversion_character\n" -" | '{' annotated_rhs '='? ['!' NAME] !(':' | '}') {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting ':' or '}'\") }\n" -" | '{' annotated_rhs '='? ['!' NAME] ':' fstring_format_spec* !'}' {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting '}', or format specs\") }\n" -" | '{' annotated_rhs '='? ['!' NAME] !'}' {\n" -" PyErr_Occurred() ? NULL : RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: expecting '}'\") }\n" -"\n" -"invalid_tstring_conversion_character:\n" -" | '!' &(':' | '}') { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: missing conversion character\") }\n" -" | '!' !NAME { RAISE_SYNTAX_ERROR_ON_NEXT_TOKEN(\"t-string: invalid conversion character\") }\n" -"\n" -"invalid_string_tstring_concat:\n" -" | a=(fstring|string)+ b[expr_ty]=tstring {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(PyPegen_last_item(a, expr_ty), b, \"cannot mix t-string literals with string or bytes literals\") }\n" -" | a=tstring+ b[expr_ty]=(fstring|string) {\n" -" RAISE_SYNTAX_ERROR_KNOWN_RANGE(PyPegen_last_item(a, expr_ty), b, \"cannot mix t-string literals with string or bytes literals\") }\n" -"\n" -"invalid_arithmetic:\n" -" | sum ('+'|'-'|'*'|'/'|'%'|'//'|'@') a='not' b=inversion { RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"'not' after an operator must be parenthesized\") }\n" -"invalid_factor:\n" -" | ('+' | '-' | '~') a='not' b=factor { RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, \"'not' after an operator must be parenthesized\") }\n" -"\n" -"invalid_type_params:\n" -" | '[' token=']' {\n" -" RAISE_SYNTAX_ERROR_STARTING_FROM(\n" -" token,\n" -" \"Type parameter list cannot be empty\")}\n" -msgstr "" From 1ed7e5b90d8426719d396e7b8aa30351c14ab414 Mon Sep 17 00:00:00 2001 From: Sepehr Rasouli Date: Sat, 5 Sep 2026 17:46:43 +0330 Subject: [PATCH 3/5] Translate all of Python documentation files --- .github/ISSUE_TEMPLATE/page_request.md | 8 +- .github/ISSUE_TEMPLATE/question.md | 8 +- .github/ISSUE_TEMPLATE/translation_bug.md | 10 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/build-and-deploy.yml | 2 +- .readthedocs.yml | 8 +- CONTRIBUTING.md | 70 +- GLOSSARY.md | 586 +- README.md | 18 +- STATUS.md | 10 +- about.po | 11 +- bugs.po | 10 +- c-api/abstract.po | 2 +- c-api/allocation.po | 4 +- c-api/apiabiversion.po | 4 +- c-api/arg.po | 1217 ++- c-api/bool.po | 8 +- c-api/buffer.po | 777 +- c-api/bytearray.po | 2 +- c-api/bytes.po | 368 +- c-api/call.po | 531 +- c-api/capsule.po | 223 +- c-api/cell.po | 72 +- c-api/code.po | 424 +- c-api/codec.po | 154 +- c-api/complex.po | 196 +- c-api/concrete.po | 64 +- c-api/contextvars.po | 203 +- c-api/conversion.po | 326 +- c-api/coro.po | 28 +- c-api/curses.po | 136 +- c-api/datetime.po | 309 +- c-api/descriptor.po | 244 +- c-api/dict.po | 761 +- c-api/exceptions.po | 1553 +++- c-api/extension-modules.po | 365 +- c-api/file.po | 216 +- c-api/float.po | 310 +- c-api/frame.po | 257 +- c-api/function.po | 260 +- c-api/gcsupport.po | 463 +- c-api/gen.po | 90 +- c-api/hash.po | 133 +- c-api/import.po | 453 +- c-api/index.po | 12 +- c-api/init.po | 16 +- c-api/init_config.po | 2488 ++++-- c-api/interp-lifecycle.po | 1310 ++- c-api/intro.po | 1657 +++- c-api/iter.po | 72 +- c-api/iterator.po | 114 +- c-api/lifecycle.po | 462 +- c-api/list.po | 256 +- c-api/long.po | 1019 ++- c-api/mapping.po | 162 +- c-api/marshal.po | 113 +- c-api/memory.po | 1186 ++- c-api/memoryview.po | 101 +- c-api/method.po | 89 +- c-api/module.po | 890 +- c-api/monitoring.po | 244 +- c-api/none.po | 28 +- c-api/number.po | 336 +- c-api/object.po | 1027 ++- c-api/objimpl.po | 8 +- c-api/perfmaps.po | 143 +- c-api/picklebuffer.po | 77 +- c-api/profiling.po | 314 +- c-api/refcounting.po | 269 +- c-api/reflection.po | 121 +- c-api/sequence.po | 217 +- c-api/set.po | 270 +- c-api/slice.po | 149 +- c-api/stable.po | 339 +- c-api/structures.po | 1079 ++- c-api/subinterpreters.po | 633 +- c-api/synchronization.po | 316 +- c-api/sys.po | 622 +- c-api/threads.po | 1149 ++- c-api/time.po | 143 +- c-api/tls.po | 195 +- c-api/tuple.po | 255 +- c-api/type.po | 847 +- c-api/typehints.po | 51 +- c-api/typeobj.po | 4339 +++++++-- c-api/unicode.po | 2261 ++++- c-api/utilities.po | 11 +- c-api/veryhigh.po | 690 +- c-api/weakref.po | 159 +- copyright.po | 2 +- deprecations/c-api-pending-removal-in-3.14.po | 14 +- deprecations/c-api-pending-removal-in-3.15.po | 296 +- deprecations/c-api-pending-removal-in-3.16.po | 4 +- deprecations/c-api-pending-removal-in-3.18.po | 122 +- .../c-api-pending-removal-in-future.po | 86 +- deprecations/index.po | 1215 ++- deprecations/pending-removal-in-3.13.po | 66 +- deprecations/pending-removal-in-3.14.po | 171 +- deprecations/pending-removal-in-3.15.po | 158 +- deprecations/pending-removal-in-3.16.po | 161 +- deprecations/pending-removal-in-3.17.po | 66 +- deprecations/pending-removal-in-3.18.po | 14 +- deprecations/pending-removal-in-3.19.po | 12 +- deprecations/pending-removal-in-future.po | 314 +- distributing/index.po | 9 +- extending/building.po | 29 +- extending/embedding.po | 467 +- extending/extending.po | 2261 ++++- extending/index.po | 72 +- extending/newtypes.po | 1016 ++- extending/newtypes_tutorial.po | 2654 +++++- extending/windows.po | 258 +- faq/design.po | 1312 ++- faq/extending.po | 374 +- faq/general.po | 754 +- faq/gui.po | 103 +- faq/index.po | 2 +- faq/installed.po | 103 +- faq/library.po | 991 ++- faq/programming.po | 3112 ++++++- faq/windows.po | 466 +- glossary.json | 488 + glossary.po | 3214 +++++-- howto/a-conceptual-overview-of-asyncio.po | 840 +- howto/annotations.po | 454 +- howto/argparse-optparse.po | 121 +- howto/argparse.po | 1028 ++- howto/clinic.po | 8 +- howto/cporting.po | 32 +- howto/curses.po | 964 +- howto/descriptor.po | 1698 +++- howto/enum.po | 1755 +++- howto/free-threading-extensions.po | 670 +- howto/free-threading-python.po | 509 +- howto/functional.po | 1821 +++- howto/gdb_helpers.po | 559 +- howto/index.po | 68 +- howto/instrumentation.po | 544 +- howto/ipaddress.po | 406 +- howto/isolating-extensions.po | 913 +- howto/logging-cookbook.po | 4220 +++++++-- howto/logging.po | 1799 +++- howto/mro.po | 845 +- howto/perf_profiling.po | 384 +- howto/pyporting.po | 56 +- howto/regex.po | 2191 ++++- howto/remote_debugging.po | 1112 ++- howto/sockets.po | 711 +- howto/sorting.po | 531 +- howto/timerfd.po | 234 +- howto/unicode.po | 1228 ++- howto/urllib2.po | 829 +- improve-page-nojs.po | 5 +- improve-page.po | 5 +- installing/index.po | 296 +- library/__future__.po | 13 +- library/__main__.po | 4 +- library/_thread.po | 289 +- library/abc.po | 467 +- library/aifc.po | 16 +- library/allos.po | 13 +- library/annotationlib.po | 1186 ++- library/archiving.po | 12 +- library/argparse.po | 2414 ++++- library/array.po | 375 +- library/ast.po | 3118 ++++++- library/asynchat.po | 18 +- library/asyncio-api-index.po | 235 +- library/asyncio-dev.po | 560 +- library/asyncio-eventloop.po | 2522 +++++- library/asyncio-exceptions.po | 57 +- library/asyncio-extending.po | 113 +- library/asyncio-future.po | 334 +- library/asyncio-graph.po | 177 +- library/asyncio-llapi-index.po | 578 +- library/asyncio-platforms.po | 147 +- library/asyncio-policy.po | 174 +- library/asyncio-protocol.po | 1251 ++- library/asyncio-queue.po | 285 +- library/asyncio-runner.po | 224 +- library/asyncio-stream.po | 553 +- library/asyncio-subprocess.po | 454 +- library/asyncio-sync.po | 483 +- library/asyncio-task.po | 1820 +++- library/asyncio-threading.po | 213 +- library/asyncio-tools.po | 156 +- library/asyncio.po | 155 +- library/asyncore.po | 18 +- library/atexit.po | 169 +- library/audioop.po | 16 +- library/audit_events.po | 77 +- library/base64.po | 521 +- library/bdb.po | 610 +- library/binary.po | 29 +- library/binascii.po | 222 +- library/bisect.po | 322 +- library/builtins.po | 58 +- library/bz2.po | 384 +- library/calendar.po | 694 +- library/cgi.po | 24 +- library/cgitb.po | 24 +- library/chunk.po | 16 +- library/cmath.po | 497 +- library/cmd.po | 509 +- library/cmdline.po | 106 +- library/cmdlinelibs.po | 10 +- library/code.po | 284 +- library/codecs.po | 2472 ++++-- library/codeop.po | 104 +- library/collections.abc.po | 653 +- library/collections.po | 1716 +++- library/colorsys.po | 48 +- library/compileall.po | 434 +- library/compression.po | 31 +- library/compression.zstd.po | 1199 ++- library/concurrency.po | 15 +- library/concurrent.futures.po | 1042 ++- library/concurrent.interpreters.po | 461 +- library/concurrent.po | 11 +- library/configparser.po | 1851 +++- library/constants.po | 161 +- library/contextlib.po | 1318 ++- library/contextvars.po | 396 +- library/copy.po | 180 +- library/copyreg.po | 62 +- library/crypt.po | 26 +- library/crypto.po | 12 +- library/csv.po | 833 +- library/ctypes.po | 3632 ++++++-- library/curses.ascii.po | 232 +- library/curses.panel.po | 99 +- library/curses.po | 2373 +++-- library/custominterp.po | 16 +- library/dataclasses.po | 1309 ++- library/datatypes.po | 23 +- library/datetime.po | 3907 ++++++-- library/dbm.po | 544 +- library/debug.po | 17 +- library/decimal.po | 2593 +++++- library/development.po | 16 +- library/devmode.po | 309 +- library/dialog.po | 351 +- library/difflib.po | 1140 ++- library/dis.po | 1960 ++++- library/distribution.po | 12 +- library/distutils.po | 18 +- library/doctest.po | 2801 +++++- library/email.charset.po | 291 +- library/email.compat32-message.po | 1111 ++- library/email.contentmanager.po | 324 +- library/email.encoders.po | 124 +- library/email.errors.po | 180 +- library/email.examples.po | 516 +- library/email.generator.po | 405 +- library/email.header.po | 369 +- library/email.headerregistry.po | 666 +- library/email.iterators.po | 92 +- library/email.message.po | 1101 ++- library/email.mime.po | 371 +- library/email.parser.po | 457 +- library/email.po | 219 +- library/email.policy.po | 949 +- library/email.utils.po | 311 +- library/ensurepip.po | 215 +- library/enum.po | 799 +- library/errno.po | 418 +- library/exceptions.po | 1537 +++- library/faulthandler.po | 331 +- library/fcntl.po | 423 +- library/filecmp.po | 207 +- library/fileformats.po | 8 +- library/fileinput.po | 317 +- library/filesys.po | 32 +- library/fnmatch.po | 156 +- library/fractions.po | 316 +- library/frameworks.po | 14 +- library/ftplib.po | 580 +- library/functional.po | 11 +- library/functions.po | 2387 +++-- library/functools.po | 1104 ++- library/gc.po | 462 +- library/getopt.po | 305 +- library/getpass.po | 104 +- library/gettext.po | 939 +- library/glob.po | 259 +- library/graphlib.po | 306 +- library/grp.po | 90 +- library/gzip.po | 407 +- library/hashlib.po | 987 ++- library/heapq.po | 641 +- library/hmac.po | 167 +- library/html.entities.po | 40 +- library/html.parser.po | 436 +- library/html.po | 40 +- library/http.client.po | 773 +- library/http.cookiejar.po | 1017 ++- library/http.cookies.po | 325 +- library/http.po | 592 +- library/http.server.po | 877 +- library/i18n.po | 14 +- library/idle.po | 1736 +++- library/imaplib.po | 890 +- library/imghdr.po | 24 +- library/imp.po | 21 +- library/importlib.metadata.po | 795 +- library/importlib.po | 1838 +++- library/importlib.resources.abc.po | 215 +- library/importlib.resources.po | 308 +- library/index.po | 55 +- library/inspect.po | 2075 ++++- library/internet.po | 26 +- library/intro.po | 319 +- library/io.po | 1866 +++- library/ipaddress.po | 1130 ++- library/ipc.po | 19 +- library/itertools.po | 1491 +++- library/json.po | 1043 ++- library/keyword.po | 36 +- library/language.po | 12 +- library/linecache.po | 99 +- library/locale.po | 963 +- library/logging.config.po | 1525 +++- library/logging.handlers.po | 1756 +++- library/logging.po | 2409 ++++- library/lzma.po | 735 +- library/mailbox.po | 1907 +++- library/mailcap.po | 16 +- library/markup.po | 13 +- library/marshal.po | 304 +- library/math.po | 1120 ++- library/mimetypes.po | 484 +- library/mm.po | 10 +- library/mmap.po | 515 +- library/modulefinder.po | 112 +- library/modules.po | 10 +- library/msilib.po | 16 +- library/msvcrt.po | 288 +- library/multiprocessing.po | 3795 ++++++-- library/multiprocessing.shared_memory.po | 512 +- library/netdata.po | 8 +- library/netrc.po | 117 +- library/nis.po | 16 +- library/nntplib.po | 16 +- library/numbers.po | 277 +- library/numeric.po | 17 +- library/operator.po | 562 +- library/optparse.po | 3041 +++++-- library/os.path.po | 761 +- library/os.po | 6910 ++++++++++++--- library/ossaudiodev.po | 16 +- library/pathlib.po | 1967 ++++- library/pdb.po | 1114 ++- library/persistence.po | 17 +- library/pickle.po | 2088 ++++- library/pickletools.po | 126 +- library/pipes.po | 18 +- library/pkgutil.po | 320 +- library/platform.po | 514 +- library/plistlib.po | 234 +- library/poplib.po | 323 +- library/posix.po | 132 +- library/pprint.po | 422 +- library/profile.po | 1104 ++- library/pty.po | 173 +- library/pwd.po | 105 +- library/py_compile.po | 218 +- library/pyclbr.po | 147 +- library/pydoc.po | 204 +- library/pyexpat.po | 1170 ++- library/python.po | 15 +- library/queue.po | 447 +- library/quopri.po | 80 +- library/random.po | 977 +- library/re.po | 2560 +++++- library/readline.po | 506 +- library/removed.po | 9 +- library/reprlib.po | 265 +- library/resource.po | 479 +- library/rlcompleter.po | 83 +- library/runpy.po | 299 +- library/sched.po | 167 +- library/secrets.po | 201 +- library/security_warnings.po | 91 +- library/select.po | 772 +- library/selectors.po | 327 +- library/shelve.po | 313 +- library/shlex.po | 595 +- library/shutil.po | 1291 ++- library/signal.po | 957 +- library/site.po | 443 +- library/smtpd.po | 22 +- library/smtplib.po | 853 +- library/sndhdr.po | 24 +- library/socket.po | 2996 ++++++- library/socketserver.po | 879 +- library/spwd.po | 22 +- library/sqlite3.po | 2872 +++++- library/ssl.po | 3794 ++++++-- library/stat.po | 352 +- library/statistics.po | 1493 +++- library/stdtypes.po | 7361 +++++++++++++--- library/string.po | 1434 ++- library/string.templatelib.po | 284 +- library/stringprep.po | 145 +- library/struct.po | 960 +- library/subprocess.po | 2061 ++++- library/sunau.po | 16 +- library/superseded.po | 35 +- library/symtable.po | 309 +- library/sys.monitoring.po | 561 +- library/sys.po | 3067 +++++-- library/sys_path_init.po | 237 +- library/sysconfig.po | 598 +- library/syslog.po | 212 +- library/tabnanny.po | 60 +- library/tarfile.po | 1857 +++- library/telnetlib.po | 24 +- library/tempfile.po | 686 +- library/termios.po | 159 +- library/test.po | 2087 ++++- library/text.po | 16 +- library/textwrap.po | 389 +- library/threading.po | 1940 +++- library/threadsafety.po | 722 +- library/time.po | 1324 ++- library/timeit.po | 436 +- library/tk.po | 49 +- library/tkinter.colorchooser.po | 46 +- library/tkinter.dnd.po | 78 +- library/tkinter.font.po | 136 +- library/tkinter.messagebox.po | 211 +- library/tkinter.po | 7832 ++++++++++++++--- library/tkinter.scrolledtext.po | 38 +- library/tkinter.ttk.po | 2243 +++-- library/token.po | 369 +- library/tokenize.po | 359 +- library/tomllib.po | 172 +- library/trace.po | 249 +- library/traceback.po | 894 +- library/tracemalloc.po | 804 +- library/tty.po | 87 +- library/turtle.po | 2996 +++++-- library/types.po | 583 +- library/typing.po | 3962 +++++++-- library/unicodedata.po | 266 +- library/unittest.mock-examples.po | 1404 ++- library/unittest.mock.po | 3115 ++++++- library/unittest.po | 3187 +++++-- library/unix.po | 10 +- library/urllib.error.po | 81 +- library/urllib.parse.po | 1063 ++- library/urllib.po | 19 +- library/urllib.request.po | 1971 ++++- library/urllib.robotparser.po | 102 +- library/uu.po | 24 +- library/uuid.po | 492 +- library/venv.po | 777 +- library/warnings.po | 1099 ++- library/wave.po | 261 +- library/weakref.po | 755 +- library/webbrowser.po | 381 +- library/windows.po | 8 +- library/winreg.po | 839 +- library/winsound.po | 175 +- library/wsgiref.po | 1250 ++- library/xdrlib.po | 16 +- library/xml.dom.minidom.po | 472 +- library/xml.dom.po | 1299 ++- library/xml.dom.pulldom.po | 169 +- library/xml.etree.elementtree.po | 1839 +++- library/xml.po | 152 +- library/xml.sax.handler.po | 584 +- library/xml.sax.po | 242 +- library/xml.sax.reader.po | 382 +- library/xml.sax.utils.po | 134 +- library/xmlrpc.client.po | 758 +- library/xmlrpc.po | 21 +- library/xmlrpc.server.po | 490 +- library/zipapp.po | 496 +- library/zipfile.po | 1239 ++- library/zipimport.po | 229 +- library/zlib.po | 603 +- library/zoneinfo.po | 609 +- reference/compound_stmts.po | 2592 +++++- reference/datamodel.po | 5648 +++++++++--- reference/executionmodel.po | 950 +- reference/expressions.po | 1452 +-- reference/grammar.po | 3892 +++++++- reference/import.po | 1716 +++- reference/index.po | 19 +- reference/introduction.po | 371 +- reference/lexical_analysis.po | 1560 +++- reference/simple_stmts.po | 1521 +++- reference/toplevel_components.po | 124 +- scripts/check_consistency.py | 890 ++ scripts/check_markup.py | 75 +- scripts/decode_urls_to_plain_text.py | 126 + scripts/fix_term_refs.py | 560 +- scripts/list_parentheticals.py | 341 + scripts/script.py | 341 + scripts/triage_consistency.py | 555 ++ sphinx.po | 19 +- tutorial/appendix.po | 12 +- tutorial/appetite.po | 22 +- tutorial/classes.po | 96 +- tutorial/controlflow.po | 90 +- tutorial/datastructures.po | 72 +- tutorial/errors.po | 44 +- tutorial/floatingpoint.po | 20 +- tutorial/index.po | 4 +- tutorial/inputoutput.po | 30 +- tutorial/interactive.po | 8 +- tutorial/interpreter.po | 28 +- tutorial/introduction.po | 92 +- tutorial/modules.po | 108 +- tutorial/stdlib.po | 40 +- tutorial/stdlib2.po | 40 +- tutorial/venv.po | 30 +- tutorial/whatnow.po | 14 +- using/android.po | 156 +- using/cmdline.po | 1811 +++- using/configure.po | 1912 +++- using/editors.po | 38 +- using/index.po | 10 +- using/ios.po | 682 +- using/mac.po | 749 +- using/unix.po | 267 +- using/windows.po | 3623 ++++++-- whatsnew/2.0.po | 2203 ++++- whatsnew/2.1.po | 1371 ++- whatsnew/2.2.po | 2256 ++++- whatsnew/2.3.po | 3400 ++++++- whatsnew/2.4.po | 2466 +++++- whatsnew/2.5.po | 3816 ++++++-- whatsnew/2.6.po | 5232 +++++++++-- whatsnew/2.7.po | 4532 ++++++++-- whatsnew/3.0.po | 1524 +++- whatsnew/3.1.po | 835 +- whatsnew/3.10.po | 3674 ++++++-- whatsnew/3.11.po | 4251 +++++++-- whatsnew/3.12.po | 4903 +++++++++-- whatsnew/3.13.po | 5846 +++++++++--- whatsnew/3.14.po | 6422 +++++++++++--- whatsnew/3.2.po | 4116 +++++++-- whatsnew/3.3.po | 4062 +++++++-- whatsnew/3.4.po | 4284 +++++++-- whatsnew/3.5.po | 3860 ++++++-- whatsnew/3.6.po | 3716 ++++++-- whatsnew/3.7.po | 4224 +++++++-- whatsnew/3.8.po | 3312 +++++-- whatsnew/3.9.po | 2760 +++++- whatsnew/changelog.po | 5 +- whatsnew/index.po | 19 +- 553 files changed, 362535 insertions(+), 72076 deletions(-) create mode 100644 glossary.json create mode 100644 scripts/check_consistency.py create mode 100644 scripts/decode_urls_to_plain_text.py create mode 100644 scripts/list_parentheticals.py create mode 100644 scripts/script.py create mode 100644 scripts/triage_consistency.py diff --git a/.github/ISSUE_TEMPLATE/page_request.md b/.github/ISSUE_TEMPLATE/page_request.md index 8f158685a..c03617356 100644 --- a/.github/ISSUE_TEMPLATE/page_request.md +++ b/.github/ISSUE_TEMPLATE/page_request.md @@ -1,6 +1,6 @@ --- -name: درخواست ترجمهٔ صفحه -about: درخواست ترجمه یا اولویت‌دادن به ترجمهٔ یک صفحهٔ خاص +name: درخواست ترجمه‌ی صفحه +about: درخواست ترجمه یا اولویت‌دادن به ترجمه‌ی یک صفحه‌ی خاص title: "[ترجمه] " labels: enhancement assignees: '' @@ -16,10 +16,10 @@ assignees: '' ## اولویت - + - [ ] بله، از فایل‌های ضروری است - [ ] خیر ## آیین‌نامه رفتاری -- [ ] می‌پذیرم که از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file +- [ ] می‌پذیرم که از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 2c3cdb4da..23fe20aff 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,6 +1,6 @@ --- name: پرسش یا پیشنهاد واژه‌نامه -about: سؤال دربارهٔ قواعد ترجمه یا پیشنهاد اصطلاح برای واژه‌نامه +about: سؤال درباره‌ی قواعد ترجمه یا پیشنهاد اصطلاح برای واژه‌نامه title: "" labels: question assignees: '' @@ -12,12 +12,12 @@ assignees: '' ## اصطلاح (در صورت پیشنهاد برای واژه‌نامه) - + ## منابع - + ## آیین‌نامه رفتاری -- [ ] می‌پذیرم که از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file +- [ ] می‌پذیرم که از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/translation_bug.md b/.github/ISSUE_TEMPLATE/translation_bug.md index eac73a407..0b8f207dc 100644 --- a/.github/ISSUE_TEMPLATE/translation_bug.md +++ b/.github/ISSUE_TEMPLATE/translation_bug.md @@ -8,7 +8,7 @@ assignees: '' ## صفحه / فایل - + ## متن اصلی (msgid) @@ -16,13 +16,13 @@ assignees: '' ``` -## ترجمهٔ فعلی (msgstr) +## ترجمه‌ی فعلی (msgstr) ``` ``` -## ترجمهٔ پیشنهادی +## ترجمه‌ی پیشنهادی ``` @@ -30,8 +30,8 @@ assignees: '' ## دلیل / توضیح - + ## آیین‌نامه رفتاری -- [ ] می‌پذیرم که از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file +- [ ] می‌پذیرم که از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4a2deb814..fa8491f61 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,7 +15,7 @@ ## چک‌لیست -- [ ] می‌پذیرم که از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. +- [ ] می‌پذیرم که از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنم. - [ ] `msgfmt --check` روی فایل‌های تغییر یافته با موفقیت اجرا شده است - [ ] `python3 scripts/check_markup.py` روی فایل‌های تغییر یافته اجرا شده است - [ ] نشانه‌گذاری‌های Sphinx (`:class:`، `:func:`، کد درون‌خطی) و جای‌گذارها (`%s`، `{name}`) دست‌نخورده مانده‌اند diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 8755a386d..02a4c0289 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -50,7 +50,7 @@ jobs: uses: sphinx-doc/github-problem-matcher@v1.1 - name: Build documentation - run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 --keep-going" html + run: make -e SPHINXOPTS="--color -D language='fa' -D gettext_allow_fuzzy_translations=1 -D suppress_warnings=misc.highlighting_failure -D html_theme_options.is_rtl=true --keep-going" html working-directory: ./Doc - name: Setup Pages diff --git a/.readthedocs.yml b/.readthedocs.yml index f2f5b514b..2d703d40e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -36,11 +36,13 @@ build: - find */ -name "*.po" -not -path "venv/*" | xargs -I{} cp --parents {} venv/cpython/Doc/locales/fa/LC_MESSAGES/ - find venv/cpython/Doc/locales/fa/LC_MESSAGES -name "*.po" | python3 scripts/compile_mo.py - python -m sphinx -T -j auto -b html + --color -d $READTHEDOCS_OUTPUT/doctrees -D language=fa - -D locale_dirs=locales - -D gettext_compact=0 -D gettext_allow_fuzzy_translations=1 - -D html_theme_options.is_rtl=1 + -D suppress_warnings=misc.highlighting_failure + -D gettext_compact=0 + -D html_theme_options.is_rtl=true + --keep-going venv/cpython/Doc $READTHEDOCS_OUTPUT/html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7780cce6..d452d4ec7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -# راهنمای مشارکت در ترجمهٔ مستندات پایتون +# راهنمای مشارکت در ترجمه‌ی مستندات پایتون این راهنما مکمل [README.md](README.md) است و جزئیات فنی و فرایندهای پروژه را توضیح می‌دهد. پیش از شروع، حتماً [README.md](README.md) و [واژه‌نامه (GLOSSARY.md)](GLOSSARY.md) را هم بخوانید. -تمام مشارکت‌کنندگان موظف‌اند از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنند. این تعهد در همهٔ ایشیوها و پول‌ریکوئست‌ها به‌صورت یک چک‌باکس ثبت می‌شود. +تمام مشارکت‌کنندگان موظف‌اند از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنند. این تعهد در همه‌ی ایشیوها و پول‌ریکوئست‌ها به‌صورت یک چک‌باکس ثبت می‌شود. ## شروع کار -1. ریپازیتوری را روی GitHub **فورک** کنید و نسخهٔ خودتان را کلون کنید: +1. ریپازیتوری را روی GitHub **منشعب** کنید و نسخه‌ی خودتان را رونوشت کنید: ```bash git clone https://github.com//python-docs-fa.git cd python-docs-fa @@ -16,38 +16,38 @@ ```bash git checkout -b translate-functions ``` -3. کارتان را روی شاخهٔ `3.14` (شاخهٔ پیش‌فرض) آماده کنید. -4. بعد از ترجمه، تغییرات را روی شاخهٔ خودتان پوش کنید و یک **پول‌ریکوئست** به شاخهٔ `3.14` باز کنید. +3. کارتان را روی شاخه‌ی `3.14` (شاخه‌ی پیش‌فرض) آماده کنید. +4. بعد از ترجمه، تغییرات را روی شاخه‌ی خودتان پوش کنید و یک **پول‌ریکوئست** به شاخه‌ی `3.14` باز کنید. ## ساختار فایل‌ها -فایل‌های `.po` ساختار مستندات اصلی پایتون را دنبال می‌کنند؛ یعنی هر فایل مربوط به یک صفحهٔ مستندات است: +فایل‌های `.po` ساختار مستندات اصلی پایتون را دنبال می‌کنند؛ یعنی هر فایل مربوط به یک صفحه‌ی مستندات است: -- `bugs.po` — صفحهٔ «گزارش باگ» +- `bugs.po` — صفحه‌ی «گزارش باگ» - `tutorial/*.po` — آموزش پایتون -- `library/*.po` — کتابخانهٔ استاندارد +- `library/*.po` — کتابخانه‌ی استاندارد - `c-api/*.po` — رابط C - `using/`، `reference/`، `howto/`، `faq/`، `whatsnew/`، `extending/`، `installing/`، `distributing/`، `deprecations/` و غیره -هر فایل `.po` شامل جفت‌های `msgid` (متن انگلیسی) و `msgstr` (ترجمهٔ فارسی) است. +هر فایل `.po` شامل جفت‌های `msgid` (متن انگلیسی) و `msgstr` (ترجمه‌ی فارسی) است. ## انواع ایشیو -پیش از باز کردن ایشیوی جدید، قالب مناسب را از [صفحهٔ ایشیوهای پروژه](https://github.com/python/python-docs-fa/issues/new/choose) انتخاب کنید. سه قالب موجود است: +پیش از باز کردن ایشیوی جدید، قالب مناسب را از [صفحه‌ی ایشیوهای پروژه](https://github.com/python/python-docs-fa/issues/new/choose) انتخاب کنید. سه قالب موجود است: -- **درخواست ترجمهٔ صفحه:** برای اعلام اینکه می‌خواهید صفحه‌ای را ترجمه کنید، یا برای درخواست اولویت‌دادن به ترجمهٔ یک صفحهٔ خاص (مثلاً چون برای فعال‌سازی فارسی در تغییردهندهٔ زبان لازم است). قبل از شروع ترجمهٔ هر فایل، از همین قالب استفاده کنید تا دیگران بدانند آن فایل در حال انجام است. -- **پرسش یا پیشنهاد واژه‌نامه:** برای سؤال دربارهٔ قواعد ترجمه، یا پیشنهاد اصطلاح جدید برای افزودن به `GLOSSARY.md`. -- **اشکال در ترجمه:** برای گزارش ترجمهٔ نادرست یا مشکل‌دار در یک صفحهٔ منتشرشده. `msgid`، `msgstr` فعلی، و ترجمهٔ پیشنهادی خود را در قالب وارد کنید. +- **درخواست ترجمه‌ی صفحه:** برای اعلام اینکه می‌خواهید صفحه‌ای را ترجمه کنید، یا برای درخواست اولویت‌دادن به ترجمه‌ی یک صفحه‌ی خاص (مثلاً چون برای فعال‌سازی فارسی در تغییردهنده‌ی زبان لازم است). قبل از شروع ترجمه‌ی هر فایل، از همین قالب استفاده کنید تا دیگران بدانند آن فایل در حال انجام است. +- **پرسش یا پیشنهاد واژه‌نامه:** برای سؤال درباره‌ی قواعد ترجمه، یا پیشنهاد اصطلاح جدید برای افزودن به `GLOSSARY.md`. +- **اشکال در ترجمه:** برای گزارش ترجمه‌ی نادرست یا مشکل‌دار در یک صفحه‌ی منتشرشده. `msgid`، `msgstr` فعلی، و ترجمه‌ی پیشنهادی خود را در قالب وارد کنید. ## فرایند ترجمه -1. فایلی را انتخاب کنید و بررسی کنید آیا [ایشیوی](https://github.com/python/python-docs-fa/issues) مربوط به آن باز شده است یا نه (قالب «درخواست ترجمهٔ صفحه»). اگر باز شده و ترجمهٔ کامل آن در حال انجام است، فایل دیگری را انتخاب کنید؛ در غیر این صورت یک ایشیو باز کرده و شروع به کار کنید. +1. فایلی را انتخاب کنید و بررسی کنید آیا [ایشیوی](https://github.com/python/python-docs-fa/issues) مربوط به آن باز شده است یا نه (قالب «درخواست ترجمه‌ی صفحه»). اگر باز شده و ترجمه‌ی کامل آن در حال انجام است، فایل دیگری را انتخاب کنید؛ در غیر این صورت یک ایشیو باز کرده و شروع به کار کنید. 2. فایل `.po` مورد نظر را با [Poedit](https://poedit.net) یا هر ویرایشگر متنی باز کنید. - در Poedit رشته‌های ترجمه‌نشده یا `fuzzy` را از پنل فیلتر (Filter) پیدا کنید. 3. متن `msgid` را ترجمه کنید و در `msgstr` وارد کنید. -4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. در `` :term:`target` ``، اگر عبارت داخل بک‌تیک با شناسهٔ واژه‌نامه یکی است، می‌توانید آن را به شکل `` :term:`ترجمه ` `` بنویسید تا هم متن ترجمه‌شده نمایش داده شود و هم لینک درست کار کند؛ در این حالت فقط بخش نمایشی (پیش از `<`) ترجمه می‌شود و `target` داخل `<>` باید دقیقاً همان شناسهٔ انگلیسی اصلی (بدون تغییر) باقی بماند، چون تغییر آن لینک را خراب می‌کند. +4. **نشانه‌گذاری‌های Sphinx** مثل `` :class:`int` `` ، `` :func:`repr` `` ، `` :ref:`...` `` ، `` ``code`` `` و **جای‌گذارها** مثل `%s` یا `{name}` را دقیقاً بدون تغییر نگه دارید؛ فقط متن اطراف آن‌ها ترجمه می‌شود. در `` :term:`target` ``، اگر عبارت داخل بک‌تیک با شناسه‌ی واژه‌نامه یکی است، می‌توانید آن را به شکل `` :term:`ترجمه ` `` بنویسید تا هم متن ترجمه‌شده نمایش داده شود و هم لینک درست کار کند؛ در این حالت فقط بخش نمایشی (پیش از `<`) ترجمه می‌شود و `target` داخل `<>` باید دقیقاً همان شناسه‌ی انگلیسی اصلی (بدون تغییر) باقی بماند، چون تغییر آن لینک را خراب می‌کند. 5. داخل کدها (بلوک‌های `code-block`) نام متغیرها، توابع و کلمات کلیدی را ترجمه نکنید؛ فقط رشته‌ها و کامنت‌ها را می‌توانید ترجمه کنید. -6. از [واژه‌نامهٔ پروژه (GLOSSARY.md)](GLOSSARY.md) برای ثابت نگه‌داشتن اصطلاحات استفاده کنید. +6. از [واژه‌نامه‌ی پروژه (GLOSSARY.md)](GLOSSARY.md) برای ثابت نگه‌داشتن اصطلاحات استفاده کنید. 7. اگر به اصطلاحی برخوردید که در واژه‌نامه نبود، ترجمه‌ای برای آن انتخاب کنید و به واژه‌نامه اضافه کنید. ### بررسی‌ها قبل از ارسال پول‌ریکوئست @@ -62,42 +62,42 @@ python3 scripts/check_markup.py your_file.po روی هر پول‌ریکوئست، به‌صورت خودکار این بررسی‌ها (به‌همراه `sphinx-lint` و ساخت کامل مستندات) در GitHub Actions اجرا می‌شوند. -پس از باز کردن پول‌ریکوئست، ری‌دتردکس (Read the Docs) به‌صورت خودکار نسخهٔ ساخته‌شدهٔ مستندات را می‌سازد؛ از بخش checks پول‌ریکوئست می‌توانید لینک پیش‌نمایش را باز کنید و ترجمهٔ خود را به‌صورت رندرشده ببینید. +پس از باز کردن پول‌ریکوئست، ری‌دتردکس (Read the Docs) به‌صورت خودکار نسخه‌ی ساخته‌شده‌ی مستندات را می‌سازد؛ از بخش checks پول‌ریکوئست می‌توانید لینک پیش‌نمایش را باز کنید و ترجمه‌ی خود را به‌صورت رندرشده ببینید. ## نکات نگارشی و تایپوگرافی فارسی برای یکدست ماندن ترجمه‌ها، این نکات نگارشی را رعایت کنید: -- **نیم‌فاصله (ZWNJ):** در جاهایی که نیم‌فاصله لازم است (مثل «می‌شود»، «می‌کنید»، جمع با «ها» نظیر «فایل‌ها»، یا پیشوندهایی مثل «بی‌» و «نا‌») از کاراکتر نیم‌فاصلهٔ واقعی (U+200C) استفاده کنید، نه فاصلهٔ معمولی یا بدون فاصله. مثال درست: «فایل‌های ترجمه‌نشده». مثال نادرست: «فایل های ترجمه نشده» یا «فایلهای ترجمه‌نشده». -- **اعداد فارسی در برابر اعداد لاتین:** در متن روایی فارسی از ارقام فارسی (۰۱۲۳۴۵۶۷۸۹) استفاده کنید (مثلاً «در نسخهٔ ۳ پایتون»). اما داخل کد، شمارهٔ نسخهٔ پایتون، مسیر فایل‌ها، لینک‌ها و هر جایی که عدد بخشی از یک شناسهٔ فنی است (مثل `v3.14.6`)، همیشه از ارقام لاتین استفاده کنید و آن‌ها را تغییر ندهید. +- **نیم‌فاصله (ZWNJ):** در جاهایی که نیم‌فاصله لازم است (مثل «می‌شود»، «می‌کنید»، جمع با «ها» نظیر «فایل‌ها»، یا پیشوندهایی مثل «بی‌» و «نا‌») از کاراکتر نیم‌فاصله‌ی واقعی (U+200C) استفاده کنید، نه فاصله‌ی معمولی یا بدون فاصله. مثال درست: «فایل‌های ترجمه‌نشده». مثال نادرست: «فایل های ترجمه نشده» یا «فایلهای ترجمه‌نشده». +- **اعداد فارسی در برابر اعداد لاتین:** در متن روایی فارسی از ارقام فارسی (۰۱۲۳۴۵۶۷۸۹) استفاده کنید (مثلاً «در نسخه‌ی ۳ پایتون»). اما داخل کد، شماره‌ی نسخه‌ی پایتون، مسیر فایل‌ها، لینک‌ها و هر جایی که عدد بخشی از یک شناسه‌ی فنی است (مثل `v3.14.6`)، همیشه از ارقام لاتین استفاده کنید و آن‌ها را تغییر ندهید. - **علائم نگارشی فارسی در برابر انگلیسی:** در متن فارسی از علائم فارسی استفاده کنید: «،» به‌جای «,» و «؟» به‌جای «?». علائمی که داخل کد، نشانه‌گذاری‌های Sphinx، یا جای‌گذارها هستند دست‌نخورده باقی می‌مانند (چون بخشی از متن انگلیسی اصلی محسوب نمی‌شوند و نباید تغییر کنند). ## سطح رسمیت و لحن نوشتار -مستندات پایتون رسمی هستند، پس ترجمهٔ فارسی هم باید در سطح **رسمی** نوشته شود؛ نه محاوره‌ای و نه بیش‌ازحد تشریفاتی. چند نکتهٔ عملی: +مستندات پایتون رسمی هستند، پس ترجمه‌ی فارسی هم باید در سطح **رسمی** نوشته شود؛ نه محاوره‌ای و نه بیش‌ازحد تشریفاتی. چند نکته‌ی عملی: - برای اشاره به خواننده همیشه از «شما» استفاده کنید، نه «تو». این مورد باید در کل فایل و در کل پروژه یکدست بماند. - افعال را به‌صورت رسمی و کامل بنویسید (مثلاً «می‌توانید» نه «می‌تونید»). - از واژه‌های محاوره‌ای، اختصارات غیررسمی یا شکسته‌نویسی خودداری کنید. -- لحن باید دوستانه و راهنما باشد، اما رسمیتِ متن باید همان سطحی باشد که در مستندات رسمی سایر زبان‌ها (مثل نسخهٔ انگلیسی) دیده می‌شود. +- لحن باید دوستانه و راهنما باشد، اما رسمیتِ متن باید همان سطحی باشد که در مستندات رسمی سایر زبان‌ها (مثل نسخه‌ی انگلیسی) دیده می‌شود. ## رشته‌های fuzzy -رشته‌های `fuzzy` یعنی ترجمهٔ قبلی وجود دارد اما به دلیل تغییر متن اصلی (یا مداخلهٔ ابزارها) باید دوباره بررسی شود. این رشته‌ها در نسخهٔ نهایی ساخته‌شدهٔ مستندات نمایش داده نمی‌شوند و در جدول `STATUS.md` نیز در ستون «Fuzzy» شمارش می‌شوند. حتماً آن‌ها را بررسی، بازنویسی و سپس علامت `fuzzy` را حذف کنید. +رشته‌های `fuzzy` یعنی ترجمه‌ی قبلی وجود دارد اما به دلیل تغییر متن اصلی (یا مداخله‌ی ابزارها) باید دوباره بررسی شود. این رشته‌ها در نسخه‌ی نهایی ساخته‌شده‌ی مستندات نمایش داده نمی‌شوند و در جدول `STATUS.md` نیز در ستون «Fuzzy» شمارش می‌شوند. حتماً آن‌ها را بررسی، بازنویسی و سپس علامت `fuzzy` را حذف کنید. -## سربرگ فایل‌های `.po` و اعتبار مترجمان +## سرآیند فایل‌های `.po` و اعتبار مترجمان -هر فایل `.po` در بخش سربرگ خود دو جایگاه برای ثبت اعتبار دارد: +هر فایل `.po` در بخش سرآیند خود دو جایگاه برای ثبت اعتبار دارد: -- کامنت `# Translators:` — فهرست همهٔ کسانی که در ترجمهٔ آن فایل مشارکت داشته‌اند. +- کامنت `# Translators:` — فهرست همه‌ی کسانی که در ترجمه‌ی آن فایل مشارکت داشته‌اند. - فیلد `Last-Translator:` — آخرین کسی که فایل را ویرایش کرده است. -**قانون اعتبار:** ترجیحاً هر وقت فایلی را ویرایش می‌کنید، فیلد `Last-Translator:` را به نام خودتان تغییر دهید (به فرمت `نام <ایمیل>, سال`) و اگر نامتان در فهرست `# Translators:` نیست، آن را اضافه کنید. این کار **اختیاری** است: هماهنگ‌کننده/بازبین نهایی و اسکریپت `update_po_headers.py` (که در ادامه شرح داده شده) این اعتبارها را به‌صورت خودکار از تاریخچهٔ git بازسازی می‌کنند، پس اگر آن را انجام ندهید نگران نباشید. +**قانون اعتبار:** ترجیحاً هر وقت فایلی را ویرایش می‌کنید، فیلد `Last-Translator:` را به نام خودتان تغییر دهید (به فرمت `نام <ایمیل>, سال`) و اگر نامتان در فهرست `# Translators:` نیست، آن را اضافه کنید. این کار **اختیاری** است: هماهنگ‌کننده/بازبین نهایی و اسکریپت `update_po_headers.py` (که در ادامه شرح داده شده) این اعتبارها را به‌صورت خودکار از تاریخچه‌ی git بازسازی می‌کنند، پس اگر آن را انجام ندهید نگران نباشید. -برای بازسازی خودکار این اعتبارها از تاریخچهٔ git، اسکریپت زیر وجود دارد: +برای بازسازی خودکار این اعتبارها از تاریخچه‌ی git، اسکریپت زیر وجود دارد: ```bash -# بازسازی اعتبارهای همهٔ فایل‌ها از git history +# بازسازی اعتبارهای همه‌ی فایل‌ها از git history python3 scripts/update_po_headers.py # فقط پیش‌نمایش بدون اعمال تغییر @@ -112,9 +112,9 @@ python3 scripts/update_po_headers.py --no-credits \ python3 scripts/update_po_headers.py --merge bugs.po tutorial/ ``` -> اسکریپت فقط سربرگ را تغییر می‌دهد و به متن ترجمه‌ها دست نمی‌زند، اما حساب‌های خودکار (مثل ربات‌های GitHub Actions) را از فهرست مترجمان حذف می‌کند. جزئیات کامل در docstring خود اسکریپت آمده است. +> اسکریپت فقط سرآیند را تغییر می‌دهد و به متن ترجمه‌ها دست نمی‌زند، اما حساب‌های خودکار (مثل ربات‌های GitHub Actions) را از فهرست مترجمان حذف می‌کند. جزئیات کامل در docstring خود اسکریپت آمده است. -## اندازهٔ پول‌ریکوئست +## اندازه‌ی پول‌ریکوئست هر پول‌ریکوئست را به **حداکثر ۴ فایل `.po`** محدود کنید. این محدودیت هم از پول‌ریکوئست‌های بزرگ و غیرقابل‌بازبینی جلوگیری می‌کند و هم از سیل پول‌ریکوئست‌های تک‌فایلی برای فایل‌های خیلی کوچک. اگر چند فایل کوچک و مرتبط دارید (مثلاً چند فایل زیر یک پوشه)، بسته‌بندی‌شان در یک پول‌ریکوئست مشکلی ندارد، تا سقف ۴ فایل. برای فایل‌های بزرگ، یک پول‌ریکوئست جداگانه برای هرکدام بهتر است. @@ -126,25 +126,25 @@ python3 scripts/update_po_headers.py --merge bugs.po tutorial/ - **مترجم:** فایل‌ها را ترجمه می‌کند و پول‌ریکوئست می‌زند. - **بازبین (reviewer):** ترجمه‌ها را از نظر صحت، یکدستی و رعایت واژه‌نامه بررسی می‌کند. -- **هماهنگ‌کننده (coordinator):** بر فرایندها نظارت دارد، پول‌ریکوئست‌ها را ادغام می‌کند و اعتبار مترجمان را در سربرگ فایل‌ها ثبت می‌کند. +- **هماهنگ‌کننده (coordinator):** بر فرایندها نظارت دارد، پول‌ریکوئست‌ها را ادغام می‌کند و اعتبار مترجمان را در سرآیند فایل‌ها ثبت می‌کند. فهرست اعضای تیم همراه با آمار مشارکت در [TEAM.md](TEAM.md) نگهداری می‌شود. -ستون «Translated Count» در `TEAM.md` توسط `scripts/team_stats.py` محاسبه می‌شود: اسکریپت روی همهٔ فایل‌های `.po` تعداد رشته‌های ترجمه‌شده (به‌جز `fuzzy`) را می‌شمارد و با `git blame` هر رشته را به نویسندهٔ کامیتی نسبت می‌دهد که آخرین‌بار آن سطر را تغییر داده است. کامیت‌های مکانیکی (همگام‌سازی با CPython، به‌روزرسانی سربرگ «Update .po files» و کامیت‌های ربات/Transifex) شمرده نمی‌شوند و رشته‌های بدون نویسندهٔ مشخص در ردیف «(unassigned)» می‌افتند. این عدد تقریبی است و با توجه به ماهیت git، سهم مترجمان دورهٔ Transifex که کارشان از طریق کامیت ربات وارد شده را نشان نمی‌دهد. این به‌روزرسانی به‌همراه بازسازی اعتبارهای سربرگ (با `update_po_headers.py`) و جدول `STATUS.md`، شبانه توسط گردش‌کار `.github/workflows/maintenance.yml` انجام می‌شود. +ستون «Translated Count» در `TEAM.md` توسط `scripts/team_stats.py` محاسبه می‌شود: اسکریپت روی همه‌ی فایل‌های `.po` تعداد رشته‌های ترجمه‌شده (به‌جز `fuzzy`) را می‌شمارد و با `git blame` هر رشته را به نویسنده‌ی کامیتی نسبت می‌دهد که آخرین‌بار آن ردیف را تغییر داده است. کامیت‌های مکانیکی (همگام‌سازی با CPython، به‌روزرسانی سرآیند «Update .po files» و کامیت‌های ربات/Transifex) شمرده نمی‌شوند و رشته‌های بدون نویسنده‌ی مشخص در ردیف «(unassigned)» می‌افتند. این عدد تقریبی است و با توجه به ماهیت git، سهم مترجمان دوره‌ی Transifex که کارشان از طریق کامیت ربات وارد شده را نشان نمی‌دهد. این به‌روزرسانی به‌همراه بازسازی اعتبارهای سرآیند (با `update_po_headers.py`) و جدول `STATUS.md`، شبانه توسط گردش‌کار `.github/workflows/maintenance.yml` انجام می‌شود. ## همگام‌سازی با نسخه‌های جدید پایتون -وقتی نسخهٔ جدیدی از پایتون منتشر می‌شود، متن انگلیسی مستندات تغییر می‌کند و فایل‌های `.po` باید با آن همگام شوند. اسکریپت `scripts/update_python_version.py` این کار را خودکار می‌کند: +وقتی نسخه‌ی جدیدی از پایتون منتشر می‌شود، متن انگلیسی مستندات تغییر می‌کند و فایل‌های `.po` باید با آن همگام شوند. اسکریپت `scripts/update_python_version.py` این کار را خودکار می‌کند: ```bash -# همگام‌سازی با نسخهٔ مشخص +# همگام‌سازی با نسخه‌ی مشخص python3 scripts/update_python_version.py v3.14.6 # نگه‌داشتن کپی موقت برای بررسی دستی python3 scripts/update_python_version.py v3.15.0 --keep-src ``` -این اسکریپت نسخهٔ مشخص‌شدهٔ CPython را کلون می‌کند، قالب‌های gettext (`*.pot`) را از روی آن می‌سازد، فایل‌های `.po` موجود را با `msgmerge` به‌روزرسانی می‌کند، برای صفحات جدید فایل `.po` تازه می‌سازد و در پایان همهٔ فایل‌ها را با `msgfmt --check` صحت‌سنجی می‌کند. بعد از اجرای آن، خروجی را بازبینی کنید و اعتبارهای سربرگ را (در صورت نیاز با `scripts/update_po_headers.py`) به‌روزرسانی کنید. +این اسکریپت نسخه‌ی مشخص‌شده‌ی CPython را رونوشت می‌کند، قالب‌های gettext (`*.pot`) را از روی آن می‌سازد، فایل‌های `.po` موجود را با `msgmerge` به‌روزرسانی می‌کند، برای صفحات جدید فایل `.po` تازه می‌سازد و در پایان همه‌ی فایل‌ها را با `msgfmt --check` صحت‌سنجی می‌کند. بعد از اجرای آن، خروجی را بازبینی کنید و اعتبارهای سرآیند را (در صورت نیاز با `scripts/update_po_headers.py`) به‌روزرسانی کنید. ## وضعیت ترجمه‌های باقی‌مانده diff --git a/GLOSSARY.md b/GLOSSARY.md index b8d8681b4..a6d37c1ed 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -2,102 +2,494 @@ ما توی واژه‌نامه یه سری معادل فارسی برای کلمات و عبارت‌های تخصصی فهرست کردیم که باید موقع ترجمه به اونها پایبند بمونیم. همچنین بهتره که بعضی از کلمات/عبارات رو ترجمه نکنیم و براشون معادل فارسی درنظر نگیریم، درحالی که بعضی از اونها چندین معادل دارن که می‌تونیم برحسب شرایط به انتخاب خودمون استفاده کنیم. یکی از اهداف اصلی ما کامل کردن واژه‌نامه‌ست تا بتونیم فرایند ترجمه رو راحت‌تر کنیم و کیفیت ترجمه رو بالا ببریم، بنابراین اگر که معادل فارسی بهتری برای موارد زیر مدنظر دارید حتما اونها رو اصلاح کنید. -> این واژه‌نامه با الهام از واژه‌نامه پروژهٔ ترجمه مستندات Vue.js به فارسی تهیه شده و از ساختار و توضیحات دقیق اون استفاده شده. با تشکر از مشارکت‌کنندگان این پروژه برای زحماتشون: +> این واژه‌نامه با الهام از واژه‌نامه پروژه‌ی ترجمه مستندات Vue.js به فارسی تهیه شده و از ساختار و توضیحات دقیق اون استفاده شده. با تشکر از مشارکت‌کنندگان این پروژه برای زحماتشون: > https://github.com/vuejs-translations/docs-fa/blob/main/GLOSSARY.md -| English | فارسی | -| ------------------ | ----------------------- | -| accessibility | دسترسی‌پذیری | -| API | API | -| argument | آرگومان | -| async | ناهمگام، غیرهمگام | -| attribute | ویژگی، صفت، شاخصه | -| await | await | -| boolean | بولی | -| built-in | توکار، درونی، درون‌ساخته | -| cache | نهانگاه | -| callback | کال‌بک، فراخوانی بازگشتی | -| character | نویسه | -| class | کلاس | -| command line | خط فرمان | -| community | کامیونیتی | -| component | کامپوننت | -| context management | مدیریت زمینه | -| coroutine | هم‌روال | -| custom | سفارشی، اختصاصی | -| debugging | اشکال‌زدایی، دیباگ کردن | -| decoding | کدگشایی | -| decorator | دکوراتور، آراینده | -| dependency | وابستگی | -| deprecated | منسوخ، از رده خارج شده | -| dictionary | دیکشنری | -| directory | پوشه | -| DOM | DOM | -| duck-typing | نوع‌دهی اردکی | -| ecosystem | اکوسیستم | -| element | المان، عنصر | -| encoding | کدگذاری | -| endpoint | پایانه | -| escape | خنثی کردن | -| event | رویداد | -| exception | استثنا | -| expression | عبارت | -| f-string | اف‌استرینگ | -| function | تابع | -| garbage collection | زباله‌روبی | -| generator | تولیدگر | -| generic function | تابع عام، تابع عمومی | -| global | سراسری | -| hexadecimal | مبنای شانزده | -| immortal | نامیرا | -| immutable | تغییرناپذیر | -| import | ایمپورت | -| index | اندیس، شماره | -| instance | نمونه | -| integer | عدد صحیح | -| interface | رابط | -| interpreter | مفسر | -| item | آیتم | -| iterable | تکرارپذیر | -| keyword | کلیدواژه | -| keyword argument | آرگومان کلیدواژه‌ای | -| list | فهرست | -| list comprehension | درک فهرستی | -| load | بارگذاری | -| loader | بارگذار | -| local | محلی | -| loop | حلقه | -| metaclass | فراکلاس | -| method | متد | -| mock | ماک | -| module | ماژول | -| mutable | تغییرپذیر | -| namespace | نام‌فضا | -| object | شیء | -| operator | عملگر | -| package | بسته | -| parallelism | موازی‌سازی | -| parameter | پارامتر | -| positional | جایگاهی | -| property | ویژگی، پراپرتی، خصوصیت | -| quotation | علامت نقل‌قول | -| race | رقابت | -| raise | پرتاب | -| return | بازگشت، برگرداندن | -| runtime | ران‌تایم | -| scope | محدوده | -| shadowing | پوشاندن | -| shell | پوسته | -| stack traceback | ردگیری پشته | -| statement | دستور | -| string | رشته | -| syntactic sugar | قند نحوی | -| syntax | سینتکس، نحو | -| thread | نخ | -| tracking | پیگیری | -| type | نوع، نوع داده، تایپ | -| unit test | یونیت تست | -| unpacking | واگشایی | -| value | مقدار | -| variable | متغیر | -| wrapper | پوششی، دربرگیرنده | +| English | فارسی | +| --- | --- | +| `__pycache__` | `__pycache__` | +| ABC | کلاس پایه انتزاعی | +| abstract base class | کلاس پایه انتزاعی | +| accessibility | دسترسی‌پذیری | +| action | اکشن، کنش | +| anchor | لنگر | +| annotate | حاشیه‌نویسی کردن | +| annotation | حاشیه‌نویسی | +| API | API | +| argument | آرگومان | +| ASCII | اسکی | +| assertion | ادعا، شرط | +| async | ناهمگام، غیرهمگام | +| asynchronous context manager | مدیر زمینه ناهمگام | +| asynchronous generator | تولیدگر ناهمگام | +| asynchronous iterable | پیمایش‌پذیر ناهمگام | +| asynchronous iterator | پیمایش‌گر ناهمگام | +| attribute | ویژگی، صفت، شاخصه | +| attribute reference | ارجاع به ویژگی | +| audit | حسابرسی | +| autospeccing | مشخصه‌گذاری خودکار | +| availability | دسترس‌پذیری | +| await | await | +| awaitable | انتظارپذیر، awaitable | +| backend | بک‌اند | +| backreference | بازارجاع | +| backslash | بک‌اسلش | +| backspace | بک‌اسپیس، پس‌بر | +| barrier | سد | +| BDFL | BDFL (دیکتاتور خیرخواه مادام‌العمر) | +| big-endian | بزرگ‌اندیان | +| binary | دودویی | +| binary file | پرونده دودویی | +| bind | مقید کردن | +| bitmap | بیت‌مپ | +| bitmask | نقاب بیتی | +| bitwise mask | نقاب بیتی | +| blob | بلاب | +| boilerplate | کد پیش‌ساخته، متن قالبی | +| bom, byte-order mark | نشانگر ترتیب بایت | +| boolean | بولی | +| bootstrapping | بوت‌استرپینگ | +| borrowed reference | ارجاع امانتی | +| bot | بات | +| bottom tee | tee پایین | +| bounding box | جعبه‌ی محدودکننده | +| bound | کران | +| broadcast (network/event) | پخش | +| broadcasting (array) | بسط‌دهی | +| buffer | بافر | +| built-in | توکار، درونی، درون‌ساخته | +| by-name | نام‌محور | +| bytecode | بایت‌کد | +| bytes-like object | شیء شبه‌بایت | +| CA | مرجع صدور گواهی | +| cache | نهانگاه | +| calendar | گاه‌شماری | +| callable | فراخوانی‌پذیر | +| callback | کال‌بک، فراخوانی بازگشتی | +| canonical | کانونیکال | +| capture pattern | الگوی ثبت‌کننده | +| capturing group | گروه ثبت‌کننده | +| cardinality | کاردینالیتی | +| carriage return | بازگشت به ابتدای سطر | +| cast | تبدیل نوع، قالب‌ریزی | +| certification | گواهی‌سازی | +| certificate | گواهی | +| character | نویسه | +| checkbutton | دکمه‌ی انتخابی | +| checksum | جمع‌آزما | +| chunked | بخش‌بندی‌شده | +| cipher | رمز | +| class | کلاس | +| class method | متد کلاس | +| class variable | متغیر کلاس | +| classmethod | classmethod | +| CLI | رابط خط فرمان، CLI | +| clone | رونوشت | +| closure | بستار | +| code point | نقطه‌کد | +| coercion | تبدیل ضمنی نوع | +| collation | ترتیب‌گذاری | +| column | ستون | +| combobox | جعبه انتخاب | +| command line | خط فرمان | +| comment | کامنت | +| commit (database transaction) | ثبت نهایی | +| community | کامیونیتی | +| compile | کامپایل | +| compiled | کامپایل‌شده | +| component | کامپوننت، جزء | +| container | ظرف | +| context | زمینه | +| context management | مدیریت زمینه | +| context manager | مدیر زمینه | +| context variable | متغیر زمینه | +| contiguous | پیوسته | +| contravariant | پادوردا | +| converter | مبدل | +| converter function | تابع تبدیل‌کننده | +| coroutine | هم‌روال | +| covariant | هم‌وردا | +| CPU-bound | محدود به CPU | +| CPython | سی‌پایتون | +| crash | فروپاشی | +| CRL | فهرست لغو گواهی | +| cursor | مکان‌نما | +| cursor (database) | نشانگر | +| custom | سفارشی، اختصاصی | +| daemon | دِیمِن | +| dataclass | دیتاکلاس | +| debugging | اشکال‌زدایی، دیباگ کردن | +| decoding | کدگشایی | +| decompressor | واگشا | +| decorator | دکوراتور، آراینده | +| deferred reference counting | شمارش ارجاعِ معوق | +| delegation | واگذاری | +| delta | دلتا | +| dependency | وابستگی | +| dependency resolution | حل وابستگی | +| deprecated | منسوخ، از رده خارج شده | +| deque | صف دوطرفه | +| descriptor | توصیف‌گر | +| deserialization | سریال‌زدایی | +| deserialize | سریال‌زدایی کردن | +| deserializer | سریال‌زدا | +| dialect | گویش | +| dictionary | دیکشنری | +| dictionary comprehension | درک دیکشنری | +| dictionary view | نمای دیکشنری | +| directive | دایرکتیو | +| directory | پوشه | +| disassemble | واسازی کردن | +| disassembler | واساز | +| dispatch table | جدول نگاشت | +| docstring | رشته مستند | +| DOM | DOM | +| double (double precision) | ممیز شناور با دقت مضاعف | +| drop-in | جایگزین مستقیم | +| duck-typing | نوع‌دهی اردکی | +| dump | برون‌ریزی | +| EAFP | EAFP (بهتر است پوزش بخواهی تا اجازه) | +| ecosystem | اکوسیستم | +| element | المان، عنصر | +| ellipsis | سه‌نقطه | +| Ellipsis | Ellipsis | +| encoding | کدگذاری | +| endian | اندیان | +| endianness | ترتیب بایت | +| endpoint | پایانه | +| entitlement | حق دسترسی | +| entity | موجودیت | +| enum | enum | +| envelope | پاکت | +| EOF | EOF، پایان پرونده | +| epoch | مبدأ زمان | +| escape | خنثی کردن، گریز | +| event | رویداد | +| exception | استثنا | +| executor | اجراکننده | +| expression | عبارت | +| extended hex alphabet | الفبای مبنای شانزده‌ی توسعه‌یافته | +| extension module | ماژول توسعه‌ای | +| extension types | نوع‌های توسعه‌ای | +| f-string | اف‌استرینگ | +| facility | امکان، دسته گزارش | +| factory function | تابع کارخانه‌ای | +| fallback | جایگزین | +| file object | شیء پرونده | +| file-like object | شیء شبه‌پرونده | +| filesystem encoding | کدگذاری فایل‌سیستم | +| finalizer | نهایی‌ساز | +| finder | یابنده | +| fixture | ثابت آزمایشی | +| flattening | تخت‌سازی | +| float (type) | اعشاری | +| float (value) | عدد اعشاری | +| floating point (adj., representation) | ممیز شناور | +| floating-point arithmetic | محاسبات ممیز شناور | +| floating-point number | عدد ممیز شناور | +| floor division | تقسیم کف | +| folding | تا کردن | +| fork | انشعاب، فورک | +| form feed | تغذیه‌ی صفحه | +| formatter | قالب‌بند | +| forward reference | ارجاع پیشرو | +| free threading | نخ‌بندی آزاد | +| free variable | متغیر آزاد | +| free-threaded | نخ‌آزاد | +| function | تابع | +| function annotation | حاشیه‌نویسی تابع | +| futures | آینده‌نماها، فیوچرز | +| garbage collection | زباله‌روبی | +| generator | تولیدگر | +| generator expression | عبارت تولیدگر | +| generic | عام | +| generic function | تابع عام، تابع عمومی | +| generic type | نوع عام | +| GIL | قفل مفسر سراسری | +| global | سراسری، عمومی | +| guard | نگهبان | +| handshake | دست‌دهی | +| handle | دسته | +| handler | هندلر | +| hash-based pyc | pyc مبتنی بر هش | +| hashable | هش‌پذیر | +| header | سرآیند | +| heap | هیپ | +| hex | مبنای شانزده | +| hexadecimal | مبنای شانزده | +| hook | قلاب | +| howto | راهنمای عملی | +| IDE | IDE, محیط توسعه یکپارچه | +| idempotent | هم‌توان | +| IDN | IDN، دامنه اینترنتی بین‌المللی | +| immortal | نامیرا | +| immutable | تغییرناپذیر | +| import | ایمپورت | +| import path | مسیر ایمپورت | +| importing | ایمپورت کردن | +| index | اندیس، شماره | +| inode | آی‌نود | +| instance | نمونه | +| integer | عدد صحیح | +| interactive | تعاملی | +| interface | رابط | +| interpolation | درون‌یابی | +| interpreted | تفسیرشده | +| interpreter | مفسر | +| invariant | ناوردا | +| IPC | ارتباط بین‌فرایندی | +| item | آیتم | +| iterable | پیمایش‌پذیر | +| iterate | پیمایش کردن | +| iteration | پیمایش | +| iterator | پیمایش‌گر | +| join | پیوستن، الحاق | +| junction | اتصال | +| key function | تابع کلید | +| keybinding | کلیدبندی | +| keyword | کلیدواژه | +| keyword argument | آرگومان کلیدواژه‌ای | +| lambda | لامبدا | +| LBYL | LBYL (نگاه کن پیش از پریدن) | +| line | سطر | +| line feed | تغذیه‌ی سطر | +| list | فهرست | +| list comprehension | درک فهرستی | +| literal | لفظی | +| literals | مقادیر لفظی | +| little-endian | کوچک‌اندیان | +| load | بارگذاری | +| loader | بارگذار | +| local | محلی | +| locale | locale | +| logger | گزارش‌گیر | +| logging | گزارش‌گیری | +| long distance matcher | تطبیق‌گر فاصله بلند | +| lookahead assertion | شرط پیش‌نگر | +| lookbehind assertion | شرط پس‌نگر | +| loop | حلقه | +| magic method | متد ویژه | +| manager | مدیر | +| map | نگاشت | +| mapped | نگاشت‌شده | +| mapping | نگاشت | +| marshal | مارشال‌کردن | +| marshaling/marshalling | مارشالینگ | +| mask | نقاب | +| master (pty) | اصلی | +| match finder | تطبیق‌یاب | +| max-heap | هیپ بیشینه | +| meta path finder | یابنده مسیر فرا | +| metaclass | فراکلاس | +| method | متد، روش | +| method resolution order (MRO) | ترتیب حل متد | +| min-heap | هیپ کمینه | +| mix-in | میکس‌این | +| mixed-in | افزوده‌شده، میکس‌این | +| mock | ماک | +| mode | حالت | +| module | ماژول | +| module spec | مشخصه ماژول | +| monkey-patch | مانکی‌پچ | +| mutable | تغییرپذیر | +| mutex | قفل متقابل | +| name resolution | حل نام | +| named tuple | تاپل نام‌دار | +| namespace | فضای نام | +| namespace package | بسته فضای‌نام | +| NaN | NaN | +| nested scope | محدوده تودرتو | +| no-op | عملیات بی‌اثر | +| non-capturing group | گروه غیرثبت‌کننده | +| notation | نمادگذاری، نماد | +| nul | تهی | +| object | شیء | +| octet | هشت‌بیتی | +| offset | آفست | +| opcode | کدعمل | +| operator | عملگر | +| optimized scope | محدوده بهینه‌شده | +| ordinal | ترتیبی | +| overload | سربارگذاری | +| overloaded | سربارگذاری‌شده | +| package | بسته | +| padding | پُرکننده، پدینگ | +| pane | بخش | +| parallelism | موازی‌سازی | +| parameter | پارامتر | +| parser | پارسر | +| patch | وصل | +| path entry | ورودی مسیر | +| path entry finder | یابنده ورودی مسیر | +| path entry hook | قلاب ورودی مسیر | +| path-based finder | یابنده مبتنی بر مسیر | +| path-like object | شیء شبه‌مسیر | +| pathname | مسیرنام | +| payload | بار | +| PEP | PEP (پیشنهاد بهبود پایتون) | +| persistence | ماندگاری | +| persistent | پایا | +| picklable | پیکل‌پذیر | +| pickle | پیکل | +| pickler | پیکل‌ساز | +| pipe | پایپ | +| placeholder | جای‌نگهدار | +| poll | پایش | +| polling | پایش | +| portion | بخش | +| positional | جایگاهی | +| positional argument | آرگومان جایگاهی | +| post-mortem debugging | اشکال‌زدایی پس از خاتمه | +| precision | دقت | +| predicate | محمول | +| process | فرایند | +| process-local | فرایندمحلی | +| process-safe | فرایندایمن | +| profiler | پروفایل‌گیر | +| profiling | پروفایل‌گیری | +| proleptic Gregorian | گاه‌شماری میلادی تعمیم‌یافته | +| prompt | اعلان | +| property | ویژگی، پراپرتی، خصوصیت | +| protocol | پروتکل | +| prototype | پیش‌نمونه | +| provisional API | API آزمایشی | +| proxy | پراکسی | +| pseudo-terminal | شبه‌پایانه | +| qualified | کامل | +| qualified name | نام کامل | +| qualifier | مشخص‌کننده | +| quantifier | کمیت‌گذار | +| quotation | علامت نقل‌قول | +| quoted-printable | quoted-printable | +| race | رقابت | +| realm | قلمرو | +| reentrancy | بازورودپذیری | +| reentrant | بازورودپذیر | +| refcount | شمارش ارجاع | +| reference | ارجاع | +| reference counting | شمارش ارجاع | +| register | ثبت کردن | +| registry | رجیستری | +| regular expression/RE | عبارت باقاعده | +| regular package | بسته معمولی | +| REPL | REPL، پوسته تعاملی پایتون | +| resolution | حل، وضوح | +| resolve | حل کردن | +| return | بازگشت، برگرداندن | +| reverse solidus | اسلش معکوس | +| rollback | بازگردانی | +| rollover | چرخش | +| row | ردیف | +| run time, run-time | زمان اجرا | +| runtime | ران‌تایم | +| salt | نمک | +| sandbox | سندباکس | +| sash | نوار جداکننده | +| scheme | طرح‌واره، طرح | +| scope | محدوده | +| seal | مهر و موم | +| seed | بذر | +| seek | مکان‌یابی کردن | +| seeking | مکان‌یابی | +| segmentation fault | خطای قطعه‌بندی (segmentation fault) | +| sentinel | نشانگر | +| sequence | دنباله | +| serialization | سریال‌سازی | +| set | مجموعه | +| set comprehension | درک مجموعه | +| shadowing | پوشاندن | +| shelf | قفسه | +| shell | پوسته | +| signal | سیگنال | +| single dispatch | ارسال تک‌گانه | +| single precision | دقت منفرد | +| singleton | تک‌نمونه | +| slave (pty) | پیرو | +| sleep | توقف | +| slice | اسلایس | +| slot | جایگاه | +| snapshot | تصویر لحظه‌ای | +| spec | مشخصات | +| special method | متد ویژه | +| spinbox | اسپین‌باکس | +| stack traceback | ردگیری پشته | +| state | وضعیت | +| statement | دستور | +| static method | متد ایستا | +| staticmethod | staticmethod | +| stipple | نقطه‌نگاری | +| string | رشته | +| stringifier | رشته‌ساز | +| struct sequence | دنباله ساختاری | +| stub | stub | +| subnormal | زیرنرمال | +| subscript | زیرنویس | +| subscription | زیرنویسی | +| suite | بدنه | +| surrogate | جانشین | +| symlink | پیوند نمادین | +| syntactic sugar | قند نحوی | +| syntax | سینتکس، نحو | +| t-string | تی‌استرینگ | +| task | وظیفه | +| test | آزمون | +| test fixture | ثابت آزمایشی | +| text encoding | کدگذاری متن | +| text file | پرونده متنی | +| thread | نخ | +| thread-local | نخ‌محلی | +| thread-safe | نخ‌ایمن | +| time tuple | تاپل زمانی | +| timeout | مهلت زمانی | +| titlecase | نگارش عنوان‌نویسی | +| titlecased | عنوان‌نویسی‌شده | +| TLS | TLS | +| token | توکن | +| tokenizer | توکن‌ساز | +| trace | ردگیری | +| tracking | پیگیری | +| trampoline | ترامپولین | +| transcode | بازکدگذاری کردن | +| transcoding | بازکدگذاری | +| transformer | تبدیل کننده | +| Transport Layer Security | امنیت لایه انتقال | +| trap (catch/intercept) | گرفتن، رهگیری کردن | +| trap (decimal signal mechanism) | تله | +| treeview | نمای درختی | +| triple-quoted string | رشته سه‌نقل‌قولی | +| turtle | turtle، لاک‌پشت | +| type | نوع، نوع داده، تایپ | +| type alias | مستعار نوع | +| type hint | راهنمای نوع | +| typeahead | پیش‌تایپ | +| unary | یک‌عملوندی | +| undo buffer | بافر لغو | +| unhashable | هش‌ناپذیر | +| unicode | یونیکد | +| unit test | آزمون واحد | +| universal | همگانی | +| universal newlines | سطرهای جدید همگانی | +| unmarshal | مارشال‌گشایی کردن | +| unmarshaling | مارشال‌گشایی | +| unpacking | واگشایی | +| unpacking assignments | انتساب‌های واگشایی | +| unpickle | پیکل‌گشایی | +| UTC | UTC، زمان هماهنگ جهانی | +| value | مقدار | +| variable | متغیر | +| variable annotation | حاشیه‌نویسی متغیر | +| view | نما | +| virtual environment | محیط مجازی | +| walrus operator | عملگر گراز دریایی | +| weak reference | ارجاع ضعیف | +| wide | پهن | +| widget | ابزارک | +| wildcard | وایلدکارد | +| wrap | پوشش دادن، دربرگرفتن | +| wrapper | پوششی، دربرگیرنده | +| write-back | بازنوشت | +| write-through | نوشتن‌همزمان | +| zero-padded | پرشده با صفر | +| zero-padding | پدینگ صفر | +| zero-width assertion | شرط با عرض صفر | +| zip application | برنامه zip | \ No newline at end of file diff --git a/README.md b/README.md index d998d08b8..6189bbd8c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# ترجمهٔ مستندات پایتون به فارسی 🐍💛 +# ترجمه‌ی مستندات پایتون به فارسی 🐍💛 [![discord](https://img.shields.io/badge/Telegram-python--docs--fa-00a5e0?style=for-the-badge&logo=telegram)](https://t.me/python_docs_farsi) [![youtube](https://img.shields.io/badge/Youtube-Contribution--Guide-CD201F?style=for-the-badge&logo=Youtube)](https://www.youtube.com/watch?v=DH5c5ZutTCo) -## دربارهٔ پروژه +## درباره‌ی پروژه این پروژه گروهی از علاقه‌مندان به پایتون است که مستندات رسمی پایتون را به فارسی ترجمه می‌کنند. هدف این است که کاربرانی که تسلط کاملی به زبان انگلیسی ندارند نیز بتوانند با استفاده از راهنمایی‌های دقیق و به‌روز، اصول برنامه‌نویسی پایتون را به‌راحتی یاد بگیرند. @@ -18,14 +18,14 @@ پیش از شروع، حتماً نگاهی به این فایل‌ها بیندازید: -- [CONTRIBUTING.md](CONTRIBUTING.md) — راهنمای کامل مشارکت: انواع ایشیو، نکات نگارشی و تایپوگرافی فارسی، سطح رسمیت و لحن نوشتار، اندازهٔ پول‌ریکوئست، فرایند بازبینی و تأیید پول‌ریکوئست، همگام‌سازی با نسخه‌های جدید پایتون (`scripts/update_python_version.py`)، پاک‌سازی رشته‌های `fuzzy` و نگهداری اعتبار مترجمان در سربرگ فایل‌های `.po`. -- [GLOSSARY.md](GLOSSARY.md) — واژه‌نامهٔ معادل‌های فارسی اصطلاحات تخصصی؛ هنگام ترجمه باید به آن پایبند باشید. +- [CONTRIBUTING.md](CONTRIBUTING.md) — راهنمای کامل مشارکت: انواع ایشیو، نکات نگارشی و تایپوگرافی فارسی، سطح رسمیت و لحن نوشتار، اندازه‌ی پول‌ریکوئست، فرایند بازبینی و تأیید پول‌ریکوئست، همگام‌سازی با نسخه‌های جدید پایتون (`scripts/update_python_version.py`)، پاک‌سازی رشته‌های `fuzzy` و نگهداری اعتبار مترجمان در سرآیند فایل‌های `.po`. +- [GLOSSARY.md](GLOSSARY.md) — واژه‌نامه‌ی معادل‌های فارسی اصطلاحات تخصصی؛ هنگام ترجمه باید به آن پایبند باشید. - [TEAM.md](TEAM.md) — فهرست هماهنگ‌کننده‌ها، بازبین‌ها و مترجمان به‌همراه آمار مشارکت. -- [STATUS.md](STATUS.md) — جدول وضعیت ترجمهٔ فایل‌ها که به‌صورت خودکار به‌روزرسانی می‌شود. +- [STATUS.md](STATUS.md) — جدول وضعیت ترجمه‌ی فایل‌ها که به‌صورت خودکار به‌روزرسانی می‌شود. ### شاخه‌های نسخه -ترجمه‌ها به‌ازای هر نسخهٔ پایتون در یک شاخهٔ جدا نگهداری می‌شوند. شاخهٔ فعلی و پیش‌فرض، نسخهٔ `3.14` است و پول‌ریکوئست‌ها باید روی همین شاخه باز شوند (برای مثال روی فایل‌های `tutorial/`، `library/`، `c-api/` و غیره). هنگام انتشار نسخهٔ جدید پایتون، هماهنگ‌کننده‌ها شاخهٔ جدیدی ایجاد و ترجمه‌ها را به آن منتقل می‌کنند. +ترجمه‌ها به‌ازای هر نسخه‌ی پایتون در یک شاخه‌ی جدا نگهداری می‌شوند. شاخه‌ی فعلی و پیش‌فرض، نسخه‌ی `3.14` است و پول‌ریکوئست‌ها باید روی همین شاخه باز شوند (برای مثال روی فایل‌های `tutorial/`، `library/`، `c-api/` و غیره). هنگام انتشار نسخه‌ی جدید پایتون، هماهنگ‌کننده‌ها شاخه‌ی جدیدی ایجاد و ترجمه‌ها را به آن منتقل می‌کنند. ## ارتباط و هماهنگی @@ -33,10 +33,10 @@
  • Discord مستندات پایتون به فارسی
  • -
  • بخش Issues در این مخزن جهت گزارش مشکلات یا پیشنهادات؛ سه قالب موجود است: درخواست ترجمهٔ صفحه، پرسش یا پیشنهاد واژه‌نامه، و گزارش اشکال در ترجمه.
  • +
  • بخش Issues در این مخزن جهت گزارش مشکلات یا پیشنهادات؛ سه قالب موجود است: درخواست ترجمه‌ی صفحه، پرسش یا پیشنهاد واژه‌نامه، و گزارش اشکال در ترجمه.
-تمام مشارکت‌کنندگان موظف‌اند از [آیین‌نامهٔ رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنند. +تمام مشارکت‌کنندگان موظف‌اند از [آیین‌نامه‌ی رفتاری PSF](https://www.python.org/psf/conduct/) پیروی کنند. *** @@ -45,5 +45,5 @@ ### مشارکت‌های کاربران ![نمودار مشارکت‌های کاربران؛ Revisto 3984، sepehr-rs 2210، danialbehzadi 677، invincible627 358، khosro_o 63، ParhamF 41، Ariyan_Bolandi 37، nikovinix7878 13، thaghgoo 12، Ramiz_222 10](reports/contributor_stats_latest.png) -(به‌روزرسانی: 2026-09-05) +(به‌روزرسانی: 2026-08-26) \ No newline at end of file diff --git a/STATUS.md b/STATUS.md index 808382db2..c3f81ae45 100644 --- a/STATUS.md +++ b/STATUS.md @@ -1,6 +1,6 @@ ### وضعیت ترجمه فایل‌ها -(به‌روزرسانی: 2026-09-05) +(به‌روزرسانی: 2026-08-26) | فایل | ترجمه‌شده | مبهم | تعداد ترجمه‌شده | تعداد ترجمه‌نشده | |:-----|:-----------:|:-----------:|:-----------:|:-----------:| @@ -179,7 +179,7 @@ | library/archiving.po | 0.0% | 0.0% | 0 | 2 | | library/argparse.po | 0.0% | 0.0% | 0 | 408 | | library/array.po | 0.0% | 0.0% | 0 | 89 | -| library/ast.po | 0.0% | 0.0% | 0 | 338 | +| library/ast.po | 0.0% | 0.0% | 0 | 339 | | library/asynchat.po | 0.0% | 0.0% | 0 | 4 | | library/asyncio-api-index.po | 0.0% | 0.0% | 0 | 100 | | library/asyncio-dev.po | 0.0% | 0.0% | 0 | 84 | @@ -280,7 +280,7 @@ | library/ensurepip.po | 0.0% | 0.0% | 0 | 40 | | library/enum.po | 0.0% | 0.0% | 0 | 257 | | library/errno.po | 0.0% | 0.0% | 0 | 161 | -| library/exceptions.po | 0.0% | 0.0% | 0 | 203 | +| library/exceptions.po | 0.0% | 0.0% | 0 | 204 | | library/faulthandler.po | 0.0% | 0.0% | 0 | 53 | | library/fcntl.po | 0.0% | 0.0% | 0 | 54 | | library/filecmp.po | 0.0% | 0.0% | 0 | 42 | @@ -500,7 +500,7 @@ | reference/datamodel.po | 0.0% | 0.0% | 0 | 913 | | reference/executionmodel.po | 0.0% | 0.0% | 0 | 145 | | reference/expressions.po | 0.0% | 0.0% | 0 | 595 | -| reference/grammar.po | 0.0% | 0.0% | 0 | 6 | +| reference/grammar.po | 0.0% | 0.0% | 0 | 7 | | reference/import.po | 0.0% | 0.0% | 0 | 202 | | reference/index.po | 0.0% | 0.0% | 0 | 2 | | reference/introduction.po | 0.0% | 0.0% | 0 | 56 | @@ -541,5 +541,5 @@ | whatsnew/3.9.po | 0.0% | 0.0% | 0 | 380 | | whatsnew/changelog.po | 0.0% | 0.0% | 0 | 1 | | whatsnew/index.po | 0.0% | 0.0% | 0 | 3 | -| **مجموع** | **3.9%** | **0.0%** | **2706** | **67533** | +| **مجموع** | **3.9%** | **0.0%** | **2706** | **67536** | diff --git a/about.po b/about.po index e62834b0e..7b93cbf4b 100644 --- a/about.po +++ b/about.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"PO-Revision-Date: 2026-08-28 10:52+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,24 +23,25 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "About this documentation" -msgstr "دربارهٔ این مستندات" +msgstr "درباره‌ی این مستندات" msgid "Python's documentation is generated from `reStructuredText`_ sources using `Sphinx`_, a documentation generator originally created for Python and now maintained as an independent project." msgstr "مستندات پایتون از طریق منابع `reStructuredText`_ با استفاده از `Sphinx`_ تولید می‌شوند، که یک تولیدگر مستندات است که در ابتدا برای پایتون ساخته شد و اکنون به‌عنوان یک پروژه مستقل نگهداری می‌شود." msgid "Development of the documentation and its toolchain is an entirely volunteer effort, just like Python itself. If you want to contribute, please take a look at the :ref:`reporting-bugs` page for information on how to do so. New volunteers are always welcome!" -msgstr "توسعهٔ مستندات و زنجیرهٔ ابزارهایش، همانند خود پایتون تلاشی کاملاً داوطلبانه است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به صفحهٔ :ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!" +msgstr "توسعه‌ی مستندات و زنجیره‌ی ابزارهایش، همانند خود پایتون تلاشی کاملاً داوطلبانه است. اگر می‌خواهید مشارکت کنید برای اطّلاعات در مورد چگونگی آن نگاهی به صفحه‌ی :ref:`reporting-bugs` بیندازید. همیشه از داوطلبان جدید استقبال می‌شود!" msgid "Many thanks go to:" msgstr "سپاس بسیار از:" msgid "Fred L. Drake, Jr., the creator of the original Python documentation toolset and author of much of the content;" -msgstr "فرد ال. درک جونیور خالق مجموعه ابزارهای اصلی مستندات پایتون و نویسنده بسیاری از محتواها:" +msgstr "فرد ال. درک جونیور خالق مجموعه ابزارهای اصلی مستندات پایتون و نویسنده بسیاری از محتواها;" msgid "the `Docutils `_ project for creating reStructuredText and the Docutils suite;" -msgstr "پروژه `Docutils `_ برای ایجاد reStructuredText و مجموعهٔ Docutils؛" +msgstr "پروژه `Docutils `_ برای ایجاد reStructuredText و مجموعه‌ی Docutils؛" msgid "Fredrik Lundh for his Alternative Python Reference project from which Sphinx got many good ideas." msgstr "فردریک لوند (Fredrik Lundh) برای پروژه‌ی \"Alternative Python Reference\" (مرجع جایگزین پایتون) که از آن بسیاری از ایده‌های خوب برای Sphinx (اسفینکس) گرفته شد." diff --git a/bugs.po b/bugs.po index 8062ab76d..92cd07c0f 100644 --- a/bugs.po +++ b/bugs.po @@ -43,7 +43,7 @@ msgid "If you find a bug in this documentation or would like to propose an impro msgstr "اگر مشکلی در این مستندات یافته یا می‌خواهید بهبودی را پیشنهاد دهید، گزارش مشکلی روی :ref:`issue tracker `. ثبت کنید. اگر برای حلش پیشنهادی دارید، آن را هم بنویسید." msgid "If the bug or suggested improvement concerns the translation of this documentation, submit the report to the `translation’s repository `_ instead." -msgstr "اگر اشکال یا پیشنهاد بهبودی مربوط به ترجمهٔ این مستندات است، گزارش را به `مخزن ترجمه `_ ارسال کنید." +msgstr "اگر اشکال یا پیشنهاد بهبودی مربوط به ترجمه‌ی این مستندات است، گزارش را به `مخزن ترجمه `_ ارسال کنید." msgid "You can also open a discussion item on our `Documentation Discourse forum `_." msgstr "همچنین می‌توانید گفت‌وگویی در `انجمن‌های گفتمان مستندات `_ بگشایید." @@ -73,7 +73,7 @@ msgid "`Documentation Translations `_" msgid "A list of GitHub pages for documentation translation and their primary contacts." -msgstr "فهرستی از صفحات GitHub مربوط به ترجمهٔ مستندات و راه‌های ارتباطی مسئولان هر یک." +msgstr "فهرستی از صفحات GitHub مربوط به ترجمه‌ی مستندات و راه‌های ارتباطی مسئولان هر یک." msgid "Using the Python issue tracker" msgstr "استفاده از پایگاه پیگیری مشکلات پایتون" @@ -97,7 +97,7 @@ msgid "For the \"Title\" field, enter a *very* short description of the problem; msgstr "برای بخش \"Title\", یک توضیح کوتاه از مشکل وارد کنید؛ کمتر از ده کلمه مناسب است." msgid "In the \"Comment\" field, describe the problem in detail, including what you expected to happen and what did happen. Be sure to include whether any extension modules were involved, and what hardware and software platform you were using (including version information as appropriate)." -msgstr "در قسمت \"Comment\", مشکل را با جزئیات بیان کنید، از جمله اینکه انتظار داشتید چه اتفاقی بیفتد و چه چیزی واقعاً اتفاق افتاد. حتماً اشاره کنید که آیا ماژول‌های افزونه‌ای درگیر بودند یا خیر و از چه سخت افزار و پلتفرم نرم‌‌افزاری استفاده می‌کردید (شامل اطلاعات نسخه در صورت لزوم)." +msgstr "در قسمت \"Comment\", مشکل را با جزئیات بیان کنید، از جمله اینکه انتظار داشتید چه اتفاقی بیفتد و چه چیزی واقعاً اتفاق افتاد. حتماً اشاره کنید که آیا ماژول‌های افزونه‌ای درگیر بودند یا خیر و از چه سخت افزار و پلتفرم نرم‌افزاری استفاده می‌کردید (شامل اطلاعات نسخه در صورت لزوم)." msgid "Each issue report will be reviewed by a developer who will determine what needs to be done to correct the problem. You will receive an update each time an action is taken on the issue." msgstr "هر گزارش خطا توسط یک توسعه‌دهنده بررسی خواهد شد که تصمیم می‌گیرد چه اقداماتی برای رفع مشکل نیاز است. هر بار که اقدامی روی گزارش انجام شود، به شما اطلاع‌رسانی خواهد شد." @@ -112,10 +112,10 @@ msgid "`Bug Writing Guidelines `_" msgid "Information about writing a good bug report. Some of this is specific to the Mozilla project, but describes general good practices." -msgstr "اطلاعاتی دربارهٔ نحوهٔ نگارش یک گزارش خطای خوب. بخشی از این اطلاعات به پروژهٔ موزیلا اختصاص دارد، اما اصول کلی و خوبِ گزارش‌دهی را نیز توضیح می‌دهد." +msgstr "اطلاعاتی درباره‌ی نحوه‌ی نگارش یک گزارش خطای خوب. بخشی از این اطلاعات به پروژه‌ی موزیلا اختصاص دارد، اما اصول کلی و خوبِ گزارش‌دهی را نیز توضیح می‌دهد." msgid "Getting started contributing to Python yourself" -msgstr "شروع مشارکت در توسعهٔ پایتون" +msgstr "شروع مشارکت در توسعه‌ی پایتون" msgid "Beyond just reporting bugs that you find, you are also welcome to submit patches to fix them. You can find more information on how to get started patching Python in the `Python Developer's Guide`_. If you have questions, the `core-mentorship mailing list`_ is a friendly place to get answers to any and all questions pertaining to the process of fixing issues in Python." msgstr "علاوه بر گزارش اشکالاتی که پیدا می‌کنید، می توانید وصله‌هایی برای رفع آن ها ارسال کنید. می‌توانید اطلاعات بیشتری درباره‌ی نحوه‌ی شروع به وصله زدن Python را در \"`Python Developer's Guide`_\" پیدا کنید. اگر سوالی دارید، \"`core-mentorship mailing list`_\" جای دوستانه‌ای برای دریافت پاسخ به هر سوال مربوط به فرآیند رفع اشکالات در Python است." diff --git a/c-api/abstract.po b/c-api/abstract.po index 94ff5477f..0efc0f1cf 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -25,7 +25,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Abstract Objects Layer" -msgstr "لایه اشیاء انتزاعی (Abstract Objects Layer)" +msgstr "لایه اشیاء انتزاعی" msgid "The functions in this chapter interact with Python objects regardless of their type, or with wide classes of object types (e.g. all numerical types, or all sequence types). When used on object types for which they do not apply, they will raise a Python exception." msgstr "توابع در این فصل با انواع اشیاء صرف نظر از نوع آنها یا با کلاس‌های گسترده‌ای از انواع اشیاء ( برای مثال همه‌ی اعداد یا همه‌ی انواع توالی) تعامل دارند. اگر این توابع بر روی نوعی از اشیاء استفاده شوند که برای آن‌ها تعریف نشده‌اند، یک استثنا در پایتون پرتاب خواهند کرد." diff --git a/c-api/allocation.po b/c-api/allocation.po index 753da7321..3d6629e9f 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -32,7 +32,7 @@ msgstr "" "X-Generator: Poedit 3.6\n" msgid "Allocating objects on the heap" -msgstr "تخصیص اشیاء روی پشته" +msgstr "تخصیص اشیاء روی هیپ" msgid "Initialize a newly allocated object *op* with its type and initial reference. Returns the initialized object. Other fields of the object are not initialized. Despite its name, this function is unrelated to the object's :meth:`~object.__init__` method (:c:member:`~PyTypeObject.tp_init` slot). Specifically, this function does **not** call the object's :meth:`!__init__` method." msgstr "یک شیء *op* که به‌تازگی تخصیص داده شده را با نوع و مرجع اولیه‌اش مقداردهی اولیه می‌کند. شیء مقداردهی‌شده را برمی‌گرداند. سایر فیلدهای شیء مقداردهی اولیه نمی‌شوند. با وجود نام این تابع، آن به متد :meth:`~object.__init__` شیء (درگاه :c:member:`~PyTypeObject.tp_init`) مربوط نیست. به‌طور خاص، این تابع متد :meth:`!__init__` شیء را **فراخوانی نمی‌کند**." @@ -44,7 +44,7 @@ msgid "This function only initializes the object's memory corresponding to the i msgstr "این تابع فقط حافظه‌ی شیء را که مربوط به ساختار ابتدایی :c:type:`PyObject` است، مقداردهی اولیه می‌کند. بقیه‌ی حافظه را صفر نمی‌کند." msgid "This does everything :c:func:`PyObject_Init` does, and also initializes the length information for a variable-size object." -msgstr "این تابع همهٔ کارهایی را انجام می‌دهد که :c:func:`PyObject_Init` انجام می‌دهد، و همچنین اطلاعات مربوط به طول را برای یک شیء با اندازهٔ متغیر مقداردهی می‌کند." +msgstr "این تابع همه‌ی کارهایی را انجام می‌دهد که :c:func:`PyObject_Init` انجام می‌دهد، و همچنین اطلاعات مربوط به طول را برای یک شیء با اندازه‌ی متغیر مقداردهی می‌کند." msgid "This function only initializes some of the object's memory. It does not zero the rest." msgstr "این تابع فقط بخشی از حافظه‌ی شیء را مقداردهی اولیه می‌کند. بقیه‌ی حافظه را صفر نمی‌کند." diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index b04049e8f..d9d99e35a 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -34,7 +34,7 @@ msgid "Build-time version constants" msgstr "ثابتهای نسخه در زمان ساخت" msgid "CPython exposes its version number in the following macros. Note that these correspond to the version code is **built** with. See :c:var:`Py_Version` for the version used at **run time**." -msgstr "CPython شماره‌ی نسخه‌ی خود را در ماکروهای زیر در معرض دید قرار می‌دهد. توجه داشته باشید که اینها مربوط به نسخه‌ای هستند که کد با آن **ساخته (build)** شده است. برای نسخه‌ای که در **زمان اجرا (run time)** استفاده می‌شود، به :c:var:`Py_Version` مراجعه کنید." +msgstr "CPython شماره‌ی نسخه‌ی خود را در ماکروهای زیر در معرض دید قرار می‌دهد. توجه داشته باشید که اینها مربوط به نسخه‌ای هستند که کد با آن **ساخته (build)** شده است. برای نسخه‌ای که در **زمان اجرا** استفاده می‌شود، به :c:var:`Py_Version` مراجعه کنید." msgid "See :ref:`stable` for a discussion of API and ABI stability across versions." msgstr "برای بحث درباره‌ی پایداری API و ABI در میان نسخه‌ها، به :ref:`stable` مراجعه کنید." @@ -67,7 +67,7 @@ msgid "Run-time version" msgstr "نسخه‌ی زمان اجرا" msgid "The Python runtime version number encoded in a single constant integer. See :c:func:`Py_PACK_FULL_VERSION` for the encoding details. This contains the Python version used at run time." -msgstr "شماره‌ی نسخه‌ی زمان اجرای پایتون که در یک عدد صحیح ثابت کدگذاری شده است. برای جزئیات کدگذاری، به :c:func:`Py_PACK_FULL_VERSION` مراجعه کنید. این (مقدار) شامل نسخه‌ی پایتون است که در زمان اجرا استفاده می‌شود." +msgstr "شماره‌ی نسخه‌ی ران‌تایم پایتون که در یک عدد صحیح ثابت کدگذاری شده است. برای جزئیات کدگذاری، به :c:func:`Py_PACK_FULL_VERSION` مراجعه کنید. این (مقدار) شامل نسخه‌ی پایتون است که در زمان اجرا استفاده می‌شود." msgid "Use this for numeric comparisons, for example, ``if (Py_Version >= ...)``." msgstr "از این (مقدار) برای مقایسه‌های عددی استفاده کنید، برای مثال، ``if (Py_Version >= ...)``." diff --git a/c-api/arg.po b/c-api/arg.po index 04a11a7b3..b8ca1f2b3 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -26,421 +26,994 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Parsing arguments and building values" -msgstr "" +msgstr "تجزیه آرگومان‌ها و ساخت مقادیر" -msgid "These functions are useful when creating your own extension functions and methods. Additional information and examples are available in :ref:`extending-index`." +msgid "" +"These functions are useful when creating your own extension functions and " +"methods. Additional information and examples are available in " +":ref:`extending-index`." msgstr "" +"این توابع هنگام ایجاد توابع و متدهای توسعه‌ای خودتان مفید هستند. اطلاعات و " +"نمونه‌های بیشتر در :ref:`extending-index` در دسترس است." -msgid "The first three of these functions described, :c:func:`PyArg_ParseTuple`, :c:func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use *format strings* which are used to tell the function about the expected arguments. The format strings use the same syntax for each of these functions." -msgstr "" +msgid "" +"The first three of these functions described, :c:func:`PyArg_ParseTuple`, " +":c:func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use " +"*format strings* which are used to tell the function about the expected " +"arguments. The format strings use the same syntax for each of these " +"functions." +msgstr "" +"سه تابع نخستِ توضیح‌داده‌شده، :c:func:`PyArg_ParseTuple`، " +":c:func:`PyArg_ParseTupleAndKeywords` و :c:func:`PyArg_Parse`، همگی از " +"*رشته‌های قالبی* استفاده می‌کنند که برای اطلاع‌رسانی به تابع درباره " +"آرگومان‌های مورد انتظار به کار می‌روند. رشته‌های قالبی برای هر یک از این " +"توابع از نحو یکسانی استفاده می‌کنند." msgid "Parsing arguments" -msgstr "" +msgstr "پارس کردن آرگومان‌ها" -msgid "A format string consists of zero or more \"format units.\" A format unit describes one Python object; it is usually a single character or a parenthesized sequence of format units. With a few exceptions, a format unit that is not a parenthesized sequence normally corresponds to a single address argument to these functions. In the following description, the quoted form is the format unit; the entry in (round) parentheses is the Python object type that matches the format unit; and the entry in [square] brackets is the type of the C variable(s) whose address should be passed." -msgstr "" +msgid "" +"A format string consists of zero or more \"format units.\" A format unit " +"describes one Python object; it is usually a single character or a " +"parenthesized sequence of format units. With a few exceptions, a format " +"unit that is not a parenthesized sequence normally corresponds to a single " +"address argument to these functions. In the following description, the " +"quoted form is the format unit; the entry in (round) parentheses is the " +"Python object type that matches the format unit; and the entry in [square] " +"brackets is the type of the C variable(s) whose address should be passed." +msgstr "" +"رشته قالب از صفر یا چند «واحد قالب» (format unit) تشکیل شده است. هر واحد " +"قالب یک شیء پایتون را توصیف می‌کند؛ این واحد معمولاً یک نویسه‌ی تنها یا یک " +"دنباله‌ی پرانتز‌گذاری‌شده از واحدهای قالب است. با وجود چند استثنا، واحد " +"قالبی که دنباله‌ی پرانتز‌گذاری‌شده نیست، معمولاً متناظر با تنها یک آرگومان " +"آدرس برای این توابع است. در توضیح زیر، شکل نقل‌قول‌شده همان واحد قالب است؛ " +"ورودی داخل پرانتز (گرد)، نوع شیء پایتون است که با واحد قالب تطابق دارد؛ و " +"ورودی داخل کروشه [مربع]، نوع متغیر(های) C است که آدرس آن باید گذر داده شود." msgid "Strings and buffers" -msgstr "" +msgstr "رشته‌ها و بافرها" -msgid "On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be defined before including :file:`Python.h` to use all ``#`` variants of formats (``s#``, ``y#``, etc.) explained below. This is not necessary on Python 3.13 and later." +msgid "" +"On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be " +"defined before including :file:`Python.h` to use all ``#`` variants of " +"formats (``s#``, ``y#``, etc.) explained below. This is not necessary on " +"Python 3.13 and later." msgstr "" +"در پایتون 3.12 و قدیمی‌تر، باید ماکروی :c:macro:`!PY_SSIZE_T_CLEAN` پیش از " +"درج :file:`Python.h` تعریف شود تا بتوان از همه‌ی گونه‌های ``#`` قالب‌ها " +"(``s#``، ``y#`` و غیره) که در ادامه توضیح داده شده‌اند استفاده کرد. در " +"پایتون 3.13 و جدیدتر، این کار ضروری نیست." -msgid "These formats allow accessing an object as a contiguous chunk of memory. You don't have to provide raw storage for the returned unicode or bytes area." +msgid "" +"These formats allow accessing an object as a contiguous chunk of memory. You" +" don't have to provide raw storage for the returned unicode or bytes area." msgstr "" +"این قالب‌ها اجازه می‌دهند به یک شیء به‌عنوان یک تکه پیوسته از حافظه دسترسی " +"داشته باشید. لازم نیست فضای ذخیره‌سازی خامی برای ناحیه یونیکد یا بایت‌های " +"برگردانده‌شده فراهم کنید." msgid "Unless otherwise stated, buffers are not NUL-terminated." msgstr "" +"مگر آنکه خلاف آن ذکر شده باشد، بافر‌ها با نویسه تهی (NUL) پایان نمی‌یابند." msgid "There are three ways strings and buffers can be converted to C:" -msgstr "" +msgstr "سه روش برای تبدیل رشته‌ها و بافرها به C وجود دارد:" -msgid "Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This locks the underlying buffer so that the caller can subsequently use the buffer even inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk of mutable data being resized or destroyed. As a result, **you have to call** :c:func:`PyBuffer_Release` after you have finished processing the data (or in any early abort case)." -msgstr "" +msgid "" +"Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This" +" locks the underlying buffer so that the caller can subsequently use the " +"buffer even inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk" +" of mutable data being resized or destroyed. As a result, **you have to " +"call** :c:func:`PyBuffer_Release` after you have finished processing the " +"data (or in any early abort case)." +msgstr "" +"قالب‌هایی مانند ``y*`` و ``s*`` یک ساختار :c:type:`Py_buffer` را پر می‌کنند." +" این کار بافر زیرین را قفل می‌کند تا فراخواننده بتواند متعاقباً حتی درون یک " +"بلوک :c:type:`Py_BEGIN_ALLOW_THREADS` از بافر استفاده کند، بدون خطر تغییر " +"اندازه یا نابود شدن داده‌های تغییرپذیر. در نتیجه، پس از اتمام پردازش داده‌ها" +" (یا در هر حالت خاتمه زودهنگام)، **باید** :c:func:`PyBuffer_Release` **را " +"فراخوانی کنید**." -msgid "The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. **You have to call** :c:func:`PyMem_Free` after you have finished processing the data (or in any early abort case)." +msgid "" +"The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. " +"**You have to call** :c:func:`PyMem_Free` after you have finished processing" +" the data (or in any early abort case)." msgstr "" +"قالب‌های ``es``، ``es#``، ``et`` و ``et#`` بافر نتیجه را تخصیص می‌دهند. " +"**باید** پس از پایان پردازش داده‌ها (یا در هر مورد خاتمه زودهنگام)، " +":c:func:`PyMem_Free` **را فراخوانی کنید**." -msgid "Other formats take a :class:`str` or a read-only :term:`bytes-like object`, such as :class:`bytes`, and provide a ``const char *`` pointer to its buffer. In this case the buffer is \"borrowed\": it is managed by the corresponding Python object, and shares the lifetime of this object. You won't have to release any memory yourself." -msgstr "" +msgid "" +"Other formats take a :class:`str` or a read-only :term:`bytes-like object`, " +"such as :class:`bytes`, and provide a ``const char *`` pointer to its " +"buffer. In this case the buffer is \"borrowed\": it is managed by the " +"corresponding Python object, and shares the lifetime of this object. You " +"won't have to release any memory yourself." +msgstr "" +"قالب‌های دیگر یک :class:`str` یا یک :term:`شیء شبه‌بایت `" +" فقط‌خواندنی، مانند :class:`bytes`، می‌گیرند و اشاره‌گری از نوع ``const char" +" *`` به بافر آن فراهم می‌کنند. در این حالت بافر «امانتی» است: توسط شیء " +"پایتون متناظر مدیریت می‌شود و عمر آن با عمر این شیء مشترک است. شما نیازی " +"نخواهید داشت که خودتان هیچ حافظه‌ای را آزاد کنید." -msgid "To ensure that the underlying buffer may be safely borrowed, the object's :c:member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This disallows common mutable objects such as :class:`bytearray`, but also some read-only objects such as :class:`memoryview` of :class:`bytes`." +msgid "" +"To ensure that the underlying buffer may be safely borrowed, the object's " +":c:member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " +"disallows common mutable objects such as :class:`bytearray`, but also some " +"read-only objects such as :class:`memoryview` of :class:`bytes`." msgstr "" +"برای اطمینان از این‌که بافر زیرین بتواند به‌طور ایمن به امانت گرفته شود، " +"فیلد :c:member:`PyBufferProcs.bf_releasebuffer` مربوط به شیء باید ``NULL`` " +"باشد. این امر نه‌تنها اشیاء تغییرپذیر رایج مانند :class:`bytearray`، بلکه " +"برخی اشیاء فقط‌خواندنی مانند :class:`memoryview` از :class:`bytes` را نیز " +"منع می‌کند." -msgid "Besides this ``bf_releasebuffer`` requirement, there is no check to verify whether the input object is immutable (e.g. whether it would honor a request for a writable buffer, or whether another thread can mutate the data)." +msgid "" +"Besides this ``bf_releasebuffer`` requirement, there is no check to verify " +"whether the input object is immutable (e.g. whether it would honor a request" +" for a writable buffer, or whether another thread can mutate the data)." msgstr "" +"علاوه بر این الزام ``bf_releasebuffer``، هیچ بررسی‌ای برای تأیید اینکه شیء " +"ورودی تغییرناپذیر است یا خیر انجام نمی‌شود (مثلاً اینکه آیا شیء به درخواست " +"بافر نوشتنی ترتیب اثر می‌دهد، یا اینکه آیا نخ دیگری می‌تواند داده‌ها را " +"تغییر دهد)." msgid "``s`` (:class:`str`) [const char \\*]" -msgstr "" +msgstr "``s`` (:class:`str`) [const char \\*]" -msgid "Convert a Unicode object to a C pointer to a character string. A pointer to an existing string is stored in the character pointer variable whose address you pass. The C string is NUL-terminated. The Python string must not contain embedded null code points; if it does, a :exc:`ValueError` exception is raised. Unicode objects are converted to C strings using ``'utf-8'`` encoding. If this conversion fails, a :exc:`UnicodeError` is raised." -msgstr "" +msgid "" +"Convert a Unicode object to a C pointer to a character string. A pointer to " +"an existing string is stored in the character pointer variable whose address" +" you pass. The C string is NUL-terminated. The Python string must not " +"contain embedded null code points; if it does, a :exc:`ValueError` exception" +" is raised. Unicode objects are converted to C strings using ``'utf-8'`` " +"encoding. If this conversion fails, a :exc:`UnicodeError` is raised." +msgstr "" +"یک شیء یونیکد را به اشاره‌گر C به یک رشته نویسه‌ای تبدیل می‌کند. اشاره‌گر به" +" یک رشته موجود، در متغیر اشاره‌گر نویسه که نشانی آن را ارسال می‌کنید، ذخیره " +"می‌شود. رشته C با NUL پایان می‌یابد. رشته پایتون نباید شامل نقطه‌کدهای تهی " +"تعبیه‌شده باشد؛ در صورت وجود، استثنای :exc:`ValueError` ایجاد می‌شود. اشیاء " +"یونیکد با استفاده از کدگذاری ``'utf-8'`` به رشته‌های C تبدیل می‌شوند. اگر " +"این تبدیل شکست بخورد، استثنای :exc:`UnicodeError` ایجاد می‌شود." -msgid "This format does not accept :term:`bytes-like objects `. If you want to accept filesystem paths and convert them to C character strings, it is preferable to use the ``O&`` format with :c:func:`PyUnicode_FSConverter` as *converter*." +msgid "" +"This format does not accept :term:`bytes-like objects `." +" If you want to accept filesystem paths and convert them to C character " +"strings, it is preferable to use the ``O&`` format with " +":c:func:`PyUnicode_FSConverter` as *converter*." msgstr "" +"این قالب :term:`اشیاء شبه‌بایت ` را نمی‌پذیرد. اگر " +"می‌خواهید مسیرهای فایل‌سیستم را بپذیرید و آن‌ها را به رشته‌های نویسه‌ای C " +"تبدیل کنید، بهتر است از قالب ``O&`` با :c:func:`PyUnicode_FSConverter` " +"به‌عنوان *converter* استفاده کنید." -msgid "Previously, :exc:`TypeError` was raised when embedded null code points were encountered in the Python string." +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null code points were " +"encountered in the Python string." msgstr "" +"پیش‌تر، هنگام مواجهه با نقطه‌کدهای تهی تعبیه‌شده در رشته پایتون، استثنای " +":exc:`TypeError` پرتاب می‌شد." msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]" -msgstr "" +msgstr "``s*`` (:class:`str` یا :term:`bytes-like object`) [Py_buffer]" -msgid "This format accepts Unicode objects as well as bytes-like objects. It fills a :c:type:`Py_buffer` structure provided by the caller. In this case the resulting C string may contain embedded NUL bytes. Unicode objects are converted to C strings using ``'utf-8'`` encoding." +msgid "" +"This format accepts Unicode objects as well as bytes-like objects. It fills " +"a :c:type:`Py_buffer` structure provided by the caller. In this case the " +"resulting C string may contain embedded NUL bytes. Unicode objects are " +"converted to C strings using ``'utf-8'`` encoding." msgstr "" +"این قالب اشیاء یونیکد و همچنین اشیاء شبه‌بایت را می‌پذیرد. این قالب ساختار " +":c:type:`Py_buffer` فراهم‌شده توسط فراخواننده را پر می‌کند. در این حالت، " +"رشته C حاصل ممکن است شامل بایت‌های تهی تعبیه‌شده باشد. اشیاء یونیکد با " +"استفاده از کدگذاری ``'utf-8'`` به رشته‌های C تبدیل می‌شوند." -msgid "``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :c:type:`Py_ssize_t`]" +msgid "" +"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, " +":c:type:`Py_ssize_t`]" msgstr "" +"``s#`` (:class:`str`، :term:`شیء شبه‌بایت ` فقط‌خواندنی) " +"[const char \\*, :c:type:`Py_ssize_t`]" -msgid "Like ``s*``, except that it provides a :ref:`borrowed buffer `. The result is stored into two C variables, the first one a pointer to a C string, the second one its length. The string may contain embedded null bytes. Unicode objects are converted to C strings using ``'utf-8'`` encoding." +msgid "" +"Like ``s*``, except that it provides a :ref:`borrowed buffer `. The result is stored into two C variables, the first one " +"a pointer to a C string, the second one its length. The string may contain " +"embedded null bytes. Unicode objects are converted to C strings using " +"``'utf-8'`` encoding." msgstr "" +"مانند ``s*``، با این تفاوت که یک :ref:`بافر امانی ` " +"فراهم می‌کند. نتیجه در دو متغیر C ذخیره می‌شود؛ اولی اشاره‌گری به یک رشته C " +"و دومی طول آن است. رشته ممکن است حاوی بایت‌های تهی تعبیه‌شده باشد. اشیاء " +"یونیکد با استفاده از کدگذاری ``'utf-8'`` به رشته‌های C تبدیل می‌شوند." msgid "``z`` (:class:`str` or ``None``) [const char \\*]" -msgstr "" +msgstr "``z`` (:class:`str` یا ``None``) [const char \\*]" -msgid "Like ``s``, but the Python object may also be ``None``, in which case the C pointer is set to ``NULL``." +msgid "" +"Like ``s``, but the Python object may also be ``None``, in which case the C " +"pointer is set to ``NULL``." msgstr "" +"مانند ``s``، اما شیء پایتون می‌تواند ``None`` نیز باشد، که در این صورت " +"اشاره‌گر C برابر ``NULL`` قرار می‌گیرد." -msgid "``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" +msgid "" +"``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" msgstr "" +"``z*`` (:class:`str`، :term:`شیء شبه‌بایت ` یا ``None``) " +"[Py_buffer]" -msgid "Like ``s*``, but the Python object may also be ``None``, in which case the ``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``." +msgid "" +"Like ``s*``, but the Python object may also be ``None``, in which case the " +"``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``." msgstr "" +"مانند ``s*``، اما شیء پایتون می‌تواند ``None`` نیز باشد، که در این صورت عضو " +"``buf`` از ساختار :c:type:`Py_buffer` برابر ``NULL`` قرار می‌گیرد." -msgid "``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +msgid "" +"``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) " +"[const char \\*, :c:type:`Py_ssize_t`]" msgstr "" +"``z#`` (:class:`str`، :term:`شیء شبه‌بایت ` فقط‌خواندنی " +"یا ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -msgid "Like ``s#``, but the Python object may also be ``None``, in which case the C pointer is set to ``NULL``." +msgid "" +"Like ``s#``, but the Python object may also be ``None``, in which case the C" +" pointer is set to ``NULL``." msgstr "" +"مانند ``s#``، اما شیء پایتون می‌تواند ``None`` نیز باشد، که در این حالت " +"اشاره‌گر C برابر ``NULL`` قرار می‌گیرد." msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]" msgstr "" +"``y`` (:term:`شیء شبه‌بایت ` فقط‌خواندنی) [const char " +"\\*]" -msgid "This format converts a bytes-like object to a C pointer to a :ref:`borrowed ` character string; it does not accept Unicode objects. The bytes buffer must not contain embedded null bytes; if it does, a :exc:`ValueError` exception is raised." +msgid "" +"This format converts a bytes-like object to a C pointer to a :ref:`borrowed " +"` character string; it does not accept Unicode " +"objects. The bytes buffer must not contain embedded null bytes; if it does," +" a :exc:`ValueError` exception is raised." msgstr "" +"این قالب یک شیء شبه‌بایت را به اشاره‌گر C به یک رشته نویسه‌ی :ref:`امانی " +"` تبدیل می‌کند؛ اشیاء یونیکد را نمی‌پذیرد. بافر " +"بایت‌ها نباید حاوی بایت‌های تهی تعبیه‌شده باشد؛ در صورت وجود، استثنای " +":exc:`ValueError` ایجاد می‌شود." -msgid "Previously, :exc:`TypeError` was raised when embedded null bytes were encountered in the bytes buffer." +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null bytes were " +"encountered in the bytes buffer." msgstr "" +"پیش‌تر، هنگامی که بایت‌های تهی تعبیه‌شده در بافر بایت‌ها مشاهده می‌شدند، " +"استثنای :exc:`TypeError` ایجاد می‌شد." msgid "``y*`` (:term:`bytes-like object`) [Py_buffer]" -msgstr "" +msgstr "``y*`` (:term:`شیء شبه‌بایت `) [Py_buffer]" -msgid "This variant on ``s*`` doesn't accept Unicode objects, only bytes-like objects. **This is the recommended way to accept binary data.**" +msgid "" +"This variant on ``s*`` doesn't accept Unicode objects, only bytes-like " +"objects. **This is the recommended way to accept binary data.**" msgstr "" +"این گونه از ``s*`` اشیای یونیکد را نمی‌پذیرد، فقط اشیای شبه‌بایت را " +"می‌پذیرد. **این روش توصیه‌شده برای پذیرش داده‌های دودویی است.**" -msgid "``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:`Py_ssize_t`]" +msgid "" +"``y#`` (read-only :term:`bytes-like object`) [const char \\*, " +":c:type:`Py_ssize_t`]" msgstr "" +"``y#`` (:term:`شیء شبه‌بایت ` فقط‌خواندنی) [const char " +"\\*, :c:type:`Py_ssize_t`]" -msgid "This variant on ``s#`` doesn't accept Unicode objects, only bytes-like objects." +msgid "" +"This variant on ``s#`` doesn't accept Unicode objects, only bytes-like " +"objects." msgstr "" +"این گونه از ``s#`` اشیاء یونیکد را نمی‌پذیرد، بلکه فقط اشیاء شبه‌بایت را " +"می‌پذیرد." msgid "``S`` (:class:`bytes`) [PyBytesObject \\*]" -msgstr "" +msgstr "``S`` (:class:`bytes`) [PyBytesObject \\*]" -msgid "Requires that the Python object is a :class:`bytes` object, without attempting any conversion. Raises :exc:`TypeError` if the object is not a bytes object. The C variable may also be declared as :c:expr:`PyObject*`." +msgid "" +"Requires that the Python object is a :class:`bytes` object, without " +"attempting any conversion. Raises :exc:`TypeError` if the object is not a " +"bytes object. The C variable may also be declared as :c:expr:`PyObject*`." msgstr "" +"نیازمند است که شیء پایتون یک شیء :class:`bytes` باشد، بدون تلاش برای انجام " +"هیچ تبدیلی. اگر شیء، یک شیء bytes نباشد، استثنای :exc:`TypeError` ایجاد " +"می‌شود. متغیر C همچنین می‌تواند به صورت :c:expr:`PyObject*` اعلان شود." msgid "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" -msgstr "" +msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" -msgid "Requires that the Python object is a :class:`bytearray` object, without attempting any conversion. Raises :exc:`TypeError` if the object is not a :class:`bytearray` object. The C variable may also be declared as :c:expr:`PyObject*`." +msgid "" +"Requires that the Python object is a :class:`bytearray` object, without " +"attempting any conversion. Raises :exc:`TypeError` if the object is not a " +":class:`bytearray` object. The C variable may also be declared as " +":c:expr:`PyObject*`." msgstr "" +"الزام می‌کند که شیء پایتون یک شیء :class:`bytearray` باشد، بدون تلاش برای " +"انجام هیچ تبدیلی. اگر شیء یک شیء :class:`bytearray` نباشد، استثنای " +":exc:`TypeError` را ایجاد می‌کند. متغیر C همچنین می‌تواند به صورت " +":c:expr:`PyObject*` اعلان شود." msgid "``U`` (:class:`str`) [PyObject \\*]" -msgstr "" +msgstr "``U`` (:class:`str`) [PyObject \\*]" -msgid "Requires that the Python object is a Unicode object, without attempting any conversion. Raises :exc:`TypeError` if the object is not a Unicode object. The C variable may also be declared as :c:expr:`PyObject*`." +msgid "" +"Requires that the Python object is a Unicode object, without attempting any " +"conversion. Raises :exc:`TypeError` if the object is not a Unicode object." +" The C variable may also be declared as :c:expr:`PyObject*`." msgstr "" +"الزام می‌کند که شیء پایتون یک شیء یونیکد باشد، بدون تلاش برای انجام هیچ " +"تبدیلی. اگر شیء یک شیء یونیکد نباشد، استثنای :exc:`TypeError` ایجاد می‌شود." +" متغیر C همچنین می‌تواند به‌صورت :c:expr:`PyObject*` اعلان شود." msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" msgstr "" +"``w*`` (:term:`شیء شبه‌بایت ` خواندن-نوشتن) [Py_buffer]" -msgid "This format accepts any object which implements the read-write buffer interface. It fills a :c:type:`Py_buffer` structure provided by the caller. The buffer may contain embedded null bytes. The caller has to call :c:func:`PyBuffer_Release` when it is done with the buffer." +msgid "" +"This format accepts any object which implements the read-write buffer " +"interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " +"The buffer may contain embedded null bytes. The caller has to call " +":c:func:`PyBuffer_Release` when it is done with the buffer." msgstr "" +"این قالب هر شیء‌ای را که رابط بافر خواندن-نوشتن را پیاده‌سازی کند، می‌پذیرد." +" این قالب ساختار :c:type:`Py_buffer` را که توسط فراخواننده فراهم شده است، پر" +" می‌کند. بافر ممکن است شامل بایت‌های تهی تعبیه‌شده باشد. فراخواننده باید پس " +"از پایان کار با بافر، :c:func:`PyBuffer_Release` را فراخوانی کند." msgid "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" -msgstr "" +msgstr "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" -msgid "This variant on ``s`` is used for encoding Unicode into a character buffer. It only works for encoded data without embedded NUL bytes." +msgid "" +"This variant on ``s`` is used for encoding Unicode into a character buffer. " +"It only works for encoded data without embedded NUL bytes." msgstr "" +"این گونه از ``s`` برای کدگذاری یونیکد درون یک بافر نویسه استفاده می‌شود. این" +" گونه تنها با داده‌های کدگذاری‌شده‌ای که بایت‌های تهی تعبیه‌شده ندارند کار " +"می‌کند." -msgid "This format requires two arguments. The first is only used as input, and must be a :c:expr:`const char*` which points to the name of an encoding as a NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. An exception is raised if the named encoding is not known to Python. The second argument must be a :c:expr:`char**`; the value of the pointer it references will be set to a buffer with the contents of the argument text. The text will be encoded in the encoding specified by the first argument." -msgstr "" +msgid "" +"This format requires two arguments. The first is only used as input, and " +"must be a :c:expr:`const char*` which points to the name of an encoding as a" +" NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " +"used. An exception is raised if the named encoding is not known to Python. " +"The second argument must be a :c:expr:`char**`; the value of the pointer it " +"references will be set to a buffer with the contents of the argument text. " +"The text will be encoded in the encoding specified by the first argument." +msgstr "" +"این قالب به دو آرگومان نیاز دارد. آرگومان اول فقط به عنوان ورودی استفاده " +"می‌شود و باید یک :c:expr:`const char*` باشد که به نام یک کدگذاری به صورت " +"رشته‌ی پایان‌یافته با تهی (NUL-terminated) اشاره کند، یا ``NULL`` باشد که در" +" این صورت کدگذاری ``'utf-8'`` استفاده می‌شود. اگر کدگذاری نام‌برده برای " +"پایتون شناخته‌شده نباشد، استثنایی مطرح می‌شود. آرگومان دوم باید یک " +":c:expr:`char**` باشد؛ مقدار اشاره‌گری که این آرگومان به آن ارجاع می‌دهد، به" +" بافری حاوی محتوای متن آرگومان تنظیم خواهد شد. متن در کدگذاری تعیین‌شده توسط" +" آرگومان اول کدگذاری خواهد شد." -msgid ":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy the encoded data into this buffer and adjust *\\*buffer* to reference the newly allocated storage. The caller is responsible for calling :c:func:`PyMem_Free` to free the allocated buffer after use." +msgid "" +":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy " +"the encoded data into this buffer and adjust *\\*buffer* to reference the " +"newly allocated storage. The caller is responsible for calling " +":c:func:`PyMem_Free` to free the allocated buffer after use." msgstr "" +":c:func:`PyArg_ParseTuple` یک بافر با اندازه‌ی مورد نیاز تخصیص می‌دهد، " +"داده‌های کدگذاری‌شده را در این بافر کپی می‌کند و *\\*buffer* را طوری تنظیم " +"می‌کند که به حافظه‌ی تازه تخصیص‌یافته ارجاع دهد. فراخوان‌کننده مسئول " +"فراخوانی :c:func:`PyMem_Free` برای آزاد کردن بافر تخصیص‌یافته پس از استفاده " +"است." -msgid "``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \\*encoding, char \\*\\*buffer]" +msgid "" +"``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer]" msgstr "" +"``et`` (:class:`str`، :class:`bytes` یا :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer]" -msgid "Same as ``es`` except that byte string objects are passed through without recoding them. Instead, the implementation assumes that the byte string object uses the encoding passed in as parameter." +msgid "" +"Same as ``es`` except that byte string objects are passed through without " +"recoding them. Instead, the implementation assumes that the byte string " +"object uses the encoding passed in as parameter." msgstr "" +"مانند ``es`` است، با این تفاوت که اشیاء رشته بایتی بدون بازکدگذاری عبور داده" +" می‌شوند. در عوض، پیاده‌سازی فرض می‌کند که شیء رشته بایتی از کدگذاری‌ای " +"استفاده می‌کند که به‌عنوان پارامتر به آن داده شده است." -msgid "``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" +msgid "" +"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, " +":c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" +"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, " +":c:type:`Py_ssize_t` \\*buffer_length]" -msgid "This variant on ``s#`` is used for encoding Unicode into a character buffer. Unlike the ``es`` format, this variant allows input data which contains NUL characters." +msgid "" +"This variant on ``s#`` is used for encoding Unicode into a character buffer." +" Unlike the ``es`` format, this variant allows input data which contains NUL" +" characters." msgstr "" +"این واریانتِ ``s#`` برای کدگذاری یونیکد به یک بافر نویسه‌ای به کار می‌رود. " +"برخلاف قالب ``es``، این واریانت اجازه‌ی داده‌های ورودی حاوی نویسه‌های تهی را" +" می‌دهد." -msgid "It requires three arguments. The first is only used as input, and must be a :c:expr:`const char*` which points to the name of an encoding as a NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. An exception is raised if the named encoding is not known to Python. The second argument must be a :c:expr:`char**`; the value of the pointer it references will be set to a buffer with the contents of the argument text. The text will be encoded in the encoding specified by the first argument. The third argument must be a pointer to an integer; the referenced integer will be set to the number of bytes in the output buffer." -msgstr "" +msgid "" +"It requires three arguments. The first is only used as input, and must be a" +" :c:expr:`const char*` which points to the name of an encoding as a NUL-" +"terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. " +"An exception is raised if the named encoding is not known to Python. The " +"second argument must be a :c:expr:`char**`; the value of the pointer it " +"references will be set to a buffer with the contents of the argument text. " +"The text will be encoded in the encoding specified by the first argument. " +"The third argument must be a pointer to an integer; the referenced integer " +"will be set to the number of bytes in the output buffer." +msgstr "" +"این مورد به سه آرگومان نیاز دارد. آرگومان اول فقط به عنوان ورودی استفاده " +"می‌شود و باید یک :c:expr:`const char*` باشد که به نام یک کدگذاری به صورت " +"رشته خاتمه‌یافته با تهی (NUL) اشاره کند، یا ``NULL`` باشد که در این صورت از " +"کدگذاری ``'utf-8'`` استفاده می‌شود. اگر کدگذاری نام‌برده برای پایتون شناخته " +"نشده باشد، استثنایی مطرح می‌شود. آرگومان دوم باید یک :c:expr:`char**` باشد؛ " +"مقدار اشاره‌گری که به آن ارجاع داده می‌شود، به بافری شامل محتوای متن آرگومان" +" تنظیم خواهد شد. متن در کدگذاری مشخص‌شده توسط آرگومان اول کدگذاری خواهد شد. " +"آرگومان سوم باید اشاره‌گری به یک عدد صحیح باشد؛ عدد صحیح ارجاع‌شده به تعداد " +"بایت‌های بافر خروجی تنظیم خواهد شد." msgid "There are two modes of operation:" -msgstr "" +msgstr "دو حالت کارکرد وجود دارد:" -msgid "If *\\*buffer* points a ``NULL`` pointer, the function will allocate a buffer of the needed size, copy the encoded data into this buffer and set *\\*buffer* to reference the newly allocated storage. The caller is responsible for calling :c:func:`PyMem_Free` to free the allocated buffer after usage." -msgstr "" +msgid "" +"If *\\*buffer* points a ``NULL`` pointer, the function will allocate a " +"buffer of the needed size, copy the encoded data into this buffer and set " +"*\\*buffer* to reference the newly allocated storage. The caller is " +"responsible for calling :c:func:`PyMem_Free` to free the allocated buffer " +"after usage." +msgstr "" +"اگر *\\*buffer* یک اشاره‌گر ``NULL`` باشد، تابع بافری با اندازه‌ی مورد نیاز " +"تخصیص می‌دهد، داده‌های کدگذاری‌شده را در این بافر کپی می‌کند و *\\*buffer* " +"را برای ارجاع به فضای ذخیره‌سازی تازه تخصیص‌یافته تنظیم می‌کند. فراخواننده " +"مسئول فراخوانی :c:func:`PyMem_Free` برای آزاد کردن بافر تخصیص‌یافته پس از " +"استفاده است." -msgid "If *\\*buffer* points to a non-``NULL`` pointer (an already allocated buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and interpret the initial value of *\\*buffer_length* as the buffer size. It will then copy the encoded data into the buffer and NUL-terminate it. If the buffer is not large enough, a :exc:`ValueError` will be set." -msgstr "" +msgid "" +"If *\\*buffer* points to a non-``NULL`` pointer (an already allocated " +"buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and" +" interpret the initial value of *\\*buffer_length* as the buffer size. It " +"will then copy the encoded data into the buffer and NUL-terminate it. If " +"the buffer is not large enough, a :exc:`ValueError` will be set." +msgstr "" +"اگر *\\*buffer* به اشاره‌گری غیر ``NULL`` اشاره کند (بافری که از قبل تخصیص " +"داده شده است)، :c:func:`PyArg_ParseTuple` از این مکان به عنوان بافر استفاده " +"می‌کند و مقدار اولیه‌ی *\\*buffer_length* را به عنوان اندازه‌ی بافر تفسیر " +"می‌کند. سپس داده‌های کدگذاری‌شده را در بافر کپی می‌کند و آن را با NUL پایان " +"می‌دهد. اگر بافر به اندازه‌ی کافی بزرگ نباشد، یک :exc:`ValueError` تنظیم " +"می‌شود." -msgid "In both cases, *\\*buffer_length* is set to the length of the encoded data without the trailing NUL byte." +msgid "" +"In both cases, *\\*buffer_length* is set to the length of the encoded data " +"without the trailing NUL byte." msgstr "" +"در هر دو حالت، *\\*buffer_length* به طول داده‌های کدگذاری‌شده بدون بایت تهی " +"انتهایی تنظیم می‌شود." -msgid "``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char \\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" +msgid "" +"``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" +"``et#`` (:class:`str`، :class:`bytes` یا :class:`bytearray`) [const char " +"\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" -msgid "Same as ``es#`` except that byte string objects are passed through without recoding them. Instead, the implementation assumes that the byte string object uses the encoding passed in as parameter." +msgid "" +"Same as ``es#`` except that byte string objects are passed through without " +"recoding them. Instead, the implementation assumes that the byte string " +"object uses the encoding passed in as parameter." msgstr "" +"مانند ``es#`` است، با این تفاوت که اشیاء رشته بایتی بدون بازکدگذاری، " +"مستقیماً عبور داده می‌شوند. در عوض، پیاده‌سازی فرض می‌کند که شیء رشته بایتی " +"از کدگذاری‌ای استفاده می‌کند که به‌عنوان پارامتر پاس داده شده است." -msgid "``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy ``Py_UNICODE*`` representation." +msgid "" +"``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy " +"``Py_UNICODE*`` representation." msgstr "" +"``u``، ``u#``، ``Z`` و ``Z#`` حذف شده‌اند زیرا از نمایش قدیمی " +"``Py_UNICODE*`` استفاده می‌کردند." msgid "Numbers" -msgstr "" +msgstr "اعداد" -msgid "These formats allow representing Python numbers or single characters as C numbers. Formats that require :class:`int`, :class:`float` or :class:`complex` can also use the corresponding special methods :meth:`~object.__index__`, :meth:`~object.__float__` or :meth:`~object.__complex__` to convert the Python object to the required type." -msgstr "" +msgid "" +"These formats allow representing Python numbers or single characters as C " +"numbers. Formats that require :class:`int`, :class:`float` or " +":class:`complex` can also use the corresponding special methods " +":meth:`~object.__index__`, :meth:`~object.__float__` or " +":meth:`~object.__complex__` to convert the Python object to the required " +"type." +msgstr "" +"این قالب‌ها اجازه می‌دهند اعداد پایتون یا نویسه‌های تکی به‌صورت اعداد C " +"نمایش داده شوند. قالب‌هایی که به :class:`int`، :class:`float` یا " +":class:`complex` نیاز دارند، می‌توانند برای تبدیل شیء پایتون به نوع موردنیاز" +" از متدهای ویژه‌ی متناظر :meth:`~object.__index__`، " +":meth:`~object.__float__` یا :meth:`~object.__complex__` نیز استفاده کنند." -msgid "For signed integer formats, :exc:`OverflowError` is raised if the value is out of range for the C type. For unsigned integer formats, no range checking is done --- the most significant bits are silently truncated when the receiving field is too small to receive the value." +msgid "" +"For signed integer formats, :exc:`OverflowError` is raised if the value is " +"out of range for the C type. For unsigned integer formats, no range checking" +" is done --- the most significant bits are silently truncated when the " +"receiving field is too small to receive the value." msgstr "" +"برای قالب‌های عدد صحیح علامت‌دار، اگر مقدار خارج از محدوده نوع C باشد، " +":exc:`OverflowError` مطرح می‌شود. برای قالب‌های عدد صحیح بدون علامت، هیچ " +"بررسی محدوده‌ای انجام نمی‌شود --- وقتی فیلد دریافت‌کننده برای دریافت مقدار " +"بیش از حد کوچک باشد، بیت‌های پرارزش بدون هیچ هشداری بریده می‌شوند." msgid "``b`` (:class:`int`) [unsigned char]" -msgstr "" +msgstr "``b`` (:class:`int`) [unsigned char]" -msgid "Convert a nonnegative Python integer to an unsigned tiny integer, stored in a C :c:expr:`unsigned char`." +msgid "" +"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " +"a C :c:expr:`unsigned char`." msgstr "" +"یک عدد صحیح نامنفی پایتون را به یک عدد صحیح بسیار کوچک بدون علامت تبدیل " +"می‌کند که در یک :c:expr:`unsigned char` در زبان C ذخیره می‌شود." msgid "``B`` (:class:`int`) [unsigned char]" -msgstr "" +msgstr "``B`` (:class:`int`) [unsigned char]" -msgid "Convert a Python integer to a tiny integer without overflow checking, stored in a C :c:expr:`unsigned char`." +msgid "" +"Convert a Python integer to a tiny integer without overflow checking, stored" +" in a C :c:expr:`unsigned char`." msgstr "" +"یک عدد صحیح پایتون را بدون بررسی سرریز به یک عدد صحیح کوچک تبدیل می‌کند که " +"در یک :c:expr:`unsigned char` از C ذخیره می‌شود." msgid "``h`` (:class:`int`) [short int]" -msgstr "" +msgstr "``h`` (:class:`int`) [short int]" msgid "Convert a Python integer to a C :c:expr:`short int`." -msgstr "" +msgstr "یک عدد صحیح پایتون را به :c:expr:`short int` در زبان C تبدیل می‌کند." msgid "``H`` (:class:`int`) [unsigned short int]" -msgstr "" +msgstr "``H`` (:class:`int`) [unsigned short int]" -msgid "Convert a Python integer to a C :c:expr:`unsigned short int`, without overflow checking." +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned short int`, without " +"overflow checking." msgstr "" +"یک عدد صحیح پایتون را بدون بررسی سرریز به یک :c:expr:`unsigned short int` در" +" C تبدیل می‌کند." msgid "``i`` (:class:`int`) [int]" -msgstr "" +msgstr "``i`` (:class:`int`) [int]" msgid "Convert a Python integer to a plain C :c:expr:`int`." -msgstr "" +msgstr "یک عدد صحیح پایتون را به یک :c:expr:`int` ساده‌ی C تبدیل می‌کند." msgid "``I`` (:class:`int`) [unsigned int]" -msgstr "" +msgstr "``I`` (:class:`int`) [unsigned int]" -msgid "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow checking." +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " +"checking." msgstr "" +"یک عدد صحیح پایتون را به :c:expr:`unsigned int` در C تبدیل می‌کند، بدون " +"بررسی سرریز." msgid "``l`` (:class:`int`) [long int]" -msgstr "" +msgstr "``l`` (:class:`int`) [long int]" msgid "Convert a Python integer to a C :c:expr:`long int`." -msgstr "" +msgstr "یک عدد صحیح پایتون را به یک :c:expr:`long int` در C تبدیل می‌کند." msgid "``k`` (:class:`int`) [unsigned long]" -msgstr "" +msgstr "``k`` (:class:`int`) [unsigned long]" -msgid "Convert a Python integer to a C :c:expr:`unsigned long` without overflow checking." +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned long` without overflow " +"checking." msgstr "" +"یک عدد صحیح پایتون را بدون بررسی سرریز به یک :c:expr:`unsigned long` در C " +"تبدیل می‌کند." msgid "Use :meth:`~object.__index__` if available." -msgstr "" +msgstr "در صورت وجود، از :meth:`~object.__index__` استفاده کنید." msgid "``L`` (:class:`int`) [long long]" -msgstr "" +msgstr "``L`` (:class:`int`) [long long]" msgid "Convert a Python integer to a C :c:expr:`long long`." -msgstr "" +msgstr "تبدیل یک عدد صحیح پایتون به یک :c:expr:`long long` در C." msgid "``K`` (:class:`int`) [unsigned long long]" -msgstr "" +msgstr "``K`` (:class:`int`) [unsigned long long]" -msgid "Convert a Python integer to a C :c:expr:`unsigned long long` without overflow checking." +msgid "" +"Convert a Python integer to a C :c:expr:`unsigned long long` without " +"overflow checking." msgstr "" +"یک عدد صحیح پایتون را بدون بررسی سرریز به یک :c:expr:`unsigned long long` در" +" C تبدیل می‌کند." msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -msgstr "" +msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." -msgstr "" +msgstr "یک عدد صحیح پایتون را به یک :c:type:`Py_ssize_t` در C تبدیل می‌کند." msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" -msgstr "" +msgstr "``c`` (:class:`bytes` یا :class:`bytearray` با طول ۱) [char]" -msgid "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` object of length 1, to a C :c:expr:`char`." +msgid "" +"Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray`" +" object of length 1, to a C :c:expr:`char`." msgstr "" +"یک بایت پایتون را که به صورت شیء :class:`bytes` یا :class:`bytearray` به طول" +" ۱ نمایش داده می‌شود، به یک :c:expr:`char` در C تبدیل می‌کند." msgid "Allow :class:`bytearray` objects." -msgstr "" +msgstr "اجازه‌ی استفاده از اشیاء :class:`bytearray`." msgid "``C`` (:class:`str` of length 1) [int]" -msgstr "" +msgstr "``C`` (:class:`str` به طول ۱) [int]" -msgid "Convert a Python character, represented as a :class:`str` object of length 1, to a C :c:expr:`int`." +msgid "" +"Convert a Python character, represented as a :class:`str` object of length " +"1, to a C :c:expr:`int`." msgstr "" +"یک نویسه‌ی پایتون را، که به‌صورت شیء :class:`str` با طول ۱ نمایش داده " +"می‌شود، به یک :c:expr:`int` در C تبدیل می‌کند." msgid "``f`` (:class:`float`) [float]" -msgstr "" +msgstr "``f`` (:class:`float`) [float]" msgid "Convert a Python floating-point number to a C :c:expr:`float`." -msgstr "" +msgstr "تبدیل یک عدد ممیز شناور پایتون به یک :c:expr:`float` در C." msgid "``d`` (:class:`float`) [double]" -msgstr "" +msgstr "``d`` (:class:`float`) [double]" msgid "Convert a Python floating-point number to a C :c:expr:`double`." -msgstr "" +msgstr "یک عدد ممیز شناور پایتون را به یک :c:expr:`double` در C تبدیل می‌کند." msgid "``D`` (:class:`complex`) [Py_complex]" -msgstr "" +msgstr "``D`` (:class:`complex`) [Py_complex]" msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." msgstr "" +"یک عدد مختلط پایتون را به ساختار :c:type:`Py_complex` زبان C تبدیل می‌کند." msgid "Other objects" -msgstr "" +msgstr "سایر اشیاء" msgid "``O`` (object) [PyObject \\*]" -msgstr "" +msgstr "``O`` (شیء) [PyObject \\*]" -msgid "Store a Python object (without any conversion) in a C object pointer. The C program thus receives the actual object that was passed. A new :term:`strong reference` to the object is not created (i.e. its reference count is not increased). The pointer stored is not ``NULL``." +msgid "" +"Store a Python object (without any conversion) in a C object pointer. The C" +" program thus receives the actual object that was passed. A new " +":term:`strong reference` to the object is not created (i.e. its reference " +"count is not increased). The pointer stored is not ``NULL``." msgstr "" +"یک شیء پایتون را (بدون هیچ تبدیلی) در یک اشاره‌گر شیء C ذخیره می‌کند. بدین " +"ترتیب برنامه‌ی C همان شیء واقعی‌ای را که پاس داده‌شده است دریافت می‌کند. " +":term:`ارجاع قوی ` جدیدی به این شیء ایجاد نمی‌شود (یعنی " +"شمارش ارجاع آن افزایش نمی‌یابد). اشاره‌گر ذخیره‌شده ``NULL`` نیست." msgid "``O!`` (object) [*typeobject*, PyObject \\*]" -msgstr "" +msgstr "``O!`` (شیء) [*typeobject*, PyObject \\*]" -msgid "Store a Python object in a C object pointer. This is similar to ``O``, but takes two C arguments: the first is the address of a Python type object, the second is the address of the C variable (of type :c:expr:`PyObject*`) into which the object pointer is stored. If the Python object does not have the required type, :exc:`TypeError` is raised." -msgstr "" +msgid "" +"Store a Python object in a C object pointer. This is similar to ``O``, but " +"takes two C arguments: the first is the address of a Python type object, the" +" second is the address of the C variable (of type :c:expr:`PyObject*`) into " +"which the object pointer is stored. If the Python object does not have the " +"required type, :exc:`TypeError` is raised." +msgstr "" +"یک شیء پایتون را در یک اشاره‌گر شیء C ذخیره می‌کند. این مورد شبیه ``O`` است،" +" اما دو آرگومان C می‌گیرد: آرگومان اول نشانی یک شیء نوع پایتون است و آرگومان" +" دوم نشانی متغیر C (از نوع :c:expr:`PyObject*`) است که اشاره‌گر شیء در آن " +"ذخیره می‌شود. اگر شیء پایتون نوع مورد نیاز را نداشته باشد، استثنای " +":exc:`TypeError` مطرح می‌شود." msgid "``O&`` (object) [*converter*, *address*]" -msgstr "" +msgstr "``O&`` (شیء) [*مبدل*، *آدرس*]" -msgid "Convert a Python object to a C variable through a *converter* function. This takes two arguments: the first is a function, the second is the address of a C variable (of arbitrary type), converted to :c:expr:`void *`. The *converter* function in turn is called as follows::" +msgid "" +"Convert a Python object to a C variable through a *converter* function. " +"This takes two arguments: the first is a function, the second is the address" +" of a C variable (of arbitrary type), converted to :c:expr:`void *`. The " +"*converter* function in turn is called as follows::" msgstr "" +"یک شیء پایتون را از طریق تابع *مبدل* به یک متغیر C تبدیل کنید. این تبدیل دو" +" آرگومان می‌گیرد: اولی یک تابع است و دومی آدرس یک متغیر C (از نوع دلخواه) " +"است که به :c:expr:`void *` تبدیل می‌شود. تابع *مبدل* به نوبه خود به شکل زیر" +" فراخوانی می‌شود::" msgid "status = converter(object, address);" -msgstr "" +msgstr "status = converter(object, address);" -msgid "where *object* is the Python object to be converted and *address* is the :c:expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The returned *status* should be ``1`` for a successful conversion and ``0`` if the conversion has failed. When the conversion fails, the *converter* function should raise an exception and leave the content of *address* unmodified." -msgstr "" +msgid "" +"where *object* is the Python object to be converted and *address* is the " +":c:expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. " +"The returned *status* should be ``1`` for a successful conversion and ``0`` " +"if the conversion has failed. When the conversion fails, the *converter* " +"function should raise an exception and leave the content of *address* " +"unmodified." +msgstr "" +"که در آن *object* شیء پایتونی است که باید تبدیل شود و *address* آرگومان " +":c:expr:`void*` است که به تابع ``PyArg_Parse*`` ارسال شده است. *status* " +"بازگردانده‌شده باید در صورت تبدیل موفق ``1`` و در صورت شکست تبدیل ``0`` " +"باشد. هنگامی که تبدیل شکست می‌خورد، تابع *converter* باید استثنایی را " +"برانگیزد و محتوای *address* را بدون تغییر بگذارد." -msgid "If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get called a second time if the argument parsing eventually fails, giving the converter a chance to release any memory that it had already allocated. In this second call, the *object* parameter will be ``NULL``; *address* will have the same value as in the original call." -msgstr "" +msgid "" +"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get " +"called a second time if the argument parsing eventually fails, giving the " +"converter a chance to release any memory that it had already allocated. In " +"this second call, the *object* parameter will be ``NULL``; *address* will " +"have the same value as in the original call." +msgstr "" +"اگر *مبدل* مقدار :c:macro:`!Py_CLEANUP_SUPPORTED` را برگرداند، ممکن است در " +"صورتی که تجزیه‌ی آرگومان‌ها در نهایت شکست بخورد، بار دوم فراخوانی شود، که " +"این به مبدل فرصت می‌دهد تا هر حافظه‌ای را که پیش‌تر تخصیص داده بود آزاد کند." +" در این فراخوانی دوم، پارامتر *object* برابر ``NULL`` خواهد بود؛ *address* " +"همان مقداری را خواهد داشت که در فراخوانی اصلی داشت." -msgid "Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:`PyUnicode_FSDecoder`." +msgid "" +"Examples of converters: :c:func:`PyUnicode_FSConverter` and " +":c:func:`PyUnicode_FSDecoder`." msgstr "" +"نمونه‌هایی از مبدل‌ها: :c:func:`PyUnicode_FSConverter` و " +":c:func:`PyUnicode_FSDecoder`." msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." -msgstr "" +msgstr ":c:macro:`!Py_CLEANUP_SUPPORTED` افزوده شد." msgid "``p`` (:class:`bool`) [int]" -msgstr "" +msgstr "``p`` (:class:`bool`) [int]" -msgid "Tests the value passed in for truth (a boolean **p**\\ redicate) and converts the result to its equivalent C true/false integer value. Sets the int to ``1`` if the expression was true and ``0`` if it was false. This accepts any valid Python value. See :ref:`truth` for more information about how Python tests values for truth." -msgstr "" +msgid "" +"Tests the value passed in for truth (a boolean **p**\\ redicate) and " +"converts the result to its equivalent C true/false integer value. Sets the " +"int to ``1`` if the expression was true and ``0`` if it was false. This " +"accepts any valid Python value. See :ref:`truth` for more information about" +" how Python tests values for truth." +msgstr "" +"مقدار پاس‌داده‌شده را برای درستی آزمایش می‌کند (یک محمول بولی (**p**\\ " +"redicate)) و نتیجه را به مقدار عدد صحیح true/false معادل آن در C تبدیل " +"می‌کند. اگر عبارت درست باشد، int را روی ``1`` و اگر نادرست باشد، روی ``0`` " +"قرار می‌دهد. این، هر مقدار معتبر پایتون را می‌پذیرد. برای اطلاعات بیشتر " +"درباره‌ی اینکه پایتون چگونه مقادیر را برای درستی آزمایش می‌کند، :ref:`truth`" +" را ببینید." msgid "``(items)`` (sequence) [*matching-items*]" -msgstr "" +msgstr "``(items)`` (دنباله) [*آیتم‌های منطبق*]" -msgid "The object must be a Python sequence (except :class:`str`, :class:`bytes` or :class:`bytearray`) whose length is the number of format units in *items*. The C arguments must correspond to the individual format units in *items*. Format units for sequences may be nested." +msgid "" +"The object must be a Python sequence (except :class:`str`, :class:`bytes` or" +" :class:`bytearray`) whose length is the number of format units in *items*." +" The C arguments must correspond to the individual format units in *items*." +" Format units for sequences may be nested." msgstr "" +"شیء باید یک دنباله پایتونی باشد (به جز :class:`str`، :class:`bytes` یا " +":class:`bytearray`) که طول آن برابر با تعداد واحدهای قالب (format unit) در " +"*items* است. آرگومان‌های C باید با تک‌تک واحدهای قالب در *items* متناظر " +"باشند. واحدهای قالب برای دنباله‌ها می‌توانند تودرتو باشند." -msgid "If *items* contains format units which store a :ref:`borrowed buffer ` (``s``, ``s#``, ``z``, ``z#``, ``y``, or ``y#``) or a :term:`borrowed reference` (``S``, ``Y``, ``U``, ``O``, or ``O!``), the object must be a Python tuple. The *converter* for the ``O&`` format unit in *items* must not store a borrowed buffer or a borrowed reference." -msgstr "" +msgid "" +"If *items* contains format units which store a :ref:`borrowed buffer ` (``s``, ``s#``, ``z``, ``z#``, ``y``, or ``y#``) or a " +":term:`borrowed reference` (``S``, ``Y``, ``U``, ``O``, or ``O!``), the " +"object must be a Python tuple. The *converter* for the ``O&`` format unit in" +" *items* must not store a borrowed buffer or a borrowed reference." +msgstr "" +"اگر *items* شامل واحدهای قالب (format unit) باشد که یک :ref:`بافر امانتی " +"` (``s``، ``s#``، ``z``، ``z#``، ``y`` یا ``y#``) یا " +"یک :term:`ارجاع امانتی ` (``S``، ``Y``، ``U``، ``O`` یا " +"``O!``) را ذخیره می‌کنند، شیء باید یک تاپل پایتون باشد. *مبدل* واحد قالب " +"``O&`` در *items* نباید بافر امانتی یا ارجاع امانتی ذخیره کند." -msgid ":class:`str` and :class:`bytearray` objects no longer accepted as a sequence." +msgid "" +":class:`str` and :class:`bytearray` objects no longer accepted as a " +"sequence." msgstr "" +"اشیاء :class:`str` و :class:`bytearray` دیگر به‌عنوان دنباله پذیرفته " +"نمی‌شوند." -msgid "Non-tuple sequences are deprecated if *items* contains format units which store a borrowed buffer or a borrowed reference." +msgid "" +"Non-tuple sequences are deprecated if *items* contains format units which " +"store a borrowed buffer or a borrowed reference." msgstr "" +"اگر *items* شامل واحدهای قالب باشد که بافر امانتی یا ارجاع امانتی ذخیره " +"می‌کنند، دنباله‌های غیرتاپلی منسوخ شده‌اند." -msgid "A few other characters have a meaning in a format string. These may not occur inside nested parentheses. They are:" +msgid "" +"A few other characters have a meaning in a format string. These may not " +"occur inside nested parentheses. They are:" msgstr "" +"چند نویسه‌ی دیگر نیز در رشته‌ی قالب‌بندی معنا دارند. این نویسه‌ها نمی‌توانند" +" درون پرانتزهای تودرتو به کار روند. آن‌ها عبارت‌اند از:" msgid "``|``" -msgstr "" +msgstr "``|``" -msgid "Indicates that the remaining arguments in the Python argument list are optional. The C variables corresponding to optional arguments should be initialized to their default value --- when an optional argument is not specified, :c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C variable(s)." +msgid "" +"Indicates that the remaining arguments in the Python argument list are " +"optional. The C variables corresponding to optional arguments should be " +"initialized to their default value --- when an optional argument is not " +"specified, :c:func:`PyArg_ParseTuple` does not touch the contents of the " +"corresponding C variable(s)." msgstr "" +"نشان می‌دهد که آرگومان‌های باقی‌مانده در فهرست آرگومان‌های پایتون اختیاری " +"هستند. متغیرهای C متناظر با آرگومان‌های اختیاری باید با مقدار پیش‌فرض خود " +"مقداردهی اولیه شوند --- هنگامی که یک آرگومان اختیاری مشخص نشده باشد، " +":c:func:`PyArg_ParseTuple` به محتویات متغیر(های) C متناظر دست نمی‌برد." msgid "``$``" -msgstr "" +msgstr "``$``" -msgid ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining arguments in the Python argument list are keyword-only. Currently, all keyword-only arguments must also be optional arguments, so ``|`` must always be specified before ``$`` in the format string." +msgid "" +":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " +"arguments in the Python argument list are keyword-only. Currently, all " +"keyword-only arguments must also be optional arguments, so ``|`` must always" +" be specified before ``$`` in the format string." msgstr "" +"فقط برای :c:func:`PyArg_ParseTupleAndKeywords`: نشان می‌دهد که آرگومان‌های " +"باقی‌مانده در فهرست آرگومان‌های پایتون، فقط‌کلیدواژه‌ای هستند. در حال حاضر، " +"همه‌ی آرگومان‌های فقط‌کلیدواژه‌ای باید آرگومان‌های اختیاری نیز باشند، " +"بنابراین ``|`` باید همیشه پیش از ``$`` در رشته قالب تعیین شود." msgid "``:``" -msgstr "" +msgstr "``:``" -msgid "The list of format units ends here; the string after the colon is used as the function name in error messages (the \"associated value\" of the exception that :c:func:`PyArg_ParseTuple` raises)." +msgid "" +"The list of format units ends here; the string after the colon is used as " +"the function name in error messages (the \"associated value\" of the " +"exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" +"فهرست واحدهای قالب در اینجا به پایان می‌رسد؛ رشته‌ای که پس از دونقطه می‌آید " +"به‌عنوان نام تابع در پیام‌های خطا استفاده می‌شود («مقدار مرتبط» استثنایی که " +":c:func:`PyArg_ParseTuple` ایجاد می‌کند)." msgid "``;``" -msgstr "" +msgstr "``;``" -msgid "The list of format units ends here; the string after the semicolon is used as the error message *instead* of the default error message. ``:`` and ``;`` mutually exclude each other." +msgid "" +"The list of format units ends here; the string after the semicolon is used " +"as the error message *instead* of the default error message. ``:`` and " +"``;`` mutually exclude each other." msgstr "" +"فهرست واحدهای قالب در اینجا به پایان می‌رسد؛ رشته‌ی پس از نقطه‌ویرگول " +"*به‌جای* پیام خطای پیش‌فرض، به‌عنوان پیام خطا استفاده می‌شود. ``:`` و ``;`` " +"با یکدیگر انحصار متقابل دارند." -msgid "Note that any Python object references which are provided to the caller are *borrowed* references; do not release them (i.e. do not decrement their reference count)!" +msgid "" +"Note that any Python object references which are provided to the caller are " +"*borrowed* references; do not release them (i.e. do not decrement their " +"reference count)!" msgstr "" +"توجه داشته باشید که هر ارجاع به شیء پایتون که به فراخوان‌کننده ارائه می‌شود،" +" ارجاعی *امانتی* است؛ آن‌ها را آزاد نکنید (یعنی شمارش ارجاع آن‌ها را کاهش " +"ندهید)!" -msgid "Additional arguments passed to these functions must be addresses of variables whose type is determined by the format string; these are used to store values from the input tuple. There are a few cases, as described in the list of format units above, where these parameters are used as input values; they should match what is specified for the corresponding format unit in that case." -msgstr "" +msgid "" +"Additional arguments passed to these functions must be addresses of " +"variables whose type is determined by the format string; these are used to " +"store values from the input tuple. There are a few cases, as described in " +"the list of format units above, where these parameters are used as input " +"values; they should match what is specified for the corresponding format " +"unit in that case." +msgstr "" +"آرگومان‌های اضافی که به این توابع پاس داده می‌شوند باید آدرس متغیرهایی باشند" +" که نوع آن‌ها توسط رشته‌ی قالب تعیین می‌شود؛ از این آرگومان‌ها برای ذخیره‌ی " +"مقادیر تاپل ورودی استفاده می‌شود. چند مورد وجود دارد، همان‌طور که در فهرست " +"واحدهای قالب در بالا توضیح داده شده، که در آن‌ها این پارامترها به‌عنوان " +"مقادیر ورودی استفاده می‌شوند؛ در چنین مواردی، این پارامترها باید با آنچه " +"برای واحد قالب متناظر مشخص شده است مطابقت داشته باشند." -msgid "For the conversion to succeed, the *arg* object must match the format and the format must be exhausted. On success, the ``PyArg_Parse*`` functions return true, otherwise they return false and raise an appropriate exception. When the ``PyArg_Parse*`` functions fail due to conversion failure in one of the format units, the variables at the addresses corresponding to that and the following format units are left untouched." -msgstr "" +msgid "" +"For the conversion to succeed, the *arg* object must match the format and " +"the format must be exhausted. On success, the ``PyArg_Parse*`` functions " +"return true, otherwise they return false and raise an appropriate exception." +" When the ``PyArg_Parse*`` functions fail due to conversion failure in one " +"of the format units, the variables at the addresses corresponding to that " +"and the following format units are left untouched." +msgstr "" +"برای آنکه تبدیل با موفقیت انجام شود، شیء *arg* باید با قالب مطابقت داشته " +"باشد و قالب باید به‌طور کامل مصرف شود. در صورت موفقیت، توابع " +"``PyArg_Parse*`` مقدار true را برمی‌گردانند، در غیر این صورت مقدار false را " +"برمی‌گردانند و یک استثنای مناسب ایجاد می‌کنند. هنگامی که توابع " +"``PyArg_Parse*`` به دلیل شکست تبدیل در یکی از واحدهای قالب با شکست مواجه " +"می‌شوند، متغیرهایی که در آدرس‌های متناظر با آن واحد قالب و واحدهای قالب بعدی" +" قرار دارند، دست‌نخورده باقی می‌مانند." msgid "API Functions" -msgstr "" +msgstr "توابع API" -msgid "Parse the parameters of a function that takes only positional parameters into local variables. Returns true on success; on failure, it returns false and raises the appropriate exception." +msgid "" +"Parse the parameters of a function that takes only positional parameters " +"into local variables. Returns true on success; on failure, it returns false" +" and raises the appropriate exception." msgstr "" +"پارامترهای تابعی را که فقط پارامترهای جایگاهی می‌پذیرد، به متغیرهای محلی " +"تجزیه می‌کند. در صورت موفقیت true برمی‌گرداند؛ در صورت شکست، false " +"برمی‌گرداند و استثنای مناسب را برمی‌انگیزد." -msgid "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list rather than a variable number of arguments." +msgid "" +"Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " +"rather than a variable number of arguments." msgstr "" +"یکسان با :c:func:`PyArg_ParseTuple` است، با این تفاوت که به‌جای تعداد متغیری" +" از آرگومان‌ها، یک va_list را می‌پذیرد." -msgid "Parse the parameters of a function that takes both positional and keyword parameters into local variables. The *keywords* argument is a ``NULL``-terminated array of keyword parameter names specified as null-terminated ASCII or UTF-8 encoded C strings. Empty names denote :ref:`positional-only parameters `. Returns true on success; on failure, it returns false and raises the appropriate exception." -msgstr "" +msgid "" +"Parse the parameters of a function that takes both positional and keyword " +"parameters into local variables. The *keywords* argument is a " +"``NULL``-terminated array of keyword parameter names specified as null-" +"terminated ASCII or UTF-8 encoded C strings. Empty names denote " +":ref:`positional-only parameters `. Returns true " +"on success; on failure, it returns false and raises the appropriate " +"exception." +msgstr "" +"پارامترهای تابعی را که هم پارامترهای جایگاهی و هم پارامترهای کلیدواژه‌ای " +"می‌پذیرد، به متغیرهای محلی تجزیه می‌کند. آرگومان *keywords* آرایه‌ای " +"خاتمه‌یافته با ``NULL`` از نام‌های پارامترهای کلیدواژه‌ای است که به‌صورت " +"رشته‌های C خاتمه‌یافته با تهی و کدگذاری‌شده با اسکی یا UTF-8 مشخص شده‌اند. " +"نام‌های خالی نشان‌دهنده‌ی :ref:`پارامترهای فقط‌جایگاهی ` هستند. در صورت موفقیت، true برمی‌گرداند؛ در صورت شکست، " +"false برمی‌گرداند و استثنای مناسب را ایجاد می‌کند." -msgid "The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:expr:`const char * const *` in C++. This can be overridden with the :c:macro:`PY_CXX_CONST` macro." +msgid "" +"The *keywords* parameter declaration is :c:expr:`char * const *` in C and " +":c:expr:`const char * const *` in C++. This can be overridden with the " +":c:macro:`PY_CXX_CONST` macro." msgstr "" +"اعلان پارامتر *keywords* در C به صورت :c:expr:`char * const *` و در C++ به " +"صورت :c:expr:`const char * const *` است. این را می‌توان با ماکروی " +":c:macro:`PY_CXX_CONST` بازنویسی کرد." -msgid "Added support for :ref:`positional-only parameters `." +msgid "" +"Added support for :ref:`positional-only parameters `." msgstr "" +"پشتیبانی از :ref:`پارامترهای فقط‌جایگاهی ` افزوده" +" شد." -msgid "The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added support for non-ASCII keyword parameter names." +msgid "" +"The *keywords* parameter has now type :c:expr:`char * const *` in C and " +":c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " +"support for non-ASCII keyword parameter names." msgstr "" +"پارامتر *keywords* اکنون در C از نوع :c:expr:`char * const *` و در C++ از " +"نوع :c:expr:`const char * const *` است، به‌جای :c:expr:`char **`. پشتیبانی " +"از نام‌های غیراسکی برای پارامترهای کلیدواژه‌ای افزوده شد." -msgid "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a va_list rather than a variable number of arguments." +msgid "" +"Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a" +" va_list rather than a variable number of arguments." msgstr "" +"یکسان با :c:func:`PyArg_ParseTupleAndKeywords` است، با این تفاوت که به جای " +"تعداد متغیری از آرگومان‌ها، یک va_list می‌پذیرد." -msgid "Ensure that the keys in the keywords argument dictionary are strings. This is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since the latter already does this check." +msgid "" +"Ensure that the keys in the keywords argument dictionary are strings. This " +"is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " +"the latter already does this check." msgstr "" +"مطمئن شوید که کلیدهای دیکشنری آرگومان keywords رشته باشند. این کار تنها در " +"صورتی لازم است که از :c:func:`PyArg_ParseTupleAndKeywords` استفاده نشده " +"باشد، زیرا خودِ آن از پیش این بررسی را انجام می‌دهد." -msgid "Parse the parameter of a function that takes a single positional parameter into a local variable. Returns true on success; on failure, it returns false and raises the appropriate exception." +msgid "" +"Parse the parameter of a function that takes a single positional parameter " +"into a local variable. Returns true on success; on failure, it returns " +"false and raises the appropriate exception." msgstr "" +"پارامتر تابعی را که یک پارامتر جایگاهی منفرد می‌گیرد، در یک متغیر محلی پارس " +"می‌کند. در صورت موفقیت true را برمی‌گرداند؛ در صورت شکست، false برمی‌گرداند " +"و استثنای مناسب را ایجاد می‌کند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "// Function using METH_O calling convention\n" @@ -454,12 +1027,53 @@ msgid "" " // ... use value ...\n" "}" msgstr "" +"// Function using METH_O calling convention\n" +"static PyObject*\n" +"my_function(PyObject *module, PyObject *arg)\n" +"{\n" +" int value;\n" +" if (!PyArg_Parse(arg, \"i:my_function\", &value)) {\n" +" return NULL;\n" +" }\n" +" // ... use value ...\n" +"}" -msgid "A simpler form of parameter retrieval which does not use a format string to specify the types of the arguments. Functions which use this method to retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in function or method tables. The tuple containing the actual parameters should be passed as *args*; it must actually be a tuple. The length of the tuple must be at least *min* and no more than *max*; *min* and *max* may be equal. Additional arguments must be passed to the function, each of which should be a pointer to a :c:expr:`PyObject*` variable; these will be filled in with the values from *args*; they will contain :term:`borrowed references `. The variables which correspond to optional parameters not given by *args* will not be filled in; these should be initialized by the caller. This function returns true on success and false if *args* is not a tuple or contains the wrong number of elements; an exception will be set if there was a failure." -msgstr "" +msgid "" +"A simpler form of parameter retrieval which does not use a format string to " +"specify the types of the arguments. Functions which use this method to " +"retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in " +"function or method tables. The tuple containing the actual parameters " +"should be passed as *args*; it must actually be a tuple. The length of the " +"tuple must be at least *min* and no more than *max*; *min* and *max* may be " +"equal. Additional arguments must be passed to the function, each of which " +"should be a pointer to a :c:expr:`PyObject*` variable; these will be filled " +"in with the values from *args*; they will contain :term:`borrowed references" +" `. The variables which correspond to optional " +"parameters not given by *args* will not be filled in; these should be " +"initialized by the caller. This function returns true on success and false " +"if *args* is not a tuple or contains the wrong number of elements; an " +"exception will be set if there was a failure." +msgstr "" +"شکل ساده‌تری از بازیابی پارامتر که برای تعیین نوع آرگومان‌ها از رشته قالب " +"استفاده نمی‌کند. توابعی که از این روش برای بازیابی پارامترهای خود استفاده " +"می‌کنند باید در جدول‌های تابع یا متد به‌صورت :c:macro:`METH_VARARGS` اعلان " +"شوند. تاپل حاوی پارامترهای واقعی باید به‌عنوان *args* ارسال شود؛ واقعاً باید" +" یک تاپل باشد. طول تاپل باید حداقل *min* و حداکثر *max* باشد؛ *min* و *max* " +"می‌توانند برابر باشند. آرگومان‌های اضافی باید به تابع ارسال شوند که هر یک " +"باید اشاره‌گری به متغیر :c:expr:`PyObject*` باشد؛ این‌ها با مقادیر *args* پر" +" خواهند شد؛ آن‌ها حاوی :term:`ارجاع‌های امانتی ` خواهند " +"بود. متغیرهای متناظر با پارامترهای اختیاری که توسط *args* داده نشده‌اند، پر " +"نخواهند شد؛ این متغیرها باید توسط فراخواننده مقداردهی اولیه شوند. این تابع " +"در صورت موفقیت true برمی‌گرداند و اگر *args* یک تاپل نباشد یا تعداد عناصر " +"نادرستی داشته باشد false برمی‌گرداند؛ در صورت شکست، یک استثنا تنظیم خواهد " +"شد." -msgid "This is an example of the use of this function, taken from the sources for the :mod:`!_weakref` helper module for weak references::" +msgid "" +"This is an example of the use of this function, taken from the sources for " +"the :mod:`!_weakref` helper module for weak references::" msgstr "" +"این مثالی از استفاده از این تابع است که از کدهای منبع ماژول کمکی " +":mod:`!_weakref` برای ارجاع‌های ضعیف برگرفته شده است::" msgid "" "static PyObject *\n" @@ -475,189 +1089,366 @@ msgid "" " return result;\n" "}" msgstr "" +"static PyObject *\n" +"weakref_ref(PyObject *self, PyObject *args)\n" +"{\n" +" PyObject *object;\n" +" PyObject *callback = NULL;\n" +" PyObject *result = NULL;\n" +"\n" +" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n" +" result = PyWeakref_NewRef(object, callback);\n" +" }\n" +" return result;\n" +"}" -msgid "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely equivalent to this call to :c:func:`PyArg_ParseTuple`::" +msgid "" +"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " +"equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" +"فراخوانی :c:func:`PyArg_UnpackTuple` در این مثال کاملاً معادل این فراخوانی " +":c:func:`PyArg_ParseTuple` است::" msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" -msgstr "" +msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" -msgid "The value to be inserted, if any, before :c:expr:`char * const *` in the *keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` and :c:func:`PyArg_VaParseTupleAndKeywords`. Default empty for C and ``const`` for C++ (:c:expr:`const char * const *`). To override, define it to the desired value before including :file:`Python.h`." -msgstr "" +msgid "" +"The value to be inserted, if any, before :c:expr:`char * const *` in the " +"*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " +"and :c:func:`PyArg_VaParseTupleAndKeywords`. Default empty for C and " +"``const`` for C++ (:c:expr:`const char * const *`). To override, define it " +"to the desired value before including :file:`Python.h`." +msgstr "" +"مقداری که در صورت وجود، پیش از :c:expr:`char * const *` در اعلان پارامتر " +"*keywords* در :c:func:`PyArg_ParseTupleAndKeywords` و " +":c:func:`PyArg_VaParseTupleAndKeywords` درج می‌شود. مقدار پیش‌فرض برای C " +"خالی و برای C++ مقدار ``const`` است (:c:expr:`const char * const *`). برای " +"تغییر این مقدار، آن را پیش از گنجاندن (include) :file:`Python.h` به مقدار " +"دلخواه تعریف کنید." msgid "Building values" -msgstr "" +msgstr "ساخت مقادیر" -msgid "Create a new value based on a format string similar to those accepted by the ``PyArg_Parse*`` family of functions and a sequence of values. Returns the value or ``NULL`` in the case of an error; an exception will be raised if ``NULL`` is returned." +msgid "" +"Create a new value based on a format string similar to those accepted by the" +" ``PyArg_Parse*`` family of functions and a sequence of values. Returns the" +" value or ``NULL`` in the case of an error; an exception will be raised if " +"``NULL`` is returned." msgstr "" +"یک مقدار جدید بر اساس یک رشته قالب‌بندی مشابه رشته‌های پذیرفته‌شده توسط " +"خانواده‌ی توابع ``PyArg_Parse*`` و یک دنباله از مقادیر ایجاد می‌کند. مقدار " +"یا ``NULL`` را در صورت وقوع خطا برمی‌گرداند؛ اگر ``NULL`` برگردانده شود، " +"استثنا ایجاد خواهد شد." -msgid ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple only if its format string contains two or more format units. If the format string is empty, it returns ``None``; if it contains exactly one format unit, it returns whatever object is described by that format unit. To force it to return a tuple of size 0 or one, parenthesize the format string." -msgstr "" +msgid "" +":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " +"only if its format string contains two or more format units. If the format " +"string is empty, it returns ``None``; if it contains exactly one format " +"unit, it returns whatever object is described by that format unit. To force" +" it to return a tuple of size 0 or one, parenthesize the format string." +msgstr "" +":c:func:`Py_BuildValue` همیشه تاپل نمی‌سازد. این تابع تنها زمانی تاپل " +"می‌سازد که رشته قالب‌بندی آن شامل دو واحد قالب‌بندی یا بیشتر باشد. اگر رشته " +"قالب‌بندی خالی باشد، ``None`` برمی‌گرداند؛ و اگر دقیقاً یک واحد قالب‌بندی " +"داشته باشد، هر شیئی را که آن واحد قالب‌بندی توصیف می‌کند برمی‌گرداند. برای " +"وادار کردن آن به برگرداندن تاپلی با اندازه ۰ یا یک، رشته قالب‌بندی را داخل " +"پرانتز قرار دهید." -msgid "When memory buffers are passed as parameters to supply data to build objects, as for the ``s`` and ``s#`` formats, the required data is copied. Buffers provided by the caller are never referenced by the objects created by :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`, your code is responsible for calling :c:func:`free` for that memory once :c:func:`Py_BuildValue` returns." -msgstr "" +msgid "" +"When memory buffers are passed as parameters to supply data to build " +"objects, as for the ``s`` and ``s#`` formats, the required data is copied. " +"Buffers provided by the caller are never referenced by the objects created " +"by :c:func:`Py_BuildValue`. In other words, if your code invokes " +":c:func:`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`," +" your code is responsible for calling :c:func:`free` for that memory once " +":c:func:`Py_BuildValue` returns." +msgstr "" +"هنگامی که بافرهای حافظه به‌عنوان پارامتر برای تأمین داده‌های ساخت اشیاء " +"ارسال می‌شوند — مانند قالب‌های ``s`` و ``s#`` — داده‌های مورد نیاز کپی " +"می‌شوند. اشیایی که :c:func:`Py_BuildValue` ایجاد می‌کند، هرگز به بافرهای " +"فراهم‌شده توسط فراخوان‌کننده ارجاعی ندارند. به عبارت دیگر، اگر کد شما " +":c:func:`malloc` را فراخوانی کند و حافظه‌ی تخصیص‌یافته را به " +":c:func:`Py_BuildValue` منتقل کند، کد شما مسئول است که به‌محض بازگشت " +":c:func:`Py_BuildValue`، :c:func:`free` را برای آن حافظه فراخوانی کند." -msgid "In the following description, the quoted form is the format unit; the entry in (round) parentheses is the Python object type that the format unit will return; and the entry in [square] brackets is the type of the C value(s) to be passed." +msgid "" +"In the following description, the quoted form is the format unit; the entry " +"in (round) parentheses is the Python object type that the format unit will " +"return; and the entry in [square] brackets is the type of the C value(s) to " +"be passed." msgstr "" +"در توضیح زیر، شکل داخل گیومه، واحد قالب (format unit) است؛ ورودی داخل پرانتز" +" (گرد)، نوع شیء پایتونی است که واحد قالب بازمی‌گرداند؛ و ورودی داخل کروشه " +"[مربع]، نوع مقدار(های) C است که باید گذر داده شود." -msgid "The characters space, tab, colon and comma are ignored in format strings (but not within format units such as ``s#``). This can be used to make long format strings a tad more readable." +msgid "" +"The characters space, tab, colon and comma are ignored in format strings " +"(but not within format units such as ``s#``). This can be used to make long" +" format strings a tad more readable." msgstr "" +"نویسه‌های فاصله، تب، دونقطه و ویرگول در رشته‌های قالب نادیده گرفته می‌شوند " +"(اما نه درون واحدهای قالب مانند ``s#``). از این می‌توان برای کمی خواناتر " +"کردن رشته‌های قالب بلند استفاده کرد." msgid "``s`` (:class:`str` or ``None``) [const char \\*]" -msgstr "" +msgstr "``s`` (:class:`str` یا ``None``) [const char \\*]" -msgid "Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." +msgid "" +"Convert a null-terminated C string to a Python :class:`str` object using " +"``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" +"یک رشته C پایان‌یافته با نویسه تهی را با استفاده از کدگذاری ``'utf-8'`` به " +"شیء :class:`str` پایتون تبدیل می‌کند. اگر اشاره‌گر رشته C برابر ``NULL`` " +"باشد، از ``None`` استفاده می‌شود." msgid "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" +"``s#`` (:class:`str` یا ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -msgid "Convert a C string and its length to a Python :class:`str` object using ``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is ignored and ``None`` is returned." +msgid "" +"Convert a C string and its length to a Python :class:`str` object using " +"``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " +"ignored and ``None`` is returned." msgstr "" +"یک رشته‌ی C و طول آن را با استفاده از کدگذاری ``'utf-8'`` به یک شیء " +":class:`str` پایتون تبدیل می‌کند. اگر اشاره‌گر رشته‌ی C برابر ``NULL`` باشد،" +" طول نادیده گرفته می‌شود و ``None`` بازگردانده می‌شود." msgid "``y`` (:class:`bytes`) [const char \\*]" -msgstr "" +msgstr "``y`` (:class:`bytes`) [const char \\*]" -msgid "This converts a C string to a Python :class:`bytes` object. If the C string pointer is ``NULL``, ``None`` is returned." +msgid "" +"This converts a C string to a Python :class:`bytes` object. If the C string" +" pointer is ``NULL``, ``None`` is returned." msgstr "" +"این، یک رشته C را به یک شیء :class:`bytes` پایتون تبدیل می‌کند. اگر اشاره‌گر" +" رشته C برابر ``NULL`` باشد، ``None`` بازگردانده می‌شود." msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -msgstr "" +msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -msgid "This converts a C string and its lengths to a Python object. If the C string pointer is ``NULL``, ``None`` is returned." +msgid "" +"This converts a C string and its lengths to a Python object. If the C " +"string pointer is ``NULL``, ``None`` is returned." msgstr "" +"این، یک رشته‌ی C و طول آن را به یک شیء پایتون تبدیل می‌کند. اگر اشاره‌گر " +"رشته‌ی C برابر ``NULL`` باشد، ``None`` برگردانده می‌شود." msgid "Same as ``s``." -msgstr "" +msgstr "همانند ``s`` است." msgid "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" +"``z#`` (:class:`str` یا ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgid "Same as ``s#``." -msgstr "" +msgstr "همانند ``s#`` است." msgid "``u`` (:class:`str`) [const wchar_t \\*]" -msgstr "" +msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -msgid "Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is ``NULL``, ``None`` is returned." +msgid "" +"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " +"UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " +"``NULL``, ``None`` is returned." msgstr "" +"یک بافر پایان‌یافته با تهی از نوع :c:type:`wchar_t` حاوی داده‌های یونیکد " +"(UTF-16 یا UCS-4) را به یک شیء یونیکد پایتون تبدیل می‌کند. اگر اشاره‌گر بافر" +" یونیکد ``NULL`` باشد، ``None`` برگردانده می‌شود." msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -msgstr "" +msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -msgid "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python Unicode object. If the Unicode buffer pointer is ``NULL``, the length is ignored and ``None`` is returned." +msgid "" +"Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " +"Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " +"ignored and ``None`` is returned." msgstr "" +"یک بافر داده یونیکد (UTF-16 یا UCS-4) و طول آن را به یک شیء یونیکد پایتون " +"تبدیل می‌کند. اگر اشاره‌گر بافر یونیکد ``NULL`` باشد، طول نادیده گرفته " +"می‌شود و ``None`` برگردانده می‌شود." msgid "``U`` (:class:`str` or ``None``) [const char \\*]" -msgstr "" +msgstr "``U`` (:class:`str` یا ``None``) [const char \\*]" msgid "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" +"``U#`` (:class:`str` یا ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgid "Convert a plain C :c:expr:`int` to a Python integer object." -msgstr "" +msgstr "تبدیل یک :c:expr:`int` ساده‌ی C به یک شیء عدد صحیح پایتون." msgid "``b`` (:class:`int`) [char]" -msgstr "" +msgstr "``b`` (:class:`int`) [char]" msgid "Convert a plain C :c:expr:`char` to a Python integer object." -msgstr "" +msgstr "تبدیل یک :c:expr:`char` ساده‌ی C به یک شیء عدد صحیح پایتون." msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "" +"یک :c:expr:`short int` ساده‌ی C را به یک شیء عدد صحیح پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`long int` to a Python integer object." -msgstr "" +msgstr "تبدیل یک :c:expr:`long int` از زبان C به یک شیء عدد صحیح پایتون." msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "" +"یک :c:expr:`unsigned char` از C را به یک شیء عدد صحیح پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "" +"تبدیل یک :c:expr:`unsigned short int` در زبان C به یک شیء عدد صحیح پایتون." msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." -msgstr "" +msgstr "تبدیل یک :c:expr:`unsigned int` از زبان C به یک شیء عدد صحیح پایتون." msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "" +"یک :c:expr:`unsigned long` در C را به یک شیء عدد صحیح پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "" +"یک :c:expr:`long long` از C را به یک شیء عدد صحیح پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "" +"یک :c:expr:`unsigned long long` در C را به یک شیء عدد صحیح پایتون تبدیل " +"می‌کند." msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." -msgstr "" +msgstr "یک :c:type:`Py_ssize_t` در C را به یک عدد صحیح پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`int` to a Python :class:`bool` object." -msgstr "" +msgstr "تبدیل یک :c:expr:`int` در C به یک شیء :class:`bool` پایتون." -msgid "Be aware that this format requires an ``int`` argument. Unlike most other contexts in C, variadic arguments are not coerced to a suitable type automatically. You can convert another type (for example, a pointer or a float) to a suitable ``int`` value using ``(x) ? 1 : 0`` or ``!!x``." +msgid "" +"Be aware that this format requires an ``int`` argument. Unlike most other " +"contexts in C, variadic arguments are not coerced to a suitable type " +"automatically. You can convert another type (for example, a pointer or a " +"float) to a suitable ``int`` value using ``(x) ? 1 : 0`` or ``!!x``." msgstr "" +"آگاه باشید که این قالب به یک آرگومان ``int`` نیاز دارد. برخلاف بیشتر " +"زمینه‌های دیگر در C، آرگومان‌های متغیر (variadic) به‌طور خودکار به نوعی " +"مناسب تبدیل ضمنی نمی‌شوند. می‌توانید نوع دیگری (مثلاً یک اشاره‌گر یا یک عدد " +"اعشاری) را با استفاده از ``(x) ? 1 : 0`` یا ``!!x`` به مقدار ``int`` مناسب " +"تبدیل کنید." msgid "``c`` (:class:`bytes` of length 1) [char]" -msgstr "" +msgstr "``c`` (:class:`bytes` به طول ۱) [char]" -msgid "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` object of length 1." +msgid "" +"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " +"object of length 1." msgstr "" +"یک :c:expr:`int` از زبان C که نمایانگر یک بایت است را به یک شیء " +":class:`bytes` پایتون به طول ۱ تبدیل می‌کند." -msgid "Convert a C :c:expr:`int` representing a character to Python :class:`str` object of length 1." +msgid "" +"Convert a C :c:expr:`int` representing a character to Python :class:`str` " +"object of length 1." msgstr "" +"یک :c:expr:`int` از C که نشان‌دهنده‌ی یک نویسه است را به شیء :class:`str` " +"پایتون با طول ۱ تبدیل می‌کند." msgid "Convert a C :c:expr:`double` to a Python floating-point number." -msgstr "" +msgstr "یک :c:expr:`double` در C را به یک عدد ممیز شناور پایتون تبدیل می‌کند." msgid "Convert a C :c:expr:`float` to a Python floating-point number." -msgstr "" +msgstr "تبدیل یک :c:expr:`float` در C به یک عدد ممیز شناور پایتون." msgid "``D`` (:class:`complex`) [Py_complex \\*]" -msgstr "" +msgstr "``D`` (:class:`complex`) [Py_complex \\*]" msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." -msgstr "" +msgstr "تبدیل ساختار C :c:type:`Py_complex` به یک عدد مختلط پایتون." -msgid "Pass a Python object untouched but create a new :term:`strong reference` to it (i.e. its reference count is incremented by one). If the object passed in is a ``NULL`` pointer, it is assumed that this was caused because the call producing the argument found an error and set an exception. Therefore, :c:func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If no exception has been raised yet, :exc:`SystemError` is set." -msgstr "" +msgid "" +"Pass a Python object untouched but create a new :term:`strong reference` to " +"it (i.e. its reference count is incremented by one). If the object passed in" +" is a ``NULL`` pointer, it is assumed that this was caused because the call " +"producing the argument found an error and set an exception. Therefore, " +":c:func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. " +"If no exception has been raised yet, :exc:`SystemError` is set." +msgstr "" +"شیء پایتون را بدون تغییر پاس می‌دهد، اما یک :term:`strong reference` جدید به" +" آن ایجاد می‌کند (یعنی شمارش ارجاع آن یک واحد افزایش می‌یابد). اگر شیء " +"پاس‌داده‌شده یک اشاره‌گر ``NULL`` باشد، فرض می‌شود که این اتفاق به این دلیل " +"رخ داده است که فراخوانی‌ای که آرگومان را تولید کرده، خطایی یافته و استثنایی " +"تنظیم کرده است. بنابراین، :c:func:`Py_BuildValue` مقدار ``NULL`` را " +"برمی‌گرداند اما استثنایی طرح نمی‌کند. اگر هنوز استثنایی طرح نشده باشد، " +":exc:`SystemError` تنظیم می‌شود." msgid "``S`` (object) [PyObject \\*]" -msgstr "" +msgstr "``S`` (شیء) [PyObject \\*]" msgid "Same as ``O``." -msgstr "" +msgstr "مانند ``O`` است." msgid "``N`` (object) [PyObject \\*]" -msgstr "" +msgstr "``N`` (شیء) [PyObject \\*]" -msgid "Same as ``O``, except it doesn't create a new :term:`strong reference`. Useful when the object is created by a call to an object constructor in the argument list." +msgid "" +"Same as ``O``, except it doesn't create a new :term:`strong reference`. " +"Useful when the object is created by a call to an object constructor in the " +"argument list." msgstr "" +"مانند ``O`` است، با این تفاوت که :term:`ارجاع قوی ` جدیدی " +"ایجاد نمی‌کند. زمانی مفید است که شیء در فهرست آرگومان‌ها با فراخوانی " +"سازنده‌ی شیء ایجاد شده باشد." msgid "``O&`` (object) [*converter*, *anything*]" -msgstr "" +msgstr "``O&`` (شیء) [*مبدل*، *هر چیزی*]" -msgid "Convert *anything* to a Python object through a *converter* function. The function is called with *anything* (which should be compatible with :c:expr:`void*`) as its argument and should return a \"new\" Python object, or ``NULL`` if an error occurred." +msgid "" +"Convert *anything* to a Python object through a *converter* function. The " +"function is called with *anything* (which should be compatible with " +":c:expr:`void*`) as its argument and should return a \"new\" Python object, " +"or ``NULL`` if an error occurred." msgstr "" +"تبدیل *هرچیز* به یک شیء پایتون از طریق یک تابع *مبدل*. این تابع با *هرچیز* " +"(که باید با :c:expr:`void*` سازگار باشد) به‌عنوان آرگومان خود فراخوانی " +"می‌شود و باید یک شیء پایتون «جدید» برگرداند، یا در صورت وقوع خطا ``NULL``." msgid "``(items)`` (:class:`tuple`) [*matching-items*]" -msgstr "" +msgstr "``(items)`` (:class:`tuple`) [*آیتم‌های مطابق*]" -msgid "Convert a sequence of C values to a Python tuple with the same number of items." +msgid "" +"Convert a sequence of C values to a Python tuple with the same number of " +"items." msgstr "" +"یک دنباله از مقادیر C را به یک تاپل پایتون با همان تعداد آیتم تبدیل می‌کند." msgid "``[items]`` (:class:`list`) [*matching-items*]" -msgstr "" +msgstr "``[items]`` (:class:`list`) [*آیتم‌های مطابق*]" -msgid "Convert a sequence of C values to a Python list with the same number of items." +msgid "" +"Convert a sequence of C values to a Python list with the same number of " +"items." msgstr "" +"دنباله‌ای از مقادیر C را به یک فهرست پایتون با همان تعداد آیتم تبدیل می‌کند." msgid "``{items}`` (:class:`dict`) [*matching-items*]" -msgstr "" +msgstr "``{items}`` (:class:`dict`) [*آیتم‌های متناظر*]" -msgid "Convert a sequence of C values to a Python dictionary. Each pair of consecutive C values adds one item to the dictionary, serving as key and value, respectively." +msgid "" +"Convert a sequence of C values to a Python dictionary. Each pair of " +"consecutive C values adds one item to the dictionary, serving as key and " +"value, respectively." msgstr "" +"یک دنباله از مقادیر C را به یک دیکشنری پایتون تبدیل می‌کند. هر جفت از مقادیر" +" متوالی C یک آیتم به دیکشنری اضافه می‌کند که به ترتیب به عنوان کلید و مقدار " +"عمل می‌کنند." -msgid "If there is an error in the format string, the :exc:`SystemError` exception is set and ``NULL`` returned." +msgid "" +"If there is an error in the format string, the :exc:`SystemError` exception " +"is set and ``NULL`` returned." msgstr "" +"اگر خطایی در رشته قالب‌بندی وجود داشته باشد، استثنای :exc:`SystemError` " +"تنظیم می‌شود و ``NULL`` بازگردانده می‌شود." -msgid "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list rather than a variable number of arguments." +msgid "" +"Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " +"rather than a variable number of arguments." msgstr "" +"یکسان با :c:func:`Py_BuildValue` است، با این تفاوت که به جای تعداد متغیری از" +" آرگومان‌ها، یک va_list می‌پذیرد." diff --git a/c-api/bool.po b/c-api/bool.po index fbd7ca7e7..04ab66dca 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -35,16 +35,16 @@ msgid "Return true if *o* is of type :c:data:`PyBool_Type`. This function alway msgstr "اگر *o* از نوع :c:data:`PyBool_Type` باشد، مقدار True را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." msgid "The Python ``False`` object. This object has no methods and is :term:`immortal`." -msgstr "شیء ``False`` در پایتون. این شیء هیچ متدی ندارد و :term:`immortal` است." +msgstr "شیء ``False`` در پایتون. این شیء هیچ متدی ندارد و :term:`نامیرا ` است." msgid ":c:data:`Py_False` is :term:`immortal`." -msgstr ":c:data:`Py_False` :term:`immortal` است." +msgstr ":c:data:`Py_False` :term:`نامیرا ` است." msgid "The Python ``True`` object. This object has no methods and is :term:`immortal`." -msgstr "شیء ``True`` در پایتون. این شیء هیچ متدی ندارد و :term:`immortal` است." +msgstr "شیء ``True`` در پایتون. این شیء هیچ متدی ندارد و :term:`نامیرا ` است." msgid ":c:data:`Py_True` is :term:`immortal`." -msgstr ":c:data:`Py_True` :term:`immortal` است." +msgstr ":c:data:`Py_True` :term:`نامیرا ` است." msgid "Return :c:data:`Py_False` from a function." msgstr ":c:data:`Py_False` را از یک تابع برگردانید." diff --git a/c-api/buffer.po b/c-api/buffer.po index 2d11569e3..a008c16db 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -25,264 +25,627 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Buffer Protocol" -msgstr "" +msgstr "پروتکل بافر" -msgid "Certain objects available in Python wrap access to an underlying memory array or *buffer*. Such objects include the built-in :class:`bytes` and :class:`bytearray`, and some extension types like :class:`array.array`. Third-party libraries may define their own types for special purposes, such as image processing or numeric analysis." -msgstr "" +msgid "" +"Certain objects available in Python wrap access to an underlying memory " +"array or *buffer*. Such objects include the built-in :class:`bytes` and " +":class:`bytearray`, and some extension types like :class:`array.array`. " +"Third-party libraries may define their own types for special purposes, such " +"as image processing or numeric analysis." +msgstr "" +"برخی از اشیاء موجود در پایتون، دسترسی به یک آرایه حافظه یا *بافر* زیرین را " +"پوشش می‌دهند. چنین اشیایی شامل :class:`bytes` و :class:`bytearray` توکار و " +"برخی نوع‌های توسعه‌ای مانند :class:`array.array` هستند. کتابخانه‌های شخص " +"ثالث ممکن است برای مقاصد خاص، مانند پردازش تصویر یا تحلیل عددی، نوع‌های خود " +"را تعریف کنند." -msgid "While each of these types have their own semantics, they share the common characteristic of being backed by a possibly large memory buffer. It is then desirable, in some situations, to access that buffer directly and without intermediate copying." +msgid "" +"While each of these types have their own semantics, they share the common " +"characteristic of being backed by a possibly large memory buffer. It is " +"then desirable, in some situations, to access that buffer directly and " +"without intermediate copying." msgstr "" +"هرچند هر یک از این نوع‌ها معناشناسی خاص خود را دارند، اما ویژگی مشترک آن‌ها " +"این است که مبتنی بر یک بافر حافظه — که ممکن است بزرگ باشد — هستند. از این " +"رو، در برخی موارد مطلوب است که به آن بافر مستقیماً و بدون کپی‌کردن میانی " +"دسترسی داشته باشید." -msgid "Python provides such a facility at the C and Python level in the form of the :ref:`buffer protocol `. This protocol has two sides:" +msgid "" +"Python provides such a facility at the C and Python level in the form of the" +" :ref:`buffer protocol `. This protocol has two sides:" msgstr "" +"پایتون چنین امکانی را در سطح C و پایتون به شکل :ref:`پروتکل بافر " +"` فراهم می‌کند. این پروتکل دو سمت دارد:" -msgid "on the producer side, a type can export a \"buffer interface\" which allows objects of that type to expose information about their underlying buffer. This interface is described in the section :ref:`buffer-structs`; for Python see :ref:`python-buffer-protocol`." +msgid "" +"on the producer side, a type can export a \"buffer interface\" which allows " +"objects of that type to expose information about their underlying buffer. " +"This interface is described in the section :ref:`buffer-structs`; for Python" +" see :ref:`python-buffer-protocol`." msgstr "" +"در سمت تولید‌کننده، یک نوع می‌تواند «رابط بافر» را ارائه کند که به اشیاء آن " +"نوع اجازه می‌دهد تا اطلاعاتی درباره‌ی بافر زیرین خود را آشکار کنند. این رابط" +" در بخش :ref:`buffer-structs` شرح داده شده است؛ برای پایتون به :ref:`python-" +"buffer-protocol` مراجعه کنید." -msgid "on the consumer side, several means are available to obtain a pointer to the raw underlying data of an object (for example a method parameter). For Python see :class:`memoryview`." +msgid "" +"on the consumer side, several means are available to obtain a pointer to the" +" raw underlying data of an object (for example a method parameter). For " +"Python see :class:`memoryview`." msgstr "" +"در سمت مصرف‌کننده، چندین روش برای به دست آوردن اشاره‌گر به داده‌های خام " +"زیربنایی یک شیء (برای مثال، یک پارامتر متد) در دسترس است. برای پایتون به " +":class:`memoryview` مراجعه کنید." -msgid "Simple objects such as :class:`bytes` and :class:`bytearray` expose their underlying buffer in byte-oriented form. Other forms are possible; for example, the elements exposed by an :class:`array.array` can be multi-byte values." +msgid "" +"Simple objects such as :class:`bytes` and :class:`bytearray` expose their " +"underlying buffer in byte-oriented form. Other forms are possible; for " +"example, the elements exposed by an :class:`array.array` can be multi-byte " +"values." msgstr "" +"اشیاء ساده‌ای مانند :class:`bytes` و :class:`bytearray` بافر زیرین خود را به" +" شکل بایت‌محور در دسترس قرار می‌دهند. شکل‌های دیگری نیز ممکن است؛ برای مثال،" +" عناصری که یک :class:`array.array` در دسترس قرار می‌دهد می‌توانند مقادیر " +"چندبایتی باشند." -msgid "An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase.write` method of file objects: any object that can export a series of bytes through the buffer interface can be written to a file. While :meth:`!write` only needs read-only access to the internal contents of the object passed to it, other methods such as :meth:`~io.BufferedIOBase.readinto` need write access to the contents of their argument. The buffer interface allows objects to selectively allow or reject exporting of read-write and read-only buffers." -msgstr "" +msgid "" +"An example consumer of the buffer interface is the " +":meth:`~io.BufferedIOBase.write` method of file objects: any object that can" +" export a series of bytes through the buffer interface can be written to a " +"file. While :meth:`!write` only needs read-only access to the internal " +"contents of the object passed to it, other methods such as " +":meth:`~io.BufferedIOBase.readinto` need write access to the contents of " +"their argument. The buffer interface allows objects to selectively allow or" +" reject exporting of read-write and read-only buffers." +msgstr "" +"نمونه‌ای از مصرف‌کنندگان رابط بافر، متد :meth:`~io.BufferedIOBase.write` در " +"شیءهای پرونده است: هر شیئی که بتواند دنباله‌ای از بایت‌ها را از طریق رابط " +"بافر صادر کند، می‌تواند در پرونده‌ای نوشته شود. در حالی که :meth:`!write` " +"تنها به دسترسی فقط‌خواندنی به محتوای درونی شیئی که به آن پاس داده شده نیاز " +"دارد، متدهای دیگری مانند :meth:`~io.BufferedIOBase.readinto` به دسترسی نوشتن" +" به محتوای آرگومان خود نیاز دارند. رابط بافر به شیءها اجازه می‌دهد تا صادر " +"کردن بافرهای خواندنی-نوشتنی و فقط‌خواندنی را به‌صورت انتخابی بپذیرند یا رد " +"کنند." -msgid "There are two ways for a consumer of the buffer interface to acquire a buffer over a target object:" +msgid "" +"There are two ways for a consumer of the buffer interface to acquire a " +"buffer over a target object:" msgstr "" +"دو راه وجود دارد که مصرف‌کننده‌ی رابط بافر بتواند بافری را روی یک شیء هدف به" +" دست آورد:" msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" -msgstr "" +msgstr ":c:func:`PyObject_GetBuffer` را با پارامترهای درست فراخوانی کنید؛" -msgid "call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the ``y*``, ``w*`` or ``s*`` :ref:`format codes `." +msgid "" +"call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the " +"``y*``, ``w*`` or ``s*`` :ref:`format codes `." msgstr "" +"تابع :c:func:`PyArg_ParseTuple` (یا یکی از توابع هم‌خانواده‌ی آن) را با یکی " +"از :ref:`کدهای قالب ` ``y*``، ``w*`` یا ``s*`` فراخوانی کنید." -msgid "In both cases, :c:func:`PyBuffer_Release` must be called when the buffer isn't needed anymore. Failure to do so could lead to various issues such as resource leaks." +msgid "" +"In both cases, :c:func:`PyBuffer_Release` must be called when the buffer " +"isn't needed anymore. Failure to do so could lead to various issues such as" +" resource leaks." msgstr "" +"در هر دو مورد، :c:func:`PyBuffer_Release` باید زمانی که دیگر به بافر نیازی " +"نیست فراخوانی شود. عدم انجام این کار می‌تواند به مشکلات مختلفی مانند نشت " +"منابع منجر شود." -msgid "The buffer protocol is now accessible in Python, see :ref:`python-buffer-protocol` and :class:`memoryview`." +msgid "" +"The buffer protocol is now accessible in Python, see :ref:`python-buffer-" +"protocol` and :class:`memoryview`." msgstr "" +"پروتکل بافر اکنون در پایتون دسترسی‌پذیر است؛ به :ref:`python-buffer-" +"protocol` و :class:`memoryview` مراجعه کنید." msgid "Buffer structure" -msgstr "" +msgstr "ساختار بافر" -msgid "Buffer structures (or simply \"buffers\") are useful as a way to expose the binary data from another object to the Python programmer. They can also be used as a zero-copy slicing mechanism. Using their ability to reference a block of memory, it is possible to expose any data to the Python programmer quite easily. The memory could be a large, constant array in a C extension, it could be a raw block of memory for manipulation before passing to an operating system library, or it could be used to pass around structured data in its native, in-memory format." -msgstr "" +msgid "" +"Buffer structures (or simply \"buffers\") are useful as a way to expose the " +"binary data from another object to the Python programmer. They can also be " +"used as a zero-copy slicing mechanism. Using their ability to reference a " +"block of memory, it is possible to expose any data to the Python programmer " +"quite easily. The memory could be a large, constant array in a C extension," +" it could be a raw block of memory for manipulation before passing to an " +"operating system library, or it could be used to pass around structured data" +" in its native, in-memory format." +msgstr "" +"ساختارهای بافر (یا به‌سادگی «بافرها») به‌عنوان راهی برای افشای داده‌های " +"دودویی از یک شیء دیگر به برنامه‌نویس پایتون مفید هستند. همچنین می‌توان از " +"آن‌ها به‌عنوان سازوکاری برای اسلایس‌کردن بدون کپی استفاده کرد. با استفاده از" +" توانایی آن‌ها در ارجاع به یک بلوک حافظه، می‌توان هر داده‌ای را به‌سادگی به " +"برنامه‌نویس پایتون افشا کرد. این حافظه می‌تواند یک آرایه‌ی بزرگ و ثابت در یک" +" توسعه C باشد، می‌تواند یک بلوک خام حافظه برای دستکاری پیش از انتقال به یک " +"کتابخانه‌ی سیستم‌عامل باشد، یا می‌تواند برای به‌گردش درآوردن داده‌های " +"ساختاریافته در قالب بومی و درون‌حافظه‌ای خود استفاده شود." -msgid "Contrary to most data types exposed by the Python interpreter, buffers are not :c:type:`PyObject` pointers but rather simple C structures. This allows them to be created and copied very simply. When a generic wrapper around a buffer is needed, a :ref:`memoryview ` object can be created." -msgstr "" +msgid "" +"Contrary to most data types exposed by the Python interpreter, buffers are " +"not :c:type:`PyObject` pointers but rather simple C structures. This allows" +" them to be created and copied very simply. When a generic wrapper around a" +" buffer is needed, a :ref:`memoryview ` object can be " +"created." +msgstr "" +"برخلاف بیشتر نوع‌های داده‌ای که مفسر پایتون ارائه می‌کند، بافرها اشاره‌گرهای" +" :c:type:`PyObject` نیستند، بلکه ساختارهای ساده‌ی C هستند. این امر امکان " +"می‌دهد که آن‌ها به‌سادگی ساخته و کپی شوند. وقتی به یک دربرگیرنده‌ی عام برای" +" بافر نیاز باشد، می‌توان یک شیء :ref:`memoryview ` ایجاد" +" کرد." -msgid "For short instructions how to write an exporting object, see :ref:`Buffer Object Structures `. For obtaining a buffer, see :c:func:`PyObject_GetBuffer`." +msgid "" +"For short instructions how to write an exporting object, see :ref:`Buffer " +"Object Structures `. For obtaining a buffer, see " +":c:func:`PyObject_GetBuffer`." msgstr "" +"برای دستورالعمل‌های کوتاه درباره‌ی نحوه‌ی نوشتن یک شیء صادرکننده (exporting " +"object)، به :ref:`ساختارهای شیء بافر ` مراجعه کنید. برای به " +"دست آوردن یک بافر، به :c:func:`PyObject_GetBuffer` مراجعه کنید." -msgid "A pointer to the start of the logical structure described by the buffer fields. This can be any location within the underlying physical memory block of the exporter. For example, with negative :c:member:`~Py_buffer.strides` the value may point to the end of the memory block." +msgid "" +"A pointer to the start of the logical structure described by the buffer " +"fields. This can be any location within the underlying physical memory block" +" of the exporter. For example, with negative :c:member:`~Py_buffer.strides` " +"the value may point to the end of the memory block." msgstr "" +"اشاره‌گری به ابتدای ساختار منطقی‌ای که توسط فیلدهای بافر توصیف می‌شود. این " +"می‌تواند هر مکانی درون بلوک حافظه فیزیکی زیرین صادرکننده باشد. برای مثال، با" +" :c:member:`~Py_buffer.strides` منفی، مقدار ممکن است به انتهای بلوک حافظه " +"اشاره کند." -msgid "For :term:`contiguous` arrays, the value points to the beginning of the memory block." +msgid "" +"For :term:`contiguous` arrays, the value points to the beginning of the " +"memory block." msgstr "" +"برای آرایه‌های :term:`پیوسته `، مقدار به ابتدای بلوک حافظه اشاره" +" می‌کند." -msgid "A new reference to the exporting object. The reference is owned by the consumer and automatically released (i.e. reference count decremented) and set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent of the return value of any standard C-API function." +msgid "" +"A new reference to the exporting object. The reference is owned by the " +"consumer and automatically released (i.e. reference count decremented) and " +"set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent " +"of the return value of any standard C-API function." msgstr "" +"ارجاعی جدید به شیء صادرکننده. این ارجاع در مالکیت مصرف‌کننده است و به‌طور " +"خودکار توسط :c:func:`PyBuffer_Release` آزاد می‌شود (یعنی شمارش ارجاع کاهش " +"می‌یابد) و به ``NULL`` تنظیم می‌شود. این فیلد معادل مقدار بازگشتی هر تابع " +"استاندارد C-API است." -msgid "As a special case, for *temporary* buffers that are wrapped by :c:func:`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is ``NULL``. In general, exporting objects MUST NOT use this scheme." +msgid "" +"As a special case, for *temporary* buffers that are wrapped by " +":c:func:`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field " +"is ``NULL``. In general, exporting objects MUST NOT use this scheme." msgstr "" +"به‌عنوان یک مورد خاص، برای بافرهای *موقتی* که توسط " +":c:func:`PyMemoryView_FromBuffer` یا :c:func:`PyBuffer_FillInfo` پوشش داده " +"می‌شوند، این فیلد ``NULL`` است. به‌طور کلی، اشیاء صادرکننده به هیچ وجه نباید" +" از این طرح استفاده کنند." -msgid "``product(shape) * itemsize``. For contiguous arrays, this is the length of the underlying memory block. For non-contiguous arrays, it is the length that the logical structure would have if it were copied to a contiguous representation." +msgid "" +"``product(shape) * itemsize``. For contiguous arrays, this is the length of " +"the underlying memory block. For non-contiguous arrays, it is the length " +"that the logical structure would have if it were copied to a contiguous " +"representation." msgstr "" +"``product(shape) * itemsize``. برای آرایه‌های پیوسته، این مقدار طول بلوک " +"حافظه‌ی زیرین است. برای آرایه‌های ناپیوسته، این مقدار طولی است که ساختار " +"منطقی در صورت کپی شدن به یک نمایش پیوسته خواهد داشت." -msgid "Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if the buffer has been obtained by a request that guarantees contiguity. In most cases such a request will be :c:macro:`PyBUF_SIMPLE` or :c:macro:`PyBUF_WRITABLE`." +msgid "" +"Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if " +"the buffer has been obtained by a request that guarantees contiguity. In " +"most cases such a request will be :c:macro:`PyBUF_SIMPLE` or " +":c:macro:`PyBUF_WRITABLE`." msgstr "" +"دسترسی به ``((char *)buf)[0] up to ((char *)buf)[len-1]`` تنها زمانی معتبر " +"است که بافر از طریق درخواستی که پیوستگی را تضمین می‌کند به دست آمده باشد. در" +" بیشتر موارد، چنین درخواستی :c:macro:`PyBUF_SIMPLE` یا " +":c:macro:`PyBUF_WRITABLE` خواهد بود." -msgid "An indicator of whether the buffer is read-only. This field is controlled by the :c:macro:`PyBUF_WRITABLE` flag." +msgid "" +"An indicator of whether the buffer is read-only. This field is controlled by" +" the :c:macro:`PyBUF_WRITABLE` flag." msgstr "" +"نشانگری که مشخص می‌کند بافر فقط‌خواندنی است یا خیر. این فیلد توسط پرچم " +":c:macro:`PyBUF_WRITABLE` کنترل می‌شود." -msgid "Item size in bytes of a single element. Same as the value of :func:`struct.calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." +msgid "" +"Item size in bytes of a single element. Same as the value of " +":func:`struct.calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format`" +" values." msgstr "" +"اندازه‌ی آیتم به بایت برای یک عنصر منفرد. همانند مقدار " +":func:`struct.calcsize` است که روی مقادیر غیر ``NULL`` " +":c:member:`~Py_buffer.format` فراخوانی می‌شود." -msgid "Important exception: If a consumer requests a buffer without the :c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to ``NULL``, but :c:member:`~Py_buffer.itemsize` still has the value for the original format." +msgid "" +"Important exception: If a consumer requests a buffer without the " +":c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to " +"``NULL``, but :c:member:`~Py_buffer.itemsize` still has the value for the " +"original format." msgstr "" +"استثنای مهم: اگر مصرف‌کننده‌ای بافر را بدون پرچم :c:macro:`PyBUF_FORMAT` " +"درخواست کند، :c:member:`~Py_buffer.format` برابر ``NULL`` قرار می‌گیرد، اما " +":c:member:`~Py_buffer.itemsize` همچنان مقدار مربوط به قالب اصلی را دارد." -msgid "If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer.itemsize` to navigate the buffer." +msgid "" +"If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " +"itemsize == len`` still holds and the consumer can use " +":c:member:`~Py_buffer.itemsize` to navigate the buffer." msgstr "" +"اگر :c:member:`~Py_buffer.shape` موجود باشد، برابری ``product(shape) * " +"itemsize == len`` همچنان برقرار است و مصرف‌کننده می‌تواند از " +":c:member:`~Py_buffer.itemsize` برای پیمایش بافر استفاده کند." -msgid "If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." +msgid "" +"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a " +":c:macro:`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer" +" must disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == " +"1``." msgstr "" +"اگر :c:member:`~Py_buffer.shape` در نتیجه‌ی درخواست :c:macro:`PyBUF_SIMPLE` " +"یا :c:macro:`PyBUF_WRITABLE` برابر ``NULL`` باشد، مصرف‌کننده باید " +":c:member:`~Py_buffer.itemsize` را نادیده بگیرد و فرض کند که ``itemsize == " +"1`` است." -msgid "A *NULL* terminated string in :mod:`struct` module style syntax describing the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned bytes) is assumed." +msgid "" +"A *NULL* terminated string in :mod:`struct` module style syntax describing " +"the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " +"bytes) is assumed." msgstr "" +"رشته‌ای خاتمه‌یافته با *NULL* به سبک سینتکس ماژول :mod:`struct` که محتویات " +"یک آیتم منفرد را توصیف می‌کند. اگر این ``NULL`` باشد، ``\"B\"`` (بایت‌های " +"بدون علامت) فرض می‌شود." msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." -msgstr "" +msgstr "این فیلد توسط پرچم :c:macro:`PyBUF_FORMAT` کنترل می‌شود." -msgid "The number of dimensions the memory represents as an n-dimensional array. If it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``. The maximum number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`." -msgstr "" +msgid "" +"The number of dimensions the memory represents as an n-dimensional array. If" +" it is ``0``, :c:member:`~Py_buffer.buf` points to a single item " +"representing a scalar. In this case, :c:member:`~Py_buffer.shape`, " +":c:member:`~Py_buffer.strides` and :c:member:`~Py_buffer.suboffsets` MUST be" +" ``NULL``. The maximum number of dimensions is given by " +":c:macro:`PyBUF_MAX_NDIM`." +msgstr "" +"تعداد ابعادی که حافظه به‌صورت یک آرایه‌ی n-بعدی بازنمایی می‌کند. اگر ``0`` " +"باشد، :c:member:`~Py_buffer.buf` به یک آیتم واحد اشاره می‌کند که نمایانگر یک" +" اسکالر است. در این حالت، :c:member:`~Py_buffer.shape`، " +":c:member:`~Py_buffer.strides` و :c:member:`~Py_buffer.suboffsets` باید " +"``NULL`` باشند. حداکثر تعداد ابعاد توسط :c:macro:`PyBUF_MAX_NDIM` تعیین " +"می‌شود." -msgid "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` indicating the shape of the memory as an n-dimensional array. Note that ``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to :c:member:`~Py_buffer.len`." +msgid "" +"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " +"indicating the shape of the memory as an n-dimensional array. Note that " +"``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to " +":c:member:`~Py_buffer.len`." msgstr "" +"آرایه‌ای از :c:type:`Py_ssize_t` به طول :c:member:`~Py_buffer.ndim` که شکل " +"حافظه را به‌عنوان یک آرایه‌ی n-بعدی نشان می‌دهد. توجه داشته باشید که " +"``shape[0] * ... * shape[ndim-1] * itemsize`` حتماً باید با " +":c:member:`~Py_buffer.len` برابر باشد." -msgid "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` requires special attention. See `complex arrays`_ for further information." +msgid "" +"Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0``" +" requires special attention. See `complex arrays`_ for further information." msgstr "" +"مقادیر شکل به ``shape[n] >= 0`` محدود هستند. مورد ``shape[n] == 0`` نیاز به " +"توجه ویژه دارد. برای اطلاعات بیشتر به `complex arrays`_ مراجعه کنید." msgid "The shape array is read-only for the consumer." -msgstr "" +msgstr "آرایه‌ی شکل برای مصرف‌کننده فقط‌خواندنی است." -msgid "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` giving the number of bytes to skip to get to a new element in each dimension." +msgid "" +"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " +"giving the number of bytes to skip to get to a new element in each " +"dimension." msgstr "" +"آرایه‌ای از :c:type:`Py_ssize_t` به طول :c:member:`~Py_buffer.ndim` که مشخص " +"می‌کند برای رسیدن به عنصر جدید در هر بُعد باید چند بایت را رد کرد." -msgid "Stride values can be any integer. For regular arrays, strides are usually positive, but a consumer MUST be able to handle the case ``strides[n] <= 0``. See `complex arrays`_ for further information." +msgid "" +"Stride values can be any integer. For regular arrays, strides are usually " +"positive, but a consumer MUST be able to handle the case ``strides[n] <= " +"0``. See `complex arrays`_ for further information." msgstr "" +"مقادیر گام (stride) می‌توانند هر عدد صحیحی باشند. برای آرایه‌های معمولی، " +"گام‌ها معمولاً مثبت هستند، اما مصرف‌کننده باید حتماً بتواند مورد " +"``strides[n] <= 0`` را مدیریت کند. برای اطلاعات بیشتر به `complex arrays`_ " +"مراجعه کنید." msgid "The strides array is read-only for the consumer." -msgstr "" +msgstr "آرایه‌ی strides برای مصرف‌کننده فقط‌خواندنی است." -msgid "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If ``suboffsets[n] >= 0``, the values stored along the nth dimension are pointers and the suboffset value dictates how many bytes to add to each pointer after de-referencing. A suboffset value that is negative indicates that no de-referencing should occur (striding in a contiguous memory block)." -msgstr "" +msgid "" +"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If " +"``suboffsets[n] >= 0``, the values stored along the nth dimension are " +"pointers and the suboffset value dictates how many bytes to add to each " +"pointer after de-referencing. A suboffset value that is negative indicates " +"that no de-referencing should occur (striding in a contiguous memory block)." +msgstr "" +"آرایه‌ای از :c:type:`Py_ssize_t` به طول :c:member:`~Py_buffer.ndim`. اگر " +"``suboffsets[n] >= 0`` باشد، مقادیر ذخیره‌شده در راستای بعد n-اُم اشاره‌گر " +"هستند و مقدار زیرآفست تعیین می‌کند که پس از ارجاع‌زدایی (de-referencing)، " +"چند بایت باید به هر اشاره‌گر افزوده شود. مقدار منفیِ زیرآفست نشان می‌دهد که " +"نباید ارجاع‌زدایی انجام شود (گام‌برداری (striding) در یک بلوک حافظه‌ی " +"پیوسته)." -msgid "If all suboffsets are negative (i.e. no de-referencing is needed), then this field must be ``NULL`` (the default value)." +msgid "" +"If all suboffsets are negative (i.e. no de-referencing is needed), then this" +" field must be ``NULL`` (the default value)." msgstr "" +"اگر همه‌ی suboffsets منفی باشند (یعنی نیازی به ارجاع‌زدایی نیست)، آن‌گاه این" +" فیلد باید ``NULL`` باشد (مقدار پیش‌فرض)." -msgid "This type of array representation is used by the Python Imaging Library (PIL). See `complex arrays`_ for further information how to access elements of such an array." +msgid "" +"This type of array representation is used by the Python Imaging Library " +"(PIL). See `complex arrays`_ for further information how to access elements " +"of such an array." msgstr "" +"این نوع نمایش آرایه توسط Python Imaging Library (PIL) استفاده می‌شود. برای " +"اطلاعات بیشتر درباره‌ی نحوه‌ی دسترسی به عناصر چنین آرایه‌ای، به `complex " +"arrays`_ مراجعه کنید." msgid "The suboffsets array is read-only for the consumer." -msgstr "" +msgstr "آرایه‌ی suboffsets برای مصرف‌کننده فقط‌خواندنی است." -msgid "This is for use internally by the exporting object. For example, this might be re-cast as an integer by the exporter and used to store flags about whether or not the shape, strides, and suboffsets arrays must be freed when the buffer is released. The consumer MUST NOT alter this value." +msgid "" +"This is for use internally by the exporting object. For example, this might " +"be re-cast as an integer by the exporter and used to store flags about " +"whether or not the shape, strides, and suboffsets arrays must be freed when " +"the buffer is released. The consumer MUST NOT alter this value." msgstr "" +"این مورد برای استفاده داخلی توسط شیء صادرکننده است. برای مثال، صادرکننده " +"ممکن است آن را به یک عدد صحیح قالب‌ریزی مجدد کند و از آن برای ذخیره " +"پرچم‌هایی استفاده کند که مشخص می‌کنند آرایه‌های shape، strides و suboffsets " +"هنگام رها شدن بافر باید آزاد شوند یا خیر. مصرف‌کننده به هیچ وجه نباید این " +"مقدار را تغییر دهد." msgid "Constants:" -msgstr "" +msgstr "ثابت‌ها:" -msgid "The maximum number of dimensions the memory represents. Exporters MUST respect this limit, consumers of multi-dimensional buffers SHOULD be able to handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." +msgid "" +"The maximum number of dimensions the memory represents. Exporters MUST " +"respect this limit, consumers of multi-dimensional buffers SHOULD be able to" +" handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." msgstr "" +"حداکثر تعداد ابعادی که حافظه بازنمایی می‌کند. صادرکنندگان باید (MUST) این " +"محدودیت را رعایت کنند و بهتر است (SHOULD) مصرف‌کنندگان بافرهای چندبعدی " +"بتوانند تا :c:macro:`!PyBUF_MAX_NDIM` بعد را مدیریت کنند. در حال حاضر روی ۶۴" +" تنظیم شده است." msgid "Buffer request types" -msgstr "" +msgstr "انواع درخواست بافر" -msgid "Buffers are usually obtained by sending a buffer request to an exporting object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical structure of the memory can vary drastically, the consumer uses the *flags* argument to specify the exact buffer type it can handle." +msgid "" +"Buffers are usually obtained by sending a buffer request to an exporting " +"object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical" +" structure of the memory can vary drastically, the consumer uses the *flags*" +" argument to specify the exact buffer type it can handle." msgstr "" +"بافرها معمولاً با ارسال درخواست بافر به یک شیء صادرکننده از طریق " +":c:func:`PyObject_GetBuffer` به دست می‌آیند. از آنجا که پیچیدگی ساختار منطقی" +" حافظه می‌تواند به‌شدت متفاوت باشد، مصرف‌کننده از آرگومان *پرچم‌ها* برای " +"تعیین نوع دقیق بافری که می‌تواند آن را مدیریت کند استفاده می‌کند." -msgid "All :c:type:`Py_buffer` fields are unambiguously defined by the request type." +msgid "" +"All :c:type:`Py_buffer` fields are unambiguously defined by the request " +"type." msgstr "" +"همه‌ی فیلدهای :c:type:`Py_buffer` به‌طور بی‌ابهام توسط نوع درخواست تعریف " +"می‌شوند." msgid "request-independent fields" -msgstr "" +msgstr "فیلدهای مستقل از درخواست" -msgid "The following fields are not influenced by *flags* and must always be filled in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:`~Py_buffer.buf`, :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`." +msgid "" +"The following fields are not influenced by *flags* and must always be filled" +" in with the correct values: :c:member:`~Py_buffer.obj`, " +":c:member:`~Py_buffer.buf`, :c:member:`~Py_buffer.len`, " +":c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`." msgstr "" +"فیلد‌های زیر تحت تأثیر *پرچم‌ها* قرار نمی‌گیرند و همیشه باید با مقادیر صحیح " +"پر شوند: :c:member:`~Py_buffer.obj`، :c:member:`~Py_buffer.buf`، " +":c:member:`~Py_buffer.len`، :c:member:`~Py_buffer.itemsize`، " +":c:member:`~Py_buffer.ndim`." msgid "readonly, format" -msgstr "" +msgstr "فقط‌خواندنی، قالب" -msgid "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter MUST provide a writable buffer or else report failure. Otherwise, the exporter MAY provide either a read-only or writable buffer, but the choice MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | PyBUF_WRITABLE` can be used to request a simple writable buffer." -msgstr "" +msgid "" +"Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " +"MUST provide a writable buffer or else report failure. Otherwise, the " +"exporter MAY provide either a read-only or writable buffer, but the choice " +"MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | " +"PyBUF_WRITABLE` can be used to request a simple writable buffer." +msgstr "" +"فیلد :c:member:`~Py_buffer.readonly` را کنترل می‌کند. اگر تنظیم شده باشد، " +"صادرکننده باید یا بافر نوشتنی فراهم کند یا شکست را گزارش دهد. در غیر این " +"صورت، صادرکننده می‌تواند بافر فقط‌خواندنی یا نوشتنی فراهم کند، اما این " +"انتخاب باید برای همه‌ی مصرف‌کنندگان یکسان باشد. برای مثال، می‌توان از " +":c:expr:`PyBUF_SIMPLE | PyBUF_WRITABLE` برای درخواست یک بافر نوشتنی ساده " +"استفاده کرد." msgid "This is an alias to :c:macro:`PyBUF_WRITABLE`." -msgstr "" +msgstr "این یک نام مستعار برای :c:macro:`PyBUF_WRITABLE` است." -msgid "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be filled in correctly. Otherwise, this field MUST be ``NULL``." +msgid "" +"Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be" +" filled in correctly. Otherwise, this field MUST be ``NULL``." msgstr "" +"فیلد :c:member:`~Py_buffer.format` را کنترل می‌کند. اگر تنظیم شده باشد، این" +" فیلد باید به‌درستی پر شود. در غیر این صورت، این فیلد باید ``NULL`` باشد." -msgid ":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:`PyBUF_WRITABLE` can be used as a stand-alone flag to request a simple writable buffer." +msgid "" +":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next " +"section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, " +":c:macro:`PyBUF_WRITABLE` can be used as a stand-alone flag to request a " +"simple writable buffer." msgstr "" +"می‌توان :c:macro:`PyBUF_WRITABLE` را با هر یک از پرچم‌های بخش بعدی از طریق " +"عملگر \\| ترکیب کرد. از آنجا که :c:macro:`PyBUF_SIMPLE` به صورت 0 تعریف شده " +"است، می‌توان از :c:macro:`PyBUF_WRITABLE` به عنوان یک پرچم مستقل برای " +"درخواست یک بافر ساده‌ی نوشتنی استفاده کرد." -msgid ":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." +msgid "" +":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except " +":c:macro:`PyBUF_SIMPLE`, because the latter already implies format ``B`` " +"(unsigned bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." msgstr "" +":c:macro:`PyBUF_FORMAT` باید با عملگر \\| به هر یک از پرچم‌ها به‌جز " +":c:macro:`PyBUF_SIMPLE` اضافه شود، زیرا مورد دوم از قبل قالب ``B`` (بایت‌های" +" بدون علامت) را در بر می‌گیرد. :c:macro:`!PyBUF_FORMAT` را نمی‌توان " +"به‌تنهایی استفاده کرد." msgid "shape, strides, suboffsets" -msgstr "" +msgstr "شکل، گام‌ها (strides)، زیرآفست‌ها (suboffsets)" -msgid "The flags that control the logical structure of the memory are listed in decreasing order of complexity. Note that each flag contains all bits of the flags below it." +msgid "" +"The flags that control the logical structure of the memory are listed in " +"decreasing order of complexity. Note that each flag contains all bits of the" +" flags below it." msgstr "" +"پرچم‌هایی که ساختار منطقی حافظه را کنترل می‌کنند، به ترتیب نزولی پیچیدگی " +"فهرست شده‌اند. توجه داشته باشید که هر پرچم، تمام بیت‌های پرچم‌های پایین‌تر " +"از آن را در بر می‌گیرد." msgid "Request" -msgstr "" +msgstr "درخواست" msgid "shape" -msgstr "" +msgstr "شکل" msgid "strides" -msgstr "" +msgstr "گام‌ها (strides)" msgid "suboffsets" -msgstr "" +msgstr "suboffsets" msgid "yes" -msgstr "" +msgstr "بله" msgid "if needed" -msgstr "" +msgstr "در صورت نیاز" msgid "NULL" -msgstr "" +msgstr "NULL" msgid "contiguity requests" -msgstr "" +msgstr "درخواست‌های پیوستگی" -msgid "C or Fortran :term:`contiguity ` can be explicitly requested, with and without stride information. Without stride information, the buffer must be C-contiguous." +msgid "" +"C or Fortran :term:`contiguity ` can be explicitly requested, " +"with and without stride information. Without stride information, the buffer " +"must be C-contiguous." msgstr "" +"می‌توان :term:`پیوستگی ` به سبک C یا Fortran را به‌طور صریح " +"درخواست کرد، هم به همراه اطلاعات گام (stride) و هم بدون آن. بدون اطلاعات " +"گام، بافر باید پیوسته به سبک C (C-contiguous) باشد." msgid "contig" -msgstr "" +msgstr "پیوسته" msgid "C" -msgstr "" +msgstr "C" msgid "F" -msgstr "" +msgstr "F" msgid "C or F" -msgstr "" +msgstr "C یا F" msgid ":c:macro:`PyBUF_ND`" -msgstr "" +msgstr ":c:macro:`PyBUF_ND`" msgid "compound requests" -msgstr "" +msgstr "درخواست‌های ترکیبی" -msgid "All possible requests are fully defined by some combination of the flags in the previous section. For convenience, the buffer protocol provides frequently used combinations as single flags." +msgid "" +"All possible requests are fully defined by some combination of the flags in " +"the previous section. For convenience, the buffer protocol provides " +"frequently used combinations as single flags." msgstr "" +"تمامی درخواست‌های ممکن به‌طور کامل با ترکیبی از پرچم‌های بخش قبلی تعریف " +"می‌شوند. برای راحتی، پروتکل بافر ترکیب‌های پرکاربرد را به‌صورت پرچم‌های تکی " +"فراهم می‌کند." -msgid "In the following table *U* stands for undefined contiguity. The consumer would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." +msgid "" +"In the following table *U* stands for undefined contiguity. The consumer " +"would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" +"در جدول زیر *U* نمایانگر پیوستگی تعریف‌نشده است. مصرف‌کننده برای تعیین " +"پیوستگی باید :c:func:`PyBuffer_IsContiguous` را فراخوانی کند." msgid "readonly" -msgstr "" +msgstr "فقط‌خواندنی" msgid "format" -msgstr "" +msgstr "قالب" msgid "U" -msgstr "" +msgstr "U" msgid "0" -msgstr "" +msgstr "0" msgid "1 or 0" -msgstr "" +msgstr "۱ یا ۰" msgid "Complex arrays" -msgstr "" +msgstr "آرایه‌های مختلط" msgid "NumPy-style: shape and strides" -msgstr "" +msgstr "به سبک NumPy: شکل و گام‌ها (strides)" -msgid "The logical structure of NumPy-style arrays is defined by :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides`." +msgid "" +"The logical structure of NumPy-style arrays is defined by " +":c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, " +":c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides`." msgstr "" +"ساختار منطقی آرایه‌های به سبک NumPy توسط :c:member:`~Py_buffer.itemsize`، " +":c:member:`~Py_buffer.ndim`، :c:member:`~Py_buffer.shape` و " +":c:member:`~Py_buffer.strides` تعریف می‌شود." -msgid "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer.buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In that case, both :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides` are ``NULL``." +msgid "" +"If ``ndim == 0``, the memory location pointed to by " +":c:member:`~Py_buffer.buf` is interpreted as a scalar of size " +":c:member:`~Py_buffer.itemsize`. In that case, both " +":c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides` are " +"``NULL``." msgstr "" +"اگر ``ndim == 0`` باشد، مکان حافظه‌ای که :c:member:`~Py_buffer.buf` به آن " +"اشاره می‌کند، به‌عنوان یک اسکالر با اندازه‌ی :c:member:`~Py_buffer.itemsize`" +" تفسیر می‌شود. در این حالت، هر دو :c:member:`~Py_buffer.shape` و " +":c:member:`~Py_buffer.strides` برابر ``NULL`` هستند." -msgid "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a standard n-dimensional C-array. Otherwise, the consumer must access an n-dimensional array as follows:" +msgid "" +"If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a" +" standard n-dimensional C-array. Otherwise, the consumer must access an " +"n-dimensional array as follows:" msgstr "" +"اگر :c:member:`~Py_buffer.strides` برابر ``NULL`` باشد، آرایه به‌عنوان یک " +"آرایه‌ی C استاندارد n-بعدی تفسیر می‌شود. در غیر این صورت، مصرف‌کننده باید به" +" یک آرایه‌ی n-بعدی به شرح زیر دسترسی داشته باشد:" msgid "" "ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1];\n" "item = *((typeof(item) *)ptr);" msgstr "" +"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1];\n" +"item = *((typeof(item) *)ptr);" -msgid "As noted above, :c:member:`~Py_buffer.buf` can point to any location within the actual memory block. An exporter can check the validity of a buffer with this function:" +msgid "" +"As noted above, :c:member:`~Py_buffer.buf` can point to any location within " +"the actual memory block. An exporter can check the validity of a buffer with" +" this function:" msgstr "" +"همان‌طور که در بالا ذکر شد، :c:member:`~Py_buffer.buf` می‌تواند به هر مکانی " +"درون بلوک حافظه‌ی واقعی اشاره کند. یک صادرکننده (exporter) می‌تواند اعتبار " +"یک بافر را با این تابع بررسی کند:" msgid "" "def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" @@ -311,15 +674,60 @@ msgid "" "\n" " return 0 <= offset+imin and offset+imax+itemsize <= memlen" msgstr "" +"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" +" \"\"\"Verify that the parameters represent a valid array within\n" +" the bounds of the allocated memory:\n" +" char *mem: start of the physical memory block\n" +" memlen: length of the physical memory block\n" +" offset: (char *)buf - mem\n" +" \"\"\"\n" +" if offset % itemsize:\n" +" return False\n" +" if offset < 0 or offset+itemsize > memlen:\n" +" return False\n" +" if any(v % itemsize for v in strides):\n" +" return False\n" +"\n" +" if ndim <= 0:\n" +" return ndim == 0 and not shape and not strides\n" +" if 0 in shape:\n" +" return True\n" +"\n" +" imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" +" if strides[j] <= 0)\n" +" imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" +" if strides[j] > 0)\n" +"\n" +" return 0 <= offset+imin and offset+imax+itemsize <= memlen" msgid "PIL-style: shape, strides and suboffsets" -msgstr "" +msgstr "به سبک PIL: shape، strides و suboffsets" -msgid "In addition to the regular items, PIL-style arrays can contain pointers that must be followed in order to get to the next element in a dimension. For example, the regular three-dimensional C-array ``char v[2][2][3]`` can also be viewed as an array of 2 pointers to 2 two-dimensional arrays: ``char (*v[2])[2][3]``. In suboffsets representation, those two pointers can be embedded at the start of :c:member:`~Py_buffer.buf`, pointing to two ``char x[2][3]`` arrays that can be located anywhere in memory." -msgstr "" +msgid "" +"In addition to the regular items, PIL-style arrays can contain pointers that" +" must be followed in order to get to the next element in a dimension. For " +"example, the regular three-dimensional C-array ``char v[2][2][3]`` can also " +"be viewed as an array of 2 pointers to 2 two-dimensional arrays: ``char " +"(*v[2])[2][3]``. In suboffsets representation, those two pointers can be " +"embedded at the start of :c:member:`~Py_buffer.buf`, pointing to two ``char " +"x[2][3]`` arrays that can be located anywhere in memory." +msgstr "" +"علاوه بر آیتم‌های معمولی، آرایه‌های به سبک PIL می‌توانند شامل اشاره‌گرهایی " +"باشند که برای رسیدن به عنصر بعدی در یک بعد باید دنبال شوند. برای مثال، آرایه" +" سه‌بعدی معمولی C یعنی ``char v[2][2][3]`` را می‌توان به‌صورت آرایه‌ای از ۲ " +"اشاره‌گر به ۲ آرایه دوبعدی نیز در نظر گرفت: ``char (*v[2])[2][3]``. در نمایش" +" زیرآفست‌ها (suboffsets)، این دو اشاره‌گر می‌توانند در ابتدای " +":c:member:`~Py_buffer.buf` جاسازی شوند و به دو آرایه ``char x[2][3]`` اشاره " +"کنند که می‌توانند در هر جای حافظه قرار داشته باشند." -msgid "Here is a function that returns a pointer to the element in an N-D array pointed to by an N-dimensional index when there are both non-``NULL`` strides and suboffsets::" +msgid "" +"Here is a function that returns a pointer to the element in an N-D array " +"pointed to by an N-dimensional index when there are both non-``NULL`` " +"strides and suboffsets::" msgstr "" +"تابع زیر وقتی که هم گام‌ها (strides) و هم زیرآفست‌ها (suboffsets) غیر " +"``NULL`` باشند، اشاره‌گر به عنصری در آرایه‌ی N-بعدی را که یک اندیس N-بعدی به" +" آن اشاره می‌کند برمی‌گرداند::" msgid "" "void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" @@ -335,87 +743,206 @@ msgid "" " return (void*)pointer;\n" "}" msgstr "" +"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" +" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n" +" char *pointer = (char*)buf;\n" +" int i;\n" +" for (i = 0; i < ndim; i++) {\n" +" pointer += strides[i] * indices[i];\n" +" if (suboffsets[i] >=0 ) {\n" +" pointer = *((char**)pointer) + suboffsets[i];\n" +" }\n" +" }\n" +" return (void*)pointer;\n" +"}" msgid "Buffer-related functions" -msgstr "" +msgstr "توابع مرتبط با بافر" -msgid "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When ``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` will succeed. This function always succeeds." +msgid "" +"Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " +"``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " +"will succeed. This function always succeeds." msgstr "" +"اگر *obj* از رابط بافر پشتیبانی کند، ``1`` و در غیر این صورت ``0`` را " +"برمی‌گرداند. برگرداندن ``1`` تضمین نمی‌کند که :c:func:`PyObject_GetBuffer` " +"موفق شود. این تابع همیشه موفق است." -msgid "Send a request to *exporter* to fill in *view* as specified by *flags*. If the exporter cannot provide a buffer of the exact type, it MUST raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +msgid "" +"Send a request to *exporter* to fill in *view* as specified by *flags*. If " +"the exporter cannot provide a buffer of the exact type, it MUST raise " +":exc:`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" +"درخواستی به *صادرکننده* ارسال می‌شود تا *نما* را همان‌طور که *پرچم‌ها* مشخص " +"کرده‌اند، پر کند. اگر صادرکننده نتواند بافری از دقیقاً همان نوع ارائه دهد، " +"باید استثنای :exc:`BufferError` را برانگیزد، ``view->obj`` را بر ``NULL`` " +"تنظیم کند و ``-1`` برگرداند." -msgid "On success, fill in *view*, set ``view->obj`` to a new reference to *exporter* and return 0. In the case of chained buffer providers that redirect requests to a single object, ``view->obj`` MAY refer to this object instead of *exporter* (See :ref:`Buffer Object Structures `)." -msgstr "" +msgid "" +"On success, fill in *view*, set ``view->obj`` to a new reference to " +"*exporter* and return 0. In the case of chained buffer providers that " +"redirect requests to a single object, ``view->obj`` MAY refer to this object" +" instead of *exporter* (See :ref:`Buffer Object Structures `)." +msgstr "" +"در صورت موفقیت، *view* را پر می‌کند، ``view->obj`` را به ارجاع جدیدی به " +"*exporter* تنظیم می‌کند و 0 را برمی‌گرداند. در مورد زنجیره‌ای از " +"ارائه‌دهندگان بافر که درخواست‌ها را به یک شیء واحد هدایت مجدد می‌کنند، " +"``view->obj`` می‌تواند به‌جای *exporter* به این شیء اشاره کند (به " +":ref:`ساختارهای شیء بافر ` مراجعه کنید)." -msgid "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:`free`. Thus, after the consumer is done with the buffer, :c:func:`PyBuffer_Release` must be called exactly once." +msgid "" +"Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " +"to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and " +":c:func:`free`. Thus, after the consumer is done with the buffer, " +":c:func:`PyBuffer_Release` must be called exactly once." msgstr "" +"فراخوانی‌های موفق :c:func:`PyObject_GetBuffer` باید با فراخوانی‌های " +":c:func:`PyBuffer_Release` جفت شوند، مشابه :c:func:`malloc` و " +":c:func:`free`. بنابراین، پس از آنکه مصرف‌کننده کار خود را با بافر به پایان " +"برد، :c:func:`PyBuffer_Release` باید دقیقاً یک‌بار فراخوانی شود." -msgid "Release the buffer *view* and release the :term:`strong reference` (i.e. decrement the reference count) to the view's supporting object, ``view->obj``. This function MUST be called when the buffer is no longer being used, otherwise reference leaks may occur." +msgid "" +"Release the buffer *view* and release the :term:`strong reference` (i.e. " +"decrement the reference count) to the view's supporting object, " +"``view->obj``. This function MUST be called when the buffer is no longer " +"being used, otherwise reference leaks may occur." msgstr "" +"*نمای* بافر را آزاد می‌کند و :term:`ارجاع قوی ` (یعنی کاهش" +" شمارش ارجاع) به شیء پشتیبان نما، ``view->obj``، را آزاد می‌کند. این تابع " +"باید زمانی که دیگر از بافر استفاده نمی‌شود حتماً فراخوانی شود، در غیر این " +"صورت ممکن است نشت ارجاع رخ دهد." -msgid "It is an error to call this function on a buffer that was not obtained via :c:func:`PyObject_GetBuffer`." +msgid "" +"It is an error to call this function on a buffer that was not obtained via " +":c:func:`PyObject_GetBuffer`." msgstr "" +"فراخوانی این تابع روی بافری که از طریق :c:func:`PyObject_GetBuffer` به دست " +"نیامده است، خطا است." -msgid "Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:`~Py_buffer.format`. On error, raise an exception and return -1." +msgid "" +"Return the implied :c:member:`~Py_buffer.itemsize` from " +":c:member:`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" +":c:member:`~Py_buffer.itemsize` ضمنی را از :c:member:`~Py_buffer.format` " +"برمی‌گرداند. در صورت خطا، یک استثنا مطرح می‌کند و -1 برمی‌گرداند." -msgid "Return ``1`` if the memory defined by the *view* is C-style (*order* is ``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either one (*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds." +msgid "" +"Return ``1`` if the memory defined by the *view* is C-style (*order* is " +"``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " +"one (*order* is ``'A'``). Return ``0`` otherwise. This function always " +"succeeds." msgstr "" +"اگر حافظه‌ی تعریف‌شده توسط *view* به سبک C (*order* برابر ``'C'`` است) یا به" +" سبک Fortran (*order* برابر ``'F'`` است) :term:`پیوسته ` باشد یا" +" هر یک از این دو (*order* برابر ``'A'`` است)، ``1`` را برمی‌گرداند. در غیر " +"این صورت ``0`` برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Get the memory area pointed to by the *indices* inside the given *view*. *indices* must point to an array of ``view->ndim`` indices." +msgid "" +"Get the memory area pointed to by the *indices* inside the given *view*. " +"*indices* must point to an array of ``view->ndim`` indices." msgstr "" +"به دست آوردن ناحیه حافظه‌ای درون *view* داده‌شده که *indices* به آن اشاره " +"می‌کند. *indices* باید به آرایه‌ای از ``view->ndim`` اندیس اشاره کند." -msgid "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or ``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on success, ``-1`` on error." +msgid "" +"Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " +"``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " +"success, ``-1`` on error." msgstr "" +"*len* بایت پیوسته را از *buf* به *view* کپی می‌کند. *fort* می‌تواند ``'C'`` " +"یا ``'F'`` باشد (برای ترتیب به سبک C یا به سبک فورترن). در صورت موفقیت ``0``" +" و در صورت خطا ``-1`` برگردانده می‌شود." -msgid "Copy *len* bytes from *src* to its contiguous representation in *buf*. *order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style ordering or either one). ``0`` is returned on success, ``-1`` on error." +msgid "" +"Copy *len* bytes from *src* to its contiguous representation in *buf*. " +"*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " +"ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" +"*len* بایت از *src* را به نمایش پیوسته‌ی آن در *buf* کپی می‌کند. *order* " +"می‌تواند ``'C'`` یا ``'F'`` یا ``'A'`` باشد (برای ترتیب به سبک C یا سبک " +"Fortran یا هر یک از این دو). در صورت موفقیت ``0`` و در صورت خطا ``-1`` " +"برگردانده می‌شود." msgid "This function fails if *len* != *src->len*." -msgstr "" +msgstr "این تابع در صورتی که *len* != *src->len* باشد شکست می‌خورد." -msgid "Copy data from *src* to *dest* buffer. Can convert between C-style and or Fortran-style buffers." +msgid "" +"Copy data from *src* to *dest* buffer. Can convert between C-style and or " +"Fortran-style buffers." msgstr "" +"داده‌ها را از بافر *src* به بافر *dest* کپی می‌کند. می‌تواند بین بافرهای سبک" +" C و یا سبک Fortran تبدیل انجام دهد." msgid "``0`` is returned on success, ``-1`` on error." -msgstr "" +msgstr "در صورت موفقیت ``0`` و در صورت خطا ``-1`` برگردانده می‌شود." -msgid "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the given shape with the given number of bytes per element." +msgid "" +"Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " +"if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " +"given shape with the given number of bytes per element." msgstr "" +"آرایه‌ی *strides* را با گام‌های بایتی (byte-strides) یک آرایه‌ی " +":term:`پیوسته ` (به سبک C اگر *order* برابر با ``'C'`` باشد، یا " +"به سبک Fortran اگر *order* برابر با ``'F'`` باشد) که شکل داده‌شده و تعداد " +"بایت داده‌شده به ازای هر عنصر را دارد، پر کنید." -msgid "Handle buffer requests for an exporter that wants to expose *buf* of size *len* with writability set according to *readonly*. *buf* is interpreted as a sequence of unsigned bytes." +msgid "" +"Handle buffer requests for an exporter that wants to expose *buf* of size " +"*len* with writability set according to *readonly*. *buf* is interpreted as " +"a sequence of unsigned bytes." msgstr "" +"درخواست‌های بافر را برای صادرکننده‌ای (exporter) که می‌خواهد *buf* را با " +"اندازه‌ی *len* و با قابلیت نوشتنِ تنظیم‌شده بر اساس *readonly* افشا کند، " +"مدیریت می‌کند. *buf* به‌عنوان دنباله‌ای از بایت‌های بدون علامت تفسیر می‌شود." -msgid "The *flags* argument indicates the request type. This function always fills in *view* as specified by flags, unless *buf* has been designated as read-only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." +msgid "" +"The *flags* argument indicates the request type. This function always fills " +"in *view* as specified by flags, unless *buf* has been designated as read-" +"only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" +"آرگومان *flags* نوع درخواست را نشان می‌دهد. این تابع همیشه *view* را مطابق " +"با flags پر می‌کند، مگر آنکه *buf* به‌عنوان فقط‌خواندنی تعیین‌شده باشد و " +":c:macro:`PyBUF_WRITABLE` در *flags* تنظیم‌شده باشد." -msgid "On success, set ``view->obj`` to a new reference to *exporter* and return 0. Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``;" +msgid "" +"On success, set ``view->obj`` to a new reference to *exporter* and return 0." +" Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " +"return ``-1``;" msgstr "" +"در صورت موفقیت، ``view->obj`` را برابر ارجاعی جدید به *exporter* قرار دهید و" +" 0 را برگردانید. در غیر این صورت، استثنای :exc:`BufferError` را raise کنید، " +"``view->obj`` را برابر ``NULL`` قرار دهید و ``-1`` را برگردانید؛" -msgid "If this function is used as part of a :ref:`getbufferproc `, *exporter* MUST be set to the exporting object and *flags* must be passed unmodified. Otherwise, *exporter* MUST be ``NULL``." +msgid "" +"If this function is used as part of a :ref:`getbufferproc `," +" *exporter* MUST be set to the exporting object and *flags* must be passed " +"unmodified. Otherwise, *exporter* MUST be ``NULL``." msgstr "" +"اگر این تابع به عنوان بخشی از :ref:`getbufferproc ` استفاده " +"شود، *exporter* باید برابر با شیء صادرکننده تنظیم شود و *flags* باید " +"دست‌نخورده ارسال شود. در غیر این صورت، *exporter* باید ``NULL`` باشد." msgid "buffer protocol" -msgstr "" +msgstr "پروتکل بافر" msgid "buffer interface" -msgstr "" +msgstr "رابط بافر" msgid "(see buffer protocol)" -msgstr "" +msgstr "(به پروتکل بافر مراجعه کنید)" msgid "buffer object" -msgstr "" +msgstr "شیء بافر" msgid "PyBufferProcs (C type)" -msgstr "" +msgstr "PyBufferProcs (نوع C)" msgid "contiguous" -msgstr "" +msgstr "پیوسته" msgid "C-contiguous" -msgstr "" +msgstr "پیوسته به سبک C" msgid "Fortran contiguous" -msgstr "" +msgstr "پیوسته به سبک فورترن" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index caad0d221..aa2d4ea5c 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -62,7 +62,7 @@ msgid "Concat bytearrays *a* and *b* and return a new bytearray with the result. msgstr "bytearrayهای *a* و *b* را به هم متصل کنید و یک bytearray جدید با نتیجه بازگردانید." msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." -msgstr "اندازهٔ *bytearray* را پس از بررسی اشاره‌گر ``NULL`` بازگردانید." +msgstr "اندازه‌ی *bytearray* را پس از بررسی اشاره‌گر ``NULL`` بازگردانید." msgid "Return the contents of *bytearray* as a char array after checking for a ``NULL`` pointer. The returned array always has an extra null byte appended." msgstr "محتوای *bytearray* را پس از بررسی اشاره‌گر ``NULL`` به‌صورت یک آرایه نویسه‌ای (char array) بازگردانید. آرایه‌ی برگشتی همیشه دارای یک بایت null اضافی در انتها است." diff --git a/c-api/bytes.po b/c-api/bytes.po index a2e513cdf..3e8117e37 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -25,232 +25,434 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Bytes Objects" -msgstr "" +msgstr "اشیاء بایت" -msgid "These functions raise :exc:`TypeError` when expecting a bytes parameter and called with a non-bytes parameter." +msgid "" +"These functions raise :exc:`TypeError` when expecting a bytes parameter and " +"called with a non-bytes parameter." msgstr "" +"این توابع هنگامی که انتظار پارامتر bytes را دارند و با پارامتری غیر bytes " +"فراخوانی می‌شوند، :exc:`TypeError` را raise می‌کنند." msgid "This subtype of :c:type:`PyObject` represents a Python bytes object." -msgstr "" +msgstr "این زیرنوع از :c:type:`PyObject` یک شیء bytes پایتون را نمایش می‌دهد." -msgid "This instance of :c:type:`PyTypeObject` represents the Python bytes type; it is the same object as :class:`bytes` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python bytes type; it" +" is the same object as :class:`bytes` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع bytes پایتون را نمایندگی می‌کند؛ این" +" همان شیء :class:`bytes` در لایه‌ی پایتون است." -msgid "Return true if the object *o* is a bytes object or an instance of a subtype of the bytes type. This function always succeeds." +msgid "" +"Return true if the object *o* is a bytes object or an instance of a subtype " +"of the bytes type. This function always succeeds." msgstr "" +"اگر شیء *o* یک شیء bytes یا نمونه‌ای از یک زیرنوع از نوع bytes باشد، مقدار " +"true را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if the object *o* is a bytes object, but not an instance of a subtype of the bytes type. This function always succeeds." +msgid "" +"Return true if the object *o* is a bytes object, but not an instance of a " +"subtype of the bytes type. This function always succeeds." msgstr "" +"اگر شیء *o* یک شیء بایت (bytes) باشد اما نمونه‌ای از زیرنوعی از نوع بایت " +"نباشد، مقدار true را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return a new bytes object with a copy of the string *v* as value on success, and ``NULL`` on failure. The parameter *v* must not be ``NULL``; it will not be checked." +msgid "" +"Return a new bytes object with a copy of the string *v* as value on success," +" and ``NULL`` on failure. The parameter *v* must not be ``NULL``; it will " +"not be checked." msgstr "" +"در صورت موفقیت، شیء بایت جدیدی را برمی‌گرداند که مقدار آن کپی رشته *v* است، " +"و در صورت شکست ``NULL`` برمی‌گرداند. پارامتر *v* نباید ``NULL`` باشد؛ بررسی " +"نخواهد شد." -msgid "Return a new bytes object with a copy of the string *v* as value and length *len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of the bytes object are uninitialized." +msgid "" +"Return a new bytes object with a copy of the string *v* as value and length " +"*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents" +" of the bytes object are uninitialized." msgstr "" +"در صورت موفقیت، شیء بایت جدیدی برمی‌گرداند که مقدار آن رونوشتی از رشته *v* و" +" طول آن *len* است و در صورت شکست ``NULL`` برمی‌گرداند. اگر *v* برابر " +"``NULL`` باشد، محتویات شیء بایت مقداردهی‌نشده هستند." -msgid "Take a C :c:func:`printf`\\ -style *format* string and a variable number of arguments, calculate the size of the resulting Python bytes object and return a bytes object with the values formatted into it. The variable arguments must be C types and must correspond exactly to the format characters in the *format* string. The following format characters are allowed:" -msgstr "" +msgid "" +"Take a C :c:func:`printf`\\ -style *format* string and a variable number of " +"arguments, calculate the size of the resulting Python bytes object and " +"return a bytes object with the values formatted into it. The variable " +"arguments must be C types and must correspond exactly to the format " +"characters in the *format* string. The following format characters are " +"allowed:" +msgstr "" +"یک رشته‌ی *format* به سبک :c:func:`printf`\\ در C و تعداد متغیری از " +"آرگومان‌ها می‌گیرد، اندازه‌ی شیء bytes پایتون که حاصل می‌شود را محاسبه " +"می‌کند و یک شیء bytes که مقادیر در آن قالب‌بندی شده‌اند برمی‌گرداند. " +"آرگومان‌های متغیر باید از نوع‌های C باشند و باید دقیقاً با نویسه‌های قالب در" +" رشته‌ی *format* مطابقت داشته باشند. نویسه‌های قالب زیر مجاز هستند:" msgid "Format Characters" -msgstr "" +msgstr "نویسه‌های قالب" msgid "Type" -msgstr "" +msgstr "نوع" msgid "Comment" -msgstr "" +msgstr "کامنت" msgid "``%%``" -msgstr "" +msgstr "``%%``" msgid "*n/a*" -msgstr "" +msgstr "*غیرقابل اعمال*" msgid "The literal % character." -msgstr "" +msgstr "نویسه‌ی لفظی %." msgid "``%c``" -msgstr "" +msgstr "``%c``" msgid "int" -msgstr "" +msgstr "int" msgid "A single byte, represented as a C int." -msgstr "" +msgstr "یک بایت منفرد که به‌صورت int در C بازنمایی می‌شود." msgid "``%d``" -msgstr "" +msgstr "``%d``" msgid "Equivalent to ``printf(\"%d\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%d\")`` است. [1]_" msgid "``%u``" -msgstr "" +msgstr "``%u``" msgid "unsigned int" -msgstr "" +msgstr "unsigned int" msgid "Equivalent to ``printf(\"%u\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%u\")`` است. [1]_" msgid "``%ld``" -msgstr "" +msgstr "``%ld``" msgid "long" -msgstr "" +msgstr "long" msgid "Equivalent to ``printf(\"%ld\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%ld\")``. [1]_" msgid "``%lu``" -msgstr "" +msgstr "``%lu``" msgid "unsigned long" -msgstr "" +msgstr "unsigned long" msgid "Equivalent to ``printf(\"%lu\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%lu\")``. [1]_" msgid "``%zd``" -msgstr "" +msgstr "``%zd``" msgid ":c:type:`\\ Py_ssize_t`" -msgstr "" +msgstr ":c:type:`\\ Py_ssize_t`" msgid "Equivalent to ``printf(\"%zd\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%zd\")`` است. [1]_" msgid "``%zu``" -msgstr "" +msgstr "``%zu``" msgid "size_t" -msgstr "" +msgstr "size_t" msgid "Equivalent to ``printf(\"%zu\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%zu\")`` است. [1]_" msgid "``%i``" -msgstr "" +msgstr "``%i``" msgid "Equivalent to ``printf(\"%i\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%i\")`` است. [1]_" msgid "``%x``" -msgstr "" +msgstr "``%x``" msgid "Equivalent to ``printf(\"%x\")``. [1]_" -msgstr "" +msgstr "معادل ``printf(\"%x\")`` است. [1]_" msgid "``%s``" -msgstr "" +msgstr "``%s``" msgid "const char\\*" -msgstr "" +msgstr "const char\\*" msgid "A null-terminated C character array." -msgstr "" +msgstr "آرایه‌ی نویسه‌ای C که با نویسه‌ی تهی پایان می‌یابد." msgid "``%p``" -msgstr "" +msgstr "``%p``" msgid "const void\\*" -msgstr "" +msgstr "const void\\*" -msgid "The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p\")`` except that it is guaranteed to start with the literal ``0x`` regardless of what the platform's ``printf`` yields." +msgid "" +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." msgstr "" +"نمایش اشاره‌گر C در مبنای شانزده. عمدتاً معادل ``printf(\"%p\")`` است، با " +"این تفاوت که شروع آن با مقدار لفظی ``0x`` تضمین شده است، صرف‌نظر از آنچه " +"``printf`` پلتفرم تولید می‌کند." -msgid "An unrecognized format character causes all the rest of the format string to be copied as-is to the result object, and any extra arguments discarded." +msgid "" +"An unrecognized format character causes all the rest of the format string to" +" be copied as-is to the result object, and any extra arguments discarded." msgstr "" +"نویسه قالب‌بندی ناشناخته باعث می‌شود تمام باقی‌مانده‌ی رشته قالب‌بندی عیناً " +"در شیء نتیجه کپی شود و هر آرگومان اضافی نیز دور ریخته شود." -msgid "For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag has effect even when a precision is given." +msgid "" +"For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag " +"has effect even when a precision is given." msgstr "" +"برای مشخص‌کننده‌های عدد صحیح (d, u, ld, lu, zd, zu, i, x): پرچم تبدیل 0 حتی " +"هنگامی که دقتی مشخص‌شده باشد، تأثیر دارد." -msgid "Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two arguments." +msgid "" +"Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two " +"arguments." msgstr "" +"یکسان با :c:func:`PyBytes_FromFormat` است، به‌جز اینکه دقیقاً دو آرگومان " +"می‌پذیرد." -msgid "Return the bytes representation of object *o* that implements the buffer protocol." +msgid "" +"Return the bytes representation of object *o* that implements the buffer " +"protocol." msgstr "" +"نمایش بایتی شیء *o* را که پروتکل بافر را پیاده‌سازی می‌کند، برمی‌گرداند." -msgid "If the object implements the buffer protocol, then the buffer must not be mutated while the bytes object is being created." +msgid "" +"If the object implements the buffer protocol, then the buffer must not be " +"mutated while the bytes object is being created." msgstr "" +"اگر شیء پروتکل بافر را پیاده‌سازی کند، بافر نباید در حین ایجاد شدن شیء بایت " +"تغییر داده شود." msgid "Return the length of the bytes in bytes object *o*." -msgstr "" +msgstr "طول بایت‌های شیء بایت *o* را برمی‌گرداند." msgid "Similar to :c:func:`PyBytes_Size`, but without error checking." -msgstr "" +msgstr "مشابه :c:func:`PyBytes_Size`، اما بدون بررسی خطا." -msgid "Return a pointer to the contents of *o*. The pointer refers to the internal buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in the buffer is always null, regardless of whether there are any other null bytes. The data must not be modified in any way, unless the object was just created using ``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If *o* is not a bytes object at all, :c:func:`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`." -msgstr "" +msgid "" +"Return a pointer to the contents of *o*. The pointer refers to the internal" +" buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in " +"the buffer is always null, regardless of whether there are any other null " +"bytes. The data must not be modified in any way, unless the object was just" +" created using ``PyBytes_FromStringAndSize(NULL, size)``. It must not be " +"deallocated. If *o* is not a bytes object at all, " +":c:func:`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`." +msgstr "" +"اشاره‌گری به محتویات *o* را برمی‌گرداند. این اشاره‌گر به بافر داخلی *o* " +"اشاره می‌کند که از ``len(o) + 1`` بایت تشکیل شده است. آخرین بایت در بافر " +"همیشه تهی است، صرف‌نظر از اینکه بایت‌های تهی دیگری وجود دارند یا نه. این " +"داده نباید به هیچ شکلی تغییر داده شود، مگر اینکه شیء تازه با استفاده از " +"``PyBytes_FromStringAndSize(NULL, size)`` ایجاد شده باشد. نباید آزادسازی " +"شود. اگر *o* اصلاً یک شیء بایت نباشد، :c:func:`PyBytes_AsString` مقدار " +"``NULL`` را برمی‌گرداند و استثنای :exc:`TypeError` را ایجاد می‌کند." msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking." -msgstr "" +msgstr "مشابه :c:func:`PyBytes_AsString`، اما بدون بررسی خطا." -msgid "Return the null-terminated contents of the object *obj* through the output variables *buffer* and *length*. Returns ``0`` on success." +msgid "" +"Return the null-terminated contents of the object *obj* through the output " +"variables *buffer* and *length*. Returns ``0`` on success." msgstr "" +"محتوای شیء *obj* را که با تهی پایان یافته است، از طریق متغیرهای خروجی " +"*buffer* و *length* برمی‌گرداند. در صورت موفقیت ``0`` را برمی‌گرداند." -msgid "If *length* is ``NULL``, the bytes object may not contain embedded null bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is raised." +msgid "" +"If *length* is ``NULL``, the bytes object may not contain embedded null " +"bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is " +"raised." msgstr "" +"اگر *length* برابر ``NULL`` باشد، شیء بایت نباید شامل بایت‌های تهی تعبیه‌شده" +" باشد؛ در غیر این صورت، تابع ``-1`` را برمی‌گرداند و استثنای " +":exc:`ValueError` به‌وجود می‌آید." -msgid "The buffer refers to an internal buffer of *obj*, which includes an additional null byte at the end (not counted in *length*). The data must not be modified in any way, unless the object was just created using ``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If *obj* is not a bytes object at all, :c:func:`PyBytes_AsStringAndSize` returns ``-1`` and raises :exc:`TypeError`." -msgstr "" +msgid "" +"The buffer refers to an internal buffer of *obj*, which includes an " +"additional null byte at the end (not counted in *length*). The data must " +"not be modified in any way, unless the object was just created using " +"``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If " +"*obj* is not a bytes object at all, :c:func:`PyBytes_AsStringAndSize` " +"returns ``-1`` and raises :exc:`TypeError`." +msgstr "" +"بافر به بافر داخلی *obj* اشاره می‌کند که شامل یک بایت تهی اضافی در انتها است" +" (که در *length* شمرده نمی‌شود). داده‌ها نباید به هیچ شکلی تغییر داده شوند، " +"مگر آنکه شیء به‌تازگی با استفاده از ``PyBytes_FromStringAndSize(NULL, " +"size)`` ایجاد شده باشد. این بافر نباید آزاد شود. اگر *obj* اصلاً یک شیء بایت" +" نباشد، :c:func:`PyBytes_AsStringAndSize` مقدار ``-1`` را برمی‌گرداند و " +"استثنای :exc:`TypeError` را ایجاد می‌کند." -msgid "Previously, :exc:`TypeError` was raised when embedded null bytes were encountered in the bytes object." +msgid "" +"Previously, :exc:`TypeError` was raised when embedded null bytes were " +"encountered in the bytes object." msgstr "" +"پیش‌تر، هنگامی که به بایت‌های تهی تعبیه‌شده در شیء بایت برخورد می‌شد، " +":exc:`TypeError` رخ می‌داد." -msgid "Create a new bytes object in *\\*bytes* containing the contents of *newpart* appended to *bytes*; the caller will own the new reference. The reference to the old value of *bytes* will be \":term:`stolen `\". If the new object cannot be created, the old reference to *bytes* will still be \"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the appropriate exception will be set." -msgstr "" +msgid "" +"Create a new bytes object in *\\*bytes* containing the contents of *newpart*" +" appended to *bytes*; the caller will own the new reference. The reference " +"to the old value of *bytes* will be \":term:`stolen `\". If the new " +"object cannot be created, the old reference to *bytes* will still be " +"\"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the " +"appropriate exception will be set." +msgstr "" +"یک شیء بایت جدید در *\\*bytes* ایجاد می‌کند که شامل محتوای *newpart* " +"الحاق‌شده به *bytes* است؛ فراخوان‌کننده مالک ارجاع جدید خواهد بود. ارجاع به " +"مقدار قبلی *bytes* «:term:`دزدیده‌شده (stolen) `» خواهد بود. اگر " +"نتوان شیء جدید را ایجاد کرد، ارجاع قبلی به *bytes* همچنان «دزدیده‌شده» خواهد" +" بود، مقدار *\\*bytes* برابر ``NULL`` قرار خواهد گرفت و استثنای مناسب تنظیم " +"خواهد شد." -msgid "If *newpart* implements the buffer protocol, then the buffer must not be mutated while the new bytes object is being created." +msgid "" +"If *newpart* implements the buffer protocol, then the buffer must not be " +"mutated while the new bytes object is being created." msgstr "" +"اگر *newpart* پروتکل بافر را پیاده‌سازی کرده باشد، بافر نباید در حین ایجاد " +"شدن شیء بایت جدید تغییر کند." -msgid "Create a new bytes object in *\\*bytes* containing the contents of *newpart* appended to *bytes*. This version releases the :term:`strong reference` to *newpart* (i.e. decrements its reference count)." +msgid "" +"Create a new bytes object in *\\*bytes* containing the contents of *newpart*" +" appended to *bytes*. This version releases the :term:`strong reference` to" +" *newpart* (i.e. decrements its reference count)." msgstr "" +"یک شیء بایت جدید در *\\*bytes* ایجاد می‌کند که محتوای *newpart* الحاق‌شده به" +" *bytes* را در بر دارد. این نسخه :term:`ارجاع قوی ` به " +"*newpart* را آزاد می‌کند (یعنی شمارش ارجاع آن را کاهش می‌دهد)." msgid "Similar to ``sep.join(iterable)`` in Python." -msgstr "" +msgstr "مشابه ``sep.join(iterable)`` در پایتون." -msgid "*sep* must be Python :class:`bytes` object. (Note that :c:func:`PyUnicode_Join` accepts ``NULL`` separator and treats it as a space, whereas :c:func:`PyBytes_Join` doesn't accept ``NULL`` separator.)" +msgid "" +"*sep* must be Python :class:`bytes` object. (Note that " +":c:func:`PyUnicode_Join` accepts ``NULL`` separator and treats it as a " +"space, whereas :c:func:`PyBytes_Join` doesn't accept ``NULL`` separator.)" msgstr "" +"*sep* باید یک شیء :class:`bytes` پایتون باشد. (توجه داشته باشید که " +":c:func:`PyUnicode_Join` جداکننده ``NULL`` را می‌پذیرد و آن را به‌عنوان یک " +"فاصله در نظر می‌گیرد، در حالی که :c:func:`PyBytes_Join` جداکننده ``NULL`` را" +" نمی‌پذیرد.)" -msgid "*iterable* must be an iterable object yielding objects that implement the :ref:`buffer protocol `." +msgid "" +"*iterable* must be an iterable object yielding objects that implement the " +":ref:`buffer protocol `." msgstr "" +"*iterable* باید یک شیء پیمایش‌پذیر باشد که اشیایی را تولید می‌کند که " +":ref:`پروتکل بافر ` را پیاده‌سازی کرده باشند." -msgid "On success, return a new :class:`bytes` object. On error, set an exception and return ``NULL``." +msgid "" +"On success, return a new :class:`bytes` object. On error, set an exception " +"and return ``NULL``." msgstr "" +"در صورت موفقیت، یک شیء :class:`bytes` جدید برمی‌گرداند. در صورت خطا، یک " +"استثنا تنظیم کرده و ``NULL`` برمی‌گرداند." -msgid "If *iterable* objects implement the buffer protocol, then the buffers must not be mutated while the new bytes object is being created." +msgid "" +"If *iterable* objects implement the buffer protocol, then the buffers must " +"not be mutated while the new bytes object is being created." msgstr "" +"اگر اشیاء *پیمایش‌پذیر* پروتکل بافر را پیاده‌سازی کنند، بافرها نباید در حین " +"ایجاد شیء بایت جدید تغییر داده شوند." -msgid "Resize a bytes object. *newsize* will be the new length of the bytes object. You can think of it as creating a new bytes object and destroying the old one, only more efficiently. Pass the address of an existing bytes object as an lvalue (it may be written into), and the new size desired. On success, *\\*bytes* holds the resized bytes object and ``0`` is returned; the address in *\\*bytes* may differ from its input value. If the reallocation fails, the original bytes object at *\\*bytes* is deallocated, *\\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned." -msgstr "" +msgid "" +"Resize a bytes object. *newsize* will be the new length of the bytes object." +" You can think of it as creating a new bytes object and destroying the old " +"one, only more efficiently. Pass the address of an existing bytes object as " +"an lvalue (it may be written into), and the new size desired. On success, " +"*\\*bytes* holds the resized bytes object and ``0`` is returned; the address" +" in *\\*bytes* may differ from its input value. If the reallocation fails, " +"the original bytes object at *\\*bytes* is deallocated, *\\*bytes* is set to" +" ``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned." +msgstr "" +"اندازه یک شیء بایت را تغییر می‌دهد. *newsize* طول جدید شیء بایت خواهد بود. " +"می‌توانید آن را به‌صورت ایجاد یک شیء بایت جدید و نابود کردن شیء قدیمی تصور " +"کنید، فقط با کارایی بیشتر. آدرس یک شیء بایت موجود را به‌عنوان یک چپ‌مقدار " +"(lvalue) (که ممکن است در آن نوشته شود) به همراه اندازه جدید موردنظر ارسال " +"کنید. در صورت موفقیت، *\\*bytes* حاوی شیء بایت با اندازه جدید است و ``0`` " +"بازگردانده می‌شود؛ آدرس موجود در *\\*bytes* ممکن است با مقدار ورودی آن " +"متفاوت باشد. اگر تخصیص مجدد شکست بخورد، شیء بایت اصلی موجود در *\\*bytes* " +"آزاد می‌شود، *\\*bytes* برابر ``NULL`` قرار می‌گیرد، :exc:`MemoryError` " +"تنظیم می‌شود و ``-1`` بازگردانده می‌شود." -msgid "Get the string representation of *bytes*. This function is currently used to implement :meth:`!bytes.__repr__` in Python." +msgid "" +"Get the string representation of *bytes*. This function is currently used to" +" implement :meth:`!bytes.__repr__` in Python." msgstr "" +"بازنمایی رشته‌ای *bytes* را برمی‌گرداند. این تابع در حال حاضر برای " +"پیاده‌سازی :meth:`!bytes.__repr__` در پایتون استفاده می‌شود." -msgid "This function does not do type checking; it is undefined behavior to pass *bytes* as a non-bytes object or ``NULL``." +msgid "" +"This function does not do type checking; it is undefined behavior to pass " +"*bytes* as a non-bytes object or ``NULL``." msgstr "" +"این تابع بررسی نوع انجام نمی‌دهد؛ گذراندن *bytes* به‌عنوان یک شیء غیربایتی " +"یا ``NULL`` رفتار تعریف‌نشده است." -msgid "If *smartquotes* is true, the representation will use a double-quoted string instead of single-quoted string when single-quotes are present in *bytes*. For example, the byte string ``'Python'`` would be represented as ``b\"'Python'\"`` when *smartquotes* is true, or ``b'\\'Python\\''`` when it is false." -msgstr "" +msgid "" +"If *smartquotes* is true, the representation will use a double-quoted string" +" instead of single-quoted string when single-quotes are present in *bytes*. " +"For example, the byte string ``'Python'`` would be represented as " +"``b\"'Python'\"`` when *smartquotes* is true, or ``b'\\'Python\\''`` when it" +" is false." +msgstr "" +"اگر *smartquotes* درست باشد، نمایش در صورت وجود علامت‌های نقل‌قول تکی در " +"*bytes*، به‌جای رشته‌ی محصور در علامت نقل‌قول تکی از رشته‌ی محصور در علامت " +"نقل‌قول دوتایی استفاده خواهد کرد. برای مثال، رشته‌ی بایتی ``'Python'`` " +"هنگامی که *smartquotes* درست باشد به‌صورت ``b\"'Python'\"`` و هنگامی که " +"نادرست باشد به‌صورت ``b'\\'Python\\''`` نمایش داده می‌شود." -msgid "On success, this function returns a :term:`strong reference` to a :class:`str` object containing the representation. On failure, this returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to a " +":class:`str` object containing the representation. On failure, this returns " +"``NULL`` with an exception set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`ارجاع قوی ` به یک شیء " +":class:`str` حاوی نمایش را برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را " +"همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "Unescape a backslash-escaped string *s*. *s* must not be ``NULL``. *len* must be the size of *s*." +msgid "" +"Unescape a backslash-escaped string *s*. *s* must not be ``NULL``. *len* " +"must be the size of *s*." msgstr "" +"رشته‌ی خنثی‌شده با بک‌اسلش *s* را بازگشایی (unescape) کنید. *s* نباید " +"``NULL`` باشد. *len* باید اندازه‌ی *s* باشد." -msgid "*errors* must be one of ``\"strict\"``, ``\"replace\"``, or ``\"ignore\"``. If *errors* is ``NULL``, then ``\"strict\"`` is used by default." +msgid "" +"*errors* must be one of ``\"strict\"``, ``\"replace\"``, or ``\"ignore\"``. " +"If *errors* is ``NULL``, then ``\"strict\"`` is used by default." msgstr "" +"*errors* باید یکی از ``\"strict\"``، ``\"replace\"`` یا ``\"ignore\"`` باشد." +" اگر *errors* برابر ``NULL`` باشد، به‌طور پیش‌فرض از ``\"strict\"`` استفاده " +"می‌شود." -msgid "On success, this function returns a :term:`strong reference` to a Python :class:`bytes` object containing the unescaped string. On failure, this function returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to a Python " +":class:`bytes` object containing the unescaped string. On failure, this " +"function returns ``NULL`` with an exception set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`ارجاع قوی ` به یک شیء " +":class:`bytes` پایتونی حاوی رشته‌ی گریز‌زدایی‌شده (unescaped) را " +"برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را همراه با یک استثنای " +"تنظیم‌شده برمی‌گرداند." msgid "*unicode* and *recode_encoding* are now unused." -msgstr "" +msgstr "*unicode* و *recode_encoding* اکنون استفاده نمی‌شوند." msgid "object" -msgstr "" +msgstr "شیء" msgid "bytes" -msgstr "" +msgstr "bytes" diff --git a/c-api/call.po b/c-api/call.po index c58eba555..f89cc08ef 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -25,298 +25,617 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Call Protocol" -msgstr "" +msgstr "پروتکل فراخوانی" -msgid "CPython supports two different calling protocols: *tp_call* and vectorcall." +msgid "" +"CPython supports two different calling protocols: *tp_call* and vectorcall." msgstr "" +"سی‌پایتون از دو پروتکل فراخوانی متفاوت پشتیبانی می‌کند: *tp_call* و " +"vectorcall." msgid "The *tp_call* Protocol" -msgstr "" +msgstr "پروتکل *tp_call*" -msgid "Instances of classes that set :c:member:`~PyTypeObject.tp_call` are callable. The signature of the slot is::" +msgid "" +"Instances of classes that set :c:member:`~PyTypeObject.tp_call` are " +"callable. The signature of the slot is::" msgstr "" +"نمونه‌های کلاس‌هایی که :c:member:`~PyTypeObject.tp_call` را تنظیم می‌کنند، " +"فراخوانی‌پذیر هستند. امضای این جایگاه به صورت زیر است::" -msgid "PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" +msgid "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" msgstr "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" -msgid "A call is made using a tuple for the positional arguments and a dict for the keyword arguments, similarly to ``callable(*args, **kwargs)`` in Python code. *args* must be non-NULL (use an empty tuple if there are no arguments) but *kwargs* may be *NULL* if there are no keyword arguments." +msgid "" +"A call is made using a tuple for the positional arguments and a dict for the" +" keyword arguments, similarly to ``callable(*args, **kwargs)`` in Python " +"code. *args* must be non-NULL (use an empty tuple if there are no arguments)" +" but *kwargs* may be *NULL* if there are no keyword arguments." msgstr "" +"فراخوانی با استفاده از یک تاپل برای آرگومان‌های جایگاهی و یک دیکشنری برای " +"آرگومان‌های کلیدواژه‌ای انجام می‌شود، مشابه ``callable(*args, **kwargs)`` در" +" کد پایتون. *args* باید غیر NULL باشد (اگر آرگومانی وجود ندارد، از یک تاپل " +"خالی استفاده کنید) اما *kwargs* در صورت نبود آرگومان‌های کلیدواژه‌ای " +"می‌تواند *NULL* باشد." -msgid "This convention is not only used by *tp_call*: :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_init` also pass arguments this way." +msgid "" +"This convention is not only used by *tp_call*: " +":c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_init` also " +"pass arguments this way." msgstr "" +"این قرارداد تنها توسط *tp_call* استفاده نمی‌شود: " +":c:member:`~PyTypeObject.tp_new` و :c:member:`~PyTypeObject.tp_init` نیز " +"آرگومان‌ها را به این روش پاس می‌دهند." -msgid "To call an object, use :c:func:`PyObject_Call` or another :ref:`call API `." +msgid "" +"To call an object, use :c:func:`PyObject_Call` or another :ref:`call API " +"`." msgstr "" +"برای فراخوانی یک شیء، از :c:func:`PyObject_Call` یا :ref:`API فراخوانی " +"` دیگری استفاده کنید." msgid "The Vectorcall Protocol" -msgstr "" +msgstr "پروتکل Vectorcall" -msgid "The vectorcall protocol was introduced in :pep:`590` as an additional protocol for making calls more efficient." +msgid "" +"The vectorcall protocol was introduced in :pep:`590` as an additional " +"protocol for making calls more efficient." msgstr "" +"پروتکل vectorcall در :pep:`590` به‌عنوان پروتکلی اضافی برای کارآمدتر کردن " +"فراخوانی‌ها معرفی شد." -msgid "As rule of thumb, CPython will prefer the vectorcall for internal calls if the callable supports it. However, this is not a hard rule. Additionally, some third-party extensions use *tp_call* directly (rather than using :c:func:`PyObject_Call`). Therefore, a class supporting vectorcall must also implement :c:member:`~PyTypeObject.tp_call`. Moreover, the callable must behave the same regardless of which protocol is used. The recommended way to achieve this is by setting :c:member:`~PyTypeObject.tp_call` to :c:func:`PyVectorcall_Call`. This bears repeating:" -msgstr "" +msgid "" +"As rule of thumb, CPython will prefer the vectorcall for internal calls if " +"the callable supports it. However, this is not a hard rule. Additionally, " +"some third-party extensions use *tp_call* directly (rather than using " +":c:func:`PyObject_Call`). Therefore, a class supporting vectorcall must also" +" implement :c:member:`~PyTypeObject.tp_call`. Moreover, the callable must " +"behave the same regardless of which protocol is used. The recommended way to" +" achieve this is by setting :c:member:`~PyTypeObject.tp_call` to " +":c:func:`PyVectorcall_Call`. This bears repeating:" +msgstr "" +"به عنوان یک قاعده سرانگشتی، سی‌پایتون برای فراخوانی‌های داخلی vectorcall را " +"ترجیح می‌دهد، مشروط به اینکه فراخوانی‌پذیر از آن پشتیبانی کند. با این حال، " +"این یک قاعده سفت و سخت نیست. افزون بر این، برخی افزونه‌های شخص ثالث مستقیماً" +" از *tp_call* استفاده می‌کنند (به‌جای استفاده از :c:func:`PyObject_Call`). " +"بنابراین، کلاسی که از vectorcall پشتیبانی می‌کند باید " +":c:member:`~PyTypeObject.tp_call` را نیز پیاده‌سازی کند. به‌علاوه، " +"فراخوانی‌پذیر باید فارغ از اینکه از کدام پروتکل استفاده می‌شود، رفتار یکسانی" +" داشته باشد. راه توصیه‌شده برای دستیابی به این هدف، تنظیم " +":c:member:`~PyTypeObject.tp_call` روی :c:func:`PyVectorcall_Call` است. این " +"نکته شایان تکرار است:" -msgid "A class supporting vectorcall **must** also implement :c:member:`~PyTypeObject.tp_call` with the same semantics." +msgid "" +"A class supporting vectorcall **must** also implement " +":c:member:`~PyTypeObject.tp_call` with the same semantics." msgstr "" +"کلاسی که از vectorcall پشتیبانی می‌کند، **باید** " +":c:member:`~PyTypeObject.tp_call` را نیز با همان معناشناسی پیاده‌سازی کند." -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 internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it behave differently than the vectorcall function.) In earlier Python versions, vectorcall should only be used with :c:macro:`immutable ` or static types." -msgstr "" +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 " +"internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it" +" behave differently than the vectorcall function.) In earlier Python " +"versions, vectorcall should only be used with :c:macro:`immutable " +"` or static types." +msgstr "" +"پرچم :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` اکنون هنگامی از یک کلاس حذف " +"می‌شود که متد :py:meth:`~object.__call__` آن کلاس دوباره انتساب داده شود. " +"(این کار به‌طور داخلی فقط :c:member:`~PyTypeObject.tp_call` را تنظیم می‌کند " +"و در نتیجه ممکن است رفتار آن متفاوت از تابع vectorcall باشد.) در نسخه‌های " +"پیشین پایتون، vectorcall باید فقط با نوع‌های :c:macro:`تغییرناپذیر " +"` یا ایستا استفاده شود." -msgid "A class should not implement vectorcall if that would be slower than *tp_call*. For example, if the callee needs to convert the arguments to an args tuple and kwargs dict anyway, then there is no point in implementing vectorcall." +msgid "" +"A class should not implement vectorcall if that would be slower than " +"*tp_call*. For example, if the callee needs to convert the arguments to an " +"args tuple and kwargs dict anyway, then there is no point in implementing " +"vectorcall." msgstr "" +"یک کلاس نباید vectorcall را پیاده‌سازی کند اگر این کار کندتر از *tp_call* " +"باشد. برای مثال، اگر فراخوانی‌شونده به هر حال نیاز داشته باشد که آرگومان‌ها " +"را به تاپل args و دیکشنری kwargs تبدیل کند، آنگاه پیاده‌سازی vectorcall " +"فایده‌ای ندارد." -msgid "Classes can implement the vectorcall protocol by enabling the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting :c:member:`~PyTypeObject.tp_vectorcall_offset` to the offset inside the object structure where a *vectorcallfunc* appears. This is a pointer to a function with the following signature:" -msgstr "" +msgid "" +"Classes can implement the vectorcall protocol by enabling the " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting " +":c:member:`~PyTypeObject.tp_vectorcall_offset` to the offset inside the " +"object structure where a *vectorcallfunc* appears. This is a pointer to a " +"function with the following signature:" +msgstr "" +"کلاس‌ها می‌توانند پروتکل vectorcall را با فعال کردن پرچم " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` و تنظیم " +":c:member:`~PyTypeObject.tp_vectorcall_offset` به آفست درون ساختار شیء که یک" +" *vectorcallfunc* در آن قرار دارد، پیاده‌سازی کنند. این یک اشاره‌گر به تابعی" +" با امضای زیر است:" msgid "*callable* is the object being called." -msgstr "" +msgstr "*callable* شیءی است که فراخوانی می‌شود." -msgid "*args* is a C array consisting of the positional arguments followed by the" +msgid "" +"*args* is a C array consisting of the positional arguments followed by the" msgstr "" +"*args* یک آرایه‌ی C است که از آرگومان‌های جایگاهی تشکیل شده و به دنبال آن" -msgid "values of the keyword arguments. This can be *NULL* if there are no arguments." +msgid "" +"values of the keyword arguments. This can be *NULL* if there are no " +"arguments." msgstr "" +"مقادیر آرگومان‌های کلیدواژه‌ای. در صورت نبود آرگومان، این می‌تواند *NULL* " +"باشد." msgid "*nargsf* is the number of positional arguments plus possibly the" -msgstr "" +msgstr "*nargsf* تعداد آرگومان‌های جایگاهی است به‌علاوه احتمالاً" -msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." +msgid "" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " +"positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" +"پرچم :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. برای به‌دست‌آوردن تعداد " +"واقعی آرگومان‌های جایگاهی از *nargsf*، از :c:func:`PyVectorcall_NARGS` " +"استفاده کنید." msgid "*kwnames* is a tuple containing the names of the keyword arguments;" -msgstr "" +msgstr "*kwnames* تاپلی است که نام‌های آرگومان‌های کلیدواژه‌ای را در بر دارد؛" -msgid "in other words, the keys of the kwargs dict. These names must be strings (instances of ``str`` or a subclass) and they must be unique. If there are no keyword arguments, then *kwnames* can instead be *NULL*." +msgid "" +"in other words, the keys of the kwargs dict. These names must be strings " +"(instances of ``str`` or a subclass) and they must be unique. If there are " +"no keyword arguments, then *kwnames* can instead be *NULL*." msgstr "" +"به عبارت دیگر، کلیدهای دیکشنری kwargs. این نام‌ها باید رشته باشند " +"(نمونه‌هایی از ``str`` یا یک زیرکلاس) و باید یکتا باشند. اگر آرگومان " +"کلیدواژه‌ای وجود نداشته باشد، *kwnames* می‌تواند به‌جای آن *NULL* باشد." -msgid "If this flag is set in a vectorcall *nargsf* argument, the callee is allowed to temporarily change ``args[-1]``. In other words, *args* points to argument 1 (not 0) in the allocated vector. The callee must restore the value of ``args[-1]`` before returning." +msgid "" +"If this flag is set in a vectorcall *nargsf* argument, the callee is allowed" +" to temporarily change ``args[-1]``. In other words, *args* points to " +"argument 1 (not 0) in the allocated vector. The callee must restore the " +"value of ``args[-1]`` before returning." msgstr "" +"اگر این پرچم در آرگومان *nargsf* مربوط به vectorcall تنظیم شده باشد، به " +"فراخوانی‌شونده اجازه داده می‌شود که ``args[-1]`` را به‌طور موقت تغییر دهد. " +"به عبارت دیگر، *args* به آرگومان ۱ (نه ۰) در بردار تخصیص‌یافته اشاره می‌کند." +" فراخوانی‌شونده باید پیش از بازگشت، مقدار ``args[-1]`` را بازگرداند." -msgid "For :c:func:`PyObject_VectorcallMethod`, this flag means instead that ``args[0]`` may be changed." +msgid "" +"For :c:func:`PyObject_VectorcallMethod`, this flag means instead that " +"``args[0]`` may be changed." msgstr "" +"برای :c:func:`PyObject_VectorcallMethod`، این پرچم در عوض به این معنا است که" +" ``args[0]`` ممکن است تغییر کند." -msgid "Whenever they can do so cheaply (without additional allocation), callers are encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will allow callables such as bound methods to make their onward calls (which include a prepended *self* argument) very efficiently." +msgid "" +"Whenever they can do so cheaply (without additional allocation), callers are" +" encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " +"allow callables such as bound methods to make their onward calls (which " +"include a prepended *self* argument) very efficiently." msgstr "" +"هرگاه بتوانند این کار را با هزینه‌ی اندکی انجام دهند (بدون تخصیص اضافی)، به " +"فراخوان‌کنندگان توصیه می‌شود که از :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" +" استفاده کنند. انجام این کار به فراخوانی‌پذیرهایی مانند متدهای مقید اجازه " +"می‌دهد تا فراخوانی‌های بعدی خود (که آرگومان *self* در ابتدای آن‌ها افزوده " +"شده است) را به‌طور بسیار کارآمد انجام دهند." -msgid "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` will usually be most efficient." +msgid "" +"To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " +"will usually be most efficient." msgstr "" +"برای فراخوانی شیئی که vectorcall را پیاده‌سازی می‌کند، مانند هر " +"فراخوانی‌پذیر دیگری از یک تابع :ref:`API فراخوانی ` استفاده کنید." +" :c:func:`PyObject_Vectorcall` معمولاً کارآمدترین خواهد بود." msgid "Recursion Control" -msgstr "" +msgstr "کنترل بازگشت" -msgid "When using *tp_call*, callees do not need to worry about :ref:`recursion `: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` for calls made using *tp_call*." +msgid "" +"When using *tp_call*, callees do not need to worry about :ref:`recursion " +"`: CPython uses :c:func:`Py_EnterRecursiveCall` and " +":c:func:`Py_LeaveRecursiveCall` for calls made using *tp_call*." msgstr "" +"هنگام استفاده از *tp_call*، لازم نیست فراخوانی‌شده‌ها نگران :ref:`بازگشتی " +"` باشند: سی‌پایتون برای فراخوانی‌هایی که با استفاده از *tp_call* " +"انجام می‌شوند، از :c:func:`Py_EnterRecursiveCall` و " +":c:func:`Py_LeaveRecursiveCall` استفاده می‌کند." -msgid "For efficiency, this is not the case for calls done using vectorcall: the callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if needed." +msgid "" +"For efficiency, this is not the case for calls done using vectorcall: the " +"callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " +"needed." msgstr "" +"برای کارایی، این موضوع در مورد فراخوانی‌هایی که با استفاده از vectorcall " +"انجام می‌شوند صدق نمی‌کند: فراخوانی‌شونده باید در صورت نیاز از " +"*Py_EnterRecursiveCall* و *Py_LeaveRecursiveCall* استفاده کند." msgid "Vectorcall Support API" -msgstr "" +msgstr "API پشتیبانی Vectorcall" -msgid "Given a vectorcall *nargsf* argument, return the actual number of arguments. Currently equivalent to::" +msgid "" +"Given a vectorcall *nargsf* argument, return the actual number of arguments." +" Currently equivalent to::" msgstr "" +"با دریافت آرگومان *nargsf* در فراخوانی برداری (vectorcall)، تعداد واقعی " +"آرگومان‌ها را برمی‌گرداند. در حال حاضر معادل است با::" msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" -msgstr "" +msgstr "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" -msgid "However, the function ``PyVectorcall_NARGS`` should be used to allow for future extensions." +msgid "" +"However, the function ``PyVectorcall_NARGS`` should be used to allow for " +"future extensions." msgstr "" +"با این حال، برای پشتیبانی از توسعه‌های آینده، باید از تابع " +"``PyVectorcall_NARGS`` استفاده شود." -msgid "If *op* does not support the vectorcall protocol (either because the type does not or because the specific instance does not), return *NULL*. Otherwise, return the vectorcall function pointer stored in *op*. This function never raises an exception." +msgid "" +"If *op* does not support the vectorcall protocol (either because the type " +"does not or because the specific instance does not), return *NULL*. " +"Otherwise, return the vectorcall function pointer stored in *op*. This " +"function never raises an exception." msgstr "" +"اگر *op* از پروتکل فراخوانی برداری (vectorcall) پشتیبانی نکند (چه به این " +"دلیل که نوع آن پشتیبانی نکند و چه به این دلیل که نمونه‌ی خاص پشتیبانی نکند)،" +" مقدار *NULL* برگردانده می‌شود. در غیر این صورت، اشاره‌گر تابع vectorcall " +"ذخیره‌شده در *op* برگردانده می‌شود. این تابع هرگز استثنا ایجاد نمی‌کند." -msgid "This is mostly useful to check whether or not *op* supports vectorcall, which can be done by checking ``PyVectorcall_Function(op) != NULL``." +msgid "" +"This is mostly useful to check whether or not *op* supports vectorcall, " +"which can be done by checking ``PyVectorcall_Function(op) != NULL``." msgstr "" +"این عمدتاً برای بررسی اینکه آیا *op* از vectorcall پشتیبانی می‌کند یا خیر " +"مفید است؛ این کار را می‌توان با بررسی ``PyVectorcall_Function(op) != NULL`` " +"انجام داد." -msgid "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword arguments given in a tuple and dict, respectively." +msgid "" +"Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " +"arguments given in a tuple and dict, respectively." msgstr "" +"تابع :c:type:`vectorcallfunc` مربوط به *فراخوانی‌پذیر* را با آرگومان‌های " +"جایگاهی و کلیدواژه‌ای که به ترتیب در یک تاپل و دیکشنری داده شده‌اند، " +"فراخوانی می‌کند." -msgid "This is a specialized function, intended to be put in the :c:member:`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does not fall back to ``tp_call``." +msgid "" +"This is a specialized function, intended to be put in the " +":c:member:`~PyTypeObject.tp_call` slot or be used in an implementation of " +"``tp_call``. It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` " +"flag and it does not fall back to ``tp_call``." msgstr "" +"این یک تابع تخصصی است که در نظر گرفته شده است تا در جایگاه " +":c:member:`~PyTypeObject.tp_call` قرار گیرد یا در پیاده‌سازی ``tp_call`` " +"استفاده شود. این تابع پرچم :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` را بررسی " +"نمی‌کند و به ``tp_call`` بازنمی‌گردد." msgid "Object Calling API" -msgstr "" +msgstr "API فراخوانی شیء" -msgid "Various functions are available for calling a Python object. Each converts its arguments to a convention supported by the called object – either *tp_call* or vectorcall. In order to do as little conversion as possible, pick one that best fits the format of data you have available." +msgid "" +"Various functions are available for calling a Python object. Each converts " +"its arguments to a convention supported by the called object – either " +"*tp_call* or vectorcall. In order to do as little conversion as possible, " +"pick one that best fits the format of data you have available." msgstr "" +"توابع گوناگونی برای فراخوانی یک شیء پایتون در دسترس هستند. هر یک از این " +"توابع، آرگومان‌های خود را به قراردادی که شیء فراخوانی‌شده از آن پشتیبانی " +"می‌کند — یعنی *tp_call* یا vectorcall — تبدیل می‌کند. برای انجام کمترین " +"تبدیل ممکن، تابعی را انتخاب کنید که بهترین تناسب را با قالب داده‌های در " +"دسترس شما دارد." -msgid "The following table summarizes the available functions; please see individual documentation for details." +msgid "" +"The following table summarizes the available functions; please see " +"individual documentation for details." msgstr "" +"جدول زیر خلاصه‌ای از توابع موجود را ارائه می‌دهد؛ برای جزئیات، لطفاً به " +"مستندات هر یک مراجعه کنید." msgid "Function" -msgstr "" +msgstr "تابع" msgid "callable" -msgstr "" +msgstr "فراخوانی‌پذیر" msgid "args" -msgstr "" +msgstr "args" msgid "kwargs" -msgstr "" +msgstr "kwargs" msgid ":c:func:`PyObject_Call`" -msgstr "" +msgstr ":c:func:`PyObject_Call`" msgid "``PyObject *``" -msgstr "" +msgstr "``PyObject *``" msgid "tuple" -msgstr "" +msgstr "تاپل" msgid "dict/``NULL``" -msgstr "" +msgstr "dict/``NULL``" msgid ":c:func:`PyObject_CallNoArgs`" -msgstr "" +msgstr ":c:func:`PyObject_CallNoArgs`" msgid "---" -msgstr "" +msgstr "---" msgid ":c:func:`PyObject_CallOneArg`" -msgstr "" +msgstr ":c:func:`PyObject_CallOneArg`" msgid "1 object" -msgstr "" +msgstr "۱ شیء" msgid ":c:func:`PyObject_CallObject`" -msgstr "" +msgstr ":c:func:`PyObject_CallObject`" msgid "tuple/``NULL``" -msgstr "" +msgstr "تاپل/``NULL``" msgid ":c:func:`PyObject_CallFunction`" -msgstr "" +msgstr ":c:func:`PyObject_CallFunction`" msgid "format" -msgstr "" +msgstr "قالب" msgid ":c:func:`PyObject_CallMethod`" -msgstr "" +msgstr ":c:func:`PyObject_CallMethod`" msgid "obj + ``char*``" -msgstr "" +msgstr "obj + ``char*``" msgid ":c:func:`PyObject_CallFunctionObjArgs`" -msgstr "" +msgstr ":c:func:`PyObject_CallFunctionObjArgs`" msgid "variadic" -msgstr "" +msgstr "با تعداد متغیر (variadic)" msgid ":c:func:`PyObject_CallMethodObjArgs`" -msgstr "" +msgstr ":c:func:`PyObject_CallMethodObjArgs`" msgid "obj + name" -msgstr "" +msgstr "obj + name" msgid ":c:func:`PyObject_CallMethodNoArgs`" -msgstr "" +msgstr ":c:func:`PyObject_CallMethodNoArgs`" msgid ":c:func:`PyObject_CallMethodOneArg`" -msgstr "" +msgstr ":c:func:`PyObject_CallMethodOneArg`" msgid ":c:func:`PyObject_Vectorcall`" -msgstr "" +msgstr ":c:func:`PyObject_Vectorcall`" msgid "vectorcall" -msgstr "" +msgstr "فراخوانی برداری (vectorcall)" msgid ":c:func:`PyObject_VectorcallDict`" -msgstr "" +msgstr ":c:func:`PyObject_VectorcallDict`" msgid ":c:func:`PyObject_VectorcallMethod`" -msgstr "" +msgstr ":c:func:`PyObject_VectorcallMethod`" msgid "arg + name" -msgstr "" +msgstr "arg + name" -msgid "Call a callable Python object *callable*, with arguments given by the tuple *args*, and named arguments given by the dictionary *kwargs*." +msgid "" +"Call a callable Python object *callable*, with arguments given by the tuple " +"*args*, and named arguments given by the dictionary *kwargs*." msgstr "" +"شیء فراخوانی‌پذیر پایتون *callable* را با آرگومان‌هایی که توسط تاپل *args* " +"داده شده‌اند و آرگومان‌های نام‌داری که توسط دیکشنری *kwargs* داده شده‌اند، " +"فراخوانی می‌کند." -msgid "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If no named arguments are needed, *kwargs* can be *NULL*." +msgid "" +"*args* must not be *NULL*; use an empty tuple if no arguments are needed. If" +" no named arguments are needed, *kwargs* can be *NULL*." msgstr "" +"*args* نباید *NULL* باشد؛ اگر هیچ آرگومانی لازم نیست، از یک تاپل خالی " +"استفاده کنید. اگر هیچ آرگومان نام‌داری لازم نیست، *kwargs* می‌تواند *NULL* " +"باشد." -msgid "Return the result of the call on success, or raise an exception and return *NULL* on failure." +msgid "" +"Return the result of the call on success, or raise an exception and return " +"*NULL* on failure." msgstr "" +"در صورت موفقیت، نتیجه‌ی فراخوانی را برمی‌گرداند، یا در صورت شکست، استثنا " +"ایجاد کرده و *NULL* را برمی‌گرداند." -msgid "This is the equivalent of the Python expression: ``callable(*args, **kwargs)``." -msgstr "" +msgid "" +"This is the equivalent of the Python expression: ``callable(*args, " +"**kwargs)``." +msgstr "این معادل عبارت پایتونی ``callable(*args, **kwargs)`` است." -msgid "Call a callable Python object *callable* without any arguments. It is the most efficient way to call a callable Python object without any argument." +msgid "" +"Call a callable Python object *callable* without any arguments. It is the " +"most efficient way to call a callable Python object without any argument." msgstr "" +"یک شیء پایتونی فراخوانی‌پذیر *callable* را بدون هیچ آرگومانی فراخوانی " +"می‌کند. این کارآمدترین راه برای فراخوانی یک شیء پایتونی فراخوانی‌پذیر بدون " +"هیچ آرگومانی است." -msgid "Call a callable Python object *callable* with exactly 1 positional argument *arg* and no keyword arguments." +msgid "" +"Call a callable Python object *callable* with exactly 1 positional argument " +"*arg* and no keyword arguments." msgstr "" +"یک شیء فراخوانی‌پذیر پایتون *callable* را با دقیقاً ۱ آرگومان جایگاهی *arg* " +"و بدون هیچ آرگومان کلیدواژه‌ای فراخوانی می‌کند." -msgid "Call a callable Python object *callable*, with arguments given by the tuple *args*. If no arguments are needed, then *args* can be *NULL*." +msgid "" +"Call a callable Python object *callable*, with arguments given by the tuple " +"*args*. If no arguments are needed, then *args* can be *NULL*." msgstr "" +"شیء فراخوانی‌پذیر پایتون *callable* را با آرگومان‌های داده‌شده توسط تاپل " +"*args* فراخوانی می‌کند. اگر نیازی به آرگومان نباشد، *args* می‌تواند *NULL* " +"باشد." msgid "This is the equivalent of the Python expression: ``callable(*args)``." -msgstr "" +msgstr "این معادل عبارت زیر در پایتون است: ``callable(*args)``." -msgid "Call a callable Python object *callable*, with a variable number of C arguments. The C arguments are described using a :c:func:`Py_BuildValue` style format string. The format can be *NULL*, indicating that no arguments are provided." +msgid "" +"Call a callable Python object *callable*, with a variable number of C " +"arguments. The C arguments are described using a :c:func:`Py_BuildValue` " +"style format string. The format can be *NULL*, indicating that no arguments" +" are provided." msgstr "" +"شیء پایتون فراخوانی‌پذیر *callable* را با تعداد متغیری از آرگومان‌های C " +"فراخوانی می‌کند. آرگومان‌های C با استفاده از رشته قالب به سبک " +":c:func:`Py_BuildValue` توصیف می‌شوند. قالب می‌تواند *NULL* باشد که نشان " +"می‌دهد هیچ آرگومانی ارائه نشده است." -msgid "Note that if you only pass :c:expr:`PyObject *` args, :c:func:`PyObject_CallFunctionObjArgs` is a faster alternative." +msgid "" +"Note that if you only pass :c:expr:`PyObject *` args, " +":c:func:`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" +"توجه داشته باشید که اگر فقط آرگومان‌های :c:expr:`PyObject *` را ارسال کنید، " +":c:func:`PyObject_CallFunctionObjArgs` جایگزین سریع‌تری است." msgid "The type of *format* was changed from ``char *``." -msgstr "" +msgstr "نوع *format* از ``char *`` تغییر کرد." -msgid "Call the method named *name* of object *obj* with a variable number of C arguments. The C arguments are described by a :c:func:`Py_BuildValue` format string that should produce a tuple." +msgid "" +"Call the method named *name* of object *obj* with a variable number of C " +"arguments. The C arguments are described by a :c:func:`Py_BuildValue` " +"format string that should produce a tuple." msgstr "" +"متدی با نام *name* از شیء *obj* را با تعداد متغیری از آرگومان‌های C فراخوانی" +" می‌کند. آرگومان‌های C توسط یک رشته قالب :c:func:`Py_BuildValue` توصیف " +"می‌شوند که باید یک تاپل تولید کند." msgid "The format can be *NULL*, indicating that no arguments are provided." -msgstr "" +msgstr "قالب می‌تواند *NULL* باشد که نشان می‌دهد هیچ آرگومانی ارائه نمی‌شود." -msgid "This is the equivalent of the Python expression: ``obj.name(arg1, arg2, ...)``." -msgstr "" +msgid "" +"This is the equivalent of the Python expression: ``obj.name(arg1, arg2, " +"...)``." +msgstr "این معادل عبارت پایتون ``obj.name(arg1, arg2, ...)`` است." -msgid "Note that if you only pass :c:expr:`PyObject *` args, :c:func:`PyObject_CallMethodObjArgs` is a faster alternative." +msgid "" +"Note that if you only pass :c:expr:`PyObject *` args, " +":c:func:`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" +"توجه داشته باشید که اگر تنها آرگومان‌هایی از نوع :c:expr:`PyObject *` را " +"عبور می‌دهید، :c:func:`PyObject_CallMethodObjArgs` جایگزین سریع‌تری است." msgid "The types of *name* and *format* were changed from ``char *``." -msgstr "" +msgstr "نوع‌های *name* و *format* از ``char *`` تغییر یافتند." -msgid "Call a callable Python object *callable*, with a variable number of :c:expr:`PyObject *` arguments. The arguments are provided as a variable number of parameters followed by *NULL*." +msgid "" +"Call a callable Python object *callable*, with a variable number of " +":c:expr:`PyObject *` arguments. The arguments are provided as a variable " +"number of parameters followed by *NULL*." msgstr "" +"یک شیء پایتونی فراخوانی‌پذیر *callable* را با تعداد متغیری آرگومان " +":c:expr:`PyObject *` فراخوانی می‌کند. آرگومان‌ها به‌صورت تعداد متغیری " +"پارامتر و به‌دنبال آن *NULL* ارائه می‌شوند." -msgid "This is the equivalent of the Python expression: ``callable(arg1, arg2, ...)``." -msgstr "" +msgid "" +"This is the equivalent of the Python expression: ``callable(arg1, arg2, " +"...)``." +msgstr "این معادل عبارت پایتون ``callable(arg1, arg2, ...)`` است." -msgid "Call a method of the Python object *obj*, where the name of the method is given as a Python string object in *name*. It is called with a variable number of :c:expr:`PyObject *` arguments. The arguments are provided as a variable number of parameters followed by *NULL*." +msgid "" +"Call a method of the Python object *obj*, where the name of the method is " +"given as a Python string object in *name*. It is called with a variable " +"number of :c:expr:`PyObject *` arguments. The arguments are provided as a " +"variable number of parameters followed by *NULL*." msgstr "" +"متدی از شیء پایتونی *obj* را فراخوانی می‌کند که نام آن به‌صورت یک شیء رشته " +"پایتون در *name* داده شده است. این متد با تعداد متغیری از آرگومان‌های " +":c:expr:`PyObject *` فراخوانی می‌شود. آرگومان‌ها به‌صورت تعداد متغیری از " +"پارامترها و در پایان *NULL* ارائه می‌شوند." -msgid "Call a method of the Python object *obj* without arguments, where the name of the method is given as a Python string object in *name*." +msgid "" +"Call a method of the Python object *obj* without arguments, where the name " +"of the method is given as a Python string object in *name*." msgstr "" +"متدی از شیء پایتون *obj* را بدون آرگومان فراخوانی می‌کند، که در آن نام متد " +"به‌صورت یک شیء رشته پایتون در *name* داده شده است." -msgid "Call a method of the Python object *obj* with a single positional argument *arg*, where the name of the method is given as a Python string object in *name*." +msgid "" +"Call a method of the Python object *obj* with a single positional argument " +"*arg*, where the name of the method is given as a Python string object in " +"*name*." msgstr "" +"متدی از شیء پایتون *obj* را با تنها یک آرگومان جایگاهی *arg* فراخوانی " +"می‌کند، که نام متد به‌صورت یک شیء رشته پایتون در *name* داده می‌شود." -msgid "Call a callable Python object *callable*. The arguments are the same as for :c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly calls the vectorcall function stored in *callable*." +msgid "" +"Call a callable Python object *callable*. The arguments are the same as for " +":c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " +"calls the vectorcall function stored in *callable*." msgstr "" +"شیء پایتونی فراخوانی‌پذیر *callable* را فراخوانی می‌کند. آرگومان‌ها همانند " +"آرگومان‌های :c:type:`vectorcallfunc` هستند. اگر *callable* از vectorcall_ " +"پشتیبانی کند، این تابع مستقیماً تابع vectorcall ذخیره‌شده در *callable* را " +"فراخوانی می‌کند." msgid "as ``_PyObject_Vectorcall``" -msgstr "" +msgstr "به‌عنوان ``_PyObject_Vectorcall``" -msgid "Renamed to the current name, without the leading underscore. The old provisional name is :term:`soft deprecated`." +msgid "" +"Renamed to the current name, without the leading underscore. The old " +"provisional name is :term:`soft deprecated`." msgstr "" +"به نام کنونی تغییر نام داده شد، بدون زیرخط ابتدایی. نام آزمایشی قبلی " +":term:`soft deprecated` است." -msgid "Call *callable* with positional arguments passed exactly as in the vectorcall_ protocol, but with keyword arguments passed as a dictionary *kwdict*. The *args* array contains only the positional arguments." +msgid "" +"Call *callable* with positional arguments passed exactly as in the " +"vectorcall_ protocol, but with keyword arguments passed as a dictionary " +"*kwdict*. The *args* array contains only the positional arguments." msgstr "" +"فراخوانی‌پذیر *callable* را با آرگومان‌های جایگاهی که دقیقاً مطابق پروتکل " +"vectorcall_ ارسال می‌شوند فراخوانی می‌کند، اما آرگومان‌های کلیدواژه‌ای " +"به‌صورت دیکشنری *kwdict* ارسال می‌شوند. آرایه *args* فقط شامل آرگومان‌های " +"جایگاهی است." -msgid "Regardless of which protocol is used internally, a conversion of arguments needs to be done. Therefore, this function should only be used if the caller already has a dictionary ready to use for the keyword arguments, but not a tuple for the positional arguments." +msgid "" +"Regardless of which protocol is used internally, a conversion of arguments " +"needs to be done. Therefore, this function should only be used if the caller" +" already has a dictionary ready to use for the keyword arguments, but not a " +"tuple for the positional arguments." msgstr "" +"صرف‌نظر از اینکه کدام پروتکل به‌طور داخلی استفاده می‌شود، باید تبدیلی روی " +"آرگومان‌ها انجام شود. بنابراین، این تابع تنها زمانی باید استفاده شود که " +"فراخوان‌کننده از قبل دیکشنری آماده‌ای برای آرگومان‌های کلیدواژه‌ای داشته " +"باشد، اما تاپلی برای آرگومان‌های جایگاهی نداشته باشد." -msgid "Call a method using the vectorcall calling convention. The name of the method is given as a Python string *name*. The object whose method is called is *args[0]*, and the *args* array starting at *args[1]* represents the arguments of the call. There must be at least one positional argument. *nargsf* is the number of positional arguments including *args[0]*, plus :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may temporarily be changed. Keyword arguments can be passed just like in :c:func:`PyObject_Vectorcall`." -msgstr "" +msgid "" +"Call a method using the vectorcall calling convention. The name of the " +"method is given as a Python string *name*. The object whose method is called" +" is *args[0]*, and the *args* array starting at *args[1]* represents the " +"arguments of the call. There must be at least one positional argument. " +"*nargsf* is the number of positional arguments including *args[0]*, plus " +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " +"temporarily be changed. Keyword arguments can be passed just like in " +":c:func:`PyObject_Vectorcall`." +msgstr "" +"یک متد را با استفاده از قرارداد فراخوانی vectorcall فراخوانی کنید. نام متد " +"به صورت رشته پایتون *name* داده می‌شود. شیئی که متد آن فراخوانی می‌شود " +"*args[0]* است و آرایه *args* که از *args[1]* آغاز می‌شود، آرگومان‌های " +"فراخوانی را نشان می‌دهد. باید حداقل یک آرگومان جایگاهی وجود داشته باشد. " +"*nargsf* تعداد آرگومان‌های جایگاهی شامل *args[0]* است، به‌علاوه " +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` در صورتی که مقدار ``args[0]`` ممکن" +" است به‌طور موقت تغییر کند. آرگومان‌های کلیدواژه‌ای را می‌توان دقیقاً مشابه " +":c:func:`PyObject_Vectorcall` ارسال کرد." -msgid "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this will call the unbound method object with the full *args* vector as arguments." +msgid "" +"If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " +"will call the unbound method object with the full *args* vector as " +"arguments." msgstr "" +"اگر شیء قابلیت :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` را داشته باشد، این، " +"شیء متد غیرمقید را با بردار کامل *args* به‌عنوان آرگومان‌ها فراخوانی می‌کند." msgid "Call Support API" -msgstr "" +msgstr "API پشتیبانی فراخوانی" -msgid "Determine if the object *o* is callable. Return ``1`` if the object is callable and ``0`` otherwise. This function always succeeds." +msgid "" +"Determine if the object *o* is callable. Return ``1`` if the object is " +"callable and ``0`` otherwise. This function always succeeds." msgstr "" +"تعیین می‌کند که آیا شیء *o* فراخوانی‌پذیر است یا خیر. اگر شیء فراخوانی‌پذیر " +"باشد ``1`` و در غیر این صورت ``0`` را برمی‌گرداند. این تابع همیشه با موفقیت " +"اجرا می‌شود." diff --git a/c-api/capsule.po b/c-api/capsule.po index 98619c925..e414bf678 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -23,109 +23,256 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Capsules" -msgstr "" +msgstr "کپسول‌ها (Capsules)" -msgid "Refer to :ref:`using-capsules` for more information on using these objects." +msgid "" +"Refer to :ref:`using-capsules` for more information on using these objects." msgstr "" +"برای اطلاعات بیشتر درباره استفاده از این اشیاء، به :ref:`using-capsules` " +"مراجعه کنید." -msgid "This subtype of :c:type:`PyObject` represents an opaque value, useful for C extension modules which need to pass an opaque value (as a :c:expr:`void*` pointer) through Python code to other C code. It is often used to make a C function pointer defined in one module available to other modules, so the regular import mechanism can be used to access C APIs defined in dynamically loaded modules." -msgstr "" +msgid "" +"This subtype of :c:type:`PyObject` represents an opaque value, useful for C " +"extension modules which need to pass an opaque value (as a :c:expr:`void*` " +"pointer) through Python code to other C code. It is often used to make a C " +"function pointer defined in one module available to other modules, so the " +"regular import mechanism can be used to access C APIs defined in dynamically" +" loaded modules." +msgstr "" +"این زیرنوع از :c:type:`PyObject` نمایانگر یک مقدار مات (opaque) است و برای " +"ماژول‌های توسعه‌ای C که نیاز دارند مقداری مات را (به‌صورت اشاره‌گر " +":c:expr:`void*`) از طریق کد پایتون به کد C دیگری منتقل کنند، مفید است. این " +"نوع اغلب برای در اختیار ماژول‌های دیگر قرار دادن اشاره‌گر تابع C تعریف‌شده " +"در یک ماژول استفاده می‌شود، به‌طوری که بتوان از سازوکار ایمپورت معمول برای " +"دسترسی به APIهای C تعریف‌شده در ماژول‌های بارگذاری‌شده به‌صورت پویا استفاده " +"کرد." -msgid "The type object corresponding to capsule objects. This is the same object as :class:`types.CapsuleType` in the Python layer." +msgid "" +"The type object corresponding to capsule objects. This is the same object as" +" :class:`types.CapsuleType` in the Python layer." msgstr "" +"شیء نوعِ متناظر با شیءهای کپسول. این همان شیء :class:`types.CapsuleType` در " +"لایه‌ی پایتون است." msgid "The type of a destructor callback for a capsule. Defined as::" -msgstr "" +msgstr "نوع کال‌بک مخرب برای یک کپسول. به صورت زیر تعریف می‌شود::" msgid "typedef void (*PyCapsule_Destructor)(PyObject *);" -msgstr "" +msgstr "typedef void (*PyCapsule_Destructor)(PyObject *);" -msgid "See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor callbacks." +msgid "" +"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor " +"callbacks." msgstr "" +"برای آگاهی از معناشناسی کال‌بک‌های PyCapsule_Destructor به " +":c:func:`PyCapsule_New` مراجعه کنید." -msgid "Return true if its argument is a :c:type:`PyCapsule`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyCapsule`. This function always " +"succeeds." msgstr "" +"اگر آرگومان آن یک :c:type:`PyCapsule` باشد، مقدار true را برمی‌گرداند. این " +"تابع همیشه با موفقیت اجرا می‌شود." -msgid "Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* argument may not be ``NULL``." +msgid "" +"Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* " +"argument may not be ``NULL``." msgstr "" +"یک :c:type:`PyCapsule` ایجاد می‌کند که *اشاره‌گر* را کپسوله می‌کند. آرگومان " +"*اشاره‌گر* نمی‌تواند ``NULL`` باشد." msgid "On failure, set an exception and return ``NULL``." -msgstr "" +msgstr "در صورت شکست، یک استثنا تنظیم کرده و ``NULL`` را برگردانید." -msgid "The *name* string may either be ``NULL`` or a pointer to a valid C string. If non-``NULL``, this string must outlive the capsule. (Though it is permitted to free it inside the *destructor*.)" +msgid "" +"The *name* string may either be ``NULL`` or a pointer to a valid C string. " +"If non-``NULL``, this string must outlive the capsule. (Though it is " +"permitted to free it inside the *destructor*.)" msgstr "" +"رشته *name* می‌تواند ``NULL`` یا اشاره‌گری به یک رشته C معتبر باشد. اگر " +"``NULL`` نباشد، این رشته باید بیشتر از کپسول عمر کند. (هرچند آزاد کردن آن " +"درون *مخرب* مجاز است.)" -msgid "If the *destructor* argument is not ``NULL``, it will be called with the capsule as its argument when it is destroyed." +msgid "" +"If the *destructor* argument is not ``NULL``, it will be called with the " +"capsule as its argument when it is destroyed." msgstr "" +"اگر آرگومان *مخرب* ``NULL`` نباشد، هنگامی که کپسول نابود می‌شود، با کپسول " +"به‌عنوان آرگومان آن فراخوانی خواهد شد." -msgid "If this capsule will be stored as an attribute of a module, the *name* should be specified as ``modulename.attributename``. This will enable other modules to import the capsule using :c:func:`PyCapsule_Import`." +msgid "" +"If this capsule will be stored as an attribute of a module, the *name* " +"should be specified as ``modulename.attributename``. This will enable other" +" modules to import the capsule using :c:func:`PyCapsule_Import`." msgstr "" +"اگر این کپسول قرار است به‌عنوان ویژگی یک ماژول ذخیره شود، *نام* باید به‌صورت" +" ``modulename.attributename`` مشخص شود. این کار به ماژول‌های دیگر امکان " +"می‌دهد کپسول را با استفاده از :c:func:`PyCapsule_Import` ایمپورت کنند." -msgid "Retrieve the *pointer* stored in the capsule. On failure, set an exception and return ``NULL``." +msgid "" +"Retrieve the *pointer* stored in the capsule. On failure, set an exception " +"and return ``NULL``." msgstr "" +"*اشاره‌گر* ذخیره‌شده در کپسول را بازیابی می‌کند. در صورت شکست، یک استثنا " +"تنظیم می‌کند و ``NULL`` را برمی‌گرداند." -msgid "The *name* parameter must compare exactly to the name stored in the capsule. If the name stored in the capsule is ``NULL``, the *name* passed in must also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare capsule names." +msgid "" +"The *name* parameter must compare exactly to the name stored in the capsule." +" If the name stored in the capsule is ``NULL``, the *name* passed in must " +"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare " +"capsule names." msgstr "" +"پارامتر *name* باید دقیقاً با نام ذخیره‌شده در کپسول مقایسه شود. اگر نام " +"ذخیره‌شده در کپسول ``NULL`` باشد، *name* گذرانده‌شده نیز باید ``NULL`` باشد." +" پایتون برای مقایسه‌ی نام کپسول‌ها از تابع C :c:func:`!strcmp` استفاده " +"می‌کند." -msgid "Return the current destructor stored in the capsule. On failure, set an exception and return ``NULL``." +msgid "" +"Return the current destructor stored in the capsule. On failure, set an " +"exception and return ``NULL``." msgstr "" +"مخرب (destructor) فعلی ذخیره‌شده در کپسول را بازمی‌گرداند. در صورت شکست، یک " +"استثنا تنظیم کرده و ``NULL`` را بازمی‌گرداند." -msgid "It is legal for a capsule to have a ``NULL`` destructor. This makes a ``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"It is legal for a capsule to have a ``NULL`` destructor. This makes a " +"``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or " +":c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"داشتن مخرب ``NULL`` برای یک کپسول مجاز است. این امر کد بازگشتی ``NULL`` را " +"تا حدی مبهم می‌کند؛ برای رفع ابهام، از :c:func:`PyCapsule_IsValid` یا " +":c:func:`PyErr_Occurred` استفاده کنید." -msgid "Return the current context stored in the capsule. On failure, set an exception and return ``NULL``." +msgid "" +"Return the current context stored in the capsule. On failure, set an " +"exception and return ``NULL``." msgstr "" +"زمینه فعلی ذخیره‌شده در کپسول را بازمی‌گرداند. در صورت شکست، یک استثنا تنظیم" +" کرده و ``NULL`` را بازمی‌گرداند." -msgid "It is legal for a capsule to have a ``NULL`` context. This makes a ``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"It is legal for a capsule to have a ``NULL`` context. This makes a ``NULL``" +" return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or " +":c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"داشتن زمینه ``NULL`` برای یک کپسول مجاز است. این امر کد بازگشتی ``NULL`` را " +"تا حدی مبهم می‌کند؛ برای رفع ابهام از :c:func:`PyCapsule_IsValid` یا " +":c:func:`PyErr_Occurred` استفاده کنید." -msgid "Return the current name stored in the capsule. On failure, set an exception and return ``NULL``." +msgid "" +"Return the current name stored in the capsule. On failure, set an exception" +" and return ``NULL``." msgstr "" +"نام فعلی ذخیره‌شده در کپسول را برمی‌گرداند. در صورت شکست، یک استثنا تنظیم " +"کرده و ``NULL`` را برمی‌گرداند." -msgid "It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` " +"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or " +":c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"مجاز است که یک کپسول نام ``NULL`` داشته باشد. این امر کد بازگشتی ``NULL`` را" +" تا حدی مبهم می‌کند؛ برای رفع ابهام، از :c:func:`PyCapsule_IsValid` یا " +":c:func:`PyErr_Occurred` استفاده کنید." -msgid "Import a pointer to a C object from a capsule attribute in a module. The *name* parameter should specify the full name to the attribute, as in ``module.attribute``. The *name* stored in the capsule must match this string exactly." +msgid "" +"Import a pointer to a C object from a capsule attribute in a module. The " +"*name* parameter should specify the full name to the attribute, as in " +"``module.attribute``. The *name* stored in the capsule must match this " +"string exactly." msgstr "" +"اشاره‌گر به یک شیء C را از یک ویژگی کپسول در یک ماژول ایمپورت می‌کند. " +"پارامتر *name* باید نام کامل ویژگی را مشخص کند، مانند ``module.attribute``. " +"*name* ذخیره‌شده در کپسول باید دقیقاً با این رشته مطابقت داشته باشد." -msgid "This function splits *name* on the ``.`` character, and imports the first element. It then processes further elements using attribute lookups." +msgid "" +"This function splits *name* on the ``.`` character, and imports the first " +"element. It then processes further elements using attribute lookups." msgstr "" +"این تابع *name* را بر اساس نویسه‌ی ``.`` تجزیه می‌کند و اولین عنصر را " +"ایمپورت می‌کند. سپس عناصر بعدی را با استفاده از جستجوهای ویژگی پردازش " +"می‌کند." -msgid "Return the capsule's internal *pointer* on success. On failure, set an exception and return ``NULL``." +msgid "" +"Return the capsule's internal *pointer* on success. On failure, set an " +"exception and return ``NULL``." msgstr "" +"در صورت موفقیت، *اشاره‌گر* داخلی کپسول را برمی‌گرداند. در صورت شکست، یک " +"استثنا تنظیم کرده و ``NULL`` برمی‌گرداند." -msgid "If *name* points to an attribute of some submodule or subpackage, this submodule or subpackage must be previously imported using other means (for example, by using :c:func:`PyImport_ImportModule`) for the attribute lookups to succeed." +msgid "" +"If *name* points to an attribute of some submodule or subpackage, this " +"submodule or subpackage must be previously imported using other means (for " +"example, by using :c:func:`PyImport_ImportModule`) for the attribute lookups" +" to succeed." msgstr "" +"اگر *name* به ویژگی‌ای از یک زیرماژول یا زیربسته اشاره کند، این زیرماژول یا " +"زیربسته باید پیش‌تر به روشی دیگر ایمپورت شده باشد (برای مثال، با استفاده از " +":c:func:`PyImport_ImportModule`) تا جستجوی ویژگی‌ها با موفقیت انجام شود." msgid "*no_block* has no effect anymore." -msgstr "" +msgstr "*no_block* دیگر هیچ تأثیری ندارد." -msgid "Determines whether or not *capsule* is a valid capsule. A valid capsule is non-``NULL``, passes :c:func:`PyCapsule_CheckExact`, has a non-``NULL`` pointer stored in it, and its internal name matches the *name* parameter. (See :c:func:`PyCapsule_GetPointer` for information on how capsule names are compared.)" -msgstr "" +msgid "" +"Determines whether or not *capsule* is a valid capsule. A valid capsule is " +"non-``NULL``, passes :c:func:`PyCapsule_CheckExact`, has a non-``NULL`` " +"pointer stored in it, and its internal name matches the *name* parameter. " +"(See :c:func:`PyCapsule_GetPointer` for information on how capsule names are" +" compared.)" +msgstr "" +"تعیین می‌کند که *capsule* یک کپسول معتبر است یا خیر. یک کپسول معتبر غیر " +"``NULL`` است، از :c:func:`PyCapsule_CheckExact` عبور می‌کند، اشاره‌گری غیر " +"``NULL`` در آن ذخیره شده است، و نام داخلی آن با پارامتر *name* مطابقت دارد. " +"(برای اطلاعات درباره‌ی نحوه‌ی مقایسه‌ی نام‌های کپسول، " +":c:func:`PyCapsule_GetPointer` را ببینید.)" -msgid "In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls to any of the accessors (any function starting with ``PyCapsule_Get``) are guaranteed to succeed." +msgid "" +"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls " +"to any of the accessors (any function starting with ``PyCapsule_Get``) are " +"guaranteed to succeed." msgstr "" +"به عبارت دیگر، اگر :c:func:`PyCapsule_IsValid` مقداری درست (true) برگرداند، " +"موفقیت فراخوانی هر یک از دسترسی‌دهنده‌ها (accessor) (هر تابعی که با " +"``PyCapsule_Get`` شروع می‌شود) تضمین می‌شود." -msgid "Return a nonzero value if the object is valid and matches the name passed in. Return ``0`` otherwise. This function will not fail." +msgid "" +"Return a nonzero value if the object is valid and matches the name passed " +"in. Return ``0`` otherwise. This function will not fail." msgstr "" +"اگر شیء معتبر باشد و با نام ارسال‌شده مطابقت داشته باشد، مقدار ناصفر " +"بازگردانده می‌شود. در غیر این صورت ``0`` بازگردانده می‌شود. این تابع شکست " +"نخواهد خورد." msgid "Set the context pointer inside *capsule* to *context*." -msgstr "" +msgstr "اشاره‌گر زمینه درون *capsule* را برابر *context* قرار می‌دهد." -msgid "Return ``0`` on success. Return nonzero and set an exception on failure." +msgid "" +"Return ``0`` on success. Return nonzero and set an exception on failure." msgstr "" +"در صورت موفقیت ``0`` را برمی‌گرداند. در صورت شکست، مقداری غیر از صفر " +"برمی‌گرداند و یک استثنا تنظیم می‌کند." msgid "Set the destructor inside *capsule* to *destructor*." -msgstr "" +msgstr "مخرب درون *capsule* را برابر *destructor* قرار دهید." -msgid "Set the name inside *capsule* to *name*. If non-``NULL``, the name must outlive the capsule. If the previous *name* stored in the capsule was not ``NULL``, no attempt is made to free it." +msgid "" +"Set the name inside *capsule* to *name*. If non-``NULL``, the name must " +"outlive the capsule. If the previous *name* stored in the capsule was not " +"``NULL``, no attempt is made to free it." msgstr "" +"نام داخل *capsule* را برابر *name* قرار می‌دهد. اگر ``NULL`` نباشد، نام باید" +" از کپسول عمر بیشتری داشته باشد. اگر *name* قبلیِ ذخیره‌شده در کپسول " +"``NULL`` نبوده باشد، هیچ تلاشی برای آزاد کردن آن صورت نمی‌گیرد." -msgid "Set the void pointer inside *capsule* to *pointer*. The pointer may not be ``NULL``." +msgid "" +"Set the void pointer inside *capsule* to *pointer*. The pointer may not be " +"``NULL``." msgstr "" +"اشاره‌گر void درون *capsule* را برابر *pointer* قرار می‌دهد. این اشاره‌گر " +"نمی‌تواند ``NULL`` باشد." msgid "object" -msgstr "" +msgstr "شیء" msgid "Capsule" -msgstr "" +msgstr "کپسول (Capsule)" diff --git a/c-api/cell.po b/c-api/cell.po index ee3a9bf4c..cca4854ce 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -22,34 +22,84 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Cell Objects" -msgstr "" +msgstr "شیءهای سلول (Cell)" -msgid "\"Cell\" objects are used to implement variables referenced by multiple scopes. For each such variable, a cell object is created to store the value; the local variables of each stack frame that references the value contain a reference to the cells from outer scopes which also use that variable. When the value is accessed, the value contained in the cell is used instead of the cell object itself. This de-referencing of the cell object requires support from the generated byte-code; these are not automatically de-referenced when accessed. Cell objects are not likely to be useful elsewhere." +msgid "" +"\"Cell\" objects are used to implement variables referenced by multiple " +"scopes. For each such variable, a cell object is created to store the value;" +" the local variables of each stack frame that references the value contain a" +" reference to the cells from outer scopes which also use that variable. " +"When the value is accessed, the value contained in the cell is used instead " +"of the cell object itself. This de-referencing of the cell object requires " +"support from the generated byte-code; these are not automatically de-" +"referenced when accessed. Cell objects are not likely to be useful " +"elsewhere." msgstr "" +"از اشیاء \"Cell\" برای پیاده‌سازی متغیرهایی استفاده می‌شود که توسط چندین " +"محدوده به آن‌ها ارجاع می‌شود. برای هر یک از چنین متغیرهایی، یک شیء سلول برای" +" ذخیره‌ی مقدار ایجاد می‌شود؛ متغیرهای محلیِ هر فریم پشته (stack frame) که به" +" این مقدار ارجاع می‌کند، ارجاعی به سلول‌های محدوده‌های بیرونی‌ای که آن " +"محدوده‌ها نیز از آن متغیر استفاده می‌کنند را در خود دارند. هنگامی که به " +"مقدار دسترسی می‌شود، مقدارِ موجود در سلول به‌جای خودِ شیء سلول استفاده " +"می‌شود. این ارجاع‌زدایی (de-referencing) از شیء سلول نیازمند پشتیبانی از سوی" +" بایت‌کدِ تولیدشده است؛ این اشیاء هنگام دسترسی به‌طور خودکار ارجاع‌زدایی " +"نمی‌شوند. اشیاء سلول به احتمال زیاد در جای دیگری مفید نخواهند بود." msgid "The C structure used for cell objects." -msgstr "" +msgstr "ساختار C استفاده‌شده برای شیءهای سلول (cell)." msgid "The type object corresponding to cell objects." -msgstr "" +msgstr "شیء نوعِ متناظر با شیءهای سلول (cell)." -msgid "Return true if *ob* is a cell object; *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is a cell object; *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" +"اگر *ob* یک شیء سلول (cell) باشد، true را برمی‌گرداند؛ *ob* نباید ``NULL`` " +"باشد. این تابع همیشه موفق است." -msgid "Create and return a new cell object containing the value *ob*. The parameter may be ``NULL``." +msgid "" +"Create and return a new cell object containing the value *ob*. The parameter" +" may be ``NULL``." msgstr "" +"یک شیء سلول جدید حاوی مقدار *ob* ایجاد کنید و آن را برگردانید. این پارامتر " +"می‌تواند ``NULL`` باشد." -msgid "Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is not a cell object, returns ``NULL`` with an exception set." +msgid "" +"Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is " +"not a cell object, returns ``NULL`` with an exception set." msgstr "" +"محتویات سلول *cell* را برمی‌گرداند که می‌تواند ``NULL`` باشد. اگر *cell* یک " +"شیء سلول نباشد، ``NULL`` همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "Return the contents of the cell *cell*, but without checking that *cell* is non-``NULL`` and a cell object." +msgid "" +"Return the contents of the cell *cell*, but without checking that *cell* is " +"non-``NULL`` and a cell object." msgstr "" +"محتوای سلول *cell* را بازمی‌گرداند، اما بدون بررسی اینکه *cell* غیر ``NULL``" +" و یک شیء سلول باشد." -msgid "Set the contents of the cell object *cell* to *value*. This releases the reference to any current content of the cell. *value* may be ``NULL``. *cell* must be non-``NULL``." +msgid "" +"Set the contents of the cell object *cell* to *value*. This releases the " +"reference to any current content of the cell. *value* may be ``NULL``. " +"*cell* must be non-``NULL``." msgstr "" +"محتوای شیء سلول *cell* را بر *value* قرار می‌دهد. این کار، ارجاع به هر " +"محتوای فعلی سلول را آزاد می‌کند. *value* می‌تواند ``NULL`` باشد. *cell* " +"باید غیر ``NULL`` باشد." -msgid "On success, return ``0``. If *cell* is not a cell object, set an exception and return ``-1``." +msgid "" +"On success, return ``0``. If *cell* is not a cell object, set an exception " +"and return ``-1``." msgstr "" +"در صورت موفقیت، ``0`` را برمی‌گرداند. اگر *cell* یک شیء سلول نباشد، یک " +"استثنا تنظیم کرده و ``-1`` را برمی‌گرداند." -msgid "Sets the value of the cell object *cell* to *value*. No reference counts are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` and must be a cell object." +msgid "" +"Sets the value of the cell object *cell* to *value*. No reference counts " +"are adjusted, and no checks are made for safety; *cell* must be non-``NULL``" +" and must be a cell object." msgstr "" +"مقدار شیء سلول *cell* را روی *value* تنظیم می‌کند. هیچ شمارش ارجاعی تعدیل " +"نمی‌شود و هیچ بررسی ایمنی انجام نمی‌شود؛ *cell* باید غیر ``NULL`` باشد و " +"باید یک شیء سلول باشد." diff --git a/c-api/code.po b/c-api/code.po index 3d3d9df23..2dedf04e0 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -24,247 +24,505 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Code Objects" -msgstr "" +msgstr "اشیاء کد" -msgid "Code objects are a low-level detail of the CPython implementation. Each one represents a chunk of executable code that hasn't yet been bound into a function." +msgid "" +"Code objects are a low-level detail of the CPython implementation. Each one " +"represents a chunk of executable code that hasn't yet been bound into a " +"function." msgstr "" +"اشیای کد از جزئیات سطح پایین پیاده‌سازی سی‌پایتون هستند. هر یک نمایانگر " +"تکه‌ای از کد اجرایی است که هنوز به تابعی مقید نشده است." -msgid "The C structure of the objects used to describe code objects. The fields of this type are subject to change at any time." +msgid "" +"The C structure of the objects used to describe code objects. The fields of" +" this type are subject to change at any time." msgstr "" +"ساختار C اشیایی که برای توصیف اشیاء کد استفاده می‌شوند. فیلد‌های این نوع " +"ممکن است در هر زمان تغییر کنند." -msgid "This is an instance of :c:type:`PyTypeObject` representing the Python :ref:`code object `." +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python " +":ref:`code object `." msgstr "" +"این یک نمونه از :c:type:`PyTypeObject` است که شیء کد پایتون را نمایندگی " +"می‌کند و :ref:`شیء کد `" -msgid "Return true if *co* is a :ref:`code object `. This function always succeeds." +msgid "" +"Return true if *co* is a :ref:`code object `. This function " +"always succeeds." msgstr "" +"اگر *co* یک :ref:`شیء کد ` باشد، مقدار true را برمی‌گرداند. " +"این تابع همیشه موفق می‌شود." -msgid "Return the number of :term:`free (closure) variables ` in a code object." +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." msgstr "" +"تعداد :term:`متغیرهای آزاد (بستار) ` در یک شیء کد را " +"برمی‌گرداند." -msgid "Return the position of the first :term:`free (closure) variable ` in a code object." +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." msgstr "" +"موقعیت نخستین :term:`متغیر آزاد (بستار) ` در یک شیء کد را " +"برمی‌گرداند." -msgid "Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The old name is deprecated, but will remain available until the signature changes again." +msgid "" +"Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " +"old name is deprecated, but will remain available until the signature " +"changes again." msgstr "" +"به عنوان بخشی از :ref:`unstable-c-api` از ``PyCode_GetFirstFree`` تغییر نام " +"داده شده است. نام قدیمی منسوخ شده است، اما تا زمانی که امضای تابع دوباره " +"تغییر کند، در دسترس باقی خواهد ماند." -msgid "Return a new code object. If you need a dummy code object to create a frame, use :c:func:`PyCode_NewEmpty` instead." +msgid "" +"Return a new code object. If you need a dummy code object to create a " +"frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" +"یک شیء کد جدید برمی‌گرداند. اگر برای ایجاد یک قاب به یک شیء کد ساختگی نیاز " +"دارید، به‌جای آن از :c:func:`PyCode_NewEmpty` استفاده کنید." -msgid "Since the definition of the bytecode changes often, calling :c:func:`PyUnstable_Code_New` directly can bind you to a precise Python version." +msgid "" +"Since the definition of the bytecode changes often, calling " +":c:func:`PyUnstable_Code_New` directly can bind you to a precise Python " +"version." msgstr "" +"از آنجا که تعریف بایت‌کد اغلب تغییر می‌کند، فراخوانی مستقیم " +":c:func:`PyUnstable_Code_New` می‌تواند شما را به یک نسخه‌ی دقیق پایتون مقید " +"کند." -msgid "The many arguments of this function are inter-dependent in complex ways, meaning that subtle changes to values are likely to result in incorrect execution or VM crashes. Use this function only with extreme care." +msgid "" +"The many arguments of this function are inter-dependent in complex ways, " +"meaning that subtle changes to values are likely to result in incorrect " +"execution or VM crashes. Use this function only with extreme care." msgstr "" +"آرگومان‌های متعدد این تابع به شیوه‌های پیچیده‌ای به یکدیگر وابسته‌اند، به " +"این معنا که تغییرات ظریف در مقادیر به احتمال زیاد به اجرای نادرست یا فروپاشی" +" ماشین مجازی منجر می‌شود. از این تابع تنها با نهایت احتیاط استفاده کنید." msgid "Added ``qualname`` and ``exceptiontable`` parameters." -msgstr "" +msgstr "پارامترهای ``qualname`` و ``exceptiontable`` افزوده شدند." -msgid "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name is deprecated, but will remain available until the signature changes again." +msgid "" +"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " +"is deprecated, but will remain available until the signature changes again." msgstr "" +"از ``PyCode_New`` به‌عنوان بخشی از :ref:`unstable-c-api` تغییر نام داده شده " +"است. نام قدیمی منسوخ شده است، اما تا زمانی که امضای آن دوباره تغییر کند، در " +"دسترس باقی خواهد ماند." -msgid "Similar to :c:func:`PyUnstable_Code_New`, but with an extra \"posonlyargcount\" for positional-only arguments. The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function." +msgid "" +"Similar to :c:func:`PyUnstable_Code_New`, but with an extra " +"\"posonlyargcount\" for positional-only arguments. The same caveats that " +"apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" +"مشابه :c:func:`PyUnstable_Code_New` است، اما یک «posonlyargcount» اضافی برای" +" آرگومان‌های صرفاً جایگاهی دارد. همان هشدارهایی که درباره‌ی " +"``PyUnstable_Code_New`` صدق می‌کنند، درباره‌ی این تابع نیز صدق می‌کنند." msgid "as ``PyCode_NewWithPosOnlyArgs``" -msgstr "" +msgstr "به‌صورت ``PyCode_NewWithPosOnlyArgs``" msgid "Added ``qualname`` and ``exceptiontable`` parameters." -msgstr "" +msgstr "پارامترهای ``qualname`` و ``exceptiontable`` افزوده شدند." -msgid "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is deprecated, but will remain available until the signature changes again." +msgid "" +"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " +"deprecated, but will remain available until the signature changes again." msgstr "" +"به ``PyUnstable_Code_NewWithPosOnlyArgs`` تغییر نام یافت. نام قدیمی منسوخ " +"شده است، اما تا زمانی که امضا دوباره تغییر کند، در دسترس باقی خواهد ماند." -msgid "Return a new empty code object with the specified filename, function name, and first line number. The resulting code object will raise an ``Exception`` if executed." +msgid "" +"Return a new empty code object with the specified filename, function name, " +"and first line number. The resulting code object will raise an ``Exception``" +" if executed." msgstr "" +"یک شیء کد خالی جدید با نام پرونده، نام تابع و شماره سطر اول مشخص‌شده " +"برمی‌گرداند. شیء کد حاصل در صورت اجرا یک ``Exception`` پرتاب می‌کند." -msgid "Return the line number of the instruction that occurs on or before ``byte_offset`` and ends after it. If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead." +msgid "" +"Return the line number of the instruction that occurs on or before " +"``byte_offset`` and ends after it. If you just need the line number of a " +"frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" +"شماره سطر دستوری را برمی‌گرداند که در ``byte_offset`` یا پیش از آن قرار دارد" +" و پس از آن پایان می‌یابد. اگر فقط به شماره سطر یک فریم نیاز دارید، به‌جای " +"آن از :c:func:`PyFrame_GetLineNumber` استفاده کنید." -msgid "For efficiently iterating over the line numbers in a code object, use :pep:`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." +msgid "" +"For efficiently iterating over the line numbers in a code object, use " +":pep:`the API described in PEP 626 <0626#out-of-process-debuggers-and-" +"profilers>`." msgstr "" +"برای پیمایش کارآمد شماره سطرهای یک شیء کد، از :pep:`API توصیف‌شده در PEP 626" +" <0626#out-of-process-debuggers-and-profilers>` استفاده کنید." -msgid "Sets the passed ``int`` pointers to the source code line and column numbers for the instruction at ``byte_offset``. Sets the value to ``0`` when information is not available for any particular element." +msgid "" +"Sets the passed ``int`` pointers to the source code line and column numbers " +"for the instruction at ``byte_offset``. Sets the value to ``0`` when " +"information is not available for any particular element." msgstr "" +"اشاره‌گرهای ``int`` ارسال‌شده را برابر شماره سطر و ستون کد منبع برای " +"دستورالعمل در ``byte_offset`` قرار می‌دهد. وقتی اطلاعات برای هیچ عنصر خاصی " +"در دسترس نباشد، مقدار را ``0`` قرار می‌دهد." msgid "Returns ``1`` if the function succeeds and 0 otherwise." -msgstr "" +msgstr "اگر تابع با موفقیت اجرا شود، ``1`` و در غیر این صورت 0 برمی‌گرداند." -msgid "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong reference to a :c:type:`PyBytesObject` representing the bytecode in a code object. On error, ``NULL`` is returned and an exception is raised." +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " +"reference to a :c:type:`PyBytesObject` representing the bytecode in a code " +"object. On error, ``NULL`` is returned and an exception is raised." msgstr "" +"معادل کد پایتون ``getattr(co, 'co_code')`` است. یک ارجاع قوی به " +":c:type:`PyBytesObject` برمی‌گرداند که بایت‌کد موجود در یک شیء کد را نمایش " +"می‌دهد. در صورت خطا، ``NULL`` برگردانده می‌شود و یک استثنا مطرح می‌شود." -msgid "This ``PyBytesObject`` may be created on-demand by the interpreter and does not necessarily represent the bytecode actually executed by CPython. The primary use case for this function is debuggers and profilers." +msgid "" +"This ``PyBytesObject`` may be created on-demand by the interpreter and does " +"not necessarily represent the bytecode actually executed by CPython. The " +"primary use case for this function is debuggers and profilers." msgstr "" +"این ``PyBytesObject`` ممکن است به‌صورت درخواستی توسط مفسر ایجاد شود و لزوماً" +" بایت‌کدی را که در واقع توسط سی‌پایتون اجرا می‌شود نشان نمی‌دهد. کاربرد اصلی" +" این تابع در اشکال‌زداها و پروفایل‌گیرها است." -msgid "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new reference to a :c:type:`PyTupleObject` containing the names of the local variables. On error, ``NULL`` is returned and an exception is raised." +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the local " +"variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" +"معادل کد پایتون ``getattr(co, 'co_varnames')`` است. یک ارجاع جدید به " +":c:type:`PyTupleObject` شامل نام‌های متغیرهای محلی برمی‌گرداند. در صورت خطا،" +" ``NULL`` برگردانده می‌شود و یک استثنا مطرح می‌شود." -msgid "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new reference to a :c:type:`PyTupleObject` containing the names of the local variables that are referenced by nested functions. On error, ``NULL`` is returned and an exception is raised." +msgid "" +"Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the local " +"variables that are referenced by nested functions. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" +"معادل کد پایتونِ ``getattr(co, 'co_cellvars')`` است. یک ارجاع جدید به " +":c:type:`PyTupleObject` حاوی نام متغیرهای محلی‌ای که توابع تودرتو به آن‌ها " +"ارجاع می‌دهند، برمی‌گرداند. در صورت خطا، ``NULL`` برگردانده می‌شود و یک " +"استثنا مطرح می‌شود." -msgid "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new reference to a :c:type:`PyTupleObject` containing the names of the :term:`free (closure) variables `. On error, ``NULL`` is returned and an exception is raised." +msgid "" +"Equivalent to the Python code `getattr(co, 'co_freevars')`. Returns a new " +"reference to a :c:type:`PyTupleObject` containing the names of the " +":term:`free (closure) variables `. On error, `NULL` is " +"returned and an exception is raised." msgstr "" +"معادل کد پایتونِ `getattr(co, 'co_freevars')` است. یک ارجاع جدید به " +":c:type:`PyTupleObject` برمی‌گرداند که نام‌های " +":term:`متغیرهای آزاد (بستار) ` را در بر می‌گیرد. " +"در صورت خطا، `NULL` برگردانده می‌شود و یک استثنا مطرح می‌شود." -msgid "Register *callback* as a code object watcher for the current interpreter. Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case of error (e.g. no more watcher IDs available), return ``-1`` and set an exception." +msgid "" +"Register *callback* as a code object watcher for the current interpreter. " +"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." msgstr "" +"*callback* را به‌عنوان دیده‌بان (watcher) شیء کد برای مفسر فعلی ثبت می‌کند. " +"شناسه‌ای برمی‌گرداند که می‌توان آن را به :c:func:`PyCode_ClearWatcher` ارسال" +" کرد. در صورت بروز خطا (مثلاً وقتی دیگر هیچ شناسه‌ی دیده‌بانی در دسترس " +"نیست)، مقدار ``-1`` را برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "Clear watcher identified by *watcher_id* previously returned from :c:func:`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or ``-1`` and set an exception on error (e.g. if the given *watcher_id* was never registered.)" +msgid "" +"Clear watcher identified by *watcher_id* previously returned from " +":c:func:`PyCode_AddWatcher` for the current interpreter. Return ``0`` on " +"success, or ``-1`` and set an exception on error (e.g. if the given " +"*watcher_id* was never registered.)" msgstr "" +"پاک کردن پایشگر (watcher) شناسایی‌شده با *watcher_id* که پیش‌تر از " +":c:func:`PyCode_AddWatcher` برای مفسر فعلی برگردانده شده است. در صورت موفقیت" +" ``0`` را برمی‌گرداند، یا در صورت خطا ``-1`` را برمی‌گرداند و یک استثنا " +"تنظیم می‌کند (مثلاً اگر *watcher_id* داده‌شده هرگز ثبت نشده باشد.)" -msgid "Enumeration of possible code object watcher events: - ``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" +msgid "" +"Enumeration of possible code object watcher events: - " +"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" +"شمارش رویدادهای ممکن دیده‌بان شیء کد: - ``PY_CODE_EVENT_CREATE`` - " +"``PY_CODE_EVENT_DESTROY``" msgid "Type of a code object watcher callback function." -msgstr "" +msgstr "نوع تابع کال‌بک دیده‌بان شیء کد." -msgid "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after *co* has been fully initialized. Otherwise, the callback is invoked before the destruction of *co* takes place, so the prior state of *co* can be inspected." +msgid "" +"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " +"*co* has been fully initialized. Otherwise, the callback is invoked before " +"the destruction of *co* takes place, so the prior state of *co* can be " +"inspected." msgstr "" +"اگر *event* برابر ``PY_CODE_EVENT_CREATE`` باشد، کال‌بک پس از آنکه *co* " +"به‌طور کامل مقداردهی اولیه شده باشد فراخوانی می‌شود. در غیر این صورت، کال‌بک" +" پیش از آنکه تخریب *co* رخ دهد فراخوانی می‌شود، تا بتوان وضعیت پیشین *co* را" +" بررسی کرد." -msgid "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback to the about-to-be-destroyed code object will resurrect it and prevent it from being freed at this time. When the resurrected object is destroyed later, any watcher callbacks active at that time will be called again." +msgid "" +"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " +"to the about-to-be-destroyed code object will resurrect it and prevent it " +"from being freed at this time. When the resurrected object is destroyed " +"later, any watcher callbacks active at that time will be called again." msgstr "" +"اگر *event* برابر ``PY_CODE_EVENT_DESTROY`` باشد، گرفتن ارجاعی در کال‌بک به " +"شیء کدی که در شرف نابودی است، آن را احیا می‌کند و مانع آزاد شدن آن در این " +"زمان می‌شود. هنگامی که شیء احیاشده بعداً نابود شود، هر کال‌بک ناظری که در آن" +" زمان فعال باشد، دوباره فراخوانی خواهد شد." -msgid "Users of this API should not rely on internal runtime implementation details. Such details may include, but are not limited to, the exact order and timing of creation and destruction of code objects. While changes in these details may result in differences observable by watchers (including whether a callback is invoked or not), it does not change the semantics of the Python code being executed." -msgstr "" +msgid "" +"Users of this API should not rely on internal runtime implementation " +"details. Such details may include, but are not limited to, the exact order " +"and timing of creation and destruction of code objects. While changes in " +"these details may result in differences observable by watchers (including " +"whether a callback is invoked or not), it does not change the semantics of " +"the Python code being executed." +msgstr "" +"کاربران این API نباید به جزئیات پیاده‌سازی داخلی ران‌تایم تکیه کنند. چنین " +"جزئیاتی ممکن است شامل ترتیب و زمان‌بندی دقیق ایجاد و تخریب اشیاء کد باشد، " +"اما به همین موارد محدود نمی‌شود. هرچند تغییر در این جزئیات ممکن است " +"تفاوت‌هایی قابل‌مشاهده برای ناظرها ایجاد کند (از جمله اینکه آیا یک کال‌بک " +"فراخوانی می‌شود یا خیر)، اما معناشناسی کد پایتونِ در حال اجرا را تغییر " +"نمی‌دهد." -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``." +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 "" +"اگر کال‌بک یک استثنا تنظیم کند، باید ``-1`` را برگرداند؛ این استثنا با " +"استفاده از :c:func:`PyErr_WriteUnraisable` به‌عنوان یک استثنای غیرقابل‌برپا " +"(unraisable) چاپ خواهد شد. در غیر این صورت باید ``0`` را برگرداند." -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 set. This means the callback may not call any other API that can set an exception unless it saves and clears the exception state first, and restores it before returning." -msgstr "" +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 " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores" +" it before returning." +msgstr "" +"ممکن است هنگام ورود به کال‌بک، از قبل استثنایی در انتظار تنظیم‌شده باشد. در " +"این حالت، کال‌بک باید ``0`` را برگرداند در حالی که همان استثنا همچنان " +"تنظیم‌شده است. این بدان معناست که کال‌بک مجاز نیست هیچ API دیگری را که " +"می‌تواند استثنایی تنظیم کند فراخوانی کند، مگر آنکه ابتدا وضعیت استثنا را " +"ذخیره و پاک کند و پیش از بازگشت، آن را بازیابی کند." msgid "This is a function that does nothing." -msgstr "" +msgstr "این تابعی است که هیچ کاری انجام نمی‌دهد." -msgid "Prior to Python 3.10, this function would perform basic optimizations to a code object." +msgid "" +"Prior to Python 3.10, this function would perform basic optimizations to a " +"code object." msgstr "" +"پیش از پایتون 3.10، این تابع بهینه‌سازی‌های پایه را روی یک شیء کد انجام " +"می‌داد." msgid "This function now does nothing." -msgstr "" +msgstr "این تابع اکنون هیچ کاری انجام نمی‌دهد." msgid "Code Object Flags" -msgstr "" +msgstr "پرچم‌های شیء کد" -msgid "Code objects contain a bit-field of flags, which can be retrieved as the :attr:`~codeobject.co_flags` Python attribute (for example using :c:func:`PyObject_GetAttrString`), and set using a *flags* argument to :c:func:`PyUnstable_Code_New` and similar functions." +msgid "" +"Code objects contain a bit-field of flags, which can be retrieved as the " +":attr:`~codeobject.co_flags` Python attribute (for example using " +":c:func:`PyObject_GetAttrString`), and set using a *flags* argument to " +":c:func:`PyUnstable_Code_New` and similar functions." msgstr "" +"اشیاء کد شامل یک میدان بیتی (bit-field) از پرچم‌ها هستند که می‌توان آن را " +"به‌عنوان ویژگی پایتونی :attr:`~codeobject.co_flags` بازیابی کرد (برای مثال " +"با استفاده از :c:func:`PyObject_GetAttrString`)، و با استفاده از آرگومان " +"*flags* در :c:func:`PyUnstable_Code_New` و توابع مشابه تنظیم کرد." -msgid "Flags whose names start with ``CO_FUTURE_`` correspond to features normally selectable by :ref:`future statements `. These flags can be used in :c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags are mandatory in current versions of Python, and setting them has no effect." +msgid "" +"Flags whose names start with ``CO_FUTURE_`` correspond to features normally " +"selectable by :ref:`future statements `. These flags can be used in " +":c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags " +"are mandatory in current versions of Python, and setting them has no effect." msgstr "" +"پرچم‌هایی که نام‌شان با ``CO_FUTURE_`` آغاز می‌شود، به قابلیت‌هایی مربوط‌اند" +" که معمولاً از طریق :ref:`دستورهای آینده (future) ` قابل انتخاب " +"هستند. این پرچم‌ها را می‌توان در :c:member:`PyCompilerFlags.cf_flags` به کار" +" برد. توجه داشته باشید که بسیاری از پرچم‌های ``CO_FUTURE_`` در نسخه‌های فعلی" +" پایتون الزامی هستند و تنظیم کردن آن‌ها هیچ اثری ندارد." -msgid "The following flags are available. For their meaning, see the linked documentation of their Python equivalents." +msgid "" +"The following flags are available. For their meaning, see the linked " +"documentation of their Python equivalents." msgstr "" +"پرچم‌های زیر در دسترس هستند. برای معنای آن‌ها، به مستندات پیوند‌شده‌ی " +"معادل‌های پایتونی آن‌ها مراجعه کنید." msgid "Flag" -msgstr "" +msgstr "پرچم" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid ":py:data:`inspect.CO_OPTIMIZED`" -msgstr "" +msgstr ":py:data:`inspect.CO_OPTIMIZED`" msgid ":py:data:`inspect.CO_NEWLOCALS`" -msgstr "" +msgstr ":py:data:`inspect.CO_NEWLOCALS`" msgid ":py:data:`inspect.CO_VARARGS`" -msgstr "" +msgstr ":py:data:`inspect.CO_VARARGS`" msgid ":py:data:`inspect.CO_VARKEYWORDS`" -msgstr "" +msgstr ":py:data:`inspect.CO_VARKEYWORDS`" msgid ":py:data:`inspect.CO_NESTED`" -msgstr "" +msgstr ":py:data:`inspect.CO_NESTED`" msgid ":py:data:`inspect.CO_GENERATOR`" -msgstr "" +msgstr ":py:data:`inspect.CO_GENERATOR`" msgid ":py:data:`inspect.CO_COROUTINE`" -msgstr "" +msgstr ":py:data:`inspect.CO_COROUTINE`" msgid ":py:data:`inspect.CO_ITERABLE_COROUTINE`" -msgstr "" +msgstr ":py:data:`inspect.CO_ITERABLE_COROUTINE`" msgid ":py:data:`inspect.CO_ASYNC_GENERATOR`" -msgstr "" +msgstr ":py:data:`inspect.CO_ASYNC_GENERATOR`" msgid ":py:data:`inspect.CO_HAS_DOCSTRING`" -msgstr "" +msgstr ":py:data:`inspect.CO_HAS_DOCSTRING`" msgid ":py:data:`inspect.CO_METHOD`" -msgstr "" +msgstr ":py:data:`inspect.CO_METHOD`" msgid "no effect (:py:data:`__future__.division`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.division`)" msgid "no effect (:py:data:`__future__.absolute_import`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.absolute_import`)" msgid "no effect (:py:data:`__future__.with_statement`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.with_statement`)" msgid "no effect (:py:data:`__future__.print_function`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.print_function`)" msgid "no effect (:py:data:`__future__.unicode_literals`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.unicode_literals`)" msgid "no effect (:py:data:`__future__.generator_stop`)" -msgstr "" +msgstr "بدون اثر (:py:data:`__future__.generator_stop`)" msgid ":py:data:`__future__.annotations`" -msgstr "" +msgstr ":py:data:`__future__.annotations`" msgid "Extra information" -msgstr "" +msgstr "اطلاعات اضافی" -msgid "To support low-level extensions to frame evaluation, such as external just-in-time compilers, it is possible to attach arbitrary extra data to code objects." +msgid "" +"To support low-level extensions to frame evaluation, such as external just-" +"in-time compilers, it is possible to attach arbitrary extra data to code " +"objects." msgstr "" +"برای پشتیبانی از توسعه‌های سطح پایین در ارزیابی فریم، مانند کامپایلرهای " +"خارجیِ در لحظه (just-in-time)، می‌توان داده‌های اضافیِ دلخواه را به اشیاء کد" +" الصاق کرد." -msgid "These functions are part of the unstable C API tier: this functionality is a CPython implementation detail, and the API may change without deprecation warnings." +msgid "" +"These functions are part of the unstable C API tier: this functionality is a" +" CPython implementation detail, and the API may change without deprecation " +"warnings." msgstr "" +"این توابع بخشی از سطح نا‌پایدار C API هستند: این کارکرد جزئی از پیاده‌سازی " +"سی‌پایتون است و ممکن است API بدون هشدار منسوخ‌شدن تغییر کند." msgid "Return a new opaque index value used to adding data to code objects." msgstr "" +"یک مقدار اندیس مات (opaque) جدید برمی‌گرداند که برای افزودن داده به اشیاء کد" +" استفاده می‌شود." -msgid "You generally call this function once (per interpreter) and use the result with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on individual code objects." +msgid "" +"You generally call this function once (per interpreter) and use the result " +"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " +"individual code objects." msgstr "" +"معمولاً این تابع را یک‌بار (به ازای هر مفسر) فراخوانی می‌کنید و از نتیجه‌ی " +"آن به همراه ``PyCode_GetExtra`` و ``PyCode_SetExtra`` برای دستکاری داده‌ها " +"روی هر یک از اشیاء کد استفاده می‌کنید." -msgid "If *free* is not ``NULL``: when a code object is deallocated, *free* will be called on non-``NULL`` data stored under the new index. Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`." +msgid "" +"If *free* is not ``NULL``: when a code object is deallocated, *free* will be" +" called on non-``NULL`` data stored under the new index. Use " +":c:func:`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" +"اگر *free* برابر ``NULL`` نباشد: هنگامی که یک شیء کد تخصیص‌زدایی شود، *free*" +" روی داده‌های غیر``NULL`` ذخیره‌شده تحت اندیس جدید فراخوانی خواهد شد. هنگام " +"ذخیره‌سازی :c:type:`PyObject` از :c:func:`Py_DecRef` استفاده کنید." msgid "as ``_PyEval_RequestCodeExtraIndex``" -msgstr "" +msgstr "به‌عنوان ``_PyEval_RequestCodeExtraIndex``" -msgid "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name is deprecated, but will be available until the API changes." +msgid "" +"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " +"is deprecated, but will be available until the API changes." msgstr "" +"به ``PyUnstable_Eval_RequestCodeExtraIndex`` تغییر نام یافت. نام خصوصی قدیمی" +" منسوخ شده است، اما تا زمانی که API تغییر کند، دسترس‌پذیر خواهد بود." -msgid "Set *extra* to the extra data stored under the given index. Return 0 on success. Set an exception and return -1 on failure." +msgid "" +"Set *extra* to the extra data stored under the given index. Return 0 on " +"success. Set an exception and return -1 on failure." msgstr "" +"*extra* را برابر داده‌ی اضافی ذخیره‌شده در اندیس داده‌شده قرار می‌دهد. در " +"صورت موفقیت، 0 برمی‌گرداند. در صورت شکست، یک استثنا تنظیم کرده و -1 " +"برمی‌گرداند." -msgid "If no data was set under the index, set *extra* to ``NULL`` and return 0 without setting an exception." +msgid "" +"If no data was set under the index, set *extra* to ``NULL`` and return 0 " +"without setting an exception." msgstr "" +"اگر داده‌ای در آن اندیس قرار داده نشده باشد، *extra* را برابر ``NULL`` قرار " +"دهید و بدون تنظیم استثنا، ۰ را برگردانید." msgid "as ``_PyCode_GetExtra``" -msgstr "" +msgstr "به‌صورت ``_PyCode_GetExtra``" -msgid "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, but will be available until the API changes." +msgid "" +"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated," +" but will be available until the API changes." msgstr "" +"به ``PyUnstable_Code_GetExtra`` تغییر نام یافت. نام خصوصی قدیمی منسوخ شده " +"است، اما تا زمانی که API تغییر کند، در دسترس خواهد بود." -msgid "Set the extra data stored under the given index to *extra*. Return 0 on success. Set an exception and return -1 on failure." +msgid "" +"Set the extra data stored under the given index to *extra*. Return 0 on " +"success. Set an exception and return -1 on failure." msgstr "" +"داده‌های اضافی ذخیره‌شده در اندیس داده‌شده را برابر *extra* قرار می‌دهد. در " +"صورت موفقیت، 0 را برمی‌گرداند. در صورت شکست، استثنا را تنظیم می‌کند و -1 را " +"برمی‌گرداند." msgid "as ``_PyCode_SetExtra``" -msgstr "" +msgstr "به‌صورت ``_PyCode_SetExtra``" -msgid "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, but will be available until the API changes." +msgid "" +"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated," +" but will be available until the API changes." msgstr "" +"به ``PyUnstable_Code_SetExtra`` تغییر نام داده شد. نام خصوصی قدیمی منسوخ شده" +" است، اما تا زمان تغییر API در دسترس خواهد بود." msgid "object" -msgstr "" +msgstr "شیء" msgid "code" -msgstr "" +msgstr "کد" msgid "code object" -msgstr "" +msgstr "شیء کد" msgid "PyCode_New (C function)" -msgstr "" +msgstr "PyCode_New (تابع C)" diff --git a/c-api/codec.po b/c-api/codec.po index 0ef3359ca..4df5cd56e 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -22,91 +22,183 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Codec registry and support functions" -msgstr "" +msgstr "رجیستری کدک (codec) و توابع پشتیبانی" msgid "Register a new codec search function." -msgstr "" +msgstr "یک تابع جستجوی کدک جدید را ثبت می‌کند." -msgid "As a side effect, this tries to load the :mod:`!encodings` package, if not yet done, to make sure that it is always first in the list of search functions." +msgid "" +"As a side effect, this tries to load the :mod:`!encodings` package, if not " +"yet done, to make sure that it is always first in the list of search " +"functions." msgstr "" +"به‌عنوان یک اثر جانبی، این تلاش می‌کند در صورتی که هنوز انجام نشده باشد، " +"بسته‌ی :mod:`!encodings` را بارگذاری کند تا مطمئن شود که همیشه در ابتدای " +"فهرست توابع جستجو قرار دارد." -msgid "Unregister a codec search function and clear the registry's cache. If the search function is not registered, do nothing. Return 0 on success. Raise an exception and return -1 on error." +msgid "" +"Unregister a codec search function and clear the registry's cache. If the " +"search function is not registered, do nothing. Return 0 on success. Raise an" +" exception and return -1 on error." msgstr "" +"ثبت یک تابع جستجوی کدک را لغو می‌کند و نهانگاه رجیستری را پاک می‌کند. اگر " +"تابع جستجو ثبت نشده باشد، هیچ کاری انجام نمی‌دهد. در صورت موفقیت، 0 را " +"برمی‌گرداند. در صورت خطا، یک استثنا ایجاد می‌کند و -1 را برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether there is a registered codec for the given *encoding*. This function always succeeds." +msgid "" +"Return ``1`` or ``0`` depending on whether there is a registered codec for " +"the given *encoding*. This function always succeeds." msgstr "" +"بسته به اینکه برای *encoding* داده‌شده کدک (codec) ثبت‌شده‌ای وجود دارد یا " +"خیر، ``1`` یا ``0`` برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." msgid "Generic codec based encoding API." -msgstr "" +msgstr "API عمومی کدگذاری مبتنی بر کدک." -msgid "*object* is passed through the encoder function found for the given *encoding* using the error handling method defined by *errors*. *errors* may be ``NULL`` to use the default method defined for the codec. Raises a :exc:`LookupError` if no encoder can be found." +msgid "" +"*object* is passed through the encoder function found for the given " +"*encoding* using the error handling method defined by *errors*. *errors* " +"may be ``NULL`` to use the default method defined for the codec. Raises a " +":exc:`LookupError` if no encoder can be found." msgstr "" +"*object* با استفاده از روش مدیریت خطای تعریف‌شده توسط *errors*، از تابع " +"کدگذاری که برای *encoding* داده‌شده یافت شده است، عبور داده می‌شود. " +"*errors* می‌تواند ``NULL`` باشد تا از روش پیش‌فرض تعریف‌شده برای کدک استفاده" +" شود. در صورت یافت نشدن کدگذار، استثنای :exc:`LookupError` ایجاد می‌شود." msgid "Generic codec based decoding API." -msgstr "" +msgstr "API کدگشایی مبتنی بر کدک عمومی." -msgid "*object* is passed through the decoder function found for the given *encoding* using the error handling method defined by *errors*. *errors* may be ``NULL`` to use the default method defined for the codec. Raises a :exc:`LookupError` if no decoder can be found." +msgid "" +"*object* is passed through the decoder function found for the given " +"*encoding* using the error handling method defined by *errors*. *errors* " +"may be ``NULL`` to use the default method defined for the codec. Raises a " +":exc:`LookupError` if no decoder can be found." msgstr "" +"*object* با استفاده از روش مدیریت خطای تعریف‌شده توسط *errors*، از تابع " +"کدگشای یافت‌شده برای *encoding* داده‌شده عبور داده می‌شود. *errors* می‌تواند" +" ``NULL`` باشد تا از روش پیش‌فرض تعریف‌شده برای کدک استفاده شود. اگر هیچ " +"کدگشایی یافت نشود، استثنای :exc:`LookupError` ایجاد می‌شود." msgid "Codec lookup API" -msgstr "" +msgstr "API جستجوی کدک" -msgid "In the following functions, the *encoding* string is looked up converted to all lower-case characters, which makes encodings looked up through this mechanism effectively case-insensitive. If no codec is found, a :exc:`KeyError` is set and ``NULL`` returned." +msgid "" +"In the following functions, the *encoding* string is looked up converted to " +"all lower-case characters, which makes encodings looked up through this " +"mechanism effectively case-insensitive. If no codec is found, a " +":exc:`KeyError` is set and ``NULL`` returned." msgstr "" +"در توابع زیر، رشته‌ی *encoding* پس از تبدیل به نویسه‌های تماماً کوچک جستجو " +"می‌شود، که همین امر باعث می‌شود کدگذاری‌هایی که از طریق این سازوکار جستجو " +"می‌شوند، عملاً بدون حساسیت به بزرگی و کوچکی نویسه‌ها باشند. اگر هیچ کدکی " +"یافت نشود، یک :exc:`KeyError` تنظیم می‌شود و ``NULL`` برگردانده می‌شود." msgid "Get an encoder function for the given *encoding*." -msgstr "" +msgstr "دریافت تابع کدگذار برای *encoding* داده‌شده." msgid "Get a decoder function for the given *encoding*." -msgstr "" +msgstr "گرفتن تابع کدگشا برای *کدگذاری* داده‌شده." -msgid "Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*." +msgid "" +"Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*." msgstr "" +"یک شیء :class:`~codecs.IncrementalEncoder` برای *کدگذاری* داده‌شده دریافت " +"می‌کند." -msgid "Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*." +msgid "" +"Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*." msgstr "" +"به دست آوردن یک شیء :class:`~codecs.IncrementalDecoder` برای *encoding* " +"داده‌شده." -msgid "Get a :class:`~codecs.StreamReader` factory function for the given *encoding*." +msgid "" +"Get a :class:`~codecs.StreamReader` factory function for the given " +"*encoding*." msgstr "" +"گرفتن تابع کارخانه‌ای :class:`~codecs.StreamReader` برای *کدگذاری* داده‌شده." -msgid "Get a :class:`~codecs.StreamWriter` factory function for the given *encoding*." +msgid "" +"Get a :class:`~codecs.StreamWriter` factory function for the given " +"*encoding*." msgstr "" +"دریافت یک تابع کارخانه‌ای :class:`~codecs.StreamWriter` برای *کدگذاری* " +"داده‌شده." msgid "Registry API for Unicode encoding error handlers" -msgstr "" +msgstr "API رجیستری برای هندلر‌های خطای کدگذاری یونیکد" -msgid "Register the error handling callback function *error* under the given *name*. This callback function will be called by a codec when it encounters unencodable characters/undecodable bytes and *name* is specified as the error parameter in the call to the encode/decode function." +msgid "" +"Register the error handling callback function *error* under the given " +"*name*. This callback function will be called by a codec when it encounters " +"unencodable characters/undecodable bytes and *name* is specified as the " +"error parameter in the call to the encode/decode function." msgstr "" +"تابع کال‌بک مدیریت خطای *error* را با نام داده‌شده *name* ثبت می‌کند. این " +"تابع کال‌بک توسط یک کدک (codec) زمانی فراخوانی می‌شود که به نویسه‌های " +"غیرقابل کدگذاری/بایت‌های غیرقابل کدگشایی برخورد کند و *name* به‌عنوان " +"پارامتر خطا در فراخوانی تابع کدگذاری/کدگشایی مشخص شده باشد." -msgid "The callback gets a single argument, an instance of :exc:`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or :exc:`UnicodeTranslateError` that holds information about the problematic sequence of characters or bytes and their offset in the original string (see :ref:`unicodeexceptions` for functions to extract this information). The callback must either raise the given exception, or return a two-item tuple containing the replacement for the problematic sequence, and an integer giving the offset in the original string at which encoding/decoding should be resumed." -msgstr "" +msgid "" +"The callback gets a single argument, an instance of " +":exc:`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or " +":exc:`UnicodeTranslateError` that holds information about the problematic " +"sequence of characters or bytes and their offset in the original string (see" +" :ref:`unicodeexceptions` for functions to extract this information). The " +"callback must either raise the given exception, or return a two-item tuple " +"containing the replacement for the problematic sequence, and an integer " +"giving the offset in the original string at which encoding/decoding should " +"be resumed." +msgstr "" +"کال‌بک یک آرگومان واحد دریافت می‌کند، نمونه‌ای از :exc:`UnicodeEncodeError`،" +" :exc:`UnicodeDecodeError` یا :exc:`UnicodeTranslateError` که اطلاعاتی " +"درباره‌ی دنباله‌ی مشکل‌ساز نویسه‌ها یا بایت‌ها و آفست آن‌ها در رشته‌ی اصلی " +"نگه می‌دارد (برای توابعی که این اطلاعات را استخراج می‌کنند، به " +":ref:`unicodeexceptions` مراجعه کنید). کال‌بک باید یا استثنای داده‌شده را " +"ایجاد کند، یا یک تاپل دوآیتمی بازگرداند که شامل جایگزین دنباله‌ی مشکل‌ساز و " +"یک عدد صحیح است که مشخص می‌کند کدگذاری/کدگشایی باید از کدام آفست در رشته‌ی " +"اصلی از سر گرفته شود." msgid "Return ``0`` on success, ``-1`` on error." -msgstr "" +msgstr "در صورت موفقیت ``0`` و در صورت خطا ``-1`` برمی‌گرداند." -msgid "Lookup the error handling callback function registered under *name*. As a special case ``NULL`` can be passed, in which case the error handling callback for \"strict\" will be returned." +msgid "" +"Lookup the error handling callback function registered under *name*. As a " +"special case ``NULL`` can be passed, in which case the error handling " +"callback for \"strict\" will be returned." msgstr "" +"تابع کال‌بک مدیریت خطای ثبت‌شده تحت نام *name* را جستجو می‌کند. به عنوان یک " +"حالت خاص، می‌توان ``NULL`` را ارسال کرد که در این صورت کال‌بک مدیریت خطا " +"برای \"strict\" بازگردانده می‌شود." msgid "Raise *exc* as an exception." -msgstr "" +msgstr "*exc* را به‌عنوان استثنا ایجاد می‌کند." msgid "Ignore the unicode error, skipping the faulty input." -msgstr "" +msgstr "خطای یونیکد را نادیده می‌گیرد و از ورودی معیوب عبور می‌کند." msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``." -msgstr "" +msgstr "خطای کدگذاری یونیکد را با ``?`` یا ``U+FFFD`` جایگزین کنید." msgid "Replace the unicode encode error with XML character references." -msgstr "" +msgstr "خطای کدگذاری یونیکد را با ارجاع‌های نویسه XML جایگزین می‌کند." -msgid "Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` and ``\\U``)." +msgid "" +"Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` " +"and ``\\U``)." msgstr "" +"خطای کدگذاری یونیکد را با گریزهای بک‌اسلش (``\\x``، ``\\u`` و ``\\U``) " +"جایگزین می‌کند." msgid "Replace the unicode encode error with ``\\N{...}`` escapes." -msgstr "" +msgstr "خطای کدگذاری یونیکد را با گریزهای ``\\N{...}`` جایگزین کنید." msgid "Codec utility variables" -msgstr "" +msgstr "متغیرهای کاربردی کدک" -msgid "A string constant containing the lowercase hexadecimal digits: ``\"0123456789abcdef\"``." +msgid "" +"A string constant containing the lowercase hexadecimal digits: " +"``\"0123456789abcdef\"``." msgstr "" +"یک ثابت رشته‌ای که شامل ارقام مبنای شانزده با حروف کوچک است: " +"``\"0123456789abcdef\"``." diff --git a/c-api/complex.po b/c-api/complex.po index a6f3f2a23..24624d692 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -23,22 +23,44 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Complex Number Objects" -msgstr "" +msgstr "اشیاء عدد مختلط" -msgid "Python's complex number objects are implemented as two distinct types when viewed from the C API: one is the Python object exposed to Python programs, and the other is a C structure which represents the actual complex number value. The API provides functions for working with both." +msgid "" +"Python's complex number objects are implemented as two distinct types when " +"viewed from the C API: one is the Python object exposed to Python programs," +" and the other is a C structure which represents the actual complex number " +"value. The API provides functions for working with both." msgstr "" +"اشیاء عدد مختلط پایتون از دید API زبان C به‌صورت دو نوع متمایز پیاده‌سازی " +"شده‌اند: یکی شیء پایتونی است که در اختیار برنامه‌های پایتون قرار می‌گیرد، و " +"دیگری ساختاری در C است که مقدار واقعی عدد مختلط را نمایندگی می‌کند. این API " +"توابعی برای کار با هر دو فراهم می‌کند." msgid "Complex Numbers as C Structures" -msgstr "" +msgstr "اعداد مختلط به‌عنوان ساختارهای C" -msgid "Note that the functions which accept these structures as parameters and return them as results do so *by value* rather than dereferencing them through pointers. This is consistent throughout the API." +msgid "" +"Note that the functions which accept these structures as parameters and " +"return them as results do so *by value* rather than dereferencing them " +"through pointers. This is consistent throughout the API." msgstr "" +"توجه داشته باشید که توابعی که این ساختارها را به‌عنوان پارامتر می‌پذیرند و " +"آن‌ها را به‌عنوان نتیجه برمی‌گردانند، این کار را *به‌صورت مقدار* انجام " +"می‌دهند، نه با ارجاع‌زدایی (dereferencing) آن‌ها از طریق اشاره‌گرها. این " +"موضوع در سراسر API یکسان است." -msgid "The C structure which corresponds to the value portion of a Python complex number object. Most of the functions for dealing with complex number objects use structures of this type as input or output values, as appropriate." +msgid "" +"The C structure which corresponds to the value portion of a Python complex " +"number object. Most of the functions for dealing with complex number " +"objects use structures of this type as input or output values, as " +"appropriate." msgstr "" +"ساختار C که به بخش مقدارِ شیء عدد مختلط پایتون مربوط می‌شود. بیشتر توابعی که" +" با اشیاء عدد مختلط سروکار دارند، بسته به مورد، از ساختارهایی از این نوع " +"به‌عنوان مقادیر ورودی یا خروجی استفاده می‌کنند." msgid "The structure is defined as::" -msgstr "" +msgstr "ساختار به صورت زیر تعریف می‌شود::" msgid "" "typedef struct {\n" @@ -46,87 +68,191 @@ msgid "" " double imag;\n" "} Py_complex;" msgstr "" +"typedef struct {\n" +" double real;\n" +" double imag;\n" +"} Py_complex;" -msgid "Return the sum of two complex numbers, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the sum of two complex numbers, using the C :c:type:`Py_complex` " +"representation." msgstr "" +"مجموع دو عدد مختلط را با استفاده از نمایش C :c:type:`Py_complex` " +"برمی‌گرداند." -msgid "Return the difference between two complex numbers, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the difference between two complex numbers, using the C " +":c:type:`Py_complex` representation." msgstr "" +"تفاضل دو عدد مختلط را با استفاده از نمایش C :c:type:`Py_complex` " +"برمی‌گرداند." -msgid "Return the negation of the complex number *num*, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the negation of the complex number *num*, using the C " +":c:type:`Py_complex` representation." msgstr "" +"نقیض عدد مختلط *num* را با استفاده از نمایش C :c:type:`Py_complex` " +"برمی‌گرداند." -msgid "Return the product of two complex numbers, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the product of two complex numbers, using the C :c:type:`Py_complex` " +"representation." msgstr "" +"حاصل‌ضرب دو عدد مختلط را با استفاده از نمایش :c:type:`Py_complex` در C " +"برمی‌گرداند." -msgid "Return the quotient of two complex numbers, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the quotient of two complex numbers, using the C :c:type:`Py_complex`" +" representation." msgstr "" +"خارج قسمت دو عدد مختلط را با استفاده از نمایش :c:type:`Py_complex` در C " +"برمی‌گرداند." -msgid "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." +msgid "" +"If *divisor* is null, this method returns zero and sets :c:data:`errno` to " +":c:macro:`!EDOM`." msgstr "" +"اگر *divisor* تهی باشد، این متد صفر را برمی‌گرداند و :c:data:`errno` را " +"برابر :c:macro:`!EDOM` قرار می‌دهد." -msgid "Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex` representation." +msgid "" +"Return the exponentiation of *num* by *exp*, using the C " +":c:type:`Py_complex` representation." msgstr "" +"توان *num* به *exp* را با استفاده از نمایش C :c:type:`Py_complex` " +"برمی‌گرداند." -msgid "If *num* is null and *exp* is not a positive real number, this method returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." +msgid "" +"If *num* is null and *exp* is not a positive real number, this method " +"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." msgstr "" +"اگر *num* صفر باشد و *exp* عدد حقیقی مثبت نباشد، این متد صفر را برمی‌گرداند " +"و مقدار :c:data:`errno` را برابر :c:macro:`!EDOM` قرار می‌دهد." msgid "Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows." msgstr "" +"در صورت سرریز، :c:data:`errno` را برابر :c:macro:`!ERANGE` قرار می‌دهد." msgid "Complex Numbers as Python Objects" -msgstr "" +msgstr "اعداد مختلط به‌عنوان اشیاء پایتون" -msgid "This subtype of :c:type:`PyObject` represents a Python complex number object." +msgid "" +"This subtype of :c:type:`PyObject` represents a Python complex number " +"object." msgstr "" +"این زیرنوع از :c:type:`PyObject` نمایانگر یک شیء عدد مختلط پایتون است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python complex number type. It is the same object as :class:`complex` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python complex number" +" type. It is the same object as :class:`complex` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع عدد مختلط پایتون را نشان می‌دهد. این" +" همان شیء :class:`complex` در لایه‌ی پایتون است." -msgid "Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :c:type:`PyComplexObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of " +":c:type:`PyComplexObject`. This function always succeeds." msgstr "" +"اگر آرگومان آن یک :c:type:`PyComplexObject` یا زیرنوعی از " +":c:type:`PyComplexObject` باشد، مقدار درست را برمی‌گرداند. این تابع همیشه " +"موفق می‌شود." -msgid "Return true if its argument is a :c:type:`PyComplexObject`, but not a subtype of :c:type:`PyComplexObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyComplexObject`, but not a " +"subtype of :c:type:`PyComplexObject`. This function always succeeds." msgstr "" +"در صورتی که آرگومان آن یک :c:type:`PyComplexObject` باشد، اما زیرنوعی از " +":c:type:`PyComplexObject` نباشد، مقدار true را برمی‌گرداند. این تابع همیشه " +"موفق می‌شود." -msgid "Create a new Python complex number object from a C :c:type:`Py_complex` value. Return ``NULL`` with an exception set on error." +msgid "" +"Create a new Python complex number object from a C :c:type:`Py_complex` " +"value. Return ``NULL`` with an exception set on error." msgstr "" +"یک شیء عدد مختلط جدید پایتون را از یک مقدار :c:type:`Py_complex` در C ایجاد " +"می‌کند. در صورت خطا، ``NULL`` به همراه یک استثنای تنظیم‌شده برگردانده " +"می‌شود." -msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return ``NULL`` with an exception set on error." +msgid "" +"Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return" +" ``NULL`` with an exception set on error." msgstr "" +"یک شیء جدید :c:type:`PyComplexObject` از *real* و *imag* برمی‌گرداند. در " +"صورت خطا، ``NULL`` به همراه یک استثنای تنظیم‌شده برمی‌گرداند." msgid "Return the real part of *op* as a C :c:expr:`double`." -msgstr "" +msgstr "بخش حقیقی *op* را به‌صورت یک :c:expr:`double` در C برمی‌گرداند." -msgid "If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to call :c:func:`PyFloat_AsDouble` and returns its result." +msgid "" +"If *op* is not a Python complex number object but has a " +":meth:`~object.__complex__` method, this method will first be called to " +"convert *op* to a Python complex number object. If :meth:`!__complex__` is " +"not defined then it falls back to call :c:func:`PyFloat_AsDouble` and " +"returns its result." msgstr "" +"اگر *op* یک شیء عدد مختلط پایتون نباشد اما متد :meth:`~object.__complex__` " +"را داشته باشد، این متد ابتدا برای تبدیل *op* به یک شیء عدد مختلط پایتون " +"فراخوانی می‌شود. اگر :meth:`!__complex__` تعریف نشده باشد، به فراخوانی " +":c:func:`PyFloat_AsDouble` بازمی‌گردد و نتیجه‌ی آن را برمی‌گرداند." -msgid "Upon failure, this method returns ``-1.0`` with an exception set, so one should call :c:func:`PyErr_Occurred` to check for errors." +msgid "" +"Upon failure, this method returns ``-1.0`` with an exception set, so one " +"should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" +"در صورت شکست، این متد ``-1.0`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند،" +" بنابراین برای بررسی خطاها باید :c:func:`PyErr_Occurred` را فراخوانی کنید." msgid "Use :meth:`~object.__complex__` if available." -msgstr "" +msgstr "در صورت وجود، از :meth:`~object.__complex__` استفاده کنید." msgid "Return the imaginary part of *op* as a C :c:expr:`double`." -msgstr "" +msgstr "بخش موهومی *op* را به‌صورت یک :c:expr:`double` در C برمی‌گرداند." -msgid "If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on success." -msgstr "" +msgid "" +"If *op* is not a Python complex number object but has a " +":meth:`~object.__complex__` method, this method will first be called to " +"convert *op* to a Python complex number object. If :meth:`!__complex__` is " +"not defined then it falls back to call :c:func:`PyFloat_AsDouble` and " +"returns ``0.0`` on success." +msgstr "" +"اگر *op* یک شیء عدد مختلط پایتون نباشد اما متد :meth:`~object.__complex__` " +"را داشته باشد، این متد ابتدا برای تبدیل *op* به یک شیء عدد مختلط پایتون " +"فراخوانی می‌شود. اگر :meth:`!__complex__` تعریف نشده باشد، به فراخوانی " +":c:func:`PyFloat_AsDouble` روی می‌آورد و در صورت موفقیت مقدار ``0.0`` را " +"برمی‌گرداند." msgid "Return the :c:type:`Py_complex` value of the complex number *op*." -msgstr "" +msgstr "مقدار :c:type:`Py_complex` عدد مختلط *op* را برمی‌گرداند." -msgid "If *op* is not a Python complex number object but has a :meth:`~object.__complex__` method, this method will first be called to convert *op* to a Python complex number object. If :meth:`!__complex__` is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`." -msgstr "" +msgid "" +"If *op* is not a Python complex number object but has a " +":meth:`~object.__complex__` method, this method will first be called to " +"convert *op* to a Python complex number object. If :meth:`!__complex__` is " +"not defined then it falls back to :meth:`~object.__float__`. If " +":meth:`!__float__` is not defined then it falls back to " +":meth:`~object.__index__`." +msgstr "" +"اگر *op* یک شیء عدد مختلط پایتون نباشد اما متد :meth:`~object.__complex__` " +"را داشته باشد، این متد ابتدا فراخوانی می‌شود تا *op* را به یک شیء عدد مختلط " +"پایتون تبدیل کند. اگر :meth:`!__complex__` تعریف‌نشده باشد، به جای آن از " +":meth:`~object.__float__` استفاده می‌شود. اگر :meth:`!__float__` تعریف‌نشده " +"باشد، به جای آن از :meth:`~object.__index__` استفاده می‌شود." -msgid "Upon failure, this method returns :c:type:`Py_complex` with :c:member:`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should call :c:func:`PyErr_Occurred` to check for errors." +msgid "" +"Upon failure, this method returns :c:type:`Py_complex` with " +":c:member:`~Py_complex.real` set to ``-1.0`` and with an exception set, so " +"one should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" +"در صورت شکست، این متد یک :c:type:`Py_complex` برمی‌گرداند که " +":c:member:`~Py_complex.real` آن روی ``-1.0`` تنظیم شده و یک استثنا نیز تنظیم" +" شده است؛ بنابراین برای بررسی خطاها باید :c:func:`PyErr_Occurred` را " +"فراخوانی کرد." msgid "Use :meth:`~object.__index__` if available." -msgstr "" +msgstr "در صورت وجود، از :meth:`~object.__index__` استفاده کنید." msgid "object" -msgstr "" +msgstr "شیء" msgid "complex number" -msgstr "" +msgstr "عدد مختلط" diff --git a/c-api/concrete.po b/c-api/concrete.po index da2b910ec..0c7da120e 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -24,49 +24,77 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Concrete Objects Layer" -msgstr "" +msgstr "لایه اشیاء عینی" -msgid "The functions in this chapter are specific to certain Python object types. Passing them an object of the wrong type is not a good idea; if you receive an object from a Python program and you are not sure that it has the right type, you must perform a type check first; for example, to check that an object is a dictionary, use :c:func:`PyDict_Check`. The chapter is structured like the \"family tree\" of Python object types." -msgstr "" +msgid "" +"The functions in this chapter are specific to certain Python object types. " +"Passing them an object of the wrong type is not a good idea; if you receive " +"an object from a Python program and you are not sure that it has the right " +"type, you must perform a type check first; for example, to check that an " +"object is a dictionary, use :c:func:`PyDict_Check`. The chapter is " +"structured like the \"family tree\" of Python object types." +msgstr "" +"توابع این فصل مخصوص نوع‌های شیء خاصی از پایتون هستند. پاس دادن شیئی از نوع " +"نادرست به آن‌ها ایده خوبی نیست؛ اگر شیئی را از یک برنامه پایتون دریافت " +"می‌کنید و مطمئن نیستید که نوع درستی دارد، باید ابتدا یک بررسی نوع انجام " +"دهید؛ برای مثال، برای بررسی اینکه شیئی دیکشنری است، از " +":c:func:`PyDict_Check` استفاده کنید. ساختار این فصل مانند «درخت خانوادگی» " +"نوع‌های شیء پایتون است." -msgid "While the functions described in this chapter carefully check the type of the objects which are passed in, many of them do not check for ``NULL`` being passed instead of a valid object. Allowing ``NULL`` to be passed in can cause memory access violations and immediate termination of the interpreter." +msgid "" +"While the functions described in this chapter carefully check the type of " +"the objects which are passed in, many of them do not check for ``NULL`` " +"being passed instead of a valid object. Allowing ``NULL`` to be passed in " +"can cause memory access violations and immediate termination of the " +"interpreter." msgstr "" +"در حالی که توابع توصیف‌شده در این فصل نوع اشیایی را که به آن‌ها پاس داده " +"می‌شود با دقت بررسی می‌کنند، بسیاری از آن‌ها بررسی نمی‌کنند که به جای یک شیء" +" معتبر، ``NULL`` پاس داده شده باشد. اجازه‌ی پاس دادن ``NULL`` می‌تواند باعث " +"نقض دسترسی به حافظه و خاتمه فوری مفسر شود." msgid "Fundamental Objects" -msgstr "" +msgstr "اشیاء بنیادی" -msgid "This section describes Python type objects and the singleton object ``None``." -msgstr "" +msgid "" +"This section describes Python type objects and the singleton object " +"``None``." +msgstr "این بخش اشیاء نوع پایتون و شیء تک‌نمونه ``None`` را توصیف می‌کند." msgid "Numeric Objects" -msgstr "" +msgstr "اشیاء عددی" msgid "Sequence Objects" -msgstr "" +msgstr "شیءهای دنباله" -msgid "Generic operations on sequence objects were discussed in the previous chapter; this section deals with the specific kinds of sequence objects that are intrinsic to the Python language." +msgid "" +"Generic operations on sequence objects were discussed in the previous " +"chapter; this section deals with the specific kinds of sequence objects that" +" are intrinsic to the Python language." msgstr "" +"عملیات عمومی بر روی اشیاء دنباله در فصل پیشین بحث شد؛ این بخش به انواع خاص " +"اشیاء دنباله می‌پردازد که ذاتیِ زبان پایتون هستند." msgid "Container Objects" -msgstr "" +msgstr "اشیاء ظرف" msgid "Function Objects" -msgstr "" +msgstr "اشیاء تابع" msgid "Other Objects" -msgstr "" +msgstr "سایر اشیاء" msgid "C API for extension modules" -msgstr "" +msgstr "API زبان C برای ماژول‌های توسعه‌ای" msgid "object" -msgstr "" +msgstr "شیء" msgid "numeric" -msgstr "" +msgstr "عددی" msgid "sequence" -msgstr "" +msgstr "دنباله" msgid "mapping" -msgstr "" +msgstr "نگاشت" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 956cf9492..33f50ec45 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -25,10 +25,17 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Context Variables Objects" -msgstr "" +msgstr "اشیاء متغیرهای زمینه" -msgid "In Python 3.7.1 the signatures of all context variables C APIs were **changed** to use :c:type:`PyObject` pointers instead of :c:type:`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::" +msgid "" +"In Python 3.7.1 the signatures of all context variables C APIs were " +"**changed** to use :c:type:`PyObject` pointers instead of " +":c:type:`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, " +"e.g.::" msgstr "" +"در پایتون 3.7.1، امضاهای تمام APIهای C مربوط به متغیرهای زمینه **تغییر " +"یافتند** تا از اشاره‌گرهای :c:type:`PyObject` به‌جای :c:type:`PyContext`، " +":c:type:`PyContextVar` و :c:type:`PyContextToken` استفاده کنند، مثلاً::" msgid "" "// in 3.7.0:\n" @@ -37,108 +44,230 @@ msgid "" "// in 3.7.1+:\n" "PyObject *PyContext_New(void);" msgstr "" +"// in 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// in 3.7.1+:\n" +"PyObject *PyContext_New(void);" msgid "See :issue:`34762` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر به :issue:`34762` مراجعه کنید." -msgid "This section details the public C API for the :mod:`contextvars` module." +msgid "" +"This section details the public C API for the :mod:`contextvars` module." msgstr "" +"این بخش API عمومی C را برای ماژول :mod:`contextvars` به تفصیل شرح می‌دهد." -msgid "The C structure used to represent a :class:`contextvars.Context` object." +msgid "" +"The C structure used to represent a :class:`contextvars.Context` object." msgstr "" +"ساختار C که برای بازنمایی یک شیء :class:`contextvars.Context` استفاده " +"می‌شود." -msgid "The C structure used to represent a :class:`contextvars.ContextVar` object." +msgid "" +"The C structure used to represent a :class:`contextvars.ContextVar` object." msgstr "" +"ساختار C که برای نمایش یک شیء :class:`contextvars.ContextVar` استفاده " +"می‌شود." msgid "The C structure used to represent a :class:`contextvars.Token` object." msgstr "" +"ساختار C که برای نمایش یک شیء :class:`contextvars.Token` استفاده می‌شود." msgid "The type object representing the *context* type." -msgstr "" +msgstr "شیء نوعی که نوع *زمینه* را نشان می‌دهد." msgid "The type object representing the *context variable* type." -msgstr "" +msgstr "شیء نوعی که نوع *متغیر زمینه* را نشان می‌دهد." msgid "The type object representing the *context variable token* type." -msgstr "" +msgstr "شیء نوعی که نوع *توکن متغیر زمینه* را نشان می‌دهد." msgid "Type-check macros:" -msgstr "" +msgstr "ماکروهای بررسی نوع:" -msgid "Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be " +"``NULL``. This function always succeeds." msgstr "" +"اگر *o* از نوع :c:data:`PyContext_Type` باشد، مقدار true را برمی‌گرداند. *o*" +" نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be " +"``NULL``. This function always succeeds." msgstr "" +"اگر *o* از نوع :c:data:`PyContextVar_Type` باشد، مقدار true را برمی‌گرداند. " +"*o* نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be" +" ``NULL``. This function always succeeds." msgstr "" +"اگر *o* از نوع :c:data:`PyContextToken_Type` باشد، مقدار true را " +"برمی‌گرداند. *o* نباید ``NULL`` باشد. این تابع همیشه موفق می‌شود." msgid "Context object management functions:" -msgstr "" +msgstr "توابع مدیریت شیء زمینه:" -msgid "Create a new empty context object. Returns ``NULL`` if an error has occurred." +msgid "" +"Create a new empty context object. Returns ``NULL`` if an error has " +"occurred." msgstr "" +"یک شیء زمینه‌ی خالی جدید ایجاد می‌کند. اگر خطایی رخ داده باشد، ``NULL`` را " +"برمی‌گرداند." -msgid "Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` if an error has occurred." +msgid "" +"Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` " +"if an error has occurred." msgstr "" +"یک کپی سطحی از شیء زمینه‌ی *ctx* ارسال‌شده ایجاد می‌کند. اگر خطایی رخ داده " +"باشد، ``NULL`` برمی‌گرداند." -msgid "Create a shallow copy of the current thread context. Returns ``NULL`` if an error has occurred." +msgid "" +"Create a shallow copy of the current thread context. Returns ``NULL`` if an " +"error has occurred." msgstr "" +"یک کپی سطحی از زمینه نخ فعلی ایجاد می‌کند. اگر خطایی رخ داده باشد، ``NULL`` " +"را برمی‌گرداند." -msgid "Set *ctx* as the current context for the current thread. Returns ``0`` on success, and ``-1`` on error." +msgid "" +"Set *ctx* as the current context for the current thread. Returns ``0`` on " +"success, and ``-1`` on error." msgstr "" +"*ctx* را به‌عنوان زمینه جاری برای نخ جاری تنظیم می‌کند. در صورت موفقیت ``0``" +" و در صورت خطا ``-1`` برمی‌گرداند." -msgid "Deactivate the *ctx* context and restore the previous context as the current context for the current thread. Returns ``0`` on success, and ``-1`` on error." +msgid "" +"Deactivate the *ctx* context and restore the previous context as the current" +" context for the current thread. Returns ``0`` on success, and ``-1`` on " +"error." msgstr "" +"زمینه‌ی *ctx* را غیرفعال می‌کند و زمینه‌ی قبلی را به‌عنوان زمینه‌ی جاری برای" +" نخ جاری بازگردانی می‌کند. در صورت موفقیت ``0`` و در صورت خطا ``-1`` " +"برمی‌گرداند." -msgid "Register *callback* as a context object watcher for the current interpreter. Return an ID which may be passed to :c:func:`PyContext_ClearWatcher`. In case of error (e.g. no more watcher IDs available), return ``-1`` and set an exception." +msgid "" +"Register *callback* as a context object watcher for the current interpreter." +" Return an ID which may be passed to :c:func:`PyContext_ClearWatcher`. In " +"case of error (e.g. no more watcher IDs available), return ``-1`` and set an" +" exception." msgstr "" +"*callback* را به‌عنوان دیده‌بان شیء زمینه برای مفسر فعلی ثبت می‌کند. " +"شناسه‌ای برمی‌گرداند که می‌توان آن را به :c:func:`PyContext_ClearWatcher` " +"پاس داد. در صورت خطا (برای مثال، وقتی دیگر شناسه‌ی دیده‌بانی در دسترس نیست)،" +" مقدار ``-1`` برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "Clear watcher identified by *watcher_id* previously returned from :c:func:`PyContext_AddWatcher` for the current interpreter. Return ``0`` on success, or ``-1`` and set an exception on error (e.g. if the given *watcher_id* was never registered.)" +msgid "" +"Clear watcher identified by *watcher_id* previously returned from " +":c:func:`PyContext_AddWatcher` for the current interpreter. Return ``0`` on " +"success, or ``-1`` and set an exception on error (e.g. if the given " +"*watcher_id* was never registered.)" msgstr "" +"دیده‌بان شناسایی‌شده با *watcher_id* که پیش‌تر از " +":c:func:`PyContext_AddWatcher` برگردانده شده است را برای مفسر جاری حذف " +"می‌کند. در صورت موفقیت ``0`` را برمی‌گرداند، یا در صورت خطا ``-1`` را " +"برمی‌گرداند و یک استثنا تنظیم می‌کند (برای مثال، اگر *watcher_id* داده‌شده " +"هرگز ثبت نشده باشد.)" msgid "Enumeration of possible context object watcher events:" -msgstr "" +msgstr "شمارش رویدادهای ممکن دیده‌بان (watcher) شیء زمینه:" -msgid "``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a different context. The object passed to the watch callback is the now-current :class:`contextvars.Context` object, or None if no context is current." +msgid "" +"``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a " +"different context. The object passed to the watch callback is the now-" +"current :class:`contextvars.Context` object, or None if no context is " +"current." msgstr "" +"``Py_CONTEXT_SWITCHED``: :term:`current context` به زمینه‌ای متفاوت تغییر " +"کرده است. شیء پاس‌داده‌شده به کال‌بک نظارت، شیء " +":class:`contextvars.Context` است که اکنون فعلی است، یا در صورتی که هیچ " +"زمینه‌ای فعلی نباشد، None است." -msgid "Context object watcher callback function. The object passed to the callback is event-specific; see :c:type:`PyContextEvent` for details." +msgid "" +"Context object watcher callback function. The object passed to the callback" +" is event-specific; see :c:type:`PyContextEvent` for details." msgstr "" +"تابع کال‌بک ناظر شیء زمینه. شیء پاس‌داده‌شده به کال‌بک مختص رویداد است؛ برای" +" جزئیات به :c:type:`PyContextEvent` مراجعه کنید." -msgid "If the callback returns with an exception set, it must return ``-1``; this exception will be printed as an unraisable exception using :c:func:`PyErr_FormatUnraisable`. Otherwise it should return ``0``." +msgid "" +"If the callback returns with an exception set, it must return ``-1``; this " +"exception will be printed as an unraisable exception using " +":c:func:`PyErr_FormatUnraisable`. Otherwise it should return ``0``." msgstr "" +"اگر کال‌بک همراه با استثنای تنظیم‌شده بازگردد، باید ``-1`` را برگرداند؛ این " +"استثنا با استفاده از :c:func:`PyErr_FormatUnraisable` به‌عنوان یک استثنای " +"غیرقابل‌پرتاب (unraisable exception) چاپ خواهد شد. در غیر این صورت، باید " +"``0`` را برگرداند." -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 set. This means the callback may not call any other API that can set an exception unless it saves and clears the exception state first, and restores it before returning." -msgstr "" +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 " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores" +" it before returning." +msgstr "" +"ممکن است در هنگام ورود به کال‌بک، از قبل یک استثنای در انتظار تنظیم شده " +"باشد. در این حالت، کال‌بک باید ``0`` را همراه با همان استثنای همچنان " +"تنظیم‌شده برگرداند. این بدان معناست که کال‌بک نباید هیچ API دیگری را که " +"می‌تواند استثنا تنظیم کند فراخوانی کند، مگر آنکه ابتدا وضعیت استثنا را ذخیره" +" و پاک کند و پیش از بازگشت، آن را بازیابی کند." msgid "Context variable functions:" -msgstr "" +msgstr "توابع متغیر زمینه:" -msgid "Create a new ``ContextVar`` object. The *name* parameter is used for introspection and debug purposes. The *def* parameter specifies a default value for the context variable, or ``NULL`` for no default. If an error has occurred, this function returns ``NULL``." +msgid "" +"Create a new ``ContextVar`` object. The *name* parameter is used for " +"introspection and debug purposes. The *def* parameter specifies a default " +"value for the context variable, or ``NULL`` for no default. If an error has " +"occurred, this function returns ``NULL``." msgstr "" +"یک شیء ``ContextVar`` جدید ایجاد می‌کند. پارامتر *name* برای اهداف درون‌نگری" +" و اشکال‌زدایی استفاده می‌شود. پارامتر *def* یک مقدار پیش‌فرض برای متغیر " +"زمینه مشخص می‌کند، یا ``NULL`` در صورت نبود مقدار پیش‌فرض. اگر خطایی رخ داده" +" باشد، این تابع ``NULL`` برمی‌گرداند." -msgid "Get the value of a context variable. Returns ``-1`` if an error has occurred during lookup, and ``0`` if no error occurred, whether or not a value was found." +msgid "" +"Get the value of a context variable. Returns ``-1`` if an error has " +"occurred during lookup, and ``0`` if no error occurred, whether or not a " +"value was found." msgstr "" +"گرفتن مقدار یک متغیر زمینه. اگر در حین جستجو خطایی رخ داده باشد، ``-1`` و " +"اگر خطایی رخ نداده باشد، ``0`` برمی‌گرداند؛ صرف‌نظر از اینکه مقداری یافت شده" +" است یا نه." -msgid "If the context variable was found, *value* will be a pointer to it. If the context variable was *not* found, *value* will point to:" +msgid "" +"If the context variable was found, *value* will be a pointer to it. If the " +"context variable was *not* found, *value* will point to:" msgstr "" +"اگر متغیر زمینه یافته شود، *value* اشاره‌گری به آن خواهد بود. اگر متغیر " +"زمینه یافته *نشود*، *value* به موارد زیر اشاره خواهد کرد:" msgid "*default_value*, if not ``NULL``;" -msgstr "" +msgstr "*default_value*، اگر ``NULL`` نباشد؛" msgid "the default value of *var*, if not ``NULL``;" -msgstr "" +msgstr "مقدار پیش‌فرض *var*، اگر ``NULL`` نباشد؛" msgid "``NULL``" -msgstr "" +msgstr "``NULL``" msgid "Except for ``NULL``, the function returns a new reference." -msgstr "" +msgstr "به‌جز ``NULL``، تابع یک ارجاع جدید برمی‌گرداند." -msgid "Set the value of *var* to *value* in the current context. Returns a new token object for this change, or ``NULL`` if an error has occurred." +msgid "" +"Set the value of *var* to *value* in the current context. Returns a new " +"token object for this change, or ``NULL`` if an error has occurred." msgstr "" +"مقدار *var* را در زمینه‌ی فعلی به *value* تنظیم می‌کند. یک شیء توکن جدید " +"برای این تغییر برمی‌گرداند، یا در صورت وقوع خطا ``NULL``." -msgid "Reset the state of the *var* context variable to that it was in before :c:func:`PyContextVar_Set` that returned the *token* was called. This function returns ``0`` on success and ``-1`` on error." +msgid "" +"Reset the state of the *var* context variable to that it was in before " +":c:func:`PyContextVar_Set` that returned the *token* was called. This " +"function returns ``0`` on success and ``-1`` on error." msgstr "" +"وضعیت متغیر زمینه *var* را به وضعیت پیش از فراخوانی " +":c:func:`PyContextVar_Set` (که *token* را برگردانده بود) بازنشانی می‌کند. " +"این تابع در صورت موفقیت ``0`` و در صورت خطا ``-1`` برمی‌گرداند." diff --git a/c-api/conversion.po b/c-api/conversion.po index 7e12c603c..b1221ef3e 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -22,166 +22,376 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "String conversion and formatting" -msgstr "" +msgstr "تبدیل و قالب‌بندی رشته" msgid "Functions for number conversion and formatted string output." -msgstr "" +msgstr "توابعی برای تبدیل عدد و خروجی رشته‌ی قالب‌بندی‌شده." -msgid "Output not more than *size* bytes to *str* according to the format string *format* and the extra arguments. See the Unix man page :manpage:`snprintf(3)`." +msgid "" +"Output not more than *size* bytes to *str* according to the format string " +"*format* and the extra arguments. See the Unix man page " +":manpage:`snprintf(3)`." msgstr "" +"حداکثر *size* بایت را مطابق رشته قالب *format* و آرگومان‌های اضافی به *str* " +"خروجی بدهید. صفحه راهنمای یونیکس :manpage:`snprintf(3)` را ببینید." -msgid "Output not more than *size* bytes to *str* according to the format string *format* and the variable argument list *va*. Unix man page :manpage:`vsnprintf(3)`." +msgid "" +"Output not more than *size* bytes to *str* according to the format string " +"*format* and the variable argument list *va*. Unix man page " +":manpage:`vsnprintf(3)`." msgstr "" +"مطابق رشته قالب‌بندی *format* و فهرست آرگومان‌های متغیر *va*، حداکثر *size* " +"بایت را به *str* خروجی می‌دهد. صفحه راهنمای man یونیکس " +":manpage:`vsnprintf(3)`." -msgid ":c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C library functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose is to guarantee consistent behavior in corner cases, which the Standard C functions do not." +msgid "" +":c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C " +"library functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose " +"is to guarantee consistent behavior in corner cases, which the Standard C " +"functions do not." msgstr "" +":c:func:`PyOS_snprintf` و :c:func:`PyOS_vsnprintf` توابع :c:func:`snprintf` " +"و :c:func:`vsnprintf` کتابخانه‌ی استاندارد C را پوشش می‌دهند. هدف آن‌ها " +"تضمین رفتار سازگار در حالت‌های حاشیه‌ای (corner cases) است؛ چیزی که توابع " +"استاندارد C انجام نمی‌دهند." -msgid "The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. They never write more than *size* bytes (including the trailing ``'\\0'``) into str. Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL`` and ``size < INT_MAX``. Note that this means there is no equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine the necessary buffer size." -msgstr "" +msgid "" +"The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. " +"They never write more than *size* bytes (including the trailing ``'\\0'``) " +"into str. Both functions require that ``str != NULL``, ``size > 0``, " +"``format != NULL`` and ``size < INT_MAX``. Note that this means there is no " +"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine " +"the necessary buffer size." +msgstr "" +"این توابع پوششی تضمین می‌کنند که ``str[size-1]`` پس از بازگشت همیشه " +"``'\\0'`` باشد. آن‌ها هرگز بیش از *size* بایت (شامل ``'\\0'`` انتهایی) در " +"str نمی‌نویسند. هر دو تابع نیاز دارند که ``str != NULL``، ``size > 0``، " +"``format != NULL`` و ``size < INT_MAX`` باشد. توجه داشته باشید که این بدان " +"معناست که معادلی برای ``n = snprintf(NULL, 0, ...)`` در C99 وجود ندارد که " +"اندازه‌ی بافر لازم را تعیین کند." -msgid "The return value (*rv*) for these functions should be interpreted as follows:" -msgstr "" +msgid "" +"The return value (*rv*) for these functions should be interpreted as " +"follows:" +msgstr "مقدار بازگشتی (*rv*) برای این توابع باید به شرح زیر تفسیر شود:" -msgid "When ``0 <= rv < size``, the output conversion was successful and *rv* characters were written to *str* (excluding the trailing ``'\\0'`` byte at ``str[rv]``)." +msgid "" +"When ``0 <= rv < size``, the output conversion was successful and *rv* " +"characters were written to *str* (excluding the trailing ``'\\0'`` byte at " +"``str[rv]``)." msgstr "" +"وقتی ``0 <= rv < size`` باشد، تبدیل خروجی با موفقیت انجام شده و *rv* نویسه " +"در *str* نوشته شده است (بدون احتساب بایت انتهایی ``'\\0'`` در ``str[rv]``)." -msgid "When ``rv >= size``, the output conversion was truncated and a buffer with ``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is ``'\\0'`` in this case." +msgid "" +"When ``rv >= size``, the output conversion was truncated and a buffer with " +"``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is " +"``'\\0'`` in this case." msgstr "" +"وقتی ``rv >= size`` باشد، تبدیل خروجی بریده شده است و برای موفقیت، بافری با " +"``rv + 1`` بایت لازم بود. در این حالت، ``str[size-1]`` برابر با ``'\\0'`` " +"است." -msgid "When ``rv < 0``, the output conversion failed and ``str[size-1]`` is ``'\\0'`` in this case too, but the rest of *str* is undefined. The exact cause of the error depends on the underlying platform." +msgid "" +"When ``rv < 0``, the output conversion failed and ``str[size-1]`` is " +"``'\\0'`` in this case too, but the rest of *str* is undefined. The exact " +"cause of the error depends on the underlying platform." msgstr "" +"وقتی ``rv < 0`` باشد، تبدیل خروجی شکست خورده و در این حالت نیز " +"``str[size-1]`` برابر ``'\\0'`` است، اما بقیه‌ی *str* تعریف‌نشده است. علت " +"دقیق خطا به پلتفرم زیرین بستگی دارد." -msgid "The following functions provide locale-independent string to number conversions." -msgstr "" +msgid "" +"The following functions provide locale-independent string to number " +"conversions." +msgstr "توابع زیر تبدیل رشته به عدد را به‌صورت مستقل از locale ارائه می‌دهند." -msgid "Convert the initial part of the string in ``str`` to an :c:expr:`unsigned long` value according to the given ``base``, which must be between ``2`` and ``36`` inclusive, or be the special value ``0``." +msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`unsigned " +"long` value according to the given ``base``, which must be between ``2`` and" +" ``36`` inclusive, or be the special value ``0``." msgstr "" +"بخش ابتدایی رشته در ``str`` را مطابق با ``base`` داده‌شده — که باید مقداری " +"بین ``2`` و ``36`` (با احتساب هر دو) یا مقدار ویژه‌ی ``0`` باشد — به مقدار " +":c:expr:`unsigned long` تبدیل می‌کند." -msgid "Leading white space and case of characters are ignored. If ``base`` is zero it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If these are absent it defaults to ``10``. Base must be 0 or between 2 and 36 (inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the end of the scan." -msgstr "" +msgid "" +"Leading white space and case of characters are ignored. If ``base`` is zero" +" it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If " +"these are absent it defaults to ``10``. Base must be 0 or between 2 and 36 " +"(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " +"end of the scan." +msgstr "" +"فضای سفید ابتدایی و بزرگی و کوچکی نویسه‌ها نادیده گرفته می‌شوند. اگر " +"``base`` صفر باشد، به دنبال ``0b``، ``0o`` یا ``0x`` ابتدایی می‌گردد تا مشخص" +" کند که مبنا کدام است. اگر این‌ها وجود نداشته باشند، مبنا به طور پیش‌فرض " +"``10`` خواهد بود. مبنا باید ۰ یا عددی بین ۲ و ۳۶ (با احتساب هر دو) باشد. اگر" +" ``ptr`` غیر از ``NULL`` باشد، حاوی اشاره‌گری به انتهای پویش خواهد بود." -msgid "If the converted value falls out of range of corresponding return type, range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is returned." +msgid "" +"If the converted value falls out of range of corresponding return type, " +"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and " +":c:macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0``" +" is returned." msgstr "" +"اگر مقدار تبدیل‌شده از محدوده‌ی نوع بازگشتی مربوطه خارج شود، خطای محدوده رخ " +"می‌دهد (:c:data:`errno` برابر :c:macro:`!ERANGE` قرار می‌گیرد) و " +":c:macro:`!ULONG_MAX` برگردانده می‌شود. اگر نتوان هیچ تبدیلی انجام داد، " +"``0`` برگردانده می‌شود." msgid "See also the Unix man page :manpage:`strtoul(3)`." msgstr "" +"همچنین صفحه‌ی راهنما (man page) یونیکس :manpage:`strtoul(3)` را ببینید." -msgid "Convert the initial part of the string in ``str`` to an :c:expr:`long` value according to the given ``base``, which must be between ``2`` and ``36`` inclusive, or be the special value ``0``." +msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`long` value" +" according to the given ``base``, which must be between ``2`` and ``36`` " +"inclusive, or be the special value ``0``." msgstr "" +"بخش ابتدایی رشته در ``str`` را بر اساس ``base`` داده‌شده، که باید عددی بین " +"``2`` و ``36`` (با احتساب هر دو) یا مقدار ویژه ``0`` باشد، به مقدار " +":c:expr:`long` تبدیل می‌کند." -msgid "Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead and :c:macro:`LONG_MAX` on overflows." +msgid "" +"Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " +"and :c:macro:`LONG_MAX` on overflows." msgstr "" +"مانند :c:func:`PyOS_strtoul` است، اما به‌جای آن مقدار :c:expr:`long` و در " +"صورت سرریز :c:macro:`LONG_MAX` برمی‌گرداند." msgid "See also the Unix man page :manpage:`strtol(3)`." -msgstr "" +msgstr "همچنین صفحه‌ی man یونیکس :manpage:`strtol(3)` را ببینید." -msgid "Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on failure. The set of accepted strings corresponds to the set of strings accepted by Python's :func:`float` constructor, except that ``s`` must not have leading or trailing whitespace. The conversion is independent of the current locale." +msgid "" +"Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " +"failure. The set of accepted strings corresponds to the set of strings " +"accepted by Python's :func:`float` constructor, except that ``s`` must not " +"have leading or trailing whitespace. The conversion is independent of the " +"current locale." msgstr "" +"رشته‌ی ``s`` را به :c:expr:`double` تبدیل می‌کند و در صورت شکست، یک استثنای " +"پایتون ایجاد می‌کند. مجموعه‌ی رشته‌های پذیرفته‌شده با مجموعه‌ی رشته‌هایی که " +"سازنده‌ی :func:`float` پایتون می‌پذیرد مطابقت دارد، به جز اینکه ``s`` نباید " +"فضای سفید ابتدایی یا انتهایی داشته باشد. این تبدیل مستقل از locale جاری است." -msgid "If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:`ValueError` and return ``-1.0`` if the string is not a valid representation of a floating-point number." +msgid "" +"If ``endptr`` is ``NULL``, convert the whole string. Raise " +":exc:`ValueError` and return ``-1.0`` if the string is not a valid " +"representation of a floating-point number." msgstr "" +"اگر ``endptr`` برابر ``NULL`` باشد، کل رشته تبدیل می‌شود. اگر رشته نمایش " +"معتبری از یک عدد ممیز شناور نباشد، استثنای :exc:`ValueError` برافراخته " +"می‌شود و ``-1.0`` برگردانده می‌شود." -msgid "If endptr is not ``NULL``, convert as much of the string as possible and set ``*endptr`` to point to the first unconverted character. If no initial segment of the string is the valid representation of a floating-point number, set ``*endptr`` to point to the beginning of the string, raise ValueError, and return ``-1.0``." -msgstr "" +msgid "" +"If endptr is not ``NULL``, convert as much of the string as possible and set" +" ``*endptr`` to point to the first unconverted character. If no initial " +"segment of the string is the valid representation of a floating-point " +"number, set ``*endptr`` to point to the beginning of the string, raise " +"ValueError, and return ``-1.0``." +msgstr "" +"اگر endptr برابر ``NULL`` نباشد، تا حد امکان رشته را تبدیل می‌کند و " +"``*endptr`` را طوری تنظیم می‌کند که به نخستین نویسه‌ی تبدیل‌نشده اشاره کند. " +"اگر هیچ بخش آغازینی از رشته، نمای معتبر یک عدد ممیز شناور نباشد، ``*endptr``" +" را طوری تنظیم می‌کند که به ابتدای رشته اشاره کند، استثنای ValueError ایجاد " +"می‌کند و ``-1.0`` را برمی‌گرداند." -msgid "If ``s`` represents a value that is too large to store in a float (for example, ``\"1e500\"`` is such a string on many platforms) then if ``overflow_exception`` is ``NULL`` return ``Py_INFINITY`` (with an appropriate sign) and don't set any exception. Otherwise, ``overflow_exception`` must point to a Python exception object; raise that exception and return ``-1.0``. In both cases, set ``*endptr`` to point to the first character after the converted value." -msgstr "" +msgid "" +"If ``s`` represents a value that is too large to store in a float (for " +"example, ``\"1e500\"`` is such a string on many platforms) then if " +"``overflow_exception`` is ``NULL`` return ``Py_INFINITY`` (with an " +"appropriate sign) and don't set any exception. Otherwise, " +"``overflow_exception`` must point to a Python exception object; raise that " +"exception and return ``-1.0``. In both cases, set ``*endptr`` to point to " +"the first character after the converted value." +msgstr "" +"اگر ``s`` مقداری را بازنمایی کند که برای ذخیره‌سازی در یک عدد اعشاری بیش از " +"حد بزرگ است (برای مثال، ``\"1e500\"`` در بسیاری از پلتفرم‌ها چنین رشته‌ای " +"است)، آنگاه اگر ``overflow_exception`` برابر ``NULL`` باشد، ``Py_INFINITY`` " +"را (با علامت مناسب) بازگردانید و هیچ استثنایی تنظیم نکنید. در غیر این صورت، " +"``overflow_exception`` باید به یک شیء استثنای پایتون اشاره کند؛ آن استثنا را" +" برانگیزید و ``-1.0`` را بازگردانید. در هر دو حالت، ``*endptr`` را طوری " +"تنظیم کنید که به نخستین نویسه‌ی پس از مقدار تبدیل‌شده اشاره کند." -msgid "If any other error occurs during the conversion (for example an out-of-memory error), set the appropriate Python exception and return ``-1.0``." +msgid "" +"If any other error occurs during the conversion (for example an out-of-" +"memory error), set the appropriate Python exception and return ``-1.0``." msgstr "" +"اگر خطای دیگری در حین تبدیل رخ دهد (برای مثال، خطای کمبود حافظه)، استثنای " +"مناسب پایتون را تنظیم کرده و ``-1.0`` را برگردانید." -msgid "Convert a :c:expr:`double` *val* to a string using supplied *format_code*, *precision*, and *flags*." +msgid "" +"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " +"*precision*, and *flags*." msgstr "" +"تبدیل *val* از نوع :c:expr:`double` به یک رشته با استفاده از *format_code*، " +"*precision* و *flags* داده‌شده." -msgid "*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is ignored. The ``'r'`` format code specifies the standard :func:`repr` format." +msgid "" +"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " +"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is " +"ignored. The ``'r'`` format code specifies the standard :func:`repr` " +"format." msgstr "" +"*format_code* باید یکی از ``'e'``، ``'E'``، ``'f'``، ``'F'``، ``'g'``، " +"``'G'`` یا ``'r'`` باشد. برای ``'r'``، *precision* داده‌شده باید ۰ باشد و " +"نادیده گرفته می‌شود. کد قالب ``'r'`` قالب استاندارد :func:`repr` را مشخص " +"می‌کند." msgid "*flags* can be zero or more of the following values or-ed together:" msgstr "" +"*flags* می‌تواند صفر یا بیشتر از مقادیر زیر باشد که با عملگر OR با هم ترکیب " +"شده‌اند:" -msgid "Always precede the returned string with a sign character, even if *val* is non-negative." +msgid "" +"Always precede the returned string with a sign character, even if *val* is " +"non-negative." msgstr "" +"همیشه پیش از رشته‌ی بازگردانده‌شده یک نویسه‌ی علامت قرار دهید، حتی اگر *val*" +" نامنفی باشد." msgid "Ensure that the returned string will not look like an integer." -msgstr "" +msgstr "مطمئن شوید که رشته‌ی بازگردانده‌شده شبیه یک عدد صحیح به نظر نرسد." -msgid "Apply \"alternate\" formatting rules. See the documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." +msgid "" +"Apply \"alternate\" formatting rules. See the documentation for the " +":c:func:`PyOS_snprintf` ``'#'`` specifier for details." msgstr "" +"قواعد قالب‌بندی «جایگزین» را اعمال می‌کند. برای جزئیات، مستندات مشخص‌کننده‌ی" +" ``'#'`` در :c:func:`PyOS_snprintf` را ببینید." msgid "Negative zero is converted to positive zero." -msgstr "" +msgstr "صفر منفی به صفر مثبت تبدیل می‌شود." -msgid "If *ptype* is non-``NULL``, then the value it points to will be set to one of the following constants depending on the type of *val*:" +msgid "" +"If *ptype* is non-``NULL``, then the value it points to will be set to one " +"of the following constants depending on the type of *val*:" msgstr "" +"اگر *ptype* غیر از ``NULL`` باشد، مقداری که به آن اشاره می‌کند بسته به نوع " +"*val* به یکی از ثابت‌های زیر تنظیم خواهد شد:" msgid "*\\*ptype*" -msgstr "" +msgstr "*\\*ptype*" msgid "type of *val*" -msgstr "" +msgstr "نوع *val*" msgid "finite number" -msgstr "" +msgstr "عدد متناهی" msgid "infinite number" -msgstr "" +msgstr "عدد بی‌نهایت" msgid "not a number" -msgstr "" +msgstr "عدد نیست" -msgid "The return value is a pointer to *buffer* with the converted string or ``NULL`` if the conversion failed. The caller is responsible for freeing the returned string by calling :c:func:`PyMem_Free`." +msgid "" +"The return value is a pointer to *buffer* with the converted string or " +"``NULL`` if the conversion failed. The caller is responsible for freeing the" +" returned string by calling :c:func:`PyMem_Free`." msgstr "" +"مقدار بازگشتی اشاره‌گری به *بافر* حاوی رشته‌ی تبدیل‌شده است، یا در صورت شکست" +" در تبدیل، ``NULL`` است. فراخواننده مسئول آزاد کردن رشته‌ی بازگردانده‌شده از" +" طریق فراخوانی :c:func:`PyMem_Free` است." -msgid "Case insensitive comparison of strings. These functions work almost identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), except that they ignore the case of ASCII characters." +msgid "" +"Case insensitive comparison of strings. These functions work almost " +"identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), " +"except that they ignore the case of ASCII characters." msgstr "" +"مقایسه‌ی رشته‌ها بدون حساسیت به بزرگی و کوچکی حروف. این توابع تقریباً به‌طور" +" یکسان با :c:func:`!strcmp` و :c:func:`!strncmp` (به ترتیب) کار می‌کنند، با " +"این تفاوت که بزرگی و کوچکی نویسه‌های اسکی را نادیده می‌گیرند." -msgid "Return ``0`` if the strings are equal, a negative value if *str1* sorts lexicographically before *str2*, or a positive value if it sorts after." +msgid "" +"Return ``0`` if the strings are equal, a negative value if *str1* sorts " +"lexicographically before *str2*, or a positive value if it sorts after." msgstr "" +"اگر رشته‌ها برابر باشند ``0``، اگر *str1* از نظر ترتیب لغت‌نگارتی قبل از " +"*str2* مرتب شود مقداری منفی، یا اگر بعد از آن مرتب شود مقداری مثبت " +"برمی‌گرداند." -msgid "In the *str1* or *str2* arguments, a NUL byte marks the end of the string. For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size of the string, as if NUL was present at the index given by *size*." +msgid "" +"In the *str1* or *str2* arguments, a NUL byte marks the end of the string. " +"For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size " +"of the string, as if NUL was present at the index given by *size*." msgstr "" +"در آرگومان‌های *str1* یا *str2*، بایت تهی پایان رشته را مشخص می‌کند. برای " +":c:func:`!PyOS_mystrnicmp`، آرگومان *size* حداکثر اندازه‌ی رشته را تعیین " +"می‌کند؛ گویی که بایت تهی در اندیسی که *size* می‌دهد وجود داشته باشد." msgid "These functions do not use the locale." -msgstr "" +msgstr "این توابع از locale استفاده نمی‌کنند." msgid "Case insensitive comparison of strings." -msgstr "" +msgstr "مقایسه رشته‌ها بدون توجه به بزرگی و کوچکی حروف." -msgid "On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`, respectively." +msgid "" +"On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`," +" respectively." msgstr "" +"در ویندوز، این‌ها به ترتیب نام‌های مستعارِ :c:func:`!stricmp` و " +":c:func:`!strnicmp` هستند." -msgid "On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and :c:func:`PyOS_mystrnicmp`, respectively." +msgid "" +"On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and " +":c:func:`PyOS_mystrnicmp`, respectively." msgstr "" +"در پلتفرم‌های دیگر، آن‌ها به ترتیب نام‌های مستعاری از " +":c:func:`PyOS_mystricmp` و :c:func:`PyOS_mystrnicmp` هستند." msgid "Character classification and conversion" -msgstr "" +msgstr "طبقه‌بندی و تبدیل نویسه‌ها" -msgid "The following macros provide locale-independent (unlike the C standard library ``ctype.h``) character classification and conversion. The argument must be a signed or unsigned :c:expr:`char`." +msgid "" +"The following macros provide locale-independent (unlike the C standard " +"library ``ctype.h``) character classification and conversion. The argument " +"must be a signed or unsigned :c:expr:`char`." msgstr "" +"ماکروهای زیر طبقه‌بندی و تبدیل نویسه‌ها را به‌صورت مستقل از locale (برخلاف " +"کتابخانه استاندارد C ``ctype.h``) فراهم می‌کنند. آرگومان باید یک " +":c:expr:`char` علامت‌دار یا بدون علامت باشد." msgid "Return true if the character *c* is an alphanumeric character." -msgstr "" +msgstr "اگر نویسه *c* یک نویسه الفبایی‌عددی باشد، مقدار درست را برمی‌گرداند." -msgid "Return true if the character *c* is an alphabetic character (``a-z`` and ``A-Z``)." +msgid "" +"Return true if the character *c* is an alphabetic character (``a-z`` and " +"``A-Z``)." msgstr "" +"اگر نویسه‌ی *c* یک نویسه‌ی الفبایی باشد (``a-z`` و ``A-Z``)، مقدار true را " +"برمی‌گرداند." msgid "Return true if the character *c* is a decimal digit (``0-9``)." msgstr "" +"اگر نویسه *c* یک رقم ده‌دهی (``0-9``) باشد، مقدار true را برمی‌گرداند." -msgid "Return true if the character *c* is a lowercase ASCII letter (``a-z``)." +msgid "" +"Return true if the character *c* is a lowercase ASCII letter (``a-z``)." msgstr "" +"اگر نویسه *c* یک حرف کوچک اسکی (``a-z``) باشد، مقدار true را برمی‌گرداند." -msgid "Return true if the character *c* is an uppercase ASCII letter (``A-Z``)." +msgid "" +"Return true if the character *c* is an uppercase ASCII letter (``A-Z``)." msgstr "" +"اگر نویسه‌ی *c* یک حرف بزرگ اسکی (``A-Z``) باشد، مقدار true را برمی‌گرداند." -msgid "Return true if the character *c* is a whitespace character (space, tab, carriage return, newline, vertical tab, or form feed)." +msgid "" +"Return true if the character *c* is a whitespace character (space, tab, " +"carriage return, newline, vertical tab, or form feed)." msgstr "" +"در صورتی که نویسه *c* یک نویسه فاصله‌ساز (whitespace) باشد (فاصله، تب، " +"بازگشت به ابتدای سطر، سطر جدید، تب عمودی یا تغذیه‌ی صفحه)، true برمی‌گرداند." -msgid "Return true if the character *c* is a hexadecimal digit (``0-9``, ``a-f``, and ``A-F``)." +msgid "" +"Return true if the character *c* is a hexadecimal digit (``0-9``, ``a-f``, " +"and ``A-F``)." msgstr "" +"اگر نویسه *c* یک رقم در مبنای شانزده باشد (``0-9``، ``a-f`` و ``A-F``)، " +"مقدار درست را برمی‌گرداند." msgid "Return the lowercase equivalent of the character *c*." -msgstr "" +msgstr "بازگرداندن معادل کوچک نویسه‌ی *c*." msgid "Return the uppercase equivalent of the character *c*." -msgstr "" +msgstr "معادل بزرگ‌نویسی نویسه‌ی *c* را برمی‌گرداند." diff --git a/c-api/coro.po b/c-api/coro.po index a46edf671..ba6bf953e 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -24,19 +24,35 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Coroutine Objects" -msgstr "" +msgstr "شیءهای هم‌روال" -msgid "Coroutine objects are what functions declared with an ``async`` keyword return." +msgid "" +"Coroutine objects are what functions declared with an ``async`` keyword " +"return." msgstr "" +"اشیاء هم‌روال همان چیزی هستند که توابع تعریف‌شده با کلیدواژه‌ی ``async`` " +"برمی‌گردانند." msgid "The C structure used for coroutine objects." -msgstr "" +msgstr "ساختار C استفاده‌شده برای شیءهای هم‌روال." msgid "The type object corresponding to coroutine objects." -msgstr "" +msgstr "شیءِ نوعِ متناظر با شیءهای هم‌روال." -msgid "Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be " +"``NULL``. This function always succeeds." msgstr "" +"اگر نوع *ob* برابر :c:type:`PyCoro_Type` باشد، مقدار true برمی‌گرداند؛ *ob* " +"نباید ``NULL`` باشد. این تابع همیشه موفق می‌شود." -msgid "Create and return a new coroutine object based on the *frame* object, with ``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference to *frame* is stolen by this function. The *frame* argument must not be ``NULL``." +msgid "" +"Create and return a new coroutine object based on the *frame* object, with " +"``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference " +"to *frame* is stolen by this function. The *frame* argument must not be " +"``NULL``." msgstr "" +"یک شیء هم‌روال جدید بر اساس شیء *frame* ایجاد می‌کند و برمی‌گرداند که " +"``__name__`` و ``__qualname__`` آن به *name* و *qualname* تنظیم شده‌اند. یک " +"ارجاع به *frame* توسط این تابع ربوده می‌شود. آرگومان *frame* نباید ``NULL`` " +"باشد." diff --git a/c-api/curses.po b/c-api/curses.po index af243bf38..a8a5276d7 100644 --- a/c-api/curses.po +++ b/c-api/curses.po @@ -20,63 +20,128 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Curses C API" -msgstr "" +msgstr "API زبان C برای Curses" -msgid ":mod:`curses` exposes a small C interface for extension modules. Consumers must include the header file :file:`py_curses.h` (which is not included by default by :file:`Python.h`) and :c:func:`import_curses` must be invoked, usually as part of the module initialisation function, to populate :c:var:`PyCurses_API`." -msgstr "" +msgid "" +":mod:`curses` exposes a small C interface for extension modules. Consumers " +"must include the header file :file:`py_curses.h` (which is not included by " +"default by :file:`Python.h`) and :c:func:`import_curses` must be invoked, " +"usually as part of the module initialisation function, to populate " +":c:var:`PyCurses_API`." +msgstr "" +":mod:`curses` یک رابط C کوچک را برای ماژول‌های توسعه‌ای در اختیار قرار " +"می‌دهد. مصرف‌کنندگان باید پرونده سرآیند :file:`py_curses.h` (که به‌طور " +"پیش‌فرض توسط :file:`Python.h` گنجانده نمی‌شود) را گنجانده باشند و " +":c:func:`import_curses` باید، معمولاً به‌عنوان بخشی از تابع مقداردهی اولیه " +"ماژول، برای پر کردن :c:var:`PyCurses_API` فراخوانی شود." -msgid "Neither the C API nor the pure Python :mod:`curses` module are compatible with subinterpreters." +msgid "" +"Neither the C API nor the pure Python :mod:`curses` module are compatible " +"with subinterpreters." msgstr "" +"نه API زبان C و نه ماژول :mod:`curses` پایتون خالص با زیرمفسرها سازگار است." -msgid "Import the curses C API. The macro does not need a semi-colon to be called." +msgid "" +"Import the curses C API. The macro does not need a semi-colon to be called." msgstr "" +"API سی curses را ایمپورت می‌کند. این ماکرو برای فراخوانی به نقطه‌ویرگول نیاز" +" ندارد." msgid "On success, populate the :c:var:`PyCurses_API` pointer." -msgstr "" +msgstr "در صورت موفقیت، اشاره‌گر :c:var:`PyCurses_API` را پر می‌کند." -msgid "On failure, set :c:var:`PyCurses_API` to NULL and set an exception. The caller must check if an error occurred via :c:func:`PyErr_Occurred`:" +msgid "" +"On failure, set :c:var:`PyCurses_API` to NULL and set an exception. The " +"caller must check if an error occurred via :c:func:`PyErr_Occurred`:" msgstr "" +"در صورت شکست، مقدار :c:var:`PyCurses_API` را برابر NULL قرار دهید و یک " +"استثنا تنظیم کنید. فراخواننده باید از طریق :c:func:`PyErr_Occurred` بررسی " +"کند که آیا خطایی رخ داده است:" msgid "" "import_curses(); // semi-colon is optional but recommended\n" "if (PyErr_Occurred()) { /* cleanup */ }" msgstr "" +"import_curses(); // نقطه‌ویرگول اختیاری است اما توصیه می‌شود\n" +"if (PyErr_Occurred()) { /* پاک‌سازی */ }" -msgid "Dynamically allocated object containing the curses C API. This variable is only available once :c:macro:`import_curses` succeeds." +msgid "" +"Dynamically allocated object containing the curses C API. This variable is " +"only available once :c:macro:`import_curses` succeeds." msgstr "" +"شیء تخصیص‌یافته به‌طور پویا که API زبان C ماژول curses را در بر دارد. این " +"متغیر تنها پس از موفقیت :c:macro:`import_curses` در دسترس است." msgid "``PyCurses_API[0]`` corresponds to :c:data:`PyCursesWindow_Type`." -msgstr "" +msgstr "``PyCurses_API[0]`` متناظر با :c:data:`PyCursesWindow_Type` است." -msgid "``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are pointers to predicate functions of type ``int (*)(void)``." +msgid "" +"``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are " +"pointers to predicate functions of type ``int (*)(void)``." msgstr "" +"``PyCurses_API[1]``، ``PyCurses_API[2]`` و ``PyCurses_API[3]`` اشاره‌گرهایی " +"به توابع محمول از نوع ``int (*)(void)`` هستند." -msgid "When called, these predicates return whether :func:`curses.setupterm`, :func:`curses.initscr`, and :func:`curses.start_color` have been called respectively." +msgid "" +"When called, these predicates return whether :func:`curses.setupterm`, " +":func:`curses.initscr`, and :func:`curses.start_color` have been called " +"respectively." msgstr "" +"هنگام فراخوانی، این محمول‌ها به ترتیب برمی‌گردانند که " +":func:`curses.setupterm`، :func:`curses.initscr` و " +":func:`curses.start_color` فراخوانی شده‌اند یا نه." -msgid "See also the convenience macros :c:macro:`PyCursesSetupTermCalled`, :c:macro:`PyCursesInitialised`, and :c:macro:`PyCursesInitialisedColor`." +msgid "" +"See also the convenience macros :c:macro:`PyCursesSetupTermCalled`, " +":c:macro:`PyCursesInitialised`, and :c:macro:`PyCursesInitialisedColor`." msgstr "" +"همچنین ماکروهای راحتی :c:macro:`PyCursesSetupTermCalled`، " +":c:macro:`PyCursesInitialised` و :c:macro:`PyCursesInitialisedColor` را " +"ببینید." -msgid "The number of entries in this structure is subject to changes. Consider using :c:macro:`PyCurses_API_pointers` to check if new fields are available or not." +msgid "" +"The number of entries in this structure is subject to changes. Consider " +"using :c:macro:`PyCurses_API_pointers` to check if new fields are available " +"or not." msgstr "" +"تعداد ورودی‌های این ساختار ممکن است تغییر کند. برای بررسی موجود بودن یا " +"نبودن فیلدهای جدید، استفاده از :c:macro:`PyCurses_API_pointers` را در نظر " +"بگیرید." -msgid "The number of accessible fields (``4``) in :c:var:`PyCurses_API`. This number is incremented whenever new fields are added." +msgid "" +"The number of accessible fields (``4``) in :c:var:`PyCurses_API`. This " +"number is incremented whenever new fields are added." msgstr "" +"تعداد فیلد‌های دسترسی‌پذیر (``4``) در :c:var:`PyCurses_API`. این عدد هر زمان" +" که فیلد‌های جدیدی افزوده شوند، افزایش می‌یابد." -msgid "The :ref:`heap type ` corresponding to :class:`curses.window`." +msgid "" +"The :ref:`heap type ` corresponding to :class:`curses.window`." msgstr "" +"نوع :ref:`هیپ ` متناظر با :class:`curses.window`." -msgid "Return true if *op* is a :class:`curses.window` instance, false otherwise." +msgid "" +"Return true if *op* is a :class:`curses.window` instance, false otherwise." msgstr "" +"اگر *op* نمونه‌ای از :class:`curses.window` باشد، مقدار درست و در غیر این " +"صورت مقدار نادرست برمی‌گرداند." -msgid "The following macros are convenience macros expanding into C statements. In particular, they can only be used as ``macro;`` or ``macro``, but not ``macro()`` or ``macro();``." +msgid "" +"The following macros are convenience macros expanding into C statements. In " +"particular, they can only be used as ``macro;`` or ``macro``, but not " +"``macro()`` or ``macro();``." msgstr "" +"ماکروهای زیر ماکروهایی برای راحتی کار هستند که به دستورهای C بسط می‌یابند. " +"به‌طور خاص، این ماکروها را فقط می‌توان به شکل ``macro;`` یا ``macro`` به کار" +" برد، اما نه به شکل ``macro()`` یا ``macro();``." msgid "Macro checking if :func:`curses.setupterm` has been called." msgstr "" +"ماکرویی که بررسی می‌کند آیا :func:`curses.setupterm` فراخوانی شده است یا " +"خیر." msgid "The macro expansion is roughly equivalent to:" -msgstr "" +msgstr "بسط ماکرو تقریباً معادل است با:" msgid "" "{\n" @@ -87,9 +152,17 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n" +" if (!was_setupterm_called()) {\n" +" return NULL;\n" +" }\n" +"}" msgid "Macro checking if :func:`curses.initscr` has been called." msgstr "" +"ماکرویی که بررسی می‌کند آیا :func:`curses.initscr` فراخوانی شده است یا خیر." msgid "" "{\n" @@ -100,9 +173,17 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n" +" if (!was_initscr_called()) {\n" +" return NULL;\n" +" }\n" +"}" msgid "Macro checking if :func:`curses.start_color` has been called." msgstr "" +"ماکرویی که بررسی می‌کند آیا :func:`curses.start_color` فراخوانی شده است." msgid "" "{\n" @@ -113,15 +194,28 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n" +" if (!was_start_color_called()) {\n" +" return NULL;\n" +" }\n" +"}" msgid "Internal data" -msgstr "" +msgstr "داده‌های داخلی" -msgid "The following objects are exposed by the C API but should be considered internal-only." +msgid "" +"The following objects are exposed by the C API but should be considered " +"internal-only." msgstr "" +"اشیاء زیر توسط API زبان C ارائه شده‌اند، اما باید صرفاً داخلی در نظر گرفته " +"شوند." msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`." -msgstr "" +msgstr "نام کپسول curses برای ارسال به :c:func:`PyCapsule_Import`." msgid "Internal usage only. Use :c:macro:`import_curses` instead." msgstr "" +"فقط برای استفاده‌ی داخلی. به جای آن از :c:macro:`import_curses` استفاده " +"کنید." diff --git a/c-api/datetime.po b/c-api/datetime.po index 1fd43cd4a..bb6d9edb6 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -24,198 +24,387 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "DateTime Objects" -msgstr "" +msgstr "شیءهای DateTime" -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 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 the following macros." -msgstr "" +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 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 the following macros." +msgstr "" +"اشیاء مختلف تاریخ و زمان توسط ماژول :mod:`datetime` فراهم می‌شوند. پیش از " +"استفاده از هر یک از این توابع، پرونده سرآیند :file:`datetime.h` باید در کد " +"منبع شما گنجانده شود (توجه داشته باشید که این پرونده توسط :file:`Python.h` " +"گنجانده نمی‌شود) و ماکروی :c:macro:`PyDateTime_IMPORT` باید فراخوانی شود، که" +" معمولاً به عنوان بخشی از تابع مقداردهی اولیه ماژول انجام می‌شود. این ماکرو" +" یک اشاره‌گر به یک ساختار C را در یک متغیر ایستا، :c:data:`PyDateTimeAPI`، " +"قرار می‌دهد که توسط ماکروهای زیر استفاده می‌شود." msgid "Import the datetime C API." -msgstr "" +msgstr "ایمپورت کردن C API مربوط به datetime." -msgid "On success, populate the :c:var:`PyDateTimeAPI` pointer. On failure, set :c:var:`PyDateTimeAPI` to ``NULL`` and set an exception. The caller must check if an error occurred via :c:func:`PyErr_Occurred`:" +msgid "" +"On success, populate the :c:var:`PyDateTimeAPI` pointer. On failure, set " +":c:var:`PyDateTimeAPI` to ``NULL`` and set an exception. The caller must " +"check if an error occurred via :c:func:`PyErr_Occurred`:" msgstr "" +"در صورت موفقیت، اشاره‌گر :c:var:`PyDateTimeAPI` را پر می‌کند. در صورت شکست، " +":c:var:`PyDateTimeAPI` را برابر ``NULL`` قرار می‌دهد و یک استثنا تنظیم " +"می‌کند. فراخوان‌کننده باید از طریق :c:func:`PyErr_Occurred` بررسی کند که آیا" +" خطایی رخ داده است:" msgid "" "PyDateTime_IMPORT;\n" "if (PyErr_Occurred()) { /* cleanup */ }" msgstr "" +"PyDateTime_IMPORT;\n" +"if (PyErr_Occurred()) { /* cleanup */ }" msgid "This is not compatible with subinterpreters." -msgstr "" +msgstr "این با زیرمفسر‌ها سازگار نیست." msgid "Structure containing the fields for the datetime C API." -msgstr "" +msgstr "ساختار شامل فیلدهای C API مربوط به datetime." msgid "The fields of this structure are private and subject to change." -msgstr "" +msgstr "فیلد‌های این ساختار خصوصی هستند و ممکن است تغییر کنند." msgid "Do not use this directly; prefer ``PyDateTime_*`` APIs instead." msgstr "" +"از این مستقیماً استفاده نکنید؛ به‌جای آن، API‌های ``PyDateTime_*`` را ترجیح " +"دهید." msgid "Dynamically allocated object containing the datetime C API." msgstr "" +"شیء تخصیص‌یافته به‌صورت پویا که C API مربوط به datetime را در بر می‌گیرد." -msgid "This variable is only available once :c:macro:`PyDateTime_IMPORT` succeeds." +msgid "" +"This variable is only available once :c:macro:`PyDateTime_IMPORT` succeeds." msgstr "" +"این متغیر تنها پس از موفقیت :c:macro:`PyDateTime_IMPORT` در دسترس است." msgid "This subtype of :c:type:`PyObject` represents a Python date object." msgstr "" +"این زیرنوع از :c:type:`PyObject` یک شیء تاریخ پایتون را نمایندگی می‌کند." -msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." -msgstr "" +msgid "" +"This subtype of :c:type:`PyObject` represents a Python datetime object." +msgstr "این زیرنوع از :c:type:`PyObject` نمایانگر یک شیء datetime پایتون است." msgid "This subtype of :c:type:`PyObject` represents a Python time object." -msgstr "" +msgstr "این زیرنوع از :c:type:`PyObject` نمایانگر یک شیء زمان پایتون است." -msgid "This subtype of :c:type:`PyObject` represents the difference between two datetime values." +msgid "" +"This subtype of :c:type:`PyObject` represents the difference between two " +"datetime values." msgstr "" +"این زیرنوع از :c:type:`PyObject` تفاوت میان دو مقدار datetime را نشان " +"می‌دهد." -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." +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:type:`PyTypeObject` نوع تاریخ پایتون را نمایندگی می‌کند؛ این" +" همان شیء :class:`datetime.date` در لایه‌ی پایتون است." -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." +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:type:`PyTypeObject` نمایانگر نوع datetime پایتون است؛ این " +"همان شیء :class:`datetime.datetime` در لایه‌ی پایتون است." -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." +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:type:`PyTypeObject`، نوع time پایتون را نشان می‌دهد؛ این " +"همان شیء :class:`datetime.time` در لایه پایتون است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python type for the difference between two datetime values; it is the same object as :class:`datetime.timedelta` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python type for the " +"difference between two datetime values; it is the same object as " +":class:`datetime.timedelta` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع پایتونی برای اختلاف بین دو مقدار " +"datetime را نشان می‌دهد؛ این همان شیء :class:`datetime.timedelta` در لایه " +"پایتون است." -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." +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:type:`PyTypeObject` نوع اطلاعات منطقه زمانی پایتون را " +"نمایندگی می‌کند؛ این همان شیء :class:`datetime.tzinfo` در لایه پایتون است." msgid "Macro for access to the UTC singleton:" -msgstr "" +msgstr "ماکرو برای دسترسی به تک‌نمونه‌ی UTC:" -msgid "Returns the time zone singleton representing UTC, the same object as :attr:`datetime.timezone.utc`." +msgid "" +"Returns the time zone singleton representing UTC, the same object as " +":attr:`datetime.timezone.utc`." msgstr "" +"تک‌نمونه‌ی منطقه‌ی زمانی UTC را برمی‌گرداند؛ این همان شیء " +":attr:`datetime.timezone.utc` است." msgid "Type-check macros:" -msgstr "" +msgstr "ماکروهای بررسی نوع:" -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." +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." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DateType` یا زیرنوعی از " +":c:data:`!PyDateTime_DateType` باشد، مقدار true را برمی‌گرداند. *ob* نباید " +"``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " +"be ``NULL``. This function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DateType` باشد، مقدار true را " +"برمی‌گرداند. *ob* نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -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``. This function always succeeds." +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``. " +"This function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DateTimeType` یا زیرنوعی از " +":c:data:`!PyDateTime_DateTimeType` باشد، true را برمی‌گرداند. *ob* نباید " +"``NULL`` باشد. این تابع همیشه موفق می‌شود." -msgid "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " +"not be ``NULL``. This function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DateTimeType` باشد، مقدار true را " +"برمی‌گرداند. *ob* نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -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." +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." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_TimeType` یا زیرنوعی از " +":c:data:`!PyDateTime_TimeType` باشد، مقدار true را برمی‌گرداند. *ob* نباید " +"``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " +"be ``NULL``. This function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_TimeType` باشد، مقدار true را " +"برمی‌گرداند. *ob* نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -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 function always succeeds." +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 " +"function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DeltaType` یا زیرنوعی از " +":c:data:`!PyDateTime_DeltaType` باشد، مقدار true را برمی‌گرداند. *ob* نباید " +"``NULL`` باشد. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not" +" be ``NULL``. This function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_DeltaType` باشد، true را برمی‌گرداند. " +"*ob* نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -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 function always succeeds." +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 " +"function always succeeds." msgstr "" +"اگر *ob* از نوع :c:data:`PyDateTime_TZInfoType` یا زیرنوعی از " +":c:data:`!PyDateTime_TZInfoType` باشد، مقدار true را برمی‌گرداند. *ob* نباید" +" ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " +"not be ``NULL``. This function always succeeds." msgstr "" +"در صورتی که *ob* از نوع :c:data:`PyDateTime_TZInfoType` باشد، مقدار true را " +"برمی‌گرداند. *ob* نباید ``NULL`` باشد. این تابع همیشه موفق می‌شود." msgid "Macros to create objects:" -msgstr "" +msgstr "ماکروهای ساخت اشیاء:" -msgid "Return a :class:`datetime.date` object with the specified year, month and day." -msgstr "" +msgid "" +"Return a :class:`datetime.date` object with the specified year, month and " +"day." +msgstr "یک شیء :class:`datetime.date` با سال، ماه و روز مشخص‌شده برمی‌گرداند." -msgid "Return a :class:`datetime.datetime` object with the specified year, month, day, hour, minute, second and microsecond." +msgid "" +"Return a :class:`datetime.datetime` object with the specified year, month, " +"day, hour, minute, second and microsecond." msgstr "" +"یک شیء :class:`datetime.datetime` با سال، ماه، روز، ساعت، دقیقه، ثانیه و " +"میکروثانیه‌ی مشخص‌شده برمی‌گرداند." -msgid "Return a :class:`datetime.datetime` object with the specified year, month, day, hour, minute, second, microsecond and fold." +msgid "" +"Return a :class:`datetime.datetime` object with the specified year, month, " +"day, hour, minute, second, microsecond and fold." msgstr "" +"یک شیء :class:`datetime.datetime` با سال، ماه، روز، ساعت، دقیقه، ثانیه، " +"میکروثانیه و fold مشخص‌شده برمی‌گرداند." -msgid "Return a :class:`datetime.time` object with the specified hour, minute, second and microsecond." +msgid "" +"Return a :class:`datetime.time` object with the specified hour, minute, " +"second and microsecond." msgstr "" +"یک شیء :class:`datetime.time` با ساعت، دقیقه، ثانیه و میکروثانیه‌ی مشخص‌شده " +"برمی‌گرداند." -msgid "Return a :class:`datetime.time` object with the specified hour, minute, second, microsecond and fold." +msgid "" +"Return a :class:`datetime.time` object with the specified hour, minute, " +"second, microsecond and fold." msgstr "" +"یک شیء :class:`datetime.time` با ساعت، دقیقه، ثانیه، میکروثانیه و fold " +"مشخص‌شده برمی‌گرداند." -msgid "Return a :class:`datetime.timedelta` object representing the given number of days, seconds and microseconds. Normalization is performed so that the resulting number of microseconds and seconds lie in the ranges documented for :class:`datetime.timedelta` objects." +msgid "" +"Return a :class:`datetime.timedelta` object representing the given number of" +" days, seconds and microseconds. Normalization is performed so that the " +"resulting number of microseconds and seconds lie in the ranges documented " +"for :class:`datetime.timedelta` objects." msgstr "" +"یک شیء :class:`datetime.timedelta` برمی‌گرداند که نمایانگر تعداد روزها، " +"ثانیه‌ها و میکروثانیه‌های داده‌شده است. نرمال‌سازی انجام می‌شود تا تعداد " +"میکروثانیه‌ها و ثانیه‌های حاصل، در محدوده‌های مستندشده برای اشیاء " +":class:`datetime.timedelta` قرار گیرند." -msgid "Return a :class:`datetime.timezone` object with an unnamed fixed offset represented by the *offset* argument." +msgid "" +"Return a :class:`datetime.timezone` object with an unnamed fixed offset " +"represented by the *offset* argument." msgstr "" +"یک شیء :class:`datetime.timezone` با آفست ثابتِ بی‌نامی که توسط آرگومان " +"*offset* نمایش داده می‌شود، برمی‌گرداند." -msgid "Return a :class:`datetime.timezone` object with a fixed offset represented by the *offset* argument and with tzname *name*." +msgid "" +"Return a :class:`datetime.timezone` object with a fixed offset represented " +"by the *offset* argument and with tzname *name*." msgstr "" +"یک شیء :class:`datetime.timezone` با آفست ثابتی که توسط آرگومان *offset* " +"مشخص شده و با tzname برابر *name* برمی‌گرداند." -msgid "Macros to extract fields from date objects. The argument must be an 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:" +msgid "" +"Macros to extract fields from date objects. The argument must be an " +"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 "" +"ماکروهایی برای استخراج فیلدها از اشیاء تاریخ. آرگومان باید نمونه‌ای از " +":c:type:`PyDateTime_Date` باشد، از جمله زیرکلاس‌ها (مانند " +":c:type:`PyDateTime_DateTime`). آرگومان نباید ``NULL`` باشد و نوع آن بررسی " +"نمی‌شود:" msgid "Return the year, as a positive int." -msgstr "" +msgstr "سال را به صورت یک عدد صحیح مثبت برمی‌گرداند." msgid "Return the month, as an int from 1 through 12." -msgstr "" +msgstr "ماه را به‌صورت یک عدد صحیح از ۱ تا ۱۲ برمی‌گرداند." msgid "Return the day, as an int from 1 through 31." -msgstr "" +msgstr "روز را به‌صورت یک عدد صحیح از ۱ تا ۳۱ برمی‌گرداند." -msgid "Macros to extract fields from datetime objects. The argument must be an instance of :c:type:`PyDateTime_DateTime`, including subclasses. The argument must not be ``NULL``, and the type is not checked:" +msgid "" +"Macros to extract fields from datetime objects. The argument must be an " +"instance of :c:type:`PyDateTime_DateTime`, including subclasses. The " +"argument must not be ``NULL``, and the type is not checked:" msgstr "" +"ماکروهایی برای استخراج فیلدها از اشیاء datetime. آرگومان باید نمونه‌ای از " +":c:type:`PyDateTime_DateTime` باشد، شامل زیرکلاس‌ها. آرگومان نباید ``NULL`` " +"باشد و نوع آن بررسی نمی‌شود:" msgid "Return the hour, as an int from 0 through 23." -msgstr "" +msgstr "ساعت را به‌صورت یک عدد صحیح از ۰ تا ۲۳ برمی‌گرداند." msgid "Return the minute, as an int from 0 through 59." -msgstr "" +msgstr "دقیقه را به‌صورت یک عدد صحیح از ۰ تا ۵۹ برمی‌گرداند." msgid "Return the second, as an int from 0 through 59." -msgstr "" +msgstr "ثانیه را به‌صورت یک عدد صحیح از ۰ تا ۵۹ برمی‌گرداند." msgid "Return the microsecond, as an int from 0 through 999999." -msgstr "" +msgstr "میکروثانیه را به صورت یک عدد صحیح از ۰ تا ۹۹۹۹۹۹ برمی‌گرداند." msgid "Return the fold, as an int from 0 through 1." -msgstr "" +msgstr "مقدار تاخوردگی (fold) را به‌صورت یک عدد صحیح از ۰ تا ۱ برمی‌گرداند." msgid "Return the tzinfo (which may be ``None``)." -msgstr "" +msgstr "بازگرداندن tzinfo (که ممکن است ``None`` باشد)." -msgid "Macros to extract fields from time objects. The argument must be an instance of :c:type:`PyDateTime_Time`, including subclasses. The argument must not be ``NULL``, and the type is not checked:" +msgid "" +"Macros to extract fields from time objects. The argument must be an " +"instance of :c:type:`PyDateTime_Time`, including subclasses. The argument " +"must not be ``NULL``, and the type is not checked:" msgstr "" +"ماکروهایی برای استخراج فیلدها از اشیاء زمان. آرگومان باید نمونه‌ای از " +":c:type:`PyDateTime_Time` باشد، شامل زیرکلاس‌ها. آرگومان نباید ``NULL`` باشد" +" و نوع آن بررسی نمی‌شود:" -msgid "Macros to extract fields from time delta objects. The argument must be an instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument must not be ``NULL``, and the type is not checked:" +msgid "" +"Macros to extract fields from time delta objects. The argument must be an " +"instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument " +"must not be ``NULL``, and the type is not checked:" msgstr "" +"ماکروهایی برای استخراج فیلدها از اشیاء دلتای زمانی. آرگومان باید نمونه‌ای از" +" :c:type:`PyDateTime_Delta` باشد، از جمله زیرکلاس‌ها. آرگومان نباید ``NULL``" +" باشد و نوع آن بررسی نمی‌شود:" msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "" +"تعداد روز‌ها را به صورت یک عدد صحیح از -999999999 تا 999999999 برمی‌گرداند." msgid "Return the number of seconds, as an int from 0 through 86399." -msgstr "" +msgstr "تعداد ثانیه‌ها را به‌صورت یک عدد صحیح از ۰ تا ۸۶۳۹۹ برمی‌گرداند." msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "" +"تعداد میکروثانیه‌ها را به صورت یک عدد صحیح از ۰ تا ۹۹۹۹۹۹ برمی‌گرداند." msgid "Macros for the convenience of modules implementing the DB API:" -msgstr "" +msgstr "ماکروهایی برای سهولت کار ماژول‌هایی که DB API را پیاده‌سازی می‌کنند:" -msgid "Create and return a new :class:`datetime.datetime` object given an argument tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`." +msgid "" +"Create and return a new :class:`datetime.datetime` object given an argument " +"tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`." msgstr "" +"با گرفتن یک تاپل آرگومان مناسب برای ارسال به " +":meth:`datetime.datetime.fromtimestamp`، یک شیء جدید " +":class:`datetime.datetime` می‌سازد و برمی‌گرداند." -msgid "Create and return a new :class:`datetime.date` object given an argument tuple suitable for passing to :meth:`datetime.date.fromtimestamp`." +msgid "" +"Create and return a new :class:`datetime.date` object given an argument " +"tuple suitable for passing to :meth:`datetime.date.fromtimestamp`." msgstr "" +"با گرفتن یک تاپل آرگومان مناسب برای پاس دادن به " +":meth:`datetime.date.fromtimestamp`، یک شیء جدید :class:`datetime.date` " +"ایجاد کرده و بازمی‌گرداند." msgid "Internal data" -msgstr "" +msgstr "داده‌های داخلی" -msgid "The following symbols are exposed by the C API but should be considered internal-only." +msgid "" +"The following symbols are exposed by the C API but should be considered " +"internal-only." msgstr "" +"نمادهای زیر توسط C API ارائه‌شده‌اند، اما باید فقط داخلی در نظر گرفته شوند." msgid "Name of the datetime capsule to pass to :c:func:`PyCapsule_Import`." msgstr "" +"نام کپسول datetime که باید به :c:func:`PyCapsule_Import` پاس داده شود." msgid "Internal usage only. Use :c:macro:`PyDateTime_IMPORT` instead." msgstr "" +"صرفاً برای استفاده‌ی داخلی. به‌جای آن از :c:macro:`PyDateTime_IMPORT` " +"استفاده کنید." diff --git a/c-api/descriptor.po b/c-api/descriptor.po index c9fc9ebd0..15f3e9f85 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -24,100 +24,276 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Descriptor Objects" -msgstr "" +msgstr "شیءهای توصیف‌گر" -msgid "\"Descriptors\" are objects that describe some attribute of an object. They are found in the dictionary of type objects." +msgid "" +"\"Descriptors\" are objects that describe some attribute of an object. They " +"are found in the dictionary of type objects." msgstr "" +"«توصیف‌گرها» اشیایی هستند که ویژگی‌ای از یک شیء را توصیف می‌کنند. آن‌ها در " +"دیکشنری اشیاء نوع یافت می‌شوند." msgid "The type object for the built-in descriptor types." -msgstr "" +msgstr "شیء نوع برای نوع‌های توصیف‌گر توکار." -msgid "Create a new get-set descriptor for extension type *type* from the :c:type:`PyGetSetDef` structure *getset*." +msgid "" +"Create a new get-set descriptor for extension type *type* from the " +":c:type:`PyGetSetDef` structure *getset*." msgstr "" +"یک توصیف‌گر دریافت-تنظیم (get-set) جدید برای نوع توسعه‌ای *type* از ساختار " +":c:type:`PyGetSetDef` با نام *getset* می‌سازد." -msgid "Get-set descriptors expose attributes implemented by C getter and setter functions rather than stored directly in the instance. This is the same kind of descriptor created for entries in :c:member:`~PyTypeObject.tp_getset`, and it appears in Python as a :class:`types.GetSetDescriptorType` object." +msgid "" +"Get-set descriptors expose attributes implemented by C getter and setter " +"functions rather than stored directly in the instance. This is the same kind" +" of descriptor created for entries in :c:member:`~PyTypeObject.tp_getset`, " +"and it appears in Python as a :class:`types.GetSetDescriptorType` object." msgstr "" +"توصیف‌گرهای دریافت-تنظیم (get-set) ویژگی‌هایی را در دسترس قرار می‌دهند که " +"به‌جای ذخیره‌شدن مستقیم در نمونه، توسط توابع گیرنده (getter) و تنظیم‌کننده " +"(setter) زبان C پیاده‌سازی شده‌اند. این همان نوع توصیف‌گری است که برای " +"ورودی‌های :c:member:`~PyTypeObject.tp_getset` ایجاد می‌شود و در پایتون " +"به‌صورت یک شیء :class:`types.GetSetDescriptorType` ظاهر می‌شود." -msgid "On success, return a :term:`strong reference` to the descriptor. Return ``NULL`` with an exception set on failure." +msgid "" +"On success, return a :term:`strong reference` to the descriptor. Return " +"``NULL`` with an exception set on failure." msgstr "" +"در صورت موفقیت، یک :term:`ارجاع قوی ` به توصیف‌گر " +"برمی‌گرداند. در صورت شکست، ``NULL`` همراه با یک استثنای تنظیم‌شده " +"برمی‌گرداند." -msgid "Create a new member descriptor for extension type *type* from the :c:type:`PyMemberDef` structure *member*." +msgid "" +"Create a new member descriptor for extension type *type* from the " +":c:type:`PyMemberDef` structure *member*." msgstr "" +"یک توصیف‌گر عضو جدید برای نوع توسعه‌ای *type* از ساختار " +":c:type:`PyMemberDef` به نام *member* ایجاد می‌کند." -msgid "Member descriptors expose fields in the type's C struct as Python attributes. This is the same kind of descriptor created for entries in :c:member:`~PyTypeObject.tp_members`, and it appears in Python as a :class:`types.MemberDescriptorType` object." +msgid "" +"Member descriptors expose fields in the type's C struct as Python " +"attributes. This is the same kind of descriptor created for entries in " +":c:member:`~PyTypeObject.tp_members`, and it appears in Python as a " +":class:`types.MemberDescriptorType` object." msgstr "" +"توصیف‌گرهای عضو، فیلدهای موجود در ساختار C نوع را به‌عنوان ویژگی‌های پایتون " +"در دسترس قرار می‌دهند. این همان نوع توصیف‌گری است که برای ورودی‌های " +":c:member:`~PyTypeObject.tp_members` ایجاد می‌شود و در پایتون به‌صورت شیء " +":class:`types.MemberDescriptorType` ظاهر می‌شود." -msgid "The type object for member descriptor objects created from :c:type:`PyMemberDef` structures. These descriptors expose fields of a C struct as attributes on a type, and correspond to :class:`types.MemberDescriptorType` objects in Python." +msgid "" +"The type object for member descriptor objects created from " +":c:type:`PyMemberDef` structures. These descriptors expose fields of a C " +"struct as attributes on a type, and correspond to " +":class:`types.MemberDescriptorType` objects in Python." msgstr "" +"شیء نوع برای اشیاء توصیف‌گر عضو که از ساختارهای :c:type:`PyMemberDef` ایجاد " +"می‌شوند. این توصیف‌گرها فیلدهای یک ساختار C را به‌عنوان ویژگی‌هایی روی یک " +"نوع در دسترس قرار می‌دهند و متناظر با اشیاء " +":class:`types.MemberDescriptorType` در پایتون هستند." -msgid "The type object for get/set descriptor objects created from :c:type:`PyGetSetDef` structures. These descriptors implement attributes whose value is computed by C getter and setter functions, and are used for many built-in type attributes. They correspond to :class:`types.GetSetDescriptorType` objects in Python." -msgstr "" +msgid "" +"The type object for get/set descriptor objects created from " +":c:type:`PyGetSetDef` structures. These descriptors implement attributes " +"whose value is computed by C getter and setter functions, and are used for " +"many built-in type attributes. They correspond to " +":class:`types.GetSetDescriptorType` objects in Python." +msgstr "" +"شیء نوع برای اشیای توصیف‌گر get/set که از ساختارهای :c:type:`PyGetSetDef` " +"ایجاد می‌شوند. این توصیف‌گرها ویژگی‌هایی را پیاده‌سازی می‌کنند که مقدار " +"آن‌ها توسط توابع گیرنده (getter) و تنظیم‌کننده (setter) زبان C محاسبه می‌شود" +" و برای بسیاری از ویژگی‌های انواع توکار به کار می‌روند. آن‌ها معادل اشیای " +":class:`types.GetSetDescriptorType` در پایتون هستند." -msgid "Create a new method descriptor for extension type *type* from the :c:type:`PyMethodDef` structure *meth*." +msgid "" +"Create a new method descriptor for extension type *type* from the " +":c:type:`PyMethodDef` structure *meth*." msgstr "" +"یک توصیف‌گر متد جدید برای نوع توسعه‌ای *type* از ساختار " +":c:type:`PyMethodDef` به نام *meth* ایجاد کنید." -msgid "Method descriptors expose C functions as methods on a type. This is the same kind of descriptor created for entries in :c:member:`~PyTypeObject.tp_methods`, and it appears in Python as a :class:`types.MethodDescriptorType` object." +msgid "" +"Method descriptors expose C functions as methods on a type. This is the same" +" kind of descriptor created for entries in " +":c:member:`~PyTypeObject.tp_methods`, and it appears in Python as a " +":class:`types.MethodDescriptorType` object." msgstr "" +"توصیف‌گرهای متد، توابع C را به‌صورت متدهایی روی یک نوع در دسترس قرار " +"می‌دهند. این همان نوع توصیف‌گری است که برای ورودی‌های " +":c:member:`~PyTypeObject.tp_methods` ایجاد می‌شود و در پایتون به‌صورت شیء " +":class:`types.MethodDescriptorType` ظاهر می‌شود." -msgid "The type object for method descriptor objects created from :c:type:`PyMethodDef` structures. These descriptors expose C functions as methods on a type, and correspond to :class:`types.MethodDescriptorType` objects in Python." +msgid "" +"The type object for method descriptor objects created from " +":c:type:`PyMethodDef` structures. These descriptors expose C functions as " +"methods on a type, and correspond to :class:`types.MethodDescriptorType` " +"objects in Python." msgstr "" +"شیء نوع برای اشیاء توصیف‌گر متد که از ساختارهای :c:type:`PyMethodDef` ایجاد " +"شده‌اند. این توصیف‌گرها توابع C را به‌عنوان متدهایی روی یک نوع در دسترس قرار" +" می‌دهند و معادل اشیاء :class:`types.MethodDescriptorType` در پایتون هستند." msgid "Describes a slot wrapper used by :c:func:`PyDescr_NewWrapper`." msgstr "" +"یک دربرگیرنده‌ی جایگاه را توصیف می‌کند که توسط :c:func:`PyDescr_NewWrapper` " +"استفاده می‌شود." -msgid "Each ``wrapperbase`` record stores the Python-visible name and metadata for a special method implemented by a type slot, together with the wrapper function used to adapt that slot to Python's calling convention." +msgid "" +"Each ``wrapperbase`` record stores the Python-visible name and metadata for " +"a special method implemented by a type slot, together with the wrapper " +"function used to adapt that slot to Python's calling convention." msgstr "" +"هر رکورد ``wrapperbase`` نام قابل‌مشاهده در پایتون و فراداده‌ی متد ویژه‌ای " +"را که توسط یک جایگاه نوع پیاده‌سازی شده است، به همراه تابع پوششی‌ای که برای " +"تطبیق آن جایگاه با قرارداد فراخوانی پایتون استفاده می‌شود، ذخیره می‌کند." -msgid "Create a new wrapper descriptor for extension type *type* from the :c:struct:`wrapperbase` structure *base* and the wrapped slot function pointer *wrapped*." +msgid "" +"Create a new wrapper descriptor for extension type *type* from the " +":c:struct:`wrapperbase` structure *base* and the wrapped slot function " +"pointer *wrapped*." msgstr "" +"یک توصیف‌گر پوششی جدید برای نوع توسعه‌ای *type* از ساختار " +":c:struct:`wrapperbase` به نام *base* و اشاره‌گر تابع جایگاه دربرگرفته‌شده " +"به نام *wrapped* می‌سازد." -msgid "Wrapper descriptors expose special methods implemented by type slots. This is the same kind of descriptor that CPython creates for slot-based special methods such as ``__repr__`` or ``__add__``, and it appears in Python as a :class:`types.WrapperDescriptorType` object." +msgid "" +"Wrapper descriptors expose special methods implemented by type slots. This " +"is the same kind of descriptor that CPython creates for slot-based special " +"methods such as ``__repr__`` or ``__add__``, and it appears in Python as a " +":class:`types.WrapperDescriptorType` object." msgstr "" +"توصیف‌گرهای پوششی، متدهای ویژه‌ای را که توسط جایگاه‌های نوع پیاده‌سازی " +"شده‌اند، در دسترس قرار می‌دهند. این همان نوع توصیف‌گری است که سی‌پایتون برای" +" متدهای ویژه‌ی مبتنی بر جایگاه مانند ``__repr__`` یا ``__add__`` ایجاد " +"می‌کند و در پایتون به‌صورت یک شیء :class:`types.WrapperDescriptorType` ظاهر " +"می‌شود." -msgid "The type object for wrapper descriptor objects created by :c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper descriptors are used internally to expose special methods implemented via wrapper structures, and appear in Python as :class:`types.WrapperDescriptorType` objects." -msgstr "" +msgid "" +"The type object for wrapper descriptor objects created by " +":c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper " +"descriptors are used internally to expose special methods implemented via " +"wrapper structures, and appear in Python as " +":class:`types.WrapperDescriptorType` objects." +msgstr "" +"شیء نوع برای اشیاء توصیف‌گر پوششی که توسط :c:func:`PyDescr_NewWrapper` و " +":c:func:`PyWrapper_New` ایجاد می‌شوند. توصیف‌گرهای پوششی به‌طور داخلی برای " +"در دسترس قرار دادن متدهای ویژه‌ای که از طریق ساختارهای پوششی پیاده‌سازی " +"شده‌اند استفاده می‌شوند و در پایتون به‌صورت اشیاء " +":class:`types.WrapperDescriptorType` ظاهر می‌شوند." -msgid "Create a new class method descriptor for extension type *type* from the :c:type:`PyMethodDef` structure *method*." +msgid "" +"Create a new class method descriptor for extension type *type* from the " +":c:type:`PyMethodDef` structure *method*." msgstr "" +"یک توصیف‌گر متد کلاس جدید برای نوع توسعه‌ای *type* از ساختار " +":c:type:`PyMethodDef` به نام *method* ایجاد می‌کند." -msgid "Class method descriptors expose C methods that receive the class rather than an instance when accessed. This is the same kind of descriptor created for ``METH_CLASS`` entries in :c:member:`~PyTypeObject.tp_methods`, and it appears in Python as a :class:`types.ClassMethodDescriptorType` object." +msgid "" +"Class method descriptors expose C methods that receive the class rather than" +" an instance when accessed. This is the same kind of descriptor created for " +"``METH_CLASS`` entries in :c:member:`~PyTypeObject.tp_methods`, and it " +"appears in Python as a :class:`types.ClassMethodDescriptorType` object." msgstr "" +"توصیف‌گرهای متد کلاس، متدهای C را نمایان می‌کنند که هنگام دسترسی، کلاس را به" +" جای نمونه دریافت می‌کنند. این همان نوع توصیف‌گری است که برای ورودی‌های " +"``METH_CLASS`` در :c:member:`~PyTypeObject.tp_methods` ایجاد می‌شود و در " +"پایتون به صورت شیء :class:`types.ClassMethodDescriptorType` ظاهر می‌شود." -msgid "Return non-zero if the descriptor object *descr* describes a data attribute, or ``0`` if it describes a method. *descr* must be a descriptor object; there is no error checking." +msgid "" +"Return non-zero if the descriptor object *descr* describes a data attribute," +" or ``0`` if it describes a method. *descr* must be a descriptor object; " +"there is no error checking." msgstr "" +"اگر شیء توصیف‌گر *descr* یک ویژگی داده‌ای را توصیف کند، مقدار نا‌صفر را " +"برمی‌گرداند و اگر متدی را توصیف کند، ``0`` را برمی‌گرداند. *descr* باید یک " +"شیء توصیف‌گر باشد؛ هیچ بررسی خطایی انجام نمی‌شود." -msgid "Create a new bound wrapper object from the wrapper descriptor *d* and the instance *self*." +msgid "" +"Create a new bound wrapper object from the wrapper descriptor *d* and the " +"instance *self*." msgstr "" +"یک شیء پوششی مقید جدید از توصیف‌گر پوششی *d* و نمونه *self* ایجاد کنید." -msgid "This is the bound form of a wrapper descriptor created by :c:func:`PyDescr_NewWrapper`. CPython creates these objects when a slot wrapper is accessed through an instance, and they appear in Python as :class:`types.MethodWrapperType` objects." +msgid "" +"This is the bound form of a wrapper descriptor created by " +":c:func:`PyDescr_NewWrapper`. CPython creates these objects when a slot " +"wrapper is accessed through an instance, and they appear in Python as " +":class:`types.MethodWrapperType` objects." msgstr "" +"این، شکل مقیدِ یک توصیف‌گر پوششی (wrapper descriptor) است که توسط " +":c:func:`PyDescr_NewWrapper` ایجاد شده است. سی‌پایتون این اشیاء را زمانی " +"ایجاد می‌کند که از طریق یک نمونه به یک پوشش‌دهنده جایگاه (slot wrapper) " +"دسترسی پیدا شود، و آن‌ها در پایتون به‌صورت اشیاء " +":class:`types.MethodWrapperType` ظاهر می‌شوند." -msgid "On success, return a :term:`strong reference` to the wrapper object. Return ``NULL`` with an exception set on failure." +msgid "" +"On success, return a :term:`strong reference` to the wrapper object. Return " +"``NULL`` with an exception set on failure." msgstr "" +"در صورت موفقیت، یک :term:`ارجاع قوی ` به شیء پوششی " +"برمی‌گرداند. در صورت شکل، ``NULL`` را همراه با یک استثنای تنظیم‌شده " +"برمی‌گرداند." msgid "Built-in descriptors" -msgstr "" +msgstr "توصیف‌گرهای توکار" -msgid "The type object for super objects. This is the same object as :class:`super` in the Python layer." +msgid "" +"The type object for super objects. This is the same object as :class:`super`" +" in the Python layer." msgstr "" +"شیء نوع برای اشیای super. این همان شیء :class:`super` در لایه‌ی پایتون است." -msgid "The type of class method objects. This is the same object as :class:`classmethod` in the Python layer." +msgid "" +"The type of class method objects. This is the same object as " +":class:`classmethod` in the Python layer." msgstr "" +"نوع اشیای متد کلاس. این همان شیء :class:`classmethod` در لایه پایتون است." -msgid "The type object for C-level class method descriptor objects. This is the type of the descriptors created for :func:`classmethod` defined in C extension types, and corresponds to :class:`types.ClassMethodDescriptorType` objects in Python." +msgid "" +"The type object for C-level class method descriptor objects. This is the " +"type of the descriptors created for :func:`classmethod` defined in C " +"extension types, and corresponds to :class:`types.ClassMethodDescriptorType`" +" objects in Python." msgstr "" +"شیء نوع برای اشیاء توصیف‌گر متد کلاس در سطح C. این همان نوع توصیف‌گرهایی است" +" که برای :func:`classmethod` تعریف‌شده در نوع‌های توسعه‌ای C ایجاد می‌شوند و" +" با اشیاء :class:`types.ClassMethodDescriptorType` در پایتون مطابقت دارد." -msgid "Create a new :class:`classmethod` object wrapping *callable*. *callable* must be a callable object and must not be ``NULL``." +msgid "" +"Create a new :class:`classmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." msgstr "" +"یک شیء جدید :class:`classmethod` می‌سازد که *callable* را در بر می‌گیرد. " +"*callable* باید یک شیء فراخوانی‌پذیر باشد و نباید ``NULL`` باشد." -msgid "On success, this function returns a :term:`strong reference` to a new class method descriptor. On failure, this function returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to a new class " +"method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`ارجاع قوی ` به یک " +"توصیف‌گر جدید متد کلاس برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را همراه" +" با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "The type of static method objects. This is the same object as :class:`staticmethod` in the Python layer." +msgid "" +"The type of static method objects. This is the same object as " +":class:`staticmethod` in the Python layer." msgstr "" +"نوع اشیاء متد ایستا. این همان شیء :class:`staticmethod` در لایه‌ی پایتون " +"است." -msgid "Create a new :class:`staticmethod` object wrapping *callable*. *callable* must be a callable object and must not be ``NULL``." +msgid "" +"Create a new :class:`staticmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." msgstr "" +"یک شیء :class:`staticmethod` جدید ایجاد می‌کند که *callable* را دربر " +"می‌گیرد. *callable* باید یک شیء فراخوانی‌پذیر باشد و نباید ``NULL`` باشد." -msgid "On success, this function returns a :term:`strong reference` to a new static method descriptor. On failure, this function returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to a new static" +" method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`ارجاع قوی ` به توصیف‌گر" +" جدید متد ایستا برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را همراه با یک " +"استثنای تنظیم‌شده برمی‌گرداند." diff --git a/c-api/dict.po b/c-api/dict.po index 0e3063a78..c9dfaa727 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -27,146 +27,399 @@ msgstr "" msgid "Dictionary Objects" msgstr "اشیاء دیکشنری «Dictionary Objecte»" -msgid "This subtype of :c:type:`PyObject` represents a Python dictionary object." -msgstr "این زیرنوع «subtype» از :c:type:`PyObject` نمایانگر یک شیء دیکشنری پایتون است." +msgid "" +"This subtype of :c:type:`PyObject` represents a Python dictionary object." +msgstr "" +"این زیرنوع «subtype» از :c:type:`PyObject` نمایانگر یک شیء دیکشنری پایتون " +"است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python dictionary type. This is the same object as :class:`dict` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python dictionary " +"type. This is the same object as :class:`dict` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع دیکشنری پایتون را نمایندگی می‌کند. " +"این همان شیء :class:`dict` در لایه پایتون است." -msgid "Return true if *p* is a dict object or an instance of a subtype of the dict type. This function always succeeds." +msgid "" +"Return true if *p* is a dict object or an instance of a subtype of the dict " +"type. This function always succeeds." msgstr "" +"اگر *p* یک شیء dict یا نمونه‌ای از یک زیرنوع از نوع dict باشد، true را " +"برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Return true if *p* is a dict object, but not an instance of a subtype of the dict type. This function always succeeds." +msgid "" +"Return true if *p* is a dict object, but not an instance of a subtype of the" +" dict type. This function always succeeds." msgstr "" +"در صورتی که *p* یک شیء dict باشد اما نمونه‌ای از یک زیرنوع از نوع dict " +"نباشد، مقدار true را برمی‌گرداند. این تابع همیشه موفق می‌شود." msgid "Return a new empty dictionary, or ``NULL`` on failure." -msgstr "" +msgstr "یک دیکشنری خالی جدید برمی‌گرداند، یا در صورت شکست ``NULL``." -msgid "Return a :class:`types.MappingProxyType` object for a mapping which enforces read-only behavior. This is normally used to create a view to prevent modification of the dictionary for non-dynamic class types." +msgid "" +"Return a :class:`types.MappingProxyType` object for a mapping which enforces" +" read-only behavior. This is normally used to create a view to prevent " +"modification of the dictionary for non-dynamic class types." msgstr "" +"یک شیء :class:`types.MappingProxyType` برای نگاشتی که رفتار فقط‌خواندنی را " +"اعمال می‌کند بازمی‌گرداند. این معمولاً برای ایجاد نمایی استفاده می‌شود که " +"از تغییر دیکشنری در نوع‌های کلاس غیرپویا جلوگیری کند." -msgid "The type object for mapping proxy objects created by :c:func:`PyDictProxy_New` and for the read-only ``__dict__`` attribute of many built-in types. A :c:type:`PyDictProxy_Type` instance provides a dynamic, read-only view of an underlying dictionary: changes to the underlying dictionary are reflected in the proxy, but the proxy itself does not support mutation operations. This corresponds to :class:`types.MappingProxyType` in Python." -msgstr "" +msgid "" +"The type object for mapping proxy objects created by " +":c:func:`PyDictProxy_New` and for the read-only ``__dict__`` attribute of " +"many built-in types. A :c:type:`PyDictProxy_Type` instance provides a " +"dynamic, read-only view of an underlying dictionary: changes to the " +"underlying dictionary are reflected in the proxy, but the proxy itself does " +"not support mutation operations. This corresponds to " +":class:`types.MappingProxyType` in Python." +msgstr "" +"شیء نوع برای اشیاء پراکسی نگاشت ایجاد‌شده توسط :c:func:`PyDictProxy_New` و " +"برای ویژگی ``__dict__`` فقط‌خواندنی بسیاری از نوع‌های توکار. یک نمونه‌ی " +":c:type:`PyDictProxy_Type` نمای پویا و فقط‌خواندنی از یک دیکشنری زیرین ارائه" +" می‌دهد: تغییرات دیکشنری زیرین در پراکسی منعکس می‌شوند، اما خود پراکسی از " +"عملیات تغییر پشتیبانی نمی‌کند. این معادل :class:`types.MappingProxyType` در " +"پایتون است." msgid "Empty an existing dictionary of all key-value pairs." -msgstr "" +msgstr "یک دیکشنری موجود را از تمام جفت‌های کلید-مقدار خالی می‌کند." -msgid "Determine if dictionary *p* contains *key*. If an item in *p* matches *key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This is equivalent to the Python expression ``key in p``." +msgid "" +"Determine if dictionary *p* contains *key*. If an item in *p* matches " +"*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This " +"is equivalent to the Python expression ``key in p``." msgstr "" +"تعیین می‌کند که آیا دیکشنری *p* شامل *key* است یا خیر. اگر آیتمی در *p* با " +"*key* مطابقت داشته باشد، ``1`` را برمی‌گرداند، در غیر این صورت ``0`` را " +"برمی‌گرداند. در صورت خطا، ``-1`` را برمی‌گرداند. این معادل عبارت پایتونی " +"``key in p`` است." -msgid "The operation is atomic on :term:`free threading ` when *key* is :class:`str`, :class:`int`, :class:`float`, :class:`bool` or :class:`bytes`." +msgid "" +"The operation is atomic on :term:`free threading ` when" +" *key* is :class:`str`, :class:`int`, :class:`float`, :class:`bool` or " +":class:`bytes`." msgstr "" +"این عملیات در :term:`نخ‌بندی آزاد ` زمانی که *کلید* " +":class:`str`، :class:`int`، :class:`float`، :class:`bool` یا :class:`bytes` " +"باشد، اتمی است." -msgid "This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyDict_Contains` است، اما *key* به‌صورت یک رشته‌ی بایتیِ " +"کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه از نوع " +":c:expr:`PyObject*`." msgid "Return a new dictionary that contains the same key-value pairs as *p*." -msgstr "" +msgstr "یک دیکشنری جدید برمی‌گرداند که شامل همان جفت‌های کلید-مقدار *p* است." -msgid "Insert *val* into the dictionary *p* with a key of *key*. *key* must be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` on success or ``-1`` on failure. This function *does not* \":term:`steal`\" a reference to *val*." +msgid "" +"Insert *val* into the dictionary *p* with a key of *key*. *key* must be " +":term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0``" +" on success or ``-1`` on failure. This function *does not* \":term:`steal`\"" +" a reference to *val*." msgstr "" +"*val* را با کلید *key* در دیکشنری *p* درج می‌کند. *key* باید :term:`هش‌پذیر " +"` باشد؛ در غیر این صورت، استثنای :exc:`TypeError` ایجاد خواهد شد. " +"در صورت موفقیت ``0`` یا در صورت شکست ``-1`` برمی‌گرداند. این تابع ارجاعی به " +"*val* را «:term:`دزدی `» *نمی‌کند*." -msgid "This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyDict_SetItem` است، اما *کلید* به‌جای یک " +":c:expr:`PyObject*`، به‌صورت یک رشته‌ی بایتی کدگذاری‌شده با UTF-8 از نوع " +":c:expr:`const char*` مشخص می‌شود." -msgid "Remove the entry in dictionary *p* with key *key*. *key* must be :term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +msgid "" +"Remove the entry in dictionary *p* with key *key*. *key* must be " +":term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not " +"in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or " +"``-1`` on failure." msgstr "" +"ورودی دارای کلید *key* را از دیکشنری *p* حذف می‌کند. *key* باید " +":term:`hashable` باشد؛ در غیر این صورت، :exc:`TypeError` مطرح می‌شود. اگر " +"*key* در دیکشنری نباشد، :exc:`KeyError` مطرح می‌شود. در صورت موفقیت ``0`` و " +"در صورت شکست ``-1`` را برمی‌گرداند." -msgid "This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyDict_DelItem` است، اما *key* به‌عنوان یک رشته‌ی بایتی " +"کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه به‌عنوان " +":c:expr:`PyObject*`." -msgid "Return a new :term:`strong reference` to the object from dictionary *p* which has a key *key*:" +msgid "" +"Return a new :term:`strong reference` to the object from dictionary *p* " +"which has a key *key*:" msgstr "" +"بازگرداندن یک :term:`ارجاع قوی ` جدید به شیء موجود در " +"دیکشنری *p* که کلید *key* را دارد:" -msgid "If the key is present, set *\\*result* to a new :term:`strong reference` to the value and return ``1``." +msgid "" +"If the key is present, set *\\*result* to a new :term:`strong reference` to " +"the value and return ``1``." msgstr "" +"اگر کلید موجود باشد، *\\*result* را برابر یک :term:`ارجاع قوی ` جدید به مقدار قرار می‌دهد و ``1`` را برمی‌گرداند." msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." msgstr "" +"اگر کلید وجود نداشته باشد، *\\*result* برابر ``NULL`` قرار می‌گیرد و ``0`` " +"بازگردانده می‌شود." -msgid "On error, raise an exception, set *\\*result* to ``NULL`` and return ``-1``." +msgid "" +"On error, raise an exception, set *\\*result* to ``NULL`` and return ``-1``." msgstr "" +"در صورت خطا، یک استثنا برمی‌انگیزد، *\\*result* را برابر ``NULL`` قرار " +"می‌دهد و ``-1`` برمی‌گرداند." msgid "See also the :c:func:`PyObject_GetItem` function." -msgstr "" +msgstr "همچنین تابع :c:func:`PyObject_GetItem` را ببینید." -msgid "Return a :term:`borrowed reference` to the object from dictionary *p* which has a key *key*. Return ``NULL`` if the key *key* is missing *without* setting an exception." +msgid "" +"Return a :term:`borrowed reference` to the object from dictionary *p* which " +"has a key *key*. Return ``NULL`` if the key *key* is missing *without* " +"setting an exception." msgstr "" +":term:`ارجاع امانتی ` به شیء دارای کلید *key* را از " +"دیکشنری *p* برمی‌گرداند. اگر کلید *key* موجود نباشد، ``NULL`` را *بدون* " +"تنظیم استثنا برمی‌گرداند." -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." +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 "" +"استثناهایی که هنگام فراخوانی متدهای :meth:`~object.__hash__` و " +":meth:`~object.__eq__` توسط این تابع رخ می‌دهند، بی‌صدا نادیده گرفته " +"می‌شوند. به‌جای آن، استفاده از تابع :c:func:`PyDict_GetItemWithError` را " +"ترجیح دهید." -msgid "In the :term:`free-threaded build`, the returned :term:`borrowed reference` may become invalid if another thread modifies the dictionary concurrently. Prefer :c:func:`PyDict_GetItemRef`, which returns a :term:`strong reference`." +msgid "" +"In the :term:`free-threaded build`, the returned :term:`borrowed reference` " +"may become invalid if another thread modifies the dictionary concurrently. " +"Prefer :c:func:`PyDict_GetItemRef`, which returns a :term:`strong " +"reference`." msgstr "" +"در :term:`بیلد نخ‌آزاد `، اگر نخ دیگری دیکشنری را " +"به‌طور هم‌زمان تغییر دهد، :term:`ارجاع امانتی ` " +"برگردانده‌شده ممکن است نامعتبر شود. استفاده از :c:func:`PyDict_GetItemRef` " +"را ترجیح دهید که یک :term:`ارجاع قوی ` برمی‌گرداند." -msgid "Calling this API without an :term:`attached thread state` had been allowed for historical reason. It is no longer allowed." +msgid "" +"Calling this API without an :term:`attached thread state` had been allowed " +"for historical reason. It is no longer allowed." msgstr "" +"فراخوانی این API بدون :term:`وضعیت نخ متصل ` به دلایل" +" تاریخی مجاز بود. این کار دیگر مجاز نیست." -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." +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:func:`PyDict_GetItem` که استثناها را فرونمی‌نشاند. اگر " +"استثنایی رخ داده باشد، ``NULL`` را **همراه با** استثنای تنظیم‌شده " +"برمی‌گرداند. اگر کلید موجود نباشد، ``NULL`` را **بدون** استثنای تنظیم‌شده " +"برمی‌گرداند." -msgid "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyDict_GetItem` است، اما *key* به‌جای :c:expr:`PyObject*`،" +" به‌صورت یک رشته بایت کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص" +" می‌شود." -msgid "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:`~object.__eq__` methods or while creating the temporary :class:`str` object are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` function with your own :c:func:`PyUnicode_FromString` *key* instead." -msgstr "" +msgid "" +"Exceptions that occur while this calls :meth:`~object.__hash__` and " +":meth:`~object.__eq__` methods or while creating the temporary :class:`str` " +"object are silently ignored. Prefer using the " +":c:func:`PyDict_GetItemWithError` function with your own " +":c:func:`PyUnicode_FromString` *key* instead." +msgstr "" +"استثناهایی که هنگام فراخوانی متدهای :meth:`~object.__hash__` و " +":meth:`~object.__eq__` توسط این تابع یا هنگام ایجاد شیء موقت :class:`str` رخ" +" می‌دهند، به‌صورت خاموش نادیده گرفته می‌شوند. به‌جای آن، بهتر است از تابع " +":c:func:`PyDict_GetItemWithError` به‌همراه *کلید* " +":c:func:`PyUnicode_FromString` خودتان استفاده کنید." -msgid "In the :term:`free-threaded build`, the returned :term:`borrowed reference` may become invalid if another thread modifies the dictionary concurrently. Prefer :c:func:`PyDict_GetItemStringRef`, which returns a :term:`strong reference`." +msgid "" +"In the :term:`free-threaded build`, the returned :term:`borrowed reference` " +"may become invalid if another thread modifies the dictionary concurrently. " +"Prefer :c:func:`PyDict_GetItemStringRef`, which returns a :term:`strong " +"reference`." msgstr "" +"در :term:`free-threaded build`، اگر نخ دیگری دیکشنری را به‌صورت هم‌زمان " +"تغییر دهد، ممکن است :term:`borrowed reference` بازگردانده‌شده نامعتبر شود. " +"ترجیحاً از :c:func:`PyDict_GetItemStringRef` استفاده کنید که یک " +":term:`strong reference` برمی‌گرداند." -msgid "Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"مشابه :c:func:`PyDict_GetItemRef`، اما *key* به‌عنوان یک رشته بایت " +"کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه به‌صورت " +":c:expr:`PyObject*`." -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 key is not in the dict, it is inserted with value *defaultobj* and *defaultobj* is returned. This function evaluates the hash function of *key* only once, instead of evaluating it independently for the lookup and the insertion." -msgstr "" +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" +" key is not in the dict, it is inserted with value *defaultobj* and " +"*defaultobj* is returned. This function evaluates the hash function of " +"*key* only once, instead of evaluating it independently for the lookup and " +"the insertion." +msgstr "" +"این همان :meth:`dict.setdefault` در سطح پایتون است. در صورت وجود، مقدار " +"متناظر با *key* را از دیکشنری *p* برمی‌گرداند. اگر کلید در دیکشنری نباشد، با" +" مقدار *defaultobj* درج می‌شود و *defaultobj* برگردانده می‌شود. این تابع، " +"تابع هش *key* را تنها یک بار ارزیابی می‌کند، به‌جای اینکه آن را به‌طور مستقل" +" برای جستجو و درج ارزیابی کند." -msgid "In the :term:`free-threaded build`, the returned :term:`borrowed reference` may become invalid if another thread modifies the dictionary concurrently. Prefer :c:func:`PyDict_SetDefaultRef`, which returns a :term:`strong reference`." +msgid "" +"In the :term:`free-threaded build`, the returned :term:`borrowed reference` " +"may become invalid if another thread modifies the dictionary concurrently. " +"Prefer :c:func:`PyDict_SetDefaultRef`, which returns a :term:`strong " +"reference`." msgstr "" +"در :term:`نسخه‌ی نخ‌آزاد `، اگر نخ دیگری دیکشنری را " +"هم‌زمان تغییر دهد، ممکن است :term:`ارجاع امانتی ` " +"بازگردانده‌شده نا‌معتبر شود. ترجیح دهید از :c:func:`PyDict_SetDefaultRef` " +"استفاده کنید که یک :term:`ارجاع قوی ` برمی‌گرداند." -msgid "Inserts *default_value* into the dictionary *p* with a key of *key* if the key is not already present in the dictionary. If *result* is not ``NULL``, then *\\*result* is set to a :term:`strong reference` to either *default_value*, if the key was not present, or the existing value, if *key* was already present in the dictionary. Returns ``1`` if the key was present and *default_value* was not inserted, or ``0`` if the key was not present and *default_value* was inserted. On failure, returns ``-1``, sets an exception, and sets ``*result`` to ``NULL``." -msgstr "" +msgid "" +"Inserts *default_value* into the dictionary *p* with a key of *key* if the " +"key is not already present in the dictionary. If *result* is not ``NULL``, " +"then *\\*result* is set to a :term:`strong reference` to either " +"*default_value*, if the key was not present, or the existing value, if *key*" +" was already present in the dictionary. Returns ``1`` if the key was present" +" and *default_value* was not inserted, or ``0`` if the key was not present " +"and *default_value* was inserted. On failure, returns ``-1``, sets an " +"exception, and sets ``*result`` to ``NULL``." +msgstr "" +"در صورتی که کلید از قبل در دیکشنری وجود نداشته باشد، *default_value* را با " +"کلید *key* در دیکشنری *p* درج می‌کند. اگر *result* برابر ``NULL`` نباشد، " +"*\\*result* به یک :term:`strong reference` به *default_value* (در صورتی که " +"کلید وجود نداشته باشد) یا به مقدار موجود (در صورتی که *key* از قبل در " +"دیکشنری وجود داشته باشد) تنظیم می‌شود. اگر کلید وجود داشته باشد و " +"*default_value* درج نشده باشد، ``1`` را برمی‌گرداند، و اگر کلید وجود نداشته " +"باشد و *default_value* درج شده باشد، ``0`` را برمی‌گرداند. در صورت شکست، " +"``-1`` را برمی‌گرداند، یک استثنا تنظیم می‌کند و ``*result`` را برابر " +"``NULL`` قرار می‌دهد." -msgid "For clarity: if you have a strong reference to *default_value* before calling this function, then after it returns, you hold a strong reference to both *default_value* and *\\*result* (if it's not ``NULL``). These may refer to the same object: in that case you hold two separate references to it." -msgstr "" +msgid "" +"For clarity: if you have a strong reference to *default_value* before " +"calling this function, then after it returns, you hold a strong reference to" +" both *default_value* and *\\*result* (if it's not ``NULL``). These may " +"refer to the same object: in that case you hold two separate references to " +"it." +msgstr "" +"برای شفافیت: اگر پیش از فراخوانی این تابع، ارجاع قوی به *default_value* " +"داشته باشید، پس از بازگشت آن، ارجاع قوی به هر دو *default_value* و " +"*\\*result* را در اختیار دارید (اگر ``NULL`` نباشد). این دو ممکن است به یک " +"شیء واحد اشاره داشته باشند: در این صورت دو ارجاع جداگانه به آن در اختیار " +"دارید." -msgid "Remove *key* from dictionary *p* and optionally return the removed value. Do not raise :exc:`KeyError` if the key is missing." +msgid "" +"Remove *key* from dictionary *p* and optionally return the removed value. Do" +" not raise :exc:`KeyError` if the key is missing." msgstr "" +"کلید *key* را از دیکشنری *p* حذف می‌کند و به‌صورت اختیاری مقدار حذف‌شده را " +"برمی‌گرداند. اگر کلید وجود نداشته باشد، استثنای :exc:`KeyError` صادر " +"نمی‌شود." -msgid "If the key is present, set *\\*result* to a new reference to the removed value if *result* is not ``NULL``, and return ``1``." +msgid "" +"If the key is present, set *\\*result* to a new reference to the removed " +"value if *result* is not ``NULL``, and return ``1``." msgstr "" +"اگر کلید موجود باشد، *\\*result* را در صورتی که *result* برابر ``NULL`` " +"نباشد، برابر ارجاعی جدید به مقدار حذف‌شده قرار می‌دهد و ``1`` را " +"برمی‌گرداند." -msgid "If the key is missing, set *\\*result* to ``NULL`` if *result* is not ``NULL``, and return ``0``." +msgid "" +"If the key is missing, set *\\*result* to ``NULL`` if *result* is not " +"``NULL``, and return ``0``." msgstr "" +"اگر کلید وجود نداشته باشد، *\\*result* را در صورتی که *result* برابر " +"``NULL`` نباشد برابر ``NULL`` قرار می‌دهد و ``0`` را برمی‌گرداند." msgid "On error, raise an exception and return ``-1``." -msgstr "" +msgstr "در صورت خطا، یک استثنا پرتاب‌شده و ``-1`` بازگردانده می‌شود." -msgid "Similar to :meth:`dict.pop`, but without the default value and not raising :exc:`KeyError` if the key is missing." +msgid "" +"Similar to :meth:`dict.pop`, but without the default value and not raising " +":exc:`KeyError` if the key is missing." msgstr "" +"شبیه :meth:`dict.pop` است، اما بدون مقدار پیش‌فرض و در صورت نبود کلید، " +"استثنای :exc:`KeyError` ایجاد نمی‌کند." -msgid "Similar to :c:func:`PyDict_Pop`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"Similar to :c:func:`PyDict_Pop`, but *key* is specified as a :c:expr:`const " +"char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." msgstr "" +"مشابه :c:func:`PyDict_Pop`، اما *key* به‌عنوان یک رشته بایت کدگذاری‌شده با " +"UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه یک :c:expr:`PyObject*`." -msgid "Return a :c:type:`PyListObject` containing all the items from the dictionary." -msgstr "" +msgid "" +"Return a :c:type:`PyListObject` containing all the items from the " +"dictionary." +msgstr "یک :c:type:`PyListObject` حاوی همه‌ی آیتم‌های دیکشنری را برمی‌گرداند." -msgid "Return a :c:type:`PyListObject` containing all the keys from the dictionary." -msgstr "" +msgid "" +"Return a :c:type:`PyListObject` containing all the keys from the dictionary." +msgstr "یک :c:type:`PyListObject` شامل همه‌ی کلیدهای دیکشنری برمی‌گرداند." -msgid "Return a :c:type:`PyListObject` containing all the values from the dictionary *p*." -msgstr "" +msgid "" +"Return a :c:type:`PyListObject` containing all the values from the " +"dictionary *p*." +msgstr "یک :c:type:`PyListObject` شامل تمام مقادیر دیکشنری *p* برمی‌گرداند." -msgid "Return the number of items in the dictionary. This is equivalent to ``len(p)`` on a dictionary." +msgid "" +"Return the number of items in the dictionary. This is equivalent to " +"``len(p)`` on a dictionary." msgstr "" +"تعداد آیتم‌های موجود در دیکشنری را برمی‌گرداند. این معادل ``len(p)`` روی یک " +"دیکشنری است." msgid "Similar to :c:func:`PyDict_Size`, but without error checking." -msgstr "" +msgstr "مشابه :c:func:`PyDict_Size`، اما بدون بررسی خطا." -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 first call to this function to start the iteration; the function returns true for each pair in the dictionary, and false once all pairs have been reported. The parameters *pkey* and *pvalue* should either point to :c:expr:`PyObject*` variables that will be filled in with each key and value, respectively, or may be ``NULL``. Any references returned through them are borrowed. *ppos* should not be altered during iteration. Its value represents offsets within the internal dictionary structure, and since the structure is sparse, the offsets are not consecutive." -msgstr "" +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 first call to this function to start the iteration; the " +"function returns true for each pair in the dictionary, and false once all " +"pairs have been reported. The parameters *pkey* and *pvalue* should either " +"point to :c:expr:`PyObject*` variables that will be filled in with each key " +"and value, respectively, or may be ``NULL``. Any references returned " +"through them are borrowed. *ppos* should not be altered during iteration. " +"Its value represents offsets within the internal dictionary structure, and " +"since the structure is sparse, the offsets are not consecutive." +msgstr "" +"تمام جفت‌های کلید-مقدار در دیکشنری *p* را پیمایش می‌کند. " +"مقدار :c:type:`Py_ssize_t` که توسط *ppos* مشخص می‌شود، باید پیش از " +"نخستین فراخوانی این تابع برای آغاز پیمایش، با ``0`` مقداردهی اولیه شود؛ " +"این تابع برای هر جفت موجود در دیکشنری مقدار true و پس از گزارش همه‌ی " +"جفت‌ها مقدار false را برمی‌گرداند. پارامترهای *pkey* و *pvalue* باید " +"به متغیرهایی از نوع :c:expr:`PyObject*` اشاره کنند که به‌ترتیب با هر " +"کلید و مقدار پر می‌شوند، یا می‌توانند ``NULL`` باشند. هر ارجاعی که از " +"طریق آن‌ها بازگردانده می‌شود، امانتی است. *ppos* نباید در طول پیمایش " +"تغییر داده شود. مقدار آن نشان‌دهنده‌ی آفست‌هایی در ساختار داخلی " +"دیکشنری است و از آنجا که این ساختار خلوت است، این آفست‌ها متوالی نیستند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "PyObject *key, *value;\n" @@ -177,9 +430,22 @@ msgid "" " ...\n" "}" msgstr "" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" /* do something interesting with the values... */\n" +" ...\n" +"}" -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::" +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 "" +"دیکشنری *p* نباید در حین پیمایش تغییر داده شود. تغییر دادن مقدارهای کلیدها " +"هنگام پیمایش دیکشنری ایمن است، اما تنها تا زمانی که مجموعه‌ی کلیدها تغییر " +"نکند. برای مثال::" msgid "" "PyObject *key, *value;\n" @@ -200,9 +466,33 @@ msgid "" " Py_DECREF(o);\n" "}" msgstr "" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" long i = PyLong_AsLong(value);\n" +" if (i == -1 && PyErr_Occurred()) {\n" +" return -1;\n" +" }\n" +" PyObject *o = PyLong_FromLong(i + 1);\n" +" if (o == NULL)\n" +" return -1;\n" +" if (PyDict_SetItem(self->dict, key, o) < 0) {\n" +" Py_DECREF(o);\n" +" return -1;\n" +" }\n" +" Py_DECREF(o);\n" +"}" -msgid "The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" +msgid "" +"The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use " +":c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating " +"over it::" msgstr "" +"این تابع در بیلدِ :term:`نخ‌آزاد ` بدون همگام‌سازی بیرونی، " +"نخ‌ایمن نیست. می‌توانید از :c:macro:`Py_BEGIN_CRITICAL_SECTION` برای قفل " +"کردن دیکشنری در حین پیمایش آن استفاده کنید::" msgid "" "Py_BEGIN_CRITICAL_SECTION(self->dict);\n" @@ -211,21 +501,83 @@ msgid "" "}\n" "Py_END_CRITICAL_SECTION();" msgstr "" +"Py_BEGIN_CRITICAL_SECTION(self->dict);\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" -msgid "On the free-threaded build, this function can be used safely inside a critical section. However, the references returned for *pkey* and *pvalue* are :term:`borrowed ` and are only valid while the critical section is held. If you need to use these objects outside the critical section or when the critical section can be suspended, create a :term:`strong reference ` (for example, using :c:func:`Py_NewRef`)." -msgstr "" +msgid "" +"On the free-threaded build, this function can be used safely inside a " +"critical section. However, the references returned for *pkey* and *pvalue* " +"are :term:`borrowed ` and are only valid while the " +"critical section is held. If you need to use these objects outside the " +"critical section or when the critical section can be suspended, create a " +":term:`strong reference ` (for example, using " +":c:func:`Py_NewRef`)." +msgstr "" +"در نسخه‌ی نخ‌آزاد، می‌توان از این تابع به‌طور ایمن درون بخش بحرانی استفاده " +"کرد. با این حال، ارجاع‌های برگردانده‌شده برای *pkey* و *pvalue* " +":term:`امانتی ` هستند و تنها تا زمانی که بخش بحرانی " +"برقرار است معتبرند. اگر نیاز دارید از این اشیاء خارج از بخش بحرانی یا در " +"زمانی که بخش بحرانی ممکن است معلق شود استفاده کنید، یک :term:`ارجاع قوی " +"` ایجاد کنید (برای مثال، با استفاده از " +":c:func:`Py_NewRef`)." -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` and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a* will be replaced if a matching key is found in *b*, otherwise pairs will only be added if there is not a matching key in *a*. Return ``0`` on success or ``-1`` if an exception was raised." -msgstr "" +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` " +"and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a*" +" will be replaced if a matching key is found in *b*, otherwise pairs will " +"only be added if there is not a matching key in *a*. Return ``0`` on success" +" or ``-1`` if an exception was raised." +msgstr "" +"بر روی شیء نگاشت *b* پیمایش می‌کند و جفت‌های کلید-مقدار را به دیکشنری *a* " +"اضافه می‌کند. *b* می‌تواند یک دیکشنری یا هر شیئی باشد که از " +":c:func:`PyMapping_Keys` و :c:func:`PyObject_GetItem` پشتیبانی کند. اگر " +"*override* درست باشد، جفت‌های موجود در *a* در صورتی که کلید مطابقی در *b* " +"یافت شود جایگزین می‌شوند، در غیر این صورت جفت‌ها تنها در صورتی اضافه می‌شوند" +" که کلید مطابقی در *a* وجود نداشته باشد. در صورت موفقیت ``0`` و در صورت " +"ایجاد استثنا ``-1`` بازگردانده می‌شود." -msgid "In the :term:`free-threaded build`, when *b* is a :class:`dict` (with the standard iterator), both *a* and *b* are locked for the duration of the operation. When *b* is a non-dict mapping, only *a* is locked; *b* may be concurrently modified by another thread." +msgid "" +"In the :term:`free-threaded build`, when *b* is a :class:`dict` (with the " +"standard iterator), both *a* and *b* are locked for the duration of the " +"operation. When *b* is a non-dict mapping, only *a* is locked; *b* may be " +"concurrently modified by another thread." msgstr "" +"در :term:`free-threaded build`، وقتی *b* یک :class:`dict` (با پیمایش‌گر " +"استاندارد) باشد، هر دو *a* و *b* در طول عملیات قفل می‌شوند. وقتی *b* یک " +"نگاشت غیردیکشنری باشد، فقط *a* قفل می‌شود؛ *b* ممکن است توسط نخ دیگری به‌طور" +" هم‌زمان تغییر یابد." -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 to the iterating over a sequence of key value pairs if the second argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an exception was raised." -msgstr "" +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 to the iterating over a sequence of key value pairs if the second " +"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an" +" exception was raised." +msgstr "" +"این همان ``PyDict_Merge(a, b, 1)`` در C است و مشابه ``a.update(b)`` در " +"پایتون است، با این تفاوت که :c:func:`PyDict_Update` در صورتی که آرگومان دوم " +"ویژگی «keys» نداشته باشد، به پیمایش دنباله‌ای از جفت‌های کلید-مقدار " +"بازنمی‌گردد. در صورت موفقیت ``0`` و در صورت بروز استثنا ``-1`` را " +"برمی‌گرداند." -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, viewed as key-value pairs. In case of duplicate keys, the last wins if *override* is true, else the first wins. Return ``0`` on success or ``-1`` if an exception was raised. Equivalent Python (except for the return value)::" -msgstr "" +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, " +"viewed as key-value pairs. In case of duplicate keys, the last wins if " +"*override* is true, else the first wins. Return ``0`` on success or ``-1`` " +"if an exception was raised. Equivalent Python (except for the return " +"value)::" +msgstr "" +"به‌روزرسانی یا ادغام در دیکشنری *a*، از جفت‌های کلید-مقدار در *seq2*. *seq2*" +" باید یک شیء پیمایش‌پذیر باشد که اشیاء پیمایش‌پذیر با طول ۲ تولید می‌کند که " +"به‌عنوان جفت‌های کلید-مقدار در نظر گرفته می‌شوند. در صورت وجود کلیدهای " +"تکراری، اگر *override* درست باشد آخری برنده می‌شود، در غیر این صورت اولی " +"برنده می‌شود. در صورت موفقیت ``0`` و در صورت پرتاب استثنا ``-1`` " +"برمی‌گرداند. معادل پایتونی (به‌جز مقدار بازگشتی)::" msgid "" "def PyDict_MergeFromSeq2(a, seq2, override):\n" @@ -233,153 +585,328 @@ msgid "" " if override or key not in a:\n" " a[key] = value" msgstr "" +"def PyDict_MergeFromSeq2(a, seq2, override):\n" +" for key, value in seq2:\n" +" if override or key not in a:\n" +" a[key] = value" -msgid "In the :term:`free-threaded ` build, only *a* is locked. The iteration over *seq2* is not synchronized; *seq2* may be concurrently modified by another thread." +msgid "" +"In the :term:`free-threaded ` build, only *a* is locked. The" +" iteration over *seq2* is not synchronized; *seq2* may be concurrently " +"modified by another thread." msgstr "" +"در بیلد :term:`نخ‌آزاد `، فقط *a* قفل می‌شود. پیمایش روی " +"*seq2* همگام‌سازی نمی‌شود؛ ممکن است *seq2* به‌طور هم‌زمان توسط نخ دیگری " +"تغییر یابد." -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 of error (e.g. no more watcher IDs available), return ``-1`` and set an exception." +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 " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." msgstr "" +"*callback* را به‌عنوان دیده‌بان (watcher) دیکشنری ثبت می‌کند. یک شناسه‌ی عدد" +" صحیح نامنفی برمی‌گرداند که باید به فراخوانی‌های آتی :c:func:`PyDict_Watch` " +"پاس داده شود. در صورت خطا (برای مثال، وقتی دیگر شناسه‌ی دیده‌بانی در دسترس " +"نباشد)، مقدار ``-1`` را برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "This function is not internally synchronized. In the :term:`free-threaded ` build, callers should ensure no concurrent calls to :c:func:`PyDict_AddWatcher` or :c:func:`PyDict_ClearWatcher` are in progress." +msgid "" +"This function is not internally synchronized. In the :term:`free-threaded " +"` build, callers should ensure no concurrent calls to " +":c:func:`PyDict_AddWatcher` or :c:func:`PyDict_ClearWatcher` are in " +"progress." msgstr "" +"این تابع به‌طور داخلی همگام‌سازی نمی‌شود. در نسخه‌ی :term:`نخ‌آزاد `، فراخوان‌کنندگان باید اطمینان حاصل کنند که هیچ فراخوانی هم‌زمانی" +" از :c:func:`PyDict_AddWatcher` یا :c:func:`PyDict_ClearWatcher` در حال " +"انجام نیست." -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.)" +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 "" +"پایشگر (watcher) شناسایی‌شده با *watcher_id* را که پیش‌تر از " +":c:func:`PyDict_AddWatcher` برگردانده شده است، پاک می‌کند. در صورت موفقیت " +"``0`` و در صورت خطا ``-1`` برمی‌گرداند (مثلاً اگر *watcher_id* داده‌شده هرگز" +" ثبت نشده باشد.)" -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." +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 "" +"دیکشنری *dict* را به‌عنوان تحت نظر علامت‌گذاری می‌کند. کال‌بکی که " +":c:func:`PyDict_AddWatcher` شناسه‌ی *watcher_id* را به آن اعطا کرده است، " +"هنگامی که *dict* تغییر داده شود یا تخصیص‌گشایی شود فراخوانی خواهد شد. در " +"صورت موفقیت ``0`` و در صورت خطا ``-1`` برمی‌گرداند." -msgid "Mark dictionary *dict* as no longer watched. The callback granted *watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when *dict* is modified or deallocated. The dict must previously have been watched by this watcher. Return ``0`` on success or ``-1`` on error." +msgid "" +"Mark dictionary *dict* as no longer watched. The callback granted " +"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " +"*dict* is modified or deallocated. The dict must previously have been " +"watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" +"دیکشنری *dict* را به‌عنوان دیگر دیده‌بانی‌نشده علامت‌گذاری می‌کند. کال‌بکی " +"که :c:func:`PyDict_AddWatcher` شناسه‌ی *watcher_id* را به آن اعطا کرده است، " +"دیگر زمانی که *dict* تغییر داده یا آزادسازی شود، فراخوانی نخواهد شد. دیکشنری" +" باید پیش‌تر توسط این دیده‌بان دیده‌بانی شده باشد. در صورت موفقیت ``0`` و در" +" صورت خطا ``-1`` را برمی‌گرداند." -msgid "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, ``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, ``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or ``PyDict_EVENT_DEALLOCATED``." +msgid "" +"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " +"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " +"``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or " +"``PyDict_EVENT_DEALLOCATED``." msgstr "" +"برشمردن رویدادهای ممکن دیده‌بان دیکشنری: ``PyDict_EVENT_ADDED``، " +"``PyDict_EVENT_MODIFIED``، ``PyDict_EVENT_DELETED``، " +"``PyDict_EVENT_CLONED``، ``PyDict_EVENT_CLEARED`` یا " +"``PyDict_EVENT_DEALLOCATED``." msgid "Type of a dict watcher callback function." -msgstr "" +msgstr "نوع تابع کال‌بک ناظر دیکشنری." -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`` or ``PyDict_EVENT_MODIFIED``, *new_value* will be the new value for *key*. If *event* is ``PyDict_EVENT_DELETED``, *key* is being deleted from the dictionary and *new_value* will be ``NULL``." -msgstr "" +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`` or ``PyDict_EVENT_MODIFIED``, *new_value* will be the" +" new value for *key*. If *event* is ``PyDict_EVENT_DELETED``, *key* is being" +" deleted from the dictionary and *new_value* will be ``NULL``." +msgstr "" +"اگر *event* برابر ``PyDict_EVENT_CLEARED`` یا ``PyDict_EVENT_DEALLOCATED`` " +"باشد، هر دو *key* و *new_value* برابر ``NULL`` خواهند بود. اگر *event* برابر" +" ``PyDict_EVENT_ADDED`` یا ``PyDict_EVENT_MODIFIED`` باشد، *new_value* مقدار" +" جدید برای *key* خواهد بود. اگر *event* برابر ``PyDict_EVENT_DELETED`` باشد،" +" *key* در حال حذف شدن از دیکشنری است و *new_value* برابر ``NULL`` خواهد بود." -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 ``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single ``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." +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 " +"``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single " +"``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" +"``PyDict_EVENT_CLONED`` زمانی رخ می‌دهد که *dict* قبلاً خالی بوده و دیکشنری " +"دیگری در آن ادغام شود. برای حفظ کارایی این عملیات، در این حالت رویدادهای " +"``PyDict_EVENT_ADDED`` به ازای هر کلید صادر نمی‌شوند؛ در عوض یک " +"``PyDict_EVENT_CLONED`` واحد صادر می‌شود و *key* دیکشنری منبع خواهد بود." -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." +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 "" +"کال‌بک می‌تواند *dict* را بازرسی کند، اما نباید آن را تغییر دهد؛ انجام این " +"کار می‌تواند اثرات غیرقابل پیش‌بینی، از جمله بازگشت بی‌نهایت، داشته باشد. در" +" کال‌بک، اجرای کد پایتون را فعال نکنید، زیرا ممکن است به عنوان یک عارضه " +"جانبی، دیکشنری را تغییر دهد." -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 prevent it from being freed at this time. When the resurrected object is destroyed later, any watcher callbacks active at that time will be called again." +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 " +"prevent it from being freed at this time. When the resurrected object is " +"destroyed later, any watcher callbacks active at that time will be called " +"again." msgstr "" +"اگر *event* برابر ``PyDict_EVENT_DEALLOCATED`` باشد، گرفتن یک ارجاع جدید به " +"دیکشنریِ در آستانه‌ی نابودی از درون کال‌بک، آن را احیا می‌کند و جلوی آزاد " +"شدن آن را در این لحظه می‌گیرد. هنگامی که شیء احیا‌شده بعداً نابود شود، هر " +"کال‌بکِ ناظری که در آن زمان فعال باشد، دوباره فراخوانی خواهد شد." -msgid "Callbacks occur before the notified modification to *dict* takes place, so the prior state of *dict* can be inspected." +msgid "" +"Callbacks occur before the notified modification to *dict* takes place, so " +"the prior state of *dict* can be inspected." msgstr "" +"کال‌بک‌ها پیش از انجام تغییر اطلاع‌رسانی‌شده در *dict* رخ می‌دهند، بنابراین " +"می‌توان وضعیت پیشین *dict* را بررسی کرد." -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``." +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 "" +"اگر کال‌بک استثنایی تنظیم کند، باید ``-1`` را برگرداند؛ این استثنا با " +"استفاده از :c:func:`PyErr_WriteUnraisable` به‌عنوان یک استثنای " +"غیرقابل‌برافراشتن (unraisable) چاپ خواهد شد. در غیر این صورت، بهتر است ``0``" +" را برگرداند." -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 set. This means the callback may not call any other API that can set an exception unless it saves and clears the exception state first, and restores it before returning." -msgstr "" +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 " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores" +" it before returning." +msgstr "" +"ممکن است هنگام ورود به کال‌بک، از قبل استثنایی در انتظار تنظیم‌شده باشد. در " +"این حالت، کال‌بک باید ``0`` را بازگرداند، در حالی که همان استثنا همچنان " +"تنظیم‌شده است. این بدان معناست که کال‌بک نمی‌تواند هیچ API دیگری که می‌تواند" +" استثنا تنظیم کند فراخوانی کند، مگر آنکه ابتدا وضعیت استثنا را ذخیره و پاک " +"کند و پیش از بازگشت، آن را بازگردانی کند." msgid "Dictionary View Objects" msgstr "اشیاء نمای دیکشنری" -msgid "Return true if *op* is a view of a set inside a dictionary. This is currently equivalent to :c:expr:`PyDictKeys_Check(op) || PyDictItems_Check(op)`. This function always succeeds." +msgid "" +"Return true if *op* is a view of a set inside a dictionary. This is " +"currently equivalent to :c:expr:`PyDictKeys_Check(op) || " +"PyDictItems_Check(op)`. This function always succeeds." msgstr "" +"اگر *op* نمایی از یک مجموعه درون یک دیکشنری باشد، مقدار true را برمی‌گرداند." +" این تابع در حال حاضر معادل :c:expr:`PyDictKeys_Check(op) || " +"PyDictItems_Check(op)` است. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Type object for a view of dictionary keys. In Python, this is the type of the object returned by :meth:`dict.keys`." +msgid "" +"Type object for a view of dictionary keys. In Python, this is the type of " +"the object returned by :meth:`dict.keys`." msgstr "" +"شیء نوع برای نمای کلیدهای دیکشنری. در پایتون، این نوع شیء‌ای است که " +":meth:`dict.keys` برمی‌گرداند." -msgid "Return true if *op* is an instance of a dictionary keys view. This function always succeeds." +msgid "" +"Return true if *op* is an instance of a dictionary keys view. This function " +"always succeeds." msgstr "" +"اگر *op* نمونه‌ای از نمای کلیدهای دیکشنری باشد، مقدار true برمی‌گرداند. این " +"تابع همیشه با موفقیت اجرا می‌شود." -msgid "Type object for a view of dictionary values. In Python, this is the type of the object returned by :meth:`dict.values`." +msgid "" +"Type object for a view of dictionary values. In Python, this is the type of " +"the object returned by :meth:`dict.values`." msgstr "" +"شیء نوع برای نمای مقادیر دیکشنری. در پایتون، این نوع شیء‌ای است که توسط " +":meth:`dict.values` بازگردانده می‌شود." -msgid "Return true if *op* is an instance of a dictionary values view. This function always succeeds." +msgid "" +"Return true if *op* is an instance of a dictionary values view. This " +"function always succeeds." msgstr "" +"اگر *op* نمونه‌ای از نمای مقادیر دیکشنری باشد، مقدار true برمی‌گرداند. این " +"تابع همیشه با موفقیت اجرا می‌شود." -msgid "Type object for a view of dictionary items. In Python, this is the type of the object returned by :meth:`dict.items`." +msgid "" +"Type object for a view of dictionary items. In Python, this is the type of " +"the object returned by :meth:`dict.items`." msgstr "" +"شیء نوع برای نمای آیتم‌های دیکشنری. در پایتون، این نوع شیءی است که توسط " +":meth:`dict.items` برگردانده می‌شود." -msgid "Return true if *op* is an instance of a dictionary items view. This function always succeeds." +msgid "" +"Return true if *op* is an instance of a dictionary items view. This function" +" always succeeds." msgstr "" +"اگر *op* نمونه‌ای از نمای آیتم‌های دیکشنری باشد، مقدار true را برمی‌گرداند. " +"این تابع همیشه با موفقیت اجرا می‌شود." msgid "Ordered Dictionaries" -msgstr "" +msgstr "دیکشنری‌های ترتیب‌دار" -msgid "Python's C API provides interface for :class:`collections.OrderedDict` from C. Since Python 3.7, dictionaries are ordered by default, so there is usually little need for these functions; prefer ``PyDict*`` where possible." +msgid "" +"Python's C API provides interface for :class:`collections.OrderedDict` from " +"C. Since Python 3.7, dictionaries are ordered by default, so there is " +"usually little need for these functions; prefer ``PyDict*`` where possible." msgstr "" +"API زبان C پایتون رابطی برای :class:`collections.OrderedDict` از C فراهم " +"می‌کند. از پایتون 3.7 به بعد، دیکشنری‌ها به‌طور پیش‌فرض مرتب هستند، بنابراین" +" معمولاً نیاز اندکی به این توابع وجود دارد؛ در صورت امکان ``PyDict*`` را " +"ترجیح دهید." -msgid "Type object for ordered dictionaries. This is the same object as :class:`collections.OrderedDict` in the Python layer." +msgid "" +"Type object for ordered dictionaries. This is the same object as " +":class:`collections.OrderedDict` in the Python layer." msgstr "" +"شیء نوع برای دیکشنری‌های مرتب. این همان شیء :class:`collections.OrderedDict`" +" در لایه‌ی پایتون است." -msgid "Return true if *od* is an ordered dictionary object or an instance of a subtype of the :class:`~collections.OrderedDict` type. This function always succeeds." +msgid "" +"Return true if *od* is an ordered dictionary object or an instance of a " +"subtype of the :class:`~collections.OrderedDict` type. This function always" +" succeeds." msgstr "" +"اگر *od* یک شیء دیکشنری مرتب یا نمونه‌ای از یک زیرنوع از نوع " +":class:`~collections.OrderedDict` باشد، مقدار true را برمی‌گرداند. این تابع " +"همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *od* is an ordered dictionary object, but not an instance of a subtype of the :class:`~collections.OrderedDict` type. This function always succeeds." +msgid "" +"Return true if *od* is an ordered dictionary object, but not an instance of " +"a subtype of the :class:`~collections.OrderedDict` type. This function " +"always succeeds." msgstr "" +"اگر *od* یک شیء دیکشنری مرتب باشد، اما نمونه‌ای از یک زیرنوع از نوع " +":class:`~collections.OrderedDict` نباشد، مقدار درست را برمی‌گرداند. این تابع" +" همیشه موفق است." msgid "Analogous to :c:type:`PyDictKeys_Type` for ordered dictionaries." -msgstr "" +msgstr "مشابه :c:type:`PyDictKeys_Type` برای دیکشنری‌های مرتب." msgid "Analogous to :c:type:`PyDictValues_Type` for ordered dictionaries." -msgstr "" +msgstr "مشابه :c:type:`PyDictValues_Type` برای دیکشنری‌های مرتب." msgid "Analogous to :c:type:`PyDictItems_Type` for ordered dictionaries." -msgstr "" +msgstr "مشابه :c:type:`PyDictItems_Type` برای دیکشنری‌های مرتب است." msgid "Return a new empty ordered dictionary, or ``NULL`` on failure." -msgstr "" +msgstr "یک دیکشنری مرتب خالی جدید برمی‌گرداند، یا در صورت شکست ``NULL``." msgid "This is analogous to :c:func:`PyDict_New`." -msgstr "" +msgstr "این مشابه :c:func:`PyDict_New` است." -msgid "Insert *value* into the ordered dictionary *od* with a key of *key*. Return ``0`` on success or ``-1`` with an exception set on failure." +msgid "" +"Insert *value* into the ordered dictionary *od* with a key of *key*. Return " +"``0`` on success or ``-1`` with an exception set on failure." msgstr "" +"*value* را با کلید *key* در دیکشنری مرتب *od* درج می‌کند. در صورت موفقیت " +"``0`` و در صورت شکست ``-1`` همراه با تنظیم یک استثنا برمی‌گرداند." msgid "This is analogous to :c:func:`PyDict_SetItem`." -msgstr "" +msgstr "این مشابه :c:func:`PyDict_SetItem` است." -msgid "Remove the entry in the ordered dictionary *od* with key *key*. Return ``0`` on success or ``-1`` with an exception set on failure." +msgid "" +"Remove the entry in the ordered dictionary *od* with key *key*. Return ``0``" +" on success or ``-1`` with an exception set on failure." msgstr "" +"ورودی با کلید *key* را از دیکشنری مرتب *od* حذف می‌کند. در صورت موفقیت ``0``" +" و در صورت شکست ``-1`` همراه با تنظیم یک استثنا برمی‌گرداند." msgid "This is analogous to :c:func:`PyDict_DelItem`." -msgstr "" +msgstr "این مشابه :c:func:`PyDict_DelItem` است." msgid "These are :term:`soft deprecated` aliases to ``PyDict`` APIs:" msgstr "" +"این‌ها نام‌های مستعار :term:`soft deprecated` برای API‌های ``PyDict`` هستند:" msgid "``PyODict``" -msgstr "" +msgstr "``PyODict``" msgid "``PyDict``" -msgstr "" +msgstr "``PyDict``" msgid ":c:func:`PyDict_GetItem`" -msgstr "" +msgstr ":c:func:`PyDict_GetItem`" msgid ":c:func:`PyDict_GetItemWithError`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemWithError`" msgid ":c:func:`PyDict_GetItemString`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemString`" msgid ":c:func:`PyDict_Contains`" -msgstr "" +msgstr ":c:func:`PyDict_Contains`" msgid ":c:func:`PyDict_Size`" -msgstr "" +msgstr ":c:func:`PyDict_Size`" msgid ":c:func:`PyDict_GET_SIZE`" -msgstr "" +msgstr ":c:func:`PyDict_GET_SIZE`" msgid "object" -msgstr "" +msgstr "شیء" msgid "dictionary" -msgstr "" +msgstr "دیکشنری" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "len" -msgstr "" +msgstr "len" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 638e7b6d8..a3a3b1622 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"PO-Revision-Date: 2026-09-04 20:21+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,225 +23,668 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Exception Handling" -msgstr "" +msgstr "مدیریت استثنا" -msgid "The functions described in this chapter will let you handle and raise Python exceptions. It is important to understand some of the basics of Python exception handling. It works somewhat like the POSIX :c:data:`errno` variable: there is a global indicator (per thread) of the last error that occurred. Most C API functions don't clear this on success, but will set it to indicate the cause of the error on failure. Most C API functions also return an error indicator, usually ``NULL`` if they are supposed to return a pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` functions return ``1`` for success and ``0`` for failure)." -msgstr "" +msgid "" +"The functions described in this chapter will let you handle and raise Python" +" exceptions. It is important to understand some of the basics of Python " +"exception handling. It works somewhat like the POSIX :c:data:`errno` " +"variable: there is a global indicator (per thread) of the last error that " +"occurred. Most C API functions don't clear this on success, but will set it" +" to indicate the cause of the error on failure. Most C API functions also " +"return an error indicator, usually ``NULL`` if they are supposed to return a" +" pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` " +"functions return ``1`` for success and ``0`` for failure)." +msgstr "" +"توابعی که در این فصل توضیح داده شده‌اند به شما امکان می‌دهند تا استثناهای " +"پایتون را مدیریت و برپا کنید. درک برخی از مبانی مدیریت استثنا در پایتون " +"اهمیت دارد. این سازوکار تا حدی مانند متغیر :c:data:`errno` در POSIX کار " +"می‌کند: یک نشانگر سراسری (به ازای هر نخ) برای آخرین خطای رخ‌داده وجود دارد. " +"بیشتر توابع C API این نشانگر را در صورت موفقیت پاک نمی‌کنند، اما در صورت " +"شکست آن را برای نشان دادن علت خطا تنظیم می‌کنند. بیشتر توابع C API همچنین یک" +" نشانگر خطا برمی‌گردانند؛ معمولاً ``NULL`` اگر قرار باشد اشاره‌گر برگردانند،" +" یا ``-1`` اگر عدد صحیح برگردانند (استثنا: توابع ``PyArg_*`` برای موفقیت " +"``1`` و برای شکست ``0`` برمی‌گردانند)." -msgid "Concretely, the error indicator consists of three object pointers: the exception's type, the exception's value, and the traceback object. Any of those pointers can be ``NULL`` if non-set (although some combinations are forbidden, for example you can't have a non-``NULL`` traceback if the exception type is ``NULL``)." +msgid "" +"Concretely, the error indicator consists of three object pointers: the " +"exception's type, the exception's value, and the traceback object. Any of " +"those pointers can be ``NULL`` if non-set (although some combinations are " +"forbidden, for example you can't have a non-``NULL`` traceback if the " +"exception type is ``NULL``)." msgstr "" +"به‌طور مشخص، نشانگر خطا از سه اشاره‌گر شیء تشکیل شده است: نوع استثنا، مقدار " +"استثنا، و شیء ردگیری. هر یک از این اشاره‌گرها می‌تواند در صورت تنظیم‌نشده " +"بودن ``NULL`` باشد (هرچند برخی ترکیب‌ها ممنوع هستند؛ برای مثال، اگر نوع " +"استثنا ``NULL`` باشد، نمی‌توانید ردگیری‌ای داشته باشید که ``NULL`` نباشد)." -msgid "When a function must fail because some function it called failed, it generally doesn't set the error indicator; the function it called already set it. It is responsible for either handling the error and clearing the exception or returning after cleaning up any resources it holds (such as object references or memory allocations); it should *not* continue normally if it is not prepared to handle the error. If returning due to an error, it is important to indicate to the caller that an error has been set. If the error is not handled or carefully propagated, additional calls into the Python/C API may not behave as intended and may fail in mysterious ways." -msgstr "" +msgid "" +"When a function must fail because some function it called failed, it " +"generally doesn't set the error indicator; the function it called already " +"set it. It is responsible for either handling the error and clearing the " +"exception or returning after cleaning up any resources it holds (such as " +"object references or memory allocations); it should *not* continue normally " +"if it is not prepared to handle the error. If returning due to an error, it" +" is important to indicate to the caller that an error has been set. If the " +"error is not handled or carefully propagated, additional calls into the " +"Python/C API may not behave as intended and may fail in mysterious ways." +msgstr "" +"وقتی تابعی باید به این دلیل شکست بخورد که تابعی که آن را فراخوانی کرده شکست " +"خورده است، معمولاً نشانگر خطا را تنظیم نمی‌کند؛ تابع فراخوانی‌شده قبلاً آن " +"را تنظیم کرده است. مسئولیت این تابع است که یا خطا را مدیریت کند و استثنا را " +"پاک کند، یا پس از پاک‌سازی هر منبعی که در اختیار دارد (مانند ارجاع‌های شیء " +"یا تخصیص‌های حافظه) بازگشت کند؛ اگر برای مدیریت خطا آماده نباشد، *نباید* " +"به‌صورت عادی ادامه دهد. در صورت بازگشت به‌دلیل خطا، مهم است به فراخواننده " +"نشان داده شود که خطایی تنظیم شده است. اگر خطا مدیریت نشود یا به‌دقت بالا " +"برده نشود، ممکن است فراخوانی‌های بعدی در Python/C API آن‌گونه که در نظر " +"گرفته شده است رفتار نکنند و به شیوه‌های مرموز شکست بخورند." -msgid "The error indicator is **not** the result of :func:`sys.exc_info`. The former corresponds to an exception that is not yet caught (and is therefore still propagating), while the latter returns an exception after it is caught (and has therefore stopped propagating)." +msgid "" +"The error indicator is **not** the result of :func:`sys.exc_info`. The " +"former corresponds to an exception that is not yet caught (and is therefore " +"still propagating), while the latter returns an exception after it is caught" +" (and has therefore stopped propagating)." msgstr "" +"نشانگر خطا نتیجه‌ی :func:`sys.exc_info` **نیست**. اولی به استثنایی مربوط است" +" که هنوز گرفته‌نشده است (و بنابراین همچنان در حال انتشار است)، در حالی که " +"دومی استثنا را پس از گرفته‌شدن آن برمی‌گرداند (و بنابراین انتشار آن متوقف " +"شده است)." msgid "Printing and clearing" -msgstr "" +msgstr "چاپ و پاک کردن" -msgid "Clear the error indicator. If the error indicator is not set, there is no effect." +msgid "" +"Clear the error indicator. If the error indicator is not set, there is no " +"effect." msgstr "" +"نشانگر خطا را پاک می‌کند. اگر نشانگر خطا تنظیم نشده باشد، هیچ اثری ندارد." -msgid "Print a standard traceback to ``sys.stderr`` and clear the error indicator. **Unless** the error is a ``SystemExit``, in that case no traceback is printed and the Python process will exit with the error code specified by the ``SystemExit`` instance." +msgid "" +"Print a standard traceback to ``sys.stderr`` and clear the error indicator. " +"**Unless** the error is a ``SystemExit``, in that case no traceback is " +"printed and the Python process will exit with the error code specified by " +"the ``SystemExit`` instance." msgstr "" +"یک ردگیری استاندارد در ``sys.stderr`` چاپ می‌کند و نشانگر خطا را پاک می‌کند." +" **مگر اینکه** خطا یک ``SystemExit`` باشد، در این حالت هیچ ردگیری‌ای چاپ " +"نمی‌شود و فرایند پایتون با کد خطای تعیین‌شده توسط نمونه‌ی ``SystemExit`` " +"خارج خواهد شد." -msgid "Call this function **only** when the error indicator is set. Otherwise it will cause a fatal error!" +msgid "" +"Call this function **only** when the error indicator is set. Otherwise it " +"will cause a fatal error!" msgstr "" +"این تابع را **فقط** زمانی فراخوانی کنید که نشانگر خطا تنظیم شده باشد. در غیر" +" این صورت، باعث خطای مهلک خواهد شد!" -msgid "If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set to the printed exception. For backwards compatibility, the deprecated variables :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback` are also set to the type, value and traceback of this exception, respectively." +msgid "" +"If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set " +"to the printed exception. For backwards compatibility, the deprecated " +"variables :data:`sys.last_type`, :data:`sys.last_value` and " +":data:`sys.last_traceback` are also set to the type, value and traceback of " +"this exception, respectively." msgstr "" +"اگر *set_sys_last_vars* ناصفر باشد، متغیر :data:`sys.last_exc` به استثنای " +"چاپ‌شده تنظیم می‌شود. برای سازگاری با نسخه‌های پیشین، متغیرهای منسوخ " +":data:`sys.last_type`، :data:`sys.last_value` و :data:`sys.last_traceback` " +"نیز به ترتیب به نوع، مقدار و ردگیری این استثنا تنظیم می‌شوند." msgid "The setting of :data:`sys.last_exc` was added." -msgstr "" +msgstr "تنظیم :data:`sys.last_exc` اضافه شد." msgid "Alias for ``PyErr_PrintEx(1)``." -msgstr "" +msgstr "مستعار برای ``PyErr_PrintEx(1)``." -msgid "Call :func:`sys.unraisablehook` using the current exception and *obj* argument." +msgid "" +"Call :func:`sys.unraisablehook` using the current exception and *obj* " +"argument." msgstr "" +":func:`sys.unraisablehook` را با استفاده از استثنای فعلی و آرگومان *obj* " +"فراخوانی کنید." -msgid "This utility function prints a warning message to ``sys.stderr`` when an exception has been set but it is impossible for the interpreter to actually raise the exception. It is used, for example, when an exception occurs in an :meth:`~object.__del__` method." +msgid "" +"This utility function prints a warning message to ``sys.stderr`` when an " +"exception has been set but it is impossible for the interpreter to actually " +"raise the exception. It is used, for example, when an exception occurs in " +"an :meth:`~object.__del__` method." msgstr "" +"این تابع کاربردی زمانی که استثنایی تنظیم‌شده باشد اما برافکندن آن برای مفسر " +"واقعاً ممکن نباشد، یک پیام هشدار در ``sys.stderr`` چاپ می‌کند. این تابع برای" +" مثال زمانی استفاده می‌شود که استثنایی در متد :meth:`~object.__del__` رخ " +"دهد." -msgid "The function is called with a single argument *obj* that identifies the context in which the unraisable exception occurred. If possible, the repr of *obj* will be printed in the warning message. If *obj* is ``NULL``, only the traceback is printed." +msgid "" +"The function is called with a single argument *obj* that identifies the " +"context in which the unraisable exception occurred. If possible, the repr of" +" *obj* will be printed in the warning message. If *obj* is ``NULL``, only " +"the traceback is printed." msgstr "" +"این تابع با یک آرگومان واحد *obj* فراخوانی می‌شود که زمینه‌ی وقوع استثنای " +"غیرقابل‌صدور (unraisable exception) را شناسایی می‌کند. در صورت امکان، repr " +"مربوط به *obj* در پیام هشدار چاپ می‌شود. اگر *obj* برابر ``NULL`` باشد، فقط " +"ردگیری پشته چاپ می‌شود." msgid "An exception must be set when calling this function." -msgstr "" +msgstr "هنگام فراخوانی این تابع، باید یک استثنا تنظیم شده باشد." msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." msgstr "" +"یک ردگیری پشته چاپ می‌کند. اگر *obj* برابر ``NULL`` باشد، فقط ردگیری پشته را" +" چاپ می‌کند." msgid "Use :func:`sys.unraisablehook`." -msgstr "" +msgstr "از :func:`sys.unraisablehook` استفاده کنید." -msgid "Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent parameters help format the warning message; they have the same meaning and values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: %R\", obj)``. If *format* is ``NULL``, only the traceback is printed." -msgstr "" +msgid "" +"Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent " +"parameters help format the warning message; they have the same meaning and " +"values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` " +"is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: " +"%R\", obj)``. If *format* is ``NULL``, only the traceback is printed." +msgstr "" +"مشابه :c:func:`PyErr_WriteUnraisable` است، اما *format* و پارامترهای بعدی به" +" قالب‌بندی پیام هشدار کمک می‌کنند؛ معنا و مقادیر آن‌ها همانند " +":c:func:`PyUnicode_FromFormat` است. ``PyErr_WriteUnraisable(obj)`` تقریباً " +"معادل ``PyErr_FormatUnraisable(\"Exception ignored in: %R\", obj)`` است. اگر" +" *format* برابر ``NULL`` باشد، فقط ردگیری پشته چاپ می‌شود." -msgid "Print the standard traceback display of ``exc`` to ``sys.stderr``, including chained exceptions and notes." +msgid "" +"Print the standard traceback display of ``exc`` to ``sys.stderr``, including" +" chained exceptions and notes." msgstr "" +"نمایش استاندارد ردگیری ``exc`` را به‌همراه استثناهای زنجیره‌شده و یادداشت‌ها" +" در ``sys.stderr`` چاپ می‌کند." msgid "Legacy variant of :c:func:`PyErr_DisplayException`." -msgstr "" +msgstr "گونه‌ی قدیمیِ :c:func:`PyErr_DisplayException`." -msgid "Print the exception *value* with its traceback to :data:`sys.stderr`. If *value* has no traceback set, *tb* is used as its traceback. The first argument is ignored." +msgid "" +"Print the exception *value* with its traceback to :data:`sys.stderr`. If " +"*value* has no traceback set, *tb* is used as its traceback. The first " +"argument is ignored." msgstr "" +"مقدار استثنا *value* را همراه با ردگیری آن در :data:`sys.stderr` چاپ می‌کند." +" اگر برای *value* هیچ ردگیری‌ای تنظیم نشده باشد، از *tb* به‌عنوان ردگیری آن " +"استفاده می‌شود. آرگومان اول نادیده گرفته می‌شود." -msgid "If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr` is not set, the exception is dumped to the C ``stderr`` stream instead." +msgid "" +"If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr`" +" is not set, the exception is dumped to the C ``stderr`` stream instead." msgstr "" +"اگر :data:`sys.stderr` برابر ``None`` باشد، چیزی چاپ نمی‌شود. اگر " +":data:`sys.stderr` تنظیم نشده باشد، استثنا در عوض به جریان ``stderr`` زبان C" +" برون‌ریزی می‌شود." msgid "Use :c:func:`PyErr_DisplayException` instead." -msgstr "" +msgstr "به جای آن از :c:func:`PyErr_DisplayException` استفاده کنید." msgid "Raising exceptions" -msgstr "" +msgstr "برخاست دادن استثناها" -msgid "These functions help you set the current thread's error indicator. For convenience, some of these functions will always return a ``NULL`` pointer for use in a ``return`` statement." +msgid "" +"These functions help you set the current thread's error indicator. For " +"convenience, some of these functions will always return a ``NULL`` pointer " +"for use in a ``return`` statement." msgstr "" +"این توابع به شما کمک می‌کنند نشانگر خطای نخ جاری را تنظیم کنید. برای سهولت، " +"برخی از این توابع همیشه یک اشاره‌گر ``NULL`` برای استفاده در دستور " +"``return`` برمی‌گردانند." -msgid "This is the most common way to set the error indicator. The first argument specifies the exception type; it is normally one of the standard exceptions, e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an error message; it is decoded from ``'utf-8'``." -msgstr "" +msgid "" +"This is the most common way to set the error indicator. The first argument " +"specifies the exception type; it is normally one of the standard exceptions," +" e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong" +" reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an" +" error message; it is decoded from ``'utf-8'``." +msgstr "" +"این رایج‌ترین روش برای تنظیم نشانگر خطا است. آرگومان اول نوع استثنا را مشخص" +" می‌کند؛ این آرگومان معمولاً یکی از استثناهای استاندارد است، برای مثال " +":c:data:`PyExc_RuntimeError`. لازم نیست :term:`ارجاع قوی ` جدیدی به آن ایجاد کنید (مثلاً با :c:func:`Py_INCREF`). آرگومان " +"دوم یک پیام خطا است؛ این پیام از ``'utf-8'`` کدگشایی می‌شود." -msgid "This function is similar to :c:func:`PyErr_SetString` but lets you specify an arbitrary Python object for the \"value\" of the exception." +msgid "" +"This function is similar to :c:func:`PyErr_SetString` but lets you specify " +"an arbitrary Python object for the \"value\" of the exception." msgstr "" +"این تابع مشابه :c:func:`PyErr_SetString` است، اما به شما اجازه می‌دهد یک شیء" +" دلخواه پایتون را به‌عنوان «مقدار» استثنا مشخص کنید." -msgid "This function sets the error indicator and returns ``NULL``. *exception* should be a Python exception class. The *format* and subsequent parameters help format the error message; they have the same meaning and values as in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." +msgid "" +"This function sets the error indicator and returns ``NULL``. *exception* " +"should be a Python exception class. The *format* and subsequent parameters " +"help format the error message; they have the same meaning and values as in " +":c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" +"این تابع نشانگر خطا را تنظیم می‌کند و ``NULL`` را برمی‌گرداند. *exception* " +"باید یک کلاس استثنای پایتون باشد. *format* و پارامترهای بعدی به قالب‌بندی " +"پیام خطا کمک می‌کنند؛ معنا و مقادیر آن‌ها همانند " +":c:func:`PyUnicode_FromFormat` است. *format* یک رشته کدگذاری‌شده با اسکی " +"است." -msgid "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument rather than a variable number of arguments." +msgid "" +"Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " +"rather than a variable number of arguments." msgstr "" +"مانند :c:func:`PyErr_Format` است، اما به‌جای تعداد متغیری از آرگومان‌ها، یک " +"آرگومان :c:type:`va_list` می‌گیرد." msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." -msgstr "" +msgstr "این یک شکل مختصر برای ``PyErr_SetObject(type, Py_None)`` است." -msgid "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where *message* indicates that a built-in operation was invoked with an illegal argument. It is mostly for internal use." +msgid "" +"This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where" +" *message* indicates that a built-in operation was invoked with an illegal " +"argument. It is mostly for internal use." msgstr "" +"این شکل کوتاهی برای ``PyErr_SetString(PyExc_TypeError, message)`` است، که در" +" آن *message* نشان می‌دهد که یک عملیات توکار با آرگومانی غیرمجاز فراخوانی " +"شده است. این عمدتاً برای استفاده‌ی داخلی است." -msgid "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns ``NULL`` so an object allocation function can write ``return PyErr_NoMemory();`` when it runs out of memory." +msgid "" +"This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " +"``NULL`` so an object allocation function can write ``return " +"PyErr_NoMemory();`` when it runs out of memory." msgstr "" +"این شکل مختصری برای ``PyErr_SetNone(PyExc_MemoryError)`` است؛ این تابع " +"``NULL`` را برمی‌گرداند تا یک تابع تخصیص شیء بتواند هنگامی که حافظه‌اش تمام " +"می‌شود، ``return PyErr_NoMemory();`` بنویسد." -msgid "This is a convenience function to raise an exception when a C library function has returned an error and set the C variable :c:data:`errno`. It constructs a tuple object whose first item is the integer :c:data:`errno` value and whose second item is the corresponding error message (gotten from :c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator, leaves it set to that. The function always returns ``NULL``, so a wrapper function around a system call can write ``return PyErr_SetFromErrno(type);`` when the system call returns an error." -msgstr "" +msgid "" +"This is a convenience function to raise an exception when a C library " +"function has returned an error and set the C variable :c:data:`errno`. It " +"constructs a tuple object whose first item is the integer :c:data:`errno` " +"value and whose second item is the corresponding error message (gotten from " +":c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " +"Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an " +"interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " +"that set the error indicator, leaves it set to that. The function always " +"returns ``NULL``, so a wrapper function around a system call can write " +"``return PyErr_SetFromErrno(type);`` when the system call returns an error." +msgstr "" +"این تابع برای راحتی کار فراهم شده است تا در زمانی که یک تابع کتابخانه‌ی C " +"خطا برگردانده و متغیر C یعنی :c:data:`errno` را تنظیم کرده است، یک استثنا " +"برافرازد. این تابع یک شیء تاپل می‌سازد که آیتم نخست آن، مقدار عدد صحیح " +":c:data:`errno`، و آیتم دوم آن، پیام خطای مربوطه (گرفته‌شده از " +":c:func:`!strerror`) است، و سپس ``PyErr_SetObject(type, object)`` را " +"فراخوانی می‌کند. در یونیکس، هنگامی که مقدار :c:data:`errno` برابر " +":c:macro:`!EINTR` باشد (که نشان‌دهنده‌ی یک فراخوانی سیستمی مختل‌شده است)، " +"این تابع :c:func:`PyErr_CheckSignals` را فراخوانی می‌کند و اگر آن تابع " +"نشانگر خطا را تنظیم کرده باشد، آن را به همان صورت تنظیم‌شده باقی می‌گذارد. " +"این تابع همیشه ``NULL`` را برمی‌گرداند، بنابراین یک تابع پوششی حول یک " +"فراخوانی سیستمی می‌تواند هنگامی که فراخوانی سیستمی خطا برمی‌گرداند، ``return" +" PyErr_SetFromErrno(type);`` بنویسد." -msgid "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if *filenameObject* is not ``NULL``, it is passed to the constructor of *type* as a third parameter. In the case of :exc:`OSError` exception, this is used to define the :attr:`!filename` attribute of the exception instance." +msgid "" +"Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " +"if *filenameObject* is not ``NULL``, it is passed to the constructor of " +"*type* as a third parameter. In the case of :exc:`OSError` exception, this " +"is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" +"مشابه :c:func:`PyErr_SetFromErrno`، با این رفتار اضافی که اگر " +"*filenameObject* برابر ``NULL`` نباشد، به‌عنوان پارامتر سوم به سازنده‌ی " +"*type* پاس داده می‌شود. در مورد استثنای :exc:`OSError`، از این برای تعریف " +"ویژگی :attr:`!filename` نمونه‌ی استثنا استفاده می‌شود." -msgid "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a second filename object, for raising errors when a function that takes two filenames fails." +msgid "" +"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " +"second filename object, for raising errors when a function that takes two " +"filenames fails." msgstr "" +"مشابه :c:func:`PyErr_SetFromErrnoWithFilenameObject` است، اما یک شیء نام " +"پرونده‌ی دوم می‌گیرد تا هنگامی که تابعی که دو نام پرونده می‌گیرد شکست " +"می‌خورد، خطاها برافراشته شوند." -msgid "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename is given as a C string. *filename* is decoded from the :term:`filesystem encoding and error handler`." +msgid "" +"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " +"is given as a C string. *filename* is decoded from the :term:`filesystem " +"encoding and error handler`." msgstr "" +"مشابه :c:func:`PyErr_SetFromErrnoWithFilenameObject`، با این تفاوت که نام " +"پرونده به‌صورت یک رشته‌ی C داده می‌شود. *filename* با استفاده از " +":term:`filesystem encoding and error handler` کدگشایی می‌شود." -msgid "This is a convenience function to raise :exc:`OSError`. If called with *ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError` is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve the Windows description of error code given by *ierr* or :c:func:`!GetLastError`, then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror` attribute set to the error code, the :attr:`~OSError.strerror` attribute set to the corresponding error message (gotten from :c:func:`!FormatMessage`), and then calls ``PyErr_SetObject(PyExc_OSError, object)``. This function always returns ``NULL``." -msgstr "" +msgid "" +"This is a convenience function to raise :exc:`OSError`. If called with " +"*ierr* of ``0``, the error code returned by a call to " +":c:func:`!GetLastError` is used instead. It calls the Win32 function " +":c:func:`!FormatMessage` to retrieve the Windows description of error code " +"given by *ierr* or :c:func:`!GetLastError`, then it constructs a " +":exc:`OSError` object with the :attr:`~OSError.winerror` attribute set to " +"the error code, the :attr:`~OSError.strerror` attribute set to the " +"corresponding error message (gotten from :c:func:`!FormatMessage`), and then" +" calls ``PyErr_SetObject(PyExc_OSError, object)``. This function always " +"returns ``NULL``." +msgstr "" +"این یک تابع راحتی برای برافراختن :exc:`OSError` است. اگر با مقدار ``0`` برای" +" *ierr* فراخوانی شود، به‌جای آن از کد خطایی که فراخوانی " +":c:func:`!GetLastError` برمی‌گرداند استفاده می‌شود. این تابع برای بازیابی " +"توضیح ویندوز برای کد خطای داده‌شده توسط *ierr* یا :c:func:`!GetLastError`، " +"تابع Win32 یعنی :c:func:`!FormatMessage` را فراخوانی می‌کند؛ سپس یک شیء " +":exc:`OSError` می‌سازد که ویژگی :attr:`~OSError.winerror` آن روی کد خطا و " +"ویژگی :attr:`~OSError.strerror` آن روی پیام خطای متناظر (گرفته‌شده از " +":c:func:`!FormatMessage`) تنظیم شده‌اند، و سپس " +"``PyErr_SetObject(PyExc_OSError, object)`` را فراخوانی می‌کند. این تابع " +"همیشه ``NULL`` را برمی‌گرداند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter specifying the exception type to be raised." +msgid "" +"Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " +"specifying the exception type to be raised." msgstr "" +"مشابه :c:func:`PyErr_SetFromWindowsErr`، با یک پارامتر اضافی برای تعیین نوع " +"استثنایی که باید ایجاد شود." -msgid "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 "" +msgid "" +"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:func:`PyErr_SetFromWindowsErr`، با این رفتار افزوده که اگر " +"*filename* برابر ``NULL`` نباشد، بر اساس کدگذاری فایل‌سیستم " +"(:func:`os.fsdecode`) کدگشایی می‌شود و به‌عنوان پارامتر سوم به سازنده‌ی " +":exc:`OSError` ارسال می‌شود تا برای تعریف ویژگی :attr:`!filename` در نمونه‌ی" +" استثنا استفاده شود." -msgid "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." +msgid "" +"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:func:`PyErr_SetExcFromWindowsErr`، با این رفتار اضافی که اگر " +"*filename* برابر ``NULL`` نباشد، به‌عنوان پارامتر سوم به سازنده‌ی " +":exc:`OSError` پاس داده می‌شود تا برای تعریف ویژگی :attr:`!filename` در " +"نمونه‌ی استثنا استفاده شود." -msgid "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but accepts a second filename object." +msgid "" +"Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " +"accepts a second filename object." msgstr "" +"مشابه :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject` است، اما یک شیء" +" نام پرونده‌ی دوم را می‌پذیرد." -msgid "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional parameter specifying the exception type to be raised." +msgid "" +"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional" +" parameter specifying the exception type to be raised." msgstr "" +"مشابه :c:func:`PyErr_SetFromWindowsErrWithFilename`، با یک پارامتر اضافی " +"برای مشخص کردن نوع استثنایی که باید مطرح (raise) شود." -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 be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name`` and ``path`` attributes." +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 " +"be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name`` and" +" ``path`` attributes." msgstr "" +"این یک تابع راحتی برای ایجاد استثنای :exc:`ImportError` است. *msg* به‌عنوان " +"رشته‌ی پیام استثنا تنظیم می‌شود. *name* و *path*، که هر دو می‌توانند " +"``NULL`` باشند، به‌ترتیب به‌عنوان ویژگی‌های ``name`` و ``path`` مربوط به " +":exc:`ImportError` تنظیم می‌شوند." -msgid "Much like :c:func:`PyErr_SetImportError` but this function allows for specifying a subclass of :exc:`ImportError` to raise." +msgid "" +"Much like :c:func:`PyErr_SetImportError` but this function allows for " +"specifying a subclass of :exc:`ImportError` to raise." msgstr "" +"بسیار شبیه :c:func:`PyErr_SetImportError` است، اما این تابع به شما امکان " +"می‌دهد زیرکلاسی از :exc:`ImportError` را برای برافکندن مشخص کنید." -msgid "Set file, line, and offset information for the current exception. If the current exception is not a :exc:`SyntaxError`, then it sets additional attributes, which make the exception printing subsystem think the exception is a :exc:`SyntaxError`." +msgid "" +"Set file, line, and offset information for the current exception. If the " +"current exception is not a :exc:`SyntaxError`, then it sets additional " +"attributes, which make the exception printing subsystem think the exception " +"is a :exc:`SyntaxError`." msgstr "" +"اطلاعات پرونده، سطر و آفست را برای استثنای کنونی تنظیم می‌کند. اگر استثنای " +"کنونی :exc:`SyntaxError` نباشد، ویژگی‌های اضافی تنظیم می‌کند که باعث می‌شوند" +" زیرسیستم چاپ استثنا، استثنا را یک :exc:`SyntaxError` تلقی کند." -msgid "Similar to :c:func:`PyErr_SyntaxLocationObject`, but also sets the *end_lineno* and *end_col_offset* information for the current exception." +msgid "" +"Similar to :c:func:`PyErr_SyntaxLocationObject`, but also sets the " +"*end_lineno* and *end_col_offset* information for the current exception." msgstr "" +"مشابه :c:func:`PyErr_SyntaxLocationObject`، اما اطلاعات *end_lineno* و " +"*end_col_offset* را نیز برای استثنای فعلی تنظیم می‌کند." -msgid "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string decoded from the :term:`filesystem encoding and error handler`." +msgid "" +"Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " +"decoded from the :term:`filesystem encoding and error handler`." msgstr "" +"مانند :c:func:`PyErr_SyntaxLocationObject`، اما *filename* یک رشته بایتی است" +" که با :term:`filesystem encoding and error handler` کدگشایی‌شده است." -msgid "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is omitted." +msgid "" +"Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " +"omitted." msgstr "" +"مانند :c:func:`PyErr_SyntaxLocationEx`، اما پارامتر *col_offset* حذف شده " +"است." -msgid "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, where *message* indicates that an internal operation (e.g. a Python/C API function) was invoked with an illegal argument. It is mostly for internal use." +msgid "" +"This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " +"where *message* indicates that an internal operation (e.g. a Python/C API " +"function) was invoked with an illegal argument. It is mostly for internal " +"use." msgstr "" +"این یک شکل مختصر برای ``PyErr_SetString(PyExc_SystemError, message)`` است، " +"که در آن *message* نشان می‌دهد که یک عملیات داخلی (مثلاً یک تابع Python/C " +"API) با آرگومانی نامعتبر فراخوانی شده است. این عمدتاً برای استفاده داخلی " +"است." -msgid "Get the source line in *filename* at line *lineno*. *filename* should be a Python :class:`str` object." +msgid "" +"Get the source line in *filename* at line *lineno*. *filename* should be a " +"Python :class:`str` object." msgstr "" +"گرفتن سطر منبع از *filename* در سطر *lineno*. *filename* باید یک شیء " +":class:`str` پایتون باشد." -msgid "On success, this function returns a Python string object with the found line. On failure, this function returns ``NULL`` without an exception set." +msgid "" +"On success, this function returns a Python string object with the found " +"line. On failure, this function returns ``NULL`` without an exception set." msgstr "" +"در صورت موفقیت، این تابع یک شیء رشته پایتون حاوی سطر یافت‌شده را " +"برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را بدون تنظیم استثنا " +"برمی‌گرداند." -msgid "Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a :c:expr:`const char *`, which is decoded with the :term:`filesystem encoding and error handler`, instead of a Python object reference." +msgid "" +"Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a " +":c:expr:`const char *`, which is decoded with the :term:`filesystem encoding" +" and error handler`, instead of a Python object reference." msgstr "" +"مشابه :c:func:`PyErr_ProgramTextObject`، اما *filename* به‌جای ارجاع به شیء " +"پایتون، یک :c:expr:`const char *` است که با :term:`filesystem encoding and " +"error handler` کدگشایی می‌شود." msgid "Issuing warnings" -msgstr "" +msgstr "صدور هشدارها" -msgid "Use these functions to issue warnings from C code. They mirror similar functions exported by the Python :mod:`warnings` module. They normally print a warning message to *sys.stderr*; however, it is also possible that the user has specified that warnings are to be turned into errors, and in that case they will raise an exception. It is also possible that the functions raise an exception because of a problem with the warning machinery. The return value is ``0`` if no exception is raised, or ``-1`` if an exception is raised. (It is not possible to determine whether a warning message is actually printed, nor what the reason is for the exception; this is intentional.) If an exception is raised, the caller should do its normal exception handling (for example, :c:func:`Py_DECREF` owned references and return an error value)." -msgstr "" +msgid "" +"Use these functions to issue warnings from C code. They mirror similar " +"functions exported by the Python :mod:`warnings` module. They normally " +"print a warning message to *sys.stderr*; however, it is also possible that " +"the user has specified that warnings are to be turned into errors, and in " +"that case they will raise an exception. It is also possible that the " +"functions raise an exception because of a problem with the warning " +"machinery. The return value is ``0`` if no exception is raised, or ``-1`` if" +" an exception is raised. (It is not possible to determine whether a warning" +" message is actually printed, nor what the reason is for the exception; this" +" is intentional.) If an exception is raised, the caller should do its " +"normal exception handling (for example, :c:func:`Py_DECREF` owned references" +" and return an error value)." +msgstr "" +"از این توابع برای صدور هشدار از کد C استفاده کنید. این توابع قرینه‌ی توابع " +"مشابهی هستند که ماژول :mod:`warnings` پایتون صادر می‌کند. این توابع معمولاً " +"یک پیام هشدار را در *sys.stderr* چاپ می‌کنند؛ با این حال، این امکان نیز وجود" +" دارد که کاربر تعیین کرده باشد که هشدارها به خطا تبدیل شوند، و در این حالت " +"این توابع یک استثنا ایجاد می‌کنند. همچنین این امکان وجود دارد که توابع به " +"دلیل مشکلی در سازوکار هشدار، استثنا ایجاد کنند. مقدار بازگشتی ``0`` است اگر " +"استثنایی ایجاد نشود، یا ``-1`` اگر استثنایی ایجاد شود. (امکان تعیین اینکه " +"آیا پیام هشدار واقعاً چاپ می‌شود یا اینکه دلیل استثنا چیست وجود ندارد؛ این " +"موضوع عمدی است.) اگر استثنایی ایجاد شود، فراخواننده باید مدیریت استثنای " +"معمول خود را انجام دهد (برای مثال، فراخوانی :c:func:`Py_DECREF` روی " +"ارجاع‌های در مالکیت و برگرداندن یک مقدار خطا)." -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. *stack_level* is a positive number giving a number of stack frames; the warning will be issued from the currently executing line of code in that stack frame. A *stack_level* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that, and so forth." -msgstr "" +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. " +"*stack_level* is a positive number giving a number of stack frames; the " +"warning will be issued from the currently executing line of code in that " +"stack frame. A *stack_level* of 1 is the function calling " +":c:func:`PyErr_WarnEx`, 2 is the function above that, and so forth." +msgstr "" +"یک پیام هشدار صادر می‌کند. آرگومان *category* یک دسته‌ی هشدار است (در ادامه " +"مراجعه کنید) یا ``NULL``؛ آرگومان *message* یک رشته‌ی کدگذاری‌شده با UTF-8 " +"است. *stack_level* یک عدد مثبت است که تعداد قاب‌های پشته را مشخص می‌کند؛ " +"هشدار از سطر کدِ در حال اجرا در آن قاب پشته صادر خواهد شد. *stack_level* " +"برابر ۱ تابعی است که :c:func:`PyErr_WarnEx` را فراخوانی می‌کند، ۲ تابع " +"بالاتر از آن است، و به همین ترتیب." -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 warning category is :c:data:`PyExc_RuntimeWarning`. The standard Python warning categories are available as global variables whose names are enumerated at :ref:`standardwarningcategories`." -msgstr "" +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 warning category is :c:data:`PyExc_RuntimeWarning`. The standard " +"Python warning categories are available as global variables whose names are " +"enumerated at :ref:`standardwarningcategories`." +msgstr "" +"دسته‌های هشدار باید زیرکلاس‌هایی از :c:data:`PyExc_Warning` باشند؛ " +":c:data:`PyExc_Warning` زیرکلاسی از :c:data:`PyExc_Exception` است؛ دسته‌ی " +"پیش‌فرض هشدار، :c:data:`PyExc_RuntimeWarning` است. دسته‌های هشدار استاندارد " +"پایتون به‌صورت متغیرهای سراسری در دسترس هستند که نام‌های آن‌ها در " +":ref:`standardwarningcategories` فهرست شده است." -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." +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 "" +"برای کسب اطلاعات درباره‌ی کنترل هشدارها، به مستندات ماژول :mod:`warnings` و " +"گزینه‌ی :option:`-W` در مستندات خط فرمان مراجعه کنید. برای کنترل هشدارها API" +" زبان C وجود ندارد." -msgid "Issue a warning message with explicit control over all warning attributes. This is a straightforward wrapper around the Python function :func:`warnings.warn_explicit`; see there for more information. The *module* and *registry* arguments may be set to ``NULL`` to get the default effect described there." +msgid "" +"Issue a warning message with explicit control over all warning attributes. " +"This is a straightforward wrapper around the Python function " +":func:`warnings.warn_explicit`; see there for more information. The " +"*module* and *registry* arguments may be set to ``NULL`` to get the default " +"effect described there." msgstr "" +"یک پیام هشدار با کنترل صریح بر تمام ویژگی‌های هشدار صادر می‌کند. این پوششی " +"ساده در اطراف تابع پایتونی :func:`warnings.warn_explicit` است؛ برای اطلاعات " +"بیشتر به آنجا مراجعه کنید. آرگومان‌های *module* و *registry* می‌توانند روی " +"``NULL`` تنظیم شوند تا اثر پیش‌فرضِ توصیف‌شده در آنجا به دست آید." -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`." +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:func:`PyErr_WarnExplicitObject` است، با این تفاوت که *message* و " +"*module* رشته‌های کدگذاری‌شده با UTF-8 هستند و *filename* از " +":term:`filesystem encoding and error handler` کدگشایی می‌شود." -msgid "Function similar to :c:func:`PyErr_WarnEx`, but uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-encoded string." +msgid "" +"Function similar to :c:func:`PyErr_WarnEx`, but uses " +":c:func:`PyUnicode_FromFormat` to format the warning message. *format* is " +"an ASCII-encoded string." msgstr "" +"تابعی مشابه :c:func:`PyErr_WarnEx` است، اما از " +":c:func:`PyUnicode_FromFormat` برای قالب‌بندی پیام هشدار استفاده می‌کند. " +"*format* یک رشته کدگذاری‌شده با اسکی است." -msgid "Similar to :c:func:`PyErr_WarnExplicit`, but uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-encoded string." +msgid "" +"Similar to :c:func:`PyErr_WarnExplicit`, but uses " +":c:func:`PyUnicode_FromFormat` to format the warning message. *format* is an" +" ASCII-encoded string." msgstr "" +"مشابه :c:func:`PyErr_WarnExplicit`، اما برای قالب‌بندی پیام هشدار از " +":c:func:`PyUnicode_FromFormat` استفاده می‌کند. *format* یک رشته کدگذاری‌شده " +"با اسکی است." -msgid "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:`ResourceWarning` and it passes *source* to :class:`!warnings.WarningMessage`." +msgid "" +"Function similar to :c:func:`PyErr_WarnFormat`, but *category* is " +":exc:`ResourceWarning` and it passes *source* to " +":class:`!warnings.WarningMessage`." msgstr "" +"تابعی مشابه :c:func:`PyErr_WarnFormat`، اما *category* برابر " +":exc:`ResourceWarning` است و *source* را به " +":class:`!warnings.WarningMessage` پاس می‌دهد." msgid "Querying the error indicator" -msgstr "" +msgstr "پرس‌وجو از نشانگر خطا" -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*`` functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You do not own a reference to the return value, so you do not need to :c:func:`Py_DECREF` it." -msgstr "" +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*`` " +"functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You" +" do not own a reference to the return value, so you do not need to " +":c:func:`Py_DECREF` it." +msgstr "" +"بررسی می‌کند که آیا نشانگر خطا تنظیم شده است. اگر تنظیم شده باشد، *نوع* " +"استثنا را برمی‌گرداند (آرگومان اول آخرین فراخوانی یکی از توابع " +"``PyErr_Set*`` یا :c:func:`PyErr_Restore`). اگر تنظیم نشده باشد، ``NULL`` را" +" برمی‌گرداند. شما مالک ارجاع به مقدار بازگشتی نیستید، بنابراین نیازی به " +":c:func:`Py_DECREF` کردن آن ندارید." msgid "The caller must have an :term:`attached thread state`." -msgstr "" +msgstr "فراخواننده باید :term:`attached thread state` داشته باشد." -msgid "Do not compare the return value to a specific exception; use :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily fail since the exception may be an instance instead of a class, in the case of a class exception, or it may be a subclass of the expected exception.)" -msgstr "" +msgid "" +"Do not compare the return value to a specific exception; use " +":c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison " +"could easily fail since the exception may be an instance instead of a class," +" in the case of a class exception, or it may be a subclass of the expected " +"exception.)" +msgstr "" +"مقدار بازگشتی را با یک استثنای مشخص مقایسه نکنید؛ در عوض از " +":c:func:`PyErr_ExceptionMatches` استفاده کنید که در ادامه نشان داده شده است." +" (این مقایسه به‌راحتی می‌تواند شکست بخورد، زیرا در مورد استثنای کلاسی، " +"استثنا ممکن است به جای کلاس، نمونه‌ای باشد، یا ممکن است زیرکلاسی از استثنای " +"مورد انتظار باشد.)" -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." +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 "" +"معادل ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)`` است. این باید " +"تنها زمانی فراخوانی شود که استثنا واقعاً تنظیم شده باشد؛ اگر هیچ استثنایی " +"ایجاد نشده باشد، نقض دسترسی به حافظه (memory access violation) رخ خواهد داد." -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 instance of a subclass. If *exc* is a tuple, all exception types in the tuple (and recursively in subtuples) are searched for a match." +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 " +"instance of a subclass. If *exc* is a tuple, all exception types in the " +"tuple (and recursively in subtuples) are searched for a match." msgstr "" +"اگر استثنای *given* با نوع استثنا در *exc* مطابقت داشته باشد، مقدار true " +"بازگردانده می‌شود. اگر *exc* یک شیء کلاس باشد، در صورتی که *given* نمونه‌ای " +"از یک زیرکلاس باشد نیز مقدار true بازگردانده می‌شود. اگر *exc* یک تاپل باشد،" +" تمام انواع استثنا در تاپل (و به‌صورت بازگشتی در زیرتاپل‌ها) برای یافتن " +"تطبیق جستجو می‌شوند." -msgid "Return the exception currently being raised, clearing the error indicator at the same time. Return ``NULL`` if the error indicator is not set." +msgid "" +"Return the exception currently being raised, clearing the error indicator at" +" the same time. Return ``NULL`` if the error indicator is not set." msgstr "" +"استثنایی که هم‌اکنون در حال raise شدن است را برمی‌گرداند و همزمان نشانگر خطا" +" را پاک می‌کند. اگر نشانگر خطا تنظیم نشده باشد، ``NULL`` را برمی‌گرداند." -msgid "This function is used by code that needs to catch exceptions, or code that needs to save and restore the error indicator temporarily." +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 "" +"این تابع توسط کدهایی استفاده می‌شود که نیاز به گرفتن استثناها دارند، یا " +"کدهایی که نیاز دارند نشانگر خطا را به‌طور موقت ذخیره و بازیابی کنند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "{\n" @@ -252,27 +695,58 @@ msgid "" " PyErr_SetRaisedException(exc);\n" "}" msgstr "" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_SetRaisedException(exc);\n" +"}" -msgid ":c:func:`PyErr_GetHandledException`, to save the exception currently being handled." +msgid "" +":c:func:`PyErr_GetHandledException`, to save the exception currently being " +"handled." msgstr "" +":c:func:`PyErr_GetHandledException`، برای ذخیره‌ی استثنایی که در حال حاضر " +"مدیریت می‌شود." -msgid "Set *exc* as the exception currently being raised, clearing the existing exception if one is set. If *exc* is ``NULL``, just clear the existing exception." +msgid "" +"Set *exc* as the exception currently being raised, clearing the existing " +"exception if one is set. If *exc* is ``NULL``, just clear the existing " +"exception." msgstr "" +"*exc* را به عنوان استثنای در حال رخ دادن تنظیم می‌کند و اگر استثنایی از قبل " +"تنظیم شده باشد، آن را پاک می‌کند. اگر *exc* برابر ``NULL`` باشد، تنها " +"استثنای موجود پاک می‌شود." msgid "*exc* must be a valid exception or ``NULL``." -msgstr "" +msgstr "*exc* باید یک استثنای معتبر یا ``NULL`` باشد." msgid "This call \":term:`steals `\" a reference to *exc*." -msgstr "" +msgstr "این فراخوانی ارجاعی به *exc* را «:term:`می‌دزدد `»." msgid "Use :c:func:`PyErr_GetRaisedException` instead." -msgstr "" +msgstr "به جای آن از :c:func:`PyErr_GetRaisedException` استفاده کنید." -msgid "Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, set all three variables to ``NULL``. If it is set, it will be cleared and you own a reference to each object retrieved. The value and traceback object may be ``NULL`` even when the type object is not." -msgstr "" +msgid "" +"Retrieve the error indicator into three variables whose addresses are " +"passed. If the error indicator is not set, set all three variables to " +"``NULL``. If it is set, it will be cleared and you own a reference to each " +"object retrieved. The value and traceback object may be ``NULL`` even when " +"the type object is not." +msgstr "" +"نشانگر خطا را در سه متغیر که آدرس آن‌ها ارسال شده است، بازیابی کنید. اگر " +"نشانگر خطا فعال نباشد، هر سه متغیر را روی ``NULL`` تنظیم کنید. اگر فعال " +"باشد، پاک می‌شود و شما مالک یک ارجاع به هر یک از اشیای بازیابی‌شده خواهید " +"بود. شیء مقدار و شیء ردیابی پشته ممکن است حتی زمانی که شیء نوع NULL " +"نیست، ``NULL`` باشند." -msgid "This function is normally only used by legacy code that needs to catch exceptions or save and restore the error indicator temporarily." +msgid "" +"This function is normally only used by legacy code that needs to catch " +"exceptions or save and restore the error indicator temporarily." msgstr "" +"این تابع معمولاً تنها توسط کدهای قدیمی‌ای استفاده می‌شود که نیاز دارند " +"استثناها را بگیرند یا نشانگر خطا را به‌طور موقت ذخیره و بازیابی کنند." msgid "" "{\n" @@ -284,582 +758,1077 @@ msgid "" " PyErr_Restore(type, value, traceback);\n" "}" msgstr "" +"{\n" +" PyObject *type, *value, *traceback;\n" +" PyErr_Fetch(&type, &value, &traceback);\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_Restore(type, value, traceback);\n" +"}" msgid "Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" +msgstr "به‌جای آن از :c:func:`PyErr_SetRaisedException` استفاده کنید." -msgid "Set the error indicator from the three objects, *type*, *value*, and *traceback*, clearing the existing exception if one is set. If the objects are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or traceback. The exception type should be a class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to each object before the call and after the call you no longer own these references. (If you don't understand this, don't use this function. I warned you.)" -msgstr "" +msgid "" +"Set the error indicator from the three objects, *type*, *value*, and " +"*traceback*, clearing the existing exception if one is set. If the objects " +"are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type " +"and non-``NULL`` value or traceback. The exception type should be a class." +" Do not pass an invalid exception type or value. (Violating these rules " +"will cause subtle problems later.) This call takes away a reference to each" +" object: you must own a reference to each object before the call and after " +"the call you no longer own these references. (If you don't understand this," +" don't use this function. I warned you.)" +msgstr "" +"نشانگر خطا را از سه شیء *type*، *value* و *traceback* تنظیم می‌کند و اگر " +"استثنایی از پیش تنظیم شده باشد، استثنای موجود را پاک می‌کند. اگر این اشیاء " +"``NULL`` باشند، نشانگر خطا پاک می‌شود. نوع ``NULL`` را همراه با مقدار یا " +"ردگیری غیر ``NULL`` ارسال نکنید. نوع استثنا باید یک کلاس باشد. نوع یا مقدار " +"نامعتبر برای استثنا ارسال نکنید. (نقض این قواعد بعداً موجب مشکلات ظریفی " +"خواهد شد.) این فراخوانی یک ارجاع به هر شیء را برمی‌دارد: شما باید پیش از " +"فراخوانی مالک ارجاعی به هر شیء باشید و پس از فراخوانی، دیگر مالک این " +"ارجاع‌ها نخواهید بود. (اگر این را نمی‌فهمید، از این تابع استفاده نکنید. من " +"به شما هشدار دادم.)" -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." +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:func:`PyErr_Fetch` استفاده کنید." -msgid "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-normalization." +msgid "" +"Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" +"normalization." msgstr "" +"به جای آن از :c:func:`PyErr_GetRaisedException` استفاده کنید تا از هرگونه " +"نرمال‌زدایی (de-normalization) احتمالی جلوگیری شود." -msgid "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below can be \"unnormalized\", meaning that ``*exc`` is a class object but ``*val`` is not an instance of the same class. This function can be used to instantiate the class in that case. If the values are already normalized, nothing happens. The delayed normalization is implemented to improve performance." -msgstr "" +msgid "" +"Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " +"below can be \"unnormalized\", meaning that ``*exc`` is a class object but " +"``*val`` is not an instance of the same class. This function can be used " +"to instantiate the class in that case. If the values are already " +"normalized, nothing happens. The delayed normalization is implemented to " +"improve performance." +msgstr "" +"در شرایط خاص، مقادیری که :c:func:`PyErr_Fetch` در ادامه بازمی‌گرداند " +"می‌توانند «نرمال‌نشده» باشند؛ یعنی ``*exc`` یک شیء کلاس است اما ``*val`` " +"نمونه‌ای از همان کلاس نیست. در این حالت می‌توان از این تابع برای نمونه‌سازی " +"کردن کلاس استفاده کرد. اگر مقادیر از قبل نرمال شده باشند، هیچ اتفاقی " +"نمی‌افتد. نرمال‌سازی معوق برای بهبود کارایی پیاده‌سازی شده است." -msgid "This function *does not* implicitly set the :attr:`~BaseException.__traceback__` attribute on the exception value. If setting the traceback appropriately is desired, the following additional snippet is needed::" +msgid "" +"This function *does not* implicitly set the " +":attr:`~BaseException.__traceback__` attribute on the exception value. If " +"setting the traceback appropriately is desired, the following additional " +"snippet is needed::" msgstr "" +"این تابع ویژگی :attr:`~BaseException.__traceback__` را به‌صورت ضمنی روی " +"مقدار استثنا *تنظیم نمی‌کند*. اگر مایلید ردگیری به‌نحو مناسب تنظیم شود، " +"قطعه‌کد اضافی زیر لازم است::" msgid "" "if (tb != NULL) {\n" " PyException_SetTraceback(val, tb);\n" "}" msgstr "" +"if (tb != NULL) {\n" +" PyException_SetTraceback(val, tb);\n" +"}" -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 exception that was freshly raised. Returns a new reference to the exception or ``NULL``. Does not modify the interpreter's exception state." +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 exception that was freshly raised. Returns a new " +"reference to the exception or ``NULL``. Does not modify the interpreter's " +"exception state." msgstr "" +"نمونه‌ی استثنای فعال را بازیابی می‌کند؛ همان چیزی که :func:`sys.exception` " +"برمی‌گرداند. این به استثنایی اشاره دارد که *از قبل گرفته‌شده* است، نه به " +"استثنایی که به‌تازگی ایجاد (raise) شده است. یک ارجاع جدید به استثنا یا " +"``NULL`` برمی‌گرداند. وضعیت استثنای مفسر را تغییر نمی‌دهد." -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 state temporarily. Use :c:func:`PyErr_SetHandledException` to restore or clear the exception state." +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 " +"state temporarily. Use :c:func:`PyErr_SetHandledException` to restore or " +"clear the exception state." msgstr "" +"این تابع به‌طور معمول توسط کدهایی که می‌خواهند استثناها را مدیریت کنند " +"استفاده نمی‌شود؛ بلکه می‌توان از آن در مواردی استفاده کرد که کد نیاز دارد " +"وضعیت استثنا را به‌طور موقت ذخیره و بازیابی کند. برای بازیابی یا پاک کردن " +"وضعیت استثنا از :c:func:`PyErr_SetHandledException` استفاده کنید." -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``." +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 "" +"استثنای فعال را، همان‌طور که از ``sys.exception()`` شناخته می‌شود، تنظیم " +"کنید. این به استثنایی اشاره دارد که *از قبل گرفته‌شده* است، نه به استثنایی " +"که به‌تازگی ایجاد (raised) شده است. برای پاک کردن وضعیت استثنا، ``NULL`` را " +"ارسال کنید." -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 state temporarily. Use :c:func:`PyErr_GetHandledException` to get the exception state." +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 " +"state temporarily. Use :c:func:`PyErr_GetHandledException` to get the " +"exception state." msgstr "" +"این تابع معمولاً توسط کدی که می‌خواهد استثناها را مدیریت کند استفاده " +"نمی‌شود؛ بلکه زمانی به کار می‌رود که کد نیاز داشته باشد وضعیت استثنا را " +"به‌طور موقت ذخیره و بازیابی کند. برای دریافت وضعیت استثنا از " +":c:func:`PyErr_GetHandledException` استفاده کنید." -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*, not to an exception that was freshly raised. Returns new references for the three objects, any of which may be ``NULL``. Does not modify the exception info state. This function is kept for backwards compatibility. Prefer using :c:func:`PyErr_GetHandledException`." -msgstr "" +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*, not to an exception that was freshly raised. Returns new " +"references for the three objects, any of which may be ``NULL``. Does not " +"modify the exception info state. This function is kept for backwards " +"compatibility. Prefer using :c:func:`PyErr_GetHandledException`." +msgstr "" +"بازنمایی قدیمی اطلاعات استثنا را، همان‌گونه که از :func:`sys.exc_info` " +"شناخته می‌شود، بازیابی می‌کند. این به استثنایی اشاره دارد که *از پیش گرفته " +"شده* است، نه به استثنایی که به‌تازگی مطرح (raise) شده است. ارجاع‌های جدیدی " +"برای سه شیء برمی‌گرداند که هر یک ممکن است ``NULL`` باشد. وضعیت اطلاعات " +"استثنا را تغییر نمی‌دهد. این تابع برای سازگاری با نسخه‌های پیشین نگه داشته " +"شده است. ترجیحاً از :c:func:`PyErr_GetHandledException` استفاده کنید." -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 state temporarily. Use :c:func:`PyErr_SetExcInfo` to restore or clear the exception state." +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 " +"state temporarily. Use :c:func:`PyErr_SetExcInfo` to restore or clear the " +"exception state." msgstr "" +"این تابع معمولاً توسط کدهایی که می‌خواهند استثناها را مدیریت کنند استفاده " +"نمی‌شود. بلکه می‌توان از آن در مواردی استفاده کرد که کد نیاز دارد وضعیت " +"استثنا را به‌طور موقت ذخیره و بازیابی کند. برای بازیابی یا پاک کردن وضعیت " +"استثنا از :c:func:`PyErr_SetExcInfo` استفاده کنید." -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 raised. This function \":term:`steals `\" the references of the arguments. To clear the exception state, pass ``NULL`` for all three arguments. This function is kept for backwards compatibility. Prefer using :c:func:`PyErr_SetHandledException`." -msgstr "" +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 " +"raised. This function \":term:`steals `\" the references of the " +"arguments. To clear the exception state, pass ``NULL`` for all three " +"arguments. This function is kept for backwards compatibility. Prefer using " +":c:func:`PyErr_SetHandledException`." +msgstr "" +"اطلاعات استثنا را همان‌طور که از ``sys.exc_info()`` شناخته می‌شود تنظیم " +"می‌کند. این به استثنایی اشاره دارد که *قبلاً گرفته‌شده* است، نه به استثنایی " +"که به‌تازگی ایجاد (raise) شده است. این تابع ارجاع‌های آرگومان‌ها را " +"«:term:`می‌دزدد `». برای پاک کردن وضعیت استثنا، ``NULL`` را برای هر " +"سه آرگومان ارسال کنید. این تابع برای سازگاری با نسخه‌های پیشین نگه داشته شده" +" است. ترجیحاً از :c:func:`PyErr_SetHandledException` استفاده کنید." -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 state temporarily. Use :c:func:`PyErr_GetExcInfo` to read the exception state." +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 " +"state temporarily. Use :c:func:`PyErr_GetExcInfo` to read the exception " +"state." msgstr "" +"این تابع به‌طور معمول توسط کدی که می‌خواهد استثناها را مدیریت کند، استفاده " +"نمی‌شود. بلکه، زمانی که کد نیاز دارد وضعیت استثنا را به‌طور موقت ذخیره و " +"بازیابی کند، می‌توان از آن استفاده کرد. برای خواندن وضعیت استثنا از " +":c:func:`PyErr_GetExcInfo` استفاده کنید." -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 \":term:`steals `\" references of all three arguments." +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 \":term:`steals `\" references of all " +"three arguments." msgstr "" +"آرگومان‌های ``type`` و ``traceback`` دیگر استفاده نمی‌شوند و می‌توانند NULL " +"باشند. مفسر اکنون آن‌ها را از نمونه‌ی استثنا (آرگومان ``value``) استخراج " +"می‌کند. این تابع همچنان ارجاع‌های هر سه آرگومان را «:term:`می‌دزدد " +"`»." msgid "Signal Handling" -msgstr "" +msgstr "مدیریت سیگنال" -msgid "Handle external interruptions, such as signals or activating a debugger, whose processing has been delayed until it is safe to run Python code and/or raise exceptions." +msgid "" +"Handle external interruptions, such as signals or activating a debugger, " +"whose processing has been delayed until it is safe to run Python code and/or" +" raise exceptions." msgstr "" +"رسیدگی می‌کند به وقفه‌های خارجی، مانند سیگنال‌ها یا فعال‌سازی اشکال‌زدا، که " +"پردازش آن‌ها به تعویق افتاده است تا زمانی که اجرای کد پایتون و/یا برافراختن " +"استثناها ایمن باشد." -msgid "For example, pressing :kbd:`Ctrl-C` causes a terminal to send the :py:data:`signal.SIGINT` signal. This function executes the corresponding Python signal handler, which, by default, raises the :exc:`KeyboardInterrupt` exception." +msgid "" +"For example, pressing :kbd:`Ctrl-C` causes a terminal to send the " +":py:data:`signal.SIGINT` signal. This function executes the corresponding " +"Python signal handler, which, by default, raises the " +":exc:`KeyboardInterrupt` exception." msgstr "" +"برای مثال، فشردن :kbd:`Ctrl-C` باعث می‌شود یک ترمینال سیگنال " +":py:data:`signal.SIGINT` را ارسال کند. این تابع هندلر سیگنال متناظر در " +"پایتون را اجرا می‌کند که به‌طور پیش‌فرض استثنای :exc:`KeyboardInterrupt` را " +"ایجاد می‌کند." -msgid ":c:func:`!PyErr_CheckSignals` should be called by long-running C code frequently enough so that the response appears immediate to humans." +msgid "" +":c:func:`!PyErr_CheckSignals` should be called by long-running C code " +"frequently enough so that the response appears immediate to humans." msgstr "" +":c:func:`!PyErr_CheckSignals` باید توسط کد C طولانی‌مدت به‌اندازه‌ای مکرر " +"فراخوانی شود که پاسخ از دید انسان‌ها فوری به‌نظر برسد." msgid "Handlers invoked by this function currently include:" msgstr "" +"هندلر‌هایی که توسط این تابع فراخوانی می‌شوند، در حال حاضر عبارت‌اند از:" -msgid "Signal handlers, including Python functions registered using the :mod:`signal` module." +msgid "" +"Signal handlers, including Python functions registered using the " +":mod:`signal` module." msgstr "" +"هندلرهای سیگنال، از جمله توابع پایتونی که با استفاده از ماژول :mod:`signal` " +"ثبت شده‌اند." -msgid "Signal handlers are only run in the main thread of the main interpreter." -msgstr "" +msgid "" +"Signal handlers are only run in the main thread of the main interpreter." +msgstr "هندلرهای سیگنال فقط در نخ اصلی مفسر اصلی اجرا می‌شوند." -msgid "(This is where the function got the name: originally, signals were the only way to interrupt the interpreter.)" +msgid "" +"(This is where the function got the name: originally, signals were the only " +"way to interrupt the interpreter.)" msgstr "" +"(این تابع نام خود را از اینجا گرفته است: در اصل، سیگنال‌ها تنها راه برای " +"مقاطعه کردن مفسر بودند.)" msgid "Running the garbage collector, if necessary." -msgstr "" +msgstr "اجرای زباله‌روب، در صورت نیاز." msgid "Executing a pending :ref:`remote debugger ` script." msgstr "" +"اجرای یک اسکریپت در انتظار :ref:`اشکال‌زدای راه دور `." -msgid "If any handler raises an exception, immediately return ``-1`` with that exception set. Any remaining interruptions are left to be processed on the next :c:func:`PyErr_CheckSignals()` invocation, if appropriate." +msgid "" +"If any handler raises an exception, immediately return ``-1`` with that " +"exception set. Any remaining interruptions are left to be processed on the " +"next :c:func:`PyErr_CheckSignals()` invocation, if appropriate." msgstr "" +"اگر هر هندلری استثنایی ایجاد کند، بلافاصله ``-1`` همراه با آن استثنای " +"تنظیم‌شده بازگردانده می‌شود. پردازش هر وقفه‌ی باقی‌مانده، در صورت لزوم، به " +"فراخوانی بعدی :c:func:`PyErr_CheckSignals()` موکول می‌شود." -msgid "If all handlers finish successfully, or there are no handlers to run, return ``0``." +msgid "" +"If all handlers finish successfully, or there are no handlers to run, return" +" ``0``." msgstr "" +"اگر همه‌ی هندلرها با موفقیت پایان یابند، یا هندلری برای اجرا وجود نداشته " +"باشد، ``0`` را برمی‌گرداند." msgid "This function may now invoke the garbage collector." -msgstr "" +msgstr "این تابع ممکن است اکنون زباله‌روب را فراخوانی کند." -msgid "This function may now execute a remote debugger script, if remote debugging is enabled." +msgid "" +"This function may now execute a remote debugger script, if remote debugging " +"is enabled." msgstr "" +"این تابع اکنون ممکن است در صورت فعال بودن اشکال‌زدایی از راه دور، یک اسکریپت" +" اشکال‌زدای از راه دور را اجرا کند." -msgid "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is equivalent to ``PyErr_SetInterruptEx(SIGINT)``." +msgid "" +"Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " +"equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" +"اثر رسیدن سیگنال :c:macro:`!SIGINT` را شبیه‌سازی می‌کند. این معادل " +"``PyErr_SetInterruptEx(SIGINT)`` است." -msgid "This function is async-signal-safe. It can be called without an :term:`attached thread state` and from a C signal handler." +msgid "" +"This function is async-signal-safe. It can be called without an " +":term:`attached thread state` and from a C signal handler." msgstr "" +"این تابع نسبت به سیگنال ناهمگام ایمن است (async-signal-safe). این تابع را " +"می‌توان بدون :term:`وضعیت نخ متصل ` و از یک هندلر " +"سیگنال C فراخوانی کرد." -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." +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:func:`PyErr_CheckSignals` " +"فراخوانی شود، هندلر سیگنال پایتون برای شماره سیگنال داده‌شده فراخوانی خواهد " +"شد." -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 interruption is requested (for example when the user presses Ctrl-C to interrupt an operation)." +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 " +"interruption is requested (for example when the user presses Ctrl-C to " +"interrupt an operation)." msgstr "" +"این تابع را می‌توان از کد C‌ای فراخوانی کرد که مدیریت سیگنال خود را " +"راه‌اندازی می‌کند و می‌خواهد هندلرهای سیگنال پایتون هنگامی که وقفه‌ای " +"درخواست شود، همان‌طور که انتظار می‌رود فراخوانی شوند (برای مثال وقتی کاربر " +"برای قطع کردن یک عملیات، Ctrl-C را فشار می‌دهد)." -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." +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 "" +"اگر سیگنال داده‌شده توسط پایتون هندل نشده باشد (روی " +":py:const:`signal.SIG_DFL` یا :py:const:`signal.SIG_IGN` تنظیم‌شده باشد)، " +"نادیده گرفته خواهد شد." -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." +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 "" +"اگر *signum* خارج از بازه‌ی مجاز شماره‌های سیگنال باشد، مقدار ``-1`` " +"بازگردانده می‌شود. در غیر این صورت، مقدار ``0`` بازگردانده می‌شود. این تابع " +"هرگز نشانگر خطا را تغییر نمی‌دهد." -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." +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 "" +"این تابع کاربردی، توصیف‌گر پرونده‌ای را مشخص می‌کند که هر زمان سیگنالی " +"دریافت شود، شماره‌ی سیگنال به‌صورت یک بایت منفرد در آن نوشته می‌شود. *fd* " +"باید غیرمسدود باشد. این تابع توصیف‌گر پرونده‌ی قبلی از این نوع را " +"برمی‌گرداند." -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 checking. *fd* should be a valid file descriptor. The function should only be called from the main thread." +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 " +"checking. *fd* should be a valid file descriptor. The function should only" +" be called from the main thread." msgstr "" +"مقدار ``-1`` این قابلیت را غیرفعال می‌کند؛ این وضعیت اولیه است. این معادل " +":func:`signal.set_wakeup_fd` در پایتون است، اما بدون هیچ بررسی خطایی. *fd* " +"باید یک توصیف‌گر پرونده معتبر باشد. این تابع باید فقط از نخ اصلی فراخوانی " +"شود." msgid "On Windows, the function now also supports socket handles." -msgstr "" +msgstr "در ویندوز، این تابع اکنون از دسته‌های سوکت نیز پشتیبانی می‌کند." msgid "Exception Classes" -msgstr "" +msgstr "کلاس‌های استثنا" -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 ``module.classname``. The *base* and *dict* arguments are normally ``NULL``. This creates a class object derived from :exc:`Exception` (accessible in C as :c:data:`PyExc_Exception`)." -msgstr "" +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 " +"``module.classname``. The *base* and *dict* arguments are normally " +"``NULL``. This creates a class object derived from :exc:`Exception` " +"(accessible in C as :c:data:`PyExc_Exception`)." +msgstr "" +"این تابع کاربردی یک کلاس استثنای جدید ایجاد می‌کند و آن را برمی‌گرداند. " +"آرگومان *name* باید نام استثنای جدید باشد؛ یعنی یک رشته‌ی C به شکل " +"``module.classname``. آرگومان‌های *base* و *dict* معمولاً ``NULL`` هستند. " +"این یک شیء کلاس مشتق‌شده از :exc:`Exception` ایجاد می‌کند (که در C به صورت " +":c:data:`PyExc_Exception` قابل دسترسی است)." -msgid "The :attr:`~type.__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 the last part (after the last dot). The *base* argument can be used to specify alternate base classes; it can either be only one class or a tuple of classes. The *dict* argument can be used to specify a dictionary of class variables and methods." -msgstr "" +msgid "" +"The :attr:`~type.__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 the last part (after the last dot). The *base* argument can be used to " +"specify alternate base classes; it can either be only one class or a tuple " +"of classes. The *dict* argument can be used to specify a dictionary of class" +" variables and methods." +msgstr "" +"ویژگی :attr:`~type.__module__` کلاس جدید به بخش اول (تا آخرین نقطه) آرگومان " +"*name* تنظیم می‌شود و نام کلاس به بخش آخر (پس از آخرین نقطه) تنظیم می‌شود. " +"از آرگومان *base* می‌توان برای مشخص کردن کلاس‌های پایه‌ی جایگزین استفاده " +"کرد؛ این آرگومان می‌تواند تنها یک کلاس یا یک تاپل از کلاس‌ها باشد. از " +"آرگومان *dict* می‌توان برای مشخص کردن یک دیکشنری از متغیرهای کلاس و متدها " +"استفاده کرد." -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." +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:func:`PyErr_NewException` است، با این تفاوت که می‌توان به‌راحتی به " +"کلاس استثنای جدید یک رشته مستند داد: اگر *doc* مقدار ``NULL`` نباشد، از آن " +"به‌عنوان رشته مستند کلاس استثنا استفاده خواهد شد." -msgid "Return non-zero if *ob* is an exception class, zero otherwise. This function always succeeds." +msgid "" +"Return non-zero if *ob* is an exception class, zero otherwise. This function" +" always succeeds." msgstr "" +"اگر *ob* یک کلاس استثنا باشد، مقدار ناصفر و در غیر این صورت صفر برمی‌گرداند." +" این تابع همیشه با موفقیت اجرا می‌شود." msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*." -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_name` کلاس استثنا *ob* را بازمی‌گرداند." msgid "Exception Objects" -msgstr "" +msgstr "اشیاء استثنا" -msgid "Return true if *op* is an instance of :class:`BaseException`, false otherwise. This function always succeeds." +msgid "" +"Return true if *op* is an instance of :class:`BaseException`, false " +"otherwise. This function always succeeds." msgstr "" +"اگر *op* نمونه‌ای از :class:`BaseException` باشد، true برمی‌گرداند و در غیر " +"این صورت false. این تابع همیشه با موفقیت انجام می‌شود." msgid "Equivalent to :c:func:`Py_TYPE(op) `." -msgstr "" +msgstr "معادل :c:func:`Py_TYPE(op) ` است." -msgid "Return the traceback associated with the exception as a new reference, as accessible from Python through the :attr:`~BaseException.__traceback__` attribute. If there is no traceback associated, this returns ``NULL``." +msgid "" +"Return the traceback associated with the exception as a new reference, as " +"accessible from Python through the :attr:`~BaseException.__traceback__` " +"attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" +"ردگیری مرتبط با استثنا را به‌عنوان یک ارجاع جدید برمی‌گرداند؛ همان‌طور که از" +" پایتون از طریق ویژگی :attr:`~BaseException.__traceback__` قابل دسترسی است. " +"اگر هیچ ردگیری مرتبطی وجود نداشته باشد، این تابع ``NULL`` را برمی‌گرداند." -msgid "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to clear it." +msgid "" +"Set the traceback associated with the exception to *tb*. Use ``Py_None`` to" +" clear it." msgstr "" +"ردگیری مرتبط با استثنا را برابر *tb* قرار می‌دهد. برای پاک کردن آن از " +"``Py_None`` استفاده کنید." -msgid "Return the context (another exception instance during whose handling *ex* was raised) associated with the exception as a new reference, as accessible from Python through the :attr:`~BaseException.__context__` attribute. If there is no context associated, this returns ``NULL``." +msgid "" +"Return the context (another exception instance during whose handling *ex* " +"was raised) associated with the exception as a new reference, as accessible " +"from Python through the :attr:`~BaseException.__context__` attribute. If " +"there is no context associated, this returns ``NULL``." msgstr "" +"زمینه (نمونه استثنای دیگری که در حین مدیریت آن، *ex* پرتاب شده است) مرتبط با" +" استثنا را به‌عنوان یک ارجاع جدید برمی‌گرداند؛ همان‌طور که از پایتون از طریق" +" ویژگی :attr:`~BaseException.__context__` دسترسی‌پذیر است. اگر زمینه‌ای " +"مرتبط نباشد، این تابع ``NULL`` را برمی‌گرداند." -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 \":term:`steals `\" a reference to *ctx*." +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 \":term:`steals `\" a reference to *ctx*." msgstr "" +"زمینه مرتبط با استثنا را به *ctx* تنظیم می‌کند. برای پاک‌کردن آن از ``NULL``" +" استفاده کنید. هیچ بررسی نوعی برای اطمینان از این‌که *ctx* نمونه‌ای از " +"استثنا است انجام نمی‌شود. این تابع ارجاعی به *ctx* را «:term:`می‌دزدد " +"`»." -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 the :attr:`~BaseException.__cause__` attribute." +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 the :attr:`~BaseException.__cause__` " +"attribute." msgstr "" +"بازگرداندن علت مرتبط با استثنا (که یا یک نمونه‌ی استثنا است یا ``None``، و " +"توسط ``raise ... from ...`` تنظیم شده است) به‌عنوان یک ارجاع جدید، همان‌طور " +"که در پایتون از طریق ویژگی :attr:`~BaseException.__cause__` قابل دسترسی است." -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 \":term:`steals `\" a reference to *cause*." +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 \":term:`steals `\" a reference " +"to *cause*." msgstr "" +"علت مرتبط با استثنا را برابر *cause* قرار می‌دهد. برای پاک کردن آن از " +"``NULL`` استفاده کنید. هیچ بررسی نوعی برای اطمینان از اینکه *cause* یا " +"نمونه‌ای از استثنا است یا ``None``، انجام نمی‌شود. این یک ارجاع به *cause* " +"را «:term:`می‌دزدد `»." -msgid "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set to ``True`` by this function." +msgid "" +"The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " +"to ``True`` by this function." msgstr "" +"ویژگی :attr:`~BaseException.__suppress_context__` به‌طور ضمنی توسط این تابع " +"برابر ``True`` قرار می‌گیرد." msgid "Return :attr:`~BaseException.args` of exception *ex*." -msgstr "" +msgstr "بازگشت :attr:`~BaseException.args` از استثنای *ex*." msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" +"مقدار :attr:`~BaseException.args` استثنای *ex* را برابر *args* قرار می‌دهد." -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 the exceptions that need to be raised. This list contains the unhandled part of *orig*, if any, as well as the exceptions that were raised from the :keyword:`!except*` clauses (so they have a different traceback from *orig*) and those that were reraised (and have the same traceback as *orig*). Return the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` if there is nothing to reraise." -msgstr "" +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 " +"the exceptions that need to be raised. This list contains the unhandled part" +" of *orig*, if any, as well as the exceptions that were raised from the " +":keyword:`!except*` clauses (so they have a different traceback from *orig*)" +" and those that were reraised (and have the same traceback as *orig*). " +"Return the :exc:`ExceptionGroup` that needs to be reraised in the end, or " +"``None`` if there is nothing to reraise." +msgstr "" +"بخشی از پیاده‌سازی :keyword:`!except*` توسط مفسر را انجام می‌دهد. *orig* " +"استثنای اصلی است که گرفته شده است، و *excs* فهرست استثناهایی است که باید " +"مطرح (raise) شوند. این فهرست شامل بخش مدیریت‌نشده‌ی *orig* (در صورت وجود) و " +"همچنین استثناهایی است که از بندهای :keyword:`!except*` مطرح شده‌اند " +"(بنابراین ردگیری‌شان با *orig* متفاوت است) و آن‌هایی که دوباره مطرح شده‌اند " +"(و ردگیری‌شان با *orig* یکسان است). :exc:`ExceptionGroup` را برمی‌گرداند که " +"در نهایت باید دوباره مطرح شود، یا ``None`` را اگر چیزی برای مطرح شدن مجدد " +"وجود ندارد." msgid "Unicode Exception Objects" -msgstr "" +msgstr "اشیاء استثنای یونیکد" -msgid "The following functions are used to create and modify Unicode exceptions from C." -msgstr "" +msgid "" +"The following functions are used to create and modify Unicode exceptions " +"from C." +msgstr "توابع زیر برای ایجاد و تغییر استثناهای یونیکد از C استفاده می‌شوند." -msgid "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are UTF-8 encoded strings." +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 "" +"یک شیء :class:`UnicodeDecodeError` با ویژگی‌های *encoding*، *object*، " +"*length*، *start*، *end* و *reason* ایجاد کنید. *encoding* و *reason* " +"رشته‌های کدگذاری‌شده با UTF-8 هستند." msgid "Return the *encoding* attribute of the given exception object." -msgstr "" +msgstr "ویژگی *encoding* شیء استثنای داده‌شده را بازمی‌گرداند." msgid "Return the *object* attribute of the given exception object." -msgstr "" +msgstr "ویژگی *object* شیء استثنای داده‌شده را برمی‌گرداند." -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." +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 "" +"ویژگی *start* شیء استثنای داده‌شده را می‌گیرد و آن را در *\\*start* قرار " +"می‌دهد. *start* نباید ``NULL`` باشد. در صورت موفقیت ``0`` و در صورت شکست " +"``-1`` برمی‌گرداند." -msgid "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." +msgid "" +"If the :attr:`UnicodeError.object` is an empty sequence, the resulting " +"*start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." msgstr "" +"اگر :attr:`UnicodeError.object` یک دنباله‌ی خالی باشد، *start* حاصل ``0`` " +"است. در غیر این صورت، *start* به ``[0, len(object) - 1]`` محدود می‌شود." msgid ":attr:`UnicodeError.start`" -msgstr "" +msgstr ":attr:`UnicodeError.start`" -msgid "Set the *start* attribute of the given exception object to *start*. Return ``0`` on success, ``-1`` on failure." +msgid "" +"Set the *start* attribute of the given exception object to *start*. Return " +"``0`` on success, ``-1`` on failure." msgstr "" +"ویژگی *start* شیء استثنای داده‌شده را برابر *start* قرار می‌دهد. در صورت " +"موفقیت ``0`` و در صورت شکست ``-1`` برمی‌گرداند." -msgid "While passing a negative *start* does not raise an exception, the corresponding getters will not consider it as a relative offset." +msgid "" +"While passing a negative *start* does not raise an exception, the " +"corresponding getters will not consider it as a relative offset." msgstr "" +"اگرچه گذراندن یک *start* منفی استثنایی مطرح نمی‌کند، گترهای (getters) مربوطه" +" آن را به‌عنوان یک آفست نسبی در نظر نخواهند گرفت." -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." +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 "" +"ویژگی *end* شیء استثنای داده‌شده را دریافت می‌کند و آن را در *\\*end* قرار " +"می‌دهد. *end* نباید ``NULL`` باشد. در صورت موفقیت ``0`` و در صورت شکست " +"``-1`` برمی‌گرداند." -msgid "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." +msgid "" +"If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end*" +" is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." msgstr "" +"اگر :attr:`UnicodeError.object` یک دنباله‌ی خالی باشد، *end* حاصل ``0`` است." +" در غیر این صورت، این مقدار به ``[1, len(object)]`` محدود می‌شود." -msgid "Set the *end* attribute of the given exception object to *end*. Return ``0`` on success, ``-1`` on failure." +msgid "" +"Set the *end* attribute of the given exception object to *end*. Return " +"``0`` on success, ``-1`` on failure." msgstr "" +"ویژگی *end* شیء استثنای داده‌شده را به *end* تنظیم می‌کند. در صورت موفقیت " +"``0`` و در صورت شکست ``-1`` برمی‌گرداند." msgid ":attr:`UnicodeError.end`" -msgstr "" +msgstr ":attr:`UnicodeError.end`" msgid "Return the *reason* attribute of the given exception object." -msgstr "" +msgstr "ویژگی *reason* شیء استثنای داده‌شده را برمی‌گرداند." -msgid "Set the *reason* attribute of the given exception object to *reason*. Return ``0`` on success, ``-1`` on failure." +msgid "" +"Set the *reason* attribute of the given exception object to *reason*. " +"Return ``0`` on success, ``-1`` on failure." msgstr "" +"ویژگی *reason* شیء استثنای داده‌شده را برابر *reason* قرار می‌دهد. در صورت " +"موفقیت ``0`` و در صورت شکست ``-1`` برمی‌گرداند." msgid "Recursion Control" -msgstr "" +msgstr "کنترل بازگشتی" -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 recursive code does not necessarily invoke Python code (which tracks its recursion depth automatically). They are also not needed for *tp_call* implementations because the :ref:`call protocol ` takes care of recursion handling." -msgstr "" +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 " +"recursive code does not necessarily invoke Python code (which tracks its " +"recursion depth automatically). They are also not needed for *tp_call* " +"implementations because the :ref:`call protocol ` takes care of " +"recursion handling." +msgstr "" +"این دو تابع راهی برای انجام فراخوانی‌های بازگشتی ایمن در سطح C فراهم " +"می‌کنند، هم در هسته و هم در ماژول‌های توسعه‌ای. این توابع زمانی لازم هستند " +"که کد بازگشتی لزوماً کد پایتون را فراخوانی نکند (که عمق بازگشت خود را به‌طور" +" خودکار پیگیری می‌کند). این توابع برای پیاده‌سازی‌های *tp_call* نیز لازم " +"نیستند، زیرا :ref:`پروتکل فراخوانی ` مدیریت بازگشت را بر عهده می‌گیرد." msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" +"نقطه‌ای را نشان‌گذاری می‌کند که در آن یک فراخوانی بازگشتی در سطح C در شرف " +"انجام است." -msgid "The function then checks if the stack limit is reached. If this is the case, a :exc:`RecursionError` is set and a nonzero value is returned. Otherwise, zero is returned." +msgid "" +"The function then checks if the stack limit is reached. If this is the " +"case, a :exc:`RecursionError` is set and a nonzero value is returned. " +"Otherwise, zero is returned." msgstr "" +"سپس تابع بررسی می‌کند که آیا به حد پشته رسیده است یا خیر. اگر چنین باشد، یک " +":exc:`RecursionError` تنظیم می‌شود و مقدار غیرصفر بازگردانده می‌شود. در غیر " +"این صورت، صفر بازگردانده می‌شود." -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." +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 "" +"*where* باید یک رشته‌ی کدگذاری‌شده با UTF-8 مانند ``\" in instance check\"``" +" باشد تا به پیام :exc:`RecursionError` که ناشی از محدودیت عمق بازگشت است، " +"الحاق شود." msgid "The :c:func:`PyUnstable_ThreadState_SetStackProtection` function." -msgstr "" +msgstr "تابع :c:func:`PyUnstable_ThreadState_SetStackProtection`." -msgid "This function is now also available in the :ref:`limited API `." -msgstr "" +msgid "" +"This function is now also available in the :ref:`limited API `." +msgstr "این تابع اکنون در :ref:`API محدود ` نیز در دسترس است." -msgid "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each *successful* invocation of :c:func:`Py_EnterRecursiveCall`." +msgid "" +"Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " +"*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" +"یک :c:func:`Py_EnterRecursiveCall` را پایان می‌دهد. باید یک‌بار برای هر " +"فراخوانی *موفق* :c:func:`Py_EnterRecursiveCall` فراخوانی شود." -msgid "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types requires special recursion handling. In addition to protecting the stack, :c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent cycles. The following two functions facilitate this functionality. Effectively, these are the C equivalent to :deco:`reprlib.recursive_repr`." -msgstr "" +msgid "" +"Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " +"requires special recursion handling. In addition to protecting the stack, " +":c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent " +"cycles. The following two functions facilitate this functionality. " +"Effectively, these are the C equivalent to :deco:`reprlib.recursive_repr`." +msgstr "" +"پیاده‌سازی صحیح :c:member:`~PyTypeObject.tp_repr` برای نوع‌های ظرف نیازمند " +"مدیریت ویژه‌ی بازگشت است. علاوه بر محافظت از پشته، " +":c:member:`~PyTypeObject.tp_repr` باید اشیاء را برای جلوگیری از چرخه‌ها " +"پیگیری کند. دو تابع زیر این عملکرد را تسهیل می‌کنند. در واقع، این‌ها معادل" +" C برای :deco:`reprlib.recursive_repr` هستند." -msgid "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` implementation to detect cycles." +msgid "" +"Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " +"implementation to detect cycles." msgstr "" +"در ابتدای پیاده‌سازی :c:member:`~PyTypeObject.tp_repr` برای تشخیص چرخه‌ها " +"فراخوانی می‌شود." -msgid "If the object has already been processed, the function returns a positive integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation should return a string object indicating a cycle. As examples, :class:`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." +msgid "" +"If the object has already been processed, the function returns a positive " +"integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " +"should return a string object indicating a cycle. As examples, " +":class:`dict` objects return ``{...}`` and :class:`list` objects return " +"``[...]``." msgstr "" +"اگر شیء قبلاً پردازش شده باشد، تابع یک عدد صحیح مثبت برمی‌گرداند. در این " +"صورت، پیاده‌سازی :c:member:`~PyTypeObject.tp_repr` باید یک شیء رشته برگرداند" +" که نشان‌دهنده‌ی یک چرخه است. به عنوان مثال، شیءهای :class:`dict` ``{...}`` " +"و شیءهای :class:`list` ``[...]`` را برمی‌گردانند." -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``." +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:member:`~PyTypeObject.tp_repr` معمولاً باید ``NULL`` " +"برگرداند." -msgid "Otherwise, the function returns zero and the :c:member:`~PyTypeObject.tp_repr` implementation can continue normally." +msgid "" +"Otherwise, the function returns zero and the " +":c:member:`~PyTypeObject.tp_repr` implementation can continue normally." msgstr "" +"در غیر این صورت، تابع صفر را برمی‌گرداند و پیاده‌سازی " +":c:member:`~PyTypeObject.tp_repr` می‌تواند به‌طور عادی ادامه یابد." -msgid "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :c:func:`Py_ReprEnter` that returns zero." +msgid "" +"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of " +":c:func:`Py_ReprEnter` that returns zero." msgstr "" +"یک :c:func:`Py_ReprEnter` را به پایان می‌رساند. باید یک‌بار برای هر فراخوانی" +" :c:func:`Py_ReprEnter` که صفر را برمی‌گرداند، فراخوانی شود." -msgid "Get the recursion limit for the current interpreter. It can be set with :c:func:`Py_SetRecursionLimit`. The recursion limit prevents the Python interpreter stack from growing infinitely." +msgid "" +"Get the recursion limit for the current interpreter. It can be set with " +":c:func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " +"interpreter stack from growing infinitely." msgstr "" +"حد بازگشتی مفسر فعلی را برمی‌گرداند. این حد را می‌توان با " +":c:func:`Py_SetRecursionLimit` تنظیم کرد. حد بازگشتی مانع از رشد بی‌نهایت " +"پشته‌ی مفسر پایتون می‌شود." -msgid "This function cannot fail, and the caller must hold an :term:`attached thread state`." +msgid "" +"This function cannot fail, and the caller must hold an :term:`attached " +"thread state`." msgstr "" +"این تابع نمی‌تواند شکست بخورد، و فراخوان‌کننده باید یک :term:`وضعیت نخ متصل " +"` را در اختیار داشته باشد." msgid ":py:func:`sys.getrecursionlimit`" -msgstr "" +msgstr ":py:func:`sys.getrecursionlimit`" msgid "Set the recursion limit for the current interpreter." -msgstr "" +msgstr "حد بازگشتی را برای مفسر فعلی تنظیم کنید." msgid ":py:func:`sys.setrecursionlimit`" -msgstr "" +msgstr ":py:func:`sys.setrecursionlimit`" msgid "Exception and warning types" -msgstr "" +msgstr "نوع‌های استثنا و هشدار" -msgid "All standard Python exceptions and warning categories are available as global variables whose names are ``PyExc_`` followed by the Python exception name. These have the type :c:expr:`PyObject*`; they are all class objects." +msgid "" +"All standard Python exceptions and warning categories are available as " +"global variables whose names are ``PyExc_`` followed by the Python exception" +" name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" +"تمام استثناهای استاندارد پایتون و دسته‌های هشدار به‌صورت متغیرهای سراسری در " +"دسترس هستند که نام آن‌ها ``PyExc_`` و به دنبال آن نام استثنای پایتون است. " +"این‌ها از نوع :c:expr:`PyObject*` هستند؛ همگی اشیای کلاس هستند." msgid "For completeness, here are all the variables:" -msgstr "" +msgstr "برای کامل بودن، همه متغیرها این‌جا آمده‌اند:" msgid "Exception types" -msgstr "" +msgstr "نوع‌های استثنا" msgid "C name" -msgstr "" +msgstr "نام C" msgid "Python name" -msgstr "" +msgstr "نام پایتونی" msgid ":exc:`BaseException`" -msgstr "" +msgstr ":exc:`BaseException`" msgid ":exc:`BaseExceptionGroup`" -msgstr "" +msgstr ":exc:`BaseExceptionGroup`" msgid ":exc:`Exception`" -msgstr "" +msgstr ":exc:`Exception`" msgid ":exc:`ArithmeticError`" -msgstr "" +msgstr ":exc:`ArithmeticError`" msgid ":exc:`AssertionError`" -msgstr "" +msgstr ":exc:`AssertionError`" msgid ":exc:`AttributeError`" -msgstr "" +msgstr ":exc:`AttributeError`" msgid ":exc:`BlockingIOError`" -msgstr "" +msgstr ":exc:`BlockingIOError`" msgid ":exc:`BrokenPipeError`" -msgstr "" +msgstr ":exc:`BrokenPipeError`" msgid ":exc:`BufferError`" -msgstr "" +msgstr ":exc:`BufferError`" msgid ":exc:`ChildProcessError`" -msgstr "" +msgstr ":exc:`ChildProcessError`" msgid ":exc:`ConnectionAbortedError`" -msgstr "" +msgstr ":exc:`ConnectionAbortedError`" msgid ":exc:`ConnectionError`" -msgstr "" +msgstr ":exc:`ConnectionError`" msgid ":exc:`ConnectionRefusedError`" -msgstr "" +msgstr ":exc:`ConnectionRefusedError`" msgid ":exc:`ConnectionResetError`" -msgstr "" +msgstr ":exc:`ConnectionResetError`" msgid ":exc:`EOFError`" -msgstr "" +msgstr ":exc:`EOFError`" msgid ":exc:`FileExistsError`" -msgstr "" +msgstr ":exc:`FileExistsError`" msgid ":exc:`FileNotFoundError`" -msgstr "" +msgstr ":exc:`FileNotFoundError`" msgid ":exc:`FloatingPointError`" -msgstr "" +msgstr ":exc:`FloatingPointError`" msgid ":exc:`GeneratorExit`" -msgstr "" +msgstr ":exc:`GeneratorExit`" msgid ":exc:`ImportError`" -msgstr "" +msgstr ":exc:`ImportError`" msgid ":exc:`IndentationError`" -msgstr "" +msgstr ":exc:`IndentationError`" msgid ":exc:`IndexError`" -msgstr "" +msgstr ":exc:`IndexError`" msgid ":exc:`InterruptedError`" -msgstr "" +msgstr ":exc:`InterruptedError`" msgid ":exc:`IsADirectoryError`" -msgstr "" +msgstr ":exc:`IsADirectoryError`" msgid ":exc:`KeyError`" -msgstr "" +msgstr ":exc:`KeyError`" msgid ":exc:`KeyboardInterrupt`" -msgstr "" +msgstr ":exc:`KeyboardInterrupt`" msgid ":exc:`LookupError`" -msgstr "" +msgstr ":exc:`LookupError`" msgid ":exc:`MemoryError`" -msgstr "" +msgstr ":exc:`MemoryError`" msgid ":exc:`ModuleNotFoundError`" -msgstr "" +msgstr ":exc:`ModuleNotFoundError`" msgid ":exc:`NameError`" -msgstr "" +msgstr ":exc:`NameError`" msgid ":exc:`NotADirectoryError`" -msgstr "" +msgstr ":exc:`NotADirectoryError`" msgid ":exc:`NotImplementedError`" -msgstr "" +msgstr ":exc:`NotImplementedError`" msgid ":exc:`OSError`" -msgstr "" +msgstr ":exc:`OSError`" msgid ":exc:`OverflowError`" -msgstr "" +msgstr ":exc:`OverflowError`" msgid ":exc:`PermissionError`" -msgstr "" +msgstr ":exc:`PermissionError`" msgid ":exc:`ProcessLookupError`" -msgstr "" +msgstr ":exc:`ProcessLookupError`" msgid ":exc:`PythonFinalizationError`" -msgstr "" +msgstr ":exc:`PythonFinalizationError`" msgid ":exc:`RecursionError`" -msgstr "" +msgstr ":exc:`RecursionError`" msgid ":exc:`ReferenceError`" -msgstr "" +msgstr ":exc:`ReferenceError`" msgid ":exc:`RuntimeError`" -msgstr "" +msgstr ":exc:`RuntimeError`" msgid ":exc:`StopAsyncIteration`" -msgstr "" +msgstr ":exc:`StopAsyncIteration`" msgid ":exc:`StopIteration`" -msgstr "" +msgstr ":exc:`StopIteration`" msgid ":exc:`SyntaxError`" -msgstr "" +msgstr ":exc:`SyntaxError`" msgid ":exc:`SystemError`" -msgstr "" +msgstr ":exc:`SystemError`" msgid ":exc:`SystemExit`" -msgstr "" +msgstr ":exc:`SystemExit`" msgid ":exc:`TabError`" -msgstr "" +msgstr ":exc:`TabError`" msgid ":exc:`TimeoutError`" -msgstr "" +msgstr ":exc:`TimeoutError`" msgid ":exc:`TypeError`" -msgstr "" +msgstr ":exc:`TypeError`" msgid ":exc:`UnboundLocalError`" -msgstr "" +msgstr ":exc:`UnboundLocalError`" msgid ":exc:`UnicodeDecodeError`" -msgstr "" +msgstr ":exc:`UnicodeDecodeError`" msgid ":exc:`UnicodeEncodeError`" -msgstr "" +msgstr ":exc:`UnicodeEncodeError`" msgid ":exc:`UnicodeError`" -msgstr "" +msgstr ":exc:`UnicodeError`" msgid ":exc:`UnicodeTranslateError`" -msgstr "" +msgstr ":exc:`UnicodeTranslateError`" msgid ":exc:`ValueError`" -msgstr "" +msgstr ":exc:`ValueError`" msgid ":exc:`ZeroDivisionError`" -msgstr "" +msgstr ":exc:`ZeroDivisionError`" -msgid ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and :c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`." -msgstr "" +msgid "" +":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, " +":c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, " +":c:data:`PyExc_ConnectionAbortedError`, " +":c:data:`PyExc_ConnectionRefusedError`, " +":c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, " +":c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, " +":c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, " +":c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and " +":c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`." +msgstr "" +":c:data:`PyExc_BlockingIOError`، :c:data:`PyExc_BrokenPipeError`، " +":c:data:`PyExc_ChildProcessError`، :c:data:`PyExc_ConnectionError`، " +":c:data:`PyExc_ConnectionAbortedError`، " +":c:data:`PyExc_ConnectionRefusedError`، " +":c:data:`PyExc_ConnectionResetError`، :c:data:`PyExc_FileExistsError`، " +":c:data:`PyExc_FileNotFoundError`، :c:data:`PyExc_InterruptedError`، " +":c:data:`PyExc_IsADirectoryError`، :c:data:`PyExc_NotADirectoryError`، " +":c:data:`PyExc_PermissionError`، :c:data:`PyExc_ProcessLookupError` و " +":c:data:`PyExc_TimeoutError` در پی :pep:`3151` معرفی شدند." msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." -msgstr "" +msgstr ":c:data:`PyExc_StopAsyncIteration` و :c:data:`PyExc_RecursionError`." msgid ":c:data:`PyExc_ModuleNotFoundError`." -msgstr "" +msgstr ":c:data:`PyExc_ModuleNotFoundError`." msgid ":c:data:`PyExc_BaseExceptionGroup`." -msgstr "" +msgstr ":c:data:`PyExc_BaseExceptionGroup`." msgid "OSError aliases" -msgstr "" +msgstr "نام‌های مستعار OSError" msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." -msgstr "" +msgstr "موارد زیر نام‌های مستعار سازگاری برای :c:data:`PyExc_OSError` هستند." msgid "These aliases used to be separate exception types." -msgstr "" +msgstr "این نام‌های مستعار قبلاً نوع‌های استثنای جداگانه بودند." msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "[win]_" -msgstr "" +msgstr "[win]_" msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" -msgid ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." +msgid "" +":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " +"uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" +":c:var:`!PyExc_WindowsError` تنها در ویندوز تعریف شده است؛ برای محافظت از " +"کدی که از این استفاده می‌کند، بررسی کنید که ماکروی پیش‌پردازنده " +"``MS_WINDOWS`` تعریف شده باشد." msgid "Warning types" -msgstr "" +msgstr "انواع هشدار" msgid ":exc:`Warning`" -msgstr "" +msgstr ":exc:`Warning`" msgid ":exc:`BytesWarning`" -msgstr "" +msgstr ":exc:`BytesWarning`" msgid ":exc:`DeprecationWarning`" -msgstr "" +msgstr ":exc:`DeprecationWarning`" msgid ":exc:`EncodingWarning`" -msgstr "" +msgstr ":exc:`EncodingWarning`" msgid ":exc:`FutureWarning`" -msgstr "" +msgstr ":exc:`FutureWarning`" msgid ":exc:`ImportWarning`" -msgstr "" +msgstr ":exc:`ImportWarning`" msgid ":exc:`PendingDeprecationWarning`" -msgstr "" +msgstr ":exc:`PendingDeprecationWarning`" msgid ":exc:`ResourceWarning`" -msgstr "" +msgstr ":exc:`ResourceWarning`" msgid ":exc:`RuntimeWarning`" -msgstr "" +msgstr ":exc:`RuntimeWarning`" msgid ":exc:`SyntaxWarning`" -msgstr "" +msgstr ":exc:`SyntaxWarning`" msgid ":exc:`UnicodeWarning`" -msgstr "" +msgstr ":exc:`UnicodeWarning`" msgid ":exc:`UserWarning`" -msgstr "" +msgstr ":exc:`UserWarning`" msgid ":c:data:`PyExc_ResourceWarning`." -msgstr "" +msgstr ":c:data:`PyExc_ResourceWarning`." msgid ":c:data:`PyExc_EncodingWarning`." -msgstr "" +msgstr ":c:data:`PyExc_EncodingWarning`." msgid "Tracebacks" -msgstr "" +msgstr "ردگیری‌ها" -msgid "Type object for traceback objects. This is available as :class:`types.TracebackType` in the Python layer." +msgid "" +"Type object for traceback objects. This is available as " +":class:`types.TracebackType` in the Python layer." msgstr "" +"شیء نوع برای اشیاء ردگیری (traceback). این به‌صورت " +":class:`types.TracebackType` در لایه‌ی پایتون در دسترس است." -msgid "Return true if *op* is a traceback object, false otherwise. This function does not account for subtypes." +msgid "" +"Return true if *op* is a traceback object, false otherwise. This function " +"does not account for subtypes." msgstr "" +"اگر *op* یک شیء ردگیری (traceback) باشد، مقدار true را برمی‌گرداند و در غیر " +"این صورت مقدار false را. این تابع زیرنوع‌ها را در نظر نمی‌گیرد." -msgid "Replace the :attr:`~BaseException.__traceback__` attribute on the current exception with a new traceback prepending *f* to the existing chain." +msgid "" +"Replace the :attr:`~BaseException.__traceback__` attribute on the current " +"exception with a new traceback prepending *f* to the existing chain." msgstr "" +"ویژگی :attr:`~BaseException.__traceback__` روی استثنای فعلی را با یک ردگیری " +"جدید که *f* را به ابتدای زنجیره‌ی موجود می‌افزاید، جایگزین کنید." msgid "Calling this function without an exception set is undefined behavior." msgstr "" +"فراخوانی این تابع در حالی که استثنایی تنظیم نشده باشد، رفتار تعریف‌نشده است." -msgid "This function returns ``0`` on success, and returns ``-1`` with an exception set on failure." +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception" +" set on failure." msgstr "" +"این تابع در صورت موفقیت ``0`` را برمی‌گرداند، و در صورت شکست ``-1`` را همراه" +" با یک استثنای تنظیم‌شده برمی‌گرداند." msgid "Write the traceback *tb* into the file *f*." -msgstr "" +msgstr "ردگیری *tb* را در پرونده *f* بنویسید." msgid "strerror (C function)" -msgstr "" +msgstr "strerror (تابع C)" msgid "module" -msgstr "" +msgstr "ماژول" msgid "signal" -msgstr "" +msgstr "سیگنال" msgid "SIGINT (C macro)" -msgstr "" +msgstr "SIGINT (ماکروی C)" msgid "KeyboardInterrupt (built-in exception)" -msgstr "" +msgstr "KeyboardInterrupt (استثنای توکار)" diff --git a/c-api/extension-modules.po b/c-api/extension-modules.po index db72a05b6..aa58abd4c 100644 --- a/c-api/extension-modules.po +++ b/c-api/extension-modules.po @@ -20,64 +20,187 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Defining extension modules" -msgstr "" +msgstr "تعریف ماژول‌های توسعه‌ای" -msgid "A C extension for CPython is a shared library (for example, a ``.so`` file on Linux, ``.pyd`` DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which exports an :ref:`initialization function `." +msgid "" +"A C extension for CPython is a shared library (for example, a ``.so`` file " +"on Linux, ``.pyd`` DLL on Windows), which is loadable into the Python " +"process (for example, it is compiled with compatible compiler settings), and" +" which exports an :ref:`initialization function `." msgstr "" +"یک افزونه C برای سی‌پایتون یک کتابخانه اشتراکی است (برای مثال، یک پرونده " +"``.so`` در لینوکس، DLL ``.pyd`` در ویندوز) که در فرایند پایتون بارگذاری‌پذیر" +" است (برای مثال، با تنظیمات سازگار کامپایلر کامپایل شده است) و یک :ref:`تابع" +" مقداردهی اولیه ` را صادر می‌کند." -msgid "To be importable by default (that is, by :py:class:`importlib.machinery.ExtensionFileLoader`), the shared library must be available on :py:attr:`sys.path`, and must be named after the module name plus an extension listed in :py:attr:`importlib.machinery.EXTENSION_SUFFIXES`." -msgstr "" +msgid "" +"To be importable by default (that is, by " +":py:class:`importlib.machinery.ExtensionFileLoader`), the shared library " +"must be available on :py:attr:`sys.path`, and must be named after the module" +" name plus an extension listed in " +":py:attr:`importlib.machinery.EXTENSION_SUFFIXES`." +msgstr "" +"برای اینکه به‌صورت پیش‌فرض ایمپورت‌پذیر باشد (یعنی توسط " +":py:class:`importlib.machinery.ExtensionFileLoader`)، کتابخانه‌ی اشتراکی " +"باید در :py:attr:`sys.path` موجود باشد و باید بر اساس نام ماژول به‌علاوه‌ی " +"یکی از پسوند‌های فهرست‌شده در " +":py:attr:`importlib.machinery.EXTENSION_SUFFIXES` نام‌گذاری شود." -msgid "Building, packaging and distributing extension modules is best done with third-party tools, and is out of scope of this document. One suitable tool is Setuptools, whose documentation can be found at https://setuptools.pypa.io/en/latest/setuptools.html." +msgid "" +"Building, packaging and distributing extension modules is best done with " +"third-party tools, and is out of scope of this document. One suitable tool " +"is Setuptools, whose documentation can be found at " +"https://setuptools.pypa.io/en/latest/setuptools.html." msgstr "" +"ساخت، بسته‌بندی و توزیع ماژول‌های توسعه‌ای بهتر است با ابزارهای شخص ثالث " +"انجام شود و خارج از محدوده‌ی این سند است. یکی از ابزارهای مناسب، Setuptools " +"است که می‌توانید مستندات آن را در " +"https://setuptools.pypa.io/en/latest/setuptools.html بیابید." -msgid "Normally, the initialization function returns a module definition initialized using :c:func:`PyModuleDef_Init`. This allows splitting the creation process into several phases:" +msgid "" +"Normally, the initialization function returns a module definition " +"initialized using :c:func:`PyModuleDef_Init`. This allows splitting the " +"creation process into several phases:" msgstr "" +"به‌طور معمول، تابع مقداردهی اولیه، تعریف ماژولی را برمی‌گرداند که با استفاده" +" از :c:func:`PyModuleDef_Init` مقداردهی اولیه شده است. این اجازه می‌دهد " +"فرایند ایجاد به چندین مرحله تقسیم شود:" -msgid "Before any substantial code is executed, Python can determine which capabilities the module supports, and it can adjust the environment or refuse loading an incompatible extension." +msgid "" +"Before any substantial code is executed, Python can determine which " +"capabilities the module supports, and it can adjust the environment or " +"refuse loading an incompatible extension." msgstr "" +"پیش از آنکه هر کد قابل توجهی اجرا شود، پایتون می‌تواند تعیین کند که ماژول از" +" چه قابلیت‌هایی پشتیبانی می‌کند، و می‌تواند محیط را تنظیم کند یا از بارگذاری" +" یک ماژول توسعه‌ای ناسازگار خودداری کند." -msgid "By default, Python itself creates the module object -- that is, it does the equivalent of :py:meth:`object.__new__` for classes. It also sets initial attributes like :attr:`~module.__package__` and :attr:`~module.__loader__`." +msgid "" +"By default, Python itself creates the module object -- that is, it does the " +"equivalent of :py:meth:`object.__new__` for classes. It also sets initial " +"attributes like :attr:`~module.__package__` and :attr:`~module.__loader__`." msgstr "" +"به‌طور پیش‌فرض، خودِ پایتون شیء ماژول را ایجاد می‌کند -- یعنی همان کاری را " +"انجام می‌دهد که :py:meth:`object.__new__` برای کلاس‌ها انجام می‌دهد. همچنین " +"ویژگی‌های اولیه‌ای مانند :attr:`~module.__package__` و " +":attr:`~module.__loader__` را تنظیم می‌کند." -msgid "Afterwards, the module object is initialized using extension-specific code -- the equivalent of :py:meth:`~object.__init__` on classes." +msgid "" +"Afterwards, the module object is initialized using extension-specific code " +"-- the equivalent of :py:meth:`~object.__init__` on classes." msgstr "" +"پس از آن، شیء ماژول با استفاده از کد مخصوص توسعه مقداردهی اولیه می‌شود — " +"معادلِ :py:meth:`~object.__init__` در کلاس‌ها." -msgid "This is called *multi-phase initialization* to distinguish it from the legacy (but still supported) *single-phase initialization* scheme, where the initialization function returns a fully constructed module. See the :ref:`single-phase-initialization section below ` for details." -msgstr "" +msgid "" +"This is called *multi-phase initialization* to distinguish it from the " +"legacy (but still supported) *single-phase initialization* scheme, where the" +" initialization function returns a fully constructed module. See the " +":ref:`single-phase-initialization section below ` for details." +msgstr "" +"این روش *مقداردهی اولیه چندمرحله‌ای* (multi-phase initialization) نامیده " +"می‌شود تا از طرح قدیمی (اما همچنان پشتیبانی‌شده) *مقداردهی اولیه " +"تک‌مرحله‌ای* (single-phase initialization) متمایز باشد؛ در این طرح، تابع " +"مقداردهی اولیه ماژولی کاملاً ساخته‌شده را برمی‌گرداند. برای جزئیات، " +":ref:`بخش مقداردهی اولیه تک‌مرحله‌ای در پایین `" +" را ببینید." msgid "Added support for multi-phase initialization (:pep:`489`)." -msgstr "" +msgstr "پشتیبانی از مقداردهی اولیه چندمرحله‌ای اضافه شد (:pep:`489`)." msgid "Multiple module instances" -msgstr "" +msgstr "نمونه‌های متعدد ماژول" -msgid "By default, extension modules are not singletons. For example, if the :py:attr:`sys.modules` entry is removed and the module is re-imported, a new module object is created, and typically populated with fresh method and type objects. The old module is subject to normal garbage collection. This mirrors the behavior of pure-Python modules." +msgid "" +"By default, extension modules are not singletons. For example, if the " +":py:attr:`sys.modules` entry is removed and the module is re-imported, a new" +" module object is created, and typically populated with fresh method and " +"type objects. The old module is subject to normal garbage collection. This " +"mirrors the behavior of pure-Python modules." msgstr "" +"به‌طور پیش‌فرض، ماژول‌های توسعه‌ای تک‌نمونه نیستند. برای مثال، اگر ورودی " +":py:attr:`sys.modules` حذف شود و ماژول دوباره ایمپورت شود، یک شیء ماژول جدید" +" ساخته می‌شود که معمولاً با اشیاء متد و نوع تازه پر می‌شود. ماژول قدیمی " +"مشمول زباله‌روبی معمول می‌شود. این، بازتاب رفتار ماژول‌های پایتون خالص است." -msgid "Additional module instances may be created in :ref:`sub-interpreters ` or after Python runtime reinitialization (:c:func:`Py_Finalize` and :c:func:`Py_Initialize`). In these cases, sharing Python objects between module instances would likely cause crashes or undefined behavior." +msgid "" +"Additional module instances may be created in :ref:`sub-interpreters ` or after Python runtime reinitialization " +"(:c:func:`Py_Finalize` and :c:func:`Py_Initialize`). In these cases, sharing" +" Python objects between module instances would likely cause crashes or " +"undefined behavior." msgstr "" +"ممکن است نمونه‌های اضافی ماژول در :ref:`زیرمفسرها `" +" یا پس از راه‌اندازی مجدد ران‌تایم پایتون (:c:func:`Py_Finalize` و " +":c:func:`Py_Initialize`) ایجاد شوند. در این موارد، اشتراک‌گذاری اشیاء پایتون" +" بین نمونه‌های ماژول به احتمال زیاد باعث فروپاشی یا رفتار تعریف‌نشده می‌شود." -msgid "To avoid such issues, each instance of an extension module should be *isolated*: changes to one instance should not implicitly affect the others, and all state owned by the module, including references to Python objects, should be specific to a particular module instance. See :ref:`isolating-extensions-howto` for more details and a practical guide." -msgstr "" +msgid "" +"To avoid such issues, each instance of an extension module should be " +"*isolated*: changes to one instance should not implicitly affect the others," +" and all state owned by the module, including references to Python objects, " +"should be specific to a particular module instance. See :ref:`isolating-" +"extensions-howto` for more details and a practical guide." +msgstr "" +"برای پرهیز از چنین مشکلاتی، هر نمونه از یک ماژول توسعه‌ای باید *مجزا* باشد: " +"تغییرات در یک نمونه نباید به‌طور ضمنی بر نمونه‌های دیگر تأثیر بگذارد، و تمام" +" وضعیت‌های متعلق به ماژول، از جمله ارجاع‌ها به اشیاء پایتون، باید مختص به یک" +" نمونه ماژول خاص باشند. برای جزئیات بیشتر و راهنمای عملی، :ref:`isolating-" +"extensions-howto` را ببینید." -msgid "A simpler way to avoid these issues is :ref:`raising an error on repeated initialization `." +msgid "" +"A simpler way to avoid these issues is :ref:`raising an error on repeated " +"initialization `." msgstr "" +"راه ساده‌تر برای اجتناب از این مشکلات، :ref:`ایجاد خطا هنگام مقداردهی " +"اولیه‌ی مکرر ` است." -msgid "All modules are expected to support :ref:`sub-interpreters `, or otherwise explicitly signal a lack of support. This is usually achieved by isolation or blocking repeated initialization, as above. A module may also be limited to the main interpreter using the :c:data:`Py_mod_multiple_interpreters` slot." -msgstr "" +msgid "" +"All modules are expected to support :ref:`sub-interpreters `, or otherwise explicitly signal a lack of support. This is usually" +" achieved by isolation or blocking repeated initialization, as above. A " +"module may also be limited to the main interpreter using the " +":c:data:`Py_mod_multiple_interpreters` slot." +msgstr "" +"انتظار می‌رود تمام ماژول‌ها از :ref:`زیرمفسرها ` " +"پشتیبانی کنند، یا در غیر این صورت، به‌صراحت عدم پشتیبانی خود را اعلام کنند. " +"این کار معمولاً از طریق جداسازی یا مسدود کردن مقداردهی اولیه‌ی مکرر، همان‌طور" +" که در بالا ذکر شد، انجام می‌شود. همچنین ممکن است یک ماژول با استفاده از " +"جایگاه :c:data:`Py_mod_multiple_interpreters` به مفسر اصلی محدود شود." msgid "Initialization function" -msgstr "" +msgstr "تابع مقداردهی اولیه" -msgid "The initialization function defined by an extension module has the following signature:" +msgid "" +"The initialization function defined by an extension module has the following" +" signature:" msgstr "" +"تابع مقدار‌دهی اولیه‌ای که توسط یک ماژول توسعه‌ای تعریف می‌شود، امضای زیر را" +" دارد:" -msgid "Its name should be :samp:`PyInit_{}`, with ```` replaced by the name of the module." +msgid "" +"Its name should be :samp:`PyInit_{}`, with ```` replaced by the " +"name of the module." msgstr "" +"نام آن باید :samp:`PyInit_{}` باشد، که در آن ```` با نام ماژول " +"جایگزین می‌شود." -msgid "For modules with ASCII-only names, the function must instead be named :samp:`PyInit_{}`, with ```` replaced by the name of the module. When using :ref:`multi-phase-initialization`, non-ASCII module names are allowed. In this case, the initialization function name is :samp:`PyInitU_{}`, with ```` encoded using Python's *punycode* encoding with hyphens replaced by underscores. In Python:" -msgstr "" +msgid "" +"For modules with ASCII-only names, the function must instead be named " +":samp:`PyInit_{}`, with ```` replaced by the name of the module." +" When using :ref:`multi-phase-initialization`, non-ASCII module names are " +"allowed. In this case, the initialization function name is " +":samp:`PyInitU_{}`, with ```` encoded using Python's *punycode* " +"encoding with hyphens replaced by underscores. In Python:" +msgstr "" +"برای ماژول‌هایی با نام‌های فقط اسکی، تابع باید در عوض " +":samp:`PyInit_{}` نام‌گذاری شود، که در آن ```` با نام ماژول " +"جایگزین می‌شود. هنگام استفاده از :ref:`multi-phase-initialization`، نام‌های " +"غیراسکی برای ماژول‌ها مجاز هستند. در این حالت، نام تابع مقداردهی اولیه " +":samp:`PyInitU_{}` است، که در آن ```` با استفاده از کدگذاری " +"*punycode* پایتون کدگذاری می‌شود و خط تیره‌ها با زیرخط جایگزین می‌شوند. در " +"پایتون:" msgid "" "def initfunc_name(name):\n" @@ -87,24 +210,34 @@ msgid "" " suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" " return b'PyInit' + suffix" msgstr "" +"def initfunc_name(name):\n" +" try:\n" +" suffix = b'_' + name.encode('ascii')\n" +" except UnicodeEncodeError:\n" +" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" +" return b'PyInit' + suffix" -msgid "It is recommended to define the initialization function using a helper macro:" +msgid "" +"It is recommended to define the initialization function using a helper " +"macro:" msgstr "" +"توصیه می‌شود که تابع مقداردهی اولیه را با استفاده از یک ماکرو کمکی تعریف " +"کنید:" msgid "Declare an extension module initialization function. This macro:" -msgstr "" +msgstr "یک تابع مقداردهی اولیه‌ی ماژول توسعه‌ای را اعلان می‌کند. این ماکرو:" msgid "specifies the :c:expr:`PyObject*` return type," -msgstr "" +msgstr "نوع بازگشتی :c:expr:`PyObject*` را تعیین می‌کند،" msgid "adds any special linkage declarations required by the platform, and" -msgstr "" +msgstr "هرگونه اعلان پیوند خاص مورد نیاز پلتفرم را می‌افزاید و" msgid "for C++, declares the function as ``extern \"C\"``." -msgstr "" +msgstr "برای C++، تابع را به‌صورت ``extern \"C\"`` اعلان می‌کند." msgid "For example, a module called ``spam`` would be defined like this::" -msgstr "" +msgstr "برای مثال، ماژولی به نام ``spam`` به شکل زیر تعریف می‌شود::" msgid "" "static struct PyModuleDef spam_module = {\n" @@ -119,51 +252,141 @@ msgid "" " return PyModuleDef_Init(&spam_module);\n" "}" msgstr "" +"static struct PyModuleDef spam_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"spam\",\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModuleDef_Init(&spam_module);\n" +"}" -msgid "It is possible to export multiple modules from a single shared library by defining multiple initialization functions. However, importing them requires using symbolic links or a custom importer, because by default only the function corresponding to the filename is found. See the `Multiple modules in one library `__ section in :pep:`489` for details." -msgstr "" +msgid "" +"It is possible to export multiple modules from a single shared library by " +"defining multiple initialization functions. However, importing them requires" +" using symbolic links or a custom importer, because by default only the " +"function corresponding to the filename is found. See the `Multiple modules " +"in one library `__ section in :pep:`489` for details." +msgstr "" +"با تعریف چند تابع مقداردهی اولیه می‌توان چند ماژول را از یک کتابخانه اشتراکی" +" واحد صادر کرد. با این حال، ایمپورت کردن آن‌ها مستلزم استفاده از پیوند‌های " +"نمادین یا یک ایمپورت‌کننده سفارشی است، زیرا به‌طور پیش‌فرض تنها تابع متناظر " +"با نام پرونده پیدا می‌شود. برای جزئیات، به بخش `چند ماژول در یک کتابخانه " +"`__ در " +":pep:`489` مراجعه کنید." -msgid "The initialization function is typically the only non-\\ ``static`` item defined in the module's C source." +msgid "" +"The initialization function is typically the only non-\\ ``static`` item " +"defined in the module's C source." msgstr "" +"تابع مقداردهی اولیه معمولاً تنها آیتم غیر\\ ``static`` تعریف‌شده در کد منبع " +"C ماژول است." msgid "Multi-phase initialization" -msgstr "" +msgstr "مقداردهی اولیه چندمرحله‌ای" -msgid "Normally, the :ref:`initialization function ` (``PyInit_modulename``) returns a :c:type:`PyModuleDef` instance with non-``NULL`` :c:member:`~PyModuleDef.m_slots`. Before it is returned, the ``PyModuleDef`` instance must be initialized using the following function:" +msgid "" +"Normally, the :ref:`initialization function ` " +"(``PyInit_modulename``) returns a :c:type:`PyModuleDef` instance with " +"non-``NULL`` :c:member:`~PyModuleDef.m_slots`. Before it is returned, the " +"``PyModuleDef`` instance must be initialized using the following function:" msgstr "" +"معمولاً، :ref:`تابع مقدار‌دهی اولیه ` " +"(``PyInit_modulename``) نمونه‌ای از :c:type:`PyModuleDef` برمی‌گرداند که " +":c:member:`~PyModuleDef.m_slots` آن غیر ``NULL`` است. پیش از آنکه بازگردانده" +" شود، نمونه‌ی ``PyModuleDef`` باید با استفاده از تابع زیر مقدار‌دهی اولیه " +"شود:" -msgid "Ensure a module definition is a properly initialized Python object that correctly reports its type and a reference count." +msgid "" +"Ensure a module definition is a properly initialized Python object that " +"correctly reports its type and a reference count." msgstr "" +"اطمینان حاصل می‌کند که تعریف ماژول، یک شیء پایتونِ به‌درستی مقداردهی‌شده است" +" که نوع و شمارش ارجاع خود را به‌درستی گزارش می‌کند." msgid "Return *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" +"*def* قالب‌ریزی‌شده به ``PyObject*`` را برمی‌گرداند، یا ``NULL`` را در صورت " +"وقوع خطا." -msgid "Calling this function is required for :ref:`multi-phase-initialization`. It should not be used in other contexts." +msgid "" +"Calling this function is required for :ref:`multi-phase-initialization`. It " +"should not be used in other contexts." msgstr "" +"فراخوانی این تابع برای :ref:`multi-phase-initialization` لازم است. این تابع " +"نباید در زمینه‌های دیگر استفاده شود." -msgid "Note that Python assumes that ``PyModuleDef`` structures are statically allocated. This function may return either a new reference or a borrowed one; this reference must not be released." +msgid "" +"Note that Python assumes that ``PyModuleDef`` structures are statically " +"allocated. This function may return either a new reference or a borrowed " +"one; this reference must not be released." msgstr "" +"توجه داشته باشید که پایتون فرض می‌کند ساختارهای ``PyModuleDef`` به‌صورت " +"ایستا تخصیص یافته‌اند. این تابع ممکن است یک ارجاع جدید یا یک ارجاع امانتی " +"برگرداند؛ این ارجاع نباید آزاد شود." msgid "Legacy single-phase initialization" -msgstr "" +msgstr "مقداردهی اولیه تک‌مرحله‌ای قدیمی" -msgid "Single-phase initialization is a legacy mechanism to initialize extension modules, with known drawbacks and design flaws. Extension module authors are encouraged to use multi-phase initialization instead." +msgid "" +"Single-phase initialization is a legacy mechanism to initialize extension " +"modules, with known drawbacks and design flaws. Extension module authors are" +" encouraged to use multi-phase initialization instead." msgstr "" +"راه‌اندازی تک‌فازی (single-phase initialization) سازوکاری قدیمی برای " +"راه‌اندازی ماژول‌های توسعه‌ای است و معایب شناخته‌شده و نقص‌های طراحی دارد. " +"به نویسندگان ماژول‌های توسعه‌ای توصیه می‌شود که به‌جای آن از راه‌اندازی " +"چندفازی (multi-phase initialization) استفاده کنند." -msgid "In single-phase initialization, the :ref:`initialization function ` (``PyInit_modulename``) should create, populate and return a module object. This is typically done using :c:func:`PyModule_Create` and functions like :c:func:`PyModule_AddObjectRef`." +msgid "" +"In single-phase initialization, the :ref:`initialization function " +"` (``PyInit_modulename``) should create, populate and" +" return a module object. This is typically done using " +":c:func:`PyModule_Create` and functions like " +":c:func:`PyModule_AddObjectRef`." msgstr "" +"در مقداردهی اولیه تک‌فازی، :ref:`تابع مقداردهی اولیه ` (``PyInit_modulename``) باید یک شیء ماژول ایجاد کند، آن را پر کند و " +"بازگرداند. این کار معمولاً با استفاده از :c:func:`PyModule_Create` و توابعی " +"مانند :c:func:`PyModule_AddObjectRef` انجام می‌شود." -msgid "Single-phase initialization differs from the :ref:`default ` in the following ways:" +msgid "" +"Single-phase initialization differs from the :ref:`default ` in the following ways:" msgstr "" +"مقداردهی اولیه تک‌فازی در موارد زیر با :ref:`پیش‌فرض ` تفاوت دارد:" msgid "Single-phase modules are, or rather *contain*, “singletons”." msgstr "" +"ماژول‌های تک‌فاز (single-phase) «تک‌نمونه» هستند، یا به بیان دقیق‌تر، *حاوی*" +" «تک‌نمونه» هستند." -msgid "When the module is first initialized, Python saves the contents of the module's ``__dict__`` (that is, typically, the module's functions and types)." +msgid "" +"When the module is first initialized, Python saves the contents of the " +"module's ``__dict__`` (that is, typically, the module's functions and " +"types)." msgstr "" +"هنگامی که ماژول برای نخستین بار مقداردهی اولیه می‌شود، پایتون محتویات " +"``__dict__`` ماژول را ذخیره می‌کند (یعنی، به‌طور معمول، توابع و نوع‌های " +"ماژول)." -msgid "For subsequent imports, Python does not call the initialization function again. Instead, it creates a new module object with a new ``__dict__``, and copies the saved contents to it. For example, given a single-phase module ``_testsinglephase`` [#testsinglephase]_ that defines a function ``sum`` and an exception class ``error``:" -msgstr "" +msgid "" +"For subsequent imports, Python does not call the initialization function " +"again. Instead, it creates a new module object with a new ``__dict__``, and " +"copies the saved contents to it. For example, given a single-phase module " +"``_testsinglephase`` [#testsinglephase]_ that defines a function ``sum`` and" +" an exception class ``error``:" +msgstr "" +"برای ایمپورت‌های بعدی، پایتون تابع مقداردهی اولیه را دوباره فراخوانی " +"نمی‌کند. در عوض، شیء ماژول جدیدی با ``__dict__`` جدید می‌سازد و محتویات " +"ذخیره‌شده را در آن کپی می‌کند. برای مثال، با فرض یک ماژول تک‌فاز " +"``_testsinglephase`` [#testsinglephase]_ که تابعی به نام ``sum`` و کلاس " +"استثنایی به نام ``error`` را تعریف می‌کند:" msgid "" ">>> import sys\n" @@ -179,21 +402,57 @@ msgid "" ">>> one.error is two.error\n" "True" msgstr "" +">>> import sys\n" +">>> import _testsinglephase as one\n" +">>> del sys.modules['_testsinglephase']\n" +">>> import _testsinglephase as two\n" +">>> one is two\n" +"False\n" +">>> one.__dict__ is two.__dict__\n" +"False\n" +">>> one.sum is two.sum\n" +"True\n" +">>> one.error is two.error\n" +"True" -msgid "The exact behavior should be considered a CPython implementation detail." +msgid "" +"The exact behavior should be considered a CPython implementation detail." msgstr "" +"رفتار دقیق باید به‌عنوان جزئیات پیاده‌سازی سی‌پایتون در نظر گرفته شود." -msgid "To work around the fact that ``PyInit_modulename`` does not take a *spec* argument, some state of the import machinery is saved and applied to the first suitable module created during the ``PyInit_modulename`` call. Specifically, when a sub-module is imported, this mechanism prepends the parent package name to the name of the module." -msgstr "" +msgid "" +"To work around the fact that ``PyInit_modulename`` does not take a *spec* " +"argument, some state of the import machinery is saved and applied to the " +"first suitable module created during the ``PyInit_modulename`` call. " +"Specifically, when a sub-module is imported, this mechanism prepends the " +"parent package name to the name of the module." +msgstr "" +"برای دور زدن این واقعیت که ``PyInit_modulename`` آرگومان *مشخصات* نمی‌پذیرد،" +" بخشی از وضعیت سازوکار ایمپورت ذخیره می‌شود و بر نخستین ماژول مناسب " +"ایجاد‌شده در طول فراخوانی ``PyInit_modulename`` اعمال می‌شود. به‌طور خاص، " +"هنگامی که یک زیرماژول ایمپورت می‌شود، این سازوکار نام بسته والد را به ابتدای" +" نام ماژول می‌افزاید." -msgid "A single-phase ``PyInit_modulename`` function should create “its” module object as soon as possible, before any other module objects can be created." +msgid "" +"A single-phase ``PyInit_modulename`` function should create “its” module " +"object as soon as possible, before any other module objects can be created." msgstr "" +"یک تابع تک‌فازه ``PyInit_modulename`` باید شیء ماژول «خود» را در اسرع وقت " +"ایجاد کند، پیش از آن‌که بتوان هر شیء ماژول دیگری را ایجاد کرد." msgid "Non-ASCII module names (``PyInitU_modulename``) are not supported." -msgstr "" +msgstr "نام‌های ماژول غیراسکی (``PyInitU_modulename``) پشتیبانی نمی‌شوند." -msgid "Single-phase modules support module lookup functions like :c:func:`PyState_FindModule`." +msgid "" +"Single-phase modules support module lookup functions like " +":c:func:`PyState_FindModule`." msgstr "" +"ماژول‌های تک‌فازی از توابع جستجوی ماژول مانند :c:func:`PyState_FindModule` " +"پشتیبانی می‌کنند." -msgid "``_testsinglephase`` is an internal module used in CPython's self-test suite; your installation may or may not include it." +msgid "" +"``_testsinglephase`` is an internal module used in CPython's self-test " +"suite; your installation may or may not include it." msgstr "" +"``_testsinglephase`` یک ماژول داخلی است که در مجموعه خودآزمون سی‌پایتون " +"استفاده می‌شود؛ ممکن است نصب شما شامل آن باشد یا نباشد." diff --git a/c-api/file.po b/c-api/file.po index a8a9239a9..52839375b 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -23,94 +23,234 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "File objects" -msgstr "" +msgstr "اشیاء پرونده" -msgid "These APIs are a minimal emulation of the Python 2 C API for built-in file objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support from the C standard library. In Python 3, files and streams use the new :mod:`io` module, which defines several layers over the low-level unbuffered I/O of the operating system. The functions described below are convenience C wrappers over these new APIs, and meant mostly for internal error reporting in the interpreter; third-party code is advised to access the :mod:`io` APIs instead." -msgstr "" +msgid "" +"These APIs are a minimal emulation of the Python 2 C API for built-in file " +"objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support " +"from the C standard library. In Python 3, files and streams use the new " +":mod:`io` module, which defines several layers over the low-level unbuffered" +" I/O of the operating system. The functions described below are convenience" +" C wrappers over these new APIs, and meant mostly for internal error " +"reporting in the interpreter; third-party code is advised to access the " +":mod:`io` APIs instead." +msgstr "" +"این API‌ها شبیه‌سازی حداقلی از C API پایتون 2 برای اشیای پرونده توکار هستند،" +" که پیش‌تر به پشتیبانی ورودی/خروجی بافرشده (:c:expr:`FILE*`) از کتابخانه " +"استاندارد C تکیه داشت. در پایتون 3، پرونده‌ها و جریان‌ها از ماژول جدید " +":mod:`io` استفاده می‌کنند که چندین لایه را روی ورودی/خروجی سطح پایین و بدون " +"بافر سیستم‌عامل تعریف می‌کند. توابعی که در ادامه توضیح داده شده‌اند، " +"پوشش‌های C راحتی روی این API‌های جدید هستند و عمدتاً برای گزارش خطای داخلی " +"در مفسر در نظر گرفته شده‌اند؛ به کد شخص ثالث توصیه می‌شود که به جای آن‌ها به" +" API‌های :mod:`io` دسترسی داشته باشد." -msgid "Create a Python file object from the file descriptor of an already opened file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be ``NULL`` to use the defaults; *buffering* can be *-1* to use the default. *name* is ignored and kept for backward compatibility. Return ``NULL`` on failure. For a more comprehensive description of the arguments, please refer to the :func:`io.open` function documentation." -msgstr "" +msgid "" +"Create a Python file object from the file descriptor of an already opened " +"file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be " +"``NULL`` to use the defaults; *buffering* can be *-1* to use the default. " +"*name* is ignored and kept for backward compatibility. Return ``NULL`` on " +"failure. For a more comprehensive description of the arguments, please refer" +" to the :func:`io.open` function documentation." +msgstr "" +"یک شیء پرونده‌ی پایتون از توصیف‌گر پرونده‌ی از پیش باز‌شده‌ی *fd* ایجاد " +"می‌کند. آرگومان‌های *name*، *encoding*، *errors* و *newline* می‌توانند " +"``NULL`` باشند تا از مقادیر پیش‌فرض استفاده شود؛ *buffering* می‌تواند *-1* " +"باشد تا از مقدار پیش‌فرض استفاده شود. *name* نادیده گرفته می‌شود و برای " +"سازگاری با نسخه‌های قبلی نگه داشته شده است. در صورت شکست، ``NULL`` برگردانده" +" می‌شود. برای توضیحات جامع‌تر درباره‌ی آرگومان‌ها، لطفاً به مستندات تابع " +":func:`io.open` مراجعه کنید." -msgid "Since Python streams have their own buffering layer, mixing them with OS-level file descriptors can produce various issues (such as unexpected ordering of data)." +msgid "" +"Since Python streams have their own buffering layer, mixing them with OS-" +"level file descriptors can produce various issues (such as unexpected " +"ordering of data)." msgstr "" +"از آنجا که جریان‌های پایتون لایه بافرینگ اختصاصی خود را دارند، ترکیب آن‌ها " +"با توصیف‌گرهای پرونده در سطح سیستم‌عامل می‌تواند مشکلات گوناگونی (مانند " +"ترتیب غیرمنتظره داده‌ها) ایجاد کند." msgid "Ignore *name* attribute." -msgstr "" +msgstr "ویژگی *name* را نادیده بگیرید." -msgid "Return the file descriptor associated with *p* as an :c:expr:`int`. If the object is an integer, its value is returned. If not, the object's :meth:`~io.IOBase.fileno` method is called if it exists; the method must return an integer, which is returned as the file descriptor value. Sets an exception and returns ``-1`` on failure." -msgstr "" +msgid "" +"Return the file descriptor associated with *p* as an :c:expr:`int`. If the " +"object is an integer, its value is returned. If not, the object's " +":meth:`~io.IOBase.fileno` method is called if it exists; the method must " +"return an integer, which is returned as the file descriptor value. Sets an " +"exception and returns ``-1`` on failure." +msgstr "" +"توصیف‌گر پرونده (file descriptor) مرتبط با *p* را به‌صورت :c:expr:`int` " +"برمی‌گرداند. اگر شیء یک عدد صحیح باشد، مقدار آن برگردانده می‌شود. در غیر این" +" صورت، متد :meth:`~io.IOBase.fileno` شیء در صورت وجود فراخوانی می‌شود؛ این " +"متد باید یک عدد صحیح برگرداند که به‌عنوان مقدار توصیف‌گر پرونده برگردانده " +"می‌شود. در صورت شکست، یک استثنا تنظیم می‌کند و ``-1`` برمی‌گرداند." -msgid "Equivalent to ``p.readline([n])``, this function reads one line from the object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase.readline` method. If *n* is ``0``, exactly one line is read, regardless of the length of the line. If *n* is greater than ``0``, no more than *n* bytes will be read from the file; a partial line can be returned. In both cases, an empty string is returned if the end of the file is reached immediately. If *n* is less than ``0``, however, one line is read regardless of length, but :exc:`EOFError` is raised if the end of the file is reached immediately." -msgstr "" +msgid "" +"Equivalent to ``p.readline([n])``, this function reads one line from the " +"object *p*. *p* may be a file object or any object with a " +":meth:`~io.IOBase.readline` method. If *n* is ``0``, exactly one line is " +"read, regardless of the length of the line. If *n* is greater than ``0``, " +"no more than *n* bytes will be read from the file; a partial line can be " +"returned. In both cases, an empty string is returned if the end of the file" +" is reached immediately. If *n* is less than ``0``, however, one line is " +"read regardless of length, but :exc:`EOFError` is raised if the end of the " +"file is reached immediately." +msgstr "" +"این تابع معادل ``p.readline([n])`` است و یک سطر از شیء *p* می‌خواند. *p* " +"می‌تواند یک شیء پرونده یا هر شیء دارای متد :meth:`~io.IOBase.readline` باشد." +" اگر *n* برابر ``0`` باشد، دقیقاً یک سطر خوانده می‌شود، بدون توجه به طول " +"سطر. اگر *n* بزرگ‌تر از ``0`` باشد، بیش از *n* بایت از پرونده خوانده " +"نمی‌شود؛ ممکن است سطر ناقصی برگردانده شود. در هر دو حالت، اگر بلافاصله به " +"پایان پرونده برسیم، رشته‌ای خالی برگردانده می‌شود. اما اگر *n* کوچک‌تر از " +"``0`` باشد، یک سطر بدون توجه به طول خوانده می‌شود، ولی اگر بلافاصله به پایان" +" پرونده برسیم، :exc:`EOFError` پرتاب می‌شود." -msgid "Overrides the normal behavior of :func:`io.open_code` to pass its parameter through the provided handler." +msgid "" +"Overrides the normal behavior of :func:`io.open_code` to pass its parameter " +"through the provided handler." msgstr "" +"رفتار عادی :func:`io.open_code` را بازتعریف می‌کند تا پارامتر خود را از " +"هندلر ارائه‌شده عبور دهد." msgid "The *handler* is a function of type:" -msgstr "" +msgstr "*هندلر* تابعی از نوع زیر است:" -msgid "Equivalent of :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`." +msgid "" +"Equivalent of :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)`, " +"where *path* is guaranteed to be :c:type:`PyUnicodeObject`." msgstr "" +"معادل :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)` است که در آن" +" تضمین می‌شود *path* از نوع :c:type:`PyUnicodeObject` باشد." -msgid "The *userData* pointer is passed into the hook function. Since hook functions may be called from different runtimes, this pointer should not refer directly to Python state." +msgid "" +"The *userData* pointer is passed into the hook function. Since hook " +"functions may be called from different runtimes, this pointer should not " +"refer directly to Python state." msgstr "" +"اشاره‌گر *userData* به تابع قلاب پاس داده می‌شود. از آنجا که توابع قلاب ممکن" +" است از ران‌تایم‌های مختلف فراخوانی شوند، این اشاره‌گر نباید مستقیماً به " +"وضعیت پایتون اشاره کند." -msgid "As this hook is intentionally used during import, avoid importing new modules during its execution unless they are known to be frozen or available in ``sys.modules``." +msgid "" +"As this hook is intentionally used during import, avoid importing new " +"modules during its execution unless they are known to be frozen or available" +" in ``sys.modules``." msgstr "" +"از آنجا که این قلاب عمداً در زمان ایمپورت استفاده می‌شود، از ایمپورت کردن " +"ماژول‌های جدید در حین اجرای آن خودداری کنید، مگر آنکه مشخص باشد که منجمد " +"(frozen) هستند یا در ``sys.modules`` موجود هستند." -msgid "Once a hook has been set, it cannot be removed or replaced, and later calls to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function returns -1 and sets an exception if the interpreter has been initialized." -msgstr "" +msgid "" +"Once a hook has been set, it cannot be removed or replaced, and later calls " +"to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function " +"returns -1 and sets an exception if the interpreter has been initialized." +msgstr "" +"پس از آنکه یک قلاب تنظیم شده باشد، نمی‌توان آن را حذف یا جایگزین کرد و " +"فراخوانی‌های بعدی :c:func:`PyFile_SetOpenCodeHook` شکست خواهند خورد. در صورت" +" شکست، تابع مقدار -1 را برمی‌گرداند و اگر مفسر مقداردهی اولیه شده باشد، یک " +"استثنا تنظیم می‌کند." msgid "This function is safe to call before :c:func:`Py_Initialize`." -msgstr "" +msgstr "فراخوانی این تابع پیش از :c:func:`Py_Initialize` ایمن است." -msgid "Raises an :ref:`auditing event ` ``setopencodehook`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``setopencodehook`` with no " +"arguments." msgstr "" +":ref:`رویداد حسابرسی ` ``setopencodehook`` را بدون هیچ آرگومانی " +"ایجاد می‌کند." -msgid "Open *path* with the mode ``'rb'``. *path* must be a Python :class:`str` object. The behavior of this function may be overridden by :c:func:`PyFile_SetOpenCodeHook` to allow for some preprocessing of the text." -msgstr "" +msgid "" +"Open *path* with the mode ``'rb'``. *path* must be a Python :class:`str` " +"object. The behavior of this function may be overridden by " +":c:func:`PyFile_SetOpenCodeHook` to allow for some preprocessing of the " +"text." +msgstr "" +"*path* را با حالت ``'rb'`` باز می‌کند. *path* باید یک شیء :class:`str` " +"پایتون باشد. رفتار این تابع ممکن است توسط :c:func:`PyFile_SetOpenCodeHook` " +"بازنویسی شود تا امکان انجام پیش‌پردازش‌هایی روی متن فراهم شود." msgid "This is analogous to :func:`io.open_code` in Python." -msgstr "" +msgstr "این مشابه :func:`io.open_code` در پایتون است." -msgid "On success, this function returns a :term:`strong reference` to a Python file object. On failure, this function returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to a Python " +"file object. On failure, this function returns ``NULL`` with an exception " +"set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`strong reference` به یک شیء پرونده‌ی " +"پایتون برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را همراه با یک استثنای " +"تنظیم‌شده برمی‌گرداند." -msgid "Similar to :c:func:`PyFile_OpenCodeObject`, but *path* is a UTF-8 encoded :c:expr:`const char*`." +msgid "" +"Similar to :c:func:`PyFile_OpenCodeObject`, but *path* is a UTF-8 encoded " +":c:expr:`const char*`." msgstr "" +"مشابه :c:func:`PyFile_OpenCodeObject`، اما *path* یک :c:expr:`const char*` " +"کدگذاری‌شده با UTF-8 است." -msgid "Write object *obj* to file object *p*. The only supported flag for *flags* is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written instead of the :func:`repr`." +msgid "" +"Write object *obj* to file object *p*. The only supported flag for *flags* " +"is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is " +"written instead of the :func:`repr`." msgstr "" +"شیء *obj* را در شیء پرونده *p* می‌نویسد. تنها پرچم پشتیبانی‌شده برای " +"*flags*، :c:macro:`Py_PRINT_RAW` است؛ در صورت ارائه، :func:`str` شیء به‌جای " +":func:`repr` آن نوشته می‌شود." msgid "If *obj* is ``NULL``, write the string ``\"\"``." -msgstr "" +msgstr "اگر *obj* برابر ``NULL`` باشد، رشته‌ی ``\"\"`` نوشته می‌شود." -msgid "Return ``0`` on success or ``-1`` on failure; the appropriate exception will be set." +msgid "" +"Return ``0`` on success or ``-1`` on failure; the appropriate exception will" +" be set." msgstr "" +"در صورت موفقیت ``0`` و در صورت شکست ``-1`` را برمی‌گرداند؛ استثنای مناسب " +"تنظیم خواهد شد." -msgid "Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on failure; the appropriate exception will be set." +msgid "" +"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on " +"failure; the appropriate exception will be set." msgstr "" +"رشته *s* را در شیء پرونده *p* می‌نویسد. در صورت موفقیت ``0`` و در صورت شکست " +"``-1`` برمی‌گرداند؛ استثنای مناسب تنظیم خواهد شد." msgid "Soft-deprecated API" -msgstr "" +msgstr "API نیمه‌منسوخ (soft-deprecated)" -msgid "These are APIs that were included in Python's C API by mistake. They are documented solely for completeness; use other ``PyFile*`` APIs instead." +msgid "" +"These are APIs that were included in Python's C API by mistake. They are " +"documented solely for completeness; use other ``PyFile*`` APIs instead." msgstr "" +"این‌ها API‌هایی هستند که به اشتباه در C API پایتون گنجانده شده‌اند. آن‌ها " +"صرفاً برای کامل بودن مستند شده‌اند؛ به جای آن‌ها از سایر API‌های ``PyFile*``" +" استفاده کنید." -msgid "Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, \"w\", -1, NULL, NULL, NULL, 0``) instead." +msgid "" +"Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, \"w\", -1, NULL, " +"NULL, NULL, 0``) instead." msgstr "" +"به جای آن، از :c:func:`PyFile_FromFd` با مقادیر پیش‌فرض (``fd, NULL, \"w\", " +"-1, NULL, NULL, NULL, 0``) استفاده کنید." -msgid "Type of file-like objects used internally at Python startup when :py:mod:`io` is not yet available. Use Python :py:func:`open` or :c:func:`PyFile_FromFd` to create file objects instead." -msgstr "" +msgid "" +"Type of file-like objects used internally at Python startup when " +":py:mod:`io` is not yet available. Use Python :py:func:`open` or " +":c:func:`PyFile_FromFd` to create file objects instead." +msgstr "" +"نوع اشیای شبه‌پرونده‌ای که در زمان راه‌اندازی پایتون، هنگامی که " +":py:mod:`io` هنوز در دسترس نیست، به‌طور داخلی استفاده می‌شوند. به‌جای آن، " +"برای ایجاد اشیای پرونده از :py:func:`open` پایتون یا " +":c:func:`PyFile_FromFd` استفاده کنید." msgid "object" -msgstr "" +msgstr "شیء" msgid "file" -msgstr "" +msgstr "پرونده" msgid "EOFError (built-in exception)" -msgstr "" +msgstr "EOFError (استثنای توکار)" msgid "Py_PRINT_RAW (C macro)" -msgstr "" +msgstr "Py_PRINT_RAW (ماکروی C)" diff --git a/c-api/float.po b/c-api/float.po index 55d61abdf..7ebac0c8d 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -23,175 +23,367 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Floating-Point Objects" -msgstr "" +msgstr "اشیاء ممیز شناور" -msgid "This subtype of :c:type:`PyObject` represents a Python floating-point object." +msgid "" +"This subtype of :c:type:`PyObject` represents a Python floating-point " +"object." msgstr "" +"این زیرنوع از :c:type:`PyObject` نمایانگر یک شیء ممیز شناور پایتون است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python floating-point type. This is the same object as :class:`float` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python floating-point" +" type. This is the same object as :class:`float` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع ممیز شناور پایتون را نشان می‌دهد. " +"این همان شیء :class:`float` در لایه‌ی پایتون است." -msgid "Return true if its argument is a :c:type:`PyFloatObject` or a subtype of :c:type:`PyFloatObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyFloatObject` or a subtype of " +":c:type:`PyFloatObject`. This function always succeeds." msgstr "" +"اگر آرگومان آن یک :c:type:`PyFloatObject` یا زیرنوعی از " +":c:type:`PyFloatObject` باشد، مقدار درست را برمی‌گرداند. این تابع همیشه با " +"موفقیت انجام می‌شود." -msgid "Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype of :c:type:`PyFloatObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype " +"of :c:type:`PyFloatObject`. This function always succeeds." msgstr "" +"اگر آرگومان آن یک :c:type:`PyFloatObject` باشد، اما زیرنوعی از " +":c:type:`PyFloatObject` نباشد، مقدار true برمی‌گرداند. این تابع همیشه موفق " +"می‌شود." -msgid "Create a :c:type:`PyFloatObject` object based on the string value in *str*, or ``NULL`` on failure." +msgid "" +"Create a :c:type:`PyFloatObject` object based on the string value in *str*, " +"or ``NULL`` on failure." msgstr "" +"ایجاد یک شیء :c:type:`PyFloatObject` بر اساس مقدار رشته در *str*، یا " +"``NULL`` در صورت شکست." -msgid "Create a :c:type:`PyFloatObject` object from *v*, or ``NULL`` on failure." +msgid "" +"Create a :c:type:`PyFloatObject` object from *v*, or ``NULL`` on failure." msgstr "" +"یک شیء :c:type:`PyFloatObject` از *v* می‌سازد، یا در صورت شکست ``NULL``." -msgid "Return a C :c:expr:`double` representation of the contents of *pyfloat*. If *pyfloat* is not a Python floating-point object but has a :meth:`~object.__float__` method, this method will first be called to convert *pyfloat* into a float. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one should call :c:func:`PyErr_Occurred` to check for errors." -msgstr "" +msgid "" +"Return a C :c:expr:`double` representation of the contents of *pyfloat*. If" +" *pyfloat* is not a Python floating-point object but has a " +":meth:`~object.__float__` method, this method will first be called to " +"convert *pyfloat* into a float. If :meth:`!__float__` is not defined then it" +" falls back to :meth:`~object.__index__`. This method returns ``-1.0`` upon " +"failure, so one should call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" +"یک نمایش :c:expr:`double` در C از محتویات *pyfloat* برمی‌گرداند. اگر " +"*pyfloat* یک شیء ممیز شناور پایتون نباشد اما متد :meth:`~object.__float__` " +"را داشته باشد، این متد ابتدا برای تبدیل *pyfloat* به یک عدد ممیز شناور " +"فراخوانی می‌شود. اگر :meth:`!__float__` تعریف‌نشده باشد، به " +":meth:`~object.__index__` بازمی‌گردد. این متد در صورت شکست ``-1.0`` را " +"برمی‌گرداند، بنابراین برای بررسی خطاها باید :c:func:`PyErr_Occurred` را " +"فراخوانی کنید." msgid "Use :meth:`~object.__index__` if available." -msgstr "" +msgstr "در صورت وجود، از :meth:`~object.__index__` استفاده کنید." -msgid "Return a C :c:expr:`double` representation of the contents of *pyfloat*, but without error checking." +msgid "" +"Return a C :c:expr:`double` representation of the contents of *pyfloat*, but" +" without error checking." msgstr "" +"نمایش C :c:expr:`double` از محتویات *pyfloat* را برمی‌گرداند، اما بدون بررسی" +" خطا." -msgid "Return a structseq instance which contains information about the precision, minimum and maximum values of a float. It's a thin wrapper around the header file :file:`float.h`." +msgid "" +"Return a structseq instance which contains information about the precision, " +"minimum and maximum values of a float. It's a thin wrapper around the header" +" file :file:`float.h`." msgstr "" +"یک نمونه از دنباله ساختاری برمی‌گرداند که اطلاعاتی درباره‌ی دقت و مقادیر " +"کمینه و بیشینه‌ی یک عدد ممیز شناور در بر دارد. این یک دربرگیرنده‌ی نازک حول " +"پرونده‌ی سرآیند :file:`float.h` است." -msgid "Return the maximum representable finite float *DBL_MAX* as C :c:expr:`double`." +msgid "" +"Return the maximum representable finite float *DBL_MAX* as C " +":c:expr:`double`." msgstr "" +"بزرگ‌ترین عدد ممیز شناور محدود قابل نمایش *DBL_MAX* را به‌صورت " +":c:expr:`double` در C برمی‌گرداند." -msgid "Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." +msgid "" +"Return the minimum normalized positive float *DBL_MIN* as C " +":c:expr:`double`." msgstr "" +"کمترین عدد اعشاری مثبت نرمال‌شده *DBL_MIN* را به‌صورت :c:expr:`double` در C " +"برمی‌گرداند." -msgid "This macro expands to a constant expression of type :c:expr:`double`, that represents the positive infinity." +msgid "" +"This macro expands to a constant expression of type :c:expr:`double`, that " +"represents the positive infinity." msgstr "" +"این ماکرو به یک عبارت ثابت از نوع :c:expr:`double` بسط می‌یابد که بی‌نهایت " +"مثبت را نشان می‌دهد." -msgid "On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard ```` header." +msgid "" +"On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from" +" the C11 standard ```` header." msgstr "" +"در بیشتر پلتفرم‌ها، این معادل ماکروی :c:macro:`!INFINITY` از سرآیند " +"```` استاندارد C11 است." -msgid "This macro expands to a constant expression of type :c:expr:`double`, that represents a quiet not-a-number (qNaN) value." +msgid "" +"This macro expands to a constant expression of type :c:expr:`double`, that " +"represents a quiet not-a-number (qNaN) value." msgstr "" +"این ماکرو به عبارت ثابتی از نوع :c:expr:`double` بسط می‌یابد که نشان‌دهنده‌ی" +" مقدار عدد-نیست ساکت (qNaN) است." -msgid "On most platforms, this is equivalent to the :c:macro:`!NAN` macro from the C11 standard ```` header." +msgid "" +"On most platforms, this is equivalent to the :c:macro:`!NAN` macro from the " +"C11 standard ```` header." msgstr "" +"در بیشتر پلتفرم‌ها، این معادل ماکروی :c:macro:`!NAN` از سرآیند ```` " +"استاندارد C11 است." msgid "Equivalent to :c:macro:`!INFINITY`." -msgstr "" +msgstr "معادل :c:macro:`!INFINITY` است." msgid "The macro is :term:`soft deprecated`." -msgstr "" +msgstr "این ماکرو :term:`soft deprecated` است." -msgid "The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant." -msgstr "" +msgid "" +"The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` " +"constant." +msgstr "تعریف ثابت :data:`math.e` (دقیق برای نوع :c:expr:`double`)." msgid "High precision (long double) definition of :data:`~math.e` constant." -msgstr "" +msgstr "تعریف با دقت بالا (long double) ثابت :data:`~math.e`." -msgid "The definition (accurate for a :c:expr:`double` type) of the :data:`math.pi` constant." -msgstr "" +msgid "" +"The definition (accurate for a :c:expr:`double` type) of the :data:`math.pi`" +" constant." +msgstr "تعریف ثابت :data:`math.pi` (که برای نوع :c:expr:`double` دقیق است)." msgid "High precision (long double) definition of :data:`~math.pi` constant." -msgstr "" +msgstr "تعریف ثابت :data:`~math.pi` با دقت بالا (long double)." -msgid "The definition (accurate for a :c:expr:`double` type) of the :data:`math.tau` constant." -msgstr "" +msgid "" +"The definition (accurate for a :c:expr:`double` type) of the " +":data:`math.tau` constant." +msgstr "تعریف ثابت :data:`math.tau` (دقیق برای نوع :c:expr:`double`)." msgid "Return :data:`math.nan` from a function." -msgstr "" +msgstr "برگرداندن :data:`math.nan` از یک تابع." -msgid "On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``." -msgstr "" +msgid "" +"On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``." +msgstr "در اکثر پلتفرم‌ها، این معادل ``return PyFloat_FromDouble(NAN)`` است." -msgid "Return :data:`math.inf` or :data:`-math.inf ` from a function, depending on the sign of *sign*." +msgid "" +"Return :data:`math.inf` or :data:`-math.inf ` from a function, " +"depending on the sign of *sign*." msgstr "" +"برگرداندن :data:`math.inf` یا :data:`-math.inf ` از یک تابع، بسته " +"به علامت *sign*." msgid "On most platforms, this is equivalent to the following::" -msgstr "" +msgstr "در اغلب پلتفرم‌ها، این معادل موارد زیر است::" msgid "return PyFloat_FromDouble(copysign(INFINITY, sign));" -msgstr "" +msgstr "return PyFloat_FromDouble(copysign(INFINITY, sign));" -msgid "Return ``1`` if the given floating-point number *X* is finite, that is, it is normal, subnormal or zero, but not infinite or NaN. Return ``0`` otherwise." +msgid "" +"Return ``1`` if the given floating-point number *X* is finite, that is, it " +"is normal, subnormal or zero, but not infinite or NaN. Return ``0`` " +"otherwise." msgstr "" +"اگر عدد ممیز شناور داده‌شده *X* متناهی باشد، یعنی نرمال، زیرنرمال یا صفر " +"باشد، اما بی‌نهایت یا NaN نباشد، ``1`` را برمی‌گرداند. در غیر این صورت ``0``" +" را برمی‌گرداند." -msgid "The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead." +msgid "" +"The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead." msgstr "" +"این ماکرو :term:`نرم‌منسوخ (soft deprecated) ` است. به‌جای " +"آن از :c:macro:`!isfinite` استفاده کنید." -msgid "Return ``1`` if the given floating-point number *X* is positive or negative infinity. Return ``0`` otherwise." +msgid "" +"Return ``1`` if the given floating-point number *X* is positive or negative " +"infinity. Return ``0`` otherwise." msgstr "" +"اگر عدد ممیز شناورِ داده‌شده‌ی *X* بی‌نهایت مثبت یا منفی باشد، ``1`` را " +"برمی‌گرداند. در غیر این صورت ``0`` را برمی‌گرداند." msgid "The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead." msgstr "" +"این ماکرو :term:`منسوخ نرم ` است. به‌جای آن از " +":c:macro:`!isinf` استفاده کنید." -msgid "Return ``1`` if the given floating-point number *X* is a not-a-number (NaN) value. Return ``0`` otherwise." +msgid "" +"Return ``1`` if the given floating-point number *X* is a not-a-number (NaN) " +"value. Return ``0`` otherwise." msgstr "" +"اگر عدد ممیز شناورِ داده‌شده‌ی *X* مقداری غیرعددی (NaN) باشد، ``1`` را " +"برمی‌گرداند. در غیر این صورت ``0`` را برمی‌گرداند." msgid "The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead." msgstr "" +"این ماکرو :term:`soft deprecated` است. به‌جای آن از :c:macro:`!isnan` " +"استفاده کنید." msgid "Pack and Unpack functions" -msgstr "" +msgstr "توابع بسته‌بندی و بسته‌گشایی" -msgid "The pack and unpack functions provide an efficient platform-independent way to store floating-point values as byte strings. The Pack routines produce a bytes string from a C :c:expr:`double`, and the Unpack routines produce a C :c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies the number of bytes in the bytes string." -msgstr "" +msgid "" +"The pack and unpack functions provide an efficient platform-independent way " +"to store floating-point values as byte strings. The Pack routines produce a " +"bytes string from a C :c:expr:`double`, and the Unpack routines produce a C " +":c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies " +"the number of bytes in the bytes string." +msgstr "" +"توابع pack و unpack راهی کارآمد و مستقل از پلتفرم برای ذخیره‌سازی مقادیر " +"ممیز شناور به‌صورت رشته‌های بایتی فراهم می‌کنند. روال‌های Pack از یک " +":c:expr:`double` در C یک رشته بایتی تولید می‌کنند و روال‌های Unpack از چنین " +"رشته بایتی، یک :c:expr:`double` در C تولید می‌کنند. پسوند (۲، ۴ یا ۸) تعداد " +"بایت‌های رشته بایتی را مشخص می‌کند." -msgid "On platforms that appear to use IEEE 754 formats these functions work by copying bits. On other platforms, the 2-byte format is identical to the IEEE 754 binary16 half-precision format, the 4-byte format (32-bit) is identical to the IEEE 754 binary32 single precision format, and the 8-byte format to the IEEE 754 binary64 double precision format, although the packing of INFs and NaNs (if such things exist on the platform) isn't handled correctly, and attempting to unpack a bytes string containing an IEEE INF or NaN will raise an exception." -msgstr "" +msgid "" +"On platforms that appear to use IEEE 754 formats these functions work by " +"copying bits. On other platforms, the 2-byte format is identical to the IEEE" +" 754 binary16 half-precision format, the 4-byte format (32-bit) is identical" +" to the IEEE 754 binary32 single precision format, and the 8-byte format to " +"the IEEE 754 binary64 double precision format, although the packing of INFs " +"and NaNs (if such things exist on the platform) isn't handled correctly, and" +" attempting to unpack a bytes string containing an IEEE INF or NaN will " +"raise an exception." +msgstr "" +"در پلتفرم‌هایی که به نظر می‌رسد از قالب‌های IEEE 754 استفاده می‌کنند، این " +"توابع با کپی کردن بیت‌ها کار می‌کنند. در پلتفرم‌های دیگر، قالب ۲ بایتی با " +"قالب دقت نصف binary16 در IEEE 754 یکسان است، قالب ۴ بایتی (۳۲ بیتی) با قالب " +"دقت منفرد binary32 در IEEE 754 یکسان است و قالب ۸ بایتی با قالب دقت مضاعف " +"binary64 در IEEE 754 یکسان است؛ هرچند بسته‌بندی مقادیر INF و NaN (اگر چنین " +"مقادیری در پلتفرم وجود داشته باشند) به‌درستی مدیریت نمی‌شود و تلاش برای " +"واگشایی رشته بایتی حاوی INF یا NaN مطابق با IEEE، منجر به ایجاد استثنا " +"می‌شود." -msgid "Note that NaN type may not be preserved on IEEE platforms (signaling NaNs become quiet NaNs), for example on x86 systems in 32-bit mode." +msgid "" +"Note that NaN type may not be preserved on IEEE platforms (signaling NaNs " +"become quiet NaNs), for example on x86 systems in 32-bit mode." msgstr "" +"توجه داشته باشید که نوع NaN ممکن است روی سکوهای IEEE حفظ نشود (NaNهای " +"علامت‌دهنده (signaling NaN) به NaNهای خاموش (quiet NaN) تبدیل می‌شوند)، برای" +" مثال روی سیستم‌های x86 در حالت ۳۲ بیتی." -msgid "On non-IEEE platforms with more precision, or larger dynamic range, than IEEE 754 supports, not all values can be packed; on non-IEEE platforms with less precision, or smaller dynamic range, not all values can be unpacked. What happens in such cases is partly accidental (alas)." +msgid "" +"On non-IEEE platforms with more precision, or larger dynamic range, than " +"IEEE 754 supports, not all values can be packed; on non-IEEE platforms with " +"less precision, or smaller dynamic range, not all values can be unpacked. " +"What happens in such cases is partly accidental (alas)." msgstr "" +"در پلتفرم‌های غیر IEEE که دقتی بیشتر از آنچه IEEE 754 از آن پشتیبانی می‌کند " +"دارند، یا گستره پویایی بزرگ‌تری دارند، نمی‌توان همه مقادیر را بسته‌بندی کرد؛" +" در پلتفرم‌های غیر IEEE با دقت کمتر، یا گستره پویایی کوچک‌تر، نمی‌توان همه " +"مقادیر را واگشایی کرد. آنچه در چنین مواردی رخ می‌دهد تا حدی اتفاقی است " +"(متأسفانه)." msgid "Pack functions" -msgstr "" +msgstr "توابع بسته‌بندی" -msgid "The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:`int` argument, non-zero if you want the bytes string in little-endian format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal to ``1`` on big endian processor, or ``0`` on little endian processor." -msgstr "" +msgid "" +"The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an " +":c:expr:`int` argument, non-zero if you want the bytes string in little-" +"endian format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), " +"zero if you want big-endian format (exponent first, at *p*). The " +":c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it " +"is equal to ``1`` on big endian processor, or ``0`` on little endian " +"processor." +msgstr "" +"روال‌های بسته‌بندی ۲، ۴ یا ۸ بایت را با شروع از *p* می‌نویسند. *le* یک " +"آرگومان :c:expr:`int` است؛ اگر می‌خواهید رشته بایتی در قالب کوچک‌اندیان " +"باشد، ناصفر است (توان در انتها، در ``p+1``، ``p+3``، یا ``p+6`` و ``p+7``)، " +"و اگر قالب بزرگ‌اندیان را می‌خواهید، صفر است (توان در ابتدا، در *p*). برای " +"استفاده از اندیان بومی می‌توان از ثابت :c:macro:`PY_BIG_ENDIAN` بهره گرفت: " +"این ثابت روی پردازنده‌های بزرگ‌اندیان برابر ``1`` و روی پردازنده‌های " +"کوچک‌اندیان برابر ``0`` است." -msgid "Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set, most likely :exc:`OverflowError`)." +msgid "" +"Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set, " +"most likely :exc:`OverflowError`)." msgstr "" +"مقدار بازگشتی: ``0`` در صورت موفقیت، ``-1`` در صورت خطا (و استثنا تنظیم‌شده " +"است، به احتمال زیاد :exc:`OverflowError`)." msgid "There are two problems on non-IEEE platforms:" -msgstr "" +msgstr "دو مشکل در پلتفرم‌های غیر IEEE وجود دارد:" msgid "What this does is undefined if *x* is a NaN or infinity." msgstr "" +"اگر *x* یک NaN یا بی‌نهایت باشد، آنچه این انجام می‌دهد تعریف‌نشده است." msgid "``-0.0`` and ``+0.0`` produce the same bytes string." -msgstr "" +msgstr "``-0.0`` و ``+0.0`` همان رشته بایت را تولید می‌کنند." msgid "Pack a C double as the IEEE 754 binary16 half-precision format." msgstr "" +"یک ممیز شناور با دقت مضاعف در C را به قالب binary16 با دقت نصف IEEE 754 " +"بسته‌بندی می‌کند." msgid "Pack a C double as the IEEE 754 binary32 single precision format." msgstr "" +"یک ممیز شناور با دقت مضاعف در C را به قالب IEEE 754 binary32 با دقت منفرد " +"بسته‌بندی می‌کند." msgid "Pack a C double as the IEEE 754 binary64 double precision format." msgstr "" +"یک double زبان C را به قالب دقت مضاعف binary64 استاندارد IEEE 754 بسته‌بندی " +"می‌کند." msgid "Unpack functions" -msgstr "" +msgstr "توابع واگشایی" -msgid "The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:`int` argument, non-zero if the bytes string is in little-endian format (exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal to ``1`` on big endian processor, or ``0`` on little endian processor." -msgstr "" +msgid "" +"The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an " +":c:expr:`int` argument, non-zero if the bytes string is in little-endian " +"format (exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if " +"big-endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant " +"can be used to use the native endian: it is equal to ``1`` on big endian " +"processor, or ``0`` on little endian processor." +msgstr "" +"روال‌های واگشایی ۲، ۴ یا ۸ بایت را با شروع از *p* می‌خوانند. *le* یک آرگومان" +" :c:expr:`int` است؛ اگر رشته بایتی در قالب کوچک‌اندیان باشد، ناصفر است (نما " +"در انتها، در ``p+1``، ``p+3`` یا ``p+6`` و ``p+7``)، و اگر بزرگ‌اندیان باشد،" +" صفر است (نما در ابتدا، در *p*). می‌توان ثابت :c:macro:`PY_BIG_ENDIAN` را " +"برای بهره‌گیری از اندیان بومی به کار برد: این ثابت روی پردازنده‌ی " +"بزرگ‌اندیان برابر ``1``، یا روی پردازنده‌ی کوچک‌اندیان برابر ``0`` است." -msgid "Return value: The unpacked double. On error, this is ``-1.0`` and :c:func:`PyErr_Occurred` is true (and an exception is set, most likely :exc:`OverflowError`)." +msgid "" +"Return value: The unpacked double. On error, this is ``-1.0`` and " +":c:func:`PyErr_Occurred` is true (and an exception is set, most likely " +":exc:`OverflowError`)." msgstr "" +"مقدار بازگشتی: ممیز شناور با دقت مضاعفِ واگشایی‌شده. در صورت خطا، این مقدار " +"``-1.0`` است و :c:func:`PyErr_Occurred` درست است (و استثنایی تنظیم‌شده است " +"که به احتمال زیاد :exc:`OverflowError` است)." -msgid "Note that on a non-IEEE platform this will refuse to unpack a bytes string that represents a NaN or infinity." +msgid "" +"Note that on a non-IEEE platform this will refuse to unpack a bytes string " +"that represents a NaN or infinity." msgstr "" +"توجه داشته باشید که روی یک پلتفرم غیر IEEE، این از واگشایی کردن رشته‌ی بایتی" +" که نمایانگر NaN یا بی‌نهایت است، خودداری خواهد کرد." msgid "Unpack the IEEE 754 binary16 half-precision format as a C double." msgstr "" +"قالب IEEE 754 binary16 با دقت نصف را به‌صورت یک double در C واگشایی می‌کند." msgid "Unpack the IEEE 754 binary32 single precision format as a C double." -msgstr "" +msgstr "واگشایی کردن قالب دقت منفرد binary32 از IEEE 754 به‌صورت double در C." msgid "Unpack the IEEE 754 binary64 double precision format as a C double." msgstr "" +"قالب دقت مضاعف binary64 در استاندارد IEEE 754 را به‌صورت یک double در C " +"واگشایی می‌کند." msgid "object" -msgstr "" +msgstr "شیء" msgid "floating-point" -msgstr "" +msgstr "ممیز شناور" diff --git a/c-api/frame.po b/c-api/frame.po index 434725255..eda07a9c5 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -24,181 +24,298 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Frame objects" -msgstr "" +msgstr "اشیای قاب" msgid "The C structure of the objects used to describe frame objects." -msgstr "" +msgstr "ساختار C اشیایی که برای توصیف اشیاء فریم استفاده می‌شوند." msgid "There are no public members in this structure." -msgstr "" +msgstr "هیچ عضو عمومی در این ساختار وجود ندارد." -msgid "The members of this structure were removed from the public C API. Refer to the :ref:`What's New entry ` for details." +msgid "" +"The members of this structure were removed from the public C API. Refer to " +"the :ref:`What's New entry ` for details." msgstr "" +"اعضای این ساختار از API عمومی C حذف شدند. برای جزئیات، به :ref:`مدخل «What's" +" New» ` مراجعه کنید." -msgid "The :c:func:`PyEval_GetFrame` and :c:func:`PyThreadState_GetFrame` functions can be used to get a frame object." +msgid "" +"The :c:func:`PyEval_GetFrame` and :c:func:`PyThreadState_GetFrame` functions" +" can be used to get a frame object." msgstr "" +"از توابع :c:func:`PyEval_GetFrame` و :c:func:`PyThreadState_GetFrame` " +"می‌توان برای به‌دست‌آوردن یک شیء قاب (frame) استفاده کرد." msgid "See also :ref:`Reflection `." -msgstr "" +msgstr "همچنین ببینید :ref:`بازتاب `." -msgid "The type of frame objects. It is the same object as :py:class:`types.FrameType` in the Python layer." +msgid "" +"The type of frame objects. It is the same object as " +":py:class:`types.FrameType` in the Python layer." msgstr "" +"نوع اشیاء فریم. این همان شیء :py:class:`types.FrameType` در لایه‌ی پایتون " +"است." -msgid "Previously, this type was only available after including ````." -msgstr "" +msgid "" +"Previously, this type was only available after including " +"````." +msgstr "پیش‌تر، این نوع تنها پس از گنجاندن ```` در دسترس بود." -msgid "Create a new frame object. This function returns a :term:`strong reference` to the new frame object on success, and returns ``NULL`` with an exception set on failure." +msgid "" +"Create a new frame object. This function returns a :term:`strong reference` " +"to the new frame object on success, and returns ``NULL`` with an exception " +"set on failure." msgstr "" +"یک شیء فریم جدید ایجاد می‌کند. این تابع در صورت موفقیت، یک :term:`ارجاع قوی " +"` به شیء فریم جدید برمی‌گرداند و در صورت شکست، ``NULL`` را" +" همراه با یک استثنای تنظیم‌شده برمی‌گرداند." msgid "Return non-zero if *obj* is a frame object." -msgstr "" +msgstr "اگر *obj* یک شیء فریم باشد، مقدار غیر صفر برمی‌گرداند." -msgid "Previously, this function was only available after including ````." -msgstr "" +msgid "" +"Previously, this function was only available after including " +"````." +msgstr "پیش‌تر، این تابع تنها پس از گنجاندن ```` در دسترس بود." msgid "Get the *frame* next outer frame." -msgstr "" +msgstr "گرفتن فریم بیرونی بعدیِ *frame*." -msgid "Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer frame. This raises no exceptions." +msgid "" +"Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer " +"frame. This raises no exceptions." msgstr "" +"یک :term:`ارجاع قوی ` برمی‌گرداند، یا اگر *frame* فریم " +"بیرونی نداشته باشد، ``NULL``. این تابع هیچ استثنایی ایجاد نمی‌کند." msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." -msgstr "" +msgstr "ویژگی :attr:`~frame.f_builtins` *فریم* را دریافت می‌کند." msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." msgstr "" +"یک :term:`strong reference` برمی‌گرداند. نتیجه نمی‌تواند ``NULL`` باشد." msgid "Get the *frame* code." -msgstr "" +msgstr "دریافت کد *قاب* (frame)." msgid "Return a :term:`strong reference`." -msgstr "" +msgstr "یک :term:`strong reference` را برمی‌گرداند." msgid "The result (frame code) cannot be ``NULL``." -msgstr "" +msgstr "نتیجه (کد فریم) نمی‌تواند ``NULL`` باشد." -msgid "Get the generator, coroutine, or async generator that owns this frame, or ``NULL`` if this frame is not owned by a generator. Does not raise an exception, even if the return value is ``NULL``." +msgid "" +"Get the generator, coroutine, or async generator that owns this frame, or " +"``NULL`` if this frame is not owned by a generator. Does not raise an " +"exception, even if the return value is ``NULL``." msgstr "" +"تولیدگر، هم‌روال یا تولیدگر ناهمگامی را که مالک این قاب است به دست می‌آورد، " +"یا ``NULL`` اگر این قاب متعلق به هیچ تولیدگری نباشد. حتی اگر مقدار بازگشتی " +"``NULL`` باشد، استثنایی ایجاد نمی‌کند." msgid "Return a :term:`strong reference`, or ``NULL``." -msgstr "" +msgstr "یک :term:`ارجاع قوی ` یا ``NULL`` برمی‌گرداند." msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." -msgstr "" +msgstr "گرفتن ویژگی :attr:`~frame.f_globals` از *فریم*." msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." -msgstr "" +msgstr "ویژگی :attr:`~frame.f_lasti` *قاب (frame)* را دریافت کنید." msgid "Returns -1 if ``frame.f_lasti`` is ``None``." msgstr "" +"اگر ``frame.f_lasti`` برابر با ``None`` باشد، مقدار -1 را برمی‌گرداند." msgid "Get the variable *name* of *frame*." -msgstr "" +msgstr "متغیر *name* را از *frame* می‌گیرد." msgid "Return a :term:`strong reference` to the variable value on success." msgstr "" +"در صورت موفقیت، یک :term:`ارجاع قوی ` به مقدار متغیر " +"برمی‌گرداند." -msgid "Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." +msgid "" +"Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." msgstr "" +"اگر متغیر وجود نداشته باشد، :exc:`NameError` را پرتاب کرده و ``NULL`` را " +"برمی‌گرداند." msgid "Raise an exception and return ``NULL`` on error." -msgstr "" +msgstr "در صورت خطا، یک استثنا ایجاد کرده و ``NULL`` را برمی‌گرداند." msgid "*name* type must be a :class:`str`." -msgstr "" +msgstr "نوع *name* باید :class:`str` باشد." -msgid "Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string encoded in UTF-8." +msgid "" +"Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " +"encoded in UTF-8." msgstr "" +"مشابه :c:func:`PyFrame_GetVar`، اما نام متغیر یک رشته C کدگذاری‌شده با UTF-8" +" است." -msgid "Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to an :term:`optimized scope`, this returns a write-through proxy object that allows modifying the locals. In all other cases (classes, modules, :func:`exec`, :func:`eval`) it returns the mapping representing the frame locals directly (as described for :func:`locals`)." -msgstr "" +msgid "" +"Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to " +"an :term:`optimized scope`, this returns a write-through proxy object that " +"allows modifying the locals. In all other cases (classes, modules, " +":func:`exec`, :func:`eval`) it returns the mapping representing the frame " +"locals directly (as described for :func:`locals`)." +msgstr "" +"ویژگی :attr:`~frame.f_locals` *فریم* را دریافت می‌کند. اگر فریم به یک " +":term:`محدوده بهینه‌شده ` اشاره کند، یک شیء پراکسی " +"نوشتن‌همزمان برمی‌گرداند که امکان تغییر متغیرهای محلی را فراهم می‌کند. در " +"تمام موارد دیگر (کلاس‌ها، ماژول‌ها، :func:`exec`، :func:`eval`) نگاشتی را " +"برمی‌گرداند که متغیرهای محلی فریم را به‌طور مستقیم نمایش می‌دهد (همان‌طور که" +" برای :func:`locals` توضیح داده شده است)." -msgid "As part of :pep:`667`, return an instance of :c:var:`PyFrameLocalsProxy_Type`." +msgid "" +"As part of :pep:`667`, return an instance of " +":c:var:`PyFrameLocalsProxy_Type`." msgstr "" +"به عنوان بخشی از :pep:`667`، یک نمونه از :c:var:`PyFrameLocalsProxy_Type` را" +" برمی‌گرداند." msgid "Return the line number that *frame* is currently executing." -msgstr "" +msgstr "شماره سطری که *frame* هم‌اکنون در حال اجرای آن است را بازمی‌گرداند." msgid "Frame locals proxies" -msgstr "" +msgstr "پراکسی‌های متغیرهای محلی قاب" -msgid "The :attr:`~frame.f_locals` attribute on a :ref:`frame object ` is an instance of a \"frame-locals proxy\". The proxy object exposes a write-through view of the underlying locals dictionary for the frame. This ensures that the variables exposed by ``f_locals`` are always up to date with the live local variables in the frame itself." -msgstr "" +msgid "" +"The :attr:`~frame.f_locals` attribute on a :ref:`frame object ` is an instance of a \"frame-locals proxy\". The proxy object " +"exposes a write-through view of the underlying locals dictionary for the " +"frame. This ensures that the variables exposed by ``f_locals`` are always up" +" to date with the live local variables in the frame itself." +msgstr "" +"ویژگی :attr:`~frame.f_locals` روی یک :ref:`شیء فریم `، " +"نمونه‌ای از «پراکسی متغیرهای محلی فریم» (frame-locals proxy) است. شیء پراکسی" +" یک نمای نوشتن‌همزمان از دیکشنری متغیرهای محلی زیرین فریم ارائه می‌دهد. این " +"تضمین می‌کند که متغیرهای ارائه‌شده توسط ``f_locals`` همیشه با متغیرهای محلی " +"زنده در خودِ فریم به‌روز باشند." msgid "See :pep:`667` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :pep:`667` مراجعه کنید." msgid "The type of frame :func:`locals` proxy objects." -msgstr "" +msgstr "نوع شیءهای پراکسی :func:`locals` در فریم." msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." msgstr "" +"اگر *obj* یک پراکسی :func:`locals` قاب باشد، مقدار غیر صفر را برمی‌گرداند." msgid "Legacy local variable APIs" -msgstr "" +msgstr "APIهای قدیمی متغیر محلی" -msgid "These APIs are :term:`soft deprecated`. As of Python 3.13, they do nothing. They exist solely for backwards compatibility." +msgid "" +"These APIs are :term:`soft deprecated`. As of Python 3.13, they do nothing. " +"They exist solely for backwards compatibility." msgstr "" +"این API‌ها :term:`soft deprecated` هستند. از پایتون 3.13 به بعد، آن‌ها هیچ " +"کاری انجام نمی‌دهند. آن‌ها صرفاً برای سازگاری با نسخه‌های قبلی وجود دارند." -msgid "Prior to Python 3.13, this function would copy the :attr:`~frame.f_locals` attribute of *f* to the internal \"fast\" array of local variables, allowing changes in frame objects to be visible to the interpreter. If *clear* was true, this function would process variables that were unset in the locals dictionary." -msgstr "" +msgid "" +"Prior to Python 3.13, this function would copy the :attr:`~frame.f_locals` " +"attribute of *f* to the internal \"fast\" array of local variables, allowing" +" changes in frame objects to be visible to the interpreter. If *clear* was " +"true, this function would process variables that were unset in the locals " +"dictionary." +msgstr "" +"پیش از پایتون 3.13، این تابع ویژگی :attr:`~frame.f_locals` از *f* را به " +"آرایه‌ی داخلی «سریع» (fast) متغیرهای محلی کپی می‌کرد، به‌طوری‌که تغییرات در " +"اشیاء فریم (frame) برای مفسر قابل مشاهده می‌شدند. اگر *clear* درست بود، این " +"تابع متغیرهایی را که در دیکشنری متغیرهای محلی تنظیم نشده بودند پردازش " +"می‌کرد." msgid "This function now does nothing." -msgstr "" +msgstr "این تابع اکنون کاری انجام نمی‌دهد." -msgid "Prior to Python 3.13, this function would copy the internal \"fast\" array of local variables (which is used by the interpreter) to the :attr:`~frame.f_locals` attribute of *f*, allowing changes in local variables to be visible to frame objects." +msgid "" +"Prior to Python 3.13, this function would copy the internal \"fast\" array " +"of local variables (which is used by the interpreter) to the " +":attr:`~frame.f_locals` attribute of *f*, allowing changes in local " +"variables to be visible to frame objects." msgstr "" +"پیش از پایتون 3.13، این تابع آرایه داخلی «سریع» متغیرهای محلی (که توسط مفسر " +"استفاده می‌شود) را به ویژگی :attr:`~frame.f_locals` از *f* کپی می‌کرد، " +"به‌طوری که تغییرات در متغیرهای محلی برای اشیاء فریم قابل مشاهده باشند." -msgid "Prior to Python 3.13, this function was similar to :c:func:`PyFrame_FastToLocals`, but would return ``0`` on success, and ``-1`` with an exception set on failure." +msgid "" +"Prior to Python 3.13, this function was similar to " +":c:func:`PyFrame_FastToLocals`, but would return ``0`` on success, and " +"``-1`` with an exception set on failure." msgstr "" +"پیش از پایتون 3.13، این تابع مشابه :c:func:`PyFrame_FastToLocals` بود، اما " +"در صورت موفقیت ``0`` و در صورت شکست ``-1`` به همراه استثنای تنظیم‌شده " +"برمی‌گرداند." msgid ":pep:`667`" -msgstr "" +msgstr ":pep:`667`" msgid "Internal frames" -msgstr "" +msgstr "قاب‌های داخلی" msgid "Unless using :pep:`523`, you will not need this." -msgstr "" +msgstr "مگر اینکه از :pep:`523` استفاده کنید، به این نیاز نخواهید داشت." msgid "The interpreter's internal frame representation." -msgstr "" +msgstr "نمایش داخلی فریم (frame) در مفسر." msgid "Return a :term:`strong reference` to the code object for the frame." -msgstr "" +msgstr "یک :term:`strong reference` به شیء کدِ قاب را برمی‌گرداند." msgid "Return the byte offset into the last executed instruction." -msgstr "" +msgstr "آفست بایتیِ آخرین دستور اجرا‌شده را برمی‌گرداند." -msgid "Return the currently executing line number, or -1 if there is no line number." +msgid "" +"Return the currently executing line number, or -1 if there is no line " +"number." msgstr "" +"شماره‌ی سطر در حال اجرا را برمی‌گرداند، یا -1 اگر شماره‌ی سطری وجود نداشته " +"باشد." -msgid "An array of executable kinds (executor types) for frames, used for internal debugging and tracing." +msgid "" +"An array of executable kinds (executor types) for frames, used for internal " +"debugging and tracing." msgstr "" +"آرایه‌ای از انواع اجراکننده (executor types) برای قاب‌ها، که برای " +"اشکال‌زدایی داخلی و ردگیری استفاده می‌شود." -msgid "Tools like debuggers and profilers can use this to identify the type of execution context associated with a frame (such as to filter out internal frames). The entries are indexed by the following constants:" +msgid "" +"Tools like debuggers and profilers can use this to identify the type of " +"execution context associated with a frame (such as to filter out internal " +"frames). The entries are indexed by the following constants:" msgstr "" +"ابزارهایی مانند اشکال‌زداها و پروفایل‌گیرها می‌توانند از این برای شناسایی " +"نوع زمینه اجرای مرتبط با یک فریم استفاده کنند (مانند پالایش فریم‌های داخلی)." +" ورودی‌ها با ثابت‌های زیر اندیس‌گذاری می‌شوند:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Description" -msgstr "" +msgstr "توضیحات" -msgid "The frame is internal (For example: inlined) and should be skipped by tools." +msgid "" +"The frame is internal (For example: inlined) and should be skipped by tools." msgstr "" +"این فریم داخلی است (برای مثال: درون‌خطی‌شده (inlined)) و باید توسط ابزارها " +"نادیده گرفته شود." msgid "The frame corresponds to a standard Python function." -msgstr "" +msgstr "این قاب (frame) متناظر با یک تابع استاندارد پایتون است." msgid "The frame corresponds to a function defined in native code." -msgstr "" +msgstr "این قاب (frame) مربوط به تابعی است که در کد بومی تعریف شده است." msgid "The frame corresponds to a method on a class instance." -msgstr "" +msgstr "فریم متناظر با متدی روی نمونه‌ای از یک کلاس است." -msgid "However, Python's C API lacks a function to read the executable kind from a frame. Instead, use this recipe:" +msgid "" +"However, Python's C API lacks a function to read the executable kind from a " +"frame. Instead, use this recipe:" msgstr "" +"با این حال، API زبان C پایتون تابعی برای خواندن نوع اجراکننده (executable) " +"از یک قاب (frame) ندارد. در عوض، از این دستورالعمل استفاده کنید:" msgid "" "int\n" @@ -220,6 +337,24 @@ msgid "" " return PyUnstable_EXECUTABLE_KIND_SKIP;\n" "}" msgstr "" +"int\n" +"get_executable_kind(PyFrameObject *frame)\n" +"{\n" +" _PyInterpreterFrame *f = frame->f_frame;\n" +" PyObject *exec = PyStackRef_AsPyObjectBorrow(f->f_executable);\n" +"\n" +" if (PyCode_Check(exec)) {\n" +" return PyUnstable_EXECUTABLE_KIND_PY_FUNCTION;\n" +" }\n" +" if (PyMethod_Check(exec)) {\n" +" return PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION;\n" +" }\n" +" if (Py_IS_TYPE(exec, &PyMethodDescr_Type)) {\n" +" return PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR;\n" +" }\n" +"\n" +" return PyUnstable_EXECUTABLE_KIND_SKIP;\n" +"}" msgid "The number of entries in :c:data:`PyUnstable_ExecutableKinds`." -msgstr "" +msgstr "تعداد ورودی‌های :c:data:`PyUnstable_ExecutableKinds`." diff --git a/c-api/function.po b/c-api/function.po index 65722d5a9..ade57c2ad 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -24,130 +24,296 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Function Objects" -msgstr "" +msgstr "شیءهای تابع" msgid "There are a few functions specific to Python functions." -msgstr "" +msgstr "چند تابع وجود دارند که مختص توابع پایتون هستند." msgid "The C structure used for functions." -msgstr "" +msgstr "ساختار C استفاده‌شده برای توابع." -msgid "This is an instance of :c:type:`PyTypeObject` and represents the Python function type. It is exposed to Python programmers as ``types.FunctionType``." +msgid "" +"This is an instance of :c:type:`PyTypeObject` and represents the Python " +"function type. It is exposed to Python programmers as " +"``types.FunctionType``." msgstr "" +"این نمونه‌ای از :c:type:`PyTypeObject` است و نوع تابع پایتون را نمایندگی " +"می‌کند. این نوع به برنامه‌نویسان پایتون به صورت ``types.FunctionType`` در " +"دسترس قرار گرفته است." -msgid "Return true if *o* is a function object (has type :c:data:`PyFunction_Type`). The parameter must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is a function object (has type " +":c:data:`PyFunction_Type`). The parameter must not be ``NULL``. This " +"function always succeeds." msgstr "" +"اگر *o* یک شیء تابع باشد (نوع :c:data:`PyFunction_Type` را داشته باشد)، true" +" را برمی‌گرداند. پارامتر نباید ``NULL`` باشد. این تابع همیشه با موفقیت انجام" +" می‌شود." -msgid "Return a new function object associated with the code object *code*. *globals* must be a dictionary with the global variables accessible to the function." +msgid "" +"Return a new function object associated with the code object *code*. " +"*globals* must be a dictionary with the global variables accessible to the " +"function." msgstr "" +"شیء تابع جدیدی مرتبط با شیء کد *code* را برمی‌گرداند. *globals* باید " +"دیکشنری‌ای شامل متغیرهای سراسری قابل دسترس برای تابع باشد." -msgid "The function's docstring and name are retrieved from the code object. :attr:`~function.__module__` is retrieved from *globals*. The argument defaults, annotations and closure are set to ``NULL``. :attr:`~function.__qualname__` is set to the same value as the code object's :attr:`~codeobject.co_qualname` field." -msgstr "" +msgid "" +"The function's docstring and name are retrieved from the code object. " +":attr:`~function.__module__` is retrieved from *globals*. The argument " +"defaults, annotations and closure are set to ``NULL``. " +":attr:`~function.__qualname__` is set to the same value as the code object's" +" :attr:`~codeobject.co_qualname` field." +msgstr "" +"رشته مستند و نام تابع از شیء کد بازیابی می‌شوند. " +":attr:`~function.__module__` از *globals* بازیابی می‌شود. مقادیر پیش‌فرض " +"آرگومان‌ها، حاشیه‌نویسی‌ها و بستار به ``NULL`` تنظیم می‌شوند. " +":attr:`~function.__qualname__` به همان مقدار فیلد " +":attr:`~codeobject.co_qualname` شیء کد تنظیم می‌شود." -msgid "As :c:func:`PyFunction_New`, but also allows setting the function object's :attr:`~function.__qualname__` attribute. *qualname* should be a unicode object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute is set to the same value as the code object's :attr:`~codeobject.co_qualname` field." -msgstr "" +msgid "" +"As :c:func:`PyFunction_New`, but also allows setting the function object's " +":attr:`~function.__qualname__` attribute. *qualname* should be a unicode " +"object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute is set " +"to the same value as the code object's :attr:`~codeobject.co_qualname` " +"field." +msgstr "" +"مانند :c:func:`PyFunction_New` است، اما به‌علاوه امکان تنظیم ویژگی " +":attr:`~function.__qualname__` شیء تابع را نیز فراهم می‌کند. *qualname* باید" +" یک شیء یونیکد یا ``NULL`` باشد؛ اگر ``NULL`` باشد، ویژگی " +":attr:`!__qualname__` به همان مقدار فیلد :attr:`~codeobject.co_qualname` شیء" +" کد تنظیم می‌شود." msgid "Return the code object associated with the function object *op*." -msgstr "" +msgstr "شیء کدِ مرتبط با شیء تابع *op* را برمی‌گرداند." -msgid "Return the globals dictionary associated with the function object *op*." -msgstr "" +msgid "" +"Return the globals dictionary associated with the function object *op*." +msgstr "دیکشنری سراسری مرتبط با شیء تابع *op* را برمی‌گرداند." -msgid "Return a :term:`borrowed reference` to the :attr:`~function.__module__` attribute of the :ref:`function object ` *op*. It can be *NULL*." +msgid "" +"Return a :term:`borrowed reference` to the :attr:`~function.__module__` " +"attribute of the :ref:`function object ` *op*. It can be" +" *NULL*." msgstr "" +"یک :term:`ارجاع امانتی ` به ویژگی " +":attr:`~function.__module__` از :ref:`شیء تابع ` *op* " +"برمی‌گرداند. می‌تواند *NULL* باشد." -msgid "This is normally a :class:`string ` containing the module name, but can be set to any other object by Python code." +msgid "" +"This is normally a :class:`string ` containing the module name, but can" +" be set to any other object by Python code." msgstr "" +"این به‌طور معمول یک :class:`رشته ` حاوی نام ماژول است، اما می‌تواند " +"توسط کد پایتون به هر شیء دیگری تنظیم شود." -msgid "Return the argument default values of the function object *op*. This can be a tuple of arguments or ``NULL``." +msgid "" +"Return the argument default values of the function object *op*. This can be " +"a tuple of arguments or ``NULL``." msgstr "" +"مقادیر پیش‌فرض آرگومان‌های شیء تابع *op* را برمی‌گرداند. این می‌تواند یک " +"تاپل از آرگومان‌ها یا ``NULL`` باشد." -msgid "Set the argument default values for the function object *op*. *defaults* must be ``Py_None`` or a tuple." +msgid "" +"Set the argument default values for the function object *op*. *defaults* " +"must be ``Py_None`` or a tuple." msgstr "" +"مقادیر پیش‌فرض آرگومان‌ها را برای شیء تابع *op* تنظیم می‌کند. *defaults* " +"باید ``Py_None`` یا یک تاپل باشد." msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." msgstr "" +"در صورت شکست، :exc:`SystemError` ایجاد می‌کند و ``-1`` را برمی‌گرداند." msgid "Set the vectorcall field of a given function object *func*." -msgstr "" +msgstr "فیلد vectorcall از شیء تابع داده‌شده *func* را تنظیم می‌کند." -msgid "Warning: extensions using this API must preserve the behavior of the unaltered (default) vectorcall function!" +msgid "" +"Warning: extensions using this API must preserve the behavior of the " +"unaltered (default) vectorcall function!" msgstr "" +"هشدار: ماژول‌های توسعه‌ای که از این API استفاده می‌کنند، باید رفتار تابع " +"vectorcall دست‌نخورده (پیش‌فرض) را حفظ کنند!" -msgid "Return the keyword-only argument default values of the function object *op*. This can be a dictionary of arguments or ``NULL``." +msgid "" +"Return the keyword-only argument default values of the function object *op*." +" This can be a dictionary of arguments or ``NULL``." msgstr "" +"مقادیر پیش‌فرض آرگومان‌های فقط‌کلیدواژه‌ای شیء تابع *op* را برمی‌گرداند. این" +" می‌تواند یک دیکشنری از آرگومان‌ها یا ``NULL`` باشد." -msgid "Set the keyword-only argument default values of the function object *op*. *defaults* must be a dictionary of keyword-only arguments or ``Py_None``." +msgid "" +"Set the keyword-only argument default values of the function object *op*. " +"*defaults* must be a dictionary of keyword-only arguments or ``Py_None``." msgstr "" +"مقادیر پیش‌فرض آرگومان‌های فقط کلیدواژه‌ای شیء تابع *op* را تنظیم می‌کند. " +"*defaults* باید یک دیکشنری از آرگومان‌های فقط کلیدواژه‌ای یا ``Py_None`` " +"باشد." -msgid "This function returns ``0`` on success, and returns ``-1`` with an exception set on failure." +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception" +" set on failure." msgstr "" +"این تابع در صورت موفقیت ``0`` را برمی‌گرداند و در صورت شکست ``-1`` را همراه " +"با تنظیم یک استثنا برمی‌گرداند." -msgid "Return the closure associated with the function object *op*. This can be ``NULL`` or a tuple of cell objects." +msgid "" +"Return the closure associated with the function object *op*. This can be " +"``NULL`` or a tuple of cell objects." msgstr "" +"بستار مرتبط با شیء تابع *op* را برمی‌گرداند. این می‌تواند ``NULL`` یا تاپلی " +"از شیءهای سلولی (cell objects) باشد." -msgid "Set the closure associated with the function object *op*. *closure* must be ``Py_None`` or a tuple of cell objects." +msgid "" +"Set the closure associated with the function object *op*. *closure* must be " +"``Py_None`` or a tuple of cell objects." msgstr "" +"بستار مرتبط با شیء تابع *op* را تنظیم می‌کند. *closure* باید ``Py_None`` یا " +"تاپلی از اشیاء سلول (cell) باشد." -msgid "Return the annotations of the function object *op*. This can be a mutable dictionary or ``NULL``." +msgid "" +"Return the annotations of the function object *op*. This can be a mutable " +"dictionary or ``NULL``." msgstr "" +"حاشیه‌نویسی‌های شیء تابع *op* را برمی‌گرداند. این می‌تواند یک دیکشنری " +"تغییرپذیر یا ``NULL`` باشد." -msgid "Set the annotations for the function object *op*. *annotations* must be a dictionary or ``Py_None``." +msgid "" +"Set the annotations for the function object *op*. *annotations* must be a " +"dictionary or ``Py_None``." msgstr "" +"حاشیه‌نویسی‌های شیء تابع *op* را تنظیم می‌کند. *annotations* باید یک دیکشنری" +" یا ``Py_None`` باشد." -msgid "These functions are similar to their ``PyFunction_Get*`` counterparts, but do not do type checking. Passing anything other than an instance of :c:data:`PyFunction_Type` is undefined behavior." +msgid "" +"These functions are similar to their ``PyFunction_Get*`` counterparts, but " +"do not do type checking. Passing anything other than an instance of " +":c:data:`PyFunction_Type` is undefined behavior." msgstr "" +"این توابع مشابه همتایان ``PyFunction_Get*`` خود هستند، اما بررسی نوع انجام " +"نمی‌دهند. ارسال هر چیزی غیر از نمونه‌ای از :c:data:`PyFunction_Type` رفتار " +"تعریف‌نشده است." -msgid "Register *callback* as a function watcher for the current interpreter. Return an ID which may be passed to :c:func:`PyFunction_ClearWatcher`. In case of error (e.g. no more watcher IDs available), return ``-1`` and set an exception." +msgid "" +"Register *callback* as a function watcher for the current interpreter. " +"Return an ID which may be passed to :c:func:`PyFunction_ClearWatcher`. In " +"case of error (e.g. no more watcher IDs available), return ``-1`` and set an" +" exception." msgstr "" +"*callback* را به‌عنوان ناظر تابع برای مفسر جاری ثبت می‌کند. شناسه‌ای " +"برمی‌گرداند که می‌توان آن را به :c:func:`PyFunction_ClearWatcher` پاس داد. " +"در صورت بروز خطا (مثلاً وقتی دیگر شناسه ناظری در دسترس نباشد)، مقدار ``-1`` " +"را برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "Clear watcher identified by *watcher_id* previously returned from :c:func:`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on success, or ``-1`` and set an exception on error (e.g. if the given *watcher_id* was never registered.)" +msgid "" +"Clear watcher identified by *watcher_id* previously returned from " +":c:func:`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on" +" success, or ``-1`` and set an exception on error (e.g. if the given " +"*watcher_id* was never registered.)" msgstr "" +"دیده‌بان (watcher) شناسایی‌شده توسط *watcher_id* که پیش‌تر از " +":c:func:`PyFunction_AddWatcher` برای مفسر فعلی برگردانده شده است را حذف " +"می‌کند. در صورت موفقیت ``0`` را برمی‌گرداند، یا در صورت خطا ``-1`` را " +"برمی‌گرداند و یک استثنا تنظیم می‌کند (مثلاً اگر *watcher_id* داده‌شده هرگز " +"ثبت نشده باشد.)" msgid "Enumeration of possible function watcher events:" -msgstr "" +msgstr "فهرست رویداد‌های ممکن ناظر تابع (function watcher):" msgid "``PyFunction_EVENT_CREATE``" -msgstr "" +msgstr "``PyFunction_EVENT_CREATE``" msgid "``PyFunction_EVENT_DESTROY``" -msgstr "" +msgstr "``PyFunction_EVENT_DESTROY``" msgid "``PyFunction_EVENT_MODIFY_CODE``" -msgstr "" +msgstr "``PyFunction_EVENT_MODIFY_CODE``" msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" -msgstr "" +msgstr "``PyFunction_EVENT_MODIFY_DEFAULTS``" msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" -msgstr "" +msgstr "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" msgid "Type of a function watcher callback function." -msgstr "" +msgstr "نوع تابع کال‌بک دیده‌بان (watcher) تابع." -msgid "If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:`borrowed reference` to the new value that is about to be stored in *func* for the attribute that is being modified." +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " +"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a " +":term:`borrowed reference` to the new value that is about to be stored in " +"*func* for the attribute that is being modified." msgstr "" +"اگر *event* برابر ``PyFunction_EVENT_CREATE`` یا " +"``PyFunction_EVENT_DESTROY`` باشد، *new_value* برابر ``NULL`` خواهد بود. در " +"غیر این صورت، *new_value* حاوی یک :term:`borrowed reference` به مقدار جدیدی " +"خواهد بود که قرار است در *func* برای ویژگی‌ای که در حال تغییر است ذخیره شود." -msgid "The callback may inspect but must not modify *func*; doing so could have unpredictable effects, including infinite recursion." +msgid "" +"The callback may inspect but must not modify *func*; doing so could have " +"unpredictable effects, including infinite recursion." msgstr "" +"کال‌بک می‌تواند *func* را بررسی کند اما نباید آن را تغییر دهد؛ انجام این کار" +" می‌تواند پیامدهای غیرقابل پیش‌بینی، از جمله بازگشتی بی‌نهایت، داشته باشد." -msgid "If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked after *func* has been fully initialized. Otherwise, the callback is invoked before the modification to *func* takes place, so the prior state of *func* can be inspected. The runtime is permitted to optimize away the creation of function objects when possible. In such cases no event will be emitted. Although this creates the possibility of an observable difference of runtime behavior depending on optimization decisions, it does not change the semantics of the Python code being executed." -msgstr "" +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " +"after *func* has been fully initialized. Otherwise, the callback is invoked " +"before the modification to *func* takes place, so the prior state of *func* " +"can be inspected. The runtime is permitted to optimize away the creation of " +"function objects when possible. In such cases no event will be emitted. " +"Although this creates the possibility of an observable difference of runtime" +" behavior depending on optimization decisions, it does not change the " +"semantics of the Python code being executed." +msgstr "" +"اگر *event* برابر ``PyFunction_EVENT_CREATE`` باشد، کال‌بک پس از آنکه *func*" +" به‌طور کامل مقداردهی اولیه‌شده باشد فراخوانی می‌شود. در غیر این صورت، " +"کال‌بک پیش از اعمال تغییر روی *func* فراخوانی می‌شود، به‌طوری‌که بتوان وضعیت" +" پیشین *func* را بررسی کرد. ران‌تایم مجاز است در صورت امکان، ایجاد اشیاء " +"تابع را با بهینه‌سازی حذف کند. در چنین مواردی هیچ رویدادی منتشر نخواهد شد. " +"اگرچه این امر امکان بروز تفاوت قابل مشاهده در رفتار ران‌تایم بسته به تصمیمات" +" بهینه‌سازی را ایجاد می‌کند، اما معناشناسی کد پایتون در حال اجرا را تغییر " +"نمی‌دهد." -msgid "If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the callback to the about-to-be-destroyed function will resurrect it, preventing it from being freed at this time. When the resurrected object is destroyed later, any watcher callbacks active at that time will be called again." +msgid "" +"If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the " +"callback to the about-to-be-destroyed function will resurrect it, preventing" +" it from being freed at this time. When the resurrected object is destroyed " +"later, any watcher callbacks active at that time will be called again." msgstr "" +"اگر *event* برابر با ``PyFunction_EVENT_DESTROY`` باشد، گرفتن ارجاعی در " +"کال‌بک به تابعی که در آستانه‌ی نابودی است، آن را احیا می‌کند و مانع از آزاد " +"شدن آن در این زمان می‌شود. هنگامی که شیء احیا‌شده بعداً نابود شود، هر کال‌بک" +" ناظری که در آن زمان فعال باشد، دوباره فراخوانی خواهد شد." -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``." +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 "" +"اگر کال‌بک استثنایی تنظیم کند، باید ``-1`` را بازگرداند؛ این استثنا با " +"استفاده از :c:func:`PyErr_WriteUnraisable` به‌عنوان یک استثنای غیرقابل " +"برافراشتن (unraisable) چاپ خواهد شد. در غیر این صورت باید ``0`` را " +"بازگرداند." -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 set. This means the callback may not call any other API that can set an exception unless it saves and clears the exception state first, and restores it before returning." -msgstr "" +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 " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores" +" it before returning." +msgstr "" +"ممکن است هنگام ورود به کال‌بک، از قبل یک استثنای معلق تنظیم‌شده باشد. در این" +" حالت، کال‌بک باید ``0`` را برگرداند در حالی که همان استثنا همچنان تنظیم‌شده" +" است. این بدان معناست که کال‌بک نباید هیچ API دیگری را که می‌تواند استثنا " +"تنظیم کند فراخوانی کند، مگر آنکه ابتدا وضعیت استثنا را ذخیره و پاک کند و پیش" +" از بازگشت، آن را بازگردانی کند." msgid "object" -msgstr "" +msgstr "شیء" msgid "function" -msgstr "" +msgstr "تابع" msgid "MethodType (in module types)" -msgstr "" +msgstr "MethodType (در ماژول types)" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index c940948df..f591735ea 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -24,160 +24,391 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Supporting Cyclic Garbage Collection" -msgstr "" +msgstr "پشتیبانی از زباله‌روبی چرخه‌ای" -msgid "Python's support for detecting and collecting garbage which involves circular references requires support from object types which are \"containers\" for other objects which may also be containers. Types which do not store references to other objects, or which only store references to atomic types (such as numbers or strings), do not need to provide any explicit support for garbage collection." -msgstr "" +msgid "" +"Python's support for detecting and collecting garbage which involves " +"circular references requires support from object types which are " +"\"containers\" for other objects which may also be containers. Types which " +"do not store references to other objects, or which only store references to " +"atomic types (such as numbers or strings), do not need to provide any " +"explicit support for garbage collection." +msgstr "" +"پشتیبانی پایتون از تشخیص و جمع‌آوری زباله‌هایی که شامل ارجاع‌های چرخه‌ای " +"هستند، نیازمند پشتیبانی از سوی نوع‌های شیء است که «ظرف»هایی برای اشیاء دیگر " +"به شمار می‌روند و ممکن است خود آن اشیاء نیز ظرف باشند. نوع‌هایی که ارجاعی به" +" اشیاء دیگر ذخیره نمی‌کنند، یا تنها ارجاع‌هایی به نوع‌های اتمی (مانند اعداد " +"یا رشته‌ها) ذخیره می‌کنند، نیازی به ارائه هیچ پشتیبانی صریحی برای زباله‌روبی" +" ندارند." -msgid "To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` implementation must also be provided." +msgid "" +"To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of " +"the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide " +"an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " +"instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` " +"implementation must also be provided." msgstr "" +"برای ایجاد یک نوع ظرف، فیلد :c:member:`~PyTypeObject.tp_flags` شیء نوع باید " +"شامل :c:macro:`Py_TPFLAGS_HAVE_GC` باشد و پیاده‌سازی هندلر " +":c:member:`~PyTypeObject.tp_traverse` ارائه شود. اگر نمونه‌های نوع تغییرپذیر" +" باشند، پیاده‌سازی :c:member:`~PyTypeObject.tp_clear` نیز باید ارائه شود." msgid ":c:macro:`Py_TPFLAGS_HAVE_GC`" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_GC`" -msgid "Objects with a type with this flag set must conform with the rules documented here. For convenience these objects will be referred to as container objects." +msgid "" +"Objects with a type with this flag set must conform with the rules " +"documented here. For convenience these objects will be referred to as " +"container objects." msgstr "" +"اشیایی با نوعی که این پرچم در آن تنظیم شده است باید با قواعدی که در اینجا " +"مستند شده‌اند مطابقت داشته باشند. برای سهولت، به این اشیاء «اشیاء ظرف» گفته " +"خواهد شد." msgid "Constructors for container types must conform to two rules:" -msgstr "" +msgstr "سازنده‌های انواع ظرف باید از دو قاعده پیروی کنند:" -msgid "The memory for the object must be allocated using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`." +msgid "" +"The memory for the object must be allocated using :c:macro:`PyObject_GC_New`" +" or :c:macro:`PyObject_GC_NewVar`." msgstr "" +"حافظه برای شیء باید با استفاده از :c:macro:`PyObject_GC_New` یا " +":c:macro:`PyObject_GC_NewVar` تخصیص یابد." -msgid "Once all the fields which may contain references to other containers are initialized, it must call :c:func:`PyObject_GC_Track`." +msgid "" +"Once all the fields which may contain references to other containers are " +"initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" +"پس از آنکه تمامی فیلدهایی که ممکن است حاوی ارجاع‌هایی به ظرف‌های دیگر باشند " +"مقداردهی اولیه شدند، باید :c:func:`PyObject_GC_Track` را فراخوانی کند." -msgid "Similarly, the deallocator for the object must conform to a similar pair of rules:" +msgid "" +"Similarly, the deallocator for the object must conform to a similar pair of " +"rules:" msgstr "" +"به‌طور مشابه، تخصیص‌زدای (deallocator) شیء باید از جفت قاعده‌ی مشابهی پیروی " +"کند:" -msgid "Before fields which refer to other containers are invalidated, :c:func:`PyObject_GC_UnTrack` must be called." +msgid "" +"Before fields which refer to other containers are invalidated, " +":c:func:`PyObject_GC_UnTrack` must be called." msgstr "" +"پیش از آنکه فیلد‌هایی که به ظرف‌های دیگر ارجاع دارند نامعتبر شوند، باید " +":c:func:`PyObject_GC_UnTrack` فراخوانی شود." -msgid "The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." -msgstr "" +msgid "" +"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." +msgstr "حافظه‌ی شیء باید با استفاده از :c:func:`PyObject_GC_Del` آزاد شود." -msgid "If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its subclass or subclasses." +msgid "" +"If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a " +":c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its" +" subclass or subclasses." msgstr "" +"اگر نوعی Py_TPFLAGS_HAVE_GC را اضافه کند، آن‌گاه *باید* حداقل یک هندلر " +":c:member:`~PyTypeObject.tp_traverse` را پیاده‌سازی کند یا صریحاً از هندلری " +"در زیرکلاس یا زیرکلاس‌های خود استفاده کند." -msgid "When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the interpreter will automatically populate the :c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a class that implements the garbage collector protocol and the child class does *not* include the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" +msgid "" +"When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call" +" it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the" +" interpreter will automatically populate the " +":c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse` " +"and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a " +"class that implements the garbage collector protocol and the child class " +"does *not* include the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." +msgstr "" +"هنگام فراخوانی :c:func:`PyType_Ready` یا برخی از API‌هایی که به‌طور " +"غیرمستقیم آن را فراخوانی می‌کنند، مانند :c:func:`PyType_FromSpecWithBases` " +"یا :c:func:`PyType_FromSpec`، اگر نوع از کلاسی ارث‌بری کند که پروتکل " +"زباله‌روب را پیاده‌سازی کرده باشد و کلاس فرزند شامل پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` *نباشد*، مفسر به‌طور خودکار فیلدهای " +":c:member:`~PyTypeObject.tp_flags`، :c:member:`~PyTypeObject.tp_traverse` و " +":c:member:`~PyTypeObject.tp_clear` را پر می‌کند." -msgid "Analogous to :c:macro:`PyObject_New` but for container objects with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set." +msgid "" +"Analogous to :c:macro:`PyObject_New` but for container objects with the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" +"مشابه :c:macro:`PyObject_New` است، اما برای اشیاء ظرفی است که پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` روی آن‌ها تنظیم شده است." -msgid "Do not call this directly to allocate memory for an object; call the type's :c:member:`~PyTypeObject.tp_alloc` slot instead." +msgid "" +"Do not call this directly to allocate memory for an object; call the type's " +":c:member:`~PyTypeObject.tp_alloc` slot instead." msgstr "" +"برای تخصیص حافظه به یک شیء، این را مستقیماً فراخوانی نکنید؛ در عوض، جایگاه " +":c:member:`~PyTypeObject.tp_alloc` نوع را فراخوانی کنید." -msgid "When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, :c:func:`PyType_GenericAlloc` is preferred over a custom function that simply calls this macro." +msgid "" +"When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, " +":c:func:`PyType_GenericAlloc` is preferred over a custom function that " +"simply calls this macro." msgstr "" +"هنگام پر کردن جایگاه :c:member:`~PyTypeObject.tp_alloc` یک نوع، " +":c:func:`PyType_GenericAlloc` به تابع سفارشی‌ای که صرفاً این ماکرو را " +"فراخوانی می‌کند ترجیح داده می‌شود." -msgid "Memory allocated by this macro must be freed with :c:func:`PyObject_GC_Del` (usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." +msgid "" +"Memory allocated by this macro must be freed with :c:func:`PyObject_GC_Del` " +"(usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." msgstr "" +"حافظه‌ی تخصیص‌یافته توسط این ماکرو باید با :c:func:`PyObject_GC_Del` آزاد " +"شود (که معمولاً از طریق جایگاه :c:member:`~PyTypeObject.tp_free` شیء " +"فراخوانی می‌شود)." msgid ":c:func:`PyObject_GC_Del`" -msgstr "" +msgstr ":c:func:`PyObject_GC_Del`" msgid ":c:macro:`PyObject_New`" -msgstr "" +msgstr ":c:macro:`PyObject_New`" msgid ":c:func:`PyType_GenericAlloc`" -msgstr "" +msgstr ":c:func:`PyType_GenericAlloc`" msgid ":c:member:`~PyTypeObject.tp_alloc`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_alloc`" -msgid "Analogous to :c:macro:`PyObject_NewVar` but for container objects with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set." +msgid "" +"Analogous to :c:macro:`PyObject_NewVar` but for container objects with the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" +"مشابه :c:macro:`PyObject_NewVar` است، اما برای اشیاء ظرفی که پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` برایشان تنظیم شده است." msgid ":c:macro:`PyObject_NewVar`" -msgstr "" +msgstr ":c:macro:`PyObject_NewVar`" -msgid "Analogous to :c:macro:`PyObject_GC_New` but allocates *extra_size* bytes at the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). The allocated memory is initialized to zeros, except for the :c:type:`Python object header `." +msgid "" +"Analogous to :c:macro:`PyObject_GC_New` but allocates *extra_size* bytes at " +"the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " +"The allocated memory is initialized to zeros, except for the :c:type:`Python" +" object header `." msgstr "" +"مشابه :c:macro:`PyObject_GC_New` است، اما *extra_size* بایت در انتهای شیء " +"تخصیص می‌دهد (در آفست :c:member:`~PyTypeObject.tp_basicsize`). حافظه‌ی " +"تخصیص‌یافته با صفر مقداردهی اولیه می‌شود، به‌جز :c:type:`سرآیند شیء پایتون " +"`." -msgid "The extra data will be deallocated with the object, but otherwise it is not managed by Python." +msgid "" +"The extra data will be deallocated with the object, but otherwise it is not " +"managed by Python." msgstr "" +"داده‌ی اضافی به همراه شیء آزادسازی خواهد شد، اما در غیر این صورت توسط پایتون" +" مدیریت نمی‌شود." -msgid "Memory allocated by this function must be freed with :c:func:`PyObject_GC_Del` (usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." +msgid "" +"Memory allocated by this function must be freed with " +":c:func:`PyObject_GC_Del` (usually called via the object's " +":c:member:`~PyTypeObject.tp_free` slot)." msgstr "" +"حافظه‌ی تخصیص‌یافته توسط این تابع باید با :c:func:`PyObject_GC_Del` آزاد شود" +" (که معمولاً از طریق جایگاه :c:member:`~PyTypeObject.tp_free` شیء فراخوانی " +"می‌شود)." -msgid "The function is marked as unstable because the final mechanism for reserving extra data after an instance is not yet decided. For allocating a variable number of fields, prefer using :c:type:`PyVarObject` and :c:member:`~PyTypeObject.tp_itemsize` instead." +msgid "" +"The function is marked as unstable because the final mechanism for reserving" +" extra data after an instance is not yet decided. For allocating a variable " +"number of fields, prefer using :c:type:`PyVarObject` and " +":c:member:`~PyTypeObject.tp_itemsize` instead." msgstr "" +"این تابع به‌عنوان ناپاید علامت‌گذاری شده است زیرا سازوکار نهایی برای رزرو " +"داده‌های اضافی پس از یک نمونه هنوز تصمیم‌گیری نشده است. برای تخصیص تعداد " +"متغیری از فیلدها، بهتر است به‌جای آن از :c:type:`PyVarObject` و " +":c:member:`~PyTypeObject.tp_itemsize` استفاده کنید." -msgid "Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on failure." +msgid "" +"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " +"resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on " +"failure." msgstr "" +"تغییر اندازه‌ی شیء‌ای که توسط :c:macro:`PyObject_NewVar` تخصیص‌یافته است. " +"شیء تغییراندازه‌یافته از نوع ``TYPE*`` (منظور هر نوع C است) را برمی‌گرداند " +"یا در صورت شکست ``NULL``." -msgid "*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the collector yet. *newsize* must be of type :c:type:`Py_ssize_t`." +msgid "" +"*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the " +"collector yet. *newsize* must be of type :c:type:`Py_ssize_t`." msgstr "" +"*op* باید از نوع :c:expr:`PyVarObject *` باشد و هنوز توسط جمع‌کننده زباله " +"پیگیری نشده باشد. *newsize* باید از نوع :c:type:`Py_ssize_t` باشد." -msgid "Adds the object *op* to the set of container objects tracked by the collector. The collector can run at unexpected times so objects must be valid while being tracked. This should be called once all the fields followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, usually near the end of the constructor." -msgstr "" +msgid "" +"Adds the object *op* to the set of container objects tracked by the " +"collector. The collector can run at unexpected times so objects must be " +"valid while being tracked. This should be called once all the fields " +"followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, " +"usually near the end of the constructor." +msgstr "" +"شیء *op* را به مجموعه‌ی اشیاء ظرفی که توسط زباله‌روب پیگیری می‌شوند اضافه " +"می‌کند. زباله‌روب می‌تواند در زمان‌های غیرمنتظره اجرا شود، بنابراین اشیاء " +"باید در حین پیگیری معتبر باشند. این تابع باید پس از معتبر شدن همه‌ی فیلدهایی" +" که هندلر :c:member:`~PyTypeObject.tp_traverse` دنبال می‌کند فراخوانی شود، " +"که معمولاً نزدیک به پایان سازنده انجام می‌شود." -msgid "Returns non-zero if the object implements the garbage collector protocol, otherwise returns 0." +msgid "" +"Returns non-zero if the object implements the garbage collector protocol, " +"otherwise returns 0." msgstr "" +"اگر شیء پروتکل جمع‌آورنده زباله را پیاده‌سازی کند، مقدار غیرصفر برمی‌گرداند؛" +" در غیر این صورت ۰ برمی‌گرداند." -msgid "The object cannot be tracked by the garbage collector if this function returns 0." +msgid "" +"The object cannot be tracked by the garbage collector if this function " +"returns 0." msgstr "" +"اگر این تابع مقدار 0 را برگرداند، شیء توسط زباله‌روب قابل پیگیری نخواهد بود." -msgid "Returns 1 if the object type of *op* implements the GC protocol and *op* is being currently tracked by the garbage collector and 0 otherwise." +msgid "" +"Returns 1 if the object type of *op* implements the GC protocol and *op* is " +"being currently tracked by the garbage collector and 0 otherwise." msgstr "" +"اگر نوع شیء *op* پروتکل GC را پیاده‌سازی کرده باشد و *op* در حال حاضر توسط " +"زباله‌روب پیگیری شود، ۱ را برمی‌گرداند و در غیر این صورت ۰." msgid "This is analogous to the Python function :func:`gc.is_tracked`." -msgstr "" +msgstr "این مشابه تابع پایتون :func:`gc.is_tracked` است." -msgid "Returns 1 if the object type of *op* implements the GC protocol and *op* has been already finalized by the garbage collector and 0 otherwise." +msgid "" +"Returns 1 if the object type of *op* implements the GC protocol and *op* has" +" been already finalized by the garbage collector and 0 otherwise." msgstr "" +"اگر نوع شیء *op* پروتکل زباله‌روبی (GC) را پیاده‌سازی کرده باشد و *op* قبلاً" +" توسط زباله‌روب نهایی‌سازی شده باشد، مقدار ۱ و در غیر این صورت مقدار ۰ را " +"برمی‌گرداند." msgid "This is analogous to the Python function :func:`gc.is_finalized`." -msgstr "" +msgstr "این مشابه تابع پایتونی :func:`gc.is_finalized` است." -msgid "Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`." +msgid "" +"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or " +":c:macro:`PyObject_GC_NewVar`." msgstr "" +"حافظه‌ای را که با :c:macro:`PyObject_GC_New` یا " +":c:macro:`PyObject_GC_NewVar` به یک شیء تخصیص یافته است، آزاد می‌کند." -msgid "Do not call this directly to free an object's memory; call the type's :c:member:`~PyTypeObject.tp_free` slot instead." +msgid "" +"Do not call this directly to free an object's memory; call the type's " +":c:member:`~PyTypeObject.tp_free` slot instead." msgstr "" +"برای آزاد کردن حافظه‌ی یک شیء، این را مستقیماً فراخوانی نکنید؛ در عوض جایگاه" +" :c:member:`~PyTypeObject.tp_free` نوع را فراخوانی کنید." -msgid "Do not use this for memory allocated by :c:macro:`PyObject_New`, :c:macro:`PyObject_NewVar`, or related allocation functions; use :c:func:`PyObject_Free` instead." +msgid "" +"Do not use this for memory allocated by :c:macro:`PyObject_New`, " +":c:macro:`PyObject_NewVar`, or related allocation functions; use " +":c:func:`PyObject_Free` instead." msgstr "" +"از این برای حافظه‌ی تخصیص‌یافته توسط :c:macro:`PyObject_New`، " +":c:macro:`PyObject_NewVar` یا توابع تخصیص مرتبط استفاده نکنید؛ به جای آن از " +":c:func:`PyObject_Free` استفاده کنید." msgid ":c:func:`PyObject_Free` is the non-GC equivalent of this function." -msgstr "" +msgstr ":c:func:`PyObject_Free` معادلِ بدون GC این تابع است." msgid ":c:macro:`PyObject_GC_New`" -msgstr "" +msgstr ":c:macro:`PyObject_GC_New`" msgid ":c:macro:`PyObject_GC_NewVar`" -msgstr "" +msgstr ":c:macro:`PyObject_GC_NewVar`" msgid ":c:member:`~PyTypeObject.tp_free`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_free`" -msgid "Remove the object *op* from the set of container objects tracked by the collector. Note that :c:func:`PyObject_GC_Track` can be called again on this object to add it back to the set of tracked objects. The deallocator (:c:member:`~PyTypeObject.tp_dealloc` handler) should call this for the object before any of the fields used by the :c:member:`~PyTypeObject.tp_traverse` handler become invalid." -msgstr "" +msgid "" +"Remove the object *op* from the set of container objects tracked by the " +"collector. Note that :c:func:`PyObject_GC_Track` can be called again on " +"this object to add it back to the set of tracked objects. The deallocator " +"(:c:member:`~PyTypeObject.tp_dealloc` handler) should call this for the " +"object before any of the fields used by the " +":c:member:`~PyTypeObject.tp_traverse` handler become invalid." +msgstr "" +"شیء *op* را از مجموعه‌ی اشیای ظرفی که توسط جمع‌کننده پیگیری می‌شوند حذف " +"می‌کند. توجه داشته باشید که :c:func:`PyObject_GC_Track` می‌تواند دوباره روی" +" این شیء فراخوانی شود تا آن را به مجموعه‌ی اشیای پیگیری‌شده بازگرداند. " +"تخصیص‌زداینده (deallocator) (هندلر :c:member:`~PyTypeObject.tp_dealloc`) " +"باید این تابع را برای این شیء پیش از آنکه هر یک از فیلدهای مورد استفاده‌ی " +"هندلر :c:member:`~PyTypeObject.tp_traverse` نامعتبر شوند، فراخوانی کند." -msgid "The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros have been removed from the public C API." +msgid "" +"The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros" +" have been removed from the public C API." msgstr "" +"ماکروهای :c:func:`!_PyObject_GC_TRACK` و :c:func:`!_PyObject_GC_UNTRACK` از " +"API عمومی C حذف شده‌اند." -msgid "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function parameter of this type:" +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " +"parameter of this type:" msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_traverse` یک پارامتر تابع از این نوع " +"می‌پذیرد:" -msgid "Type of the visitor function passed to the :c:member:`~PyTypeObject.tp_traverse` handler. The function should be called with an object to traverse as *object* and the third parameter to the :c:member:`~PyTypeObject.tp_traverse` handler as *arg*. The Python core uses several visitor functions to implement cyclic garbage detection; it's not expected that users will need to write their own visitor functions." -msgstr "" +msgid "" +"Type of the visitor function passed to the " +":c:member:`~PyTypeObject.tp_traverse` handler. The function should be called" +" with an object to traverse as *object* and the third parameter to the " +":c:member:`~PyTypeObject.tp_traverse` handler as *arg*. The Python core " +"uses several visitor functions to implement cyclic garbage detection; it's " +"not expected that users will need to write their own visitor functions." +msgstr "" +"نوع تابع بازدیدکننده (visitor function) که به هندلر " +":c:member:`~PyTypeObject.tp_traverse` پاس داده می‌شود. این تابع باید با یک " +"شیء برای پیمایش به‌عنوان *object* و پارامتر سوم هندلر " +":c:member:`~PyTypeObject.tp_traverse` به‌عنوان *arg* فراخوانی شود. هسته‌ی " +"پایتون از چندین تابع بازدیدکننده برای پیاده‌سازی تشخیص زباله‌ی چرخه‌ای " +"استفاده می‌کند؛ انتظار نمی‌رود که کاربران نیازی به نوشتن توابع بازدیدکننده‌ی" +" خودشان داشته باشند." -msgid "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:" -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " +"type:" +msgstr "هندلر :c:member:`~PyTypeObject.tp_traverse` باید از نوع زیر باشد:" -msgid "Traversal function for a container object. Implementations must call the *visit* function for each object directly contained by *self*, with the parameters to *visit* being the contained object and the *arg* value passed to the handler. The *visit* function must not be called with a ``NULL`` object argument. If *visit* returns a non-zero value that value should be returned immediately." -msgstr "" +msgid "" +"Traversal function for a container object. Implementations must call the " +"*visit* function for each object directly contained by *self*, with the " +"parameters to *visit* being the contained object and the *arg* value passed " +"to the handler. The *visit* function must not be called with a ``NULL`` " +"object argument. If *visit* returns a non-zero value that value should be " +"returned immediately." +msgstr "" +"تابع پیمایش برای یک شیء ظرف. پیاده‌سازی‌ها باید تابع *visit* را برای هر " +"شیء‌ای که مستقیماً توسط *self* دربرگرفته شده است فراخوانی کنند، به‌طوری که " +"پارامترهای *visit*، شیء دربرگرفته و مقدار *arg*ِ ارسال‌شده به هندلر باشند. " +"تابع *visit* نباید با آرگومان شیء ``NULL`` فراخوانی شود. اگر *visit* مقدار " +"غیرصفر برگرداند، آن مقدار باید بی‌درنگ بازگردانده شود." -msgid "The traversal function must not have any side effects. Implementations may not modify the reference counts of any Python objects nor create or destroy any Python objects." +msgid "" +"The traversal function must not have any side effects. Implementations may " +"not modify the reference counts of any Python objects nor create or destroy " +"any Python objects." msgstr "" +"تابع پیمایش نباید هیچ اثر جانبی داشته باشد. پیاده‌سازی‌ها نباید شمارش ارجاع " +"هیچ‌یک از اشیاء پایتون را تغییر دهند و نباید هیچ شیء پایتونی ایجاد یا نابود " +"کنند." -msgid "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:func:`Py_VISIT` macro is provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse` implementation must name its arguments exactly *visit* and *arg*:" +msgid "" +"To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a " +":c:func:`Py_VISIT` macro is provided. In order to use this macro, the " +":c:member:`~PyTypeObject.tp_traverse` implementation must name its arguments" +" exactly *visit* and *arg*:" msgstr "" +"برای ساده‌سازی نوشتن هندلرهای :c:member:`~PyTypeObject.tp_traverse`، ماکروی " +":c:func:`Py_VISIT` فراهم شده است. برای استفاده از این ماکرو، پیاده‌سازی " +":c:member:`~PyTypeObject.tp_traverse` باید آرگومان‌های خود را دقیقاً *visit*" +" و *arg* نام‌گذاری کند:" -msgid "If the :c:expr:`PyObject *` *o* is not ``NULL``, call the *visit* callback, with arguments *o* and *arg*. If *visit* returns a non-zero value, then return it. Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" +msgid "" +"If the :c:expr:`PyObject *` *o* is not ``NULL``, call the *visit* callback, " +"with arguments *o* and *arg*. If *visit* returns a non-zero value, then " +"return it. Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers " +"look like::" msgstr "" +"اگر :c:expr:`PyObject *` *o* برابر ``NULL`` نباشد، کال‌بک *visit* با " +"آرگومان‌های *o* و *arg* فراخوانی می‌شود. اگر *visit* مقدار غیرصفری برگرداند،" +" همان مقدار برگردانده می‌شود. با استفاده از این ماکرو، هندلرهای " +":c:member:`~PyTypeObject.tp_traverse` به این شکل هستند::" msgid "" "static int\n" @@ -188,48 +419,124 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"my_traverse(Noddy *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->foo);\n" +" Py_VISIT(self->bar);\n" +" return 0;\n" +"}" -msgid "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:`inquiry` type, or ``NULL`` if the object is immutable." +msgid "" +"The :c:member:`~PyTypeObject.tp_clear` handler must be of the " +":c:type:`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_clear` باید از نوع :c:type:`inquiry` باشد،" +" یا در صورتی که شیء تغییرناپذیر است، ``NULL`` باشد." -msgid "Drop references that may have created reference cycles. Immutable objects do not have to define this method since they can never directly create reference cycles. Note that the object must still be valid after calling this method (don't just call :c:func:`Py_DECREF` on a reference). The collector will call this method if it detects that this object is involved in a reference cycle." -msgstr "" +msgid "" +"Drop references that may have created reference cycles. Immutable objects " +"do not have to define this method since they can never directly create " +"reference cycles. Note that the object must still be valid after calling " +"this method (don't just call :c:func:`Py_DECREF` on a reference). The " +"collector will call this method if it detects that this object is involved " +"in a reference cycle." +msgstr "" +"ارجاع‌هایی را که ممکن است چرخه‌های ارجاع ایجاد کرده باشند رها کنید. اشیاء " +"تغییرناپذیر نیازی به تعریف این متد ندارند، زیرا هرگز نمی‌توانند به‌طور " +"مستقیم چرخه‌های ارجاع ایجاد کنند. توجه داشته باشید که شیء باید پس از " +"فراخوانی این متد همچنان معتبر باشد (تنها :c:func:`Py_DECREF` را روی یک ارجاع" +" فراخوانی نکنید). زباله‌روب در صورتی که تشخیص دهد این شیء در یک چرخه ارجاع " +"درگیر است، این متد را فراخوانی خواهد کرد." msgid "Controlling the Garbage Collector State" -msgstr "" +msgstr "کنترل وضعیت زباله‌روب" -msgid "The C-API provides the following functions for controlling garbage collection runs." -msgstr "" +msgid "" +"The C-API provides the following functions for controlling garbage " +"collection runs." +msgstr "API زبان C توابع زیر را برای کنترل اجراهای زباله‌روبی فراهم می‌کند." -msgid "Perform a full garbage collection, if the garbage collector is enabled. (Note that :func:`gc.collect` runs it unconditionally.)" +msgid "" +"Perform a full garbage collection, if the garbage collector is enabled. " +"(Note that :func:`gc.collect` runs it unconditionally.)" msgstr "" +"در صورت فعال بودن زباله‌روب، یک زباله‌روبی کامل انجام می‌دهد. (توجه داشته " +"باشید که :func:`gc.collect` آن را بدون قید و شرط اجرا می‌کند.)" -msgid "Returns the number of collected + unreachable objects which cannot be collected. If the garbage collector is disabled or already collecting, returns ``0`` immediately. Errors during garbage collection are passed to :data:`sys.unraisablehook`. This function does not raise exceptions." +msgid "" +"Returns the number of collected + unreachable objects which cannot be " +"collected. If the garbage collector is disabled or already collecting, " +"returns ``0`` immediately. Errors during garbage collection are passed to " +":data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" +"تعداد اشیاء جمع‌آوری‌شده + اشیاء دسترس‌ناپذیری که نمی‌توان آن‌ها را جمع‌آوری" +" کرد را برمی‌گرداند. اگر زباله‌روب غیرفعال باشد یا از قبل در حال جمع‌آوری " +"باشد، بلافاصله ``0`` را برمی‌گرداند. خطاهای رخ‌داده در حین زباله‌روبی به " +":data:`sys.unraisablehook` منتقل می‌شوند. این تابع استثنایی ایجاد نمی‌کند." -msgid "Enable the garbage collector: similar to :func:`gc.enable`. Returns the previous state, 0 for disabled and 1 for enabled." +msgid "" +"Enable the garbage collector: similar to :func:`gc.enable`. Returns the " +"previous state, 0 for disabled and 1 for enabled." msgstr "" +"فعال کردن زباله‌روب: مشابه :func:`gc.enable`. وضعیت قبلی را برمی‌گرداند، ۰ " +"برای غیرفعال و ۱ برای فعال." -msgid "Disable the garbage collector: similar to :func:`gc.disable`. Returns the previous state, 0 for disabled and 1 for enabled." +msgid "" +"Disable the garbage collector: similar to :func:`gc.disable`. Returns the " +"previous state, 0 for disabled and 1 for enabled." msgstr "" +"جمع‌کننده زباله را غیرفعال می‌کند: مشابه :func:`gc.disable`. وضعیت قبلی را " +"برمی‌گرداند، 0 برای غیرفعال و 1 برای فعال." -msgid "Query the state of the garbage collector: similar to :func:`gc.isenabled`. Returns the current state, 0 for disabled and 1 for enabled." +msgid "" +"Query the state of the garbage collector: similar to :func:`gc.isenabled`. " +"Returns the current state, 0 for disabled and 1 for enabled." msgstr "" +"وضعیت زباله‌روب را پرس‌وجو می‌کند: مشابه :func:`gc.isenabled`. وضعیت فعلی را" +" برمی‌گرداند، ۰ برای غیرفعال و ۱ برای فعال." msgid "Querying Garbage Collector State" -msgstr "" +msgstr "پرس‌وجوی وضعیت زباله‌روب" -msgid "The C-API provides the following interface for querying information about the garbage collector." +msgid "" +"The C-API provides the following interface for querying information about " +"the garbage collector." msgstr "" +"C-API رابط زیر را برای استعلام اطلاعات درباره‌ی زباله‌روب فراهم می‌کند." -msgid "Run supplied *callback* on all live GC-capable objects. *arg* is passed through to all invocations of *callback*." +msgid "" +"Run supplied *callback* on all live GC-capable objects. *arg* is passed " +"through to all invocations of *callback*." msgstr "" +"*callback* داده‌شده را روی تمام اشیای زنده‌ی قابل زباله‌روبی اجرا می‌کند. " +"*arg* بدون تغییر به تمام فراخوانی‌های *callback* پاس داده می‌شود." -msgid "If new objects are (de)allocated by the callback it is undefined if they will be visited." +msgid "" +"If new objects are (de)allocated by the callback it is undefined if they " +"will be visited." msgstr "" +"اگر اشیاء جدیدی توسط کال‌بک تخصیص داده (یا آزادسازی) شوند، تعریف‌نشده است که" +" آیا بازدید خواهند شد یا خیر." -msgid "Garbage collection is disabled during operation. Explicitly running a collection in the callback may lead to undefined behaviour e.g. visiting the same objects multiple times or not at all." +msgid "" +"Garbage collection is disabled during operation. Explicitly running a " +"collection in the callback may lead to undefined behaviour e.g. visiting the" +" same objects multiple times or not at all." msgstr "" +"زباله‌روبی در حین عملیات غیرفعال است. اجرای صریح یک زباله‌روبی در کال‌بک " +"ممکن است به رفتار تعریف‌نشده منجر شود؛ برای مثال، پیمایش همان اشیاء چندین " +"بار یا اصلاً پیمایش‌نشدن آن‌ها." -msgid "Type of the visitor function to be passed to :c:func:`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to ``PyUnstable_GC_VisitObjects``. Return ``1`` to continue iteration, return ``0`` to stop iteration. Other return values are reserved for now so behavior on returning anything else is undefined." -msgstr "" +msgid "" +"Type of the visitor function to be passed to " +":c:func:`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed " +"to ``PyUnstable_GC_VisitObjects``. Return ``1`` to continue iteration, " +"return ``0`` to stop iteration. Other return values are reserved for now so " +"behavior on returning anything else is undefined." +msgstr "" +"نوع تابع بازدیدکننده‌ای که باید به :c:func:`PyUnstable_GC_VisitObjects` پاس " +"داده شود. *arg* همان *arg*\\ ی است که به ``PyUnstable_GC_VisitObjects`` پاس " +"داده شده است. برای ادامه‌ی پیمایش ``1`` را برگردانید و برای توقف پیمایش " +"``0`` را برگردانید. سایر مقادیر بازگشتی فعلاً رزرو شده‌اند، بنابراین رفتار " +"در صورت برگرداندن هر مقدار دیگر تعریف‌نشده است." diff --git a/c-api/gen.po b/c-api/gen.po index 4a83cb955..aa800cef0 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -22,55 +22,111 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Generator Objects" -msgstr "" +msgstr "اشیاء تولیدگر" -msgid "Generator objects are what Python uses to implement generator iterators. They are normally created by iterating over a function that yields values, rather than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`." +msgid "" +"Generator objects are what Python uses to implement generator iterators. " +"They are normally created by iterating over a function that yields values, " +"rather than explicitly calling :c:func:`PyGen_New` or " +":c:func:`PyGen_NewWithQualName`." msgstr "" +"اشیاء تولیدگر همان چیزی هستند که پایتون برای پیاده‌سازی پیمایش‌گرهای تولیدگر" +" از آن‌ها استفاده می‌کند. این اشیاء معمولاً با پیمایش کردن تابعی که مقادیر " +"را بازدهی (yield) می‌کند ایجاد می‌شوند، نه با فراخوانی صریح " +":c:func:`PyGen_New` یا :c:func:`PyGen_NewWithQualName`." msgid "The C structure used for generator objects." -msgstr "" +msgstr "ساختار C استفاده‌شده برای اشیاء تولیدگر." msgid "The type object corresponding to generator objects." -msgstr "" +msgstr "شیء نوعِ متناظر با شیءهای تولیدگر." -msgid "Return true if *ob* is a generator object; *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is a generator object; *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" +"اگر *ob* یک شیء تولیدگر باشد، مقدار true را برمی‌گرداند؛ *ob* نباید ``NULL``" +" باشد. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be " +"``NULL``. This function always succeeds." msgstr "" +"اگر نوع *ob* برابر :c:type:`PyGen_Type` باشد، مقدار true برمی‌گرداند؛ *ob* " +"نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Create and return a new generator object based on the *frame* object. A reference to *frame* is \":term:`stolen `\" by this function (even on error). The argument must not be ``NULL``." +msgid "" +"Create and return a new generator object based on the *frame* object. A " +"reference to *frame* is \":term:`stolen `\" by this function (even on" +" error). The argument must not be ``NULL``." msgstr "" +"یک شیء تولیدگر جدید بر اساس شیء *frame* ایجاد کرده و برمی‌گرداند. ارجاعی به " +"*frame* توسط این تابع «:term:`دزدیده `» می‌شود (حتی در صورت بروز " +"خطا). این آرگومان نباید ``NULL`` باشد." -msgid "Create and return a new generator object based on the *frame* object, with ``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference to *frame* is \":term:`stolen `\" by this function (even on error). The *frame* argument must not be ``NULL``." +msgid "" +"Create and return a new generator object based on the *frame* object, with " +"``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference " +"to *frame* is \":term:`stolen `\" by this function (even on error). " +"The *frame* argument must not be ``NULL``." msgstr "" +"یک شیء تولیدگر جدید بر اساس شیء *frame* ایجاد می‌کند و برمی‌گرداند که " +"``__name__`` و ``__qualname__`` آن روی *name* و *qualname* تنظیم شده‌اند. " +"ارجاعی به *frame* توسط این تابع «:term:`دزدیده `» می‌شود (حتی در صورت" +" خطا). آرگومان *frame* نباید ``NULL`` باشد." -msgid "Return a new :term:`strong reference` to the code object wrapped by *gen*. This function always succeeds." +msgid "" +"Return a new :term:`strong reference` to the code object wrapped by *gen*. " +"This function always succeeds." msgstr "" +"یک :term:`ارجاع قوی ` جدید به شیء کدی که توسط *gen* " +"دربرگرفته‌شده است، برمی‌گرداند. این تابع همیشه با موفقیت انجام می‌شود." msgid "Asynchronous Generator Objects" -msgstr "" +msgstr "اشیاء تولیدگر ناهمگام" msgid ":pep:`525`" -msgstr "" +msgstr ":pep:`525`" -msgid "The type object corresponding to asynchronous generator objects. This is available as :class:`types.AsyncGeneratorType` in the Python layer." +msgid "" +"The type object corresponding to asynchronous generator objects. This is " +"available as :class:`types.AsyncGeneratorType` in the Python layer." msgstr "" +"شیء نوعِ متناظر با شیءهای تولیدگر ناهمگام. این در لایه‌ی پایتون به‌صورت " +":class:`types.AsyncGeneratorType` دسترس‌پذیر است." -msgid "Create a new asynchronous generator wrapping *frame*, with ``__name__`` and ``__qualname__`` set to *name* and *qualname*. *frame* is \":term:`stolen `\" by this function (even on error) and must not be ``NULL``." +msgid "" +"Create a new asynchronous generator wrapping *frame*, with ``__name__`` and " +"``__qualname__`` set to *name* and *qualname*. *frame* is \":term:`stolen " +"`\" by this function (even on error) and must not be ``NULL``." msgstr "" +"یک تولیدگر ناهمگام جدید که *frame* را دربرمی‌گیرد ایجاد کنید، به‌طوری که " +"``__name__`` و ``__qualname__`` آن روی *name* و *qualname* تنظیم شوند. " +"*frame* توسط این تابع «:term:`دزدیده می‌شود `» (حتی در صورت خطا) و " +"نباید ``NULL`` باشد." -msgid "On success, this function returns a :term:`strong reference` to the new asynchronous generator. On failure, this function returns ``NULL`` with an exception set." +msgid "" +"On success, this function returns a :term:`strong reference` to the new " +"asynchronous generator. On failure, this function returns ``NULL`` with an " +"exception set." msgstr "" +"در صورت موفقیت، این تابع یک :term:`ارجاع قوی ` به تولیدگر " +"ناهمگام جدید برمی‌گرداند. در صورت شکست، این تابع ``NULL`` را همراه با یک " +"استثنای تنظیم‌شده برمی‌گرداند." -msgid "Return true if *op* is an asynchronous generator object, false otherwise. This function always succeeds." +msgid "" +"Return true if *op* is an asynchronous generator object, false otherwise. " +"This function always succeeds." msgstr "" +"اگر *op* یک شیء تولیدگر ناهمگام باشد، true برمی‌گرداند و در غیر این صورت " +"false. این تابع همیشه موفق می‌شود." msgid "Deprecated API" -msgstr "" +msgstr "API منسوخ" msgid "This is an API that was included in Python's C API by mistake." -msgstr "" +msgstr "این یک API است که به اشتباه در C API پایتون گنجانده شده بود." msgid "It is solely here for completeness; do not use this API." msgstr "" +"این تنها برای کامل بودن اینجا قرار گرفته است؛ از این API استفاده نکنید." diff --git a/c-api/hash.po b/c-api/hash.po index 6c7b97596..390804616 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -22,121 +22,176 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "PyHash API" -msgstr "" +msgstr "PyHash API" -msgid "See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`." +msgid "" +"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-" +"hash`." msgstr "" +"همچنین عضو :c:member:`PyTypeObject.tp_hash` و :ref:`numeric-hash` را ببینید." msgid "Hash value type: signed integer." -msgstr "" +msgstr "نوع مقدار هش: عدد صحیح علامت‌دار." msgid "Hash value type: unsigned integer." -msgstr "" +msgstr "نوع مقدار هش: عدد صحیح بدون علامت." -msgid "A numerical value indicating the algorithm for hashing of :class:`str`, :class:`bytes`, and :class:`memoryview`." +msgid "" +"A numerical value indicating the algorithm for hashing of :class:`str`, " +":class:`bytes`, and :class:`memoryview`." msgstr "" +"یک مقدار عددی که الگوریتم هش‌کردنِ :class:`str`، :class:`bytes` و " +":class:`memoryview` را نشان می‌دهد." msgid "The algorithm name is exposed by :data:`sys.hash_info.algorithm`." msgstr "" +"نام الگوریتم توسط :data:`sys.hash_info.algorithm` در دسترس قرار می‌گیرد." -msgid "Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine which algorithm is used for hashing. The hash algorithm can be configured via the configure :option:`--with-hash-algorithm` option." +msgid "" +"Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine " +"which algorithm is used for hashing. The hash algorithm can be configured " +"via the configure :option:`--with-hash-algorithm` option." msgstr "" +"مقادیر عددی برای مقایسه با :c:macro:`Py_HASH_ALGORITHM` به‌منظور تعیین اینکه" +" کدام الگوریتم برای هش‌کردن استفاده می‌شود. الگوریتم هش را می‌توان از طریق " +"گزینه‌ی :option:`--with-hash-algorithm` در configure پیکربندی کرد." msgid "Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`." -msgstr "" +msgstr "افزودن :c:macro:`!Py_HASH_FNV` و :c:macro:`!Py_HASH_SIPHASH24`." msgid "Add :c:macro:`!Py_HASH_SIPHASH13`." -msgstr "" +msgstr "افزودن :c:macro:`!Py_HASH_SIPHASH13`." -msgid "Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A instead of the algorithm described by :c:macro:`Py_HASH_ALGORITHM`." +msgid "" +"Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A " +"instead of the algorithm described by :c:macro:`Py_HASH_ALGORITHM`." msgstr "" +"بافرهایی که طول آن‌ها در بازه‌ی ``[1, Py_HASH_CUTOFF)`` است، به‌جای الگوریتم" +" توصیف‌شده توسط :c:macro:`Py_HASH_ALGORITHM`، با استفاده از DJBX33A هش " +"می‌شوند." msgid "A :c:macro:`!Py_HASH_CUTOFF` of 0 disables the optimization." msgstr "" +"مقدار :c:macro:`!Py_HASH_CUTOFF` برابر با ۰، بهینه‌سازی را غیرفعال می‌کند." -msgid ":c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7." -msgstr "" +msgid "" +":c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7." +msgstr ":c:macro:`!Py_HASH_CUTOFF` باید نامنفی و کمتر یا مساوی ۷ باشد." -msgid "32-bit platforms should use a cutoff smaller than 64-bit platforms because it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms and 5 on 32-bit platforms should provide a decent safety margin." +msgid "" +"32-bit platforms should use a cutoff smaller than 64-bit platforms because " +"it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms " +"and 5 on 32-bit platforms should provide a decent safety margin." msgstr "" +"پلتفرم‌های ۳۲ بیتی باید از آستانه‌ای کوچک‌تر از پلتفرم‌های ۶۴ بیتی استفاده " +"کنند، زیرا در آن‌ها ایجاد رشته‌های برخوردکننده آسان‌تر است. آستانه‌ی ۷ در " +"پلتفرم‌های ۶۴ بیتی و ۵ در پلتفرم‌های ۳۲ بیتی باید حاشیه‌ی ایمنی مناسبی فراهم" +" کند." msgid "This corresponds to the :data:`sys.hash_info.cutoff` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.cutoff` مطابقت دارد." -msgid "The `Mersenne prime `_ ``P = 2**n -1``, used for numeric hash scheme." +msgid "" +"The `Mersenne prime `_ ``P = " +"2**n -1``, used for numeric hash scheme." msgstr "" +"`عدد اول مرسن `_ ``P = 2**n " +"-1`` که در طرح هش عددی استفاده می‌شود." msgid "This corresponds to the :data:`sys.hash_info.modulus` constant." -msgstr "" +msgstr "این معادل ثابت :data:`sys.hash_info.modulus` است." msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." -msgstr "" +msgstr "توان ``n`` از ``P`` در :c:macro:`PyHASH_MODULUS`." msgid "Prime multiplier used in string and various other hashes." -msgstr "" +msgstr "ضریب اول استفاده‌شده در هش رشته و هش‌های مختلف دیگر." msgid "The hash value returned for a positive infinity." -msgstr "" +msgstr "مقدار هشی که برای بی‌نهایت مثبت برگردانده می‌شود." msgid "This corresponds to the :data:`sys.hash_info.inf` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.inf` مطابقت دارد." msgid "The multiplier used for the imaginary part of a complex number." -msgstr "" +msgstr "ضریب استفاده‌شده برای بخش موهومی یک عدد مختلط." msgid "This corresponds to the :data:`sys.hash_info.imag` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.imag` مطابقت دارد." msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." -msgstr "" +msgstr "تعریف تابع هش که توسط :c:func:`PyHash_GetFuncDef` استفاده می‌شود." msgid "Hash function." -msgstr "" +msgstr "تابع هش." msgid "Hash function name (UTF-8 encoded string)." -msgstr "" +msgstr "نام تابع هش (رشته کدگذاری‌شده با UTF-8)." msgid "This corresponds to the :data:`sys.hash_info.algorithm` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.algorithm` مطابقت دارد." msgid "Internal size of the hash value in bits." -msgstr "" +msgstr "اندازه داخلی مقدار هش بر حسب بیت." msgid "This corresponds to the :data:`sys.hash_info.hash_bits` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.hash_bits` مطابقت دارد." msgid "Size of seed input in bits." -msgstr "" +msgstr "اندازه‌ی ورودی بذر بر حسب بیت." msgid "This corresponds to the :data:`sys.hash_info.seed_bits` constant." -msgstr "" +msgstr "این با ثابت :data:`sys.hash_info.seed_bits` مطابق است." msgid "Get the hash function definition." -msgstr "" +msgstr "گرفتن تعریف تابع هش." msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." -msgstr "" +msgstr ":pep:`456` \"Secure and interchangeable hash algorithm\"." -msgid "Hash a pointer value: process the pointer value as an integer (cast it to ``uintptr_t`` internally). The pointer is not dereferenced." +msgid "" +"Hash a pointer value: process the pointer value as an integer (cast it to " +"``uintptr_t`` internally). The pointer is not dereferenced." msgstr "" +"هش کردن یک مقدار اشاره‌گر: مقدار اشاره‌گر را به‌عنوان یک عدد صحیح پردازش " +"می‌کند (به‌طور داخلی آن را به ``uintptr_t`` قالب‌ریزی می‌کند). اشاره‌گر " +"ارجاع‌زدایی (dereference) نمی‌شود." msgid "The function cannot fail: it cannot return ``-1``." -msgstr "" +msgstr "این تابع نمی‌تواند شکست بخورد: نمی‌تواند ``-1`` را برگرداند." -msgid "Compute and return the hash value of a buffer of *len* bytes starting at address *ptr*. The hash is guaranteed to match that of :class:`bytes`, :class:`memoryview`, and other built-in objects that implement the :ref:`buffer protocol `." +msgid "" +"Compute and return the hash value of a buffer of *len* bytes starting at " +"address *ptr*. The hash is guaranteed to match that of :class:`bytes`, " +":class:`memoryview`, and other built-in objects that implement the " +":ref:`buffer protocol `." msgstr "" +"مقدار هش یک بافر به طول *len* بایت که از نشانی *ptr* آغاز می‌شود را محاسبه " +"کرده و برمی‌گرداند. تضمین می‌شود که این هش با هش :class:`bytes`، " +":class:`memoryview` و سایر اشیاء توکاری که :ref:`پروتکل بافر " +"` را پیاده‌سازی می‌کنند، مطابقت داشته باشد." -msgid "Use this function to implement hashing for immutable objects whose :c:member:`~PyTypeObject.tp_richcompare` function compares to another object's buffer." +msgid "" +"Use this function to implement hashing for immutable objects whose " +":c:member:`~PyTypeObject.tp_richcompare` function compares to another " +"object's buffer." msgstr "" +"برای پیاده‌سازی هش برای اشیاء تغییرناپذیری که تابع " +":c:member:`~PyTypeObject.tp_richcompare` آن‌ها با بافر شیء دیگری مقایسه " +"می‌کند، از این تابع استفاده کنید." msgid "*len* must be greater than or equal to ``0``." -msgstr "" +msgstr "*len* باید بزرگ‌تر یا مساوی ``0`` باشد." msgid "This function always succeeds." -msgstr "" +msgstr "این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Generic hashing function that is meant to be put into a type object's ``tp_hash`` slot. Its result only depends on the object's identity." +msgid "" +"Generic hashing function that is meant to be put into a type object's " +"``tp_hash`` slot. Its result only depends on the object's identity." msgstr "" +"تابع هش عمومی‌ای که برای قرار گرفتن در جایگاه ``tp_hash`` شیء نوع در نظر " +"گرفته شده است. نتیجه‌ی آن تنها به همانی شیء بستگی دارد." msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`." -msgstr "" +msgstr "در سی‌پایتون، این معادل :c:func:`Py_HashPointer` است." diff --git a/c-api/import.po b/c-api/import.po index c495a7e92..0dd69e96d 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -23,139 +23,367 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Importing Modules" -msgstr "" +msgstr "ایمپورت کردن ماژول‌ها" -msgid "This is a wrapper around :c:func:`PyImport_Import()` which takes a :c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`." +msgid "" +"This is a wrapper around :c:func:`PyImport_Import()` which takes a " +":c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`." msgstr "" +"این یک دربرگیرنده در اطراف :c:func:`PyImport_Import()` است که به‌جای " +":c:expr:`PyObject *`، آرگومانی از نوع :c:expr:`const char *` می‌گیرد." -msgid "This function is a deprecated alias of :c:func:`PyImport_ImportModule`." +msgid "" +"This function is a deprecated alias of :c:func:`PyImport_ImportModule`." msgstr "" +"این تابع یک نام مستعار منسوخ برای :c:func:`PyImport_ImportModule` است." -msgid "This function used to fail immediately when the import lock was held by another thread. In Python 3.3 though, the locking scheme switched to per-module locks for most purposes, so this function's special behaviour isn't needed anymore." +msgid "" +"This function used to fail immediately when the import lock was held by " +"another thread. In Python 3.3 though, the locking scheme switched to per-" +"module locks for most purposes, so this function's special behaviour isn't " +"needed anymore." msgstr "" +"این تابع پیش‌تر زمانی که قفل ایمپورت توسط نخ دیگری نگه داشته می‌شد، بلافاصله" +" شکست می‌خورد. اما در پایتون 3.3، طرح‌واره قفل‌گذاری در اکثر موارد به " +"قفل‌های جداگانه برای هر ماژول تغییر کرد، بنابراین رفتار خاص این تابع دیگر " +"مورد نیاز نیست." msgid "Use :c:func:`PyImport_ImportModule` instead." -msgstr "" +msgstr "به جای آن از :c:func:`PyImport_ImportModule` استفاده کنید." -msgid "Import a module. This is best described by referring to the built-in Python function :func:`__import__`." +msgid "" +"Import a module. This is best described by referring to the built-in Python" +" function :func:`__import__`." msgstr "" +"ایمپورت کردن یک ماژول. این کار را به بهترین شکل می‌توان با ارجاع به تابع " +"توکار پایتون :func:`__import__` توصیف کرد." -msgid "The return value is a new reference to the imported module or top-level package, or ``NULL`` with an exception set on failure. Like for :func:`__import__`, the return value when a submodule of a package was requested is normally the top-level package, unless a non-empty *fromlist* was given." -msgstr "" +msgid "" +"The return value is a new reference to the imported module or top-level " +"package, or ``NULL`` with an exception set on failure. Like for " +":func:`__import__`, the return value when a submodule of a package was " +"requested is normally the top-level package, unless a non-empty *fromlist* " +"was given." +msgstr "" +"مقدار بازگشتی، ارجاعی جدید به ماژول یا بسته‌ی سطح‌بالا که ایمپورت شده است، " +"یا در صورت شکست ``NULL`` به همراه استثنایی تنظیم‌شده است. مانند " +":func:`__import__`، مقدار بازگشتی هنگامی که زیرماژولی از یک بسته درخواست شده" +" باشد، معمولاً بسته‌ی سطح‌بالا است، مگر آنکه *fromlist* غیرخالی داده شده " +"باشد." -msgid "Failing imports remove incomplete module objects, like with :c:func:`PyImport_ImportModule`." +msgid "" +"Failing imports remove incomplete module objects, like with " +":c:func:`PyImport_ImportModule`." msgstr "" +"ایمپورت‌های ناموفق، اشیاء ماژول ناقص را حذف می‌کنند، مانند " +":c:func:`PyImport_ImportModule`." -msgid "Import a module. This is best described by referring to the built-in Python function :func:`__import__`, as the standard :func:`__import__` function calls this function directly." +msgid "" +"Import a module. This is best described by referring to the built-in Python" +" function :func:`__import__`, as the standard :func:`__import__` function " +"calls this function directly." msgstr "" +"یک ماژول را ایمپورت می‌کند. این کار به بهترین شکل با ارجاع به تابع توکار " +"پایتون :func:`__import__` توصیف می‌شود، زیرا تابع استاندارد " +":func:`__import__` این تابع را مستقیماً فراخوانی می‌کند." -msgid "Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a UTF-8 encoded string instead of a Unicode object." +msgid "" +"Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a " +"UTF-8 encoded string instead of a Unicode object." msgstr "" +"مشابه :c:func:`PyImport_ImportModuleLevelObject`، اما نام به جای شیء یونیکد،" +" یک رشته کدگذاری‌شده با UTF-8 است." msgid "Negative values for *level* are no longer accepted." -msgstr "" +msgstr "مقادیر منفی برای *level* دیگر پذیرفته نمی‌شوند." -msgid "This is a higher-level interface that calls the current \"import hook function\" (with an explicit *level* of 0, meaning absolute import). It invokes the :func:`__import__` function from the ``__builtins__`` of the current globals. This means that the import is done using whatever import hooks are installed in the current environment." -msgstr "" +msgid "" +"This is a higher-level interface that calls the current \"import hook " +"function\" (with an explicit *level* of 0, meaning absolute import). It " +"invokes the :func:`__import__` function from the ``__builtins__`` of the " +"current globals. This means that the import is done using whatever import " +"hooks are installed in the current environment." +msgstr "" +"این یک رابط سطح بالاتر است که «تابع قلاب ایمپورت» فعلی را فراخوانی می‌کند " +"(با مقدار صریح ۰ برای *level*، به معنای ایمپورت مطلق). این رابط، تابع " +":func:`__import__` را از ``__builtins__`` موجود در سراسری‌های فعلی فراخوانی " +"می‌کند. این بدان معناست که ایمپورت با استفاده از هر قلاب ایمپورتی که در محیط" +" فعلی نصب شده باشد انجام می‌شود." msgid "This function always uses absolute imports." -msgstr "" +msgstr "این تابع همیشه از ایمپورت‌های مطلق استفاده می‌کند." -msgid "Reload a module. Return a new reference to the reloaded module, or ``NULL`` with an exception set on failure (the module still exists in this case)." +msgid "" +"Reload a module. Return a new reference to the reloaded module, or ``NULL``" +" with an exception set on failure (the module still exists in this case)." msgstr "" +"یک ماژول را بارگذاری مجدد می‌کند. ارجاعی جدید به ماژولِ بارگذاری‌مجدد‌شده " +"برمی‌گرداند، یا در صورت شکست ``NULL`` همراه با تنظیم یک استثنا برمی‌گرداند " +"(در این حالت ماژول همچنان وجود دارد)." msgid "Return the module object corresponding to a module name." -msgstr "" +msgstr "شیء ماژول متناظر با نام یک ماژول را برمی‌گرداند." -msgid "The *name* argument may be of the form ``package.module``. First check the modules dictionary if there's one there, and if not, create a new one and insert it in the modules dictionary." +msgid "" +"The *name* argument may be of the form ``package.module``. First check the " +"modules dictionary if there's one there, and if not, create a new one and " +"insert it in the modules dictionary." msgstr "" +"آرگومان *name* ممکن است به شکل ``package.module`` باشد. ابتدا بررسی کنید که " +"آیا ماژولی در دیکشنری ماژول‌ها وجود دارد یا نه، و اگر وجود ندارد، یک ماژول " +"جدید ایجاد کرده و آن را در دیکشنری ماژول‌ها درج کنید." -msgid "Return a :term:`strong reference` to the module on success. Return ``NULL`` with an exception set on failure." +msgid "" +"Return a :term:`strong reference` to the module on success. Return ``NULL`` " +"with an exception set on failure." msgstr "" +"در صورت موفقیت، یک :term:`strong reference` به ماژول برمی‌گرداند. در صورت " +"شکست، ``NULL`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند." msgid "The module name *name* is decoded from UTF-8." -msgstr "" +msgstr "نام ماژول *name* از UTF-8 کدگشایی می‌شود." -msgid "This function does not load or import the module; if the module wasn't already loaded, you will get an empty module object. Use :c:func:`PyImport_ImportModule` or one of its variants to import a module. Package structures implied by a dotted name for *name* are not created if not already present." -msgstr "" +msgid "" +"This function does not load or import the module; if the module wasn't " +"already loaded, you will get an empty module object. Use " +":c:func:`PyImport_ImportModule` or one of its variants to import a module. " +"Package structures implied by a dotted name for *name* are not created if " +"not already present." +msgstr "" +"این تابع ماژول را بارگذاری یا ایمپورت نمی‌کند؛ اگر ماژول از قبل بارگذاری " +"نشده باشد، یک شیء ماژول خالی دریافت خواهید کرد. برای ایمپورت کردن یک ماژول، " +"از :c:func:`PyImport_ImportModule` یا یکی از انواع آن استفاده کنید. " +"ساختارهای بسته‌ای که نام نقطه‌دارِ *name* بر آن‌ها دلالت می‌کند، اگر از قبل " +"وجود نداشته باشند ایجاد نمی‌شوند." -msgid "Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed reference` and *name* is a Python :class:`str` object." +msgid "" +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference` and *name* is a Python :class:`str` object." msgstr "" +"مشابه :c:func:`PyImport_AddModuleRef`، اما یک :term:`borrowed reference` " +"برمی‌گرداند و *name* یک شیء :class:`str` پایتون است." -msgid "Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed reference`." +msgid "" +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference`." msgstr "" +"مشابه :c:func:`PyImport_AddModuleRef` است، اما یک :term:`borrowed reference`" +" برمی‌گرداند." -msgid "Given a module name (possibly of the form ``package.module``) and a code object read from a Python bytecode file or obtained from the built-in function :func:`compile`, load the module. Return a new reference to the module object, or ``NULL`` with an exception set if an error occurred. *name* is removed from :data:`sys.modules` in error cases, even if *name* was already in :data:`sys.modules` on entry to :c:func:`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :data:`sys.modules` is dangerous, as imports of such modules have no way to know that the module object is an unknown (and probably damaged with respect to the module author's intents) state." -msgstr "" +msgid "" +"Given a module name (possibly of the form ``package.module``) and a code " +"object read from a Python bytecode file or obtained from the built-in " +"function :func:`compile`, load the module. Return a new reference to the " +"module object, or ``NULL`` with an exception set if an error occurred. " +"*name* is removed from :data:`sys.modules` in error cases, even if *name* " +"was already in :data:`sys.modules` on entry to " +":c:func:`PyImport_ExecCodeModule`. Leaving incompletely initialized modules" +" in :data:`sys.modules` is dangerous, as imports of such modules have no way" +" to know that the module object is an unknown (and probably damaged with " +"respect to the module author's intents) state." +msgstr "" +"با دریافت نام یک ماژول (احتمالاً به شکل ``package.module``) و یک شیء کد که " +"از یک پرونده بایت‌کد پایتون خوانده شده یا از تابع توکار :func:`compile` به " +"دست آمده است، ماژول را بارگذاری می‌کند. یک ارجاع جدید به شیء ماژول " +"برمی‌گرداند، یا در صورت وقوع خطا، ``NULL`` را همراه با یک استثنای تنظیم‌شده " +"برمی‌گرداند. *name* در موارد خطا از :data:`sys.modules` حذف می‌شود، حتی اگر " +"*name* هنگام ورود به :c:func:`PyImport_ExecCodeModule` از قبل در " +":data:`sys.modules` موجود بوده باشد. باقی گذاشتن ماژول‌هایی که مقداردهی " +"اولیه‌شان کامل نشده است در :data:`sys.modules` خطرناک است، زیرا ایمپورت‌های " +"چنین ماژول‌هایی هیچ راهی برای دانستن این موضوع ندارند که شیء ماژول در وضعیتی" +" ناشناخته (و احتمالاً نسبت به مقاصد نویسنده‌ی ماژول آسیب‌دیده) قرار دارد." -msgid "The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be set, if not set already, with the appropriate values. The spec's loader will be set to the module's :attr:`!__loader__` (if set) and to an instance of :class:`~importlib.machinery.SourceFileLoader` otherwise." +msgid "" +"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be" +" set, if not set already, with the appropriate values. The spec's loader " +"will be set to the module's :attr:`!__loader__` (if set) and to an instance " +"of :class:`~importlib.machinery.SourceFileLoader` otherwise." msgstr "" +":attr:`~module.__spec__` و :attr:`~module.__loader__` ماژول، در صورتی که از " +"قبل تنظیم‌نشده باشند، با مقادیر مناسب تنظیم خواهند شد. بارگذار مشخصه به " +":attr:`!__loader__` ماژول (در صورت تنظیم بودن) و در غیر این صورت به نمونه‌ای" +" از :class:`~importlib.machinery.SourceFileLoader` تنظیم خواهد شد." -msgid "The module's :attr:`~module.__file__` attribute will be set to the code object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module.__cached__` will also be set." +msgid "" +"The module's :attr:`~module.__file__` attribute will be set to the code " +"object's :attr:`~codeobject.co_filename`. If applicable, " +":attr:`~module.__cached__` will also be set." msgstr "" +"ویژگی :attr:`~module.__file__` ماژول به :attr:`~codeobject.co_filename` شیء " +"کد تنظیم خواهد شد. در صورت وجود، :attr:`~module.__cached__` نیز تنظیم خواهد " +"شد." -msgid "This function will reload the module if it was already imported. See :c:func:`PyImport_ReloadModule` for the intended way to reload a module." +msgid "" +"This function will reload the module if it was already imported. See " +":c:func:`PyImport_ReloadModule` for the intended way to reload a module." msgstr "" +"این تابع در صورتی که ماژول قبلاً ایمپورت شده باشد، آن را بازبارگذاری می‌کند." +" برای روش موردنظرِ بازبارگذاری یک ماژول، :c:func:`PyImport_ReloadModule` را " +"ببینید." -msgid "If *name* points to a dotted name of the form ``package.module``, any package structures not already created will still not be created." +msgid "" +"If *name* points to a dotted name of the form ``package.module``, any " +"package structures not already created will still not be created." msgstr "" +"اگر *name* به نامی نقطه‌گذاری‌شده به شکل ``package.module`` اشاره کند، هر " +"ساختار بسته‌ای که از قبل ایجاد نشده باشد، همچنان ایجاد نخواهد شد." -msgid "See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:`PyImport_ExecCodeModuleWithPathnames`." +msgid "" +"See also :c:func:`PyImport_ExecCodeModuleEx` and " +":c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr "" +"همچنین ببینید :c:func:`PyImport_ExecCodeModuleEx` و " +":c:func:`PyImport_ExecCodeModuleWithPathnames`." -msgid "The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +msgid "" +"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" +"تنظیم کردن :attr:`~module.__cached__` و :attr:`~module.__loader__` منسوخ شده" +" است. برای جایگزین‌ها به :class:`~importlib.machinery.ModuleSpec` مراجعه " +"کنید." -msgid "Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` attribute of the module object is set to *pathname* if it is non-``NULL``." +msgid "" +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " +"attribute of the module object is set to *pathname* if it is non-``NULL``." msgstr "" +"مانند :c:func:`PyImport_ExecCodeModule`، اما اگر *مسیرنام* غیر ``NULL`` " +"باشد، ویژگی :attr:`~module.__file__` شیء ماژول به *مسیرنام* تنظیم می‌شود." msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." -msgstr "" +msgstr "همچنین :c:func:`PyImport_ExecCodeModuleWithPathnames` را ببینید." -msgid "Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` attribute of the module object is set to *cpathname* if it is non-``NULL``. Of the three functions, this is the preferred one to use." +msgid "" +"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__`" +" attribute of the module object is set to *cpathname* if it is non-``NULL``." +" Of the three functions, this is the preferred one to use." msgstr "" +"مانند :c:func:`PyImport_ExecCodeModuleEx`، اما ویژگی " +":attr:`~module.__cached__` شیء ماژول در صورتی که *cpathname* غیر ``NULL`` " +"باشد، برابر *cpathname* تنظیم می‌شود. از میان این سه تابع، استفاده از این " +"تابع ترجیح دارد." -msgid "Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +msgid "" +"Setting :attr:`~module.__cached__` is deprecated. See " +":class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" +"تنظیم کردن :attr:`~module.__cached__` منسوخ شده است. برای جایگزین‌ها به " +":class:`~importlib.machinery.ModuleSpec` مراجعه کنید." -msgid "Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and *cpathname* are UTF-8 encoded strings. Attempts are also made to figure out what the value for *pathname* should be from *cpathname* if the former is set to ``NULL``." +msgid "" +"Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " +"*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " +"what the value for *pathname* should be from *cpathname* if the former is " +"set to ``NULL``." msgstr "" +"مانند :c:func:`PyImport_ExecCodeModuleObject`، اما *name*، *pathname* و " +"*cpathname* رشته‌های کدگذاری‌شده با UTF-8 هستند. اگر *pathname* برابر " +"``NULL`` قرار داده شده باشد، تلاش‌هایی نیز برای تعیین مقدار *pathname* از " +"روی *cpathname* صورت می‌گیرد." -msgid "Uses :func:`!imp.source_from_cache` in calculating the source path if only the bytecode path is provided." +msgid "" +"Uses :func:`!imp.source_from_cache` in calculating the source path if only " +"the bytecode path is provided." msgstr "" +"اگر تنها مسیر بایت‌کد ارائه‌شده باشد، از :func:`!imp.source_from_cache` برای" +" محاسبه‌ی مسیر منبع استفاده می‌کند." msgid "No longer uses the removed :mod:`!imp` module." -msgstr "" +msgstr "دیگر از ماژول حذف‌شده :mod:`!imp` استفاده نمی‌کند." -msgid "Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` file). The magic number should be present in the first four bytes of the bytecode file, in little-endian byte order. Returns ``-1`` on error." +msgid "" +"Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` " +"file). The magic number should be present in the first four bytes of the " +"bytecode file, in little-endian byte order. Returns ``-1`` on error." msgstr "" +"عدد جادویی پرونده‌های بایت‌کد پایتون (که با نام پرونده‌ی :file:`.pyc` نیز " +"شناخته می‌شود) را برمی‌گرداند. عدد جادویی باید در چهار بایت نخست پرونده‌ی " +"بایت‌کد، با ترتیب بایت کوچک‌اندیان، موجود باشد. در صورت خطا ``-1`` را " +"برمی‌گرداند." msgid "Return value of ``-1`` upon failure." -msgstr "" +msgstr "بازگشت مقدار ``-1`` در صورت شکست." -msgid "Return the magic tag string for :pep:`3147` format Python bytecode file names. Keep in mind that the value at ``sys.implementation.cache_tag`` is authoritative and should be used instead of this function." +msgid "" +"Return the magic tag string for :pep:`3147` format Python bytecode file " +"names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " +"authoritative and should be used instead of this function." msgstr "" +"رشته برچسب جادویی (magic tag) را برای نام پرونده‌های بایت‌کد پایتون با قالب " +":pep:`3147` برمی‌گرداند. به خاطر داشته باشید که مقدار " +"``sys.implementation.cache_tag`` معتبر است و باید به‌جای این تابع از آن " +"استفاده شود." -msgid "Return the dictionary used for the module administration (a.k.a. ``sys.modules``). Note that this is a per-interpreter variable." +msgid "" +"Return the dictionary used for the module administration (a.k.a. " +"``sys.modules``). Note that this is a per-interpreter variable." msgstr "" +"دیکشنری مورد استفاده برای مدیریت ماژول‌ها را برمی‌گرداند (که با نام " +"``sys.modules`` نیز شناخته می‌شود). توجه داشته باشید که این یک متغیر به‌ازای" +" هر مفسر است." -msgid "Return the already imported module with the given name. If the module has not been imported yet then returns ``NULL`` but does not set an error. Returns ``NULL`` and sets an error if the lookup failed." +msgid "" +"Return the already imported module with the given name. If the module has " +"not been imported yet then returns ``NULL`` but does not set an error. " +"Returns ``NULL`` and sets an error if the lookup failed." msgstr "" +"ماژول از پیش ایمپورت‌شده با نام داده‌شده را برمی‌گرداند. اگر ماژول هنوز " +"ایمپورت نشده باشد، ``NULL`` برمی‌گرداند اما خطایی تنظیم نمی‌کند. اگر جستجو " +"ناموفق باشد، ``NULL`` برمی‌گرداند و خطایی تنظیم می‌کند." -msgid "Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item *path*, possibly by fetching it from the :data:`sys.path_importer_cache` dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook is found that can handle the path item. Return ``None`` if no hook could; this tells our caller that the :term:`path based finder` could not find a finder for this path item. Cache the result in :data:`sys.path_importer_cache`. Return a new reference to the finder object." -msgstr "" +msgid "" +"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item " +"*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " +"dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook" +" is found that can handle the path item. Return ``None`` if no hook could; " +"this tells our caller that the :term:`path based finder` could not find a " +"finder for this path item. Cache the result in " +":data:`sys.path_importer_cache`. Return a new reference to the finder " +"object." +msgstr "" +"یک شیء یابنده برای ورودی *path* از :data:`sys.path`/:attr:`!pkg.__path__` " +"برمی‌گرداند، که ممکن است آن را از دیکشنری :data:`sys.path_importer_cache` " +"واکشی کند. اگر هنوز نهان‌سازی نشده باشد، :data:`sys.path_hooks` را پیمایش " +"می‌کند تا قلابی پیدا شود که بتواند ورودی مسیر را مدیریت کند. اگر هیچ قلابی " +"نتواند، ``None`` برمی‌گرداند؛ این به فراخوان‌کننده‌ی ما می‌گوید که " +":term:`path based finder` نتوانسته است یابنده‌ای برای این ورودی مسیر پیدا " +"کند. نتیجه را در :data:`sys.path_importer_cache` نهان‌سازی می‌کند. یک ارجاع " +"جدید به شیء یابنده برمی‌گرداند." -msgid "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the module is not found, and ``-1`` with an exception set if the initialization failed. To access the imported module on a successful load, use :c:func:`PyImport_ImportModule`. (Note the misnomer --- this function would reload the module if it was already imported.)" -msgstr "" +msgid "" +"Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " +"module is not found, and ``-1`` with an exception set if the initialization " +"failed. To access the imported module on a successful load, use " +":c:func:`PyImport_ImportModule`. (Note the misnomer --- this function would" +" reload the module if it was already imported.)" +msgstr "" +"یک ماژول منجمد با نام *name* را بارگذاری می‌کند. در صورت موفقیت مقدار " +"``1``، اگر ماژول یافت نشود مقدار ``0`` و اگر مقداردهی اولیه شکست بخورد مقدار" +" ``-1`` به همراه استثنای تنظیم‌شده برمی‌گرداند. برای دسترسی به ماژول " +"ایمپورت‌شده پس از بارگذاری موفق، از :c:func:`PyImport_ImportModule` استفاده " +"کنید. (توجه داشته باشید که این نام‌گذاری نادرست است --- این تابع در صورتی " +"که ماژول قبلاً ایمپورت‌شده باشد، آن را مجدداً بارگذاری می‌کند.)" msgid "The ``__file__`` attribute is no longer set on the module." -msgstr "" +msgstr "ویژگی ``__file__`` دیگر بر روی ماژول تنظیم نمی‌شود." -msgid "Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a UTF-8 encoded string instead of a Unicode object." +msgid "" +"Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " +"UTF-8 encoded string instead of a Unicode object." msgstr "" +"مشابه :c:func:`PyImport_ImportFrozenModuleObject` است، اما نام به جای شیء " +"یونیکد، یک رشته کدگذاری‌شده با UTF-8 است." -msgid "This is the structure type definition for frozen module descriptors, as generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the Python source distribution). Its definition, found in :file:`Include/import.h`, is::" +msgid "" +"This is the structure type definition for frozen module descriptors, as " +"generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the" +" Python source distribution). Its definition, found in " +":file:`Include/import.h`, is::" msgstr "" +"این تعریف نوع ساختار برای توصیف‌گرهای ماژول منجمد (frozen) است، همان‌طور که " +"توسط ابزار :program:`freeze` تولید می‌شود (به :file:`Tools/freeze/` در توزیع" +" سورس پایتون مراجعه کنید). تعریف آن که در :file:`Include/import.h` آمده است،" +" چنین است::" msgid "" "struct _frozen {\n" @@ -165,66 +393,145 @@ msgid "" " bool is_package;\n" "};" msgstr "" +"struct _frozen {\n" +" const char *name;\n" +" const unsigned char *code;\n" +" int size;\n" +" bool is_package;\n" +"};" -msgid "The new ``is_package`` field indicates whether the module is a package or not. This replaces setting the ``size`` field to a negative value." +msgid "" +"The new ``is_package`` field indicates whether the module is a package or " +"not. This replaces setting the ``size`` field to a negative value." msgstr "" +"فیلد جدید ``is_package`` نشان می‌دهد که ماژول یک بسته است یا خیر. این کار " +"جایگزین تنظیم فیلد ``size`` به مقدار منفی می‌شود." -msgid "This pointer is initialized to point to an array of :c:struct:`_frozen` records, terminated by one whose members are all ``NULL`` or zero. When a frozen module is imported, it is searched in this table. Third-party code could play tricks with this to provide a dynamically created collection of frozen modules." -msgstr "" +msgid "" +"This pointer is initialized to point to an array of :c:struct:`_frozen` " +"records, terminated by one whose members are all ``NULL`` or zero. When a " +"frozen module is imported, it is searched in this table. Third-party code " +"could play tricks with this to provide a dynamically created collection of " +"frozen modules." +msgstr "" +"این اشاره‌گر برای اشاره به آرایه‌ای از رکوردهای :c:struct:`_frozen` مقداردهی" +" اولیه می‌شود که با رکوردی پایان می‌یابد که تمام اعضای آن ``NULL`` یا صفر " +"هستند. هنگامی که یک ماژول منجمد ایمپورت می‌شود، در این جدول جستجو می‌شود. کد" +" شخص ثالث می‌تواند با این اشاره‌گر ترفندهایی بزند تا مجموعه‌ای از ماژول‌های " +"منجمد که به‌صورت پویا ایجاد شده‌اند فراهم کند." -msgid "Add a single module to the existing table of built-in modules. This is a convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning ``-1`` if the table could not be extended. The new module can be imported by the name *name*, and uses the function *initfunc* as the initialization function called on the first attempted import. This should be called before :c:func:`Py_Initialize`." -msgstr "" +msgid "" +"Add a single module to the existing table of built-in modules. This is a " +"convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " +"``-1`` if the table could not be extended. The new module can be imported " +"by the name *name*, and uses the function *initfunc* as the initialization " +"function called on the first attempted import. This should be called before" +" :c:func:`Py_Initialize`." +msgstr "" +"یک ماژول تکی را به جدول موجود ماژول‌های توکار اضافه می‌کند. این تابع یک پوشش" +" راحتی حول :c:func:`PyImport_ExtendInittab` است که در صورتی که نتوان جدول را" +" گسترش داد، مقدار ``-1`` را برمی‌گرداند. ماژول جدید را می‌توان با نام *name*" +" ایمپورت کرد و از تابع *initfunc* به عنوان تابع مقداردهی اولیه‌ای که در " +"نخستین تلاش برای ایمپورت فراخوانی می‌شود، استفاده می‌کند. این تابع باید پیش " +"از :c:func:`Py_Initialize` فراخوانی شود." -msgid "Structure describing a single entry in the list of built-in modules. Programs which embed Python may use an array of these structures in conjunction with :c:func:`PyImport_ExtendInittab` to provide additional built-in modules. The structure consists of two members:" +msgid "" +"Structure describing a single entry in the list of built-in modules. " +"Programs which embed Python may use an array of these structures in " +"conjunction with :c:func:`PyImport_ExtendInittab` to provide additional " +"built-in modules. The structure consists of two members:" msgstr "" +"ساختاری که یک ورودی واحد در فهرست ماژول‌های توکار را توصیف می‌کند. " +"برنامه‌هایی که پایتون را تعبیه می‌کنند می‌توانند از آرایه‌ای از این " +"ساختار‌ها همراه با :c:func:`PyImport_ExtendInittab` برای فراهم کردن " +"ماژول‌های توکار اضافی استفاده کنند. این ساختار از دو عضو تشکیل شده است:" msgid "The module name, as an ASCII encoded string." -msgstr "" +msgstr "نام ماژول، به‌صورت یک رشته کدگذاری‌شده با اسکی." msgid "Initialization function for a module built into the interpreter." msgstr "" +"تابع مقداردهی اولیه برای ماژولی که به‌صورت توکار در مفسر ساخته‌شده است." -msgid "Add a collection of modules to the table of built-in modules. The *newtab* array must end with a sentinel entry which contains ``NULL`` for the :c:member:`~_inittab.name` field; failure to provide the sentinel value can result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient memory could be allocated to extend the internal table. In the event of failure, no modules are added to the internal table. This must be called before :c:func:`Py_Initialize`." -msgstr "" +msgid "" +"Add a collection of modules to the table of built-in modules. The *newtab* " +"array must end with a sentinel entry which contains ``NULL`` for the " +":c:member:`~_inittab.name` field; failure to provide the sentinel value can " +"result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient" +" memory could be allocated to extend the internal table. In the event of " +"failure, no modules are added to the internal table. This must be called " +"before :c:func:`Py_Initialize`." +msgstr "" +"مجموعه‌ای از ماژول‌ها را به جدول ماژول‌های توکار اضافه می‌کند. آرایه " +"*newtab* باید با یک ورودی نشانگر پایان یابد که برای فیلد " +":c:member:`~_inittab.name` مقدار ``NULL`` را در بر دارد؛ ارائه‌نکردن مقدار " +"نشانگر می‌تواند به خطای حافظه منجر شود. در صورت موفقیت ``0`` و در صورتی که " +"حافظه کافی برای گسترش جدول داخلی تخصیص داده نشود، ``-1`` برمی‌گرداند. در " +"صورت شکست، هیچ ماژولی به جدول داخلی اضافه نمی‌شود. این باید پیش از " +":c:func:`Py_Initialize` فراخوانی شود." -msgid "If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` must be called before each Python initialization." +msgid "" +"If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` or" +" :c:func:`PyImport_ExtendInittab` must be called before each Python " +"initialization." msgstr "" +"اگر پایتون چندین بار مقداردهی اولیه شود، :c:func:`PyImport_AppendInittab` یا" +" :c:func:`PyImport_ExtendInittab` باید پیش از هر مقداردهی اولیه پایتون " +"فراخوانی شوند." -msgid "The table of built-in modules used by Python initialization. Do not use this directly; use :c:func:`PyImport_AppendInittab` and :c:func:`PyImport_ExtendInittab` instead." +msgid "" +"The table of built-in modules used by Python initialization. Do not use this" +" directly; use :c:func:`PyImport_AppendInittab` and " +":c:func:`PyImport_ExtendInittab` instead." msgstr "" +"جدول ماژول‌های توکار مورد استفاده در راه‌اندازی پایتون. آن را مستقیماً به " +"کار نبرید؛ به‌جای آن از :c:func:`PyImport_AppendInittab` و " +":c:func:`PyImport_ExtendInittab` استفاده کنید." msgid "Import the module *mod_name* and get its attribute *attr_name*." msgstr "" +"ماژول *mod_name* را ایمپورت کنید و ویژگی *attr_name* آن را دریافت کنید." msgid "Names must be Python :class:`str` objects." -msgstr "" +msgstr "نام‌ها باید شیءهای :class:`str` پایتون باشند." -msgid "Helper function combining :c:func:`PyImport_Import` and :c:func:`PyObject_GetAttr`. For example, it can raise :exc:`ImportError` if the module is not found, and :exc:`AttributeError` if the attribute doesn't exist." +msgid "" +"Helper function combining :c:func:`PyImport_Import` and " +":c:func:`PyObject_GetAttr`. For example, it can raise :exc:`ImportError` if " +"the module is not found, and :exc:`AttributeError` if the attribute doesn't " +"exist." msgstr "" +"تابع کمکی که :c:func:`PyImport_Import` و :c:func:`PyObject_GetAttr` را با هم" +" ترکیب می‌کند. برای مثال، اگر ماژول یافت نشود می‌تواند :exc:`ImportError` و " +"اگر ویژگی وجود نداشته باشد می‌تواند :exc:`AttributeError` را پرتاب کند." -msgid "Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded strings instead of Python :class:`str` objects." +msgid "" +"Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded " +"strings instead of Python :class:`str` objects." msgstr "" +"مشابه :c:func:`PyImport_ImportModuleAttr` است، اما نام‌ها به‌جای اشیاء " +":class:`str` پایتون، رشته‌های کدگذاری‌شده با UTF-8 هستند." msgid "package variable" -msgstr "" +msgstr "متغیر بسته" msgid "__all__" -msgstr "" +msgstr "__all__" msgid "__all__ (package variable)" -msgstr "" +msgstr "__all__ (متغیر بسته)" msgid "modules (in module sys)" -msgstr "" +msgstr "modules (در ماژول sys)" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "__import__" -msgstr "" +msgstr "__import__" msgid "compile" -msgstr "" +msgstr "کامپایل" msgid "freeze utility" -msgstr "" +msgstr "ابزار انجماد (freeze)" diff --git a/c-api/index.po b/c-api/index.po index 26bf83010..fcf7c17db 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -24,7 +24,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Python/C API reference manual" -msgstr "" +msgstr "راهنمای مرجع Python/C API" -msgid "This manual documents the API used by C and C++ programmers who want to write extension modules or embed Python. It is a companion to :ref:`extending-index`, which describes the general principles of extension writing but does not document the API functions in detail." +msgid "" +"This manual documents the API used by C and C++ programmers who want to " +"write extension modules or embed Python. It is a companion to " +":ref:`extending-index`, which describes the general principles of extension " +"writing but does not document the API functions in detail." msgstr "" +"این راهنما، API مورد استفاده‌ی برنامه‌نویسان C و C++ که می‌خواهند ماژول‌های " +"توسعه‌ای بنویسند یا پایتون را جاسازی کنند، مستندسازی می‌کند. این راهنما مکمل" +" :ref:`extending-index` است که اصول کلی نوشتن ماژول‌های توسعه‌ای را شرح " +"می‌دهد، اما توابع API را به‌تفصیل مستندسازی نمی‌کند." diff --git a/c-api/init.po b/c-api/init.po index e0661be5c..aa3d69da9 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -25,25 +25,25 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Initialization, finalization, and threads" -msgstr "" +msgstr "راه‌اندازی، نهایی‌سازی و نخ‌ها" msgid "This page has been split up into the following:" -msgstr "" +msgstr "این صفحه به موارد زیر تقسیم شده است:" msgid ":ref:`initialization`" -msgstr "" +msgstr ":ref:`initialization`" msgid ":ref:`threads`" -msgstr "" +msgstr ":ref:`threads`" msgid ":ref:`synchronization`" -msgstr "" +msgstr ":ref:`synchronization`" msgid ":ref:`thread-local-storage`" -msgstr "" +msgstr ":ref:`thread-local-storage`" msgid ":ref:`sub-interpreter-support`" -msgstr "" +msgstr ":ref:`sub-interpreter-support`" msgid ":ref:`profiling`" -msgstr "" +msgstr ":ref:`profiling`" diff --git a/c-api/init_config.po b/c-api/init_config.po index 9a045c9cb..2403c0915 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"PO-Revision-Date: 2026-09-04 20:24+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,30 +23,41 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Python Initialization Configuration" -msgstr "" +msgstr "پیکربندی راه‌اندازی پایتون" msgid "PyInitConfig C API" -msgstr "" +msgstr "API زبان C برای PyInitConfig" msgid "Python can be initialized with :c:func:`Py_InitializeFromInitConfig`." msgstr "" +"پایتون را می‌توان با :c:func:`Py_InitializeFromInitConfig` مقداردهی اولیه کرد." -msgid "The :c:func:`Py_RunMain` function can be used to write a customized Python program." +msgid "" +"The :c:func:`Py_RunMain` function can be used to write a customized Python " +"program." msgstr "" +"از تابع :c:func:`Py_RunMain` می‌توان برای نوشتن یک برنامه‌ی سفارشی پایتون استفاده " +"کرد." -msgid "See also :ref:`Initialization, Finalization, and Threads `." -msgstr "" +msgid "" +"See also :ref:`Initialization, Finalization, and Threads `." +msgstr "همچنین ببینید :ref:`مقداردهی اولیه، نهایی‌سازی و نخ‌ها `." msgid ":pep:`741` \"Python Configuration C API\"." -msgstr "" +msgstr ":pep:`741` «C API پیکربندی پایتون»." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "Example of customized Python always running with the :ref:`Python Development Mode ` enabled; return ``-1`` on error:" +msgid "" +"Example of customized Python always running with the :ref:`Python Development " +"Mode ` enabled; return ``-1`` on error:" msgstr "" +"نمونه‌ای از پایتون سفارشی‌شده که همیشه با :ref:`حالت توسعه پایتون ` فعال " +"اجرا می‌شود؛ در صورت خطا ``-1`` را برمی‌گرداند:" msgid "" "int init_python(void)\n" @@ -83,684 +94,852 @@ msgid "" " }\n" "}" msgstr "" +"int init_python(void)\n" +"{\n" +" PyInitConfig *config = PyInitConfig_Create();\n" +" if (config == NULL) {\n" +" printf(\"PYTHON INIT ERROR: memory allocation failed\\n\");\n" +" return -1;\n" +" }\n" +"\n" +" // Enable the Python Development Mode\n" +" if (PyInitConfig_SetInt(config, \"dev_mode\", 1) < 0) {\n" +" goto error;\n" +" }\n" +"\n" +" // Initialize Python with the configuration\n" +" if (Py_InitializeFromInitConfig(config) < 0) {\n" +" goto error;\n" +" }\n" +" PyInitConfig_Free(config);\n" +" return 0;\n" +"\n" +"error:\n" +" {\n" +" // Display the error message.\n" +" //\n" +" // This uncommon braces style is used, because you cannot make\n" +" // goto targets point to variable declarations.\n" +" const char *err_msg;\n" +" (void)PyInitConfig_GetError(config, &err_msg);\n" +" printf(\"PYTHON INIT ERROR: %s\\n\", err_msg);\n" +" PyInitConfig_Free(config);\n" +" return -1;\n" +" }\n" +"}" msgid "Create Config" -msgstr "" +msgstr "ایجاد پیکربندی" msgid "Opaque structure to configure the Python initialization." -msgstr "" +msgstr "ساختار غیرشفاف برای پیکربندی مقداردهی اولیه پایتون." -msgid "Create a new initialization configuration using :ref:`Isolated Configuration ` default values." +msgid "" +"Create a new initialization configuration using :ref:`Isolated Configuration " +"` default values." msgstr "" +"یک پیکربندی مقداردهی اولیه‌ی جدید با استفاده از مقادیر پیش‌فرض :ref:`پیکربندی " +"ایزوله ` ایجاد کنید." msgid "It must be freed by :c:func:`PyInitConfig_Free`." -msgstr "" +msgstr "آن باید توسط :c:func:`PyInitConfig_Free` آزاد شود." msgid "Return ``NULL`` on memory allocation failure." -msgstr "" +msgstr "در صورت شکست تخصیص حافظه، ``NULL`` را برمی‌گرداند." msgid "Free memory of the initialization configuration *config*." -msgstr "" +msgstr "آزاد کردن حافظه‌ی پیکربندی مقداردهی اولیه *config*." msgid "If *config* is ``NULL``, no operation is performed." -msgstr "" +msgstr "اگر *config* برابر ``NULL`` باشد، هیچ عملیاتی انجام نمی‌شود." msgid "Error Handling" -msgstr "" +msgstr "مدیریت خطا" msgid "Get the *config* error message." -msgstr "" +msgstr "دریافت پیام خطای *پیکربندی*." msgid "Set *\\*err_msg* and return ``1`` if an error is set." msgstr "" +"در صورتی که خطا تنظیم شده باشد، *\\*err_msg* را تنظیم کرده و ``1`` برمی‌گرداند." msgid "Set *\\*err_msg* to ``NULL`` and return ``0`` otherwise." msgstr "" +"در غیر این صورت، *\\*err_msg* را برابر ``NULL`` قرار دهید و ``0`` را برگردانید." msgid "An error message is a UTF-8 encoded string." -msgstr "" +msgstr "پیام خطا یک رشته کدگذاری‌شده با UTF-8 است." msgid "If *config* has an exit code, format the exit code as an error message." msgstr "" +"اگر *config* دارای کد خروج باشد، کد خروج را به‌صورت یک پیام خطا قالب‌بندی کنید." -msgid "The error message remains valid until another ``PyInitConfig`` function is called with *config*. The caller doesn't have to free the error message." +msgid "" +"The error message remains valid until another ``PyInitConfig`` function is " +"called with *config*. The caller doesn't have to free the error message." msgstr "" +"پیام خطا تا زمانی که تابع ``PyInitConfig`` دیگری با *config* فراخوانی شود معتبر " +"باقی می‌ماند. فراخوانی‌کننده نیازی به آزاد کردن پیام خطا ندارد." msgid "Get the *config* exit code." -msgstr "" +msgstr "گرفتن کد خروج *config*." msgid "Set *\\*exitcode* and return ``1`` if *config* has an exit code set." msgstr "" +"اگر *config* دارای کد خروج تنظیم‌شده باشد، *\\*exitcode* را تنظیم می‌کند و ``1`` " +"را برمی‌گرداند." msgid "Return ``0`` if *config* has no exit code set." -msgstr "" +msgstr "اگر *config* کد خروجی تنظیم‌شده‌ای نداشته باشد، ``0`` را برمی‌گرداند." -msgid "Only the ``Py_InitializeFromInitConfig()`` function can set an exit code if the ``parse_argv`` option is non-zero." +msgid "" +"Only the ``Py_InitializeFromInitConfig()`` function can set an exit code if the " +"``parse_argv`` option is non-zero." msgstr "" +"تنها تابع ``Py_InitializeFromInitConfig()`` می‌تواند در صورتی که گزینه " +"``parse_argv`` ناصفر باشد، کد خروج را تنظیم کند." -msgid "An exit code can be set when parsing the command line failed (exit code ``2``) or when a command line option asks to display the command line help (exit code ``0``)." +msgid "" +"An exit code can be set when parsing the command line failed (exit code ``2``) " +"or when a command line option asks to display the command line help (exit code " +"``0``)." msgstr "" +"می‌توان یک کد خروج را هنگامی تنظیم کرد که تجزیه‌ی خط فرمان شکست بخورد (کد خروج " +"``2``) یا هنگامی که یک گزینه‌ی خط فرمان درخواست نمایش راهنمای خط فرمان کند (کد " +"خروج ``0``)." msgid "Get Options" -msgstr "" +msgstr "دریافت گزینه‌ها" -msgid "The configuration option *name* parameter must be a non-NULL null-terminated UTF-8 encoded string. See :ref:`Configuration Options `." +msgid "" +"The configuration option *name* parameter must be a non-NULL null-terminated " +"UTF-8 encoded string. See :ref:`Configuration Options `." msgstr "" +"پارامتر *name* گزینه پیکربندی باید یک رشته غیر NULL، پایان‌یافته با نویسه تهی و " +"کدگذاری‌شده با UTF-8 باشد. به :ref:`گزینه‌های پیکربندی ` " +"مراجعه کنید." msgid "Test if the configuration has an option called *name*." -msgstr "" +msgstr "بررسی می‌کند که آیا پیکربندی گزینه‌ای با نام *name* دارد." msgid "Return ``1`` if the option exists, or return ``0`` otherwise." msgstr "" +"اگر گزینه وجود داشته باشد ``1`` را برمی‌گرداند، در غیر این صورت ``0`` را " +"برمی‌گرداند." msgid "Get an integer configuration option." -msgstr "" +msgstr "دریافت یک گزینه‌ی پیکربندی از نوع عدد صحیح." msgid "Set *\\*value*, and return ``0`` on success." -msgstr "" +msgstr "مقدار *\\*value* را تنظیم می‌کند و در صورت موفقیت ``0`` را برمی‌گرداند." msgid "Set an error in *config* and return ``-1`` on error." -msgstr "" +msgstr "در صورت خطا، خطا را در *config* تنظیم کرده و ``-1`` برمی‌گرداند." -msgid "Get a string configuration option as a null-terminated UTF-8 encoded string." +msgid "" +"Get a string configuration option as a null-terminated UTF-8 encoded string." msgstr "" +"یک گزینه پیکربندی رشته‌ای را به‌صورت رشته‌ای کدگذاری‌شده با UTF-8 و پایان‌یافته با " +"تهی دریافت می‌کند." -msgid "*\\*value* can be set to ``NULL`` if the option is an optional string and the option is unset." +msgid "" +"*\\*value* can be set to ``NULL`` if the option is an optional string and the " +"option is unset." msgstr "" +"اگر گزینه یک رشته‌ی اختیاری باشد و تنظیم نشده باشد، می‌توان *\\*value* را برابر " +"``NULL`` قرار داد." -msgid "On success, the string must be released with ``free(value)`` if it's not ``NULL``." +msgid "" +"On success, the string must be released with ``free(value)`` if it's not " +"``NULL``." msgstr "" +"در صورت موفقیت، اگر رشته ``NULL`` نباشد، باید با ``free(value)`` آزاد شود." -msgid "Get a string list configuration option as an array of null-terminated UTF-8 encoded strings." +msgid "" +"Get a string list configuration option as an array of null-terminated UTF-8 " +"encoded strings." msgstr "" +"یک گزینه پیکربندی فهرست رشته‌ها را به‌صورت آرایه‌ای از رشته‌های کدگذاری‌شده با UTF-8 " +"و خاتمه‌یافته با تهی دریافت می‌کند." msgid "Set *\\*length* and *\\*value*, and return ``0`` on success." msgstr "" +"مقدار *\\*length* و *\\*value* را تنظیم می‌کند و در صورت موفقیت ``0`` را " +"برمی‌گرداند." -msgid "On success, the string list must be released with ``PyInitConfig_FreeStrList(length, items)``." +msgid "" +"On success, the string list must be released with " +"``PyInitConfig_FreeStrList(length, items)``." msgstr "" +"در صورت موفقیت، فهرست رشته‌ها باید با ``PyInitConfig_FreeStrList(length, " +"items)`` آزاد شود." msgid "Free memory of a string list created by ``PyInitConfig_GetStrList()``." msgstr "" +"حافظه‌ی فهرست رشته‌های ایجادشده توسط ``PyInitConfig_GetStrList()`` را آزاد می‌کند." msgid "Set Options" -msgstr "" +msgstr "تنظیم گزینه‌ها" -msgid "Some configuration options have side effects on other options. This logic is only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the \"Set\" functions below. For example, setting ``dev_mode`` to ``1`` does not set ``faulthandler`` to ``1``." +msgid "" +"Some configuration options have side effects on other options. This logic is " +"only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the " +"\"Set\" functions below. For example, setting ``dev_mode`` to ``1`` does not " +"set ``faulthandler`` to ``1``." msgstr "" +"برخی گزینه‌های پیکربندی روی گزینه‌های دیگر اثر جانبی دارند. این منطق تنها هنگامی " +"پیاده‌سازی می‌شود که ``Py_InitializeFromInitConfig()`` فراخوانی شود، نه توسط " +"توابع «Set» در ادامه. برای مثال، تنظیم ``dev_mode`` به ``1`` باعث نمی‌شود " +"``faulthandler`` به ``1`` تنظیم شود." msgid "Set an integer configuration option." -msgstr "" +msgstr "یک گزینه‌ی پیکربندی از نوع عدد صحیح را تنظیم می‌کند." msgid "Return ``0`` on success." -msgstr "" +msgstr "در صورت موفقیت ``0`` را برمی‌گرداند." -msgid "Set a string configuration option from a null-terminated UTF-8 encoded string. The string is copied." +msgid "" +"Set a string configuration option from a null-terminated UTF-8 encoded string. " +"The string is copied." msgstr "" +"یک گزینه پیکربندی رشته‌ای را از یک رشته‌ی کدگذاری‌شده با UTF-8 و خاتمه‌یافته با " +"نویسه تهی تنظیم می‌کند. رشته کپی می‌شود." -msgid "Set a string list configuration option from an array of null-terminated UTF-8 encoded strings. The string list is copied." +msgid "" +"Set a string list configuration option from an array of null-terminated UTF-8 " +"encoded strings. The string list is copied." msgstr "" +"یک گزینه پیکربندی فهرست رشته‌ای را از آرایه‌ای از رشته‌های کدگذاری‌شده با UTF-8 و " +"پایان‌یافته با نویسه تهی تنظیم می‌کند. فهرست رشته‌ها کپی می‌شود." msgid "Module" -msgstr "" +msgstr "ماژول" msgid "Add a built-in extension module to the table of built-in modules." -msgstr "" +msgstr "افزودن یک ماژول توسعه‌ای توکار به جدول ماژول‌های توکار." -msgid "The new module can be imported by the name *name*, and uses the function *initfunc* as the initialization function called on the first attempted import." +msgid "" +"The new module can be imported by the name *name*, and uses the function " +"*initfunc* as the initialization function called on the first attempted import." msgstr "" +"ماژول جدید را می‌توان با نام *name* ایمپورت کرد و از تابع *initfunc* به عنوان " +"تابع مقداردهی اولیه‌ای که در نخستین تلاش برای ایمپورت فراخوانی می‌شود، استفاده " +"می‌کند." -msgid "If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must be called at each Python initialization." +msgid "" +"If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must be " +"called at each Python initialization." msgstr "" +"اگر پایتون چند بار مقداردهی اولیه شود، ``PyInitConfig_AddModule()`` باید در هر " +"مقداردهی اولیه پایتون فراخوانی شود." msgid "Similar to the :c:func:`PyImport_AppendInittab` function." -msgstr "" +msgstr "مشابه تابع :c:func:`PyImport_AppendInittab`." msgid "Initialize Python" -msgstr "" +msgstr "مقداردهی اولیه پایتون" msgid "Initialize Python from the initialization configuration." -msgstr "" +msgstr "پایتون را از پیکربندی مقداردهی اولیه راه‌اندازی کنید." msgid "Set an exit code in *config* and return ``-1`` if Python wants to exit." msgstr "" +"اگر پایتون بخواهد خارج شود، یک کد خروج در *config* تنظیم می‌کند و ``-1`` را " +"برمی‌گرداند." msgid "See ``PyInitConfig_GetExitcode()`` for the exit code case." -msgstr "" +msgstr "برای مورد کد خروج، ``PyInitConfig_GetExitcode()`` را ببینید." msgid "Configuration Options" -msgstr "" +msgstr "گزینه‌های پیکربندی" msgid "Option" -msgstr "" +msgstr "گزینه" msgid "PyConfig/PyPreConfig member" -msgstr "" +msgstr "عضو PyConfig/PyPreConfig" msgid "Type" -msgstr "" +msgstr "نوع" msgid "Visibility" -msgstr "" +msgstr "مرئی بودن" msgid "``\"allocator\"``" -msgstr "" +msgstr "``\"allocator\"``" msgid ":c:member:`allocator `" -msgstr "" +msgstr ":c:member:`allocator `" msgid "``int``" -msgstr "" +msgstr "``int``" msgid "Read-only" -msgstr "" +msgstr "فقط‌خواندنی" msgid "``\"argv\"``" -msgstr "" +msgstr "``\"argv\"``" msgid ":c:member:`argv `" -msgstr "" +msgstr ":c:member:`argv `" msgid "``list[str]``" -msgstr "" +msgstr "``list[str]``" msgid "Public" -msgstr "" +msgstr "عمومی" msgid "``\"base_exec_prefix\"``" -msgstr "" +msgstr "``\"base_exec_prefix\"``" msgid ":c:member:`base_exec_prefix `" -msgstr "" +msgstr ":c:member:`base_exec_prefix `" msgid "``str``" -msgstr "" +msgstr "``str``" msgid "``\"base_executable\"``" -msgstr "" +msgstr "``\"base_executable\"``" msgid ":c:member:`base_executable `" -msgstr "" +msgstr ":c:member:`base_executable `" msgid "``\"base_prefix\"``" -msgstr "" +msgstr "``\"base_prefix\"``" msgid ":c:member:`base_prefix `" -msgstr "" +msgstr ":c:member:`base_prefix `" msgid "``\"buffered_stdio\"``" -msgstr "" +msgstr "``\"buffered_stdio\"``" msgid ":c:member:`buffered_stdio `" -msgstr "" +msgstr ":c:member:`buffered_stdio `" msgid "``bool``" -msgstr "" +msgstr "``bool``" msgid "``\"bytes_warning\"``" -msgstr "" +msgstr "``\"bytes_warning\"``" msgid ":c:member:`bytes_warning `" -msgstr "" +msgstr ":c:member:`bytes_warning `" msgid "``\"check_hash_pycs_mode\"``" -msgstr "" +msgstr "``\"check_hash_pycs_mode\"``" msgid ":c:member:`check_hash_pycs_mode `" -msgstr "" +msgstr ":c:member:`check_hash_pycs_mode `" msgid "``\"code_debug_ranges\"``" -msgstr "" +msgstr "``\"code_debug_ranges\"``" msgid ":c:member:`code_debug_ranges `" -msgstr "" +msgstr ":c:member:`code_debug_ranges `" msgid "``\"coerce_c_locale\"``" -msgstr "" +msgstr "``\"coerce_c_locale\"``" msgid ":c:member:`coerce_c_locale `" -msgstr "" +msgstr ":c:member:`coerce_c_locale `" msgid "``\"coerce_c_locale_warn\"``" -msgstr "" +msgstr "``\"coerce_c_locale_warn\"``" msgid ":c:member:`coerce_c_locale_warn `" -msgstr "" +msgstr ":c:member:`coerce_c_locale_warn `" msgid "``\"configure_c_stdio\"``" -msgstr "" +msgstr "``\"configure_c_stdio\"``" msgid ":c:member:`configure_c_stdio `" -msgstr "" +msgstr ":c:member:`configure_c_stdio `" msgid "``\"configure_locale\"``" -msgstr "" +msgstr "``\"configure_locale\"``" msgid ":c:member:`configure_locale `" -msgstr "" +msgstr ":c:member:`configure_locale `" msgid "``\"cpu_count\"``" -msgstr "" +msgstr "``\"cpu_count\"``" msgid ":c:member:`cpu_count `" -msgstr "" +msgstr ":c:member:`cpu_count `" msgid "``\"dev_mode\"``" -msgstr "" +msgstr "``\"dev_mode\"``" msgid ":c:member:`dev_mode `" -msgstr "" +msgstr ":c:member:`dev_mode `" msgid "``\"dump_refs\"``" -msgstr "" +msgstr "``\"dump_refs\"``" msgid ":c:member:`dump_refs `" -msgstr "" +msgstr ":c:member:`dump_refs `" msgid "``\"dump_refs_file\"``" -msgstr "" +msgstr "``\"dump_refs_file\"``" msgid ":c:member:`dump_refs_file `" -msgstr "" +msgstr ":c:member:`dump_refs_file `" msgid "``\"exec_prefix\"``" -msgstr "" +msgstr "``\"exec_prefix\"``" msgid ":c:member:`exec_prefix `" -msgstr "" +msgstr ":c:member:`exec_prefix `" msgid "``\"executable\"``" -msgstr "" +msgstr "``\"executable\"``" msgid ":c:member:`executable `" -msgstr "" +msgstr ":c:member:`executable `" msgid "``\"faulthandler\"``" -msgstr "" +msgstr "``\"faulthandler\"``" msgid ":c:member:`faulthandler `" -msgstr "" +msgstr ":c:member:`faulthandler `" msgid "``\"filesystem_encoding\"``" -msgstr "" +msgstr "``\"filesystem_encoding\"``" msgid ":c:member:`filesystem_encoding `" -msgstr "" +msgstr ":c:member:`filesystem_encoding `" msgid "``\"filesystem_errors\"``" -msgstr "" +msgstr "``\"filesystem_errors\"``" msgid ":c:member:`filesystem_errors `" -msgstr "" +msgstr ":c:member:`filesystem_errors `" msgid "``\"hash_seed\"``" -msgstr "" +msgstr "``\"hash_seed\"``" msgid ":c:member:`hash_seed `" -msgstr "" +msgstr ":c:member:`hash_seed `" msgid "``\"home\"``" -msgstr "" +msgstr "``\"home\"``" msgid ":c:member:`home `" -msgstr "" +msgstr ":c:member:`home `" msgid "``\"import_time\"``" -msgstr "" +msgstr "``\"import_time\"``" msgid ":c:member:`import_time `" -msgstr "" +msgstr ":c:member:`import_time `" msgid "``\"inspect\"``" -msgstr "" +msgstr "``\"inspect\"``" msgid ":c:member:`inspect `" -msgstr "" +msgstr ":c:member:`inspect `" msgid "``\"install_signal_handlers\"``" -msgstr "" +msgstr "``\"install_signal_handlers\"``" msgid ":c:member:`install_signal_handlers `" -msgstr "" +msgstr ":c:member:`install_signal_handlers `" msgid "``\"int_max_str_digits\"``" -msgstr "" +msgstr "``\"int_max_str_digits\"``" msgid ":c:member:`int_max_str_digits `" -msgstr "" +msgstr ":c:member:`int_max_str_digits `" msgid "``\"interactive\"``" -msgstr "" +msgstr "``\"interactive\"``" msgid ":c:member:`interactive `" -msgstr "" +msgstr ":c:member:`interactive `" msgid "``\"isolated\"``" -msgstr "" +msgstr "``\"isolated\"``" msgid ":c:member:`isolated `" -msgstr "" +msgstr ":c:member:`isolated `" msgid "``\"legacy_windows_fs_encoding\"``" -msgstr "" +msgstr "``\"legacy_windows_fs_encoding\"``" -msgid ":c:member:`legacy_windows_fs_encoding `" +msgid "" +":c:member:`legacy_windows_fs_encoding `" msgstr "" +":c:member:`legacy_windows_fs_encoding `" msgid "``\"legacy_windows_stdio\"``" -msgstr "" +msgstr "``\"legacy_windows_stdio\"``" msgid ":c:member:`legacy_windows_stdio `" -msgstr "" +msgstr ":c:member:`legacy_windows_stdio `" msgid "``\"malloc_stats\"``" -msgstr "" +msgstr "``\"malloc_stats\"``" msgid ":c:member:`malloc_stats `" -msgstr "" +msgstr ":c:member:`malloc_stats `" msgid "``\"module_search_paths\"``" -msgstr "" +msgstr "``\"module_search_paths\"``" msgid ":c:member:`module_search_paths `" -msgstr "" +msgstr ":c:member:`module_search_paths `" msgid "``\"optimization_level\"``" -msgstr "" +msgstr "``\"optimization_level\"``" msgid ":c:member:`optimization_level `" -msgstr "" +msgstr ":c:member:`optimization_level `" msgid "``\"orig_argv\"``" -msgstr "" +msgstr "``\"orig_argv\"``" msgid ":c:member:`orig_argv `" -msgstr "" +msgstr ":c:member:`orig_argv `" msgid "``\"parse_argv\"``" -msgstr "" +msgstr "``\"parse_argv\"``" msgid ":c:member:`parse_argv `" -msgstr "" +msgstr ":c:member:`parse_argv `" msgid "``\"parser_debug\"``" -msgstr "" +msgstr "``\"parser_debug\"``" msgid ":c:member:`parser_debug `" -msgstr "" +msgstr ":c:member:`parser_debug `" msgid "``\"pathconfig_warnings\"``" -msgstr "" +msgstr "``\"pathconfig_warnings\"``" msgid ":c:member:`pathconfig_warnings `" -msgstr "" +msgstr ":c:member:`pathconfig_warnings `" msgid "``\"perf_profiling\"``" -msgstr "" +msgstr "``\"perf_profiling\"``" msgid ":c:member:`perf_profiling `" -msgstr "" +msgstr ":c:member:`perf_profiling `" msgid "``\"platlibdir\"``" -msgstr "" +msgstr "``\"platlibdir\"``" msgid ":c:member:`platlibdir `" -msgstr "" +msgstr ":c:member:`platlibdir `" msgid "``\"prefix\"``" -msgstr "" +msgstr "``\"prefix\"``" msgid ":c:member:`prefix `" -msgstr "" +msgstr ":c:member:`prefix `" msgid "``\"program_name\"``" -msgstr "" +msgstr "``\"program_name\"``" msgid ":c:member:`program_name `" -msgstr "" +msgstr ":c:member:`program_name `" msgid "``\"pycache_prefix\"``" -msgstr "" +msgstr "``\"pycache_prefix\"``" msgid ":c:member:`pycache_prefix `" -msgstr "" +msgstr ":c:member:`pycache_prefix `" msgid "``\"quiet\"``" -msgstr "" +msgstr "``\"quiet\"``" msgid ":c:member:`quiet `" -msgstr "" +msgstr ":c:member:`quiet `" msgid "``\"run_command\"``" -msgstr "" +msgstr "``\"run_command\"``" msgid ":c:member:`run_command `" -msgstr "" +msgstr ":c:member:`run_command `" msgid "``\"run_filename\"``" -msgstr "" +msgstr "``\"run_filename\"``" msgid ":c:member:`run_filename `" -msgstr "" +msgstr ":c:member:`run_filename `" msgid "``\"run_module\"``" -msgstr "" +msgstr "``\"run_module\"``" msgid ":c:member:`run_module `" -msgstr "" +msgstr ":c:member:`run_module `" msgid "``\"run_presite\"``" -msgstr "" +msgstr "``\"run_presite\"``" msgid ":c:member:`run_presite `" -msgstr "" +msgstr ":c:member:`run_presite `" msgid "``\"safe_path\"``" msgstr "" +"```\n" +"``\"safe_path\"``" msgid ":c:member:`safe_path `" -msgstr "" +msgstr ":c:member:`safe_path `" msgid "``\"show_ref_count\"``" -msgstr "" +msgstr "``\"show_ref_count\"``" msgid ":c:member:`show_ref_count `" -msgstr "" +msgstr ":c:member:`show_ref_count `" msgid "``\"site_import\"``" -msgstr "" +msgstr "``\"site_import\"``" msgid ":c:member:`site_import `" -msgstr "" +msgstr ":c:member:`site_import `" msgid "``\"skip_source_first_line\"``" -msgstr "" +msgstr "``\"skip_source_first_line\"``" msgid ":c:member:`skip_source_first_line `" -msgstr "" +msgstr ":c:member:`skip_source_first_line `" msgid "``\"stdio_encoding\"``" -msgstr "" +msgstr "``\"stdio_encoding\"``" msgid ":c:member:`stdio_encoding `" -msgstr "" +msgstr ":c:member:`stdio_encoding `" msgid "``\"stdio_errors\"``" -msgstr "" +msgstr "``\"stdio_errors\"``" msgid ":c:member:`stdio_errors `" -msgstr "" +msgstr ":c:member:`stdio_errors `" msgid "``\"stdlib_dir\"``" -msgstr "" +msgstr "``\"stdlib_dir\"``" msgid ":c:member:`stdlib_dir `" -msgstr "" +msgstr ":c:member:`stdlib_dir `" msgid "``\"tracemalloc\"``" -msgstr "" +msgstr "``\"tracemalloc\"``" msgid ":c:member:`tracemalloc `" -msgstr "" +msgstr ":c:member:`tracemalloc `" msgid "``\"use_environment\"``" -msgstr "" +msgstr "``\"use_environment\"``" msgid ":c:member:`use_environment `" -msgstr "" +msgstr ":c:member:`use_environment `" msgid "``\"use_frozen_modules\"``" -msgstr "" +msgstr "``\"use_frozen_modules\"``" msgid ":c:member:`use_frozen_modules `" -msgstr "" +msgstr ":c:member:`use_frozen_modules `" msgid "``\"use_hash_seed\"``" -msgstr "" +msgstr "``\"use_hash_seed\"``" msgid ":c:member:`use_hash_seed `" -msgstr "" +msgstr ":c:member:`use_hash_seed `" msgid "``\"use_system_logger\"``" -msgstr "" +msgstr "``\"use_system_logger\"``" msgid ":c:member:`use_system_logger `" -msgstr "" +msgstr ":c:member:`use_system_logger `" msgid "``\"user_site_directory\"``" -msgstr "" +msgstr "``\"user_site_directory\"``" msgid ":c:member:`user_site_directory `" -msgstr "" +msgstr ":c:member:`user_site_directory `" msgid "``\"utf8_mode\"``" -msgstr "" +msgstr "``\"utf8_mode\"``" msgid ":c:member:`utf8_mode `" -msgstr "" +msgstr ":c:member:`utf8_mode `" msgid "``\"verbose\"``" -msgstr "" +msgstr "``\"verbose\"``" msgid ":c:member:`verbose `" -msgstr "" +msgstr ":c:member:`verbose `" msgid "``\"warn_default_encoding\"``" -msgstr "" +msgstr "``\"warn_default_encoding\"``" msgid ":c:member:`warn_default_encoding `" -msgstr "" +msgstr ":c:member:`warn_default_encoding `" msgid "``\"warnoptions\"``" -msgstr "" +msgstr "``\"warnoptions\"``" msgid ":c:member:`warnoptions `" -msgstr "" +msgstr ":c:member:`warnoptions `" msgid "``\"write_bytecode\"``" -msgstr "" +msgstr "``\"write_bytecode\"``" msgid ":c:member:`write_bytecode `" -msgstr "" +msgstr ":c:member:`write_bytecode `" msgid "``\"xoptions\"``" -msgstr "" +msgstr "``\"xoptions\"``" msgid ":c:member:`xoptions `" -msgstr "" +msgstr ":c:member:`xoptions `" msgid "``dict[str, str]``" -msgstr "" +msgstr "``dict[str, str]``" msgid "``\"_pystats\"``" -msgstr "" +msgstr "``\"_pystats\"``" msgid ":c:member:`_pystats `" -msgstr "" +msgstr ":c:member:`_pystats `" msgid "Visibility:" -msgstr "" +msgstr "پدیداری:" -msgid "Public: Can be retrieved by :c:func:`PyConfig_Get` and set by :c:func:`PyConfig_Set`." +msgid "" +"Public: Can be retrieved by :c:func:`PyConfig_Get` and set " +"by :c:func:`PyConfig_Set`." msgstr "" +"عمومی: می‌توان آن را با :c:func:`PyConfig_Get` بازیابی کرد و " +"با :c:func:`PyConfig_Set` تنظیم کرد." -msgid "Read-only: Can be retrieved by :c:func:`PyConfig_Get`, but cannot be set by :c:func:`PyConfig_Set`." +msgid "" +"Read-only: Can be retrieved by :c:func:`PyConfig_Get`, but cannot be set " +"by :c:func:`PyConfig_Set`." msgstr "" +"فقط‌خواندنی: می‌توان آن را با :c:func:`PyConfig_Get` بازیابی کرد، اما نمی‌توان آن " +"را با :c:func:`PyConfig_Set` تنظیم کرد." msgid "Runtime Python configuration API" -msgstr "" +msgstr "API پیکربندی پایتون در ران‌تایم" -msgid "At runtime, it's possible to get and set configuration options using :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions." +msgid "" +"At runtime, it's possible to get and set configuration options " +"using :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions." msgstr "" +"در زمان اجرا، می‌توان با استفاده از توابع :c:func:`PyConfig_Get` " +"و :c:func:`PyConfig_Set` گزینه‌های پیکربندی را دریافت و تنظیم کرد." -msgid "Some options are read from the :mod:`sys` attributes. For example, the option ``\"argv\"`` is read from :data:`sys.argv`." +msgid "" +"Some options are read from the :mod:`sys` attributes. For example, the option " +"``\"argv\"`` is read from :data:`sys.argv`." msgstr "" +"برخی گزینه‌ها از ویژگی‌های :mod:`sys` خوانده می‌شوند. برای نمونه، گزینه‌ی " +"``\"argv\"`` از :data:`sys.argv` خوانده می‌شود." -msgid "Get the current runtime value of a configuration option as a Python object." -msgstr "" +msgid "" +"Get the current runtime value of a configuration option as a Python object." +msgstr "دریافت مقدار فعلی یک گزینه پیکربندی در ران‌تایم به‌صورت یک شیء پایتون." msgid "Return a new reference on success." -msgstr "" +msgstr "در صورت موفقیت، یک ارجاع جدید برمی‌گرداند." msgid "Set an exception and return ``NULL`` on error." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم کرده و ``NULL`` را برمی‌گرداند." msgid "The object type depends on the configuration option. It can be:" -msgstr "" +msgstr "نوع شیء به گزینه پیکربندی بستگی دارد. این می‌تواند یکی از موارد زیر باشد:" -msgid "The caller must have an :term:`attached thread state`. The function cannot be called before Python initialization nor after Python finalization." +msgid "" +"The caller must have an :term:`attached thread state`. The function cannot be " +"called before Python initialization nor after Python finalization." msgstr "" +"فراخوان‌کننده باید یک :term:`وضعیت نخ متصل ` داشته باشد. " +"این تابع را نمی‌توان پیش از مقداردهی اولیه‌ی پایتون و نه پس از نهایی‌سازی پایتون " +"فراخوانی کرد." msgid "Similar to :c:func:`PyConfig_Get`, but get the value as a C int." msgstr "" +"مشابه :c:func:`PyConfig_Get` است، اما مقدار را به‌صورت یک int در C دریافت می‌کند." msgid "Set an exception and return ``-1`` on error." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم کرده و ``-1`` را برمی‌گرداند." msgid "Get all configuration option names as a ``frozenset``." -msgstr "" +msgstr "گرفتن همه نام‌های گزینه‌های پیکربندی به صورت یک ``frozenset``." msgid "Set the current runtime value of a configuration option." -msgstr "" +msgstr "مقدار ران‌تایم فعلی یک گزینه پیکربندی را تنظیم می‌کند." msgid "Raise a :exc:`ValueError` if there is no option *name*." -msgstr "" +msgstr "در صورت نبود گزینه *name*، یک :exc:`ValueError` بالا برده می‌شود." msgid "Raise a :exc:`ValueError` if *value* is an invalid value." -msgstr "" +msgstr "اگر *value* مقدار نامعتبری باشد، یک :exc:`ValueError` ایجاد می‌کند." msgid "Raise a :exc:`ValueError` if the option is read-only (cannot be set)." msgstr "" +"در صورتی که گزینه فقط‌خواندنی باشد (قابل تنظیم نباشد)، یک :exc:`ValueError` " +"ایجاد می‌کند." msgid "Raise a :exc:`TypeError` if *value* has not the proper type." -msgstr "" +msgstr "اگر *value* نوع مناسب را نداشته باشد، :exc:`TypeError` ایجاد می‌شود." -msgid "Raises an :ref:`auditing event ` ``cpython.PyConfig_Set`` with arguments ``name``, ``value``." +msgid "" +"Raises an :ref:`auditing event ` ``cpython.PyConfig_Set`` with " +"arguments ``name``, ``value``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``cpython.PyConfig_Set`` را با آرگومان‌های " +"``name`` و ``value`` ایجاد می‌کند." -msgid "The function now replaces :data:`sys.flags` (create a new object), instead of modifying :data:`sys.flags` in-place." +msgid "" +"The function now replaces :data:`sys.flags` (create a new object), instead of " +"modifying :data:`sys.flags` in-place." msgstr "" +"این تابع اکنون :data:`sys.flags` را جایگزین می‌کند (یک شیء جدید ایجاد می‌کند)، " +"به‌جای اینکه :data:`sys.flags` را به‌صورت درجا تغییر دهد." msgid "PyConfig C API" -msgstr "" +msgstr "API زبان C برای PyConfig" -msgid "Python can be initialized with :c:func:`Py_InitializeFromConfig` and the :c:type:`PyConfig` structure. It can be preinitialized with :c:func:`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." +msgid "" +"Python can be initialized with :c:func:`Py_InitializeFromConfig` and " +"the :c:type:`PyConfig` structure. It can be preinitialized " +"with :c:func:`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." msgstr "" +"پایتون را می‌توان با :c:func:`Py_InitializeFromConfig` و " +"ساختار :c:type:`PyConfig` راه‌اندازی کرد. می‌توان آن را " +"با :c:func:`Py_PreInitialize` و ساختار :c:type:`PyPreConfig` پیش‌راه‌اندازی کرد." msgid "There are two kinds of configuration:" -msgstr "" +msgstr "دو نوع پیکربندی وجود دارد:" -msgid "The :ref:`Python Configuration ` can be used to build a customized Python which behaves as the regular Python. For example, environment variables and command line arguments are used to configure Python." +msgid "" +"The :ref:`Python Configuration ` can be used to build a " +"customized Python which behaves as the regular Python. For example, environment " +"variables and command line arguments are used to configure Python." msgstr "" +"می‌توان از :ref:`پیکربندی پایتون ` برای ساخت یک پایتون " +"سفارشی‌شده که مانند پایتون معمولی رفتار می‌کند استفاده کرد. برای مثال، از " +"متغیرهای محیطی و آرگومان‌های خط فرمان برای پیکربندی پایتون استفاده می‌شود." -msgid "The :ref:`Isolated Configuration ` can be used to embed Python into an application. It isolates Python from the system. For example, environment variables are ignored, the LC_CTYPE locale is left unchanged and no signal handler is registered." +msgid "" +"The :ref:`Isolated Configuration ` can be used to embed " +"Python into an application. It isolates Python from the system. For example, " +"environment variables are ignored, the LC_CTYPE locale is left unchanged and no " +"signal handler is registered." msgstr "" +"می‌توان از :ref:`پیکربندی جداشده ` برای جاسازی پایتون در یک " +"برنامه استفاده کرد. این پیکربندی پایتون را از سیستم جدا می‌کند. برای مثال، " +"متغیرهای محیطی نادیده گرفته می‌شوند، locale مربوط به LC_CTYPE بدون تغییر باقی " +"می‌ماند و هیچ هندلر سیگنالی ثبت نمی‌شود." msgid ":pep:`587` \"Python Initialization Configuration\"." -msgstr "" +msgstr ":pep:`587` «پیکربندی راه‌اندازی پایتون»." msgid "Example of customized Python always running in isolated mode::" -msgstr "" +msgstr "نمونه‌ای از پایتون سفارشی‌سازی‌شده که همیشه در حالت ایزوله اجرا می‌شود::" msgid "" "int main(int argc, char **argv)\n" @@ -796,99 +975,153 @@ msgid "" " Py_ExitStatusException(status);\n" "}" msgstr "" +"int main(int argc, char **argv)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +" config.isolated = 1;\n" +"\n" +" /* Decode command line arguments.\n" +" Implicitly preinitialize Python (in isolated mode). */\n" +" status = PyConfig_SetBytesArgv(&config, argc, argv);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" return Py_RunMain();\n" +"\n" +"exception:\n" +" PyConfig_Clear(&config);\n" +" if (PyStatus_IsExit(status)) {\n" +" return status.exitcode;\n" +" }\n" +" /* Display the error message and exit the process with\n" +" non-zero exit code */\n" +" Py_ExitStatusException(status);\n" +"}" msgid "PyWideStringList" -msgstr "" +msgstr "PyWideStringList" msgid "List of ``wchar_t*`` strings." -msgstr "" +msgstr "فهرستی از رشته‌های ``wchar_t*``." -msgid "If *length* is non-zero, *items* must be non-``NULL`` and all strings must be non-``NULL``." +msgid "" +"If *length* is non-zero, *items* must be non-``NULL`` and all strings must be " +"non-``NULL``." msgstr "" +"اگر *length* ناصفر باشد، *items* باید غیر ``NULL`` باشد و همه‌ی رشته‌ها باید غیر " +"``NULL`` باشند." msgid "Methods:" -msgstr "" +msgstr "متدها:" msgid "Append *item* to *list*." -msgstr "" +msgstr "افزودن *آیتم* به *فهرست*." msgid "Python must be preinitialized to call this function." -msgstr "" +msgstr "برای فراخوانی این تابع، پایتون باید از پیش مقداردهی اولیه شده باشد." msgid "Insert *item* into *list* at *index*." -msgstr "" +msgstr "درج *آیتم* در *فهرست* در *اندیس*." -msgid "If *index* is greater than or equal to *list* length, append *item* to *list*." +msgid "" +"If *index* is greater than or equal to *list* length, append *item* to *list*." msgstr "" +"اگر *index* بزرگ‌تر یا مساوی طول *list* باشد، *item* به *list* افزوده می‌شود." msgid "*index* must be greater than or equal to ``0``." -msgstr "" +msgstr "*index* باید بزرگ‌تر یا مساوی با ``0`` باشد." msgid "Structure fields:" -msgstr "" +msgstr "فیلد‌های ساختار:" msgid "List length." -msgstr "" +msgstr "طول فهرست." msgid "List items." -msgstr "" +msgstr "آیتم‌های فهرست." msgid "PyStatus" -msgstr "" +msgstr "PyStatus" -msgid "Structure to store an initialization function status: success, error or exit." -msgstr "" +msgid "" +"Structure to store an initialization function status: success, error or exit." +msgstr "ساختاری برای ذخیره‌سازی وضعیت یک تابع مقداردهی اولیه: موفقیت، خطا یا خروج." msgid "For an error, it can store the C function name which created the error." msgstr "" +"در صورت وقوع خطا، می‌تواند نام تابع C که خطا را ایجاد کرده است را ذخیره کند." msgid "Exit code. Argument passed to ``exit()``." -msgstr "" +msgstr "کد خروج. آرگومان پاس‌داده‌شده به ``exit()``." msgid "Error message." -msgstr "" +msgstr "پیام خطا." msgid "Name of the function which created an error, can be ``NULL``." -msgstr "" +msgstr "نام تابعی که خطا ایجاد کرده است، می‌تواند ``NULL`` باشد." msgid "Functions to create a status:" -msgstr "" +msgstr "توابع برای ایجاد وضعیت:" msgid "Success." -msgstr "" +msgstr "موفقیت." msgid "Initialization error with a message." -msgstr "" +msgstr "خطای مقداردهی اولیه همراه با پیام." msgid "*err_msg* must not be ``NULL``." -msgstr "" +msgstr "*err_msg* نباید ``NULL`` باشد." msgid "Memory allocation failure (out of memory)." -msgstr "" +msgstr "شکست تخصیص حافظه (کمبود حافظه)." msgid "Exit Python with the specified exit code." -msgstr "" +msgstr "با کد خروج مشخص‌شده از پایتون خارج شوید." msgid "Functions to handle a status:" -msgstr "" +msgstr "توابعی برای مدیریت یک وضعیت:" -msgid "Is the status an error or an exit? If true, the exception must be handled; by calling :c:func:`Py_ExitStatusException` for example." +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:func:`Py_ExitStatusException`." msgid "Is the result an error?" -msgstr "" +msgstr "آیا نتیجه یک خطا است؟" msgid "Is the result an exit?" -msgstr "" +msgstr "آیا نتیجه یک خروج است؟" -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." +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 "" +"اگر *status* یک خروج باشد، ``exit(exitcode)`` را فراخوانی کنید. اگر *status* یک " +"خطا باشد، پیام خطا را چاپ کرده و با کد خروج ناصفر خارج شوید. فقط باید در صورتی " +"فراخوانی شود که ``PyStatus_Exception(status)`` ناصفر باشد." -msgid "Internally, Python uses macros which set ``PyStatus.func``, whereas functions to create a status set ``func`` to ``NULL``." +msgid "" +"Internally, Python uses macros which set ``PyStatus.func``, whereas functions " +"to create a status set ``func`` to ``NULL``." msgstr "" +"به‌طور داخلی، پایتون از ماکروهایی استفاده می‌کند که ``PyStatus.func`` را تنظیم " +"می‌کنند، در حالی که توابع ایجاد وضعیت، ``func`` را به ``NULL`` تنظیم می‌کنند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "PyStatus alloc(void **ptr, size_t size)\n" @@ -911,189 +1144,348 @@ msgid "" " return 0;\n" "}" msgstr "" +"PyStatus alloc(void **ptr, size_t size)\n" +"{\n" +" *ptr = PyMem_RawMalloc(size);\n" +" if (*ptr == NULL) {\n" +" return PyStatus_NoMemory();\n" +" }\n" +" return PyStatus_Ok();\n" +"}\n" +"\n" +"int main(int argc, char **argv)\n" +"{\n" +" void *ptr;\n" +" PyStatus status = alloc(&ptr, 16);\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +" PyMem_Free(ptr);\n" +" return 0;\n" +"}" msgid "PyPreConfig" -msgstr "" +msgstr "PyPreConfig" msgid "Structure used to preinitialize Python." -msgstr "" +msgstr "ساختاری که برای پیش‌مقداردهی اولیه (preinitialize) پایتون استفاده می‌شود." msgid "Function to initialize a preconfiguration:" -msgstr "" +msgstr "تابعی برای مقداردهی اولیه‌ی پیش‌پیکربندی:" -msgid "Initialize the preconfiguration with :ref:`Python Configuration `." +msgid "" +"Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" +"پیش‌پیکربندی را با :ref:`پیکربندی پایتون ` مقداردهی اولیه " +"کنید." -msgid "Initialize the preconfiguration with :ref:`Isolated Configuration `." +msgid "" +"Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" +"پیش‌پیکربندی را با :ref:`پیکربندی ایزوله ` مقداردهی اولیه " +"کنید." msgid "Name of the Python memory allocators:" -msgstr "" +msgstr "نام تخصیص‌دهنده‌های حافظه‌ی پایتون:" -msgid "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use defaults)." +msgid "" +"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " +"defaults)." msgstr "" +"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): تخصیص‌دهنده‌های حافظه تغییر داده نمی‌شوند (از " +"پیش‌فرض‌ها استفاده می‌شود)." -msgid "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators `." +msgid "" +"``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators `." msgstr "" +"``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`تخصیص‌دهنده‌های حافظه پیش‌فرض `." -msgid "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." +msgid "" +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`تخصیص‌دهنده‌های حافظه پیش‌فرض ` به همراه :ref:`قلاب‌های اشکال‌زدایی `." msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." -msgstr "" +msgstr "``PYMEM_ALLOCATOR_MALLOC`` (``3``): استفاده از ``malloc()`` کتابخانه‌ی C." -msgid "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :ref:`debug hooks `." +msgid "" +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` " +"with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): اجبار به استفاده از ``malloc()`` به " +"همراه :ref:`قلاب‌های اشکال‌زدایی `." -msgid "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator `." +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " +"`." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`تخصیص‌دهنده حافظه pymalloc پایتون " +"`." -msgid "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory allocator ` with :ref:`debug hooks `." +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " +"allocator ` with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`تخصیص‌دهنده حافظه pymalloc " +"پایتون ` به همراه :ref:`قلاب‌های اشکال‌زدایی `." -msgid "``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc replacement." +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " +"replacement." msgstr "" +"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): استفاده از ``mimalloc``، جایگزین سریعی " +"برای malloc." -msgid "``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc replacement with :ref:`debug hooks `." +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " +"replacement with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): استفاده از ``mimalloc``، جایگزین " +"سریعی برای malloc با :ref:`قلاب‌های اشکال‌زدایی `." -msgid "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not supported if Python is :option:`configured using --without-pymalloc <--without-pymalloc>`." +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " +"supported if Python is :option:`configured using --without-pymalloc <--without-" +"pymalloc>`." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` و ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` در صورتی که " +"پایتون با :option:`--without-pymalloc <--without-pymalloc>` پیکربندی شده باشد، " +"پشتیبانی نمی‌شوند." -msgid "``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not supported if Python is :option:`configured using --without-mimalloc <--without-mimalloc>` or if the underlying atomic support isn't available." +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not " +"supported if Python is :option:`configured using --without-mimalloc <--without-" +"mimalloc>` or if the underlying atomic support isn't available." msgstr "" +"اگر پایتون :option:`با --without-mimalloc پیکربندی‌شده باشد <--without-" +"mimalloc>` یا پشتیبانی اتمی زیرین در دسترس نباشد، ``PYMEM_ALLOCATOR_MIMALLOC`` " +"و ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` پشتیبانی نمی‌شوند." msgid "See :ref:`Memory Management `." -msgstr "" +msgstr "به :ref:`مدیریت حافظه ` مراجعه کنید." msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." -msgstr "" +msgstr "پیش‌فرض: ``PYMEM_ALLOCATOR_NOT_SET``." msgid "Set the LC_CTYPE locale to the user preferred locale." -msgstr "" +msgstr "locale مربوط به LC_CTYPE را به locale ترجیحی کاربر تنظیم کنید." -msgid "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." +msgid "" +"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` " +"and :c:member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" +"اگر برابر ``0`` باشد، اعضای :c:member:`~PyPreConfig.coerce_c_locale` " +"و :c:member:`~PyPreConfig.coerce_c_locale_warn` را بر ``0`` تنظیم می‌کند." msgid "See the :term:`locale encoding`." -msgstr "" +msgstr "به :term:`locale encoding` مراجعه کنید." msgid "Default: ``1`` in Python config, ``0`` in isolated config." -msgstr "" +msgstr "پیش‌فرض: ``1`` در پیکربندی پایتون، ``0`` در پیکربندی ایزوله." msgid "If equals to ``2``, coerce the C locale." -msgstr "" +msgstr "اگر برابر با ``2`` باشد، C locale اجبار می‌شود." -msgid "If equals to ``1``, read the LC_CTYPE locale to decide if it should be coerced." +msgid "" +"If equals to ``1``, read the LC_CTYPE locale to decide if it should be coerced." msgstr "" +"اگر برابر ``1`` باشد، locale مربوط به LC_CTYPE خوانده می‌شود تا مشخص شود که آیا " +"باید اجبار (coerce) شود یا خیر." msgid "Default: ``-1`` in Python config, ``0`` in isolated config." -msgstr "" +msgstr "پیش‌فرض: ``-1`` در پیکربندی پایتون، ``0`` در پیکربندی ایزوله." msgid "If non-zero, emit a warning if the C locale is coerced." -msgstr "" +msgstr "اگر ناصفر باشد، در صورت اجبار locale C هشداری صادر می‌شود." -msgid ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." +msgid "" +":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" +":ref:`حالت توسعه پایتون `: به :c:member:`PyConfig.dev_mode` مراجعه " +"کنید." msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." -msgstr "" +msgstr "پیش‌فرض: ``-1`` در حالت پایتون، ``0`` در حالت ایزوله." msgid "Isolated mode: see :c:member:`PyConfig.isolated`." -msgstr "" +msgstr "حالت مجزا (isolated mode): به :c:member:`PyConfig.isolated` مراجعه کنید." msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." -msgstr "" +msgstr "پیش‌فرض: ``0`` در حالت پایتون، ``1`` در حالت ایزوله." msgid "If non-zero:" -msgstr "" +msgstr "اگر نا‌صفر باشد:" msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," -msgstr "" +msgstr "مقدار :c:member:`PyPreConfig.utf8_mode` را برابر ``0`` قرار دهید،" msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," -msgstr "" +msgstr ":c:member:`PyConfig.filesystem_encoding` را روی ``\"mbcs\"`` تنظیم کنید،" msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." -msgstr "" +msgstr ":c:member:`PyConfig.filesystem_errors` را روی ``\"replace\"`` تنظیم کنید." -msgid "Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable value." +msgid "" +"Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " +"variable value." msgstr "" +"از مقدار متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSFSENCODING` مقداردهی اولیه " +"می‌شود." -msgid "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for Windows specific code." +msgid "" +"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for Windows " +"specific code." msgstr "" +"فقط در ویندوز در دسترس است. می‌توان از ماکروی ``#ifdef MS_WINDOWS`` برای کد " +"مخصوص ویندوز استفاده کرد." msgid "Default: ``0``." -msgstr "" +msgstr "پیش‌فرض: ``0``." -msgid "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way the regular Python parses command line arguments: see :ref:`Command Line Arguments `." +msgid "" +"If non-zero, :c:func:`Py_PreInitializeFromArgs` " +"and :c:func:`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the " +"same way the regular Python parses command line arguments: see :ref:`Command " +"Line Arguments `." msgstr "" +"اگر ناصفر باشد، :c:func:`Py_PreInitializeFromArgs` " +"و :c:func:`Py_PreInitializeFromBytesArgs` آرگومان ``argv`` خود را همان‌گونه " +"تجزیه می‌کنند که پایتون معمولی آرگومان‌های خط فرمان را تجزیه می‌کند: " +"به :ref:`آرگومان‌های خط فرمان ` مراجعه کنید." -msgid "Use :ref:`environment variables `? See :c:member:`PyConfig.use_environment`." +msgid "" +"Use :ref:`environment variables `? " +"See :c:member:`PyConfig.use_environment`." msgstr "" +"از :ref:`متغیرهای محیطی ` استفاده " +"می‌کنید؟ :c:member:`PyConfig.use_environment` را ببینید." msgid "Default: ``1`` in Python config and ``0`` in isolated config." -msgstr "" +msgstr "پیش‌فرض: ``1`` در پیکربندی پایتون و ``0`` در پیکربندی ایزوله." msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." -msgstr "" +msgstr "اگر ناصفر باشد، :ref:`حالت UTF-8 پایتون ` را فعال می‌کند." -msgid "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and the :envvar:`PYTHONUTF8` environment variable." +msgid "" +"Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " +"the :envvar:`PYTHONUTF8` environment variable." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X utf8 <-X>` و متغیر محیطی :envvar:`PYTHONUTF8` " +"روی ``0`` یا ``1`` تنظیم می‌شود." msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" +"همچنین اگر locale مربوط به ``LC_CTYPE`` برابر ``C`` یا ``POSIX`` باشد، به ``1`` " +"تنظیم می‌شود." msgid "Default: ``-1`` in Python config and ``0`` in isolated config." -msgstr "" +msgstr "پیش‌فرض: ``-1`` در پیکربندی پایتون و ``0`` در پیکربندی ایزوله." msgid "Preinitialize Python with PyPreConfig" -msgstr "" +msgstr "پیش‌مقداردهی اولیه‌ی پایتون با PyPreConfig" msgid "The preinitialization of Python:" -msgstr "" +msgstr "پیش‌مقداردهی اولیه پایتون:" msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" -msgstr "" +msgstr "تنظیم تخصیص‌دهنده‌های حافظه پایتون (:c:member:`PyPreConfig.allocator`)" msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" +"locale مربوط به LC_CTYPE را پیکربندی کنید (:term:`کدگذاری locale `)" -msgid "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig.utf8_mode`)" +msgid "" +"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig.utf8_mode`)" msgstr "" +"تنظیم :ref:`حالت UTF-8 پایتون ` (:c:member:`PyPreConfig.utf8_mode`)" -msgid "The current preconfiguration (``PyPreConfig`` type) is stored in ``_PyRuntime.preconfig``." +msgid "" +"The current preconfiguration (``PyPreConfig`` type) is stored in " +"``_PyRuntime.preconfig``." msgstr "" +"پیش‌پیکربندی فعلی (نوع ``PyPreConfig``) در ``_PyRuntime.preconfig`` ذخیره می‌شود." msgid "Functions to preinitialize Python:" -msgstr "" +msgstr "توابعی برای پیش‌مقداردهی اولیه (preinitialize) پایتون:" msgid "Preinitialize Python from *preconfig* preconfiguration." -msgstr "" +msgstr "پایتون را از پیش‌پیکربندی *preconfig* پیش‌مقداردهی اولیه می‌کند." msgid "*preconfig* must not be ``NULL``." -msgstr "" +msgstr "*preconfig* نباید ``NULL`` باشد." -msgid "Parse *argv* command line arguments (bytes strings) if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +msgid "" +"Parse *argv* command line arguments (bytes strings) " +"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" +"اگر :c:member:`~PyPreConfig.parse_argv` در *preconfig* ناصفر باشد، آرگومان‌های " +"خط فرمان *argv* (رشته‌های بایتی) را تجزیه می‌کند." -msgid "Parse *argv* command line arguments (wide strings) if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +msgid "" +"Parse *argv* command line arguments (wide strings) " +"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" +"اگر :c:member:`~PyPreConfig.parse_argv` در *preconfig* غیر صفر باشد، آرگومان‌های " +"خط فرمان *argv* (رشته‌های پهن) را پارس می‌کند." -msgid "The caller is responsible to handle exceptions (error or exit) using :c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." +msgid "" +"The caller is responsible to handle exceptions (error or exit) " +"using :c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" +"فراخوان‌کننده مسئول مدیریت استثناها (خطا یا خروج) با استفاده " +"از :c:func:`PyStatus_Exception` و :c:func:`Py_ExitStatusException` است." -msgid "For :ref:`Python Configuration ` (:c:func:`PyPreConfig_InitPythonConfig`), if Python is initialized with command line arguments, the command line arguments must also be passed to preinitialize Python, since they have an effect on the pre-configuration like encodings. For example, the :option:`-X utf8 <-X>` command line option enables the :ref:`Python UTF-8 Mode `." -msgstr "" +msgid "" +"For :ref:`Python Configuration ` " +"(:c:func:`PyPreConfig_InitPythonConfig`), if Python is initialized with command " +"line arguments, the command line arguments must also be passed to preinitialize " +"Python, since they have an effect on the pre-configuration like encodings. For " +"example, the :option:`-X utf8 <-X>` command line option enables " +"the :ref:`Python UTF-8 Mode `." +msgstr "" +"برای :ref:`پیکربندی پایتون ` " +"(:c:func:`PyPreConfig_InitPythonConfig`)، اگر پایتون با آرگومان‌های خط فرمان " +"مقداردهی اولیه شود، آرگومان‌های خط فرمان باید برای پیش‌مقداردهی اولیه‌ی پایتون نیز " +"پاس داده شوند، زیرا این آرگومان‌ها بر پیش‌پیکربندی، مانند کدگذاری‌ها، اثر " +"می‌گذارند. برای مثال، گزینه‌ی خط فرمان :option:`-X utf8 <-X>` :ref:`حالت UTF-8 " +"پایتون ` را فعال می‌کند." -msgid "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and before :c:func:`Py_InitializeFromConfig` to install a custom memory allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." +msgid "" +"``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " +"before :c:func:`Py_InitializeFromConfig` to install a custom memory allocator. " +"It can be called before :c:func:`Py_PreInitialize` " +"if :c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" +"می‌توان ``PyMem_SetAllocator()`` را پس از :c:func:`Py_PreInitialize` و پیش " +"از :c:func:`Py_InitializeFromConfig` برای نصب یک تخصیص‌دهنده حافظه‌ی سفارشی " +"فراخوانی کرد. اگر :c:member:`PyPreConfig.allocator` برابر " +"``PYMEM_ALLOCATOR_NOT_SET`` تنظیم شده باشد، می‌توان آن را پیش " +"از :c:func:`Py_PreInitialize` فراخوانی کرد." -msgid "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not be used before the Python preinitialization, whereas calling directly ``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must not be called before the Python preinitialization." +msgid "" +"Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not be " +"used before the Python preinitialization, whereas calling directly ``malloc()`` " +"and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must not be called " +"before the Python preinitialization." msgstr "" +"توابع تخصیص حافظه‌ی پایتون مانند :c:func:`PyMem_RawMalloc` نباید پیش از " +"پیش‌مقداردهی پایتون استفاده شوند، در حالی که فراخوانی مستقیم ``malloc()`` و " +"``free()`` همیشه ایمن است. :c:func:`Py_DecodeLocale` نباید پیش از پیش‌مقداردهی " +"پایتون فراخوانی شود." -msgid "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode `::" +msgid "" +"Example using the preinitialization to enable the :ref:`Python UTF-8 Mode `::" msgstr "" +"مثالی از استفاده از پیش‌مقداردهی اولیه (preinitialization) برای " +"فعال‌سازی :ref:`حالت UTF-8 پایتون `::" msgid "" "PyStatus status;\n" @@ -1113,747 +1505,1363 @@ msgid "" "/* ... use Python API here ... */\n" "Py_Finalize();" msgstr "" +"PyStatus status;\n" +"PyPreConfig preconfig;\n" +"PyPreConfig_InitPythonConfig(&preconfig);\n" +"\n" +"preconfig.utf8_mode = 1;\n" +"\n" +"status = Py_PreInitialize(&preconfig);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}\n" +"\n" +"/* at this point, Python speaks UTF-8 */\n" +"\n" +"Py_Initialize();\n" +"/* ... use Python API here ... */\n" +"Py_Finalize();" msgid "PyConfig" -msgstr "" +msgstr "PyConfig" msgid "Structure containing most parameters to configure Python." -msgstr "" +msgstr "ساختاری که بیشتر پارامترهای پیکربندی پایتون را در بر می‌گیرد." -msgid "When done, the :c:func:`PyConfig_Clear` function must be used to release the configuration memory." +msgid "" +"When done, the :c:func:`PyConfig_Clear` function must be used to release the " +"configuration memory." msgstr "" +"پس از اتمام کار، باید از تابع :c:func:`PyConfig_Clear` برای آزاد کردن حافظه‌ی " +"پیکربندی استفاده شود." msgid "Structure methods:" -msgstr "" +msgstr "متدهای ساختار:" -msgid "Initialize configuration with the :ref:`Python Configuration `." +msgid "" +"Initialize configuration with the :ref:`Python Configuration `." msgstr "" +"پیکربندی را با :ref:`پیکربندی پایتون ` مقداردهی اولیه کنید." -msgid "Initialize configuration with the :ref:`Isolated Configuration `." +msgid "" +"Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" +"پیکربندی را با :ref:`پیکربندی ایزوله ` مقداردهی اولیه می‌کند." msgid "Copy the wide character string *str* into ``*config_str``." -msgstr "" +msgstr "رشته نویسه پهن *str* را در ``*config_str`` کپی کنید." msgid ":ref:`Preinitialize Python ` if needed." -msgstr "" +msgstr ":ref:`پیش‌مقداردهی پایتون ` را در صورت نیاز انجام دهید." -msgid "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into ``*config_str``." +msgid "" +"Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " +"``*config_str``." msgstr "" +"*str* را با استفاده از :c:func:`Py_DecodeLocale` کدگشایی کنید و نتیجه را در " +"``*config_str`` قرار دهید." -msgid "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) from the *argv* list of wide character strings." +msgid "" +"Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) from " +"the *argv* list of wide character strings." msgstr "" +"آرگومان‌های خط فرمان (عضو :c:member:`~PyConfig.argv` از *config*) را از فهرست " +"*argv* از رشته‌های نویسه پهن تنظیم می‌کند." -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`." +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:member:`~PyConfig.argv` عضوی از *config*) را از فهرست " +"*argv* از رشته‌های بایتی تنظیم می‌کند. بایت‌ها با استفاده " +"از :c:func:`Py_DecodeLocale` کدگشایی می‌شوند." msgid "Set the list of wide strings *list* to *length* and *items*." -msgstr "" +msgstr "فهرست رشته‌های پهن *list* را برابر *length* و *items* قرار می‌دهد." msgid "Read all Python configuration." -msgstr "" +msgstr "خواندن تمام پیکربندی پایتون." msgid "Fields which are already initialized are left unchanged." -msgstr "" +msgstr "فیلد‌هایی که از قبل مقداردهی اولیه شده‌اند، بدون تغییر باقی می‌مانند." -msgid "Fields for :ref:`path configuration ` are no longer calculated or modified when calling this function, as of Python 3.11." +msgid "" +"Fields for :ref:`path configuration ` are no longer " +"calculated or modified when calling this function, as of Python 3.11." msgstr "" +"از پایتون 3.11 به بعد، فیلدهای :ref:`پیکربندی مسیر ` هنگام " +"فراخوانی این تابع دیگر محاسبه یا تغییر داده نمی‌شوند." -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 arguments are parsed. Since Python arguments are stripped from :c:member:`PyConfig.argv`, parsing arguments twice would parse the application options as Python options." +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 arguments " +"are parsed. Since Python arguments are stripped from :c:member:`PyConfig.argv`, " +"parsing arguments twice would parse the application options as Python options." msgstr "" +"تابع :c:func:`PyConfig_Read` آرگومان‌های :c:member:`PyConfig.argv` را فقط یک بار " +"تجزیه می‌کند: پس از تجزیه‌ی آرگومان‌ها، :c:member:`PyConfig.parse_argv` روی ``2`` " +"تنظیم می‌شود. از آنجا که آرگومان‌های پایتون از :c:member:`PyConfig.argv` حذف " +"می‌شوند، تجزیه‌ی دوباره‌ی آرگومان‌ها باعث می‌شد گزینه‌های برنامه به‌عنوان گزینه‌های " +"پایتون تجزیه شوند." -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``." +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:member:`PyConfig.argv` اکنون فقط یک‌بار تجزیه " +"می‌شوند، :c:member:`PyConfig.parse_argv` پس از تجزیه آرگومان‌ها برابر ``2`` تنظیم " +"می‌شود، و آرگومان‌ها تنها در صورتی تجزیه می‌شوند " +"که :c:member:`PyConfig.parse_argv` برابر ``1`` باشد." -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." +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:func:`PyConfig_Read` دیگر تمام مسیرها را محاسبه نمی‌کند و در نتیجه، ممکن است " +"فیلدهای فهرست‌شده در :ref:`پیکربندی مسیر پایتون ` تا زمان " +"فراخوانی :c:func:`Py_InitializeFromConfig` به‌روزرسانی نشوند." msgid "Release configuration memory." -msgstr "" +msgstr "آزاد کردن حافظه پیکربندی." -msgid "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. In that case, the Python preinitialization configuration (:c:type:`PyPreConfig`) is based on the :c:type:`PyConfig`. If configuration fields which are in common with :c:type:`PyPreConfig` are tuned, they must be set before calling a :c:type:`PyConfig` method:" -msgstr "" +msgid "" +"Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. In " +"that case, the Python preinitialization configuration (:c:type:`PyPreConfig`) " +"is based on the :c:type:`PyConfig`. If configuration fields which are in common " +"with :c:type:`PyPreConfig` are tuned, they must be set before calling " +"a :c:type:`PyConfig` method:" +msgstr "" +"بیشتر متدهای ``PyConfig`` در صورت نیاز پایتون را :ref:`پیش‌مقداردهی اولیه ` می‌کنند. در این صورت، پیکربندی پیش‌مقداردهی اولیه پایتون " +"(:c:type:`PyPreConfig`) بر اساس :c:type:`PyConfig` است. اگر فیلدهای پیکربندی که " +"با :c:type:`PyPreConfig` مشترک‌اند تنظیم شوند، باید پیش از فراخوانی یک " +"متد :c:type:`PyConfig` مقداردهی شده باشند:" msgid ":c:member:`PyConfig.dev_mode`" -msgstr "" +msgstr ":c:member:`PyConfig.dev_mode`" msgid ":c:member:`PyConfig.isolated`" -msgstr "" +msgstr ":c:member:`PyConfig.isolated`" msgid ":c:member:`PyConfig.parse_argv`" -msgstr "" +msgstr ":c:member:`PyConfig.parse_argv`" msgid ":c:member:`PyConfig.use_environment`" -msgstr "" +msgstr ":c:member:`PyConfig.use_environment`" -msgid "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` is used, this method must be called before other methods, since the preinitialization configuration depends on command line arguments (if :c:member:`~PyConfig.parse_argv` is non-zero)." +msgid "" +"Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` is " +"used, this method must be called before other methods, since the " +"preinitialization configuration depends on command line arguments " +"(if :c:member:`~PyConfig.parse_argv` is non-zero)." msgstr "" +"علاوه بر این، اگر از :c:func:`PyConfig_SetArgv` " +"یا :c:func:`PyConfig_SetBytesArgv` استفاده شود، این متد باید پیش از سایر متدها " +"فراخوانی شود، زیرا پیکربندی پیش‌مقداردهی اولیه به آرگومان‌های خط فرمان وابسته است " +"(اگر :c:member:`~PyConfig.parse_argv` ناصفر باشد)." -msgid "The caller of these methods is responsible to handle exceptions (error or exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." +msgid "" +"The caller of these methods is responsible to handle exceptions (error or exit) " +"using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" +"فراخوان‌کننده این متدها مسئول مدیریت استثناها (خطا یا خروج) با استفاده از " +"``PyStatus_Exception()`` و ``Py_ExitStatusException()`` است." -msgid "Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig.argv`. These parameters are similar to those passed to the program's :c:func:`main` function with the difference that the first entry should refer to the script file to be executed rather than the executable hosting the Python interpreter. If there isn't a script that will be run, the first entry in :c:member:`~PyConfig.argv` can be an empty string." -msgstr "" +msgid "" +"Set :data:`sys.argv` command line arguments based " +"on :c:member:`~PyConfig.argv`. These parameters are similar to those passed to " +"the program's :c:func:`main` function with the difference that the first entry " +"should refer to the script file to be executed rather than the executable " +"hosting the Python interpreter. If there isn't a script that will be run, the " +"first entry in :c:member:`~PyConfig.argv` can be an empty string." +msgstr "" +"آرگومان‌های خط فرمان :data:`sys.argv` بر اساس :c:member:`~PyConfig.argv` تنظیم " +"می‌شوند. این پارامترها مشابه پارامترهایی هستند که به تابع :c:func:`main` برنامه " +"پاس داده می‌شوند، با این تفاوت که ورودی اول باید به پرونده اسکریپتی که قرار است " +"اجرا شود اشاره کند، نه به پرونده اجرایی‌ای که مفسر پایتون را میزبانی می‌کند. اگر " +"اسکریپتی که قرار است اجرا شود وجود نداشته باشد، ورودی اول " +"در :c:member:`~PyConfig.argv` می‌تواند یک رشته خالی باشد." -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`." +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:member:`~PyConfig.parse_argv` را برابر ``1`` قرار دهید " +"تا :c:member:`~PyConfig.argv` به همان شیوه‌ای که پایتون معمولی آرگومان‌های خط " +"فرمان پایتون را تجزیه می‌کند، تجزیه شود و سپس آرگومان‌های پایتون " +"از :c:member:`~PyConfig.argv` حذف شوند." -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." +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:member:`~PyConfig.argv` خالی باشد، یک رشته خالی افزوده می‌شود تا اطمینان " +"حاصل شود که :data:`sys.argv` همیشه وجود دارد و هرگز خالی نیست." msgid "Default: ``NULL``." -msgstr "" +msgstr "پیش‌فرض: ``NULL``." msgid "See also the :c:member:`~PyConfig.orig_argv` member." -msgstr "" +msgstr "همچنین عضو :c:member:`~PyConfig.orig_argv` را ببینید." -msgid "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :data:`sys.path` at startup:" +msgid "" +"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path " +"to :data:`sys.path` at startup:" msgstr "" +"اگر برابر با صفر باشد، ``Py_RunMain()`` هنگام راه‌اندازی یک مسیر بالقوه ناامن را " +"به ابتدای :data:`sys.path` اضافه می‌کند:" -msgid "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m module``), prepend the current working directory." +msgid "" +"If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " +"module``), prepend the current working directory." msgstr "" +"اگر :c:member:`argv[0] ` برابر با ``L\"-m\"`` (``python -m " +"module``) باشد، پوشه‌ی کاری جاری به ابتدا افزوده می‌شود." -msgid "If running a script (``python script.py``), prepend the script's directory. If it's a symbolic link, resolve symbolic links." +msgid "" +"If running a script (``python script.py``), prepend the script's directory. If " +"it's a symbolic link, resolve symbolic links." msgstr "" +"اگر اسکریپتی اجرا شود (``python script.py``)، پوشه‌ی اسکریپت در ابتدا قرار " +"می‌گیرد. اگر اسکریپت یک پیوند نمادین باشد، پیوندهای نمادین حل می‌شوند." -msgid "Otherwise (``python -c code`` and ``python``), prepend an empty string, which means the current working directory." +msgid "" +"Otherwise (``python -c code`` and ``python``), prepend an empty string, which " +"means the current working directory." msgstr "" +"در غیر این صورت (``python -c code`` و ``python``)، یک رشته‌ی خالی در ابتدا قرار " +"می‌گیرد که به معنای پوشه‌ی کاری فعلی است." -msgid "Set to ``1`` by the :option:`-P` command line option and the :envvar:`PYTHONSAFEPATH` environment variable." +msgid "" +"Set to ``1`` by the :option:`-P` command line option and " +"the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" +"با گزینه‌ی خط فرمان :option:`-P` و متغیر محیطی :envvar:`PYTHONSAFEPATH` روی " +"``1`` تنظیم می‌شود." msgid "Default: ``0`` in Python config, ``1`` in isolated config." -msgstr "" +msgstr "پیش‌فرض: ``0`` در پیکربندی پایتون، ``1`` در پیکربندی ایزوله." msgid ":data:`sys.base_exec_prefix`." -msgstr "" +msgstr ":data:`sys.base_exec_prefix`." msgid "Part of the :ref:`Python Path Configuration ` output." -msgstr "" +msgstr "بخشی از خروجی :ref:`پیکربندی مسیر پایتون ` است." msgid "See also :c:member:`PyConfig.exec_prefix`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.exec_prefix` را ببینید." msgid "Python base executable: ``sys._base_executable``." -msgstr "" +msgstr "فایل اجرایی پایه‌ی پایتون: ``sys._base_executable``." msgid "Set by the ``__PYVENV_LAUNCHER__`` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی ``__PYVENV_LAUNCHER__`` تنظیم می‌شود." msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." -msgstr "" +msgstr "اگر ``NULL`` باشد، از :c:member:`PyConfig.executable` تنظیم می‌شود." msgid "See also :c:member:`PyConfig.executable`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.executable` را ببینید." msgid ":data:`sys.base_prefix`." -msgstr "" +msgstr ":data:`sys.base_prefix`." msgid "See also :c:member:`PyConfig.prefix`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.prefix` را ببینید." -msgid "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, disable buffering on the C streams stdout and stderr." +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 "" +"اگر برابر با ``0`` باشد و :c:member:`~PyConfig.configure_c_stdio` غیر‌صفر باشد، " +"بافر کردن جریان‌های stdout و stderr زبان C غیر‌فعال می‌شود." -msgid "Set to ``0`` by the :option:`-u` command line option and the :envvar:`PYTHONUNBUFFERED` environment variable." +msgid "" +"Set to ``0`` by the :option:`-u` command line option and " +"the :envvar:`PYTHONUNBUFFERED` environment variable." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-u` و متغیر محیطی :envvar:`PYTHONUNBUFFERED` روی " +"``0`` تنظیم می‌شود." msgid "stdin is always opened in buffered mode." -msgstr "" +msgstr "stdin همیشه در حالت بافرشده باز می‌شود." msgid "Default: ``1``." -msgstr "" +msgstr "پیش‌فرض: ``1``." -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`." +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 "" +"اگر برابر با ``1`` باشد، هنگام مقایسه‌ی :class:`bytes` یا :class:`bytearray` " +"با :class:`str`، یا مقایسه‌ی :class:`bytes` با :class:`int`، هشداری صادر می‌شود." -msgid "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these cases." +msgid "" +"If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " +"cases." msgstr "" +"اگر برابر یا بزرگ‌تر از ``2`` باشد، در این موارد استثنای :exc:`BytesWarning` " +"مطرح می‌شود." msgid "Incremented by the :option:`-b` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-b` افزایش می‌یابد." -msgid "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for details." +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 "" +"اگر نا‌صفر باشد، هنگامی که :class:`io.TextIOWrapper` از کدگذاری پیش‌فرض خود " +"استفاده می‌کند، هشدار :exc:`EncodingWarning` صادر می‌شود. برای جزئیات به :ref:`io-" +"encoding-warning` مراجعه کنید." -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." +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 "" +"اگر برابر با ``0`` باشد، گنجاندن نگاشت‌های سطر پایانی و ستون در اشیاء کد را " +"غیرفعال می‌کند. همچنین چاپ نشان‌های ^ (caret) در ردگیری برای مکان‌های مشخص خطا را " +"غیرفعال می‌کند." -msgid "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and by the :option:`-X no_debug_ranges <-X>` command line option." +msgid "" +"Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and by " +"the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" +"با متغیر محیطی :envvar:`PYTHONNODEBUGRANGES` و با گزینه‌ی خط فرمان :option:`-X " +"no_debug_ranges <-X>` روی ``0`` تنظیم می‌شود." -msgid "Control the validation behavior of hash-based ``.pyc`` files: value of the :option:`--check-hash-based-pycs` command line option." +msgid "" +"Control the validation behavior of hash-based ``.pyc`` files: value of " +"the :option:`--check-hash-based-pycs` command line option." msgstr "" +"کنترل رفتار اعتبارسنجی پرونده‌های ``.pyc`` مبتنی بر هش: مقدار گزینه‌ی خط " +"فرمان :option:`--check-hash-based-pycs`." msgid "Valid values:" -msgstr "" +msgstr "مقادیر معتبر:" -msgid "``L\"always\"``: Hash the source file for invalidation regardless of value of the 'check_source' flag." +msgid "" +"``L\"always\"``: Hash the source file for invalidation regardless of value of " +"the 'check_source' flag." msgstr "" +"``L\"always\"``: هش پرونده‌ی منبع برای باطل‌سازی محاسبه می‌شود، صرف‌نظر از مقدار " +"پرچم 'check_source'." msgid "``L\"never\"``: Assume that hash-based pycs always are valid." -msgstr "" +msgstr "``L\"never\"``: فرض کنید که pycهای مبتنی بر هش همیشه معتبر هستند." -msgid "``L\"default\"``: The 'check_source' flag in hash-based pycs determines invalidation." +msgid "" +"``L\"default\"``: The 'check_source' flag in hash-based pycs determines " +"invalidation." msgstr "" +"``L\"default\"``: پرچم 'check_source' در pyc‌های مبتنی بر هش، بی‌اعتبارسازی را " +"تعیین می‌کند." msgid "Default: ``L\"default\"``." -msgstr "" +msgstr "پیش‌فرض: ``L\"default\"``." msgid "See also :pep:`552` \"Deterministic pycs\"." -msgstr "" +msgstr "همچنین ببینید :pep:`552` «pyc‌های قطعی»." msgid "If non-zero, configure C standard streams:" -msgstr "" +msgstr "اگر نا‌صفر باشد، جریان‌های استاندارد C را پیکربندی می‌کند:" -msgid "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." +msgid "" +"On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" +"در ویندوز، حالت دودویی (``O_BINARY``) را روی stdin، stdout و stderr تنظیم کنید." -msgid "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of stdin, stdout and stderr streams." +msgid "" +"If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " +"stdin, stdout and stderr streams." msgstr "" +"اگر :c:member:`~PyConfig.buffered_stdio` برابر صفر باشد، بافر کردن جریان‌های " +"stdin، stdout و stderr غیرفعال می‌شود." -msgid "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on stdin and stdout (only stdout on Windows)." +msgid "" +"If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " +"stdin and stdout (only stdout on Windows)." msgstr "" +"اگر :c:member:`~PyConfig.interactive` ناصفر باشد، بافر کردن جریان روی stdin و " +"stdout فعال می‌شود (در ویندوز فقط stdout)." msgid "If non-zero, enable the :ref:`Python Development Mode `." -msgstr "" +msgstr "اگر ناصفر باشد، :ref:`حالت توسعه پایتون ` را فعال می‌کند." -msgid "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:`PYTHONDEVMODE` environment variable." +msgid "" +"Set to ``1`` by the :option:`-X dev <-X>` option and " +"the :envvar:`PYTHONDEVMODE` environment variable." msgstr "" +"با گزینه‌ی :option:`-X dev <-X>` و متغیر محیطی :envvar:`PYTHONDEVMODE` برابر " +"``1`` قرار می‌گیرد." msgid "Dump Python references?" -msgstr "" +msgstr "ارجاع‌های پایتون برون‌ریزی شوند؟" msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" +"اگر ناصفر باشد، تمام اشیایی که در زمان خروج هنوز زنده‌اند را برون‌ریزی می‌کند." msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." -msgstr "" +msgstr "با متغیر محیطی :envvar:`PYTHONDUMPREFS` روی ``1`` تنظیم می‌شود." -msgid "Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: see the :option:`configure --with-trace-refs option <--with-trace-refs>`." +msgid "" +"Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: see " +"the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" +"نیازمند ساخت خاصی از پایتون است که ماکروی ``Py_TRACE_REFS`` در آن تعریف‌شده " +"باشد: :option:`گزینه‌ی configure --with-trace-refs <--with-trace-refs>` را " +"ببینید." msgid "Filename where to dump Python references." -msgstr "" +msgstr "نام پرونده‌ای که ارجاع‌های پایتون در آن برون‌ریزی می‌شوند." msgid "Set by the :envvar:`PYTHONDUMPREFSFILE` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONDUMPREFSFILE` تنظیم می‌شود." -msgid "The site-specific directory prefix where the platform-dependent Python files are installed: :data:`sys.exec_prefix`." +msgid "" +"The site-specific directory prefix where the platform-dependent Python files " +"are installed: :data:`sys.exec_prefix`." msgstr "" +"پیشوند پوشه‌ی مختص سایت که پرونده‌های پایتونِ وابسته به پلتفرم در آن نصب " +"می‌شوند: :data:`sys.exec_prefix`." msgid "See also :c:member:`PyConfig.base_exec_prefix`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.base_exec_prefix` را ببینید." -msgid "The absolute path of the executable binary for the Python interpreter: :data:`sys.executable`." -msgstr "" +msgid "" +"The absolute path of the executable binary for the Python " +"interpreter: :data:`sys.executable`." +msgstr "مسیر مطلق پرونده دودویی اجرایی مفسر پایتون: :data:`sys.executable`." msgid "See also :c:member:`PyConfig.base_executable`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.base_executable` را ببینید." msgid "Enable faulthandler?" -msgstr "" +msgstr "فعال کردن faulthandler؟" msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" +"اگر نا‌صفر باشد، تابع :func:`faulthandler.enable` در زمان راه‌اندازی فراخوانی " +"می‌شود." -msgid "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:`PYTHONFAULTHANDLER` environment variable." +msgid "" +"Set to ``1`` by :option:`-X faulthandler <-X>` and " +"the :envvar:`PYTHONFAULTHANDLER` environment variable." msgstr "" +"با گزینه‌ی :option:`-X faulthandler <-X>` و متغیر " +"محیطی :envvar:`PYTHONFAULTHANDLER` روی ``1`` تنظیم می‌شود." -msgid ":term:`Filesystem encoding `: :func:`sys.getfilesystemencoding`." +msgid "" +":term:`Filesystem encoding `: :func:`sys.getfilesystemencoding`." msgstr "" +":term:`کدگذاری فایل‌سیستم `: :func:`sys.getfilesystemencoding`." msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." -msgstr "" +msgstr "در macOS، Android و VxWorks: به‌طور پیش‌فرض از ``\"utf-8\"`` استفاده می‌شود." -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." +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 "" +"در ویندوز: به‌طور پیش‌فرض از ``\"utf-8\"`` استفاده کنید، یا ``\"mbcs\"`` در صورتی " +"که :c:member:`~PyPreConfig.legacy_windows_fs_encoding` از :c:type:`PyPreConfig` " +"ناصفر باشد." msgid "Default encoding on other platforms:" -msgstr "" +msgstr "کدگذاری پیش‌فرض روی سایر پلتفرم‌ها:" msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." -msgstr "" +msgstr "``\"utf-8\"`` اگر :c:member:`PyPreConfig.utf8_mode` ناصفر باشد." -msgid "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different encoding (usually Latin1)." +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 "" +"``\"ascii\"`` اگر پایتون تشخیص دهد که ``nl_langinfo(CODESET)`` کدگذاری اسکی را " +"اعلام می‌کند، در حالی که تابع ``mbstowcs()`` از کدگذاری دیگری (معمولاً Latin1) " +"کدگشایی می‌کند." msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." -msgstr "" +msgstr "``\"utf-8\"`` اگر ``nl_langinfo(CODESET)`` رشته‌ای خالی برگرداند." -msgid "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." +msgid "" +"Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" +"در غیر این صورت، از :term:`locale encoding` استفاده کنید: نتیجه‌ی " +"``nl_langinfo(CODESET)``." -msgid "At Python startup, the encoding name is normalized to the Python codec name. For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." +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 "" +"در زمان راه‌اندازی پایتون، نام کدگذاری به نام کدک پایتون نرمال‌سازی می‌شود. برای " +"مثال، ``\"ANSI_X3.4-1968\"`` با ``\"ascii\"`` جایگزین می‌شود." msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." -msgstr "" +msgstr "همچنین عضو :c:member:`~PyConfig.filesystem_errors` را ببینید." -msgid ":term:`Filesystem error handler `: :func:`sys.getfilesystemencodeerrors`." +msgid "" +":term:`Filesystem error handler `: :func:`sys.getfilesystemencodeerrors`." msgstr "" +":term:`هندلر خطای فایل‌سیستم `: :func:`sys.getfilesystemencodeerrors`." -msgid "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-zero." +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 "" +"در ویندوز: به‌طور پیش‌فرض از ``\"surrogatepass\"`` استفاده کنید، یا " +"``\"replace\"`` اگر :c:member:`~PyPreConfig.legacy_windows_fs_encoding` " +"در :c:type:`PyPreConfig` ناصفر باشد." msgid "On other platforms: use ``\"surrogateescape\"`` by default." -msgstr "" +msgstr "در پلتفرم‌های دیگر: به‌طور پیش‌فرض از ``\"surrogateescape\"`` استفاده کنید." msgid "Supported error handlers:" -msgstr "" +msgstr "هندلرهای خطای پشتیبانی‌شده:" msgid "``\"strict\"``" -msgstr "" +msgstr "``\"strict\"``" msgid "``\"surrogateescape\"``" -msgstr "" +msgstr "``\"surrogateescape\"``" msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" -msgstr "" +msgstr "``\"surrogatepass\"`` (فقط با کدگذاری UTF-8 پشتیبانی می‌شود)" msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." -msgstr "" +msgstr "همچنین عضو :c:member:`~PyConfig.filesystem_encoding` را ببینید." msgid "If non-zero, use frozen modules." -msgstr "" +msgstr "اگر نا‌صفر باشد، از ماژول‌های منجمد استفاده می‌شود." msgid "Set by the :envvar:`PYTHON_FROZEN_MODULES` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHON_FROZEN_MODULES` تنظیم می‌شود." -msgid "Default: ``1`` in a release build, or ``0`` in a :ref:`debug build `." +msgid "" +"Default: ``1`` in a release build, or ``0`` in a :ref:`debug build `." msgstr "" +"پیش‌فرض: ``1`` در بیلد انتشار، یا ``0`` در :ref:`بیلد اشکال‌زدایی `." msgid "Randomized hash function seed." -msgstr "" +msgstr "بذر تصادفی‌سازی تابع هش." -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." +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:member:`~PyConfig.use_hash_seed` صفر باشد، یک بذر هنگام راه‌اندازی پایتون " +"به‌طور تصادفی انتخاب می‌شود و :c:member:`~PyConfig.hash_seed` نادیده گرفته می‌شود." msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONHASHSEED` تنظیم می‌شود." -msgid "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." +msgid "" +"Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" +"مقدار پیش‌فرض *use_hash_seed*: ``-1`` در حالت پایتون، ``0`` در حالت ایزوله." -msgid "Set the default Python \"home\" directory, that is, the location of the standard Python libraries (see :envvar:`PYTHONHOME`)." +msgid "" +"Set the default Python \"home\" directory, that is, the location of the " +"standard Python libraries (see :envvar:`PYTHONHOME`)." msgstr "" +"پوشه‌ی «خانه»ی پیش‌فرضِ پایتون را تنظیم می‌کند، یعنی مکان کتابخانه‌های استاندارد " +"پایتون (به :envvar:`PYTHONHOME` مراجعه کنید)." msgid "Set by the :envvar:`PYTHONHOME` environment variable." -msgstr "" +msgstr "با متغیر محیطی :envvar:`PYTHONHOME` تنظیم می‌شود." msgid "Part of the :ref:`Python Path Configuration ` input." -msgstr "" +msgstr "بخشی از ورودی :ref:`پیکربندی مسیر پایتون ` است." -msgid "If ``1``, profile import time. If ``2``, include additional output that indicates when an imported module has already been loaded." +msgid "" +"If ``1``, profile import time. If ``2``, include additional output that " +"indicates when an imported module has already been loaded." msgstr "" +"اگر ``1`` باشد، زمان ایمپورت پروفایل‌گیری می‌شود. اگر ``2`` باشد، خروجی اضافی‌ای " +"گنجانده می‌شود که نشان می‌دهد یک ماژول ایمپورت‌شده از قبل بارگذاری شده است." -msgid "Set by the :option:`-X importtime <-X>` option and the :envvar:`PYTHONPROFILEIMPORTTIME` environment variable." +msgid "" +"Set by the :option:`-X importtime <-X>` option and " +"the :envvar:`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" +"توسط گزینه‌ی :option:`-X importtime <-X>` و متغیر " +"محیطی :envvar:`PYTHONPROFILEIMPORTTIME` تنظیم می‌شود." msgid "Added support for ``import_time = 2``" -msgstr "" +msgstr "پشتیبانی از ``import_time = 2`` افزوده شد" msgid "Enter interactive mode after executing a script or a command." -msgstr "" +msgstr "پس از اجرای یک اسکریپت یا دستور، وارد حالت تعاملی شوید." -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 the script or the command, even when :data:`sys.stdin` does not appear to be a terminal." +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 the " +"script or the command, even when :data:`sys.stdin` does not appear to be a " +"terminal." msgstr "" +"اگر بزرگ‌تر از ``0`` باشد، بررسی (inspect) را فعال می‌کند: وقتی یک اسکریپت " +"به‌عنوان آرگومان اول پاس داده شود یا از گزینه -c استفاده شود، پس از اجرای " +"اسکریپت یا فرمان وارد حالت تعاملی می‌شود، حتی زمانی که :data:`sys.stdin` پایانه " +"به نظر نرسد." -msgid "Incremented by the :option:`-i` command line option. Set to ``1`` if the :envvar:`PYTHONINSPECT` environment variable is non-empty." +msgid "" +"Incremented by the :option:`-i` command line option. Set to ``1`` if " +"the :envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" +"با گزینه‌ی خط فرمان :option:`-i` افزایش می‌یابد. اگر متغیر " +"محیطی :envvar:`PYTHONINSPECT` غیرخالی باشد، روی ``1`` تنظیم می‌شود." msgid "Install Python signal handlers?" -msgstr "" +msgstr "نصب هندلر‌های سیگنال پایتون؟" msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." -msgstr "" +msgstr "پیش‌فرض: ``1`` در حالت پایتون، ``0`` در حالت ایزوله." msgid "If greater than ``0``, enable the interactive mode (REPL)." -msgstr "" +msgstr "اگر بزرگ‌تر از ``0`` باشد، حالت تعاملی (REPL) را فعال می‌کند." msgid "Incremented by the :option:`-i` command line option." -msgstr "" +msgstr "توسط گزینه‌ی خط فرمان :option:`-i` افزایش می‌یابد." -msgid "Configures the :ref:`integer string conversion length limitation `. An initial value of ``-1`` means the value will be taken from the command line or environment or otherwise default to 4300 (:data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables the limitation. Values greater than zero but less than 640 (:data:`sys.int_info.str_digits_check_threshold`) are unsupported and will produce an error." -msgstr "" +msgid "" +"Configures the :ref:`integer string conversion length limitation " +"`. An initial value of ``-1`` means the value will be " +"taken from the command line or environment or otherwise default to 4300 " +"(:data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables the " +"limitation. Values greater than zero but less than 640 " +"(:data:`sys.int_info.str_digits_check_threshold`) are unsupported and will " +"produce an error." +msgstr "" +":ref:`محدودیت طول تبدیل رشته به عدد صحیح ` را پیکربندی " +"می‌کند. مقدار اولیه‌ی ``-1`` به این معناست که مقدار از خط فرمان یا محیط گرفته " +"می‌شود و در غیر این صورت مقدار پیش‌فرض ۴۳۰۰ " +"(:data:`sys.int_info.default_max_str_digits`) خواهد بود. مقدار ``0`` این " +"محدودیت را غیرفعال می‌کند. مقادیر بزرگ‌تر از صفر اما کوچک‌تر از ۶۴۰ " +"(:data:`sys.int_info.str_digits_check_threshold`) پشتیبانی نمی‌شوند و منجر به " +"خطا می‌شوند." -msgid "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." +msgid "" +"Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " +"the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" +"با پرچم خط فرمان :option:`-X int_max_str_digits <-X>` یا متغیر " +"محیطی :envvar:`PYTHONINTMAXSTRDIGITS` پیکربندی می‌شود." -msgid "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info.default_max_str_digits`) in isolated mode." +msgid "" +"Default: ``-1`` in Python mode. 4300 " +"(:data:`sys.int_info.default_max_str_digits`) in isolated mode." msgstr "" +"پیش‌فرض: ``-1`` در حالت پایتون. ۴۳۰۰ " +"(:data:`sys.int_info.default_max_str_digits`) در حالت ایزوله." -msgid "If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will override the return values of :func:`os.cpu_count`, :func:`os.process_cpu_count`, and :func:`multiprocessing.cpu_count`." +msgid "" +"If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " +"override the return values " +"of :func:`os.cpu_count`, :func:`os.process_cpu_count`, " +"and :func:`multiprocessing.cpu_count`." msgstr "" +"اگر مقدار :c:member:`~PyConfig.cpu_count` برابر ``-1`` نباشد، مقادیر " +"بازگشتی :func:`os.cpu_count`، :func:`os.process_cpu_count` " +"و :func:`multiprocessing.cpu_count` را بازنویسی می‌کند." -msgid "Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :envvar:`PYTHON_CPU_COUNT` environment variable." +msgid "" +"Configured by the :samp:`-X cpu_count={n|default}` command line flag or " +"the :envvar:`PYTHON_CPU_COUNT` environment variable." msgstr "" +"با پرچم خط فرمان :samp:`-X cpu_count={n|default}` یا متغیر " +"محیطی :envvar:`PYTHON_CPU_COUNT` پیکربندی می‌شود." msgid "Default: ``-1``." -msgstr "" +msgstr "پیش‌فرض: ``-1``." msgid "If greater than ``0``, enable isolated mode:" -msgstr "" +msgstr "اگر بزرگ‌تر از ``0`` باشد، حالت ایزوله (isolated mode) را فعال می‌کند:" -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." +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:member:`~PyConfig.safe_path` را برابر ``1`` قرار دهید: هنگام راه‌اندازی " +"پایتون، هیچ مسیری که بالقوه ناامن است — مانند پوشه‌ی جاری، پوشه‌ی اسکریپت یا یک " +"رشته‌ی خالی — به ابتدای :data:`sys.path` افزوده نشود." -msgid "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` environment variables." +msgid "" +"Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " +"environment variables." msgstr "" +"مقدار :c:member:`~PyConfig.use_environment` را روی ``0`` تنظیم کنید: متغیرهای " +"محیطی ``PYTHON`` نادیده گرفته می‌شوند." -msgid "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user site directory to :data:`sys.path`." +msgid "" +"Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user site " +"directory to :data:`sys.path`." msgstr "" +"مقدار :c:member:`~PyConfig.user_site_directory` را ``0`` قرار دهید: پوشه‌ی site " +"کاربر به :data:`sys.path` اضافه نشود." -msgid "Python REPL doesn't import :mod:`readline` nor enable default readline configuration on interactive prompts." +msgid "" +"Python REPL doesn't import :mod:`readline` nor enable default readline " +"configuration on interactive prompts." msgstr "" +"REPL پایتون ماژول :mod:`readline` را ایمپورت نمی‌کند و پیکربندی پیش‌فرض readline " +"را نیز در اعلان‌های تعاملی فعال نمی‌کند." msgid "Set to ``1`` by the :option:`-I` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-I` روی ``1`` تنظیم می‌شود." -msgid "See also the :ref:`Isolated Configuration ` and :c:member:`PyPreConfig.isolated`." +msgid "" +"See also the :ref:`Isolated Configuration ` " +"and :c:member:`PyPreConfig.isolated`." msgstr "" +"همچنین :ref:`پیکربندی ایزوله ` " +"و :c:member:`PyPreConfig.isolated` را ببینید." -msgid "If non-zero, use :class:`io.FileIO` instead of :class:`!io._WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`." +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 "" +"اگر غیر صفر باشد، به‌جای :class:`!io._WindowsConsoleIO` از :class:`io.FileIO` " +"برای :data:`sys.stdin`، :data:`sys.stdout` و :data:`sys.stderr` استفاده می‌شود." -msgid "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable is set to a non-empty string." +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable is " +"set to a non-empty string." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSSTDIO` به یک رشته‌ی غیرخالی تنظیم " +"شده باشد، به ``1`` تنظیم می‌شود." msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." -msgstr "" +msgstr "همچنین :pep:`528` (تغییر کدگذاری کنسول ویندوز به UTF-8) را ببینید." -msgid "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator ` at exit." +msgid "" +"If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " +"` at exit." msgstr "" +"اگر ناصفر باشد، آمار :ref:`تخصیص‌دهنده حافظه pymalloc پایتون ` در زمان " +"خروج برون‌ریزی می‌شود." msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONMALLOCSTATS` به ``1`` تنظیم می‌شود." -msgid "The option is ignored if Python is :option:`configured using the --without-pymalloc option <--without-pymalloc>`." +msgid "" +"The option is ignored if Python is :option:`configured using the --without-" +"pymalloc option <--without-pymalloc>`." msgstr "" +"اگر پایتون :option:`با گزینه‌ی --without-pymalloc پیکربندی شده باشد <--without-" +"pymalloc>`، این گزینه نادیده گرفته می‌شود." msgid "Platform library directory name: :data:`sys.platlibdir`." -msgstr "" +msgstr "نام پوشه‌ی کتابخانه‌ی پلتفرم: :data:`sys.platlibdir`." msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONPLATLIBDIR` تنظیم می‌شود." -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)." +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 "" +"پیش‌فرض: مقدار ماکروی ``PLATLIBDIR`` که توسط :option:`configure --with-" +"platlibdir option <--with-platlibdir>` تنظیم می‌شود (پیش‌فرض: ``\"lib\"``، یا " +"``\"DLLs\"`` در ویندوز)." -msgid "This macro is now used on Windows to locate the standard library extension modules, typically under ``DLLs``. However, for compatibility, note that this value is ignored for any non-standard layouts, including in-tree builds and virtual environments." +msgid "" +"This macro is now used on Windows to locate the standard library extension " +"modules, typically under ``DLLs``. However, for compatibility, note that this " +"value is ignored for any non-standard layouts, including in-tree builds and " +"virtual environments." msgstr "" +"این ماکرو اکنون در ویندوز برای مکان‌یابی ماژول‌های توسعه‌ای کتابخانه استاندارد " +"استفاده می‌شود که معمولاً در ``DLLs`` قرار دارند. با این حال، برای سازگاری، توجه " +"داشته باشید که این مقدار برای هرگونه چیدمان غیراستاندارد، از جمله ساخت‌های " +"درون‌درخت (in-tree builds) و محیط‌های مجازی، نادیده گرفته می‌شود." -msgid "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:data:`os.pathsep`)." +msgid "" +"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` " +"(:data:`os.pathsep`)." msgstr "" +"مسیرهای جستجوی ماژول (:data:`sys.path`) به‌صورت رشته‌ای که با ``DELIM`` " +"(:data:`os.pathsep`) جدا شده است." msgid "Set by the :envvar:`PYTHONPATH` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONPATH` تنظیم می‌شود." msgid "Module search paths: :data:`sys.path`." -msgstr "" +msgstr "مسیرهای جستجوی ماژول: :data:`sys.path`." -msgid "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:`Py_InitializeFromConfig` will replace :c:member:`~PyConfig.module_search_paths` and sets :c:member:`~PyConfig.module_search_paths_set` to ``1``." +msgid "" +"If :c:member:`~PyConfig.module_search_paths_set` is equal to " +"``0``, :c:func:`Py_InitializeFromConfig` will " +"replace :c:member:`~PyConfig.module_search_paths` and " +"sets :c:member:`~PyConfig.module_search_paths_set` to ``1``." msgstr "" +"اگر :c:member:`~PyConfig.module_search_paths_set` برابر با ``0`` " +"باشد، :c:func:`Py_InitializeFromConfig` " +"مقدار :c:member:`~PyConfig.module_search_paths` را جایگزین می‌کند " +"و :c:member:`~PyConfig.module_search_paths_set` را روی ``1`` تنظیم می‌کند." -msgid "Default: empty list (``module_search_paths``) and ``0`` (``module_search_paths_set``)." +msgid "" +"Default: empty list (``module_search_paths``) and ``0`` " +"(``module_search_paths_set``)." msgstr "" +"پیش‌فرض: فهرست خالی (``module_search_paths``) و ``0`` " +"(``module_search_paths_set``)." msgid "Compilation optimization level:" -msgstr "" +msgstr "سطح بهینه‌سازی کامپایل:" msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" +"``0``: بهینه‌ساز پنجره‌ای (peephole optimizer)، مقدار ``__debug__`` برابر " +"``True`` قرار می‌گیرد." msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." -msgstr "" +msgstr "``1``: سطح ۰، حذف ادعاها، تنظیم ``__debug__`` به ``False``." msgid "``2``: Level 1, strip docstrings." -msgstr "" +msgstr "``2``: سطح ۱، حذف رشته‌های مستند." -msgid "Incremented by the :option:`-O` command line option. Set to the :envvar:`PYTHONOPTIMIZE` environment variable value." +msgid "" +"Incremented by the :option:`-O` command line option. Set to " +"the :envvar:`PYTHONOPTIMIZE` environment variable value." msgstr "" +"با گزینه‌ی خط فرمان :option:`-O` افزایش می‌یابد. برابر با مقدار متغیر " +"محیطی :envvar:`PYTHONOPTIMIZE` قرار می‌گیرد." -msgid "The list of the original command line arguments passed to the Python executable: :data:`sys.orig_argv`." +msgid "" +"The list of the original command line arguments passed to the Python " +"executable: :data:`sys.orig_argv`." msgstr "" +"فهرست آرگومان‌های اصلی خط فرمان که به فایل اجرایی پایتون ارسال " +"شده‌اند: :data:`sys.orig_argv`." -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` copies :c:member:`~PyConfig.argv` into :c:member:`~PyConfig.orig_argv` before modifying :c:member:`~PyConfig.argv` (if :c:member:`~PyConfig.parse_argv` is non-zero)." -msgstr "" +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` " +"copies :c:member:`~PyConfig.argv` into :c:member:`~PyConfig.orig_argv` before " +"modifying :c:member:`~PyConfig.argv` (if :c:member:`~PyConfig.parse_argv` is " +"non-zero)." +msgstr "" +"اگر فهرست :c:member:`~PyConfig.orig_argv` خالی باشد " +"و :c:member:`~PyConfig.argv` فهرستی نباشد که تنها شامل یک رشته خالی " +"باشد، :c:func:`PyConfig_Read` پیش از تغییر دادن :c:member:`~PyConfig.argv` " +"(اگر :c:member:`~PyConfig.parse_argv` ناصفر باشد)، :c:member:`~PyConfig.argv` " +"را در :c:member:`~PyConfig.orig_argv` کپی می‌کند." -msgid "See also the :c:member:`~PyConfig.argv` member and the :c:func:`Py_GetArgcArgv` function." +msgid "" +"See also the :c:member:`~PyConfig.argv` member and the :c:func:`Py_GetArgcArgv` " +"function." msgstr "" +"همچنین عضو :c:member:`~PyConfig.argv` و تابع :c:func:`Py_GetArgcArgv` را ببینید." msgid "Default: empty list." -msgstr "" +msgstr "پیش‌فرض: فهرست خالی." msgid "Parse command line arguments?" -msgstr "" +msgstr "پارس کردن آرگومان‌های خط فرمان؟" -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`." +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 "" +"اگر برابر با ``1`` باشد، :c:member:`~PyConfig.argv` به همان روشی که پایتون " +"معمولی :ref:`آرگومان‌های خط فرمان ` را پارس می‌کند پارس می‌شود، " +"و آرگومان‌های پایتون از :c:member:`~PyConfig.argv` حذف می‌شوند." -msgid "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:`PyConfig.parse_argv` equals to ``1``." +msgid "" +"The :c:member:`PyConfig.argv` arguments are now only parsed " +"if :c:member:`PyConfig.parse_argv` equals to ``1``." msgstr "" +"آرگومان‌های :c:member:`PyConfig.argv` اکنون تنها زمانی تجزیه می‌شوند " +"که :c:member:`PyConfig.parse_argv` برابر با ``1`` باشد." -msgid "Parser debug mode. If greater than ``0``, turn on parser debugging output (for expert only, depending on compilation options)." +msgid "" +"Parser debug mode. If greater than ``0``, turn on parser debugging output (for " +"expert only, depending on compilation options)." msgstr "" +"حالت اشکال‌زدایی پارسر. اگر بزرگ‌تر از ``0`` باشد، خروجی اشکال‌زدایی پارسر را فعال " +"می‌کند (فقط برای کاربران خبره، بسته به گزینه‌های کامپایل)." -msgid "Incremented by the :option:`-d` command line option. Set to the :envvar:`PYTHONDEBUG` environment variable value." +msgid "" +"Incremented by the :option:`-d` command line option. Set to " +"the :envvar:`PYTHONDEBUG` environment variable value." msgstr "" +"با گزینه‌ی خط فرمان :option:`-d` افزایش می‌یابد. به مقدار متغیر " +"محیطی :envvar:`PYTHONDEBUG` تنظیم می‌شود." -msgid "Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro must be defined)." +msgid "" +"Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro must " +"be defined)." msgstr "" +"به :ref:`نسخه‌ی اشکال‌زدایی پایتون ` نیاز دارد (ماکروی ``Py_DEBUG`` " +"باید تعریف شده باشد)." -msgid "If non-zero, calculation of path configuration is allowed to log warnings into ``stderr``. If equals to ``0``, suppress these warnings." +msgid "" +"If non-zero, calculation of path configuration is allowed to log warnings into " +"``stderr``. If equals to ``0``, suppress these warnings." msgstr "" +"اگر ناصفر باشد، محاسبه‌ی پیکربندی مسیر مجاز است هشدارها را در ``stderr`` ثبت " +"کند. اگر برابر ``0`` باشد، این هشدارها سرکوب می‌شوند." msgid "Now also applies on Windows." -msgstr "" +msgstr "اکنون در ویندوز نیز اعمال می‌شود." -msgid "The site-specific directory prefix where the platform independent Python files are installed: :data:`sys.prefix`." +msgid "" +"The site-specific directory prefix where the platform independent Python files " +"are installed: :data:`sys.prefix`." msgstr "" +"پیشوند پوشه‌ی مختص سایت که پرونده‌های پایتونِ مستقل از پلتفرم در آن نصب " +"می‌شوند: :data:`sys.prefix`." msgid "See also :c:member:`PyConfig.base_prefix`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.base_prefix` را ببینید." -msgid "Program name used to initialize :c:member:`~PyConfig.executable` and in early error messages during Python initialization." +msgid "" +"Program name used to initialize :c:member:`~PyConfig.executable` and in early " +"error messages during Python initialization." msgstr "" +"نام برنامه‌ای که برای مقداردهی اولیه‌ی :c:member:`~PyConfig.executable` و در " +"پیام‌های خطای اولیه در حین مقداردهی اولیه پایتون استفاده می‌شود." msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" +"در macOS، اگر متغیر محیطی :envvar:`PYTHONEXECUTABLE` تنظیم شده باشد، از آن " +"استفاده کنید." -msgid "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use ``__PYVENV_LAUNCHER__`` environment variable if set." +msgid "" +"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use ``__PYVENV_LAUNCHER__`` " +"environment variable if set." msgstr "" +"اگر ماکروی ``WITH_NEXT_FRAMEWORK`` تعریف شده باشد، در صورت تنظیم بودن، از متغیر " +"محیطی ``__PYVENV_LAUNCHER__`` استفاده می‌شود." msgid "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" +"در صورت موجود و غیرخالی بودن، از ``argv[0]`` :c:member:`~PyConfig.argv` استفاده " +"کنید." -msgid "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other platforms." +msgid "" +"Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " +"platforms." msgstr "" +"در غیر این صورت، در ویندوز از ``L\"python\"`` و در سایر پلتفرم‌ها از " +"``L\"python3\"`` استفاده کنید." -msgid "Directory where cached ``.pyc`` files are written: :data:`sys.pycache_prefix`." +msgid "" +"Directory where cached ``.pyc`` files are written: :data:`sys.pycache_prefix`." msgstr "" +"پوشه‌ای که پرونده‌های ``.pyc`` نهانگاهی در آن نوشته " +"می‌شوند: :data:`sys.pycache_prefix`." -msgid "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line option takes precedence." +msgid "" +"Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " +"the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line option " +"takes precedence." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X pycache_prefix=PATH <-X>` و متغیر " +"محیطی :envvar:`PYTHONPYCACHEPREFIX` تنظیم می‌شود. گزینه‌ی خط فرمان اولویت دارد." msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." -msgstr "" +msgstr "اگر ``NULL`` باشد، :data:`sys.pycache_prefix` روی ``None`` تنظیم می‌شود." -msgid "Quiet mode. If greater than ``0``, don't display the copyright and version at Python startup in interactive mode." +msgid "" +"Quiet mode. If greater than ``0``, don't display the copyright and version at " +"Python startup in interactive mode." msgstr "" +"حالت ساکت. اگر بزرگ‌تر از ``0`` باشد، حق نشر و نسخه هنگام راه‌اندازی پایتون در " +"حالت تعاملی نمایش داده نمی‌شود." msgid "Incremented by the :option:`-q` command line option." -msgstr "" +msgstr "توسط گزینه‌ی خط فرمان :option:`-q` افزایش می‌یابد." msgid "Value of the :option:`-c` command line option." -msgstr "" +msgstr "مقدار گزینه‌ی خط فرمان :option:`-c`." msgid "Used by :c:func:`Py_RunMain`." -msgstr "" +msgstr "توسط :c:func:`Py_RunMain` استفاده می‌شود." -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." +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 "" +"نام پرونده‌ی ارسال‌شده در خط فرمان: آرگومان انتهایی خط فرمان بدون :option:`-c` " +"یا :option:`-m`. این نام پرونده توسط تابع :c:func:`Py_RunMain` استفاده می‌شود." -msgid "For example, it is set to ``script.py`` by the ``python3 script.py arg`` command line." +msgid "" +"For example, it is set to ``script.py`` by the ``python3 script.py arg`` " +"command line." msgstr "" +"برای مثال، توسط خط فرمان ``python3 script.py arg`` برابر ``script.py`` قرار " +"می‌گیرد." msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." -msgstr "" +msgstr "همچنین گزینه‌ی :c:member:`PyConfig.skip_source_first_line` را ببینید." msgid "Value of the :option:`-m` command line option." -msgstr "" +msgstr "مقدار گزینه‌ی خط فرمان :option:`-m`." -msgid "``package.module`` path to module that should be imported before ``site.py`` is run." +msgid "" +"``package.module`` path to module that should be imported before ``site.py`` is " +"run." msgstr "" +"``package.module`` مسیر ماژولی که باید پیش از اجرای ``site.py`` ایمپورت شود." -msgid "Set by the :option:`-X presite=package.module <-X>` command-line option and the :envvar:`PYTHON_PRESITE` environment variable. The command-line option takes precedence." +msgid "" +"Set by the :option:`-X presite=package.module <-X>` command-line option and " +"the :envvar:`PYTHON_PRESITE` environment variable. The command-line option " +"takes precedence." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X presite=package.module <-X>` و متغیر " +"محیطی :envvar:`PYTHON_PRESITE` تنظیم می‌شود. گزینه‌ی خط فرمان اولویت دارد." msgid "Show total reference count at exit (excluding :term:`immortal` objects)?" msgstr "" +"نمایش مجموع شمارش ارجاع در هنگام خروج (به‌جز اشیاء :term:`نامیرا `)؟" msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-X showrefcount <-X>` روی ``1`` تنظیم می‌شود." -msgid "Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` macro must be defined)." +msgid "" +"Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` macro " +"must be defined)." msgstr "" +"نیازمند :ref:`بیلد دیباگ پایتون ` است (ماکروی ``Py_REF_DEBUG`` " +"باید تعریف شده باشد)." msgid "Import the :mod:`site` module at startup?" -msgstr "" +msgstr "آیا ماژول :mod:`site` در زمان راه‌اندازی ایمپورت شود؟" -msgid "If equal to zero, disable the import of the module site and the site-dependent manipulations of :data:`sys.path` that it entails." +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 "" +"اگر برابر با صفر باشد، ایمپورت ماژول site و دستکاری‌های وابسته به site " +"در :data:`sys.path` که این ایمپورت در پی دارد را غیرفعال می‌کند." -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)." +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 "" +"همچنین در صورتی که ماژول :mod:`site` بعداً به‌طور صریح ایمپورت شود، این دستکاری‌ها " +"را غیرفعال می‌کند (اگر می‌خواهید این دستکاری‌ها انجام شوند، :func:`site.main` را " +"فراخوانی کنید)." msgid "Set to ``0`` by the :option:`-S` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-S` روی ``0`` تنظیم می‌شود." -msgid ":data:`sys.flags.no_site ` is set to the inverted value of :c:member:`~PyConfig.site_import`." +msgid "" +":data:`sys.flags.no_site ` is set to the inverted value " +"of :c:member:`~PyConfig.site_import`." msgstr "" +":data:`sys.flags.no_site ` به مقدار " +"معکوسِ :c:member:`~PyConfig.site_import` تنظیم می‌شود." -msgid "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` source." +msgid "" +"If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " +"source." msgstr "" +"اگر ناصفر باشد، از سطر نخستِ منبع :c:member:`PyConfig.run_filename` صرف‌نظر می‌شود." -msgid "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a DOS specific hack only." +msgid "" +"It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a DOS " +"specific hack only." msgstr "" +"این اجازه می‌دهد که از شکل‌های غیر‌یونیکسی ``#!cmd`` استفاده کنید. این تنها برای " +"یک ترفند مخصوص DOS در نظر گرفته شده است." msgid "Set to ``1`` by the :option:`-x` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-x` روی ``1`` تنظیم می‌شود." -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)." +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 "" +"کدگذاری و خطاهای کدگذاری :data:`sys.stdin`، :data:`sys.stdout` " +"و :data:`sys.stderr` (اما :data:`sys.stderr` همیشه از هندلر خطای " +"``\"backslashreplace\"`` استفاده می‌کند)." -msgid "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." +msgid "" +"Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONIOENCODING` خالی نباشد، از آن استفاده کنید." msgid "Default encoding:" -msgstr "" +msgstr "کدگذاری پیش‌فرض:" msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." -msgstr "" +msgstr "``\"UTF-8\"`` اگر :c:member:`PyPreConfig.utf8_mode` غیر صفر باشد." msgid "Otherwise, use the :term:`locale encoding`." -msgstr "" +msgstr "در غیر این صورت، از :term:`locale encoding` استفاده کنید." msgid "Default error handler:" -msgstr "" +msgstr "هندلر خطای پیش‌فرض:" msgid "On Windows: use ``\"surrogateescape\"``." -msgstr "" +msgstr "در ویندوز: از ``\"surrogateescape\"`` استفاده کنید." -msgid "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or if the LC_CTYPE locale is \"C\" or \"POSIX\"." +msgid "" +"``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or if " +"the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" +"``\"surrogateescape\"`` اگر :c:member:`PyPreConfig.utf8_mode` غیر صفر باشد، یا " +"اگر locale مربوط به LC_CTYPE برابر با \"C\" یا \"POSIX\" باشد." msgid "``\"strict\"`` otherwise." -msgstr "" +msgstr "``\"strict\"`` در غیر این صورت." msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." -msgstr "" +msgstr "همچنین :c:member:`PyConfig.legacy_windows_stdio` را ببینید." msgid "Enable tracemalloc?" -msgstr "" +msgstr "tracemalloc فعال شود؟" msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" +"اگر ناصفر باشد، :func:`tracemalloc.start` در زمان راه‌اندازی فراخوانی می‌شود." -msgid "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :envvar:`PYTHONTRACEMALLOC` environment variable." +msgid "" +"Set by :option:`-X tracemalloc=N <-X>` command line option and by " +"the :envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X tracemalloc=N <-X>` و متغیر " +"محیطی :envvar:`PYTHONTRACEMALLOC` تنظیم می‌شود." msgid "Enable the Linux ``perf`` profiler support?" -msgstr "" +msgstr "فعال‌سازی پشتیبانی از پروفایل‌گیر ``perf`` لینوکس؟" msgid "If equals to ``1``, enable support for the Linux ``perf`` profiler." msgstr "" +"اگر برابر با ``1`` باشد، پشتیبانی از پروفایل‌گیر ``perf`` لینوکس فعال می‌شود." -msgid "If equals to ``2``, enable support for the Linux ``perf`` profiler with DWARF JIT support." +msgid "" +"If equals to ``2``, enable support for the Linux ``perf`` profiler with DWARF " +"JIT support." msgstr "" +"اگر برابر با ``2`` باشد، پشتیبانی از پروفایل‌گیر ``perf`` لینوکس به همراه " +"پشتیبانی از DWARF JIT فعال می‌شود." -msgid "Set to ``1`` by :option:`-X perf <-X>` command-line option and the :envvar:`PYTHONPERFSUPPORT` environment variable." +msgid "" +"Set to ``1`` by :option:`-X perf <-X>` command-line option and " +"the :envvar:`PYTHONPERFSUPPORT` environment variable." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X perf <-X>` و متغیر " +"محیطی :envvar:`PYTHONPERFSUPPORT` روی ``1`` تنظیم می‌شود." -msgid "Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." +msgid "" +"Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and " +"the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." msgstr "" +"توسط گزینه‌ی خط فرمان :option:`-X perf_jit <-X>` و متغیر " +"محیطی :envvar:`PYTHON_PERF_JIT_SUPPORT` به ``2`` تنظیم می‌شود." msgid "See :ref:`perf_profiling` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :ref:`perf_profiling` مراجعه کنید." msgid "Directory of the Python standard library." -msgstr "" +msgstr "پوشه‌ی کتابخانه استاندارد پایتون." msgid "Use :ref:`environment variables `?" -msgstr "" +msgstr "استفاده از :ref:`متغیرهای محیطی `؟" -msgid "If equals to zero, ignore the :ref:`environment variables `." +msgid "" +"If equals to zero, ignore the :ref:`environment variables `." msgstr "" +"اگر برابر با صفر باشد، :ref:`متغیرهای محیطی ` نادیده گرفته " +"می‌شوند." msgid "Set to ``0`` by the :option:`-E` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :option:`-E` روی ``0`` تنظیم می‌شود." -msgid "If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." +msgid "" +"If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." msgstr "" +"اگر نا‌صفر باشد، ``stdout`` و ``stderr`` به گزارش سیستم بازهدایت خواهند شد." msgid "Only available on macOS 10.12 and later, and on iOS." -msgstr "" +msgstr "فقط در macOS 10.12 و نسخه‌های بعدی، و در iOS در دسترس است." -msgid "Default: ``0`` (don't use the system log) on macOS; ``1`` on iOS (use the system log)." +msgid "" +"Default: ``0`` (don't use the system log) on macOS; ``1`` on iOS (use the " +"system log)." msgstr "" +"پیش‌فرض: ``0`` (استفاده نکردن از گزارش سیستم) در macOS؛ ``1`` در iOS (استفاده از " +"گزارش سیستم)." msgid "If non-zero, add the user site directory to :data:`sys.path`." -msgstr "" +msgstr "اگر نا‌صفر باشد، پوشه‌ی site کاربر به :data:`sys.path` افزوده می‌شود." msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." -msgstr "" +msgstr "با گزینه‌های خط فرمان :option:`-s` و :option:`-I` به ``0`` تنظیم می‌شود." msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." -msgstr "" +msgstr "توسط متغیر محیطی :envvar:`PYTHONNOUSERSITE` روی ``0`` تنظیم می‌شود." -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." +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 "" +"حالت پرگویی (verbose). اگر بزرگ‌تر از ``0`` باشد، هر بار که ماژولی ایمپورت " +"می‌شود، پیامی چاپ می‌شود که مکان (نام پرونده یا ماژول توکار) بارگذاری آن را نشان " +"می‌دهد." -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." +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 "" +"اگر بزرگ‌تر یا مساوی ``2`` باشد، هنگام جست‌وجوی یک ماژول، برای هر پرونده‌ای که " +"بررسی می‌شود پیامی چاپ می‌کند. همچنین اطلاعاتی درباره پاک‌سازی ماژول‌ها هنگام خروج " +"ارائه می‌دهد." msgid "Incremented by the :option:`-v` command line option." -msgstr "" +msgstr "با گزینه‌ی خط فرمان :option:`-v` افزایش می‌یابد." msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." -msgstr "" +msgstr "توسط مقدار متغیر محیطی :envvar:`PYTHONVERBOSE` تنظیم می‌شود." -msgid "Options of the :mod:`warnings` module to build warnings filters, lowest to highest priority: :data:`sys.warnoptions`." +msgid "" +"Options of the :mod:`warnings` module to build warnings filters, lowest to " +"highest priority: :data:`sys.warnoptions`." msgstr "" +"گزینه‌های ماژول :mod:`warnings` برای ساخت صافی‌های هشدار، از کمترین تا بیشترین " +"اولویت: :data:`sys.warnoptions`." -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 ``warnings.filters`` which is checked first (highest priority)." +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 " +"``warnings.filters`` which is checked first (highest priority)." msgstr "" +"ماژول :mod:`warnings` مقدار :data:`sys.warnoptions` را با ترتیب معکوس اضافه " +"می‌کند: آخرین آیتم :c:member:`PyConfig.warnoptions` به اولین آیتم " +"``warnings.filters`` تبدیل می‌شود که ابتدا بررسی می‌شود (بالاترین اولویت)." -msgid "The :option:`-W` command line options adds its value to :c:member:`~PyConfig.warnoptions`, it can be used multiple times." +msgid "" +"The :option:`-W` command line options adds its value " +"to :c:member:`~PyConfig.warnoptions`, it can be used multiple times." msgstr "" +"گزینه‌ی خط فرمان :option:`-W` مقدار خود را به :c:member:`~PyConfig.warnoptions` " +"اضافه می‌کند؛ می‌توان آن را چندین بار استفاده کرد." -msgid "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add warning options. Multiple options can be specified, separated by commas (``,``)." +msgid "" +"The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " +"warning options. Multiple options can be specified, separated by commas (``,``)." msgstr "" +"متغیر محیطی :envvar:`PYTHONWARNINGS` نیز می‌تواند برای افزودن گزینه‌های هشدار " +"استفاده شود. می‌توان چندین گزینه را مشخص کرد که با کاما (``,``) از یکدیگر جدا " +"شده‌اند." -msgid "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of source modules." +msgid "" +"If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " +"source modules." msgstr "" +"اگر برابر ``0`` باشد، پایتون هنگام ایمپورت ماژول‌های سورس تلاشی برای نوشتن " +"پرونده‌های ``.pyc`` نمی‌کند." -msgid "Set to ``0`` by the :option:`-B` command line option and the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable." +msgid "" +"Set to ``0`` by the :option:`-B` command line option and " +"the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" +"با گزینه‌ی خط فرمان :option:`-B` و متغیر محیطی :envvar:`PYTHONDONTWRITEBYTECODE` " +"روی ``0`` تنظیم می‌شود." -msgid ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:member:`~PyConfig.write_bytecode`." +msgid "" +":data:`sys.dont_write_bytecode` is initialized to the inverted value " +"of :c:member:`~PyConfig.write_bytecode`." msgstr "" +":data:`sys.dont_write_bytecode` به مقدار " +"معکوسِ :c:member:`~PyConfig.write_bytecode` مقداردهی اولیه می‌شود." msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." -msgstr "" +msgstr "مقادیر گزینه‌های خط فرمان :option:`-X`: :data:`sys._xoptions`." msgid "If non-zero, write performance statistics at Python exit." -msgstr "" +msgstr "اگر نا‌صفر باشد، آمار عملکرد هنگام خروج پایتون نوشته می‌شود." -msgid "Need a special build with the ``Py_STATS`` macro: see :option:`--enable-pystats`." +msgid "" +"Need a special build with the ``Py_STATS`` macro: see :option:`--enable-" +"pystats`." msgstr "" +"نیاز به بیلد خاصی با ماکروی ``Py_STATS`` دارد: به :option:`--enable-pystats` " +"مراجعه کنید." -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 line arguments `, and Python arguments are stripped from :c:member:`~PyConfig.argv`." +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 line " +"arguments `, and Python arguments are stripped " +"from :c:member:`~PyConfig.argv`." msgstr "" +"اگر :c:member:`~PyConfig.parse_argv` ناصفر باشد، " +"آرگومان‌های :c:member:`~PyConfig.argv` به همان شیوه‌ای تجزیه می‌شوند که پایتون " +"معمولی :ref:`آرگومان‌های خط فرمان ` را تجزیه می‌کند، و " +"آرگومان‌های پایتون از :c:member:`~PyConfig.argv` حذف می‌شوند." -msgid "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: see the :option:`-X` command line option." +msgid "" +"The :c:member:`~PyConfig.xoptions` options are parsed to set other options: see " +"the :option:`-X` command line option." msgstr "" +"گزینه‌های :c:member:`~PyConfig.xoptions` برای تنظیم گزینه‌های دیگر تجزیه می‌شوند؛ " +"به گزینه‌ی خط فرمان :option:`-X` مراجعه کنید." msgid "The ``show_alloc_count`` field has been removed." -msgstr "" +msgstr "فیلد ``show_alloc_count`` حذف شده است." msgid "Initialization with PyConfig" -msgstr "" +msgstr "مقداردهی اولیه با PyConfig" -msgid "Initializing the interpreter from a populated configuration struct is handled by calling :c:func:`Py_InitializeFromConfig`." +msgid "" +"Initializing the interpreter from a populated configuration struct is handled " +"by calling :c:func:`Py_InitializeFromConfig`." msgstr "" +"مقداردهی اولیه مفسر از یک ساختار پیکربندی پرشده، با " +"فراخوانی :c:func:`Py_InitializeFromConfig` انجام می‌شود." -msgid "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` are used, they must be set or called after Python preinitialization and before the Python initialization. If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` must be called before each Python initialization." -msgstr "" +msgid "" +"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` " +"or :c:func:`PyImport_ExtendInittab` are used, they must be set or called after " +"Python preinitialization and before the Python initialization. If Python is " +"initialized multiple times, :c:func:`PyImport_AppendInittab` " +"or :c:func:`PyImport_ExtendInittab` must be called before each Python " +"initialization." +msgstr "" +"اگر از :c:func:`PyImport_FrozenModules`، :c:func:`PyImport_AppendInittab` " +"یا :c:func:`PyImport_ExtendInittab` استفاده شود، باید پس از پیش‌مقداردهی اولیه " +"پایتون و پیش از مقداردهی اولیه پایتون تنظیم یا فراخوانی شوند. اگر پایتون چندین " +"بار مقداردهی اولیه شود، :c:func:`PyImport_AppendInittab` " +"یا :c:func:`PyImport_ExtendInittab` باید پیش از هر مقداردهی اولیه پایتون " +"فراخوانی شوند." -msgid "The current configuration (``PyConfig`` type) is stored in ``PyInterpreterState.config``." +msgid "" +"The current configuration (``PyConfig`` type) is stored in " +"``PyInterpreterState.config``." msgstr "" +"پیکربندی فعلی (نوع ``PyConfig``) در ``PyInterpreterState.config`` ذخیره می‌شود." msgid "Example setting the program name::" -msgstr "" +msgstr "نمونه‌ای از تنظیم نام برنامه::" msgid "" "void init_python(void)\n" @@ -1882,9 +2890,44 @@ msgid "" " Py_ExitStatusException(status);\n" "}" msgstr "" +"void init_python(void)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Set the program name. Implicitly preinitialize Python. */\n" +" status = PyConfig_SetString(&config, &config.program_name,\n" +" L\"/path/to/my_program\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +" return;\n" +"\n" +"exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" -msgid "More complete example modifying the default configuration, read the configuration, and then override some parameters. Note that since 3.11, many parameters are not calculated until initialization, and so values cannot be read from the configuration structure. Any values set before initialize is called will be left unchanged by initialization::" -msgstr "" +msgid "" +"More complete example modifying the default configuration, read the " +"configuration, and then override some parameters. Note that since 3.11, many " +"parameters are not calculated until initialization, and so values cannot be " +"read from the configuration structure. Any values set before initialize is " +"called will be left unchanged by initialization::" +msgstr "" +"مثال کامل‌تری که پیکربندی پیش‌فرض را تغییر می‌دهد، پیکربندی را می‌خواند و سپس برخی " +"از پارامترها را بازنویسی می‌کند. توجه داشته باشید که از نسخه‌ی 3.11، بسیاری از " +"پارامترها تا زمان راه‌اندازی محاسبه نمی‌شوند و بنابراین نمی‌توان مقادیر را از " +"ساختار پیکربندی خواند. هر مقداری که پیش از فراخوانی initialize تنظیم شده باشد، " +"توسط راه‌اندازی بدون تغییر باقی می‌ماند::" msgid "" "PyStatus init_python(const char *program_name)\n" @@ -1939,180 +2982,377 @@ msgid "" " return status;\n" "}" msgstr "" +"PyStatus init_python(const char *program_name)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Set the program name before reading the configuration\n" +" (decode byte string from the locale encoding).\n" +"\n" +" Implicitly preinitialize Python. */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name,\n" +" program_name);\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Read all configuration at once */\n" +" status = PyConfig_Read(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Specify sys.path explicitly */\n" +" /* If you want to modify the default set of paths, finish\n" +" initialization first and then use PySys_GetObject(\"path\") */\n" +" config.module_search_paths_set = 1;\n" +" status = PyWideStringList_Append(&config.module_search_paths,\n" +" L\"/path/to/stdlib\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +" status = PyWideStringList_Append(&config.module_search_paths,\n" +" L\"/path/to/more/modules\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Override executable computed by PyConfig_Read() */\n" +" status = PyConfig_SetString(&config, &config.executable,\n" +" L\"/path/to/my_executable\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +"\n" +"done:\n" +" PyConfig_Clear(&config);\n" +" return status;\n" +"}" msgid "Isolated Configuration" -msgstr "" +msgstr "پیکربندی مجزا" -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." +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:func:`PyPreConfig_InitIsolatedConfig` " +"و :c:func:`PyConfig_InitIsolatedConfig` پیکربندی‌ای برای جداسازی پایتون از سیستم " +"ایجاد می‌کنند. برای مثال، برای تعبیه کردن پایتون در یک برنامه." -msgid "This configuration ignores global configuration variables, environment variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) and user site directory. The C standard streams (ex: ``stdout``) and the LC_CTYPE locale are left unchanged. Signal handlers are not installed." +msgid "" +"This configuration ignores global configuration variables, environment " +"variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) and " +"user site directory. The C standard streams (ex: ``stdout``) and the LC_CTYPE " +"locale are left unchanged. Signal handlers are not installed." msgstr "" +"این پیکربندی، متغیرهای پیکربندی سراسری، متغیرهای محیطی، آرگومان‌های خط فرمان " +"(:c:member:`PyConfig.argv` تجزیه نمی‌شود) و پوشه site کاربر را نادیده می‌گیرد. " +"جریان‌های استاندارد C (مثلاً ``stdout``) و locale مربوط به LC_CTYPE بدون تغییر " +"باقی می‌مانند. هندلرهای سیگنال نصب نمی‌شوند." -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." +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:member:`PyConfig.home` مشخص شده باشد." msgid "Python Configuration" -msgstr "" +msgstr "پیکربندی پایتون" -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." +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:func:`PyPreConfig_InitPythonConfig` " +"و :c:func:`PyConfig_InitPythonConfig` پیکربندی‌ای برای ساخت پایتونی سفارشی که " +"مانند پایتون معمولی رفتار می‌کند، ایجاد می‌کنند." -msgid "Environments variables and command line arguments are used to configure Python, whereas global configuration variables are ignored." +msgid "" +"Environments variables and command line arguments are used to configure Python, " +"whereas global configuration variables are ignored." msgstr "" +"متغیرهای محیطی و آرگومان‌های خط فرمان برای پیکربندی پایتون استفاده می‌شوند، در " +"حالی که متغیرهای پیکربندی سراسری نادیده گرفته می‌شوند." -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." +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 "" +"این تابع بسته به locale مربوط به LC_CTYPE و متغیرهای محیطی :envvar:`PYTHONUTF8` " +"و :envvar:`PYTHONCOERCECLOCALE`، اجبار locale سی (C locale coercion) " +"(:pep:`538`) و :ref:`حالت UTF-8 پایتون ` (:pep:`540`) را فعال می‌کند." msgid "Python Path Configuration" -msgstr "" +msgstr "پیکربندی مسیر پایتون" msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" -msgstr "" +msgstr ":c:type:`PyConfig` شامل چندین فیلد برای پیکربندی مسیر است:" msgid "Path configuration inputs:" -msgstr "" +msgstr "ورودی‌های پیکربندی مسیر:" msgid ":c:member:`PyConfig.home`" -msgstr "" +msgstr ":c:member:`PyConfig.home`" msgid ":c:member:`PyConfig.platlibdir`" -msgstr "" +msgstr ":c:member:`PyConfig.platlibdir`" msgid ":c:member:`PyConfig.pathconfig_warnings`" -msgstr "" +msgstr ":c:member:`PyConfig.pathconfig_warnings`" msgid ":c:member:`PyConfig.program_name`" -msgstr "" +msgstr ":c:member:`PyConfig.program_name`" msgid ":c:member:`PyConfig.pythonpath_env`" -msgstr "" +msgstr ":c:member:`PyConfig.pythonpath_env`" msgid "current working directory: to get absolute paths" -msgstr "" +msgstr "پوشه‌ی کاری جاری: برای به‌دست آوردن مسیرهای مطلق" -msgid "``PATH`` environment variable to get the program full path (from :c:member:`PyConfig.program_name`)" +msgid "" +"``PATH`` environment variable to get the program full path " +"(from :c:member:`PyConfig.program_name`)" msgstr "" +"متغیر محیطی ``PATH`` برای به‌دست آوردن مسیر کامل برنامه " +"(از :c:member:`PyConfig.program_name`)" msgid "``__PYVENV_LAUNCHER__`` environment variable" -msgstr "" +msgstr "متغیر محیطی ``__PYVENV_LAUNCHER__``" -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)." +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 "" +"(فقط ویندوز) مسیرهای برنامه در رجیستری، زیر " +"\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" از HKEY_CURRENT_USER و " +"HKEY_LOCAL_MACHINE (که در آن X.Y نسخه‌ی پایتون است)." msgid "Path configuration output fields:" -msgstr "" +msgstr "فیلد‌های خروجی پیکربندی مسیر:" msgid ":c:member:`PyConfig.base_exec_prefix`" -msgstr "" +msgstr ":c:member:`PyConfig.base_exec_prefix`" msgid ":c:member:`PyConfig.base_executable`" -msgstr "" +msgstr ":c:member:`PyConfig.base_executable`" msgid ":c:member:`PyConfig.base_prefix`" -msgstr "" +msgstr ":c:member:`PyConfig.base_prefix`" msgid ":c:member:`PyConfig.exec_prefix`" -msgstr "" +msgstr ":c:member:`PyConfig.exec_prefix`" msgid ":c:member:`PyConfig.executable`" -msgstr "" +msgstr ":c:member:`PyConfig.executable`" msgid ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" -msgstr "" +msgstr ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" msgid ":c:member:`PyConfig.prefix`" -msgstr "" +msgstr ":c:member:`PyConfig.prefix`" -msgid "If at least one \"output field\" is not set, Python calculates the path configuration to fill unset fields. If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:member:`~PyConfig.module_search_paths` is overridden and :c:member:`~PyConfig.module_search_paths_set` is set to ``1``." -msgstr "" +msgid "" +"If at least one \"output field\" is not set, Python calculates the path " +"configuration to fill unset fields. " +"If :c:member:`~PyConfig.module_search_paths_set` is equal to " +"``0``, :c:member:`~PyConfig.module_search_paths` is overridden " +"and :c:member:`~PyConfig.module_search_paths_set` is set to ``1``." +msgstr "" +"اگر حداقل یک \"فیلد خروجی\" تنظیم نشده باشد، پایتون پیکربندی مسیر را برای پر " +"کردن فیلد‌های تنظیم‌نشده محاسبه می‌کند. " +"اگر :c:member:`~PyConfig.module_search_paths_set` برابر ``0`` " +"باشد، :c:member:`~PyConfig.module_search_paths` بازنویسی می‌شود " +"و :c:member:`~PyConfig.module_search_paths_set` برابر ``1`` قرار می‌گیرد." -msgid "It is possible to completely ignore the function calculating the default path configuration by setting explicitly all path configuration output fields listed above. A string is considered as set even if it is non-empty. ``module_search_paths`` is considered as set if ``module_search_paths_set`` is set to ``1``. In this case, ``module_search_paths`` will be used without modification." -msgstr "" +msgid "" +"It is possible to completely ignore the function calculating the default path " +"configuration by setting explicitly all path configuration output fields listed " +"above. A string is considered as set even if it is non-empty. " +"``module_search_paths`` is considered as set if ``module_search_paths_set`` is " +"set to ``1``. In this case, ``module_search_paths`` will be used without " +"modification." +msgstr "" +"با تنظیم صریح همه‌ی فیلدهای خروجی پیکربندی مسیر که در بالا فهرست شده‌اند، می‌توان " +"تابع محاسبه‌کننده‌ی پیکربندی پیش‌فرض مسیر را به‌طور کامل نادیده گرفت. یک رشته حتی " +"اگر غیرخالی باشد، تنظیم‌شده در نظر گرفته می‌شود. ``module_search_paths`` زمانی " +"تنظیم‌شده در نظر گرفته می‌شود که ``module_search_paths_set`` روی ``1`` تنظیم شده " +"باشد. در این صورت، ``module_search_paths`` بدون تغییر استفاده خواهد شد." -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)." +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:member:`~PyConfig.pathconfig_warnings` را برابر ``0`` قرار دهید تا " +"هشدارها هنگام محاسبه پیکربندی مسیر سرکوب شوند (فقط در یونیکس؛ ویندوز هیچ هشداری " +"ثبت نمی‌کند)." -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." +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:member:`~PyConfig.base_prefix` " +"یا :c:member:`~PyConfig.base_exec_prefix` تنظیم نشده باشند، مقدار خود را به " +"ترتیب از :c:member:`~PyConfig.prefix` و :c:member:`~PyConfig.exec_prefix` به " +"ارث می‌برند." msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" +":c:func:`Py_RunMain` و :c:func:`Py_Main` مقدار :data:`sys.path` را تغییر می‌دهند:" -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`." +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:member:`~PyConfig.run_filename` تنظیم شده باشد و پوشه‌ای باشد که اسکریپت " +"``__main__.py`` را دربر دارد، :c:member:`~PyConfig.run_filename` به " +"ابتدای :data:`sys.path` اضافه می‌شود." msgid "If :c:member:`~PyConfig.isolated` is zero:" -msgstr "" +msgstr "اگر :c:member:`~PyConfig.isolated` صفر باشد:" -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." +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:member:`~PyConfig.run_module` تنظیم شده باشد، پوشه‌ی جاری به " +"ابتدای :data:`sys.path` افزوده می‌شود. اگر پوشه‌ی جاری قابل خواندن نباشد، هیچ " +"کاری انجام نمی‌شود." -msgid "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the filename to :data:`sys.path`." +msgid "" +"If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " +"filename to :data:`sys.path`." msgstr "" +"اگر :c:member:`~PyConfig.run_filename` تنظیم شده باشد، پوشه‌ی نام پرونده به " +"ابتدای :data:`sys.path` اضافه می‌شود." msgid "Otherwise, prepend an empty string to :data:`sys.path`." -msgstr "" +msgstr "در غیر این صورت، یک رشته خالی به ابتدای :data:`sys.path` اضافه کنید." -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.user_site_directory` is non-zero and the user's site-package directory exists, the :mod:`site` module appends the user's site-package directory to :data:`sys.path`." -msgstr "" +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.user_site_directory` is non-zero and the user's site-" +"package directory exists, the :mod:`site` module appends the user's site-" +"package directory to :data:`sys.path`." +msgstr "" +"اگر :c:member:`~PyConfig.site_import` غیر صفر باشد، ماژول :mod:`site` " +"می‌تواند :data:`sys.path` را تغییر دهد. " +"اگر :c:member:`~PyConfig.user_site_directory` غیر صفر باشد و پوشه‌ی site-package " +"کاربر وجود داشته باشد، ماژول :mod:`site` پوشه‌ی site-package کاربر را " +"به :data:`sys.path` می‌افزاید." msgid "The following configuration files are used by the path configuration:" -msgstr "" +msgstr "پرونده‌های پیکربندی زیر توسط پیکربندی مسیر استفاده می‌شوند:" msgid "``pyvenv.cfg``" -msgstr "" +msgstr "``pyvenv.cfg``" msgid "``._pth`` file (ex: ``python._pth``)" -msgstr "" +msgstr "پرونده ``._pth`` (مثلاً ``python._pth``)" msgid "``pybuilddir.txt`` (Unix only)" -msgstr "" +msgstr "``pybuilddir.txt`` (فقط یونیکس)" msgid "If a ``._pth`` file is present:" -msgstr "" +msgstr "اگر یک پرونده‌ی ``._pth`` موجود باشد:" msgid "Set :c:member:`~PyConfig.isolated` to ``1``." -msgstr "" +msgstr "مقدار :c:member:`~PyConfig.isolated` را روی ``1`` قرار دهید." msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." -msgstr "" +msgstr "مقدار :c:member:`~PyConfig.use_environment` را برابر ``0`` قرار دهید." msgid "Set :c:member:`~PyConfig.site_import` to ``0``." -msgstr "" +msgstr "مقدار :c:member:`~PyConfig.site_import` را برابر ``0`` قرار دهید." msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." -msgstr "" +msgstr "مقدار :c:member:`~PyConfig.safe_path` را برابر ``1`` قرار دهید." -msgid "If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is present in the same directory as :c:member:`~PyConfig.executable`, or its parent, :c:member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` are set that location. When this happens, :c:member:`~PyConfig.base_prefix` and :c:member:`~PyConfig.base_exec_prefix` still keep their value, pointing to the base installation. See :ref:`sys-path-init-virtual-environments` for more information." -msgstr "" +msgid "" +"If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is present " +"in the same directory as :c:member:`~PyConfig.executable`, or its " +"parent, :c:member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` are " +"set that location. When this happens, :c:member:`~PyConfig.base_prefix` " +"and :c:member:`~PyConfig.base_exec_prefix` still keep their value, pointing to " +"the base installation. See :ref:`sys-path-init-virtual-environments` for more " +"information." +msgstr "" +"اگر :c:member:`~PyConfig.home` تنظیم نشده باشد و پرونده‌ی ``pyvenv.cfg`` در همان " +"پوشه‌ای که :c:member:`~PyConfig.executable` در آن قرار دارد یا در پوشه‌ی والد آن " +"وجود داشته باشد، :c:member:`~PyConfig.prefix` " +"و :c:member:`~PyConfig.exec_prefix` به آن مکان تنظیم می‌شوند. در این " +"حالت، :c:member:`~PyConfig.base_prefix` " +"و :c:member:`~PyConfig.base_exec_prefix` همچنان مقدار خود را حفظ می‌کنند و به " +"نصب پایه اشاره می‌کنند. برای اطلاعات بیشتر به :ref:`sys-path-init-virtual-" +"environments` مراجعه کنید." -msgid "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:`PyConfig.base_executable`." +msgid "" +"The ``__PYVENV_LAUNCHER__`` environment variable is used to " +"set :c:member:`PyConfig.base_executable`." msgstr "" +"از متغیر محیطی ``__PYVENV_LAUNCHER__`` برای " +"تنظیم :c:member:`PyConfig.base_executable` استفاده می‌شود." -msgid ":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now set to the ``pyvenv.cfg`` directory. This was previously done by :mod:`site`, therefore affected by :option:`-S`." +msgid "" +":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now " +"set to the ``pyvenv.cfg`` directory. This was previously done by :mod:`site`, " +"therefore affected by :option:`-S`." msgstr "" +":c:member:`~PyConfig.prefix` و :c:member:`~PyConfig.exec_prefix` اکنون به پوشه‌ی " +"``pyvenv.cfg`` تنظیم می‌شوند. این کار پیش‌تر توسط :mod:`site` انجام می‌شد و " +"بنابراین تحت تأثیر :option:`-S` قرار داشت." msgid "Py_GetArgcArgv()" -msgstr "" +msgstr "Py_GetArgcArgv()" msgid "Get the original command line arguments, before Python modified them." msgstr "" +"آرگومان‌های اصلی خط فرمان را دریافت می‌کند، پیش از آن‌که پایتون آن‌ها را تغییر دهد." msgid "See also :c:member:`PyConfig.orig_argv` member." -msgstr "" +msgstr "همچنین عضو :c:member:`PyConfig.orig_argv` را ببینید." msgid "Delaying main module execution" -msgstr "" +msgstr "به تأخیر انداختن اجرای ماژول اصلی" -msgid "In some embedding use cases, it may be desirable to separate interpreter initialization from the execution of the main module." +msgid "" +"In some embedding use cases, it may be desirable to separate interpreter " +"initialization from the execution of the main module." msgstr "" +"در برخی موارد استفاده از جاسازی (embedding)، ممکن است مطلوب باشد که مقداردهی " +"اولیه‌ی مفسر از اجرای ماژول اصلی جدا شود." -msgid "This separation can be achieved by setting ``PyConfig.run_command`` to the empty string during initialization (to prevent the interpreter from dropping into the interactive prompt), and then subsequently executing the desired main module code using ``__main__.__dict__`` as the global namespace." +msgid "" +"This separation can be achieved by setting ``PyConfig.run_command`` to the " +"empty string during initialization (to prevent the interpreter from dropping " +"into the interactive prompt), and then subsequently executing the desired main " +"module code using ``__main__.__dict__`` as the global namespace." msgstr "" +"این جداسازی را می‌توان با تنظیم ``PyConfig.run_command`` به رشته خالی در حین " +"راه‌اندازی (برای جلوگیری از اینکه مفسر وارد اعلان تعاملی شود)، و سپس اجرای کد " +"ماژول اصلی موردنظر با استفاده از ``__main__.__dict__`` به‌عنوان فضای نام سراسری " +"به دست آورد." msgid "main()" -msgstr "" +msgstr "main()" msgid "argv (in module sys)" -msgstr "" +msgstr "argv (در ماژول sys)" diff --git a/c-api/interp-lifecycle.po b/c-api/interp-lifecycle.po index 508702e09..e5991a763 100644 --- a/c-api/interp-lifecycle.po +++ b/c-api/interp-lifecycle.po @@ -20,367 +20,802 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Interpreter initialization and finalization" -msgstr "" +msgstr "مقداردهی اولیه و نهایی‌سازی مفسر" -msgid "See :ref:`Python Initialization Configuration ` for details on how to configure the interpreter prior to initialization." +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." msgstr "" +"برای جزئیات درباره‌ی چگونگی پیکربندی مفسر پیش از مقداردهی اولیه، به " +":ref:`پیکربندی مقداردهی اولیه پایتون ` مراجعه کنید." msgid "Before Python initialization" -msgstr "" +msgstr "پیش از مقداردهی اولیه پایتون" -msgid "In an application embedding Python, the :c:func:`Py_Initialize` function must be called before using any other Python/C API functions; with the exception of a few functions and the :ref:`global configuration variables `." +msgid "" +"In an application embedding Python, the :c:func:`Py_Initialize` function " +"must be called before using any other Python/C API functions; with the " +"exception of a few functions and the :ref:`global configuration variables " +"`." msgstr "" +"در برنامه‌ای که پایتون را تعبیه می‌کند، تابع :c:func:`Py_Initialize` باید " +"پیش از استفاده از هر تابع دیگری از Python/C API فراخوانی شود؛ به استثنای چند" +" تابع و :ref:`متغیرهای پیکربندی سراسری `." -msgid "The following functions can be safely called before Python is initialized:" +msgid "" +"The following functions can be safely called before Python is initialized:" msgstr "" +"توابع زیر را می‌توان پیش از مقدار‌دهی اولیه پایتون به‌طور ایمن فراخوانی کرد:" msgid "Functions that initialize the interpreter:" -msgstr "" +msgstr "توابعی که مفسر را راه‌اندازی می‌کنند:" msgid ":c:func:`Py_Initialize`" -msgstr "" +msgstr ":c:func:`Py_Initialize`" msgid ":c:func:`Py_InitializeEx`" -msgstr "" +msgstr ":c:func:`Py_InitializeEx`" msgid ":c:func:`Py_InitializeFromConfig`" -msgstr "" +msgstr ":c:func:`Py_InitializeFromConfig`" msgid ":c:func:`Py_BytesMain`" -msgstr "" +msgstr ":c:func:`Py_BytesMain`" msgid ":c:func:`Py_Main`" -msgstr "" +msgstr ":c:func:`Py_Main`" msgid "the runtime pre-initialization functions covered in :ref:`init-config`" -msgstr "" +msgstr "توابع پیش‌مقداردهی ران‌تایم که در :ref:`init-config` شرح داده شده‌اند" msgid "Configuration functions:" -msgstr "" +msgstr "توابع پیکربندی:" msgid ":c:func:`PyImport_AppendInittab`" -msgstr "" +msgstr ":c:func:`PyImport_AppendInittab`" msgid ":c:func:`PyImport_ExtendInittab`" -msgstr "" +msgstr ":c:func:`PyImport_ExtendInittab`" msgid ":c:func:`!PyInitFrozenExtensions`" -msgstr "" +msgstr ":c:func:`!PyInitFrozenExtensions`" msgid ":c:func:`PyMem_SetAllocator`" -msgstr "" +msgstr ":c:func:`PyMem_SetAllocator`" msgid ":c:func:`PyMem_SetupDebugHooks`" -msgstr "" +msgstr ":c:func:`PyMem_SetupDebugHooks`" msgid ":c:func:`PyObject_SetArenaAllocator`" -msgstr "" +msgstr ":c:func:`PyObject_SetArenaAllocator`" msgid ":c:func:`Py_SetProgramName`" -msgstr "" +msgstr ":c:func:`Py_SetProgramName`" msgid ":c:func:`Py_SetPythonHome`" -msgstr "" +msgstr ":c:func:`Py_SetPythonHome`" msgid "the configuration functions covered in :ref:`init-config`" -msgstr "" +msgstr "توابع پیکربندی که در :ref:`init-config` شرح داده شده‌اند" msgid "Informative functions:" -msgstr "" +msgstr "توابع اطلاعاتی:" msgid ":c:func:`Py_IsInitialized`" -msgstr "" +msgstr ":c:func:`Py_IsInitialized`" msgid ":c:func:`PyMem_GetAllocator`" -msgstr "" +msgstr ":c:func:`PyMem_GetAllocator`" msgid ":c:func:`PyObject_GetArenaAllocator`" -msgstr "" +msgstr ":c:func:`PyObject_GetArenaAllocator`" msgid ":c:func:`Py_GetBuildInfo`" -msgstr "" +msgstr ":c:func:`Py_GetBuildInfo`" msgid ":c:func:`Py_GetCompiler`" -msgstr "" +msgstr ":c:func:`Py_GetCompiler`" msgid ":c:func:`Py_GetCopyright`" -msgstr "" +msgstr ":c:func:`Py_GetCopyright`" msgid ":c:func:`Py_GetPlatform`" -msgstr "" +msgstr ":c:func:`Py_GetPlatform`" msgid ":c:func:`Py_GetVersion`" -msgstr "" +msgstr ":c:func:`Py_GetVersion`" msgid "Utilities:" -msgstr "" +msgstr "ابزارها:" msgid ":c:func:`Py_DecodeLocale`" -msgstr "" +msgstr ":c:func:`Py_DecodeLocale`" -msgid "the status reporting and utility functions covered in :ref:`init-config`" +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" msgstr "" +"توابع گزارش‌دهی وضعیت و توابع ابزاری که در :ref:`init-config` پوشش داده " +"شده‌اند" msgid "Memory allocators:" -msgstr "" +msgstr "تخصیص‌دهنده‌های حافظه:" msgid ":c:func:`PyMem_RawMalloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawMalloc`" msgid ":c:func:`PyMem_RawRealloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawRealloc`" msgid ":c:func:`PyMem_RawCalloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawCalloc`" msgid ":c:func:`PyMem_RawFree`" -msgstr "" +msgstr ":c:func:`PyMem_RawFree`" msgid "Synchronization:" -msgstr "" +msgstr "همگام‌سازی:" msgid ":c:func:`PyMutex_Lock`" -msgstr "" +msgstr ":c:func:`PyMutex_Lock`" msgid ":c:func:`PyMutex_Unlock`" -msgstr "" +msgstr ":c:func:`PyMutex_Unlock`" -msgid "Despite their apparent similarity to some of the functions listed above, the following functions **should not be called** before the interpreter has been initialized: :c:func:`Py_EncodeLocale`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." +msgid "" +"Despite their apparent similarity to some of the functions listed above, the" +" following functions **should not be called** before the interpreter has " +"been initialized: :c:func:`Py_EncodeLocale`, :c:func:`PyEval_InitThreads`, " +"and :c:func:`Py_RunMain`." msgstr "" +"با وجود شباهت ظاهری آن‌ها به برخی از توابع فهرست‌شده در بالا، توابع زیر پیش " +"از مقداردهی اولیه‌ی مفسر **نباید فراخوانی شوند**: :c:func:`Py_EncodeLocale`،" +" :c:func:`PyEval_InitThreads` و :c:func:`Py_RunMain`." msgid "Global configuration variables" -msgstr "" +msgstr "متغیرهای پیکربندی سراسری" -msgid "Python has variables for the global configuration to control different features and options. By default, these flags are controlled by :ref:`command line options `." +msgid "" +"Python has variables for the global configuration to control different " +"features and options. By default, these flags are controlled by " +":ref:`command line options `." msgstr "" +"پایتون برای پیکربندی سراسری، متغیرهایی دارد که قابلیت‌ها و گزینه‌های مختلف " +"را کنترل می‌کنند. به‌طور پیش‌فرض، این پرچم‌ها توسط :ref:`گزینه‌های خط فرمان " +"` کنترل می‌شوند." -msgid "When a flag is set by an option, the value of the flag is the number of times that the option was set. For example, ``-b`` sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2." +msgid "" +"When a flag is set by an option, the value of the flag is the number of " +"times that the option was set. For example, ``-b`` sets " +":c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` sets " +":c:data:`Py_BytesWarningFlag` to 2." msgstr "" +"هنگامی که یک پرچم توسط گزینه‌ای تنظیم می‌شود، مقدار پرچم برابر با تعداد " +"دفعاتی است که آن گزینه مشخص شده است. برای مثال، ``-b`` مقدار " +":c:data:`Py_BytesWarningFlag` را روی ۱ تنظیم می‌کند و ``-bb`` مقدار " +":c:data:`Py_BytesWarningFlag` را روی ۲ تنظیم می‌کند." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.bytes_warning` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.bytes_warning` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن، باید از تنظیم" +" :c:member:`PyConfig.bytes_warning` استفاده کرد؛ به :ref:`پیکربندی مقدار‌دهی" +" اولیه پایتون ` مراجعه کنید." -msgid "Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater or equal to ``2``." +msgid "" +"Issue a warning when comparing :class:`bytes` or :class:`bytearray` with " +":class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater" +" or equal to ``2``." msgstr "" +"هنگام مقایسه‌ی :class:`bytes` یا :class:`bytearray` با :class:`str`، یا " +":class:`bytes` با :class:`int` هشدار صادر می‌کند. در صورت بزرگ‌تر یا مساوی " +"``2`` بودن، خطا صادر می‌کند." msgid "Set by the :option:`-b` option." -msgstr "" +msgstr "توسط گزینه‌ی :option:`-b` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.parser_debug` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.parser_debug` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های قبلی حفظ شده است: به جای آن باید " +":c:member:`PyConfig.parser_debug` را تنظیم کنید؛ به :ref:`پیکربندی مقداردهی " +"اولیه پایتون ` مراجعه کنید." -msgid "Turn on parser debugging output (for expert only, depending on compilation options)." +msgid "" +"Turn on parser debugging output (for expert only, depending on compilation " +"options)." msgstr "" +"فعال کردن خروجی اشکال‌زدایی پارسر (فقط برای متخصصان، بسته به گزینه‌های " +"کامپایل)." -msgid "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment variable." +msgid "" +"Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " +"variable." msgstr "" +"توسط گزینه‌ی :option:`-d` و متغیر محیطی :envvar:`PYTHONDEBUG` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.write_bytecode` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.write_bytecode` should be used instead, see :ref:`Python" +" Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید از تنظیم " +":c:member:`PyConfig.write_bytecode` استفاده شود؛ به :ref:`پیکربندی مقداردهی " +"اولیه پایتون ` مراجعه کنید." -msgid "If set to non-zero, Python won't try to write ``.pyc`` files on the import of source modules." +msgid "" +"If set to non-zero, Python won't try to write ``.pyc`` files on the import " +"of source modules." msgstr "" +"اگر روی مقدار غیرصفر تنظیم شود، پایتون هنگام ایمپورت ماژول‌های منبع تلاش " +"نمی‌کند پرونده‌های ``.pyc`` را بنویسد." -msgid "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable." +msgid "" +"Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " +"environment variable." msgstr "" +"توسط گزینه‌ی :option:`-B` و متغیر محیطی :envvar:`PYTHONDONTWRITEBYTECODE` " +"تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.pathconfig_warnings` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.pathconfig_warnings` should be used instead, see " +":ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های قبلی حفظ شده است: به جای آن باید " +":c:member:`PyConfig.pathconfig_warnings` را تنظیم کنید؛ به :ref:`پیکربندی " +"مقداردهی اولیه پایتون ` مراجعه کنید." msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" +"پرچم خصوصی استفاده‌شده توسط برنامه‌های ``_freeze_module`` و ``frozenmain``." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.hash_seed` and :c:member:`PyConfig.use_hash_seed` should" +" be used instead, see :ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین نگه داشته شده است: به جای آن باید از " +"تنظیم :c:member:`PyConfig.hash_seed` و :c:member:`PyConfig.use_hash_seed` " +"استفاده شود؛ به :ref:`پیکربندی مقداردهی اولیه پایتون ` مراجعه " +"کنید." -msgid "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to a non-empty string." +msgid "" +"Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " +"a non-empty string." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONHASHSEED` به یک رشته‌ی غیرخالی تنظیم شده " +"باشد، روی ``1`` تنظیم می‌شود." -msgid "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment variable to initialize the secret hash seed." +msgid "" +"If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " +"variable to initialize the secret hash seed." msgstr "" +"اگر پرچم ناصفر باشد، متغیر محیطی :envvar:`PYTHONHASHSEED` برای مقداردهی " +"اولیه‌ی بذر هش مخفی خوانده می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.use_environment` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.use_environment` should be used instead, see " +":ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.use_environment` تنظیم شود؛ به :ref:`پیکربندی مقداردهی " +"اولیه پایتون ` مراجعه کنید." -msgid "Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +msgid "" +"Ignore all :envvar:`!PYTHON*` environment variables, e.g. " +":envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" +"نادیده گرفتن تمام متغیرهای محیطی :envvar:`!PYTHON*`، مانند " +":envvar:`PYTHONPATH` و :envvar:`PYTHONHOME`، که ممکن است تنظیم شده باشند." msgid "Set by the :option:`-E` and :option:`-I` options." -msgstr "" +msgstr "توسط گزینه‌های :option:`-E` و :option:`-I` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.inspect` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.inspect` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید از تنظیم " +":c:member:`PyConfig.inspect` استفاده کرد؛ به :ref:`پیکربندی مقداردهی اولیه " +"پایتون ` مراجعه کنید." -msgid "When a script is passed as first argument or the :option:`-c` option is used, enter interactive mode after executing the script or the command, even when :data:`sys.stdin` does not appear to be a terminal." +msgid "" +"When a script is passed as first argument or the :option:`-c` option is " +"used, enter interactive mode after executing the script or the command, even" +" when :data:`sys.stdin` does not appear to be a terminal." msgstr "" +"وقتی یک اسکریپت به‌عنوان آرگومان اول داده شود یا از گزینه‌ی :option:`-c` " +"استفاده شود، پس از اجرای اسکریپت یا دستور وارد حالت تعاملی می‌شود، حتی زمانی" +" که به نظر نمی‌رسد :data:`sys.stdin` یک پایانه باشد." -msgid "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment variable." +msgid "" +"Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " +"variable." msgstr "" +"تنظیم می‌شود توسط گزینه‌ی :option:`-i` و متغیر محیطی " +":envvar:`PYTHONINSPECT`." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.interactive` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.interactive` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.interactive` را تنظیم کنید؛ به :ref:`پیکربندی مقداردهی " +"اولیه پایتون ` مراجعه کنید." msgid "Set by the :option:`-i` option." -msgstr "" +msgstr "با گزینه‌ی :option:`-i` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.isolated` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.isolated` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید از تنظیم " +":c:member:`PyConfig.isolated` استفاده شود؛ به :ref:`پیکربندی مقدار‌دهی اولیه" +" پایتون ` مراجعه کنید." -msgid "Run Python in isolated mode. In isolated mode :data:`sys.path` contains neither the script's directory nor the user's site-packages directory." +msgid "" +"Run Python in isolated mode. In isolated mode :data:`sys.path` contains " +"neither the script's directory nor the user's site-packages directory." msgstr "" +"پایتون را در حالت ایزوله اجرا کنید. در حالت ایزوله، :data:`sys.path` نه " +"پوشه‌ی اسکریپت و نه پوشه‌ی site-packages کاربر را در بر می‌گیرد." msgid "Set by the :option:`-I` option." -msgstr "" +msgstr "توسط گزینه‌ی :option:`-I` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های قبلی حفظ شده است: به جای آن باید " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` را تنظیم کرد؛ به " +":ref:`پیکربندی مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, for the :term:`filesystem encoding and error handler`." +msgid "" +"If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " +"handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler," +" for the :term:`filesystem encoding and error handler`." msgstr "" +"اگر پرچم نا‌صفر باشد، به‌جای کدگذاری UTF-8 با هندلر خطای ``surrogatepass``، " +"از کدگذاری ``mbcs`` با هندلر خطای ``replace`` برای :term:`filesystem " +"encoding and error handler` استفاده می‌شود." -msgid "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable is set to a non-empty string." +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " +"variable is set to a non-empty string." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSFSENCODING` به یک رشته غیرخالی " +"تنظیم شده باشد، به ``1`` تنظیم می‌شود." msgid "See :pep:`529` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر به :pep:`529` مراجعه کنید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.legacy_windows_stdio` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.legacy_windows_stdio` should be used instead, see " +":ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با گذشته حفظ شده است: به جای آن باید " +":c:member:`PyConfig.legacy_windows_stdio` تنظیم شود؛ به :ref:`پیکربندی " +"مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io._WindowsConsoleIO` for :mod:`sys` standard streams." +msgid "" +"If the flag is non-zero, use :class:`io.FileIO` instead of " +":class:`!io._WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" +"اگر پرچم نا‌صفر باشد، برای جریان‌های استاندارد :mod:`sys` به‌جای " +":class:`!io._WindowsConsoleIO` از :class:`io.FileIO` استفاده می‌شود." -msgid "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable is set to a non-empty string." +msgid "" +"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " +"is set to a non-empty string." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSSTDIO` روی یک رشته‌ی غیرخالی " +"تنظیم شده باشد، روی ``1`` تنظیم می‌شود." msgid "See :pep:`528` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر به :pep:`528` مراجعه کنید." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.site_import` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.site_import` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری به عقب نگه داشته شده است: به جای آن باید " +":c:member:`PyConfig.site_import` را تنظیم کنید؛ به :ref:`پیکربندی مقداردهی " +"اولیه پایتون ` مراجعه کنید." -msgid "Disable the import of the module :mod:`site` and the site-dependent manipulations of :data:`sys.path` that it entails. Also disable these manipulations if :mod:`site` is explicitly imported later (call :func:`site.main` if you want them to be triggered)." +msgid "" +"Disable the import of the module :mod:`site` and the site-dependent " +"manipulations of :data:`sys.path` that it entails. Also disable these " +"manipulations if :mod:`site` is explicitly imported later (call " +":func:`site.main` if you want them to be triggered)." msgstr "" +"ایمپورت ماژول :mod:`site` و دستکاری‌های وابسته به site در :data:`sys.path` " +"که این ایمپورت به همراه دارد را غیرفعال می‌کند. همچنین اگر :mod:`site` بعداً" +" به‌طور صریح ایمپورت شود، این دستکاری‌ها را غیرفعال می‌کند (اگر می‌خواهید " +"این دستکاری‌ها انجام شوند، :func:`site.main` را فراخوانی کنید)." msgid "Set by the :option:`-S` option." -msgstr "" +msgstr "توسط گزینه‌ی :option:`-S` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.user_site_directory` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.user_site_directory` should be used instead, see " +":ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های قبلی حفظ شده است: به جای آن باید " +":c:member:`PyConfig.user_site_directory` را تنظیم کنید؛ به :ref:`پیکربندی " +"مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "Don't add the :data:`user site-packages directory ` to :data:`sys.path`." +msgid "" +"Don't add the :data:`user site-packages directory ` to " +":data:`sys.path`." msgstr "" +":data:`پوشه‌ی site-packages کاربر ` را به :data:`sys.path` " +"اضافه نکنید." -msgid "Set by the :option:`-s` and :option:`-I` options, and the :envvar:`PYTHONNOUSERSITE` environment variable." +msgid "" +"Set by the :option:`-s` and :option:`-I` options, and the " +":envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" +"با گزینه‌های :option:`-s` و :option:`-I` و متغیر محیطی " +":envvar:`PYTHONNOUSERSITE` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.optimization_level` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.optimization_level` should be used instead, see " +":ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.optimization_level` را تنظیم کرد؛ به :ref:`پیکربندی " +"مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment variable." +msgid "" +"Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " +"variable." msgstr "" +"توسط گزینه‌ی :option:`-O` و متغیر محیطی :envvar:`PYTHONOPTIMIZE` تنظیم " +"می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.quiet` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.quiet` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.quiet` را تنظیم کنید؛ به :ref:`پیکربندی مقداردهی اولیه " +"پایتون ` مراجعه کنید." -msgid "Don't display the copyright and version messages even in interactive mode." -msgstr "" +msgid "" +"Don't display the copyright and version messages even in interactive mode." +msgstr "پیام‌های حق نشر و نسخه را حتی در حالت تعاملی نمایش ندهید." msgid "Set by the :option:`-q` option." -msgstr "" +msgstr "توسط گزینه‌ی :option:`-q` تنظیم می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.buffered_stdio` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.buffered_stdio` should be used instead, see :ref:`Python" +" Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.buffered_stdio` را تنظیم کنید؛ به :ref:`پیکربندی " +"راه‌اندازی پایتون ` مراجعه کنید." msgid "Force the stdout and stderr streams to be unbuffered." -msgstr "" +msgstr "جریان‌های stdout و stderr را مجبور کنید که بدون بافر باشند." -msgid "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` environment variable." +msgid "" +"Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " +"environment variable." msgstr "" +"با گزینه‌ی :option:`-u` و متغیر محیطی :envvar:`PYTHONUNBUFFERED` تنظیم " +"می‌شود." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.verbose` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.verbose` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های قبلی نگه داشته شده است: به جای آن باید " +":c:member:`PyConfig.verbose` را تنظیم کنید؛ برای جزئیات به :ref:`پیکربندی " +"مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. If greater or equal 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." +msgid "" +"Print a message each time a module is initialized, showing the place " +"(filename or built-in module) from which it is loaded. If greater or equal " +"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 "" +"هر بار که یک ماژول مقداردهی اولیه می‌شود، پیامی چاپ می‌کند که نشان می‌دهد " +"ماژول از کدام مکان (نام پرونده یا ماژول توکار) بارگذاری شده است. اگر بزرگ‌تر" +" یا مساوی ``2`` باشد، برای هر پرونده‌ای که هنگام جستجوی یک ماژول بررسی " +"می‌شود پیامی چاپ می‌کند. همچنین اطلاعاتی درباره پاک‌سازی ماژول‌ها هنگام خروج" +" ارائه می‌دهد." -msgid "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment variable." +msgid "" +"Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " +"variable." msgstr "" +"با گزینه‌ی :option:`-v` و متغیر محیطی :envvar:`PYTHONVERBOSE` تنظیم می‌شود." msgid "Initializing and finalizing the interpreter" -msgstr "" +msgstr "راه‌اندازی و نهایی‌سازی مفسر" -msgid "Initialize the Python interpreter. In an application embedding Python, this should be called before using any other Python/C API functions; see :ref:`Before Python Initialization ` for the few exceptions." +msgid "" +"Initialize the Python interpreter. In an application embedding Python, this" +" should be called before using any other Python/C API functions; see " +":ref:`Before Python Initialization ` for the few exceptions." msgstr "" +"مفسر پایتون را راه‌اندازی می‌کند. در برنامه‌ای که پایتون را تعبیه می‌کند، " +"این تابع باید پیش از استفاده از هر تابع دیگری از Python/C API فراخوانی شود؛ " +"برای استثناهای معدود، :ref:`پیش از راه‌اندازی پایتون ` را " +"ببینید." -msgid "This initializes the table of loaded modules (``sys.modules``), and creates the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It also initializes the module search path (``sys.path``). It does not set ``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time (without calling :c:func:`Py_FinalizeEx` first). There is no return value; it is a fatal error if the initialization fails." -msgstr "" +msgid "" +"This initializes the table of loaded modules (``sys.modules``), and creates " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"also initializes the module search path (``sys.path``). It does not set " +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." +msgstr "" +"این کار جدول ماژول‌های بارگذاری‌شده (``sys.modules``) را مقداردهی اولیه " +"می‌کند و ماژول‌های بنیادی :mod:`builtins`، :mod:`__main__` و :mod:`sys` را " +"ایجاد می‌کند. همچنین مسیر جستجوی ماژول (``sys.path``) را مقداردهی اولیه " +"می‌کند. این کار ``sys.argv`` را تنظیم نمی‌کند؛ برای این منظور از API " +":ref:`پیکربندی مقداردهی اولیه پایتون ` استفاده کنید. این کار " +"هنگام فراخوانی برای بار دوم (بدون فراخوانی :c:func:`Py_FinalizeEx` پیش از " +"آن) یک عملیات بی‌اثر است. هیچ مقدار بازگشتی وجود ندارد؛ در صورت شکست " +"مقداردهی اولیه، خطای مهلک رخ می‌دهد." -msgid "Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python Initialization Configuration `." +msgid "" +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." msgstr "" +"از :c:func:`Py_InitializeFromConfig` برای سفارشی‌سازی :ref:`پیکربندی " +"راه‌اندازی پایتون ` استفاده کنید." -msgid "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which will also affect non-Python uses of the console using the C Runtime." +msgid "" +"On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " +"will also affect non-Python uses of the console using the C Runtime." msgstr "" +"در ویندوز، حالت کنسول را از ``O_TEXT`` به ``O_BINARY`` تغییر می‌دهد که بر " +"استفاده‌های غیرپایتونی از کنسول با استفاده از زمان اجرای C (C Runtime) نیز " +"تأثیر می‌گذارد." -msgid "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If *initsigs* is ``0``, it skips initialization registration of signal handlers, which may be useful when CPython is embedded as part of a larger application." +msgid "" +"This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " +"*initsigs* is ``0``, it skips initialization registration of signal " +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." msgstr "" +"اگر *initsigs* برابر ``1`` باشد، این تابع مانند :c:func:`Py_Initialize` عمل " +"می‌کند. اگر *initsigs* برابر ``0`` باشد، از ثبت هندلرهای سیگنال در زمان " +"راه‌اندازی صرف‌نظر می‌کند، که این امر می‌تواند زمانی مفید باشد که سی‌پایتون " +"به‌عنوان بخشی از یک برنامه بزرگ‌تر تعبیه شده باشد." -msgid "Initialize Python from *config* configuration, as described in :ref:`init-from-config`." +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." msgstr "" +"پایتون را از پیکربندی *config* مقداردهی اولیه کنید، همان‌طور که در " +":ref:`init-from-config` توضیح داده‌شده است." -msgid "See the :ref:`init-config` section for details on pre-initializing the interpreter, populating the runtime configuration structure, and querying the returned status structure." +msgid "" +"See the :ref:`init-config` section for details on pre-initializing the " +"interpreter, populating the runtime configuration structure, and querying " +"the returned status structure." msgstr "" +"برای جزئیات درباره‌ی پیش‌راه‌اندازی مفسر، پر کردن ساختار پیکربندی ران‌تایم و" +" پرس‌وجو از ساختار وضعیت بازگشتی، به بخش :ref:`init-config` مراجعه کنید." -msgid "Return true (nonzero) when the Python interpreter has been initialized, false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns false until :c:func:`Py_Initialize` is called again." +msgid "" +"Return true (nonzero) when the Python interpreter has been initialized, " +"false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " +"false until :c:func:`Py_Initialize` is called again." msgstr "" +"هنگامی که مفسر پایتون مقداردهی اولیه شده باشد، true (غیرصفر) را برمی‌گرداند " +"و در غیر این صورت false (صفر) را برمی‌گرداند. پس از فراخوانی " +":c:func:`Py_FinalizeEx`، این تابع تا زمانی که :c:func:`Py_Initialize` دوباره" +" فراخوانی شود، false برمی‌گرداند." -msgid "Return true (non-zero) if the main Python interpreter is :term:`shutting down `. Return false (zero) otherwise." +msgid "" +"Return true (non-zero) if the main Python interpreter is :term:`shutting " +"down `. Return false (zero) otherwise." msgstr "" +"اگر مفسر اصلی پایتون در حال :term:`خاموش شدن ` باشد، " +"مقدار true (غیرصفر) را برمی‌گرداند. در غیر این صورت مقدار false (صفر) را " +"برمی‌گرداند." -msgid "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use of Python/C API functions, and destroy all sub-interpreters (see :c:func:`Py_NewInterpreter` below) that were created and not yet destroyed since the last call to :c:func:`Py_Initialize`. This is a no-op when called for a second time (without calling :c:func:`Py_Initialize` again first)." -msgstr "" +msgid "" +"Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " +"of Python/C API functions, and destroy all sub-interpreters (see " +":c:func:`Py_NewInterpreter` below) that were created and not yet destroyed " +"since the last call to :c:func:`Py_Initialize`. This is a no-op when called" +" for a second time (without calling :c:func:`Py_Initialize` again first)." +msgstr "" +"تمام مقداردهی‌های اولیه‌ای که توسط :c:func:`Py_Initialize` و استفاده‌های " +"بعدی از توابع Python/C API انجام شده‌اند را لغو می‌کند، و تمام زیرمفسرهایی " +"(به :c:func:`Py_NewInterpreter` در ادامه مراجعه کنید) که از آخرین فراخوانی " +":c:func:`Py_Initialize` ایجاد شده‌اند و هنوز نابود نشده‌اند را نابود می‌کند." +" این تابع در صورت فراخوانی برای بار دوم (بدون فراخوانی مجدد " +":c:func:`Py_Initialize` در ابتدا) یک عملیات بی‌اثر است." -msgid "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in the same thread with the same interpreter active. That means the main thread and the main interpreter. This should never be called while :c:func:`Py_RunMain` is running." +msgid "" +"Since this is the reverse of :c:func:`Py_Initialize`, it should be called in" +" the same thread with the same interpreter active. That means the main " +"thread and the main interpreter. This should never be called while " +":c:func:`Py_RunMain` is running." msgstr "" +"از آنجا که این تابع معکوسِ :c:func:`Py_Initialize` است، باید در همان نخ و با" +" همان مفسرِ فعال فراخوانی شود. این به معنای نخ اصلی و مفسر اصلی است. این " +"تابع هرگز نباید در حین اجرای :c:func:`Py_RunMain` فراخوانی شود." -msgid "Normally the return value is ``0``. If there were errors during finalization (flushing buffered data), ``-1`` is returned." +msgid "" +"Normally the return value is ``0``. If there were errors during finalization" +" (flushing buffered data), ``-1`` is returned." msgstr "" +"معمولاً مقدار بازگشتی ``0`` است. اگر هنگام نهایی‌سازی (تخلیه داده‌های " +"بافرشده) خطاهایی رخ داده باشد، ``-1`` بازگردانده می‌شود." -msgid "Note that Python will do a best effort at freeing all memory allocated by the Python interpreter. Therefore, any C-Extension should make sure to correctly clean up all of the previously allocated PyObjects before using them in subsequent calls to :c:func:`Py_Initialize`. Otherwise it could introduce vulnerabilities and incorrect behavior." -msgstr "" +msgid "" +"Note that Python will do a best effort at freeing all memory allocated by " +"the Python interpreter. Therefore, any C-Extension should make sure to " +"correctly clean up all of the previously allocated PyObjects before using " +"them in subsequent calls to :c:func:`Py_Initialize`. Otherwise it could " +"introduce vulnerabilities and incorrect behavior." +msgstr "" +"توجه داشته باشید که پایتون تلاش حداکثری خود را برای آزادسازی تمام حافظه‌ای " +"که توسط مفسر پایتون تخصیص یافته است، انجام می‌دهد. بنابراین، هر ماژول " +"توسعه‌ای C باید مطمئن شود که همه‌ی اشیای PyObject که پیش‌تر تخصیص " +"یافته‌اند، پیش از استفاده از آن‌ها در فراخوانی‌های بعدی " +":c:func:`Py_Initialize` به‌درستی پاک‌سازی می‌شوند. در غیر این صورت، ممکن است" +" آسیب‌پذیری‌ها و رفتار نادرست ایجاد شود." -msgid "This function is provided for a number of reasons. An embedding application might want to restart Python without having to restart the application itself. An application that has loaded the Python interpreter from a dynamically loadable library (or DLL) might want to free all memory allocated by Python before unloading the DLL. During a hunt for memory leaks in an application a developer might want to free all memory allocated by Python before exiting from the application." -msgstr "" +msgid "" +"This function is provided for a number of reasons. An embedding application" +" might want to restart Python without having to restart the application " +"itself. An application that has loaded the Python interpreter from a " +"dynamically loadable library (or DLL) might want to free all memory " +"allocated by Python before unloading the DLL. During a hunt for memory leaks" +" in an application a developer might want to free all memory allocated by " +"Python before exiting from the application." +msgstr "" +"این تابع به دلایل متعددی ارائه شده است. یک برنامه جاساز ممکن است بخواهد " +"پایتون را از نو راه‌اندازی کند، بدون آنکه لازم باشد خودِ برنامه را " +"راه‌اندازی مجدد کند. برنامه‌ای که مفسر پایتون را از یک کتابخانه " +"بارگذاری‌پذیر پویا (یا DLL) بارگذاری کرده است، ممکن است بخواهد پیش از تخلیه " +"DLL، تمام حافظه تخصیص‌یافته توسط پایتون را آزاد کند. در جریان ردیابی نشت " +"حافظه در یک برنامه، ممکن است توسعه‌دهنده‌ای بخواهد پیش از خروج از برنامه، " +"تمام حافظه تخصیص‌یافته توسط پایتون را آزاد کند." -msgid "**Bugs and caveats:** The destruction of modules and objects in modules is done in random order; this may cause destructors (:meth:`~object.__del__` methods) to fail when they depend on other objects (even functions) or modules. Dynamically loaded extension modules loaded by Python are not unloaded. Small amounts of memory allocated by the Python interpreter may not be freed (if you find a leak, please report it). Memory tied up in circular references between objects is not freed. Interned strings will all be deallocated regardless of their reference count. Some memory allocated by extension modules may not be freed. Some extensions may not work properly if their initialization routine is called more than once; this can happen if an application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` more than once. :c:func:`Py_FinalizeEx` must not be called recursively from within itself. Therefore, it must not be called by any code that may be run as part of the interpreter shutdown process, such as :py:mod:`atexit` handlers, object finalizers, or any code that may be run while flushing the stdout and stderr files." -msgstr "" +msgid "" +"**Bugs and caveats:** The destruction of modules and objects in modules is " +"done in random order; this may cause destructors (:meth:`~object.__del__` " +"methods) to fail when they depend on other objects (even functions) or " +"modules. Dynamically loaded extension modules loaded by Python are not " +"unloaded. Small amounts of memory allocated by the Python interpreter may " +"not be freed (if you find a leak, please report it). Memory tied up in " +"circular references between objects is not freed. Interned strings will all" +" be deallocated regardless of their reference count. Some memory allocated " +"by extension modules may not be freed. Some extensions may not work " +"properly if their initialization routine is called more than once; this can " +"happen if an application calls :c:func:`Py_Initialize` and " +":c:func:`Py_FinalizeEx` more than once. :c:func:`Py_FinalizeEx` must not be" +" called recursively from within itself. Therefore, it must not be called by" +" any code that may be run as part of the interpreter shutdown process, such " +"as :py:mod:`atexit` handlers, object finalizers, or any code that may be run" +" while flushing the stdout and stderr files." +msgstr "" +"**باگ‌ها و هشدارها:** تخریب ماژول‌ها و اشیاء موجود در ماژول‌ها به ترتیب " +"تصادفی انجام می‌شود؛ این ممکن است باعث شود مخرب‌ها (متدهای " +":meth:`~object.__del__`) هنگامی که به اشیاء دیگر (حتی توابع) یا ماژول‌ها " +"وابسته‌اند، شکست بخورند. ماژول‌های توسعه‌ای که به‌صورت پویا توسط پایتون " +"بارگذاری شده‌اند، تخلیه نمی‌شوند. مقادیر کمی از حافظه‌ی تخصیص‌یافته توسط " +"مفسر پایتون ممکن است آزاد نشوند (اگر نشتی حافظه پیدا کردید، لطفاً آن را " +"گزارش کنید). حافظه‌ی درگیر در ارجاع‌های چرخه‌ای میان اشیاء آزاد نمی‌شود. " +"همه‌ی رشته‌های درون‌بسته (interned strings) صرف‌نظر از شمارش ارجاع‌شان آزاد " +"می‌شوند. مقداری از حافظه‌ی تخصیص‌یافته توسط ماژول‌های توسعه‌ای ممکن است آزاد" +" نشود. برخی ماژول‌های توسعه‌ای ممکن است اگر روال مقداردهی اولیه‌شان بیش از " +"یک بار فراخوانی شود، به‌درستی کار نکنند؛ این می‌تواند در صورتی رخ دهد که " +"برنامه‌ای :c:func:`Py_Initialize` و :c:func:`Py_FinalizeEx` را بیش از یک بار" +" فراخوانی کند. :c:func:`Py_FinalizeEx` نباید به‌صورت بازگشتی از درون خود " +"فراخوانی شود. بنابراین، هیچ کدی که ممکن است به‌عنوان بخشی از فرایند " +"خاموش‌شدن مفسر اجرا شود، نباید آن را فراخوانی کند؛ مانند هندلرهای " +":py:mod:`atexit`، نهایی‌سازهای شیء، یا هر کدی که ممکن است هنگام تخلیه‌ی " +"پرونده‌های stdout و stderr اجرا شود." -msgid "Raises an :ref:`auditing event ` ``cpython._PySys_ClearAuditHooks`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` " +"``cpython._PySys_ClearAuditHooks`` with no arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``cpython._PySys_ClearAuditHooks`` را " +"بدون هیچ آرگومانی ایجاد می‌کند." -msgid "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that disregards the return value." +msgid "" +"This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " +"disregards the return value." msgstr "" +"این نسخه‌ای سازگار با نسخه‌های پیشین از :c:func:`Py_FinalizeEx` است که مقدار" +" بازگشتی را نادیده می‌گیرد." -msgid "Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, allowing the calling application to delegate the text decoding step to the CPython runtime." +msgid "" +"Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, " +"allowing the calling application to delegate the text decoding step to the " +"CPython runtime." msgstr "" +"مشابه :c:func:`Py_Main` است، اما *argv* آرایه‌ای از رشته‌های بایت است و به " +"برنامه‌ی فراخواننده اجازه می‌دهد مرحله‌ی کدگشایی متن را به ران‌تایم " +"سی‌پایتون واگذار کند." -msgid "The main program for the standard interpreter, encapsulating a full initialization/finalization cycle, as well as additional behaviour to implement reading configurations settings from the environment and command line, and then executing ``__main__`` in accordance with :ref:`using-on-cmdline`." +msgid "" +"The main program for the standard interpreter, encapsulating a full " +"initialization/finalization cycle, as well as additional behaviour to " +"implement reading configurations settings from the environment and command " +"line, and then executing ``__main__`` in accordance with :ref:`using-on-" +"cmdline`." msgstr "" +"برنامه اصلی مفسر استاندارد که یک چرخه کامل مقداردهی اولیه/نهایی‌سازی را در " +"بر می‌گیرد، و همچنین رفتار اضافی برای پیاده‌سازی خواندن تنظیمات پیکربندی از " +"محیط و خط فرمان و سپس اجرای ``__main__`` مطابق با :ref:`using-on-cmdline`." -msgid "This is made available for programs which wish to support the full CPython command line interface, rather than just embedding a Python runtime in a larger application." +msgid "" +"This is made available for programs which wish to support the full CPython " +"command line interface, rather than just embedding a Python runtime in a " +"larger application." msgstr "" +"این برای برنامه‌هایی فراهم شده است که می‌خواهند از رابط کامل خط فرمان " +"سی‌پایتون پشتیبانی کنند، نه صرفاً ران‌تایم پایتون را در برنامه‌ای بزرگ‌تر " +"جاسازی کنند." -msgid "The *argc* and *argv* parameters are similar to those which are passed to a C program's :c:func:`main` function, except that the *argv* entries are first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also important to note that the argument list entries may be modified to point to strings other than those passed in (however, the contents of the strings pointed to by the argument list are not modified)." -msgstr "" +msgid "" +"The *argc* and *argv* parameters are similar to those which are passed to a " +"C program's :c:func:`main` function, except that the *argv* entries are " +"first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also " +"important to note that the argument list entries may be modified to point to" +" strings other than those passed in (however, the contents of the strings " +"pointed to by the argument list are not modified)." +msgstr "" +"پارامترهای *argc* و *argv* مشابه پارامترهایی هستند که به تابع :c:func:`main`" +" یک برنامه‌ی C پاس داده می‌شوند، با این تفاوت که ورودی‌های *argv* ابتدا با " +"استفاده از :c:func:`Py_DecodeLocale` به ``wchar_t`` تبدیل می‌شوند. همچنین " +"توجه به این نکته مهم است که ورودی‌های فهرست آرگومان‌ها ممکن است به‌گونه‌ای " +"تغییر داده شوند که به رشته‌هایی غیر از رشته‌های پاس‌داده‌شده اشاره کنند (با " +"این حال، محتویات رشته‌هایی که فهرست آرگومان‌ها به آن‌ها اشاره می‌کند، تغییر " +"نمی‌کنند)." -msgid "The return value is ``2`` if the argument list does not represent a valid Python command line, and otherwise the same as :c:func:`Py_RunMain`." +msgid "" +"The return value is ``2`` if the argument list does not represent a valid " +"Python command line, and otherwise the same as :c:func:`Py_RunMain`." msgstr "" +"اگر فهرست آرگومان‌ها نمایانگر خط فرمان معتبر پایتون نباشد، مقدار بازگشتی " +"``2`` است و در غیر این صورت همانند :c:func:`Py_RunMain` است." -msgid "In terms of the CPython runtime configuration APIs documented in the :ref:`runtime configuration ` section (and without accounting for error handling), ``Py_Main`` is approximately equivalent to::" +msgid "" +"In terms of the CPython runtime configuration APIs documented in the " +":ref:`runtime configuration ` section (and without accounting " +"for error handling), ``Py_Main`` is approximately equivalent to::" msgstr "" +"بر اساس APIهای پیکربندی ران‌تایم سی‌پایتون که در بخش :ref:`پیکربندی ران‌تایم" +" ` مستند شده‌اند (و بدون در نظر گرفتن مدیریت خطا)، ``Py_Main`` " +"تقریباً معادل است با::" msgid "" "PyConfig config;\n" @@ -391,243 +826,674 @@ msgid "" "\n" "Py_RunMain();" msgstr "" +"PyConfig config;\n" +"PyConfig_InitPythonConfig(&config);\n" +"PyConfig_SetArgv(&config, argc, argv);\n" +"Py_InitializeFromConfig(&config);\n" +"PyConfig_Clear(&config);\n" +"\n" +"Py_RunMain();" -msgid "In normal usage, an embedding application will call this function *instead* of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:`Py_InitializeFromConfig` directly, and all settings will be applied as described elsewhere in this documentation. If this function is instead called *after* a preceding runtime initialization API call, then exactly which environmental and command line configuration settings will be updated is version dependent (as it depends on which settings correctly support being modified after they have already been set once when the runtime was first initialized)." -msgstr "" +msgid "" +"In normal usage, an embedding application will call this function *instead* " +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or " +":c:func:`Py_InitializeFromConfig` directly, and all settings will be applied" +" as described elsewhere in this documentation. If this function is instead " +"called *after* a preceding runtime initialization API call, then exactly " +"which environmental and command line configuration settings will be updated " +"is version dependent (as it depends on which settings correctly support " +"being modified after they have already been set once when the runtime was " +"first initialized)." +msgstr "" +"در استفاده‌ی معمول، یک برنامه تعبیه‌کننده این تابع را *به‌جای* فراخوانی " +"مستقیم :c:func:`Py_Initialize`، :c:func:`Py_InitializeEx` یا " +":c:func:`Py_InitializeFromConfig` فراخوانی می‌کند و تمام تنظیمات همان‌گونه " +"که در جای دیگر این مستندات توضیح داده شده است، اعمال خواهند شد. اگر این تابع" +" در عوض *پس از* یک فراخوانی قبلی از API مقداردهی اولیه‌ی ران‌تایم فراخوانی " +"شود، دقیقاً اینکه کدام تنظیمات پیکربندی محیطی و خط فرمان به‌روزرسانی خواهند " +"شد، وابسته به نسخه است (زیرا به این بستگی دارد که کدام تنظیمات به‌درستی از " +"این پشتیبانی می‌کنند که پس از آن‌که یک‌بار در نخستین مقداردهی اولیه‌ی " +"ران‌تایم تنظیم شده‌اند، تغییر کنند)." msgid "Executes the main module in a fully configured CPython runtime." msgstr "" +"ماژول اصلی را در یک ران‌تایم سی‌پایتون کاملاً پیکربندی‌شده اجرا می‌کند." -msgid "Executes the command (:c:member:`PyConfig.run_command`), the script (:c:member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig.run_module`) specified on the command line or in the configuration. If none of these values are set, runs the interactive Python prompt (REPL) using the ``__main__`` module's global namespace." -msgstr "" +msgid "" +"Executes the command (:c:member:`PyConfig.run_command`), the script " +"(:c:member:`PyConfig.run_filename`) or the module " +"(:c:member:`PyConfig.run_module`) specified on the command line or in the " +"configuration. If none of these values are set, runs the interactive Python " +"prompt (REPL) using the ``__main__`` module's global namespace." +msgstr "" +"دستور (:c:member:`PyConfig.run_command`)، اسکریپت " +"(:c:member:`PyConfig.run_filename`) یا ماژول " +"(:c:member:`PyConfig.run_module`) مشخص‌شده در خط فرمان یا در پیکربندی را " +"اجرا می‌کند. اگر هیچ‌کدام از این مقادیر تنظیم نشده باشند، پوسته تعاملی " +"پایتون (REPL) را با استفاده از فضای نام سراسری ماژول ``__main__`` اجرا " +"می‌کند." -msgid "If :c:member:`PyConfig.inspect` is not set (the default), the return value will be ``0`` if the interpreter exits normally (that is, without raising an exception), the exit status of an unhandled :exc:`SystemExit`, or ``1`` for any other unhandled exception." +msgid "" +"If :c:member:`PyConfig.inspect` is not set (the default), the return value " +"will be ``0`` if the interpreter exits normally (that is, without raising an" +" exception), the exit status of an unhandled :exc:`SystemExit`, or ``1`` for" +" any other unhandled exception." msgstr "" +"اگر :c:member:`PyConfig.inspect` تنظیم نشده باشد (پیش‌فرض)، مقدار بازگشتی در" +" صورت خروج عادی مفسر (یعنی بدون ایجاد استثنا) ``0`` خواهد بود، در صورت وقوع " +"استثنای مدیریت‌نشده‌ی :exc:`SystemExit` برابر با وضعیت خروج آن، و برای هر " +"استثنای مدیریت‌نشده‌ی دیگر ``1``." -msgid "If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option is used), rather than returning when the interpreter exits, execution will instead resume in an interactive Python prompt (REPL) using the ``__main__`` module's global namespace. If the interpreter exited with an exception, it is immediately raised in the REPL session. The function return value is then determined by the way the *REPL session* terminates: ``0``, ``1``, or the status of a :exc:`SystemExit`, as specified above." -msgstr "" +msgid "" +"If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option" +" is used), rather than returning when the interpreter exits, execution will " +"instead resume in an interactive Python prompt (REPL) using the ``__main__``" +" module's global namespace. If the interpreter exited with an exception, it " +"is immediately raised in the REPL session. The function return value is then" +" determined by the way the *REPL session* terminates: ``0``, ``1``, or the " +"status of a :exc:`SystemExit`, as specified above." +msgstr "" +"اگر :c:member:`PyConfig.inspect` تنظیم شده باشد (مانند زمانی که از گزینه‌ی " +":option:`-i` استفاده می‌شود)، به‌جای آنکه هنگام خروج مفسر بازگشت رخ دهد، " +"اجرا در یک اعلان تعاملی پایتون (REPL) با استفاده از فضای نام سراسری ماژول " +"``__main__`` از سر گرفته می‌شود. اگر مفسر با یک استثنا خارج شده باشد، آن " +"استثنا بلافاصله در نشست REPL پرتاب می‌شود. سپس مقدار بازگشتی تابع بر اساس " +"نحوه‌ی خاتمه‌ی *نشست REPL* تعیین می‌شود: ``0``، ``1``، یا وضعیت یک " +":exc:`SystemExit`، همان‌طور که در بالا مشخص شده است." -msgid "This function always finalizes the Python interpreter before it returns." -msgstr "" +msgid "" +"This function always finalizes the Python interpreter before it returns." +msgstr "این تابع همیشه پیش از بازگشت، مفسر پایتون را نهایی‌سازی می‌کند." -msgid "See :ref:`Python Configuration ` for an example of a customized Python that always runs in isolated mode using :c:func:`Py_RunMain`." +msgid "" +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode using " +":c:func:`Py_RunMain`." msgstr "" +"برای مثالی از یک پایتون سفارشی‌شده که همیشه در حالت ایزوله با استفاده از " +":c:func:`Py_RunMain` اجرا می‌شود، به :ref:`پیکربندی پایتون ` مراجعه کنید." -msgid "Register an :mod:`atexit` callback for the target interpreter *interp*. This is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and data pointer for the callback." +msgid "" +"Register an :mod:`atexit` callback for the target interpreter *interp*. This" +" is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and " +"data pointer for the callback." msgstr "" +"برای مفسر هدف *interp* یک کال‌بک :mod:`atexit` ثبت می‌کند. این مشابه " +":c:func:`Py_AtExit` است، اما یک مفسر صریح و اشاره‌گر داده برای کال‌بک دریافت" +" می‌کند." msgid "There must be an :term:`attached thread state` for *interp*." -msgstr "" +msgstr "باید یک :term:`attached thread state` برای *interp* وجود داشته باشد." msgid "Cautions regarding runtime finalization" -msgstr "" +msgstr "هشدارهایی درباره‌ی نهایی‌سازی ران‌تایم" -msgid "In the late stage of :term:`interpreter shutdown`, after attempting to wait for non-daemon threads to exit (though this can be interrupted by :class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime is marked as *finalizing*: :c:func:`Py_IsFinalizing` and :func:`sys.is_finalizing` return true. At this point, only the *finalization thread* that initiated finalization (typically the main thread) is allowed to acquire the :term:`GIL`." -msgstr "" +msgid "" +"In the late stage of :term:`interpreter shutdown`, after attempting to wait " +"for non-daemon threads to exit (though this can be interrupted by " +":class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the " +"runtime is marked as *finalizing*: :c:func:`Py_IsFinalizing` and " +":func:`sys.is_finalizing` return true. At this point, only the " +"*finalization thread* that initiated finalization (typically the main " +"thread) is allowed to acquire the :term:`GIL`." +msgstr "" +"در مرحله‌ی پایانیِ :term:`خاموشی مفسر `، پس از تلاش " +"برای منتظر ماندن تا خروج نخ‌های غیر دِیمِن (هرچند این انتظار ممکن است توسط " +":class:`KeyboardInterrupt` قطع شود) و اجرای توابع :mod:`atexit`، ران‌تایم " +"به‌عنوان *در حال نهایی‌سازی* علامت‌گذاری می‌شود: :c:func:`Py_IsFinalizing` و" +" :func:`sys.is_finalizing` مقدار true را برمی‌گردانند. در این نقطه، تنها " +"*نخ نهایی‌سازی* که نهایی‌سازی را آغاز کرده است (معمولاً نخ اصلی) مجاز است " +":term:`قفل مفسر سراسری (GIL) ` را به دست آورد." -msgid "If any thread, other than the finalization thread, attempts to attach a :term:`thread state` during finalization, either explicitly or implicitly, the thread enters **a permanently blocked state** where it remains until the program exits. In most cases this is harmless, but this can result in deadlock if a later stage of finalization attempts to acquire a lock owned by the blocked thread, or otherwise waits on the blocked thread." -msgstr "" +msgid "" +"If any thread, other than the finalization thread, attempts to attach a " +":term:`thread state` during finalization, either explicitly or implicitly, " +"the thread enters **a permanently blocked state** where it remains until the" +" program exits. In most cases this is harmless, but this can result in " +"deadlock if a later stage of finalization attempts to acquire a lock owned " +"by the blocked thread, or otherwise waits on the blocked thread." +msgstr "" +"اگر نخی غیر از نخ نهایی‌سازی، در حین نهایی‌سازی، چه به‌طور صریح و چه به‌طور " +"ضمنی، تلاش کند یک :term:`thread state` را متصل کند، آن نخ وارد **وضعیت مسدود" +" دائمی** می‌شود و تا زمان خروج برنامه در همان وضعیت باقی می‌ماند. در بیشتر " +"موارد این بی‌ضرر است، اما اگر مرحله‌ای بعدی از نهایی‌سازی تلاش کند قفلی را " +"که در اختیار نخ مسدود است به دست آورد یا به نحوی دیگر منتظر نخ مسدود بماند، " +"این می‌تواند منجر به بن‌بست شود." -msgid "Gross? Yes. This prevents random crashes and/or unexpectedly skipped C++ finalizations further up the call stack when such threads were forcibly exited here in CPython 3.13 and earlier. The CPython runtime :term:`thread state` C APIs have never had any error reporting or handling expectations at :term:`thread state` attachment time that would've allowed for graceful exit from this situation. Changing that would require new stable C APIs and rewriting the majority of C code in the CPython ecosystem to use those with error handling." -msgstr "" +msgid "" +"Gross? Yes. This prevents random crashes and/or unexpectedly skipped C++ " +"finalizations further up the call stack when such threads were forcibly " +"exited here in CPython 3.13 and earlier. The CPython runtime :term:`thread " +"state` C APIs have never had any error reporting or handling expectations at" +" :term:`thread state` attachment time that would've allowed for graceful " +"exit from this situation. Changing that would require new stable C APIs and " +"rewriting the majority of C code in the CPython ecosystem to use those with " +"error handling." +msgstr "" +"زشت است؟ بله. این کار از فروپاشی‌های تصادفی و/یا رد شدن غیرمنتظره‌ی " +"نهایی‌سازی‌های C++ در بخش‌های بالاتر پشته فراخوانی جلوگیری می‌کند؛ همان " +"مشکلاتی که در سی‌پایتون 3.13 و نسخه‌های پیشین، هنگامی که چنین نخ‌هایی در " +"اینجا به‌اجبار خارج می‌شدند، پیش می‌آمدند. APIهای C مربوط به :term:`وضعیت نخ" +" ` در ران‌تایم سی‌پایتون هیچ‌گاه در زمان اتصال :term:`وضعیت نخ" +" ` هیچ‌گونه انتظاری برای گزارش یا مدیریت خطا نداشته‌اند که " +"خروج منظم از این وضعیت را ممکن می‌ساخت. تغییر این امر نیازمند ایجاد APIهای C" +" پایدار جدید و بازنویسی بخش عمده‌ی کدهای C در اکوسیستم سی‌پایتون برای " +"استفاده از آن‌ها همراه با مدیریت خطا خواهد بود." msgid "Process-wide parameters" -msgstr "" +msgstr "پارامترهای در سطح فرایند" -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.program_name` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.program_name` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.program_name` را تنظیم کنید؛ به :ref:`پیکربندی مقدار‌دهی" +" اولیه پایتون ` مراجعه کنید." -msgid "This function should be called before :c:func:`Py_Initialize` is called for the first time, if it is called at all. It tells the interpreter the value of the ``argv[0]`` argument to the :c:func:`main` function of the program (converted to wide characters). This is used by :c:func:`Py_GetPath` and some other functions below to find the Python run-time libraries relative to the interpreter executable. The default value is ``'python'``. The argument should point to a zero-terminated wide character string in static storage whose contents will not change for the duration of the program's execution. No code in the Python interpreter will change the contents of this storage." -msgstr "" +msgid "" +"This function should be called before :c:func:`Py_Initialize` is called for " +"the first time, if it is called at all. It tells the interpreter the value " +"of the ``argv[0]`` argument to the :c:func:`main` function of the program " +"(converted to wide characters). This is used by :c:func:`Py_GetPath` and " +"some other functions below to find the Python run-time libraries relative to" +" the interpreter executable. The default value is ``'python'``. The " +"argument should point to a zero-terminated wide character string in static " +"storage whose contents will not change for the duration of the program's " +"execution. No code in the Python interpreter will change the contents of " +"this storage." +msgstr "" +"این تابع، اگر اصلاً فراخوانی شود، باید پیش از آنکه :c:func:`Py_Initialize` " +"برای نخستین بار فراخوانی شود، فراخوانی شود. این تابع مقدار آرگومان " +"``argv[0]`` تابع :c:func:`main` برنامه را به مفسر اطلاع می‌دهد (تبدیل‌شده به" +" نویسه‌های پهن). این مقدار توسط :c:func:`Py_GetPath` و برخی توابع دیگر در " +"ادامه برای یافتن کتابخانه‌های زمان اجرای پایتون نسبت به فایل اجرایی مفسر " +"استفاده می‌شود. مقدار پیش‌فرض ``'python'`` است. این آرگومان باید به یک " +"رشته‌ی نویسه‌های پهن خاتمه‌یافته با نویسه‌ی تهی (zero-terminated) در حافظه‌ی" +" ایستا اشاره کند که محتوای آن در طول اجرای برنامه تغییر نخواهد کرد. هیچ کدی " +"در مفسر پایتون محتوای این حافظه را تغییر نخواهد داد." -msgid "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:`wchar_t*` string." +msgid "" +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a " +":c:expr:`wchar_t*` string." msgstr "" +"برای کدگشایی یک رشته بایتی و به‌دست آوردن یک رشته‌ی :c:expr:`wchar_t*` از " +":c:func:`Py_DecodeLocale` استفاده کنید." -msgid "Return the program name set with :c:member:`PyConfig.program_name`, or the default. The returned string points into static storage; the caller should not modify its value." +msgid "" +"Return the program name set with :c:member:`PyConfig.program_name`, or the " +"default. The returned string points into static storage; the caller should " +"not modify its value." msgstr "" +"نام برنامه‌ی تنظیم‌شده با :c:member:`PyConfig.program_name` یا مقدار پیش‌فرض" +" را برمی‌گرداند. رشته‌ی بازگردانده‌شده به فضای ذخیره‌سازی ایستا اشاره " +"می‌کند؛ فراخواننده نباید مقدار آن را تغییر دهد." -msgid "This function should not be called before :c:func:`Py_Initialize`, otherwise it returns ``NULL``." +msgid "" +"This function should not be called before :c:func:`Py_Initialize`, otherwise" +" it returns ``NULL``." msgstr "" +"این تابع نباید پیش از :c:func:`Py_Initialize` فراخوانی شود، در غیر این صورت " +"``NULL`` را برمی‌گرداند." msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" +"اکنون اگر پیش از :c:func:`Py_Initialize` فراخوانی شود، ``NULL`` را " +"برمی‌گرداند." -msgid "Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys.executable`) instead." +msgid "" +"Use :c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) instead." msgstr "" +"به جای آن از :c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) استفاده کنید." -msgid "Return the *prefix* for installed platform-independent files. This is derived through a number of complicated rules from the program name set with :c:member:`PyConfig.program_name` and some environment variables; for example, if the program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The returned string points into static storage; the caller should not modify its value. This corresponds to the :makevar:`prefix` variable in the top-level :file:`Makefile` and the :option:`--prefix` argument to the :program:`configure` script at build time. The value is available to Python code as ``sys.base_prefix``. It is only useful on Unix. See also the next function." -msgstr "" +msgid "" +"Return the *prefix* for installed platform-independent files. This is " +"derived through a number of complicated rules from the program name set with" +" :c:member:`PyConfig.program_name` and some environment variables; for " +"example, if the program name is ``'/usr/local/bin/python'``, the prefix is " +"``'/usr/local'``. The returned string points into static storage; the caller" +" should not modify its value. This corresponds to the :makevar:`prefix` " +"variable in the top-level :file:`Makefile` and the :option:`--prefix` " +"argument to the :program:`configure` script at build time. The value is " +"available to Python code as ``sys.base_prefix``. It is only useful on Unix." +" See also the next function." +msgstr "" +"*پیشوند* پرونده‌های نصب‌شده‌ی مستقل از پلتفرم را برمی‌گرداند. این پیشوند بر " +"اساس تعدادی قاعده‌ی پیچیده، از نام برنامه‌ای که با " +":c:member:`PyConfig.program_name` تنظیم‌شده است و برخی متغیرهای محیطی به دست" +" می‌آید؛ برای نمونه، اگر نام برنامه ``'/usr/local/bin/python'`` باشد، پیشوند" +" ``'/usr/local'`` است. رشته‌ی بازگردانده‌شده به حافظه‌ی ایستا اشاره می‌کند؛ " +"فراخواننده نباید مقدار آن را تغییر دهد. این مقدار با متغیر :makevar:`prefix`" +" در :file:`Makefile` سطح بالا و آرگومان :option:`--prefix` اسکریپت " +":program:`configure` در زمان ساخت مطابقت دارد. این مقدار برای کد پایتون " +"به‌صورت ``sys.base_prefix`` در دسترس است. فقط روی یونیکس کاربرد دارد. همچنین" +" تابع بعدی را ببینید." -msgid "Use :c:func:`PyConfig_Get(\"base_prefix\") ` (:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:`virtual environments ` need to be handled." +msgid "" +"Use :c:func:`PyConfig_Get(\"base_prefix\") ` " +"(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") " +"` (:data:`sys.prefix`) if :ref:`virtual environments ` need to be handled." msgstr "" +"به‌جای آن از :c:func:`PyConfig_Get(\"base_prefix\") ` " +"(:data:`sys.base_prefix`) استفاده کنید. اگر لازم است :ref:`محیط‌های مجازی " +"` مدیریت شوند، از :c:func:`PyConfig_Get(\"prefix\") " +"` (:data:`sys.prefix`) استفاده کنید." -msgid "Return the *exec-prefix* for installed platform-*dependent* files. This is derived through a number of complicated rules from the program name set with :c:member:`PyConfig.program_name` and some environment variables; for example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix is ``'/usr/local'``. The returned string points into static storage; the caller should not modify its value. This corresponds to the :makevar:`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-prefix`` argument to the :program:`configure` script at build time. The value is available to Python code as ``sys.base_exec_prefix``. It is only useful on Unix." -msgstr "" +msgid "" +"Return the *exec-prefix* for installed platform-*dependent* files. This is " +"derived through a number of complicated rules from the program name set with" +" :c:member:`PyConfig.program_name` and some environment variables; for " +"example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix" +" is ``'/usr/local'``. The returned string points into static storage; the " +"caller should not modify its value. This corresponds to the " +":makevar:`exec_prefix` variable in the top-level :file:`Makefile` and the " +"``--exec-prefix`` argument to the :program:`configure` script at build " +"time. The value is available to Python code as ``sys.base_exec_prefix``. " +"It is only useful on Unix." +msgstr "" +"*پیشوند اجرا* (exec-prefix) را برای پرونده‌های نصب‌شده‌ی *وابسته* به پلتفرم " +"برمی‌گرداند. این مقدار بر اساس تعدادی قاعده‌ی پیچیده از نام برنامه‌ی " +"تنظیم‌شده با :c:member:`PyConfig.program_name` و برخی متغیرهای محیطی به دست " +"می‌آید؛ برای مثال، اگر نام برنامه ``'/usr/local/bin/python'`` باشد، پیشوند " +"اجرا ``'/usr/local'`` است. رشته‌ی بازگردانده‌شده به حافظه‌ی ایستا اشاره " +"می‌کند؛ فراخواننده نباید مقدار آن را تغییر دهد. این مقدار با متغیر " +":makevar:`exec_prefix` در :file:`Makefile` سطح بالا و آرگومان ``--exec-" +"prefix`` اسکریپت :program:`configure` در زمان ساخت مطابقت دارد. این مقدار در" +" کد پایتون به‌صورت ``sys.base_exec_prefix`` در دسترس است. این مقدار فقط در " +"یونیکس کاربرد دارد." -msgid "Background: The exec-prefix differs from the prefix when platform dependent files (such as executables and shared libraries) are installed in a different directory tree. In a typical installation, platform dependent files may be installed in the :file:`/usr/local/plat` subtree while platform independent may be installed in :file:`/usr/local`." -msgstr "" +msgid "" +"Background: The exec-prefix differs from the prefix when platform dependent " +"files (such as executables and shared libraries) are installed in a " +"different directory tree. In a typical installation, platform dependent " +"files may be installed in the :file:`/usr/local/plat` subtree while platform" +" independent may be installed in :file:`/usr/local`." +msgstr "" +"پیش‌زمینه: پیشوند اجرا (exec-prefix) هنگامی از پیشوند (prefix) متفاوت است که" +" پرونده‌های وابسته به پلتفرم (مانند پرونده‌های اجرایی و کتابخانه‌های " +"اشتراکی) در درخت پوشه‌ی متفاوتی نصب شوند. در یک نصب معمولی، ممکن است " +"پرونده‌های وابسته به پلتفرم در زیردرخت :file:`/usr/local/plat` نصب شوند، در " +"حالی که پرونده‌های مستقل از پلتفرم ممکن است در :file:`/usr/local` نصب شوند." -msgid "Generally speaking, a platform is a combination of hardware and software families, e.g. Sparc machines running the Solaris 2.x operating system are considered the same platform, but Intel machines running Solaris 2.x are another platform, and Intel machines running Linux are yet another platform. Different major revisions of the same operating system generally also form different platforms. Non-Unix operating systems are a different story; the installation strategies on those systems are so different that the prefix and exec-prefix are meaningless, and set to the empty string. Note that compiled Python bytecode files are platform independent (but not independent from the Python version by which they were compiled!)." -msgstr "" +msgid "" +"Generally speaking, a platform is a combination of hardware and software " +"families, e.g. Sparc machines running the Solaris 2.x operating system are " +"considered the same platform, but Intel machines running Solaris 2.x are " +"another platform, and Intel machines running Linux are yet another platform." +" Different major revisions of the same operating system generally also form" +" different platforms. Non-Unix operating systems are a different story; the" +" installation strategies on those systems are so different that the prefix " +"and exec-prefix are meaningless, and set to the empty string. Note that " +"compiled Python bytecode files are platform independent (but not independent" +" from the Python version by which they were compiled!)." +msgstr "" +"به‌طور کلی، یک پلتفرم ترکیبی از خانواده‌های سخت‌افزاری و نرم‌افزاری است؛ " +"برای مثال، ماشین‌های Sparc که سیستم‌عامل Solaris 2.x را اجرا می‌کنند، یک " +"پلتفرم واحد محسوب می‌شوند، اما ماشین‌های Intel که Solaris 2.x را اجرا " +"می‌کنند، پلتفرم دیگری هستند و ماشین‌های Intel که لینوکس را اجرا می‌کنند، " +"پلتفرمی دیگر. نسخه‌های اصلی مختلف یک سیستم‌عامل واحد نیز به‌طور کلی " +"پلتفرم‌های متفاوتی را تشکیل می‌دهند. سیستم‌عامل‌های غیر یونیکسی داستان دیگری" +" دارند؛ راهبردهای نصب در این سیستم‌ها چنان متفاوت است که پیشوند (prefix) و " +"پیشوند اجرا (exec-prefix) بی‌معنا هستند و روی رشته خالی تنظیم می‌شوند. توجه " +"داشته باشید که پرونده‌های بایت‌کد کامپایل‌شده پایتون مستقل از پلتفرم هستند " +"(اما از نسخه پایتونی که آن‌ها را کامپایل کرده است، مستقل نیستند!)." -msgid "System administrators will know how to configure the :program:`mount` or :program:`automount` programs to share :file:`/usr/local` between platforms while having :file:`/usr/local/plat` be a different filesystem for each platform." +msgid "" +"System administrators will know how to configure the :program:`mount` or " +":program:`automount` programs to share :file:`/usr/local` between platforms " +"while having :file:`/usr/local/plat` be a different filesystem for each " +"platform." msgstr "" +"مدیران سیستم می‌دانند چگونه برنامه‌های :program:`mount` یا " +":program:`automount` را پیکربندی کنند تا :file:`/usr/local` میان پلتفرم‌ها " +"به اشتراک گذاشته شود، در حالی که :file:`/usr/local/plat` برای هر پلتفرم یک " +"فایل‌سیستم متفاوت باشد." -msgid "Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys.base_exec_prefix`) instead. Use :c:func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to be handled." +msgid "" +"Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " +"(:data:`sys.base_exec_prefix`) instead. Use " +":c:func:`PyConfig_Get(\"exec_prefix\") ` " +"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " +"be handled." msgstr "" +"به‌جای آن از :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " +"(:data:`sys.base_exec_prefix`) استفاده کنید. اگر لازم باشد :ref:`محیط‌های " +"مجازی ` مدیریت شوند، از :c:func:`PyConfig_Get(\"exec_prefix\") " +"` (:data:`sys.exec_prefix`) استفاده کنید." -msgid "Return the full program name of the Python executable; this is computed as a side-effect of deriving the default module search path from the program name (set by :c:member:`PyConfig.program_name`). The returned string points into static storage; the caller should not modify its value. The value is available to Python code as ``sys.executable``." -msgstr "" +msgid "" +"Return the full program name of the Python executable; this is computed as " +"a side-effect of deriving the default module search path from the program " +"name (set by :c:member:`PyConfig.program_name`). The returned string points " +"into static storage; the caller should not modify its value. The value is " +"available to Python code as ``sys.executable``." +msgstr "" +"نام کامل برنامه‌ی اجرایی پایتون را برمی‌گرداند؛ این نام به‌عنوان یک عارضه‌ی " +"جانبی از استخراج مسیر جستجوی پیش‌فرض ماژول از نام برنامه (که توسط " +":c:member:`PyConfig.program_name` تنظیم می‌شود) محاسبه می‌شود. رشته‌ی " +"بازگردانده‌شده به حافظه‌ی ایستا اشاره می‌کند؛ فراخواننده نباید مقدار آن را " +"تغییر دهد. این مقدار برای کد پایتون به صورت ``sys.executable`` در دسترس است." -msgid "Return the default module search path; this is computed from the program name (set by :c:member:`PyConfig.program_name`) and some environment variables. The returned string consists of a series of directory names separated by a platform dependent delimiter character. The delimiter character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned string points into static storage; the caller should not modify its value. The list :data:`sys.path` is initialized with this value on interpreter startup; it can be (and usually is) modified later to change the search path for loading modules." -msgstr "" +msgid "" +"Return the default module search path; this is computed from the program " +"name (set by :c:member:`PyConfig.program_name`) and some environment " +"variables. The returned string consists of a series of directory names " +"separated by a platform dependent delimiter character. The delimiter " +"character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned " +"string points into static storage; the caller should not modify its value. " +"The list :data:`sys.path` is initialized with this value on interpreter " +"startup; it can be (and usually is) modified later to change the search path" +" for loading modules." +msgstr "" +"مسیر جستجوی پیش‌فرض ماژول را برمی‌گرداند؛ این مسیر از نام برنامه (که توسط " +":c:member:`PyConfig.program_name` تنظیم می‌شود) و برخی متغیرهای محیطی محاسبه" +" می‌شود. رشته‌ی بازگردانده‌شده از مجموعه‌ای از نام پوشه‌ها تشکیل شده است که " +"با نویسه‌ی جداکننده‌ای وابسته به پلتفرم از هم جدا شده‌اند. نویسه‌ی جداکننده " +"در یونیکس و مک‌اواس ``':'`` و در ویندوز ``';'`` است. رشته‌ی بازگردانده‌شده " +"به داخل ذخیره‌گاه ایستا اشاره می‌کند؛ فراخوان‌کننده نباید مقدار آن را تغییر " +"دهد. فهرست :data:`sys.path` هنگام راه‌اندازی مفسر با این مقدار مقداردهی " +"اولیه می‌شود؛ این فهرست می‌تواند (و معمولاً نیز چنین می‌شود) بعداً برای " +"تغییر مسیر جستجو جهت بارگذاری ماژول‌ها تغییر کند." -msgid "Use :c:func:`PyConfig_Get(\"module_search_paths\") ` (:data:`sys.path`) instead." +msgid "" +"Use :c:func:`PyConfig_Get(\"module_search_paths\") ` " +"(:data:`sys.path`) instead." msgstr "" +"به جای آن از :c:func:`PyConfig_Get(\"module_search_paths\") ` " +"(:data:`sys.path`) استفاده کنید." -msgid "Return the version of this Python interpreter. This is a string that looks something like ::" +msgid "" +"Return the version of this Python interpreter. This is a string that looks " +"something like ::" msgstr "" +"نسخه‌ی این مفسر پایتون را برمی‌گرداند. این رشته‌ای است که چیزی شبیه به این " +"است ::" msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -msgstr "" +msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -msgid "The first word (up to the first space character) is the current Python version; the first characters are the major and minor version separated by a period. The returned string points into static storage; the caller should not modify its value. The value is available to Python code as :data:`sys.version`." +msgid "" +"The first word (up to the first space character) is the current Python " +"version; the first characters are the major and minor version separated by a" +" period. The returned string points into static storage; the caller should " +"not modify its value. The value is available to Python code as " +":data:`sys.version`." msgstr "" +"نخستین واژه (تا نخستین نویسه فاصله) نسخه فعلی پایتون است؛ نویسه‌های نخست، " +"نسخه اصلی و فرعی هستند که با نقطه از هم جدا شده‌اند. رشته بازگردانده‌شده به " +"حافظه ایستا اشاره می‌کند؛ فراخواننده نباید مقدار آن را تغییر دهد. این مقدار " +"در کد پایتون به صورت :data:`sys.version` در دسترس است." msgid "See also the :c:var:`Py_Version` constant." -msgstr "" +msgstr "همچنین ثابت :c:var:`Py_Version` را ببینید." -msgid "Return the platform identifier for the current platform. On Unix, this is formed from the \"official\" name of the operating system, converted to lower case, followed by the major revision number; e.g., for Solaris 2.x, which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is ``'darwin'``. On Windows, it is ``'win'``. The returned string points into static storage; the caller should not modify its value. The value is available to Python code as ``sys.platform``." -msgstr "" +msgid "" +"Return the platform identifier for the current platform. On Unix, this is " +"formed from the \"official\" name of the operating system, converted to " +"lower case, followed by the major revision number; e.g., for Solaris 2.x, " +"which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it " +"is ``'darwin'``. On Windows, it is ``'win'``. The returned string points " +"into static storage; the caller should not modify its value. The value is " +"available to Python code as ``sys.platform``." +msgstr "" +"شناسه پلتفرم را برای پلتفرم فعلی برمی‌گرداند. در یونیکس، این شناسه از نام " +"«رسمی» سیستم‌عامل — که به حروف کوچک تبدیل شده — و به دنبال آن شماره بازنگری " +"اصلی تشکیل می‌شود؛ برای مثال، برای Solaris 2.x که با نام SunOS 5.x نیز " +"شناخته می‌شود، مقدار ``'sunos5'`` است. در macOS این مقدار ``'darwin'`` است. " +"در ویندوز این مقدار ``'win'`` است. رشته‌ی بازگردانده‌شده به حافظه‌ی ایستا " +"اشاره می‌کند؛ فراخوان‌کننده نباید مقدار آن را تغییر دهد. این مقدار در کد " +"پایتون به‌صورت ``sys.platform`` در دسترس است." -msgid "Return the official copyright string for the current Python version, for example" -msgstr "" +msgid "" +"Return the official copyright string for the current Python version, for " +"example" +msgstr "رشته‌ی رسمی حق نشر برای نسخه‌ی فعلی پایتون را برمی‌گرداند، برای مثال" msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -msgstr "" +msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -msgid "The returned string points into static storage; the caller should not modify its value. The value is available to Python code as ``sys.copyright``." +msgid "" +"The returned string points into static storage; the caller should not modify" +" its value. The value is available to Python code as ``sys.copyright``." msgstr "" +"رشته‌ی بازگشتی به حافظه‌ی ایستا اشاره می‌کند؛ فراخوان‌کننده نباید مقدار آن " +"را تغییر دهد. این مقدار برای کد پایتون به‌صورت ``sys.copyright`` در دسترس " +"است." -msgid "Return an indication of the compiler used to build the current Python version, in square brackets, for example::" +msgid "" +"Return an indication of the compiler used to build the current Python " +"version, in square brackets, for example::" msgstr "" +"بازگرداندن نشانه‌ای از کامپایلر استفاده‌شده برای ساخت نسخه‌ی فعلی پایتون، " +"داخل کروشه، برای مثال::" msgid "\"[GCC 2.7.2.2]\"" -msgstr "" +msgstr "[GCC 2.7.2.2]" -msgid "The returned string points into static storage; the caller should not modify its value. The value is available to Python code as part of the variable ``sys.version``." +msgid "" +"The returned string points into static storage; the caller should not modify" +" its value. The value is available to Python code as part of the variable " +"``sys.version``." msgstr "" +"رشته‌ی بازگردانده‌شده به حافظه‌ی ایستا اشاره می‌کند؛ فراخواننده نباید مقدار " +"آن را تغییر دهد. این مقدار به‌عنوان بخشی از متغیر ``sys.version`` برای کد " +"پایتون در دسترس است." -msgid "Return information about the sequence number and build date and time of the current Python interpreter instance, for example ::" +msgid "" +"Return information about the sequence number and build date and time of the " +"current Python interpreter instance, for example ::" msgstr "" +"اطلاعات مربوط به شماره ترتیبی و تاریخ و زمان ساخت نمونه‌ی فعلی مفسر پایتون " +"را برمی‌گرداند، برای مثال ::" msgid "\"#67, Aug 1 1997, 22:34:28\"" -msgstr "" +msgstr "#67, Aug 1 1997, 22:34:28" -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` and " +":c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین نگه داشته شده است: به جای آن باید " +":c:member:`PyConfig.argv`، :c:member:`PyConfig.parse_argv` و " +":c:member:`PyConfig.safe_path` تنظیم شوند؛ به :ref:`پیکربندی راه‌اندازی " +"پایتون ` مراجعه کنید." -msgid "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are similar to those passed to the program's :c:func:`main` function with the difference that the first entry should refer to the script file to be executed rather than the executable hosting the Python interpreter. If there isn't a script that will be run, the first entry in *argv* can be an empty string. If this function fails to initialize :data:`sys.argv`, a fatal condition is signalled using :c:func:`Py_FatalError`." -msgstr "" +msgid "" +"Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " +"similar to those passed to the program's :c:func:`main` function with the " +"difference that the first entry should refer to the script file to be " +"executed rather than the executable hosting the Python interpreter. If " +"there isn't a script that will be run, the first entry in *argv* can be an " +"empty string. If this function fails to initialize :data:`sys.argv`, a " +"fatal condition is signalled using :c:func:`Py_FatalError`." +msgstr "" +"مقدار :data:`sys.argv` را بر اساس *argc* و *argv* تنظیم می‌کند. این " +"پارامترها مشابه پارامترهایی هستند که به تابع :c:func:`main` برنامه پاس داده " +"می‌شوند، با این تفاوت که نخستین ورودی باید به پرونده‌ی اسکریپتی که قرار است " +"اجرا شود اشاره کند، نه به پرونده‌ی اجرایی میزبان مفسر پایتون. اگر اسکریپتی " +"برای اجرا وجود نداشته باشد، نخستین ورودی در *argv* می‌تواند یک رشته‌ی خالی " +"باشد. اگر این تابع نتواند :data:`sys.argv` را مقداردهی اولیه کند، یک وضعیت " +"مهلک با استفاده از :c:func:`Py_FatalError` اعلام می‌شود." -msgid "If *updatepath* is zero, this is all the function does. If *updatepath* is non-zero, the function also modifies :data:`sys.path` according to the following algorithm:" +msgid "" +"If *updatepath* is zero, this is all the function does. If *updatepath* is " +"non-zero, the function also modifies :data:`sys.path` according to the " +"following algorithm:" msgstr "" +"اگر *updatepath* صفر باشد، تمام کاری که تابع انجام می‌دهد همین است. اگر " +"*updatepath* غیرصفر باشد، تابع همچنین :data:`sys.path` را مطابق الگوریتم زیر" +" تغییر می‌دهد:" -msgid "If the name of an existing script is passed in ``argv[0]``, the absolute path of the directory where the script is located is prepended to :data:`sys.path`." +msgid "" +"If the name of an existing script is passed in ``argv[0]``, the absolute " +"path of the directory where the script is located is prepended to " +":data:`sys.path`." msgstr "" +"اگر نام یک اسکریپت موجود در ``argv[0]`` ارسال شود، مسیر مطلق پوشه‌ای که " +"اسکریپت در آن قرار دارد به ابتدای :data:`sys.path` اضافه می‌شود." -msgid "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an existing file name), an empty string is prepended to :data:`sys.path`, which is the same as prepending the current working directory (``\".\"``)." +msgid "" +"Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " +"existing file name), an empty string is prepended to :data:`sys.path`, which" +" is the same as prepending the current working directory (``\".\"``)." msgstr "" +"در غیر این صورت (یعنی اگر *argc* برابر ``0`` باشد یا ``argv[0]`` به نام یک " +"پرونده‌ی موجود اشاره نکند)، یک رشته‌ی خالی به ابتدای :data:`sys.path` افزوده" +" می‌شود، که معادل افزودن پوشه‌ی کاری جاری (``\".\"``) به ابتدای آن است." -msgid "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` members of the :ref:`Python Initialization Configuration `." +msgid "" +"See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " +"members of the :ref:`Python Initialization Configuration `." msgstr "" +"همچنین اعضای :c:member:`PyConfig.orig_argv` و :c:member:`PyConfig.argv` از " +":ref:`پیکربندی مقداردهی اولیه پایتون ` را ببینید." -msgid "It is recommended that applications embedding the Python interpreter for purposes other than executing a single script pass ``0`` as *updatepath*, and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." +msgid "" +"It is recommended that applications embedding the Python interpreter for " +"purposes other than executing a single script pass ``0`` as *updatepath*, " +"and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" +"توصیه می‌شود برنامه‌هایی که مفسر پایتون را برای اهدافی غیر از اجرای یک " +"اسکریپت واحد درون‌سازی می‌کنند، مقدار ``0`` را به‌عنوان *updatepath* عبور " +"دهند و در صورت تمایل، خودشان :data:`sys.path` را به‌روزرسانی کنند. به " +":cve:`2008-5983` مراجعه کنید." -msgid "On versions before 3.1.3, you can achieve the same effect by manually popping the first :data:`sys.path` element after having called :c:func:`PySys_SetArgv`, for example using::" +msgid "" +"On versions before 3.1.3, you can achieve the same effect by manually " +"popping the first :data:`sys.path` element after having called " +":c:func:`PySys_SetArgv`, for example using::" msgstr "" +"در نسخه‌های پیش از 3.1.3، می‌توانید همان اثر را با حذف دستی نخستین عنصر " +":data:`sys.path` پس از فراخوانی :c:func:`PySys_SetArgv` به دست آورید، برای " +"مثال با استفاده از::" msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -msgstr "" +msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should be used" +" instead, see :ref:`Python Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.argv` و :c:member:`PyConfig.parse_argv` را تنظیم کرد؛ به" +" :ref:`پیکربندی مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to ``1`` unless the :program:`python` interpreter was started with the :option:`-I`." +msgid "" +"This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " +"``1`` unless the :program:`python` interpreter was started with the " +":option:`-I`." msgstr "" +"این تابع مانند :c:func:`PySys_SetArgvEx` با *updatepath* برابر با ``1`` کار " +"می‌کند، مگر آنکه مفسر :program:`python` با گزینه‌ی :option:`-I` راه‌اندازی " +"شده باشد." msgid "The *updatepath* value depends on :option:`-I`." -msgstr "" +msgstr "مقدار *updatepath* به :option:`-I` بستگی دارد." -msgid "This API is kept for backward compatibility: setting :c:member:`PyConfig.home` should be used instead, see :ref:`Python Initialization Configuration `." +msgid "" +"This API is kept for backward compatibility: setting " +":c:member:`PyConfig.home` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"این API برای سازگاری با نسخه‌های پیشین حفظ شده است: به جای آن باید " +":c:member:`PyConfig.home` را تنظیم کرد؛ به :ref:`پیکربندی مقداردهی اولیه " +"پایتون ` مراجعه کنید." -msgid "Set the default \"home\" directory, that is, the location of the standard Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument string." +msgid "" +"Set the default \"home\" directory, that is, the location of the standard " +"Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " +"string." msgstr "" +"پوشه‌ی «home» پیش‌فرض را تنظیم می‌کند، یعنی مکان کتابخانه‌های استاندارد " +"پایتون. برای معنای رشته‌ی آرگومان، :envvar:`PYTHONHOME` را ببینید." -msgid "The argument should point to a zero-terminated character string in static storage whose contents will not change for the duration of the program's execution. No code in the Python interpreter will change the contents of this storage." +msgid "" +"The argument should point to a zero-terminated character string in static " +"storage whose contents will not change for the duration of the program's " +"execution. No code in the Python interpreter will change the contents of " +"this storage." msgstr "" +"آرگومان باید به یک رشته‌ی نویسه‌ای پایان‌یافته با نویسه‌ی تهی در حافظه‌ی " +"ایستا اشاره کند که محتوای آن در طول مدت اجرای برنامه تغییر نخواهد کرد. هیچ " +"کدی در مفسر پایتون محتوای این حافظه را تغییر نخواهد داد." -msgid "Return the default \"home\", that is, the value set by :c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` environment variable if it is set." +msgid "" +"Return the default \"home\", that is, the value set by " +":c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` " +"environment variable if it is set." msgstr "" +"بازگرداندن «home» پیش‌فرض، یعنی مقداری که توسط :c:member:`PyConfig.home` " +"تنظیم شده است، یا مقدار متغیر محیطی :envvar:`PYTHONHOME` در صورتی که تنظیم " +"شده باشد." -msgid "Use :c:func:`PyConfig_Get(\"home\") ` or the :envvar:`PYTHONHOME` environment variable instead." +msgid "" +"Use :c:func:`PyConfig_Get(\"home\") ` or the " +":envvar:`PYTHONHOME` environment variable instead." msgstr "" +"به‌جای آن از :c:func:`PyConfig_Get(\"home\") ` یا متغیر محیطی " +":envvar:`PYTHONHOME` استفاده کنید." msgid "PyEval_InitThreads()" -msgstr "" +msgstr "PyEval_InitThreads()" msgid "modules (in module sys)" -msgstr "" +msgstr "modules (در ماژول sys)" msgid "path (in module sys)" -msgstr "" +msgstr "path (در ماژول sys)" msgid "module" -msgstr "" +msgstr "ماژول" msgid "builtins" -msgstr "" +msgstr "توکارها" msgid "__main__" -msgstr "" +msgstr "__main__" msgid "sys" -msgstr "" +msgstr "sys" msgid "search" -msgstr "" +msgstr "جستجو" msgid "path" -msgstr "" +msgstr "مسیر" msgid "Py_FinalizeEx (C function)" -msgstr "" +msgstr "Py_FinalizeEx (تابع C)" msgid "Py_Initialize()" -msgstr "" +msgstr "Py_Initialize()" msgid "main()" -msgstr "" +msgstr "main()" msgid "Py_GetPath()" -msgstr "" +msgstr "Py_GetPath()" msgid "executable (in module sys)" -msgstr "" +msgstr "اجرایی (در ماژول sys)" msgid "version (in module sys)" -msgstr "" +msgstr "version (در ماژول sys)" msgid "platform (in module sys)" -msgstr "" +msgstr "platform (در ماژول sys)" msgid "copyright (in module sys)" -msgstr "" +msgstr "copyright (در ماژول sys)" msgid "Py_FatalError()" -msgstr "" +msgstr "Py_FatalError()" msgid "argv (in module sys)" -msgstr "" +msgstr "argv (در ماژول sys)" diff --git a/c-api/intro.po b/c-api/intro.po index 1bd1cbefe..51c317901 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -25,90 +25,245 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "The Application Programmer's Interface to Python gives C and C++ programmers access to the Python interpreter at a variety of levels. The API is equally usable from C++, but for brevity it is generally referred to as the Python/C API. There are two fundamentally different reasons for using the Python/C API. The first reason is to write *extension modules* for specific purposes; these are C modules that extend the Python interpreter. This is probably the most common use. The second reason is to use Python as a component in a larger application; this technique is generally referred to as :dfn:`embedding` Python in an application." -msgstr "" +msgid "" +"The Application Programmer's Interface to Python gives C and C++ programmers" +" access to the Python interpreter at a variety of levels. The API is " +"equally usable from C++, but for brevity it is generally referred to as the " +"Python/C API. There are two fundamentally different reasons for using the " +"Python/C API. The first reason is to write *extension modules* for specific " +"purposes; these are C modules that extend the Python interpreter. This is " +"probably the most common use. The second reason is to use Python as a " +"component in a larger application; this technique is generally referred to " +"as :dfn:`embedding` Python in an application." +msgstr "" +"رابط برنامه‌نویسی کاربردی پایتون، دسترسی به مفسر پایتون را در سطوح گوناگون " +"در اختیار برنامه‌نویسان C و C++ قرار می‌دهد. این API از C++ نیز به همان " +"اندازه قابل استفاده است، اما برای اختصار، معمولاً از آن با عنوان Python/C " +"API یاد می‌شود. دو دلیل اساساً متفاوت برای استفاده از Python/C API وجود " +"دارد. دلیل اول، نوشتن *ماژول‌های توسعه‌ای* برای مقاصد خاص است؛ این‌ها " +"ماژول‌های C هستند که مفسر پایتون را توسعه می‌دهند. این احتمالاً رایج‌ترین " +"کاربرد است. دلیل دوم، استفاده از پایتون به‌عنوان یک جزء در یک برنامه بزرگ‌تر" +" است؛ به این تکنیک عموماً :dfn:`جاسازی ` پایتون در یک برنامه گفته" +" می‌شود." -msgid "Writing an extension module is a relatively well-understood process, where a \"cookbook\" approach works well. There are several tools that automate the process to some extent. While people have embedded Python in other applications since its early existence, the process of embedding Python is less straightforward than writing an extension." -msgstr "" +msgid "" +"Writing an extension module is a relatively well-understood process, where a" +" \"cookbook\" approach works well. There are several tools that automate " +"the process to some extent. While people have embedded Python in other " +"applications since its early existence, the process of embedding Python is " +"less straightforward than writing an extension." +msgstr "" +"نوشتن یک ماژول توسعه‌ای فرایندی نسبتاً شناخته‌شده است که در آن رویکرد «کتاب " +"آشپزی» به‌خوبی کار می‌کند. چندین ابزار وجود دارند که این فرایند را تا حدی " +"خودکار می‌کنند. هرچند مردم از همان اوایل پیدایش پایتون، آن را در برنامه‌های " +"دیگر جاسازی کرده‌اند، اما فرایند جاسازی پایتون نسبت به نوشتن یک ماژول " +"توسعه‌ای کمتر سرراست است." -msgid "Many API functions are useful independent of whether you're embedding or extending Python; moreover, most applications that embed Python will need to provide a custom extension as well, so it's probably a good idea to become familiar with writing an extension before attempting to embed Python in a real application." -msgstr "" +msgid "" +"Many API functions are useful independent of whether you're embedding or " +"extending Python; moreover, most applications that embed Python will need " +"to provide a custom extension as well, so it's probably a good idea to " +"become familiar with writing an extension before attempting to embed Python" +" in a real application." +msgstr "" +"بسیاری از توابع API صرف‌نظر از اینکه در حال جاسازی کردن یا توسعه دادن پایتون" +" هستید، مفید هستند؛ علاوه بر این، بیشتر برنامه‌هایی که پایتون را جاسازی " +"می‌کنند، به ارائه یک توسعه سفارشی نیز نیاز خواهند داشت، بنابراین احتمالاً " +"ایده خوبی است که پیش از تلاش برای جاسازی پایتون در یک برنامه واقعی، با نوشتن" +" یک توسعه آشنا شوید." msgid "Language version compatibility" -msgstr "" +msgstr "سازگاری نسخه‌های زبان" msgid "Python's C API is compatible with C11 and C++11 versions of C and C++." msgstr "" +"API زبان C پایتون با نسخه‌های C11 و C++11 از زبان‌های C و C++ سازگار است." -msgid "This is a lower limit: the C API does not require features from later C/C++ versions. You do *not* need to enable your compiler's \"c11 mode\"." +msgid "" +"This is a lower limit: the C API does not require features from later C/C++ " +"versions. You do *not* need to enable your compiler's \"c11 mode\"." msgstr "" +"این یک حد پایین است: API زبان C به ویژگی‌های نسخه‌های بعدی C/C++ نیازی " +"ندارد. شما نیازی *ندارید* که حالت \"c11\" کامپایلر خود را فعال کنید." msgid "Coding standards" -msgstr "" +msgstr "استاندارد‌های کدنویسی" -msgid "If you're writing C code for inclusion in CPython, you **must** follow the guidelines and standards defined in :PEP:`7`. These guidelines apply regardless of the version of Python you are contributing to. Following these conventions is not necessary for your own third party extension modules, unless you eventually expect to contribute them to Python." -msgstr "" +msgid "" +"If you're writing C code for inclusion in CPython, you **must** follow the " +"guidelines and standards defined in :PEP:`7`. These guidelines apply " +"regardless of the version of Python you are contributing to. Following " +"these conventions is not necessary for your own third party extension " +"modules, unless you eventually expect to contribute them to Python." +msgstr "" +"اگر در حال نوشتن کد C برای گنجاندن در سی‌پایتون هستید، **باید** از " +"دستورالعمل‌ها و استانداردهای تعریف‌شده در :PEP:`7` پیروی کنید. این " +"دستورالعمل‌ها صرف‌نظر از نسخه‌ی پایتونی که در آن مشارکت می‌کنید، اعمال " +"می‌شوند. پیروی از این قراردادها برای ماژول‌های توسعه‌ای شخص ثالث خودتان " +"ضروری نیست، مگر آنکه در نهایت انتظار داشته باشید آن‌ها را به پایتون مشارکت " +"دهید." msgid "Include Files" -msgstr "" +msgstr "پرونده‌های include" -msgid "All function, type and macro definitions needed to use the Python/C API are included in your code by the following line::" +msgid "" +"All function, type and macro definitions needed to use the Python/C API are " +"included in your code by the following line::" msgstr "" +"تمام تعریف‌های تابع، نوع و ماکروی مورد نیاز برای استفاده از Python/C API، با" +" سطر زیر در کد شما گنجانده می‌شوند::" msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include " msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " -msgid "This implies inclusion of the following standard headers: ````, ````, ````, ````, ```` and ```` (if available)." +msgid "" +"This implies inclusion of the following standard headers: ````, " +"````, ````, ````, ```` and " +"```` (if available)." msgstr "" +"این به معنای گنجانده‌شدن سرآیندهای استاندارد زیر است: ````، " +"````، ````، ````، ```` و " +"```` (در صورت وجود)." -msgid "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you *must* include :file:`Python.h` before any standard headers are included." +msgid "" +"Since Python may define some pre-processor definitions which affect the " +"standard headers on some systems, you *must* include :file:`Python.h` before" +" any standard headers are included." msgstr "" +"از آنجا که پایتون ممکن است برخی تعریف‌های پیش‌پردازنده را تعریف کند که در " +"برخی سیستم‌ها بر سرآیندهای استاندارد تأثیر می‌گذارند، شما *باید* پیش از " +"گنجاندن هر سرآیند استانداردی، :file:`Python.h` را بگنجانید." -msgid "It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including ``Python.h``. See :ref:`arg-parsing` for a description of this macro." +msgid "" +"It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including " +"``Python.h``. See :ref:`arg-parsing` for a description of this macro." msgstr "" +"توصیه می‌شود که همیشه ``PY_SSIZE_T_CLEAN`` را پیش از گنجاندن (include) " +"``Python.h`` تعریف کنید. برای توضیح این ماکرو، :ref:`arg-parsing` را ببینید." -msgid "All user visible names defined by Python.h (except those defined by the included standard headers) have one of the prefixes ``Py`` or ``_Py``. Names beginning with ``_Py`` are for internal use by the Python implementation and should not be used by extension writers. Structure member names do not have a reserved prefix." -msgstr "" +msgid "" +"All user visible names defined by Python.h (except those defined by the " +"included standard headers) have one of the prefixes ``Py`` or ``_Py``. " +"Names beginning with ``_Py`` are for internal use by the Python " +"implementation and should not be used by extension writers. Structure member" +" names do not have a reserved prefix." +msgstr "" +"همه‌ی نام‌های قابل مشاهده برای کاربر که توسط Python.h تعریف شده‌اند (به‌جز " +"نام‌هایی که توسط سرآیندهای استانداردِ گنجانده‌شده تعریف شده‌اند) یکی از " +"پیشوندهای ``Py`` یا ``_Py`` را دارند. نام‌هایی که با ``_Py`` آغاز می‌شوند " +"برای استفاده‌ی داخلی پیاده‌سازی پایتون هستند و نباید توسط نویسندگان " +"ماژول‌های توسعه‌ای استفاده شوند. نام‌های اعضای ساختار پیشوند رزروشده‌ای " +"ندارند." -msgid "User code should never define names that begin with ``Py`` or ``_Py``. This confuses the reader, and jeopardizes the portability of the user code to future Python versions, which may define additional names beginning with one of these prefixes." +msgid "" +"User code should never define names that begin with ``Py`` or ``_Py``. This " +"confuses the reader, and jeopardizes the portability of the user code to " +"future Python versions, which may define additional names beginning with one" +" of these prefixes." msgstr "" +"کد کاربر هرگز نباید نام‌هایی تعریف کند که با ``Py`` یا ``_Py`` آغاز می‌شوند." +" این امر خواننده را سردرگم می‌کند و قابلیت حمل کد کاربر به نسخه‌های آینده " +"پایتون را به خطر می‌اندازد؛ چرا که این نسخه‌ها ممکن است نام‌های دیگری تعریف " +"کنند که با یکی از این پیشوندها آغاز می‌شوند." -msgid "The header files are typically installed with Python. On Unix, these are located in the directories :file:`{prefix}/include/pythonversion/` and :file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding parameters to Python's :program:`configure` script and *version* is ``'%d.%d' % sys.version_info[:2]``. On Windows, the headers are installed in :file:`{prefix}/include`, where ``prefix`` is the installation directory specified to the installer." -msgstr "" +msgid "" +"The header files are typically installed with Python. On Unix, these are " +"located in the directories :file:`{prefix}/include/pythonversion/` and " +":file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix " +"<--prefix>` and :option:`exec_prefix <--exec-prefix>` are defined by the " +"corresponding parameters to Python's :program:`configure` script and " +"*version* is ``'%d.%d' % sys.version_info[:2]``. On Windows, the headers " +"are installed in :file:`{prefix}/include`, where ``prefix`` is the " +"installation directory specified to the installer." +msgstr "" +"پرونده‌های سرآیند معمولاً همراه با پایتون نصب می‌شوند. در یونیکس، این " +"پرونده‌ها در پوشه‌های :file:`{prefix}/include/pythonversion/` و " +":file:`{exec_prefix}/include/pythonversion/` قرار دارند؛ جایی که " +":option:`prefix <--prefix>` و :option:`exec_prefix <--exec-prefix>` توسط " +"پارامترهای متناظرِ اسکریپت :program:`configure` پایتون تعریف می‌شوند و " +"*نسخه* برابر ``'%d.%d' % sys.version_info[:2]`` است. در ویندوز، سرآیندها در " +":file:`{prefix}/include` نصب می‌شوند که در آن ``prefix`` پوشه‌ی نصب مشخص‌شده" +" به نصب‌کننده است." -msgid "To include the headers, place both directories (if different) on your compiler's search path for includes. Do *not* place the parent directories on the search path and then use ``#include ``; this will break on multi-platform builds since the platform independent headers under :option:`prefix <--prefix>` include the platform specific headers from :option:`exec_prefix <--exec-prefix>`." -msgstr "" +msgid "" +"To include the headers, place both directories (if different) on your " +"compiler's search path for includes. Do *not* place the parent directories " +"on the search path and then use ``#include ``; this will" +" break on multi-platform builds since the platform independent headers under" +" :option:`prefix <--prefix>` include the platform specific headers from " +":option:`exec_prefix <--exec-prefix>`." +msgstr "" +"برای گنجاندن سرآیندها، هر دو پوشه (در صورت تفاوت) را در مسیر جستجوی کامپایلر" +" خودتان برای سرآیندها قرار دهید. پوشه‌های والد را در مسیر جستجو قرار داده و " +"سپس از ``#include `` استفاده *نکنید*؛ این کار در " +"ساخت‌های چندسکویی خراب می‌شود، زیرا سرآیندهای مستقل از سکو که در " +":option:`prefix <--prefix>` قرار دارند، سرآیندهای وابسته به سکو از " +":option:`exec_prefix <--exec-prefix>` را دربر می‌گیرند." -msgid "C++ users should note that although the API is defined entirely using C, the header files properly declare the entry points to be ``extern \"C\"``. As a result, there is no need to do anything special to use the API from C++." +msgid "" +"C++ users should note that although the API is defined entirely using C, the" +" header files properly declare the entry points to be ``extern \"C\"``. As a" +" result, there is no need to do anything special to use the API from C++." msgstr "" +"کاربران C++ باید توجه داشته باشند که اگرچه API کاملاً با استفاده از C تعریف " +"شده است، پرونده‌های سرآیند نقاط ورود را به‌درستی به‌صورت ``extern \"C\"`` " +"اعلام می‌کنند. در نتیجه، برای استفاده از API در C++ نیازی به انجام کار خاصی " +"نیست." msgid "Useful macros" -msgstr "" +msgstr "ماکروهای مفید" -msgid "Several useful macros are defined in the Python header files. Many are defined closer to where they are useful (for example, :c:macro:`Py_RETURN_NONE`, :c:macro:`PyMODINIT_FUNC`). Others of a more general utility are defined here. This is not necessarily a complete listing." +msgid "" +"Several useful macros are defined in the Python header files. Many are " +"defined closer to where they are useful (for example, " +":c:macro:`Py_RETURN_NONE`, :c:macro:`PyMODINIT_FUNC`). Others of a more " +"general utility are defined here. This is not necessarily a complete " +"listing." msgstr "" +"چندین ماکروی مفید در فایل‌های سرآیند پایتون تعریف شده‌اند. بسیاری از آن‌ها " +"نزدیک‌تر به جایی که به کار می‌آیند تعریف شده‌اند (برای مثال، " +":c:macro:`Py_RETURN_NONE` و :c:macro:`PyMODINIT_FUNC`). ماکروهای دیگر که " +"کاربرد عمومی‌تری دارند، در اینجا تعریف شده‌اند. این فهرست لزوماً کامل نیست." -msgid "If this macro is defined, then the current system is able to start threads." -msgstr "" +msgid "" +"If this macro is defined, then the current system is able to start threads." +msgstr "اگر این ماکرو تعریف‌شده باشد، سیستم فعلی می‌تواند نخ‌ها را آغاز کند." -msgid "Currently, all systems supported by CPython (per :pep:`11`), with the exception of some WebAssembly platforms, support starting threads." +msgid "" +"Currently, all systems supported by CPython (per :pep:`11`), with the " +"exception of some WebAssembly platforms, support starting threads." msgstr "" +"در حال حاضر، همه سیستم‌های پشتیبانی‌شده توسط سی‌پایتون (طبق :pep:`11`)، به " +"استثنای برخی پلتفرم‌های WebAssembly، از راه‌اندازی نخ‌ها پشتیبانی می‌کنند." -msgid "Like :samp:`getenv({s})`, but returns ``NULL`` if :option:`-E` was passed on the command line (see :c:member:`PyConfig.use_environment`)." +msgid "" +"Like :samp:`getenv({s})`, but returns ``NULL`` if :option:`-E` was passed on" +" the command line (see :c:member:`PyConfig.use_environment`)." msgstr "" +"مانند :samp:`getenv({s})`، اما اگر :option:`-E` در خط فرمان گذرانده شده " +"باشد، ``NULL`` برمی‌گرداند (نگاه کنید به " +":c:member:`PyConfig.use_environment`)." msgid "Docstring macros" -msgstr "" +msgstr "ماکروهای رشته مستند" -msgid "Creates a variable with name *name* that can be used in docstrings. If Python is built without docstrings (:option:`--without-doc-strings`), the value will be an empty string." +msgid "" +"Creates a variable with name *name* that can be used in docstrings. If " +"Python is built without docstrings (:option:`--without-doc-strings`), the " +"value will be an empty string." msgstr "" +"یک متغیر با نام *name* ایجاد می‌کند که می‌توان از آن در رشته‌های مستند " +"استفاده کرد. اگر پایتون بدون رشته‌های مستند ساخته شود (:option:`--without-" +"doc-strings`)، مقدار آن یک رشته خالی خواهد بود." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" @@ -119,12 +274,23 @@ msgid "" " // ...\n" "}" msgstr "" +"PyDoc_STRVAR(pop_doc, \"راست‌ترین عنصر را حذف کرده و برمی‌گرداند.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" msgid "Expands to :samp:`PyDoc_VAR({name}) = PyDoc_STR({str})`." -msgstr "" +msgstr "به :samp:`PyDoc_VAR({name}) = PyDoc_STR({str})` بسط می‌یابد." -msgid "Expands to the given input string, or an empty string if docstrings are disabled (:option:`--without-doc-strings`)." +msgid "" +"Expands to the given input string, or an empty string if docstrings are " +"disabled (:option:`--without-doc-strings`)." msgstr "" +"به رشته ورودی داده‌شده بسط می‌یابد، یا اگر رشته‌های مستند غیرفعال باشند " +"(:option:`--without-doc-strings`)، به رشته خالی." msgid "" "static PyMethodDef pysqlite_row_methods[] = {\n" @@ -133,302 +299,770 @@ msgid "" " {NULL, NULL}\n" "};" msgstr "" +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Returns the keys of the row.\")},\n" +" {NULL, NULL}\n" +"};" -msgid "Declares a static character array variable with the given *name*. Expands to :samp:`static const char {name}[]`" +msgid "" +"Declares a static character array variable with the given *name*. Expands to" +" :samp:`static const char {name}[]`" msgstr "" +"یک متغیر آرایه‌ی نویسه‌ای ایستا با *نام* داده‌شده اعلان می‌کند. به " +":samp:`static const char {name}[]` بسط می‌یابد" msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "PyDoc_VAR(python_doc) = PyDoc_STR(\n" " \"A genus of constricting snakes in the Pythonidae family native \"\n" " \"to the tropics and subtropics of the Eastern Hemisphere.\");" msgstr "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\n" +" \"سرده‌ای از مارهای فشارنده در خانواده‌ی Pythonidae بومی \"\n" +" \"مناطق حاره و نیمه‌حاره‌ی نیم‌کره شرقی.\");" msgid "General utility macros" -msgstr "" +msgstr "ماکروهای کاربردی عمومی" msgid "The following macros are for common tasks not specific to Python." -msgstr "" +msgstr "ماکروهای زیر برای کارهای رایجی هستند که مخصوص پایتون نیستند." -msgid "Use this for unused arguments in a function definition to silence compiler warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." +msgid "" +"Use this for unused arguments in a function definition to silence compiler " +"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." msgstr "" +"از این برای آرگومان‌های استفاده‌نشده در تعریف تابع استفاده کنید تا هشدارهای " +"کامپایلر سرکوب شوند. مثال: ``int func(int a, int Py_UNUSED(b)) { return a; " +"}``." -msgid "Use a GCC attribute *name*, hiding it from compilers that don't support GCC attributes (such as MSVC)." +msgid "" +"Use a GCC attribute *name*, hiding it from compilers that don't support GCC " +"attributes (such as MSVC)." msgstr "" +"از صفت GCC با نام *name* استفاده کنید تا از کامپایلرهایی که صفات GCC را " +"پشتیبانی نمی‌کنند (مانند MSVC) پنهان بماند." -msgid "This expands to :samp:`__attribute__(({name)})` on a GCC compiler, and expands to nothing on compilers that don't support GCC attributes." +msgid "" +"This expands to :samp:`__attribute__(({name)})` on a GCC compiler, and " +"expands to nothing on compilers that don't support GCC attributes." msgstr "" +"این در کامپایلر GCC به :samp:`__attribute__(({name)})` بسط می‌یابد و در " +"کامپایلرهایی که از ویژگی‌های GCC پشتیبانی نمی‌کنند، به هیچ‌چیز بسط نمی‌یابد." msgid "Numeric utilities" -msgstr "" +msgstr "ابزارهای عددی" msgid "Return the absolute value of ``x``." -msgstr "" +msgstr "مقدار مطلق ``x`` را برمی‌گرداند." -msgid "The argument may be evaluated more than once. Consequently, do not pass an expression with side-effects directly to this macro." +msgid "" +"The argument may be evaluated more than once. Consequently, do not pass an " +"expression with side-effects directly to this macro." msgstr "" +"آرگومان ممکن است بیش از یک بار ارزیابی شود. در نتیجه، عبارتی با اثر جانبی را" +" مستقیماً به این ماکرو ندهید." -msgid "If the result cannot be represented (for example, if ``x`` has :c:macro:`!INT_MIN` value for :c:expr:`int` type), the behavior is undefined." +msgid "" +"If the result cannot be represented (for example, if ``x`` has " +":c:macro:`!INT_MIN` value for :c:expr:`int` type), the behavior is " +"undefined." msgstr "" +"اگر نتوان نتیجه را نمایش داد (برای مثال، اگر ``x`` برای نوع :c:expr:`int` " +"مقدار :c:macro:`!INT_MIN` داشته باشد)، رفتار تعریف‌نشده است." msgid "Corresponds roughly to :samp:`(({x}) < 0 ? -({x}) : ({x}))`" -msgstr "" +msgstr "تقریباً معادل :samp:`(({x}) < 0 ? -({x}) : ({x}))` است" msgid "Return the larger or smaller of the arguments, respectively." -msgstr "" +msgstr "بازگرداندن بزرگ‌تر یا کوچک‌تر آرگومان‌ها، به ترتیب." -msgid "Any arguments may be evaluated more than once. Consequently, do not pass an expression with side-effects directly to this macro." +msgid "" +"Any arguments may be evaluated more than once. Consequently, do not pass an " +"expression with side-effects directly to this macro." msgstr "" +"ممکن است هر یک از آرگومان‌ها بیش از یک بار ارزیابی شود. در نتیجه، عبارتی با " +"اثرات جانبی را مستقیماً به این ماکرو پاس ندهید." -msgid ":c:macro:`!Py_MAX` corresponds roughly to :samp:`((({x}) > ({y})) ? ({x}) : ({y}))`." +msgid "" +":c:macro:`!Py_MAX` corresponds roughly to :samp:`((({x}) > ({y})) ? ({x}) : " +"({y}))`." msgstr "" +":c:macro:`!Py_MAX` تقریباً معادل :samp:`((({x}) > ({y})) ? ({x}) : ({y}))` " +"است." -msgid "Similar to :samp:`{integer} >> {positions}`, but forces sign extension, as the C standard does not define whether a right-shift of a signed integer will perform sign extension or a zero-fill." +msgid "" +"Similar to :samp:`{integer} >> {positions}`, but forces sign extension, as " +"the C standard does not define whether a right-shift of a signed integer " +"will perform sign extension or a zero-fill." msgstr "" +"مشابه :samp:`{integer} >> {positions}` است، اما گسترش علامت را اجباری " +"می‌کند، زیرا استاندارد C تعریف نمی‌کند که آیا شیفت به راست یک عدد صحیح " +"علامت‌دار، گسترش علامت انجام می‌دهد یا با صفر پر می‌کند." -msgid "*integer* should be any signed integer type. *positions* is the number of positions to shift to the right." +msgid "" +"*integer* should be any signed integer type. *positions* is the number of " +"positions to shift to the right." msgstr "" +"*integer* می‌تواند از هر نوع عدد صحیح علامت‌دار باشد. *positions* تعداد " +"جایگاه‌هایی است که باید به سمت راست شیفت شوند." -msgid "Both *integer* and *positions* can be evaluated more than once; consequently, avoid directly passing a function call or some other operation with side-effects to this macro. Instead, store the result as a variable and then pass it." +msgid "" +"Both *integer* and *positions* can be evaluated more than once; " +"consequently, avoid directly passing a function call or some other operation" +" with side-effects to this macro. Instead, store the result as a variable " +"and then pass it." msgstr "" +"هر دو *integer* و *positions* ممکن است بیش از یک بار ارزیابی شوند؛ در نتیجه،" +" از عبور دادن مستقیم یک فراخوانی تابع یا هر عملیات دیگری با عوارض جانبی به " +"این ماکرو خودداری کنید. در عوض، نتیجه را در یک متغیر ذخیره کنید و سپس آن را " +"عبور دهید." -msgid "*type* is unused and only kept for backwards compatibility. Historically, *type* was used to cast *integer*." +msgid "" +"*type* is unused and only kept for backwards compatibility. Historically, " +"*type* was used to cast *integer*." msgstr "" +"*type* استفاده نمی‌شود و تنها برای سازگاری با نسخه‌های پیشین نگه داشته شده " +"است. در گذشته، *type* برای تبدیل نوع *integer* استفاده می‌شد." -msgid "This macro is now valid for all signed integer types, not just those for which ``unsigned type`` is legal. As a result, *type* is no longer used." +msgid "" +"This macro is now valid for all signed integer types, not just those for " +"which ``unsigned type`` is legal. As a result, *type* is no longer used." msgstr "" +"این ماکرو اکنون برای همه‌ی نوع‌های عدد صحیح علامت‌دار معتبر است، نه فقط برای" +" نوع‌هایی که ``unsigned type`` برایشان مجاز است. در نتیجه، *type* دیگر " +"استفاده نمی‌شود." -msgid "Argument must be a character or an integer in the range [-128, 127] or [0, 255]. This macro returns ``c`` cast to an ``unsigned char``." +msgid "" +"Argument must be a character or an integer in the range [-128, 127] or [0, " +"255]. This macro returns ``c`` cast to an ``unsigned char``." msgstr "" +"آرگومان باید یک نویسه یا یک عدد صحیح در محدوده‌ی [-128, 127] یا [0, 255] " +"باشد. این ماکرو ``c`` را پس از تبدیل نوع به ``unsigned char`` برمی‌گرداند." msgid "Assertion utilities" -msgstr "" +msgstr "ابزارهای ادعا" -msgid "Use this when you have a code path that cannot be reached by design. For example, in the ``default:`` clause in a ``switch`` statement for which all possible values are covered in ``case`` statements. Use this in places where you might be tempted to put an ``assert(0)`` or ``abort()`` call." +msgid "" +"Use this when you have a code path that cannot be reached by design. For " +"example, in the ``default:`` clause in a ``switch`` statement for which all " +"possible values are covered in ``case`` statements. Use this in places " +"where you might be tempted to put an ``assert(0)`` or ``abort()`` call." msgstr "" +"از این زمانی استفاده کنید که مسیر کدی دارید که بر اساس طراحی هرگز نمی‌توان " +"به آن رسید. برای مثال، در بند ``default:`` در یک دستور ``switch`` که تمام " +"مقادیر ممکن آن در دستورهای ``case`` پوشش داده شده‌اند. از این در جاهایی " +"استفاده کنید که ممکن است وسوسه شوید که فراخوانی ``assert(0)`` یا ``abort()``" +" قرار دهید." -msgid "In release mode, the macro helps the compiler to optimize the code, and avoids a warning about unreachable code. For example, the macro is implemented with ``__builtin_unreachable()`` on GCC in release mode." +msgid "" +"In release mode, the macro helps the compiler to optimize the code, and " +"avoids a warning about unreachable code. For example, the macro is " +"implemented with ``__builtin_unreachable()`` on GCC in release mode." msgstr "" +"در حالت انتشار (release)، این ماکرو به کامپایلر کمک می‌کند تا کد را " +"بهینه‌سازی کند و از هشدار درباره‌ی کد غیرقابل‌دسترسی جلوگیری می‌کند. برای " +"مثال، این ماکرو در حالت انتشار (release) روی GCC با " +"``__builtin_unreachable()`` پیاده‌سازی شده است." -msgid "In debug mode, and on unsupported compilers, the macro expands to a call to :c:func:`Py_FatalError`." +msgid "" +"In debug mode, and on unsupported compilers, the macro expands to a call to " +":c:func:`Py_FatalError`." msgstr "" +"در حالت اشکال‌زدایی و روی کامپایلرهای پشتیبانی‌نشده، ماکرو به فراخوانی " +":c:func:`Py_FatalError` بسط می‌یابد." -msgid "A use for ``Py_UNREACHABLE()`` is following a call to a function that never returns but that is not declared ``_Noreturn``." +msgid "" +"A use for ``Py_UNREACHABLE()`` is following a call to a function that never " +"returns but that is not declared ``_Noreturn``." msgstr "" +"یکی از کاربردهای ``Py_UNREACHABLE()`` استفاده از آن پس از فراخوانی تابعی است" +" که هرگز باز نمی‌گردد اما با ``_Noreturn`` اعلان نشده است." -msgid "If a code path is very unlikely code but can be reached under exceptional case, this macro must not be used. For example, under low memory condition or if a system call returns a value out of the expected range. In this case, it's better to report the error to the caller. If the error cannot be reported to caller, :c:func:`Py_FatalError` can be used." -msgstr "" +msgid "" +"If a code path is very unlikely code but can be reached under exceptional " +"case, this macro must not be used. For example, under low memory condition " +"or if a system call returns a value out of the expected range. In this " +"case, it's better to report the error to the caller. If the error cannot be" +" reported to caller, :c:func:`Py_FatalError` can be used." +msgstr "" +"اگر مسیری از کد بسیار نامحتمل باشد اما در حالت‌های استثنایی بتوان به آن " +"رسید، نباید از این ماکرو استفاده کرد. برای مثال، در وضعیت کمبود حافظه یا " +"زمانی که یک فراخوانی سیستمی مقداری خارج از محدوده‌ی مورد انتظار برمی‌گرداند." +" در این حالت، بهتر است خطا به فراخواننده گزارش شود. اگر نتوان خطا را به " +"فراخواننده گزارش داد، می‌توان از :c:func:`Py_FatalError` استفاده کرد." -msgid "Cast *value* to type *smaller* from type *larger*, validating that no information was lost." +msgid "" +"Cast *value* to type *smaller* from type *larger*, validating that no " +"information was lost." msgstr "" +"*value* را از نوع *larger* به نوع *smaller* قالب‌ریزی می‌کند و اعتبارسنجی " +"می‌کند که هیچ اطلاعاتی از دست نرفته باشد." -msgid "On release builds of Python, this is roughly equivalent to :samp:`(({smaller}) {value})` (in C++, :samp:`static_cast<{smaller}>({value})` will be used instead)." +msgid "" +"On release builds of Python, this is roughly equivalent to " +":samp:`(({smaller}) {value})` (in C++, " +":samp:`static_cast<{smaller}>({value})` will be used instead)." msgstr "" +"در ساخت‌های انتشار (release) پایتون، این تقریباً معادل :samp:`(({smaller}) " +"{value})` است (در C++، به‌جای آن از :samp:`static_cast<{smaller}>({value})` " +"استفاده می‌شود)." -msgid "On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts that no information was lost with the cast from *larger* to *smaller*." +msgid "" +"On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts" +" that no information was lost with the cast from *larger* to *smaller*." msgstr "" +"در بیلدهای اشکال‌زدایی (به این معنا که :c:macro:`Py_DEBUG` تعریف شده است)، " +"این ادعا می‌کند که با تبدیل نوع از *بزرگ‌تر* به *کوچک‌تر*، هیچ اطلاعاتی از " +"دست نرفته است." -msgid "*value*, *larger*, and *smaller* may all be evaluated more than once in the expression; consequently, do not pass an expression with side-effects directly to this macro." +msgid "" +"*value*, *larger*, and *smaller* may all be evaluated more than once in the " +"expression; consequently, do not pass an expression with side-effects " +"directly to this macro." msgstr "" +"*value*، *larger* و *smaller* ممکن است هر سه بیش از یک بار در عبارت ارزیابی " +"شوند؛ در نتیجه، عبارتی با عوارض جانبی را مستقیماً به این ماکرو نگذرانید." -msgid "Asserts a compile-time condition *cond*, as a statement. The build will fail if the condition is false or cannot be evaluated at compile time." +msgid "" +"Asserts a compile-time condition *cond*, as a statement. The build will fail" +" if the condition is false or cannot be evaluated at compile time." msgstr "" +"یک شرط زمان کامپایل *cond* را به‌صورت یک دستور ادعا می‌کند. اگر شرط نادرست " +"باشد یا نتوان آن را در زمان کامپایل ارزیابی کرد، ساخت با شکست مواجه خواهد " +"شد." msgid "Corresponds roughly to :samp:`static_assert({cond})` on C23 and above." -msgstr "" +msgstr "تقریباً معادل :samp:`static_assert({cond})` در C23 و بالاتر است." msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" -msgstr "" +msgstr "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" -msgid "Asserts a compile-time condition *cond*, as an expression that evaluates to ``0``. The build will fail if the condition is false or cannot be evaluated at compile time." +msgid "" +"Asserts a compile-time condition *cond*, as an expression that evaluates to " +"``0``. The build will fail if the condition is false or cannot be evaluated " +"at compile time." msgstr "" +"یک شرط زمان کامپایل *cond* را به‌عنوان عبارتی که به ``0`` ارزیابی می‌شود، " +"ادعا می‌کند. اگر شرط نادرست باشد یا نتوان آن را در زمان کامپایل ارزیابی کرد،" +" ساخت (build) شکست می‌خورد." msgid "" "#define foo_to_char(foo) \\\n" " ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" msgstr "" +"#define foo_to_char(foo) \\\n" +" ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" msgid "Type size utilities" -msgstr "" +msgstr "ابزارهای اندازه‌ی نوع" msgid "Compute the length of a statically allocated C array at compile time." -msgstr "" +msgstr "طول یک آرایه‌ی C با تخصیص ایستا را در زمان کامپایل محاسبه می‌کند." -msgid "The *array* argument must be a C array with a size known at compile time. Passing an array with an unknown size, such as a heap-allocated array, will result in a compilation error on some compilers, or otherwise produce incorrect results." +msgid "" +"The *array* argument must be a C array with a size known at compile time. " +"Passing an array with an unknown size, such as a heap-allocated array, will " +"result in a compilation error on some compilers, or otherwise produce " +"incorrect results." msgstr "" +"آرگومان *array* باید یک آرایه‌ی C با اندازه‌ی معلوم در زمان کامپایل باشد. " +"پاس دادن آرایه‌ای با اندازه‌ی نامعلوم، مانند آرایه‌ی تخصیص‌یافته در هیپ، در " +"برخی کامپایلر‌ها منجر به خطای کامپایل می‌شود یا در غیر این صورت، نتایج " +"نادرستی تولید می‌کند." msgid "This is roughly equivalent to::" -msgstr "" +msgstr "این تقریباً معادل است با::" msgid "sizeof(array) / sizeof((array)[0])" -msgstr "" +msgstr "sizeof(array) / sizeof((array)[0])" msgid "Return the size of a structure (*type*) *member* in bytes." -msgstr "" +msgstr "اندازه‌ی یک *عضو* ساختار (*نوع*) را به بایت برمی‌گرداند." msgid "Corresponds roughly to :samp:`sizeof((({type} *)NULL)->{member})`." -msgstr "" +msgstr "تقریباً معادل :samp:`sizeof((({type} *)NULL)->{member})` است." msgid "Macro definition utilities" -msgstr "" +msgstr "ابزارهای تعریف ماکرو" -msgid "This is equivalent to :samp:`{X}`, which is useful for token-pasting in macros, as macro expansions in *X* are forcefully evaluated by the preprocessor." +msgid "" +"This is equivalent to :samp:`{X}`, which is useful for token-pasting in " +"macros, as macro expansions in *X* are forcefully evaluated by the " +"preprocessor." msgstr "" +"این معادل :samp:`{X}` است که برای چسباندن توکن‌ها (token-pasting) در ماکروها" +" مفید است، زیرا بسط‌های ماکرو در *X* به‌اجبار توسط پیش‌پردازنده ارزیابی " +"می‌شوند." -msgid "Convert ``x`` to a C string. For example, ``Py_STRINGIFY(123)`` returns ``\"123\"``." +msgid "" +"Convert ``x`` to a C string. For example, ``Py_STRINGIFY(123)`` returns " +"``\"123\"``." msgstr "" +"تبدیل ``x`` به یک رشته‌ی C. برای مثال، ``Py_STRINGIFY(123)`` مقدار " +"``\"123\"`` را برمی‌گرداند." msgid "Declaration utilities" -msgstr "" +msgstr "ابزارهای اعلان" -msgid "The following macros can be used in declarations. They are most useful for defining the C API itself, and have limited use for extension authors. Most of them expand to compiler-specific spellings of common extensions to the C language." +msgid "" +"The following macros can be used in declarations. They are most useful for " +"defining the C API itself, and have limited use for extension authors. Most " +"of them expand to compiler-specific spellings of common extensions to the C " +"language." msgstr "" +"از ماکروهای زیر می‌توان در اعلان‌ها استفاده کرد. این ماکروها بیشترین کاربرد " +"را در تعریف خودِ C API دارند و برای نویسندگان ماژول‌های توسعه‌ای کاربرد " +"محدودی دارند. بیشتر آن‌ها به نوشتارهای مخصوص کامپایلر برای توسعه‌های رایج " +"زبان C بسط می‌یابند." -msgid "Ask the compiler to always inline a static inline function. The compiler can ignore it and decide to not inline the function." +msgid "" +"Ask the compiler to always inline a static inline function. The compiler can" +" ignore it and decide to not inline the function." msgstr "" +"از کامپایلر می‌خواهد که یک تابع ایستای درون‌خطی (static inline) را همیشه " +"درون‌خطی کند. کامپایلر می‌تواند آن را نادیده بگیرد و تصمیم بگیرد که تابع را " +"درون‌خطی نکند." -msgid "Corresponds to ``always_inline`` attribute in GCC and ``__forceinline`` in MSVC." -msgstr "" +msgid "" +"Corresponds to ``always_inline`` attribute in GCC and ``__forceinline`` in " +"MSVC." +msgstr "معادل ویژگی ``always_inline`` در GCC و ``__forceinline`` در MSVC است." -msgid "It can be used to inline performance critical static inline functions when building Python in debug mode with function inlining disabled. For example, MSC disables function inlining when building in debug mode." +msgid "" +"It can be used to inline performance critical static inline functions when " +"building Python in debug mode with function inlining disabled. For example, " +"MSC disables function inlining when building in debug mode." msgstr "" +"از آن می‌توان برای درون‌خطی کردن توابع static inline حیاتی از نظر کارایی " +"استفاده کرد، زمانی که پایتون در حالت اشکال‌زدایی و با درون‌خطی‌سازی توابع " +"غیرفعال ساخته می‌شود. برای مثال، MSC هنگام ساخت در حالت اشکال‌زدایی، " +"درون‌خطی‌سازی توابع را غیرفعال می‌کند." -msgid "Marking blindly a static inline function with Py_ALWAYS_INLINE can result in worse performances (due to increased code size for example). The compiler is usually smarter than the developer for the cost/benefit analysis." +msgid "" +"Marking blindly a static inline function with Py_ALWAYS_INLINE can result in" +" worse performances (due to increased code size for example). The compiler " +"is usually smarter than the developer for the cost/benefit analysis." msgstr "" +"علامت‌گذاری کورکورانه‌ی یک تابع ایستای درون‌خطی (static inline) با " +"Py_ALWAYS_INLINE می‌تواند به عملکرد بدتری منجر شود (برای مثال، به دلیل " +"افزایش حجم کد). کامپایلر معمولاً در تحلیل هزینه/فایده از توسعه‌دهنده " +"هوشمندتر است." -msgid "If Python is :ref:`built in debug mode ` (if the :c:macro:`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing." +msgid "" +"If Python is :ref:`built in debug mode ` (if the " +":c:macro:`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro" +" does nothing." msgstr "" +"اگر پایتون :ref:`در حالت اشکال‌زدایی ساخته‌شده باشد ` (اگر " +"ماکروی :c:macro:`Py_DEBUG` تعریف‌شده باشد)، ماکروی " +":c:macro:`Py_ALWAYS_INLINE` هیچ کاری انجام نمی‌دهد." msgid "It must be specified before the function return type. Usage::" -msgstr "" +msgstr "آن باید پیش از نوع بازگشتی تابع مشخص شود. کاربرد::" msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -msgstr "" +msgstr "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -msgid "Disable inlining on a function. For example, it reduces the C stack consumption: useful on LTO+PGO builds which heavily inline code (see :issue:`33720`)." +msgid "" +"Disable inlining on a function. For example, it reduces the C stack " +"consumption: useful on LTO+PGO builds which heavily inline code (see " +":issue:`33720`)." msgstr "" +"درون‌خطی‌سازی (inlining) را روی یک تابع غیرفعال می‌کند. برای مثال، مصرف " +"پشته‌ی C را کاهش می‌دهد: در بیلدهای LTO+PGO که کد را به‌شدت درون‌خطی " +"می‌کنند، مفید است (نگاه کنید به :issue:`33720`)." -msgid "Corresponds to the ``noinline`` attribute/specification on GCC and MSVC." -msgstr "" +msgid "" +"Corresponds to the ``noinline`` attribute/specification on GCC and MSVC." +msgstr "معادل ویژگی/مشخصه‌ی ``noinline`` در GCC و MSVC است." msgid "Usage::" -msgstr "" +msgstr "کاربرد::" msgid "Py_NO_INLINE static int random(void) { return 4; }" -msgstr "" +msgstr "Py_NO_INLINE static int random(void) { return 4; }" -msgid "Use this to declare APIs that were deprecated in a specific CPython version. The macro must be placed before the symbol name." +msgid "" +"Use this to declare APIs that were deprecated in a specific CPython version." +" The macro must be placed before the symbol name." msgstr "" +"از این برای اعلام APIهایی که در نسخه‌ی مشخصی از سی‌پایتون منسوخ شده‌اند، " +"استفاده کنید. ماکرو باید پیش از نام نماد قرار گیرد." msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" -msgstr "" +msgstr "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" msgid "MSVC support was added." -msgstr "" +msgstr "پشتیبانی از MSVC اضافه شد." -msgid "Declare a function returning the specified *type* using a fast-calling qualifier for functions that are local to the current file. Semantically, this is equivalent to :samp:`static {type}`." +msgid "" +"Declare a function returning the specified *type* using a fast-calling " +"qualifier for functions that are local to the current file. Semantically, " +"this is equivalent to :samp:`static {type}`." msgstr "" +"برای توابعی که محلی به پرونده جاری هستند، تابعی را که *نوع* مشخص‌شده را " +"برمی‌گرداند، با استفاده از مشخص‌کننده فراخوانی سریع (fast-calling qualifier)" +" اعلان می‌کند. از نظر معنایی، این معادل :samp:`static {type}` است." -msgid "Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be inlined." +msgid "" +"Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be " +"inlined." msgstr "" +"معادل :c:macro:`Py_LOCAL` است، اما علاوه بر آن درخواست می‌کند که تابع " +"به‌صورت درون‌خطی (inline) شود." -msgid "Macro used to declare a symbol as local to the shared library (hidden). On supported platforms, it ensures the symbol is not exported." +msgid "" +"Macro used to declare a symbol as local to the shared library (hidden). On " +"supported platforms, it ensures the symbol is not exported." msgstr "" +"ماکرویی که برای اعلام نماد به‌عنوان محلیِ کتابخانه اشتراکی (مخفی) استفاده " +"می‌شود. در پلتفرم‌های پشتیبانی‌شده، تضمین می‌کند که نماد صادر نشود." -msgid "On compatible versions of GCC/Clang, it expands to ``__attribute__((visibility(\"hidden\")))``." +msgid "" +"On compatible versions of GCC/Clang, it expands to " +"``__attribute__((visibility(\"hidden\")))``." msgstr "" +"در نسخه‌های سازگار GCC/Clang، این به " +"``__attribute__((visibility(\"hidden\")))`` بسط می‌یابد." -msgid "Macro used to declare a symbol (function or data) as exported. On Windows, this expands to ``__declspec(dllexport)``. On compatible versions of GCC/Clang, it expands to ``__attribute__((visibility(\"default\")))``. This macro is for defining the C API itself; extension modules should not use it." +msgid "" +"Macro used to declare a symbol (function or data) as exported. On Windows, " +"this expands to ``__declspec(dllexport)``. On compatible versions of " +"GCC/Clang, it expands to ``__attribute__((visibility(\"default\")))``. This " +"macro is for defining the C API itself; extension modules should not use it." msgstr "" +"ماکرویی که برای اعلام یک نماد (تابع یا داده) به‌عنوان صادرشده به کار می‌رود." +" در ویندوز، این ماکرو به ``__declspec(dllexport)`` بسط می‌یابد. در نسخه‌های " +"سازگار GCC/Clang، به ``__attribute__((visibility(\"default\")))`` بسط " +"می‌یابد. این ماکرو برای تعریف خودِ C API است؛ ماژول‌های توسعه‌ای نباید از آن" +" استفاده کنند." -msgid "Macro used to declare a symbol as imported. On Windows, this expands to ``__declspec(dllimport)``. This macro is for defining the C API itself; extension modules should not use it." +msgid "" +"Macro used to declare a symbol as imported. On Windows, this expands to " +"``__declspec(dllimport)``. This macro is for defining the C API itself; " +"extension modules should not use it." msgstr "" +"ماکرویی که برای اعلام یک نماد به‌عنوان ایمپورت‌شده به کار می‌رود. در ویندوز،" +" این ماکرو به ``__declspec(dllimport)`` بسط می‌یابد. این ماکرو برای تعریف " +"خودِ C API است؛ ماژول‌های توسعه‌ای نباید از آن استفاده کنند." -msgid "Macro used by CPython to declare a function as part of the C API. Its expansion depends on the platform and build configuration. This macro is intended for defining CPython's C API itself; extension modules should not use it for their own symbols." +msgid "" +"Macro used by CPython to declare a function as part of the C API. Its " +"expansion depends on the platform and build configuration. This macro is " +"intended for defining CPython's C API itself; extension modules should not " +"use it for their own symbols." msgstr "" +"ماکرویی که توسط سی‌پایتون برای اعلان یک تابع به‌عنوان بخشی از C API استفاده " +"می‌شود. بسط آن به پلتفرم و پیکربندی ساخت بستگی دارد. این ماکرو برای تعریف " +"خودِ C API سی‌پایتون در نظر گرفته‌شده است؛ ماژول‌های توسعه‌ای نباید از آن " +"برای نمادهای خودشان استفاده کنند." -msgid "Macro used by CPython to declare a public global variable as part of the C API. Its expansion depends on the platform and build configuration. This macro is intended for defining CPython's C API itself; extension modules should not use it for their own symbols." +msgid "" +"Macro used by CPython to declare a public global variable as part of the C " +"API. Its expansion depends on the platform and build configuration. This " +"macro is intended for defining CPython's C API itself; extension modules " +"should not use it for their own symbols." msgstr "" +"ماکرویی که توسط سی‌پایتون برای اعلان یک متغیر سراسری عمومی به‌عنوان بخشی از " +"C API استفاده می‌شود. بسط آن به پلتفرم و پیکربندی ساخت بستگی دارد. این ماکرو" +" برای تعریف خودِ C API سی‌پایتون در نظر گرفته شده است؛ ماژول‌های توسعه‌ای " +"نباید از آن برای نمادهای خودشان استفاده کنند." msgid "Outdated macros" -msgstr "" +msgstr "ماکروهای منسوخ" -msgid "The following macros have been used to features that have been standardized in C11." +msgid "" +"The following macros have been used to features that have been standardized " +"in C11." msgstr "" +"از ماکروهای زیر برای ویژگی‌هایی که در C11 استاندارد شده‌اند استفاده شده است." msgid "Specify alignment to *num* bytes on compilers that support it." msgstr "" +"در کامپایلرهایی که از آن پشتیبانی می‌کنند، هم‌ترازی را به *num* بایت مشخص " +"کنید." -msgid "Consider using the C11 standard ``_Alignas`` specifier over this macro." +msgid "" +"Consider using the C11 standard ``_Alignas`` specifier over this macro." msgstr "" +"استفاده از مشخص‌کننده‌ی ``_Alignas`` استاندارد C11 را به جای این ماکرو در " +"نظر بگیرید." -msgid "Use *number* as a ``long long`` or ``unsigned long long`` integer literal, respectively." +msgid "" +"Use *number* as a ``long long`` or ``unsigned long long`` integer literal, " +"respectively." msgstr "" +"از *number* به ترتیب به عنوان لفظی عدد صحیح ``long long`` یا ``unsigned long" +" long`` استفاده کنید." -msgid "Expands to *number* followed by ``LL`` or ``LLU``, respectively, but will expand to some compiler-specific suffixes on some older compilers." +msgid "" +"Expands to *number* followed by ``LL`` or ``LLU``, respectively, but will " +"expand to some compiler-specific suffixes on some older compilers." msgstr "" +"به *number* و به ترتیب پس از آن ``LL`` یا ``LLU`` گسترش می‌یابد، اما در برخی" +" کامپایلرهای قدیمی‌تر به برخی پسوندهای خاص کامپایلر گسترش می‌یابد." msgid "Consider using the C99 standard suffixes ``LL`` and ``LLU`` directly." msgstr "" +"در نظر بگیرید که مستقیماً از پسوندهای استاندارد C99 یعنی ``LL`` و ``LLU`` " +"استفاده کنید." msgid "This is an alias to :c:func:`!memcpy`." -msgstr "" +msgstr "این یک نام مستعار برای :c:func:`!memcpy` است." msgid "Use :c:func:`!memcpy` directly instead." -msgstr "" +msgstr "به‌جای آن، مستقیماً از :c:func:`!memcpy` استفاده کنید." msgid "This is an alias to the C99-standard ``va_copy`` function." -msgstr "" +msgstr "این یک نام‌مستعار برای تابع ``va_copy`` مطابق با استاندارد C99 است." -msgid "Historically, this would use a compiler-specific method to copy a ``va_list``." +msgid "" +"Historically, this would use a compiler-specific method to copy a " +"``va_list``." msgstr "" +"از نظر تاریخی، این کار از روشی وابسته به کامپایلر برای کپی کردن ``va_list`` " +"استفاده می‌کرد." msgid "This is now an alias to ``va_copy``." -msgstr "" +msgstr "این اکنون یک نام مستعار برای ``va_copy`` است." msgid "Objects, Types and Reference Counts" -msgstr "" +msgstr "شیءها، نوع‌ها و شمارش ارجاع" -msgid "Most Python/C API functions have one or more arguments as well as a return value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type representing an arbitrary Python object. Since all Python object types are treated the same way by the Python language in most situations (e.g., assignments, scope rules, and argument passing), it is only fitting that they should be represented by a single C type. Almost all Python objects live on the heap: you never declare an automatic or static variable of type :c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can be declared. The sole exception are the type objects; since these must never be deallocated, they are typically static :c:type:`PyTypeObject` objects." -msgstr "" +msgid "" +"Most Python/C API functions have one or more arguments as well as a return " +"value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data" +" type representing an arbitrary Python object. Since all Python object " +"types are treated the same way by the Python language in most situations " +"(e.g., assignments, scope rules, and argument passing), it is only fitting " +"that they should be represented by a single C type. Almost all Python " +"objects live on the heap: you never declare an automatic or static variable " +"of type :c:type:`PyObject`, only pointer variables of type " +":c:expr:`PyObject*` can be declared. The sole exception are the type " +"objects; since these must never be deallocated, they are typically static " +":c:type:`PyTypeObject` objects." +msgstr "" +"بیشتر توابع Python/C API یک یا چند آرگومان و همچنین مقدار بازگشتی‌ای از نوع " +":c:expr:`PyObject*` دارند. این نوع، اشاره‌گر به یک نوع داده‌ی مبهم است که " +"نمایانگر یک شیء پایتونی دلخواه است. از آنجا که زبان پایتون در بیشتر " +"موقعیت‌ها (مانند انتساب‌ها، قواعد محدوده و ارسال آرگومان) با همه‌ی نوع‌های " +"شیء پایتون به یک شکل رفتار می‌کند، بجاست که همه‌ی آن‌ها با یک نوع C واحد " +"نمایش داده شوند. تقریباً همه‌ی اشیای پایتون روی هیپ قرار دارند: شما هرگز " +"متغیر خودکار یا ایستایی از نوع :c:type:`PyObject` تعریف نمی‌کنید؛ تنها " +"متغیرهای اشاره‌گر از نوع :c:expr:`PyObject*` را می‌توان تعریف کرد. تنها " +"استثنا اشیای نوع هستند؛ از آنجا که این اشیا هرگز نباید آزادسازی شوند، " +"معمولاً اشیای ایستای :c:type:`PyTypeObject` هستند." -msgid "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:`reference count`. An object's type determines what kind of object it is (e.g., an integer, a list, or a user-defined function; there are many more as explained in :ref:`types`). For each of the well-known types there is a macro to check whether an object is of that type; for instance, ``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is a Python list." -msgstr "" +msgid "" +"All Python objects (even Python integers) have a :dfn:`type` and a " +":dfn:`reference count`. An object's type determines what kind of object it " +"is (e.g., an integer, a list, or a user-defined function; there are many " +"more as explained in :ref:`types`). For each of the well-known types there " +"is a macro to check whether an object is of that type; for instance, " +"``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is" +" a Python list." +msgstr "" +"همه‌ی اشیاء پایتون (حتی اعداد صحیح پایتون) یک :dfn:`نوع ` و یک " +":dfn:`شمارش ارجاع ` دارند. نوع یک شیء تعیین می‌کند که آن " +"شیء از چه نوعی است (مثلاً یک عدد صحیح، یک فهرست یا یک تابع تعریف‌شده توسط " +"کاربر؛ انواع بسیار بیشتری نیز وجود دارند که در :ref:`types` توضیح " +"داده‌شده‌اند). برای هر یک از انواع شناخته‌شده، یک ماکرو وجود دارد که بررسی " +"می‌کند آیا یک شیء از آن نوع است یا خیر؛ برای مثال، ``PyList_Check(a)`` درست " +"است اگر (و تنها اگر) شیئی که *a* به آن اشاره می‌کند، یک فهرست پایتون باشد." msgid "Reference Counts" -msgstr "" +msgstr "شمارش ارجاع" -msgid "The reference count is important because today's computers have a finite (and often severely limited) memory size; it counts how many different places there are that have a :term:`strong reference` to an object. Such a place could be another object, or a global (or static) C variable, or a local variable in some C function. When the last :term:`strong reference` to an object is released (i.e. its reference count becomes zero), the object is deallocated. If it contains references to other objects, those references are released. Those other objects may be deallocated in turn, if there are no more references to them, and so on. (There's an obvious problem with objects that reference each other here; for now, the solution is \"don't do that.\")" -msgstr "" +msgid "" +"The reference count is important because today's computers have a finite " +"(and often severely limited) memory size; it counts how many different " +"places there are that have a :term:`strong reference` to an object. Such a " +"place could be another object, or a global (or static) C variable, or a " +"local variable in some C function. When the last :term:`strong reference` to" +" an object is released (i.e. its reference count becomes zero), the object " +"is deallocated. If it contains references to other objects, those references" +" are released. Those other objects may be deallocated in turn, if there are " +"no more references to them, and so on. (There's an obvious problem with " +"objects that reference each other here; for now, the solution is \"don't do " +"that.\")" +msgstr "" +"شمارش ارجاع مهم است زیرا رایانه‌های امروزی اندازه‌ی حافظه‌ی محدودی (و اغلب " +"به‌شدت محدود) دارند؛ این شمارش، تعداد مکان‌های مختلفی را می‌شمارد که " +":term:`ارجاع قوی ` به یک شیء دارند. چنین مکانی می‌تواند یک" +" شیء دیگر، یا یک متغیر سراسری (یا ایستا) در C، یا یک متغیر محلی در تابعی به " +"زبان C باشد. وقتی آخرین :term:`ارجاع قوی ` به یک شیء آزاد " +"شود (یعنی شمارش ارجاع آن به صفر برسد)، آن شیء تخصیص‌زدایی می‌شود. اگر آن شیء" +" شامل ارجاع‌هایی به اشیاء دیگر باشد، آن ارجاع‌ها آزاد می‌شوند. آن اشیاء دیگر" +" نیز ممکن است به نوبت خود تخصیص‌زدایی شوند، اگر ارجاع دیگری به آن‌ها وجود " +"نداشته باشد، و به همین ترتیب. (در اینجا یک مشکل آشکار با اشیائی که به یکدیگر" +" ارجاع دارند وجود دارد؛ فعلاً راه‌حل این است: «این کار را نکنید.»)" -msgid "Reference counts are always manipulated explicitly. The normal way is to use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. increment its reference count by one), and :c:func:`Py_DECREF` to release that reference (i.e. decrement the reference count by one). The :c:func:`Py_DECREF` macro is considerably more complex than the incref one, since it must check whether the reference count becomes zero and then cause the object's deallocator to be called. The deallocator is a function pointer contained in the object's type structure. The type-specific deallocator takes care of releasing references for other objects contained in the object if this is a compound object type, such as a list, as well as performing any additional finalization that's needed. There's no chance that the reference count can overflow; at least as many bits are used to hold the reference count as there are distinct memory locations in virtual memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count increment is a simple operation." -msgstr "" +msgid "" +"Reference counts are always manipulated explicitly. The normal way is to " +"use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e." +" increment its reference count by one), and :c:func:`Py_DECREF` to release " +"that reference (i.e. decrement the reference count by one). The " +":c:func:`Py_DECREF` macro is considerably more complex than the incref one, " +"since it must check whether the reference count becomes zero and then cause " +"the object's deallocator to be called. The deallocator is a function " +"pointer contained in the object's type structure. The type-specific " +"deallocator takes care of releasing references for other objects contained " +"in the object if this is a compound object type, such as a list, as well as " +"performing any additional finalization that's needed. There's no chance " +"that the reference count can overflow; at least as many bits are used to " +"hold the reference count as there are distinct memory locations in virtual " +"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the " +"reference count increment is a simple operation." +msgstr "" +"شمارش ارجاع همیشه به‌طور صریح دستکاری می‌شود. روش معمول این است که از ماکرو " +":c:func:`Py_INCREF` برای گرفتن ارجاعی جدید به یک شیء (یعنی شمارش ارجاع آن " +"یکی افزایش می‌یابد) و از :c:func:`Py_DECREF` برای آزاد کردن آن ارجاع (یعنی " +"شمارش ارجاع یکی کاهش می‌یابد) استفاده شود. ماکرو :c:func:`Py_DECREF` " +"به‌مراتب پیچیده‌تر از ماکرو incref است، زیرا باید بررسی کند که آیا شمارش " +"ارجاع به صفر می‌رسد و سپس باعث شود آزادساز (deallocator) شیء فراخوانی شود. " +"آزادساز، اشاره‌گری به تابع است که در ساختار نوع شیء قرار دارد. آزادساز مخصوص" +" هر نوع، اگر نوع مربوطه یک نوع شیء مرکب مانند فهرست باشد، آزاد کردن " +"ارجاع‌های مربوط به سایر اشیاء موجود در شیء را بر عهده دارد و همچنین هرگونه " +"نهایی‌سازی اضافی لازم را انجام می‌دهد. هیچ احتمالی وجود ندارد که شمارش ارجاع" +" سرریز کند؛ برای نگه‌داشتن شمارش ارجاع، دست‌کم به‌اندازه‌ی تعداد مکان‌های " +"متمایز حافظه در حافظه‌ی مجازی بیت استفاده می‌شود (با فرض " +"``sizeof(Py_ssize_t) >= sizeof(void*)``). بنابراین، افزایش شمارش ارجاع یک " +"عملیات ساده است." -msgid "It is not necessary to hold a :term:`strong reference` (i.e. increment the reference count) for every local variable that contains a pointer to an object. In theory, the object's reference count goes up by one when the variable is made to point to it and it goes down by one when the variable goes out of scope. However, these two cancel each other out, so at the end the reference count hasn't changed. The only real reason to use the reference count is to prevent the object from being deallocated as long as our variable is pointing to it. If we know that there is at least one other reference to the object that lives at least as long as our variable, there is no need to take a new :term:`strong reference` (i.e. increment the reference count) temporarily. An important situation where this arises is in objects that are passed as arguments to C functions in an extension module that are called from Python; the call mechanism guarantees to hold a reference to every argument for the duration of the call." -msgstr "" +msgid "" +"It is not necessary to hold a :term:`strong reference` (i.e. increment the " +"reference count) for every local variable that contains a pointer to an " +"object. In theory, the object's reference count goes up by one when the " +"variable is made to point to it and it goes down by one when the variable " +"goes out of scope. However, these two cancel each other out, so at the end" +" the reference count hasn't changed. The only real reason to use the " +"reference count is to prevent the object from being deallocated as long as " +"our variable is pointing to it. If we know that there is at least one " +"other reference to the object that lives at least as long as our variable, " +"there is no need to take a new :term:`strong reference` (i.e. increment the " +"reference count) temporarily. An important situation where this arises is in" +" objects that are passed as arguments to C functions in an extension module" +" that are called from Python; the call mechanism guarantees to hold a " +"reference to every argument for the duration of the call." +msgstr "" +"لازم نیست برای هر متغیر محلی که حاوی اشاره‌گری به یک شیء است، یک " +":term:`strong reference` (یعنی افزایش دادن شمارش ارجاع) نگه دارید. از نظر " +"تئوری، شمارش ارجاع شیء هنگامی که متغیر به آن اشاره می‌کند، یک واحد افزایش " +"می‌یابد و هنگامی که متغیر از محدوده خارج می‌شود، یک واحد کاهش می‌یابد. اما " +"این دو، اثر یکدیگر را خنثی می‌کنند، بنابراین در نهایت شمارش ارجاع تغییری " +"نکرده است. تنها دلیل واقعی برای استفاده از شمارش ارجاع، جلوگیری از آزاد شدن " +"شیء در طول مدتی است که متغیر ما به آن اشاره می‌کند. اگر بدانیم که حداقل یک " +"ارجاع دیگر به شیء وجود دارد که دست‌کم به اندازه‌ی متغیر ما عمر می‌کند، نیازی" +" نیست موقتاً یک :term:`strong reference` جدید (یعنی افزایش دادن شمارش ارجاع)" +" بگیریم. یک موقعیت مهم که این موضوع در آن پیش می‌آید، هنگامی است که اشیایی " +"به‌عنوان آرگومان به توابع C در یک ماژول توسعه‌ای که از پایتون فراخوانی " +"می‌شوند، پاس داده می‌شوند؛ سازوکار فراخوانی تضمین می‌کند که در طول مدت " +"فراخوانی، به هر آرگومان ارجاعی نگه دارد." -msgid "However, a common pitfall is to extract an object from a list and hold on to it for a while without taking a new reference. Some other operation might conceivably remove the object from the list, releasing that reference, and possibly deallocating it. The real danger is that innocent-looking operations may invoke arbitrary Python code which could do this; there is a code path which allows control to flow back to the user from a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous." -msgstr "" +msgid "" +"However, a common pitfall is to extract an object from a list and hold on to" +" it for a while without taking a new reference. Some other operation might " +"conceivably remove the object from the list, releasing that reference, and " +"possibly deallocating it. The real danger is that innocent-looking " +"operations may invoke arbitrary Python code which could do this; there is a " +"code path which allows control to flow back to the user from a " +":c:func:`Py_DECREF`, so almost any operation is potentially dangerous." +msgstr "" +"با این حال، یک دام رایج این است که شیئی را از یک فهرست استخراج کنید و برای " +"مدتی آن را نگه دارید، بدون اینکه ارجاع جدیدی بگیرید. ممکن است عملیات دیگری " +"شیء را از فهرست حذف کند، آن ارجاع را آزاد کند و شاید حافظه‌ی آن را آزادسازی " +"کند. خطر واقعی این است که عملیات‌های به‌ظاهر بی‌ضرر ممکن است کد دلخواه " +"پایتون را فراخوانی کنند که بتواند این کار را انجام دهد؛ مسیری در کد وجود " +"دارد که اجازه می‌دهد کنترل از :c:func:`Py_DECREF` به کاربر بازگردد، بنابراین" +" تقریباً هر عملیاتی به‌طور بالقوه خطرناک است." -msgid "A safe approach is to always use the generic operations (functions whose name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or ``PyMapping_``). These operations always create a new :term:`strong reference` (i.e. increment the reference count) of the object they return. This leaves the caller with the responsibility to call :c:func:`Py_DECREF` when they are done with the result; this soon becomes second nature." -msgstr "" +msgid "" +"A safe approach is to always use the generic operations (functions whose " +"name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " +"``PyMapping_``). These operations always create a new :term:`strong " +"reference` (i.e. increment the reference count) of the object they return. " +"This leaves the caller with the responsibility to call :c:func:`Py_DECREF` " +"when they are done with the result; this soon becomes second nature." +msgstr "" +"یک رویکرد امن این است که همیشه از عملیات عام استفاده کنید (توابعی که نامشان " +"با ``PyObject_``، ``PyNumber_``، ``PySequence_`` یا ``PyMapping_`` آغاز " +"می‌شود). این عملیات‌ها همیشه یک :term:`ارجاع قوی ` جدید " +"(یعنی شمارش ارجاع را افزایش می‌دهند) برای شیء‌ای که برمی‌گردانند ایجاد " +"می‌کنند. این امر مسئولیت فراخوانی :c:func:`Py_DECREF` را پس از پایان کار با " +"نتیجه بر عهده‌ی فراخوان‌کننده می‌گذارد؛ این کار به‌زودی به عادت دوم تبدیل " +"می‌شود." msgid "Reference Count Details" -msgstr "" +msgstr "جزئیات شمارش ارجاع" -msgid "The reference count behavior of functions in the Python/C API is best explained in terms of *ownership of references*. Ownership pertains to references, never to objects (objects are not owned: they are always shared). \"Owning a reference\" means being responsible for calling Py_DECREF on it when the reference is no longer needed. Ownership can also be transferred, meaning that the code that receives ownership of the reference then becomes responsible for eventually releasing it by calling :c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or passing on this responsibility (usually to its caller). When a function passes ownership of a reference on to its caller, the caller is said to receive a *new* reference. When no ownership is transferred, the caller is said to *borrow* the reference. Nothing needs to be done for a :term:`borrowed reference`." -msgstr "" +msgid "" +"The reference count behavior of functions in the Python/C API is best " +"explained in terms of *ownership of references*. Ownership pertains to " +"references, never to objects (objects are not owned: they are always " +"shared). \"Owning a reference\" means being responsible for calling " +"Py_DECREF on it when the reference is no longer needed. Ownership can also " +"be transferred, meaning that the code that receives ownership of the " +"reference then becomes responsible for eventually releasing it by calling " +":c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " +"passing on this responsibility (usually to its caller). When a function " +"passes ownership of a reference on to its caller, the caller is said to " +"receive a *new* reference. When no ownership is transferred, the caller is " +"said to *borrow* the reference. Nothing needs to be done for a " +":term:`borrowed reference`." +msgstr "" +"رفتار شمارش ارجاع توابع در Python/C API به بهترین وجه بر حسب *مالکیت " +"ارجاع‌ها* توضیح داده می‌شود. مالکیت به ارجاع‌ها مربوط است، هرگز به اشیاء " +"(اشیاء در مالکیت کسی نیستند: آن‌ها همیشه مشترک‌اند). «مالک بودن یک ارجاع» به" +" این معناست که مسئول فراخواندن Py_DECREF روی آن هستید وقتی که دیگر به آن " +"ارجاع نیازی نیست. مالکیت همچنین می‌تواند منتقل شود، به این معنا که کدی که " +"مالکیت ارجاع را دریافت می‌کند، از آن پس مسئول خواهد بود که سرانجام آن را با " +"فراخوانی :c:func:`Py_DECREF` یا :c:func:`Py_XDECREF` وقتی دیگر مورد نیاز " +"نیست آزاد کند---یا این مسئولیت را (معمولاً به فراخوان‌کننده خود) واگذار کند." +" وقتی تابعی مالکیت یک ارجاع را به فراخوان‌کننده خود منتقل می‌کند، گفته " +"می‌شود فراخوان‌کننده ارجاع *جدید* دریافت کرده است. وقتی هیچ مالکیتی منتقل " +"نمی‌شود، گفته می‌شود فراخوان‌کننده ارجاع را *امانت* گرفته است. برای " +":term:`borrowed reference` هیچ کاری لازم نیست انجام شود." -msgid "Conversely, when a calling function passes in a reference to an object, there are two possibilities: the function *steals* a reference to the object, or it does not." +msgid "" +"Conversely, when a calling function passes in a reference to an object, " +"there are two possibilities: the function *steals* a reference to the " +"object, or it does not." msgstr "" +"برعکس، وقتی یک تابع فراخواننده ارجاعی به یک شیء را ارسال می‌کند، دو احتمال " +"وجود دارد: تابع ارجاعی به آن شیء را *می‌دزدد*، یا نمی‌دزدد." -msgid "*Stealing a reference* means that when you pass a reference to a function, that function assumes that it now owns that reference. Since the new owner can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not use that reference after the call." +msgid "" +"*Stealing a reference* means that when you pass a reference to a function, " +"that function assumes that it now owns that reference. Since the new owner " +"can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not " +"use that reference after the call." msgstr "" +"*دزدیدن ارجاع* به این معناست که وقتی ارجاعی را به تابعی پاس می‌دهید، آن تابع" +" فرض می‌کند که اکنون مالک آن ارجاع است. از آنجا که مالک جدید می‌تواند به " +"صلاحدید خود از :c:func:`!Py_DECREF` استفاده کند، شما (فراخواننده) نباید پس " +"از فراخوانی از آن ارجاع استفاده کنید." -msgid "Few functions steal references; the two notable exceptions are :c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to the item (but not to the tuple or list into which the item is put!). These functions were designed to steal a reference because of a common idiom for populating a tuple or list with newly created objects; for example, the code to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting about error handling for the moment; a better way to code this is shown below)::" -msgstr "" +msgid "" +"Few functions steal references; the two notable exceptions are " +":c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a " +"reference to the item (but not to the tuple or list into which the item is " +"put!). These functions were designed to steal a reference because of a " +"common idiom for populating a tuple or list with newly created objects; for " +"example, the code to create the tuple ``(1, 2, \"three\")`` could look like " +"this (forgetting about error handling for the moment; a better way to code " +"this is shown below)::" +msgstr "" +"تعداد کمی از توابع ارجاع می‌دزدند؛ دو استثنای قابل‌توجه " +":c:func:`PyList_SetItem` و :c:func:`PyTuple_SetItem` هستند که ارجاع به آیتم " +"را می‌دزدند (اما نه ارجاع به تاپل یا فهرستی که آیتم در آن قرار می‌گیرد!). " +"این توابع به دلیل یک الگوی رایج برای پر کردن تاپل یا فهرست با اشیاء " +"تازه‌ایجادشده، به گونه‌ای طراحی شده‌اند که ارجاعی را بدزدند؛ برای مثال، کد " +"ایجاد تاپل ``(1, 2, \"three\")`` می‌تواند چیزی شبیه این باشد (فعلاً از " +"مدیریت خطا صرف‌نظر کنید؛ روش بهتری برای کدنویسی این مورد در ادامه نشان داده " +"شده است)::" msgid "" "PyObject *t;\n" @@ -438,18 +1072,56 @@ msgid "" "PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" "PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" msgstr "" +"PyObject *t;\n" +"\n" +"t = PyTuple_New(3);\n" +"PyTuple_SetItem(t, 0, PyLong_FromLong(1L));\n" +"PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" +"PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -msgid "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab another reference before calling the reference-stealing function." +msgid "" +"Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately" +" stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object" +" although the reference to it will be stolen, use :c:func:`Py_INCREF` to " +"grab another reference before calling the reference-stealing function." msgstr "" +"در اینجا، :c:func:`PyLong_FromLong` ارجاع جدیدی برمی‌گرداند که بلافاصله توسط" +" :c:func:`PyTuple_SetItem` دزدیده می‌شود. هرگاه بخواهید با اینکه ارجاع به " +"یک شیء دزدیده خواهد شد، همچنان از آن استفاده کنید، پیش از فراخوانی تابع " +"دزدنده‌ی ارجاع، از :c:func:`Py_INCREF` برای گرفتن ارجاع دیگری استفاده کنید." -msgid "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to do this since tuples are an immutable data type. You should only use :c:func:`PyTuple_SetItem` for tuples that you are creating yourself." +msgid "" +"Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " +"items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to" +" do this since tuples are an immutable data type. You should only use " +":c:func:`PyTuple_SetItem` for tuples that you are creating yourself." msgstr "" +"ضمناً، :c:func:`PyTuple_SetItem` *تنها* راه تنظیم آیتم‌های تاپل است؛ " +":c:func:`PySequence_SetItem` و :c:func:`PyObject_SetItem` از انجام این کار " +"امتناع می‌ورزند، زیرا تاپل‌ها نوع داده‌ای تغییرناپذیر هستند. شما باید " +":c:func:`PyTuple_SetItem` را تنها برای تاپل‌هایی که خودتان ایجاد می‌کنید " +"استفاده کنید." -msgid "Equivalent code for populating a list can be written using :c:func:`PyList_New` and :c:func:`PyList_SetItem`." +msgid "" +"Equivalent code for populating a list can be written using " +":c:func:`PyList_New` and :c:func:`PyList_SetItem`." msgstr "" +"می‌توان کد معادل برای پر کردن یک فهرست را با استفاده از :c:func:`PyList_New`" +" و :c:func:`PyList_SetItem` نوشت." -msgid "However, in practice, you will rarely use these ways of creating and populating a tuple or list. There's a generic function, :c:func:`Py_BuildValue`, that can create most common objects from C values, directed by a :dfn:`format string`. For example, the above two blocks of code could be replaced by the following (which also takes care of the error checking)::" -msgstr "" +msgid "" +"However, in practice, you will rarely use these ways of creating and " +"populating a tuple or list. There's a generic function, " +":c:func:`Py_BuildValue`, that can create most common objects from C values, " +"directed by a :dfn:`format string`. For example, the above two blocks of " +"code could be replaced by the following (which also takes care of the error " +"checking)::" +msgstr "" +"با این حال، در عمل، شما به‌ندرت از این روش‌ها برای ایجاد و پر کردن یک تاپل " +"یا فهرست استفاده خواهید کرد. یک تابع عام وجود دارد، :c:func:`Py_BuildValue`،" +" که می‌تواند با هدایت یک :dfn:`رشته قالب `، بیشتر اشیاء رایج " +"را از مقادیر C ایجاد کند. برای مثال، دو بلوک کد بالا را می‌توان با کد زیر " +"جایگزین کرد (که بررسی خطا را نیز انجام می‌دهد)::" msgid "" "PyObject *tuple, *list;\n" @@ -457,9 +1129,27 @@ msgid "" "tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" "list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" msgstr "" +"PyObject *tuple, *list;\n" +"\n" +"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" +"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -msgid "It is much more common to use :c:func:`PyObject_SetItem` and friends with items whose references you are only borrowing, like arguments that were passed in to the function you are writing. In that case, their behaviour regarding references is much saner, since you don't have to take a new reference just so you can give that reference away (\"have it be stolen\"). For example, this function sets all items of a list (actually, any mutable sequence) to a given item::" -msgstr "" +msgid "" +"It is much more common to use :c:func:`PyObject_SetItem` and friends with " +"items whose references you are only borrowing, like arguments that were " +"passed in to the function you are writing. In that case, their behaviour " +"regarding references is much saner, since you don't have to take a new " +"reference just so you can give that reference away (\"have it be stolen\")." +" For example, this function sets all items of a list (actually, any mutable" +" sequence) to a given item::" +msgstr "" +"بسیار رایج‌تر است که از :c:func:`PyObject_SetItem` و توابع مشابه آن با " +"آیتم‌هایی استفاده کنید که ارجاع‌هایشان را صرفاً به امانت دارید، مانند " +"آرگومان‌هایی که به تابعی که در حال نوشتن آن هستید ارسال شده‌اند. در چنین " +"حالتی، رفتار این توابع در مورد ارجاع‌ها بسیار منطقی‌تر است، زیرا لازم نیست " +"صرفاً برای اینکه بتوانید آن ارجاع را واگذار کنید (بگذارید آن «دزدیده» شود)، " +"ارجاع جدیدی بگیرید. برای مثال، این تابع همه‌ی آیتم‌های یک فهرست (در واقع، هر" +" دنباله‌ی تغییرپذیری) را برابر یک آیتم داده‌شده قرار می‌دهد::" msgid "" "int\n" @@ -483,15 +1173,74 @@ msgid "" " return 0;\n" "}" msgstr "" +"int\n" +"set_all(PyObject *target, PyObject *item)\n" +"{\n" +" Py_ssize_t i, n;\n" +"\n" +" n = PyObject_Length(target);\n" +" if (n < 0)\n" +" return -1;\n" +" for (i = 0; i < n; i++) {\n" +" PyObject *index = PyLong_FromSsize_t(i);\n" +" if (!index)\n" +" return -1;\n" +" if (PyObject_SetItem(target, index, item) < 0) {\n" +" Py_DECREF(index);\n" +" return -1;\n" +" }\n" +" Py_DECREF(index);\n" +" }\n" +" return 0;\n" +"}" -msgid "The situation is slightly different for function return values. While passing a reference to most functions does not change your ownership responsibilities for that reference, many functions that return a reference to an object give you ownership of the reference. The reason is simple: in many cases, the returned object is created on the fly, and the reference you get is the only reference to the object. Therefore, the generic functions that return object references, like :c:func:`PyObject_GetItem` and :c:func:`PySequence_GetItem`, always return a new reference (the caller becomes the owner of the reference)." -msgstr "" +msgid "" +"The situation is slightly different for function return values. While " +"passing a reference to most functions does not change your ownership " +"responsibilities for that reference, many functions that return a reference" +" to an object give you ownership of the reference. The reason is simple: in " +"many cases, the returned object is created on the fly, and the reference " +"you get is the only reference to the object. Therefore, the generic " +"functions that return object references, like :c:func:`PyObject_GetItem` and" +" :c:func:`PySequence_GetItem`, always return a new reference (the caller " +"becomes the owner of the reference)." +msgstr "" +"وضعیت برای مقادیر بازگشتی توابع کمی متفاوت است. در حالی که گذراندن ارجاع به " +"بیشتر توابع، مسئولیت‌های مالکیت شما نسبت به آن ارجاع را تغییر نمی‌دهد، " +"بسیاری از توابعی که ارجاعی به یک شیء را برمی‌گردانند، مالکیت آن ارجاع را به " +"شما می‌دهند. دلیل این امر ساده است: در بسیاری از موارد، شیء بازگردانده‌شده " +"در لحظه ایجاد می‌شود و ارجاعی که دریافت می‌کنید تنها ارجاع به آن شیء است. " +"بنابراین، توابع عمومی‌ای که ارجاع‌های شیء را برمی‌گردانند، مانند " +":c:func:`PyObject_GetItem` و :c:func:`PySequence_GetItem`، همیشه یک ارجاع " +"جدید برمی‌گردانند (فراخوان‌کننده مالک ارجاع می‌شود)." -msgid "It is important to realize that whether you own a reference returned by a function depends on which function you call only --- *the plumage* (the type of the object passed as an argument to the function) *doesn't enter into it!* Thus, if you extract an item from a list using :c:func:`PyList_GetItem`, you don't own the reference --- but if you obtain the same item from the same list using :c:func:`PySequence_GetItem` (which happens to take exactly the same arguments), you do own a reference to the returned object." -msgstr "" +msgid "" +"It is important to realize that whether you own a reference returned by a " +"function depends on which function you call only --- *the plumage* (the type" +" of the object passed as an argument to the function) *doesn't enter into " +"it!* Thus, if you extract an item from a list using " +":c:func:`PyList_GetItem`, you don't own the reference --- but if you obtain " +"the same item from the same list using :c:func:`PySequence_GetItem` (which " +"happens to take exactly the same arguments), you do own a reference to the " +"returned object." +msgstr "" +"مهم است بدانید که اینکه شما مالک ارجاعی هستید که یک تابع برمی‌گرداند یا نه، " +"تنها به تابعی که فراخوانی می‌کنید بستگی دارد --- *پر و بال* (نوع شیئی که " +"به‌عنوان آرگومان به تابع داده می‌شود) *در این میان نقشی ندارد!* بنابراین، " +"اگر آیتمی را از یک فهرست با استفاده از :c:func:`PyList_GetItem` استخراج " +"کنید، مالک ارجاع نیستید --- اما اگر همان آیتم را از همان فهرست با استفاده از" +" :c:func:`PySequence_GetItem` (که اتفاقاً دقیقاً همان آرگومان‌ها را می‌گیرد)" +" به دست آورید، مالک ارجاعی به شیء برگردانده‌شده هستید." -msgid "Here is an example of how you could write a function that computes the sum of the items in a list of integers; once using :c:func:`PyList_GetItem`, and once using :c:func:`PySequence_GetItem`. ::" +msgid "" +"Here is an example of how you could write a function that computes the sum " +"of the items in a list of integers; once using :c:func:`PyList_GetItem`, " +"and once using :c:func:`PySequence_GetItem`. ::" msgstr "" +"در اینجا مثالی از نحوه‌ی نوشتن تابعی که مجموع آیتم‌های فهرستی از اعداد صحیح " +"را محاسبه می‌کند آورده شده است؛ یک بار با استفاده از " +":c:func:`PyList_GetItem` و یک بار با استفاده از " +":c:func:`PySequence_GetItem`. ::" msgid "" "long\n" @@ -516,6 +1265,27 @@ msgid "" " return total;\n" "}" msgstr "" +"long\n" +"sum_list(PyObject *list)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +"\n" +" n = PyList_Size(list);\n" +" if (n < 0)\n" +" return -1; /* Not a list */\n" +" for (i = 0; i < n; i++) {\n" +" item = PyList_GetItem(list, i); /* Can't fail */\n" +" if (!PyLong_Check(item)) continue; /* Skip non-integers */\n" +" value = PyLong_AsLong(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Integer too big to fit in a C long, bail out */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" return total;\n" +"}" msgid "" "long\n" @@ -546,39 +1316,195 @@ msgid "" " return total;\n" "}" msgstr "" +"long\n" +"sum_sequence(PyObject *sequence)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +" n = PySequence_Length(sequence);\n" +" if (n < 0)\n" +" return -1; /* Has no length */\n" +" for (i = 0; i < n; i++) {\n" +" item = PySequence_GetItem(sequence, i);\n" +" if (item == NULL)\n" +" return -1; /* Not a sequence, or other failure */\n" +" if (PyLong_Check(item)) {\n" +" value = PyLong_AsLong(item);\n" +" Py_DECREF(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Integer too big to fit in a C long, bail out */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" else {\n" +" Py_DECREF(item); /* Discard reference ownership */\n" +" }\n" +" }\n" +" return total;\n" +"}" msgid "Types" -msgstr "" +msgstr "نوع‌ها" -msgid "There are few other data types that play a significant role in the Python/C API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:`double` and :c:expr:`char*`. A few structure types are used to describe static tables used to list the functions exported by a module or the data attributes of a new object type, and another is used to describe the value of a complex number. These will be discussed together with the functions that use them." -msgstr "" +msgid "" +"There are few other data types that play a significant role in the Python/C" +" API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, " +":c:expr:`double` and :c:expr:`char*`. A few structure types are used to " +"describe static tables used to list the functions exported by a module or " +"the data attributes of a new object type, and another is used to describe " +"the value of a complex number. These will be discussed together with the " +"functions that use them." +msgstr "" +"چند نوع داده‌ی دیگر نیز نقش مهمی در Python/C API ایفا می‌کنند؛ بیشتر آن‌ها " +"نوع‌های ساده‌ی C مانند :c:expr:`int`، :c:expr:`long`، :c:expr:`double` و " +":c:expr:`char*` هستند. چند نوع ساختاری برای توصیف جدول‌های ایستایی که توابع " +"صادرشده توسط یک ماژول یا ویژگی‌های داده‌ی یک نوع شیء جدید را فهرست می‌کنند، " +"به کار می‌روند، و نوع دیگری برای توصیف مقدار یک عدد مختلط استفاده می‌شود. " +"این موارد همراه با توابعی که از آن‌ها استفاده می‌کنند بحث خواهند شد." -msgid "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. C99 doesn't define such a thing directly (size_t is an unsigned integral type). See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest positive value of type :c:type:`Py_ssize_t`." +msgid "" +"A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " +"C99 doesn't define such a thing directly (size_t is an unsigned integral " +"type). See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest " +"positive value of type :c:type:`Py_ssize_t`." msgstr "" +"یک نوع صحیح علامت‌دار به‌گونه‌ای که ``sizeof(Py_ssize_t) == sizeof(size_t)``" +" باشد. استاندارد C99 چنین چیزی را مستقیماً تعریف نمی‌کند (size_t یک نوع صحیح" +" بدون علامت است). برای جزئیات به :pep:`353` مراجعه کنید. ``PY_SSIZE_T_MAX`` " +"بزرگ‌ترین مقدار مثبت از نوع :c:type:`Py_ssize_t` است." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "The Python programmer only needs to deal with exceptions if specific error handling is required; unhandled exceptions are automatically propagated to the caller, then to the caller's caller, and so on, until they reach the top-level interpreter, where they are reported to the user accompanied by a stack traceback." +msgid "" +"The Python programmer only needs to deal with exceptions if specific error " +"handling is required; unhandled exceptions are automatically propagated to " +"the caller, then to the caller's caller, and so on, until they reach the " +"top-level interpreter, where they are reported to the user accompanied by a" +" stack traceback." msgstr "" +"برنامه‌نویس پایتون تنها در صورتی نیاز به رسیدگی به استثناها دارد که مدیریت " +"خطای خاصی لازم باشد؛ استثناهای مدیریت‌نشده به‌طور خودکار به فراخواننده منتشر" +" می‌شوند، سپس به فراخواننده‌ی فراخواننده، و به همین ترتیب، تا اینکه به مفسر " +"سطح بالا برسند، جایی که همراه با یک ردگیری پشته به کاربر گزارش می‌شوند." -msgid "For C programmers, however, error checking always has to be explicit. All functions in the Python/C API can raise exceptions, unless an explicit claim is made otherwise in a function's documentation. In general, when a function encounters an error, it sets an exception, discards any object references that it owns, and returns an error indicator. If not documented otherwise, this indicator is either ``NULL`` or ``-1``, depending on the function's return type. A few functions return a Boolean true/false result, with false indicating an error. Very few functions return no explicit error indicator or have an ambiguous return value, and require explicit testing for errors with :c:func:`PyErr_Occurred`. These exceptions are always explicitly documented." -msgstr "" +msgid "" +"For C programmers, however, error checking always has to be explicit. All " +"functions in the Python/C API can raise exceptions, unless an explicit claim" +" is made otherwise in a function's documentation. In general, when a " +"function encounters an error, it sets an exception, discards any object " +"references that it owns, and returns an error indicator. If not documented " +"otherwise, this indicator is either ``NULL`` or ``-1``, depending on the " +"function's return type. A few functions return a Boolean true/false result, " +"with false indicating an error. Very few functions return no explicit error" +" indicator or have an ambiguous return value, and require explicit testing " +"for errors with :c:func:`PyErr_Occurred`. These exceptions are always " +"explicitly documented." +msgstr "" +"اما برای برنامه‌نویسان C، بررسی خطا همیشه باید صریح باشد. همه‌ی توابع در " +"Python/C API می‌توانند استثنا ایجاد کنند، مگر آنکه در مستندات یک تابع، خلاف " +"آن به‌طور صریح ادعا شده باشد. به‌طور کلی، وقتی تابعی با خطا مواجه می‌شود، یک" +" استثنا را تنظیم می‌کند، ارجاع‌های شیء‌ای را که مالک آن‌هاست دور می‌ریزد و " +"یک نشانگر خطا برمی‌گرداند. اگر خلاف آن مستند نشده باشد، این نشانگر یا " +"``NULL`` است یا ``-1``، بسته به نوع بازگشتی تابع. چند تابع نتیجه‌ی بولی " +"درست/غلط برمی‌گردانند که در آن‌ها مقدار غلط نشان‌دهنده‌ی خطا است. تعداد " +"بسیار کمی از توابع هیچ نشانگر خطای صریحی برنمی‌گردانند یا مقدار بازگشتی " +"مبهمی دارند و نیازمند آزمون صریح خطاها با :c:func:`PyErr_Occurred` هستند. " +"این استثناها همیشه به‌طور صریح مستند می‌شوند." -msgid "Exception state is maintained in per-thread storage (this is equivalent to using global storage in an unthreaded application). A thread can be in one of two states: an exception has occurred, or not. The function :c:func:`PyErr_Occurred` can be used to check for this: it returns a borrowed reference to the exception type object when an exception has occurred, and ``NULL`` otherwise. There are a number of functions to set the exception state: :c:func:`PyErr_SetString` is the most common (though not the most general) function to set the exception state, and :c:func:`PyErr_Clear` clears the exception state." -msgstr "" +msgid "" +"Exception state is maintained in per-thread storage (this is equivalent to " +"using global storage in an unthreaded application). A thread can be in one" +" of two states: an exception has occurred, or not. The function " +":c:func:`PyErr_Occurred` can be used to check for this: it returns a " +"borrowed reference to the exception type object when an exception has " +"occurred, and ``NULL`` otherwise. There are a number of functions to set " +"the exception state: :c:func:`PyErr_SetString` is the most common (though " +"not the most general) function to set the exception state, and " +":c:func:`PyErr_Clear` clears the exception state." +msgstr "" +"وضعیت استثنا در ذخیره‌گاه اختصاصی هر نخ نگهداری می‌شود (این معادل استفاده از" +" ذخیره‌گاه سراسری در یک برنامه‌ی بدون نخ است). یک نخ می‌تواند در یکی از دو " +"وضعیت باشد: استثنایی رخ داده است یا نه. می‌توان از تابع " +":c:func:`PyErr_Occurred` برای بررسی این موضوع استفاده کرد: این تابع هنگامی " +"که استثنایی رخ داده باشد، یک ارجاع امانتی به شیء نوع استثنا برمی‌گرداند و در" +" غیر این صورت ``NULL`` را برمی‌گرداند. توابع متعددی برای تنظیم وضعیت استثنا " +"وجود دارند: :c:func:`PyErr_SetString` رایج‌ترین (هرچند نه عام‌ترین) تابع " +"برای تنظیم وضعیت استثنا است و :c:func:`PyErr_Clear` وضعیت استثنا را پاک " +"می‌کند." -msgid "The full exception state consists of three objects (all of which can be ``NULL``): the exception type, the corresponding exception value, and the traceback. These have the same meanings as the Python result of ``sys.exc_info()``; however, they are not the same: the Python objects represent the last exception being handled by a Python :keyword:`try` ... :keyword:`except` statement, while the C level exception state only exists while an exception is being passed on between C functions until it reaches the Python bytecode interpreter's main loop, which takes care of transferring it to ``sys.exc_info()`` and friends." -msgstr "" +msgid "" +"The full exception state consists of three objects (all of which can be " +"``NULL``): the exception type, the corresponding exception value, and the " +"traceback. These have the same meanings as the Python result of " +"``sys.exc_info()``; however, they are not the same: the Python objects " +"represent the last exception being handled by a Python :keyword:`try` ... " +":keyword:`except` statement, while the C level exception state only exists " +"while an exception is being passed on between C functions until it reaches " +"the Python bytecode interpreter's main loop, which takes care of " +"transferring it to ``sys.exc_info()`` and friends." +msgstr "" +"وضعیت کامل استثنا از سه شیء تشکیل شده است (که هر سه می‌توانند ``NULL`` " +"باشند): نوع استثنا، مقدار متناظر استثنا، و ردگیری. این‌ها همان معانی نتیجه‌ی" +" پایتونی ``sys.exc_info()`` را دارند؛ با این حال، یکسان نیستند: اشیاء " +"پایتونی آخرین استثنایی را نشان می‌دهند که توسط یک دستور :keyword:`try` ... " +":keyword:`except` پایتونی در حال مدیریت است، در حالی که وضعیت استثنا در سطح " +"C تنها زمانی وجود دارد که استثنایی بین توابع C در حال انتقال باشد تا اینکه " +"به حلقه‌ی اصلی مفسر بایت‌کد پایتون برسد؛ حلقه‌ای که کار انتقال آن به " +"``sys.exc_info()`` و توابع مشابه را بر عهده دارد." -msgid "Note that starting with Python 1.5, the preferred, thread-safe way to access the exception state from Python code is to call the function :func:`sys.exc_info`, which returns the per-thread exception state for Python code. Also, the semantics of both ways to access the exception state have changed so that a function which catches an exception will save and restore its thread's exception state so as to preserve the exception state of its caller. This prevents common bugs in exception handling code caused by an innocent-looking function overwriting the exception being handled; it also reduces the often unwanted lifetime extension for objects that are referenced by the stack frames in the traceback." -msgstr "" +msgid "" +"Note that starting with Python 1.5, the preferred, thread-safe way to access" +" the exception state from Python code is to call the function " +":func:`sys.exc_info`, which returns the per-thread exception state for " +"Python code. Also, the semantics of both ways to access the exception state" +" have changed so that a function which catches an exception will save and " +"restore its thread's exception state so as to preserve the exception state " +"of its caller. This prevents common bugs in exception handling code caused " +"by an innocent-looking function overwriting the exception being handled; it " +"also reduces the often unwanted lifetime extension for objects that are " +"referenced by the stack frames in the traceback." +msgstr "" +"توجه داشته باشید که از پایتون 1.5 به بعد، روش ترجیحی و نخ‌ایمن برای دسترسی " +"به وضعیت استثنا از درون کد پایتون، فراخوانی تابع :func:`sys.exc_info` است که" +" وضعیت استثنای هر نخ را برای کد پایتون برمی‌گرداند. همچنین، معناشناسی هر دو " +"روش دسترسی به وضعیت استثنا تغییر کرده است، به‌طوری که تابعی که استثنایی را " +"می‌گیرد، وضعیت استثنای نخ خود را ذخیره و بازیابی می‌کند تا وضعیت استثنای " +"فراخواننده‌اش حفظ شود. این امر از اشکال‌های رایج در کد مدیریت استثنا که ناشی" +" از بازنویسی استثنای در حال مدیریت توسط تابعی به‌ظاهر بی‌آزار هستند جلوگیری " +"می‌کند؛ همچنین تمدیدِ اغلب ناخواسته‌ی طول عمر اشیایی را که قاب‌های پشته در " +"ردگیری به آن‌ها ارجاع می‌دهند، کاهش می‌دهد." -msgid "As a general principle, a function that calls another function to perform some task should check whether the called function raised an exception, and if so, pass the exception state on to its caller. It should discard any object references that it owns, and return an error indicator, but it should *not* set another exception --- that would overwrite the exception that was just raised, and lose important information about the exact cause of the error." -msgstr "" +msgid "" +"As a general principle, a function that calls another function to perform " +"some task should check whether the called function raised an exception, and" +" if so, pass the exception state on to its caller. It should discard any " +"object references that it owns, and return an error indicator, but it " +"should *not* set another exception --- that would overwrite the exception " +"that was just raised, and lose important information about the exact cause " +"of the error." +msgstr "" +"به‌عنوان یک اصل کلی، تابعی که برای انجام کاری تابع دیگری را فراخوانی می‌کند،" +" باید بررسی کند که آیا تابع فراخوانی‌شده استثنایی ایجاد کرده است یا خیر، و " +"در این صورت، وضعیت استثنا را به فراخواننده خود منتقل کند. این تابع باید هر " +"ارجاع شیء‌ای را که مالک آن است دور بریزد و یک نشانگر خطا برگرداند، اما " +"*نباید* استثنای دیگری تنظیم کند --- زیرا این کار باعث می‌شد که استثنایی که " +"به‌تازگی ایجاد شده بازنویسی شود و اطلاعات مهمی درباره‌ی علت دقیق خطا از دست " +"برود." -msgid "A simple example of detecting exceptions and passing them on is shown in the :c:func:`!sum_sequence` example above. It so happens that this example doesn't need to clean up any owned references when it detects an error. The following example function shows some error cleanup. First, to remind you why you like Python, we show the equivalent Python code::" -msgstr "" +msgid "" +"A simple example of detecting exceptions and passing them on is shown in the" +" :c:func:`!sum_sequence` example above. It so happens that this example " +"doesn't need to clean up any owned references when it detects an error. The" +" following example function shows some error cleanup. First, to remind you " +"why you like Python, we show the equivalent Python code::" +msgstr "" +"یک مثال ساده از تشخیص استثناها و عبور دادن آن‌ها در مثال " +":c:func:`!sum_sequence` بالا نشان داده‌شده است. اتفاقاً این مثال هنگام " +"تشخیص خطا نیازی به پاک‌سازی هیچ‌یک از ارجاع‌های مالکیت‌شده ندارد. تابع مثال" +" زیر مقداری پاک‌سازی خطا را نشان می‌دهد. ابتدا، برای یادآوری اینکه چرا " +"پایتون را دوست دارید، کد معادل پایتون را نشان می‌دهیم::" msgid "" "def incr_item(dict, key):\n" @@ -588,9 +1514,15 @@ msgid "" " item = 0\n" " dict[key] = item + 1" msgstr "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" msgid "Here is the corresponding C code, in all its glory::" -msgstr "" +msgstr "در اینجا کد C مربوطه، در تمام شکوهش، آمده است::" msgid "" "int\n" @@ -636,186 +1568,427 @@ msgid "" " return rv; /* -1 for error, 0 for success */\n" "}" msgstr "" +"int\n" +"incr_item(PyObject *dict, PyObject *key)\n" +"{\n" +" /* Objects all initialized to NULL for Py_XDECREF */\n" +" PyObject *item = NULL, *const_one = NULL, *incremented_item = NULL;\n" +" int rv = -1; /* Return value initialized to -1 (failure) */\n" +"\n" +" item = PyObject_GetItem(dict, key);\n" +" if (item == NULL) {\n" +" /* Handle KeyError only: */\n" +" if (!PyErr_ExceptionMatches(PyExc_KeyError))\n" +" goto error;\n" +"\n" +" /* Clear the error and use zero: */\n" +" PyErr_Clear();\n" +" item = PyLong_FromLong(0L);\n" +" if (item == NULL)\n" +" goto error;\n" +" }\n" +" const_one = PyLong_FromLong(1L);\n" +" if (const_one == NULL)\n" +" goto error;\n" +"\n" +" incremented_item = PyNumber_Add(item, const_one);\n" +" if (incremented_item == NULL)\n" +" goto error;\n" +"\n" +" if (PyObject_SetItem(dict, key, incremented_item) < 0)\n" +" goto error;\n" +" rv = 0; /* Success */\n" +" /* Continue with cleanup code */\n" +"\n" +" error:\n" +" /* Cleanup code, shared by success and failure path */\n" +"\n" +" /* Use Py_XDECREF() to ignore NULL references */\n" +" Py_XDECREF(item);\n" +" Py_XDECREF(const_one);\n" +" Py_XDECREF(incremented_item);\n" +"\n" +" return rv; /* -1 for error, 0 for success */\n" +"}" -msgid "This example represents an endorsed use of the ``goto`` statement in C! It illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:`PyErr_Clear` to handle specific exceptions, and the use of :c:func:`Py_XDECREF` to dispose of owned references that may be ``NULL`` (note the ``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a ``NULL`` reference). It is important that the variables used to hold owned references are initialized to ``NULL`` for this to work; likewise, the proposed return value is initialized to ``-1`` (failure) and only set to success after the final call made is successful." -msgstr "" +msgid "" +"This example represents an endorsed use of the ``goto`` statement in C! It " +"illustrates the use of :c:func:`PyErr_ExceptionMatches` and " +":c:func:`PyErr_Clear` to handle specific exceptions, and the use of " +":c:func:`Py_XDECREF` to dispose of owned references that may be ``NULL`` " +"(note the ``'X'`` in the name; :c:func:`Py_DECREF` would crash when " +"confronted with a ``NULL`` reference). It is important that the variables " +"used to hold owned references are initialized to ``NULL`` for this to work; " +"likewise, the proposed return value is initialized to ``-1`` (failure) and " +"only set to success after the final call made is successful." +msgstr "" +"این مثال، کاربردی مورد تأیید از دستور ``goto`` در C را به نمایش می‌گذارد! " +"این مثال، استفاده از :c:func:`PyErr_ExceptionMatches` و " +":c:func:`PyErr_Clear` برای مدیریت استثناهای خاص و استفاده از " +":c:func:`Py_XDECREF` برای آزاد کردن ارجاع‌های مالکیت‌دار (owned) که ممکن است" +" ``NULL`` باشند را نشان می‌دهد (به ``'X'`` در نام توجه کنید؛ " +":c:func:`Py_DECREF` هنگام مواجهه با ارجاع ``NULL`` فروپاشی می‌کند). برای " +"اینکه این کار کند، مهم است که متغیرهایی که برای نگه‌داشتن ارجاع‌های " +"مالکیت‌دار به کار می‌روند، به ``NULL`` مقداردهی اولیه شده باشند؛ به همین " +"ترتیب، مقدار بازگشتی پیشنهادی نیز به ``-1`` (شکست) مقداردهی اولیه می‌شود و " +"تنها پس از آنکه آخرین فراخوانی انجام‌شده موفق باشد، روی موفقیت تنظیم می‌شود." msgid "Embedding Python" -msgstr "" +msgstr "جاسازی پایتون" -msgid "The one important task that only embedders (as opposed to extension writers) of the Python interpreter have to worry about is the initialization, and possibly the finalization, of the Python interpreter. Most functionality of the interpreter can only be used after the interpreter has been initialized." +msgid "" +"The one important task that only embedders (as opposed to extension writers)" +" of the Python interpreter have to worry about is the initialization, and " +"possibly the finalization, of the Python interpreter. Most functionality of" +" the interpreter can only be used after the interpreter has been " +"initialized." msgstr "" +"تنها کار مهمی که فقط جاسازی‌کنندگان (embedders) مفسر پایتون — برخلاف " +"نویسندگان ماژول‌های توسعه‌ای — باید نگران آن باشند، مقداردهی اولیه و " +"احتمالاً نهایی‌سازی مفسر پایتون است. بیشترِ کارکردهای مفسر تنها پس از آن‌که " +"مفسر مقداردهی اولیه شده باشد، قابل استفاده‌اند." -msgid "The basic initialization function is :c:func:`Py_Initialize`. This initializes the table of loaded modules, and creates the fundamental modules :mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also initializes the module search path (``sys.path``)." +msgid "" +"The basic initialization function is :c:func:`Py_Initialize`. This " +"initializes the table of loaded modules, and creates the fundamental modules" +" :mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also initializes the " +"module search path (``sys.path``)." msgstr "" +"تابع مقداردهی اولیه‌ی پایه :c:func:`Py_Initialize` است. این تابع جدول " +"ماژول‌های بارگذاری‌شده را مقداردهی اولیه می‌کند و ماژول‌های بنیادی " +":mod:`builtins`، :mod:`__main__` و :mod:`sys` را ایجاد می‌کند. همچنین مسیر " +"جستجوی ماژول (``sys.path``) را مقداردهی اولیه می‌کند." -msgid ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys.argv``). If this variable is needed by Python code that will be executed later, setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` must be set: see :ref:`Python Initialization Configuration `." +msgid "" +":c:func:`Py_Initialize` does not set the \"script argument list\" " +"(``sys.argv``). If this variable is needed by Python code that will be " +"executed later, setting :c:member:`PyConfig.argv` and " +":c:member:`PyConfig.parse_argv` must be set: see :ref:`Python Initialization" +" Configuration `." msgstr "" +":c:func:`Py_Initialize` فهرست آرگومان‌های اسکریپت (``sys.argv``) را تنظیم " +"نمی‌کند. اگر این متغیر توسط کد پایتونی که بعداً اجرا خواهد شد مورد نیاز " +"باشد، باید :c:member:`PyConfig.argv` و :c:member:`PyConfig.parse_argv` تنظیم" +" شوند: به :ref:`پیکربندی مقداردهی اولیه پایتون ` مراجعه کنید." -msgid "On most systems (in particular, on Unix and Windows, although the details are slightly different), :c:func:`Py_Initialize` calculates the module search path based upon its best guess for the location of the standard Python interpreter executable, assuming that the Python library is found in a fixed location relative to the Python interpreter executable. In particular, it looks for a directory named :file:`lib/python{X.Y}` relative to the parent directory where the executable named :file:`python` is found on the shell command search path (the environment variable :envvar:`PATH`)." -msgstr "" +msgid "" +"On most systems (in particular, on Unix and Windows, although the details " +"are slightly different), :c:func:`Py_Initialize` calculates the module " +"search path based upon its best guess for the location of the standard " +"Python interpreter executable, assuming that the Python library is found in " +"a fixed location relative to the Python interpreter executable. In " +"particular, it looks for a directory named :file:`lib/python{X.Y}` relative " +"to the parent directory where the executable named :file:`python` is found " +"on the shell command search path (the environment variable :envvar:`PATH`)." +msgstr "" +"در بیشتر سیستم‌ها (به‌طور خاص در یونیکس و ویندوز، هرچند جزئیات اندکی متفاوت " +"است)، :c:func:`Py_Initialize` مسیر جستجوی ماژول را بر اساس بهترین حدس خود " +"برای مکان پرونده‌ی اجرایی مفسر استاندارد پایتون محاسبه می‌کند، با این فرض که" +" کتابخانه‌ی پایتون در مکانی ثابت نسبت به پرونده‌ی اجرایی مفسر پایتون قرار " +"دارد. به‌طور خاص، این تابع به دنبال پوشه‌ای با نام :file:`lib/python{X.Y}` " +"نسبت به پوشه‌ی والدِ مکانی می‌گردد که پرونده‌ی اجرایی با نام :file:`python` " +"در مسیر جستجوی فرمان پوسته (متغیر محیط :envvar:`PATH`) در آن یافت می‌شود." -msgid "For instance, if the Python executable is found in :file:`/usr/local/bin/python`, it will assume that the libraries are in :file:`/usr/local/lib/python{X.Y}`. (In fact, this particular path is also the \"fallback\" location, used when no executable file named :file:`python` is found along :envvar:`PATH`.) The user can override this behavior by setting the environment variable :envvar:`PYTHONHOME`, or insert additional directories in front of the standard path by setting :envvar:`PYTHONPATH`." -msgstr "" +msgid "" +"For instance, if the Python executable is found in " +":file:`/usr/local/bin/python`, it will assume that the libraries are in " +":file:`/usr/local/lib/python{X.Y}`. (In fact, this particular path is also " +"the \"fallback\" location, used when no executable file named :file:`python`" +" is found along :envvar:`PATH`.) The user can override this behavior by " +"setting the environment variable :envvar:`PYTHONHOME`, or insert additional " +"directories in front of the standard path by setting :envvar:`PYTHONPATH`." +msgstr "" +"برای نمونه، اگر پرونده اجرایی پایتون در :file:`/usr/local/bin/python` یافت " +"شود، فرض می‌کند که کتابخانه‌ها در :file:`/usr/local/lib/python{X.Y}` قرار " +"دارند. (در واقع، این مسیر خاص همچنین مکان «جایگزین» است که زمانی استفاده " +"می‌شود که هیچ پرونده اجرایی‌ای با نام :file:`python` در :envvar:`PATH` یافت " +"نشود.) کاربر می‌تواند این رفتار را با تنظیم متغیر محیطی :envvar:`PYTHONHOME`" +" بازتعریف کند، یا با تنظیم :envvar:`PYTHONPATH` پوشه‌های اضافی را در ابتدای " +"مسیر استاندارد درج کند." -msgid "The embedding application can steer the search by setting :c:member:`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. Note that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is still inserted in front of the standard path. An application that requires total control has to provide its own implementation of :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)." -msgstr "" +msgid "" +"The embedding application can steer the search by setting " +":c:member:`PyConfig.program_name` *before* calling " +":c:func:`Py_InitializeFromConfig`. Note that :envvar:`PYTHONHOME` still " +"overrides this and :envvar:`PYTHONPATH` is still inserted in front of the " +"standard path. An application that requires total control has to provide " +"its own implementation of :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, " +":c:func:`Py_GetExecPrefix`, and :c:func:`Py_GetProgramFullPath` (all defined" +" in :file:`Modules/getpath.c`)." +msgstr "" +"برنامه جاسازنده می‌تواند با تنظیم :c:member:`PyConfig.program_name` *پیش از*" +" فراخوانی :c:func:`Py_InitializeFromConfig` جستجو را هدایت کند. توجه داشته " +"باشید که :envvar:`PYTHONHOME` همچنان این تنظیم را لغو می‌کند و " +":envvar:`PYTHONPATH` همچنان در ابتدای مسیر استاندارد درج می‌شود. برنامه‌ای " +"که به کنترل کامل نیاز دارد، باید پیاده‌سازی خودش از :c:func:`Py_GetPath`، " +":c:func:`Py_GetPrefix`، :c:func:`Py_GetExecPrefix` و " +":c:func:`Py_GetProgramFullPath` را فراهم کند (که همگی در " +":file:`Modules/getpath.c` تعریف شده‌اند)." -msgid "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the application may want to start over (make another call to :c:func:`Py_Initialize`) or the application is simply done with its use of Python and wants to free memory allocated by Python. This can be accomplished by calling :c:func:`Py_FinalizeEx`. The function :c:func:`Py_IsInitialized` returns true if Python is currently in the initialized state. More information about these functions is given in a later chapter. Notice that :c:func:`Py_FinalizeEx` does *not* free all memory allocated by the Python interpreter, e.g. memory allocated by extension modules currently cannot be released." -msgstr "" +msgid "" +"Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " +"application may want to start over (make another call to " +":c:func:`Py_Initialize`) or the application is simply done with its use of " +"Python and wants to free memory allocated by Python. This can be " +"accomplished by calling :c:func:`Py_FinalizeEx`. The function " +":c:func:`Py_IsInitialized` returns true if Python is currently in the " +"initialized state. More information about these functions is given in a " +"later chapter. Notice that :c:func:`Py_FinalizeEx` does *not* free all " +"memory allocated by the Python interpreter, e.g. memory allocated by " +"extension modules currently cannot be released." +msgstr "" +"گاهی مطلوب است که پایتون را «مقداردهی‌زدایی» (uninitialize) کنید. برای " +"نمونه، ممکن است برنامه بخواهد از نو شروع کند (فراخوانی دوباره‌ی " +":c:func:`Py_Initialize`) یا اینکه کار برنامه با پایتون به‌سادگی تمام شده " +"باشد و بخواهد حافظه‌ای را که پایتون تخصیص داده است آزاد کند. این کار را " +"می‌توان با فراخوانی :c:func:`Py_FinalizeEx` انجام داد. تابع " +":c:func:`Py_IsInitialized` در صورتی که پایتون در حال حاضر در وضعیت " +"مقداردهی‌شده باشد، مقدار true برمی‌گرداند. اطلاعات بیشتر درباره‌ی این توابع " +"در فصلی بعدی ارائه شده است. توجه داشته باشید که :c:func:`Py_FinalizeEx` تمام" +" حافظه‌ی تخصیص‌یافته توسط مفسر پایتون را آزاد *نمی‌کند*؛ مثلاً حافظه‌ی " +"تخصیص‌یافته توسط ماژول‌های توسعه‌ای در حال حاضر قابل آزادسازی نیست." msgid "Debugging Builds" -msgstr "" +msgstr "ساخت‌های اشکال‌زدایی" -msgid "Python can be built with several macros to enable extra checks of the interpreter and extension modules. These checks tend to add a large amount of overhead to the runtime so they are not enabled by default." +msgid "" +"Python can be built with several macros to enable extra checks of the " +"interpreter and extension modules. These checks tend to add a large amount " +"of overhead to the runtime so they are not enabled by default." msgstr "" +"پایتون را می‌توان با چندین ماکرو ساخت تا بررسی‌های اضافی مفسر و ماژول‌های " +"توسعه‌ای فعال شوند. این بررسی‌ها معمولاً سربار زیادی به ران‌تایم اضافه " +"می‌کنند، بنابراین به‌طور پیش‌فرض فعال نیستند." -msgid "A full list of the various types of debugging builds is in the file :file:`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are available that support tracing of reference counts, debugging the memory allocator, or low-level profiling of the main interpreter loop. Only the most frequently used builds will be described in the remainder of this section." -msgstr "" +msgid "" +"A full list of the various types of debugging builds is in the file " +":file:`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are" +" available that support tracing of reference counts, debugging the memory " +"allocator, or low-level profiling of the main interpreter loop. Only the " +"most frequently used builds will be described in the remainder of this " +"section." +msgstr "" +"فهرست کامل انواع مختلف ساخت‌های اشکال‌زدایی در پرونده " +":file:`Misc/SpecialBuilds.txt` در توزیع کد منبع پایتون قرار دارد. ساخت‌هایی " +"در دسترس هستند که از ردگیری شمارش ارجاع، اشکال‌زدایی تخصیص‌دهنده حافظه یا " +"پروفایل‌گیری سطح پایین حلقه اصلی مفسر پشتیبانی می‌کنند. در ادامه این بخش، " +"تنها پرکاربردترین ساخت‌ها توضیح داده خواهند شد." -msgid "Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding :option:`--with-pydebug` to the :file:`./configure` command. It is also implied by the presence of the not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled in the Unix build, compiler optimization is disabled." -msgstr "" +msgid "" +"Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined " +"produces what is generally meant by :ref:`a debug build of Python `. :c:macro:`!Py_DEBUG` is enabled in the Unix build by adding " +":option:`--with-pydebug` to the :file:`./configure` command. It is also " +"implied by the presence of the not-Python-specific :c:macro:`!_DEBUG` macro." +" When :c:macro:`!Py_DEBUG` is enabled in the Unix build, compiler " +"optimization is disabled." +msgstr "" +"کامپایل کردن مفسر در حالی که ماکروی :c:macro:`!Py_DEBUG` تعریف‌شده باشد، " +"چیزی را تولید می‌کند که عموماً از :ref:`بیلد دیباگ پایتون ` " +"منظور می‌شود. ماکروی :c:macro:`!Py_DEBUG` در بیلد یونیکس با افزودن " +":option:`--with-pydebug` به دستور :file:`./configure` فعال می‌شود. این ماکرو" +" همچنین با وجود ماکروی :c:macro:`!_DEBUG` که مختص پایتون نیست، به‌طور ضمنی " +"فعال می‌شود. هنگامی که :c:macro:`!Py_DEBUG` در بیلد یونیکس فعال باشد، " +"بهینه‌سازی کامپایلر غیرفعال می‌شود." -msgid "In addition to the reference count debugging described below, extra checks are performed, see :ref:`Python Debug Build `." +msgid "" +"In addition to the reference count debugging described below, extra checks " +"are performed, see :ref:`Python Debug Build `." msgstr "" +"علاوه بر اشکال‌زدایی شمارش ارجاع که در زیر شرح داده شده، بررسی‌های اضافی نیز" +" انجام می‌شود؛ به :ref:`نسخه دیباگ پایتون ` مراجعه کنید." -msgid "Defining ``Py_TRACE_REFS`` enables reference tracing (see the :option:`configure --with-trace-refs option <--with-trace-refs>`). When defined, a circular doubly linked list of active objects is maintained by adding two extra fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon exit, all existing references are printed. (In interactive mode this happens after every statement run by the interpreter.)" -msgstr "" +msgid "" +"Defining ``Py_TRACE_REFS`` enables reference tracing (see the " +":option:`configure --with-trace-refs option <--with-trace-refs>`). When " +"defined, a circular doubly linked list of active objects is maintained by " +"adding two extra fields to every :c:type:`PyObject`. Total allocations are " +"tracked as well. Upon exit, all existing references are printed. (In " +"interactive mode this happens after every statement run by the interpreter.)" +msgstr "" +"تعریف ``Py_TRACE_REFS`` ردگیری ارجاع را فعال می‌کند (به :option:`configure " +"--with-trace-refs option <--with-trace-refs>` مراجعه کنید). هنگامی که تعریف " +"شود، با افزودن دو فیلد اضافی به هر :c:type:`PyObject`، یک فهرست پیوندی " +"دوطرفه‌ی حلقوی از اشیاء فعال نگهداری می‌شود. مجموع تخصیص‌ها نیز پیگیری " +"می‌شود. هنگام خروج، تمام ارجاع‌های موجود چاپ می‌شوند. (در حالت تعاملی، این " +"کار پس از اجرای هر دستور توسط مفسر انجام می‌شود.)" -msgid "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source distribution for more detailed information." +msgid "" +"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " +"distribution for more detailed information." msgstr "" +"لطفاً برای اطلاعات مفصل‌تر به :file:`Misc/SpecialBuilds.txt` در توزیع منبع " +"پایتون مراجعه کنید." msgid "Recommended third party tools" -msgstr "" +msgstr "ابزارهای شخص ثالث پیشنهادی" -msgid "The following third party tools offer both simpler and more sophisticated approaches to creating C, C++ and Rust extensions for Python:" +msgid "" +"The following third party tools offer both simpler and more sophisticated " +"approaches to creating C, C++ and Rust extensions for Python:" msgstr "" +"ابزارهای شخص ثالث زیر رویکردهایی هم ساده‌تر و هم پیشرفته‌تر برای ایجاد " +"افزونه‌های C، C++ و Rust برای پایتون ارائه می‌دهند:" msgid "`Cython `_" -msgstr "" +msgstr "`Cython `_" msgid "`cffi `_" -msgstr "" +msgstr "`cffi `_" msgid "`HPy `_" -msgstr "" +msgstr "`HPy `_" msgid "`nanobind `_ (C++)" -msgstr "" +msgstr "`nanobind `_ (C++)" msgid "`Numba `_" -msgstr "" +msgstr "`Numba `_" msgid "`pybind11 `_ (C++)" -msgstr "" +msgstr "`pybind11 `_ (C++)" msgid "`PyO3 `_ (Rust)" -msgstr "" +msgstr "`PyO3 `_ (Rust)" msgid "`SWIG `_" -msgstr "" +msgstr "`SWIG `_" -msgid "Using tools such as these can help avoid writing code that is tightly bound to a particular version of CPython, avoid reference counting errors, and focus more on your own code than on using the CPython API. In general, new versions of Python can be supported by updating the tool, and your code will often use newer and more efficient APIs automatically. Some tools also support compiling for other implementations of Python from a single set of sources." -msgstr "" +msgid "" +"Using tools such as these can help avoid writing code that is tightly bound " +"to a particular version of CPython, avoid reference counting errors, and " +"focus more on your own code than on using the CPython API. In general, new " +"versions of Python can be supported by updating the tool, and your code will" +" often use newer and more efficient APIs automatically. Some tools also " +"support compiling for other implementations of Python from a single set of " +"sources." +msgstr "" +"استفاده از چنین ابزارهایی می‌تواند به شما کمک کند تا از نوشتن کدی که به‌شدت " +"به نسخه‌ی خاصی از سی‌پایتون وابسته است، اجتناب کنید، از خطاهای شمارش ارجاع " +"بپرهیزید و بیشتر بر کد خودتان تمرکز کنید تا بر استفاده از API سی‌پایتون. " +"به‌طور کلی، می‌توان با به‌روزرسانی ابزار، از نسخه‌های جدید پایتون پشتیبانی " +"کرد و کد شما اغلب به‌طور خودکار از APIهای جدیدتر و کارآمدتر استفاده خواهد " +"کرد. برخی از ابزارها همچنین از کامپایل برای پیاده‌سازی‌های دیگر پایتون با یک" +" مجموعه واحد از کدهای منبع پشتیبانی می‌کنند." -msgid "These projects are not supported by the same people who maintain Python, and issues need to be raised with the projects directly. Remember to check that the project is still maintained and supported, as the list above may become outdated." +msgid "" +"These projects are not supported by the same people who maintain Python, and" +" issues need to be raised with the projects directly. Remember to check that" +" the project is still maintained and supported, as the list above may become" +" outdated." msgstr "" +"این پروژه‌ها توسط همان افرادی که پایتون را نگه‌داری می‌کنند، پشتیبانی " +"نمی‌شوند و مشکلات باید مستقیماً با خود پروژه‌ها مطرح شوند. به یاد داشته " +"باشید که بررسی کنید پروژه هنوز نگه‌داری و پشتیبانی می‌شود، زیرا ممکن است " +"فهرست بالا از تاریخ بیفتد." -msgid "`Python Packaging User Guide: Binary Extensions `_" +msgid "" +"`Python Packaging User Guide: Binary Extensions " +"`_" msgstr "" +"`راهنمای کاربری بسته‌بندی پایتون: افزونه‌های دودویی " +"`_" -msgid "The Python Packaging User Guide not only covers several available tools that simplify the creation of binary extensions, but also discusses the various reasons why creating an extension module may be desirable in the first place." +msgid "" +"The Python Packaging User Guide not only covers several available tools that" +" simplify the creation of binary extensions, but also discusses the various " +"reasons why creating an extension module may be desirable in the first " +"place." msgstr "" +"راهنمای کاربر بسته‌بندی پایتون (Python Packaging User Guide) نه‌تنها چندین " +"ابزار موجود را پوشش می‌دهد که ایجاد توسعه‌های دودویی را ساده می‌کنند، بلکه " +"به دلایل مختلفی نیز می‌پردازد که چرا از اساس ایجاد یک ماژول توسعه‌ای " +"می‌تواند مطلوب باشد." msgid "object" -msgstr "" +msgstr "شیء" msgid "type" -msgstr "" +msgstr "نوع" msgid "Py_INCREF (C function)" -msgstr "" +msgstr "Py_INCREF (تابع C)" msgid "Py_DECREF (C function)" -msgstr "" +msgstr "Py_DECREF (تابع C)" msgid "PyList_SetItem (C function)" -msgstr "" +msgstr "PyList_SetItem (تابع C)" msgid "PyTuple_SetItem (C function)" -msgstr "" +msgstr "PyTuple_SetItem (تابع C)" msgid "set_all()" -msgstr "" +msgstr "set_all()" msgid "PyList_GetItem (C function)" -msgstr "" +msgstr "PyList_GetItem (تابع C)" msgid "PySequence_GetItem (C function)" -msgstr "" +msgstr "PySequence_GetItem (تابع C)" msgid "sum_list()" -msgstr "" +msgstr "sum_list()" msgid "sum_sequence()" -msgstr "" +msgstr "sum_sequence()" msgid "PyErr_Occurred (C function)" -msgstr "" +msgstr "PyErr_Occurred (تابع C)" msgid "PyErr_SetString (C function)" -msgstr "" +msgstr "PyErr_SetString (تابع C)" msgid "PyErr_Clear (C function)" -msgstr "" +msgstr "PyErr_Clear (تابع C)" msgid "exc_info (in module sys)" -msgstr "" +msgstr "exc_info (در ماژول sys)" msgid "incr_item()" -msgstr "" +msgstr "incr_item()" msgid "PyErr_ExceptionMatches (C function)" -msgstr "" +msgstr "PyErr_ExceptionMatches (تابع C)" msgid "Py_XDECREF (C function)" -msgstr "" +msgstr "Py_XDECREF (تابع C)" msgid "Py_Initialize (C function)" -msgstr "" +msgstr "Py_Initialize (تابع C)" msgid "module" -msgstr "" +msgstr "ماژول" msgid "builtins" -msgstr "" +msgstr "توکارها" msgid "__main__" -msgstr "" +msgstr "__main__" msgid "sys" -msgstr "" +msgstr "sys" msgid "search" -msgstr "" +msgstr "جستجو" msgid "path" -msgstr "" +msgstr "مسیر" msgid "path (in module sys)" -msgstr "" +msgstr "path (در ماژول sys)" msgid "Py_GetPath (C function)" -msgstr "" +msgstr "Py_GetPath (تابع C)" msgid "Py_GetPrefix (C function)" -msgstr "" +msgstr "Py_GetPrefix (تابع C)" msgid "Py_GetExecPrefix (C function)" -msgstr "" +msgstr "Py_GetExecPrefix (تابع C)" msgid "Py_GetProgramFullPath (C function)" -msgstr "" +msgstr "Py_GetProgramFullPath (تابع C)" msgid "Py_IsInitialized (C function)" -msgstr "" +msgstr "Py_IsInitialized (تابع C)" diff --git a/c-api/iter.po b/c-api/iter.po index 35d70b8b5..b7d588962 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -22,37 +22,85 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Iterator Protocol" -msgstr "" +msgstr "پروتکل پیمایش‌گر" msgid "There are two functions specifically for working with iterators." -msgstr "" +msgstr "دو تابع به‌طور خاص برای کار با پیمایش‌گرها وجود دارند." -msgid "Return non-zero if the object *o* can be safely passed to :c:func:`PyIter_NextItem` and ``0`` otherwise. This function always succeeds." +msgid "" +"Return non-zero if the object *o* can be safely passed to " +":c:func:`PyIter_NextItem` and ``0`` otherwise. This function always " +"succeeds." msgstr "" +"اگر شیء *o* بتواند به‌طور ایمن به :c:func:`PyIter_NextItem` پاس داده شود، " +"مقدار غیرصفر و در غیر این صورت ``0`` برگردانده می‌شود. این تابع همیشه با " +"موفقیت انجام می‌شود." -msgid "Return non-zero if the object *o* provides the :class:`AsyncIterator` protocol, and ``0`` otherwise. This function always succeeds." +msgid "" +"Return non-zero if the object *o* provides the :class:`AsyncIterator` " +"protocol, and ``0`` otherwise. This function always succeeds." msgstr "" +"اگر شیء *o* پروتکل :class:`AsyncIterator` را فراهم کند، مقدار غیر صفر " +"برمی‌گرداند و در غیر این صورت ``0``. این تابع همیشه موفق می‌شود." -msgid "Return ``1`` and set *item* to a :term:`strong reference` of the next value of the iterator *iter* on success. Return ``0`` and set *item* to ``NULL`` if there are no remaining values. Return ``-1``, set *item* to ``NULL`` and set an exception on error." +msgid "" +"Return ``1`` and set *item* to a :term:`strong reference` of the next value " +"of the iterator *iter* on success. Return ``0`` and set *item* to ``NULL`` " +"if there are no remaining values. Return ``-1``, set *item* to ``NULL`` and " +"set an exception on error." msgstr "" +"در صورت موفقیت، مقدار ``1`` را برمی‌گرداند و *item* را برابر یک :term:`ارجاع" +" قوی ` به مقدار بعدی پیمایش‌گر *iter* قرار می‌دهد. اگر هیچ" +" مقدار باقی‌مانده‌ای وجود نداشته باشد، مقدار ``0`` را برمی‌گرداند و *item* " +"را برابر ``NULL`` قرار می‌دهد. در صورت خطا، مقدار ``-1`` را برمی‌گرداند، " +"*item* را برابر ``NULL`` قرار می‌دهد و یک استثنا تنظیم می‌کند." -msgid "This is an older version of :c:func:`!PyIter_NextItem`, which is retained for backwards compatibility. Prefer :c:func:`PyIter_NextItem`." +msgid "" +"This is an older version of :c:func:`!PyIter_NextItem`, which is retained " +"for backwards compatibility. Prefer :c:func:`PyIter_NextItem`." msgstr "" +"این نسخه‌ای قدیمی‌تر از :c:func:`!PyIter_NextItem` است که برای سازگاری با " +"نسخه‌های قبلی نگه داشته شده است. استفاده از :c:func:`PyIter_NextItem` را " +"ترجیح دهید." -msgid "Return the next value from the iterator *o*. The object must be an iterator according to :c:func:`PyIter_Check` (it is up to the caller to check this). If there are no remaining values, returns ``NULL`` with no exception set. If an error occurs while retrieving the item, returns ``NULL`` and passes along the exception." +msgid "" +"Return the next value from the iterator *o*. The object must be an iterator" +" according to :c:func:`PyIter_Check` (it is up to the caller to check this)." +" If there are no remaining values, returns ``NULL`` with no exception set. " +"If an error occurs while retrieving the item, returns ``NULL`` and passes " +"along the exception." msgstr "" +"مقدار بعدی را از پیمایش‌گر *o* برمی‌گرداند. شیء باید طبق " +":c:func:`PyIter_Check` یک پیمایش‌گر باشد (بررسی این مورد بر عهده‌ی " +"فراخوان‌کننده است). اگر مقدار باقی‌مانده‌ای وجود نداشته باشد، ``NULL`` را " +"بدون تنظیم هیچ استثنایی برمی‌گرداند. اگر هنگام بازیابی آیتم خطایی رخ دهد، " +"``NULL`` را برمی‌گرداند و استثنا را منتقل می‌کند." -msgid "The enum value used to represent different results of :c:func:`PyIter_Send`." +msgid "" +"The enum value used to represent different results of :c:func:`PyIter_Send`." msgstr "" +"مقدار enum که برای نمایش نتایج مختلف تابع :c:func:`PyIter_Send` استفاده " +"می‌شود." msgid "Sends the *arg* value into the iterator *iter*. Returns:" -msgstr "" +msgstr "مقدار *arg* را به پیمایش‌گر *iter* ارسال می‌کند. بازگشت:" -msgid "``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*." +msgid "" +"``PYGEN_RETURN`` if iterator returns. Return value is returned via " +"*presult*." msgstr "" +"``PYGEN_RETURN`` اگر پیمایش‌گر بازگشت کند. مقدار بازگشتی از طریق *presult* " +"بازگردانده می‌شود." -msgid "``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*." +msgid "" +"``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*." msgstr "" +"``PYGEN_NEXT`` اگر پیمایش‌گر مقداری تولید کند. مقدار تولیدشده از طریق " +"*presult* بازگردانده می‌شود." -msgid "``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``." +msgid "" +"``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to " +"``NULL``." msgstr "" +"``PYGEN_ERROR`` اگر پیمایش‌گر استثنایی مطرح کرده باشد. *presult* برابر " +"``NULL`` قرار می‌گیرد." diff --git a/c-api/iterator.po b/c-api/iterator.po index 50655a5d4..647e2aab9 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -22,73 +22,135 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Iterator Objects" -msgstr "" +msgstr "اشیاء پیمایش‌گر" -msgid "Python provides two general-purpose iterator objects. The first, a sequence iterator, works with an arbitrary sequence supporting the :meth:`~object.__getitem__` method. The second works with a callable object and a sentinel value, calling the callable for each item in the sequence, and ending the iteration when the sentinel value is returned." -msgstr "" +msgid "" +"Python provides two general-purpose iterator objects. The first, a sequence" +" iterator, works with an arbitrary sequence supporting the " +":meth:`~object.__getitem__` method. The second works with a callable object" +" and a sentinel value, calling the callable for each item in the sequence, " +"and ending the iteration when the sentinel value is returned." +msgstr "" +"پایتون دو شیء پیمایش‌گر همه‌منظوره فراهم می‌کند. اولی یک پیمایش‌گر دنباله " +"است که با هر دنباله دلخواهی که از متد :meth:`~object.__getitem__` پشتیبانی " +"می‌کند کار می‌کند. دومی با یک شیء فراخوانی‌پذیر و یک مقدار نشانگر کار " +"می‌کند؛ فراخوانی‌پذیر برای هر آیتم در دنباله فراخوانی می‌شود و پیمایش هنگامی" +" که مقدار نشانگر بازگردانده شود پایان می‌یابد." -msgid "Type object for iterator objects returned by :c:func:`PySeqIter_New` and the one-argument form of the :func:`iter` built-in function for built-in sequence types." +msgid "" +"Type object for iterator objects returned by :c:func:`PySeqIter_New` and the" +" one-argument form of the :func:`iter` built-in function for built-in " +"sequence types." msgstr "" +"شیء نوع برای اشیاء پیمایش‌گری که توسط :c:func:`PySeqIter_New` و شکل " +"تک‌آرگومانی تابع توکار :func:`iter` برای نوع‌های دنباله توکار بازگردانده " +"می‌شوند." -msgid "Return true if the type of *op* is :c:data:`PySeqIter_Type`. This function always succeeds." +msgid "" +"Return true if the type of *op* is :c:data:`PySeqIter_Type`. This function " +"always succeeds." msgstr "" +"اگر نوع *op* برابر :c:data:`PySeqIter_Type` باشد، مقدار true را برمی‌گرداند." +" این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return an iterator that works with a general sequence object, *seq*. The iteration ends when the sequence raises :exc:`IndexError` for the subscripting operation." +msgid "" +"Return an iterator that works with a general sequence object, *seq*. The " +"iteration ends when the sequence raises :exc:`IndexError` for the " +"subscripting operation." msgstr "" +"یک پیمایش‌گر برمی‌گرداند که با شیء دنباله‌ی عمومی، *seq* کار می‌کند. پیمایش " +"زمانی پایان می‌یابد که دنباله هنگام عملیات زیرنویسی، استثنای " +":exc:`IndexError` را ایجاد کند." -msgid "Type object for iterator objects returned by :c:func:`PyCallIter_New` and the two-argument form of the :func:`iter` built-in function." +msgid "" +"Type object for iterator objects returned by :c:func:`PyCallIter_New` and " +"the two-argument form of the :func:`iter` built-in function." msgstr "" +"شیء نوع برای اشیاء پیمایش‌گری که توسط :c:func:`PyCallIter_New` و شکل " +"دوآرگومانی تابع توکار :func:`iter` بازگردانده می‌شوند." -msgid "Return true if the type of *op* is :c:data:`PyCallIter_Type`. This function always succeeds." +msgid "" +"Return true if the type of *op* is :c:data:`PyCallIter_Type`. This function" +" always succeeds." msgstr "" +"اگر نوع *op* برابر با :c:data:`PyCallIter_Type` باشد، مقدار true را " +"برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return a new iterator. The first parameter, *callable*, can be any Python callable object that can be called with no parameters; each call to it should return the next item in the iteration. When *callable* returns a value equal to *sentinel*, the iteration will be terminated." +msgid "" +"Return a new iterator. The first parameter, *callable*, can be any Python " +"callable object that can be called with no parameters; each call to it " +"should return the next item in the iteration. When *callable* returns a " +"value equal to *sentinel*, the iteration will be terminated." msgstr "" +"یک پیمایش‌گر جدید برگردانید. پارامتر اول، *callable*، می‌تواند هر شیء " +"فراخوانی‌پذیر پایتونی باشد که بدون هیچ پارامتری می‌توان آن را فراخوانی کرد؛ " +"هر فراخوانی آن باید آیتم بعدی در پیمایش را برگرداند. وقتی *callable* مقداری " +"برابر با *sentinel* برگرداند، پیمایش خاتمه می‌یابد." msgid "Range Objects" -msgstr "" +msgstr "اشیاء بازه" msgid "The type object for :class:`range` objects." -msgstr "" +msgstr "شیء نوع برای اشیاء :class:`range`." -msgid "Return true if the object *o* is an instance of a :class:`range` object. This function always succeeds." +msgid "" +"Return true if the object *o* is an instance of a :class:`range` object. " +"This function always succeeds." msgstr "" +"در صورتی که شیء *o* نمونه‌ای از یک شیء :class:`range` باشد، true را " +"برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." msgid "Builtin Iterator Types" -msgstr "" +msgstr "نوع‌های پیمایش‌گر توکار" -msgid "These are built-in iteration types that are included in Python's C API, but provide no additional functions. They are here for completeness." +msgid "" +"These are built-in iteration types that are included in Python's C API, but " +"provide no additional functions. They are here for completeness." msgstr "" +"این‌ها نوع‌های پیمایش توکار هستند که در API زبان C پایتون گنجانده شده‌اند، " +"اما هیچ تابع اضافه‌ای ارائه نمی‌دهند. آن‌ها برای کامل بودن اینجا قرار دارند." msgid "C type" -msgstr "" +msgstr "نوع C" msgid "Python type" -msgstr "" +msgstr "نوع پایتونی" msgid ":py:class:`enumerate`" -msgstr "" +msgstr ":py:class:`enumerate`" msgid ":py:class:`filter`" -msgstr "" +msgstr ":py:class:`filter`" msgid ":py:class:`map`" -msgstr "" +msgstr ":py:class:`map`" msgid ":py:class:`reversed`" -msgstr "" +msgstr ":py:class:`reversed`" msgid ":py:class:`zip`" -msgstr "" +msgstr ":py:class:`zip`" msgid "Other Iterator Objects" -msgstr "" +msgstr "سایر اشیاء پیمایش‌گر" msgid "Type objects for iterators of various built-in objects." -msgstr "" +msgstr "شیءهای نوع برای پیمایش‌گرهای شیءهای توکار گوناگون." -msgid "Do not create instances of these directly; prefer calling :c:func:`PyObject_GetIter` instead." +msgid "" +"Do not create instances of these directly; prefer calling " +":c:func:`PyObject_GetIter` instead." msgstr "" +"نمونه‌هایی از این‌ها را مستقیماً ایجاد نکنید؛ به جای آن، فراخوانی " +":c:func:`PyObject_GetIter` را ترجیح دهید." -msgid "Note that there is no guarantee that a given built-in type uses a given iterator type. For example, iterating over :class:`range` will use one of two iterator types depending on the size of the range. Other types may start using a similar scheme in the future, without warning." -msgstr "" +msgid "" +"Note that there is no guarantee that a given built-in type uses a given " +"iterator type. For example, iterating over :class:`range` will use one of " +"two iterator types depending on the size of the range. Other types may start" +" using a similar scheme in the future, without warning." +msgstr "" +"توجه داشته باشید که هیچ تضمینی وجود ندارد که یک نوع توکار مشخص از نوع " +"پیمایش‌گر مشخصی استفاده کند. برای مثال، پیمایش روی :class:`range` بسته به " +"اندازه‌ی بازه از یکی از دو نوع پیمایش‌گر استفاده می‌کند. نوع‌های دیگر ممکن " +"است در آینده بدون هشدار شروع به استفاده از طرح‌واره‌ای مشابه کنند." diff --git a/c-api/lifecycle.po b/c-api/lifecycle.po index 606767cf1..5daa236c3 100644 --- a/c-api/lifecycle.po +++ b/c-api/lifecycle.po @@ -20,136 +20,478 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Object Life Cycle" -msgstr "" +msgstr "چرخه‌ی حیات شیء" -msgid "This section explains how a type's slots relate to each other throughout the life of an object. It is not intended to be a complete canonical reference for the slots; instead, refer to the slot-specific documentation in :ref:`type-structs` for details about a particular slot." +msgid "" +"This section explains how a type's slots relate to each other throughout the" +" life of an object. It is not intended to be a complete canonical reference" +" for the slots; instead, refer to the slot-specific documentation in " +":ref:`type-structs` for details about a particular slot." msgstr "" +"این بخش توضیح می‌دهد که جایگاه‌های یک نوع در طول عمر یک شیء چگونه با یکدیگر " +"در ارتباط هستند. این بخش به‌عنوان مرجع کامل و کانونیکال برای جایگاه‌ها در " +"نظر گرفته نشده است؛ در عوض، برای جزئیات درباره‌ی یک جایگاه خاص، به مستندات " +"اختصاصی جایگاه در :ref:`type-structs` مراجعه کنید." msgid "Life Events" -msgstr "" +msgstr "رویدادهای چرخه حیات" -msgid "The figure below illustrates the order of events that can occur throughout an object's life. An arrow from *A* to *B* indicates that event *B* can occur after event *A* has occurred, with the arrow's label indicating the condition that must be true for *B* to occur after *A*." +msgid "" +"The figure below illustrates the order of events that can occur throughout " +"an object's life. An arrow from *A* to *B* indicates that event *B* can " +"occur after event *A* has occurred, with the arrow's label indicating the " +"condition that must be true for *B* to occur after *A*." msgstr "" +"شکل زیر ترتیب رویدادهایی را که در طول عمر یک شیء می‌توانند رخ دهند نشان " +"می‌دهد. پیکانی از *A* به *B* نشان می‌دهد که رویداد *B* می‌تواند پس از رخ " +"دادن رویداد *A* رخ دهد، و برچسب پیکان، شرطی را که برای رخ دادن *B* پس از *A*" +" باید برقرار باشد، مشخص می‌کند." -msgid "Diagram showing events in an object's life. Explained in detail below." +msgid "" +"Diagram showing events in an object's life. Explained in detail below." msgstr "" +"نموداری که رویدادهای طول عمر یک شیء را نشان می‌دهد. در ادامه با جزئیات " +"توضیح داده شده است." msgid "Explanation:" -msgstr "" +msgstr "توضیح:" msgid "When a new object is constructed by calling its type:" -msgstr "" +msgstr "هنگامی که شیء جدیدی با فراخوانی نوع آن ساخته می‌شود:" msgid ":c:member:`~PyTypeObject.tp_new` is called to create a new object." msgstr "" +":c:member:`~PyTypeObject.tp_new` برای ایجاد یک شیء جدید فراخوانی می‌شود." -msgid ":c:member:`~PyTypeObject.tp_alloc` is directly called by :c:member:`~PyTypeObject.tp_new` to allocate the memory for the new object." +msgid "" +":c:member:`~PyTypeObject.tp_alloc` is directly called by " +":c:member:`~PyTypeObject.tp_new` to allocate the memory for the new object." msgstr "" +":c:member:`~PyTypeObject.tp_alloc` مستقیماً توسط " +":c:member:`~PyTypeObject.tp_new` برای تخصیص حافظه‌ی شیء جدید فراخوانی " +"می‌شود." -msgid ":c:member:`~PyTypeObject.tp_init` initializes the newly created object. :c:member:`!tp_init` can be called again to re-initialize an object, if desired. The :c:member:`!tp_init` call can also be skipped entirely, for example by Python code calling :py:meth:`~object.__new__`." +msgid "" +":c:member:`~PyTypeObject.tp_init` initializes the newly created object. " +":c:member:`!tp_init` can be called again to re-initialize an object, if " +"desired. The :c:member:`!tp_init` call can also be skipped entirely, for " +"example by Python code calling :py:meth:`~object.__new__`." msgstr "" +":c:member:`~PyTypeObject.tp_init` شیء تازه‌ایجادشده را مقداردهی اولیه " +"می‌کند. در صورت تمایل می‌توان :c:member:`!tp_init` را دوباره فراخوانی کرد تا" +" یک شیء مجدداً مقداردهی اولیه شود. همچنین می‌توان از فراخوانی " +":c:member:`!tp_init` به‌طور کامل صرف‌نظر کرد، برای مثال توسط کد پایتونی که " +":py:meth:`~object.__new__` را فراخوانی می‌کند." msgid "After :c:member:`!tp_init` completes, the object is ready to use." -msgstr "" +msgstr "پس از تکمیل :c:member:`!tp_init`، شیء آماده استفاده است." msgid "Some time after the last reference to an object is removed:" -msgstr "" +msgstr "مدتی پس از حذف آخرین ارجاع به یک شیء:" -msgid "If an object is not marked as *finalized*, it might be finalized by marking it as *finalized* and calling its :c:member:`~PyTypeObject.tp_finalize` function. Python does *not* finalize an object when the last reference to it is deleted; use :c:func:`PyObject_CallFinalizerFromDealloc` to ensure that :c:member:`~PyTypeObject.tp_finalize` is always called." -msgstr "" +msgid "" +"If an object is not marked as *finalized*, it might be finalized by marking " +"it as *finalized* and calling its :c:member:`~PyTypeObject.tp_finalize` " +"function. Python does *not* finalize an object when the last reference to " +"it is deleted; use :c:func:`PyObject_CallFinalizerFromDealloc` to ensure " +"that :c:member:`~PyTypeObject.tp_finalize` is always called." +msgstr "" +"اگر شیئی به‌عنوان *نهایی‌شده* علامت‌گذاری نشده باشد، می‌توان آن را با " +"علامت‌گذاری به‌عنوان *نهایی‌شده* و فراخوانی تابع " +":c:member:`~PyTypeObject.tp_finalize` آن نهایی‌سازی کرد. پایتون هنگامی که " +"آخرین ارجاع به یک شیء حذف می‌شود، آن را نهایی‌سازی *نمی‌کند*؛ برای اطمینان " +"از اینکه :c:member:`~PyTypeObject.tp_finalize` همیشه فراخوانی می‌شود، از " +":c:func:`PyObject_CallFinalizerFromDealloc` استفاده کنید." -msgid "If the object is marked as finalized, :c:member:`~PyTypeObject.tp_clear` might be called by the garbage collector to clear references held by the object. It is *not* called when the object's reference count reaches zero." +msgid "" +"If the object is marked as finalized, :c:member:`~PyTypeObject.tp_clear` " +"might be called by the garbage collector to clear references held by the " +"object. It is *not* called when the object's reference count reaches zero." msgstr "" +"اگر شیء به‌عنوان نهایی‌سازی‌شده علامت‌گذاری شده باشد، ممکن است " +":c:member:`~PyTypeObject.tp_clear` توسط زباله‌روب فراخوانی شود تا ارجاع‌هایی" +" را که شیء نگه‌داشته است پاک کند. این متد هنگامی که شمارش ارجاع شیء به صفر " +"برسد فراخوانی *نمی‌شود*." -msgid ":c:member:`~PyTypeObject.tp_dealloc` is called to destroy the object. To avoid code duplication, :c:member:`~PyTypeObject.tp_dealloc` typically calls into :c:member:`~PyTypeObject.tp_clear` to free up the object's references." +msgid "" +":c:member:`~PyTypeObject.tp_dealloc` is called to destroy the object. To " +"avoid code duplication, :c:member:`~PyTypeObject.tp_dealloc` typically calls" +" into :c:member:`~PyTypeObject.tp_clear` to free up the object's references." msgstr "" +":c:member:`~PyTypeObject.tp_dealloc` برای نابود کردن شیء فراخوانی می‌شود. " +"برای جلوگیری از تکرار کد، :c:member:`~PyTypeObject.tp_dealloc` معمولاً " +":c:member:`~PyTypeObject.tp_clear` را فراخوانی می‌کند تا ارجاع‌های شیء را " +"آزاد کند." -msgid "When :c:member:`~PyTypeObject.tp_dealloc` finishes object destruction, it directly calls :c:member:`~PyTypeObject.tp_free` (usually set to :c:func:`PyObject_Free` or :c:func:`PyObject_GC_Del` automatically as appropriate for the type) to deallocate the memory." +msgid "" +"When :c:member:`~PyTypeObject.tp_dealloc` finishes object destruction, it " +"directly calls :c:member:`~PyTypeObject.tp_free` (usually set to " +":c:func:`PyObject_Free` or :c:func:`PyObject_GC_Del` automatically as " +"appropriate for the type) to deallocate the memory." msgstr "" +"وقتی :c:member:`~PyTypeObject.tp_dealloc` تخریب شیء را به پایان می‌رساند، " +"برای آزادسازی حافظه :c:member:`~PyTypeObject.tp_free` را مستقیماً فراخوانی " +"می‌کند (که معمولاً به‌طور خودکار و متناسب با نوع، روی " +":c:func:`PyObject_Free` یا :c:func:`PyObject_GC_Del` تنظیم می‌شود)." -msgid "The :c:member:`~PyTypeObject.tp_finalize` function is permitted to add a reference to the object if desired. If it does, the object is *resurrected*, preventing its pending destruction. (Only :c:member:`!tp_finalize` is allowed to resurrect an object; :c:member:`~PyTypeObject.tp_clear` and :c:member:`~PyTypeObject.tp_dealloc` cannot without calling into :c:member:`!tp_finalize`.) Resurrecting an object may or may not cause the object's *finalized* mark to be removed. Currently, Python does not remove the *finalized* mark from a resurrected object if it supports garbage collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set) but does remove the mark if the object does not support garbage collection; either or both of these behaviors may change in the future." -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_finalize` function is permitted to add a " +"reference to the object if desired. If it does, the object is " +"*resurrected*, preventing its pending destruction. (Only " +":c:member:`!tp_finalize` is allowed to resurrect an object; " +":c:member:`~PyTypeObject.tp_clear` and :c:member:`~PyTypeObject.tp_dealloc` " +"cannot without calling into :c:member:`!tp_finalize`.) Resurrecting an " +"object may or may not cause the object's *finalized* mark to be removed. " +"Currently, Python does not remove the *finalized* mark from a resurrected " +"object if it supports garbage collection (i.e., the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag is set) but does remove the mark if the " +"object does not support garbage collection; either or both of these " +"behaviors may change in the future." +msgstr "" +"تابع :c:member:`~PyTypeObject.tp_finalize` در صورت تمایل مجاز است ارجاعی به " +"شیء اضافه کند. اگر چنین کند، شیء *احیا* می‌شود و از تخریب در انتظارش جلوگیری" +" می‌شود. (تنها :c:member:`!tp_finalize` مجاز است یک شیء را احیا کند؛ " +":c:member:`~PyTypeObject.tp_clear` و :c:member:`~PyTypeObject.tp_dealloc` " +"بدون فراخوانی :c:member:`!tp_finalize` نمی‌توانند این کار را انجام دهند.) " +"احیای یک شیء ممکن است باعث حذف نشان *نهایی‌شده* از روی آن شود یا نشود. در " +"حال حاضر، پایتون اگر شیء احیاشده از زباله‌روبی پشتیبانی کند (یعنی پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم شده باشد)، نشان *نهایی‌شده* را از روی آن" +" حذف نمی‌کند، اما اگر شیء از زباله‌روبی پشتیبانی نکند، این نشان را حذف " +"می‌کند؛ هر یک یا هر دوی این رفتارها ممکن است در آینده تغییر کنند." -msgid ":c:member:`~PyTypeObject.tp_dealloc` can optionally call :c:member:`~PyTypeObject.tp_finalize` via :c:func:`PyObject_CallFinalizerFromDealloc` if it wishes to reuse that code to help with object destruction. This is recommended because it guarantees that :c:member:`!tp_finalize` is always called before destruction. See the :c:member:`~PyTypeObject.tp_dealloc` documentation for example code." -msgstr "" +msgid "" +":c:member:`~PyTypeObject.tp_dealloc` can optionally call " +":c:member:`~PyTypeObject.tp_finalize` via " +":c:func:`PyObject_CallFinalizerFromDealloc` if it wishes to reuse that code " +"to help with object destruction. This is recommended because it guarantees " +"that :c:member:`!tp_finalize` is always called before destruction. See the " +":c:member:`~PyTypeObject.tp_dealloc` documentation for example code." +msgstr "" +":c:member:`~PyTypeObject.tp_dealloc` می‌تواند در صورت تمایل به استفاده مجدد " +"از آن کد برای کمک به تخریب شیء، به‌صورت اختیاری " +":c:member:`~PyTypeObject.tp_finalize` را از طریق " +":c:func:`PyObject_CallFinalizerFromDealloc` فراخوانی کند. انجام این کار " +"توصیه می‌شود، زیرا تضمین می‌کند که :c:member:`!tp_finalize` همیشه پیش از " +"تخریب فراخوانی می‌شود. برای مشاهده کد نمونه، به مستندات " +":c:member:`~PyTypeObject.tp_dealloc` مراجعه کنید." -msgid "If the object is a member of a :term:`cyclic isolate` and either :c:member:`~PyTypeObject.tp_clear` fails to break the reference cycle or the cyclic isolate is not detected (perhaps :func:`gc.disable` was called, or the :c:macro:`Py_TPFLAGS_HAVE_GC` flag was erroneously omitted in one of the involved types), the objects remain indefinitely uncollectable (they \"leak\"). See :data:`gc.garbage`." -msgstr "" +msgid "" +"If the object is a member of a :term:`cyclic isolate` and either " +":c:member:`~PyTypeObject.tp_clear` fails to break the reference cycle or the" +" cyclic isolate is not detected (perhaps :func:`gc.disable` was called, or " +"the :c:macro:`Py_TPFLAGS_HAVE_GC` flag was erroneously omitted in one of the" +" involved types), the objects remain indefinitely uncollectable (they " +"\"leak\"). See :data:`gc.garbage`." +msgstr "" +"اگر شیء عضوی از یک :term:`cyclic isolate` باشد و یا " +":c:member:`~PyTypeObject.tp_clear` در شکستن چرخه ارجاع ناکام بماند یا مجموعه" +" چرخه‌ای ایزوله (cyclic isolate) تشخیص داده نشود (شاید :func:`gc.disable` " +"فراخوانی شده باشد، یا پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` به‌اشتباه در یکی از" +" نوع‌های درگیر تنظیم نشده باشد)، اشیاء به‌طور نامحدود غیرقابل جمع‌آوری باقی " +"می‌مانند (آن‌ها «نشت» می‌کنند). :data:`gc.garbage` را ببینید." -msgid "If the object is marked as supporting garbage collection (the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:`~PyTypeObject.tp_flags`), the following events are also possible:" +msgid "" +"If the object is marked as supporting garbage collection (the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in " +":c:member:`~PyTypeObject.tp_flags`), the following events are also possible:" msgstr "" +"اگر شیء به‌عنوان پشتیبان از زباله‌روبی نشانه‌گذاری شده باشد (پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` در :c:member:`~PyTypeObject.tp_flags` تنظیم " +"شده باشد)، رویدادهای زیر نیز ممکن‌اند:" -msgid "The garbage collector occasionally calls :c:member:`~PyTypeObject.tp_traverse` to identify :term:`cyclic isolates `." +msgid "" +"The garbage collector occasionally calls " +":c:member:`~PyTypeObject.tp_traverse` to identify :term:`cyclic isolates " +"`." msgstr "" +"زباله‌روب گاهی برای شناسایی :term:`ایزوله‌های چرخه‌ای `، " +":c:member:`~PyTypeObject.tp_traverse` را فراخوانی می‌کند." -msgid "When the garbage collector discovers a :term:`cyclic isolate`, it finalizes one of the objects in the group by marking it as *finalized* and calling its :c:member:`~PyTypeObject.tp_finalize` function, if it has one. This repeats until the cyclic isolate doesn't exist or all of the objects have been finalized." -msgstr "" +msgid "" +"When the garbage collector discovers a :term:`cyclic isolate`, it finalizes " +"one of the objects in the group by marking it as *finalized* and calling its" +" :c:member:`~PyTypeObject.tp_finalize` function, if it has one. This repeats" +" until the cyclic isolate doesn't exist or all of the objects have been " +"finalized." +msgstr "" +"هنگامی که زباله‌روب یک :term:`cyclic isolate` را کشف می‌کند، یکی از اشیاء " +"درون گروه را با علامت‌گذاری آن به‌عنوان *نهایی‌شده* و فراخوانی تابع " +":c:member:`~PyTypeObject.tp_finalize` آن (در صورت وجود) نهایی‌سازی می‌کند. " +"این کار تا زمانی تکرار می‌شود که ایزوله چرخه‌ای (cyclic isolate) دیگر وجود " +"نداشته باشد یا همه‌ی اشیاء نهایی‌سازی شده باشند." -msgid ":c:member:`~PyTypeObject.tp_finalize` is permitted to resurrect the object by adding a reference from outside the :term:`cyclic isolate`. The new reference causes the group of objects to no longer form a cyclic isolate (the reference cycle may still exist, but if it does the objects are no longer isolated)." +msgid "" +":c:member:`~PyTypeObject.tp_finalize` is permitted to resurrect the object " +"by adding a reference from outside the :term:`cyclic isolate`. The new " +"reference causes the group of objects to no longer form a cyclic isolate " +"(the reference cycle may still exist, but if it does the objects are no " +"longer isolated)." msgstr "" +":c:member:`~PyTypeObject.tp_finalize` مجاز است با افزودن ارجاعی از بیرون " +":term:`cyclic isolate` شیء را احیا کند. این ارجاع جدید باعث می‌شود که گروه " +"اشیاء دیگر مجموعه منزوی چرخه‌ای (cyclic isolate) تشکیل ندهد (ممکن است چرخه " +"ارجاع همچنان وجود داشته باشد، اما در این صورت اشیاء دیگر منزوی نیستند)." -msgid "When the garbage collector discovers a :term:`cyclic isolate` and all of the objects in the group have already been marked as *finalized*, the garbage collector clears one or more of the uncleared objects in the group (possibly concurrently) by calling each's :c:member:`~PyTypeObject.tp_clear` function. This repeats as long as the cyclic isolate still exists and not all of the objects have been cleared." -msgstr "" +msgid "" +"When the garbage collector discovers a :term:`cyclic isolate` and all of the" +" objects in the group have already been marked as *finalized*, the garbage " +"collector clears one or more of the uncleared objects in the group (possibly" +" concurrently) by calling each's :c:member:`~PyTypeObject.tp_clear` " +"function. This repeats as long as the cyclic isolate still exists and not " +"all of the objects have been cleared." +msgstr "" +"وقتی زباله‌روب یک :term:`مجموعه‌ی منزوی چرخه‌ای (cyclic isolate) ` را کشف می‌کند و همه‌ی اشیاء در گروه از قبل به‌عنوان " +"*نهایی‌سازی‌شده* علامت‌گذاری شده‌اند، زباله‌روب یک یا چند شیء از اشیاء " +"پاک‌نشده در گروه را (احتمالاً به‌صورت هم‌زمان) با فراخوانی تابع " +":c:member:`~PyTypeObject.tp_clear` هر یک از آن‌ها پاک می‌کند. این کار تا " +"زمانی که مجموعه‌ی منزوی چرخه‌ای همچنان وجود داشته باشد و همه‌ی اشیاء هنوز " +"پاک نشده باشند، تکرار می‌شود." msgid "Cyclic Isolate Destruction" -msgstr "" +msgstr "تخریب چرخه‌های منزوی (Cyclic Isolate)" -msgid "Listed below are the stages of life of a hypothetical :term:`cyclic isolate` that continues to exist after each member object is finalized or cleared. It is a memory leak if a cyclic isolate progresses through all of these stages; it should vanish once all objects are cleared, if not sooner. A cyclic isolate can vanish either because the reference cycle is broken or because the objects are no longer isolated due to finalizer resurrection (see :c:member:`~PyTypeObject.tp_finalize`)." -msgstr "" +msgid "" +"Listed below are the stages of life of a hypothetical :term:`cyclic isolate`" +" that continues to exist after each member object is finalized or cleared. " +"It is a memory leak if a cyclic isolate progresses through all of these " +"stages; it should vanish once all objects are cleared, if not sooner. A " +"cyclic isolate can vanish either because the reference cycle is broken or " +"because the objects are no longer isolated due to finalizer resurrection " +"(see :c:member:`~PyTypeObject.tp_finalize`)." +msgstr "" +"در ادامه، مراحل حیات یک :term:`مجموعه‌ی منزوی حلقوی ` فرضی " +"که پس از نهایی شدن یا پاک شدن هر شیء عضو، همچنان وجود دارد، فهرست شده‌اند. " +"اگر یک مجموعه‌ی منزوی حلقوی (cyclic isolate) از تمام این مراحل عبور کند، نشت" +" حافظه رخ داده است؛ چنین مجموعه‌ای باید به محض پاک شدن تمام اشیاء ناپدید " +"شود، اگر نه زودتر از آن. مجموعه‌ی منزوی حلقوی می‌تواند یا به این دلیل ناپدید" +" شود که چرخه‌ی ارجاع شکسته شده است، یا به این دلیل که اشیاء در نتیجه احیا " +"شدن توسط نهایی‌ساز دیگر منزوی نیستند (به " +":c:member:`~PyTypeObject.tp_finalize` مراجعه کنید)." -msgid "**Reachable** (not yet a cyclic isolate): All objects are in their normal, reachable state. A reference cycle could exist, but an external reference means the objects are not yet isolated." +msgid "" +"**Reachable** (not yet a cyclic isolate): All objects are in their normal, " +"reachable state. A reference cycle could exist, but an external reference " +"means the objects are not yet isolated." msgstr "" +"**قابل دسترس** (هنوز ایزوله چرخه‌ای نیست): همه‌ی اشیاء در وضعیت عادی و قابل " +"دسترس خود هستند. ممکن است چرخه‌ی ارجاع وجود داشته باشد، اما وجود یک ارجاع " +"بیرونی به این معناست که اشیاء هنوز ایزوله نشده‌اند." -msgid "**Unreachable but consistent:** The final reference from outside the cyclic group of objects has been removed, causing the objects to become isolated (thus a cyclic isolate is born). None of the group's objects have been finalized or cleared yet. The cyclic isolate remains at this stage until some future run of the garbage collector (not necessarily the next run because the next run might not scan every object)." -msgstr "" +msgid "" +"**Unreachable but consistent:** The final reference from outside the cyclic " +"group of objects has been removed, causing the objects to become isolated " +"(thus a cyclic isolate is born). None of the group's objects have been " +"finalized or cleared yet. The cyclic isolate remains at this stage until " +"some future run of the garbage collector (not necessarily the next run " +"because the next run might not scan every object)." +msgstr "" +"**دسترس‌ناپذیر اما سازگار:** آخرین ارجاع از بیرون گروه چرخه‌ای اشیاء حذف شده" +" است و در نتیجه اشیاء منزوی شده‌اند (بدین ترتیب یک ایزوله چرخه‌ای (cyclic " +"isolate) متولد می‌شود). هیچ‌یک از اشیاء گروه هنوز نهایی‌سازی یا پاک‌سازی " +"نشده‌اند. ایزوله چرخه‌ای در این مرحله باقی می‌ماند تا اجرای آینده‌ای از " +"زباله‌روب انجام شود (که لزوماً اجرای بعدی نیست، زیرا ممکن است اجرای بعدی هر " +"شیء را پویش نکند)." -msgid "**Mix of finalized and not finalized:** Objects in a cyclic isolate are finalized one at a time, which means that there is a period of time when the cyclic isolate is composed of a mix of finalized and non-finalized objects. Finalization order is unspecified, so it can appear random. A finalized object must behave in a sane manner when non-finalized objects interact with it, and a non-finalized object must be able to tolerate the finalization of an arbitrary subset of its referents." -msgstr "" +msgid "" +"**Mix of finalized and not finalized:** Objects in a cyclic isolate are " +"finalized one at a time, which means that there is a period of time when the" +" cyclic isolate is composed of a mix of finalized and non-finalized objects." +" Finalization order is unspecified, so it can appear random. A finalized " +"object must behave in a sane manner when non-finalized objects interact with" +" it, and a non-finalized object must be able to tolerate the finalization of" +" an arbitrary subset of its referents." +msgstr "" +"**ترکیبی از نهایی‌شده و نهایی‌نشده:** اشیاء در یک مجموعه‌ی چرخه‌ای منزوی " +"(cyclic isolate) یک‌به‌یک نهایی‌سازی می‌شوند، که این بدان معناست که برای " +"مدتی، مجموعه‌ی چرخه‌ای منزوی از ترکیبی از اشیاء نهایی‌شده و نهایی‌نشده تشکیل" +" شده است. ترتیب نهایی‌سازی نامشخص است، بنابراین ممکن است تصادفی به نظر برسد." +" یک شیء نهایی‌شده باید هنگامی که اشیاء نهایی‌نشده با آن تعامل می‌کنند، به " +"شیوه‌ای منطقی رفتار کند، و یک شیء نهایی‌نشده باید بتواند نهایی‌سازی " +"زیرمجموعه‌ی دلخواهی از اشیایی را که به آن‌ها ارجاع دارد (referents) تحمل " +"کند." -msgid "**All finalized:** All objects in a cyclic isolate are finalized before any of them are cleared." +msgid "" +"**All finalized:** All objects in a cyclic isolate are finalized before any " +"of them are cleared." msgstr "" +"**همه نهایی‌سازی می‌شوند:** همه‌ی اشیاء موجود در یک ایزوله حلقوی (cyclic " +"isolate) پیش از پاک شدن هر یک از آن‌ها نهایی‌سازی می‌شوند." -msgid "**Mix of finalized and cleared:** The objects can be cleared serially or concurrently (but with the :term:`GIL` held); either way, some will finish before others. A finalized object must be able to tolerate the clearing of a subset of its referents. :pep:`442` calls this stage \"cyclic trash\"." -msgstr "" +msgid "" +"**Mix of finalized and cleared:** The objects can be cleared serially or " +"concurrently (but with the :term:`GIL` held); either way, some will finish " +"before others. A finalized object must be able to tolerate the clearing of " +"a subset of its referents. :pep:`442` calls this stage \"cyclic trash\"." +msgstr "" +"**ترکیبی از نهایی‌سازی‌شده و پاک‌سازی‌شده:** اشیاء می‌توانند به‌صورت متوالی " +"یا هم‌زمان پاک‌سازی شوند (اما با در اختیار داشتن :term:`قفل مفسر سراسری " +"`)؛ در هر دو حالت، برخی پیش از بقیه پایان می‌یابند. یک شیء " +"نهایی‌سازی‌شده باید بتواند پاک‌سازی زیرمجموعه‌ای از اشیایی که به آن‌ها ارجاع" +" دارد را تحمل کند. :pep:`442` این مرحله را «زباله چرخه‌ای» (cyclic trash) " +"می‌نامد." -msgid "**Leaked:** If a cyclic isolate still exists after all objects in the group have been finalized and cleared, then the objects remain indefinitely uncollectable (see :data:`gc.garbage`). It is a bug if a cyclic isolate reaches this stage---it means the :c:member:`~PyTypeObject.tp_clear` methods of the participating objects have failed to break the reference cycle as required." -msgstr "" +msgid "" +"**Leaked:** If a cyclic isolate still exists after all objects in the group " +"have been finalized and cleared, then the objects remain indefinitely " +"uncollectable (see :data:`gc.garbage`). It is a bug if a cyclic isolate " +"reaches this stage---it means the :c:member:`~PyTypeObject.tp_clear` methods" +" of the participating objects have failed to break the reference cycle as " +"required." +msgstr "" +"**نشت‌شده:** اگر یک منزوی حلقوی (cyclic isolate) پس از نهایی‌سازی و پاک‌سازی" +" همه‌ی اشیاء گروه همچنان وجود داشته باشد، در این صورت اشیاء برای همیشه " +"غیرقابل جمع‌آوری باقی می‌مانند (به :data:`gc.garbage` مراجعه کنید). اگر یک " +"منزوی حلقوی به این مرحله برسد، این یک باگ است---یعنی متدهای " +":c:member:`~PyTypeObject.tp_clear` اشیاء شرکت‌کننده نتوانسته‌اند چرخه‌ی " +"ارجاع را همان‌طور که لازم است بشکنند." -msgid "If :c:member:`~PyTypeObject.tp_clear` did not exist, then Python would have no way to safely break a reference cycle. Simply destroying an object in a cyclic isolate would result in a dangling pointer, triggering undefined behavior when an object referencing the destroyed object is itself destroyed. The clearing step makes object destruction a two-phase process: first :c:member:`~PyTypeObject.tp_clear` is called to partially destroy the objects enough to detangle them from each other, then :c:member:`~PyTypeObject.tp_dealloc` is called to complete the destruction." -msgstr "" +msgid "" +"If :c:member:`~PyTypeObject.tp_clear` did not exist, then Python would have " +"no way to safely break a reference cycle. Simply destroying an object in a " +"cyclic isolate would result in a dangling pointer, triggering undefined " +"behavior when an object referencing the destroyed object is itself " +"destroyed. The clearing step makes object destruction a two-phase process: " +"first :c:member:`~PyTypeObject.tp_clear` is called to partially destroy the " +"objects enough to detangle them from each other, then " +":c:member:`~PyTypeObject.tp_dealloc` is called to complete the destruction." +msgstr "" +"اگر :c:member:`~PyTypeObject.tp_clear` وجود نداشت، پایتون هیچ راهی نداشت تا " +"یک چرخه‌ی ارجاع را به‌طور ایمن قطع کند. صرفاً نابود کردن یک شیء در یک " +"مجموعه‌ی منزوی چرخه‌ای (cyclic isolate) منجر به یک اشاره‌گر سرگردان می‌شد و " +"هنگامی که شیئی که به شیء نابودشده ارجاع می‌کند، خود نابود شود، رفتار " +"تعریف‌نشده را برمی‌انگیخت. مرحله‌ی پاک‌سازی، نابود کردن شیء را به فرایندی دو" +" مرحله‌ای تبدیل می‌کند: نخست :c:member:`~PyTypeObject.tp_clear` فراخوانی " +"می‌شود تا اشیاء را تا حدی نابود کند که از یکدیگر گره‌گشایی شوند، سپس " +":c:member:`~PyTypeObject.tp_dealloc` فراخوانی می‌شود تا نابودی را کامل کند." -msgid "Unlike clearing, finalization is not a phase of destruction. A finalized object must still behave properly by continuing to fulfill its design contracts. An object's finalizer is allowed to execute arbitrary Python code, and is even allowed to prevent the impending destruction by adding a reference. The finalizer is only related to destruction by call order---if it runs, it runs before destruction, which starts with :c:member:`~PyTypeObject.tp_clear` (if called) and concludes with :c:member:`~PyTypeObject.tp_dealloc`." -msgstr "" +msgid "" +"Unlike clearing, finalization is not a phase of destruction. A finalized " +"object must still behave properly by continuing to fulfill its design " +"contracts. An object's finalizer is allowed to execute arbitrary Python " +"code, and is even allowed to prevent the impending destruction by adding a " +"reference. The finalizer is only related to destruction by call order---if " +"it runs, it runs before destruction, which starts with " +":c:member:`~PyTypeObject.tp_clear` (if called) and concludes with " +":c:member:`~PyTypeObject.tp_dealloc`." +msgstr "" +"برخلاف پاک‌سازی، نهایی‌سازی مرحله‌ای از تخریب نیست. یک شیء نهایی‌شده همچنان " +"باید با ادامه‌ی برآوردن قراردادهای طراحی‌اش، به‌درستی رفتار کند. نهایی‌ساز " +"یک شیء مجاز است هر کد پایتونی را اجرا کند، و حتی مجاز است با افزودن یک " +"ارجاع، از تخریب قریب‌الوقوع جلوگیری کند. نهایی‌ساز تنها از نظر ترتیب " +"فراخوانی با تخریب در ارتباط است---اگر اجرا شود، پیش از تخریب اجرا می‌شود؛ " +"تخریبی که با :c:member:`~PyTypeObject.tp_clear` (در صورت فراخوانی) آغاز " +"می‌شود و با :c:member:`~PyTypeObject.tp_dealloc` به پایان می‌رسد." -msgid "The finalization step is not necessary to safely reclaim the objects in a cyclic isolate, but its existence makes it easier to design types that behave in a sane manner when objects are cleared. Clearing an object might necessarily leave it in a broken, partially destroyed state---it might be unsafe to call any of the cleared object's methods or access any of its attributes. With finalization, only finalized objects can possibly interact with cleared objects; non-finalized objects are guaranteed to interact with only non-cleared (but potentially finalized) objects." -msgstr "" +msgid "" +"The finalization step is not necessary to safely reclaim the objects in a " +"cyclic isolate, but its existence makes it easier to design types that " +"behave in a sane manner when objects are cleared. Clearing an object might " +"necessarily leave it in a broken, partially destroyed state---it might be " +"unsafe to call any of the cleared object's methods or access any of its " +"attributes. With finalization, only finalized objects can possibly interact" +" with cleared objects; non-finalized objects are guaranteed to interact with" +" only non-cleared (but potentially finalized) objects." +msgstr "" +"گام نهایی‌سازی برای بازپس‌گیری ایمن اشیاء در یک مجموعه چرخه‌ای منزوی (cyclic" +" isolate) ضروری نیست، اما وجود آن طراحی نوع‌هایی را آسان‌تر می‌کند که هنگام " +"پاک‌سازی اشیاء به شیوه‌ای معقول رفتار کنند. پاک‌سازی یک شیء ممکن است آن را " +"ناگزیر در وضعیتی معیوب و نیمه‌تخریب‌شده باقی بگذارد---ممکن است فراخوانی هر " +"یک از متدهای شیء پاک‌سازی‌شده یا دسترسی به هر یک از ویژگی‌های آن ناایمن " +"باشد. با نهایی‌سازی، تنها اشیاء نهایی‌سازی‌شده ممکن است با اشیاء " +"پاک‌سازی‌شده تعامل داشته باشند؛ برای اشیاء غیرنهایی‌سازی‌شده تضمین می‌شود که" +" تنها با اشیاء پاک‌سازی‌نشده (اما به‌طور بالقوه نهایی‌سازی‌شده) تعامل داشته " +"باشند." msgid "To summarize the possible interactions:" -msgstr "" +msgstr "برای جمع‌بندی تعامل‌های ممکن:" -msgid "A non-finalized object might have references to or from non-finalized and finalized objects, but not to or from cleared objects." +msgid "" +"A non-finalized object might have references to or from non-finalized and " +"finalized objects, but not to or from cleared objects." msgstr "" +"یک شیء نهایی‌نشده ممکن است ارجاع‌هایی به اشیاء نهایی‌نشده و نهایی‌شده داشته " +"باشد یا از آن‌ها ارجاعی دریافت کند، اما به اشیاء پاک‌سازی‌شده ارجاعی ندارد و" +" از آن‌ها نیز ارجاعی دریافت نمی‌کند." -msgid "A finalized object might have references to or from non-finalized, finalized, and cleared objects." +msgid "" +"A finalized object might have references to or from non-finalized, " +"finalized, and cleared objects." msgstr "" +"یک شیء نهایی‌شده ممکن است ارجاع‌هایی به اشیاء نهایی‌نشده، نهایی‌شده و " +"پاک‌سازی‌شده داشته باشد یا آن اشیاء ارجاع‌هایی به آن داشته باشند." -msgid "A cleared object might have references to or from finalized and cleared objects, but not to or from non-finalized objects." +msgid "" +"A cleared object might have references to or from finalized and cleared " +"objects, but not to or from non-finalized objects." msgstr "" +"یک شیء پاک‌سازی‌شده ممکن است ارجاع‌هایی به اشیاء نهایی‌سازی‌شده و " +"پاک‌سازی‌شده داشته باشد یا از آن‌ها ارجاعی به آن وجود داشته باشد، اما هیچ " +"ارجاعی به اشیاء نهایی‌سازی‌نشده یا از آن‌ها به آن وجود نخواهد داشت." -msgid "Without any reference cycles, an object can be simply destroyed once its last reference is deleted; the finalization and clearing steps are not necessary to safely reclaim unused objects. However, it can be useful to automatically call :c:member:`~PyTypeObject.tp_finalize` and :c:member:`~PyTypeObject.tp_clear` before destruction anyway because type design is simplified when all objects always experience the same series of events regardless of whether they participated in a cyclic isolate. Python currently only calls :c:member:`~PyTypeObject.tp_finalize` and :c:member:`~PyTypeObject.tp_clear` as needed to destroy a cyclic isolate; this may change in a future version." -msgstr "" +msgid "" +"Without any reference cycles, an object can be simply destroyed once its " +"last reference is deleted; the finalization and clearing steps are not " +"necessary to safely reclaim unused objects. However, it can be useful to " +"automatically call :c:member:`~PyTypeObject.tp_finalize` and " +":c:member:`~PyTypeObject.tp_clear` before destruction anyway because type " +"design is simplified when all objects always experience the same series of " +"events regardless of whether they participated in a cyclic isolate. Python " +"currently only calls :c:member:`~PyTypeObject.tp_finalize` and " +":c:member:`~PyTypeObject.tp_clear` as needed to destroy a cyclic isolate; " +"this may change in a future version." +msgstr "" +"در نبود هرگونه چرخه ارجاع، یک شیء را می‌توان به‌سادگی به محض حذف آخرین ارجاع" +" به آن نابود کرد؛ گام‌های نهایی‌سازی و پاک‌سازی برای بازپس‌گیری ایمن اشیاء " +"استفاده‌نشده ضروری نیستند. با این حال، می‌تواند مفید باشد که " +":c:member:`~PyTypeObject.tp_finalize` و :c:member:`~PyTypeObject.tp_clear` " +"به هر جهت پیش از نابودی به‌طور خودکار فراخوانی شوند، زیرا وقتی همه اشیاء " +"همیشه توالی یکسانی از رویدادها را تجربه کنند، صرف‌نظر از اینکه در یک مجموعه " +"چرخه‌ای ایزوله (cyclic isolate) مشارکت داشته‌اند یا نه، طراحی نوع ساده‌تر " +"می‌شود. در حال حاضر، پایتون :c:member:`~PyTypeObject.tp_finalize` و " +":c:member:`~PyTypeObject.tp_clear` را تنها در صورت نیاز برای نابود کردن یک " +"مجموعه چرخه‌ای ایزوله فراخوانی می‌کند؛ این ممکن است در نسخه‌ای آینده تغییر " +"کند." msgid "Functions" -msgstr "" +msgstr "توابع" msgid "To allocate and free memory, see :ref:`allocating-objects`." msgstr "" +"برای تخصیص و آزادسازی حافظه، به :ref:`allocating-objects` مراجعه کنید." -msgid "Finalizes the object as described in :c:member:`~PyTypeObject.tp_finalize`. Call this function (or :c:func:`PyObject_CallFinalizerFromDealloc`) instead of calling :c:member:`~PyTypeObject.tp_finalize` directly because this function may deduplicate multiple calls to :c:member:`!tp_finalize`. Currently, calls are only deduplicated if the type supports garbage collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set); this may change in the future." -msgstr "" +msgid "" +"Finalizes the object as described in :c:member:`~PyTypeObject.tp_finalize`. " +"Call this function (or :c:func:`PyObject_CallFinalizerFromDealloc`) instead " +"of calling :c:member:`~PyTypeObject.tp_finalize` directly because this " +"function may deduplicate multiple calls to :c:member:`!tp_finalize`. " +"Currently, calls are only deduplicated if the type supports garbage " +"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set); this may " +"change in the future." +msgstr "" +"شیء را مطابق توضیحات داده‌شده در :c:member:`~PyTypeObject.tp_finalize` " +"نهایی‌سازی می‌کند. به جای فراخوانی مستقیم " +":c:member:`~PyTypeObject.tp_finalize`، این تابع (یا " +":c:func:`PyObject_CallFinalizerFromDealloc`) را فراخوانی کنید، زیرا این تابع" +" ممکن است تکرار فراخوانی‌های متعدد :c:member:`!tp_finalize` را حذف کند. در " +"حال حاضر، تکرار فراخوانی‌ها تنها زمانی حذف می‌شود که نوع از زباله‌روبی " +"پشتیبانی کند (یعنی پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم شده باشد)؛ این " +"موضوع ممکن است در آینده تغییر کند." -msgid "Same as :c:func:`PyObject_CallFinalizer` but meant to be called at the beginning of the object's destructor (:c:member:`~PyTypeObject.tp_dealloc`). There must not be any references to the object. If the object's finalizer resurrects the object, this function returns -1; no further destruction should happen. Otherwise, this function returns 0 and destruction can continue normally." -msgstr "" +msgid "" +"Same as :c:func:`PyObject_CallFinalizer` but meant to be called at the " +"beginning of the object's destructor (:c:member:`~PyTypeObject.tp_dealloc`)." +" There must not be any references to the object. If the object's finalizer " +"resurrects the object, this function returns -1; no further destruction " +"should happen. Otherwise, this function returns 0 and destruction can " +"continue normally." +msgstr "" +"همانند :c:func:`PyObject_CallFinalizer` است، اما در نظر گرفته شده که در " +"ابتدای مخرب شیء (:c:member:`~PyTypeObject.tp_dealloc`) فراخوانی شود. نباید " +"هیچ ارجاعی به شیء وجود داشته باشد. اگر نهایی‌ساز شیء آن را احیا کند، این " +"تابع مقدار -1 را برمی‌گرداند؛ هیچ تخریب بیشتری نباید رخ دهد. در غیر این " +"صورت، این تابع مقدار 0 را برمی‌گرداند و تخریب می‌تواند به‌طور عادی ادامه " +"یابد." msgid ":c:member:`~PyTypeObject.tp_dealloc` for example code." -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_dealloc` برای کد نمونه." diff --git a/c-api/list.po b/c-api/list.po index 0ea2bcf7c..c7b5d06a4 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -23,115 +23,289 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "List Objects" -msgstr "" +msgstr "اشیاء فهرست" msgid "This subtype of :c:type:`PyObject` represents a Python list object." -msgstr "" +msgstr "این زیرنوع از :c:type:`PyObject` نمایانگر یک شیء فهرست پایتون است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python list type. This is the same object as :class:`list` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python list type. " +"This is the same object as :class:`list` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نمایانگر نوع فهرست پایتون است. این همان " +"شیء :class:`list` در لایه‌ی پایتون است." -msgid "Return true if *p* is a list object or an instance of a subtype of the list type. This function always succeeds." +msgid "" +"Return true if *p* is a list object or an instance of a subtype of the list " +"type. This function always succeeds." msgstr "" +"اگر *p* یک شیء فهرست یا نمونه‌ای از یک زیرنوع از نوع فهرست باشد، مقدار true " +"را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *p* is a list object, but not an instance of a subtype of the list type. This function always succeeds." +msgid "" +"Return true if *p* is a list object, but not an instance of a subtype of the" +" list type. This function always succeeds." msgstr "" +"اگر *p* یک شیء فهرست باشد، اما نمونه‌ای از زیرنوعی از نوع فهرست نباشد، true " +"برمی‌گرداند. این تابع همیشه موفق می‌شود." msgid "Return a new list of length *len* on success, or ``NULL`` on failure." msgstr "" +"در صورت موفقیت، فهرست جدیدی به طول *len* برمی‌گرداند، یا در صورت شکست " +"``NULL``." -msgid "If *len* is greater than zero, the returned list object's items are set to ``NULL``. Thus you cannot use abstract API functions such as :c:func:`PySequence_SetItem` or expose the object to Python code before setting all items to a real object with :c:func:`PyList_SetItem` or :c:func:`PyList_SET_ITEM()`. The following APIs are safe APIs before the list is fully initialized: :c:func:`PyList_SetItem()` and :c:func:`PyList_SET_ITEM()`." -msgstr "" +msgid "" +"If *len* is greater than zero, the returned list object's items are set to " +"``NULL``. Thus you cannot use abstract API functions such as " +":c:func:`PySequence_SetItem` or expose the object to Python code before " +"setting all items to a real object with :c:func:`PyList_SetItem` or " +":c:func:`PyList_SET_ITEM()`. The following APIs are safe APIs before the " +"list is fully initialized: :c:func:`PyList_SetItem()` and " +":c:func:`PyList_SET_ITEM()`." +msgstr "" +"اگر *len* بزرگ‌تر از صفر باشد، آیتم‌های شیء فهرست بازگردانده‌شده روی " +"``NULL`` تنظیم می‌شوند. بنابراین پیش از آنکه تمام آیتم‌ها را با " +":c:func:`PyList_SetItem` یا :c:func:`PyList_SET_ITEM()` روی یک شیء واقعی " +"تنظیم کنید، نمی‌توانید از توابع API انتزاعی مانند " +":c:func:`PySequence_SetItem` استفاده کنید یا شیء را در دسترس کد پایتون قرار " +"دهید. APIهای زیر پیش از آنکه فهرست به‌طور کامل مقداردهی اولیه شود، امن " +"هستند: :c:func:`PyList_SetItem()` و :c:func:`PyList_SET_ITEM()`." -msgid "Return the length of the list object in *list*; this is equivalent to ``len(list)`` on a list object." +msgid "" +"Return the length of the list object in *list*; this is equivalent to " +"``len(list)`` on a list object." msgstr "" +"طول شیء فهرست در *list* را برمی‌گرداند؛ این معادل ``len(list)`` روی یک شیء " +"فهرست است." msgid "Similar to :c:func:`PyList_Size`, but without error checking." -msgstr "" +msgstr "مشابه :c:func:`PyList_Size`، اما بدون بررسی خطا." -msgid "Return the object at position *index* in the list pointed to by *list*. The position must be non-negative; indexing from the end of the list is not supported. If *index* is out of bounds (:code:`<0 or >=len(list)`), return ``NULL`` and set an :exc:`IndexError` exception." +msgid "" +"Return the object at position *index* in the list pointed to by *list*. The" +" position must be non-negative; indexing from the end of the list is not " +"supported. If *index* is out of bounds (:code:`<0 or >=len(list)`), return " +"``NULL`` and set an :exc:`IndexError` exception." msgstr "" +"شیء موجود در موقعیت *index* در فهرستی که *list* به آن اشاره می‌کند را " +"برمی‌گرداند. موقعیت باید نامنفی باشد؛ اندیس‌دهی از انتهای فهرست پشتیبانی " +"نمی‌شود. اگر *index* خارج از محدوده باشد (:code:`<0 or >=len(list)`)، " +"``NULL`` را برمی‌گرداند و استثنای :exc:`IndexError` را تنظیم می‌کند." -msgid "Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` instead of a :term:`strong reference`." +msgid "" +"Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` " +"instead of a :term:`strong reference`." msgstr "" +"مانند :c:func:`PyList_GetItemRef`، اما به‌جای :term:`ارجاع قوی `، یک :term:`ارجاع امانتی ` برمی‌گرداند." -msgid "In the :term:`free-threaded build`, the returned :term:`borrowed reference` may become invalid if another thread modifies the list concurrently. Prefer :c:func:`PyList_GetItemRef`, which returns a :term:`strong reference`." +msgid "" +"In the :term:`free-threaded build`, the returned :term:`borrowed reference` " +"may become invalid if another thread modifies the list concurrently. Prefer " +":c:func:`PyList_GetItemRef`, which returns a :term:`strong reference`." msgstr "" +"در :term:`بیلد نخ‌آزاد `، :term:`ارجاع امانتی ` بازگردانده‌شده ممکن است در صورت تغییر هم‌زمان فهرست توسط نخ " +"دیگر، نامعتبر شود. بهتر است از :c:func:`PyList_GetItemRef` استفاده کنید که " +"یک :term:`ارجاع قوی ` برمی‌گرداند." msgid "Similar to :c:func:`PyList_GetItem`, but without error checking." -msgstr "" +msgstr "مشابه :c:func:`PyList_GetItem`، اما بدون بررسی خطا." -msgid "Set the item at index *index* in list to *item*. Return ``0`` on success. If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` exception." +msgid "" +"Set the item at index *index* in list to *item*. Return ``0`` on success. " +"If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` " +"exception." msgstr "" +"آیتم موجود در اندیس *index* در فهرست را به *item* تنظیم می‌کند. در صورت " +"موفقیت ``0`` را برمی‌گرداند. اگر *index* خارج از محدوده باشد، ``-1`` را " +"برمی‌گرداند و استثنای :exc:`IndexError` را برقرار می‌کند." -msgid "This function \":term:`steals `\" a reference to *item*, even on error. On success, it discards a reference to an item already in the list at the affected position (unless it was ``NULL``)." +msgid "" +"This function \":term:`steals `\" a reference to *item*, even on " +"error. On success, it discards a reference to an item already in the list at" +" the affected position (unless it was ``NULL``)." msgstr "" +"این تابع ارجاعی به *item* را «:term:`می‌دزدد `»، حتی در صورت وقوع " +"خطا. در صورت موفقیت، این تابع ارجاعی به آیتمی را که از قبل در موقعیت متأثر " +"در فهرست بوده است، رها می‌کند (مگر آنکه ``NULL`` بوده باشد)." -msgid "Macro form of :c:func:`PyList_SetItem` without error checking. This is normally only used to fill in new lists where there is no previous content." +msgid "" +"Macro form of :c:func:`PyList_SetItem` without error checking. This is " +"normally only used to fill in new lists where there is no previous content." msgstr "" +"فرم ماکرویِ :c:func:`PyList_SetItem` بدون بررسی خطا. این معمولاً فقط برای پر" +" کردن فهرست‌های جدیدی که محتوای قبلی ندارند، استفاده می‌شود." -msgid "Bounds checking is performed as an assertion if Python is built in :ref:`debug mode ` or :option:`with assertions <--with-assertions>`." +msgid "" +"Bounds checking is performed as an assertion if Python is built in " +":ref:`debug mode ` or :option:`with assertions <--with-" +"assertions>`." msgstr "" +"اگر پایتون در :ref:`حالت اشکال‌زدایی ` یا :option:`با ادعاها " +"<--with-assertions>` ساخته شده باشد، بررسی کران‌ها به‌صورت یک ادعا انجام " +"می‌شود." -msgid "This macro \":term:`steals `\" a reference to *item*, and, unlike :c:func:`PyList_SetItem`, does *not* discard a reference to any item that is being replaced; any reference in *list* at position *i* will be leaked." +msgid "" +"This macro \":term:`steals `\" a reference to *item*, and, unlike " +":c:func:`PyList_SetItem`, does *not* discard a reference to any item that is" +" being replaced; any reference in *list* at position *i* will be leaked." msgstr "" +"این ماکرو ارجاعی به *item* را «:term:`می‌دزدد `» و برخلاف " +":c:func:`PyList_SetItem`، ارجاع به هیچ آیتمی که جایگزین می‌شود را دور " +"*نمی‌اندازد*؛ هر ارجاعی که در جایگاه *i* از *list* باشد، نشت خواهد کرد." -msgid "In the :term:`free-threaded build`, this macro has no internal synchronization. It is normally only used to fill in new lists where no other thread has a reference to the list. If the list may be shared, use :c:func:`PyList_SetItem` instead, which uses a :term:`per-object lock`." +msgid "" +"In the :term:`free-threaded build`, this macro has no internal " +"synchronization. It is normally only used to fill in new lists where no " +"other thread has a reference to the list. If the list may be shared, use " +":c:func:`PyList_SetItem` instead, which uses a :term:`per-object lock`." msgstr "" +"در :term:`بیلد نخ‌آزاد `، این ماکرو هیچ همگام‌سازی " +"داخلی ندارد. معمولاً تنها برای پر کردن فهرست‌های جدیدی استفاده می‌شود که هیچ" +" نخ دیگری ارجاعی به آن فهرست ندارد. اگر ممکن است فهرست مشترک باشد، به‌جای آن" +" از :c:func:`PyList_SetItem` استفاده کنید که از :term:`قفل به ازای هر شیء " +"` استفاده می‌کند." -msgid "Insert the item *item* into list *list* in front of index *index*. Return ``0`` if successful; return ``-1`` and set an exception if unsuccessful. Analogous to ``list.insert(index, item)``." +msgid "" +"Insert the item *item* into list *list* in front of index *index*. Return " +"``0`` if successful; return ``-1`` and set an exception if unsuccessful. " +"Analogous to ``list.insert(index, item)``." msgstr "" +"آیتم *item* را در جلوی اندیس *index* در فهرست *list* درج می‌کند. در صورت " +"موفقیت ``0`` را برمی‌گرداند؛ در صورت عدم موفقیت ``-1`` را برمی‌گرداند و یک " +"استثنا تنظیم می‌کند. مشابه ``list.insert(index, item)`` است." -msgid "Append the object *item* at the end of list *list*. Return ``0`` if successful; return ``-1`` and set an exception if unsuccessful. Analogous to ``list.append(item)``." +msgid "" +"Append the object *item* at the end of list *list*. Return ``0`` if " +"successful; return ``-1`` and set an exception if unsuccessful. Analogous " +"to ``list.append(item)``." msgstr "" +"شیء *item* را به انتهای فهرست *list* می‌افزاید. در صورت موفقیت ``0`` را " +"برمی‌گرداند؛ در صورت ناموفق بودن، ``-1`` را برمی‌گرداند و یک استثنا تنظیم " +"می‌کند. مشابه ``list.append(item)`` است." -msgid "Return a list of the objects in *list* containing the objects *between* *low* and *high*. Return ``NULL`` and set an exception if unsuccessful. Analogous to ``list[low:high]``. Indexing from the end of the list is not supported." +msgid "" +"Return a list of the objects in *list* containing the objects *between* " +"*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. " +"Analogous to ``list[low:high]``. Indexing from the end of the list is not " +"supported." msgstr "" +"فهرستی از اشیاء موجود در *list* را برمی‌گرداند که اشیاء *بین* *low* و *high*" +" را در بر می‌گیرد. در صورت شکست، ``NULL`` برمی‌گرداند و یک استثنا تنظیم " +"می‌کند. مشابه ``list[low:high]`` است. اندیس‌گذاری از انتهای فهرست پشتیبانی" +" نمی‌شود." -msgid "Set the slice of *list* between *low* and *high* to the contents of *itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may be ``NULL``, indicating the assignment of an empty list (slice deletion). Return ``0`` on success, ``-1`` on failure. Indexing from the end of the list is not supported." -msgstr "" +msgid "" +"Set the slice of *list* between *low* and *high* to the contents of " +"*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may " +"be ``NULL``, indicating the assignment of an empty list (slice deletion). " +"Return ``0`` on success, ``-1`` on failure. Indexing from the end of the " +"list is not supported." +msgstr "" +"اسلایس *list* بین *low* و *high* را برابر محتویات *itemlist* قرار می‌دهد. " +"مشابه ``list[low:high] = itemlist`` است. *itemlist* می‌تواند ``NULL`` باشد " +"که نشان‌دهنده‌ی انتساب یک فهرست خالی است (حذف اسلایس). در صورت موفقیت ``0`` " +"و در صورت شکست ``-1`` را برمی‌گرداند. اندیس‌گذاری از انتهای فهرست پشتیبانی " +"نمی‌شود." -msgid "In the :term:`free-threaded build`, when *itemlist* is a :class:`list`, both *list* and *itemlist* are locked for the duration of the operation. For other iterables (or ``NULL``), only *list* is locked." +msgid "" +"In the :term:`free-threaded build`, when *itemlist* is a :class:`list`, both" +" *list* and *itemlist* are locked for the duration of the operation. For " +"other iterables (or ``NULL``), only *list* is locked." msgstr "" +"در :term:`بیلد نخ‌آزاد `، وقتی *itemlist* یک " +":class:`list` باشد، هر دو *list* و *itemlist* در طول عملیات قفل می‌شوند. " +"برای سایر پیمایش‌پذیرها (یا ``NULL``)، تنها *list* قفل می‌شود." -msgid "Extend *list* with the contents of *iterable*. This is the same as ``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` and analogous to ``list.extend(iterable)`` or ``list += iterable``." +msgid "" +"Extend *list* with the contents of *iterable*. This is the same as " +"``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` and " +"analogous to ``list.extend(iterable)`` or ``list += iterable``." msgstr "" +"*list* را با محتویات *iterable* گسترش می‌دهد. این همان " +"``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` است و " +"مشابه ``list.extend(iterable)`` یا ``list += iterable`` است." -msgid "Raise an exception and return ``-1`` if *list* is not a :class:`list` object. Return 0 on success." +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." msgstr "" +"اگر *list* یک شیء :class:`list` نباشد، استثنا ایجاد می‌کند و ``-1`` را " +"برمی‌گرداند. در صورت موفقیت ۰ را برمی‌گرداند." -msgid "In the :term:`free-threaded build`, when *iterable* is a :class:`list`, :class:`set`, :class:`dict`, or dict view, both *list* and *iterable* (or its underlying dict) are locked for the duration of the operation. For other iterables, only *list* is locked; *iterable* may be concurrently modified by another thread." -msgstr "" +msgid "" +"In the :term:`free-threaded build`, when *iterable* is a :class:`list`, " +":class:`set`, :class:`dict`, or dict view, both *list* and *iterable* (or " +"its underlying dict) are locked for the duration of the operation. For other" +" iterables, only *list* is locked; *iterable* may be concurrently modified " +"by another thread." +msgstr "" +"در :term:`free-threaded build`، وقتی *iterable* یک :class:`list`، " +":class:`set`، :class:`dict` یا نمای دیکشنری باشد، هم *list* و هم *iterable* " +"(یا دیکشنری زیربنایی آن) برای مدت‌زمان عملیات قفل می‌شوند. برای سایر " +"پیمایش‌پذیرها، تنها *list* قفل می‌شود؛ *iterable* ممکن است به‌طور هم‌زمان " +"توسط نخ دیگری تغییر داده شود." -msgid "Remove all items from *list*. This is the same as ``PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL)`` and analogous to ``list.clear()`` or ``del list[:]``." +msgid "" +"Remove all items from *list*. This is the same as ``PyList_SetSlice(list, " +"0, PY_SSIZE_T_MAX, NULL)`` and analogous to ``list.clear()`` or ``del " +"list[:]``." msgstr "" +"تمام آیتم‌ها را از *list* حذف می‌کند. این همان ``PyList_SetSlice(list, 0, " +"PY_SSIZE_T_MAX, NULL)`` است و مشابه ``list.clear()`` یا ``del list[:]`` است." -msgid "Raise an exception and return ``-1`` if *list* is not a :class:`list` object. Return 0 on success." +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." msgstr "" +"اگر *list* یک شیء :class:`list` نباشد، استثنا برمی‌انگیزد و ``-1`` را " +"برمی‌گرداند. در صورت موفقیت 0 را برمی‌گرداند." -msgid "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on failure. This is equivalent to ``list.sort()``." +msgid "" +"Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " +"failure. This is equivalent to ``list.sort()``." msgstr "" +"آیتم‌های *list* را درجا مرتب می‌کند. در صورت موفقیت ``0`` و در صورت شکست " +"``-1`` را برمی‌گرداند. این معادل ``list.sort()`` است." -msgid "In the :term:`free-threaded build`, element comparison via :meth:`~object.__lt__` can execute arbitrary Python code, during which the :term:`per-object lock` may be temporarily released. For built-in types (:class:`str`, :class:`int`, :class:`float`), the lock is not released during comparison." -msgstr "" +msgid "" +"In the :term:`free-threaded build`, element comparison via " +":meth:`~object.__lt__` can execute arbitrary Python code, during which the " +":term:`per-object lock` may be temporarily released. For built-in types " +"(:class:`str`, :class:`int`, :class:`float`), the lock is not released " +"during comparison." +msgstr "" +"در :term:`نسخه‌ی نخ‌آزاد `، مقایسه‌ی عناصر از طریق " +":meth:`~object.__lt__` می‌تواند کد پایتون دلخواهی اجرا کند که در این مدت " +":term:`قفل به‌ازای هر شیء ` ممکن است به‌طور موقت آزاد شود. " +"برای نوع‌های توکار (:class:`str`، :class:`int`، :class:`float`)، قفل در حین " +"مقایسه آزاد نمی‌شود." -msgid "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on failure. This is the equivalent of ``list.reverse()``." +msgid "" +"Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " +"failure. This is the equivalent of ``list.reverse()``." msgstr "" +"آیتم‌های *list* را به‌صورت درجا معکوس می‌کند. در صورت موفقیت ``0`` و در صورت" +" شکست ``-1`` برمی‌گرداند. این معادل ``list.reverse()`` است." -msgid "Return a new tuple object containing the contents of *list*; equivalent to ``tuple(list)``." +msgid "" +"Return a new tuple object containing the contents of *list*; equivalent to " +"``tuple(list)``." msgstr "" +"یک شیء تاپل جدید حاوی محتوای *list* برمی‌گرداند؛ معادل ``tuple(list)`` است." msgid "object" -msgstr "" +msgstr "شیء" msgid "list" -msgstr "" +msgstr "فهرست" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "len" -msgstr "" +msgstr "len" msgid "tuple" -msgstr "" +msgstr "تاپل" diff --git a/c-api/long.po b/c-api/long.po index f5da800e2..fb01c7036 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"PO-Revision-Date: 2026-09-04 20:20+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,238 +23,582 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Integer Objects" -msgstr "" +msgstr "شیءهای عدد صحیح" -msgid "All integers are implemented as \"long\" integer objects of arbitrary size." +msgid "" +"All integers are implemented as \"long\" integer objects of arbitrary size." msgstr "" +"تمام اعداد صحیح به‌صورت اشیاء عدد صحیح «long» با اندازه دلخواه پیاده‌سازی " +"شده‌اند." -msgid "On error, most ``PyLong_As*`` APIs return ``(return type)-1`` which cannot be distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"On error, most ``PyLong_As*`` APIs return ``(return type)-1`` which cannot " +"be distinguished from a number. Use :c:func:`PyErr_Occurred` to " +"disambiguate." msgstr "" +"در صورت خطا، بیشتر APIهای ``PyLong_As*`` مقدار ``(return type)-1`` را " +"برمی‌گردانند که از یک عدد قابل تشخیص نیست. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." msgid "This subtype of :c:type:`PyObject` represents a Python integer object." msgstr "" +"این زیرنوع از :c:type:`PyObject` یک شیء عدد صحیح پایتون را نشان می‌دهد." -msgid "This instance of :c:type:`PyTypeObject` represents the Python integer type. This is the same object as :class:`int` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python integer type. " +"This is the same object as :class:`int` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع عدد صحیح پایتون را نشان می‌دهد. این " +"همان شیء :class:`int` در لایه‌ی پایتون است." -msgid "Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:type:`PyLongObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyLongObject` or a subtype " +"of :c:type:`PyLongObject`. This function always succeeds." msgstr "" +"اگر آرگومان آن یک :c:type:`PyLongObject` یا زیرنوعی " +"از :c:type:`PyLongObject` باشد، مقدار true را برمی‌گرداند. این تابع همیشه با " +"موفقیت اجرا می‌شود." -msgid "Return true if its argument is a :c:type:`PyLongObject`, but not a subtype of :c:type:`PyLongObject`. This function always succeeds." +msgid "" +"Return true if its argument is a :c:type:`PyLongObject`, but not a subtype " +"of :c:type:`PyLongObject`. This function always succeeds." msgstr "" +"در صورتی که آرگومان آن یک :c:type:`PyLongObject` باشد، اما زیرنوعی " +"از :c:type:`PyLongObject` نباشد، مقدار true را برمی‌گرداند. این تابع همیشه " +"با موفقیت اجرا می‌شود." -msgid "Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از *v* برمی‌گرداند، یا در صورت شکست " +"``NULL``." -msgid "CPython keeps an array of integer objects for all integers between ``-5`` and ``256``. When you create an int in that range you actually just get back a reference to the existing object." +msgid "" +"CPython keeps an array of integer objects for all integers between ``-5`` " +"and ``256``. When you create an int in that range you actually just get " +"back a reference to the existing object." msgstr "" +"سی‌پایتون آرایه‌ای از اشیاء عدد صحیح را برای تمام اعداد صحیح بین ``-5`` و " +"``256`` نگه می‌دارد. وقتی شما یک int در این بازه ایجاد می‌کنید، در واقع فقط " +"ارجاعی به شیء موجود را دریافت می‌کنید." -msgid "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned " +"long`, or ``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:expr:`unsigned long` در C " +"برمی‌گرداند، یا در صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, " +"or ``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:type:`Py_ssize_t` در C " +"برمی‌گرداند، یا در صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or " +"``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:type:`size_t` در C برمی‌گرداند، " +"یا در صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " +"``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:expr:`long long` در C " +"برمی‌گرداند، یا در صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long long`, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " +"long`, or ``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:expr:`unsigned long long` در C " +"برمی‌گرداند، یا در صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` object from a signed C :c:expr:`int32_t` or :c:expr:`int64_t`, or ``NULL`` with an exception set on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from a signed " +"C :c:expr:`int32_t` or :c:expr:`int64_t`, or ``NULL`` with an exception set " +"on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:expr:`int32_t` " +"یا :c:expr:`int64_t` علامت‌دار در C برمی‌گرداند، یا در صورت شکست ``NULL`` را " +"همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "Return a new :c:type:`PyLongObject` object from an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t`, or ``NULL`` with an exception set on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from an unsigned " +"C :c:expr:`uint32_t` or :c:expr:`uint64_t`, or ``NULL`` with an exception " +"set on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از یک :c:expr:`uint32_t` " +"یا :c:expr:`uint64_t` بدون علامت C برمی‌گرداند، یا در صورت شکست، ``NULL`` " +"همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "Return a new :c:type:`PyLongObject` object from the integer part of *v*, or ``NULL`` on failure." +msgid "" +"Return a new :c:type:`PyLongObject` object from the integer part of *v*, or " +"``NULL`` on failure." msgstr "" +"یک شیء جدید :c:type:`PyLongObject` از بخش عدد صحیح *v* برمی‌گرداند، یا در " +"صورت شکست ``NULL``." -msgid "Return a new :c:type:`PyLongObject` based on the string value in *str*, which is interpreted according to the radix in *base*, or ``NULL`` on failure. If *pend* is non-``NULL``, *\\*pend* will point to the end of *str* on success or to the first character that could not be processed on error. If *base* is ``0``, *str* is interpreted using the :ref:`integers` definition; in this case, leading zeros in a non-zero decimal number raises a :exc:`ValueError`. If *base* is not ``0``, it must be between ``2`` and ``36``, inclusive. Leading and trailing whitespace and single underscores after a base specifier and between digits are ignored. If there are no digits or *str* is not NULL-terminated following the digits and trailing whitespace, :exc:`ValueError` will be raised." -msgstr "" +msgid "" +"Return a new :c:type:`PyLongObject` based on the string value in *str*, " +"which is interpreted according to the radix in *base*, or ``NULL`` on " +"failure. If *pend* is non-``NULL``, *\\*pend* will point to the end of " +"*str* on success or to the first character that could not be processed on " +"error. If *base* is ``0``, *str* is interpreted using the :ref:`integers` " +"definition; in this case, leading zeros in a non-zero decimal number raises " +"a :exc:`ValueError`. If *base* is not ``0``, it must be between ``2`` and " +"``36``, inclusive. Leading and trailing whitespace and single underscores " +"after a base specifier and between digits are ignored. If there are no " +"digits or *str* is not NULL-terminated following the digits and trailing " +"whitespace, :exc:`ValueError` will be raised." +msgstr "" +"یک :c:type:`PyLongObject` جدید بر اساس مقدار رشته‌ای موجود در *str* " +"برمی‌گرداند که مطابق با مبنای عددی موجود در *base* تفسیر می‌شود، یا در صورت " +"شکست ``NULL`` برمی‌گرداند. اگر *pend* غیر ``NULL`` باشد، *\\*pend* در صورت " +"موفقیت به انتهای *str* و در صورت خطا به نخستین نویسه‌ای که نتوان آن را " +"پردازش کرد اشاره خواهد کرد. اگر *base* برابر ``0`` باشد، *str* با استفاده " +"از تعریف :ref:`integers` تفسیر می‌شود؛ در این حالت، صفرهای ابتدایی در یک عدد " +"ده‌دهی غیرصفر باعث پرتاب استثنای :exc:`ValueError` می‌شوند. اگر *base* برابر " +"``0`` نباشد، باید مقداری بین ``2`` و ``36`` (با احتساب هر دو) باشد. فضاهای " +"سفید ابتدایی و انتهایی و همچنین زیرخط‌های تکی پس از مشخص‌کننده‌ی مبنا و بین " +"ارقام نادیده گرفته می‌شوند. اگر هیچ رقمی وجود نداشته باشد یا *str* پس از " +"ارقام و فضاهای سفید انتهایی با NULL خاتمه نیافته باشد، " +"استثنای :exc:`ValueError` پرتاب خواهد شد." -msgid ":c:func:`PyLong_AsNativeBytes()` and :c:func:`PyLong_FromNativeBytes()` functions can be used to convert a :c:type:`PyLongObject` to/from an array of bytes in base ``256``." +msgid "" +":c:func:`PyLong_AsNativeBytes()` and :c:func:`PyLong_FromNativeBytes()` " +"functions can be used to convert a :c:type:`PyLongObject` to/from an array " +"of bytes in base ``256``." msgstr "" +"می‌توان از توابع :c:func:`PyLong_AsNativeBytes()` " +"و :c:func:`PyLong_FromNativeBytes()` برای تبدیل یک :c:type:`PyLongObject` " +"به/از آرایه‌ای از بایت‌ها در مبنای ``256`` استفاده کرد." -msgid "Convert a sequence of Unicode digits in the string *u* to a Python integer value." +msgid "" +"Convert a sequence of Unicode digits in the string *u* to a Python integer " +"value." msgstr "" +"تبدیل دنباله‌ای از ارقام یونیکد در رشته *u* به یک مقدار عدد صحیح پایتون." -msgid "Create a Python integer from the pointer *p*. The pointer value can be retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." +msgid "" +"Create a Python integer from the pointer *p*. The pointer value can be " +"retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" +"یک عدد صحیح پایتون از اشاره‌گر *p* می‌سازد. مقدار اشاره‌گر را می‌توان با " +"استفاده از :c:func:`PyLong_AsVoidPtr` از مقدار حاصل بازیابی کرد." -msgid "Create a Python integer from the value contained in the first *n_bytes* of *buffer*, interpreted as a two's-complement signed number." +msgid "" +"Create a Python integer from the value contained in the first *n_bytes* of " +"*buffer*, interpreted as a two's-complement signed number." msgstr "" +"یک عدد صحیح پایتون از مقدار موجود در *n_bytes* اول *buffer* می‌سازد که " +"به‌عنوان یک عدد علامت‌دار مکمل دو تفسیر می‌شود." -msgid "*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will select the native endian that CPython was compiled with and assume that the most-significant bit is a sign bit. Passing ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` will produce the same result as calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." -msgstr "" +msgid "" +"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " +"select the native endian that CPython was compiled with and assume that the " +"most-significant bit is a sign bit. Passing " +"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` will produce the same result as " +"calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." +msgstr "" +"*flags* همان‌طور است که برای :c:func:`PyLong_AsNativeBytes` توضیح داده شده " +"است. با ارسال ``-1``، اندیان بومی‌ای که سی‌پایتون با آن کامپایل شده است " +"انتخاب می‌شود و فرض می‌شود که بیش‌ارزش‌ترین بیت، بیت علامت است. با ارسال " +"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER``، همان نتیجه‌ی " +"فراخوانی :c:func:`PyLong_FromUnsignedNativeBytes` تولید می‌شود. سایر پرچم‌ها " +"نادیده گرفته می‌شوند." -msgid "Create a Python integer from the value contained in the first *n_bytes* of *buffer*, interpreted as an unsigned number." +msgid "" +"Create a Python integer from the value contained in the first *n_bytes* of " +"*buffer*, interpreted as an unsigned number." msgstr "" +"یک عدد صحیح پایتون از مقدار موجود در *n_bytes* بایت اول *buffer* بسازید که " +"به‌عنوان یک عدد بدون علامت تفسیر می‌شود." -msgid "*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will select the native endian that CPython was compiled with and assume that the most-significant bit is not a sign bit. Flags other than endian are ignored." +msgid "" +"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " +"select the native endian that CPython was compiled with and assume that the " +"most-significant bit is not a sign bit. Flags other than endian are ignored." msgstr "" +"*flags* همانند :c:func:`PyLong_AsNativeBytes` است. ارسال ``-1`` اندیان " +"بومی‌ای را که سی‌پایتون با آن کامپایل شده است انتخاب می‌کند و فرض می‌کند که " +"بیش‌اهمیت‌ترین بیت، بیت علامت نیست. پرچم‌های غیر از اندیان نادیده گرفته می‌شوند." msgid "Macro for creating a Python integer from a process identifier." -msgstr "" +msgstr "ماکرویی برای ایجاد یک عدد صحیح پایتون از شناسه‌ی فرایند." -msgid "This can be defined as an alias to :c:func:`PyLong_FromLong` or :c:func:`PyLong_FromLongLong`, depending on the size of the system's PID type." +msgid "" +"This can be defined as an alias to :c:func:`PyLong_FromLong` " +"or :c:func:`PyLong_FromLongLong`, depending on the size of the system's PID " +"type." msgstr "" +"این می‌تواند بسته به اندازه‌ی نوع PID سیستم، به عنوان مستعاری " +"برای :c:func:`PyLong_FromLong` یا :c:func:`PyLong_FromLongLong` تعریف شود." -msgid "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " +"instance of :c:type:`PyLongObject`, first call " +"its :meth:`~object.__index__` method (if present) to convert it to " +"a :c:type:`PyLongObject`." msgstr "" +"نمایشی از نوع :c:expr:`long` در زبان C از *obj* برمی‌گرداند. اگر *obj* " +"نمونه‌ای از :c:type:`PyLongObject` نباشد، ابتدا " +"متد :meth:`~object.__index__` آن (در صورت وجود) فراخوانی می‌شود تا " +"به :c:type:`PyLongObject` تبدیل شود." -msgid "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:expr:`long`." +msgid "" +"Raise :exc:`OverflowError` if the value of *obj* is out of range for " +"a :c:expr:`long`." msgstr "" +"اگر مقدار *obj* خارج از محدوده‌ی :c:expr:`long` باشد، " +"استثنای :exc:`OverflowError` ایجاد می‌شود." -msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"در صورت خطا ``-1`` برمی‌گرداند. برای رفع ابهام از :c:func:`PyErr_Occurred` " +"استفاده کنید." msgid "Use :meth:`~object.__index__` if available." -msgstr "" +msgstr "در صورت وجود، از :meth:`~object.__index__` استفاده کنید." msgid "This function will no longer use :meth:`~object.__int__`." -msgstr "" +msgstr "این تابع دیگر از :meth:`~object.__int__` استفاده نخواهد کرد." -msgid "Exactly equivalent to the preferred ``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or another exception." +msgid "" +"Exactly equivalent to the preferred ``PyLong_AsLong``. In particular, it " +"can fail with :exc:`OverflowError` or another exception." msgstr "" +"دقیقاً معادل ``PyLong_AsLong`` ترجیحی است. به‌طور خاص، می‌تواند " +"با :exc:`OverflowError` یا استثنای دیگری شکست بخورد." -msgid "Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:`int` instead of a C :c:expr:`long`." +msgid "" +"Similar to :c:func:`PyLong_AsLong`, but store the result in a " +"C :c:expr:`int` instead of a C :c:expr:`long`." msgstr "" +"مانند :c:func:`PyLong_AsLong`، اما نتیجه را به‌جای یک :c:expr:`long` در C، " +"در یک :c:expr:`int` در C ذخیره می‌کند." -msgid "If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." -msgstr "" +msgid "" +"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less " +"than :c:macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, " +"respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If " +"any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as " +"usual." +msgstr "" +"اگر مقدار *obj* بزرگ‌تر از :c:macro:`LONG_MAX` یا کوچک‌تر " +"از :c:macro:`LONG_MIN` باشد، *\\*overflow* را به‌ترتیب برابر ``1`` یا ``-1`` " +"قرار می‌دهد و ``-1`` را برمی‌گرداند؛ در غیر این صورت، *\\*overflow* را برابر " +"``0`` قرار می‌دهد. اگر هر استثنای دیگری رخ دهد، *\\*overflow* را برابر ``0`` " +"قرار می‌دهد و ``-1`` را طبق معمول برمی‌گرداند." -msgid "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " +"instance of :c:type:`PyLongObject`, first call " +"its :meth:`~object.__index__` method (if present) to convert it to " +"a :c:type:`PyLongObject`." msgstr "" +"نمایشی از *obj* به صورت C :c:expr:`long long` برمی‌گرداند. اگر *obj* نمونه‌ای " +"از :c:type:`PyLongObject` نباشد، ابتدا متد :meth:`~object.__index__` آن (در " +"صورت وجود) فراخوانی می‌شود تا به :c:type:`PyLongObject` تبدیل شود." -msgid "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:expr:`long long`." +msgid "" +"Raise :exc:`OverflowError` if the value of *obj* is out of range for " +"a :c:expr:`long long`." msgstr "" +"اگر مقدار *obj* خارج از محدوده‌ی :c:expr:`long long` " +"باشد، :exc:`OverflowError` ایجاد می‌شود." -msgid "If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." -msgstr "" +msgid "" +"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less " +"than :c:macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, " +"respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If " +"any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as " +"usual." +msgstr "" +"اگر مقدار *obj* بزرگ‌تر از :c:macro:`LLONG_MAX` یا کوچک‌تر " +"از :c:macro:`LLONG_MIN` باشد، *\\*overflow* را به‌ترتیب روی ``1`` یا ``-1`` " +"قرار می‌دهد و ``-1`` را برمی‌گرداند؛ در غیر این صورت، *\\*overflow* را روی " +"``0`` قرار می‌دهد. اگر استثنای دیگری رخ دهد، *\\*overflow* را روی ``0`` قرار " +"می‌دهد و ``-1`` را طبق معمول برمی‌گرداند." -msgid "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must be an instance of :c:type:`PyLongObject`." +msgid "" +"Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " +"be an instance of :c:type:`PyLongObject`." msgstr "" +"نمایش C از *pylong* به‌صورت :c:type:`Py_ssize_t` را برمی‌گرداند. *pylong* " +"باید نمونه‌ای از :c:type:`PyLongObject` باشد." -msgid "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:type:`Py_ssize_t`." +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:type:`Py_ssize_t`." msgstr "" +"اگر مقدار *pylong* خارج از محدوده‌ی :c:type:`Py_ssize_t` باشد، " +"استثنای :exc:`OverflowError` ایجاد می‌کند." -msgid "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* must be an instance of :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " +"must be an instance of :c:type:`PyLongObject`." msgstr "" +"نمایش :c:expr:`unsigned long` در C از *pylong* را برمی‌گرداند. *pylong* " +"باید نمونه‌ای از :c:type:`PyLongObject` باشد." -msgid "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:expr:`unsigned long`." +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:expr:`unsigned long`." msgstr "" +"اگر مقدار *pylong* خارج از محدوده‌ی :c:expr:`unsigned long` " +"باشد، :exc:`OverflowError` ایجاد می‌کند." -msgid "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." msgstr "" +"در صورت خطا ``(unsigned long)-1`` را برمی‌گرداند. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an instance of :c:type:`PyLongObject`." +msgid "" +"Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be " +"an instance of :c:type:`PyLongObject`." msgstr "" +"نمایش C :c:type:`size_t` از *pylong* را برمی‌گرداند. *pylong* باید نمونه‌ای " +"از :c:type:`PyLongObject` باشد." -msgid "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:type:`size_t`." +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:type:`size_t`." msgstr "" +"اگر مقدار *pylong* خارج از محدوده‌ی :c:type:`size_t` باشد، " +"استثنای :exc:`OverflowError` را ایجاد می‌کند." -msgid "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." msgstr "" +"در صورت خطا ``(size_t)-1`` برمی‌گرداند. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "Return a C :c:expr:`unsigned long long` representation of *pylong*. *pylong* must be an instance of :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`unsigned long long` representation of *pylong*. " +"*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" +"نمایش C :c:expr:`unsigned long long` از *pylong* را برمی‌گرداند. *pylong* " +"باید نمونه‌ای از :c:type:`PyLongObject` باشد." -msgid "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :c:expr:`unsigned long long`." +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"an :c:expr:`unsigned long long`." msgstr "" +"اگر مقدار *pylong* خارج از محدوده‌ی یک :c:expr:`unsigned long long` باشد، " +"استثنای :exc:`OverflowError` ایجاد می‌شود." -msgid "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " +"to disambiguate." msgstr "" +"در صورت خطا ``(unsigned long long)-1`` برمی‌گرداند. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." +msgid "" +"A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" +"یک *pylong* منفی اکنون :exc:`OverflowError` ایجاد می‌کند، " +"نه :exc:`TypeError`." -msgid "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is " +"not an instance of :c:type:`PyLongObject`, first call " +"its :meth:`~object.__index__` method (if present) to convert it to " +"a :c:type:`PyLongObject`." msgstr "" +"نمایشی از *obj* را به صورت :c:expr:`unsigned long` در C برمی‌گرداند. اگر " +"*obj* نمونه‌ای از :c:type:`PyLongObject` نباشد، ابتدا " +"متد :meth:`~object.__index__` آن (در صورت وجود) فراخوانی می‌شود تا به " +"یک :c:type:`PyLongObject` تبدیل شود." -msgid "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return the reduction of that value modulo ``ULONG_MAX + 1``." +msgid "" +"If the value of *obj* is out of range for an :c:expr:`unsigned long`, " +"return the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" +"اگر مقدار *obj* خارج از بازه‌ی :c:expr:`unsigned long` باشد، کاهش آن مقدار " +"به پیمانه‌ی ``ULONG_MAX + 1`` را برمی‌گرداند." -msgid "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " +"disambiguate." msgstr "" +"در صورت خطا ``(unsigned long)-1`` را برمی‌گرداند. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " +"is not an instance of :c:type:`PyLongObject`, first call " +"its :meth:`~object.__index__` method (if present) to convert it to " +"a :c:type:`PyLongObject`." msgstr "" +"یک نمایش :c:expr:`unsigned long long` در C از *obj* برمی‌گرداند. اگر *obj* " +"نمونه‌ای از :c:type:`PyLongObject` نباشد، ابتدا " +"متد :meth:`~object.__index__` آن (در صورت وجود) فراخوانی می‌شود تا آن را به " +"یک :c:type:`PyLongObject` تبدیل کند." -msgid "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, return the reduction of that value modulo ``ULLONG_MAX + 1``." +msgid "" +"If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " +"return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" +"اگر مقدار *obj* خارج از محدوده‌ی :c:expr:`unsigned long long` باشد، کاهش آن " +"مقدار به پیمانه‌ی ``ULLONG_MAX + 1`` برگردانده می‌شود." -msgid "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " +"to disambiguate." msgstr "" +"در صورت خطا ``(unsigned long long)-1`` را برمی‌گرداند. برای رفع ابهام " +"از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "Set *\\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t` representation of *obj*." +msgid "" +"Set *\\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t` " +"representation of *obj*." msgstr "" +"مقدار *\\*value* را به نمایش علامت‌دار :c:expr:`int32_t` " +"یا :c:expr:`int64_t` زبان C از *obj* تنظیم می‌کند." -msgid "If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` method (if present) to convert it to a :c:type:`PyLongObject`." +msgid "" +"If *obj* is not an instance of :c:type:`PyLongObject`, first call " +"its :meth:`~object.__index__` method (if present) to convert it to " +"a :c:type:`PyLongObject`." msgstr "" +"اگر *obj* نمونه‌ای از :c:type:`PyLongObject` نباشد، ابتدا " +"متد :meth:`~object.__index__` آن (در صورت وجود) فراخوانی می‌شود تا آن را " +"به :c:type:`PyLongObject` تبدیل کند." msgid "If the *obj* value is out of range, raise an :exc:`OverflowError`." msgstr "" +"اگر مقدار *obj* خارج از محدوده باشد، یک :exc:`OverflowError` ایجاد می‌شود." -msgid "Set *\\*value* and return ``0`` on success. Set an exception and return ``-1`` on error." +msgid "" +"Set *\\*value* and return ``0`` on success. Set an exception and return " +"``-1`` on error." msgstr "" +"در صورت موفقیت، *\\*value* را تنظیم کرده و ``0`` را برمی‌گرداند. در صورت " +"خطا، یک استثنا تنظیم کرده و ``-1`` را برمی‌گرداند." msgid "*value* must not be ``NULL``." -msgstr "" +msgstr "*value* نباید ``NULL`` باشد." -msgid "Set *\\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t` representation of *obj*." +msgid "" +"Set *\\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t` " +"representation of *obj*." msgstr "" +"مقدار *\\*value* را به بازنمایی بدون علامت :c:expr:`uint32_t` " +"یا :c:expr:`uint64_t` در C از *obj* تنظیم کنید." msgid "If *obj* is negative, raise a :exc:`ValueError`." -msgstr "" +msgstr "اگر *obj* منفی باشد، یک :exc:`ValueError` raise می‌شود." -msgid "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an instance of :c:type:`PyLongObject`." +msgid "" +"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be " +"an instance of :c:type:`PyLongObject`." msgstr "" +"بازنمایی *pylong* را به‌صورت یک :c:expr:`double` در C برمی‌گرداند. *pylong* " +"باید نمونه‌ای از :c:type:`PyLongObject` باشد." -msgid "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:expr:`double`." +msgid "" +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:expr:`double`." msgstr "" +"اگر مقدار *pylong* از محدوده‌ی :c:expr:`double` خارج باشد، " +"استثنای :exc:`OverflowError` ایجاد می‌شود." -msgid "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"در صورت خطا ``-1.0`` برمی‌گرداند. برای رفع ابهام از :c:func:`PyErr_Occurred` " +"استفاده کنید." -msgid "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* cannot be converted, an :exc:`OverflowError` will be raised. This is only assured to produce a usable :c:expr:`void` pointer for values created with :c:func:`PyLong_FromVoidPtr`." +msgid "" +"Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If " +"*pylong* cannot be converted, an :exc:`OverflowError` will be raised. This " +"is only assured to produce a usable :c:expr:`void` pointer for values " +"created with :c:func:`PyLong_FromVoidPtr`." msgstr "" +"یک عدد صحیح پایتون *pylong* را به یک اشاره‌گر :c:expr:`void` در C تبدیل " +"می‌کند. اگر *pylong* قابل تبدیل نباشد، یک :exc:`OverflowError` به‌وجود " +"می‌آید. تولید اشاره‌گر :c:expr:`void` قابل استفاده فقط برای مقادیری که " +"با :c:func:`PyLong_FromVoidPtr` ایجاد شده‌اند تضمین می‌شود." -msgid "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." +msgid "" +"Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" +"در صورت خطا ``NULL`` برمی‌گرداند. برای رفع ابهام از :c:func:`PyErr_Occurred` " +"استفاده کنید." -msgid "Copy the Python integer value *pylong* to a native *buffer* of size *n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, or to values documented below to control the behavior." +msgid "" +"Copy the Python integer value *pylong* to a native *buffer* of size " +"*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C " +"cast, or to values documented below to control the behavior." msgstr "" +"مقدار عدد صحیح پایتون *pylong* را به یک *buffer* بومی با اندازه‌ی *n_bytes* " +"کپی کنید. *flags* را می‌توان روی ``-1`` تنظیم کرد تا مشابه تبدیل نوع در زبان " +"C رفتار کند، یا برای کنترل رفتار، روی مقادیر مستندشده در ادامه تنظیم کرد." -msgid "Returns ``-1`` with an exception raised on error. This may happen if *pylong* cannot be interpreted as an integer, or if *pylong* was negative and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." +msgid "" +"Returns ``-1`` with an exception raised on error. This may happen if " +"*pylong* cannot be interpreted as an integer, or if *pylong* was negative " +"and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." msgstr "" +"در صورت خطا، ``-1`` را همراه با ایجاد یک استثنا برمی‌گرداند. این ممکن است " +"زمانی رخ دهد که *pylong* نتواند به‌عنوان یک عدد صحیح تفسیر شود، یا اینکه " +"*pylong* منفی بوده و پرچم ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` تنظیم شده " +"باشد." -msgid "Otherwise, returns the number of bytes required to store the value. If this is equal to or less than *n_bytes*, the entire value was copied. All *n_bytes* of the buffer are written: remaining bytes filled by copies of the sign bit." +msgid "" +"Otherwise, returns the number of bytes required to store the value. If this " +"is equal to or less than *n_bytes*, the entire value was copied. All " +"*n_bytes* of the buffer are written: remaining bytes filled by copies of " +"the sign bit." msgstr "" +"در غیر این صورت، تعداد بایت‌های مورد نیاز برای ذخیره مقدار را برمی‌گرداند. " +"اگر این عدد برابر یا کمتر از *n_bytes* باشد، کل مقدار کپی شده است. تمام " +"*n_bytes* بافر نوشته می‌شوند: بایت‌های باقی‌مانده با کپی‌هایی از بیت علامت پر " +"می‌شوند." -msgid "If the returned value is greater than *n_bytes*, the value was truncated: as many of the lowest bits of the value as could fit are written, and the higher bits are ignored. This matches the typical behavior of a C-style downcast." +msgid "" +"If the returned value is greater than *n_bytes*, the value was truncated: " +"as many of the lowest bits of the value as could fit are written, and the " +"higher bits are ignored. This matches the typical behavior of a C-style " +"downcast." msgstr "" +"اگر مقدار بازگشتی بزرگ‌تر از *n_bytes* باشد، مقدار برش‌خورده است: هر تعداد از " +"کم‌ارزش‌ترین بیت‌های مقدار که جا داشتند نوشته می‌شوند و بیت‌های پرارزش نادیده " +"گرفته می‌شوند. این با رفتار معمول تبدیل نوع به پایین (downcast) به سبک C " +"مطابقت دارد." -msgid "Overflow is not considered an error. If the returned value is larger than *n_bytes*, most significant bits were discarded." +msgid "" +"Overflow is not considered an error. If the returned value is larger than " +"*n_bytes*, most significant bits were discarded." msgstr "" +"سرریز به‌عنوان خطا در نظر گرفته نمی‌شود. اگر مقدار بازگشتی بزرگ‌تر از " +"*n_bytes* باشد، بیت‌های پرارزش دور ریخته شده‌اند." msgid "``0`` will never be returned." -msgstr "" +msgstr "``0`` هرگز بازگردانده نمی‌شود." msgid "Values are always copied as two's-complement." -msgstr "" +msgstr "مقادیر همیشه به‌صورت مکمل دو کپی می‌شوند." msgid "Usage example::" -msgstr "" +msgstr "مثال استفاده::" msgid "" "int32_t value;\n" -"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n" +"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), " +"-1);\n" "if (bytes < 0) {\n" " // Failed. A Python exception was set with the reason.\n" " return NULL;\n" @@ -267,15 +611,44 @@ msgid "" " // lowest bits of pylong.\n" "}" msgstr "" +"int32_t value;\n" +"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), " +"-1);\n" +"if (bytes < 0) {\n" +" // Failed. A Python exception was set with the reason.\n" +" return NULL;\n" +"}\n" +"else if (bytes <= (Py_ssize_t)sizeof(value)) {\n" +" // Success!\n" +"}\n" +"else {\n" +" // Overflow occurred, but 'value' contains the truncated\n" +" // lowest bits of pylong.\n" +"}" -msgid "Passing zero to *n_bytes* will return the size of a buffer that would be large enough to hold the value. This may be larger than technically necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``." +msgid "" +"Passing zero to *n_bytes* will return the size of a buffer that would be " +"large enough to hold the value. This may be larger than technically " +"necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be " +"``NULL``." msgstr "" +"ارسال صفر به *n_bytes* اندازه‌ی بافری را برمی‌گرداند که برای نگه‌داشتن مقدار " +"به‌اندازه‌ی کافی بزرگ باشد. این اندازه ممکن است از آنچه از نظر فنی لازم است " +"بزرگ‌تر باشد، اما نه به‌طور نامعقول. اگر *n_bytes=0* باشد، *buffer* می‌تواند " +"``NULL`` باشد." -msgid "Passing *n_bytes=0* to this function is not an accurate way to determine the bit length of the value." +msgid "" +"Passing *n_bytes=0* to this function is not an accurate way to determine " +"the bit length of the value." msgstr "" +"ارسال *n_bytes=0* به این تابع، راه دقیقی برای تعیین طول بیتی مقدار نیست." -msgid "To get at the entire Python value of an unknown size, the function can be called twice: first to determine the buffer size, then to fill it::" +msgid "" +"To get at the entire Python value of an unknown size, the function can be " +"called twice: first to determine the buffer size, then to fill it::" msgstr "" +"برای دسترسی به کل مقدار پایتون با اندازه‌ی نامشخص، می‌توان تابع را دو بار " +"فراخوانی کرد: ابتدا برای تعیین اندازه‌ی بافر، سپس برای پر کردن آن::" msgid "" "// Ask how much space we need.\n" @@ -306,297 +679,579 @@ msgid "" "// ... use bignum ...\n" "free(bignum);" msgstr "" +"// Ask how much space we need.\n" +"Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n" +"if (expected < 0) {\n" +" // Failed. A Python exception was set with the reason.\n" +" return NULL;\n" +"}\n" +"assert(expected != 0); // Impossible per the API definition.\n" +"uint8_t *bignum = malloc(expected);\n" +"if (!bignum) {\n" +" PyErr_SetString(PyExc_MemoryError, \"bignum malloc failed.\");\n" +" return NULL;\n" +"}\n" +"// Safely get the entire value.\n" +"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, bignum, expected, -1);\n" +"if (bytes < 0) { // Exception has been set.\n" +" free(bignum);\n" +" return NULL;\n" +"}\n" +"else if (bytes > expected) { // This should not be possible.\n" +" PyErr_SetString(PyExc_RuntimeError,\n" +" \"Unexpected bignum truncation after a size check.\");\n" +" free(bignum);\n" +" return NULL;\n" +"}\n" +"// The expected success given the above pre-check.\n" +"// ... use bignum ...\n" +"free(bignum);" -msgid "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults that behave most like a C cast, or a combination of the other flags in the table below. Note that ``-1`` cannot be combined with other flags." +msgid "" +"*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " +"that behave most like a C cast, or a combination of the other flags in the " +"table below. Note that ``-1`` cannot be combined with other flags." msgstr "" +"*flags* یا ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) است تا پیش‌فرض‌هایی را " +"انتخاب کند که رفتارشان بیشترین شباهت را به قالب‌ریزی C دارد، یا ترکیبی از " +"پرچم‌های دیگر در جدول زیر است. توجه داشته باشید که ``-1`` را نمی‌توان با " +"پرچم‌های دیگر ترکیب کرد." -msgid "Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." +msgid "" +"Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " +"Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" +"در حال حاضر، ``-1`` معادل ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " +"Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` است." msgid "Flag" -msgstr "" +msgstr "پرچم" msgid "Value" -msgstr "" +msgstr "مقدار" msgid "``-1``" -msgstr "" +msgstr "``-1``" msgid "``0``" -msgstr "" +msgstr "``0``" msgid "``1``" -msgstr "" +msgstr "``1``" msgid "``3``" -msgstr "" +msgstr "``3``" msgid "``4``" -msgstr "" +msgstr "``4``" msgid "``8``" -msgstr "" +msgstr "``8``" msgid "``16``" -msgstr "" +msgstr "``16``" -msgid "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian flags. Passing ``2`` is reserved." +msgid "" +"Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other " +"endian flags. Passing ``2`` is reserved." msgstr "" +"مشخص کردن ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` هر پرچم اندیان دیگری را لغو " +"می‌کند. ارسال ``2`` رزرو شده است." -msgid "By default, sufficient buffer will be requested to include a sign bit. For example, when converting 128 with *n_bytes=1*, the function will return 2 (or more) in order to store a zero sign bit." +msgid "" +"By default, sufficient buffer will be requested to include a sign bit. For " +"example, when converting 128 with *n_bytes=1*, the function will return 2 " +"(or more) in order to store a zero sign bit." msgstr "" +"به‌طور پیش‌فرض، بافر کافی برای گنجاندن بیت علامت درخواست می‌شود. برای مثال، " +"هنگام تبدیل ۱۲۸ با *n_bytes=1*، تابع ۲ (یا بیشتر) را برمی‌گرداند تا بیت " +"علامت صفر ذخیره شود." -msgid "If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will be omitted from size calculations. This allows, for example, 128 to fit in a single-byte buffer. If the destination buffer is later treated as signed, a positive input value may become negative. Note that the flag does not affect handling of negative values: for those, space for a sign bit is always requested." -msgstr "" +msgid "" +"If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " +"be omitted from size calculations. This allows, for example, 128 to fit in " +"a single-byte buffer. If the destination buffer is later treated as signed, " +"a positive input value may become negative. Note that the flag does not " +"affect handling of negative values: for those, space for a sign bit is " +"always requested." +msgstr "" +"اگر ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` مشخص شده باشد، بیت علامت صفر از " +"محاسبات اندازه حذف می‌شود. این امکان را فراهم می‌کند که برای مثال عدد ۱۲۸ در " +"یک بافر تک‌بایتی جا شود. اگر بافر مقصد بعداً علامت‌دار تلقی شود، ممکن است یک " +"مقدار ورودی مثبت به مقداری منفی تبدیل شود. توجه داشته باشید که این پرچم بر " +"مدیریت مقادیر منفی تأثیری ندارد: برای این مقادیر، همیشه فضایی برای بیت " +"علامت درخواست می‌شود." -msgid "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be set if *pylong* is negative. Without this flag, negative values will be copied provided there is enough space for at least one sign bit, regardless of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." +msgid "" +"Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " +"set if *pylong* is negative. Without this flag, negative values will be " +"copied provided there is enough space for at least one sign bit, regardless " +"of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" +"مشخص کردن ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` باعث می‌شود در صورت منفی بودن " +"*pylong*، یک استثنا تنظیم شود. بدون این پرچم، مقادیر منفی کپی می‌شوند، به " +"شرطی که فضای کافی برای حداقل یک بیت علامت وجود داشته باشد؛ صرف‌نظر از اینکه " +"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` مشخص شده باشد یا خیر." -msgid "If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is passed, its :meth:`~object.__index__` method will be called first. This may result in Python code executing and other threads being allowed to run, which could cause changes to other objects or values in use. When *flags* is ``-1``, this option is not set, and non-integer values will raise :exc:`TypeError`." -msgstr "" +msgid "" +"If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " +"passed, its :meth:`~object.__index__` method will be called first. This may " +"result in Python code executing and other threads being allowed to run, " +"which could cause changes to other objects or values in use. When *flags* " +"is ``-1``, this option is not set, and non-integer values will " +"raise :exc:`TypeError`." +msgstr "" +"اگر ``Py_ASNATIVEBYTES_ALLOW_INDEX`` تعیین شده باشد و یک مقدار غیر عدد صحیح " +"پاس داده شود، متد :meth:`~object.__index__` آن ابتدا فراخوانی خواهد شد. این " +"ممکن است منجر به اجرای کد پایتون شود و به نخ‌های دیگر اجازه اجرا داده شود، " +"که می‌تواند تغییراتی در اشیاء یا مقادیر دیگر در حال استفاده ایجاد کند. وقتی " +"*flags* برابر ``-1`` باشد، این گزینه تنظیم نشده است و مقادیر غیر عدد صحیح " +"باعث ایجاد :exc:`TypeError` می‌شوند." -msgid "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without *REJECT_NEGATIVE*), multiple Python integers can map to a single value without overflow. For example, both ``255`` and ``-1`` fit a single-byte buffer and set all its bits. This matches typical C cast behavior." +msgid "" +"With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " +"*REJECT_NEGATIVE*), multiple Python integers can map to a single value " +"without overflow. For example, both ``255`` and ``-1`` fit a single-byte " +"buffer and set all its bits. This matches typical C cast behavior." msgstr "" +"با *flags* پیش‌فرض (``-1``، یا *UNSIGNED_BUFFER* بدون *REJECT_NEGATIVE*)، " +"چندین عدد صحیح پایتون می‌توانند بدون سرریز به یک مقدار واحد نگاشت شوند. برای " +"مثال، هر دو ``255`` و ``-1`` در یک بافر تک‌بایتی جا می‌شوند و تمام بیت‌های آن " +"را تنظیم می‌کنند. این با رفتار تبدیل نوع معمول در C مطابقت دارد." msgid "Macro for converting a Python integer into a process identifier." -msgstr "" +msgstr "ماکرویی برای تبدیل یک عدد صحیح پایتون به شناسه فرایند." -msgid "This can be defined as an alias to :c:func:`PyLong_AsLong`, :c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the size of the system's PID type." +msgid "" +"This can be defined as an alias " +"to :c:func:`PyLong_AsLong`, :c:func:`PyLong_FromLongLong`, " +"or :c:func:`PyLong_AsInt`, depending on the size of the system's PID type." msgstr "" +"این می‌تواند بسته به اندازه‌ی نوع PID سیستم، به عنوان نام مستعاری " +"برای :c:func:`PyLong_AsLong`، :c:func:`PyLong_FromLongLong` " +"یا :c:func:`PyLong_AsInt` تعریف شود." msgid "Get the sign of the integer object *obj*." -msgstr "" +msgstr "علامت شیء عدد صحیح *obj* را دریافت کنید." -msgid "On success, set *\\*sign* to the integer sign (0, -1 or +1 for zero, negative or positive integer, respectively) and return 0." +msgid "" +"On success, set *\\*sign* to the integer sign (0, -1 or +1 for zero, " +"negative or positive integer, respectively) and return 0." msgstr "" +"در صورت موفقیت، *\\*sign* را برابر علامت عدد صحیح قرار می‌دهد (به ترتیب ۰، " +"-۱ یا +۱ برای عدد صحیح صفر، منفی یا مثبت) و ۰ را برمی‌گرداند." -msgid "On failure, return -1 with an exception set. This function always succeeds if *obj* is a :c:type:`PyLongObject` or its subtype." +msgid "" +"On failure, return -1 with an exception set. This function always succeeds " +"if *obj* is a :c:type:`PyLongObject` or its subtype." msgstr "" +"در صورت شکست، مقدار -1 را همراه با یک استثنای تنظیم‌شده برمی‌گرداند. اگر " +"*obj* یک :c:type:`PyLongObject` یا زیرنوع آن باشد، این تابع همیشه موفق " +"می‌شود." msgid "Check if the integer object *obj* is positive (``obj > 0``)." -msgstr "" +msgstr "بررسی کنید که شیء عدد صحیح *obj* مثبت باشد (``obj > 0``)." -msgid "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return ``1`` when it's positive and ``0`` otherwise. Else set an exception and return ``-1``." +msgid "" +"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " +"``1`` when it's positive and ``0`` otherwise. Else set an exception and " +"return ``-1``." msgstr "" +"اگر *obj* نمونه‌ای از :c:type:`PyLongObject` یا زیرنوع آن باشد، در صورت مثبت " +"بودن ``1`` و در غیر این صورت ``0`` را برمی‌گرداند. وگرنه یک استثنا تنظیم " +"کرده و ``-1`` را برمی‌گرداند." msgid "Check if the integer object *obj* is negative (``obj < 0``)." -msgstr "" +msgstr "بررسی می‌کند که آیا شیء عدد صحیح *obj* منفی است (``obj < 0``)." -msgid "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return ``1`` when it's negative and ``0`` otherwise. Else set an exception and return ``-1``." +msgid "" +"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " +"``1`` when it's negative and ``0`` otherwise. Else set an exception and " +"return ``-1``." msgstr "" +"اگر *obj* نمونه‌ای از :c:type:`PyLongObject` یا زیرنوع آن باشد، در صورت منفی " +"بودن ``1`` و در غیر این صورت ``0`` برمی‌گرداند. وگرنه یک استثنا تنظیم کرده و " +"``-1`` برمی‌گرداند." msgid "Check if the integer object *obj* is zero." -msgstr "" +msgstr "بررسی کنید که آیا شیء عدد صحیح *obj* صفر است." -msgid "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return ``1`` when it's zero and ``0`` otherwise. Else set an exception and return ``-1``." +msgid "" +"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " +"``1`` when it's zero and ``0`` otherwise. Else set an exception and return " +"``-1``." msgstr "" +"اگر *obj* نمونه‌ای از :c:type:`PyLongObject` یا زیرنوع آن باشد، در صورت صفر " +"بودن مقدار ``1`` و در غیر این صورت ``0`` را برمی‌گرداند. در غیر این صورت، یک " +"استثنا تنظیم می‌کند و ``-1`` را برمی‌گرداند." -msgid "On success, return a read only :term:`named tuple`, that holds information about Python's internal representation of integers. See :data:`sys.int_info` for description of individual fields." +msgid "" +"On success, return a read only :term:`named tuple`, that holds information " +"about Python's internal representation of integers. " +"See :data:`sys.int_info` for description of individual fields." msgstr "" +"در صورت موفقیت، یک :term:`named tuple` فقط‌خواندنی برمی‌گرداند که حاوی " +"اطلاعاتی درباره‌ی نمایش داخلی پایتون از اعداد صحیح است. برای توضیح هر یک از " +"فیلدها به :data:`sys.int_info` مراجعه کنید." msgid "On failure, return ``NULL`` with an exception set." -msgstr "" +msgstr "در صورت شکست، ``NULL`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند." msgid "Return 1 if *op* is compact, 0 otherwise." -msgstr "" +msgstr "اگر *op* فشرده باشد، ۱ و در غیر این صورت ۰ برمی‌گرداند." -msgid "This function makes it possible for performance-critical code to implement a “fast path” for small integers. For compact values use :c:func:`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." -msgstr "" +msgid "" +"This function makes it possible for performance-critical code to implement " +"a “fast path” for small integers. For compact values " +"use :c:func:`PyUnstable_Long_CompactValue`; for others fall back to " +"a :c:func:`PyLong_As* ` function " +"or :c:func:`PyLong_AsNativeBytes`." +msgstr "" +"این تابع به کدهای حساس به کارایی امکان می‌دهد تا یک «مسیر سریع» برای اعداد " +"صحیح کوچک پیاده‌سازی کنند. برای مقادیر فشرده " +"از :c:func:`PyUnstable_Long_CompactValue` استفاده کنید؛ برای مقادیر دیگر به " +"یک تابع :c:func:`PyLong_As* ` " +"یا :c:func:`PyLong_AsNativeBytes` مراجعه کنید." msgid "The speedup is expected to be negligible for most users." -msgstr "" +msgstr "انتظار می‌رود که افزایش سرعت برای اکثر کاربران ناچیز باشد." -msgid "Exactly what values are considered compact is an implementation detail and is subject to change." +msgid "" +"Exactly what values are considered compact is an implementation detail and " +"is subject to change." msgstr "" +"اینکه دقیقاً چه مقادیری فشرده در نظر گرفته می‌شوند، جزئیات پیاده‌سازی است و " +"ممکن است تغییر کند." -msgid "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, return its value." +msgid "" +"If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " +"return its value." msgstr "" +"اگر *op* فشرده باشد، همان‌طور که با :c:func:`PyUnstable_Long_IsCompact` " +"تعیین می‌شود، مقدار آن را برمی‌گرداند." msgid "Otherwise, the return value is undefined." -msgstr "" +msgstr "در غیر این صورت، مقدار بازگشتی تعریف‌نشده است." msgid "Export API" -msgstr "" +msgstr "API برون‌ریزی" -msgid "Layout of an array of \"digits\" (\"limbs\" in the GMP terminology), used to represent absolute value for arbitrary precision integers." +msgid "" +"Layout of an array of \"digits\" (\"limbs\" in the GMP terminology), used " +"to represent absolute value for arbitrary precision integers." msgstr "" +"چیدمان آرایه‌ای از «رقم‌ها» («limbs» در اصطلاحات GMP)، که برای نمایش مقدار " +"مطلق اعداد صحیح با دقت دلخواه استفاده می‌شود." -msgid "Use :c:func:`PyLong_GetNativeLayout` to get the native layout of Python :class:`int` objects, used internally for integers with \"big enough\" absolute value." +msgid "" +"Use :c:func:`PyLong_GetNativeLayout` to get the native layout of " +"Python :class:`int` objects, used internally for integers with \"big " +"enough\" absolute value." msgstr "" +"برای دریافت چیدمان بومی اشیاء :class:`int` پایتون، که به‌طور داخلی برای " +"اعداد صحیح با مقدار مطلق «به اندازه کافی بزرگ» به کار می‌رود، " +"از :c:func:`PyLong_GetNativeLayout` استفاده کنید." -msgid "See also :data:`sys.int_info` which exposes similar information in Python." +msgid "" +"See also :data:`sys.int_info` which exposes similar information in Python." msgstr "" +"همچنین :data:`sys.int_info` را ببینید که اطلاعات مشابهی را در پایتون در " +"دسترس قرار می‌دهد." -msgid "Bits per digit. For example, a 15 bit digit means that bits 0-14 contain meaningful information." +msgid "" +"Bits per digit. For example, a 15 bit digit means that bits 0-14 contain " +"meaningful information." msgstr "" +"بیت به ازای هر رقم. برای مثال، یک رقم ۱۵ بیتی به این معنی است که بیت‌های ۰ " +"تا ۱۴ حاوی اطلاعات معنادار هستند." -msgid "Digit size in bytes. For example, a 15 bit digit will require at least 2 bytes." +msgid "" +"Digit size in bytes. For example, a 15 bit digit will require at least 2 " +"bytes." msgstr "" +"اندازه رقم بر حسب بایت. برای مثال، یک رقم ۱۵ بیتی حداقل به ۲ بایت نیاز " +"خواهد داشت." msgid "Digits order:" -msgstr "" +msgstr "ترتیب ارقام:" msgid "``1`` for most significant digit first" -msgstr "" +msgstr "``1`` برای باارزش‌ترین رقم در ابتدا" msgid "``-1`` for least significant digit first" -msgstr "" +msgstr "``-1`` برای کم‌ارزش‌ترین رقم در ابتدا" msgid "Digit endianness:" -msgstr "" +msgstr "ترتیب ارقام:" msgid "``1`` for most significant byte first (big endian)" -msgstr "" +msgstr "``1`` برای معنادارترین بایت در ابتدا (بزرگ‌اندیان)" msgid "``-1`` for least significant byte first (little endian)" -msgstr "" +msgstr "``-1`` برای کم‌ارزش‌ترین بایت در ابتدا (کوچک‌اندیان)" msgid "Get the native layout of Python :class:`int` objects." -msgstr "" +msgstr "دریافت چیدمان بومی اشیای :class:`int` پایتون." msgid "See the :c:struct:`PyLongLayout` structure." -msgstr "" +msgstr "ساختار :c:struct:`PyLongLayout` را ببینید." -msgid "The function must not be called before Python initialization nor after Python finalization. The returned layout is valid until Python is finalized. The layout is the same for all Python sub-interpreters in a process, and so it can be cached." +msgid "" +"The function must not be called before Python initialization nor after " +"Python finalization. The returned layout is valid until Python is " +"finalized. The layout is the same for all Python sub-interpreters in a " +"process, and so it can be cached." msgstr "" +"تابع نباید نه پیش از مقداردهی اولیه پایتون و نه پس از نهایی‌سازی پایتون " +"فراخوانی شود. چیدمان بازگردانده‌شده تا زمان نهایی‌سازی پایتون معتبر است. " +"چیدمان برای همه زیرمفسرهای پایتون در یک فرایند یکسان است و بنابراین می‌توان " +"آن را در نهانگاه ذخیره کرد." msgid "Export of a Python :class:`int` object." -msgstr "" +msgstr "برون‌ریزی یک شیء :class:`int` پایتون." msgid "There are two cases:" -msgstr "" +msgstr "دو حالت وجود دارد:" -msgid "If :c:member:`digits` is ``NULL``, only use the :c:member:`value` member." +msgid "" +"If :c:member:`digits` is ``NULL``, only use the :c:member:`value` member." msgstr "" +"اگر :c:member:`digits` برابر با ``NULL`` باشد، فقط از عضو :c:member:`value` " +"استفاده کنید." -msgid "If :c:member:`digits` is not ``NULL``, use :c:member:`negative`, :c:member:`ndigits` and :c:member:`digits` members." +msgid "" +"If :c:member:`digits` is not ``NULL``, " +"use :c:member:`negative`, :c:member:`ndigits` and :c:member:`digits` " +"members." msgstr "" +"اگر :c:member:`digits` برابر ``NULL`` نباشد، از " +"اعضای :c:member:`negative`، :c:member:`ndigits` و :c:member:`digits` " +"استفاده کنید." -msgid "The native integer value of the exported :class:`int` object. Only valid if :c:member:`digits` is ``NULL``." +msgid "" +"The native integer value of the exported :class:`int` object. Only valid " +"if :c:member:`digits` is ``NULL``." msgstr "" +"مقدار عدد صحیح بومی شیء :class:`int` صادرشده. تنها در صورتی معتبر است " +"که :c:member:`digits` برابر ``NULL`` باشد." -msgid "``1`` if the number is negative, ``0`` otherwise. Only valid if :c:member:`digits` is not ``NULL``." +msgid "" +"``1`` if the number is negative, ``0`` otherwise. Only valid " +"if :c:member:`digits` is not ``NULL``." msgstr "" +"``1`` اگر عدد منفی باشد، در غیر این صورت ``0``. تنها زمانی معتبر است " +"که :c:member:`digits` برابر ``NULL`` نباشد." -msgid "Number of digits in :c:member:`digits` array. Only valid if :c:member:`digits` is not ``NULL``." +msgid "" +"Number of digits in :c:member:`digits` array. Only valid " +"if :c:member:`digits` is not ``NULL``." msgstr "" +"تعداد ارقام در آرایه‌ی :c:member:`digits`. تنها زمانی معتبر است " +"که :c:member:`digits` برابر ``NULL`` نباشد." msgid "Read-only array of unsigned digits. Can be ``NULL``." -msgstr "" +msgstr "آرایه‌ی فقط خواندنی از ارقام بدون علامت. می‌تواند ``NULL`` باشد." msgid "Export a Python :class:`int` object." -msgstr "" +msgstr "یک شیء :class:`int` پایتون را برون‌بری (export) می‌کند." -msgid "*export_long* must point to a :c:struct:`PyLongExport` structure allocated by the caller. It must not be ``NULL``." +msgid "" +"*export_long* must point to a :c:struct:`PyLongExport` structure allocated " +"by the caller. It must not be ``NULL``." msgstr "" +"*export_long* باید به یک ساختار :c:struct:`PyLongExport` که توسط فراخواننده " +"تخصیص داده‌شده است اشاره کند. این نباید ``NULL`` باشد." -msgid "On success, fill in *\\*export_long* and return ``0``. On error, set an exception and return ``-1``." +msgid "" +"On success, fill in *\\*export_long* and return ``0``. On error, set an " +"exception and return ``-1``." msgstr "" +"در صورت موفقیت، *\\*export_long* را پر می‌کند و ``0`` برمی‌گرداند. در صورت " +"خطا، یک استثنا تنظیم می‌کند و ``-1`` برمی‌گرداند." -msgid ":c:func:`PyLong_FreeExport` must be called when the export is no longer needed." +msgid "" +":c:func:`PyLong_FreeExport` must be called when the export is no longer " +"needed." msgstr "" +":c:func:`PyLong_FreeExport` باید زمانی فراخوانی شود که برون‌برد (export) " +"دیگر مورد نیاز نیست." -msgid "This function always succeeds if *obj* is a Python :class:`int` object or a subclass." +msgid "" +"This function always succeeds if *obj* is a Python :class:`int` object or a " +"subclass." msgstr "" +"این تابع همیشه موفق می‌شود اگر *obj* یک شیء :class:`int` پایتون یا زیرکلاسی " +"از آن باشد." msgid "Release the export *export_long* created by :c:func:`PyLong_Export`." msgstr "" +"آزاد کردن برون‌بری (export) *export_long* که توسط :c:func:`PyLong_Export` " +"ایجاد شده است." -msgid "Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits* is ``NULL``." +msgid "" +"Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits* is " +"``NULL``." msgstr "" +"فراخوانی :c:func:`PyLong_FreeExport` در صورتی که *export_long->digits* " +"برابر ``NULL`` باشد، اختیاری است." msgid "PyLongWriter API" -msgstr "" +msgstr "APIی PyLongWriter" msgid "The :c:type:`PyLongWriter` API can be used to import an integer." msgstr "" +"می‌توان از API :c:type:`PyLongWriter` برای ایمپورت کردن یک عدد صحیح استفاده " +"کرد." msgid "A Python :class:`int` writer instance." -msgstr "" +msgstr "یک نمونه نویسنده‌ی :class:`int` پایتون." -msgid "The instance must be destroyed by :c:func:`PyLongWriter_Finish` or :c:func:`PyLongWriter_Discard`." +msgid "" +"The instance must be destroyed by :c:func:`PyLongWriter_Finish` " +"or :c:func:`PyLongWriter_Discard`." msgstr "" +"نمونه باید توسط :c:func:`PyLongWriter_Finish` " +"یا :c:func:`PyLongWriter_Discard` نابود شود." msgid "Create a :c:type:`PyLongWriter`." -msgstr "" +msgstr "یک :c:type:`PyLongWriter` ایجاد کنید." -msgid "On success, allocate *\\*digits* and return a writer. On error, set an exception and return ``NULL``." +msgid "" +"On success, allocate *\\*digits* and return a writer. On error, set an " +"exception and return ``NULL``." msgstr "" +"در صورت موفقیت، *\\*digits* تخصیص داده می‌شود و یک نویسنده برگردانده می‌شود. " +"در صورت خطا، یک استثنا تنظیم می‌شود و ``NULL`` برگردانده می‌شود." msgid "*negative* is ``1`` if the number is negative, or ``0`` otherwise." msgstr "" +"*negative* در صورت منفی بودن عدد برابر ``1`` و در غیر این صورت برابر ``0`` " +"است." -msgid "*ndigits* is the number of digits in the *digits* array. It must be greater than 0." -msgstr "" +msgid "" +"*ndigits* is the number of digits in the *digits* array. It must be greater " +"than 0." +msgstr "*ndigits* تعداد ارقام در آرایه *digits* است. باید بزرگ‌تر از ۰ باشد." msgid "*digits* must not be NULL." -msgstr "" +msgstr "*digits* نباید NULL باشد." -msgid "After a successful call to this function, the caller should fill in the array of digits *digits* and then call :c:func:`PyLongWriter_Finish` to get a Python :class:`int`. The layout of *digits* is described by :c:func:`PyLong_GetNativeLayout`." +msgid "" +"After a successful call to this function, the caller should fill in the " +"array of digits *digits* and then call :c:func:`PyLongWriter_Finish` to get " +"a Python :class:`int`. The layout of *digits* is described " +"by :c:func:`PyLong_GetNativeLayout`." msgstr "" +"پس از فراخوانی موفق این تابع، فراخوانی‌کننده باید آرایه‌ی ارقام *digits* را " +"پر کند و سپس :c:func:`PyLongWriter_Finish` را فراخوانی کند تا " +"یک :class:`int` پایتونی به دست آورد. چیدمان *digits* " +"توسط :c:func:`PyLong_GetNativeLayout` توصیف می‌شود." -msgid "Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``] (where the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits per digit). Any unused most significant digits must be set to ``0``." +msgid "" +"Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``] (where " +"the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits per " +"digit). Any unused most significant digits must be set to ``0``." msgstr "" +"رقم‌ها باید در بازه‌ی [``0``; ``(1 << bits_per_digit) - 1``] باشند (که در " +"آن :c:struct:`~PyLongLayout.bits_per_digit` تعداد بیت‌های هر رقم است). هر " +"رقم مرتبه‌بالا که استفاده نشده باشد، باید برابر ``0`` قرار داده شود." -msgid "Alternately, call :c:func:`PyLongWriter_Discard` to destroy the writer instance without creating an :class:`~int` object." +msgid "" +"Alternately, call :c:func:`PyLongWriter_Discard` to destroy the writer " +"instance without creating an :class:`~int` object." msgstr "" +"به‌طور جایگزین، می‌توانید :c:func:`PyLongWriter_Discard` را فراخوانی کنید تا " +"نمونه‌ی نویسنده را بدون ایجاد شیء :class:`~int` نابود کنید." -msgid "Finish a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." +msgid "" +"Finish a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" +"یک :c:type:`PyLongWriter` ایجاد‌شده توسط :c:func:`PyLongWriter_Create` را " +"نهایی کنید." -msgid "On success, return a Python :class:`int` object. On error, set an exception and return ``NULL``." +msgid "" +"On success, return a Python :class:`int` object. On error, set an exception " +"and return ``NULL``." msgstr "" +"در صورت موفقیت، یک شیء :class:`int` پایتون برمی‌گرداند. در صورت خطا، یک " +"استثنا تنظیم کرده و ``NULL`` را برمی‌گرداند." -msgid "The function takes care of normalizing the digits and converts the object to a compact integer if needed." +msgid "" +"The function takes care of normalizing the digits and converts the object " +"to a compact integer if needed." msgstr "" +"این تابع نرمال‌سازی ارقام را انجام می‌دهد و در صورت نیاز، شیء را به یک عدد " +"صحیح فشرده تبدیل می‌کند." msgid "The writer instance and the *digits* array are invalid after the call." msgstr "" +"نمونه‌ی نوشتارگر (writer) و آرایه‌ی *digits* پس از فراخوانی نامعتبر می‌شوند." -msgid "Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." +msgid "" +"Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" +"یک :c:type:`PyLongWriter` ایجاد‌شده توسط :c:func:`PyLongWriter_Create` را " +"دور بیندازید." msgid "If *writer* is ``NULL``, no operation is performed." -msgstr "" +msgstr "اگر *writer* برابر ``NULL`` باشد، هیچ عملیاتی انجام نمی‌شود." msgid "Deprecated API" -msgstr "" +msgstr "API منسوخ" -msgid "These macros are :term:`soft deprecated`. They describe parameters of the internal representation of :c:type:`PyLongObject` instances." +msgid "" +"These macros are :term:`soft deprecated`. They describe parameters of the " +"internal representation of :c:type:`PyLongObject` instances." msgstr "" +"این ماکروها :term:`به‌نرمی منسوخ ` هستند. آن‌ها پارامترهای " +"نمایش داخلی نمونه‌های :c:type:`PyLongObject` را توصیف می‌کنند." -msgid "Use :c:func:`PyLong_GetNativeLayout` instead, along with :c:func:`PyLong_Export` to read integer data or :c:type:`PyLongWriter` to write it. These currently use the same layout, but are designed to continue working correctly even if CPython's internal integer representation changes." -msgstr "" +msgid "" +"Use :c:func:`PyLong_GetNativeLayout` instead, along " +"with :c:func:`PyLong_Export` to read integer data or :c:type:`PyLongWriter` " +"to write it. These currently use the same layout, but are designed to " +"continue working correctly even if CPython's internal integer " +"representation changes." +msgstr "" +"به‌جای آن از :c:func:`PyLong_GetNativeLayout` استفاده کنید، همراه " +"با :c:func:`PyLong_Export` برای خواندن داده‌های عدد صحیح " +"یا :c:type:`PyLongWriter` برای نوشتن آن. این‌ها در حال حاضر از همان چیدمان " +"استفاده می‌کنند، اما به‌گونه‌ای طراحی شده‌اند که حتی اگر نمایش داخلی اعداد صحیح " +"در سی‌پایتون تغییر کند، همچنان به‌درستی کار کنند." -msgid "This is equivalent to :c:member:`~PyLongLayout.bits_per_digit` in the output of :c:func:`PyLong_GetNativeLayout`." +msgid "" +"This is equivalent to :c:member:`~PyLongLayout.bits_per_digit` in the " +"output of :c:func:`PyLong_GetNativeLayout`." msgstr "" +"این معادل :c:member:`~PyLongLayout.bits_per_digit` در " +"خروجی :c:func:`PyLong_GetNativeLayout` است." msgid "This is currently equivalent to :c:expr:`1 << PyLong_SHIFT`." -msgstr "" +msgstr "این در حال حاضر معادل :c:expr:`1 << PyLong_SHIFT` است." msgid "This is currently equivalent to :c:expr:`(1 << PyLong_SHIFT) - 1`" -msgstr "" +msgstr "این در حال حاضر معادل :c:expr:`(1 << PyLong_SHIFT) - 1` است" msgid "object" -msgstr "" +msgstr "شیء" msgid "long integer" -msgstr "" +msgstr "عدد صحیح بلند" msgid "integer" -msgstr "" +msgstr "عدد صحیح" msgid "LONG_MAX (C macro)" -msgstr "" +msgstr "LONG_MAX (ماکروی C)" msgid "OverflowError (built-in exception)" -msgstr "" +msgstr "OverflowError (استثنای توکار)" msgid "PY_SSIZE_T_MAX (C macro)" -msgstr "" +msgstr "PY_SSIZE_T_MAX (ماکروی C)" msgid "ULONG_MAX (C macro)" -msgstr "" +msgstr "ULONG_MAX (ماکروی C)" msgid "SIZE_MAX (C macro)" -msgstr "" +msgstr "SIZE_MAX (ماکروی C)" diff --git a/c-api/mapping.po b/c-api/mapping.po index 5f3603b70..33926cebe 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -23,70 +23,180 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Mapping Protocol" -msgstr "" +msgstr "پروتکل نگاشت" -msgid "See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and :c:func:`PyObject_DelItem`." +msgid "" +"See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and " +":c:func:`PyObject_DelItem`." msgstr "" +"همچنین :c:func:`PyObject_GetItem`، :c:func:`PyObject_SetItem` و " +":c:func:`PyObject_DelItem` را ببینید." -msgid "Return ``1`` if the object provides the mapping protocol or supports slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes with a :meth:`~object.__getitem__` method, since in general it is impossible to determine what type of keys the class supports. This function always succeeds." -msgstr "" +msgid "" +"Return ``1`` if the object provides the mapping protocol or supports " +"slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes" +" with a :meth:`~object.__getitem__` method, since in general it is " +"impossible to determine what type of keys the class supports. This function " +"always succeeds." +msgstr "" +"اگر شیء پروتکل نگاشت را فراهم کند یا از اسلایس‌کردن پشتیبانی کند، ``1`` را " +"برمی‌گرداند و در غیر این صورت ``0``. توجه داشته باشید که برای کلاس‌های " +"پایتون دارای متد :meth:`~object.__getitem__` مقدار ``1`` را برمی‌گرداند، " +"زیرا به‌طور کلی تشخیص اینکه کلاس از چه نوع کلیدهایی پشتیبانی می‌کند " +"امکان‌پذیر نیست. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Returns the number of keys in object *o* on success, and ``-1`` on failure. This is equivalent to the Python expression ``len(o)``." +msgid "" +"Returns the number of keys in object *o* on success, and ``-1`` on failure. " +"This is equivalent to the Python expression ``len(o)``." msgstr "" +"در صورت موفقیت، تعداد کلیدهای شیء *o* را برمی‌گرداند و در صورت شکست ``-1``. " +"این معادل عبارت پایتونی ``len(o)`` است." -msgid "This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_GetItem` است، اما *کلید* به‌جای " +":c:expr:`PyObject*`، به‌صورت یک رشته‌ی بایتِ کدگذاری‌شده با UTF-8 از نوع " +":c:expr:`const char*` مشخص می‌شود." -msgid "Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if the key is not found." +msgid "" +"Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if" +" the key is not found." msgstr "" +"گونه‌ای از :c:func:`PyObject_GetItem` که اگر کلید پیدا نشود، استثنای " +":exc:`KeyError` را ایجاد نمی‌کند." -msgid "If the key is found, return ``1`` and set *\\*result* to a new :term:`strong reference` to the corresponding value. If the key is not found, return ``0`` and set *\\*result* to ``NULL``; the :exc:`KeyError` is silenced. If an error other than :exc:`KeyError` is raised, return ``-1`` and set *\\*result* to ``NULL``." -msgstr "" +msgid "" +"If the key is found, return ``1`` and set *\\*result* to a new :term:`strong" +" reference` to the corresponding value. If the key is not found, return " +"``0`` and set *\\*result* to ``NULL``; the :exc:`KeyError` is silenced. If " +"an error other than :exc:`KeyError` is raised, return ``-1`` and set " +"*\\*result* to ``NULL``." +msgstr "" +"اگر کلید یافت شود، ``1`` را برمی‌گرداند و *\\*result* را روی یک :term:`ارجاع" +" قوی ` جدید به مقدار متناظر تنظیم می‌کند. اگر کلید یافت " +"نشود، ``0`` را برمی‌گرداند و *\\*result* را روی ``NULL`` تنظیم می‌کند؛ " +"استثنای :exc:`KeyError` سرکوب می‌شود. اگر خطایی غیر از :exc:`KeyError` رخ " +"دهد، ``-1`` را برمی‌گرداند و *\\*result* را روی ``NULL`` تنظیم می‌کند." -msgid "This is the same as :c:func:`PyMapping_GetOptionalItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyMapping_GetOptionalItem`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than" +" a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyMapping_GetOptionalItem` است، اما *key* به‌صورت یک رشته " +"بایتی کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه یک " +":c:expr:`PyObject*`." -msgid "This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_SetItem` است، اما *key* به‌جای " +":c:expr:`PyObject*` به‌صورت یک رشته‌ی بایتِ کدگذاری‌شده با UTF-8 از نوع " +":c:expr:`const char*` مشخص می‌شود." msgid "This is an alias of :c:func:`PyObject_DelItem`." -msgstr "" +msgstr "این یک نام مستعار برای :c:func:`PyObject_DelItem` است." -msgid "This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_DelItem` است، اما *key* به‌صورت یک رشته‌ی " +"بایت‌های کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه " +"به‌صورت :c:expr:`PyObject*`." -msgid "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. This is equivalent to the Python expression ``key in o``. On failure, return ``-1``." +msgid "" +"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " +"This is equivalent to the Python expression ``key in o``. On failure, return" +" ``-1``." msgstr "" +"اگر شیء نگاشت کلید *key* را داشته باشد ``1`` و در غیر این صورت ``0`` " +"برمی‌گرداند. این معادل عبارت پایتونی ``key in o`` است. در صورت شکست، ``-1`` " +"برمی‌گرداند." -msgid "This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than" +" a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyMapping_HasKeyWithError` است، اما *key* به‌عنوان یک " +"رشته‌ی بایتی کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، " +"نه به‌صورت :c:expr:`PyObject*`." -msgid "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. This is equivalent to the Python expression ``key in o``. This function always succeeds." +msgid "" +"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " +"This is equivalent to the Python expression ``key in o``. This function " +"always succeeds." msgstr "" +"اگر شیء نگاشت دارای کلید *کلید* باشد، ``1`` و در غیر این صورت ``0`` " +"برمی‌گرداند. این معادل عبارت پایتونی ``key in o`` است. این تابع همیشه با " +"موفقیت اجرا می‌شود." -msgid "Exceptions which occur when this calls the :meth:`~object.__getitem__` method are silently ignored. For proper error handling, use :c:func:`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:`PyObject_GetItem()` instead." +msgid "" +"Exceptions which occur when this calls the :meth:`~object.__getitem__` " +"method are silently ignored. For proper error handling, use " +":c:func:`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or " +":c:func:`PyObject_GetItem()` instead." msgstr "" +"استثناهایی که هنگام فراخوانی متد :meth:`~object.__getitem__` توسط این تابع " +"رخ می‌دهند، بی‌صدا نادیده گرفته می‌شوند. برای مدیریت صحیح خطاها، به جای آن " +"از :c:func:`PyMapping_HasKeyWithError`، :c:func:`PyMapping_GetOptionalItem` " +"یا :c:func:`PyObject_GetItem()` استفاده کنید." -msgid "This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a " +":c:expr:`const char*` UTF-8 encoded bytes string, rather than a " +":c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyMapping_HasKey` است، با این تفاوت که *key* به‌عنوان یک " +"رشته‌ی بایتی کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، " +"نه یک :c:expr:`PyObject*`." -msgid "Exceptions that occur when this calls the :meth:`~object.__getitem__` method or while creating the temporary :class:`str` object are silently ignored. For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`, :c:func:`PyMapping_GetOptionalItemString` or :c:func:`PyMapping_GetItemString` instead." -msgstr "" +msgid "" +"Exceptions that occur when this calls the :meth:`~object.__getitem__` method" +" or while creating the temporary :class:`str` object are silently ignored. " +"For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`, " +":c:func:`PyMapping_GetOptionalItemString` or " +":c:func:`PyMapping_GetItemString` instead." +msgstr "" +"استثناهایی که هنگام فراخوانی متد :meth:`~object.__getitem__` یا هنگام ایجاد " +"شیء موقت :class:`str` رخ می‌دهند، بی‌صدا نادیده گرفته می‌شوند. برای مدیریت " +"صحیح خطا، به جای آن از :c:func:`PyMapping_HasKeyStringWithError`، " +":c:func:`PyMapping_GetOptionalItemString` یا " +":c:func:`PyMapping_GetItemString` استفاده کنید." -msgid "On success, return a list of the keys in object *o*. On failure, return ``NULL``." +msgid "" +"On success, return a list of the keys in object *o*. On failure, return " +"``NULL``." msgstr "" +"در صورت موفقیت، فهرستی از کلیدهای شیء *o* را برمی‌گرداند. در صورت شکست، " +"``NULL`` را برمی‌گرداند." msgid "Previously, the function returned a list or a tuple." -msgstr "" +msgstr "پیش‌تر، این تابع یک فهرست یا یک تاپل را برمی‌گرداند." -msgid "On success, return a list of the values in object *o*. On failure, return ``NULL``." +msgid "" +"On success, return a list of the values in object *o*. On failure, return " +"``NULL``." msgstr "" +"در صورت موفقیت، فهرستی از مقادیر موجود در شیء *o* را برمی‌گرداند. در صورت " +"شکست، ``NULL`` را برمی‌گرداند." -msgid "On success, return a list of the items in object *o*, where each item is a tuple containing a key-value pair. On failure, return ``NULL``." +msgid "" +"On success, return a list of the items in object *o*, where each item is a " +"tuple containing a key-value pair. On failure, return ``NULL``." msgstr "" +"در صورت موفقیت، فهرستی از آیتم‌های شیء *o* را برمی‌گرداند که هر آیتم آن، " +"تاپلی حاوی یک جفت کلید-مقدار است. در صورت شکست، ``NULL`` را برمی‌گرداند." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "len" -msgstr "" +msgstr "len" diff --git a/c-api/marshal.po b/c-api/marshal.po index 36d67c41a..5a8fa6761 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -22,52 +22,129 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Data marshalling support" -msgstr "" +msgstr "پشتیبانی از مارشالینگ داده" -msgid "These routines allow C code to work with serialized objects using the same data format as the :mod:`marshal` module. There are functions to write data into the serialization format, and additional functions that can be used to read the data back. Files used to store marshalled data must be opened in binary mode." -msgstr "" +msgid "" +"These routines allow C code to work with serialized objects using the same " +"data format as the :mod:`marshal` module. There are functions to write data" +" into the serialization format, and additional functions that can be used to" +" read the data back. Files used to store marshalled data must be opened in " +"binary mode." +msgstr "" +"این روتین‌ها به کد C اجازه می‌دهند تا با اشیاء سریال‌سازی‌شده، با استفاده از" +" همان قالب داده‌ی ماژول :mod:`marshal` کار کند. توابعی برای نوشتن داده‌ها در" +" قالب سریال‌سازی وجود دارند و علاوه بر آن‌ها، توابع دیگری نیز هستند که " +"می‌توان از آن‌ها برای بازخوانی داده‌ها استفاده کرد. پرونده‌هایی که برای " +"ذخیره‌سازی داده‌های مارشال‌شده استفاده می‌شوند، باید در حالت دودویی باز " +"شوند." msgid "Numeric values are stored with the least significant byte first." msgstr "" +"مقادیر عددی به‌گونه‌ای ذخیره می‌شوند که کم‌ارزش‌ترین بایت در ابتدا قرار " +"گیرد." -msgid "The module supports several versions of the data format; see the :py:mod:`Python module documentation ` for details." +msgid "" +"The module supports several versions of the data format; see the " +":py:mod:`Python module documentation ` for details." msgstr "" +"این ماژول از چندین نسخه از قالب داده پشتیبانی می‌کند؛ برای جزئیات، " +":py:mod:`مستندات ماژول پایتون ` را ببینید." msgid "The current format version. See :py:data:`marshal.version`." -msgstr "" +msgstr "نسخه‌ی فعلی قالب. به :py:data:`marshal.version` مراجعه کنید." -msgid "Marshal a :c:expr:`long` integer, *value*, to *file*. This will only write the least-significant 32 bits of *value*; regardless of the size of the native :c:expr:`long` type. *version* indicates the file format." +msgid "" +"Marshal a :c:expr:`long` integer, *value*, to *file*. This will only write " +"the least-significant 32 bits of *value*; regardless of the size of the " +"native :c:expr:`long` type. *version* indicates the file format." msgstr "" +"یک عدد صحیح :c:expr:`long` به نام *value* را در *file* مارشال می‌کند. این " +"تابع تنها ۳۲ بیت کم‌ارزش *value* را می‌نویسد؛ صرف‌نظر از اندازه‌ی نوع بومی " +":c:expr:`long`. *version* قالب پرونده را نشان می‌دهد." -msgid "This function can fail, in which case it sets the error indicator. Use :c:func:`PyErr_Occurred` to check for that." +msgid "" +"This function can fail, in which case it sets the error indicator. Use " +":c:func:`PyErr_Occurred` to check for that." msgstr "" +"این تابع می‌تواند شکست بخورد، که در این صورت نشانگر خطا را تنظیم می‌کند. " +"برای بررسی این موضوع از :c:func:`PyErr_Occurred` استفاده کنید." -msgid "Marshal a Python object, *value*, to *file*. *version* indicates the file format." +msgid "" +"Marshal a Python object, *value*, to *file*. *version* indicates the file " +"format." msgstr "" +"یک شیء پایتون، *value*، را به *file* مارشال کنید. *version* قالب پرونده را " +"مشخص می‌کند." -msgid "Return a bytes object containing the marshalled representation of *value*. *version* indicates the file format." +msgid "" +"Return a bytes object containing the marshalled representation of *value*. " +"*version* indicates the file format." msgstr "" +"یک شیء bytes حاوی نمایش مارشال‌شده‌ی *value* را برمی‌گرداند. *version* قالب " +"پرونده را مشخص می‌کند." msgid "The following functions allow marshalled values to be read back in." -msgstr "" +msgstr "توابع زیر امکان بازخوانی مقادیر مارشال‌شده را فراهم می‌کنند." -msgid "Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened for reading. Only a 32-bit value can be read in using this function, regardless of the native size of :c:expr:`long`." +msgid "" +"Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened " +"for reading. Only a 32-bit value can be read in using this function, " +"regardless of the native size of :c:expr:`long`." msgstr "" +"یک :c:expr:`long` سی را از جریان داده در یک :c:expr:`FILE*` که برای خواندن " +"باز شده است برمی‌گرداند. با استفاده از این تابع تنها می‌توان یک مقدار ۳۲ " +"بیتی را خواند، صرف‌نظر از اندازه بومی :c:expr:`long`." -msgid "On error, sets the appropriate exception (:exc:`EOFError`) and returns ``-1``." +msgid "" +"On error, sets the appropriate exception (:exc:`EOFError`) and returns " +"``-1``." msgstr "" +"در صورت خطا، استثنای مناسب (:exc:`EOFError`) را تنظیم می‌کند و ``-1`` را " +"برمی‌گرداند." -msgid "Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened for reading. Only a 16-bit value can be read in using this function, regardless of the native size of :c:expr:`short`." +msgid "" +"Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened " +"for reading. Only a 16-bit value can be read in using this function, " +"regardless of the native size of :c:expr:`short`." msgstr "" +"بازگرداندن یک :c:expr:`short` از زبان C از جریان داده در یک :c:expr:`FILE*` " +"که برای خواندن باز شده است. با استفاده از این تابع فقط می‌توان یک مقدار ۱۶ " +"بیتی را خواند، صرف‌نظر از اندازه بومی :c:expr:`short`." -msgid "Return a Python object from the data stream in a :c:expr:`FILE*` opened for reading." +msgid "" +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"reading." msgstr "" +"یک شیء پایتون را از جریان داده در یک :c:expr:`FILE*` که برای خواندن باز شده " +"است، برمی‌گرداند." -msgid "On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`) and returns ``NULL``." +msgid "" +"On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError`" +" or :exc:`TypeError`) and returns ``NULL``." msgstr "" +"در صورت خطا، استثنای مناسب (:exc:`EOFError`، :exc:`ValueError` یا " +":exc:`TypeError`) را تنظیم می‌کند و ``NULL`` را برمی‌گرداند." -msgid "Return a Python object from the data stream in a :c:expr:`FILE*` opened for reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function assumes that no further objects will be read from the file, allowing it to aggressively load file data into memory so that the de-serialization can operate from data in memory rather than reading a byte at a time from the file. Only use this variant if you are certain that you won't be reading anything else from the file." -msgstr "" +msgid "" +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " +"assumes that no further objects will be read from the file, allowing it to " +"aggressively load file data into memory so that the de-serialization can " +"operate from data in memory rather than reading a byte at a time from the " +"file. Only use this variant if you are certain that you won't be reading " +"anything else from the file." +msgstr "" +"یک شیء پایتون را از جریان داده در یک :c:expr:`FILE*` باز‌شده برای خواندن " +"برمی‌گرداند. برخلاف :c:func:`PyMarshal_ReadObjectFromFile`، این تابع فرض " +"می‌کند که هیچ شیء دیگری از پرونده خوانده نخواهد شد و همین فرض به آن اجازه " +"می‌دهد که داده‌های پرونده را به‌طور پرخاشگرانه در حافظه بارگذاری کند تا " +"سریال‌زدایی بتواند به‌جای خواندن بایت‌به‌بایت از پرونده، بر اساس داده‌های " +"موجود در حافظه عمل کند. تنها در صورتی از این گونه استفاده کنید که مطمئن " +"باشید هیچ چیز دیگری از پرونده نخواهید خواند." -msgid "Return a Python object from the data stream in a byte buffer containing *len* bytes pointed to by *data*." +msgid "" +"Return a Python object from the data stream in a byte buffer containing " +"*len* bytes pointed to by *data*." msgstr "" +"یک شیء پایتون را از جریان داده در یک بافر بایت شامل *len* بایت که *data* به " +"آن اشاره می‌کند، برمی‌گرداند." diff --git a/c-api/memory.po b/c-api/memory.po index 571ae15aa..08324b490 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -25,22 +25,79 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Memory Management" -msgstr "" +msgstr "مدیریت حافظه" msgid "Overview" -msgstr "" +msgstr "مرور کلی" -msgid "Memory management in Python involves a private heap containing all Python objects and data structures. The management of this private heap is ensured internally by the *Python memory manager*. The Python memory manager has different components which deal with various dynamic storage management aspects, like sharing, segmentation, preallocation or caching." -msgstr "" +msgid "" +"Memory management in Python involves a private heap containing all Python " +"objects and data structures. The management of this private heap is ensured " +"internally by the *Python memory manager*. The Python memory manager has " +"different components which deal with various dynamic storage management " +"aspects, like sharing, segmentation, preallocation or caching." +msgstr "" +"مدیریت حافظه در پایتون شامل یک هیپ خصوصی است که تمام اشیاء و ساختارهای " +"داده‌ی پایتون را در بر می‌گیرد. مدیریت این هیپ خصوصی به‌طور داخلی توسط *مدیر" +" حافظه پایتون* تضمین می‌شود. مدیر حافظه پایتون اجزای مختلفی دارد که با " +"جنبه‌های گوناگون مدیریت ذخیره‌سازی پویا، مانند اشتراک‌گذاری، قطعه‌بندی، " +"پیش‌تخصیص یا نهان‌گذاری، سروکار دارند." -msgid "At the lowest level, a raw memory allocator ensures that there is enough room in the private heap for storing all Python-related data by interacting with the memory manager of the operating system. On top of the raw memory allocator, several object-specific allocators operate on the same heap and implement distinct memory management policies adapted to the peculiarities of every object type. For example, integer objects are managed differently within the heap than strings, tuples or dictionaries because integers imply different storage requirements and speed/space tradeoffs. The Python memory manager thus delegates some of the work to the object-specific allocators, but ensures that the latter operate within the bounds of the private heap." -msgstr "" +msgid "" +"At the lowest level, a raw memory allocator ensures that there is enough " +"room in the private heap for storing all Python-related data by interacting " +"with the memory manager of the operating system. On top of the raw memory " +"allocator, several object-specific allocators operate on the same heap and " +"implement distinct memory management policies adapted to the peculiarities " +"of every object type. For example, integer objects are managed differently " +"within the heap than strings, tuples or dictionaries because integers imply " +"different storage requirements and speed/space tradeoffs. The Python memory " +"manager thus delegates some of the work to the object-specific allocators, " +"but ensures that the latter operate within the bounds of the private heap." +msgstr "" +"در پایین‌ترین سطح، یک تخصیص‌دهنده‌ی حافظه‌ی خام از طریق تعامل با مدیر " +"حافظه‌ی سیستم‌عامل اطمینان می‌دهد که فضای کافی برای ذخیره‌سازی تمام داده‌های" +" مرتبط با پایتون در هیپ خصوصی وجود داشته باشد. بر فراز تخصیص‌دهنده‌ی حافظه‌ی" +" خام، چندین تخصیص‌دهنده‌ی مخصوص شیء روی همان هیپ فعالیت می‌کنند و سیاست‌های " +"متمایز مدیریت حافظه را که با ویژگی‌های خاص هر نوع شیء تطبیق یافته‌اند، " +"پیاده‌سازی می‌کنند. برای مثال، شیءهای عدد صحیح درون هیپ به‌گونه‌ای متفاوت از" +" رشته‌ها، تاپل‌ها یا دیکشنری‌ها مدیریت می‌شوند، زیرا اعداد صحیح نیازمندی‌های" +" ذخیره‌سازی و توازن‌های سرعت/فضای متفاوتی ایجاب می‌کنند. بدین ترتیب، مدیر " +"حافظه‌ی پایتون بخشی از کار را به تخصیص‌دهنده‌های مخصوص شیء واگذار می‌کند، " +"اما اطمینان می‌دهد که این تخصیص‌دهنده‌ها در محدوده‌ی هیپ خصوصی فعالیت کنند." -msgid "It is important to understand that the management of the Python heap is performed by the interpreter itself and that the user has no control over it, even if they regularly manipulate object pointers to memory blocks inside that heap. The allocation of heap space for Python objects and other internal buffers is performed on demand by the Python memory manager through the Python/C API functions listed in this document." -msgstr "" +msgid "" +"It is important to understand that the management of the Python heap is " +"performed by the interpreter itself and that the user has no control over " +"it, even if they regularly manipulate object pointers to memory blocks " +"inside that heap. The allocation of heap space for Python objects and other" +" internal buffers is performed on demand by the Python memory manager " +"through the Python/C API functions listed in this document." +msgstr "" +"مهم است بدانید که مدیریت هیپ پایتون توسط خودِ مفسر انجام می‌شود و کاربر هیچ " +"کنترلی بر آن ندارد، حتی اگر به‌طور منظم اشاره‌گرهای اشیاء به بلوک‌های حافظه " +"درون آن هیپ را دستکاری کند. تخصیص فضای هیپ برای اشیاء پایتون و بافرهای داخلی" +" دیگر، به‌صورت درخواستی توسط مدیر حافظه پایتون از طریق توابع Python/C API " +"فهرست‌شده در این سند انجام می‌شود." -msgid "To avoid memory corruption, extension writers should never try to operate on Python objects with the functions exported by the C library: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will result in mixed calls between the C allocator and the Python memory manager with fatal consequences, because they implement different algorithms and operate on different heaps. However, one may safely allocate and release memory blocks with the C library allocator for individual purposes, as shown in the following example::" -msgstr "" +msgid "" +"To avoid memory corruption, extension writers should never try to operate on" +" Python objects with the functions exported by the C library: " +":c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. " +"This will result in mixed calls between the C allocator and the Python " +"memory manager with fatal consequences, because they implement different " +"algorithms and operate on different heaps. However, one may safely allocate" +" and release memory blocks with the C library allocator for individual " +"purposes, as shown in the following example::" +msgstr "" +"برای پرهیز از خرابی حافظه، نویسندگان ماژول‌های توسعه‌ای هرگز نباید سعی کنند " +"با توابع صادرشده توسط کتابخانه C: :c:func:`malloc`، :c:func:`calloc`، " +":c:func:`realloc` و :c:func:`free` روی اشیاء پایتون عمل کنند. این کار به " +"فراخوانی‌های ترکیبی میان تخصیص‌دهنده C و مدیر حافظه پایتون با پیامدهای " +"مرگبار منجر خواهد شد، زیرا آن‌ها الگوریتم‌های متفاوتی را پیاده‌سازی می‌کنند " +"و روی هیپ‌های متفاوتی کار می‌کنند. با این حال، می‌توان برای مقاصد شخصی، " +"بلوک‌های حافظه را با تخصیص‌دهنده کتابخانه C به‌طور ایمن تخصیص داد و آزاد " +"کرد، همان‌طور که در مثال زیر نشان داده شده است::" msgid "" "PyObject *res;\n" @@ -53,609 +110,1235 @@ msgid "" "free(buf); /* malloc'ed */\n" "return res;" msgstr "" +"PyObject *res;\n" +"char *buf = (char *) malloc(BUFSIZ); /* برای ورودی/خروجی */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"...انجام برخی عملیات ورودی/خروجی با buf...\n" +"res = PyBytes_FromString(buf);\n" +"free(buf); /* تخصیص‌یافته با malloc */\n" +"return res;" -msgid "In this example, the memory request for the I/O buffer is handled by the C library allocator. The Python memory manager is involved only in the allocation of the bytes object returned as a result." +msgid "" +"In this example, the memory request for the I/O buffer is handled by the C " +"library allocator. The Python memory manager is involved only in the " +"allocation of the bytes object returned as a result." msgstr "" +"در این مثال، درخواست حافظه برای بافر ورودی/خروجی توسط تخصیص‌دهنده‌ی کتابخانه" +" C برطرف می‌شود. مدیر حافظه‌ی پایتون تنها در تخصیص شیء بایتی که به‌عنوان " +"نتیجه بازگردانده می‌شود نقش دارد." -msgid "In most situations, however, it is recommended to allocate memory from the Python heap specifically because the latter is under control of the Python memory manager. For example, this is required when the interpreter is extended with new object types written in C. Another reason for using the Python heap is the desire to *inform* the Python memory manager about the memory needs of the extension module. Even when the requested memory is used exclusively for internal, highly specific purposes, delegating all memory requests to the Python memory manager causes the interpreter to have a more accurate image of its memory footprint as a whole. Consequently, under certain circumstances, the Python memory manager may or may not trigger appropriate actions, like garbage collection, memory compaction or other preventive procedures. Note that by using the C library allocator as shown in the previous example, the allocated memory for the I/O buffer completely escapes the Python memory manager." -msgstr "" +msgid "" +"In most situations, however, it is recommended to allocate memory from the " +"Python heap specifically because the latter is under control of the Python " +"memory manager. For example, this is required when the interpreter is " +"extended with new object types written in C. Another reason for using the " +"Python heap is the desire to *inform* the Python memory manager about the " +"memory needs of the extension module. Even when the requested memory is used" +" exclusively for internal, highly specific purposes, delegating all memory " +"requests to the Python memory manager causes the interpreter to have a more " +"accurate image of its memory footprint as a whole. Consequently, under " +"certain circumstances, the Python memory manager may or may not trigger " +"appropriate actions, like garbage collection, memory compaction or other " +"preventive procedures. Note that by using the C library allocator as shown " +"in the previous example, the allocated memory for the I/O buffer completely " +"escapes the Python memory manager." +msgstr "" +"با این حال، در بیشتر موارد توصیه می‌شود حافظه از هیپ پایتون تخصیص داده شود، " +"دقیقاً به این دلیل که دومی تحت کنترل مدیر حافظه پایتون است. برای مثال، این " +"کار زمانی لازم است که مفسر با نوع‌های جدید شیء نوشته‌شده به زبان C توسعه " +"یابد. دلیل دیگر استفاده از هیپ پایتون، تمایل به *آگاه‌سازی* مدیر حافظه " +"پایتون از نیازهای حافظه‌ای ماژول توسعه‌ای است. حتی وقتی حافظه درخواست‌شده " +"صرفاً برای مقاصد داخلی و بسیار خاص استفاده می‌شود، واگذاری تمام درخواست‌های " +"حافظه به مدیر حافظه پایتون باعث می‌شود مفسر تصویری دقیق‌تر از ردپای کلی " +"حافظه خود داشته باشد. در نتیجه، در شرایط خاص، مدیر حافظه پایتون ممکن است " +"کنش‌های مناسب مانند زباله‌روبی، فشرده‌سازی حافظه یا سایر رویه‌های پیشگیرانه " +"را فعال کند یا نکند. توجه داشته باشید که با استفاده از تخصیص‌دهنده کتابخانه " +"C، همان‌طور که در مثال قبلی نشان داده شد، حافظه تخصیص‌یافته برای بافر " +"ورودی/خروجی کاملاً از دسترس مدیر حافظه پایتون خارج می‌شود." -msgid "The :envvar:`PYTHONMALLOC` environment variable can be used to configure the memory allocators used by Python." +msgid "" +"The :envvar:`PYTHONMALLOC` environment variable can be used to configure the" +" memory allocators used by Python." msgstr "" +"متغیر محیطی :envvar:`PYTHONMALLOC` می‌تواند برای پیکربندی تخصیص‌دهنده‌های " +"حافظه‌ای که پایتون به کار می‌گیرد، استفاده شود." -msgid "The :envvar:`PYTHONMALLOCSTATS` environment variable can be used to print statistics of the :ref:`pymalloc memory allocator ` every time a new pymalloc object arena is created, and on shutdown." +msgid "" +"The :envvar:`PYTHONMALLOCSTATS` environment variable can be used to print " +"statistics of the :ref:`pymalloc memory allocator ` every time a " +"new pymalloc object arena is created, and on shutdown." msgstr "" +"متغیر محیطی :envvar:`PYTHONMALLOCSTATS` می‌تواند هر بار که یک آرنا (arena) " +"جدید برای اشیاء pymalloc ایجاد می‌شود و هنگام خاموش شدن، آمار " +":ref:`تخصیص‌دهنده حافظه pymalloc ` را چاپ کند." msgid "Allocator Domains" -msgstr "" +msgstr "دامنه‌های تخصیص‌دهنده" -msgid "All allocating functions belong to one of three different \"domains\" (see also :c:type:`PyMemAllocatorDomain`). These domains represent different allocation strategies and are optimized for different purposes. The specific details on how every domain allocates memory or what internal functions each domain calls is considered an implementation detail, but for debugging purposes a simplified table can be found at :ref:`default-memory-allocators`. The APIs used to allocate and free a block of memory must be from the same domain. For example, :c:func:`PyMem_Free` must be used to free memory allocated using :c:func:`PyMem_Malloc`." -msgstr "" +msgid "" +"All allocating functions belong to one of three different \"domains\" (see " +"also :c:type:`PyMemAllocatorDomain`). These domains represent different " +"allocation strategies and are optimized for different purposes. The specific" +" details on how every domain allocates memory or what internal functions " +"each domain calls is considered an implementation detail, but for debugging " +"purposes a simplified table can be found at :ref:`default-memory-" +"allocators`. The APIs used to allocate and free a block of memory must be " +"from the same domain. For example, :c:func:`PyMem_Free` must be used to free" +" memory allocated using :c:func:`PyMem_Malloc`." +msgstr "" +"تمام توابع تخصیص‌دهنده به یکی از سه «قلمرو» (domain) متفاوت تعلق دارند " +"(همچنین :c:type:`PyMemAllocatorDomain` را ببینید). این قلمروها نماینده‌ی " +"راهبردهای تخصیص متفاوت هستند و برای اهداف مختلف بهینه شده‌اند. جزئیات دقیق " +"اینکه هر قلمرو چگونه حافظه را تخصیص می‌دهد یا هر قلمرو چه توابع داخلی را " +"فراخوانی می‌کند، از جزئیات پیاده‌سازی به شمار می‌آید، اما برای اهداف " +"اشکال‌زدایی می‌توان یک جدول ساده‌شده را در :ref:`default-memory-allocators` " +"یافت. APIهایی که برای تخصیص و آزاد کردن یک بلوک حافظه استفاده می‌شوند، باید " +"از یک قلمرو واحد باشند. به‌عنوان مثال، برای آزاد کردن حافظه‌ای که با " +":c:func:`PyMem_Malloc` تخصیص داده شده است، باید از :c:func:`PyMem_Free` " +"استفاده کرد." msgid "The three allocation domains are:" -msgstr "" +msgstr "سه دامنه‌ی تخصیص عبارت‌اند از:" -msgid "Raw domain: intended for allocating memory for general-purpose memory buffers where the allocation *must* go to the system allocator or where the allocator can operate without an :term:`attached thread state`. The memory is requested directly from the system. See :ref:`Raw Memory Interface `." +msgid "" +"Raw domain: intended for allocating memory for general-purpose memory " +"buffers where the allocation *must* go to the system allocator or where the " +"allocator can operate without an :term:`attached thread state`. The memory " +"is requested directly from the system. See :ref:`Raw Memory Interface `." msgstr "" +"دامنه خام: برای تخصیص حافظه به بافرهای حافظه‌ی همه‌منظوره در مواردی در نظر " +"گرفته شده است که تخصیص *باید* به تخصیص‌دهنده‌ی سیستم برود یا تخصیص‌دهنده " +"بتواند بدون :term:`attached thread state` کار کند. حافظه مستقیماً از سیستم " +"درخواست می‌شود. به :ref:`رابط حافظه خام ` مراجعه کنید." -msgid "\"Mem\" domain: intended for allocating memory for Python buffers and general-purpose memory buffers where the allocation must be performed with an :term:`attached thread state`. The memory is taken from the Python private heap. See :ref:`Memory Interface `." +msgid "" +"\"Mem\" domain: intended for allocating memory for Python buffers and " +"general-purpose memory buffers where the allocation must be performed with " +"an :term:`attached thread state`. The memory is taken from the Python " +"private heap. See :ref:`Memory Interface `." msgstr "" +"دامنه‌ی \"Mem\": برای تخصیص حافظه به بافرهای پایتون و بافرهای حافظه‌ی " +"همه‌منظوره در مواردی که تخصیص باید با :term:`attached thread state` انجام " +"شود، در نظر گرفته شده است. حافظه از هیپ خصوصی پایتون گرفته می‌شود. به " +":ref:`رابط حافظه ` مراجعه کنید." -msgid "Object domain: intended for allocating memory for Python objects. The memory is taken from the Python private heap. See :ref:`Object allocators `." +msgid "" +"Object domain: intended for allocating memory for Python objects. The memory" +" is taken from the Python private heap. See :ref:`Object allocators " +"`." msgstr "" +"دامنه‌ی شیء: برای تخصیص حافظه به اشیای پایتون در نظر گرفته شده است. این " +"حافظه از هیپ خصوصی پایتون گرفته می‌شود. به :ref:`تخصیص‌دهنده‌های شیء " +"` مراجعه کنید." -msgid "The :term:`free-threaded ` build requires that only Python objects are allocated using the \"object\" domain and that all Python objects are allocated using that domain. This differs from the prior Python versions, where this was only a best practice and not a hard requirement." +msgid "" +"The :term:`free-threaded ` build requires that only Python " +"objects are allocated using the \"object\" domain and that all Python " +"objects are allocated using that domain. This differs from the prior Python " +"versions, where this was only a best practice and not a hard requirement." msgstr "" +"بیلد :term:`نخ‌آزاد ` ایجاب می‌کند که تنها اشیاء پایتون با " +"استفاده از دامنه‌ی \"object\" تخصیص داده شوند و اینکه همه‌ی اشیاء پایتون با " +"استفاده از آن دامنه تخصیص داده شوند. این با نسخه‌های پیشین پایتون متفاوت " +"است، که در آن‌ها این امر تنها یک بهترین شیوه بود و نه یک الزام قطعی." -msgid "For example, buffers (non-Python objects) should be allocated using :c:func:`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but not :c:func:`PyObject_Malloc`." +msgid "" +"For example, buffers (non-Python objects) should be allocated using " +":c:func:`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but " +"not :c:func:`PyObject_Malloc`." msgstr "" +"برای مثال، بافرها (اشیاء غیرپایتونی) باید با استفاده از " +":c:func:`PyMem_Malloc`، :c:func:`PyMem_RawMalloc` یا :c:func:`malloc` تخصیص " +"داده شوند، اما نه با :c:func:`PyObject_Malloc`." msgid "See :ref:`Memory Allocation APIs `." msgstr "" +"به :ref:`API‌های تخصیص حافظه ` مراجعه کنید." msgid "Raw Memory Interface" -msgstr "" +msgstr "رابط حافظه خام" -msgid "The following function sets are wrappers to the system allocator. These functions are thread-safe, so a :term:`thread state` does not need to be :term:`attached `." +msgid "" +"The following function sets are wrappers to the system allocator. These " +"functions are thread-safe, so a :term:`thread state` does not need to be " +":term:`attached `." msgstr "" +"مجموعه‌های تابع زیر دربرگیرنده‌ی تخصیص‌دهنده‌ی سیستم هستند. این توابع " +"نخ‌ایمن هستند، بنابراین :term:`وضعیت نخ ` نیازی ندارد که " +":term:`متصل ` باشد." -msgid "The :ref:`default raw memory allocator ` uses the following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`!free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when requesting zero bytes." +msgid "" +"The :ref:`default raw memory allocator ` uses the" +" following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " +"and :c:func:`!free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when " +"requesting zero bytes." msgstr "" +":ref:`تخصیص‌دهنده‌ی حافظه‌ی خام پیش‌فرض ` از " +"توابع زیر استفاده می‌کند: :c:func:`malloc`، :c:func:`calloc`، " +":c:func:`realloc` و :c:func:`!free`؛ هنگام درخواست صفر بایت، ``malloc(1)`` " +"(یا ``calloc(1, 1)``) فراخوانی می‌شود." -msgid "Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request fails." +msgid "" +"Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " +"allocated memory, or ``NULL`` if the request fails." msgstr "" +"*n* بایت تخصیص می‌دهد و اشاره‌گری از نوع :c:expr:`void*` به حافظه‌ی " +"تخصیص‌یافته برمی‌گرداند، یا اگر درخواست شکست بخورد، ``NULL``." -msgid "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not have been initialized in any way." +msgid "" +"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " +"as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not " +"have been initialized in any way." msgstr "" +"درخواست صفر بایت در صورت امکان یک اشاره‌گر متمایز غیر ``NULL`` برمی‌گرداند، " +"گویی به جای آن ``PyMem_RawMalloc(1)`` فراخوانی شده است. حافظه به هیچ شکلی " +"مقداردهی اولیه نخواهد شد." -msgid "Allocates *nelem* elements each of size *elsize* bytes and returns a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request fails. The memory is initialized to zeros." +msgid "" +"Allocates *nelem* elements each of size *elsize* bytes and returns a pointer" +" of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request" +" fails. The memory is initialized to zeros." msgstr "" +"*nelem* عنصر که هر یک به اندازه‌ی *elsize* بایت است تخصیص می‌دهد و اشاره‌گری" +" از نوع :c:expr:`void*` به حافظه‌ی تخصیص‌یافته برمی‌گرداند، یا در صورتی که " +"درخواست شکست بخورد، ``NULL`` برمی‌گرداند. حافظه با صفر مقداردهی اولیه " +"می‌شود." -msgid "Requesting zero elements or elements of size zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been called instead." +msgid "" +"Requesting zero elements or elements of size zero bytes returns a distinct " +"non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been " +"called instead." msgstr "" +"درخواست صفر المان یا المان‌هایی با اندازه‌ی صفر بایت، در صورت امکان یک " +"اشاره‌گر متمایز غیر ``NULL`` برمی‌گرداند؛ گویی به جای آن " +"``PyMem_RawCalloc(1, 1)`` فراخوانی شده است." -msgid "Resizes the memory block pointed to by *p* to *n* bytes. The contents will be unchanged to the minimum of the old and the new sizes." +msgid "" +"Resizes the memory block pointed to by *p* to *n* bytes. The contents will " +"be unchanged to the minimum of the old and the new sizes." msgstr "" +"اندازه بلوک حافظه‌ای را که *p* به آن اشاره می‌کند به *n* بایت تغییر می‌دهد. " +"محتویات تا کمینه‌ی اندازه‌های قدیمی و جدید بدون تغییر باقی می‌مانند." -msgid "If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else if *n* is equal to zero, the memory block is resized but is not freed, and the returned pointer is non-``NULL``." +msgid "" +"If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else " +"if *n* is equal to zero, the memory block is resized but is not freed, and " +"the returned pointer is non-``NULL``." msgstr "" +"اگر *p* برابر ``NULL`` باشد، این فراخوانی معادل ``PyMem_RawMalloc(n)`` است؛ " +"در غیر این صورت، اگر *n* برابر صفر باشد، بلوک حافظه تغییر اندازه می‌یابد اما" +" آزاد نمی‌شود، و اشاره‌گر برگردانده‌شده غیر ``NULL`` است." -msgid "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:`PyMem_RawCalloc`." +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to " +":c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or " +":c:func:`PyMem_RawCalloc`." msgstr "" +"مگر آنکه *p* برابر ``NULL`` باشد، باید توسط فراخوانی قبلیِ " +":c:func:`PyMem_RawMalloc`، :c:func:`PyMem_RawRealloc` یا " +":c:func:`PyMem_RawCalloc` بازگردانده شده باشد." -msgid "If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* remains a valid pointer to the previous memory area." +msgid "" +"If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." msgstr "" +"اگر درخواست شکست بخورد، :c:func:`PyMem_RawRealloc` مقدار ``NULL`` را " +"برمی‌گرداند و *p* همچنان اشاره‌گر معتبری به ناحیه حافظه قبلی باقی می‌ماند." -msgid "Frees the memory block pointed to by *p*, which must have been returned by a previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has been called before, undefined behavior occurs." +msgid "" +"Frees the memory block pointed to by *p*, which must have been returned by a" +" previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or " +":c:func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has been " +"called before, undefined behavior occurs." msgstr "" +"بلوک حافظه‌ای را که *p* به آن اشاره می‌کند آزاد می‌کند، که باید قبلاً توسط " +"فراخوانی :c:func:`PyMem_RawMalloc`، :c:func:`PyMem_RawRealloc` یا " +":c:func:`PyMem_RawCalloc` بازگردانده شده باشد. در غیر این صورت، یا اگر " +"``PyMem_RawFree(p)`` قبلاً فراخوانی شده باشد، رفتار تعریف‌نشده رخ می‌دهد." msgid "If *p* is ``NULL``, no operation is performed." -msgstr "" +msgstr "اگر *p* برابر ``NULL`` باشد، هیچ عملیاتی انجام نمی‌شود." msgid "Memory Interface" -msgstr "" +msgstr "رابط حافظه" -msgid "The following function sets, modeled after the ANSI C standard, but specifying behavior when requesting zero bytes, are available for allocating and releasing memory from the Python heap." +msgid "" +"The following function sets, modeled after the ANSI C standard, but " +"specifying behavior when requesting zero bytes, are available for allocating" +" and releasing memory from the Python heap." msgstr "" +"مجموعه‌های تابع زیر، که بر اساس استاندارد ANSI C الگوبرداری شده‌اند، اما " +"رفتار هنگام درخواست صفر بایت را مشخص می‌کنند، برای تخصیص و آزادسازی حافظه از" +" هیپ پایتون در دسترس هستند." -msgid "In the GIL-enabled build (default build) the :ref:`default memory allocator ` uses the :ref:`pymalloc memory allocator `, whereas in the :term:`free-threaded build`, the default is the :ref:`mimalloc memory allocator ` instead." +msgid "" +"In the GIL-enabled build (default build) the :ref:`default memory allocator " +"` uses the :ref:`pymalloc memory allocator " +"`, whereas in the :term:`free-threaded build`, the default is the " +":ref:`mimalloc memory allocator ` instead." msgstr "" +"در بیلد دارای قفل مفسر سراسری (بیلد پیش‌فرض)، :ref:`تخصیص‌دهنده‌ی حافظه‌ی " +"پیش‌فرض ` از :ref:`تخصیص‌دهنده‌ی حافظه‌ی pymalloc" +" ` استفاده می‌کند، در حالی که در :term:`free-threaded build`، " +"پیش‌فرض :ref:`تخصیص‌دهنده‌ی حافظه‌ی mimalloc ` است." -msgid "There must be an :term:`attached thread state` when using these functions." +msgid "" +"There must be an :term:`attached thread state` when using these functions." msgstr "" +"هنگام استفاده از این توابع، باید یک :term:`وضعیت نخ متصل ` وجود داشته باشد." -msgid "The default allocator is now pymalloc instead of system :c:func:`malloc`." +msgid "" +"The default allocator is now pymalloc instead of system :c:func:`malloc`." msgstr "" +"تخصیص‌دهنده پیش‌فرض اکنون pymalloc است، به‌جای :c:func:`malloc` سیستمی." -msgid "In the :term:`free-threaded ` build, the default allocator is now :ref:`mimalloc `." +msgid "" +"In the :term:`free-threaded ` build, the default allocator " +"is now :ref:`mimalloc `." msgstr "" +"در بیلد :term:`نخ‌آزاد `، تخصیص‌دهنده‌ی پیش‌فرض اکنون " +":ref:`mimalloc ` است." -msgid "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have been initialized in any way." +msgid "" +"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " +"as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have " +"been initialized in any way." msgstr "" +"درخواست صفر بایت در صورت امکان یک اشاره‌گر متمایز و غیر ``NULL`` " +"برمی‌گرداند، گویی که به‌جای آن ``PyMem_Malloc(1)`` فراخوانی شده است. این " +"حافظه به هیچ شکلی مقداردهی اولیه نشده خواهد بود." -msgid "Requesting zero elements or elements of size zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been called instead." +msgid "" +"Requesting zero elements or elements of size zero bytes returns a distinct " +"non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been " +"called instead." msgstr "" +"درخواست صفر المان یا المان‌هایی با اندازه‌ی صفر بایت، در صورت امکان یک " +"اشاره‌گر متمایز غیر ``NULL`` برمی‌گرداند، گویی به‌جای آن ``PyMem_Calloc(1, " +"1)`` فراخوانی شده بود." -msgid "If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if *n* is equal to zero, the memory block is resized but is not freed, and the returned pointer is non-``NULL``." +msgid "" +"If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if " +"*n* is equal to zero, the memory block is resized but is not freed, and the " +"returned pointer is non-``NULL``." msgstr "" +"اگر *p* برابر ``NULL`` باشد، این فراخوانی معادل ``PyMem_Malloc(n)`` است؛ در " +"غیر این صورت، اگر *n* برابر صفر باشد، بلوک حافظه تغییر اندازه می‌یابد اما " +"آزاد نمی‌شود و اشاره‌گر بازگردانده‌شده غیر ``NULL`` است." -msgid "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to " +":c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." msgstr "" +"مگر اینکه *p* برابر ``NULL`` باشد، این مقدار باید توسط یک فراخوانی قبلی به " +":c:func:`PyMem_Malloc`، :c:func:`PyMem_Realloc` یا :c:func:`PyMem_Calloc` " +"بازگردانده شده باشد." -msgid "If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* remains a valid pointer to the previous memory area." +msgid "" +"If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." msgstr "" +"اگر درخواست ناموفق باشد، :c:func:`PyMem_Realloc` مقدار ``NULL`` را " +"برمی‌گرداند و *p* همچنان اشاره‌گر معتبری به ناحیه‌ی حافظه قبلی باقی می‌ماند." -msgid "Frees the memory block pointed to by *p*, which must have been returned by a previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been called before, undefined behavior occurs." +msgid "" +"Frees the memory block pointed to by *p*, which must have been returned by a" +" previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or " +":c:func:`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been called " +"before, undefined behavior occurs." msgstr "" +"بلوک حافظه‌ای را که *p* به آن اشاره می‌کند آزاد می‌کند؛ این بلوک باید قبلاً " +"توسط فراخوانی :c:func:`PyMem_Malloc`، :c:func:`PyMem_Realloc` یا " +":c:func:`PyMem_Calloc` بازگردانده شده باشد. در غیر این صورت، یا اگر " +"``PyMem_Free(p)`` پیش‌تر فراخوانی شده باشد، رفتار تعریف‌نشده رخ می‌دهد." -msgid "The following type-oriented macros are provided for convenience. Note that *TYPE* refers to any C type." +msgid "" +"The following type-oriented macros are provided for convenience. Note that" +" *TYPE* refers to any C type." msgstr "" +"ماکروهای نوع‌محور زیر برای سهولت فراهم شده‌اند. توجه داشته باشید که *TYPE* " +"به هر نوع C اشاره می‌کند." -msgid "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of memory. Returns a pointer cast to ``TYPE*``. The memory will not have been initialized in any way." +msgid "" +"Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " +"of memory. Returns a pointer cast to ``TYPE*``. The memory will not have " +"been initialized in any way." msgstr "" +"مانند :c:func:`PyMem_Malloc` است، اما ``(n * sizeof(TYPE))`` بایت حافظه " +"تخصیص می‌دهد. اشاره‌گری قالب‌ریزی‌شده به ``TYPE*`` برمی‌گرداند. حافظه به هیچ" +" شکلی مقداردهی اولیه نشده است." -msgid "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* will be a pointer to the new memory area, or ``NULL`` in the event of failure." +msgid "" +"Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " +"sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " +"will be a pointer to the new memory area, or ``NULL`` in the event of " +"failure." msgstr "" +"مانند :c:func:`PyMem_Realloc` است، اما بلوک حافظه به ``(n * sizeof(TYPE))`` " +"بایت تغییر اندازه می‌یابد. اشاره‌گری قالب‌ریزی‌شده به ``TYPE*`` را " +"برمی‌گرداند. هنگام بازگشت، *p* اشاره‌گری به ناحیه حافظه جدید خواهد بود، یا " +"در صورت شکست ``NULL``." -msgid "This is a C preprocessor macro; *p* is always reassigned. Save the original value of *p* to avoid losing memory when handling errors." +msgid "" +"This is a C preprocessor macro; *p* is always reassigned. Save the original" +" value of *p* to avoid losing memory when handling errors." msgstr "" +"این یک ماکروی پیش‌پردازنده C است؛ *p* همیشه دوباره انتساب می‌شود. مقدار اصلی" +" *p* را ذخیره کنید تا هنگام مدیریت خطاها حافظه از دست نرود." msgid "Same as :c:func:`PyMem_Free`." -msgstr "" +msgstr "مانند :c:func:`PyMem_Free` است." msgid "Deprecated aliases" -msgstr "" +msgstr "نام‌های مستعار منسوخ" -msgid "These are :term:`soft deprecated` aliases to existing functions and macros. They exist solely for backwards compatibility." +msgid "" +"These are :term:`soft deprecated` aliases to existing functions and macros. " +"They exist solely for backwards compatibility." msgstr "" +"این‌ها نام‌های مستعار :term:`منسوخ نرم ` برای توابع و " +"ماکروهای موجود هستند. این نام‌های مستعار صرفاً برای سازگاری با نسخه‌های " +"پیشین وجود دارند." msgid "Deprecated alias" -msgstr "" +msgstr "نام مستعار منسوخ" msgid "Corresponding function or macro" -msgstr "" +msgstr "تابع یا ماکروی متناظر" msgid ":c:func:`PyMem_Malloc`" -msgstr "" +msgstr ":c:func:`PyMem_Malloc`" msgid ":c:macro:`PyMem_New`" -msgstr "" +msgstr ":c:macro:`PyMem_New`" msgid ":c:func:`PyMem_Realloc`" -msgstr "" +msgstr ":c:func:`PyMem_Realloc`" msgid ":c:macro:`PyMem_Resize`" -msgstr "" +msgstr ":c:macro:`PyMem_Resize`" msgid ":c:func:`PyMem_Free`" -msgstr "" +msgstr ":c:func:`PyMem_Free`" -msgid "The macros are now aliases of the corresponding functions and macros. Previously, their behavior was the same, but their use did not necessarily preserve binary compatibility across Python versions." +msgid "" +"The macros are now aliases of the corresponding functions and macros. " +"Previously, their behavior was the same, but their use did not necessarily " +"preserve binary compatibility across Python versions." msgstr "" +"این ماکروها اکنون نام‌مستعار توابع و ماکروهای متناظر هستند. پیش‌تر، رفتار " +"آن‌ها یکسان بود، اما استفاده از آن‌ها لزوماً سازگاری دودویی را بین نسخه‌های " +"پایتون حفظ نمی‌کرد." msgid "Object allocators" -msgstr "" +msgstr "تخصیص‌دهنده‌های شیء" -msgid "There is no guarantee that the memory returned by these allocators can be successfully cast to a Python object when intercepting the allocating functions in this domain by the methods described in the :ref:`Customize Memory Allocators ` section." +msgid "" +"There is no guarantee that the memory returned by these allocators can be " +"successfully cast to a Python object when intercepting the allocating " +"functions in this domain by the methods described in the :ref:`Customize " +"Memory Allocators ` section." msgstr "" +"هنگام رهگیری توابع تخصیص‌دهنده در این دامنه با استفاده از روش‌های توضیح " +"داده‌شده در بخش :ref:`سفارشی‌سازی تخصیص‌دهنده‌های حافظه `، هیچ تضمینی وجود ندارد که حافظه‌ی بازگردانده‌شده توسط این " +"تخصیص‌دهنده‌ها بتواند با موفقیت به یک شیء پایتون قالب‌ریزی شود." -msgid "The :ref:`default object allocator ` uses the :ref:`pymalloc memory allocator `. In the :term:`free-threaded ` build, the default is the :ref:`mimalloc memory allocator ` instead." +msgid "" +"The :ref:`default object allocator ` uses the " +":ref:`pymalloc memory allocator `. In the :term:`free-threaded " +"` build, the default is the :ref:`mimalloc memory allocator " +"` instead." msgstr "" +":ref:`تخصیص‌دهنده پیش‌فرض اشیاء ` از " +":ref:`تخصیص‌دهنده حافظه pymalloc ` استفاده می‌کند. در نسخه‌ی " +":term:`نخ‌آزاد `، پیش‌فرض به‌جای آن :ref:`تخصیص‌دهنده حافظه " +"mimalloc ` است." -msgid "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyObject_Malloc(1)`` had been called instead. The memory will not have been initialized in any way." +msgid "" +"Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " +"as if ``PyObject_Malloc(1)`` had been called instead. The memory will not " +"have been initialized in any way." msgstr "" +"درخواست صفر بایت در صورت امکان یک اشاره‌گر متمایز غیر ``NULL`` بازمی‌گرداند،" +" گویی که به جای آن ``PyObject_Malloc(1)`` فراخوانی شده است. حافظه به هیچ " +"شکلی مقداردهی اولیه نخواهد شد." -msgid "Requesting zero elements or elements of size zero bytes returns a distinct non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been called instead." +msgid "" +"Requesting zero elements or elements of size zero bytes returns a distinct " +"non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been " +"called instead." msgstr "" +"درخواست صفر عنصر یا عناصری با اندازه‌ی صفر بایت، در صورت امکان، یک اشاره‌گر " +"متمایز غیر ``NULL`` برمی‌گرداند، گویی که به جای آن ``PyObject_Calloc(1, 1)``" +" فراخوانی شده باشد." -msgid "If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else if *n* is equal to zero, the memory block is resized but is not freed, and the returned pointer is non-``NULL``." +msgid "" +"If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else " +"if *n* is equal to zero, the memory block is resized but is not freed, and " +"the returned pointer is non-``NULL``." msgstr "" +"اگر *p* برابر ``NULL`` باشد، این فراخوانی معادل ``PyObject_Malloc(n)`` است؛ " +"در غیر این صورت، اگر *n* برابر صفر باشد، بلوک حافظه تغییر اندازه می‌یابد اما" +" آزاد نمی‌شود و اشاره‌گر بازگردانده‌شده غیر ``NULL`` است." -msgid "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:`PyObject_Calloc`." +msgid "" +"Unless *p* is ``NULL``, it must have been returned by a previous call to " +":c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or " +":c:func:`PyObject_Calloc`." msgstr "" +"مگر اینکه *p* برابر ``NULL`` باشد، باید قبلاً توسط فراخوانی " +":c:func:`PyObject_Malloc`، :c:func:`PyObject_Realloc` یا " +":c:func:`PyObject_Calloc` برگردانده شده باشد." -msgid "If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* remains a valid pointer to the previous memory area." +msgid "" +"If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " +"remains a valid pointer to the previous memory area." msgstr "" +"اگر درخواست شکست بخورد، :c:func:`PyObject_Realloc` مقدار ``NULL`` را " +"برمی‌گرداند و *p* همچنان اشاره‌گر معتبری به ناحیه حافظه قبلی باقی می‌ماند." -msgid "Frees the memory block pointed to by *p*, which must have been returned by a previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has been called before, undefined behavior occurs." +msgid "" +"Frees the memory block pointed to by *p*, which must have been returned by a" +" previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or " +":c:func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has been " +"called before, undefined behavior occurs." msgstr "" +"بلوک حافظه‌ای را که *p* به آن اشاره می‌کند آزاد می‌کند، که باید توسط یک " +"فراخوانی قبلی به :c:func:`PyObject_Malloc`، :c:func:`PyObject_Realloc` یا " +":c:func:`PyObject_Calloc` برگردانده شده باشد. در غیر این صورت، یا اگر " +"``PyObject_Free(p)`` پیش‌تر فراخوانی شده باشد، رفتار تعریف‌نشده رخ می‌دهد." -msgid "Do not call this directly to free an object's memory; call the type's :c:member:`~PyTypeObject.tp_free` slot instead." +msgid "" +"Do not call this directly to free an object's memory; call the type's " +":c:member:`~PyTypeObject.tp_free` slot instead." msgstr "" +"برای آزاد کردن حافظه‌ی یک شیء، این را مستقیماً فراخوانی نکنید؛ در عوض جایگاه" +" :c:member:`~PyTypeObject.tp_free` نوع را فراخوانی کنید." -msgid "Do not use this for memory allocated by :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`; use :c:func:`PyObject_GC_Del` instead." +msgid "" +"Do not use this for memory allocated by :c:macro:`PyObject_GC_New` or " +":c:macro:`PyObject_GC_NewVar`; use :c:func:`PyObject_GC_Del` instead." msgstr "" +"از این برای حافظه‌ای که توسط :c:macro:`PyObject_GC_New` یا " +":c:macro:`PyObject_GC_NewVar` تخصیص‌یافته است استفاده نکنید؛ به جای آن از " +":c:func:`PyObject_GC_Del` استفاده کنید." -msgid ":c:func:`PyObject_GC_Del` is the equivalent of this function for memory allocated by types that support garbage collection." +msgid "" +":c:func:`PyObject_GC_Del` is the equivalent of this function for memory " +"allocated by types that support garbage collection." msgstr "" +":c:func:`PyObject_GC_Del` معادل این تابع برای حافظه‌ی تخصیص‌یافته توسط " +"نوع‌هایی است که از زباله‌روبی پشتیبانی می‌کنند." msgid ":c:func:`PyObject_Malloc`" -msgstr "" +msgstr ":c:func:`PyObject_Malloc`" msgid ":c:func:`PyObject_Realloc`" -msgstr "" +msgstr ":c:func:`PyObject_Realloc`" msgid ":c:func:`PyObject_Calloc`" -msgstr "" +msgstr ":c:func:`PyObject_Calloc`" msgid ":c:macro:`PyObject_New`" -msgstr "" +msgstr ":c:macro:`PyObject_New`" msgid ":c:macro:`PyObject_NewVar`" -msgstr "" +msgstr ":c:macro:`PyObject_NewVar`" msgid ":c:func:`PyType_GenericAlloc`" -msgstr "" +msgstr ":c:func:`PyType_GenericAlloc`" msgid ":c:member:`~PyTypeObject.tp_free`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_free`" msgid "Default Memory Allocators" -msgstr "" +msgstr "تخصیص‌دهنده‌های حافظه پیش‌فرض" msgid "Default memory allocators:" -msgstr "" +msgstr "تخصیص‌دهنده‌های پیش‌فرض حافظه:" msgid "Configuration" -msgstr "" +msgstr "پیکربندی" msgid "Name" -msgstr "" +msgstr "نام" msgid "PyMem_RawMalloc" -msgstr "" +msgstr "PyMem_RawMalloc" msgid "PyMem_Malloc" -msgstr "" +msgstr "PyMem_Malloc" msgid "PyObject_Malloc" -msgstr "" +msgstr "PyObject_Malloc" msgid "Release build" -msgstr "" +msgstr "بیلد انتشار (Release build)" msgid "``\"pymalloc\"``" -msgstr "" +msgstr "``\"pymalloc\"``" msgid "``malloc``" -msgstr "" +msgstr "``malloc``" msgid "``pymalloc``" -msgstr "" +msgstr "``pymalloc``" msgid "Debug build" -msgstr "" +msgstr "نسخه‌ی اشکال‌زدایی (Debug build)" msgid "``\"pymalloc_debug\"``" -msgstr "" +msgstr "``\"pymalloc_debug\"``" msgid "``malloc`` + debug" -msgstr "" +msgstr "``malloc`` + اشکال‌زدایی" msgid "``pymalloc`` + debug" -msgstr "" +msgstr "``pymalloc`` + دیباگ" msgid "Release build, without pymalloc" -msgstr "" +msgstr "بیلد انتشار، بدون pymalloc" msgid "``\"malloc\"``" -msgstr "" +msgstr "``\"malloc\"``" msgid "Debug build, without pymalloc" -msgstr "" +msgstr "ساخت دیباگ، بدون pymalloc" msgid "``\"malloc_debug\"``" -msgstr "" +msgstr "``\"malloc_debug\"``" msgid "Free-threaded build" -msgstr "" +msgstr "بیلد نخ‌آزاد" msgid "``\"mimalloc\"``" -msgstr "" +msgstr "``\"mimalloc\"``" msgid "``mimalloc``" -msgstr "" +msgstr "``mimalloc``" msgid "Free-threaded debug build" -msgstr "" +msgstr "نسخه‌ی اشکال‌زداییِ نخ‌آزاد" msgid "``\"mimalloc_debug\"``" -msgstr "" +msgstr "``\"mimalloc_debug\"``" msgid "``mimalloc`` + debug" -msgstr "" +msgstr "``mimalloc`` + دیباگ" msgid "Legend:" -msgstr "" +msgstr "راهنما:" msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." -msgstr "" +msgstr "نام: مقدار برای متغیر محیطی :envvar:`PYTHONMALLOC`." -msgid "``malloc``: system allocators from the standard C library, C functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." +msgid "" +"``malloc``: system allocators from the standard C library, C functions: " +":c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." msgstr "" +"``malloc``: تخصیص‌دهنده‌های سیستمی از کتابخانه استاندارد C، توابع C: " +":c:func:`malloc`، :c:func:`calloc`، :c:func:`realloc` و :c:func:`free`." msgid "``pymalloc``: :ref:`pymalloc memory allocator `." -msgstr "" +msgstr "``pymalloc``: :ref:`تخصیص‌دهنده حافظه‌ی pymalloc `." msgid "``mimalloc``: :ref:`mimalloc memory allocator `." -msgstr "" +msgstr "``mimalloc``: :ref:`تخصیص‌گر حافظه mimalloc `." -msgid "\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." +msgid "" +"\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." msgstr "" +"\"+ debug\": با :ref:`قلاب‌های اشکال‌زدایی روی تخصیص‌دهنده‌های حافظه پایتون " +"`." msgid "\"Debug build\": :ref:`Python build in debug mode `." msgstr "" +"«بیلد اشکال‌زدایی»: :ref:`بیلد پایتون در حالت اشکال‌زدایی `." msgid "Customize Memory Allocators" -msgstr "" +msgstr "سفارشی‌سازی تخصیص‌دهنده‌های حافظه" -msgid "Structure used to describe a memory block allocator. The structure has the following fields:" +msgid "" +"Structure used to describe a memory block allocator. The structure has the " +"following fields:" msgstr "" +"ساختاری که برای توصیف یک تخصیص‌دهنده بلوک حافظه استفاده می‌شود. این ساختار " +"فیلدهای زیر را دارد:" msgid "Field" -msgstr "" +msgstr "فیلد" msgid "Meaning" -msgstr "" +msgstr "معنا" msgid "``void *ctx``" -msgstr "" +msgstr "``void *ctx``" msgid "user context passed as first argument" -msgstr "" +msgstr "زمینه کاربر که به‌عنوان آرگومان اول ارسال می‌شود" msgid "``void* malloc(void *ctx, size_t size)``" -msgstr "" +msgstr "``void* malloc(void *ctx, size_t size)``" msgid "allocate a memory block" -msgstr "" +msgstr "تخصیص دادن یک بلوک حافظه" msgid "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" -msgstr "" +msgstr "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" msgid "allocate a memory block initialized with zeros" -msgstr "" +msgstr "تخصیص دادن یک بلوک حافظه مقداردهی اولیه‌شده با صفر" msgid "``void* realloc(void *ctx, void *ptr, size_t new_size)``" -msgstr "" +msgstr "``void* realloc(void *ctx, void *ptr, size_t new_size)``" msgid "allocate or resize a memory block" -msgstr "" +msgstr "تخصیص دادن یا تغییر اندازه دادن یک بلوک حافظه" msgid "``void free(void *ctx, void *ptr)``" -msgstr "" +msgstr "``void free(void *ctx, void *ptr)``" msgid "free a memory block" -msgstr "" +msgstr "آزاد کردن یک بلوک حافظه" -msgid "The :c:type:`!PyMemAllocator` structure was renamed to :c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added." +msgid "" +"The :c:type:`!PyMemAllocator` structure was renamed to " +":c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" +"ساختار :c:type:`!PyMemAllocator` به :c:type:`PyMemAllocatorEx` تغییر نام " +"یافت و یک فیلد جدید ``calloc`` افزوده شد." msgid "Enum used to identify an allocator domain. Domains:" -msgstr "" +msgstr "enum برای شناسایی دامنه‌ی تخصیص‌دهنده استفاده می‌شود. دامنه‌ها:" msgid "Functions:" -msgstr "" +msgstr "توابع:" msgid ":c:func:`PyMem_RawMalloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawMalloc`" msgid ":c:func:`PyMem_RawRealloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawRealloc`" msgid ":c:func:`PyMem_RawCalloc`" -msgstr "" +msgstr ":c:func:`PyMem_RawCalloc`" msgid ":c:func:`PyMem_RawFree`" -msgstr "" +msgstr ":c:func:`PyMem_RawFree`" msgid ":c:func:`PyMem_Malloc`," -msgstr "" +msgstr ":c:func:`PyMem_Malloc`," msgid ":c:func:`PyMem_Calloc`" -msgstr "" +msgstr ":c:func:`PyMem_Calloc`" msgid ":c:func:`PyObject_Free`" -msgstr "" +msgstr ":c:func:`PyObject_Free`" msgid "Get the memory block allocator of the specified domain." -msgstr "" +msgstr "گرفتن تخصیص‌دهنده بلوک حافظه از دامنه‌ی مشخص‌شده." msgid "Set the memory block allocator of the specified domain." -msgstr "" +msgstr "تخصیص‌دهنده بلوک حافظه‌ی دامنه‌ی مشخص‌شده را تنظیم می‌کند." -msgid "The new allocator must return a distinct non-``NULL`` pointer when requesting zero bytes." +msgid "" +"The new allocator must return a distinct non-``NULL`` pointer when " +"requesting zero bytes." msgstr "" +"تخصیص‌دهنده جدید باید هنگام درخواست صفر بایت، یک اشاره‌گر متمایز غیر " +"``NULL`` بازگرداند." -msgid "For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-safe: a :term:`thread state` is not :term:`attached ` when the allocator is called." +msgid "" +"For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" +"safe: a :term:`thread state` is not :term:`attached `" +" when the allocator is called." msgstr "" +"برای دامنه‌ی :c:macro:`PYMEM_DOMAIN_RAW`، تخصیص‌دهنده باید نخ‌ایمن باشد: " +"هنگامی که تخصیص‌دهنده فراخوانی می‌شود، یک :term:`thread state` :term:`متصل " +"` نیست." -msgid "For the remaining domains, the allocator must also be thread-safe: the allocator may be called in different interpreters that do not share a :term:`GIL`." +msgid "" +"For the remaining domains, the allocator must also be thread-safe: the " +"allocator may be called in different interpreters that do not share a " +":term:`GIL`." msgstr "" +"برای دامنه‌های باقی‌مانده، تخصیص‌دهنده باید نخ‌ایمن نیز باشد: تخصیص‌دهنده " +"ممکن است در مفسر‌های مختلفی فراخوانی شود که یک :term:`GIL` را به اشتراک " +"نمی‌گذارند." -msgid "If the new allocator is not a hook (does not call the previous allocator), the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the debug hooks on top on the new allocator." +msgid "" +"If the new allocator is not a hook (does not call the previous allocator), " +"the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the" +" debug hooks on top on the new allocator." msgstr "" +"اگر تخصیص‌دهنده جدید یک قلاب نباشد (تخصیص‌دهنده قبلی را فراخوانی نکند)، باید" +" تابع :c:func:`PyMem_SetupDebugHooks` فراخوانی شود تا قلاب‌های اشکال‌زدایی " +"مجدداً بر روی تخصیص‌دهنده جدید نصب شوند." -msgid "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python with PyPreConfig `." +msgid "" +"See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " +"with PyPreConfig `." msgstr "" +"همچنین ببینید :c:member:`PyPreConfig.allocator` و :ref:`پیش‌راه‌اندازی " +"پایتون با PyPreConfig `." msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" -msgstr "" +msgstr ":c:func:`PyMem_SetAllocator` قرارداد زیر را دارد:" -msgid "It can be called after :c:func:`Py_PreInitialize` and before :c:func:`Py_InitializeFromConfig` to install a custom memory allocator. There are no restrictions over the installed allocator other than the ones imposed by the domain (for instance, the Raw Domain allows the allocator to be called without an :term:`attached thread state`). See :ref:`the section on allocator domains ` for more information." -msgstr "" +msgid "" +"It can be called after :c:func:`Py_PreInitialize` and before " +":c:func:`Py_InitializeFromConfig` to install a custom memory allocator. " +"There are no restrictions over the installed allocator other than the ones " +"imposed by the domain (for instance, the Raw Domain allows the allocator to " +"be called without an :term:`attached thread state`). See :ref:`the section " +"on allocator domains ` for more information." +msgstr "" +"برای نصب یک تخصیص‌دهنده حافظه سفارشی، می‌توان آن را پس از " +":c:func:`Py_PreInitialize` و پیش از :c:func:`Py_InitializeFromConfig` " +"فراخوانی کرد. هیچ محدودیتی بر تخصیص‌دهنده‌ی نصب‌شده وجود ندارد، جز " +"محدودیت‌هایی که توسط دامنه اعمال می‌شوند (برای نمونه، دامنه خام اجازه می‌دهد" +" که تخصیص‌دهنده بدون :term:`attached thread state` فراخوانی شود). برای " +"اطلاعات بیشتر به :ref:`بخش دامنه‌های تخصیص‌دهنده ` مراجعه" +" کنید." -msgid "If called after Python has finish initializing (after :c:func:`Py_InitializeFromConfig` has been called) the allocator **must** wrap the existing allocator. Substituting the current allocator for some other arbitrary one is **not supported**." +msgid "" +"If called after Python has finish initializing (after " +":c:func:`Py_InitializeFromConfig` has been called) the allocator **must** " +"wrap the existing allocator. Substituting the current allocator for some " +"other arbitrary one is **not supported**." msgstr "" +"اگر پس از پایان مقداردهی اولیه پایتون (پس از فراخوانی " +":c:func:`Py_InitializeFromConfig`) فراخوانی شود، تخصیص‌دهنده (allocator) " +"**باید** تخصیص‌دهنده موجود را دربرگیرد. جایگزین کردن تخصیص‌دهنده فعلی با " +"تخصیص‌دهنده دلخواه دیگری **پشتیبانی نمی‌شود**." msgid "All allocators must be thread-safe." -msgstr "" +msgstr "همه‌ی تخصیص‌دهنده‌ها (allocator) باید نخ‌ایمن باشند." -msgid "Setup :ref:`debug hooks in the Python memory allocators ` to detect memory errors." +msgid "" +"Setup :ref:`debug hooks in the Python memory allocators `" +" to detect memory errors." msgstr "" +"راه‌اندازی :ref:`قلاب‌های اشکال‌زدایی در تخصیص‌دهنده‌های حافظه پایتون " +"` برای تشخیص خطاهای حافظه." msgid "Debug hooks on the Python memory allocators" -msgstr "" +msgstr "قلاب‌های اشکال‌زدایی روی تخصیص‌دهنده‌های حافظه پایتون" -msgid "When :ref:`Python is built in debug mode `, the :c:func:`PyMem_SetupDebugHooks` function is called at the :ref:`Python preinitialization ` to setup debug hooks on Python memory allocators to detect memory errors." +msgid "" +"When :ref:`Python is built in debug mode `, the " +":c:func:`PyMem_SetupDebugHooks` function is called at the :ref:`Python " +"preinitialization ` to setup debug hooks on Python memory " +"allocators to detect memory errors." msgstr "" +"هنگامی که :ref:`پایتون در حالت اشکال‌زدایی ساخته می‌شود `، تابع" +" :c:func:`PyMem_SetupDebugHooks` در :ref:`پیش‌مقداردهی پایتون ` " +"فراخوانی می‌شود تا قلاب‌های اشکال‌زدایی را برای تشخیص خطاهای حافظه روی " +"تخصیص‌دهنده‌های حافظه پایتون برپا کند." -msgid "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." +msgid "" +"The :envvar:`PYTHONMALLOC` environment variable can be used to install debug" +" hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" +"از متغیر محیطی :envvar:`PYTHONMALLOC` می‌توان برای نصب قلاب‌های اشکال‌زدایی " +"روی پایتونی که در حالت انتشار (release) کامپایل شده است، استفاده کرد (مثال: " +"``PYTHONMALLOC=debug``)." -msgid "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks after calling :c:func:`PyMem_SetAllocator`." +msgid "" +"The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " +"after calling :c:func:`PyMem_SetAllocator`." msgstr "" +"از تابع :c:func:`PyMem_SetupDebugHooks` می‌توان برای تنظیم قلاب‌های " +"اشکال‌زدایی پس از فراخوانی :c:func:`PyMem_SetAllocator` استفاده کرد." -msgid "These debug hooks fill dynamically allocated memory blocks with special, recognizable bit patterns. Newly allocated memory is filled with the byte ``0xCD`` (``PYMEM_CLEANBYTE``), freed memory is filled with the byte ``0xDD`` (``PYMEM_DEADBYTE``). Memory blocks are surrounded by \"forbidden bytes\" filled with the byte ``0xFD`` (``PYMEM_FORBIDDENBYTE``). Strings of these bytes are unlikely to be valid addresses, floats, or ASCII strings." -msgstr "" +msgid "" +"These debug hooks fill dynamically allocated memory blocks with special, " +"recognizable bit patterns. Newly allocated memory is filled with the byte " +"``0xCD`` (``PYMEM_CLEANBYTE``), freed memory is filled with the byte " +"``0xDD`` (``PYMEM_DEADBYTE``). Memory blocks are surrounded by \"forbidden " +"bytes\" filled with the byte ``0xFD`` (``PYMEM_FORBIDDENBYTE``). Strings of " +"these bytes are unlikely to be valid addresses, floats, or ASCII strings." +msgstr "" +"این قلاب‌های اشکال‌زدایی بلوک‌های حافظه‌ی تخصیص‌یافته به‌صورت پویا را با " +"الگوهای بیتیِ خاص و قابل تشخیص پر می‌کنند. حافظه‌ی تازه تخصیص‌یافته با بایت " +"``0xCD`` (``PYMEM_CLEANBYTE``) پر می‌شود و حافظه‌ی آزادشده با بایت ``0xDD`` " +"(``PYMEM_DEADBYTE``) پر می‌شود. اطراف بلوک‌های حافظه با «بایت‌های ممنوع» که " +"با بایت ``0xFD`` (``PYMEM_FORBIDDENBYTE``) پر شده‌اند، احاطه شده است. " +"رشته‌هایی از این بایت‌ها به احتمال زیاد آدرس‌های معتبر، اعداد ممیز شناور یا " +"رشته‌های اسکی معتبر نیستند." msgid "Runtime checks:" -msgstr "" +msgstr "بررسی‌های ران‌تایم:" -msgid "Detect API violations. For example, detect if :c:func:`PyObject_Free` is called on a memory block allocated by :c:func:`PyMem_Malloc`." +msgid "" +"Detect API violations. For example, detect if :c:func:`PyObject_Free` is " +"called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" +"تشخیص نقض‌های API. برای مثال، تشخیص اینکه آیا :c:func:`PyObject_Free` روی " +"بلوک حافظه‌ای که توسط :c:func:`PyMem_Malloc` تخصیص داده شده است، فراخوانی " +"می‌شود یا خیر." msgid "Detect write before the start of the buffer (buffer underflow)." -msgstr "" +msgstr "تشخیص نوشتن پیش از ابتدای بافر (زیرریز بافر (buffer underflow))." msgid "Detect write after the end of the buffer (buffer overflow)." -msgstr "" +msgstr "تشخیص نوشتن فراتر از انتهای بافر (سرریز بافر)." -msgid "Check that there is an :term:`attached thread state` when allocator functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +msgid "" +"Check that there is an :term:`attached thread state` when allocator " +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and" +" :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" +"بررسی کنید که هنگام فراخوانی توابع تخصیص‌دهنده‌ی دامنه‌های " +":c:macro:`PYMEM_DOMAIN_OBJ` (مثلاً :c:func:`PyObject_Malloc`) و " +":c:macro:`PYMEM_DOMAIN_MEM` (مثلاً :c:func:`PyMem_Malloc`)، یک " +":term:`attached thread state` وجود داشته باشد." -msgid "On error, the debug hooks use the :mod:`tracemalloc` module to get the traceback where a memory block was allocated. The traceback is only displayed if :mod:`tracemalloc` is tracing Python memory allocations and the memory block was traced." +msgid "" +"On error, the debug hooks use the :mod:`tracemalloc` module to get the " +"traceback where a memory block was allocated. The traceback is only " +"displayed if :mod:`tracemalloc` is tracing Python memory allocations and the" +" memory block was traced." msgstr "" +"در صورت خطا، قلاب‌های اشکال‌زدایی برای به‌دست‌آوردن ردگیری پشته‌ای که بلوک " +"حافظه در آن تخصیص یافته است، از ماژول :mod:`tracemalloc` استفاده می‌کنند. " +"ردگیری پشته تنها زمانی نمایش داده می‌شود که :mod:`tracemalloc` در حال ردگیری" +" تخصیص‌های حافظه پایتون باشد و بلوک حافظه ردگیری شده باشد." -msgid "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each block of *N* bytes requested. The memory layout is like so, where p represents the address returned by a malloc-like or realloc-like function (``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to ``*(p+j)`` exclusive; note that the treatment of negative indices differs from a Python slice):" -msgstr "" +msgid "" +"Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " +"block of *N* bytes requested. The memory layout is like so, where p " +"represents the address returned by a malloc-like or realloc-like function " +"(``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to " +"``*(p+j)`` exclusive; note that the treatment of negative indices differs " +"from a Python slice):" +msgstr "" +"فرض کنید *S* = ``sizeof(size_t)`` باشد. به هر یک از دو انتهای هر بلوک از *N*" +" بایت درخواست‌شده، ``2*S`` بایت اضافه می‌شود. چیدمان حافظه به این صورت است، " +"که در آن p نشانی بازگردانده‌شده توسط تابعی شبیه به malloc یا realloc را نشان" +" می‌دهد (``p[i:j]`` به معنای اسلایس بایت‌ها از ``*(p+i)`` با احتساب آن تا " +"``*(p+j)`` بدون احتساب آن است؛ توجه داشته باشید که نحوه برخورد با اندیس‌های " +"منفی با اسلایس پایتون متفاوت است):" msgid "``p[-2*S:-S]``" -msgstr "" +msgstr "``p[-2*S:-S]``" -msgid "Number of bytes originally asked for. This is a size_t, big-endian (easier to read in a memory dump)." +msgid "" +"Number of bytes originally asked for. This is a size_t, big-endian (easier " +"to read in a memory dump)." msgstr "" +"تعداد بایت‌هایی که در ابتدا درخواست شده است. این یک size_t بزرگ‌اندیان است " +"(که خواندن آن در برون‌ریزی حافظه آسان‌تر است)." msgid "``p[-S]``" -msgstr "" +msgstr "``p[-S]``" msgid "API identifier (ASCII character):" -msgstr "" +msgstr "شناسه API (نویسه اسکی):" msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." -msgstr "" +msgstr "``'r'`` برای :c:macro:`PYMEM_DOMAIN_RAW`." msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." -msgstr "" +msgstr "``'m'`` برای :c:macro:`PYMEM_DOMAIN_MEM`." msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." -msgstr "" +msgstr "``'o'`` برای :c:macro:`PYMEM_DOMAIN_OBJ`." msgid "``p[-S+1:0]``" -msgstr "" +msgstr "``p[-S+1:0]``" msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" +"رونوشت‌هایی از PYMEM_FORBIDDENBYTE. برای گرفتن نوشتن‌ها و خواندن‌های پیش از " +"ابتدای ناحیه (under-writes and reads) استفاده می‌شوند." msgid "``p[0:N]``" -msgstr "" +msgstr "``p[0:N]``" -msgid "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch reference to uninitialized memory. When a realloc-like function is called requesting a larger memory block, the new excess bytes are also filled with PYMEM_CLEANBYTE. When a free-like function is called, these are overwritten with PYMEM_DEADBYTE, to catch reference to freed memory. When a realloc- like function is called requesting a smaller memory block, the excess old bytes are also filled with PYMEM_DEADBYTE." -msgstr "" +msgid "" +"The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " +"reference to uninitialized memory. When a realloc-like function is called " +"requesting a larger memory block, the new excess bytes are also filled with " +"PYMEM_CLEANBYTE. When a free-like function is called, these are overwritten" +" with PYMEM_DEADBYTE, to catch reference to freed memory. When a realloc- " +"like function is called requesting a smaller memory block, the excess old " +"bytes are also filled with PYMEM_DEADBYTE." +msgstr "" +"حافظه‌ی درخواستی با رونوشت‌هایی از PYMEM_CLEANBYTE پر می‌شود تا ارجاع به " +"حافظه‌ی مقداردهی‌نشده رهگیری شود. هنگامی که تابعی شبیه realloc برای درخواست " +"بلوک حافظه‌ی بزرگ‌تر فراخوانی می‌شود، بایت‌های اضافی جدید نیز با " +"PYMEM_CLEANBYTE پر می‌شوند. هنگامی که تابعی شبیه free فراخوانی می‌شود، این " +"بایت‌ها با PYMEM_DEADBYTE بازنویسی می‌شوند تا ارجاع به حافظه‌ی آزادشده " +"رهگیری شود. هنگامی که تابعی شبیه realloc برای درخواست بلوک حافظه‌ی کوچک‌تر " +"فراخوانی می‌شود، بایت‌های اضافی قدیمی نیز با PYMEM_DEADBYTE پر می‌شوند." msgid "``p[N:N+S]``" -msgstr "" +msgstr "``p[N:N+S]``" msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" +"کپی‌هایی از PYMEM_FORBIDDENBYTE. برای رهگیری نوشتن‌ها و خواندن‌های خارج از " +"محدوده استفاده می‌شوند." msgid "``p[N+S:N+2*S]``" -msgstr "" +msgstr "``p[N+S:N+2*S]``" -msgid "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by default)." +msgid "" +"Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " +"default)." msgstr "" +"تنها زمانی استفاده می‌شود که ماکروی ``PYMEM_DEBUG_SERIALNO`` تعریف شده باشد " +"(به‌طور پیش‌فرض تعریف نشده است)." -msgid "A serial number, incremented by 1 on each call to a malloc-like or realloc-like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected later, the serial number gives an excellent way to set a breakpoint on the next run, to capture the instant at which this block was passed out. The static function bumpserialno() in obmalloc.c is the only place the serial number is incremented, and exists so you can set such a breakpoint easily." -msgstr "" +msgid "" +"A serial number, incremented by 1 on each call to a malloc-like or realloc-" +"like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " +"later, the serial number gives an excellent way to set a breakpoint on the " +"next run, to capture the instant at which this block was passed out. The " +"static function bumpserialno() in obmalloc.c is the only place the serial " +"number is incremented, and exists so you can set such a breakpoint easily." +msgstr "" +"شماره سریالی که در هر فراخوانی تابعی شبیه malloc یا realloc، ۱ واحد افزایش " +"می‌یابد. :c:type:`size_t` بزرگ‌اندیان. اگر بعدها «حافظه‌ی خراب» تشخیص داده" +" شود، شماره سریال راهی عالی فراهم می‌کند تا در اجرای بعدی نقطه‌وقفی " +"(breakpoint) تعیین کنید و لحظه‌ی تحویل داده شدن این بلوک را به‌دست آورید. " +"تابع ایستای bumpserialno() در obmalloc.c تنها جایی است که شماره سریال در آن " +"افزایش می‌یابد، و وجود دارد تا شما بتوانید چنین نقطه‌وقفی را به‌سادگی تعیین " +"کنید." -msgid "A realloc-like or free-like function first checks that the PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, diagnostic output is written to stderr, and the program is aborted via Py_FatalError(). The other main failure mode is provoking a memory error when a program reads up one of the special bit patterns and tries to use it as an address. If you get in a debugger then and look at the object, you're likely to see that it's entirely filled with PYMEM_DEADBYTE (meaning freed memory is getting used) or PYMEM_CLEANBYTE (meaning uninitialized memory is getting used)." -msgstr "" +msgid "" +"A realloc-like or free-like function first checks that the " +"PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " +"diagnostic output is written to stderr, and the program is aborted via " +"Py_FatalError(). The other main failure mode is provoking a memory error " +"when a program reads up one of the special bit patterns and tries to use it " +"as an address. If you get in a debugger then and look at the object, you're" +" likely to see that it's entirely filled with PYMEM_DEADBYTE (meaning freed " +"memory is getting used) or PYMEM_CLEANBYTE (meaning uninitialized memory is " +"getting used)." +msgstr "" +"تابعی شبیه realloc یا free ابتدا بررسی می‌کند که بایت‌های " +"PYMEM_FORBIDDENBYTE در هر دو انتها سالم باشند. اگر تغییر کرده باشند، خروجی " +"تشخیصی به stderr نوشته می‌شود و برنامه از طریق Py_FatalError() خاتمه " +"می‌یابد. حالت شکست اصلی دیگر، ایجاد خطای حافظه هنگامی است که برنامه یکی از " +"الگوهای بیتی خاص را می‌خواند و تلاش می‌کند از آن به‌عنوان آدرس استفاده کند. " +"اگر در چنین موقعیتی وارد اشکال‌زدا شوید و به شیء نگاه کنید، به احتمال زیاد " +"می‌بینید که کاملاً با PYMEM_DEADBYTE (به این معنا که حافظه‌ی آزادشده در حال " +"استفاده است) یا PYMEM_CLEANBYTE (به این معنا که حافظه‌ی مقداردهی‌نشده در حال" +" استفاده است) پر شده است." -msgid "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python compiled in release mode. On error, the debug hooks now use :mod:`tracemalloc` to get the traceback where a memory block was allocated. The debug hooks now also check if there is an :term:`attached thread state` when functions of :c:macro:`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." -msgstr "" +msgid "" +"The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " +"compiled in release mode. On error, the debug hooks now use " +":mod:`tracemalloc` to get the traceback where a memory block was allocated. " +"The debug hooks now also check if there is an :term:`attached thread state` " +"when functions of :c:macro:`PYMEM_DOMAIN_OBJ` and " +":c:macro:`PYMEM_DOMAIN_MEM` domains are called." +msgstr "" +"تابع :c:func:`PyMem_SetupDebugHooks` اکنون روی پایتونی که در حالت انتشار " +"(release) کامپایل شده است نیز کار می‌کند. در صورت خطا، قلاب‌های اشکال‌زدایی " +"اکنون از :mod:`tracemalloc` برای به‌دست‌آوردن ردگیری محل تخصیص یک بلوک حافظه" +" استفاده می‌کنند. قلاب‌های اشکال‌زدایی اکنون همچنین بررسی می‌کنند که آیا " +"هنگام فراخوانی توابع دامنه‌های :c:macro:`PYMEM_DOMAIN_OBJ` و " +":c:macro:`PYMEM_DOMAIN_MEM`، یک :term:`attached thread state` وجود دارد یا " +"خیر." -msgid "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, ``0xDD`` and ``0xFD`` to use the same values than Windows CRT debug ``malloc()`` and ``free()``." +msgid "" +"Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " +"and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " +"``0xDD`` and ``0xFD`` to use the same values than Windows CRT debug " +"``malloc()`` and ``free()``." msgstr "" +"الگو‌های بایتی ``0xCB`` (``PYMEM_CLEANBYTE``)، ``0xDB`` (``PYMEM_DEADBYTE``)" +" و ``0xFB`` (``PYMEM_FORBIDDENBYTE``) با ``0xCD``، ``0xDD`` و ``0xFD`` " +"جایگزین شده‌اند تا از همان مقادیر ``malloc()`` و ``free()`` اشکال‌زدایی CRT " +"ویندوز استفاده شود." msgid "The pymalloc allocator" -msgstr "" +msgstr "تخصیص‌دهنده‌ی pymalloc" -msgid "Python has a *pymalloc* allocator optimized for small objects (smaller or equal to 512 bytes) with a short lifetime. It uses memory mappings called \"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes." -msgstr "" +msgid "" +"Python has a *pymalloc* allocator optimized for small objects (smaller or " +"equal to 512 bytes) with a short lifetime. It uses memory mappings called " +"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB " +"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and " +":c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes." +msgstr "" +"پایتون یک تخصیص‌دهنده *pymalloc* دارد که برای اشیاء کوچک (کوچک‌تر یا برابر " +"با ۵۱۲ بایت) با عمر کوتاه بهینه‌سازی شده است. این تخصیص‌دهنده از نگاشت‌های " +"حافظه به نام «آرنا» (arena) با اندازه ثابت ۲۵۶ KiB در سکوهای ۳۲ بیتی یا ۱ " +"MiB در سکوهای ۶۴ بیتی استفاده می‌کند. برای تخصیص‌های بزرگ‌تر از ۵۱۲ بایت، به" +" :c:func:`PyMem_RawMalloc` و :c:func:`PyMem_RawRealloc` بازمی‌گردد." -msgid "*pymalloc* is the :ref:`default allocator ` of the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." +msgid "" +"*pymalloc* is the :ref:`default allocator ` of " +"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and " +":c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" +"*pymalloc* :ref:`تخصیص‌دهنده پیش‌فرض ` دامنه‌های " +":c:macro:`PYMEM_DOMAIN_MEM` (مثلاً :c:func:`PyMem_Malloc`) و " +":c:macro:`PYMEM_DOMAIN_OBJ` (مثلاً :c:func:`PyObject_Malloc`) است." msgid "The arena allocator uses the following functions:" -msgstr "" +msgstr "تخصیص‌دهنده‌ی آرنا (arena allocator) از توابع زیر استفاده می‌کند:" msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," -msgstr "" +msgstr ":c:func:`!VirtualAlloc` و :c:func:`!VirtualFree` در ویندوز،" msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," -msgstr "" +msgstr ":c:func:`!mmap` و :c:func:`!munmap` در صورت دسترس‌پذیری،" msgid ":c:func:`malloc` and :c:func:`free` otherwise." -msgstr "" +msgstr ":c:func:`malloc` و :c:func:`free` در غیر این صورت." -msgid "This allocator is disabled if Python is configured with the :option:`--without-pymalloc` option. It can also be disabled at runtime using the :envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." +msgid "" +"This allocator is disabled if Python is configured with the " +":option:`--without-pymalloc` option. It can also be disabled at runtime " +"using the :envvar:`PYTHONMALLOC` environment variable (ex: " +"``PYTHONMALLOC=malloc``)." msgstr "" +"اگر پایتون با گزینه‌ی :option:`--without-pymalloc` پیکربندی شده باشد، این " +"تخصیص‌دهنده غیرفعال می‌شود. همچنین می‌توان آن را در زمان اجرا با استفاده از " +"متغیر محیطی :envvar:`PYTHONMALLOC` غیرفعال کرد (مثلاً " +"``PYTHONMALLOC=malloc``)." -msgid "Typically, it makes sense to disable the pymalloc allocator when building Python with AddressSanitizer (:option:`--with-address-sanitizer`) which helps uncover low level bugs within the C code." +msgid "" +"Typically, it makes sense to disable the pymalloc allocator when building " +"Python with AddressSanitizer (:option:`--with-address-sanitizer`) which " +"helps uncover low level bugs within the C code." msgstr "" +"معمولاً منطقی است که هنگام ساخت پایتون با AddressSanitizer (:option:`--with-" +"address-sanitizer`)، که به کشف اشکال‌های سطح پایین درون کد C کمک می‌کند، " +"تخصیص‌دهنده pymalloc را غیرفعال کنید." msgid "Customize pymalloc Arena Allocator" -msgstr "" +msgstr "سفارشی‌سازی تخصیص‌دهنده آرنا (Arena Allocator) در pymalloc" -msgid "Structure used to describe an arena allocator. The structure has three fields:" +msgid "" +"Structure used to describe an arena allocator. The structure has three " +"fields:" msgstr "" +"ساختاری که برای توصیف یک تخصیص‌دهنده‌ی آرنا (arena allocator) استفاده " +"می‌شود. این ساختار سه فیلد دارد:" msgid "``void* alloc(void *ctx, size_t size)``" -msgstr "" +msgstr "``void* alloc(void *ctx, size_t size)``" msgid "allocate an arena of size bytes" -msgstr "" +msgstr "تخصیص دادن یک آرنا (arena) به اندازه‌ی size بایت" msgid "``void free(void *ctx, void *ptr, size_t size)``" -msgstr "" +msgstr "``void free(void *ctx, void *ptr, size_t size)``" msgid "free an arena" -msgstr "" +msgstr "آزاد کردن یک آرنا (arena)" msgid "Get the arena allocator." -msgstr "" +msgstr "بهدست آوردن تخصیص‌دهنده‌ی آرنا (arena)." msgid "Set the arena allocator." -msgstr "" +msgstr "تخصیص‌دهنده‌ی عرصه (arena) را تنظیم می‌کند." msgid "The mimalloc allocator" -msgstr "" +msgstr "تخصیص‌دهنده mimalloc" -msgid "Python supports the `mimalloc `__ allocator when the underlying platform support is available. mimalloc is a general purpose allocator with excellent performance characteristics, initially developed by Daan Leijen for the runtime systems of the Koka and Lean languages." -msgstr "" +msgid "" +"Python supports the `mimalloc `__ " +"allocator when the underlying platform support is available. mimalloc is a " +"general purpose allocator with excellent performance characteristics, " +"initially developed by Daan Leijen for the runtime systems of the Koka and " +"Lean languages." +msgstr "" +"پایتون از تخصیص‌دهنده (allocator) `mimalloc " +"`__ پشتیبانی می‌کند، زمانی که " +"پشتیبانی پلتفرم زیرین در دسترس باشد. mimalloc یک تخصیص‌دهنده همه‌منظوره با " +"ویژگی‌های عملکردی عالی است که در ابتدا توسط Daan Leijen برای سیستم‌های " +"ران‌تایم زبان‌های Koka و Lean توسعه‌یافته است." -msgid "Unlike :ref:`pymalloc `, which is optimized for small objects (512 bytes or fewer), mimalloc handles allocations of any size." +msgid "" +"Unlike :ref:`pymalloc `, which is optimized for small objects (512" +" bytes or fewer), mimalloc handles allocations of any size." msgstr "" +"برخلاف :ref:`pymalloc ` که برای اشیاء کوچک (۵۱۲ بایت یا کمتر) " +"بهینه‌سازی‌شده است، mimalloc تخصیص‌هایی با هر اندازه را مدیریت می‌کند." -msgid "In the :term:`free-threaded ` build, mimalloc is the default and **required** allocator for the :c:macro:`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains. It cannot be disabled in free-threaded builds. The free-threaded build uses per-thread mimalloc heaps, which allows allocation and deallocation to proceed without locking in most cases." -msgstr "" +msgid "" +"In the :term:`free-threaded ` build, mimalloc is the default" +" and **required** allocator for the :c:macro:`PYMEM_DOMAIN_MEM` and " +":c:macro:`PYMEM_DOMAIN_OBJ` domains. It cannot be disabled in free-threaded" +" builds. The free-threaded build uses per-thread mimalloc heaps, which " +"allows allocation and deallocation to proceed without locking in most cases." +msgstr "" +"در بیلد (build) :term:`نخ‌آزاد `، mimalloc تخصیص‌دهنده‌ی " +"پیش‌فرض و **الزامی** برای دامنه‌های :c:macro:`PYMEM_DOMAIN_MEM` و " +":c:macro:`PYMEM_DOMAIN_OBJ` است. در بیلد‌های نخ‌آزاد نمی‌توان آن را غیرفعال " +"کرد. بیلد نخ‌آزاد از هیپ‌های mimalloc به ازای هر نخ استفاده می‌کند که این " +"امر اجازه می‌دهد تخصیص و آزادسازی در بیشتر موارد بدون قفل‌کردن انجام شوند." -msgid "In the default (non-free-threaded) build, mimalloc is available but not the default allocator. It can be selected at runtime using :envvar:`PYTHONMALLOC`\\ ``=mimalloc`` (or ``mimalloc_debug`` to include :ref:`debug hooks `). It can be disabled at build time using the :option:`--without-mimalloc` configure option, but this option cannot be combined with :option:`--disable-gil`." -msgstr "" +msgid "" +"In the default (non-free-threaded) build, mimalloc is available but not the " +"default allocator. It can be selected at runtime using " +":envvar:`PYTHONMALLOC`\\ ``=mimalloc`` (or ``mimalloc_debug`` to include " +":ref:`debug hooks `). It can be disabled at build time " +"using the :option:`--without-mimalloc` configure option, but this option " +"cannot be combined with :option:`--disable-gil`." +msgstr "" +"در بیلد پیش‌فرض (غیر نخ‌آزاد)، mimalloc دسترس‌پذیر است، اما تخصیص‌دهنده‌ی " +"پیش‌فرض نیست. می‌توان آن را در زمان اجرا با استفاده از " +":envvar:`PYTHONMALLOC`\\ ``=mimalloc`` انتخاب کرد (یا ``mimalloc_debug`` " +"برای گنجاندن :ref:`قلاب‌های اشکال‌زدایی `). می‌توان آن را" +" در زمان بیلد با استفاده از گزینه‌ی پیکربندی :option:`--without-mimalloc` " +"غیرفعال کرد، اما این گزینه را نمی‌توان با :option:`--disable-gil` ترکیب کرد." msgid "tracemalloc C API" -msgstr "" +msgstr "API زبان C برای tracemalloc" msgid "Track an allocated memory block in the :mod:`tracemalloc` module." -msgstr "" +msgstr "پیگیری یک بلوک حافظه‌ی تخصیص‌یافته در ماژول :mod:`tracemalloc`." -msgid "Return ``0`` on success, return ``-1`` on error (failed to allocate memory to store the trace). Return ``-2`` if tracemalloc is disabled." +msgid "" +"Return ``0`` on success, return ``-1`` on error (failed to allocate memory " +"to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" +"در صورت موفقیت ``0`` را برمی‌گرداند، در صورت خطا ``-1`` را برمی‌گرداند " +"(تخصیص حافظه برای ذخیره‌ی ردگیری ناموفق بود). اگر tracemalloc غیرفعال باشد، " +"``-2`` را برمی‌گرداند." msgid "If memory block is already tracked, update the existing trace." msgstr "" +"اگر بلوک حافظه از قبل پیگیری شده باشد، ردگیری موجود به‌روزرسانی می‌شود." -msgid "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do nothing if the block was not tracked." +msgid "" +"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " +"nothing if the block was not tracked." msgstr "" +"پیگیری یک بلوک حافظه‌ی تخصیص‌یافته را در ماژول :mod:`tracemalloc` لغو " +"می‌کند. اگر بلوک پیگیری نشده باشد، هیچ کاری انجام نمی‌دهد." msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" +"اگر tracemalloc غیرفعال باشد، ``-2`` را برمی‌گرداند، در غیر این صورت ``0`` " +"را برمی‌گرداند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "Here is the example from section :ref:`memoryoverview`, rewritten so that the I/O buffer is allocated from the Python heap by using the first function set::" +msgid "" +"Here is the example from section :ref:`memoryoverview`, rewritten so that " +"the I/O buffer is allocated from the Python heap by using the first function" +" set::" msgstr "" +"اینجا مثال بخش :ref:`memoryoverview` آمده است که به‌گونه‌ای بازنویسی شده است" +" تا بافر ورودی/خروجی با استفاده از نخستین مجموعه توابع، از هیپ پایتون تخصیص " +"یابد::" msgid "" "PyObject *res;\n" @@ -668,9 +1351,18 @@ msgid "" "PyMem_Free(buf); /* allocated with PyMem_Malloc */\n" "return res;" msgstr "" +"PyObject *res;\n" +"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"/* ...Do some I/O operation involving buf... */\n" +"res = PyBytes_FromString(buf);\n" +"PyMem_Free(buf); /* allocated with PyMem_Malloc */\n" +"return res;" msgid "The same code using the type-oriented function set::" -msgstr "" +msgstr "همان کد با استفاده از مجموعه توابع نوع‌محور::" msgid "" "PyObject *res;\n" @@ -683,9 +1375,30 @@ msgid "" "PyMem_Free(buf); /* allocated with PyMem_New */\n" "return res;" msgstr "" +"PyObject *res;\n" +"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"/* ...Do some I/O operation involving buf... */\n" +"res = PyBytes_FromString(buf);\n" +"PyMem_Free(buf); /* allocated with PyMem_New */\n" +"return res;" -msgid "Note that in the two examples above, the buffer is always manipulated via functions belonging to the same set. Indeed, it is required to use the same memory API family for a given memory block, so that the risk of mixing different allocators is reduced to a minimum. The following code sequence contains two errors, one of which is labeled as *fatal* because it mixes two different allocators operating on different heaps. ::" -msgstr "" +msgid "" +"Note that in the two examples above, the buffer is always manipulated via " +"functions belonging to the same set. Indeed, it is required to use the same " +"memory API family for a given memory block, so that the risk of mixing " +"different allocators is reduced to a minimum. The following code sequence " +"contains two errors, one of which is labeled as *fatal* because it mixes two" +" different allocators operating on different heaps. ::" +msgstr "" +"توجه داشته باشید که در دو مثال بالا، بافر همیشه از طریق توابعی که به یک " +"مجموعه تعلق دارند دستکاری می‌شود. در واقع، لازم است برای یک بلوک حافظه‌ی " +"معین از یک خانواده‌ی واحد API حافظه استفاده شود تا خطر ترکیب تخصیص‌دهنده‌های" +" مختلف به حداقل کاهش یابد. دنباله کد زیر شامل دو خطا است که یکی از آن‌ها " +"به‌عنوان *مهلک* برچسب‌گذاری شده است، زیرا دو تخصیص‌دهنده‌ی متفاوت را که بر " +"روی هیپ‌های متفاوت کار می‌کنند، با هم ترکیب می‌کند. ::" msgid "" "char *buf1 = PyMem_New(char, BUFSIZ);\n" @@ -696,21 +1409,40 @@ msgid "" "free(buf2); /* Right -- allocated via malloc() */\n" "free(buf1); /* Fatal -- should be PyMem_Free() */" msgstr "" +"char *buf1 = PyMem_New(char, BUFSIZ);\n" +"char *buf2 = (char *) malloc(BUFSIZ);\n" +"char *buf3 = (char *) PyMem_Malloc(BUFSIZ);\n" +"...\n" +"PyMem_Del(buf3); /* Wrong -- should be PyMem_Free() */\n" +"free(buf2); /* Right -- allocated via malloc() */\n" +"free(buf1); /* Fatal -- should be PyMem_Free() */" -msgid "In addition to the functions aimed at handling raw memory blocks from the Python heap, objects in Python are allocated and released with :c:macro:`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Free`." +msgid "" +"In addition to the functions aimed at handling raw memory blocks from the " +"Python heap, objects in Python are allocated and released with " +":c:macro:`PyObject_New`, :c:macro:`PyObject_NewVar` and " +":c:func:`PyObject_Free`." msgstr "" +"علاوه بر توابعی که برای مدیریت بلوک‌های حافظه خام از هیپ پایتون در نظر گرفته" +" شده‌اند، اشیاء در پایتون با :c:macro:`PyObject_New`، " +":c:macro:`PyObject_NewVar` و :c:func:`PyObject_Free` تخصیص می‌یابند و آزاد " +"می‌شوند." -msgid "These will be explained in the next chapter on defining and implementing new object types in C." +msgid "" +"These will be explained in the next chapter on defining and implementing new" +" object types in C." msgstr "" +"این موارد در فصل بعدی که به تعریف و پیاده‌سازی نوع‌های شیء جدید در C " +"می‌پردازد، توضیح داده خواهند شد." msgid "malloc (C function)" -msgstr "" +msgstr "malloc (تابع C)" msgid "calloc (C function)" -msgstr "" +msgstr "calloc (تابع C)" msgid "realloc (C function)" -msgstr "" +msgstr "realloc (تابع C)" msgid "free (C function)" -msgstr "" +msgstr "free (تابع C)" diff --git a/c-api/memoryview.po b/c-api/memoryview.po index f349208b9..a45036de2 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -23,46 +23,109 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "MemoryView objects" -msgstr "" +msgstr "اشیاء MemoryView" -msgid "A :class:`memoryview` object exposes the C level :ref:`buffer interface ` as a Python object which can then be passed around like any other object." +msgid "" +"A :class:`memoryview` object exposes the C level :ref:`buffer interface " +"` as a Python object which can then be passed around like any" +" other object." msgstr "" +"شیء :class:`memoryview` :ref:`رابط بافر ` سطح C را به‌صورت یک" +" شیء پایتون در دسترس قرار می‌دهد که سپس می‌توان آن را مانند هر شیء دیگری " +"منتقل کرد." -msgid "This instance of :c:type:`PyTypeObject` represents the Python memoryview type. This is the same object as :class:`memoryview` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python memoryview " +"type. This is the same object as :class:`memoryview` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع memoryview پایتون را نمایش می‌دهد. " +"این همان شیء :class:`memoryview` در لایه‌ی پایتون است." -msgid "Create a memoryview object from an object that provides the buffer interface. If *obj* supports writable buffer exports, the memoryview object will be read/write, otherwise it may be either read-only or read/write at the discretion of the exporter." -msgstr "" +msgid "" +"Create a memoryview object from an object that provides the buffer " +"interface. If *obj* supports writable buffer exports, the memoryview object " +"will be read/write, otherwise it may be either read-only or read/write at " +"the discretion of the exporter." +msgstr "" +"یک شیء memoryview از شیئی که رابط بافر را فراهم می‌کند ایجاد می‌کند. اگر " +"*obj* از برون‌دهی (export) بافرهای نوشتنی پشتیبانی کند، شیء memoryview " +"خواندنی/نوشتنی خواهد بود؛ در غیر این صورت، ممکن است به تشخیص برون‌دهنده " +"(exporter)، فقط‌خواندنی یا خواندنی/نوشتنی باشد." msgid "Flag to request a readonly buffer." -msgstr "" +msgstr "پرچمی برای درخواست بافر فقط‌خواندنی." msgid "Flag to request a writable buffer." -msgstr "" +msgstr "پرچم برای درخواست بافر نوشتنی." -msgid "Create a memoryview object using *mem* as the underlying buffer. *flags* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." +msgid "" +"Create a memoryview object using *mem* as the underlying buffer. *flags* can" +" be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." msgstr "" +"یک شیء memoryview با استفاده از *mem* به‌عنوان بافر زیربنایی ایجاد می‌کند. " +"*flags* می‌تواند یکی از :c:macro:`PyBUF_READ` یا :c:macro:`PyBUF_WRITE` " +"باشد." -msgid "Create a memoryview object wrapping the given buffer structure *view*. For simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred function." +msgid "" +"Create a memoryview object wrapping the given buffer structure *view*. For " +"simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred " +"function." msgstr "" +"یک شیء memoryview می‌سازد که ساختار بافر داده‌شده *view* را دربرمی‌گیرد. " +"برای بافرهای بایت ساده، :c:func:`PyMemoryView_FromMemory` تابع ترجیحی است." -msgid "Create a memoryview object to a :term:`contiguous` chunk of memory (in either 'C' or 'F'ortran *order*) from an object that defines the buffer interface. If memory is contiguous, the memoryview object points to the original memory. Otherwise, a copy is made and the memoryview points to a new bytes object." -msgstr "" +msgid "" +"Create a memoryview object to a :term:`contiguous` chunk of memory (in " +"either 'C' or 'F'ortran *order*) from an object that defines the buffer " +"interface. If memory is contiguous, the memoryview object points to the " +"original memory. Otherwise, a copy is made and the memoryview points to a " +"new bytes object." +msgstr "" +"یک شیء memoryview روی یک تکه‌ی :term:`پیوسته ` از حافظه (به " +"*ترتیب* 'C' یا 'F'ortran) از شیئی که رابط بافر را تعریف می‌کند، ایجاد " +"می‌کند. اگر حافظه پیوسته باشد، شیء memoryview به حافظه‌ی اصلی اشاره می‌کند. " +"در غیر این صورت، یک رونوشت ساخته می‌شود و memoryview به یک شیء bytes جدید " +"اشاره می‌کند." -msgid "*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." +msgid "" +"*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." msgstr "" +"*buffertype* می‌تواند یکی از :c:macro:`PyBUF_READ` یا :c:macro:`PyBUF_WRITE`" +" باشد." -msgid "Return true if the object *obj* is a memoryview object. It is not currently allowed to create subclasses of :class:`memoryview`. This function always succeeds." +msgid "" +"Return true if the object *obj* is a memoryview object. It is not currently" +" allowed to create subclasses of :class:`memoryview`. This function always " +"succeeds." msgstr "" +"اگر شیء *obj* یک شیء memoryview باشد، مقدار true را برمی‌گرداند. در حال حاضر" +" ایجاد زیرکلاس‌های :class:`memoryview` مجاز نیست. این تابع همیشه با موفقیت " +"اجرا می‌شود." -msgid "Return a pointer to the memoryview's private copy of the exporter's buffer. *mview* **must** be a memoryview instance; this macro doesn't check its type, you must do it yourself or you will risk crashes." -msgstr "" +msgid "" +"Return a pointer to the memoryview's private copy of the exporter's buffer. " +"*mview* **must** be a memoryview instance; this macro doesn't check its " +"type, you must do it yourself or you will risk crashes." +msgstr "" +"اشاره‌گری به رونوشت خصوصی memoryview از بافر صادرکننده را برمی‌گرداند. " +"*mview* **باید** یک نمونه‌ی memoryview باشد؛ این ماکرو نوع آن را بررسی " +"نمی‌کند، باید خودتان این کار را انجام دهید وگرنه خود را در معرض خطر فروپاشی " +"قرار می‌دهید." -msgid "Return either a pointer to the exporting object that the memoryview is based on or ``NULL`` if the memoryview has been created by one of the functions :c:func:`PyMemoryView_FromMemory` or :c:func:`PyMemoryView_FromBuffer`. *mview* **must** be a memoryview instance." -msgstr "" +msgid "" +"Return either a pointer to the exporting object that the memoryview is based" +" on or ``NULL`` if the memoryview has been created by one of the functions " +":c:func:`PyMemoryView_FromMemory` or :c:func:`PyMemoryView_FromBuffer`. " +"*mview* **must** be a memoryview instance." +msgstr "" +"اشاره‌گری به شیء صادرکننده‌ای (exporting object) که memoryview بر پایه‌ی آن " +"است را برمی‌گرداند، یا اگر memoryview توسط یکی از توابع " +":c:func:`PyMemoryView_FromMemory` یا :c:func:`PyMemoryView_FromBuffer` ایجاد" +" شده باشد، ``NULL`` را برمی‌گرداند. *mview* **باید** یک نمونه از memoryview " +"باشد." msgid "object" -msgstr "" +msgstr "شیء" msgid "memoryview" -msgstr "" +msgstr "memoryview" diff --git a/c-api/method.po b/c-api/method.po index 4bd9d3fca..217817fc7 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -24,61 +24,110 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Instance Method Objects" -msgstr "" +msgstr "اشیاء متد نمونه" -msgid "An instance method is a wrapper for a :c:type:`PyCFunction` and the new way to bind a :c:type:`PyCFunction` to a class object. It replaces the former call ``PyMethod_New(func, NULL, class)``." +msgid "" +"An instance method is a wrapper for a :c:type:`PyCFunction` and the new way " +"to bind a :c:type:`PyCFunction` to a class object. It replaces the former " +"call ``PyMethod_New(func, NULL, class)``." msgstr "" +"متد نمونه، پوششی برای :c:type:`PyCFunction` و راه جدیدی برای مقید کردن " +":c:type:`PyCFunction` به یک شیء کلاس است. این متد جایگزین فراخوانی قبلی " +"``PyMethod_New(func, NULL, class)`` می‌شود." -msgid "This instance of :c:type:`PyTypeObject` represents the Python instance method type. It is not exposed to Python programs." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python instance " +"method type. It is not exposed to Python programs." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع متد نمونه در پایتون را نشان می‌دهد. " +"این نمونه در دسترس برنامه‌های پایتون قرار نمی‌گیرد." -msgid "Return true if *o* is an instance method object (has type :c:data:`PyInstanceMethod_Type`). The parameter must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is an instance method object (has type " +":c:data:`PyInstanceMethod_Type`). The parameter must not be ``NULL``. This " +"function always succeeds." msgstr "" +"اگر *o* یک شیء متد نمونه باشد (نوع آن :c:data:`PyInstanceMethod_Type` باشد)،" +" مقدار true را برمی‌گرداند. این پارامتر نباید ``NULL`` باشد. این تابع همیشه " +"با موفقیت انجام می‌شود." -msgid "Return a new instance method object, with *func* being any callable object. *func* is the function that will be called when the instance method is called." +msgid "" +"Return a new instance method object, with *func* being any callable object. " +"*func* is the function that will be called when the instance method is " +"called." msgstr "" +"یک شیء متد نمونه‌ی جدید برمی‌گرداند که در آن *func* می‌تواند هر شیء " +"فراخوانی‌پذیر باشد. *func* تابعی است که هنگام فراخوانی متد نمونه فراخوانی " +"می‌شود." msgid "Return the function object associated with the instance method *im*." -msgstr "" +msgstr "شیء تابع مرتبط با متد نمونه‌ی *im* را برمی‌گرداند." -msgid "Macro version of :c:func:`PyInstanceMethod_Function` which avoids error checking." +msgid "" +"Macro version of :c:func:`PyInstanceMethod_Function` which avoids error " +"checking." msgstr "" +"نسخه‌ی ماکروی :c:func:`PyInstanceMethod_Function` که بررسی خطا را انجام " +"نمی‌دهد." msgid "Method Objects" -msgstr "" +msgstr "اشیاء متد" -msgid "Methods are bound function objects. Methods are always bound to an instance of a user-defined class. Unbound methods (methods bound to a class object) are no longer available." +msgid "" +"Methods are bound function objects. Methods are always bound to an instance " +"of a user-defined class. Unbound methods (methods bound to a class object) " +"are no longer available." msgstr "" +"متدها اشیاء تابع مقید هستند. متدها همیشه به نمونه‌ای از یک کلاس تعریف‌شده " +"توسط کاربر مقید هستند. متدهای مقید‌نشده (متدهایی که به شیء کلاس مقید هستند) " +"دیگر در دسترس نیستند." -msgid "This instance of :c:type:`PyTypeObject` represents the Python method type. This is exposed to Python programs as ``types.MethodType``." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python method type. " +"This is exposed to Python programs as ``types.MethodType``." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نمایانگر نوع متد پایتون است. این نوع در " +"برنامه‌های پایتون به صورت ``types.MethodType`` در دسترس قرار می‌گیرد." -msgid "Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). The parameter must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). " +"The parameter must not be ``NULL``. This function always succeeds." msgstr "" +"اگر *o* یک شیء متد باشد (دارای نوع :c:data:`PyMethod_Type` است)، true " +"برمی‌گرداند. پارامتر نباید ``NULL`` باشد. این تابع همیشه با موفقیت اجرا " +"می‌شود." -msgid "Return a new method object, with *func* being any callable object and *self* the instance the method should be bound. *func* is the function that will be called when the method is called. *self* must not be ``NULL``." +msgid "" +"Return a new method object, with *func* being any callable object and *self*" +" the instance the method should be bound. *func* is the function that will " +"be called when the method is called. *self* must not be ``NULL``." msgstr "" +"یک شیء متد جدید برمی‌گرداند که در آن *func* هر شیء فراخوانی‌پذیری است و " +"*self* نمونه‌ای است که متد باید به آن مقید شود. *func* تابعی است که هنگام " +"فراخوانی متد فراخوانی می‌شود. *self* نباید ``NULL`` باشد." msgid "Return the function object associated with the method *meth*." -msgstr "" +msgstr "شیء تابع مرتبط با متد *meth* را برمی‌گرداند." -msgid "Macro version of :c:func:`PyMethod_Function` which avoids error checking." +msgid "" +"Macro version of :c:func:`PyMethod_Function` which avoids error checking." msgstr "" +"نسخه‌ی ماکروی :c:func:`PyMethod_Function` که از بررسی خطا اجتناب می‌کند." msgid "Return the instance associated with the method *meth*." -msgstr "" +msgstr "نمونه‌ی مرتبط با متد *meth* را برمی‌گرداند." msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking." -msgstr "" +msgstr "نسخه‌ی ماکروی :c:func:`PyMethod_Self` که از بررسی خطا اجتناب می‌کند." msgid "object" -msgstr "" +msgstr "شیء" msgid "instancemethod" -msgstr "" +msgstr "متد نمونه" msgid "method" -msgstr "" +msgstr "متد" msgid "MethodType (in module types)" -msgstr "" +msgstr "MethodType (در ماژول types)" diff --git a/c-api/module.po b/c-api/module.po index 4d23e76ab..6144850f2 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -24,268 +24,655 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Module Objects" -msgstr "" +msgstr "اشیاء ماژول" -msgid "This instance of :c:type:`PyTypeObject` represents the Python module type. This is exposed to Python programs as :py:class:`types.ModuleType`." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python module type. " +"This is exposed to Python programs as :py:class:`types.ModuleType`." msgstr "" +"این نمونه از :c:type:`PyTypeObject` معرف نوع ماژول پایتون است. این نوع به " +"برنامه‌های پایتون به‌صورت :py:class:`types.ModuleType` ارائه می‌شود." -msgid "Return true if *p* is a module object, or a subtype of a module object. This function always succeeds." +msgid "" +"Return true if *p* is a module object, or a subtype of a module object. This" +" function always succeeds." msgstr "" +"اگر *p* یک شیء ماژول یا زیرنوعی از یک شیء ماژول باشد، مقدار true " +"برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Return true if *p* is a module object, but not a subtype of :c:data:`PyModule_Type`. This function always succeeds." +msgid "" +"Return true if *p* is a module object, but not a subtype of " +":c:data:`PyModule_Type`. This function always succeeds." msgstr "" +"اگر *p* یک شیء ماژول باشد، اما زیرنوعی از :c:data:`PyModule_Type` نباشد، " +"مقدار درست را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return a new module object with :attr:`module.__name__` set to *name*. The module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module.__package__` and :attr:`~module.__loader__` attributes are filled in (all but :attr:`!__name__` are set to ``None``). The caller is responsible for setting a :attr:`~module.__file__` attribute." -msgstr "" +msgid "" +"Return a new module object with :attr:`module.__name__` set to *name*. The " +"module's :attr:`!__name__`, :attr:`~module.__doc__`, " +":attr:`~module.__package__` and :attr:`~module.__loader__` attributes are " +"filled in (all but :attr:`!__name__` are set to ``None``). The caller is " +"responsible for setting a :attr:`~module.__file__` attribute." +msgstr "" +"یک شیء ماژول جدید با :attr:`module.__name__` تنظیم‌شده بر *name* " +"برمی‌گرداند. ویژگی‌های :attr:`!__name__`، :attr:`~module.__doc__`، " +":attr:`~module.__package__` و :attr:`~module.__loader__` ماژول پر می‌شوند " +"(همه به‌جز :attr:`!__name__` بر ``None`` تنظیم می‌شوند). تنظیم ویژگی " +":attr:`~module.__file__` بر عهده‌ی فراخواننده است." msgid "Return ``NULL`` with an exception set on error." -msgstr "" +msgstr "در صورت خطا، ``NULL`` به همراه استثنای تنظیم‌شده برمی‌گرداند." -msgid ":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to ``None``." +msgid "" +":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " +"``None``." msgstr "" +":attr:`~module.__package__` و :attr:`~module.__loader__` اکنون به ``None`` " +"تنظیم می‌شوند." -msgid "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded string instead of a Unicode object." +msgid "" +"Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " +"string instead of a Unicode object." msgstr "" +"مشابه :c:func:`PyModule_NewObject`، اما نام به جای یک شیء یونیکد، یک رشته " +"کدگذاری‌شده با UTF-8 است." -msgid "Return the dictionary object that implements *module*'s namespace; this object is the same as the :attr:`~object.__dict__` attribute of the module object. If *module* is not a module object (or a subtype of a module object), :exc:`SystemError` is raised and ``NULL`` is returned." +msgid "" +"Return the dictionary object that implements *module*'s namespace; this " +"object is the same as the :attr:`~object.__dict__` attribute of the module " +"object. If *module* is not a module object (or a subtype of a module " +"object), :exc:`SystemError` is raised and ``NULL`` is returned." msgstr "" +"شیء دیکشنری‌ای را که فضای نام *module* را پیاده‌سازی می‌کند برمی‌گرداند؛ این" +" شیء همان ویژگی :attr:`~object.__dict__` شیء ماژول است. اگر *module* یک شیء " +"ماژول (یا زیرنوعی از شیء ماژول) نباشد، :exc:`SystemError` برخاسته می‌شود و " +"``NULL`` بازگردانده می‌شود." -msgid "It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` functions rather than directly manipulate a module's :attr:`~object.__dict__`." +msgid "" +"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " +"functions rather than directly manipulate a module's " +":attr:`~object.__dict__`." msgstr "" +"توصیه می‌شود ماژول‌های توسعه‌ای به‌جای دست‌کاری مستقیم " +":attr:`~object.__dict__` یک ماژول، از سایر توابع ``PyModule_*`` و " +"``PyObject_*`` استفاده کنند." -msgid "The returned reference is borrowed from the module; it is valid until the module is destroyed." +msgid "" +"The returned reference is borrowed from the module; it is valid until the " +"module is destroyed." msgstr "" +"ارجاع بازگردانده‌شده، ارجاعی امانتی از ماژول است؛ این ارجاع تا زمانی که " +"ماژول نابود شود معتبر است." -msgid "Return *module*'s :attr:`~module.__name__` value. If the module does not provide one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is returned." +msgid "" +"Return *module*'s :attr:`~module.__name__` value. If the module does not " +"provide one, or if it is not a string, :exc:`SystemError` is raised and " +"``NULL`` is returned." msgstr "" +"مقدار :attr:`~module.__name__` *module* را برمی‌گرداند. اگر ماژول آن را " +"ارائه نکند یا اگر رشته نباشد، استثنای :exc:`SystemError` مطرح می‌شود و " +"``NULL`` برگردانده می‌شود." -msgid "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to ``'utf-8'``." +msgid "" +"Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " +"``'utf-8'``." msgstr "" +"مشابه :c:func:`PyModule_GetNameObject` است، اما نام را با کدگذاری " +"``'utf-8'`` برمی‌گرداند." -msgid "The returned buffer is only valid until the module is renamed or destroyed. Note that Python code may rename a module by setting its :py:attr:`~module.__name__` attribute." +msgid "" +"The returned buffer is only valid until the module is renamed or destroyed. " +"Note that Python code may rename a module by setting its " +":py:attr:`~module.__name__` attribute." msgstr "" +"بافر بازگشتی تنها تا زمانی معتبر است که نام ماژول تغییر کند یا ماژول نابود " +"شود. توجه داشته باشید که کد پایتون می‌تواند نام یک ماژول را با تنظیم ویژگی " +":py:attr:`~module.__name__` آن تغییر دهد." -msgid "Return the \"state\" of the module, that is, a pointer to the block of memory allocated at module creation time, or ``NULL``. See :c:member:`PyModuleDef.m_size`." +msgid "" +"Return the \"state\" of the module, that is, a pointer to the block of " +"memory allocated at module creation time, or ``NULL``. See " +":c:member:`PyModuleDef.m_size`." msgstr "" +"«وضعیت» ماژول را برمی‌گرداند، یعنی اشاره‌گری به بلوک حافظه‌ای که در زمان " +"ایجاد ماژول تخصیص یافته است، یا ``NULL``. :c:member:`PyModuleDef.m_size` را " +"ببینید." -msgid "Return a pointer to the :c:type:`PyModuleDef` struct from which the module was created, or ``NULL`` if the module wasn't created from a definition." +msgid "" +"Return a pointer to the :c:type:`PyModuleDef` struct from which the module " +"was created, or ``NULL`` if the module wasn't created from a definition." msgstr "" +"اشاره‌گر به ساختار :c:type:`PyModuleDef` که ماژول از آن ایجاد شده است را " +"برمی‌گرداند، یا ``NULL`` اگر ماژول از یک تعریف ایجاد نشده باشد." -msgid "On error, return ``NULL`` with an exception set. Use :c:func:`PyErr_Occurred` to tell this case apart from a missing :c:type:`!PyModuleDef`." +msgid "" +"On error, return ``NULL`` with an exception set. Use " +":c:func:`PyErr_Occurred` to tell this case apart from a missing " +":c:type:`!PyModuleDef`." msgstr "" +"در صورت خطا، ``NULL`` را همراه با استثنای تنظیم‌شده برگردانید. از " +":c:func:`PyErr_Occurred` برای تمایز این حالت از نبود :c:type:`!PyModuleDef` " +"استفاده کنید." -msgid "Return the name of the file from which *module* was loaded using *module*'s :attr:`~module.__file__` attribute. If this is not defined, or if it is not a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a reference to a Unicode object." +msgid "" +"Return the name of the file from which *module* was loaded using *module*'s " +":attr:`~module.__file__` attribute. If this is not defined, or if it is not" +" a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a " +"reference to a Unicode object." msgstr "" +"نام پرونده‌ای را که *module* از آن بارگذاری شده است، با استفاده از ویژگی " +":attr:`~module.__file__` مربوط به *module* برمی‌گرداند. اگر این ویژگی تعریف " +"نشده باشد یا رشته نباشد، استثنای :exc:`SystemError` را مطرح می‌کند و " +"``NULL`` برمی‌گرداند؛ در غیر این صورت، ارجاعی به یک شیء یونیکد برمی‌گرداند." -msgid "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename encoded to 'utf-8'." +msgid "" +"Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " +"encoded to 'utf-8'." msgstr "" +"مشابه :c:func:`PyModule_GetFilenameObject` است، اما نام پرونده را با کدگذاری" +" 'utf-8' برمی‌گرداند." -msgid "The returned buffer is only valid until the module's :py:attr:`~module.__file__` attribute is reassigned or the module is destroyed." +msgid "" +"The returned buffer is only valid until the module's " +":py:attr:`~module.__file__` attribute is reassigned or the module is " +"destroyed." msgstr "" +"بافر بازگشتی تنها تا زمانی معتبر است که ویژگی :py:attr:`~module.__file__` " +"ماژول دوباره مقداردهی شود یا ماژول نابود شود." -msgid ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." +msgid "" +":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " +"unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" +":c:func:`PyModule_GetFilename` برای نام‌های پرونده‌ی غیرقابل کدگذاری، " +"استثنای :exc:`UnicodeEncodeError` را مطرح می‌کند؛ به‌جای آن از " +":c:func:`PyModule_GetFilenameObject` استفاده کنید." msgid "Module definitions" -msgstr "" +msgstr "تعریف‌های ماژول" -msgid "The functions in the previous section work on any module object, including modules imported from Python code." +msgid "" +"The functions in the previous section work on any module object, including " +"modules imported from Python code." msgstr "" +"توابع بخش قبلی روی هر شیء ماژول کار می‌کنند، از جمله ماژول‌هایی که از کد " +"پایتون ایمپورت شده‌اند." -msgid "Modules defined using the C API typically use a *module definition*, :c:type:`PyModuleDef` -- a statically allocated, constant “description\" of how a module should be created." +msgid "" +"Modules defined using the C API typically use a *module definition*, " +":c:type:`PyModuleDef` -- a statically allocated, constant “description\" of " +"how a module should be created." msgstr "" +"ماژول‌هایی که با استفاده از C API تعریف می‌شوند، معمولاً از یک *تعریف " +"ماژول*، :c:type:`PyModuleDef`، استفاده می‌کنند -- یک «توصیف» ثابت و " +"تخصیص‌یافته به‌صورت ایستا از چگونگی ایجاد یک ماژول." -msgid "The definition is usually used to define an extension's “main” module object (see :ref:`extension-modules` for details). It is also used to :ref:`create extension modules dynamically `." +msgid "" +"The definition is usually used to define an extension's “main” module object" +" (see :ref:`extension-modules` for details). It is also used to :ref:`create" +" extension modules dynamically `." msgstr "" +"این تعریف معمولاً برای تعریف شیء ماژول «اصلی» یک ماژول توسعه‌ای استفاده " +"می‌شود (برای جزئیات به :ref:`extension-modules` مراجعه کنید). همچنین برای " +":ref:`ایجاد ماژول‌های توسعه‌ای به‌صورت پویا ` استفاده " +"می‌شود." -msgid "Unlike :c:func:`PyModule_New`, the definition allows management of *module state* -- a piece of memory that is allocated and cleared together with the module object. Unlike the module's Python attributes, Python code cannot replace or delete data stored in module state." +msgid "" +"Unlike :c:func:`PyModule_New`, the definition allows management of *module " +"state* -- a piece of memory that is allocated and cleared together with the " +"module object. Unlike the module's Python attributes, Python code cannot " +"replace or delete data stored in module state." msgstr "" +"برخلاف :c:func:`PyModule_New`، این تعریف امکان مدیریت *وضعیت ماژول* را فراهم" +" می‌کند -- تکه‌ای از حافظه که همراه با شیء ماژول تخصیص داده و پاک‌سازی " +"می‌شود. برخلاف ویژگی‌های پایتونیِ ماژول، کد پایتون نمی‌تواند داده‌های " +"ذخیره‌شده در وضعیت ماژول را جایگزین یا حذف کند." -msgid "The module definition struct, which holds all information needed to create a module object. This structure must be statically allocated (or be otherwise guaranteed to be valid while any modules created from it exist). Usually, there is only one variable of this type for each extension module." +msgid "" +"The module definition struct, which holds all information needed to create a" +" module object. This structure must be statically allocated (or be otherwise" +" guaranteed to be valid while any modules created from it exist). Usually, " +"there is only one variable of this type for each extension module." msgstr "" +"ساختار تعریف ماژول که تمام اطلاعات مورد نیاز برای ایجاد یک شیء ماژول را در " +"خود نگه می‌دارد. این ساختار باید به‌صورت ایستا تخصیص داده شود (یا به نحوی " +"تضمین شود که تا زمانی که هر یک از ماژول‌های ایجاد‌شده از روی آن وجود دارد، " +"معتبر بماند). معمولاً برای هر ماژول توسعه‌ای تنها یک متغیر از این نوع وجود " +"دارد." msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "" +"این عضو را همیشه به :c:macro:`PyModuleDef_HEAD_INIT` مقداردهی اولیه کنید." msgid "Name for the new module." -msgstr "" +msgstr "نام ماژول جدید." -msgid "Docstring for the module; usually a docstring variable created with :c:macro:`PyDoc_STRVAR` is used." +msgid "" +"Docstring for the module; usually a docstring variable created with " +":c:macro:`PyDoc_STRVAR` is used." msgstr "" +"رشته مستند ماژول؛ معمولاً از متغیر رشته مستند ایجاد‌شده با " +":c:macro:`PyDoc_STRVAR` استفاده می‌شود." -msgid "Module state may be kept in a per-module memory area that can be retrieved with :c:func:`PyModule_GetState`, rather than in static globals. This makes modules safe for use in multiple sub-interpreters." +msgid "" +"Module state may be kept in a per-module memory area that can be retrieved " +"with :c:func:`PyModule_GetState`, rather than in static globals. This makes " +"modules safe for use in multiple sub-interpreters." msgstr "" +"وضعیت ماژول می‌تواند به‌جای متغیرهای سراسری ایستا، در ناحیه حافظه‌ی مخصوص هر" +" ماژول نگهداری شود که می‌توان آن را با :c:func:`PyModule_GetState` بازیابی " +"کرد. این کار باعث می‌شود ماژول‌ها برای استفاده در چندین زیرمفسر ایمن باشند." -msgid "This memory area is allocated based on *m_size* on module creation, and freed when the module object is deallocated, after the :c:member:`~PyModuleDef.m_free` function has been called, if present." +msgid "" +"This memory area is allocated based on *m_size* on module creation, and " +"freed when the module object is deallocated, after the " +":c:member:`~PyModuleDef.m_free` function has been called, if present." msgstr "" +"این ناحیه حافظه هنگام ایجاد ماژول بر اساس *m_size* تخصیص داده می‌شود و هنگام" +" تخصیص‌زدایی شیء ماژول، پس از فراخوانی تابع :c:member:`~PyModuleDef.m_free` " +"(در صورت وجود)، آزاد می‌شود." -msgid "Setting it to a non-negative value means that the module can be re-initialized and specifies the additional amount of memory it requires for its state." +msgid "" +"Setting it to a non-negative value means that the module can be re-" +"initialized and specifies the additional amount of memory it requires for " +"its state." msgstr "" +"تنظیم آن به یک مقدار نامنفی به این معناست که ماژول می‌تواند مجدداً مقداردهی " +"اولیه شود و میزان حافظه‌ی اضافی مورد نیاز برای وضعیت خود را مشخص می‌کند." -msgid "Setting ``m_size`` to ``-1`` means that the module does not support sub-interpreters, because it has global state. Negative ``m_size`` is only allowed when using :ref:`legacy single-phase initialization ` or when :ref:`creating modules dynamically `." +msgid "" +"Setting ``m_size`` to ``-1`` means that the module does not support sub-" +"interpreters, because it has global state. Negative ``m_size`` is only " +"allowed when using :ref:`legacy single-phase initialization ` or when :ref:`creating modules dynamically `." msgstr "" +"تنظیم ``m_size`` روی ``-1`` به این معنی است که ماژول از زیرمفسرها پشتیبانی " +"نمی‌کند، زیرا دارای وضعیت سراسری است. مقدار منفی ``m_size`` تنها هنگام " +"استفاده از :ref:`راه‌اندازی تک‌فازی قدیمی ` یا " +"هنگام :ref:`ایجاد ماژول‌ها به‌صورت پویا ` مجاز است." msgid "See :PEP:`3121` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر به :PEP:`3121` مراجعه کنید." -msgid "A pointer to a table of module-level functions, described by :c:type:`PyMethodDef` values. Can be ``NULL`` if no functions are present." +msgid "" +"A pointer to a table of module-level functions, described by " +":c:type:`PyMethodDef` values. Can be ``NULL`` if no functions are present." msgstr "" +"اشاره‌گری به جدولی از توابع در سطح ماژول که توسط مقادیر " +":c:type:`PyMethodDef` توصیف می‌شوند. اگر هیچ تابعی وجود نداشته باشد، " +"می‌تواند ``NULL`` باشد." -msgid "An array of slot definitions for multi-phase initialization, terminated by a ``{0, NULL}`` entry. When using legacy single-phase initialization, *m_slots* must be ``NULL``." +msgid "" +"An array of slot definitions for multi-phase initialization, terminated by a" +" ``{0, NULL}`` entry. When using legacy single-phase initialization, " +"*m_slots* must be ``NULL``." msgstr "" +"آرایه‌ای از تعریف‌های جایگاه برای مقداردهی اولیه چندمرحله‌ای که با ورودی " +"``{0, NULL}`` پایان می‌یابد. هنگام استفاده از مقداردهی اولیه تک‌مرحله‌ای " +"قدیمی، *m_slots* باید ``NULL`` باشد." -msgid "Prior to version 3.5, this member was always set to ``NULL``, and was defined as:" +msgid "" +"Prior to version 3.5, this member was always set to ``NULL``, and was " +"defined as:" msgstr "" +"پیش از نسخه 3.5، این عضو همیشه روی ``NULL`` تنظیم می‌شد و به این صورت تعریف " +"می‌شد:" -msgid "A traversal function to call during GC traversal of the module object, or ``NULL`` if not needed." +msgid "" +"A traversal function to call during GC traversal of the module object, or " +"``NULL`` if not needed." msgstr "" +"تابع پیمایشی که در حین پیمایش شیء ماژول توسط GC فراخوانی می‌شود، یا ``NULL``" +" در صورت عدم نیاز." -msgid "This function is not called if the module state was requested but is not allocated yet. This is the case immediately after the module is created and before the module is executed (:c:data:`Py_mod_exec` function). More precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module state (as returned by :c:func:`PyModule_GetState`) is ``NULL``." -msgstr "" +msgid "" +"This function is not called if the module state was requested but is not " +"allocated yet. This is the case immediately after the module is created and " +"before the module is executed (:c:data:`Py_mod_exec` function). More " +"precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is" +" greater than 0 and the module state (as returned by " +":c:func:`PyModule_GetState`) is ``NULL``." +msgstr "" +"این تابع در صورتی فراخوانی نمی‌شود که وضعیت ماژول درخواست شده باشد اما هنوز " +"تخصیص داده نشده باشد. این حالت بلافاصله پس از ایجاد ماژول و پیش از اجرای " +"ماژول (تابع :c:data:`Py_mod_exec`) برقرار است. دقیق‌تر آنکه، این تابع در " +"صورتی فراخوانی نمی‌شود که :c:member:`~PyModuleDef.m_size` بزرگ‌تر از ۰ باشد " +"و وضعیت ماژول (همان‌طور که :c:func:`PyModule_GetState` برمی‌گرداند) برابر " +"``NULL`` باشد." msgid "No longer called before the module state is allocated." -msgstr "" +msgstr "دیگر پیش از تخصیص وضعیت ماژول فراخوانی نمی‌شود." -msgid "A clear function to call during GC clearing of the module object, or ``NULL`` if not needed." +msgid "" +"A clear function to call during GC clearing of the module object, or " +"``NULL`` if not needed." msgstr "" +"تابعی برای پاک‌سازی که در حین پاک‌سازی زباله‌روبی (GC) شیء ماژول فراخوانی " +"می‌شود، یا ``NULL`` در صورت عدم نیاز." -msgid "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called before a module is deallocated. For example, when reference counting is enough to determine that an object is no longer used, the cyclic garbage collector is not involved and :c:member:`~PyModuleDef.m_free` is called directly." +msgid "" +"Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called" +" before a module is deallocated. For example, when reference counting is " +"enough to determine that an object is no longer used, the cyclic garbage " +"collector is not involved and :c:member:`~PyModuleDef.m_free` is called " +"directly." msgstr "" +"مانند :c:member:`PyTypeObject.tp_clear`، این تابع *همیشه* پیش از آزادسازی یک" +" ماژول فراخوانی نمی‌شود. برای مثال، وقتی شمارش ارجاع برای تعیین اینکه یک شیء" +" دیگر استفاده نمی‌شود کافی باشد، زباله‌روب چرخه‌ای دخالتی ندارد و " +":c:member:`~PyModuleDef.m_free` مستقیماً فراخوانی می‌شود." -msgid "A function to call during deallocation of the module object, or ``NULL`` if not needed." +msgid "" +"A function to call during deallocation of the module object, or ``NULL`` if " +"not needed." msgstr "" +"تابعی که هنگام آزادسازی شیء ماژول فراخوانی می‌شود، یا ``NULL`` در صورت عدم " +"نیاز." msgid "The type of ``PyModuleDef`` objects." -msgstr "" +msgstr "نوع اشیاء ``PyModuleDef``." msgid "Module slots" -msgstr "" +msgstr "جایگاه‌های ماژول" msgid "A slot ID, chosen from the available values explained below." msgstr "" +"شناسه‌ی جایگاه، که از میان مقادیر موجود توضیح‌داده‌شده در ادامه انتخاب " +"می‌شود." msgid "Value of the slot, whose meaning depends on the slot ID." -msgstr "" +msgstr "مقدار جایگاه، که معنای آن به شناسه جایگاه بستگی دارد." msgid "The available slot types are:" -msgstr "" +msgstr "انواع جایگاه‌های موجود عبارت‌اند از:" -msgid "Specifies a function that is called to create the module object itself. The *value* pointer of this slot must point to a function of the signature:" +msgid "" +"Specifies a function that is called to create the module object itself. The " +"*value* pointer of this slot must point to a function of the signature:" msgstr "" +"تابعی را مشخص می‌کند که برای ایجاد خودِ شیء ماژول فراخوانی می‌شود. اشاره‌گر " +"*value* این جایگاه باید به تابعی با امضای زیر اشاره کند:" -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``." +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 "" +"این تابع یک نمونه‌ی :py:class:`~importlib.machinery.ModuleSpec` را که در " +":PEP:`451` تعریف شده است، و تعریف ماژول را دریافت می‌کند. این تابع باید یک " +"شیء ماژول جدید برگرداند، یا خطا را تنظیم کرده و ``NULL`` را برگرداند." -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." +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 "" +"این تابع باید در حداقل ممکن نگه داشته شود. به‌ویژه، نباید کد دلخواه پایتون " +"را فراخوانی کند، زیرا تلاش برای ایمپورت کردن مجدد همان ماژول ممکن است به " +"حلقه بی‌نهایت منجر شود." -msgid "Multiple ``Py_mod_create`` slots may not be specified in one module definition." -msgstr "" +msgid "" +"Multiple ``Py_mod_create`` slots may not be specified in one module " +"definition." +msgstr "نمی‌توان چند جایگاه ``Py_mod_create`` را در یک تعریف ماژول مشخص کرد." -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 *spec*, not the definition, to allow extension modules to dynamically adjust to their place in the module hierarchy and be imported under different names through symlinks, all while sharing a single module definition." -msgstr "" +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 " +"*spec*, not the definition, to allow extension modules to dynamically adjust" +" to their place in the module hierarchy and be imported under different " +"names through symlinks, all while sharing a single module definition." +msgstr "" +"اگر ``Py_mod_create`` مشخص نشده باشد، مکانیزم ایمپورت با استفاده از " +":c:func:`PyModule_New` یک شیء ماژول معمولی ایجاد می‌کند. نام از *مشخصه* " +"گرفته می‌شود، نه از تعریف، تا ماژول‌های توسعه‌ای بتوانند به‌طور پویا با " +"جایگاه خود در سلسله‌مراتب ماژول سازگار شوند و از طریق پیوندهای نمادین با " +"نام‌های مختلف ایمپورت شوند، در حالی که همگی یک تعریف ماژول واحد را به اشتراک" +" می‌گذارند." -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 getting import-related attributes. However, only ``PyModule_Type`` instances may be returned if the ``PyModuleDef`` has non-``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; non-zero ``m_size``; or slots other than ``Py_mod_create``." -msgstr "" +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 getting import-related attributes. However, only " +"``PyModule_Type`` instances may be returned if the ``PyModuleDef`` has " +"non-``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; non-zero ``m_size``; " +"or slots other than ``Py_mod_create``." +msgstr "" +"هیچ الزامی وجود ندارد که شیء بازگردانده‌شده نمونه‌ای از " +":c:type:`PyModule_Type` باشد. می‌توان از هر نوعی استفاده کرد، به شرط آنکه از" +" تنظیم و دریافت ویژگی‌های مرتبط با ایمپورت پشتیبانی کند. با این حال، تنها " +"نمونه‌های ``PyModule_Type`` را می‌توان بازگرداند اگر ``PyModuleDef`` دارای " +"``m_traverse``، ``m_clear`` و ``m_free`` غیر``NULL``؛ ``m_size`` غیرصفر؛ یا " +"جایگاه‌هایی غیر از ``Py_mod_create`` باشد." -msgid "Specifies a function that is called to *execute* the module. This is equivalent to executing the code of a Python module: typically, this function adds classes and constants to the module. The signature of the function is:" +msgid "" +"Specifies a function that is called to *execute* the module. This is " +"equivalent to executing the code of a Python module: typically, this " +"function adds classes and constants to the module. The signature of the " +"function is:" msgstr "" +"تابعی را مشخص می‌کند که برای *اجرا* کردن ماژول فراخوانی می‌شود. این معادل " +"اجرای کد یک ماژول پایتون است: به‌طور معمول، این تابع کلاس‌ها و ثابت‌ها را به" +" ماژول اضافه می‌کند. امضای تابع به این صورت است:" -msgid "If multiple ``Py_mod_exec`` slots are specified, they are processed in the order they appear in the *m_slots* array." +msgid "" +"If multiple ``Py_mod_exec`` slots are specified, they are processed in the " +"order they appear in the *m_slots* array." msgstr "" +"اگر چندین جایگاه ``Py_mod_exec`` مشخص شده باشند، به ترتیبی که در آرایه " +"*m_slots* ظاهر شده‌اند پردازش می‌شوند." msgid "Specifies one of the following values:" -msgstr "" +msgstr "یکی از مقادیر زیر را مشخص می‌کند:" msgid "The module does not support being imported in subinterpreters." msgstr "" +"این ماژول از ایمپورت شدن در زیرمفسرها (subinterpreters) پشتیبانی نمی‌کند." -msgid "The module supports being imported in subinterpreters, but only when they share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" +msgid "" +"The module supports being imported in subinterpreters, but only when they " +"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" +"این ماژول از ایمپورت شدن در زیرمفسرها پشتیبانی می‌کند، اما تنها زمانی که " +"آن‌ها قفل مفسر سراسری (GIL) مفسر اصلی را به اشتراک بگذارند. (به " +":ref:`isolating-extensions-howto` مراجعه کنید.)" -msgid "The module supports being imported in subinterpreters, even when they have their own GIL. (See :ref:`isolating-extensions-howto`.)" +msgid "" +"The module supports being imported in subinterpreters, even when they have " +"their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" +"این ماژول از ایمپورت شدن در زیرمفسرها پشتیبانی می‌کند، حتی زمانی که آن‌ها " +"قفل مفسر سراسری خود را دارند. (به :ref:`isolating-extensions-howto` مراجعه " +"کنید.)" -msgid "This slot determines whether or not importing this module in a subinterpreter will fail." +msgid "" +"This slot determines whether or not importing this module in a " +"subinterpreter will fail." msgstr "" +"این جایگاه تعیین می‌کند که آیا ایمپورت کردن این ماژول در یک زیرمفسر شکست " +"می‌خورد یا خیر." -msgid "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one module definition." +msgid "" +"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " +"module definition." msgstr "" +"نمی‌توان چند جایگاه ``Py_mod_multiple_interpreters`` در یک تعریف ماژول مشخص " +"کرد." -msgid "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." +msgid "" +"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." msgstr "" +"اگر ``Py_mod_multiple_interpreters`` مشخص نشده باشد، سازوکار ایمپورت به‌صورت" +" پیش‌فرض از ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED`` استفاده می‌کند." -msgid "The module depends on the presence of the global interpreter lock (GIL), and may access global state without synchronization." +msgid "" +"The module depends on the presence of the global interpreter lock (GIL), and" +" may access global state without synchronization." msgstr "" +"این ماژول به وجود قفل مفسر سراسری (GIL) وابسته است و ممکن است بدون " +"همگام‌سازی به وضعیت سراسری دسترسی داشته باشد." msgid "The module is safe to run without an active GIL." -msgstr "" +msgstr "اجرای این ماژول بدون قفل مفسر سراسریِ فعال، ایمن است." -msgid "This slot is ignored by Python builds not configured with :option:`--disable-gil`. Otherwise, it determines whether or not importing this module will cause the GIL to be automatically enabled. See :ref:`whatsnew313-free-threaded-cpython` for more detail." +msgid "" +"This slot is ignored by Python builds not configured with " +":option:`--disable-gil`. Otherwise, it determines whether or not importing " +"this module will cause the GIL to be automatically enabled. See " +":ref:`whatsnew313-free-threaded-cpython` for more detail." msgstr "" +"این جایگاه توسط بیلدهای پایتون که با :option:`--disable-gil` پیکربندی " +"نشده‌اند نادیده گرفته می‌شود. در غیر این صورت، تعیین می‌کند که آیا ایمپورت " +"کردن این ماژول باعث می‌شود قفل مفسر سراسری (GIL) به‌طور خودکار فعال شود یا " +"خیر. برای جزئیات بیشتر به :ref:`whatsnew313-free-threaded-cpython` مراجعه " +"کنید." -msgid "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." -msgstr "" +msgid "" +"Multiple ``Py_mod_gil`` slots may not be specified in one module definition." +msgstr "تعیین چند جایگاه ``Py_mod_gil`` در یک تعریف ماژول مجاز نیست." -msgid "If ``Py_mod_gil`` is not specified, the import machinery defaults to ``Py_MOD_GIL_USED``." +msgid "" +"If ``Py_mod_gil`` is not specified, the import machinery defaults to " +"``Py_MOD_GIL_USED``." msgstr "" +"اگر ``Py_mod_gil`` مشخص نشده باشد، سازوکار ایمپورت به‌طور پیش‌فرض از " +"``Py_MOD_GIL_USED`` استفاده می‌کند." msgid "Creating extension modules dynamically" -msgstr "" +msgstr "ایجاد ماژول‌های توسعه‌ای به‌صورت پویا" -msgid "The following functions may be used to create a module outside of an extension's :ref:`initialization function `. They are also used in :ref:`single-phase initialization `." +msgid "" +"The following functions may be used to create a module outside of an " +"extension's :ref:`initialization function `. They are" +" also used in :ref:`single-phase initialization `." msgstr "" +"از توابع زیر می‌توان برای ایجاد یک ماژول خارج از :ref:`تابع مقداردهی اولیه " +"` یک ماژول توسعه‌ای استفاده کرد. این توابع در " +":ref:`مقداردهی اولیه تک‌فازی ` نیز به کار " +"می‌روند." -msgid "Create a new module object, given the definition in *def*. This is a macro that calls :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:`PYTHON_API_VERSION`, or to :c:macro:`PYTHON_ABI_VERSION` if using the :ref:`limited API `." +msgid "" +"Create a new module object, given the definition in *def*. This is a macro " +"that calls :c:func:`PyModule_Create2` with *module_api_version* set to " +":c:macro:`PYTHON_API_VERSION`, or to :c:macro:`PYTHON_ABI_VERSION` if using " +"the :ref:`limited API `." msgstr "" +"بر اساس تعریف داده‌شده در *def*، یک شیء ماژول جدید ایجاد می‌کند. این یک " +"ماکرو است که :c:func:`PyModule_Create2` را با *module_api_version* برابر با " +":c:macro:`PYTHON_API_VERSION`، یا در صورت استفاده از :ref:`API محدود " +"` برابر با :c:macro:`PYTHON_ABI_VERSION`، فراخوانی می‌کند." -msgid "Create a new module object, given the definition in *def*, assuming the API version *module_api_version*. If that version does not match the version of the running interpreter, a :exc:`RuntimeWarning` is emitted." +msgid "" +"Create a new module object, given the definition in *def*, assuming the API " +"version *module_api_version*. If that version does not match the version of" +" the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" +"یک شیء ماژول جدید، بر اساس تعریف موجود در *def* و با فرض نسخه API " +"*module_api_version*، ایجاد می‌کند. اگر این نسخه با نسخه مفسر در حال اجرا " +"مطابقت نداشته باشد، یک :exc:`RuntimeWarning` صادر می‌شود." -msgid "This function does not support slots. The :c:member:`~PyModuleDef.m_slots` member of *def* must be ``NULL``." +msgid "" +"This function does not support slots. The :c:member:`~PyModuleDef.m_slots` " +"member of *def* must be ``NULL``." msgstr "" +"این تابع از جایگاه‌ها پشتیبانی نمی‌کند. عضو :c:member:`~PyModuleDef.m_slots`" +" از *def* باید ``NULL`` باشد." -msgid "Most uses of this function should be using :c:func:`PyModule_Create` instead; only use this if you are sure you need it." +msgid "" +"Most uses of this function should be using :c:func:`PyModule_Create` " +"instead; only use this if you are sure you need it." msgstr "" +"در بیشتر موارد، به جای این تابع باید از :c:func:`PyModule_Create` استفاده " +"شود؛ تنها زمانی از آن استفاده کنید که مطمئن باشید به آن نیاز دارید." -msgid "This macro calls :c:func:`PyModule_FromDefAndSpec2` with *module_api_version* set to :c:macro:`PYTHON_API_VERSION`, or to :c:macro:`PYTHON_ABI_VERSION` if using the :ref:`limited API `." +msgid "" +"This macro calls :c:func:`PyModule_FromDefAndSpec2` with " +"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`, or to " +":c:macro:`PYTHON_ABI_VERSION` if using the :ref:`limited API `." msgstr "" +"این ماکرو :c:func:`PyModule_FromDefAndSpec2` را با *module_api_version* " +"تنظیم‌شده روی :c:macro:`PYTHON_API_VERSION`، یا روی " +":c:macro:`PYTHON_ABI_VERSION` در صورت استفاده از :ref:`API محدود ` فراخوانی می‌کند." -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 not match the version of the running interpreter, a :exc:`RuntimeWarning` is emitted." +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" +" not match the version of the running interpreter, a :exc:`RuntimeWarning` " +"is emitted." msgstr "" +"با توجه به تعریف موجود در *def* و ModuleSpec *spec*، و با فرض نسخه API " +"*module_api_version*، یک شیء ماژول جدید ایجاد می‌کند. اگر آن نسخه با نسخه " +"مفسر در حال اجرا مطابقت نداشته باشد، یک :exc:`RuntimeWarning` منتشر می‌شود." -msgid "Note that this does not process execution slots (:c:data:`Py_mod_exec`). Both ``PyModule_FromDefAndSpec`` and ``PyModule_ExecDef`` must be called to fully initialize a module." +msgid "" +"Note that this does not process execution slots (:c:data:`Py_mod_exec`). " +"Both ``PyModule_FromDefAndSpec`` and ``PyModule_ExecDef`` must be called to " +"fully initialize a module." msgstr "" +"توجه داشته باشید که این، جایگاه‌های اجرا (:c:data:`Py_mod_exec`) را پردازش " +"نمی‌کند. برای مقداردهی اولیه‌ی کامل یک ماژول، باید هر دو " +"``PyModule_FromDefAndSpec`` و ``PyModule_ExecDef`` فراخوانی شوند." -msgid "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` instead; only use this if you are sure you need it." +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:func:`PyModule_FromDefAndSpec` " +"استفاده کرد؛ تنها در صورتی از این تابع استفاده کنید که مطمئن باشید به آن " +"نیاز دارید." msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" +"پردازش هر جایگاه اجرا (:c:data:`Py_mod_exec`) که در *def* داده شده است." msgid "The C API version. Defined for backwards compatibility." -msgstr "" +msgstr "نسخه‌ی C API. برای سازگاری با نسخه‌های پیشین تعریف‌شده است." -msgid "Currently, this constant is not updated in new Python versions, and is not useful for versioning. This may change in the future." +msgid "" +"Currently, this constant is not updated in new Python versions, and is not " +"useful for versioning. This may change in the future." msgstr "" +"در حال حاضر، این ثابت در نسخه‌های جدید پایتون به‌روزرسانی نمی‌شود و برای " +"نسخه‌بندی مفید نیست. این ممکن است در آینده تغییر کند." msgid "Defined as ``3`` for backwards compatibility." -msgstr "" +msgstr "برای سازگاری با نسخه‌های پیشین به‌صورت ``3`` تعریف‌شده است." msgid "Support functions" -msgstr "" +msgstr "توابع پشتیبانی" -msgid "The following functions are provided to help initialize a module state. They are intended for a module's execution slots (:c:data:`Py_mod_exec`), the initialization function for legacy :ref:`single-phase initialization `, or code that creates modules dynamically." +msgid "" +"The following functions are provided to help initialize a module state. They" +" are intended for a module's execution slots (:c:data:`Py_mod_exec`), the " +"initialization function for legacy :ref:`single-phase initialization " +"`, or code that creates modules dynamically." msgstr "" +"تابع‌های زیر برای کمک به مقداردهی اولیه وضعیت یک ماژول ارائه شده‌اند. این " +"توابع برای جایگاه‌های اجرای یک ماژول (:c:data:`Py_mod_exec`)، تابع مقداردهی " +"اولیه برای :ref:`مقداردهی اولیه تک‌مرحله‌ای ` " +"قدیمی، یا کدی که ماژول‌ها را به‌صورت پویا ایجاد می‌کند، در نظر گرفته " +"شده‌اند." -msgid "Add an object to *module* as *name*. This is a convenience function which can be used from the module's initialization function." +msgid "" +"Add an object to *module* as *name*. This is a convenience function which " +"can be used from the module's initialization function." msgstr "" +"یک شیء را با نام *name* به *module* اضافه می‌کند. این تابع برای راحتی کار " +"فراهم شده و می‌توان از آن در تابع مقداردهی اولیه‌ی ماژول استفاده کرد." -msgid "On success, return ``0``. On error, raise an exception and return ``-1``." +msgid "" +"On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" +"در صورت موفقیت، ``0`` را برمی‌گرداند. در صورت خطا، یک استثنا ایجاد می‌کند " +"(raise) و ``-1`` را برمی‌گرداند." msgid "Example usage::" -msgstr "" +msgstr "نمونه استفاده::" msgid "" "static int\n" @@ -300,12 +687,32 @@ msgid "" " return res;\n" " }" msgstr "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" if (obj == NULL) {\n" +" return -1;\n" +" }\n" +" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" +" Py_DECREF(obj);\n" +" return res;\n" +" }" -msgid "To be convenient, the function accepts ``NULL`` *value* with an exception set. In this case, return ``-1`` and just leave the raised exception unchanged." +msgid "" +"To be convenient, the function accepts ``NULL`` *value* with an exception " +"set. In this case, return ``-1`` and just leave the raised exception " +"unchanged." msgstr "" +"برای سهولت، تابع *مقدار* ``NULL`` را همراه با استثنای تنظیم‌شده می‌پذیرد. در" +" این حالت، ``-1`` را برگردانید و استثنای ایجادشده را دست‌نخورده بگذارید." -msgid "The example can also be written without checking explicitly if *obj* is ``NULL``::" +msgid "" +"The example can also be written without checking explicitly if *obj* is " +"``NULL``::" msgstr "" +"این مثال را می‌توان بدون بررسی صریح اینکه آیا *obj* برابر ``NULL`` است یا نه" +" نیز نوشت::" msgid "" "static int\n" @@ -317,33 +724,87 @@ msgid "" " return res;\n" " }" msgstr "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" +" Py_XDECREF(obj);\n" +" return res;\n" +" }" -msgid "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this case, since *obj* can be ``NULL``." +msgid "" +"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this" +" case, since *obj* can be ``NULL``." msgstr "" +"توجه داشته باشید که در این مورد باید از ``Py_XDECREF()`` به جای " +"``Py_DECREF()`` استفاده شود، زیرا *obj* می‌تواند ``NULL`` باشد." -msgid "The number of different *name* strings passed to this function should be kept small, usually by only using statically allocated strings as *name*. For names that aren't known at compile time, prefer calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more details, see :c:func:`PyUnicode_InternFromString`, which may be used internally to create a key object." -msgstr "" +msgid "" +"The number of different *name* strings passed to this function should be " +"kept small, usually by only using statically allocated strings as *name*. " +"For names that aren't known at compile time, prefer calling " +":c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For " +"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " +"internally to create a key object." +msgstr "" +"تعداد رشته‌های *name* متفاوتی که به این تابع پاس داده می‌شوند باید کم نگه " +"داشته شود؛ این کار معمولاً با استفاده فقط از رشته‌های با تخصیص ایستا " +"به‌عنوان *name* انجام می‌شود. برای نام‌هایی که در زمان کامپایل معلوم نیستند،" +" ترجیح دهید :c:func:`PyUnicode_FromString` و :c:func:`PyObject_SetAttr` را " +"مستقیماً فراخوانی کنید. برای جزئیات بیشتر، " +":c:func:`PyUnicode_InternFromString` را ببینید که ممکن است به‌طور داخلی برای" +" ایجاد یک شیء کلید استفاده شود." -msgid "Similar to :c:func:`PyModule_AddObjectRef`, but \":term:`steals `\" a reference to *value* (even on error). It can be called with a result of function that returns a new reference without bothering to check its result or even saving it to a variable." +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but \":term:`steals `\" a" +" reference to *value* (even on error). It can be called with a result of " +"function that returns a new reference without bothering to check its result " +"or even saving it to a variable." msgstr "" +"مشابه :c:func:`PyModule_AddObjectRef`، اما ارجاعی به *value* را " +"\":term:`می‌دزدد `\" (حتی در صورت خطا). می‌توان آن را با نتیجه‌ی " +"تابعی که ارجاع جدیدی برمی‌گرداند فراخوانی کرد، بدون نیاز به بررسی نتیجه‌ی آن" +" یا حتی ذخیره‌ی آن در متغیری." msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" +"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" +" goto error;\n" +"}" -msgid "Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals ` a reference to *value* on success (if it returns ``0``)." +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals ` a " +"reference to *value* on success (if it returns ``0``)." msgstr "" +"مشابه :c:func:`PyModule_AddObjectRef` است، اما در صورت موفقیت (اگر ``0`` را " +"برگرداند) ارجاع به *value* را :term:`می‌دزدد `." -msgid "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions are recommended, since it is easy to introduce reference leaks by misusing the :c:func:`PyModule_AddObject` function." +msgid "" +"The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " +"are recommended, since it is easy to introduce reference leaks by misusing " +"the :c:func:`PyModule_AddObject` function." msgstr "" +"استفاده از توابع جدید :c:func:`PyModule_Add` یا " +":c:func:`PyModule_AddObjectRef` توصیه می‌شود، زیرا استفاده نادرست از تابع " +":c:func:`PyModule_AddObject` به‌راحتی می‌تواند منجر به نشتی ارجاع شود." -msgid "Unlike other functions that steal references, ``PyModule_AddObject()`` only releases the reference to *value* **on success**." +msgid "" +"Unlike other functions that steal references, ``PyModule_AddObject()`` only " +"releases the reference to *value* **on success**." msgstr "" +"برخلاف سایر توابعی که ارجاع‌ها را می‌دزدند، ``PyModule_AddObject()`` ارجاع " +"به *value* را تنها **در صورت موفقیت** آزاد می‌کند." -msgid "This means that its return value must be checked, and calling code must :c:func:`Py_XDECREF` *value* manually on error." +msgid "" +"This means that its return value must be checked, and calling code must " +":c:func:`Py_XDECREF` *value* manually on error." msgstr "" +"این بدان معناست که مقدار بازگشتی آن باید بررسی شود و کد فراخواننده باید در " +"صورت خطا، :c:func:`Py_XDECREF` را به‌صورت دستی روی *value* فراخوانی کند." msgid "" "PyObject *obj = PyBytes_FromString(value);\n" @@ -357,105 +818,264 @@ msgid "" "// PyModule_AddObject() stole a reference to obj:\n" "// Py_XDECREF(obj) is not needed here." msgstr "" +"PyObject *obj = PyBytes_FromString(value);\n" +"if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" +" // If 'obj' is not NULL and PyModule_AddObject() failed,\n" +" // 'obj' strong reference must be deleted with Py_XDECREF().\n" +" // If 'obj' is NULL, Py_XDECREF() does nothing.\n" +" Py_XDECREF(obj);\n" +" goto error;\n" +"}\n" +"// PyModule_AddObject() stole a reference to obj:\n" +"// Py_XDECREF(obj) is not needed here." -msgid "Add an integer constant to *module* as *name*. This convenience function can be used from the module's initialization function. Return ``-1`` with an exception set on error, ``0`` on success." +msgid "" +"Add an integer constant to *module* as *name*. This convenience function " +"can be used from the module's initialization function. Return ``-1`` with an" +" exception set on error, ``0`` on success." msgstr "" +"یک ثابت عدد صحیح را با نام *name* به *module* اضافه می‌کند. می‌توان از این " +"تابع راحتی در تابع مقداردهی اولیه‌ی ماژول استفاده کرد. در صورت خطا، ``-1`` " +"همراه با تنظیم یک استثنا و در صورت موفقیت ``0`` برمی‌گرداند." -msgid "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:func:`PyModule_AddObjectRef`; see their documentation for details." +msgid "" +"This is a convenience function that calls :c:func:`PyLong_FromLong` and " +":c:func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" +"این یک تابع راحتی است که :c:func:`PyLong_FromLong` و " +":c:func:`PyModule_AddObjectRef` را فراخوانی می‌کند؛ برای جزئیات به مستندات " +"آن‌ها مراجعه کنید." -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`` with an exception set on error, ``0`` on success." +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`` with an exception set on error, ``0`` " +"on success." msgstr "" +"یک ثابت رشته‌ای را با نام *name* به *module* اضافه می‌کند. از این تابع راحتی" +" می‌توان در تابع مقداردهی اولیه‌ی ماژول استفاده کرد. رشته‌ی *value* باید با " +"``NULL`` پایان یابد. در صورت خطا ``-1`` همراه با تنظیم یک استثنا، و در صورت " +"موفقیت ``0`` برمی‌گرداند." -msgid "This is a convenience function that calls :c:func:`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their documentation for details." +msgid "" +"This is a convenience function that calls " +":c:func:`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; " +"see their documentation for details." msgstr "" +"این یک تابع راحتی است که :c:func:`PyUnicode_InternFromString` و " +":c:func:`PyModule_AddObjectRef` را فراخوانی می‌کند؛ برای جزئیات به مستندات " +"آن‌ها مراجعه کنید." -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 constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` with an exception set on error, ``0`` on success." +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 " +"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` " +"with an exception set on error, ``0`` on success." msgstr "" +"یک ثابت صحیح به *module* اضافه می‌کند. نام و مقدار از *macro* گرفته می‌شوند." +" برای مثال، ``PyModule_AddIntMacro(module, AF_INET)`` ثابت صحیح *AF_INET* را" +" با مقدار *AF_INET* به *module* اضافه می‌کند. در صورت خطا ``-1`` همراه با " +"تنظیم یک استثنا و در صورت موفقیت ``0`` را برمی‌گرداند." msgid "Add a string constant to *module*." -msgstr "" +msgstr "افزودن یک ثابت رشته‌ای به *module*." -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 the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return ``-1`` with an exception set on error, ``0`` on success." +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" +" the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return " +"``-1`` with an exception set on error, ``0`` on success." msgstr "" +"یک شیء نوع به *module* اضافه می‌کند. شیء نوع با فراخوانی داخلی " +":c:func:`PyType_Ready` نهایی‌سازی می‌شود. نام شیء نوع از آخرین جزء " +":c:member:`~PyTypeObject.tp_name` پس از نقطه گرفته می‌شود. در صورت خطا " +"``-1`` همراه با یک استثنای تنظیم‌شده و در صورت موفقیت ``0`` برمی‌گرداند." -msgid "Add the functions from the ``NULL`` terminated *functions* array to *module*. Refer to the :c:type:`PyMethodDef` documentation for details on individual entries (due to the lack of a shared module namespace, module level \"functions\" implemented in C typically receive the module as their first parameter, making them similar to instance methods on Python classes)." -msgstr "" +msgid "" +"Add the functions from the ``NULL`` terminated *functions* array to " +"*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " +"individual entries (due to the lack of a shared module namespace, module " +"level \"functions\" implemented in C typically receive the module as their " +"first parameter, making them similar to instance methods on Python classes)." +msgstr "" +"تابع‌ها را از آرایه‌ی *functions* که با ``NULL`` پایان می‌یابد به *module* " +"اضافه می‌کند. برای جزئیات مربوط به ورودی‌های منفرد به مستندات " +":c:type:`PyMethodDef` مراجعه کنید (به دلیل نبود فضای نام ماژول مشترک، " +"«توابع» سطح ماژول که در C پیاده‌سازی می‌شوند معمولاً ماژول را به‌عنوان " +"نخستین پارامتر خود دریافت می‌کنند که این امر آن‌ها را مشابه متدهای نمونه در " +"کلاس‌های پایتون می‌سازد)." -msgid "This function is called automatically when creating a module from ``PyModuleDef`` (such as when using :ref:`multi-phase-initialization`, ``PyModule_Create``, or ``PyModule_FromDefAndSpec``). Some module authors may prefer defining functions in multiple :c:type:`PyMethodDef` arrays; in that case they should call this function directly." -msgstr "" +msgid "" +"This function is called automatically when creating a module from " +"``PyModuleDef`` (such as when using :ref:`multi-phase-initialization`, " +"``PyModule_Create``, or ``PyModule_FromDefAndSpec``). Some module authors " +"may prefer defining functions in multiple :c:type:`PyMethodDef` arrays; in " +"that case they should call this function directly." +msgstr "" +"این تابع هنگام ایجاد یک ماژول از ``PyModuleDef`` (مانند زمانی که از " +":ref:`multi-phase-initialization`، ``PyModule_Create`` یا " +"``PyModule_FromDefAndSpec`` استفاده می‌شود) به‌طور خودکار فراخوانی می‌شود. " +"برخی از نویسندگان ماژول ممکن است ترجیح دهند توابع را در چندین آرایه‌ی " +":c:type:`PyMethodDef` تعریف کنند؛ در این صورت باید این تابع را مستقیماً " +"فراخوانی کنند." -msgid "The *functions* array must be statically allocated (or otherwise guaranteed to outlive the module object)." +msgid "" +"The *functions* array must be statically allocated (or otherwise guaranteed " +"to outlive the module object)." msgstr "" +"آرایه‌ی *functions* باید به‌صورت ایستا تخصیص داده شود (یا به نحوی دیگر تضمین" +" شود که عمرش از شیء ماژول طولانی‌تر باشد)." -msgid "Set the docstring for *module* to *docstring*. This function is called automatically when creating a module from ``PyModuleDef`` (such as when using :ref:`multi-phase-initialization`, ``PyModule_Create``, or ``PyModule_FromDefAndSpec``)." +msgid "" +"Set the docstring for *module* to *docstring*. This function is called " +"automatically when creating a module from ``PyModuleDef`` (such as when " +"using :ref:`multi-phase-initialization`, ``PyModule_Create``, or " +"``PyModule_FromDefAndSpec``)." msgstr "" +"رشته مستند *module* را به *docstring* تنظیم می‌کند. این تابع هنگام ایجاد " +"ماژول از روی ``PyModuleDef`` (مانند زمان استفاده از :ref:`multi-phase-" +"initialization`، ``PyModule_Create`` یا ``PyModule_FromDefAndSpec``) به‌طور " +"خودکار فراخوانی می‌شود." msgid "Return ``0`` on success. Return ``-1`` with an exception set on error." msgstr "" +"در صورت موفقیت ``0`` را برمی‌گرداند. در صورت خطا ``-1`` همراه با تنظیم یک " +"استثنا برمی‌گرداند." -msgid "Indicate that *module* does or does not support running without the global interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. It must be called during *module*'s initialization function when using :ref:`single-phase-initialization`. If this function is not called during module initialization, the import machinery assumes the module does not support running without the GIL. This function is only available in Python builds configured with :option:`--disable-gil`. Return ``-1`` with an exception set on error, ``0`` on success." -msgstr "" +msgid "" +"Indicate that *module* does or does not support running without the global " +"interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " +"It must be called during *module*'s initialization function when using " +":ref:`single-phase-initialization`. If this function is not called during " +"module initialization, the import machinery assumes the module does not " +"support running without the GIL. This function is only available in Python " +"builds configured with :option:`--disable-gil`. Return ``-1`` with an " +"exception set on error, ``0`` on success." +msgstr "" +"با استفاده از یکی از مقادیر :c:macro:`Py_mod_gil` نشان می‌دهد که *module* از" +" اجرا بدون قفل مفسر سراسری (GIL) پشتیبانی می‌کند یا نمی‌کند. هنگام استفاده " +"از :ref:`single-phase-initialization`، این تابع باید در طول تابع مقدار‌دهی " +"اولیه‌ی *module* فراخوانی شود. اگر این تابع در طول مقدار‌دهی اولیه ماژول " +"فراخوانی نشود، سازوکار ایمپورت فرض می‌کند که ماژول از اجرا بدون GIL پشتیبانی" +" نمی‌کند. این تابع فقط در بیلدهای پایتون که با :option:`--disable-gil` " +"پیکربندی شده‌اند در دسترس است. در صورت خطا ``-1`` را همراه با تنظیم یک " +"استثنا و در صورت موفقیت ``0`` را برمی‌گرداند." msgid "Module lookup (single-phase initialization)" -msgstr "" +msgstr "جستجوی ماژول (مقداردهی اولیه تک‌فازی)" -msgid "The legacy :ref:`single-phase initialization ` initialization scheme 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." +msgid "" +"The legacy :ref:`single-phase initialization ` " +"initialization scheme 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 "" +"طرح مقداردهی اولیه‌ی :ref:`مقداردهی اولیه تک‌مرحله‌ای ` قدیمی، ماژول‌های تک‌نمونه ایجاد می‌کند که می‌توان آن‌ها را " +"در زمینه‌ی مفسر جاری جستجو کرد. این امکان را فراهم می‌کند که شیء ماژول بعداً" +" تنها با یک ارجاع به تعریف ماژول بازیابی شود." -msgid "These functions will not work on modules created using multi-phase initialization, since multiple such modules can be created from a single definition." +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 "" +"این توابع روی ماژول‌هایی که با استفاده از مقداردهی اولیه چندمرحله‌ای (multi-" +"phase initialization) ایجاد شده‌اند کار نخواهند کرد، زیرا می‌توان چندین " +"ماژول از این نوع را از یک تعریف واحد ایجاد کرد." -msgid "Returns the module object that was created from *def* for the current interpreter. This method requires that the module object has been attached to the interpreter state with :c:func:`PyState_AddModule` beforehand. In case the corresponding module object is not found or has not been attached to the interpreter state yet, it returns ``NULL``." +msgid "" +"Returns the module object that was created from *def* for the current " +"interpreter. This method requires that the module object has been attached " +"to the interpreter state with :c:func:`PyState_AddModule` beforehand. In " +"case the corresponding module object is not found or has not been attached " +"to the interpreter state yet, it returns ``NULL``." msgstr "" +"شیء ماژولی که از *def* برای مفسر فعلی ایجاد شده است را برمی‌گرداند. این متد " +"مستلزم آن است که شیء ماژول از قبل با :c:func:`PyState_AddModule` به وضعیت " +"مفسر متصل شده باشد. در صورتی که شیء ماژول مربوطه یافت نشود یا هنوز به وضعیت " +"مفسر متصل نشده باشد، ``NULL`` را برمی‌گرداند." -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`." +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:func:`PyState_FindModule` را فراهم می‌کند." msgid "Only effective on modules created using single-phase initialization." msgstr "" +"تنها بر ماژول‌هایی که با استفاده از مقداردهی اولیه تک‌مرحله‌ای ایجاد شده‌اند" +" مؤثر است." -msgid "Python calls ``PyState_AddModule`` automatically after importing a module that uses :ref:`single-phase initialization `, so it is unnecessary (but harmless) to call it from module initialization code. An explicit call is needed only if the module's own init code subsequently calls ``PyState_FindModule``. The function is mainly intended for implementing alternative import mechanisms (either by calling it directly, or by referring to its implementation for details of the required state updates)." -msgstr "" +msgid "" +"Python calls ``PyState_AddModule`` automatically after importing a module " +"that uses :ref:`single-phase initialization `, " +"so it is unnecessary (but harmless) to call it from module initialization " +"code. An explicit call is needed only if the module's own init code " +"subsequently calls ``PyState_FindModule``. The function is mainly intended " +"for implementing alternative import mechanisms (either by calling it " +"directly, or by referring to its implementation for details of the required " +"state updates)." +msgstr "" +"پایتون پس از ایمپورت کردن ماژولی که از :ref:`راه‌اندازی تک‌فازی ` استفاده می‌کند، ``PyState_AddModule`` را به‌طور " +"خودکار فراخوانی می‌کند؛ بنابراین فراخوانی آن از کد راه‌اندازی ماژول ضروری " +"نیست (اما بی‌ضرر است). تنها در صورتی به فراخوانی صریح آن نیاز است که کد " +"راه‌اندازی خودِ ماژول در ادامه ``PyState_FindModule`` را فراخوانی کند. این " +"تابع عمدتاً برای پیاده‌سازی سازوکارهای ایمپورت جایگزین در نظر گرفته شده است " +"(چه با فراخوانی مستقیم آن، چه با مراجعه به پیاده‌سازی آن برای جزئیات " +"به‌روزرسانی‌های وضعیت موردنیاز)." -msgid "If a module was attached previously using the same *def*, it is replaced by the new *module*." +msgid "" +"If a module was attached previously using the same *def*, it is replaced by " +"the new *module*." msgstr "" +"اگر پیش‌تر ماژولی با استفاده از همان *def* پیوست شده باشد، با *module* جدید " +"جایگزین می‌شود." msgid "The caller must have an :term:`attached thread state`." -msgstr "" +msgstr "فراخوان‌کننده باید یک :term:`attached thread state` داشته باشد." msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" +"در صورت خطا، ``-1`` همراه با استثنای تنظیم‌شده و در صورت موفقیت ``0`` " +"برمی‌گرداند." -msgid "Removes the module object created from *def* from the interpreter state. Return ``-1`` with an exception set on error, ``0`` on success." +msgid "" +"Removes the module object created from *def* from the interpreter state. " +"Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" +"شیء ماژول ایجادشده از *def* را از وضعیت مفسر حذف می‌کند. در صورت خطا ``-1`` " +"همراه با استثنای تنظیم‌شده و در صورت موفقیت ``0`` برمی‌گرداند." msgid "object" -msgstr "" +msgstr "شیء" msgid "module" -msgstr "" +msgstr "ماژول" msgid "ModuleType (in module types)" -msgstr "" +msgstr "ModuleType (در ماژول types)" msgid "__name__ (module attribute)" -msgstr "" +msgstr "__name__ (ویژگی ماژول)" msgid "__doc__ (module attribute)" -msgstr "" +msgstr "__doc__ (ویژگی ماژول)" msgid "__file__ (module attribute)" -msgstr "" +msgstr "__file__ (ویژگی ماژول)" msgid "__package__ (module attribute)" -msgstr "" +msgstr "__package__ (ویژگی ماژول)" msgid "__loader__ (module attribute)" -msgstr "" +msgstr "__loader__ (ویژگی ماژول)" msgid "__dict__ (module attribute)" -msgstr "" +msgstr "__dict__ (ویژگی ماژول)" msgid "SystemError (built-in exception)" -msgstr "" +msgstr "SystemError (استثنای توکار)" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index 5f394e5b3..97235ce54 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -24,166 +24,292 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Monitoring C API" -msgstr "" +msgstr "API پایش C" msgid "Added in version 3.13." -msgstr "" +msgstr "در نسخه 3.13 افزوده شد." -msgid "An extension may need to interact with the event monitoring system. Subscribing to events and registering callbacks can be done via the Python API exposed in :mod:`sys.monitoring`." +msgid "" +"An extension may need to interact with the event monitoring system. " +"Subscribing to events and registering callbacks can be done via the Python " +"API exposed in :mod:`sys.monitoring`." msgstr "" +"یک ماژول توسعه‌ای ممکن است نیاز به تعامل با سامانه پایش رویدادها داشته باشد." +" اشتراک در رویدادها و ثبت کال‌بک‌ها را می‌توان از طریق API پایتون ارائه‌شده " +"در :mod:`sys.monitoring` انجام داد." msgid "Generating Execution Events" -msgstr "" +msgstr "تولید رویدادهای اجرا" -msgid "The functions below make it possible for an extension to fire monitoring events as it emulates the execution of Python code. Each of these functions accepts a ``PyMonitoringState`` struct which contains concise information about the activation state of events, as well as the event arguments, which include a ``PyObject*`` representing the code object, the instruction offset and sometimes additional, event-specific arguments (see :mod:`sys.monitoring` for details about the signatures of the different event callbacks). The ``codelike`` argument should be an instance of :class:`types.CodeType` or of a type that emulates it." -msgstr "" +msgid "" +"The functions below make it possible for an extension to fire monitoring " +"events as it emulates the execution of Python code. Each of these functions " +"accepts a ``PyMonitoringState`` struct which contains concise information " +"about the activation state of events, as well as the event arguments, which " +"include a ``PyObject*`` representing the code object, the instruction offset" +" and sometimes additional, event-specific arguments (see " +":mod:`sys.monitoring` for details about the signatures of the different " +"event callbacks). The ``codelike`` argument should be an instance of " +":class:`types.CodeType` or of a type that emulates it." +msgstr "" +"توابع زیر این امکان را فراهم می‌کنند که یک ماژول توسعه‌ای بتواند هنگام " +"شبیه‌سازی اجرای کد پایتون، رویدادهای پایش را ایجاد کند. هر یک از این توابع " +"یک ساختار ``PyMonitoringState`` را می‌پذیرد که اطلاعات مختصری درباره‌ی وضعیت" +" فعال‌سازی رویدادها و همچنین آرگومان‌های رویداد را در بر دارد؛ این " +"آرگومان‌ها شامل یک ``PyObject*`` که نمایانگر شیء کد است، آفست دستورالعمل و " +"گاهی آرگومان‌های اضافی خاص رویداد هستند (برای جزئیات درباره‌ی امضاهای " +"کال‌بک‌های مختلف رویداد به :mod:`sys.monitoring` مراجعه کنید). آرگومان " +"``codelike`` باید نمونه‌ای از :class:`types.CodeType` یا از نوعی باشد که آن " +"را شبیه‌سازی می‌کند." -msgid "The VM disables tracing when firing an event, so there is no need for user code to do that." +msgid "" +"The VM disables tracing when firing an event, so there is no need for user " +"code to do that." msgstr "" +"ماشین مجازی هنگام فعال‌سازی رویداد، ردگیری را غیر‌فعال می‌کند، بنابراین " +"نیازی نیست که کد کاربر این کار را انجام دهد." -msgid "Monitoring functions should not be called with an exception set, except those listed below as working with the current exception." +msgid "" +"Monitoring functions should not be called with an exception set, except " +"those listed below as working with the current exception." msgstr "" +"توابع نظارت نباید در حالی که استثنایی تنظیم شده است فراخوانی شوند، به‌جز " +"مواردی که در ادامه به‌عنوان توابعی که با استثنای جاری کار می‌کنند فهرست " +"شده‌اند." -msgid "Representation of the state of an event type. It is allocated by the user while its contents are maintained by the monitoring API functions described below." +msgid "" +"Representation of the state of an event type. It is allocated by the user " +"while its contents are maintained by the monitoring API functions described " +"below." msgstr "" +"بازنمایی وضعیت یک نوع رویداد. آن توسط کاربر تخصیص داده می‌شود، در حالی که " +"محتویات آن توسط توابع API پایش که در ادامه توضیح داده شده‌اند، نگهداری " +"می‌شود." -msgid "All of the functions below return 0 on success and -1 (with an exception set) on error." +msgid "" +"All of the functions below return 0 on success and -1 (with an exception " +"set) on error." msgstr "" +"تمام توابع زیر در صورت موفقیت 0 و در صورت خطا -1 (همراه با تنظیم استثنا) را " +"برمی‌گردانند." msgid "See :mod:`sys.monitoring` for descriptions of the events." -msgstr "" +msgstr "برای توضیحات رویدادها به :mod:`sys.monitoring` مراجعه کنید." msgid "Fire a ``PY_START`` event." -msgstr "" +msgstr "رویداد ``PY_START`` را فعال می‌کند." msgid "Fire a ``PY_RESUME`` event." -msgstr "" +msgstr "رویداد ``PY_RESUME`` را فعال می‌کند." msgid "Fire a ``PY_RETURN`` event." -msgstr "" +msgstr "رویداد ``PY_RETURN`` فعال می‌شود." msgid "Fire a ``PY_YIELD`` event." -msgstr "" +msgstr "رویداد ``PY_YIELD`` را فعال می‌کند." msgid "Fire a ``CALL`` event." -msgstr "" +msgstr "رویداد ``CALL`` را صادر می‌کند." msgid "Fire a ``LINE`` event." -msgstr "" +msgstr "رویداد ``LINE`` فعال می‌شود." msgid "Fire a ``JUMP`` event." -msgstr "" +msgstr "رویداد ``JUMP`` فعال می‌شود." msgid "Fire a ``BRANCH_LEFT`` event." -msgstr "" +msgstr "رویداد ``BRANCH_LEFT`` را فعال کنید." msgid "Fire a ``BRANCH_RIGHT`` event." -msgstr "" +msgstr "رویداد ``BRANCH_RIGHT`` را فعال کنید." msgid "Fire a ``C_RETURN`` event." -msgstr "" +msgstr "رویداد ``C_RETURN`` فعال می‌شود." -msgid "Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire a ``PY_THROW`` event with the current exception (as returned by " +":c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``PY_THROW`` را با استثنای فعلی (همان‌طور که " +":c:func:`PyErr_GetRaisedException` برمی‌گرداند) فعال می‌کند." -msgid "Fire a ``RAISE`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire a ``RAISE`` event with the current exception (as returned by " +":c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``RAISE`` به همراه استثنای فعلی (همان‌طور که توسط " +":c:func:`PyErr_GetRaisedException` برگردانده می‌شود) شلیک می‌شود." -msgid "Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire a ``C_RAISE`` event with the current exception (as returned by " +":c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``C_RAISE`` را همراه با استثنای فعلی (همان‌طور که توسط " +":c:func:`PyErr_GetRaisedException` برگردانده می‌شود) فعال می‌کند." -msgid "Fire a ``RERAISE`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire a ``RERAISE`` event with the current exception (as returned by " +":c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``RERAISE`` را با استثنای فعلی (که توسط " +":c:func:`PyErr_GetRaisedException` برگردانده می‌شود) صادر می‌کند." -msgid "Fire an ``EXCEPTION_HANDLED`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire an ``EXCEPTION_HANDLED`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``EXCEPTION_HANDLED`` را همراه با استثنای فعلی (که توسط " +":c:func:`PyErr_GetRaisedException` برگردانده می‌شود) فعال می‌کند." -msgid "Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:func:`PyErr_GetRaisedException`)." +msgid "" +"Fire a ``PY_UNWIND`` event with the current exception (as returned by " +":c:func:`PyErr_GetRaisedException`)." msgstr "" +"رویداد ``PY_UNWIND`` را با استثنای فعلی (همان‌طور که توسط " +":c:func:`PyErr_GetRaisedException` برگردانده می‌شود) فعال کنید." -msgid "Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` instance is created with ``value`` as its argument." +msgid "" +"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of " +":exc:`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` " +"instance is created with ``value`` as its argument." msgstr "" +"رویداد ``STOP_ITERATION`` را اجرا می‌کند. اگر ``value`` نمونه‌ای از " +":exc:`StopIteration` باشد، از آن استفاده می‌شود. در غیر این صورت، نمونه‌ی " +"جدیدی از :exc:`StopIteration` با ``value`` به‌عنوان آرگومان آن ایجاد می‌شود." msgid "Managing the Monitoring State" -msgstr "" +msgstr "مدیریت وضعیت پایش" -msgid "Monitoring states can be managed with the help of monitoring scopes. A scope would typically correspond to a Python function." +msgid "" +"Monitoring states can be managed with the help of monitoring scopes. A scope" +" would typically correspond to a Python function." msgstr "" +"وضعیت‌های نظارت را می‌توان با کمک محدوده‌های نظارت مدیریت کرد. یک محدوده " +"معمولاً متناظر با یک تابع پایتون است." -msgid "Enter a monitored scope. ``event_types`` is an array of the event IDs for events that may be fired from the scope. For example, the ID of a ``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is numerically equal to the base-2 logarithm of ``sys.monitoring.events.PY_START``. ``state_array`` is an array with a monitoring state entry for each event in ``event_types``, it is allocated by the user but populated by :c:func:`!PyMonitoring_EnterScope` with information about the activation state of the event. The size of ``event_types`` (and hence also of ``state_array``) is given in ``length``." -msgstr "" +msgid "" +"Enter a monitored scope. ``event_types`` is an array of the event IDs for " +"events that may be fired from the scope. For example, the ID of a " +"``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is " +"numerically equal to the base-2 logarithm of " +"``sys.monitoring.events.PY_START``. ``state_array`` is an array with a " +"monitoring state entry for each event in ``event_types``, it is allocated by" +" the user but populated by :c:func:`!PyMonitoring_EnterScope` with " +"information about the activation state of the event. The size of " +"``event_types`` (and hence also of ``state_array``) is given in ``length``." +msgstr "" +"ورود به یک محدوده‌ی پایش‌شده. ``event_types`` آرایه‌ای از شناسه‌های رویداد " +"برای رویدادهایی است که ممکن است از این محدوده رخ دهند. برای مثال، شناسه‌ی " +"رویداد ``PY_START`` مقدار ``PY_MONITORING_EVENT_PY_START`` است که از نظر " +"عددی با لگاریتم پایه ۲ ``sys.monitoring.events.PY_START`` برابر است. " +"``state_array`` آرایه‌ای است که برای هر رویداد در ``event_types`` یک ورودی " +"وضعیت پایش دارد؛ این آرایه توسط کاربر تخصیص داده می‌شود، اما توسط " +":c:func:`!PyMonitoring_EnterScope` با اطلاعاتی درباره‌ی وضعیت فعال‌سازی " +"رویداد پر می‌شود. اندازه‌ی ``event_types`` (و در نتیجه ``state_array`` نیز) " +"در ``length`` داده می‌شود." -msgid "The ``version`` argument is a pointer to a value which should be allocated by the user together with ``state_array`` and initialized to 0, and then set only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this function to determine whether event states have changed since the previous call, and to return quickly if they have not." -msgstr "" +msgid "" +"The ``version`` argument is a pointer to a value which should be allocated " +"by the user together with ``state_array`` and initialized to 0, and then set" +" only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this function " +"to determine whether event states have changed since the previous call, and " +"to return quickly if they have not." +msgstr "" +"آرگومان ``version`` اشاره‌گری به مقداری است که باید توسط کاربر همراه با " +"``state_array`` تخصیص داده شود و به 0 مقداردهی اولیه گردد، و سپس تنها توسط " +"خودِ :c:func:`!PyMonitoring_EnterScope` تنظیم شود. این به تابع امکان می‌دهد " +"تشخیص دهد که آیا وضعیت‌های رویداد از فراخوانی قبلی تغییر کرده‌اند یا خیر، و " +"در صورت عدم تغییر، به‌سرعت بازگردد." -msgid "The scopes referred to here are lexical scopes: a function, class or method. :c:func:`!PyMonitoring_EnterScope` should be called whenever the lexical scope is entered. Scopes can be reentered, reusing the same *state_array* and *version*, in situations like when emulating a recursive Python function. When a code-like's execution is paused, such as when emulating a generator, the scope needs to be exited and re-entered." -msgstr "" +msgid "" +"The scopes referred to here are lexical scopes: a function, class or method." +" :c:func:`!PyMonitoring_EnterScope` should be called whenever the lexical " +"scope is entered. Scopes can be reentered, reusing the same *state_array* " +"and *version*, in situations like when emulating a recursive Python " +"function. When a code-like's execution is paused, such as when emulating a " +"generator, the scope needs to be exited and re-entered." +msgstr "" +"محدوده‌هایی که در اینجا به آن‌ها اشاره می‌شود، محدوده‌های واژگانی هستند: یک " +"تابع، کلاس یا متد. هرگاه به محدوده واژگانی وارد می‌شود، باید " +":c:func:`!PyMonitoring_EnterScope` فراخوانی شود. در موقعیت‌هایی مانند هنگام " +"شبیه‌سازی یک تابع بازگشتی پایتون، می‌توان دوباره وارد محدوده‌ها شد و از همان" +" *state_array* و *version* استفاده مجدد کرد. هنگامی که اجرای یک شیء شبه‌کد " +"(code-like) متوقف می‌شود، مانند هنگام شبیه‌سازی یک تولیدگر، باید از محدوده " +"خارج و دوباره به آن وارد شد." msgid "The macros for *event_types* are:" -msgstr "" +msgstr "ماکروهای *event_types* عبارت‌اند از:" msgid "Macro" -msgstr "" +msgstr "ماکرو" msgid "Event" -msgstr "" +msgstr "رویداد" msgid ":monitoring-event:`BRANCH_LEFT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_LEFT`" msgid ":monitoring-event:`BRANCH_RIGHT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_RIGHT`" msgid ":monitoring-event:`CALL`" -msgstr "" +msgstr ":monitoring-event:`CALL`" msgid ":monitoring-event:`C_RAISE`" -msgstr "" +msgstr ":monitoring-event:`C_RAISE`" msgid ":monitoring-event:`C_RETURN`" -msgstr "" +msgstr ":monitoring-event:`C_RETURN`" msgid ":monitoring-event:`EXCEPTION_HANDLED`" -msgstr "" +msgstr ":monitoring-event:`EXCEPTION_HANDLED`" msgid ":monitoring-event:`INSTRUCTION`" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`" msgid ":monitoring-event:`JUMP`" -msgstr "" +msgstr ":monitoring-event:`JUMP`" msgid ":monitoring-event:`LINE`" -msgstr "" +msgstr ":monitoring-event:`LINE`" msgid ":monitoring-event:`PY_RESUME`" -msgstr "" +msgstr ":monitoring-event:`PY_RESUME`" msgid ":monitoring-event:`PY_RETURN`" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN`" msgid ":monitoring-event:`PY_START`" -msgstr "" +msgstr ":monitoring-event:`PY_START`" msgid ":monitoring-event:`PY_THROW`" -msgstr "" +msgstr ":monitoring-event:`PY_THROW`" msgid ":monitoring-event:`PY_UNWIND`" -msgstr "" +msgstr ":monitoring-event:`PY_UNWIND`" msgid ":monitoring-event:`PY_YIELD`" -msgstr "" +msgstr ":monitoring-event:`PY_YIELD`" msgid ":monitoring-event:`RAISE`" -msgstr "" +msgstr ":monitoring-event:`RAISE`" msgid ":monitoring-event:`RERAISE`" -msgstr "" +msgstr ":monitoring-event:`RERAISE`" msgid ":monitoring-event:`STOP_ITERATION`" -msgstr "" +msgstr ":monitoring-event:`STOP_ITERATION`" -msgid "Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." +msgid "" +"Exit the last scope that was entered with " +":c:func:`!PyMonitoring_EnterScope`." msgstr "" +"از آخرین محدوده‌ای که با :c:func:`!PyMonitoring_EnterScope` وارد شده بود، " +"خارج شوید." -msgid "Return true if the event corresponding to the event ID *ev* is a :ref:`local event `." +msgid "" +"Return true if the event corresponding to the event ID *ev* is a :ref:`local" +" event `." msgstr "" +"اگر رویداد متناظر با شناسه‌ی رویداد *ev* یک :ref:`رویداد محلی ` باشد، مقدار true برمی‌گرداند." diff --git a/c-api/none.po b/c-api/none.po index 068fa838a..bb9e146b3 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -24,22 +24,34 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "The ``None`` Object" -msgstr "" +msgstr "شیء ``None``" -msgid "Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in the Python/C API. Since ``None`` is a singleton, testing for object identity (using ``==`` in C) is sufficient. There is no :c:func:`!PyNone_Check` function for the same reason." -msgstr "" +msgid "" +"Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in" +" the Python/C API. Since ``None`` is a singleton, testing for object " +"identity (using ``==`` in C) is sufficient. There is no " +":c:func:`!PyNone_Check` function for the same reason." +msgstr "" +"توجه داشته باشید که :c:type:`PyTypeObject` مربوط به ``None`` به‌طور مستقیم " +"در Python/C API در دسترس قرار ندارد. از آنجا که ``None`` یک تک‌نمونه است، " +"بررسی همانی شیء (با استفاده از ``==`` در C) کافی است. به همین دلیل، تابع " +":c:func:`!PyNone_Check` وجود ندارد." -msgid "The Python ``None`` object, denoting lack of value. This object has no methods and is :term:`immortal`." +msgid "" +"The Python ``None`` object, denoting lack of value. This object has no " +"methods and is :term:`immortal`." msgstr "" +"شیء ``None`` در پایتون که نشان‌دهنده‌ی نبود مقدار است. این شیء هیچ متدی " +"ندارد و :term:`نامیرا ` است." msgid ":c:data:`Py_None` is :term:`immortal`." -msgstr "" +msgstr ":c:data:`Py_None` :term:`نامیرا ` است." msgid "Return :c:data:`Py_None` from a function." -msgstr "" +msgstr "بازگرداندن :c:data:`Py_None` از یک تابع." msgid "object" -msgstr "" +msgstr "شیء" msgid "None" -msgstr "" +msgstr "None" diff --git a/c-api/number.po b/c-api/number.po index b7834293f..f9dc5d7f2 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -23,145 +23,375 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Number Protocol" -msgstr "" +msgstr "پروتکل عدد" -msgid "Returns ``1`` if the object *o* provides numeric protocols, and false otherwise. This function always succeeds." +msgid "" +"Returns ``1`` if the object *o* provides numeric protocols, and false " +"otherwise. This function always succeeds." msgstr "" +"اگر شیء *o* پروتکل‌های عددی را فراهم کند، ``1`` بازمی‌گرداند و در غیر این " +"صورت نادرست. این تابع همیشه موفق می‌شود." msgid "Returns ``1`` if *o* is an index integer." -msgstr "" +msgstr "اگر *o* یک عدد صحیح اندیس باشد، ``1`` برمی‌گرداند." -msgid "Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 + o2``." +msgid "" +"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. This is" +" the equivalent of the Python expression ``o1 + o2``." msgstr "" +"نتیجه‌ی جمع *o1* و *o2* را برمی‌گرداند، یا در صورت شکست ``NULL`` " +"برمی‌گرداند. این معادل عبارت پایتونی ``o1 + o2`` است." -msgid "Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 - o2``." +msgid "" +"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 - o2``." msgstr "" +"نتیجه‌ی تفریق *o2* از *o1* را برمی‌گرداند، یا در صورت شکست ``NULL``. این " +"معادل عبارت پایتونی ``o1 - o2`` است." -msgid "Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 * o2``." +msgid "" +"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 * o2``." msgstr "" +"نتیجه‌ی ضرب *o1* و *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. این معادل" +" عبارت پایتونی ``o1 * o2`` است." -msgid "Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 @ o2``." +msgid "" +"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on" +" failure. This is the equivalent of the Python expression ``o1 @ o2``." msgstr "" +"نتیجه‌ی ضرب ماتریسی روی *o1* و *o2* را برمی‌گرداند، یا در صورت شکست " +"``NULL``. این معادل عبارت پایتونی ``o1 @ o2`` است." -msgid "Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 // o2``." +msgid "" +"Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is " +"the equivalent of the Python expression ``o1 // o2``." msgstr "" +"کف تقسیم *o1* بر *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. این معادل " +"عبارت پایتونی ``o1 // o2`` است." -msgid "Return a reasonable approximation for the mathematical value of *o1* divided by *o2*, or ``NULL`` on failure. The return value is \"approximate\" because binary floating-point numbers are approximate; it is not possible to represent all real numbers in base two. This function can return a floating-point value when passed two integers. This is the equivalent of the Python expression ``o1 / o2``." -msgstr "" +msgid "" +"Return a reasonable approximation for the mathematical value of *o1* divided" +" by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " +"because binary floating-point numbers are approximate; it is not possible to" +" represent all real numbers in base two. This function can return a " +"floating-point value when passed two integers. This is the equivalent of " +"the Python expression ``o1 / o2``." +msgstr "" +"تقریبی معقول از مقدار ریاضی *o1* تقسیم‌شده بر *o2* را برمی‌گرداند، یا در " +"صورت شکست ``NULL`` را برمی‌گرداند. مقدار بازگشتی «تقریبی» است، زیرا اعداد " +"ممیز شناور دودویی تقریبی‌اند؛ نمی‌توان همه‌ی اعداد حقیقی را در مبنای دو " +"نمایش داد. این تابع می‌تواند هنگام دریافت دو عدد صحیح، یک مقدار ممیز شناور " +"برگرداند. این معادل عبارت پایتونی ``o1 / o2`` است." -msgid "Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 % o2``." +msgid "" +"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``o1 % o2``." msgstr "" +"باقیمانده‌ی تقسیم *o1* بر *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. این" +" معادل عبارت پایتونی ``o1 % o2`` است." -msgid "See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This is the equivalent of the Python expression ``divmod(o1, o2)``." +msgid "" +"See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This" +" is the equivalent of the Python expression ``divmod(o1, o2)``." msgstr "" +"تابع توکار :func:`divmod` را ببینید. در صورت شکست ``NULL`` را برمی‌گرداند. " +"این معادل عبارت پایتونی ``divmod(o1, o2)`` است." -msgid "See the built-in function :func:`pow`. Returns ``NULL`` on failure. This is the equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is optional. If *o3* is to be ignored, pass :c:data:`Py_None` in its place (passing ``NULL`` for *o3* would cause an illegal memory access)." +msgid "" +"See the built-in function :func:`pow`. Returns ``NULL`` on failure. This is" +" the equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is " +"optional. If *o3* is to be ignored, pass :c:data:`Py_None` in its place " +"(passing ``NULL`` for *o3* would cause an illegal memory access)." msgstr "" +"به تابع توکار :func:`pow` مراجعه کنید. در صورت شکست، ``NULL`` برمی‌گرداند. " +"این معادل عبارت پایتونی ``pow(o1, o2, o3)`` است که در آن *o3* اختیاری است. " +"اگر قرار است *o3* نادیده گرفته شود، به جای آن :c:data:`Py_None` را ارسال " +"کنید (ارسال ``NULL`` برای *o3* باعث دسترسی غیرمجاز به حافظه می‌شود)." -msgid "Returns the negation of *o* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``-o``." +msgid "" +"Returns the negation of *o* on success, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``-o``." msgstr "" +"نفی *o* را در صورت موفقیت، یا ``NULL`` را در صورت شکست برمی‌گرداند. این " +"معادل عبارت پایتونی ``-o`` است." -msgid "Returns *o* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``+o``." +msgid "" +"Returns *o* on success, or ``NULL`` on failure. This is the equivalent of " +"the Python expression ``+o``." msgstr "" +"در صورت موفقیت *o* و در صورت شکست ``NULL`` را برمی‌گرداند. این معادل عبارت " +"پایتونی ``+o`` است." -msgid "Returns the absolute value of *o*, or ``NULL`` on failure. This is the equivalent of the Python expression ``abs(o)``." +msgid "" +"Returns the absolute value of *o*, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``abs(o)``." msgstr "" +"قدر مطلق *o* را برمی‌گرداند، یا در صورت شکست ``NULL``. این معادل عبارت " +"پایتونی ``abs(o)`` است." -msgid "Returns the bitwise negation of *o* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``~o``." +msgid "" +"Returns the bitwise negation of *o* on success, or ``NULL`` on failure. " +"This is the equivalent of the Python expression ``~o``." msgstr "" +"نقیض بیتی *o* را در صورت موفقیت و ``NULL`` را در صورت شکست برمی‌گرداند. این " +"معادل عبارت پایتونی ``~o`` است." -msgid "Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 << o2``." +msgid "" +"Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 << o2``." msgstr "" +"در صورت موفقیت، نتیجه‌ی شیفت به چپ *o1* به اندازه‌ی *o2* را برمی‌گرداند، یا " +"در صورت شکست ``NULL`` را برمی‌گرداند. این معادل عبارت پایتونی ``o1 << o2`` " +"است." -msgid "Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 >> o2``." +msgid "" +"Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on" +" failure. This is the equivalent of the Python expression ``o1 >> o2``." msgstr "" +"در صورت موفقیت، نتیجه‌ی شیفت به راست *o1* به اندازه‌ی *o2* را برمی‌گرداند و " +"در صورت شکست ``NULL``. این معادل عبارت پایتون ``o1 >> o2`` است." -msgid "Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on failure. This is the equivalent of the Python expression ``o1 & o2``." +msgid "" +"Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 & o2``." msgstr "" +"در صورت موفقیت، «وِ بیتی» *o1* و *o2* را و در صورت شکست ``NULL`` را " +"برمی‌گرداند. این معادل عبارت ``o1 & o2`` در پایتون است." -msgid "Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 ^ o2``." +msgid "" +"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL``" +" on failure. This is the equivalent of the Python expression ``o1 ^ o2``." msgstr "" +"در صورت موفقیت، «یای انحصاری بیتی» *o1* با *o2* را برمی‌گرداند و در صورت " +"شکست ``NULL`` را برمی‌گرداند. این معادل عبارت پایتونی ``o1 ^ o2`` است." -msgid "Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``o1 | o2``." +msgid "" +"Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 | o2``." msgstr "" +"در صورت موفقیت، «یا بیتی» *o1* و *o2* را برمی‌گرداند و در صورت شکست " +"``NULL``. این معادل عبارت پایتونی ``o1 | o2`` است." -msgid "Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 += o2``." +msgid "" +"Returns the result of adding *o1* and *o2*, or ``NULL`` on failure. The " +"operation is done *in-place* when *o1* supports it. This is the equivalent " +"of the Python statement ``o1 += o2``." msgstr "" +"حاصل جمع *o1* و *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. عملیات زمانی " +"به‌صورت *درجا* (in-place) انجام می‌شود که *o1* آن را پشتیبانی کند. این معادل" +" دستور پایتونی ``o1 += o2`` است." -msgid "Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 -= o2``." +msgid "" +"Returns the result of subtracting *o2* from *o1*, or ``NULL`` on failure. " +"The operation is done *in-place* when *o1* supports it. This is the " +"equivalent of the Python statement ``o1 -= o2``." msgstr "" +"نتیجه‌ی تفریق *o2* از *o1* را برمی‌گرداند، یا در صورت شکست ``NULL``. این " +"عملیات هنگامی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* انجام می‌شود. این " +"معادل دستور ``o1 -= o2`` در پایتون است." -msgid "Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 *= o2``." +msgid "" +"Returns the result of multiplying *o1* and *o2*, or ``NULL`` on failure. " +"The operation is done *in-place* when *o1* supports it. This is the " +"equivalent of the Python statement ``o1 *= o2``." msgstr "" +"نتیجه‌ی ضرب *o1* و *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. این عملیات" +" زمانی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* انجام می‌شود. این معادل " +"دستور ``o1 *= o2`` در پایتون است." -msgid "Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 @= o2``." +msgid "" +"Returns the result of matrix multiplication on *o1* and *o2*, or ``NULL`` on" +" failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 @= o2``." msgstr "" +"نتیجه‌ی ضرب ماتریسی روی *o1* و *o2* را برمی‌گرداند، یا در صورت شکست " +"``NULL``. این عملیات زمانی *درجا* انجام می‌شود که *o1* از آن پشتیبانی کند." +" این معادل دستور پایتونی ``o1 @= o2`` است." -msgid "Returns the mathematical floor of dividing *o1* by *o2*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 //= o2``." +msgid "" +"Returns the mathematical floor of dividing *o1* by *o2*, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 //= o2``." msgstr "" +"کف ریاضی تقسیم *o1* بر *o2* را برمی‌گرداند، یا در صورت شکاست ``NULL``. این " +"عملیات زمانی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* انجام می‌شود. این " +"معادل دستور پایتونی ``o1 //= o2`` است." -msgid "Return a reasonable approximation for the mathematical value of *o1* divided by *o2*, or ``NULL`` on failure. The return value is \"approximate\" because binary floating-point numbers are approximate; it is not possible to represent all real numbers in base two. This function can return a floating-point value when passed two integers. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 /= o2``." -msgstr "" +msgid "" +"Return a reasonable approximation for the mathematical value of *o1* divided" +" by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " +"because binary floating-point numbers are approximate; it is not possible to" +" represent all real numbers in base two. This function can return a " +"floating-point value when passed two integers. The operation is done *in-" +"place* when *o1* supports it. This is the equivalent of the Python statement" +" ``o1 /= o2``." +msgstr "" +"تقریب معقولی از مقدار ریاضیِ *o1* تقسیم بر *o2* را برمی‌گرداند، یا در صورت " +"شکست ``NULL``. مقدار بازگشتی «تقریبی» است زیرا اعداد ممیز شناور دودویی " +"تقریبی‌اند؛ نمی‌توان تمامی اعداد حقیقی را در مبنای دو نمایش داد. این تابع " +"می‌تواند هنگامی که دو عدد صحیح به آن داده شود، مقداری ممیز شناور برگرداند. " +"این عملیات در صورتی که *o1* از آن پشتیبانی کند، *درجا* انجام می‌شود. این " +"معادل دستور پایتونی ``o1 /= o2`` است." -msgid "Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 %= o2``." +msgid "" +"Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. The" +" operation is done *in-place* when *o1* supports it. This is the equivalent" +" of the Python statement ``o1 %= o2``." msgstr "" +"باقیمانده‌ی تقسیم *o1* بر *o2* را برمی‌گرداند، یا در صورت شکست ``NULL``. این" +" عملیات زمانی که *o1* از آن پشتیبانی کند، *درجا* انجام می‌شود. این معادل " +"دستور پایتونی ``o1 %= o2`` است." -msgid "See the built-in function :func:`pow`. Returns ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an in-place variant of ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, pass :c:data:`Py_None` in its place (passing ``NULL`` for *o3* would cause an illegal memory access)." -msgstr "" +msgid "" +"See the built-in function :func:`pow`. Returns ``NULL`` on failure. The " +"operation is done *in-place* when *o1* supports it. This is the equivalent " +"of the Python statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an " +"in-place variant of ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored," +" pass :c:data:`Py_None` in its place (passing ``NULL`` for *o3* would cause " +"an illegal memory access)." +msgstr "" +"تابع توکار :func:`pow` را ببینید. در صورت شکست، ``NULL`` را برمی‌گرداند. این" +" عملیات زمانی که *o1* از آن پشتیبانی کند، *درجا* انجام می‌شود. این معادل " +"دستور پایتونی ``o1 **= o2`` است وقتی که o3 برابر :c:data:`Py_None` باشد، یا " +"در غیر این صورت، گونه‌ی درجای ``pow(o1, o2, o3)`` است. اگر قرار باشد *o3* " +"نادیده گرفته شود، :c:data:`Py_None` را به‌جای آن پاس دهید (پاس دادن ``NULL``" +" برای *o3* باعث دسترسی غیرمجاز به حافظه خواهد شد)." -msgid "Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 <<= o2``." +msgid "" +"Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 <<= o2``." msgstr "" +"در صورت موفقیت، نتیجه‌ی شیفت به چپ *o1* به اندازه‌ی *o2* و در صورت شکست " +"``NULL`` را برمی‌گرداند. این عملیات در صورتی که *o1* از آن پشتیبانی کند، " +"به‌صورت *درجا* (in-place) انجام می‌شود. این معادل دستور ``o1 <<= o2`` در " +"پایتون است." -msgid "Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 >>= o2``." +msgid "" +"Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on" +" failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 >>= o2``." msgstr "" +"نتیجه‌ی شیفت به راست *o1* به میزان *o2* را در صورت موفقیت برمی‌گرداند و در " +"صورت شکست ``NULL`` را. این عملیات زمانی که *o1* از آن پشتیبانی کند، *درجا* " +"انجام می‌شود. این معادل دستور پایتون ``o1 >>= o2`` است." -msgid "Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 &= o2``." +msgid "" +"Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 &= o2``." msgstr "" +"در صورت موفقیت، «و بیتی» *o1* و *o2* را برمی‌گرداند و در صورت شکست ``NULL`` " +"برمی‌گرداند. این عملیات زمانی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* " +"انجام می‌شود. این معادل دستور پایتونی ``o1 &= o2`` است." -msgid "Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 ^= o2``." +msgid "" +"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL``" +" on failure. The operation is done *in-place* when *o1* supports it. This " +"is the equivalent of the Python statement ``o1 ^= o2``." msgstr "" +"در صورت موفقیت، «یای انحصاری بیتی» *o1* با *o2* را برمی‌گرداند و در صورت " +"شکست ``NULL``. این عملیات زمانی که *o1* از آن پشتیبانی کند، *درجا* انجام " +"می‌شود. این معادل دستور ``o1 ^= o2`` در پایتون است." -msgid "Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python statement ``o1 |= o2``." +msgid "" +"Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python statement ``o1 |= o2``." msgstr "" +"در صورت موفقیت، «یا بیتی» *o1* و *o2* و در صورت شکست ``NULL`` را " +"برمی‌گرداند. این عملیات هنگامی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* " +"انجام می‌شود. این معادل دستور پایتونی ``o1 |= o2`` است." -msgid "Returns the *o* converted to an integer object on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``int(o)``." +msgid "" +"Returns the *o* converted to an integer object on success, or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``int(o)``." msgstr "" +"در صورت موفقیت، *o* تبدیل‌شده به یک شیء عدد صحیح را بازمی‌گرداند، یا در صورت" +" شکست ``NULL`` را برمی‌گرداند. این معادل عبارت پایتونی ``int(o)`` است." -msgid "Returns the *o* converted to a float object on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``float(o)``." +msgid "" +"Returns the *o* converted to a float object on success, or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``float(o)``." msgstr "" +"در صورت موفقیت، *o* تبدیل‌شده به یک شیء اعشاری و در صورت شکست ``NULL`` را " +"برمی‌گرداند. این معادل عبارت پایتونی ``float(o)`` است." -msgid "Returns the *o* converted to a Python int on success or ``NULL`` with a :exc:`TypeError` exception raised on failure." +msgid "" +"Returns the *o* converted to a Python int on success or ``NULL`` with a " +":exc:`TypeError` exception raised on failure." msgstr "" +"در صورت موفقیت، *o* تبدیل‌شده به یک عدد صحیح پایتون را برمی‌گرداند و در صورت" +" شکست، ``NULL`` را همراه با ایجاد استثنای :exc:`TypeError` برمی‌گرداند." -msgid "The result always has exact type :class:`int`. Previously, the result could have been an instance of a subclass of ``int``." +msgid "" +"The result always has exact type :class:`int`. Previously, the result could" +" have been an instance of a subclass of ``int``." msgstr "" +"نتیجه همیشه دقیقاً از نوع :class:`int` است. پیش‌تر، نتیجه می‌توانست نمونه‌ای" +" از یک زیرکلاس از ``int`` باشد." -msgid "Returns the integer *n* converted to base *base* as a string. The *base* argument must be one of 2, 8, 10, or 16. For base 2, 8, or 16, the returned string is prefixed with a base marker of ``'0b'``, ``'0o'``, or ``'0x'``, respectively. If *n* is not a Python int, it is converted with :c:func:`PyNumber_Index` first." -msgstr "" +msgid "" +"Returns the integer *n* converted to base *base* as a string. The *base* " +"argument must be one of 2, 8, 10, or 16. For base 2, 8, or 16, the returned" +" string is prefixed with a base marker of ``'0b'``, ``'0o'``, or ``'0x'``, " +"respectively. If *n* is not a Python int, it is converted with " +":c:func:`PyNumber_Index` first." +msgstr "" +"عدد صحیح *n* تبدیل‌شده به مبنای *base* را به‌صورت رشته برمی‌گرداند. آرگومان " +"*base* باید یکی از مقادیر ۲، ۸، ۱۰ یا ۱۶ باشد. برای مبنای ۲، ۸ یا ۱۶، رشته‌ی" +" برگردانده‌شده به‌ترتیب با نشانگر مبنای ``'0b'``، ``'0o'`` یا ``'0x'`` " +"پیشوند می‌گیرد. اگر *n* یک int پایتون نباشد، ابتدا با " +":c:func:`PyNumber_Index` تبدیل می‌شود." -msgid "Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be interpreted as an integer. If the call fails, an exception is raised and ``-1`` is returned." +msgid "" +"Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be " +"interpreted as an integer. If the call fails, an exception is raised and " +"``-1`` is returned." msgstr "" +"در صورتی که *o* بتواند به عنوان یک عدد صحیح تفسیر شود، *o* را به یک مقدار " +":c:type:`Py_ssize_t` تبدیل‌شده برمی‌گرداند. اگر فراخوانی شکست بخورد، یک " +"استثنا مطرح می‌شود و ``-1`` برگردانده می‌شود." -msgid "If *o* can be converted to a Python int but the attempt to convert to a :c:type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the *exc* argument is the type of exception that will be raised (usually :exc:`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, then the exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a negative integer or ``PY_SSIZE_T_MAX`` for a positive integer." -msgstr "" +msgid "" +"If *o* can be converted to a Python int but the attempt to convert to a " +":c:type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the " +"*exc* argument is the type of exception that will be raised (usually " +":exc:`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, then the " +"exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a " +"negative integer or ``PY_SSIZE_T_MAX`` for a positive integer." +msgstr "" +"اگر *o* بتواند به یک int پایتون تبدیل شود، اما تلاش برای تبدیل به مقدار " +":c:type:`Py_ssize_t` موجب ایجاد :exc:`OverflowError` شود، آنگاه آرگومان " +"*exc* نوع استثنایی است که ایجاد خواهد شد (معمولاً :exc:`IndexError` یا " +":exc:`OverflowError`). اگر *exc* برابر ``NULL`` باشد، استثنا پاک می‌شود و " +"مقدار برای عدد صحیح منفی به ``PY_SSIZE_T_MIN`` و برای عدد صحیح مثبت به " +"``PY_SSIZE_T_MAX`` بریده می‌شود." -msgid "Returns ``1`` if *o* is an index integer (has the ``nb_index`` slot of the ``tp_as_number`` structure filled in), and ``0`` otherwise. This function always succeeds." +msgid "" +"Returns ``1`` if *o* is an index integer (has the ``nb_index`` slot of the " +"``tp_as_number`` structure filled in), and ``0`` otherwise. This function " +"always succeeds." msgstr "" +"اگر *o* یک عدد صحیح اندیس باشد (جایگاه ``nb_index`` در ساختار " +"``tp_as_number`` آن پر شده باشد)، ``1`` و در غیر این صورت ``0`` برمی‌گرداند." +" این تابع همیشه موفق می‌شود." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "divmod" -msgstr "" +msgstr "divmod" msgid "pow" -msgstr "" +msgstr "pow" msgid "abs" -msgstr "" +msgstr "abs" msgid "int" -msgstr "" +msgstr "int" msgid "float" -msgstr "" +msgstr "اعشاری" diff --git a/c-api/object.po b/c-api/object.po index ada0d57e1..baff5f64d 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"PO-Revision-Date: 2026-09-04 20:18+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,395 +23,1022 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Object Protocol" -msgstr "" +msgstr "پروتکل شیء" msgid "Get a :term:`strong reference` to a constant." -msgstr "" +msgstr "گرفتن یک :term:`strong reference` به یک ثابت." msgid "Set an exception and return ``NULL`` if *constant_id* is invalid." msgstr "" +"اگر *constant_id* نامعتبر باشد، یک استثنا تنظیم شده و ``NULL`` برگردانده " +"می‌شود." msgid "*constant_id* must be one of these constant identifiers:" -msgstr "" +msgstr "*constant_id* باید یکی از این شناسه‌های ثابت باشد:" msgid "Constant Identifier" -msgstr "" +msgstr "شناسه‌ی ثابت" msgid "Value" -msgstr "" +msgstr "مقدار" msgid "Returned object" -msgstr "" +msgstr "شیء بازگردانده‌شده" msgid "``0``" -msgstr "" +msgstr "``0``" msgid ":py:data:`None`" -msgstr "" +msgstr ":py:data:`None`" msgid "``1``" -msgstr "" +msgstr "``1``" msgid ":py:data:`False`" -msgstr "" +msgstr ":py:data:`False`" msgid "``2``" -msgstr "" +msgstr "``2``" msgid ":py:data:`True`" -msgstr "" +msgstr ":py:data:`True`" msgid "``3``" -msgstr "" +msgstr "``3``" msgid ":py:data:`Ellipsis`" -msgstr "" +msgstr ":py:data:`Ellipsis`" msgid "``4``" -msgstr "" +msgstr "``4``" msgid ":py:data:`NotImplemented`" -msgstr "" +msgstr ":py:data:`NotImplemented`" msgid "``5``" -msgstr "" +msgstr "``5``" msgid "``6``" -msgstr "" +msgstr "``6``" msgid "``7``" -msgstr "" +msgstr "``7``" msgid "``''``" -msgstr "" +msgstr "``''``" msgid "``8``" -msgstr "" +msgstr "``8``" msgid "``b''``" -msgstr "" +msgstr "``b''``" msgid "``9``" -msgstr "" +msgstr "``9``" msgid "``()``" -msgstr "" +msgstr "``()``" -msgid "Numeric values are only given for projects which cannot use the constant identifiers." +msgid "" +"Numeric values are only given for projects which cannot use the constant " +"identifiers." msgstr "" +"مقادیر عددی فقط برای پروژه‌هایی ارائه شده‌اند که نمی‌توانند از شناسه‌های ثابت " +"استفاده کنند." msgid "In CPython, all of these constants are :term:`immortal`." -msgstr "" +msgstr "در سی‌پایتون، همه‌ی این ثابت‌ها :term:`نامیرا ` هستند." -msgid "Similar to :c:func:`Py_GetConstant`, but return a :term:`borrowed reference`." +msgid "" +"Similar to :c:func:`Py_GetConstant`, but return a :term:`borrowed " +"reference`." msgstr "" +"مشابه :c:func:`Py_GetConstant`، اما یک :term:`ارجاع امانتی ` برمی‌گرداند." -msgid "This function is primarily intended for backwards compatibility: using :c:func:`Py_GetConstant` is recommended for new code." +msgid "" +"This function is primarily intended for backwards compatibility: " +"using :c:func:`Py_GetConstant` is recommended for new code." msgstr "" +"این تابع عمدتاً برای سازگاری با نسخه‌های قبلی در نظر گرفته شده است: استفاده " +"از :c:func:`Py_GetConstant` برای کد جدید توصیه می‌شود." -msgid "The reference is borrowed from the interpreter, and is valid until the interpreter finalization." +msgid "" +"The reference is borrowed from the interpreter, and is valid until the " +"interpreter finalization." msgstr "" +"این ارجاع از مفسر امانت گرفته شده است و تا زمان نهایی‌سازی مفسر معتبر است." -msgid "The ``NotImplemented`` singleton, used to signal that an operation is not implemented for the given type combination." +msgid "" +"The ``NotImplemented`` singleton, used to signal that an operation is not " +"implemented for the given type combination." msgstr "" +"تک‌نمونه‌ی ``NotImplemented``، که برای اعلام اینکه عملیاتی برای ترکیب مشخصی " +"از نوع‌ها پیاده‌سازی نشده است، استفاده می‌شود." -msgid "Properly handle returning :c:data:`Py_NotImplemented` from within a C function (that is, create a new :term:`strong reference` to :const:`NotImplemented` and return it)." +msgid "" +"Properly handle returning :c:data:`Py_NotImplemented` from within a C " +"function (that is, create a new :term:`strong reference` " +"to :const:`NotImplemented` and return it)." msgstr "" +"بازگرداندن :c:data:`Py_NotImplemented` از درون یک تابع C را به‌درستی مدیریت " +"کنید (یعنی، یک :term:`strong reference` جدید به :const:`NotImplemented` " +"ایجاد کنید و آن را بازگردانید)." -msgid "Flag to be used with multiple functions that print the object (like :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these functions use the :func:`str` of the object instead of the :func:`repr`." +msgid "" +"Flag to be used with multiple functions that print the object " +"(like :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`). If " +"passed, these functions use the :func:`str` of the object instead of " +"the :func:`repr`." msgstr "" +"پرچمی که همراه چندین تابعِ چاپ‌کننده‌ی شیء استفاده می‌شود " +"(مانند :c:func:`PyObject_Print` و :c:func:`PyFile_WriteObject`). اگر پاس " +"داده شود، این توابع به جای :func:`repr` از :func:`str` شیء استفاده می‌کنند." -msgid "Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument is used to enable certain printing options. The only option currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written instead of the :func:`repr`." +msgid "" +"Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " +"argument is used to enable certain printing options. The only option " +"currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` " +"of the object is written instead of the :func:`repr`." msgstr "" +"شیء *o* را در پرونده *fp* چاپ می‌کند. در صورت خطا ``-1`` را برمی‌گرداند. از " +"آرگومان پرچم‌ها برای فعال‌سازی برخی گزینه‌های چاپ استفاده می‌شود. تنها گزینه‌ای " +"که در حال حاضر پشتیبانی می‌شود :c:macro:`Py_PRINT_RAW` است؛ در صورت ارائه " +"این گزینه، :func:`str` شیء به‌جای :func:`repr` آن نوشته می‌شود." -msgid "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This is equivalent to the Python expression ``hasattr(o, attr_name)``. On failure, return ``-1``." +msgid "" +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This is equivalent to the Python expression ``hasattr(o, attr_name)``. On " +"failure, return ``-1``." msgstr "" +"اگر *o* ویژگی *attr_name* را داشته باشد، ``1`` و در غیر این صورت ``0`` " +"برمی‌گرداند. این معادل عبارت پایتونی ``hasattr(o, attr_name)`` است. در صورت " +"شکست، ``-1`` برمی‌گرداند." -msgid "This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_HasAttrWithError` است، اما *attr_name* " +"به‌جای :c:expr:`PyObject*` به‌صورت یک رشته‌ی بایتی کدگذاری‌شده با UTF-8 از " +"نوع :c:expr:`const char*` مشخص می‌شود." -msgid "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This function always succeeds." +msgid "" +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This function always succeeds." msgstr "" +"اگر *o* ویژگی *attr_name* را داشته باشد، ``1`` و در غیر این صورت ``0`` " +"برمی‌گرداند. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:`~object.__getattribute__` methods aren't propagated, but instead given to :func:`sys.unraisablehook`. For proper error handling, use :c:func:`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead." -msgstr "" +msgid "" +"Exceptions that occur when this calls :meth:`~object.__getattr__` " +"and :meth:`~object.__getattribute__` methods aren't propagated, but instead " +"given to :func:`sys.unraisablehook`. For proper error handling, " +"use :c:func:`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` " +"or :c:func:`PyObject_GetAttr` instead." +msgstr "" +"استثناهایی که هنگام فراخوانی متدهای :meth:`~object.__getattr__` " +"و :meth:`~object.__getattribute__` توسط این تابع رخ می‌دهند، منتشر نمی‌شوند، " +"بلکه به :func:`sys.unraisablehook` داده می‌شوند. برای مدیریت صحیح خطا، به " +"جای آن " +"از :c:func:`PyObject_HasAttrWithError`، :c:func:`PyObject_GetOptionalAttr` " +"یا :c:func:`PyObject_GetAttr` استفاده کنید." -msgid "This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_HasAttr` است، اما *attr_name* به‌صورت یک رشته‌ی " +"بایت کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه " +"یک :c:expr:`PyObject*`." -msgid "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:`~object.__getattribute__` methods or while creating the temporary :class:`str` object are silently ignored. For proper error handling, use :c:func:`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` or :c:func:`PyObject_GetAttrString` instead." -msgstr "" +msgid "" +"Exceptions that occur when this calls :meth:`~object.__getattr__` " +"and :meth:`~object.__getattribute__` methods or while creating the " +"temporary :class:`str` object are silently ignored. For proper error " +"handling, " +"use :c:func:`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " +"or :c:func:`PyObject_GetAttrString` instead." +msgstr "" +"استثناهایی که هنگام فراخوانی متدهای :meth:`~object.__getattr__` " +"و :meth:`~object.__getattribute__` توسط این تابع، یا هنگام ایجاد شیء " +"موقت :class:`str` رخ می‌دهند، به‌صورت بی‌صدا نادیده گرفته می‌شوند. برای مدیریت " +"صحیح خطاها، به‌جای آن " +"از :c:func:`PyObject_HasAttrStringWithError`، :c:func:`PyObject_GetOptionalAttrString` " +"یا :c:func:`PyObject_GetAttrString` استفاده کنید." -msgid "Retrieve an attribute named *attr_name* from object *o*. Returns the attribute value on success, or ``NULL`` on failure. This is the equivalent of the Python expression ``o.attr_name``." +msgid "" +"Retrieve an attribute named *attr_name* from object *o*. Returns the " +"attribute value on success, or ``NULL`` on failure. This is the equivalent " +"of the Python expression ``o.attr_name``." msgstr "" +"یک ویژگی با نام *attr_name* را از شیء *o* بازیابی می‌کند. در صورت موفقیت، " +"مقدار ویژگی و در صورت شکست، ``NULL`` را برمی‌گرداند. این معادل عبارت پایتونی " +"``o.attr_name`` است." -msgid "If the missing attribute should not be treated as a failure, you can use :c:func:`PyObject_GetOptionalAttr` instead." +msgid "" +"If the missing attribute should not be treated as a failure, you can " +"use :c:func:`PyObject_GetOptionalAttr` instead." msgstr "" +"اگر نبود ویژگی نباید به‌عنوان شکست تلقی شود، می‌توانید به‌جای آن " +"از :c:func:`PyObject_GetOptionalAttr` استفاده کنید." -msgid "This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_GetAttr` است، اما *attr_name* " +"به‌جای :c:expr:`PyObject*` به‌صورت یک رشته‌ی بایتِ کدگذاری‌شده با UTF-8 از " +"نوع :c:expr:`const char*` مشخص می‌شود." -msgid "If the missing attribute should not be treated as a failure, you can use :c:func:`PyObject_GetOptionalAttrString` instead." +msgid "" +"If the missing attribute should not be treated as a failure, you can " +"use :c:func:`PyObject_GetOptionalAttrString` instead." msgstr "" +"اگر ویژگی مفقود نباید به‌عنوان شکست در نظر گرفته شود، می‌توانید به جای آن " +"از :c:func:`PyObject_GetOptionalAttrString` استفاده کنید." -msgid "Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:`AttributeError` if the attribute is not found." +msgid "" +"Variant of :c:func:`PyObject_GetAttr` which doesn't " +"raise :exc:`AttributeError` if the attribute is not found." msgstr "" +"گونه‌ای از :c:func:`PyObject_GetAttr` که اگر ویژگی پیدا نشود، " +"استثنای :exc:`AttributeError` را ایجاد نمی‌کند." -msgid "If the attribute is found, return ``1`` and set *\\*result* to a new :term:`strong reference` to the attribute. If the attribute is not found, return ``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is silenced. If an error other than :exc:`AttributeError` is raised, return ``-1`` and set *\\*result* to ``NULL``." -msgstr "" +msgid "" +"If the attribute is found, return ``1`` and set *\\*result* to a " +"new :term:`strong reference` to the attribute. If the attribute is not " +"found, return ``0`` and set *\\*result* to ``NULL``; " +"the :exc:`AttributeError` is silenced. If an error other " +"than :exc:`AttributeError` is raised, return ``-1`` and set *\\*result* to " +"``NULL``." +msgstr "" +"اگر ویژگی یافت شود، ``1`` برگردانده می‌شود و *\\*result* روی یک :term:`ارجاع " +"قوی ` جدید به ویژگی تنظیم می‌شود. اگر ویژگی یافت نشود، " +"``0`` برگردانده می‌شود و *\\*result* روی ``NULL`` تنظیم می‌شود؛ " +"استثنای :exc:`AttributeError` سرکوب می‌شود. اگر خطایی غیر " +"از :exc:`AttributeError` مطرح شود، ``-1`` برگردانده می‌شود و *\\*result* روی " +"``NULL`` تنظیم می‌شود." -msgid "This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_GetOptionalAttr` است، اما *attr_name* به‌عنوان یک " +"رشته‌ی بایتی کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه " +"یک :c:expr:`PyObject*`." -msgid "Generic attribute getter function that is meant to be put into a type object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary of classes in the object's MRO as well as an attribute in the object's :attr:`~object.__dict__` (if present). As outlined in :ref:`descriptors`, data descriptors take preference over instance attributes, while non-data descriptors don't. Otherwise, an :exc:`AttributeError` is raised." -msgstr "" +msgid "" +"Generic attribute getter function that is meant to be put into a type " +"object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary " +"of classes in the object's MRO as well as an attribute in the " +"object's :attr:`~object.__dict__` (if present). As outlined " +"in :ref:`descriptors`, data descriptors take preference over instance " +"attributes, while non-data descriptors don't. Otherwise, " +"an :exc:`AttributeError` is raised." +msgstr "" +"تابع عمومی گیرنده‌ی ویژگی که در نظر گرفته شده است تا در جایگاه " +"``tp_getattro`` یک شیء نوع قرار داده شود. این تابع به دنبال یک توصیف‌گر در " +"دیکشنری کلاس‌های موجود در MRO شیء و همچنین یک ویژگی " +"در :attr:`~object.__dict__` شیء (در صورت وجود) می‌گردد. همان‌طور که " +"در :ref:`descriptors` شرح داده شده است، توصیف‌گرهای داده‌ای نسبت به ویژگی‌های " +"نمونه اولویت دارند، در حالی که توصیف‌گرهای غیر داده‌ای چنین نیستند. در غیر " +"این صورت، استثنای :exc:`AttributeError` مطرح می‌شود." -msgid "Set the value of the attribute named *attr_name*, for object *o*, to the value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on success. This is the equivalent of the Python statement ``o.attr_name = v``." +msgid "" +"Set the value of the attribute named *attr_name*, for object *o*, to the " +"value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " +"success. This is the equivalent of the Python statement ``o.attr_name = " +"v``." msgstr "" +"مقدار ویژگی‌ای با نام *attr_name* را برای شیء *o* به مقدار *v* تنظیم می‌کند. " +"در صورت شکست، یک استثنا ایجاد می‌کند و ``-1`` را برمی‌گرداند؛ در صورت موفقیت " +"``0`` را برمی‌گرداند. این معادل دستور ``o.attr_name = v`` در پایتون است." -msgid "If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated in favour of using :c:func:`PyObject_DelAttr`, but there are currently no plans to remove it." +msgid "" +"If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " +"in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " +"plans to remove it." msgstr "" +"اگر *v* برابر ``NULL`` باشد، ویژگی حذف می‌شود. این رفتار به نفع استفاده " +"از :c:func:`PyObject_DelAttr` منسوخ شده است، اما در حال حاضر هیچ برنامه‌ای " +"برای حذف آن وجود ندارد." -msgid "This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_SetAttr` است، اما *attr_name* به‌صورت یک رشته‌ی " +"بایتِ کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، " +"نه :c:expr:`PyObject*`." -msgid "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated in favour of using :c:func:`PyObject_DelAttrString`." +msgid "" +"If *v* is ``NULL``, the attribute is deleted, but this feature is " +"deprecated in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" +"اگر *v* برابر ``NULL`` باشد، ویژگی حذف می‌شود، اما این قابلیت به نفع استفاده " +"از :c:func:`PyObject_DelAttrString` منسوخ شده است." -msgid "The number of different attribute names passed to this function should be kept small, usually by using a statically allocated string as *attr_name*. For attribute names that aren't known at compile time, prefer calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more details, see :c:func:`PyUnicode_InternFromString`, which may be used internally to create a key object." -msgstr "" +msgid "" +"The number of different attribute names passed to this function should be " +"kept small, usually by using a statically allocated string as *attr_name*. " +"For attribute names that aren't known at compile time, prefer " +"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` " +"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which " +"may be used internally to create a key object." +msgstr "" +"تعداد نام‌های ویژگی متفاوتی که به این تابع ارسال می‌شوند باید کم نگه داشته " +"شود؛ این کار معمولاً با استفاده از یک رشته با تخصیص ایستا به‌عنوان " +"*attr_name* انجام می‌شود. برای نام‌های ویژگی که در زمان کامپایل مشخص نیستند، " +"ترجیح دهید :c:func:`PyUnicode_FromString` و :c:func:`PyObject_SetAttr` را " +"مستقیماً فراخوانی کنید. برای جزئیات " +"بیشتر، :c:func:`PyUnicode_InternFromString` را ببینید که ممکن است به‌صورت " +"داخلی برای ایجاد یک شیء کلید استفاده شود." -msgid "Generic attribute setter and deleter function that is meant to be put into a type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a data descriptor in the dictionary of classes in the object's MRO, and if found it takes preference over setting or deleting the attribute in the instance dictionary. Otherwise, the attribute is set or deleted in the object's :attr:`~object.__dict__` (if present). On success, ``0`` is returned, otherwise an :exc:`AttributeError` is raised and ``-1`` is returned." -msgstr "" +msgid "" +"Generic attribute setter and deleter function that is meant to be put into " +"a type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " +"data descriptor in the dictionary of classes in the object's MRO, and if " +"found it takes preference over setting or deleting the attribute in the " +"instance dictionary. Otherwise, the attribute is set or deleted in the " +"object's :attr:`~object.__dict__` (if present). On success, ``0`` is " +"returned, otherwise an :exc:`AttributeError` is raised and ``-1`` is " +"returned." +msgstr "" +"تابع عمومی تنظیم‌کننده و حذف‌کننده‌ی ویژگی که برای قرار گرفتن در " +"جایگاه :c:member:`~PyTypeObject.tp_setattro` از یک شیء نوع در نظر گرفته شده " +"است. این تابع به دنبال یک توصیف‌گر داده در دیکشنری کلاس‌های موجود در MRO شیء " +"می‌گردد و در صورت یافته شدن، آن نسبت به تنظیم یا حذف ویژگی در دیکشنری نمونه " +"اولویت دارد. در غیر این صورت، ویژگی در :attr:`~object.__dict__` شیء (در " +"صورت وجود) تنظیم یا حذف می‌شود. در صورت موفقیت، ``0`` برگردانده می‌شود؛ در " +"غیر این صورت، :exc:`AttributeError` مطرح می‌شود و ``-1`` برگردانده می‌شود." -msgid "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``del o.attr_name``." +msgid "" +"Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " +"failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" +"ویژگی به نام *attr_name* را از شیء *o* حذف می‌کند. در صورت شکست ``-1`` " +"برمی‌گرداند. این معادل دستور ``del o.attr_name`` در پایتون است." -msgid "This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather " +"than a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_DelAttr` است، اما *attr_name* به‌صورت یک رشته " +"بایتی کدگذاری‌شده با UTF-8 از نوع :c:expr:`const char*` مشخص می‌شود، نه " +"به‌صورت یک :c:expr:`PyObject*`." -msgid "The number of different attribute names passed to this function should be kept small, usually by using a statically allocated string as *attr_name*. For attribute names that aren't known at compile time, prefer calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` directly. For more details, see :c:func:`PyUnicode_InternFromString`, which may be used internally to create a key object for lookup." -msgstr "" +msgid "" +"The number of different attribute names passed to this function should be " +"kept small, usually by using a statically allocated string as *attr_name*. " +"For attribute names that aren't known at compile time, prefer " +"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` " +"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which " +"may be used internally to create a key object for lookup." +msgstr "" +"تعداد نام‌های ویژگی متفاوتی که به این تابع پاس داده می‌شوند باید کم نگه داشته " +"شود؛ این کار معمولاً با استفاده از یک رشته تخصیص‌یافته به‌صورت ایستا به‌عنوان " +"*attr_name* انجام می‌شود. برای نام‌های ویژگی که در زمان کامپایل شناخته " +"نمی‌شوند، ترجیح دهید :c:func:`PyUnicode_FromString` " +"و :c:func:`PyObject_DelAttr` را مستقیماً فراخوانی کنید. برای جزئیات " +"بیشتر، :c:func:`PyUnicode_InternFromString` را ببینید که ممکن است به‌صورت " +"داخلی برای ایجاد یک شیء کلید جهت جستجو استفاده شود." -msgid "A generic implementation for the getter of a ``__dict__`` descriptor. It creates the dictionary if necessary." +msgid "" +"A generic implementation for the getter of a ``__dict__`` descriptor. It " +"creates the dictionary if necessary." msgstr "" +"پیاده‌سازی عام برای گیرنده‌ی توصیف‌گر ``__dict__``. در صورت نیاز، دیکشنری را " +"ایجاد می‌کند." -msgid "This function may also be called to get the :py:attr:`~object.__dict__` of the object *o*. Pass ``NULL`` for *context* when calling it. Since this function may need to allocate memory for the dictionary, it may be more efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." -msgstr "" +msgid "" +"This function may also be called to get the :py:attr:`~object.__dict__` of " +"the object *o*. Pass ``NULL`` for *context* when calling it. Since this " +"function may need to allocate memory for the dictionary, it may be more " +"efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on " +"the object." +msgstr "" +"برای گرفتن :py:attr:`~object.__dict__` شیء *o* نیز می‌توان این تابع را " +"فراخوانی کرد. هنگام فراخوانی آن، مقدار ``NULL`` را برای *context* ارسال " +"کنید. از آنجا که این تابع ممکن است برای دیکشنری به تخصیص حافظه نیاز داشته " +"باشد، هنگام دسترسی به یک ویژگی بر روی شیء، ممکن است " +"فراخوانی :c:func:`PyObject_GetAttr` کارآمدتر باشد." msgid "On failure, returns ``NULL`` with an exception set." -msgstr "" +msgstr "در صورت شکست، ``NULL`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "A generic implementation for the setter of a ``__dict__`` descriptor. This implementation does not allow the dictionary to be deleted." +msgid "" +"A generic implementation for the setter of a ``__dict__`` descriptor. This " +"implementation does not allow the dictionary to be deleted." msgstr "" +"پیاده‌سازی عام برای ست‌کننده (setter) یک توصیف‌گر ``__dict__``. این پیاده‌سازی " +"اجازه حذف دیکشنری را نمی‌دهد." -msgid "Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If there is no ``__dict__``, return ``NULL`` without setting an exception." +msgid "" +"Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If " +"there is no ``__dict__``, return ``NULL`` without setting an exception." msgstr "" +"اشاره‌گر به :py:attr:`~object.__dict__` شیء *obj* را بازمی‌گرداند. اگر " +"``__dict__`` وجود نداشته باشد، ``NULL`` را بدون تنظیم استثنا بازمی‌گرداند." -msgid "This function may need to allocate memory for the dictionary, so it may be more efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." +msgid "" +"This function may need to allocate memory for the dictionary, so it may be " +"more efficient to call :c:func:`PyObject_GetAttr` when accessing an " +"attribute on the object." msgstr "" +"این تابع ممکن است نیاز به تخصیص حافظه برای دیکشنری داشته باشد، بنابراین " +"ممکن است هنگام دسترسی به یک ویژگی بر روی شیء، " +"فراخوانی :c:func:`PyObject_GetAttr` کارآمدتر باشد." -msgid "Compare the values of *o1* and *o2* using the operation specified by *opid*, which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to ``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the equivalent of the Python expression ``o1 op o2``, where ``op`` is the operator corresponding to *opid*. Returns the value of the comparison on success, or ``NULL`` on failure." -msgstr "" +msgid "" +"Compare the values of *o1* and *o2* using the operation specified by " +"*opid*, which must be one " +"of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_GT`, " +"or :c:macro:`Py_GE`, corresponding to ``<``, ``<=``, ``==``, ``!=``, ``>``, " +"or ``>=`` respectively. This is the equivalent of the Python expression " +"``o1 op o2``, where ``op`` is the operator corresponding to *opid*. Returns " +"the value of the comparison on success, or ``NULL`` on failure." +msgstr "" +"مقادیر *o1* و *o2* را با استفاده از عملیات مشخص‌شده توسط *opid* مقایسه " +"می‌کند، که باید یکی " +"از :c:macro:`Py_LT`، :c:macro:`Py_LE`، :c:macro:`Py_EQ`، :c:macro:`Py_NE`، :c:macro:`Py_GT` " +"یا :c:macro:`Py_GE` باشد که به‌ترتیب متناظر با ``<``، ``<=``، ``==``، ``!" +"=``، ``>`` یا ``>=`` هستند. این معادل عبارت پایتونی ``o1 op o2`` است، که در " +"آن ``op`` عملگر متناظر با *opid* است. در صورت موفقیت مقدار مقایسه و در صورت " +"شکست ``NULL`` را برمی‌گرداند." -msgid "Compare the values of *o1* and *o2* using the operation specified by *opid*, like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if the result is false, ``1`` otherwise." +msgid "" +"Compare the values of *o1* and *o2* using the operation specified by " +"*opid*, like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, " +"``0`` if the result is false, ``1`` otherwise." msgstr "" +"مقادیر *o1* و *o2* را با استفاده از عملیات مشخص‌شده توسط *opid* مقایسه " +"می‌کند، مانند :c:func:`PyObject_RichCompare`، اما در صورت خطا ``-1``، اگر " +"نتیجه نادرست باشد ``0`` و در غیر این صورت ``1`` برمی‌گرداند." -msgid "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." +msgid "" +"If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " +"will always return ``1`` for :c:macro:`Py_EQ` and ``0`` " +"for :c:macro:`Py_NE`." msgstr "" +"اگر *o1* و *o2* یک شیء واحد باشند، :c:func:`PyObject_RichCompareBool` همیشه " +"برای :c:macro:`Py_EQ` مقدار ``1`` و برای :c:macro:`Py_NE` مقدار ``0`` را " +"برمی‌گرداند." -msgid "Format *obj* using *format_spec*. This is equivalent to the Python expression ``format(obj, format_spec)``." +msgid "" +"Format *obj* using *format_spec*. This is equivalent to the Python " +"expression ``format(obj, format_spec)``." msgstr "" +"*obj* را با استفاده از *format_spec* قالب‌بندی می‌کند. این معادل عبارت " +"پایتونی ``format(obj, format_spec)`` است." -msgid "*format_spec* may be ``NULL``. In this case the call is equivalent to ``format(obj)``. Returns the formatted string on success, ``NULL`` on failure." +msgid "" +"*format_spec* may be ``NULL``. In this case the call is equivalent to " +"``format(obj)``. Returns the formatted string on success, ``NULL`` on " +"failure." msgstr "" +"*format_spec* ممکن است ``NULL`` باشد. در این حالت، این فراخوانی معادل " +"``format(obj)`` است. در صورت موفقیت، رشته قالب‌بندی‌شده و در صورت شکست " +"``NULL`` را برمی‌گرداند." -msgid "Compute a string representation of object *o*. Returns the string representation on success, ``NULL`` on failure. This is the equivalent of the Python expression ``repr(o)``. Called by the :func:`repr` built-in function." +msgid "" +"Compute a string representation of object *o*. Returns the string " +"representation on success, ``NULL`` on failure. This is the equivalent of " +"the Python expression ``repr(o)``. Called by the :func:`repr` built-in " +"function." msgstr "" +"نمایش رشته‌ای شیء *o* را محاسبه می‌کند. در صورت موفقیت نمایش رشته‌ای و در صورت " +"شکست ``NULL`` برمی‌گرداند. این معادل عبارت پایتونی ``repr(o)`` است. توسط " +"تابع توکار :func:`repr` فراخوانی می‌شود." msgid "If argument is ``NULL``, return the string ``''``." -msgstr "" +msgstr "اگر آرگومان ``NULL`` باشد، رشته‌ی ``''`` را برمی‌گرداند." -msgid "This function now includes a debug assertion to help ensure that it does not silently discard an active exception." +msgid "" +"This function now includes a debug assertion to help ensure that it does " +"not silently discard an active exception." msgstr "" +"این تابع اکنون شامل یک ادعای اشکال‌زدایی است تا کمک کند اطمینان حاصل شود که " +"استثنای فعال به‌صورت بی‌صدا دور انداخته نمی‌شود." -msgid "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, but escape the non-ASCII characters in the string returned by :c:func:`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This generates a string similar to that returned by :c:func:`PyObject_Repr` in Python 2. Called by the :func:`ascii` built-in function." -msgstr "" +msgid "" +"As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " +"but escape the non-ASCII characters in the string returned " +"by :c:func:`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This " +"generates a string similar to that returned by :c:func:`PyObject_Repr` in " +"Python 2. Called by the :func:`ascii` built-in function." +msgstr "" +"مانند :c:func:`PyObject_Repr`، بازنمایی رشته‌ای از شیء *o* را محاسبه می‌کند، " +"اما نویسه‌های غیراسکی در رشته‌ای که :c:func:`PyObject_Repr` برمی‌گرداند را با " +"گریزهای ``\\x``، ``\\u`` یا ``\\U`` خنثی می‌کند. این کار رشته‌ای مشابه " +"آنچه :c:func:`PyObject_Repr` در پایتون 2 برمی‌گرداند تولید می‌کند. توسط تابع " +"توکار :func:`ascii` فراخوانی می‌شود." -msgid "Compute a string representation of object *o*. Returns the string representation on success, ``NULL`` on failure. This is the equivalent of the Python expression ``str(o)``. Called by the :func:`str` built-in function and, therefore, by the :func:`print` function." +msgid "" +"Compute a string representation of object *o*. Returns the string " +"representation on success, ``NULL`` on failure. This is the equivalent of " +"the Python expression ``str(o)``. Called by the :func:`str` built-in " +"function and, therefore, by the :func:`print` function." msgstr "" +"نمایش رشته‌ای شیء *o* را محاسبه می‌کند. در صورت موفقیت، نمایش رشته‌ای را " +"برمی‌گرداند و در صورت شکست، ``NULL`` را. این معادل عبارت پایتونی ``str(o)`` " +"است. این تابع توسط تابع توکار :func:`str` و در نتیجه توسط " +"تابع :func:`print` فراخوانی می‌شود." -msgid "Compute a bytes representation of object *o*. ``NULL`` is returned on failure and a bytes object on success. This is equivalent to the Python expression ``bytes(o)``, when *o* is not an integer. Unlike ``bytes(o)``, a TypeError is raised when *o* is an integer instead of a zero-initialized bytes object." -msgstr "" +msgid "" +"Compute a bytes representation of object *o*. ``NULL`` is returned on " +"failure and a bytes object on success. This is equivalent to the Python " +"expression ``bytes(o)``, when *o* is not an integer. Unlike ``bytes(o)``, " +"a TypeError is raised when *o* is an integer instead of a zero-initialized " +"bytes object." +msgstr "" +"یک نمایش بایتی از شیء *o* را محاسبه می‌کند. در صورت شکست ``NULL`` و در صورت " +"موفقیت یک شیء بایت بازگردانده می‌شود. این کار معادل عبارت پایتونی " +"``bytes(o)`` است، هنگامی که *o* عدد صحیح نباشد. برخلاف ``bytes(o)``، " +"هنگامی که *o* عدد صحیح باشد، به‌جای یک شیء بایتِ مقداردهی‌شده با صفر، استثنای " +"TypeError ایجاد می‌شود." -msgid "If argument is ``NULL``, return the :class:`bytes` object ``b''``." +msgid "" +"If argument is ``NULL``, return the :class:`bytes` object ``b''``." msgstr "" +"اگر آرگومان ``NULL`` باشد، شیء :class:`bytes` یعنی ``b''`` را " +"بازمی‌گرداند." -msgid "Return ``1`` if the class *derived* is identical to or derived from the class *cls*, otherwise return ``0``. In case of an error, return ``-1``." +msgid "" +"Return ``1`` if the class *derived* is identical to or derived from the " +"class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" +"اگر کلاس *derived* با کلاس *cls* یکسان باشد یا از آن مشتق‌شده باشد، ``1`` را " +"برمی‌گرداند؛ در غیر این صورت ``0`` را برمی‌گرداند. در صورت خطا، ``-1`` را " +"برمی‌گرداند." -msgid "If *cls* is a tuple, the check will be done against every entry in *cls*. The result will be ``1`` when at least one of the checks returns ``1``, otherwise it will be ``0``." +msgid "" +"If *cls* is a tuple, the check will be done against every entry in *cls*. " +"The result will be ``1`` when at least one of the checks returns ``1``, " +"otherwise it will be ``0``." msgstr "" +"اگر *cls* یک تاپل باشد، بررسی نسبت به هر یک از ورودی‌های *cls* انجام می‌شود. " +"نتیجه ``1`` خواهد بود اگر حداقل یکی از بررسی‌ها ``1`` برگرداند، در غیر این " +"صورت ``0`` خواهد بود." -msgid "If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to determine the subclass status as described in :pep:`3119`. Otherwise, *derived* is a subclass of *cls* if it is a direct or indirect subclass, i.e. contained in :attr:`cls.__mro__ `." +msgid "" +"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " +"determine the subclass status as described in :pep:`3119`. Otherwise, " +"*derived* is a subclass of *cls* if it is a direct or indirect subclass, " +"i.e. contained in :attr:`cls.__mro__ `." msgstr "" +"اگر *cls* دارای متد :meth:`~type.__subclasscheck__` باشد، این متد برای " +"تعیین وضعیت زیرکلاس بودن، همان‌گونه که در :pep:`3119` توصیف شده است، " +"فراخوانی می‌شود. در غیر این صورت، *derived* در صورتی زیرکلاس *cls* است که " +"زیرکلاس مستقیم یا غیرمستقیم آن باشد؛ یعنی در :attr:`cls.__mro__ " +"` قرار داشته باشد." -msgid "Normally only class objects, i.e. instances of :class:`type` or a derived class, are considered classes. However, objects can override this by having a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." +msgid "" +"Normally only class objects, i.e. instances of :class:`type` or a derived " +"class, are considered classes. However, objects can override this by " +"having a :attr:`~type.__bases__` attribute (which must be a tuple of base " +"classes)." msgstr "" +"معمولاً فقط اشیاء کلاس، یعنی نمونه‌های :class:`type` یا یک کلاس مشتق‌شده، به " +"عنوان کلاس در نظر گرفته می‌شوند. اما اشیاء می‌توانند با داشتن " +"ویژگی :attr:`~type.__bases__` (که باید تاپلی از کلاس‌های پایه باشد) این " +"موضوع را لغو کنند." -msgid "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of *cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." +msgid "" +"Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " +"*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" +"اگر *inst* نمونه‌ای از کلاس *cls* یا زیرکلاسی از *cls* باشد، ``1`` را " +"برمی‌گرداند و در غیر این صورت ``0`` را برمی‌گرداند. در صورت خطا، ``-1`` را " +"برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to determine the subclass status as described in :pep:`3119`. Otherwise, *inst* is an instance of *cls* if its class is a subclass of *cls*." +msgid "" +"If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to " +"determine the subclass status as described in :pep:`3119`. Otherwise, " +"*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" +"اگر *cls* متد :meth:`~type.__instancecheck__` را داشته باشد، این متد برای " +"تعیین وضعیت زیرکلاس بودن، همان‌طور که در :pep:`3119` توضیح داده شده است، " +"فراخوانی می‌شود. در غیر این صورت، *inst* در صورتی نمونه‌ای از *cls* است که " +"کلاس آن زیرکلاسی از *cls* باشد." -msgid "An instance *inst* can override what is considered its class by having a :attr:`~object.__class__` attribute." +msgid "" +"An instance *inst* can override what is considered its class by having " +"a :attr:`~object.__class__` attribute." msgstr "" +"یک نمونه *inst* می‌تواند با داشتن ویژگی :attr:`~object.__class__`، آنچه را " +"که به‌عنوان کلاس آن در نظر گرفته می‌شود بازنویسی کند." -msgid "An object *cls* can override if it is considered a class, and what its base classes are, by having a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." +msgid "" +"An object *cls* can override if it is considered a class, and what its base " +"classes are, by having a :attr:`~type.__bases__` attribute (which must be a " +"tuple of base classes)." msgstr "" +"یک شیء *cls* می‌تواند با داشتن ویژگی :attr:`~type.__bases__` (که باید تاپلی " +"از کلاس‌های پایه باشد) بازنویسی کند که آیا به‌عنوان کلاس در نظر گرفته می‌شود، " +"و کلاس‌های پایه‌اش چه هستند." -msgid "Compute and return the hash value of an object *o*. On failure, return ``-1``. This is the equivalent of the Python expression ``hash(o)``." +msgid "" +"Compute and return the hash value of an object *o*. On failure, return " +"``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" +"مقدار هش یک شیء *o* را محاسبه کرده و برمی‌گرداند. در صورت شکست، ``-1`` " +"برمی‌گرداند. این معادل عبارت پایتونی ``hash(o)`` است." -msgid "The return type is now Py_hash_t. This is a signed integer the same size as :c:type:`Py_ssize_t`." +msgid "" +"The return type is now Py_hash_t. This is a signed integer the same size " +"as :c:type:`Py_ssize_t`." msgstr "" +"نوع بازگشتی اکنون Py_hash_t است. این یک عدد صحیح علامت‌دار هم‌اندازه " +"با :c:type:`Py_ssize_t` است." -msgid "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` and return ``-1``. This function receives special treatment when stored in a ``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter that it is not hashable." +msgid "" +"Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " +"and return ``-1``. This function receives special treatment when stored in " +"a ``tp_hash`` slot, allowing a type to explicitly indicate to the " +"interpreter that it is not hashable." msgstr "" +"یک :exc:`TypeError` تنظیم می‌کند که نشان می‌دهد ``type(o)`` :term:`hashable` " +"نیست و ``-1`` را برمی‌گرداند. این تابع هنگامی که در جایگاه ``tp_hash`` ذخیره " +"شود، مورد رفتار ویژه‌ای قرار می‌گیرد و به یک نوع اجازه می‌دهد به‌طور صریح به " +"مفسر نشان دهد که هش‌پذیر نیست." -msgid "Returns ``1`` if the object *o* is considered to be true, and ``0`` otherwise. This is equivalent to the Python expression ``not not o``. On failure, return ``-1``." +msgid "" +"Returns ``1`` if the object *o* is considered to be true, and ``0`` " +"otherwise. This is equivalent to the Python expression ``not not o``. On " +"failure, return ``-1``." msgstr "" +"اگر شیء *o* درست در نظر گرفته شود، ``1`` و در غیر این صورت ``0`` را " +"برمی‌گرداند. این معادل عبارت ``not not o`` در پایتون است. در صورت شکست، " +"``-1`` را برمی‌گرداند." -msgid "Returns ``0`` if the object *o* is considered to be true, and ``1`` otherwise. This is equivalent to the Python expression ``not o``. On failure, return ``-1``." +msgid "" +"Returns ``0`` if the object *o* is considered to be true, and ``1`` " +"otherwise. This is equivalent to the Python expression ``not o``. On " +"failure, return ``-1``." msgstr "" +"اگر شیء *o* درست در نظر گرفته شود، ``0`` و در غیر این صورت ``1`` را " +"برمی‌گرداند. این معادل عبارت پایتونی ``not o`` است. در صورت شکست، ``-1`` " +"برمی‌گرداند." -msgid "When *o* is non-``NULL``, returns a type object corresponding to the object type of object *o*. On failure, raises :exc:`SystemError` and returns ``NULL``. This is equivalent to the Python expression ``type(o)``. This function creates a new :term:`strong reference` to the return value. There's really no reason to use this function instead of the :c:func:`Py_TYPE()` function, which returns a pointer of type :c:expr:`PyTypeObject*`, except when a new :term:`strong reference` is needed." -msgstr "" +msgid "" +"When *o* is non-``NULL``, returns a type object corresponding to the object " +"type of object *o*. On failure, raises :exc:`SystemError` and returns " +"``NULL``. This is equivalent to the Python expression ``type(o)``. This " +"function creates a new :term:`strong reference` to the return value. " +"There's really no reason to use this function instead of " +"the :c:func:`Py_TYPE()` function, which returns a pointer of " +"type :c:expr:`PyTypeObject*`, except when a new :term:`strong reference` is " +"needed." +msgstr "" +"وقتی *o* برابر ``NULL`` نباشد، شیء نوعی متناظر با نوع شیءِ *o* برمی‌گرداند. " +"در صورت شکست، استثنای :exc:`SystemError` را ایجاد می‌کند و ``NULL`` را " +"برمی‌گرداند. این معادل عبارت پایتونی ``type(o)`` است. این تابع " +"یک :term:`ارجاع قوی ` جدید به مقدار بازگشتی ایجاد می‌کند. " +"واقعاً هیچ دلیلی برای استفاده از این تابع به‌جای تابع :c:func:`Py_TYPE()` که " +"اشاره‌گری از نوع :c:expr:`PyTypeObject*` برمی‌گرداند وجود ندارد، مگر زمانی که " +"به یک :term:`ارجاع قوی ` جدید نیاز باشد." -msgid "Return non-zero if the object *o* is of type *type* or a subtype of *type*, and ``0`` otherwise. Both parameters must be non-``NULL``." +msgid "" +"Return non-zero if the object *o* is of type *type* or a subtype of *type*, " +"and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" +"اگر شیء *o* از نوع *type* یا زیرنوعی از *type* باشد، مقدار ناصفر و در غیر " +"این صورت ``0`` برمی‌گرداند. هر دو پارامتر باید غیر ``NULL`` باشند." -msgid "Return the length of object *o*. If the object *o* provides either the sequence and mapping protocols, the sequence length is returned. On error, ``-1`` is returned. This is the equivalent to the Python expression ``len(o)``." +msgid "" +"Return the length of object *o*. If the object *o* provides either the " +"sequence and mapping protocols, the sequence length is returned. On error, " +"``-1`` is returned. This is the equivalent to the Python expression " +"``len(o)``." msgstr "" +"طول شیء *o* را برمی‌گرداند. اگر شیء *o* هر یک از پروتکل‌های دنباله و نگاشت را " +"فراهم کند، طول دنباله برگردانده می‌شود. در صورت خطا، ``-1`` برگردانده می‌شود. " +"این معادل عبارت پایتونی ``len(o)`` است." -msgid "Return an estimated length for the object *o*. First try to return its actual length, then an estimate using :meth:`~object.__length_hint__`, and finally return the default value. On error return ``-1``. This is the equivalent to the Python expression ``operator.length_hint(o, defaultvalue)``." +msgid "" +"Return an estimated length for the object *o*. First try to return its " +"actual length, then an estimate using :meth:`~object.__length_hint__`, and " +"finally return the default value. On error return ``-1``. This is the " +"equivalent to the Python expression ``operator.length_hint(o, " +"defaultvalue)``." msgstr "" +"طول تخمینی شیء *o* را برمی‌گرداند. ابتدا تلاش می‌کند طول واقعی آن را " +"برگرداند، سپس تخمینی با استفاده از :meth:`~object.__length_hint__` و در " +"نهایت مقدار پیش‌فرض را برمی‌گرداند. در صورت خطا ``-1`` را برمی‌گرداند. این " +"معادل عبارت پایتون ``operator.length_hint(o, defaultvalue)`` است." -msgid "Return element of *o* corresponding to the object *key* or ``NULL`` on failure. This is the equivalent of the Python expression ``o[key]``." +msgid "" +"Return element of *o* corresponding to the object *key* or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" +"عنصر *o* متناظر با شیء *key* را برمی‌گرداند، یا در صورت شکست ``NULL`` " +"برمی‌گرداند. این معادل عبارت پایتون ``o[key]`` است." -msgid "Map the object *key* to the value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on success. This is the equivalent of the Python statement ``o[key] = v``. This function *does not* steal a reference to *v*." +msgid "" +"Map the object *key* to the value *v*. Raise an exception and return " +"``-1`` on failure; return ``0`` on success. This is the equivalent of the " +"Python statement ``o[key] = v``. This function *does not* steal a " +"reference to *v*." msgstr "" +"شیء *key* را به مقدار *v* نگاشت می‌کند. در صورت شکست، یک استثنا ایجاد می‌کند " +"و ``-1`` را برمی‌گرداند؛ در صورت موفقیت ``0`` را برمی‌گرداند. این کار معادل " +"دستور پایتونی ``o[key] = v`` است. این تابع ارجاعی به *v* را *نمی‌دزدد*." -msgid "Remove the mapping for the object *key* from the object *o*. Return ``-1`` on failure. This is equivalent to the Python statement ``del o[key]``." +msgid "" +"Remove the mapping for the object *key* from the object *o*. Return ``-1`` " +"on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" +"نگاشت مربوط به شیء *key* را از شیء *o* حذف می‌کند. در صورت شکست ``-1`` " +"برمی‌گرداند. این کار معادل دستور ``del o[key]`` در پایتون است." -msgid "This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgid "" +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" +"این همان :c:func:`PyObject_DelItem` است، اما *key* به‌جای " +"یک :c:expr:`PyObject*`، به‌صورت یک رشته بایتی کدگذاری‌شده با UTF-8 از " +"نوع :c:expr:`const char*` مشخص می‌شود." -msgid "This is equivalent to the Python expression ``dir(o)``, returning a (possibly empty) list of strings appropriate for the object argument, or ``NULL`` if there was an error. If the argument is ``NULL``, this is like the Python ``dir()``, returning the names of the current locals; in this case, if no execution frame is active then ``NULL`` is returned but :c:func:`PyErr_Occurred` will return false." -msgstr "" +msgid "" +"This is equivalent to the Python expression ``dir(o)``, returning a " +"(possibly empty) list of strings appropriate for the object argument, or " +"``NULL`` if there was an error. If the argument is ``NULL``, this is like " +"the Python ``dir()``, returning the names of the current locals; in this " +"case, if no execution frame is active then ``NULL`` is returned " +"but :c:func:`PyErr_Occurred` will return false." +msgstr "" +"این معادل عبارت پایتونی ``dir(o)`` است که فهرستی (احتمالاً خالی) از رشته‌های " +"مناسب برای آرگومان شیء برمی‌گرداند، یا اگر خطایی رخ داده باشد، ``NULL`` " +"برمی‌گرداند. اگر آرگومان ``NULL`` باشد، این مانند ``dir()`` پایتون عمل می‌کند " +"و نام‌های متغیرهای محلی فعلی را برمی‌گرداند؛ در این حالت، اگر هیچ فریم اجرا " +"(execution frame) فعالی وجود نداشته باشد، ``NULL`` برگردانده می‌شود، " +"اما :c:func:`PyErr_Occurred` مقدار false را برمی‌گرداند." -msgid "This is equivalent to the Python expression ``iter(o)``. It returns a new iterator for the object argument, or the object itself if the object is already an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the object cannot be iterated." +msgid "" +"This is equivalent to the Python expression ``iter(o)``. It returns a new " +"iterator for the object argument, or the object itself if the object is " +"already an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the " +"object cannot be iterated." msgstr "" +"این معادل عبارت پایتونی ``iter(o)`` است. یک پیمایش‌گر جدید برای آرگومان شیء " +"برمی‌گرداند، یا اگر شیء از قبل یک پیمایش‌گر باشد، خودِ شیء را برمی‌گرداند. اگر " +"شیء پیمایش‌پذیر نباشد، استثنای :exc:`TypeError` را مطرح می‌کند و ``NULL`` " +"برمی‌گرداند." -msgid "This is equivalent to the Python ``__iter__(self): return self`` method. It is intended for :term:`iterator` types, to be used in the :c:member:`PyTypeObject.tp_iter` slot." +msgid "" +"This is equivalent to the Python ``__iter__(self): return self`` method. It " +"is intended for :term:`iterator` types, to be used in " +"the :c:member:`PyTypeObject.tp_iter` slot." msgstr "" +"این معادل متد ``__iter__(self): return self`` در پایتون است. این برای " +"نوع‌های :term:`iterator` در نظر گرفته شده است تا در " +"جایگاه :c:member:`PyTypeObject.tp_iter` استفاده شود." -msgid "This is the equivalent to the Python expression ``aiter(o)``. Takes an :class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. This is typically a new iterator but if the argument is an :class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and returns ``NULL`` if the object cannot be iterated." -msgstr "" +msgid "" +"This is the equivalent to the Python expression ``aiter(o)``. Takes " +"an :class:`AsyncIterable` object and returns an :class:`AsyncIterator` for " +"it. This is typically a new iterator but if the argument is " +"an :class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and " +"returns ``NULL`` if the object cannot be iterated." +msgstr "" +"این معادل عبارت پایتونی ``aiter(o)`` است. یک شیء :class:`AsyncIterable` " +"می‌گیرد و یک :class:`AsyncIterator` برای آن برمی‌گرداند. این معمولاً یک " +"پیمایش‌گر جدید است، اما اگر آرگومان یک :class:`AsyncIterator` باشد، خودِ آن " +"بازگردانده می‌شود. اگر شیء قابل پیمایش نباشد، خطای :exc:`TypeError` ایجاد " +"می‌کند و ``NULL`` را برمی‌گرداند." msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" +"یک اشاره‌گر به داده‌های اختصاصی زیرکلاس که برای *cls* رزرو شده‌اند را دریافت " +"کنید." -msgid "The object *o* must be an instance of *cls*, and *cls* must have been created using negative :c:member:`PyType_Spec.basicsize`. Python does not check this." +msgid "" +"The object *o* must be an instance of *cls*, and *cls* must have been " +"created using negative :c:member:`PyType_Spec.basicsize`. Python does not " +"check this." msgstr "" +"شیء *o* باید نمونه‌ای از *cls* باشد و *cls* باید با استفاده " +"از :c:member:`PyType_Spec.basicsize` منفی ایجاد شده باشد. پایتون این موضوع " +"را بررسی نمی‌کند." msgid "On error, set an exception and return ``NULL``." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم کنید و ``NULL`` را برگردانید." -msgid "Return the size of the instance memory space reserved for *cls*, i.e. the size of the memory :c:func:`PyObject_GetTypeData` returns." +msgid "" +"Return the size of the instance memory space reserved for *cls*, i.e. the " +"size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" +"اندازه‌ی فضای حافظه‌ی نمونه‌ی رزرو‌شده برای *cls* را بازمی‌گرداند، یعنی اندازه‌ی " +"حافظه‌ای که :c:func:`PyObject_GetTypeData` بازمی‌گرداند." -msgid "This may be larger than requested using :c:member:`-PyType_Spec.basicsize `; it is safe to use this larger size (e.g. with :c:func:`!memset`)." +msgid "" +"This may be larger than requested using :c:member:`-PyType_Spec.basicsize " +"`; it is safe to use this larger size (e.g. " +"with :c:func:`!memset`)." msgstr "" +"این اندازه ممکن است بزرگ‌تر از مقدار درخواست‌شده با استفاده از :c:member:`-" +"PyType_Spec.basicsize ` باشد؛ استفاده از این اندازه‌ی " +"بزرگ‌تر ایمن است (مثلاً با :c:func:`!memset`)." -msgid "The type *cls* **must** have been created using negative :c:member:`PyType_Spec.basicsize`. Python does not check this." +msgid "" +"The type *cls* **must** have been created using " +"negative :c:member:`PyType_Spec.basicsize`. Python does not check this." msgstr "" +"نوع *cls* **باید** با استفاده از :c:member:`PyType_Spec.basicsize` منفی " +"ایجاد شده باشد. پایتون این را بررسی نمی‌کند." msgid "On error, set an exception and return a negative value." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم و مقدار منفی برگردانده می‌شود." -msgid "Get a pointer to per-item data for a class with :c:macro:`Py_TPFLAGS_ITEMS_AT_END`." +msgid "" +"Get a pointer to per-item data for a class " +"with :c:macro:`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" +"گرفتن اشاره‌گر به داده‌های هر آیتم برای کلاسی " +"با :c:macro:`Py_TPFLAGS_ITEMS_AT_END`." -msgid "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." +msgid "" +"On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " +"raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" +"در صورت خطا، یک استثنا تنظیم کرده و ``NULL`` را برگردانید. " +"استثنای :py:exc:`TypeError` در صورتی ایجاد می‌شود که " +"پرچم :c:macro:`Py_TPFLAGS_ITEMS_AT_END` روی *o* تنظیم نشده باشد." msgid "Visit the managed dictionary of *obj*." -msgstr "" +msgstr "دیکشنری مدیریت‌شده‌ی *obj* را بازدید می‌کند." -msgid "This function must only be called in a traverse function of the type which has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." +msgid "" +"This function must only be called in a traverse function of the type which " +"has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" +"این تابع باید فقط در تابع پیمایش (traverse) نوعی فراخوانی شود که " +"پرچم :c:macro:`Py_TPFLAGS_MANAGED_DICT` روی آن تنظیم شده باشد." msgid "Clear the managed dictionary of *obj*." -msgstr "" +msgstr "دیکشنری مدیریت‌شده‌ی *obj* را پاک کنید." -msgid "This function must only be called in a clear function of the type which has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." +msgid "" +"This function must only be called in a clear function of the type which has " +"the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" +"این تابع باید فقط در تابع پاک‌سازی (clear function) نوعی که " +"پرچم :c:macro:`Py_TPFLAGS_MANAGED_DICT` روی آن تنظیم شده است، فراخوانی شود." -msgid "Enable `deferred reference counting `_ on *obj*, if supported by the runtime. In the :term:`free-threaded ` build, this allows the interpreter to avoid reference count adjustments to *obj*, which may improve multi-threaded performance. The tradeoff is that *obj* will only be deallocated by the tracing garbage collector, and not when the interpreter no longer has any references to it." -msgstr "" +msgid "" +"Enable `deferred reference counting `_ on *obj*, if supported by the runtime. In " +"the :term:`free-threaded ` build, this allows the " +"interpreter to avoid reference count adjustments to *obj*, which may " +"improve multi-threaded performance. The tradeoff is that *obj* will only " +"be deallocated by the tracing garbage collector, and not when the " +"interpreter no longer has any references to it." +msgstr "" +"`شمارش ارجاعِ معوق `_ را روی *obj* فعال می‌کند، اگر ران‌تایم از آن پشتیبانی کند. در " +"بیلدِ :term:`نخ‌آزاد `، این به مفسر اجازه می‌دهد تا از تعدیل " +"شمارش ارجاعِ *obj* اجتناب کند، که ممکن است کارایی چندنخی را بهبود بخشد. " +"بهای آن این است که *obj* فقط توسط زباله‌روبِ ردیابی (tracing garbage " +"collector) آزادسازی خواهد شد، و نه زمانی که مفسر دیگر هیچ ارجاعی به آن " +"ندارد." -msgid "This function returns ``1`` if deferred reference counting is enabled on *obj*, and ``0`` if deferred reference counting is not supported or if the hint was ignored by the interpreter, such as when deferred reference counting is already enabled on *obj*. This function is thread-safe, and cannot fail." +msgid "" +"This function returns ``1`` if deferred reference counting is enabled on " +"*obj*, and ``0`` if deferred reference counting is not supported or if the " +"hint was ignored by the interpreter, such as when deferred reference " +"counting is already enabled on *obj*. This function is thread-safe, and " +"cannot fail." msgstr "" +"این تابع در صورتی که شمارش ارجاعِ معوق روی *obj* فعال باشد، مقدار ``1`` را " +"برمی‌گرداند و در صورتی که شمارش ارجاعِ معوق پشتیبانی نشده باشد یا مفسر راهنما " +"را نادیده گرفته باشد (مانند زمانی که شمارش ارجاعِ معوق از قبل روی *obj* فعال " +"باشد)، مقدار ``0`` را برمی‌گرداند. این تابع نخ‌ایمن است و نمی‌تواند شکست بخورد." -msgid "This function does nothing on builds with the :term:`GIL` enabled, which do not support deferred reference counting. This also does nothing if *obj* is not an object tracked by the garbage collector (see :func:`gc.is_tracked` and :c:func:`PyObject_GC_IsTracked`)." +msgid "" +"This function does nothing on builds with the :term:`GIL` enabled, which do " +"not support deferred reference counting. This also does nothing if *obj* is " +"not an object tracked by the garbage collector (see :func:`gc.is_tracked` " +"and :c:func:`PyObject_GC_IsTracked`)." msgstr "" +"این تابع در نسخه‌های ساخته‌شده‌ای که :term:`GIL` در آن‌ها فعال است و از شمارش " +"ارجاعِ معوق پشتیبانی نمی‌کنند، هیچ کاری انجام نمی‌دهد. همچنین اگر *obj* شیئی " +"نباشد که توسط زباله‌روب پیگیری می‌شود، این تابع هیچ کاری انجام نمی‌دهد " +"(به :func:`gc.is_tracked` و :c:func:`PyObject_GC_IsTracked` مراجعه کنید)." -msgid "This function is intended to be used soon after *obj* is created, by the code that creates it, such as in the object's :c:member:`~PyTypeObject.tp_new` slot." +msgid "" +"This function is intended to be used soon after *obj* is created, by the " +"code that creates it, such as in the " +"object's :c:member:`~PyTypeObject.tp_new` slot." msgstr "" +"این تابع برای استفاده به‌زودی پس از ایجاد *obj*، توسط کدی که آن را ایجاد " +"می‌کند، در نظر گرفته شده است؛ برای مثال در " +"جایگاه :c:member:`~PyTypeObject.tp_new` شیء." -msgid "Check if *obj* is a unique temporary object. Returns ``1`` if *obj* is known to be a unique temporary object, and ``0`` otherwise. This function cannot fail, but the check is conservative, and may return ``0`` in some cases even if *obj* is a unique temporary object." +msgid "" +"Check if *obj* is a unique temporary object. Returns ``1`` if *obj* is " +"known to be a unique temporary object, and ``0`` otherwise. This function " +"cannot fail, but the check is conservative, and may return ``0`` in some " +"cases even if *obj* is a unique temporary object." msgstr "" +"بررسی می‌کند که آیا *obj* یک شیء موقت یکتا است یا نه. اگر مشخص باشد که *obj* " +"یک شیء موقت یکتا است، ``1`` و در غیر این صورت ``0`` را برمی‌گرداند. این تابع " +"نمی‌تواند شکست بخورد، اما بررسی محافظه‌کارانه است و ممکن است در برخی موارد " +"حتی اگر *obj* یک شیء موقت یکتا باشد، ``0`` برگرداند." -msgid "If an object is a unique temporary, it is guaranteed that the current code has the only reference to the object. For arguments to C functions, this should be used instead of checking if the reference count is ``1``. Starting with Python 3.14, the interpreter internally avoids some reference count modifications when loading objects onto the operands stack by :term:`borrowing ` references when possible, which means that a reference count of ``1`` by itself does not guarantee that a function argument uniquely referenced." -msgstr "" +msgid "" +"If an object is a unique temporary, it is guaranteed that the current code " +"has the only reference to the object. For arguments to C functions, this " +"should be used instead of checking if the reference count is ``1``. " +"Starting with Python 3.14, the interpreter internally avoids some reference " +"count modifications when loading objects onto the operands stack " +"by :term:`borrowing ` references when possible, which " +"means that a reference count of ``1`` by itself does not guarantee that a " +"function argument uniquely referenced." +msgstr "" +"اگر شیئی موقتِ یکتا (unique temporary) باشد، تضمین می‌شود که کد فعلی تنها " +"ارجاع به آن شیء را دارد. برای آرگومان‌های توابع C، باید از این به‌جای بررسی " +"اینکه آیا شمارش ارجاع ``1`` است استفاده کرد. از پایتون 3.14 به بعد، مفسر " +"به‌صورت داخلی هنگام بارگذاری اشیاء روی پشته عملوندها، در صورت امکان " +"با :term:`امانت گرفتن ` ارجاع‌ها، از برخی از تغییرات " +"شمارش ارجاع اجتناب می‌کند؛ این بدان معناست که شمارش ارجاع ``1`` به‌تنهایی " +"تضمین نمی‌کند که آرگومان تابع به‌طور یکتا ارجاع شده باشد." -msgid "In the example below, ``my_func`` is called with a unique temporary object as its argument::" +msgid "" +"In the example below, ``my_func`` is called with a unique temporary object " +"as its argument::" msgstr "" +"در مثال زیر، ``my_func`` با یک شیء موقت یکتا به‌عنوان آرگومان خود فراخوانی " +"می‌شود::" msgid "my_func([1, 2, 3])" -msgstr "" +msgstr "my_func([1, 2, 3])" -msgid "In the example below, ``my_func`` is **not** called with a unique temporary object as its argument, even if its refcount is ``1``::" +msgid "" +"In the example below, ``my_func`` is **not** called with a unique temporary " +"object as its argument, even if its refcount is ``1``::" msgstr "" +"در مثال زیر، ``my_func`` با یک شیء موقت یکتا به‌عنوان آرگومان خود فراخوانی " +"**نمی‌شود**، حتی اگر شمارش ارجاع آن ``1`` باشد::" msgid "" "my_list = [1, 2, 3]\n" "my_func(my_list)" msgstr "" +"my_list = [1, 2, 3]\n" +"my_func(my_list)" msgid "See also the function :c:func:`Py_REFCNT`." -msgstr "" +msgstr "همچنین تابع :c:func:`Py_REFCNT` را ببینید." -msgid "This function returns non-zero if *obj* is :term:`immortal`, and zero otherwise. This function cannot fail." +msgid "" +"This function returns non-zero if *obj* is :term:`immortal`, and zero " +"otherwise. This function cannot fail." msgstr "" +"این تابع در صورتی که *obj* :term:`نامیرا ` باشد، مقدار غیرصفر و " +"در غیر این صورت صفر را برمی‌گرداند. این تابع نمی‌تواند شکست بخورد." -msgid "Objects that are immortal in one CPython version are not guaranteed to be immortal in another." +msgid "" +"Objects that are immortal in one CPython version are not guaranteed to be " +"immortal in another." msgstr "" +"اشیایی که در یک نسخه از سی‌پایتون نامیرا هستند، تضمین نمی‌شود که در نسخه‌ای " +"دیگر نیز نامیرا باشند." -msgid "Increments the reference count of *obj* if it is not zero. Returns ``1`` if the object's reference count was successfully incremented. Otherwise, this function returns ``0``." +msgid "" +"Increments the reference count of *obj* if it is not zero. Returns ``1`` " +"if the object's reference count was successfully incremented. Otherwise, " +"this function returns ``0``." msgstr "" +"شمارش ارجاع *obj* را در صورتی که صفر نباشد افزایش می‌دهد. اگر شمارش ارجاع " +"شیء با موفقیت افزایش یافته باشد، ``1`` را برمی‌گرداند. در غیر این صورت، این " +"تابع ``0`` را برمی‌گرداند." -msgid ":c:func:`PyUnstable_EnableTryIncRef` must have been called earlier on *obj* or this function may spuriously return ``0`` in the :term:`free-threaded build`." +msgid "" +":c:func:`PyUnstable_EnableTryIncRef` must have been called earlier on *obj* " +"or this function may spuriously return ``0`` in the :term:`free-threaded " +"build`." msgstr "" +":c:func:`PyUnstable_EnableTryIncRef` باید پیش‌تر روی *obj* فراخوانی شده " +"باشد؛ در غیر این صورت، این تابع ممکن است در :term:`بیلد نخ‌آزاد ` به‌طور کاذب ``0`` را برگرداند." -msgid "This function is logically equivalent to the following C code, except that it behaves atomically in the :term:`free-threaded build`::" +msgid "" +"This function is logically equivalent to the following C code, except that " +"it behaves atomically in the :term:`free-threaded build`::" msgstr "" +"این تابع از نظر منطقی معادل کد C زیر است، با این تفاوت که در :term:`free-" +"threaded build` به‌صورت اتمیک رفتار می‌کند::" msgid "" "if (Py_REFCNT(op) > 0) {\n" @@ -420,12 +1047,30 @@ msgid "" "}\n" "return 0;" msgstr "" +"if (Py_REFCNT(op) > 0) {\n" +" Py_INCREF(op);\n" +" return 1;\n" +"}\n" +"return 0;" -msgid "This is intended as a building block for managing weak references without the overhead of a Python :ref:`weak reference object `." +msgid "" +"This is intended as a building block for managing weak references without " +"the overhead of a Python :ref:`weak reference object `." msgstr "" +"این به‌عنوان یک بلوک سازنده برای مدیریت ارجاع‌های ضعیف بدون سربار " +"یک :ref:`شیء ارجاع ضعیف ` پایتون در نظر گرفته شده است." -msgid "Typically, correct use of this function requires support from *obj*'s deallocator (:c:member:`~PyTypeObject.tp_dealloc`). For example, the following sketch could be adapted to implement a \"weakmap\" that works like a :py:class:`~weakref.WeakValueDictionary` for a specific type:" +msgid "" +"Typically, correct use of this function requires support from *obj*'s " +"deallocator (:c:member:`~PyTypeObject.tp_dealloc`). For example, the " +"following sketch could be adapted to implement a \"weakmap\" that works " +"like a :py:class:`~weakref.WeakValueDictionary` for a specific type:" msgstr "" +"معمولاً، استفاده‌ی صحیح از این تابع نیازمند پشتیبانی از سوی تخصیص‌گشا " +"(deallocator) مربوط به *obj* (:c:member:`~PyTypeObject.tp_dealloc`) است. " +"برای مثال، می‌توان طرح زیر را برای پیاده‌سازی «weakmap»‌ای که " +"مانند :py:class:`~weakref.WeakValueDictionary` برای یک نوع مشخص کار می‌کند، " +"تطبیق داد:" msgid "" "PyMutex mutex;\n" @@ -470,45 +1115,109 @@ msgid "" " PyMutex_Unlock(&mutex);\n" "}" msgstr "" +"PyMutex mutex;\n" +"\n" +"PyObject *\n" +"add_entry(weakmap_key_type *key, PyObject *value)\n" +"{\n" +" PyUnstable_EnableTryIncRef(value);\n" +" weakmap_type weakmap = ...;\n" +" PyMutex_Lock(&mutex);\n" +" weakmap_add_entry(weakmap, key, value);\n" +" PyMutex_Unlock(&mutex);\n" +" Py_RETURN_NONE;\n" +"}\n" +"\n" +"PyObject *\n" +"get_value(weakmap_key_type *key)\n" +"{\n" +" weakmap_type weakmap = ...;\n" +" PyMutex_Lock(&mutex);\n" +" PyObject *result = weakmap_find(weakmap, key);\n" +" if (PyUnstable_TryIncRef(result)) {\n" +" // `result` is safe to use\n" +" PyMutex_Unlock(&mutex);\n" +" return result;\n" +" }\n" +" // if we get here, `result` is starting to be garbage-collected,\n" +" // but has not been removed from the weakmap yet\n" +" PyMutex_Unlock(&mutex);\n" +" return NULL;\n" +"}\n" +"\n" +"// tp_dealloc function for weakmap values\n" +"void\n" +"value_dealloc(PyObject *value)\n" +"{\n" +" weakmap_type weakmap = ...;\n" +" PyMutex_Lock(&mutex);\n" +" weakmap_remove_value(weakmap, value);\n" +"\n" +" ...\n" +" PyMutex_Unlock(&mutex);\n" +"}" -msgid "Enables subsequent uses of :c:func:`PyUnstable_TryIncRef` on *obj*. The caller must hold a :term:`strong reference` to *obj* when calling this." +msgid "" +"Enables subsequent uses of :c:func:`PyUnstable_TryIncRef` on *obj*. The " +"caller must hold a :term:`strong reference` to *obj* when calling this." msgstr "" +"امکان استفاده‌های بعدی از :c:func:`PyUnstable_TryIncRef` روی *obj* را فراهم " +"می‌کند. فراخواننده باید هنگام فراخوانی این تابع، یک :term:`ارجاع قوی ` به *obj* داشته باشد." msgid "Determine if *op* only has one reference." -msgstr "" +msgstr "تشخیص می‌دهد که آیا *op* فقط یک ارجاع دارد یا خیر." -msgid "On GIL-enabled builds, this function is equivalent to :c:expr:`Py_REFCNT(op) == 1`." +msgid "" +"On GIL-enabled builds, this function is equivalent " +"to :c:expr:`Py_REFCNT(op) == 1`." msgstr "" +"در بیلدهای دارای قفل مفسر سراسری، این تابع معادل :c:expr:`Py_REFCNT(op) == " +"1` است." -msgid "On a :term:`free-threaded build`, this checks if *op*'s :term:`reference count` is equal to one and additionally checks if *op* is only used by this thread. :c:expr:`Py_REFCNT(op) == 1` is **not** thread-safe on free-threaded builds; prefer this function." +msgid "" +"On a :term:`free-threaded build`, this checks if *op*'s :term:`reference " +"count` is equal to one and additionally checks if *op* is only used by this " +"thread. :c:expr:`Py_REFCNT(op) == 1` is **not** thread-safe on free-" +"threaded builds; prefer this function." msgstr "" +"در :term:`بیلد نخ‌آزاد `، این تابع بررسی می‌کند " +"که :term:`شمارش ارجاع ` *op* برابر با یک باشد و به‌علاوه " +"بررسی می‌کند که *op* تنها توسط این نخ استفاده می‌شود. :c:expr:`Py_REFCNT(op) " +"== 1` در بیلدهای نخ‌آزاد نخ‌ایمن **نیست**؛ استفاده از این تابع را ترجیح دهید." -msgid "The caller must hold an :term:`attached thread state`, despite the fact that this function doesn't call into the Python interpreter. This function cannot fail." +msgid "" +"The caller must hold an :term:`attached thread state`, despite the fact " +"that this function doesn't call into the Python interpreter. This function " +"cannot fail." msgstr "" +"فراخوانی‌کننده باید یک :term:`attached thread state` را در اختیار داشته " +"باشد، با وجود اینکه این تابع مفسر پایتون را فراخوانی نمی‌کند. این تابع " +"نمی‌تواند شکست بخورد." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "repr" -msgstr "" +msgstr "repr" msgid "ascii" -msgstr "" +msgstr "ascii" msgid "string" -msgstr "" +msgstr "رشته" msgid "PyObject_Str (C function)" -msgstr "" +msgstr "PyObject_Str (تابع C)" msgid "bytes" -msgstr "" +msgstr "bytes" msgid "hash" -msgstr "" +msgstr "هش" msgid "type" -msgstr "" +msgstr "نوع" msgid "len" -msgstr "" +msgstr "len" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index 90df64831..6125faca8 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -22,7 +22,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Object Implementation Support" -msgstr "" +msgstr "پشتیبانی از پیاده‌سازی شیء" -msgid "This chapter describes the functions, types, and macros used when defining new object types." +msgid "" +"This chapter describes the functions, types, and macros used when defining " +"new object types." msgstr "" +"این فصل توابع، نوع‌ها و ماکروهایی را که هنگام تعریف نوع‌های جدید شیء به کار " +"می‌روند، شرح می‌دهد." diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index 185760430..d96009d7e 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -22,75 +22,168 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Support for Perf Maps" -msgstr "" +msgstr "پشتیبانی از Perf Maps" -msgid "On supported platforms (as of this writing, only Linux), the runtime can take advantage of *perf map files* to make Python functions visible to an external profiling tool (such as `perf `_). A running process may create a file in the ``/tmp`` directory, which contains entries that can map a section of executable code to a name. This interface is described in the `documentation of the Linux Perf tool `_." -msgstr "" +msgid "" +"On supported platforms (as of this writing, only Linux), the runtime can " +"take advantage of *perf map files* to make Python functions visible to an " +"external profiling tool (such as `perf " +"`_). A running process may" +" create a file in the ``/tmp`` directory, which contains entries that can " +"map a section of executable code to a name. This interface is described in " +"the `documentation of the Linux Perf tool " +"`_." +msgstr "" +"در پلتفرم‌های پشتیبانی‌شده (در زمان نگارش این متن، تنها لینوکس)، ران‌تایم " +"می‌تواند از *پرونده‌های نگاشت perf* بهره بگیرد تا توابع پایتون برای یک ابزار" +" پروفایل‌گیری خارجی (مانند `perf " +"`_) قابل مشاهده شوند. یک " +"فرایند در حال اجرا ممکن است پرونده‌ای در پوشه‌ی ``/tmp`` ایجاد کند که حاوی " +"ورودی‌هایی است که می‌توانند بخشی از کد اجرایی را به یک نام نگاشت کنند. این " +"رابط در `مستندات ابزار Linux Perf `_ شرح داده شده است." -msgid "In Python, these helper APIs can be used by libraries and features that rely on generating machine code on the fly." +msgid "" +"In Python, these helper APIs can be used by libraries and features that rely" +" on generating machine code on the fly." msgstr "" +"در پایتون، کتابخانه‌ها و قابلیت‌هایی که به تولید کد ماشین در لحظه " +"وابسته‌اند، می‌توانند از این APIهای کمکی استفاده کنند." -msgid "Note that holding an :term:`attached thread state` is not required for these APIs." +msgid "" +"Note that holding an :term:`attached thread state` is not required for these" +" APIs." msgstr "" +"توجه داشته باشید که نگه‌داشتن :term:`attached thread state` برای این API‌ها " +"الزامی نیست." -msgid "Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create a lock to ensure thread-safe writes to the file (provided the writes are done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no need to call this explicitly; just use :c:func:`PyUnstable_WritePerfMapEntry` and it will initialize the state on first call." -msgstr "" +msgid "" +"Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create" +" a lock to ensure thread-safe writes to the file (provided the writes are " +"done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no " +"need to call this explicitly; just use " +":c:func:`PyUnstable_WritePerfMapEntry` and it will initialize the state on " +"first call." +msgstr "" +"پرونده‌ی ``/tmp/perf-$pid.map`` را باز کنید، مگر اینکه از قبل باز شده باشد، " +"و یک قفل ایجاد کنید تا نوشتن در پرونده به‌صورت نخ‌ایمن تضمین شود (به شرطی که" +" نوشتن‌ها از طریق :c:func:`PyUnstable_WritePerfMapEntry` انجام شوند). " +"معمولاً نیازی به فراخوانی صریح آن نیست؛ کافی است از " +":c:func:`PyUnstable_WritePerfMapEntry` استفاده کنید و این تابع وضعیت را در " +"نخستین فراخوانی مقداردهی اولیه می‌کند." -msgid "Returns ``0`` on success, ``-1`` on failure to create/open the perf map file, or ``-2`` on failure to create a lock. Check ``errno`` for more information about the cause of a failure." +msgid "" +"Returns ``0`` on success, ``-1`` on failure to create/open the perf map " +"file, or ``-2`` on failure to create a lock. Check ``errno`` for more " +"information about the cause of a failure." msgstr "" +"در صورت موفقیت مقدار ``0``، در صورت شکست در ایجاد/باز کردن پرونده‌ی perf map" +" مقدار ``-1`` و در صورت شکست در ایجاد قفل مقدار ``-2`` را برمی‌گرداند. برای " +"کسب اطلاعات بیشتر درباره‌ی علت شکست، ``errno`` را بررسی کنید." -msgid "Write one single entry to the ``/tmp/perf-$pid.map`` file. This function is thread safe. Here is what an example entry looks like::" +msgid "" +"Write one single entry to the ``/tmp/perf-$pid.map`` file. This function is " +"thread safe. Here is what an example entry looks like::" msgstr "" +"یک ورودی واحد را در پرونده‌ی ``/tmp/perf-$pid.map`` می‌نویسد. این تابع " +"نخ‌ایمن است. نمونه‌ای از یک ورودی به شکل زیر است::" msgid "" "# address size name\n" "7f3529fcf759 b py::bar:/run/t.py" msgstr "" +"# address size name\n" +"7f3529fcf759 b py::bar:/run/t.py" -msgid "Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, if the perf map file is not already opened. Returns ``0`` on success, or the same error codes as :c:func:`PyUnstable_PerfMapState_Init` on failure." +msgid "" +"Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " +"if the perf map file is not already opened. Returns ``0`` on success, or the" +" same error codes as :c:func:`PyUnstable_PerfMapState_Init` on failure." msgstr "" +"اگر پرونده‌ی perf map از قبل باز نشده باشد، پیش از نوشتن ورودی، " +":c:func:`PyUnstable_PerfMapState_Init` فراخوانی می‌شود. در صورت موفقیت ``0``" +" و در صورت شکست، همان کدهای خطای :c:func:`PyUnstable_PerfMapState_Init` را " +"برمی‌گرداند." -msgid "Close the perf map file opened by :c:func:`PyUnstable_PerfMapState_Init`. This is called by the runtime itself during interpreter shut-down. In general, there shouldn't be a reason to explicitly call this, except to handle specific scenarios such as forking." +msgid "" +"Close the perf map file opened by :c:func:`PyUnstable_PerfMapState_Init`. " +"This is called by the runtime itself during interpreter shut-down. In " +"general, there shouldn't be a reason to explicitly call this, except to " +"handle specific scenarios such as forking." msgstr "" +"پرونده‌ی نقشه‌ی perf (perf map) باز‌شده توسط " +":c:func:`PyUnstable_PerfMapState_Init` را می‌بندد. این تابع توسط خودِ " +"ران‌تایم در زمان خاموشی مفسر فراخوانی می‌شود. به‌طور کلی، نباید دلیلی برای " +"فراخوانی صریح آن وجود داشته باشد، مگر برای مدیریت سناریوهای خاص مانند " +"انشعاب." -msgid "Open the ``/tmp/perf-$pid.map`` file and append the content of *parent_filename* to it." +msgid "" +"Open the ``/tmp/perf-$pid.map`` file and append the content of " +"*parent_filename* to it." msgstr "" +"پرونده‌ی ``/tmp/perf-$pid.map`` را باز کنید و محتوای *parent_filename* را به" +" آن الحاق کنید." -msgid "This function is available on all platforms but only generates output on platforms that support perf maps (currently only Linux). On other platforms, it does nothing." +msgid "" +"This function is available on all platforms but only generates output on " +"platforms that support perf maps (currently only Linux). On other platforms," +" it does nothing." msgstr "" +"این تابع در همه‌ی پلتفرم‌ها دسترس‌پذیر است، اما تنها در پلتفرم‌هایی که از " +"نقشه‌های perf (perf maps) پشتیبانی می‌کنند (در حال حاضر فقط لینوکس) خروجی " +"تولید می‌کند. در پلتفرم‌های دیگر، هیچ کاری انجام نمی‌دهد." msgid "Compile the given code object using the current perf trampoline." -msgstr "" +msgstr "شیء کد داده‌شده را با استفاده از ترامپولین فعلی perf کامپایل کنید." -msgid "The \"current\" trampoline is the one set by the runtime or the most recent :c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` call." +msgid "" +"The \"current\" trampoline is the one set by the runtime or the most recent " +":c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` call." msgstr "" +"ترامپولین «جاری» همان ترامپولینی است که توسط ران‌تایم یا جدیدترین فراخوانی " +":c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` تنظیم‌شده است." -msgid "If no trampoline is set, falls back to normal compilation (no perf map entry)." +msgid "" +"If no trampoline is set, falls back to normal compilation (no perf map " +"entry)." msgstr "" +"اگر هیچ ترامپولینی تنظیم‌نشده باشد، به کامپایل عادی بازمی‌گردد (بدون ورودی " +"در نقشه‌ی perf)." msgid "Parameters" -msgstr "" +msgstr "پارامترها" msgid "The code object to compile." -msgstr "" +msgstr "شیء کدی که باید کامپایل شود." msgid "Returns" -msgstr "" +msgstr "بازگشت" msgid "0 on success, -1 on failure." -msgstr "" +msgstr "0 در صورت موفقیت، -1 در صورت شکست." msgid "Set whether the perf trampoline should persist after a fork." -msgstr "" +msgstr "تعیین می‌کند که آیا ترامپولین perf باید پس از فورک پایا بماند یا خیر." -msgid "If ``enable`` is true (non-zero): perf map file remains open/valid post-fork. Child process inherits all existing perf map entries." +msgid "" +"If ``enable`` is true (non-zero): perf map file remains open/valid post-" +"fork. Child process inherits all existing perf map entries." msgstr "" +"اگر ``enable`` درست (ناصفر) باشد: پرونده‌ی perf map پس از انشعاب باز/معتبر " +"باقی می‌ماند. فرایند فرزند تمام ورودی‌های موجود perf map را به ارث می‌برد." -msgid "If ``enable`` is false (zero): perf map closes post-fork. Child process gets empty perf map." +msgid "" +"If ``enable`` is false (zero): perf map closes post-fork. Child process gets" +" empty perf map." msgstr "" +"اگر ``enable`` نادرست (صفر) باشد: نقشه perf (perf map) پس از انشعاب بسته " +"می‌شود. فرایند فرزند نقشه perf خالی دریافت می‌کند." msgid "Default: false (clears on fork)." -msgstr "" +msgstr "پیش‌فرض: false (هنگام انشعاب پاک می‌شود)." msgid "1 to enable, 0 to disable." -msgstr "" +msgstr "۱ برای فعال‌سازی، ۰ برای غیرفعال‌سازی." diff --git a/c-api/picklebuffer.po b/c-api/picklebuffer.po index bb05e03c3..3afc32661 100644 --- a/c-api/picklebuffer.po +++ b/c-api/picklebuffer.po @@ -20,49 +20,92 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pickle buffer objects" -msgstr "" +msgstr "اشیاء بافر پیکل" -msgid "A :class:`pickle.PickleBuffer` object wraps a :ref:`buffer-providing object ` for out-of-band data transfer with the :mod:`pickle` module." +msgid "" +"A :class:`pickle.PickleBuffer` object wraps a :ref:`buffer-providing object " +"` for out-of-band data transfer with the :mod:`pickle` " +"module." msgstr "" +"شیء :class:`pickle.PickleBuffer` یک :ref:`شیء فراهم‌کننده‌ی بافر " +"` را برای انتقال داده‌ی خارج از باند (out-of-band) با ماژول " +":mod:`pickle` دربرمی‌گیرد." -msgid "This instance of :c:type:`PyTypeObject` represents the Python pickle buffer type. This is the same object as :class:`pickle.PickleBuffer` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python pickle buffer " +"type. This is the same object as :class:`pickle.PickleBuffer` in the Python " +"layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع بافر پیکل پایتون را نشان می‌دهد. این" +" همان شیء :class:`pickle.PickleBuffer` در لایه پایتون است." -msgid "Return true if *op* is a pickle buffer instance. This function always succeeds." +msgid "" +"Return true if *op* is a pickle buffer instance. This function always " +"succeeds." msgstr "" +"اگر *op* یک نمونه‌ی بافر پیکل باشد، مقدار true را برمی‌گرداند. این تابع " +"همیشه با موفقیت اجرا می‌شود." msgid "Create a pickle buffer from the object *obj*." -msgstr "" +msgstr "از شیء *obj* یک بافر پیکل بسازید." -msgid "This function will fail if *obj* doesn't support the :ref:`buffer protocol `." +msgid "" +"This function will fail if *obj* doesn't support the :ref:`buffer protocol " +"`." msgstr "" +"این تابع در صورتی که *obj* از :ref:`پروتکل بافر ` پشتیبانی " +"نکند، شکست می‌خورد." -msgid "On success, return a new pickle buffer instance. On failure, set an exception and return ``NULL``." +msgid "" +"On success, return a new pickle buffer instance. On failure, set an " +"exception and return ``NULL``." msgstr "" +"در صورت موفقیت، یک نمونه جدید بافر پیکل برمی‌گرداند. در صورت شکست، یک استثنا" +" تنظیم کرده و ``NULL`` برمی‌گرداند." -msgid "Analogous to calling :class:`pickle.PickleBuffer` with *obj* in Python." -msgstr "" +msgid "" +"Analogous to calling :class:`pickle.PickleBuffer` with *obj* in Python." +msgstr "مشابه فراخوانی :class:`pickle.PickleBuffer` با *obj* در پایتون." -msgid "Get a pointer to the underlying :c:type:`Py_buffer` that the pickle buffer wraps." +msgid "" +"Get a pointer to the underlying :c:type:`Py_buffer` that the pickle buffer " +"wraps." msgstr "" +"یک اشاره‌گر به :c:type:`Py_buffer` زیرین که بافر پیکل دربر می‌گیرد، دریافت " +"کنید." -msgid "The returned pointer is valid as long as *picklebuf* is alive and has not been released. The caller must not modify or free the returned :c:type:`Py_buffer`. If the pickle buffer has been released, raise :exc:`ValueError`." +msgid "" +"The returned pointer is valid as long as *picklebuf* is alive and has not " +"been released. The caller must not modify or free the returned " +":c:type:`Py_buffer`. If the pickle buffer has been released, raise " +":exc:`ValueError`." msgstr "" +"اشاره‌گر بازگردانده‌شده تا زمانی که *picklebuf* زنده باشد و آزاد نشده باشد، " +"معتبر است. فراخواننده نباید :c:type:`Py_buffer` بازگردانده‌شده را تغییر دهد " +"یا آزاد کند. اگر بافر پیکل آزاد شده باشد، استثنای :exc:`ValueError` مطرح " +"می‌شود." -msgid "On success, return a pointer to the buffer view. On failure, set an exception and return ``NULL``." +msgid "" +"On success, return a pointer to the buffer view. On failure, set an " +"exception and return ``NULL``." msgstr "" +"در صورت موفقیت، اشاره‌گری به نمای بافر برگردانده می‌شود. در صورت شکست، یک " +"استثنا تنظیم شده و ``NULL`` برگردانده می‌شود." msgid "Release the underlying buffer held by the pickle buffer." -msgstr "" +msgstr "بافر زیرینِ نگه‌داشته‌شده توسط بافر پیکل را آزاد می‌کند." -msgid "Return ``0`` on success. On failure, set an exception and return ``-1``." +msgid "" +"Return ``0`` on success. On failure, set an exception and return ``-1``." msgstr "" +"در صورت موفقیت ``0`` را برمی‌گرداند. در صورت شکست، یک استثنا تنظیم کرده و " +"``-1`` را برمی‌گرداند." msgid "Analogous to calling :meth:`pickle.PickleBuffer.release` in Python." -msgstr "" +msgstr "معادل فراخوانی :meth:`pickle.PickleBuffer.release` در پایتون است." msgid "object" -msgstr "" +msgstr "شیء" msgid "PickleBuffer" -msgstr "" +msgstr "PickleBuffer" diff --git a/c-api/profiling.po b/c-api/profiling.po index bbce616bf..e8350c4a2 100644 --- a/c-api/profiling.po +++ b/c-api/profiling.po @@ -20,139 +20,347 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Profiling and tracing" -msgstr "" +msgstr "پروفایل‌گیری و ردگیری" -msgid "The Python interpreter provides some low-level support for attaching profiling and execution tracing facilities. These are used for profiling, debugging, and coverage analysis tools." +msgid "" +"The Python interpreter provides some low-level support for attaching " +"profiling and execution tracing facilities. These are used for profiling, " +"debugging, and coverage analysis tools." msgstr "" +"مفسر پایتون پشتیبانی سطح پایینی برای متصل کردن امکانات پروفایل‌گیری و ردگیری" +" اجرا فراهم می‌کند. از این امکانات در ابزارهای پروفایل‌گیری، اشکال‌زدایی و " +"تحلیل پوشش استفاده می‌شود." -msgid "This C interface allows the profiling or tracing code to avoid the overhead of calling through Python-level callable objects, making a direct C function call instead. The essential attributes of the facility have not changed; the interface allows trace functions to be installed per-thread, and the basic events reported to the trace function are the same as had been reported to the Python-level trace functions in previous versions." -msgstr "" +msgid "" +"This C interface allows the profiling or tracing code to avoid the overhead " +"of calling through Python-level callable objects, making a direct C function" +" call instead. The essential attributes of the facility have not changed; " +"the interface allows trace functions to be installed per-thread, and the " +"basic events reported to the trace function are the same as had been " +"reported to the Python-level trace functions in previous versions." +msgstr "" +"این رابط C به کد پروفایل‌گیری یا ردگیری اجازه می‌دهد از سربار فراخوانی از " +"طریق اشیاء فراخوانی‌پذیر در سطح پایتون اجتناب کند و در عوض فراخوانی مستقیم " +"تابع C انجام دهد. ویژگی‌های اساسی این امکان تغییری نکرده‌اند؛ این رابط اجازه" +" می‌دهد توابع ردگیری به ازای هر نخ نصب شوند، و رویدادهای پایه‌ای که به تابع " +"ردگیری گزارش می‌شوند، همان رویدادهایی هستند که در نسخه‌های قبلی به توابع " +"ردگیری در سطح پایتون گزارش می‌شدند." -msgid "The type of the trace function registered using :c:func:`PyEval_SetProfile` and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to the registration function as *obj*, *frame* is the frame object to which the event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" -msgstr "" +msgid "" +"The type of the trace function registered using :c:func:`PyEval_SetProfile` " +"and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " +"the registration function as *obj*, *frame* is the frame object to which the" +" event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, " +":c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, " +":c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, " +":c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, or " +":c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" +msgstr "" +"نوع تابع ردگیری‌ای که با استفاده از :c:func:`PyEval_SetProfile` و " +":c:func:`PyEval_SetTrace` ثبت می‌شود. پارامتر نخست، شیءی است که به‌عنوان " +"*obj* به تابع ثبت‌کننده پاس داده‌شده است؛ *frame* شیء فریمی است که رویداد به" +" آن مربوط است؛ *what* یکی از ثابت‌های :c:data:`PyTrace_CALL`، " +":c:data:`PyTrace_EXCEPTION`، :c:data:`PyTrace_LINE`، " +":c:data:`PyTrace_RETURN`، :c:data:`PyTrace_C_CALL`، " +":c:data:`PyTrace_C_EXCEPTION`، :c:data:`PyTrace_C_RETURN` یا " +":c:data:`PyTrace_OPCODE` است و *arg* به مقدار *what* بستگی دارد:" msgid "Value of *what*" -msgstr "" +msgstr "مقدار *چه چیزی*" msgid "Meaning of *arg*" -msgstr "" +msgstr "معنای *arg*" msgid ":c:data:`PyTrace_CALL`" -msgstr "" +msgstr ":c:data:`PyTrace_CALL`" msgid "Always :c:data:`Py_None`." -msgstr "" +msgstr "همیشه :c:data:`Py_None`." msgid ":c:data:`PyTrace_EXCEPTION`" -msgstr "" +msgstr ":c:data:`PyTrace_EXCEPTION`" msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" +"اطلاعات استثنا به شکلی که توسط :func:`sys.exc_info` بازگردانده می‌شود." msgid ":c:data:`PyTrace_LINE`" -msgstr "" +msgstr ":c:data:`PyTrace_LINE`" msgid ":c:data:`PyTrace_RETURN`" -msgstr "" +msgstr ":c:data:`PyTrace_RETURN`" -msgid "Value being returned to the caller, or ``NULL`` if caused by an exception." +msgid "" +"Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" +"مقداری که به فراخوان‌کننده بازگردانده می‌شود، یا ``NULL`` در صورتی که ناشی " +"از استثنا باشد." msgid ":c:data:`PyTrace_C_CALL`" -msgstr "" +msgstr ":c:data:`PyTrace_C_CALL`" msgid "Function object being called." -msgstr "" +msgstr "شیء تابعی که فراخوانی می‌شود." msgid ":c:data:`PyTrace_C_EXCEPTION`" -msgstr "" +msgstr ":c:data:`PyTrace_C_EXCEPTION`" msgid ":c:data:`PyTrace_C_RETURN`" -msgstr "" +msgstr ":c:data:`PyTrace_C_RETURN`" msgid ":c:data:`PyTrace_OPCODE`" -msgstr "" +msgstr ":c:data:`PyTrace_OPCODE`" -msgid "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when a new call to a function or method is being reported, or a new entry into a generator. Note that the creation of the iterator for a generator function is not reported as there is no control transfer to the Python bytecode in the corresponding frame." +msgid "" +"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " +"a new call to a function or method is being reported, or a new entry into a " +"generator. Note that the creation of the iterator for a generator function " +"is not reported as there is no control transfer to the Python bytecode in " +"the corresponding frame." msgstr "" +"مقدار پارامتر *what* در تابع :c:type:`Py_tracefunc` هنگامی که فراخوانی جدیدی" +" از یک تابع یا متد، یا ورود جدیدی به یک تولیدگر گزارش می‌شود. توجه داشته " +"باشید که ایجاد پیمایش‌گر برای یک تابع تولیدگر گزارش نمی‌شود، زیرا هیچ انتقال" +" کنترلی به بایت‌کد پایتون در قاب (frame) مربوطه وجود ندارد." -msgid "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when an exception has been raised. The callback function is called with this value for *what* when after any bytecode is processed after which the exception becomes set within the frame being executed. The effect of this is that as exception propagation causes the Python stack to unwind, the callback is called upon return to each frame as the exception propagates. Only trace functions receive these events; they are not needed by the profiler." -msgstr "" +msgid "" +"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " +"an exception has been raised. The callback function is called with this " +"value for *what* when after any bytecode is processed after which the " +"exception becomes set within the frame being executed. The effect of this " +"is that as exception propagation causes the Python stack to unwind, the " +"callback is called upon return to each frame as the exception propagates. " +"Only trace functions receive these events; they are not needed by the " +"profiler." +msgstr "" +"مقدار پارامتر *what* برای تابع :c:type:`Py_tracefunc` زمانی که استثنایی " +"پرتاب شده باشد. تابع کال‌بک با این مقدار برای *what* زمانی فراخوانی می‌شود " +"که پس از پردازش هر بایت‌کدی، استثنا در قابی که در حال اجراست تنظیم شود. اثر " +"این امر آن است که همان‌طور که گسترش استثنا موجب بازگشایی پشته‌ی پایتون " +"می‌شود، کال‌بک هنگام بازگشت به هر قاب، همزمان با گسترش استثنا فراخوانی " +"می‌شود. فقط توابع ردگیری این رویدادها را دریافت می‌کنند؛ پروفایل‌گیر به " +"آن‌ها نیازی ندارد." -msgid "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` function (but not a profiling function) when a line-number event is being reported. It may be disabled for a frame by setting :attr:`~frame.f_trace_lines` to *0* on that frame." +msgid "" +"The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " +"function (but not a profiling function) when a line-number event is being " +"reported. It may be disabled for a frame by setting " +":attr:`~frame.f_trace_lines` to *0* on that frame." msgstr "" +"مقداری که هنگام گزارش‌شدن یک رویداد شماره سطر، به‌عنوان پارامتر *what* به یک" +" تابع :c:type:`Py_tracefunc` (اما نه به یک تابع پروفایل‌گیری) ارسال می‌شود. " +"این رویداد می‌تواند برای یک فریم، با تنظیم :attr:`~frame.f_trace_lines` روی " +"*0* در همان فریم، غیرفعال شود." -msgid "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a call is about to return." +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a call is about to return." msgstr "" +"مقدار پارامتر *what* در توابع :c:type:`Py_tracefunc` زمانی که یک فراخوانی در" +" شرف بازگشت است." -msgid "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C function is about to be called." +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function is about to be called." msgstr "" +"مقدار پارامتر *what* برای توابع :c:type:`Py_tracefunc` هنگامی که یک تابع C " +"در شرف فراخوانی شدن است." -msgid "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C function has raised an exception." +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function has raised an exception." msgstr "" +"مقدار پارامتر *what* برای توابع :c:type:`Py_tracefunc` هنگامی که یک تابع C " +"استثنا ایجاد کرده باشد." -msgid "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when a C function has returned." +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " +"a C function has returned." msgstr "" +"مقدار پارامتر *what* برای توابع :c:type:`Py_tracefunc` هنگامی که یک تابع C " +"بازگشته است." -msgid "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but not profiling functions) when a new opcode is about to be executed. This event is not emitted by default: it must be explicitly requested by setting :attr:`~frame.f_trace_opcodes` to *1* on the frame." +msgid "" +"The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " +"not profiling functions) when a new opcode is about to be executed. This " +"event is not emitted by default: it must be explicitly requested by setting " +":attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" +"مقدار پارامتر *what* برای توابع :c:type:`Py_tracefunc` (اما نه توابع " +"پروفایل‌گیری) زمانی که یک کدعمل جدید در شرف اجراست. این رویداد به‌طور " +"پیش‌فرض منتشر نمی‌شود: باید به‌طور صریح با تنظیم " +":attr:`~frame.f_trace_opcodes` به *1* روی فریم (frame) درخواست شود." -msgid "Set the profiler function to *func*. The *obj* parameter is passed to the function as its first parameter, and may be any Python object, or ``NULL``. If the profile function needs to maintain state, using a different value for *obj* for each thread provides a convenient and thread-safe place to store it. The profile function is called for all monitored events except :c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." -msgstr "" +msgid "" +"Set the profiler function to *func*. The *obj* parameter is passed to the " +"function as its first parameter, and may be any Python object, or ``NULL``." +" If the profile function needs to maintain state, using a different value " +"for *obj* for each thread provides a convenient and thread-safe place to " +"store it. The profile function is called for all monitored events except " +":c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and " +":c:data:`PyTrace_EXCEPTION`." +msgstr "" +"تابع پروفایل‌گیر را روی *func* تنظیم می‌کند. پارامتر *obj* به عنوان نخستین " +"پارامتر به تابع پاس داده می‌شود و می‌تواند هر شیء پایتون یا ``NULL`` باشد. " +"اگر تابع پروفایل نیاز به نگهداری وضعیت داشته باشد، استفاده از مقدار متفاوتی " +"برای *obj* در هر نخ، مکانی مناسب و نخ‌ایمن برای ذخیره‌سازی آن فراهم می‌کند. " +"تابع پروفایل برای همه رویدادهای پایش‌شده به جز :c:data:`PyTrace_LINE`، " +":c:data:`PyTrace_OPCODE` و :c:data:`PyTrace_EXCEPTION` فراخوانی می‌شود." msgid "See also the :func:`sys.setprofile` function." -msgstr "" +msgstr "همچنین تابع :func:`sys.setprofile` را ببینید." msgid "The caller must have an :term:`attached thread state`." -msgstr "" +msgstr "فراخوانی‌کننده باید یک :term:`attached thread state` داشته باشد." -msgid "Like :c:func:`PyEval_SetProfile` but sets the profile function in all running threads belonging to the current interpreter instead of the setting it only on the current thread." +msgid "" +"Like :c:func:`PyEval_SetProfile` but sets the profile function in all " +"running threads belonging to the current interpreter instead of the setting " +"it only on the current thread." msgstr "" +"مانند :c:func:`PyEval_SetProfile` است، اما به‌جای تنظیم تابع پروفایل تنها " +"روی نخ فعلی، آن را در تمام نخ‌های در حال اجرای متعلق به مفسر فعلی تنظیم " +"می‌کند." -msgid "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised while setting the profile functions in all threads." +msgid "" +"As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " +"while setting the profile functions in all threads." msgstr "" +"مانند :c:func:`PyEval_SetProfile`، این تابع هر استثنایی را که هنگام تنظیم " +"توابع پروفایل در همه‌ی نخ‌ها ایجاد می‌شود، نادیده می‌گیرد." -msgid "Set the tracing function to *func*. This is similar to :c:func:`PyEval_SetProfile`, except the tracing function does receive line-number events and per-opcode events, but does not receive any event related to C function objects being called. Any trace function registered using :c:func:`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the *what* parameter." -msgstr "" +msgid "" +"Set the tracing function to *func*. This is similar to " +":c:func:`PyEval_SetProfile`, except the tracing function does receive line-" +"number events and per-opcode events, but does not receive any event related " +"to C function objects being called. Any trace function registered using " +":c:func:`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, " +":c:data:`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for " +"the *what* parameter." +msgstr "" +"تابع ردگیری را روی *func* تنظیم می‌کند. این تابع مشابه " +":c:func:`PyEval_SetProfile` است، با این تفاوت که تابع ردگیری رویدادهای شماره" +" سطر و رویدادهای به ازای هر کدعمل را دریافت می‌کند، اما هیچ رویدادی مربوط به" +" فراخوانی اشیاء تابع C را دریافت نمی‌کند. هر تابع ردگیری که با استفاده از " +":c:func:`PyEval_SetTrace` ثبت‌شده باشد، :c:data:`PyTrace_C_CALL`، " +":c:data:`PyTrace_C_EXCEPTION` یا :c:data:`PyTrace_C_RETURN` را به عنوان " +"مقدار پارامتر *what* دریافت نخواهد کرد." msgid "See also the :func:`sys.settrace` function." -msgstr "" +msgstr "همچنین تابع :func:`sys.settrace` را ببینید." -msgid "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running threads belonging to the current interpreter instead of the setting it only on the current thread." +msgid "" +"Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " +"threads belonging to the current interpreter instead of the setting it only " +"on the current thread." msgstr "" +"مانند :c:func:`PyEval_SetTrace` است، اما به‌جای تنظیم تابع ردگیری فقط روی نخ" +" فعلی، آن را در تمام نخ‌های در حال اجرا که به مفسر فعلی تعلق دارند تنظیم " +"می‌کند." -msgid "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised while setting the trace functions in all threads." +msgid "" +"As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " +"while setting the trace functions in all threads." msgstr "" +"مانند :c:func:`PyEval_SetTrace`، این تابع هر استثنایی را که هنگام تنظیم " +"توابع ردگیری در تمامی نخ‌ها ایجاد شود نادیده می‌گیرد." msgid "Reference tracing" -msgstr "" +msgstr "ردگیری ارجاع" -msgid "The type of the trace function registered using :c:func:`PyRefTracer_SetTracer`. The first parameter is a Python object that has been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called." -msgstr "" +msgid "" +"The type of the trace function registered using " +":c:func:`PyRefTracer_SetTracer`. The first parameter is a Python object that" +" has been just created (when **event** is set to " +":c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is " +"set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque " +"pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called." +msgstr "" +"نوع تابع ردگیری‌ای که با استفاده از :c:func:`PyRefTracer_SetTracer` ثبت‌شده " +"است. پارامتر اول یک شیء پایتون است که به‌تازگی ایجاد‌شده است (زمانی که " +"**event** روی :c:data:`PyRefTracer_CREATE` تنظیم‌شده باشد) یا در شرف نابودی " +"است (زمانی که **event** روی :c:data:`PyRefTracer_DESTROY` تنظیم‌شده باشد). " +"آرگومان **data** همان اشاره‌گر مات (opaque) است که هنگام فراخوانی " +":c:func:`PyRefTracer_SetTracer` ارائه‌شده است." -msgid "If a new tracing function is registered replacing the current one, a call to the trace function will be made with the object set to **NULL** and **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen just before the new function is registered." +msgid "" +"If a new tracing function is registered replacing the current one, a call to" +" the trace function will be made with the object set to **NULL** and " +"**event** set to :c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen " +"just before the new function is registered." msgstr "" +"اگر یک تابع ردگیری جدید به‌جای تابع فعلی ثبت شود، فراخوانی تابع ردگیری با " +"شیء تنظیم‌شده بر **NULL** و **event** تنظیم‌شده بر " +":c:data:`PyRefTracer_TRACKER_REMOVED` انجام خواهد شد. این اتفاق درست پیش از " +"ثبت تابع جدید رخ خواهد داد." -msgid "The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python object has been created." +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been created." msgstr "" +"مقدار پارامتر *event* در توابع :c:type:`PyRefTracer` هنگامی که یک شیء پایتون" +" ایجاد شده است." -msgid "The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python object has been destroyed." +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been destroyed." msgstr "" +"مقدار پارامتر *event* در توابع :c:type:`PyRefTracer` هنگامی که یک شیء پایتون" +" نابود شده است." -msgid "The value for the *event* parameter to :c:type:`PyRefTracer` functions when the current tracer is about to be replaced by a new one." +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"the current tracer is about to be replaced by a new one." msgstr "" +"مقدار پارامتر *event* برای توابع :c:type:`PyRefTracer` هنگامی که ردیاب فعلی " +"در شرف جایگزین‌شدن با ردیاب جدیدی است." -msgid "Register a reference tracer function. The function will be called when a new Python object has been created or when an object is going to be destroyed. If **data** is provided it must be an opaque pointer that will be provided when the tracer function is called. Return ``0`` on success. Set an exception and return ``-1`` on error." -msgstr "" +msgid "" +"Register a reference tracer function. The function will be called when a new" +" Python object has been created or when an object is going to be destroyed. " +"If **data** is provided it must be an opaque pointer that will be provided " +"when the tracer function is called. Return ``0`` on success. Set an " +"exception and return ``-1`` on error." +msgstr "" +"یک تابع ردیاب ارجاع ثبت کنید. این تابع هنگامی فراخوانی می‌شود که یک شیء جدید" +" پایتون ایجاد شده باشد یا هنگامی که یک شیء در شرف نابود شدن است. اگر " +"**data** ارائه شود، باید یک اشاره‌گر مات باشد که هنگام فراخوانی تابع ردیاب " +"ارائه خواهد شد. در صورت موفقیت ``0`` را برگردانید. در صورت خطا یک استثنا " +"تنظیم کنید و ``-1`` را برگردانید." -msgid "Note that tracer functions **must not** create Python objects inside or otherwise the call will be re-entrant. The tracer also **must not** clear any existing exception or set an exception. A :term:`thread state` will be active every time the tracer function is called." +msgid "" +"Note that tracer functions **must not** create Python objects inside or " +"otherwise the call will be re-entrant. The tracer also **must not** clear " +"any existing exception or set an exception. A :term:`thread state` will be " +"active every time the tracer function is called." msgstr "" +"توجه داشته باشید که توابع ردیاب **نباید** درون خود اشیاء پایتونی ایجاد کنند،" +" در غیر این صورت فراخوانی بازورودپذیر خواهد بود. ردیاب همچنین **نباید** هیچ " +"استثنای موجودی را پاک کند یا استثنایی تنظیم کند. هر بار که تابع ردیاب " +"فراخوانی می‌شود، یک :term:`وضعیت نخ ` فعال خواهد بود." -msgid "There must be an :term:`attached thread state` when calling this function." +msgid "" +"There must be an :term:`attached thread state` when calling this function." msgstr "" +"هنگام فراخوانی این تابع، باید یک :term:`attached thread state` وجود داشته " +"باشد." -msgid "If another tracer function was already registered, the old function will be called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just before the new function is registered." +msgid "" +"If another tracer function was already registered, the old function will be " +"called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just " +"before the new function is registered." msgstr "" +"اگر تابع ردیاب دیگری از قبل ثبت شده باشد، تابع قدیمی درست پیش از ثبت تابع " +"جدید، با **رویداد** برابر با :c:data:`PyRefTracer_TRACKER_REMOVED` فراخوانی " +"می‌شود." -msgid "Get the registered reference tracer function and the value of the opaque data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was called. If no tracer was registered this function will return NULL and will set the **data** pointer to NULL." -msgstr "" +msgid "" +"Get the registered reference tracer function and the value of the opaque " +"data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " +"called. If no tracer was registered this function will return NULL and will " +"set the **data** pointer to NULL." +msgstr "" +"تابع ردیاب ارجاع ثبت‌شده و مقدار اشاره‌گر داده‌ی مات (opaque) را که هنگام " +"فراخوانی :c:func:`PyRefTracer_SetTracer` ثبت شده بود، برمی‌گرداند. اگر هیچ " +"ردیابی ثبت نشده باشد، این تابع NULL را برمی‌گرداند و اشاره‌گر **data** را " +"برابر NULL قرار می‌دهد." diff --git a/c-api/refcounting.po b/c-api/refcounting.po index b463f520b..9a9b25c44 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -24,155 +24,326 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Reference Counting" -msgstr "" +msgstr "شمارش ارجاع" -msgid "The functions and macros in this section are used for managing reference counts of Python objects." +msgid "" +"The functions and macros in this section are used for managing reference " +"counts of Python objects." msgstr "" +"توابع و ماکرو‌های این بخش برای مدیریت شمارش ارجاع اشیاء پایتون استفاده " +"می‌شوند." msgid "Get the reference count of the Python object *o*." -msgstr "" +msgstr "شمارش ارجاع شیء پایتون *o* را دریافت کنید." -msgid "Note that the returned value may not actually reflect how many references to the object are actually held. For example, some objects are :term:`immortal` and have a very high refcount that does not reflect the actual number of references. Consequently, do not rely on the returned value to be accurate, other than a value of 0 or 1." -msgstr "" +msgid "" +"Note that the returned value may not actually reflect how many references to" +" the object are actually held. For example, some objects are " +":term:`immortal` and have a very high refcount that does not reflect the " +"actual number of references. Consequently, do not rely on the returned " +"value to be accurate, other than a value of 0 or 1." +msgstr "" +"توجه داشته باشید که مقدار بازگشتی ممکن است در واقع تعداد ارجاع‌هایی را که " +"واقعاً به شیء نگه‌داشته می‌شوند منعکس نکند. برای مثال، برخی از اشیاء " +":term:`immortal` هستند و شمارش ارجاع بسیار بالایی دارند که تعداد واقعی " +"ارجاع‌ها را منعکس نمی‌کند. در نتیجه، به‌جز در مورد مقدار ۰ یا ۱، بر دقت " +"مقدار بازگشتی تکیه نکنید." -msgid "Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +msgid "" +"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." msgstr "" +"برای تنظیم شمارش ارجاع یک شیء، از تابع :c:func:`Py_SET_REFCNT()` استفاده " +"کنید." -msgid "On :term:`free-threaded builds ` of Python, returning 1 isn't sufficient to determine if it's safe to treat *o* as having no access by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced` for that instead." +msgid "" +"On :term:`free-threaded builds ` of Python, returning 1" +" isn't sufficient to determine if it's safe to treat *o* as having no access" +" by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced` for " +"that instead." msgstr "" +"در :term:`بیلدهای نخ‌آزاد ` پایتون، بازگرداندن 1 برای " +"تعیین اینکه آیا در نظر گرفتن *o* به‌عنوان شیئی که هیچ نخ دیگری به آن دسترسی " +"ندارد، ایمن است، کافی نیست. برای این کار به‌جای آن از " +":c:func:`PyUnstable_Object_IsUniquelyReferenced` استفاده کنید." -msgid "See also the function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`." +msgid "" +"See also the function " +":c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`." msgstr "" +"همچنین تابع :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()` را " +"ببینید." msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." msgstr "" +":c:func:`Py_REFCNT()` به تابع ایستای درون‌خطی (inline) تغییر یافته است." msgid "The parameter type is no longer :c:expr:`const PyObject*`." -msgstr "" +msgstr "نوع پارامتر دیگر :c:expr:`const PyObject*` نیست." msgid "Set the object *o* reference counter to *refcnt*." -msgstr "" +msgstr "شمارنده ارجاع شیء *o* را برابر *refcnt* قرار می‌دهد." -msgid "On :ref:`Python build with Free Threading `, if *refcnt* is larger than ``UINT32_MAX``, the object is made :term:`immortal`." +msgid "" +"On :ref:`Python build with Free Threading `, if " +"*refcnt* is larger than ``UINT32_MAX``, the object is made :term:`immortal`." msgstr "" +"در :ref:`ساخت پایتون با نخ‌بندی آزاد `، اگر *refcnt* " +"بزرگ‌تر از ``UINT32_MAX`` باشد، شیء :term:`نامیرا ` می‌شود." msgid "This function has no effect on :term:`immortal` objects." -msgstr "" +msgstr "این تابع هیچ تأثیری بر اشیاء :term:`نامیرا ` ندارد." msgid "Immortal objects are not modified." -msgstr "" +msgstr "اشیاء نامیرا تغییر نمی‌یابند." -msgid "Indicate taking a new :term:`strong reference` to object *o*, indicating it is in use and should not be destroyed." +msgid "" +"Indicate taking a new :term:`strong reference` to object *o*, indicating it " +"is in use and should not be destroyed." msgstr "" +"نشان می‌دهد که یک :term:`strong reference` جدید به شیء *o* گرفته می‌شود و " +"بیانگر این است که آن در حال استفاده است و نباید نابود شود." -msgid "This function is usually used to convert a :term:`borrowed reference` to a :term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be used to create a new :term:`strong reference`." +msgid "" +"This function is usually used to convert a :term:`borrowed reference` to a " +":term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " +"used to create a new :term:`strong reference`." msgstr "" +"این تابع معمولاً برای تبدیل یک :term:`ارجاع امانتی ` به " +"یک :term:`ارجاع قوی ` به‌صورت درجا استفاده می‌شود. می‌توان" +" از تابع :c:func:`Py_NewRef` برای ایجاد یک :term:`ارجاع قوی ` جدید استفاده کرد." msgid "When done using the object, release is by calling :c:func:`Py_DECREF`." msgstr "" +"پس از پایان استفاده از شیء، آزادسازی آن با فراخوانی :c:func:`Py_DECREF` " +"انجام می‌شود." -msgid "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, use :c:func:`Py_XINCREF`." +msgid "" +"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " +"use :c:func:`Py_XINCREF`." msgstr "" +"شیء نباید ``NULL`` باشد؛ اگر مطمئن نیستید که ``NULL`` نیست، از " +":c:func:`Py_XINCREF` استفاده کنید." -msgid "Do not expect this function to actually modify *o* in any way. For at least :pep:`some objects <0683>`, this function has no effect." +msgid "" +"Do not expect this function to actually modify *o* in any way. For at least " +":pep:`some objects <0683>`, this function has no effect." msgstr "" +"انتظار نداشته باشید که این تابع به هیچ وجه *o* را واقعاً تغییر دهد. دست‌کم " +"برای :pep:`برخی از اشیاء <0683>`، این تابع هیچ تأثیری ندارد." -msgid "Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which case this has no effect." +msgid "" +"Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which" +" case this has no effect." msgstr "" +"مشابه :c:func:`Py_INCREF`، اما شیء *o* می‌تواند ``NULL`` باشد، که در این " +"صورت هیچ اثری نخواهد داشت." msgid "See also :c:func:`Py_XNewRef`." -msgstr "" +msgstr "همچنین :c:func:`Py_XNewRef` را ببینید." -msgid "Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` on *o* and return the object *o*." +msgid "" +"Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF`" +" on *o* and return the object *o*." msgstr "" +"یک :term:`ارجاع قوی ` جدید به یک شیء بسازید: " +":c:func:`Py_INCREF` را روی *o* فراخوانی کنید و شیء *o* را برگردانید." -msgid "When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` should be called on it to release the reference." +msgid "" +"When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " +"should be called on it to release the reference." msgstr "" +"هنگامی که :term:`strong reference` دیگر مورد نیاز نیست، باید " +":c:func:`Py_DECREF` روی آن فراخوانی شود تا ارجاع آزاد شود." -msgid "The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be ``NULL``." +msgid "" +"The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " +"``NULL``." msgstr "" +"شیء *o* نباید ``NULL`` باشد؛ اگر *o* می‌تواند ``NULL`` باشد، از " +":c:func:`Py_XNewRef` استفاده کنید." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "Py_INCREF(obj);\n" "self->attr = obj;" msgstr "" +"Py_INCREF(obj);\n" +"self->attr = obj;" msgid "can be written as::" -msgstr "" +msgstr "می‌توان آن را به صورت زیر نوشت::" msgid "self->attr = Py_NewRef(obj);" -msgstr "" +msgstr "self->attr = Py_NewRef(obj);" msgid "See also :c:func:`Py_INCREF`." -msgstr "" +msgstr "همچنین ببینید :c:func:`Py_INCREF`." msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." -msgstr "" +msgstr "مشابه :c:func:`Py_NewRef`، اما شیء *o* می‌تواند NULL باشد." msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." -msgstr "" +msgstr "اگر شیء *o* برابر ``NULL`` باشد، تابع صرفاً ``NULL`` را برمی‌گرداند." -msgid "Release a :term:`strong reference` to object *o*, indicating the reference is no longer used." +msgid "" +"Release a :term:`strong reference` to object *o*, indicating the reference " +"is no longer used." msgstr "" +"یک :term:`ارجاع قوی ` به شیء *o* را آزاد کنید که نشان " +"می‌دهد این ارجاع دیگر استفاده نمی‌شود." -msgid "Once the last :term:`strong reference` is released (i.e. the object's reference count reaches 0), the object's type's deallocation function (which must not be ``NULL``) is invoked." +msgid "" +"Once the last :term:`strong reference` is released (i.e. the object's " +"reference count reaches 0), the object's type's deallocation function (which" +" must not be ``NULL``) is invoked." msgstr "" +"پس از آزاد شدن آخرین :term:`strong reference` (یعنی زمانی که شمارش ارجاع شیء" +" به ۰ برسد)، تابع تخصیص‌زدایی (deallocation) نوع شیء (که نباید ``NULL`` " +"باشد) فراخوانی می‌شود." -msgid "This function is usually used to delete a :term:`strong reference` before exiting its scope." +msgid "" +"This function is usually used to delete a :term:`strong reference` before " +"exiting its scope." msgstr "" +"این تابع معمولاً برای حذف یک :term:`ارجاع قوی ` پیش از " +"خروج از محدوده‌ی آن استفاده می‌شود." -msgid "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, use :c:func:`Py_XDECREF`." +msgid "" +"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " +"use :c:func:`Py_XDECREF`." msgstr "" +"شیء نباید ``NULL`` باشد؛ اگر مطمئن نیستید که ``NULL`` نیست، از " +":c:func:`Py_XDECREF` استفاده کنید." -msgid "Do not expect this function to actually modify *o* in any way. For at least :pep:`some objects <683>`, this function has no effect." +msgid "" +"Do not expect this function to actually modify *o* in any way. For at least " +":pep:`some objects <683>`, this function has no effect." msgstr "" +"انتظار نداشته باشید که این تابع واقعاً *o* را به هیچ نحوی تغییر دهد. برای " +"حداقل :pep:`برخی اشیاء <683>`، این تابع هیچ اثری ندارد." -msgid "The deallocation function can cause arbitrary Python code to be invoked (e.g. when a class instance with a :meth:`~object.__del__` method is deallocated). While exceptions in such code are not propagated, the executed code has free access to all Python global variables. This means that any object that is reachable from a global variable should be in a consistent state before :c:func:`Py_DECREF` is invoked. For example, code to delete an object from a list should copy a reference to the deleted object in a temporary variable, update the list data structure, and then call :c:func:`Py_DECREF` for the temporary variable." -msgstr "" +msgid "" +"The deallocation function can cause arbitrary Python code to be invoked " +"(e.g. when a class instance with a :meth:`~object.__del__` method is " +"deallocated). While exceptions in such code are not propagated, the " +"executed code has free access to all Python global variables. This means " +"that any object that is reachable from a global variable should be in a " +"consistent state before :c:func:`Py_DECREF` is invoked. For example, code " +"to delete an object from a list should copy a reference to the deleted " +"object in a temporary variable, update the list data structure, and then " +"call :c:func:`Py_DECREF` for the temporary variable." +msgstr "" +"تابع آزادسازی می‌تواند باعث فراخوانی کد دلخواه پایتون شود (مثلاً وقتی " +"نمونه‌ای از کلاسی دارای متد :meth:`~object.__del__` آزادسازی می‌شود). اگرچه " +"استثناهای چنین کدی منتشر نمی‌شوند، کد اجرا‌شده به تمام متغیرهای سراسری " +"پایتون دسترسی آزاد دارد. این بدان معناست که هر شیئی که از یک متغیر سراسری " +"قابل دسترسی باشد، باید پیش از فراخوانی :c:func:`Py_DECREF` در وضعیت سازگار " +"قرار داشته باشد. برای مثال، کدی که شیئی را از یک فهرست حذف می‌کند، باید " +"ارجاعی به شیء حذف‌شده را در یک متغیر موقت کپی کند، ساختار داده فهرست را " +"به‌روزرسانی کند و سپس :c:func:`Py_DECREF` را برای متغیر موقت فراخوانی کند." -msgid "Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which case this has no effect. The same warning from :c:func:`Py_DECREF` applies here as well." +msgid "" +"Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which" +" case this has no effect. The same warning from :c:func:`Py_DECREF` applies " +"here as well." msgstr "" +"مشابه :c:func:`Py_DECREF`، اما شیء *o* می‌تواند ``NULL`` باشد که در این صورت" +" هیچ اثری ندارد. همان هشدارِ مربوط به :c:func:`Py_DECREF` در اینجا نیز صدق " +"می‌کند." -msgid "Release a :term:`strong reference` for object *o*. The object may be ``NULL``, in which case the macro has no effect; otherwise the effect is the same as for :c:func:`Py_DECREF`, except that the argument is also set to ``NULL``. The warning for :c:func:`Py_DECREF` does not apply with respect to the object passed because the macro carefully uses a temporary variable and sets the argument to ``NULL`` before releasing the reference." -msgstr "" +msgid "" +"Release a :term:`strong reference` for object *o*. The object may be " +"``NULL``, in which case the macro has no effect; otherwise the effect is the" +" same as for :c:func:`Py_DECREF`, except that the argument is also set to " +"``NULL``. The warning for :c:func:`Py_DECREF` does not apply with respect " +"to the object passed because the macro carefully uses a temporary variable " +"and sets the argument to ``NULL`` before releasing the reference." +msgstr "" +"یک :term:`ارجاع قوی ` برای شیء *o* را آزاد می‌کند. شیء " +"ممکن است ``NULL`` باشد که در این صورت ماکرو هیچ اثری ندارد؛ در غیر این صورت،" +" اثر آن همانند :c:func:`Py_DECREF` است، با این تفاوت که آرگومان نیز به " +"``NULL`` تنظیم می‌شود. هشدار مربوط به :c:func:`Py_DECREF` در مورد شیء " +"ارسال‌شده اعمال نمی‌شود، زیرا ماکرو با دقت از یک متغیر موقت استفاده می‌کند و" +" آرگومان را پیش از آزاد کردن ارجاع به ``NULL`` تنظیم می‌کند." -msgid "It is a good idea to use this macro whenever releasing a reference to an object that might be traversed during garbage collection." +msgid "" +"It is a good idea to use this macro whenever releasing a reference to an " +"object that might be traversed during garbage collection." msgstr "" +"هر زمان که ارجاعی به شیئی را که ممکن است در حین زباله‌روبی پیمایش شود آزاد " +"می‌کنید، استفاده از این ماکرو ایده‌ی خوبی است." -msgid "The macro argument is now only evaluated once. If the argument has side effects, these are no longer duplicated." +msgid "" +"The macro argument is now only evaluated once. If the argument has side " +"effects, these are no longer duplicated." msgstr "" +"آرگومان ماکرو اکنون فقط یک بار ارزیابی می‌شود. اگر آرگومان دارای اثرات جانبی" +" باشد، این اثرات دیگر تکرار نمی‌شوند." -msgid "Indicate taking a new :term:`strong reference` to object *o*. A function version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic embedding of Python." +msgid "" +"Indicate taking a new :term:`strong reference` to object *o*. A function " +"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " +"embedding of Python." msgstr "" +"نشان دادن گرفتن یک :term:`ارجاع قوی ` جدید به شیء *o*. " +"نسخه‌ی تابعی از :c:func:`Py_XINCREF`. می‌توان از آن برای جاسازی پویای پایتون" +" در زمان اجرا استفاده کرد." -msgid "Release a :term:`strong reference` to object *o*. A function version of :c:func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." +msgid "" +"Release a :term:`strong reference` to object *o*. A function version of " +":c:func:`Py_XDECREF`. It can be used for runtime dynamic embedding of " +"Python." msgstr "" +"یک :term:`ارجاع قوی ` به شیء *o* را آزاد می‌کند. نسخه‌ی " +"تابعی از :c:func:`Py_XDECREF`. می‌توان از آن برای جاسازی پویای پایتون در " +"ران‌تایم استفاده کرد." -msgid "Macro safely releasing a :term:`strong reference` to object *dst* and setting *dst* to *src*." +msgid "" +"Macro safely releasing a :term:`strong reference` to object *dst* and " +"setting *dst* to *src*." msgstr "" +"ماکرویی که :term:`ارجاع قوی ` به شیء *dst* را به‌صورت ایمن" +" آزاد می‌کند و *dst* را برابر *src* قرار می‌دهد." msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" -msgstr "" +msgstr "همانند مورد :c:func:`Py_CLEAR`، کد «بدیهی» می‌تواند مرگبار باشد::" msgid "" "Py_DECREF(dst);\n" "dst = src;" msgstr "" +"Py_DECREF(dst);\n" +"dst = src;" msgid "The safe way is::" -msgstr "" +msgstr "روش امن این است::" msgid "Py_SETREF(dst, src);" -msgstr "" +msgstr "Py_SETREF(dst, src);" -msgid "That arranges to set *dst* to *src* *before* releasing the reference to the old value of *dst*, so that any code triggered as a side-effect of *dst* getting torn down no longer believes *dst* points to a valid object." +msgid "" +"That arranges to set *dst* to *src* *before* releasing the reference to the " +"old value of *dst*, so that any code triggered as a side-effect of *dst* " +"getting torn down no longer believes *dst* points to a valid object." msgstr "" +"این کار به‌گونه‌ای ترتیب می‌دهد که *dst* *پیش از* آزاد کردن ارجاع به مقدار " +"قبلی *dst* برابر *src* قرار گیرد؛ به‌طوری که هر کدی که به‌عنوان اثر جانبیِ " +"تخریب شدن *dst* اجرا می‌شود، دیگر باور نمی‌کند که *dst* به یک شیء معتبر " +"اشاره می‌کند." -msgid "The macro arguments are now only evaluated once. If an argument has side effects, these are no longer duplicated." +msgid "" +"The macro arguments are now only evaluated once. If an argument has side " +"effects, these are no longer duplicated." msgstr "" +"آرگومان‌های ماکرو اکنون تنها یک‌بار ارزیابی می‌شوند. اگر آرگومانی اثر جانبی " +"داشته باشد، این اثرها دیگر دوبار رخ نمی‌دهند." -msgid "Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead of :c:func:`Py_DECREF`." +msgid "" +"Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead" +" of :c:func:`Py_DECREF`." msgstr "" +"گونه‌ای از ماکرو :c:macro:`Py_SETREF` که به‌جای :c:func:`Py_DECREF` از " +":c:func:`Py_XDECREF` استفاده می‌کند." diff --git a/c-api/reflection.po b/c-api/reflection.po index 41efd1470..4fc84f8b8 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -25,52 +25,135 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Reflection" -msgstr "" +msgstr "بازتاب" msgid "Use :c:func:`PyEval_GetFrameBuiltins` instead." -msgstr "" +msgstr "به‌جای آن از :c:func:`PyEval_GetFrameBuiltins` استفاده کنید." -msgid "Return a dictionary of the builtins in the current execution frame, or the interpreter of the thread state if no frame is currently executing." +msgid "" +"Return a dictionary of the builtins in the current execution frame, or the " +"interpreter of the thread state if no frame is currently executing." msgstr "" +"بازگرداندن دیکشنری‌ای از توکارها در چارچوب اجرای فعلی، یا در مفسر وضعیت نخ، " +"در صورتی که هیچ چارچوبی در حال اجرا نباشد." -msgid "Use either :c:func:`PyEval_GetFrameLocals` to obtain the same behaviour as calling :func:`locals` in Python code, or else call :c:func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame` to access the :attr:`~frame.f_locals` attribute of the currently executing frame." +msgid "" +"Use either :c:func:`PyEval_GetFrameLocals` to obtain the same behaviour as " +"calling :func:`locals` in Python code, or else call " +":c:func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame` to " +"access the :attr:`~frame.f_locals` attribute of the currently executing " +"frame." msgstr "" +"برای به دست آوردن همان رفتاری که فراخوانی :func:`locals` در کد پایتون دارد، " +"از :c:func:`PyEval_GetFrameLocals` استفاده کنید، یا برای دسترسی به ویژگی " +":attr:`~frame.f_locals` از قاب در حال اجرا، :c:func:`PyFrame_GetLocals` را " +"بر روی نتیجه‌ی :c:func:`PyEval_GetFrame` فراخوانی کنید." -msgid "Return a mapping providing access to the local variables in the current execution frame, or ``NULL`` if no frame is currently executing." +msgid "" +"Return a mapping providing access to the local variables in the current " +"execution frame, or ``NULL`` if no frame is currently executing." msgstr "" +"نگاشتی را برمی‌گرداند که دسترسی به متغیرهای محلی در قاب اجرای فعلی " +"(execution frame) را فراهم می‌کند، یا اگر هم‌اکنون هیچ قابی در حال اجرا " +"نباشد، ``NULL`` برمی‌گرداند." -msgid "Refer to :func:`locals` for details of the mapping returned at different scopes." +msgid "" +"Refer to :func:`locals` for details of the mapping returned at different " +"scopes." msgstr "" +"برای جزئیات نگاشتی که در محدوده‌های مختلف بازگردانده می‌شود، به " +":func:`locals` مراجعه کنید." -msgid "As this function returns a :term:`borrowed reference`, the dictionary returned for :term:`optimized scopes ` is cached on the frame object and will remain alive as long as the frame object does. Unlike :c:func:`PyEval_GetFrameLocals` and :func:`locals`, subsequent calls to this function in the same frame will update the contents of the cached dictionary to reflect changes in the state of the local variables rather than returning a new snapshot." -msgstr "" +msgid "" +"As this function returns a :term:`borrowed reference`, the dictionary " +"returned for :term:`optimized scopes ` is cached on the " +"frame object and will remain alive as long as the frame object does. Unlike " +":c:func:`PyEval_GetFrameLocals` and :func:`locals`, subsequent calls to this" +" function in the same frame will update the contents of the cached " +"dictionary to reflect changes in the state of the local variables rather " +"than returning a new snapshot." +msgstr "" +"از آن‌جا که این تابع یک :term:`ارجاع امانتی ` " +"برمی‌گرداند، دیکشنری برگردانده‌شده برای :term:`محدوده‌های بهینه‌شده " +"` روی شیء قاب (frame) نهانگاه می‌شود و تا زمانی که شیء قاب " +"زنده است، زنده باقی می‌ماند. برخلاف :c:func:`PyEval_GetFrameLocals` و " +":func:`locals`، فراخوانی‌های بعدی این تابع در همان قاب، محتوای دیکشنری " +"نهانگاه‌شده را به‌روزرسانی می‌کنند تا تغییرات وضعیت متغیرهای محلی را منعکس " +"کنند، نه اینکه تصویر لحظه‌ای جدیدی برگردانند." -msgid "As part of :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals`, and :attr:`FrameType.f_locals ` no longer make use of the shared cache dictionary. Refer to the :ref:`What's New entry ` for additional details." +msgid "" +"As part of :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals`, and " +":attr:`FrameType.f_locals ` no longer make use of the shared" +" cache dictionary. Refer to the :ref:`What's New entry ` for additional details." msgstr "" +"به عنوان بخشی از :pep:`667`، :c:func:`PyFrame_GetLocals`، :func:`locals` و " +":attr:`FrameType.f_locals ` دیگر از دیکشنری نهانگاه مشترک " +"استفاده نمی‌کنند. برای جزئیات بیشتر به :ref:`مدخل تازه‌ها " +"` مراجعه کنید." msgid "Use :c:func:`PyEval_GetFrameGlobals` instead." -msgstr "" +msgstr "به جای آن از :c:func:`PyEval_GetFrameGlobals` استفاده کنید." -msgid "Return a dictionary of the global variables in the current execution frame, or ``NULL`` if no frame is currently executing." +msgid "" +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing." msgstr "" +"دیکشنری‌ای از متغیرهای سراسری در قاب اجرای فعلی را برمی‌گرداند، یا ``NULL`` " +"اگر هم‌اکنون هیچ قابی در حال اجرا نباشد." -msgid "Return the :term:`attached thread state`'s frame, which is ``NULL`` if no frame is currently executing." +msgid "" +"Return the :term:`attached thread state`'s frame, which is ``NULL`` if no " +"frame is currently executing." msgstr "" +"فریم :term:`attached thread state` را برمی‌گرداند که اگر در حال حاضر هیچ " +"فریمی در حال اجرا نباشد، ``NULL`` است." msgid "See also :c:func:`PyThreadState_GetFrame`." -msgstr "" +msgstr "همچنین :c:func:`PyThreadState_GetFrame` را ببینید." -msgid "Return a dictionary of the local variables in the current execution frame, or ``NULL`` if no frame is currently executing. Equivalent to calling :func:`locals` in Python code." +msgid "" +"Return a dictionary of the local variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing. Equivalent to calling " +":func:`locals` in Python code." msgstr "" +"یک دیکشنری از متغیرهای محلی در قاب اجرای فعلی را برمی‌گرداند، یا ``NULL`` " +"اگر در حال حاضر هیچ قابی در حال اجرا نباشد. معادل فراخوانی :func:`locals` در" +" کد پایتون است." -msgid "To access :attr:`~frame.f_locals` on the current frame without making an independent snapshot in :term:`optimized scopes `, call :c:func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame`." +msgid "" +"To access :attr:`~frame.f_locals` on the current frame without making an " +"independent snapshot in :term:`optimized scopes `, call " +":c:func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame`." msgstr "" +"برای دسترسی به :attr:`~frame.f_locals` در فریم فعلی بدون ایجاد تصویر لحظه‌ای" +" مستقل در :term:`محدوده‌های بهینه‌شده `، " +":c:func:`PyFrame_GetLocals` را روی نتیجه‌ی :c:func:`PyEval_GetFrame` " +"فراخوانی کنید." -msgid "Return a dictionary of the global variables in the current execution frame, or ``NULL`` if no frame is currently executing. Equivalent to calling :func:`globals` in Python code." +msgid "" +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing. Equivalent to calling " +":func:`globals` in Python code." msgstr "" +"یک دیکشنری از متغیرهای سراسری در قاب اجرای جاری برمی‌گرداند، یا اگر هیچ قابی" +" در حال اجرا نباشد، ``NULL`` برمی‌گرداند. معادل فراخوانی :func:`globals` در " +"کد پایتون است." -msgid "Return the name of *func* if it is a function, class or instance object, else the name of *func*\\s type." +msgid "" +"Return the name of *func* if it is a function, class or instance object, " +"else the name of *func*\\s type." msgstr "" +"اگر *func* یک تابع، کلاس یا شیء نمونه باشد، نام *func* و در غیر این صورت نام" +" نوع *func* را برمی‌گرداند." -msgid "Return a description string, depending on the type of *func*. Return values include \"()\" for functions and methods, \" constructor\", \" instance\", and \" object\". Concatenated with the result of :c:func:`PyEval_GetFuncName`, the result will be a description of *func*." -msgstr "" +msgid "" +"Return a description string, depending on the type of *func*. Return values " +"include \"()\" for functions and methods, \" constructor\", \" instance\", " +"and \" object\". Concatenated with the result of " +":c:func:`PyEval_GetFuncName`, the result will be a description of *func*." +msgstr "" +"بسته به نوع *func*، یک رشته‌ی توصیفی برمی‌گرداند. مقادیر بازگشتی شامل \"()\"" +" برای توابع و متدها، \" constructor\"، \" instance\" و \" object\" است. اگر" +" با نتیجه‌ی :c:func:`PyEval_GetFuncName` الحاق شود، نتیجه، توصیفی از *func* " +"خواهد بود." diff --git a/c-api/sequence.po b/c-api/sequence.po index 5c1792208..20fa6ded2 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -23,97 +23,246 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Sequence Protocol" -msgstr "" +msgstr "پروتکل دنباله" -msgid "Return ``1`` if the object provides the sequence protocol, and ``0`` otherwise. Note that it returns ``1`` for Python classes with a :meth:`~object.__getitem__` method, unless they are :class:`dict` subclasses, since in general it is impossible to determine what type of keys the class supports. This function always succeeds." -msgstr "" +msgid "" +"Return ``1`` if the object provides the sequence protocol, and ``0`` " +"otherwise. Note that it returns ``1`` for Python classes with a " +":meth:`~object.__getitem__` method, unless they are :class:`dict` " +"subclasses, since in general it is impossible to determine what type of keys" +" the class supports. This function always succeeds." +msgstr "" +"اگر شیء پروتکل دنباله را فراهم کند، ``1`` را برمی‌گرداند و در غیر این صورت " +"``0``. توجه داشته باشید که این تابع برای کلاس‌های پایتونی که متد " +":meth:`~object.__getitem__` دارند ``1`` برمی‌گرداند، مگر آنکه زیرکلاس‌های " +":class:`dict` باشند، زیرا به‌طور کلی غیرممکن است تعیین کرد که کلاس از چه نوع" +" کلیدهایی پشتیبانی می‌کند. این تابع همیشه موفق می‌شود." -msgid "Returns the number of objects in sequence *o* on success, and ``-1`` on failure. This is equivalent to the Python expression ``len(o)``." +msgid "" +"Returns the number of objects in sequence *o* on success, and ``-1`` on " +"failure. This is equivalent to the Python expression ``len(o)``." msgstr "" +"در صورت موفقیت، تعداد اشیاء در دنباله *o* و در صورت شکست ``-1`` را " +"برمی‌گرداند. این معادل عبارت پایتونی ``len(o)`` است." -msgid "Return the concatenation of *o1* and *o2* on success, and ``NULL`` on failure. This is the equivalent of the Python expression ``o1 + o2``." +msgid "" +"Return the concatenation of *o1* and *o2* on success, and ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o1 + o2``." msgstr "" +"در صورت موفقیت، الحاق *o1* و *o2* و در صورت شکست ``NULL`` را برمی‌گرداند. " +"این معادل عبارت پایتونی ``o1 + o2`` است." -msgid "Return the result of repeating sequence object *o* *count* times, or ``NULL`` on failure. This is the equivalent of the Python expression ``o * count``." +msgid "" +"Return the result of repeating sequence object *o* *count* times, or " +"``NULL`` on failure. This is the equivalent of the Python expression ``o * " +"count``." msgstr "" +"نتیجه‌ی تکرار شیء دنباله‌ی *o* به تعداد *count* بار را برمی‌گرداند، یا در " +"صورت شکست ``NULL`` برمی‌گرداند. این معادل عبارت پایتونی ``o * count`` است." -msgid "Return the concatenation of *o1* and *o2* on success, and ``NULL`` on failure. The operation is done *in-place* when *o1* supports it. This is the equivalent of the Python expression ``o1 += o2``." +msgid "" +"Return the concatenation of *o1* and *o2* on success, and ``NULL`` on " +"failure. The operation is done *in-place* when *o1* supports it. This is " +"the equivalent of the Python expression ``o1 += o2``." msgstr "" +"در صورت موفقیت، الحاق *o1* و *o2* و در صورت شکست ``NULL`` را برمی‌گرداند. " +"این عملیات زمانی که *o1* از آن پشتیبانی کند، به‌صورت *درجا* (in-place) انجام" +" می‌شود. این معادل عبارت پایتونی ``o1 += o2`` است." -msgid "Return the result of repeating sequence object *o* *count* times, or ``NULL`` on failure. The operation is done *in-place* when *o* supports it. This is the equivalent of the Python expression ``o *= count``." +msgid "" +"Return the result of repeating sequence object *o* *count* times, or " +"``NULL`` on failure. The operation is done *in-place* when *o* supports it." +" This is the equivalent of the Python expression ``o *= count``." msgstr "" +"نتیجه‌ی تکرار شیء دنباله *o* به تعداد *count* بار را برمی‌گرداند، یا در صورت" +" شکست ``NULL``. این عملیات هنگامی که *o* از آن پشتیبانی کند، به‌صورت *درجا* " +"(in-place) انجام می‌شود. این معادل عبارت پایتونی ``o *= count`` است." -msgid "Return the *i*\\ th element of *o*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o[i]``." +msgid "" +"Return the *i*\\ th element of *o*, or ``NULL`` on failure. This is the " +"equivalent of the Python expression ``o[i]``." msgstr "" +"عنصر *i*\\ اُم از *o* را برمی‌گرداند، یا در صورت شکست ``NULL``. این معادل " +"عبارت پایتونی ``o[i]`` است." -msgid "Return the slice of sequence object *o* between *i1* and *i2*, or ``NULL`` on failure. This is the equivalent of the Python expression ``o[i1:i2]``." +msgid "" +"Return the slice of sequence object *o* between *i1* and *i2*, or ``NULL`` " +"on failure. This is the equivalent of the Python expression ``o[i1:i2]``." msgstr "" +"اسلایس شیء دنباله *o* بین *i1* و *i2* را برمی‌گرداند، یا در صورت شکست " +"``NULL``. این معادل عبارت پایتونی ``o[i1:i2]`` است." -msgid "Assign object *v* to the *i*\\ th element of *o*. Raise an exception and return ``-1`` on failure; return ``0`` on success. This is the equivalent of the Python statement ``o[i] = v``. This function *does not* \":term:`steal`\" a reference to *v*." +msgid "" +"Assign object *v* to the *i*\\ th element of *o*. Raise an exception and " +"return ``-1`` on failure; return ``0`` on success. This is the equivalent " +"of the Python statement ``o[i] = v``. This function *does not* " +"\":term:`steal`\" a reference to *v*." msgstr "" +"شیء *v* را به عنصر *i*\\ ام از *o* اختصاص می‌دهد. در صورت شکست، یک استثنا " +"مطرح می‌کند و ``-1`` را برمی‌گرداند؛ در صورت موفقیت ``0`` را برمی‌گرداند. " +"این معادل دستور پایتونی ``o[i] = v`` است. این تابع ارجاعی به *v* را " +"\":term:`steal`\" *نمی‌کند*." -msgid "If *v* is ``NULL``, the element is deleted, but this feature is deprecated in favour of using :c:func:`PySequence_DelItem`." +msgid "" +"If *v* is ``NULL``, the element is deleted, but this feature is deprecated " +"in favour of using :c:func:`PySequence_DelItem`." msgstr "" +"اگر *v* برابر ``NULL`` باشد، المان حذف می‌شود، اما این قابلیت منسوخ شده و " +"به‌جای آن استفاده از :c:func:`PySequence_DelItem` توصیه می‌شود." -msgid "Delete the *i*\\ th element of object *o*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``del o[i]``." +msgid "" +"Delete the *i*\\ th element of object *o*. Returns ``-1`` on failure. This" +" is the equivalent of the Python statement ``del o[i]``." msgstr "" +"عنصر *i*\\ اُم از شیء *o* را حذف می‌کند. در صورت شکست ``-1`` برمی‌گرداند. " +"این معادل دستور پایتون ``del o[i]`` است." -msgid "Assign the sequence object *v* to the slice in sequence object *o* from *i1* to *i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``." +msgid "" +"Assign the sequence object *v* to the slice in sequence object *o* from *i1*" +" to *i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``." msgstr "" +"شیء دنباله *v* را به اسلایس موجود در شیء دنباله *o* از *i1* تا *i2* منتسب " +"کنید. این معادل دستور پایتونی ``o[i1:i2] = v`` است." -msgid "Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``del o[i1:i2]``." +msgid "" +"Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` " +"on failure. This is the equivalent of the Python statement ``del " +"o[i1:i2]``." msgstr "" +"اسلایس موجود در شیء دنباله *o* را از *i1* تا *i2* حذف می‌کند. در صورت شکست، " +"``-1`` برمی‌گرداند. این معادل دستور پایتون ``del o[i1:i2]`` است." -msgid "Return the number of occurrences of *value* in *o*, that is, return the number of keys for which ``o[key] == value``. On failure, return ``-1``. This is equivalent to the Python expression ``o.count(value)``." +msgid "" +"Return the number of occurrences of *value* in *o*, that is, return the " +"number of keys for which ``o[key] == value``. On failure, return ``-1``. " +"This is equivalent to the Python expression ``o.count(value)``." msgstr "" +"تعداد رخدادهای *value* در *o* را بازمی‌گرداند؛ یعنی تعداد کلیدهایی که " +"``o[key] == value`` باشد را بازمی‌گرداند. در صورت شکست، ``-1`` بازمی‌گرداند." +" این معادل عبارت پایتونی ``o.count(value)`` است." -msgid "Determine if *o* contains *value*. If an item in *o* is equal to *value*, return ``1``, otherwise return ``0``. On error, return ``-1``. This is equivalent to the Python expression ``value in o``." +msgid "" +"Determine if *o* contains *value*. If an item in *o* is equal to *value*, " +"return ``1``, otherwise return ``0``. On error, return ``-1``. This is " +"equivalent to the Python expression ``value in o``." msgstr "" +"بررسی می‌کند که آیا *o* شامل *value* است. اگر آیتمی در *o* برابر با *value* " +"باشد، ``1`` و در غیر این صورت ``0`` برگردانده می‌شود. در صورت خطا، ``-1`` " +"برگردانده می‌شود. این معادل عبارت پایتونی ``value in o`` است." msgid "Alias for :c:func:`PySequence_Contains`." -msgstr "" +msgstr "نام مستعاری برای :c:func:`PySequence_Contains`." msgid "The function should no longer be used to write new code." -msgstr "" +msgstr "این تابع نباید دیگر برای نوشتن کد جدید استفاده شود." -msgid "Return the first index *i* for which ``o[i] == value``. On error, return ``-1``. This is equivalent to the Python expression ``o.index(value)``." +msgid "" +"Return the first index *i* for which ``o[i] == value``. On error, return " +"``-1``. This is equivalent to the Python expression ``o.index(value)``." msgstr "" +"اولین اندیس *i* را که ``o[i] == value`` باشد برمی‌گرداند. در صورت خطا، " +"``-1`` را برمی‌گرداند. این معادل عبارت پایتونی ``o.index(value)`` است." -msgid "Return a list object with the same contents as the sequence or iterable *o*, or ``NULL`` on failure. The returned list is guaranteed to be new. This is equivalent to the Python expression ``list(o)``." +msgid "" +"Return a list object with the same contents as the sequence or iterable *o*," +" or ``NULL`` on failure. The returned list is guaranteed to be new. This " +"is equivalent to the Python expression ``list(o)``." msgstr "" +"یک شیء فهرست با همان محتویات دنباله یا پیمایش‌پذیر *o* برمی‌گرداند، یا در " +"صورت شکست ``NULL``. تضمین می‌شود که فهرست بازگردانده‌شده جدید باشد. این " +"معادل عبارت پایتونی ``list(o)`` است." -msgid "Return a tuple object with the same contents as the sequence or iterable *o*, or ``NULL`` on failure. If *o* is a tuple, a new reference will be returned, otherwise a tuple will be constructed with the appropriate contents. This is equivalent to the Python expression ``tuple(o)``." +msgid "" +"Return a tuple object with the same contents as the sequence or iterable " +"*o*, or ``NULL`` on failure. If *o* is a tuple, a new reference will be " +"returned, otherwise a tuple will be constructed with the appropriate " +"contents. This is equivalent to the Python expression ``tuple(o)``." msgstr "" +"یک شیء تاپل با همان محتوای دنباله یا پیمایش‌پذیر *o* برمی‌گرداند، یا در صورت" +" شکست ``NULL`` برمی‌گرداند. اگر *o* یک تاپل باشد، یک ارجاع جدید بازگردانده " +"می‌شود؛ در غیر این صورت، تاپلی با محتوای مناسب ساخته می‌شود. این معادل عبارت" +" پایتونی ``tuple(o)`` است." -msgid "Return the sequence or iterable *o* as an object usable by the other ``PySequence_Fast*`` family of functions. If the object is not a sequence or iterable, raises :exc:`TypeError` with *m* as the message text. Returns ``NULL`` on failure." +msgid "" +"Return the sequence or iterable *o* as an object usable by the other " +"``PySequence_Fast*`` family of functions. If the object is not a sequence or" +" iterable, raises :exc:`TypeError` with *m* as the message text. Returns " +"``NULL`` on failure." msgstr "" +"دنباله یا پیمایش‌پذیر *o* را به‌صورت شیئی قابل استفاده توسط سایر توابع " +"خانواده ``PySequence_Fast*`` برمی‌گرداند. اگر شیء یک دنباله یا پیمایش‌پذیر " +"نباشد، استثنای :exc:`TypeError` را با *m* به‌عنوان متن پیام ایجاد می‌کند. در" +" صورت شکست، ``NULL`` برمی‌گرداند." -msgid "The ``PySequence_Fast*`` functions are thus named because they assume *o* is a :c:type:`PyTupleObject` or a :c:type:`PyListObject` and access the data fields of *o* directly." +msgid "" +"The ``PySequence_Fast*`` functions are thus named because they assume *o* is" +" a :c:type:`PyTupleObject` or a :c:type:`PyListObject` and access the data " +"fields of *o* directly." msgstr "" +"توابع ``PySequence_Fast*`` به این دلیل چنین نام‌گذاری شده‌اند که فرض می‌کنند" +" *o* یک :c:type:`PyTupleObject` یا :c:type:`PyListObject` است و مستقیماً به " +"فیلدهای داده‌ی *o* دسترسی دارند." -msgid "As a CPython implementation detail, if *o* is already a sequence or list, it will be returned." +msgid "" +"As a CPython implementation detail, if *o* is already a sequence or list, it" +" will be returned." msgstr "" +"به عنوان یک جزئیات از پیاده‌سازی سی‌پایتون، اگر *o* از قبل یک دنباله یا " +"فهرست باشد، همان بازگردانده خواهد شد." -msgid "Returns the length of *o*, assuming that *o* was returned by :c:func:`PySequence_Fast` and that *o* is not ``NULL``. The size can also be retrieved by calling :c:func:`PySequence_Size` on *o*, but :c:func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list or tuple." -msgstr "" +msgid "" +"Returns the length of *o*, assuming that *o* was returned by " +":c:func:`PySequence_Fast` and that *o* is not ``NULL``. The size can also " +"be retrieved by calling :c:func:`PySequence_Size` on *o*, but " +":c:func:`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a " +"list or tuple." +msgstr "" +"طول *o* را برمی‌گرداند، با این فرض که *o* توسط :c:func:`PySequence_Fast` " +"برگردانده‌شده و *o* برابر ``NULL`` نیست. اندازه را می‌توان با فراخوانی " +":c:func:`PySequence_Size` روی *o* نیز بازیابی کرد، اما " +":c:func:`PySequence_Fast_GET_SIZE` سریع‌تر است زیرا می‌تواند فرض کند *o* یک " +"فهرست یا تاپل است." -msgid "Return the *i*\\ th element of *o*, assuming that *o* was returned by :c:func:`PySequence_Fast`, *o* is not ``NULL``, and that *i* is within bounds." +msgid "" +"Return the *i*\\ th element of *o*, assuming that *o* was returned by " +":c:func:`PySequence_Fast`, *o* is not ``NULL``, and that *i* is within " +"bounds." msgstr "" +"بازگرداندن عنصر *i*\\ ام از *o*، با این فرض که *o* توسط " +":c:func:`PySequence_Fast` بازگردانده شده باشد، *o* برابر ``NULL`` نباشد و " +"*i* در محدوده باشد." -msgid "Return the underlying array of PyObject pointers. Assumes that *o* was returned by :c:func:`PySequence_Fast` and *o* is not ``NULL``." +msgid "" +"Return the underlying array of PyObject pointers. Assumes that *o* was " +"returned by :c:func:`PySequence_Fast` and *o* is not ``NULL``." msgstr "" +"آرایه‌ی زیربنایی اشاره‌گرهای PyObject را برمی‌گرداند. فرض می‌کند که *o* توسط" +" :c:func:`PySequence_Fast` برگردانده شده باشد و *o* برابر ``NULL`` نباشد." -msgid "Note, if a list gets resized, the reallocation may relocate the items array. So, only use the underlying array pointer in contexts where the sequence cannot change." +msgid "" +"Note, if a list gets resized, the reallocation may relocate the items array." +" So, only use the underlying array pointer in contexts where the sequence " +"cannot change." msgstr "" +"توجه داشته باشید که اگر اندازه‌ی یک فهرست تغییر کند، تخصیص مجدد ممکن است " +"آرایه‌ی آیتم‌ها را جابه‌جا کند. بنابراین، اشاره‌گر آرایه‌ی زیرین را تنها در " +"زمینه‌هایی استفاده کنید که دنباله در آن‌ها نمی‌تواند تغییر کند." -msgid "Return the *i*\\ th element of *o* or ``NULL`` on failure. Faster form of :c:func:`PySequence_GetItem` but without checking that :c:func:`PySequence_Check` on *o* is true and without adjustment for negative indices." +msgid "" +"Return the *i*\\ th element of *o* or ``NULL`` on failure. Faster form of " +":c:func:`PySequence_GetItem` but without checking that " +":c:func:`PySequence_Check` on *o* is true and without adjustment for " +"negative indices." msgstr "" +"عنصر *i*\\ -ام از *o* یا در صورت شکست ``NULL`` را برمی‌گرداند. شکل سریع‌تری " +"از :c:func:`PySequence_GetItem` است، اما بدون بررسی اینکه " +":c:func:`PySequence_Check` روی *o* درست باشد و بدون تعدیل اندیس‌های منفی." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "len" -msgstr "" +msgstr "len" msgid "tuple" -msgstr "" +msgstr "تاپل" diff --git a/c-api/set.po b/c-api/set.po index fcd28f225..323c6cc6b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -25,106 +25,296 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Set Objects" -msgstr "" +msgstr "اشیاء مجموعه" -msgid "This section details the public API for :class:`set` and :class:`frozenset` objects. Any functionality not listed below is best accessed using either the abstract object protocol (including :c:func:`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print`, and :c:func:`PyObject_GetIter`) or the abstract number protocol (including :c:func:`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`, :c:func:`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`, :c:func:`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and :c:func:`PyNumber_InPlaceXor`)." -msgstr "" +msgid "" +"This section details the public API for :class:`set` and :class:`frozenset` " +"objects. Any functionality not listed below is best accessed using either " +"the abstract object protocol (including :c:func:`PyObject_CallMethod`, " +":c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`, " +":c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, " +":c:func:`PyObject_Print`, and :c:func:`PyObject_GetIter`) or the abstract " +"number protocol (including :c:func:`PyNumber_And`, " +":c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`, :c:func:`PyNumber_Xor`, " +":c:func:`PyNumber_InPlaceAnd`, :c:func:`PyNumber_InPlaceSubtract`, " +":c:func:`PyNumber_InPlaceOr`, and :c:func:`PyNumber_InPlaceXor`)." +msgstr "" +"این بخش API عمومی اشیاء :class:`set` و :class:`frozenset` را با جزئیات شرح " +"می‌دهد. بهترین راه دسترسی به هر قابلیتی که در ادامه فهرست نشده است، استفاده " +"از پروتکل انتزاعی شیء (شامل :c:func:`PyObject_CallMethod`، " +":c:func:`PyObject_RichCompareBool`، :c:func:`PyObject_Hash`، " +":c:func:`PyObject_Repr`، :c:func:`PyObject_IsTrue`، :c:func:`PyObject_Print`" +" و :c:func:`PyObject_GetIter`) یا پروتکل انتزاعی عدد (شامل " +":c:func:`PyNumber_And`، :c:func:`PyNumber_Subtract`، :c:func:`PyNumber_Or`، " +":c:func:`PyNumber_Xor`، :c:func:`PyNumber_InPlaceAnd`، " +":c:func:`PyNumber_InPlaceSubtract`، :c:func:`PyNumber_InPlaceOr` و " +":c:func:`PyNumber_InPlaceXor`) است." -msgid "This subtype of :c:type:`PyObject` is used to hold the internal data for both :class:`set` and :class:`frozenset` objects. It is like a :c:type:`PyDictObject` in that it is a fixed size for small sets (much like tuple storage) and will point to a separate, variable sized block of memory for medium and large sized sets (much like list storage). None of the fields of this structure should be considered public and all are subject to change. All access should be done through the documented API rather than by manipulating the values in the structure." -msgstr "" +msgid "" +"This subtype of :c:type:`PyObject` is used to hold the internal data for " +"both :class:`set` and :class:`frozenset` objects. It is like a " +":c:type:`PyDictObject` in that it is a fixed size for small sets (much like " +"tuple storage) and will point to a separate, variable sized block of memory " +"for medium and large sized sets (much like list storage). None of the fields" +" of this structure should be considered public and all are subject to " +"change. All access should be done through the documented API rather than by" +" manipulating the values in the structure." +msgstr "" +"این زیرنوع از :c:type:`PyObject` برای نگه‌داشتن داده‌های داخلی هر دو نوع شیء" +" :class:`set` و :class:`frozenset` استفاده می‌شود. این زیرنوع مانند " +":c:type:`PyDictObject` است از این جهت که برای مجموعه‌های کوچک اندازه‌ای ثابت" +" دارد (بسیار شبیه ذخیره‌سازی تاپل) و برای مجموعه‌های متوسط و بزرگ به یک بلوک" +" حافظه‌ی جداگانه با اندازه متغیر اشاره می‌کند (بسیار شبیه ذخیره‌سازی فهرست)." +" هیچ‌یک از فیلدهای این ساختار نباید عمومی در نظر گرفته شود و همه آن‌ها ممکن " +"است تغییر کنند. تمام دسترسی‌ها باید از طریق API مستندشده انجام شود، نه با " +"دستکاری مقادیر درون ساختار." -msgid "This is an instance of :c:type:`PyTypeObject` representing the Python :class:`set` type." +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python " +":class:`set` type." msgstr "" +"این یک نمونه از :c:type:`PyTypeObject` است که نوع :class:`set` پایتون را " +"نشان می‌دهد." -msgid "This is an instance of :c:type:`PyTypeObject` representing the Python :class:`frozenset` type." +msgid "" +"This is an instance of :c:type:`PyTypeObject` representing the Python " +":class:`frozenset` type." msgstr "" +"این یک نمونه از :c:type:`PyTypeObject` است که نوع :class:`frozenset` پایتون " +"را نشان می‌دهد." -msgid "The following type check macros work on pointers to any Python object. Likewise, the constructor functions work with any iterable Python object." +msgid "" +"The following type check macros work on pointers to any Python object. " +"Likewise, the constructor functions work with any iterable Python object." msgstr "" +"ماکروهای بررسی نوع زیر روی اشاره‌گر به هر شیء پایتونی کار می‌کنند. به همین " +"ترتیب، توابع سازنده با هر شیء پیمایش‌پذیر پایتونی کار می‌کنند." -msgid "Return true if *p* is a :class:`set` object or an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`set` object or an instance of a subtype. " +"This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`set` یا نمونه‌ای از یک زیرنوع باشد، مقدار true را " +"برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *p* is a :class:`frozenset` object or an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`frozenset` object or an instance of a " +"subtype. This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`frozenset` یا نمونه‌ای از یک زیرنوع باشد، مقدار true " +"را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or" +" an instance of a subtype. This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`set`، یک شیء :class:`frozenset` یا نمونه‌ای از یک " +"زیرنوع باشد، مقدار true را برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Return true if *p* is a :class:`set` object but not an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`set` object but not an instance of a " +"subtype. This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`set` باشد اما نمونه‌ای از یک زیرنوع نباشد، مقدار درست" +" را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return true if *p* is a :class:`set` object or a :class:`frozenset` object but not an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`set` object or a :class:`frozenset` object " +"but not an instance of a subtype. This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`set` یا یک شیء :class:`frozenset` باشد اما نمونه‌ای " +"از یک زیرنوع نباشد، مقدار true را برمی‌گرداند. این تابع همیشه با موفقیت " +"اجرا می‌شود." -msgid "Return true if *p* is a :class:`frozenset` object but not an instance of a subtype. This function always succeeds." +msgid "" +"Return true if *p* is a :class:`frozenset` object but not an instance of a " +"subtype. This function always succeeds." msgstr "" +"اگر *p* یک شیء :class:`frozenset` باشد اما نمونه‌ای از یک زیرنوع نباشد، " +"مقدار درست را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return a new :class:`set` containing objects returned by the *iterable*. The *iterable* may be ``NULL`` to create a new empty set. Return the new set on success or ``NULL`` on failure. Raise :exc:`TypeError` if *iterable* is not actually iterable. The constructor is also useful for copying a set (``c=set(s)``)." -msgstr "" +msgid "" +"Return a new :class:`set` containing objects returned by the *iterable*. " +"The *iterable* may be ``NULL`` to create a new empty set. Return the new " +"set on success or ``NULL`` on failure. Raise :exc:`TypeError` if *iterable*" +" is not actually iterable. The constructor is also useful for copying a set" +" (``c=set(s)``)." +msgstr "" +"یک :class:`set` جدید شامل اشیاء بازگردانده‌شده توسط *iterable* برمی‌گرداند. " +"*iterable* می‌تواند ``NULL`` باشد تا یک مجموعه‌ی خالی جدید ایجاد شود. در " +"صورت موفقیت مجموعه‌ی جدید و در صورت شکست ``NULL`` برمی‌گرداند. اگر " +"*iterable* در واقع پیمایش‌پذیر نباشد، استثنای :exc:`TypeError` ایجاد می‌شود." +" این سازنده برای کپی‌کردن یک مجموعه نیز مفید است (``c=set(s)``)." -msgid "The operation is atomic on :term:`free threading ` when *iterable* is a :class:`set`, :class:`frozenset` or :class:`dict`." +msgid "" +"The operation is atomic on :term:`free threading ` when" +" *iterable* is a :class:`set`, :class:`frozenset` or :class:`dict`." msgstr "" +"این عملیات در :term:`نخ‌بندی آزاد ` زمانی اتمی است که " +"*iterable* یک :class:`set`، :class:`frozenset` یا :class:`dict` باشد." -msgid "Return a new :class:`frozenset` containing objects returned by the *iterable*. The *iterable* may be ``NULL`` to create a new empty frozenset. Return the new set on success or ``NULL`` on failure. Raise :exc:`TypeError` if *iterable* is not actually iterable." +msgid "" +"Return a new :class:`frozenset` containing objects returned by the " +"*iterable*. The *iterable* may be ``NULL`` to create a new empty frozenset." +" Return the new set on success or ``NULL`` on failure. Raise " +":exc:`TypeError` if *iterable* is not actually iterable." msgstr "" +"یک :class:`frozenset` جدید شامل اشیایی که توسط *iterable* برگردانده می‌شوند " +"را برمی‌گرداند. *iterable* می‌تواند ``NULL`` باشد تا یک frozenset خالی جدید " +"ایجاد شود. در صورت موفقیت، مجموعه جدید و در صورت شکست، ``NULL`` برگردانده " +"می‌شود. اگر *iterable* در واقع پیمایش‌پذیر نباشد، :exc:`TypeError` ایجاد " +"می‌شود." -msgid "The following functions and macros are available for instances of :class:`set` or :class:`frozenset` or instances of their subtypes." +msgid "" +"The following functions and macros are available for instances of " +":class:`set` or :class:`frozenset` or instances of their subtypes." msgstr "" +"توابع و ماکروهای زیر برای نمونه‌های :class:`set` یا :class:`frozenset` یا " +"نمونه‌های زیرنوع‌های آن‌ها در دسترس هستند." -msgid "Return the length of a :class:`set` or :class:`frozenset` object. Equivalent to ``len(anyset)``. Raises a :exc:`SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, or an instance of a subtype." +msgid "" +"Return the length of a :class:`set` or :class:`frozenset` object. Equivalent" +" to ``len(anyset)``. Raises a :exc:`SystemError` if *anyset* is not a " +":class:`set`, :class:`frozenset`, or an instance of a subtype." msgstr "" +"طول یک شیء :class:`set` یا :class:`frozenset` را برمی‌گرداند. معادل " +"``len(anyset)`` است. اگر *anyset* یک :class:`set`، :class:`frozenset` یا " +"نمونه‌ای از یک زیرنوع نباشد، استثنای :exc:`SystemError` ایجاد می‌کند." msgid "Macro form of :c:func:`PySet_Size` without error checking." -msgstr "" +msgstr "شکل ماکروی :c:func:`PySet_Size` بدون بررسی خطا." -msgid "Return ``1`` if found, ``0`` if not found, and ``-1`` if an error is encountered. Unlike the Python :meth:`~object.__contains__` method, this function does not automatically convert unhashable sets into temporary frozensets. Raise a :exc:`TypeError` if the *key* is unhashable. Raise :exc:`SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, or an instance of a subtype." -msgstr "" +msgid "" +"Return ``1`` if found, ``0`` if not found, and ``-1`` if an error is " +"encountered. Unlike the Python :meth:`~object.__contains__` method, this " +"function does not automatically convert unhashable sets into temporary " +"frozensets. Raise a :exc:`TypeError` if the *key* is unhashable. Raise " +":exc:`SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, or" +" an instance of a subtype." +msgstr "" +"مقدار ``1`` را در صورت یافت‌شدن، ``0`` را در صورت یافت‌نشدن و ``-1`` را در " +"صورت بروز خطا برمی‌گرداند. برخلاف متد :meth:`~object.__contains__` پایتون، " +"این تابع مجموعه‌های هش‌ناپذیر را به‌طور خودکار به frozenset‌های موقت تبدیل " +"نمی‌کند. اگر *key* هش‌ناپذیر باشد، یک :exc:`TypeError` ایجاد می‌کند. اگر " +"*anyset* یک :class:`set`، :class:`frozenset` یا نمونه‌ای از یک زیرنوع نباشد،" +" :exc:`SystemError` ایجاد می‌کند." -msgid "The operation is atomic on :term:`free threading ` when *key* is :class:`str`, :class:`int`, :class:`float`, :class:`bool` or :class:`bytes`." +msgid "" +"The operation is atomic on :term:`free threading ` when" +" *key* is :class:`str`, :class:`int`, :class:`float`, :class:`bool` or " +":class:`bytes`." msgstr "" +"این عملیات در :term:`نخ‌بندی آزاد ` زمانی که *key* از " +"نوع :class:`str`، :class:`int`، :class:`float`، :class:`bool` یا " +":class:`bytes` باشد، اتمیک است." -msgid "Add *key* to a :class:`set` instance. Also works with :class:`frozenset` instances (like :c:func:`PyTuple_SetItem` it can be used to fill in the values of brand new frozensets before they are exposed to other code). Return ``0`` on success or ``-1`` on failure. Raise a :exc:`TypeError` if the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to grow. Raise a :exc:`SystemError` if *set* is not an instance of :class:`set` or its subtype." -msgstr "" +msgid "" +"Add *key* to a :class:`set` instance. Also works with :class:`frozenset` " +"instances (like :c:func:`PyTuple_SetItem` it can be used to fill in the " +"values of brand new frozensets before they are exposed to other code). " +"Return ``0`` on success or ``-1`` on failure. Raise a :exc:`TypeError` if " +"the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to " +"grow. Raise a :exc:`SystemError` if *set* is not an instance of " +":class:`set` or its subtype." +msgstr "" +"*key* را به یک نمونه از :class:`set` اضافه می‌کند. همچنین با نمونه‌های " +":class:`frozenset` کار می‌کند (مانند :c:func:`PyTuple_SetItem`، می‌توان از " +"آن برای پر کردن مقادیر frozenset‌های تازه‌ساخته پیش از آنکه در معرض کد دیگر " +"قرار گیرند استفاده کرد). در صورت موفقیت ``0`` یا در صورت شکست ``-1`` را " +"برمی‌گرداند. اگر *key* هش‌ناپذیر باشد، :exc:`TypeError` ایجاد می‌شود. اگر " +"فضایی برای رشد وجود نداشته باشد، :exc:`MemoryError` ایجاد می‌شود. اگر *set* " +"نمونه‌ای از :class:`set` یا زیرنوع آن نباشد، :exc:`SystemError` ایجاد " +"می‌شود." -msgid "The following functions are available for instances of :class:`set` or its subtypes but not for instances of :class:`frozenset` or its subtypes." +msgid "" +"The following functions are available for instances of :class:`set` or its " +"subtypes but not for instances of :class:`frozenset` or its subtypes." msgstr "" +"توابع زیر برای نمونه‌های :class:`set` یا زیرنوع‌های آن در دسترس هستند، اما " +"برای نمونه‌های :class:`frozenset` یا زیرنوع‌های آن در دسترس نیستند." -msgid "Return ``1`` if found and removed, ``0`` if not found (no action taken), and ``-1`` if an error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a :exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~set.discard` method, this function does not automatically convert unhashable sets into temporary frozensets. Raise :exc:`SystemError` if *set* is not an instance of :class:`set` or its subtype." -msgstr "" +msgid "" +"Return ``1`` if found and removed, ``0`` if not found (no action taken), and" +" ``-1`` if an error is encountered. Does not raise :exc:`KeyError` for " +"missing keys. Raise a :exc:`TypeError` if the *key* is unhashable. Unlike " +"the Python :meth:`~set.discard` method, this function does not automatically" +" convert unhashable sets into temporary frozensets. Raise :exc:`SystemError`" +" if *set* is not an instance of :class:`set` or its subtype." +msgstr "" +"اگر یافته و حذف شود، ``1``؛ اگر یافت نشود (هیچ عملی انجام نمی‌شود)، ``0``؛ و" +" اگر با خطایی مواجه شود، ``-1`` برمی‌گرداند. استثنای :exc:`KeyError` را برای" +" کلیدهای مفقود ایجاد نمی‌کند. اگر *key* هش‌ناپذیر باشد، استثنای " +":exc:`TypeError` ایجاد می‌کند. برخلاف متد :meth:`~set.discard` در پایتون، " +"این تابع مجموعه‌های هش‌ناپذیر را به‌طور خودکار به frozenset‌های موقت تبدیل " +"نمی‌کند. اگر *set* نمونه‌ای از :class:`set` یا زیرنوع آن نباشد، استثنای " +":exc:`SystemError` ایجاد می‌کند." -msgid "Return a new reference to an arbitrary object in the *set*, and removes the object from the *set*. Return ``NULL`` on failure. Raise :exc:`KeyError` if the set is empty. Raise a :exc:`SystemError` if *set* is not an instance of :class:`set` or its subtype." +msgid "" +"Return a new reference to an arbitrary object in the *set*, and removes the " +"object from the *set*. Return ``NULL`` on failure. Raise :exc:`KeyError` " +"if the set is empty. Raise a :exc:`SystemError` if *set* is not an instance " +"of :class:`set` or its subtype." msgstr "" +"یک ارجاع جدید به یک شیء دلخواه در *set* برمی‌گرداند و آن شیء را از *set* حذف" +" می‌کند. در صورت شکست ``NULL`` را برمی‌گرداند. اگر مجموعه خالی باشد، استثنای" +" :exc:`KeyError` ایجاد می‌شود. اگر *set* نمونه‌ای از :class:`set` یا زیرنوع " +"آن نباشد، استثنای :exc:`SystemError` ایجاد می‌شود." -msgid "Empty an existing set of all elements. Return ``0`` on success. Return ``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:`set` or its subtype." +msgid "" +"Empty an existing set of all elements. Return ``0`` on success. Return " +"``-1`` and raise :exc:`SystemError` if *set* is not an instance of " +":class:`set` or its subtype." msgstr "" +"یک مجموعه‌ی موجود را از تمام عناصرش خالی می‌کند. در صورت موفقیت ``0`` را " +"برمی‌گرداند. اگر *set* نمونه‌ای از :class:`set` یا زیرنوع آن نباشد، ``-1`` " +"را برمی‌گرداند و استثنای :exc:`SystemError` را ایجاد می‌کند." -msgid "In the :term:`free-threaded build`, the set is emptied before its entries are cleared, so other threads will observe an empty set rather than intermediate states." +msgid "" +"In the :term:`free-threaded build`, the set is emptied before its entries " +"are cleared, so other threads will observe an empty set rather than " +"intermediate states." msgstr "" +"در :term:`free-threaded build`، مجموعه پیش از پاک شدن ورودی‌هایش خالی " +"می‌شود، بنابراین نخ‌های دیگر به‌جای وضعیت‌های میانی، مجموعه‌ای خالی را " +"مشاهده خواهند کرد." msgid "Deprecated API" -msgstr "" +msgstr "API منسوخ" -msgid "A constant representing the size of an internal preallocated table inside :c:type:`PySetObject` instances." +msgid "" +"A constant representing the size of an internal preallocated table inside " +":c:type:`PySetObject` instances." msgstr "" +"ثابتی که نشان‌دهنده‌ی اندازه‌ی جدول داخلی پیش‌تخصیص‌شده درون نمونه‌های " +":c:type:`PySetObject` است." -msgid "This is documented solely for completeness, as there are no guarantees that a given version of CPython uses preallocated tables with a fixed size. In code that does not deal with unstable set internals, :c:macro:`!PySet_MINSIZE` can be replaced with a small constant like ``8``." +msgid "" +"This is documented solely for completeness, as there are no guarantees that " +"a given version of CPython uses preallocated tables with a fixed size. In " +"code that does not deal with unstable set internals, " +":c:macro:`!PySet_MINSIZE` can be replaced with a small constant like ``8``." msgstr "" +"این مورد صرفاً برای کامل بودن مستند شده است، زیرا هیچ تضمینی وجود ندارد که " +"نسخه‌ی خاصی از سی‌پایتون از جدول‌های پیش‌تخصیص‌شده با اندازه‌ی ثابت استفاده " +"کند. در کدی که با جزئیات داخلی ناپایدار مجموعه سروکار ندارد، می‌توان " +":c:macro:`!PySet_MINSIZE` را با یک ثابت کوچک مانند ``8`` جایگزین کرد." msgid "If looking for the size of a set, use :c:func:`PySet_Size` instead." msgstr "" +"اگر به دنبال اندازه‌ی یک مجموعه هستید، به‌جای آن از :c:func:`PySet_Size` " +"استفاده کنید." msgid "object" -msgstr "" +msgstr "شیء" msgid "set" -msgstr "" +msgstr "مجموعه" msgid "frozenset" -msgstr "" +msgstr "frozenset" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "len" -msgstr "" +msgstr "len" diff --git a/c-api/slice.po b/c-api/slice.po index fb3fada50..3eb86db5a 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -22,49 +22,101 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Slice Objects" -msgstr "" +msgstr "اشیاء اسلایس" -msgid "The type object for slice objects. This is the same as :class:`slice` in the Python layer." +msgid "" +"The type object for slice objects. This is the same as :class:`slice` in " +"the Python layer." msgstr "" +"شیء نوع برای اشیاء اسلایس. این همان :class:`slice` در لایه‌ی پایتون است." -msgid "Return true if *ob* is a slice object; *ob* must not be ``NULL``. This function always succeeds." +msgid "" +"Return true if *ob* is a slice object; *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" +"اگر *ob* یک شیء اسلایس باشد، مقدار درست را برمی‌گرداند؛ *ob* نباید ``NULL`` " +"باشد. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return a new slice object with the given values. The *start*, *stop*, and *step* parameters are used as the values of the slice object attributes of the same names. Any of the values may be ``NULL``, in which case the ``None`` will be used for the corresponding attribute." +msgid "" +"Return a new slice object with the given values. The *start*, *stop*, and " +"*step* parameters are used as the values of the slice object attributes of " +"the same names. Any of the values may be ``NULL``, in which case the " +"``None`` will be used for the corresponding attribute." msgstr "" +"یک شیء اسلایس جدید با مقادیر داده‌شده برمی‌گرداند. پارامترهای *start*، " +"*stop* و *step* به‌عنوان مقادیر ویژگی‌های هم‌نام شیء اسلایس استفاده می‌شوند." +" هر یک از مقادیر می‌تواند ``NULL`` باشد، که در این صورت ``None`` برای ویژگی " +"مربوطه استفاده خواهد شد." -msgid "Return ``NULL`` with an exception set if the new object could not be allocated." +msgid "" +"Return ``NULL`` with an exception set if the new object could not be " +"allocated." msgstr "" +"اگر نتوان شیء جدید را تخصیص داد، ``NULL`` به‌همراه یک استثنا تنظیم‌شده " +"بازگردانید." -msgid "Retrieve the start, stop and step indices from the slice object *slice*, assuming a sequence of length *length*. Treats indices greater than *length* as errors." +msgid "" +"Retrieve the start, stop and step indices from the slice object *slice*, " +"assuming a sequence of length *length*. Treats indices greater than *length*" +" as errors." msgstr "" +"اندیس‌های شروع، توقف و گام را از شیء اسلایس *slice*، با فرض دنباله‌ای به طول" +" *length*، بازیابی می‌کند. اندیس‌های بزرگ‌تر از *length* را به‌عنوان خطا در " +"نظر می‌گیرد." -msgid "Returns ``0`` on success and ``-1`` on error with no exception set (unless one of the indices was not ``None`` and failed to be converted to an integer, in which case ``-1`` is returned with an exception set)." +msgid "" +"Returns ``0`` on success and ``-1`` on error with no exception set (unless " +"one of the indices was not ``None`` and failed to be converted to an " +"integer, in which case ``-1`` is returned with an exception set)." msgstr "" +"در صورت موفقیت ``0`` و در صورت خطا ``-1`` را بدون تنظیم استثنا برمی‌گرداند " +"(مگر آنکه یکی از اندیس‌ها ``None`` نباشد و نتوان آن را به عدد صحیح تبدیل " +"کرد، که در این حالت ``-1`` همراه با استثنای تنظیم‌شده برگردانده می‌شود)." msgid "You probably do not want to use this function." -msgstr "" +msgstr "احتمالاً نمی‌خواهید از این تابع استفاده کنید." -msgid "The parameter type for the *slice* parameter was ``PySliceObject*`` before." -msgstr "" +msgid "" +"The parameter type for the *slice* parameter was ``PySliceObject*`` before." +msgstr "نوع پارامتر *slice* قبلاً ``PySliceObject*`` بود." -msgid "Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, stop, and step indices from the slice object *slice* assuming a sequence of length *length*, and store the length of the slice in *slicelength*. Out of bounds indices are clipped in a manner consistent with the handling of normal slices." +msgid "" +"Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, " +"stop, and step indices from the slice object *slice* assuming a sequence of " +"length *length*, and store the length of the slice in *slicelength*. Out of" +" bounds indices are clipped in a manner consistent with the handling of " +"normal slices." msgstr "" +"جایگزین قابل استفاده برای :c:func:`PySlice_GetIndices`. اندیس‌های شروع، توقف" +" و گام را از شیء اسلایس *slice* با فرض دنباله‌ای به طول *length* بازیابی " +"می‌کند و طول اسلایس را در *slicelength* ذخیره می‌کند. اندیس‌های خارج از " +"محدوده به شکلی سازگار با نحوه‌ی برخورد با اسلایس‌های معمولی محدود می‌شوند." msgid "Return ``0`` on success and ``-1`` on error with an exception set." msgstr "" +"در صورت موفقیت ``0`` و در صورت خطا ``-1`` به همراه استثنای تنظیم‌شده " +"برمی‌گرداند." -msgid "This function is considered not safe for resizable sequences. Its invocation should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices` where ::" +msgid "" +"This function is considered not safe for resizable sequences. Its invocation" +" should be replaced by a combination of :c:func:`PySlice_Unpack` and " +":c:func:`PySlice_AdjustIndices` where ::" msgstr "" +"این تابع برای دنباله‌های با اندازه‌ی قابل تغییر، ایمن در نظر گرفته نمی‌شود. " +"فراخوانی آن باید با ترکیبی از :c:func:`PySlice_Unpack` و " +":c:func:`PySlice_AdjustIndices` جایگزین شود که در آن ::" msgid "" "if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) < 0) {\n" " // return error\n" "}" msgstr "" +"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) < 0) {\n" +" // return error\n" +"}" msgid "is replaced by ::" -msgstr "" +msgstr "جایگزین می‌شود با ::" msgid "" "if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" @@ -72,33 +124,82 @@ msgid "" "}\n" "slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" msgstr "" +"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" +" // return error\n" +"}\n" +"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" -msgid "If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` and ``0x03060000`` (not including) or ``0x03060100`` or higher :c:func:`!PySlice_GetIndicesEx` is implemented as a macro using :c:func:`!PySlice_Unpack` and :c:func:`!PySlice_AdjustIndices`. Arguments *start*, *stop* and *step* are evaluated more than once." -msgstr "" +msgid "" +"If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` " +"and ``0x03060000`` (not including) or ``0x03060100`` or higher " +":c:func:`!PySlice_GetIndicesEx` is implemented as a macro using " +":c:func:`!PySlice_Unpack` and :c:func:`!PySlice_AdjustIndices`. Arguments " +"*start*, *stop* and *step* are evaluated more than once." +msgstr "" +"اگر ``Py_LIMITED_API`` تنظیم نشده باشد یا روی مقداری بین ``0x03050400`` و " +"``0x03060000`` (شامل نمی‌شود) یا ``0x03060100`` یا بالاتر تنظیم شده باشد، " +":c:func:`!PySlice_GetIndicesEx` به‌صورت یک ماکرو با استفاده از " +":c:func:`!PySlice_Unpack` و :c:func:`!PySlice_AdjustIndices` پیاده‌سازی شده " +"است. آرگومان‌های *start*، *stop* و *step* بیش از یک بار ارزیابی می‌شوند." -msgid "If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or between ``0x03060000`` and ``0x03060100`` (not including) :c:func:`!PySlice_GetIndicesEx` is a deprecated function." +msgid "" +"If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or " +"between ``0x03060000`` and ``0x03060100`` (not including) " +":c:func:`!PySlice_GetIndicesEx` is a deprecated function." msgstr "" +"اگر ``Py_LIMITED_API`` به مقداری کمتر از ``0x03050400`` یا به مقداری بین " +"``0x03060000`` و ``0x03060100`` (شامل نمی‌شود) تنظیم‌شده باشد، " +":c:func:`!PySlice_GetIndicesEx` تابعی منسوخ است." -msgid "Extract the start, stop and step data members from a slice object as C integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to ``PY_SSIZE_T_MAX``, silently boost the start and stop values less than ``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``." -msgstr "" +msgid "" +"Extract the start, stop and step data members from a slice object as C " +"integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to " +"``PY_SSIZE_T_MAX``, silently boost the start and stop values less than " +"``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step values" +" less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``." +msgstr "" +"اعضای داده‌ی آغاز، پایان و گام را از یک شیء اسلایس به‌صورت اعداد صحیح C " +"استخراج می‌کند. مقادیر بزرگ‌تر از ``PY_SSIZE_T_MAX`` را بی‌صدا به " +"``PY_SSIZE_T_MAX`` کاهش می‌دهد، مقادیر کمتر از ``PY_SSIZE_T_MIN`` برای آغاز " +"و پایان را بی‌صدا به ``PY_SSIZE_T_MIN`` افزایش می‌دهد و مقادیر کمتر از " +"``-PY_SSIZE_T_MAX`` برای گام را بی‌صدا به ``-PY_SSIZE_T_MAX`` افزایش می‌دهد." msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" +"در صورت خطا ``-1`` به همراه استثنای تنظیم‌شده و در صورت موفقیت ``0`` " +"برمی‌گرداند." -msgid "Adjust start/end slice indices assuming a sequence of the specified length. Out of bounds indices are clipped in a manner consistent with the handling of normal slices." +msgid "" +"Adjust start/end slice indices assuming a sequence of the specified length. " +"Out of bounds indices are clipped in a manner consistent with the handling " +"of normal slices." msgstr "" +"اندیس‌های شروع/پایان اسلایس را با فرض دنباله‌ای به طول مشخص‌شده تنظیم " +"می‌کند. اندیس‌های خارج از محدوده به شکلی سازگار با نحوه‌ی برخورد با " +"اسلایس‌های معمولی محدود می‌شوند." -msgid "Return the length of the slice. Always successful. Doesn't call Python code." +msgid "" +"Return the length of the slice. Always successful. Doesn't call Python " +"code." msgstr "" +"طول اسلایس را برمی‌گرداند. همیشه موفق است. کد پایتون را فراخوانی نمی‌کند." msgid "Ellipsis Object" -msgstr "" +msgstr "شیء Ellipsis" -msgid "The type of Python :const:`Ellipsis` object. Same as :class:`types.EllipsisType` in the Python layer." +msgid "" +"The type of Python :const:`Ellipsis` object. Same " +"as :class:`types.EllipsisType` in the Python layer." msgstr "" +"نوع شیء :const:`Ellipsis` پایتون. همانند :class:`types.EllipsisType` در " +"لایه‌ی پایتون است." -msgid "The Python ``Ellipsis`` object. This object has no methods. Like :c:data:`Py_None`, it is an :term:`immortal` singleton object." +msgid "" +"The Python ``Ellipsis`` object. This object has no methods. Like " +":c:data:`Py_None`, it is an :term:`immortal` singleton object." msgstr "" +"شیء ``Ellipsis`` پایتون. این شیء هیچ متدی ندارد. مانند :c:data:`Py_None`، " +"این یک شیء تک‌نمونه‌ی :term:`نامیرا ` است." msgid ":c:data:`Py_Ellipsis` is immortal." -msgstr "" +msgstr ":c:data:`Py_Ellipsis` نامیرا است." diff --git a/c-api/stable.po b/c-api/stable.po index 80d66ec9b..317722e62 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -22,136 +22,369 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "C API Stability" -msgstr "" +msgstr "پایداری API زبان C" -msgid "Unless documented otherwise, Python's C API is covered by the Backwards Compatibility Policy, :pep:`387`. Most changes to it are source-compatible (typically by only adding new API). Changing existing API or removing API is only done after a deprecation period or to fix serious issues." +msgid "" +"Unless documented otherwise, Python's C API is covered by the Backwards " +"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " +"(typically by only adding new API). Changing existing API or removing API is" +" only done after a deprecation period or to fix serious issues." msgstr "" +"مگر آنکه خلاف آن مستند شده باشد، C API پایتون مشمول سیاست سازگاری رو به عقب،" +" :pep:`387`، است. بیشتر تغییرات آن با کد منبع سازگار هستند (source-" +"compatible) (معمولاً فقط با افزودن API‌های جدید). تغییر API‌های موجود یا حذف" +" API تنها پس از یک دوره‌ی منسوخ‌سازی یا برای رفع مشکلات جدی انجام می‌شود." -msgid "CPython's Application Binary Interface (ABI) is forward- and backwards-compatible across a minor release (if these are compiled the same way; see :ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will work on 3.10.8 and vice versa, but will need to be compiled separately for 3.9.x and 3.11.x." -msgstr "" +msgid "" +"CPython's Application Binary Interface (ABI) is forward- and backwards-" +"compatible across a minor release (if these are compiled the same way; see " +":ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " +"work on 3.10.8 and vice versa, but will need to be compiled separately for " +"3.9.x and 3.11.x." +msgstr "" +"رابط دودویی برنامه (ABI) سی‌پایتون در طول یک انتشار جزئی، به جلو و به عقب " +"سازگار است (اگر این‌ها به یک شکل کامپایل شده باشند؛ به :ref:`stable-abi-" +"platform` در ادامه مراجعه کنید). بنابراین، کدی که برای پایتون 3.10.0 کامپایل" +" شده باشد، روی 3.10.8 کار خواهد کرد و برعکس، اما برای 3.9.x و 3.11.x باید " +"جداگانه کامپایل شود." msgid "There are two tiers of C API with different stability expectations:" -msgstr "" +msgstr "دو سطح از C API با انتظارات پایداری متفاوت وجود دارد:" -msgid ":ref:`Unstable API `, may change in minor versions without a deprecation period. It is marked by the ``PyUnstable`` prefix in names." +msgid "" +":ref:`Unstable API `, may change in minor versions without a" +" deprecation period. It is marked by the ``PyUnstable`` prefix in names." msgstr "" +":ref:`API ناپایدار `، ممکن است در نسخه‌های جزئی بدون دوره‌ی " +"منسوخ‌سازی تغییر کند. این API با پیشوند ``PyUnstable`` در نام‌ها مشخص " +"می‌شود." -msgid ":ref:`Limited API `, is compatible across several minor releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is exposed from ``Python.h``." +msgid "" +":ref:`Limited API `, is compatible across several minor " +"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " +"exposed from ``Python.h``." msgstr "" +":ref:`API محدود `، در چندین نسخه‌ی فرعی سازگار است. هنگامی که" +" :c:macro:`Py_LIMITED_API` تعریف شود، فقط این زیرمجموعه از ``Python.h`` در " +"دسترس قرار می‌گیرد." msgid "These are discussed in more detail below." -msgstr "" +msgstr "این موارد در ادامه با جزئیات بیشتر بررسی می‌شوند." -msgid "Names prefixed by an underscore, such as ``_Py_InternalState``, are private API that can change without notice even in patch releases. If you need to use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use case." -msgstr "" +msgid "" +"Names prefixed by an underscore, such as ``_Py_InternalState``, are private " +"API that can change without notice even in patch releases. If you need to " +"use this API, consider reaching out to `CPython developers " +"`_ to discuss adding public " +"API for your use case." +msgstr "" +"نام‌هایی که با خط زیر آغاز می‌شوند، مانند ``_Py_InternalState``، API خصوصی " +"هستند و می‌توانند حتی در نسخه‌های وصله (patch) بدون اطلاع قبلی تغییر کنند. " +"اگر نیاز به استفاده از این API دارید، در نظر بگیرید که با `توسعه‌دهندگان " +"سی‌پایتون `_ ارتباط برقرار " +"کنید تا درباره‌ی افزودن API عمومی برای مورد استفاده‌ی خود گفت‌وگو کنید." msgid "Unstable C API" -msgstr "" +msgstr "API ناپایدار C" -msgid "Any API named with the ``PyUnstable`` prefix exposes CPython implementation details, and may change in every minor release (e.g. from 3.9 to 3.10) without any deprecation warnings. However, it will not change in a bugfix release (e.g. from 3.10.0 to 3.10.1)." +msgid "" +"Any API named with the ``PyUnstable`` prefix exposes CPython implementation " +"details, and may change in every minor release (e.g. from 3.9 to 3.10) " +"without any deprecation warnings. However, it will not change in a bugfix " +"release (e.g. from 3.10.0 to 3.10.1)." msgstr "" +"هر API که با پیشوند ``PyUnstable`` نام‌گذاری شده باشد، جزئیات پیاده‌سازی " +"سی‌پایتون را آشکار می‌کند و ممکن است در هر انتشار جزئی (برای مثال از 3.9 به " +"3.10) بدون هیچ هشدار منسوخ‌شدن تغییر کند. با این حال، در انتشار رفع اشکال " +"(برای مثال از 3.10.0 به 3.10.1) تغییر نخواهد کرد." -msgid "It is generally intended for specialized, low-level tools like debuggers." +msgid "" +"It is generally intended for specialized, low-level tools like debuggers." msgstr "" +"این به‌طور کلی برای ابزارهای تخصصی و سطح پایین مانند اشکال‌زداها در نظر " +"گرفته شده است." -msgid "Projects that use this API are expected to follow CPython development and spend extra effort adjusting to changes." +msgid "" +"Projects that use this API are expected to follow CPython development and " +"spend extra effort adjusting to changes." msgstr "" +"انتظار می‌رود پروژه‌هایی که از این API استفاده می‌کنند، توسعه‌ی سی‌پایتون را" +" دنبال کنند و برای سازگاری با تغییرات تلاش اضافی صرف کنند." msgid "Stable Application Binary Interface" -msgstr "" +msgstr "رابط دودویی پایدار برنامه (ABI)" -msgid "For simplicity, this document talks about *extensions*, but the Limited API and Stable ABI work the same way for all uses of the API – for example, embedding Python." +msgid "" +"For simplicity, this document talks about *extensions*, but the Limited API " +"and Stable ABI work the same way for all uses of the API – for example, " +"embedding Python." msgstr "" +"برای سادگی، این سند درباره‌ی *افزونه‌ها* صحبت می‌کند، اما API محدود (Limited" +" API) و ABI پایدار (Stable ABI) برای همه‌ی کاربردهای API به همان شکل کار " +"می‌کنند – برای مثال، جاسازی کردن پایتون." msgid "Limited C API" -msgstr "" +msgstr "C API محدود" -msgid "Python 3.2 introduced the *Limited API*, a subset of Python's C API. Extensions that only use the Limited API can be compiled once and be loaded on multiple versions of Python. Contents of the Limited API are :ref:`listed below `." +msgid "" +"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " +"Extensions that only use the Limited API can be compiled once and be loaded " +"on multiple versions of Python. Contents of the Limited API are :ref:`listed" +" below `." msgstr "" +"پایتون 3.2 *API محدود* را معرفی کرد، زیرمجموعه‌ای از C API پایتون. ماژول‌های" +" توسعه‌ای که فقط از API محدود استفاده می‌کنند، می‌توانند یک‌بار کامپایل شوند" +" و روی نسخه‌های متعدد پایتون بارگذاری شوند. محتوای API محدود :ref:`در ادامه " +"فهرست شده‌اند `." -msgid "Define this macro before including ``Python.h`` to opt in to only use the Limited API, and to select the Limited API version." +msgid "" +"Define this macro before including ``Python.h`` to opt in to only use the " +"Limited API, and to select the Limited API version." msgstr "" +"این ماکرو را پیش از گنجاندن ``Python.h`` تعریف کنید تا فقط از API محدود " +"استفاده کنید و نسخه‌ی API محدود را انتخاب کنید." -msgid "Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` corresponding to the lowest Python version your extension supports. The extension will be ABI-compatible with all Python 3 releases from the specified one onward, and can use Limited API introduced up to that version." +msgid "" +"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " +"corresponding to the lowest Python version your extension supports. The " +"extension will be ABI-compatible with all Python 3 releases from the " +"specified one onward, and can use Limited API introduced up to that version." msgstr "" +"``Py_LIMITED_API`` را برابر با مقدار :c:macro:`PY_VERSION_HEX` مربوط به " +"کمترین نسخه‌ی پایتونی که ماژول توسعه‌ای شما از آن پشتیبانی می‌کند، تعریف " +"کنید. ماژول توسعه‌ای از نظر ABI با تمام نسخه‌های پایتون 3 از نسخه‌ی مشخص‌شده" +" به بعد سازگار خواهد بود و می‌تواند از API محدودی که تا آن نسخه معرفی شده " +"است استفاده کند." -msgid "Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when compiling with future Python versions." +msgid "" +"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum " +"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when " +"compiling with future Python versions." msgstr "" +"به‌جای استفاده‌ی مستقیم از ماکروی ``PY_VERSION_HEX``، برای پایداری هنگام " +"کامپایل با نسخه‌های آینده‌ی پایتون، یک حداقل نسخه‌ی فرعی (مثلاً " +"``0x030A0000`` برای پایتون 3.10) را به‌صورت هاردکد (hardcode) در کد بنویسید." -msgid "You can also define ``Py_LIMITED_API`` to ``3``. This works the same as ``0x03020000`` (Python 3.2, the version that introduced Limited API)." +msgid "" +"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as " +"``0x03020000`` (Python 3.2, the version that introduced Limited API)." msgstr "" +"همچنین می‌توانید ``Py_LIMITED_API`` را با مقدار ``3`` تعریف کنید. این همانند" +" ``0x03020000`` عمل می‌کند (پایتون 3.2، نسخه‌ای که API محدود را معرفی کرد)." msgid "Stable ABI" -msgstr "" +msgstr "رابط دودویی کاربردی پایدار (Stable ABI)" -msgid "To enable this, Python provides a *Stable ABI*: a set of symbols that will remain ABI-compatible across Python 3.x versions." +msgid "" +"To enable this, Python provides a *Stable ABI*: a set of symbols that will " +"remain ABI-compatible across Python 3.x versions." msgstr "" +"برای فعال‌سازی این، پایتون یک *ABI پایدار* فراهم می‌کند: مجموعه‌ای از نمادها" +" که در تمام نسخه‌های Python 3.x از نظر ABI سازگار باقی خواهند ماند." -msgid "The Stable ABI prevents ABI issues, like linker errors due to missing symbols or data corruption due to changes in structure layouts or function signatures. However, other changes in Python can change the *behavior* of extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for details." -msgstr "" +msgid "" +"The Stable ABI prevents ABI issues, like linker errors due to missing " +"symbols or data corruption due to changes in structure layouts or function " +"signatures. However, other changes in Python can change the *behavior* of " +"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for " +"details." +msgstr "" +"ABI پایدار از بروز مشکلات ABI جلوگیری می‌کند؛ مانند خطاهای پیونددهنده " +"(linker) به دلیل نبود نمادها یا خرابی داده به دلیل تغییرات در چیدمان " +"ساختارها یا امضاهای توابع. با این حال، تغییرات دیگر در پایتون می‌توانند " +"*رفتار* ماژول‌های توسعه‌ای را تغییر دهند. برای جزئیات، سیاست سازگاری رو به " +"عقب پایتون (:pep:`387`) را ببینید." -msgid "The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support older versions of the Limited API." +msgid "" +"The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " +"older versions of the Limited API." msgstr "" +"ABI پایدار شامل نمادهایی است که در :ref:`API محدود ` افشا " +"شده‌اند، اما نمادهای دیگری را نیز در بر می‌گیرد – برای مثال، توابعی که برای " +"پشتیبانی از نسخه‌های قدیمی‌ترِ API محدود ضروری‌اند." -msgid "On Windows, extensions that use the Stable ABI should be linked against ``python3.dll`` rather than a version-specific library such as ``python39.dll``." +msgid "" +"On Windows, extensions that use the Stable ABI should be linked against " +"``python3.dll`` rather than a version-specific library such as " +"``python39.dll``." msgstr "" +"در ویندوز، ماژول‌های توسعه‌ای که از رابط دودویی پایدار (Stable ABI) استفاده " +"می‌کنند، باید به‌جای کتابخانه‌ی خاص نسخه مانند ``python39.dll`` به " +"``python3.dll`` پیوند داده شوند." -msgid "On some platforms, Python will look for and load shared library files named with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such extensions conform to a Stable ABI. The user (or their packaging tools) need to ensure that, for example, extensions built with the 3.10+ Limited API are not installed for lower versions of Python." -msgstr "" +msgid "" +"On some platforms, Python will look for and load shared library files named " +"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such" +" extensions conform to a Stable ABI. The user (or their packaging tools) " +"need to ensure that, for example, extensions built with the 3.10+ Limited " +"API are not installed for lower versions of Python." +msgstr "" +"در برخی پلتفرم‌ها، پایتون به دنبال پرونده‌های کتابخانه اشتراکی‌ای که با " +"برچسب ``abi3`` نام‌گذاری شده‌اند می‌گردد و آن‌ها را بارگذاری می‌کند (برای " +"مثال، ``mymodule.abi3.so``). پایتون بررسی نمی‌کند که آیا این‌گونه ماژول‌های " +"توسعه‌ای با ABI پایدار مطابقت دارند یا خیر. کاربر (یا ابزارهای بسته‌بندی او)" +" باید اطمینان حاصل کنند که مثلاً ماژول‌های توسعه‌ای ساخته‌شده با API محدودِ " +"3.10+ برای نسخه‌های پایین‌تر پایتون نصب نمی‌شوند." -msgid "All functions in the Stable ABI are present as functions in Python's shared library, not solely as macros. This makes them usable from languages that don't use the C preprocessor." +msgid "" +"All functions in the Stable ABI are present as functions in Python's shared " +"library, not solely as macros. This makes them usable from languages that " +"don't use the C preprocessor." msgstr "" +"تمام توابع موجود در ABI پایدار به‌صورت تابع در کتابخانه‌ی اشتراکی پایتون " +"وجود دارند، نه صرفاً به‌صورت ماکرو. این امر امکان استفاده از آن‌ها را در " +"زبان‌هایی که از پیش‌پردازنده‌ی C استفاده نمی‌کنند، فراهم می‌کند." msgid "Limited API Scope and Performance" -msgstr "" +msgstr "محدوده و کارایی API محدود" -msgid "The goal for the Limited API is to allow everything that is possible with the full C API, but possibly with a performance penalty." +msgid "" +"The goal for the Limited API is to allow everything that is possible with " +"the full C API, but possibly with a performance penalty." msgstr "" +"هدف API محدود (Limited API) این است که هر آنچه با C API کامل امکان‌پذیر است " +"را ممکن سازد، اما احتمالاً با جریمه‌ای در کارایی (performance penalty)." -msgid "For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it can rely on version-specific implementation details of the list object." +msgid "" +"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro" +" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because " +"it can rely on version-specific implementation details of the list object." msgstr "" +"برای مثال، در حالی که :c:func:`PyList_GetItem` دسترس‌پذیر است، گونه‌ی ماکروی" +" «ناامن» آن :c:func:`PyList_GET_ITEM` دسترس‌پذیر نیست. این ماکرو می‌تواند " +"سریع‌تر باشد، زیرا می‌تواند به جزئیات پیاده‌سازی وابسته به نسخه‌ی شیء فهرست " +"تکیه کند." -msgid "Without ``Py_LIMITED_API`` defined, some C API functions are inlined or replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, allowing stability as Python's data structures are improved, but possibly reducing performance." +msgid "" +"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " +"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " +"allowing stability as Python's data structures are improved, but possibly " +"reducing performance." msgstr "" +"بدون تعریف ``Py_LIMITED_API``، برخی از توابع C API به‌صورت درون‌خطی (inline)" +" تعریف می‌شوند یا با ماکروها جایگزین می‌گردند. تعریف ``Py_LIMITED_API`` این " +"درون‌خطی‌سازی را غیرفعال می‌کند و همین امر باعث می‌شود با بهبود ساختارهای " +"داده‌ی پایتون، پایداری حفظ شود، هرچند ممکن است کارایی را کاهش دهد." -msgid "By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile a Limited API extension with a version-specific ABI. This can improve performance for that Python version, but will limit compatibility. Compiling with ``Py_LIMITED_API`` will then yield an extension that can be distributed where a version-specific one is not available – for example, for prereleases of an upcoming Python version." -msgstr "" +msgid "" +"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " +"a Limited API extension with a version-specific ABI. This can improve " +"performance for that Python version, but will limit compatibility. Compiling" +" with ``Py_LIMITED_API`` will then yield an extension that can be " +"distributed where a version-specific one is not available – for example, for" +" prereleases of an upcoming Python version." +msgstr "" +"با تعریف ن کردن ``Py_LIMITED_API``، می‌توان یک افزونه‌ی API محدود را با ABI " +"مخصوص نسخه کامپایل کرد. این کار می‌تواند کارایی را برای آن نسخه از پایتون " +"بهبود بخشد، اما سازگاری را محدود خواهد کرد. در مقابل، کامپایل کردن با " +"``Py_LIMITED_API`` افزونه‌ای به دست می‌دهد که می‌توان آن را در جایی که " +"افزونه‌ی مخصوص نسخه در دسترس نیست، توزیع کرد – برای مثال، برای نسخه‌های " +"پیش‌انتشار یک نسخه‌ی آتی از پایتون." msgid "Limited API Caveats" -msgstr "" +msgstr "هشدارهای API محدود" -msgid "Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee that code conforms to the :ref:`Limited API ` or the :ref:`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but an API also includes other issues, such as expected semantics." +msgid "" +"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " +"that code conforms to the :ref:`Limited API ` or the " +":ref:`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, " +"but an API also includes other issues, such as expected semantics." msgstr "" +"توجه داشته باشید که کامپایل با ``Py_LIMITED_API`` تضمین کاملی *نیست* که کد " +"با :ref:`API محدود ` یا :ref:`ABI پایدار ` مطابقت" +" داشته باشد. ``Py_LIMITED_API`` تنها تعاریف را پوشش می‌دهد، اما یک API " +"همچنین شامل مسائل دیگری مانند معناشناسی مورد انتظار است." -msgid "One issue that ``Py_LIMITED_API`` does not guard against is calling a function with arguments that are invalid in a lower Python version. For example, consider a function that starts accepting ``NULL`` for an argument. In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, the argument will be used directly, causing a ``NULL`` dereference and crash. A similar argument works for fields of structs." -msgstr "" +msgid "" +"One issue that ``Py_LIMITED_API`` does not guard against is calling a " +"function with arguments that are invalid in a lower Python version. For " +"example, consider a function that starts accepting ``NULL`` for an argument." +" In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, " +"the argument will be used directly, causing a ``NULL`` dereference and " +"crash. A similar argument works for fields of structs." +msgstr "" +"یکی از مشکلاتی که ``Py_LIMITED_API`` در برابر آن محافظت نمی‌کند، فراخوانی " +"تابعی با آرگومان‌هایی است که در نسخه‌ی پایین‌تر پایتون نامعتبر هستند. برای " +"مثال، تابعی را در نظر بگیرید که شروع به پذیرش ``NULL`` برای یک آرگومان کرده " +"است. در پایتون 3.9، ``NULL`` اکنون یک رفتار پیش‌فرض را انتخاب می‌کند، اما در" +" پایتون 3.8، آرگومان مستقیماً استفاده خواهد شد که موجب ارجاع‌زدایی " +"(dereference) ``NULL`` و فروپاشی می‌شود. استدلال مشابهی برای فیلدهای " +"ساختارها نیز برقرار است." -msgid "Another issue is that some struct fields are currently not hidden when ``Py_LIMITED_API`` is defined, even though they're part of the Limited API." +msgid "" +"Another issue is that some struct fields are currently not hidden when " +"``Py_LIMITED_API`` is defined, even though they're part of the Limited API." msgstr "" +"مشکل دیگر این است که برخی از فیلدهای ساختار هنگامی که ``Py_LIMITED_API`` " +"تعریف شده باشد، در حال حاضر پنهان نمی‌شوند، هرچند که بخشی از API محدود به " +"شمار می‌روند." -msgid "For these reasons, we recommend testing an extension with *all* minor Python versions it supports, and preferably to build with the *lowest* such version." +msgid "" +"For these reasons, we recommend testing an extension with *all* minor Python" +" versions it supports, and preferably to build with the *lowest* such " +"version." msgstr "" +"به این دلایل، توصیه می‌کنیم یک ماژول توسعه‌ای را با *همه‌ی* نسخه‌های فرعی " +"پایتون که از آن‌ها پشتیبانی می‌کند آزمایش کنید و ترجیحاً آن را با " +"*پایین‌ترین* نسخه از میان آن‌ها کامپایل کنید." -msgid "We also recommend reviewing documentation of all used API to check if it is explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a few private declarations are exposed for technical reasons (or even unintentionally, as bugs)." +msgid "" +"We also recommend reviewing documentation of all used API to check if it is " +"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " +"few private declarations are exposed for technical reasons (or even " +"unintentionally, as bugs)." msgstr "" +"همچنین توصیه می‌کنیم مستندات تمام API‌های استفاده‌شده را بررسی کنید تا مشخص " +"شود که آیا به‌طور صریح بخشی از API محدود هستند یا خیر. حتی با تعریف " +"``Py_LIMITED_API``، چند اعلان خصوصی به دلایل فنی (یا حتی ناخواسته، به‌عنوان " +"باگ) در دسترس قرار می‌گیرند." -msgid "Also note that the Limited API is not necessarily stable: compiling with ``Py_LIMITED_API`` with Python 3.8 means that the extension will run with Python 3.12, but it will not necessarily *compile* with Python 3.12. In particular, parts of the Limited API may be deprecated and removed, provided that the Stable ABI stays stable." -msgstr "" +msgid "" +"Also note that the Limited API is not necessarily stable: compiling with " +"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " +"Python 3.12, but it will not necessarily *compile* with Python 3.12. In " +"particular, parts of the Limited API may be deprecated and removed, provided" +" that the Stable ABI stays stable." +msgstr "" +"همچنین توجه داشته باشید که API محدود لزوماً پایدار نیست: کامپایل کردن با " +"``Py_LIMITED_API`` در پایتون 3.8 به این معناست که ماژول توسعه‌ای با پایتون " +"3.12 اجرا خواهد شد، اما لزوماً با پایتون 3.12 *کامپایل* نخواهد شد. به‌ویژه، " +"ممکن است بخش‌هایی از API محدود منسوخ و حذف شوند، به شرط آنکه ABI پایدار " +"پایدار باقی بماند." msgid "Platform Considerations" -msgstr "" +msgstr "ملاحظات پلتفرم" -msgid "ABI stability depends not only on Python, but also on the compiler used, lower-level libraries and compiler options. For the purposes of the :ref:`Stable ABI `, these details define a “platform”. They usually depend on the OS type and processor architecture" +msgid "" +"ABI stability depends not only on Python, but also on the compiler used, " +"lower-level libraries and compiler options. For the purposes of the " +":ref:`Stable ABI `, these details define a “platform”. They " +"usually depend on the OS type and processor architecture" msgstr "" +"پایداری ABI نه‌تنها به پایتون، بلکه به کامپایلر استفاده‌شده، کتابخانه‌های " +"سطح پایین‌تر و گزینه‌های کامپایلر نیز بستگی دارد. در چارچوب :ref:`ABI پایدار" +" `، این جزئیات یک «پلتفرم» را تعریف می‌کنند. این جزئیات معمولاً " +"به نوع سیستم‌عامل و معماری پردازنده بستگی دارند" -msgid "It is the responsibility of each particular distributor of Python to ensure that all Python versions on a particular platform are built in a way that does not break the Stable ABI. This is the case with Windows and macOS releases from ``python.org`` and many third-party distributors." +msgid "" +"It is the responsibility of each particular distributor of Python to ensure " +"that all Python versions on a particular platform are built in a way that " +"does not break the Stable ABI. This is the case with Windows and macOS " +"releases from ``python.org`` and many third-party distributors." msgstr "" +"مسئولیت هر توزیع‌کننده‌ی خاص پایتون این است که اطمینان حاصل کند تمام " +"نسخه‌های پایتون روی یک پلتفرم خاص به گونه‌ای ساخته می‌شوند که ABI پایدار را " +"نشکنند. این موضوع درباره‌ی نسخه‌های ویندوز و macOS از ``python.org`` و " +"بسیاری از توزیع‌کنندگان شخص ثالث صادق است." msgid "Contents of Limited API" -msgstr "" +msgstr "محتویات API محدود" -msgid "Currently, the :ref:`Limited API ` includes the following items:" -msgstr "" +msgid "" +"Currently, the :ref:`Limited API ` includes the following " +"items:" +msgstr "در حال حاضر، :ref:`API محدود ` شامل موارد زیر است:" msgid "PyUnstable" -msgstr "" +msgstr "PyUnstable" diff --git a/c-api/structures.po b/c-api/structures.po index d484582b6..9703e3ff9 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -25,166 +25,354 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Common Object Structures" -msgstr "" +msgstr "ساختارهای مشترک اشیاء" -msgid "There are a large number of structures which are used in the definition of object types for Python. This section describes these structures and how they are used." +msgid "" +"There are a large number of structures which are used in the definition of " +"object types for Python. This section describes these structures and how " +"they are used." msgstr "" +"تعداد زیادی ساختار وجود دارند که در تعریف نوع‌های شیء برای پایتون استفاده " +"می‌شوند. این بخش این ساختارها و نحوه‌ی استفاده از آن‌ها را شرح می‌دهد." msgid "Base object types and macros" -msgstr "" +msgstr "نوع‌های شیء پایه و ماکروها" -msgid "All Python objects ultimately share a small number of fields at the beginning of the object's representation in memory. These are represented by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are defined, in turn, by the expansions of some macros also used, whether directly or indirectly, in the definition of all other Python objects. Additional macros can be found under :ref:`reference counting `." -msgstr "" +msgid "" +"All Python objects ultimately share a small number of fields at the " +"beginning of the object's representation in memory. These are represented " +"by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are " +"defined, in turn, by the expansions of some macros also used, whether " +"directly or indirectly, in the definition of all other Python objects. " +"Additional macros can be found under :ref:`reference counting " +"`." +msgstr "" +"همه‌ی اشیاء پایتون در نهایت تعداد اندکی فیلد را در ابتدای بازنمایی شیء در " +"حافظه به اشتراک می‌گذارند. این فیلدها با نوع‌های :c:type:`PyObject` و " +":c:type:`PyVarObject` بازنمایی می‌شوند که آن نوع‌ها نیز به نوبه‌ی خود توسط " +"بسط برخی ماکروها تعریف می‌شوند؛ ماکروهایی که چه به‌طور مستقیم و چه به‌طور " +"غیرمستقیم، در تعریف همه‌ی اشیاء دیگر پایتون نیز به کار رفته‌اند. ماکروهای " +"دیگر را می‌توانید در :ref:`شمارش ارجاع ` بیابید." -msgid "All object types are extensions of this type. This is a type which contains the information Python needs to treat a pointer to an object as an object. In a normal \"release\" build, it contains only the object's reference count and a pointer to the corresponding type object. Nothing is actually declared to be a :c:type:`PyObject`, but every pointer to a Python object can be cast to a :c:expr:`PyObject*`." -msgstr "" +msgid "" +"All object types are extensions of this type. This is a type which contains" +" the information Python needs to treat a pointer to an object as an object." +" In a normal \"release\" build, it contains only the object's reference " +"count and a pointer to the corresponding type object. Nothing is actually " +"declared to be a :c:type:`PyObject`, but every pointer to a Python object " +"can be cast to a :c:expr:`PyObject*`." +msgstr "" +"همه‌ی نوع‌های شیء توسعه‌هایی از این نوع هستند. این نوعی است که اطلاعات مورد " +"نیاز پایتون برای در نظر گرفتن یک اشاره‌گر به یک شیء به‌عنوان یک شیء را در بر" +" می‌گیرد. در یک ساختِ «انتشار» (release) معمولی، این نوع تنها شمارش ارجاع " +"شیء و یک اشاره‌گر به شیء نوع متناظر را در بر دارد. در واقع هیچ‌چیز به‌عنوان " +"یک :c:type:`PyObject` اعلام نمی‌شود، اما هر اشاره‌گر به یک شیء پایتون را " +"می‌توان به :c:expr:`PyObject*` قالب‌ریزی کرد." -msgid "The members must not be accessed directly; instead use macros such as :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." +msgid "" +"The members must not be accessed directly; instead use macros such as " +":c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." msgstr "" +"اعضا نباید به‌طور مستقیم مورد دسترسی قرار گیرند؛ در عوض از ماکروهایی مانند " +":c:macro:`Py_REFCNT` و :c:macro:`Py_TYPE` استفاده کنید." -msgid "The object's reference count, as returned by :c:macro:`Py_REFCNT`. Do not use this field directly; instead use functions and macros such as :c:macro:`!Py_REFCNT`, :c:func:`Py_INCREF` and :c:func:`Py_DecRef`." +msgid "" +"The object's reference count, as returned by :c:macro:`Py_REFCNT`. Do not " +"use this field directly; instead use functions and macros such as " +":c:macro:`!Py_REFCNT`, :c:func:`Py_INCREF` and :c:func:`Py_DecRef`." msgstr "" +"شمارش ارجاع شیء، همان‌طور که توسط :c:macro:`Py_REFCNT` برگردانده می‌شود. از " +"این فیلد مستقیماً استفاده نکنید؛ در عوض از توابع و ماکروهایی مانند " +":c:macro:`!Py_REFCNT`، :c:func:`Py_INCREF` و :c:func:`Py_DecRef` استفاده " +"کنید." -msgid "The field type may be different from ``Py_ssize_t``, depending on build configuration and platform." +msgid "" +"The field type may be different from ``Py_ssize_t``, depending on build " +"configuration and platform." msgstr "" +"نوع فیلد ممکن است بسته به پیکربندی ساخت و پلتفرم، از ``Py_ssize_t`` متفاوت " +"باشد." -msgid "The object's type. Do not use this field directly; use :c:macro:`Py_TYPE` and :c:func:`Py_SET_TYPE` instead." +msgid "" +"The object's type. Do not use this field directly; use :c:macro:`Py_TYPE` " +"and :c:func:`Py_SET_TYPE` instead." msgstr "" +"نوع شیء. از این فیلد مستقیماً استفاده نکنید؛ به‌جای آن از :c:macro:`Py_TYPE`" +" و :c:func:`Py_SET_TYPE` استفاده کنید." -msgid "An extension of :c:type:`PyObject` that adds the :c:member:`~PyVarObject.ob_size` field. This is intended for objects that have some notion of *length*." +msgid "" +"An extension of :c:type:`PyObject` that adds the " +":c:member:`~PyVarObject.ob_size` field. This is intended for objects that " +"have some notion of *length*." msgstr "" +"توسعه‌ای از :c:type:`PyObject` که فیلد :c:member:`~PyVarObject.ob_size` را " +"به آن می‌افزاید. این برای شیءهایی در نظر گرفته شده است که نوعی مفهوم از " +"*طول* دارند." -msgid "As with :c:type:`!PyObject`, the members must not be accessed directly; instead use macros such as :c:macro:`Py_SIZE`, :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." +msgid "" +"As with :c:type:`!PyObject`, the members must not be accessed directly; " +"instead use macros such as :c:macro:`Py_SIZE`, :c:macro:`Py_REFCNT` and " +":c:macro:`Py_TYPE`." msgstr "" +"همان‌طور که در مورد :c:type:`!PyObject` صادق است، نباید به اعضا مستقیماً " +"دسترسی داشته باشید؛ در عوض از ماکروهایی مانند :c:macro:`Py_SIZE`، " +":c:macro:`Py_REFCNT` و :c:macro:`Py_TYPE` استفاده کنید." -msgid "A size field, whose contents should be considered an object's internal implementation detail." +msgid "" +"A size field, whose contents should be considered an object's internal " +"implementation detail." msgstr "" +"فیلد اندازه، که محتوای آن باید به‌عنوان جزئیات داخلی پیاده‌سازی یک شیء در " +"نظر گرفته شود." msgid "Do not use this field directly; use :c:macro:`Py_SIZE` instead." msgstr "" +"از این فیلد به‌طور مستقیم استفاده نکنید؛ در عوض از :c:macro:`Py_SIZE` " +"استفاده کنید." -msgid "Object creation functions such as :c:func:`PyObject_NewVar` will generally set this field to the requested size (number of items). After creation, arbitrary values can be stored in :c:member:`!ob_size` using :c:macro:`Py_SET_SIZE`." +msgid "" +"Object creation functions such as :c:func:`PyObject_NewVar` will generally " +"set this field to the requested size (number of items). After creation, " +"arbitrary values can be stored in :c:member:`!ob_size` using " +":c:macro:`Py_SET_SIZE`." msgstr "" +"توابع ایجاد شیء مانند :c:func:`PyObject_NewVar` به‌طور کلی این فیلد را به " +"اندازه‌ی درخواستی (تعداد آیتم‌ها) تنظیم می‌کنند. پس از ایجاد، می‌توان مقادیر" +" دلخواه را در :c:member:`!ob_size` با استفاده از :c:macro:`Py_SET_SIZE` " +"ذخیره کرد." -msgid "To get an object's publicly exposed length, as returned by the Python function :py:func:`len`, use :c:func:`PyObject_Length` instead." +msgid "" +"To get an object's publicly exposed length, as returned by the Python " +"function :py:func:`len`, use :c:func:`PyObject_Length` instead." msgstr "" +"برای به‌دست‌آوردن طولِ عمومیِ در دسترسِ یک شیء، که تابع پایتونی " +":py:func:`len` بازمی‌گرداند، به‌جای آن از :c:func:`PyObject_Length` استفاده " +"کنید." -msgid "This is a macro used when declaring new types which represent objects without a varying length. The PyObject_HEAD macro expands to::" +msgid "" +"This is a macro used when declaring new types which represent objects " +"without a varying length. The PyObject_HEAD macro expands to::" msgstr "" +"این ماکرو هنگام اعلان نوع‌های جدیدی که اشیاء بدون طول متغیر را بازنمایی " +"می‌کنند، به کار می‌رود. ماکرو PyObject_HEAD به شکل زیر بسط می‌یابد::" msgid "PyObject ob_base;" -msgstr "" +msgstr "PyObject ob_base;" msgid "See documentation of :c:type:`PyObject` above." -msgstr "" +msgstr "به مستندات :c:type:`PyObject` در بالا مراجعه کنید." -msgid "This is a macro used when declaring new types which represent objects with a length that varies from instance to instance. The PyObject_VAR_HEAD macro expands to::" +msgid "" +"This is a macro used when declaring new types which represent objects with a" +" length that varies from instance to instance. The PyObject_VAR_HEAD macro " +"expands to::" msgstr "" +"این ماکرو هنگام اعلان نوع‌های جدیدی به کار می‌رود که شیءهایی را نمایندگی " +"می‌کنند که طولشان از نمونه‌ای به نمونه‌ای دیگر تغییر می‌کند. ماکرو " +"PyObject_VAR_HEAD به شکل زیر بسط می‌یابد::" msgid "PyVarObject ob_base;" -msgstr "" +msgstr "PyVarObject ob_base;" msgid "See documentation of :c:type:`PyVarObject` above." -msgstr "" +msgstr "به مستندات :c:type:`PyVarObject` در بالا مراجعه کنید." -msgid "The base class of all other objects, the same as :class:`object` in Python." -msgstr "" +msgid "" +"The base class of all other objects, the same as :class:`object` in Python." +msgstr "کلاس پایه‌ی همه‌ی اشیاء دیگر، همانند :class:`object` در پایتون." -msgid "Test if the *x* object is the *y* object, the same as ``x is y`` in Python." +msgid "" +"Test if the *x* object is the *y* object, the same as ``x is y`` in Python." msgstr "" +"بررسی می‌کند که آیا شیء *x* همان شیء *y* است، همانند ``x is y`` در پایتون." -msgid "Test if an object is the ``None`` singleton, the same as ``x is None`` in Python." +msgid "" +"Test if an object is the ``None`` singleton, the same as ``x is None`` in " +"Python." msgstr "" +"بررسی می‌کند که آیا یک شیء، تک‌نمونه‌ی ``None`` است یا نه؛ همانند ``x is " +"None`` در پایتون." -msgid "Test if an object is the ``True`` singleton, the same as ``x is True`` in Python." +msgid "" +"Test if an object is the ``True`` singleton, the same as ``x is True`` in " +"Python." msgstr "" +"بررسی می‌کند که آیا یک شیء تک‌نمونه‌ی ``True`` است یا نه؛ همانند ``x is " +"True`` در پایتون." -msgid "Test if an object is the ``False`` singleton, the same as ``x is False`` in Python." +msgid "" +"Test if an object is the ``False`` singleton, the same as ``x is False`` in " +"Python." msgstr "" +"بررسی می‌کند که آیا یک شیء، تک‌نمونه‌ی ``False`` است، همانند ``x is False`` " +"در پایتون." msgid "Get the type of the Python object *o*." -msgstr "" +msgstr "نوع شیء پایتون *o* را به دست می‌آورد." -msgid "The returned reference is :term:`borrowed ` from *o*. Do not release it with :c:func:`Py_DECREF` or similar." +msgid "" +"The returned reference is :term:`borrowed ` from *o*. Do" +" not release it with :c:func:`Py_DECREF` or similar." msgstr "" +"ارجاع بازگردانده‌شده از *o* :term:`امانی ` است. آن را با" +" :c:func:`Py_DECREF` یا مشابه آن آزاد نکنید." -msgid ":c:func:`Py_TYPE()` is changed to an inline static function. The parameter type is no longer :c:expr:`const PyObject*`." +msgid "" +":c:func:`Py_TYPE()` is changed to an inline static function. The parameter " +"type is no longer :c:expr:`const PyObject*`." msgstr "" +":c:func:`Py_TYPE()` به یک تابع ایستای درون‌خطی تغییر کرده است. نوع پارامتر " +"دیگر :c:expr:`const PyObject*` نیست." -msgid "Return non-zero if the object *o* type is *type*. Return zero otherwise. Equivalent to: ``Py_TYPE(o) == type``." +msgid "" +"Return non-zero if the object *o* type is *type*. Return zero otherwise. " +"Equivalent to: ``Py_TYPE(o) == type``." msgstr "" +"اگر نوع شیء *o* برابر با *type* باشد، مقدار غیرصفر برمی‌گرداند. در غیر این " +"صورت صفر برمی‌گرداند. معادل با: ``Py_TYPE(o) == type``." -msgid "Set the type of object *o* to *type*, without any checking or reference counting." -msgstr "" +msgid "" +"Set the type of object *o* to *type*, without any checking or reference " +"counting." +msgstr "نوع شیء *o* را بدون هیچ بررسی یا شمارش ارجاع، به *type* تنظیم می‌کند." -msgid "This is a very low-level operation. Consider instead setting the Python attribute :attr:`~object.__class__` using :c:func:`PyObject_SetAttrString` or similar." +msgid "" +"This is a very low-level operation. Consider instead setting the Python " +"attribute :attr:`~object.__class__` using :c:func:`PyObject_SetAttrString` " +"or similar." msgstr "" +"این یک عملیات بسیار سطح‌پایین است. به‌جای این کار، تنظیم ویژگی پایتونی " +":attr:`~object.__class__` با استفاده از :c:func:`PyObject_SetAttrString` یا " +"مشابه آن را در نظر بگیرید." -msgid "Note that assigning an incompatible type can lead to undefined behavior." +msgid "" +"Note that assigning an incompatible type can lead to undefined behavior." msgstr "" +"توجه داشته باشید که انتساب یک نوع ناسازگار می‌تواند منجر به رفتار تعریف‌نشده" +" شود." -msgid "If *type* is a :ref:`heap type `, the caller must create a new reference to it. Similarly, if the old type of *o* is a heap type, the caller must release a reference to that type." +msgid "" +"If *type* is a :ref:`heap type `, the caller must create a new " +"reference to it. Similarly, if the old type of *o* is a heap type, the " +"caller must release a reference to that type." msgstr "" +"اگر *type* یک :ref:`نوع هیپ ` باشد، فراخوان‌کننده باید یک ارجاع " +"جدید به آن ایجاد کند. به‌طور مشابه، اگر نوع قبلی *o* یک نوع هیپ باشد، " +"فراخوان‌کننده باید یک ارجاع به آن نوع را آزاد کند." msgid "Get the :c:member:`~PyVarObject.ob_size` field of *o*." -msgstr "" +msgstr "گرفتن فیلد :c:member:`~PyVarObject.ob_size` از *o*." -msgid ":c:func:`Py_SIZE()` is changed to an inline static function. The parameter type is no longer :c:expr:`const PyVarObject*`." +msgid "" +":c:func:`Py_SIZE()` is changed to an inline static function. The parameter " +"type is no longer :c:expr:`const PyVarObject*`." msgstr "" +":c:func:`Py_SIZE()` به یک تابع ایستای درون‌خطی تغییر یافته است. نوع پارامتر " +"دیگر :c:expr:`const PyVarObject*` نیست." msgid "Set the :c:member:`~PyVarObject.ob_size` field of *o* to *size*." msgstr "" +"فیلد :c:member:`~PyVarObject.ob_size` از *o* را برابر *size* قرار می‌دهد." -msgid "This is a macro which expands to initialization values for a new :c:type:`PyObject` type. This macro expands to::" +msgid "" +"This is a macro which expands to initialization values for a new " +":c:type:`PyObject` type. This macro expands to::" msgstr "" +"این یک ماکرو است که به مقادیر مقداردهی اولیه برای یک نوع جدید " +":c:type:`PyObject` بسط می‌یابد. این ماکرو به صورت زیر بسط می‌یابد::" msgid "" "_PyObject_EXTRA_INIT\n" "1, type," msgstr "" +"_PyObject_EXTRA_INIT\n" +"1, type," -msgid "This is a macro which expands to initialization values for a new :c:type:`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. This macro expands to::" +msgid "" +"This is a macro which expands to initialization values for a new " +":c:type:`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` " +"field. This macro expands to::" msgstr "" +"این یک ماکرو است که به مقادیر مقداردهی اولیه برای یک نوع جدید " +":c:type:`PyVarObject` بسط می‌یابد و فیلد :c:member:`~PyVarObject.ob_size` را" +" نیز در بر می‌گیرد. این ماکرو به این صورت بسط می‌یابد::" msgid "" "_PyObject_EXTRA_INIT\n" "1, type, size," msgstr "" +"_PyObject_EXTRA_INIT\n" +"1, type, size," msgid "Implementing functions and methods" -msgstr "" +msgstr "پیاده‌سازی توابع و متدها" -msgid "Type of the functions used to implement most Python callables in C. Functions of this type take two :c:expr:`PyObject*` parameters and return one such value. If the return value is ``NULL``, an exception shall have been set. If not ``NULL``, the return value is interpreted as the return value of the function as exposed in Python. The function must return a new reference." -msgstr "" +msgid "" +"Type of the functions used to implement most Python callables in C. " +"Functions of this type take two :c:expr:`PyObject*` parameters and return " +"one such value. If the return value is ``NULL``, an exception shall have " +"been set. If not ``NULL``, the return value is interpreted as the return " +"value of the function as exposed in Python. The function must return a new " +"reference." +msgstr "" +"نوع توابعی که برای پیاده‌سازی بیشتر فراخوانی‌پذیرهای پایتون در C به کار " +"می‌روند. توابع از این نوع دو پارامتر :c:expr:`PyObject*` می‌گیرند و یک مقدار" +" از این نوع برمی‌گردانند. اگر مقدار بازگشتی ``NULL`` باشد، یک استثنا باید " +"تنظیم شده باشد. اگر ``NULL`` نباشد، مقدار بازگشتی به‌عنوان مقدار بازگشتی " +"تابع از دید پایتون تفسیر می‌شود. تابع باید یک ارجاع جدید برگرداند." msgid "The function signature is::" -msgstr "" +msgstr "امضای تابع به این صورت است::" msgid "" "PyObject *PyCFunction(PyObject *self,\n" " PyObject *args);" msgstr "" +"PyObject *PyCFunction(PyObject *self,\n" +" PyObject *args);" -msgid "Type of the functions used to implement Python callables in C with signature :ref:`METH_VARARGS | METH_KEYWORDS `. The function signature is::" +msgid "" +"Type of the functions used to implement Python callables in C with signature" +" :ref:`METH_VARARGS | METH_KEYWORDS `. The " +"function signature is::" msgstr "" +"نوع توابعی که برای پیاده‌سازی فراخوانی‌پذیرهای پایتون در C با امضای " +":ref:`METH_VARARGS | METH_KEYWORDS ` استفاده " +"می‌شوند. امضای تابع به این صورت است::" msgid "" "PyObject *PyCFunctionWithKeywords(PyObject *self,\n" " PyObject *args,\n" " PyObject *kwargs);" msgstr "" +"PyObject *PyCFunctionWithKeywords(PyObject *self,\n" +" PyObject *args,\n" +" PyObject *kwargs);" -msgid "Type of the functions used to implement Python callables in C with signature :c:macro:`METH_FASTCALL`. The function signature is::" +msgid "" +"Type of the functions used to implement Python callables in C with signature" +" :c:macro:`METH_FASTCALL`. The function signature is::" msgstr "" +"نوع توابعی که برای پیاده‌سازی فراخوانی‌پذیرهای پایتون در C با امضای " +":c:macro:`METH_FASTCALL` استفاده می‌شوند. امضای تابع چنین است::" msgid "" "PyObject *PyCFunctionFast(PyObject *self,\n" " PyObject *const *args,\n" " Py_ssize_t nargs);" msgstr "" +"PyObject *PyCFunctionFast(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs);" -msgid "Type of the functions used to implement Python callables in C with signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::" +msgid "" +"Type of the functions used to implement Python callables in C with signature" +" :ref:`METH_FASTCALL | METH_KEYWORDS `. The " +"function signature is::" msgstr "" +"نوع توابعی که برای پیاده‌سازی فراخوانی‌پذیرهای پایتون در C با امضای " +":ref:`METH_FASTCALL | METH_KEYWORDS ` استفاده " +"می‌شوند. امضای تابع به این صورت است::" msgid "" "PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n" @@ -192,9 +380,19 @@ msgid "" " Py_ssize_t nargs,\n" " PyObject *kwnames);" msgstr "" +"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames);" -msgid "Type of the functions used to implement Python callables in C with signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" +msgid "" +"Type of the functions used to implement Python callables in C with signature" +" :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" msgstr "" +"نوع توابعی که برای پیاده‌سازی فراخوانی‌پذیرهای پایتون در C با امضای " +":ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` استفاده می‌شوند. امضای تابع چنین است::" msgid "" "PyObject *PyCMethod(PyObject *self,\n" @@ -203,192 +401,489 @@ msgid "" " Py_ssize_t nargs,\n" " PyObject *kwnames)" msgstr "" +"PyObject *PyCMethod(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)" -msgid "Structure used to describe a method of an extension type. This structure has four fields:" +msgid "" +"Structure used to describe a method of an extension type. This structure " +"has four fields:" msgstr "" +"ساختاری که برای توصیف متد یک نوع توسعه‌ای استفاده می‌شود. این ساختار چهار " +"فیلد دارد:" msgid "Name of the method." -msgstr "" +msgstr "نام متد." msgid "Pointer to the C implementation." -msgstr "" +msgstr "اشاره‌گر به پیاده‌سازی C." msgid "Flags bits indicating how the call should be constructed." -msgstr "" +msgstr "بیت‌های پرچم که مشخص می‌کنند فراخوانی چگونه باید ساخته شود." msgid "Points to the contents of the docstring." -msgstr "" +msgstr "به محتوای رشته مستند اشاره می‌کند." -msgid "The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions may be of different types, but they always return :c:expr:`PyObject*`. If the function is not of the :c:type:`PyCFunction`, the compiler will require a cast in the method table. Even though :c:type:`PyCFunction` defines the first parameter as :c:expr:`PyObject*`, it is common that the method implementation uses the specific C type of the *self* object." -msgstr "" +msgid "" +"The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions " +"may be of different types, but they always return :c:expr:`PyObject*`. If " +"the function is not of the :c:type:`PyCFunction`, the compiler will require " +"a cast in the method table. Even though :c:type:`PyCFunction` defines the " +"first parameter as :c:expr:`PyObject*`, it is common that the method " +"implementation uses the specific C type of the *self* object." +msgstr "" +":c:member:`~PyMethodDef.ml_meth` یک اشاره‌گر به تابع C است. توابع ممکن است " +"از نوع‌های مختلفی باشند، اما همیشه :c:expr:`PyObject*` برمی‌گردانند. اگر " +"تابع از نوع :c:type:`PyCFunction` نباشد، کامپایلر در جدول متدها به قالب‌ریزی" +" نیاز خواهد داشت. هرچند :c:type:`PyCFunction` پارامتر اول را به‌صورت " +":c:expr:`PyObject*` تعریف می‌کند، رایج است که پیاده‌سازی متد از نوع مشخص C " +"شیء *self* استفاده کند." -msgid "The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include the following flags. The individual flags indicate either a calling convention or a binding convention." +msgid "" +"The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include " +"the following flags. The individual flags indicate either a calling " +"convention or a binding convention." msgstr "" +"فیلد :c:member:`~PyMethodDef.ml_flags` یک میدان بیتی (bitfield) است که " +"می‌تواند شامل پرچم‌های زیر باشد. هر یک از پرچم‌ها نشان‌دهنده‌ی یک قرارداد " +"فراخوانی یا یک قرارداد مقیدسازی است." msgid "There are these calling conventions:" -msgstr "" +msgstr "قراردادهای فراخوانی عبارت‌اند از:" -msgid "This is the typical calling convention, where the methods have the type :c:type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The first one is the *self* object for methods; for module functions, it is the module object. The second parameter (often called *args*) is a tuple object representing all arguments. This parameter is typically processed using :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." -msgstr "" +msgid "" +"This is the typical calling convention, where the methods have the type " +":c:type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. " +"The first one is the *self* object for methods; for module functions, it is " +"the module object. The second parameter (often called *args*) is a tuple " +"object representing all arguments. This parameter is typically processed " +"using :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." +msgstr "" +"این قرارداد فراخوانی متداول است که در آن متدها از نوع :c:type:`PyCFunction` " +"هستند. این تابع دو مقدار :c:expr:`PyObject*` دریافت می‌کند. مقدار نخست، شیء " +"*self* برای متدهاست؛ برای توابع ماژول، این مقدار شیء ماژول است. پارامتر دوم " +"(که اغلب *args* نامیده می‌شود) یک شیء تاپل است که تمام آرگومان‌ها را " +"نمایندگی می‌کند. این پارامتر معمولاً با استفاده از " +":c:func:`PyArg_ParseTuple` یا :c:func:`PyArg_UnpackTuple` پردازش می‌شود." -msgid "Can only be used in certain combinations with other flags: :ref:`METH_VARARGS | METH_KEYWORDS `, :ref:`METH_FASTCALL | METH_KEYWORDS ` and :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." -msgstr "" +msgid "" +"Can only be used in certain combinations with other flags: " +":ref:`METH_VARARGS | METH_KEYWORDS `, " +":ref:`METH_FASTCALL | METH_KEYWORDS ` and " +":ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." +msgstr "" +"فقط می‌تواند در ترکیب‌های خاصی با پرچم‌های دیگر استفاده شود: " +":ref:`METH_VARARGS | METH_KEYWORDS `، " +":ref:`METH_FASTCALL | METH_KEYWORDS ` و " +":ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_VARARGS | METH_KEYWORDS`" -msgid "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. The function expects three parameters: *self*, *args*, *kwargs* where *kwargs* is a dictionary of all the keyword arguments or possibly ``NULL`` if there are no keyword arguments. The parameters are typically processed using :c:func:`PyArg_ParseTupleAndKeywords`." -msgstr "" +msgid "" +"Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " +"The function expects three parameters: *self*, *args*, *kwargs* where " +"*kwargs* is a dictionary of all the keyword arguments or possibly ``NULL`` " +"if there are no keyword arguments. The parameters are typically processed " +"using :c:func:`PyArg_ParseTupleAndKeywords`." +msgstr "" +"متدهای دارای این پرچم‌ها باید از نوع :c:type:`PyCFunctionWithKeywords` " +"باشند. این تابع سه پارامتر می‌پذیرد: *self*، *args* و *kwargs* که در آن " +"*kwargs* دیکشنری‌ای از تمام آرگومان‌های کلیدواژه‌ای است یا در صورت نبود " +"آرگومان‌های کلیدواژه‌ای ممکن است ``NULL`` باشد. این پارامترها معمولاً با " +"استفاده از :c:func:`PyArg_ParseTupleAndKeywords` پردازش می‌شوند." -msgid "Fast calling convention supporting only positional arguments. The methods have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the second parameter is a C array of :c:expr:`PyObject*` values indicating the arguments and the third parameter is the number of arguments (the length of the array)." +msgid "" +"Fast calling convention supporting only positional arguments. The methods " +"have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the " +"second parameter is a C array of :c:expr:`PyObject*` values indicating the " +"arguments and the third parameter is the number of arguments (the length of " +"the array)." msgstr "" +"قرارداد فراخوانی سریع که فقط از آرگومان‌های جایگاهی پشتیبانی می‌کند. متدها " +"از نوع :c:type:`PyCFunctionFast` هستند. پارامتر اول *self* است، پارامتر دوم " +"یک آرایه C از مقادیر :c:expr:`PyObject*` است که آرگومان‌ها را نشان می‌دهد و " +"پارامتر سوم تعداد آرگومان‌ها است (طول آرایه)." msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." msgstr "" +"``METH_FASTCALL`` اکنون بخشی از :ref:`رابط دودویی پایدار (stable ABI) " +"` است." msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" -msgid "Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword arguments are passed the same way as in the :ref:`vectorcall protocol `: there is an additional fourth :c:expr:`PyObject*` parameter which is a tuple representing the names of the keyword arguments (which are guaranteed to be strings) or possibly ``NULL`` if there are no keywords. The values of the keyword arguments are stored in the *args* array, after the positional arguments." -msgstr "" +msgid "" +"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " +"with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword " +"arguments are passed the same way as in the :ref:`vectorcall protocol " +"`: there is an additional fourth :c:expr:`PyObject*` parameter " +"which is a tuple representing the names of the keyword arguments (which are " +"guaranteed to be strings) or possibly ``NULL`` if there are no keywords. " +"The values of the keyword arguments are stored in the *args* array, after " +"the positional arguments." +msgstr "" +"توسعه‌ای از :c:macro:`METH_FASTCALL` که از آرگومان‌های کلیدواژه‌ای نیز " +"پشتیبانی می‌کند، با متدهایی از نوع :c:type:`PyCFunctionFastWithKeywords`. " +"آرگومان‌های کلیدواژه‌ای به همان شیوه‌ی :ref:`پروتکل vectorcall `" +" منتقل می‌شوند: یک پارامتر چهارم اضافی از نوع :c:expr:`PyObject*` وجود دارد " +"که یک تاپل است و نام‌های آرگومان‌های کلیدواژه‌ای را نشان می‌دهد (که تضمین " +"می‌شود رشته باشند) یا در صورت نبود کلیدواژه‌ها ممکن است ``NULL`` باشد. " +"مقادیر آرگومان‌های کلیدواژه‌ای در آرایه‌ی *args*، پس از آرگومان‌های جایگاهی،" +" ذخیره می‌شوند." -msgid "Can only be used in the combination with other flags: :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." +msgid "" +"Can only be used in the combination with other flags: :ref:`METH_METHOD | " +"METH_FASTCALL | METH_KEYWORDS `." msgstr "" +"تنها می‌تواند در ترکیب با سایر پرچم‌ها استفاده شود: :ref:`METH_METHOD | " +"METH_FASTCALL | METH_KEYWORDS `." msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" -msgid "Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that contains the method in question. The defining class might be a superclass of ``Py_TYPE(self)``." +msgid "" +"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " +"contains the method in question. The defining class might be a superclass of" +" ``Py_TYPE(self)``." msgstr "" +"توسعه‌ای از :ref:`METH_FASTCALL | METH_KEYWORDS ` است که از *کلاس تعریف‌کننده* پشتیبانی می‌کند؛ یعنی کلاسی که " +"متد مورد نظر در آن قرار دارد. کلاس تعریف‌کننده ممکن است ابرکلاس " +"``Py_TYPE(self)`` باشد." -msgid "The method needs to be of type :c:type:`PyCMethod`, the same as for ``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added after ``self``." +msgid "" +"The method needs to be of type :c:type:`PyCMethod`, the same as for " +"``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " +"after ``self``." msgstr "" +"متد باید از نوع :c:type:`PyCMethod` باشد، همان‌طور که برای ``METH_FASTCALL |" +" METH_KEYWORDS`` است، با آرگومان ``defining_class`` که پس از ``self`` اضافه " +"می‌شود." -msgid "Methods without parameters don't need to check whether arguments are given if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of type :c:type:`PyCFunction`. The first parameter is typically named *self* and will hold a reference to the module or object instance. In all cases the second parameter will be ``NULL``." -msgstr "" +msgid "" +"Methods without parameters don't need to check whether arguments are given " +"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of" +" type :c:type:`PyCFunction`. The first parameter is typically named *self* " +"and will hold a reference to the module or object instance. In all cases " +"the second parameter will be ``NULL``." +msgstr "" +"متدهای بدون پارامتر، در صورتی که با پرچم :c:macro:`METH_NOARGS` فهرست شده " +"باشند، لازم نیست بررسی کنند که آیا آرگومانی داده شده است یا خیر. آن‌ها باید " +"از نوع :c:type:`PyCFunction` باشند. پارامتر اول معمولاً *self* نام دارد و " +"ارجاعی به ماژول یا نمونه‌ی شیء را نگه می‌دارد. در همه‌ی موارد، پارامتر دوم " +"``NULL`` خواهد بود." -msgid "The function must have 2 parameters. Since the second parameter is unused, :c:macro:`Py_UNUSED` can be used to prevent a compiler warning." +msgid "" +"The function must have 2 parameters. Since the second parameter is unused, " +":c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" +"تابع باید ۲ پارامتر داشته باشد. از آنجا که پارامتر دوم استفاده نمی‌شود، " +"می‌توان از :c:macro:`Py_UNUSED` برای جلوگیری از هشدار کامپایلر استفاده کرد." -msgid "Methods with a single object argument can be listed with the :c:macro:`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the *self* parameter, and a :c:expr:`PyObject*` parameter representing the single argument." +msgid "" +"Methods with a single object argument can be listed with the " +":c:macro:`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with " +"a ``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " +"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " +"single argument." msgstr "" +"می‌توان متدهایی که تنها یک آرگومان شیء دارند، با پرچم :c:macro:`METH_O` " +"فهرست کرد، به‌جای فراخوانی :c:func:`PyArg_ParseTuple` با آرگومان ``\"O\"``. " +"این متدها از نوع :c:type:`PyCFunction` هستند و پارامتر *self* و پارامتری از " +"نوع :c:expr:`PyObject*` دارند که نمایانگر تنها آرگومان است." -msgid "These two constants are not used to indicate the calling convention but the binding when used with methods of classes. These may not be used for functions defined for modules. At most one of these flags may be set for any given method." +msgid "" +"These two constants are not used to indicate the calling convention but the " +"binding when used with methods of classes. These may not be used for " +"functions defined for modules. At most one of these flags may be set for " +"any given method." msgstr "" +"این دو ثابت هنگامی که با متدهای کلاس‌ها استفاده می‌شوند، برای نشان دادن " +"قرارداد فراخوانی (calling convention) به کار نمی‌روند، بلکه مقید‌سازی " +"(binding) را نشان می‌دهند. از این ثابت‌ها نمی‌توان برای توابع تعریف‌شده برای" +" ماژول‌ها استفاده کرد. برای هر متد معین، حداکثر یکی از این پرچم‌ها می‌تواند " +"تنظیم شود." -msgid "The method will be passed the type object as the first parameter rather than an instance of the type. This is used to create *class methods*, similar to what is created when using the :deco:`classmethod` built-in decorator." +msgid "" +"The method will be passed the type object as the first parameter rather than" +" an instance of the type. This is used to create *class methods*, similar " +"to what is created when using the :deco:`classmethod` built-in decorator." msgstr "" +"به این متد، به جای نمونه‌ای از نوع، شیء نوع به عنوان اولین پارامتر پاس داده " +"خواهد شد. از این برای ایجاد *متدهای کلاس* استفاده می‌شود، مشابه آنچه هنگام " +"استفاده از دکوراتور توکار :deco:`classmethod` ایجاد می‌شود." -msgid "The method will be passed ``NULL`` as the first parameter rather than an instance of the type. This is used to create *static methods*, similar to what is created when using the :deco:`staticmethod` built-in decorator." +msgid "" +"The method will be passed ``NULL`` as the first parameter rather than an " +"instance of the type. This is used to create *static methods*, similar to " +"what is created when using the :deco:`staticmethod` built-in decorator." msgstr "" +"به این متد، ``NULL`` به‌عنوان پارامتر اول ارسال می‌شود، نه نمونه‌ای از آن " +"نوع. این برای ایجاد *متدهای ایستا* استفاده می‌شود، مشابه آنچه هنگام استفاده " +"از دکوراتور توکار :deco:`staticmethod` ایجاد می‌شود." -msgid "One other constant controls whether a method is loaded in place of another definition with the same method name." +msgid "" +"One other constant controls whether a method is loaded in place of another " +"definition with the same method name." msgstr "" +"یک ثابت دیگر کنترل می‌کند که آیا یک متد به‌جای تعریف دیگری با همان نام متد " +"بارگذاری شود یا خیر." -msgid "The method will be loaded in place of existing definitions. Without *METH_COEXIST*, the default is to skip repeated definitions. Since slot wrappers are loaded before the method table, the existence of a *sq_contains* slot, for example, would generate a wrapped method named :meth:`~object.__contains__` and preclude the loading of a corresponding PyCFunction with the same name. With the flag defined, the PyCFunction will be loaded in place of the wrapper object and will co-exist with the slot. This is helpful because calls to PyCFunctions are optimized more than wrapper object calls." -msgstr "" +msgid "" +"The method will be loaded in place of existing definitions. Without " +"*METH_COEXIST*, the default is to skip repeated definitions. Since slot " +"wrappers are loaded before the method table, the existence of a " +"*sq_contains* slot, for example, would generate a wrapped method named " +":meth:`~object.__contains__` and preclude the loading of a corresponding " +"PyCFunction with the same name. With the flag defined, the PyCFunction will" +" be loaded in place of the wrapper object and will co-exist with the slot. " +"This is helpful because calls to PyCFunctions are optimized more than " +"wrapper object calls." +msgstr "" +"این متد به جای تعریف‌های موجود بارگذاری خواهد شد. بدون *METH_COEXIST*، حالت " +"پیش‌فرض، صرف‌نظر کردن از تعریف‌های تکراری است. از آنجا که پوشش‌های جایگاه " +"(slot wrapper) پیش از جدول متد بارگذاری می‌شوند، مثلاً وجود یک جایگاه " +"*sq_contains* متدی پوششی به نام :meth:`~object.__contains__` تولید می‌کند و " +"مانع از بارگذاری یک PyCFunction متناظر با همان نام می‌شود. با تعریف این " +"پرچم، PyCFunction به جای شیء پوششی بارگذاری خواهد شد و در کنار جایگاه " +"هم‌زیستی خواهد کرد. این مفید است زیرا فراخوانی‌های PyCFunction نسبت به " +"فراخوانی‌های شیء پوششی بهینه‌سازی بیشتری دارند." -msgid "The type object corresponding to Python C method objects. This is available as :class:`types.BuiltinMethodType` in the Python layer." +msgid "" +"The type object corresponding to Python C method objects. This is available " +"as :class:`types.BuiltinMethodType` in the Python layer." msgstr "" +"شیء نوع متناظر با اشیاء متد C در پایتون. این به‌صورت " +":class:`types.BuiltinMethodType` در لایه پایتون در دسترس است." -msgid "Return true if *op* is an instance of the :c:type:`PyCMethod_Type` type or a subtype of it. This function always succeeds." +msgid "" +"Return true if *op* is an instance of the :c:type:`PyCMethod_Type` type or a" +" subtype of it. This function always succeeds." msgstr "" +"اگر *op* نمونه‌ای از نوع :c:type:`PyCMethod_Type` یا زیرنوعی از آن باشد، " +"مقدار true را برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "This is the same as :c:func:`PyCMethod_Check`, but does not account for subtypes." +msgid "" +"This is the same as :c:func:`PyCMethod_Check`, but does not account for " +"subtypes." msgstr "" +"این همان :c:func:`PyCMethod_Check` است، اما زیرنوع‌ها را در نظر نمی‌گیرد." -msgid "Turn *ml* into a Python :term:`callable` object. The caller must ensure that *ml* outlives the :term:`callable`. Typically, *ml* is defined as a static variable." +msgid "" +"Turn *ml* into a Python :term:`callable` object. The caller must ensure that" +" *ml* outlives the :term:`callable`. Typically, *ml* is defined as a static " +"variable." msgstr "" +"*ml* را به یک شیء :term:`callable` پایتون تبدیل می‌کند. فراخواننده باید " +"اطمینان حاصل کند که *ml* بیشتر از :term:`callable` زنده می‌ماند. معمولاً " +"*ml* به‌صورت یک متغیر ایستا تعریف می‌شود." -msgid "The *self* parameter will be passed as the *self* argument to the C function in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." +msgid "" +"The *self* parameter will be passed as the *self* argument to the C function" +" in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." msgstr "" +"پارامتر *self* هنگام فراخوانی، به عنوان آرگومان *self* به تابع C در " +"``ml->ml_meth`` منتقل می‌شود. *self* می‌تواند ``NULL`` باشد." -msgid "The :term:`callable` object's ``__module__`` attribute can be set from the given *module* argument. *module* should be a Python string, which will be used as name of the module the function is defined in. If unavailable, it can be set to :const:`None` or ``NULL``." +msgid "" +"The :term:`callable` object's ``__module__`` attribute can be set from the " +"given *module* argument. *module* should be a Python string, which will be " +"used as name of the module the function is defined in. If unavailable, it " +"can be set to :const:`None` or ``NULL``." msgstr "" +"ویژگی ``__module__`` شیء :term:`فراخوانی‌پذیر ` را می‌توان از " +"آرگومان *module* داده‌شده تنظیم کرد. *module* باید یک رشته پایتونی باشد که " +"به‌عنوان نام ماژولی که تابع در آن تعریف شده است استفاده می‌شود. اگر در دسترس" +" نباشد، می‌توان آن را روی :const:`None` یا ``NULL`` تنظیم کرد." msgid ":attr:`function.__module__`" -msgstr "" +msgstr ":attr:`function.__module__`" -msgid "The *cls* parameter will be passed as the *defining_class* argument to the C function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." +msgid "" +"The *cls* parameter will be passed as the *defining_class* argument to the C" +" function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." msgstr "" +"پارامتر *cls* به‌عنوان آرگومان *defining_class* به تابع C ارسال می‌شود. اگر " +":c:macro:`METH_METHOD` روی ``ml->ml_flags`` تنظیم شده باشد، باید مقداردهی " +"شود." -msgid "The type object corresponding to Python C function objects. This is available as :class:`types.BuiltinFunctionType` in the Python layer." +msgid "" +"The type object corresponding to Python C function objects. This is " +"available as :class:`types.BuiltinFunctionType` in the Python layer." msgstr "" +"شیء نوع متناظر با شیءهای تابع C پایتون. این شیء در لایه پایتون به‌صورت " +":class:`types.BuiltinFunctionType` در دسترس است." -msgid "Return true if *op* is an instance of the :c:type:`PyCFunction_Type` type or a subtype of it. This function always succeeds." +msgid "" +"Return true if *op* is an instance of the :c:type:`PyCFunction_Type` type or" +" a subtype of it. This function always succeeds." msgstr "" +"اگر *op* نمونه‌ای از نوع :c:type:`PyCFunction_Type` یا زیرنوعی از آن باشد، " +"مقدار درست را برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "This is the same as :c:func:`PyCFunction_Check`, but does not account for subtypes." +msgid "" +"This is the same as :c:func:`PyCFunction_Check`, but does not account for " +"subtypes." msgstr "" +"این همان :c:func:`PyCFunction_Check` است، اما زیرنوع‌ها را در نظر نمی‌گیرد." msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." -msgstr "" +msgstr "معادل ``PyCMethod_New(ml, self, module, NULL)`` است." msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." -msgstr "" +msgstr "معادل ``PyCMethod_New(ml, self, NULL, NULL)`` است." -msgid "Get the function's flags on *func* as they were passed to :c:member:`~PyMethodDef.ml_flags`." +msgid "" +"Get the function's flags on *func* as they were passed to " +":c:member:`~PyMethodDef.ml_flags`." msgstr "" +"پرچم‌های تابع روی *func* را، همان‌طور که به " +":c:member:`~PyMethodDef.ml_flags` پاس داده‌شده‌اند، دریافت می‌کند." -msgid "If *func* is not a C function object, this fails with an exception. *func* must not be ``NULL``." +msgid "" +"If *func* is not a C function object, this fails with an exception. *func* " +"must not be ``NULL``." msgstr "" +"اگر *func* یک شیء تابع C نباشد، این کار با یک استثنا شکست می‌خورد. *func* " +"نباید ``NULL`` باشد." -msgid "This function returns the function's flags on success, and ``-1`` with an exception set on failure." +msgid "" +"This function returns the function's flags on success, and ``-1`` with an " +"exception set on failure." msgstr "" +"این تابع در صورت موفقیت، پرچم‌های تابع را برمی‌گرداند و در صورت شکست، ``-1``" +" به همراه یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "This is the same as :c:func:`PyCFunction_GetFlags`, but without error or type checking." +msgid "" +"This is the same as :c:func:`PyCFunction_GetFlags`, but without error or " +"type checking." msgstr "" +"این همان :c:func:`PyCFunction_GetFlags` است، اما بدون بررسی خطا یا بررسی " +"نوع." -msgid "Get the function pointer on *func* as it was passed to :c:member:`~PyMethodDef.ml_meth`." +msgid "" +"Get the function pointer on *func* as it was passed to " +":c:member:`~PyMethodDef.ml_meth`." msgstr "" +"گرفتن اشاره‌گر تابع روی *func*، همان‌طور که به " +":c:member:`~PyMethodDef.ml_meth` پاس داده شده است." -msgid "This function returns the function pointer on success, and ``NULL`` with an exception set on failure." +msgid "" +"This function returns the function pointer on success, and ``NULL`` with an " +"exception set on failure." msgstr "" +"این تابع در صورت موفقیت، اشاره‌گر تابع را برمی‌گرداند و در صورت شکست، " +"``NULL`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "This is the same as :c:func:`PyCFunction_GetFunction`, but without error or type checking." +msgid "" +"This is the same as :c:func:`PyCFunction_GetFunction`, but without error or " +"type checking." msgstr "" +"این همان :c:func:`PyCFunction_GetFunction` است، اما بدون بررسی خطا یا بررسی " +"نوع." -msgid "Get the \"self\" object on *func*. This is the object that would be passed to the first argument of a :c:type:`PyCFunction`. For C function objects created through a :c:type:`PyMethodDef` on a :c:type:`PyModuleDef`, this is the resulting module object." +msgid "" +"Get the \"self\" object on *func*. This is the object that would be passed " +"to the first argument of a :c:type:`PyCFunction`. For C function objects " +"created through a :c:type:`PyMethodDef` on a :c:type:`PyModuleDef`, this is " +"the resulting module object." msgstr "" +"گرفتن شیء \"self\" روی *func*. این همان شیئی است که به آرگومان اول یک " +":c:type:`PyCFunction` پاس داده می‌شود. برای اشیاء تابع C که از طریق یک " +":c:type:`PyMethodDef` روی یک :c:type:`PyModuleDef` ایجاد شده‌اند، این همان " +"شیء ماژول حاصل است." -msgid "This function returns a :term:`borrowed reference` to the \"self\" object on success, and ``NULL`` with an exception set on failure." +msgid "" +"This function returns a :term:`borrowed reference` to the \"self\" object on" +" success, and ``NULL`` with an exception set on failure." msgstr "" +"این تابع در صورت موفقیت، یک :term:`ارجاع امانتی ` به شیء" +" \"self\" برمی‌گرداند و در صورت شکست، ``NULL`` را همراه با استثنای تنظیم‌شده" +" برمی‌گرداند." -msgid "This is the same as :c:func:`PyCFunction_GetSelf`, but without error or type checking." -msgstr "" +msgid "" +"This is the same as :c:func:`PyCFunction_GetSelf`, but without error or type" +" checking." +msgstr "این همان :c:func:`PyCFunction_GetSelf` است، اما بدون بررسی خطا و نوع." msgid "Accessing attributes of extension types" -msgstr "" +msgstr "دسترسی به ویژگی‌های نوع‌های توسعه‌ای" -msgid "Structure which describes an attribute of a type which corresponds to a C struct member. When defining a class, put a NULL-terminated array of these structures in the :c:member:`~PyTypeObject.tp_members` slot." +msgid "" +"Structure which describes an attribute of a type which corresponds to a C " +"struct member. When defining a class, put a NULL-terminated array of these " +"structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" +"ساختاری که ویژگی‌ای از یک نوع را توصیف می‌کند که متناظر با عضوی از ساختار C " +"است. هنگام تعریف یک کلاس، آرایه‌ای خاتمه‌یافته با NULL از این ساختارها را در" +" جایگاه :c:member:`~PyTypeObject.tp_members` قرار دهید." msgid "Its fields are, in order:" -msgstr "" +msgstr "فیلدهای آن به ترتیب عبارت‌اند از:" -msgid "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." -msgstr "" +msgid "" +"Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." +msgstr "نام عضو. مقدار NULL پایان یک آرایه ``PyMemberDef[]`` را مشخص می‌کند." msgid "The string should be static, no copy is made of it." -msgstr "" +msgstr "رشته باید ایستا باشد، هیچ کپی‌ای از آن ساخته نمی‌شود." -msgid "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the possible values." +msgid "" +"The type of the member in the C struct. See :ref:`PyMemberDef-types` for the" +" possible values." msgstr "" +"نوع عضو در ساختار C. برای مقادیر ممکن، :ref:`PyMemberDef-types` را ببینید." -msgid "The offset in bytes that the member is located on the type’s object struct." -msgstr "" +msgid "" +"The offset in bytes that the member is located on the type’s object struct." +msgstr "آفست بر حسب بایتی که عضو در ساختار شیء نوع در آن قرار دارد." -msgid "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." +msgid "" +"Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" +"صفر یا بیشتر از :ref:`PyMemberDef-flags`، که با استفاده از OR بیتی ترکیب " +"شده‌اند." -msgid "The docstring, or NULL. The string should be static, no copy is made of it. Typically, it is defined using :c:macro:`PyDoc_STR`." +msgid "" +"The docstring, or NULL. The string should be static, no copy is made of it. " +"Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" +"رشته مستند، یا NULL. این رشته باید ایستا باشد؛ هیچ کپی‌ای از آن تهیه " +"نمی‌شود. معمولاً این رشته با استفاده از :c:macro:`PyDoc_STR` تعریف می‌شود." -msgid "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow both read and write access. Use the :c:macro:`Py_READONLY` flag for read-only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:`T_OBJECT`) members can be deleted." -msgstr "" +msgid "" +"By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " +"both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" +"only access. Certain types, like :c:macro:`Py_T_STRING`, imply " +":c:macro:`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy " +":c:macro:`T_OBJECT`) members can be deleted." +msgstr "" +"به‌طور پیش‌فرض (زمانی که :c:member:`~PyMemberDef.flags` برابر ``0`` باشد)، " +"اعضا هم اجازه‌ی خواندن و هم اجازه‌ی نوشتن را می‌دهند. برای دسترسی " +"فقط‌خواندنی از پرچم :c:macro:`Py_READONLY` استفاده کنید. برخی نوع‌ها، مانند " +":c:macro:`Py_T_STRING`، مستلزم :c:macro:`Py_READONLY` هستند. فقط اعضای " +":c:macro:`Py_T_OBJECT_EX` (و :c:macro:`T_OBJECT` قدیمی) قابل حذف هستند." -msgid "For heap-allocated types (created using :c:func:`PyType_FromSpec` or similar), ``PyMemberDef`` may contain a definition for the special member ``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects. This member must be defined with ``Py_T_PYSSIZET``, and either ``Py_READONLY`` or ``Py_READONLY | Py_RELATIVE_OFFSET``. For example::" -msgstr "" +msgid "" +"For heap-allocated types (created using :c:func:`PyType_FromSpec` or " +"similar), ``PyMemberDef`` may contain a definition for the special member " +"``\"__vectorcalloffset__\"``, corresponding to " +":c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects. This member " +"must be defined with ``Py_T_PYSSIZET``, and either ``Py_READONLY`` or " +"``Py_READONLY | Py_RELATIVE_OFFSET``. For example::" +msgstr "" +"برای نوع‌های تخصیص‌یافته در هیپ (که با استفاده از :c:func:`PyType_FromSpec` " +"یا مشابه آن ایجاد می‌شوند)، ``PyMemberDef`` می‌تواند تعریفی برای عضو ویژه‌ی " +"``\"__vectorcalloffset__\"`` داشته باشد که متناظر با " +":c:member:`~PyTypeObject.tp_vectorcall_offset` در شیءهای نوع است. این عضو " +"باید با ``Py_T_PYSSIZET`` و یکی از ``Py_READONLY`` یا ``Py_READONLY | " +"Py_RELATIVE_OFFSET`` تعریف شود. برای مثال::" msgid "" "static PyMemberDef spam_type_members[] = {\n" @@ -397,273 +892,425 @@ msgid "" " {NULL} /* Sentinel */\n" "};" msgstr "" +"static PyMemberDef spam_type_members[] = {\n" +" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n" +" offsetof(Spam_object, vectorcall), Py_READONLY},\n" +" {NULL} /* Sentinel */\n" +"};" msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" +"(ممکن است برای :c:func:`!offsetof` به ``#include `` نیاز داشته " +"باشید.)" -msgid "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:`~PyTypeObject.tp_weaklistoffset` can be defined similarly using ``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." -msgstr "" +msgid "" +"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and " +":c:member:`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " +"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " +"extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT`" +" and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." +msgstr "" +"آفست‌های قدیمی :c:member:`~PyTypeObject.tp_dictoffset` و " +":c:member:`~PyTypeObject.tp_weaklistoffset` را می‌توان به‌طور مشابه با " +"استفاده از اعضای ``\"__dictoffset__\"`` و ``\"__weaklistoffset__\"`` تعریف " +"کرد، اما به ماژول‌های توسعه‌ای به‌شدت توصیه می‌شود که به‌جای آن‌ها از " +":c:macro:`Py_TPFLAGS_MANAGED_DICT` و :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " +"استفاده کنند." -msgid "``PyMemberDef`` is always available. Previously, it required including ``\"structmember.h\"``." +msgid "" +"``PyMemberDef`` is always available. Previously, it required including " +"``\"structmember.h\"``." msgstr "" +"``PyMemberDef`` همیشه در دسترس است. پیش از این، نیازمند درج " +"``\"structmember.h\"`` بود." -msgid ":c:macro:`Py_RELATIVE_OFFSET` is now allowed for ``\"__vectorcalloffset__\"``, ``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"``." +msgid "" +":c:macro:`Py_RELATIVE_OFFSET` is now allowed for " +"``\"__vectorcalloffset__\"``, ``\"__dictoffset__\"`` and " +"``\"__weaklistoffset__\"``." msgstr "" +":c:macro:`Py_RELATIVE_OFFSET` اکنون برای ``\"__vectorcalloffset__\"``، " +"``\"__dictoffset__\"`` و ``\"__weaklistoffset__\"`` مجاز است." -msgid "Get an attribute belonging to the object at address *obj_addr*. The attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." +msgid "" +"Get an attribute belonging to the object at address *obj_addr*. The " +"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" +"یک ویژگی متعلق به شیء موجود در نشانی *obj_addr* را بازیابی می‌کند. این ویژگی" +" توسط ``PyMemberDef`` *m* توصیف می‌شود. در صورت خطا ``NULL`` را برمی‌گرداند." -msgid "``PyMember_GetOne`` is always available. Previously, it required including ``\"structmember.h\"``." +msgid "" +"``PyMember_GetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." msgstr "" +"``PyMember_GetOne`` همیشه دسترس‌پذیر است. پیش‌تر، نیازمند گنجاندن " +"``\"structmember.h\"`` بود." -msgid "Set an attribute belonging to the object at address *obj_addr* to object *o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns ``0`` if successful and a negative value on failure." +msgid "" +"Set an attribute belonging to the object at address *obj_addr* to object " +"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " +"``0`` if successful and a negative value on failure." msgstr "" +"یک ویژگی متعلق به شیءِ واقع در نشانی *obj_addr* را برابر شیء *o* قرار " +"می‌دهد. ویژگیِ تنظیم‌شونده توسط ``PyMemberDef`` *m* توصیف می‌شود. در صورت " +"موفقیت ``0`` و در صورت شکست مقدار منفی برمی‌گرداند." -msgid "``PyMember_SetOne`` is always available. Previously, it required including ``\"structmember.h\"``." +msgid "" +"``PyMember_SetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." msgstr "" +"``PyMember_SetOne`` همیشه در دسترس است. پیش‌تر، نیازمند گنجاندن " +"``\"structmember.h\"`` بود." msgid "Member flags" -msgstr "" +msgstr "پرچم‌های عضو" msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" -msgstr "" +msgstr "از پرچم‌های زیر می‌توان با :c:member:`PyMemberDef.flags` استفاده کرد:" msgid "Not writable." -msgstr "" +msgstr "قابل نوشتن نیست." -msgid "Emit an ``object.__getattr__`` :ref:`audit event ` before reading." +msgid "" +"Emit an ``object.__getattr__`` :ref:`audit event ` before " +"reading." msgstr "" +"پیش از خواندن، یک :ref:`رویداد حسابرسی ` " +"``object.__getattr__`` منتشر می‌کند." -msgid "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` entry indicates an offset from the subclass-specific data, rather than from ``PyObject``." +msgid "" +"Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " +"entry indicates an offset from the subclass-specific data, rather than from " +"``PyObject``." msgstr "" +"نشان می‌دهد که :c:member:`~PyMemberDef.offset` این ورودی ``PyMemberDef`` " +"آفستی از داده‌های خاص زیرکلاس را مشخص می‌کند، نه از ``PyObject``." -msgid "Can only be used as part of the :c:data:`Py_tp_members` :c:type:`slot ` when creating a class using negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case. When setting :c:member:`~PyTypeObject.tp_members` from the slot during class creation, Python clears the flag and sets :c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." -msgstr "" +msgid "" +"Can only be used as part of the :c:data:`Py_tp_members` :c:type:`slot " +"` when creating a class using negative " +":c:member:`~PyType_Spec.basicsize`. It is mandatory in that case. When " +"setting :c:member:`~PyTypeObject.tp_members` from the slot during class " +"creation, Python clears the flag and sets :c:member:`PyMemberDef.offset` to " +"the offset from the ``PyObject`` struct." +msgstr "" +"هنگام ایجاد کلاس با استفاده از :c:member:`~PyType_Spec.basicsize` منفی، تنها" +" می‌تواند به‌عنوان بخشی از :c:type:`جایگاه ` " +":c:data:`Py_tp_members` استفاده شود. استفاده از آن در چنین حالتی الزامی است." +" هنگام تنظیم :c:member:`~PyTypeObject.tp_members` از جایگاه در طول ایجاد " +"کلاس، پایتون پرچم را پاک می‌کند و :c:member:`PyMemberDef.offset` را برابر با" +" آفست نسبت به ساختار ``PyObject`` قرار می‌دهد." -msgid "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are deprecated. :c:macro:`!READ_RESTRICTED` and :c:macro:`!RESTRICTED` are equivalent to :c:macro:`Py_AUDIT_READ`; :c:macro:`!WRITE_RESTRICTED` does nothing." -msgstr "" +msgid "" +"The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and " +":c:macro:`!WRITE_RESTRICTED` macros available with ``#include " +"\"structmember.h\"`` are deprecated. :c:macro:`!READ_RESTRICTED` and " +":c:macro:`!RESTRICTED` are equivalent to :c:macro:`Py_AUDIT_READ`; " +":c:macro:`!WRITE_RESTRICTED` does nothing." +msgstr "" +"ماکروهای :c:macro:`!RESTRICTED`، :c:macro:`!READ_RESTRICTED` و " +":c:macro:`!WRITE_RESTRICTED` که با ``#include \"structmember.h\"`` در دسترس " +"هستند، منسوخ شده‌اند. :c:macro:`!READ_RESTRICTED` و :c:macro:`!RESTRICTED` " +"معادل :c:macro:`Py_AUDIT_READ` هستند؛ :c:macro:`!WRITE_RESTRICTED` هیچ کاری " +"انجام نمی‌دهد." -msgid "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new names are now always available. Previously, these required ``#include \"structmember.h\"``. The header is still available and it provides the old names." -msgstr "" +msgid "" +"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The " +":c:macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new" +" names are now always available. Previously, these required ``#include " +"\"structmember.h\"``. The header is still available and it provides the old " +"names." +msgstr "" +"ماکروی :c:macro:`!READONLY` به :c:macro:`Py_READONLY` تغییر نام یافت. ماکروی" +" :c:macro:`!PY_AUDIT_READ` با پیشوند ``Py_`` تغییر نام یافت. نام‌های جدید " +"اکنون همیشه در دسترس هستند. پیش‌تر، این موارد نیازمند ``#include " +"\"structmember.h\"`` بودند. سرآیند هنوز در دسترس است و نام‌های قدیمی را " +"فراهم می‌کند." msgid "Member types" -msgstr "" +msgstr "نوع‌های عضو" -msgid ":c:member:`PyMemberDef.type` can be one of the following macros corresponding to various C types. When the member is accessed in Python, it will be converted to the equivalent Python type. When it is set from Python, it will be converted back to the C type. If that is not possible, an exception such as :exc:`TypeError` or :exc:`ValueError` is raised." -msgstr "" +msgid "" +":c:member:`PyMemberDef.type` can be one of the following macros " +"corresponding to various C types. When the member is accessed in Python, it " +"will be converted to the equivalent Python type. When it is set from Python," +" it will be converted back to the C type. If that is not possible, an " +"exception such as :exc:`TypeError` or :exc:`ValueError` is raised." +msgstr "" +":c:member:`PyMemberDef.type` می‌تواند یکی از ماکروهای زیر باشد که متناظر با " +"نوع‌های مختلف C هستند. هنگامی که در پایتون به این عضو دسترسی پیدا شود، به " +"نوع معادل پایتونی تبدیل می‌شود. هنگامی که از پایتون مقداردهی شود، دوباره به " +"نوع C تبدیل می‌شود. اگر این کار ممکن نباشد، استثنایی مانند :exc:`TypeError` " +"یا :exc:`ValueError` ایجاد می‌شود." -msgid "Unless marked (D), attributes defined this way cannot be deleted using e.g. :keyword:`del` or :py:func:`delattr`." +msgid "" +"Unless marked (D), attributes defined this way cannot be deleted using e.g. " +":keyword:`del` or :py:func:`delattr`." msgstr "" +"ویژگی‌های تعریف‌شده به این روش را نمی‌توان با استفاده از مثلاً " +":keyword:`del` یا :py:func:`delattr` حذف کرد، مگر آنکه با (D) علامت‌گذاری " +"شده باشند." msgid "Macro name" -msgstr "" +msgstr "نام ماکرو" msgid "C type" -msgstr "" +msgstr "نوع C" msgid "Python type" -msgstr "" +msgstr "نوع پایتون" msgid ":c:expr:`char`" -msgstr "" +msgstr ":c:expr:`char`" msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" msgid ":c:expr:`short`" -msgstr "" +msgstr ":c:expr:`short`" msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" msgid ":c:expr:`long`" -msgstr "" +msgstr ":c:expr:`long`" msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" msgid ":c:expr:`unsigned char`" -msgstr "" +msgstr ":c:expr:`unsigned char`" msgid ":c:expr:`unsigned int`" -msgstr "" +msgstr ":c:expr:`unsigned int`" msgid ":c:expr:`unsigned short`" -msgstr "" +msgstr ":c:expr:`unsigned short`" msgid ":c:expr:`unsigned long`" -msgstr "" +msgstr ":c:expr:`unsigned long`" msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" msgid ":c:expr:`Py_ssize_t`" -msgstr "" +msgstr ":c:expr:`Py_ssize_t`" msgid ":c:expr:`float`" -msgstr "" +msgstr ":c:expr:`float`" msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" msgid ":c:expr:`double`" -msgstr "" +msgstr ":c:expr:`double`" msgid ":c:expr:`char` (written as 0 or 1)" -msgstr "" +msgstr ":c:expr:`char` (به‌صورت ۰ یا ۱ نوشته می‌شود)" msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" msgid ":c:expr:`const char *` (*)" -msgstr "" +msgstr ":c:expr:`const char *` (*)" msgid ":py:class:`str` (RO)" -msgstr "" +msgstr ":py:class:`str` (RO)" msgid ":c:expr:`const char[]` (*)" -msgstr "" +msgstr ":c:expr:`const char[]` (*)" msgid ":c:expr:`char` (0-127)" -msgstr "" +msgstr ":c:expr:`char` (0-127)" msgid ":py:class:`str` (**)" -msgstr "" +msgstr ":py:class:`str` (**)" msgid ":c:expr:`PyObject *`" -msgstr "" +msgstr ":c:expr:`PyObject *`" msgid ":py:class:`object` (D)" -msgstr "" +msgstr ":py:class:`object` (D)" -msgid "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the string is stored directly in the structure." +msgid "" +"(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " +"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " +"string is stored directly in the structure." msgstr "" +"(*): رشته‌ی C پایان‌یافته با صفر و کدگذاری‌شده با UTF8. با " +":c:macro:`!Py_T_STRING` نمایش C یک اشاره‌گر است؛ با " +":c:macro:`!Py_T_STRING_INPLACE` رشته مستقیماً در ساختار ذخیره می‌شود." msgid "(**): String of length 1. Only ASCII is accepted." -msgstr "" +msgstr "(**): رشته‌ای به طول ۱. فقط اسکی پذیرفته می‌شود." msgid "(RO): Implies :c:macro:`Py_READONLY`." -msgstr "" +msgstr "(RO): مستلزم :c:macro:`Py_READONLY` است." -msgid "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a ``NULL`` pointer raises :py:exc:`AttributeError`." +msgid "" +"(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a" +" ``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" +"(D): قابل حذف است؛ در این صورت اشاره‌گر به ``NULL`` تنظیم می‌شود. خواندن " +"اشاره‌گر ``NULL`` استثنای :py:exc:`AttributeError` را ایجاد می‌کند." -msgid "In previous versions, the macros were only available with ``#include \"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as ``T_INT``). The header is still available and contains the old names, along with the following deprecated types:" +msgid "" +"In previous versions, the macros were only available with ``#include " +"\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " +"``T_INT``). The header is still available and contains the old names, along " +"with the following deprecated types:" msgstr "" +"در نسخه‌های پیشین، ماکروها تنها با ``#include \"structmember.h\"`` در دسترس " +"بودند و بدون پیشوند ``Py_`` نام‌گذاری می‌شدند (مثلاً به‌صورت ``T_INT``). این" +" سرآیند همچنان در دسترس است و شامل نام‌های قدیمی، به‌همراه نوع‌های منسوخ زیر" +" است:" -msgid "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results in surprising behavior in Python: deleting the attribute effectively sets it to ``None``." +msgid "" +"Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results" +" in surprising behavior in Python: deleting the attribute effectively sets " +"it to ``None``." msgstr "" +"مانند ``Py_T_OBJECT_EX`` است، اما ``NULL`` به ``None`` تبدیل می‌شود. این امر" +" در پایتون به رفتاری غافلگیرکننده منجر می‌شود: حذف ویژگی عملاً آن را به " +"``None`` تنظیم می‌کند." msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." -msgstr "" +msgstr "همیشه ``None`` است. باید همراه با :c:macro:`Py_READONLY` استفاده شود." msgid "Defining Getters and Setters" -msgstr "" +msgstr "تعریف گترها (getter) و ستترها (setter)" -msgid "Structure to define property-like access for a type. See also description of the :c:member:`PyTypeObject.tp_getset` slot." +msgid "" +"Structure to define property-like access for a type. See also description of" +" the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" +"ساختاری برای تعریف دسترسی شبیه به پراپرتی برای یک نوع. همچنین توضیحات جایگاه" +" :c:member:`PyTypeObject.tp_getset` را ببینید." msgid "attribute name" -msgstr "" +msgstr "نام ویژگی" msgid "C function to get the attribute." -msgstr "" +msgstr "تابع C برای دریافت ویژگی." -msgid "Optional C function to set or delete the attribute. If ``NULL``, the attribute is read-only." +msgid "" +"Optional C function to set or delete the attribute. If ``NULL``, the " +"attribute is read-only." msgstr "" +"تابع C اختیاری برای تنظیم یا حذف ویژگی. اگر ``NULL`` باشد، ویژگی فقط‌خواندنی" +" است." msgid "optional docstring" -msgstr "" +msgstr "رشته مستند اختیاری" -msgid "Optional user data pointer, providing additional data for getter and setter." +msgid "" +"Optional user data pointer, providing additional data for getter and setter." msgstr "" +"اشاره‌گر اختیاری داده‌های کاربر، که داده‌های اضافی را برای گیرنده (getter) و" +" تنظیم‌کننده (setter) فراهم می‌کند." -msgid "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) and a user data pointer (the associated ``closure``):" +msgid "" +"The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " +"and a user data pointer (the associated ``closure``):" msgstr "" +"تابع ``get`` یک پارامتر :c:expr:`PyObject*` (نمونه) و یک اشاره‌گر داده‌ی " +"کاربر (``closure`` مرتبط) را می‌پذیرد:" -msgid "It should return a new reference on success or ``NULL`` with a set exception on failure." +msgid "" +"It should return a new reference on success or ``NULL`` with a set exception" +" on failure." msgstr "" +"باید در صورت موفقیت یک ارجاع جدید و در صورت شکست ``NULL`` همراه با یک " +"استثنای تنظیم‌شده بازگرداند." -msgid "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and the value to be set) and a user data pointer (the associated ``closure``):" +msgid "" +"``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " +"the value to be set) and a user data pointer (the associated ``closure``):" msgstr "" +"توابع ``set`` دو پارامتر :c:expr:`PyObject*` (نمونه و مقداری که باید تنظیم " +"شود) و یک اشاره‌گر داده کاربر (``closure`` مرتبط) را دریافت می‌کنند:" -msgid "In case the attribute should be deleted the second parameter is ``NULL``. Should return ``0`` on success or ``-1`` with a set exception on failure." +msgid "" +"In case the attribute should be deleted the second parameter is ``NULL``. " +"Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" +"در صورتی که ویژگی باید حذف شود، پارامتر دوم ``NULL`` است. باید در صورت " +"موفقیت ``0`` و در صورت شکست ``-1`` به همراه استثنای تنظیم‌شده برگرداند." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "classmethod" -msgstr "" +msgstr "classmethod" msgid "staticmethod" -msgstr "" +msgstr "staticmethod" msgid "READ_RESTRICTED (C macro)" -msgstr "" +msgstr "READ_RESTRICTED (ماکروی C)" msgid "WRITE_RESTRICTED (C macro)" -msgstr "" +msgstr "WRITE_RESTRICTED (ماکروی C)" msgid "RESTRICTED (C macro)" -msgstr "" +msgstr "RESTRICTED (ماکروی C)" msgid "READONLY (C macro)" -msgstr "" +msgstr "READONLY (ماکروی C)" msgid "T_BYTE (C macro)" -msgstr "" +msgstr "T_BYTE (ماکروی C)" msgid "T_SHORT (C macro)" -msgstr "" +msgstr "T_SHORT (ماکروی C)" msgid "T_INT (C macro)" -msgstr "" +msgstr "T_INT (ماکروی C)" msgid "T_LONG (C macro)" -msgstr "" +msgstr "T_LONG (ماکروی C)" msgid "T_LONGLONG (C macro)" -msgstr "" +msgstr "T_LONGLONG (ماکروی C)" msgid "T_UBYTE (C macro)" -msgstr "" +msgstr "T_UBYTE (ماکروی C)" msgid "T_USHORT (C macro)" -msgstr "" +msgstr "T_USHORT (ماکرو C)" msgid "T_UINT (C macro)" -msgstr "" +msgstr "T_UINT (ماکروی C)" msgid "T_ULONG (C macro)" -msgstr "" +msgstr "T_ULONG (ماکروی C)" msgid "T_ULONGULONG (C macro)" -msgstr "" +msgstr "T_ULONGULONG (ماکروی C)" msgid "T_PYSSIZET (C macro)" -msgstr "" +msgstr "T_PYSSIZET (ماکروی C)" msgid "T_FLOAT (C macro)" -msgstr "" +msgstr "T_FLOAT (ماکروی C)" msgid "T_DOUBLE (C macro)" -msgstr "" +msgstr "T_DOUBLE (ماکروی C)" msgid "T_BOOL (C macro)" -msgstr "" +msgstr "T_BOOL (ماکروی C)" msgid "T_CHAR (C macro)" -msgstr "" +msgstr "T_CHAR (ماکروی C)" msgid "T_STRING (C macro)" -msgstr "" +msgstr "T_STRING (ماکروی C)" msgid "T_STRING_INPLACE (C macro)" -msgstr "" +msgstr "T_STRING_INPLACE (ماکروی C)" msgid "T_OBJECT_EX (C macro)" -msgstr "" +msgstr "T_OBJECT_EX (ماکروی C)" msgid "structmember.h" -msgstr "" +msgstr "structmember.h" diff --git a/c-api/subinterpreters.po b/c-api/subinterpreters.po index ddf903b22..c8daba4ce 100644 --- a/c-api/subinterpreters.po +++ b/c-api/subinterpreters.po @@ -20,82 +20,234 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Multiple interpreters in a Python process" -msgstr "" +msgstr "چندین مفسر در یک فرایند پایتون" -msgid "While in most uses, you will only embed a single Python interpreter, there are cases where you need to create several independent interpreters in the same process and perhaps even in the same thread. Sub-interpreters allow you to do that." +msgid "" +"While in most uses, you will only embed a single Python interpreter, there " +"are cases where you need to create several independent interpreters in the " +"same process and perhaps even in the same thread. Sub-interpreters allow you" +" to do that." msgstr "" +"هرچند در بیشتر موارد شما تنها یک مفسر پایتون را جاسازی می‌کنید، مواردی وجود " +"دارد که نیاز دارید چندین مفسر مستقل را در همان فرایند و شاید حتی در همان نخ " +"ایجاد کنید. زیرمفسرها به شما امکان انجام این کار را می‌دهند." -msgid "The \"main\" interpreter is the first one created when the runtime initializes. It is usually the only Python interpreter in a process. Unlike sub-interpreters, the main interpreter has unique process-global responsibilities like signal handling. It is also responsible for execution during runtime initialization and is usually the active interpreter during runtime finalization. The :c:func:`PyInterpreterState_Main` function returns a pointer to its state." -msgstr "" +msgid "" +"The \"main\" interpreter is the first one created when the runtime " +"initializes. It is usually the only Python interpreter in a process. Unlike" +" sub-interpreters, the main interpreter has unique process-global " +"responsibilities like signal handling. It is also responsible for execution" +" during runtime initialization and is usually the active interpreter during " +"runtime finalization. The :c:func:`PyInterpreterState_Main` function " +"returns a pointer to its state." +msgstr "" +"مفسر «اصلی» نخستین مفسری است که هنگام راه‌اندازی ران‌تایم ایجاد می‌شود. این " +"مفسر معمولاً تنها مفسر پایتون در یک فرایند است. برخلاف زیرمفسرها، مفسر اصلی " +"مسئولیت‌های منحصربه‌فردی در سطح کل فرایند مانند مدیریت سیگنال را بر عهده " +"دارد. این مفسر همچنین مسئول اجرا در طول راه‌اندازی ران‌تایم است و معمولاً " +"مفسر فعال در طول نهایی‌سازی ران‌تایم است. تابع " +":c:func:`PyInterpreterState_Main` اشاره‌گری به وضعیت آن برمی‌گرداند." -msgid "You can switch between sub-interpreters using the :c:func:`PyThreadState_Swap` function. You can create and destroy them using the following functions:" +msgid "" +"You can switch between sub-interpreters using the " +":c:func:`PyThreadState_Swap` function. You can create and destroy them using" +" the following functions:" msgstr "" +"می‌توانید با استفاده از تابع :c:func:`PyThreadState_Swap` بین زیرمفسرها " +"جابه‌جا شوید. می‌توانید آن‌ها را با استفاده از توابع زیر ایجاد و نابود کنید:" -msgid "Structure containing most parameters to configure a sub-interpreter. Its values are used only in :c:func:`Py_NewInterpreterFromConfig` and never modified by the runtime." +msgid "" +"Structure containing most parameters to configure a sub-interpreter. Its " +"values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " +"modified by the runtime." msgstr "" +"ساختاری که بیشتر پارامترهای لازم برای پیکربندی یک زیرمفسر را در بر دارد. " +"مقادیر آن تنها در :c:func:`Py_NewInterpreterFromConfig` استفاده می‌شوند و " +"هرگز توسط ران‌تایم تغییر داده نمی‌شوند." msgid "Structure fields:" -msgstr "" +msgstr "فیلد‌های ساختار:" -msgid "If this is ``0`` then the sub-interpreter will use its own \"object\" allocator state. Otherwise it will use (share) the main interpreter's." +msgid "" +"If this is ``0`` then the sub-interpreter will use its own \"object\" " +"allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" +"اگر این مقدار ``0`` باشد، زیرمفسر از وضعیت تخصیص‌دهنده‌ی «object» خود " +"استفاده می‌کند. در غیر این صورت از وضعیت تخصیص‌دهنده‌ی مفسر اصلی (به اشتراک)" +" استفاده می‌کند." -msgid "If this is ``0`` then :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:`PyInterpreterConfig_OWN_GIL`." +msgid "" +"If this is ``0`` then " +":c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be ``1``" +" (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` must" +" not be :c:macro:`PyInterpreterConfig_OWN_GIL`." msgstr "" +"اگر این مقدار ``0`` باشد، آنگاه " +":c:member:`~PyInterpreterConfig.check_multi_interp_extensions` باید ``1`` " +"(ناصفر) باشد. اگر این مقدار ``1`` باشد، آنگاه " +":c:member:`~PyInterpreterConfig.gil` نباید " +":c:macro:`PyInterpreterConfig_OWN_GIL` باشد." -msgid "If this is ``0`` then the runtime will not support forking the process in any thread where the sub-interpreter is currently active. Otherwise fork is unrestricted." +msgid "" +"If this is ``0`` then the runtime will not support forking the process in " +"any thread where the sub-interpreter is currently active. Otherwise fork is " +"unrestricted." msgstr "" +"اگر این مقدار ``0`` باشد، ران‌تایم از فورک کردن فرایند در هیچ نخی که زیرمفسر" +" در حال حاضر در آن فعال است پشتیبانی نخواهد کرد. در غیر این صورت، فورک بدون " +"محدودیت است." -msgid "Note that the :mod:`subprocess` module still works when fork is disallowed." +msgid "" +"Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" +"توجه داشته باشید که ماژول :mod:`subprocess` وقتی فورک ممنوع است، همچنان کار " +"می‌کند." -msgid "If this is ``0`` then the runtime will not support replacing the current process via exec (e.g. :func:`os.execv`) in any thread where the sub-interpreter is currently active. Otherwise exec is unrestricted." +msgid "" +"If this is ``0`` then the runtime will not support replacing the current " +"process via exec (e.g. :func:`os.execv`) in any thread where the sub-" +"interpreter is currently active. Otherwise exec is unrestricted." msgstr "" +"اگر این مقدار ``0`` باشد، ران‌تایم در هیچ نخی که زیرمفسر در حال حاضر در آن " +"فعال است، از جایگزینی فرایند جاری از طریق exec (مثلاً :func:`os.execv`) " +"پشتیبانی نخواهد کرد. در غیر این صورت، exec بدون محدودیت است." -msgid "Note that the :mod:`subprocess` module still works when exec is disallowed." +msgid "" +"Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" +"توجه داشته باشید که ماژول :mod:`subprocess` هنگامی که exec ممنوع است، همچنان" +" کار می‌کند." -msgid "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't create threads. Otherwise threads are allowed." +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create threads. Otherwise threads are allowed." msgstr "" +"اگر این مقدار ``0`` باشد، ماژول :mod:`threading` زیرمفسر نخ‌ها را ایجاد " +"نمی‌کند. در غیر این صورت، نخ‌ها مجاز هستند." -msgid "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't create daemon threads. Otherwise daemon threads are allowed (as long as :c:member:`~PyInterpreterConfig.allow_threads` is non-zero)." +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create daemon threads. Otherwise daemon threads are allowed (as long as " +":c:member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" +"اگر این مقدار ``0`` باشد، ماژول :mod:`threading` در زیرمفسر نخ‌های دِیمِن " +"ایجاد نمی‌کند. در غیر این صورت، نخ‌های دِیمِن مجاز هستند (تا زمانی که " +":c:member:`~PyInterpreterConfig.allow_threads` ناصفر باشد)." -msgid "If this is ``0`` then all extension modules may be imported, including legacy (single-phase init) modules, in any thread where the sub-interpreter is currently active. Otherwise only multi-phase init extension modules (see :pep:`489`) may be imported. (Also see :c:macro:`Py_mod_multiple_interpreters`.)" -msgstr "" +msgid "" +"If this is ``0`` then all extension modules may be imported, including " +"legacy (single-phase init) modules, in any thread where the sub-interpreter " +"is currently active. Otherwise only multi-phase init extension modules (see " +":pep:`489`) may be imported. (Also see " +":c:macro:`Py_mod_multiple_interpreters`.)" +msgstr "" +"اگر این مقدار ``0`` باشد، همه ماژول‌های توسعه‌ای، از جمله ماژول‌های قدیمی " +"(با مقداردهی اولیه تک‌مرحله‌ای)، می‌توانند در هر نخی که زیرمفسر در حال حاضر " +"در آن فعال است ایمپورت شوند. در غیر این صورت، فقط ماژول‌های توسعه‌ای با " +"مقداردهی اولیه چندمرحله‌ای (نگاه کنید به :pep:`489`) می‌توانند ایمپورت شوند." +" (همچنین :c:macro:`Py_mod_multiple_interpreters` را ببینید.)" -msgid "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``." +msgid "" +"This must be ``1`` (non-zero) if " +":c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``." msgstr "" +"اگر :c:member:`~PyInterpreterConfig.use_main_obmalloc` برابر ``0`` باشد، این" +" مقدار باید ``1`` (نا‌صفر) باشد." -msgid "This determines the operation of the GIL for the sub-interpreter. It may be one of the following:" +msgid "" +"This determines the operation of the GIL for the sub-interpreter. It may be " +"one of the following:" msgstr "" +"این، عملکرد قفل مفسر سراسری را برای زیرمفسر تعیین می‌کند. این می‌تواند یکی " +"از موارد زیر باشد:" msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" +"از انتخاب پیش‌فرض (:c:macro:`PyInterpreterConfig_SHARED_GIL`) استفاده کنید." msgid "Use (share) the main interpreter's GIL." -msgstr "" +msgstr "استفاده از (اشتراک‌گذاری) قفل مفسر سراسریِ مفسر اصلی." msgid "Use the sub-interpreter's own GIL." -msgstr "" +msgstr "از قفل مفسر سراسریِ خودِ زیرمفسر استفاده کنید." -msgid "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +msgid "" +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then " +":c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" +"اگر این مقدار :c:macro:`PyInterpreterConfig_OWN_GIL` باشد، آنگاه " +":c:member:`PyInterpreterConfig.use_main_obmalloc` باید ``0`` باشد." -msgid "Create a new sub-interpreter. This is an (almost) totally separate environment for the execution of Python code. In particular, the new interpreter has separate, independent versions of all imported modules, including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. The table of loaded modules (``sys.modules``) and the module search path (``sys.path``) are also separate. The new environment has no ``sys.argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the same underlying file descriptors)." -msgstr "" +msgid "" +"Create a new sub-interpreter. This is an (almost) totally separate " +"environment for the execution of Python code. In particular, the new " +"interpreter has separate, independent versions of all imported modules, " +"including the fundamental modules :mod:`builtins`, :mod:`__main__` and " +":mod:`sys`. The table of loaded modules (``sys.modules``) and the module " +"search path (``sys.path``) are also separate. The new environment has no " +"``sys.argv`` variable. It has new standard I/O stream file objects " +"``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the" +" same underlying file descriptors)." +msgstr "" +"یک زیرمفسر جدید ایجاد کنید. این یک محیط (تقریباً) کاملاً جداگانه برای اجرای " +"کد پایتون است. به‌ویژه، مفسر جدید نسخه‌های جداگانه و مستقلی از تمام " +"ماژول‌های ایمپورت‌شده دارد، از جمله ماژول‌های بنیادی :mod:`builtins`، " +":mod:`__main__` و :mod:`sys`. جدول ماژول‌های بارگذاری‌شده (``sys.modules``) " +"و مسیر جستجوی ماژول (``sys.path``) نیز جداگانه هستند. محیط جدید متغیر " +"``sys.argv`` ندارد. این محیط اشیاء پرونده‌ی جدید جریان‌های ورودی/خروجی " +"استاندارد ``sys.stdin``، ``sys.stdout`` و ``sys.stderr`` را دارد (البته " +"این‌ها به همان توصیف‌گرهای پرونده‌ی زیرین ارجاع می‌دهند)." -msgid "The given *config* controls the options with which the interpreter is initialized." +msgid "" +"The given *config* controls the options with which the interpreter is " +"initialized." msgstr "" +"*config* داده‌شده، گزینه‌هایی را که مفسر با آن‌ها راه‌اندازی می‌شود کنترل " +"می‌کند." -msgid "Upon success, *tstate_p* will be set to the first :term:`thread state` created in the new sub-interpreter. This thread state is :term:`attached `. Note that no actual thread is created; see the discussion of thread states below. If creation of the new interpreter is unsuccessful, *tstate_p* is set to ``NULL``; no exception is set since the exception state is stored in the :term:`attached thread state`, which might not exist." -msgstr "" +msgid "" +"Upon success, *tstate_p* will be set to the first :term:`thread state` " +"created in the new sub-interpreter. This thread state is :term:`attached " +"`. Note that no actual thread is created; see the " +"discussion of thread states below. If creation of the new interpreter is " +"unsuccessful, *tstate_p* is set to ``NULL``; no exception is set since the " +"exception state is stored in the :term:`attached thread state`, which might " +"not exist." +msgstr "" +"در صورت موفقیت، *tstate_p* به نخستین :term:`وضعیت نخ ` " +"ایجادشده در زیرمفسر جدید تنظیم می‌شود. این وضعیت نخ :term:`متصل ` است. توجه داشته باشید که هیچ نخ واقعی ایجاد نمی‌شود؛ بحث " +"درباره وضعیت‌های نخ را در ادامه ببینید. اگر ایجاد مفسر جدید ناموفق باشد، " +"*tstate_p* به ``NULL`` تنظیم می‌شود؛ هیچ استثنایی تنظیم نمی‌شود، زیرا وضعیت " +"استثنا در :term:`وضعیت نخ متصل ` ذخیره می‌شود که ممکن" +" است وجود نداشته باشد." -msgid "Like all other Python/C API functions, an :term:`attached thread state` must be present before calling this function, but it might be detached upon returning. On success, the returned thread state will be :term:`attached `. If the sub-interpreter is created with its own :term:`GIL` then the :term:`attached thread state` of the calling interpreter will be detached. When the function returns, the new interpreter's :term:`thread state` will be :term:`attached ` to the current thread and the previous interpreter's :term:`attached thread state` will remain detached." -msgstr "" +msgid "" +"Like all other Python/C API functions, an :term:`attached thread state` must" +" be present before calling this function, but it might be detached upon " +"returning. On success, the returned thread state will be :term:`attached " +"`. If the sub-interpreter is created with its own " +":term:`GIL` then the :term:`attached thread state` of the calling " +"interpreter will be detached. When the function returns, the new " +"interpreter's :term:`thread state` will be :term:`attached ` to the current thread and the previous interpreter's :term:`attached" +" thread state` will remain detached." +msgstr "" +"مانند تمام توابع دیگر Python/C API، باید پیش از فراخوانی این تابع، یک " +":term:`attached thread state` موجود باشد، اما ممکن است هنگام بازگشت جدا شده " +"باشد. در صورت موفقیت، وضعیت نخ بازگردانده‌شده :term:`متصل ` خواهد بود. اگر زیرمفسر (sub-interpreter) با :term:`GIL` اختصاصی خودش" +" ایجاد شود، :term:`attached thread state` مفسر فراخواننده جدا خواهد شد. " +"هنگامی که تابع بازمی‌گردد، :term:`thread state` مفسر جدید به نخ فعلی " +":term:`متصل ` خواهد بود و :term:`attached thread " +"state` مفسر قبلی جدا باقی خواهد ماند." -msgid "Sub-interpreters are most effective when isolated from each other, with certain functionality restricted::" +msgid "" +"Sub-interpreters are most effective when isolated from each other, with " +"certain functionality restricted::" msgstr "" +"زیرمفسرها زمانی بیشترین کارایی را دارند که از یکدیگر ایزوله باشند و برخی از " +"قابلیت‌ها محدود باشند::" msgid "" "PyInterpreterConfig config = {\n" @@ -113,183 +265,464 @@ msgid "" " Py_ExitStatusException(status);\n" "}" msgstr "" +"PyInterpreterConfig config = {\n" +" .use_main_obmalloc = 0,\n" +" .allow_fork = 0,\n" +" .allow_exec = 0,\n" +" .allow_threads = 1,\n" +" .allow_daemon_threads = 0,\n" +" .check_multi_interp_extensions = 1,\n" +" .gil = PyInterpreterConfig_OWN_GIL,\n" +"};\n" +"PyThreadState *tstate = NULL;\n" +"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}" -msgid "Note that the config is used only briefly and does not get modified. During initialization the config's values are converted into various :c:type:`PyInterpreterState` values. A read-only copy of the config may be stored internally on the :c:type:`PyInterpreterState`." +msgid "" +"Note that the config is used only briefly and does not get modified. During " +"initialization the config's values are converted into various " +":c:type:`PyInterpreterState` values. A read-only copy of the config may be " +"stored internally on the :c:type:`PyInterpreterState`." msgstr "" +"توجه داشته باشید که پیکربندی فقط به‌طور گذرا استفاده می‌شود و تغییر داده " +"نمی‌شود. در طول مقداردهی اولیه، مقادیر پیکربندی به مقادیر مختلف " +":c:type:`PyInterpreterState` تبدیل می‌شوند. ممکن است یک نسخه‌ی فقط‌خواندنی " +"از پیکربندی به‌طور داخلی روی :c:type:`PyInterpreterState` ذخیره شود." msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" +"ماژول‌های توسعه‌ای بین (زیر-)مفسر‌ها به شرح زیر به اشتراک گذاشته می‌شوند:" -msgid "For modules using multi-phase initialization, e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is created and initialized for each interpreter. Only C-level static and global variables are shared between these module objects." +msgid "" +"For modules using multi-phase initialization, e.g. " +":c:func:`PyModule_FromDefAndSpec`, a separate module object is created and " +"initialized for each interpreter. Only C-level static and global variables " +"are shared between these module objects." msgstr "" +"برای ماژول‌هایی که از مقداردهی اولیه چندمرحله‌ای استفاده می‌کنند، مانند " +":c:func:`PyModule_FromDefAndSpec`، یک شیء ماژول جداگانه برای هر مفسر ایجاد و" +" مقداردهی اولیه می‌شود. تنها متغیرهای ایستا و سراسری در سطح C بین این اشیاء " +"ماژول به اشتراک گذاشته می‌شوند." -msgid "For modules using legacy :ref:`single-phase initialization `, e.g. :c:func:`PyModule_Create`, the first time a particular extension is imported, it is initialized normally, and a (shallow) copy of its module's dictionary is squirreled away. When the same extension is imported by another (sub-)interpreter, a new module is initialized and filled with the contents of this copy; the extension's ``init`` function is not called. Objects in the module's dictionary thus end up shared across (sub-)interpreters, which might cause unwanted behavior (see `Bugs and caveats`_ below)." -msgstr "" +msgid "" +"For modules using legacy :ref:`single-phase initialization `, e.g. :c:func:`PyModule_Create`, the first time a " +"particular extension is imported, it is initialized normally, and a " +"(shallow) copy of its module's dictionary is squirreled away. When the same " +"extension is imported by another (sub-)interpreter, a new module is " +"initialized and filled with the contents of this copy; the extension's " +"``init`` function is not called. Objects in the module's dictionary thus end" +" up shared across (sub-)interpreters, which might cause unwanted behavior " +"(see `Bugs and caveats`_ below)." +msgstr "" +"برای ماژول‌هایی که از :ref:`مقداردهی اولیه تک‌فازی ` قدیمی استفاده می‌کنند، مانند :c:func:`PyModule_Create`، " +"اولین باری که یک ماژول توسعه‌ای خاص ایمپورت می‌شود، به‌طور عادی مقداردهی " +"اولیه می‌شود و یک کپی (سطحی) از دیکشنری ماژول آن ذخیره می‌شود. وقتی همان " +"ماژول توسعه‌ای توسط (زیر)مفسر دیگری ایمپورت می‌شود، یک ماژول جدید مقداردهی " +"اولیه می‌شود و با محتویات این کپی پر می‌شود؛ تابع ``init`` ماژول توسعه‌ای " +"فراخوانی نمی‌شود. بنابراین، اشیاء موجود در دیکشنری ماژول در نهایت میان " +"(زیر)مفسر‌ها به اشتراک گذاشته می‌شوند، که ممکن است باعث رفتار ناخواسته شود " +"(به `باگ‌ها و هشدار‌ها`_ در ادامه مراجعه کنید)." -msgid "Note that this is different from what happens when an extension is imported after the interpreter has been completely re-initialized by calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's ``initmodule`` function *is* called again. As with multi-phase initialization, this means that only C-level static and global variables are shared between these modules." -msgstr "" +msgid "" +"Note that this is different from what happens when an extension is imported " +"after the interpreter has been completely re-initialized by calling " +":c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the " +"extension's ``initmodule`` function *is* called again. As with multi-phase " +"initialization, this means that only C-level static and global variables are" +" shared between these modules." +msgstr "" +"توجه داشته باشید که این مورد با آنچه هنگام ایمپورت شدن یک ماژول توسعه‌ای پس " +"از بازمقداردهی اولیه‌ی کامل مفسر از طریق فراخوانی :c:func:`Py_FinalizeEx` و " +":c:func:`Py_Initialize` رخ می‌دهد، متفاوت است؛ در آن صورت، تابع " +"``initmodule`` ماژول توسعه‌ای *دوباره* فراخوانی می‌شود. مانند مقداردهی " +"اولیه‌ی چندمرحله‌ای، این بدان معناست که تنها متغیرهای ایستا و سراسری در سطح " +"C بین این ماژول‌ها مشترک هستند." -msgid "Create a new sub-interpreter. This is essentially just a wrapper around :c:func:`Py_NewInterpreterFromConfig` with a config that preserves the existing behavior. The result is an unisolated sub-interpreter that shares the main interpreter's GIL, allows fork/exec, allows daemon threads, and allows single-phase init modules." -msgstr "" +msgid "" +"Create a new sub-interpreter. This is essentially just a wrapper around " +":c:func:`Py_NewInterpreterFromConfig` with a config that preserves the " +"existing behavior. The result is an unisolated sub-interpreter that shares " +"the main interpreter's GIL, allows fork/exec, allows daemon threads, and " +"allows single-phase init modules." +msgstr "" +"یک زیرمفسر (sub-interpreter) جدید ایجاد کنید. این در اصل صرفاً پوششی در " +"اطراف :c:func:`Py_NewInterpreterFromConfig` با پیکربندی‌ای است که رفتار " +"موجود را حفظ می‌کند. نتیجه، یک زیرمفسر غیرمجزا (unisolated) است که قفل مفسر " +"سراسری (GIL) را با مفسر اصلی به اشتراک می‌گذارد، اجازه‌ی fork/exec را " +"می‌دهد، اجازه‌ی نخ‌های دِیمِن را می‌دهد و اجازه‌ی ماژول‌های مقداردهی اولیه‌ی" +" تک‌فازی (single-phase init) را می‌دهد." -msgid "Destroy the (sub-)interpreter represented by the given :term:`thread state`. The given thread state must be :term:`attached `. When the call returns, there will be no :term:`attached thread state`. All thread states associated with this interpreter are destroyed." +msgid "" +"Destroy the (sub-)interpreter represented by the given :term:`thread state`." +" The given thread state must be :term:`attached `. " +"When the call returns, there will be no :term:`attached thread state`. All " +"thread states associated with this interpreter are destroyed." msgstr "" +"(زیر)مفسری را نابود می‌کند که :term:`وضعیت نخ ` داده‌شده آن را" +" نمایندگی می‌کند. وضعیت نخ داده‌شده باید :term:`متصل ` باشد. هنگامی که فراخوانی بازگردد، هیچ :term:`وضعیت نخ متصل ` وجود نخواهد داشت. تمام وضعیت‌های نخ مرتبط با این مفسر نابود " +"می‌شوند." -msgid ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been explicitly destroyed at that point." +msgid "" +":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " +"explicitly destroyed at that point." msgstr "" +":c:func:`Py_FinalizeEx` تمام زیرمفسرهایی را که تا آن لحظه به‌طور صریح نابود " +"نشده‌اند، از بین می‌برد." msgid "A per-interpreter GIL" -msgstr "" +msgstr "قفل مفسر سراسری (GIL) به‌ازای هر مفسر" -msgid "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter that is completely isolated from other interpreters, including having its own GIL. The most important benefit of this isolation is that such an interpreter can execute Python code without being blocked by other interpreters or blocking any others. Thus a single Python process can truly take advantage of multiple CPU cores when running Python code. The isolation also encourages a different approach to concurrency than that of just using threads. (See :pep:`554` and :pep:`684`.)" -msgstr "" +msgid "" +"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter" +" that is completely isolated from other interpreters, including having its " +"own GIL. The most important benefit of this isolation is that such an " +"interpreter can execute Python code without being blocked by other " +"interpreters or blocking any others. Thus a single Python process can truly" +" take advantage of multiple CPU cores when running Python code. The " +"isolation also encourages a different approach to concurrency than that of " +"just using threads. (See :pep:`554` and :pep:`684`.)" +msgstr "" +"با استفاده از :c:func:`Py_NewInterpreterFromConfig` می‌توانید یک زیرمفسر " +"ایجاد کنید که به‌طور کامل از سایر مفسرها جداشده باشد، از جمله با داشتن قفل " +"مفسر سراسری مخصوص به خود. مهم‌ترین مزیت این جداسازی این است که چنین مفسری " +"می‌تواند بدون مسدود شدن توسط مفسرهای دیگر و بدون مسدود کردن هیچ مفسر دیگری، " +"کد پایتون را اجرا کند. بدین ترتیب، یک فرایند پایتون واحد می‌تواند هنگام " +"اجرای کد پایتون واقعاً از چندین هسته‌ی CPU بهره ببرد. این جداسازی همچنین " +"به‌جای صرفاً استفاده از نخ‌ها، رویکردی متفاوت به همزمانی را ترغیب می‌کند. " +"(به :pep:`554` و :pep:`684` مراجعه کنید.)" -msgid "Using an isolated interpreter requires vigilance in preserving that isolation. That especially means not sharing any objects or mutable state without guarantees about thread-safety. Even objects that are otherwise immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of the refcount. One simple but less-efficient approach around this is to use a global lock around all use of some state (or object). Alternately, effectively immutable objects (like integers or strings) can be made safe in spite of their refcounts by making them :term:`immortal`. In fact, this has been done for the builtin singletons, small integers, and a number of other builtin objects." -msgstr "" +msgid "" +"Using an isolated interpreter requires vigilance in preserving that " +"isolation. That especially means not sharing any objects or mutable state " +"without guarantees about thread-safety. Even objects that are otherwise " +"immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of " +"the refcount. One simple but less-efficient approach around this is to use " +"a global lock around all use of some state (or object). Alternately, " +"effectively immutable objects (like integers or strings) can be made safe in" +" spite of their refcounts by making them :term:`immortal`. In fact, this has" +" been done for the builtin singletons, small integers, and a number of other" +" builtin objects." +msgstr "" +"استفاده از مفسر مجزا نیازمند هوشیاری در حفظ آن جداسازی است. این به‌ویژه به " +"آن معناست که هیچ شیئی یا وضعیت تغییرپذیری را نباید بدون تضمین‌هایی درباره‌ی " +"نخ‌ایمنی به اشتراک گذاشت. حتی اشیائی که در سایر جهات تغییرناپذیرند (مانند " +"``None`` و ``(1, 5)``) به‌طور معمول نمی‌توانند به دلیل شمارش ارجاع به اشتراک" +" گذاشته شوند. یک راه‌حل ساده اما کم‌کارآمدتر برای این مسئله، استفاده از یک " +"قفل سراسری در پیرامون تمامی استفاده‌ها از یک وضعیت (یا شیء) است. به‌طور " +"جایگزین، اشیاء عملاً تغییرناپذیر (مانند اعداد صحیح یا رشته‌ها) را می‌توان با" +" وجود شمارش ارجاعشان، از طریق :term:`نامیرا ` کردن آنها ایمن ساخت." +" در واقع، این کار برای تک‌نمونه‌های توکار، اعداد صحیح کوچک و تعدادی از اشیاء" +" توکار دیگر انجام شده است." -msgid "If you preserve isolation then you will have access to proper multi-core computing without the complications that come with free-threading. Failure to preserve isolation will expose you to the full consequences of free-threading, including races and hard-to-debug crashes." +msgid "" +"If you preserve isolation then you will have access to proper multi-core " +"computing without the complications that come with free-threading. Failure " +"to preserve isolation will expose you to the full consequences of free-" +"threading, including races and hard-to-debug crashes." msgstr "" +"اگر جداسازی را حفظ کنید، به محاسبات چند‌هسته‌ای واقعی بدون پیچیدگی‌هایی که " +"با نخ‌بندی آزاد همراه هستند دسترسی خواهید داشت. در صورت عدم حفظ جداسازی، با " +"تمام پیامدهای نخ‌بندی آزاد از جمله رقابت‌ها و فروپاشی‌هایی که اشکال‌زدایی " +"آن‌ها دشوار است روبه‌رو خواهید شد." -msgid "Aside from that, one of the main challenges of using multiple isolated interpreters is how to communicate between them safely (not break isolation) and efficiently. The runtime and stdlib do not provide any standard approach to this yet. A future stdlib module would help mitigate the effort of preserving isolation and expose effective tools for communicating (and sharing) data between interpreters." -msgstr "" +msgid "" +"Aside from that, one of the main challenges of using multiple isolated " +"interpreters is how to communicate between them safely (not break isolation)" +" and efficiently. The runtime and stdlib do not provide any standard " +"approach to this yet. A future stdlib module would help mitigate the effort" +" of preserving isolation and expose effective tools for communicating (and " +"sharing) data between interpreters." +msgstr "" +"علاوه بر این، یکی از چالش‌های اصلی استفاده از چندین مفسر جداشده این است که " +"چگونه می‌توان به‌طور امن (بدون بر هم زدن جداسازی) و کارآمد بین آن‌ها ارتباط " +"برقرار کرد. ران‌تایم و کتابخانه استاندارد هنوز هیچ رویکرد استانداردی برای " +"این کار ارائه نمی‌دهند. یک ماژول آینده در کتابخانه استاندارد می‌تواند به " +"کاهش تلاش لازم برای حفظ جداسازی کمک کند و ابزارهای مؤثری برای ارتباط (و " +"اشتراک‌گذاری) داده‌ها بین مفسرها در اختیار بگذارد." msgid "Bugs and caveats" -msgstr "" +msgstr "اشکال‌ها و هشدارها" -msgid "Because sub-interpreters (and the main interpreter) are part of the same process, the insulation between them isn't perfect --- for example, using low-level file operations like :func:`os.close` they can (accidentally or maliciously) affect each other's open files. Because of the way extensions are shared between (sub-)interpreters, some extensions may not work properly; this is especially likely when using single-phase initialization or (static) global variables. It is possible to insert objects created in one sub-interpreter into a namespace of another (sub-)interpreter; this should be avoided if possible." -msgstr "" +msgid "" +"Because sub-interpreters (and the main interpreter) are part of the same " +"process, the insulation between them isn't perfect --- for example, using " +"low-level file operations like :func:`os.close` they can (accidentally or " +"maliciously) affect each other's open files. Because of the way extensions " +"are shared between (sub-)interpreters, some extensions may not work " +"properly; this is especially likely when using single-phase initialization " +"or (static) global variables. It is possible to insert objects created in " +"one sub-interpreter into a namespace of another (sub-)interpreter; this " +"should be avoided if possible." +msgstr "" +"از آنجا که زیرمفسر‌ها (و مفسر اصلی) بخشی از یک فرایند واحد هستند، جداسازی " +"میان آن‌ها بی‌نقص نیست --- برای مثال، با استفاده از عملیات‌های سطح پایین " +"پرونده مانند :func:`os.close` می‌توانند (به‌طور تصادفی یا خرابکارانه) بر " +"پرونده‌های باز یکدیگر تأثیر بگذارند. به دلیل نحوه‌ی اشتراک‌گذاری ماژول‌های " +"توسعه‌ای میان (زیر)مفسر‌ها، ممکن است برخی از ماژول‌های توسعه‌ای به‌درستی کار" +" نکنند؛ احتمال این امر به‌ویژه هنگام استفاده از مقداردهی اولیه‌ی تک‌فازی یا " +"متغیرهای سراسری (ایستا) بیشتر است. می‌توان اشیایی را که در یک زیرمفسر ایجاد " +"شده‌اند، در فضای نام (زیر)مفسر دیگری قرار داد؛ بهتر است در صورت امکان از این" +" کار پرهیز شود." -msgid "Special care should be taken to avoid sharing user-defined functions, methods, instances or classes between sub-interpreters, since import operations executed by such objects may affect the wrong (sub-)interpreter's dictionary of loaded modules. It is equally important to avoid sharing objects from which the above are reachable." -msgstr "" +msgid "" +"Special care should be taken to avoid sharing user-defined functions, " +"methods, instances or classes between sub-interpreters, since import " +"operations executed by such objects may affect the wrong (sub-)interpreter's" +" dictionary of loaded modules. It is equally important to avoid sharing " +"objects from which the above are reachable." +msgstr "" +"باید با دقت ویژه از اشتراک‌گذاری توابع، متدها، نمونه‌ها یا کلاس‌های " +"تعریف‌شده توسط کاربر بین زیرمفسر‌ها جلوگیری شود، زیرا عملیات ایمپورت که توسط" +" چنین اشیایی اجرا می‌شوند، ممکن است بر دیکشنری ماژول‌های بارگذاری‌شده‌ی " +"(زیر)مفسر اشتباه تأثیر بگذارد. به همان اندازه مهم است که از اشتراک‌گذاری " +"اشیایی که موارد فوق از طریق آن‌ها قابل دسترسی‌اند، جلوگیری شود." -msgid "Also note that combining this functionality with ``PyGILState_*`` APIs is delicate, because these APIs assume a bijection between Python thread states and OS-level threads, an assumption broken by the presence of sub-interpreters. It is highly recommended that you don't switch sub-interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:`ctypes`) using these APIs to allow calling of Python code from non-Python created threads will probably be broken when using sub-interpreters." -msgstr "" +msgid "" +"Also note that combining this functionality with ``PyGILState_*`` APIs is " +"delicate, because these APIs assume a bijection between Python thread states" +" and OS-level threads, an assumption broken by the presence of sub-" +"interpreters. It is highly recommended that you don't switch sub-" +"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and " +":c:func:`PyGILState_Release` calls. Furthermore, extensions (such as " +":mod:`ctypes`) using these APIs to allow calling of Python code from non-" +"Python created threads will probably be broken when using sub-interpreters." +msgstr "" +"همچنین توجه داشته باشید که ترکیب این قابلیت با API‌های ``PyGILState_*`` امری" +" حساس است، زیرا این API‌ها تناظر یک‌به‌یک بین وضعیت‌های نخ پایتون و نخ‌های " +"سطح سیستم‌عامل را فرض می‌کنند؛ فرضی که با وجود زیرمفسر‌ها نقض می‌شود. قویاً " +"توصیه می‌شود که زیرمفسر‌ها را بین یک جفت فراخوانی متناظر " +":c:func:`PyGILState_Ensure` و :c:func:`PyGILState_Release` عوض نکنید. علاوه " +"بر این، ماژول‌های توسعه‌ای (مانند :mod:`ctypes`) که از این API‌ها برای فراهم" +" کردن امکان فراخوانی کد پایتون از نخ‌هایی که توسط پایتون ایجاد نشده‌اند " +"استفاده می‌کنند، احتمالاً هنگام استفاده از زیرمفسر‌ها از کار می‌افتند." msgid "High-level APIs" -msgstr "" +msgstr "APIهای سطح‌بالا" -msgid "This data structure represents the state shared by a number of cooperating threads. Threads belonging to the same interpreter share their module administration and a few other internal items. There are no public members in this structure." +msgid "" +"This data structure represents the state shared by a number of cooperating " +"threads. Threads belonging to the same interpreter share their module " +"administration and a few other internal items. There are no public members " +"in this structure." msgstr "" +"این ساختار داده وضعیت مشترک بین تعدادی از نخ‌های همکاری‌کننده را نشان " +"می‌دهد. نخ‌هایی که به یک مفسر واحد تعلق دارند، مدیریت ماژول خود و چند مورد " +"داخلی دیگر را به اشتراک می‌گذارند. در این ساختار هیچ عضو عمومی وجود ندارد." -msgid "Threads belonging to different interpreters initially share nothing, except process state like available memory, open file descriptors and such. The global interpreter lock is also shared by all threads, regardless of to which interpreter they belong." +msgid "" +"Threads belonging to different interpreters initially share nothing, except " +"process state like available memory, open file descriptors and such. The " +"global interpreter lock is also shared by all threads, regardless of to " +"which interpreter they belong." msgstr "" +"نخ‌های متعلق به مفسرهای مختلف در ابتدا هیچ چیزی را به اشتراک نمی‌گذارند، " +"به‌جز وضعیت فرایند مانند حافظه‌ی در دسترس، توصیف‌گرهای پرونده‌ی باز و مواردی" +" از این دست. قفل مفسر سراسری نیز میان همه‌ی نخ‌ها مشترک است، صرف‌نظر از " +"اینکه به کدام مفسر تعلق دارند." -msgid ":pep:`684` introduced the possibility of a :ref:`per-interpreter GIL `. See :c:func:`Py_NewInterpreterFromConfig`." +msgid "" +":pep:`684` introduced the possibility of a :ref:`per-interpreter GIL `. See :c:func:`Py_NewInterpreterFromConfig`." msgstr "" +":pep:`684` امکان :ref:`قفل مفسر سراسری برای هر مفسر ` " +"را معرفی کرد. :c:func:`Py_NewInterpreterFromConfig` را ببینید." msgid "Get the current interpreter." -msgstr "" +msgstr "مفسر جاری را برمی‌گرداند." -msgid "Issue a fatal error if there is no :term:`attached thread state`. It cannot return NULL." +msgid "" +"Issue a fatal error if there is no :term:`attached thread state`. It cannot " +"return NULL." msgstr "" +"اگر :term:`attached thread state` وجود نداشته باشد، خطای مهلک صادر می‌کند. " +"این تابع نمی‌تواند NULL را بازگرداند." -msgid "Return the interpreter's unique ID. If there was any error in doing so then ``-1`` is returned and an error is set." +msgid "" +"Return the interpreter's unique ID. If there was any error in doing so then" +" ``-1`` is returned and an error is set." msgstr "" +"شناسه یکتای مفسر را برمی‌گرداند. اگر در انجام این کار خطایی رخ دهد، ``-1`` " +"برگردانده می‌شود و خطا تنظیم می‌شود." msgid "The caller must have an :term:`attached thread state`." -msgstr "" +msgstr "فراخوان‌کننده باید یک :term:`attached thread state` داشته باشد." -msgid "Return a dictionary in which interpreter-specific data may be stored. If this function returns ``NULL`` then no exception has been raised and the caller should assume no interpreter-specific dict is available." +msgid "" +"Return a dictionary in which interpreter-specific data may be stored. If " +"this function returns ``NULL`` then no exception has been raised and the " +"caller should assume no interpreter-specific dict is available." msgstr "" +"یک دیکشنری برمی‌گرداند که در آن می‌توان داده‌های خاص مفسر را ذخیره کرد. اگر " +"این تابع ``NULL`` را برگرداند، هیچ استثنایی ایجاد نشده است و فراخواننده باید" +" فرض کند که هیچ دیکشنری خاص مفسری در دسترس نیست." -msgid "This is not a replacement for :c:func:`PyModule_GetState()`, which extensions should use to store interpreter-specific state information." +msgid "" +"This is not a replacement for :c:func:`PyModule_GetState()`, which " +"extensions should use to store interpreter-specific state information." msgstr "" +"این جایگزینی برای :c:func:`PyModule_GetState()` نیست؛ ماژول‌های توسعه‌ای " +"باید از آن برای ذخیره‌سازی اطلاعات وضعیت مخصوص مفسر استفاده کنند." -msgid "The returned dictionary is borrowed from the interpreter and is valid until interpreter shutdown." +msgid "" +"The returned dictionary is borrowed from the interpreter and is valid until " +"interpreter shutdown." msgstr "" +"دیکشنری برگردانده‌شده از مفسر امانت گرفته شده است و تا زمان خاموش شدن مفسر " +"معتبر است." msgid "Type of a frame evaluation function." -msgstr "" +msgstr "نوع یک تابع ارزیابی فریم." -msgid "The *throwflag* parameter is used by the ``throw()`` method of generators: if non-zero, handle the current exception." +msgid "" +"The *throwflag* parameter is used by the ``throw()`` method of generators: " +"if non-zero, handle the current exception." msgstr "" +"پارامتر *throwflag* توسط متد ``throw()`` تولیدگرها استفاده می‌شود: اگر ناصفر" +" باشد، استثنای جاری مدیریت می‌شود." msgid "The function now takes a *tstate* parameter." -msgstr "" +msgstr "این تابع اکنون پارامتر *tstate* را می‌پذیرد." -msgid "The *frame* parameter changed from ``PyFrameObject*`` to ``_PyInterpreterFrame*``." +msgid "" +"The *frame* parameter changed from ``PyFrameObject*`` to " +"``_PyInterpreterFrame*``." msgstr "" +"پارامتر *frame* از ``PyFrameObject*`` به ``_PyInterpreterFrame*`` تغییر کرد." msgid "Get the frame evaluation function." -msgstr "" +msgstr "تابع ارزیابی قاب (frame) را دریافت کنید." msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." -msgstr "" +msgstr "به :pep:`523` «افزودن یک API ارزیابی فریم به سی‌پایتون» مراجعه کنید." msgid "Set the frame evaluation function." -msgstr "" +msgstr "تابع ارزیابی فریم را تنظیم می‌کند." msgid "Low-level APIs" -msgstr "" +msgstr "API‌های سطح پایین" -msgid "All of the following functions must be called after :c:func:`Py_Initialize`." -msgstr "" +msgid "" +"All of the following functions must be called after :c:func:`Py_Initialize`." +msgstr "تمام توابع زیر باید پس از :c:func:`Py_Initialize` فراخوانی شوند." -msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an :term:`attached thread state`." +msgid "" +":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an " +":term:`attached thread state`." msgstr "" +":c:func:`Py_Initialize()` اکنون :term:`قفل مفسر سراسری ` را مقدار‌دهی " +"اولیه می‌کند و یک :term:`وضعیت نخ متصل ` تنظیم " +"می‌کند." -msgid "Create a new interpreter state object. An :term:`attached thread state` is not needed, but may optionally exist if it is necessary to serialize calls to this function." +msgid "" +"Create a new interpreter state object. An :term:`attached thread state` is " +"not needed, but may optionally exist if it is necessary to serialize calls " +"to this function." msgstr "" +"یک شیء وضعیت مفسر جدید ایجاد می‌کند. نیازی به :term:`attached thread state`" +" نیست، اما در صورت ضرورت سریال‌سازی فراخوانی‌های این تابع، می‌تواند به‌صورت " +"اختیاری وجود داشته باشد." -msgid "Raises an :ref:`auditing event ` ``cpython.PyInterpreterState_New`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_New`` with no arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``cpython.PyInterpreterState_New`` را " +"بدون هیچ آرگومانی ایجاد می‌کند." -msgid "Reset all information in an interpreter state object. There must be an :term:`attached thread state` for the interpreter." +msgid "" +"Reset all information in an interpreter state object. There must be an " +":term:`attached thread state` for the interpreter." msgstr "" +"تمام اطلاعات در یک شیء وضعیت مفسر را بازنشانی می‌کند. باید یک " +":term:`attached thread state` برای مفسر وجود داشته باشد." -msgid "Raises an :ref:`auditing event ` ``cpython.PyInterpreterState_Clear`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_Clear`` with no arguments." msgstr "" +":ref:`رویداد حسابرسی ` ``cpython.PyInterpreterState_Clear`` را " +"بدون هیچ آرگومانی ایجاد می‌کند." -msgid "Destroy an interpreter state object. There **should not** be an :term:`attached thread state` for the target interpreter. The interpreter state must have been reset with a previous call to :c:func:`PyInterpreterState_Clear`." +msgid "" +"Destroy an interpreter state object. There **should not** be an " +":term:`attached thread state` for the target interpreter. The interpreter " +"state must have been reset with a previous call to " +":c:func:`PyInterpreterState_Clear`." msgstr "" +"یک شیء وضعیت مفسر را نابود می‌کند. برای مفسر هدف **نباید** :term:`attached " +"thread state` وجود داشته باشد. وضعیت مفسر باید پیش‌تر با فراخوانی " +":c:func:`PyInterpreterState_Clear` بازنشانی شده باشد." msgid "Advanced debugger support" -msgstr "" +msgstr "پشتیبانی از اشکال‌زدای پیشرفته" -msgid "These functions are only intended to be used by advanced debugging tools." +msgid "" +"These functions are only intended to be used by advanced debugging tools." msgstr "" +"این توابع تنها برای استفاده توسط ابزارهای پیشرفته‌ی اشکال‌زدایی در نظر گرفته" +" شده‌اند." -msgid "Return the interpreter state object at the head of the list of all such objects." -msgstr "" +msgid "" +"Return the interpreter state object at the head of the list of all such " +"objects." +msgstr "شیء وضعیت مفسر در ابتدای فهرست همه‌ی چنین اشیایی را بازمی‌گرداند." msgid "Return the main interpreter state object." -msgstr "" +msgstr "شیء وضعیت مفسر اصلی را برمی‌گرداند." -msgid "Return the next interpreter state object after *interp* from the list of all such objects." +msgid "" +"Return the next interpreter state object after *interp* from the list of all" +" such objects." msgstr "" +"شیء وضعیت مفسرِ بعدی پس از *interp* را از فهرست همه‌ی چنین اشیایی " +"برمی‌گرداند." -msgid "Return the pointer to the first :c:type:`PyThreadState` object in the list of threads associated with the interpreter *interp*." +msgid "" +"Return the pointer to the first :c:type:`PyThreadState` object in the list " +"of threads associated with the interpreter *interp*." msgstr "" +"اشاره‌گر به نخستین شیء :c:type:`PyThreadState` در فهرست نخ‌های مرتبط با مفسر" +" *interp* را برمی‌گرداند." -msgid "Return the next thread state object after *tstate* from the list of all such objects belonging to the same :c:type:`PyInterpreterState` object." +msgid "" +"Return the next thread state object after *tstate* from the list of all such" +" objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" +"شیء وضعیت نخ بعدی را پس از *tstate* از فهرست همه‌ی اشیاء از این دست که به " +"همان شیء :c:type:`PyInterpreterState` تعلق دارند، برمی‌گرداند." msgid "module" -msgstr "" +msgstr "ماژول" msgid "builtins" -msgstr "" +msgstr "builtins" msgid "__main__" -msgstr "" +msgstr "__main__" msgid "sys" -msgstr "" +msgstr "sys" msgid "stdout (in module sys)" -msgstr "" +msgstr "stdout (در ماژول sys)" msgid "stderr (in module sys)" -msgstr "" +msgstr "stderr (در ماژول sys)" msgid "stdin (in module sys)" -msgstr "" +msgstr "stdin (در ماژول sys)" msgid "Py_FinalizeEx (C function)" -msgstr "" +msgstr "Py_FinalizeEx (تابع C)" msgid "Py_Initialize (C function)" -msgstr "" +msgstr "Py_Initialize (تابع C)" msgid "close (in module os)" -msgstr "" +msgstr "close (در ماژول os)" diff --git a/c-api/synchronization.po b/c-api/synchronization.po index 78cd1c0e6..1a3b9ee78 100644 --- a/c-api/synchronization.po +++ b/c-api/synchronization.po @@ -20,58 +20,157 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Synchronization primitives" -msgstr "" +msgstr "پیش‌موجودات همگام‌سازی (synchronization primitives)" msgid "The C-API provides a basic mutual exclusion lock." -msgstr "" +msgstr "API زبان C یک قفل متقابل پایه‌ای فراهم می‌کند." -msgid "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to zero to represent the unlocked state. For example::" +msgid "" +"A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " +"zero to represent the unlocked state. For example::" msgstr "" +"قفل متقابل. :c:type:`!PyMutex` باید برای نمایش وضعیت باز، با مقدار صفر " +"مقداردهی اولیه شود. برای مثال::" msgid "PyMutex mutex = {0};" -msgstr "" +msgstr "PyMutex mutex = {0};" -msgid "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the contents and address of a :c:type:`!PyMutex` are meaningful, and it must remain at a fixed, writable location in memory." +msgid "" +"Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " +"contents and address of a :c:type:`!PyMutex` are meaningful, and it must " +"remain at a fixed, writable location in memory." msgstr "" +"نباید نمونه‌های :c:type:`!PyMutex` کپی یا منتقل شوند. هم محتویات و هم آدرس " +"یک :c:type:`!PyMutex` معنادار هستند و باید در مکانی ثابت و قابل‌نوشتن در " +"حافظه باقی بماند." -msgid "A :c:type:`!PyMutex` currently occupies one byte, but the size should be considered unstable. The size may change in future Python releases without a deprecation period." +msgid "" +"A :c:type:`!PyMutex` currently occupies one byte, but the size should be " +"considered unstable. The size may change in future Python releases without " +"a deprecation period." msgstr "" +":c:type:`!PyMutex` در حال حاضر یک بایت فضا اشغال می‌کند، اما اندازه‌ی آن " +"باید ناپاید در نظر گرفته شود. این اندازه ممکن است در نسخه‌های آینده‌ی پایتون" +" بدون دوره‌ی منسوخ‌شدن تغییر کند." -msgid "Lock mutex *m*. If another thread has already locked it, the calling thread will block until the mutex is unlocked. While blocked, the thread will temporarily detach the :term:`thread state ` if one exists." +msgid "" +"Lock mutex *m*. If another thread has already locked it, the calling thread" +" will block until the mutex is unlocked. While blocked, the thread will " +"temporarily detach the :term:`thread state ` if one " +"exists." msgstr "" +"قفل متقابل *m* را قفل می‌کند. اگر نخ دیگری از قبل آن را قفل کرده باشد، نخ " +"فراخواننده تا زمانی که قفل متقابل باز شود، مسدود خواهد شد. در حال مسدود " +"بودن، نخ :term:`وضعیت نخ ` را در صورت وجود به‌طور " +"موقت جدا خواهد کرد." -msgid "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will issue a fatal error." +msgid "" +"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " +"issue a fatal error." msgstr "" +"قفل متقابل *m* را باز می‌کند. قفل متقابل باید در حالت قفل‌شده باشد --- در " +"غیر این صورت، تابع خطای مهلک صادر خواهد کرد." msgid "Returns non-zero if the mutex *m* is currently locked, zero otherwise." msgstr "" +"اگر قفل متقابل *m* در حال حاضر قفل شده باشد، مقدار غیرصفر و در غیر این صورت " +"صفر برمی‌گرداند." -msgid "This function is intended for use in assertions and debugging only and should not be used to make concurrency control decisions, as the lock state may change immediately after the check." +msgid "" +"This function is intended for use in assertions and debugging only and " +"should not be used to make concurrency control decisions, as the lock state " +"may change immediately after the check." msgstr "" +"این تابع فقط برای استفاده در ادعاها و اشکال‌زدایی در نظر گرفته شده است و " +"نباید برای تصمیم‌گیری‌های کنترل همزمانی به کار رود، زیرا وضعیت قفل ممکن است " +"بلافاصله پس از بررسی تغییر کند." msgid "Python critical section API" -msgstr "" +msgstr "API بخش بحرانی پایتون" -msgid "The critical section API provides a deadlock avoidance layer on top of per-object locks for :term:`free-threaded ` CPython. They are intended to replace reliance on the :term:`global interpreter lock`, and are no-ops in versions of Python with the global interpreter lock." +msgid "" +"The critical section API provides a deadlock avoidance layer on top of per-" +"object locks for :term:`free-threaded ` CPython. They are " +"intended to replace reliance on the :term:`global interpreter lock`, and are" +" no-ops in versions of Python with the global interpreter lock." msgstr "" +"برای سی‌پایتونِ :term:`نخ‌آزاد `، API بخش بحرانی یک لایه‌ی " +"اجتناب از بن‌بست بر روی قفل‌های به‌ازای هر شیء فراهم می‌کند. آن‌ها در نظر " +"گرفته شده‌اند تا اتکا به :term:`قفل مفسر سراسری ` " +"را جایگزین کنند، و در نسخه‌های پایتونی که قفل مفسر سراسری را دارند، عملیات " +"بی‌اثر هستند." -msgid "Critical sections are intended to be used for custom types implemented in C-API extensions. They should generally not be used with built-in types like :class:`list` and :class:`dict` because their public C-APIs already use critical sections internally, with the notable exception of :c:func:`PyDict_Next`, which requires critical section to be acquired externally." -msgstr "" +msgid "" +"Critical sections are intended to be used for custom types implemented in " +"C-API extensions. They should generally not be used with built-in types like" +" :class:`list` and :class:`dict` because their public C-APIs already use " +"critical sections internally, with the notable exception of " +":c:func:`PyDict_Next`, which requires critical section to be acquired " +"externally." +msgstr "" +"بخش‌های بحرانی برای استفاده در نوع‌های سفارشی پیاده‌سازی‌شده در توسعه‌های " +"C-API در نظر گرفته شده‌اند. به‌طور کلی نباید از آن‌ها با نوع‌های توکار مانند" +" :class:`list` و :class:`dict` استفاده کرد، زیرا C-APIهای عمومی آن‌ها از پیش" +" به‌طور داخلی از بخش‌های بحرانی استفاده می‌کنند؛ با این استثنای قابل توجه که" +" :c:func:`PyDict_Next` برای آن باید بخش بحرانی از بیرون به دست گرفته شود." -msgid "Critical sections avoid deadlocks by implicitly suspending active critical sections, hence, they do not provide exclusive access such as provided by traditional locks like :c:type:`PyMutex`. When a critical section is started, the per-object lock for the object is acquired. If the code executed inside the critical section calls C-API functions then it can suspend the critical section thereby releasing the per-object lock, so other threads can acquire the per-object lock for the same object." -msgstr "" +msgid "" +"Critical sections avoid deadlocks by implicitly suspending active critical " +"sections, hence, they do not provide exclusive access such as provided by " +"traditional locks like :c:type:`PyMutex`. When a critical section is " +"started, the per-object lock for the object is acquired. If the code " +"executed inside the critical section calls C-API functions then it can " +"suspend the critical section thereby releasing the per-object lock, so other" +" threads can acquire the per-object lock for the same object." +msgstr "" +"بخش‌های بحرانی با تعلیق ضمنی بخش‌های بحرانی فعال از بن‌بست اجتناب می‌کنند؛ " +"از این رو، آن‌ها دسترسی انحصاری‌ای از نوع آنچه قفل‌های سنتی مانند " +":c:type:`PyMutex` فراهم می‌کنند را ارائه نمی‌دهند. هنگامی که یک بخش بحرانی " +"آغاز می‌شود، قفل هر شیء برای آن شیء به دست گرفته می‌شود. اگر کدی که درون بخش" +" بحرانی اجرا می‌شود توابع C-API را فراخوانی کند، می‌تواند بخش بحرانی را معلق" +" کند و بدین ترتیب قفل هر شیء را آزاد کند تا نخ‌های دیگر بتوانند قفل هر شیء " +"را برای همان شیء به دست آورند." -msgid "Variants that accept :c:type:`PyMutex` pointers rather than Python objects are also available. Use these variants to start a critical section in a situation where there is no :c:type:`PyObject` -- for example, when working with a C type that does not extend or wrap :c:type:`PyObject` but still needs to call into the C API in a manner that might lead to deadlocks." -msgstr "" +msgid "" +"Variants that accept :c:type:`PyMutex` pointers rather than Python objects " +"are also available. Use these variants to start a critical section in a " +"situation where there is no :c:type:`PyObject` -- for example, when working " +"with a C type that does not extend or wrap :c:type:`PyObject` but still " +"needs to call into the C API in a manner that might lead to deadlocks." +msgstr "" +"گونه‌هایی نیز موجود هستند که به‌جای اشیاء پایتون، اشاره‌گرهای " +":c:type:`PyMutex` را می‌پذیرند. از این گونه‌ها برای آغاز یک بخش بحرانی در " +"موقعیتی که :c:type:`PyObject` وجود ندارد استفاده کنید -- برای مثال، هنگام " +"کار با یک نوع C که :c:type:`PyObject` را بسط نمی‌دهد یا دربر نمی‌گیرد، اما " +"همچنان باید به شکلی که ممکن است به بن‌بست منجر شود، در API زبان C فراخوانی " +"انجام دهد." -msgid "The functions and structs used by the macros are exposed for cases where C macros are not available. They should only be used as in the given macro expansions. Note that the sizes and contents of the structures may change in future Python versions." +msgid "" +"The functions and structs used by the macros are exposed for cases where C " +"macros are not available. They should only be used as in the given macro " +"expansions. Note that the sizes and contents of the structures may change in" +" future Python versions." msgstr "" +"توابع و ساختارهایی که ماکروها از آن‌ها استفاده می‌کنند، برای مواردی که " +"ماکروهای C موجود نیستند، در دسترس قرار گرفته‌اند. از آن‌ها باید فقط مطابق با" +" بسط‌های داده‌شده‌ی ماکروها استفاده شود. توجه داشته باشید که اندازه و " +"محتویات ساختارها ممکن است در نسخه‌های آینده پایتون تغییر کنند." -msgid "Operations that need to lock two objects at once must use :c:macro:`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to lock more than one object at once, because the inner critical section may suspend the outer critical sections. This API does not provide a way to lock more than two objects at once." -msgstr "" +msgid "" +"Operations that need to lock two objects at once must use " +":c:macro:`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical " +"sections to lock more than one object at once, because the inner critical " +"section may suspend the outer critical sections. This API does not provide " +"a way to lock more than two objects at once." +msgstr "" +"عملیاتی که نیاز به قفل کردن دو شیء به‌طور همزمان دارند، باید از " +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` استفاده کنند. شما *نمی‌توانید* از " +"بخش‌های بحرانی تودرتو برای قفل کردن بیش از یک شیء به‌طور همزمان استفاده " +"کنید، زیرا بخش بحرانی داخلی ممکن است بخش‌های بحرانی خارجی را تعلیق کند. این" +" API راهی برای قفل کردن بیش از دو شیء به‌طور همزمان فراهم نمی‌کند." msgid "Example usage::" -msgstr "" +msgstr "مثال استفاده::" msgid "" "static PyObject *\n" @@ -83,136 +182,245 @@ msgid "" " Py_RETURN_NONE;\n" "}" msgstr "" +"static PyObject *\n" +"set_field(MyObject *self, PyObject *value)\n" +"{\n" +" Py_BEGIN_CRITICAL_SECTION(self);\n" +" Py_SETREF(self->field, Py_XNewRef(value));\n" +" Py_END_CRITICAL_SECTION();\n" +" Py_RETURN_NONE;\n" +"}" -msgid "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which can call arbitrary code through an object's deallocation function. The critical section API avoids potential deadlocks due to reentrancy and lock ordering by allowing the runtime to temporarily suspend the critical section if the code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`." -msgstr "" +msgid "" +"In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which" +" can call arbitrary code through an object's deallocation function. The " +"critical section API avoids potential deadlocks due to reentrancy and lock " +"ordering by allowing the runtime to temporarily suspend the critical section" +" if the code triggered by the finalizer blocks and calls " +":c:func:`PyEval_SaveThread`." +msgstr "" +"در مثال بالا، :c:macro:`Py_SETREF` :c:macro:`Py_DECREF` را فراخوانی می‌کند " +"که می‌تواند از طریق تابع آزادسازی یک شیء، کد دلخواهی را فراخوانی کند. API " +"بخش بحرانی با اجازه دادن به ران‌تایم تا در صورتی که کد راه‌اندازی‌شده توسط " +"نهایی‌ساز مسدود شود و :c:func:`PyEval_SaveThread` را فراخوانی کند، بخش " +"بحرانی را به‌طور موقت معلق کند، از بن‌بست‌های احتمالی ناشی از بازورودپذیری و" +" ترتیب قفل‌ها جلوگیری می‌کند." -msgid "Acquires the per-object lock for the object *op* and begins a critical section." +msgid "" +"Acquires the per-object lock for the object *op* and begins a critical " +"section." msgstr "" +"قفل مخصوص هر شیء را برای شیء *op* به دست می‌آورد و یک بخش بحرانی را آغاز " +"می‌کند." msgid "In the free-threaded build, this macro expands to::" -msgstr "" +msgstr "در بیلد نخ‌آزاد، این ماکرو به صورت زیر بسط می‌یابد::" msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" +"{\n" +" PyCriticalSection _py_cs;\n" +" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgid "In the default build, this macro expands to ``{``." -msgstr "" +msgstr "در بیلد پیش‌فرض، این ماکرو به ``{`` بسط داده می‌شود." msgid "Locks the mutex *m* and begins a critical section." -msgstr "" +msgstr "قفل متقابل *m* را قفل می‌کند و یک بخش بحرانی را آغاز می‌کند." msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_BeginMutex(&_py_cs, m)" msgstr "" +"{\n" +" PyCriticalSection _py_cs;\n" +" PyCriticalSection_BeginMutex(&_py_cs, m)" -msgid "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for the argument of the macro - it must be a :c:type:`PyMutex` pointer." +msgid "" +"Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for " +"the argument of the macro - it must be a :c:type:`PyMutex` pointer." msgstr "" +"توجه داشته باشید که برخلاف :c:macro:`Py_BEGIN_CRITICAL_SECTION`، برای " +"آرگومان این ماکرو هیچ قالب‌ریزی وجود ندارد؛ این آرگومان باید اشاره‌گری به " +":c:type:`PyMutex` باشد." msgid "On the default build, this macro expands to ``{``." -msgstr "" +msgstr "در ساخت پیش‌فرض، این ماکرو به ``{`` بسط می‌یابد." msgid "Ends the critical section and releases the per-object lock." -msgstr "" +msgstr "بخش بحرانی را به پایان می‌رساند و قفل به ازای هر شیء را آزاد می‌کند." msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" +" PyCriticalSection_End(&_py_cs);\n" +"}" msgid "In the default build, this macro expands to ``}``." -msgstr "" +msgstr "در بیلد پیش‌فرض، این ماکرو به ``}`` بسط می‌یابد." -msgid "Acquires the per-object locks for the objects *a* and *b* and begins a critical section. The locks are acquired in a consistent order (lowest address first) to avoid lock ordering deadlocks." +msgid "" +"Acquires the per-object locks for the objects *a* and *b* and begins a " +"critical section. The locks are acquired in a consistent order (lowest " +"address first) to avoid lock ordering deadlocks." msgstr "" +"قفل‌های به‌ازای هر شیء را برای اشیاء *a* و *b* به‌دست می‌گیرد و یک بخش " +"بحرانی را آغاز می‌کند. قفل‌ها با ترتیبی ثابت (ابتدا کمترین نشانی) به‌دست " +"گرفته می‌شوند تا از بن‌بست‌های ناشی از ترتیب قفل‌گیری جلوگیری شود." msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" +"{\n" +" PyCriticalSection2 _py_cs2;\n" +" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgid "Locks the mutexes *m1* and *m2* and begins a critical section." msgstr "" +"قفل‌های متقابل *m1* و *m2* را قفل می‌کند و یک بخش بحرانی را آغاز می‌کند." msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)" msgstr "" +"{\n" +" PyCriticalSection2 _py_cs2;\n" +" PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)" -msgid "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for the arguments of the macro - they must be :c:type:`PyMutex` pointers." +msgid "" +"Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for" +" the arguments of the macro - they must be :c:type:`PyMutex` pointers." msgstr "" +"توجه داشته باشید که برخلاف :c:macro:`Py_BEGIN_CRITICAL_SECTION2`، هیچ تبدیل " +"نوعی برای آرگومان‌های ماکرو انجام نمی‌شود — این آرگومان‌ها باید اشاره‌گرهای " +":c:type:`PyMutex` باشند." msgid "Ends the critical section and releases the per-object locks." -msgstr "" +msgstr "بخش بحرانی را به پایان می‌رساند و قفل‌های هر شیء را آزاد می‌کند." msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" msgstr "" +" PyCriticalSection2_End(&_py_cs2);\n" +"}" msgid "Legacy locking APIs" -msgstr "" +msgstr "API‌های قدیمی قفل‌گذاری" -msgid "These APIs are obsolete since Python 3.13 with the introduction of :c:type:`PyMutex`." -msgstr "" +msgid "" +"These APIs are obsolete since Python 3.13 with the introduction of " +":c:type:`PyMutex`." +msgstr "این API‌ها با معرفی :c:type:`PyMutex` در پایتون 3.13 منسوخ شده‌اند." msgid "A pointer to a mutual exclusion lock." -msgstr "" +msgstr "اشاره‌گری به قفل متقابل." msgid "The result of acquiring a lock with a timeout." -msgstr "" +msgstr "نتیجه‌ی به‌دست آوردن یک قفل با مهلت زمانی." msgid "Failed to acquire the lock." -msgstr "" +msgstr "به‌دست آوردن قفل ناموفق بود." msgid "The lock was successfully acquired." -msgstr "" +msgstr "قفل با موفقیت به دست آمد." msgid "The lock was interrupted by a signal." -msgstr "" +msgstr "قفل توسط یک سیگنال مختل شد." msgid "Allocate a new lock." -msgstr "" +msgstr "یک قفل جدید تخصیص می‌دهد." -msgid "On success, this function returns a lock; on failure, this function returns ``0`` without an exception set." +msgid "" +"On success, this function returns a lock; on failure, this function returns " +"``0`` without an exception set." msgstr "" +"در صورت موفقیت، این تابع یک قفل برمی‌گرداند؛ در صورت شکست، این تابع ``0`` را" +" بدون تنظیم استثنا برمی‌گرداند." msgid "The caller does not need to hold an :term:`attached thread state`." msgstr "" +"فراخواننده نیازی به در اختیار داشتن :term:`وضعیت نخ متصل ` ندارد." -msgid "Destroy *lock*. The lock should not be held by any thread when calling this." +msgid "" +"Destroy *lock*. The lock should not be held by any thread when calling this." msgstr "" +"قفل *lock* را از بین می‌برد. هنگام فراخوانی این تابع، قفل نباید در اختیار " +"هیچ نخی باشد." msgid "Acquire *lock* with a timeout." -msgstr "" +msgstr "به‌دست آوردن *قفل* با مهلت زمانی." -msgid "This will wait for *microseconds* microseconds to acquire the lock. If the timeout expires, this function returns :c:enumerator:`PY_LOCK_FAILURE`. If *microseconds* is ``-1``, this will wait indefinitely until the lock has been released." +msgid "" +"This will wait for *microseconds* microseconds to acquire the lock. If the " +"timeout expires, this function returns :c:enumerator:`PY_LOCK_FAILURE`. If " +"*microseconds* is ``-1``, this will wait indefinitely until the lock has " +"been released." msgstr "" +"این تابع برای به‌دست آوردن قفل به مدت *microseconds* میکروثانیه منتظر " +"می‌ماند. اگر مهلت زمانی به پایان برسد، این تابع " +":c:enumerator:`PY_LOCK_FAILURE` را برمی‌گرداند. اگر *microseconds* برابر " +"``-1`` باشد، این تابع به‌طور نامحدود تا زمانی که قفل آزاد شود منتظر می‌ماند." -msgid "If *intr_flag* is ``1``, acquiring the lock may be interrupted by a signal, in which case this function returns :c:enumerator:`PY_LOCK_INTR`. Upon interruption, it's generally expected that the caller makes a call to :c:func:`Py_MakePendingCalls` to propagate an exception to Python code." +msgid "" +"If *intr_flag* is ``1``, acquiring the lock may be interrupted by a signal, " +"in which case this function returns :c:enumerator:`PY_LOCK_INTR`. Upon " +"interruption, it's generally expected that the caller makes a call to " +":c:func:`Py_MakePendingCalls` to propagate an exception to Python code." msgstr "" +"اگر *intr_flag* برابر ``1`` باشد، ممکن است به‌دست‌آوردن قفل توسط یک سیگنال " +"مختل شود که در این صورت این تابع :c:enumerator:`PY_LOCK_INTR` را " +"برمی‌گرداند. پس از وقوع اختلال، معمولاً انتظار می‌رود که فراخواننده " +":c:func:`Py_MakePendingCalls` را فراخوانی کند تا استثنی را به کد پایتون " +"منتشر کند." -msgid "If the lock is successfully acquired, this function returns :c:enumerator:`PY_LOCK_ACQUIRED`." +msgid "" +"If the lock is successfully acquired, this function returns " +":c:enumerator:`PY_LOCK_ACQUIRED`." msgstr "" +"اگر قفل با موفقیت به دست آید، این تابع :c:enumerator:`PY_LOCK_ACQUIRED` را " +"برمی‌گرداند." msgid "Acquire *lock*." -msgstr "" +msgstr "*lock* را به دست بگیرید." -msgid "If *waitflag* is ``1`` and another thread currently holds the lock, this function will wait until the lock can be acquired and will always return ``1``." +msgid "" +"If *waitflag* is ``1`` and another thread currently holds the lock, this " +"function will wait until the lock can be acquired and will always return " +"``1``." msgstr "" +"اگر *waitflag* برابر ``1`` باشد و در حال حاضر نخ دیگری قفل را در اختیار " +"داشته باشد، این تابع تا زمانی که بتوان قفل را به دست آورد منتظر می‌ماند و " +"همیشه ``1`` را برمی‌گرداند." -msgid "If *waitflag* is ``0`` and another thread holds the lock, this function will not wait and instead return ``0``. If the lock is not held by any other thread, then this function will acquire it and return ``1``." +msgid "" +"If *waitflag* is ``0`` and another thread holds the lock, this function will" +" not wait and instead return ``0``. If the lock is not held by any other " +"thread, then this function will acquire it and return ``1``." msgstr "" +"اگر *waitflag* برابر ``0`` باشد و نخ دیگری قفل را در اختیار داشته باشد، این " +"تابع منتظر نمی‌ماند و در عوض ``0`` را برمی‌گرداند. اگر هیچ نخ دیگری قفل را " +"در اختیار نداشته باشد، این تابع آن را به دست می‌آورد و ``1`` را برمی‌گرداند." -msgid "Unlike :c:func:`PyThread_acquire_lock_timed`, acquiring the lock cannot be interrupted by a signal." +msgid "" +"Unlike :c:func:`PyThread_acquire_lock_timed`, acquiring the lock cannot be " +"interrupted by a signal." msgstr "" +"برخلاف :c:func:`PyThread_acquire_lock_timed`، به‌دست‌آوردن قفل نمی‌تواند " +"توسط سیگنال مختل شود." -msgid "Release *lock*. If *lock* is not held, then this function issues a fatal error." +msgid "" +"Release *lock*. If *lock* is not held, then this function issues a fatal " +"error." msgstr "" +"*lock* را آزاد می‌کند. اگر *lock* نگه داشته نشده باشد، این تابع خطای مهلک " +"صادر می‌کند." diff --git a/c-api/sys.po b/c-api/sys.po index c78f1f1f6..8cfe76561 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -22,262 +22,690 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Operating System Utilities" -msgstr "" +msgstr "ابزارهای سیستم‌عامل" -msgid "Return the file system representation for *path*. If the object is a :class:`str` or :class:`bytes` object, then a new :term:`strong reference` is returned. If the object implements the :class:`os.PathLike` interface, then :meth:`~os.PathLike.__fspath__` is returned as long as it is a :class:`str` or :class:`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` is returned." -msgstr "" +msgid "" +"Return the file system representation for *path*. If the object is a " +":class:`str` or :class:`bytes` object, then a new :term:`strong reference` " +"is returned. If the object implements the :class:`os.PathLike` interface, " +"then :meth:`~os.PathLike.__fspath__` is returned as long as it is a " +":class:`str` or :class:`bytes` object. Otherwise :exc:`TypeError` is raised " +"and ``NULL`` is returned." +msgstr "" +"نمایش فایل‌سیستم برای *path* را برمی‌گرداند. اگر شیء از نوع :class:`str` یا " +":class:`bytes` باشد، یک :term:`ارجاع قوی ` جدید برگردانده " +"می‌شود. اگر شیء رابط :class:`os.PathLike` را پیاده‌سازی کند، " +":meth:`~os.PathLike.__fspath__` به شرط آن‌که یک شیء :class:`str` یا " +":class:`bytes` باشد، برگردانده می‌شود. در غیر این صورت، استثنای " +":exc:`TypeError` برداشته می‌شود و ``NULL`` برگردانده می‌شود." -msgid "Return true (nonzero) if the standard I/O file *fp* with name *filename* is deemed interactive. This is the case for files for which ``isatty(fileno(fp))`` is true. If the :c:member:`PyConfig.interactive` is non-zero, this function also returns true if the *filename* pointer is ``NULL`` or if the name is equal to one of the strings ``''`` or ``'???'``." -msgstr "" +msgid "" +"Return true (nonzero) if the standard I/O file *fp* with name *filename* is " +"deemed interactive. This is the case for files for which " +"``isatty(fileno(fp))`` is true. If the :c:member:`PyConfig.interactive` is " +"non-zero, this function also returns true if the *filename* pointer is " +"``NULL`` or if the name is equal to one of the strings ``''`` or " +"``'???'``." +msgstr "" +"اگر پرونده‌ی ورودی/خروجی استاندارد *fp* با نام *filename* تعاملی در نظر " +"گرفته شود، مقدار true (غیرصفر) برمی‌گرداند. این حالت برای پرونده‌هایی که " +"``isatty(fileno(fp))`` در آن‌ها true است، برقرار است. اگر " +":c:member:`PyConfig.interactive` غیرصفر باشد، این تابع همچنین در صورتی که " +"اشاره‌گر *filename* برابر ``NULL`` باشد یا نام برابر با یکی از رشته‌های " +"``''`` یا ``'???'`` باشد، مقدار true برمی‌گرداند." msgid "This function must not be called before Python is initialized." -msgstr "" +msgstr "این تابع نباید پیش از مقداردهی اولیه پایتون فراخوانی شود." -msgid "Function to prepare some internal state before a process fork. This should be called before calling :c:func:`fork` or any similar function that clones the current process. Only available on systems where :c:func:`fork` is defined." +msgid "" +"Function to prepare some internal state before a process fork. This should " +"be called before calling :c:func:`fork` or any similar function that clones " +"the current process. Only available on systems where :c:func:`fork` is " +"defined." msgstr "" +"تابعی برای آماده‌سازی برخی وضعیت‌های داخلی پیش از انشعاب فرایند. این تابع " +"باید پیش از فراخوانی :c:func:`fork` یا هر تابع مشابه‌ای که از فرایند فعلی " +"رونوشت می‌گیرد، فراخوانی شود. تنها در سیستم‌هایی که :c:func:`fork` در آن‌ها " +"تعریف شده است در دسترس است." -msgid "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread" +" ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" +"فراخوانی :c:func:`fork` در C باید فقط از :ref:`نخِ «اصلی» ` (از :ref:`مفسرِ «اصلی» `) انجام شود. همین" +" موضوع برای ``PyOS_BeforeFork()`` نیز صادق است." -msgid "Function to update some internal state after a process fork. This should be called from the parent process after calling :c:func:`fork` or any similar function that clones the current process, regardless of whether process cloning was successful. Only available on systems where :c:func:`fork` is defined." -msgstr "" +msgid "" +"Function to update some internal state after a process fork. This should be" +" called from the parent process after calling :c:func:`fork` or any similar " +"function that clones the current process, regardless of whether process " +"cloning was successful. Only available on systems where :c:func:`fork` is " +"defined." +msgstr "" +"تابعی برای به‌روزرسانی برخی از وضعیت‌های داخلی پس از انشعاب فرایند. این تابع" +" باید از فرایند والد، پس از فراخوانی :c:func:`fork` یا هر تابع مشابه‌ای که " +"از فرایند فعلی رونوشت می‌گیرد، فراخوانی شود؛ صرف‌نظر از اینکه رونوشت‌گیری " +"فرایند موفق بوده است یا خیر. تنها روی سیستم‌هایی که :c:func:`fork` در آن‌ها " +"تعریف شده است در دسترس است." -msgid "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread" +" ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" +"فراخوانی :c:func:`fork` در C باید تنها از :ref:`نخ «اصلی» ` (از :ref:`مفسر «اصلی» `) انجام شود. همین " +"امر برای ``PyOS_AfterFork_Parent()`` نیز صادق است." -msgid "Function to update internal interpreter state after a process fork. This must be called from the child process after calling :c:func:`fork`, or any similar function that clones the current process, if there is any chance the process will call back into the Python interpreter. Only available on systems where :c:func:`fork` is defined." -msgstr "" +msgid "" +"Function to update internal interpreter state after a process fork. This " +"must be called from the child process after calling :c:func:`fork`, or any " +"similar function that clones the current process, if there is any chance the" +" process will call back into the Python interpreter. Only available on " +"systems where :c:func:`fork` is defined." +msgstr "" +"تابعی برای به‌روزرسانی وضعیت داخلی مفسر پس از انشعاب یک فرایند. این تابع " +"باید از فرایند فرزند پس از فراخوانی :c:func:`fork` یا هر تابع مشابه‌ای که " +"فرایند فعلی را رونوشت می‌کند، فراخوانی شود، اگر احتمالی وجود داشته باشد که " +"فرایند دوباره مفسر پایتون را فراخوانی کند. این تابع فقط در سیستم‌هایی که " +":c:func:`fork` در آن‌ها تعریف شده است دسترس‌پذیر است." -msgid "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." +msgid "" +"The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread" +" ` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" +"فراخوانی :c:func:`fork` در C باید فقط از :ref:`نخ «اصلی» `" +" (از :ref:`مفسر «اصلی» `) انجام شود. همین امر برای " +"``PyOS_AfterFork_Child()`` نیز صادق است." -msgid ":func:`os.register_at_fork` allows registering custom Python functions to be called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." +msgid "" +":func:`os.register_at_fork` allows registering custom Python functions to be" +" called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and" +" :c:func:`PyOS_AfterFork_Child`." msgstr "" +":func:`os.register_at_fork` اجازه می‌دهد توابع سفارشی پایتون را ثبت کنید تا " +"توسط :c:func:`PyOS_BeforeFork()`، :c:func:`PyOS_AfterFork_Parent` و " +":c:func:`PyOS_AfterFork_Child` فراخوانی شوند." -msgid "Function to update some internal state after a process fork; this should be called in the new process if the Python interpreter will continue to be used. If a new executable is loaded into the new process, this function does not need to be called." +msgid "" +"Function to update some internal state after a process fork; this should be " +"called in the new process if the Python interpreter will continue to be " +"used. If a new executable is loaded into the new process, this function does" +" not need to be called." msgstr "" +"تابعی برای به‌روزرسانی برخی از وضعیت‌های داخلی پس از انشعاب فرایند؛ اگر قرار" +" باشد مفسر پایتون همچنان استفاده شود، این تابع باید در فرایند جدید فراخوانی " +"شود. اگر یک فایل اجرایی جدید در فرایند جدید بارگذاری شود، نیازی به فراخوانی " +"این تابع نیست." msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." -msgstr "" +msgstr "این تابع توسط :c:func:`PyOS_AfterFork_Child()` جایگزین شده است." -msgid "Return true when the interpreter runs out of stack space. This is a reliable check, but is only available when :c:macro:`!USE_STACKCHECK` is defined (currently on certain versions of Windows using the Microsoft Visual C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; you should never change the definition in your own code." -msgstr "" +msgid "" +"Return true when the interpreter runs out of stack space. This is a " +"reliable check, but is only available when :c:macro:`!USE_STACKCHECK` is " +"defined (currently on certain versions of Windows using the Microsoft Visual" +" C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; " +"you should never change the definition in your own code." +msgstr "" +"وقتی فضای پشته‌ی مفسر تمام شود، مقدار true را برمی‌گرداند. این یک بررسی قابل" +" اعتماد است، اما تنها زمانی در دسترس است که :c:macro:`!USE_STACKCHECK` تعریف" +" شده باشد (در حال حاضر در نسخه‌هایی از ویندوز که از کامپایلر Microsoft " +"Visual C++ استفاده می‌کنند). :c:macro:`!USE_STACKCHECK` به‌صورت خودکار تعریف" +" می‌شود؛ شما هرگز نباید این تعریف را در کد خودتان تغییر دهید." -msgid "Return the current signal handler for signal *i*. This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those functions directly!" +msgid "" +"Return the current signal handler for signal *i*. This is a thin wrapper " +"around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " +"functions directly!" msgstr "" +"هندلر فعلی سیگنال *i* را برمی‌گرداند. این تابع پوششی نازک حول " +":c:func:`!sigaction` یا :c:func:`!signal` است. این توابع را مستقیماً " +"فراخوانی نکنید!" -msgid "Set the signal handler for signal *i* to be *h*; return the old signal handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those functions directly!" +msgid "" +"Set the signal handler for signal *i* to be *h*; return the old signal " +"handler. This is a thin wrapper around either :c:func:`!sigaction` or " +":c:func:`!signal`. Do not call those functions directly!" msgstr "" +"هندلر سیگنال مربوط به سیگنال *i* را به *h* تنظیم می‌کند؛ هندلر سیگنال قدیمی " +"را برمی‌گرداند. این تابع یک پوشش نازک حول :c:func:`!sigaction` یا " +":c:func:`!signal` است. آن توابع را مستقیماً فراخوانی نکنید!" msgid "Check if a :c:macro:`!SIGINT` signal has been received." -msgstr "" +msgstr "بررسی می‌کند که آیا سیگنال :c:macro:`!SIGINT` دریافت شده است یا خیر." -msgid "Returns ``1`` if a :c:macro:`!SIGINT` has occurred and clears the signal flag, or ``0`` otherwise." +msgid "" +"Returns ``1`` if a :c:macro:`!SIGINT` has occurred and clears the signal " +"flag, or ``0`` otherwise." msgstr "" +"اگر سیگنال :c:macro:`!SIGINT` رخ داده باشد، ``1`` را برمی‌گرداند و پرچم " +"سیگنال را پاک می‌کند؛ در غیر این صورت ``0``." -msgid "In most cases, you should prefer :c:func:`PyErr_CheckSignals` over this function. :c:func:`!PyErr_CheckSignals` invokes the appropriate signal handlers for all pending signals, allowing Python code to handle the signal properly. This function only detects :c:macro:`!SIGINT` and does not invoke any Python signal handlers." -msgstr "" +msgid "" +"In most cases, you should prefer :c:func:`PyErr_CheckSignals` over this " +"function. :c:func:`!PyErr_CheckSignals` invokes the appropriate signal " +"handlers for all pending signals, allowing Python code to handle the signal " +"properly. This function only detects :c:macro:`!SIGINT` and does not invoke " +"any Python signal handlers." +msgstr "" +"در بیشتر موارد، بهتر است به‌جای این تابع از :c:func:`PyErr_CheckSignals` " +"استفاده کنید. :c:func:`!PyErr_CheckSignals` هندلرهای مناسب سیگنال را برای " +"همه‌ی سیگنال‌های در انتظار فراخوانی می‌کند و به کد پایتون اجازه می‌دهد " +"سیگنال را به‌درستی مدیریت کند. این تابع فقط :c:macro:`!SIGINT` را تشخیص " +"می‌دهد و هیچ‌یک از هندلرهای سیگنال پایتون را فراخوانی نمی‌کند." -msgid "This function is async-signal-safe and this function cannot fail. The caller must hold an :term:`attached thread state`." +msgid "" +"This function is async-signal-safe and this function cannot fail. The caller" +" must hold an :term:`attached thread state`." msgstr "" +"این تابع نسبت به سیگنال‌های نا‌همگام ایمن (async-signal-safe) است و " +"نمی‌تواند شکست بخورد. فراخوان‌کننده باید یک :term:`attached thread state` را" +" در اختیار داشته باشد." -msgid "This function should not be called directly: use the :c:type:`PyConfig` API with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:`Python is preinitialized `." +msgid "" +"This function should not be called directly: use the :c:type:`PyConfig` API " +"with the :c:func:`PyConfig_SetBytesString` function which ensures that " +":ref:`Python is preinitialized `." msgstr "" +"این تابع نباید مستقیماً فراخوانی شود: از API :c:type:`PyConfig` به همراه " +"تابع :c:func:`PyConfig_SetBytesString` استفاده کنید که تضمین می‌کند " +":ref:`پایتون از پیش مقداردهی اولیه شده است `." -msgid "This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:func:`Py_PreInitialize` function." +msgid "" +"This function must not be called before :ref:`Python is preinitialized " +"` and so that the LC_CTYPE locale is properly configured: see the" +" :c:func:`Py_PreInitialize` function." msgstr "" +"این تابع نباید پیش از :ref:`پیش‌مقداردهی اولیه پایتون ` و پیش از " +"پیکربندی درست locale مربوط به LC_CTYPE فراخوانی شود: تابع " +":c:func:`Py_PreInitialize` را ببینید." -msgid "Decode a byte string from the :term:`filesystem encoding and error handler`. If the error handler is :ref:`surrogateescape error handler `, undecodable bytes are decoded as characters in range U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate character, the bytes are escaped using the surrogateescape error handler instead of decoding them." -msgstr "" +msgid "" +"Decode a byte string from the :term:`filesystem encoding and error handler`." +" If the error handler is :ref:`surrogateescape error handler " +"`, undecodable bytes are decoded as characters in range " +"U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " +"character, the bytes are escaped using the surrogateescape error handler " +"instead of decoding them." +msgstr "" +"یک رشته بایتی را از :term:`کدگذاری و هندلر خطای فایل‌سیستم ` کدگشایی می‌کند. اگر هندلر خطا :ref:`هندلر خطای " +"surrogateescape ` باشد، بایت‌های کدگشایی‌ناپذیر به‌عنوان " +"نویسه‌هایی در بازه U+DC80..U+DCFF کدگشایی می‌شوند؛ و اگر بتوان دنباله‌ای از " +"بایت‌ها را به‌عنوان یک نویسه جانشین کدگشایی کرد، بایت‌ها به‌جای کدگشایی‌شدن،" +" با استفاده از هندلر خطای surrogateescape خنثی می‌شوند." -msgid "Return a pointer to a newly allocated wide character string, use :c:func:`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the number of wide characters excluding the null character into ``*size``" +msgid "" +"Return a pointer to a newly allocated wide character string, use " +":c:func:`PyMem_RawFree` to free the memory. If size is not ``NULL``, write " +"the number of wide characters excluding the null character into ``*size``" msgstr "" +"یک اشاره‌گر به رشته نویسه پهنِ تازه تخصیص‌یافته برمی‌گرداند؛ برای آزاد کردن " +"حافظه از :c:func:`PyMem_RawFree` استفاده کنید. اگر size برابر ``NULL`` " +"نباشد، تعداد نویسه‌های پهن را بدون احتساب نویسه تهی در ``*size`` می‌نویسد." -msgid "Return ``NULL`` on decoding error or memory allocation error. If *size* is not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to ``(size_t)-2`` on decoding error." +msgid "" +"Return ``NULL`` on decoding error or memory allocation error. If *size* is " +"not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " +"``(size_t)-2`` on decoding error." msgstr "" +"در صورت خطای کدگشایی یا خطای تخصیص حافظه، ``NULL`` را برمی‌گرداند. اگر " +"*size* برابر ``NULL`` نباشد، ``*size`` در خطای حافظه به ``(size_t)-1`` و در " +"خطای کدگشایی به ``(size_t)-2`` تنظیم می‌شود." -msgid "The :term:`filesystem encoding and error handler` are selected by :c:func:`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +msgid "" +"The :term:`filesystem encoding and error handler` are selected by " +":c:func:`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and " +":c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" +":term:`filesystem encoding and error handler` توسط :c:func:`PyConfig_Read` " +"انتخاب می‌شوند: به اعضای :c:member:`~PyConfig.filesystem_encoding` و " +":c:member:`~PyConfig.filesystem_errors` از :c:type:`PyConfig` مراجعه کنید." -msgid "Decoding errors should never happen, unless there is a bug in the C library." +msgid "" +"Decoding errors should never happen, unless there is a bug in the C library." msgstr "" +"خطاهای کدگشایی هرگز نباید رخ دهند، مگر اینکه اشکالی در کتابخانه C وجود داشته" +" باشد." -msgid "Use the :c:func:`Py_EncodeLocale` function to encode the character string back to a byte string." +msgid "" +"Use the :c:func:`Py_EncodeLocale` function to encode the character string " +"back to a byte string." msgstr "" +"برای کدگذاری رشته‌ی نویسه‌ها و بازگرداندن آن به یک رشته بایتی، از تابع " +":c:func:`Py_EncodeLocale` استفاده کنید." -msgid "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:`PyUnicode_DecodeLocaleAndSize` functions." +msgid "" +"The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and " +":c:func:`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" +"توابع :c:func:`PyUnicode_DecodeFSDefaultAndSize` و " +":c:func:`PyUnicode_DecodeLocaleAndSize`." -msgid "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode `." +msgid "" +"The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " +"`." msgstr "" +"این تابع اکنون در :ref:`حالت UTF-8 پایتون ` از کدگذاری UTF-8 " +"استفاده می‌کند." -msgid "The function now uses the UTF-8 encoding on Windows if :c:member:`PyPreConfig.legacy_windows_fs_encoding` is zero;" +msgid "" +"The function now uses the UTF-8 encoding on Windows if " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" +"اگر :c:member:`PyPreConfig.legacy_windows_fs_encoding` صفر باشد، این تابع " +"اکنون در ویندوز از کدگذاری UTF-8 استفاده می‌کند؛" -msgid "Encode a wide character string to the :term:`filesystem encoding and error handler`. If the error handler is :ref:`surrogateescape error handler `, surrogate characters in the range U+DC80..U+DCFF are converted to bytes 0x80..0xFF." +msgid "" +"Encode a wide character string to the :term:`filesystem encoding and error " +"handler`. If the error handler is :ref:`surrogateescape error handler " +"`, surrogate characters in the range U+DC80..U+DCFF are " +"converted to bytes 0x80..0xFF." msgstr "" +"یک رشته‌ی نویسه پهن را با :term:`کدگذاری فایل‌سیستم و هندلر خطا ` کدگذاری می‌کند. اگر هندلر خطا :ref:`هندلر خطای " +"surrogateescape ` باشد، نویسه‌های جانشین در بازه‌ی " +"U+DC80..U+DCFF به بایت‌های 0x80..0xFF تبدیل می‌شوند." -msgid "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` to free the memory. Return ``NULL`` on encoding error or memory allocation error." +msgid "" +"Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " +"to free the memory. Return ``NULL`` on encoding error or memory allocation " +"error." msgstr "" +"یک اشاره‌گر به رشته بایتی تازه تخصیص‌یافته را برمی‌گرداند؛ برای آزاد کردن " +"حافظه از :c:func:`PyMem_Free` استفاده کنید. در صورت خطای کدگذاری یا خطای " +"تخصیص حافظه، ``NULL`` برمی‌گرداند." -msgid "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on success, or set to the index of the invalid character on encoding error." +msgid "" +"If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " +"success, or set to the index of the invalid character on encoding error." msgstr "" +"اگر error_pos برابر ``NULL`` نباشد، ``*error_pos`` در صورت موفقیت به " +"``(size_t)-1`` و در صورت وقوع خطای کدگذاری به اندیس نویسه نامعتبر تنظیم " +"می‌شود." -msgid "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back to a wide character string." +msgid "" +"Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " +"to a wide character string." msgstr "" +"از تابع :c:func:`Py_DecodeLocale` برای کدگشایی رشته بایتی و بازگرداندن آن به" +" یک رشته نویسه پهن استفاده کنید." -msgid "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` functions." +msgid "" +"The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale`" +" functions." msgstr "" +"توابع :c:func:`PyUnicode_EncodeFSDefault` و " +":c:func:`PyUnicode_EncodeLocale`." -msgid "The function now uses the UTF-8 encoding on Windows if :c:member:`PyPreConfig.legacy_windows_fs_encoding` is zero." +msgid "" +"The function now uses the UTF-8 encoding on Windows if " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` is zero." msgstr "" +"اگر :c:member:`PyPreConfig.legacy_windows_fs_encoding` صفر باشد، این تابع " +"اکنون در ویندوز از کدگذاری UTF-8 استفاده می‌کند." -msgid "Similar to :c:func:`!fopen`, but *path* is a Python object and an exception is set on error." +msgid "" +"Similar to :c:func:`!fopen`, but *path* is a Python object and an exception " +"is set on error." msgstr "" +"مشابه :c:func:`!fopen` است، اما *path* یک شیء پایتون است و در صورت خطا یک " +"استثنا تنظیم می‌شود." -msgid "*path* must be a :class:`str` object, a :class:`bytes` object, or a :term:`path-like object`." +msgid "" +"*path* must be a :class:`str` object, a :class:`bytes` object, or a " +":term:`path-like object`." msgstr "" +"*path* باید یک شیء :class:`str`، یک شیء :class:`bytes` یا یک :term:`شیء " +"شبه‌مسیر ` باشد." -msgid "On success, return the new file pointer. On error, set an exception and return ``NULL``." +msgid "" +"On success, return the new file pointer. On error, set an exception and " +"return ``NULL``." msgstr "" +"در صورت موفقیت، اشاره‌گر جدید پرونده را برمی‌گرداند. در صورت خطا، یک استثنا " +"تنظیم کرده و ``NULL`` را برمی‌گرداند." -msgid "The file must be closed by :c:func:`Py_fclose` rather than calling directly :c:func:`!fclose`." +msgid "" +"The file must be closed by :c:func:`Py_fclose` rather than calling directly " +":c:func:`!fclose`." msgstr "" +"پرونده باید توسط :c:func:`Py_fclose` بسته شود، نه با فراخوانی مستقیم " +":c:func:`!fclose`." msgid "The file descriptor is created non-inheritable (:pep:`446`)." -msgstr "" +msgstr "توصیف‌گر پرونده به‌صورت غیرقابل ارث‌بری ایجاد می‌شود (:pep:`446`)." msgid "The caller must have an :term:`attached thread state`." -msgstr "" +msgstr "فراخواننده باید :term:`attached thread state` داشته باشد." msgid "Close a file that was opened by :c:func:`Py_fopen`." -msgstr "" +msgstr "بستن پرونده‌ای که با :c:func:`Py_fopen` باز شده است." -msgid "On success, return ``0``. On error, return ``EOF`` and ``errno`` is set to indicate the error. In either case, any further access (including another call to :c:func:`Py_fclose`) to the stream results in undefined behavior." +msgid "" +"On success, return ``0``. On error, return ``EOF`` and ``errno`` is set to " +"indicate the error. In either case, any further access (including another " +"call to :c:func:`Py_fclose`) to the stream results in undefined behavior." msgstr "" +"در صورت موفقیت، ``0`` را برمی‌گرداند. در صورت خطا، ``EOF`` را برمی‌گرداند و " +"``errno`` برای نشان دادن خطا تنظیم می‌شود. در هر دو حالت، هر دسترسی بعدی (از" +" جمله فراخوانی مجدد :c:func:`Py_fclose`) به جریان، منجر به رفتار تعریف‌نشده " +"می‌شود." msgid "System Functions" -msgstr "" +msgstr "توابع سیستمی" -msgid "These are utility functions that make functionality from the :mod:`sys` module accessible to C code. They all work with the current interpreter thread's :mod:`sys` module's dict, which is contained in the internal thread state structure." +msgid "" +"These are utility functions that make functionality from the :mod:`sys` " +"module accessible to C code. They all work with the current interpreter " +"thread's :mod:`sys` module's dict, which is contained in the internal thread" +" state structure." msgstr "" +"این‌ها توابع کاربردی هستند که کارکردهای ماژول :mod:`sys` را برای کد C در " +"دسترس قرار می‌دهند. همه‌ی آن‌ها با دیکشنری ماژول :mod:`sys` مربوط به نخ فعلی" +" مفسر کار می‌کنند که در ساختار وضعیت داخلی نخ قرار دارد." -msgid "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does not exist, without setting an exception." +msgid "" +"Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " +"not exist, without setting an exception." msgstr "" +"شیء *name* را از ماژول :mod:`sys` بازمی‌گرداند، یا اگر وجود نداشته باشد " +"``NULL`` را برمی‌گرداند، بدون تنظیم استثنا." -msgid "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` on error." +msgid "" +"Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " +"case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``" +" on error." msgstr "" +"*name* را در ماژول :mod:`sys` برابر *v* قرار می‌دهد، مگر اینکه *v* ``NULL`` " +"باشد که در این صورت *name* از ماژول sys حذف می‌شود. در صورت موفقیت ``0`` و " +"در صورت خطا ``-1`` برمی‌گرداند." -msgid "Reset :data:`sys.warnoptions` to an empty list. This function may be called prior to :c:func:`Py_Initialize`." +msgid "" +"Reset :data:`sys.warnoptions` to an empty list. This function may be called " +"prior to :c:func:`Py_Initialize`." msgstr "" +"بازنشانی :data:`sys.warnoptions` به یک فهرست خالی. این تابع می‌تواند پیش از " +":c:func:`Py_Initialize` فراخوانی شود." msgid "Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." msgstr "" +"به جای آن، :data:`sys.warnoptions` و :data:`!warnings.filters` را پاک کنید." -msgid "Write the output string described by *format* to :data:`sys.stdout`. No exceptions are raised, even if truncation occurs (see below)." +msgid "" +"Write the output string described by *format* to :data:`sys.stdout`. No " +"exceptions are raised, even if truncation occurs (see below)." msgstr "" +"رشته خروجی توصیف‌شده توسط *format* را در :data:`sys.stdout` می‌نویسد. هیچ " +"استثنایی به‌وجود نمی‌آید، حتی اگر برش رخ دهد (در ادامه ببینید)." -msgid "*format* should limit the total size of the formatted output string to 1000 bytes or less -- after 1000 bytes, the output string is truncated. In particular, this means that no unrestricted \"%s\" formats should occur; these should be limited using \"%.s\" where is a decimal number calculated so that plus the maximum size of other formatted text does not exceed 1000 bytes. Also watch out for \"%f\", which can print hundreds of digits for very large numbers." -msgstr "" +msgid "" +"*format* should limit the total size of the formatted output string to 1000 " +"bytes or less -- after 1000 bytes, the output string is truncated. In " +"particular, this means that no unrestricted \"%s\" formats should occur; " +"these should be limited using \"%.s\" where is a decimal number " +"calculated so that plus the maximum size of other formatted text does " +"not exceed 1000 bytes. Also watch out for \"%f\", which can print hundreds " +"of digits for very large numbers." +msgstr "" +"*format* باید اندازه‌ی کل رشته‌ی خروجی قالب‌بندی‌شده را به ۱۰۰۰ بایت یا کمتر" +" محدود کند -- پس از ۱۰۰۰ بایت، رشته‌ی خروجی بریده می‌شود. به‌طور خاص، این " +"بدان معناست که نباید هیچ قالب \"%s\" بدون محدودیت وجود داشته باشد؛ این " +"قالب‌ها باید با استفاده از \"%.s\" محدود شوند که در آن عددی دهدهی است" +" که به‌گونه‌ای محاسبه می‌شود که به‌علاوه‌ی حداکثر اندازه‌ی سایر متن‌های " +"قالب‌بندی‌شده از ۱۰۰۰ بایت بیشتر نشود. همچنین مراقب \"%f\" باشید که می‌تواند" +" برای اعداد بسیار بزرگ صدها رقم چاپ کند." -msgid "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message is written to the real (C level) *stdout*." +msgid "" +"If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " +"is written to the real (C level) *stdout*." msgstr "" +"اگر مشکلی رخ دهد یا :data:`sys.stdout` تنظیم نشده باشد، پیام قالب‌بندی‌شده " +"به *stdout* واقعی (در سطح C) نوشته می‌شود." -msgid "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* instead." +msgid "" +"As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " +"instead." msgstr "" +"مانند :c:func:`PySys_WriteStdout` است، اما به جای آن به :data:`sys.stderr` " +"یا *stderr* می‌نویسد." -msgid "Function similar to PySys_WriteStdout() but format the message using :c:func:`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary length." +msgid "" +"Function similar to PySys_WriteStdout() but format the message using " +":c:func:`PyUnicode_FromFormatV` and don't truncate the message to an " +"arbitrary length." msgstr "" +"تابعی مشابه PySys_WriteStdout() است، اما پیام را با استفاده از " +":c:func:`PyUnicode_FromFormatV` قالب‌بندی می‌کند و پیام را به طولی دلخواه " +"کوتاه نمی‌کند." -msgid "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* instead." +msgid "" +"As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr*" +" instead." msgstr "" +"مانند :c:func:`PySys_FormatStdout`، اما به‌جای آن به :data:`sys.stderr` یا " +"*stderr* می‌نویسد." -msgid "Return the current dictionary of :option:`-X` options, similarly to :data:`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." +msgid "" +"Return the current dictionary of :option:`-X` options, similarly to " +":data:`sys._xoptions`. On error, ``NULL`` is returned and an exception is " +"set." msgstr "" +"دیکشنری فعلی گزینه‌های :option:`-X` را برمی‌گرداند، مشابه " +":data:`sys._xoptions`. در صورت خطا، ``NULL`` برگردانده می‌شود و یک استثنا " +"تنظیم می‌شود." -msgid "Raise an auditing event with any active hooks. Return zero for success and non-zero with an exception set on failure." +msgid "" +"Raise an auditing event with any active hooks. Return zero for success and " +"non-zero with an exception set on failure." msgstr "" +"یک رویداد حسابرسی را همراه با هر قلاب فعال برپ می‌کند. در صورت موفقیت صفر و " +"در صورت شکست مقدار غیرصفر به همراه استثنای تنظیم‌شده برمی‌گرداند." msgid "The *event* string argument must not be *NULL*." -msgstr "" +msgstr "آرگومان رشته‌ای *event* نباید *NULL* باشد." -msgid "If any hooks have been added, *format* and other arguments will be used to construct a tuple to pass. Apart from ``N``, the same format characters as used in :c:func:`Py_BuildValue` are available. If the built value is not a tuple, it will be added into a single-element tuple." +msgid "" +"If any hooks have been added, *format* and other arguments will be used to " +"construct a tuple to pass. Apart from ``N``, the same format characters as " +"used in :c:func:`Py_BuildValue` are available. If the built value is not a " +"tuple, it will be added into a single-element tuple." msgstr "" +"اگر قلابی افزوده شده باشد، از *format* و سایر آرگومان‌ها برای ساخت تاپلی که " +"پاس داده شود استفاده خواهد شد. به جز ``N``، همان نویسه‌های قالب که در " +":c:func:`Py_BuildValue` استفاده می‌شوند، در دسترس هستند. اگر مقدار ساخته‌شده" +" یک تاپل نباشد، به یک تاپل تک‌عنصری افزوده خواهد شد." -msgid "The ``N`` format option must not be used. It consumes a reference, but since there is no way to know whether arguments to this function will be consumed, using it may cause reference leaks." +msgid "" +"The ``N`` format option must not be used. It consumes a reference, but since" +" there is no way to know whether arguments to this function will be " +"consumed, using it may cause reference leaks." msgstr "" +"از گزینه‌ی قالب ``N`` نباید استفاده شود. این گزینه یک ارجاع را مصرف می‌کند، " +"اما از آنجا که هیچ راهی برای دانستن اینکه آیا آرگومان‌های این تابع مصرف " +"خواهند شد یا خیر وجود ندارد، استفاده از آن ممکن است باعث نشت ارجاع شود." -msgid "Note that ``#`` format characters should always be treated as :c:type:`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." +msgid "" +"Note that ``#`` format characters should always be treated as " +":c:type:`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was " +"defined." msgstr "" +"توجه داشته باشید که نویسه‌های قالب ``#`` همیشه باید به‌عنوان " +":c:type:`Py_ssize_t` در نظر گرفته شوند، صرف‌نظر از اینکه " +"``PY_SSIZE_T_CLEAN`` تعریف‌شده باشد یا خیر." msgid ":func:`sys.audit` performs the same function from Python code." -msgstr "" +msgstr ":func:`sys.audit` همین کار را از درون کد پایتون انجام می‌دهد." msgid "See also :c:func:`PySys_AuditTuple`." -msgstr "" +msgstr "همچنین :c:func:`PySys_AuditTuple` را ببینید." -msgid "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an unavoidable deprecation warning was raised." +msgid "" +"Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " +"unavoidable deprecation warning was raised." msgstr "" +"نویسه‌های قالب ``#`` به :c:type:`Py_ssize_t` نیاز دارند. پیش‌تر، یک هشدار " +"منسوخ‌شدگی اجتناب‌ناپذیر صادر می‌شد." -msgid "Similar to :c:func:`PySys_Audit`, but pass arguments as a Python object. *args* must be a :class:`tuple`. To pass no arguments, *args* can be *NULL*." +msgid "" +"Similar to :c:func:`PySys_Audit`, but pass arguments as a Python object. " +"*args* must be a :class:`tuple`. To pass no arguments, *args* can be *NULL*." msgstr "" +"مشابه :c:func:`PySys_Audit` است، اما آرگومان‌ها را به‌صورت یک شیء پایتون " +"می‌گذرد. *args* باید یک :class:`tuple` باشد. برای عدم گذراندن آرگومان، " +"*args* می‌تواند *NULL* باشد." -msgid "Append the callable *hook* to the list of active auditing hooks. Return zero on success and non-zero on failure. If the runtime has been initialized, also set an error on failure. Hooks added through this API are called for all interpreters created by the runtime." +msgid "" +"Append the callable *hook* to the list of active auditing hooks. Return zero" +" on success and non-zero on failure. If the runtime has been initialized, " +"also set an error on failure. Hooks added through this API are called for " +"all interpreters created by the runtime." msgstr "" +"فراخوانی‌پذیر *hook* را به فهرست قلاب‌های حسابرسی فعال الحاق می‌کند. در صورت" +" موفقیت صفر و در صورت شکست مقدار غیرصفر برمی‌گرداند. اگر ران‌تایم مقداردهی " +"اولیه شده باشد، در صورت شکست خطایی نیز تنظیم می‌کند. قلاب‌هایی که از طریق " +"این API افزوده می‌شوند، برای تمام مفسرهای ایجادشده توسط ران‌تایم فراخوانی " +"می‌شوند." -msgid "The *userData* pointer is passed into the hook function. Since hook functions may be called from different runtimes, this pointer should not refer directly to Python state." +msgid "" +"The *userData* pointer is passed into the hook function. Since hook " +"functions may be called from different runtimes, this pointer should not " +"refer directly to Python state." msgstr "" +"اشاره‌گر *userData* به تابع قلاب پاس داده می‌شود. از آنجا که توابع قلاب ممکن" +" است از ران‌تایم‌های مختلف فراخوانی شوند، این اشاره‌گر نباید مستقیماً به " +"وضعیت پایتون اشاره کند." -msgid "This function is safe to call before :c:func:`Py_Initialize`. When called after runtime initialization, existing audit hooks are notified and may silently abort the operation by raising an error subclassed from :class:`Exception` (other errors will not be silenced)." +msgid "" +"This function is safe to call before :c:func:`Py_Initialize`. When called " +"after runtime initialization, existing audit hooks are notified and may " +"silently abort the operation by raising an error subclassed from " +":class:`Exception` (other errors will not be silenced)." msgstr "" +"فراخوانی این تابع پیش از :c:func:`Py_Initialize` ایمن است. هنگامی که پس از " +"مقداردهی اولیه ران‌تایم فراخوانی شود، قلاب‌های حسابرسی موجود مطلع می‌شوند و " +"ممکن است عملیات را با ایجاد خطایی که زیرکلاسی از :class:`Exception` است، " +"به‌صورت بی‌صدا لغو کنند (خطاهای دیگر سرکوب نخواهند شد)." -msgid "The hook function is always called with an :term:`attached thread state` by the Python interpreter that raised the event." +msgid "" +"The hook function is always called with an :term:`attached thread state` by " +"the Python interpreter that raised the event." msgstr "" +"تابع قلاب همیشه با یک :term:`وضعیت نخ پیوست‌شده ` " +"توسط مفسر پایتونی که رویداد را ایجاد کرده است، فراخوانی می‌شود." -msgid "See :pep:`578` for a detailed description of auditing. Functions in the runtime and standard library that raise events are listed in the :ref:`audit events table `. Details are in each function's documentation." +msgid "" +"See :pep:`578` for a detailed description of auditing. Functions in the " +"runtime and standard library that raise events are listed in the :ref:`audit" +" events table `. Details are in each function's documentation." msgstr "" +"برای شرح مفصل حسابرسی به :pep:`578` مراجعه کنید. توابعی در ران‌تایم و " +"کتابخانه استاندارد که رویداد ایجاد می‌کنند در :ref:`جدول رویدادهای حسابرسی " +"` فهرست شده‌اند. جزئیات در مستندات هر تابع آمده است." -msgid "If the interpreter is initialized, this function raises an auditing event ``sys.addaudithook`` with no arguments. If any existing hooks raise an exception derived from :class:`Exception`, the new hook will not be added and the exception is cleared. As a result, callers cannot assume that their hook has been added unless they control all existing hooks." -msgstr "" +msgid "" +"If the interpreter is initialized, this function raises an auditing event " +"``sys.addaudithook`` with no arguments. If any existing hooks raise an " +"exception derived from :class:`Exception`, the new hook will not be added " +"and the exception is cleared. As a result, callers cannot assume that their " +"hook has been added unless they control all existing hooks." +msgstr "" +"اگر مفسر راه‌اندازی‌شده باشد، این تابع رویداد حسابرسی ``sys.addaudithook`` " +"را بدون هیچ آرگومانی ایجاد می‌کند. اگر هر یک از قلاب‌های موجود استثنایی " +"مشتق‌شده از :class:`Exception` ایجاد کند، قلاب جدید اضافه نخواهد شد و استثنا" +" پاک می‌شود. در نتیجه، فراخوانندگان نمی‌توانند فرض کنند که قلاب‌شان اضافه " +"شده است، مگر آنکه کنترل تمام قلاب‌های موجود را در دست داشته باشند." -msgid "The type of the hook function. *event* is the C string event argument passed to :c:func:`PySys_Audit` or :c:func:`PySys_AuditTuple`. *args* is guaranteed to be a :c:type:`PyTupleObject`. *userData* is the argument passed to PySys_AddAuditHook()." +msgid "" +"The type of the hook function. *event* is the C string event argument passed" +" to :c:func:`PySys_Audit` or :c:func:`PySys_AuditTuple`. *args* is " +"guaranteed to be a :c:type:`PyTupleObject`. *userData* is the argument " +"passed to PySys_AddAuditHook()." msgstr "" +"نوع تابع قلاب. *event* آرگومان رویداد از نوع رشته‌ی C است که به " +":c:func:`PySys_Audit` یا :c:func:`PySys_AuditTuple` ارسال می‌شود. تضمین " +"می‌شود که *args* یک :c:type:`PyTupleObject` باشد. *userData* آرگومانی است که" +" به PySys_AddAuditHook() ارسال می‌شود." msgid "Process Control" -msgstr "" +msgstr "کنترل فرایند" -msgid "Print a fatal error message and kill the process. No cleanup is performed. This function should only be invoked when a condition is detected that would make it dangerous to continue using the Python interpreter; e.g., when the object administration appears to be corrupted. On Unix, the standard C library function :c:func:`!abort` is called which will attempt to produce a :file:`core` file." -msgstr "" +msgid "" +"Print a fatal error message and kill the process. No cleanup is performed. " +"This function should only be invoked when a condition is detected that would" +" make it dangerous to continue using the Python interpreter; e.g., when the " +"object administration appears to be corrupted. On Unix, the standard C " +"library function :c:func:`!abort` is called which will attempt to produce a " +":file:`core` file." +msgstr "" +"یک پیام خطای مهلک چاپ می‌کند و فرایند را می‌کشد. هیچ پاک‌سازی انجام نمی‌شود." +" این تابع تنها زمانی باید فراخوانی شود که شرایطی تشخیص داده شود که ادامه " +"استفاده از مفسر پایتون را خطرناک سازد؛ برای مثال، زمانی که به نظر می‌رسد " +"مدیریت شیء دچار خرابی شده باشد. در یونیکس، تابع :c:func:`!abort` از کتابخانه" +" استاندارد C فراخوانی می‌شود که سعی خواهد کرد یک پرونده :file:`core` تولید " +"کند." -msgid "The ``Py_FatalError()`` function is replaced with a macro which logs automatically the name of the current function, unless the ``Py_LIMITED_API`` macro is defined." +msgid "" +"The ``Py_FatalError()`` function is replaced with a macro which logs " +"automatically the name of the current function, unless the " +"``Py_LIMITED_API`` macro is defined." msgstr "" +"تابع ``Py_FatalError()`` با ماکرویی جایگزین می‌شود که نام تابع فعلی را " +"به‌طور خودکار ثبت می‌کند، مگر آنکه ماکروی ``Py_LIMITED_API`` تعریف شده باشد." msgid "Log the function name automatically." -msgstr "" +msgstr "نام تابع را به‌طور خودکار ثبت می‌کند." -msgid "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls the standard C library function ``exit(status)``. If :c:func:`Py_FinalizeEx` indicates an error, the exit status is set to 120." +msgid "" +"Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls" +" the standard C library function ``exit(status)``. If " +":c:func:`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" +"از فرایند فعلی خارج می‌شود. این تابع :c:func:`Py_FinalizeEx` را فراخوانی " +"می‌کند و سپس تابع ``exit(status)`` کتابخانه‌ی استاندارد C را فراخوانی " +"می‌کند. اگر :c:func:`Py_FinalizeEx` خطا را نشان دهد، وضعیت خروج به ۱۲۰ تنظیم" +" می‌شود." msgid "Errors from finalization no longer ignored." -msgstr "" +msgstr "خطاهای ناشی از نهایی‌سازی دیگر نادیده گرفته نمی‌شوند." -msgid "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The cleanup function will be called with no arguments and should return no value. At most 32 cleanup functions can be registered. When the registration is successful, :c:func:`Py_AtExit` returns ``0``; on failure, it returns ``-1``. The cleanup function registered last is called first. Each cleanup function will be called at most once. Since Python's internal finalization will have completed before the cleanup function, no Python APIs should be called by *func*." -msgstr "" +msgid "" +"Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " +"cleanup function will be called with no arguments and should return no " +"value. At most 32 cleanup functions can be registered. When the " +"registration is successful, :c:func:`Py_AtExit` returns ``0``; on failure, " +"it returns ``-1``. The cleanup function registered last is called first. " +"Each cleanup function will be called at most once. Since Python's internal " +"finalization will have completed before the cleanup function, no Python APIs" +" should be called by *func*." +msgstr "" +"یک تابع پاک‌سازی ثبت کنید تا توسط :c:func:`Py_FinalizeEx` فراخوانی شود. تابع" +" پاک‌سازی بدون هیچ آرگومانی فراخوانی می‌شود و نباید مقداری برگرداند. حداکثر " +"۳۲ تابع پاک‌سازی را می‌توان ثبت کرد. وقتی ثبت با موفقیت انجام شود، " +":c:func:`Py_AtExit` مقدار ``0`` را برمی‌گرداند؛ در صورت شکست، مقدار ``-1`` " +"را برمی‌گرداند. آخرین تابع پاک‌سازی ثبت‌شده، نخست فراخوانی می‌شود. هر تابع " +"پاک‌سازی حداکثر یک‌بار فراخوانی خواهد شد. از آنجا که نهایی‌سازی داخلی پایتون" +" پیش از تابع پاک‌سازی کامل شده خواهد بود، *func* نباید هیچ‌یک از APIهای " +"پایتون را فراخوانی کند." msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument." -msgstr "" +msgstr ":c:func:`PyUnstable_AtExit` برای گذراندن آرگومان ``void *data``." msgid "USE_STACKCHECK (C macro)" -msgstr "" +msgstr "USE_STACKCHECK (ماکروی C)" msgid "abort (C function)" -msgstr "" +msgstr "abort (تابع C)" msgid "Py_FinalizeEx (C function)" -msgstr "" +msgstr "Py_FinalizeEx (تابع C)" msgid "exit (C function)" -msgstr "" +msgstr "exit (تابع C)" msgid "cleanup functions" -msgstr "" +msgstr "توابع پاک‌سازی" diff --git a/c-api/threads.po b/c-api/threads.po index b7626dba7..4c452539f 100644 --- a/c-api/threads.po +++ b/c-api/threads.po @@ -20,61 +20,157 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Thread states and the global interpreter lock" -msgstr "" +msgstr "وضعیت‌های نخ و قفل مفسر سراسری" -msgid "Unless on a :term:`free-threaded build` of :term:`CPython`, the Python interpreter is generally not thread-safe. In order to support multi-threaded Python programs, there's a global lock, called the :term:`global interpreter lock` or :term:`GIL`, that must be held by a thread before accessing Python objects. Without the lock, even the simplest operations could cause problems in a multi-threaded program: for example, when two threads simultaneously increment the reference count of the same object, the reference count could end up being incremented only once instead of twice." -msgstr "" +msgid "" +"Unless on a :term:`free-threaded build` of :term:`CPython`, the Python " +"interpreter is generally not thread-safe. In order to support multi-" +"threaded Python programs, there's a global lock, called the :term:`global " +"interpreter lock` or :term:`GIL`, that must be held by a thread before " +"accessing Python objects. Without the lock, even the simplest operations " +"could cause problems in a multi-threaded program: for example, when two " +"threads simultaneously increment the reference count of the same object, the" +" reference count could end up being incremented only once instead of twice." +msgstr "" +"مگر در :term:`free-threaded build` از :term:`CPython`، مفسر پایتون به‌طور " +"کلی نخ‌ایمن نیست. به منظور پشتیبانی از برنامه‌های چندنخی پایتون، یک قفل " +"سراسری به نام :term:`global interpreter lock` یا :term:`GIL` وجود دارد که " +"باید پیش از دسترسی به اشیای پایتون، توسط یک نخ نگه داشته شود. بدون این قفل، " +"حتی ساده‌ترین عملیات‌ها می‌توانند در یک برنامه‌ی چندنخی مشکل ایجاد کنند: " +"برای مثال، وقتی دو نخ هم‌زمان شمارش ارجاع یک شیء واحد را افزایش می‌دهند، " +"ممکن است شمارش ارجاع در نهایت به جای دو بار، فقط یک بار افزایش یابد." -msgid "As such, only a thread that holds the GIL may operate on Python objects or invoke Python's C API." +msgid "" +"As such, only a thread that holds the GIL may operate on Python objects or " +"invoke Python's C API." msgstr "" +"از این رو، تنها نخی که قفل مفسر سراسری (GIL) را در اختیار دارد، می‌تواند روی" +" اشیای پایتون عمل کند یا C API پایتون را فراخوانی کند." -msgid "In order to emulate concurrency, the interpreter regularly tries to switch threads between bytecode instructions (see :func:`sys.setswitchinterval`). This is why locks are also necessary for thread-safety in pure-Python code." +msgid "" +"In order to emulate concurrency, the interpreter regularly tries to switch " +"threads between bytecode instructions (see :func:`sys.setswitchinterval`). " +"This is why locks are also necessary for thread-safety in pure-Python code." msgstr "" +"برای شبیه‌سازی همزمانی، مفسر به‌طور منظم تلاش می‌کند نخ‌ها را بین " +"دستورالعمل‌های بایت‌کد تعویض کند (به :func:`sys.setswitchinterval` مراجعه " +"کنید). به همین دلیل است که قفل‌ها برای نخ‌ایمنی در کد پایتون خالص نیز ضروری " +"هستند." -msgid "Additionally, the global interpreter lock is released around blocking I/O operations, such as reading or writing to a file. From the C API, this is done by :ref:`detaching the thread state `." +msgid "" +"Additionally, the global interpreter lock is released around blocking I/O " +"operations, such as reading or writing to a file. From the C API, this is " +"done by :ref:`detaching the thread state `." msgstr "" +"علاوه بر این، قفل مفسر سراسری در اطراف عملیات ورودی/خروجی (I/O) مسدودکننده، " +"مانند خواندن از یک پرونده یا نوشتن در آن، آزاد می‌شود. از طریق C API، این " +"کار با :ref:`جدا کردن وضعیت نخ ` انجام می‌شود." -msgid "The Python interpreter keeps some thread-local information inside a data structure called :c:type:`PyThreadState`, known as a :term:`thread state`. Each thread has a thread-local pointer to a :c:type:`PyThreadState`; a thread state referenced by this pointer is considered to be :term:`attached `." -msgstr "" +msgid "" +"The Python interpreter keeps some thread-local information inside a data " +"structure called :c:type:`PyThreadState`, known as a :term:`thread state`. " +"Each thread has a thread-local pointer to a :c:type:`PyThreadState`; a " +"thread state referenced by this pointer is considered to be :term:`attached " +"`." +msgstr "" +"مفسر پایتون برخی از اطلاعات نخ‌محلی را درون ساختار داده‌ای به نام " +":c:type:`PyThreadState` نگه می‌دارد که به آن :term:`وضعیت نخ ` " +"گفته می‌شود. هر نخ یک اشاره‌گر نخ‌محلی به یک :c:type:`PyThreadState` دارد؛ " +"وضعیت نخی که این اشاره‌گر به آن ارجاع می‌دهد، :term:`متصل ` در نظر گرفته می‌شود." -msgid "A thread can only have one :term:`attached thread state` at a time. An attached thread state is typically analogous with holding the GIL, except on free-threaded builds. On builds with the GIL enabled, attaching a thread state will block until the GIL can be acquired. However, even on builds with the GIL disabled, it is still required to have an attached thread state, as the interpreter needs to keep track of which threads may access Python objects." -msgstr "" +msgid "" +"A thread can only have one :term:`attached thread state` at a time. An " +"attached thread state is typically analogous with holding the GIL, except on" +" free-threaded builds. On builds with the GIL enabled, attaching a thread " +"state will block until the GIL can be acquired. However, even on builds with" +" the GIL disabled, it is still required to have an attached thread state, as" +" the interpreter needs to keep track of which threads may access Python " +"objects." +msgstr "" +"یک نخ در هر لحظه تنها می‌تواند یک :term:`attached thread state` داشته باشد. " +"وضعیت نخ متصل معمولاً معادل با در اختیار داشتن GIL است، به‌جز در بیلدهای " +"نخ‌آزاد. در بیلدهایی که GIL فعال است، متصل کردن یک وضعیت نخ تا زمانی که " +"بتوان GIL را به دست آورد، مسدود می‌ماند. با این حال، حتی در بیلدهایی که GIL " +"غیرفعال است، همچنان داشتن یک وضعیت نخ متصل الزامی " +"است، زیرا مفسر باید پیگیری کند که کدام نخ‌ها ممکن است به اشیای پایتون " +"دسترسی داشته باشند." -msgid "Even on the free-threaded build, attaching a thread state may block, as the GIL can be re-enabled or threads might be temporarily suspended (such as during a garbage collection)." +msgid "" +"Even on the free-threaded build, attaching a thread state may block, as the " +"GIL can be re-enabled or threads might be temporarily suspended (such as " +"during a garbage collection)." msgstr "" +"حتی در بیلد نخ‌آزاد، پیوست کردن وضعیت نخ ممکن است مسدود شود، زیرا قفل مفسر " +"سراسری می‌تواند دوباره فعال شود یا نخ‌ها ممکن است به‌طور موقت معلق شوند " +"(مانند هنگام زباله‌روبی)." -msgid "Generally, there will always be an attached thread state when using Python's C API, including during embedding and when implementing methods, so it's uncommon to need to set up a thread state on your own. Only in some specific cases, such as in a :c:macro:`Py_BEGIN_ALLOW_THREADS` block or in a fresh thread, will the thread not have an attached thread state. If uncertain, check if :c:func:`PyThreadState_GetUnchecked` returns ``NULL``." -msgstr "" +msgid "" +"Generally, there will always be an attached thread state when using Python's" +" C API, including during embedding and when implementing methods, so it's " +"uncommon to need to set up a thread state on your own. Only in some specific" +" cases, such as in a :c:macro:`Py_BEGIN_ALLOW_THREADS` block or in a fresh " +"thread, will the thread not have an attached thread state. If uncertain, " +"check if :c:func:`PyThreadState_GetUnchecked` returns ``NULL``." +msgstr "" +"به‌طور کلی، هنگام استفاده از API زبان C پایتون، همیشه یک وضعیت نخ متصل وجود " +"خواهد داشت، از جمله در حین جاسازی و هنگام پیاده‌سازی متدها؛ بنابراین به‌ندرت" +" پیش می‌آید که لازم باشد خودتان وضعیت نخ ایجاد کنید. تنها در برخی موارد خاص،" +" مانند داخل بلوک :c:macro:`Py_BEGIN_ALLOW_THREADS` یا در یک نخ تازه، نخ " +"وضعیت نخ متصل نخواهد داشت. اگر مطمئن نیستید، بررسی کنید که آیا " +":c:func:`PyThreadState_GetUnchecked` مقدار ``NULL`` برمی‌گرداند یا خیر." -msgid "If it turns out that you do need to create a thread state, call :c:func:`PyThreadState_New` followed by :c:func:`PyThreadState_Swap`, or use the dangerous :c:func:`PyGILState_Ensure` function." +msgid "" +"If it turns out that you do need to create a thread state, call " +":c:func:`PyThreadState_New` followed by :c:func:`PyThreadState_Swap`, or use" +" the dangerous :c:func:`PyGILState_Ensure` function." msgstr "" +"اگر معلوم شد که واقعاً به ایجاد وضعیت نخ نیاز دارید، " +":c:func:`PyThreadState_New` و سپس :c:func:`PyThreadState_Swap` را فراخوانی " +"کنید، یا از تابع خطرناک :c:func:`PyGILState_Ensure` استفاده کنید." msgid "Detaching the thread state from extension code" -msgstr "" +msgstr "جدا کردن وضعیت نخ از کد توسعه‌ای" -msgid "Most extension code manipulating the :term:`thread state` has the following simple structure::" +msgid "" +"Most extension code manipulating the :term:`thread state` has the following " +"simple structure::" msgstr "" +"بیشتر کدهای توسعه‌ای که :term:`وضعیت نخ ` را دستکاری می‌کنند، " +"ساختار ساده‌ی زیر را دارند::" msgid "" "Save the thread state in a local variable.\n" "... Do some blocking I/O operation ...\n" "Restore the thread state from the local variable." msgstr "" +"وضعیت نخ را در یک متغیر محلی ذخیره کنید.\n" +"... یک عملیات ورودی/خروجی مسدودکننده انجام دهید ...\n" +"وضعیت نخ را از متغیر محلی بازیابی کنید." msgid "This is so common that a pair of macros exists to simplify it::" -msgstr "" +msgstr "این چنان رایج است که جفتی از ماکروها برای ساده‌سازی آن وجود دارد::" msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" +"Py_BEGIN_ALLOW_THREADS\n" +"... یک عملیات ورودی/خروجی مسدودکننده انجام دهید ...\n" +"Py_END_ALLOW_THREADS" -msgid "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the block." +msgid "" +"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a" +" hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the" +" block." msgstr "" +"ماکروی :c:macro:`Py_BEGIN_ALLOW_THREADS` یک بلوک جدید باز می‌کند و یک متغیر " +"محلی پنهان اعلان می‌کند؛ ماکروی :c:macro:`Py_END_ALLOW_THREADS` بلوک را " +"می‌بندد." msgid "The block above expands to the following code::" -msgstr "" +msgstr "بلوک بالا به کد زیر بسط می‌یابد::" msgid "" "PyThreadState *_save;\n" @@ -83,63 +179,172 @@ msgid "" "... Do some blocking I/O operation ...\n" "PyEval_RestoreThread(_save);" msgstr "" +"PyThreadState *_save;\n" +"\n" +"_save = PyEval_SaveThread();\n" +"... یک عملیات ورودی/خروجی مسدودکننده انجام دهید ...\n" +"PyEval_RestoreThread(_save);" msgid "Here is how these functions work:" -msgstr "" +msgstr "نحوه کار این توابع به این صورت است:" -msgid "The attached thread state implies that the GIL is held for the interpreter. To detach it, :c:func:`PyEval_SaveThread` is called and the result is stored in a local variable." +msgid "" +"The attached thread state implies that the GIL is held for the interpreter. " +"To detach it, :c:func:`PyEval_SaveThread` is called and the result is stored" +" in a local variable." msgstr "" +"متصل بودن وضعیت نخ نشان می‌دهد که قفل مفسر سراسری (GIL) برای مفسر نگه داشته " +"شده است. برای جدا کردن آن، :c:func:`PyEval_SaveThread` فراخوانی می‌شود و " +"نتیجه در یک متغیر محلی ذخیره می‌شود." -msgid "By detaching the thread state, the GIL is released, which allows other threads to attach to the interpreter and execute while the current thread performs blocking I/O. When the I/O operation is complete, the old thread state is reattached by calling :c:func:`PyEval_RestoreThread`, which will wait until the GIL can be acquired." -msgstr "" +msgid "" +"By detaching the thread state, the GIL is released, which allows other " +"threads to attach to the interpreter and execute while the current thread " +"performs blocking I/O. When the I/O operation is complete, the old thread " +"state is reattached by calling :c:func:`PyEval_RestoreThread`, which will " +"wait until the GIL can be acquired." +msgstr "" +"با جدا کردن وضعیت نخ، قفل مفسر سراسری (GIL) آزاد می‌شود که به نخ‌های دیگر " +"اجازه می‌دهد در حالی که نخ فعلی در حال انجام عملیات ورودی/خروجی مسدودکننده " +"است، به مفسر متصل شده و اجرا شوند. هنگامی که عملیات ورودی/خروجی به پایان " +"رسید، وضعیت نخ قبلی با فراخوانی :c:func:`PyEval_RestoreThread` دوباره متصل " +"می‌شود؛ این تابع تا زمانی که بتوان قفل مفسر سراسری را به دست آورد، منتظر " +"می‌ماند." -msgid "Performing blocking I/O is the most common use case for detaching the thread state, but it is also useful to call it over long-running native code that doesn't need access to Python objects or Python's C API. For example, the standard :mod:`zlib` and :mod:`hashlib` modules detach the :term:`thread state ` when compressing or hashing data." -msgstr "" +msgid "" +"Performing blocking I/O is the most common use case for detaching the thread" +" state, but it is also useful to call it over long-running native code that " +"doesn't need access to Python objects or Python's C API. For example, the " +"standard :mod:`zlib` and :mod:`hashlib` modules detach the :term:`thread " +"state ` when compressing or hashing data." +msgstr "" +"انجام عملیات ورودی/خروجی مسدودکننده رایج‌ترین مورد استفاده برای جداسازی " +"وضعیت نخ است، اما فراخوانی آن روی کد بومی طولانی‌مدتی که نیازی به دسترسی به " +"اشیاء پایتون یا C API پایتون ندارد نیز مفید است. برای مثال، ماژول‌های " +"استاندارد :mod:`zlib` و :mod:`hashlib` هنگام فشرده‌سازی یا هش کردن داده‌ها، " +":term:`وضعیت نخ ` را جدا می‌کنند." -msgid "On a :term:`free-threaded build`, the :term:`GIL` is usually out of the question, but **detaching the thread state is still required**, because the interpreter periodically needs to block all threads to get a consistent view of Python objects without the risk of race conditions. For example, CPython currently suspends all threads for a short period of time while running the garbage collector." -msgstr "" +msgid "" +"On a :term:`free-threaded build`, the :term:`GIL` is usually out of the " +"question, but **detaching the thread state is still required**, because the " +"interpreter periodically needs to block all threads to get a consistent view" +" of Python objects without the risk of race conditions. For example, CPython" +" currently suspends all threads for a short period of time while running the" +" garbage collector." +msgstr "" +"در یک :term:`بیلد نخ‌آزاد `، :term:`قفل مفسر سراسری " +"(GIL) ` معمولاً منتفی است، اما **جدا کردن وضعیت نخ همچنان الزامی است**،" +" زیرا مفسر به‌طور دوره‌ای نیاز دارد همه‌ی نخ‌ها را مسدود کند تا نمای سازگار " +"از اشیای پایتون را بدون خطر شرایط رقابتی به دست آورد. برای مثال، سی‌پایتون " +"در حال حاضر هنگام اجرای زباله‌روب، همه‌ی نخ‌ها را برای مدت کوتاهی معلق " +"می‌کند." -msgid "Detaching the thread state can lead to unexpected behavior during interpreter finalization. See :ref:`cautions-regarding-runtime-finalization` for more details." +msgid "" +"Detaching the thread state can lead to unexpected behavior during " +"interpreter finalization. See :ref:`cautions-regarding-runtime-finalization`" +" for more details." msgstr "" +"جدا کردن وضعیت نخ می‌تواند در حین نهایی‌سازی مفسر به رفتار غیرمنتظره منجر " +"شود. برای جزئیات بیشتر به :ref:`cautions-regarding-runtime-finalization` " +"مراجعه کنید." msgid "APIs" -msgstr "" +msgstr "APIها" -msgid "The following macros are normally used without a trailing semicolon; look for example usage in the Python source distribution." +msgid "" +"The following macros are normally used without a trailing semicolon; look " +"for example usage in the Python source distribution." msgstr "" +"ماکروهای زیر معمولاً بدون نقطه‌ویرگول انتهایی استفاده می‌شوند؛ نمونه‌های " +"استفاده را در توزیع کد منبع پایتون جست‌وجو کنید." -msgid "These macros are still necessary on the :term:`free-threaded build` to prevent deadlocks." +msgid "" +"These macros are still necessary on the :term:`free-threaded build` to " +"prevent deadlocks." msgstr "" +"این ماکروها در :term:`بیلد نخ‌آزاد ` همچنان برای " +"جلوگیری از بن‌بست‌ها ضروری هستند." -msgid "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();``. Note that it contains an opening brace; it must be matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further discussion of this macro." +msgid "" +"This macro expands to ``{ PyThreadState *_save; _save = " +"PyEval_SaveThread();``. Note that it contains an opening brace; it must be " +"matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above " +"for further discussion of this macro." msgstr "" +"این ماکرو به ``{ PyThreadState *_save; _save = PyEval_SaveThread();`` بسط " +"می‌یابد. توجه داشته باشید که این ماکرو یک آکولاد باز در بر دارد و باید با " +"ماکروی :c:macro:`Py_END_ALLOW_THREADS` که پس از آن می‌آید جفت شود. برای بحث " +"بیشتر درباره‌ی این ماکرو به بالا مراجعه کنید." -msgid "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it contains a closing brace; it must be matched with an earlier :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this macro." +msgid "" +"This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " +"contains a closing brace; it must be matched with an earlier " +":c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion " +"of this macro." msgstr "" +"این ماکرو به ``PyEval_RestoreThread(_save); }`` بسط می‌یابد. توجه داشته " +"باشید که این ماکرو شامل یک آکولاد بسته است و باید با یک ماکروی " +":c:macro:`Py_BEGIN_ALLOW_THREADS` پیشین جفت شود. برای بحث بیشتر درباره‌ی این" +" ماکرو، به بالا مراجعه کنید." -msgid "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :c:macro:`Py_END_ALLOW_THREADS` without the closing brace." +msgid "" +"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to " +":c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" +"این ماکرو به ``PyEval_RestoreThread(_save);`` بسط می‌یابد: معادل " +":c:macro:`Py_END_ALLOW_THREADS` بدون آکولاد پایانی است." -msgid "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable declaration." +msgid "" +"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to " +":c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " +"declaration." msgstr "" +"این ماکرو به ``_save = PyEval_SaveThread();`` بسط می‌یابد: معادل " +":c:macro:`Py_BEGIN_ALLOW_THREADS` بدون آکولاد باز و اعلان متغیر است." msgid "Non-Python created threads" -msgstr "" +msgstr "نخ‌های ایجادشده خارج از پایتون" -msgid "When threads are created using the dedicated Python APIs (such as the :mod:`threading` module), a thread state is automatically associated with them, However, when a thread is created from native code (for example, by a third-party library with its own thread management), it doesn't hold an attached thread state." +msgid "" +"When threads are created using the dedicated Python APIs (such as the " +":mod:`threading` module), a thread state is automatically associated with " +"them, However, when a thread is created from native code (for example, by a " +"third-party library with its own thread management), it doesn't hold an " +"attached thread state." msgstr "" +"وقتی نخ‌ها با استفاده از APIهای اختصاصی پایتون (مانند ماژول " +":mod:`threading`) ایجاد می‌شوند، یک وضعیت نخ به‌طور خودکار با آن‌ها مرتبط " +"می‌شود؛ با این حال، وقتی یک نخ از کد بومی ایجاد شود (برای مثال، توسط یک " +"کتابخانه شخص ثالث با مدیریت نخ اختصاصی خودش)، وضعیت نخ متصل‌شده‌ای ندارد." -msgid "If you need to call Python code from these threads (often this will be part of a callback API provided by the aforementioned third-party library), you must first register these threads with the interpreter by creating a new thread state and attaching it." +msgid "" +"If you need to call Python code from these threads (often this will be part " +"of a callback API provided by the aforementioned third-party library), you " +"must first register these threads with the interpreter by creating a new " +"thread state and attaching it." msgstr "" +"اگر لازم باشد کد پایتون را از این نخ‌ها فراخوانی کنید (اغلب این کار بخشی از " +"یک API کال‌بک ارائه‌شده توسط کتابخانه شخص ثالث مذکور خواهد بود)، باید ابتدا " +"با ایجاد یک وضعیت نخ جدید و پیوست دادن آن، این نخ‌ها را در مفسر ثبت کنید." -msgid "The most robust way to do this is through :c:func:`PyThreadState_New` followed by :c:func:`PyThreadState_Swap`." +msgid "" +"The most robust way to do this is through :c:func:`PyThreadState_New` " +"followed by :c:func:`PyThreadState_Swap`." msgstr "" +"مقاوم‌ترین راه انجام این کار، استفاده از :c:func:`PyThreadState_New` و سپس " +":c:func:`PyThreadState_Swap` است." -msgid "``PyThreadState_New`` requires an argument pointing to the desired interpreter; such a pointer can be acquired via a call to :c:func:`PyInterpreterState_Get` from the code where the thread was created." +msgid "" +"``PyThreadState_New`` requires an argument pointing to the desired " +"interpreter; such a pointer can be acquired via a call to " +":c:func:`PyInterpreterState_Get` from the code where the thread was created." msgstr "" +"``PyThreadState_New`` به آرگومانی نیاز دارد که به مفسر موردنظر اشاره کند؛ " +"چنین اشاره‌گری را می‌توان از طریق فراخوانی :c:func:`PyInterpreterState_Get` " +"در کدی که نخ در آن ایجاد شده است، به دست آورد." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "/* The return value of PyInterpreterState_Get() from the\n" @@ -161,24 +366,67 @@ msgid "" "PyThreadState_Clear(tstate);\n" "PyThreadState_DeleteCurrent();" msgstr "" +"/* مقدار بازگشتی PyInterpreterState_Get() از تابعی که\n" +" این نخ را ایجاد کرده است. */\n" +"PyInterpreterState *interp = thread_data->interp;\n" +"\n" +"/* ایجاد یک وضعیت نخ جدید برای مفسر. این وضعیت در ابتدا\n" +" متصل نیست. */\n" +"PyThreadState *tstate = PyThreadState_New(interp);\n" +"\n" +"/* اتصال وضعیت نخ، که قفل مفسر سراسری را به دست خواهد آورد. */\n" +"PyThreadState_Swap(tstate);\n" +"\n" +"/* اینجا کنش‌های پایتون را انجام دهید. */\n" +"result = CallSomeFunction();\n" +"/* ارزیابی نتیجه یا مدیریت استثنا */\n" +"\n" +"/* تخریب وضعیت نخ. پس از این نقطه هیچ API پایتونی مجاز نیست. */\n" +"PyThreadState_Clear(tstate);\n" +"PyThreadState_DeleteCurrent();" -msgid "If the interpreter finalized before ``PyThreadState_Swap`` was called, then ``interp`` will be a dangling pointer!" +msgid "" +"If the interpreter finalized before ``PyThreadState_Swap`` was called, then " +"``interp`` will be a dangling pointer!" msgstr "" +"اگر مفسر پیش از فراخوانی ``PyThreadState_Swap`` نهایی‌سازی شده باشد، آنگاه " +"``interp`` یک اشاره‌گر معلق (dangling pointer) خواهد بود!" msgid "Legacy API" -msgstr "" +msgstr "API قدیمی (Legacy)" -msgid "Another common pattern to call Python code from a non-Python thread is to use :c:func:`PyGILState_Ensure` followed by a call to :c:func:`PyGILState_Release`." +msgid "" +"Another common pattern to call Python code from a non-Python thread is to " +"use :c:func:`PyGILState_Ensure` followed by a call to " +":c:func:`PyGILState_Release`." msgstr "" +"الگوی رایج دیگر برای فراخوانی کد پایتون از یک نخ غیرپایتونی، استفاده از " +":c:func:`PyGILState_Ensure` و سپس فراخوانی :c:func:`PyGILState_Release` است." -msgid "These functions do not work well when multiple interpreters exist in the Python process. If no Python interpreter has ever been used in the current thread (which is common for threads created outside Python), ``PyGILState_Ensure`` will create and attach a thread state for the \"main\" interpreter (the first interpreter in the Python process)." -msgstr "" +msgid "" +"These functions do not work well when multiple interpreters exist in the " +"Python process. If no Python interpreter has ever been used in the current " +"thread (which is common for threads created outside Python), " +"``PyGILState_Ensure`` will create and attach a thread state for the \"main\"" +" interpreter (the first interpreter in the Python process)." +msgstr "" +"این توابع زمانی که چندین مفسر در فرایند پایتون وجود داشته باشند، به‌خوبی کار" +" نمی‌کنند. اگر تاکنون هیچ مفسر پایتونی در نخ فعلی استفاده نشده باشد (که این " +"امر برای نخ‌هایی که خارج از پایتون ایجاد شده‌اند رایج است)، " +"``PyGILState_Ensure`` یک وضعیت نخ برای مفسر «اصلی» (اولین مفسر در فرایند " +"پایتون) ایجاد و پیوست می‌دهد." -msgid "Additionally, these functions have thread-safety issues during interpreter finalization. Using ``PyGILState_Ensure`` during finalization will likely crash the process." +msgid "" +"Additionally, these functions have thread-safety issues during interpreter " +"finalization. Using ``PyGILState_Ensure`` during finalization will likely " +"crash the process." msgstr "" +"علاوه بر این، این توابع در حین نهایی‌سازی مفسر دارای مشکلات نخ‌ایمنی هستند. " +"استفاده از ``PyGILState_Ensure`` در حین نهایی‌سازی به احتمال زیاد باعث " +"فروپاشی فرایند می‌شود." msgid "Usage of these functions look like such::" -msgstr "" +msgstr "استفاده از این توابع به این شکل است::" msgid "" "PyGILState_STATE gstate;\n" @@ -191,396 +439,929 @@ msgid "" "/* Release the thread. No Python API allowed beyond this point. */\n" "PyGILState_Release(gstate);" msgstr "" +"PyGILState_STATE gstate;\n" +"gstate = PyGILState_Ensure();\n" +"\n" +"/* Perform Python actions here. */\n" +"result = CallSomeFunction();\n" +"/* evaluate result or handle exception */\n" +"\n" +"/* Release the thread. No Python API allowed beyond this point. */\n" +"PyGILState_Release(gstate);" msgid "Cautions about fork()" -msgstr "" +msgstr "هشدارهایی درباره‌ی fork()" -msgid "Another important thing to note about threads is their behaviour in the face of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a process forks only the thread that issued the fork will exist. This has a concrete impact both on how locks must be handled and on all stored state in CPython's runtime." -msgstr "" +msgid "" +"Another important thing to note about threads is their behaviour in the face" +" of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " +"process forks only the thread that issued the fork will exist. This has a " +"concrete impact both on how locks must be handled and on all stored state in" +" CPython's runtime." +msgstr "" +"نکته‌ی مهم دیگری که درباره‌ی نخ‌ها باید به آن توجه کرد، رفتار آن‌ها در برابر" +" فراخوانی C :c:func:`fork` است. در بیشتر سیستم‌هایی که :c:func:`fork` را " +"دارند، پس از انشعاب یک فرایند، تنها نخی که انشعاب را انجام داده است، وجود " +"خواهد داشت. این موضوع هم بر نحوه‌ی مدیریت قفل‌ها و هم بر تمام وضعیت " +"ذخیره‌شده در ران‌تایم سی‌پایتون تأثیر ملموسی دارد." -msgid "The fact that only the \"current\" thread remains means any locks held by other threads will never be released. Python solves this for :func:`os.fork` by acquiring the locks it uses internally before the fork, and releasing them afterwards. In addition, it resets any :ref:`lock-objects` in the child. When extending or embedding Python, there is no way to inform Python of additional (non-Python) locks that need to be acquired before or reset after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to be used to accomplish the same thing. Additionally, when extending or embedding Python, calling :c:func:`fork` directly rather than through :func:`os.fork` (and returning to or calling into Python) may result in a deadlock by one of Python's internal locks being held by a thread that is defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary locks, but is not always able to." -msgstr "" +msgid "" +"The fact that only the \"current\" thread remains means any locks held by " +"other threads will never be released. Python solves this for :func:`os.fork`" +" by acquiring the locks it uses internally before the fork, and releasing " +"them afterwards. In addition, it resets any :ref:`lock-objects` in the " +"child. When extending or embedding Python, there is no way to inform Python " +"of additional (non-Python) locks that need to be acquired before or reset " +"after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " +"be used to accomplish the same thing. Additionally, when extending or " +"embedding Python, calling :c:func:`fork` directly rather than through " +":func:`os.fork` (and returning to or calling into Python) may result in a " +"deadlock by one of Python's internal locks being held by a thread that is " +"defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the " +"necessary locks, but is not always able to." +msgstr "" +"این واقعیت که فقط نخ «فعلی» باقی می‌ماند، به این معناست که هر قفلی که توسط " +"نخ‌های دیگر نگه‌داشته شده است، هرگز آزاد نخواهد شد. پایتون این مشکل را برای " +":func:`os.fork` با گرفتن قفل‌های داخلی خود پیش از انشعاب و آزاد کردن آن‌ها " +"پس از آن حل می‌کند. علاوه بر این، پایتون هر :ref:`lock-objects` را در فرزند " +"بازنشانی می‌کند. هنگام توسعه یا تعبیه پایتون، هیچ راهی برای اطلاع دادن به " +"پایتون درباره‌ی قفل‌های اضافی (غیرپایتونی) که باید پیش از انشعاب گرفته شوند " +"یا پس از آن بازنشانی شوند، وجود ندارد. برای انجام همین کار، لازم است از " +"امکانات سیستم‌عامل مانند :c:func:`!pthread_atfork` استفاده شود. افزون بر " +"این، هنگام توسعه یا تعبیه پایتون، فراخوانی مستقیم :c:func:`fork` به‌جای " +"فراخوانی آن از طریق :func:`os.fork` (و بازگشت به پایتون یا فراخوانی کدهای " +"پایتون) ممکن است به بن‌بست منجر شود؛ زیرا یکی از قفل‌های داخلی پایتون توسط " +"نخی نگه‌داشته می‌شود که پس از انشعاب از کار افتاده است. " +":c:func:`PyOS_AfterFork_Child` می‌کوشد قفل‌های لازم را بازنشانی کند، اما " +"همیشه قادر به انجام آن نیست." -msgid "The fact that all other threads go away also means that CPython's runtime state there must be cleaned up properly, which :func:`os.fork` does. This means finalizing all other :c:type:`PyThreadState` objects belonging to the current interpreter and all other :c:type:`PyInterpreterState` objects. Due to this and the special nature of the :ref:`\"main\" interpreter `, :c:func:`fork` should only be called in that interpreter's \"main\" thread, where the CPython global runtime was originally initialized. The only exception is if :c:func:`exec` will be called immediately after." -msgstr "" +msgid "" +"The fact that all other threads go away also means that CPython's runtime " +"state there must be cleaned up properly, which :func:`os.fork` does. This " +"means finalizing all other :c:type:`PyThreadState` objects belonging to the " +"current interpreter and all other :c:type:`PyInterpreterState` objects. Due" +" to this and the special nature of the :ref:`\"main\" interpreter `, :c:func:`fork` should only be called in that " +"interpreter's \"main\" thread, where the CPython global runtime was " +"originally initialized. The only exception is if :c:func:`exec` will be " +"called immediately after." +msgstr "" +"این واقعیت که همه نخ‌های دیگر از بین می‌روند، همچنین به این معناست که وضعیت " +"ران‌تایم سی‌پایتون در آن‌جا باید به‌درستی پاک‌سازی شود، که :func:`os.fork` " +"این کار را انجام می‌دهد. این به معنای نهایی کردن همه اشیاء دیگر " +":c:type:`PyThreadState` متعلق به مفسر فعلی و همه اشیاء دیگر " +":c:type:`PyInterpreterState` است. به دلیل این موضوع و ماهیت خاص :ref:`مفسر " +"«اصلی» `، :c:func:`fork` باید فقط در نخ «اصلی» آن " +"مفسر فراخوانی شود، جایی که ران‌تایم سراسری سی‌پایتون در ابتدا راه‌اندازی شده" +" بود. تنها استثنا زمانی است که :c:func:`exec` بلافاصله پس از آن فراخوانی " +"شود." msgid "High-level APIs" -msgstr "" +msgstr "APIهای سطح‌بالا" -msgid "These are the most commonly used types and functions when writing multi-threaded C extensions." +msgid "" +"These are the most commonly used types and functions when writing multi-" +"threaded C extensions." msgstr "" +"این‌ها پرکاربردترین نوع‌ها و توابع هنگام نوشتن توسعه‌های C چندنخی هستند." -msgid "This data structure represents the state of a single thread. The only public data member is:" +msgid "" +"This data structure represents the state of a single thread. The only " +"public data member is:" msgstr "" +"این ساختار داده، وضعیت یک نخ منفرد را نشان می‌دهد. تنها عضو داده‌ی عمومی " +"عبارت است از:" msgid "This thread's interpreter state." -msgstr "" +msgstr "وضعیت مفسر این نخ." msgid "Deprecated function which does nothing." -msgstr "" +msgstr "تابع منسوخ که هیچ کاری انجام نمی‌دهد." -msgid "In Python 3.6 and older, this function created the GIL if it didn't exist." +msgid "" +"In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" +"در پایتون 3.6 و نسخه‌های قدیمی‌تر، این تابع در صورت عدم وجود، قفل مفسر " +"سراسری را ایجاد می‌کرد." msgid "The function now does nothing." -msgstr "" +msgstr "تابع اکنون هیچ کاری انجام نمی‌دهد." -msgid "This function is now called by :c:func:`Py_Initialize()`, so you don't have to call it yourself anymore." +msgid "" +"This function is now called by :c:func:`Py_Initialize()`, so you don't have " +"to call it yourself anymore." msgstr "" +"این تابع اکنون توسط :c:func:`Py_Initialize()` فراخوانی می‌شود، بنابراین دیگر" +" لازم نیست خودتان آن را فراخوانی کنید." -msgid "This function cannot be called before :c:func:`Py_Initialize()` anymore." +msgid "" +"This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" +"این تابع دیگر نمی‌تواند پیش از :c:func:`Py_Initialize()` فراخوانی شود." -msgid "Detach the :term:`attached thread state` and return it. The thread will have no :term:`thread state` upon returning." +msgid "" +"Detach the :term:`attached thread state` and return it. The thread will have" +" no :term:`thread state` upon returning." msgstr "" +":term:`attached thread state` را جدا کنید و آن را برگردانید. پس از بازگشت، " +"نخ هیچ :term:`thread state` نخواهد داشت." -msgid "Set the :term:`attached thread state` to *tstate*. The passed :term:`thread state` **should not** be :term:`attached `, otherwise deadlock ensues. *tstate* will be attached upon returning." +msgid "" +"Set the :term:`attached thread state` to *tstate*. The passed :term:`thread " +"state` **should not** be :term:`attached `, otherwise" +" deadlock ensues. *tstate* will be attached upon returning." msgstr "" +":term:`وضعیت نخ متصل ` را به *tstate* تنظیم کنید. " +":term:`وضعیت نخ ` ارسال‌شده **نباید** " +":term:`متصل ` باشد، در غیر این صورت بن‌بست رخ می‌دهد. " +"پس از بازگشت، *tstate* متصل خواهد شد." -msgid "Calling this function from a thread when the runtime is finalizing will hang the thread until the program exits, even if the thread was not created by Python. Refer to :ref:`cautions-regarding-runtime-finalization` for more details." +msgid "" +"Calling this function from a thread when the runtime is finalizing will hang" +" the thread until the program exits, even if the thread was not created by " +"Python. Refer to :ref:`cautions-regarding-runtime-finalization` for more " +"details." msgstr "" +"فراخوانی این تابع از یک نخ در زمانی که ران‌تایم در حال نهایی‌سازی است، باعث " +"می‌شود نخ تا زمان خروج از برنامه معلق بماند، حتی اگر آن نخ توسط پایتون ایجاد" +" نشده باشد. برای جزئیات بیشتر به :ref:`cautions-regarding-runtime-" +"finalization` مراجعه کنید." -msgid "Hangs the current thread, rather than terminating it, if called while the interpreter is finalizing." +msgid "" +"Hangs the current thread, rather than terminating it, if called while the " +"interpreter is finalizing." msgstr "" +"اگر در حین نهایی‌سازی مفسر فراخوانی شود، نخ فعلی را معلق می‌کند، نه اینکه آن" +" را خاتمه دهد." -msgid "Return the :term:`attached thread state`. If the thread has no attached thread state, (such as when inside of :c:macro:`Py_BEGIN_ALLOW_THREADS` block), then this issues a fatal error (so that the caller needn't check for ``NULL``)." +msgid "" +"Return the :term:`attached thread state`. If the thread has no attached " +"thread state, (such as when inside of :c:macro:`Py_BEGIN_ALLOW_THREADS` " +"block), then this issues a fatal error (so that the caller needn't check for" +" ``NULL``)." msgstr "" +":term:`attached thread state` را برمی‌گرداند. اگر نخ وضعیت نخ متصلی نداشته " +"باشد (مانند زمانی که درون بلوک :c:macro:`Py_BEGIN_ALLOW_THREADS` هستیم)، " +"خطای مهلک ایجاد می‌شود (تا فراخواننده نیازی به بررسی ``NULL`` نداشته باشد)." msgid "See also :c:func:`PyThreadState_GetUnchecked`." -msgstr "" +msgstr "همچنین :c:func:`PyThreadState_GetUnchecked` را ببینید." -msgid "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a fatal error if it is NULL. The caller is responsible to check if the result is NULL." +msgid "" +"Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " +"fatal error if it is NULL. The caller is responsible to check if the result " +"is NULL." msgstr "" +"مشابه :c:func:`PyThreadState_Get`، اما اگر NULL باشد، فرایند را با خطای مهلک" +" از بین نمی‌برد. فراخواننده مسئول بررسی NULL بودن نتیجه است." -msgid "In Python 3.5 to 3.12, the function was private and known as ``_PyThreadState_UncheckedGet()``." +msgid "" +"In Python 3.5 to 3.12, the function was private and known as " +"``_PyThreadState_UncheckedGet()``." msgstr "" +"در پایتون 3.5 تا 3.12، این تابع خصوصی بود و به نام " +"``_PyThreadState_UncheckedGet()`` شناخته می‌شد." -msgid "Set the :term:`attached thread state` to *tstate*, and return the :term:`thread state` that was attached prior to calling." +msgid "" +"Set the :term:`attached thread state` to *tstate*, and return the " +":term:`thread state` that was attached prior to calling." msgstr "" +":term:`attached thread state` را روی *tstate* تنظیم می‌کند و " +":term:`thread state` را که پیش از فراخوانی متصل بوده است، بازمی‌گرداند." -msgid "This function is safe to call without an :term:`attached thread state`; it will simply return ``NULL`` indicating that there was no prior thread state." +msgid "" +"This function is safe to call without an :term:`attached thread state`; it " +"will simply return ``NULL`` indicating that there was no prior thread state." msgstr "" +"فراخوانی این تابع بدون :term:`وضعیت نخ متصل ` ایمن " +"است؛ این تابع صرفاً ``NULL`` را برمی‌گرداند که نشان می‌دهد هیچ وضعیت نخ " +"پیشینی وجود نداشته است." msgid ":c:func:`PyEval_ReleaseThread`" -msgstr "" +msgstr ":c:func:`PyEval_ReleaseThread`" -msgid "Similar to :c:func:`PyGILState_Ensure`, this function will hang the thread if the runtime is finalizing." +msgid "" +"Similar to :c:func:`PyGILState_Ensure`, this function will hang the thread " +"if the runtime is finalizing." msgstr "" +"مشابه :c:func:`PyGILState_Ensure`، این تابع در صورتی که ران‌تایم در حال " +"نهایی‌سازی باشد، نخ را معلق می‌کند." msgid "GIL-state APIs" -msgstr "" +msgstr "APIهای وضعیت قفل مفسر سراسری" -msgid "The following functions use thread-local storage, and are not compatible with sub-interpreters:" +msgid "" +"The following functions use thread-local storage, and are not compatible " +"with sub-interpreters:" msgstr "" +"توابع زیر از ذخیره‌سازی نخ‌محلی استفاده می‌کنند و با زیرمفسر‌ها (sub-" +"interpreters) سازگار نیستند:" -msgid "The type of the value returned by :c:func:`PyGILState_Ensure` and passed to :c:func:`PyGILState_Release`." +msgid "" +"The type of the value returned by :c:func:`PyGILState_Ensure` and passed to " +":c:func:`PyGILState_Release`." msgstr "" +"نوع مقداری که توسط :c:func:`PyGILState_Ensure` بازگردانده می‌شود و به " +":c:func:`PyGILState_Release` پاس داده می‌شود." msgid "The GIL was already held when :c:func:`PyGILState_Ensure` was called." msgstr "" +"هنگام فراخوانی :c:func:`PyGILState_Ensure`، قفل مفسر سراسری از قبل گرفته شده" +" بود." msgid "The GIL was not held when :c:func:`PyGILState_Ensure` was called." msgstr "" +"قفل مفسر سراسری هنگام فراخوانی :c:func:`PyGILState_Ensure` در اختیار گرفته " +"نشده بود." -msgid "Ensure that the current thread is ready to call the Python C API regardless of the current state of Python, or of the :term:`attached thread state`. This may be called as many times as desired by a thread as long as each call is matched with a call to :c:func:`PyGILState_Release`. In general, other thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` calls as long as the thread state is restored to its previous state before the Release(). For example, normal usage of the :c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros is acceptable." -msgstr "" +msgid "" +"Ensure that the current thread is ready to call the Python C API regardless " +"of the current state of Python, or of the :term:`attached thread state`. " +"This may be called as many times as desired by a thread as long as each call" +" is matched with a call to :c:func:`PyGILState_Release`. In general, other " +"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and " +":c:func:`PyGILState_Release` calls as long as the thread state is restored " +"to its previous state before the Release(). For example, normal usage of " +"the :c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` " +"macros is acceptable." +msgstr "" +"تضمین می‌کند که نخ فعلی، صرف‌نظر از وضعیت فعلی پایتون یا :term:`وضعیت نخ " +"متصل `، برای فراخوانی Python C API آماده باشد. یک نخ " +"می‌تواند این تابع را به هر تعداد که مطلوب است فراخوانی کند، به شرط آن‌که هر " +"فراخوانی با یک فراخوانی :c:func:`PyGILState_Release` جفت شود. به‌طور کلی، " +"می‌توان بین فراخوانی‌های :c:func:`PyGILState_Ensure` و " +":c:func:`PyGILState_Release` از سایر APIهای مربوط به نخ استفاده کرد، به شرط " +"آن‌که وضعیت نخ پیش از Release() به وضعیت پیشین خود بازگردانی شود. برای " +"نمونه، استفاده‌ی معمول از ماکروهای :c:macro:`Py_BEGIN_ALLOW_THREADS` و " +":c:macro:`Py_END_ALLOW_THREADS` قابل‌قبول است." -msgid "The return value is an opaque \"handle\" to the :term:`attached thread state` when :c:func:`PyGILState_Ensure` was called, and must be passed to :c:func:`PyGILState_Release` to ensure Python is left in the same state. Even though recursive calls are allowed, these handles *cannot* be shared - each unique call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:func:`PyGILState_Release`." -msgstr "" +msgid "" +"The return value is an opaque \"handle\" to the :term:`attached thread " +"state` when :c:func:`PyGILState_Ensure` was called, and must be passed to " +":c:func:`PyGILState_Release` to ensure Python is left in the same state. " +"Even though recursive calls are allowed, these handles *cannot* be shared - " +"each unique call to :c:func:`PyGILState_Ensure` must save the handle for its" +" call to :c:func:`PyGILState_Release`." +msgstr "" +"مقدار بازگشتی، یک «دسته» مات برای :term:`attached thread state` در زمان " +"فراخوانی :c:func:`PyGILState_Ensure` است و باید به " +":c:func:`PyGILState_Release` پاس داده شود تا اطمینان حاصل شود که پایتون در " +"همان وضعیت باقی می‌ماند. هرچند فراخوانی‌های بازگشتی مجاز هستند، این دسته‌ها " +"*نمی‌توانند* به اشتراک گذاشته شوند؛ هر فراخوانی مجزای " +":c:func:`PyGILState_Ensure` باید دسته را برای فراخوانی خود به " +":c:func:`PyGILState_Release` ذخیره کند." -msgid "When the function returns, there will be an :term:`attached thread state` and the thread will be able to call arbitrary Python code. Failure is a fatal error." +msgid "" +"When the function returns, there will be an :term:`attached thread state` " +"and the thread will be able to call arbitrary Python code. Failure is a " +"fatal error." msgstr "" +"هنگامی که تابع بازمی‌گردد، یک :term:`attached thread state` وجود خواهد داشت " +"و نخ قادر خواهد بود کد دلخواه پایتون را فراخوانی کند. شکست یک خطای مهلک " +"است." -msgid "Calling this function when the runtime is finalizing is unsafe. Doing so will either hang the thread until the program ends, or fully crash the interpreter in rare cases. Refer to :ref:`cautions-regarding-runtime-finalization` for more details." +msgid "" +"Calling this function when the runtime is finalizing is unsafe. Doing so " +"will either hang the thread until the program ends, or fully crash the " +"interpreter in rare cases. Refer to :ref:`cautions-regarding-runtime-" +"finalization` for more details." msgstr "" +"فراخوانی این تابع هنگامی که ران‌تایم در حال نهایی‌سازی است، ناامن است. انجام" +" این کار یا باعث می‌شود نخ تا پایان برنامه معلق بماند، یا در موارد نادر مفسر" +" به‌طور کامل فروپاشی می‌کند. برای جزئیات بیشتر به :ref:`cautions-regarding-" +"runtime-finalization` مراجعه کنید." -msgid "Release any resources previously acquired. After this call, Python's state will be the same as it was prior to the corresponding :c:func:`PyGILState_Ensure` call (but generally this state will be unknown to the caller, hence the use of the GILState API)." +msgid "" +"Release any resources previously acquired. After this call, Python's state " +"will be the same as it was prior to the corresponding " +":c:func:`PyGILState_Ensure` call (but generally this state will be unknown " +"to the caller, hence the use of the GILState API)." msgstr "" +"هر منبعی که پیش‌تر به‌دست آمده است را آزاد می‌کند. پس از این فراخوانی، وضعیت" +" پایتون همان وضعیتی خواهد بود که پیش از فراخوانی متناظر " +":c:func:`PyGILState_Ensure` وجود داشت (اما به‌طور کلی این وضعیت برای " +"فراخواننده ناشناخته است، از این رو از GILState API استفاده می‌شود)." -msgid "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:func:`PyGILState_Release` on the same thread." +msgid "" +"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to " +":c:func:`PyGILState_Release` on the same thread." msgstr "" +"هر فراخوانی :c:func:`PyGILState_Ensure` باید با یک فراخوانی " +":c:func:`PyGILState_Release` روی همان نخ متناظر باشد." -msgid "Get the :term:`attached thread state` for this thread. May return ``NULL`` if no GILState API has been used on the current thread. Note that the main thread always has such a thread-state, even if no auto-thread-state call has been made on the main thread. This is mainly a helper/diagnostic function." +msgid "" +"Get the :term:`attached thread state` for this thread. May return ``NULL`` " +"if no GILState API has been used on the current thread. Note that the main " +"thread always has such a thread-state, even if no auto-thread-state call has" +" been made on the main thread. This is mainly a helper/diagnostic function." msgstr "" +":term:`وضعیت نخ متصل ` مربوط به این نخ را " +"برمی‌گرداند. اگر هیچ API‌ی GILState روی نخ فعلی استفاده نشده باشد، ممکن است " +"``NULL`` را برگرداند. توجه داشته باشید که نخ اصلی همیشه چنین وضعیت نخی دارد،" +" حتی اگر هیچ فراخوانی auto-thread-state روی نخ اصلی انجام نشده باشد. این " +"عمدتاً یک تابع کمکی/تشخیصی است." -msgid "This function may return non-``NULL`` even when the :term:`thread state` is detached. Prefer :c:func:`PyThreadState_Get` or :c:func:`PyThreadState_GetUnchecked` for most cases." +msgid "" +"This function may return non-``NULL`` even when the :term:`thread state` is " +"detached. Prefer :c:func:`PyThreadState_Get` or " +":c:func:`PyThreadState_GetUnchecked` for most cases." msgstr "" +"این تابع ممکن است حتی زمانی که :term:`thread state` جدا شده باشد، مقدار غیر " +"``NULL`` را برگرداند. برای بیشتر موارد، :c:func:`PyThreadState_Get` یا " +":c:func:`PyThreadState_GetUnchecked` را ترجیح دهید." msgid ":c:func:`PyThreadState_Get`" -msgstr "" +msgstr ":c:func:`PyThreadState_Get`" -msgid "Return ``1`` if the current thread is holding the :term:`GIL` and ``0`` otherwise. This function can be called from any thread at any time. Only if it has had its :term:`thread state ` initialized via :c:func:`PyGILState_Ensure` will it return ``1``. This is mainly a helper/diagnostic function. It can be useful for example in callback contexts or memory allocation functions when knowing that the :term:`GIL` is locked can allow the caller to perform sensitive actions or otherwise behave differently." -msgstr "" +msgid "" +"Return ``1`` if the current thread is holding the :term:`GIL` and ``0`` " +"otherwise. This function can be called from any thread at any time. Only if " +"it has had its :term:`thread state ` initialized via " +":c:func:`PyGILState_Ensure` will it return ``1``. This is mainly a " +"helper/diagnostic function. It can be useful for example in callback " +"contexts or memory allocation functions when knowing that the :term:`GIL` is" +" locked can allow the caller to perform sensitive actions or otherwise " +"behave differently." +msgstr "" +"اگر نخ فعلی :term:`قفل مفسر سراسری ` را در اختیار داشته باشد، ``1`` و " +"در غیر این صورت ``0`` را برمی‌گرداند. این تابع را می‌توان در هر زمان از هر " +"نخی فراخوانی کرد. تنها در صورتی ``1`` برمی‌گرداند که :term:`وضعیت نخ " +"` آن از طریق :c:func:`PyGILState_Ensure` مقداردهی " +"اولیه شده باشد. این عمدتاً یک تابع کمکی/تشخیصی است. این تابع می‌تواند برای " +"مثال در زمینه‌های کال‌بک یا توابع تخصیص حافظه مفید باشد؛ زمانی که دانستن " +"اینکه :term:`قفل مفسر سراسری ` گرفته شده است می‌تواند به فراخوان‌کننده " +"اجازه دهد تا کنش‌های حساسی انجام دهد یا رفتار متفاوتی داشته باشد." -msgid "If the current Python process has ever created a subinterpreter, this function will *always* return ``1``. Prefer :c:func:`PyThreadState_GetUnchecked` for most cases." +msgid "" +"If the current Python process has ever created a subinterpreter, this " +"function will *always* return ``1``. Prefer " +":c:func:`PyThreadState_GetUnchecked` for most cases." msgstr "" +"اگر فرایند فعلی پایتون تا به حال یک زیرمفسر (subinterpreter) ایجاد کرده " +"باشد، این تابع *همیشه* ``1`` را برمی‌گرداند. در بیشتر موارد، " +":c:func:`PyThreadState_GetUnchecked` را ترجیح دهید." msgid "Low-level APIs" -msgstr "" +msgstr "APIهای سطح پایین" -msgid "Create a new thread state object belonging to the given interpreter object. An :term:`attached thread state` is not needed." +msgid "" +"Create a new thread state object belonging to the given interpreter object. " +"An :term:`attached thread state` is not needed." msgstr "" +"یک شیء وضعیت نخ جدید متعلق به شیء مفسر داده‌شده ایجاد کنید. به یک " +":term:`وضعیت نخ متصل ` نیازی نیست." -msgid "Reset all information in a :term:`thread state` object. *tstate* must be :term:`attached `" +msgid "" +"Reset all information in a :term:`thread state` object. *tstate* must be " +":term:`attached `" msgstr "" +"تمام اطلاعات در یک شیء :term:`وضعیت نخ ` را بازنشانی می‌کند. " +"*tstate* باید :term:`متصل ` باشد" -msgid "This function now calls the :c:member:`!PyThreadState.on_delete` callback. Previously, that happened in :c:func:`PyThreadState_Delete`." +msgid "" +"This function now calls the :c:member:`!PyThreadState.on_delete` callback. " +"Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" +"این تابع اکنون کال‌بک :c:member:`!PyThreadState.on_delete` را فراخوانی " +"می‌کند. پیش‌تر، این کار در :c:func:`PyThreadState_Delete` انجام می‌شد." msgid "The :c:member:`!PyThreadState.on_delete` callback was removed." -msgstr "" +msgstr "کال‌بک :c:member:`!PyThreadState.on_delete` حذف شد." -msgid "Destroy a :term:`thread state` object. *tstate* should not be :term:`attached ` to any thread. *tstate* must have been reset with a previous call to :c:func:`PyThreadState_Clear`." +msgid "" +"Destroy a :term:`thread state` object. *tstate* should not be " +":term:`attached ` to any thread. *tstate* must have " +"been reset with a previous call to :c:func:`PyThreadState_Clear`." msgstr "" +"یک شیء :term:`وضعیت نخ ` را نابود می‌کند. *tstate* نباید به " +"هیچ نخی :term:`متصل ` باشد. *tstate* باید پیش‌تر با " +"فراخوانی :c:func:`PyThreadState_Clear` بازنشانی شده باشد." -msgid "Detach the :term:`attached thread state` (which must have been reset with a previous call to :c:func:`PyThreadState_Clear`) and then destroy it." +msgid "" +"Detach the :term:`attached thread state` (which must have been reset with a " +"previous call to :c:func:`PyThreadState_Clear`) and then destroy it." msgstr "" +":term:`وضعیت نخ متصل ` را جدا کنید (که باید پیش‌تر با" +" یک فراخوانی از :c:func:`PyThreadState_Clear` بازنشانی شده باشد) و سپس آن را" +" نابود کنید." -msgid "No :term:`thread state` will be :term:`attached ` upon returning." +msgid "" +"No :term:`thread state` will be :term:`attached ` " +"upon returning." msgstr "" +"پس از بازگشت، هیچ :term:`thread state`\\ ای :term:`پیوست ` نخواهد شد." msgid "Get the current frame of the Python thread state *tstate*." -msgstr "" +msgstr "گرفتن فریم فعلی وضعیت نخ پایتون *tstate*." -msgid "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently executing." +msgid "" +"Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " +"executing." msgstr "" +"یک :term:`ارجاع قوی ` را برمی‌گرداند. اگر هیچ فریمی " +"هم‌اکنون در حال اجرا نباشد، ``NULL`` را برمی‌گرداند." msgid "See also :c:func:`PyEval_GetFrame`." -msgstr "" +msgstr "همچنین ببینید :c:func:`PyEval_GetFrame`." -msgid "*tstate* must not be ``NULL``, and must be :term:`attached `." +msgid "" +"*tstate* must not be ``NULL``, and must be :term:`attached `." msgstr "" +"*tstate* نباید ``NULL`` باشد، و باید :term:`متصل ` " +"باشد." -msgid "Get the unique :term:`thread state` identifier of the Python thread state *tstate*." +msgid "" +"Get the unique :term:`thread state` identifier of the Python thread state " +"*tstate*." msgstr "" +"شناسه‌ی یکتای :term:`thread state` را از وضعیت نخ پایتون *tstate* دریافت " +"کنید." msgid "Get the interpreter of the Python thread state *tstate*." -msgstr "" +msgstr "مفسر وضعیت نخ پایتون *tstate* را برمی‌گرداند." msgid "Suspend tracing and profiling in the Python thread state *tstate*." -msgstr "" +msgstr "ردگیری و پروفایل‌گیری را در وضعیت نخ پایتون *tstate* تعلیق می‌کند." msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" +"برای از سر گرفتن آن‌ها، از تابع :c:func:`PyThreadState_LeaveTracing` استفاده" +" کنید." -msgid "Resume tracing and profiling in the Python thread state *tstate* suspended by the :c:func:`PyThreadState_EnterTracing` function." +msgid "" +"Resume tracing and profiling in the Python thread state *tstate* suspended " +"by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" +"ردگیری و پروفایل‌گیری را در وضعیت نخ پایتون *tstate* که توسط تابع " +":c:func:`PyThreadState_EnterTracing` معلق شده است، از سر می‌گیرد." -msgid "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." +msgid "" +"See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` " +"functions." msgstr "" +"همچنین توابع :c:func:`PyEval_SetTrace` و :c:func:`PyEval_SetProfile` را " +"ببینید." -msgid "Set the stack protection start address and stack protection size of a Python thread state." +msgid "" +"Set the stack protection start address and stack protection size of a Python" +" thread state." msgstr "" +"آدرس شروع حفاظت پشته و اندازه حفاظت پشته‌ی یک وضعیت نخ پایتون را تنظیم " +"می‌کند." -msgid "On success, return ``0``. On failure, set an exception and return ``-1``." +msgid "" +"On success, return ``0``. On failure, set an exception and return ``-1``." msgstr "" +"در صورت موفقیت، ``0`` برمی‌گرداند. در صورت شکست، یک استثنا تنظیم کرده و " +"``-1`` برمی‌گرداند." -msgid "CPython implements :ref:`recursion control ` for C code by raising :py:exc:`RecursionError` when it notices that the machine execution stack is close to overflow. See for example the :c:func:`Py_EnterRecursiveCall` function. For this, it needs to know the location of the current thread's stack, which it normally gets from the operating system. When the stack is changed, for example using context switching techniques like the Boost library's ``boost::context``, you must call :c:func:`~PyUnstable_ThreadState_SetStackProtection` to inform CPython of the change." -msgstr "" +msgid "" +"CPython implements :ref:`recursion control ` for C code by " +"raising :py:exc:`RecursionError` when it notices that the machine execution " +"stack is close to overflow. See for example the " +":c:func:`Py_EnterRecursiveCall` function. For this, it needs to know the " +"location of the current thread's stack, which it normally gets from the " +"operating system. When the stack is changed, for example using context " +"switching techniques like the Boost library's ``boost::context``, you must " +"call :c:func:`~PyUnstable_ThreadState_SetStackProtection` to inform CPython " +"of the change." +msgstr "" +"سی‌پایتون :ref:`کنترل بازگشت ` را برای کد C به این صورت " +"پیاده‌سازی می‌کند که وقتی متوجه می‌شود که پشته اجرای ماشین نزدیک به سرریز " +"است، :py:exc:`RecursionError` ایجاد می‌کند. برای نمونه، تابع " +":c:func:`Py_EnterRecursiveCall` را ببینید. برای این کار، سی‌پایتون باید مکان" +" پشته نخ فعلی را بداند که معمولاً آن را از سیستم‌عامل دریافت می‌کند. هنگامی " +"که پشته تغییر می‌کند، مثلاً با استفاده از تکنیک‌های تعویض زمینه مانند " +"``boost::context`` در کتابخانه Boost، باید " +":c:func:`~PyUnstable_ThreadState_SetStackProtection` را فراخوانی کنید تا " +"سی‌پایتون را از این تغییر مطلع کنید." -msgid "Call :c:func:`~PyUnstable_ThreadState_SetStackProtection` either before or after changing the stack. Do not call any other Python C API between the call and the stack change." +msgid "" +"Call :c:func:`~PyUnstable_ThreadState_SetStackProtection` either before or " +"after changing the stack. Do not call any other Python C API between the " +"call and the stack change." msgstr "" +"تابع :c:func:`~PyUnstable_ThreadState_SetStackProtection` را یا پیش از تغییر" +" پشته یا پس از آن فراخوانی کنید. بین این فراخوانی و تغییر پشته، هیچ فراخوانی" +" دیگری به C API پایتون انجام ندهید." -msgid "See :c:func:`PyUnstable_ThreadState_ResetStackProtection` for undoing this operation." +msgid "" +"See :c:func:`PyUnstable_ThreadState_ResetStackProtection` for undoing this " +"operation." msgstr "" +"برای بازگردانی این عملیات، به " +":c:func:`PyUnstable_ThreadState_ResetStackProtection` مراجعه کنید." -msgid "Reset the stack protection start address and stack protection size of a Python thread state to the operating system defaults." +msgid "" +"Reset the stack protection start address and stack protection size of a " +"Python thread state to the operating system defaults." msgstr "" +"نشانی شروع حفاظت پشته و اندازه حفاظت پشته وضعیت نخ پایتون را به پیش‌فرض‌های " +"سیستم‌عامل بازنشانی می‌کند." -msgid "See :c:func:`PyUnstable_ThreadState_SetStackProtection` for an explanation." +msgid "" +"See :c:func:`PyUnstable_ThreadState_SetStackProtection` for an explanation." msgstr "" +"برای توضیح به :c:func:`PyUnstable_ThreadState_SetStackProtection` مراجعه " +"کنید." -msgid "Return a dictionary in which extensions can store thread-specific state information. Each extension should use a unique key to use to store state in the dictionary. It is okay to call this function when no :term:`thread state` is :term:`attached `. If this function returns ``NULL``, no exception has been raised and the caller should assume no thread state is attached." -msgstr "" +msgid "" +"Return a dictionary in which extensions can store thread-specific state " +"information. Each extension should use a unique key to use to store state " +"in the dictionary. It is okay to call this function when no :term:`thread " +"state` is :term:`attached `. If this function returns" +" ``NULL``, no exception has been raised and the caller should assume no " +"thread state is attached." +msgstr "" +"یک دیکشنری برمی‌گرداند که افزونه‌ها می‌توانند اطلاعات وضعیت مخصوص نخ را در " +"آن ذخیره کنند. هر افزونه باید برای ذخیره‌سازی وضعیت در دیکشنری، از یک کلید " +"یکتا استفاده کند. اشکالی ندارد این تابع را زمانی که هیچ :term:`thread state` " +":term:`متصل ` نیست، فراخوانی کنید. " +"اگر این تابع ``NULL`` برگرداند، هیچ استثنایی مطرح نشده است و فراخوان‌کننده " +"باید فرض کند که هیچ وضعیت نخی متصل نیست." -msgid ":term:`Attach ` *tstate* to the current thread, which must not be ``NULL`` or already :term:`attached `." +msgid "" +":term:`Attach ` *tstate* to the current thread, which" +" must not be ``NULL`` or already :term:`attached `." msgstr "" +"*tstate* را، که نباید ``NULL`` یا از قبل :term:`پیوست‌شده ` باشد، به نخ فعلی :term:`پیوست می‌کند `." -msgid "The calling thread must not already have an :term:`attached thread state`." +msgid "" +"The calling thread must not already have an :term:`attached thread state`." msgstr "" +"نخ فراخواننده نباید از قبل یک :term:`attached thread state` داشته باشد." -msgid "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the current thread if called while the interpreter is finalizing." +msgid "" +"Updated to be consistent with :c:func:`PyEval_RestoreThread`, " +":c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and " +"terminate the current thread if called while the interpreter is finalizing." msgstr "" +"به‌روزرسانی شد تا با :c:func:`PyEval_RestoreThread`، " +":c:func:`Py_END_ALLOW_THREADS` و :c:func:`PyGILState_Ensure` سازگار باشد و " +"اگر در حین نهایی‌سازی مفسر فراخوانی شود، نخ جاری را خاتمه می‌دهد." -msgid ":c:func:`PyEval_RestoreThread` is a higher-level function which is always available (even when threads have not been initialized)." +msgid "" +":c:func:`PyEval_RestoreThread` is a higher-level function which is always " +"available (even when threads have not been initialized)." msgstr "" +":c:func:`PyEval_RestoreThread` تابعی در سطح بالاتر است که همیشه در دسترس است" +" (حتی زمانی که نخ‌ها مقداردهی اولیه نشده باشند)." -msgid "Detach the :term:`attached thread state`. The *tstate* argument, which must not be ``NULL``, is only used to check that it represents the :term:`attached thread state` --- if it isn't, a fatal error is reported." +msgid "" +"Detach the :term:`attached thread state`. The *tstate* argument, which must " +"not be ``NULL``, is only used to check that it represents the " +":term:`attached thread state` --- if it isn't, a fatal error is reported." msgstr "" +":term:`وضعیت نخ متصل ` را جدا می‌کند. آرگومان " +"*tstate*، که نباید ``NULL`` باشد، تنها برای بررسی این‌که :term:`وضعیت نخ " +"متصل ` را نمایندگی می‌کند استفاده می‌شود --- اگر چنین" +" نباشد، خطای مهلکی گزارش می‌شود." -msgid ":c:func:`PyEval_SaveThread` is a higher-level function which is always available (even when threads have not been initialized)." +msgid "" +":c:func:`PyEval_SaveThread` is a higher-level function which is always " +"available (even when threads have not been initialized)." msgstr "" +":c:func:`PyEval_SaveThread` تابعی در سطح بالاتر است که همیشه دسترس‌پذیر است " +"(حتی زمانی که نخ‌ها مقداردهی اولیه نشده باشند)." msgid "Asynchronous notifications" -msgstr "" +msgstr "اطلاع‌رسانی ناهمگام" -msgid "A mechanism is provided to make asynchronous notifications to the main interpreter thread. These notifications take the form of a function pointer and a void pointer argument." +msgid "" +"A mechanism is provided to make asynchronous notifications to the main " +"interpreter thread. These notifications take the form of a function pointer" +" and a void pointer argument." msgstr "" +"سازوکاری برای ارسال اعلان‌های ناهمگام به نخ اصلی مفسر ارائه شده است. این " +"اعلان‌ها به شکل یک اشاره‌گر تابع و یک آرگومان اشاره‌گر void هستند." -msgid "Schedule a function to be called from the main interpreter thread. On success, ``0`` is returned and *func* is queued for being called in the main thread. On failure, ``-1`` is returned without setting any exception." +msgid "" +"Schedule a function to be called from the main interpreter thread. On " +"success, ``0`` is returned and *func* is queued for being called in the main" +" thread. On failure, ``-1`` is returned without setting any exception." msgstr "" +"یک تابع را برای فراخوانی از نخ اصلی مفسر زمان‌بندی می‌کند. در صورت موفقیت، " +"``0`` بازگردانده می‌شود و *func* برای فراخوانی در نخ اصلی در صف قرار " +"می‌گیرد. در صورت شکست، ``-1`` بدون تنظیم هیچ استثنایی بازگردانده می‌شود." -msgid "When successfully queued, *func* will be *eventually* called from the main interpreter thread with the argument *arg*. It will be called asynchronously with respect to normally running Python code, but with both these conditions met:" +msgid "" +"When successfully queued, *func* will be *eventually* called from the main " +"interpreter thread with the argument *arg*. It will be called " +"asynchronously with respect to normally running Python code, but with both " +"these conditions met:" msgstr "" +"هنگامی که با موفقیت در صف قرار گیرد، *func* *سرانجام* از نخ اصلی مفسر با " +"آرگومان *arg* فراخوانی خواهد شد. این تابع نسبت به کد پایتونی که به‌طور عادی " +"در حال اجراست، به‌صورت ناهمگام فراخوانی خواهد شد، اما با برآورده شدن هر دوی " +"این شرایط:" msgid "on a :term:`bytecode` boundary;" -msgstr "" +msgstr "در مرز :term:`بایت‌کد `؛" -msgid "with the main thread holding an :term:`attached thread state` (*func* can therefore use the full C API)." +msgid "" +"with the main thread holding an :term:`attached thread state` (*func* can " +"therefore use the full C API)." msgstr "" +"در حالی که نخ اصلی یک :term:`وضعیت نخ متصل ` را در " +"اختیار دارد (*func* در نتیجه می‌تواند از تمام API زبان C استفاده کند)." -msgid "*func* must return ``0`` on success, or ``-1`` on failure with an exception set. *func* won't be interrupted to perform another asynchronous notification recursively, but it can still be interrupted to switch threads if the :term:`thread state ` is detached." +msgid "" +"*func* must return ``0`` on success, or ``-1`` on failure with an exception " +"set. *func* won't be interrupted to perform another asynchronous " +"notification recursively, but it can still be interrupted to switch threads " +"if the :term:`thread state ` is detached." msgstr "" +"*func* باید در صورت موفقیت ``0`` و در صورت شکست همراه با یک استثنای " +"تنظیم‌شده ``-1`` را برگرداند. *func* برای انجام اطلاع‌رسانی ناهمگام دیگری " +"به‌صورت بازگشتی قطع نمی‌شود، اما اگر :term:`وضعیت نخ ` جداشده باشد، همچنان ممکن است برای تعویض نخ‌ها قطع شود." -msgid "This function doesn't need an :term:`attached thread state`. However, to call this function in a subinterpreter, the caller must have an :term:`attached thread state`. Otherwise, the function *func* can be scheduled to be called from the wrong interpreter." +msgid "" +"This function doesn't need an :term:`attached thread state`. However, to " +"call this function in a subinterpreter, the caller must have an " +":term:`attached thread state`. Otherwise, the function *func* can be " +"scheduled to be called from the wrong interpreter." msgstr "" +"این تابع به :term:`وضعیت نخ متصل ` نیاز ندارد. با این" +" حال، برای فراخوانی این تابع در یک زیرمفسر، فراخواننده باید :term:`وضعیت نخ " +"متصل ` داشته باشد. در غیر این صورت، ممکن است تابع " +"*func* برای فراخوانی از مفسر اشتباه زمان‌بندی شود." -msgid "This is a low-level function, only useful for very special cases. There is no guarantee that *func* will be called as quick as possible. If the main thread is busy executing a system call, *func* won't be called before the system call returns. This function is generally **not** suitable for calling Python code from arbitrary C threads. Instead, use the :ref:`PyGILState API`." -msgstr "" +msgid "" +"This is a low-level function, only useful for very special cases. There is " +"no guarantee that *func* will be called as quick as possible. If the main " +"thread is busy executing a system call, *func* won't be called before the " +"system call returns. This function is generally **not** suitable for " +"calling Python code from arbitrary C threads. Instead, use the " +":ref:`PyGILState API`." +msgstr "" +"این یک تابع سطح پایین است که فقط برای موارد بسیار خاص مفید است. هیچ تضمینی " +"وجود ندارد که *func* در سریع‌ترین حالت ممکن فراخوانی شود. اگر نخ اصلی مشغول " +"اجرای یک فراخوانی سیستمی باشد، *func* پیش از بازگشت فراخوانی سیستمی فراخوانی" +" نخواهد شد. این تابع به‌طور کلی برای فراخوانی کد پایتون از نخ‌های C دلخواه " +"مناسب **نیست**. در عوض، از :ref:`PyGILState API` استفاده کنید." -msgid "If this function is called in a subinterpreter, the function *func* is now scheduled to be called from the subinterpreter, rather than being called from the main interpreter. Each subinterpreter now has its own list of scheduled calls." +msgid "" +"If this function is called in a subinterpreter, the function *func* is now " +"scheduled to be called from the subinterpreter, rather than being called " +"from the main interpreter. Each subinterpreter now has its own list of " +"scheduled calls." msgstr "" +"اگر این تابع در یک زیرمفسر فراخوانی شود، تابع *func* اکنون برای فراخوانی از " +"طریق زیرمفسر زمان‌بندی می‌شود، نه از طریق مفسر اصلی. هر زیرمفسر اکنون فهرست " +"فراخوانی‌های زمان‌بندی‌شده‌ی خود را دارد." -msgid "This function now always schedules *func* to be run in the main interpreter." +msgid "" +"This function now always schedules *func* to be run in the main interpreter." msgstr "" +"این تابع اکنون همیشه *func* را برای اجرا در مفسر اصلی زمان‌بندی می‌کند." -msgid "Execute all pending calls. This is usually executed automatically by the interpreter." +msgid "" +"Execute all pending calls. This is usually executed automatically by the " +"interpreter." msgstr "" +"همه‌ی فراخوانی‌های در انتظار را اجرا می‌کند. این کار معمولاً به‌طور خودکار " +"توسط مفسر اجرا می‌شود." -msgid "This function returns ``0`` on success, and returns ``-1`` with an exception set on failure." +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception" +" set on failure." msgstr "" +"این تابع در صورت موفقیت ``0`` را بازمی‌گرداند و در صورت شکست ``-1`` را " +"به‌همراه یک استثنای تنظیم‌شده بازمی‌گرداند." -msgid "If this is not called in the main thread of the main interpreter, this function does nothing and returns ``0``. The caller must hold an :term:`attached thread state`." +msgid "" +"If this is not called in the main thread of the main interpreter, this " +"function does nothing and returns ``0``. The caller must hold an " +":term:`attached thread state`." msgstr "" +"اگر این تابع در نخ اصلی مفسر اصلی فراخوانی نشود، این تابع هیچ کاری انجام " +"نمی‌دهد و ``0`` را برمی‌گرداند. فراخواننده باید یک :term:`attached thread " +"state` را در اختیار داشته باشد." msgid "This function only runs pending calls in the main interpreter." -msgstr "" +msgstr "این تابع فقط فراخوانی‌های در انتظار را در مفسر اصلی اجرا می‌کند." -msgid "Asynchronously raise an exception in a thread. The *id* argument is the thread id of the target thread; *exc* is the exception object to be raised. This function does not :term:`steal` any references to *exc*. To prevent naive misuse, you must write your own C extension to call this. Must be called with an :term:`attached thread state`. Returns the number of thread states modified; this is normally one, but will be zero if the thread id isn't found. If *exc* is ``NULL``, the pending exception (if any) for the thread is cleared. This raises no exceptions." -msgstr "" +msgid "" +"Asynchronously raise an exception in a thread. The *id* argument is the " +"thread id of the target thread; *exc* is the exception object to be raised. " +"This function does not :term:`steal` any references to *exc*. To prevent " +"naive misuse, you must write your own C extension to call this. Must be " +"called with an :term:`attached thread state`. Returns the number of thread " +"states modified; this is normally one, but will be zero if the thread id " +"isn't found. If *exc* is ``NULL``, the pending exception (if any) for the " +"thread is cleared. This raises no exceptions." +msgstr "" +"یک استثنا را به‌صورت ناهمگام در یک نخ ایجاد می‌کند. آرگومان *id* شناسه‌ی نخ " +"هدف است؛ *exc* شیء استثنا است که باید ایجاد شود. این تابع هیچ ارجاعی به " +"*exc* را :term:`سرقت ` نمی‌کند. برای جلوگیری از سوءاستفاده‌ی " +"ساده‌لوحانه، باید برای فراخوانی این تابع، افزونه‌ی C خودتان را بنویسید. باید" +" با یک :term:`وضعیت نخ متصل ` فراخوانی شود. تعداد " +"وضعیت‌های نخ که تغییر کرده‌اند را برمی‌گرداند؛ این تعداد معمولاً یکی است، " +"اما اگر شناسه‌ی نخ پیدا نشود، صفر خواهد بود. اگر *exc* برابر ``NULL`` باشد، " +"استثنای در انتظار (در صورت وجود) برای آن نخ پاک می‌شود. این تابع هیچ " +"استثنایی ایجاد نمی‌کند." -msgid "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:`unsigned long`." +msgid "" +"The type of the *id* parameter changed from :c:expr:`long` to " +":c:expr:`unsigned long`." msgstr "" +"نوع پارامتر *id* از :c:expr:`long` به :c:expr:`unsigned long` تغییر یافت." msgid "Operating system thread APIs" -msgstr "" +msgstr "APIهای نخ سیستم‌عامل" msgid "Sentinel value for an invalid thread ID." -msgstr "" +msgstr "مقدار نشانگر برای شناسه‌ی نامعتبر نخ." msgid "This is currently equivalent to ``(unsigned long)-1``." -msgstr "" +msgstr "این در حال حاضر معادل ``(unsigned long)-1`` است." -msgid "Start function *func* in a new thread with argument *arg*. The resulting thread is not intended to be joined." +msgid "" +"Start function *func* in a new thread with argument *arg*. The resulting " +"thread is not intended to be joined." msgstr "" +"تابع *func* را با آرگومان *arg* در یک نخ جدید آغاز می‌کند. نخ حاصل برای " +"پیوستن در نظر گرفته نشده است." msgid "*func* must not be ``NULL``, but *arg* may be ``NULL``." -msgstr "" +msgstr "*func* نباید ``NULL`` باشد، اما *arg* می‌تواند ``NULL`` باشد." -msgid "On success, this function returns the identifier of the new thread; on failure, this returns :c:macro:`PYTHREAD_INVALID_THREAD_ID`." +msgid "" +"On success, this function returns the identifier of the new thread; on " +"failure, this returns :c:macro:`PYTHREAD_INVALID_THREAD_ID`." msgstr "" +"در صورت موفقیت، این تابع شناسه‌ی نخ جدید را برمی‌گرداند؛ در صورت شکست، " +":c:macro:`PYTHREAD_INVALID_THREAD_ID` را برمی‌گرداند." msgid "The caller does not need to hold an :term:`attached thread state`." msgstr "" +"فراخواننده نیازی به در اختیار داشتن :term:`attached thread state` ندارد." msgid "Return the identifier of the current thread, which will never be zero." -msgstr "" +msgstr "شناسه‌ی نخ فعلی را برمی‌گرداند که هرگز صفر نخواهد بود." -msgid "This function cannot fail, and the caller does not need to hold an :term:`attached thread state`." +msgid "" +"This function cannot fail, and the caller does not need to hold an " +":term:`attached thread state`." msgstr "" +"این تابع نمی‌تواند شکست بخورد و فراخوانی‌کننده نیازی به نگه داشتن " +":term:`attached thread state` ندارد." msgid ":py:func:`threading.get_ident`" -msgstr "" +msgstr ":py:func:`threading.get_ident`" -msgid "Get general information about the current thread in the form of a :ref:`struct sequence ` object. This information is accessible as :py:attr:`sys.thread_info` in Python." +msgid "" +"Get general information about the current thread in the form of a " +":ref:`struct sequence ` object. This information is" +" accessible as :py:attr:`sys.thread_info` in Python." msgstr "" +"اطلاعات کلی درباره‌ی نخ فعلی را به شکل یک شیء :ref:`دنباله ساختاری ` دریافت کنید. این اطلاعات در پایتون به صورت " +":py:attr:`sys.thread_info` در دسترس است." -msgid "On success, this returns a new :term:`strong reference` to the thread information; on failure, this returns ``NULL`` with an exception set." +msgid "" +"On success, this returns a new :term:`strong reference` to the thread " +"information; on failure, this returns ``NULL`` with an exception set." msgstr "" +"در صورت موفقیت، یک :term:`ارجاع قوی ` جدید به اطلاعات نخ " +"بازگردانده می‌شود؛ در صورت شکست، ``NULL`` همراه با یک استثنای تنظیم‌شده " +"بازگردانده می‌شود." msgid "The caller must hold an :term:`attached thread state`." msgstr "" +"فراخواننده باید یک :term:`attached thread state` را در اختیار داشته باشد." msgid "This macro is defined when the system supports native thread IDs." msgstr "" +"این ماکرو زمانی تعریف می‌شود که سیستم از شناسه‌های نخ بومی پشتیبانی کند." -msgid "Get the native identifier of the current thread as it was assigned by the operating system's kernel, which will never be less than zero." +msgid "" +"Get the native identifier of the current thread as it was assigned by the " +"operating system's kernel, which will never be less than zero." msgstr "" +"شناسه بومی نخ فعلی را همان‌طور که توسط هسته سیستم‌عامل به آن اختصاص داده شده" +" است به دست می‌آورد؛ این شناسه هرگز کمتر از صفر نخواهد بود." -msgid "This function is only available when :c:macro:`PY_HAVE_THREAD_NATIVE_ID` is defined." +msgid "" +"This function is only available when :c:macro:`PY_HAVE_THREAD_NATIVE_ID` is " +"defined." msgstr "" +"این تابع تنها زمانی دسترس‌پذیر است که :c:macro:`PY_HAVE_THREAD_NATIVE_ID` " +"تعریف‌شده باشد." msgid ":py:func:`threading.get_native_id`" -msgstr "" +msgstr ":py:func:`threading.get_native_id`" -msgid "Terminate the current thread. This function is generally considered unsafe and should be avoided. It is kept solely for backwards compatibility." +msgid "" +"Terminate the current thread. This function is generally considered unsafe " +"and should be avoided. It is kept solely for backwards compatibility." msgstr "" +"نخ فعلی را خاتمه می‌دهد. این تابع به‌طور کلی ناامن تلقی می‌شود و باید از آن " +"پرهیز کرد. این تابع صرفاً برای سازگاری با نسخه‌های پیشین نگه‌داشته شده است." -msgid "This function is only safe to call if all functions in the full call stack are written to safely allow it." +msgid "" +"This function is only safe to call if all functions in the full call stack " +"are written to safely allow it." msgstr "" +"فراخوانی این تابع تنها زمانی ایمن است که تمام توابع در کل پشته فراخوانی، " +"به‌گونه‌ای نوشته شده باشند که به‌صورت ایمن اجازه‌ی آن را بدهند." -msgid "If the current system uses POSIX threads (also known as \"pthreads\"), this calls :manpage:`pthread_exit(3)`, which attempts to unwind the stack and call C++ destructors on some libc implementations. However, if a ``noexcept`` function is reached, it may terminate the process. Other systems, such as macOS, do unwinding." -msgstr "" +msgid "" +"If the current system uses POSIX threads (also known as \"pthreads\"), this " +"calls :manpage:`pthread_exit(3)`, which attempts to unwind the stack and " +"call C++ destructors on some libc implementations. However, if a " +"``noexcept`` function is reached, it may terminate the process. Other " +"systems, such as macOS, do unwinding." +msgstr "" +"اگر سیستم فعلی از نخ‌های POSIX (که با نام «pthreads» نیز شناخته می‌شوند) " +"استفاده کند، این تابع :manpage:`pthread_exit(3)` را فراخوانی می‌کند که تلاش " +"می‌کند واپیمایش پشته (stack unwinding) را انجام دهد و در برخی پیاده‌سازی‌های" +" libc مخرب‌های C++ را فراخوانی کند. اما اگر به یک تابع ``noexcept`` برسد، " +"ممکن است فرایند را خاتمه دهد. سایر سیستم‌ها مانند macOS واپیمایش پشته را " +"انجام می‌دهند." -msgid "On Windows, this function calls ``_endthreadex()``, which kills the thread without calling C++ destructors." +msgid "" +"On Windows, this function calls ``_endthreadex()``, which kills the thread " +"without calling C++ destructors." msgstr "" +"در ویندوز، این تابع ``_endthreadex()`` را فراخوانی می‌کند که نخ را بدون " +"فراخوانی مخرب‌های C++ می‌کشد." msgid "In any case, there is a risk of corruption on the thread's stack." -msgstr "" +msgstr "در هر صورت، خطر خرابی پشته‌ی نخ وجود دارد." -msgid "Initialize ``PyThread*`` APIs. Python executes this function automatically, so there's little need to call it from an extension module." +msgid "" +"Initialize ``PyThread*`` APIs. Python executes this function automatically, " +"so there's little need to call it from an extension module." msgstr "" +"APIهای ``PyThread*`` را مقداردهی اولیه می‌کند. پایتون این تابع را به‌طور " +"خودکار اجرا می‌کند، بنابراین نیاز چندانی به فراخوانی آن از یک ماژول توسعه‌ای" +" وجود ندارد." msgid "Set the stack size of the current thread to *size* bytes." -msgstr "" +msgstr "اندازه پشته‌ی نخ فعلی را روی *size* بایت تنظیم می‌کند." -msgid "This function returns ``0`` on success, ``-1`` if *size* is invalid, or ``-2`` if the system does not support changing the stack size. This function does not set exceptions." +msgid "" +"This function returns ``0`` on success, ``-1`` if *size* is invalid, or " +"``-2`` if the system does not support changing the stack size. This function" +" does not set exceptions." msgstr "" +"این تابع در صورت موفقیت ``0``، در صورت نامعتبر بودن *size* مقدار ``-1``، یا " +"در صورتی که سیستم از تغییر اندازه پشته پشتیبانی نکند ``-2`` برمی‌گرداند. این" +" تابع استثنایی تنظیم نمی‌کند." -msgid "Return the stack size of the current thread in bytes, or ``0`` if the system's default stack size is in use." +msgid "" +"Return the stack size of the current thread in bytes, or ``0`` if the " +"system's default stack size is in use." msgstr "" +"اندازه پشته نخ فعلی را بر حسب بایت برمی‌گرداند، یا ``0`` اگر اندازه پشته " +"پیش‌فرض سیستم در حال استفاده باشد." msgid "global interpreter lock" -msgstr "" +msgstr "قفل مفسر سراسری" msgid "interpreter lock" -msgstr "" +msgstr "قفل مفسر" msgid "lock, interpreter" -msgstr "" +msgstr "قفل، مفسر" msgid "setswitchinterval (in module sys)" -msgstr "" +msgstr "setswitchinterval (در ماژول sys)" msgid "PyThreadState (C type)" -msgstr "" +msgstr "PyThreadState (نوع C)" msgid "Py_BEGIN_ALLOW_THREADS (C macro)" -msgstr "" +msgstr "Py_BEGIN_ALLOW_THREADS (ماکروی C)" msgid "Py_END_ALLOW_THREADS (C macro)" -msgstr "" +msgstr "Py_END_ALLOW_THREADS (ماکروی C)" msgid "PyEval_RestoreThread (C function)" -msgstr "" +msgstr "PyEval_RestoreThread (تابع C)" msgid "PyEval_SaveThread (C function)" -msgstr "" +msgstr "PyEval_SaveThread (تابع C)" msgid "PyEval_AcquireThread()" -msgstr "" +msgstr "PyEval_AcquireThread()" msgid "PyEval_ReleaseThread()" -msgstr "" +msgstr "PyEval_ReleaseThread()" msgid "PyEval_SaveThread()" -msgstr "" +msgstr "PyEval_SaveThread()" msgid "PyEval_RestoreThread()" -msgstr "" +msgstr "PyEval_RestoreThread()" msgid "module" -msgstr "" +msgstr "ماژول" msgid "_thread" -msgstr "" +msgstr "_thread" diff --git a/c-api/time.po b/c-api/time.po index af03410e6..6e9b6b2a7 100644 --- a/c-api/time.po +++ b/c-api/time.po @@ -24,82 +24,171 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "PyTime C API" -msgstr "" +msgstr "API زبان C برای PyTime" -msgid "The clock C API provides access to system clocks. It is similar to the Python :mod:`time` module." +msgid "" +"The clock C API provides access to system clocks. It is similar to the " +"Python :mod:`time` module." msgstr "" +"API ساعت در C دسترسی به ساعت‌های سیستمی را فراهم می‌کند. این API مشابه ماژول" +" :mod:`time` پایتون است." -msgid "For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." +msgid "" +"For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." msgstr "" +"برای API زبان C مربوط به ماژول :mod:`datetime`، به :ref:`datetimeobjects` " +"مراجعه کنید." msgid "Types" -msgstr "" +msgstr "نوع‌ها" -msgid "A timestamp or duration in nanoseconds, represented as a signed 64-bit integer." +msgid "" +"A timestamp or duration in nanoseconds, represented as a signed 64-bit " +"integer." msgstr "" +"یک برچسب زمانی یا مدت‌زمان بر حسب نانوثانیه که به‌صورت یک عدد صحیح علامت‌دار" +" ۶۴ بیتی نمایش داده می‌شود." -msgid "The reference point for timestamps depends on the clock used. For example, :c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." +msgid "" +"The reference point for timestamps depends on the clock used. For example, " +":c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." msgstr "" +"نقطه مرجع مهرهای زمانی (timestamp) به ساعت مورد استفاده بستگی دارد. برای " +"مثال، :c:func:`PyTime_Time` مهرهای زمانی را نسبت به مبدأ زمان یونیکس " +"برمی‌گرداند." -msgid "The supported range is around [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970) as reference, the supported date range is around [1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" +msgid "" +"The supported range is around [-292.3 years; +292.3 years]. Using the Unix " +"epoch (January 1st, 1970) as reference, the supported date range is around " +"[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" msgstr "" +"محدوده‌ی پشتیبانی‌شده حدود [-292.3 سال؛ +292.3 سال] است. با استفاده از مبدأ " +"زمان یونیکس (۱ ژانویه ۱۹۷۰) به عنوان مرجع، محدوده‌ی تاریخ‌های پشتیبانی‌شده " +"حدود [1677-09-21; 2262-04-11] است. حد‌های دقیق به صورت ثابت‌ها ارائه " +"شده‌اند:" msgid "Minimum value of :c:type:`PyTime_t`." -msgstr "" +msgstr "کمترین مقدار :c:type:`PyTime_t`." msgid "Maximum value of :c:type:`PyTime_t`." -msgstr "" +msgstr "بیشینه مقدار :c:type:`PyTime_t`." msgid "Clock Functions" -msgstr "" +msgstr "توابع ساعت" -msgid "The following functions take a pointer to a :c:expr:`PyTime_t` that they set to the value of a particular clock. Details of each clock are given in the documentation of the corresponding Python function." +msgid "" +"The following functions take a pointer to a :c:expr:`PyTime_t` that they set" +" to the value of a particular clock. Details of each clock are given in the " +"documentation of the corresponding Python function." msgstr "" +"توابع زیر یک اشاره‌گر به :c:expr:`PyTime_t` می‌گیرند که آن را به مقدار یک " +"ساعت خاص تنظیم می‌کنند. جزئیات هر ساعت در مستندات تابع متناظر پایتون ارائه " +"شده است." -msgid "The functions return ``0`` on success, or ``-1`` (with an exception set) on failure." +msgid "" +"The functions return ``0`` on success, or ``-1`` (with an exception set) on " +"failure." msgstr "" +"این توابع در صورت موفقیت ``0`` و در صورت شکست ``-1`` (همراه با استثنای " +"تنظیم‌شده) برمی‌گردانند." -msgid "On integer overflow, they set the :c:data:`PyExc_OverflowError` exception and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` range. (On current systems, integer overflows are likely caused by misconfigured system time.)" +msgid "" +"On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " +"and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]``" +" range. (On current systems, integer overflows are likely caused by " +"misconfigured system time.)" msgstr "" +"در صورت سرریز عدد صحیح، استثنای :c:data:`PyExc_OverflowError` تنظیم می‌شود و" +" ``*result`` به مقداری تنظیم می‌شود که به بازه‌ی ``[PyTime_MIN; " +"PyTime_MAX]`` محدود شده است. (در سیستم‌های امروزی، سرریزهای عدد صحیح به " +"احتمال زیاد ناشی از تنظیم نادرست زمان سیستم هستند.)" -msgid "As any other C API (unless otherwise specified), the functions must be called with an :term:`attached thread state`." +msgid "" +"As any other C API (unless otherwise specified), the functions must be " +"called with an :term:`attached thread state`." msgstr "" +"مانند هر API زبان C دیگری (مگر این‌که خلاف آن مشخص شده باشد)، این توابع باید" +" با یک :term:`attached thread state` فراخوانی شوند." -msgid "Read the monotonic clock. See :func:`time.monotonic` for important details on this clock." +msgid "" +"Read the monotonic clock. See :func:`time.monotonic` for important details " +"on this clock." msgstr "" +"ساعت یکنواخت را بخوانید. برای جزئیات مهم درباره‌ی این ساعت به " +":func:`time.monotonic` مراجعه کنید." -msgid "Read the performance counter. See :func:`time.perf_counter` for important details on this clock." +msgid "" +"Read the performance counter. See :func:`time.perf_counter` for important " +"details on this clock." msgstr "" +"شمارنده‌ی عملکرد را بخوانید. برای جزئیات مهم درباره‌ی این ساعت، " +":func:`time.perf_counter` را ببینید." -msgid "Read the “wall clock” time. See :func:`time.time` for details important on this clock." +msgid "" +"Read the “wall clock” time. See :func:`time.time` for details important on " +"this clock." msgstr "" +"زمان «ساعت دیواری» را می‌خواند. برای جزئیات مهم درباره‌ی این ساعت، " +":func:`time.time` را ببینید." msgid "Raw Clock Functions" -msgstr "" +msgstr "توابع ساعت خام" -msgid "Similar to clock functions, but don't set an exception on error and don't require the caller to have an :term:`attached thread state`." +msgid "" +"Similar to clock functions, but don't set an exception on error and don't " +"require the caller to have an :term:`attached thread state`." msgstr "" +"مشابه توابع ساعت، اما در صورت خطا استثنا تنظیم نمی‌کنند و نیازی ندارند که " +"فراخواننده :term:`وضعیت نخ متصل ` داشته باشد." msgid "On success, the functions return ``0``." -msgstr "" +msgstr "در صورت موفقیت، این توابع ``0`` را برمی‌گردانند." -msgid "On failure, they set ``*result`` to ``0`` and return ``-1``, *without* setting an exception. To get the cause of the error, :term:`attach ` a :term:`thread state`, and call the regular (non-``Raw``) function. Note that the regular function may succeed after the ``Raw`` one failed." -msgstr "" +msgid "" +"On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " +"setting an exception. To get the cause of the error, :term:`attach ` a :term:`thread state`, and call the regular (non-``Raw``) " +"function. Note that the regular function may succeed after the ``Raw`` one " +"failed." +msgstr "" +"در صورت شکست، آن‌ها ``*result`` را برابر ``0`` قرار می‌دهند و ``-1`` را " +"برمی‌گردانند، *بدون* تنظیم کردن استثنا. برای به دست آوردن علت خطا، یک " +":term:`وضعیت نخ ` را :term:`متصل کنید `" +" و تابع معمولی (غیر ``Raw``) را فراخوانی کنید. توجه داشته باشید که تابع " +"معمولی ممکن است پس از شکست تابع ``Raw`` موفق شود." -msgid "Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error and don't require an :term:`attached thread state`." +msgid "" +"Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " +"and don't require an :term:`attached thread state`." msgstr "" +"مشابه :c:func:`PyTime_Monotonic` است، اما در صورت خطا استثنایی تنظیم نمی‌کند" +" و نیازی به :term:`attached thread state` ندارد." -msgid "Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error and don't require an :term:`attached thread state`." +msgid "" +"Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error" +" and don't require an :term:`attached thread state`." msgstr "" +"مشابه :c:func:`PyTime_PerfCounter` است، اما در صورت خطا استثنایی تنظین " +"نمی‌کند و نیازی به :term:`وضعیت نخ متصل ` ندارد." -msgid "Similar to :c:func:`PyTime_Time`, but don't set an exception on error and don't require an :term:`attached thread state`." +msgid "" +"Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " +"don't require an :term:`attached thread state`." msgstr "" +"مشابه :c:func:`PyTime_Time` است، اما در صورت خطا استثنایی تنظیم نمی‌کند و به" +" :term:`attached thread state` نیازی ندارد." msgid "Conversion functions" -msgstr "" +msgstr "توابع تبدیل" msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." msgstr "" +"یک مهر زمانی را به تعدادی ثانیه به‌صورت یک :c:expr:`double` در C تبدیل " +"می‌کند." -msgid "The function cannot fail, but note that :c:expr:`double` has limited accuracy for large values." +msgid "" +"The function cannot fail, but note that :c:expr:`double` has limited " +"accuracy for large values." msgstr "" +"تابع نمی‌تواند شکست بخورد، اما توجه داشته باشید که :c:expr:`double` برای " +"مقادیر بزرگ دقت محدودی دارد." diff --git a/c-api/tls.po b/c-api/tls.po index 1072341cc..e4d0c3f54 100644 --- a/c-api/tls.po +++ b/c-api/tls.po @@ -20,82 +20,217 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Thread-local storage support" -msgstr "" +msgstr "پشتیبانی از ذخیره‌سازی نخ‌محلی" -msgid "The Python interpreter provides low-level support for thread-local storage (TLS) which wraps the underlying native TLS implementation to support the Python-level thread-local storage API (:class:`threading.local`). The CPython C level APIs are similar to those offered by pthreads and Windows: use a thread key and functions to associate a :c:expr:`void*` value per thread." -msgstr "" +msgid "" +"The Python interpreter provides low-level support for thread-local storage " +"(TLS) which wraps the underlying native TLS implementation to support the " +"Python-level thread-local storage API (:class:`threading.local`). The " +"CPython C level APIs are similar to those offered by pthreads and Windows: " +"use a thread key and functions to associate a :c:expr:`void*` value per " +"thread." +msgstr "" +"مفسر پایتون پشتیبانی سطح پایین برای ذخیره‌سازی نخ‌محلی (TLS) فراهم می‌کند که" +" پیاده‌سازی بومی TLS در لایه زیرین را پوشش می‌دهد تا از API ذخیره‌سازی " +"نخ‌محلی در سطح پایتون (:class:`threading.local`) پشتیبانی کند. APIهای سطح C " +"سی‌پایتون مشابه APIهایی هستند که pthreads و ویندوز ارائه می‌دهند: از یک کلید" +" نخ و توابعی برای مرتبط کردن یک مقدار :c:expr:`void*` به ازای هر نخ استفاده " +"می‌کنند." -msgid "A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they supply their own locking." +msgid "" +"A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they supply their own locking." msgstr "" +":term:`وضعیت نخ ` هنگام فراخوانی این توابع *لازم نیست* " +":term:`متصل ` باشد؛ این توابع قفل‌گذاری خودشان را " +"فراهم می‌کنند." -msgid "Note that :file:`Python.h` does not include the declaration of the TLS APIs, you need to include :file:`pythread.h` to use thread-local storage." +msgid "" +"Note that :file:`Python.h` does not include the declaration of the TLS APIs," +" you need to include :file:`pythread.h` to use thread-local storage." msgstr "" +"توجه داشته‌باشید که :file:`Python.h` شامل اعلان API‌های TLS نیست؛ برای " +"استفاده از ذخیره‌سازی نخ‌محلی، باید :file:`pythread.h` را include کنید." -msgid "None of these API functions handle memory management on behalf of the :c:expr:`void*` values. You need to allocate and deallocate them yourself. If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions don't do refcount operations on them either." +msgid "" +"None of these API functions handle memory management on behalf of the " +":c:expr:`void*` values. You need to allocate and deallocate them yourself. " +"If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these " +"functions don't do refcount operations on them either." msgstr "" +"هیچ‌یک از این توابع API مدیریت حافظه را برای مقادیر :c:expr:`void*` انجام " +"نمی‌دهند. شما باید خودتان آن‌ها را تخصیص دهید و آزاد کنید. اگر مقادیر " +":c:expr:`void*` اتفاقاً :c:expr:`PyObject*` باشند، این توابع نیز هیچ عملیات " +"شمارش ارجاعی روی آن‌ها انجام نمی‌دهند." msgid "Thread-specific storage API" -msgstr "" +msgstr "API ذخیره‌سازی ویژه‌ی نخ (Thread-Specific Storage)" -msgid "The thread-specific storage (TSS) API was introduced to supersede the use of the existing TLS API within the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` instead of :c:expr:`int` to represent thread keys." +msgid "" +"The thread-specific storage (TSS) API was introduced to supersede the use of" +" the existing TLS API within the CPython interpreter. This API uses a new " +"type :c:type:`Py_tss_t` instead of :c:expr:`int` to represent thread keys." msgstr "" +"API ذخیره‌سازی اختصاصی نخ (TSS) برای جایگزینی استفاده از API موجود TLS در " +"مفسر سی‌پایتون معرفی شد. این API از نوع جدید :c:type:`Py_tss_t` به‌جای " +":c:expr:`int` برای نمایش کلیدهای نخ استفاده می‌کند." msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" -msgstr "" +msgstr "«یک C-API جدید برای ذخیره‌سازی نخ‌محلی در سی‌پایتون» (:pep:`539`)" -msgid "This data structure represents the state of a thread key, the definition of which may depend on the underlying TLS implementation, and it has an internal field representing the key's initialization state. There are no public members in this structure." +msgid "" +"This data structure represents the state of a thread key, the definition of " +"which may depend on the underlying TLS implementation, and it has an " +"internal field representing the key's initialization state. There are no " +"public members in this structure." msgstr "" +"این ساختار داده وضعیت یک کلید نخ را نشان می‌دهد که تعریف آن ممکن است به " +"پیاده‌سازی زیربنایی TLS وابسته باشد، و دارای یک فیلد داخلی است که وضعیت " +"مقداردهی اولیه‌ی کلید را نشان می‌دهد. هیچ عضو عمومی‌ای در این ساختار وجود " +"ندارد." -msgid "When :ref:`Py_LIMITED_API ` is not defined, static allocation of this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." +msgid "" +"When :ref:`Py_LIMITED_API ` is not defined, static allocation of " +"this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" +"وقتی :ref:`Py_LIMITED_API ` تعریف نشده باشد، تخصیص ایستای این نوع با" +" :c:macro:`Py_tss_NEEDS_INIT` مجاز است." -msgid "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note that this macro won't be defined with :ref:`Py_LIMITED_API `." +msgid "" +"This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note" +" that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" +"این ماکرو به مقداردهنده‌ی اولیه‌ی متغیرهای :c:type:`Py_tss_t` بسط می‌یابد. " +"توجه داشته باشید که این ماکرو همراه با :ref:`Py_LIMITED_API ` تعریف " +"نخواهد شد." msgid "Dynamic allocation" -msgstr "" +msgstr "تخصیص پویا" -msgid "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules built with :ref:`Py_LIMITED_API `, where static allocation of this type is not possible due to its implementation being opaque at build time." +msgid "" +"Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " +"built with :ref:`Py_LIMITED_API `, where static allocation of this " +"type is not possible due to its implementation being opaque at build time." msgstr "" +"تخصیص پویای :c:type:`Py_tss_t`، که در ماژول‌های توسعه‌ای ساخته‌شده با " +":ref:`Py_LIMITED_API ` لازم است؛ جایی که تخصیص ایستای این نوع به " +"دلیل مات (opaque) بودن پیاده‌سازی آن در زمان ساخت ممکن نیست." -msgid "Return a value which is the same state as a value initialized with :c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." +msgid "" +"Return a value which is the same state as a value initialized with " +":c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation " +"failure." msgstr "" +"مقداری را برمی‌گرداند که در همان وضعیتِ مقدارِ مقداردهی‌شده با " +":c:macro:`Py_tss_NEEDS_INIT` است، یا ``NULL`` در صورت شکست تخصیص پویا." -msgid "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals have been unassigned. This is a no-op if the *key* argument is ``NULL``." +msgid "" +"Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " +"calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals" +" have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" +"*کلید* داده‌شده که توسط :c:func:`PyThread_tss_alloc` تخصیص یافته است را آزاد" +" می‌کند، پس از آنکه ابتدا :c:func:`PyThread_tss_delete` را برای اطمینان از " +"اینکه هر متغیر نخ‌محلی مرتبطی لغو تخصیص شده باشد فراخوانی کرده است. اگر " +"آرگومان *کلید* ``NULL`` باشد، این یک عملیات بی‌اثر است." -msgid "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." +msgid "" +"A freed key becomes a dangling pointer. You should reset the key to " +"``NULL``." msgstr "" +"کلید آزادشده به یک اشاره‌گر معلق تبدیل می‌شود. شما باید کلید را به ``NULL`` " +"بازنشانی کنید." msgid "Methods" -msgstr "" +msgstr "متدها" -msgid "The parameter *key* of these functions must not be ``NULL``. Moreover, the behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:func:`PyThread_tss_create`." +msgid "" +"The parameter *key* of these functions must not be ``NULL``. Moreover, the " +"behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " +"undefined if the given :c:type:`Py_tss_t` has not been initialized by " +":c:func:`PyThread_tss_create`." msgstr "" +"پارامتر *key* این توابع نباید ``NULL`` باشد. علاوه بر این، رفتار " +":c:func:`PyThread_tss_set` و :c:func:`PyThread_tss_get` در صورتی تعریف‌نشده " +"است که :c:type:`Py_tss_t` داده‌شده با :c:func:`PyThread_tss_create` مقداردهی" +" اولیه نشده باشد." -msgid "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized by :c:func:`PyThread_tss_create`." +msgid "" +"Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized" +" by :c:func:`PyThread_tss_create`." msgstr "" +"اگر :c:type:`Py_tss_t` داده‌شده توسط :c:func:`PyThread_tss_create` مقداردهی " +"اولیه شده باشد، مقداری غیر صفر برمی‌گرداند." -msgid "Return a zero value on successful initialization of a TSS key. The behavior is undefined if the value pointed to by the *key* argument is not initialized by :c:macro:`Py_tss_NEEDS_INIT`. This function can be called repeatedly on the same key -- calling it on an already initialized key is a no-op and immediately returns success." -msgstr "" +msgid "" +"Return a zero value on successful initialization of a TSS key. The behavior" +" is undefined if the value pointed to by the *key* argument is not " +"initialized by :c:macro:`Py_tss_NEEDS_INIT`. This function can be called " +"repeatedly on the same key -- calling it on an already initialized key is a " +"no-op and immediately returns success." +msgstr "" +"در صورت موفقیت‌آمیز بودن مقداردهی اولیه‌ی یک کلید TSS، مقدار صفر را " +"برمی‌گرداند. اگر مقداری که آرگومان *key* به آن اشاره می‌کند با " +":c:macro:`Py_tss_NEEDS_INIT` مقداردهی اولیه نشده باشد، رفتار تعریف‌نشده " +"خواهد بود. می‌توان این تابع را به طور مکرر روی همان کلید فراخوانی کرد -- " +"فراخوانی آن روی کلیدی که از قبل مقداردهی اولیه شده است، یک عملیات بی‌اثر است" +" و بلافاصله موفقیت را برمی‌گرداند." -msgid "Destroy a TSS key to forget the values associated with the key across all threads, and change the key's initialization state to uninitialized. A destroyed key is able to be initialized again by :c:func:`PyThread_tss_create`. This function can be called repeatedly on the same key -- calling it on an already destroyed key is a no-op." -msgstr "" +msgid "" +"Destroy a TSS key to forget the values associated with the key across all " +"threads, and change the key's initialization state to uninitialized. A " +"destroyed key is able to be initialized again by " +":c:func:`PyThread_tss_create`. This function can be called repeatedly on the" +" same key -- calling it on an already destroyed key is a no-op." +msgstr "" +"یک کلید TSS را نابود می‌کند تا مقدارهای مرتبط با آن کلید در همه‌ی نخ‌ها " +"فراموش شوند، و وضعیت مقداردهی اولیه‌ی کلید را به مقداردهی‌نشده تغییر می‌دهد." +" یک کلید نابودشده می‌تواند دوباره توسط :c:func:`PyThread_tss_create` " +"مقداردهی اولیه شود. این تابع را می‌توان به‌طور مکرر روی همان کلید فراخوانی " +"کرد -- فراخوانی آن روی کلیدی که از قبل نابود شده، یک عملیات بی‌اثر است." -msgid "Return a zero value to indicate successfully associating a :c:expr:`void*` value with a TSS key in the current thread. Each thread has a distinct mapping of the key to a :c:expr:`void*` value." +msgid "" +"Return a zero value to indicate successfully associating a :c:expr:`void*` " +"value with a TSS key in the current thread. Each thread has a distinct " +"mapping of the key to a :c:expr:`void*` value." msgstr "" +"مقدار صفر را برای نشان دادن موفقیت در مرتبط کردن یک مقدار :c:expr:`void*` با" +" کلید TSS در نخ جاری برمی‌گرداند. هر نخ نگاشت متمایزی از کلید به یک مقدار " +":c:expr:`void*` دارد." -msgid "Return the :c:expr:`void*` value associated with a TSS key in the current thread. This returns ``NULL`` if no value is associated with the key in the current thread." +msgid "" +"Return the :c:expr:`void*` value associated with a TSS key in the current " +"thread. This returns ``NULL`` if no value is associated with the key in the" +" current thread." msgstr "" +"مقدار :c:expr:`void*` مرتبط با کلید TSS در نخ جاری را برمی‌گرداند. اگر هیچ " +"مقداری با کلید در نخ جاری مرتبط نباشد، این تابع ``NULL`` را برمی‌گرداند." msgid "Legacy APIs" -msgstr "" +msgstr "API‌های قدیمی" -msgid "This API is superseded by the :ref:`thread-specific storage (TSS) API `." +msgid "" +"This API is superseded by the :ref:`thread-specific storage (TSS) API " +"`." msgstr "" +"این API توسط :ref:`API ذخیره‌سازی اختصاصی نخ (TSS) ` جایگزین شده است." -msgid "This version of the API does not support platforms where the native TLS key is defined in a way that cannot be safely cast to ``int``. On such platforms, :c:func:`PyThread_create_key` will return immediately with a failure status, and the other TLS functions will all be no-ops on such platforms." +msgid "" +"This version of the API does not support platforms where the native TLS key " +"is defined in a way that cannot be safely cast to ``int``. On such " +"platforms, :c:func:`PyThread_create_key` will return immediately with a " +"failure status, and the other TLS functions will all be no-ops on such " +"platforms." msgstr "" +"این نسخه از API از پلتفرم‌هایی پشتیبانی نمی‌کند که در آن‌ها کلید بومی TLS به" +" شکلی تعریف شده باشد که نتوان آن را به‌طور امن به ``int`` قالب‌ریزی کرد. در " +"چنین پلتفرم‌هایی، :c:func:`PyThread_create_key` بلافاصله وضعیت شکست برخواهد " +"گرداند و سایر توابع TLS همگی در چنین پلتفرم‌هایی عملیات بی‌اثر خواهند بود." -msgid "Due to the compatibility problem noted above, this version of the API should not be used in new code." +msgid "" +"Due to the compatibility problem noted above, this version of the API should" +" not be used in new code." msgstr "" +"به دلیل مشکل سازگاری ذکرشده در بالا، نباید از این نسخه از API در کد جدید " +"استفاده شود." diff --git a/c-api/tuple.po b/c-api/tuple.po index a7f842954..2f17592ef 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -24,142 +24,311 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Tuple Objects" -msgstr "" +msgstr "اشیاء تاپل" msgid "This subtype of :c:type:`PyObject` represents a Python tuple object." -msgstr "" +msgstr "این زیرنوع از :c:type:`PyObject` معرف یک شیء تاپل پایتون است." -msgid "This instance of :c:type:`PyTypeObject` represents the Python tuple type; it is the same object as :class:`tuple` in the Python layer." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python tuple type; it" +" is the same object as :class:`tuple` in the Python layer." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع تاپل پایتون را نشان می‌دهد؛ این همان" +" شیء :class:`tuple` در لایه‌ی پایتون است." -msgid "Return true if *p* is a tuple object or an instance of a subtype of the tuple type. This function always succeeds." +msgid "" +"Return true if *p* is a tuple object or an instance of a subtype of the " +"tuple type. This function always succeeds." msgstr "" +"اگر *p* یک شیء تاپل یا نمونه‌ای از یک زیرنوع از نوع تاپل باشد، مقدار true را" +" برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Return true if *p* is a tuple object, but not an instance of a subtype of the tuple type. This function always succeeds." +msgid "" +"Return true if *p* is a tuple object, but not an instance of a subtype of " +"the tuple type. This function always succeeds." msgstr "" +"اگر *p* یک شیء تاپل باشد، اما نمونه‌ای از زیرنوعی از نوع تاپل نباشد، مقدار " +"true را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return a new tuple object of size *len*, or ``NULL`` with an exception set on failure." +msgid "" +"Return a new tuple object of size *len*, or ``NULL`` with an exception set " +"on failure." msgstr "" +"یک شیء تاپل جدید با اندازه‌ی *len* برمی‌گرداند، یا در صورت شکست ``NULL`` را " +"همراه با استثنای تنظیم‌شده برمی‌گرداند." -msgid "Return a new tuple object of size *n*, or ``NULL`` with an exception set on failure. The tuple values are initialized to the subsequent *n* C arguments pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue(\"(OO)\", a, b)``." +msgid "" +"Return a new tuple object of size *n*, or ``NULL`` with an exception set on " +"failure. The tuple values are initialized to the subsequent *n* C arguments " +"pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " +"``Py_BuildValue(\"(OO)\", a, b)``." msgstr "" +"یک شیء تاپل جدید با اندازه‌ی *n* برمی‌گرداند، یا در صورت شکست ``NULL`` به " +"همراه یک استثنای تنظیم‌شده برمی‌گرداند. مقادیر تاپل به *n* آرگومان C بعدی که" +" به اشیاء پایتون اشاره می‌کنند، مقداردهی اولیه می‌شوند. ``PyTuple_Pack(2, a," +" b)`` معادل ``Py_BuildValue(\"(OO)\", a, b)`` است." -msgid "Take a pointer to a tuple object, and return the size of that tuple. On error, return ``-1`` with an exception set." +msgid "" +"Take a pointer to a tuple object, and return the size of that tuple. On " +"error, return ``-1`` with an exception set." msgstr "" +"یک اشاره‌گر به شیء تاپل می‌گیرد و اندازه‌ی آن تاپل را برمی‌گرداند. در صورت " +"خطا، ``-1`` همراه با استثنای تنظیم‌شده برمی‌گرداند." msgid "Like :c:func:`PyTuple_Size`, but without error checking." -msgstr "" +msgstr "مانند :c:func:`PyTuple_Size`، اما بدون بررسی خطا." -msgid "Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is negative or out of bounds, return ``NULL`` and set an :exc:`IndexError` exception." +msgid "" +"Return the object at position *pos* in the tuple pointed to by *p*. If " +"*pos* is negative or out of bounds, return ``NULL`` and set an " +":exc:`IndexError` exception." msgstr "" +"شیء در موقعیت *pos* در تاپلی که توسط *p* به آن اشاره می‌شود را برمی‌گرداند. " +"اگر *pos* منفی یا خارج از محدوده باشد، ``NULL`` را برمی‌گرداند و یک استثنای " +":exc:`IndexError` تنظیم می‌کند." -msgid "The returned reference is borrowed from the tuple *p* (that is: it is only valid as long as you hold a reference to *p*). To get a :term:`strong reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or :c:func:`PySequence_GetItem`." +msgid "" +"The returned reference is borrowed from the tuple *p* (that is: it is only " +"valid as long as you hold a reference to *p*). To get a :term:`strong " +"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or " +":c:func:`PySequence_GetItem`." msgstr "" +"ارجاع بازگردانده‌شده از تاپل *p* امانت گرفته شده است (یعنی: تنها تا زمانی که" +" شما ارجاعی به *p* را در اختیار دارید معتبر است). برای به دست آوردن " +":term:`ارجاع قوی `، از " +":c:func:`Py_NewRef(PyTuple_GetItem(...)) ` یا " +":c:func:`PySequence_GetItem` استفاده کنید." msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments." msgstr "" +"مانند :c:func:`PyTuple_GetItem`، اما هیچ بررسی‌ای روی آرگومان‌های خود انجام " +"نمی‌دهد." -msgid "Return the slice of the tuple pointed to by *p* between *low* and *high*, or ``NULL`` with an exception set on failure." +msgid "" +"Return the slice of the tuple pointed to by *p* between *low* and *high*, or" +" ``NULL`` with an exception set on failure." msgstr "" +"اسلایس تاپلی را که *p* به آن اشاره می‌کند، بین *low* و *high* برمی‌گرداند، " +"یا در صورت شکست ``NULL`` را همراه با استثنای تنظیم‌شده برمی‌گرداند." -msgid "This is the equivalent of the Python expression ``p[low:high]``. Indexing from the end of the tuple is not supported." +msgid "" +"This is the equivalent of the Python expression ``p[low:high]``. Indexing " +"from the end of the tuple is not supported." msgstr "" +"این معادل عبارت پایتونی ``p[low:high]`` است. اندیس‌گذاری از انتهای تاپل " +"پشتیبانی نمی‌شود." -msgid "Insert a reference to object *o* at position *pos* of the tuple pointed to by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` and set an :exc:`IndexError` exception." +msgid "" +"Insert a reference to object *o* at position *pos* of the tuple pointed to " +"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` " +"and set an :exc:`IndexError` exception." msgstr "" +"یک ارجاع به شیء *o* در موقعیت *pos* از تاپلی که *p* به آن اشاره می‌کند، درج " +"می‌کند. در صورت موفقیت ``0`` برمی‌گرداند. اگر *pos* خارج از محدوده باشد، " +"``-1`` برمی‌گرداند و استثنای :exc:`IndexError` را تنظیم می‌کند." -msgid "This function \":term:`steals `\" a reference to *o* and discards a reference to an item already in the tuple at the affected position (unless it was NULL)." +msgid "" +"This function \":term:`steals `\" a reference to *o* and discards a " +"reference to an item already in the tuple at the affected position (unless " +"it was NULL)." msgstr "" +"این تابع ارجاعی به *o* را «:term:`می‌دزدد (steal) `» و ارجاع به آیتمی" +" را که از قبل در جایگاه مورد تأثیر تاپل قرار دارد، دور می‌ریزد (مگر اینکه " +"NULL بوده باشد)." -msgid "Like :c:func:`PyTuple_SetItem`, but does no error checking, and should *only* be used to fill in brand new tuples." +msgid "" +"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should " +"*only* be used to fill in brand new tuples." msgstr "" +"مانند :c:func:`PyTuple_SetItem` است، اما هیچ بررسی خطایی انجام نمی‌دهد و " +"باید *فقط* برای پر کردن تاپل‌های کاملاً جدید استفاده شود." -msgid "Bounds checking is performed as an assertion if Python is built in :ref:`debug mode ` or :option:`with assertions <--with-assertions>`." +msgid "" +"Bounds checking is performed as an assertion if Python is built in " +":ref:`debug mode ` or :option:`with assertions <--with-" +"assertions>`." msgstr "" +"اگر پایتون در :ref:`حالت اشکال‌زدایی ` یا :option:`با ادعاها " +"<--with-assertions>` ساخته شده باشد، بررسی کران‌ها به‌صورت یک ادعا انجام " +"می‌شود." -msgid "This function \":term:`steals `\" a reference to *o*, and, unlike :c:func:`PyTuple_SetItem`, does *not* discard a reference to any item that is being replaced; any reference in the tuple at position *pos* will be leaked." +msgid "" +"This function \":term:`steals `\" a reference to *o*, and, unlike " +":c:func:`PyTuple_SetItem`, does *not* discard a reference to any item that " +"is being replaced; any reference in the tuple at position *pos* will be " +"leaked." msgstr "" +"این تابع ارجاعی به *o* را «:term:`می‌دزدد `» و برخلاف " +":c:func:`PyTuple_SetItem`، ارجاع به هیچ آیتمی را که در حال جایگزینی است *دور" +" نمی‌اندازد*؛ هر ارجاعی که در جایگاه *pos* از تاپل باشد، نشت خواهد شد." -msgid "This macro should *only* be used on tuples that are newly created. Using this macro on a tuple that is already in use (or in other words, has a refcount > 1) could lead to undefined behavior." +msgid "" +"This macro should *only* be used on tuples that are newly created. Using " +"this macro on a tuple that is already in use (or in other words, has a " +"refcount > 1) could lead to undefined behavior." msgstr "" +"این ماکرو باید *تنها* روی تاپل‌هایی که به‌تازگی ایجاد شده‌اند استفاده شود. " +"استفاده از این ماکرو روی تاپلی که از قبل در حال استفاده است (یا به عبارت " +"دیگر، شمارش ارجاع آن بزرگ‌تر از ۱ است) ممکن است به رفتار تعریف‌نشده منجر " +"شود." -msgid "Can be used to resize a tuple. *newsize* will be the new length of the tuple. Because tuples are *supposed* to be immutable, this should only be used if there is only one reference to the object. Do *not* use this if the tuple may already be known to some other part of the code. The tuple will always grow or shrink at the end. Think of this as destroying the old tuple and creating a new one, only more efficiently. Returns ``0`` on success. Client code should never assume that the resulting value of ``*p`` will be the same as before calling this function. If the object referenced by ``*p`` is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or :exc:`SystemError`." -msgstr "" +msgid "" +"Can be used to resize a tuple. *newsize* will be the new length of the " +"tuple. Because tuples are *supposed* to be immutable, this should only be " +"used if there is only one reference to the object. Do *not* use this if the" +" tuple may already be known to some other part of the code. The tuple will " +"always grow or shrink at the end. Think of this as destroying the old tuple" +" and creating a new one, only more efficiently. Returns ``0`` on success. " +"Client code should never assume that the resulting value of ``*p`` will be " +"the same as before calling this function. If the object referenced by ``*p``" +" is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` " +"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or " +":exc:`SystemError`." +msgstr "" +"می‌تواند برای تغییر اندازه‌ی یک تاپل استفاده شود. *newsize* طول جدید تاپل " +"خواهد بود. از آنجا که تاپل‌ها *قرار است* تغییرناپذیر باشند، این تابع فقط " +"باید زمانی استفاده شود که تنها یک ارجاع به شیء وجود داشته باشد. اگر ممکن است" +" تاپل از قبل توسط بخش دیگری از کد شناخته شده باشد، از این تابع استفاده " +"*نکنید*. تاپل همیشه از انتها بزرگ‌تر یا کوچک‌تر می‌شود. این کار را به‌عنوان " +"نابود کردن تاپل قدیمی و ایجاد یک تاپل جدید در نظر بگیرید، فقط با کارایی " +"بیشتر. در صورت موفقیت ``0`` را برمی‌گرداند. کد کلاینت هرگز نباید فرض کند که " +"مقدار حاصل ``*p`` با مقدار قبل از فراخوانی این تابع یکسان خواهد بود. اگر شیء" +" ارجاع‌شده توسط ``*p`` جایگزین شود، ``*p`` اصلی نابود می‌شود. در صورت شکست، " +"``-1`` را برمی‌گرداند، ``*p`` را برابر ``NULL`` قرار می‌دهد و " +":exc:`MemoryError` یا :exc:`SystemError` ایجاد می‌کند." msgid "Struct Sequence Objects" -msgstr "" +msgstr "اشیاء دنباله ساختاری" -msgid "Struct sequence objects are the C equivalent of :func:`~collections.namedtuple` objects, i.e. a sequence whose items can also be accessed through attributes. To create a struct sequence, you first have to create a specific struct sequence type." +msgid "" +"Struct sequence objects are the C equivalent of " +":func:`~collections.namedtuple` objects, i.e. a sequence whose items can " +"also be accessed through attributes. To create a struct sequence, you first " +"have to create a specific struct sequence type." msgstr "" +"اشیاء دنباله ساختاری معادل C برای اشیاء :func:`~collections.namedtuple` " +"هستند؛ یعنی دنباله‌ای که به آیتم‌های آن می‌توان از طریق ویژگی‌ها نیز دسترسی " +"داشت. برای ایجاد یک دنباله ساختاری، ابتدا باید یک نوع دنباله ساختاری خاص " +"ایجاد کنید." -msgid "Create a new struct sequence type from the data in *desc*, described below. Instances of the resulting type can be created with :c:func:`PyStructSequence_New`." +msgid "" +"Create a new struct sequence type from the data in *desc*, described below. " +"Instances of the resulting type can be created with " +":c:func:`PyStructSequence_New`." msgstr "" +"نوع دنباله ساختاری جدیدی از داده‌های موجود در *desc* که در ادامه توضیح داده " +"شده است، ایجاد می‌کند. نمونه‌های نوع حاصل را می‌توان با " +":c:func:`PyStructSequence_New` ایجاد کرد." msgid "Return ``NULL`` with an exception set on failure." -msgstr "" +msgstr "در صورت شکست، ``NULL`` را همراه با استثنای تنظیم‌شده برمی‌گرداند." msgid "Initializes a struct sequence type *type* from *desc* in place." msgstr "" +"نوع دنباله ساختاری *type* را از روی *desc* به‌صورت درجا مقداردهی اولیه " +"می‌کند." -msgid "Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and ``-1`` with an exception set on failure." +msgid "" +"Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and " +"``-1`` with an exception set on failure." msgstr "" +"مانند :c:func:`PyStructSequence_InitType`، با این تفاوت که در صورت موفقیت " +"``0`` و در صورت شکست ``-1`` همراه با تنظیم یک استثنا برمی‌گرداند." msgid "Contains the meta information of a struct sequence type to create." -msgstr "" +msgstr "شامل فراطلاعات نوع دنباله ساختاری‌ای است که باید ایجاد شود." -msgid "Fully qualified name of the type; null-terminated UTF-8 encoded. The name must contain the module name." +msgid "" +"Fully qualified name of the type; null-terminated UTF-8 encoded. The name " +"must contain the module name." msgstr "" +"نام کامل نوع؛ پایان‌یافته با تهی و کدگذاری‌شده با UTF-8. نام باید شامل نام " +"ماژول باشد." msgid "Pointer to docstring for the type or ``NULL`` to omit." -msgstr "" +msgstr "اشاره‌گر به رشته‌ی مستند برای نوع، یا ``NULL`` برای حذف آن." msgid "Pointer to ``NULL``-terminated array with field names of the new type." msgstr "" +"اشاره‌گر به آرایه‌ی خاتمه‌یافته با ``NULL`` حاوی نام فیلدهای نوع جدید." msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" +"تعداد فیلدهای قابل مشاهده برای سمت پایتون (در صورت استفاده به‌عنوان تاپل)." -msgid "Describes a field of a struct sequence. As a struct sequence is modeled as a tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:member:`~PyStructSequence_Desc.fields` array of the :c:type:`PyStructSequence_Desc` determines which field of the struct sequence is described." -msgstr "" +msgid "" +"Describes a field of a struct sequence. As a struct sequence is modeled as a" +" tuple, all fields are typed as :c:expr:`PyObject*`. The index in the " +":c:member:`~PyStructSequence_Desc.fields` array of the " +":c:type:`PyStructSequence_Desc` determines which field of the struct " +"sequence is described." +msgstr "" +"یک فیلد از دنباله ساختاری را توصیف می‌کند. از آنجا که دنباله ساختاری به‌صورت" +" یک تاپل مدل‌سازی می‌شود، همه‌ی فیلدها از نوع :c:expr:`PyObject*` هستند. " +"اندیس در آرایه‌ی :c:member:`~PyStructSequence_Desc.fields` از " +":c:type:`PyStructSequence_Desc` تعیین می‌کند که کدام فیلد از دنباله ساختاری " +"توصیف می‌شود." -msgid "Name for the field or ``NULL`` to end the list of named fields, set to :c:data:`PyStructSequence_UnnamedField` to leave unnamed." +msgid "" +"Name for the field or ``NULL`` to end the list of named fields, set to " +":c:data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" +"نام فیلد یا ``NULL`` برای پایان دادن به فهرست فیلدهای نام‌دار؛ برای بی‌نام " +"گذاشتن فیلد، روی :c:data:`PyStructSequence_UnnamedField` تنظیم می‌شود." msgid "Field docstring or ``NULL`` to omit." -msgstr "" +msgstr "رشته مستند فیلد یا ``NULL`` برای حذف." msgid "Special value for a field name to leave it unnamed." -msgstr "" +msgstr "مقدار ویژه برای نام فیلد که آن را بی‌نام باقی می‌گذارد." msgid "The type was changed from ``char *``." -msgstr "" +msgstr "نوع از ``char *`` تغییر یافت." -msgid "Creates an instance of *type*, which must have been created with :c:func:`PyStructSequence_NewType`." +msgid "" +"Creates an instance of *type*, which must have been created with " +":c:func:`PyStructSequence_NewType`." msgstr "" +"یک نمونه از *نوع* ایجاد می‌کند که باید با :c:func:`PyStructSequence_NewType`" +" ایجاد شده باشد." -msgid "Return the object at position *pos* in the struct sequence pointed to by *p*." +msgid "" +"Return the object at position *pos* in the struct sequence pointed to by " +"*p*." msgstr "" +"شیء موجود در موقعیت *pos* در دنباله ساختاری‌ای که *p* به آن اشاره می‌کند را " +"برمی‌گرداند." msgid "Alias to :c:func:`PyStructSequence_GetItem`." -msgstr "" +msgstr "نام مستعاری برای :c:func:`PyStructSequence_GetItem` است." msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." msgstr "" +"اکنون به عنوان مستعاری برای :c:func:`PyStructSequence_GetItem` پیاده‌سازی " +"شده است." -msgid "Sets the field at index *pos* of the struct sequence *p* to value *o*. Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new instances." +msgid "" +"Sets the field at index *pos* of the struct sequence *p* to value *o*. Like" +" :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new " +"instances." msgstr "" +"فیلد در اندیس *pos* از دنباله ساختاری *p* را به مقدار *o* تنظیم می‌کند. " +"مانند :c:func:`PyTuple_SET_ITEM`، این باید فقط برای پر کردن نمونه‌های کاملاً" +" جدید استفاده شود." msgid "This function \":term:`steals `\" a reference to *o*." -msgstr "" +msgstr "این تابع ارجاعی به *o* را «:term:`می‌دزدد `»." msgid "Alias to :c:func:`PyStructSequence_SetItem`." -msgstr "" +msgstr "نام مستعاری برای :c:func:`PyStructSequence_SetItem` است." msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." msgstr "" +"اکنون به عنوان نامی مستعار برای :c:func:`PyStructSequence_SetItem` " +"پیاده‌سازی شده است." msgid "object" -msgstr "" +msgstr "شیء" msgid "tuple" -msgstr "" +msgstr "تاپل" diff --git a/c-api/type.po b/c-api/type.po index 785296949..c3109fe64 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -24,414 +24,981 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Type Objects" -msgstr "" +msgstr "اشیاء نوع" msgid "The C structure of the objects used to describe built-in types." -msgstr "" +msgstr "ساختار C اشیایی که برای توصیف نوع‌های توکار استفاده می‌شوند." -msgid "This is the type object for type objects; it is the same object as :class:`type` in the Python layer." +msgid "" +"This is the type object for type objects; it is the same object as " +":class:`type` in the Python layer." msgstr "" +"این شیء نوع برای اشیاء نوع است؛ این همان شیء :class:`type` در لایه‌ی پایتون " +"است." -msgid "Return non-zero if the object *o* is a type object, including instances of types derived from the standard type object. Return 0 in all other cases. This function always succeeds." +msgid "" +"Return non-zero if the object *o* is a type object, including instances of " +"types derived from the standard type object. Return 0 in all other cases. " +"This function always succeeds." msgstr "" +"اگر شیء *o* یک شیء نوع باشد، مقدار غیرصفر را برمی‌گرداند؛ این امر شامل " +"نمونه‌هایی از نوع‌های مشتق‌شده از شیء نوع استاندارد نیز می‌شود. در تمام " +"موارد دیگر، 0 را برمی‌گرداند. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return non-zero if the object *o* is a type object, but not a subtype of the standard type object. Return 0 in all other cases. This function always succeeds." +msgid "" +"Return non-zero if the object *o* is a type object, but not a subtype of the" +" standard type object. Return 0 in all other cases. This function always " +"succeeds." msgstr "" +"اگر شیء *o* یک شیء نوع باشد، اما زیرنوعی از شیء نوع استاندارد نباشد، مقدار " +"غیرصفر برمی‌گرداند. در تمام موارد دیگر ۰ برمی‌گرداند. این تابع همیشه با " +"موفقیت اجرا می‌شود." msgid "Clear the internal lookup cache. Return the current version tag." -msgstr "" +msgstr "نهانگاه جستجوی داخلی را پاک می‌کند. برچسب نسخه‌ی فعلی را برمی‌گرداند." -msgid "Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily meant for use with ``Py_LIMITED_API``; the individual flag bits are guaranteed to be stable across Python releases, but access to :c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited API `." -msgstr "" +msgid "" +"Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " +"function is primarily meant for use with ``Py_LIMITED_API``; the individual " +"flag bits are guaranteed to be stable across Python releases, but access to " +":c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited " +"API `." +msgstr "" +"عضو :c:member:`~PyTypeObject.tp_flags` از *type* را برمی‌گرداند. این تابع در" +" درجه‌ی اول برای استفاده با ``Py_LIMITED_API`` در نظر گرفته شده است؛ تضمین " +"شده است که بیت‌های منفرد پرچم در میان نسخه‌های پایتون پایدار باقی بمانند، " +"اما دسترسی به خودِ :c:member:`~PyTypeObject.tp_flags` بخشی از :ref:`API " +"محدود ` نیست." msgid "The return type is now ``unsigned long`` rather than ``long``." -msgstr "" +msgstr "نوع بازگشتی اکنون ``unsigned long`` است، به‌جای ``long``." -msgid "Return the type object's internal namespace, which is otherwise only exposed via a read-only proxy (:attr:`cls.__dict__ `). This is a replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly. The returned dictionary must be treated as read-only." +msgid "" +"Return the type object's internal namespace, which is otherwise only exposed" +" via a read-only proxy (:attr:`cls.__dict__ `). This is a " +"replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly. The " +"returned dictionary must be treated as read-only." msgstr "" +"فضای نام داخلی شیء نوع را برمی‌گرداند که در غیر این صورت تنها از طریق یک " +"پراکسی فقط‌خواندنی (:attr:`cls.__dict__ `) در دسترس قرار " +"می‌گیرد. این جایگزینی برای دسترسی مستقیم به " +":c:member:`~PyTypeObject.tp_dict` است. دیکشنری بازگردانده‌شده باید به‌عنوان " +"فقط‌خواندنی در نظر گرفته شود." -msgid "This function is meant for specific embedding and language-binding cases, where direct access to the dict is necessary and indirect access (e.g. via the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." +msgid "" +"This function is meant for specific embedding and language-binding cases, " +"where direct access to the dict is necessary and indirect access (e.g. via " +"the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." msgstr "" +"این تابع برای موارد خاص تعبیه (embedding) و پیوند زبانی (language binding) " +"در نظر گرفته شده است؛ مواردی که دسترسی مستقیم به دیکشنری ضروری است و دسترسی " +"غیرمستقیم (مثلاً از طریق پراکسی یا :c:func:`PyObject_GetAttr`) کافی نیست." -msgid "Extension modules should continue to use ``tp_dict``, directly or indirectly, when setting up their own types." +msgid "" +"Extension modules should continue to use ``tp_dict``, directly or " +"indirectly, when setting up their own types." msgstr "" +"ماژول‌های توسعه‌ای باید هنگام راه‌اندازی نوع‌های خودشان، همچنان از " +"``tp_dict`` به‌طور مستقیم یا غیرمستقیم استفاده کنند." -msgid "Invalidate the internal lookup cache for the type and all of its subtypes. This function must be called after any manual modification of the attributes or base classes of the type." +msgid "" +"Invalidate the internal lookup cache for the type and all of its subtypes. " +"This function must be called after any manual modification of the attributes" +" or base classes of the type." msgstr "" +"نهانگاه جستجوی داخلی را برای نوع و همه‌ی زیرنوع‌های آن بی‌اعتبار می‌کند. این" +" تابع باید پس از هرگونه تغییر دستی در ویژگی‌ها یا کلاس‌های پایه‌ی نوع " +"فراخوانی شود." -msgid "Register *callback* as a type watcher. Return a non-negative integer ID which must be passed to future calls to :c:func:`PyType_Watch`. In case of error (e.g. no more watcher IDs available), return ``-1`` and set an exception." +msgid "" +"Register *callback* as a type watcher. Return a non-negative integer ID " +"which must be passed to future calls to :c:func:`PyType_Watch`. In case of " +"error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." msgstr "" +"*کال‌بک* را به‌عنوان دیده‌بان نوع (type watcher) ثبت می‌کند. یک شناسه‌ی عدد " +"صحیح نا‌منفی برمی‌گرداند که باید به فراخوانی‌های آتی :c:func:`PyType_Watch` " +"پاس داده شود. در صورت خطا (مثلاً وقتی شناسه‌ی دیده‌بان دیگری در دسترس نیست)،" +" مقدار ``-1`` را برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so it must be called at start up (before spawning the first thread)." +msgid "" +"In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so " +"it must be called at start up (before spawning the first thread)." msgstr "" +"در بیلدهای نخ‌آزاد، :c:func:`PyType_AddWatcher` نخ‌ایمن نیست، بنابراین باید " +"هنگام راه‌اندازی (پیش از ایجاد اولین نخ) فراخوانی شود." -msgid "Clear watcher identified by *watcher_id* (previously returned from :c:func:`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if *watcher_id* was never registered.)" +msgid "" +"Clear watcher identified by *watcher_id* (previously returned from " +":c:func:`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g." +" if *watcher_id* was never registered.)" msgstr "" +"پاک‌کردن دیده‌بان (watcher) شناسایی‌شده با *watcher_id* (که پیش‌تر از " +":c:func:`PyType_AddWatcher` برگردانده شده است). در صورت موفقیت ``0`` و در " +"صورت خطا ``-1`` برگردانده می‌شود (مثلاً اگر *watcher_id* هرگز ثبت نشده " +"باشد.)" -msgid "An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* that was not returned to it by a previous call to :c:func:`PyType_AddWatcher`." +msgid "" +"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " +"that was not returned to it by a previous call to " +":c:func:`PyType_AddWatcher`." msgstr "" +"یک ماژول توسعه‌ای هرگز نباید ``PyType_ClearWatcher`` را با یک *watcher_id* " +"که توسط فراخوانی قبلی :c:func:`PyType_AddWatcher` به آن بازگردانده نشده است،" +" فراخوانی کند." -msgid "Mark *type* as watched. The callback granted *watcher_id* by :c:func:`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` reports a change to *type*. (The callback may be called only once for a series of consecutive modifications to *type*, if :c:func:`!_PyType_Lookup` is not called on *type* between the modifications; this is an implementation detail and subject to change.)" -msgstr "" +msgid "" +"Mark *type* as watched. The callback granted *watcher_id* by " +":c:func:`PyType_AddWatcher` will be called whenever " +":c:func:`PyType_Modified` reports a change to *type*. (The callback may be " +"called only once for a series of consecutive modifications to *type*, if " +":c:func:`!_PyType_Lookup` is not called on *type* between the modifications;" +" this is an implementation detail and subject to change.)" +msgstr "" +"*type* را به‌عنوان تحت نظارت علامت‌گذاری می‌کند. کال‌بکی که " +":c:func:`PyType_AddWatcher` شناسه‌ی *watcher_id* را به آن اعطا کرده است، هر " +"زمان که :c:func:`PyType_Modified` تغییری در *type* را گزارش کند، فراخوانی " +"خواهد شد. (کال‌بک ممکن است برای یک سری تغییرهای متوالی در *type* تنها یک بار" +" فراخوانی شود، اگر :c:func:`!_PyType_Lookup` بین این تغییرها بر روی *type* " +"فراخوانی نشود؛ این یک جزئیات پیاده‌سازی است و ممکن است تغییر کند.)" -msgid "An extension should never call ``PyType_Watch`` with a *watcher_id* that was not returned to it by a previous call to :c:func:`PyType_AddWatcher`." +msgid "" +"An extension should never call ``PyType_Watch`` with a *watcher_id* that was" +" not returned to it by a previous call to :c:func:`PyType_AddWatcher`." msgstr "" +"یک ماژول توسعه‌ای هرگز نباید ``PyType_Watch`` را با یک *watcher_id* که " +"پیش‌تر توسط فراخوانی :c:func:`PyType_AddWatcher` به آن بازگردانده نشده است، " +"فراخوانی کند." -msgid "Mark *type* as not watched. This undoes a previous call to :c:func:`PyType_Watch`. *type* must not be ``NULL``." +msgid "" +"Mark *type* as not watched. This undoes a previous call to " +":c:func:`PyType_Watch`. *type* must not be ``NULL``." msgstr "" +"*type* را به‌عنوان نظارت‌نشده علامت‌گذاری می‌کند. این کار، فراخوانی قبلیِ " +":c:func:`PyType_Watch` را خنثی می‌کند. *type* نباید ``NULL`` باشد." -msgid "An extension should never call this function with a *watcher_id* that was not returned to it by a previous call to :c:func:`PyType_AddWatcher`." +msgid "" +"An extension should never call this function with a *watcher_id* that was " +"not returned to it by a previous call to :c:func:`PyType_AddWatcher`." msgstr "" +"یک ماژول توسعه‌ای هرگز نباید این تابع را با یک *watcher_id* که توسط فراخوانی" +" قبلی :c:func:`PyType_AddWatcher` به آن بازگردانده نشده است، فراخوانی کند." -msgid "On success, this function returns ``0``. On failure, this function returns ``-1`` with an exception set." +msgid "" +"On success, this function returns ``0``. On failure, this function returns " +"``-1`` with an exception set." msgstr "" +"در صورت موفقیت، این تابع ``0`` را برمی‌گرداند. در صورت شکست، این تابع ``-1``" +" را همراه با استثنای تنظیم‌شده برمی‌گرداند." msgid "Type of a type-watcher callback function." -msgstr "" +msgstr "نوع تابع کال‌بک دیده‌بان نوع (type-watcher)." -msgid "The callback must not modify *type* or cause :c:func:`PyType_Modified` to be called on *type* or any type in its MRO; violating this rule could cause infinite recursion." +msgid "" +"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be" +" called on *type* or any type in its MRO; violating this rule could cause " +"infinite recursion." msgstr "" +"کال‌بک نباید *type* را تغییر دهد یا باعث فراخوانی :c:func:`PyType_Modified` " +"روی *type* یا هیچ نوعی در ترتیب حل متد (MRO) آن شود؛ نقض این قاعده می‌تواند " +"منجر به بازگشت بی‌نهایت شود." -msgid "Return non-zero if the type object *o* sets the feature *feature*. Type features are denoted by single bit flags." +msgid "" +"Return non-zero if the type object *o* sets the feature *feature*. Type " +"features are denoted by single bit flags." msgstr "" +"اگر شیء نوع *o* ویژگی *feature* را تنظیم کرده باشد، مقدار غیرصفر " +"برمی‌گرداند. ویژگی‌های نوع با پرچم‌های تک‌بیتی نشان داده می‌شوند." -msgid "Return non-zero if the type object *type* sets the subclass flag *flag*. Subclass flags are denoted by :c:macro:`Py_TPFLAGS_*_SUBCLASS `. This function is used by many ``_Check`` functions for common types." +msgid "" +"Return non-zero if the type object *type* sets the subclass flag *flag*. " +"Subclass flags are denoted by :c:macro:`Py_TPFLAGS_*_SUBCLASS " +"`. This function is used by many ``_Check`` " +"functions for common types." msgstr "" +"اگر شیء نوع *type* پرچم زیرکلاس *flag* را تنظیم کرده باشد، مقدار ناصفر " +"برمی‌گرداند. پرچم‌های زیرکلاس با :c:macro:`Py_TPFLAGS_*_SUBCLASS " +"` نشان داده می‌شوند. این تابع توسط بسیاری از توابع" +" ``_Check`` برای نوع‌های رایج استفاده می‌شود." -msgid ":c:func:`PyObject_TypeCheck`, which is used as a slower alternative in ``_Check`` functions for types that don't come with subclass flags." +msgid "" +":c:func:`PyObject_TypeCheck`, which is used as a slower alternative in " +"``_Check`` functions for types that don't come with subclass flags." msgstr "" +":c:func:`PyObject_TypeCheck`، که در توابع ``_Check`` برای نوع‌هایی که " +"پرچم‌های زیرکلاس ندارند، به‌عنوان جایگزینی کندتر استفاده می‌شود." -msgid "Return true if the type object includes support for the cycle detector; this tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." +msgid "" +"Return true if the type object includes support for the cycle detector; this" +" tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" +"اگر شیء نوع شامل پشتیبانی از آشکارساز چرخه باشد، مقدار true را برمی‌گرداند؛ " +"این تابع پرچم نوع :c:macro:`Py_TPFLAGS_HAVE_GC` را بررسی می‌کند." msgid "Return true if *a* is a subtype of *b*." -msgstr "" +msgstr "اگر *a* زیرنوعی از *b* باشد، مقدار درست را برمی‌گرداند." -msgid "This function only checks for actual subtypes, which means that :meth:`~type.__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do." +msgid "" +"This function only checks for actual subtypes, which means that " +":meth:`~type.__subclasscheck__` is not called on *b*. Call " +":c:func:`PyObject_IsSubclass` to do the same check that :func:`issubclass` " +"would do." msgstr "" +"این تابع فقط زیرنوع‌های واقعی را بررسی می‌کند، به این معنا که " +":meth:`~type.__subclasscheck__` روی *b* فراخوانی نمی‌شود. برای انجام همان " +"بررسی‌ای که :func:`issubclass` انجام می‌دهد، :c:func:`PyObject_IsSubclass` " +"را فراخوانی کنید." -msgid "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type object. Uses Python's default memory allocation mechanism to allocate memory for a new instance, zeros the memory, then initializes the memory as if by calling :c:func:`PyObject_Init` or :c:func:`PyObject_InitVar`." +msgid "" +"Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " +"object. Uses Python's default memory allocation mechanism to allocate " +"memory for a new instance, zeros the memory, then initializes the memory as " +"if by calling :c:func:`PyObject_Init` or :c:func:`PyObject_InitVar`." msgstr "" +"هندلر عام برای جایگاه :c:member:`~PyTypeObject.tp_alloc` در یک شیء نوع. از " +"سازوکار تخصیص حافظه پیش‌فرض پایتون برای تخصیص حافظه به یک نمونه جدید استفاده" +" می‌کند، حافظه را صفر می‌کند، سپس حافظه را مقداردهی اولیه می‌کند، گویی که " +":c:func:`PyObject_Init` یا :c:func:`PyObject_InitVar` فراخوانی شده باشد." -msgid "Do not call this directly to allocate memory for an object; call the type's :c:member:`~PyTypeObject.tp_alloc` slot instead." +msgid "" +"Do not call this directly to allocate memory for an object; call the type's " +":c:member:`~PyTypeObject.tp_alloc` slot instead." msgstr "" +"برای تخصیص حافظه به یک شیء، این را مستقیماً فراخوانی نکنید؛ در عوض، جایگاه " +":c:member:`~PyTypeObject.tp_alloc` نوع را فراخوانی کنید." -msgid "For types that support garbage collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set), this function behaves like :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar` (except the memory is guaranteed to be zeroed before initialization), and should be paired with :c:func:`PyObject_GC_Del` in :c:member:`~PyTypeObject.tp_free`. Otherwise, it behaves like :c:macro:`PyObject_New` or :c:macro:`PyObject_NewVar` (except the memory is guaranteed to be zeroed before initialization) and should be paired with :c:func:`PyObject_Free` in :c:member:`~PyTypeObject.tp_free`." -msgstr "" +msgid "" +"For types that support garbage collection (i.e., the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag is set), this function behaves like " +":c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar` (except the " +"memory is guaranteed to be zeroed before initialization), and should be " +"paired with :c:func:`PyObject_GC_Del` in :c:member:`~PyTypeObject.tp_free`. " +"Otherwise, it behaves like :c:macro:`PyObject_New` or " +":c:macro:`PyObject_NewVar` (except the memory is guaranteed to be zeroed " +"before initialization) and should be paired with :c:func:`PyObject_Free` in " +":c:member:`~PyTypeObject.tp_free`." +msgstr "" +"برای نوع‌هایی که از زباله‌روبی پشتیبانی می‌کنند (یعنی پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم شده باشد)، این تابع مانند " +":c:macro:`PyObject_GC_New` یا :c:macro:`PyObject_GC_NewVar` رفتار می‌کند " +"(به‌جز اینکه تضمین می‌شود حافظه پیش از مقداردهی اولیه صفر شود)، و باید در " +":c:member:`~PyTypeObject.tp_free` با :c:func:`PyObject_GC_Del` جفت شود. در " +"غیر این صورت، مانند :c:macro:`PyObject_New` یا :c:macro:`PyObject_NewVar` " +"رفتار می‌کند (به‌جز اینکه تضمین می‌شود حافظه پیش از مقداردهی اولیه صفر شود) " +"و باید در :c:member:`~PyTypeObject.tp_free` با :c:func:`PyObject_Free` جفت " +"شود." -msgid "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type object. Creates a new instance using the type's :c:member:`~PyTypeObject.tp_alloc` slot and returns the resulting object." +msgid "" +"Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " +"object. Creates a new instance using the type's " +":c:member:`~PyTypeObject.tp_alloc` slot and returns the resulting object." msgstr "" +"هندلر عام برای جایگاه :c:member:`~PyTypeObject.tp_new` در یک شیء نوع است. " +"با استفاده از جایگاه :c:member:`~PyTypeObject.tp_alloc` نوع، نمونه‌ای جدید " +"ایجاد می‌کند و شیء حاصل را برمی‌گرداند." -msgid "Finalize a type object. This should be called on all type objects to finish their initialization. This function is responsible for adding inherited slots from a type's base class. Return ``0`` on success, or return ``-1`` and sets an exception on error." +msgid "" +"Finalize a type object. This should be called on all type objects to finish" +" their initialization. This function is responsible for adding inherited " +"slots from a type's base class. Return ``0`` on success, or return ``-1`` " +"and sets an exception on error." msgstr "" +"یک شیء نوع را نهایی می‌کند. این تابع باید روی همه‌ی شیءهای نوع فراخوانی شود " +"تا مقداردهی اولیه‌شان به پایان برسد. این تابع مسئول افزودن جایگاه‌های " +"به‌ارث‌رسیده از کلاس پایه‌ی یک نوع است. در صورت موفقیت ``0`` را برمی‌گرداند،" +" یا در صورت خطا ``-1`` را برمی‌گرداند و یک استثنا تنظیم می‌کند." -msgid "If some of the base classes implements the GC protocol and the provided type does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC protocol will be automatically implemented from its parents. On the contrary, if the type being created does include :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` handle." -msgstr "" +msgid "" +"If some of the base classes implements the GC protocol and the provided type" +" does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the " +"GC protocol will be automatically implemented from its parents. On the " +"contrary, if the type being created does include " +":c:macro:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC" +" protocol itself by at least implementing the " +":c:member:`~PyTypeObject.tp_traverse` handle." +msgstr "" +"اگر برخی از کلاس‌های پایه پروتکل زباله‌روبی (GC) را پیاده‌سازی کرده باشند و " +"نوع ارائه‌شده در پرچم‌هایش شامل :c:macro:`Py_TPFLAGS_HAVE_GC` نباشد، آنگاه " +"پروتکل زباله‌روبی به‌طور خودکار از کلاس‌های والدش پیاده‌سازی خواهد شد. در " +"مقابل، اگر نوعی که در حال ایجاد است در پرچم‌هایش شامل " +":c:macro:`Py_TPFLAGS_HAVE_GC` باشد، آنگاه **باید** خودش پروتکل زباله‌روبی را" +" پیاده‌سازی کند، دست‌کم با پیاده‌سازی دسته " +":c:member:`~PyTypeObject.tp_traverse`." -msgid "Return the type's name. Equivalent to getting the type's :attr:`~type.__name__` attribute." +msgid "" +"Return the type's name. Equivalent to getting the type's " +":attr:`~type.__name__` attribute." msgstr "" +"نام نوع را برمی‌گرداند. برابر است با دریافت ویژگی :attr:`~type.__name__` " +"نوع." -msgid "Return the type's qualified name. Equivalent to getting the type's :attr:`~type.__qualname__` attribute." +msgid "" +"Return the type's qualified name. Equivalent to getting the type's " +":attr:`~type.__qualname__` attribute." msgstr "" +"نام کامل نوع را برمی‌گرداند. این کار معادل گرفتن ویژگی " +":attr:`~type.__qualname__` نوع است." -msgid "Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}.{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type.__module__` is not a string or is equal to ``\"builtins\"``." +msgid "" +"Return the type's fully qualified name. Equivalent to " +"``f\"{type.__module__}.{type.__qualname__}\"``, or :attr:`type.__qualname__`" +" if :attr:`type.__module__` is not a string or is equal to ``\"builtins\"``." msgstr "" +"نام کامل نوع را برمی‌گرداند. معادل " +"``f\"{type.__module__}.{type.__qualname__}\"`` است، یا " +":attr:`type.__qualname__` اگر :attr:`type.__module__` رشته نباشد یا برابر با" +" ``\"builtins\"`` باشد." -msgid "Return the type's module name. Equivalent to getting the :attr:`type.__module__` attribute." +msgid "" +"Return the type's module name. Equivalent to getting the " +":attr:`type.__module__` attribute." msgstr "" +"نام ماژول نوع را برمی‌گرداند. این معادل گرفتن ویژگی :attr:`type.__module__` " +"است." -msgid "Return the function pointer stored in the given slot. If the result is ``NULL``, this indicates that either the slot is ``NULL``, or that the function was called with invalid parameters. Callers will typically cast the result pointer into the appropriate function type." +msgid "" +"Return the function pointer stored in the given slot. If the result is " +"``NULL``, this indicates that either the slot is ``NULL``, or that the " +"function was called with invalid parameters. Callers will typically cast the" +" result pointer into the appropriate function type." msgstr "" +"اشاره‌گر تابع ذخیره‌شده در جایگاه داده‌شده را برمی‌گرداند. اگر نتیجه " +"``NULL`` باشد، این نشان می‌دهد که یا جایگاه ``NULL`` است، یا اینکه تابع با " +"پارامترهای نامعتبر فراخوانی‌شده است. فراخوانندگان معمولاً اشاره‌گر نتیجه را " +"به نوع تابع مناسب قالب‌ریزی می‌کنند." -msgid "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." +msgid "" +"See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" +"برای مقادیر ممکن آرگومان *slot* به :c:member:`PyType_Slot.slot` مراجعه کنید." -msgid ":c:func:`PyType_GetSlot` can now accept all types. Previously, it was limited to :ref:`heap types `." +msgid "" +":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " +"limited to :ref:`heap types `." msgstr "" +":c:func:`PyType_GetSlot` اکنون می‌تواند همه انواع را بپذیرد. پیش‌تر، محدود " +"به :ref:`نوع‌های هیپ ` بود." -msgid "Return the module object associated with the given type when the type was created using :c:func:`PyType_FromModuleAndSpec`." +msgid "" +"Return the module object associated with the given type when the type was " +"created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" +"شیء ماژول مرتبط با نوع داده‌شده را برمی‌گرداند، هنگامی که این نوع با استفاده" +" از :c:func:`PyType_FromModuleAndSpec` ایجاد شده باشد." -msgid "The returned reference is :term:`borrowed ` from *type*, and will be valid as long as you hold a reference to *type*. Do not release it with :c:func:`Py_DECREF` or similar." +msgid "" +"The returned reference is :term:`borrowed ` from *type*," +" and will be valid as long as you hold a reference to *type*. Do not release" +" it with :c:func:`Py_DECREF` or similar." msgstr "" +"ارجاع بازگردانده‌شده از *type* به‌صورت :term:`امانتی ` " +"است و تا زمانی که ارجاعی به *type* را نگه دارید، معتبر خواهد بود. آن را با " +":c:func:`Py_DECREF` یا مشابه آن آزاد نکنید." -msgid "If no module is associated with the given type, sets :py:class:`TypeError` and returns ``NULL``." +msgid "" +"If no module is associated with the given type, sets :py:class:`TypeError` " +"and returns ``NULL``." msgstr "" +"اگر هیچ ماژولی با نوع داده‌شده مرتبط نباشد، :py:class:`TypeError` را تنظیم " +"می‌کند و ``NULL`` را برمی‌گرداند." -msgid "This function is usually used to get the module in which a method is defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the intended class, and subclasses are not necessarily defined in the same module as their superclass. See :c:type:`PyCMethod` to get the class that defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:type:`!PyCMethod` cannot be used." -msgstr "" +msgid "" +"This function is usually used to get the module in which a method is " +"defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may" +" not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of " +"the intended class, and subclasses are not necessarily defined in the same " +"module as their superclass. See :c:type:`PyCMethod` to get the class that " +"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when " +":c:type:`!PyCMethod` cannot be used." +msgstr "" +"این تابع معمولاً برای به‌دست‌آوردن ماژولی که متدی در آن تعریف شده است " +"استفاده می‌شود. توجه داشته باشید که در چنین متدی، " +"``PyType_GetModule(Py_TYPE(self))`` ممکن است نتیجه‌ی مورد نظر را برنگرداند. " +"``Py_TYPE(self)`` ممکن است یک *زیرکلاس* از کلاس مورد نظر باشد و زیرکلاس‌ها " +"لزوماً در همان ماژولی که ابرکلاس‌شان در آن تعریف شده است، تعریف نمی‌شوند. " +"برای به‌دست‌آوردن کلاسی که متد را تعریف می‌کند، به :c:type:`PyCMethod` " +"مراجعه کنید. برای مواردی که نمی‌توان از :c:type:`!PyCMethod` استفاده کرد، به" +" :c:func:`PyType_GetModuleByDef` مراجعه کنید." -msgid "Return the state of the module object associated with the given type. This is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:func:`PyType_GetModule`." +msgid "" +"Return the state of the module object associated with the given type. This " +"is a shortcut for calling :c:func:`PyModule_GetState()` on the result of " +":c:func:`PyType_GetModule`." msgstr "" +"وضعیت شیء ماژول مرتبط با نوع داده‌شده را برمی‌گرداند. این یک میان‌بر برای " +"فراخوانی :c:func:`PyModule_GetState()` بر روی نتیجه‌ی " +":c:func:`PyType_GetModule` است." -msgid "If the *type* has an associated module but its state is ``NULL``, returns ``NULL`` without setting an exception." +msgid "" +"If the *type* has an associated module but its state is ``NULL``, returns " +"``NULL`` without setting an exception." msgstr "" +"اگر *نوع* ماژول مرتبطی داشته باشد اما وضعیت آن ``NULL`` باشد، ``NULL`` را " +"بدون تنظیم استثنا برمی‌گرداند." -msgid "Find the first superclass whose module was created from the given :c:type:`PyModuleDef` *def*, and return that module." +msgid "" +"Find the first superclass whose module was created from the given " +":c:type:`PyModuleDef` *def*, and return that module." msgstr "" +"اولین ابرکلاسی را بیابید که ماژول آن از :c:type:`PyModuleDef` *def* داده‌شده" +" ساخته‌شده است و آن ماژول را برگردانید." -msgid "If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." +msgid "" +"If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." msgstr "" +"اگر هیچ ماژولی یافت نشود، یک :py:class:`TypeError` ایجاد می‌کند و ``NULL`` " +"را برمی‌گرداند." -msgid "This function is intended to be used together with :c:func:`PyModule_GetState()` to get module state from slot methods (such as :c:member:`~PyTypeObject.tp_init` or :c:member:`~PyNumberMethods.nb_add`) and other places where a method's defining class cannot be passed using the :c:type:`PyCMethod` calling convention." -msgstr "" +msgid "" +"This function is intended to be used together with " +":c:func:`PyModule_GetState()` to get module state from slot methods (such as" +" :c:member:`~PyTypeObject.tp_init` or :c:member:`~PyNumberMethods.nb_add`) " +"and other places where a method's defining class cannot be passed using the " +":c:type:`PyCMethod` calling convention." +msgstr "" +"این تابع برای استفاده همراه با :c:func:`PyModule_GetState()` جهت گرفتن وضعیت" +" ماژول از متدهای جایگاه (مانند :c:member:`~PyTypeObject.tp_init` یا " +":c:member:`~PyNumberMethods.nb_add`) و دیگر جاهایی که کلاس تعریف‌کننده‌ی متد" +" را نمی‌توان با استفاده از قرارداد فراخوانی :c:type:`PyCMethod` ارسال کرد، " +"در نظر گرفته شده است." -msgid "Find the first superclass in *type*'s :term:`method resolution order` whose :c:macro:`Py_tp_token` token is equal to the given one." +msgid "" +"Find the first superclass in *type*'s :term:`method resolution order` whose " +":c:macro:`Py_tp_token` token is equal to the given one." msgstr "" +"اولین ابرکلاسی را در :term:`ترتیب حل متد ` *type* " +"می‌یابد که توکن :c:macro:`Py_tp_token` آن با توکن داده‌شده برابر است." -msgid "If found, set *\\*result* to a new :term:`strong reference` to it and return ``1``." +msgid "" +"If found, set *\\*result* to a new :term:`strong reference` to it and return" +" ``1``." msgstr "" +"اگر یافت شود، *\\*result* را برابر با یک :term:`ارجاع قوی ` جدید به آن قرار می‌دهد و ``1`` را برمی‌گرداند." msgid "If not found, set *\\*result* to ``NULL`` and return ``0``." msgstr "" +"اگر یافت نشد، *\\*result* را برابر ``NULL`` قرار دهید و ``0`` را برگردانید." -msgid "On error, set *\\*result* to ``NULL`` and return ``-1`` with an exception set." +msgid "" +"On error, set *\\*result* to ``NULL`` and return ``-1`` with an exception " +"set." msgstr "" +"در صورت خطا، *\\*result* را برابر ``NULL`` قرار دهید و ``-1`` را همراه با " +"استثنای تنظیم‌شده برگردانید." -msgid "The *result* argument may be ``NULL``, in which case *\\*result* is not set. Use this if you need only the return value." +msgid "" +"The *result* argument may be ``NULL``, in which case *\\*result* is not set." +" Use this if you need only the return value." msgstr "" +"آرگومان *result* می‌تواند ``NULL`` باشد که در این صورت *\\*result* مقداردهی " +"نمی‌شود. اگر فقط به مقدار بازگشتی نیاز دارید، از این استفاده کنید." msgid "The *token* argument may not be ``NULL``." -msgstr "" +msgstr "آرگومان *token* نباید ``NULL`` باشد." msgid "Attempt to assign a version tag to the given type." -msgstr "" +msgstr "تلاش می‌کند تا یک برچسب نسخه را به نوع داده‌شده انتساب دهد." -msgid "Returns 1 if the type already had a valid version tag or a new one was assigned, or 0 if a new tag could not be assigned." +msgid "" +"Returns 1 if the type already had a valid version tag or a new one was " +"assigned, or 0 if a new tag could not be assigned." msgstr "" +"اگر نوع از قبل برچسب نسخه‌ی معتبر داشته باشد یا برچسب جدیدی به آن اختصاص " +"داده شود، مقدار ۱ را برمی‌گرداند، و اگر نتوان برچسب جدیدی به آن اختصاص داد، " +"مقدار ۰ را برمی‌گرداند." -msgid "Return true if instances of *type* support creating weak references, false otherwise. This function always succeeds. *type* must not be ``NULL``." +msgid "" +"Return true if instances of *type* support creating weak references, false " +"otherwise. This function always succeeds. *type* must not be ``NULL``." msgstr "" +"اگر نمونه‌های *type* از ایجاد ارجاع ضعیف پشتیبانی کنند، مقدار درست و در غیر " +"این صورت مقدار نادرست را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود. " +"*type* نباید ``NULL`` باشد." msgid ":ref:`weakrefobjects`" -msgstr "" +msgstr ":ref:`weakrefobjects`" msgid ":py:mod:`weakref`" -msgstr "" +msgstr ":py:mod:`weakref`" msgid "Creating Heap-Allocated Types" -msgstr "" +msgstr "ایجاد نوع‌های تخصیص‌یافته از هیپ" -msgid "The following functions and structs are used to create :ref:`heap types `." +msgid "" +"The following functions and structs are used to create :ref:`heap types " +"`." msgstr "" +"توابع و ساختارهای زیر برای ایجاد :ref:`نوع‌های هیپ ` استفاده " +"می‌شوند." -msgid "Create and return a :ref:`heap type ` from the *spec* (see :c:macro:`Py_TPFLAGS_HEAPTYPE`)." +msgid "" +"Create and return a :ref:`heap type ` from the *spec* (see " +":c:macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" +"یک :ref:`نوع هیپ ` از *spec* بسازید و بازگردانید (به " +":c:macro:`Py_TPFLAGS_HEAPTYPE` مراجعه کنید)." -msgid "The metaclass *metaclass* is used to construct the resulting type object. When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or *Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." +msgid "" +"The metaclass *metaclass* is used to construct the resulting type object. " +"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " +"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." msgstr "" +"فراکلاس *metaclass* برای ساخت شیء نوع حاصل استفاده می‌شود. وقتی *metaclass* " +"برابر ``NULL`` باشد، فراکلاس از *bases* به دست می‌آید (یا از جایگاه‌های " +"*Py_tp_base[s]* اگر *bases* برابر ``NULL`` باشد؛ در ادامه ببینید)." -msgid "Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not supported, except if ``tp_new`` is ``NULL``." +msgid "" +"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " +"supported, except if ``tp_new`` is ``NULL``." msgstr "" +"فراکلاس‌هایی که :c:member:`~PyTypeObject.tp_new` را بازنویسی می‌کنند " +"پشتیبانی نمی‌شوند، مگر آنکه ``tp_new`` برابر ``NULL`` باشد." -msgid "The *bases* argument can be used to specify base classes; it can either be only one class or a tuple of classes. If *bases* is ``NULL``, the :c:data:`Py_tp_bases` slot is used instead. If that also is ``NULL``, the :c:data:`Py_tp_base` slot is used instead. If that also is ``NULL``, the new type derives from :class:`object`." -msgstr "" +msgid "" +"The *bases* argument can be used to specify base classes; it can either be " +"only one class or a tuple of classes. If *bases* is ``NULL``, the " +":c:data:`Py_tp_bases` slot is used instead. If that also is ``NULL``, the " +":c:data:`Py_tp_base` slot is used instead. If that also is ``NULL``, the new" +" type derives from :class:`object`." +msgstr "" +"می‌توان از آرگومان *bases* برای تعیین کلاس‌های پایه استفاده کرد؛ این آرگومان" +" می‌تواند تنها یک کلاس یا یک تاپل از کلاس‌ها باشد. اگر *bases* برابر " +"``NULL`` باشد، در عوض از جایگاه :c:data:`Py_tp_bases` استفاده می‌شود. اگر آن" +" نیز ``NULL`` باشد، در عوض از جایگاه :c:data:`Py_tp_base` استفاده می‌شود. " +"اگر آن نیز ``NULL`` باشد، نوع جدید از :class:`object` مشتق می‌شود." -msgid "The *module* argument can be used to record the module in which the new class is defined. It must be a module object or ``NULL``. If not ``NULL``, the module is associated with the new type and can later be retrieved with :c:func:`PyType_GetModule`. The associated module is not inherited by subclasses; it must be specified for each class individually." -msgstr "" +msgid "" +"The *module* argument can be used to record the module in which the new " +"class is defined. It must be a module object or ``NULL``. If not ``NULL``, " +"the module is associated with the new type and can later be retrieved with " +":c:func:`PyType_GetModule`. The associated module is not inherited by " +"subclasses; it must be specified for each class individually." +msgstr "" +"می‌توان از آرگومان *module* برای ثبت ماژولی که کلاس جدید در آن تعریف می‌شود،" +" استفاده کرد. این آرگومان باید یک شیء ماژول یا ``NULL`` باشد. اگر ``NULL`` " +"نباشد، ماژول با نوع جدید مرتبط می‌شود و بعداً می‌توان آن را با " +":c:func:`PyType_GetModule` بازیابی کرد. ماژول مرتبط به زیرکلاس‌ها به ارث " +"نمی‌رسد؛ باید برای هر کلاس به‌طور جداگانه مشخص شود." msgid "This function calls :c:func:`PyType_Ready` on the new type." -msgstr "" +msgstr "این تابع :c:func:`PyType_Ready` را روی نوع جدید فراخوانی می‌کند." -msgid "Note that this function does *not* fully match the behavior of calling :py:class:`type() ` or using the :keyword:`class` statement. With user-provided base types or metaclasses, prefer :ref:`calling ` :py:class:`type` (or the metaclass) over ``PyType_From*`` functions. Specifically:" -msgstr "" +msgid "" +"Note that this function does *not* fully match the behavior of calling " +":py:class:`type() ` or using the :keyword:`class` statement. With " +"user-provided base types or metaclasses, prefer :ref:`calling ` " +":py:class:`type` (or the metaclass) over ``PyType_From*`` functions. " +"Specifically:" +msgstr "" +"توجه داشته باشید که این تابع به‌طور کامل با رفتار فراخوانی :py:class:`type()" +" ` یا استفاده از دستور :keyword:`class` مطابقت *ندارد*. با نوع‌های " +"پایه یا فراکلاس‌های ارائه‌شده از سوی کاربر، :ref:`فراخوانی ` " +":py:class:`type` (یا فراکلاس) را به توابع ``PyType_From*`` ترجیح دهید. " +"به‌طور مشخص:" -msgid ":py:meth:`~object.__new__` is not called on the new class (and it must be set to ``type.__new__``)." +msgid "" +":py:meth:`~object.__new__` is not called on the new class (and it must be " +"set to ``type.__new__``)." msgstr "" +":py:meth:`~object.__new__` روی کلاس جدید فراخوانی نمی‌شود (و باید روی " +"``type.__new__`` تنظیم شود)." msgid ":py:meth:`~object.__init__` is not called on the new class." -msgstr "" +msgstr ":py:meth:`~object.__init__` روی کلاس جدید فراخوانی نمی‌شود." msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." msgstr "" +":py:meth:`~object.__init_subclass__` روی هیچ‌یک از کلاس‌های پایه فراخوانی " +"نمی‌شود." msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." msgstr "" +":py:meth:`~object.__set_name__` روی توصیف‌گرهای جدید فراخوانی نمی‌شود." msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." -msgstr "" +msgstr "معادل ``PyType_FromMetaclass(NULL, module, spec, bases)`` است." -msgid "The function now accepts a single class as the *bases* argument and ``NULL`` as the ``tp_doc`` slot." +msgid "" +"The function now accepts a single class as the *bases* argument and ``NULL``" +" as the ``tp_doc`` slot." msgstr "" +"این تابع اکنون یک کلاس منفرد را به‌عنوان آرگومان *bases* و ``NULL`` را " +"به‌عنوان جایگاه ``tp_doc`` می‌پذیرد." -msgid "The function now finds and uses a metaclass corresponding to the provided base classes. Previously, only :class:`type` instances were returned." +msgid "" +"The function now finds and uses a metaclass corresponding to the provided " +"base classes. Previously, only :class:`type` instances were returned." msgstr "" +"این تابع اکنون فراکلاسی متناظر با کلاس‌های پایه‌ی ارائه‌شده را می‌یابد و از " +"آن استفاده می‌کند. پیش‌تر، تنها نمونه‌های :class:`type` برگردانده می‌شدند." -msgid "The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which may result in incomplete initialization. Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` is deprecated." +msgid "" +"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " +"may result in incomplete initialization. Creating classes whose metaclass " +"overrides :c:member:`~PyTypeObject.tp_new` is deprecated." msgstr "" +":c:member:`~PyTypeObject.tp_new` مربوط به فراکلاس *نادیده گرفته می‌شود*. که " +"ممکن است به مقداردهی اولیه‌ی ناقص منجر شود. ایجاد کلاس‌هایی که فراکلاس آن‌ها" +" :c:member:`~PyTypeObject.tp_new` را بازنویسی می‌کند، منسوخ شده است." -msgid "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` is no longer allowed." +msgid "" +"Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " +"is no longer allowed." msgstr "" +"ساخت کلاس‌هایی که فراکلاس آن‌ها :c:member:`~PyTypeObject.tp_new` را بازنویسی" +" می‌کند، دیگر مجاز نیست." msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." -msgstr "" +msgstr "معادل ``PyType_FromMetaclass(NULL, NULL, spec, bases)`` است." msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." -msgstr "" +msgstr "معادل ``PyType_FromMetaclass(NULL, NULL, spec, NULL)`` است." -msgid "The function now finds and uses a metaclass corresponding to the base classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` instances were returned." +msgid "" +"The function now finds and uses a metaclass corresponding to the base " +"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " +"instances were returned." msgstr "" +"این تابع اکنون فراکلاسی متناظر با کلاس‌های پایه‌ی ارائه‌شده در جایگاه‌های " +"*Py_tp_base[s]* را می‌یابد و از آن استفاده می‌کند. پیش‌تر، تنها نمونه‌های " +":class:`type` برگردانده می‌شدند." -msgid "Make a type immutable: set the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag." +msgid "" +"Make a type immutable: set the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag." msgstr "" +"برای تغییرناپذیر کردن یک نوع: پرچم :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` را " +"تنظیم کنید." msgid "All base classes of *type* must be immutable." -msgstr "" +msgstr "همه‌ی کلاس‌های پایه‌ی *نوع* باید تغییرناپذیر باشند." -msgid "On success, return ``0``. On error, set an exception and return ``-1``." +msgid "" +"On success, return ``0``. On error, set an exception and return ``-1``." msgstr "" +"در صورت موفقیت، ``0`` را برمی‌گرداند. در صورت خطا، یک استثنا تنظیم کرده و " +"``-1`` را برمی‌گرداند." -msgid "The type must not be used before it's made immutable. For example, type instances must not be created before the type is made immutable." +msgid "" +"The type must not be used before it's made immutable. For example, type " +"instances must not be created before the type is made immutable." msgstr "" +"از نوع نباید پیش از تغییرناپذیر شدن آن استفاده شود. برای مثال، نمونه‌های نوع" +" نباید پیش از تغییرناپذیر شدن نوع ایجاد شوند." msgid "Structure defining a type's behavior." -msgstr "" +msgstr "ساختاری که رفتار یک نوع را تعریف می‌کند." msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" +"نام نوع، که برای تنظیم :c:member:`PyTypeObject.tp_name` استفاده می‌شود." -msgid "If positive, specifies the size of the instance in bytes. It is used to set :c:member:`PyTypeObject.tp_basicsize`." +msgid "" +"If positive, specifies the size of the instance in bytes. It is used to set " +":c:member:`PyTypeObject.tp_basicsize`." msgstr "" +"اگر مثبت باشد، اندازه‌ی نمونه را بر حسب بایت مشخص می‌کند. از آن برای تنظیم " +":c:member:`PyTypeObject.tp_basicsize` استفاده می‌شود." -msgid "If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be inherited." +msgid "" +"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " +"inherited." msgstr "" +"اگر صفر باشد، مشخص می‌کند که :c:member:`~PyTypeObject.tp_basicsize` باید به " +"ارث برده شود." -msgid "If negative, the absolute value specifies how much space instances of the class need *in addition* to the superclass. Use :c:func:`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved this way. For negative :c:member:`!basicsize`, Python will insert padding when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment requirements." -msgstr "" +msgid "" +"If negative, the absolute value specifies how much space instances of the " +"class need *in addition* to the superclass. Use " +":c:func:`PyObject_GetTypeData` to get a pointer to subclass-specific memory " +"reserved this way. For negative :c:member:`!basicsize`, Python will insert " +"padding when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s " +"alignment requirements." +msgstr "" +"اگر منفی باشد، قدر مطلق آن مشخص می‌کند که نمونه‌های کلاس *علاوه بر* ابرکلاس " +"به چه مقدار فضا نیاز دارند. برای دریافت اشاره‌گر به حافظه‌ی اختصاصی زیرکلاس " +"که به این شیوه رزرو شده است، از :c:func:`PyObject_GetTypeData` استفاده کنید." +" برای :c:member:`!basicsize` منفی، پایتون در صورت نیاز پدینگ اضافه خواهد کرد" +" تا نیازمندی‌های ترازبندیِ :c:member:`~PyTypeObject.tp_basicsize` را برآورده" +" کند." msgid "Previously, this field could not be negative." -msgstr "" +msgstr "پیش‌تر، این فیلد نمی‌توانست منفی باشد." -msgid "Size of one element of a variable-size type, in bytes. Used to set :c:member:`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." +msgid "" +"Size of one element of a variable-size type, in bytes. Used to set " +":c:member:`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for " +"caveats." msgstr "" +"اندازه‌ی یک المان از یک نوع با اندازه‌ی متغیر، بر حسب بایت. برای تنظیم " +":c:member:`PyTypeObject.tp_itemsize` استفاده می‌شود. برای هشدارها به مستندات" +" ``tp_itemsize`` مراجعه کنید." -msgid "If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending arbitrary variable-sized classes is dangerous, since some types use a fixed offset for variable-sized memory, which can then overlap fixed-sized memory used by a subclass. To help prevent mistakes, inheriting ``itemsize`` is only possible in the following situations:" -msgstr "" +msgid "" +"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " +"arbitrary variable-sized classes is dangerous, since some types use a fixed " +"offset for variable-sized memory, which can then overlap fixed-sized memory " +"used by a subclass. To help prevent mistakes, inheriting ``itemsize`` is " +"only possible in the following situations:" +msgstr "" +"اگر صفر باشد، :c:member:`~PyTypeObject.tp_itemsize` به ارث برده می‌شود. " +"گسترش کلاس‌های اندازه‌متغیرِ دلخواه خطرناک است، زیرا برخی نوع‌ها برای " +"حافظه‌ی اندازه‌متغیر از آفست ثابت استفاده می‌کنند که در نتیجه می‌تواند با " +"حافظه‌ی اندازه‌ثابتِ استفاده‌شده توسط یک زیرکلاس هم‌پوشانی پیدا کند. برای " +"کمک به جلوگیری از اشتباهات، ارث‌بری ``itemsize`` تنها در شرایط زیر ممکن است:" -msgid "The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize` is zero)." +msgid "" +"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize` is" +" zero)." msgstr "" +"پایه اندازه‌متغیر نیست (:c:member:`~PyTypeObject.tp_itemsize` آن صفر است)." -msgid "The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that the memory layout of the base class is known." +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that" +" the memory layout of the base class is known." msgstr "" +"مقدار درخواستی :c:member:`PyType_Spec.basicsize` مثبت است، که نشان می‌دهد " +"چیدمان حافظه‌ی کلاس پایه معلوم است." -msgid "The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the subclass does not access the instance's memory directly." +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the" +" subclass does not access the instance's memory directly." msgstr "" +":c:member:`PyType_Spec.basicsize` درخواست‌شده صفر است، که نشان می‌دهد " +"زیرکلاس مستقیماً به حافظه‌ی نمونه دسترسی ندارد." msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." -msgstr "" +msgstr "با پرچم :c:macro:`Py_TPFLAGS_ITEMS_AT_END`." msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" +"پرچم‌های نوع، که برای تنظیم :c:member:`PyTypeObject.tp_flags` به کار " +"می‌روند." -msgid "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:`PyType_FromSpecWithBases` sets it automatically." +msgid "" +"If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, " +":c:func:`PyType_FromSpecWithBases` sets it automatically." msgstr "" +"اگر پرچم ``Py_TPFLAGS_HEAPTYPE`` تنظیم‌نشده باشد، تابع " +":c:func:`PyType_FromSpecWithBases` آن را به‌طور خودکار تنظیم می‌کند." -msgid "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot value ``{0, NULL}``." +msgid "" +"Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " +"value ``{0, NULL}``." msgstr "" +"آرایه‌ای از ساختارهای :c:type:`PyType_Slot`. با مقدار جایگاه ویژه‌ی ``{0, " +"NULL}`` پایان می‌یابد." msgid "Each slot ID should be specified at most once." -msgstr "" +msgstr "هر شناسه‌ی جایگاه باید حداکثر یک‌بار مشخص شود." -msgid "Structure defining optional functionality of a type, containing a slot ID and a value pointer." +msgid "" +"Structure defining optional functionality of a type, containing a slot ID " +"and a value pointer." msgstr "" +"ساختاری که کارکرد اختیاری یک نوع را تعریف می‌کند و شامل شناسه‌ی جایگاه و " +"اشاره‌گر مقدار است." msgid "A slot ID." -msgstr "" +msgstr "شناسه‌ی جایگاه." -msgid "Slot IDs are named like the field names of the structures :c:type:`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:type:`PyMappingMethods` and :c:type:`PyAsyncMethods` with an added ``Py_`` prefix. For example, use:" +msgid "" +"Slot IDs are named like the field names of the structures " +":c:type:`PyTypeObject`, :c:type:`PyNumberMethods`, " +":c:type:`PySequenceMethods`, :c:type:`PyMappingMethods` and " +":c:type:`PyAsyncMethods` with an added ``Py_`` prefix. For example, use:" msgstr "" +"شناسه‌های جایگاه مانند نام فیلدهای ساختارهای :c:type:`PyTypeObject`، " +":c:type:`PyNumberMethods`، :c:type:`PySequenceMethods`، " +":c:type:`PyMappingMethods` و :c:type:`PyAsyncMethods` با افزودن پیشوند " +"``Py_`` نام‌گذاری می‌شوند. برای مثال، از این استفاده کنید:" msgid ":c:data:`Py_tp_dealloc` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" +":c:data:`Py_tp_dealloc` برای تنظیم :c:member:`PyTypeObject.tp_dealloc`" msgid ":c:data:`Py_nb_add` to set :c:member:`PyNumberMethods.nb_add`" -msgstr "" +msgstr ":c:data:`Py_nb_add` برای تنظیم :c:member:`PyNumberMethods.nb_add`" msgid ":c:data:`Py_sq_length` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" +":c:data:`Py_sq_length` برای تنظیم :c:member:`PySequenceMethods.sq_length`" -msgid "An additional slot is supported that does not correspond to a :c:type:`!PyTypeObject` struct field:" +msgid "" +"An additional slot is supported that does not correspond to a " +":c:type:`!PyTypeObject` struct field:" msgstr "" +"یک جایگاه اضافی پشتیبانی می‌شود که با هیچ فیلدی از ساختار " +":c:type:`!PyTypeObject` مطابق نیست:" msgid ":c:data:`Py_tp_token`" -msgstr "" +msgstr ":c:data:`Py_tp_token`" -msgid "The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" +msgid "" +"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" +"فیلدهای «آفست» زیر را نمی‌توان با استفاده از :c:type:`PyType_Slot` تنظیم " +"کرد:" -msgid ":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +msgid "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use " +":c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" msgstr "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (در صورت امکان، به‌جای آن از " +":c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` استفاده کنید)" -msgid ":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +msgid "" +":c:member:`~PyTypeObject.tp_dictoffset` (use " +":c:macro:`Py_TPFLAGS_MANAGED_DICT` instead if possible)" msgstr "" +":c:member:`~PyTypeObject.tp_dictoffset` (در صورت امکان، به‌جای آن از " +":c:macro:`Py_TPFLAGS_MANAGED_DICT` استفاده کنید)" -msgid ":c:member:`~PyTypeObject.tp_vectorcall_offset` (use ``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " +"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" msgstr "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (از " +"``\"__vectorcalloffset__\"`` در :ref:`PyMemberDef ` " +"استفاده کنید)" -msgid "If it is not possible to switch to a ``MANAGED`` flag (for example, for vectorcall or to support Python older than 3.12), specify the offset in :c:data:`Py_tp_members`. See :ref:`PyMemberDef documentation ` for details." +msgid "" +"If it is not possible to switch to a ``MANAGED`` flag (for example, for " +"vectorcall or to support Python older than 3.12), specify the offset in " +":c:data:`Py_tp_members`. See :ref:`PyMemberDef documentation ` for details." msgstr "" +"اگر تغییر به پرچم ``MANAGED`` ممکن نباشد (برای مثال، برای vectorcall یا برای" +" پشتیبانی از پایتون قدیمی‌تر از 3.12)، آفست را در :c:data:`Py_tp_members` " +"مشخص کنید. برای جزئیات، :ref:`مستندات PyMemberDef ` را " +"ببینید." -msgid "The following internal fields cannot be set at all when creating a heap type:" -msgstr "" +msgid "" +"The following internal fields cannot be set at all when creating a heap " +"type:" +msgstr "هنگام ایجاد نوع هیپ، فیلد‌های داخلی زیر به هیچ وجه قابل تنظیم نیستند:" -msgid ":c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject.tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." +msgid "" +":c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject.tp_mro`, " +":c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`," +" and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" +":c:member:`~PyTypeObject.tp_dict`، :c:member:`~PyTypeObject.tp_mro`، " +":c:member:`~PyTypeObject.tp_cache`، :c:member:`~PyTypeObject.tp_subclasses`،" +" و :c:member:`~PyTypeObject.tp_weaklist`." -msgid "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on some platforms. To avoid issues, use the *bases* argument of :c:func:`PyType_FromSpecWithBases` instead." +msgid "" +"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " +"some platforms. To avoid issues, use the *bases* argument of " +":c:func:`PyType_FromSpecWithBases` instead." msgstr "" +"تنظیم :c:data:`Py_tp_bases` یا :c:data:`Py_tp_base` ممکن است روی برخی " +"پلتفرم‌ها مشکل‌ساز باشد. برای پرهیز از مشکلات، به‌جای آن از آرگومان *bases* " +"در :c:func:`PyType_FromSpecWithBases` استفاده کنید." msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" +"جایگاه‌های :c:type:`PyBufferProcs` را می‌توان در API نامحدود تنظیم کرد." -msgid ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs.bf_releasebuffer` are now available under the :ref:`limited API `." +msgid "" +":c:member:`~PyBufferProcs.bf_getbuffer` and " +":c:member:`~PyBufferProcs.bf_releasebuffer` are now available under the " +":ref:`limited API `." msgstr "" +":c:member:`~PyBufferProcs.bf_getbuffer` و " +":c:member:`~PyBufferProcs.bf_releasebuffer` اکنون در :ref:`API محدود " +"` در دسترس هستند." -msgid "The field :c:member:`~PyTypeObject.tp_vectorcall` can now be set using :c:data:`Py_tp_vectorcall`. See the field's documentation for details." +msgid "" +"The field :c:member:`~PyTypeObject.tp_vectorcall` can now be set using " +":c:data:`Py_tp_vectorcall`. See the field's documentation for details." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_vectorcall` اکنون می‌تواند با استفاده از " +":c:data:`Py_tp_vectorcall` تنظیم شود. برای جزئیات، به مستندات این فیلد " +"مراجعه کنید." -msgid "The desired value of the slot. In most cases, this is a pointer to a function." -msgstr "" +msgid "" +"The desired value of the slot. In most cases, this is a pointer to a " +"function." +msgstr "مقدار موردنظر جایگاه. در بیشتر موارد، این یک اشاره‌گر به تابع است." msgid "*pfunc* values may not be ``NULL``, except for the following slots:" -msgstr "" +msgstr "مقادیر *pfunc* نمی‌توانند ``NULL`` باشند، به‌جز جایگاه‌های زیر:" msgid ":c:data:`Py_tp_doc`" -msgstr "" +msgstr ":c:data:`Py_tp_doc`" -msgid ":c:data:`Py_tp_token` (for clarity, prefer :c:data:`Py_TP_USE_SPEC` rather than ``NULL``)" +msgid "" +":c:data:`Py_tp_token` (for clarity, prefer :c:data:`Py_TP_USE_SPEC` rather " +"than ``NULL``)" msgstr "" +":c:data:`Py_tp_token` (برای شفافیت، :c:data:`Py_TP_USE_SPEC` را به‌جای " +"``NULL`` ترجیح دهید)" -msgid "A :c:member:`~PyType_Slot.slot` that records a static memory layout ID for a class." +msgid "" +"A :c:member:`~PyType_Slot.slot` that records a static memory layout ID for a" +" class." msgstr "" +"یک :c:member:`~PyType_Slot.slot` که شناسه‌ی چیدمان حافظه‌ی ایستا را برای یک " +"کلاس ثبت می‌کند." -msgid "If the :c:type:`PyType_Spec` of the class is statically allocated, the token can be set to the spec using the special value :c:data:`Py_TP_USE_SPEC`:" +msgid "" +"If the :c:type:`PyType_Spec` of the class is statically allocated, the token" +" can be set to the spec using the special value :c:data:`Py_TP_USE_SPEC`:" msgstr "" +"اگر :c:type:`PyType_Spec` کلاس به‌صورت ایستا تخصیص یافته باشد، می‌توان توکن " +"را با استفاده از مقدار ویژه‌ی :c:data:`Py_TP_USE_SPEC` برابر با مشخصه تنظیم " +"کرد:" msgid "" "static PyType_Slot foo_slots[] = {\n" " {Py_tp_token, Py_TP_USE_SPEC}," msgstr "" +"static PyType_Slot foo_slots[] = {\n" +" {Py_tp_token, Py_TP_USE_SPEC}," msgid "It can also be set to an arbitrary pointer, but you must ensure that:" msgstr "" +"می‌توان آن را به یک اشاره‌گر دلخواه نیز تنظیم کرد، اما باید مطمئن شوید که:" -msgid "The pointer outlives the class, so it's not reused for something else while the class exists." +msgid "" +"The pointer outlives the class, so it's not reused for something else while " +"the class exists." msgstr "" +"عمر اشاره‌گر از عمر کلاس طولانی‌تر است، بنابراین تا زمانی که کلاس وجود دارد،" +" برای چیز دیگری باز‌استفاده نمی‌شود." -msgid "It \"belongs\" to the extension module where the class lives, so it will not clash with other extensions." +msgid "" +"It \"belongs\" to the extension module where the class lives, so it will not" +" clash with other extensions." msgstr "" +"آن به ماژول توسعه‌ای «تعلق دارد» که کلاس در آن قرار دارد، بنابراین با سایر " +"توسعه‌ها تداخل نخواهد کرد." -msgid "Use :c:func:`PyType_GetBaseByToken` to check if a class's superclass has a given token -- that is, check whether the memory layout is compatible." +msgid "" +"Use :c:func:`PyType_GetBaseByToken` to check if a class's superclass has a " +"given token -- that is, check whether the memory layout is compatible." msgstr "" +"از :c:func:`PyType_GetBaseByToken` برای بررسی این‌که آیا ابرکلاس یک کلاس " +"توکن مشخصی دارد یا نه استفاده کنید — یعنی، بررسی کنید که آیا چیدمان حافظه " +"سازگار است یا خیر." -msgid "To get the token for a given class (without considering superclasses), use :c:func:`PyType_GetSlot` with ``Py_tp_token``." +msgid "" +"To get the token for a given class (without considering superclasses), use " +":c:func:`PyType_GetSlot` with ``Py_tp_token``." msgstr "" +"برای به‌دست‌آوردن توکن یک کلاس معین (بدون در نظر گرفتن کلاس‌های والد)، از " +":c:func:`PyType_GetSlot` با ``Py_tp_token`` استفاده کنید." -msgid "Used as a value with :c:data:`Py_tp_token` to set the token to the class's :c:type:`PyType_Spec`. Expands to ``NULL``." +msgid "" +"Used as a value with :c:data:`Py_tp_token` to set the token to the class's " +":c:type:`PyType_Spec`. Expands to ``NULL``." msgstr "" +"به عنوان یک مقدار همراه با :c:data:`Py_tp_token` برای تنظیم توکن به " +":c:type:`PyType_Spec` کلاس استفاده می‌شود. به ``NULL`` بسط می‌یابد." msgid "object" -msgstr "" +msgstr "شیء" msgid "type" -msgstr "" +msgstr "نوع" diff --git a/c-api/typehints.po b/c-api/typehints.po index 1b2f1da69..f40fa447e 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -22,16 +22,44 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Objects for Type Hinting" -msgstr "" +msgstr "اشیاء برای راهنمای نوع" -msgid "Various built-in types for type hinting are provided. Currently, two types exist -- :ref:`GenericAlias ` and :ref:`Union `. Only ``GenericAlias`` is exposed to C." +msgid "" +"Various built-in types for type hinting are provided. Currently, two types " +"exist -- :ref:`GenericAlias ` and :ref:`Union `. Only ``GenericAlias`` is exposed to C." msgstr "" +"نوع‌های توکار گوناگونی برای راهنمایی نوع ارائه شده‌اند. در حال حاضر، دو نوع " +"وجود دارد — :ref:`GenericAlias ` و :ref:`Union `. فقط ``GenericAlias`` در C در دسترس است." -msgid "Create a :ref:`GenericAlias ` object. Equivalent to calling the Python class :class:`types.GenericAlias`. The *origin* and *args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and ``__args__`` attributes respectively. *origin* should be a :c:expr:`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any ``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done for the arguments, so the function will succeed even if *origin* is not a type. The ``GenericAlias``\\ 's ``__parameters__`` attribute is constructed lazily from ``__args__``. On failure, an exception is raised and ``NULL`` is returned." +msgid "" +"Create a :ref:`GenericAlias ` object. Equivalent to " +"calling the Python class :class:`types.GenericAlias`. The *origin* and " +"*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " +"``__args__`` attributes respectively. *origin* should be a " +":c:expr:`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any" +" ``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically" +" constructed and ``__args__`` is set to ``(args,)``. Minimal checking is " +"done for the arguments, so the function will succeed even if *origin* is not" +" a type. The ``GenericAlias``\\ 's ``__parameters__`` attribute is " +"constructed lazily from ``__args__``. On failure, an exception is raised " +"and ``NULL`` is returned." msgstr "" +"یک شیء :ref:`GenericAlias ` ایجاد می‌کند. معادل با " +"فراخوانی کلاس پایتونی :class:`types.GenericAlias` است. آرگومان‌های *origin* " +"و *args* به‌ترتیب ویژگی‌های ``__origin__`` و ``__args__`` مربوط به " +"``GenericAlias`` را تنظیم می‌کنند. *origin* باید یک :c:expr:`PyTypeObject*` " +"باشد و *args* می‌تواند یک :c:expr:`PyTupleObject*` یا هر ``PyObject*`` باشد." +" اگر *args* ارسال‌شده یک تاپل نباشد، یک تاپل تک‌عضوی به‌طور خودکار ساخته " +"می‌شود و ``__args__`` روی ``(args,)`` تنظیم می‌شود. بررسی حداقلی روی " +"آرگومان‌ها انجام می‌شود، بنابراین حتی اگر *origin* یک نوع نباشد، تابع با " +"موفقیت اجرا خواهد شد. ویژگی ``__parameters__`` مربوط به ``GenericAlias`` " +"به‌صورت تنبل از ``__args__`` ساخته می‌شود. در صورت شکست، یک استثنا مطرح " +"می‌شود و ``NULL`` برگردانده می‌شود." msgid "Here's an example of how to make an extension type generic::" -msgstr "" +msgstr "در اینجا مثالی از نحوه‌ی عام کردن یک نوع توسعه‌ای آمده است::" msgid "" "...\n" @@ -42,9 +70,20 @@ msgid "" " ...\n" "}" msgstr "" +"...\n" +"static PyMethodDef my_obj_methods[] = {\n" +" // Other methods.\n" +" ...\n" +" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"my_obj is generic over its contained type\"}\n" +" ...\n" +"}" msgid "The data model method :meth:`~object.__class_getitem__`." -msgstr "" +msgstr "متد مدل داده :meth:`~object.__class_getitem__`." -msgid "The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent to :class:`types.GenericAlias` in Python." +msgid "" +"The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent " +"to :class:`types.GenericAlias` in Python." msgstr "" +"نوع C شیء‌ای که توسط :c:func:`Py_GenericAlias` برگردانده می‌شود. معادل " +":class:`types.GenericAlias` در پایتون است." diff --git a/c-api/typeobj.po b/c-api/typeobj.po index bd65827b2..cd5f50588 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" +"PO-Revision-Date: 2026-09-04 20:25+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,408 +23,446 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Type Object Structures" -msgstr "" +msgstr "ساختارهای شیء نوع" -msgid "Perhaps one of the most important structures of the Python object system is the structure that defines a new type: the :c:type:`PyTypeObject` structure. Type objects can be handled using any of the ``PyObject_*`` or ``PyType_*`` functions, but do not offer much that's interesting to most Python applications. These objects are fundamental to how objects behave, so they are very important to the interpreter itself and to any extension module that implements new types." -msgstr "" +msgid "" +"Perhaps one of the most important structures of the Python object system is " +"the structure that defines a new type: the :c:type:`PyTypeObject` structure." +" Type objects can be handled using any of the ``PyObject_*`` or " +"``PyType_*`` functions, but do not offer much that's interesting to most " +"Python applications. These objects are fundamental to how objects behave, so" +" they are very important to the interpreter itself and to any extension " +"module that implements new types." +msgstr "" +"شاید یکی از مهم‌ترین ساختارهای سیستم شیء پایتون، ساختاری باشد که یک نوع جدید" +" را تعریف می‌کند: ساختار :c:type:`PyTypeObject`. اشیاء نوع را می‌توان با " +"استفاده از هر یک از توابع ``PyObject_*`` یا ``PyType_*`` مدیریت کرد، اما چیز" +" جالب زیادی برای بیشتر برنامه‌های پایتون ارائه نمی‌دهند. این اشیاء مبنای " +"نحوه رفتار اشیاء هستند، بنابراین برای خود مفسر و برای هر ماژول توسعه‌ای که " +"نوع‌های جدیدی را پیاده‌سازی می‌کند بسیار مهم هستند." -msgid "Type objects are fairly large compared to most of the standard types. The reason for the size is that each type object stores a large number of values, mostly C function pointers, each of which implements a small part of the type's functionality. The fields of the type object are examined in detail in this section. The fields will be described in the order in which they occur in the structure." -msgstr "" +msgid "" +"Type objects are fairly large compared to most of the standard types. The " +"reason for the size is that each type object stores a large number of " +"values, mostly C function pointers, each of which implements a small part of" +" the type's functionality. The fields of the type object are examined in " +"detail in this section. The fields will be described in the order in which " +"they occur in the structure." +msgstr "" +"اشیاء نوع در مقایسه با اکثر نوع‌های استاندارد نسبتاً بزرگ هستند. دلیل این " +"اندازه آن است که هر شیء نوع تعداد زیادی مقدار را ذخیره می‌کند که عمدتاً " +"اشاره‌گرهای تابع C هستند و هر یک بخش کوچکی از کارکرد نوع را پیاده‌سازی " +"می‌کند. فیلد‌های شیء نوع در این بخش به تفصیل بررسی می‌شوند. فیلد‌ها به " +"ترتیبی که در ساختار قرار دارند توصیف خواهند شد." -msgid "In addition to the following quick reference, the :ref:`typedef-examples` section provides at-a-glance insight into the meaning and use of :c:type:`PyTypeObject`." +msgid "" +"In addition to the following quick reference, the :ref:`typedef-examples` " +"section provides at-a-glance insight into the meaning and use of " +":c:type:`PyTypeObject`." msgstr "" +"علاوه بر مرجع سریع زیر، بخش :ref:`typedef-examples` درکی سریع و فوری از معنا" +" و کاربرد :c:type:`PyTypeObject` فراهم می‌کند." msgid "Quick Reference" -msgstr "" +msgstr "مرجع سریع" msgid "\"tp slots\"" -msgstr "" +msgstr "جایگاه‌های tp" msgid "PyTypeObject Slot [#slots]_" -msgstr "" +msgstr "جایگاه PyTypeObject [#slots]_" msgid ":ref:`Type `" -msgstr "" +msgstr ":ref:`نوع `" msgid "special methods/attrs" -msgstr "" +msgstr "متدهای ویژه/ویژگی‌ها" msgid "Info [#cols]_" -msgstr "" +msgstr "اطلاعات [#cols]_" msgid "O" -msgstr "" +msgstr "O" msgid "T" -msgstr "" +msgstr "T" msgid "D" -msgstr "" +msgstr "D" msgid "I" -msgstr "" +msgstr "I" msgid " :c:member:`~PyTypeObject.tp_name`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_name`" msgid "const char *" -msgstr "" +msgstr "const char *" msgid "__name__" -msgstr "" +msgstr "__name__" msgid "X" -msgstr "" +msgstr "X" msgid ":c:member:`~PyTypeObject.tp_basicsize`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_basicsize`" msgid ":c:type:`Py_ssize_t`" -msgstr "" +msgstr ":c:type:`Py_ssize_t`" msgid ":c:member:`~PyTypeObject.tp_itemsize`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_itemsize`" msgid ":c:member:`~PyTypeObject.tp_dealloc`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_dealloc`" msgid ":c:type:`destructor`" -msgstr "" +msgstr ":c:type:`destructor`" msgid ":c:member:`~PyTypeObject.tp_vectorcall_offset`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_vectorcall_offset`" msgid "(:c:member:`~PyTypeObject.tp_getattr`)" -msgstr "" +msgstr "(:c:member:`~PyTypeObject.tp_getattr`)" msgid ":c:type:`getattrfunc`" -msgstr "" +msgstr ":c:type:`getattrfunc`" msgid "__getattribute__, __getattr__" -msgstr "" +msgstr "__getattribute__, __getattr__" msgid "G" -msgstr "" +msgstr "G" msgid "(:c:member:`~PyTypeObject.tp_setattr`)" -msgstr "" +msgstr "(:c:member:`~PyTypeObject.tp_setattr`)" msgid ":c:type:`setattrfunc`" -msgstr "" +msgstr ":c:type:`setattrfunc`" msgid "__setattr__, __delattr__" -msgstr "" +msgstr "__setattr__, __delattr__" msgid ":c:member:`~PyTypeObject.tp_as_async`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_as_async`" msgid ":c:type:`PyAsyncMethods` *" -msgstr "" +msgstr ":c:type:`PyAsyncMethods` *" msgid ":ref:`sub-slots`" -msgstr "" +msgstr ":ref:`sub-slots`" msgid "%" -msgstr "" +msgstr "%" msgid ":c:member:`~PyTypeObject.tp_repr`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_repr`" msgid ":c:type:`reprfunc`" -msgstr "" +msgstr ":c:type:`reprfunc`" msgid "__repr__" -msgstr "" +msgstr "__repr__" msgid ":c:member:`~PyTypeObject.tp_as_number`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_as_number`" msgid ":c:type:`PyNumberMethods` *" -msgstr "" +msgstr ":c:type:`PyNumberMethods` *" msgid ":c:member:`~PyTypeObject.tp_as_sequence`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_as_sequence`" msgid ":c:type:`PySequenceMethods` *" -msgstr "" +msgstr ":c:type:`PySequenceMethods` *" msgid ":c:member:`~PyTypeObject.tp_as_mapping`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_as_mapping`" msgid ":c:type:`PyMappingMethods` *" -msgstr "" +msgstr ":c:type:`PyMappingMethods` *" msgid ":c:member:`~PyTypeObject.tp_hash`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_hash`" msgid ":c:type:`hashfunc`" -msgstr "" +msgstr ":c:type:`hashfunc`" msgid "__hash__" -msgstr "" +msgstr "__hash__" msgid ":c:member:`~PyTypeObject.tp_call`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_call`" msgid ":c:type:`ternaryfunc`" -msgstr "" +msgstr ":c:type:`ternaryfunc`" msgid "__call__" -msgstr "" +msgstr "__call__" msgid ":c:member:`~PyTypeObject.tp_str`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_str`" msgid "__str__" -msgstr "" +msgstr "__str__" msgid ":c:member:`~PyTypeObject.tp_getattro`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_getattro`" msgid ":c:type:`getattrofunc`" -msgstr "" +msgstr ":c:type:`getattrofunc`" msgid ":c:member:`~PyTypeObject.tp_setattro`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_setattro`" msgid ":c:type:`setattrofunc`" -msgstr "" +msgstr ":c:type:`setattrofunc`" msgid ":c:member:`~PyTypeObject.tp_as_buffer`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_as_buffer`" msgid ":c:type:`PyBufferProcs` *" -msgstr "" +msgstr ":c:type:`PyBufferProcs` *" msgid ":c:member:`~PyTypeObject.tp_flags`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_flags`" msgid "unsigned long" -msgstr "" +msgstr "unsigned long" msgid "?" -msgstr "" +msgstr "?" msgid ":c:member:`~PyTypeObject.tp_doc`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_doc`" msgid "__doc__" -msgstr "" +msgstr "__doc__" msgid ":c:member:`~PyTypeObject.tp_traverse`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_traverse`" msgid ":c:type:`traverseproc`" -msgstr "" +msgstr ":c:type:`traverseproc`" msgid ":c:member:`~PyTypeObject.tp_clear`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_clear`" msgid ":c:type:`inquiry`" -msgstr "" +msgstr ":c:type:`inquiry`" msgid ":c:member:`~PyTypeObject.tp_richcompare`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_richcompare`" msgid ":c:type:`richcmpfunc`" -msgstr "" +msgstr ":c:type:`richcmpfunc`" msgid "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" -msgstr "" +msgstr "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" msgid "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" -msgstr "" +msgstr "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" msgid ":c:member:`~PyTypeObject.tp_iter`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_iter`" msgid ":c:type:`getiterfunc`" -msgstr "" +msgstr ":c:type:`getiterfunc`" msgid "__iter__" -msgstr "" +msgstr "__iter__" msgid ":c:member:`~PyTypeObject.tp_iternext`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_iternext`" msgid ":c:type:`iternextfunc`" -msgstr "" +msgstr ":c:type:`iternextfunc`" msgid "__next__" -msgstr "" +msgstr "__next__" msgid ":c:member:`~PyTypeObject.tp_methods`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_methods`" msgid ":c:type:`PyMethodDef` []" -msgstr "" +msgstr ":c:type:`PyMethodDef` []" msgid ":c:member:`~PyTypeObject.tp_members`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_members`" msgid ":c:type:`PyMemberDef` []" -msgstr "" +msgstr ":c:type:`PyMemberDef` []" msgid ":c:member:`~PyTypeObject.tp_getset`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_getset`" msgid ":c:type:`PyGetSetDef` []" -msgstr "" +msgstr ":c:type:`PyGetSetDef` []" msgid ":c:member:`~PyTypeObject.tp_base`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_base`" msgid ":c:type:`PyTypeObject` *" -msgstr "" +msgstr ":c:type:`PyTypeObject` *" msgid "__base__" -msgstr "" +msgstr "__base__" msgid ":c:member:`~PyTypeObject.tp_dict`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_dict`" msgid ":c:type:`PyObject` *" -msgstr "" +msgstr ":c:type:`PyObject` *" msgid "__dict__" -msgstr "" +msgstr "__dict__" msgid ":c:member:`~PyTypeObject.tp_descr_get`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_descr_get`" msgid ":c:type:`descrgetfunc`" -msgstr "" +msgstr ":c:type:`descrgetfunc`" msgid "__get__" -msgstr "" +msgstr "__get__" msgid ":c:member:`~PyTypeObject.tp_descr_set`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_descr_set`" msgid ":c:type:`descrsetfunc`" -msgstr "" +msgstr ":c:type:`descrsetfunc`" msgid "__set__, __delete__" -msgstr "" +msgstr "__set__, __delete__" msgid "(:c:member:`~PyTypeObject.tp_dictoffset`)" -msgstr "" +msgstr "(:c:member:`~PyTypeObject.tp_dictoffset`)" msgid ":c:member:`~PyTypeObject.tp_init`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_init`" msgid ":c:type:`initproc`" -msgstr "" +msgstr ":c:type:`initproc`" msgid "__init__" -msgstr "" +msgstr "__init__" msgid ":c:member:`~PyTypeObject.tp_alloc`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_alloc`" msgid ":c:type:`allocfunc`" -msgstr "" +msgstr ":c:type:`allocfunc`" msgid ":c:member:`~PyTypeObject.tp_new`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_new`" msgid ":c:type:`newfunc`" -msgstr "" +msgstr ":c:type:`newfunc`" msgid "__new__" -msgstr "" +msgstr "__new__" msgid ":c:member:`~PyTypeObject.tp_free`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_free`" msgid ":c:type:`freefunc`" -msgstr "" +msgstr ":c:type:`freefunc`" msgid ":c:member:`~PyTypeObject.tp_is_gc`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_is_gc`" msgid "<:c:member:`~PyTypeObject.tp_bases`>" -msgstr "" +msgstr "<:c:member:`~PyTypeObject.tp_bases`>" msgid "__bases__" -msgstr "" +msgstr "__bases__" msgid "~" -msgstr "" +msgstr "~" msgid "<:c:member:`~PyTypeObject.tp_mro`>" -msgstr "" +msgstr "<:c:member:`~PyTypeObject.tp_mro`>" msgid "__mro__" -msgstr "" +msgstr "__mro__" msgid "[:c:member:`~PyTypeObject.tp_cache`]" -msgstr "" +msgstr "[:c:member:`~PyTypeObject.tp_cache`]" msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" -msgstr "" +msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" msgid "void *" -msgstr "" +msgstr "void *" msgid "__subclasses__" -msgstr "" +msgstr "__subclasses__" msgid "[:c:member:`~PyTypeObject.tp_weaklist`]" -msgstr "" +msgstr "[:c:member:`~PyTypeObject.tp_weaklist`]" msgid "(:c:member:`~PyTypeObject.tp_del`)" -msgstr "" +msgstr "(:c:member:`~PyTypeObject.tp_del`)" msgid "[:c:member:`~PyTypeObject.tp_version_tag`]" -msgstr "" +msgstr "[:c:member:`~PyTypeObject.tp_version_tag`]" msgid "unsigned int" -msgstr "" +msgstr "unsigned int" msgid ":c:member:`~PyTypeObject.tp_finalize`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_finalize`" msgid "__del__" -msgstr "" +msgstr "__del__" msgid ":c:member:`~PyTypeObject.tp_vectorcall`" -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" msgid ":c:type:`vectorcallfunc`" -msgstr "" +msgstr ":c:type:`vectorcallfunc`" msgid "[:c:member:`~PyTypeObject.tp_watched`]" -msgstr "" +msgstr "[:c:member:`~PyTypeObject.tp_watched`]" msgid "unsigned char" -msgstr "" +msgstr "unsigned char" -msgid "**()**: A slot name in parentheses indicates it is (effectively) deprecated." -msgstr "" +msgid "" +"**()**: A slot name in parentheses indicates it is (effectively) deprecated." +msgstr "**()**: نام جایگاه درون پرانتز نشان می‌دهد که آن (عملاً) منسوخ است." -msgid "**<>**: Names in angle brackets should be initially set to ``NULL`` and treated as read-only." +msgid "" +"**<>**: Names in angle brackets should be initially set to ``NULL`` and " +"treated as read-only." msgstr "" +"**<>**: نام‌های داخل علامت‌های زاویه‌ای باید در ابتدا روی ``NULL`` تنظیم " +"شوند و به‌عنوان فقط‌خواندنی در نظر گرفته شوند." msgid "**[]**: Names in square brackets are for internal use only." -msgstr "" +msgstr "**[]**: نام‌های داخل کروشه تنها برای استفاده‌ی داخلی هستند." -msgid "**** (as a prefix) means the field is required (must be non-``NULL``)." +msgid "" +"**** (as a prefix) means the field is required (must be non-``NULL``)." msgstr "" +"**** (به‌عنوان پیشوند) به این معنی است که فیلد الزامی است (باید ``NULL`` " +"نباشد)." msgid "Columns:" -msgstr "" +msgstr "ستون‌ها:" msgid "**\"O\"**: set on :c:data:`PyBaseObject_Type`" -msgstr "" +msgstr "**\"O\"**: تنظیم‌شده روی :c:data:`PyBaseObject_Type`" msgid "**\"T\"**: set on :c:data:`PyType_Type`" -msgstr "" +msgstr "**\"T\"**: تنظیم‌شده روی :c:data:`PyType_Type`" msgid "**\"D\"**: default (if slot is set to ``NULL``)" -msgstr "" +msgstr "**\"D\"**: پیش‌فرض (اگر جایگاه روی ``NULL`` تنظیم شده باشد)" msgid "" "X - PyType_Ready sets this value if it is NULL\n" @@ -433,9 +471,14 @@ msgid "" "\n" "Also see the inheritance column (\"I\")." msgstr "" +"X - اگر این مقدار NULL باشد، PyType_Ready آن را تنظیم می‌کند\n" +"~ - PyType_Ready همیشه این مقدار را تنظیم می‌کند (باید NULL باشد)\n" +"? - PyType_Ready ممکن است این مقدار را بسته به جایگاه‌های دیگر تنظیم کند\n" +"\n" +"همچنین به ستون ارث‌بری («I») مراجعه کنید." msgid "**\"I\"**: inheritance" -msgstr "" +msgstr "**\"I\"**: وراثت" msgid "" "X - type slot is inherited via *PyType_Ready* if defined with a *NULL* value\n" @@ -443,390 +486,404 @@ msgid "" "G - inherited, but only in combination with other slots; see the slot's description\n" "? - it's complicated; see the slot's description" msgstr "" +"X - جایگاه نوع در صورتی که با مقدار *NULL* تعریف شود، از طریق *PyType_Ready* به ارث می‌رسد\n" +"% - جایگاه‌های ساختار فرعی به‌صورت جداگانه به ارث می‌رسند\n" +"G - به ارث می‌رسد، اما فقط در ترکیب با جایگاه‌های دیگر؛ به توضیح جایگاه مراجعه کنید\n" +"? - پیچیده است؛ به توضیح جایگاه مراجعه کنید" -msgid "Note that some slots are effectively inherited through the normal attribute lookup chain." +msgid "" +"Note that some slots are effectively inherited through the normal attribute " +"lookup chain." msgstr "" +"توجه داشته باشید که برخی جایگاه‌ها در عمل از طریق زنجیره‌ی معمول جست‌وجوی " +"ویژگی به ارث می‌رسند." msgid "sub-slots" -msgstr "" +msgstr "زیرجایگاه‌ها (sub-slots)" msgid "Slot" -msgstr "" +msgstr "جایگاه" msgid "special methods" -msgstr "" +msgstr "متد‌های ویژه" msgid ":c:member:`~PyAsyncMethods.am_await`" -msgstr "" +msgstr ":c:member:`~PyAsyncMethods.am_await`" msgid ":c:type:`unaryfunc`" -msgstr "" +msgstr ":c:type:`unaryfunc`" msgid "__await__" -msgstr "" +msgstr "__await__" msgid ":c:member:`~PyAsyncMethods.am_aiter`" -msgstr "" +msgstr ":c:member:`~PyAsyncMethods.am_aiter`" msgid "__aiter__" -msgstr "" +msgstr "__aiter__" msgid ":c:member:`~PyAsyncMethods.am_anext`" -msgstr "" +msgstr ":c:member:`~PyAsyncMethods.am_anext`" msgid "__anext__" -msgstr "" +msgstr "__anext__" msgid ":c:member:`~PyAsyncMethods.am_send`" -msgstr "" +msgstr ":c:member:`~PyAsyncMethods.am_send`" msgid ":c:type:`sendfunc`" -msgstr "" +msgstr ":c:type:`sendfunc`" msgid ":c:member:`~PyNumberMethods.nb_add`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_add`" msgid ":c:type:`binaryfunc`" -msgstr "" +msgstr ":c:type:`binaryfunc`" msgid "__add__ __radd__" -msgstr "" +msgstr "__add__ __radd__" msgid ":c:member:`~PyNumberMethods.nb_inplace_add`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_add`" msgid "__iadd__" -msgstr "" +msgstr "__iadd__" msgid ":c:member:`~PyNumberMethods.nb_subtract`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_subtract`" msgid "__sub__ __rsub__" -msgstr "" +msgstr "__sub__ __rsub__" msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_subtract`" msgid "__isub__" -msgstr "" +msgstr "__isub__" msgid ":c:member:`~PyNumberMethods.nb_multiply`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_multiply`" msgid "__mul__ __rmul__" -msgstr "" +msgstr "__mul__ __rmul__" msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_multiply`" msgid "__imul__" -msgstr "" +msgstr "__imul__" msgid ":c:member:`~PyNumberMethods.nb_remainder`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_remainder`" msgid "__mod__ __rmod__" -msgstr "" +msgstr "__mod__ __rmod__" msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_remainder`" msgid "__imod__" -msgstr "" +msgstr "__imod__" msgid ":c:member:`~PyNumberMethods.nb_divmod`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_divmod`" msgid "__divmod__ __rdivmod__" -msgstr "" +msgstr "__divmod__ __rdivmod__" msgid ":c:member:`~PyNumberMethods.nb_power`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_power`" msgid "__pow__ __rpow__" -msgstr "" +msgstr "__pow__ __rpow__" msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_power`" msgid "__ipow__" -msgstr "" +msgstr "__ipow__" msgid ":c:member:`~PyNumberMethods.nb_negative`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_negative`" msgid "__neg__" -msgstr "" +msgstr "__neg__" msgid ":c:member:`~PyNumberMethods.nb_positive`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_positive`" msgid "__pos__" -msgstr "" +msgstr "__pos__" msgid ":c:member:`~PyNumberMethods.nb_absolute`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_absolute`" msgid "__abs__" -msgstr "" +msgstr "__abs__" msgid ":c:member:`~PyNumberMethods.nb_bool`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_bool`" msgid "__bool__" -msgstr "" +msgstr "__bool__" msgid ":c:member:`~PyNumberMethods.nb_invert`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_invert`" msgid "__invert__" -msgstr "" +msgstr "__invert__" msgid ":c:member:`~PyNumberMethods.nb_lshift`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_lshift`" msgid "__lshift__ __rlshift__" -msgstr "" +msgstr "__lshift__ __rlshift__" msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_lshift`" msgid "__ilshift__" -msgstr "" +msgstr "__ilshift__" msgid ":c:member:`~PyNumberMethods.nb_rshift`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_rshift`" msgid "__rshift__ __rrshift__" -msgstr "" +msgstr "__rshift__ __rrshift__" msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_rshift`" msgid "__irshift__" -msgstr "" +msgstr "__irshift__" msgid ":c:member:`~PyNumberMethods.nb_and`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_and`" msgid "__and__ __rand__" -msgstr "" +msgstr "__and__ __rand__" msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_and`" msgid "__iand__" -msgstr "" +msgstr "__iand__" msgid ":c:member:`~PyNumberMethods.nb_xor`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_xor`" msgid "__xor__ __rxor__" -msgstr "" +msgstr "__xor__ __rxor__" msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_xor`" msgid "__ixor__" -msgstr "" +msgstr "__ixor__" msgid ":c:member:`~PyNumberMethods.nb_or`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_or`" msgid "__or__ __ror__" -msgstr "" +msgstr "__or__ __ror__" msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_or`" msgid "__ior__" -msgstr "" +msgstr "__ior__" msgid ":c:member:`~PyNumberMethods.nb_int`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_int`" msgid "__int__" -msgstr "" +msgstr "__int__" msgid ":c:member:`~PyNumberMethods.nb_reserved`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_reserved`" msgid ":c:member:`~PyNumberMethods.nb_float`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_float`" msgid "__float__" -msgstr "" +msgstr "__float__" msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_floor_divide`" msgid "__floordiv__" -msgstr "" +msgstr "__floordiv__" msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" msgid "__ifloordiv__" -msgstr "" +msgstr "__ifloordiv__" msgid ":c:member:`~PyNumberMethods.nb_true_divide`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_true_divide`" msgid "__truediv__" -msgstr "" +msgstr "__truediv__" msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" msgid "__itruediv__" -msgstr "" +msgstr "__itruediv__" msgid ":c:member:`~PyNumberMethods.nb_index`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_index`" msgid "__index__" -msgstr "" +msgstr "__index__" msgid ":c:member:`~PyNumberMethods.nb_matrix_multiply`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_matrix_multiply`" msgid "__matmul__ __rmatmul__" -msgstr "" +msgstr "__matmul__ __rmatmul__" msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" -msgstr "" +msgstr ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" msgid "__imatmul__" -msgstr "" +msgstr "__imatmul__" msgid ":c:member:`~PyMappingMethods.mp_length`" -msgstr "" +msgstr ":c:member:`~PyMappingMethods.mp_length`" msgid ":c:type:`lenfunc`" -msgstr "" +msgstr ":c:type:`lenfunc`" msgid "__len__" -msgstr "" +msgstr "__len__" msgid ":c:member:`~PyMappingMethods.mp_subscript`" -msgstr "" +msgstr ":c:member:`~PyMappingMethods.mp_subscript`" msgid "__getitem__" -msgstr "" +msgstr "__getitem__" msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" -msgstr "" +msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" msgid ":c:type:`objobjargproc`" -msgstr "" +msgstr ":c:type:`objobjargproc`" msgid "__setitem__, __delitem__" -msgstr "" +msgstr "__setitem__, __delitem__" msgid ":c:member:`~PySequenceMethods.sq_length`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_length`" msgid ":c:member:`~PySequenceMethods.sq_concat`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_concat`" msgid "__add__" -msgstr "" +msgstr "__add__" msgid ":c:member:`~PySequenceMethods.sq_repeat`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_repeat`" msgid ":c:type:`ssizeargfunc`" -msgstr "" +msgstr ":c:type:`ssizeargfunc`" msgid "__mul__" -msgstr "" +msgstr "__mul__" msgid ":c:member:`~PySequenceMethods.sq_item`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_item`" msgid ":c:member:`~PySequenceMethods.sq_ass_item`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_ass_item`" msgid ":c:type:`ssizeobjargproc`" -msgstr "" +msgstr ":c:type:`ssizeobjargproc`" msgid "__setitem__ __delitem__" -msgstr "" +msgstr "__setitem__ __delitem__" msgid ":c:member:`~PySequenceMethods.sq_contains`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_contains`" msgid ":c:type:`objobjproc`" -msgstr "" +msgstr ":c:type:`objobjproc`" msgid "__contains__" -msgstr "" +msgstr "__contains__" msgid ":c:member:`~PySequenceMethods.sq_inplace_concat`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_inplace_concat`" msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" -msgstr "" +msgstr ":c:member:`~PySequenceMethods.sq_inplace_repeat`" msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" -msgstr "" +msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" msgid ":c:func:`getbufferproc`" -msgstr "" +msgstr ":c:func:`getbufferproc`" msgid "__buffer__" -msgstr "" +msgstr "__buffer__" msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" -msgstr "" +msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" msgid ":c:func:`releasebufferproc`" -msgstr "" +msgstr ":c:func:`releasebufferproc`" msgid "__release_\\ buffer\\__" -msgstr "" +msgstr "__release_\\ buffer\\__" msgid "slot typedefs" -msgstr "" +msgstr "تعریف‌های نوع جایگاه (slot typedefs)" msgid "typedef" -msgstr "" +msgstr "typedef" msgid "Parameter Types" -msgstr "" +msgstr "انواع پارامتر" msgid "Return Type" -msgstr "" +msgstr "نوع بازگشتی" msgid "void" -msgstr "" +msgstr "void" msgid ":c:type:`visitproc`" -msgstr "" +msgstr ":c:type:`visitproc`" msgid "int" -msgstr "" +msgstr "int" msgid "Py_hash_t" -msgstr "" +msgstr "Py_hash_t" msgid ":c:type:`getbufferproc`" -msgstr "" +msgstr ":c:type:`getbufferproc`" msgid ":c:type:`Py_buffer` *" -msgstr "" +msgstr ":c:type:`Py_buffer` *" msgid ":c:type:`releasebufferproc`" -msgstr "" +msgstr ":c:type:`releasebufferproc`" msgid "See :ref:`slot-typedefs` below for more detail." -msgstr "" +msgstr "برای جزئیات بیشتر، :ref:`slot-typedefs` را در ادامه ببینید." msgid "PyTypeObject Definition" -msgstr "" +msgstr "تعریف PyTypeObject" -msgid "The structure definition for :c:type:`PyTypeObject` can be found in :file:`Include/cpython/object.h`. For convenience of reference, this repeats the definition found there:" +msgid "" +"The structure definition for :c:type:`PyTypeObject` can be found in " +":file:`Include/cpython/object.h`. For convenience of reference, this " +"repeats the definition found there:" msgstr "" +"تعریف ساختار :c:type:`PyTypeObject` را می‌توان در " +":file:`Include/cpython/object.h` یافت. برای سهولت مراجعه، این بخش تعریف " +"موجود در آنجا را تکرار می‌کند:" msgid "" "typedef struct _typeobject {\n" @@ -925,132 +982,480 @@ msgid "" " uint16_t tp_versions_used;\n" "} PyTypeObject;\n" msgstr "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" PyMethodDef *tp_methods;\n" +" PyMemberDef *tp_members;\n" +" PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" PyTypeObject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache; /* no longer used */\n" +" void *tp_subclasses; /* for static builtin types this is an index */\n" +" PyObject *tp_weaklist; /* not used for static builtin types */\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6.\n" +" * If zero, the cache is invalid and must be initialized.\n" +" */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"\n" +" /* Number of tp_version_tag values used.\n" +" * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is\n" +" * disabled for this type (e.g. due to custom MRO entries).\n" +" * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere).\n" +" */\n" +" uint16_t tp_versions_used;\n" +"} PyTypeObject;\n" msgid "PyObject Slots" -msgstr "" +msgstr "جایگاه‌های PyObject" -msgid "The type object structure extends the :c:type:`PyVarObject` structure. The :c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by :c:func:`!type_new`, usually called from a class statement). Note that :c:data:`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject.tp_itemsize`, which means that its instances (i.e. type objects) *must* have the :c:member:`~PyVarObject.ob_size` field." -msgstr "" +msgid "" +"The type object structure extends the :c:type:`PyVarObject` structure. The " +":c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by" +" :c:func:`!type_new`, usually called from a class statement). Note that " +":c:data:`PyType_Type` (the metatype) initializes " +":c:member:`~PyTypeObject.tp_itemsize`, which means that its instances (i.e. " +"type objects) *must* have the :c:member:`~PyVarObject.ob_size` field." +msgstr "" +"ساختار شیء نوع، ساختار :c:type:`PyVarObject` را گسترش می‌دهد. فیلد " +":c:member:`~PyVarObject.ob_size` برای نوع‌های پویا استفاده می‌شود (ایجادشده " +"توسط :c:func:`!type_new` که معمولاً از یک دستور کلاس فراخوانی می‌شود). توجه " +"داشته باشید که :c:data:`PyType_Type` (فرانوع) مقدار " +":c:member:`~PyTypeObject.tp_itemsize` را مقداردهی اولیه می‌کند، که این بدان " +"معناست که نمونه‌های آن (یعنی اشیاء نوع) *باید* فیلد " +":c:member:`~PyVarObject.ob_size` را داشته باشند." msgid ":c:member:`PyObject.ob_refcnt`" -msgstr "" +msgstr ":c:member:`PyObject.ob_refcnt`" -msgid "The type object's reference count is initialized to ``1`` by the ``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type objects `, the type's instances (objects whose :c:member:`~PyObject.ob_type` points back to the type) do *not* count as references. But for :ref:`dynamically allocated type objects `, the instances *do* count as references." -msgstr "" +msgid "" +"The type object's reference count is initialized to ``1`` by the " +"``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type" +" objects `, the type's instances (objects whose " +":c:member:`~PyObject.ob_type` points back to the type) do *not* count as " +"references. But for :ref:`dynamically allocated type objects `," +" the instances *do* count as references." +msgstr "" +"شمارش ارجاع شیء نوع توسط ماکروی ``PyObject_HEAD_INIT`` به ``1`` مقداردهی " +"اولیه می‌شود. توجه داشته باشید که برای :ref:`اشیای نوع تخصیص‌یافته به‌صورت" +" ایستا `، نمونه‌های نوع (اشیایی که " +":c:member:`~PyObject.ob_type` آن‌ها به خود نوع اشاره می‌کند) به‌عنوان ارجاع " +"شمرده *نمی‌شوند*. اما برای :ref:`اشیای نوع تخصیص‌یافته به‌صورت پویا `، نمونه‌ها به‌عنوان ارجاع شمرده *می‌شوند*." msgid "**Inheritance:**" -msgstr "" +msgstr "**ارث‌بری:**" msgid "This field is not inherited by subtypes." -msgstr "" +msgstr "این فیلد توسط زیرنوع‌ها به ارث برده نمی‌شود." msgid ":c:member:`PyObject.ob_type`" -msgstr "" +msgstr ":c:member:`PyObject.ob_type`" -msgid "This is the type's type, in other words its metatype. It is initialized by the argument to the ``PyObject_HEAD_INIT`` macro, and its value should normally be ``&PyType_Type``. However, for dynamically loadable extension modules that must be usable on Windows (at least), the compiler complains that this is not a valid initializer. Therefore, the convention is to pass ``NULL`` to the ``PyObject_HEAD_INIT`` macro and to initialize this field explicitly at the start of the module's initialization function, before doing anything else. This is typically done like this::" -msgstr "" +msgid "" +"This is the type's type, in other words its metatype. It is initialized by " +"the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " +"normally be ``&PyType_Type``. However, for dynamically loadable extension " +"modules that must be usable on Windows (at least), the compiler complains " +"that this is not a valid initializer. Therefore, the convention is to pass " +"``NULL`` to the ``PyObject_HEAD_INIT`` macro and to initialize this field " +"explicitly at the start of the module's initialization function, before " +"doing anything else. This is typically done like this::" +msgstr "" +"این، نوعِ نوع است؛ به عبارت دیگر، فرانوع (metatype) آن است. این فیلد با " +"آرگومان ماکروی ``PyObject_HEAD_INIT`` مقداردهی اولیه می‌شود و مقدار آن " +"معمولاً باید ``&PyType_Type`` باشد. با این حال، برای ماژول‌های توسعه‌ای قابل" +" بارگذاری پویا که باید در ویندوز (دست‌کم) قابل استفاده باشند، کامپایلر شکایت" +" می‌کند که این یک مقداردهنده‌ی اولیه‌ی معتبر نیست. بنابراین، قرارداد بر این " +"است که ``NULL`` به ماکروی ``PyObject_HEAD_INIT`` داده شود و این فیلد به‌طور " +"صریح در ابتدای تابع مقداردهی اولیه‌ی ماژول، پیش از انجام هر کار دیگری، " +"مقداردهی اولیه شود. این کار معمولاً به این شکل انجام می‌شود::" msgid "Foo_Type.ob_type = &PyType_Type;" -msgstr "" +msgstr "Foo_Type.ob_type = &PyType_Type;" -msgid "This should be done before any instances of the type are created. :c:func:`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, and if so, initializes it to the :c:member:`~PyObject.ob_type` field of the base class. :c:func:`PyType_Ready` will not change this field if it is non-zero." -msgstr "" +msgid "" +"This should be done before any instances of the type are created. " +":c:func:`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, " +"and if so, initializes it to the :c:member:`~PyObject.ob_type` field of the " +"base class. :c:func:`PyType_Ready` will not change this field if it is non-" +"zero." +msgstr "" +"این کار باید پیش از ایجاد هر نمونه‌ای از این نوع انجام شود. " +":c:func:`PyType_Ready` بررسی می‌کند که آیا :c:member:`~PyObject.ob_type` " +"برابر ``NULL`` است یا خیر، و در این صورت، آن را به فیلد " +":c:member:`~PyObject.ob_type` کلاس پایه مقداردهی اولیه می‌کند. " +":c:func:`PyType_Ready` در صورتی که این فیلد نا‌صفر باشد، آن را تغییر " +"نمی‌دهد." msgid "This field is inherited by subtypes." -msgstr "" +msgstr "این فیلد به زیرنوع‌ها به ارث می‌رسد." msgid "PyVarObject Slots" -msgstr "" +msgstr "جایگاه‌های PyVarObject" msgid ":c:member:`PyVarObject.ob_size`" -msgstr "" +msgstr ":c:member:`PyVarObject.ob_size`" -msgid "For :ref:`statically allocated type objects `, this should be initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." +msgid "" +"For :ref:`statically allocated type objects `, this should be " +"initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." msgstr "" +"برای :ref:`اشیاء نوع با تخصیص ایستا `، این باید به صفر " +"مقداردهی اولیه شود. برای :ref:`اشیاء نوع با تخصیص پویا `، این " +"فیلد معنای درونی خاصی دارد." msgid "This field should be accessed using the :c:func:`Py_SIZE()` macro." msgstr "" +"برای دسترسی به این فیلد باید از ماکروی :c:func:`Py_SIZE()` استفاده شود." msgid "PyTypeObject Slots" -msgstr "" +msgstr "جایگاه‌های PyTypeObject" -msgid "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` may set a value when the field is set to ``NULL`` then there will also be a \"Default\" section. (Note that many fields set on :c:data:`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)" -msgstr "" +msgid "" +"Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " +"may set a value when the field is set to ``NULL`` then there will also be a " +"\"Default\" section. (Note that many fields set on " +":c:data:`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as " +"defaults.)" +msgstr "" +"هر جایگاه بخشی دارد که وراثت را توصیف می‌کند. اگر ممکن است " +":c:func:`PyType_Ready` هنگامی که فیلد برابر ``NULL`` تنظیم شده باشد، مقداری " +"تعیین کند، آنگاه بخشی نیز با عنوان «پیش‌فرض» وجود خواهد داشت. (توجه داشته " +"باشید که بسیاری از فیلدهای تنظیم‌شده در :c:data:`PyBaseObject_Type` و " +":c:data:`PyType_Type` عملاً به‌عنوان پیش‌فرض عمل می‌کنند.)" -msgid "Pointer to a NUL-terminated string containing the name of the type. For types that are accessible as module globals, the string should be the full module name, followed by a dot, followed by the type name; for built-in types, it should be just the type name. If the module is a submodule of a package, the full package name is part of the full module name. For example, a type named :class:`!T` defined in module :mod:`!M` in subpackage :mod:`!Q` in package :mod:`!P` should have the :c:member:`~PyTypeObject.tp_name` initializer ``\"P.Q.M.T\"``." -msgstr "" +msgid "" +"Pointer to a NUL-terminated string containing the name of the type. For " +"types that are accessible as module globals, the string should be the full " +"module name, followed by a dot, followed by the type name; for built-in " +"types, it should be just the type name. If the module is a submodule of a " +"package, the full package name is part of the full module name. For " +"example, a type named :class:`!T` defined in module :mod:`!M` in subpackage " +":mod:`!Q` in package :mod:`!P` should have the " +":c:member:`~PyTypeObject.tp_name` initializer ``\"P.Q.M.T\"``." +msgstr "" +"اشاره‌گر به رشته‌ی پایان‌یافته با تهی که نام نوع را در بر دارد. برای " +"نوع‌هایی که به‌صورت متغیرهای سراسری ماژول در دسترس‌اند، این رشته باید شامل " +"نام کامل ماژول، سپس یک نقطه و سپس نام نوع باشد؛ برای نوع‌های توکار، باید فقط" +" نام نوع باشد. اگر ماژول، زیرماژولی از یک بسته باشد، نام کامل بسته بخشی از " +"نام کامل ماژول است. برای مثال، نوعی با نام :class:`!T` که در ماژول :mod:`!M`" +" در زیربسته‌ی :mod:`!Q` در بسته‌ی :mod:`!P` تعریف‌شده باشد، باید " +"مقداردهنده‌ی اولیه‌ی :c:member:`~PyTypeObject.tp_name` آن ``\"P.Q.M.T\"`` " +"باشد." -msgid "For :ref:`dynamically allocated type objects `, this should just be the type name, and the module name explicitly stored in the type dict as the value for key ``'__module__'``." +msgid "" +"For :ref:`dynamically allocated type objects `, this should just" +" be the type name, and the module name explicitly stored in the type dict as" +" the value for key ``'__module__'``." msgstr "" +"برای :ref:`شیءهای نوعِ تخصیص‌یافته به‌صورت پویا `، این باید فقط " +"نام نوع باشد و نام ماژول به‌صورت صریح در دیکشنری نوع به‌عنوان مقدار کلید " +"``'__module__'`` ذخیره شود." -msgid "For :ref:`statically allocated type objects `, the *tp_name* field should contain a dot. Everything before the last dot is made accessible as the :attr:`~type.__module__` attribute, and everything after the last dot is made accessible as the :attr:`~type.__name__` attribute." +msgid "" +"For :ref:`statically allocated type objects `, the *tp_name* " +"field should contain a dot. Everything before the last dot is made " +"accessible as the :attr:`~type.__module__` attribute, and everything after " +"the last dot is made accessible as the :attr:`~type.__name__` attribute." msgstr "" +"برای :ref:`شیءهای نوع تخصیص‌یافته به‌صورت ایستا `، فیلد " +"*tp_name* باید حاوی یک نقطه باشد. همه‌چیز پیش از آخرین نقطه به‌عنوان ویژگی " +":attr:`~type.__module__` و همه‌چیز پس از آخرین نقطه به‌عنوان ویژگی " +":attr:`~type.__name__` در دسترس قرار می‌گیرد." -msgid "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is made accessible as the :attr:`~type.__name__` attribute, and the :attr:`~type.__module__` attribute is undefined (unless explicitly set in the dictionary, as explained above). This means your type will be impossible to pickle. Additionally, it will not be listed in module documentations created with pydoc." -msgstr "" +msgid "" +"If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " +"made accessible as the :attr:`~type.__name__` attribute, and the " +":attr:`~type.__module__` attribute is undefined (unless explicitly set in " +"the dictionary, as explained above). This means your type will be " +"impossible to pickle. Additionally, it will not be listed in module " +"documentations created with pydoc." +msgstr "" +"اگر نقطه‌ای وجود نداشته باشد، کل فیلد :c:member:`~PyTypeObject.tp_name` " +"به‌عنوان ویژگی :attr:`~type.__name__` در دسترس قرار می‌گیرد و ویژگی " +":attr:`~type.__module__` تعریف‌نشده است (مگر آنکه به‌طور صریح در دیکشنری " +"تنظیم شده باشد، همان‌طور که در بالا توضیح داده شد). این بدان معناست که " +"پیکل‌کردن نوع شما ناممکن خواهد بود. علاوه بر این، در مستندات ماژول‌هایی که " +"با pydoc ایجاد می‌شوند فهرست نخواهد شد." -msgid "This field must not be ``NULL``. It is the only required field in :c:func:`PyTypeObject` (other than potentially :c:member:`~PyTypeObject.tp_itemsize`)." +msgid "" +"This field must not be ``NULL``. It is the only required field in " +":c:func:`PyTypeObject` (other than potentially " +":c:member:`~PyTypeObject.tp_itemsize`)." msgstr "" +"این فیلد نباید ``NULL`` باشد. این تنها فیلد الزامی در :c:func:`PyTypeObject`" +" است (به‌جز احتمالاً :c:member:`~PyTypeObject.tp_itemsize`)." -msgid "These fields allow calculating the size in bytes of instances of the type." +msgid "" +"These fields allow calculating the size in bytes of instances of the type." msgstr "" +"این فیلد‌ها محاسبه‌ی اندازه‌ی نمونه‌های نوع بر حسب بایت را ممکن می‌سازند." -msgid "There are two kinds of types: types with fixed-length instances have a zero :c:member:`!tp_itemsize` field, types with variable-length instances have a non-zero :c:member:`!tp_itemsize` field. For a type with fixed-length instances, all instances have the same size, given in :c:member:`!tp_basicsize`. (Exceptions to this rule can be made using :c:func:`PyUnstable_Object_GC_NewWithExtraData`.)" -msgstr "" +msgid "" +"There are two kinds of types: types with fixed-length instances have a zero " +":c:member:`!tp_itemsize` field, types with variable-length instances have a " +"non-zero :c:member:`!tp_itemsize` field. For a type with fixed-length " +"instances, all instances have the same size, given in " +":c:member:`!tp_basicsize`. (Exceptions to this rule can be made using " +":c:func:`PyUnstable_Object_GC_NewWithExtraData`.)" +msgstr "" +"دو گونه نوع وجود دارد: نوع‌هایی با نمونه‌های طول ثابت، فیلد " +":c:member:`!tp_itemsize` صفر دارند و نوع‌هایی با نمونه‌های طول متغیر، فیلد " +":c:member:`!tp_itemsize` غیرصفر دارند. برای نوعی با نمونه‌های طول ثابت، همه " +"نمونه‌ها اندازه یکسانی دارند که در :c:member:`!tp_basicsize` داده شده است. " +"(می‌توان با استفاده از :c:func:`PyUnstable_Object_GC_NewWithExtraData` برای " +"این قاعده استثنا قائل شد.)" -msgid "For a type with variable-length instances, the instances must have an :c:member:`~PyVarObject.ob_size` field, and the instance size is :c:member:`!tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N is the \"length\" of the object." +msgid "" +"For a type with variable-length instances, the instances must have an " +":c:member:`~PyVarObject.ob_size` field, and the instance size is " +":c:member:`!tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N is " +"the \"length\" of the object." msgstr "" +"برای نوعی که نمونه‌های آن طول متغیر دارند، نمونه‌ها باید دارای فیلد " +":c:member:`~PyVarObject.ob_size` باشند و اندازه‌ی نمونه برابر است با " +":c:member:`!tp_basicsize` به‌اضافه‌ی N برابر :c:member:`!tp_itemsize`، که در" +" آن N «طول» شیء است." -msgid "Functions like :c:func:`PyObject_NewVar` will take the value of N as an argument, and store in the instance's :c:member:`~PyVarObject.ob_size` field. Note that the :c:member:`~PyVarObject.ob_size` field may later be used for other purposes. For example, :py:type:`int` instances use the bits of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the underlying storage and its size should be accessed using :c:func:`PyLong_Export`." -msgstr "" +msgid "" +"Functions like :c:func:`PyObject_NewVar` will take the value of N as an " +"argument, and store in the instance's :c:member:`~PyVarObject.ob_size` " +"field. Note that the :c:member:`~PyVarObject.ob_size` field may later be " +"used for other purposes. For example, :py:type:`int` instances use the bits " +"of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the " +"underlying storage and its size should be accessed using " +":c:func:`PyLong_Export`." +msgstr "" +"توابعی مانند :c:func:`PyObject_NewVar` مقدار N را به‌عنوان آرگومان می‌گیرند " +"و آن را در فیلد :c:member:`~PyVarObject.ob_size` نمونه ذخیره می‌کنند. توجه " +"داشته باشید که فیلد :c:member:`~PyVarObject.ob_size` ممکن است بعداً برای " +"منظورهای دیگری استفاده شود. برای مثال، نمونه‌های :py:type:`int` بیت‌های " +":c:member:`~PyVarObject.ob_size` را به شیوه‌ای که توسط پیاده‌سازی تعریف شده " +"است استفاده می‌کنند؛ برای دسترسی به ذخیره‌سازی زیرین و اندازه‌ی آن باید از " +":c:func:`PyLong_Export` استفاده کرد." -msgid "The :c:member:`~PyVarObject.ob_size` field should be accessed using the :c:func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros." +msgid "" +"The :c:member:`~PyVarObject.ob_size` field should be accessed using the " +":c:func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros." msgstr "" +"برای دسترسی به فیلد :c:member:`~PyVarObject.ob_size` باید از ماکروهای " +":c:func:`Py_SIZE()` و :c:func:`Py_SET_SIZE()` استفاده کرد." -msgid "Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the instance layout doesn't mean that the instance structure is variable-length. For example, the :py:type:`list` type has fixed-length instances, yet those instances have a :c:member:`~PyVarObject.ob_size` field. (As with :py:type:`int`, avoid reading lists' :c:member:`!ob_size` directly. Call :c:func:`PyList_Size` instead.)" -msgstr "" +msgid "" +"Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the " +"instance layout doesn't mean that the instance structure is variable-length." +" For example, the :py:type:`list` type has fixed-length instances, yet those" +" instances have a :c:member:`~PyVarObject.ob_size` field. (As with " +":py:type:`int`, avoid reading lists' :c:member:`!ob_size` directly. Call " +":c:func:`PyList_Size` instead.)" +msgstr "" +"همچنین، وجود یک فیلد :c:member:`~PyVarObject.ob_size` در چیدمان نمونه به این" +" معنا نیست که ساختار نمونه طول متغیر دارد. برای مثال، نوع :py:type:`list` " +"نمونه‌هایی با طول ثابت دارد، با این حال آن نمونه‌ها فیلد " +":c:member:`~PyVarObject.ob_size` دارند. (مانند :py:type:`int`، از خواندن " +"مستقیم :c:member:`!ob_size` فهرست‌ها خودداری کنید. در عوض " +":c:func:`PyList_Size` را فراخوانی کنید.)" -msgid "The :c:member:`!tp_basicsize` includes size needed for data of the type's :c:member:`~PyTypeObject.tp_base`, plus any extra data needed by each instance." +msgid "" +"The :c:member:`!tp_basicsize` includes size needed for data of the type's " +":c:member:`~PyTypeObject.tp_base`, plus any extra data needed by each " +"instance." msgstr "" +":c:member:`!tp_basicsize` شامل اندازه‌ی مورد نیاز برای داده‌های " +":c:member:`~PyTypeObject.tp_base` نوع، به‌علاوه‌ی هر داده‌ی اضافی مورد نیاز " +"برای هر نمونه است." -msgid "The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` operator on the struct used to declare the instance layout. This struct must include the struct used to declare the base type. In other words, :c:member:`!tp_basicsize` must be greater than or equal to the base's :c:member:`!tp_basicsize`." -msgstr "" +msgid "" +"The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` " +"operator on the struct used to declare the instance layout. This struct must" +" include the struct used to declare the base type. In other words, " +":c:member:`!tp_basicsize` must be greater than or equal to the base's " +":c:member:`!tp_basicsize`." +msgstr "" +"روش صحیح برای تنظیم :c:member:`!tp_basicsize`، استفاده از عملگر ``sizeof`` " +"روی ساختاری است که برای اعلان چیدمان نمونه به کار می‌رود. این ساختار باید " +"ساختاری را که برای اعلان نوع پایه به کار می‌رود، در بر بگیرد. به عبارت دیگر،" +" :c:member:`!tp_basicsize` باید بزرگ‌تر از یا برابر با " +":c:member:`!tp_basicsize` نوع پایه باشد." -msgid "Since every type is a subtype of :py:type:`object`, this struct must include :c:type:`PyObject` or :c:type:`PyVarObject` (depending on whether :c:member:`~PyVarObject.ob_size` should be included). These are usually defined by the macro :c:macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD`, respectively." -msgstr "" +msgid "" +"Since every type is a subtype of :py:type:`object`, this struct must include" +" :c:type:`PyObject` or :c:type:`PyVarObject` (depending on whether " +":c:member:`~PyVarObject.ob_size` should be included). These are usually " +"defined by the macro :c:macro:`PyObject_HEAD` or " +":c:macro:`PyObject_VAR_HEAD`, respectively." +msgstr "" +"از آنجا که هر نوع، زیرنوعی از :py:type:`object` است، این ساختار باید شامل " +":c:type:`PyObject` یا :c:type:`PyVarObject` باشد (بسته به اینکه آیا " +":c:member:`~PyVarObject.ob_size` باید در آن گنجانده شود یا نه). این‌ها " +"معمولاً به‌ترتیب توسط ماکروی :c:macro:`PyObject_HEAD` یا " +":c:macro:`PyObject_VAR_HEAD` تعریف می‌شوند." -msgid "The basic size does not include the GC header size, as that header is not part of :c:macro:`PyObject_HEAD`." +msgid "" +"The basic size does not include the GC header size, as that header is not " +"part of :c:macro:`PyObject_HEAD`." msgstr "" +"اندازه پایه شامل اندازه سرآیند GC نیست، زیرا آن سرآیند بخشی از " +":c:macro:`PyObject_HEAD` نیست." -msgid "For cases where struct used to declare the base type is unknown, see :c:member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`." +msgid "" +"For cases where struct used to declare the base type is unknown, see " +":c:member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`." msgstr "" +"برای مواردی که ساختار (struct) استفاده‌شده برای اعلان نوع پایه نامشخص است، " +"به :c:member:`PyType_Spec.basicsize` و :c:func:`PyType_FromMetaclass` مراجعه" +" کنید." msgid "Notes about alignment:" -msgstr "" +msgstr "نکاتی درباره‌ی ترازبندی (alignment):" -msgid ":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as recommended, the compiler ensures this. When not using a C ``struct``, or when using compiler extensions like ``__attribute__((packed))``, it is up to you." -msgstr "" +msgid "" +":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When" +" using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as" +" recommended, the compiler ensures this. When not using a C ``struct``, or " +"when using compiler extensions like ``__attribute__((packed))``, it is up to" +" you." +msgstr "" +":c:member:`!tp_basicsize` باید مضربی از ``_Alignof(PyObject)`` باشد. هنگام " +"استفاده از ``sizeof`` بر روی یک ``struct`` که :c:macro:`PyObject_HEAD` را در" +" بر می‌گیرد، همان‌طور که توصیه می‌شود، کامپایلر این موضوع را تضمین می‌کند. " +"اگر از یک ``struct`` در C استفاده نکنید یا از افزونه‌های کامپایلر مانند " +"``__attribute__((packed))`` استفاده کنید، این کار بر عهده‌ی شماست." -msgid "If the variable items require a particular alignment, :c:member:`!tp_basicsize` and :c:member:`!tp_itemsize` must each be a multiple of that alignment. For example, if a type's variable part stores a ``double``, it is your responsibility that both fields are a multiple of ``_Alignof(double)``." +msgid "" +"If the variable items require a particular alignment, " +":c:member:`!tp_basicsize` and :c:member:`!tp_itemsize` must each be a " +"multiple of that alignment. For example, if a type's variable part stores a " +"``double``, it is your responsibility that both fields are a multiple of " +"``_Alignof(double)``." msgstr "" +"اگر آیتم‌های متغیر به ترازبندی (alignment) خاصی نیاز داشته باشند، " +":c:member:`!tp_basicsize` و :c:member:`!tp_itemsize` باید هر کدام مضربی از " +"آن ترازبندی باشند. برای مثال، اگر بخش متغیرِ یک نوع، ``double`` ذخیره کند، " +"مسئولیت شماست که هر دو فیلد مضربی از ``_Alignof(double)`` باشند." -msgid "These fields are inherited separately by subtypes. (That is, if the field is set to zero, :c:func:`PyType_Ready` will copy the value from the base type, indicating that the instances do not need additional storage.)" +msgid "" +"These fields are inherited separately by subtypes. (That is, if the field is" +" set to zero, :c:func:`PyType_Ready` will copy the value from the base type," +" indicating that the instances do not need additional storage.)" msgstr "" +"این فیلدها به‌طور جداگانه توسط زیرنوع‌ها به ارث برده می‌شوند. (یعنی اگر فیلد" +" روی صفر تنظیم شده باشد، :c:func:`PyType_Ready` مقدار را از نوع پایه کپی " +"می‌کند، که نشان می‌دهد نمونه‌ها نیازی به فضای ذخیره‌سازی اضافی ندارند.)" -msgid "If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a different non-zero value in a subtype (though this depends on the implementation of the base type)." +msgid "" +"If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is" +" generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a " +"different non-zero value in a subtype (though this depends on the " +"implementation of the base type)." msgstr "" +"اگر نوع پایه دارای :c:member:`~PyTypeObject.tp_itemsize` ناصفر باشد، به‌طور " +"کلی ایمن نیست که :c:member:`~PyTypeObject.tp_itemsize` را در یک زیرنوع به " +"مقدار ناصفر متفاوتی تنظیم کنید (هرچند این امر به پیاده‌سازی نوع پایه بستگی " +"دارد)." -msgid "A pointer to the instance destructor function. The function signature is::" -msgstr "" +msgid "" +"A pointer to the instance destructor function. The function signature is::" +msgstr "اشاره‌گری به تابع مخرب نمونه. امضای تابع به صورت زیر است::" msgid "void tp_dealloc(PyObject *self);" -msgstr "" +msgstr "void tp_dealloc(PyObject *self);" -msgid "The destructor function should remove all references which the instance owns (e.g., call :c:func:`Py_CLEAR`), free all memory buffers owned by the instance, and call the type's :c:member:`~PyTypeObject.tp_free` function to free the object itself." +msgid "" +"The destructor function should remove all references which the instance owns" +" (e.g., call :c:func:`Py_CLEAR`), free all memory buffers owned by the " +"instance, and call the type's :c:member:`~PyTypeObject.tp_free` function to " +"free the object itself." msgstr "" +"تابع مخرب باید تمام ارجاع‌هایی را که نمونه مالک آن‌هاست حذف کند (مثلاً " +":c:func:`Py_CLEAR` را فراخوانی کند)، تمام بافرهای حافظه‌ای را که در مالکیت " +"نمونه‌اند آزاد کند و برای آزاد کردن خودِ شیء، تابع " +":c:member:`~PyTypeObject.tp_free` نوع را فراخوانی کند." -msgid "If you may call functions that may set the error indicator, you must use :c:func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` to ensure you don't clobber a preexisting error indicator (the deallocation could have occurred while processing a different error):" +msgid "" +"If you may call functions that may set the error indicator, you must use " +":c:func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` to" +" ensure you don't clobber a preexisting error indicator (the deallocation " +"could have occurred while processing a different error):" msgstr "" +"اگر ممکن است توابعی را فراخوانی کنید که نشانگر خطا را تنظیم کنند، باید از " +":c:func:`PyErr_GetRaisedException` و :c:func:`PyErr_SetRaisedException` " +"استفاده کنید تا مطمئن شوید نشانگر خطای از پیش موجود را از بین نمی‌برید " +"(آزادسازی ممکن است هنگام پردازش خطایی دیگر رخ داده باشد):" msgid "" "static void\n" @@ -1062,33 +1467,93 @@ msgid "" " PyErr_SetRaisedException(exc);\n" "}" msgstr "" +"static void\n" +"foo_dealloc(foo_object *self)\n" +"{\n" +" PyObject *et, *ev, *etb;\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +" ...\n" +" PyErr_SetRaisedException(exc);\n" +"}" -msgid "The dealloc handler itself must not raise an exception; if it hits an error case it should call :c:func:`PyErr_FormatUnraisable` to log (and clear) an unraisable exception." +msgid "" +"The dealloc handler itself must not raise an exception; if it hits an error " +"case it should call :c:func:`PyErr_FormatUnraisable` to log (and clear) an " +"unraisable exception." msgstr "" +"خودِ هندلر تخصیص‌زدایی (dealloc) نباید استثنایی پرتاب کند؛ اگر با مورد خطایی" +" مواجه شود، باید :c:func:`PyErr_FormatUnraisable` را فراخوانی کند تا استثنای" +" غیرقابل‌پرتاب (unraisable) را گزارش (و پاک) کند." msgid "No guarantees are made about when an object is destroyed, except:" -msgstr "" +msgstr "هیچ تضمینی وجود ندارد که یک شیء چه زمانی نابود می‌شود، مگر:" -msgid "Python will destroy an object immediately or some time after the final reference to the object is deleted, unless its finalizer (:c:member:`~PyTypeObject.tp_finalize`) subsequently resurrects the object." +msgid "" +"Python will destroy an object immediately or some time after the final " +"reference to the object is deleted, unless its finalizer " +"(:c:member:`~PyTypeObject.tp_finalize`) subsequently resurrects the object." msgstr "" +"پایتون یک شیء را بلافاصله یا مدتی پس از حذف آخرین ارجاع به آن نابود می‌کند، " +"مگر آنکه نهایی‌ساز آن (:c:member:`~PyTypeObject.tp_finalize`) متعاقباً شیء " +"را احیا کند." -msgid "An object will not be destroyed while it is being automatically finalized (:c:member:`~PyTypeObject.tp_finalize`) or automatically cleared (:c:member:`~PyTypeObject.tp_clear`)." +msgid "" +"An object will not be destroyed while it is being automatically finalized " +"(:c:member:`~PyTypeObject.tp_finalize`) or automatically cleared " +"(:c:member:`~PyTypeObject.tp_clear`)." msgstr "" +"یک شیء تا زمانی که در حال نهایی‌سازی خودکار " +"(:c:member:`~PyTypeObject.tp_finalize`) یا پاک‌سازی خودکار " +"(:c:member:`~PyTypeObject.tp_clear`) است، نابود نخواهد شد." -msgid "CPython currently destroys an object immediately from :c:func:`Py_DECREF` when the new reference count is zero, but this may change in a future version." +msgid "" +"CPython currently destroys an object immediately from :c:func:`Py_DECREF` " +"when the new reference count is zero, but this may change in a future " +"version." msgstr "" +"سی‌پایتون در حال حاضر یک شیء را هنگامی که شمارش ارجاع جدید صفر است، بلافاصله" +" از طریق :c:func:`Py_DECREF` نابود می‌کند، اما این ممکن است در نسخه‌ای در " +"آینده تغییر کند." -msgid "It is recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the beginning of :c:member:`!tp_dealloc` to guarantee that the object is always finalized before destruction." +msgid "" +"It is recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the" +" beginning of :c:member:`!tp_dealloc` to guarantee that the object is always" +" finalized before destruction." msgstr "" +"توصیه می‌شود که :c:func:`PyObject_CallFinalizerFromDealloc` در ابتدای " +":c:member:`!tp_dealloc` فراخوانی شود تا تضمین شود که شیء همیشه پیش از تخریب " +"نهایی‌سازی می‌شود." -msgid "If the type supports garbage collection (the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set), the destructor should call :c:func:`PyObject_GC_UnTrack` before clearing any member fields." +msgid "" +"If the type supports garbage collection (the :c:macro:`Py_TPFLAGS_HAVE_GC` " +"flag is set), the destructor should call :c:func:`PyObject_GC_UnTrack` " +"before clearing any member fields." msgstr "" +"اگر نوع از زباله‌روبی پشتیبانی کند (پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم" +" شده باشد)، مخرب باید پیش از پاک کردن هر یک از فیلدهای عضو، " +":c:func:`PyObject_GC_UnTrack` را فراخوانی کند." -msgid "It is permissible to call :c:member:`~PyTypeObject.tp_clear` from :c:member:`!tp_dealloc` to reduce code duplication and to guarantee that the object is always cleared before destruction. Beware that :c:member:`!tp_clear` might have already been called." +msgid "" +"It is permissible to call :c:member:`~PyTypeObject.tp_clear` from " +":c:member:`!tp_dealloc` to reduce code duplication and to guarantee that the" +" object is always cleared before destruction. Beware that " +":c:member:`!tp_clear` might have already been called." msgstr "" +"مجاز است که :c:member:`~PyTypeObject.tp_clear` را از :c:member:`!tp_dealloc`" +" فراخوانی کنید تا از تکرار کد کاسته شود و تضمین شود که شیء همیشه پیش از " +"انهدام پاک‌سازی می‌شود. مراقب باشید که ممکن است :c:member:`!tp_clear` از پیش" +" فراخوانی شده باشد." -msgid "If the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the deallocator should release the owned reference to its type object (via :c:func:`Py_DECREF`) after calling the type deallocator. See the example code below.::" +msgid "" +"If the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " +"deallocator should release the owned reference to its type object (via " +":c:func:`Py_DECREF`) after calling the type deallocator. See the example " +"code below.::" msgstr "" +"اگر نوع در هیپ تخصیص‌یافته باشد (:c:macro:`Py_TPFLAGS_HEAPTYPE`)، تخصیص‌گشا " +"(deallocator) باید پس از فراخوانی تخصیص‌گشای نوع، ارجاع مالکانه به شیء نوع " +"خود را (از طریق :c:func:`Py_DECREF`) آزاد کند. کد نمونه را در ادامه " +"ببینید.::" msgid "" "static void\n" @@ -1100,12 +1565,28 @@ msgid "" " Py_TYPE(self)->tp_free(self);\n" "}" msgstr "" +"static void\n" +"foo_dealloc(PyObject *op)\n" +"{\n" +" foo_object *self = (foo_object *) op;\n" +" PyObject_GC_UnTrack(self);\n" +" Py_CLEAR(self->ref);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" -msgid ":c:member:`!tp_dealloc` must leave the exception status unchanged. If it needs to call something that might raise an exception, the exception state must be backed up first and restored later (after logging any exceptions with :c:func:`PyErr_WriteUnraisable`)." +msgid "" +":c:member:`!tp_dealloc` must leave the exception status unchanged. If it " +"needs to call something that might raise an exception, the exception state " +"must be backed up first and restored later (after logging any exceptions " +"with :c:func:`PyErr_WriteUnraisable`)." msgstr "" +":c:member:`!tp_dealloc` باید وضعیت استثنا را بدون تغییر بگذارد. اگر لازم " +"باشد چیزی را فراخوانی کند که ممکن است استثنا ایجاد کند، وضعیت استثنا باید " +"ابتدا پشتیبان‌گیری و بعداً بازگردانی شود (پس از گزارش‌گیری هرگونه استثنا با " +":c:func:`PyErr_WriteUnraisable`)." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "static void\n" @@ -1147,393 +1628,1079 @@ msgid "" " PyErr_SetRaisedException(exc);\n" "}" msgstr "" +"static void\n" +"foo_dealloc(PyObject *self)\n" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" if (PyObject_CallFinalizerFromDealloc(self) < 0) {\n" +" // self was resurrected.\n" +" goto done;\n" +" }\n" +"\n" +" PyTypeObject *tp = Py_TYPE(self);\n" +"\n" +" if (tp->tp_flags & Py_TPFLAGS_HAVE_GC) {\n" +" PyObject_GC_UnTrack(self);\n" +" }\n" +"\n" +" // Optional, but convenient to avoid code duplication.\n" +" if (tp->tp_clear && tp->tp_clear(self) < 0) {\n" +" PyErr_WriteUnraisable(self);\n" +" }\n" +"\n" +" // Any additional destruction goes here.\n" +"\n" +" tp->tp_free(self);\n" +" self = NULL; // In case PyErr_WriteUnraisable() is called below.\n" +"\n" +" if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" +" Py_CLEAR(tp);\n" +" }\n" +"\n" +"done:\n" +" // Optional, if something was called that might have raised an\n" +" // exception.\n" +" if (PyErr_Occurred()) {\n" +" PyErr_WriteUnraisable(self);\n" +" }\n" +" PyErr_SetRaisedException(exc);\n" +"}" -msgid ":c:member:`!tp_dealloc` may be called from any Python thread, not just the thread which created the object (if the object becomes part of a refcount cycle, that cycle might be collected by a garbage collection on any thread). This is not a problem for Python API calls, since the thread on which :c:member:`!tp_dealloc` is called with an :term:`attached thread state`. However, if the object being destroyed in turn destroys objects from some other C library, care should be taken to ensure that destroying those objects on the thread which called :c:member:`!tp_dealloc` will not violate any assumptions of the library." -msgstr "" +msgid "" +":c:member:`!tp_dealloc` may be called from any Python thread, not just the " +"thread which created the object (if the object becomes part of a refcount " +"cycle, that cycle might be collected by a garbage collection on any thread)." +" This is not a problem for Python API calls, since the thread on which " +":c:member:`!tp_dealloc` is called with an :term:`attached thread state`. " +"However, if the object being destroyed in turn destroys objects from some " +"other C library, care should be taken to ensure that destroying those " +"objects on the thread which called :c:member:`!tp_dealloc` will not violate " +"any assumptions of the library." +msgstr "" +":c:member:`!tp_dealloc` ممکن است از هر نخ پایتون فراخوانی شود، نه فقط از نخی" +" که شیء را ایجاد کرده است (اگر شیء بخشی از یک چرخه شمارش ارجاع شود، ممکن است" +" آن چرخه توسط یک زباله‌روبی روی هر نخ جمع‌آوری شود). این برای فراخوانی‌های " +"API پایتون مشکلی نیست، زیرا نخی که :c:member:`!tp_dealloc` روی آن فراخوانی " +"می‌شود، دارای :term:`وضعیت نخ متصل ` است. با این " +"حال، اگر شیءِ در حال نابود شدن به نوبه خود اشیایی از یک کتابخانه C دیگر را " +"نابود کند، باید دقت کنید تا مطمئن شوید که نابود کردن آن اشیا روی نخی که " +":c:member:`!tp_dealloc` را فراخوانی کرده است، هیچ‌یک از فرض‌های آن کتابخانه " +"را نقض نخواهد کرد." -msgid ":ref:`life-cycle` for details about how this slot relates to other slots." +msgid "" +":ref:`life-cycle` for details about how this slot relates to other slots." msgstr "" +":ref:`life-cycle` را برای جزئیات درباره‌ی نحوه‌ی ارتباط این جایگاه با " +"جایگاه‌های دیگر ببینید." -msgid "An optional offset to a per-instance function that implements calling the object using the :ref:`vectorcall protocol `, a more efficient alternative of the simpler :c:member:`~PyTypeObject.tp_call`." +msgid "" +"An optional offset to a per-instance function that implements calling the " +"object using the :ref:`vectorcall protocol `, a more efficient " +"alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" +"آفست اختیاری برای تابعی به‌ازای هر نمونه که فراخوانی شیء را با استفاده از " +":ref:`پروتکل vectorcall ` پیاده‌سازی می‌کند؛ این پروتکل جایگزینی" +" کارآمدتر برای :c:member:`~PyTypeObject.tp_call` ساده‌تر است." -msgid "This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is set. If so, this must be a positive integer containing the offset in the instance of a :c:type:`vectorcallfunc` pointer." +msgid "" +"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is" +" set. If so, this must be a positive integer containing the offset in the " +"instance of a :c:type:`vectorcallfunc` pointer." msgstr "" +"این فیلد تنها زمانی استفاده می‌شود که پرچم " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` تنظیم شده باشد. در این صورت، این فیلد " +"باید یک عدد صحیح مثبت حاوی آفست اشاره‌گر :c:type:`vectorcallfunc` در نمونه " +"باشد." -msgid "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the instance falls back to :c:member:`~PyTypeObject.tp_call`." +msgid "" +"The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " +"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the" +" instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" +"اشاره‌گر *vectorcallfunc* ممکن است ``NULL`` باشد، که در این صورت نمونه به " +"گونه‌ای رفتار می‌کند که گویی :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` تنظیم " +"نشده است: فراخوانی نمونه به :c:member:`~PyTypeObject.tp_call` بازمی‌گردد." -msgid "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the *vectorcallfunc* function. This can be done by setting *tp_call* to :c:func:`PyVectorcall_Call`." +msgid "" +"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set " +":c:member:`~PyTypeObject.tp_call` and make sure its behaviour is consistent " +"with the *vectorcallfunc* function. This can be done by setting *tp_call* to" +" :c:func:`PyVectorcall_Call`." msgstr "" +"هر کلاسی که ``Py_TPFLAGS_HAVE_VECTORCALL`` را تنظیم می‌کند، باید " +":c:member:`~PyTypeObject.tp_call` را نیز تنظیم کند و اطمینان حاصل کند که " +"رفتار آن با تابع *vectorcallfunc* سازگار است. این کار را می‌توان با تنظیم " +"*tp_call* برابر با :c:func:`PyVectorcall_Call` انجام داد." -msgid "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was used for printing to a file. In Python 3.0 to 3.7, it was unused." +msgid "" +"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " +"used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" +"پیش از نسخه 3.8، این جایگاه ``tp_print`` نام داشت. در پایتون 2.x، از آن برای" +" چاپ در یک پرونده استفاده می‌شد. در پایتون 3.0 تا 3.7، استفاده نمی‌شد." -msgid "Before version 3.12, it was not recommended for :ref:`mutable heap types ` to implement the vectorcall protocol. When a user sets :attr:`~object.__call__` in Python code, only *tp_call* is updated, likely making it inconsistent with the vectorcall function. Since 3.12, setting ``__call__`` will disable vectorcall optimization by clearing the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag." -msgstr "" +msgid "" +"Before version 3.12, it was not recommended for :ref:`mutable heap types " +"` to implement the vectorcall protocol. When a user sets " +":attr:`~object.__call__` in Python code, only *tp_call* is updated, likely " +"making it inconsistent with the vectorcall function. Since 3.12, setting " +"``__call__`` will disable vectorcall optimization by clearing the " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag." +msgstr "" +"پیش از نسخه 3.12، توصیه نمی‌شد که :ref:`نوع‌های هیپِ تغییرپذیر `" +" پروتکل vectorcall را پیاده‌سازی کنند. هنگامی که کاربر " +":attr:`~object.__call__` را در کد پایتون تنظیم می‌کند، تنها *tp_call* " +"به‌روزرسانی می‌شود که احتمالاً آن را با تابع vectorcall ناسازگار می‌سازد. از" +" نسخه 3.12 به بعد، تنظیم ``__call__`` بهینه‌سازی vectorcall را با پاک کردن " +"پرچم :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` غیرفعال می‌کند." -msgid "This field is always inherited. However, the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, then the subclass won't use :ref:`vectorcall `, except when :c:func:`PyVectorcall_Call` is explicitly called." +msgid "" +"This field is always inherited. However, the " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's " +"not set, then the subclass won't use :ref:`vectorcall `, except " +"when :c:func:`PyVectorcall_Call` is explicitly called." msgstr "" +"این فیلد همیشه به ارث برده می‌شود. با این حال، پرچم " +":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` همیشه به ارث برده نمی‌شود. اگر این " +"پرچم تنظیم نشده باشد، زیرکلاس از :ref:`vectorcall ` استفاده " +"نخواهد کرد، مگر اینکه :c:func:`PyVectorcall_Call` به‌طور صریح فراخوانی شود." msgid "An optional pointer to the get-attribute-string function." -msgstr "" +msgstr "اشاره‌گر اختیاری به تابع get-attribute-string." -msgid "This field is deprecated. When it is defined, it should point to a function that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, but taking a C string instead of a Python string object to give the attribute name." +msgid "" +"This field is deprecated. When it is defined, it should point to a function" +" that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." msgstr "" +"این فیلد منسوخ شده است. هنگامی که تعریف شود، باید به تابعی اشاره کند که " +"مانند تابع :c:member:`~PyTypeObject.tp_getattro` عمل می‌کند، اما به‌جای شیء " +"رشته پایتون، یک رشته C برای ارائه‌ی نام ویژگی می‌گیرد." -msgid "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject.tp_getattro`" +msgid "" +"Group: :c:member:`~PyTypeObject.tp_getattr`, " +":c:member:`~PyTypeObject.tp_getattro`" msgstr "" +"گروه: :c:member:`~PyTypeObject.tp_getattr`، " +":c:member:`~PyTypeObject.tp_getattro`" -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` from its base type when the subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_getattro`: a subtype inherits both " +":c:member:`~PyTypeObject.tp_getattr` and " +":c:member:`~PyTypeObject.tp_getattro` from its base type when the subtype's " +":c:member:`~PyTypeObject.tp_getattr` and " +":c:member:`~PyTypeObject.tp_getattro` are both ``NULL``." +msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_getattro` توسط زیرنوع‌ها به " +"ارث می‌رسد: یک زیرنوع، هر دو :c:member:`~PyTypeObject.tp_getattr` و " +":c:member:`~PyTypeObject.tp_getattro` را از نوع پایه خود به ارث می‌برد، " +"زمانی که :c:member:`~PyTypeObject.tp_getattr` و " +":c:member:`~PyTypeObject.tp_getattro` زیرنوع هر دو ``NULL`` باشند." -msgid "An optional pointer to the function for setting and deleting attributes." -msgstr "" +msgid "" +"An optional pointer to the function for setting and deleting attributes." +msgstr "یک اشاره‌گر اختیاری به تابعِ تنظیم و حذف ویژگی‌ها." -msgid "This field is deprecated. When it is defined, it should point to a function that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, but taking a C string instead of a Python string object to give the attribute name." +msgid "" +"This field is deprecated. When it is defined, it should point to a function" +" that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." msgstr "" +"این فیلد منسوخ شده است. هنگامی که تعریف می‌شود، باید به تابعی اشاره کند که " +"مانند تابع :c:member:`~PyTypeObject.tp_setattro` عمل می‌کند، اما به جای شیء " +"رشته‌ی پایتون، یک رشته‌ی C برای ارائه‌ی نام ویژگی می‌پذیرد." -msgid "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject.tp_setattro`" +msgid "" +"Group: :c:member:`~PyTypeObject.tp_setattr`, " +":c:member:`~PyTypeObject.tp_setattro`" msgstr "" +"گروه: :c:member:`~PyTypeObject.tp_setattr`، " +":c:member:`~PyTypeObject.tp_setattro`" -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` from its base type when the subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_setattro`: a subtype inherits both " +":c:member:`~PyTypeObject.tp_setattr` and " +":c:member:`~PyTypeObject.tp_setattro` from its base type when the subtype's " +":c:member:`~PyTypeObject.tp_setattr` and " +":c:member:`~PyTypeObject.tp_setattro` are both ``NULL``." +msgstr "" +"این فیلد همراه با :c:member:`~PyTypeObject.tp_setattro` توسط زیرنوع‌ها به " +"ارث برده می‌شود: یک زیرنوع هر دو :c:member:`~PyTypeObject.tp_setattr` و " +":c:member:`~PyTypeObject.tp_setattro` را از نوع پایه‌ی خود به ارث می‌برد " +"وقتی که :c:member:`~PyTypeObject.tp_setattr` و " +":c:member:`~PyTypeObject.tp_setattro` آن هر دو ``NULL`` باشند." -msgid "Pointer to an additional structure that contains fields relevant only to objects which implement :term:`awaitable` and :term:`asynchronous iterator` protocols at the C-level. See :ref:`async-structs` for details." +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement :term:`awaitable` and :term:`asynchronous iterator` " +"protocols at the C-level. See :ref:`async-structs` for details." msgstr "" +"اشاره‌گر به یک ساختار اضافی که فیلدهایی را در بر می‌گیرد که تنها به اشیایی " +"مربوط‌اند که پروتکل‌های :term:`awaitable` و :term:`asynchronous iterator` را" +" در سطح C پیاده‌سازی می‌کنند. برای جزئیات به :ref:`async-structs` مراجعه " +"کنید." msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." -msgstr "" +msgstr "قبلاً با نام ``tp_compare`` و ``tp_reserved`` شناخته می‌شد." -msgid "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the contained fields are inherited individually." +msgid "" +"The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " +"contained fields are inherited individually." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_as_async` به ارث نمی‌رسد، اما فیلدهای درون " +"آن به‌صورت جداگانه به ارث می‌رسند." -msgid "An optional pointer to a function that implements the built-in function :func:`repr`." +msgid "" +"An optional pointer to a function that implements the built-in function " +":func:`repr`." msgstr "" +"اشاره‌گر اختیاری به تابعی که تابع توکار :func:`repr` را پیاده‌سازی می‌کند." msgid "The signature is the same as for :c:func:`PyObject_Repr`::" -msgstr "" +msgstr "امضا همانند :c:func:`PyObject_Repr` است::" msgid "PyObject *tp_repr(PyObject *self);" -msgstr "" +msgstr "PyObject *tp_repr(PyObject *self);" -msgid "The function must return a string or a Unicode object. Ideally, this function should return a string that, when passed to :func:`eval`, given a suitable environment, returns an object with the same value. If this is not feasible, it should return a string starting with ``'<'`` and ending with ``'>'`` from which both the type and the value of the object can be deduced." -msgstr "" +msgid "" +"The function must return a string or a Unicode object. Ideally, this " +"function should return a string that, when passed to :func:`eval`, given a " +"suitable environment, returns an object with the same value. If this is not" +" feasible, it should return a string starting with ``'<'`` and ending with " +"``'>'`` from which both the type and the value of the object can be deduced." +msgstr "" +"این تابع باید یک رشته یا یک شیء یونیکد را برگرداند. در حالت ایده‌آل، این " +"تابع باید رشته‌ای را برگرداند که وقتی به :func:`eval` پاس داده شود، با فراهم" +" بودن محیطی مناسب، شیئی با همان مقدار را بازگرداند. اگر این کار امکان‌پذیر " +"نباشد، باید رشته‌ای را برگرداند که با ``'<'`` شروع می‌شود و به ``'>'`` ختم " +"می‌شود و از روی آن می‌توان هم نوع و هم مقدار شیء را استنباط کرد." msgid "**Default:**" -msgstr "" +msgstr "**پیش‌فرض:**" -msgid "When this field is not set, a string of the form ``<%s object at %p>`` is returned, where ``%s`` is replaced by the type name, and ``%p`` by the object's memory address." +msgid "" +"When this field is not set, a string of the form ``<%s object at %p>`` is " +"returned, where ``%s`` is replaced by the type name, and ``%p`` by the " +"object's memory address." msgstr "" +"هنگامی که این فیلد تنظیم نشده باشد، رشته‌ای به شکل ``<%s object at %p>`` " +"برگردانده می‌شود که در آن ``%s`` با نام نوع و ``%p`` با نشانی حافظه‌ی شیء " +"جایگزین می‌شود." -msgid "Pointer to an additional structure that contains fields relevant only to objects which implement the number protocol. These fields are documented in :ref:`number-structs`." +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the number protocol. These fields are documented in" +" :ref:`number-structs`." msgstr "" +"اشاره‌گر به یک ساختار اضافی که فیلدهایی را در بر دارد که تنها برای اشیایی که" +" پروتکل عددی را پیاده‌سازی می‌کنند مربوط‌اند. این فیلدها در :ref:`number-" +"structs` مستند شده‌اند." -msgid "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the contained fields are inherited individually." +msgid "" +"The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " +"contained fields are inherited individually." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_as_number` به ارث برده نمی‌شود، اما فیلدهای" +" درون آن به‌صورت جداگانه به ارث برده می‌شوند." -msgid "Pointer to an additional structure that contains fields relevant only to objects which implement the sequence protocol. These fields are documented in :ref:`sequence-structs`." +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the sequence protocol. These fields are documented " +"in :ref:`sequence-structs`." msgstr "" +"اشاره‌گر به یک ساختار اضافی که فیلدهایی را در بر می‌گیرد که تنها به اشیائی " +"مربوط‌اند که پروتکل دنباله را پیاده‌سازی می‌کنند. این فیلدها در " +":ref:`sequence-structs` مستند شده‌اند." -msgid "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the contained fields are inherited individually." +msgid "" +"The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the" +" contained fields are inherited individually." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_as_sequence` به ارث برده نمی‌شود، اما " +"فیلدهای درون آن به‌صورت جداگانه به ارث برده می‌شوند." -msgid "Pointer to an additional structure that contains fields relevant only to objects which implement the mapping protocol. These fields are documented in :ref:`mapping-structs`." +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the mapping protocol. These fields are documented " +"in :ref:`mapping-structs`." msgstr "" +"اشاره‌گر به ساختاری اضافی که فیلدهایش تنها به اشیایی مربوط است که پروتکل " +"نگاشت را پیاده‌سازی می‌کنند. این فیلدها در :ref:`mapping-structs` مستند " +"شده‌اند." -msgid "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the contained fields are inherited individually." +msgid "" +"The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " +"contained fields are inherited individually." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_as_mapping` به ارث نمی‌رسد، اما فیلدهای " +"درون آن به‌صورت جداگانه به ارث می‌رسند." -msgid "An optional pointer to a function that implements the built-in function :func:`hash`." +msgid "" +"An optional pointer to a function that implements the built-in function " +":func:`hash`." msgstr "" +"یک اشاره‌گر اختیاری به تابعی که تابع توکار :func:`hash` را پیاده‌سازی " +"می‌کند." msgid "The signature is the same as for :c:func:`PyObject_Hash`::" -msgstr "" +msgstr "امضا همانند :c:func:`PyObject_Hash` است::" msgid "Py_hash_t tp_hash(PyObject *);" -msgstr "" +msgstr "Py_hash_t tp_hash(PyObject *);" -msgid "The value ``-1`` should not be returned as a normal return value; when an error occurs during the computation of the hash value, the function should set an exception and return ``-1``." +msgid "" +"The value ``-1`` should not be returned as a normal return value; when an " +"error occurs during the computation of the hash value, the function should " +"set an exception and return ``-1``." msgstr "" +"مقدار ``-1`` نباید به‌عنوان یک مقدار بازگشتی عادی برگردانده شود؛ هنگامی که " +"در حین محاسبه‌ی مقدار هش خطایی رخ می‌دهد، تابع باید یک استثنا تنظیم کرده و " +"``-1`` را برگرداند." -msgid "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` is not set), an attempt to take the hash of the object raises :exc:`TypeError`. This is the same as setting it to :c:func:`PyObject_HashNotImplemented`." +msgid "" +"When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " +"is not set), an attempt to take the hash of the object raises " +":exc:`TypeError`. This is the same as setting it to " +":c:func:`PyObject_HashNotImplemented`." msgstr "" +"وقتی این فیلد تنظیم نشده باشد (*و* :c:member:`~PyTypeObject.tp_richcompare` " +"نیز تنظیم نشده باشد)، تلاش برای گرفتن هش شیء باعث ایجاد استثنای " +":exc:`TypeError` می‌شود. این همانند تنظیم آن به " +":c:func:`PyObject_HashNotImplemented` است." -msgid "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to block inheritance of the hash method from a parent type. This is interpreted as the equivalent of ``__hash__ = None`` at the Python level, causing ``isinstance(o, collections.Hashable)`` to correctly return ``False``. Note that the converse is also true - setting ``__hash__ = None`` on a class at the Python level will result in the ``tp_hash`` slot being set to :c:func:`PyObject_HashNotImplemented`." -msgstr "" +msgid "" +"This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to" +" block inheritance of the hash method from a parent type. This is " +"interpreted as the equivalent of ``__hash__ = None`` at the Python level, " +"causing ``isinstance(o, collections.Hashable)`` to correctly return " +"``False``. Note that the converse is also true - setting ``__hash__ = None``" +" on a class at the Python level will result in the ``tp_hash`` slot being " +"set to :c:func:`PyObject_HashNotImplemented`." +msgstr "" +"این فیلد را می‌توان به‌طور صریح روی :c:func:`PyObject_HashNotImplemented` " +"تنظیم کرد تا از ارث‌بری متد هش از نوع والد جلوگیری شود. این به‌عنوان معادل " +"``__hash__ = None`` در سطح پایتون تفسیر می‌شود و باعث می‌شود ``isinstance(o," +" collections.Hashable)`` به‌درستی ``False`` را برگرداند. توجه داشته باشید که" +" عکس این موضوع نیز صادق است — تنظیم ``__hash__ = None`` روی یک کلاس در سطح " +"پایتون باعث می‌شود جایگاه ``tp_hash`` روی " +":c:func:`PyObject_HashNotImplemented` تنظیم شود." -msgid "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject.tp_richcompare`" +msgid "" +"Group: :c:member:`~PyTypeObject.tp_hash`, " +":c:member:`~PyTypeObject.tp_richcompare`" msgstr "" +"گروه: :c:member:`~PyTypeObject.tp_hash`، " +":c:member:`~PyTypeObject.tp_richcompare`" -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash`, when the subtype's :c:member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_richcompare`: a subtype inherits both of " +":c:member:`~PyTypeObject.tp_richcompare` and " +":c:member:`~PyTypeObject.tp_hash`, when the subtype's " +":c:member:`~PyTypeObject.tp_richcompare` and " +":c:member:`~PyTypeObject.tp_hash` are both ``NULL``." +msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_richcompare` توسط زیرنوع‌ها به" +" ارث برده می‌شود: یک زیرنوع هر دو :c:member:`~PyTypeObject.tp_richcompare` و" +" :c:member:`~PyTypeObject.tp_hash` را به ارث می‌برد، زمانی که " +":c:member:`~PyTypeObject.tp_richcompare` و :c:member:`~PyTypeObject.tp_hash`" +" زیرنوع هر دو ``NULL`` باشند." msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." msgstr "" +":c:data:`PyBaseObject_Type` از :c:func:`PyObject_GenericHash` استفاده " +"می‌کند." -msgid "An optional pointer to a function that implements calling the object. This should be ``NULL`` if the object is not callable. The signature is the same as for :c:func:`PyObject_Call`::" +msgid "" +"An optional pointer to a function that implements calling the object. This " +"should be ``NULL`` if the object is not callable. The signature is the same" +" as for :c:func:`PyObject_Call`::" msgstr "" +"اشاره‌گر اختیاری به تابعی که فراخوانی شیء را پیاده‌سازی می‌کند. اگر شیء " +"فراخوانی‌پذیر نباشد، این اشاره‌گر باید ``NULL`` باشد. امضای این تابع همانند " +":c:func:`PyObject_Call` است::" msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" -msgstr "" +msgstr "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" -msgid "An optional pointer to a function that implements the built-in operation :func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls the constructor for that type. This constructor calls :c:func:`PyObject_Str` to do the actual work, and :c:func:`PyObject_Str` will call this handler.)" -msgstr "" +msgid "" +"An optional pointer to a function that implements the built-in operation " +":func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " +"the constructor for that type. This constructor calls " +":c:func:`PyObject_Str` to do the actual work, and :c:func:`PyObject_Str` " +"will call this handler.)" +msgstr "" +"یک اشاره‌گر اختیاری به تابعی که عملیات توکار :func:`str` را پیاده‌سازی " +"می‌کند. (توجه داشته باشید که :class:`str` اکنون یک نوع است و :func:`str` " +"سازنده‌ی آن نوع را فراخوانی می‌کند. این سازنده برای انجام کار اصلی " +":c:func:`PyObject_Str` را فراخوانی می‌کند و :c:func:`PyObject_Str` این هندلر" +" را فراخوانی خواهد کرد.)" msgid "The signature is the same as for :c:func:`PyObject_Str`::" -msgstr "" +msgstr "امضا همانند :c:func:`PyObject_Str` است::" msgid "PyObject *tp_str(PyObject *self);" -msgstr "" +msgstr "PyObject *tp_str(PyObject *self);" -msgid "The function must return a string or a Unicode object. It should be a \"friendly\" string representation of the object, as this is the representation that will be used, among other things, by the :func:`print` function." +msgid "" +"The function must return a string or a Unicode object. It should be a " +"\"friendly\" string representation of the object, as this is the " +"representation that will be used, among other things, by the :func:`print` " +"function." msgstr "" +"این تابع باید یک رشته یا یک شیء یونیکد را برگرداند. این باید نمایش رشته‌ای " +"«دوستانه» از شیء باشد، زیرا این نمایشی است که، از جمله موارد دیگر، توسط تابع" +" :func:`print` استفاده خواهد شد." -msgid "When this field is not set, :c:func:`PyObject_Repr` is called to return a string representation." +msgid "" +"When this field is not set, :c:func:`PyObject_Repr` is called to return a " +"string representation." msgstr "" +"هنگامی که این فیلد تنظیم‌نشده باشد، :c:func:`PyObject_Repr` برای برگرداندن " +"یک نمایش رشته‌ای فراخوانی می‌شود." msgid "An optional pointer to the get-attribute function." -msgstr "" +msgstr "اشاره‌گر اختیاری به تابع دریافت ویژگی." msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" -msgstr "" +msgstr "امضا همانند :c:func:`PyObject_GetAttr` است::" msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" -msgstr "" +msgstr "PyObject *tp_getattro(PyObject *self, PyObject *attr);" -msgid "It is usually convenient to set this field to :c:func:`PyObject_GenericGetAttr`, which implements the normal way of looking for object attributes." +msgid "" +"It is usually convenient to set this field to " +":c:func:`PyObject_GenericGetAttr`, which implements the normal way of " +"looking for object attributes." msgstr "" +"معمولاً مناسب است که این فیلد را روی :c:func:`PyObject_GenericGetAttr` تنظیم" +" کنید که روش معمولِ جستجوی ویژگی‌های شیء را پیاده‌سازی می‌کند." -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` from its base type when the subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_getattr`: a subtype inherits both " +":c:member:`~PyTypeObject.tp_getattr` and " +":c:member:`~PyTypeObject.tp_getattro` from its base type when the subtype's " +":c:member:`~PyTypeObject.tp_getattr` and " +":c:member:`~PyTypeObject.tp_getattro` are both ``NULL``." +msgstr "" +"این فیلد همراه با :c:member:`~PyTypeObject.tp_getattr` توسط زیرنوع‌ها به ارث" +" برده می‌شود: زیرنوع زمانی هر دو :c:member:`~PyTypeObject.tp_getattr` و " +":c:member:`~PyTypeObject.tp_getattro` را از نوع پایه‌ی خود به ارث می‌برد که " +"هر دو :c:member:`~PyTypeObject.tp_getattr` و " +":c:member:`~PyTypeObject.tp_getattro` آن ``NULL`` باشند." msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" +":c:data:`PyBaseObject_Type` از :c:func:`PyObject_GenericGetAttr` استفاده " +"می‌کند." msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" -msgstr "" +msgstr "امضا همان امضای :c:func:`PyObject_SetAttr` است::" msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" -msgstr "" +msgstr "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" -msgid "In addition, setting *value* to ``NULL`` to delete an attribute must be supported. It is usually convenient to set this field to :c:func:`PyObject_GenericSetAttr`, which implements the normal way of setting object attributes." +msgid "" +"In addition, setting *value* to ``NULL`` to delete an attribute must be " +"supported. It is usually convenient to set this field to " +":c:func:`PyObject_GenericSetAttr`, which implements the normal way of " +"setting object attributes." msgstr "" +"علاوه بر این، باید از تنظیم *value* به ``NULL`` برای حذف یک ویژگی پشتیبانی " +"شود. معمولاً سودمند است که این فیلد را به :c:func:`PyObject_GenericSetAttr` " +"تنظیم کنید که روش معمول تنظیم ویژگی‌های شیء را پیاده‌سازی می‌کند." -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` from its base type when the subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_setattr`: a subtype inherits both " +":c:member:`~PyTypeObject.tp_setattr` and " +":c:member:`~PyTypeObject.tp_setattro` from its base type when the subtype's " +":c:member:`~PyTypeObject.tp_setattr` and " +":c:member:`~PyTypeObject.tp_setattro` are both ``NULL``." +msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_setattr` توسط زیرنوع‌ها به ارث" +" برده می‌شود: زیرنوعی که :c:member:`~PyTypeObject.tp_setattr` و " +":c:member:`~PyTypeObject.tp_setattro` آن هر دو ``NULL`` هستند، هر دو " +":c:member:`~PyTypeObject.tp_setattr` و :c:member:`~PyTypeObject.tp_setattro`" +" را از نوع پایه خود به ارث می‌برد." msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" +":c:data:`PyBaseObject_Type` از :c:func:`PyObject_GenericSetAttr` استفاده " +"می‌کند." -msgid "Pointer to an additional structure that contains fields relevant only to objects which implement the buffer interface. These fields are documented in :ref:`buffer-structs`." +msgid "" +"Pointer to an additional structure that contains fields relevant only to " +"objects which implement the buffer interface. These fields are documented " +"in :ref:`buffer-structs`." msgstr "" +"اشاره‌گر به یک ساختار اضافی که فیلدهای آن تنها برای اشیایی که رابط بافر را " +"پیاده‌سازی می‌کنند مربوط است. این فیلدها در :ref:`buffer-structs` مستند " +"شده‌اند." -msgid "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the contained fields are inherited individually." +msgid "" +"The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " +"contained fields are inherited individually." msgstr "" +"فیلد :c:member:`~PyTypeObject.tp_as_buffer` به ارث برده نمی‌شود، اما فیلدهای" +" درون آن به‌طور جداگانه به ارث برده می‌شوند." -msgid "This field is a bit mask of various flags. Some flags indicate variant semantics for certain situations; others are used to indicate that certain fields in the type object (or in the extension structures referenced via :c:member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject.tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping`, and :c:member:`~PyTypeObject.tp_as_buffer`) that were historically not always present are valid; if such a flag bit is clear, the type fields it guards must not be accessed and must be considered to have a zero or ``NULL`` value instead." -msgstr "" +msgid "" +"This field is a bit mask of various flags. Some flags indicate variant " +"semantics for certain situations; others are used to indicate that certain " +"fields in the type object (or in the extension structures referenced via " +":c:member:`~PyTypeObject.tp_as_number`, " +":c:member:`~PyTypeObject.tp_as_sequence`, " +":c:member:`~PyTypeObject.tp_as_mapping`, and " +":c:member:`~PyTypeObject.tp_as_buffer`) that were historically not always " +"present are valid; if such a flag bit is clear, the type fields it guards " +"must not be accessed and must be considered to have a zero or ``NULL`` value" +" instead." +msgstr "" +"این فیلد یک نقاب بیتی از پرچم‌های گوناگون است. برخی پرچم‌ها معناشناسی " +"متفاوتی را برای موقعیت‌های خاص نشان می‌دهند؛ برخی دیگر برای نشان دادن این " +"موضوع به کار می‌روند که فیلدهای خاصی در شیء نوع (یا در ساختارهای توسعه‌ای که" +" از طریق :c:member:`~PyTypeObject.tp_as_number`، " +":c:member:`~PyTypeObject.tp_as_sequence`، " +":c:member:`~PyTypeObject.tp_as_mapping` و " +":c:member:`~PyTypeObject.tp_as_buffer` به آن‌ها ارجاع می‌شود) که به‌طور " +"تاریخی همیشه وجود نداشته‌اند، معتبر هستند؛ اگر چنین بیت پرچمی صفر باشد، " +"نباید به فیلدهای نوعی که این بیت از آن‌ها نگهبانی می‌کند دسترسی پیدا کرد و " +"باید در عوض، آن‌ها را دارای مقدار صفر یا ``NULL`` در نظر گرفت." -msgid "Inheritance of this field is complicated. Most flag bits are inherited individually, i.e. if the base type has a flag bit set, the subtype inherits this flag bit. The flag bits that pertain to extension structures are strictly inherited if the extension structure is inherited, i.e. the base type's value of the flag bit is copied into the subtype together with a pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` values." -msgstr "" +msgid "" +"Inheritance of this field is complicated. Most flag bits are inherited " +"individually, i.e. if the base type has a flag bit set, the subtype inherits" +" this flag bit. The flag bits that pertain to extension structures are " +"strictly inherited if the extension structure is inherited, i.e. the base " +"type's value of the flag bit is copied into the subtype together with a " +"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag " +"bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` and" +" :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the " +":c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear`" +" fields in the subtype exist and have ``NULL`` values." +msgstr "" +"وراثت این فیلد پیچیده است. بیشتر بیت‌های پرچم به‌صورت جداگانه به ارث " +"می‌رسند، یعنی اگر بیت پرچمی در نوع پایه تنظیم‌شده باشد، زیرنوع این بیت پرچم " +"را به ارث می‌برد. بیت‌های پرچم مربوط به ساختارهای توسعه‌ای، در صورتی که " +"ساختار توسعه‌ای به ارث برسد، به‌طور اکید به ارث می‌رسند؛ یعنی مقدار بیت پرچم" +" در نوع پایه به همراه اشاره‌گری به ساختار توسعه‌ای، در زیرنوع کپی می‌شود. " +"بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` همراه با فیلدهای " +":c:member:`~PyTypeObject.tp_traverse` و :c:member:`~PyTypeObject.tp_clear` " +"به ارث می‌رسد، یعنی بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` در صورتی به ارث " +"می‌رسد که در زیرنوع صفر باشد و فیلدهای :c:member:`~PyTypeObject.tp_traverse`" +" و :c:member:`~PyTypeObject.tp_clear` در زیرنوع موجود باشند و مقدار ``NULL``" +" داشته باشند." -msgid ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE``." +msgid "" +":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " +"Py_TPFLAGS_BASETYPE``." msgstr "" +":c:data:`PyBaseObject_Type` از ``Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE`` " +"استفاده می‌کند." msgid "**Bit Masks:**" -msgstr "" +msgstr "**نقاب‌های بیتی:**" -msgid "The following bit masks are currently defined; these can be ORed together using the ``|`` operator to form the value of the :c:member:`~PyTypeObject.tp_flags` field. The macro :c:func:`PyType_HasFeature` takes a type and a flags value, *tp* and *f*, and checks whether ``tp->tp_flags & f`` is non-zero." -msgstr "" +msgid "" +"The following bit masks are currently defined; these can be ORed together " +"using the ``|`` operator to form the value of the " +":c:member:`~PyTypeObject.tp_flags` field. The macro " +":c:func:`PyType_HasFeature` takes a type and a flags value, *tp* and *f*, " +"and checks whether ``tp->tp_flags & f`` is non-zero." +msgstr "" +"نقاب‌های بیتی زیر در حال حاضر تعریف شده‌اند؛ این نقاب‌ها را می‌توان با " +"استفاده از عملگر ``|`` با یکدیگر OR کرد تا مقدار فیلد " +":c:member:`~PyTypeObject.tp_flags` را تشکیل دهند. ماکروی " +":c:func:`PyType_HasFeature` یک نوع و یک مقدار پرچم، یعنی *tp* و *f*، می‌گیرد" +" و بررسی می‌کند که آیا ``tp->tp_flags & f`` ناصفر است یا خیر." -msgid "This bit is set when the type object itself is allocated on the heap, for example, types created dynamically using :c:func:`PyType_FromSpec`. In this case, the :c:member:`~PyObject.ob_type` field of its instances is considered a reference to the type, and the type object is INCREF'ed when a new instance is created, and DECREF'ed when an instance is destroyed (this does not apply to instances of subtypes; only the type referenced by the instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should also :ref:`support garbage collection ` as they can form a reference cycle with their own module object." -msgstr "" +msgid "" +"This bit is set when the type object itself is allocated on the heap, for " +"example, types created dynamically using :c:func:`PyType_FromSpec`. In this" +" case, the :c:member:`~PyObject.ob_type` field of its instances is " +"considered a reference to the type, and the type object is INCREF'ed when a " +"new instance is created, and DECREF'ed when an instance is destroyed (this " +"does not apply to instances of subtypes; only the type referenced by the " +"instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should also " +":ref:`support garbage collection ` as they can " +"form a reference cycle with their own module object." +msgstr "" +"این بیت زمانی تنظیم می‌شود که خودِ شیء نوع روی هیپ تخصیص یابد؛ برای مثال، " +"نوع‌هایی که به‌صورت پویا با استفاده از :c:func:`PyType_FromSpec` ایجاد " +"می‌شوند. در این حالت، فیلد :c:member:`~PyObject.ob_type` نمونه‌های آن " +"به‌عنوان ارجاعی به نوع در نظر گرفته می‌شود و شیء نوع هنگام ایجاد شدن یک " +"نمونه‌ی جدید INCREF می‌شود و هنگام نابود شدن نمونه DECREF می‌شود (این مورد " +"برای نمونه‌های زیرنوع‌ها اعمال نمی‌شود؛ فقط نوعی که ob_type نمونه به آن " +"ارجاع می‌دهد INCREF یا DECREF می‌شود). نوع‌های هیپ همچنین باید " +":ref:`زباله‌روبی را پشتیبانی کنند `، زیرا " +"می‌توانند با شیء ماژول خود چرخه‌ی ارجاع تشکیل دهند." msgid "???" -msgstr "" +msgstr "???" -msgid "This bit is set when the type can be used as the base type of another type. If this bit is clear, the type cannot be subtyped (similar to a \"final\" class in Java)." +msgid "" +"This bit is set when the type can be used as the base type of another type." +" If this bit is clear, the type cannot be subtyped (similar to a \"final\" " +"class in Java)." msgstr "" +"این بیت زمانی تنظیم می‌شود که بتوان از این نوع به‌عنوان نوع پایه‌ی نوع دیگری" +" استفاده کرد. اگر این بیت پاک باشد، نمی‌توان از این نوع زیرنوعی ساخت (مشابه " +"کلاس «final» در جاوا)." -msgid "This bit is set when the type object has been fully initialized by :c:func:`PyType_Ready`." +msgid "" +"This bit is set when the type object has been fully initialized by " +":c:func:`PyType_Ready`." msgstr "" +"این بیت زمانی تنظیم می‌شود که شیء نوع به‌طور کامل توسط " +":c:func:`PyType_Ready` مقداردهی اولیه شده باشد." -msgid "This bit is set while :c:func:`PyType_Ready` is in the process of initializing the type object." +msgid "" +"This bit is set while :c:func:`PyType_Ready` is in the process of " +"initializing the type object." msgstr "" +"این بیت هنگامی تنظیم می‌شود که :c:func:`PyType_Ready` در حال مقدار‌دهی " +"اولیه‌ی شیء نوع است." -msgid "This bit is set when the object supports garbage collection. If this bit is set, memory for new instances (see :c:member:`~PyTypeObject.tp_alloc`) must be allocated using :c:macro:`PyObject_GC_New` or :c:func:`PyType_GenericAlloc` and deallocated (see :c:member:`~PyTypeObject.tp_free`) using :c:func:`PyObject_GC_Del`. More information in section :ref:`supporting-cycle-detection`." -msgstr "" +msgid "" +"This bit is set when the object supports garbage collection. If this bit is" +" set, memory for new instances (see :c:member:`~PyTypeObject.tp_alloc`) must" +" be allocated using :c:macro:`PyObject_GC_New` or " +":c:func:`PyType_GenericAlloc` and deallocated (see " +":c:member:`~PyTypeObject.tp_free`) using :c:func:`PyObject_GC_Del`. More " +"information in section :ref:`supporting-cycle-detection`." +msgstr "" +"این بیت زمانی تنظیم می‌شود که شیء از زباله‌روبی پشتیبانی کند. اگر این بیت " +"تنظیم شده باشد، حافظه‌ی نمونه‌های جدید (نگاه کنید به " +":c:member:`~PyTypeObject.tp_alloc`) باید با استفاده از " +":c:macro:`PyObject_GC_New` یا :c:func:`PyType_GenericAlloc` تخصیص داده شود و" +" (نگاه کنید به :c:member:`~PyTypeObject.tp_free`) با استفاده از " +":c:func:`PyObject_GC_Del` آزاد شود. اطلاعات بیشتر در بخش :ref:`supporting-" +"cycle-detection`." -msgid "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject.tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" +msgid "" +"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject.tp_traverse`," +" :c:member:`~PyTypeObject.tp_clear`" msgstr "" +"گروه: :c:macro:`Py_TPFLAGS_HAVE_GC`، :c:member:`~PyTypeObject.tp_traverse`، " +":c:member:`~PyTypeObject.tp_clear`" -msgid "The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` values." -msgstr "" +msgid "" +"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the " +":c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear`" +" fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the" +" subtype and the :c:member:`~PyTypeObject.tp_traverse` and " +":c:member:`~PyTypeObject.tp_clear` fields in the subtype exist and have " +"``NULL`` values." +msgstr "" +"بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` به همراه فیلد‌های " +":c:member:`~PyTypeObject.tp_traverse` و :c:member:`~PyTypeObject.tp_clear` " +"به ارث برده می‌شود؛ یعنی اگر بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` در " +"زیرنوع صفر باشد و فیلد‌های :c:member:`~PyTypeObject.tp_traverse` و " +":c:member:`~PyTypeObject.tp_clear` در زیرنوع وجود داشته باشند و مقدار " +"``NULL`` داشته باشند." -msgid "This is a bitmask of all the bits that pertain to the existence of certain fields in the type object and its extension structures. Currently, it includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." +msgid "" +"This is a bitmask of all the bits that pertain to the existence of certain " +"fields in the type object and its extension structures. Currently, it " +"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" +"این نقاب بیتی تمام بیت‌هایی را در بر می‌گیرد که به وجود فیلدهای معین در شیء " +"نوع و ساختارهای توسعه‌ای آن مربوط می‌شوند. در حال حاضر، شامل بیت‌های زیر " +"است: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgid "This bit indicates that objects behave like unbound methods." -msgstr "" +msgstr "این بیت نشان می‌دهد که اشیاء مانند متدهای غیرمقید رفتار می‌کنند." msgid "If this flag is set for ``type(meth)``, then:" -msgstr "" +msgstr "اگر این پرچم برای ``type(meth)`` تنظیم‌شده باشد، آنگاه:" -msgid "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be equivalent to ``meth(obj, *args, **kwds)``." +msgid "" +"``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " +"equivalent to ``meth(obj, *args, **kwds)``." msgstr "" +"عبارت ``meth.__get__(obj, cls)(*args, **kwds)`` (وقتی ``obj`` برابر None " +"نیست) باید معادل ``meth(obj, *args, **kwds)`` باشد." -msgid "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to ``meth(*args, **kwds)``." +msgid "" +"``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " +"``meth(*args, **kwds)``." msgstr "" +"``meth.__get__(None, cls)(*args, **kwds)`` باید معادل ``meth(*args, " +"**kwds)`` باشد." -msgid "This flag enables an optimization for typical method calls like ``obj.meth()``: it avoids creating a temporary \"bound method\" object for ``obj.meth``." +msgid "" +"This flag enables an optimization for typical method calls like " +"``obj.meth()``: it avoids creating a temporary \"bound method\" object for " +"``obj.meth``." msgstr "" +"این پرچم بهینه‌سازی‌ای را برای فراخوانی‌های متداول متد مانند ``obj.meth()`` " +"فعال می‌کند: از ایجاد یک شیء موقت «متد مقید» برای ``obj.meth`` جلوگیری " +"می‌کند." -msgid "This flag is never inherited by types without the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." +msgid "" +"This flag is never inherited by types without the " +":c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is " +"inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" +"این پرچم هرگز توسط نوع‌هایی که پرچم :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` روی " +"آن‌ها تنظیم‌نشده است، به ارث برده نمی‌شود. برای نوع‌های توسعه‌ای، این پرچم " +"هر زمان که :c:member:`~PyTypeObject.tp_descr_get` به ارث برده شود، به ارث " +"برده می‌شود." -msgid "This bit indicates that instances of the class have a :attr:`~object.__dict__` attribute, and that the space for the dictionary is managed by the VM." +msgid "" +"This bit indicates that instances of the class have a " +":attr:`~object.__dict__` attribute, and that the space for the dictionary is" +" managed by the VM." msgstr "" +"این بیت نشان می‌دهد که نمونه‌های کلاس دارای ویژگی :attr:`~object.__dict__` " +"هستند و فضای دیکشنری توسط ماشین مجازی مدیریت می‌شود." msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" +"اگر این پرچم تنظیم شده باشد، :c:macro:`Py_TPFLAGS_HAVE_GC` نیز باید تنظیم " +"شود." -msgid "The type traverse function must call :c:func:`PyObject_VisitManagedDict` and its clear function must call :c:func:`PyObject_ClearManagedDict`." +msgid "" +"The type traverse function must call :c:func:`PyObject_VisitManagedDict` and" +" its clear function must call :c:func:`PyObject_ClearManagedDict`." msgstr "" +"تابع پیمایش (traverse) نوع باید :c:func:`PyObject_VisitManagedDict` را " +"فراخوانی کند و تابع پاک‌سازی آن باید :c:func:`PyObject_ClearManagedDict` را " +"فراخوانی کند." -msgid "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` field is set in a superclass." +msgid "" +"This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " +"field is set in a superclass." msgstr "" +"این پرچم به ارث برده می‌شود، مگر آنکه فیلد " +":c:member:`~PyTypeObject.tp_dictoffset` در یک ابرکلاس تنظیم شده باشد." -msgid "This bit indicates that instances of the class should be weakly referenceable." -msgstr "" +msgid "" +"This bit indicates that instances of the class should be weakly " +"referenceable." +msgstr "این بیت نشان می‌دهد که نمونه‌های کلاس باید قابل ارجاع ضعیف باشند." -msgid "This flag is inherited unless the :c:member:`~PyTypeObject.tp_weaklistoffset` field is set in a superclass." +msgid "" +"This flag is inherited unless the " +":c:member:`~PyTypeObject.tp_weaklistoffset` field is set in a superclass." msgstr "" +"این پرچم به ارث برده می‌شود مگر اینکه فیلد " +":c:member:`~PyTypeObject.tp_weaklistoffset` در یک ابرکلاس تنظیم شده باشد." -msgid "Only usable with variable-size types, i.e. ones with non-zero :c:member:`~PyTypeObject.tp_itemsize`." +msgid "" +"Only usable with variable-size types, i.e. ones with non-zero " +":c:member:`~PyTypeObject.tp_itemsize`." msgstr "" +"فقط با نوع‌های دارای اندازه متغیر قابل استفاده است؛ یعنی نوع‌هایی که " +":c:member:`~PyTypeObject.tp_itemsize` غیر صفر دارند." -msgid "Indicates that the variable-sized portion of an instance of this type is at the end of the instance's memory area, at an offset of ``Py_TYPE(obj)->tp_basicsize`` (which may be different in each subclass)." +msgid "" +"Indicates that the variable-sized portion of an instance of this type is at " +"the end of the instance's memory area, at an offset of " +"``Py_TYPE(obj)->tp_basicsize`` (which may be different in each subclass)." msgstr "" +"نشان می‌دهد که بخش با اندازه‌ی متغیرِ نمونه‌ای از این نوع، در انتهای ناحیه‌ی" +" حافظه‌ی نمونه و با آفست ``Py_TYPE(obj)->tp_basicsize`` قرار دارد (که ممکن " +"است در هر زیرکلاس متفاوت باشد)." -msgid "When setting this flag, be sure that all superclasses either use this memory layout, or are not variable-sized. Python does not check this." +msgid "" +"When setting this flag, be sure that all superclasses either use this memory" +" layout, or are not variable-sized. Python does not check this." msgstr "" +"هنگام تنظیم این پرچم، مطمئن شوید که همه‌ی ابرکلاس‌ها یا از این چیدمان حافظه " +"استفاده می‌کنند یا اندازه‌ی متغیر ندارند. پایتون این مورد را بررسی نمی‌کند." msgid "This flag is inherited." -msgstr "" +msgstr "این پرچم به ارث برده می‌شود." -msgid "Functions such as :c:func:`PyLong_Check` will call :c:func:`PyType_FastSubclass` with one of these flags to quickly determine if a type is a subclass of a built-in type; such specific checks are faster than a generic check, like :c:func:`PyObject_IsInstance`. Custom types that inherit from built-ins should have their :c:member:`~PyTypeObject.tp_flags` set appropriately, or the code that interacts with such types will behave differently depending on what kind of check is used." -msgstr "" +msgid "" +"Functions such as :c:func:`PyLong_Check` will call " +":c:func:`PyType_FastSubclass` with one of these flags to quickly determine " +"if a type is a subclass of a built-in type; such specific checks are faster " +"than a generic check, like :c:func:`PyObject_IsInstance`. Custom types that " +"inherit from built-ins should have their :c:member:`~PyTypeObject.tp_flags` " +"set appropriately, or the code that interacts with such types will behave " +"differently depending on what kind of check is used." +msgstr "" +"تابع‌هایی مانند :c:func:`PyLong_Check` با یکی از این پرچم‌ها " +":c:func:`PyType_FastSubclass` را فراخوانی می‌کنند تا به‌سرعت تعیین کنند که " +"آیا یک نوع، زیرکلاس یک نوع توکار است یا نه؛ چنین بررسی‌های خاصی سریع‌تر از " +"یک بررسی عام مانند :c:func:`PyObject_IsInstance` هستند. نوع‌های سفارشی که از" +" نوع‌های توکار ارث‌بری می‌کنند باید :c:member:`~PyTypeObject.tp_flags` خود " +"را به‌درستی تنظیم کنند، وگرنه کدی که با چنین نوع‌هایی تعامل دارد، بسته به " +"اینکه چه نوع بررسی‌ای استفاده می‌شود، رفتار متفاوتی خواهد داشت." -msgid "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is present in the type structure." +msgid "" +"This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " +"present in the type structure." msgstr "" +"این بیت زمانی تنظیم می‌شود که جایگاه :c:member:`~PyTypeObject.tp_finalize` " +"در ساختار نوع موجود باشد." -msgid "This flag isn't necessary anymore, as the interpreter assumes the :c:member:`~PyTypeObject.tp_finalize` slot is always present in the type structure." +msgid "" +"This flag isn't necessary anymore, as the interpreter assumes the " +":c:member:`~PyTypeObject.tp_finalize` slot is always present in the type " +"structure." msgstr "" +"این پرچم دیگر ضروری نیست، زیرا مفسر فرض می‌کند که جایگاه " +":c:member:`~PyTypeObject.tp_finalize` همیشه در ساختار نوع وجود دارد." -msgid "This bit is set when the class implements the :ref:`vectorcall protocol `. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for details." +msgid "" +"This bit is set when the class implements the :ref:`vectorcall protocol " +"`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " +"details." msgstr "" +"این بیت زمانی تنظیم می‌شود که کلاس :ref:`پروتکل vectorcall ` را " +"پیاده‌سازی کند. برای جزئیات به " +":c:member:`~PyTypeObject.tp_vectorcall_offset` مراجعه کنید." -msgid "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." +msgid "" +"This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also " +"inherited." msgstr "" +"این بیت در صورتی به ارث می‌رسد که :c:member:`~PyTypeObject.tp_call` نیز به " +"ارث برسد." msgid "as ``_Py_TPFLAGS_HAVE_VECTORCALL``" -msgstr "" +msgstr "به‌عنوان ``_Py_TPFLAGS_HAVE_VECTORCALL``" -msgid "Renamed to the current name, without the leading underscore. The old provisional name is :term:`soft deprecated`." +msgid "" +"Renamed to the current name, without the leading underscore. The old " +"provisional name is :term:`soft deprecated`." msgstr "" +"به نام فعلی تغییر نام یافت، بدون زیرخط ابتدایی. نام آزمایشی قدیمی " +":term:`soft deprecated` است." -msgid "This flag is now removed from a class when the class's :py:meth:`~object.__call__` method is reassigned." +msgid "" +"This flag is now removed from a class when the class's " +":py:meth:`~object.__call__` method is reassigned." msgstr "" +"این پرچم اکنون هنگامی که متد :py:meth:`~object.__call__` کلاس مجدداً انتساب " +"داده شود، از کلاس حذف می‌شود." msgid "This flag can now be inherited by mutable classes." -msgstr "" +msgstr "این پرچم اکنون می‌تواند توسط کلاس‌های تغییرپذیر به ارث برده شود." -msgid "This bit is set for type objects that are immutable: type attributes cannot be set nor deleted." +msgid "" +"This bit is set for type objects that are immutable: type attributes cannot " +"be set nor deleted." msgstr "" +"این بیت برای اشیاء نوعِ تغییرناپذیر تنظیم می‌شود: ویژگی‌های نوع را نمی‌توان " +"تنظیم یا حذف کرد." -msgid ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types `." +msgid "" +":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types" +" `." msgstr "" +":c:func:`PyType_Ready` این پرچم را به‌طور خودکار به :ref:`انواع ایستا " +"` اعمال می‌کند." msgid "This flag is not inherited." -msgstr "" +msgstr "این پرچم به ارث برده نمی‌شود." -msgid "Disallow creating instances of the type: set :c:member:`~PyTypeObject.tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." +msgid "" +"Disallow creating instances of the type: set " +":c:member:`~PyTypeObject.tp_new` to NULL and don't create the ``__new__`` " +"key in the type dictionary." msgstr "" +"ایجاد نمونه از این نوع را ممنوع کنید: :c:member:`~PyTypeObject.tp_new` را " +"برابر NULL قرار دهید و کلید ``__new__`` را در دیکشنری نوع ایجاد نکنید." -msgid "The flag must be set before creating the type, not after. For example, it must be set before :c:func:`PyType_Ready` is called on the type." +msgid "" +"The flag must be set before creating the type, not after. For example, it " +"must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" +"پرچم باید پیش از ایجاد نوع تنظیم شود، نه پس از آن. برای مثال، باید پیش از " +"فراخوانی :c:func:`PyType_Ready` روی نوع تنظیم شود." -msgid "The flag is set automatically on :ref:`static types ` if :c:member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:member:`~PyTypeObject.tp_new` is NULL." +msgid "" +"The flag is set automatically on :ref:`static types ` if " +":c:member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and " +":c:member:`~PyTypeObject.tp_new` is NULL." msgstr "" +"اگر :c:member:`~PyTypeObject.tp_base` برابر NULL یا ``&PyBaseObject_Type`` " +"باشد و :c:member:`~PyTypeObject.tp_new` برابر NULL باشد، این پرچم به‌طور " +"خودکار بر روی :ref:`نوع‌های ایستا ` تنظیم می‌شود." -msgid "This flag is not inherited. However, subclasses will not be instantiable unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is only possible via the C API)." +msgid "" +"This flag is not inherited. However, subclasses will not be instantiable " +"unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " +"only possible via the C API)." msgstr "" +"این پرچم به ارث برده نمی‌شود. با این حال، زیرکلاس‌ها قابل نمونه‌سازی نخواهند" +" بود مگر آنکه یک :c:member:`~PyTypeObject.tp_new` غیر NULL ارائه کنند (که " +"این کار تنها از طریق API زبان C امکان‌پذیر است)." -msgid "To disallow instantiating a class directly but allow instantiating its subclasses (e.g. for an :term:`abstract base class`), do not use this flag. Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." +msgid "" +"To disallow instantiating a class directly but allow instantiating its " +"subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " +"Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" +"برای اینکه نمونه‌سازی مستقیم از یک کلاس ممنوع باشد اما نمونه‌سازی از " +"زیرکلاس‌های آن مجاز باشد (مثلاً برای یک :term:`کلاس پایه انتزاعی `)، از این پرچم استفاده نکنید. در عوض، کاری کنید که " +":c:member:`~PyTypeObject.tp_new` تنها برای زیرکلاس‌ها موفق شود." -msgid "This bit indicates that instances of the class may match mapping patterns when used as the subject of a :keyword:`match` block. It is automatically set when registering or subclassing :class:`collections.abc.Mapping`, and unset when registering :class:`collections.abc.Sequence`." +msgid "" +"This bit indicates that instances of the class may match mapping patterns " +"when used as the subject of a :keyword:`match` block. It is automatically " +"set when registering or subclassing :class:`collections.abc.Mapping`, and " +"unset when registering :class:`collections.abc.Sequence`." msgstr "" +"این بیت نشان می‌دهد که نمونه‌های کلاس، زمانی که به‌عنوان موضوع بلوک " +":keyword:`match` استفاده می‌شوند، می‌توانند با الگوهای نگاشت تطبیق یابند. " +"این بیت هنگام ثبت یا زیرکلاس‌سازی :class:`collections.abc.Mapping` به‌طور " +"خودکار تنظیم می‌شود و هنگام ثبت :class:`collections.abc.Sequence` از تنظیم " +"خارج می‌شود." -msgid ":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are mutually exclusive; it is an error to enable both flags simultaneously." +msgid "" +":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " +"mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" +":c:macro:`Py_TPFLAGS_MAPPING` و :c:macro:`Py_TPFLAGS_SEQUENCE` انحصاری " +"متقابل هستند؛ فعال‌سازی هر دو پرچم به‌طور هم‌زمان خطا است." -msgid "This flag is inherited by types that do not already set :c:macro:`Py_TPFLAGS_SEQUENCE`." +msgid "" +"This flag is inherited by types that do not already set " +":c:macro:`Py_TPFLAGS_SEQUENCE`." msgstr "" +"این پرچم به نوع‌هایی که از پیش :c:macro:`Py_TPFLAGS_SEQUENCE` را تنظیم " +"نکرده‌اند، به ارث می‌رسد." msgid ":pep:`634` -- Structural Pattern Matching: Specification" -msgstr "" +msgstr ":pep:`634` -- تطبیق الگوی ساختاری: مشخصات" -msgid "This bit indicates that instances of the class may match sequence patterns when used as the subject of a :keyword:`match` block. It is automatically set when registering or subclassing :class:`collections.abc.Sequence`, and unset when registering :class:`collections.abc.Mapping`." +msgid "" +"This bit indicates that instances of the class may match sequence patterns " +"when used as the subject of a :keyword:`match` block. It is automatically " +"set when registering or subclassing :class:`collections.abc.Sequence`, and " +"unset when registering :class:`collections.abc.Mapping`." msgstr "" +"این بیت نشان می‌دهد که نمونه‌های کلاس ممکن است هنگامی که به‌عنوان موضوع یک " +"بلوک :keyword:`match` استفاده می‌شوند، با الگوهای دنباله تطبیق یابند. این " +"بیت به‌طور خودکار هنگام ثبت کردن یا زیرکلاس‌سازی " +":class:`collections.abc.Sequence` تنظیم می‌شود و هنگام ثبت کردن " +":class:`collections.abc.Mapping` پاک می‌شود." -msgid "This flag is inherited by types that do not already set :c:macro:`Py_TPFLAGS_MAPPING`." +msgid "" +"This flag is inherited by types that do not already set " +":c:macro:`Py_TPFLAGS_MAPPING`." msgstr "" +"این پرچم توسط نوع‌هایی که از قبل :c:macro:`Py_TPFLAGS_MAPPING` را تنظیم " +"نکرده‌اند، به ارث می‌رسد." -msgid "Internal. Do not set or unset this flag. To indicate that a class has changed call :c:func:`PyType_Modified`" +msgid "" +"Internal. Do not set or unset this flag. To indicate that a class has " +"changed call :c:func:`PyType_Modified`" msgstr "" +"داخلی است. این پرچم را تنظیم یا از تنظیم خارج نکنید. برای نشان دادن اینکه " +"کلاسی تغییر کرده است، :c:func:`PyType_Modified` را فراخوانی کنید" -msgid "This flag is present in header files, but is not be used. It will be removed in a future version of CPython" +msgid "" +"This flag is present in header files, but is not be used. It will be removed" +" in a future version of CPython" msgstr "" +"این پرچم در پرونده‌های سرآیند وجود دارد، اما استفاده نمی‌شود. این پرچم در " +"نسخه‌ای آینده از سی‌پایتون حذف خواهد شد" -msgid "This macro does nothing. Historically, this would indicate that the :c:member:`~PyTypeObject.tp_version_tag` field was available and initialized." +msgid "" +"This macro does nothing. Historically, this would indicate that the " +":c:member:`~PyTypeObject.tp_version_tag` field was available and " +"initialized." msgstr "" +"این ماکرو هیچ کاری انجام نمی‌دهد. در گذشته، این نشان می‌داد که فیلد " +":c:member:`~PyTypeObject.tp_version_tag` موجود و مقداردهی اولیه شده بود." -msgid "This bit indicates that instances of this type will have an \"inline values\" array (containing the object's attributes) placed directly after the end of the object." +msgid "" +"This bit indicates that instances of this type will have an \"inline " +"values\" array (containing the object's attributes) placed directly after " +"the end of the object." msgstr "" +"این بیت نشان می‌دهد که نمونه‌های این نوع، آرایه‌ی «مقادیر درون‌خطی» (inline " +"values) — شامل ویژگی‌های شیء — خواهند داشت که مستقیماً پس از انتهای شیء قرار" +" می‌گیرد." msgid "This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set." msgstr "" +"این امر نیازمند آن است که :c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم شده باشد." -msgid "This bit indicates that this is an abstract type and therefore cannot be instantiated." +msgid "" +"This bit indicates that this is an abstract type and therefore cannot be " +"instantiated." msgstr "" +"این بیت نشان می‌دهد که این یک نوع انتزاعی است و بنابراین نمی‌توان از آن " +"نمونه‌سازی کرد." msgid ":mod:`abc`" -msgstr "" +msgstr ":mod:`abc`" -msgid "Internal. Do not set or unset this flag. Historically, this was a reserved flag for use in Stackless Python." +msgid "" +"Internal. Do not set or unset this flag. Historically, this was a reserved " +"flag for use in Stackless Python." msgstr "" +"داخلی. این پرچم را تنظیم یا از تنظیم خارج نکنید. در گذشته، این پرچم برای " +"استفاده در Stackless Python رزروشده بود." -msgid "This flag is present in header files, but is not be used. This may be removed in a future version of CPython." +msgid "" +"This flag is present in header files, but is not be used. This may be " +"removed in a future version of CPython." msgstr "" +"این پرچم در پرونده‌های سرآیند وجود دارد، اما استفاده نمی‌شود. ممکن است در " +"نسخه‌های آینده‌ی سی‌پایتون حذف شود." -msgid "An optional pointer to a NUL-terminated C string giving the docstring for this type object. This is exposed as the :attr:`~type.__doc__` attribute on the type and instances of the type." +msgid "" +"An optional pointer to a NUL-terminated C string giving the docstring for " +"this type object. This is exposed as the :attr:`~type.__doc__` attribute on" +" the type and instances of the type." msgstr "" +"یک اشاره‌گر اختیاری به رشته‌ی C پایان‌یافته با تهی که رشته‌ی مستند این شیء " +"نوع را ارائه می‌دهد. این رشته‌ی مستند به‌صورت ویژگی :attr:`~type.__doc__` " +"روی نوع و نمونه‌های آن نوع در دسترس قرار می‌گیرد." msgid "This field is *not* inherited by subtypes." -msgstr "" +msgstr "این فیلد توسط زیرنوع‌ها به ارث برده *نمی‌شود*." -msgid "An optional pointer to a traversal function for the garbage collector. This is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature is::" +msgid "" +"An optional pointer to a traversal function for the garbage collector. This" +" is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"signature is::" msgstr "" +"اشاره‌گر اختیاری به تابع پیمایش برای زباله‌روب. این تنها زمانی استفاده " +"می‌شود که بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم شده باشد. امضا به این" +" صورت است::" msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" -msgstr "" +msgstr "int tp_traverse(PyObject *self, visitproc visit, void *arg);" -msgid "More information about Python's garbage collection scheme can be found in section :ref:`supporting-cycle-detection`." +msgid "" +"More information about Python's garbage collection scheme can be found in " +"section :ref:`supporting-cycle-detection`." msgstr "" +"اطلاعات بیشتری درباره‌ی طرح‌واره‌ی زباله‌روبی پایتون را می‌توانید در بخش " +":ref:`supporting-cycle-detection` بیابید." -msgid "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage collector to detect reference cycles. A typical implementation of a :c:member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` on each of the instance's members that are Python objects that the instance owns. For example, this is function :c:func:`!local_traverse` from the :mod:`!_thread` extension module::" -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " +"collector to detect reference cycles. A typical implementation of a " +":c:member:`~PyTypeObject.tp_traverse` function simply calls " +":c:func:`Py_VISIT` on each of the instance's members that are Python objects" +" that the instance owns. For example, this is function " +":c:func:`!local_traverse` from the :mod:`!_thread` extension module::" +msgstr "" +"اشاره‌گر :c:member:`~PyTypeObject.tp_traverse` توسط زباله‌روب برای تشخیص " +"چرخه‌های ارجاع استفاده می‌شود. یک پیاده‌سازی معمول از تابع " +":c:member:`~PyTypeObject.tp_traverse` به‌سادگی :c:func:`Py_VISIT` را روی هر " +"یک از اعضای نمونه که شیءهای پایتونی هستند و نمونه مالک آن‌هاست، فراخوانی " +"می‌کند. برای مثال، این تابع :c:func:`!local_traverse` از ماژول توسعه‌ای " +":mod:`!_thread` است::" msgid "" "static int\n" @@ -1546,120 +2713,365 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"local_traverse(PyObject *op, visitproc visit, void *arg)\n" +"{\n" +" localobject *self = (localobject *) op;\n" +" Py_VISIT(self->args);\n" +" Py_VISIT(self->kw);\n" +" Py_VISIT(self->dict);\n" +" return 0;\n" +"}" -msgid "Note that :c:func:`Py_VISIT` is called only on those members that can participate in reference cycles. Although there is also a ``self->key`` member, it can only be ``NULL`` or a Python string and therefore cannot be part of a reference cycle." +msgid "" +"Note that :c:func:`Py_VISIT` is called only on those members that can " +"participate in reference cycles. Although there is also a ``self->key`` " +"member, it can only be ``NULL`` or a Python string and therefore cannot be " +"part of a reference cycle." msgstr "" +"توجه داشته باشید که :c:func:`Py_VISIT` تنها بر روی اعضایی فراخوانی می‌شود که" +" می‌توانند در چرخه‌های ارجاع شرکت کنند. اگرچه عضو ``self->key`` نیز وجود " +"دارد، اما این عضو تنها می‌تواند ``NULL`` یا یک رشته‌ی پایتون باشد و بنابراین" +" نمی‌تواند بخشی از یک چرخه‌ی ارجاع باشد." -msgid "On the other hand, even if you know a member can never be part of a cycle, as a debugging aid you may want to visit it anyway just so the :mod:`gc` module's :func:`~gc.get_referents` function will include it." +msgid "" +"On the other hand, even if you know a member can never be part of a cycle, " +"as a debugging aid you may want to visit it anyway just so the :mod:`gc` " +"module's :func:`~gc.get_referents` function will include it." msgstr "" +"از سوی دیگر، حتی اگر بدانید که یک عضو هرگز نمی‌تواند بخشی از یک چرخه باشد، " +"ممکن است به عنوان کمکی برای اشکال‌زدایی، به هر حال بخواهید آن را بازدید کنید" +" تا تابع :func:`~gc.get_referents` ماژول :mod:`gc` آن را در بر بگیرد." -msgid "Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" +msgid "" +"Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" msgstr "" +"نوع‌های هیپ (:c:macro:`Py_TPFLAGS_HEAPTYPE`) باید نوع خود را با کد زیر " +"بازدید کنند::" msgid "Py_VISIT(Py_TYPE(self));" -msgstr "" +msgstr "Py_VISIT(Py_TYPE(self));" -msgid "It is only needed since Python 3.9. To support Python 3.8 and older, this line must be conditional::" +msgid "" +"It is only needed since Python 3.9. To support Python 3.8 and older, this " +"line must be conditional::" msgstr "" +"این تنها از پایتون 3.9 به بعد مورد نیاز است. برای پشتیبانی از پایتون 3.8 و " +"نسخه‌های قدیمی‌تر، این سطر باید شرطی باشد::" msgid "" "#if PY_VERSION_HEX >= 0x03090000\n" " Py_VISIT(Py_TYPE(self));\n" "#endif" msgstr "" +"#if PY_VERSION_HEX >= 0x03090000\n" +" Py_VISIT(Py_TYPE(self));\n" +"#endif" -msgid "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:`PyObject_VisitManagedDict` like this::" +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the " +":c:member:`~PyTypeObject.tp_flags` field, the traverse function must call " +":c:func:`PyObject_VisitManagedDict` like this::" msgstr "" +"اگر بیت :c:macro:`Py_TPFLAGS_MANAGED_DICT` در فیلد " +":c:member:`~PyTypeObject.tp_flags` تنظیم شده باشد، تابع پیمایش باید " +":c:func:`PyObject_VisitManagedDict` را به این شکل فراخوانی کند::" msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" -msgstr "" +msgstr "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" -msgid "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members that the instance *owns* (by having :term:`strong references ` to them) must be visited. For instance, if an object supports weak references via the :c:member:`~PyTypeObject.tp_weaklist` slot, the pointer supporting the linked list (what *tp_weaklist* points to) must **not** be visited as the instance does not directly own the weak references to itself (the weakreference list is there to support the weak reference machinery, but the instance has no strong reference to the elements inside it, as they are allowed to be removed even if the instance is still alive)." -msgstr "" +msgid "" +"When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " +"that the instance *owns* (by having :term:`strong references ` to them) must be visited. For instance, if an object supports " +"weak references via the :c:member:`~PyTypeObject.tp_weaklist` slot, the " +"pointer supporting the linked list (what *tp_weaklist* points to) must " +"**not** be visited as the instance does not directly own the weak references" +" to itself (the weakreference list is there to support the weak reference " +"machinery, but the instance has no strong reference to the elements inside " +"it, as they are allowed to be removed even if the instance is still alive)." +msgstr "" +"هنگام پیاده‌سازی :c:member:`~PyTypeObject.tp_traverse`، فقط اعضایی که نمونه " +"*مالک* آن‌هاست (با داشتن :term:`ارجاع‌های قوی ` به آن‌ها) " +"باید بازدید شوند. برای مثال، اگر یک شیء از طریق جایگاه " +":c:member:`~PyTypeObject.tp_weaklist` از ارجاع‌های ضعیف پشتیبانی کند، " +"اشاره‌گری که فهرست پیوندی را پشتیبانی می‌کند (چیزی که *tp_weaklist* به آن " +"اشاره می‌کند) **نباید** بازدید شود، زیرا نمونه به‌طور مستقیم مالک ارجاع‌های " +"ضعیف به خود نیست (فهرست ارجاع‌های ضعیف وجود دارد تا از سازوکار ارجاع ضعیف " +"پشتیبانی کند، اما نمونه ارجاع قوی به عناصر درون آن ندارد، زیرا اجازه داده " +"می‌شود آن‌ها حتی اگر نمونه هنوز زنده باشد حذف شوند)." -msgid "The traversal function must not have any side effects. It must not modify the reference counts of any Python objects nor create or destroy any Python objects." +msgid "" +"The traversal function must not have any side effects. It must not modify " +"the reference counts of any Python objects nor create or destroy any Python " +"objects." msgstr "" +"تابع پیمایش نباید هیچ اثر جانبی داشته باشد. این تابع نباید شمارش ارجاع هیچ " +"شیء پایتونی را تغییر دهد و نه هیچ شیء پایتونی را ایجاد یا نابود کند." -msgid "Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to :c:func:`!local_traverse` to have these specific names; don't name them just anything." +msgid "" +"Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to " +":c:func:`!local_traverse` to have these specific names; don't name them just" +" anything." msgstr "" +"توجه داشته باشید که :c:func:`Py_VISIT` نیازمند آن است که پارامترهای *visit* " +"و *arg* در :c:func:`!local_traverse` دقیقاً همین نام‌ها را داشته باشند؛ " +"آن‌ها را با هر نامی نام‌گذاری نکنید." -msgid "Instances of :ref:`heap-allocated types ` hold a reference to their type. Their traversal function must therefore either visit :c:func:`Py_TYPE(self) `, or delegate this responsibility by calling ``tp_traverse`` of another heap-allocated type (such as a heap-allocated superclass). If they do not, the type object may not be garbage-collected." -msgstr "" +msgid "" +"Instances of :ref:`heap-allocated types ` hold a reference to " +"their type. Their traversal function must therefore either visit " +":c:func:`Py_TYPE(self) `, or delegate this responsibility by " +"calling ``tp_traverse`` of another heap-allocated type (such as a heap-" +"allocated superclass). If they do not, the type object may not be garbage-" +"collected." +msgstr "" +"نمونه‌های :ref:`نوع‌های تخصیص‌یافته در هیپ ` ارجاعی به نوع خود " +"نگه می‌دارند. بنابراین تابع پیمایش آن‌ها باید یا :c:func:`Py_TYPE(self) " +"` را بازدید کند، یا این مسئولیت را با فراخوانی ``tp_traverse`` یک " +"نوع تخصیص‌یافته در هیپ دیگر (مانند یک ابرکلاس تخصیص‌یافته در هیپ) واگذار " +"کند. اگر چنین نکنند، ممکن است شیء نوع زباله‌روبی نشود." -msgid "The :c:member:`~PyTypeObject.tp_traverse` function can be called from any thread." +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` function can be called from any " +"thread." msgstr "" +"تابع :c:member:`~PyTypeObject.tp_traverse` را می‌توان از هر نخی فراخوانی " +"کرد." -msgid "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in ``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." +msgid "" +"Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " +"``tp_traverse``. In earlier versions of Python, due to `bug 40217 " +"`_, doing this may lead to crashes in " +"subclasses." msgstr "" +"انتظار می‌رود که نوع‌های تخصیص‌یافته در هیپ، ``Py_TYPE(self)`` را در " +"``tp_traverse`` بازدید کنند. در نسخه‌های پیشین پایتون، به دلیل `باگ 40217 " +"`_، انجام این کار ممکن است در زیرکلاس‌ها" +" به فروپاشی منجر شود." -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` are all inherited from the base type if they are all zero in the subtype." +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` " +"flag bit: the flag bit, :c:member:`~PyTypeObject.tp_traverse`, and " +":c:member:`~PyTypeObject.tp_clear` are all inherited from the base type if " +"they are all zero in the subtype." msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_clear` و بیت پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` توسط زیرنوع‌ها به ارث برده می‌شود: بیت پرچم، " +":c:member:`~PyTypeObject.tp_traverse` و :c:member:`~PyTypeObject.tp_clear` " +"همگی در صورتی از نوع پایه به ارث برده می‌شوند که هر سه در زیرنوع صفر باشند." msgid "An optional pointer to a clear function. The signature is::" -msgstr "" +msgstr "اشاره‌گر اختیاری به تابع پاک‌سازی. امضا به این صورت است::" msgid "int tp_clear(PyObject *);" -msgstr "" +msgstr "int tp_clear(PyObject *);" -msgid "The purpose of this function is to break reference cycles that are causing a :term:`cyclic isolate` so that the objects can be safely destroyed. A cleared object is a partially destroyed object; the object is not obligated to satisfy design invariants held during normal use." +msgid "" +"The purpose of this function is to break reference cycles that are causing a" +" :term:`cyclic isolate` so that the objects can be safely destroyed. A " +"cleared object is a partially destroyed object; the object is not obligated " +"to satisfy design invariants held during normal use." msgstr "" +"هدف از این تابع، شکستن چرخه‌های ارجاعی است که یک :term:`cyclic isolate` " +"ایجاد می‌کنند تا اشیاء بتوانند به‌طور ایمن نابود شوند. شیء پاک‌سازی‌شده شیئی" +" است که به‌طور جزئی نابود شده است؛ این شیء موظف نیست ناوردهای طراحی‌ای را که" +" در استفاده‌ی عادی برقرارند رعایت کند." -msgid ":c:member:`!tp_clear` does not need to delete references to objects that can't participate in reference cycles, such as Python strings or Python integers. However, it may be convenient to clear all references, and write the type's :c:member:`~PyTypeObject.tp_dealloc` function to invoke :c:member:`!tp_clear` to avoid code duplication. (Beware that :c:member:`!tp_clear` might have already been called. Prefer calling idempotent functions like :c:func:`Py_CLEAR`.)" -msgstr "" +msgid "" +":c:member:`!tp_clear` does not need to delete references to objects that " +"can't participate in reference cycles, such as Python strings or Python " +"integers. However, it may be convenient to clear all references, and write " +"the type's :c:member:`~PyTypeObject.tp_dealloc` function to invoke " +":c:member:`!tp_clear` to avoid code duplication. (Beware that " +":c:member:`!tp_clear` might have already been called. Prefer calling " +"idempotent functions like :c:func:`Py_CLEAR`.)" +msgstr "" +":c:member:`!tp_clear` نیازی به حذف ارجاعات به اشیایی ندارد که نمی‌توانند در " +"چرخه‌های ارجاع شرکت کنند، مانند رشته‌های پایتون یا اعداد صحیح پایتون. با این" +" حال، ممکن است پاک‌کردن همه‌ی ارجاعات و نوشتن تابع " +":c:member:`~PyTypeObject.tp_dealloc` نوع به‌گونه‌ای که :c:member:`!tp_clear`" +" را فراخوانی کند، برای جلوگیری از تکرار کد مناسب باشد. (مراقب باشید که ممکن " +"است :c:member:`!tp_clear` قبلاً فراخوانی شده باشد. فراخوانی توابع هم‌توان " +"مانند :c:func:`Py_CLEAR` را ترجیح دهید.)" -msgid "Any non-trivial cleanup should be performed in :c:member:`~PyTypeObject.tp_finalize` instead of :c:member:`!tp_clear`." +msgid "" +"Any non-trivial cleanup should be performed in " +":c:member:`~PyTypeObject.tp_finalize` instead of :c:member:`!tp_clear`." msgstr "" +"هرگونه پاک‌سازی غیر‌ساده باید به‌جای :c:member:`!tp_clear` در " +":c:member:`~PyTypeObject.tp_finalize` انجام شود." -msgid "If :c:member:`!tp_clear` fails to break a reference cycle then the objects in the :term:`cyclic isolate` may remain indefinitely uncollectable (\"leak\"). See :data:`gc.garbage`." +msgid "" +"If :c:member:`!tp_clear` fails to break a reference cycle then the objects " +"in the :term:`cyclic isolate` may remain indefinitely uncollectable " +"(\"leak\"). See :data:`gc.garbage`." msgstr "" +"اگر :c:member:`!tp_clear` نتواند یک چرخه ارجاع را بشکند، ممکن است اشیاء درون" +" :term:`cyclic isolate` به‌طور نامحدود غیرقابل جمع‌آوری باقی بمانند («نشت»)." +" :data:`gc.garbage` را ببینید." -msgid "Referents (direct and indirect) might have already been cleared; they are not guaranteed to be in a consistent state." +msgid "" +"Referents (direct and indirect) might have already been cleared; they are " +"not guaranteed to be in a consistent state." msgstr "" +"ارجاع‌شونده‌ها (referents) — مستقیم و غیرمستقیم — ممکن است از پیش پاک‌سازی " +"شده باشند؛ تضمینی نیست که در وضعیتی سازگار باشند." -msgid "The :c:member:`~PyTypeObject.tp_clear` function can be called from any thread." +msgid "" +"The :c:member:`~PyTypeObject.tp_clear` function can be called from any " +"thread." msgstr "" +"تابع :c:member:`~PyTypeObject.tp_clear` را می‌توان از هر نخی فراخوانی کرد." -msgid "An object is not guaranteed to be automatically cleared before its destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called." +msgid "" +"An object is not guaranteed to be automatically cleared before its " +"destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called." msgstr "" +"تضمین نمی‌شود که یک شیء پیش از فراخوانی مخرب آن " +"(:c:member:`~PyTypeObject.tp_dealloc`) به‌طور خودکار پاک‌سازی شود." -msgid "This function differs from the destructor (:c:member:`~PyTypeObject.tp_dealloc`) in the following ways:" +msgid "" +"This function differs from the destructor " +"(:c:member:`~PyTypeObject.tp_dealloc`) in the following ways:" msgstr "" +"این تابع به روش‌های زیر با مخرب (:c:member:`~PyTypeObject.tp_dealloc`) تفاوت" +" دارد:" -msgid "The purpose of clearing an object is to remove references to other objects that might participate in a reference cycle. The purpose of the destructor, on the other hand, is a superset: it must release *all* resources it owns, including references to objects that cannot participate in a reference cycle (e.g., integers) as well as the object's own memory (by calling :c:member:`~PyTypeObject.tp_free`)." -msgstr "" +msgid "" +"The purpose of clearing an object is to remove references to other objects " +"that might participate in a reference cycle. The purpose of the destructor," +" on the other hand, is a superset: it must release *all* resources it owns, " +"including references to objects that cannot participate in a reference cycle" +" (e.g., integers) as well as the object's own memory (by calling " +":c:member:`~PyTypeObject.tp_free`)." +msgstr "" +"هدف از پاک‌سازی یک شیء، حذف ارجاع‌ها به اشیاء دیگری است که ممکن است در چرخه " +"ارجاع شرکت کنند. از سوی دیگر، هدف مخرب ابرمجموعه‌ای از آن است: مخرب باید " +"*همه* منابعی را که در اختیار دارد آزاد کند، از جمله ارجاع‌ها به اشیائی که " +"نمی‌توانند در چرخه ارجاع شرکت کنند (مانند اعداد صحیح) و همچنین حافظه‌ی خودِ " +"شیء (با فراخوانی :c:member:`~PyTypeObject.tp_free`)." -msgid "When :c:member:`!tp_clear` is called, other objects might still hold references to the object being cleared. Because of this, :c:member:`!tp_clear` must not deallocate the object's own memory (:c:member:`~PyTypeObject.tp_free`). The destructor, on the other hand, is only called when no (strong) references exist, and as such, must safely destroy the object itself by deallocating it." -msgstr "" +msgid "" +"When :c:member:`!tp_clear` is called, other objects might still hold " +"references to the object being cleared. Because of this, " +":c:member:`!tp_clear` must not deallocate the object's own memory " +"(:c:member:`~PyTypeObject.tp_free`). The destructor, on the other hand, is " +"only called when no (strong) references exist, and as such, must safely " +"destroy the object itself by deallocating it." +msgstr "" +"وقتی :c:member:`!tp_clear` فراخوانی می‌شود، ممکن است اشیاء دیگر همچنان " +"ارجاع‌هایی به شیءِ در حال پاک‌شدن داشته باشند. به همین دلیل، " +":c:member:`!tp_clear` نباید حافظه‌ی خودِ شیء را آزاد کند " +"(:c:member:`~PyTypeObject.tp_free`). از سوی دیگر، مخرب تنها زمانی فراخوانی " +"می‌شود که هیچ ارجاعی (قوی) وجود نداشته باشد، و از این رو، باید خودِ شیء را " +"با آزاد کردن آن به‌طور ایمن نابود کند." -msgid ":c:member:`!tp_clear` might never be automatically called. An object's destructor, on the other hand, will be automatically called some time after the object becomes unreachable (i.e., either there are no references to the object or the object is a member of a :term:`cyclic isolate`)." +msgid "" +":c:member:`!tp_clear` might never be automatically called. An object's " +"destructor, on the other hand, will be automatically called some time after " +"the object becomes unreachable (i.e., either there are no references to the " +"object or the object is a member of a :term:`cyclic isolate`)." msgstr "" +":c:member:`!tp_clear` ممکن است هرگز به‌طور خودکار فراخوانی نشود. از سوی " +"دیگر، مخرب (destructor) یک شیء، مدتی پس از دسترس‌ناپذیر شدن شیء به‌طور " +"خودکار فراخوانی می‌شود (یعنی، یا هیچ ارجاعی به شیء وجود ندارد یا شیء عضوی از" +" یک :term:`cyclic isolate` است)." -msgid "No guarantees are made about when, if, or how often Python automatically clears an object, except:" +msgid "" +"No guarantees are made about when, if, or how often Python automatically " +"clears an object, except:" msgstr "" +"هیچ تضمینی درباره‌ی اینکه پایتون چه زمانی، آیا اصلاً، یا هر چند وقت یک‌بار " +"یک شیء را به‌طور خودکار پاک می‌کند ارائه نمی‌شود، مگر در موارد زیر:" -msgid "Python will not automatically clear an object if it is reachable, i.e., there is a reference to it and it is not a member of a :term:`cyclic isolate`." +msgid "" +"Python will not automatically clear an object if it is reachable, i.e., " +"there is a reference to it and it is not a member of a :term:`cyclic " +"isolate`." msgstr "" +"پایتون به‌طور خودکار شیئی را پاک نمی‌کند که دسترسی‌پذیر باشد؛ یعنی ارجاعی به" +" آن وجود داشته باشد و عضوی از :term:`cyclic isolate` نباشد." -msgid "Python will not automatically clear an object if it has not been automatically finalized (see :c:member:`~PyTypeObject.tp_finalize`). (If the finalizer resurrected the object, the object may or may not be automatically finalized again before it is cleared.)" +msgid "" +"Python will not automatically clear an object if it has not been " +"automatically finalized (see :c:member:`~PyTypeObject.tp_finalize`). (If " +"the finalizer resurrected the object, the object may or may not be " +"automatically finalized again before it is cleared.)" msgstr "" +"اگر یک شیء به‌طور خودکار نهایی‌سازی نشده باشد، پایتون آن را به‌طور خودکار " +"پاک نمی‌کند (به :c:member:`~PyTypeObject.tp_finalize` مراجعه کنید). (اگر " +"نهایی‌ساز شیء را احیا کرده باشد، ممکن است شیء پیش از پاک شدن، دوباره به‌طور " +"خودکار نهایی‌سازی شود یا نشود.)" -msgid "If an object is a member of a :term:`cyclic isolate`, Python will not automatically clear it if any member of the cyclic isolate has not yet been automatically finalized (:c:member:`~PyTypeObject.tp_finalize`)." +msgid "" +"If an object is a member of a :term:`cyclic isolate`, Python will not " +"automatically clear it if any member of the cyclic isolate has not yet been " +"automatically finalized (:c:member:`~PyTypeObject.tp_finalize`)." msgstr "" +"اگر شیئی عضوی از یک :term:`cyclic isolate` باشد، پایتون در صورتی که عضوی از " +"cyclic isolate هنوز به‌طور خودکار نهایی‌سازی نشده باشد، آن را به‌طور خودکار " +"پاک نمی‌کند (:c:member:`~PyTypeObject.tp_finalize`)." -msgid "Python will not destroy an object until after any automatic calls to its :c:member:`!tp_clear` function have returned. This ensures that the act of breaking a reference cycle does not invalidate the ``self`` pointer while :c:member:`!tp_clear` is still executing." +msgid "" +"Python will not destroy an object until after any automatic calls to its " +":c:member:`!tp_clear` function have returned. This ensures that the act of " +"breaking a reference cycle does not invalidate the ``self`` pointer while " +":c:member:`!tp_clear` is still executing." msgstr "" +"پایتون تا پس از بازگشت هرگونه فراخوانی خودکار تابع :c:member:`!tp_clear` یک " +"شیء، آن را نابود نمی‌کند. این تضمین می‌کند که عمل شکستن چرخه ارجاع، " +"اشاره‌گر ``self`` را در حالی که :c:member:`!tp_clear` هنوز در حال اجراست، " +"نامعتبر نکند." -msgid "Python will not automatically call :c:member:`!tp_clear` multiple times concurrently." +msgid "" +"Python will not automatically call :c:member:`!tp_clear` multiple times " +"concurrently." msgstr "" +"پایتون به‌طور خودکار :c:member:`!tp_clear` را چندین بار به‌طور همزمان " +"فراخوانی نمی‌کند." -msgid "CPython currently only automatically clears objects as needed to break reference cycles in a :term:`cyclic isolate`, but future versions might clear objects regularly before their destruction." +msgid "" +"CPython currently only automatically clears objects as needed to break " +"reference cycles in a :term:`cyclic isolate`, but future versions might " +"clear objects regularly before their destruction." msgstr "" +"سی‌پایتون در حال حاضر اشیاء را تنها زمانی به‌طور خودکار پاک‌سازی می‌کند که " +"برای شکستن چرخه‌های ارجاع در یک :term:`cyclic isolate` نیاز باشد، اما " +"نسخه‌های آینده ممکن است اشیاء را به‌طور منظم پیش از تخریبشان پاک‌سازی کنند." -msgid "Taken together, all :c:member:`~PyTypeObject.tp_clear` functions in the system must combine to break all reference cycles. This is subtle, and if in any doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For example, the tuple type does not implement a :c:member:`~PyTypeObject.tp_clear` function, because it's possible to prove that no reference cycle can be composed entirely of tuples. Therefore the :c:member:`~PyTypeObject.tp_clear` functions of other types are responsible for breaking any cycle containing a tuple. This isn't immediately obvious, and there's rarely a good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." -msgstr "" +msgid "" +"Taken together, all :c:member:`~PyTypeObject.tp_clear` functions in the " +"system must combine to break all reference cycles. This is subtle, and if " +"in any doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For " +"example, the tuple type does not implement a " +":c:member:`~PyTypeObject.tp_clear` function, because it's possible to prove " +"that no reference cycle can be composed entirely of tuples. Therefore the " +":c:member:`~PyTypeObject.tp_clear` functions of other types are responsible " +"for breaking any cycle containing a tuple. This isn't immediately obvious, " +"and there's rarely a good reason to avoid implementing " +":c:member:`~PyTypeObject.tp_clear`." +msgstr "" +"در مجموع، همه‌ی توابع :c:member:`~PyTypeObject.tp_clear` در سیستم باید با هم" +" تمام چرخه‌های ارجاع را بشکنند. این موضوع ظریف است، و در صورت وجود هرگونه " +"شک، یک تابع :c:member:`~PyTypeObject.tp_clear` ارائه دهید. برای مثال، نوع " +"تاپل تابع :c:member:`~PyTypeObject.tp_clear` را پیاده‌سازی نمی‌کند، زیرا " +"می‌توان اثبات کرد که هیچ چرخه‌ی ارجاعی نمی‌تواند به‌طور کامل از تاپل‌ها " +"تشکیل شود. بنابراین توابع :c:member:`~PyTypeObject.tp_clear` انواع دیگر " +"مسئول شکستن هر چرخه‌ای هستند که شامل یک تاپل باشد. این موضوع در نگاه اول " +"آشکار نیست، و به‌ندرت دلیل خوبی برای اجتناب از پیاده‌سازی " +":c:member:`~PyTypeObject.tp_clear` وجود دارد." -msgid "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the instance's references to those of its members that may be Python objects, and set its pointers to those members to ``NULL``, as in the following example::" +msgid "" +"Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " +"instance's references to those of its members that may be Python objects, " +"and set its pointers to those members to ``NULL``, as in the following " +"example::" msgstr "" +"پیاده‌سازی‌های :c:member:`~PyTypeObject.tp_clear` باید ارجاع‌های نمونه به " +"آن‌هایی از اعضایش که ممکن است اشیاء پایتون باشند را رها کنند و اشاره‌گرهایش " +"به آن اعضا را برابر ``NULL`` قرار دهند، همانند مثال زیر::" msgid "" "static int\n" @@ -1673,438 +3085,1141 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"local_clear(PyObject *op)\n" +"{\n" +" localobject *self = (localobject *) op;\n" +" Py_CLEAR(self->key);\n" +" Py_CLEAR(self->args);\n" +" Py_CLEAR(self->kw);\n" +" Py_CLEAR(self->dict);\n" +" return 0;\n" +"}" -msgid "The :c:func:`Py_CLEAR` macro should be used, because clearing references is delicate: the reference to the contained object must not be released (via :c:func:`Py_DECREF`) until after the pointer to the contained object is set to ``NULL``. This is because releasing the reference may cause the contained object to become trash, triggering a chain of reclamation activity that may include invoking arbitrary Python code (due to finalizers, or weakref callbacks, associated with the contained object). If it's possible for such code to reference *self* again, it's important that the pointer to the contained object be ``NULL`` at that time, so that *self* knows the contained object can no longer be used. The :c:func:`Py_CLEAR` macro performs the operations in a safe order." -msgstr "" +msgid "" +"The :c:func:`Py_CLEAR` macro should be used, because clearing references is " +"delicate: the reference to the contained object must not be released (via " +":c:func:`Py_DECREF`) until after the pointer to the contained object is set " +"to ``NULL``. This is because releasing the reference may cause the " +"contained object to become trash, triggering a chain of reclamation activity" +" that may include invoking arbitrary Python code (due to finalizers, or " +"weakref callbacks, associated with the contained object). If it's possible " +"for such code to reference *self* again, it's important that the pointer to " +"the contained object be ``NULL`` at that time, so that *self* knows the " +"contained object can no longer be used. The :c:func:`Py_CLEAR` macro " +"performs the operations in a safe order." +msgstr "" +"باید از ماکروی :c:func:`Py_CLEAR` استفاده کرد، زیرا پاک‌سازی ارجاع‌ها امری " +"ظریف است: ارجاع به شیء درون‌گرفته نباید (از طریق :c:func:`Py_DECREF`) آزاد " +"شود، مگر پس از آنکه اشاره‌گر به شیء درون‌گرفته برابر ``NULL`` قرار گرفته " +"باشد. دلیل این امر آن است که آزاد کردن ارجاع ممکن است باعث شود شیء " +"درون‌گرفته به زباله تبدیل شود و زنجیره‌ای از فعالیت بازیافت را فعال کند که " +"ممکن است شامل فراخوانی کد دلخواه پایتون باشد (به دلیل نهایی‌سازها یا " +"کال‌بک‌های weakref مرتبط با شیء درون‌گرفته). اگر چنین کدی بتواند دوباره به " +"*self* ارجاع کند، مهم است که اشاره‌گر به شیء درون‌گرفته در آن لحظه برابر " +"``NULL`` باشد، تا *self* بداند که شیء درون‌گرفته دیگر قابل استفاده نیست. " +"ماکروی :c:func:`Py_CLEAR` عملیات‌ها را به ترتیبی ایمن انجام می‌دهد." -msgid "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:`~PyTypeObject.tp_flags` field, the clear function must call :c:func:`PyObject_ClearManagedDict` like this::" +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the " +":c:member:`~PyTypeObject.tp_flags` field, the clear function must call " +":c:func:`PyObject_ClearManagedDict` like this::" msgstr "" +"اگر بیت :c:macro:`Py_TPFLAGS_MANAGED_DICT` در فیلد " +":c:member:`~PyTypeObject.tp_flags` تنظیم شده باشد، تابع پاک‌سازی باید " +":c:func:`PyObject_ClearManagedDict` را به این شکل فراخوانی کند::" msgid "PyObject_ClearManagedDict((PyObject*)self);" -msgstr "" +msgstr "PyObject_ClearManagedDict((PyObject*)self);" -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` are all inherited from the base type if they are all zero in the subtype." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` " +"flag bit: the flag bit, :c:member:`~PyTypeObject.tp_traverse`, and " +":c:member:`~PyTypeObject.tp_clear` are all inherited from the base type if " +"they are all zero in the subtype." +msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_traverse` و بیت پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` توسط زیرنوع‌ها به ارث برده می‌شود: اگر بیت " +"پرچم، :c:member:`~PyTypeObject.tp_traverse` و " +":c:member:`~PyTypeObject.tp_clear` در زیرنوع همگی صفر باشند، از نوع پایه به " +"ارث برده می‌شوند." -msgid "An optional pointer to the rich comparison function, whose signature is::" +msgid "" +"An optional pointer to the rich comparison function, whose signature is::" msgstr "" +"یک اشاره‌گر اختیاری به تابع مقایسه‌ی غنی (rich comparison)، که امضای آن به " +"صورت زیر است::" msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" -msgstr "" +msgstr "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" -msgid "The first parameter is guaranteed to be an instance of the type that is defined by :c:type:`PyTypeObject`." +msgid "" +"The first parameter is guaranteed to be an instance of the type that is " +"defined by :c:type:`PyTypeObject`." msgstr "" +"تضمین می‌شود که پارامتر اول، نمونه‌ای از نوعی باشد که توسط " +":c:type:`PyTypeObject` تعریف شده است." -msgid "The function should return the result of the comparison (usually ``Py_True`` or ``Py_False``). If the comparison is undefined, it must return ``Py_NotImplemented``, if another error occurred it must return ``NULL`` and set an exception condition." +msgid "" +"The function should return the result of the comparison (usually ``Py_True``" +" or ``Py_False``). If the comparison is undefined, it must return " +"``Py_NotImplemented``, if another error occurred it must return ``NULL`` and" +" set an exception condition." msgstr "" +"تابع باید نتیجه‌ی مقایسه را برگرداند (معمولاً ``Py_True`` یا ``Py_False``)." +" اگر مقایسه تعریف‌نشده باشد، باید ``Py_NotImplemented`` را برگرداند، و اگر " +"خطای دیگری رخ داده باشد، باید ``NULL`` برگرداند و یک وضعیت استثنا را تنظیم " +"کند." -msgid "The following constants are defined to be used as the third argument for :c:member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" +msgid "" +"The following constants are defined to be used as the third argument for " +":c:member:`~PyTypeObject.tp_richcompare` and for " +":c:func:`PyObject_RichCompare`:" msgstr "" +"ثابت‌های زیر برای استفاده به‌عنوان آرگومان سومِ " +":c:member:`~PyTypeObject.tp_richcompare` و :c:func:`PyObject_RichCompare` " +"تعریف شده‌اند:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Comparison" -msgstr "" +msgstr "مقایسه" msgid "``<``" -msgstr "" +msgstr "``<``" msgid "``<=``" -msgstr "" +msgstr "``<=``" msgid "``==``" -msgstr "" +msgstr "``==``" msgid "``!=``" -msgstr "" +msgstr "``!=``" msgid "``>``" -msgstr "" +msgstr "``>``" msgid "``>=``" -msgstr "" +msgstr "``>=``" -msgid "The following macro is defined to ease writing rich comparison functions:" +msgid "" +"The following macro is defined to ease writing rich comparison functions:" msgstr "" +"ماکروی زیر برای آسان‌سازی نوشتن توابع مقایسه‌ی غنی (rich comparison) " +"تعریف‌شده است:" -msgid "Return ``Py_True`` or ``Py_False`` from the function, depending on the result of a comparison. VAL_A and VAL_B must be orderable by C comparison operators (for example, they may be C ints or floats). The third argument specifies the requested operation, as for :c:func:`PyObject_RichCompare`." +msgid "" +"Return ``Py_True`` or ``Py_False`` from the function, depending on the " +"result of a comparison. VAL_A and VAL_B must be orderable by C comparison " +"operators (for example, they may be C ints or floats). The third argument " +"specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" +"بسته به نتیجه‌ی مقایسه، ``Py_True`` یا ``Py_False`` را از تابع برگردانید. " +"VAL_A و VAL_B باید با عملگرهای مقایسه‌ی C قابل مرتب‌سازی باشند (برای مثال، " +"ممکن است اعداد صحیح یا ممیز شناور در C باشند). آرگومان سوم، عملیات درخواستی " +"را مشخص می‌کند، همان‌گونه که برای :c:func:`PyObject_RichCompare` است." msgid "The returned value is a new :term:`strong reference`." -msgstr "" +msgstr "مقدار بازگشتی یک :term:`ارجاع قوی ` جدید است." msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" +"در صورت خطا، یک استثنا تنظیم می‌کند و ``NULL`` را از تابع برمی‌گرداند." -msgid "This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` when the subtype's :c:member:`~PyTypeObject.tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." -msgstr "" +msgid "" +"This field is inherited by subtypes together with " +":c:member:`~PyTypeObject.tp_hash`: a subtype inherits " +":c:member:`~PyTypeObject.tp_richcompare` and " +":c:member:`~PyTypeObject.tp_hash` when the subtype's " +":c:member:`~PyTypeObject.tp_richcompare` and " +":c:member:`~PyTypeObject.tp_hash` are both ``NULL``." +msgstr "" +"این فیلد به همراه :c:member:`~PyTypeObject.tp_hash` توسط زیرنوع‌ها به ارث " +"برده می‌شود: زیرنوع زمانی :c:member:`~PyTypeObject.tp_richcompare` و " +":c:member:`~PyTypeObject.tp_hash` را به ارث می‌برد که هر دو " +":c:member:`~PyTypeObject.tp_richcompare` و :c:member:`~PyTypeObject.tp_hash`" +" آن ``NULL`` باشند." -msgid ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject.tp_richcompare` implementation, which may be inherited. However, if only :c:member:`~PyTypeObject.tp_hash` is defined, not even the inherited function is used and instances of the type will not be able to participate in any comparisons." -msgstr "" +msgid "" +":c:data:`PyBaseObject_Type` provides a " +":c:member:`~PyTypeObject.tp_richcompare` implementation, which may be " +"inherited. However, if only :c:member:`~PyTypeObject.tp_hash` is defined, " +"not even the inherited function is used and instances of the type will not " +"be able to participate in any comparisons." +msgstr "" +":c:data:`PyBaseObject_Type` یک پیاده‌سازی از " +":c:member:`~PyTypeObject.tp_richcompare` فراهم می‌کند که ممکن است به ارث " +"برده شود. با این حال، اگر تنها :c:member:`~PyTypeObject.tp_hash` تعریف شده " +"باشد، حتی تابع به‌ارث‌رسیده هم استفاده نمی‌شود و نمونه‌های این نوع " +"نمی‌توانند در هیچ مقایسه‌ای شرکت کنند." -msgid "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` should be used instead, if at all possible." +msgid "" +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " +"should be used instead, if at all possible." msgstr "" +"هرچند این فیلد همچنان پشتیبانی می‌شود، تا جای ممکن باید به جای آن از " +":c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` استفاده شود." -msgid "If the instances of this type are weakly referenceable, this field is greater than zero and contains the offset in the instance structure of the weak reference list head (ignoring the GC header, if present); this offset is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` functions. The instance structure needs to include a field of type :c:expr:`PyObject*` which is initialized to ``NULL``." -msgstr "" +msgid "" +"If the instances of this type are weakly referenceable, this field is " +"greater than zero and contains the offset in the instance structure of the " +"weak reference list head (ignoring the GC header, if present); this offset " +"is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` " +"functions. The instance structure needs to include a field of type " +":c:expr:`PyObject*` which is initialized to ``NULL``." +msgstr "" +"اگر نمونه‌های این نوع قابل ارجاع ضعیف باشند، این فیلد بزرگ‌تر از صفر است و " +"آفست سر فهرست ارجاع‌های ضعیف در ساختار نمونه را در بر می‌گیرد (با نادیده " +"گرفتن سرآیند GC، در صورت وجود)؛ این آفست توسط " +":c:func:`PyObject_ClearWeakRefs` و توابع ``PyWeakref_*`` استفاده می‌شود. " +"ساختار نمونه باید شامل یک فیلد از نوع :c:expr:`PyObject*` باشد که با " +"``NULL`` مقداردهی اولیه می‌شود." -msgid "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that is the list head for weak references to the type object itself." +msgid "" +"Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " +"is the list head for weak references to the type object itself." msgstr "" +"این فیلد را با :c:member:`~PyTypeObject.tp_weaklist` اشتباه نگیرید؛ آن، سر " +"فهرست ارجاع‌های ضعیف به خودِ شیء نوع است." -msgid "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit and :c:member:`~PyTypeObject.tp_weaklistoffset`." +msgid "" +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit and" +" :c:member:`~PyTypeObject.tp_weaklistoffset`." msgstr "" +"تنظیم کردن هم بیت :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` و هم " +":c:member:`~PyTypeObject.tp_weaklistoffset` خطا است." -msgid "This field is inherited by subtypes, but see the rules listed below. A subtype may override this offset; this means that the subtype uses a different weak reference list head than the base type. Since the list head is always found via :c:member:`~PyTypeObject.tp_weaklistoffset`, this should not be a problem." -msgstr "" +msgid "" +"This field is inherited by subtypes, but see the rules listed below. A " +"subtype may override this offset; this means that the subtype uses a " +"different weak reference list head than the base type. Since the list head " +"is always found via :c:member:`~PyTypeObject.tp_weaklistoffset`, this should" +" not be a problem." +msgstr "" +"این فیلد توسط زیرنوع‌ها به ارث برده می‌شود، اما به قواعد فهرست‌شده در پایین " +"مراجعه کنید. یک زیرنوع می‌تواند این آفست را بازنویسی کند؛ این بدان معناست که" +" زیرنوع از سر فهرست ارجاع‌های ضعیف متفاوتی نسبت به نوع پایه استفاده می‌کند. " +"از آنجا که سر فهرست همیشه از طریق " +":c:member:`~PyTypeObject.tp_weaklistoffset` یافت می‌شود، این نباید مشکلی " +"ایجاد کند." -msgid "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_weaklistoffset` will be set to a negative value, to indicate that it is unsafe to use this field." +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the " +":c:member:`~PyTypeObject.tp_flags` field, then " +":c:member:`~PyTypeObject.tp_weaklistoffset` will be set to a negative value," +" to indicate that it is unsafe to use this field." msgstr "" +"اگر بیت :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` در فیلد " +":c:member:`~PyTypeObject.tp_flags` تنظیم شده باشد، آنگاه " +":c:member:`~PyTypeObject.tp_weaklistoffset` به یک مقدار منفی تنظیم خواهد شد " +"تا نشان دهد که استفاده از این فیلد ناامن است." -msgid "An optional pointer to a function that returns an :term:`iterator` for the object. Its presence normally signals that the instances of this type are :term:`iterable` (although sequences may be iterable without this function)." +msgid "" +"An optional pointer to a function that returns an :term:`iterator` for the " +"object. Its presence normally signals that the instances of this type are " +":term:`iterable` (although sequences may be iterable without this function)." msgstr "" +"یک اشاره‌گر اختیاری به تابعی که یک :term:`iterator` برای شیء برمی‌گرداند. " +"حضور آن معمولاً نشان می‌دهد که نمونه‌های این نوع :term:`iterable` هستند " +"(هرچند دنباله‌ها ممکن است بدون این تابع پیمایش‌پذیر باشند)." msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" -msgstr "" +msgstr "این تابع همان امضای :c:func:`PyObject_GetIter` را دارد::" msgid "PyObject *tp_iter(PyObject *self);" -msgstr "" +msgstr "PyObject *tp_iter(PyObject *self);" -msgid "An optional pointer to a function that returns the next item in an :term:`iterator`. The signature is::" +msgid "" +"An optional pointer to a function that returns the next item in an " +":term:`iterator`. The signature is::" msgstr "" +"اشاره‌گر اختیاری به تابعی که آیتم بعدی در یک :term:`پیمایش‌گر ` را" +" برمی‌گرداند. امضا به این صورت است::" msgid "PyObject *tp_iternext(PyObject *self);" -msgstr "" +msgstr "PyObject *tp_iternext(PyObject *self);" -msgid "When the iterator is exhausted, it must return ``NULL``; a :exc:`StopIteration` exception may or may not be set. When another error occurs, it must return ``NULL`` too. Its presence signals that the instances of this type are iterators." +msgid "" +"When the iterator is exhausted, it must return ``NULL``; a " +":exc:`StopIteration` exception may or may not be set. When another error " +"occurs, it must return ``NULL`` too. Its presence signals that the " +"instances of this type are iterators." msgstr "" +"هنگامی که پیمایش‌گر به پایان می‌رسد، باید ``NULL`` برگرداند؛ استثنای " +":exc:`StopIteration` ممکن است تنظیم شده باشد یا نباشد. هنگامی که خطای دیگری " +"رخ می‌دهد، نیز باید ``NULL`` برگرداند. وجود آن نشان می‌دهد که نمونه‌های این " +"نوع، پیمایش‌گر هستند." -msgid "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` function, and that function should return the iterator instance itself (not a new iterator instance)." +msgid "" +"Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " +"function, and that function should return the iterator instance itself (not " +"a new iterator instance)." msgstr "" +"نوع‌های پیمایش‌گر باید تابع :c:member:`~PyTypeObject.tp_iter` را نیز تعریف " +"کنند، و این تابع باید خودِ نمونه‌ی پیمایش‌گر را برگرداند (نه یک نمونه‌ی " +"پیمایش‌گر جدید)." msgid "This function has the same signature as :c:func:`PyIter_Next`." -msgstr "" +msgstr "این تابع همان امضای :c:func:`PyIter_Next` را دارد." -msgid "An optional pointer to a static ``NULL``-terminated array of :c:type:`PyMethodDef` structures, declaring regular methods of this type." +msgid "" +"An optional pointer to a static ``NULL``-terminated array of " +":c:type:`PyMethodDef` structures, declaring regular methods of this type." msgstr "" +"یک اشاره‌گر اختیاری به آرایه‌ی ایستای پایان‌یافته با ``NULL`` از ساختارهای " +":c:type:`PyMethodDef` که متدهای معمولی این نوع را اعلام می‌کند." -msgid "For each entry in the array, an entry is added to the type's dictionary (see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." +msgid "" +"For each entry in the array, an entry is added to the type's dictionary (see" +" :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" +"برای هر ورودی در آرایه، ورودی‌ای به دیکشنری نوع اضافه می‌شود (به " +":c:member:`~PyTypeObject.tp_dict` در ادامه ببینید) که حاوی یک توصیف‌گر متد " +"است." -msgid "This field is not inherited by subtypes (methods are inherited through a different mechanism)." +msgid "" +"This field is not inherited by subtypes (methods are inherited through a " +"different mechanism)." msgstr "" +"این فیلد توسط زیرنوع‌ها به ارث برده نمی‌شود (متدها از طریق سازوکاری متفاوت " +"به ارث برده می‌شوند)." -msgid "An optional pointer to a static ``NULL``-terminated array of :c:type:`PyMemberDef` structures, declaring regular data members (fields or slots) of instances of this type." +msgid "" +"An optional pointer to a static ``NULL``-terminated array of " +":c:type:`PyMemberDef` structures, declaring regular data members (fields or " +"slots) of instances of this type." msgstr "" +"یک اشاره‌گر اختیاری به آرایه‌ی ایستای مختوم به ``NULL`` از ساختارهای " +":c:type:`PyMemberDef`، که اعضای داده‌ی عادی (فیلدها یا جایگاه‌ها) از " +"نمونه‌های این نوع را اعلان می‌کند." -msgid "For each entry in the array, an entry is added to the type's dictionary (see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." +msgid "" +"For each entry in the array, an entry is added to the type's dictionary (see" +" :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" +"برای هر ورودی در آرایه، ورودی‌ای به دیکشنری نوع افزوده می‌شود (به " +":c:member:`~PyTypeObject.tp_dict` در ادامه مراجعه کنید) که حاوی یک توصیف‌گر " +"عضو است." -msgid "This field is not inherited by subtypes (members are inherited through a different mechanism)." +msgid "" +"This field is not inherited by subtypes (members are inherited through a " +"different mechanism)." msgstr "" +"این فیلد به زیرنوع‌ها به ارث نمی‌رسد (اعضا از طریق سازوکاری متفاوت به ارث " +"می‌رسند)." -msgid "An optional pointer to a static ``NULL``-terminated array of :c:type:`PyGetSetDef` structures, declaring computed attributes of instances of this type." +msgid "" +"An optional pointer to a static ``NULL``-terminated array of " +":c:type:`PyGetSetDef` structures, declaring computed attributes of instances" +" of this type." msgstr "" +"یک اشاره‌گر اختیاری به یک آرایه‌ی ایستای پایان‌یافته با ``NULL`` از " +"ساختارهای :c:type:`PyGetSetDef` که ویژگی‌های محاسبه‌شده‌ی نمونه‌های این نوع " +"را اعلان می‌کند." -msgid "For each entry in the array, an entry is added to the type's dictionary (see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." +msgid "" +"For each entry in the array, an entry is added to the type's dictionary (see" +" :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" +"برای هر ورودی در آرایه، یک ورودی به دیکشنری نوع اضافه می‌شود (به " +":c:member:`~PyTypeObject.tp_dict` در ادامه مراجعه کنید) که شامل یک توصیف‌گر " +"getset است." -msgid "This field is not inherited by subtypes (computed attributes are inherited through a different mechanism)." +msgid "" +"This field is not inherited by subtypes (computed attributes are inherited " +"through a different mechanism)." msgstr "" +"این فیلد به زیرنوع‌ها به ارث نمی‌رسد (ویژگی‌های محاسبه‌شده از طریق سازوکاری " +"متفاوت به ارث می‌رسند)." -msgid "An optional pointer to a base type from which type properties are inherited. At this level, only single inheritance is supported; multiple inheritance require dynamically creating a type object by calling the metatype." +msgid "" +"An optional pointer to a base type from which type properties are inherited." +" At this level, only single inheritance is supported; multiple inheritance " +"require dynamically creating a type object by calling the metatype." msgstr "" +"اشاره‌گری اختیاری به یک نوع پایه که ویژگی‌های نوع از آن به ارث می‌رسند. در " +"این سطح، تنها ارث‌بری تکی پشتیبانی می‌شود؛ ارث‌بری چندگانه نیازمند ایجاد یک " +"شیء نوع به‌صورت پویا با فراخوانی فرانوع است." -msgid "Slot initialization is subject to the rules of initializing globals. C99 requires the initializers to be \"address constants\". Function designators like :c:func:`PyType_GenericNew`, with implicit conversion to a pointer, are valid C99 address constants." +msgid "" +"Slot initialization is subject to the rules of initializing globals. C99 " +"requires the initializers to be \"address constants\". Function designators" +" like :c:func:`PyType_GenericNew`, with implicit conversion to a pointer, " +"are valid C99 address constants." msgstr "" +"مقداردهی اولیه جایگاه از قواعد مقداردهی اولیه متغیرهای سراسری پیروی می‌کند. " +"C99 الزام می‌کند که مقداردهنده‌های اولیه «ثابت‌های آدرس» باشند. نشانگرهای " +"تابع (function designator) مانند :c:func:`PyType_GenericNew` که به‌طور ضمنی " +"به اشاره‌گر تبدیل می‌شوند، ثابت‌های آدرس معتبر در C99 هستند." -msgid "However, the unary '&' operator applied to a non-static variable like :c:data:`PyBaseObject_Type` is not required to produce an address constant. Compilers may support this (gcc does), MSVC does not. Both compilers are strictly standard conforming in this particular behavior." +msgid "" +"However, the unary '&' operator applied to a non-static variable like " +":c:data:`PyBaseObject_Type` is not required to produce an address constant." +" Compilers may support this (gcc does), MSVC does not. Both compilers are " +"strictly standard conforming in this particular behavior." msgstr "" +"با این حال، الزامی نیست که عملگر یک‌عملوندی '&' اعمال‌شده بر متغیری غیرایستا" +" مانند :c:data:`PyBaseObject_Type` ثابت آدرس (address constant) تولید کند. " +"کامپایلرها ممکن است از این پشتیبانی کنند (gcc پشتیبانی می‌کند)، اما MSVC " +"پشتیبانی نمی‌کند. هر دو کامپایلر در این رفتار خاص کاملاً منطبق با استاندارد " +"هستند." -msgid "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the extension module's init function." +msgid "" +"Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " +"extension module's init function." msgstr "" +"در نتیجه، :c:member:`~PyTypeObject.tp_base` باید در تابع init ماژول توسعه‌ای" +" تنظیم شود." msgid "This field is not inherited by subtypes (obviously)." -msgstr "" +msgstr "این فیلد به زیرنوع‌ها به ارث نمی‌رسد (بدیهی است)." -msgid "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers is known as the type :class:`object`)." +msgid "" +"This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " +"is known as the type :class:`object`)." msgstr "" +"مقدار پیش‌فرض این فیلد ``&PyBaseObject_Type`` است (که برای برنامه‌نویسان " +"پایتون به‌عنوان نوع :class:`object` شناخته می‌شود)." msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." -msgstr "" +msgstr "دیکشنری نوع توسط :c:func:`PyType_Ready` در اینجا ذخیره می‌شود." -msgid "This field should normally be initialized to ``NULL`` before PyType_Ready is called; it may also be initialized to a dictionary containing initial attributes for the type. Once :c:func:`PyType_Ready` has initialized the type, extra attributes for the type may be added to this dictionary only if they don't correspond to overloaded operations (like :meth:`~object.__add__`). Once initialization for the type has finished, this field should be treated as read-only." -msgstr "" +msgid "" +"This field should normally be initialized to ``NULL`` before PyType_Ready is" +" called; it may also be initialized to a dictionary containing initial " +"attributes for the type. Once :c:func:`PyType_Ready` has initialized the " +"type, extra attributes for the type may be added to this dictionary only if " +"they don't correspond to overloaded operations (like " +":meth:`~object.__add__`). Once initialization for the type has finished, " +"this field should be treated as read-only." +msgstr "" +"این فیلد به‌طور معمول باید پیش از فراخوانی PyType_Ready به ``NULL`` مقداردهی" +" اولیه شود؛ همچنین می‌تواند به یک دیکشنری حاوی ویژگی‌های اولیه برای نوع " +"مقداردهی اولیه شود. پس از آنکه :c:func:`PyType_Ready` نوع را مقداردهی اولیه " +"کرد، ویژگی‌های اضافی برای نوع تنها در صورتی می‌توانند به این دیکشنری افزوده " +"شوند که با عملیات‌های سربارگذاری‌شده (مانند :meth:`~object.__add__`) تناظر " +"نداشته باشند. پس از پایان مقداردهی اولیه نوع، این فیلد باید فقط‌خواندنی در " +"نظر گرفته شود." -msgid "Some types may not store their dictionary in this slot. Use :c:func:`PyType_GetDict` to retrieve the dictionary for an arbitrary type." +msgid "" +"Some types may not store their dictionary in this slot. Use " +":c:func:`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" +"برخی نوع‌ها ممکن است دیکشنری خود را در این جایگاه ذخیره نکنند. برای بازیابی " +"دیکشنری یک نوع دلخواه، از :c:func:`PyType_GetDict` استفاده کنید." -msgid "Internals detail: For static builtin types, this is always ``NULL``. Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:func:`PyType_GetDict` to get the dict for an arbitrary type." +msgid "" +"Internals detail: For static builtin types, this is always ``NULL``. " +"Instead, the dict for such types is stored on ``PyInterpreterState``. Use " +":c:func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" +"جزئیات داخلی: برای نوع‌های توکار ایستا، این همیشه ``NULL`` است. در عوض، " +"دیکشنری چنین نوع‌هایی در ``PyInterpreterState`` ذخیره می‌شود. برای دریافت " +"دیکشنری یک نوع دلخواه از :c:func:`PyType_GetDict` استفاده کنید." -msgid "This field is not inherited by subtypes (though the attributes defined in here are inherited through a different mechanism)." +msgid "" +"This field is not inherited by subtypes (though the attributes defined in " +"here are inherited through a different mechanism)." msgstr "" +"این فیلد توسط زیرنوع‌ها به ارث برده نمی‌شود (هرچند ویژگی‌های تعریف‌شده در آن" +" از طریق سازوکاری متفاوت به ارث برده می‌شوند)." -msgid "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new dictionary to it." +msgid "" +"If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " +"dictionary to it." msgstr "" +"اگر این فیلد ``NULL`` باشد، :c:func:`PyType_Ready` یک دیکشنری جدید به آن " +"انتساب می‌دهد." -msgid "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:member:`~PyTypeObject.tp_dict` with the dictionary C-API." +msgid "" +"It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify " +":c:member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" +"استفاده از :c:func:`PyDict_SetItem` بر روی :c:member:`~PyTypeObject.tp_dict`" +" یا تغییر دادن آن به روش‌های دیگر با C-API دیکشنری ایمن نیست." msgid "An optional pointer to a \"descriptor get\" function." -msgstr "" +msgstr "اشاره‌گری اختیاری به تابع «دریافت توصیف‌گر» (descriptor get)." msgid "The function signature is::" -msgstr "" +msgstr "امضای تابع به این صورت است::" -msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" +msgid "" +"PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" msgstr "" +"PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" -msgid "An optional pointer to a function for setting and deleting a descriptor's value." -msgstr "" +msgid "" +"An optional pointer to a function for setting and deleting a descriptor's " +"value." +msgstr "اشاره‌گر اختیاری به تابعی برای تنظیم و حذف مقدار یک توصیف‌گر." msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" -msgstr "" +msgstr "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" msgid "The *value* argument is set to ``NULL`` to delete the value." -msgstr "" +msgstr "آرگومان *value* برای حذف مقدار، بر روی ``NULL`` تنظیم می‌شود." -msgid "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` should be used instead, if at all possible." +msgid "" +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"should be used instead, if at all possible." msgstr "" +"با اینکه این فیلد هنوز پشتیبانی می‌شود، در صورت امکان باید به جای آن از " +":c:macro:`Py_TPFLAGS_MANAGED_DICT` استفاده شود." -msgid "If the instances of this type have a dictionary containing instance variables, this field is non-zero and contains the offset in the instances of the type of the instance variable dictionary; this offset is used by :c:func:`PyObject_GenericGetAttr`." +msgid "" +"If the instances of this type have a dictionary containing instance " +"variables, this field is non-zero and contains the offset in the instances " +"of the type of the instance variable dictionary; this offset is used by " +":c:func:`PyObject_GenericGetAttr`." msgstr "" +"اگر نمونه‌های این نوع دیکشنری حاوی متغیرهای نمونه داشته باشند، این فیلد " +"ناصفر است و آفست دیکشنری متغیرهای نمونه در نمونه‌های نوع را در بر می‌گیرد؛ " +"این آفست توسط :c:func:`PyObject_GenericGetAttr` استفاده می‌شود." -msgid "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is the dictionary for attributes of the type object itself." +msgid "" +"Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " +"the dictionary for attributes of the type object itself." msgstr "" +"این فیلد را با :c:member:`~PyTypeObject.tp_dict` اشتباه نگیرید؛ آن، دیکشنریِ" +" مربوط به ویژگی‌های خودِ شیء نوع است." -msgid "The value specifies the offset of the dictionary from the start of the instance structure." -msgstr "" +msgid "" +"The value specifies the offset of the dictionary from the start of the " +"instance structure." +msgstr "این مقدار، آفست دیکشنری را از ابتدای ساختار نمونه مشخص می‌کند." -msgid "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-only. To get the pointer to the dictionary call :c:func:`PyObject_GenericGetDict`. Calling :c:func:`PyObject_GenericGetDict` may need to allocate memory for the dictionary, so it is may be more efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" +"only. To get the pointer to the dictionary call " +":c:func:`PyObject_GenericGetDict`. Calling :c:func:`PyObject_GenericGetDict`" +" may need to allocate memory for the dictionary, so it is may be more " +"efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on " +"the object." +msgstr "" +":c:member:`~PyTypeObject.tp_dictoffset` باید فقط‌نوشتنی در نظر گرفته شود. " +"برای به‌دست‌آوردن اشاره‌گر به دیکشنری، :c:func:`PyObject_GenericGetDict` را " +"فراخوانی کنید. فراخوانی :c:func:`PyObject_GenericGetDict` ممکن است نیاز به " +"تخصیص حافظه برای دیکشنری داشته باشد، بنابراین ممکن است هنگام دسترسی به یک " +"ویژگی روی شیء، فراخوانی :c:func:`PyObject_GetAttr` کارآمدتر باشد." -msgid "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:member:`~PyTypeObject.tp_dictoffset`." +msgid "" +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and " +":c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" +"تنظیم هر دو بیت :c:macro:`Py_TPFLAGS_MANAGED_DICT` و " +":c:member:`~PyTypeObject.tp_dictoffset` خطا است." -msgid "This field is inherited by subtypes. A subtype should not override this offset; doing so could be unsafe, if C code tries to access the dictionary at the previous offset. To properly support inheritance, use :c:macro:`Py_TPFLAGS_MANAGED_DICT`." +msgid "" +"This field is inherited by subtypes. A subtype should not override this " +"offset; doing so could be unsafe, if C code tries to access the dictionary " +"at the previous offset. To properly support inheritance, use " +":c:macro:`Py_TPFLAGS_MANAGED_DICT`." msgstr "" +"این فیلد توسط زیرنوع‌ها به ارث برده می‌شود. زیرنوع نباید این آفست را " +"بازنویسی کند؛ انجام این کار می‌تواند ناامن باشد، اگر کد C تلاش کند به " +"دیکشنری در آفست قبلی دسترسی پیدا کند. برای پشتیبانی صحیح از ارث‌بری، از " +":c:macro:`Py_TPFLAGS_MANAGED_DICT` استفاده کنید." -msgid "This slot has no default. For :ref:`static types `, if the field is ``NULL`` then no :attr:`~object.__dict__` gets created for instances." +msgid "" +"This slot has no default. For :ref:`static types `, if the " +"field is ``NULL`` then no :attr:`~object.__dict__` gets created for " +"instances." msgstr "" +"این جایگاه مقدار پیش‌فرضی ندارد. برای :ref:`نوع‌های ایستا `، " +"اگر فیلد ``NULL`` باشد، برای نمونه‌ها هیچ :attr:`~object.__dict__` ایجاد " +"نمی‌شود." -msgid "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` will be set to ``-1``, to indicate that it is unsafe to use this field." +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the " +":c:member:`~PyTypeObject.tp_flags` field, then " +":c:member:`~PyTypeObject.tp_dictoffset` will be set to ``-1``, to indicate " +"that it is unsafe to use this field." msgstr "" +"اگر بیت :c:macro:`Py_TPFLAGS_MANAGED_DICT` در فیلد " +":c:member:`~PyTypeObject.tp_flags` تنظیم شده باشد، آنگاه " +":c:member:`~PyTypeObject.tp_dictoffset` برابر ``-1`` تنظیم خواهد شد تا نشان " +"دهد که استفاده از این فیلد ناامن است." msgid "An optional pointer to an instance initialization function." -msgstr "" +msgstr "اشاره‌گری اختیاری به تابع مقداردهی اولیه‌ی نمونه." -msgid "This function corresponds to the :meth:`~object.__init__` method of classes. Like :meth:`!__init__`, it is possible to create an instance without calling :meth:`!__init__`, and it is possible to reinitialize an instance by calling its :meth:`!__init__` method again." +msgid "" +"This function corresponds to the :meth:`~object.__init__` method of classes." +" Like :meth:`!__init__`, it is possible to create an instance without " +"calling :meth:`!__init__`, and it is possible to reinitialize an instance by" +" calling its :meth:`!__init__` method again." msgstr "" +"این تابع معادل متد :meth:`~object.__init__` کلاس‌ها است. مانند " +":meth:`!__init__`، می‌توان نمونه‌ای را بدون فراخوانی :meth:`!__init__` ایجاد" +" کرد، و می‌توان نمونه‌ای را با فراخوانی دوباره متد :meth:`!__init__` آن " +"مقداردهی مجدد کرد." msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" -msgstr "" +msgstr "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" -msgid "The self argument is the instance to be initialized; the *args* and *kwds* arguments represent positional and keyword arguments of the call to :meth:`~object.__init__`." +msgid "" +"The self argument is the instance to be initialized; the *args* and *kwds* " +"arguments represent positional and keyword arguments of the call to " +":meth:`~object.__init__`." msgstr "" +"آرگومان self نمونه‌ای است که باید مقداردهی اولیه شود؛ آرگومان‌های *args* و " +"*kwds* آرگومان‌های جایگاهی و کلیدواژه‌ای فراخوانی :meth:`~object.__init__` " +"را بازنمایی می‌کنند." -msgid "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called when an instance is created normally by calling its type, after the type's :c:member:`~PyTypeObject.tp_new` function has returned an instance of the type. If the :c:member:`~PyTypeObject.tp_new` function returns an instance of some other type that is not a subtype of the original type, no :c:member:`~PyTypeObject.tp_init` function is called; if :c:member:`~PyTypeObject.tp_new` returns an instance of a subtype of the original type, the subtype's :c:member:`~PyTypeObject.tp_init` is called." -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " +"when an instance is created normally by calling its type, after the type's " +":c:member:`~PyTypeObject.tp_new` function has returned an instance of the " +"type. If the :c:member:`~PyTypeObject.tp_new` function returns an instance " +"of some other type that is not a subtype of the original type, no " +":c:member:`~PyTypeObject.tp_init` function is called; if " +":c:member:`~PyTypeObject.tp_new` returns an instance of a subtype of the " +"original type, the subtype's :c:member:`~PyTypeObject.tp_init` is called." +msgstr "" +"تابع :c:member:`~PyTypeObject.tp_init`، در صورتی که ``NULL`` نباشد، هنگامی " +"فراخوانی می‌شود که نمونه‌ای به‌طور معمول با فراخوانی نوع آن ایجاد شود، پس از" +" آنکه تابع :c:member:`~PyTypeObject.tp_new` آن نوع، نمونه‌ای از آن نوع را " +"برگردانده باشد. اگر تابع :c:member:`~PyTypeObject.tp_new` نمونه‌ای از نوع " +"دیگری را برگرداند که زیرنوع نوع اصلی نیست، هیچ تابع " +":c:member:`~PyTypeObject.tp_init` فراخوانی نمی‌شود؛ اگر " +":c:member:`~PyTypeObject.tp_new` نمونه‌ای از یک زیرنوع از نوع اصلی را " +"برگرداند، :c:member:`~PyTypeObject.tp_init` آن زیرنوع فراخوانی می‌شود." msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" +"در صورت موفقیت ``0`` و در صورت خطا ``-1`` را برمی‌گرداند و استثنایی تنظیم " +"می‌کند." -msgid "For :ref:`static types ` this field does not have a default." +msgid "" +"For :ref:`static types ` this field does not have a default." msgstr "" +"برای :ref:`نوع‌های ایستا ` این فیلد مقدار پیش‌فرض ندارد." msgid "An optional pointer to an instance allocation function." -msgstr "" +msgstr "اشاره‌گر اختیاری به یک تابع تخصیص نمونه." msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" -msgstr "" +msgstr "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" -msgid "Static subtypes inherit this slot, which will be :c:func:`PyType_GenericAlloc` if inherited from :class:`object`." +msgid "" +"Static subtypes inherit this slot, which will be " +":c:func:`PyType_GenericAlloc` if inherited from :class:`object`." msgstr "" +"زیرنوع‌های ایستا این جایگاه را به ارث می‌برند که در صورت ارث‌بری از " +":class:`object`، :c:func:`PyType_GenericAlloc` خواهد بود." msgid ":ref:`Heap subtypes ` do not inherit this slot." -msgstr "" +msgstr ":ref:`زیرنوع‌های هیپ ` این جایگاه را به ارث نمی‌برند." -msgid "For heap subtypes, this field is always set to :c:func:`PyType_GenericAlloc`." +msgid "" +"For heap subtypes, this field is always set to " +":c:func:`PyType_GenericAlloc`." msgstr "" +"برای زیرنوع‌های هیپ، این فیلد همیشه روی :c:func:`PyType_GenericAlloc` تنظیم " +"می‌شود." msgid "For static subtypes, this slot is inherited (see above)." -msgstr "" +msgstr "برای زیرنوع‌های ایستا، این جایگاه به ارث می‌رسد (بالا را ببینید)." msgid "An optional pointer to an instance creation function." -msgstr "" +msgstr "اشاره‌گر اختیاری به یک تابع ایجاد نمونه." -msgid "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" +msgid "" +"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" msgstr "" +"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" -msgid "The *subtype* argument is the type of the object being created; the *args* and *kwds* arguments represent positional and keyword arguments of the call to the type. Note that *subtype* doesn't have to equal the type whose :c:member:`~PyTypeObject.tp_new` function is called; it may be a subtype of that type (but not an unrelated type)." -msgstr "" +msgid "" +"The *subtype* argument is the type of the object being created; the *args* " +"and *kwds* arguments represent positional and keyword arguments of the call " +"to the type. Note that *subtype* doesn't have to equal the type whose " +":c:member:`~PyTypeObject.tp_new` function is called; it may be a subtype of " +"that type (but not an unrelated type)." +msgstr "" +"آرگومان *subtype* نوع شیئی است که در حال ایجاد شدن است؛ آرگومان‌های *args* و" +" *kwds* آرگومان‌های جایگاهی و کلیدواژه‌ای فراخوانی آن نوع را نشان می‌دهند. " +"توجه داشته باشید که *subtype* لازم نیست با نوعی که تابع " +":c:member:`~PyTypeObject.tp_new` آن فراخوانی می‌شود برابر باشد؛ می‌تواند " +"زیرنوعی از آن نوع باشد (اما نه نوعی نامرتبط)." -msgid "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype->tp_alloc(subtype, nitems)`` to allocate space for the object, and then do only as much further initialization as is absolutely necessary. Initialization that can safely be ignored or repeated should be placed in the :c:member:`~PyTypeObject.tp_init` handler. A good rule of thumb is that for immutable types, all initialization should take place in :c:member:`~PyTypeObject.tp_new`, while for mutable types, most initialization should be deferred to :c:member:`~PyTypeObject.tp_init`." -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_new` function should call " +"``subtype->tp_alloc(subtype, nitems)`` to allocate space for the object, and" +" then do only as much further initialization as is absolutely necessary. " +"Initialization that can safely be ignored or repeated should be placed in " +"the :c:member:`~PyTypeObject.tp_init` handler. A good rule of thumb is that" +" for immutable types, all initialization should take place in " +":c:member:`~PyTypeObject.tp_new`, while for mutable types, most " +"initialization should be deferred to :c:member:`~PyTypeObject.tp_init`." +msgstr "" +"تابع :c:member:`~PyTypeObject.tp_new` باید برای تخصیص فضای شیء، " +"``subtype->tp_alloc(subtype, nitems)`` را فراخوانی کند و سپس تنها به " +"اندازه‌ای که کاملاً ضروری است، مقدار‌دهی اولیه‌ی بیشتری انجام دهد. مقدار‌دهی" +" اولیه‌ای که می‌توان آن را با اطمینان نادیده گرفت یا تکرار کرد، باید در " +"هندلر :c:member:`~PyTypeObject.tp_init` قرار گیرد. یک قاعده سرانگشتی خوب این" +" است که برای نوع‌های تغییرناپذیر، تمام مقدار‌دهی اولیه باید در " +":c:member:`~PyTypeObject.tp_new` انجام شود، در حالی که برای نوع‌های " +"تغییرپذیر، بیشترِ مقدار‌دهی اولیه باید به :c:member:`~PyTypeObject.tp_init` " +"موکول شود." -msgid "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating instances of the type in Python." +msgid "" +"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " +"creating instances of the type in Python." msgstr "" +"برای جلوگیری از ایجاد نمونه‌های این نوع در پایتون، پرچم " +":c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` را تنظیم کنید." -msgid "This field is inherited by subtypes, except it is not inherited by :ref:`static types ` whose :c:member:`~PyTypeObject.tp_base` is ``NULL`` or ``&PyBaseObject_Type``." +msgid "" +"This field is inherited by subtypes, except it is not inherited by " +":ref:`static types ` whose :c:member:`~PyTypeObject.tp_base` " +"is ``NULL`` or ``&PyBaseObject_Type``." msgstr "" +"این فیلد توسط زیرنوع‌ها به ارث برده می‌شود، به‌جز اینکه :ref:`نوع‌های ایستا " +"` که :c:member:`~PyTypeObject.tp_base` آن‌ها ``NULL`` یا " +"``&PyBaseObject_Type`` است، این فیلد را به ارث نمی‌برند." -msgid "For :ref:`static types ` this field has no default. This means if the slot is defined as ``NULL``, the type cannot be called to create new instances; presumably there is some other way to create instances, like a factory function." +msgid "" +"For :ref:`static types ` this field has no default. This means" +" if the slot is defined as ``NULL``, the type cannot be called to create new" +" instances; presumably there is some other way to create instances, like a " +"factory function." msgstr "" +"برای :ref:`نوع‌های ایستا ` این فیلد مقدار پیش‌فرضی ندارد. این " +"بدان معناست که اگر جایگاه به‌صورت ``NULL`` تعریف شود، نمی‌توان نوع را برای " +"ایجاد نمونه‌های جدید فراخوانی کرد؛ احتمالاً راه دیگری برای ایجاد نمونه‌ها " +"وجود دارد، مانند یک تابع کارخانه‌ای." -msgid "An optional pointer to an instance deallocation function. Its signature is::" -msgstr "" +msgid "" +"An optional pointer to an instance deallocation function. Its signature " +"is::" +msgstr "اشاره‌گری اختیاری به تابع تخصیص‌گشایی نمونه. امضای آن چنین است::" msgid "void tp_free(void *self);" -msgstr "" +msgstr "void tp_free(void *self);" -msgid "This function must free the memory allocated by :c:member:`~PyTypeObject.tp_alloc`." +msgid "" +"This function must free the memory allocated by " +":c:member:`~PyTypeObject.tp_alloc`." msgstr "" +"این تابع باید حافظه‌ی تخصیص‌یافته توسط :c:member:`~PyTypeObject.tp_alloc` را" +" آزاد کند." -msgid "Static subtypes inherit this slot, which will be :c:func:`PyObject_Free` if inherited from :class:`object`. Exception: If the type supports garbage collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:`~PyTypeObject.tp_flags`) and it would inherit :c:func:`PyObject_Free`, then this slot is not inherited but instead defaults to :c:func:`PyObject_GC_Del`." -msgstr "" +msgid "" +"Static subtypes inherit this slot, which will be :c:func:`PyObject_Free` if " +"inherited from :class:`object`. Exception: If the type supports garbage " +"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in " +":c:member:`~PyTypeObject.tp_flags`) and it would inherit " +":c:func:`PyObject_Free`, then this slot is not inherited but instead " +"defaults to :c:func:`PyObject_GC_Del`." +msgstr "" +"زیرنوع‌های ایستا این جایگاه را به ارث می‌برند؛ این جایگاه در صورتی که از " +":class:`object` به ارث برده شود، :c:func:`PyObject_Free` خواهد بود. استثنا:" +" اگر نوع از زباله‌روبی پشتیبانی کند (یعنی پرچم :c:macro:`Py_TPFLAGS_HAVE_GC`" +" در :c:member:`~PyTypeObject.tp_flags` تنظیم شده باشد) و قرار باشد " +":c:func:`PyObject_Free` را به ارث ببرد، آنگاه این جایگاه به ارث برده " +"نمی‌شود، بلکه پیش‌فرض آن :c:func:`PyObject_GC_Del` است." -msgid "For :ref:`heap subtypes `, this slot defaults to a deallocator suitable to match :c:func:`PyType_GenericAlloc` and the value of the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." +msgid "" +"For :ref:`heap subtypes `, this slot defaults to a deallocator " +"suitable to match :c:func:`PyType_GenericAlloc` and the value of the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" +"برای :ref:`زیرنوع‌های هیپ `، این جایگاه به‌طور پیش‌فرض به یک " +"تخصیص‌زدا (deallocator) مناسب برای مطابقت با :c:func:`PyType_GenericAlloc` و" +" مقدار پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم می‌شود." msgid "An optional pointer to a function called by the garbage collector." -msgstr "" +msgstr "اشاره‌گر اختیاری به تابعی که توسط زباله‌روب فراخوانی می‌شود." -msgid "The garbage collector needs to know whether a particular object is collectible or not. Normally, it is sufficient to look at the object's type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically and dynamically allocated instances, and the statically allocated instances are not collectible. Such types should define this function; it should return ``1`` for a collectible instance, and ``0`` for a non-collectible instance. The signature is::" -msgstr "" +msgid "" +"The garbage collector needs to know whether a particular object is " +"collectible or not. Normally, it is sufficient to look at the object's " +"type's :c:member:`~PyTypeObject.tp_flags` field, and check the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of " +"statically and dynamically allocated instances, and the statically allocated" +" instances are not collectible. Such types should define this function; it " +"should return ``1`` for a collectible instance, and ``0`` for a non-" +"collectible instance. The signature is::" +msgstr "" +"زباله‌روب نیاز دارد بداند که آیا یک شیء خاص قابل جمع‌آوری است یا خیر. در " +"حالت عادی، نگاه کردن به فیلد :c:member:`~PyTypeObject.tp_flags` نوع شیء و " +"بررسی بیت پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` کافی است. اما برخی نوع‌ها " +"ترکیبی از نمونه‌های تخصیص‌یافته به‌صورت ایستا و پویا دارند و نمونه‌های " +"تخصیص‌یافته به‌صورت ایستا قابل جمع‌آوری نیستند. چنین نوع‌هایی باید این تابع " +"را تعریف کنند؛ این تابع باید برای یک نمونه‌ی قابل جمع‌آوری ``1`` و برای یک " +"نمونه‌ی غیرقابل جمع‌آوری ``0`` بازگرداند. امضا به این صورت است::" msgid "int tp_is_gc(PyObject *self);" -msgstr "" +msgstr "int tp_is_gc(PyObject *self);" -msgid "(The only example of this are types themselves. The metatype, :c:data:`PyType_Type`, defines this function to distinguish between statically and :ref:`dynamically allocated types `.)" +msgid "" +"(The only example of this are types themselves. The metatype, " +":c:data:`PyType_Type`, defines this function to distinguish between " +"statically and :ref:`dynamically allocated types `.)" msgstr "" +"(تنها نمونه از این مورد، خودِ نوع‌ها هستند. فراکلاس، :c:data:`PyType_Type`، " +"این تابع را برای تمایز بین نوع‌های تخصیص‌یافته به‌صورت ایستا و :ref:`نوع‌های" +" تخصیص‌یافته به‌صورت پویا ` تعریف می‌کند.)" -msgid "This slot has no default. If this field is ``NULL``, :c:macro:`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." +msgid "" +"This slot has no default. If this field is ``NULL``, " +":c:macro:`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" +"این جایگاه مقدار پیش‌فرض ندارد. اگر این فیلد ``NULL`` باشد، " +":c:macro:`Py_TPFLAGS_HAVE_GC` به‌عنوان معادل عملکردی استفاده می‌شود." msgid "Tuple of base types." -msgstr "" +msgstr "تاپل نوع‌های پایه." -msgid "This field should be set to ``NULL`` and treated as read-only. Python will fill it in when the type is :c:func:`initialized `." +msgid "" +"This field should be set to ``NULL`` and treated as read-only. Python will " +"fill it in when the type is :c:func:`initialized `." msgstr "" +"این فیلد باید روی ``NULL`` تنظیم شود و به‌عنوان فقط‌خواندنی در نظر گرفته " +"شود. پایتون آن را زمانی که نوع :c:func:`مقداردهی اولیه ` شود، " +"پر می‌کند." -msgid "For dynamically created classes, the :c:data:`Py_tp_bases` :c:type:`slot ` can be used instead of the *bases* argument of :c:func:`PyType_FromSpecWithBases`. The argument form is preferred." +msgid "" +"For dynamically created classes, the :c:data:`Py_tp_bases` :c:type:`slot " +"` can be used instead of the *bases* argument of " +":c:func:`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" +"برای کلاس‌های ایجادشده به‌صورت پویا، می‌توان به‌جای آرگومان *bases* در " +":c:func:`PyType_FromSpecWithBases` از :c:type:`جایگاه ` " +":c:data:`Py_tp_bases` استفاده کرد. شکل آرگومان ترجیح داده می‌شود." -msgid "Multiple inheritance does not work well for statically defined types. If you set ``tp_bases`` to a tuple, Python will not raise an error, but some slots will only be inherited from the first base." +msgid "" +"Multiple inheritance does not work well for statically defined types. If you" +" set ``tp_bases`` to a tuple, Python will not raise an error, but some slots" +" will only be inherited from the first base." msgstr "" +"وراثت چندگانه برای نوع‌های تعریف‌شده به‌صورت ایستا به‌خوبی کار نمی‌کند. اگر " +"``tp_bases`` را روی یک تاپل تنظیم کنید، پایتون خطایی ایجاد نمی‌کند، اما برخی" +" جایگاه‌ها فقط از اولین پایه به ارث برده می‌شوند." msgid "This field is not inherited." -msgstr "" +msgstr "این فیلد به ارث برده نمی‌شود." -msgid "Tuple containing the expanded set of base types, starting with the type itself and ending with :class:`object`, in Method Resolution Order." +msgid "" +"Tuple containing the expanded set of base types, starting with the type " +"itself and ending with :class:`object`, in Method Resolution Order." msgstr "" +"تاپلی حاوی مجموعه‌ی گسترش‌یافته‌ی نوع‌های پایه به ترتیب حل متد، که با خودِ " +"نوع آغاز می‌شود و با :class:`object` پایان می‌یابد." -msgid "This field is not inherited; it is calculated fresh by :c:func:`PyType_Ready`." +msgid "" +"This field is not inherited; it is calculated fresh by " +":c:func:`PyType_Ready`." msgstr "" +"این فیلد به ارث برده نمی‌شود؛ توسط :c:func:`PyType_Ready` از نو محاسبه " +"می‌شود." msgid "Unused. Internal use only." -msgstr "" +msgstr "استفاده نمی‌شود. فقط برای استفاده داخلی است." -msgid "A collection of subclasses. Internal use only. May be an invalid pointer." +msgid "" +"A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" +"مجموعه‌ای از زیرکلاس‌ها. فقط برای استفاده داخلی. ممکن است اشاره‌گر نامعتبر " +"باشد." -msgid "To get a list of subclasses, call the Python method :py:meth:`~type.__subclasses__`." +msgid "" +"To get a list of subclasses, call the Python method " +":py:meth:`~type.__subclasses__`." msgstr "" +"برای به‌دست‌آوردن فهرستی از زیرکلاس‌ها، متد پایتونی " +":py:meth:`~type.__subclasses__` را فراخوانی کنید." -msgid "For some types, this field does not hold a valid :c:expr:`PyObject*`. The type was changed to :c:expr:`void*` to indicate this." +msgid "" +"For some types, this field does not hold a valid :c:expr:`PyObject*`. The " +"type was changed to :c:expr:`void*` to indicate this." msgstr "" +"برای برخی از نوع‌ها، این فیلد شامل یک :c:expr:`PyObject*` معتبر نیست. نوع " +"این فیلد به :c:expr:`void*` تغییر یافت تا این موضوع را نشان دهد." -msgid "Weak reference list head, for weak references to this type object. Not inherited. Internal use only." +msgid "" +"Weak reference list head, for weak references to this type object. Not " +"inherited. Internal use only." msgstr "" +"سر فهرست ارجاع‌های ضعیف، برای ارجاع‌های ضعیف به این شیء نوع. به ارث برده " +"نمی‌شود. فقط برای استفاده‌ی داخلی." -msgid "Internals detail: For the static builtin types this is always ``NULL``, even if weakrefs are added. Instead, the weakrefs for each are stored on ``PyInterpreterState``. Use the public C-API or the internal ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." +msgid "" +"Internals detail: For the static builtin types this is always ``NULL``, even" +" if weakrefs are added. Instead, the weakrefs for each are stored on " +"``PyInterpreterState``. Use the public C-API or the internal " +"``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" +"جزئیات داخلی: برای نوع‌های توکار ایستا، این همیشه ``NULL`` است، حتی اگر " +"ارجاع‌های ضعیف اضافه شوند. در عوض، ارجاع‌های ضعیف هر یک روی " +"``PyInterpreterState`` ذخیره می‌شوند. برای پرهیز از این تمایز، از C-API " +"عمومی یا ماکرو داخلی ``_PyObject_GET_WEAKREFS_LISTPTR()`` استفاده کنید." -msgid "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." +msgid "" +"This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` " +"instead." msgstr "" +"این فیلد منسوخ شده است. به‌جای آن از :c:member:`~PyTypeObject.tp_finalize` " +"استفاده کنید." msgid "Used to index into the method cache. Internal use only." msgstr "" +"برای اندیس‌گذاری در نهانگاه متد استفاده می‌شود. فقط برای استفاده داخلی." -msgid "An optional pointer to an instance finalization function. This is the C implementation of the :meth:`~object.__del__` special method. Its signature is::" +msgid "" +"An optional pointer to an instance finalization function. This is the C " +"implementation of the :meth:`~object.__del__` special method. Its signature" +" is::" msgstr "" +"یک اشاره‌گر اختیاری به تابع نهایی‌سازی نمونه. این، پیاده‌سازی C متد ویژه‌ی " +":meth:`~object.__del__` است. امضای آن به این صورت است::" msgid "void tp_finalize(PyObject *self);" -msgstr "" +msgstr "void tp_finalize(PyObject *self);" -msgid "The primary purpose of finalization is to perform any non-trivial cleanup that must be performed before the object is destroyed, while the object and any other objects it directly or indirectly references are still in a consistent state. The finalizer is allowed to execute arbitrary Python code." +msgid "" +"The primary purpose of finalization is to perform any non-trivial cleanup " +"that must be performed before the object is destroyed, while the object and " +"any other objects it directly or indirectly references are still in a " +"consistent state. The finalizer is allowed to execute arbitrary Python " +"code." msgstr "" +"هدف اصلی نهایی‌سازی، انجام هر پاک‌سازی غیربدیهی است که باید پیش از نابود شدن" +" شیء انجام شود، در حالی که شیء و هر شیء دیگری که مستقیماً یا غیرمستقیم به " +"آن‌ها ارجاع می‌دهد، همچنان در وضعیت سازگار هستند. نهایی‌ساز مجاز است کد " +"دلخواه پایتون را اجرا کند." -msgid "Before Python automatically finalizes an object, some of the object's direct or indirect referents might have themselves been automatically finalized. However, none of the referents will have been automatically cleared (:c:member:`~PyTypeObject.tp_clear`) yet." +msgid "" +"Before Python automatically finalizes an object, some of the object's direct" +" or indirect referents might have themselves been automatically finalized. " +"However, none of the referents will have been automatically cleared " +"(:c:member:`~PyTypeObject.tp_clear`) yet." msgstr "" +"پیش از آن‌که پایتون یک شیء را به‌طور خودکار نهایی‌سازی کند، ممکن است برخی از" +" ارجاع‌شونده‌های (referents) مستقیم یا غیرمستقیم آن شیء، خودشان به‌طور " +"خودکار نهایی‌سازی شده باشند. با این حال، هیچ‌یک از ارجاع‌شونده‌ها هنوز " +"به‌طور خودکار پاک‌سازی (:c:member:`~PyTypeObject.tp_clear`) نشده‌اند." -msgid "Other non-finalized objects might still be using a finalized object, so the finalizer must leave the object in a sane state (e.g., invariants are still met)." +msgid "" +"Other non-finalized objects might still be using a finalized object, so the " +"finalizer must leave the object in a sane state (e.g., invariants are still " +"met)." msgstr "" +"ممکن است سایر اشیای نهایی‌نشده همچنان در حال استفاده از یک شیء نهایی‌شده " +"باشند، بنابراین نهایی‌ساز باید شیء را در وضعیتی سالم باقی بگذارد (مثلاً، " +"ناورداها همچنان برقرار باشند)." -msgid "After Python automatically finalizes an object, Python might start automatically clearing (:c:member:`~PyTypeObject.tp_clear`) the object and its referents (direct and indirect). Cleared objects are not guaranteed to be in a consistent state; a finalized object must be able to tolerate cleared referents." -msgstr "" +msgid "" +"After Python automatically finalizes an object, Python might start " +"automatically clearing (:c:member:`~PyTypeObject.tp_clear`) the object and " +"its referents (direct and indirect). Cleared objects are not guaranteed to " +"be in a consistent state; a finalized object must be able to tolerate " +"cleared referents." +msgstr "" +"پس از آنکه پایتون به‌طور خودکار یک شیء را نهایی‌سازی می‌کند، ممکن است پایتون" +" پاک‌سازی خودکار (:c:member:`~PyTypeObject.tp_clear`) آن شیء و " +"ارجاع‌شده‌هایش (مستقیم و غیرمستقیم) را آغاز کند. تضمینی نیست که اشیای " +"پاک‌سازی‌شده در وضعیتی سازگار باشند؛ یک شیء نهایی‌سازی‌شده باید بتواند " +"ارجاع‌شده‌های پاک‌سازی‌شده را تحمل کند." -msgid "An object is not guaranteed to be automatically finalized before its destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called. It is recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the beginning of :c:member:`!tp_dealloc` to guarantee that the object is always finalized before destruction." -msgstr "" +msgid "" +"An object is not guaranteed to be automatically finalized before its " +"destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called. It is " +"recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the " +"beginning of :c:member:`!tp_dealloc` to guarantee that the object is always " +"finalized before destruction." +msgstr "" +"تضمین نمی‌شود که یک شیء پیش از فراخوانی مخرب آن " +"(:c:member:`~PyTypeObject.tp_dealloc`) به‌طور خودکار نهایی‌سازی شده باشد. " +"توصیه می‌شود :c:func:`PyObject_CallFinalizerFromDealloc` را در ابتدای " +":c:member:`!tp_dealloc` فراخوانی کنید تا تضمین شود که شیء همیشه پیش از تخریب" +" نهایی‌سازی می‌شود." -msgid "The :c:member:`~PyTypeObject.tp_finalize` function can be called from any thread, although the :term:`GIL` will be held." +msgid "" +"The :c:member:`~PyTypeObject.tp_finalize` function can be called from any " +"thread, although the :term:`GIL` will be held." msgstr "" +"تابع :c:member:`~PyTypeObject.tp_finalize` را می‌توان از هر نخی فراخوانی " +"کرد، هرچند :term:`قفل مفسر سراسری ` در اختیار گرفته خواهد شد." -msgid "The :c:member:`!tp_finalize` function can be called during shutdown, after some global variables have been deleted. See the documentation of the :meth:`~object.__del__` method for details." +msgid "" +"The :c:member:`!tp_finalize` function can be called during shutdown, after " +"some global variables have been deleted. See the documentation of the " +":meth:`~object.__del__` method for details." msgstr "" +"تابع :c:member:`!tp_finalize` می‌تواند در طول خاموشی، پس از حذف برخی از " +"متغیرهای سراسری فراخوانی شود. برای جزئیات، مستندات متد " +":meth:`~object.__del__` را ببینید." -msgid "When Python finalizes an object, it behaves like the following algorithm:" +msgid "" +"When Python finalizes an object, it behaves like the following algorithm:" msgstr "" +"وقتی پایتون یک شیء را نهایی‌سازی می‌کند، مانند الگوریتم زیر رفتار می‌کند:" -msgid "Python might mark the object as *finalized*. Currently, Python always marks objects whose type supports garbage collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:`~PyTypeObject.tp_flags`) and never marks other types of objects; this might change in a future version." -msgstr "" +msgid "" +"Python might mark the object as *finalized*. Currently, Python always marks" +" objects whose type supports garbage collection (i.e., the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in " +":c:member:`~PyTypeObject.tp_flags`) and never marks other types of objects; " +"this might change in a future version." +msgstr "" +"پایتون ممکن است شیء را به‌عنوان *نهایی‌شده* علامت‌گذاری کند. در حال حاضر، " +"پایتون همیشه اشیایی را که نوع آن‌ها از زباله‌روبی پشتیبانی می‌کند (یعنی پرچم" +" :c:macro:`Py_TPFLAGS_HAVE_GC` در :c:member:`~PyTypeObject.tp_flags` تنظیم " +"شده است) علامت‌گذاری می‌کند و هرگز اشیایی از انواع دیگر را علامت‌گذاری " +"نمی‌کند؛ این ممکن است در نسخه‌ای در آینده تغییر کند." -msgid "If the object is not marked as *finalized* and its :c:member:`!tp_finalize` finalizer function is non-``NULL``, the finalizer function is called." +msgid "" +"If the object is not marked as *finalized* and its :c:member:`!tp_finalize` " +"finalizer function is non-``NULL``, the finalizer function is called." msgstr "" +"اگر شیء به‌عنوان *نهایی‌سازی‌شده* نشانه‌گذاری نشده باشد و تابع نهایی‌ساز " +":c:member:`!tp_finalize` آن غیر ``NULL`` باشد، تابع نهایی‌ساز فراخوانی " +"می‌شود." -msgid "If the finalizer function was called and the finalizer made the object reachable (i.e., there is a reference to the object and it is not a member of a :term:`cyclic isolate`), then the finalizer is said to have *resurrected* the object. It is unspecified whether the finalizer can also resurrect the object by adding a new reference to the object that does not make it reachable, i.e., the object is (still) a member of a cyclic isolate." -msgstr "" +msgid "" +"If the finalizer function was called and the finalizer made the object " +"reachable (i.e., there is a reference to the object and it is not a member " +"of a :term:`cyclic isolate`), then the finalizer is said to have " +"*resurrected* the object. It is unspecified whether the finalizer can also " +"resurrect the object by adding a new reference to the object that does not " +"make it reachable, i.e., the object is (still) a member of a cyclic isolate." +msgstr "" +"اگر تابع نهایی‌ساز فراخوانی شده باشد و نهایی‌ساز شیء را دسترس‌پذیر کرده باشد" +" (یعنی ارجاعی به شیء وجود داشته باشد و شیء عضوی از :term:`cyclic isolate` " +"نباشد)، آنگاه گفته می‌شود که نهایی‌ساز شیء را *احیا کرده* است. مشخص نشده " +"است که آیا نهایی‌ساز می‌تواند با افزودن ارجاع جدیدی به شیء که آن را " +"دسترس‌پذیر نمی‌کند، شیء را نیز احیا کند، یعنی شیء (هنوز) عضوی از یک ایزوله " +"چرخه‌ای (cyclic isolate) است." -msgid "If the finalizer resurrected the object, the object's pending destruction is canceled and the object's *finalized* mark might be removed if present. Currently, Python never removes the *finalized* mark; this might change in a future version." +msgid "" +"If the finalizer resurrected the object, the object's pending destruction is" +" canceled and the object's *finalized* mark might be removed if present. " +"Currently, Python never removes the *finalized* mark; this might change in a" +" future version." msgstr "" +"اگر نهایی‌ساز شیء را احیا کرده باشد، نابودی در انتظار شیء لغو می‌شود و " +"نشانه‌ی *نهایی‌شده* شیء در صورت وجود ممکن است حذف شود. در حال حاضر، پایتون " +"هرگز نشانه‌ی *نهایی‌شده* را حذف نمی‌کند؛ این ممکن است در نسخه‌های آینده " +"تغییر کند." -msgid "*Automatic finalization* refers to any finalization performed by Python except via calls to :c:func:`PyObject_CallFinalizer` or :c:func:`PyObject_CallFinalizerFromDealloc`. No guarantees are made about when, if, or how often an object is automatically finalized, except:" +msgid "" +"*Automatic finalization* refers to any finalization performed by Python " +"except via calls to :c:func:`PyObject_CallFinalizer` or " +":c:func:`PyObject_CallFinalizerFromDealloc`. No guarantees are made about " +"when, if, or how often an object is automatically finalized, except:" msgstr "" +"*نهایی‌سازی خودکار* به هر نهایی‌سازی‌ای اشاره دارد که توسط پایتون انجام " +"می‌شود، به‌جز از طریق فراخوانی :c:func:`PyObject_CallFinalizer` یا " +":c:func:`PyObject_CallFinalizerFromDealloc`. هیچ تضمینی ارائه نمی‌شود که یک" +" شیء چه زمانی، آیا اصلاً، یا هر چند وقت یک‌بار به‌طور خودکار نهایی‌سازی " +"می‌شود، مگر:" -msgid "Python will not automatically finalize an object if it is reachable, i.e., there is a reference to it and it is not a member of a :term:`cyclic isolate`." +msgid "" +"Python will not automatically finalize an object if it is reachable, i.e., " +"there is a reference to it and it is not a member of a :term:`cyclic " +"isolate`." msgstr "" +"پایتون در صورتی که شیئی در دسترس باشد — یعنی ارجاعی به آن وجود داشته باشد و " +"عضوی از یک :term:`cyclic isolate` نباشد — آن را به‌طور خودکار نهایی‌سازی " +"نمی‌کند." -msgid "Python will not automatically finalize an object if finalizing it would not mark the object as *finalized*. Currently, this applies to objects whose type does not support garbage collection, i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is not set. Such objects can still be manually finalized by calling :c:func:`PyObject_CallFinalizer` or :c:func:`PyObject_CallFinalizerFromDealloc`." -msgstr "" +msgid "" +"Python will not automatically finalize an object if finalizing it would not " +"mark the object as *finalized*. Currently, this applies to objects whose " +"type does not support garbage collection, i.e., the " +":c:macro:`Py_TPFLAGS_HAVE_GC` flag is not set. Such objects can still be " +"manually finalized by calling :c:func:`PyObject_CallFinalizer` or " +":c:func:`PyObject_CallFinalizerFromDealloc`." +msgstr "" +"پایتون به‌طور خودکار یک شیء را نهایی‌سازی نمی‌کند اگر نهایی‌سازی آن، آن شیء " +"را به‌عنوان *نهایی‌شده* علامت‌گذاری نکند. در حال حاضر، این مورد بر اشیائی " +"اعمال می‌شود که نوع آن‌ها از زباله‌روبی پشتیبانی نمی‌کند؛ یعنی پرچم " +":c:macro:`Py_TPFLAGS_HAVE_GC` تنظیم نشده است. این‌گونه اشیاء همچنان " +"می‌توانند با فراخوانی :c:func:`PyObject_CallFinalizer` یا " +":c:func:`PyObject_CallFinalizerFromDealloc` به‌صورت دستی نهایی‌سازی شوند." -msgid "Python will not automatically finalize any two members of a :term:`cyclic isolate` concurrently." +msgid "" +"Python will not automatically finalize any two members of a :term:`cyclic " +"isolate` concurrently." msgstr "" +"پایتون به‌طور خودکار هیچ دو عضو از یک :term:`cyclic isolate` را به‌طور " +"همزمان نهایی‌سازی نمی‌کند." -msgid "Python will not automatically finalize an object after it has automatically cleared (:c:member:`~PyTypeObject.tp_clear`) the object." +msgid "" +"Python will not automatically finalize an object after it has automatically " +"cleared (:c:member:`~PyTypeObject.tp_clear`) the object." msgstr "" +"پایتون پس از پاک‌سازی خودکار (:c:member:`~PyTypeObject.tp_clear`) یک شیء، آن" +" شیء را به‌طور خودکار نهایی نمی‌کند." -msgid "If an object is a member of a :term:`cyclic isolate`, Python will not automatically finalize it after automatically clearing (see :c:member:`~PyTypeObject.tp_clear`) any other member." +msgid "" +"If an object is a member of a :term:`cyclic isolate`, Python will not " +"automatically finalize it after automatically clearing (see " +":c:member:`~PyTypeObject.tp_clear`) any other member." msgstr "" +"اگر یک شیء عضوی از یک :term:`مجموعه چرخه‌ای مجزا (cyclic isolate) ` باشد، پایتون پس از پاک‌سازی خودکار هر عضو دیگر (به " +":c:member:`~PyTypeObject.tp_clear` مراجعه کنید)، آن را به‌طور خودکار " +"نهایی‌سازی نخواهد کرد." -msgid "Python will automatically finalize every member of a :term:`cyclic isolate` before it automatically clears (see :c:member:`~PyTypeObject.tp_clear`) any of them." +msgid "" +"Python will automatically finalize every member of a :term:`cyclic isolate` " +"before it automatically clears (see :c:member:`~PyTypeObject.tp_clear`) any " +"of them." msgstr "" +"پایتون پیش از آنکه به‌طور خودکار هر یک از آن‌ها را پاک‌سازی کند (رجوع کنید " +"به :c:member:`~PyTypeObject.tp_clear`)، به‌طور خودکار هر عضو از یک " +":term:`cyclic isolate` را نهایی می‌کند." -msgid "If Python is going to automatically clear an object (:c:member:`~PyTypeObject.tp_clear`), it will automatically finalize the object first." +msgid "" +"If Python is going to automatically clear an object " +"(:c:member:`~PyTypeObject.tp_clear`), it will automatically finalize the " +"object first." msgstr "" +"اگر پایتون بخواهد یک شیء را به‌طور خودکار پاک‌سازی کند " +"(:c:member:`~PyTypeObject.tp_clear`)، ابتدا شیء را به‌طور خودکار نهایی‌سازی " +"خواهد کرد." -msgid "Python currently only automatically finalizes objects that are members of a :term:`cyclic isolate`, but future versions might finalize objects regularly before their destruction." +msgid "" +"Python currently only automatically finalizes objects that are members of a " +":term:`cyclic isolate`, but future versions might finalize objects regularly" +" before their destruction." msgstr "" +"پایتون در حال حاضر تنها اشیایی را به‌طور خودکار نهایی‌سازی می‌کند که عضوی از" +" یک :term:`cyclic isolate` باشند، اما نسخه‌های آینده ممکن است اشیاء را " +"به‌طور منظم پیش از تخریب‌شان نهایی‌سازی کنند." -msgid "To manually finalize an object, do not call this function directly; call :c:func:`PyObject_CallFinalizer` or :c:func:`PyObject_CallFinalizerFromDealloc` instead." +msgid "" +"To manually finalize an object, do not call this function directly; call " +":c:func:`PyObject_CallFinalizer` or " +":c:func:`PyObject_CallFinalizerFromDealloc` instead." msgstr "" +"برای نهایی‌سازی دستی یک شیء، این تابع را مستقیماً فراخوانی نکنید؛ به جای آن " +":c:func:`PyObject_CallFinalizer` یا " +":c:func:`PyObject_CallFinalizerFromDealloc` را فراخوانی کنید." -msgid ":c:member:`~PyTypeObject.tp_finalize` should leave the current exception status unchanged. The recommended way to write a non-trivial finalizer is to back up the exception at the beginning by calling :c:func:`PyErr_GetRaisedException` and restore the exception at the end by calling :c:func:`PyErr_SetRaisedException`. If an exception is encountered in the middle of the finalizer, log and clear it with :c:func:`PyErr_WriteUnraisable` or :c:func:`PyErr_FormatUnraisable`. For example::" -msgstr "" +msgid "" +":c:member:`~PyTypeObject.tp_finalize` should leave the current exception " +"status unchanged. The recommended way to write a non-trivial finalizer is " +"to back up the exception at the beginning by calling " +":c:func:`PyErr_GetRaisedException` and restore the exception at the end by " +"calling :c:func:`PyErr_SetRaisedException`. If an exception is encountered " +"in the middle of the finalizer, log and clear it with " +":c:func:`PyErr_WriteUnraisable` or :c:func:`PyErr_FormatUnraisable`. For " +"example::" +msgstr "" +":c:member:`~PyTypeObject.tp_finalize` باید وضعیت فعلی استثنا را بدون تغییر " +"بگذارد. روش توصیه‌شده برای نوشتن یک نهایی‌ساز غیربدیهی این است که در ابتدا " +"با فراخوانی :c:func:`PyErr_GetRaisedException` از استثنا پشتیبان‌گیری کنید و" +" در پایان با فراخوانی :c:func:`PyErr_SetRaisedException` استثنا را بازگردانی" +" کنید. اگر در میانه‌ی نهایی‌ساز استثنایی رخ دهد، آن را با " +":c:func:`PyErr_WriteUnraisable` یا :c:func:`PyErr_FormatUnraisable` گزارش " +"داده و پاک کنید. برای مثال::" msgid "" "static void\n" @@ -2127,92 +4242,249 @@ msgid "" " PyErr_SetRaisedException(exc);\n" "}" msgstr "" +"static void\n" +"foo_finalize(PyObject *self)\n" +"{\n" +" // Save the current exception, if any.\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" // ...\n" +"\n" +" if (do_something_that_might_raise() != success_indicator) {\n" +" PyErr_WriteUnraisable(self);\n" +" goto done;\n" +" }\n" +"\n" +"done:\n" +" // Restore the saved exception. This silently discards any exception\n" +" // raised above, so be sure to call PyErr_WriteUnraisable first if\n" +" // necessary.\n" +" PyErr_SetRaisedException(exc);\n" +"}" -msgid "Before version 3.8 it was necessary to set the :c:macro:`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. This is no longer required." +msgid "" +"Before version 3.8 it was necessary to set the " +":c:macro:`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be " +"used. This is no longer required." msgstr "" +"پیش از نسخه 3.8 برای استفاده از این فیلد، لازم بود که بیت پرچم " +":c:macro:`Py_TPFLAGS_HAVE_FINALIZE` تنظیم شود. این کار دیگر لازم نیست." msgid ":pep:`442`: \"Safe object finalization\"" -msgstr "" +msgstr ":pep:`442`: «نهایی‌سازی امن شیء»" msgid ":c:func:`PyObject_CallFinalizer`" -msgstr "" +msgstr ":c:func:`PyObject_CallFinalizer`" msgid ":c:func:`PyObject_CallFinalizerFromDealloc`" -msgstr "" +msgstr ":c:func:`PyObject_CallFinalizerFromDealloc`" -msgid "A :ref:`vectorcall function ` to use for calls of this type object (rather than instances). In other words, ``tp_vectorcall`` can be used to optimize ``type.__call__``, which typically returns a new instance of *type*." +msgid "" +"A :ref:`vectorcall function ` to use for calls of this type " +"object (rather than instances). In other words, ``tp_vectorcall`` can be " +"used to optimize ``type.__call__``, which typically returns a new instance " +"of *type*." msgstr "" +"یک :ref:`تابع vectorcall ` برای استفاده در فراخوانی‌های این شیء " +"نوع (به جای نمونه‌ها). به عبارت دیگر، ``tp_vectorcall`` می‌تواند برای " +"بهینه‌سازی ``type.__call__`` استفاده شود که به‌طور معمول نمونه‌ی جدیدی از " +"*نوع* را برمی‌گرداند." -msgid "As with any vectorcall function, if ``tp_vectorcall`` is ``NULL``, the *tp_call* protocol (``Py_TYPE(type)->tp_call``) is used instead." +msgid "" +"As with any vectorcall function, if ``tp_vectorcall`` is ``NULL``, the " +"*tp_call* protocol (``Py_TYPE(type)->tp_call``) is used instead." msgstr "" +"مانند هر تابع vectorcall، اگر ``tp_vectorcall`` برابر ``NULL`` باشد، به‌جای " +"آن از پروتکل *tp_call* (``Py_TYPE(type)->tp_call``) استفاده می‌شود." -msgid "The :ref:`vectorcall protocol ` requires that the vectorcall function has the same behavior as the corresponding ``tp_call``. This means that ``type->tp_vectorcall`` must match the behavior of ``Py_TYPE(type)->tp_call``." +msgid "" +"The :ref:`vectorcall protocol ` requires that the vectorcall " +"function has the same behavior as the corresponding ``tp_call``. This means " +"that ``type->tp_vectorcall`` must match the behavior of " +"``Py_TYPE(type)->tp_call``." msgstr "" +":ref:`پروتکل vectorcall ` ایجاب می‌کند که تابع vectorcall همان " +"رفتار ``tp_call`` متناظر را داشته باشد. این بدان معناست که " +"``type->tp_vectorcall`` باید با رفتار ``Py_TYPE(type)->tp_call`` مطابقت " +"داشته باشد." -msgid "Specifically, if *type* uses the default metaclass, ``type->tp_vectorcall`` must behave the same as :c:expr:`PyType_Type->tp_call`, which:" +msgid "" +"Specifically, if *type* uses the default metaclass, ``type->tp_vectorcall`` " +"must behave the same as :c:expr:`PyType_Type->tp_call`, which:" msgstr "" +"به‌طور خاص، اگر *نوع* از فراکلاس پیش‌فرض استفاده کند، " +"``type->tp_vectorcall`` باید همانند :c:expr:`PyType_Type->tp_call` رفتار " +"کند، که:" msgid "calls ``type->tp_new``," -msgstr "" +msgstr "``type->tp_new`` را فرامی‌خواند،" -msgid "if the result is a subclass of *type*, calls ``type->tp_init`` on the result of ``tp_new``, and" +msgid "" +"if the result is a subclass of *type*, calls ``type->tp_init`` on the result" +" of ``tp_new``, and" msgstr "" +"اگر نتیجه زیرکلاسی از *type* باشد، ``type->tp_init`` را روی نتیجه‌ی " +"``tp_new`` فراخوانی می‌کند و" msgid "returns the result of ``tp_new``." -msgstr "" +msgstr "نتیجه‌ی ``tp_new`` را برمی‌گرداند." -msgid "Typically, ``tp_vectorcall`` is overridden to optimize this process for specific :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_init`. When doing this for user-subclassable types, note that both can be overridden (using :py:func:`~object.__new__` and :py:func:`~object.__init__`, respectively)." -msgstr "" +msgid "" +"Typically, ``tp_vectorcall`` is overridden to optimize this process for " +"specific :c:member:`~PyTypeObject.tp_new` and " +":c:member:`~PyTypeObject.tp_init`. When doing this for user-subclassable " +"types, note that both can be overridden (using :py:func:`~object.__new__` " +"and :py:func:`~object.__init__`, respectively)." +msgstr "" +"معمولاً ``tp_vectorcall`` بازنویسی می‌شود تا این فرایند برای " +":c:member:`~PyTypeObject.tp_new` و :c:member:`~PyTypeObject.tp_init` خاص " +"بهینه‌سازی شود. هنگام انجام این کار برای نوع‌هایی که کاربران می‌توانند از " +"آن‌ها زیرکلاس بسازند، توجه داشته باشید که هر دوی آن‌ها می‌توانند بازنویسی " +"شوند (با استفاده از :py:func:`~object.__new__` و " +":py:func:`~object.__init__`، به‌ترتیب)." msgid "This field is never inherited." -msgstr "" +msgstr "این فیلد هرگز به ارث برده نمی‌شود." msgid "(the field exists since 3.8 but it's only used since 3.9)" -msgstr "" +msgstr "(این فیلد از نسخه 3.8 وجود دارد، اما تنها از نسخه 3.9 استفاده می‌شود)" msgid "Internal. Do not use." -msgstr "" +msgstr "داخلی. استفاده نکنید." msgid "Static Types" -msgstr "" +msgstr "نوع‌های ایستا" -msgid "Traditionally, types defined in C code are *static*, that is, a static :c:type:`PyTypeObject` structure is defined directly in code and initialized using :c:func:`PyType_Ready`." +msgid "" +"Traditionally, types defined in C code are *static*, that is, a static " +":c:type:`PyTypeObject` structure is defined directly in code and initialized" +" using :c:func:`PyType_Ready`." msgstr "" +"به‌طور سنتی، نوع‌های تعریف‌شده در کد C *ایستا* هستند؛ یعنی یک ساختار ایستای " +":c:type:`PyTypeObject` مستقیماً در کد تعریف می‌شود و با استفاده از " +":c:func:`PyType_Ready` مقداردهی اولیه می‌شود." -msgid "This results in types that are limited relative to types defined in Python:" +msgid "" +"This results in types that are limited relative to types defined in Python:" msgstr "" +"این امر منجر به نوع‌هایی می‌شود که نسبت به نوع‌های تعریف‌شده در پایتون محدود" +" هستند:" -msgid "Static types are limited to one base, i.e. they cannot use multiple inheritance." +msgid "" +"Static types are limited to one base, i.e. they cannot use multiple " +"inheritance." msgstr "" +"نوع‌های ایستا به یک کلاس پایه محدود هستند، یعنی نمی‌توانند از وراثت چندگانه " +"استفاده کنند." -msgid "Static type objects (but not necessarily their instances) are immutable. It is not possible to add or modify the type object's attributes from Python." +msgid "" +"Static type objects (but not necessarily their instances) are immutable. It " +"is not possible to add or modify the type object's attributes from Python." msgstr "" +"شیءهای نوع ایستا (اما نه لزوماً نمونه‌های آنها) تغییرناپذیر هستند. افزودن یا" +" تغییر دادن ویژگی‌های شیء نوع از پایتون امکان‌پذیر نیست." -msgid "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-specific state." +msgid "" +"Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" +"specific state." msgstr "" +"اشیاء نوع ایستا بین :ref:`زیرمفسرها ` به اشتراک " +"گذاشته می‌شوند، بنابراین نباید شامل هیچ وضعیت مختص زیرمفسر باشند." -msgid "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API ` as an opaque struct, any extension modules using static types must be compiled for a specific Python minor version." +msgid "" +"Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " +"` as an opaque struct, any extension modules using static " +"types must be compiled for a specific Python minor version." msgstr "" +"همچنین، از آن‌جا که :c:type:`PyTypeObject` تنها به‌عنوان یک ساختار مات " +"(opaque) بخشی از :ref:`API محدود ` است، هر ماژول توسعه‌ای که " +"از نوع‌های ایستا استفاده می‌کند، باید برای یک نسخه‌ی فرعی مشخص از پایتون " +"کامپایل شود." msgid "Heap Types" -msgstr "" +msgstr "نوع‌های هیپ" -msgid "An alternative to :ref:`static types ` is *heap-allocated types*, or *heap types* for short, which correspond closely to classes created by Python's ``class`` statement. Heap types have the :c:macro:`Py_TPFLAGS_HEAPTYPE` flag set." +msgid "" +"An alternative to :ref:`static types ` is *heap-allocated " +"types*, or *heap types* for short, which correspond closely to classes " +"created by Python's ``class`` statement. Heap types have the " +":c:macro:`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" +"جایگزینی برای :ref:`نوع‌های ایستا `، *نوع‌های تخصیص‌یافته در " +"هیپ* یا به‌اختصار *نوع‌های هیپ* است که تطابق نزدیکی با کلاس‌های ایجاد‌شده " +"توسط دستور ``class`` پایتون دارند. پرچم :c:macro:`Py_TPFLAGS_HEAPTYPE` در " +"نوع‌های هیپ تنظیم‌شده است." -msgid "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." +msgid "" +"This is done by filling a :c:type:`PyType_Spec` structure and calling " +":c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, " +":c:func:`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" +"این کار با پر کردن ساختار :c:type:`PyType_Spec` و فراخوانی " +":c:func:`PyType_FromSpec`، :c:func:`PyType_FromSpecWithBases`، " +":c:func:`PyType_FromModuleAndSpec` یا :c:func:`PyType_FromMetaclass` انجام " +"می‌شود." msgid "Number Object Structures" -msgstr "" +msgstr "ساختارهای شیء عدد" -msgid "This structure holds pointers to the functions which an object uses to implement the number protocol. Each function is used by the function of similar name documented in the :ref:`number` section." +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the number protocol. Each function is used by the function of " +"similar name documented in the :ref:`number` section." msgstr "" +"این ساختار اشاره‌گرهایی به توابعی را در خود نگه می‌دارد که یک شیء برای " +"پیاده‌سازی پروتکل عددی از آن‌ها استفاده می‌کند. هر تابع توسط تابعی با نام " +"مشابه که در بخش :ref:`number` مستند شده است، استفاده می‌شود." msgid "Here is the structure definition::" +msgstr "این تعریف ساختار است::" + +msgid "" +"typedef struct {\n" +" binaryfunc nb_add;\n" +" binaryfunc nb_subtract;\n" +" binaryfunc nb_multiply;\n" +" binaryfunc nb_remainder;\n" +" binaryfunc nb_divmod;\n" +" ternaryfunc nb_power;\n" +" unaryfunc nb_negative;\n" +" unaryfunc nb_positive;\n" +" unaryfunc nb_absolute;\n" +" inquiry nb_bool;\n" +" unaryfunc nb_invert;\n" +" binaryfunc nb_lshift;\n" +" binaryfunc nb_rshift;\n" +" binaryfunc nb_and;\n" +" binaryfunc nb_xor;\n" +" binaryfunc nb_or;\n" +" unaryfunc nb_int;\n" +" void *nb_reserved;\n" +" unaryfunc nb_float;\n" +"\n" +" binaryfunc nb_inplace_add;\n" +" binaryfunc nb_inplace_subtract;\n" +" binaryfunc nb_inplace_multiply;\n" +" binaryfunc nb_inplace_remainder;\n" +" ternaryfunc nb_inplace_power;\n" +" binaryfunc nb_inplace_lshift;\n" +" binaryfunc nb_inplace_rshift;\n" +" binaryfunc nb_inplace_and;\n" +" binaryfunc nb_inplace_xor;\n" +" binaryfunc nb_inplace_or;\n" +"\n" +" binaryfunc nb_floor_divide;\n" +" binaryfunc nb_true_divide;\n" +" binaryfunc nb_inplace_floor_divide;\n" +" binaryfunc nb_inplace_true_divide;\n" +"\n" +" unaryfunc nb_index;\n" +"\n" +" binaryfunc nb_matrix_multiply;\n" +" binaryfunc nb_inplace_matrix_multiply;\n" +"} PyNumberMethods;" msgstr "" - -msgid "" "typedef struct {\n" " binaryfunc nb_add;\n" " binaryfunc nb_subtract;\n" @@ -2255,169 +4527,413 @@ msgid "" " binaryfunc nb_matrix_multiply;\n" " binaryfunc nb_inplace_matrix_multiply;\n" "} PyNumberMethods;" -msgstr "" -msgid "Binary and ternary functions must check the type of all their operands, and implement the necessary conversions (at least one of the operands is an instance of the defined type). If the operation is not defined for the given operands, binary and ternary functions must return ``Py_NotImplemented``, if another error occurred they must return ``NULL`` and set an exception." -msgstr "" +msgid "" +"Binary and ternary functions must check the type of all their operands, and " +"implement the necessary conversions (at least one of the operands is an " +"instance of the defined type). If the operation is not defined for the " +"given operands, binary and ternary functions must return " +"``Py_NotImplemented``, if another error occurred they must return ``NULL`` " +"and set an exception." +msgstr "" +"توابع دوعملوندی و سه‌عملوندی باید نوع همه‌ی عملوندهای خود را بررسی کنند و " +"تبدیل‌های لازم را پیاده‌سازی کنند (حداقل یکی از عملوندها نمونه‌ای از نوع " +"تعریف‌شده است). اگر عملیات برای عملوندهای داده‌شده تعریف‌نشده باشد، توابع " +"دوعملوندی و سه‌عملوندی باید ``Py_NotImplemented`` را برگردانند و اگر خطای " +"دیگری رخ داده باشد، باید ``NULL`` را برگردانند و یک استثنا تنظیم کنند." -msgid "The :c:member:`~PyNumberMethods.nb_reserved` field should always be ``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in Python 3.0.1." +msgid "" +"The :c:member:`~PyNumberMethods.nb_reserved` field should always be " +"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in" +" Python 3.0.1." msgstr "" +"فیلد :c:member:`~PyNumberMethods.nb_reserved` باید همیشه ``NULL`` باشد. این " +"فیلد پیش‌تر :c:member:`!nb_long` نامیده می‌شد و در پایتون 3.0.1 تغییر نام " +"یافت." msgid "Mapping Object Structures" -msgstr "" +msgstr "ساختارهای شیء نگاشت" -msgid "This structure holds pointers to the functions which an object uses to implement the mapping protocol. It has three members:" +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the mapping protocol. It has three members:" msgstr "" +"این ساختار اشاره‌گرهایی به توابعی را نگه می‌دارد که یک شیء از آن‌ها برای " +"پیاده‌سازی پروتکل نگاشت استفاده می‌کند. این ساختار سه عضو دارد:" -msgid "This function is used by :c:func:`PyMapping_Size` and :c:func:`PyObject_Size`, and has the same signature. This slot may be set to ``NULL`` if the object has no defined length." +msgid "" +"This function is used by :c:func:`PyMapping_Size` and " +":c:func:`PyObject_Size`, and has the same signature. This slot may be set " +"to ``NULL`` if the object has no defined length." msgstr "" +"این تابع توسط :c:func:`PyMapping_Size` و :c:func:`PyObject_Size` استفاده " +"می‌شود و همان امضا را دارد. اگر شیء طول تعریف‌شده‌ای نداشته باشد، این جایگاه" +" می‌تواند به ``NULL`` تنظیم شود." -msgid "This function is used by :c:func:`PyObject_GetItem` and :c:func:`PySequence_GetSlice`, and has the same signature as :c:func:`!PyObject_GetItem`. This slot must be filled for the :c:func:`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." +msgid "" +"This function is used by :c:func:`PyObject_GetItem` and " +":c:func:`PySequence_GetSlice`, and has the same signature as " +":c:func:`!PyObject_GetItem`. This slot must be filled for the " +":c:func:`PyMapping_Check` function to return ``1``, it can be ``NULL`` " +"otherwise." msgstr "" +"این تابع توسط :c:func:`PyObject_GetItem` و :c:func:`PySequence_GetSlice` " +"استفاده می‌شود و امضای مشابهی با :c:func:`!PyObject_GetItem` دارد. این " +"جایگاه باید پر شود تا تابع :c:func:`PyMapping_Check` مقدار ``1`` را " +"برگرداند، در غیر این صورت می‌تواند ``NULL`` باشد." -msgid "This function is used by :c:func:`PyObject_SetItem`, :c:func:`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:`PySequence_DelSlice`. It has the same signature as :c:func:`!PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete an item. If this slot is ``NULL``, the object does not support item assignment and deletion." -msgstr "" +msgid "" +"This function is used by :c:func:`PyObject_SetItem`, " +":c:func:`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and " +":c:func:`PySequence_DelSlice`. It has the same signature as " +":c:func:`!PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete " +"an item. If this slot is ``NULL``, the object does not support item " +"assignment and deletion." +msgstr "" +"این تابع توسط :c:func:`PyObject_SetItem`، :c:func:`PyObject_DelItem`، " +":c:func:`PySequence_SetSlice` و :c:func:`PySequence_DelSlice` استفاده " +"می‌شود. این تابع امضایی مشابه :c:func:`!PyObject_SetItem` دارد، اما *v* را " +"می‌توان برای حذف یک آیتم نیز برابر ``NULL`` قرار داد. اگر این جایگاه " +"``NULL`` باشد، شیء از انتساب و حذف آیتم پشتیبانی نمی‌کند." msgid "Sequence Object Structures" -msgstr "" +msgstr "ساختارهای اشیاء دنباله" -msgid "This structure holds pointers to the functions which an object uses to implement the sequence protocol." +msgid "" +"This structure holds pointers to the functions which an object uses to " +"implement the sequence protocol." msgstr "" +"این ساختار اشاره‌گرهایی به توابعی را نگه می‌دارد که یک شیء برای پیاده‌سازی " +"پروتکل دنباله از آن‌ها استفاده می‌کند." -msgid "This function is used by :c:func:`PySequence_Size` and :c:func:`PyObject_Size`, and has the same signature. It is also used for handling negative indices via the :c:member:`~PySequenceMethods.sq_item` and the :c:member:`~PySequenceMethods.sq_ass_item` slots." +msgid "" +"This function is used by :c:func:`PySequence_Size` and " +":c:func:`PyObject_Size`, and has the same signature. It is also used for " +"handling negative indices via the :c:member:`~PySequenceMethods.sq_item` and" +" the :c:member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" +"این تابع توسط :c:func:`PySequence_Size` و :c:func:`PyObject_Size` استفاده " +"می‌شود و امضای یکسانی دارد. همچنین برای مدیریت اندیس‌های منفی از طریق " +"جایگاه‌های :c:member:`~PySequenceMethods.sq_item` و " +":c:member:`~PySequenceMethods.sq_ass_item` از آن استفاده می‌شود." -msgid "This function is used by :c:func:`PySequence_Concat` and has the same signature. It is also used by the ``+`` operator, after trying the numeric addition via the :c:member:`~PyNumberMethods.nb_add` slot." +msgid "" +"This function is used by :c:func:`PySequence_Concat` and has the same " +"signature. It is also used by the ``+`` operator, after trying the numeric " +"addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" +"این تابع توسط :c:func:`PySequence_Concat` استفاده می‌شود و امضای یکسانی " +"دارد. همچنین پس از تلاش برای انجام جمع عددی از طریق جایگاه " +":c:member:`~PyNumberMethods.nb_add`، توسط عملگر ``+`` نیز استفاده می‌شود." -msgid "This function is used by :c:func:`PySequence_Repeat` and has the same signature. It is also used by the ``*`` operator, after trying numeric multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." +msgid "" +"This function is used by :c:func:`PySequence_Repeat` and has the same " +"signature. It is also used by the ``*`` operator, after trying numeric " +"multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" +"این تابع توسط :c:func:`PySequence_Repeat` استفاده می‌شود و امضای یکسانی " +"دارد. عملگر ``*`` نیز پس از تلاش برای ضرب عددی از طریق جایگاه " +":c:member:`~PyNumberMethods.nb_multiply` از این تابع استفاده می‌کند." -msgid "This function is used by :c:func:`PySequence_GetItem` and has the same signature. It is also used by :c:func:`PyObject_GetItem`, after trying the subscription via the :c:member:`~PyMappingMethods.mp_subscript` slot. This slot must be filled for the :c:func:`PySequence_Check` function to return ``1``, it can be ``NULL`` otherwise." -msgstr "" +msgid "" +"This function is used by :c:func:`PySequence_GetItem` and has the same " +"signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " +"subscription via the :c:member:`~PyMappingMethods.mp_subscript` slot. This " +"slot must be filled for the :c:func:`PySequence_Check` function to return " +"``1``, it can be ``NULL`` otherwise." +msgstr "" +"این تابع توسط :c:func:`PySequence_GetItem` استفاده می‌شود و امضای یکسانی " +"دارد. این تابع همچنین توسط :c:func:`PyObject_GetItem` استفاده می‌شود، پس از " +"تلاش برای زیرنویسی از طریق جایگاه " +":c:member:`~PyMappingMethods.mp_subscript`. این جایگاه باید پر‌شده باشد تا " +"تابع :c:func:`PySequence_Check` مقدار ``1`` را برگرداند؛ در غیر این صورت " +"می‌تواند ``NULL`` باشد." -msgid "Negative indexes are handled as follows: if the :c:member:`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence length is used to compute a positive index which is passed to :c:member:`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``, the index is passed as is to the function." -msgstr "" +msgid "" +"Negative indexes are handled as follows: if the " +":c:member:`~PySequenceMethods.sq_length` slot is filled, it is called and " +"the sequence length is used to compute a positive index which is passed to " +":c:member:`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is " +"``NULL``, the index is passed as is to the function." +msgstr "" +"اندیس‌های منفی به صورت زیر مدیریت می‌شوند: اگر جایگاه " +":c:member:`~PySequenceMethods.sq_length` پر شده باشد، فراخوانی می‌شود و از " +"طول دنباله برای محاسبه‌ی اندیس مثبتی که به " +":c:member:`~PySequenceMethods.sq_item` ارسال می‌شود، استفاده می‌شود. اگر " +":c:member:`!sq_length` برابر ``NULL`` باشد، اندیس بدون تغییر به تابع ارسال " +"می‌شود." -msgid "This function is used by :c:func:`PySequence_SetItem` and has the same signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:`PyObject_DelItem`, after trying the item assignment and deletion via the :c:member:`~PyMappingMethods.mp_ass_subscript` slot. This slot may be left to ``NULL`` if the object does not support item assignment and deletion." -msgstr "" +msgid "" +"This function is used by :c:func:`PySequence_SetItem` and has the same " +"signature. It is also used by :c:func:`PyObject_SetItem` and " +":c:func:`PyObject_DelItem`, after trying the item assignment and deletion " +"via the :c:member:`~PyMappingMethods.mp_ass_subscript` slot. This slot may " +"be left to ``NULL`` if the object does not support item assignment and " +"deletion." +msgstr "" +"این تابع توسط :c:func:`PySequence_SetItem` استفاده می‌شود و همان امضا را " +"دارد. این تابع همچنین پس از تلاش برای انجام انتساب و حذف آیتم از طریق جایگاه" +" :c:member:`~PyMappingMethods.mp_ass_subscript`، توسط " +":c:func:`PyObject_SetItem` و :c:func:`PyObject_DelItem` استفاده می‌شود. اگر " +"شیء از انتساب و حذف آیتم پشتیبانی نکند، می‌توان این جایگاه را ``NULL`` " +"گذاشت." -msgid "This function may be used by :c:func:`PySequence_Contains` and has the same signature. This slot may be left to ``NULL``, in this case :c:func:`!PySequence_Contains` simply traverses the sequence until it finds a match." +msgid "" +"This function may be used by :c:func:`PySequence_Contains` and has the same " +"signature. This slot may be left to ``NULL``, in this case " +":c:func:`!PySequence_Contains` simply traverses the sequence until it finds " +"a match." msgstr "" +"این تابع ممکن است توسط :c:func:`PySequence_Contains` استفاده شود و همان امضا" +" را دارد. می‌توان این جایگاه را ``NULL`` گذاشت؛ در این صورت " +":c:func:`!PySequence_Contains` صرفاً دنباله را پیمایش می‌کند تا زمانی که " +"مورد منطبقی بیابد." -msgid "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same signature. It should modify its first operand, and return it. This slot may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceConcat` will fall back to :c:func:`PySequence_Concat`. It is also used by the augmented assignment ``+=``, after trying numeric in-place addition via the :c:member:`~PyNumberMethods.nb_inplace_add` slot." -msgstr "" +msgid "" +"This function is used by :c:func:`PySequence_InPlaceConcat` and has the same" +" signature. It should modify its first operand, and return it. This slot " +"may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceConcat` " +"will fall back to :c:func:`PySequence_Concat`. It is also used by the " +"augmented assignment ``+=``, after trying numeric in-place addition via the " +":c:member:`~PyNumberMethods.nb_inplace_add` slot." +msgstr "" +"این تابع توسط :c:func:`PySequence_InPlaceConcat` استفاده می‌شود و امضای " +"یکسانی با آن دارد. این تابع باید عملوند اول خود را تغییر دهد و آن را " +"برگرداند. این جایگاه می‌تواند ``NULL`` باقی بماند؛ در این صورت " +":c:func:`!PySequence_InPlaceConcat` به :c:func:`PySequence_Concat` " +"بازمی‌گردد. این جایگاه همچنین توسط انتساب افزوده‌ی ``+=`` استفاده می‌شود، پس" +" از تلاش برای انجام جمع درجای عددی از طریق جایگاه " +":c:member:`~PyNumberMethods.nb_inplace_add`." -msgid "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same signature. It should modify its first operand, and return it. This slot may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceRepeat` will fall back to :c:func:`PySequence_Repeat`. It is also used by the augmented assignment ``*=``, after trying numeric in-place multiplication via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." -msgstr "" +msgid "" +"This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same" +" signature. It should modify its first operand, and return it. This slot " +"may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceRepeat` " +"will fall back to :c:func:`PySequence_Repeat`. It is also used by the " +"augmented assignment ``*=``, after trying numeric in-place multiplication " +"via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." +msgstr "" +"این تابع توسط :c:func:`PySequence_InPlaceRepeat` استفاده می‌شود و امضای " +"یکسانی دارد. باید عملوند اول خود را تغییر دهد و آن را بازگرداند. این جایگاه " +"را می‌توان ``NULL`` گذاشت؛ در این صورت :c:func:`!PySequence_InPlaceRepeat` " +"به :c:func:`PySequence_Repeat` بازمی‌گردد. این جایگاه همچنین توسط عملگر " +"انتساب افزوده ``*=`` استفاده می‌شود، پس از تلاش برای ضرب عددی درجا از طریق " +"جایگاه :c:member:`~PyNumberMethods.nb_inplace_multiply`." msgid "Buffer Object Structures" -msgstr "" +msgstr "ساختارهای شیء بافر" -msgid "This structure holds pointers to the functions required by the :ref:`Buffer protocol `. The protocol defines how an exporter object can expose its internal data to consumer objects." +msgid "" +"This structure holds pointers to the functions required by the :ref:`Buffer " +"protocol `. The protocol defines how an exporter object can " +"expose its internal data to consumer objects." msgstr "" +"این ساختار اشاره‌گرهایی به توابع مورد نیاز :ref:`پروتکل بافر " +"` را نگه می‌دارد. این پروتکل تعریف می‌کند که یک شیء صادرکننده" +" چگونه می‌تواند داده‌های داخلی خود را در دسترس اشیاء مصرف‌کننده قرار دهد." msgid "The signature of this function is::" -msgstr "" +msgstr "امضای این تابع به این صورت است::" msgid "int (PyObject *exporter, Py_buffer *view, int flags);" -msgstr "" +msgstr "int (PyObject *exporter, Py_buffer *view, int flags);" -msgid "Handle a request to *exporter* to fill in *view* as specified by *flags*. Except for point (3), an implementation of this function MUST take these steps:" +msgid "" +"Handle a request to *exporter* to fill in *view* as specified by *flags*. " +"Except for point (3), an implementation of this function MUST take these " +"steps:" msgstr "" +"درخواستی به *exporter* برای پر کردن *view* مطابق با *flags* را مدیریت " +"می‌کند. به‌جز مورد (۳)، پیاده‌سازی این تابع باید این گام‌ها را بردارد:" -msgid "Check if the request can be met. If not, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +msgid "" +"Check if the request can be met. If not, raise :exc:`BufferError`, set " +"``view->obj`` to ``NULL`` and return ``-1``." msgstr "" +"بررسی کنید که آیا درخواست قابل برآوردن است یا خیر. در غیر این صورت، استثنای " +":exc:`BufferError` را ایجاد کنید، ``view->obj`` را برابر ``NULL`` قرار دهید " +"و ``-1`` را برگردانید." msgid "Fill in the requested fields." -msgstr "" +msgstr "فیلد‌های درخواستی را پر کنید." msgid "Increment an internal counter for the number of exports." -msgstr "" +msgstr "شمارنده‌ی داخلی تعداد صادرات را افزایش می‌دهد." msgid "Set ``view->obj`` to *exporter* and increment ``view->obj``." msgstr "" +"مقدار ``view->obj`` را برابر *exporter* قرار دهید و ``view->obj`` را افزایش " +"دهید." msgid "Return ``0``." -msgstr "" +msgstr "``0`` را برمی‌گرداند." msgid "**Thread safety:**" -msgstr "" +msgstr "**نخ‌ایمنی:**" msgid "In the :term:`free-threaded build`, implementations must ensure:" -msgstr "" +msgstr "در :term:`free-threaded build`، پیاده‌سازی‌ها باید اطمینان حاصل کنند:" msgid "The export counter increment in step (3) is atomic." -msgstr "" +msgstr "افزایش شمارنده‌ی برون‌بری (export) در گام (۳) اتمیک است." -msgid "The underlying buffer data remains valid and at a stable memory location for the lifetime of all exports." +msgid "" +"The underlying buffer data remains valid and at a stable memory location for" +" the lifetime of all exports." msgstr "" +"داده‌های بافر زیرین برای طول عمر همه‌ی صادرات‌ها (export) معتبر و در مکان " +"حافظه‌ای پایدار باقی می‌مانند." -msgid "For objects that support resizing or reallocation (such as :class:`bytearray`), the export counter is checked atomically before such operations, and :exc:`BufferError` is raised if exports exist." +msgid "" +"For objects that support resizing or reallocation (such as " +":class:`bytearray`), the export counter is checked atomically before such " +"operations, and :exc:`BufferError` is raised if exports exist." msgstr "" +"برای اشیایی که از تغییر اندازه یا تخصیص مجدد پشتیبانی می‌کنند (مانند " +":class:`bytearray`)، شمارنده برون‌بری پیش از انجام چنین عملیات‌هایی به‌صورت " +"اتمیک بررسی می‌شود و در صورت وجود برون‌بری‌ها، :exc:`BufferError` ایجاد " +"می‌شود." msgid "The function is safe to call concurrently from multiple threads." -msgstr "" +msgstr "فراخوانی هم‌زمان این تابع از چندین نخ ایمن است." -msgid "See also :ref:`thread-safety-memoryview` for the Python-level thread safety guarantees of :class:`memoryview` objects." +msgid "" +"See also :ref:`thread-safety-memoryview` for the Python-level thread safety " +"guarantees of :class:`memoryview` objects." msgstr "" +"همچنین برای تضمین‌های ایمنی نخ در سطح پایتون برای اشیاء :class:`memoryview`،" +" به :ref:`thread-safety-memoryview` مراجعه کنید." -msgid "If *exporter* is part of a chain or tree of buffer providers, two main schemes can be used:" +msgid "" +"If *exporter* is part of a chain or tree of buffer providers, two main " +"schemes can be used:" msgstr "" +"اگر *صادرکننده* (exporter) بخشی از زنجیره یا درختی از تأمین‌کنندگان بافر " +"باشد، می‌توان از دو طرح‌واره‌ی اصلی استفاده کرد:" -msgid "Re-export: Each member of the tree acts as the exporting object and sets ``view->obj`` to a new reference to itself." +msgid "" +"Re-export: Each member of the tree acts as the exporting object and sets " +"``view->obj`` to a new reference to itself." msgstr "" +"صادر کردن مجدد: هر عضو درخت به‌عنوان شیء صادرکننده عمل می‌کند و " +"``view->obj`` را برابر یک ارجاع جدید به خود قرار می‌دهد." -msgid "Redirect: The buffer request is redirected to the root object of the tree. Here, ``view->obj`` will be a new reference to the root object." +msgid "" +"Redirect: The buffer request is redirected to the root object of the tree. " +"Here, ``view->obj`` will be a new reference to the root object." msgstr "" +"هدایت مجدد: درخواست بافر به شیء ریشه‌ی درخت هدایت مجدد می‌شود. در اینجا، " +"``view->obj`` ارجاعی جدید به شیء ریشه خواهد بود." -msgid "The individual fields of *view* are described in section :ref:`Buffer structure `, the rules how an exporter must react to specific requests are in section :ref:`Buffer request types `." +msgid "" +"The individual fields of *view* are described in section :ref:`Buffer " +"structure `, the rules how an exporter must react to " +"specific requests are in section :ref:`Buffer request types `." msgstr "" +"فیلد‌های جداگانه‌ی *view* در بخش :ref:`ساختار بافر ` توصیف" +" شده‌اند و قواعدی که صادرکننده باید بر اساس آن‌ها به درخواست‌های خاص واکنش " +"نشان دهد، در بخش :ref:`انواع درخواست بافر ` آمده است." -msgid "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the exporter and must remain valid until there are no consumers left. :c:member:`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` and :c:member:`~Py_buffer.internal` are read-only for the consumer." -msgstr "" +msgid "" +"All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " +"exporter and must remain valid until there are no consumers left. " +":c:member:`~Py_buffer.format`, :c:member:`~Py_buffer.shape`, " +":c:member:`~Py_buffer.strides`, :c:member:`~Py_buffer.suboffsets` and " +":c:member:`~Py_buffer.internal` are read-only for the consumer." +msgstr "" +"تمام حافظه‌ای که در ساختار :c:type:`Py_buffer` به آن اشاره می‌شود متعلق به " +"صادرکننده است و باید تا زمانی که هیچ مصرف‌کننده‌ای باقی نمانده باشد معتبر " +"بماند. :c:member:`~Py_buffer.format`، :c:member:`~Py_buffer.shape`، " +":c:member:`~Py_buffer.strides`، :c:member:`~Py_buffer.suboffsets` و " +":c:member:`~Py_buffer.internal` برای مصرف‌کننده فقط‌خواندنی هستند." -msgid ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes buffer while dealing correctly with all request types." +msgid "" +":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " +"buffer while dealing correctly with all request types." msgstr "" +":c:func:`PyBuffer_FillInfo` راهی آسان برای در معرض قرار دادن یک بافر بایت " +"ساده فراهم می‌کند، در حالی که با همه‌ی انواع درخواست به‌درستی برخورد می‌کند." -msgid ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps this function." +msgid "" +":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " +"this function." msgstr "" +":c:func:`PyObject_GetBuffer` رابط مصرف‌کننده‌ای است که این تابع را دربر " +"می‌گیرد." msgid "void (PyObject *exporter, Py_buffer *view);" -msgstr "" +msgstr "void (PyObject *exporter, Py_buffer *view);" -msgid "Handle a request to release the resources of the buffer. If no resources need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be ``NULL``. Otherwise, a standard implementation of this function will take these optional steps:" +msgid "" +"Handle a request to release the resources of the buffer. If no resources " +"need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " +"``NULL``. Otherwise, a standard implementation of this function will take " +"these optional steps:" msgstr "" +"درخواست آزاد کردن منابع بافر را مدیریت می‌کند. اگر هیچ منبعی نیاز به آزاد " +"شدن نداشته باشد، :c:member:`PyBufferProcs.bf_releasebuffer` می‌تواند " +"``NULL`` باشد. در غیر این صورت، یک پیاده‌سازی استاندارد از این تابع گام‌های " +"اختیاری زیر را برمی‌دارد:" msgid "Decrement an internal counter for the number of exports." -msgstr "" +msgstr "شمارنده داخلی تعداد برون‌ریزی‌ها را کاهش دهید." msgid "If the counter is ``0``, free all memory associated with *view*." -msgstr "" +msgstr "اگر شمارنده ``0`` باشد، تمام حافظه‌ی مرتبط با *view* را آزاد کنید." msgid "In the :term:`free-threaded build`:" -msgstr "" +msgstr "در :term:`free-threaded build`:" msgid "The export counter decrement in step (1) must be atomic." -msgstr "" +msgstr "کاهش شمارنده‌ی صادرات در گام (۱) باید اتمیک باشد." -msgid "Resource cleanup when the counter reaches zero must be done atomically, as the final release may race with concurrent releases from other threads and deallocation must only happen once." +msgid "" +"Resource cleanup when the counter reaches zero must be done atomically, as " +"the final release may race with concurrent releases from other threads and " +"deallocation must only happen once." msgstr "" +"پاک‌سازی منابع هنگامی که شمارنده به صفر می‌رسد باید به‌صورت اتمیک انجام شود،" +" زیرا آزادسازی نهایی ممکن است با آزادسازی‌های هم‌زمان از سوی نخ‌های دیگر " +"رقابت کند و تخصیص‌زدایی باید تنها یک‌بار رخ دهد." -msgid "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep track of buffer-specific resources. This field is guaranteed to remain constant, while a consumer MAY pass a copy of the original buffer as the *view* argument." +msgid "" +"The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " +"track of buffer-specific resources. This field is guaranteed to remain " +"constant, while a consumer MAY pass a copy of the original buffer as the " +"*view* argument." msgstr "" +"صادرکننده باید از فیلد :c:member:`~Py_buffer.internal` برای پیگیری منابع " +"مخصوص بافر استفاده کند. تضمین می‌شود که این فیلد ثابت باقی بماند، در حالی که" +" مصرف‌کننده می‌تواند رونوشتی از بافر اصلی را به‌عنوان آرگومان *view* ارسال " +"کند." -msgid "This function MUST NOT decrement ``view->obj``, since that is done automatically in :c:func:`PyBuffer_Release` (this scheme is useful for breaking reference cycles)." +msgid "" +"This function MUST NOT decrement ``view->obj``, since that is done " +"automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " +"breaking reference cycles)." msgstr "" +"این تابع به هیچ وجه نباید ``view->obj`` را کاهش دهد، زیرا این کار به‌طور " +"خودکار در :c:func:`PyBuffer_Release` انجام می‌شود (این طرح برای شکستن " +"چرخه‌های ارجاع مفید است)." -msgid ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this function." +msgid "" +":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this" +" function." msgstr "" +":c:func:`PyBuffer_Release` رابطی برای مصرف‌کننده است که این تابع را پوشش " +"می‌دهد." msgid "Async Object Structures" -msgstr "" +msgstr "ساختارهای اشیای ناهمگام" -msgid "This structure holds pointers to the functions required to implement :term:`awaitable` and :term:`asynchronous iterator` objects." +msgid "" +"This structure holds pointers to the functions required to implement " +":term:`awaitable` and :term:`asynchronous iterator` objects." msgstr "" +"این ساختار اشاره‌گرهایی به توابع مورد نیاز برای پیاده‌سازی اشیاء " +":term:`انتظارپذیر ` و :term:`پیمایش‌گر ناهمگام ` را در خود نگه می‌دارد." msgid "" "typedef struct {\n" @@ -2427,99 +4943,169 @@ msgid "" " sendfunc am_send;\n" "} PyAsyncMethods;" msgstr "" +"typedef struct {\n" +" unaryfunc am_await;\n" +" unaryfunc am_aiter;\n" +" unaryfunc am_anext;\n" +" sendfunc am_send;\n" +"} PyAsyncMethods;" msgid "PyObject *am_await(PyObject *self);" -msgstr "" +msgstr "PyObject *am_await(PyObject *self);" -msgid "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` must return ``1`` for it." +msgid "" +"The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check`" +" must return ``1`` for it." msgstr "" +"شیء بازگردانده‌شده باید یک :term:`پیمایش‌گر ` باشد؛ یعنی " +":c:func:`PyIter_Check` باید برای آن ``1`` برگرداند." -msgid "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." +msgid "" +"This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" +"اگر یک شیء :term:`awaitable` نباشد، این جایگاه می‌تواند روی ``NULL`` تنظیم " +"شود." msgid "PyObject *am_aiter(PyObject *self);" -msgstr "" +msgstr "PyObject *am_aiter(PyObject *self);" -msgid "Must return an :term:`asynchronous iterator` object. See :meth:`~object.__anext__` for details." +msgid "" +"Must return an :term:`asynchronous iterator` object. See " +":meth:`~object.__anext__` for details." msgstr "" +"باید یک شیء :term:`asynchronous iterator` برگرداند. برای جزئیات به " +":meth:`~object.__anext__` مراجعه کنید." -msgid "This slot may be set to ``NULL`` if an object does not implement asynchronous iteration protocol." +msgid "" +"This slot may be set to ``NULL`` if an object does not implement " +"asynchronous iteration protocol." msgstr "" +"اگر شیئی پروتکل پیمایش ناهمگام را پیاده‌سازی نکرده باشد، این جایگاه می‌تواند" +" برابر ``NULL`` قرار داده شود." msgid "PyObject *am_anext(PyObject *self);" -msgstr "" +msgstr "PyObject *am_anext(PyObject *self);" -msgid "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for details. This slot may be set to ``NULL``." +msgid "" +"Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " +"details. This slot may be set to ``NULL``." msgstr "" +"باید یک شیء :term:`انتظارپذیر ` برگرداند. برای جزئیات به " +":meth:`~object.__anext__` مراجعه کنید. این جایگاه می‌تواند به ``NULL`` تنظیم" +" شود." -msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" +msgid "" +"PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" msgstr "" +"PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" -msgid "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." +msgid "" +"See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" +"برای جزئیات به :c:func:`PyIter_Send` مراجعه کنید. این جایگاه می‌تواند به " +"``NULL`` تنظیم شود." msgid "Slot Type typedefs" -msgstr "" +msgstr "typedef‌های نوع جایگاه" -msgid "The purpose of this function is to separate memory allocation from memory initialization. It should return a pointer to a block of memory of adequate length for the instance, suitably aligned, and initialized to zeros, but with :c:member:`~PyObject.ob_refcnt` set to ``1`` and :c:member:`~PyObject.ob_type` set to the type argument. If the type's :c:member:`~PyTypeObject.tp_itemsize` is non-zero, the object's :c:member:`~PyVarObject.ob_size` field should be initialized to *nitems* and the length of the allocated memory block should be ``tp_basicsize + nitems*tp_itemsize``, rounded up to a multiple of ``sizeof(void*)``; otherwise, *nitems* is not used and the length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." -msgstr "" +msgid "" +"The purpose of this function is to separate memory allocation from memory " +"initialization. It should return a pointer to a block of memory of adequate" +" length for the instance, suitably aligned, and initialized to zeros, but " +"with :c:member:`~PyObject.ob_refcnt` set to ``1`` and " +":c:member:`~PyObject.ob_type` set to the type argument. If the type's " +":c:member:`~PyTypeObject.tp_itemsize` is non-zero, the object's " +":c:member:`~PyVarObject.ob_size` field should be initialized to *nitems* and" +" the length of the allocated memory block should be ``tp_basicsize + " +"nitems*tp_itemsize``, rounded up to a multiple of ``sizeof(void*)``; " +"otherwise, *nitems* is not used and the length of the block should be " +":c:member:`~PyTypeObject.tp_basicsize`." +msgstr "" +"هدف این تابع، جداسازی تخصیص حافظه از مقداردهی اولیه حافظه است. این تابع باید" +" اشاره‌گری به بلوکی از حافظه با طول مناسب برای نمونه، هم‌تراز‌شده به‌درستی و" +" مقداردهی‌شده به صفر برگرداند، اما به‌طوری‌که " +":c:member:`~PyObject.ob_refcnt` روی ``1`` و :c:member:`~PyObject.ob_type` " +"روی آرگومان نوع تنظیم شده باشد. اگر :c:member:`~PyTypeObject.tp_itemsize` " +"نوع غیرصفر باشد، فیلد :c:member:`~PyVarObject.ob_size` شیء باید به *nitems* " +"مقداردهی اولیه شود و طول بلوک حافظه تخصیص‌یافته باید ``tp_basicsize + " +"nitems*tp_itemsize`` باشد که به سمت بالا به مضربی از ``sizeof(void*)`` گرد " +"شده است؛ در غیر این صورت، *nitems* استفاده نمی‌شود و طول بلوک باید " +":c:member:`~PyTypeObject.tp_basicsize` باشد." -msgid "This function should not do any other instance initialization, not even to allocate additional memory; that should be done by :c:member:`~PyTypeObject.tp_new`." +msgid "" +"This function should not do any other instance initialization, not even to " +"allocate additional memory; that should be done by " +":c:member:`~PyTypeObject.tp_new`." msgstr "" +"این تابع نباید هیچ مقداردهی اولیه‌ی دیگری روی نمونه انجام دهد، حتی تخصیص " +"حافظه‌ی اضافی؛ این کار باید توسط :c:member:`~PyTypeObject.tp_new` انجام شود." msgid "See :c:member:`~PyTypeObject.tp_free`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_free` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_new`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_new` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_init`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_init` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_repr`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_repr` مراجعه کنید." msgid "Return the value of the named attribute for the object." -msgstr "" +msgstr "مقدار ویژگی نام‌برده‌شده را برای شیء برمی‌گرداند." -msgid "Set the value of the named attribute for the object. The value argument is set to ``NULL`` to delete the attribute." +msgid "" +"Set the value of the named attribute for the object. The value argument is " +"set to ``NULL`` to delete the attribute." msgstr "" +"مقدار ویژگی نام‌برده را برای شیء تنظیم می‌کند. آرگومان مقدار برای حذف ویژگی " +"روی ``NULL`` تنظیم می‌شود." msgid "See :c:member:`~PyTypeObject.tp_getattro`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_getattro` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_setattro`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_setattro` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_descr_get`." -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_descr_get` را ببینید." msgid "See :c:member:`~PyTypeObject.tp_descr_set`." -msgstr "" +msgstr ":c:member:`~PyTypeObject.tp_descr_set` را ببینید." msgid "See :c:member:`~PyTypeObject.tp_hash`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_hash` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_richcompare`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_richcompare` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_iter`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_iter` مراجعه کنید." msgid "See :c:member:`~PyTypeObject.tp_iternext`." -msgstr "" +msgstr "به :c:member:`~PyTypeObject.tp_iternext` مراجعه کنید." msgid "See :c:member:`~PyAsyncMethods.am_send`." -msgstr "" +msgstr "به :c:member:`~PyAsyncMethods.am_send` مراجعه کنید." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "The following are simple examples of Python type definitions. They include common usage you may encounter. Some demonstrate tricky corner cases. For more examples, practical info, and a tutorial, see :ref:`defining-new-types` and :ref:`new-types-topics`." +msgid "" +"The following are simple examples of Python type definitions. They include " +"common usage you may encounter. Some demonstrate tricky corner cases. For " +"more examples, practical info, and a tutorial, see :ref:`defining-new-types`" +" and :ref:`new-types-topics`." msgstr "" +"در ادامه، نمونه‌های ساده‌ای از تعریف نوع‌ها در پایتون آمده است. این نمونه‌ها" +" شامل کاربردهای رایجی هستند که ممکن است با آن‌ها مواجه شوید. برخی از آن‌ها " +"موارد گوشه‌ای پیچیده را نشان می‌دهند. برای مثال‌های بیشتر، اطلاعات کاربردی و" +" یک آموزش، به :ref:`defining-new-types` و :ref:`new-types-topics` مراجعه " +"کنید." msgid "A basic :ref:`static type `::" -msgstr "" +msgstr "یک :ref:`نوع ایستای پایه `::" msgid "" "typedef struct {\n" @@ -2537,9 +5123,27 @@ msgid "" " .tp_repr = (reprfunc)myobj_repr,\n" "};" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_new = myobj_new,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" -msgid "You may also find older code (especially in the CPython code base) with a more verbose initializer::" +msgid "" +"You may also find older code (especially in the CPython code base) with a " +"more verbose initializer::" msgstr "" +"ممکن است کد قدیمی‌تری نیز بیابید (به‌ویژه در کدبیس سی‌پایتون) که از " +"مقداردهنده اولیه‌ی پرحرف‌تری استفاده می‌کند::" msgid "" "static PyTypeObject MyObject_Type = {\n" @@ -2583,9 +5187,50 @@ msgid "" " myobj_new, /* tp_new */\n" "};" msgstr "" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" \"mymod.MyObject\", /* tp_name */\n" +" sizeof(MyObject), /* tp_basicsize */\n" +" 0, /* tp_itemsize */\n" +" (destructor)myobj_dealloc, /* tp_dealloc */\n" +" 0, /* tp_vectorcall_offset */\n" +" 0, /* tp_getattr */\n" +" 0, /* tp_setattr */\n" +" 0, /* tp_as_async */\n" +" (reprfunc)myobj_repr, /* tp_repr */\n" +" 0, /* tp_as_number */\n" +" 0, /* tp_as_sequence */\n" +" 0, /* tp_as_mapping */\n" +" 0, /* tp_hash */\n" +" 0, /* tp_call */\n" +" 0, /* tp_str */\n" +" 0, /* tp_getattro */\n" +" 0, /* tp_setattro */\n" +" 0, /* tp_as_buffer */\n" +" 0, /* tp_flags */\n" +" PyDoc_STR(\"My objects\"), /* tp_doc */\n" +" 0, /* tp_traverse */\n" +" 0, /* tp_clear */\n" +" 0, /* tp_richcompare */\n" +" 0, /* tp_weaklistoffset */\n" +" 0, /* tp_iter */\n" +" 0, /* tp_iternext */\n" +" 0, /* tp_methods */\n" +" 0, /* tp_members */\n" +" 0, /* tp_getset */\n" +" 0, /* tp_base */\n" +" 0, /* tp_dict */\n" +" 0, /* tp_descr_get */\n" +" 0, /* tp_descr_set */\n" +" 0, /* tp_dictoffset */\n" +" 0, /* tp_init */\n" +" 0, /* tp_alloc */\n" +" myobj_new, /* tp_new */\n" +"};" msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" +"نوعی که از ارجاع‌های ضعیف، دیکشنری‌های نمونه و هش کردن پشتیبانی می‌کند::" msgid "" "typedef struct {\n" @@ -2611,9 +5256,37 @@ msgid "" " .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n" "};" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |\n" +" Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_MANAGED_DICT |\n" +" Py_TPFLAGS_MANAGED_WEAKREF,\n" +" .tp_new = myobj_new,\n" +" .tp_traverse = (traverseproc)myobj_traverse,\n" +" .tp_clear = (inquiry)myobj_clear,\n" +" .tp_alloc = PyType_GenericNew,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +" .tp_hash = (hashfunc)myobj_hash,\n" +" .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n" +"};" -msgid "A str subclass that cannot be subclassed and cannot be called to create instances (e.g. uses a separate factory func) using :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" +msgid "" +"A str subclass that cannot be subclassed and cannot be called to create " +"instances (e.g. uses a separate factory func) using " +":c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" +"زیرکلاسی از str که نمی‌توان از آن زیرکلاس گرفت و نمی‌توان آن را برای ایجاد " +"نمونه فراخوانی کرد (مثلاً از یک تابع کارخانه‌ای جداگانه استفاده می‌کند) با " +"استفاده از پرچم :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION`::" msgid "" "typedef struct {\n" @@ -2631,9 +5304,24 @@ msgid "" " .tp_repr = (reprfunc)myobj_repr,\n" "};" msgstr "" +"typedef struct {\n" +" PyUnicodeObject raw;\n" +" char *extra;\n" +"} MyStr;\n" +"\n" +"static PyTypeObject MyStr_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyStr\",\n" +" .tp_basicsize = sizeof(MyStr),\n" +" .tp_base = NULL, // set to &PyUnicode_Type in module init\n" +" .tp_doc = PyDoc_STR(\"my custom str\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" -msgid "The simplest :ref:`static type ` with fixed-length instances::" -msgstr "" +msgid "" +"The simplest :ref:`static type ` with fixed-length instances::" +msgstr "ساده‌ترین :ref:`نوع ایستا ` با نمونه‌های با طول ثابت::" msgid "" "typedef struct {\n" @@ -2645,9 +5333,19 @@ msgid "" " .tp_name = \"mymod.MyObject\",\n" "};" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +"};" -msgid "The simplest :ref:`static type ` with variable-length instances::" -msgstr "" +msgid "" +"The simplest :ref:`static type ` with variable-length " +"instances::" +msgstr "ساده‌ترین :ref:`نوع ایستا ` با نمونه‌های با طول متغیر::" msgid "" "typedef struct {\n" @@ -2662,12 +5360,23 @@ msgid "" " .tp_itemsize = sizeof(char *),\n" "};" msgstr "" +"typedef struct {\n" +" PyObject_VAR_HEAD\n" +" const char *data[1];\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject) - sizeof(char *),\n" +" .tp_itemsize = sizeof(char *),\n" +"};" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "repr" -msgstr "" +msgstr "repr" msgid "hash" -msgstr "" +msgstr "هش" diff --git a/c-api/unicode.po b/c-api/unicode.po index 03d66dc17..0d4034dda 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -25,1246 +25,2663 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Unicode Objects and Codecs" -msgstr "" +msgstr "اشیاء یونیکد و کدک‌ها" msgid "Unicode Objects" -msgstr "" +msgstr "اشیاء یونیکد" -msgid "Since the implementation of :pep:`393` in Python 3.3, Unicode objects internally use a variety of representations, in order to allow handling the complete range of Unicode characters while staying memory efficient. There are special cases for strings where all code points are below 128, 256, or 65536; otherwise, code points must be below 1114112 (which is the full Unicode range)." -msgstr "" +msgid "" +"Since the implementation of :pep:`393` in Python 3.3, Unicode objects " +"internally use a variety of representations, in order to allow handling the " +"complete range of Unicode characters while staying memory efficient. There " +"are special cases for strings where all code points are below 128, 256, or " +"65536; otherwise, code points must be below 1114112 (which is the full " +"Unicode range)." +msgstr "" +"از زمان پیاده‌سازی :pep:`393` در پایتون 3.3، شیءهای یونیکد به‌طور داخلی از " +"نمایش‌های گوناگونی استفاده می‌کنند تا امکان مدیریت کل بازه‌ی نویسه‌های " +"یونیکد فراهم شود و در عین حال از نظر حافظه بهره‌ور باقی بمانند. برای " +"رشته‌هایی که تمام نقطه‌کدهای آن‌ها کمتر از ۱۲۸، ۲۵۶ یا ۶۵۵۳۶ است، حالت‌های " +"خاصی وجود دارد؛ در غیر این صورت، نقطه‌کدها باید کمتر از ۱۱۱۴۱۱۲ باشند (که " +"بازه‌ی کامل یونیکد است)." -msgid "UTF-8 representation is created on demand and cached in the Unicode object." +msgid "" +"UTF-8 representation is created on demand and cached in the Unicode object." msgstr "" +"بازنمایی UTF-8 به‌هنگام نیاز ایجاد می‌شود و در نهانگاه شیء یونیکد ذخیره " +"می‌شود." -msgid "The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 with deprecated APIs. See :pep:`623` for more information." +msgid "" +"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 " +"with deprecated APIs. See :pep:`623` for more information." msgstr "" +"نمایش :c:type:`Py_UNICODE` از پایتون 3.12 همراه با APIهای منسوخ حذف شده است." +" برای اطلاعات بیشتر به :pep:`623` مراجعه کنید." msgid "Unicode Type" -msgstr "" +msgstr "نوع یونیکد" -msgid "These are the basic Unicode object types used for the Unicode implementation in Python:" +msgid "" +"These are the basic Unicode object types used for the Unicode implementation" +" in Python:" msgstr "" +"این‌ها انواع پایه‌ای شیء یونیکد هستند که در پیاده‌سازی یونیکد در پایتون " +"استفاده می‌شوند:" -msgid "This instance of :c:type:`PyTypeObject` represents the Python Unicode type. It is exposed to Python code as :py:class:`str`." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " +"It is exposed to Python code as :py:class:`str`." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نمایانگر نوع یونیکد پایتون است. این نوع " +"در کد پایتون به‌صورت :py:class:`str` در دسترس قرار می‌گیرد." -msgid "This instance of :c:type:`PyTypeObject` represents the Python Unicode iterator type. It is used to iterate over Unicode string objects." +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python Unicode " +"iterator type. It is used to iterate over Unicode string objects." msgstr "" +"این نمونه از :c:type:`PyTypeObject` نوع پیمایش‌گر یونیکد پایتون را نمایندگی " +"می‌کند. برای پیمایش اشیاء رشته‌ی یونیکد استفاده می‌شود." -msgid "These types are typedefs for unsigned integer types wide enough to contain characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with single Unicode characters, use :c:type:`Py_UCS4`." +msgid "" +"These types are typedefs for unsigned integer types wide enough to contain " +"characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with " +"single Unicode characters, use :c:type:`Py_UCS4`." msgstr "" +"این نوع‌ها تعریف‌های نوع (typedef) برای نوع‌های عدد صحیح بدون علامت‌اند که " +"به اندازه‌ی کافی پهن هستند تا بتوانند به ترتیب نویسه‌های ۳۲ بیتی، ۱۶ بیتی و " +"۸ بیتی را در خود جای دهند. هنگام کار با نویسه‌های منفرد یونیکد، از " +":c:type:`Py_UCS4` استفاده کنید." -msgid "These subtypes of :c:type:`PyObject` represent a Python Unicode object. In almost all cases, they shouldn't be used directly, since all API functions that deal with Unicode objects take and return :c:type:`PyObject` pointers." +msgid "" +"These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " +"almost all cases, they shouldn't be used directly, since all API functions " +"that deal with Unicode objects take and return :c:type:`PyObject` pointers." msgstr "" +"این زیرنوع‌های :c:type:`PyObject` نمایانگر یک شیء یونیکد پایتون هستند. در " +"تقریباً همه موارد، نباید مستقیماً از آن‌ها استفاده شود، زیرا تمام توابع API " +"که با اشیاء یونیکد سروکار دارند، اشاره‌گرهای :c:type:`PyObject` می‌گیرند و " +"برمی‌گردانند." -msgid "The structure of a particular object can be determined using the following macros. The macros cannot fail; their behavior is undefined if their argument is not a Python Unicode object." +msgid "" +"The structure of a particular object can be determined using the following " +"macros. The macros cannot fail; their behavior is undefined if their " +"argument is not a Python Unicode object." msgstr "" +"ساختار یک شیء خاص را می‌توان با استفاده از ماکروهای زیر تعیین کرد. این " +"ماکروها نمی‌توانند شکست بخورند؛ رفتار آن‌ها در صورتی که آرگومانشان یک شیء " +"یونیکد پایتون نباشد، تعریف‌نشده است." msgid "True if *o* uses the :c:struct:`PyCompactUnicodeObject` structure." msgstr "" +"درست است اگر *o* از ساختار :c:struct:`PyCompactUnicodeObject` استفاده کند." msgid "True if *o* uses the :c:struct:`PyASCIIObject` structure." msgstr "" +"در صورتی که *o* از ساختار :c:struct:`PyASCIIObject` استفاده کند، درست است." -msgid "The following APIs are C macros and static inlined functions for fast checks and access to internal read-only data of Unicode objects:" +msgid "" +"The following APIs are C macros and static inlined functions for fast checks" +" and access to internal read-only data of Unicode objects:" msgstr "" +"APIهای زیر ماکروهای C و توابع درون‌خطی ایستا برای بررسی‌های سریع و دسترسی به" +" داده‌های داخلی فقط‌خواندنی اشیاء یونیکد هستند:" -msgid "Return true if the object *obj* is a Unicode object or an instance of a Unicode subtype. This function always succeeds." +msgid "" +"Return true if the object *obj* is a Unicode object or an instance of a " +"Unicode subtype. This function always succeeds." msgstr "" +"اگر شیء *obj* یک شیء یونیکد یا نمونه‌ای از یک زیرنوع یونیکد باشد، مقدار true" +" برمی‌گرداند. این تابع همیشه با موفقیت انجام می‌شود." -msgid "Return true if the object *obj* is a Unicode object, but not an instance of a subtype. This function always succeeds." +msgid "" +"Return true if the object *obj* is a Unicode object, but not an instance of " +"a subtype. This function always succeeds." msgstr "" +"اگر شیء *obj* یک شیء یونیکد باشد، اما نمونه‌ای از یک زیرنوع نباشد، مقدار " +"true را برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return the length of the Unicode string, in code points. *unicode* has to be a Unicode object in the \"canonical\" representation (not checked)." +msgid "" +"Return the length of the Unicode string, in code points. *unicode* has to " +"be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" +"طول رشته یونیکد را بر حسب نقطه‌کد برمی‌گرداند. *unicode* باید یک شیء یونیکد" +" در نمایش «کانونیکال» باشد (بررسی نمی‌شود)." -msgid "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 integer types for direct character access. No checks are performed if the canonical representation has the correct character size; use :c:func:`PyUnicode_KIND` to select the right function." +msgid "" +"Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " +"integer types for direct character access. No checks are performed if the " +"canonical representation has the correct character size; use " +":c:func:`PyUnicode_KIND` to select the right function." msgstr "" +"اشاره‌گری به نمایش کانونیکال قالب‌ریزی‌شده به نوع‌های عدد صحیح UCS1، UCS2 یا" +" UCS4 را برای دسترسی مستقیم به نویسه برمی‌گرداند. هیچ بررسی‌ای انجام نمی‌شود" +" که آیا نمایش کانونیکال اندازه‌ی درست نویسه را دارد یا خیر؛ برای انتخاب تابع" +" درست از :c:func:`PyUnicode_KIND` استفاده کنید." msgid "Return values of the :c:func:`PyUnicode_KIND` macro." -msgstr "" +msgstr "مقادیر بازگشتی ماکروی :c:func:`PyUnicode_KIND`." msgid "``PyUnicode_WCHAR_KIND`` has been removed." -msgstr "" +msgstr "``PyUnicode_WCHAR_KIND`` حذف شده است." -msgid "Return one of the PyUnicode kind constants (see above) that indicate how many bytes per character this Unicode object uses to store its data. *unicode* has to be a Unicode object in the \"canonical\" representation (not checked)." +msgid "" +"Return one of the PyUnicode kind constants (see above) that indicate how " +"many bytes per character this Unicode object uses to store its data. " +"*unicode* has to be a Unicode object in the \"canonical\" representation " +"(not checked)." msgstr "" +"یکی از ثابت‌های kind مربوط به PyUnicode (که در بالا آمده‌اند) را برمی‌گرداند" +" که نشان می‌دهند این شیء یونیکد برای ذخیره داده‌های خود از چند بایت به ازای " +"هر نویسه استفاده می‌کند. *unicode* باید یک شیء یونیکد در نمایش «کانونیکال» " +"باشد (بررسی نمی‌شود)." -msgid "Return a void pointer to the raw Unicode buffer. *unicode* has to be a Unicode object in the \"canonical\" representation (not checked)." +msgid "" +"Return a void pointer to the raw Unicode buffer. *unicode* has to be a " +"Unicode object in the \"canonical\" representation (not checked)." msgstr "" +"یک اشاره‌گر void به بافر خام یونیکد برمی‌گرداند. *unicode* باید یک شیء " +"یونیکد در نمایش «کانونیکال» باشد (بررسی نمی‌شود)." -msgid "Write the code point *value* to the given zero-based *index* in a string." +msgid "" +"Write the code point *value* to the given zero-based *index* in a string." msgstr "" +"*مقدار* نقطه‌کد را در *اندیس* داده‌شده‌ی مبتنی بر صفر درون یک رشته می‌نویسد." -msgid "The *kind* value and *data* pointer must have been obtained from a string using :c:func:`PyUnicode_KIND` and :c:func:`PyUnicode_DATA` respectively. You must hold a reference to that string while calling :c:func:`!PyUnicode_WRITE`. All requirements of :c:func:`PyUnicode_WriteChar` also apply." +msgid "" +"The *kind* value and *data* pointer must have been obtained from a string " +"using :c:func:`PyUnicode_KIND` and :c:func:`PyUnicode_DATA` respectively. " +"You must hold a reference to that string while calling " +":c:func:`!PyUnicode_WRITE`. All requirements of " +":c:func:`PyUnicode_WriteChar` also apply." msgstr "" +"مقدار *kind* و اشاره‌گر *data* باید به ترتیب از یک رشته با استفاده از " +":c:func:`PyUnicode_KIND` و :c:func:`PyUnicode_DATA` به‌دست آمده باشند. شما " +"باید هنگام فراخوانی :c:func:`!PyUnicode_WRITE`، ارجاعی به آن رشته را نگه " +"دارید. تمام الزامات :c:func:`PyUnicode_WriteChar` نیز اعمال می‌شوند." -msgid "The function performs no checks for any of its requirements, and is intended for usage in loops." +msgid "" +"The function performs no checks for any of its requirements, and is intended" +" for usage in loops." msgstr "" +"این تابع هیچ بررسی‌ای برای هیچ‌یک از نیازمندی‌های خود انجام نمی‌دهد و برای " +"استفاده در حلقه‌ها در نظر گرفته شده است." -msgid "Read a code point from a canonical representation *data* (as obtained with :c:func:`PyUnicode_DATA`). No checks or ready calls are performed." +msgid "" +"Read a code point from a canonical representation *data* (as obtained with " +":c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" +"یک نقطه‌کد را از نمایش کانونیکال *data* (که با :c:func:`PyUnicode_DATA` به " +"دست آمده است) می‌خواند. هیچ بررسی یا فراخوانی ready انجام نمی‌شود." -msgid "Read a character from a Unicode object *unicode*, which must be in the \"canonical\" representation. This is less efficient than :c:func:`PyUnicode_READ` if you do multiple consecutive reads." +msgid "" +"Read a character from a Unicode object *unicode*, which must be in the " +"\"canonical\" representation. This is less efficient than " +":c:func:`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" +"یک نویسه از شیء یونیکد *unicode* می‌خواند که باید در نمایش «کانونیکال» باشد." +" اگر چندین خواندن متوالی انجام می‌دهید، این کارایی کمتری نسبت به " +":c:func:`PyUnicode_READ` دارد." -msgid "Return the maximum code point that is suitable for creating another string based on *unicode*, which must be in the \"canonical\" representation. This is always an approximation but more efficient than iterating over the string." +msgid "" +"Return the maximum code point that is suitable for creating another string " +"based on *unicode*, which must be in the \"canonical\" representation. This" +" is always an approximation but more efficient than iterating over the " +"string." msgstr "" +"بیشینه نقطه‌کدی را برمی‌گرداند که برای ایجاد رشته‌ای دیگر بر اساس *unicode* " +"مناسب است؛ *unicode* باید در نمایش «کانونیکال» باشد. این همیشه یک تقریب است،" +" اما از پیمایش کردن رشته کارآمدتر است." -msgid "Return ``1`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`. Return ``0`` otherwise." +msgid "" +"Return ``1`` if the string is a valid identifier according to the language " +"definition, section :ref:`identifiers`. Return ``0`` otherwise." msgstr "" +"اگر رشته مطابق تعریف زبان، بخش :ref:`identifiers`، یک شناسه‌ی معتبر باشد، " +"``1`` را برمی‌گرداند. در غیر این صورت ``0`` را برمی‌گرداند." -msgid "The function does not call :c:func:`Py_FatalError` anymore if the string is not ready." +msgid "" +"The function does not call :c:func:`Py_FatalError` anymore if the string is " +"not ready." msgstr "" +"اگر رشته آماده نباشد، این تابع دیگر :c:func:`Py_FatalError` را فراخوانی " +"نمی‌کند." -msgid "Return true if the string only contains ASCII characters. Equivalent to :py:meth:`str.isascii`." +msgid "" +"Return true if the string only contains ASCII characters. Equivalent to " +":py:meth:`str.isascii`." msgstr "" +"اگر رشته فقط شامل نویسه‌های اسکی باشد، مقدار درست را برمی‌گرداند. معادل " +":py:meth:`str.isascii` است." msgid "Unicode Character Properties" -msgstr "" +msgstr "ویژگی‌های نویسه‌ی یونیکد" -msgid "Unicode provides many different character properties. The most often needed ones are available through these macros which are mapped to C functions depending on the Python configuration." +msgid "" +"Unicode provides many different character properties. The most often needed " +"ones are available through these macros which are mapped to C functions " +"depending on the Python configuration." msgstr "" +"یونیکد ویژگی‌های نویسه‌ی متعدد و گوناگونی را فراهم می‌کند. پرکاربردترین " +"آن‌ها از طریق این ماکروها در دسترس‌اند که بسته به پیکربندی پایتون به توابع C" +" نگاشت می‌شوند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." msgstr "" +"بسته به این‌که *ch* یک نویسه فاصله‌ساز باشد یا نه، ``1`` یا ``0`` " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." msgstr "" +"بسته به اینکه *ch* یک نویسه‌ی کوچک باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." msgstr "" +"بسته به اینکه *ch* یک نویسه‌ی بزرگ باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." msgstr "" +"بسته به اینکه *ch* یک نویسه‌ی عنوان‌نویسی‌شده باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." msgstr "" +"بسته به اینکه *ch* یک نویسه شکست سطر باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a decimal character." msgstr "" +"بسته به اینکه *ch* یک نویسه ده‌دهی باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." msgstr "" +"بسته به اینکه *ch* یک نویسه رقم باشد یا نه، ``1`` یا ``0`` را برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a numeric character." msgstr "" +"بسته به این‌که *ch* یک نویسه عددی باشد یا نه، ``1`` یا ``0`` برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." msgstr "" +"بسته به این‌که *ch* یک نویسه الفبایی باشد یا نه، ``1`` یا ``0`` برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric " +"character." msgstr "" +"بسته به اینکه *ch* یک نویسه الفبایی-عددی باشد یا نه، ``1`` یا ``0`` را " +"برمی‌گرداند." -msgid "Return ``1`` or ``0`` depending on whether *ch* is a printable character, in the sense of :meth:`str.isprintable`." +msgid "" +"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in" +" the sense of :meth:`str.isprintable`." msgstr "" +"بسته به اینکه *ch* یک نویسه‌ی چاپ‌پذیر در معنای :meth:`str.isprintable` باشد" +" یا نه، مقدار ``1`` یا ``0`` را برمی‌گرداند." msgid "These APIs can be used for fast direct character conversions:" msgstr "" +"از این APIها می‌توان برای تبدیل‌های سریع و مستقیم نویسه‌ها استفاده کرد:" msgid "Return the character *ch* converted to lower case." -msgstr "" +msgstr "نویسه‌ی *ch* را به حروف کوچک تبدیل‌شده برمی‌گرداند." msgid "Return the character *ch* converted to upper case." -msgstr "" +msgstr "نویسه *ch* را که به حروف بزرگ تبدیل شده است برمی‌گرداند." msgid "Return the character *ch* converted to title case." -msgstr "" +msgstr "نویسه *ch* تبدیل‌شده به نگارش عنوان‌نویسی را بازمی‌گرداند." -msgid "Return the character *ch* converted to a decimal positive integer. Return ``-1`` if this is not possible. This function does not raise exceptions." +msgid "" +"Return the character *ch* converted to a decimal positive integer. Return " +"``-1`` if this is not possible. This function does not raise exceptions." msgstr "" +"نویسه *ch* را به صورت یک عدد صحیح مثبت ده‌دهی تبدیل‌شده برمی‌گرداند. اگر این" +" کار ممکن نباشد، ``-1`` برمی‌گرداند. این تابع استثنا ایجاد نمی‌کند." -msgid "Return the character *ch* converted to a single digit integer. Return ``-1`` if this is not possible. This function does not raise exceptions." +msgid "" +"Return the character *ch* converted to a single digit integer. Return ``-1``" +" if this is not possible. This function does not raise exceptions." msgstr "" +"نویسه *ch* را به یک عدد صحیح تک‌رقمی تبدیل‌شده برمی‌گرداند. اگر این کار ممکن" +" نباشد، ``-1`` برمی‌گرداند. این تابع استثنا ایجاد نمی‌کند." -msgid "Return the character *ch* converted to a double. Return ``-1.0`` if this is not possible. This function does not raise exceptions." +msgid "" +"Return the character *ch* converted to a double. Return ``-1.0`` if this is " +"not possible. This function does not raise exceptions." msgstr "" +"نویسه *ch* را به یک عدد ممیز شناور با دقت مضاعف تبدیل‌شده برمی‌گرداند. اگر " +"این کار ممکن نباشد، ``-1.0`` را برمی‌گرداند. این تابع استثنا ایجاد نمی‌کند." msgid "These APIs can be used to work with surrogates:" -msgstr "" +msgstr "می‌توان از این APIها برای کار با جانشین‌ها استفاده کرد:" msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" +"بررسی می‌کند که آیا *ch* جانشین است یا خیر (``0xD800 <= ch <= 0xDFFF``)." msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." -msgstr "" +msgstr "بررسی کنید که *ch* جانشین بالایی باشد (``0xD800 <= ch <= 0xDBFF``)." msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" +"بررسی کنید که آیا *ch* یک جانشین پایین است (``0xDC00 <= ch <= 0xDFFF``)." -msgid "Return the high UTF-16 surrogate (``0xD800`` to ``0xDBFF``) for a Unicode code point in the range ``[0x10000; 0x10FFFF]``." +msgid "" +"Return the high UTF-16 surrogate (``0xD800`` to ``0xDBFF``) for a Unicode " +"code point in the range ``[0x10000; 0x10FFFF]``." msgstr "" +"بازگرداندن جانشین بالای UTF-16 (``0xD800`` تا ``0xDBFF``) برای یک نقطه‌کد " +"یونیکد در بازه‌ی ``[0x10000; 0x10FFFF]``." -msgid "Return the low UTF-16 surrogate (``0xDC00`` to ``0xDFFF``) for a Unicode code point in the range ``[0x10000; 0x10FFFF]``." +msgid "" +"Return the low UTF-16 surrogate (``0xDC00`` to ``0xDFFF``) for a Unicode " +"code point in the range ``[0x10000; 0x10FFFF]``." msgstr "" +"جانشین پایین UTF-16 (``0xDC00`` تا ``0xDFFF``) را برای یک نقطه‌کد یونیکد در " +"محدوده‌ی ``[0x10000; 0x10FFFF]`` بازمی‌گرداند." -msgid "Join two surrogate code points and return a single :c:type:`Py_UCS4` value. *high* and *low* are respectively the leading and trailing surrogates in a surrogate pair. *high* must be in the range ``[0xD800; 0xDBFF]`` and *low* must be in the range ``[0xDC00; 0xDFFF]``." +msgid "" +"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " +"*high* and *low* are respectively the leading and trailing surrogates in a " +"surrogate pair. *high* must be in the range ``[0xD800; 0xDBFF]`` and *low* " +"must be in the range ``[0xDC00; 0xDFFF]``." msgstr "" +"دو نقطه‌کد جانشین را به هم می‌پیوندد و یک مقدار :c:type:`Py_UCS4` " +"برمی‌گرداند. *high* و *low* به ترتیب جانشین پیشرو و جانشین پسرو در یک جفت " +"جانشین هستند. *high* باید در محدوده‌ی ``[0xD800; 0xDBFF]`` و *low* باید در " +"محدوده‌ی ``[0xDC00; 0xDFFF]`` باشد." msgid "Creating and accessing Unicode strings" -msgstr "" +msgstr "ایجاد و دسترسی به رشته‌های یونیکد" -msgid "To create Unicode objects and access their basic sequence properties, use these APIs:" +msgid "" +"To create Unicode objects and access their basic sequence properties, use " +"these APIs:" msgstr "" +"برای ایجاد اشیاء یونیکد و دسترسی به ویژگی‌های پایه‌ی دنباله‌ی آن‌ها، از این " +"API‌ها استفاده کنید:" -msgid "Create a new Unicode object. *maxchar* should be the true maximum code point to be placed in the string. As an approximation, it can be rounded up to the nearest value in the sequence 127, 255, 65535, 1114111." +msgid "" +"Create a new Unicode object. *maxchar* should be the true maximum code " +"point to be placed in the string. As an approximation, it can be rounded up" +" to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" +"یک شیء یونیکد جدید ایجاد کنید. *maxchar* باید حداکثر نقطه‌کد واقعی‌ای باشد " +"که در رشته قرار می‌گیرد. به‌عنوان یک تقریب، می‌توان آن را رو به بالا به " +"نزدیک‌ترین مقدار در دنباله‌ی ۱۲۷، ۲۵۵، ۶۵۵۳۵، ۱۱۱۴۱۱۱ گرد کرد." msgid "On error, set an exception and return ``NULL``." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم کنید و ``NULL`` را برگردانید." -msgid "After creation, the string can be filled by :c:func:`PyUnicode_WriteChar`, :c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, :c:func:`PyUnicode_WRITE` or similar. Since strings are supposed to be immutable, take care to not “use” the result while it is being modified. In particular, before it's filled with its final contents, a string:" -msgstr "" +msgid "" +"After creation, the string can be filled by :c:func:`PyUnicode_WriteChar`, " +":c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, " +":c:func:`PyUnicode_WRITE` or similar. Since strings are supposed to be " +"immutable, take care to not “use” the result while it is being modified. In " +"particular, before it's filled with its final contents, a string:" +msgstr "" +"پس از ایجاد، می‌توان رشته را با :c:func:`PyUnicode_WriteChar`، " +":c:func:`PyUnicode_CopyCharacters`، :c:func:`PyUnicode_Fill`، " +":c:func:`PyUnicode_WRITE` یا توابع مشابه پر کرد. از آنجا که رشته‌ها باید " +"تغییرناپذیر باشند، مراقب باشید که نتیجه را هنگام تغییر «استفاده» نکنید. " +"به‌طور خاص، پیش از آنکه با محتوای نهایی خود پر شود، یک رشته:" msgid "must not be hashed," -msgstr "" +msgstr "نباید هش شود،" -msgid "must not be :c:func:`converted to UTF-8 `, or another non-\"canonical\" representation," +msgid "" +"must not be :c:func:`converted to UTF-8 `, or " +"another non-\"canonical\" representation," msgstr "" +"نباید :c:func:`به UTF-8 تبدیل شود `، یا به بازنمایی" +" غیر«کانونیکال» دیگری تبدیل شود،" msgid "must not have its reference count changed," -msgstr "" +msgstr "نباید شمارش ارجاع آن تغییر داده شود،" msgid "must not be shared with code that might do one of the above." msgstr "" +"نباید با کدی که ممکن است یکی از موارد فوق را انجام دهد به اشتراک گذاشته شود." -msgid "This list is not exhaustive. Avoiding these uses is your responsibility; Python does not always check these requirements." +msgid "" +"This list is not exhaustive. Avoiding these uses is your responsibility; " +"Python does not always check these requirements." msgstr "" +"این فهرست جامع نیست. پرهیز از این کاربردها مسئولیت شماست؛ پایتون همیشه این " +"الزامات را بررسی نمی‌کند." -msgid "To avoid accidentally exposing a partially-written string object, prefer using the :c:type:`PyUnicodeWriter` API, or one of the ``PyUnicode_From*`` functions below." +msgid "" +"To avoid accidentally exposing a partially-written string object, prefer " +"using the :c:type:`PyUnicodeWriter` API, or one of the ``PyUnicode_From*`` " +"functions below." msgstr "" +"برای جلوگیری از افشای ناخواسته‌ی شیء رشته‌ی نیمه‌نوشته، استفاده از API " +":c:type:`PyUnicodeWriter` یا یکی از توابع ``PyUnicode_From*`` زیر را ترجیح " +"دهید." -msgid "Create a new Unicode object with the given *kind* (possible values are :c:macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* units of 1, 2 or 4 bytes per character, as given by the kind." +msgid "" +"Create a new Unicode object with the given *kind* (possible values are " +":c:macro:`PyUnicode_1BYTE_KIND` etc., as returned by " +":c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* " +"units of 1, 2 or 4 bytes per character, as given by the kind." msgstr "" +"یک شیء یونیکد جدید با *kind* داده‌شده ایجاد می‌کند (مقادیر ممکن عبارت‌اند از" +" :c:macro:`PyUnicode_1BYTE_KIND` و غیره، همان‌طور که توسط " +":c:func:`PyUnicode_KIND` برگردانده می‌شوند). *buffer* باید به آرایه‌ای از " +"*size* واحدِ ۱، ۲ یا ۴ بایتی به ازای هر نویسه اشاره کند، همان‌طور که توسط " +"kind مشخص شده است." -msgid "If necessary, the input *buffer* is copied and transformed into the canonical representation. For example, if the *buffer* is a UCS4 string (:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." +msgid "" +"If necessary, the input *buffer* is copied and transformed into the " +"canonical representation. For example, if the *buffer* is a UCS4 string " +"(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the " +"UCS1 range, it will be transformed into UCS1 " +"(:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" +"در صورت نیاز، *بافر* ورودی کپی شده و به نمایش کانونیکال تبدیل می‌شود. برای " +"مثال، اگر *بافر* یک رشته‌ی UCS4 باشد (:c:macro:`PyUnicode_4BYTE_KIND`) و " +"تنها شامل نقطه‌کدهایی در محدوده‌ی UCS1 باشد، به UCS1 تبدیل می‌شود " +"(:c:macro:`PyUnicode_1BYTE_KIND`)." -msgid "Create a Unicode object from the char buffer *str*. The bytes will be interpreted as being UTF-8 encoded. The buffer is copied into the new object. The return value might be a shared object, i.e. modification of the data is not allowed." +msgid "" +"Create a Unicode object from the char buffer *str*. The bytes will be " +"interpreted as being UTF-8 encoded. The buffer is copied into the new " +"object. The return value might be a shared object, i.e. modification of the " +"data is not allowed." msgstr "" +"یک شیء یونیکد از بافر نویسه *str* ایجاد می‌کند. بایت‌ها به‌عنوان کدگذاری‌شده" +" با UTF-8 تفسیر می‌شوند. بافر در شیء جدید کپی می‌شود. مقدار بازگشتی ممکن است" +" یک شیء مشترک باشد، یعنی تغییر داده‌ها مجاز نیست." msgid "This function raises :exc:`SystemError` when:" -msgstr "" +msgstr "این تابع در موارد زیر استثنای :exc:`SystemError` را ایجاد می‌کند:" msgid "*size* < 0," -msgstr "" +msgstr "*size* < 0," msgid "*str* is ``NULL`` and *size* > 0" -msgstr "" +msgstr "*str* برابر ``NULL`` است و *size* > 0" msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." -msgstr "" +msgstr "*str* == ``NULL`` همراه با *size* > 0 دیگر مجاز نیست." -msgid "Create a Unicode object from a UTF-8 encoded null-terminated char buffer *str*." +msgid "" +"Create a Unicode object from a UTF-8 encoded null-terminated char buffer " +"*str*." msgstr "" +"یک شیء یونیکد از بافر نویسه‌ی کدگذاری‌شده با UTF-8 و پایان‌یافته با تهی " +"*str* ایجاد می‌کند." -msgid "Take a C :c:func:`printf`\\ -style *format* string and a variable number of arguments, calculate the size of the resulting Python Unicode string and return a string with the values formatted into it. The variable arguments must be C types and must correspond exactly to the format characters in the *format* ASCII-encoded string." -msgstr "" +msgid "" +"Take a C :c:func:`printf`\\ -style *format* string and a variable number of " +"arguments, calculate the size of the resulting Python Unicode string and " +"return a string with the values formatted into it. The variable arguments " +"must be C types and must correspond exactly to the format characters in the " +"*format* ASCII-encoded string." +msgstr "" +"یک رشته *قالب* به سبک :c:func:`printf`\\ در C و تعداد متغیری از آرگومان‌ها " +"می‌گیرد، اندازه‌ی رشته‌ی یونیکد پایتونِ حاصل را محاسبه می‌کند و رشته‌ای را " +"که مقادیر در آن قالب‌بندی شده‌اند برمی‌گرداند. آرگومان‌های متغیر باید " +"نوع‌های C باشند و دقیقاً با نویسه‌های قالب در رشته *قالب* کدگذاری‌شده با " +"اسکی مطابقت داشته باشند." -msgid "A conversion specifier contains two or more characters and has the following components, which must occur in this order:" +msgid "" +"A conversion specifier contains two or more characters and has the following" +" components, which must occur in this order:" msgstr "" +"مشخص‌کننده تبدیل شامل دو نویسه یا بیشتر است و دارای اجزای زیر است که باید به" +" این ترتیب ظاهر شوند:" msgid "The ``'%'`` character, which marks the start of the specifier." -msgstr "" +msgstr "نویسه‌ی ``'%'`` که آغاز مشخص‌کننده را علامت‌گذاری می‌کند." -msgid "Conversion flags (optional), which affect the result of some conversion types." +msgid "" +"Conversion flags (optional), which affect the result of some conversion " +"types." msgstr "" +"پرچم‌های تبدیل (اختیاری) که بر نتیجه‌ی برخی از نوع‌های تبدیل تأثیر " +"می‌گذارند." -msgid "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is given in the next argument, which must be of type :c:expr:`int`, and the object to convert comes after the minimum field width and optional precision." +msgid "" +"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " +"actual width is given in the next argument, which must be of type " +":c:expr:`int`, and the object to convert comes after the minimum field width" +" and optional precision." msgstr "" +"حداقل عرض میدان (اختیاری). اگر به‌صورت ``'*'`` (ستاره) مشخص شود، عرض واقعی " +"در آرگومان بعدی داده می‌شود که باید از نوع :c:expr:`int` باشد، و شیئی که " +"باید تبدیل شود، پس از حداقل عرض میدان و دقت اختیاری قرار می‌گیرد." -msgid "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is given in the next argument, which must be of type :c:expr:`int`, and the value to convert comes after the precision." +msgid "" +"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If" +" specified as ``'*'`` (an asterisk), the actual precision is given in the " +"next argument, which must be of type :c:expr:`int`, and the value to convert" +" comes after the precision." msgstr "" +"دقت (اختیاری)، به‌صورت ``'.'`` (نقطه) و به دنبال آن مقدار دقت داده می‌شود. " +"اگر به‌صورت ``'*'`` (ستاره) تعیین شود، دقت واقعی در آرگومان بعدی داده می‌شود" +" که باید از نوع :c:expr:`int` باشد، و مقداری که باید تبدیل شود پس از دقت " +"می‌آید." msgid "Length modifier (optional)." -msgstr "" +msgstr "اصلاح‌کننده‌ی طول (اختیاری)." msgid "Conversion type." -msgstr "" +msgstr "نوع تبدیل." msgid "The conversion flag characters are:" -msgstr "" +msgstr "نویسه‌های پرچم تبدیل عبارت‌اند از:" msgid "Flag" -msgstr "" +msgstr "پرچم" msgid "Meaning" -msgstr "" +msgstr "معنا" msgid "``0``" -msgstr "" +msgstr "``0``" msgid "The conversion will be zero padded for numeric values." -msgstr "" +msgstr "تبدیل برای مقادیر عددی با صفر پر خواهد شد." msgid "``-``" -msgstr "" +msgstr "``-``" -msgid "The converted value is left adjusted (overrides the ``0`` flag if both are given)." +msgid "" +"The converted value is left adjusted (overrides the ``0`` flag if both are " +"given)." msgstr "" +"مقدار تبدیل‌شده چپ‌تراز می‌شود (اگر هر دو داده شوند، پرچم ``0`` نادیده گرفته" +" می‌شود)." -msgid "The length modifiers for following integer conversions (``d``, ``i``, ``o``, ``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by default):" +msgid "" +"The length modifiers for following integer conversions (``d``, ``i``, ``o``," +" ``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " +"default):" msgstr "" +"اصلاح‌کننده‌های طول برای تبدیل‌های عدد صحیح زیر (``d``، ``i``، ``o``، ``u``،" +" ``x`` یا ``X``) نوع آرگومان را تعیین می‌کنند (:c:expr:`int` به‌طور " +"پیش‌فرض):" msgid "Modifier" -msgstr "" +msgstr "اصلاح‌گر" msgid "Types" -msgstr "" +msgstr "نوع‌ها" msgid "``l``" -msgstr "" +msgstr "``l``" msgid ":c:expr:`long` or :c:expr:`unsigned long`" -msgstr "" +msgstr ":c:expr:`long` یا :c:expr:`unsigned long`" msgid "``ll``" -msgstr "" +msgstr "``ll``" msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`long long` یا :c:expr:`unsigned long long`" msgid "``j``" -msgstr "" +msgstr "``j````" msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" -msgstr "" +msgstr ":c:type:`intmax_t` یا :c:type:`uintmax_t`" msgid "``z``" -msgstr "" +msgstr "``z``" msgid ":c:type:`size_t` or :c:type:`ssize_t`" -msgstr "" +msgstr ":c:type:`size_t` یا :c:type:`ssize_t`" msgid "``t``" -msgstr "" +msgstr "``t``" msgid ":c:type:`ptrdiff_t`" -msgstr "" +msgstr ":c:type:`ptrdiff_t`" -msgid "The length modifier ``l`` for following conversions ``s`` or ``V`` specify that the type of the argument is :c:expr:`const wchar_t*`." +msgid "" +"The length modifier ``l`` for following conversions ``s`` or ``V`` specify " +"that the type of the argument is :c:expr:`const wchar_t*`." msgstr "" +"اصلاح‌کننده‌ی طول ``l`` برای تبدیل‌های بعدی ``s`` یا ``V`` مشخص می‌کند که " +"نوع آرگومان :c:expr:`const wchar_t*` است." msgid "The conversion specifiers are:" -msgstr "" +msgstr "مشخص‌کننده‌های تبدیل عبارت‌اند از:" msgid "Conversion Specifier" -msgstr "" +msgstr "مشخص‌کننده تبدیل" msgid "Type" -msgstr "" +msgstr "نوع" msgid "Comment" -msgstr "" +msgstr "کامنت" msgid "``%``" -msgstr "" +msgstr "``%``" msgid "*n/a*" -msgstr "" +msgstr "*n/a*" msgid "The literal ``%`` character." -msgstr "" +msgstr "نویسه‌ی لفظی ``%``." msgid "``d``, ``i``" -msgstr "" +msgstr "``d``, ``i``" msgid "Specified by the length modifier" -msgstr "" +msgstr "تعیین‌شده توسط اصلاح‌گر طول (length modifier)" msgid "The decimal representation of a signed C integer." -msgstr "" +msgstr "نمایش دهدهی یک عدد صحیح علامت‌دار در C." msgid "``u``" -msgstr "" +msgstr "``u``" msgid "The decimal representation of an unsigned C integer." -msgstr "" +msgstr "نمایش مبنای ده یک عدد صحیح بدون علامت C." msgid "``o``" -msgstr "" +msgstr "``o``" msgid "The octal representation of an unsigned C integer." -msgstr "" +msgstr "نمایش مبنای هشت یک عدد صحیح بدون علامت C." msgid "``x``" -msgstr "" +msgstr "``x``" msgid "The hexadecimal representation of an unsigned C integer (lowercase)." -msgstr "" +msgstr "نمایش مبنای شانزده‌ی یک عدد صحیح بدون علامت C (با حروف کوچک)." msgid "``X``" -msgstr "" +msgstr "``X``" msgid "The hexadecimal representation of an unsigned C integer (uppercase)." -msgstr "" +msgstr "نمایش مبنای شانزده‌ی یک عدد صحیح بدون علامت C (با حروف بزرگ)." msgid "``c``" -msgstr "" +msgstr "``c``" msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" msgid "A single character." -msgstr "" +msgstr "یک نویسه." msgid "``s``" -msgstr "" +msgstr "``s``" msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" -msgstr "" +msgstr ":c:expr:`const char*` یا :c:expr:`const wchar_t*`" msgid "A null-terminated C character array." -msgstr "" +msgstr "آرایه‌ی نویسه‌ای C که با نویسه‌ی تهی پایان می‌یابد." msgid "``p``" -msgstr "" +msgstr "``p``" msgid ":c:expr:`const void*`" -msgstr "" +msgstr ":c:expr:`const void*`" -msgid "The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p\")`` except that it is guaranteed to start with the literal ``0x`` regardless of what the platform's ``printf`` yields." +msgid "" +"The hex representation of a C pointer. Mostly equivalent to " +"``printf(\"%p\")`` except that it is guaranteed to start with the literal " +"``0x`` regardless of what the platform's ``printf`` yields." msgstr "" +"نمایش مبنای شانزده‌ی یک اشاره‌گر C. عمدتاً معادل ``printf(\"%p\")`` است، با " +"این تفاوت که تضمین می‌شود صرف‌نظر از آنچه ``printf`` پلتفرم تولید می‌کند، با" +" مقدار لفظی ``0x`` آغاز شود." msgid "``A``" -msgstr "" +msgstr "``A``" msgid ":c:expr:`PyObject*`" -msgstr "" +msgstr ":c:expr:`PyObject*`" msgid "The result of calling :func:`ascii`." -msgstr "" +msgstr "نتیجه فراخوانی :func:`ascii`." msgid "``U``" -msgstr "" +msgstr "``U``" msgid "A Unicode object." -msgstr "" +msgstr "یک شیء یونیکد." msgid "``V``" -msgstr "" +msgstr "``V``" msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr "" +":c:expr:`PyObject*`، :c:expr:`const char*` یا :c:expr:`const wchar_t*`" -msgid "A Unicode object (which may be ``NULL``) and a null-terminated C character array as a second parameter (which will be used, if the first parameter is ``NULL``)." +msgid "" +"A Unicode object (which may be ``NULL``) and a null-terminated C character " +"array as a second parameter (which will be used, if the first parameter is " +"``NULL``)." msgstr "" +"یک شیء یونیکد (که ممکن است ``NULL`` باشد) و یک آرایه‌ی نویسه‌ای C " +"پایان‌یافته با نویسه تهی به‌عنوان پارامتر دوم (که اگر پارامتر اول ``NULL`` " +"باشد، استفاده خواهد شد)." msgid "``S``" -msgstr "" +msgstr "``S``" msgid "The result of calling :c:func:`PyObject_Str`." -msgstr "" +msgstr "نتیجه فراخوانی :c:func:`PyObject_Str`." msgid "``R``" -msgstr "" +msgstr "``R``" msgid "The result of calling :c:func:`PyObject_Repr`." -msgstr "" +msgstr "نتیجه‌ی فراخوانی :c:func:`PyObject_Repr`." msgid "``T``" -msgstr "" +msgstr "``T````" -msgid "Get the fully qualified name of an object type; call :c:func:`PyType_GetFullyQualifiedName`." +msgid "" +"Get the fully qualified name of an object type; call " +":c:func:`PyType_GetFullyQualifiedName`." msgstr "" +"برای به‌دست‌آوردن نام کامل نوع یک شیء، " +":c:func:`PyType_GetFullyQualifiedName` را فراخوانی کنید." msgid "``#T``" -msgstr "" +msgstr "``#T``" -msgid "Similar to ``T`` format, but use a colon (``:``) as separator between the module name and the qualified name." +msgid "" +"Similar to ``T`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." msgstr "" +"شبیه به قالب ``T``، اما از دونقطه (``:``) به‌عنوان جداکننده بین نام ماژول و " +"نام کامل استفاده می‌کند." msgid "``N``" -msgstr "" +msgstr "``N``" msgid ":c:expr:`PyTypeObject*`" -msgstr "" +msgstr ":c:expr:`PyTypeObject*`" -msgid "Get the fully qualified name of a type; call :c:func:`PyType_GetFullyQualifiedName`." +msgid "" +"Get the fully qualified name of a type; call " +":c:func:`PyType_GetFullyQualifiedName`." msgstr "" +"نام کامل یک نوع را دریافت کنید؛ :c:func:`PyType_GetFullyQualifiedName` را " +"فراخوانی کنید." msgid "``#N``" -msgstr "" +msgstr "``#N``" -msgid "Similar to ``N`` format, but use a colon (``:``) as separator between the module name and the qualified name." +msgid "" +"Similar to ``N`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." msgstr "" +"مشابه قالب ``N``، اما از دونقطه (``:``) به عنوان جداکننده بین نام ماژول و " +"نام کامل استفاده می‌کند." -msgid "The width formatter unit is number of characters rather than bytes. The precision formatter unit is number of bytes or :c:type:`wchar_t` items (if the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the ``PyObject*`` argument is ``NULL``), and a number of characters for ``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the ``PyObject*`` argument is not ``NULL``)." -msgstr "" +msgid "" +"The width formatter unit is number of characters rather than bytes. The " +"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " +"the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " +"``PyObject*`` argument is ``NULL``), and a number of characters for " +"``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the " +"``PyObject*`` argument is not ``NULL``)." +msgstr "" +"واحد قالب‌بند عرض، تعداد نویسه‌ها است نه بایت‌ها. واحد قالب‌بند دقت برای " +"``\"%s\"`` و ``\"%V\"`` (اگر آرگومان ``PyObject*`` برابر با ``NULL`` باشد)، " +"تعداد بایت‌ها یا آیتم‌های :c:type:`wchar_t` (در صورت استفاده از اصلاح‌کننده " +"طول ``l``) است، و برای ``\"%A\"``، ``\"%U\"``، ``\"%S\"``، ``\"%R\"`` و " +"``\"%V\"`` (اگر آرگومان ``PyObject*`` برابر با ``NULL`` نباشد)، تعداد " +"نویسه‌ها است." -msgid "Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or ``X``)." +msgid "" +"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision" +" is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " +"``X``)." msgstr "" +"برخلاف :c:func:`printf` در C، پرچم ``0`` حتی وقتی دقتی برای تبدیل‌های عدد " +"صحیح (``d``، ``i``، ``u``، ``o``، ``x`` یا ``X``) تعیین شده باشد، اثر دارد." msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." -msgstr "" +msgstr "پشتیبانی از ``\"%lld\"`` و ``\"%llu\"`` افزوده شد." msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." -msgstr "" +msgstr "پشتیبانی از ``\"%li\"``، ``\"%lli\"`` و ``\"%zi\"`` افزوده شد." -msgid "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, ``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." +msgid "" +"Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " +"``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" +"پشتیبانی از قالب‌بند عرض و دقت برای ``\"%s\"``، ``\"%A\"``، ``\"%U\"``، " +"``\"%V\"``، ``\"%S\"``، ``\"%R\"`` افزوده شد." -msgid "Support for conversion specifiers ``o`` and ``X``. Support for length modifiers ``j`` and ``t``. Length modifiers are now applied to all integer conversions. Length modifier ``l`` is now applied to conversion specifiers ``s`` and ``V``. Support for variable width and precision ``*``. Support for flag ``-``." -msgstr "" +msgid "" +"Support for conversion specifiers ``o`` and ``X``. Support for length " +"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " +"conversions. Length modifier ``l`` is now applied to conversion specifiers " +"``s`` and ``V``. Support for variable width and precision ``*``. Support for" +" flag ``-``." +msgstr "" +"پشتیبانی از مشخص‌کننده‌های تبدیل ``o`` و ``X``. پشتیبانی از اصلاح‌کننده‌های " +"طول ``j`` و ``t``. اصلاح‌کننده‌های طول اکنون بر همه‌ی تبدیل‌های عدد صحیح " +"اعمال می‌شوند. اصلاح‌کننده‌ی طول ``l`` اکنون بر مشخص‌کننده‌های تبدیل ``s`` و" +" ``V`` اعمال می‌شود. پشتیبانی از عرض و دقت متغیر ``*``. پشتیبانی از پرچم " +"``-``." -msgid "An unrecognized format character now sets a :exc:`SystemError`. In previous versions it caused all the rest of the format string to be copied as-is to the result string, and any extra arguments discarded." +msgid "" +"An unrecognized format character now sets a :exc:`SystemError`. In previous " +"versions it caused all the rest of the format string to be copied as-is to " +"the result string, and any extra arguments discarded." msgstr "" +"اکنون نویسه‌ی قالب‌بندی ناشناخته یک :exc:`SystemError` ایجاد می‌کند. در " +"نسخه‌های قبلی، این نویسه باعث می‌شد تمام بقیه‌ی رشته‌ی قالب عیناً در رشته‌ی " +"نتیجه رونوشت شود و هر آرگومان اضافی دور ریخته شود." msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." -msgstr "" +msgstr "پشتیبانی از قالب‌های ``%T``، ``%#T``، ``%N`` و ``%#N`` افزوده شد." -msgid "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two arguments." +msgid "" +"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two" +" arguments." msgstr "" +"یکسان با :c:func:`PyUnicode_FromFormat` است، با این تفاوت که دقیقاً دو " +"آرگومان می‌گیرد." -msgid "Copy an instance of a Unicode subtype to a new true Unicode object if necessary. If *obj* is already a true Unicode object (not a subtype), return a new :term:`strong reference` to the object." +msgid "" +"Copy an instance of a Unicode subtype to a new true Unicode object if " +"necessary. If *obj* is already a true Unicode object (not a subtype), return" +" a new :term:`strong reference` to the object." msgstr "" +"در صورت نیاز، یک نمونه از یک زیرنوع یونیکد را به یک شیء یونیکد واقعی جدید " +"کپی می‌کند. اگر *obj* از قبل یک شیء یونیکد واقعی باشد (نه یک زیرنوع)، یک " +":term:`ارجاع قوی ` جدید به همان شیء برمی‌گرداند." -msgid "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." +msgid "" +"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" +"اشیایی غیر از یونیکد یا زیرنوع‌های آن باعث ایجاد :exc:`TypeError` خواهند شد." msgid "Create a Unicode Object from the given Unicode code point *ordinal*." -msgstr "" +msgstr "یک شیء یونیکد از *ترتیبی*\\ ِ نقطه‌کد یونیکدِ داده‌شده ایجاد می‌کند." -msgid "The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in the case it is not." +msgid "" +"The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in" +" the case it is not." msgstr "" +"مقدار ترتیبی باید در ``range(0x110000)`` باشد. در صورتی که چنین نباشد، " +"استثنای :exc:`ValueError` مطرح می‌شود." msgid "Decode an encoded object *obj* to a Unicode object." -msgstr "" +msgstr "یک شیء کدگذاری‌شده *obj* را به یک شیء یونیکد کدگشایی می‌کند." -msgid ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects ` are decoded according to the given *encoding* and using the error handling defined by *errors*. Both can be ``NULL`` to have the interface use the default values (see :ref:`builtincodecs` for details)." +msgid "" +":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " +"` are decoded according to the given *encoding* and using" +" the error handling defined by *errors*. Both can be ``NULL`` to have the " +"interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" +":class:`bytes`، :class:`bytearray` و سایر :term:`اشیاء شبه‌بایت ` بر اساس *encoding* داده‌شده و با استفاده از مدیریت خطای تعریف‌شده " +"توسط *errors* کدگشایی می‌شوند. هر دو می‌توانند ``NULL`` باشند تا رابط از " +"مقادیر پیش‌فرض استفاده کند (برای جزئیات به :ref:`builtincodecs` مراجعه " +"کنید)." -msgid "All other objects, including Unicode objects, cause a :exc:`TypeError` to be set." +msgid "" +"All other objects, including Unicode objects, cause a :exc:`TypeError` to be" +" set." msgstr "" +"تمام اشیاء دیگر، از جمله اشیاء یونیکد، باعث می‌شوند استثنای :exc:`TypeError`" +" تنظیم شود." -msgid "The API returns ``NULL`` if there was an error. The caller is responsible for decref'ing the returned objects." +msgid "" +"The API returns ``NULL`` if there was an error. The caller is responsible " +"for decref'ing the returned objects." msgstr "" +"در صورت وقوع خطا، این API مقدار ``NULL`` را برمی‌گرداند. کاهش شمارش ارجاع " +"(decref) اشیاء برگردانده‌شده بر عهده‌ی فراخواننده است." -msgid "Append the string *right* to the end of *p_left*. *p_left* must point to a :term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` releases (\":term:`steals `\") this reference." +msgid "" +"Append the string *right* to the end of *p_left*. *p_left* must point to a " +":term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " +"releases (\":term:`steals `\") this reference." msgstr "" +"رشته *right* را به انتهای *p_left* اضافه کنید. *p_left* باید به یک " +":term:`ارجاع قوی ` به یک شیء یونیکد اشاره کند؛ " +":c:func:`!PyUnicode_Append` این ارجاع را آزاد می‌کند (\":term:`می‌دزدد " +"`\")." msgid "On error, set *\\*p_left* to ``NULL`` and set an exception." msgstr "" +"در صورت خطا، *\\*p_left* را برابر ``NULL`` قرار دهید و یک استثنا تنظیم کنید." msgid "On success, set *\\*p_left* to a new strong reference to the result." msgstr "" +"در صورت موفقیت، *\\*p_left* را برابر با ارجاع قوی جدیدی به نتیجه قرار " +"می‌دهد." -msgid "The function is similar to :c:func:`PyUnicode_Append`, with the only difference being that it decrements the reference count of *right* by one." +msgid "" +"The function is similar to :c:func:`PyUnicode_Append`, with the only " +"difference being that it decrements the reference count of *right* by one." msgstr "" +"این تابع مشابه :c:func:`PyUnicode_Append` است و تنها تفاوت آن این است که " +"شمارش ارجاع *right* را یکی کاهش می‌دهد." -msgid "Return a mapping suitable for decoding a custom single-byte encoding. Given a Unicode string *string* of up to 256 characters representing an encoding table, returns either a compact internal mapping object or a dictionary mapping character ordinals to byte values. Raises a :exc:`TypeError` and return ``NULL`` on invalid input." -msgstr "" +msgid "" +"Return a mapping suitable for decoding a custom single-byte encoding. Given " +"a Unicode string *string* of up to 256 characters representing an encoding " +"table, returns either a compact internal mapping object or a dictionary " +"mapping character ordinals to byte values. Raises a :exc:`TypeError` and " +"return ``NULL`` on invalid input." +msgstr "" +"یک نگاشت مناسب برای کدگشایی یک کدگذاری سفارشی تک‌بایتی برمی‌گرداند. با گرفتن" +" یک رشته یونیکد *string* با حداکثر ۲۵۶ نویسه که نمایانگر یک جدول کدگذاری " +"است، یا یک شیء نگاشت داخلی فشرده یا یک دیکشنری که مقادیر ترتیبی نویسه‌ها را " +"به مقادیر بایت نگاشت می‌کند، برمی‌گرداند. در صورت نامعتبر بودن ورودی، " +"استثنای :exc:`TypeError` ایجاد کرده و ``NULL`` را برمی‌گرداند." -msgid "Return the name of the default string encoding, ``\"utf-8\"``. See :func:`sys.getdefaultencoding`." +msgid "" +"Return the name of the default string encoding, ``\"utf-8\"``. See " +":func:`sys.getdefaultencoding`." msgstr "" +"نام کدگذاری پیش‌فرض رشته، ``\"utf-8\"`` را برمی‌گرداند. به " +":func:`sys.getdefaultencoding` مراجعه کنید." -msgid "The returned string does not need to be freed, and is valid until interpreter shutdown." +msgid "" +"The returned string does not need to be freed, and is valid until " +"interpreter shutdown." msgstr "" +"رشته‌ی بازگردانده‌شده نیازی به آزاد شدن ندارد و تا خاموش شدن مفسر معتبر است." msgid "Return the length of the Unicode object, in code points." -msgstr "" +msgstr "طول شیء یونیکد را بر حسب نقطه‌کد برمی‌گرداند." msgid "On error, set an exception and return ``-1``." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم شده و ``-1`` بازگردانده می‌شود." -msgid "Copy characters from one Unicode object into another. This function performs character conversion when necessary and falls back to :c:func:`!memcpy` if possible. Returns ``-1`` and sets an exception on error, otherwise returns the number of copied characters." +msgid "" +"Copy characters from one Unicode object into another. This function " +"performs character conversion when necessary and falls back to " +":c:func:`!memcpy` if possible. Returns ``-1`` and sets an exception on " +"error, otherwise returns the number of copied characters." msgstr "" +"نویسه‌ها را از یک شیء یونیکد به شیء یونیکد دیگر کپی می‌کند. این تابع در " +"صورت نیاز تبدیل نویسه‌ها را انجام می‌دهد و در صورت امکان به " +":c:func:`!memcpy` روی می‌آورد. در صورت خطا ``-1`` برمی‌گرداند و یک استثنا " +"تنظیم می‌کند، در غیر این صورت تعداد نویسه‌های کپی‌شده را برمی‌گرداند." -msgid "The string must not have been “used” yet. See :c:func:`PyUnicode_New` for details." +msgid "" +"The string must not have been “used” yet. See :c:func:`PyUnicode_New` for " +"details." msgstr "" +"رشته نباید هنوز «استفاده شده» باشد. برای جزئیات به :c:func:`PyUnicode_New` " +"مراجعه کنید." msgid "Resize a Unicode object *\\*unicode* to the new *length* in code points." msgstr "" +"اندازه یک شیء یونیکد *\\*unicode* را به *length* جدید بر حسب نقطه‌کد تغییر " +"دهید." -msgid "Try to resize the string in place (which is usually faster than allocating a new string and copying characters), or create a new string." +msgid "" +"Try to resize the string in place (which is usually faster than allocating a" +" new string and copying characters), or create a new string." msgstr "" +"سعی کنید رشته را درجا تغییر اندازه دهید (که معمولاً سریع‌تر از تخصیص دادن یک" +" رشته جدید و کپی کردن نویسه‌ها است)، یا یک رشته جدید ایجاد کنید." -msgid "*\\*unicode* is modified to point to the new (resized) object and ``0`` is returned on success. Otherwise, ``-1`` is returned and an exception is set, and *\\*unicode* is left untouched." +msgid "" +"*\\*unicode* is modified to point to the new (resized) object and ``0`` is " +"returned on success. Otherwise, ``-1`` is returned and an exception is set, " +"and *\\*unicode* is left untouched." msgstr "" +"*\\*unicode* به‌گونه‌ای تغییر می‌کند که به شیء جدید (تغییر اندازه‌یافته) " +"اشاره کند و در صورت موفقیت ``0`` بازگردانده می‌شود. در غیر این صورت، ``-1`` " +"بازگردانده می‌شود، یک استثنا تنظیم می‌شود و *\\*unicode* دست‌نخورده باقی " +"می‌ماند." -msgid "The function doesn't check string content, the result may not be a string in canonical representation." +msgid "" +"The function doesn't check string content, the result may not be a string in" +" canonical representation." msgstr "" +"این تابع محتوای رشته را بررسی نمی‌کند و نتیجه ممکن است رشته‌ای در نمایش " +"کانونیکال نباشد." -msgid "Fill a string with a character: write *fill_char* into ``unicode[start:start+length]``." +msgid "" +"Fill a string with a character: write *fill_char* into " +"``unicode[start:start+length]``." msgstr "" +"پر کردن یک رشته با یک نویسه: نوشتن *fill_char* در " +"``unicode[start:start+length]``." -msgid "Fail if *fill_char* is bigger than the string maximum character, or if the string has more than 1 reference." +msgid "" +"Fail if *fill_char* is bigger than the string maximum character, or if the " +"string has more than 1 reference." msgstr "" +"اگر *fill_char* بزرگ‌تر از بیشینه نویسه‌ی رشته باشد یا رشته بیش از ۱ ارجاع " +"داشته باشد، شکست می‌خورد." -msgid "Return the number of written characters, or return ``-1`` and raise an exception on error." +msgid "" +"Return the number of written characters, or return ``-1`` and raise an " +"exception on error." msgstr "" +"تعداد نویسه‌های نوشته‌شده را برمی‌گرداند، یا در صورت خطا ``-1`` را " +"برمی‌گرداند و استثنا raise می‌کند." -msgid "Write a *character* to the string *unicode* at the zero-based *index*. Return ``0`` on success, ``-1`` on error with an exception set." +msgid "" +"Write a *character* to the string *unicode* at the zero-based *index*. " +"Return ``0`` on success, ``-1`` on error with an exception set." msgstr "" +"نویسه‌ی *character* را در اندیس مبنای صفرِ *index* از رشته‌ی *unicode* " +"می‌نویسد. در صورت موفقیت ``0`` و در صورت خطا با تنظیم یک استثنا ``-1`` " +"برمی‌گرداند." -msgid "This function checks that *unicode* is a Unicode object, that the index is not out of bounds, and that the object's reference count is one. See :c:func:`PyUnicode_WRITE` for a version that skips these checks, making them your responsibility." +msgid "" +"This function checks that *unicode* is a Unicode object, that the index is " +"not out of bounds, and that the object's reference count is one. See " +":c:func:`PyUnicode_WRITE` for a version that skips these checks, making them" +" your responsibility." msgstr "" +"این تابع بررسی می‌کند که *unicode* یک شیء یونیکد باشد، که اندیس خارج از " +"محدوده نباشد، و اینکه شمارش ارجاع شیء برابر با یک باشد. برای نسخه‌ای که این " +"بررسی‌ها را انجام نمی‌دهد و مسئولیت آن‌ها را بر عهده‌ی شما می‌گذارد، به " +":c:func:`PyUnicode_WRITE` مراجعه کنید." -msgid "Read a character from a string. This function checks that *unicode* is a Unicode object and the index is not out of bounds, in contrast to :c:func:`PyUnicode_READ_CHAR`, which performs no error checking." +msgid "" +"Read a character from a string. This function checks that *unicode* is a " +"Unicode object and the index is not out of bounds, in contrast to " +":c:func:`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" +"یک نویسه از یک رشته می‌خواند. این تابع بررسی می‌کند که *unicode* یک شیء " +"یونیکد باشد و اندیس خارج از کران‌ها نباشد، برخلاف " +":c:func:`PyUnicode_READ_CHAR` که هیچ بررسی خطایی انجام نمی‌دهد." msgid "Return character on success, ``-1`` on error with an exception set." msgstr "" +"در صورت موفقیت نویسه و در صورت خطا ``-1`` را همراه با استثنای تنظیم‌شده " +"برمی‌گرداند." -msgid "Return a substring of *unicode*, from character index *start* (included) to character index *end* (excluded). Negative indices are not supported. On error, set an exception and return ``NULL``." +msgid "" +"Return a substring of *unicode*, from character index *start* (included) to " +"character index *end* (excluded). Negative indices are not supported. On " +"error, set an exception and return ``NULL``." msgstr "" +"زیررشته‌ای از *unicode* را برمی‌گرداند که از اندیس نویسه‌ی *start* (شامل) تا" +" اندیس نویسه‌ی *end* (بدون) است. اندیس‌های منفی پشتیبانی نمی‌شوند. در صورت " +"خطا، یک استثنا تنظیم کرده و ``NULL`` را برمی‌گرداند." -msgid "Copy the string *unicode* into a UCS4 buffer, including a null character, if *copy_null* is set. Returns ``NULL`` and sets an exception on error (in particular, a :exc:`SystemError` if *buflen* is smaller than the length of *unicode*). *buffer* is returned on success." +msgid "" +"Copy the string *unicode* into a UCS4 buffer, including a null character, if" +" *copy_null* is set. Returns ``NULL`` and sets an exception on error (in " +"particular, a :exc:`SystemError` if *buflen* is smaller than the length of " +"*unicode*). *buffer* is returned on success." msgstr "" +"رشته *unicode* را در یک بافر UCS4 کپی می‌کند و در صورت تنظیم بودن " +"*copy_null*، یک نویسه تهی نیز در آن گنجانده می‌شود. در صورت خطا، ``NULL`` را" +" برمی‌گرداند و یک استثنا تنظیم می‌کند (به‌طور خاص، :exc:`SystemError` در " +"صورتی که *buflen* کوچک‌تر از طول *unicode* باشد). در صورت موفقیت، *buffer* " +"را برمی‌گرداند." -msgid "Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:`MemoryError` set. The returned buffer always has an extra null code point appended." +msgid "" +"Copy the string *unicode* into a new UCS4 buffer that is allocated using " +":c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a " +":exc:`MemoryError` set. The returned buffer always has an extra null code " +"point appended." msgstr "" +"رشته *unicode* را به یک بافر UCS4 جدید که با استفاده از " +":c:func:`PyMem_Malloc` تخصیص داده‌شده است، کپی می‌کند. اگر این کار ناموفق " +"باشد، ``NULL`` برگردانده می‌شود و :exc:`MemoryError` تنظیم می‌شود. بافر " +"برگردانده‌شده همیشه یک نقطه‌کد تهی اضافی در انتهای خود دارد." msgid "Locale Encoding" -msgstr "" +msgstr "کدگذاری locale" -msgid "The current locale encoding can be used to decode text from the operating system." +msgid "" +"The current locale encoding can be used to decode text from the operating " +"system." msgstr "" +"از کدگذاری locale فعلی می‌توان برای کدگشایی متن از سیستم‌عامل استفاده کرد." -msgid "Decode a string from UTF-8 on Android and VxWorks, or from the current locale encoding on other platforms. The supported error handlers are ``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses ``\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a null character but cannot contain embedded null characters." -msgstr "" +msgid "" +"Decode a string from UTF-8 on Android and VxWorks, or from the current " +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The decoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. *str* must end with a" +" null character but cannot contain embedded null characters." +msgstr "" +"یک رشته را در اندروید و VxWorks از UTF-8، یا در پلتفرم‌های دیگر از کدگذاری " +"locale جاری کدگشایی می‌کند. هندلرهای خطای پشتیبانی‌شده ``\"strict\"`` و " +"``\"surrogateescape\"`` هستند (:pep:`383`). کدگشا در صورتی که *errors* " +"``NULL`` باشد، از هندلر خطای ``\"strict\"`` استفاده می‌کند. *str* باید با یک" +" نویسه تهی پایان یابد، اما نمی‌تواند شامل نویسه‌های تهی تعبیه‌شده باشد." -msgid "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :term:`filesystem encoding and error handler`." +msgid "" +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the " +":term:`filesystem encoding and error handler`." msgstr "" +"از :c:func:`PyUnicode_DecodeFSDefaultAndSize` برای کدگشایی یک رشته از " +":term:`filesystem encoding and error handler` استفاده کنید." msgid "This function ignores the :ref:`Python UTF-8 Mode `." -msgstr "" +msgstr "این تابع :ref:`حالت UTF-8 پایتون ` را نادیده می‌گیرد." msgid "The :c:func:`Py_DecodeLocale` function." -msgstr "" +msgstr "تابع :c:func:`Py_DecodeLocale`." -msgid "The function now also uses the current locale encoding for the ``surrogateescape`` error handler, except on Android. Previously, :c:func:`Py_DecodeLocale` was used for the ``surrogateescape``, and the current locale encoding was used for ``strict``." +msgid "" +"The function now also uses the current locale encoding for the " +"``surrogateescape`` error handler, except on Android. Previously, " +":c:func:`Py_DecodeLocale` was used for the ``surrogateescape``, and the " +"current locale encoding was used for ``strict``." msgstr "" +"این تابع اکنون برای هندلر خطای ``surrogateescape`` از کدگذاری locale جاری " +"نیز استفاده می‌کند، به‌جز در اندروید. پیش‌تر، :c:func:`Py_DecodeLocale` برای" +" ``surrogateescape`` استفاده می‌شد و کدگذاری locale جاری برای ``strict`` به " +"کار می‌رفت." -msgid "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string length using :c:func:`!strlen`." +msgid "" +"Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " +"length using :c:func:`!strlen`." msgstr "" +"مشابه :c:func:`PyUnicode_DecodeLocaleAndSize`، اما طول رشته را با استفاده از" +" :c:func:`!strlen` محاسبه می‌کند." -msgid "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current locale encoding on other platforms. The supported error handlers are ``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses ``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:`bytes` object. *unicode* cannot contain embedded null characters." -msgstr "" +msgid "" +"Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " +"locale encoding on other platforms. The supported error handlers are " +"``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses " +"``\"strict\"`` error handler if *errors* is ``NULL``. Return a " +":class:`bytes` object. *unicode* cannot contain embedded null characters." +msgstr "" +"یک شیء یونیکد را در اندروید و VxWorks به UTF-8، یا در پلتفرم‌های دیگر به " +"کدگذاری locale جاری کدگذاری می‌کند. هندلرهای خطای پشتیبانی‌شده عبارت‌اند از " +"``\"strict\"`` و ``\"surrogateescape\"`` (:pep:`383`). کدگذار در صورت " +"``NULL`` بودن *errors* از هندلر خطای ``\"strict\"`` استفاده می‌کند. یک شیء " +":class:`bytes` برمی‌گرداند. *unicode* نمی‌تواند حاوی نویسه‌های تهی تعبیه‌شده" +" باشد." -msgid "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:`filesystem encoding and error handler`." +msgid "" +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the " +":term:`filesystem encoding and error handler`." msgstr "" +"برای کدگذاری یک رشته به :term:`filesystem encoding and error handler` از " +":c:func:`PyUnicode_EncodeFSDefault` استفاده کنید." msgid "The :c:func:`Py_EncodeLocale` function." -msgstr "" +msgstr "تابع :c:func:`Py_EncodeLocale`." -msgid "The function now also uses the current locale encoding for the ``surrogateescape`` error handler, except on Android. Previously, :c:func:`Py_EncodeLocale` was used for the ``surrogateescape``, and the current locale encoding was used for ``strict``." +msgid "" +"The function now also uses the current locale encoding for the " +"``surrogateescape`` error handler, except on Android. Previously, " +":c:func:`Py_EncodeLocale` was used for the ``surrogateescape``, and the " +"current locale encoding was used for ``strict``." msgstr "" +"این تابع اکنون برای هندلر خطای ``surrogateescape`` نیز از کدگذاری locale " +"جاری استفاده می‌کند، به‌جز در اندروید. پیش‌تر، برای ``surrogateescape`` از " +":c:func:`Py_EncodeLocale` استفاده می‌شد و برای ``strict`` از کدگذاری locale " +"جاری به کار می‌رفت." msgid "File System Encoding" -msgstr "" +msgstr "کدگذاری فایل‌سیستم" -msgid "Functions encoding to and decoding from the :term:`filesystem encoding and error handler` (:pep:`383` and :pep:`529`)." +msgid "" +"Functions encoding to and decoding from the :term:`filesystem encoding and " +"error handler` (:pep:`383` and :pep:`529`)." msgstr "" +"توابعی که به :term:`filesystem encoding and error handler` کدگذاری و از آن " +"کدگشایی می‌کنند (:pep:`383` و :pep:`529`)." -msgid "To encode file names to :class:`bytes` during argument parsing, the ``\"O&\"`` converter should be used, passing :c:func:`!PyUnicode_FSConverter` as the conversion function:" +msgid "" +"To encode file names to :class:`bytes` during argument parsing, the " +"``\"O&\"`` converter should be used, passing " +":c:func:`!PyUnicode_FSConverter` as the conversion function:" msgstr "" +"برای کدگذاری نام پرونده‌ها به :class:`bytes` در حین پارس آرگومان‌ها، باید از" +" مبدل ``\"O&\"`` استفاده کرد و :c:func:`!PyUnicode_FSConverter` را به‌عنوان " +"تابع تبدیل‌کننده ارسال کرد:" -msgid ":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects -- obtained directly or through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is. *result* must be an address of a C variable of type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the variable to a new :term:`strong reference` to a :ref:`bytes object ` which must be released when it is no longer used and return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are not allowed in the result. On failure, return ``0`` with an exception set." -msgstr "" +msgid "" +":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " +"-- obtained directly or through the :class:`os.PathLike` interface -- to " +":class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " +"objects are output as-is. *result* must be an address of a C variable of " +"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " +"variable to a new :term:`strong reference` to a :ref:`bytes object " +"` which must be released when it is no longer used and return " +"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are " +"not allowed in the result. On failure, return ``0`` with an exception set." +msgstr "" +":ref:`مبدل PyArg_Parse\\* `: اشیاء :class:`str` را -- که " +"مستقیماً یا از طریق رابط :class:`os.PathLike` به دست آمده‌اند -- با استفاده " +"از :c:func:`PyUnicode_EncodeFSDefault` به :class:`bytes` کدگذاری می‌کند؛ " +"اشیاء :class:`bytes` بدون تغییر خروجی داده می‌شوند. *result* باید آدرس یک " +"متغیر C از نوع :c:expr:`PyObject*` (یا :c:expr:`PyBytesObject*`) باشد. در " +"صورت موفقیت، متغیر را روی یک :term:`ارجاع قوی ` جدید به " +":ref:`شیء بایت ` تنظیم می‌کند که باید هنگامی که دیگر استفاده " +"نمی‌شود آزاد شود و یک مقدار ناصفر (:c:macro:`Py_CLEANUP_SUPPORTED`) " +"برمی‌گرداند. بایت‌های تهی تعبیه‌شده در نتیجه مجاز نیستند. در صورت شکست، " +"``0`` را همراه با تنظیم یک استثنا برمی‌گرداند." -msgid "If *obj* is ``NULL``, the function releases a strong reference stored in the variable referred by *result* and returns ``1``." +msgid "" +"If *obj* is ``NULL``, the function releases a strong reference stored in the" +" variable referred by *result* and returns ``1``." msgstr "" +"اگر *obj* برابر ``NULL`` باشد، تابع ارجاع قوی ذخیره‌شده در متغیری را که " +"*result* به آن ارجاع می‌دهد آزاد می‌کند و ``1`` را برمی‌گرداند." msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "یک :term:`path-like object` را می‌پذیرد." -msgid "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the conversion function:" +msgid "" +"To decode file names to :class:`str` during argument parsing, the ``\"O&\"``" +" converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " +"conversion function:" msgstr "" +"برای کدگشایی نام پرونده‌ها به :class:`str` در حین تجزیه آرگومان‌ها، باید از " +"مبدل ``\"O&\"`` استفاده کرد و :c:func:`!PyUnicode_FSDecoder` را به‌عنوان " +"تابع تبدیل‌کننده پاس داد:" -msgid ":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects -- obtained either directly or indirectly through the :class:`os.PathLike` interface -- to :class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. *result* must be an address of a C variable of type :c:expr:`PyObject*` (or :c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:`strong reference` to a :ref:`Unicode object ` which must be released when it is no longer used and return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the result. On failure, return ``0`` with an exception set." -msgstr "" +msgid "" +":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects" +" -- obtained either directly or indirectly through the :class:`os.PathLike` " +"interface -- to :class:`str` using " +":c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output " +"as-is. *result* must be an address of a C variable of type " +":c:expr:`PyObject*` (or :c:expr:`PyUnicodeObject*`). On success, set the " +"variable to a new :term:`strong reference` to a :ref:`Unicode object " +"` which must be released when it is no longer used and " +"return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null " +"characters are not allowed in the result. On failure, return ``0`` with an " +"exception set." +msgstr "" +":ref:`مبدل PyArg_Parse\\* `: اشیاء :class:`bytes` را -- که " +"به‌طور مستقیم یا غیرمستقیم از طریق رابط :class:`os.PathLike` به دست آمده‌اند" +" -- با استفاده از :c:func:`PyUnicode_DecodeFSDefaultAndSize` به :class:`str`" +" کدگشایی می‌کند؛ اشیاء :class:`str` بدون تغییر به خروجی داده می‌شوند. " +"*result* باید نشانی یک متغیر C از نوع :c:expr:`PyObject*` (یا " +":c:expr:`PyUnicodeObject*`) باشد. در صورت موفقیت، متغیر را به یک " +":term:`ارجاع قوی ` جدید به :ref:`شیء یونیکد " +"` -- که باید هنگامی که دیگر استفاده نمی‌شود آزاد شود -- " +"تنظیم می‌کند و یک مقدار ناصفر (:c:macro:`Py_CLEANUP_SUPPORTED`) را " +"برمی‌گرداند. نتیجه نمی‌تواند شامل نویسه‌های تهی تعبیه‌شده باشد. در صورت " +"شکست، ``0`` را همراه با یک استثنای تنظیم‌شده برمی‌گرداند." -msgid "If *obj* is ``NULL``, release the strong reference to the object referred to by *result* and return ``1``." +msgid "" +"If *obj* is ``NULL``, release the strong reference to the object referred to" +" by *result* and return ``1``." msgstr "" +"اگر *obj* برابر ``NULL`` باشد، ارجاع قوی به شیئی را که *result* به آن ارجاع " +"می‌دهد آزاد کنید و ``1`` را بازگردانید." -msgid "Decode a string from the :term:`filesystem encoding and error handler`." +msgid "" +"Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" +"کدگشایی یک رشته از :term:`کدگذاری فایل‌سیستم و هندلر خطا `." -msgid "If you need to decode a string from the current locale encoding, use :c:func:`PyUnicode_DecodeLocaleAndSize`." +msgid "" +"If you need to decode a string from the current locale encoding, use " +":c:func:`PyUnicode_DecodeLocaleAndSize`." msgstr "" +"اگر نیاز دارید رشته‌ای را از کدگذاری locale جاری کدگشایی کنید، از " +":c:func:`PyUnicode_DecodeLocaleAndSize` استفاده کنید." -msgid "The :term:`filesystem error handler ` is now used." +msgid "" +"The :term:`filesystem error handler `" +" is now used." msgstr "" +"اکنون از :term:`هندلر خطای فایل‌سیستم ` استفاده می‌شود." -msgid "Decode a null-terminated string from the :term:`filesystem encoding and error handler`." +msgid "" +"Decode a null-terminated string from the :term:`filesystem encoding and " +"error handler`." msgstr "" +"کدگشایی یک رشته‌ی پایان‌یافته با تهی از :term:`کدگذاری فایل‌سیستم و هندلر " +"خطا `." -msgid "If the string length is known, use :c:func:`PyUnicode_DecodeFSDefaultAndSize`." +msgid "" +"If the string length is known, use " +":c:func:`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" +"اگر طول رشته مشخص باشد، از :c:func:`PyUnicode_DecodeFSDefaultAndSize` " +"استفاده کنید." -msgid "Encode a Unicode object to the :term:`filesystem encoding and error handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` object can contain null bytes." +msgid "" +"Encode a Unicode object to the :term:`filesystem encoding and error " +"handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " +"object can contain null bytes." msgstr "" +"یک شیء یونیکد را به :term:`filesystem encoding and error handler` کدگذاری " +"می‌کند و :class:`bytes` برمی‌گرداند. توجه داشته باشید که شیء :class:`bytes` " +"حاصل می‌تواند شامل بایت‌های تهی باشد." -msgid "If you need to encode a string to the current locale encoding, use :c:func:`PyUnicode_EncodeLocale`." +msgid "" +"If you need to encode a string to the current locale encoding, use " +":c:func:`PyUnicode_EncodeLocale`." msgstr "" +"اگر نیاز دارید رشته‌ای را به کدگذاری locale جاری کدگذاری کنید، از " +":c:func:`PyUnicode_EncodeLocale` استفاده کنید." msgid "wchar_t Support" -msgstr "" +msgstr "پشتیبانی از wchar_t" msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" +"پشتیبانی از :c:type:`wchar_t` برای پلتفرم‌هایی که از آن پشتیبانی می‌کنند:" -msgid "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the given *size*. Passing ``-1`` as the *size* indicates that the function must itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on failure." +msgid "" +"Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " +"given *size*. Passing ``-1`` as the *size* indicates that the function must " +"itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on " +"failure." msgstr "" +"یک شیء یونیکد از بافر :c:type:`wchar_t` به نام *wstr* با اندازه‌ی داده‌شده " +"*size* می‌سازد. گذراندن ``-1`` به عنوان *size* نشان می‌دهد که خودِ تابع باید" +" طول را با استفاده از :c:func:`!wcslen` محاسبه کند. در صورت شکست، ``NULL`` " +"بازمی‌گرداند." -msgid "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly trailing null termination character). Return the number of :c:type:`wchar_t` characters copied or ``-1`` in case of an error." +msgid "" +"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " +"At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly" +" trailing null termination character). Return the number of " +":c:type:`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" +"محتوای شیء یونیکد را در بافر *wstr* از نوع :c:type:`wchar_t` کپی می‌کند. " +"حداکثر *size* نویسه‌ی :c:type:`wchar_t` کپی می‌شود (بدون احتساب نویسه‌ی " +"پایانی تهی که ممکن است در انتها باشد). تعداد نویسه‌های :c:type:`wchar_t` " +"کپی‌شده را برمی‌گرداند و در صورت بروز خطا ``-1``." -msgid "When *wstr* is ``NULL``, instead return the *size* that would be required to store all of *unicode* including a terminating null." +msgid "" +"When *wstr* is ``NULL``, instead return the *size* that would be required to" +" store all of *unicode* including a terminating null." msgstr "" +"وقتی *wstr* برابر ``NULL`` باشد، به‌جای آن *اندازه*‌ای که برای ذخیره‌ی تمام " +"*unicode* شامل یک تهی پایانی لازم است، بازگردانده می‌شود." -msgid "Note that the resulting :c:expr:`wchar_t*` string may or may not be null-terminated. It is the responsibility of the caller to make sure that the :c:expr:`wchar_t*` string is null-terminated in case this is required by the application. Also, note that the :c:expr:`wchar_t*` string might contain null characters, which would cause the string to be truncated when used with most C functions." -msgstr "" +msgid "" +"Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" +"terminated. It is the responsibility of the caller to make sure that the " +":c:expr:`wchar_t*` string is null-terminated in case this is required by the" +" application. Also, note that the :c:expr:`wchar_t*` string might contain " +"null characters, which would cause the string to be truncated when used with" +" most C functions." +msgstr "" +"توجه داشته باشید که رشته‌ی حاصلِ :c:expr:`wchar_t*` ممکن است تهی‌پایان " +"(null-terminated) باشد یا نباشد. اطمینان از تهی‌پایان بودن رشته‌ی " +":c:expr:`wchar_t*` در صورتی که برنامه به آن نیاز داشته باشد، بر عهده‌ی " +"فراخوان‌کننده است. همچنین توجه داشته باشید که رشته‌ی :c:expr:`wchar_t*` ممکن" +" است حاوی نویسه‌های تهی باشد، که این امر باعث می‌شود رشته هنگام استفاده در " +"بیشتر توابع C بریده شود." -msgid "Convert the Unicode object to a wide character string. The output string always ends with a null character. If *size* is not ``NULL``, write the number of wide characters (excluding the trailing null termination character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string might contain null characters, which would cause the string to be truncated when used with most C functions. If *size* is ``NULL`` and the :c:expr:`wchar_t*` string contains null characters a :exc:`ValueError` is raised." -msgstr "" +msgid "" +"Convert the Unicode object to a wide character string. The output string " +"always ends with a null character. If *size* is not ``NULL``, write the " +"number of wide characters (excluding the trailing null termination " +"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " +"might contain null characters, which would cause the string to be truncated " +"when used with most C functions. If *size* is ``NULL`` and the " +":c:expr:`wchar_t*` string contains null characters a :exc:`ValueError` is " +"raised." +msgstr "" +"شیء یونیکد را به یک رشته نویسه پهن تبدیل می‌کند. رشته خروجی همیشه با یک " +"نویسه تهی پایان می‌یابد. اگر *size* برابر ``NULL`` نباشد، تعداد نویسه‌های " +"پهن (بدون احتساب نویسه تهی پایانی) در *\\*size* نوشته می‌شود. توجه داشته " +"باشید که رشته :c:type:`wchar_t` حاصل ممکن است شامل نویسه‌های تهی باشد، که " +"این امر باعث می‌شود رشته هنگام استفاده با بیشتر توابع C قطع شود. اگر *size* " +"برابر ``NULL`` باشد و رشته :c:expr:`wchar_t*` شامل نویسه‌های تهی باشد، " +":exc:`ValueError` مطرح می‌شود." -msgid "Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` to free it) on success. On error, returns ``NULL`` and *\\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation is failed." +msgid "" +"Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free`" +" to free it) on success. On error, returns ``NULL`` and *\\*size* is " +"undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" +"در صورت موفقیت، بافر تخصیص‌یافته توسط :c:macro:`PyMem_New` را برمی‌گرداند " +"(برای آزاد کردن آن از :c:func:`PyMem_Free` استفاده کنید). در صورت خطا، " +"``NULL`` برمی‌گرداند و *\\*size* تعریف‌نشده است. در صورت شکست تخصیص حافظه، " +"استثنای :exc:`MemoryError` را ایجاد می‌کند." -msgid "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` string contains null characters." +msgid "" +"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " +"string contains null characters." msgstr "" +"اگر *size* برابر ``NULL`` باشد و رشته‌ی :c:expr:`wchar_t*` شامل نویسه‌های " +"تهی باشد، استثنای :exc:`ValueError` را مطرح می‌کند." msgid "Built-in Codecs" -msgstr "" +msgstr "کدک‌های توکار" -msgid "Python provides a set of built-in codecs which are written in C for speed. All of these codecs are directly usable via the following functions." +msgid "" +"Python provides a set of built-in codecs which are written in C for speed. " +"All of these codecs are directly usable via the following functions." msgstr "" +"پایتون مجموعه‌ای از کدک‌های توکار را ارائه می‌کند که برای سرعت بیشتر به زبان" +" C نوشته‌شده‌اند. همه‌ی این کدک‌ها مستقیماً از طریق توابع زیر قابل استفاده " +"هستند." -msgid "Many of the following APIs take two arguments encoding and errors, and they have the same semantics as the ones of the built-in :func:`str` string object constructor." +msgid "" +"Many of the following APIs take two arguments encoding and errors, and they " +"have the same semantics as the ones of the built-in :func:`str` string " +"object constructor." msgstr "" +"بسیاری از API‌های زیر دو آرگومان encoding و errors دریافت می‌کنند و " +"معناشناسی این آرگومان‌ها با معناشناسی آرگومان‌های سازنده‌ی شیء رشته‌ی توکار " +":func:`str` یکسان است." -msgid "Setting encoding to ``NULL`` causes the default encoding to be used which is UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for encoding file names. This uses the :term:`filesystem encoding and error handler` internally." +msgid "" +"Setting encoding to ``NULL`` causes the default encoding to be used which is" +" UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` " +"for encoding file names. This uses the :term:`filesystem encoding and error " +"handler` internally." msgstr "" +"تنظیم کدگذاری به ``NULL`` باعث می‌شود از کدگذاری پیش‌فرض که UTF-8 است " +"استفاده شود. فراخوانی‌های فایل‌سیستم باید برای کدگذاری نام فایل‌ها از " +":c:func:`PyUnicode_FSConverter` استفاده کنند. این تابع به‌طور داخلی از " +":term:`کدگذاری فایل‌سیستم و هندلر خطا ` استفاده می‌کند." -msgid "Error handling is set by errors which may also be set to ``NULL`` meaning to use the default handling defined for the codec. Default error handling for all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." +msgid "" +"Error handling is set by errors which may also be set to ``NULL`` meaning to" +" use the default handling defined for the codec. Default error handling for" +" all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" +"رسیدگی به خطا توسط errors تنظیم می‌شود که ممکن است به ``NULL`` نیز تنظیم " +"شود، به این معنا که از رسیدگی پیش‌فرض تعریف‌شده برای کدک استفاده شود. " +"رسیدگی پیش‌فرض به خطا برای همه‌ی کدک‌های توکار \"strict\" است (استثنای " +":exc:`ValueError` پرتاب می‌شود)." -msgid "The codecs all use a similar interface. Only deviations from the following generic ones are documented for simplicity." +msgid "" +"The codecs all use a similar interface. Only deviations from the following " +"generic ones are documented for simplicity." msgstr "" +"همه‌ی کدک‌ها از رابط مشابهی استفاده می‌کنند. برای سادگی، تنها انحراف‌ها از " +"رابط‌های عام زیر مستند شده‌اند." msgid "Generic Codecs" -msgstr "" +msgstr "کدک‌های عمومی" msgid "The following macro is provided:" -msgstr "" +msgstr "ماکروی زیر ارائه شده است:" msgid "The Unicode code point ``U+FFFD`` (replacement character)." -msgstr "" +msgstr "نقطه‌کد یونیکد ``U+FFFD`` (نویسه جایگزینی)." -msgid "This Unicode character is used as the replacement character during decoding if the *errors* argument is set to \"replace\"." +msgid "" +"This Unicode character is used as the replacement character during decoding " +"if the *errors* argument is set to \"replace\"." msgstr "" +"اگر آرگومان *errors* روی \"replace\" تنظیم شده باشد، از این نویسه‌ی یونیکد " +"در حین کدگشایی به‌عنوان نویسه‌ی جایگزین استفاده می‌شود." msgid "These are the generic codec APIs:" -msgstr "" +msgstr "این‌ها APIهای کدک عام هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the encoded string *str*. *encoding* and *errors* have the same meaning as the parameters of the same name in the :func:`str` built-in function. The codec to be used is looked up using the Python codec registry. Return ``NULL`` if an exception was raised by the codec." -msgstr "" +msgid "" +"Create a Unicode object by decoding *size* bytes of the encoded string " +"*str*. *encoding* and *errors* have the same meaning as the parameters of " +"the same name in the :func:`str` built-in function. The codec to be used is" +" looked up using the Python codec registry. Return ``NULL`` if an exception" +" was raised by the codec." +msgstr "" +"با کدگشایی *size* بایت از رشته کدگذاری‌شده *str*، یک شیء یونیکد ایجاد " +"می‌کند. *encoding* و *errors* همان معنای پارامترهای هم‌نام در تابع توکار " +":func:`str` را دارند. کدک (codec) مورد استفاده با بهره‌گیری از رجیستری کدک " +"پایتون جستجو می‌شود. اگر استثنایی توسط کدک ایجاد‌شده باشد، ``NULL`` " +"برمی‌گرداند." -msgid "Encode a Unicode object and return the result as Python bytes object. *encoding* and *errors* have the same meaning as the parameters of the same name in the Unicode :meth:`~str.encode` method. The codec to be used is looked up using the Python codec registry. Return ``NULL`` if an exception was raised by the codec." -msgstr "" +msgid "" +"Encode a Unicode object and return the result as Python bytes object. " +"*encoding* and *errors* have the same meaning as the parameters of the same " +"name in the Unicode :meth:`~str.encode` method. The codec to be used is " +"looked up using the Python codec registry. Return ``NULL`` if an exception " +"was raised by the codec." +msgstr "" +"یک شیء یونیکد را کدگذاری می‌کند و نتیجه را به‌صورت شیء بایتی پایتون " +"برمی‌گرداند. *encoding* و *errors* همان معنای پارامترهای هم‌نام در متد " +":meth:`~str.encode` یونیکد را دارند. کدک مورد استفاده از طریق رجیستری کدک " +"پایتون جستجو می‌شود. اگر کدک استثنایی ایجاد کرده باشد، ``NULL`` را " +"برمی‌گرداند." msgid "UTF-8 Codecs" -msgstr "" +msgstr "کدک‌های UTF-8" msgid "These are the UTF-8 codec APIs:" -msgstr "" +msgstr "این‌ها APIهای کدک UTF-8 هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string" +" *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"یک شیء یونیکد با کدگشایی *size* بایت از رشته‌ی کدگذاری‌شده با UTF-8 به نام " +"*str* ایجاد می‌کند. اگر کدک استثنایی ایجاد کرده باشد، مقدار ``NULL`` را " +"برمی‌گرداند." -msgid "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If *consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will not be treated as an error. Those bytes will not be decoded and the number of bytes that have been decoded will be stored in *consumed*." +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " +"*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " +"not be treated as an error. Those bytes will not be decoded and the number " +"of bytes that have been decoded will be stored in *consumed*." msgstr "" +"اگر *consumed* برابر ``NULL`` باشد، مانند :c:func:`PyUnicode_DecodeUTF8` " +"رفتار می‌کند. اگر *consumed* برابر ``NULL`` نباشد، دنباله‌های بایتی ناقص " +"انتهایی UTF-8 به عنوان خطا در نظر گرفته نمی‌شوند. این بایت‌ها کدگشایی " +"نمی‌شوند و تعداد بایت‌هایی که کدگشایی شده‌اند در *consumed* ذخیره می‌شود." -msgid "Encode a Unicode object using UTF-8 and return the result as Python bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using UTF-8 and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از UTF-8 کدگذاری می‌کند و نتیجه را به‌صورت شیء " +"بایت پایتون برمی‌گرداند. مدیریت خطا «strict» است. اگر کدک استثنایی مطرح کرده" +" باشد، ``NULL`` را برمی‌گرداند." -msgid "The function fails if the string contains surrogate code points (``U+D800`` - ``U+DFFF``)." +msgid "" +"The function fails if the string contains surrogate code points (``U+D800`` " +"- ``U+DFFF``)." msgstr "" +"در صورتی که رشته شامل نقطه‌کدهای جانشین باشد، این تابع شکست می‌خورد " +"(``U+D800`` - ``U+DFFF``)." -msgid "Return a pointer to the UTF-8 encoding of the Unicode object, and store the size of the encoded representation (in bytes) in *size*. The *size* argument can be ``NULL``; in this case no size will be stored. The returned buffer always has an extra null byte appended (not included in *size*), regardless of whether there are any other null code points." -msgstr "" +msgid "" +"Return a pointer to the UTF-8 encoding of the Unicode object, and store the " +"size of the encoded representation (in bytes) in *size*. The *size* " +"argument can be ``NULL``; in this case no size will be stored. The returned" +" buffer always has an extra null byte appended (not included in *size*), " +"regardless of whether there are any other null code points." +msgstr "" +"یک اشاره‌گر به کدگذاری UTF-8 شیء یونیکد را برمی‌گرداند و اندازه‌ی بازنمایش " +"کدگذاری‌شده (بر حسب بایت) را در *size* ذخیره می‌کند. آرگومان *size* می‌تواند" +" ``NULL`` باشد؛ در این حالت هیچ اندازه‌ای ذخیره نمی‌شود. بافر بازگردانده‌شده" +" همیشه یک بایت تهی اضافی در انتها دارد (که در *size* حساب نمی‌شود)، صرف‌نظر " +"از اینکه نقاط کد تهی دیگری وجود داشته باشد یا نه." -msgid "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and return ``NULL``." +msgid "" +"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " +"return ``NULL``." msgstr "" +"در صورت خطا، یک استثنا تنظیم کنید، *size* را برابر ``-1`` قرار دهید (اگر " +"NULL نباشد) و ``NULL`` را برگردانید." -msgid "This caches the UTF-8 representation of the string in the Unicode object, and subsequent calls will return a pointer to the same buffer. The caller is not responsible for deallocating the buffer. The buffer is deallocated and pointers to it become invalid when the Unicode object is garbage collected." +msgid "" +"This caches the UTF-8 representation of the string in the Unicode object, " +"and subsequent calls will return a pointer to the same buffer. The caller " +"is not responsible for deallocating the buffer. The buffer is deallocated " +"and pointers to it become invalid when the Unicode object is garbage " +"collected." msgstr "" +"این کار نمایش UTF-8 رشته را در شیء یونیکد نهانگاه‌سازی می‌کند و فراخوانی‌های" +" بعدی اشاره‌گری به همان بافر را برمی‌گردانند. فراخواننده مسئول آزاد کردن " +"بافر نیست. زمانی که شیء یونیکد زباله‌روبی شود، بافر آزاد می‌شود و " +"اشاره‌گرهایی که به آن اشاره می‌کنند، نامعتبر می‌شوند." msgid "The return type is now ``const char *`` rather than ``char *``." -msgstr "" +msgstr "نوع بازگشتی اکنون ``const char *`` به‌جای ``char *`` است." msgid "This function is a part of the :ref:`limited API `." -msgstr "" +msgstr "این تابع بخشی از :ref:`API محدود ` است." msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." -msgstr "" +msgstr "مانند :c:func:`PyUnicode_AsUTF8AndSize`، اما اندازه را ذخیره نمی‌کند." -msgid "This function does not have any special behavior for `null characters `_ embedded within *unicode*. As a result, strings containing null characters will remain in the returned string, which some C functions might interpret as the end of the string, leading to truncation. If truncation is an issue, it is recommended to use :c:func:`PyUnicode_AsUTF8AndSize` instead." -msgstr "" +msgid "" +"This function does not have any special behavior for `null characters " +"`_ embedded within *unicode*. " +"As a result, strings containing null characters will remain in the returned " +"string, which some C functions might interpret as the end of the string, " +"leading to truncation. If truncation is an issue, it is recommended to use " +":c:func:`PyUnicode_AsUTF8AndSize` instead." +msgstr "" +"این تابع هیچ رفتار خاصی برای `نویسه‌های تهی " +"`_ تعبیه‌شده درون *unicode* " +"ندارد. در نتیجه، رشته‌های حاوی نویسه‌های تهی در رشته‌ی برگردانده‌شده باقی " +"می‌مانند و ممکن است برخی توابع C این نویسه‌ها را به‌عنوان پایان رشته تفسیر " +"کنند و همین امر به بریده‌شدن رشته منجر می‌شود. اگر بریده‌شدن رشته مشکل‌ساز " +"باشد، توصیه می‌شود به‌جای آن از :c:func:`PyUnicode_AsUTF8AndSize` استفاده " +"کنید." msgid "UTF-32 Codecs" -msgstr "" +msgstr "کدک‌های UTF-32" msgid "These are the UTF-32 codec APIs:" -msgstr "" +msgstr "این‌ها APIهای کُدک (codec) UTF-32 هستند:" -msgid "Decode *size* bytes from a UTF-32 encoded buffer string and return the corresponding Unicode object. *errors* (if non-``NULL``) defines the error handling. It defaults to \"strict\"." +msgid "" +"Decode *size* bytes from a UTF-32 encoded buffer string and return the " +"corresponding Unicode object. *errors* (if non-``NULL``) defines the error " +"handling. It defaults to \"strict\"." msgstr "" +"بایت‌های *size* را از یک رشته بافر کدگذاری‌شده با UTF-32 کدگشایی می‌کند و " +"شیء یونیکد متناظر را برمی‌گرداند. *errors* (در صورت ``NULL`` نبودن) برخورد " +"با خطا را تعیین می‌کند. مقدار پیش‌فرض آن \"strict\" است." -msgid "If *byteorder* is non-``NULL``, the decoder starts decoding using the given byte order::" +msgid "" +"If *byteorder* is non-``NULL``, the decoder starts decoding using the given " +"byte order::" msgstr "" +"اگر *byteorder* غیر از ``NULL`` باشد، کدگشا کدگشایی را با استفاده از ترتیب " +"بایت داده‌شده آغاز می‌کند::" msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" +"*byteorder == -1: کوچک‌اندیان\n" +"*byteorder == 0: ترتیب بومی\n" +"*byteorder == 1: بزرگ‌اندیان" -msgid "If ``*byteorder`` is zero, and the first four bytes of the input data are a byte order mark (BOM), the decoder switches to this byte order and the BOM is not copied into the resulting Unicode string. If ``*byteorder`` is ``-1`` or ``1``, any byte order mark is copied to the output." +msgid "" +"If ``*byteorder`` is zero, and the first four bytes of the input data are a " +"byte order mark (BOM), the decoder switches to this byte order and the BOM " +"is not copied into the resulting Unicode string. If ``*byteorder`` is " +"``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" +"اگر ``*byteorder`` صفر باشد و چهار بایت نخست داده‌های ورودی، نشانگر ترتیب " +"بایت (BOM) باشند، کدگشا به این ترتیب بایت تغییر می‌کند و BOM در رشته یونیکد " +"حاصل کپی نمی‌شود. اگر ``*byteorder`` برابر ``-1`` یا ``1`` باشد، هر نشانگر " +"ترتیب بایتی به خروجی کپی می‌شود." -msgid "After completion, *\\*byteorder* is set to the current byte order at the end of input data." +msgid "" +"After completion, *\\*byteorder* is set to the current byte order at the end" +" of input data." msgstr "" +"پس از اتمام، *\\*byteorder* به ترتیب بایت جاری در انتهای داده‌های ورودی " +"تنظیم می‌شود." msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" +"اگر *byteorder* برابر ``NULL`` باشد، کدک در حالت ترتیب بومی آغاز می‌کند." msgid "Return ``NULL`` if an exception was raised by the codec." -msgstr "" +msgstr "اگر استثنایی توسط کدک مطرح شده باشد، ``NULL`` برمی‌گرداند." -msgid "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If *consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not treat trailing incomplete UTF-32 byte sequences (such as a number of bytes not divisible by four) as an error. Those bytes will not be decoded and the number of bytes that have been decoded will be stored in *consumed*." -msgstr "" +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not" +" treat trailing incomplete UTF-32 byte sequences (such as a number of bytes " +"not divisible by four) as an error. Those bytes will not be decoded and the " +"number of bytes that have been decoded will be stored in *consumed*." +msgstr "" +"اگر *consumed* برابر ``NULL`` باشد، مانند :c:func:`PyUnicode_DecodeUTF32` " +"رفتار می‌کند. اگر *consumed* برابر ``NULL`` نباشد، " +":c:func:`PyUnicode_DecodeUTF32Stateful` دنباله‌های بایتی ناقص انتهایی UTF-32" +" (مانند تعدادی بایت که بر چهار بخش‌پذیر نیست) را به عنوان خطا در نظر " +"نمی‌گیرد. این بایت‌ها کدگشایی نمی‌شوند و تعداد بایت‌هایی که کدگشایی شده‌اند " +"در *consumed* ذخیره می‌شود." -msgid "Return a Python byte string using the UTF-32 encoding in native byte order. The string always starts with a BOM mark. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Return a Python byte string using the UTF-32 encoding in native byte order. " +"The string always starts with a BOM mark. Error handling is \"strict\". " +"Return ``NULL`` if an exception was raised by the codec." msgstr "" +"یک رشته بایتی پایتون را با استفاده از کدگذاری UTF-32 به ترتیب بایت بومی " +"برمی‌گرداند. این رشته همیشه با نشانگر ترتیب بایت آغاز می‌شود. مدیریت خطا " +"«strict» است. اگر استثنایی توسط کدک (codec) مطرح شده باشد، ``NULL`` را " +"برمی‌گرداند." msgid "UTF-16 Codecs" -msgstr "" +msgstr "کدک‌های UTF-16" msgid "These are the UTF-16 codec APIs:" -msgstr "" +msgstr "این‌ها API‌های کدک UTF-16 هستند:" -msgid "Decode *size* bytes from a UTF-16 encoded buffer string and return the corresponding Unicode object. *errors* (if non-``NULL``) defines the error handling. It defaults to \"strict\"." +msgid "" +"Decode *size* bytes from a UTF-16 encoded buffer string and return the " +"corresponding Unicode object. *errors* (if non-``NULL``) defines the error " +"handling. It defaults to \"strict\"." msgstr "" +"کدگشایی *size* بایت از یک رشته بافر کدگذاری‌شده با UTF-16 انجام می‌دهد و شیء" +" یونیکد متناظر را برمی‌گرداند. *errors* (در صورت ``NULL`` نبودن) مدیریت خطا " +"را تعیین می‌کند. مقدار پیش‌فرض آن \"strict\" است." -msgid "If ``*byteorder`` is zero, and the first two bytes of the input data are a byte order mark (BOM), the decoder switches to this byte order and the BOM is not copied into the resulting Unicode string. If ``*byteorder`` is ``-1`` or ``1``, any byte order mark is copied to the output (where it will result in either a ``\\ufeff`` or a ``\\ufffe`` character)." -msgstr "" +msgid "" +"If ``*byteorder`` is zero, and the first two bytes of the input data are a " +"byte order mark (BOM), the decoder switches to this byte order and the BOM " +"is not copied into the resulting Unicode string. If ``*byteorder`` is " +"``-1`` or ``1``, any byte order mark is copied to the output (where it will " +"result in either a ``\\ufeff`` or a ``\\ufffe`` character)." +msgstr "" +"اگر ``*byteorder`` صفر باشد و دو بایت نخست داده‌های ورودی، یک نشانگر ترتیب " +"بایت (BOM) باشند، کدگشا به این ترتیب بایت تغییر می‌کند و BOM در رشته یونیکدی" +" حاصل کپی نمی‌شود. اگر ``*byteorder`` برابر ``-1`` یا ``1`` باشد، هر نشانگر " +"ترتیب بایتی به خروجی کپی می‌شود (که در آن به یک نویسه‌ی ``\\ufeff`` یا " +"``\\ufffe`` تبدیل خواهد شد)." -msgid "After completion, ``*byteorder`` is set to the current byte order at the end of input data." +msgid "" +"After completion, ``*byteorder`` is set to the current byte order at the end" +" of input data." msgstr "" +"پس از تکمیل، ``*byteorder`` به ترتیب بایت جاری در انتهای داده‌های ورودی " +"تنظیم می‌شود." -msgid "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If *consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not treat trailing incomplete UTF-16 byte sequences (such as an odd number of bytes or a split surrogate pair) as an error. Those bytes will not be decoded and the number of bytes that have been decoded will be stored in *consumed*." -msgstr "" +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not" +" treat trailing incomplete UTF-16 byte sequences (such as an odd number of " +"bytes or a split surrogate pair) as an error. Those bytes will not be " +"decoded and the number of bytes that have been decoded will be stored in " +"*consumed*." +msgstr "" +"اگر *consumed* برابر با ``NULL`` باشد، مانند :c:func:`PyUnicode_DecodeUTF16`" +" رفتار می‌کند. اگر *consumed* برابر با ``NULL`` نباشد، " +":c:func:`PyUnicode_DecodeUTF16Stateful` دنباله‌های بایت ناقص انتهایی UTF-16 " +"(مانند تعداد فردی از بایت‌ها یا یک جفت جانشین جداشده) را به‌عنوان خطا در نظر" +" نمی‌گیرد. این بایت‌ها کدگشایی نمی‌شوند و تعداد بایت‌هایی که کدگشایی شده‌اند" +" در *consumed* ذخیره خواهد شد." -msgid "Return a Python byte string using the UTF-16 encoding in native byte order. The string always starts with a BOM mark. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Return a Python byte string using the UTF-16 encoding in native byte order. " +"The string always starts with a BOM mark. Error handling is \"strict\". " +"Return ``NULL`` if an exception was raised by the codec." msgstr "" +"یک رشته بایت پایتون را با استفاده از کدگذاری UTF-16 در ترتیب بایت بومی " +"برمی‌گرداند. این رشته همیشه با نشانگر ترتیب بایت (BOM) آغاز می‌شود. برخورد " +"با خطا «strict» است. اگر توسط کدک استثنایی مطرح شده باشد، ``NULL`` را " +"برمی‌گرداند." msgid "UTF-7 Codecs" -msgstr "" +msgstr "کدک‌های UTF-7" msgid "These are the UTF-7 codec APIs:" -msgstr "" +msgstr "این‌ها API‌های کدک UTF-7 هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string" +" *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"با کدگشایی *size* بایت از رشته‌ی *str* که با UTF-7 کدگذاری شده است، یک شیء " +"یونیکد ایجاد می‌کند. در صورتی که استثنایی از سوی کدک مطرح شده باشد، ``NULL``" +" را برمی‌گرداند." -msgid "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If *consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will not be treated as an error. Those bytes will not be decoded and the number of bytes that have been decoded will be stored in *consumed*." +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " +"*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " +"not be treated as an error. Those bytes will not be decoded and the number " +"of bytes that have been decoded will be stored in *consumed*." msgstr "" +"اگر *consumed* برابر ``NULL`` باشد، مانند :c:func:`PyUnicode_DecodeUTF7` " +"رفتار می‌کند. اگر *consumed* برابر ``NULL`` نباشد، بخش‌های ناقص پایانی " +"base-64 در UTF-7 به‌عنوان خطا تلقی نمی‌شوند. این بایت‌ها کدگشایی نمی‌شوند و " +"تعداد بایت‌هایی که کدگشایی شده‌اند در *consumed* ذخیره می‌شود." msgid "Unicode-Escape Codecs" -msgstr "" +msgstr "کدک‌های Unicode-Escape" msgid "These are the \"Unicode Escape\" codec APIs:" -msgstr "" +msgstr "این‌ها API‌های کدک «Unicode Escape» هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the Unicode-Escape encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the Unicode-Escape " +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." msgstr "" +"با کدگشایی *size* بایت از رشته *str* که با Unicode-Escape کدگذاری شده است، " +"یک شیء یونیکد ایجاد می‌کند. اگر استثنایی توسط کدک مطرح شده باشد، ``NULL`` " +"را برمی‌گرداند." -msgid "Encode a Unicode object using Unicode-Escape and return the result as a bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using Unicode-Escape and return the result as a " +"bytes object. Error handling is \"strict\". Return ``NULL`` if an " +"exception was raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از Unicode-Escape کدگذاری می‌کند و نتیجه را " +"به‌صورت یک شیء بایت برمی‌گرداند. مدیریت خطا \"strict\" است. اگر کدک " +"استثنایی پرتاب کرده باشد، ``NULL`` برمی‌گرداند." msgid "Raw-Unicode-Escape Codecs" -msgstr "" +msgstr "کدک‌های Raw-Unicode-Escape" msgid "These are the \"Raw Unicode Escape\" codec APIs:" -msgstr "" +msgstr "این‌ها API‌های کدک «Raw Unicode Escape» هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " +"encoded string *str*. Return ``NULL`` if an exception was raised by the " +"codec." msgstr "" +"با کدگشایی *size* بایت از رشته‌ی *str* کدگذاری‌شده با Raw-Unicode-Escape، یک" +" شیء یونیکد ایجاد می‌کند. اگر استثنایی توسط کدک ایجاد شده باشد، ``NULL`` " +"برمی‌گرداند." -msgid "Encode a Unicode object using Raw-Unicode-Escape and return the result as a bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using Raw-Unicode-Escape and return the result as a " +"bytes object. Error handling is \"strict\". Return ``NULL`` if an " +"exception was raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از Raw-Unicode-Escape کدگذاری کرده و نتیجه را " +"به‌صورت یک شیء بایت برمی‌گرداند. مدیریت خطا «strict» است. در صورت ایجاد " +"استثنا توسط کدک، ``NULL`` برگردانده می‌شود." msgid "Latin-1 Codecs" -msgstr "" +msgstr "کدک‌های Latin-1" -msgid "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 Unicode ordinals and only these are accepted by the codecs during encoding." +msgid "" +"These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " +"Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" +"این‌ها API‌های کدک Latin-1 هستند: Latin-1 با نخستین ۲۵۶ مقدار ترتیبی یونیکد " +"مطابقت دارد و کدک‌ها هنگام کدگذاری تنها همین مقادیر را می‌پذیرند." -msgid "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " +"string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"با کدگشایی *size* بایت از رشته‌ی *str* کدگذاری‌شده با Latin-1، یک شیء یونیکد" +" ایجاد می‌کند. اگر کدک استثنایی ایجاد کرده باشد، ``NULL`` را برمی‌گرداند." -msgid "Encode a Unicode object using Latin-1 and return the result as Python bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using Latin-1 and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"شیء یونیکد را با استفاده از Latin-1 کدگذاری می‌کند و نتیجه را به‌صورت شیء " +"بایت پایتون برمی‌گرداند. رسیدگی به خطا «strict» است. اگر استثنایی توسط کدک " +"مطرح شده باشد، ``NULL`` برمی‌گرداند." msgid "ASCII Codecs" -msgstr "" +msgstr "کدک‌های اسکی (codec)" -msgid "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All other codes generate errors." +msgid "" +"These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " +"other codes generate errors." msgstr "" +"این‌ها APIهای کدک (codec) اسکی هستند. فقط داده‌های اسکی ۷-بیتی پذیرفته " +"می‌شوند. تمامی کدهای دیگر خطا ایجاد می‌کنند." -msgid "Create a Unicode object by decoding *size* bytes of the ASCII encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the ASCII encoded string" +" *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"یک شیء یونیکد را با کدگشایی *size* بایت از رشته‌ی کدگذاری‌شده‌ی اسکی *str* " +"ایجاد کنید. اگر کدک استثنایی ایجاد کرده باشد، ``NULL`` را برگردانید." -msgid "Encode a Unicode object using ASCII and return the result as Python bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using ASCII and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از اسکی کدگذاری کرده و نتیجه را به‌صورت شیء بایت" +" پایتون برمی‌گرداند. مدیریت خطا «strict» است. اگر کدک استثنایی ایجاد کند، " +"``NULL`` را برمی‌گرداند." msgid "Character Map Codecs" -msgstr "" +msgstr "کدک‌های نگاشت نویسه" -msgid "This codec is special in that it can be used to implement many different codecs (and this is in fact what was done to obtain most of the standard codecs included in the :mod:`!encodings` package). The codec uses mappings to encode and decode characters. The mapping objects provided must support the :meth:`~object.__getitem__` mapping interface; dictionaries and sequences work well." -msgstr "" +msgid "" +"This codec is special in that it can be used to implement many different " +"codecs (and this is in fact what was done to obtain most of the standard " +"codecs included in the :mod:`!encodings` package). The codec uses mappings " +"to encode and decode characters. The mapping objects provided must support " +"the :meth:`~object.__getitem__` mapping interface; dictionaries and " +"sequences work well." +msgstr "" +"این کدک (codec) از این نظر خاص است که می‌توان از آن برای پیاده‌سازی بسیاری " +"از کدک‌های مختلف استفاده کرد (و در واقع همین کار برای به دست آوردن اکثر " +"کدک‌های استاندارد موجود در بسته‌ی :mod:`!encodings` انجام شده است). این کدک " +"برای کدگذاری و کدگشایی نویسه‌ها از نگاشت‌ها استفاده می‌کند. شیءهای نگاشتی " +"ارائه‌شده باید از رابط نگاشت :meth:`~object.__getitem__` پشتیبانی کنند؛ " +"دیکشنری‌ها و دنباله‌ها به‌خوبی کار می‌کنند." msgid "These are the mapping codec APIs:" -msgstr "" +msgstr "این‌ها APIهای کدک‌های نگاشتی هستند:" -msgid "Create a Unicode object by decoding *size* bytes of the encoded string *str* using the given *mapping* object. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the encoded string *str*" +" using the given *mapping* object. Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"با کدگشایی *size* بایت از رشته‌ی کدگذاری‌شده‌ی *str* با استفاده از شیء نگاشت" +" *mapping* داده‌شده، یک شیء یونیکد ایجاد می‌کند. اگر کدک استثنایی پرتاب کند،" +" ``NULL`` را برمی‌گرداند." -msgid "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* must map bytes ordinals (integers in the range from 0 to 255) to Unicode strings, integers (which are then interpreted as Unicode ordinals) or ``None``. Unmapped data bytes -- ones which cause a :exc:`LookupError`, as well as ones which get mapped to ``None``, ``0xFFFE`` or ``'\\ufffe'``, are treated as undefined mappings and cause an error." -msgstr "" +msgid "" +"If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " +"must map bytes ordinals (integers in the range from 0 to 255) to Unicode " +"strings, integers (which are then interpreted as Unicode ordinals) or " +"``None``. Unmapped data bytes -- ones which cause a :exc:`LookupError`, as " +"well as ones which get mapped to ``None``, ``0xFFFE`` or ``'\\ufffe'``, are " +"treated as undefined mappings and cause an error." +msgstr "" +"اگر *mapping* برابر ``NULL`` باشد، کدگشایی Latin-1 اعمال خواهد شد. در غیر " +"این صورت، *mapping* باید مقادیر ترتیبی بایت‌ها (اعداد صحیح در بازه‌ی ۰ تا " +"۲۵۵) را به رشته‌های یونیکد، اعداد صحیح (که سپس به عنوان مقادیر ترتیبی یونیکد" +" تفسیر می‌شوند) یا ``None`` نگاشت کند. بایت‌های داده‌ی نگاشت‌نشده -- " +"بایت‌هایی که موجب :exc:`LookupError` می‌شوند و همچنین بایت‌هایی که به " +"``None``، ``0xFFFE`` یا ``'\\ufffe'`` نگاشت می‌شوند -- به عنوان نگاشت‌های " +"تعریف‌نشده در نظر گرفته می‌شوند و باعث خطا می‌شوند." -msgid "Encode a Unicode object using the given *mapping* object and return the result as a bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using the given *mapping* object and return the " +"result as a bytes object. Error handling is \"strict\". Return ``NULL`` if" +" an exception was raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از شیء *نگاشت* داده‌شده کدگذاری می‌کند و نتیجه " +"را به‌صورت یک شیء بایت برمی‌گرداند. مدیریت خطا «strict» است. اگر کدک " +"استثنایی ایجاد کرده باشد، ``NULL`` برمی‌گرداند." -msgid "The *mapping* object must map Unicode ordinal integers to bytes objects, integers in the range from 0 to 255 or ``None``. Unmapped character ordinals (ones which cause a :exc:`LookupError`) as well as mapped to ``None`` are treated as \"undefined mapping\" and cause an error." +msgid "" +"The *mapping* object must map Unicode ordinal integers to bytes objects, " +"integers in the range from 0 to 255 or ``None``. Unmapped character " +"ordinals (ones which cause a :exc:`LookupError`) as well as mapped to " +"``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" +"شیء *نگاشت* باید اعداد صحیح ترتیبی یونیکد را به اشیاء بایت، اعداد صحیح در " +"بازه‌ی ۰ تا ۲۵۵ یا ``None`` نگاشت کند. شماره‌های ترتیبی نویسه‌های نگاشت‌نشده" +" (همان‌هایی که باعث :exc:`LookupError` می‌شوند) و همچنین آن‌هایی که به " +"``None`` نگاشت شده‌اند، به‌عنوان «نگاشت تعریف‌نشده» در نظر گرفته می‌شوند و " +"باعث خطا می‌شوند." msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" +"API کدک (codec) زیر از این جهت ویژه است که یونیکد را به یونیکد نگاشت می‌کند." -msgid "Translate a string by applying a character mapping table to it and return the resulting Unicode object. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Translate a string by applying a character mapping table to it and return " +"the resulting Unicode object. Return ``NULL`` if an exception was raised by " +"the codec." msgstr "" +"یک رشته را با اعمال جدول نگاشت نویسه بر روی آن ترجمه می‌کند و شیء یونیکد " +"حاصل را برمی‌گرداند. اگر کدک استثنا را پرتاب کرده باشد، ``NULL`` " +"برمی‌گرداند." -msgid "The mapping table must map Unicode ordinal integers to Unicode ordinal integers or ``None`` (causing deletion of the character)." +msgid "" +"The mapping table must map Unicode ordinal integers to Unicode ordinal " +"integers or ``None`` (causing deletion of the character)." msgstr "" +"جدول نگاشت باید اعداد صحیح ترتیبی یونیکد را به اعداد صحیح ترتیبی یونیکد یا " +"``None`` (که باعث حذف نویسه می‌شود) نگاشت کند." -msgid "Mapping tables need only provide the :meth:`~object.__getitem__` interface; dictionaries and sequences work well. Unmapped character ordinals (ones which cause a :exc:`LookupError`) are left untouched and are copied as-is." +msgid "" +"Mapping tables need only provide the :meth:`~object.__getitem__` interface; " +"dictionaries and sequences work well. Unmapped character ordinals (ones " +"which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" +"برای جدول‌های نگاشت، تنها ارائه رابط :meth:`~object.__getitem__` کافی است؛ " +"دیکشنری‌ها و دنباله‌ها به‌خوبی کار می‌کنند. ترتیبی‌های نگاشت‌نشده‌ی " +"نویسه‌ها (آن‌هایی که باعث :exc:`LookupError` می‌شوند) دست‌نخورده باقی " +"می‌مانند و به همان صورت کپی می‌شوند." -msgid "*errors* has the usual meaning for codecs. It may be ``NULL`` which indicates to use the default error handling." +msgid "" +"*errors* has the usual meaning for codecs. It may be ``NULL`` which " +"indicates to use the default error handling." msgstr "" +"*errors* برای کدک‌ها معنای متداول خود را دارد. ممکن است ``NULL`` باشد که " +"نشان می‌دهد از مدیریت خطای پیش‌فرض استفاده شود." msgid "MBCS codecs for Windows" -msgstr "" +msgstr "کدک‌های MBCS برای ویندوز" -msgid "These are the MBCS codec APIs. They are currently only available on Windows and use the Win32 MBCS converters to implement the conversions. Note that MBCS (or DBCS) is a class of encodings, not just one. The target encoding is defined by the user settings on the machine running the codec." +msgid "" +"These are the MBCS codec APIs. They are currently only available on Windows " +"and use the Win32 MBCS converters to implement the conversions. Note that " +"MBCS (or DBCS) is a class of encodings, not just one. The target encoding " +"is defined by the user settings on the machine running the codec." msgstr "" +"این‌ها APIهای کدک MBCS هستند. آن‌ها در حال حاضر فقط در ویندوز در دسترس هستند" +" و از مبدل‌های MBCS در Win32 برای پیاده‌سازی تبدیل‌ها استفاده می‌کنند. توجه " +"داشته باشید که MBCS (یا DBCS) دسته‌ای از کدگذاری‌هاست، نه فقط یک کدگذاری. " +"کدگذاری مقصد توسط تنظیمات کاربر روی رایانه‌ای که کدک روی آن اجرا می‌شود " +"تعریف می‌شود." -msgid "Create a Unicode object by decoding *size* bytes of the MBCS encoded string *str*. Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Create a Unicode object by decoding *size* bytes of the MBCS encoded string " +"*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"با کدگشایی *size* بایت از رشته‌ی کدگذاری‌شده‌ی MBCS با نام *str*، یک شیء " +"یونیکد ایجاد می‌کند. اگر کدک استثنایی مطرح کرده باشد، ``NULL`` برمی‌گرداند." -msgid "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If *consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not decode trailing lead byte and the number of bytes that have been decoded will be stored in *consumed*." +msgid "" +"If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " +"*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " +"decode trailing lead byte and the number of bytes that have been decoded " +"will be stored in *consumed*." msgstr "" +"اگر *consumed* برابر ``NULL`` باشد، رفتاری مانند " +":c:func:`PyUnicode_DecodeMBCS` خواهد داشت. اگر *consumed* برابر ``NULL`` " +"نباشد، :c:func:`PyUnicode_DecodeMBCSStateful` بایت پیشروی انتهایی (trailing " +"lead byte) را کدگشایی نمی‌کند و تعداد بایت‌هایی که کدگشایی شده‌اند در " +"*consumed* ذخیره می‌شود." -msgid "Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page specified by *code_page*." +msgid "" +"Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page" +" specified by *code_page*." msgstr "" +"مشابه :c:func:`PyUnicode_DecodeMBCSStateful`، با این تفاوت که از صفحه کد " +"مشخص‌شده توسط *code_page* استفاده می‌کند." -msgid "Encode a Unicode object using MBCS and return the result as Python bytes object. Error handling is \"strict\". Return ``NULL`` if an exception was raised by the codec." +msgid "" +"Encode a Unicode object using MBCS and return the result as Python bytes " +"object. Error handling is \"strict\". Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"یک شیء یونیکد را با استفاده از MBCS کدگذاری می‌کند و نتیجه را به‌صورت شیء " +"بایت پایتون برمی‌گرداند. مدیریت خطا «strict» است. اگر استثنایی توسط کدک " +"ایجاد شده باشد، ``NULL`` برمی‌گرداند." -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." +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." msgstr "" +"شیء یونیکد را با استفاده از صفحه کد مشخص‌شده کدگذاری کرده و یک شیء بایت " +"پایتون را برمی‌گرداند. اگر کدک استثنایی مطرح کرده باشد، ``NULL`` " +"برمی‌گرداند. برای گرفتن کدگذار MBCS از صفحه کد :c:macro:`!CP_ACP` استفاده " +"کنید." msgid "Methods and Slot Functions" -msgstr "" +msgstr "متدها و توابع جایگاهی" -msgid "The following APIs are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return Unicode objects or integers as appropriate." +msgid "" +"The following APIs are capable of handling Unicode objects and strings on " +"input (we refer to them as strings in the descriptions) and return Unicode " +"objects or integers as appropriate." msgstr "" +"APIهای زیر می‌توانند اشیاء یونیکد و رشته‌ها را در ورودی مدیریت کنند (در " +"توضیحات، آن‌ها را رشته می‌نامیم) و بسته به مورد، شیء یونیکد یا عدد صحیح " +"برمی‌گردانند." msgid "They all return ``NULL`` or ``-1`` if an exception occurs." -msgstr "" +msgstr "همگی در صورت وقوع استثنا ``NULL`` یا ``-1`` را برمی‌گردانند." msgid "Concat two strings giving a new Unicode string." -msgstr "" +msgstr "دو رشته را الحاق می‌کند و یک رشته یونیکد جدید به دست می‌دهد." -msgid "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, splitting will be done at all whitespace substrings. Otherwise, splits occur at the given separator. At most *maxsplit* splits will be done. If negative, no limit is set. Separators are not included in the resulting list." -msgstr "" +msgid "" +"Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " +"splitting will be done at all whitespace substrings. Otherwise, splits " +"occur at the given separator. At most *maxsplit* splits will be done. If " +"negative, no limit is set. Separators are not included in the resulting " +"list." +msgstr "" +"یک رشته را تقسیم می‌کند و فهرستی از رشته‌های یونیکد به دست می‌دهد. اگر *sep*" +" برابر ``NULL`` باشد، تقسیم در تمام زیررشته‌های فضای سفید انجام می‌شود. در " +"غیر این صورت، تقسیم‌ها در جداکننده‌ی داده‌شده رخ می‌دهند. حداکثر *maxsplit* " +"تقسیم انجام می‌شود. اگر منفی باشد، هیچ محدودیتی تعیین نمی‌شود. جداکننده‌ها " +"در فهرست حاصل قرار نمی‌گیرند." msgid "On error, return ``NULL`` with an exception set." -msgstr "" +msgstr "در صورت خطا، ``NULL`` همراه با یک استثنا تنظیم‌شده برگردانده می‌شود." msgid "Equivalent to :py:meth:`str.split`." -msgstr "" +msgstr "معادل :py:meth:`str.split` است." -msgid "Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning at the end of the string." +msgid "" +"Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " +"at the end of the string." msgstr "" +"مشابه :c:func:`PyUnicode_Split` است، اما تفکیک از انتهای رشته آغاز خواهد شد." msgid "Equivalent to :py:meth:`str.rsplit`." -msgstr "" +msgstr "معادل :py:meth:`str.rsplit` است." -msgid "Split a Unicode string at line breaks, returning a list of Unicode strings. CRLF is considered to be one line break. If *keepends* is ``0``, the Line break characters are not included in the resulting strings." +msgid "" +"Split a Unicode string at line breaks, returning a list of Unicode strings. " +"CRLF is considered to be one line break. If *keepends* is ``0``, the Line " +"break characters are not included in the resulting strings." msgstr "" +"یک رشته یونیکد را در شکست‌های سطر تفکیک می‌کند و فهرستی از رشته‌های یونیکد " +"برمی‌گرداند. CRLF به عنوان یک شکست سطر در نظر گرفته می‌شود. اگر *keepends* " +"برابر ``0`` باشد، نویسه‌های شکست سطر در رشته‌های حاصل گنجانده نمی‌شوند." -msgid "Split a Unicode string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings." +msgid "" +"Split a Unicode string at the first occurrence of *sep*, and return a " +"3-tuple containing the part before the separator, the separator itself, and " +"the part after the separator. If the separator is not found, return a " +"3-tuple containing the string itself, followed by two empty strings." msgstr "" +"یک رشته یونیکد را در نخستین رخداد *sep* تقسیم می‌کند و یک تاپل سه‌تایی شامل " +"بخش پیش از جداکننده، خود جداکننده و بخش پس از جداکننده برمی‌گرداند. اگر " +"جداکننده یافت نشود، یک تاپل سه‌تایی شامل خود رشته و به دنبال آن دو رشته خالی" +" برمی‌گرداند." msgid "*sep* must not be empty." -msgstr "" +msgstr "*sep* نباید خالی باشد." msgid "Equivalent to :py:meth:`str.partition`." -msgstr "" +msgstr "معادل با :py:meth:`str.partition` است." -msgid "Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the last occurrence of *sep*. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself." +msgid "" +"Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " +"last occurrence of *sep*. If the separator is not found, return a 3-tuple " +"containing two empty strings, followed by the string itself." msgstr "" +"مشابه :c:func:`PyUnicode_Partition` است، اما یک رشته‌ی یونیکد را در آخرین " +"رخداد *sep* جدا می‌کند. اگر جداکننده یافت نشود، یک تاپل سه‌تایی شامل دو " +"رشته‌ی خالی و سپس خودِ رشته را برمی‌گرداند." msgid "Equivalent to :py:meth:`str.rpartition`." -msgstr "" +msgstr "معادل :py:meth:`str.rpartition` است." -msgid "Join a sequence of strings using the given *separator* and return the resulting Unicode string." +msgid "" +"Join a sequence of strings using the given *separator* and return the " +"resulting Unicode string." msgstr "" +"دنباله‌ای از رشته‌ها را با استفاده از *جداکننده*\\ ‌ی داده‌شده الحاق کنید و " +"رشته‌ی یونیکدی حاصل را برگردانید." -msgid "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." +msgid "" +"Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " +"end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " +"a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" +"اگر *substr* با ``unicode[start:end]`` در انتهای مشخص‌شده تطبیق داشته باشد، " +"``1`` را برمی‌گرداند (*direction* == ``-1`` به معنای انجام تطبیق پیشوند و " +"*direction* == ``1`` به معنای تطبیق پسوند است)، در غیر این صورت ``0``. در " +"صورت وقوع خطا ``-1`` برمی‌گرداند." -msgid "Return the first position of *substr* in ``unicode[start:end]`` using the given *direction* (*direction* == ``1`` means to do a forward search, *direction* == ``-1`` a backward search). The return value is the index of the first match; a value of ``-1`` indicates that no match was found, and ``-2`` indicates that an error occurred and an exception has been set." -msgstr "" +msgid "" +"Return the first position of *substr* in ``unicode[start:end]`` using the " +"given *direction* (*direction* == ``1`` means to do a forward search, " +"*direction* == ``-1`` a backward search). The return value is the index of " +"the first match; a value of ``-1`` indicates that no match was found, and " +"``-2`` indicates that an error occurred and an exception has been set." +msgstr "" +"اولین موقعیت *substr* در ``unicode[start:end]`` را با استفاده از *direction*" +" داده‌شده برمی‌گرداند (*direction* == ``1`` به معنای انجام جستجوی رو به جلو " +"و *direction* == ``-1`` به معنای جستجوی رو به عقب است). مقدار بازگشتی اندیس " +"اولین تطبیق است؛ مقدار ``-1`` نشان می‌دهد که هیچ تطبیقی یافت نشد و ``-2`` " +"نشان می‌دهد که خطایی رخ داده و استثنایی تنظیم شده است." -msgid "Return the first position of the character *ch* in ``unicode[start:end]`` using the given *direction* (*direction* == ``1`` means to do a forward search, *direction* == ``-1`` a backward search). The return value is the index of the first match; a value of ``-1`` indicates that no match was found, and ``-2`` indicates that an error occurred and an exception has been set." -msgstr "" +msgid "" +"Return the first position of the character *ch* in ``unicode[start:end]`` " +"using the given *direction* (*direction* == ``1`` means to do a forward " +"search, *direction* == ``-1`` a backward search). The return value is the " +"index of the first match; a value of ``-1`` indicates that no match was " +"found, and ``-2`` indicates that an error occurred and an exception has been" +" set." +msgstr "" +"اولین موقعیت نویسه *ch* در ``unicode[start:end]`` را با استفاده از " +"*direction* داده‌شده برمی‌گرداند (*direction* == ``1`` به معنای انجام جستجوی" +" رو به جلو است و *direction* == ``-1`` به معنای جستجوی رو به عقب). مقدار " +"بازگشتی، اندیس اولین تطبیق است؛ مقدار ``-1`` نشان می‌دهد که هیچ تطبیقی یافت " +"نشد و ``-2`` نشان می‌دهد که خطایی رخ داده و استثنایی تنظیم شده است." -msgid "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." +msgid "" +"*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" +"*start* و *end* اکنون به‌گونه‌ای تنظیم شده‌اند که مانند " +"``unicode[start:end]`` رفتار کنند." -msgid "Return the number of non-overlapping occurrences of *substr* in ``unicode[start:end]``. Return ``-1`` if an error occurred." +msgid "" +"Return the number of non-overlapping occurrences of *substr* in " +"``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" +"تعداد رخدادهای بدون هم‌پوشانی *substr* در ``unicode[start:end]`` را " +"برمی‌گرداند. در صورت وقوع خطا، ``-1`` برگردانده می‌شود." -msgid "Replace at most *maxcount* occurrences of *substr* in *unicode* with *replstr* and return the resulting Unicode object. *maxcount* == ``-1`` means replace all occurrences." +msgid "" +"Replace at most *maxcount* occurrences of *substr* in *unicode* with " +"*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " +"means replace all occurrences." msgstr "" +"حداکثر *maxcount* تکرار از *substr* در *unicode* را با *replstr* جایگزین " +"می‌کند و شیء یونیکد حاصل را برمی‌گرداند. *maxcount* == ``-1`` به معنای " +"جایگزینی همه‌ی تکرارها است." -msgid "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, and greater than, respectively." +msgid "" +"Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " +"and greater than, respectively." msgstr "" +"دو رشته را مقایسه می‌کند و اگر کوچک‌تر باشد ``-1``، اگر مساوی باشد ``0`` و " +"اگر بزرگ‌تر باشد ``1`` برمی‌گرداند." -msgid "This function returns ``-1`` upon failure, so one should call :c:func:`PyErr_Occurred` to check for errors." +msgid "" +"This function returns ``-1`` upon failure, so one should call " +":c:func:`PyErr_Occurred` to check for errors." msgstr "" +"این تابع در صورت شکست ``-1`` را برمی‌گرداند، بنابراین برای بررسی خطاها باید " +":c:func:`PyErr_Occurred` را فراخوانی کنید." msgid "The :c:func:`PyUnicode_Equal` function." -msgstr "" +msgstr "تابع :c:func:`PyUnicode_Equal`." msgid "Test if two strings are equal:" -msgstr "" +msgstr "آزمون کنید که آیا دو رشته برابرند:" msgid "Return ``1`` if *a* is equal to *b*." -msgstr "" +msgstr "اگر *a* برابر با *b* باشد، ``1`` را برمی‌گرداند." msgid "Return ``0`` if *a* is not equal to *b*." -msgstr "" +msgstr "اگر *a* برابر *b* نباشد، ``0`` را برمی‌گرداند." -msgid "Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not a :class:`str` object." +msgid "" +"Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not a " +":class:`str` object." msgstr "" +"اگر *a* یا *b* یک شیء :class:`str` نباشد، یک استثنای :exc:`TypeError` تنظیم " +"می‌شود و ``-1`` برگردانده می‌شود." msgid "The function always succeeds if *a* and *b* are :class:`str` objects." msgstr "" +"اگر *a* و *b* شیءهای :class:`str` باشند، این تابع همیشه با موفقیت اجرا " +"می‌شود." -msgid "The function works for :class:`str` subclasses, but does not honor custom ``__eq__()`` method." +msgid "" +"The function works for :class:`str` subclasses, but does not honor custom " +"``__eq__()`` method." msgstr "" +"این تابع برای زیرکلاس‌های :class:`str` کار می‌کند، اما متد سفارشی " +"``__eq__()`` را رعایت نمی‌کند." msgid "The :c:func:`PyUnicode_Compare` function." -msgstr "" +msgstr "تابع :c:func:`PyUnicode_Compare`." -msgid "Compare a Unicode object with a char buffer which is interpreted as being UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false (``0``) otherwise. If the Unicode object contains surrogate code points (``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) is returned." -msgstr "" +msgid "" +"Compare a Unicode object with a char buffer which is interpreted as being " +"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " +"(``0``) otherwise. If the Unicode object contains surrogate code points " +"(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) " +"is returned." +msgstr "" +"یک شیء یونیکد را با یک بافر کاراکتری که به‌عنوان کدگذاری‌شده با UTF-8 یا " +"اسکی تفسیر می‌شود، مقایسه می‌کند و در صورت برابری آن‌ها مقدار درست (``1``) و" +" در غیر این صورت مقدار نادرست (``0``) را برمی‌گرداند. اگر شیء یونیکد شامل " +"نقطه‌کدهای جانشین (``U+D800`` - ``U+DFFF``) باشد یا رشته‌ی C یک UTF-8 معتبر " +"نباشد، مقدار نادرست (``0``) برگردانده می‌شود." msgid "This function does not raise exceptions." -msgstr "" +msgstr "این تابع هیچ استثنایی ایجاد نمی‌کند." -msgid "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* length using :c:func:`!strlen`. If the Unicode object contains null characters, false (``0``) is returned." +msgid "" +"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " +"length using :c:func:`!strlen`. If the Unicode object contains null " +"characters, false (``0``) is returned." msgstr "" +"مشابه :c:func:`PyUnicode_EqualToUTF8AndSize` است، اما طول *string* با " +"استفاده از :c:func:`!strlen` محاسبه می‌شود. اگر شیء یونیکد شامل نویسه‌های " +"تهی باشد، مقدار نادرست (``0``) بازگردانده می‌شود." -msgid "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, ``1`` for less than, equal, and greater than, respectively. It is best to pass only ASCII-encoded strings, but the function interprets the input string as ISO-8859-1 if it contains non-ASCII characters." +msgid "" +"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``," +" ``1`` for less than, equal, and greater than, respectively. It is best to " +"pass only ASCII-encoded strings, but the function interprets the input " +"string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" +"شیء یونیکد *unicode* را با *string* مقایسه می‌کند و به ترتیب برای کمتر از، " +"برابر با و بزرگ‌تر از، ``-1``، ``0`` و ``1`` را برمی‌گرداند. بهتر است فقط " +"رشته‌های کدگذاری‌شده با اسکی ارسال شوند، اما تابع در صورتی که رشته ورودی " +"شامل نویسه‌های غیراسکی باشد، آن را به عنوان ISO-8859-1 تفسیر می‌کند." msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" +"مقایسه غنی (rich compare) دو رشته یونیکد را انجام می‌دهد و یکی از موارد زیر " +"را برمی‌گرداند:" msgid "``NULL`` in case an exception was raised" -msgstr "" +msgstr "``NULL`` در صورتی که استثنایی رخ داده باشد" msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" -msgstr "" +msgstr ":c:data:`Py_True` یا :c:data:`Py_False` برای مقایسه‌های موفق" msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" -msgstr "" +msgstr ":c:data:`Py_NotImplemented` در صورتی که ترکیب نوع‌ها نا‌شناخته باشد" -msgid "Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." +msgid "" +"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, " +":c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" +"مقادیر ممکن برای *op* عبارت‌اند از :c:macro:`Py_GT`، :c:macro:`Py_GE`، " +":c:macro:`Py_EQ`، :c:macro:`Py_NE`، :c:macro:`Py_LT` و :c:macro:`Py_LE`." -msgid "Return a new string object from *format* and *args*; this is analogous to ``format % args``." +msgid "" +"Return a new string object from *format* and *args*; this is analogous to " +"``format % args``." msgstr "" +"شیء رشته‌ی جدیدی از *format* و *args* برمی‌گرداند؛ این همانند ``format % " +"args`` است." -msgid "Check whether *substr* is contained in *unicode* and return true or false accordingly." +msgid "" +"Check whether *substr* is contained in *unicode* and return true or false " +"accordingly." msgstr "" +"بررسی می‌کند که آیا *substr* در *unicode* موجود است و مطابق آن true یا false" +" برمی‌گرداند." -msgid "*substr* has to coerce to a one element Unicode string. ``-1`` is returned if there was an error." +msgid "" +"*substr* has to coerce to a one element Unicode string. ``-1`` is returned " +"if there was an error." msgstr "" +"*substr* باید به یک رشته یونیکدی تک‌عنصری تبدیل‌پذیر باشد. اگر خطایی رخ داده" +" باشد، ``-1`` بازگردانده می‌شود." -msgid "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the address of a pointer variable pointing to a Python Unicode string object. If there is an existing interned string that is the same as :c:expr:`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to the old string object and creating a new :term:`strong reference` to the interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and interns it." -msgstr "" +msgid "" +"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the" +" address of a pointer variable pointing to a Python Unicode string object. " +"If there is an existing interned string that is the same as " +":c:expr:`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the " +"reference to the old string object and creating a new :term:`strong " +"reference` to the interned string object), otherwise it leaves " +":c:expr:`*p_unicode` alone and interns it." +msgstr "" +"آرگومان :c:expr:`*p_unicode` را به‌صورت درجا درون‌سازی (intern) می‌کند. این " +"آرگومان باید نشانی یک متغیر اشاره‌گر باشد که به یک شیء رشته یونیکد پایتون " +"اشاره کند. اگر رشته‌ای از پیش درون‌سازی‌شده (interned) موجود باشد که با " +":c:expr:`*p_unicode` یکسان باشد، :c:expr:`*p_unicode` را برابر آن قرار " +"می‌دهد (با آزاد کردن ارجاع به شیء رشته قدیمی و ایجاد یک :term:`ارجاع قوی " +"` جدید به شیء رشته درون‌سازی‌شده)، در غیر این صورت " +":c:expr:`*p_unicode` را دست‌نخورده باقی می‌گذارد و آن را درون‌سازی می‌کند." -msgid "(Clarification: even though there is a lot of talk about references, think of this function as reference-neutral. You must own the object you pass in; after the call you no longer own the passed-in reference, but you newly own the result.)" +msgid "" +"(Clarification: even though there is a lot of talk about references, think " +"of this function as reference-neutral. You must own the object you pass in; " +"after the call you no longer own the passed-in reference, but you newly own " +"the result.)" msgstr "" +"(توضیح: هرچند بحث‌های فراوانی درباره‌ی ارجاع‌ها مطرح می‌شود، این تابع را از " +"نظر ارجاع خنثی در نظر بگیرید. باید مالک شیء‌ای که ارسال می‌کنید باشید؛ پس از" +" فراخوانی، دیگر مالک ارجاعی که ارسال کرده‌اید نیستید، اما از این پس مالک " +"نتیجه هستید.)" -msgid "This function never raises an exception. On error, it leaves its argument unchanged without interning it." +msgid "" +"This function never raises an exception. On error, it leaves its argument " +"unchanged without interning it." msgstr "" +"این تابع هرگز استثنایی ایجاد نمی‌کند. در صورت بروز خطا، آرگومان خود را بدون " +"تغییر باقی می‌گذارد و آن را درون‌سازی (interning) نمی‌کند." -msgid "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- as with any other error -- the argument is left unchanged." +msgid "" +"Instances of subclasses of :py:class:`str` may not be interned, that is, " +":c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then " +"-- as with any other error -- the argument is left unchanged." msgstr "" +"نمونه‌های زیرکلاس‌های :py:class:`str` ممکن است درون‌سازی (interning) نشوند؛ " +"به این معنا که :c:expr:`PyUnicode_CheckExact(*p_unicode)` باید درست باشد. " +"اگر چنین نباشد، آرگومان — مانند هر خطای دیگر — بدون تغییر باقی می‌ماند." -msgid "Note that interned strings are not “immortal”. You must keep a reference to the result to benefit from interning." +msgid "" +"Note that interned strings are not “immortal”. You must keep a reference to " +"the result to benefit from interning." msgstr "" +"توجه داشته باشید که رشته‌های درون‌سازی‌شده (interned) «نامیرا» نیستند. برای " +"بهره‌مندی از درون‌سازی (interning)، باید ارجاعی به نتیجه نگه دارید." -msgid "A combination of :c:func:`PyUnicode_FromString` and :c:func:`PyUnicode_InternInPlace`, meant for statically allocated strings." +msgid "" +"A combination of :c:func:`PyUnicode_FromString` and " +":c:func:`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" +"ترکیبی از :c:func:`PyUnicode_FromString` و " +":c:func:`PyUnicode_InternInPlace`، که برای رشته‌های تخصیص‌یافته به‌صورت " +"ایستا در نظر گرفته شده است." -msgid "Return a new (\"owned\") reference to either a new Unicode string object that has been interned, or an earlier interned string object with the same value." +msgid "" +"Return a new (\"owned\") reference to either a new Unicode string object " +"that has been interned, or an earlier interned string object with the same " +"value." msgstr "" +"بازگرداندن ارجاعی جدید (مالکانه — owned) به یک شیء رشته‌ی یونیکدی جدید که " +"درون‌سازی (intern) شده است، یا به یک شیء رشته‌ی درون‌سازی‌شده‌ی قبلی با همان" +" مقدار." -msgid "Python may keep a reference to the result, or make it :term:`immortal`, preventing it from being garbage-collected promptly. For interning an unbounded number of different strings, such as ones coming from user input, prefer calling :c:func:`PyUnicode_FromString` and :c:func:`PyUnicode_InternInPlace` directly." -msgstr "" +msgid "" +"Python may keep a reference to the result, or make it :term:`immortal`, " +"preventing it from being garbage-collected promptly. For interning an " +"unbounded number of different strings, such as ones coming from user input, " +"prefer calling :c:func:`PyUnicode_FromString` and " +":c:func:`PyUnicode_InternInPlace` directly." +msgstr "" +"پایتون ممکن است ارجاعی به نتیجه را نگه دارد، یا آن را :term:`نامیرا " +"` کند و در نتیجه مانع از زباله‌روبی به‌موقع آن شود. برای " +"اینترن‌کردن (interning) تعداد نامحدودی از رشته‌های متفاوت، مانند رشته‌هایی " +"که از ورودی کاربر می‌آیند، ترجیح دهید :c:func:`PyUnicode_FromString` و " +":c:func:`PyUnicode_InternInPlace` را مستقیماً فراخوانی کنید." -msgid "Return a non-zero value if *str* is interned, zero if not. The *str* argument must be a string; this is not checked. This function always succeeds." +msgid "" +"Return a non-zero value if *str* is interned, zero if not. The *str* " +"argument must be a string; this is not checked. This function always " +"succeeds." msgstr "" +"اگر *str* درون‌سازی‌شده (interned) باشد، مقدار غیرصفر و در غیر این صورت صفر " +"را برمی‌گرداند. آرگومان *str* باید یک رشته باشد؛ این مورد بررسی نمی‌شود. این" +" تابع همیشه با موفقیت اجرا می‌شود." -msgid "A non-zero return value may carry additional information about *how* the string is interned. The meaning of such non-zero values, as well as each specific string's intern-related details, may change between CPython versions." +msgid "" +"A non-zero return value may carry additional information about *how* the " +"string is interned. The meaning of such non-zero values, as well as each " +"specific string's intern-related details, may change between CPython " +"versions." msgstr "" +"مقدار بازگشتی ناصفر ممکن است حاوی اطلاعات بیشتری درباره‌ی *چگونگی* درون‌سازی" +" (interning) رشته باشد. معنای چنین مقادیر ناصفری، و همچنین جزئیات مربوط به " +"درون‌سازی هر رشته‌ی خاص، ممکن است بین نسخه‌های سی‌پایتون تغییر کند." msgid "PyUnicodeWriter" -msgstr "" +msgstr "PyUnicodeWriter" -msgid "The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:`str` object." +msgid "" +"The :c:type:`PyUnicodeWriter` API can be used to create a Python " +":class:`str` object." msgstr "" +"از API :c:type:`PyUnicodeWriter` می‌توان برای ایجاد یک شیء :class:`str` " +"پایتونی استفاده کرد." msgid "A Unicode writer instance." -msgstr "" +msgstr "یک نمونه‌ی نوشتارگر یونیکد." -msgid "The instance must be destroyed by :c:func:`PyUnicodeWriter_Finish` on success, or :c:func:`PyUnicodeWriter_Discard` on error." +msgid "" +"The instance must be destroyed by :c:func:`PyUnicodeWriter_Finish` on " +"success, or :c:func:`PyUnicodeWriter_Discard` on error." msgstr "" +"نمونه باید در صورت موفقیت توسط :c:func:`PyUnicodeWriter_Finish` یا در صورت " +"خطا توسط :c:func:`PyUnicodeWriter_Discard` نابود شود." msgid "Create a Unicode writer instance." -msgstr "" +msgstr "یک نمونه از نویسنده یونیکد ایجاد کنید." msgid "*length* must be greater than or equal to ``0``." -msgstr "" +msgstr "*length* باید بزرگ‌تر یا مساوی ``0`` باشد." -msgid "If *length* is greater than ``0``, preallocate an internal buffer of *length* characters." +msgid "" +"If *length* is greater than ``0``, preallocate an internal buffer of " +"*length* characters." msgstr "" +"اگر *length* بزرگ‌تر از ``0`` باشد، یک بافر داخلی به اندازه‌ی *length* نویسه" +" از پیش تخصیص می‌دهد." msgid "Set an exception and return ``NULL`` on error." -msgstr "" +msgstr "در صورت خطا، یک استثنا تنظیم کرده و ``NULL`` را برگردانید." -msgid "Return the final Python :class:`str` object and destroy the writer instance." +msgid "" +"Return the final Python :class:`str` object and destroy the writer instance." msgstr "" +"شیء :class:`str` نهایی پایتون را برمی‌گرداند و نمونه‌ی نویسنده (writer) را " +"نابود می‌کند." msgid "The writer instance is invalid after this call." -msgstr "" +msgstr "نمونه‌ی نویسنده پس از این فراخوانی نامعتبر است." msgid "Discard the internal Unicode buffer and destroy the writer instance." -msgstr "" +msgstr "بافر داخلی یونیکد را دور می‌ریزد و نمونه‌ی نویسنده را نابود می‌کند." msgid "If *writer* is ``NULL``, no operation is performed." -msgstr "" +msgstr "اگر *writer* برابر ``NULL`` باشد، هیچ عملیاتی انجام نمی‌شود." msgid "Write the single Unicode character *ch* into *writer*." -msgstr "" +msgstr "نویسه‌ی تکی یونیکد *ch* را در *writer* بنویسید." -msgid "On success, return ``0``. On error, set an exception, leave the writer unchanged, and return ``-1``." +msgid "" +"On success, return ``0``. On error, set an exception, leave the writer " +"unchanged, and return ``-1``." msgstr "" +"در صورت موفقیت، ``0`` را برمی‌گرداند. در صورت خطا، یک استثنا تنظیم می‌کند، " +"نوشتارگر (writer) را بدون تغییر باقی می‌گذارد و ``-1`` را برمی‌گرداند." -msgid "Decode the string *str* from UTF-8 in strict mode and write the output into *writer*." +msgid "" +"Decode the string *str* from UTF-8 in strict mode and write the output into " +"*writer*." msgstr "" +"رشته *str* را از UTF-8 در حالت سخت‌گیرانه کدگشایی می‌کند و خروجی را در " +"*writer* می‌نویسد." -msgid "*size* is the string length in bytes. If *size* is equal to ``-1``, call ``strlen(str)`` to get the string length." +msgid "" +"*size* is the string length in bytes. If *size* is equal to ``-1``, call " +"``strlen(str)`` to get the string length." msgstr "" +"*size* طول رشته بر حسب بایت است. اگر *size* برابر با ``-1`` باشد، برای به " +"دست آوردن طول رشته، ``strlen(str)`` فراخوانی می‌شود." msgid "See also :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`." -msgstr "" +msgstr "همچنین ببینید :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`." msgid "Write the ASCII string *str* into *writer*." -msgstr "" +msgstr "رشته اسکی *str* را در *writer* بنویسید." -msgid "*str* must only contain ASCII characters. The behavior is undefined if *str* contains non-ASCII characters." +msgid "" +"*str* must only contain ASCII characters. The behavior is undefined if *str*" +" contains non-ASCII characters." msgstr "" +"*str* باید فقط شامل نویسه‌های اسکی باشد. اگر *str* شامل نویسه‌های غیر‌اسکی " +"باشد، رفتار تعریف‌نشده است." msgid "Write the wide string *str* into *writer*." -msgstr "" +msgstr "رشته پهن *str* را در *writer* می‌نویسد." -msgid "*size* is a number of wide characters. If *size* is equal to ``-1``, call ``wcslen(str)`` to get the string length." +msgid "" +"*size* is a number of wide characters. If *size* is equal to ``-1``, call " +"``wcslen(str)`` to get the string length." msgstr "" +"*size* تعداد نویسه‌های پهن است. اگر *size* برابر با ``-1`` باشد، برای به‌دست" +" آوردن طول رشته، ``wcslen(str)`` را فراخوانی کنید." msgid "Writer the UCS4 string *str* into *writer*." -msgstr "" +msgstr "رشته UCS4 *str* را در *writer* می‌نویسد." msgid "*size* is a number of UCS4 characters." -msgstr "" +msgstr "*size* تعداد نویسه‌های UCS4 است." -msgid "Call :c:func:`PyObject_Str` on *obj* and write the output into *writer*." +msgid "" +"Call :c:func:`PyObject_Str` on *obj* and write the output into *writer*." msgstr "" +":c:func:`PyObject_Str` را روی *obj* فراخوانی می‌کند و خروجی را در *writer* " +"می‌نویسد." -msgid "To write a :class:`str` subclass which overrides the :meth:`~object.__str__` method, :c:func:`PyUnicode_FromObject` can be used to get the original string." +msgid "" +"To write a :class:`str` subclass which overrides the :meth:`~object.__str__`" +" method, :c:func:`PyUnicode_FromObject` can be used to get the original " +"string." msgstr "" +"برای نوشتن یک زیرکلاس از :class:`str` که متد :meth:`~object.__str__` را " +"بازنویسی کند، می‌توان از :c:func:`PyUnicode_FromObject` برای به‌دست آوردن " +"رشته اصلی استفاده کرد." -msgid "Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*." +msgid "" +"Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*." msgstr "" +":c:func:`PyObject_Repr` را روی *obj* فراخوانی کنید و خروجی را در *writer* " +"بنویسید." msgid "If *obj* is ``NULL``, write the string ``\"\"`` into *writer*." msgstr "" +"اگر *obj* برابر ``NULL`` باشد، رشته‌ی ``\"\"`` را در *writer* " +"می‌نویسد." msgid "Added support for ``NULL``." -msgstr "" +msgstr "پشتیبانی از ``NULL`` افزوده شد." msgid "Write the substring ``str[start:end]`` into *writer*." -msgstr "" +msgstr "زیررشته‌ی ``str[start:end]`` را در *writer* بنویسید." -msgid "*str* must be Python :class:`str` object. *start* must be greater than or equal to 0, and less than or equal to *end*. *end* must be less than or equal to *str* length." +msgid "" +"*str* must be Python :class:`str` object. *start* must be greater than or " +"equal to 0, and less than or equal to *end*. *end* must be less than or " +"equal to *str* length." msgstr "" +"*str* باید یک شیء :class:`str` پایتون باشد. *start* باید بزرگ‌تر یا مساوی ۰ " +"و کوچک‌تر یا مساوی *end* باشد. *end* باید کوچک‌تر یا مساوی طول *str* باشد." -msgid "Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly into *writer*." +msgid "" +"Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly " +"into *writer*." msgstr "" +"مشابه :c:func:`PyUnicode_FromFormat`، اما خروجی را مستقیماً در *writer* " +"می‌نویسد." -msgid "Decode the string *str* from UTF-8 with *errors* error handler and write the output into *writer*." +msgid "" +"Decode the string *str* from UTF-8 with *errors* error handler and write the" +" output into *writer*." msgstr "" +"رشته‌ی *str* را از UTF-8 با هندلر خطای *errors* کدگشایی می‌کند و خروجی را در" +" *writer* می‌نویسد." -msgid "*errors* is an :ref:`error handler ` name, such as ``\"replace\"``. If *errors* is ``NULL``, use the strict error handler." +msgid "" +"*errors* is an :ref:`error handler ` name, such as " +"``\"replace\"``. If *errors* is ``NULL``, use the strict error handler." msgstr "" +"*errors* نام یک :ref:`هندلر خطا ` است، مانند " +"``\"replace\"``. اگر *errors* برابر ``NULL`` باشد، از هندلر خطای سخت‌گیرانه " +"استفاده کنید." -msgid "If *consumed* is not ``NULL``, set *\\*consumed* to the number of decoded bytes on success. If *consumed* is ``NULL``, treat trailing incomplete UTF-8 byte sequences as an error." +msgid "" +"If *consumed* is not ``NULL``, set *\\*consumed* to the number of decoded " +"bytes on success. If *consumed* is ``NULL``, treat trailing incomplete UTF-8" +" byte sequences as an error." msgstr "" +"اگر *consumed* برابر ``NULL`` نباشد، در صورت موفقیت *\\*consumed* برابر با " +"تعداد بایت‌های کدگشایی‌شده تنظیم می‌شود. اگر *consumed* برابر ``NULL`` باشد،" +" دنباله‌های بایتی ناقص UTF-8 در انتها به‌عنوان خطا در نظر گرفته می‌شوند." msgid "See also :c:func:`PyUnicodeWriter_WriteUTF8`." -msgstr "" +msgstr "همچنین :c:func:`PyUnicodeWriter_WriteUTF8` را ببینید." msgid "Deprecated API" -msgstr "" +msgstr "API منسوخ" msgid "The following API is deprecated." -msgstr "" +msgstr "API زیر منسوخ شده است." -msgid "This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit type depending on the platform. Please use :c:type:`wchar_t` directly instead." +msgid "" +"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " +"type depending on the platform. Please use :c:type:`wchar_t` directly " +"instead." msgstr "" +"این یک تعریف نوع (typedef) از :c:type:`wchar_t` است که بسته به پلتفرم، نوعی " +"۱۶ بیتی یا ۳۲ بیتی است. لطفاً به‌جای آن، مستقیماً از :c:type:`wchar_t` " +"استفاده کنید." -msgid "In previous versions, this was a 16-bit type or a 32-bit type depending on whether you selected a \"narrow\" or \"wide\" Unicode version of Python at build time." +msgid "" +"In previous versions, this was a 16-bit type or a 32-bit type depending on " +"whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " +"build time." msgstr "" +"در نسخه‌های قبلی، این یک نوع ۱۶بیتی یا ۳۲بیتی بود، بسته به اینکه شما در زمان" +" ساخت، نسخه‌ی «باریک» یا «پهن» یونیکد پایتون را انتخاب کرده باشید." -msgid "Do nothing and return ``0``. This API is kept only for backward compatibility, but there are no plans to remove it." +msgid "" +"Do nothing and return ``0``. This API is kept only for backward " +"compatibility, but there are no plans to remove it." msgstr "" +"هیچ کاری انجام ندهید و ``0`` را برگردانید. این API تنها برای سازگاری با " +"نسخه‌های پیشین نگه داشته شده است، اما برنامه‌ای برای حذف آن وجود ندارد." -msgid "This API does nothing since Python 3.12. Previously, this needed to be called for each string created using the old API (:c:func:`!PyUnicode_FromUnicode` or similar)." +msgid "" +"This API does nothing since Python 3.12. Previously, this needed to be " +"called for each string created using the old API " +"(:c:func:`!PyUnicode_FromUnicode` or similar)." msgstr "" +"این API از پایتون 3.12 به بعد هیچ کاری انجام نمی‌دهد. پیش‌تر، لازم بود برای " +"هر رشته‌ای که با استفاده از API قدیمی (:c:func:`!PyUnicode_FromUnicode` یا " +"مشابه آن) ایجاد شده بود، فراخوانی شود." -msgid "Do nothing and return ``1``. This API is kept only for backward compatibility, but there are no plans to remove it." +msgid "" +"Do nothing and return ``1``. This API is kept only for backward " +"compatibility, but there are no plans to remove it." msgstr "" +"هیچ کاری انجام نمی‌دهد و ``1`` را برمی‌گرداند. این API تنها برای سازگاری با " +"نسخه‌های قبلی نگه داشته شده است، اما برنامه‌ای برای حذف آن وجود ندارد." -msgid "This API does nothing since Python 3.12. Previously, this could be called to check if :c:func:`PyUnicode_READY` is necessary." +msgid "" +"This API does nothing since Python 3.12. Previously, this could be called to" +" check if :c:func:`PyUnicode_READY` is necessary." msgstr "" +"این API از پایتون 3.12 به بعد هیچ کاری انجام نمی‌دهد. پیش‌تر، می‌شد آن را " +"برای بررسی ضرورت :c:func:`PyUnicode_READY` فراخوانی کرد." diff --git a/c-api/utilities.po b/c-api/utilities.po index cdd7ab33c..23c8e12cb 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -25,7 +25,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Utilities" -msgstr "" +msgstr "ابزارها" -msgid "The functions in this chapter perform various utility tasks, ranging from helping C code be more portable across platforms, using Python modules from C, and parsing function arguments and constructing Python values from C values." +msgid "" +"The functions in this chapter perform various utility tasks, ranging from " +"helping C code be more portable across platforms, using Python modules from " +"C, and parsing function arguments and constructing Python values from C " +"values." msgstr "" +"توابع این فصل وظایف کمکی گوناگونی را انجام می‌دهند؛ از کمک به کد C برای " +"قابلیت حمل بیشتر میان پلتفرم‌های مختلف، استفاده از ماژول‌های پایتون در C، و " +"تجزیه آرگومان‌های تابع و ساخت مقادیر پایتون از مقادیر C." diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 025e6f785..9abc37129 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -22,175 +22,543 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "The Very High Level Layer" -msgstr "" +msgstr "لایه سطح بسیار بالا" -msgid "The functions in this chapter will let you execute Python source code given in a file or a buffer, but they will not let you interact in a more detailed way with the interpreter." +msgid "" +"The functions in this chapter will let you execute Python source code given " +"in a file or a buffer, but they will not let you interact in a more detailed" +" way with the interpreter." msgstr "" +"توابع این فصل به شما اجازه می‌دهند کد منبع پایتونِ ارائه‌شده در یک پرونده یا" +" بافر را اجرا کنید، اما به شما اجازه نمی‌دهند به شکلی دقیق‌تر با مفسر تعامل " +"کنید." -msgid "Several of these functions accept a start symbol from the grammar as a parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:`Py_file_input`, :c:data:`Py_single_input`, and :c:data:`Py_func_type_input`. These are described following the functions which accept them as parameters." -msgstr "" +msgid "" +"Several of these functions accept a start symbol from the grammar as a " +"parameter. The available start symbols are :c:data:`Py_eval_input`, " +":c:data:`Py_file_input`, :c:data:`Py_single_input`, and " +":c:data:`Py_func_type_input`. These are described following the functions " +"which accept them as parameters." +msgstr "" +"چندین تابع از میان این توابع، یک نماد آغاز از گرامر را به‌عنوان پارامتر " +"می‌پذیرند. نمادهای آغاز موجود عبارت‌اند از :c:data:`Py_eval_input`، " +":c:data:`Py_file_input`، :c:data:`Py_single_input` و " +":c:data:`Py_func_type_input`. این نمادها پس از توابعی که آن‌ها را به‌عنوان " +"پارامتر می‌پذیرند، توصیف شده‌اند." -msgid "Note also that several of these functions take :c:expr:`FILE*` parameters. One particular issue which needs to be handled carefully is that the :c:type:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually use different libraries, so care should be taken that :c:expr:`FILE*` parameters are only passed to these functions if it is certain that they were created by the same library that the Python runtime is using." -msgstr "" +msgid "" +"Note also that several of these functions take :c:expr:`FILE*` parameters. " +"One particular issue which needs to be handled carefully is that the " +":c:type:`FILE` structure for different C libraries can be different and " +"incompatible. Under Windows (at least), it is possible for dynamically " +"linked extensions to actually use different libraries, so care should be " +"taken that :c:expr:`FILE*` parameters are only passed to these functions if " +"it is certain that they were created by the same library that the Python " +"runtime is using." +msgstr "" +"همچنین توجه داشته باشید که تعدادی از این توابع پارامترهای :c:expr:`FILE*` " +"می‌گیرند. یک مسئله‌ی خاص که باید با دقت به آن پرداخته شود این است که ساختار " +":c:type:`FILE` در کتابخانه‌های C مختلف می‌تواند متفاوت و ناسازگار باشد. در " +"ویندوز (حداقل)، این امکان وجود دارد که ماژول‌های توسعه‌ای با پیوند پویا در " +"واقع از کتابخانه‌های متفاوتی استفاده کنند، بنابراین باید مراقب باشید که " +"پارامترهای :c:expr:`FILE*` تنها زمانی به این توابع ارسال شوند که مطمئن باشید" +" آن‌ها توسط همان کتابخانه‌ای که ران‌تایم پایتون از آن استفاده می‌کند ایجاد " +"شده‌اند." -msgid "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving *closeit* set to ``0`` and *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_AnyFileExFlags` در پایین است که " +"*closeit* را روی ``0`` و *flags* را روی ``NULL`` تنظیم می‌کند." -msgid "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving the *closeit* argument set to ``0``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving the *closeit* argument set to ``0``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_AnyFileExFlags` در ادامه است که در " +"آن، آرگومان *closeit* روی ``0`` تنظیم باقی می‌ماند." -msgid "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, leaving the *flags* argument set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " +"leaving the *flags* argument set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_AnyFileExFlags` در پایین است که " +"آرگومان *flags* را برابر ``NULL`` قرار می‌دهد." -msgid "If *fp* refers to a file associated with an interactive device (console or terminal input or Unix pseudo-terminal), return the value of :c:func:`PyRun_InteractiveLoop`, otherwise return the result of :c:func:`PyRun_SimpleFile`. *filename* is decoded from the filesystem encoding (:func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, this function uses ``\"???\"`` as the filename. If *closeit* is true, the file is closed before ``PyRun_SimpleFileExFlags()`` returns." -msgstr "" +msgid "" +"If *fp* refers to a file associated with an interactive device (console or " +"terminal input or Unix pseudo-terminal), return the value of " +":c:func:`PyRun_InteractiveLoop`, otherwise return the result of " +":c:func:`PyRun_SimpleFile`. *filename* is decoded from the filesystem " +"encoding (:func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, " +"this function uses ``\"???\"`` as the filename. If *closeit* is true, the " +"file is closed before ``PyRun_SimpleFileExFlags()`` returns." +msgstr "" +"اگر *fp* به پرونده‌ای اشاره کند که با یک دستگاه تعاملی (کنسول یا ورودی " +"پایانه یا شبه‌پایانه‌ی یونیکس) مرتبط است، مقدار " +":c:func:`PyRun_InteractiveLoop` را برمی‌گرداند، در غیر این صورت نتیجه‌ی " +":c:func:`PyRun_SimpleFile` را برمی‌گرداند. *filename* از کدگذاری فایل‌سیستم " +"(:func:`sys.getfilesystemencoding`) کدگشایی می‌شود. اگر *filename* برابر " +"``NULL`` باشد، این تابع از ``\"???\"`` به‌عنوان نام پرونده استفاده می‌کند. " +"اگر *closeit* درست باشد، پرونده پیش از بازگشت ``PyRun_SimpleFileExFlags()`` " +"بسته می‌شود." -msgid "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " +"leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_SimpleStringFlags` در پایین است که " +"در آن آرگومان :c:struct:`PyCompilerFlags`\\* روی ``NULL`` تنظیم‌شده باقی " +"می‌ماند." -msgid "Executes the Python source code from *command* in the :mod:`__main__` module according to the *flags* argument. If :mod:`__main__` does not already exist, it is created. Returns ``0`` on success or ``-1`` if an exception was raised. If there was an error, there is no way to get the exception information. For the meaning of *flags*, see below." -msgstr "" +msgid "" +"Executes the Python source code from *command* in the :mod:`__main__` module" +" according to the *flags* argument. If :mod:`__main__` does not already " +"exist, it is created. Returns ``0`` on success or ``-1`` if an exception " +"was raised. If there was an error, there is no way to get the exception " +"information. For the meaning of *flags*, see below." +msgstr "" +"کد منبع پایتون را از *command* مطابق با آرگومان *flags* در ماژول " +":mod:`__main__` اجرا می‌کند. اگر :mod:`__main__` از قبل وجود نداشته باشد، " +"ایجاد می‌شود. در صورت موفقیت ``0`` و در صورتی که استثنایی رخ داده باشد " +"``-1`` برمی‌گرداند. اگر خطایی رخ داده باشد، راهی برای به‌دست آوردن اطلاعات " +"استثنا وجود ندارد. برای معنای *flags*، به ادامه مراجعه کنید." -msgid "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this function will not return ``-1``, but exit the process, as long as :c:member:`PyConfig.inspect` is zero." +msgid "" +"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " +"function will not return ``-1``, but exit the process, as long as " +":c:member:`PyConfig.inspect` is zero." msgstr "" +"توجه داشته باشید که اگر استثنای :exc:`SystemExit` که به نحوی دیگر " +"مدیریت‌نشده باشد raise شود، این تابع ``-1`` را برنمی‌گرداند، بلکه فرایند را " +"خاتمه می‌دهد، مادامی که :c:member:`PyConfig.inspect` صفر باشد." -msgid "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, leaving *closeit* set to ``0`` and *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " +"leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_SimpleFileExFlags` در پایین است که " +"در آن *closeit* برابر ``0`` و *flags* برابر ``NULL`` قرار می‌گیرد." -msgid "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " +"leaving *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_SimpleFileExFlags` در پایین است که " +"*flags* را برابر ``NULL`` قرار می‌دهد." -msgid "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is read from *fp* instead of an in-memory string. *filename* should be the name of the file, it is decoded from :term:`filesystem encoding and error handler`. If *closeit* is true, the file is closed before ``PyRun_SimpleFileExFlags()`` returns." -msgstr "" +msgid "" +"Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " +"read from *fp* instead of an in-memory string. *filename* should be the name" +" of the file, it is decoded from :term:`filesystem encoding and error " +"handler`. If *closeit* is true, the file is closed before " +"``PyRun_SimpleFileExFlags()`` returns." +msgstr "" +"مشابه :c:func:`PyRun_SimpleStringFlags` است، اما کد منبع پایتون به‌جای یک " +"رشته‌ی در حافظه، از *fp* خوانده می‌شود. *filename* باید نام پرونده باشد؛ این" +" نام با :term:`filesystem encoding and error handler` کدگشایی می‌شود. اگر " +"*closeit* درست باشد، پرونده پیش از بازگشت ``PyRun_SimpleFileExFlags()`` بسته" +" می‌شود." -msgid "On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, \"rb\")``). Otherwise, Python may not handle script file with LF line ending correctly." +msgid "" +"On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " +"\"rb\")``). Otherwise, Python may not handle script file with LF line ending" +" correctly." msgstr "" +"در ویندوز، *fp* باید در حالت دودویی باز شود (مثلاً ``fopen(filename, " +"\"rb\")``). در غیر این صورت، ممکن است پایتون پرونده اسکریپت با پایان سطر LF " +"را به‌درستی مدیریت نکند." -msgid "Read and execute a single statement from a file associated with an interactive device according to the *flags* argument. The user will be prompted using ``sys.ps1`` and ``sys.ps2``. *filename* must be a Python :class:`str` object." +msgid "" +"Read and execute a single statement from a file associated with an " +"interactive device according to the *flags* argument. The user will be " +"prompted using ``sys.ps1`` and ``sys.ps2``. *filename* must be a Python " +":class:`str` object." msgstr "" +"یک دستور را از پرونده‌ای که با یک دستگاه تعاملی مرتبط است، مطابق با آرگومان " +"*flags* می‌خواند و اجرا می‌کند. به کاربر با استفاده از ``sys.ps1`` و " +"``sys.ps2`` اعلان نمایش داده می‌شود. *filename* باید یک شیء :class:`str` " +"پایتون باشد." -msgid "Returns ``0`` when the input was executed successfully, ``-1`` if there was an exception, or an error code from the :file:`errcode.h` include file distributed as part of Python if there was a parse error. (Note that :file:`errcode.h` is not included by :file:`Python.h`, so must be included specifically if needed.)" -msgstr "" +msgid "" +"Returns ``0`` when the input was executed successfully, ``-1`` if there was " +"an exception, or an error code from the :file:`errcode.h` include file " +"distributed as part of Python if there was a parse error. (Note that " +":file:`errcode.h` is not included by :file:`Python.h`, so must be included " +"specifically if needed.)" +msgstr "" +"اگر ورودی با موفقیت اجرا شده باشد، ``0`` را برمی‌گرداند؛ اگر استثنایی رخ " +"داده باشد، ``-1`` را؛ و اگر خطای تجزیه رخ داده باشد، کد خطایی از پرونده‌ی " +"include با نام :file:`errcode.h` که به‌عنوان بخشی از پایتون توزیع می‌شود. " +"(توجه داشته باشید که :file:`errcode.h` توسط :file:`Python.h` include " +"نمی‌شود، بنابراین در صورت نیاز باید به‌طور خاص include شود.)" -msgid "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below," +" leaving *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_InteractiveOneFlags` در پایین است " +"که در آن *flags* بر ``NULL`` قرار می‌گیرد." -msgid "Similar to :c:func:`PyRun_InteractiveOneObject`, but *filename* is a :c:expr:`const char*`, which is decoded from the :term:`filesystem encoding and error handler`." +msgid "" +"Similar to :c:func:`PyRun_InteractiveOneObject`, but *filename* is a " +":c:expr:`const char*`, which is decoded from the :term:`filesystem encoding " +"and error handler`." msgstr "" +"مشابه :c:func:`PyRun_InteractiveOneObject`، با این تفاوت که *filename* یک " +":c:expr:`const char*` است که از :term:`کدگذاری فایل‌سیستم و هندلر خطا " +"` کدگشایی می‌شود." -msgid "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " +"below, leaving *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_InteractiveLoopFlags` در ادامه است " +"که در آن *flags* بر ``NULL`` تنظیم می‌شود." -msgid "Read and execute statements from a file associated with an interactive device until EOF is reached. The user will be prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the :term:`filesystem encoding and error handler`. Returns ``0`` at EOF or a negative number upon failure." +msgid "" +"Read and execute statements from a file associated with an interactive " +"device until EOF is reached. The user will be prompted using ``sys.ps1`` " +"and ``sys.ps2``. *filename* is decoded from the :term:`filesystem encoding " +"and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" +"دستورها را از پرونده‌ای که با یک دستگاه تعاملی مرتبط است می‌خواند و اجرا " +"می‌کند تا زمانی که به EOF برسد. به کاربر با استفاده از ``sys.ps1`` و " +"``sys.ps2`` اعلان نمایش داده می‌شود. *filename* از :term:`کدگذاری فایل‌سیستم" +" و هندلر خطا ` کدگشایی می‌شود. در EOF" +" مقدار ``0`` و در صورت شکست یک عدد منفی برمی‌گرداند." -msgid "Can be set to point to a function with the prototype ``int func(void)``. The function will be called when Python's interpreter prompt is about to become idle and wait for user input from the terminal. The return value is ignored. Overriding this hook can be used to integrate the interpreter's prompt with other event loops, as done in :file:`Modules/_tkinter.c` in the Python source code." -msgstr "" +msgid "" +"Can be set to point to a function with the prototype ``int func(void)``. " +"The function will be called when Python's interpreter prompt is about to " +"become idle and wait for user input from the terminal. The return value is " +"ignored. Overriding this hook can be used to integrate the interpreter's " +"prompt with other event loops, as done in :file:`Modules/_tkinter.c` in the " +"Python source code." +msgstr "" +"می‌توان آن را طوری تنظیم کرد که به تابعی با پیش‌نمونه‌ی ``int func(void)`` " +"اشاره کند. این تابع زمانی فراخوانی می‌شود که اعلان مفسر پایتون در شرف بی‌کار" +" شدن و انتظار برای ورودی کاربر از ترمینال باشد. مقدار بازگشتی نادیده گرفته " +"می‌شود. از بازنویسی این قلاب می‌توان برای یکپارچه‌سازی اعلان مفسر با " +"حلقه‌های رویداد دیگر استفاده کرد، همان‌گونه که در :file:`Modules/_tkinter.c`" +" در کد منبع پایتون انجام شده است." -msgid "This function is only called from the :ref:`main interpreter `." +msgid "" +"This function is only called from the :ref:`main interpreter `." msgstr "" +"این تابع فقط از :ref:`مفسر اصلی ` فراخوانی می‌شود." -msgid "Can be set to point to a function with the prototype ``char *func(FILE *stdin, FILE *stdout, char *prompt)``, overriding the default function used to read a single line of input at the interpreter's prompt. The function is expected to output the string *prompt* if it's not ``NULL``, and then read a line of input from the provided standard input file, returning the resulting string. For example, The :mod:`readline` module sets this hook to provide line-editing and tab-completion features." -msgstr "" +msgid "" +"Can be set to point to a function with the prototype ``char *func(FILE " +"*stdin, FILE *stdout, char *prompt)``, overriding the default function used " +"to read a single line of input at the interpreter's prompt. The function is" +" expected to output the string *prompt* if it's not ``NULL``, and then read " +"a line of input from the provided standard input file, returning the " +"resulting string. For example, The :mod:`readline` module sets this hook to" +" provide line-editing and tab-completion features." +msgstr "" +"می‌تواند برای اشاره به تابعی با پیش‌نمونه‌ی ``char *func(FILE *stdin, FILE " +"*stdout, char *prompt)`` تنظیم شود که تابع پیش‌فرضِ استفاده‌شده برای خواندن " +"یک سطر ورودی در اعلان مفسر را بازنویسی می‌کند. انتظار می‌رود این تابع در " +"صورت ``NULL`` نبودن *prompt*، رشته‌ی *prompt* را به خروجی بفرستد و سپس یک " +"سطر ورودی از پرونده‌ی ورودی استانداردِ ارائه‌شده بخواند و رشته‌ی حاصل را " +"برگرداند. برای مثال، ماژول :mod:`readline` این قلاب را برای فراهم کردن " +"قابلیت‌های ویرایش سطر و تکمیل با کلید Tab تنظیم می‌کند." -msgid "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." +msgid "" +"The result must be a string allocated by :c:func:`PyMem_RawMalloc` or " +":c:func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" +"نتیجه باید رشته‌ای باشد که توسط :c:func:`PyMem_RawMalloc` یا " +":c:func:`PyMem_RawRealloc` تخصیص داده‌شده باشد، یا ``NULL`` در صورت وقوع " +"خطا." -msgid "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`." +msgid "" +"The result must be allocated by :c:func:`PyMem_RawMalloc` or " +":c:func:`PyMem_RawRealloc`, instead of being allocated by " +":c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`." msgstr "" +"نتیجه باید توسط :c:func:`PyMem_RawMalloc` یا :c:func:`PyMem_RawRealloc` " +"تخصیص داده شود، نه توسط :c:func:`PyMem_Malloc` یا :c:func:`PyMem_Realloc`." -msgid "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving" +" *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_StringFlags` در ادامه است که در آن " +"*flags* روی ``NULL`` تنظیم می‌شود." -msgid "Execute Python source code from *str* in the context specified by the objects *globals* and *locals* with the compiler flags specified by *flags*. *globals* must be a dictionary; *locals* can be any object that implements the mapping protocol. The parameter *start* specifies the start symbol and must be one of the :ref:`available start symbols `." -msgstr "" +msgid "" +"Execute Python source code from *str* in the context specified by the " +"objects *globals* and *locals* with the compiler flags specified by *flags*." +" *globals* must be a dictionary; *locals* can be any object that implements" +" the mapping protocol. The parameter *start* specifies the start symbol and" +" must be one of the :ref:`available start symbols `." +msgstr "" +"کد منبع پایتون را از *str* در زمینه‌ای که توسط اشیاء *globals* و *locals* " +"مشخص شده است، همراه با پرچم‌های کامپایلر که توسط *flags* مشخص شده‌اند، اجرا " +"می‌کند. *globals* باید یک دیکشنری باشد؛ *locals* می‌تواند هر شیئی باشد که " +"پروتکل نگاشت را پیاده‌سازی کند. پارامتر *start* نماد شروع را مشخص می‌کند و " +"باید یکی از :ref:`نمادهای شروع موجود ` باشد." -msgid "Returns the result of executing the code as a Python object, or ``NULL`` if an exception was raised." +msgid "" +"Returns the result of executing the code as a Python object, or ``NULL`` if " +"an exception was raised." msgstr "" +"نتیجه‌ی اجرای کد را به‌صورت یک شیء پایتون برمی‌گرداند، یا در صورت رخ دادن " +"استثنا ``NULL`` را برمی‌گرداند." -msgid "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving *closeit* set to ``0`` and *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving" +" *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_FileExFlags` در پایین است که در آن " +"*closeit* برابر ``0`` و *flags* برابر ``NULL`` قرار می‌گیرد." -msgid "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving" +" *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_FileExFlags` در ادامه است که " +"*flags* را روی ``NULL`` تنظیم می‌کند." -msgid "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving *closeit* set to ``0``." +msgid "" +"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving" +" *closeit* set to ``0``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyRun_FileExFlags` در زیر است که در آن " +"*closeit* روی ``0`` تنظیم می‌شود." -msgid "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read from *fp* instead of an in-memory string. *filename* should be the name of the file, it is decoded from the :term:`filesystem encoding and error handler`. If *closeit* is true, the file is closed before :c:func:`PyRun_FileExFlags` returns." -msgstr "" +msgid "" +"Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " +"from *fp* instead of an in-memory string. *filename* should be the name of " +"the file, it is decoded from the :term:`filesystem encoding and error " +"handler`. If *closeit* is true, the file is closed before " +":c:func:`PyRun_FileExFlags` returns." +msgstr "" +"مشابه :c:func:`PyRun_StringFlags` است، اما کد منبع پایتون به‌جای یک رشته " +"درون حافظه، از *fp* خوانده می‌شود. *filename* باید نام پرونده باشد که از " +":term:`filesystem encoding and error handler` کدگشایی می‌شود. اگر *closeit* " +"درست باشد، پرونده پیش از آنکه :c:func:`PyRun_FileExFlags` بازگردد، بسته " +"می‌شود." -msgid "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, leaving *flags* set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " +"leaving *flags* set to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`Py_CompileStringFlags` در ادامه است که " +"*flags* را برابر ``NULL`` قرار می‌دهد." -msgid "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, with *optimize* set to ``-1``." +msgid "" +"This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " +"with *optimize* set to ``-1``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`Py_CompileStringExFlags` در ادامه است که " +"در آن *optimize* روی ``-1`` تنظیم شده است." -msgid "Parse and compile the Python source code in *str*, returning the resulting code object. The start symbol is given by *start*; this can be used to constrain the code which can be compiled and should be :ref:`available start symbols `. The filename specified by *filename* is used to construct the code object and may appear in tracebacks or :exc:`SyntaxError` exception messages. This returns ``NULL`` if the code cannot be parsed or compiled." -msgstr "" +msgid "" +"Parse and compile the Python source code in *str*, returning the resulting " +"code object. The start symbol is given by *start*; this can be used to " +"constrain the code which can be compiled and should be :ref:`available start" +" symbols `. The filename specified by *filename* is used to " +"construct the code object and may appear in tracebacks or :exc:`SyntaxError`" +" exception messages. This returns ``NULL`` if the code cannot be parsed or " +"compiled." +msgstr "" +"کد منبع پایتون موجود در *str* را تجزیه و کامپایل می‌کند و شیء کد حاصل را " +"برمی‌گرداند. نماد آغازین توسط *start* تعیین می‌شود؛ از آن می‌توان برای محدود" +" کردن کدی که قابل کامپایل است استفاده کرد و باید یکی از :ref:`نمادهای آغازین" +" موجود ` باشد. نام پرونده‌ای که توسط *filename* مشخص می‌شود " +"برای ساخت شیء کد به کار می‌رود و ممکن است در ردگیری‌های پشته یا پیام‌های " +"استثنای :exc:`SyntaxError` ظاهر شود. اگر کد قابل تجزیه یا کامپایل نباشد، " +"``NULL`` برگردانده می‌شود." -msgid "The integer *optimize* specifies the optimization level of the compiler; a value of ``-1`` selects the optimization level of the interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no optimization; ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) or ``2`` (docstrings are removed too)." -msgstr "" +msgid "" +"The integer *optimize* specifies the optimization level of the compiler; a " +"value of ``-1`` selects the optimization level of the interpreter as given " +"by :option:`-O` options. Explicit levels are ``0`` (no optimization; " +"``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) " +"or ``2`` (docstrings are removed too)." +msgstr "" +"عدد صحیح *optimize* سطح بهینه‌سازی کامپایلر را مشخص می‌کند؛ مقدار ``-1`` سطح" +" بهینه‌سازی مفسر را همان‌طور که با گزینه‌های :option:`-O` مشخص شده است " +"انتخاب می‌کند. سطح‌های صریح عبارت‌اند از ``0`` (بدون بهینه‌سازی؛ " +"``__debug__`` درست است)، ``1`` (ادعاها حذف می‌شوند و ``__debug__`` نادرست " +"است) یا ``2`` (رشته‌های مستند نیز حذف می‌شوند)." -msgid "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string decoded from the :term:`filesystem encoding and error handler`." +msgid "" +"Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " +"decoded from the :term:`filesystem encoding and error handler`." msgstr "" +"مانند :c:func:`Py_CompileStringObject`، با این تفاوت که *filename* یک رشته " +"بایتی است که با :term:`کدگذاری فایل‌سیستم و هندلر خطا ` کدگشایی شده است." -msgid "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the code object, and global and local variables. The other arguments are set to ``NULL``." +msgid "" +"This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the" +" code object, and global and local variables. The other arguments are set " +"to ``NULL``." msgstr "" +"این یک رابط ساده‌شده برای :c:func:`PyEval_EvalCodeEx` است که تنها شیء کد و " +"متغیرهای سراسری و محلی را در بر می‌گیرد. سایر آرگومان‌ها روی ``NULL`` تنظیم " +"می‌شوند." -msgid "Evaluate a precompiled code object, given a particular environment for its evaluation. This environment consists of a dictionary of global variables, a mapping object of local variables, arrays of arguments, keywords and defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells." -msgstr "" +msgid "" +"Evaluate a precompiled code object, given a particular environment for its " +"evaluation. This environment consists of a dictionary of global variables, " +"a mapping object of local variables, arrays of arguments, keywords and " +"defaults, a dictionary of default values for :ref:`keyword-only ` arguments and a closure tuple of cells." +msgstr "" +"یک شیء کد پیش‌کامپایل‌شده را، با در اختیار داشتن محیطی مشخص برای ارزیابی آن،" +" ارزیابی می‌کند. این محیط شامل یک دیکشنری از متغیرهای سراسری، یک شیء نگاشت " +"از متغیرهای محلی، آرایه‌هایی از آرگومان‌ها، کلیدواژه‌ها و مقادیر پیش‌فرض، یک" +" دیکشنری از مقادیر پیش‌فرض برای آرگومان‌های :ref:`فقط‌کلیدواژه‌ای ` و یک تاپل بستار از سلول‌ها است." -msgid "Evaluate an execution frame. This is a simplified interface to :c:func:`PyEval_EvalFrameEx`, for backward compatibility." +msgid "" +"Evaluate an execution frame. This is a simplified interface to " +":c:func:`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" +"یک قاب اجرا (execution frame) را ارزیابی می‌کند. این، برای سازگاری با " +"نسخه‌های قبلی، یک رابط ساده‌شده برای :c:func:`PyEval_EvalFrameEx` است." -msgid "This is the main, unvarnished function of Python interpretation. The code object associated with the execution frame *f* is executed, interpreting bytecode and executing calls as needed. The additional *throwflag* parameter can mostly be ignored - if true, then it causes an exception to immediately be thrown; this is used for the :meth:`~generator.throw` methods of generator objects." -msgstr "" +msgid "" +"This is the main, unvarnished function of Python interpretation. The code " +"object associated with the execution frame *f* is executed, interpreting " +"bytecode and executing calls as needed. The additional *throwflag* " +"parameter can mostly be ignored - if true, then it causes an exception to " +"immediately be thrown; this is used for the :meth:`~generator.throw` methods" +" of generator objects." +msgstr "" +"این تابع اصلی و بی‌پیرایه‌ی تفسیر پایتون است. شیء کد مرتبط با قاب اجرای *f* " +"اجرا می‌شود، بایت‌کد تفسیر می‌شود و فراخوانی‌ها در صورت نیاز اجرا می‌شوند. " +"پارامتر اضافی *throwflag* را می‌توان تا حد زیادی نادیده گرفت — اگر درست " +"باشد، باعث می‌شود یک استثنا بلافاصله پرتاب شود؛ این حالت برای متدهای " +":meth:`~generator.throw` اشیاء تولیدگر به کار می‌رود." -msgid "This function now includes a debug assertion to help ensure that it does not silently discard an active exception." +msgid "" +"This function now includes a debug assertion to help ensure that it does not" +" silently discard an active exception." msgstr "" +"این تابع اکنون شامل یک ادعای اشکال‌زدایی است که به اطمینان از اینکه استثنای " +"فعال به‌صورت خاموش دور انداخته نمی‌شود کمک می‌کند." -msgid "This function changes the flags of the current evaluation frame, and returns true on success, false on failure." +msgid "" +"This function changes the flags of the current evaluation frame, and returns" +" true on success, false on failure." msgstr "" +"این تابع پرچم‌های فریم ارزیابی جاری را تغییر می‌دهد و در صورت موفقیت مقدار " +"true و در صورت شکست مقدار false را برمی‌گرداند." -msgid "This is the structure used to hold compiler flags. In cases where code is only being compiled, it is passed as ``int flags``, and in cases where code is being executed, it is passed as ``PyCompilerFlags *flags``. In this case, ``from __future__ import`` can modify *flags*." +msgid "" +"This is the structure used to hold compiler flags. In cases where code is " +"only being compiled, it is passed as ``int flags``, and in cases where code " +"is being executed, it is passed as ``PyCompilerFlags *flags``. In this " +"case, ``from __future__ import`` can modify *flags*." msgstr "" +"این ساختاری است که برای نگه‌داشتن پرچم‌های کامپایلر استفاده می‌شود. در " +"مواردی که کد فقط کامپایل می‌شود، به‌صورت ``int flags`` پاس داده می‌شود، و در" +" مواردی که کد اجرا می‌شود، به‌صورت ``PyCompilerFlags *flags`` پاس داده " +"می‌شود. در این حالت، ``from __future__ import`` می‌تواند *flags* را تغییر " +"دهد." -msgid "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags.cf_flags` is treated as equal to ``0``, and any modification due to ``from __future__ import`` is discarded." +msgid "" +"Whenever ``PyCompilerFlags *flags`` is ``NULL``, " +":c:member:`~PyCompilerFlags.cf_flags` is treated as equal to ``0``, and any " +"modification due to ``from __future__ import`` is discarded." msgstr "" +"هرگاه ``PyCompilerFlags *flags`` برابر ``NULL`` باشد، " +":c:member:`~PyCompilerFlags.cf_flags` برابر با ``0`` در نظر گرفته می‌شود، و " +"هرگونه تغییر ناشی از ``from __future__ import`` دور ریخته می‌شود." msgid "Compiler flags." -msgstr "" +msgstr "پرچم‌های کامپایلر." -msgid "*cf_feature_version* is the minor Python version. It should be initialized to ``PY_MINOR_VERSION``." +msgid "" +"*cf_feature_version* is the minor Python version. It should be initialized " +"to ``PY_MINOR_VERSION``." msgstr "" +"*cf_feature_version* نسخه فرعی پایتون است. باید به ``PY_MINOR_VERSION`` " +"مقداردهی اولیه شود." -msgid "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` flag is set in :c:member:`~PyCompilerFlags.cf_flags`." +msgid "" +"The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST``" +" flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" +"این فیلد به‌طور پیش‌فرض نادیده گرفته می‌شود و اگر و تنها اگر پرچم " +"``PyCF_ONLY_AST`` در :c:member:`~PyCompilerFlags.cf_flags` تنظیم شده باشد، " +"استفاده می‌شود." msgid "Added *cf_feature_version* field." -msgstr "" +msgstr "فیلد *cf_feature_version* افزوده شد." msgid "The available compiler flags are accessible as macros:" -msgstr "" +msgstr "پرچم‌های موجود کامپایلر به‌صورت ماکرو دسترس‌پذیر هستند:" -msgid "See :ref:`compiler flags ` in documentation of the :py:mod:`!ast` Python module, which exports these constants under the same names." +msgid "" +"See :ref:`compiler flags ` in documentation of the " +":py:mod:`!ast` Python module, which exports these constants under the same " +"names." msgstr "" +"به :ref:`پرچم‌های کامپایلر ` در مستندات ماژول " +":py:mod:`!ast` پایتون مراجعه کنید؛ این ماژول این ثابت‌ها را با همین نام‌ها " +"صادر می‌کند." msgid "Low-level flags" -msgstr "" +msgstr "پرچم‌های سطح پایین" -msgid "The following flags and masks serve narrow needs of the standard library and interactive interpreters. Code outside the standard library rarely has a reason to use them. They are considered implementation details and may change at any time." +msgid "" +"The following flags and masks serve narrow needs of the standard library and" +" interactive interpreters. Code outside the standard library rarely has a " +"reason to use them. They are considered implementation details and may " +"change at any time." msgstr "" +"پرچم‌ها و نقاب‌های زیر نیازهای محدود کتابخانه استاندارد و مفسرهای تعاملی را " +"برآورده می‌کنند. کدِ خارج از کتابخانه استاندارد به‌ندرت دلیلی برای استفاده " +"از آن‌ها دارد. این موارد به‌عنوان جزئیات پیاده‌سازی در نظر گرفته می‌شوند و " +"ممکن است در هر زمان تغییر کنند." -msgid "This flag is a private interface between the compiler and the :mod:`codeop` module. Do not use it; its behavior is unsupported and may change without warning." +msgid "" +"This flag is a private interface between the compiler and the :mod:`codeop` " +"module. Do not use it; its behavior is unsupported and may change without " +"warning." msgstr "" +"این پرچم یک رابط خصوصی بین کامپایلر و ماژول :mod:`codeop` است. از آن استفاده" +" نکنید؛ رفتار آن پشتیبانی نمی‌شود و ممکن است بدون اطلاع قبلی تغییر کند." -msgid "With this flag set, when compilation fails because the source text ends where more input is expected, for example in the middle of an indented block or an unterminated string literal, the error raised is the undocumented ``_IncompleteInputError``, a subclass of :exc:`SyntaxError`. The :mod:`codeop` module sets this flag, together with :c:macro:`PyCF_DONT_IMPLY_DEDENT`, to tell input that is incomplete apart from input with a real syntax error, so that interactive interpreters know when to prompt for another line instead of reporting an error." -msgstr "" +msgid "" +"With this flag set, when compilation fails because the source text ends " +"where more input is expected, for example in the middle of an indented block" +" or an unterminated string literal, the error raised is the undocumented " +"``_IncompleteInputError``, a subclass of :exc:`SyntaxError`. The " +":mod:`codeop` module sets this flag, together with " +":c:macro:`PyCF_DONT_IMPLY_DEDENT`, to tell input that is incomplete apart " +"from input with a real syntax error, so that interactive interpreters know " +"when to prompt for another line instead of reporting an error." +msgstr "" +"با تنظیم این پرچم، وقتی کامپایل به این دلیل شکست می‌خورد که متن مبدأ در جایی" +" پایان می‌یابد که ورودی بیشتری مورد انتظار است (برای مثال در میانه‌ی یک بلوک" +" تورفته یا یک رشته‌ی لفظی ناتمام)، خطای ایجادشده ``_IncompleteInputError`` " +"است؛ زیرکلاسی مستندنشده از :exc:`SyntaxError`. ماژول :mod:`codeop` این پرچم " +"را همراه با :c:macro:`PyCF_DONT_IMPLY_DEDENT` تنظیم می‌کند تا ورودی ناقص از " +"ورودی‌ای که واقعاً خطای سینتکس دارد تشخیص داده شود و مفسرهای تعاملی بدانند " +"چه زمانی به‌جای گزارش خطا، برای دریافت سطر دیگری اعلانی نمایش دهند." -msgid "By default, when compiling with the :c:var:`Py_single_input` start symbol, reaching the end of the source text implicitly closes any open indented blocks. With this flag set, open blocks are only closed if the last line of the source ends with a newline; otherwise, compilation fails with a :exc:`SyntaxError`:" -msgstr "" +msgid "" +"By default, when compiling with the :c:var:`Py_single_input` start symbol, " +"reaching the end of the source text implicitly closes any open indented " +"blocks. With this flag set, open blocks are only closed if the last line of" +" the source ends with a newline; otherwise, compilation fails with a " +":exc:`SyntaxError`:" +msgstr "" +"به‌طور پیش‌فرض، هنگام کامپایل با نماد آغاز :c:var:`Py_single_input`، رسیدن " +"به پایان متن مبدأ به‌طور ضمنی همه‌ی بلوک‌های تورفته‌ی باز را می‌بندد. با " +"تنظیم این پرچم، بلوک‌های باز فقط زمانی بسته می‌شوند که آخرین سطر متن مبدأ با" +" سطر جدید تمام شود؛ در غیر این صورت، کامپایل با خطای :exc:`SyntaxError` شکست" +" می‌خورد:" msgid "" "PyCompilerFlags flags = {\n" @@ -208,12 +576,38 @@ msgid "" "flags.cf_flags = PyCF_DONT_IMPLY_DEDENT;\n" "Py_CompileStringFlags(source, \"\", Py_single_input, &flags);" msgstr "" +"PyCompilerFlags flags = {\n" +" .cf_flags = 0,\n" +" .cf_feature_version = PY_MINOR_VERSION,\n" +"};\n" +"const char *source = \"if a:\\n pass\";\n" +"\n" +"/* بلوک «if» به‌طور ضمنی بسته می‌شود؛\n" +" این یک شیء کد برمی‌گرداند: */\n" +"Py_CompileStringFlags(source, \"\", Py_single_input, &flags);\n" +"\n" +"/* با این پرچم، این کار با خطای SyntaxError شکست می‌خورد،\n" +" زیرا سطر آخر به سطر جدید ختم نمی‌شود: */\n" +"flags.cf_flags = PyCF_DONT_IMPLY_DEDENT;\n" +"Py_CompileStringFlags(source, \"\", Py_single_input, &flags);" -msgid "The :mod:`codeop` module uses this flag to detect incomplete interactive input. While the user is still typing inside an indented block, the source does not yet end with a newline, so it fails to compile and the user is prompted for another line." +msgid "" +"The :mod:`codeop` module uses this flag to detect incomplete interactive " +"input. While the user is still typing inside an indented block, the source " +"does not yet end with a newline, so it fails to compile and the user is " +"prompted for another line." msgstr "" +"ماژول :mod:`codeop` از این پرچم برای تشخیص ورودی تعاملی ناتمام استفاده " +"می‌کند. هنگامی که کاربر هنوز مشغول تایپ کردن درون یک بلوک تورفته است، کد " +"منبع هنوز به سطر جدید ختم نمی‌شود؛ در نتیجه کامپایل آن شکست می‌خورد و به " +"کاربر اعلان می‌شود تا سطر دیگری وارد کند." -msgid "Read the source text as UTF-8, ignoring its :pep:`263` encoding declaration (\"coding cookie\"), if any:" +msgid "" +"Read the source text as UTF-8, ignoring its :pep:`263` encoding declaration " +"(\"coding cookie\"), if any:" msgstr "" +"متن منبع را به‌صورت UTF-8 بخوانید و در صورت وجود، اعلان کدگذاری :pep:`263` " +"آن («coding cookie») را نادیده بگیرید:" msgid "" "PyCompilerFlags flags = {\n" @@ -231,78 +625,172 @@ msgid "" "flags.cf_flags = PyCF_IGNORE_COOKIE;\n" "Py_CompileStringFlags(source, \"\", Py_file_input, &flags);" msgstr "" +"PyCompilerFlags flags = {\n" +" .cf_flags = 0,\n" +" .cf_feature_version = PY_MINOR_VERSION,\n" +"};\n" +"const char *source = \"# coding: latin-1\\ns = '\\xe9'\\n\";\n" +"\n" +"/* کوکی کدگذاری (coding cookie) رعایت می‌شود: بایت 0xE9 به‌صورت Latin-1\n" +" کدگشایی می‌شود و این یک شیء کد برمی‌گرداند که s را برابر \"é\" قرار می‌دهد: */\n" +"Py_CompileStringFlags(source, \"\", Py_file_input, &flags);\n" +"\n" +"/* با این پرچم، کوکی نادیده گرفته می‌شود و کامپایل با خطای SyntaxError\n" +" شکست می‌خورد، زیرا 0xE9 در UTF-8 معتبر نیست: */\n" +"flags.cf_flags = PyCF_IGNORE_COOKIE;\n" +"Py_CompileStringFlags(source, \"\", Py_file_input, &flags);" -msgid "The :func:`compile`, :func:`eval` and :func:`exec` built-in functions set this flag when the source is a :class:`str` object, because they pass the text to the parser encoded as UTF-8." +msgid "" +"The :func:`compile`, :func:`eval` and :func:`exec` built-in functions set " +"this flag when the source is a :class:`str` object, because they pass the " +"text to the parser encoded as UTF-8." msgstr "" +"توابع توکار :func:`compile`، :func:`eval` و :func:`exec` این پرچم را زمانی " +"تنظیم می‌کنند که منبع یک شیء :class:`str` باشد، زیرا متن را با کدگذاری UTF-8" +" به پارسر ارسال می‌کنند." -msgid "Mark the source text as known to be UTF-8 encoded. The :func:`compile`, :func:`eval` and :func:`exec` built-in functions set this flag, but it currently has no effect." +msgid "" +"Mark the source text as known to be UTF-8 encoded. The :func:`compile`, " +":func:`eval` and :func:`exec` built-in functions set this flag, but it " +"currently has no effect." msgstr "" +"متن مبدأ را به‌عنوان کدگذاری‌شده با UTF-8 علامت‌گذاری می‌کند. توابع توکار " +":func:`compile`، :func:`eval` و :func:`exec` این پرچم را تنظیم می‌کنند، اما " +"در حال حاضر هیچ اثری ندارد." -msgid "The \"``PyCF``\" flags above can be combined with \"``CO_FUTURE``\" flags such as :c:macro:`CO_FUTURE_ANNOTATIONS` to enable features normally selectable using :ref:`future statements `. See :ref:`c_codeobject_flags` for a complete list." +msgid "" +"The \"``PyCF``\" flags above can be combined with \"``CO_FUTURE``\" flags " +"such as :c:macro:`CO_FUTURE_ANNOTATIONS` to enable features normally " +"selectable using :ref:`future statements `. See " +":ref:`c_codeobject_flags` for a complete list." msgstr "" +"پرچم‌های \"``PyCF``\" فوق را می‌توان با پرچم‌های \"``CO_FUTURE``\" مانند " +":c:macro:`CO_FUTURE_ANNOTATIONS` ترکیب کرد تا قابلیت‌هایی که به‌طور معمول با" +" استفاده از :ref:`دستورهای آینده (future) ` قابل‌انتخاب هستند، فعال " +"شوند. برای فهرست کامل به :ref:`c_codeobject_flags` مراجعه کنید." msgid "The following masks combine several flags:" -msgstr "" +msgstr "نقاب‌های زیر چندین پرچم را ترکیب می‌کنند:" -msgid "Bitmask of all ``CO_FUTURE`` flags (see :ref:`c_codeobject_flags`), which select features normally enabled by :ref:`future statements `. When code compiled with a ``PyCompilerFlags *flags`` argument contains a ``from __future__ import`` statement, the flag for the imported feature is added to *flags*, so that code executed later in the same context inherits it." -msgstr "" +msgid "" +"Bitmask of all ``CO_FUTURE`` flags (see :ref:`c_codeobject_flags`), which " +"select features normally enabled by :ref:`future statements `. When " +"code compiled with a ``PyCompilerFlags *flags`` argument contains a ``from " +"__future__ import`` statement, the flag for the imported feature is added to" +" *flags*, so that code executed later in the same context inherits it." +msgstr "" +"نقاب بیتی همه پرچم‌های ``CO_FUTURE`` (نگاه کنید به " +":ref:`c_codeobject_flags`)، که قابلیت‌هایی را انتخاب می‌کنند که معمولاً توسط" +" :ref:`دستورات آینده ` فعال می‌شوند. هنگامی که در کد کامپایل‌شده با " +"آرگومان ``PyCompilerFlags *flags`` دستور ``from __future__ import`` وجود " +"داشته باشد، پرچم قابلیت ایمپورت‌شده به *flags* افزوده می‌شود تا کدی که بعداً" +" در همان زمینه اجرا می‌شود، آن را به ارث ببرد." -msgid "Do not use this mask in new code. It is kept only so that old code passing its flags to :func:`compile` keeps working." +msgid "" +"Do not use this mask in new code. It is kept only so that old code passing " +"its flags to :func:`compile` keeps working." msgstr "" +"از این نقاب در کد جدید استفاده نکنید. این نقاب فقط برای این نگه داشته شده " +"است که کدهای قدیمی که پرچم‌های آن را به :func:`compile` ارسال می‌کنند، " +"همچنان کار کنند." -msgid "Bitmask of flags for obsolete future features that no longer have any effect." -msgstr "" +msgid "" +"Bitmask of flags for obsolete future features that no longer have any " +"effect." +msgstr "نقاب بیتی پرچم‌های ویژگی‌های آینده‌ی منسوخ که دیگر هیچ تأثیری ندارند." -msgid "Bitmask of all ``PyCF`` flags that change how the source is compiled, such as :c:macro:`PyCF_ONLY_AST`. The :func:`compile` built-in function uses this mask to validate its *flags* argument." +msgid "" +"Bitmask of all ``PyCF`` flags that change how the source is compiled, such " +"as :c:macro:`PyCF_ONLY_AST`. The :func:`compile` built-in function uses this" +" mask to validate its *flags* argument." msgstr "" +"نقاب بیتی همه‌ی پرچم‌های ``PyCF`` که نحوه‌ی کامپایل کد منبع را تغییر " +"می‌دهند، مانند :c:macro:`PyCF_ONLY_AST`. تابع توکار :func:`compile` از این " +"نقاب برای اعتبارسنجی آرگومان *flags* خود استفاده می‌کند." msgid "Available start symbols" -msgstr "" +msgstr "نمادهای شروعِ در دسترس" -msgid "The start symbol from the Python grammar for isolated expressions; for use with :c:func:`Py_CompileString`." +msgid "" +"The start symbol from the Python grammar for isolated expressions; for use " +"with :c:func:`Py_CompileString`." msgstr "" +"نماد آغاز از گرامر پایتون برای عبارت‌های مجزا؛ برای استفاده با " +":c:func:`Py_CompileString`." -msgid "The start symbol from the Python grammar for sequences of statements as read from a file or other source; for use with :c:func:`Py_CompileString`. This is the symbol to use when compiling arbitrarily long Python source code." +msgid "" +"The start symbol from the Python grammar for sequences of statements as read" +" from a file or other source; for use with :c:func:`Py_CompileString`. This" +" is the symbol to use when compiling arbitrarily long Python source code." msgstr "" +"نماد شروع از گرامر پایتون برای دنباله‌های دستور، همان‌گونه که از یک پرونده " +"یا منبع دیگر خوانده می‌شوند؛ برای استفاده همراه با " +":c:func:`Py_CompileString`. این نمادی است که هنگام کامپایل کردن کد منبع " +"پایتون با طول دلخواه، باید از آن استفاده کنید." -msgid "The start symbol from the Python grammar for a single statement; for use with :c:func:`Py_CompileString`. This is the symbol used for the interactive interpreter loop." +msgid "" +"The start symbol from the Python grammar for a single statement; for use " +"with :c:func:`Py_CompileString`. This is the symbol used for the interactive" +" interpreter loop." msgstr "" +"نماد آغاز از گرامر پایتون برای یک دستور؛ برای استفاده با " +":c:func:`Py_CompileString`. این نمادی است که در حلقه‌ی مفسر تعاملی استفاده " +"می‌شود." -msgid "The start symbol from the Python grammar for a function type; for use with :c:func:`Py_CompileString`. This is used to parse \"signature type comments\" from :pep:`484`." +msgid "" +"The start symbol from the Python grammar for a function type; for use with " +":c:func:`Py_CompileString`. This is used to parse \"signature type " +"comments\" from :pep:`484`." msgstr "" +"نماد شروع از گرامر پایتون برای نوع تابع؛ برای استفاده با " +":c:func:`Py_CompileString`. از این برای تجزیه‌ی «کامنت‌های نوع امضا» از " +":pep:`484` استفاده می‌شود." msgid "This requires the :c:macro:`PyCF_ONLY_AST` flag to be set." -msgstr "" +msgstr "این نیازمند آن است که پرچم :c:macro:`PyCF_ONLY_AST` تنظیم‌شده باشد." msgid ":py:class:`ast.FunctionType`" -msgstr "" +msgstr ":py:class:`ast.FunctionType`" msgid ":pep:`484`" -msgstr "" +msgstr ":pep:`484`" msgid "Stack Effects" -msgstr "" +msgstr "اثرات پشته" msgid ":py:func:`dis.stack_effect`" -msgstr "" +msgstr ":py:func:`dis.stack_effect`" msgid "Sentinel value representing an invalid stack effect." -msgstr "" +msgstr "مقدار نشانگر که اثر پشته‌ی نامعتبر را نمایان می‌کند." msgid "This is currently equivalent to ``INT_MAX``." -msgstr "" +msgstr "این در حال حاضر معادل ``INT_MAX`` است." msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" +"اثر پشته‌ای (stack effect) *opcode* را با آرگومان *oparg* محاسبه می‌کند." -msgid "On success, this function returns the stack effect; on failure, this returns :c:macro:`PY_INVALID_STACK_EFFECT`." +msgid "" +"On success, this function returns the stack effect; on failure, this returns" +" :c:macro:`PY_INVALID_STACK_EFFECT`." msgstr "" +"در صورت موفقیت، این تابع اثر پشته (stack effect) را برمی‌گرداند؛ در صورت " +"شکست، :c:macro:`PY_INVALID_STACK_EFFECT` را برمی‌گرداند." -msgid "Similar to :c:func:`PyCompile_OpcodeStackEffect`, but don't include the stack effect of jumping if *jump* is zero." +msgid "" +"Similar to :c:func:`PyCompile_OpcodeStackEffect`, but don't include the " +"stack effect of jumping if *jump* is zero." msgstr "" +"مشابه :c:func:`PyCompile_OpcodeStackEffect` است، اما اگر *jump* صفر باشد، " +"اثر پشته‌ی پرش را در بر نمی‌گیرد." -msgid "If *jump* is ``0``, this will not include the stack effect of jumping, but if *jump* is ``1`` or ``-1``, this will include it." +msgid "" +"If *jump* is ``0``, this will not include the stack effect of jumping, but " +"if *jump* is ``1`` or ``-1``, this will include it." msgstr "" +"اگر *jump* برابر ``0`` باشد، اثر پرش روی پشته در آن لحاظ نمی‌شود، اما اگر " +"*jump* برابر ``1`` یا ``-1`` باشد، در آن لحاظ می‌شود." msgid "Py_CompileString (C function)" -msgstr "" +msgstr "Py_CompileString (تابع C)" diff --git a/c-api/weakref.po b/c-api/weakref.po index 4742a4168..38680cbd2 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -24,70 +24,183 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Weak Reference Objects" -msgstr "" +msgstr "اشیاء ارجاع ضعیف" -msgid "Python supports *weak references* as first-class objects. There are two specific object types which directly implement weak references. The first is a simple reference object, and the second acts as a proxy for the original object as much as it can." +msgid "" +"Python supports *weak references* as first-class objects. There are two " +"specific object types which directly implement weak references. The first " +"is a simple reference object, and the second acts as a proxy for the " +"original object as much as it can." msgstr "" +"پایتون از *ارجاع‌های ضعیف* به‌عنوان اشیاء درجه یک پشتیبانی می‌کند. دو نوع " +"شیء مشخص وجود دارند که ارجاع‌های ضعیف را مستقیماً پیاده‌سازی می‌کنند. نوع " +"اول یک شیء ارجاع ساده است و نوع دوم تا جایی که می‌تواند، به‌عنوان پراکسی " +"برای شیء اصلی عمل می‌کند." -msgid "Return non-zero if *ob* is either a reference or proxy object. This function always succeeds." +msgid "" +"Return non-zero if *ob* is either a reference or proxy object. This " +"function always succeeds." msgstr "" +"اگر *ob* یا یک ارجاع باشد یا یک شیء پراکسی، مقدار غیرصفر برمی‌گرداند. این " +"تابع همیشه موفق می‌شود." -msgid "Return non-zero if *ob* is a reference object or a subclass of the reference type. This function always succeeds." +msgid "" +"Return non-zero if *ob* is a reference object or a subclass of the reference" +" type. This function always succeeds." msgstr "" +"اگر *ob* یک شیء ارجاع یا زیرکلاسی از نوع ارجاع باشد، مقدار غیر صفر " +"برمی‌گرداند. این تابع همیشه موفق می‌شود." -msgid "Return non-zero if *ob* is a reference object, but not a subclass of the reference type. This function always succeeds." +msgid "" +"Return non-zero if *ob* is a reference object, but not a subclass of the " +"reference type. This function always succeeds." msgstr "" +"اگر *ob* یک شیء ارجاع باشد اما زیرکلاسی از نوع ارجاع نباشد، مقدار ناصفر " +"برمی‌گرداند. این تابع همیشه با موفقیت اجرا می‌شود." -msgid "Return non-zero if *ob* is a proxy object. This function always succeeds." +msgid "" +"Return non-zero if *ob* is a proxy object. This function always succeeds." msgstr "" +"اگر *ob* یک شیء پراکسی باشد، مقدار غیرصفر برمی‌گرداند. این تابع همیشه موفق " +"می‌شود." -msgid "Return a weak reference object for the object *ob*. This will always return a new reference, but is not guaranteed to create a new object; an existing reference object may be returned. The second parameter, *callback*, can be a callable object that receives notification when *ob* is garbage collected; it should accept a single parameter, which will be the weak reference object itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a weakly referenceable object, this will raise :exc:`TypeError` and return ``NULL``." -msgstr "" +msgid "" +"Return a weak reference object for the object *ob*. This will always return" +" a new reference, but is not guaranteed to create a new object; an existing " +"reference object may be returned. The second parameter, *callback*, can be " +"a callable object that receives notification when *ob* is garbage collected;" +" it should accept a single parameter, which will be the weak reference " +"object itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not " +"a weakly referenceable object, this will raise :exc:`TypeError` and return " +"``NULL``." +msgstr "" +"یک شیء ارجاع ضعیف برای شیء *ob* برمی‌گرداند. این تابع همیشه یک ارجاع جدید " +"برمی‌گرداند، اما تضمین نمی‌شود که شیء جدیدی ایجاد کند؛ ممکن است یک شیء ارجاع" +" موجود برگردانده شود. پارامتر دوم، *callback*، می‌تواند یک شیء فراخوانی‌پذیر" +" باشد که هنگام زباله‌روبی *ob* اعلان دریافت می‌کند؛ این شیء باید یک پارامتر " +"واحد بپذیرد که خودِ شیء ارجاع ضعیف خواهد بود. *callback* همچنین می‌تواند " +"``None`` یا ``NULL`` باشد. اگر *ob* شیئی نباشد که بتوان ارجاع ضعیفی به آن " +"ایجاد کرد، این تابع استثنای :exc:`TypeError` را ایجاد می‌کند و ``NULL`` " +"برمی‌گرداند." -msgid ":c:func:`PyType_SUPPORTS_WEAKREFS` for checking if *ob* is weakly referenceable." +msgid "" +":c:func:`PyType_SUPPORTS_WEAKREFS` for checking if *ob* is weakly " +"referenceable." msgstr "" +":c:func:`PyType_SUPPORTS_WEAKREFS` برای بررسی اینکه آیا *ob* قابل ارجاع ضعیف" +" است." -msgid "Return a weak reference proxy object for the object *ob*. This will always return a new reference, but is not guaranteed to create a new object; an existing proxy object may be returned. The second parameter, *callback*, can be a callable object that receives notification when *ob* is garbage collected; it should accept a single parameter, which will be the weak reference object itself. *callback* may also be ``None`` or ``NULL``. If *ob* weakly referenceable object, this will raise :exc:`TypeError` and return ``NULL``." -msgstr "" +msgid "" +"Return a weak reference proxy object for the object *ob*. This will always " +"return a new reference, but is not guaranteed to create a new object; an " +"existing proxy object may be returned. The second parameter, *callback*, " +"can be a callable object that receives notification when *ob* is garbage " +"collected; it should accept a single parameter, which will be the weak " +"reference object itself. *callback* may also be ``None`` or ``NULL``. If " +"*ob* weakly referenceable object, this will raise :exc:`TypeError` and " +"return ``NULL``." +msgstr "" +"یک شیء پراکسی ارجاع ضعیف برای شیء *ob* برمی‌گرداند. این تابع همیشه یک ارجاع " +"جدید برمی‌گرداند، اما تضمین‌شده نیست که شیء جدیدی ایجاد کند؛ ممکن است یک شیء" +" پراکسی موجود برگردانده شود. پارامتر دوم، *callback*، می‌تواند یک شیء " +"فراخوانی‌پذیر باشد که هنگام زباله‌روبی شدن *ob* اطلاع‌رسانی دریافت می‌کند؛ " +"باید یک پارامتر واحد بپذیرد که خودِ شیء ارجاع ضعیف خواهد بود. *callback* " +"همچنین می‌تواند ``None`` یا ``NULL`` باشد. اگر *ob* شیء ارجاع ضعیف‌پذیری " +"نباشد، این تابع :exc:`TypeError` ایجاد می‌کند و ``NULL`` برمی‌گرداند." -msgid "Get a :term:`strong reference` to the referenced object from a weak reference, *ref*, into *\\*pobj*." +msgid "" +"Get a :term:`strong reference` to the referenced object from a weak " +"reference, *ref*, into *\\*pobj*." msgstr "" +"یک :term:`strong reference` به شیء مورد ارجاع را از یک ارجاع ضعیف، *ref*، در" +" *\\*pobj* قرار دهید." -msgid "On success, set *\\*pobj* to a new :term:`strong reference` to the referenced object and return 1." +msgid "" +"On success, set *\\*pobj* to a new :term:`strong reference` to the " +"referenced object and return 1." msgstr "" +"در صورت موفقیت، *\\*pobj* را به یک :term:`strong reference` جدید به شیء مورد" +" ارجاع تنظیم می‌کند و ۱ را برمی‌گرداند." msgid "If the reference is dead, set *\\*pobj* to ``NULL`` and return 0." msgstr "" +"اگر ارجاع مرده باشد، *\\*pobj* را برابر ``NULL`` قرار دهید و 0 را برگردانید." msgid "On error, raise an exception and return -1." -msgstr "" +msgstr "در صورت خطا، یک استثنا برانگیخته و -1 بازگردانده می‌شود." -msgid "Return a :term:`borrowed reference` to the referenced object from a weak reference, *ref*. If the referent is no longer live, returns ``Py_None``." +msgid "" +"Return a :term:`borrowed reference` to the referenced object from a weak " +"reference, *ref*. If the referent is no longer live, returns ``Py_None``." msgstr "" +"یک :term:`ارجاع امانتی ` به شیء ارجاع‌شده را از یک ارجاع" +" ضعیف، *ref*، برمی‌گرداند. اگر ارجاع‌شونده دیگر زنده نباشد، ``Py_None`` را " +"برمی‌گرداند." -msgid "This function returns a :term:`borrowed reference` to the referenced object. This means that you should always call :c:func:`Py_INCREF` on the object except when it cannot be destroyed before the last usage of the borrowed reference." +msgid "" +"This function returns a :term:`borrowed reference` to the referenced object." +" This means that you should always call :c:func:`Py_INCREF` on the object " +"except when it cannot be destroyed before the last usage of the borrowed " +"reference." msgstr "" +"این تابع یک :term:`ارجاع امانتی ` به شیء مورد ارجاع " +"برمی‌گرداند. این بدان معناست که شما باید همیشه :c:func:`Py_INCREF` را روی " +"شیء فراخوانی کنید، مگر اینکه نتوان آن را پیش از آخرین استفاده از ارجاع " +"امانتی نابود کرد." msgid "Use :c:func:`PyWeakref_GetRef` instead." -msgstr "" +msgstr "به جای آن از :c:func:`PyWeakref_GetRef` استفاده کنید." msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." msgstr "" +"مشابه :c:func:`PyWeakref_GetObject`، اما هیچ بررسی خطایی انجام نمی‌دهد." -msgid "Test if the weak reference *ref* is dead. Returns 1 if the reference is dead, 0 if it is alive, and -1 with an error set if *ref* is not a weak reference object." +msgid "" +"Test if the weak reference *ref* is dead. Returns 1 if the reference is " +"dead, 0 if it is alive, and -1 with an error set if *ref* is not a weak " +"reference object." msgstr "" +"بررسی می‌کند که آیا ارجاع ضعیف *ref* مرده است. اگر ارجاع مرده باشد 1 را " +"برمی‌گرداند، اگر زنده باشد 0 را، و اگر *ref* یک شیء ارجاع ضعیف نباشد، -1 را " +"همراه با تنظیم خطا برمی‌گرداند." -msgid "This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler to clear weak references." +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"to clear weak references." msgstr "" +"این تابع توسط هندلر :c:member:`~PyTypeObject.tp_dealloc` برای پاک‌سازی " +"ارجاع‌های ضعیف فراخوانی می‌شود." -msgid "This iterates through the weak references for *object* and calls callbacks for those references which have one. It returns when all callbacks have been attempted." +msgid "" +"This iterates through the weak references for *object* and calls callbacks " +"for those references which have one. It returns when all callbacks have been" +" attempted." msgstr "" +"این تابع ارجاع‌های ضعیفِ *object* را پیمایش می‌کند و برای ارجاع‌هایی که " +"کال‌بک دارند، کال‌بک‌هایشان را فراخوانی می‌کند. این تابع وقتی بازمی‌گردد که " +"تلاش برای همه‌ی کال‌بک‌ها انجام شده باشد." msgid "Clears the weakrefs for *object* without calling the callbacks." msgstr "" +"ارجاع‌های ضعیف مربوط به *object* را بدون فراخوانی کال‌بک‌ها پاک‌سازی می‌کند." -msgid "This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler for types with finalizers (i.e., :meth:`~object.__del__`). The handler for those objects first calls :c:func:`PyObject_ClearWeakRefs` to clear weakrefs and call their callbacks, then the finalizer, and finally this function to clear any weakrefs that may have been created by the finalizer." -msgstr "" +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"for types with finalizers (i.e., :meth:`~object.__del__`). The handler for " +"those objects first calls :c:func:`PyObject_ClearWeakRefs` to clear weakrefs" +" and call their callbacks, then the finalizer, and finally this function to " +"clear any weakrefs that may have been created by the finalizer." +msgstr "" +"این تابع توسط هندلر :c:member:`~PyTypeObject.tp_dealloc` برای نوع‌هایی که " +"نهایی‌ساز دارند (یعنی :meth:`~object.__del__`) فراخوانی می‌شود. هندلر این " +"اشیاء ابتدا :c:func:`PyObject_ClearWeakRefs` را برای پاک کردن ارجاع‌های ضعیف" +" و فراخوانی کال‌بک‌های آن‌ها فراخوانی می‌کند، سپس نهایی‌ساز را اجرا می‌کند و" +" در نهایت این تابع را برای پاک کردن هر ارجاع ضعیفی که ممکن است توسط " +"نهایی‌ساز ایجاد شده باشد فراخوانی می‌کند." -msgid "In most circumstances, it's more appropriate to use :c:func:`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." +msgid "" +"In most circumstances, it's more appropriate to use " +":c:func:`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." msgstr "" +"در بیشتر موارد، استفاده از :c:func:`PyObject_ClearWeakRefs` برای پاک کردن " +"ارجاع‌های ضعیف به‌جای این تابع مناسب‌تر است." diff --git a/copyright.po b/copyright.po index 20de3b9fa..9bffca644 100644 --- a/copyright.po +++ b/copyright.po @@ -44,4 +44,4 @@ msgid "Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserve msgstr "حق نشر © 1991-1995 Stichting Mathematisch Centrum. تمامی حقوق محفوظ است." msgid "See :ref:`history-and-license` for complete license and permissions information." -msgstr "مراجعه کنید به :ref:`history-and-license` برای اطلاعات کامل مجوز و مجوز‌های استفاده." +msgstr "مراجعه کنید به :ref:`history-and-license` برای اطلاعات کامل مجوز و مجوزهای استفاده." diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po index 96b378692..4e32f89eb 100644 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -22,10 +22,18 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in Python 3.14" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.14" -msgid "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules (:pep:`699`; :gh:`101193`)." +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules" +" (:pep:`699`; :gh:`101193`)." msgstr "" +"فیلد ``ma_version_tag`` در :c:type:`PyDictObject` برای ماژول‌های توسعه‌ای " +"(:pep:`699`؛ :gh:`101193`)." -msgid "Creating :c:data:`immutable types ` with mutable bases (:gh:`95388`)." +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." msgstr "" +"ایجاد :c:data:`نوع‌های تغییرناپذیر ` با کلاس‌های " +"پایه تغییرپذیر (:gh:`95388`)." diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index 7e8acc9c9..95339c5af 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -22,136 +22,346 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in Python 3.15" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.15" -msgid "The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:`PyImport_ImportModule` instead." +msgid "" +"The :c:func:`PyImport_ImportModuleNoBlock`: Use " +":c:func:`PyImport_ImportModule` instead." msgstr "" +"تابع :c:func:`PyImport_ImportModuleNoBlock`: به‌جای آن از " +":c:func:`PyImport_ImportModule` استفاده کنید." -msgid ":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use " +":c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " +"`__ can be used to get " +":c:func:`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" +":c:func:`PyWeakref_GetObject` و :c:func:`PyWeakref_GET_OBJECT`: به‌جای آن‌ها" +" از :c:func:`PyWeakref_GetRef` استفاده کنید. می‌توان از `پروژه‌ی pythoncapi-" +"compat `__ برای دسترسی به " +":c:func:`PyWeakref_GetRef` در پایتون 3.12 و نسخه‌های قدیمی‌تر استفاده کرد." -msgid ":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:type:`wchar_t` instead." +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use " +":c:type:`wchar_t` instead." msgstr "" +"نوع :c:type:`Py_UNICODE` و ماکرو :c:macro:`!Py_UNICODE_WIDE`: به‌جای آن‌ها " +"از :c:type:`wchar_t` استفاده کنید." -msgid ":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" +":c:func:`!PyUnicode_AsDecodedObject`: به‌جای آن از :c:func:`PyCodec_Decode` " +"استفاده کنید." -msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead; Note that some codecs (for example, \"base64\") may return a type other than :class:`str`, such as :class:`bytes`." +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead;" +" Note that some codecs (for example, \"base64\") may return a type other " +"than :class:`str`, such as :class:`bytes`." msgstr "" +":c:func:`!PyUnicode_AsDecodedUnicode`: به‌جای آن از :c:func:`PyCodec_Decode`" +" استفاده کنید؛ توجه داشته باشید که برخی کدک‌ها (مثلاً \"base64\") ممکن است " +"نوعی غیر از :class:`str`، مانند :class:`bytes`، برگردانند." -msgid ":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" +":c:func:`!PyUnicode_AsEncodedObject`: به‌جای آن از :c:func:`PyCodec_Encode` " +"استفاده کنید." -msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead; Note that some codecs (for example, \"base64\") may return a type other than :class:`bytes`, such as :class:`str`." +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead;" +" Note that some codecs (for example, \"base64\") may return a type other " +"than :class:`bytes`, such as :class:`str`." msgstr "" +":c:func:`!PyUnicode_AsEncodedUnicode`: به‌جای آن از :c:func:`PyCodec_Encode`" +" استفاده کنید؛ توجه داشته باشید که برخی کدک‌ها (مثلاً \"base64\") ممکن است " +"نوعی غیر از :class:`bytes`، مانند :class:`str`، بازگردانند." msgid "Python initialization functions, deprecated in Python 3.13:" -msgstr "" +msgstr "توابع مقداردهی اولیه پایتون، منسوخ‌شده در پایتون 3.13:" -msgid ":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") ` (:data:`sys.path`) instead." +msgid "" +":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") " +"` (:data:`sys.path`) instead." msgstr "" +":c:func:`Py_GetPath`: به‌جای آن از " +":c:func:`PyConfig_Get(\"module_search_paths\") ` " +"(:data:`sys.path`) استفاده کنید." -msgid ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") ` (:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:`virtual environments ` need to be handled." +msgid "" +":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " +"` (:data:`sys.base_prefix`) instead. Use " +":c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if " +":ref:`virtual environments ` need to be handled." msgstr "" +":c:func:`Py_GetPrefix`: به‌جای آن از :c:func:`PyConfig_Get(\"base_prefix\") " +"` (:data:`sys.base_prefix`) استفاده کنید. اگر لازم باشد " +":ref:`محیط‌های مجازی ` مدیریت شوند، از " +":c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " +"استفاده کنید." -msgid ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys.base_exec_prefix`) instead. Use :c:func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to be handled." -msgstr "" +msgid "" +":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " +"` (:data:`sys.base_exec_prefix`) instead. Use " +":c:func:`PyConfig_Get(\"exec_prefix\") ` " +"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " +"be handled." +msgstr "" +":c:func:`Py_GetExecPrefix`: به جای آن از " +":c:func:`PyConfig_Get(\"base_exec_prefix\") ` " +"(:data:`sys.base_exec_prefix`) استفاده کنید. اگر نیاز به مدیریت " +":ref:`محیط‌های مجازی ` باشد، از " +":c:func:`PyConfig_Get(\"exec_prefix\") ` " +"(:data:`sys.exec_prefix`) استفاده کنید." -msgid ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys.executable`) instead." +msgid "" +":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " +"` (:data:`sys.executable`) instead." msgstr "" +":c:func:`Py_GetProgramFullPath`: به جای آن از " +":c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) استفاده کنید." -msgid ":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys.executable`) instead." +msgid "" +":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") " +"` (:data:`sys.executable`) instead." msgstr "" +":c:func:`Py_GetProgramName`: به جای آن از " +":c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) استفاده کنید." -msgid ":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") ` or the :envvar:`PYTHONHOME` environment variable instead." +msgid "" +":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") " +"` or the :envvar:`PYTHONHOME` environment variable instead." msgstr "" +":c:func:`Py_GetPythonHome`: به جای آن از :c:func:`PyConfig_Get(\"home\") " +"` یا متغیر محیطی :envvar:`PYTHONHOME` استفاده کنید." -msgid "The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and older." +msgid "" +"The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and " +"older." msgstr "" +"می‌توان از `پروژه‌ی pythoncapi-compat `__ برای دسترسی به :c:func:`PyConfig_Get` در پایتون 3.13 و قدیمی‌تر " +"استفاده کرد." -msgid "Functions to configure Python's initialization, deprecated in Python 3.11:" +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" msgstr "" +"توابعی برای پیکربندی راه‌اندازی پایتون، که در پایتون 3.11 منسوخ شده‌اند:" msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "" +":c:func:`!PySys_SetArgvEx()`: به جای آن، :c:member:`PyConfig.argv` را تنظیم " +"کنید." msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "" +":c:func:`!PySys_SetArgv()`: به‌جای آن، :c:member:`PyConfig.argv` را تنظیم " +"کنید." -msgid ":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` instead." +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" +":c:func:`!Py_SetProgramName()`: به جای آن، :c:member:`PyConfig.program_name`" +" را تنظیم کنید." msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "" +":c:func:`!Py_SetPythonHome()`: به‌جای آن، :c:member:`PyConfig.home` را تنظیم" +" کنید." -msgid ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." +msgid "" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and " +":data:`!warnings.filters` instead." msgstr "" +":c:func:`PySys_ResetWarnOptions`: به‌جای آن، :data:`sys.warnoptions` و " +":data:`!warnings.filters` را پاک کنید." -msgid "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:`PyConfig` instead." +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with " +":c:type:`PyConfig` instead." msgstr "" +"به‌جای آن، باید از API :c:func:`Py_InitializeFromConfig` به همراه " +":c:type:`PyConfig` استفاده کرد." msgid "Global configuration variables:" -msgstr "" +msgstr "متغیرهای پیکربندی سراسری:" -msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +msgid "" +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or " +":c:func:`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" +":c:var:`Py_DebugFlag`: به‌جای آن از :c:member:`PyConfig.parser_debug` یا " +":c:func:`PyConfig_Get(\"parser_debug\") ` استفاده کنید." -msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:`PyConfig_Get(\"verbose\") ` instead." +msgid "" +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or " +":c:func:`PyConfig_Get(\"verbose\") ` instead." msgstr "" +":c:var:`Py_VerboseFlag`: به‌جای آن از :c:member:`PyConfig.verbose` یا " +":c:func:`PyConfig_Get(\"verbose\") ` استفاده کنید." -msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:`PyConfig_Get(\"quiet\") ` instead." +msgid "" +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or " +":c:func:`PyConfig_Get(\"quiet\") ` instead." msgstr "" +":c:var:`Py_QuietFlag`: به جای آن از :c:member:`PyConfig.quiet` یا " +":c:func:`PyConfig_Get(\"quiet\") ` استفاده کنید." -msgid ":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:`PyConfig_Get(\"interactive\") ` instead." +msgid "" +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or " +":c:func:`PyConfig_Get(\"interactive\") ` instead." msgstr "" +":c:var:`Py_InteractiveFlag`: به جای آن از :c:member:`PyConfig.interactive` " +"یا :c:func:`PyConfig_Get(\"interactive\") ` استفاده کنید." -msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:`PyConfig_Get(\"inspect\") ` instead." +msgid "" +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or " +":c:func:`PyConfig_Get(\"inspect\") ` instead." msgstr "" +":c:var:`Py_InspectFlag`: به‌جای آن از :c:member:`PyConfig.inspect` یا " +":c:func:`PyConfig_Get(\"inspect\") ` استفاده کنید." -msgid ":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +msgid "" +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or " +":c:func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" +":c:var:`Py_OptimizeFlag`: به جای آن از " +":c:member:`PyConfig.optimization_level` یا " +":c:func:`PyConfig_Get(\"optimization_level\") ` استفاده کنید." -msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:`PyConfig_Get(\"site_import\") ` instead." +msgid "" +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or " +":c:func:`PyConfig_Get(\"site_import\") ` instead." msgstr "" +":c:var:`Py_NoSiteFlag`: به جای آن از :c:member:`PyConfig.site_import` یا " +":c:func:`PyConfig_Get(\"site_import\") ` استفاده کنید." -msgid ":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +msgid "" +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or " +":c:func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" +":c:var:`Py_BytesWarningFlag`: به‌جای آن از " +":c:member:`PyConfig.bytes_warning` یا " +":c:func:`PyConfig_Get(\"bytes_warning\") ` استفاده کنید." -msgid ":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +msgid "" +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or " +":c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" +":c:var:`Py_FrozenFlag`: به‌جای آن از " +":c:member:`PyConfig.pathconfig_warnings` یا " +":c:func:`PyConfig_Get(\"pathconfig_warnings\") ` استفاده کنید." -msgid ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` or :c:func:`PyConfig_Get(\"use_environment\") ` instead." +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " +"or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: به‌جای آن از " +":c:member:`PyConfig.use_environment` یا " +":c:func:`PyConfig_Get(\"use_environment\") ` استفاده کنید." -msgid ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " +"or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: به جای آن از " +":c:member:`PyConfig.write_bytecode` یا " +":c:func:`PyConfig_Get(\"write_bytecode\") ` استفاده کنید." -msgid ":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig.user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +msgid "" +":c:var:`Py_NoUserSiteDirectory`: Use " +":c:member:`PyConfig.user_site_directory` or " +":c:func:`PyConfig_Get(\"user_site_directory\") ` instead." msgstr "" +":c:var:`Py_NoUserSiteDirectory`: به‌جای آن از " +":c:member:`PyConfig.user_site_directory` یا " +":c:func:`PyConfig_Get(\"user_site_directory\") ` استفاده کنید." -msgid ":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or " +":c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: به جای آن از " +":c:member:`PyConfig.buffered_stdio` یا " +":c:func:`PyConfig_Get(\"buffered_stdio\") ` استفاده کنید." -msgid ":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") ` instead." +msgid "" +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") " +"` instead." msgstr "" +":c:var:`Py_HashRandomizationFlag`: به جای آن از " +":c:member:`PyConfig.use_hash_seed` و :c:member:`PyConfig.hash_seed` یا " +":c:func:`PyConfig_Get(\"hash_seed\") ` استفاده کنید." -msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:`PyConfig_Get(\"isolated\") ` instead." +msgid "" +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or " +":c:func:`PyConfig_Get(\"isolated\") ` instead." msgstr "" +":c:var:`Py_IsolatedFlag`: به‌جای آن از :c:member:`PyConfig.isolated` یا " +":c:func:`PyConfig_Get(\"isolated\") ` استفاده کنید." -msgid ":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` or " +":c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " +"instead." msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: به‌جای آن از " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` یا " +":c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " +"استفاده کنید." -msgid ":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig.legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: Use " +":c:member:`PyConfig.legacy_windows_stdio` or " +":c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: به جای آن از " +":c:member:`PyConfig.legacy_windows_stdio` یا " +":c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` استفاده " +"کنید." -msgid ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig.filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`, " +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use " +":c:member:`PyConfig.filesystem_encoding` or " +":c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`، " +":c:var:`!Py_HasFileSystemDefaultEncoding`: به جای آن‌ها از " +":c:member:`PyConfig.filesystem_encoding` یا " +":c:func:`PyConfig_Get(\"filesystem_encoding\") ` استفاده کنید." -msgid ":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig.filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use " +":c:member:`PyConfig.filesystem_errors` or " +":c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: به جای آن از " +":c:member:`PyConfig.filesystem_errors` یا " +":c:func:`PyConfig_Get(\"filesystem_errors\") ` استفاده کنید." -msgid ":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:`Py_PreInitialize`)" +msgid "" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or " +":c:func:`PyConfig_Get(\"utf8_mode\") ` instead. (see " +":c:func:`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`: به‌جای آن از :c:member:`PyPreConfig.utf8_mode` یا " +":c:func:`PyConfig_Get(\"utf8_mode\") ` استفاده کنید. (به " +":c:func:`Py_PreInitialize` مراجعه کنید)" -msgid "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to get these options at runtime." +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with " +":c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be " +"used to get these options at runtime." msgstr "" +"برای تنظیم این گزینه‌ها باید از API :c:func:`Py_InitializeFromConfig` به " +"همراه :c:type:`PyConfig` استفاده شود. یا می‌توان از :c:func:`PyConfig_Get` " +"برای دریافت این گزینه‌ها در ران‌تایم استفاده کرد." diff --git a/deprecations/c-api-pending-removal-in-3.16.po b/deprecations/c-api-pending-removal-in-3.16.po index 2c58be540..954c5a8b0 100644 --- a/deprecations/c-api-pending-removal-in-3.16.po +++ b/deprecations/c-api-pending-removal-in-3.16.po @@ -20,7 +20,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pending removal in Python 3.16" -msgstr "" +msgstr "در پایتون 3.16 حذف خواهد شد" msgid "The bundled copy of ``libmpdec``." -msgstr "" +msgstr "نسخه‌ی همراه ``libmpdec``." diff --git a/deprecations/c-api-pending-removal-in-3.18.po b/deprecations/c-api-pending-removal-in-3.18.po index d4412efa9..a4e51695d 100644 --- a/deprecations/c-api-pending-removal-in-3.18.po +++ b/deprecations/c-api-pending-removal-in-3.18.po @@ -20,67 +20,145 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pending removal in Python 3.18" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.18" -msgid "The following private functions are deprecated and planned for removal in Python 3.18:" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" msgstr "" +"توابع خصوصی زیر منسوخ شده‌اند و حذف آن‌ها در Python 3.18 برنامه‌ریزی شده " +"است:" msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." -msgstr "" +msgstr ":c:func:`!_PyBytes_Join`: از :c:func:`PyBytes_Join` استفاده کنید." -msgid ":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`." +msgid "" +":c:func:`!_PyDict_GetItemStringWithError`: use " +":c:func:`PyDict_GetItemStringRef`." msgstr "" +":c:func:`!_PyDict_GetItemStringWithError`: از " +":c:func:`PyDict_GetItemStringRef` استفاده کنید." msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." -msgstr "" +msgstr ":c:func:`!_PyDict_Pop()`: از :c:func:`PyDict_Pop` استفاده کنید." msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." -msgstr "" +msgstr ":c:func:`!_PyLong_Sign()`: از :c:func:`PyLong_GetSign` استفاده کنید." -msgid ":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:`PyLongWriter_Create`." +msgid "" +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use " +":c:func:`PyLongWriter_Create`." msgstr "" +":c:func:`!_PyLong_FromDigits` و :c:func:`!_PyLong_New`: از " +":c:func:`PyLongWriter_Create` استفاده کنید." -msgid ":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`." +msgid "" +":c:func:`!_PyThreadState_UncheckedGet`: use " +":c:func:`PyThreadState_GetUnchecked`." msgstr "" +":c:func:`!_PyThreadState_UncheckedGet`: از " +":c:func:`PyThreadState_GetUnchecked` استفاده کنید." msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." msgstr "" +":c:func:`!_PyUnicode_AsString`: از :c:func:`PyUnicode_AsUTF8` استفاده کنید." -msgid ":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` with :c:func:`writer = PyUnicodeWriter_Create(0) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)``" +" with :c:func:`writer = PyUnicodeWriter_Create(0) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Init`: عبارت ``_PyUnicodeWriter_Init(&writer)`` " +"را با :c:func:`writer = PyUnicodeWriter_Create(0) ` " +"جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_Finish`: replace ``_PyUnicodeWriter_Finish(&writer)`` with :c:func:`PyUnicodeWriter_Finish(writer) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Finish`: replace " +"``_PyUnicodeWriter_Finish(&writer)`` with " +":c:func:`PyUnicodeWriter_Finish(writer) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Finish`: ``_PyUnicodeWriter_Finish(&writer)`` را " +"با :c:func:`PyUnicodeWriter_Finish(writer) ` جایگزین" +" کنید." -msgid ":c:func:`!_PyUnicodeWriter_Dealloc`: replace ``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:`PyUnicodeWriter_Discard(writer) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Dealloc`: replace " +"``_PyUnicodeWriter_Dealloc(&writer)`` with " +":c:func:`PyUnicodeWriter_Discard(writer) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Dealloc`: ``_PyUnicodeWriter_Dealloc(&writer)`` " +"را با :c:func:`PyUnicodeWriter_Discard(writer) ` " +"جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteChar`: replace ``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteChar`: replace " +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with " +":c:func:`PyUnicodeWriter_WriteChar(writer, ch) `." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteChar`: ``_PyUnicodeWriter_WriteChar(&writer," +" ch)`` را با :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteStr`: replace ``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteStr(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteStr`: replace " +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteStr(writer, str) `." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteStr`: عبارت " +"``_PyUnicodeWriter_WriteStr(&writer, str)`` را با " +":c:func:`PyUnicodeWriter_WriteStr(writer, str) ` " +"جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with " +":c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`: " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` را با " +":c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteASCII(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteASCII(writer, str) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteASCIIString`: " +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` را با " +":c:func:`PyUnicodeWriter_WriteASCII(writer, str) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`: " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` را با " +":c:func:`PyUnicodeWriter_WriteUTF8(writer, str) `" +" جایگزین کنید." msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." -msgstr "" +msgstr ":c:func:`!_PyUnicodeWriter_Prepare`: (بدون جایگزین)." msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." -msgstr "" +msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`: (بدون جایگزین)." msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." -msgstr "" +msgstr ":c:func:`!_Py_HashPointer`: از :c:func:`Py_HashPointer` استفاده کنید." msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." -msgstr "" +msgstr ":c:func:`!_Py_fopen_obj`: از :c:func:`Py_fopen` استفاده کنید." -msgid "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older. (Contributed by Victor Stinner in :gh:`128863`.)" -msgstr "" +msgid "" +"The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and" +" older. (Contributed by Victor Stinner in :gh:`128863`.)" +msgstr "" +"از `پروژه‌ی pythoncapi-compat `__ می‌توان برای دسترسی به این توابع عمومی جدید در پایتون 3.13 و " +"نسخه‌های قدیمی‌تر استفاده کرد. (مشارکت‌شده توسط Victor Stinner در " +":gh:`128863`.)" diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po index 0a8cf1c6c..7477fce14 100644 --- a/deprecations/c-api-pending-removal-in-future.po +++ b/deprecations/c-api-pending-removal-in-future.po @@ -22,61 +22,111 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in future versions" -msgstr "" +msgstr "در نسخه‌های آینده حذف خواهد شد" -msgid "The following APIs are deprecated and will be removed, although there is currently no date scheduled for their removal." +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." msgstr "" +"APIهای زیر منسوخ شده‌اند و حذف خواهند شد، هرچند در حال حاضر تاریخی برای حذف " +"آن‌ها برنامه‌ریزی نشده است." msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: از پایتون 3.8 به بعد لازم نیست." msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" +":c:func:`PyErr_Fetch`: به‌جای آن از :c:func:`PyErr_GetRaisedException` " +"استفاده کنید." -msgid ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` instead." +msgid "" +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " +"instead." msgstr "" +":c:func:`PyErr_NormalizeException`: به‌جای آن از " +":c:func:`PyErr_GetRaisedException` استفاده کنید." -msgid ":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." +msgid "" +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" +":c:func:`PyErr_Restore`: به جای آن از :c:func:`PyErr_SetRaisedException` " +"استفاده کنید." -msgid ":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` instead." +msgid "" +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " +"instead." msgstr "" +":c:func:`PyModule_GetFilename`: به جای آن از " +":c:func:`PyModule_GetFilenameObject` استفاده کنید." msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr "" +":c:func:`PyOS_AfterFork`: به‌جای آن از :c:func:`PyOS_AfterFork_Child` " +"استفاده کنید." -msgid ":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices` instead." +msgid "" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and " +":c:func:`PySlice_AdjustIndices` instead." msgstr "" +":c:func:`PySlice_GetIndicesEx`: به‌جای آن از :c:func:`PySlice_Unpack` و " +":c:func:`PySlice_AdjustIndices` استفاده کنید." msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" -msgstr "" +msgstr ":c:func:`PyUnicode_READY`: از پایتون 3.12 به بعد نیازی به آن نیست" -msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." +msgid "" +":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr "" +":c:func:`!PyErr_Display`: به‌جای آن از :c:func:`PyErr_DisplayException` " +"استفاده کنید." -msgid ":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` instead." +msgid "" +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" +":c:func:`!_PyErr_ChainExceptions`: به جای آن از " +":c:func:`!_PyErr_ChainExceptions1` استفاده کنید." -msgid ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` instead." +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." msgstr "" +"عضو :c:member:`!PyBytesObject.ob_shash`: به‌جای آن، :c:func:`PyObject_Hash` " +"را فراخوانی کنید." msgid "Thread Local Storage (TLS) API:" -msgstr "" +msgstr "API ذخیره‌سازی نخ‌محلی (TLS):" -msgid ":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." +msgid "" +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr "" +":c:func:`PyThread_create_key`: به‌جای آن از :c:func:`PyThread_tss_alloc` " +"استفاده کنید." -msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." +msgid "" +":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr "" +":c:func:`PyThread_delete_key`: به جای آن از :c:func:`PyThread_tss_free` " +"استفاده کنید." -msgid ":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." +msgid "" +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr "" +":c:func:`PyThread_set_key_value`: به‌جای آن از :c:func:`PyThread_tss_set` " +"استفاده کنید." -msgid ":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." +msgid "" +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr "" +":c:func:`PyThread_get_key_value`: به‌جای آن از :c:func:`PyThread_tss_get` " +"استفاده کنید." -msgid ":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` instead." +msgid "" +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " +"instead." msgstr "" +":c:func:`PyThread_delete_key_value`: به جای آن از " +":c:func:`PyThread_tss_delete` استفاده کنید." msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." -msgstr "" +msgstr ":c:func:`PyThread_ReInitTLS`: از پایتون 3.7 به بعد نیازی به آن نیست." diff --git a/deprecations/index.po b/deprecations/index.po index 8a09fbcba..62bedb460 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -22,139 +22,268 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Deprecations" -msgstr "" +msgstr "منسوخ‌شده‌ها" msgid "Pending removal in Python 3.15" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.15" msgid "The import system:" -msgstr "" +msgstr "سیستم ایمپورت:" -msgid "Setting :attr:`~module.__cached__` on a module while failing to set :attr:`__spec__.cached ` is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take into consideration by the import system or standard library. (:gh:`97879`)" +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set " +":attr:`__spec__.cached ` is " +"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take" +" into consideration by the import system or standard library. (:gh:`97879`)" msgstr "" +"تنظیم :attr:`~module.__cached__` روی یک ماژول در حالی که " +":attr:`__spec__.cached ` تنظیم نشده " +"باشد، منسوخ شده است. در پایتون 3.15، :attr:`!__cached__` دیگر توسط سیستم " +"ایمپورت یا کتابخانه استاندارد تنظیم نخواهد شد یا در نظر گرفته نخواهد شد. " +"(:gh:`97879`)" -msgid "Setting :attr:`~module.__package__` on a module while failing to set :attr:`__spec__.parent ` is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or take into consideration by the import system or standard library. (:gh:`97879`)" +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set " +":attr:`__spec__.parent ` is " +"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " +"take into consideration by the import system or standard library. " +"(:gh:`97879`)" msgstr "" +"تنظیم کردن :attr:`~module.__package__` روی یک ماژول بدون تنظیم " +":attr:`__spec__.parent ` منسوخ شده " +"است. در پایتون 3.15، :attr:`!__package__` دیگر توسط سیستم ایمپورت یا " +"کتابخانه استاندارد تنظیم یا در نظر گرفته نخواهد شد. (:gh:`97879`)" msgid ":mod:`ctypes`:" -msgstr "" +msgstr ":mod:`ctypes`:" -msgid "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated since Python 3.13." +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated" +" since Python 3.13." msgstr "" +"تابع مستند‌نشده :func:`!ctypes.SetPointerType` از پایتون 3.13 منسوخ شده است." msgid ":mod:`http.server`:" -msgstr "" +msgstr ":mod:`http.server`:" -msgid "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has been deprecated since Python 3.13. No direct replacement exists. *Anything* is better than CGI to interface a web server with a request handler." +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has" +" been deprecated since Python 3.13. No direct replacement exists. *Anything*" +" is better than CGI to interface a web server with a request handler." msgstr "" +"کلاس :class:`~http.server.CGIHTTPRequestHandler` که از رده خارج است و " +"به‌ندرت استفاده می‌شود، از پایتون 3.13 منسوخ شده است. جایگزین مستقیمی برای " +"آن وجود ندارد. برای برقراری رابط بین وب‌سرور و هندلر درخواست، *هر چیزی* بهتر" +" از CGI است." -msgid "The :option:`!--cgi` flag to the :program:`python -m http.server` command-line interface has been deprecated since Python 3.13." +msgid "" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." msgstr "" +"پرچم :option:`!--cgi` در رابط خط فرمان :program:`python -m http.server` از " +"پایتون 3.13 منسوخ شده است." msgid ":mod:`importlib`:" -msgstr "" +msgstr ":mod:`importlib`:" msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "" +msgstr "متد ``load_module()``: به‌جای آن از ``exec_module()`` استفاده کنید." msgid ":mod:`pathlib`:" -msgstr "" +msgstr ":mod:`pathlib`:" -msgid ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :func:`os.path.isreserved` to detect reserved paths on Windows." +msgid "" +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use " +":func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" +":meth:`.PurePath.is_reserved` از پایتون 3.13 منسوخ شده است. برای تشخیص " +"مسیرهای رزروشده در ویندوز، از :func:`os.path.isreserved` استفاده کنید." msgid ":mod:`platform`:" -msgstr "" +msgstr ":mod:`platform`:" -msgid ":func:`~platform.java_ver` has been deprecated since Python 3.13. This function is only useful for Jython support, has a confusing API, and is largely untested." +msgid "" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" +":func:`~platform.java_ver` از پایتون 3.13 منسوخ شده است. این تابع تنها برای " +"پشتیبانی از Jython مفید است، API گیج‌کننده‌ای دارد و عمدتاً آزمایش‌نشده است." msgid ":mod:`sysconfig`:" -msgstr "" +msgstr ":mod:`sysconfig`:" -msgid "The *check_home* argument of :func:`sysconfig.is_python_build` has been deprecated since Python 3.12." +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." msgstr "" +"آرگومان *check_home* تابع :func:`sysconfig.is_python_build` از پایتون 3.12 " +"منسوخ شده است." msgid ":mod:`threading`:" -msgstr "" +msgstr ":mod:`threading`:" -msgid ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any arguments has been deprecated since Python 3.14, as the Python version does not permit any arguments, but the C version allows any number of positional or keyword arguments, ignoring every argument." +msgid "" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" +":func:`~threading.RLock` در پایتون 3.15 هیچ آرگومانی نخواهد گرفت. ارسال هر " +"آرگومانی از پایتون 3.14 منسوخ شده است، زیرا نسخه‌ی پایتون اجازه‌ی هیچ " +"آرگومانی را نمی‌دهد، اما نسخه‌ی C هر تعداد آرگومان جایگاهی یا کلیدواژه‌ای را" +" می‌پذیرد و همه‌ی آرگومان‌ها را نادیده می‌گیرد." msgid ":mod:`types`:" -msgstr "" +msgstr ":mod:`types`:" -msgid ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" +":class:`types.CodeType`: دسترسی به :attr:`~codeobject.co_lnotab` طبق " +":pep:`626` از نسخه‌ی 3.10 منسوخ شد و قرار بود در 3.12 حذف شود، اما تنها در " +"3.12 یک :exc:`DeprecationWarning` مناسب دریافت کرد. ممکن است در 3.15 حذف " +"شود. (مشارکت‌شده توسط نیکیتا سوبولف در :gh:`101866`.)" msgid ":mod:`typing`:" -msgstr "" +msgstr ":mod:`typing`:" -msgid "The undocumented keyword argument syntax for creating :class:`~typing.NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python 3.13. Use the class-based syntax or the functional syntax instead." +msgid "" +"The undocumented keyword argument syntax for creating " +":class:`~typing.NamedTuple` classes (for example, ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " +"3.13. Use the class-based syntax or the functional syntax instead." msgstr "" +"سینتکس مستندنشده‌ی آرگومان کلیدواژه‌ای برای ایجاد کلاس‌های " +":class:`~typing.NamedTuple` (برای مثال، ``Point = NamedTuple(\"Point\", " +"x=int, y=int)``) از پایتون 3.13 منسوخ شده است. به‌جای آن، از سینتکس مبتنی بر" +" کلاس یا سینتکس تابعی استفاده کنید." -msgid "When using the functional syntax of :class:`~typing.TypedDict`\\s, failing to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})`` to create a TypedDict with zero field." -msgstr "" +msgid "" +"When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " +"to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " +"passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated " +"since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = " +"TypedDict(\"TD\", {})`` to create a TypedDict with zero field." +msgstr "" +"هنگام استفاده از سینتکس تابعی :class:`~typing.TypedDict`، عدم ارسال مقدار به" +" پارامتر *fields* (``TD = TypedDict(\"TD\")``) یا ارسال ``None`` (``TD = " +"TypedDict(\"TD\", None)``) از پایتون 3.13 منسوخ شده است. برای ایجاد یک " +"TypedDict بدون هیچ فیلدی، از ``class TD(TypedDict): pass`` یا ``TD = " +"TypedDict(\"TD\", {})`` استفاده کنید." -msgid "The :deco:`typing.no_type_check_decorator` decorator function has been deprecated since Python 3.13. After eight years in the :mod:`typing` module, it has yet to be supported by any major type checker." +msgid "" +"The :deco:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module," +" it has yet to be supported by any major type checker." msgstr "" +"تابع دکوراتور :deco:`typing.no_type_check_decorator` از پایتون 3.13 منسوخ " +"شده است. پس از هشت سال حضور در ماژول :mod:`typing`، هنوز توسط هیچ بررسی‌گر " +"نوع مطرحی پشتیبانی نشده است." msgid ":mod:`wave`:" -msgstr "" +msgstr ":mod:`wave`:" -msgid "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been deprecated since Python 3.13." +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and " +":meth:`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` " +"and :class:`~wave.Wave_write` classes have been deprecated since Python " +"3.13." msgstr "" +"متدهای :meth:`~wave.Wave_read.getmark`، :meth:`!setmark` و " +":meth:`~wave.Wave_read.getmarkers` در کلاس‌های :class:`~wave.Wave_read` و " +":class:`~wave.Wave_write` از پایتون 3.13 منسوخ شده‌اند." msgid ":mod:`zipimport`:" -msgstr "" +msgstr ":mod:`zipimport`:" -msgid ":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed by Jiahao Li in :gh:`125746`.)" +msgid "" +":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " +"3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " +"by Jiahao Li in :gh:`125746`.)" msgstr "" +":meth:`~zipimport.zipimporter.load_module` از پایتون 3.10 منسوخ شده است. به " +"جای آن از :meth:`~zipimport.zipimporter.exec_module` استفاده کنید. " +"(مشارکت‌شده توسط جیاهائو لی در :gh:`125746`.)" msgid "Pending removal in Python 3.16" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.16" -msgid "Setting :attr:`~module.__loader__` on a module while failing to set :attr:`__spec__.loader ` is deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or taken into consideration by the import system or the standard library." +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set " +":attr:`__spec__.loader ` is " +"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " +"taken into consideration by the import system or the standard library." msgstr "" +"تنظیم :attr:`~module.__loader__` روی یک ماژول بدون تنظیم " +":attr:`__spec__.loader ` منسوخ شده " +"است. در پایتون 3.16، :attr:`!__loader__` دیگر توسط سیستم ایمپورت یا کتابخانه" +" استاندارد تنظیم یا در نظر گرفته نخواهد شد." msgid ":mod:`array`:" -msgstr "" +msgstr ":mod:`array`:" -msgid "The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in documentation since Python 3.3 and at runtime since Python 3.13. Use the ``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." msgstr "" +"کد قالب ``'u'`` (:c:type:`wchar_t`) در مستندات از پایتون 3.3 و در ران‌تایم " +"از پایتون 3.13 منسوخ شده است. به جای آن، برای نویسه‌های یونیکد از کد قالب " +"``'w'`` (:c:type:`Py_UCS4`) استفاده کنید." msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -msgid ":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" +":func:`!asyncio.iscoroutinefunction` منسوخ شده است و در Python 3.16 حذف " +"خواهد شد؛ به‌جای آن از :func:`inspect.iscoroutinefunction` استفاده کنید. (با" +" مشارکت Jiahao Li و Kumar Aditya در :gh:`122875`.)" -msgid ":mod:`asyncio` policy system is deprecated and will be removed in Python 3.16. In particular, the following classes and functions are deprecated:" +msgid "" +":mod:`asyncio` policy system is deprecated and will be removed in Python " +"3.16. In particular, the following classes and functions are deprecated:" msgstr "" +"سامانه سیاست‌های :mod:`asyncio` منسوخ شده است و در پایتون 3.16 حذف خواهد شد." +" به‌ویژه، کلاس‌ها و توابع زیر منسوخ شده‌اند:" msgid ":class:`asyncio.AbstractEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.AbstractEventLoopPolicy`" msgid ":class:`asyncio.DefaultEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.DefaultEventLoopPolicy`" msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgid ":func:`asyncio.get_event_loop_policy`" -msgstr "" +msgstr ":func:`asyncio.get_event_loop_policy`" msgid ":func:`asyncio.set_event_loop_policy`" -msgstr "" +msgstr ":func:`asyncio.set_event_loop_policy`" -msgid "Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with *loop_factory* to use the desired event loop implementation." +msgid "" +"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " +"*loop_factory* to use the desired event loop implementation." msgstr "" +"کاربران باید برای استفاده از پیاده‌سازی حلقه رویداد مطلوب، از " +":func:`asyncio.run` یا :class:`asyncio.Runner` به همراه *loop_factory* " +"استفاده کنند." msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" msgstr "" +"به عنوان مثال، برای استفاده از :class:`asyncio.SelectorEventLoop` در " +"ویندوز::" msgid "" "import asyncio\n" @@ -164,555 +293,1185 @@ msgid "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" ...\n" +"\n" +"asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" -msgstr "" +msgstr "(مشارکت‌شده توسط Kumar Aditya در :gh:`127949`.)" msgid ":mod:`builtins`:" -msgstr "" +msgstr ":mod:`builtins`:" -msgid "Bitwise inversion on boolean types, ``~True`` or ``~False`` has been deprecated since Python 3.12, as it produces surprising and unintuitive results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation of a Boolean. In the rare case that you need the bitwise inversion of the underlying integer, convert to ``int`` explicitly (``~int(x)``)." -msgstr "" +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" +"وارون‌سازی بیتی روی نوع‌های بولی، یعنی ``~True`` یا ``~False``، از پایتون " +"3.12 منسوخ شده است، زیرا نتایج غیرمنتظره و غیرشهودی تولید می‌کند (``-2`` و " +"``-1``). برای نقیض منطقی یک مقدار بولی، به‌جای آن از ``not x`` استفاده کنید." +" در موارد نادر که به وارون‌سازی بیتی عدد صحیح زیرین نیاز دارید، آن را به‌طور" +" صریح به ``int`` تبدیل کنید (``~int(x)``)." msgid ":mod:`functools`:" -msgstr "" +msgstr ":mod:`functools`:" -msgid "Calling the Python implementation of :func:`functools.reduce` with *function* or *sequence* as keyword arguments has been deprecated since Python 3.14." +msgid "" +"Calling the Python implementation of :func:`functools.reduce` with " +"*function* or *sequence* as keyword arguments has been deprecated since " +"Python 3.14." msgstr "" +"فراخوانی پیاده‌سازی پایتونی :func:`functools.reduce` با آرگومان‌های " +"کلیدواژه‌ای *function* یا *sequence* از پایتون 3.14 منسوخ شده است." msgid ":mod:`logging`:" -msgstr "" +msgstr ":mod:`logging`:" -msgid "Support for custom logging handlers with the *strm* argument is deprecated and scheduled for removal in Python 3.16. Define handlers with the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" +msgid "" +"Support for custom logging handlers with the *strm* argument is deprecated " +"and scheduled for removal in Python 3.16. Define handlers with the *stream* " +"argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" msgstr "" +"پشتیبانی از هندلرهای سفارشی گزارش‌گیری با آرگومان *strm* منسوخ شده و برای " +"حذف در پایتون 3.16 برنامه‌ریزی شده است. به جای آن، هندلرها را با آرگومان " +"*stream* تعریف کنید. (مشارکت Mariusz Felisiak در :gh:`115032`.)" msgid ":mod:`mimetypes`:" -msgstr "" +msgstr ":mod:`mimetypes`:" -msgid "Valid extensions start with a '.' or are empty for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:`75223`.)" +msgid "" +"Valid extensions start with a '.' or are empty for " +":meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and" +" will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " +"Kemenade in :gh:`75223`.)" msgstr "" +"پسوندهای معتبر برای :meth:`mimetypes.MimeTypes.add_type` با '.' شروع می‌شوند" +" یا خالی هستند. پسوندهای بدون نقطه منسوخ شده‌اند و در پایتون 3.16 استثنای " +":exc:`ValueError` ایجاد خواهند کرد. (با مشارکت هوگو ون کمناده در " +":gh:`75223`.)" msgid ":mod:`shutil`:" -msgstr "" +msgstr ":mod:`shutil`:" -msgid "The :class:`!ExecError` exception has been deprecated since Python 3.14. It has not been used by any function in :mod:`!shutil` since Python 3.4, and is now an alias of :exc:`RuntimeError`." +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is" +" now an alias of :exc:`RuntimeError`." msgstr "" +"استثنای :class:`!ExecError` از پایتون 3.14 منسوخ شده است. از پایتون 3.4 به " +"بعد، هیچ تابعی در :mod:`!shutil` از آن استفاده نکرده است و اکنون نام مستعاری" +" برای :exc:`RuntimeError` است." msgid ":mod:`symtable`:" -msgstr "" +msgstr ":mod:`symtable`:" -msgid "The :meth:`Class.get_methods ` method has been deprecated since Python 3.14." +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." msgstr "" +"متد :meth:`Class.get_methods ` از پایتون 3.14 " +"منسوخ شده است." msgid ":mod:`sys`:" -msgstr "" +msgstr ":mod:`sys`:" -msgid "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead." +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated" +" since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." msgstr "" +"تابع :func:`~sys._enablelegacywindowsfsencoding` از پایتون 3.13 منسوخ شده " +"است. به جای آن از متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"استفاده کنید." -msgid "The :func:`!sysconfig.expand_makefile_vars` function has been deprecated since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` instead." +msgid "" +"The :func:`!sysconfig.expand_makefile_vars` function has been deprecated " +"since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` " +"instead." msgstr "" +"تابع :func:`!sysconfig.expand_makefile_vars` از پایتون 3.14 منسوخ شده است. " +"به جای آن، از آرگومان ``vars`` در :func:`sysconfig.get_paths` استفاده کنید." msgid ":mod:`tarfile`:" -msgstr "" +msgstr ":mod:`tarfile`:" -msgid "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been deprecated since Python 3.13." +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" +"ویژگی مستندنشده و استفاده‌نشده‌ی :attr:`!TarFile.tarfile` از پایتون 3.13 " +"منسوخ شده است." msgid "Pending removal in Python 3.17" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.17" msgid ":mod:`collections.abc`:" -msgstr "" +msgstr ":mod:`collections.abc`:" -msgid ":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." msgstr "" +":class:`collections.abc.ByteString` برای حذف در پایتون 3.17 برنامه‌ریزی شده " +"است." -msgid "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` implements the :ref:`buffer protocol ` at runtime. For use in type annotations, either use :class:`~collections.abc.Buffer` or a union that explicitly specifies the types your code supports (e.g., ``bytes | bytearray | memoryview``)." -msgstr "" +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in" +" type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." +msgstr "" +"از ``isinstance(obj, collections.abc.Buffer)`` استفاده کنید تا در زمان اجرا " +"بررسی کنید که آیا ``obj`` :ref:`پروتکل بافر ` را پیاده‌سازی " +"می‌کند. برای استفاده در حاشیه‌نویسی نوع، یا از " +":class:`~collections.abc.Buffer` استفاده کنید یا از یک اجتماع (union) که " +"به‌طور صریح نوع‌هایی را که کد شما از آن‌ها پشتیبانی می‌کند مشخص می‌کند " +"(مثلاً ``bytes | bytearray | memoryview``)." -msgid ":class:`!ByteString` was originally intended to be an abstract class that would serve as a supertype of both :class:`bytes` and :class:`bytearray`. However, since the ABC never had any methods, knowing that an object was an instance of :class:`!ByteString` never actually told you anything useful about the object. Other common buffer types such as :class:`memoryview` were also never understood as subtypes of :class:`!ByteString` (either at runtime or by static type checkers)." -msgstr "" +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were" +" also never understood as subtypes of :class:`!ByteString` (either at " +"runtime or by static type checkers)." +msgstr "" +":class:`!ByteString` در اصل قرار بود یک کلاس انتزاعی باشد که به‌عنوان " +"ابرنوعی برای هر دو :class:`bytes` و :class:`bytearray` عمل کند. با این حال، " +"از آنجا که این کلاس پایه انتزاعی هرگز هیچ متدی نداشت، دانستن اینکه شیئی " +"نمونه‌ای از :class:`!ByteString` است، هرگز در واقع هیچ چیز مفیدی درباره‌ی آن" +" شیء به شما نمی‌گفت. سایر نوع‌های رایج بافر مانند :class:`memoryview` نیز " +"هرگز به‌عنوان زیرنوع‌هایی از :class:`!ByteString` شناخته نمی‌شدند (نه در " +"ران‌تایم و نه توسط بررسی‌گرهای نوع ایستا)." -msgid "See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" msgstr "" +"برای جزئیات بیشتر به :pep:`PEP 688 <688#current-options>` مراجعه کنید. " +"(مشارکت‌شده توسط Shantanu Jain در :gh:`91896`.)" -msgid "Before Python 3.14, old-style unions were implemented using the private class ``typing._UnionGenericAlias``. This class is no longer needed for the implementation, but it has been retained for backward compatibility, with removal scheduled for Python 3.17. Users should use documented introspection helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead of relying on private implementation details." -msgstr "" +msgid "" +"Before Python 3.14, old-style unions were implemented using the private " +"class ``typing._UnionGenericAlias``. This class is no longer needed for the " +"implementation, but it has been retained for backward compatibility, with " +"removal scheduled for Python 3.17. Users should use documented introspection" +" helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead " +"of relying on private implementation details." +msgstr "" +"پیش از پایتون 3.14، اجتماع‌های سبک قدیمی (old-style unions) با استفاده از " +"کلاس خصوصی ``typing._UnionGenericAlias`` پیاده‌سازی می‌شدند. این کلاس دیگر " +"برای پیاده‌سازی لازم نیست، اما برای سازگاری با نسخه‌های پیشین حفظ شده است و " +"حذف آن برای پایتون 3.17 برنامه‌ریزی شده است. کاربران باید به‌جای اتکا به " +"جزئیات پیاده‌سازی خصوصی، از ابزارهای کمکی درون‌کاوی (introspection) مستند " +"مانند :func:`typing.get_origin` و :func:`typing.get_args` استفاده کنند." -msgid ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for removal in Python 3.17." +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17." msgstr "" +":class:`typing.ByteString` که از پایتون 3.9 منسوخ شده است، برای حذف در " +"پایتون 3.17 برنامه‌ریزی شده است." msgid "Pending removal in Python 3.18" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.18" msgid ":mod:`decimal`:" -msgstr "" +msgstr ":mod:`decimal`:" -msgid "The non-standard and undocumented :class:`~decimal.Decimal` format specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C implementation, has been deprecated since Python 3.13. (Contributed by Serhiy Storchaka in :gh:`89902`.)" +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier" +" ``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" msgstr "" +"مشخص‌کننده قالب ``'N'`` در :class:`~decimal.Decimal` که غیراستاندارد و " +"مستندسازی‌نشده است و فقط در پیاده‌سازی C ماژول :mod:`!decimal` پشتیبانی " +"می‌شود، از پایتون 3.13 منسوخ شده است. (مشارکت‌شده توسط Serhiy Storchaka در " +":gh:`89902`.)" msgid "Pending removal in Python 3.19" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.19" -msgid "Implicitly switching to the MSVC-compatible struct layout by setting :attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-Windows platforms." +msgid "" +"Implicitly switching to the MSVC-compatible struct layout by setting " +":attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` " +"on non-Windows platforms." msgstr "" +"تغییر ضمنی به چیدمان ساختار سازگار با MSVC با تنظیم " +":attr:`~ctypes.Structure._pack_` اما بدون تنظیم " +":attr:`~ctypes.Structure._layout_` روی پلتفرم‌های غیر ویندوزی." msgid "Pending removal in future versions" -msgstr "" +msgstr "در انتظار حذف در نسخه‌های آینده" -msgid "The following APIs will be removed in the future, although there is currently no date scheduled for their removal." +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." msgstr "" +"APIهای زیر در آینده حذف خواهند شد، اگرچه در حال حاضر تاریخی برای حذف آن‌ها " +"برنامه‌ریزی نشده است." msgid ":mod:`argparse`:" -msgstr "" +msgstr ":mod:`argparse`:" -msgid "Nesting argument groups and nesting mutually exclusive groups are deprecated." +msgid "" +"Nesting argument groups and nesting mutually exclusive groups are " +"deprecated." msgstr "" +"تودرتو کردن گروه‌های آرگومان و تودرتو کردن گروه‌های انحصاری متقابل منسوخ " +"شده‌اند." -msgid "Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +msgid "" +"Passing the undocumented keyword argument *prefix_chars* to " +":meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." msgstr "" +"گذراندن آرگومان کلیدواژه‌ای مستندنشده‌ی *prefix_chars* به " +":meth:`~argparse.ArgumentParser.add_argument_group` اکنون منسوخ شده است." msgid "The :class:`argparse.FileType` type converter is deprecated." -msgstr "" +msgstr "مبدل نوع :class:`argparse.FileType` منسوخ شده است." -msgid "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single argument signature." +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature" +" is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." msgstr "" +"تولیدگرها: امضای ``throw(type, exc, tb)`` و ``athrow(type, exc, tb)`` منسوخ " +"شده است؛ به جای آن از ``throw(exc)`` و ``athrow(exc)`` استفاده کنید — امضای " +"تک‌آرگومانی." -msgid "Currently Python accepts numeric literals immediately followed by keywords, for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as ``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised if the numeric literal is immediately followed by one of keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` and :keyword:`or`. In a future release it will be changed to a syntax error. (:gh:`87999`)" -msgstr "" +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords " +":keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, " +":keyword:`in`, :keyword:`is` and :keyword:`or`. In a future release it will" +" be changed to a syntax error. (:gh:`87999`)" +msgstr "" +"در حال حاضر پایتون مقادیر لفظی عددی را می‌پذیرد که بلافاصله کلیدواژه‌ای پس " +"از آن‌ها می‌آید، برای مثال ``0in x``، ``1or x``، ``0if 1else 2``. این اجازه " +"می‌دهد عبارت‌های گیج‌کننده و مبهمی مانند ``[0x1for x in y]`` نوشته شوند (که " +"می‌توان آن را به صورت ``[0x1 for x in y]`` یا ``[0x1f or x in y]`` تفسیر " +"کرد). اگر مقدار لفظی عددی بلافاصله با یکی از کلیدواژه‌های :keyword:`and`، " +":keyword:`else`، :keyword:`for`، :keyword:`if`، :keyword:`in`، :keyword:`is`" +" و :keyword:`or` دنبال شود، یک هشدار سینتکس صادر می‌شود. در یک نسخه‌ی آینده " +"این مورد به یک خطای سینتکس تبدیل خواهد شد. (:gh:`87999`)" -msgid "Support for ``__index__()`` and ``__int__()`` method returning non-int type: these methods will be required to return an instance of a strict subclass of :class:`int`." +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type:" +" these methods will be required to return an instance of a strict subclass " +"of :class:`int`." msgstr "" +"پشتیبانی از بازگرداندن نوعی غیر از int توسط متد‌های ``__index__()`` و " +"``__int__()``: این متدها ملزم خواهند شد که نمونه‌ای از یک زیرکلاس محضِ " +":class:`int` را بازگردانند." -msgid "Support for ``__float__()`` method returning a strict subclass of :class:`float`: these methods will be required to return an instance of :class:`float`." +msgid "" +"Support for ``__float__()`` method returning a strict subclass of " +":class:`float`: these methods will be required to return an instance of " +":class:`float`." msgstr "" +"پشتیبانی از متد ``__float__()`` که زیرکلاس اکیدی از :class:`float` را " +"برمی‌گرداند: این متدها ملزم خواهند شد که نمونه‌ای از :class:`float` را " +"بازگردانند." -msgid "Support for ``__complex__()`` method returning a strict subclass of :class:`complex`: these methods will be required to return an instance of :class:`complex`." +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of " +":class:`complex`: these methods will be required to return an instance of " +":class:`complex`." msgstr "" +"پشتیبانی از متد ``__complex__()`` که زیرکلاس اکیدِ :class:`complex` را " +"برمی‌گرداند: این متدها ملزم خواهند شد که نمونه‌ای از :class:`complex` را " +"برگردانند." -msgid "Passing a complex number as the *real* or *imag* argument in the :func:`complex` constructor is now deprecated; it should only be passed as a single positional argument. (Contributed by Serhiy Storchaka in :gh:`109218`.)" +msgid "" +"Passing a complex number as the *real* or *imag* argument in the " +":func:`complex` constructor is now deprecated; it should only be passed as a" +" single positional argument. (Contributed by Serhiy Storchaka in " +":gh:`109218`.)" msgstr "" +"گذراندن یک عدد مختلط به‌عنوان آرگومان *real* یا *imag* در سازنده‌ی " +":func:`complex` اکنون منسوخ شده است؛ این عدد باید فقط به‌صورت یک آرگومان " +"جایگاهی واحد ارسال شود. (مشارکت Serhiy Storchaka در :gh:`109218`.)" -msgid ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and " +":data:`calendar.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" +":mod:`calendar`: ثابت‌های ``calendar.January`` و ``calendar.February`` منسوخ" +" شده‌اند و با :data:`calendar.JANUARY` و :data:`calendar.FEBRUARY` جایگزین " +"شده‌اند. (مشارکت‌شده توسط Prince Roshan در :gh:`103636`.)" -msgid ":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:`133038`)" +msgid "" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " +"(:gh:`133038`)" msgstr "" +":mod:`codecs`: به‌جای :func:`codecs.open` از :func:`open` استفاده کنید. " +"(:gh:`133038`)" -msgid ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method instead." +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." msgstr "" +":attr:`codeobject.co_lnotab`: به جای آن از متد :meth:`codeobject.co_lines` " +"استفاده کنید." msgid ":mod:`datetime`:" -msgstr "" +msgstr ":mod:`datetime`:" -msgid ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime.UTC)``." +msgid "" +":meth:`~datetime.datetime.utcnow`: use " +"``datetime.datetime.now(tz=datetime.UTC)``." msgstr "" +":meth:`~datetime.datetime.utcnow`: از " +"``datetime.datetime.now(tz=datetime.UTC)`` استفاده کنید." -msgid ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" +":meth:`~datetime.datetime.utcfromtimestamp`: از " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)`` استفاده " +"کنید." msgid ":mod:`gettext`: Plural value must be an integer." -msgstr "" +msgstr ":mod:`gettext`: مقدار جمع باید یک عدد صحیح باشد." -msgid ":func:`~importlib.util.cache_from_source` *debug_override* parameter is deprecated: use the *optimization* parameter instead." +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." msgstr "" +"پارامتر *debug_override* در :func:`~importlib.util.cache_from_source` منسوخ " +"شده است: به جای آن از پارامتر *optimization* استفاده کنید." msgid ":mod:`importlib.metadata`:" -msgstr "" +msgstr ":mod:`importlib.metadata`:" msgid "``EntryPoints`` tuple interface." -msgstr "" +msgstr "رابط تاپلیِ ``EntryPoints``." msgid "Implicit ``None`` on return values." -msgstr "" +msgstr "``None`` ضمنی در مقادیر بازگشتی." -msgid ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, use :meth:`~logging.warning` instead." +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`: متد ``warn()`` از پایتون 3.3 به بعد منسوخ شده است؛ به جای آن" +" از :meth:`~logging.warning` استفاده کنید." -msgid ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use BytesIO and binary mode instead." +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." msgstr "" +":mod:`mailbox`: استفاده از ورودی StringIO و حالت متنی منسوخ شده است؛ به‌جای " +"آن از BytesIO و حالت دودویی استفاده کنید." -msgid ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." -msgstr "" +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr ":mod:`os`: فراخوانی :func:`os.register_at_fork` در فرایند چندنخی." -msgid ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is deprecated, use an exception instance." +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is" +" deprecated, use an exception instance." msgstr "" +":class:`!pydoc.ErrorDuringImport`: مقدار تاپل برای پارامتر *exc_info* منسوخ " +"شده است؛ از یک نمونه استثنا استفاده کنید." -msgid ":mod:`re`: More strict rules are now applied for numerical group references and group names in regular expressions. Only sequence of ASCII digits is now accepted as a numerical reference. The group name in bytes patterns and replacement strings can now only contain ASCII letters and digits and underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" -msgstr "" +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and" +" replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" +":mod:`re`: اکنون قواعد سخت‌گیرانه‌تری برای ارجاع‌های عددی گروه و نام گروه‌ها" +" در عبارت‌های باقاعده اعمال می‌شود. اکنون فقط دنباله‌ای از ارقام اسکی " +"به‌عنوان ارجاع عددی پذیرفته می‌شود. نام گروه در الگوهای بایتی و رشته‌های " +"جایگزین اکنون فقط می‌تواند شامل حروف و ارقام اسکی و زیرخط باشد. (مشارکت‌شده " +"توسط Serhiy Storchaka در :gh:`91760`.)" -msgid ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr "" +"ماژول‌های :mod:`!sre_compile`، :mod:`!sre_constants` و :mod:`!sre_parse`." -msgid ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in Python 3.12; use the *onexc* parameter instead." +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in" +" Python 3.12; use the *onexc* parameter instead." msgstr "" +":mod:`shutil`: پارامتر *onerror* در :func:`~shutil.rmtree` در پایتون 3.12 " +"منسوخ شده است؛ به‌جای آن از پارامتر *onexc* استفاده کنید." msgid ":mod:`ssl` options and protocols:" -msgstr "" +msgstr "گزینه‌ها و پروتکل‌های :mod:`ssl`:" msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." -msgstr "" +msgstr ":class:`ssl.SSLContext` بدون آرگومان پروتکل، منسوخ شده است." -msgid ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and " +":meth:`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" +":class:`ssl.SSLContext`: متدهای :meth:`~ssl.SSLContext.set_npn_protocols` و " +":meth:`!selected_npn_protocol` منسوخ شده‌اند: به‌جای آن‌ها از ALPN استفاده " +"کنید." msgid "``ssl.OP_NO_SSL*`` options" -msgstr "" +msgstr "گزینه‌های ``ssl.OP_NO_SSL*``" msgid "``ssl.OP_NO_TLS*`` options" -msgstr "" +msgstr "گزینه‌های ``ssl.OP_NO_TLS*``" msgid "``ssl.PROTOCOL_SSLv3``" -msgstr "" +msgstr "``ssl.PROTOCOL_SSLv3``" msgid "``ssl.PROTOCOL_TLS``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLS``" msgid "``ssl.PROTOCOL_TLSv1``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1``" msgid "``ssl.PROTOCOL_TLSv1_1``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1_1``" msgid "``ssl.PROTOCOL_TLSv1_2``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1_2``" msgid "``ssl.TLSVersion.SSLv3``" -msgstr "" +msgstr "``ssl.TLSVersion.SSLv3``" msgid "``ssl.TLSVersion.TLSv1``" -msgstr "" +msgstr "``ssl.TLSVersion.TLSv1``" msgid "``ssl.TLSVersion.TLSv1_1``" -msgstr "" +msgstr "``ssl.TLSVersion.TLSv1_1``" msgid ":mod:`threading` methods:" -msgstr "" +msgstr "متدهای :mod:`threading`:" -msgid ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition.notify_all`." +msgid "" +":meth:`!threading.Condition.notifyAll`: use " +":meth:`~threading.Condition.notify_all`." msgstr "" +":meth:`!threading.Condition.notifyAll`: از " +":meth:`~threading.Condition.notify_all` استفاده کنید." msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" +":meth:`!threading.Event.isSet`: از :meth:`~threading.Event.is_set` استفاده " +"کنید." -msgid ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :attr:`threading.Thread.daemon` attribute." +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use " +":attr:`threading.Thread.daemon` attribute." msgstr "" +":meth:`!threading.Thread.isDaemon`، :meth:`threading.Thread.setDaemon`: از " +"ویژگی :attr:`threading.Thread.daemon` استفاده کنید." -msgid ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :attr:`threading.Thread.name` attribute." +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use " +":attr:`threading.Thread.name` attribute." msgstr "" +":meth:`!threading.Thread.getName`، :meth:`threading.Thread.setName`: از " +"ویژگی :attr:`threading.Thread.name` استفاده کنید." -msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgid "" +":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" +":meth:`!threading.currentThread`: از :meth:`threading.current_thread` " +"استفاده کنید." msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" +":meth:`!threading.activeCount`: از :meth:`threading.active_count` استفاده " +"کنید." msgid ":class:`typing.Text` (:gh:`92332`)." -msgstr "" +msgstr ":class:`typing.Text` (:gh:`92332`)." -msgid "The internal class ``typing._UnionGenericAlias`` is no longer used to implement :class:`typing.Union`. To preserve compatibility with users using this private class, a compatibility shim will be provided until at least Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" +msgid "" +"The internal class ``typing._UnionGenericAlias`` is no longer used to " +"implement :class:`typing.Union`. To preserve compatibility with users using " +"this private class, a compatibility shim will be provided until at least " +"Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" +"کلاس داخلی ``typing._UnionGenericAlias`` دیگر برای پیاده‌سازی " +":class:`typing.Union` استفاده نمی‌شود. برای حفظ سازگاری با کاربرانی که از " +"این کلاس خصوصی استفاده می‌کنند، یک لایه‌ی سازگاری (shim) تا دست‌کم Python " +"3.17 ارائه خواهد شد. (مشارکت‌شده توسط Jelle Zijlstra در :gh:`105499`.)" -msgid ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a value that is not ``None`` from a test case." +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." msgstr "" +":class:`unittest.IsolatedAsyncioTestCase`: برگرداندن مقداری غیر از ``None`` " +"از یک مورد آزمون منسوخ شده است." -msgid ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` instead" +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" msgstr "" +"توابع منسوخ :mod:`urllib.parse`: به‌جای آن‌ها :func:`~urllib.parse.urlparse`" msgid "``splitattr()``" -msgstr "" +msgstr "``splitattr()``" msgid "``splithost()``" -msgstr "" +msgstr "``splithost()``" msgid "``splitnport()``" -msgstr "" +msgstr "``splitnport()``" msgid "``splitpasswd()``" -msgstr "" +msgstr "``splitpasswd()``" msgid "``splitport()``" -msgstr "" +msgstr "``splitport()``" msgid "``splitquery()``" -msgstr "" +msgstr "``splitquery()``" msgid "``splittag()``" -msgstr "" +msgstr "``splittag()``" msgid "``splittype()``" -msgstr "" +msgstr "``splittype()``" msgid "``splituser()``" -msgstr "" +msgstr "``splituser()``" msgid "``splitvalue()``" -msgstr "" +msgstr "``splitvalue()``" msgid "``to_bytes()``" -msgstr "" +msgstr "``to_bytes()``" -msgid ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial writes." +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." msgstr "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` نباید نوشتن جزئی (partial " +"write) انجام دهد." -msgid ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it will always return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests instead." +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an " +":class:`~xml.etree.ElementTree.Element` is deprecated. In a future release " +"it will always return ``True``. Prefer explicit ``len(elem)`` or ``elem is " +"not None`` tests instead." msgstr "" +":mod:`xml.etree.ElementTree`: آزمودن مقدار درستی یک " +":class:`~xml.etree.ElementTree.Element` منسوخ شده است. در نسخه‌ای در آینده، " +"همیشه ``True`` بازگردانده خواهد شد. به جای آن، آزمون‌های صریح ``len(elem)`` " +"یا ``elem is not None`` را ترجیح دهید." -msgid ":func:`sys._clear_type_cache` is deprecated: use :func:`sys._clear_internal_caches` instead." +msgid "" +":func:`sys._clear_type_cache` is deprecated: use " +":func:`sys._clear_internal_caches` instead." msgstr "" +":func:`sys._clear_type_cache` منسوخ شده است: به جای آن از " +":func:`sys._clear_internal_caches` استفاده کنید." msgid "C API deprecations" -msgstr "" +msgstr "منسوخ‌شده‌های C API" -msgid "The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:`PyImport_ImportModule` instead." +msgid "" +"The :c:func:`PyImport_ImportModuleNoBlock`: Use " +":c:func:`PyImport_ImportModule` instead." msgstr "" +"تابع :c:func:`PyImport_ImportModuleNoBlock`: به جای آن از " +":c:func:`PyImport_ImportModule` استفاده کنید." -msgid ":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use " +":c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " +"`__ can be used to get " +":c:func:`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" +":c:func:`PyWeakref_GetObject` و :c:func:`PyWeakref_GET_OBJECT`: به‌جای آن‌ها" +" از :c:func:`PyWeakref_GetRef` استفاده کنید. می‌توان از `پروژه‌ی pythoncapi-" +"compat `__ برای دسترسی به " +":c:func:`PyWeakref_GetRef` در پایتون 3.12 و نسخه‌های قدیمی‌تر استفاده کرد." -msgid ":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:type:`wchar_t` instead." +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use " +":c:type:`wchar_t` instead." msgstr "" +"نوع :c:type:`Py_UNICODE` و ماکرو :c:macro:`!Py_UNICODE_WIDE`: به جای آن‌ها " +"از :c:type:`wchar_t` استفاده کنید." -msgid ":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" +":c:func:`!PyUnicode_AsDecodedObject`: به جای آن از :c:func:`PyCodec_Decode` " +"استفاده کنید." -msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead; Note that some codecs (for example, \"base64\") may return a type other than :class:`str`, such as :class:`bytes`." +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead;" +" Note that some codecs (for example, \"base64\") may return a type other " +"than :class:`str`, such as :class:`bytes`." msgstr "" +":c:func:`!PyUnicode_AsDecodedUnicode`: به‌جای آن از :c:func:`PyCodec_Decode`" +" استفاده کنید؛ توجه داشته باشید که برخی کدک‌ها (برای مثال، \"base64\") ممکن " +"است نوعی غیر از :class:`str` مانند :class:`bytes` برگردانند." -msgid ":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" +":c:func:`!PyUnicode_AsEncodedObject`: به‌جای آن از :c:func:`PyCodec_Encode` " +"استفاده کنید." -msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead; Note that some codecs (for example, \"base64\") may return a type other than :class:`bytes`, such as :class:`str`." +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead;" +" Note that some codecs (for example, \"base64\") may return a type other " +"than :class:`bytes`, such as :class:`str`." msgstr "" +":c:func:`!PyUnicode_AsEncodedUnicode`: به‌جای آن از :c:func:`PyCodec_Encode`" +" استفاده کنید؛ توجه داشته باشید که برخی کدک‌ها (برای مثال، \"base64\") ممکن " +"است نوعی غیر از :class:`bytes`، مانند :class:`str` برگردانند." msgid "Python initialization functions, deprecated in Python 3.13:" -msgstr "" +msgstr "توابع مقداردهی اولیه پایتون، منسوخ‌شده در پایتون 3.13:" -msgid ":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") ` (:data:`sys.path`) instead." +msgid "" +":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") " +"` (:data:`sys.path`) instead." msgstr "" +":c:func:`Py_GetPath`: به‌جای آن از " +":c:func:`PyConfig_Get(\"module_search_paths\") ` " +"(:data:`sys.path`) استفاده کنید." -msgid ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") ` (:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:`virtual environments ` need to be handled." +msgid "" +":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " +"` (:data:`sys.base_prefix`) instead. Use " +":c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if " +":ref:`virtual environments ` need to be handled." msgstr "" +":c:func:`Py_GetPrefix`: به جای آن از :c:func:`PyConfig_Get(\"base_prefix\") " +"` (:data:`sys.base_prefix`) استفاده کنید. اگر لازم باشد " +":ref:`محیط‌های مجازی ` مدیریت شوند، از " +":c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " +"استفاده کنید." -msgid ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys.base_exec_prefix`) instead. Use :c:func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to be handled." -msgstr "" +msgid "" +":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " +"` (:data:`sys.base_exec_prefix`) instead. Use " +":c:func:`PyConfig_Get(\"exec_prefix\") ` " +"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " +"be handled." +msgstr "" +":c:func:`Py_GetExecPrefix`: به جای آن از " +":c:func:`PyConfig_Get(\"base_exec_prefix\") ` " +"(:data:`sys.base_exec_prefix`) استفاده کنید. اگر نیاز به مدیریت " +":ref:`محیط‌های مجازی ` باشد، از " +":c:func:`PyConfig_Get(\"exec_prefix\") ` " +"(:data:`sys.exec_prefix`) استفاده کنید." -msgid ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys.executable`) instead." +msgid "" +":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " +"` (:data:`sys.executable`) instead." msgstr "" +":c:func:`Py_GetProgramFullPath`: به جای آن از " +":c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) استفاده کنید." -msgid ":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys.executable`) instead." +msgid "" +":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") " +"` (:data:`sys.executable`) instead." msgstr "" +":c:func:`Py_GetProgramName`: به جای آن از " +":c:func:`PyConfig_Get(\"executable\") ` " +"(:data:`sys.executable`) استفاده کنید." -msgid ":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") ` or the :envvar:`PYTHONHOME` environment variable instead." +msgid "" +":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") " +"` or the :envvar:`PYTHONHOME` environment variable instead." msgstr "" +":c:func:`Py_GetPythonHome`: به جای آن از :c:func:`PyConfig_Get(\"home\") " +"` یا متغیر محیطی :envvar:`PYTHONHOME` استفاده کنید." -msgid "The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and older." +msgid "" +"The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and " +"older." msgstr "" +"می‌توان از پروژه‌ی `pythoncapi-compat `__ برای به دست آوردن :c:func:`PyConfig_Get` در پایتون 3.13 و " +"نسخه‌های قدیمی‌تر استفاده کرد." -msgid "Functions to configure Python's initialization, deprecated in Python 3.11:" +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" msgstr "" +"توابعی برای پیکربندی راه‌اندازی پایتون، که در پایتون 3.11 منسوخ شده‌اند:" msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "" +":c:func:`!PySys_SetArgvEx()`: به جای آن، :c:member:`PyConfig.argv` را تنظیم " +"کنید." msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "" +":c:func:`!PySys_SetArgv()`: به جای آن :c:member:`PyConfig.argv` را تنظیم " +"کنید." -msgid ":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` instead." +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" +":c:func:`!Py_SetProgramName()`: به‌جای آن :c:member:`PyConfig.program_name` " +"را تنظیم کنید." msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "" +":c:func:`!Py_SetPythonHome()`: به جای آن :c:member:`PyConfig.home` را تنظیم " +"کنید." -msgid ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." +msgid "" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and " +":data:`!warnings.filters` instead." msgstr "" +":c:func:`PySys_ResetWarnOptions`: به‌جای آن، :data:`sys.warnoptions` و " +":data:`!warnings.filters` را پاک کنید." -msgid "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:`PyConfig` instead." +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with " +":c:type:`PyConfig` instead." msgstr "" +"به‌جای آن، باید از API :c:func:`Py_InitializeFromConfig` به همراه " +":c:type:`PyConfig` استفاده شود." msgid "Global configuration variables:" -msgstr "" +msgstr "متغیرهای پیکربندی سراسری:" -msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +msgid "" +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or " +":c:func:`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" +":c:var:`Py_DebugFlag`: به‌جای آن از :c:member:`PyConfig.parser_debug` یا " +":c:func:`PyConfig_Get(\"parser_debug\") ` استفاده کنید." -msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:`PyConfig_Get(\"verbose\") ` instead." +msgid "" +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or " +":c:func:`PyConfig_Get(\"verbose\") ` instead." msgstr "" +":c:var:`Py_VerboseFlag`: به جای آن از :c:member:`PyConfig.verbose` یا " +":c:func:`PyConfig_Get(\"verbose\") ` استفاده کنید." -msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:`PyConfig_Get(\"quiet\") ` instead." +msgid "" +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or " +":c:func:`PyConfig_Get(\"quiet\") ` instead." msgstr "" +":c:var:`Py_QuietFlag`: به‌جای آن از :c:member:`PyConfig.quiet` یا " +":c:func:`PyConfig_Get(\"quiet\") ` استفاده کنید." -msgid ":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:`PyConfig_Get(\"interactive\") ` instead." +msgid "" +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or " +":c:func:`PyConfig_Get(\"interactive\") ` instead." msgstr "" +":c:var:`Py_InteractiveFlag`: به جای آن از :c:member:`PyConfig.interactive` " +"یا :c:func:`PyConfig_Get(\"interactive\") ` استفاده کنید." -msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:`PyConfig_Get(\"inspect\") ` instead." +msgid "" +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or " +":c:func:`PyConfig_Get(\"inspect\") ` instead." msgstr "" +":c:var:`Py_InspectFlag`: به‌جای آن از :c:member:`PyConfig.inspect` یا " +":c:func:`PyConfig_Get(\"inspect\") ` استفاده کنید." -msgid ":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +msgid "" +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or " +":c:func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" +":c:var:`Py_OptimizeFlag`: به جای آن از " +":c:member:`PyConfig.optimization_level` یا " +":c:func:`PyConfig_Get(\"optimization_level\") ` استفاده کنید." -msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:`PyConfig_Get(\"site_import\") ` instead." +msgid "" +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or " +":c:func:`PyConfig_Get(\"site_import\") ` instead." msgstr "" +":c:var:`Py_NoSiteFlag`: به‌جای آن از :c:member:`PyConfig.site_import` یا " +":c:func:`PyConfig_Get(\"site_import\") ` استفاده کنید." -msgid ":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +msgid "" +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or " +":c:func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" +":c:var:`Py_BytesWarningFlag`: به‌جای آن از " +":c:member:`PyConfig.bytes_warning` یا " +":c:func:`PyConfig_Get(\"bytes_warning\") ` استفاده کنید." -msgid ":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +msgid "" +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or " +":c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" +":c:var:`Py_FrozenFlag`: به‌جای آن از " +":c:member:`PyConfig.pathconfig_warnings` یا " +":c:func:`PyConfig_Get(\"pathconfig_warnings\") ` استفاده کنید." -msgid ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` or :c:func:`PyConfig_Get(\"use_environment\") ` instead." +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " +"or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: به‌جای آن از " +":c:member:`PyConfig.use_environment` یا " +":c:func:`PyConfig_Get(\"use_environment\") ` استفاده کنید." -msgid ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " +"or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: به‌جای آن از " +":c:member:`PyConfig.write_bytecode` یا " +":c:func:`PyConfig_Get(\"write_bytecode\") ` استفاده کنید." -msgid ":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig.user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +msgid "" +":c:var:`Py_NoUserSiteDirectory`: Use " +":c:member:`PyConfig.user_site_directory` or " +":c:func:`PyConfig_Get(\"user_site_directory\") ` instead." msgstr "" +":c:var:`Py_NoUserSiteDirectory`: به‌جای آن از " +":c:member:`PyConfig.user_site_directory` یا " +":c:func:`PyConfig_Get(\"user_site_directory\") ` استفاده کنید." -msgid ":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or " +":c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: به جای آن از " +":c:member:`PyConfig.buffered_stdio` یا " +":c:func:`PyConfig_Get(\"buffered_stdio\") ` استفاده کنید." -msgid ":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") ` instead." +msgid "" +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") " +"` instead." msgstr "" +":c:var:`Py_HashRandomizationFlag`: به‌جای آن از " +":c:member:`PyConfig.use_hash_seed` و :c:member:`PyConfig.hash_seed` یا " +":c:func:`PyConfig_Get(\"hash_seed\") ` استفاده کنید." -msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:`PyConfig_Get(\"isolated\") ` instead." +msgid "" +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or " +":c:func:`PyConfig_Get(\"isolated\") ` instead." msgstr "" +":c:var:`Py_IsolatedFlag`: به جای آن از :c:member:`PyConfig.isolated` یا " +":c:func:`PyConfig_Get(\"isolated\") ` استفاده کنید." -msgid ":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` or " +":c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " +"instead." msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: به جای آن از " +":c:member:`PyPreConfig.legacy_windows_fs_encoding` یا " +":c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " +"استفاده کنید." -msgid ":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig.legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: Use " +":c:member:`PyConfig.legacy_windows_stdio` or " +":c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: به‌جای آن از " +":c:member:`PyConfig.legacy_windows_stdio` یا " +":c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` استفاده " +"کنید." -msgid ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig.filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`, " +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use " +":c:member:`PyConfig.filesystem_encoding` or " +":c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`، " +":c:var:`!Py_HasFileSystemDefaultEncoding`: به‌جای آن‌ها از " +":c:member:`PyConfig.filesystem_encoding` یا " +":c:func:`PyConfig_Get(\"filesystem_encoding\") ` استفاده کنید." -msgid ":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig.filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use " +":c:member:`PyConfig.filesystem_errors` or " +":c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: به جای آن از " +":c:member:`PyConfig.filesystem_errors` یا " +":c:func:`PyConfig_Get(\"filesystem_errors\") ` استفاده کنید." -msgid ":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:`Py_PreInitialize`)" +msgid "" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or " +":c:func:`PyConfig_Get(\"utf8_mode\") ` instead. (see " +":c:func:`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`: به جای آن از :c:member:`PyPreConfig.utf8_mode` یا " +":c:func:`PyConfig_Get(\"utf8_mode\") ` استفاده کنید. (به " +":c:func:`Py_PreInitialize` مراجعه کنید)" -msgid "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to get these options at runtime." +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with " +":c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be " +"used to get these options at runtime." msgstr "" +"برای تنظیم این گزینه‌ها باید از API :c:func:`Py_InitializeFromConfig` به " +"همراه :c:type:`PyConfig` استفاده شود. یا می‌توان از :c:func:`PyConfig_Get` " +"برای دریافت این گزینه‌ها در زمان اجرا استفاده کرد." -msgid "The following private functions are deprecated and planned for removal in Python 3.18:" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" msgstr "" +"توابع خصوصی زیر منسوخ شده‌اند و حذف آن‌ها در پایتون 3.18 برنامه‌ریزی شده " +"است:" msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." -msgstr "" +msgstr ":c:func:`!_PyBytes_Join`: از :c:func:`PyBytes_Join` استفاده کنید." -msgid ":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`." +msgid "" +":c:func:`!_PyDict_GetItemStringWithError`: use " +":c:func:`PyDict_GetItemStringRef`." msgstr "" +":c:func:`!_PyDict_GetItemStringWithError`: از " +":c:func:`PyDict_GetItemStringRef` استفاده کنید." msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." -msgstr "" +msgstr ":c:func:`!_PyDict_Pop()`: از :c:func:`PyDict_Pop` استفاده کنید." msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." -msgstr "" +msgstr ":c:func:`!_PyLong_Sign()`: از :c:func:`PyLong_GetSign` استفاده کنید." -msgid ":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:`PyLongWriter_Create`." +msgid "" +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use " +":c:func:`PyLongWriter_Create`." msgstr "" +":c:func:`!_PyLong_FromDigits` و :c:func:`!_PyLong_New`: از " +":c:func:`PyLongWriter_Create` استفاده کنید." -msgid ":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`." +msgid "" +":c:func:`!_PyThreadState_UncheckedGet`: use " +":c:func:`PyThreadState_GetUnchecked`." msgstr "" +":c:func:`!_PyThreadState_UncheckedGet`: از " +":c:func:`PyThreadState_GetUnchecked` استفاده کنید." msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." msgstr "" +":c:func:`!_PyUnicode_AsString`: از :c:func:`PyUnicode_AsUTF8` استفاده کنید." -msgid ":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` with :c:func:`writer = PyUnicodeWriter_Create(0) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)``" +" with :c:func:`writer = PyUnicodeWriter_Create(0) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Init`: ``_PyUnicodeWriter_Init(&writer)`` را با " +":c:func:`writer = PyUnicodeWriter_Create(0) ` " +"جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_Finish`: replace ``_PyUnicodeWriter_Finish(&writer)`` with :c:func:`PyUnicodeWriter_Finish(writer) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Finish`: replace " +"``_PyUnicodeWriter_Finish(&writer)`` with " +":c:func:`PyUnicodeWriter_Finish(writer) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Finish`: عبارت " +"``_PyUnicodeWriter_Finish(&writer)`` را با " +":c:func:`PyUnicodeWriter_Finish(writer) ` جایگزین " +"کنید." -msgid ":c:func:`!_PyUnicodeWriter_Dealloc`: replace ``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:`PyUnicodeWriter_Discard(writer) `." +msgid "" +":c:func:`!_PyUnicodeWriter_Dealloc`: replace " +"``_PyUnicodeWriter_Dealloc(&writer)`` with " +":c:func:`PyUnicodeWriter_Discard(writer) `." msgstr "" +":c:func:`!_PyUnicodeWriter_Dealloc`: ``_PyUnicodeWriter_Dealloc(&writer)`` " +"را با :c:func:`PyUnicodeWriter_Discard(writer) ` " +"جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteChar`: replace ``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteChar`: replace " +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with " +":c:func:`PyUnicodeWriter_WriteChar(writer, ch) `." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteChar`: ``_PyUnicodeWriter_WriteChar(&writer," +" ch)`` را با :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteStr`: replace ``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteStr(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteStr`: replace " +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteStr(writer, str) `." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteStr`: ``_PyUnicodeWriter_WriteStr(&writer, " +"str)`` را با :c:func:`PyUnicodeWriter_WriteStr(writer, str) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with " +":c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`: عبارت " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` را با " +":c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteASCII(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteASCII(writer, str) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteASCIIString`: " +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` را با " +":c:func:`PyUnicodeWriter_WriteASCII(writer, str) " +"` جایگزین کنید." -msgid ":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) `." +msgid "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with " +":c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " +"`." msgstr "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`: " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` را با " +":c:func:`PyUnicodeWriter_WriteUTF8(writer, str) `" +" جایگزین کنید." msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." -msgstr "" +msgstr ":c:func:`!_PyUnicodeWriter_Prepare`: (بدون جایگزین)." msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." -msgstr "" +msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`: (بدون جایگزین)." msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." -msgstr "" +msgstr ":c:func:`!_Py_HashPointer`: از :c:func:`Py_HashPointer` استفاده کنید." msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." -msgstr "" +msgstr ":c:func:`!_Py_fopen_obj`: از :c:func:`Py_fopen` استفاده کنید." -msgid "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older. (Contributed by Victor Stinner in :gh:`128863`.)" +msgid "" +"The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and" +" older. (Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" +"می‌توان از `پروژه‌ی pythoncapi-compat `__ برای به دست آوردن این توابع عمومی جدید در پایتون 3.13 و نسخه‌های" +" قدیمی‌تر استفاده کرد. (مشارکت‌شده توسط Victor Stinner در :gh:`128863`.)" -msgid "The following APIs are deprecated and will be removed, although there is currently no date scheduled for their removal." +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." msgstr "" +"API‌های زیر منسوخ شده‌اند و حذف خواهند شد، اگرچه در حال حاضر هیچ تاریخی برای" +" حذف آن‌ها تعیین نشده است." msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." msgstr "" +":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: از پایتون 3.8 به بعد مورد نیاز نیست." msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" +":c:func:`PyErr_Fetch`: به‌جای آن از :c:func:`PyErr_GetRaisedException` " +"استفاده کنید." -msgid ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` instead." +msgid "" +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " +"instead." msgstr "" +":c:func:`PyErr_NormalizeException`: به جای آن از " +":c:func:`PyErr_GetRaisedException` استفاده کنید." -msgid ":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." +msgid "" +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" +":c:func:`PyErr_Restore`: به‌جای آن از :c:func:`PyErr_SetRaisedException` " +"استفاده کنید." -msgid ":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` instead." +msgid "" +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " +"instead." msgstr "" +":c:func:`PyModule_GetFilename`: به‌جای آن از " +":c:func:`PyModule_GetFilenameObject` استفاده کنید." msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr "" +":c:func:`PyOS_AfterFork`: به‌جای آن از :c:func:`PyOS_AfterFork_Child` " +"استفاده کنید." -msgid ":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices` instead." +msgid "" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and " +":c:func:`PySlice_AdjustIndices` instead." msgstr "" +":c:func:`PySlice_GetIndicesEx`: به‌جای آن از :c:func:`PySlice_Unpack` و " +":c:func:`PySlice_AdjustIndices` استفاده کنید." msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" -msgstr "" +msgstr ":c:func:`PyUnicode_READY`: از پایتون 3.12 به بعد نیازی به آن نیست" -msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." +msgid "" +":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr "" +":c:func:`!PyErr_Display`: به‌جای آن از :c:func:`PyErr_DisplayException` " +"استفاده کنید." -msgid ":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` instead." +msgid "" +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" +":c:func:`!_PyErr_ChainExceptions`: به‌جای آن از " +":c:func:`!_PyErr_ChainExceptions1` استفاده کنید." -msgid ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` instead." +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." msgstr "" +"عضو :c:member:`!PyBytesObject.ob_shash`: به جای آن :c:func:`PyObject_Hash` " +"را فراخوانی کنید." msgid "Thread Local Storage (TLS) API:" -msgstr "" +msgstr "API ذخیره‌سازی محلی نخ (TLS):" -msgid ":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." +msgid "" +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr "" +":c:func:`PyThread_create_key`: به‌جای آن از :c:func:`PyThread_tss_alloc` " +"استفاده کنید." -msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." +msgid "" +":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr "" +":c:func:`PyThread_delete_key`: به‌جای آن از :c:func:`PyThread_tss_free` " +"استفاده کنید." -msgid ":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." +msgid "" +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr "" +":c:func:`PyThread_set_key_value`: به‌جای آن از :c:func:`PyThread_tss_set` " +"استفاده کنید." -msgid ":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." +msgid "" +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr "" +":c:func:`PyThread_get_key_value`: به‌جای آن از :c:func:`PyThread_tss_get` " +"استفاده کنید." -msgid ":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` instead." +msgid "" +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " +"instead." msgstr "" +":c:func:`PyThread_delete_key_value`: به جای آن از " +":c:func:`PyThread_tss_delete` استفاده کنید." msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." -msgstr "" +msgstr ":c:func:`PyThread_ReInitTLS`: از پایتون 3.7 به بعد لازم نیست." diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po index 79ed62c94..f4d9ea66f 100644 --- a/deprecations/pending-removal-in-3.13.po +++ b/deprecations/pending-removal-in-3.13.po @@ -22,100 +22,100 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in Python 3.13" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.13" msgid "Modules (see :pep:`594`):" -msgstr "" +msgstr "ماژول‌ها (:pep:`594` را ببینید):" msgid ":mod:`!aifc`" -msgstr "" +msgstr ":mod:`!aifc`" msgid ":mod:`!audioop`" -msgstr "" +msgstr ":mod:`!audioop`" msgid ":mod:`!cgi`" -msgstr "" +msgstr ":mod:`!cgi`" msgid ":mod:`!cgitb`" -msgstr "" +msgstr ":mod:`!cgitb`" msgid ":mod:`!chunk`" -msgstr "" +msgstr ":mod:`!chunk`" msgid ":mod:`!crypt`" -msgstr "" +msgstr ":mod:`!crypt`" msgid ":mod:`!imghdr`" -msgstr "" +msgstr ":mod:`!imghdr`" msgid ":mod:`!mailcap`" -msgstr "" +msgstr ":mod:`!mailcap`" msgid ":mod:`!msilib`" -msgstr "" +msgstr ":mod:`!msilib`" msgid ":mod:`!nis`" -msgstr "" +msgstr ":mod:`!nis`" msgid ":mod:`!nntplib`" -msgstr "" +msgstr ":mod:`!nntplib`" msgid ":mod:`!ossaudiodev`" -msgstr "" +msgstr ":mod:`!ossaudiodev`" msgid ":mod:`!pipes`" -msgstr "" +msgstr ":mod:`!pipes`" msgid ":mod:`!sndhdr`" -msgstr "" +msgstr ":mod:`!sndhdr`" msgid ":mod:`!spwd`" -msgstr "" +msgstr ":mod:`!spwd`" msgid ":mod:`!sunau`" -msgstr "" +msgstr ":mod:`!sunau`" msgid ":mod:`!telnetlib`" -msgstr "" +msgstr ":mod:`!telnetlib`" msgid ":mod:`!uu`" -msgstr "" +msgstr ":mod:`!uu`" msgid ":mod:`!xdrlib`" -msgstr "" +msgstr ":mod:`!xdrlib`" msgid "Other modules:" -msgstr "" +msgstr "ماژول‌های دیگر:" msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" -msgstr "" +msgstr ":mod:`!lib2to3`، و برنامه :program:`2to3` (:gh:`84540`)" msgid "APIs:" -msgstr "" +msgstr "API‌ها:" msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -msgstr "" +msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgid "``locale.resetlocale()`` (:gh:`90817`)" -msgstr "" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -msgstr "" +msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -msgstr "" +msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -msgstr "" +msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" -msgstr "" +msgstr "زنجیره‌سازی توصیف‌گر :class:`classmethod` (:gh:`89519`)" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 20c456b7e..fff276c61 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -13,109 +13,208 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2024-07-20 00:54+0000\n" +"PO-Revision-Date: 2026-09-04 20:28+0330\n" +"Last-Translator: \n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Pending removal in Python 3.14" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.14" -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`.)" +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 "" +":mod:`argparse`: پارامترهای *type*، *choices* و *metavar* در :class:`!" +"argparse.BooleanOptionalAction` منسوخ شده‌اند و در 3.14 حذف خواهند شد. (با " +"مشارکت نیکیتا سوبولف در :gh:`92248`.)" -msgid ":mod:`ast`: The following features have been deprecated in documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at runtime when they are accessed or used, and will be removed in Python 3.14:" +msgid "" +":mod:`ast`: The following features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" msgstr "" +":mod:`ast`: قابلیت‌های زیر از پایتون 3.8 در مستندات منسوخ شده‌اند، اکنون " +"هنگام دسترسی یا استفاده از آن‌ها در ران‌تایم باعث " +"صدور :exc:`DeprecationWarning` می‌شوند و در پایتون 3.14 حذف خواهند شد:" msgid ":class:`!ast.Num`" -msgstr "" +msgstr ":class:`!ast.Num`" msgid ":class:`!ast.Str`" -msgstr "" +msgstr ":class:`!ast.Str`" msgid ":class:`!ast.Bytes`" -msgstr "" +msgstr ":class:`!ast.Bytes`" msgid ":class:`!ast.NameConstant`" -msgstr "" +msgstr ":class:`!ast.NameConstant`" msgid ":class:`!ast.Ellipsis`" -msgstr "" +msgstr ":class:`!ast.Ellipsis`" -msgid "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:`90953`.)" +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " +"in :gh:`90953`.)" msgstr "" +"به جای آن از :class:`ast.Constant` استفاده کنید. (مشارکت‌شده توسط Serhiy " +"Storchaka در :gh:`90953`.)" msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -msgid "The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgid "" +"The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!" +"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` " +"and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed " +"in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" +"کلاس‌های پایشگر فرزند :class:`!asyncio.MultiLoopChildWatcher`، :class:`!" +"asyncio.FastChildWatcher`، :class:`!asyncio.AbstractChildWatcher` " +"و :class:`!asyncio.SafeChildWatcher` منسوخ شده‌اند و در پایتون 3.14 حذف " +"خواهند شد. (با مشارکت Kumar Aditya در :gh:`94597`.)" -msgid ":func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" -msgstr "" +msgid "" +":func:`!asyncio.set_child_watcher`, :func:`!" +"asyncio.get_child_watcher`, :meth:`!" +"asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" +"asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will " +"be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" +":func:`!asyncio.set_child_watcher`، :func:`!" +"asyncio.get_child_watcher`، :meth:`!" +"asyncio.AbstractEventLoopPolicy.set_child_watcher` و :meth:`!" +"asyncio.AbstractEventLoopPolicy.get_child_watcher` منسوخ شده‌اند و در پایتون " +"3.14 حذف خواهند شد. (مشارکت‌شده توسط کومار آدیتیا در :gh:`94597`.)" -msgid "The :meth:`~asyncio.get_event_loop` method of the default event loop policy now emits a :exc:`DeprecationWarning` if there is no current event loop set and it decides to create one. (Contributed by Serhiy Storchaka and Guido van Rossum in :gh:`100160`.)" +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido " +"van Rossum in :gh:`100160`.)" msgstr "" +"متد :meth:`~asyncio.get_event_loop` از سیاست پیش‌فرض حلقه رویداد، اکنون اگر " +"هیچ حلقه رویداد جاری‌ای تنظیم نشده باشد و تصمیم بگیرد یکی ایجاد " +"کند، :exc:`DeprecationWarning` منتشر می‌کند. (مشارکت‌شده توسط Serhiy " +"Storchaka و Guido van Rossum در :gh:`100160`.)" -msgid ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils.localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgid "" +":mod:`email`: Deprecated the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" +":mod:`email`: پارامتر *isdst* در :func:`email.utils.localtime` منسوخ شد. " +"(مشارکت‌شده توسط Alan Williams در :gh:`72346`.)" msgid ":mod:`importlib.abc` deprecated classes:" -msgstr "" +msgstr "کلاس‌های منسوخ :mod:`importlib.abc`:" msgid ":class:`!importlib.abc.ResourceReader`" -msgstr "" +msgstr ":class:`!importlib.abc.ResourceReader`" msgid ":class:`!importlib.abc.Traversable`" -msgstr "" +msgstr ":class:`!importlib.abc.Traversable`" msgid ":class:`!importlib.abc.TraversableResources`" -msgstr "" +msgstr ":class:`!importlib.abc.TraversableResources`" msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" +msgstr "به‌جای آن از کلاس‌های :mod:`importlib.resources.abc` استفاده کنید:" msgid ":class:`importlib.resources.abc.Traversable`" -msgstr "" +msgstr ":class:`importlib.resources.abc.Traversable`" msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr "" +msgstr ":class:`importlib.resources.abc.TraversableResources`" msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "" +msgstr "(با مشارکت Jason R. Coombs و Hugo van Kemenade در :gh:`93963`.)" -msgid ":mod:`itertools` had undocumented, inefficient, historically buggy, and inconsistent support for copy, deepcopy, and pickle operations. This will be removed in 3.14 for a significant reduction in code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will " +"be removed in 3.14 for a significant reduction in code volume and " +"maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" +":mod:`itertools` برای عملیات‌های کپی (copy)، کپی عمیق (deepcopy) و پیکل " +"پشتیبانی‌ای بدون مستندسازی، ناکارآمد، به لحاظ تاریخی پر از اشکال و ناسازگار " +"داشت. این پشتیبانی در نسخه 3.14 حذف خواهد شد تا حجم کد و بار نگهداری به‌طور " +"چشمگیری کاهش یابد. (مشارکت‌شده توسط Raymond Hettinger در :gh:`101588`.)" -msgid ":mod:`multiprocessing`: The default start method will change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). Adding a runtime warning about this was deemed too disruptive as the majority of code is not expected to care. Use the :func:`~multiprocessing.get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." -msgstr "" +msgid "" +":mod:`multiprocessing`: The default start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this " +"was deemed too disruptive as the majority of code is not expected to care. " +"Use the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify " +"when your code *requires* ``'fork'``. See :ref:`multiprocessing-start-" +"methods`." +msgstr "" +":mod:`multiprocessing`: روش شروع پیش‌فرض در Linux، BSD‌ها و سایر پلتفرم‌های " +"POSIX غیر از macOS که در حال حاضر ``'fork'`` پیش‌فرض آن‌هاست، به روشی ایمن‌تر " +"تغییر خواهد کرد (:gh:`84559`). افزودن هشداری در زمان اجرا درباره این موضوع " +"بیش از حد مخل تلقی شد، زیرا انتظار نمی‌رود اکثر کدها به آن اهمیتی بدهند. از " +"API‌های :func:`~multiprocessing.get_context` " +"یا :func:`~multiprocessing.set_start_method` استفاده کنید تا به‌صراحت مشخص " +"کنید که کد شما چه زمانی به ``'fork'`` *نیاز دارد*. " +"به :ref:`multiprocessing-start-methods` مراجعه کنید." -msgid ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is deprecated." +msgid "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " +"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " +"deprecated." msgstr "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " +"و :meth:`~pathlib.PurePath.relative_to`: گذراندن آرگومان‌های اضافی منسوخ شده " +"است." -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`.)" +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 "" +":mod:`pkgutil`: :func:`!pkgutil.find_loader` و :func:`!pkgutil.get_loader` " +"اکنون :exc:`DeprecationWarning` را ایجاد می‌کنند؛ به جای آن " +"از :func:`importlib.util.find_spec` استفاده کنید. (مشارکت‌شده توسط نیکیتا " +"سوبولف در :gh:`97850`.)" msgid ":mod:`pty`:" -msgstr "" +msgstr ":mod:`pty`:" msgid "``master_open()``: use :func:`pty.openpty`." -msgstr "" +msgstr "``master_open()``: از :func:`pty.openpty` استفاده کنید." msgid "``slave_open()``: use :func:`pty.openpty`." -msgstr "" +msgstr "``slave_open()``: از :func:`pty.openpty` استفاده کنید." msgid ":mod:`sqlite3`:" -msgstr "" +msgstr ":mod:`sqlite3`:" msgid ":data:`!version` and :data:`!version_info`." -msgstr "" +msgstr ":data:`!version` و :data:`!version_info`." -msgid ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:`dict`." +msgid "" +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " +"if :ref:`named placeholders ` are used and " +"*parameters* is a sequence instead of a :class:`dict`." msgstr "" +":meth:`~sqlite3.Cursor.execute` و :meth:`~sqlite3.Cursor.executemany` اگر " +"از :ref:`جای‌نگهدارهای نام‌دار ` استفاده شود و " +"*parameters* به‌جای :class:`dict` یک دنباله باشد." -msgid ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not intended to be a public API. (Contributed by Gregory P. Smith in :gh:`88168`.)" +msgid "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " +"intended to be a public API. (Contributed by Gregory P. Smith " +"in :gh:`88168`.)" msgstr "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` منسوخ شده است؛ این کلاس " +"به‌عنوان یک API عمومی در نظر گرفته نشده بود. (مشارکت‌شده توسط Gregory P. " +"Smith در :gh:`88168`.)" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 074e441a1..dc6da198f 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -22,88 +22,186 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in Python 3.15" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.15" msgid "The import system:" -msgstr "" +msgstr "سیستم ایمپورت:" -msgid "Setting :attr:`~module.__cached__` on a module while failing to set :attr:`__spec__.cached ` is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take into consideration by the import system or standard library. (:gh:`97879`)" +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set " +":attr:`__spec__.cached ` is " +"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take" +" into consideration by the import system or standard library. (:gh:`97879`)" msgstr "" +"تنظیم :attr:`~module.__cached__` روی یک ماژول در حالی که " +":attr:`__spec__.cached ` تنظیم نشده " +"باشد، منسوخ شده است. در پایتون 3.15، :attr:`!__cached__` دیگر توسط سیستم " +"ایمپورت یا کتابخانه استاندارد تنظیم نمی‌شود یا در نظر گرفته نمی‌شود. " +"(:gh:`97879`)" -msgid "Setting :attr:`~module.__package__` on a module while failing to set :attr:`__spec__.parent ` is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or take into consideration by the import system or standard library. (:gh:`97879`)" +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set " +":attr:`__spec__.parent ` is " +"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " +"take into consideration by the import system or standard library. " +"(:gh:`97879`)" msgstr "" +"تنظیم :attr:`~module.__package__` روی یک ماژول، بدون تنظیم " +":attr:`__spec__.parent `، منسوخ است. " +"در پایتون 3.15، :attr:`!__package__` دیگر توسط سیستم ایمپورت یا کتابخانه " +"استاندارد تنظیم نخواهد شد و در نظر گرفته نخواهد شد. (:gh:`97879`)" msgid ":mod:`ctypes`:" -msgstr "" +msgstr ":mod:`ctypes`:" -msgid "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated since Python 3.13." +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated" +" since Python 3.13." msgstr "" +"تابع مستندنشده‌ی :func:`!ctypes.SetPointerType` از پایتون 3.13 منسوخ شده " +"است." msgid ":mod:`http.server`:" -msgstr "" +msgstr ":mod:`http.server`:" -msgid "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has been deprecated since Python 3.13. No direct replacement exists. *Anything* is better than CGI to interface a web server with a request handler." +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has" +" been deprecated since Python 3.13. No direct replacement exists. *Anything*" +" is better than CGI to interface a web server with a request handler." msgstr "" +"کلاس منسوخ و به‌ندرت استفاده‌شده :class:`~http.server.CGIHTTPRequestHandler`" +" از پایتون 3.13 از رده خارج شده است. هیچ جایگزین مستقیمی وجود ندارد. برای " +"برقراری رابط بین وب‌سرور و هندلر درخواست، *هر چیزی* بهتر از CGI است." -msgid "The :option:`!--cgi` flag to the :program:`python -m http.server` command-line interface has been deprecated since Python 3.13." +msgid "" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." msgstr "" +"پرچم :option:`!--cgi` در رابط خط فرمان :program:`python -m http.server` از " +"پایتون 3.13 منسوخ شده است." msgid ":mod:`importlib`:" -msgstr "" +msgstr ":mod:`importlib`:" msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "" +msgstr "متد ``load_module()``: به‌جای آن از ``exec_module()`` استفاده کنید." msgid ":mod:`pathlib`:" -msgstr "" +msgstr ":mod:`pathlib`:" -msgid ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :func:`os.path.isreserved` to detect reserved paths on Windows." +msgid "" +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use " +":func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" +":meth:`.PurePath.is_reserved` از پایتون 3.13 منسوخ شده است. برای تشخیص " +"مسیرهای رزرو‌شده در ویندوز از :func:`os.path.isreserved` استفاده کنید." msgid ":mod:`platform`:" -msgstr "" +msgstr ":mod:`platform`:" -msgid ":func:`~platform.java_ver` has been deprecated since Python 3.13. This function is only useful for Jython support, has a confusing API, and is largely untested." +msgid "" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" +":func:`~platform.java_ver` از پایتون 3.13 منسوخ شده است. این تابع تنها برای " +"پشتیبانی از Jython مفید است، API گیج‌کننده‌ای دارد و عمدتاً آزمون‌نشده است." msgid ":mod:`sysconfig`:" -msgstr "" +msgstr ":mod:`sysconfig`:" -msgid "The *check_home* argument of :func:`sysconfig.is_python_build` has been deprecated since Python 3.12." +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." msgstr "" +"آرگومان *check_home* در :func:`sysconfig.is_python_build` از پایتون 3.12 " +"منسوخ شده است." msgid ":mod:`threading`:" -msgstr "" +msgstr ":mod:`threading`:" -msgid ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any arguments has been deprecated since Python 3.14, as the Python version does not permit any arguments, but the C version allows any number of positional or keyword arguments, ignoring every argument." +msgid "" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" +":func:`~threading.RLock` در پایتون 3.15 هیچ آرگومانی نخواهد پذیرفت. گذراندن " +"هر آرگومانی از پایتون 3.14 منسوخ شده است، زیرا نسخه‌ی پایتون اجازه‌ی هیچ " +"آرگومانی را نمی‌دهد، اما نسخه‌ی C هر تعداد آرگومان جایگاهی یا کلیدواژه‌ای را" +" می‌پذیرد و همه‌ی آرگومان‌ها را نادیده می‌گیرد." msgid ":mod:`types`:" -msgstr "" +msgstr ":mod:`types`:" -msgid ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" +":class:`types.CodeType`: دسترسی به :attr:`~codeobject.co_lnotab` در " +":pep:`626` از نسخه 3.10 منسوخ شد و قرار بود در 3.12 حذف شود، اما تنها در " +"3.12 یک :exc:`DeprecationWarning` مناسب دریافت کرد. ممکن است در 3.15 حذف " +"شود. (مشارکت‌شده توسط Nikita Sobolev در :gh:`101866`.)" msgid ":mod:`typing`:" -msgstr "" +msgstr ":mod:`typing`:" -msgid "The undocumented keyword argument syntax for creating :class:`~typing.NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python 3.13. Use the class-based syntax or the functional syntax instead." +msgid "" +"The undocumented keyword argument syntax for creating " +":class:`~typing.NamedTuple` classes (for example, ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " +"3.13. Use the class-based syntax or the functional syntax instead." msgstr "" +"سینتکس مستندنشده‌ی آرگومان کلیدواژه‌ای برای ایجاد کلاس‌های " +":class:`~typing.NamedTuple` (برای مثال، ``Point = NamedTuple(\"Point\", " +"x=int, y=int)``) از پایتون 3.13 منسوخ شده است. به جای آن از سینتکس مبتنی بر " +"کلاس یا سینتکس تابعی استفاده کنید." -msgid "When using the functional syntax of :class:`~typing.TypedDict`\\s, failing to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})`` to create a TypedDict with zero field." -msgstr "" +msgid "" +"When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " +"to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " +"passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated " +"since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = " +"TypedDict(\"TD\", {})`` to create a TypedDict with zero field." +msgstr "" +"هنگام استفاده از سینتکس تابعی :class:`~typing.TypedDict`\\s، عدم گذر دادن " +"مقدار به پارامتر *fields* (``TD = TypedDict(\"TD\")``) یا گذر دادن ``None`` " +"(``TD = TypedDict(\"TD\", None)``) از پایتون 3.13 منسوخ شده است. برای ایجاد " +"یک TypedDict بدون هیچ فیلدی، از ``class TD(TypedDict): pass`` یا ``TD = " +"TypedDict(\"TD\", {})`` استفاده کنید." -msgid "The :deco:`typing.no_type_check_decorator` decorator function has been deprecated since Python 3.13. After eight years in the :mod:`typing` module, it has yet to be supported by any major type checker." +msgid "" +"The :deco:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module," +" it has yet to be supported by any major type checker." msgstr "" +"تابع دکوراتور :deco:`typing.no_type_check_decorator` از پایتون 3.13 منسوخ " +"شده است. پس از هشت سال حضور در ماژول :mod:`typing`، هنوز توسط هیچ بررسی‌گر " +"نوع بزرگی پشتیبانی نشده است." msgid ":mod:`wave`:" -msgstr "" +msgstr ":mod:`wave`:" -msgid "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been deprecated since Python 3.13." +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and " +":meth:`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` " +"and :class:`~wave.Wave_write` classes have been deprecated since Python " +"3.13." msgstr "" +"متد‌های :meth:`~wave.Wave_read.getmark`، :meth:`!setmark` و " +":meth:`~wave.Wave_read.getmarkers` در کلاس‌های :class:`~wave.Wave_read` و " +":class:`~wave.Wave_write` از پایتون 3.13 منسوخ شده‌اند." msgid ":mod:`zipimport`:" -msgstr "" +msgstr ":mod:`zipimport`:" -msgid ":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed by Jiahao Li in :gh:`125746`.)" +msgid "" +":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " +"3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " +"by Jiahao Li in :gh:`125746`.)" msgstr "" +":meth:`~zipimport.zipimporter.load_module` از پایتون 3.10 منسوخ شده است. به " +"جای آن از :meth:`~zipimport.zipimporter.exec_module` استفاده کنید. " +"(مشارکت‌شده توسط Jiahao Li در :gh:`125746`.)" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index ba1dd7272..82bc66a8d 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -22,52 +22,83 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in Python 3.16" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.16" msgid "The import system:" -msgstr "" +msgstr "سیستم ایمپورت:" -msgid "Setting :attr:`~module.__loader__` on a module while failing to set :attr:`__spec__.loader ` is deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or taken into consideration by the import system or the standard library." +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set " +":attr:`__spec__.loader ` is " +"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " +"taken into consideration by the import system or the standard library." msgstr "" +"تنظیم :attr:`~module.__loader__` روی یک ماژول بدون آنکه " +":attr:`__spec__.loader ` تنظیم شود، " +"منسوخ شده است. در پایتون 3.16، :attr:`!__loader__` دیگر توسط سیستم ایمپورت " +"یا کتابخانه استاندارد تنظیم یا در نظر گرفته نخواهد شد." msgid ":mod:`array`:" -msgstr "" +msgstr ":mod:`array`:" -msgid "The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in documentation since Python 3.3 and at runtime since Python 3.13. Use the ``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." msgstr "" +"کد قالب ``'u'`` (:c:type:`wchar_t`) از پایتون 3.3 در مستندات و از پایتون " +"3.13 در ران‌تایم منسوخ شده است. به جای آن، از کد قالب ``'w'`` " +"(:c:type:`Py_UCS4`) برای نویسه‌های یونیکد استفاده کنید." msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -msgid ":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" +":func:`!asyncio.iscoroutinefunction` منسوخ شده است و در پایتون 3.16 حذف " +"خواهد شد؛ به جای آن از :func:`inspect.iscoroutinefunction` استفاده کنید. " +"(مشارکت‌شده توسط Jiahao Li و Kumar Aditya در :gh:`122875`.)" -msgid ":mod:`asyncio` policy system is deprecated and will be removed in Python 3.16. In particular, the following classes and functions are deprecated:" +msgid "" +":mod:`asyncio` policy system is deprecated and will be removed in Python " +"3.16. In particular, the following classes and functions are deprecated:" msgstr "" +"سیستم سیاست‌های :mod:`asyncio` منسوخ شده است و در پایتون 3.16 حذف خواهد شد. " +"به‌طور خاص، کلاس‌ها و توابع زیر منسوخ شده‌اند:" msgid ":class:`asyncio.AbstractEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.AbstractEventLoopPolicy`" msgid ":class:`asyncio.DefaultEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.DefaultEventLoopPolicy`" msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" -msgstr "" +msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgid ":func:`asyncio.get_event_loop_policy`" -msgstr "" +msgstr ":func:`asyncio.get_event_loop_policy`" msgid ":func:`asyncio.set_event_loop_policy`" -msgstr "" +msgstr ":func:`asyncio.set_event_loop_policy`" -msgid "Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with *loop_factory* to use the desired event loop implementation." +msgid "" +"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " +"*loop_factory* to use the desired event loop implementation." msgstr "" +"کاربران باید برای استفاده از پیاده‌سازی حلقه رویداد دلخواه، از " +":func:`asyncio.run` یا :class:`asyncio.Runner` همراه با *loop_factory* " +"استفاده کنند." msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" msgstr "" +"به عنوان مثال، برای استفاده از :class:`asyncio.SelectorEventLoop` در " +"ویندوز::" msgid "" "import asyncio\n" @@ -77,60 +108,120 @@ msgid "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" ...\n" +"\n" +"asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" -msgstr "" +msgstr "(مشارکت‌شده توسط Kumar Aditya در :gh:`127949`.)" msgid ":mod:`builtins`:" -msgstr "" +msgstr ":mod:`builtins`:" -msgid "Bitwise inversion on boolean types, ``~True`` or ``~False`` has been deprecated since Python 3.12, as it produces surprising and unintuitive results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation of a Boolean. In the rare case that you need the bitwise inversion of the underlying integer, convert to ``int`` explicitly (``~int(x)``)." -msgstr "" +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" +"وارونگی بیتی روی نوع‌های بولی، ``~True`` یا ``~False``، از پایتون 3.12 منسوخ" +" شده است، زیرا نتایج شگفت‌آور و غیرشهودی تولید می‌کند (``-2`` و ``-1``). " +"برای نقیض منطقی یک مقدار بولی، به جای آن از ``not x`` استفاده کنید. در موارد" +" نادر که به وارونگی بیتی عدد صحیح زیرین نیاز دارید، آن را به‌طور صریح به " +"``int`` تبدیل کنید (``~int(x)``)." msgid ":mod:`functools`:" -msgstr "" +msgstr ":mod:`functools`:" -msgid "Calling the Python implementation of :func:`functools.reduce` with *function* or *sequence* as keyword arguments has been deprecated since Python 3.14." +msgid "" +"Calling the Python implementation of :func:`functools.reduce` with " +"*function* or *sequence* as keyword arguments has been deprecated since " +"Python 3.14." msgstr "" +"فراخوانی پیاده‌سازی پایتونی :func:`functools.reduce` با آرگومان‌های " +"کلیدواژه‌ای *function* یا *sequence* از پایتون 3.14 منسوخ شده است." msgid ":mod:`logging`:" -msgstr "" +msgstr ":mod:`logging`:" -msgid "Support for custom logging handlers with the *strm* argument is deprecated and scheduled for removal in Python 3.16. Define handlers with the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" +msgid "" +"Support for custom logging handlers with the *strm* argument is deprecated " +"and scheduled for removal in Python 3.16. Define handlers with the *stream* " +"argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" msgstr "" +"پشتیبانی از هندلر‌های سفارشی گزارش‌گیری با آرگومان *strm* منسوخ شده و قرار " +"است در Python 3.16 حذف شود. به‌جای آن، هندلر‌ها را با آرگومان *stream* تعریف" +" کنید. (مشارکت Mariusz Felisiak در :gh:`115032`.)" msgid ":mod:`mimetypes`:" -msgstr "" +msgstr ":mod:`mimetypes`:" -msgid "Valid extensions start with a '.' or are empty for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:`75223`.)" +msgid "" +"Valid extensions start with a '.' or are empty for " +":meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and" +" will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " +"Kemenade in :gh:`75223`.)" msgstr "" +"پسوندهای معتبر برای :meth:`mimetypes.MimeTypes.add_type` با '.' شروع می‌شوند" +" یا خالی هستند. پسوندهای بدون نقطه منسوخ شده‌اند و در پایتون 3.16 باعث ایجاد" +" یک :exc:`ValueError` خواهند شد. (مشارکت‌شده توسط Hugo van Kemenade در " +":gh:`75223`.)" msgid ":mod:`shutil`:" -msgstr "" +msgstr ":mod:`shutil`:" -msgid "The :class:`!ExecError` exception has been deprecated since Python 3.14. It has not been used by any function in :mod:`!shutil` since Python 3.4, and is now an alias of :exc:`RuntimeError`." +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is" +" now an alias of :exc:`RuntimeError`." msgstr "" +"استثنای :class:`!ExecError` از پایتون 3.14 منسوخ شده است. این استثنا از " +"پایتون 3.4 توسط هیچ تابعی در :mod:`!shutil` استفاده نشده است و اکنون مستعاری" +" برای :exc:`RuntimeError` است." msgid ":mod:`symtable`:" -msgstr "" +msgstr ":mod:`symtable`:" -msgid "The :meth:`Class.get_methods ` method has been deprecated since Python 3.14." +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." msgstr "" +"متد :meth:`Class.get_methods ` از پایتون 3.14 " +"منسوخ شده است." msgid ":mod:`sys`:" -msgstr "" +msgstr ":mod:`sys`:" -msgid "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead." +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated" +" since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." msgstr "" +"تابع :func:`~sys._enablelegacywindowsfsencoding` از پایتون 3.13 منسوخ شده " +"است. به جای آن از متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"استفاده کنید." msgid ":mod:`sysconfig`:" -msgstr "" +msgstr ":mod:`sysconfig`:" -msgid "The :func:`!sysconfig.expand_makefile_vars` function has been deprecated since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` instead." +msgid "" +"The :func:`!sysconfig.expand_makefile_vars` function has been deprecated " +"since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` " +"instead." msgstr "" +"تابع :func:`!sysconfig.expand_makefile_vars` از پایتون 3.14 منسوخ شده است. " +"به جای آن از آرگومان ``vars`` تابع :func:`sysconfig.get_paths` استفاده کنید." msgid ":mod:`tarfile`:" -msgstr "" +msgstr ":mod:`tarfile`:" -msgid "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been deprecated since Python 3.13." +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" +"ویژگی مستندنشده و استفاده‌نشده‌ی :attr:`!TarFile.tarfile` از پایتون 3.13 " +"منسوخ شده است." diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po index 41cfa5b08..52ec605ed 100644 --- a/deprecations/pending-removal-in-3.17.po +++ b/deprecations/pending-removal-in-3.17.po @@ -20,28 +20,74 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pending removal in Python 3.17" -msgstr "" +msgstr "در انتظار حذف در پایتون 3.17" msgid ":mod:`collections.abc`:" -msgstr "" +msgstr ":mod:`collections.abc`:" -msgid ":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." -msgstr "" +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgstr ":class:`collections.abc.ByteString` قرار است در Python 3.17 حذف شود." -msgid "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` implements the :ref:`buffer protocol ` at runtime. For use in type annotations, either use :class:`~collections.abc.Buffer` or a union that explicitly specifies the types your code supports (e.g., ``bytes | bytearray | memoryview``)." +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in" +" type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." msgstr "" +"برای آزمودن اینکه آیا ``obj`` :ref:`پروتکل بافر ` را در زمان " +"اجرا پیاده‌سازی می‌کند، از ``isinstance(obj, collections.abc.Buffer)`` " +"استفاده کنید. برای استفاده در حاشیه‌نویسی‌های نوع، یا از " +":class:`~collections.abc.Buffer` استفاده کنید یا از یک اجتماع (union) که " +"به‌طور صریح انواعی را که کد شما از آن‌ها پشتیبانی می‌کند مشخص می‌کند (مثلاً " +"``bytes | bytearray | memoryview``)." -msgid ":class:`!ByteString` was originally intended to be an abstract class that would serve as a supertype of both :class:`bytes` and :class:`bytearray`. However, since the ABC never had any methods, knowing that an object was an instance of :class:`!ByteString` never actually told you anything useful about the object. Other common buffer types such as :class:`memoryview` were also never understood as subtypes of :class:`!ByteString` (either at runtime or by static type checkers)." +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were" +" also never understood as subtypes of :class:`!ByteString` (either at " +"runtime or by static type checkers)." msgstr "" +":class:`!ByteString` در اصل قرار بود کلاسی انتزاعی باشد که به‌عنوان ابرنوع " +"(supertype) برای هر دو :class:`bytes` و :class:`bytearray` عمل کند. با این " +"حال، از آنجا که این کلاس پایه انتزاعی هرگز هیچ متدی نداشت، دانستن اینکه شیئی" +" نمونه‌ای از :class:`!ByteString` است، هرگز در واقع هیچ چیز مفیدی درباره‌ی " +"آن شیء به شما نمی‌گفت. سایر نوع‌های بافر رایج مانند :class:`memoryview` نیز " +"هرگز به‌عنوان زیرنوع‌هایی از :class:`!ByteString` در نظر گرفته نمی‌شدند (نه " +"در زمان اجرا و نه توسط بررسی‌گرهای نوع ایستا)." -msgid "See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" msgstr "" +"برای جزئیات بیشتر به :pep:`PEP 688 <688#current-options>` مراجعه کنید. " +"(مشارکت‌شده توسط شانتانو جین در :gh:`91896`.)" msgid ":mod:`typing`:" -msgstr "" +msgstr ":mod:`typing`:" -msgid "Before Python 3.14, old-style unions were implemented using the private class ``typing._UnionGenericAlias``. This class is no longer needed for the implementation, but it has been retained for backward compatibility, with removal scheduled for Python 3.17. Users should use documented introspection helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead of relying on private implementation details." +msgid "" +"Before Python 3.14, old-style unions were implemented using the private " +"class ``typing._UnionGenericAlias``. This class is no longer needed for the " +"implementation, but it has been retained for backward compatibility, with " +"removal scheduled for Python 3.17. Users should use documented introspection" +" helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead " +"of relying on private implementation details." msgstr "" +"پیش از پایتون 3.14، یونیون‌های سبک قدیمی (old-style unions) با استفاده از " +"کلاس خصوصی ``typing._UnionGenericAlias`` پیاده‌سازی می‌شدند. این کلاس دیگر " +"برای پیاده‌سازی مورد نیاز نیست، اما برای سازگاری با نسخه‌های قبلی حفظ شده " +"است و حذف آن برای پایتون 3.17 برنامه‌ریزی شده است. کاربران باید به‌جای تکیه " +"بر جزئیات پیاده‌سازی خصوصی، از ابزارهای کمکی مستند درون‌کاوی (introspection)" +" مانند :func:`typing.get_origin` و :func:`typing.get_args` استفاده کنند." -msgid ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for removal in Python 3.17." +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17." msgstr "" +":class:`typing.ByteString` که از پایتون 3.9 منسوخ شده است، برای حذف در " +"پایتون 3.17 برنامه‌ریزی شده است." diff --git a/deprecations/pending-removal-in-3.18.po b/deprecations/pending-removal-in-3.18.po index b2f32bdea..436e7d9ca 100644 --- a/deprecations/pending-removal-in-3.18.po +++ b/deprecations/pending-removal-in-3.18.po @@ -20,10 +20,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pending removal in Python 3.18" -msgstr "" +msgstr "در انتظار حذف در Python 3.18" msgid ":mod:`decimal`:" -msgstr "" +msgstr ":mod:`decimal`:" -msgid "The non-standard and undocumented :class:`~decimal.Decimal` format specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C implementation, has been deprecated since Python 3.13. (Contributed by Serhiy Storchaka in :gh:`89902`.)" +msgid "" +"The non-standard and undocumented :class:`~decimal.Decimal` format specifier" +" ``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation, has been deprecated since Python 3.13. (Contributed by " +"Serhiy Storchaka in :gh:`89902`.)" msgstr "" +"مشخص‌کننده قالب ``'N'`` در :class:`~decimal.Decimal`، که غیراستاندارد و " +"مستندسازی‌نشده است و تنها در پیاده‌سازی C ماژول :mod:`!decimal` پشتیبانی " +"می‌شود، از پایتون 3.13 منسوخ شده است. (مشارکت‌شده توسط Serhiy Storchaka در " +":gh:`89902`.)" diff --git a/deprecations/pending-removal-in-3.19.po b/deprecations/pending-removal-in-3.19.po index 47a1313ad..1c95147e2 100644 --- a/deprecations/pending-removal-in-3.19.po +++ b/deprecations/pending-removal-in-3.19.po @@ -20,10 +20,16 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Pending removal in Python 3.19" -msgstr "" +msgstr "در پایتون 3.19 در انتظار حذف است" msgid ":mod:`ctypes`:" -msgstr "" +msgstr ":mod:`ctypes`:" -msgid "Implicitly switching to the MSVC-compatible struct layout by setting :attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-Windows platforms." +msgid "" +"Implicitly switching to the MSVC-compatible struct layout by setting " +":attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` " +"on non-Windows platforms." msgstr "" +"تغییر ضمنی به چیدمان ساختار سازگار با MSVC از طریق تنظیم " +":attr:`~ctypes.Structure._pack_` اما بدون تنظیم " +":attr:`~ctypes.Structure._layout_` در پلتفرم‌های غیر ویندوزی." diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index c86589a0f..98698cace 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -22,211 +22,383 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Pending removal in future versions" -msgstr "" +msgstr "در نسخه‌های آینده در انتظار حذف است" -msgid "The following APIs will be removed in the future, although there is currently no date scheduled for their removal." +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." msgstr "" +"APIهای زیر در آینده حذف خواهند شد، هرچند در حال حاضر هیچ تاریخی برای حذف " +"آن‌ها تعیین نشده است." msgid ":mod:`argparse`:" -msgstr "" +msgstr ":mod:`argparse`:" -msgid "Nesting argument groups and nesting mutually exclusive groups are deprecated." +msgid "" +"Nesting argument groups and nesting mutually exclusive groups are " +"deprecated." msgstr "" +"تودرتو کردن گروه‌های آرگومان و تودرتو کردن گروه‌های متقابلاً انحصاری منسوخ " +"شده‌اند." -msgid "Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +msgid "" +"Passing the undocumented keyword argument *prefix_chars* to " +":meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." msgstr "" +"گذراندن آرگومان کلیدواژه‌ای مستندنشده *prefix_chars* به " +":meth:`~argparse.ArgumentParser.add_argument_group` اکنون منسوخ شده است." msgid "The :class:`argparse.FileType` type converter is deprecated." -msgstr "" +msgstr "مبدل نوع :class:`argparse.FileType` منسوخ شده است." msgid ":mod:`builtins`:" -msgstr "" +msgstr ":mod:`builtins`:" -msgid "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single argument signature." +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature" +" is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." msgstr "" +"تولیدگرها: امضای ``throw(type, exc, tb)`` و ``athrow(type, exc, tb)`` منسوخ " +"شده است: به‌جای آن از ``throw(exc)`` و ``athrow(exc)`` استفاده کنید؛ یعنی " +"امضای تک‌آرگومانی." -msgid "Currently Python accepts numeric literals immediately followed by keywords, for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as ``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised if the numeric literal is immediately followed by one of keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` and :keyword:`or`. In a future release it will be changed to a syntax error. (:gh:`87999`)" -msgstr "" +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords " +":keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, " +":keyword:`in`, :keyword:`is` and :keyword:`or`. In a future release it will" +" be changed to a syntax error. (:gh:`87999`)" +msgstr "" +"در حال حاضر پایتون مقادیر لفظی عددی را می‌پذیرد که بلافاصله پس از آن‌ها " +"کلیدواژه‌ای می‌آید، برای مثال ``0in x``، ``1or x``، ``0if 1else 2``. این " +"اجازه می‌دهد عبارت‌های گیج‌کننده و مبهمی مانند ``[0x1for x in y]`` وجود " +"داشته باشند (که می‌توان آن را به صورت ``[0x1 for x in y]`` یا ``[0x1f or x " +"in y]`` تفسیر کرد). اگر بلافاصله پس از مقدار لفظی عددی یکی از کلیدواژه‌های " +":keyword:`and`، :keyword:`else`، :keyword:`for`، :keyword:`if`، " +":keyword:`in`، :keyword:`is` و :keyword:`or` قرار گیرد، هشدار سینتکس صادر " +"می‌شود. در نسخه‌ای در آینده، این مورد به خطای سینتکس تغییر خواهد یافت. " +"(:gh:`87999`)" -msgid "Support for ``__index__()`` and ``__int__()`` method returning non-int type: these methods will be required to return an instance of a strict subclass of :class:`int`." +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type:" +" these methods will be required to return an instance of a strict subclass " +"of :class:`int`." msgstr "" +"پشتیبانی از متدهای ``__index__()`` و ``__int__()`` که نوعی غیر از int " +"برمی‌گردانند: این متدها ملزم خواهند شد که نمونه‌ای از یک زیرکلاس اکید " +":class:`int` را برگردانند." -msgid "Support for ``__float__()`` method returning a strict subclass of :class:`float`: these methods will be required to return an instance of :class:`float`." +msgid "" +"Support for ``__float__()`` method returning a strict subclass of " +":class:`float`: these methods will be required to return an instance of " +":class:`float`." msgstr "" +"پشتیبانی از متد ``__float__()`` که زیرکلاس محضی از :class:`float` را " +"برمی‌گرداند: این متدها ملزم خواهند شد که نمونه‌ای از :class:`float` را " +"برگردانند." -msgid "Support for ``__complex__()`` method returning a strict subclass of :class:`complex`: these methods will be required to return an instance of :class:`complex`." +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of " +":class:`complex`: these methods will be required to return an instance of " +":class:`complex`." msgstr "" +"پشتیبانی از متد ``__complex__()`` که زیرکلاس اکیدی از :class:`complex` را " +"برمی‌گرداند: این متدها ملزم خواهند شد که نمونه‌ای از :class:`complex` را " +"برگردانند." -msgid "Passing a complex number as the *real* or *imag* argument in the :func:`complex` constructor is now deprecated; it should only be passed as a single positional argument. (Contributed by Serhiy Storchaka in :gh:`109218`.)" +msgid "" +"Passing a complex number as the *real* or *imag* argument in the " +":func:`complex` constructor is now deprecated; it should only be passed as a" +" single positional argument. (Contributed by Serhiy Storchaka in " +":gh:`109218`.)" msgstr "" +"ارسال یک عدد مختلط به‌عنوان آرگومان *real* یا *imag* در سازنده‌ی " +":func:`complex` اکنون منسوخ شده است؛ این عدد باید فقط به‌صورت یک آرگومان " +"جایگاهی منفرد ارسال شود. (مشارکت‌شده توسط Serhiy Storchaka در :gh:`109218`.)" -msgid ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and " +":data:`calendar.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" +":mod:`calendar`: ثابت‌های ``calendar.January`` و ``calendar.February`` منسوخ" +" شده‌اند و توسط :data:`calendar.JANUARY` و :data:`calendar.FEBRUARY` جایگزین" +" شده‌اند. (مشارکت‌شده توسط Prince Roshan در :gh:`103636`.)" -msgid ":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:`133038`)" +msgid "" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " +"(:gh:`133038`)" msgstr "" +":mod:`codecs`: به جای :func:`codecs.open` از :func:`open` استفاده کنید. " +"(:gh:`133038`)" -msgid ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method instead." +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." msgstr "" +":attr:`codeobject.co_lnotab`: به‌جای آن از متد :meth:`codeobject.co_lines` " +"استفاده کنید." msgid ":mod:`datetime`:" -msgstr "" +msgstr ":mod:`datetime`:" -msgid ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime.UTC)``." +msgid "" +":meth:`~datetime.datetime.utcnow`: use " +"``datetime.datetime.now(tz=datetime.UTC)``." msgstr "" +":meth:`~datetime.datetime.utcnow`: از " +"``datetime.datetime.now(tz=datetime.UTC)`` استفاده کنید." -msgid ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" +":meth:`~datetime.datetime.utcfromtimestamp`: از " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)`` استفاده " +"کنید." msgid ":mod:`gettext`: Plural value must be an integer." -msgstr "" +msgstr ":mod:`gettext`: مقدار جمع باید یک عدد صحیح باشد." msgid ":mod:`importlib`:" -msgstr "" +msgstr ":mod:`importlib`:" -msgid ":func:`~importlib.util.cache_from_source` *debug_override* parameter is deprecated: use the *optimization* parameter instead." +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." msgstr "" +"پارامتر *debug_override* در :func:`~importlib.util.cache_from_source` منسوخ " +"شده است: به جای آن از پارامتر *optimization* استفاده کنید." msgid ":mod:`importlib.metadata`:" -msgstr "" +msgstr ":mod:`importlib.metadata`:" msgid "``EntryPoints`` tuple interface." -msgstr "" +msgstr "رابط تاپلی ``EntryPoints``." msgid "Implicit ``None`` on return values." -msgstr "" +msgstr "``None`` ضمنی در مقادیر بازگشتی." -msgid ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, use :meth:`~logging.warning` instead." +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`: متد ``warn()`` از پایتون 3.3 منسوخ شده است؛ به‌جای آن از " +":meth:`~logging.warning` استفاده کنید." -msgid ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use BytesIO and binary mode instead." +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." msgstr "" +":mod:`mailbox`: استفاده از ورودی StringIO و حالت متنی منسوخ شده است؛ به‌جای " +"آن از BytesIO و حالت دودویی استفاده کنید." -msgid ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." -msgstr "" +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr ":mod:`os`: فراخوانی :func:`os.register_at_fork` در فرایند چندنخی." -msgid ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is deprecated, use an exception instance." +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is" +" deprecated, use an exception instance." msgstr "" +":class:`!pydoc.ErrorDuringImport`: مقدار تاپل برای پارامتر *exc_info* منسوخ " +"شده است؛ از یک نمونه‌ی استثنا استفاده کنید." -msgid ":mod:`re`: More strict rules are now applied for numerical group references and group names in regular expressions. Only sequence of ASCII digits is now accepted as a numerical reference. The group name in bytes patterns and replacement strings can now only contain ASCII letters and digits and underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" -msgstr "" +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and" +" replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" +":mod:`re`: اکنون قواعد سخت‌گیرانه‌تری برای ارجاع‌های عددی به گروه‌ها و نام " +"گروه‌ها در عبارت‌های باقاعده اعمال می‌شود. اکنون فقط دنباله‌ای از ارقام اسکی" +" به‌عنوان ارجاع عددی پذیرفته می‌شود. نام گروه در الگوهای بایتی و رشته‌های " +"جایگزین اکنون فقط می‌تواند شامل حروف و ارقام اسکی و زیرخط باشد. (مشارکت‌شده " +"توسط Serhiy Storchaka در :gh:`91760`.)" -msgid ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr "" +"ماژول‌های :mod:`!sre_compile`، :mod:`!sre_constants` و :mod:`!sre_parse`." -msgid ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in Python 3.12; use the *onexc* parameter instead." +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in" +" Python 3.12; use the *onexc* parameter instead." msgstr "" +":mod:`shutil`: پارامتر *onerror* تابع :func:`~shutil.rmtree` در پایتون 3.12 " +"منسوخ شده است؛ به جای آن از پارامتر *onexc* استفاده کنید." msgid ":mod:`ssl` options and protocols:" -msgstr "" +msgstr "گزینه‌ها و پروتکل‌های :mod:`ssl`:" msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." -msgstr "" +msgstr ":class:`ssl.SSLContext` بدون آرگومان پروتکل منسوخ شده است." -msgid ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and " +":meth:`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` و " +":meth:`!selected_npn_protocol` منسوخ شده‌اند: به‌جای آن‌ها از ALPN استفاده " +"کنید." msgid "``ssl.OP_NO_SSL*`` options" -msgstr "" +msgstr "گزینه‌های ``ssl.OP_NO_SSL*``" msgid "``ssl.OP_NO_TLS*`` options" -msgstr "" +msgstr "گزینه‌های ``ssl.OP_NO_TLS*``" msgid "``ssl.PROTOCOL_SSLv3``" -msgstr "" +msgstr "``ssl.PROTOCOL_SSLv3``" msgid "``ssl.PROTOCOL_TLS``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLS``" msgid "``ssl.PROTOCOL_TLSv1``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1``" msgid "``ssl.PROTOCOL_TLSv1_1``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1_1``" msgid "``ssl.PROTOCOL_TLSv1_2``" -msgstr "" +msgstr "``ssl.PROTOCOL_TLSv1_2``" msgid "``ssl.TLSVersion.SSLv3``" -msgstr "" +msgstr "``ssl.TLSVersion.SSLv3``" msgid "``ssl.TLSVersion.TLSv1``" -msgstr "" +msgstr "``ssl.TLSVersion.TLSv1``" msgid "``ssl.TLSVersion.TLSv1_1``" -msgstr "" +msgstr "``ssl.TLSVersion.TLSv1_1``" msgid ":mod:`threading` methods:" -msgstr "" +msgstr "متدهای :mod:`threading`:" -msgid ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition.notify_all`." +msgid "" +":meth:`!threading.Condition.notifyAll`: use " +":meth:`~threading.Condition.notify_all`." msgstr "" +":meth:`!threading.Condition.notifyAll`: از " +":meth:`~threading.Condition.notify_all` استفاده کنید." msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" +":meth:`!threading.Event.isSet`: از :meth:`~threading.Event.is_set` استفاده " +"کنید." -msgid ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :attr:`threading.Thread.daemon` attribute." +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use " +":attr:`threading.Thread.daemon` attribute." msgstr "" +":meth:`!threading.Thread.isDaemon`، :meth:`threading.Thread.setDaemon`: از " +"ویژگی :attr:`threading.Thread.daemon` استفاده کنید." -msgid ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :attr:`threading.Thread.name` attribute." +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use " +":attr:`threading.Thread.name` attribute." msgstr "" +":meth:`!threading.Thread.getName`، :meth:`threading.Thread.setName`: از " +"ویژگی :attr:`threading.Thread.name` استفاده کنید." -msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgid "" +":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" +":meth:`!threading.currentThread`: از :meth:`threading.current_thread` " +"استفاده کنید." msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" +":meth:`!threading.activeCount`: از :meth:`threading.active_count` استفاده " +"کنید." msgid ":class:`typing.Text` (:gh:`92332`)." -msgstr "" +msgstr ":class:`typing.Text` (:gh:`92332`)." -msgid "The internal class ``typing._UnionGenericAlias`` is no longer used to implement :class:`typing.Union`. To preserve compatibility with users using this private class, a compatibility shim will be provided until at least Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" +msgid "" +"The internal class ``typing._UnionGenericAlias`` is no longer used to " +"implement :class:`typing.Union`. To preserve compatibility with users using " +"this private class, a compatibility shim will be provided until at least " +"Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" +"کلاس داخلی ``typing._UnionGenericAlias`` دیگر برای پیاده‌سازی " +":class:`typing.Union` استفاده نمی‌شود. برای حفظ سازگاری با کاربرانی که از " +"این کلاس خصوصی استفاده می‌کنند، یک شیم سازگاری (compatibility shim) حداقل تا" +" پایتون 3.17 ارائه خواهد شد. (مشارکت‌شده توسط Jelle Zijlstra در " +":gh:`105499`.)" -msgid ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a value that is not ``None`` from a test case." +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." msgstr "" +":class:`unittest.IsolatedAsyncioTestCase`: برگرداندن مقداری غیر از ``None`` " +"از یک مورد آزمون منسوخ شده است." -msgid ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` instead" +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" msgstr "" +"توابع منسوخ :mod:`urllib.parse`: به‌جای آن‌ها :func:`~urllib.parse.urlparse`" msgid "``splitattr()``" -msgstr "" +msgstr "``splitattr()``" msgid "``splithost()``" -msgstr "" +msgstr "``splithost()``" msgid "``splitnport()``" -msgstr "" +msgstr "``splitnport()``" msgid "``splitpasswd()``" -msgstr "" +msgstr "``splitpasswd()``" msgid "``splitport()``" -msgstr "" +msgstr "``splitport()``" msgid "``splitquery()``" -msgstr "" +msgstr "``splitquery()``" msgid "``splittag()``" -msgstr "" +msgstr "``splittag()``" msgid "``splittype()``" -msgstr "" +msgstr "``splittype()``" msgid "``splituser()``" -msgstr "" +msgstr "``splituser()``" msgid "``splitvalue()``" -msgstr "" +msgstr "``splitvalue()``" msgid "``to_bytes()``" -msgstr "" +msgstr "``to_bytes()``" -msgid ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial writes." +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." msgstr "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` نباید نوشتن جزئی (partial " +"write) انجام دهد." -msgid ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it will always return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests instead." +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an " +":class:`~xml.etree.ElementTree.Element` is deprecated. In a future release " +"it will always return ``True``. Prefer explicit ``len(elem)`` or ``elem is " +"not None`` tests instead." msgstr "" +":mod:`xml.etree.ElementTree`: آزمودن ارزش درستی یک " +":class:`~xml.etree.ElementTree.Element` منسوخ شده است. در یک نسخه‌ی آینده، " +"این آزمون همیشه ``True`` بازخواهد گرداند. به جای آن، آزمون‌های صریح " +"``len(elem)`` یا ``elem is not None`` را ترجیح دهید." -msgid ":func:`sys._clear_type_cache` is deprecated: use :func:`sys._clear_internal_caches` instead." +msgid "" +":func:`sys._clear_type_cache` is deprecated: use " +":func:`sys._clear_internal_caches` instead." msgstr "" +":func:`sys._clear_type_cache` منسوخ شده است: به جای آن از " +":func:`sys._clear_internal_caches` استفاده کنید." diff --git a/distributing/index.po b/distributing/index.po index 96d2c1604..de7f4142f 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -24,7 +24,12 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Distributing Python Modules" -msgstr "" +msgstr "توزیع ماژول‌های پایتون" -msgid "Information and guidance on distributing Python modules and packages has been moved to the `Python Packaging User Guide`_, and the tutorial on `packaging Python projects`_." +msgid "" +"Information and guidance on distributing Python modules and packages has " +"been moved to the `Python Packaging User Guide`_, and the tutorial on " +"`packaging Python projects`_." msgstr "" +"اطلاعات و راهنمایی درباره‌ی توزیع ماژول‌ها و بسته‌های پایتون به `Python " +"Packaging User Guide`_ و آموزشِ `packaging Python projects`_ منتقل شده است." diff --git a/extending/building.po b/extending/building.po index 76cd9c2ec..88c6ed4ca 100644 --- a/extending/building.po +++ b/extending/building.po @@ -22,19 +22,36 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Building C and C++ Extensions" -msgstr "" +msgstr "ساخت توسعه‌های C و C++" -msgid "A C extension for CPython is a shared library (for example, a ``.so`` file on Linux, ``.pyd`` on Windows), which exports an *initialization function*." +msgid "" +"A C extension for CPython is a shared library (for example, a ``.so`` file " +"on Linux, ``.pyd`` on Windows), which exports an *initialization function*." msgstr "" +"افزونه C برای سی‌پایتون یک کتابخانه اشتراکی است (برای مثال، یک پرونده " +"``.so`` در لینوکس و ``.pyd`` در ویندوز) که یک *تابع مقداردهی اولیه* را صادر " +"می‌کند." msgid "See :ref:`extension-modules` for details." -msgstr "" +msgstr "برای جزئیات به :ref:`extension-modules` مراجعه کنید." msgid "Building C and C++ Extensions with setuptools" -msgstr "" +msgstr "ساخت توسعه‌های C و C++ با setuptools" -msgid "Building, packaging and distributing extension modules is best done with third-party tools, and is out of scope of this document. One suitable tool is Setuptools, whose documentation can be found at https://setuptools.pypa.io/en/latest/setuptools.html." +msgid "" +"Building, packaging and distributing extension modules is best done with " +"third-party tools, and is out of scope of this document. One suitable tool " +"is Setuptools, whose documentation can be found at " +"https://setuptools.pypa.io/en/latest/setuptools.html." msgstr "" +"بهترین روش برای ساخت، بسته‌بندی و توزیع ماژول‌های توسعه‌ای، استفاده از " +"ابزارهای شخص ثالث است و این موضوع خارج از محدوده‌ی این سند است. یکی از " +"ابزارهای مناسب، Setuptools است که می‌توانید مستندات آن را در " +"https://setuptools.pypa.io/en/latest/setuptools.html بیابید." -msgid "The :mod:`distutils` module, which was included in the standard library until Python 3.12, is now maintained as part of Setuptools." +msgid "" +"The :mod:`distutils` module, which was included in the standard library " +"until Python 3.12, is now maintained as part of Setuptools." msgstr "" +"ماژول :mod:`distutils` که تا پایتون 3.12 در کتابخانه استاندارد قرار داشت، " +"اکنون به‌عنوان بخشی از Setuptools نگهداری می‌شود." diff --git a/extending/embedding.po b/extending/embedding.po index 7b15a4b3c..826497899 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" +"PO-Revision-Date: 2026-09-04 20:28+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,33 +23,81 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Embedding Python in Another Application" -msgstr "" +msgstr "جاسازی پایتون در برنامه‌ای دیگر" -msgid "The previous chapters discussed how to extend Python, that is, how to extend the functionality of Python by attaching a library of C functions to it. It is also possible to do it the other way around: enrich your C/C++ application by embedding Python in it. Embedding provides your application with the ability to implement some of the functionality of your application in Python rather than C or C++. This can be used for many purposes; one example would be to allow users to tailor the application to their needs by writing some scripts in Python. You can also use it yourself if some of the functionality can be written in Python more easily." -msgstr "" +msgid "" +"The previous chapters discussed how to extend Python, that is, how to extend the functionality of " +"Python by attaching a library of C functions to it. It is also possible to do it the other way " +"around: enrich your C/C++ application by embedding Python in it. Embedding provides your " +"application with the ability to implement some of the functionality of your application in Python " +"rather than C or C++. This can be used for many purposes; one example would be to allow users to " +"tailor the application to their needs by writing some scripts in Python. You can also use it " +"yourself if some of the functionality can be written in Python more easily." +msgstr "" +"فصل‌های قبلی درباره‌ی چگونگی توسعه دادن پایتون بحث کردند، یعنی چگونگی توسعه قابلیت‌های پایتون با ضمیمه " +"کردن یک کتابخانه از توابع C به آن. انجام این کار به روش معکوس نیز ممکن است: برنامه‌ی C/C++ خود را با " +"جاسازی پایتون در آن غنی کنید. جاسازی به برنامه‌ی شما این امکان را می‌دهد که بخشی از قابلیت‌های برنامه‌ی " +"خود را به جای C یا C++ در پایتون پیاده‌سازی کنید. از این می‌توان برای اهداف بسیاری استفاده کرد؛ برای " +"مثال، می‌توان به کاربران اجازه داد با نوشتن چند اسکریپت به زبان پایتون، برنامه را مطابق نیازهایشان " +"سفارشی کنند. اگر نوشتن بخشی از قابلیت‌ها در پایتون آسان‌تر باشد، خودتان نیز می‌توانید از آن استفاده " +"کنید." -msgid "Embedding Python is similar to extending it, but not quite. The difference is that when you extend Python, the main program of the application is still the Python interpreter, while if you embed Python, the main program may have nothing to do with Python --- instead, some parts of the application occasionally call the Python interpreter to run some Python code." +msgid "" +"Embedding Python is similar to extending it, but not quite. The difference is that when you extend " +"Python, the main program of the application is still the Python interpreter, while if you embed " +"Python, the main program may have nothing to do with Python --- instead, some parts of the " +"application occasionally call the Python interpreter to run some Python code." msgstr "" +"جاسازی پایتون شبیه به توسعه دادن آن است، اما نه دقیقاً. تفاوت این است که وقتی پایتون را توسعه می‌دهید، " +"برنامه اصلی اپلیکیشن همچنان مفسر پایتون است، در حالی که اگر پایتون را جاسازی کنید، برنامه اصلی ممکن " +"است هیچ ربطی به پایتون نداشته باشد --- در عوض، بخش‌هایی از اپلیکیشن گاهی مفسر پایتون را فراخوانی " +"می‌کنند تا مقداری کد پایتون را اجرا کنند." -msgid "So if you are embedding Python, you are providing your own main program. One of the things this main program has to do is initialize the Python interpreter. At the very least, you have to call the function :c:func:`Py_Initialize`. There are optional calls to pass command line arguments to Python. Then later you can call the interpreter from any part of the application." +msgid "" +"So if you are embedding Python, you are providing your own main program. One of the things this " +"main program has to do is initialize the Python interpreter. At the very least, you have to call " +"the function :c:func:`Py_Initialize`. There are optional calls to pass command line arguments to " +"Python. Then later you can call the interpreter from any part of the application." msgstr "" +"پس اگر پایتون را تعبیه می‌کنید، برنامه اصلی خودتان را فراهم می‌کنید. یکی از کارهایی که این برنامه اصلی " +"باید انجام دهد، مقداردهی اولیه مفسر پایتون است. در حداقل حالت، باید تابع :c:func:`Py_Initialize` را " +"فراخوانی کنید. فراخوانی‌های اختیاری‌ای نیز وجود دارند که آرگومان‌های خط فرمان را به پایتون منتقل " +"می‌کنند. سپس بعداً می‌توانید مفسر را از هر بخشی از برنامه فراخوانی کنید." -msgid "There are several different ways to call the interpreter: you can pass a string containing Python statements to :c:func:`PyRun_SimpleString`, or you can pass a stdio file pointer and a file name (for identification in error messages only) to :c:func:`PyRun_SimpleFile`. You can also call the lower-level operations described in the previous chapters to construct and use Python objects." +msgid "" +"There are several different ways to call the interpreter: you can pass a string containing Python " +"statements to :c:func:`PyRun_SimpleString`, or you can pass a stdio file pointer and a file name " +"(for identification in error messages only) to :c:func:`PyRun_SimpleFile`. You can also call the " +"lower-level operations described in the previous chapters to construct and use Python objects." msgstr "" +"راه‌های مختلفی برای فراخوانی مفسر وجود دارد: می‌توانید رشته‌ای حاوی دستورهای پایتون را " +"به :c:func:`PyRun_SimpleString` ارسال کنید، یا می‌توانید اشاره‌گر پرونده‌ی stdio و نام یک پرونده (فقط " +"برای شناسایی در پیام‌های خطا) را به :c:func:`PyRun_SimpleFile` ارسال کنید. همچنین می‌توانید برای ساخت " +"و استفاده از اشیای پایتون، عملیات‌های سطح پایین‌تری را که در فصل‌های قبلی توضیح داده شده‌اند فراخوانی " +"کنید." msgid ":ref:`c-api-index`" -msgstr "" +msgstr ":ref:`c-api-index`" -msgid "The details of Python's C interface are given in this manual. A great deal of necessary information can be found here." -msgstr "" +msgid "" +"The details of Python's C interface are given in this manual. A great deal of necessary information " +"can be found here." +msgstr "جزئیات رابط C پایتون در این راهنما آمده است. اطلاعات ضروری فراوانی را می‌توان در اینجا یافت." msgid "Very High Level Embedding" -msgstr "" +msgstr "جاسازی در سطح بسیار بالا" -msgid "The simplest form of embedding Python is the use of the very high level interface. This interface is intended to execute a Python script without needing to interact with the application directly. This can for example be used to perform some operation on a file. ::" +msgid "" +"The simplest form of embedding Python is the use of the very high level interface. This interface is " +"intended to execute a Python script without needing to interact with the application directly. This " +"can for example be used to perform some operation on a file. ::" msgstr "" +"ساده‌ترین شکل جاسازی پایتون، استفاده از رابط سطح بسیار بالا است. این رابط برای اجرای یک اسکریپت " +"پایتون بدون نیاز به تعامل مستقیم با برنامه در نظر گرفته شده است. برای مثال، می‌توان از این برای انجام " +"عملیاتی روی یک پرونده استفاده کرد. ::" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -86,57 +134,145 @@ msgid "" " Py_ExitStatusException(status);\n" "}" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* optional but recommended */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" PyRun_SimpleString(\"from time import time,ctime\\n\"\n" +" \"print('Today is', ctime(time()))\\n\");\n" +" if (Py_FinalizeEx() < 0) {\n" +" exit(120);\n" +" }\n" +" return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" -msgid "``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be used in some APIs instead of ``int``. It is not necessary since Python 3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-string-and-buffers` for a description of this macro." +msgid "" +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be used in some APIs " +"instead of ``int``. It is not necessary since Python 3.13, but we keep it here for backward " +"compatibility. See :ref:`arg-parsing-string-and-buffers` for a description of this macro." msgstr "" +"``#define PY_SSIZE_T_CLEAN`` برای نشان دادن این نکته استفاده می‌شد که در برخی API‌ها باید به‌جای " +"``int`` از ``Py_ssize_t`` استفاده شود. از پایتون 3.13 به بعد دیگر لازم نیست، اما برای سازگاری با " +"نسخه‌های پیشین، آن را اینجا نگه می‌داریم. برای شرح این ماکرو به :ref:`arg-parsing-string-and-buffers` " +"مراجعه کنید." -msgid "Setting :c:member:`PyConfig.program_name` should be called before :c:func:`Py_InitializeFromConfig` to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is initialized with :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the program. In a real program, you may want to get the Python script from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the trouble of allocating memory space and loading the file contents." -msgstr "" +msgid "" +"Setting :c:member:`PyConfig.program_name` should be called before :c:func:`Py_InitializeFromConfig` " +"to inform the interpreter about paths to Python run-time libraries. Next, the Python interpreter is " +"initialized with :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script " +"that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call shuts the interpreter " +"down, followed by the end of the program. In a real program, you may want to get the Python script " +"from another source, perhaps a text-editor routine, a file, or a database. Getting the Python code " +"from a file can better be done by using the :c:func:`PyRun_SimpleFile` function, which saves you the " +"trouble of allocating memory space and loading the file contents." +msgstr "" +"تنظیم :c:member:`PyConfig.program_name` باید پیش از :c:func:`Py_InitializeFromConfig` انجام شود تا " +"مفسر را از مسیرهای کتابخانه‌های زمان اجرای پایتون آگاه کند. سپس، مفسر پایتون " +"با :c:func:`Py_Initialize` مقداردهی اولیه می‌شود و در ادامه، یک اسکریپت پایتونِ هاردکد‌شده (hard-coded) " +"که تاریخ و زمان را چاپ می‌کند، اجرا می‌شود. پس از آن، فراخوانی :c:func:`Py_FinalizeEx` مفسر را متوقف " +"می‌کند و در نهایت برنامه به پایان می‌رسد. در یک برنامه‌ی واقعی، ممکن است بخواهید اسکریپت پایتون را از " +"منبع دیگری دریافت کنید؛ مثلاً از یک روتین ویرایشگر متن، یک پرونده یا یک پایگاه داده. گرفتن کد پایتون " +"از یک پرونده را بهتر می‌توان با استفاده از تابع :c:func:`PyRun_SimpleFile` انجام داد که شما را از " +"دردسر تخصیص فضای حافظه و بارگذاری محتوای پرونده بی‌نیاز می‌کند." msgid "Beyond Very High Level Embedding: An overview" -msgstr "" +msgstr "فراتر از تعبیه در سطح بسیار بالا: مروری کلی" -msgid "The high level interface gives you the ability to execute arbitrary pieces of Python code from your application, but exchanging data values is quite cumbersome to say the least. If you want that, you should use lower level calls. At the cost of having to write more C code, you can achieve almost anything." +msgid "" +"The high level interface gives you the ability to execute arbitrary pieces of Python code from your " +"application, but exchanging data values is quite cumbersome to say the least. If you want that, you " +"should use lower level calls. At the cost of having to write more C code, you can achieve almost " +"anything." msgstr "" +"رابط سطح بالا به شما امکان می‌دهد قطعات دلخواهی از کد پایتون را از درون برنامه‌تان اجرا کنید، اما " +"تبادل مقادیر داده، دست‌کم بگوییم، بسیار پرزحمت است. اگر چنین چیزی می‌خواهید، باید از فراخوانی‌های سطح " +"پایین‌تر استفاده کنید. به بهای اینکه ناچار شوید کد C بیشتری بنویسید، می‌توانید تقریباً هر کاری را انجام " +"دهید." -msgid "It should be noted that extending Python and embedding Python is quite the same activity, despite the different intent. Most topics discussed in the previous chapters are still valid. To show this, consider what the extension code from Python to C really does:" +msgid "" +"It should be noted that extending Python and embedding Python is quite the same activity, despite " +"the different intent. Most topics discussed in the previous chapters are still valid. To show this, " +"consider what the extension code from Python to C really does:" msgstr "" +"باید توجه داشت که توسعه دادن پایتون و تعبیه (embedding) کردن پایتون، با وجود تفاوت در هدف، تقریباً یک " +"فعالیت واحد هستند. بیشتر مباحثی که در فصل‌های پیشین بحث شده‌اند، همچنان معتبرند. برای نشان دادن این " +"موضوع، در نظر بگیرید که کد توسعه‌ای از پایتون به C در واقع چه کاری انجام می‌دهد:" msgid "Convert data values from Python to C," -msgstr "" +msgstr "تبدیل مقادیر داده از پایتون به C،" msgid "Perform a function call to a C routine using the converted values, and" -msgstr "" +msgstr "با استفاده از مقادیر تبدیل‌شده، فراخوانی تابعی به یک روتین C را انجام دهید، و" msgid "Convert the data values from the call from C to Python." -msgstr "" +msgstr "مقادیر داده‌ی حاصل از فراخوانی را از C به پایتون تبدیل کنید." msgid "When embedding Python, the interface code does:" -msgstr "" +msgstr "هنگام جاسازی پایتون، کد رابط کار‌های زیر را انجام می‌دهد:" msgid "Convert data values from C to Python," -msgstr "" +msgstr "تبدیل مقادیر داده از C به پایتون،" msgid "Perform a function call to a Python interface routine using the converted values, and" -msgstr "" +msgstr "با استفاده از مقادیر تبدیل‌شده، یک فراخوانی تابع به یک روتین رابط پایتون انجام دهید و" msgid "Convert the data values from the call from Python to C." -msgstr "" +msgstr "مقادیر داده را از فراخوانی، از پایتون به C تبدیل کنید." -msgid "As you can see, the data conversion steps are simply swapped to accommodate the different direction of the cross-language transfer. The only difference is the routine that you call between both data conversions. When extending, you call a C routine, when embedding, you call a Python routine." +msgid "" +"As you can see, the data conversion steps are simply swapped to accommodate the different direction " +"of the cross-language transfer. The only difference is the routine that you call between both data " +"conversions. When extending, you call a C routine, when embedding, you call a Python routine." msgstr "" +"همان‌طور که می‌بینید، گام‌های تبدیل داده صرفاً برای سازگاری با جهت متفاوتِ انتقال بین دو زبان جابه‌جا " +"شده‌اند. تنها تفاوت، روالی است که بین هر دو تبدیل داده فراخوانی می‌کنید. هنگام توسعه دادن، یک روال C " +"را فراخوانی می‌کنید؛ هنگام جاسازی، یک روال پایتون را." -msgid "This chapter will not discuss how to convert data from Python to C and vice versa. Also, proper use of references and dealing with errors is assumed to be understood. Since these aspects do not differ from extending the interpreter, you can refer to earlier chapters for the required information." +msgid "" +"This chapter will not discuss how to convert data from Python to C and vice versa. Also, proper use " +"of references and dealing with errors is assumed to be understood. Since these aspects do not " +"differ from extending the interpreter, you can refer to earlier chapters for the required " +"information." msgstr "" +"این فصل درباره‌ی نحوه‌ی تبدیل داده‌ها از پایتون به C و برعکس بحث نمی‌کند. همچنین، فرض بر این است که " +"استفاده‌ی صحیح از ارجاع‌ها و برخورد با خطاها را درک کرده‌اید. از آنجا که این جنبه‌ها با توسعه‌ی مفسر " +"تفاوتی ندارند، می‌توانید برای اطلاعات مورد نیاز به فصل‌های پیشین مراجعه کنید." msgid "Pure Embedding" -msgstr "" +msgstr "تعبیه خالص (Pure Embedding)" -msgid "The first program aims to execute a function in a Python script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the application (but that will change in the next section)." +msgid "" +"The first program aims to execute a function in a Python script. Like in the section about the very " +"high level interface, the Python interpreter does not directly interact with the application (but " +"that will change in the next section)." msgstr "" +"هدف اولین برنامه، اجرای یک تابع در یک اسکریپت پایتون است. مانند بخش مربوط به رابط سطح بسیار بالا، " +"مفسر پایتون مستقیماً با برنامه تعامل نمی‌کند (اما این موضوع در بخش بعدی تغییر خواهد کرد)." msgid "The code to run a function defined in a Python script is:" -msgstr "" +msgstr "کد اجرای تابع تعریف‌شده در یک اسکریپت پایتون چنین است:" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -211,9 +347,88 @@ msgid "" " return 0;\n" "}\n" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyObject *pName, *pModule, *pFunc;\n" +" PyObject *pArgs, *pValue;\n" +" int i;\n" +"\n" +" if (argc < 3) {\n" +" fprintf(stderr,\"Usage: call pythonfile funcname [args]\\n\");\n" +" return 1;\n" +" }\n" +"\n" +" Py_Initialize();\n" +" pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +" /* Error checking of pName left out */\n" +"\n" +" pModule = PyImport_Import(pName);\n" +" Py_DECREF(pName);\n" +"\n" +" if (pModule != NULL) {\n" +" pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +" /* pFunc is a new reference */\n" +"\n" +" if (pFunc && PyCallable_Check(pFunc)) {\n" +" pArgs = PyTuple_New(argc - 3);\n" +" for (i = 0; i < argc - 3; ++i) {\n" +" pValue = PyLong_FromLong(atoi(argv[i + 3]));\n" +" if (!pValue) {\n" +" Py_DECREF(pArgs);\n" +" Py_DECREF(pModule);\n" +" fprintf(stderr, \"Cannot convert argument\\n\");\n" +" return 1;\n" +" }\n" +" /* pValue reference stolen here: */\n" +" PyTuple_SetItem(pArgs, i, pValue);\n" +" }\n" +" pValue = PyObject_CallObject(pFunc, pArgs);\n" +" Py_DECREF(pArgs);\n" +" if (pValue != NULL) {\n" +" printf(\"Result of call: %ld\\n\", PyLong_AsLong(pValue));\n" +" Py_DECREF(pValue);\n" +" }\n" +" else {\n" +" Py_DECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" PyErr_Print();\n" +" fprintf(stderr,\"Call failed\\n\");\n" +" return 1;\n" +" }\n" +" }\n" +" else {\n" +" if (PyErr_Occurred())\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Cannot find function \\\"%s\\\"\\n\", argv[2]);\n" +" }\n" +" Py_XDECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" }\n" +" else {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Failed to load \\\"%s\\\"\\n\", argv[1]);\n" +" return 1;\n" +" }\n" +" if (Py_FinalizeEx() < 0) {\n" +" return 120;\n" +" }\n" +" return 0;\n" +"}\n" -msgid "This code loads a Python script using ``argv[1]``, and calls the function named in ``argv[2]``. Its integer arguments are the other values of the ``argv`` array. If you :ref:`compile and link ` this program (let's call the finished executable :program:`call`), and use it to execute a Python script, such as:" +msgid "" +"This code loads a Python script using ``argv[1]``, and calls the function named in ``argv[2]``. Its " +"integer arguments are the other values of the ``argv`` array. If you :ref:`compile and link " +"` this program (let's call the finished executable :program:`call`), and use it to " +"execute a Python script, such as:" msgstr "" +"این کد با استفاده از ``argv[1]`` یک اسکریپت پایتون را بارگذاری می‌کند و تابعی را که نام آن در " +"``argv[2]`` آمده است فراخوانی می‌کند. آرگومان‌های عدد صحیح آن، مقادیر دیگر آرایه‌ی ``argv`` هستند. اگر " +"این برنامه را :ref:`کامپایل و لینک ` کنید (فرض کنید نام فایل اجرایی نهایی :program:`call` " +"باشد) و از آن برای اجرای یک اسکریپت پایتون استفاده کنید، مانند:" msgid "" "def multiply(a,b):\n" @@ -223,18 +438,32 @@ msgid "" " c = c + b\n" " return c" msgstr "" +"def multiply(a,b):\n" +" print(\"Will compute\", a, \"times\", b)\n" +" c = 0\n" +" for i in range(0, a):\n" +" c = c + b\n" +" return c" msgid "then the result should be:" -msgstr "" +msgstr "در این صورت نتیجه باید چنین باشد:" msgid "" "$ call multiply multiply 3 2\n" "Will compute 3 times 2\n" "Result of call: 6" msgstr "" +"$ call multiply multiply 3 2\n" +"۳ ضربدر ۲ محاسبه خواهد شد\n" +"نتیجه‌ی فراخوانی: ۶" -msgid "Although the program is quite large for its functionality, most of the code is for data conversion between Python and C, and for error reporting. The interesting part with respect to embedding Python starts with ::" +msgid "" +"Although the program is quite large for its functionality, most of the code is for data conversion " +"between Python and C, and for error reporting. The interesting part with respect to embedding " +"Python starts with ::" msgstr "" +"با اینکه این برنامه نسبت به کارکردش بسیار بزرگ است، بیشترِ کد آن برای تبدیل داده بین پایتون و C و " +"برای گزارش خطا است. بخش جالب از نظر جاسازی پایتون با کد زیر آغاز می‌شود::" msgid "" "Py_Initialize();\n" @@ -242,9 +471,19 @@ msgid "" "/* Error checking of pName left out */\n" "pModule = PyImport_Import(pName);" msgstr "" +"Py_Initialize();\n" +"pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +"/* Error checking of pName left out */\n" +"pModule = PyImport_Import(pName);" -msgid "After initializing the interpreter, the script is loaded using :c:func:`PyImport_Import`. This routine needs a Python string as its argument, which is constructed using the :c:func:`PyUnicode_DecodeFSDefault` data conversion routine. ::" +msgid "" +"After initializing the interpreter, the script is loaded using :c:func:`PyImport_Import`. This " +"routine needs a Python string as its argument, which is constructed using " +"the :c:func:`PyUnicode_DecodeFSDefault` data conversion routine. ::" msgstr "" +"پس از مقداردهی اولیه‌ی مفسر، اسکریپت با استفاده از :c:func:`PyImport_Import` بارگذاری می‌شود. این " +"روتین به یک رشته پایتون به‌عنوان آرگومان خود نیاز دارد که با استفاده از روتین تبدیل " +"داده‌ی :c:func:`PyUnicode_DecodeFSDefault` ساخته می‌شود. ::" msgid "" "pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" @@ -255,21 +494,52 @@ msgid "" "}\n" "Py_XDECREF(pFunc);" msgstr "" +"pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +"/* pFunc is a new reference */\n" +"\n" +"if (pFunc && PyCallable_Check(pFunc)) {\n" +" ...\n" +"}\n" +"Py_XDECREF(pFunc);" -msgid "Once the script is loaded, the name we're looking for is retrieved using :c:func:`PyObject_GetAttrString`. If the name exists, and the object returned is callable, you can safely assume that it is a function. The program then proceeds by constructing a tuple of arguments as normal. The call to the Python function is then made with::" +msgid "" +"Once the script is loaded, the name we're looking for is retrieved " +"using :c:func:`PyObject_GetAttrString`. If the name exists, and the object returned is callable, " +"you can safely assume that it is a function. The program then proceeds by constructing a tuple of " +"arguments as normal. The call to the Python function is then made with::" msgstr "" +"پس از بارگذاری اسکریپت، نامی که به دنبال آن هستیم با استفاده از :c:func:`PyObject_GetAttrString` " +"بازیابی می‌شود. اگر نام وجود داشته باشد و شیء بازگردانده‌شده فراخوانی‌پذیر باشد، می‌توانید با اطمینان " +"فرض کنید که آن یک تابع است. سپس برنامه به‌صورت معمول با ساخت تاپلی از آرگومان‌ها پیش می‌رود. فراخوانی " +"تابع پایتون سپس به این صورت انجام می‌شود::" msgid "pValue = PyObject_CallObject(pFunc, pArgs);" -msgstr "" +msgstr "pValue = PyObject_CallObject(pFunc, pArgs);" -msgid "Upon return of the function, ``pValue`` is either ``NULL`` or it contains a reference to the return value of the function. Be sure to release the reference after examining the value." +msgid "" +"Upon return of the function, ``pValue`` is either ``NULL`` or it contains a reference to the return " +"value of the function. Be sure to release the reference after examining the value." msgstr "" +"پس از بازگشت تابع، ``pValue`` یا ``NULL`` است یا ارجاعی به مقدار بازگشتی تابع را در خود دارد. حتماً " +"پس از بررسی مقدار، ارجاع را آزاد کنید." msgid "Extending Embedded Python" -msgstr "" +msgstr "توسعه پایتون تعبیه‌شده" -msgid "Until now, the embedded Python interpreter had no access to functionality from the application itself. The Python API allows this by extending the embedded interpreter. That is, the embedded interpreter gets extended with routines provided by the application. While it sounds complex, it is not so bad. Simply forget for a while that the application starts the Python interpreter. Instead, consider the application to be a set of subroutines, and write some glue code that gives Python access to those routines, just like you would write a normal Python extension. For example::" -msgstr "" +msgid "" +"Until now, the embedded Python interpreter had no access to functionality from the application " +"itself. The Python API allows this by extending the embedded interpreter. That is, the embedded " +"interpreter gets extended with routines provided by the application. While it sounds complex, it is " +"not so bad. Simply forget for a while that the application starts the Python interpreter. Instead, " +"consider the application to be a set of subroutines, and write some glue code that gives Python " +"access to those routines, just like you would write a normal Python extension. For example::" +msgstr "" +"تاکنون، مفسر تعبیه‌شده‌ی پایتون هیچ دسترسی‌ای به کارکردهای خودِ برنامه نداشت. API پایتون این کار را از " +"طریق توسعه دادن مفسر تعبیه‌شده ممکن می‌سازد. یعنی مفسر تعبیه‌شده با روتین‌هایی که برنامه فراهم می‌کند، " +"توسعه می‌یابد. اگرچه پیچیده به نظر می‌رسد، چندان هم بد نیست. فقط برای مدتی فراموش کنید که برنامه مفسر " +"پایتون را راه‌اندازی می‌کند. در عوض، برنامه را مجموعه‌ای از زیرروتین‌ها در نظر بگیرید و کمی کد چسبان " +"(glue code) بنویسید که دسترسی پایتون به آن روتین‌ها را فراهم کند، درست همان‌طور که یک توسعه‌ی معمولی " +"پایتون می‌نویسید. برای مثال::" msgid "" "static int numargs=0;\n" @@ -302,62 +572,148 @@ msgid "" " return PyModuleDef_Init(&emb_module);\n" "}" msgstr "" +"static int numargs=0;\n" +"\n" +"/* Return the number of arguments of the application command line */\n" +"static PyObject*\n" +"emb_numargs(PyObject *self, PyObject *args)\n" +"{\n" +" if(!PyArg_ParseTuple(args, \":numargs\"))\n" +" return NULL;\n" +" return PyLong_FromLong(numargs);\n" +"}\n" +"\n" +"static PyMethodDef emb_module_methods[] = {\n" +" {\"numargs\", emb_numargs, METH_VARARGS,\n" +" \"Return the number of arguments received by the process.\"},\n" +" {NULL, NULL, 0, NULL}\n" +"};\n" +"\n" +"static struct PyModuleDef emb_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"emb\",\n" +" .m_size = 0,\n" +" .m_methods = emb_module_methods,\n" +"};\n" +"\n" +"static PyObject*\n" +"PyInit_emb(void)\n" +"{\n" +" return PyModuleDef_Init(&emb_module);\n" +"}" -msgid "Insert the above code just above the :c:func:`main` function. Also, insert the following two statements before the call to :c:func:`Py_Initialize`::" +msgid "" +"Insert the above code just above the :c:func:`main` function. Also, insert the following two " +"statements before the call to :c:func:`Py_Initialize`::" msgstr "" +"کد بالا را بلافاصله بالای تابع :c:func:`main` درج کنید. همچنین، دو دستور زیر را پیش از " +"فراخوانی :c:func:`Py_Initialize` درج کنید::" msgid "" "numargs = argc;\n" "PyImport_AppendInittab(\"emb\", &PyInit_emb);" msgstr "" +"numargs = argc;\n" +"PyImport_AppendInittab(\"emb\", &PyInit_emb);" -msgid "These two lines initialize the ``numargs`` variable, and make the :func:`!emb.numargs` function accessible to the embedded Python interpreter. With these extensions, the Python script can do things like" +msgid "" +"These two lines initialize the ``numargs`` variable, and make the :func:`!emb.numargs` function " +"accessible to the embedded Python interpreter. With these extensions, the Python script can do " +"things like" msgstr "" +"این دو سطر متغیر ``numargs`` را مقداردهی اولیه می‌کنند و تابع :func:`!emb.numargs` را برای مفسر " +"پایتون تعبیه‌شده در دسترس قرار می‌دهند. با این توسعه‌ها، اسکریپت پایتون می‌تواند کارهایی از این دست " +"انجام دهد" msgid "" "import emb\n" "print(\"Number of arguments\", emb.numargs())" msgstr "" +"import emb\n" +"print(\"Number of arguments\", emb.numargs())" msgid "In a real application, the methods will expose an API of the application to Python." -msgstr "" +msgstr "در یک برنامه‌ی واقعی، متدها API برنامه را برای پایتون در دسترس قرار خواهند داد." msgid "Embedding Python in C++" -msgstr "" +msgstr "جاسازی پایتون در C++" -msgid "It is also possible to embed Python in a C++ program; precisely how this is done will depend on the details of the C++ system used; in general you will need to write the main program in C++, and use the C++ compiler to compile and link your program. There is no need to recompile Python itself using C++." +msgid "" +"It is also possible to embed Python in a C++ program; precisely how this is done will depend on the " +"details of the C++ system used; in general you will need to write the main program in C++, and use " +"the C++ compiler to compile and link your program. There is no need to recompile Python itself " +"using C++." msgstr "" +"همچنین می‌توان پایتون را در یک برنامه C++ جاسازی کرد؛ اینکه این کار دقیقاً چگونه انجام می‌شود، به " +"جزئیات سیستم C++ مورد استفاده بستگی دارد؛ به‌طور کلی باید برنامه اصلی را به C++ بنویسید و از کامپایلر " +"C++ برای کامپایل و پیوند دادن برنامه خود استفاده کنید. نیازی نیست خود پایتون با C++ مجدداً کامپایل " +"شود." msgid "Compiling and Linking under Unix-like systems" -msgstr "" +msgstr "کامپایل و پیوند دادن در سیستم‌های شبه‌یونیکس" -msgid "It is not necessarily trivial to find the right flags to pass to your compiler (and linker) in order to embed the Python interpreter into your application, particularly because Python needs to load library modules implemented as C dynamic extensions (:file:`.so` files) linked against it." +msgid "" +"It is not necessarily trivial to find the right flags to pass to your compiler (and linker) in order " +"to embed the Python interpreter into your application, particularly because Python needs to load " +"library modules implemented as C dynamic extensions (:file:`.so` files) linked against it." msgstr "" +"یافتن پرچم‌های مناسب برای دادن به کامپایلر (و پیونددهنده) شما به‌منظور جاسازی مفسر پایتون در " +"برنامه‌تان، لزوماً کار ساده‌ای نیست؛ به‌ویژه از آن رو که پایتون باید ماژول‌های کتابخانه‌ای پیاده‌سازی‌شده " +"به‌صورت توسعه‌های پویای C (پرونده‌های :file:`.so`) که به آن پیوند شده‌اند را بارگذاری کند." -msgid "To find out the required compiler and linker flags, you can execute the :file:`python{X.Y}-config` script which is generated as part of the installation process (a :file:`python3-config` script may also be available). This script has several options, of which the following will be directly useful to you:" +msgid "" +"To find out the required compiler and linker flags, you can execute the :file:`python{X.Y}-config` " +"script which is generated as part of the installation process (a :file:`python3-config` script may " +"also be available). This script has several options, of which the following will be directly useful " +"to you:" msgstr "" +"برای یافتن پرچم‌های مورد نیاز کامپایلر و لینکر، می‌توانید اسکریپت :file:`python{X.Y}-config` را اجرا " +"کنید که به عنوان بخشی از فرایند نصب تولید می‌شود (ممکن است اسکریپت :file:`python3-config` نیز در " +"دسترس باشد). این اسکریپت چندین گزینه دارد که از میان آن‌ها، موارد زیر مستقیماً به کار شما خواهند آمد:" msgid "``pythonX.Y-config --cflags`` will give you the recommended flags when compiling:" -msgstr "" +msgstr "``pythonX.Y-config --cflags`` پرچم‌های توصیه‌شده برای کامپایل را به شما می‌دهد:" msgid "" "$ /opt/bin/python3.11-config --cflags\n" "-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall" msgstr "" +"$ /opt/bin/python3.11-config --cflags\n" +"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall" msgid "``pythonX.Y-config --ldflags --embed`` will give you the recommended flags when linking:" -msgstr "" +msgstr "``pythonX.Y-config --ldflags --embed`` هنگام پیوند دادن، پرچم‌های پیشنهادی را به شما می‌دهد:" msgid "" "$ /opt/bin/python3.11-config --ldflags --embed\n" "-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -lpthread -ldl -lutil -lm" msgstr "" +"$ /opt/bin/python3.11-config --ldflags --embed\n" +"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -lpthread -ldl -lutil -lm" -msgid "To avoid confusion between several Python installations (and especially between the system Python and your own compiled Python), it is recommended that you use the absolute path to :file:`python{X.Y}-config`, as in the above example." +msgid "" +"To avoid confusion between several Python installations (and especially between the system Python " +"and your own compiled Python), it is recommended that you use the absolute path " +"to :file:`python{X.Y}-config`, as in the above example." msgstr "" +"برای جلوگیری از سردرگمی میان چندین نصب پایتون (و به‌ویژه میان پایتون سیستم و پایتون کامپایل‌شده‌ی " +"خودتان)، توصیه می‌شود که از مسیر مطلق :file:`python{X.Y}-config` استفاده کنید، همان‌طور که در مثال " +"بالا آمده است." -msgid "If this procedure doesn't work for you (it is not guaranteed to work for all Unix-like platforms; however, we welcome :ref:`bug reports `) you will have to read your system's documentation about dynamic linking and/or examine Python's :file:`Makefile` (use :func:`sysconfig.get_makefile_filename` to find its location) and compilation options. In this case, the :mod:`sysconfig` module is a useful tool to programmatically extract the configuration values that you will want to combine together. For example:" -msgstr "" +msgid "" +"If this procedure doesn't work for you (it is not guaranteed to work for all Unix-like platforms; " +"however, we welcome :ref:`bug reports `) you will have to read your system's " +"documentation about dynamic linking and/or examine Python's :file:`Makefile` " +"(use :func:`sysconfig.get_makefile_filename` to find its location) and compilation options. In this " +"case, the :mod:`sysconfig` module is a useful tool to programmatically extract the configuration " +"values that you will want to combine together. For example:" +msgstr "" +"اگر این روش برای شما کار نکند (تضمینی نیست که روی همه‌ی سکوهای شبه‌یونیکس کار کند؛ با این حال، " +"از :ref:`گزارش‌های اشکال ` استقبال می‌کنیم) ناچار خواهید بود مستندات سیستم خود را " +"درباره‌ی پیونددهی پویا بخوانید و/یا :file:`Makefile` پایتون (برای یافتن مکان آن " +"از :func:`sysconfig.get_makefile_filename` استفاده کنید) و گزینه‌های کامپایل را بررسی کنید. در این " +"صورت، ماژول :mod:`sysconfig` ابزاری مفید برای استخراج برنامه‌ای مقادیر پیکربندی‌ای است که می‌خواهید " +"آن‌ها را با هم ترکیب کنید. برای مثال:" msgid "" ">>> import sysconfig\n" @@ -366,3 +722,8 @@ msgid "" ">>> sysconfig.get_config_var('LINKFORSHARED')\n" "'-Xlinker -export-dynamic'" msgstr "" +">>> import sysconfig\n" +">>> sysconfig.get_config_var('LIBS')\n" +"'-lpthread -ldl -lutil'\n" +">>> sysconfig.get_config_var('LINKFORSHARED')\n" +"'-Xlinker -export-dynamic'" diff --git a/extending/extending.po b/extending/extending.po index 51478f7fd..afe1445b7 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -24,107 +24,214 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Extending Python with C or C++" -msgstr "" +msgstr "توسعه پایتون با C یا C++" -msgid "It is quite easy to add new built-in modules to Python, if you know how to program in C. Such :dfn:`extension modules` can do two things that can't be done directly in Python: they can implement new built-in object types, and they can call C library functions and system calls." +msgid "" +"It is quite easy to add new built-in modules to Python, if you know how to " +"program in C. Such :dfn:`extension modules` can do two things that can't be" +" done directly in Python: they can implement new built-in object types, and " +"they can call C library functions and system calls." msgstr "" +"اگر بدانید چگونه به زبان C برنامه‌نویسی کنید، افزودن ماژول‌های توکار جدید به" +" پایتون کاملاً آسان است. چنین :dfn:`ماژول‌های توسعه‌ای ` " +"می‌توانند دو کاری انجام دهند که مستقیماً در پایتون امکان‌پذیر نیست: " +"می‌توانند نوع‌های شیء توکار جدید را پیاده‌سازی کنند و می‌توانند توابع " +"کتابخانه C و فراخوان‌های سیستمی را فراخوانی کنند." -msgid "To support extensions, the Python API (Application Programmers Interface) defines a set of functions, macros and variables that provide access to most aspects of the Python run-time system. The Python API is incorporated in a C source file by including the header ``\"Python.h\"``." +msgid "" +"To support extensions, the Python API (Application Programmers Interface) " +"defines a set of functions, macros and variables that provide access to most" +" aspects of the Python run-time system. The Python API is incorporated in a" +" C source file by including the header ``\"Python.h\"``." msgstr "" +"برای پشتیبانی از توسعه‌ها، API پایتون (رابط برنامه‌نویسی کاربردی) مجموعه‌ای " +"از توابع، ماکروها و متغیرها را تعریف می‌کند که دسترسی به بیشتر جنبه‌های " +"سیستم زمان اجرای پایتون را فراهم می‌کنند. API پایتون با گنجاندن سرآیند " +"``\"Python.h\"`` در یک پرونده منبع C ادغام می‌شود." -msgid "The compilation of an extension module depends on its intended use as well as on your system setup; details are given in later chapters." +msgid "" +"The compilation of an extension module depends on its intended use as well " +"as on your system setup; details are given in later chapters." msgstr "" +"کامپایل یک ماژول توسعه‌ای به کاربرد موردنظر آن و همچنین به پیکربندی سیستم " +"شما بستگی دارد؛ جزئیات در فصل‌های بعدی ارائه شده است." -msgid "The C extension interface is specific to CPython, and extension modules do not work on other Python implementations. In many cases, it is possible to avoid writing C extensions and preserve portability to other implementations. For example, if your use case is calling C library functions or system calls, you should consider using the :mod:`ctypes` module or the `cffi `_ library rather than writing custom C code. These modules let you write Python code to interface with C code and are more portable between implementations of Python than writing and compiling a C extension module." -msgstr "" +msgid "" +"The C extension interface is specific to CPython, and extension modules do " +"not work on other Python implementations. In many cases, it is possible to " +"avoid writing C extensions and preserve portability to other " +"implementations. For example, if your use case is calling C library " +"functions or system calls, you should consider using the :mod:`ctypes` " +"module or the `cffi `_ library rather than " +"writing custom C code. These modules let you write Python code to interface " +"with C code and are more portable between implementations of Python than " +"writing and compiling a C extension module." +msgstr "" +"رابط توسعه C مختص سی‌پایتون است و ماژول‌های توسعه‌ای روی پیاده‌سازی‌های دیگر" +" پایتون کار نمی‌کنند. در بسیاری از موارد می‌توان از نوشتن توسعه‌های C پرهیز " +"کرد و قابلیت حمل به پیاده‌سازی‌های دیگر را حفظ نمود. برای مثال، اگر مورد " +"استفاده‌ی شما فراخوانی توابع کتابخانه C یا فراخوانی‌های سیستمی است، باید به " +"جای نوشتن کد C سفارشی، استفاده از ماژول :mod:`ctypes` یا کتابخانه‌ی `cffi " +"`_ را در نظر بگیرید. این ماژول‌ها به شما اجازه" +" می‌دهند برای برقراری رابط با کد C، کد پایتون بنویسید و نسبت به نوشتن و " +"کامپایل کردن یک ماژول توسعه‌ای C، بین پیاده‌سازی‌های پایتون قابلیت حمل " +"بیشتری دارند." msgid "A Simple Example" -msgstr "" +msgstr "یک مثال ساده" -msgid "Let's create an extension module called ``spam`` (the favorite food of Monty Python fans...) and let's say we want to create a Python interface to the C library function :c:func:`system` [#]_. This function takes a null-terminated character string as argument and returns an integer. We want this function to be callable from Python as follows:" -msgstr "" +msgid "" +"Let's create an extension module called ``spam`` (the favorite food of Monty" +" Python fans...) and let's say we want to create a Python interface to the C" +" library function :c:func:`system` [#]_. This function takes a null-" +"terminated character string as argument and returns an integer. We want " +"this function to be callable from Python as follows:" +msgstr "" +"بیایید یک ماژول توسعه‌ای به نام ``spam`` بسازیم (غذای مورد علاقه‌ی طرفداران " +"مونتی پایتون...) و فرض کنیم می‌خواهیم یک رابط پایتونی برای تابع کتابخانه‌ی C" +" یعنی :c:func:`system` [#]_ بسازیم. این تابع یک رشته‌ی نویسه‌ای پایان‌یافته " +"با نویسه‌ی تهی را به‌عنوان آرگومان می‌گیرد و یک عدد صحیح برمی‌گرداند. " +"می‌خواهیم این تابع از پایتون به صورت زیر فراخوانی‌پذیر باشد:" msgid "" ">>> import spam\n" ">>> status = spam.system(\"ls -l\")" msgstr "" +">>> import spam\n" +">>> status = spam.system(\"ls -l\")" -msgid "Begin by creating a file :file:`spammodule.c`. (Historically, if a module is called ``spam``, the C file containing its implementation is called :file:`spammodule.c`; if the module name is very long, like ``spammify``, the module name can be just :file:`spammify.c`.)" +msgid "" +"Begin by creating a file :file:`spammodule.c`. (Historically, if a module " +"is called ``spam``, the C file containing its implementation is called " +":file:`spammodule.c`; if the module name is very long, like ``spammify``, " +"the module name can be just :file:`spammify.c`.)" msgstr "" +"کار را با ایجاد یک پرونده‌ی :file:`spammodule.c` آغاز کنید. (از نظر تاریخی، " +"اگر ماژولی ``spam`` نام داشته باشد، پرونده‌ی C حاوی پیاده‌سازی آن " +":file:`spammodule.c` نامیده می‌شود؛ اگر نام ماژول بسیار طولانی باشد، مانند " +"``spammify``، نام ماژول می‌تواند تنها :file:`spammify.c` باشد.)" msgid "The first two lines of our file can be::" -msgstr "" +msgstr "دو سطر نخست پرونده‌ی ما می‌تواند باشد::" msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include " msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " -msgid "which pulls in the Python API (you can add a comment describing the purpose of the module and a copyright notice if you like)." +msgid "" +"which pulls in the Python API (you can add a comment describing the purpose " +"of the module and a copyright notice if you like)." msgstr "" +"که API پایتون را وارد می‌کند (در صورت تمایل می‌توانید کامنتی که هدف ماژول را" +" شرح می‌دهد و یک اعلان حق نشر اضافه کنید)." -msgid "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you *must* include :file:`Python.h` before any standard headers are included." +msgid "" +"Since Python may define some pre-processor definitions which affect the " +"standard headers on some systems, you *must* include :file:`Python.h` before" +" any standard headers are included." msgstr "" +"از آنجا که پایتون ممکن است برخی تعریف‌های پیش‌پردازنده را تعریف کند که در " +"برخی سیستم‌ها بر سرآیندهای استاندارد تأثیر می‌گذارند، شما *باید* " +":file:`Python.h` را پیش از گنجاندن هر سرآیند استانداردی بگنجانید." -msgid "``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should be used in some APIs instead of ``int``. It is not necessary since Python 3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-string-and-buffers` for a description of this macro." +msgid "" +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should" +" be used in some APIs instead of ``int``. It is not necessary since Python " +"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" +"string-and-buffers` for a description of this macro." msgstr "" +"``#define PY_SSIZE_T_CLEAN`` برای نشان دادن اینکه ``Py_ssize_t`` باید در " +"برخی API‌ها به‌جای ``int`` استفاده شود، به کار می‌رفت. از پایتون 3.13 به بعد" +" دیگر ضروری نیست، اما ما آن را برای سازگاری با گذشته در اینجا نگه می‌داریم. " +"برای توضیح این ماکرو به :ref:`arg-parsing-string-and-buffers` مراجعه کنید." -msgid "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` or ``PY``, except those defined in standard header files." +msgid "" +"All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py``" +" or ``PY``, except those defined in standard header files." msgstr "" +"تمام نمادهای قابل مشاهده توسط کاربر که توسط :file:`Python.h` تعریف شده‌اند، " +"پیشوند ``Py`` یا ``PY`` دارند؛ به‌جز نمادهایی که در پرونده‌های سرآیند " +"استاندارد تعریف شده‌اند." -msgid "For backward compatibility, :file:`Python.h` includes several standard header files. C extensions should include the standard headers that they use, and should not rely on these implicit includes. If using the limited C API version 3.13 or newer, the implicit includes are:" +msgid "" +"For backward compatibility, :file:`Python.h` includes several standard " +"header files. C extensions should include the standard headers that they " +"use, and should not rely on these implicit includes. If using the limited C " +"API version 3.13 or newer, the implicit includes are:" msgstr "" +"برای سازگاری با نسخه‌های پیشین، :file:`Python.h` چندین پرونده‌ی سرآیند " +"استاندارد را include می‌کند. افزونه‌های C باید سرآیندهای استاندارد مورد " +"استفاده‌ی خود را include کنند و نباید به این include‌های ضمنی تکیه کنند. اگر" +" از C API محدود نسخه‌ی 3.13 یا جدیدتر استفاده می‌کنید، include‌های ضمنی " +"عبارت‌اند از:" msgid "````" -msgstr "" +msgstr "````" msgid "```` (on Windows)" -msgstr "" +msgstr "```` (در ویندوز)" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "```` (if present)" -msgstr "" +msgstr "```` (در صورت وجود)" -msgid "If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or older, the headers below are also included:" +msgid "" +"If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or " +"older, the headers below are also included:" msgstr "" +"اگر :c:macro:`Py_LIMITED_API` تعریف نشده باشد، یا روی نسخه 3.12 یا قدیمی‌تر " +"تنظیم شده باشد، سرآیندهای زیر نیز گنجانده می‌شوند:" msgid "````" -msgstr "" +msgstr "````" msgid "```` (on POSIX)" -msgstr "" +msgstr "```` (در POSIX)" -msgid "If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or older, the headers below are also included:" +msgid "" +"If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or " +"older, the headers below are also included:" msgstr "" +"اگر :c:macro:`Py_LIMITED_API` تعریف نشده باشد، یا روی نسخه 3.10 یا قدیمی‌تر " +"تنظیم شده باشد، سرآیندهای زیر نیز گنجانده می‌شوند:" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" msgid "````" -msgstr "" +msgstr "````" -msgid "The next thing we add to our module file is the C function that will be called when the Python expression ``spam.system(string)`` is evaluated (we'll see shortly how it ends up being called)::" +msgid "" +"The next thing we add to our module file is the C function that will be " +"called when the Python expression ``spam.system(string)`` is evaluated " +"(we'll see shortly how it ends up being called)::" msgstr "" +"مورد بعدی که به پرونده ماژول خود اضافه می‌کنیم، تابع C است که هنگام ارزیابی " +"عبارت پایتون ``spam.system(string)`` فراخوانی خواهد شد (به‌زودی خواهیم دید " +"که چگونه در نهایت فراخوانی می‌شود)::" msgid "" "static PyObject *\n" @@ -139,75 +246,280 @@ msgid "" " return PyLong_FromLong(sts);\n" "}" msgstr "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" return PyLong_FromLong(sts);\n" +"}" -msgid "There is a straightforward translation from the argument list in Python (for example, the single expression ``\"ls -l\"``) to the arguments passed to the C function. The C function always has two arguments, conventionally named *self* and *args*." +msgid "" +"There is a straightforward translation from the argument list in Python (for" +" example, the single expression ``\"ls -l\"``) to the arguments passed to " +"the C function. The C function always has two arguments, conventionally " +"named *self* and *args*." msgstr "" +"ترجمه‌ای سرراست از فهرست آرگومان‌ها در پایتون (برای مثال، عبارت واحد ``\"ls " +"-l\"``) به آرگومان‌های پاس‌داده‌شده به تابع C وجود دارد. تابع C همیشه دو " +"آرگومان دارد که به‌طور قراردادی *self* و *args* نامیده می‌شوند." -msgid "The *self* argument points to the module object for module-level functions; for a method it would point to the object instance." +msgid "" +"The *self* argument points to the module object for module-level functions; " +"for a method it would point to the object instance." msgstr "" +"آرگومان *self* برای توابع در سطح ماژول به شیء ماژول اشاره می‌کند؛ برای یک " +"متد، به نمونه‌ی شیء اشاره خواهد کرد." -msgid "The *args* argument will be a pointer to a Python tuple object containing the arguments. Each item of the tuple corresponds to an argument in the call's argument list. The arguments are Python objects --- in order to do anything with them in our C function we have to convert them to C values. The function :c:func:`PyArg_ParseTuple` in the Python API checks the argument types and converts them to C values. It uses a template string to determine the required types of the arguments as well as the types of the C variables into which to store the converted values. More about this later." -msgstr "" +msgid "" +"The *args* argument will be a pointer to a Python tuple object containing " +"the arguments. Each item of the tuple corresponds to an argument in the " +"call's argument list. The arguments are Python objects --- in order to do " +"anything with them in our C function we have to convert them to C values. " +"The function :c:func:`PyArg_ParseTuple` in the Python API checks the " +"argument types and converts them to C values. It uses a template string to " +"determine the required types of the arguments as well as the types of the C " +"variables into which to store the converted values. More about this later." +msgstr "" +"آرگومان *args* اشاره‌گری به یک شیء تاپل پایتون حاوی آرگومان‌ها خواهد بود. هر" +" آیتم از تاپل با یک آرگومان در فهرست آرگومان‌های فراخوانی مطابقت دارد. " +"آرگومان‌ها اشیاء پایتون هستند --- برای اینکه بتوانیم در تابع C خود کاری با " +"آن‌ها انجام دهیم، باید آن‌ها را به مقادیر C تبدیل کنیم. تابع " +":c:func:`PyArg_ParseTuple` در API پایتون انواع آرگومان‌ها را بررسی می‌کند و " +"آن‌ها را به مقادیر C تبدیل می‌کند. این تابع از یک رشته‌ی قالب برای تعیین " +"انواع مورد نیاز آرگومان‌ها و همچنین انواع متغیرهای C که مقادیر تبدیل‌شده در " +"آن‌ها ذخیره می‌شوند، استفاده می‌کند. در ادامه بیشتر درباره‌ی این موضوع توضیح" +" داده خواهد شد." -msgid ":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the right type and its components have been stored in the variables whose addresses are passed. It returns false (zero) if an invalid argument list was passed. In the latter case it also raises an appropriate exception so the calling function can return ``NULL`` immediately (as we saw in the example)." -msgstr "" +msgid "" +":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the " +"right type and its components have been stored in the variables whose " +"addresses are passed. It returns false (zero) if an invalid argument list " +"was passed. In the latter case it also raises an appropriate exception so " +"the calling function can return ``NULL`` immediately (as we saw in the " +"example)." +msgstr "" +"تابع :c:func:`PyArg_ParseTuple` در صورتی مقدار درست (غیرصفر) را برمی‌گرداند " +"که همه‌ی آرگومان‌ها نوع درست را داشته باشند و اجزای آن در متغیرهایی که " +"آدرس‌هایشان پاس داده شده، ذخیره شده باشند. اگر فهرست آرگومان نامعتبری پاس " +"داده شده باشد، مقدار نادرست (صفر) را برمی‌گرداند. در حالت دوم، همچنین یک " +"استثنای مناسب ایجاد می‌کند تا تابع فراخواننده بتواند بلافاصله ``NULL`` را " +"برگرداند (همان‌طور که در مثال دیدیم)." msgid "Intermezzo: Errors and Exceptions" -msgstr "" +msgstr "میان‌پرده: خطاها و استثناها" -msgid "An important convention throughout the Python interpreter is the following: when a function fails, it should set an exception condition and return an error value (usually ``-1`` or a ``NULL`` pointer). Exception information is stored in three members of the interpreter's thread state. These are ``NULL`` if there is no exception. Otherwise they are the C equivalents of the members of the Python tuple returned by :meth:`sys.exc_info`. These are the exception type, exception instance, and a traceback object. It is important to know about them to understand how errors are passed around." -msgstr "" +msgid "" +"An important convention throughout the Python interpreter is the following: " +"when a function fails, it should set an exception condition and return an " +"error value (usually ``-1`` or a ``NULL`` pointer). Exception information " +"is stored in three members of the interpreter's thread state. These are " +"``NULL`` if there is no exception. Otherwise they are the C equivalents of " +"the members of the Python tuple returned by :meth:`sys.exc_info`. These are" +" the exception type, exception instance, and a traceback object. It is " +"important to know about them to understand how errors are passed around." +msgstr "" +"یک قرارداد مهم در سراسر مفسر پایتون به شرح زیر است: هنگامی که تابعی شکست " +"می‌خورد، باید وضعیت استثنا را تنظیم کند و یک مقدار خطا (معمولاً ``-1`` یا یک" +" اشاره‌گر ``NULL``) برگرداند. اطلاعات استثنا در سه عضو از وضعیت نخ مفسر " +"ذخیره می‌شود. در صورت نبود استثنا، این‌ها ``NULL`` هستند. در غیر این صورت، " +"آن‌ها معادل‌های C اعضای تاپل پایتونی‌ای هستند که توسط :meth:`sys.exc_info` " +"برگردانده می‌شود. این‌ها عبارت‌اند از نوع استثنا، نمونه استثنا، و یک شیء " +"ردگیری. دانستن این موارد برای درک چگونگی انتقال خطاها اهمیت دارد." -msgid "The Python API defines a number of functions to set various types of exceptions." -msgstr "" +msgid "" +"The Python API defines a number of functions to set various types of " +"exceptions." +msgstr "API پایتون تعدادی تابع برای تنظیم انواع مختلف استثناها تعریف می‌کند." -msgid "The most common one is :c:func:`PyErr_SetString`. Its arguments are an exception object and a C string. The exception object is usually a predefined object like :c:data:`PyExc_ZeroDivisionError`. The C string indicates the cause of the error and is converted to a Python string object and stored as the \"associated value\" of the exception." +msgid "" +"The most common one is :c:func:`PyErr_SetString`. Its arguments are an " +"exception object and a C string. The exception object is usually a " +"predefined object like :c:data:`PyExc_ZeroDivisionError`. The C string " +"indicates the cause of the error and is converted to a Python string object " +"and stored as the \"associated value\" of the exception." msgstr "" +"رایج‌ترین آن‌ها :c:func:`PyErr_SetString` است. آرگومان‌های آن یک شیء استثنا" +" و یک رشته C هستند. شیء استثنا معمولاً شیء از پیش تعریف‌شده‌ای مانند " +":c:data:`PyExc_ZeroDivisionError` است. رشته C علت خطا را نشان می‌دهد، به یک" +" شیء رشته پایتون تبدیل می‌شود و به عنوان «مقدار مرتبط» استثنا ذخیره می‌شود." -msgid "Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an exception argument and constructs the associated value by inspection of the global variable :c:data:`errno`. The most general function is :c:func:`PyErr_SetObject`, which takes two object arguments, the exception and its associated value. You don't need to :c:func:`Py_INCREF` the objects passed to any of these functions." -msgstr "" +msgid "" +"Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an" +" exception argument and constructs the associated value by inspection of the" +" global variable :c:data:`errno`. The most general function is " +":c:func:`PyErr_SetObject`, which takes two object arguments, the exception " +"and its associated value. You don't need to :c:func:`Py_INCREF` the objects" +" passed to any of these functions." +msgstr "" +"تابع مفید دیگر :c:func:`PyErr_SetFromErrno` است که تنها یک آرگومان استثنا " +"می‌گیرد و مقدار مرتبط را با بررسی متغیر سراسری :c:data:`errno` می‌سازد. " +"عمومی‌ترین تابع :c:func:`PyErr_SetObject` است که دو آرگومان شیء می‌گیرد: " +"استثنا و مقدار مرتبط با آن. نیازی نیست اشیاء ارسال‌شده به هیچ‌یک از این " +"توابع را :c:func:`Py_INCREF` کنید." -msgid "You can test non-destructively whether an exception has been set with :c:func:`PyErr_Occurred`. This returns the current exception object, or ``NULL`` if no exception has occurred. You normally don't need to call :c:func:`PyErr_Occurred` to see whether an error occurred in a function call, since you should be able to tell from the return value." -msgstr "" +msgid "" +"You can test non-destructively whether an exception has been set with " +":c:func:`PyErr_Occurred`. This returns the current exception object, or " +"``NULL`` if no exception has occurred. You normally don't need to call " +":c:func:`PyErr_Occurred` to see whether an error occurred in a function " +"call, since you should be able to tell from the return value." +msgstr "" +"می‌توانید به‌صورت غیرمخرب با :c:func:`PyErr_Occurred` بررسی کنید که آیا " +"استثنایی تنظیم شده است یا خیر. این تابع شیء استثنای فعلی را برمی‌گرداند، یا " +"اگر استثنایی رخ نداده باشد، ``NULL``. شما معمولاً برای فهمیدن اینکه آیا " +"خطایی در فراخوانی یک تابع رخ داده است، نیازی به فراخوانی " +":c:func:`PyErr_Occurred` ندارید، زیرا باید بتوانید از روی مقدار بازگشتی " +"متوجه آن شوید." -msgid "When a function *f* that calls another function *g* detects that the latter fails, *f* should itself return an error value (usually ``NULL`` or ``-1``). It should *not* call one of the ``PyErr_*`` functions --- one has already been called by *g*. *f*'s caller is then supposed to also return an error indication to *its* caller, again *without* calling ``PyErr_*``, and so on --- the most detailed cause of the error was already reported by the function that first detected it. Once the error reaches the Python interpreter's main loop, this aborts the currently executing Python code and tries to find an exception handler specified by the Python programmer." -msgstr "" +msgid "" +"When a function *f* that calls another function *g* detects that the latter " +"fails, *f* should itself return an error value (usually ``NULL`` or ``-1``)." +" It should *not* call one of the ``PyErr_*`` functions --- one has already " +"been called by *g*. *f*'s caller is then supposed to also return an error " +"indication to *its* caller, again *without* calling ``PyErr_*``, and so on " +"--- the most detailed cause of the error was already reported by the " +"function that first detected it. Once the error reaches the Python " +"interpreter's main loop, this aborts the currently executing Python code and" +" tries to find an exception handler specified by the Python programmer." +msgstr "" +"وقتی تابعی *f* که تابع دیگری به نام *g* را فراخوانی می‌کند تشخیص می‌دهد که " +"آن تابع شکست خورده است، *f* باید خودش یک مقدار خطا برگرداند (معمولاً " +"``NULL`` یا ``-1``). این تابع *نباید* یکی از توابع ``PyErr_*`` را فراخوانی " +"کند --- یکی از آن‌ها قبلاً توسط *g* فراخوانی شده است. سپس فراخوان‌کننده *f* " +"نیز باید نشانه‌ای از خطا را به فراخوان‌کننده *خودش* برگرداند، باز هم *بدون* " +"فراخوانی ``PyErr_*``، و به همین ترتیب --- دقیق‌ترین علت خطا قبلاً توسط تابعی" +" که نخست آن را تشخیص داده است گزارش شده است. وقتی خطا به حلقه اصلی مفسر " +"پایتون می‌رسد، این امر کد پایتون در حال اجرا را متوقف می‌کند و تلاش می‌کند " +"هندلر استثنایی را که برنامه‌نویس پایتون تعیین کرده است بیابد." -msgid "(There are situations where a module can actually give a more detailed error message by calling another ``PyErr_*`` function, and in such cases it is fine to do so. As a general rule, however, this is not necessary, and can cause information about the cause of the error to be lost: most operations can fail for a variety of reasons.)" -msgstr "" +msgid "" +"(There are situations where a module can actually give a more detailed error" +" message by calling another ``PyErr_*`` function, and in such cases it is " +"fine to do so. As a general rule, however, this is not necessary, and can " +"cause information about the cause of the error to be lost: most operations " +"can fail for a variety of reasons.)" +msgstr "" +"(گاهی موقعیت‌هایی پیش می‌آید که یک ماژول می‌تواند در واقع با فراخوانی تابع " +"دیگری از نوع ``PyErr_*`` پیام خطای دقیق‌تری ارائه دهد، و در چنین مواردی " +"انجام این کار اشکالی ندارد. با این حال، به‌عنوان یک قاعده کلی، این کار " +"ضروری نیست و می‌تواند باعث از دست رفتن اطلاعاتی درباره علت خطا شود: بیشتر " +"عملیات می‌توانند به دلایل مختلفی شکست بخورند.)" -msgid "To ignore an exception set by a function call that failed, the exception condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The only time C code should call :c:func:`PyErr_Clear` is if it doesn't want to pass the error on to the interpreter but wants to handle it completely by itself (possibly by trying something else, or pretending nothing went wrong)." -msgstr "" +msgid "" +"To ignore an exception set by a function call that failed, the exception " +"condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The " +"only time C code should call :c:func:`PyErr_Clear` is if it doesn't want to " +"pass the error on to the interpreter but wants to handle it completely by " +"itself (possibly by trying something else, or pretending nothing went " +"wrong)." +msgstr "" +"برای نادیده‌گرفتن استثنایی که توسط یک فراخوانی تابع ناموفق تنظیم شده است، " +"باید وضعیت استثنا به‌طور صریح با فراخوانی :c:func:`PyErr_Clear` پاک شود. کد " +"C تنها باید زمانی :c:func:`PyErr_Clear` را فراخوانی کند که نخواهد خطا را به " +"مفسر منتقل کند، بلکه بخواهد خودش به‌طور کامل آن را مدیریت کند (احتمالاً با " +"امتحان کردن چیز دیگری، یا وانمود کردن به اینکه هیچ مشکلی پیش نیامده است)." -msgid "Every failing :c:func:`malloc` call must be turned into an exception --- the direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:`PyErr_NoMemory` and return a failure indicator itself. All the object-creating functions (for example, :c:func:`PyLong_FromLong`) already do this, so this note is only relevant to those who call :c:func:`malloc` directly." -msgstr "" +msgid "" +"Every failing :c:func:`malloc` call must be turned into an exception --- the" +" direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call " +":c:func:`PyErr_NoMemory` and return a failure indicator itself. All the " +"object-creating functions (for example, :c:func:`PyLong_FromLong`) already " +"do this, so this note is only relevant to those who call :c:func:`malloc` " +"directly." +msgstr "" +"هر فراخوانی ناموفق :c:func:`malloc` باید به یک استثنا تبدیل شود --- " +"فراخوانی‌کننده‌ی مستقیم :c:func:`malloc` (یا :c:func:`realloc`) باید " +":c:func:`PyErr_NoMemory` را فراخوانی کند و خودش نشانگر شکست را برگرداند. " +"همه‌ی توابع ایجادکننده‌ی شیء (برای مثال، :c:func:`PyLong_FromLong`) از قبل " +"این کار را انجام می‌دهند، بنابراین این نکته فقط به کسانی مربوط است که " +":c:func:`malloc` را مستقیماً فراخوانی می‌کنند." -msgid "Also note that, with the important exception of :c:func:`PyArg_ParseTuple` and friends, functions that return an integer status usually return a positive value or zero for success and ``-1`` for failure, like Unix system calls." +msgid "" +"Also note that, with the important exception of :c:func:`PyArg_ParseTuple` " +"and friends, functions that return an integer status usually return a " +"positive value or zero for success and ``-1`` for failure, like Unix system " +"calls." msgstr "" +"همچنین توجه داشته باشید که، با استثنای مهم :c:func:`PyArg_ParseTuple` و " +"امثال آن، توابعی که یک وضعیت عدد صحیح برمی‌گردانند معمولاً مانند " +"فراخوانی‌های سیستمی یونیکس، برای موفقیت مقداری مثبت یا صفر و برای شکست " +"``-1`` برمی‌گردانند." -msgid "Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :c:func:`Py_DECREF` calls for objects you have already created) when you return an error indicator!" +msgid "" +"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or " +":c:func:`Py_DECREF` calls for objects you have already created) when you " +"return an error indicator!" msgstr "" +"در نهایت، هنگامی که نشانگر خطا را برمی‌گردانید، مراقب باشید که زباله‌ها را " +"پاک‌سازی کنید (با انجام فراخوانی‌های :c:func:`Py_XDECREF` یا " +":c:func:`Py_DECREF` برای اشیایی که از قبل ایجاد کرده‌اید)!" -msgid "The choice of which exception to raise is entirely yours. There are predeclared C objects corresponding to all built-in Python exceptions, such as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` to mean that a file couldn't be opened (that should probably be :c:data:`PyExc_OSError`). If something's wrong with the argument list, the :c:func:`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If you have an argument whose value must be in a particular range or must satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." -msgstr "" +msgid "" +"The choice of which exception to raise is entirely yours. There are " +"predeclared C objects corresponding to all built-in Python exceptions, such " +"as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course," +" you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError`" +" to mean that a file couldn't be opened (that should probably be " +":c:data:`PyExc_OSError`). If something's wrong with the argument list, the " +":c:func:`PyArg_ParseTuple` function usually raises " +":c:data:`PyExc_TypeError`. If you have an argument whose value must be in a" +" particular range or must satisfy other conditions, " +":c:data:`PyExc_ValueError` is appropriate." +msgstr "" +"انتخاب اینکه کدام استثنا را برافرازید، کاملاً با شماست. اشیاء C از پیش " +"اعلان‌شده‌ای متناظر با تمام استثناهای توکار پایتون وجود دارند، مانند " +":c:data:`PyExc_ZeroDivisionError`، که می‌توانید مستقیماً از آن‌ها استفاده " +"کنید. البته، باید استثناها را هوشمندانه انتخاب کنید --- از " +":c:data:`PyExc_TypeError` برای بیان اینکه پرونده‌ای نتوانست باز شود استفاده " +"نکنید (آن مورد احتمالاً باید :c:data:`PyExc_OSError` باشد). اگر مشکلی در " +"فهرست آرگومان‌ها وجود داشته باشد، تابع :c:func:`PyArg_ParseTuple` معمولاً " +"استثنای :c:data:`PyExc_TypeError` را برمی‌افرازد. اگر آرگومانی داشته باشید " +"که مقدار آن باید در محدوده‌ی خاصی باشد یا باید شرایط دیگری را برآورده کند، " +":c:data:`PyExc_ValueError` مناسب است." -msgid "You can also define a new exception that is unique to your module. The simplest way to do this is to declare a static global object variable at the beginning of the file::" +msgid "" +"You can also define a new exception that is unique to your module. The " +"simplest way to do this is to declare a static global object variable at the" +" beginning of the file::" msgstr "" +"شما همچنین می‌توانید یک استثنای جدید تعریف کنید که مختص ماژول شما باشد. " +"ساده‌ترین راه برای انجام این کار، اعلان یک متغیر شیء سراسری ایستا در ابتدای " +"پرونده است::" msgid "static PyObject *SpamError = NULL;" -msgstr "" +msgstr "static PyObject *SpamError = NULL;" -msgid "and initialize it by calling :c:func:`PyErr_NewException` in the module's :c:data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" +msgid "" +"and initialize it by calling :c:func:`PyErr_NewException` in the module's " +":c:data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" msgstr "" +"و آن را با فراخوانی :c:func:`PyErr_NewException` در تابع " +":c:data:`Py_mod_exec` ماژول (:c:func:`!spam_module_exec`) مقداردهی اولیه " +"کنید::" msgid "SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);" -msgstr "" +msgstr "SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);" -msgid "Since :c:data:`!SpamError` is a global variable, it will be overwritten every time the module is reinitialized, when the :c:data:`Py_mod_exec` function is called." +msgid "" +"Since :c:data:`!SpamError` is a global variable, it will be overwritten " +"every time the module is reinitialized, when the :c:data:`Py_mod_exec` " +"function is called." msgstr "" +"از آنجا که :c:data:`!SpamError` یک متغیر سراسری است، هر بار که ماژول مجدداً " +"مقداردهی اولیه می‌شود — یعنی هنگامی که تابع :c:data:`Py_mod_exec` فراخوانی " +"می‌شود — بازنویسی خواهد شد." -msgid "For now, let's avoid the issue: we will block repeated initialization by raising an :py:exc:`ImportError`::" +msgid "" +"For now, let's avoid the issue: we will block repeated initialization by " +"raising an :py:exc:`ImportError`::" msgstr "" +"فعلاً، اجازه دهید از این مسئله اجتناب کنیم: راه‌اندازی مکرر را با پرتاب " +":py:exc:`ImportError` مسدود خواهیم کرد::" msgid "" "static PyObject *SpamError = NULL;\n" @@ -246,21 +558,95 @@ msgid "" " return PyModuleDef_Init(&spam_module);\n" "}" msgstr "" +"static PyObject *SpamError = NULL;\n" +"\n" +"static int\n" +"spam_module_exec(PyObject *m)\n" +"{\n" +" if (SpamError != NULL) {\n" +" PyErr_SetString(PyExc_ImportError,\n" +" \"cannot initialize spam module more than once\");\n" +" return -1;\n" +" }\n" +" SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n" +" if (PyModule_AddObjectRef(m, \"SpamError\", SpamError) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot spam_module_slots[] = {\n" +" {Py_mod_exec, spam_module_exec},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static struct PyModuleDef spam_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"spam\",\n" +" .m_size = 0, // non-negative\n" +" .m_slots = spam_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModuleDef_Init(&spam_module);\n" +"}" -msgid "Note that the Python name for the exception object is :exc:`!spam.error`. The :c:func:`PyErr_NewException` function may create a class with the base class being :exc:`Exception` (unless another class is passed in instead of ``NULL``), described in :ref:`bltin-exceptions`." +msgid "" +"Note that the Python name for the exception object is :exc:`!spam.error`. " +"The :c:func:`PyErr_NewException` function may create a class with the base " +"class being :exc:`Exception` (unless another class is passed in instead of " +"``NULL``), described in :ref:`bltin-exceptions`." msgstr "" +"توجه داشته باشید که نام پایتونی شیء استثنا :exc:`!spam.error` است. تابع " +":c:func:`PyErr_NewException` می‌تواند کلاسی ایجاد کند که کلاس پایه‌ی آن " +":exc:`Exception` باشد (مگر اینکه کلاس دیگری به جای ``NULL`` ارسال شود)؛ این " +"کلاس پایه در :ref:`bltin-exceptions` توصیف شده است." -msgid "Note also that the :c:data:`!SpamError` variable retains a reference to the newly created exception class; this is intentional! Since the exception could be removed from the module by external code, an owned reference to the class is needed to ensure that it will not be discarded, causing :c:data:`!SpamError` to become a dangling pointer. Should it become a dangling pointer, C code which raises the exception could cause a core dump or other unintended side effects." -msgstr "" +msgid "" +"Note also that the :c:data:`!SpamError` variable retains a reference to the " +"newly created exception class; this is intentional! Since the exception " +"could be removed from the module by external code, an owned reference to the" +" class is needed to ensure that it will not be discarded, causing " +":c:data:`!SpamError` to become a dangling pointer. Should it become a " +"dangling pointer, C code which raises the exception could cause a core dump " +"or other unintended side effects." +msgstr "" +"همچنین توجه داشته باشید که متغیر :c:data:`!SpamError` ارجاعی به کلاس استثنای" +" به‌تازگی ایجادشده را نگه می‌دارد؛ این کار عمدی است! از آنجا که ممکن است کد " +"خارجی استثنا را از ماژول حذف کند، به یک ارجاع مالکانه (owned reference) به " +"کلاس نیاز است تا اطمینان حاصل شود که کلاس دور انداخته نمی‌شود و در نتیجه " +":c:data:`!SpamError` به اشاره‌گر سرگردان (dangling pointer) تبدیل نمی‌شود. " +"اگر این اشاره‌گر سرگردان شود، کد C که استثنا را برمی‌انگیزد ممکن است باعث " +"برون‌ریزی هسته (core dump) یا سایر اثرات جانبی ناخواسته شود." -msgid "For now, the :c:func:`Py_DECREF` call to remove this reference is missing. Even when the Python interpreter shuts down, the global :c:data:`!SpamError` variable will not be garbage-collected. It will \"leak\". We did, however, ensure that this will happen at most once per process." +msgid "" +"For now, the :c:func:`Py_DECREF` call to remove this reference is missing. " +"Even when the Python interpreter shuts down, the global :c:data:`!SpamError`" +" variable will not be garbage-collected. It will \"leak\". We did, however, " +"ensure that this will happen at most once per process." msgstr "" +"در حال حاضر، فراخوانی :c:func:`Py_DECREF` برای حذف این ارجاع وجود ندارد. حتی" +" هنگام خاموش شدن مفسر پایتون، متغیر سراسری :c:data:`!SpamError` زباله‌روبی " +"نخواهد شد. این متغیر «نشت» خواهد کرد. با این حال، اطمینان حاصل کردیم که این " +"اتفاق حداکثر یک بار به ازای هر فرایند رخ خواهد داد." -msgid "We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type later in this sample." +msgid "" +"We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " +"later in this sample." msgstr "" +"استفاده از :c:macro:`PyMODINIT_FUNC` به‌عنوان نوع بازگشتی تابع را در ادامه‌ی" +" این نمونه بحث می‌کنیم." -msgid "The :exc:`!spam.error` exception can be raised in your extension module using a call to :c:func:`PyErr_SetString` as shown below::" +msgid "" +"The :exc:`!spam.error` exception can be raised in your extension module " +"using a call to :c:func:`PyErr_SetString` as shown below::" msgstr "" +"می‌توانید استثنای :exc:`!spam.error` را در ماژول توسعه‌ای خود با فراخوانی " +":c:func:`PyErr_SetString` ایجاد کنید، همان‌طور که در ادامه نشان داده شده " +"است::" msgid "" "static PyObject *\n" @@ -279,52 +665,121 @@ msgid "" " return PyLong_FromLong(sts);\n" "}" msgstr "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" if (sts < 0) {\n" +" PyErr_SetString(SpamError, \"System command failed\");\n" +" return NULL;\n" +" }\n" +" return PyLong_FromLong(sts);\n" +"}" msgid "Back to the Example" -msgstr "" +msgstr "بازگشت به مثال" -msgid "Going back to our example function, you should now be able to understand this statement::" +msgid "" +"Going back to our example function, you should now be able to understand " +"this statement::" msgstr "" +"با بازگشت به تابع مثال خودمان، اکنون باید بتوانید این دستور را درک کنید::" msgid "" "if (!PyArg_ParseTuple(args, \"s\", &command))\n" " return NULL;" msgstr "" +"if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;" -msgid "It returns ``NULL`` (the error indicator for functions returning object pointers) if an error is detected in the argument list, relying on the exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of the argument has been copied to the local variable :c:data:`!command`. This is a pointer assignment and you are not supposed to modify the string to which it points (so in Standard C, the variable :c:data:`!command` should properly be declared as ``const char *command``)." -msgstr "" +msgid "" +"It returns ``NULL`` (the error indicator for functions returning object " +"pointers) if an error is detected in the argument list, relying on the " +"exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of " +"the argument has been copied to the local variable :c:data:`!command`. This" +" is a pointer assignment and you are not supposed to modify the string to " +"which it points (so in Standard C, the variable :c:data:`!command` should " +"properly be declared as ``const char *command``)." +msgstr "" +"در صورت تشخیص خطا در فهرست آرگومان‌ها، این تابع ``NULL`` (نشانگر خطا برای " +"توابعی که اشاره‌گر شیء برمی‌گردانند) را برمی‌گرداند و به استثنای تنظیم‌شده " +"توسط :c:func:`PyArg_ParseTuple` تکیه می‌کند. در غیر این صورت، مقدار رشته‌ی " +"آرگومان به متغیر محلی :c:data:`!command` کپی شده است. این یک انتساب اشاره‌گر" +" است و شما نباید رشته‌ای را که به آن اشاره می‌کند تغییر دهید (بنابراین در C " +"استاندارد، متغیر :c:data:`!command` باید به‌درستی به‌صورت ``const char " +"*command`` اعلان شود)." -msgid "The next statement is a call to the Unix function :c:func:`system`, passing it the string we just got from :c:func:`PyArg_ParseTuple`::" +msgid "" +"The next statement is a call to the Unix function :c:func:`system`, passing " +"it the string we just got from :c:func:`PyArg_ParseTuple`::" msgstr "" +"دستور بعدی، تابع یونیکسی :c:func:`system` را فراخوانی می‌کند و رشته‌ای را که" +" به‌تازگی از :c:func:`PyArg_ParseTuple` دریافت کرده‌ایم به آن پاس می‌دهد::" msgid "sts = system(command);" -msgstr "" +msgstr "sts = system(command);" -msgid "Our :func:`!spam.system` function must return the value of :c:data:`!sts` as a Python object. This is done using the function :c:func:`PyLong_FromLong`. ::" +msgid "" +"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as" +" a Python object. This is done using the function " +":c:func:`PyLong_FromLong`. ::" msgstr "" +"تابع :func:`!spam.system` ما باید مقدار :c:data:`!sts` را به‌عنوان یک شیء " +"پایتون بازگرداند. این کار با استفاده از تابع :c:func:`PyLong_FromLong` انجام" +" می‌شود. ::" msgid "return PyLong_FromLong(sts);" -msgstr "" +msgstr "return PyLong_FromLong(sts);" -msgid "In this case, it will return an integer object. (Yes, even integers are objects on the heap in Python!)" +msgid "" +"In this case, it will return an integer object. (Yes, even integers are " +"objects on the heap in Python!)" msgstr "" +"در این حالت، یک شیء عدد صحیح را برمی‌گرداند. (بله، در پایتون حتی اعداد صحیح " +"هم اشیایی روی هیپ هستند!)" -msgid "If you have a C function that returns no useful argument (a function returning :c:expr:`void`), the corresponding Python function must return ``None``. You need this idiom to do so (which is implemented by the :c:macro:`Py_RETURN_NONE` macro)::" +msgid "" +"If you have a C function that returns no useful argument (a function " +"returning :c:expr:`void`), the corresponding Python function must return " +"``None``. You need this idiom to do so (which is implemented by the " +":c:macro:`Py_RETURN_NONE` macro)::" msgstr "" +"اگر تابعی در C داشته باشید که هیچ آرگومان مفیدی برنمی‌گرداند (تابعی که " +":c:expr:`void` برمی‌گرداند)، تابع پایتونِ متناظر باید ``None`` را برگرداند." +" برای انجام این کار به این اصطلاح نیاز دارید (که توسط ماکروی " +":c:macro:`Py_RETURN_NONE` پیاده‌سازی شده است)::" msgid "" "Py_INCREF(Py_None);\n" "return Py_None;" msgstr "" +"Py_INCREF(Py_None);\n" +"return Py_None;" -msgid ":c:data:`Py_None` is the C name for the special Python object ``None``. It is a genuine Python object rather than a ``NULL`` pointer, which means \"error\" in most contexts, as we have seen." +msgid "" +":c:data:`Py_None` is the C name for the special Python object ``None``. It " +"is a genuine Python object rather than a ``NULL`` pointer, which means " +"\"error\" in most contexts, as we have seen." msgstr "" +":c:data:`Py_None` نام C برای شیء ویژه‌ی پایتون ``None`` است. این یک شیء " +"واقعی پایتون است، نه یک اشاره‌گر ``NULL`` که همان‌طور که دیدیم، در بیشتر " +"زمینه‌ها به معنای «خطا» است." msgid "The Module's Method Table and Initialization Function" -msgstr "" +msgstr "جدول متدهای ماژول و تابع مقدار‌دهی اولیه" -msgid "I promised to show how :c:func:`!spam_system` is called from Python programs. First, we need to list its name and address in a \"method table\"::" +msgid "" +"I promised to show how :c:func:`!spam_system` is called from Python " +"programs. First, we need to list its name and address in a \"method " +"table\"::" msgstr "" +"قول داده بودم که نشان دهم :c:func:`!spam_system` چگونه از برنامه‌های پایتون " +"فراخوانی می‌شود. ابتدا، باید نام و نشانی آن را در یک «جدول متد» فهرست کنیم::" msgid "" "static PyMethodDef spam_methods[] = {\n" @@ -335,18 +790,54 @@ msgid "" " {NULL, NULL, 0, NULL} /* Sentinel */\n" "};" msgstr "" +"static PyMethodDef spam_methods[] = {\n" +" ...\n" +" {\"system\", spam_system, METH_VARARGS,\n" +" \"Execute a shell command.\"},\n" +" ...\n" +" {NULL, NULL, 0, NULL} /* Sentinel */\n" +"};" -msgid "Note the third entry (``METH_VARARGS``). This is a flag telling the interpreter the calling convention to be used for the C function. It should normally always be ``METH_VARARGS`` or ``METH_VARARGS | METH_KEYWORDS``; a value of ``0`` means that an obsolete variant of :c:func:`PyArg_ParseTuple` is used." -msgstr "" +msgid "" +"Note the third entry (``METH_VARARGS``). This is a flag telling the " +"interpreter the calling convention to be used for the C function. It should" +" normally always be ``METH_VARARGS`` or ``METH_VARARGS | METH_KEYWORDS``; a " +"value of ``0`` means that an obsolete variant of :c:func:`PyArg_ParseTuple` " +"is used." +msgstr "" +"به ورودی سوم (``METH_VARARGS``) توجه کنید. این یک پرچم است که به مفسر اعلام " +"می‌کند از کدام قرارداد فراخوانی برای تابع C استفاده شود. این پرچم معمولاً " +"همیشه باید ``METH_VARARGS`` یا ``METH_VARARGS | METH_KEYWORDS`` باشد؛ مقدار " +"``0`` به این معنی است که گونه‌ی منسوخی از :c:func:`PyArg_ParseTuple` به کار " +"می‌رود." -msgid "When using only ``METH_VARARGS``, the function should expect the Python-level parameters to be passed in as a tuple acceptable for parsing via :c:func:`PyArg_ParseTuple`; more information on this function is provided below." +msgid "" +"When using only ``METH_VARARGS``, the function should expect the Python-" +"level parameters to be passed in as a tuple acceptable for parsing via " +":c:func:`PyArg_ParseTuple`; more information on this function is provided " +"below." msgstr "" +"هنگام استفاده‌ی تنها از ``METH_VARARGS``، تابع باید انتظار داشته باشد که " +"پارامترهای سطح پایتون به‌صورت تاپلی مناسب برای پارس کردن توسط " +":c:func:`PyArg_ParseTuple` ارسال شوند؛ اطلاعات بیشتر درباره‌ی این تابع در " +"ادامه ارائه شده است." -msgid "The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword arguments should be passed to the function. In this case, the C function should accept a third ``PyObject *`` parameter which will be a dictionary of keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments to such a function." -msgstr "" +msgid "" +"The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " +"arguments should be passed to the function. In this case, the C function " +"should accept a third ``PyObject *`` parameter which will be a dictionary of" +" keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " +"to such a function." +msgstr "" +"اگر قرار است آرگومان‌های کلیدواژه‌ای به تابع ارسال شوند، می‌توان بیت " +":c:macro:`METH_KEYWORDS` را در فیلد سوم تنظیم کرد. در این حالت، تابع C باید " +"پارامتر سومی از نوع ``PyObject *`` را بپذیرد که دیکشنری‌ای از کلیدواژه‌ها " +"خواهد بود. برای پارس کردن آرگومان‌های چنین تابعی، از " +":c:func:`PyArg_ParseTupleAndKeywords` استفاده کنید." -msgid "The method table must be referenced in the module definition structure::" -msgstr "" +msgid "" +"The method table must be referenced in the module definition structure::" +msgstr "جدول متدها باید در ساختار تعریف ماژول ارجاع داده شود::" msgid "" "static struct PyModuleDef spam_module = {\n" @@ -355,9 +846,22 @@ msgid "" " ...\n" "};" msgstr "" +"static struct PyModuleDef spam_module = {\n" +" ...\n" +" .m_methods = spam_methods,\n" +" ...\n" +"};" -msgid "This structure, in turn, must be passed to the interpreter in the module's initialization function. The initialization function must be named :c:func:`!PyInit_name`, where *name* is the name of the module, and should be the only non-\\ ``static`` item defined in the module file::" +msgid "" +"This structure, in turn, must be passed to the interpreter in the module's " +"initialization function. The initialization function must be named " +":c:func:`!PyInit_name`, where *name* is the name of the module, and should " +"be the only non-\\ ``static`` item defined in the module file::" msgstr "" +"این ساختار، به نوبه خود، باید در تابع مقداردهی اولیه‌ی ماژول، به مفسر پاس " +"داده شود. تابع مقداردهی اولیه باید نام :c:func:`!PyInit_name` داشته باشد، که" +" در آن *name* نام ماژول است، و باید تنها آیتم غیر ``static`` تعریف‌شده در " +"پرونده‌ی ماژول باشد::" msgid "" "PyMODINIT_FUNC\n" @@ -366,15 +870,47 @@ msgid "" " return PyModuleDef_Init(&spam_module);\n" "}" msgstr "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModuleDef_Init(&spam_module);\n" +"}" -msgid "Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` return type, declares any special linkage declarations required by the platform, and for C++ declares the function as ``extern \"C\"``." +msgid "" +"Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " +"return type, declares any special linkage declarations required by the " +"platform, and for C++ declares the function as ``extern \"C\"``." msgstr "" +"توجه داشته باشید که :c:macro:`PyMODINIT_FUNC` تابع را با نوع بازگشتی " +"``PyObject *`` اعلام می‌کند، هرگونه اعلان پیوند (linkage) خاص مورد نیاز " +"پلتفرم را اعلام می‌کند و برای C++ تابع را به‌صورت ``extern \"C\"`` اعلام " +"می‌کند." -msgid ":c:func:`!PyInit_spam` is called when each interpreter imports its module :mod:`!spam` for the first time. (See below for comments about embedding Python.) A pointer to the module definition must be returned via :c:func:`PyModuleDef_Init`, so that the import machinery can create the module and store it in ``sys.modules``." -msgstr "" +msgid "" +":c:func:`!PyInit_spam` is called when each interpreter imports its module " +":mod:`!spam` for the first time. (See below for comments about embedding " +"Python.) A pointer to the module definition must be returned via " +":c:func:`PyModuleDef_Init`, so that the import machinery can create the " +"module and store it in ``sys.modules``." +msgstr "" +":c:func:`!PyInit_spam` هنگامی فراخوانی می‌شود که هر مفسر، ماژول :mod:`!spam`" +" خود را برای نخستین بار ایمپورت کند. (برای نکات مربوط به جاسازی پایتون، به " +"ادامه مراجعه کنید.) اشاره‌گری به تعریف ماژول باید از طریق " +":c:func:`PyModuleDef_Init` بازگردانده شود تا سازوکار ایمپورت بتواند ماژول را" +" ایجاد کرده و آن را در ``sys.modules`` ذخیره کند." -msgid "When embedding Python, the :c:func:`!PyInit_spam` function is not called automatically unless there's an entry in the :c:data:`PyImport_Inittab` table. To add the module to the initialization table, use :c:func:`PyImport_AppendInittab`, optionally followed by an import of the module::" -msgstr "" +msgid "" +"When embedding Python, the :c:func:`!PyInit_spam` function is not called " +"automatically unless there's an entry in the :c:data:`PyImport_Inittab` " +"table. To add the module to the initialization table, use " +":c:func:`PyImport_AppendInittab`, optionally followed by an import of the " +"module::" +msgstr "" +"هنگام تعبیه (embedding) پایتون، تابع :c:func:`!PyInit_spam` به‌طور خودکار " +"فراخوانی نمی‌شود، مگر آنکه ورودی‌ای در جدول :c:data:`PyImport_Inittab` وجود " +"داشته باشد. برای افزودن ماژول به جدول مقداردهی اولیه، از " +":c:func:`PyImport_AppendInittab` استفاده کنید و در صورت تمایل، ماژول را " +"ایمپورت کنید::" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -425,45 +961,188 @@ msgid "" " Py_ExitStatusException(status);\n" "}" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Add a built-in module, before Py_Initialize */\n" +" if (PyImport_AppendInittab(\"spam\", PyInit_spam) == -1) {\n" +" fprintf(stderr, \"Error: could not extend in-built modules table\\n\");\n" +" exit(1);\n" +" }\n" +"\n" +" /* Pass argv[0] to the Python interpreter */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" /* Initialize the Python interpreter. Required.\n" +" If this step fails, it will be a fatal error. */\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" /* Optionally import the module; alternatively,\n" +" import can be deferred until the embedded script\n" +" imports it. */\n" +" PyObject *pmodule = PyImport_ImportModule(\"spam\");\n" +" if (!pmodule) {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Error: could not import module 'spam'\\n\");\n" +" }\n" +"\n" +" // ... use Python C API here ...\n" +"\n" +" return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" -msgid "If you declare a global variable or a local static one, the module may experience unintended side-effects on re-initialisation, for example when removing entries from ``sys.modules`` or importing compiled modules into multiple interpreters within a process (or following a :c:func:`fork` without an intervening :c:func:`exec`). If module state is not yet fully :ref:`isolated `, authors should consider marking the module as having no support for subinterpreters (via :c:macro:`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." -msgstr "" +msgid "" +"If you declare a global variable or a local static one, the module may " +"experience unintended side-effects on re-initialisation, for example when " +"removing entries from ``sys.modules`` or importing compiled modules into " +"multiple interpreters within a process (or following a :c:func:`fork` " +"without an intervening :c:func:`exec`). If module state is not yet fully " +":ref:`isolated `, authors should consider " +"marking the module as having no support for subinterpreters (via " +":c:macro:`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." +msgstr "" +"اگر یک متغیر سراسری یا یک متغیر ایستای محلی تعریف کنید، ماژول ممکن است هنگام" +" مقداردهی مجدد دچار عوارض جانبی ناخواسته شود، برای مثال هنگام حذف ورودی‌ها " +"از ``sys.modules`` یا ایمپورت کردن ماژول‌های کامپایل‌شده در چندین مفسر درون " +"یک فرایند (یا پس از یک :c:func:`fork` بدون :c:func:`exec` در میان). اگر " +"وضعیت ماژول هنوز به‌طور کامل :ref:`جداسازی‌شده `" +" نباشد، نویسندگان باید در نظر بگیرند که ماژول را به‌عنوان فاقد پشتیبانی از " +"زیرمفسرها علامت‌گذاری کنند (از طریق " +":c:macro:`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." -msgid "A more substantial example module is included in the Python source distribution as :file:`Modules/xxlimited.c`. This file may be used as a template or simply read as an example." +msgid "" +"A more substantial example module is included in the Python source " +"distribution as :file:`Modules/xxlimited.c`. This file may be used as a " +"template or simply read as an example." msgstr "" +"یک ماژول نمونه‌ی جامع‌تر در توزیع کد منبع پایتون به‌صورت " +":file:`Modules/xxlimited.c` گنجانده شده است. می‌توان از این پرونده به‌عنوان " +"یک قالب استفاده کرد یا صرفاً آن را به‌عنوان مثال خواند." msgid "Compilation and Linkage" -msgstr "" +msgstr "کامپایل و پیونددهی (linkage)" -msgid "There are two more things to do before you can use your new extension: compiling and linking it with the Python system. If you use dynamic loading, the details may depend on the style of dynamic loading your system uses; see the chapters about building extension modules (chapter :ref:`building`) and additional information that pertains only to building on Windows (chapter :ref:`building-on-windows`) for more information about this." -msgstr "" +msgid "" +"There are two more things to do before you can use your new extension: " +"compiling and linking it with the Python system. If you use dynamic " +"loading, the details may depend on the style of dynamic loading your system " +"uses; see the chapters about building extension modules (chapter " +":ref:`building`) and additional information that pertains only to building " +"on Windows (chapter :ref:`building-on-windows`) for more information about " +"this." +msgstr "" +"پیش از آنکه بتوانید از ماژول توسعه‌ای جدید خود استفاده کنید، باید دو کار " +"دیگر انجام دهید: کامپایل کردن و پیوند دادن آن با سیستم پایتون. اگر از " +"بارگذاری پویا استفاده کنید، جزئیات ممکن است به سبک بارگذاری پویایی که سیستم " +"شما از آن استفاده می‌کند بستگی داشته باشد؛ برای اطلاعات بیشتر درباره‌ی این " +"موضوع، به فصل‌های مربوط به ساخت ماژول‌های توسعه‌ای (فصل :ref:`building`) و " +"اطلاعات تکمیلی‌ای که تنها به ساخت روی ویندوز مربوط می‌شود (فصل " +":ref:`building-on-windows`) مراجعه کنید." -msgid "If you can't use dynamic loading, or if you want to make your module a permanent part of the Python interpreter, you will have to change the configuration setup and rebuild the interpreter. Luckily, this is very simple on Unix: just place your file (:file:`spammodule.c` for example) in the :file:`Modules/` directory of an unpacked source distribution, add a line to the file :file:`Modules/Setup.local` describing your file:" -msgstr "" +msgid "" +"If you can't use dynamic loading, or if you want to make your module a " +"permanent part of the Python interpreter, you will have to change the " +"configuration setup and rebuild the interpreter. Luckily, this is very " +"simple on Unix: just place your file (:file:`spammodule.c` for example) in " +"the :file:`Modules/` directory of an unpacked source distribution, add a " +"line to the file :file:`Modules/Setup.local` describing your file:" +msgstr "" +"اگر نتوانید از بارگذاری پویا استفاده کنید، یا اگر می‌خواهید ماژول خود را به " +"بخشی دائمی از مفسر پایتون تبدیل کنید، باید تنظیمات پیکربندی را تغییر دهید و " +"مفسر را بازسازی کنید. خوشبختانه، این کار در یونیکس بسیار ساده است: کافی است " +"پرونده‌ی خود (برای مثال :file:`spammodule.c`) را در پوشه‌ی :file:`Modules/` " +"یک توزیع کد منبعِ استخراج‌شده قرار دهید، و سطری به پرونده‌ی " +":file:`Modules/Setup.local` اضافه کنید که پرونده‌ی شما را توصیف کند:" msgid "spam spammodule.o" -msgstr "" +msgstr "spam spammodule.o" -msgid "and rebuild the interpreter by running :program:`make` in the toplevel directory. You can also run :program:`make` in the :file:`Modules/` subdirectory, but then you must first rebuild :file:`Makefile` there by running ':program:`make` Makefile'. (This is necessary each time you change the :file:`Setup` file.)" -msgstr "" +msgid "" +"and rebuild the interpreter by running :program:`make` in the toplevel " +"directory. You can also run :program:`make` in the :file:`Modules/` " +"subdirectory, but then you must first rebuild :file:`Makefile` there by " +"running ':program:`make` Makefile'. (This is necessary each time you change" +" the :file:`Setup` file.)" +msgstr "" +"و مفسر را با اجرای :program:`make` در پوشه‌ی سطح بالا بازسازی کنید. همچنین " +"می‌توانید :program:`make` را در زیرپوشه‌ی :file:`Modules/` اجرا کنید، اما در" +" این صورت باید ابتدا :file:`Makefile` را در آنجا با اجرای ':program:`make` " +"Makefile' بازسازی کنید. (این کار هر بار که پرونده‌ی :file:`Setup` را تغییر " +"می‌دهید، ضروری است.)" -msgid "If your module requires additional libraries to link with, these can be listed on the line in the configuration file as well, for instance:" +msgid "" +"If your module requires additional libraries to link with, these can be " +"listed on the line in the configuration file as well, for instance:" msgstr "" +"اگر ماژول شما به کتابخانه‌های اضافی برای پیوند دادن نیاز دارد، می‌توانید " +"آن‌ها را نیز در همان سطر در پرونده پیکربندی فهرست کنید، برای مثال:" msgid "spam spammodule.o -lX11" -msgstr "" +msgstr "spam spammodule.o -lX11" msgid "Calling Python Functions from C" -msgstr "" +msgstr "فراخوانی توابع پایتون از زبان C" -msgid "So far we have concentrated on making C functions callable from Python. The reverse is also useful: calling Python functions from C. This is especially the case for libraries that support so-called \"callback\" functions. If a C interface makes use of callbacks, the equivalent Python often needs to provide a callback mechanism to the Python programmer; the implementation will require calling the Python callback functions from a C callback. Other uses are also imaginable." -msgstr "" +msgid "" +"So far we have concentrated on making C functions callable from Python. The" +" reverse is also useful: calling Python functions from C. This is especially" +" the case for libraries that support so-called \"callback\" functions. If a" +" C interface makes use of callbacks, the equivalent Python often needs to " +"provide a callback mechanism to the Python programmer; the implementation " +"will require calling the Python callback functions from a C callback. Other" +" uses are also imaginable." +msgstr "" +"تا اینجا بر فراخوانی‌پذیر کردن توابع C از پایتون تمرکز کرده‌ایم. حالت معکوس " +"نیز کاربردی است: فراخوانی توابع پایتون از C. این موضوع به‌ویژه در مورد " +"کتابخانه‌هایی که از توابعی به اصطلاح «کال‌بک» پشتیبانی می‌کنند صادق است. اگر" +" یک رابط C از کال‌بک‌ها استفاده کند، معادل پایتونی آن اغلب نیاز دارد که " +"سازوکار کال‌بکی را در اختیار برنامه‌نویس پایتون قرار دهد؛ پیاده‌سازی این کار" +" مستلزم فراخوانی توابع کال‌بک پایتون از یک کال‌بک C خواهد بود. کاربردهای " +"دیگری نیز قابل تصور است." -msgid "Fortunately, the Python interpreter is easily called recursively, and there is a standard interface to call a Python function. (If you're interested in how to call the Python parser with a particular string as input, see :ref:`veryhigh`.)" +msgid "" +"Fortunately, the Python interpreter is easily called recursively, and there " +"is a standard interface to call a Python function. (If you're interested in" +" how to call the Python parser with a particular string as input, see " +":ref:`veryhigh`.)" msgstr "" +"خوشبختانه، مفسر پایتون به‌راحتی به‌صورت بازگشتی فراخوانی می‌شود و یک رابط " +"استاندارد برای فراخوانی یک تابع پایتون وجود دارد. (اگر می‌خواهید بدانید " +"چگونه می‌توان پارسر پایتون را با یک رشته خاص به‌عنوان ورودی فراخوانی کرد، به" +" :ref:`veryhigh` مراجعه کنید.)" -msgid "Calling a Python function is easy. First, the Python program must somehow pass you the Python function object. You should provide a function (or some other interface) to do this. When this function is called, save a pointer to the Python function object (be careful to :c:func:`Py_INCREF` it!) in a global variable --- or wherever you see fit. For example, the following function might be part of a module definition::" -msgstr "" +msgid "" +"Calling a Python function is easy. First, the Python program must somehow " +"pass you the Python function object. You should provide a function (or some" +" other interface) to do this. When this function is called, save a pointer " +"to the Python function object (be careful to :c:func:`Py_INCREF` it!) in a " +"global variable --- or wherever you see fit. For example, the following " +"function might be part of a module definition::" +msgstr "" +"فراخوانی یک تابع پایتون آسان است. نخست، برنامه پایتون باید به نحوی شیء تابع " +"پایتون را به شما پاس دهد. شما باید تابعی (یا رابط دیگری) برای انجام این کار " +"فراهم کنید. وقتی این تابع فراخوانی شد، اشاره‌گری به شیء تابع پایتون را " +"(مراقب باشید که آن را :c:func:`Py_INCREF` کنید!) در یک متغیر سراسری --- یا " +"هر جای دیگری که صلاح می‌دانید --- ذخیره کنید. برای مثال، تابع زیر ممکن است " +"بخشی از تعریف یک ماژول باشد::" msgid "" "static PyObject *my_callback = NULL;\n" @@ -489,15 +1168,69 @@ msgid "" " return result;\n" "}" msgstr "" - -msgid "This function must be registered with the interpreter using the :c:macro:`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :c:func:`PyArg_ParseTuple` function and its arguments are documented in section :ref:`parsetuple`." -msgstr "" - -msgid "The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement the reference count of an object and are safe in the presence of ``NULL`` pointers (but note that *temp* will not be ``NULL`` in this context). More info on them in section :ref:`refcounts`." -msgstr "" - -msgid "Later, when it is time to call the function, you call the C function :c:func:`PyObject_CallObject`. This function has two arguments, both pointers to arbitrary Python objects: the Python function, and the argument list. The argument list must always be a tuple object, whose length is the number of arguments. To call the Python function with no arguments, pass in ``NULL``, or an empty tuple; to call it with one argument, pass a singleton tuple. :c:func:`Py_BuildValue` returns a tuple when its format string consists of zero or more format codes between parentheses. For example::" +"static PyObject *my_callback = NULL;\n" +"\n" +"static PyObject *\n" +"my_set_callback(PyObject *dummy, PyObject *args)\n" +"{\n" +" PyObject *result = NULL;\n" +" PyObject *temp;\n" +"\n" +" if (PyArg_ParseTuple(args, \"O:set_callback\", &temp)) {\n" +" if (!PyCallable_Check(temp)) {\n" +" PyErr_SetString(PyExc_TypeError, \"parameter must be callable\");\n" +" return NULL;\n" +" }\n" +" Py_XINCREF(temp); /* Add a reference to new callback */\n" +" Py_XDECREF(my_callback); /* Dispose of previous callback */\n" +" my_callback = temp; /* Remember new callback */\n" +" /* Boilerplate to return \"None\" */\n" +" Py_INCREF(Py_None);\n" +" result = Py_None;\n" +" }\n" +" return result;\n" +"}" + +msgid "" +"This function must be registered with the interpreter using the " +":c:macro:`METH_VARARGS` flag; this is described in section " +":ref:`methodtable`. The :c:func:`PyArg_ParseTuple` function and its " +"arguments are documented in section :ref:`parsetuple`." +msgstr "" +"این تابع باید با استفاده از پرچم :c:macro:`METH_VARARGS` در مفسر ثبت شود؛ " +"این موضوع در بخش :ref:`methodtable` توضیح داده شده است. تابع " +":c:func:`PyArg_ParseTuple` و آرگومان‌های آن در بخش :ref:`parsetuple` " +"مستندسازی شده‌اند." + +msgid "" +"The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement" +" the reference count of an object and are safe in the presence of ``NULL`` " +"pointers (but note that *temp* will not be ``NULL`` in this context). More" +" info on them in section :ref:`refcounts`." msgstr "" +"ماکروهای :c:func:`Py_XINCREF` و :c:func:`Py_XDECREF` شمارش ارجاع یک شیء را " +"افزایش/کاهش می‌دهند و در صورت وجود اشاره‌گرهای ``NULL`` ایمن هستند (اما توجه" +" داشته باشید که *temp* در این زمینه ``NULL`` نخواهد بود). اطلاعات بیشتر " +"درباره‌ی آن‌ها در بخش :ref:`refcounts` آمده است." + +msgid "" +"Later, when it is time to call the function, you call the C function " +":c:func:`PyObject_CallObject`. This function has two arguments, both " +"pointers to arbitrary Python objects: the Python function, and the argument " +"list. The argument list must always be a tuple object, whose length is the " +"number of arguments. To call the Python function with no arguments, pass in" +" ``NULL``, or an empty tuple; to call it with one argument, pass a singleton" +" tuple. :c:func:`Py_BuildValue` returns a tuple when its format string " +"consists of zero or more format codes between parentheses. For example::" +msgstr "" +"بعداً، وقتی زمان فراخوانی تابع فرا می‌رسد، شما تابع Cِ " +":c:func:`PyObject_CallObject` را فراخوانی می‌کنید. این تابع دو آرگومان دارد " +"که هر دو اشاره‌گر به اشیاء پایتونی دلخواه هستند: تابع پایتونی و فهرست " +"آرگومان‌ها. فهرست آرگومان‌ها باید همیشه یک شیء تاپل باشد که طول آن برابر با " +"تعداد آرگومان‌هاست. برای فراخوانی تابع پایتونی بدون هیچ آرگومانی، ``NULL`` " +"یا یک تاپل خالی را ارسال کنید؛ برای فراخوانی آن با یک آرگومان، یک تاپل " +"تک‌نمونه ارسال کنید. :c:func:`Py_BuildValue` زمانی که رشته قالب آن از صفر یا" +" چند کد قالب درون پرانتز تشکیل شده باشد، یک تاپل برمی‌گرداند. برای مثال::" msgid "" "int arg;\n" @@ -511,15 +1244,61 @@ msgid "" "result = PyObject_CallObject(my_callback, arglist);\n" "Py_DECREF(arglist);" msgstr "" +"int arg;\n" +"PyObject *arglist;\n" +"PyObject *result;\n" +"...\n" +"arg = 123;\n" +"...\n" +"/* Time to call the callback */\n" +"arglist = Py_BuildValue(\"(i)\", arg);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);" -msgid ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the return value of the Python function. :c:func:`PyObject_CallObject` is \"reference-count-neutral\" with respect to its arguments. In the example a new tuple was created to serve as the argument list, which is :c:func:`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call." -msgstr "" +msgid "" +":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " +"return value of the Python function. :c:func:`PyObject_CallObject` is " +"\"reference-count-neutral\" with respect to its arguments. In the example a" +" new tuple was created to serve as the argument list, which is " +":c:func:`Py_DECREF`\\ -ed immediately after the " +":c:func:`PyObject_CallObject` call." +msgstr "" +":c:func:`PyObject_CallObject` یک اشاره‌گر به شیء پایتون برمی‌گرداند: این " +"همان مقدار بازگشتی تابع پایتون است. :c:func:`PyObject_CallObject` نسبت به " +"آرگومان‌های خود، از نظر شمارش ارجاع خنثی (reference-count-neutral) است. در " +"این مثال، یک تاپل جدید برای استفاده به‌عنوان فهرست آرگومان‌ها ساخته می‌شود " +"که بلافاصله پس از فراخوانی :c:func:`PyObject_CallObject`، " +":c:func:`Py_DECREF` روی آن اعمال می‌شود." -msgid "The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a brand new object, or it is an existing object whose reference count has been incremented. So, unless you want to save it in a global variable, you should somehow :c:func:`Py_DECREF` the result, even (especially!) if you are not interested in its value." -msgstr "" +msgid "" +"The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a" +" brand new object, or it is an existing object whose reference count has " +"been incremented. So, unless you want to save it in a global variable, you " +"should somehow :c:func:`Py_DECREF` the result, even (especially!) if you are" +" not interested in its value." +msgstr "" +"مقدار بازگشتی :c:func:`PyObject_CallObject` «جدید» است: یا شیئی کاملاً جدید " +"است، یا شیئی موجود است که شمارش ارجاع آن افزایش یافته است. بنابراین، مگر " +"آنکه بخواهید آن را در یک متغیر سراسری ذخیره کنید، باید به نحوی نتیجه را " +":c:func:`Py_DECREF` کنید، حتی (به‌ویژه!) اگر علاقه‌ای به مقدار آن نداشته " +"باشید." -msgid "Before you do this, however, it is important to check that the return value isn't ``NULL``. If it is, the Python function terminated by raising an exception. If the C code that called :c:func:`PyObject_CallObject` is called from Python, it should now return an error indication to its Python caller, so the interpreter can print a stack trace, or the calling Python code can handle the exception. If this is not possible or desirable, the exception should be cleared by calling :c:func:`PyErr_Clear`. For example::" -msgstr "" +msgid "" +"Before you do this, however, it is important to check that the return value " +"isn't ``NULL``. If it is, the Python function terminated by raising an " +"exception. If the C code that called :c:func:`PyObject_CallObject` is called" +" from Python, it should now return an error indication to its Python caller," +" so the interpreter can print a stack trace, or the calling Python code can " +"handle the exception. If this is not possible or desirable, the exception " +"should be cleared by calling :c:func:`PyErr_Clear`. For example::" +msgstr "" +"با این حال، پیش از انجام این کار، مهم است که بررسی کنید مقدار بازگشتی " +"``NULL`` نیست. اگر چنین باشد، تابع پایتونی با ایجاد یک استثنا خاتمه یافته " +"است. اگر کد C که :c:func:`PyObject_CallObject` را فراخوانی کرده است از " +"پایتون فراخوانی شده باشد، باید اکنون نشان خطایی را به فراخواننده پایتونی خود" +" بازگرداند تا مفسر بتواند ردگیری پشته را چاپ کند، یا کد پایتونی فراخواننده " +"بتواند استثنا را مدیریت کند. اگر این کار ممکن یا مطلوب نباشد، استثنا باید با" +" فراخوانی :c:func:`PyErr_Clear` پاک شود. برای مثال::" msgid "" "if (result == NULL)\n" @@ -527,9 +1306,30 @@ msgid "" "...use result...\n" "Py_DECREF(result);" msgstr "" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"...use result...\n" +"Py_DECREF(result);" -msgid "Depending on the desired interface to the Python callback function, you may also have to provide an argument list to :c:func:`PyObject_CallObject`. In some cases the argument list is also provided by the Python program, through the same interface that specified the callback function. It can then be saved and used in the same manner as the function object. In other cases, you may have to construct a new tuple to pass as the argument list. The simplest way to do this is to call :c:func:`Py_BuildValue`. For example, if you want to pass an integral event code, you might use the following code::" -msgstr "" +msgid "" +"Depending on the desired interface to the Python callback function, you may " +"also have to provide an argument list to :c:func:`PyObject_CallObject`. In " +"some cases the argument list is also provided by the Python program, through" +" the same interface that specified the callback function. It can then be " +"saved and used in the same manner as the function object. In other cases, " +"you may have to construct a new tuple to pass as the argument list. The " +"simplest way to do this is to call :c:func:`Py_BuildValue`. For example, if" +" you want to pass an integral event code, you might use the following code::" +msgstr "" +"بسته به رابط مورد نظر برای تابع کال‌بک پایتون، ممکن است لازم باشد فهرست " +"آرگومان‌ها را نیز به :c:func:`PyObject_CallObject` ارائه کنید. در برخی " +"موارد، فهرست آرگومان‌ها نیز توسط برنامه پایتون و از طریق همان رابطی که تابع " +"کال‌بک را مشخص کرده بود، فراهم می‌شود. در این صورت می‌توان آن را ذخیره کرد و" +" به همان شیوه‌ی شیء تابع از آن استفاده کرد. در موارد دیگر، ممکن است لازم " +"باشد یک تاپل جدید ایجاد کنید تا آن را به‌عنوان فهرست آرگومان‌ها ارسال کنید. " +"ساده‌ترین راه انجام این کار، فراخوانی :c:func:`Py_BuildValue` است. برای " +"مثال، اگر بخواهید کد رویدادی از نوع عدد صحیح ارسال کنید، ممکن است از کد زیر " +"استفاده کنید::" msgid "" "PyObject *arglist;\n" @@ -542,12 +1342,37 @@ msgid "" "/* Here maybe use the result */\n" "Py_DECREF(result);" msgstr "" +"PyObject *arglist;\n" +"...\n" +"arglist = Py_BuildValue(\"(l)\", eventcode);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);\n" +"if (result == NULL)\n" +" return NULL; /* بازگرداندن خطا */\n" +"/* اینجا شاید از نتیجه استفاده شود */\n" +"Py_DECREF(result);" -msgid "Note the placement of ``Py_DECREF(arglist)`` immediately after the call, before the error check! Also note that strictly speaking this code is not complete: :c:func:`Py_BuildValue` may run out of memory, and this should be checked." +msgid "" +"Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " +"before the error check! Also note that strictly speaking this code is not " +"complete: :c:func:`Py_BuildValue` may run out of memory, and this should be " +"checked." msgstr "" +"به قرارگیری ``Py_DECREF(arglist)`` بلافاصله پس از فراخوانی و پیش از بررسی " +"خطا توجه کنید! همچنین توجه داشته باشید که به‌طور دقیق این کد کامل نیست: ممکن" +" است :c:func:`Py_BuildValue` با کمبود حافظه مواجه شود و این موضوع باید بررسی" +" شود." -msgid "You may also call a function with keyword arguments by using :c:func:`PyObject_Call`, which supports arguments and keyword arguments. As in the above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" +msgid "" +"You may also call a function with keyword arguments by using " +":c:func:`PyObject_Call`, which supports arguments and keyword arguments. As" +" in the above example, we use :c:func:`Py_BuildValue` to construct the " +"dictionary. ::" msgstr "" +"شما همچنین می‌توانید با استفاده از :c:func:`PyObject_Call` که از آرگومان‌ها " +"و آرگومان‌های کلیدواژه‌ای پشتیبانی می‌کند، تابعی را با آرگومان‌های " +"کلیدواژه‌ای فراخوانی کنید. مانند مثال بالا، از :c:func:`Py_BuildValue` برای " +"ساخت دیکشنری استفاده می‌کنیم. ::" msgid "" "PyObject *dict;\n" @@ -560,27 +1385,59 @@ msgid "" "/* Here maybe use the result */\n" "Py_DECREF(result);" msgstr "" +"PyObject *dict;\n" +"...\n" +"dict = Py_BuildValue(\"{s:i}\", \"name\", val);\n" +"result = PyObject_Call(my_callback, NULL, dict);\n" +"Py_DECREF(dict);\n" +"if (result == NULL)\n" +" return NULL; /* بازگرداندن خطا */\n" +"/* اینجا شاید از نتیجه استفاده کنید */\n" +"Py_DECREF(result);" msgid "Extracting Parameters in Extension Functions" -msgstr "" +msgstr "استخراج پارامترها در توابع توسعه‌ای" msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" -msgstr "" +msgstr "تابع :c:func:`PyArg_ParseTuple` به شرح زیر تعریف شده است::" msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" -msgstr "" +msgstr "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" -msgid "The *arg* argument must be a tuple object containing an argument list passed from Python to a C function. The *format* argument must be a format string, whose syntax is explained in :ref:`arg-parsing` in the Python/C API Reference Manual. The remaining arguments must be addresses of variables whose type is determined by the format string." -msgstr "" +msgid "" +"The *arg* argument must be a tuple object containing an argument list passed" +" from Python to a C function. The *format* argument must be a format " +"string, whose syntax is explained in :ref:`arg-parsing` in the Python/C API " +"Reference Manual. The remaining arguments must be addresses of variables " +"whose type is determined by the format string." +msgstr "" +"آرگومان *arg* باید یک شیء تاپل حاوی فهرست آرگومانی باشد که از پایتون به یک " +"تابع C پاس داده می‌شود. آرگومان *format* باید یک رشته قالب باشد که نحو آن " +"در :ref:`arg-parsing` در راهنمای مرجع Python/C API توضیح داده شده است. " +"آرگومان‌های باقی‌مانده باید آدرس‌های متغیرهایی باشند که نوع آن‌ها توسط رشته " +"قالب تعیین می‌شود." -msgid "Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments have the required types, it cannot check the validity of the addresses of C variables passed to the call: if you make mistakes there, your code will probably crash or at least overwrite random bits in memory. So be careful!" +msgid "" +"Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments " +"have the required types, it cannot check the validity of the addresses of C " +"variables passed to the call: if you make mistakes there, your code will " +"probably crash or at least overwrite random bits in memory. So be careful!" msgstr "" +"توجه داشته باشید که هرچند :c:func:`PyArg_ParseTuple` بررسی می‌کند که " +"آرگومان‌های پایتون نوع‌های مورد نیاز را داشته باشند، نمی‌تواند اعتبار " +"نشانی‌های متغیرهای C که به فراخوانی ارسال شده‌اند را بررسی کند: اگر در آنجا " +"اشتباهی کنید، کد شما احتمالاً فروپاشی می‌کند یا دست‌کم بیت‌های تصادفی در " +"حافظه را بازنویسی می‌کند. پس مراقب باشید!" -msgid "Note that any Python object references which are provided to the caller are *borrowed* references; do not decrement their reference count!" +msgid "" +"Note that any Python object references which are provided to the caller are " +"*borrowed* references; do not decrement their reference count!" msgstr "" +"توجه داشته باشید که هر ارجاع به شیء پایتون که در اختیار فراخواننده قرار " +"می‌گیرد، یک ارجاع *امانتی* است؛ شمارش ارجاع آن‌ها را کاهش ندهید!" msgid "Some example calls::" -msgstr "" +msgstr "چند نمونه فراخوانی::" msgid "" "int ok;\n" @@ -592,22 +1449,37 @@ msgid "" "ok = PyArg_ParseTuple(args, \"\"); /* No arguments */\n" " /* Python call: f() */" msgstr "" +"int ok;\n" +"int i, j;\n" +"long k, l;\n" +"const char *s;\n" +"Py_ssize_t size;\n" +"\n" +"ok = PyArg_ParseTuple(args, \"\"); /* No arguments */\n" +" /* Python call: f() */" msgid "" "ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" " /* Possible Python call: f('whoops!') */" msgstr "" +"ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" +" /* Possible Python call: f('whoops!') */" msgid "" "ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string */\n" " /* Possible Python call: f(1, 2, 'three') */" msgstr "" +"ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* دو long و یک رشته */\n" +" /* فراخوانی ممکن پایتون: f(1, 2, 'three') */" msgid "" "ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" " /* A pair of ints and a string, whose size is also returned */\n" " /* Possible Python call: f((1, 2), 'three') */" msgstr "" +"ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" +" /* یک جفت عدد صحیح و یک رشته، که اندازه‌ی آن نیز برگردانده می‌شود */\n" +" /* فراخوانی ممکن پایتون: f((1, 2), 'three') */" msgid "" "{\n" @@ -622,6 +1494,17 @@ msgid "" " f('spam', 'wb', 100000) */\n" "}" msgstr "" +"{\n" +" const char *file;\n" +" const char *mode = \"r\";\n" +" int bufsize = 0;\n" +" ok = PyArg_ParseTuple(args, \"s|si\", &file, &mode, &bufsize);\n" +" /* A string, and optionally another string and an integer */\n" +" /* Possible Python calls:\n" +" f('spam')\n" +" f('spam', 'w')\n" +" f('spam', 'wb', 100000) */\n" +"}" msgid "" "{\n" @@ -633,6 +1516,14 @@ msgid "" " f(((0, 0), (400, 300)), (10, 10)) */\n" "}" msgstr "" +"{\n" +" int left, top, right, bottom, h, v;\n" +" ok = PyArg_ParseTuple(args, \"((ii)(ii))(ii)\",\n" +" &left, &top, &right, &bottom, &h, &v);\n" +" /* A rectangle and a point */\n" +" /* Possible Python call:\n" +" f(((0, 0), (400, 300)), (10, 10)) */\n" +"}" msgid "" "{\n" @@ -642,26 +1533,60 @@ msgid "" " /* Possible Python call: myfunction(1+2j) */\n" "}" msgstr "" +"{\n" +" Py_complex c;\n" +" ok = PyArg_ParseTuple(args, \"D:myfunction\", &c);\n" +" /* a complex, also providing a function name for errors */\n" +" /* Possible Python call: myfunction(1+2j) */\n" +"}" msgid "Keyword Parameters for Extension Functions" -msgstr "" +msgstr "پارامترهای کلیدواژه‌ای برای توابع توسعه‌ای" -msgid "The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" -msgstr "" +msgid "" +"The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" +msgstr "تابع :c:func:`PyArg_ParseTupleAndKeywords` به صورت زیر اعلان می‌شود::" msgid "" "int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" " const char *format, char * const *kwlist, ...);" msgstr "" +"int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" +" const char *format, char * const *kwlist, ...);" -msgid "The *arg* and *format* parameters are identical to those of the :c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of keywords received as the third parameter from the Python runtime. The *kwlist* parameter is a ``NULL``-terminated list of strings which identify the parameters; the names are matched with the type information from *format* from left to right. On success, :c:func:`PyArg_ParseTupleAndKeywords` returns true, otherwise it returns false and raises an appropriate exception." -msgstr "" +msgid "" +"The *arg* and *format* parameters are identical to those of the " +":c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the " +"dictionary of keywords received as the third parameter from the Python " +"runtime. The *kwlist* parameter is a ``NULL``-terminated list of strings " +"which identify the parameters; the names are matched with the type " +"information from *format* from left to right. On success, " +":c:func:`PyArg_ParseTupleAndKeywords` returns true, otherwise it returns " +"false and raises an appropriate exception." +msgstr "" +"پارامتر‌های *arg* و *format* با پارامتر‌های تابع :c:func:`PyArg_ParseTuple` " +"یکسان هستند. پارامتر *kwdict* دیکشنری کلیدواژه‌هایی است که به‌عنوان پارامتر" +" سوم از ران‌تایم پایتون دریافت می‌شود. پارامتر *kwlist* فهرستی از رشته‌هاست" +" که با ``NULL`` پایان می‌یابد و پارامترها را شناسایی می‌کند؛ نام‌ها از چپ به" +" راست با اطلاعات نوع گرفته‌شده از *format* تطبیق داده می‌شوند. در صورت " +"موفقیت، :c:func:`PyArg_ParseTupleAndKeywords` مقدار true را برمی‌گرداند؛ در " +"غیر این صورت مقدار false را برمی‌گرداند و استثنای مناسبی ایجاد می‌کند." -msgid "Nested tuples cannot be parsed when using keyword arguments! Keyword parameters passed in which are not present in the *kwlist* will cause :exc:`TypeError` to be raised." +msgid "" +"Nested tuples cannot be parsed when using keyword arguments! Keyword " +"parameters passed in which are not present in the *kwlist* will cause " +":exc:`TypeError` to be raised." msgstr "" +"تاپل‌های تودرتو هنگام استفاده از آرگومان‌های کلیدواژه‌ای قابل تجزیه نیستند! " +"پارامترهای کلیدواژه‌ای که پاس داده می‌شوند و در *kwlist* وجود ندارند، باعث " +"به‌وجود آمدن :exc:`TypeError` می‌شوند." -msgid "Here is an example module which uses keywords, based on an example by Geoff Philbrick (philbrick@hks.com)::" +msgid "" +"Here is an example module which uses keywords, based on an example by Geoff " +"Philbrick (philbrick@hks.com)::" msgstr "" +"در اینجا یک ماژول نمونه که از کلیدواژه‌ها استفاده می‌کند، بر اساس نمونه‌ای " +"از Geoff Philbrick (philbrick@hks.com) آمده است::" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -711,24 +1636,100 @@ msgid "" " return PyModuleDef_Init(&keywdarg_module);\n" "}" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"static PyObject *\n" +"keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds)\n" +"{\n" +" int voltage;\n" +" const char *state = \"a stiff\";\n" +" const char *action = \"voom\";\n" +" const char *type = \"Norwegian Blue\";\n" +"\n" +" static char *kwlist[] = {\"voltage\", \"state\", \"action\", \"type\", NULL};\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, keywds, \"i|sss\", kwlist,\n" +" &voltage, &state, &action, &type))\n" +" return NULL;\n" +"\n" +" printf(\"-- This parrot wouldn't %s if you put %i Volts through it.\\n\",\n" +" action, voltage);\n" +" printf(\"-- Lovely plumage, the %s -- It's %s!\\n\", type, state);\n" +"\n" +" Py_RETURN_NONE;\n" +"}\n" +"\n" +"static PyMethodDef keywdarg_methods[] = {\n" +" /* The cast of the function is necessary since PyCFunction values\n" +" * only take two PyObject* parameters, and keywdarg_parrot() takes\n" +" * three.\n" +" */\n" +" {\"parrot\", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | METH_KEYWORDS,\n" +" \"Print a lovely skit to standard output.\"},\n" +" {NULL, NULL, 0, NULL} /* sentinel */\n" +"};\n" +"\n" +"static struct PyModuleDef keywdarg_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"keywdarg\",\n" +" .m_size = 0,\n" +" .m_methods = keywdarg_methods,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_keywdarg(void)\n" +"{\n" +" return PyModuleDef_Init(&keywdarg_module);\n" +"}" msgid "Building Arbitrary Values" -msgstr "" +msgstr "ساخت مقادیر دلخواه" -msgid "This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is declared as follows::" +msgid "" +"This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " +"declared as follows::" msgstr "" +"این تابع همتای :c:func:`PyArg_ParseTuple` است. این تابع به صورت زیر اعلان " +"می‌شود::" msgid "PyObject *Py_BuildValue(const char *format, ...);" -msgstr "" +msgstr "PyObject *Py_BuildValue(const char *format, ...);" -msgid "It recognizes a set of format units similar to the ones recognized by :c:func:`PyArg_ParseTuple`, but the arguments (which are input to the function, not output) must not be pointers, just values. It returns a new Python object, suitable for returning from a C function called from Python." +msgid "" +"It recognizes a set of format units similar to the ones recognized by " +":c:func:`PyArg_ParseTuple`, but the arguments (which are input to the " +"function, not output) must not be pointers, just values. It returns a new " +"Python object, suitable for returning from a C function called from Python." msgstr "" +"این تابع مجموعه‌ای از واحدهای قالب (format units) را تشخیص می‌دهد که مشابه " +"واحدهای شناسایی‌شده توسط :c:func:`PyArg_ParseTuple` هستند، اما آرگومان‌ها " +"(که ورودی تابع هستند، نه خروجی آن) نباید اشاره‌گر باشند، بلکه باید فقط مقدار" +" باشند. این تابع یک شیء جدید پایتون برمی‌گرداند که برای بازگرداندن از یک " +"تابع C فراخوانی‌شده از پایتون مناسب است." -msgid "One difference with :c:func:`PyArg_ParseTuple`: while the latter requires its first argument to be a tuple (since Python argument lists are always represented as tuples internally), :c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple only if its format string contains two or more format units. If the format string is empty, it returns ``None``; if it contains exactly one format unit, it returns whatever object is described by that format unit. To force it to return a tuple of size 0 or one, parenthesize the format string." -msgstr "" +msgid "" +"One difference with :c:func:`PyArg_ParseTuple`: while the latter requires " +"its first argument to be a tuple (since Python argument lists are always " +"represented as tuples internally), :c:func:`Py_BuildValue` does not always " +"build a tuple. It builds a tuple only if its format string contains two or " +"more format units. If the format string is empty, it returns ``None``; if it" +" contains exactly one format unit, it returns whatever object is described " +"by that format unit. To force it to return a tuple of size 0 or one, " +"parenthesize the format string." +msgstr "" +"یک تفاوت با :c:func:`PyArg_ParseTuple` این است که در حالی که دومی نیازمند " +"است آرگومان اولش یک تاپل باشد (چرا که فهرست‌های آرگومان پایتون همیشه به صورت" +" داخلی به شکل تاپل نمایش داده می‌شوند)، :c:func:`Py_BuildValue` همیشه یک " +"تاپل نمی‌سازد. این تابع تنها زمانی یک تاپل می‌سازد که رشته قالب‌بندی آن دو " +"واحد قالب‌بندی یا بیشتر داشته باشد. اگر رشته قالب‌بندی خالی باشد، ``None`` " +"برمی‌گرداند؛ اگر دقیقاً یک واحد قالب‌بندی داشته باشد، هر شیئی را که آن واحد " +"قالب‌بندی توصیف می‌کند برمی‌گرداند. برای اینکه آن را وادار کنید یک تاپل با " +"اندازه‌ی ۰ یا ۱ برگرداند، رشته قالب‌بندی را داخل پرانتز قرار دهید." -msgid "Examples (to the left the call, to the right the resulting Python value):" -msgstr "" +msgid "" +"Examples (to the left the call, to the right the resulting Python value):" +msgstr "مثال‌ها (در سمت چپ فراخوانی، در سمت راست مقدار حاصل در پایتون):" msgid "" "Py_BuildValue(\"\") None\n" @@ -749,81 +1750,366 @@ msgid "" "Py_BuildValue(\"((ii)(ii)) (ii)\",\n" " 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" msgstr "" +"Py_BuildValue(\"\") None\n" +"Py_BuildValue(\"i\", 123) 123\n" +"Py_BuildValue(\"iii\", 123, 456, 789) (123, 456, 789)\n" +"Py_BuildValue(\"s\", \"hello\") 'hello'\n" +"Py_BuildValue(\"y\", \"hello\") b'hello'\n" +"Py_BuildValue(\"ss\", \"hello\", \"world\") ('hello', 'world')\n" +"Py_BuildValue(\"s#\", \"hello\", 4) 'hell'\n" +"Py_BuildValue(\"y#\", \"hello\", 4) b'hell'\n" +"Py_BuildValue(\"()\") ()\n" +"Py_BuildValue(\"(i)\", 123) (123,)\n" +"Py_BuildValue(\"(ii)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"(i,i)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"[i,i]\", 123, 456) [123, 456]\n" +"Py_BuildValue(\"{s:i,s:i}\",\n" +" \"abc\", 123, \"def\", 456) {'abc': 123, 'def': 456}\n" +"Py_BuildValue(\"((ii)(ii)) (ii)\",\n" +" 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" msgid "Reference Counts" -msgstr "" +msgstr "شمارش ارجاع" -msgid "In languages like C or C++, the programmer is responsible for dynamic allocation and deallocation of memory on the heap. In C, this is done using the functions :c:func:`malloc` and :c:func:`free`. In C++, the operators ``new`` and ``delete`` are used with essentially the same meaning and we'll restrict the following discussion to the C case." +msgid "" +"In languages like C or C++, the programmer is responsible for dynamic " +"allocation and deallocation of memory on the heap. In C, this is done using" +" the functions :c:func:`malloc` and :c:func:`free`. In C++, the operators " +"``new`` and ``delete`` are used with essentially the same meaning and we'll " +"restrict the following discussion to the C case." msgstr "" +"در زبان‌هایی مانند C یا C++، برنامه‌نویس مسئول تخصیص پویا و آزادسازی حافظه " +"روی هیپ است. در C، این کار با استفاده از توابع :c:func:`malloc` و " +":c:func:`free` انجام می‌شود. در C++، عملگرهای ``new`` و ``delete`` با " +"معنایی اساساً یکسان به کار می‌روند و بحث زیر را به مورد C محدود می‌کنیم." -msgid "Every block of memory allocated with :c:func:`malloc` should eventually be returned to the pool of available memory by exactly one call to :c:func:`free`. It is important to call :c:func:`free` at the right time. If a block's address is forgotten but :c:func:`free` is not called for it, the memory it occupies cannot be reused until the program terminates. This is called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:`free` for a block and then continues to use the block, it creates a conflict with reuse of the block through another :c:func:`malloc` call. This is called :dfn:`using freed memory`. It has the same bad consequences as referencing uninitialized data --- core dumps, wrong results, mysterious crashes." -msgstr "" +msgid "" +"Every block of memory allocated with :c:func:`malloc` should eventually be " +"returned to the pool of available memory by exactly one call to " +":c:func:`free`. It is important to call :c:func:`free` at the right time. " +"If a block's address is forgotten but :c:func:`free` is not called for it, " +"the memory it occupies cannot be reused until the program terminates. This " +"is called a :dfn:`memory leak`. On the other hand, if a program calls " +":c:func:`free` for a block and then continues to use the block, it creates a" +" conflict with reuse of the block through another :c:func:`malloc` call. " +"This is called :dfn:`using freed memory`. It has the same bad consequences " +"as referencing uninitialized data --- core dumps, wrong results, mysterious " +"crashes." +msgstr "" +"هر بلوک حافظه‌ای که با :c:func:`malloc` تخصیص داده‌شده باشد، باید در نهایت " +"از طریق دقیقاً یک فراخوانی :c:func:`free` به استخر حافظه‌ی در دسترس " +"بازگردانده شود. مهم است که :c:func:`free` در زمان مناسب فراخوانی شود. اگر " +"نشانی یک بلوک فراموش شود اما :c:func:`free` برای آن فراخوانی نشود، حافظه‌ای " +"که آن بلوک اشغال کرده است، تا زمانی که برنامه خاتمه یابد، قابل استفاده‌ی " +"مجدد نخواهد بود. این وضعیت :dfn:`نشت حافظه ` نامیده می‌شود. از " +"سوی دیگر، اگر برنامه‌ای :c:func:`free` را برای یک بلوک فراخوانی کند و سپس به" +" استفاده از آن بلوک ادامه دهد، با استفاده‌ی مجدد از آن بلوک از طریق یک " +"فراخوانی دیگر :c:func:`malloc` تداخل ایجاد می‌کند. این کار :dfn:`استفاده از " +"حافظه‌ی آزادشده ` نامیده می‌شود. این همان پیامدهای بد " +"ارجاع به داده‌های مقداردهی‌نشده را دارد --- تخلیه‌ی حافظه (core dump)، نتایج" +" نادرست، فروپاشی‌های مرموز." -msgid "Common causes of memory leaks are unusual paths through the code. For instance, a function may allocate a block of memory, do some calculation, and then free the block again. Now a change in the requirements for the function may add a test to the calculation that detects an error condition and can return prematurely from the function. It's easy to forget to free the allocated memory block when taking this premature exit, especially when it is added later to the code. Such leaks, once introduced, often go undetected for a long time: the error exit is taken only in a small fraction of all calls, and most modern machines have plenty of virtual memory, so the leak only becomes apparent in a long-running process that uses the leaking function frequently. Therefore, it's important to prevent leaks from happening by having a coding convention or strategy that minimizes this kind of errors." -msgstr "" +msgid "" +"Common causes of memory leaks are unusual paths through the code. For " +"instance, a function may allocate a block of memory, do some calculation, " +"and then free the block again. Now a change in the requirements for the " +"function may add a test to the calculation that detects an error condition " +"and can return prematurely from the function. It's easy to forget to free " +"the allocated memory block when taking this premature exit, especially when " +"it is added later to the code. Such leaks, once introduced, often go " +"undetected for a long time: the error exit is taken only in a small fraction" +" of all calls, and most modern machines have plenty of virtual memory, so " +"the leak only becomes apparent in a long-running process that uses the " +"leaking function frequently. Therefore, it's important to prevent leaks " +"from happening by having a coding convention or strategy that minimizes this" +" kind of errors." +msgstr "" +"علت‌های رایج نشت حافظه، مسیرهای غیرمعمول در کد هستند. برای مثال، ممکن است یک" +" تابع بلوکی از حافظه را تخصیص دهد، محاسبه‌ای انجام دهد و سپس بلوک را دوباره " +"آزاد کند. اکنون تغییری در نیازمندی‌های تابع ممکن است آزمونی به محاسبه اضافه " +"کند که شرط خطا را تشخیص می‌دهد و می‌تواند زودهنگام از تابع بازگردد. آسان است" +" که آزاد کردن بلوک حافظه‌ی تخصیص‌یافته هنگام این خروج زودهنگام فراموش شود، " +"به‌خصوص وقتی که این خروج بعداً به کد اضافه می‌شود. چنین نشت‌هایی، پس از " +"ایجاد، اغلب مدت طولانی تشخیص داده نمی‌شوند: خروج خطا فقط در بخش کوچکی از " +"همه‌ی فراخوانی‌ها رخ می‌دهد و بیشتر ماشین‌های مدرن حافظه‌ی مجازی فراوانی " +"دارند، بنابراین نشت تنها در فرایند طولانی‌مدتی که مکرراً از تابع نشت‌کننده " +"استفاده می‌کند آشکار می‌شود. از این رو، مهم است که با داشتن قرارداد یا " +"راهبرد کدنویسی‌ای که این نوع خطاها را به حداقل می‌رساند، از وقوع نشت‌ها " +"جلوگیری کنید." -msgid "Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it needs a strategy to avoid memory leaks as well as the use of freed memory. The chosen method is called :dfn:`reference counting`. The principle is simple: every object contains a counter, which is incremented when a reference to the object is stored somewhere, and which is decremented when a reference to it is deleted. When the counter reaches zero, the last reference to the object has been deleted and the object is freed." -msgstr "" +msgid "" +"Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it " +"needs a strategy to avoid memory leaks as well as the use of freed memory. " +"The chosen method is called :dfn:`reference counting`. The principle is " +"simple: every object contains a counter, which is incremented when a " +"reference to the object is stored somewhere, and which is decremented when a" +" reference to it is deleted. When the counter reaches zero, the last " +"reference to the object has been deleted and the object is freed." +msgstr "" +"از آنجا که پایتون به‌طور گسترده از :c:func:`malloc` و :c:func:`free` استفاده" +" می‌کند، به راهبردی نیاز دارد تا از نشت حافظه و همچنین استفاده از حافظه‌ی " +"آزادشده جلوگیری کند. روش انتخاب‌شده :dfn:`شمارش ارجاع ` " +"نام دارد. اصل کار ساده است: هر شیء شامل یک شمارنده است که وقتی ارجاعی به شیء" +" در جایی ذخیره می‌شود، افزایش می‌یابد و وقتی ارجاعی به آن حذف می‌شود، کاهش " +"می‌یابد. وقتی شمارنده به صفر برسد، آخرین ارجاع به شیء حذف شده و شیء آزاد " +"می‌شود." -msgid "An alternative strategy is called :dfn:`automatic garbage collection`. (Sometimes, reference counting is also referred to as a garbage collection strategy, hence the use of \"automatic\" to distinguish the two.) The big advantage of automatic garbage collection is that the user doesn't need to call :c:func:`free` explicitly. (Another claimed advantage is an improvement in speed or memory usage --- this is no hard fact however.) The disadvantage is that for C, there is no truly portable automatic garbage collector, while reference counting can be implemented portably (as long as the functions :c:func:`malloc` and :c:func:`free` are available --- which the C Standard guarantees). Maybe some day a sufficiently portable automatic garbage collector will be available for C. Until then, we'll have to live with reference counts." -msgstr "" +msgid "" +"An alternative strategy is called :dfn:`automatic garbage collection`. " +"(Sometimes, reference counting is also referred to as a garbage collection " +"strategy, hence the use of \"automatic\" to distinguish the two.) The big " +"advantage of automatic garbage collection is that the user doesn't need to " +"call :c:func:`free` explicitly. (Another claimed advantage is an " +"improvement in speed or memory usage --- this is no hard fact however.) The" +" disadvantage is that for C, there is no truly portable automatic garbage " +"collector, while reference counting can be implemented portably (as long as " +"the functions :c:func:`malloc` and :c:func:`free` are available --- which " +"the C Standard guarantees). Maybe some day a sufficiently portable automatic" +" garbage collector will be available for C. Until then, we'll have to live " +"with reference counts." +msgstr "" +"راهبردی جایگزین، :dfn:`زباله‌روبی خودکار ` " +"نامیده می‌شود. (گاهی شمارش ارجاع نیز به‌عنوان یک راهبرد زباله‌روبی شناخته " +"می‌شود، از این رو از واژه‌ی «خودکار» برای تمایز میان این دو استفاده می‌شود.)" +" مزیت بزرگ زباله‌روبی خودکار این است که کاربر نیازی به فراخوانی صریح " +":c:func:`free` ندارد. (مزیت دیگری که ادعا می‌شود، بهبود سرعت یا مصرف حافظه " +"است --- هرچند این موضوع واقعیتی قطعی نیست.) نقطه‌ضعف این است که برای C، هیچ " +"زباله‌روب خودکاری که واقعاً قابل حمل باشد وجود ندارد، در حالی که شمارش ارجاع" +" را می‌توان به‌صورت قابل حمل پیاده‌سازی کرد (تا زمانی که توابع " +":c:func:`malloc` و :c:func:`free` در دسترس باشند --- که استاندارد C آن را " +"تضمین می‌کند). شاید روزی زباله‌روب خودکاری که به‌اندازه‌ی کافی قابل حمل " +"باشد، برای C در دسترس قرار گیرد. تا آن زمان، چاره‌ای جز سازگاری با شمارش " +"ارجاع نداریم." -msgid "While Python uses the traditional reference counting implementation, it also offers a cycle detector that works to detect reference cycles. This allows applications to not worry about creating direct or indirect circular references; these are the weakness of garbage collection implemented using only reference counting. Reference cycles consist of objects which contain (possibly indirect) references to themselves, so that each object in the cycle has a reference count which is non-zero. Typical reference counting implementations are not able to reclaim the memory belonging to any objects in a reference cycle, or referenced from the objects in the cycle, even though there are no further references to the cycle itself." -msgstr "" +msgid "" +"While Python uses the traditional reference counting implementation, it also" +" offers a cycle detector that works to detect reference cycles. This allows" +" applications to not worry about creating direct or indirect circular " +"references; these are the weakness of garbage collection implemented using " +"only reference counting. Reference cycles consist of objects which contain " +"(possibly indirect) references to themselves, so that each object in the " +"cycle has a reference count which is non-zero. Typical reference counting " +"implementations are not able to reclaim the memory belonging to any objects " +"in a reference cycle, or referenced from the objects in the cycle, even " +"though there are no further references to the cycle itself." +msgstr "" +"در حالی که پایتون از پیاده‌سازی سنتی شمارش ارجاع استفاده می‌کند، همچنین " +"آشکارساز چرخه‌ای ارائه می‌دهد که برای تشخیص چرخه‌های ارجاع کار می‌کند. این " +"امر به برنامه‌ها اجازه می‌دهد که نگران ایجاد ارجاع‌های دایره‌ای مستقیم یا " +"غیرمستقیم نباشند؛ این ارجاع‌ها نقطه‌ضعف زباله‌روبی‌ای هستند که تنها با " +"استفاده از شمارش ارجاع پیاده‌سازی شده است. چرخه‌های ارجاع از اشیایی تشکیل " +"شده‌اند که ارجاع‌هایی (احتمالاً غیرمستقیم) به خود دارند، به‌طوری که هر شیء " +"در چرخه تعداد ارجاعی غیر از صفر دارد. پیاده‌سازی‌های متداول شمارش ارجاع " +"نمی‌توانند حافظه‌ی متعلق به هیچ‌یک از اشیای درون یک چرخه ارجاع، یا اشیایی که" +" از سوی اشیای درون چرخه به آن‌ها ارجاع شده است، را بازیابی کنند، هرچند هیچ " +"ارجاع دیگری به خود چرخه وجود ندارد." -msgid "The cycle detector is able to detect garbage cycles and can reclaim them. The :mod:`gc` module exposes a way to run the detector (the :func:`~gc.collect` function), as well as configuration interfaces and the ability to disable the detector at runtime." +msgid "" +"The cycle detector is able to detect garbage cycles and can reclaim them. " +"The :mod:`gc` module exposes a way to run the detector (the " +":func:`~gc.collect` function), as well as configuration interfaces and the " +"ability to disable the detector at runtime." msgstr "" +"آشکارساز چرخه می‌تواند چرخه‌های زباله را تشخیص دهد و آن‌ها را بازپس‌گیری " +"کند. ماژول :mod:`gc` راهی برای اجرای آشکارساز (تابع :func:`~gc.collect`)، و " +"همچنین رابط‌های پیکربندی و امکان غیرفعال‌سازی آشکارساز در زمان اجرا را فراهم" +" می‌کند." msgid "Reference Counting in Python" -msgstr "" +msgstr "شمارش ارجاع در پایتون" -msgid "There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle the incrementing and decrementing of the reference count. :c:func:`Py_DECREF` also frees the object when the count reaches zero. For flexibility, it doesn't call :c:func:`free` directly --- rather, it makes a call through a function pointer in the object's :dfn:`type object`. For this purpose (and others), every object also contains a pointer to its type object." -msgstr "" +msgid "" +"There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " +"the incrementing and decrementing of the reference count. " +":c:func:`Py_DECREF` also frees the object when the count reaches zero. For " +"flexibility, it doesn't call :c:func:`free` directly --- rather, it makes a " +"call through a function pointer in the object's :dfn:`type object`. For " +"this purpose (and others), every object also contains a pointer to its type " +"object." +msgstr "" +"دو ماکرو وجود دارد، ``Py_INCREF(x)`` و ``Py_DECREF(x)``، که افزایش و کاهش " +"شمارش ارجاع را بر عهده دارند. :c:func:`Py_DECREF` همچنین هنگامی که شمارش به " +"صفر برسد، شیء را آزاد می‌کند. برای انعطاف‌پذیری، این ماکرو :c:func:`free` را" +" مستقیماً فراخوانی نمی‌کند --- بلکه فراخوانی را از طریق یک اشاره‌گر تابع در " +":dfn:`شیء نوع ` مربوط به آن شیء انجام می‌دهد. برای این منظور (و" +" منظورهای دیگر)، هر شیء همچنین حاوی اشاره‌گری به شیء نوع خود است." -msgid "The big question now remains: when to use ``Py_INCREF(x)`` and ``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an object; however, you can :dfn:`own a reference` to an object. An object's reference count is now defined as the number of owned references to it. The owner of a reference is responsible for calling :c:func:`Py_DECREF` when the reference is no longer needed. Ownership of a reference can be transferred. There are three ways to dispose of an owned reference: pass it on, store it, or call :c:func:`Py_DECREF`. Forgetting to dispose of an owned reference creates a memory leak." -msgstr "" +msgid "" +"The big question now remains: when to use ``Py_INCREF(x)`` and " +"``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an " +"object; however, you can :dfn:`own a reference` to an object. An object's " +"reference count is now defined as the number of owned references to it. The" +" owner of a reference is responsible for calling :c:func:`Py_DECREF` when " +"the reference is no longer needed. Ownership of a reference can be " +"transferred. There are three ways to dispose of an owned reference: pass it" +" on, store it, or call :c:func:`Py_DECREF`. Forgetting to dispose of an " +"owned reference creates a memory leak." +msgstr "" +"اکنون پرسش بزرگ این است: چه زمانی باید از ``Py_INCREF(x)`` و " +"``Py_DECREF(x)`` استفاده کرد؟ اجازه دهید ابتدا چند اصطلاح را معرفی کنیم. " +"هیچ‌کس «مالک» یک شیء نیست؛ اما شما می‌توانید :dfn:`مالک یک ارجاع ` به یک شیء باشید. اکنون شمارش ارجاع یک شیء به‌عنوان تعداد " +"ارجاع‌های در مالکیت به آن تعریف می‌شود. مالک یک ارجاع مسئول است که وقتی " +"دیگر به ارجاع نیازی نیست، :c:func:`Py_DECREF` را فراخوانی کند. مالکیت یک " +"ارجاع می‌تواند منتقل شود. سه راه برای خلاص شدن از یک ارجاع در مالکیت وجود " +"دارد: انتقال آن، ذخیره‌ی آن، یا فراخوانی :c:func:`Py_DECREF`. فراموش کردن " +"خلاص شدن از یک ارجاع در مالکیت، باعث نشت حافظه می‌شود." -msgid "It is also possible to :dfn:`borrow` [#]_ a reference to an object. The borrower of a reference should not call :c:func:`Py_DECREF`. The borrower must not hold on to the object longer than the owner from which it was borrowed. Using a borrowed reference after the owner has disposed of it risks using freed memory and should be avoided completely [#]_." -msgstr "" +msgid "" +"It is also possible to :dfn:`borrow` [#]_ a reference to an object. The " +"borrower of a reference should not call :c:func:`Py_DECREF`. The borrower " +"must not hold on to the object longer than the owner from which it was " +"borrowed. Using a borrowed reference after the owner has disposed of it " +"risks using freed memory and should be avoided completely [#]_." +msgstr "" +"همچنین می‌توان ارجاعی به یک شیء را :dfn:`به امانت گرفت ` [#]_. " +"امانت‌گیرنده‌ی ارجاع نباید :c:func:`Py_DECREF` را فراخوانی کند. امانت‌گیرنده" +" نباید شیء را بیشتر از مالکی که ارجاع از او امانت گرفته‌شده است، نگه دارد. " +"استفاده از ارجاع امانتی پس از آنکه مالک آن را دور انداخته باشد، خطر استفاده " +"از حافظه‌ی آزادشده را در پی دارد و باید به‌طور کامل از آن پرهیز کرد [#]_." -msgid "The advantage of borrowing over owning a reference is that you don't need to take care of disposing of the reference on all possible paths through the code --- in other words, with a borrowed reference you don't run the risk of leaking when a premature exit is taken. The disadvantage of borrowing over owning is that there are some subtle situations where in seemingly correct code a borrowed reference can be used after the owner from which it was borrowed has in fact disposed of it." -msgstr "" +msgid "" +"The advantage of borrowing over owning a reference is that you don't need to" +" take care of disposing of the reference on all possible paths through the " +"code --- in other words, with a borrowed reference you don't run the risk of" +" leaking when a premature exit is taken. The disadvantage of borrowing over" +" owning is that there are some subtle situations where in seemingly correct " +"code a borrowed reference can be used after the owner from which it was " +"borrowed has in fact disposed of it." +msgstr "" +"مزیت امانت گرفتن ارجاع نسبت به مالکیت آن این است که لازم نیست در تمام " +"مسیرهای ممکن در کد، دفع ارجاع را مدیریت کنید --- به عبارت دیگر، با ارجاع " +"امانتی، هنگام خروج زودهنگام در معرض خطر نشت قرار نمی‌گیرید. عیب امانت گرفتن" +" نسبت به مالکیت این است که در برخی موقعیت‌های ظریف، ممکن است در کدی که " +"به‌ظاهر درست است، از یک ارجاع امانتی پس از آنکه مالکی که ارجاع از او امانت " +"گرفته شده، در واقع آن را دفع کرده باشد، استفاده شود." -msgid "A borrowed reference can be changed into an owned reference by calling :c:func:`Py_INCREF`. This does not affect the status of the owner from which the reference was borrowed --- it creates a new owned reference, and gives full owner responsibilities (the new owner must dispose of the reference properly, as well as the previous owner)." -msgstr "" +msgid "" +"A borrowed reference can be changed into an owned reference by calling " +":c:func:`Py_INCREF`. This does not affect the status of the owner from " +"which the reference was borrowed --- it creates a new owned reference, and " +"gives full owner responsibilities (the new owner must dispose of the " +"reference properly, as well as the previous owner)." +msgstr "" +"یک ارجاع امانتی را می‌توان با فراخوانی :c:func:`Py_INCREF` به یک ارجاع ملکی " +"تبدیل کرد. این کار تأثیری بر وضعیت مالکی که ارجاع از او امانت گرفته‌شده بود " +"نمی‌گذارد --- بلکه یک ارجاع ملکی جدید ایجاد می‌کند و مسئولیت‌های کامل مالکیت" +" را به همراه دارد (مالک جدید باید ارجاع را به‌درستی دفع کند، همان‌طور که " +"مالک قبلی نیز باید این کار را انجام دهد)." msgid "Ownership Rules" -msgstr "" +msgstr "قواعد مالکیت" -msgid "Whenever an object reference is passed into or out of a function, it is part of the function's interface specification whether ownership is transferred with the reference or not." +msgid "" +"Whenever an object reference is passed into or out of a function, it is part" +" of the function's interface specification whether ownership is transferred " +"with the reference or not." msgstr "" +"هرگاه ارجاعی به یک شیء به داخل یا خارج از یک تابع پاس داده شود، اینکه آیا " +"مالکیت به همراه ارجاع منتقل می‌شود یا خیر، بخشی از مشخصات رابط تابع است." -msgid "Most functions that return a reference to an object pass on ownership with the reference. In particular, all functions whose function it is to create a new object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`, pass ownership to the receiver. Even if the object is not actually new, you still receive ownership of a new reference to that object. For instance, :c:func:`PyLong_FromLong` maintains a cache of popular values and can return a reference to a cached item." -msgstr "" +msgid "" +"Most functions that return a reference to an object pass on ownership with " +"the reference. In particular, all functions whose function it is to create " +"a new object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`," +" pass ownership to the receiver. Even if the object is not actually new, " +"you still receive ownership of a new reference to that object. For " +"instance, :c:func:`PyLong_FromLong` maintains a cache of popular values and " +"can return a reference to a cached item." +msgstr "" +"بیشتر توابعی که ارجاعی به یک شیء را برمی‌گردانند، مالکیت را همراه با ارجاع " +"منتقل می‌کنند. به‌طور خاص، تمام توابعی که وظیفه‌شان ایجاد یک شیء جدید است، " +"مانند :c:func:`PyLong_FromLong` و :c:func:`Py_BuildValue`، مالکیت را به " +"گیرنده منتقل می‌کنند. حتی اگر شیء در واقع جدید نباشد، شما همچنان مالکیت یک " +"ارجاع جدید به آن شیء را دریافت می‌کنید. برای نمونه، " +":c:func:`PyLong_FromLong` یک نهانگاه از مقادیر پرکاربرد را نگه می‌دارد و " +"می‌تواند ارجاعی به یک آیتم نهانگاه‌شده را برگرداند." -msgid "Many functions that extract objects from other objects also transfer ownership with the reference, for instance :c:func:`PyObject_GetAttrString`. The picture is less clear, here, however, since a few common routines are exceptions: :c:func:`PyTuple_GetItem`, :c:func:`PyList_GetItem`, :c:func:`PyDict_GetItem`, and :c:func:`PyDict_GetItemString` all return references that you borrow from the tuple, list or dictionary." -msgstr "" +msgid "" +"Many functions that extract objects from other objects also transfer " +"ownership with the reference, for instance :c:func:`PyObject_GetAttrString`." +" The picture is less clear, here, however, since a few common routines are " +"exceptions: :c:func:`PyTuple_GetItem`, :c:func:`PyList_GetItem`, " +":c:func:`PyDict_GetItem`, and :c:func:`PyDict_GetItemString` all return " +"references that you borrow from the tuple, list or dictionary." +msgstr "" +"بسیاری از توابعی که اشیاء را از اشیاء دیگر استخراج می‌کنند، مالکیت را نیز " +"همراه با ارجاع منتقل می‌کنند؛ برای مثال :c:func:`PyObject_GetAttrString`. با" +" این حال، تصویر در اینجا کمتر روشن است، زیرا چند روال رایج استثنا هستند: " +":c:func:`PyTuple_GetItem`، :c:func:`PyList_GetItem`، " +":c:func:`PyDict_GetItem` و :c:func:`PyDict_GetItemString` همگی ارجاع‌هایی را" +" برمی‌گردانند که شما آن‌ها را از تاپل، فهرست یا دیکشنری امانت می‌گیرید." -msgid "The function :c:func:`PyImport_AddModule` also returns a borrowed reference, even though it may actually create the object it returns: this is possible because an owned reference to the object is stored in ``sys.modules``." +msgid "" +"The function :c:func:`PyImport_AddModule` also returns a borrowed reference," +" even though it may actually create the object it returns: this is possible " +"because an owned reference to the object is stored in ``sys.modules``." msgstr "" +"تابع :c:func:`PyImport_AddModule` نیز یک ارجاع امانتی برمی‌گرداند، هرچند " +"ممکن است در واقع شیئی را که برمی‌گرداند ایجاد کند: این امر ممکن است زیرا یک " +"ارجاع مالکانه به شیء در ``sys.modules`` ذخیره شده است." -msgid "When you pass an object reference into another function, in general, the function borrows the reference from you --- if it needs to store it, it will use :c:func:`Py_INCREF` to become an independent owner. There are exactly two important exceptions to this rule: :c:func:`PyTuple_SetItem` and :c:func:`PyList_SetItem`. These functions take over ownership of the item passed to them --- even if they fail! (Note that :c:func:`PyDict_SetItem` and friends don't take over ownership --- they are \"normal.\")" -msgstr "" +msgid "" +"When you pass an object reference into another function, in general, the " +"function borrows the reference from you --- if it needs to store it, it will" +" use :c:func:`Py_INCREF` to become an independent owner. There are exactly " +"two important exceptions to this rule: :c:func:`PyTuple_SetItem` and " +":c:func:`PyList_SetItem`. These functions take over ownership of the item " +"passed to them --- even if they fail! (Note that :c:func:`PyDict_SetItem` " +"and friends don't take over ownership --- they are \"normal.\")" +msgstr "" +"وقتی یک ارجاع به شیء را به تابع دیگری می‌دهید، به‌طور کلی، تابع ارجاع را " +"به‌صورت امانتی از شما می‌گیرد --- اگر نیاز به ذخیره‌سازی آن داشته باشد، از " +":c:func:`Py_INCREF` استفاده می‌کند تا مالکی مستقل شود. دقیقاً دو استثنای " +"مهم برای این قاعده وجود دارد: :c:func:`PyTuple_SetItem` و " +":c:func:`PyList_SetItem`. این توابع مالکیت آیتمی را که به آن‌ها داده می‌شود" +" در اختیار می‌گیرند --- حتی اگر شکست بخورند! (توجه کنید که " +":c:func:`PyDict_SetItem` و توابع مشابه مالکیت را در اختیار نمی‌گیرند --- " +"آن‌ها «معمولی» هستند.)" -msgid "When a C function is called from Python, it borrows references to its arguments from the caller. The caller owns a reference to the object, so the borrowed reference's lifetime is guaranteed until the function returns. Only when such a borrowed reference must be stored or passed on, it must be turned into an owned reference by calling :c:func:`Py_INCREF`." -msgstr "" +msgid "" +"When a C function is called from Python, it borrows references to its " +"arguments from the caller. The caller owns a reference to the object, so " +"the borrowed reference's lifetime is guaranteed until the function returns." +" Only when such a borrowed reference must be stored or passed on, it must " +"be turned into an owned reference by calling :c:func:`Py_INCREF`." +msgstr "" +"وقتی یک تابع C از پایتون فراخوانی می‌شود، ارجاع‌هایی به آرگومان‌های خود را " +"از فراخوانی‌کننده به امانت می‌گیرد. فراخوانی‌کننده مالک ارجاعی به شیء است، " +"بنابراین طول عمر ارجاع امانتی تا زمان بازگشت تابع تضمین‌شده است. تنها زمانی " +"که چنین ارجاع امانتی‌ای باید ذخیره یا منتقل شود، باید با فراخوانی " +":c:func:`Py_INCREF` به یک ارجاع مالکانه (owned reference) تبدیل شود." -msgid "The object reference returned from a C function that is called from Python must be an owned reference --- ownership is transferred from the function to its caller." +msgid "" +"The object reference returned from a C function that is called from Python " +"must be an owned reference --- ownership is transferred from the function to" +" its caller." msgstr "" +"ارجاع شیئی که از یک تابع C فراخوانی‌شده از پایتون بازگردانده می‌شود، باید یک" +" ارجاع مالکانه (owned reference) باشد --- مالکیت از تابع به فراخواننده‌ی آن " +"منتقل می‌شود." msgid "Thin Ice" -msgstr "" +msgstr "یخ نازک" -msgid "There are a few situations where seemingly harmless use of a borrowed reference can lead to problems. These all have to do with implicit invocations of the interpreter, which can cause the owner of a reference to dispose of it." +msgid "" +"There are a few situations where seemingly harmless use of a borrowed " +"reference can lead to problems. These all have to do with implicit " +"invocations of the interpreter, which can cause the owner of a reference to " +"dispose of it." msgstr "" +"چند موقعیت وجود دارد که استفاده‌ی به‌ظاهر بی‌ضرر از یک ارجاع امانتی می‌تواند" +" منجر به مشکلات شود. همه‌ی این موارد به فراخوانی‌های ضمنی مفسر مربوط‌اند که " +"می‌توانند باعث شوند مالک یک ارجاع آن را رها کند." -msgid "The first and most important case to know about is using :c:func:`Py_DECREF` on an unrelated object while borrowing a reference to a list item. For instance::" +msgid "" +"The first and most important case to know about is using :c:func:`Py_DECREF`" +" on an unrelated object while borrowing a reference to a list item. For " +"instance::" msgstr "" +"نخستین و مهم‌ترین موردی که باید از آن آگاه باشید، استفاده از " +":c:func:`Py_DECREF` روی شیئی نامرتبط در حالی است که ارجاعی به یک آیتم فهرست " +"را به امانت گرفته‌اید. برای نمونه::" msgid "" "void\n" @@ -835,18 +2121,76 @@ msgid "" " PyObject_Print(item, stdout, 0); /* BUG! */\n" "}" msgstr "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" -msgid "This function first borrows a reference to ``list[0]``, then replaces ``list[1]`` with the value ``0``, and finally prints the borrowed reference. Looks harmless, right? But it's not!" +msgid "" +"This function first borrows a reference to ``list[0]``, then replaces " +"``list[1]`` with the value ``0``, and finally prints the borrowed reference." +" Looks harmless, right? But it's not!" msgstr "" +"این تابع ابتدا یک ارجاع امانتی به ``list[0]`` می‌گیرد، سپس ``list[1]`` را با" +" مقدار ``0`` جایگزین می‌کند و در نهایت ارجاع امانتی را چاپ می‌کند. بی‌ضرر به" +" نظر می‌رسد، نه؟ اما چنین نیست!" -msgid "Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns references to all its items, so when item 1 is replaced, it has to dispose of the original item 1. Now let's suppose the original item 1 was an instance of a user-defined class, and let's further suppose that the class defined a :meth:`!__del__` method. If this class instance has a reference count of 1, disposing of it will call its :meth:`!__del__` method. Internally, :c:func:`PyList_SetItem` calls :c:func:`Py_DECREF` on the replaced item, which invokes replaced item's corresponding :c:member:`~PyTypeObject.tp_dealloc` function. During deallocation, :c:member:`~PyTypeObject.tp_dealloc` calls :c:member:`~PyTypeObject.tp_finalize`, which is mapped to the :meth:`!__del__` method for class instances (see :pep:`442`). This entire sequence happens synchronously within the :c:func:`PyList_SetItem` call." -msgstr "" +msgid "" +"Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns " +"references to all its items, so when item 1 is replaced, it has to dispose " +"of the original item 1. Now let's suppose the original item 1 was an " +"instance of a user-defined class, and let's further suppose that the class " +"defined a :meth:`!__del__` method. If this class instance has a reference " +"count of 1, disposing of it will call its :meth:`!__del__` method. " +"Internally, :c:func:`PyList_SetItem` calls :c:func:`Py_DECREF` on the " +"replaced item, which invokes replaced item's corresponding " +":c:member:`~PyTypeObject.tp_dealloc` function. During deallocation, " +":c:member:`~PyTypeObject.tp_dealloc` calls " +":c:member:`~PyTypeObject.tp_finalize`, which is mapped to the " +":meth:`!__del__` method for class instances (see :pep:`442`). This entire " +"sequence happens synchronously within the :c:func:`PyList_SetItem` call." +msgstr "" +"بیایید جریان کنترل را تا داخل :c:func:`PyList_SetItem` دنبال کنیم. فهرست " +"مالک ارجاع‌هایی به همه‌ی آیتم‌های خود است، بنابراین وقتی آیتم ۱ جایگزین " +"می‌شود، فهرست باید از آیتم اصلی ۱ خلاص شود. اکنون فرض کنید آیتم اصلی ۱ " +"نمونه‌ای از یک کلاس تعریف‌شده توسط کاربر بوده است، و همچنین فرض کنید این " +"کلاس متد :meth:`!__del__` را تعریف کرده است. اگر شمارش ارجاع این نمونه‌ی " +"کلاس برابر با ۱ باشد، خلاص شدن از آن، متد :meth:`!__del__` آن را فراخوانی " +"می‌کند. به‌طور داخلی، :c:func:`PyList_SetItem` :c:func:`Py_DECREF` را روی " +"آیتم جایگزین‌شده فراخوانی می‌کند، که این امر موجب فراخوانی تابع " +":c:member:`~PyTypeObject.tp_dealloc` متناظر با آیتم جایگزین‌شده می‌شود. در " +"حین تخصیص‌زدایی (deallocation)، :c:member:`~PyTypeObject.tp_dealloc` " +":c:member:`~PyTypeObject.tp_finalize` را فراخوانی می‌کند که برای نمونه‌های " +"کلاس به متد :meth:`!__del__` نگاشت شده است (به :pep:`442` مراجعه کنید). کل " +"این توالی به‌صورت همگام درون فراخوانی :c:func:`PyList_SetItem` رخ می‌دهد." -msgid "Since it is written in Python, the :meth:`!__del__` method can execute arbitrary Python code. Could it perhaps do something to invalidate the reference to ``item`` in :c:func:`!bug`? You bet! Assuming that the list passed into :c:func:`!bug` is accessible to the :meth:`!__del__` method, it could execute a statement to the effect of ``del list[0]``, and assuming this was the last reference to that object, it would free the memory associated with it, thereby invalidating ``item``." -msgstr "" +msgid "" +"Since it is written in Python, the :meth:`!__del__` method can execute " +"arbitrary Python code. Could it perhaps do something to invalidate the " +"reference to ``item`` in :c:func:`!bug`? You bet! Assuming that the list " +"passed into :c:func:`!bug` is accessible to the :meth:`!__del__` method, it " +"could execute a statement to the effect of ``del list[0]``, and assuming " +"this was the last reference to that object, it would free the memory " +"associated with it, thereby invalidating ``item``." +msgstr "" +"از آنجا که به زبان پایتون نوشته شده است، متد :meth:`!__del__` می‌تواند کد " +"پایتون دلخواهی را اجرا کند. آیا ممکن است کاری انجام دهد که ارجاع به ``item``" +" در :c:func:`!bug` را بی‌اعتبار کند؟ قطعاً! با فرض اینکه فهرست پاس‌داده‌شده " +"به :c:func:`!bug` در دسترس متد :meth:`!__del__` باشد، می‌تواند دستوری مانند " +"``del list[0]`` اجرا کند، و با فرض اینکه این آخرین ارجاع به آن شیء باشد، " +"حافظه‌ی مرتبط با آن را آزاد می‌کند و بدین ترتیب ``item`` را بی‌اعتبار " +"می‌کند." -msgid "The solution, once you know the source of the problem, is easy: temporarily increment the reference count. The correct version of the function reads::" +msgid "" +"The solution, once you know the source of the problem, is easy: temporarily " +"increment the reference count. The correct version of the function reads::" msgstr "" +"راه‌حل، وقتی منشأ مشکل را بدانید، آسان است: شمارش ارجاع را به‌طور موقت " +"افزایش دهید. نسخه صحیح تابع چنین است::" msgid "" "void\n" @@ -860,12 +2204,47 @@ msgid "" " Py_DECREF(item);\n" "}" msgstr "" +"void\n" +"no_bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" Py_INCREF(item);\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0);\n" +" Py_DECREF(item);\n" +"}" -msgid "This is a true story. An older version of Python contained variants of this bug and someone spent a considerable amount of time in a C debugger to figure out why his :meth:`!__del__` methods would fail..." +msgid "" +"This is a true story. An older version of Python contained variants of this" +" bug and someone spent a considerable amount of time in a C debugger to " +"figure out why his :meth:`!__del__` methods would fail..." msgstr "" +"این داستانی واقعی است. نسخه‌ای قدیمی‌تر از پایتون شامل گونه‌هایی از این باگ " +"بود و کسی مدت زمان قابل توجهی را در دیباگر C صرف کرد تا بفهمد چرا متدهای " +":meth:`!__del__` او شکست می‌خوردند..." -msgid "The second case of problems with a borrowed reference is a variant involving threads. Normally, multiple threads in the Python interpreter can't get in each other's way, because there is a :term:`global lock ` protecting Python's entire object space. However, it is possible to temporarily release this lock using the macro :c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using :c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, to let other threads use the processor while waiting for the I/O to complete. Obviously, the following function has the same problem as the previous one::" -msgstr "" +msgid "" +"The second case of problems with a borrowed reference is a variant involving" +" threads. Normally, multiple threads in the Python interpreter can't get in" +" each other's way, because there is a :term:`global lock ` protecting Python's entire object space. However, it is possible to " +"temporarily release this lock using the macro " +":c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using " +":c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, " +"to let other threads use the processor while waiting for the I/O to " +"complete. Obviously, the following function has the same problem as the " +"previous one::" +msgstr "" +"دومین مورد از مشکلات مربوط به ارجاع امانتی، گونه‌ای است که به نخ‌ها مربوط " +"می‌شود. به‌طور معمول، نخ‌های متعدد در مفسر پایتون نمی‌توانند مزاحم کار " +"یکدیگر شوند، زیرا یک :term:`قفل سراسری ` از کل فضای" +" اشیای پایتون محافظت می‌کند. با این حال، می‌توان این قفل را به‌طور موقت با " +"استفاده از ماکروی :c:macro:`Py_BEGIN_ALLOW_THREADS` آزاد کرد و آن را با " +"استفاده از :c:macro:`Py_END_ALLOW_THREADS` دوباره به دست آورد. این کار " +"پیرامون فراخوانی‌های مسدودکننده‌ی ورودی/خروجی رایج است تا نخ‌های دیگر " +"بتوانند در حین انتظار برای تکمیل ورودی/خروجی، از پردازنده استفاده کنند. " +"بدیهی است که تابع زیر همان مشکلی را دارد که تابع قبلی داشت::" msgid "" "void\n" @@ -878,72 +2257,282 @@ msgid "" " PyObject_Print(item, stdout, 0); /* BUG! */\n" "}" msgstr "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +" Py_BEGIN_ALLOW_THREADS\n" +" ...some blocking I/O call...\n" +" Py_END_ALLOW_THREADS\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" msgid "NULL Pointers" -msgstr "" +msgstr "اشاره‌گرهای NULL" -msgid "In general, functions that take object references as arguments do not expect you to pass them ``NULL`` pointers, and will dump core (or cause later core dumps) if you do so. Functions that return object references generally return ``NULL`` only to indicate that an exception occurred. The reason for not testing for ``NULL`` arguments is that functions often pass the objects they receive on to other function --- if each function were to test for ``NULL``, there would be a lot of redundant tests and the code would run more slowly." -msgstr "" +msgid "" +"In general, functions that take object references as arguments do not expect" +" you to pass them ``NULL`` pointers, and will dump core (or cause later core" +" dumps) if you do so. Functions that return object references generally " +"return ``NULL`` only to indicate that an exception occurred. The reason for" +" not testing for ``NULL`` arguments is that functions often pass the objects" +" they receive on to other function --- if each function were to test for " +"``NULL``, there would be a lot of redundant tests and the code would run " +"more slowly." +msgstr "" +"به‌طور کلی، توابعی که ارجاع‌های شیء را به‌عنوان آرگومان می‌گیرند، انتظار " +"ندارند که اشاره‌گرهای ``NULL`` را به آن‌ها پاس دهید، و اگر چنین کنید، " +"برون‌ریزی هسته (core dump) ایجاد می‌کنند (یا باعث برون‌ریزی‌های هسته‌ی بعدی " +"می‌شوند). توابعی که ارجاع‌های شیء را برمی‌گردانند، معمولاً تنها برای نشان " +"دادن اینکه استثنایی رخ داده است، ``NULL`` برمی‌گردانند. دلیل آزمایش نکردن " +"``NULL`` بودن آرگومان‌ها این است که توابع اغلب اشیایی را که دریافت می‌کنند " +"به تابع دیگری پاس می‌دهند --- اگر هر تابعی ``NULL`` را آزمایش می‌کرد، " +"آزمون‌های زائد زیادی صورت می‌گرفت و کد کندتر اجرا می‌شد." -msgid "It is better to test for ``NULL`` only at the \"source:\" when a pointer that may be ``NULL`` is received, for example, from :c:func:`malloc` or from a function that may raise an exception." +msgid "" +"It is better to test for ``NULL`` only at the \"source:\" when a pointer " +"that may be ``NULL`` is received, for example, from :c:func:`malloc` or from" +" a function that may raise an exception." msgstr "" +"بهتر است بررسی ``NULL`` تنها در \"source:\" انجام شود؛ زمانی که اشاره‌گری که" +" ممکن است ``NULL`` باشد دریافت می‌شود، برای مثال از :c:func:`malloc` یا از " +"تابعی که ممکن است استثنا برافراخواند." -msgid "The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for ``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` do." +msgid "" +"The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " +"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and " +":c:func:`Py_XDECREF` do." msgstr "" +"ماکروهای :c:func:`Py_INCREF` و :c:func:`Py_DECREF` اشاره‌گرهای ``NULL`` را " +"بررسی نمی‌کنند --- اما گونه‌های آن‌ها، :c:func:`Py_XINCREF` و " +":c:func:`Py_XDECREF`، این بررسی را انجام می‌دهند." -msgid "The macros for checking for a particular object type (``Pytype_Check()``) don't check for ``NULL`` pointers --- again, there is much code that calls several of these in a row to test an object against various different expected types, and this would generate redundant tests. There are no variants with ``NULL`` checking." -msgstr "" +msgid "" +"The macros for checking for a particular object type (``Pytype_Check()``) " +"don't check for ``NULL`` pointers --- again, there is much code that calls " +"several of these in a row to test an object against various different " +"expected types, and this would generate redundant tests. There are no " +"variants with ``NULL`` checking." +msgstr "" +"ماکروهای بررسی یک نوع شیء خاص (``Pytype_Check()``) اشاره‌گرهای ``NULL`` را " +"بررسی نمی‌کنند --- باز هم، کدهای زیادی وجود دارند که برای آزمودن یک شیء در " +"برابر انواع مختلف مورد انتظار، چندین مورد از این ماکروها را پشت سر هم " +"فراخوانی می‌کنند، و این کار آزمون‌های تکراری ایجاد می‌کرد. هیچ گونه‌ای با " +"بررسی ``NULL`` وجود ندارد." -msgid "The C function calling mechanism guarantees that the argument list passed to C functions (``args`` in the examples) is never ``NULL`` --- in fact it guarantees that it is always a tuple [#]_." +msgid "" +"The C function calling mechanism guarantees that the argument list passed to" +" C functions (``args`` in the examples) is never ``NULL`` --- in fact it " +"guarantees that it is always a tuple [#]_." msgstr "" +"سازوکار فراخوانی تابع C تضمین می‌کند که فهرست آرگومان‌هایی که به توابع C " +"ارسال می‌شود (``args`` در مثال‌ها) هرگز ``NULL`` نیست --- در واقع تضمین " +"می‌کند که همیشه یک تاپل است [#]_." -msgid "It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python user." +msgid "" +"It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python" +" user." msgstr "" +"این خطایی بسیار جدی است که اشاره‌گر ``NULL`` به کاربر پایتون «گریز» کند." msgid "Writing Extensions in C++" -msgstr "" +msgstr "نوشتن توسعه‌ها با C++" -msgid "It is possible to write extension modules in C++. Some restrictions apply. If the main program (the Python interpreter) is compiled and linked by the C compiler, global or static objects with constructors cannot be used. This is not a problem if the main program is linked by the C++ compiler. Functions that will be called by the Python interpreter (in particular, module initialization functions) have to be declared using ``extern \"C\"``. It is unnecessary to enclose the Python header files in ``extern \"C\" {...}`` --- they use this form already if the symbol ``__cplusplus`` is defined (all recent C++ compilers define this symbol)." -msgstr "" +msgid "" +"It is possible to write extension modules in C++. Some restrictions apply." +" If the main program (the Python interpreter) is compiled and linked by the" +" C compiler, global or static objects with constructors cannot be used. " +"This is not a problem if the main program is linked by the C++ compiler. " +"Functions that will be called by the Python interpreter (in particular, " +"module initialization functions) have to be declared using ``extern \"C\"``." +" It is unnecessary to enclose the Python header files in ``extern \"C\" " +"{...}`` --- they use this form already if the symbol ``__cplusplus`` is " +"defined (all recent C++ compilers define this symbol)." +msgstr "" +"نوشتن ماژول‌های توسعه‌ای به زبان C++ ممکن است. برخی محدودیت‌ها اعمال " +"می‌شوند. اگر برنامه اصلی (مفسر پایتون) توسط کامپایلر C کامپایل و پیوند داده " +"شود، نمی‌توان از اشیاء سراسری یا ایستای دارای سازنده استفاده کرد. اگر برنامه" +" اصلی توسط کامپایلر C++ پیوند داده شود، این مشکل وجود ندارد. توابعی که توسط " +"مفسر پایتون فراخوانی خواهند شد (به‌ویژه توابع مقداردهی اولیه ماژول) باید با " +"استفاده از ``extern \"C\"`` اعلام شوند. لازم نیست پرونده‌های سرآیند پایتون " +"در ``extern \"C\" {...}`` محصور شوند --- این پرونده‌ها در صورتی که نماد " +"``__cplusplus`` تعریف شده باشد، از قبل به این شکل هستند (همه‌ی کامپایلرهای " +"جدید C++ این نماد را تعریف می‌کنند)." msgid "Providing a C API for an Extension Module" -msgstr "" +msgstr "ارائه‌ی یک C API برای ماژول توسعه‌ای" -msgid "Many extension modules just provide new functions and types to be used from Python, but sometimes the code in an extension module can be useful for other extension modules. For example, an extension module could implement a type \"collection\" which works like lists without order. Just like the standard Python list type has a C API which permits extension modules to create and manipulate lists, this new collection type should have a set of C functions for direct manipulation from other extension modules." -msgstr "" +msgid "" +"Many extension modules just provide new functions and types to be used from " +"Python, but sometimes the code in an extension module can be useful for " +"other extension modules. For example, an extension module could implement a " +"type \"collection\" which works like lists without order. Just like the " +"standard Python list type has a C API which permits extension modules to " +"create and manipulate lists, this new collection type should have a set of C" +" functions for direct manipulation from other extension modules." +msgstr "" +"بسیاری از ماژول‌های توسعه‌ای صرفاً توابع و نوع‌های جدیدی فراهم می‌کنند که از" +" پایتون مورد استفاده قرار می‌گیرند، اما گاهی کد موجود در یک ماژول توسعه‌ای " +"می‌تواند برای ماژول‌های توسعه‌ای دیگر مفید باشد. برای مثال، یک ماژول " +"توسعه‌ای می‌تواند نوعی به نام «مجموعه» (collection) پیاده‌سازی کند که مانند " +"فهرست‌های بدون ترتیب کار می‌کند. درست همان‌طور که نوع فهرست استاندارد پایتون" +" دارای یک C API است که به ماژول‌های توسعه‌ای اجازه می‌دهد فهرست‌ها را ایجاد " +"و دستکاری کنند، این نوع مجموعه جدید نیز باید مجموعه‌ای از توابع C برای " +"دستکاری مستقیم از سوی ماژول‌های توسعه‌ای دیگر داشته باشد." -msgid "At first sight this seems easy: just write the functions (without declaring them ``static``, of course), provide an appropriate header file, and document the C API. And in fact this would work if all extension modules were always linked statically with the Python interpreter. When modules are used as shared libraries, however, the symbols defined in one module may not be visible to another module. The details of visibility depend on the operating system; some systems use one global namespace for the Python interpreter and all extension modules (Windows, for example), whereas others require an explicit list of imported symbols at module link time (AIX is one example), or offer a choice of different strategies (most Unices). And even if symbols are globally visible, the module whose functions one wishes to call might not have been loaded yet!" -msgstr "" +msgid "" +"At first sight this seems easy: just write the functions (without declaring " +"them ``static``, of course), provide an appropriate header file, and " +"document the C API. And in fact this would work if all extension modules " +"were always linked statically with the Python interpreter. When modules are " +"used as shared libraries, however, the symbols defined in one module may not" +" be visible to another module. The details of visibility depend on the " +"operating system; some systems use one global namespace for the Python " +"interpreter and all extension modules (Windows, for example), whereas others" +" require an explicit list of imported symbols at module link time (AIX is " +"one example), or offer a choice of different strategies (most Unices). And " +"even if symbols are globally visible, the module whose functions one wishes " +"to call might not have been loaded yet!" +msgstr "" +"در نگاه نخست این کار آسان به نظر می‌رسد: کافی است توابع را بنویسید (البته " +"بدون اینکه آن‌ها را ``static`` اعلان کنید)، یک پرونده سرآیند مناسب فراهم " +"کنید و API زبان C را مستند کنید. و در واقع اگر همه ماژول‌های توسعه‌ای همیشه " +"به‌صورت ایستا با مفسر پایتون پیوند داده می‌شدند، همین روش کار می‌کرد. اما " +"هنگامی که ماژول‌ها به‌صورت کتابخانه‌های اشتراکی استفاده می‌شوند، ممکن است " +"نمادهای تعریف‌شده در یک ماژول برای ماژول دیگری نمایان نباشند. جزئیات نمایان " +"بودن نمادها به سیستم‌عامل بستگی دارد؛ برخی سیستم‌ها برای مفسر پایتون و همه " +"ماژول‌های توسعه‌ای از یک فضای نام سراسری واحد استفاده می‌کنند (مثلاً " +"ویندوز)، در حالی که برخی دیگر در زمان پیوند ماژول به فهرست صریحی از نمادهای " +"واردشده نیاز دارند (AIX یکی از این نمونه‌هاست)، یا امکان انتخاب میان " +"راهبردهای مختلف را ارائه می‌دهند (بیشتر سیستم‌های یونیکس). و حتی اگر نمادها " +"به‌صورت سراسری نمایان باشند، ممکن است ماژولی که می‌خواهید توابعش را فراخوانی" +" کنید، هنوز بارگذاری‌نشده باشد!" -msgid "Portability therefore requires not to make any assumptions about symbol visibility. This means that all symbols in extension modules should be declared ``static``, except for the module's initialization function, in order to avoid name clashes with other extension modules (as discussed in section :ref:`methodtable`). And it means that symbols that *should* be accessible from other extension modules must be exported in a different way." -msgstr "" +msgid "" +"Portability therefore requires not to make any assumptions about symbol " +"visibility. This means that all symbols in extension modules should be " +"declared ``static``, except for the module's initialization function, in " +"order to avoid name clashes with other extension modules (as discussed in " +"section :ref:`methodtable`). And it means that symbols that *should* be " +"accessible from other extension modules must be exported in a different way." +msgstr "" +"بنابراین، قابلیت انتقال (portability) ایجاب می‌کند که هیچ فرضی درباره‌ی " +"نمایانی نمادها صورت نگیرد. این بدان معناست که همه‌ی نمادها در ماژول‌های " +"توسعه‌ای، به‌جز تابع مقداردهی اولیه‌ی ماژول، باید به‌صورت ``static`` اعلام " +"شوند تا از تداخل نام با ماژول‌های توسعه‌ای دیگر پرهیز شود (همان‌طور که در " +"بخش :ref:`methodtable` بحث شد). و این بدان معناست که نمادهایی که *باید* برای" +" دیگر ماژول‌های توسعه‌ای دسترسی‌پذیر باشند، باید به شیوه‌ای متفاوت صادر " +"شوند." -msgid "Python provides a special mechanism to pass C-level information (pointers) from one extension module to another one: Capsules. A Capsule is a Python data type which stores a pointer (:c:expr:`void \\*`). Capsules can only be created and accessed via their C API, but they can be passed around like any other Python object. In particular, they can be assigned to a name in an extension module's namespace. Other extension modules can then import this module, retrieve the value of this name, and then retrieve the pointer from the Capsule." -msgstr "" +msgid "" +"Python provides a special mechanism to pass C-level information (pointers) " +"from one extension module to another one: Capsules. A Capsule is a Python " +"data type which stores a pointer (:c:expr:`void \\*`). Capsules can only be" +" created and accessed via their C API, but they can be passed around like " +"any other Python object. In particular, they can be assigned to a name in " +"an extension module's namespace. Other extension modules can then import " +"this module, retrieve the value of this name, and then retrieve the pointer " +"from the Capsule." +msgstr "" +"پایتون سازوکار ویژه‌ای برای انتقال اطلاعات در سطح C (اشاره‌گرها) از یک ماژول" +" توسعه‌ای به ماژول توسعه‌ای دیگر فراهم می‌کند: کپسول‌ها (Capsules). کپسول یک" +" نوع داده پایتونی است که یک اشاره‌گر (:c:expr:`void \\*`) را ذخیره می‌کند. " +"ایجاد و دسترسی به کپسول‌ها تنها از طریق API زبان C آن‌ها ممکن است، اما " +"می‌توان آن‌ها را مانند هر شیء پایتونی دیگری منتقل کرد. به‌طور خاص، می‌توان " +"آن‌ها را به نامی در فضای نام یک ماژول توسعه‌ای منتسب کرد. سپس ماژول‌های " +"توسعه‌ای دیگر می‌توانند این ماژول را ایمپورت کنند، مقدار این نام را بازیابی " +"کنند و سپس اشاره‌گر را از کپسول بازیابی کنند." -msgid "There are many ways in which Capsules can be used to export the C API of an extension module. Each function could get its own Capsule, or all C API pointers could be stored in an array whose address is published in a Capsule. And the various tasks of storing and retrieving the pointers can be distributed in different ways between the module providing the code and the client modules." -msgstr "" +msgid "" +"There are many ways in which Capsules can be used to export the C API of an " +"extension module. Each function could get its own Capsule, or all C API " +"pointers could be stored in an array whose address is published in a " +"Capsule. And the various tasks of storing and retrieving the pointers can be" +" distributed in different ways between the module providing the code and the" +" client modules." +msgstr "" +"از کپسول‌ها (Capsule) می‌توان به روش‌های بسیاری برای صادر کردن API زبان C یک" +" ماژول توسعه‌ای استفاده کرد. هر تابع می‌تواند کپسول مخصوص خود را داشته باشد،" +" یا تمام اشاره‌گرهای API زبان C می‌توانند در آرایه‌ای ذخیره شوند که آدرس آن " +"در یک کپسول منتشر می‌شود. همچنین می‌توان وظایف گوناگون ذخیره و بازیابی " +"اشاره‌گرها را به شیوه‌های مختلف بین ماژولی که کد را فراهم می‌کند و ماژول‌های" +" مشتری توزیع کرد." -msgid "Whichever method you choose, it's important to name your Capsules properly. The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const char \\*`); you're permitted to pass in a ``NULL`` name, but we strongly encourage you to specify a name. Properly named Capsules provide a degree of runtime type-safety; there is no feasible way to tell one unnamed Capsule from another." -msgstr "" +msgid "" +"Whichever method you choose, it's important to name your Capsules properly. " +"The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " +"char \\*`); you're permitted to pass in a ``NULL`` name, but we strongly " +"encourage you to specify a name. Properly named Capsules provide a degree " +"of runtime type-safety; there is no feasible way to tell one unnamed Capsule" +" from another." +msgstr "" +"هر روشی را که انتخاب کنید، مهم است که کپسول‌های خود را به‌درستی نام‌گذاری " +"کنید. تابع :c:func:`PyCapsule_New` یک پارامتر نام می‌گیرد (:c:expr:`const " +"char \\*`)؛ شما مجازید نام ``NULL`` ارسال کنید، اما ما به‌شدت توصیه می‌کنیم " +"که نامی مشخص کنید. کپسول‌های به‌درستی نام‌گذاری‌شده درجه‌ای از ایمنی نوع در " +"زمان اجرا فراهم می‌کنند؛ هیچ راه عملی‌ای برای تمایز یک کپسول بدون نام از " +"کپسول دیگر وجود ندارد." -msgid "In particular, Capsules used to expose C APIs should be given a name following this convention::" +msgid "" +"In particular, Capsules used to expose C APIs should be given a name " +"following this convention::" msgstr "" +"به‌طور خاص، کپسول‌هایی (Capsule) که برای افشای APIهای C استفاده می‌شوند، " +"باید مطابق این قرارداد نام‌گذاری شوند::" msgid "modulename.attributename" -msgstr "" +msgstr "modulename.attributename" -msgid "The convenience function :c:func:`PyCapsule_Import` makes it easy to load a C API provided via a Capsule, but only if the Capsule's name matches this convention. This behavior gives C API users a high degree of certainty that the Capsule they load contains the correct C API." +msgid "" +"The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " +"C API provided via a Capsule, but only if the Capsule's name matches this " +"convention. This behavior gives C API users a high degree of certainty that" +" the Capsule they load contains the correct C API." msgstr "" +"تابع راحتی :c:func:`PyCapsule_Import` بارگذاری یک C API که از طریق یک کپسول " +"ارائه شده را آسان می‌کند، اما تنها در صورتی که نام کپسول با این قرارداد " +"مطابقت داشته باشد. این رفتار به کاربران C API درجه بالایی از اطمینان می‌دهد" +" که کپسولی که بارگذاری می‌کنند، C API صحیح را در بر دارد." -msgid "The following example demonstrates an approach that puts most of the burden on the writer of the exporting module, which is appropriate for commonly used library modules. It stores all C API pointers (just one in the example!) in an array of :c:expr:`void` pointers which becomes the value of a Capsule. The header file corresponding to the module provides a macro that takes care of importing the module and retrieving its C API pointers; client modules only have to call this macro before accessing the C API." -msgstr "" +msgid "" +"The following example demonstrates an approach that puts most of the burden " +"on the writer of the exporting module, which is appropriate for commonly " +"used library modules. It stores all C API pointers (just one in the " +"example!) in an array of :c:expr:`void` pointers which becomes the value of " +"a Capsule. The header file corresponding to the module provides a macro that" +" takes care of importing the module and retrieving its C API pointers; " +"client modules only have to call this macro before accessing the C API." +msgstr "" +"مثال زیر رویکردی را نشان می‌دهد که بیشتر بار را بر دوش نویسنده ماژول " +"صادرکننده قرار می‌دهد، که برای ماژول‌های کتابخانه‌ای پرکاربرد مناسب است. این" +" رویکرد تمام اشاره‌گرهای C API (در مثال فقط یکی!) را در آرایه‌ای از " +"اشاره‌گرهای :c:expr:`void` ذخیره می‌کند که مقدار یک کپسول (Capsule) می‌شود. " +"پرونده سرآیند متناظر با ماژول، ماکرویی را فراهم می‌کند که کار ایمپورت کردن " +"ماژول و بازیابی اشاره‌گرهای C API آن را انجام می‌دهد؛ ماژول‌های کلاینت تنها " +"باید پیش از دسترسی به C API این ماکرو را فراخوانی کنند." -msgid "The exporting module is a modification of the :mod:`!spam` module from section :ref:`extending-simpleexample`. The function :func:`!spam.system` does not call the C library function :c:func:`system` directly, but a function :c:func:`!PySpam_System`, which would of course do something more complicated in reality (such as adding \"spam\" to every command). This function :c:func:`!PySpam_System` is also exported to other extension modules." -msgstr "" +msgid "" +"The exporting module is a modification of the :mod:`!spam` module from " +"section :ref:`extending-simpleexample`. The function :func:`!spam.system` " +"does not call the C library function :c:func:`system` directly, but a " +"function :c:func:`!PySpam_System`, which would of course do something more " +"complicated in reality (such as adding \"spam\" to every command). This " +"function :c:func:`!PySpam_System` is also exported to other extension " +"modules." +msgstr "" +"ماژول صادرکننده، نسخه‌ی تغییر‌یافته‌ای از ماژول :mod:`!spam` در بخش " +":ref:`extending-simpleexample` است. تابع :func:`!spam.system` مستقیماً تابع " +":c:func:`system` از کتابخانه‌ی C را فراخوانی نمی‌کند، بلکه تابع " +":c:func:`!PySpam_System` را فراخوانی می‌کند که البته در واقعیت کاری " +"پیچیده‌تر انجام می‌دهد (مانند افزودن \"spam\" به هر دستور). این تابع " +":c:func:`!PySpam_System` همچنین به ماژول‌های توسعه‌ای دیگر صادر می‌شود." -msgid "The function :c:func:`!PySpam_System` is a plain C function, declared ``static`` like everything else::" +msgid "" +"The function :c:func:`!PySpam_System` is a plain C function, declared " +"``static`` like everything else::" msgstr "" +"تابع :c:func:`!PySpam_System` یک تابع C ساده است که مانند بقیه موارد به‌صورت" +" ``static`` اعلان شده است::" msgid "" "static int\n" @@ -952,9 +2541,14 @@ msgid "" " return system(command);\n" "}" msgstr "" +"static int\n" +"PySpam_System(const char *command)\n" +"{\n" +" return system(command);\n" +"}" msgid "The function :c:func:`!spam_system` is modified in a trivial way::" -msgstr "" +msgstr "تابع :c:func:`!spam_system` به شکلی ساده تغییر داده می‌شود::" msgid "" "static PyObject *\n" @@ -969,23 +2563,44 @@ msgid "" " return PyLong_FromLong(sts);\n" "}" msgstr "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = PySpam_System(command);\n" +" return PyLong_FromLong(sts);\n" +"}" msgid "In the beginning of the module, right after the line ::" -msgstr "" +msgstr "در ابتدای ماژول، درست پس از سطر ::" msgid "#include " -msgstr "" +msgstr "#include " msgid "two more lines must be added::" -msgstr "" +msgstr "دو سطر دیگر باید افزوده شود::" msgid "" "#define SPAM_MODULE\n" "#include \"spammodule.h\"" msgstr "" +"#define SPAM_MODULE\n" +"#include \"spammodule.h\"" -msgid "The ``#define`` is used to tell the header file that it is being included in the exporting module, not a client module. Finally, the module's :c:data:`mod_exec ` function must take care of initializing the C API pointer array::" +msgid "" +"The ``#define`` is used to tell the header file that it is being included in" +" the exporting module, not a client module. Finally, the module's " +":c:data:`mod_exec ` function must take care of initializing the" +" C API pointer array::" msgstr "" +"از ``#define`` استفاده می‌شود تا به پرونده سرآیند بگوید که در ماژول " +"صادرکننده گنجانده می‌شود، نه در یک ماژول کلاینت. در نهایت، تابع " +":c:data:`mod_exec ` ماژول باید مقداردهی اولیه‌ی آرایه " +"اشاره‌گرهای C API را بر عهده بگیرد::" msgid "" "static int\n" @@ -1007,12 +2622,39 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"spam_module_exec(PyObject *m)\n" +"{\n" +" static void *PySpam_API[PySpam_API_pointers];\n" +" PyObject *c_api_object;\n" +"\n" +" /* Initialize the C API pointer array */\n" +" PySpam_API[PySpam_System_NUM] = (void *)PySpam_System;\n" +"\n" +" /* Create a Capsule containing the API pointer array's address */\n" +" c_api_object = PyCapsule_New((void *)PySpam_API, \"spam._C_API\", NULL);\n" +"\n" +" if (PyModule_Add(m, \"_C_API\", c_api_object) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}" -msgid "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array would disappear when :c:func:`!PyInit_spam` terminates!" +msgid "" +"Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array" +" would disappear when :c:func:`!PyInit_spam` terminates!" msgstr "" +"توجه داشته باشید که ``PySpam_API`` به‌صورت ``static`` تعریف شده است؛ در غیر " +"این صورت، آرایه اشاره‌گرها با خاتمه‌یافتن :c:func:`!PyInit_spam` ناپدید " +"می‌شد!" -msgid "The bulk of the work is in the header file :file:`spammodule.h`, which looks like this::" +msgid "" +"The bulk of the work is in the header file :file:`spammodule.h`, which looks" +" like this::" msgstr "" +"بخش عمده‌ی کار در پرونده سرآیند :file:`spammodule.h` قرار دارد که به این شکل" +" است::" msgid "" "#ifndef Py_SPAMMODULE_H\n" @@ -1063,9 +2705,63 @@ msgid "" "\n" "#endif /* !defined(Py_SPAMMODULE_H) */" msgstr "" +"#ifndef Py_SPAMMODULE_H\n" +"#define Py_SPAMMODULE_H\n" +"#ifdef __cplusplus\n" +"extern \"C\" {\n" +"#endif\n" +"\n" +"/* Header file for spammodule */\n" +"\n" +"/* C API functions */\n" +"#define PySpam_System_NUM 0\n" +"#define PySpam_System_RETURN int\n" +"#define PySpam_System_PROTO (const char *command)\n" +"\n" +"/* Total number of C API pointers */\n" +"#define PySpam_API_pointers 1\n" +"\n" +"\n" +"#ifdef SPAM_MODULE\n" +"/* This section is used when compiling spammodule.c */\n" +"\n" +"static PySpam_System_RETURN PySpam_System PySpam_System_PROTO;\n" +"\n" +"#else\n" +"/* This section is used in modules that use spammodule's API */\n" +"\n" +"static void **PySpam_API;\n" +"\n" +"#define PySpam_System \\\n" +" (*(PySpam_System_RETURN (*)PySpam_System_PROTO) PySpam_API[PySpam_System_NUM])\n" +"\n" +"/* Return -1 on error, 0 on success.\n" +" * PyCapsule_Import will set an exception if there's an error.\n" +" */\n" +"static int\n" +"import_spam(void)\n" +"{\n" +" PySpam_API = (void **)PyCapsule_Import(\"spam._C_API\", 0);\n" +" return (PySpam_API != NULL) ? 0 : -1;\n" +"}\n" +"\n" +"#endif\n" +"\n" +"#ifdef __cplusplus\n" +"}\n" +"#endif\n" +"\n" +"#endif /* !defined(Py_SPAMMODULE_H) */" -msgid "All that a client module must do in order to have access to the function :c:func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!import_spam` in its :c:data:`mod_exec ` function::" +msgid "" +"All that a client module must do in order to have access to the function " +":c:func:`!PySpam_System` is to call the function (or rather macro) " +":c:func:`!import_spam` in its :c:data:`mod_exec ` function::" msgstr "" +"تنها کاری که یک ماژول کلاینت باید انجام دهد تا به تابع " +":c:func:`!PySpam_System` دسترسی داشته باشد، این است که تابع (یا بهتر بگوییم،" +" ماکرو) :c:func:`!import_spam` را در تابع :c:data:`mod_exec ` " +"خود فراخوانی کند::" msgid "" "static int\n" @@ -1078,36 +2774,81 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"client_module_exec(PyObject *m)\n" +"{\n" +" if (import_spam() < 0) {\n" +" return -1;\n" +" }\n" +" /* additional initialization can happen here */\n" +" return 0;\n" +"}" -msgid "The main disadvantage of this approach is that the file :file:`spammodule.h` is rather complicated. However, the basic structure is the same for each function that is exported, so it has to be learned only once." +msgid "" +"The main disadvantage of this approach is that the file :file:`spammodule.h`" +" is rather complicated. However, the basic structure is the same for each " +"function that is exported, so it has to be learned only once." msgstr "" +"عیب اصلی این رویکرد این است که پرونده‌ی :file:`spammodule.h` نسبتاً پیچیده " +"است. با این حال، ساختار پایه برای هر تابعی که صادر می‌شود یکسان است، " +"بنابراین تنها یک بار باید یاد گرفته شود." -msgid "Finally it should be mentioned that Capsules offer additional functionality, which is especially useful for memory allocation and deallocation of the pointer stored in a Capsule. The details are described in the Python/C API Reference Manual in the section :ref:`capsules` and in the implementation of Capsules (files :file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` in the Python source code distribution)." -msgstr "" +msgid "" +"Finally it should be mentioned that Capsules offer additional functionality," +" which is especially useful for memory allocation and deallocation of the " +"pointer stored in a Capsule. The details are described in the Python/C API " +"Reference Manual in the section :ref:`capsules` and in the implementation of" +" Capsules (files :file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c`" +" in the Python source code distribution)." +msgstr "" +"در نهایت باید اشاره کرد که کپسول‌ها (Capsules) قابلیت‌های بیشتری ارائه " +"می‌دهند که به‌ویژه برای تخصیص و آزادسازی حافظه‌ی اشاره‌گری که در کپسول ذخیره" +" شده است، مفید است. جزئیات در راهنمای مرجع Python/C API، در بخش " +":ref:`capsules` و در پیاده‌سازی کپسول‌ها (پرونده‌های " +":file:`Include/pycapsule.h` و :file:`Objects/pycapsule.c` در توزیع کد منبع " +"پایتون) شرح داده شده است." msgid "Footnotes" -msgstr "" +msgstr "پانوشت‌ها" -msgid "An interface for this function already exists in the standard module :mod:`os` --- it was chosen as a simple and straightforward example." +msgid "" +"An interface for this function already exists in the standard module " +":mod:`os` --- it was chosen as a simple and straightforward example." msgstr "" +"رابطی برای این تابع از پیش در ماژول استاندارد :mod:`os` وجود دارد --- این " +"تابع به‌عنوان مثالی ساده و سرراست انتخاب شد." -msgid "The metaphor of \"borrowing\" a reference is not completely correct: the owner still has a copy of the reference." +msgid "" +"The metaphor of \"borrowing\" a reference is not completely correct: the " +"owner still has a copy of the reference." msgstr "" +"استعاره‌ی «امانت گرفتنِ» ارجاع کاملاً درست نیست: مالک همچنان نسخه‌ای از " +"ارجاع را در اختیار دارد." -msgid "Checking that the reference count is at least 1 **does not work** --- the reference count itself could be in freed memory and may thus be reused for another object!" +msgid "" +"Checking that the reference count is at least 1 **does not work** --- the " +"reference count itself could be in freed memory and may thus be reused for " +"another object!" msgstr "" +"بررسی اینکه شمارش ارجاع دست‌کم ۱ باشد **کار نمی‌کند** --- خودِ شمارش ارجاع " +"ممکن است در حافظه‌ی آزادشده باشد و بدین‌ترتیب برای شیء دیگری بازاستفاده شود!" -msgid "These guarantees don't hold when you use the \"old\" style calling convention --- this is still found in much existing code." +msgid "" +"These guarantees don't hold when you use the \"old\" style calling " +"convention --- this is still found in much existing code." msgstr "" +"این تضمین‌ها هنگامی که شما از قرارداد فراخوانی به سبک «قدیمی» استفاده " +"می‌کنید، برقرار نیستند --- این سبک همچنان در بسیاری از کدهای موجود یافت " +"می‌شود." msgid "PyObject_CallObject (C function)" -msgstr "" +msgstr "PyObject_CallObject (تابع C)" msgid "PyArg_ParseTuple (C function)" -msgstr "" +msgstr "PyArg_ParseTuple (تابع C)" msgid "PyArg_ParseTupleAndKeywords (C function)" -msgstr "" +msgstr "PyArg_ParseTupleAndKeywords (تابع C)" msgid "Philbrick, Geoff" -msgstr "" +msgstr "Philbrick, Geoff" diff --git a/extending/index.po b/extending/index.po index 17852e6af..9840f274b 100644 --- a/extending/index.po +++ b/extending/index.po @@ -22,34 +22,84 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Extending and Embedding the Python Interpreter" -msgstr "" +msgstr "توسعه و جاسازی مفسر پایتون" -msgid "This document describes how to write modules in C or C++ to extend the Python interpreter with new modules. Those modules can not only define new functions but also new object types and their methods. The document also describes how to embed the Python interpreter in another application, for use as an extension language. Finally, it shows how to compile and link extension modules so that they can be loaded dynamically (at run time) into the interpreter, if the underlying operating system supports this feature." +msgid "" +"This document describes how to write modules in C or C++ to extend the " +"Python interpreter with new modules. Those modules can not only define new " +"functions but also new object types and their methods. The document also " +"describes how to embed the Python interpreter in another application, for " +"use as an extension language. Finally, it shows how to compile and link " +"extension modules so that they can be loaded dynamically (at run time) into " +"the interpreter, if the underlying operating system supports this feature." msgstr "" +"این سند توضیح می‌دهد که چگونه می‌توان ماژول‌هایی به زبان C یا C++ نوشت تا " +"مفسر پایتون با ماژول‌های جدید توسعه یابد. این ماژول‌ها نه‌تنها توابع جدید، " +"بلکه نوع‌های جدید شیء و متدهای آن‌ها را نیز می‌توانند تعریف کنند. این سند " +"همچنین توضیح می‌دهد که چگونه می‌توان مفسر پایتون را در برنامه‌ای دیگر جاسازی" +" کرد تا به‌عنوان یک زبان توسعه‌ای از آن استفاده شود. در نهایت، نشان می‌دهد " +"که چگونه می‌توان ماژول‌های توسعه‌ای را کامپایل و پیوند داد تا در صورت " +"پشتیبانی سیستم‌عامل زیرین از این قابلیت، به‌صورت پویا (در زمان اجرا) در مفسر" +" بارگذاری شوند." -msgid "This document assumes basic knowledge about Python. For an informal introduction to the language, see :ref:`tutorial-index`. :ref:`reference-index` gives a more formal definition of the language. :ref:`library-index` documents the existing object types, functions and modules (both built-in and written in Python) that give the language its wide application range." +msgid "" +"This document assumes basic knowledge about Python. For an informal " +"introduction to the language, see :ref:`tutorial-index`. :ref:`reference-" +"index` gives a more formal definition of the language. :ref:`library-index`" +" documents the existing object types, functions and modules (both built-in " +"and written in Python) that give the language its wide application range." msgstr "" +"این سند فرض می‌کند که شما دانش پایه‌ای از پایتون دارید. برای معرفی غیررسمی " +"زبان، :ref:`tutorial-index` را ببینید. :ref:`reference-index` تعریف رسمی‌تری" +" از زبان ارائه می‌دهد. :ref:`library-index` نوع‌های شیء، توابع و ماژول‌های " +"موجود (هم توکار و هم نوشته‌شده به پایتون) را مستند می‌کند که دامنه‌ی کاربرد " +"گسترده‌ی زبان را فراهم می‌کنند." -msgid "For a detailed description of the whole Python/C API, see the separate :ref:`c-api-index`." +msgid "" +"For a detailed description of the whole Python/C API, see the separate " +":ref:`c-api-index`." msgstr "" +"برای شرح دقیق کل Python/C API، به :ref:`c-api-index` جداگانه مراجعه کنید." msgid "Recommended third party tools" -msgstr "" +msgstr "ابزارهای شخص ثالث توصیه‌شده" -msgid "This guide only covers the basic tools for creating extensions provided as part of this version of CPython. Some :ref:`third party tools ` offer both simpler and more sophisticated approaches to creating C and C++ extensions for Python." +msgid "" +"This guide only covers the basic tools for creating extensions provided as " +"part of this version of CPython. Some :ref:`third party tools `" +" offer both simpler and more sophisticated approaches to creating C and C++ " +"extensions for Python." msgstr "" +"این راهنما تنها ابزارهای پایه‌ای را پوشش می‌دهد که به‌عنوان بخشی از این نسخه" +" از سی‌پایتون برای ایجاد افزونه‌ها ارائه شده‌اند. برخی از :ref:`ابزارهای شخص" +" ثالث ` رویکردهایی هم ساده‌تر و هم پیشرفته‌تر برای ایجاد " +"افزونه‌های C و C++ برای پایتون ارائه می‌دهند." msgid "Creating extensions without third party tools" -msgstr "" +msgstr "ایجاد توسعه‌ها بدون ابزارهای شخص ثالث" -msgid "This section of the guide covers creating C and C++ extensions without assistance from third party tools. It is intended primarily for creators of those tools, rather than being a recommended way to create your own C extensions." +msgid "" +"This section of the guide covers creating C and C++ extensions without " +"assistance from third party tools. It is intended primarily for creators of " +"those tools, rather than being a recommended way to create your own C " +"extensions." msgstr "" +"این بخش از راهنما به ایجاد توسعه‌های C و C++ بدون کمک گرفتن از ابزارهای شخص " +"ثالث می‌پردازد. این بخش در درجه‌ی اول برای سازندگان آن ابزارها در نظر گرفته " +"شده است، نه اینکه روش توصیه‌شده‌ای برای ایجاد توسعه‌های C خودتان باشد." msgid ":pep:`489` -- Multi-phase extension module initialization" -msgstr "" +msgstr ":pep:`489` -- مقداردهی اولیه‌ی چندمرحله‌ای ماژول توسعه‌ای" msgid "Embedding the CPython runtime in a larger application" -msgstr "" +msgstr "تعبیه ران‌تایم سی‌پایتون در برنامه‌ای بزرگ‌تر" -msgid "Sometimes, rather than creating an extension that runs inside the Python interpreter as the main application, it is desirable to instead embed the CPython runtime inside a larger application. This section covers some of the details involved in doing that successfully." +msgid "" +"Sometimes, rather than creating an extension that runs inside the Python " +"interpreter as the main application, it is desirable to instead embed the " +"CPython runtime inside a larger application. This section covers some of the" +" details involved in doing that successfully." msgstr "" +"گاهی، به‌جای ایجاد افزونه‌ای که درون مفسر پایتون به‌عنوان برنامه اصلی اجرا " +"می‌شود، مطلوب است که ران‌تایم سی‌پایتون درون برنامه‌ای بزرگ‌تر جاسازی شود. " +"این بخش برخی از جزئیات مربوط به انجام موفقیت‌آمیز این کار را در بر می‌گیرد." diff --git a/extending/newtypes.po b/extending/newtypes.po index 560920b51..e31570156 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"PO-Revision-Date: 2026-09-04 20:29+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,15 +23,25 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Defining Extension Types: Assorted Topics" -msgstr "" +msgstr "تعریف نوع‌های توسعه‌ای: موضوعات گوناگون" -msgid "This section aims to give a quick fly-by on the various type methods you can implement and what they do." +msgid "" +"This section aims to give a quick fly-by on the various type methods you can" +" implement and what they do." msgstr "" +"هدف این بخش، ارائه‌ی مروری سریع و گذرا بر متدهای مختلف نوع است؛ متدهایی که " +"می‌توانید پیاده‌سازی کنید و اینکه هر یک چه کاری انجام می‌دهند." -msgid "Here is the definition of :c:type:`PyTypeObject`, with some fields only used in :ref:`debug builds ` omitted:" +msgid "" +"Here is the definition of :c:type:`PyTypeObject`, with some fields only used" +" in :ref:`debug builds ` omitted:" msgstr "" +"در ادامه، تعریف :c:type:`PyTypeObject` آمده است؛ برخی از فیلدهایی که تنها در" +" :ref:`بیلدهای اشکال‌زدایی ` استفاده می‌شوند، از آن حذف " +"شده‌اند:" msgid "" "typedef struct _typeobject {\n" @@ -130,42 +140,190 @@ msgid "" " uint16_t tp_versions_used;\n" "} PyTypeObject;\n" msgstr "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" PyMethodDef *tp_methods;\n" +" PyMemberDef *tp_members;\n" +" PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" PyTypeObject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache; /* no longer used */\n" +" void *tp_subclasses; /* for static builtin types this is an index */\n" +" PyObject *tp_weaklist; /* not used for static builtin types */\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6.\n" +" * If zero, the cache is invalid and must be initialized.\n" +" */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"\n" +" /* Number of tp_version_tag values used.\n" +" * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is\n" +" * disabled for this type (e.g. due to custom MRO entries).\n" +" * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere).\n" +" */\n" +" uint16_t tp_versions_used;\n" +"} PyTypeObject;\n" -msgid "Now that's a *lot* of methods. Don't worry too much though -- if you have a type you want to define, the chances are very good that you will only implement a handful of these." +msgid "" +"Now that's a *lot* of methods. Don't worry too much though -- if you have a" +" type you want to define, the chances are very good that you will only " +"implement a handful of these." msgstr "" +"خب، این *تعداد زیادی* متد است. البته زیاد نگران نباشید -- اگر نوعی دارید که" +" می‌خواهید تعریف کنید، به احتمال بسیار زیاد فقط چند مورد از آن‌ها را " +"پیاده‌سازی خواهید کرد." -msgid "As you probably expect by now, we're going to go over this and give more information about the various handlers. We won't go in the order they are defined in the structure, because there is a lot of historical baggage that impacts the ordering of the fields. It's often easiest to find an example that includes the fields you need and then change the values to suit your new type. ::" -msgstr "" +msgid "" +"As you probably expect by now, we're going to go over this and give more " +"information about the various handlers. We won't go in the order they are " +"defined in the structure, because there is a lot of historical baggage that " +"impacts the ordering of the fields. It's often easiest to find an example " +"that includes the fields you need and then change the values to suit your " +"new type. ::" +msgstr "" +"همان‌طور که احتمالاً تاکنون انتظار دارید، می‌خواهیم این موارد را مرور کنیم و" +" اطلاعات بیشتری درباره هندلرهای گوناگون ارائه دهیم. به ترتیبی که در ساختار " +"تعریف شده‌اند پیش نمی‌رویم، زیرا میراث تاریخی فراوانی وجود دارد که بر ترتیب " +"فیلدها تأثیر می‌گذارد. اغلب ساده‌ترین راه این است که مثالی بیابید که فیلدهای" +" مورد نیازتان را در بر داشته باشد و سپس مقادیر را متناسب با نوع جدید خود " +"تغییر دهید. ::" msgid "const char *tp_name; /* For printing */" -msgstr "" +msgstr "const char *tp_name; /* برای چاپ */" -msgid "The name of the type -- as mentioned in the previous chapter, this will appear in various places, almost entirely for diagnostic purposes. Try to choose something that will be helpful in such a situation! ::" +msgid "" +"The name of the type -- as mentioned in the previous chapter, this will " +"appear in various places, almost entirely for diagnostic purposes. Try to " +"choose something that will be helpful in such a situation! ::" msgstr "" +"نام نوع — همان‌طور که در فصل پیشین ذکر شد، این نام در مکان‌های مختلف ظاهر " +"خواهد شد، تقریباً به‌طور کامل برای اهداف تشخیصی. سعی کنید چیزی را برگزینید " +"که در چنین موقعیتی سودمند باشد! ::" msgid "Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */" -msgstr "" +msgstr "Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */" -msgid "These fields tell the runtime how much memory to allocate when new objects of this type are created. Python has some built-in support for variable length structures (think: strings, tuples) which is where the :c:member:`~PyTypeObject.tp_itemsize` field comes in. This will be dealt with later. ::" -msgstr "" +msgid "" +"These fields tell the runtime how much memory to allocate when new objects " +"of this type are created. Python has some built-in support for variable " +"length structures (think: strings, tuples) which is where the " +":c:member:`~PyTypeObject.tp_itemsize` field comes in. This will be dealt " +"with later. ::" +msgstr "" +"این فیلدها به ران‌تایم می‌گویند که هنگام ایجاد اشیاء جدید از این نوع، چه " +"مقدار حافظه تخصیص دهد. پایتون پشتیبانی توکاری برای ساختارهای با طول متغیر " +"دارد (مثلاً: رشته‌ها، تاپل‌ها) و این همان جایی است که فیلد " +":c:member:`~PyTypeObject.tp_itemsize` به کار می‌آید. این موضوع بعداً بررسی " +"خواهد شد. ::" msgid "const char *tp_doc;" -msgstr "" +msgstr "const char *tp_doc;" -msgid "Here you can put a string (or its address) that you want returned when the Python script references ``obj.__doc__`` to retrieve the doc string." +msgid "" +"Here you can put a string (or its address) that you want returned when the " +"Python script references ``obj.__doc__`` to retrieve the doc string." msgstr "" +"در اینجا می‌توانید رشته‌ای (یا آدرس آن) را قرار دهید که می‌خواهید هنگامی که " +"اسکریپت پایتون برای بازیابی رشته مستند به ``obj.__doc__`` ارجاع می‌دهد، " +"بازگردانده شود." -msgid "Now we come to the basic type methods -- the ones most extension types will implement." +msgid "" +"Now we come to the basic type methods -- the ones most extension types will " +"implement." msgstr "" +"اکنون به متدهای پایه‌ی نوع می‌رسیم -- همان‌هایی که بیشتر نوع‌های توسعه‌ای " +"آن‌ها را پیاده‌سازی خواهند کرد." msgid "Finalization and De-allocation" -msgstr "" +msgstr "نهایی‌سازی و آزادسازی" msgid "destructor tp_dealloc;" -msgstr "" +msgstr "destructor tp_dealloc;" -msgid "This function is called when the reference count of the instance of your type is reduced to zero and the Python interpreter wants to reclaim it. If your type has memory to free or other clean-up to perform, you can put it here. The object itself needs to be freed here as well. Here is an example of this function::" -msgstr "" +msgid "" +"This function is called when the reference count of the instance of your " +"type is reduced to zero and the Python interpreter wants to reclaim it. If " +"your type has memory to free or other clean-up to perform, you can put it " +"here. The object itself needs to be freed here as well. Here is an example" +" of this function::" +msgstr "" +"این تابع زمانی فراخوانی می‌شود که شمارش ارجاع نمونه‌ی نوع شما به صفر کاهش " +"یابد و مفسر پایتون بخواهد آن را بازپس‌گیری کند. اگر نوع شما حافظه‌ای برای " +"آزاد کردن یا پاک‌سازی دیگری برای انجام دارد، می‌توانید آن را اینجا قرار " +"دهید. خود شیء نیز باید در اینجا آزاد شود. در ادامه مثالی از این تابع آمده " +"است::" msgid "" "static void\n" @@ -176,9 +334,20 @@ msgid "" " Py_TYPE(self)->tp_free(self);\n" "}" msgstr "" +"static void\n" +"newdatatype_dealloc(PyObject *op)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" free(self->obj_UnderlyingDatatypePtr);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" -msgid "If your type supports garbage collection, the destructor should call :c:func:`PyObject_GC_UnTrack` before clearing any member fields::" +msgid "" +"If your type supports garbage collection, the destructor should call " +":c:func:`PyObject_GC_UnTrack` before clearing any member fields::" msgstr "" +"اگر نوع شما از زباله‌روبی پشتیبانی کند، مخرب باید پیش از پاک کردن هر یک از " +"فیلدهای عضو، :c:func:`PyObject_GC_UnTrack` را فراخوانی کند::" msgid "" "static void\n" @@ -191,9 +360,40 @@ msgid "" " Py_TYPE(self)->tp_free(self);\n" "}" msgstr "" +"static void\n" +"newdatatype_dealloc(PyObject *op)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" PyObject_GC_UnTrack(op);\n" +" Py_CLEAR(self->other_obj);\n" +" ...\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" -msgid "One important requirement of the deallocator function is that it leaves any pending exceptions alone. This is important since deallocators are frequently called as the interpreter unwinds the Python stack; when the stack is unwound due to an exception (rather than normal returns), nothing is done to protect the deallocators from seeing that an exception has already been set. Any actions which a deallocator performs which may cause additional Python code to be executed may detect that an exception has been set. This can lead to misleading errors from the interpreter. The proper way to protect against this is to save a pending exception before performing the unsafe action, and restoring it when done. This can be done using the :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` functions::" -msgstr "" +msgid "" +"One important requirement of the deallocator function is that it leaves any " +"pending exceptions alone. This is important since deallocators are " +"frequently called as the interpreter unwinds the Python stack; when the " +"stack is unwound due to an exception (rather than normal returns), nothing " +"is done to protect the deallocators from seeing that an exception has " +"already been set. Any actions which a deallocator performs which may cause " +"additional Python code to be executed may detect that an exception has been " +"set. This can lead to misleading errors from the interpreter. The proper " +"way to protect against this is to save a pending exception before performing" +" the unsafe action, and restoring it when done. This can be done using the " +":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` functions::" +msgstr "" +"یکی از الزامات مهم تابع تخصیص‌زدا (deallocator) این است که هرگونه استثنای در" +" انتظار را دست‌نخورده بگذارد. این موضوع اهمیت دارد، زیرا تخصیص‌زداها اغلب " +"هنگام باز شدن پشته پایتون توسط مفسر فراخوانی می‌شوند؛ وقتی پشته به دلیل یک " +"استثنا (و نه بازگشت‌های عادی) باز می‌شود، هیچ کنشی انجام نمی‌شود تا از " +"تخصیص‌زداها در برابر دیدن این موضوع که از پیش استثنایی تنظیم شده است محافظت " +"شود. هر کنشی که تخصیص‌زدا انجام می‌دهد و ممکن است باعث اجرای کد پایتون دیگری" +" شود، ممکن است تشخیص دهد که استثنایی تنظیم شده است. این می‌تواند به خطاهای " +"گمراه‌کننده از سوی مفسر منجر شود. راه درست برای محافظت در برابر این موضوع، " +"ذخیره کردن استثنای در انتظار پیش از انجام کنش نا‌ایمن و بازگردانی آن پس از " +"اتمام کار است. این کار را می‌توان با استفاده از توابع :c:func:`PyErr_Fetch` " +"و :c:func:`PyErr_Restore` انجام داد::" msgid "" "static void\n" @@ -224,29 +424,97 @@ msgid "" " Py_TYPE(self)->tp_free(self);\n" "}" msgstr "" +"static void\n" +"my_dealloc(PyObject *obj)\n" +"{\n" +" MyObject *self = (MyObject *) obj;\n" +" PyObject *cbresult;\n" +"\n" +" if (self->my_callback != NULL) {\n" +" PyObject *err_type, *err_value, *err_traceback;\n" +"\n" +" /* This saves the current exception state */\n" +" PyErr_Fetch(&err_type, &err_value, &err_traceback);\n" +"\n" +" cbresult = PyObject_CallNoArgs(self->my_callback);\n" +" if (cbresult == NULL) {\n" +" PyErr_WriteUnraisable(self->my_callback);\n" +" }\n" +" else {\n" +" Py_DECREF(cbresult);\n" +" }\n" +"\n" +" /* This restores the saved exception state */\n" +" PyErr_Restore(err_type, err_value, err_traceback);\n" +"\n" +" Py_DECREF(self->my_callback);\n" +" }\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" -msgid "There are limitations to what you can safely do in a deallocator function. First, if your type supports garbage collection (using :c:member:`~PyTypeObject.tp_traverse` and/or :c:member:`~PyTypeObject.tp_clear`), some of the object's members can have been cleared or finalized by the time :c:member:`~PyTypeObject.tp_dealloc` is called. Second, in :c:member:`~PyTypeObject.tp_dealloc`, your object is in an unstable state: its reference count is equal to zero. Any call to a non-trivial object or API (as in the example above) might end up calling :c:member:`~PyTypeObject.tp_dealloc` again, causing a double free and a crash." -msgstr "" +msgid "" +"There are limitations to what you can safely do in a deallocator function. " +"First, if your type supports garbage collection (using " +":c:member:`~PyTypeObject.tp_traverse` and/or " +":c:member:`~PyTypeObject.tp_clear`), some of the object's members can have " +"been cleared or finalized by the time :c:member:`~PyTypeObject.tp_dealloc` " +"is called. Second, in :c:member:`~PyTypeObject.tp_dealloc`, your object is " +"in an unstable state: its reference count is equal to zero. Any call to a " +"non-trivial object or API (as in the example above) might end up calling " +":c:member:`~PyTypeObject.tp_dealloc` again, causing a double free and a " +"crash." +msgstr "" +"کارهایی که می‌توانید به‌طور ایمن در یک تابع آزادساز (deallocator) انجام " +"دهید، محدودیت‌هایی دارد. نخست، اگر نوع شما از زباله‌روبی پشتیبانی کند (با " +"استفاده از :c:member:`~PyTypeObject.tp_traverse` و/یا " +":c:member:`~PyTypeObject.tp_clear`)، ممکن است برخی از اعضای شیء تا زمانی که" +" :c:member:`~PyTypeObject.tp_dealloc` فراخوانی می‌شود، پاک‌سازی یا " +"نهایی‌سازی شده باشند. دوم، در :c:member:`~PyTypeObject.tp_dealloc`، شیء شما " +"در وضعیتی ناپایدار قرار دارد: شمارش ارجاع آن برابر با صفر است. هر فراخوانی " +"شیء یا API غیربدیهی (مانند مثال بالا) ممکن است در نهایت " +":c:member:`~PyTypeObject.tp_dealloc` را دوباره فراخوانی کند و موجب آزادسازی " +"دوباره (double free) و فروپاشی شود." -msgid "Starting with Python 3.4, it is recommended not to put any complex finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use the new :c:member:`~PyTypeObject.tp_finalize` type method." +msgid "" +"Starting with Python 3.4, it is recommended not to put any complex " +"finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use " +"the new :c:member:`~PyTypeObject.tp_finalize` type method." msgstr "" +"از پایتون 3.4 به بعد، توصیه می‌شود هیچ کد نهایی‌سازی پیچیده‌ای در " +":c:member:`~PyTypeObject.tp_dealloc` قرار ندهید و در عوض از متد نوع جدید " +":c:member:`~PyTypeObject.tp_finalize` استفاده کنید." msgid ":pep:`442` explains the new finalization scheme." -msgstr "" +msgstr ":pep:`442` طرح جدید نهایی‌سازی را توضیح می‌دهد." msgid "Object Presentation" -msgstr "" +msgstr "نمایش شیء" -msgid "In Python, there are two ways to generate a textual representation of an object: the :func:`repr` function, and the :func:`str` function. (The :func:`print` function just calls :func:`str`.) These handlers are both optional." +msgid "" +"In Python, there are two ways to generate a textual representation of an " +"object: the :func:`repr` function, and the :func:`str` function. (The " +":func:`print` function just calls :func:`str`.) These handlers are both " +"optional." msgstr "" +"در پایتون، دو راه برای تولید نمایش متنی یک شیء وجود دارد: تابع :func:`repr` " +"و تابع :func:`str`. (تابع :func:`print` فقط :func:`str` را فراخوانی می‌کند.)" +" این هندلرها هر دو اختیاری هستند." msgid "" "reprfunc tp_repr;\n" "reprfunc tp_str;" msgstr "" +"reprfunc tp_repr;\n" +"reprfunc tp_str;" -msgid "The :c:member:`~PyTypeObject.tp_repr` handler should return a string object containing a representation of the instance for which it is called. Here is a simple example::" +msgid "" +"The :c:member:`~PyTypeObject.tp_repr` handler should return a string object " +"containing a representation of the instance for which it is called. Here is" +" a simple example::" msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_repr` باید یک شیء رشته را برگرداند که حاوی" +" نمایشی از نمونه‌ای باشد که برای آن فراخوانی می‌شود. در اینجا یک مثال ساده " +"آمده است::" msgid "" "static PyObject *\n" @@ -257,15 +525,43 @@ msgid "" " self->obj_UnderlyingDatatypePtr->size);\n" "}" msgstr "" +"static PyObject *\n" +"newdatatype_repr(PyObject *op)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" return PyUnicode_FromFormat(\"Repr-ified_newdatatype{{size:%d}}\",\n" +" self->obj_UnderlyingDatatypePtr->size);\n" +"}" -msgid "If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the interpreter will supply a representation that uses the type's :c:member:`~PyTypeObject.tp_name` and a uniquely identifying value for the object." +msgid "" +"If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the " +"interpreter will supply a representation that uses the type's " +":c:member:`~PyTypeObject.tp_name` and a uniquely identifying value for the " +"object." msgstr "" +"اگر هیچ هندلر :c:member:`~PyTypeObject.tp_repr` تعیین نشده باشد، مفسر " +"بازنمایی‌ای را فراهم می‌کند که از :c:member:`~PyTypeObject.tp_name` نوع و " +"مقداری که به‌طور یکتا شیء را شناسایی می‌کند، به کار می‌گیرد." -msgid "The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:member:`~PyTypeObject.tp_repr` handler described above is to :func:`repr`; that is, it is called when Python code calls :func:`str` on an instance of your object. Its implementation is very similar to the :c:member:`~PyTypeObject.tp_repr` function, but the resulting string is intended for human consumption. If :c:member:`~PyTypeObject.tp_str` is not specified, the :c:member:`~PyTypeObject.tp_repr` handler is used instead." -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the " +":c:member:`~PyTypeObject.tp_repr` handler described above is to " +":func:`repr`; that is, it is called when Python code calls :func:`str` on an" +" instance of your object. Its implementation is very similar to the " +":c:member:`~PyTypeObject.tp_repr` function, but the resulting string is " +"intended for human consumption. If :c:member:`~PyTypeObject.tp_str` is not " +"specified, the :c:member:`~PyTypeObject.tp_repr` handler is used instead." +msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_str` برای :func:`str` همان است که هندلر " +":c:member:`~PyTypeObject.tp_repr` که در بالا توضیح داده شد برای :func:`repr`" +" است؛ یعنی زمانی فراخوانی می‌شود که کد پایتون :func:`str` را روی نمونه‌ای از" +" شیء شما فراخوانی کند. پیاده‌سازی آن بسیار شبیه تابع " +":c:member:`~PyTypeObject.tp_repr` است، اما رشته‌ی حاصل برای خواندن توسط " +"انسان در نظر گرفته شده است. اگر :c:member:`~PyTypeObject.tp_str` مشخص نشده " +"باشد، از هندلر :c:member:`~PyTypeObject.tp_repr` استفاده می‌شود." msgid "Here is a simple example::" -msgstr "" +msgstr "در اینجا یک مثال ساده آمده است::" msgid "" "static PyObject *\n" @@ -276,15 +572,45 @@ msgid "" " self->obj_UnderlyingDatatypePtr->size);\n" "}" msgstr "" +"static PyObject *\n" +"newdatatype_str(PyObject *op)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" return PyUnicode_FromFormat(\"Stringified_newdatatype{{size:%d}}\",\n" +" self->obj_UnderlyingDatatypePtr->size);\n" +"}" msgid "Attribute Management" -msgstr "" +msgstr "مدیریت ویژگی" -msgid "For every object which can support attributes, the corresponding type must provide the functions that control how the attributes are resolved. There needs to be a function which can retrieve attributes (if any are defined), and another to set attributes (if setting attributes is allowed). Removing an attribute is a special case, for which the new value passed to the handler is ``NULL``." -msgstr "" +msgid "" +"For every object which can support attributes, the corresponding type must " +"provide the functions that control how the attributes are resolved. There " +"needs to be a function which can retrieve attributes (if any are defined), " +"and another to set attributes (if setting attributes is allowed). Removing " +"an attribute is a special case, for which the new value passed to the " +"handler is ``NULL``." +msgstr "" +"برای هر شیء که می‌تواند از ویژگی‌ها پشتیبانی کند، نوع متناظر باید توابعی را " +"فراهم کند که کنترل می‌کنند ویژگی‌ها چگونه حل می‌شوند. باید تابعی وجود داشته " +"باشد که بتواند ویژگی‌ها را بازیابی کند (در صورتی که ویژگی‌ای تعریف‌شده " +"باشد)، و تابع دیگری برای تنظیم ویژگی‌ها (در صورتی که تنظیم ویژگی‌ها مجاز " +"باشد). حذف یک ویژگی حالت خاصی است که در آن مقدار جدیدِ منتقل‌شده به هندلر " +"``NULL`` است." -msgid "Python supports two pairs of attribute handlers; a type that supports attributes only needs to implement the functions for one pair. The difference is that one pair takes the name of the attribute as a :c:expr:`char\\*`, while the other accepts a :c:expr:`PyObject*`. Each type can use whichever pair makes more sense for the implementation's convenience. ::" -msgstr "" +msgid "" +"Python supports two pairs of attribute handlers; a type that supports " +"attributes only needs to implement the functions for one pair. The " +"difference is that one pair takes the name of the attribute as a " +":c:expr:`char\\*`, while the other accepts a :c:expr:`PyObject*`. Each type" +" can use whichever pair makes more sense for the implementation's " +"convenience. ::" +msgstr "" +"پایتون از دو جفت هندلر ویژگی پشتیبانی می‌کند؛ نوعی که از ویژگی‌ها پشتیبانی " +"می‌کند، تنها باید توابع یکی از این جفت‌ها را پیاده‌سازی کند. تفاوت این است " +"که یک جفت، نام ویژگی را به‌صورت :c:expr:`char\\*` می‌گیرد، در حالی که جفت " +"دیگر :c:expr:`PyObject*` را می‌پذیرد. هر نوع می‌تواند از هر جفتی که برای " +"راحتی پیاده‌سازی منطقی‌تر باشد استفاده کند. ::" msgid "" "getattrfunc tp_getattr; /* char * version */\n" @@ -293,39 +619,99 @@ msgid "" "getattrofunc tp_getattro; /* PyObject * version */\n" "setattrofunc tp_setattro;" msgstr "" +"getattrfunc tp_getattr; /* char * version */\n" +"setattrfunc tp_setattr;\n" +"/* ... */\n" +"getattrofunc tp_getattro; /* PyObject * version */\n" +"setattrofunc tp_setattro;" -msgid "If accessing attributes of an object is always a simple operation (this will be explained shortly), there are generic implementations which can be used to provide the :c:expr:`PyObject*` version of the attribute management functions. The actual need for type-specific attribute handlers almost completely disappeared starting with Python 2.2, though there are many examples which have not been updated to use some of the new generic mechanism that is available." -msgstr "" +msgid "" +"If accessing attributes of an object is always a simple operation (this will" +" be explained shortly), there are generic implementations which can be used " +"to provide the :c:expr:`PyObject*` version of the attribute management " +"functions. The actual need for type-specific attribute handlers almost " +"completely disappeared starting with Python 2.2, though there are many " +"examples which have not been updated to use some of the new generic " +"mechanism that is available." +msgstr "" +"اگر دسترسی به ویژگی‌های یک شیء همیشه یک عملیات ساده باشد (این موضوع در ادامه" +" توضیح داده خواهد شد)، پیاده‌سازی‌های عامی وجود دارند که می‌توان از آن‌ها " +"برای ارائه نسخه‌ی :c:expr:`PyObject*` از توابع مدیریت ویژگی استفاده کرد. " +"نیاز واقعی به هندلرهای ویژگی مخصوص نوع، از پایتون 2.2 به بعد تقریباً به‌طور " +"کامل از بین رفت، هرچند مثال‌های زیادی برای استفاده از برخی از سازوکارهای عام" +" جدیدِ موجود به‌روزرسانی نشده‌اند." msgid "Generic Attribute Management" -msgstr "" +msgstr "مدیریت عام ویژگی" -msgid "Most extension types only use *simple* attributes. So, what makes the attributes simple? There are only a couple of conditions that must be met:" +msgid "" +"Most extension types only use *simple* attributes. So, what makes the " +"attributes simple? There are only a couple of conditions that must be met:" msgstr "" +"بیشتر نوع‌های توسعه‌ای تنها از ویژگی‌های *ساده* استفاده می‌کنند. پس، چه چیزی" +" ویژگی‌ها را ساده می‌کند؟ تنها چند شرط وجود دارد که باید برآورده شوند:" -msgid "The name of the attributes must be known when :c:func:`PyType_Ready` is called." +msgid "" +"The name of the attributes must be known when :c:func:`PyType_Ready` is " +"called." msgstr "" +"نام ویژگی‌ها باید هنگامی که :c:func:`PyType_Ready` فراخوانی می‌شود، مشخص " +"باشد." -msgid "No special processing is needed to record that an attribute was looked up or set, nor do actions need to be taken based on the value." +msgid "" +"No special processing is needed to record that an attribute was looked up or" +" set, nor do actions need to be taken based on the value." msgstr "" +"هیچ پردازش خاصی برای ثبت این‌که ویژگی‌ای جستجو یا تنظیم شده است لازم نیست، و" +" هیچ کنشی نیز بر اساس مقدار لازم نیست انجام شود." -msgid "Note that this list does not place any restrictions on the values of the attributes, when the values are computed, or how relevant data is stored." +msgid "" +"Note that this list does not place any restrictions on the values of the " +"attributes, when the values are computed, or how relevant data is stored." msgstr "" +"توجه داشته باشید که این فهرست هیچ محدودیتی روی مقادیر ویژگی‌ها، زمان " +"محاسبه‌شدن این مقادیر، یا نحوه‌ی ذخیره‌سازی داده‌های مرتبط اعمال نمی‌کند." -msgid "When :c:func:`PyType_Ready` is called, it uses three tables referenced by the type object to create :term:`descriptor`\\s which are placed in the dictionary of the type object. Each descriptor controls access to one attribute of the instance object. Each of the tables is optional; if all three are ``NULL``, instances of the type will only have attributes that are inherited from their base type, and should leave the :c:member:`~PyTypeObject.tp_getattro` and :c:member:`~PyTypeObject.tp_setattro` fields ``NULL`` as well, allowing the base type to handle attributes." -msgstr "" +msgid "" +"When :c:func:`PyType_Ready` is called, it uses three tables referenced by " +"the type object to create :term:`descriptor`\\s which are placed in the " +"dictionary of the type object. Each descriptor controls access to one " +"attribute of the instance object. Each of the tables is optional; if all " +"three are ``NULL``, instances of the type will only have attributes that are" +" inherited from their base type, and should leave the " +":c:member:`~PyTypeObject.tp_getattro` and " +":c:member:`~PyTypeObject.tp_setattro` fields ``NULL`` as well, allowing the " +"base type to handle attributes." +msgstr "" +"وقتی :c:func:`PyType_Ready` فراخوانی می‌شود، از سه جدولی که شیء نوع به آن‌ها" +" ارجاع می‌دهد برای ایجاد :term:`توصیف‌گر `\\هایی که در دیکشنری " +"شیء نوع قرار می‌گیرند استفاده می‌کند. هر توصیف‌گر دسترسی به یک ویژگی از شیء " +"نمونه را کنترل می‌کند. هر یک از این جدول‌ها اختیاری است؛ اگر هر سه ``NULL`` " +"باشند، نمونه‌های این نوع فقط ویژگی‌هایی را خواهند داشت که از نوع پایه خود به" +" ارث برده‌اند، و فیلدهای :c:member:`~PyTypeObject.tp_getattro` و " +":c:member:`~PyTypeObject.tp_setattro` نیز باید ``NULL`` باقی بمانند تا نوع " +"پایه بتواند ویژگی‌ها را مدیریت کند." msgid "The tables are declared as three fields of the type object::" -msgstr "" +msgstr "جدول‌ها به‌عنوان سه فیلد از شیء نوع اعلان می‌شوند::" msgid "" "struct PyMethodDef *tp_methods;\n" "struct PyMemberDef *tp_members;\n" "struct PyGetSetDef *tp_getset;" msgstr "" +"struct PyMethodDef *tp_methods;\n" +"struct PyMemberDef *tp_members;\n" +"struct PyGetSetDef *tp_getset;" -msgid "If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an array of :c:type:`PyMethodDef` structures. Each entry in the table is an instance of this structure::" +msgid "" +"If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an" +" array of :c:type:`PyMethodDef` structures. Each entry in the table is an " +"instance of this structure::" msgstr "" +"اگر :c:member:`~PyTypeObject.tp_methods` برابر ``NULL`` نباشد، باید به " +"آرایه‌ای از ساختارهای :c:type:`PyMethodDef` اشاره کند. هر ورودی جدول " +"نمونه‌ای از این ساختار است::" msgid "" "typedef struct PyMethodDef {\n" @@ -335,12 +721,34 @@ msgid "" " const char *ml_doc; /* docstring */\n" "} PyMethodDef;" msgstr "" +"typedef struct PyMethodDef {\n" +" const char *ml_name; /* method name */\n" +" PyCFunction ml_meth; /* implementation function */\n" +" int ml_flags; /* flags */\n" +" const char *ml_doc; /* docstring */\n" +"} PyMethodDef;" -msgid "One entry should be defined for each method provided by the type; no entries are needed for methods inherited from a base type. One additional entry is needed at the end; it is a sentinel that marks the end of the array. The :c:member:`~PyMethodDef.ml_name` field of the sentinel must be ``NULL``." +msgid "" +"One entry should be defined for each method provided by the type; no entries" +" are needed for methods inherited from a base type. One additional entry is" +" needed at the end; it is a sentinel that marks the end of the array. The " +":c:member:`~PyMethodDef.ml_name` field of the sentinel must be ``NULL``." msgstr "" +"برای هر متدی که توسط نوع ارائه می‌شود، باید یک ورودی تعریف شود؛ برای متدهایی" +" که از یک نوع پایه به ارث رسیده‌اند، نیازی به ورودی نیست. در انتها، به یک " +"ورودی اضافی نیاز است؛ این ورودی یک نشانگر است که پایان آرایه را مشخص می‌کند." +" فیلد :c:member:`~PyMethodDef.ml_name` نشانگر باید ``NULL`` باشد." -msgid "The second table is used to define attributes which map directly to data stored in the instance. A variety of primitive C types are supported, and access may be read-only or read-write. The structures in the table are defined as::" +msgid "" +"The second table is used to define attributes which map directly to data " +"stored in the instance. A variety of primitive C types are supported, and " +"access may be read-only or read-write. The structures in the table are " +"defined as::" msgstr "" +"از جدول دوم برای تعریف ویژگی‌هایی استفاده می‌شود که مستقیماً به داده‌های " +"ذخیره‌شده در نمونه نگاشت می‌شوند. انواع مختلفی از نوع‌های اولیه‌ی C پشتیبانی" +" می‌شوند و دسترسی می‌تواند فقط‌خواندنی یا خواندنی-نوشتنی باشد. ساختارهای " +"موجود در جدول به صورت زیر تعریف می‌شوند::" msgid "" "typedef struct PyMemberDef {\n" @@ -351,27 +759,85 @@ msgid "" " const char *doc;\n" "} PyMemberDef;" msgstr "" +"typedef struct PyMemberDef {\n" +" const char *name;\n" +" int type;\n" +" int offset;\n" +" int flags;\n" +" const char *doc;\n" +"} PyMemberDef;" -msgid "For each entry in the table, a :term:`descriptor` will be constructed and added to the type which will be able to extract a value from the instance structure. The :c:member:`~PyMemberDef.type` field should contain a type code like :c:macro:`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be used to determine how to convert Python values to and from C values. The :c:member:`~PyMemberDef.flags` field is used to store flags which control how the attribute can be accessed: you can set it to :c:macro:`Py_READONLY` to prevent Python code from setting it." -msgstr "" +msgid "" +"For each entry in the table, a :term:`descriptor` will be constructed and " +"added to the type which will be able to extract a value from the instance " +"structure. The :c:member:`~PyMemberDef.type` field should contain a type " +"code like :c:macro:`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be " +"used to determine how to convert Python values to and from C values. The " +":c:member:`~PyMemberDef.flags` field is used to store flags which control " +"how the attribute can be accessed: you can set it to :c:macro:`Py_READONLY` " +"to prevent Python code from setting it." +msgstr "" +"برای هر ورودی در جدول، یک :term:`توصیف‌گر ` ساخته و به نوع اضافه" +" می‌شود که قادر خواهد بود مقداری را از ساختار نمونه استخراج کند. فیلد " +":c:member:`~PyMemberDef.type` باید حاوی کد نوعی مانند :c:macro:`Py_T_INT` یا" +" :c:macro:`Py_T_DOUBLE` باشد؛ این مقدار برای تعیین نحوه‌ی تبدیل مقادیر " +"پایتون به مقادیر C و بالعکس استفاده خواهد شد. فیلد " +":c:member:`~PyMemberDef.flags` برای ذخیره‌ی پرچم‌هایی استفاده می‌شود که " +"نحوه‌ی دسترسی به ویژگی را کنترل می‌کنند: می‌توانید آن را روی " +":c:macro:`Py_READONLY` تنظیم کنید تا کد پایتون نتواند آن را مقداردهی کند." -msgid "An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` table to build descriptors that are used at runtime is that any attribute defined this way can have an associated doc string simply by providing the text in the table. An application can use the introspection API to retrieve the descriptor from the class object, and get the doc string using its :attr:`~type.__doc__` attribute." -msgstr "" +msgid "" +"An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` " +"table to build descriptors that are used at runtime is that any attribute " +"defined this way can have an associated doc string simply by providing the " +"text in the table. An application can use the introspection API to retrieve" +" the descriptor from the class object, and get the doc string using its " +":attr:`~type.__doc__` attribute." +msgstr "" +"مزیت جالب استفاده از جدول :c:member:`~PyTypeObject.tp_members` برای ساخت " +"توصیف‌گرهایی که در ران‌تایم استفاده می‌شوند این است که هر ویژگی که به این " +"روش تعریف شود، می‌تواند صرفاً با ارائه‌ی متن در جدول، یک رشته مستند مرتبط " +"داشته باشد. یک برنامه می‌تواند از API درون‌نگری (introspection) برای بازیابی" +" توصیف‌گر از شیء کلاس استفاده کند و رشته مستند را با استفاده از ویژگی " +":attr:`~type.__doc__` آن به دست آورد." -msgid "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." +msgid "" +"As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " +"with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." msgstr "" +"مانند جدول :c:member:`~PyTypeObject.tp_methods`، یک ورودی نشانگر که مقدار " +":c:member:`~PyMethodDef.ml_name` آن ``NULL`` است، لازم است." msgid "Type-specific Attribute Management" -msgstr "" +msgstr "مدیریت ویژگی‌های مخصوص به نوع" -msgid "For simplicity, only the :c:expr:`char\\*` version will be demonstrated here; the type of the name parameter is the only difference between the :c:expr:`char\\*` and :c:expr:`PyObject*` flavors of the interface. This example effectively does the same thing as the generic example above, but does not use the generic support added in Python 2.2. It explains how the handler functions are called, so that if you do need to extend their functionality, you'll understand what needs to be done." -msgstr "" +msgid "" +"For simplicity, only the :c:expr:`char\\*` version will be demonstrated " +"here; the type of the name parameter is the only difference between the " +":c:expr:`char\\*` and :c:expr:`PyObject*` flavors of the interface. This " +"example effectively does the same thing as the generic example above, but " +"does not use the generic support added in Python 2.2. It explains how the " +"handler functions are called, so that if you do need to extend their " +"functionality, you'll understand what needs to be done." +msgstr "" +"برای سادگی، در اینجا فقط نسخه‌ی :c:expr:`char\\*` نمایش داده خواهد شد؛ نوع " +"پارامتر name تنها تفاوت بین گونه‌های :c:expr:`char\\*` و :c:expr:`PyObject*`" +" رابط است. این مثال عملاً همان کاری را انجام می‌دهد که مثال عام بالا انجام " +"می‌دهد، اما از پشتیبانی عام افزوده‌شده در Python 2.2 استفاده نمی‌کند. این " +"مثال توضیح می‌دهد که توابع هندلر چگونه فراخوانی می‌شوند، تا اگر به‌راستی " +"نیاز به گسترش قابلیت‌های آن‌ها داشته باشید، بفهمید چه کاری باید انجام شود." -msgid "The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object requires an attribute look-up. It is called in the same situations where the :meth:`~object.__getattr__` method of a class would be called." +msgid "" +"The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " +"requires an attribute look-up. It is called in the same situations where " +"the :meth:`~object.__getattr__` method of a class would be called." msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_getattr` زمانی فراخوانی می‌شود که شیء به " +"جست‌وجوی ویژگی نیاز داشته باشد. این هندلر در همان موقعیت‌هایی فراخوانی " +"می‌شود که متد :meth:`~object.__getattr__` یک کلاس فراخوانی می‌شود." msgid "Here is an example::" -msgstr "" +msgstr "در ادامه یک مثال آمده است::" msgid "" "static PyObject *\n" @@ -388,9 +854,34 @@ msgid "" " return NULL;\n" "}" msgstr "" +"static PyObject *\n" +"newdatatype_getattr(PyObject *op, char *name)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" if (strcmp(name, \"data\") == 0) {\n" +" return PyLong_FromLong(self->data);\n" +" }\n" +"\n" +" PyErr_Format(PyExc_AttributeError,\n" +" \"'%.100s' object has no attribute '%.400s'\",\n" +" Py_TYPE(self)->tp_name, name);\n" +" return NULL;\n" +"}" -msgid "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:`~object.__setattr__` or :meth:`~object.__delattr__` method of a class instance would be called. When an attribute should be deleted, the third parameter will be ``NULL``. Here is an example that simply raises an exception; if this were really all you wanted, the :c:member:`~PyTypeObject.tp_setattr` handler should be set to ``NULL``. ::" -msgstr "" +msgid "" +"The :c:member:`~PyTypeObject.tp_setattr` handler is called when the " +":meth:`~object.__setattr__` or :meth:`~object.__delattr__` method of a class" +" instance would be called. When an attribute should be deleted, the third " +"parameter will be ``NULL``. Here is an example that simply raises an " +"exception; if this were really all you wanted, the " +":c:member:`~PyTypeObject.tp_setattr` handler should be set to ``NULL``. ::" +msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_setattr` زمانی فراخوانی می‌شود که قرار " +"باشد متد :meth:`~object.__setattr__` یا :meth:`~object.__delattr__` یک " +"نمونه‌ی کلاس فراخوانی شود. وقتی ویژگی‌ای باید حذف شود، پارامتر سوم ``NULL`` " +"خواهد بود. در ادامه مثالی آمده است که صرفاً یک استثنا ایجاد می‌کند؛ اگر " +"واقعاً همین تمام چیزی بود که می‌خواستید، هندلر " +":c:member:`~PyTypeObject.tp_setattr` باید روی ``NULL`` تنظیم شود. ::" msgid "" "static int\n" @@ -400,21 +891,54 @@ msgid "" " return -1;\n" "}" msgstr "" +"static int\n" +"newdatatype_setattr(PyObject *op, char *name, PyObject *v)\n" +"{\n" +" PyErr_Format(PyExc_RuntimeError, \"Read-only attribute: %s\", name);\n" +" return -1;\n" +"}" msgid "Object Comparison" -msgstr "" +msgstr "مقایسه‌ی شیء" msgid "richcmpfunc tp_richcompare;" -msgstr "" +msgstr "richcmpfunc tp_richcompare;" -msgid "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when comparisons are needed. It is analogous to the :ref:`rich comparison methods `, like :meth:`!__lt__`, and also called by :c:func:`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." +msgid "" +"The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " +"comparisons are needed. It is analogous to the :ref:`rich comparison " +"methods `, like :meth:`!__lt__`, and also called by " +":c:func:`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." msgstr "" +"هندلر :c:member:`~PyTypeObject.tp_richcompare` زمانی فراخوانی می‌شود که به " +"مقایسه نیاز باشد. این هندلر مشابه :ref:`متدهای مقایسه‌ی غنی (rich " +"comparison) ` مانند :meth:`!__lt__` است و همچنین توسط " +":c:func:`PyObject_RichCompare` و :c:func:`PyObject_RichCompareBool` فراخوانی" +" می‌شود." -msgid "This function is called with two Python objects and the operator as arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, ``Py_GE``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with respect to the specified operator and return ``Py_True`` or ``Py_False`` if the comparison is successful, ``Py_NotImplemented`` to indicate that comparison is not implemented and the other object's comparison method should be tried, or ``NULL`` if an exception was set." -msgstr "" +msgid "" +"This function is called with two Python objects and the operator as " +"arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, " +"``Py_GE``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " +"respect to the specified operator and return ``Py_True`` or ``Py_False`` if " +"the comparison is successful, ``Py_NotImplemented`` to indicate that " +"comparison is not implemented and the other object's comparison method " +"should be tried, or ``NULL`` if an exception was set." +msgstr "" +"این تابع با دو شیء پایتون و عملگر به‌عنوان آرگومان فراخوانی می‌شود، که در آن" +" عملگر یکی از ``Py_EQ``، ``Py_NE``، ``Py_LE``، ``Py_GE``، ``Py_LT`` یا " +"``Py_GT`` است. این تابع باید دو شیء را با توجه به عملگر مشخص‌شده مقایسه کند " +"و در صورت موفقیت مقایسه، ``Py_True`` یا ``Py_False`` را برگرداند، " +"``Py_NotImplemented`` را برای نشان دادن این‌که مقایسه پیاده‌سازی نشده و باید" +" متد مقایسه شیء دیگر امتحان شود، یا ``NULL`` را در صورتی که استثنایی تنظیم " +"شده باشد." -msgid "Here is a sample implementation, for a datatype that is considered equal if the size of an internal pointer is equal::" +msgid "" +"Here is a sample implementation, for a datatype that is considered equal if " +"the size of an internal pointer is equal::" msgstr "" +"در اینجا یک پیاده‌سازی نمونه برای یک نوع داده آمده است که در صورتی برابر در " +"نظر گرفته می‌شود که اندازه‌ی اشاره‌گر داخلی‌اش برابر باشد::" msgid "" "static PyObject *\n" @@ -443,30 +967,101 @@ msgid "" " return Py_NewRef(result);\n" " }" msgstr "" +"static PyObject *\n" +"newdatatype_richcmp(PyObject *lhs, PyObject *rhs, int op)\n" +"{\n" +" newdatatypeobject *obj1 = (newdatatypeobject *) lhs;\n" +" newdatatypeobject *obj2 = (newdatatypeobject *) rhs;\n" +" PyObject *result;\n" +" int c, size1, size2;\n" +"\n" +" /* code to make sure that both arguments are of type\n" +" newdatatype omitted */\n" +"\n" +" size1 = obj1->obj_UnderlyingDatatypePtr->size;\n" +" size2 = obj2->obj_UnderlyingDatatypePtr->size;\n" +"\n" +" switch (op) {\n" +" case Py_LT: c = size1 < size2; break;\n" +" case Py_LE: c = size1 <= size2; break;\n" +" case Py_EQ: c = size1 == size2; break;\n" +" case Py_NE: c = size1 != size2; break;\n" +" case Py_GT: c = size1 > size2; break;\n" +" case Py_GE: c = size1 >= size2; break;\n" +" }\n" +" result = c ? Py_True : Py_False;\n" +" return Py_NewRef(result);\n" +" }" msgid "Abstract Protocol Support" -msgstr "" +msgstr "پشتیبانی از پروتکل انتزاعی" -msgid "Python supports a variety of *abstract* 'protocols;' the specific interfaces provided to use these interfaces are documented in :ref:`abstract`." +msgid "" +"Python supports a variety of *abstract* 'protocols;' the specific interfaces" +" provided to use these interfaces are documented in :ref:`abstract`." msgstr "" +"پایتون انواع مختلفی از «پروتکل‌های *انتزاعی*» را پشتیبانی می‌کند؛ رابط‌های " +"مشخصی که برای استفاده از این رابط‌ها فراهم شده‌اند، در :ref:`abstract` مستند" +" شده‌اند." -msgid "A number of these abstract interfaces were defined early in the development of the Python implementation. In particular, the number, mapping, and sequence protocols have been part of Python since the beginning. Other protocols have been added over time. For protocols which depend on several handler routines from the type implementation, the older protocols have been defined as optional blocks of handlers referenced by the type object. For newer protocols there are additional slots in the main type object, with a flag bit being set to indicate that the slots are present and should be checked by the interpreter. (The flag bit does not indicate that the slot values are non-``NULL``. The flag may be set to indicate the presence of a slot, but a slot may still be unfilled.) ::" -msgstr "" +msgid "" +"A number of these abstract interfaces were defined early in the development " +"of the Python implementation. In particular, the number, mapping, and " +"sequence protocols have been part of Python since the beginning. Other " +"protocols have been added over time. For protocols which depend on several " +"handler routines from the type implementation, the older protocols have been" +" defined as optional blocks of handlers referenced by the type object. For " +"newer protocols there are additional slots in the main type object, with a " +"flag bit being set to indicate that the slots are present and should be " +"checked by the interpreter. (The flag bit does not indicate that the slot " +"values are non-``NULL``. The flag may be set to indicate the presence of a " +"slot, but a slot may still be unfilled.) ::" +msgstr "" +"تعدادی از این رابط‌های انتزاعی در اوایل توسعه‌ی پیاده‌سازی پایتون تعریف " +"شدند. به‌طور خاص، پروتکل‌های عدد، نگاشت و دنباله از همان ابتدا بخشی از " +"پایتون بوده‌اند. پروتکل‌های دیگر به مرور زمان اضافه شده‌اند. برای " +"پروتکل‌هایی که به چند روال هندلر از پیاده‌سازی نوع وابسته‌اند، پروتکل‌های " +"قدیمی‌تر به‌صورت بلوک‌های اختیاری از هندلرها تعریف شده‌اند که شیء نوع به " +"آن‌ها ارجاع می‌دهد. برای پروتکل‌های جدیدتر، جایگاه‌های اضافی در شیء نوع اصلی" +" وجود دارند و یک بیت پرچم تنظیم می‌شود تا نشان دهد که این جایگاه‌ها موجودند " +"و باید توسط مفسر بررسی شوند. (بیت پرچم نشان نمی‌دهد که مقادیر جایگاه‌ها غیر " +"``NULL`` هستند. ممکن است پرچم برای نشان دادن وجود یک جایگاه تنظیم شده باشد، " +"اما جایگاه همچنان پرنشده باشد.) ::" msgid "" "PyNumberMethods *tp_as_number;\n" "PySequenceMethods *tp_as_sequence;\n" "PyMappingMethods *tp_as_mapping;" msgstr "" +"PyNumberMethods *tp_as_number;\n" +"PySequenceMethods *tp_as_sequence;\n" +"PyMappingMethods *tp_as_mapping;" -msgid "If you wish your object to be able to act like a number, a sequence, or a mapping object, then you place the address of a structure that implements the C type :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, or :c:type:`PyMappingMethods`, respectively. It is up to you to fill in this structure with appropriate values. You can find examples of the use of each of these in the :file:`Objects` directory of the Python source distribution. ::" -msgstr "" +msgid "" +"If you wish your object to be able to act like a number, a sequence, or a " +"mapping object, then you place the address of a structure that implements " +"the C type :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, or " +":c:type:`PyMappingMethods`, respectively. It is up to you to fill in this " +"structure with appropriate values. You can find examples of the use of each " +"of these in the :file:`Objects` directory of the Python source distribution." +" ::" +msgstr "" +"اگر می‌خواهید شیء شما بتواند مانند یک عدد، یک دنباله یا یک شیء نگاشت رفتار " +"کند، آدرس ساختاری را که به‌ترتیب نوع C :c:type:`PyNumberMethods`، " +":c:type:`PySequenceMethods` یا :c:type:`PyMappingMethods` را پیاده‌سازی " +"می‌کند، قرار می‌دهید. پر کردن این ساختار با مقدارهای مناسب بر عهده شماست. " +"می‌توانید نمونه‌هایی از استفاده از هر یک از این‌ها را در پوشه " +":file:`Objects` توزیع کد منبع پایتون بیابید. ::" msgid "hashfunc tp_hash;" -msgstr "" +msgstr "hashfunc tp_hash;" -msgid "This function, if you choose to provide it, should return a hash number for an instance of your data type. Here is a simple example::" +msgid "" +"This function, if you choose to provide it, should return a hash number for " +"an instance of your data type. Here is a simple example::" msgstr "" +"این تابع، اگر بخواهید آن را ارائه کنید، باید یک عدد هش برای نمونه‌ای از نوع " +"داده‌ی شما بازگرداند. در اینجا یک مثال ساده آمده است::" msgid "" "static Py_hash_t\n" @@ -481,30 +1076,77 @@ msgid "" " return result;\n" "}" msgstr "" +"static Py_hash_t\n" +"newdatatype_hash(PyObject *op)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" Py_hash_t result;\n" +" result = self->some_size + 32767 * self->some_number;\n" +" if (result == -1) {\n" +" result = -2;\n" +" }\n" +" return result;\n" +"}" -msgid ":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, which is why you should be careful to avoid returning it when hash computation is successful, as seen above." +msgid "" +":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " +"Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " +"which is why you should be careful to avoid returning it when hash " +"computation is successful, as seen above." msgstr "" +":c:type:`Py_hash_t` یک نوع عدد صحیح علامت‌دار با پهنای متغیر بر اساس پلتفرم " +"است. برگرداندن ``-1`` از :c:member:`~PyTypeObject.tp_hash` نشان‌دهنده‌ی خطا " +"است؛ به همین دلیل باید مراقب باشید تا در صورت موفقیت‌آمیز بودن محاسبه‌ی هش، " +"آن را برنگردانید، همان‌طور که در بالا مشاهده کردید." msgid "ternaryfunc tp_call;" -msgstr "" +msgstr "ternaryfunc tp_call;" -msgid "This function is called when an instance of your data type is \"called\", for example, if ``obj1`` is an instance of your data type and the Python script contains ``obj1('hello')``, the :c:member:`~PyTypeObject.tp_call` handler is invoked." +msgid "" +"This function is called when an instance of your data type is \"called\", " +"for example, if ``obj1`` is an instance of your data type and the Python " +"script contains ``obj1('hello')``, the :c:member:`~PyTypeObject.tp_call` " +"handler is invoked." msgstr "" +"این تابع زمانی فراخوانی می‌شود که نمونه‌ای از نوع داده شما «فراخوانی» شود؛ " +"برای مثال، اگر ``obj1`` نمونه‌ای از نوع داده شما باشد و اسکریپت پایتون شامل " +"``obj1('hello')`` باشد، هندلر :c:member:`~PyTypeObject.tp_call` فراخوانی " +"می‌شود." msgid "This function takes three arguments:" -msgstr "" +msgstr "این تابع سه آرگومان می‌گیرد:" -msgid "*self* is the instance of the data type which is the subject of the call. If the call is ``obj1('hello')``, then *self* is ``obj1``." +msgid "" +"*self* is the instance of the data type which is the subject of the call. If" +" the call is ``obj1('hello')``, then *self* is ``obj1``." msgstr "" +"*self* نمونه‌ای از نوع داده است که موضوع فراخوانی است. اگر فراخوانی " +"``obj1('hello')`` باشد، آنگاه *self* همان ``obj1`` است." -msgid "*args* is a tuple containing the arguments to the call. You can use :c:func:`PyArg_ParseTuple` to extract the arguments." +msgid "" +"*args* is a tuple containing the arguments to the call. You can use " +":c:func:`PyArg_ParseTuple` to extract the arguments." msgstr "" +"*args* تاپلی است که آرگومان‌های فراخوانی را در بر دارد. می‌توانید از " +":c:func:`PyArg_ParseTuple` برای استخراج آرگومان‌ها استفاده کنید." -msgid "*kwds* is a dictionary of keyword arguments that were passed. If this is non-``NULL`` and you support keyword arguments, use :c:func:`PyArg_ParseTupleAndKeywords` to extract the arguments. If you do not want to support keyword arguments and this is non-``NULL``, raise a :exc:`TypeError` with a message saying that keyword arguments are not supported." -msgstr "" +msgid "" +"*kwds* is a dictionary of keyword arguments that were passed. If this is " +"non-``NULL`` and you support keyword arguments, use " +":c:func:`PyArg_ParseTupleAndKeywords` to extract the arguments. If you do " +"not want to support keyword arguments and this is non-``NULL``, raise a " +":exc:`TypeError` with a message saying that keyword arguments are not " +"supported." +msgstr "" +"*kwds* یک دیکشنری از آرگومان‌های کلیدواژه‌ای است که ارسال شده‌اند. اگر این " +"مقدار غیر ``NULL`` باشد و شما از آرگومان‌های کلیدواژه‌ای پشتیبانی می‌کنید، " +"برای استخراج آرگومان‌ها از :c:func:`PyArg_ParseTupleAndKeywords` استفاده " +"کنید. اگر نمی‌خواهید از آرگومان‌های کلیدواژه‌ای پشتیبانی کنید و این مقدار " +"غیر ``NULL`` باشد، یک :exc:`TypeError` با پیامی که می‌گوید آرگومان‌های " +"کلیدواژه‌ای پشتیبانی نمی‌شوند ایجاد کنید." msgid "Here is a toy ``tp_call`` implementation::" -msgstr "" +msgstr "در ادامه، یک پیاده‌سازی ساده از ``tp_call`` آمده است::" msgid "" "static PyObject *\n" @@ -526,42 +1168,136 @@ msgid "" " return result;\n" "}" msgstr "" +"static PyObject *\n" +"newdatatype_call(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" newdatatypeobject *self = (newdatatypeobject *) op;\n" +" PyObject *result;\n" +" const char *arg1;\n" +" const char *arg2;\n" +" const char *arg3;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"sss:call\", &arg1, &arg2, &arg3)) {\n" +" return NULL;\n" +" }\n" +" result = PyUnicode_FromFormat(\n" +" \"Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\\n\",\n" +" self->obj_UnderlyingDatatypePtr->size,\n" +" arg1, arg2, arg3);\n" +" return result;\n" +"}" msgid "" "/* Iterators */\n" "getiterfunc tp_iter;\n" "iternextfunc tp_iternext;" msgstr "" +"/* Iterators */\n" +"getiterfunc tp_iter;\n" +"iternextfunc tp_iternext;" -msgid "These functions provide support for the iterator protocol. Both handlers take exactly one parameter, the instance for which they are being called, and return a new reference. In the case of an error, they should set an exception and return ``NULL``. :c:member:`~PyTypeObject.tp_iter` corresponds to the Python :meth:`~object.__iter__` method, while :c:member:`~PyTypeObject.tp_iternext` corresponds to the Python :meth:`~iterator.__next__` method." -msgstr "" +msgid "" +"These functions provide support for the iterator protocol. Both handlers " +"take exactly one parameter, the instance for which they are being called, " +"and return a new reference. In the case of an error, they should set an " +"exception and return ``NULL``. :c:member:`~PyTypeObject.tp_iter` " +"corresponds to the Python :meth:`~object.__iter__` method, while " +":c:member:`~PyTypeObject.tp_iternext` corresponds to the Python " +":meth:`~iterator.__next__` method." +msgstr "" +"این توابع از پروتکل پیمایش‌گر پشتیبانی می‌کنند. هر دو هندلر دقیقاً یک " +"پارامتر می‌گیرند — نمونه‌ای که برای آن فراخوانی می‌شوند — و یک ارجاع جدید " +"برمی‌گردانند. در صورت خطا، باید یک استثنا تنظیم کنند و ``NULL`` را " +"برگردانند. :c:member:`~PyTypeObject.tp_iter` با متد " +":meth:`~object.__iter__` پایتون متناظر است، در حالی که " +":c:member:`~PyTypeObject.tp_iternext` با متد :meth:`~iterator.__next__` " +"پایتون متناظر است." -msgid "Any :term:`iterable` object must implement the :c:member:`~PyTypeObject.tp_iter` handler, which must return an :term:`iterator` object. Here the same guidelines apply as for Python classes:" +msgid "" +"Any :term:`iterable` object must implement the " +":c:member:`~PyTypeObject.tp_iter` handler, which must return an " +":term:`iterator` object. Here the same guidelines apply as for Python " +"classes:" msgstr "" +"هر شیء :term:`iterable` باید هندلر :c:member:`~PyTypeObject.tp_iter` را " +"پیاده‌سازی کند که باید یک شیء :term:`iterator` را برگرداند. در اینجا همان " +"دستورالعمل‌های مربوط به کلاس‌های پایتون اعمال می‌شود:" -msgid "For collections (such as lists and tuples) which can support multiple independent iterators, a new iterator should be created and returned by each call to :c:member:`~PyTypeObject.tp_iter`." +msgid "" +"For collections (such as lists and tuples) which can support multiple " +"independent iterators, a new iterator should be created and returned by each" +" call to :c:member:`~PyTypeObject.tp_iter`." msgstr "" +"برای کلکسیون‌هایی (مانند فهرست‌ها و تاپل‌ها) که می‌توانند از چندین پیمایش‌گر" +" مستقل پشتیبانی کنند، باید با هر فراخوانی :c:member:`~PyTypeObject.tp_iter` " +"یک پیمایش‌گر جدید ایجاد و برگردانده شود." -msgid "Objects which can only be iterated over once (usually due to side effects of iteration, such as file objects) can implement :c:member:`~PyTypeObject.tp_iter` by returning a new reference to themselves -- and should also therefore implement the :c:member:`~PyTypeObject.tp_iternext` handler." -msgstr "" +msgid "" +"Objects which can only be iterated over once (usually due to side effects of" +" iteration, such as file objects) can implement " +":c:member:`~PyTypeObject.tp_iter` by returning a new reference to themselves" +" -- and should also therefore implement the " +":c:member:`~PyTypeObject.tp_iternext` handler." +msgstr "" +"اشیایی که تنها یک بار می‌توان آن‌ها را پیمایش کرد (معمولاً به دلیل اثرات " +"جانبی پیمایش، مانند اشیای پرونده) می‌توانند " +":c:member:`~PyTypeObject.tp_iter` را با بازگرداندن یک ارجاع جدید به خودشان " +"پیاده‌سازی کنند -- و بنابراین باید هندلر " +":c:member:`~PyTypeObject.tp_iternext` را نیز پیاده‌سازی کنند." -msgid "Any :term:`iterator` object should implement both :c:member:`~PyTypeObject.tp_iter` and :c:member:`~PyTypeObject.tp_iternext`. An iterator's :c:member:`~PyTypeObject.tp_iter` handler should return a new reference to the iterator. Its :c:member:`~PyTypeObject.tp_iternext` handler should return a new reference to the next object in the iteration, if there is one. If the iteration has reached the end, :c:member:`~PyTypeObject.tp_iternext` may return ``NULL`` without setting an exception, or it may set :exc:`StopIteration` *in addition* to returning ``NULL``; avoiding the exception can yield slightly better performance. If an actual error occurs, :c:member:`~PyTypeObject.tp_iternext` should always set an exception and return ``NULL``." -msgstr "" +msgid "" +"Any :term:`iterator` object should implement both " +":c:member:`~PyTypeObject.tp_iter` and :c:member:`~PyTypeObject.tp_iternext`." +" An iterator's :c:member:`~PyTypeObject.tp_iter` handler should return a " +"new reference to the iterator. Its :c:member:`~PyTypeObject.tp_iternext` " +"handler should return a new reference to the next object in the iteration, " +"if there is one. If the iteration has reached the end, " +":c:member:`~PyTypeObject.tp_iternext` may return ``NULL`` without setting an" +" exception, or it may set :exc:`StopIteration` *in addition* to returning " +"``NULL``; avoiding the exception can yield slightly better performance. If " +"an actual error occurs, :c:member:`~PyTypeObject.tp_iternext` should always " +"set an exception and return ``NULL``." +msgstr "" +"هر شیء :term:`iterator` باید هم :c:member:`~PyTypeObject.tp_iter` و هم " +":c:member:`~PyTypeObject.tp_iternext` را پیاده‌سازی کند. هندلر " +":c:member:`~PyTypeObject.tp_iter` در یک پیمایش‌گر باید ارجاع جدیدی به " +"پیمایش‌گر برگرداند. هندلر :c:member:`~PyTypeObject.tp_iternext` آن باید در " +"صورت وجود، ارجاع جدیدی به شیء بعدی در پیمایش برگرداند. اگر پیمایش به پایان " +"رسیده باشد، :c:member:`~PyTypeObject.tp_iternext` می‌تواند بدون تنظیم استثنا" +" ``NULL`` برگرداند، یا *علاوه بر* برگرداندن ``NULL``، :exc:`StopIteration` " +"را تنظیم کند؛ پرهیز از استثنا می‌تواند به کارایی کمی بهتر منجر شود. اگر خطای" +" واقعی رخ دهد، :c:member:`~PyTypeObject.tp_iternext` باید همیشه یک استثنا " +"تنظیم کند و ``NULL`` برگرداند." msgid "Weak Reference Support" -msgstr "" +msgstr "پشتیبانی از ارجاع ضعیف" -msgid "One of the goals of Python's weak reference implementation is to allow any type to participate in the weak reference mechanism without incurring the overhead on performance-critical objects (such as numbers)." +msgid "" +"One of the goals of Python's weak reference implementation is to allow any " +"type to participate in the weak reference mechanism without incurring the " +"overhead on performance-critical objects (such as numbers)." msgstr "" +"یکی از اهداف پیاده‌سازی ارجاع ضعیف در پایتون این است که به هر نوعی اجازه دهد" +" در سازوکار ارجاع ضعیف شرکت کند، بدون آنکه سرباری بر شیءهای حساس به کارایی " +"(مانند اعداد) تحمیل شود." msgid "Documentation for the :mod:`weakref` module." -msgstr "" +msgstr "مستندات ماژول :mod:`weakref`." -msgid "For an object to be weakly referenceable, the extension type must set the ``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags` field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should be left as zero." +msgid "" +"For an object to be weakly referenceable, the extension type must set the " +"``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags`" +" field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should " +"be left as zero." msgstr "" +"برای اینکه بتوان به یک شیء ارجاع ضعیف داد، نوع توسعه‌ای باید بیت " +"``Py_TPFLAGS_MANAGED_WEAKREF`` را در فیلد :c:member:`~PyTypeObject.tp_flags`" +" تنظیم کند. فیلد قدیمی :c:member:`~PyTypeObject.tp_weaklistoffset` باید صفر " +"باقی بماند." -msgid "Concretely, here is how the statically declared type object would look::" -msgstr "" +msgid "" +"Concretely, here is how the statically declared type object would look::" +msgstr "به‌طور مشخص، شیء نوعِ به‌صورت ایستا اعلان‌شده به این شکل خواهد بود::" msgid "" "static PyTypeObject TrivialType = {\n" @@ -570,9 +1306,18 @@ msgid "" " .tp_flags = Py_TPFLAGS_MANAGED_WEAKREF | ...,\n" "};" msgstr "" +"static PyTypeObject TrivialType = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" /* ... سایر اعضا برای اختصار حذف شده‌اند ... */\n" +" .tp_flags = Py_TPFLAGS_MANAGED_WEAKREF | ...,\n" +"};" -msgid "The only further addition is that ``tp_dealloc`` needs to clear any weak references (by calling :c:func:`PyObject_ClearWeakRefs`)::" +msgid "" +"The only further addition is that ``tp_dealloc`` needs to clear any weak " +"references (by calling :c:func:`PyObject_ClearWeakRefs`)::" msgstr "" +"تنها مورد دیگری که باید اضافه شود این است که ``tp_dealloc`` باید هر ارجاع " +"ضعیفی را پاک کند (با فراخوانی :c:func:`PyObject_ClearWeakRefs`)::" msgid "" "static void\n" @@ -584,15 +1329,39 @@ msgid "" " Py_TYPE(op)->tp_free(op);\n" "}" msgstr "" +"static void\n" +"Trivial_dealloc(PyObject *op)\n" +"{\n" +" /* Clear weakrefs first before calling any destructors */\n" +" PyObject_ClearWeakRefs(op);\n" +" /* ... remainder of destruction code omitted for brevity ... */\n" +" Py_TYPE(op)->tp_free(op);\n" +"}" msgid "More Suggestions" -msgstr "" +msgstr "پیشنهادهای بیشتر" -msgid "In order to learn how to implement any specific method for your new data type, get the :term:`CPython` source code. Go to the :file:`Objects` directory, then search the C source files for ``tp_`` plus the function you want (for example, ``tp_richcompare``). You will find examples of the function you want to implement." -msgstr "" +msgid "" +"In order to learn how to implement any specific method for your new data " +"type, get the :term:`CPython` source code. Go to the :file:`Objects` " +"directory, then search the C source files for ``tp_`` plus the function you " +"want (for example, ``tp_richcompare``). You will find examples of the " +"function you want to implement." +msgstr "" +"برای یادگیری نحوه‌ی پیاده‌سازی هر متد خاص برای نوع داده‌ی جدید خود، کد منبع " +":term:`CPython` را دریافت کنید. به پوشه‌ی :file:`Objects` بروید، سپس در " +"پرونده‌های منبع C به دنبال ``tp_`` به‌علاوه‌ی تابعی که می‌خواهید بگردید " +"(برای مثال، ``tp_richcompare``). نمونه‌هایی از تابعی که می‌خواهید پیاده‌سازی" +" کنید را خواهید یافت." -msgid "When you need to verify that an object is a concrete instance of the type you are implementing, use the :c:func:`PyObject_TypeCheck` function. A sample of its use might be something like the following::" +msgid "" +"When you need to verify that an object is a concrete instance of the type " +"you are implementing, use the :c:func:`PyObject_TypeCheck` function. A " +"sample of its use might be something like the following::" msgstr "" +"هنگامی که نیاز دارید بررسی کنید که یک شیء، نمونه‌ی عینی نوعی است که " +"پیاده‌سازی می‌کنید، از تابع :c:func:`PyObject_TypeCheck` استفاده کنید. " +"نمونه‌ای از کاربرد آن می‌تواند چیزی شبیه به موارد زیر باشد::" msgid "" "if (!PyObject_TypeCheck(some_object, &MyType)) {\n" @@ -600,48 +1369,55 @@ msgid "" " return NULL;\n" "}" msgstr "" +"if (!PyObject_TypeCheck(some_object, &MyType)) {\n" +" PyErr_SetString(PyExc_TypeError, \"arg #1 not a mything\");\n" +" return NULL;\n" +"}" msgid "Download CPython source releases." -msgstr "" +msgstr "دانلود نسخه‌های کد منبع سی‌پایتون." msgid "https://www.python.org/downloads/source/" -msgstr "" +msgstr "https://www.python.org/downloads/source/" -msgid "The CPython project on GitHub, where the CPython source code is developed." +msgid "" +"The CPython project on GitHub, where the CPython source code is developed." msgstr "" +"پروژه‌ی سی‌پایتون در GitHub، جایی که کد منبع سی‌پایتون در آن توسعه داده " +"می‌شود." msgid "https://github.com/python/cpython" -msgstr "" +msgstr "https://github.com/python/cpython" msgid "object" -msgstr "" +msgstr "شیء" msgid "deallocation" -msgstr "" +msgstr "آزادسازی" msgid "deallocation, object" -msgstr "" +msgstr "آزادسازی، شیء" msgid "finalization" -msgstr "" +msgstr "نهایی‌سازی" msgid "finalization, of objects" -msgstr "" +msgstr "نهایی‌سازی، از اشیاء" msgid "PyErr_Fetch (C function)" -msgstr "" +msgstr "PyErr_Fetch (تابع C)" msgid "PyErr_Restore (C function)" -msgstr "" +msgstr "PyErr_Restore (تابع C)" msgid "string" -msgstr "" +msgstr "رشته" msgid "object representation" -msgstr "" +msgstr "نمایش شیء" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "repr" -msgstr "" +msgstr "repr" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index eae368146..5d899f556 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"PO-Revision-Date: 2026-09-04 20:29+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,27 +23,73 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Defining Extension Types: Tutorial" -msgstr "" +msgstr "تعریف نوع‌های توسعه‌ای: آموزش" -msgid "Python allows the writer of a C extension module to define new types that can be manipulated from Python code, much like the built-in :class:`str` and :class:`list` types. The code for all extension types follows a pattern, but there are some details that you need to understand before you can get started. This document is a gentle introduction to the topic." -msgstr "" +msgid "" +"Python allows the writer of a C extension module to define new types that " +"can be manipulated from Python code, much like the built-in :class:`str` " +"and :class:`list` types. The code for all extension types follows a " +"pattern, but there are some details that you need to understand before you " +"can get started. This document is a gentle introduction to the topic." +msgstr "" +"پایتون به نویسنده‌ی یک ماژول توسعه‌ای C اجازه می‌دهد نوع‌های جدیدی تعریف کند که " +"بتوان آن‌ها را از طریق کد پایتون دستکاری کرد، بسیار شبیه به نوع‌های " +"توکار :class:`str` و :class:`list`. کد همه‌ی نوع‌های توسعه‌ای از یک الگو پیروی " +"می‌کند، اما جزئیاتی وجود دارند که پیش از شروع کار باید آن‌ها را درک کنید. این " +"سند مقدمه‌ای ساده و روان بر این موضوع است." msgid "The Basics" -msgstr "" +msgstr "مبانی" -msgid "The :term:`CPython` runtime sees all Python objects as variables of type :c:expr:`PyObject*`, which serves as a \"base type\" for all Python objects. The :c:type:`PyObject` structure itself only contains the object's :term:`reference count` and a pointer to the object's \"type object\". This is where the action is; the type object determines which (C) functions get called by the interpreter when, for instance, an attribute gets looked up on an object, a method called, or it is multiplied by another object. These C functions are called \"type methods\"." -msgstr "" +msgid "" +"The :term:`CPython` runtime sees all Python objects as variables of " +"type :c:expr:`PyObject*`, which serves as a \"base type\" for all Python " +"objects. The :c:type:`PyObject` structure itself only contains the " +"object's :term:`reference count` and a pointer to the object's \"type " +"object\". This is where the action is; the type object determines which (C) " +"functions get called by the interpreter when, for instance, an attribute " +"gets looked up on an object, a method called, or it is multiplied by " +"another object. These C functions are called \"type methods\"." +msgstr "" +"ران‌تایم :term:`CPython` همه‌ی اشیاء پایتون را به‌صورت متغیرهایی از " +"نوع :c:expr:`PyObject*` می‌بیند که به‌عنوان یک «نوع پایه» برای همه‌ی اشیاء " +"پایتون عمل می‌کند. خودِ ساختار :c:type:`PyObject` تنها شامل :term:`reference " +"count` شیء و اشاره‌گری به «شیء نوع» آن است. همین‌جاست که کار اصلی انجام " +"می‌شود؛ شیء نوع تعیین می‌کند که مفسر در مواردی مانند جستجوی یک ویژگی روی یک " +"شیء، فراخوانی یک متد یا ضرب آن در شیء دیگری، کدام توابع (C) را فراخوانی " +"می‌کند. به این توابع C «متدهای نوع» گفته می‌شود." -msgid "So, if you want to define a new extension type, you need to create a new type object." +msgid "" +"So, if you want to define a new extension type, you need to create a new " +"type object." msgstr "" +"بنابراین، اگر می‌خواهید یک نوع توسعه‌ای جدید تعریف کنید، باید یک شیء نوع جدید " +"ایجاد کنید." -msgid "This sort of thing can only be explained by example, so here's a minimal, but complete, module that defines a new type named :class:`!Custom` inside a C extension module :mod:`!custom`:" +msgid "" +"This sort of thing can only be explained by example, so here's a minimal, " +"but complete, module that defines a new type named :class:`!Custom` inside " +"a C extension module :mod:`!custom`:" msgstr "" +"چنین چیزی را تنها می‌توان با مثال توضیح داد، بنابراین در اینجا یک ماژول " +"حداقلی اما کامل ارائه می‌شود که نوع جدیدی به نام :class:`!Custom` را درون یک " +"ماژول توسعه‌ای C به نام :mod:`!custom` تعریف می‌کند:" -msgid "What we're showing here is the traditional way of defining *static* extension types. It should be adequate for most uses. The C API also allows defining heap-allocated extension types using the :c:func:`PyType_FromSpec` function, which isn't covered in this tutorial." -msgstr "" +msgid "" +"What we're showing here is the traditional way of defining *static* " +"extension types. It should be adequate for most uses. The C API also " +"allows defining heap-allocated extension types using " +"the :c:func:`PyType_FromSpec` function, which isn't covered in this " +"tutorial." +msgstr "" +"آنچه در اینجا نشان می‌دهیم، روش سنتی تعریف نوع‌های توسعه‌ای *ایستا* است. این " +"روش باید برای بیشتر کاربردها کافی باشد. API زبان C همچنین اجازه می‌دهد " +"نوع‌های توسعه‌ای تخصیص‌یافته در هیپ را با استفاده از " +"تابع :c:func:`PyType_FromSpec` تعریف کنید؛ تابعی که در این آموزش پوشش داده " +"نشده است." msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -71,7 +117,8 @@ msgid "" " return -1;\n" " }\n" "\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" " return -1;\n" " }\n" "\n" @@ -81,7 +128,8 @@ msgid "" "static PyModuleDef_Slot custom_module_slots[] = {\n" " {Py_mod_exec, custom_module_exec},\n" " // Just use this while using static types\n" -" {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" " {0, NULL}\n" "};\n" "\n" @@ -99,36 +147,138 @@ msgid "" " return PyModuleDef_Init(&custom_module);\n" "}\n" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" /* Type-specific fields go here. */\n" +"} CustomObject;\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};\n" +"\n" +"static int\n" +"custom_module_exec(PyObject *m)\n" +"{\n" +" if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot custom_module_slots[] = {\n" +" {Py_mod_exec, custom_module_exec},\n" +" // Just use this while using static types\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef custom_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = custom_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom(void)\n" +"{\n" +" return PyModuleDef_Init(&custom_module);\n" +"}\n" -msgid "Now that's quite a bit to take in at once, but hopefully bits will seem familiar from the previous chapter. This file defines three things:" +msgid "" +"Now that's quite a bit to take in at once, but hopefully bits will seem " +"familiar from the previous chapter. This file defines three things:" msgstr "" +"این واقعاً مقدار زیادی است که باید یک‌باره هضم کنید، اما امیدواریم بخش‌هایی از " +"آن از فصل پیشین آشنا به نظر برسند. این فایل سه چیز را تعریف می‌کند:" -msgid "What a :class:`!Custom` **object** contains: this is the ``CustomObject`` struct, which is allocated once for each :class:`!Custom` instance." +msgid "" +"What a :class:`!Custom` **object** contains: this is the ``CustomObject`` " +"struct, which is allocated once for each :class:`!Custom` instance." msgstr "" +"آنچه یک **شیء** :class:`!Custom` در بر دارد: این ساختار ``CustomObject`` " +"است که یک‌بار برای هر نمونه‌ی :class:`!Custom` تخصیص داده می‌شود." -msgid "How the :class:`!Custom` **type** behaves: this is the ``CustomType`` struct, which defines a set of flags and function pointers that the interpreter inspects when specific operations are requested." +msgid "" +"How the :class:`!Custom` **type** behaves: this is the ``CustomType`` " +"struct, which defines a set of flags and function pointers that the " +"interpreter inspects when specific operations are requested." msgstr "" +"نحوه‌ی رفتار **نوع** :class:`!Custom`: این ساختار ``CustomType`` است که " +"مجموعه‌ای از پرچم‌ها و اشاره‌گرهای تابع را تعریف می‌کند؛ مفسر آن‌ها را زمانی که " +"عملیات‌های خاصی درخواست می‌شوند بررسی می‌کند." -msgid "How to define and execute the :mod:`!custom` module: this is the ``PyInit_custom`` function and the associated ``custom_module`` struct for defining the module, and the ``custom_module_exec`` function to set up a fresh module object." +msgid "" +"How to define and execute the :mod:`!custom` module: this is the " +"``PyInit_custom`` function and the associated ``custom_module`` struct for " +"defining the module, and the ``custom_module_exec`` function to set up a " +"fresh module object." msgstr "" +"نحوه تعریف و اجرای ماژول :mod:`!custom`: این، تابع ``PyInit_custom`` و " +"ساختار مرتبط ``custom_module`` برای تعریف ماژول، و تابع " +"``custom_module_exec`` برای راه‌اندازی یک شیء ماژول تازه است." msgid "The first bit is::" -msgstr "" +msgstr "بیت اول این است::" msgid "" "typedef struct {\n" " PyObject_HEAD\n" "} CustomObject;" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} CustomObject;" -msgid "This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory at the start of each object struct and defines a field called ``ob_base`` of type :c:type:`PyObject`, containing a pointer to a type object and a reference count (these can be accessed using the macros :c:macro:`Py_TYPE` and :c:macro:`Py_REFCNT` respectively). The reason for the macro is to abstract away the layout and to enable additional fields in :ref:`debug builds `." -msgstr "" +msgid "" +"This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory " +"at the start of each object struct and defines a field called ``ob_base`` " +"of type :c:type:`PyObject`, containing a pointer to a type object and a " +"reference count (these can be accessed using the macros :c:macro:`Py_TYPE` " +"and :c:macro:`Py_REFCNT` respectively). The reason for the macro is to " +"abstract away the layout and to enable additional fields in :ref:`debug " +"builds `." +msgstr "" +"این همان چیزی است که یک شیء Custom در بر خواهد گرفت. ``PyObject_HEAD`` در " +"ابتدای ساختار هر شیء الزامی است و فیلدی به نام ``ob_base`` از " +"نوع :c:type:`PyObject` تعریف می‌کند که شامل یک اشاره‌گر به یک شیء نوع و یک " +"شمارش ارجاع است (می‌توان به این‌ها به‌ترتیب با استفاده از " +"ماکروهای :c:macro:`Py_TYPE` و :c:macro:`Py_REFCNT` دسترسی داشت). دلیل وجود " +"این ماکرو، انتزاعی کردن چیدمان و امکان‌پذیر کردن فیلدهای اضافی " +"در :ref:`نسخه‌های اشکال‌زدایی ` است." -msgid "There is no semicolon above after the :c:macro:`PyObject_HEAD` macro. Be wary of adding one by accident: some compilers will complain." +msgid "" +"There is no semicolon above after the :c:macro:`PyObject_HEAD` macro. Be " +"wary of adding one by accident: some compilers will complain." msgstr "" +"در بالا، پس از ماکروی :c:macro:`PyObject_HEAD` هیچ نقطه‌ویرگولی وجود ندارد. " +"مراقب باشید که ناخواسته یکی اضافه نکنید: برخی کامپایلرها اعتراض خواهند کرد." -msgid "Of course, objects generally store additional data besides the standard ``PyObject_HEAD`` boilerplate; for example, here is the definition for standard Python floats::" +msgid "" +"Of course, objects generally store additional data besides the standard " +"``PyObject_HEAD`` boilerplate; for example, here is the definition for " +"standard Python floats::" msgstr "" +"البته، اشیاء به‌طور کلی علاوه بر کد پیش‌ساخته‌ی استاندارد ``PyObject_HEAD`` " +"داده‌های اضافی نیز ذخیره می‌کنند؛ برای مثال، تعریف اعشاری‌های استاندارد پایتون " +"در ادامه آمده است::" msgid "" "typedef struct {\n" @@ -136,9 +286,13 @@ msgid "" " double ob_fval;\n" "} PyFloatObject;" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +" double ob_fval;\n" +"} PyFloatObject;" msgid "The second bit is the definition of the type object. ::" -msgstr "" +msgstr "بخش دوم، تعریف شیء نوع است. ::" msgid "" "static PyTypeObject CustomType = {\n" @@ -151,27 +305,59 @@ msgid "" " .tp_new = PyType_GenericNew,\n" "};" msgstr "" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};" -msgid "We recommend using C99-style designated initializers as above, to avoid listing all the :c:type:`PyTypeObject` fields that you don't care about and also to avoid caring about the fields' declaration order." +msgid "" +"We recommend using C99-style designated initializers as above, to avoid " +"listing all the :c:type:`PyTypeObject` fields that you don't care about and " +"also to avoid caring about the fields' declaration order." msgstr "" +"توصیه می‌کنیم مانند بالا از مقداردهنده‌های تعیین‌شده (designated initializers) " +"به سبک C99 استفاده کنید تا از فهرست‌کردن تمام فیلدهای :c:type:`PyTypeObject` " +"که به آن‌ها اهمیت نمی‌دهید پرهیز کنید و همچنین از توجه به ترتیب اعلان فیلدها " +"پرهیز کنید." -msgid "The actual definition of :c:type:`PyTypeObject` in :file:`object.h` has many more :ref:`fields ` than the definition above. The remaining fields will be filled with zeros by the C compiler, and it's common practice to not specify them explicitly unless you need them." +msgid "" +"The actual definition of :c:type:`PyTypeObject` in :file:`object.h` has " +"many more :ref:`fields ` than the definition above. The " +"remaining fields will be filled with zeros by the C compiler, and it's " +"common practice to not specify them explicitly unless you need them." msgstr "" +"تعریف واقعی :c:type:`PyTypeObject` در :file:`object.h` نسبت به تعریف " +"بالا :ref:`فیلدهای ` بسیار بیشتری دارد. فیلدهای باقی‌مانده " +"توسط کامپایلر C با صفر پر می‌شوند و رویه رایج این است که آن‌ها را صریحاً مشخص " +"نکنید، مگر اینکه به آن‌ها نیاز داشته باشید." msgid "We're going to pick it apart, one field at a time::" -msgstr "" +msgstr "می‌خواهیم آن را کالبدشکافی کنیم، هر بار یک فیلد::" msgid ".ob_base = PyVarObject_HEAD_INIT(NULL, 0)" -msgstr "" +msgstr ".ob_base = PyVarObject_HEAD_INIT(NULL, 0)" -msgid "This line is mandatory boilerplate to initialize the ``ob_base`` field mentioned above. ::" +msgid "" +"This line is mandatory boilerplate to initialize the ``ob_base`` field " +"mentioned above. ::" msgstr "" +"این سطر یک کد پیش‌ساخته الزامی برای مقداردهی اولیه‌ی فیلد ``ob_base`` است که " +"در بالا ذکر شد. ::" msgid ".tp_name = \"custom.Custom\"," -msgstr "" +msgstr ".tp_name = \"custom.Custom\"," -msgid "The name of our type. This will appear in the default textual representation of our objects and in some error messages, for example:" +msgid "" +"The name of our type. This will appear in the default textual " +"representation of our objects and in some error messages, for example:" msgstr "" +"نام نوع ما. این نام در بازنمایی متنی پیش‌فرض اشیاء ما و در برخی پیام‌های خطا " +"ظاهر می‌شود، برای مثال:" msgid "" ">>> \"\" + custom.Custom()\n" @@ -179,70 +365,158 @@ msgid "" " File \"\", line 1, in \n" "TypeError: can only concatenate str (not \"custom.Custom\") to str" msgstr "" +">>> \"\" + custom.Custom()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: can only concatenate str (not \"custom.Custom\") to str" -msgid "Note that the name is a dotted name that includes both the module name and the name of the type within the module. The module in this case is :mod:`!custom` and the type is :class:`!Custom`, so we set the type name to :class:`!custom.Custom`. Using the real dotted import path is important to make your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" -msgstr "" +msgid "" +"Note that the name is a dotted name that includes both the module name and " +"the name of the type within the module. The module in this case is :mod:`!" +"custom` and the type is :class:`!Custom`, so we set the type name " +"to :class:`!custom.Custom`. Using the real dotted import path is important " +"to make your type compatible with the :mod:`pydoc` and :mod:`pickle` " +"modules. ::" +msgstr "" +"توجه داشته باشید که نام، یک نام نقطه‌گذاری‌شده است که هم نام ماژول و هم نام " +"نوع درون ماژول را در بر می‌گیرد. ماژول در این مورد :mod:`!custom` است و " +"نوع :class:`!Custom`، بنابراین نام نوع را برابر با :class:`!custom.Custom` " +"قرار می‌دهیم. استفاده از مسیر ایمپورت نقطه‌گذاری‌شده‌ی واقعی برای سازگار کردن " +"نوع شما با ماژول‌های :mod:`pydoc` و :mod:`pickle` اهمیت دارد. ::" msgid "" ".tp_basicsize = sizeof(CustomObject),\n" ".tp_itemsize = 0," msgstr "" +".tp_basicsize = sizeof(CustomObject),\n" +".tp_itemsize = 0," -msgid "This is so that Python knows how much memory to allocate when creating new :class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only used for variable-sized objects and should otherwise be zero." +msgid "" +"This is so that Python knows how much memory to allocate when creating " +"new :class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is " +"only used for variable-sized objects and should otherwise be zero." msgstr "" +"این کار برای آن است که پایتون بداند هنگام ایجاد نمونه‌های جدید :class:`!" +"Custom` چه مقدار حافظه باید تخصیص " +"دهد. :c:member:`~PyTypeObject.tp_itemsize` تنها برای شیءهای با اندازه‌ی " +"متغیر استفاده می‌شود و در غیر این صورت باید صفر باشد." -msgid "If you want your type to be subclassable from Python, and your type has the same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have problems with multiple inheritance. A Python subclass of your type will have to list your type first in its :attr:`~type.__bases__`, or else it will not be able to call your type's :meth:`~object.__new__` method without getting an error. You can avoid this problem by ensuring that your type has a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type does. Most of the time, this will be true anyway, because either your base type will be :class:`object`, or else you will be adding data members to your base type, and therefore increasing its size." -msgstr "" +msgid "" +"If you want your type to be subclassable from Python, and your type has the " +"same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have " +"problems with multiple inheritance. A Python subclass of your type will " +"have to list your type first in its :attr:`~type.__bases__`, or else it " +"will not be able to call your type's :meth:`~object.__new__` method without " +"getting an error. You can avoid this problem by ensuring that your type " +"has a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base " +"type does. Most of the time, this will be true anyway, because either your " +"base type will be :class:`object`, or else you will be adding data members " +"to your base type, and therefore increasing its size." +msgstr "" +"اگر می‌خواهید نوع شما از پایتون قابل زیرکلاس‌گیری باشد و نوع شما " +"همان :c:member:`~PyTypeObject.tp_basicsize` نوع پایه‌اش را داشته باشد، ممکن " +"است با وراثت چندگانه مشکلاتی داشته باشید. یک زیرکلاس پایتونی از نوع شما " +"باید نوع شما را در ابتدای :attr:`~type.__bases__` خود فهرست کند، وگرنه " +"نخواهد توانست متد :meth:`~object.__new__` نوع شما را بدون دریافت خطا " +"فراخوانی کند. می‌توانید با اطمینان از اینکه نوع شما مقدار بزرگ‌تری " +"برای :c:member:`~PyTypeObject.tp_basicsize` نسبت به نوع پایه‌اش دارد، از این " +"مشکل اجتناب کنید. در بیشتر موارد، این موضوع به هر حال برقرار خواهد بود، " +"زیرا یا نوع پایه شما :class:`object` خواهد بود، یا اعضای داده به نوع پایه " +"خود اضافه خواهید کرد و بنابراین اندازه‌اش را افزایش می‌دهید." msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" -msgstr "" +msgstr "پرچم‌های کلاس را برابر :c:macro:`Py_TPFLAGS_DEFAULT` قرار می‌دهیم. ::" msgid ".tp_flags = Py_TPFLAGS_DEFAULT," -msgstr "" +msgstr ".tp_flags = Py_TPFLAGS_DEFAULT," -msgid "All types should include this constant in their flags. It enables all of the members defined until at least Python 3.3. If you need further members, you will need to OR the corresponding flags." +msgid "" +"All types should include this constant in their flags. It enables all of " +"the members defined until at least Python 3.3. If you need further " +"members, you will need to OR the corresponding flags." msgstr "" +"همه‌ی نوع‌ها باید این ثابت را در پرچم‌های خود بگنجانند. این ثابت همه‌ی اعضای " +"تعریف‌شده تا دست‌کم پایتون 3.3 را فعال می‌کند. اگر به اعضای بیشتری نیاز داشته " +"باشید، باید پرچم‌های مربوطه را OR کنید." -msgid "We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::" +msgid "" +"We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::" msgstr "" +"ما یک رشته مستند برای این نوع در :c:member:`~PyTypeObject.tp_doc` ارائه " +"می‌کنیم. ::" msgid ".tp_doc = PyDoc_STR(\"Custom objects\")," -msgstr "" +msgstr ".tp_doc = PyDoc_STR(\"Custom objects\")," -msgid "To enable object creation, we have to provide a :c:member:`~PyTypeObject.tp_new` handler. This is the equivalent of the Python method :meth:`~object.__new__`, but has to be specified explicitly. In this case, we can just use the default implementation provided by the API function :c:func:`PyType_GenericNew`. ::" +msgid "" +"To enable object creation, we have to provide " +"a :c:member:`~PyTypeObject.tp_new` handler. This is the equivalent of the " +"Python method :meth:`~object.__new__`, but has to be specified explicitly. " +"In this case, we can just use the default implementation provided by the " +"API function :c:func:`PyType_GenericNew`. ::" msgstr "" +"برای فعال‌سازی ایجاد شیء، باید هندلر :c:member:`~PyTypeObject.tp_new` را " +"فراهم کنیم. این معادل متد پایتونی :meth:`~object.__new__` است، اما باید " +"به‌طور صریح مشخص شود. در این مورد، می‌توانیم به‌سادگی از پیاده‌سازی پیش‌فرض " +"ارائه‌شده توسط تابع API یعنی :c:func:`PyType_GenericNew` استفاده کنیم. ::" msgid ".tp_new = PyType_GenericNew," -msgstr "" +msgstr ".tp_new = PyType_GenericNew," -msgid "Everything else in the file should be familiar, except for some code in :c:func:`!custom_module_exec`::" +msgid "" +"Everything else in the file should be familiar, except for some code " +"in :c:func:`!custom_module_exec`::" msgstr "" +"بقیه‌ی محتوای پرونده باید برایتان آشنا باشد، به‌جز بخشی از کد در :c:func:`!" +"custom_module_exec`::" msgid "" "if (PyType_Ready(&CustomType) < 0) {\n" " return -1;\n" "}" msgstr "" +"if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" +"}" -msgid "This initializes the :class:`!Custom` type, filling in a number of members to the appropriate default values, including :c:member:`~PyObject.ob_type` that we initially set to ``NULL``. ::" +msgid "" +"This initializes the :class:`!Custom` type, filling in a number of members " +"to the appropriate default values, including :c:member:`~PyObject.ob_type` " +"that we initially set to ``NULL``. ::" msgstr "" +"این کار نوع :class:`!Custom` را مقداردهی اولیه می‌کند و تعدادی از اعضا را با " +"مقادیر پیش‌فرض مناسب پر می‌کند؛ از جمله :c:member:`~PyObject.ob_type` که در " +"ابتدا آن را روی ``NULL`` قرار داده‌ایم. ::" msgid "" "if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" " return -1;\n" "}" msgstr "" +"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" return -1;\n" +"}" -msgid "This adds the type to the module dictionary. This allows us to create :class:`!Custom` instances by calling the :class:`!Custom` class:" +msgid "" +"This adds the type to the module dictionary. This allows us to " +"create :class:`!Custom` instances by calling the :class:`!Custom` class:" msgstr "" +"این کار، نوع را به دیکشنری ماژول اضافه می‌کند. این به ما امکان می‌دهد " +"نمونه‌های :class:`!Custom` را با فراخوانی کلاس :class:`!Custom` ایجاد کنیم:" msgid "" ">>> import custom\n" ">>> mycustom = custom.Custom()" msgstr "" +">>> import custom\n" +">>> mycustom = custom.Custom()" -msgid "That's it! All that remains is to build it; put the above code in a file called :file:`custom.c`," +msgid "" +"That's it! All that remains is to build it; put the above code in a file " +"called :file:`custom.c`," msgstr "" +"همین است! تنها کار باقی‌مانده، ساختن آن است؛ کد بالا را در پرونده‌ای به " +"نام :file:`custom.c` قرار دهید،" msgid "" "[build-system]\n" @@ -253,35 +527,60 @@ msgid "" "name = \"custom\"\n" "version = \"1\"\n" msgstr "" +"[build-system]\n" +"requires = [\"setuptools\"]\n" +"build-backend = \"setuptools.build_meta\"\n" +"\n" +"[project]\n" +"name = \"custom\"\n" +"version = \"1\"\n" msgid "in a file called :file:`pyproject.toml`, and" -msgstr "" +msgstr "در پرونده‌ای به نام :file:`pyproject.toml`، و" msgid "" "from setuptools import Extension, setup\n" "setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" msgstr "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" msgid "in a file called :file:`setup.py`; then typing" -msgstr "" +msgstr "در پرونده‌ای به نام :file:`setup.py`؛ سپس با تایپ کردن" msgid "$ python -m pip install ." -msgstr "" +msgstr "$ python -m pip install ." -msgid "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." +msgid "" +"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 "" +"در یک پوسته باید پرونده‌ی :file:`custom.so` را در یک زیرپوشه تولید کند و آن " +"را نصب کند؛ اکنون پایتون را اجرا کنید --- باید بتوانید ``import custom`` را " +"انجام دهید و با اشیای ``Custom`` آزمایش کنید." msgid "That wasn't so hard, was it?" -msgstr "" +msgstr "این کار چندان سخت نبود، نه؟" -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." +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 "" +"البته، نوع Custom فعلی کاملاً بی‌جالب است. هیچ داده‌ای ندارد و هیچ کاری انجام " +"نمی‌دهد. حتی نمی‌توان از آن زیرکلاس ساخت." msgid "Adding data and methods to the Basic example" -msgstr "" +msgstr "افزودن داده‌ها و متدها به مثال پایه" -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:" +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 "" +"بیایید مثال پایه را گسترش دهیم تا برخی داده‌ها و متدها را اضافه کنیم. بیایید " +"همچنین نوع را به‌گونه‌ای بسازیم که به‌عنوان کلاس پایه قابل استفاده باشد. ماژول " +"جدیدی می‌سازیم، :mod:`!custom2`، که این قابلیت‌ها را اضافه می‌کند:" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -399,7 +698,8 @@ msgid "" " return -1;\n" " }\n" "\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" " return -1;\n" " }\n" "\n" @@ -408,7 +708,8 @@ msgid "" "\n" "static PyModuleDef_Slot custom_module_slots[] = {\n" " {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" " {0, NULL}\n" "};\n" "\n" @@ -426,29 +727,17 @@ msgid "" " return PyModuleDef_Init(&custom_module);\n" "}\n" msgstr "" - -msgid "This version of the module has a number of changes." -msgstr "" - -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 strings containing first and last names. The *number* attribute is a C integer." -msgstr "" - -msgid "The object structure is updated accordingly::" -msgstr "" - -msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" "typedef struct {\n" " PyObject_HEAD\n" " PyObject *first; /* first name */\n" " PyObject *last; /* last name */\n" " int number;\n" -"} CustomObject;" -msgstr "" - -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 "" - -msgid "" +"} CustomObject;\n" +"\n" "static void\n" "Custom_dealloc(PyObject *op)\n" "{\n" @@ -456,54 +745,20 @@ msgid "" " Py_XDECREF(self->first);\n" " Py_XDECREF(self->last);\n" " Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" -msgstr "" - -msgid ".tp_dealloc = Custom_dealloc," -msgstr "" - -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 ``NULL`` (which might happen here if ``tp_new`` failed midway). It then calls the :c:member:`~PyTypeObject.tp_free` member of the object's type (computed by ``Py_TYPE(self)``) to free the object's memory. Note that the object's type might not be :class:`!CustomType`, because the object may be an instance of a subclass." -msgstr "" - -msgid "The explicit cast to ``CustomObject *`` above is needed because we defined ``Custom_dealloc`` to take a ``PyObject *`` argument, as the ``tp_dealloc`` function pointer expects to receive a ``PyObject *`` argument. By assigning to the ``tp_dealloc`` slot of a type, we declare that it can only be called with instances of our ``CustomObject`` class, so the cast to ``(CustomObject *)`` is safe. This is object-oriented polymorphism, in C!" -msgstr "" - -msgid "In existing code, or in previous versions of this tutorial, you might see similar functions take a pointer to the subtype object structure (``CustomObject*``) directly, like this::" -msgstr "" - -msgid "" -"Custom_dealloc(CustomObject *self)\n" -"{\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free((PyObject *) self);\n" "}\n" -"...\n" -".tp_dealloc = (destructor) Custom_dealloc," -msgstr "" - -msgid "This does the same thing on all architectures that CPython supports, but according to the C standard, it invokes undefined behavior." -msgstr "" - -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 "" - -msgid "" +"\n" "static PyObject *\n" "Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" "{\n" " CustomObject *self;\n" " self = (CustomObject *) type->tp_alloc(type, 0);\n" " if (self != NULL) {\n" -" self->first = PyUnicode_FromString(\"\");\n" +" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" " if (self->first == NULL) {\n" " Py_DECREF(self);\n" " return NULL;\n" " }\n" -" self->last = PyUnicode_FromString(\"\");\n" +" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" " if (self->last == NULL) {\n" " Py_DECREF(self);\n" " return NULL;\n" @@ -511,49 +766,14 @@ msgid "" " self->number = 0;\n" " }\n" " return (PyObject *) self;\n" -"}" -msgstr "" - -msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" -msgstr "" - -msgid ".tp_new = Custom_new," -msgstr "" - -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:`~object.__new__` method. It is not required to define a ``tp_new`` member, and indeed many extension types will simply reuse :c:func:`PyType_GenericNew` as done in the first version of the :class:`!Custom` type above. In this case, we use the ``tp_new`` handler to initialize the ``first`` and ``last`` attributes to non-``NULL`` default values." -msgstr "" - -msgid "``tp_new`` is passed the type being instantiated (not necessarily ``CustomType``, if a subclass is instantiated) and any arguments passed when the type was called, and is expected to return the instance created. ``tp_new`` handlers always accept positional and keyword arguments, but they often ignore the arguments, leaving the argument handling to initializer (a.k.a. ``tp_init`` in C or ``__init__`` in Python) methods." -msgstr "" - -msgid "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do it itself." -msgstr "" - -msgid "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` slot to allocate memory::" -msgstr "" - -msgid "self = (CustomObject *) type->tp_alloc(type, 0);" -msgstr "" - -msgid "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject.tp_alloc` result against ``NULL`` before proceeding." -msgstr "" - -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 class, which is :class:`object` by default. Most types use the default allocation strategy." -msgstr "" - -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.__new__`), you must *not* try to determine what method to call using method resolution order at runtime. Always statically determine what type you are going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or via ``type->tp_base->tp_new``. If you do not do this, Python subclasses of your type that also inherit from other Python-defined classes may not work correctly. (Specifically, you may not be able to create instances of such subclasses without getting a :exc:`TypeError`.)" -msgstr "" - -msgid "We also define an initialization function which accepts arguments to provide initial values for our instance::" -msgstr "" - -msgid "" +"}\n" +"\n" "static int\n" "Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" "{\n" " CustomObject *self = (CustomObject *) op;\n" " static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL, *tmp;\n" +" PyObject *first = NULL, *last = NULL;\n" "\n" " if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" " &first, &last,\n" @@ -561,163 +781,1451 @@ msgid "" " return -1;\n" "\n" " if (first) {\n" -" tmp = self->first;\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -" Py_XDECREF(tmp);\n" +" Py_XSETREF(self->first, Py_NewRef(first));\n" " }\n" " if (last) {\n" -" tmp = self->last;\n" -" Py_INCREF(last);\n" -" self->last = last;\n" -" Py_XDECREF(tmp);\n" +" Py_XSETREF(self->last, Py_NewRef(last));\n" " }\n" " return 0;\n" -"}" -msgstr "" - -msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" -msgstr "" - -msgid ".tp_init = Custom_init," -msgstr "" - -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 created. Initializers always accept positional and keyword arguments, and they should return either ``0`` on success or ``-1`` on error." -msgstr "" - -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 call :meth:`~object.__init__` on unpickled instances). It can also be called multiple times. Anyone can call the :meth:`!__init__` method on our objects. For this reason, we have to be extra careful when assigning the new attribute values. We might be tempted, for example to assign the ``first`` member like this::" -msgstr "" - +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom2.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = Custom_init,\n" +" .tp_dealloc = Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +"};\n" +"\n" +"static int\n" +"custom_module_exec(PyObject *m)\n" +"{\n" +" if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot custom_module_slots[] = {\n" +" {Py_mod_exec, custom_module_exec},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef custom_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom2\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = custom_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom2(void)\n" +"{\n" +" return PyModuleDef_Init(&custom_module);\n" +"}\n" + +msgid "This version of the module has a number of changes." +msgstr "این نسخه از ماژول شامل تعدادی تغییر است." + msgid "" -"if (first) {\n" -" Py_XDECREF(self->first);\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -"}" +"The :class:`!Custom` type now has three data attributes in its C struct, " +"*first*, *last*, and *number*. The *first* and *last* variables are Python " +"strings containing first and last names. The *number* attribute is a C " +"integer." msgstr "" +"نوع :class:`!Custom` اکنون سه ویژگی داده‌ای در ساختار C خود دارد: *first*، " +"*last* و *number*. متغیرهای *first* و *last* رشته‌های پایتونی حاوی نام و نام " +"خانوادگی هستند. ویژگی *number* یک عدد صحیح C است." -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 destructor that causes code to be executed that tries to access the ``first`` member; or that destructor could detach the :term:`thread state ` and let arbitrary code run in other threads that accesses and modifies our object." -msgstr "" +msgid "The object structure is updated accordingly::" +msgstr "ساختار شیء متناسب با آن به‌روزرسانی می‌شود::" -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?" +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;" msgstr "" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;" -msgid "when we absolutely know that the reference count is greater than 1;" +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 "" +"از آنجا که اکنون داده‌هایی برای مدیریت داریم، باید در تخصیص و آزادسازی شیء " +"دقت بیشتری به خرج دهیم. دست‌کم، به یک متد آزادسازی نیاز داریم::" -msgid "when we know that deallocation of the object [#]_ will neither detach the :term:`thread state ` nor cause any calls back into our type's code;" +msgid "" +"static void\n" +"Custom_dealloc(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" msgstr "" +"static void\n" +"Custom_dealloc(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}" -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 "" +msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" +msgstr "که به عضو :c:member:`~PyTypeObject.tp_dealloc` انتساب داده می‌شود::" -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 "" +msgid ".tp_dealloc = Custom_dealloc," +msgstr ".tp_dealloc = Custom_dealloc," msgid "" -"static PyMemberDef Custom_members[] = {\n" -" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" -" \"first name\"},\n" -" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" -" \"last name\"},\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" +"This method first clears the reference counts of the two Python " +"attributes. :c:func:`Py_XDECREF` correctly handles the case where its " +"argument is ``NULL`` (which might happen here if ``tp_new`` failed " +"midway). It then calls the :c:member:`~PyTypeObject.tp_free` member of the " +"object's type (computed by ``Py_TYPE(self)``) to free the object's memory. " +"Note that the object's type might not be :class:`!CustomType`, because the " +"object may be an instance of a subclass." +msgstr "" +"این متد ابتدا شمارش ارجاع دو ویژگی پایتونی را پاک " +"می‌کند. :c:func:`Py_XDECREF` به‌درستی حالتی را مدیریت می‌کند که آرگومان آن " +"``NULL`` باشد (که ممکن است در اینجا رخ دهد اگر ``tp_new`` در میانه کار شکست " +"بخورد). سپس عضو :c:member:`~PyTypeObject.tp_free` از نوع شیء (که توسط " +"``Py_TYPE(self)`` محاسبه می‌شود) را فراخوانی می‌کند تا حافظه شیء را آزاد کند. " +"توجه داشته باشید که نوع شیء ممکن است :class:`!CustomType` نباشد، زیرا شیء " +"ممکن است نمونه‌ای از یک زیرکلاس باشد." -msgid "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" -msgstr "" +msgid "" +"The explicit cast to ``CustomObject *`` above is needed because we defined " +"``Custom_dealloc`` to take a ``PyObject *`` argument, as the ``tp_dealloc`` " +"function pointer expects to receive a ``PyObject *`` argument. By assigning " +"to the ``tp_dealloc`` slot of a type, we declare that it can only be called " +"with instances of our ``CustomObject`` class, so the cast to " +"``(CustomObject *)`` is safe. This is object-oriented polymorphism, in C!" +msgstr "" +"قالب‌ریزی صریح به ``CustomObject *`` در بالا لازم است، زیرا " +"``Custom_dealloc`` را طوری تعریف کردیم که یک آرگومان ``PyObject *`` بگیرد، " +"چرا که اشاره‌گر تابع ``tp_dealloc`` انتظار دارد یک آرگومان ``PyObject *`` " +"دریافت کند. با انتساب به جایگاه ``tp_dealloc`` یک نوع، اعلام می‌کنیم که فقط " +"می‌توان آن را با نمونه‌های کلاس ``CustomObject`` ما فراخوانی کرد، بنابراین " +"قالب‌ریزی به ``(CustomObject *)`` ایمن است. این همان چندریختی شیءگرا است، در " +"C!" -msgid ".tp_members = Custom_members," +msgid "" +"In existing code, or in previous versions of this tutorial, you might see " +"similar functions take a pointer to the subtype object structure " +"(``CustomObject*``) directly, like this::" msgstr "" +"در کدهای موجود، یا در نسخه‌های قبلی این آموزش، ممکن است ببینید که توابع " +"مشابه، اشاره‌گر به ساختار شیء زیرنوع (``CustomObject*``) را مستقیماً می‌گیرند، " +"به این شکل::" -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." +msgid "" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"...\n" +".tp_dealloc = (destructor) Custom_dealloc," msgstr "" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"...\n" +".tp_dealloc = (destructor) Custom_dealloc," -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 expect the first and last names to be strings, but any Python objects can be assigned. Further, the attributes can be deleted, setting the C pointers to ``NULL``. Even though we can make sure the members are initialized to non-``NULL`` values, the members can be set to ``NULL`` if the attributes are deleted." +msgid "" +"This does the same thing on all architectures that CPython supports, but " +"according to the C standard, it invokes undefined behavior." msgstr "" +"این کار روی همه‌ی معماری‌هایی که سی‌پایتون از آن‌ها پشتیبانی می‌کند، یکسان انجام " +"می‌شود، اما طبق استاندارد C، موجب رفتار تعریف‌نشده (undefined behavior) می‌شود." -msgid "We define a single method, :meth:`!Custom.name`, that outputs the objects name as the concatenation of the first and last names. ::" +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 "" +"می‌خواهیم مطمئن شویم که نام و نام خانوادگی با رشته‌های خالی مقداردهی اولیه " +"می‌شوند، بنابراین یک پیاده‌سازی ``tp_new`` ارائه می‌کنیم::" msgid "" "static PyObject *\n" -"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" "{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (self->first == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"first\");\n" -" return NULL;\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" " }\n" -" if (self->last == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"last\");\n" -" return NULL;\n" +" return (PyObject *) self;\n" +"}" +msgstr "" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" " }\n" -" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +" return (PyObject *) self;\n" "}" + +msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" +msgstr "و آن را در عضو :c:member:`~PyTypeObject.tp_new` نصب کنید::" + +msgid ".tp_new = Custom_new," +msgstr ".tp_new = Custom_new," + +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:`~object.__new__` method. It is not required to define a " +"``tp_new`` member, and indeed many extension types will simply " +"reuse :c:func:`PyType_GenericNew` as done in the first version of " +"the :class:`!Custom` type above. In this case, we use the ``tp_new`` " +"handler to initialize the ``first`` and ``last`` attributes to non-``NULL`` " +"default values." +msgstr "" +"هندلر ``tp_new`` مسئول ایجاد (و نه مقداردهی اولیه‌ی) اشیاء از این نوع است. " +"این هندلر در پایتون به‌صورت متد :meth:`~object.__new__` در دسترس قرار " +"می‌گیرد. تعریف عضو ``tp_new`` الزامی نیست و در واقع بسیاری از نوع‌های توسعه‌ای " +"صرفاً از :c:func:`PyType_GenericNew` بازاستفاده می‌کنند، همان‌طور که در نسخه‌ی " +"اول نوع :class:`!Custom` در بالا انجام شد. در این حالت، از هندلر ``tp_new`` " +"برای مقداردهی اولیه‌ی ویژگی‌های ``first`` و ``last`` به مقادیر پیش‌فرض غیر " +"``NULL`` استفاده می‌کنیم." + +msgid "" +"``tp_new`` is passed the type being instantiated (not necessarily " +"``CustomType``, if a subclass is instantiated) and any arguments passed " +"when the type was called, and is expected to return the instance created. " +"``tp_new`` handlers always accept positional and keyword arguments, but " +"they often ignore the arguments, leaving the argument handling to " +"initializer (a.k.a. ``tp_init`` in C or ``__init__`` in Python) methods." +msgstr "" +"``tp_new`` نوعی را که از آن نمونه‌سازی می‌شود (اگر از یک زیرکلاس نمونه‌سازی " +"شود، لزوماً ``CustomType`` نیست) و هر آرگومانی را که هنگام فراخوانی نوع پاس " +"داده شده است، دریافت می‌کند و انتظار می‌رود که نمونه‌ی ایجادشده را برگرداند. " +"هندلرهای ``tp_new`` همیشه آرگومان‌های جایگاهی و کلیدواژه‌ای را می‌پذیرند، اما " +"اغلب آرگومان‌ها را نادیده می‌گیرند و مدیریت آرگومان‌ها را به متدهای " +"مقداردهنده‌ی اولیه (معروف به ``tp_init`` در C یا ``__init__`` در پایتون) " +"واگذار می‌کنند." + +msgid "" +"``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will " +"do it itself." +msgstr "" +"``tp_new`` نباید ``tp_init`` را به‌طور صریح فراخوانی کند، زیرا مفسر خودش این " +"کار را انجام می‌دهد." + +msgid "" +"The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " +"slot to allocate memory::" msgstr "" +"پیاده‌سازی ``tp_new`` جایگاه :c:member:`~PyTypeObject.tp_alloc` را برای " +"تخصیص حافظه فراخوانی می‌کند::" + +msgid "self = (CustomObject *) type->tp_alloc(type, 0);" +msgstr "self = (CustomObject *) type->tp_alloc(type, 0);" -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 take an instance as the first argument. Methods often take positional and keyword arguments as well, but in this case we don't take any and don't need to accept a positional argument tuple or keyword argument dictionary. This method is equivalent to the Python method:" +msgid "" +"Since memory allocation may fail, we must check " +"the :c:member:`~PyTypeObject.tp_alloc` result against ``NULL`` before " +"proceeding." msgstr "" +"از آنجا که تخصیص حافظه ممکن است شکست بخورد، باید پیش از ادامه دادن، " +"نتیجه‌ی :c:member:`~PyTypeObject.tp_alloc` را در برابر ``NULL`` بررسی کنیم." msgid "" -"def name(self):\n" -" return \"%s %s\" % (self.first, self.last)" +"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 class, which is :class:`object` by default. Most types use the " +"default allocation strategy." msgstr "" +"ما خودمان جایگاه :c:member:`~PyTypeObject.tp_alloc` را پر نکردیم. " +"بلکه :c:func:`PyType_Ready` آن را با ارث‌بری از کلاس پایه‌ی ما — که به‌طور " +"پیش‌فرض :class:`object` است — برای ما پر می‌کند. بیشتر نوع‌ها از راهبرد تخصیص " +"پیش‌فرض استفاده می‌کنند." + +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.__new__`), you must *not* try to determine what method to " +"call using method resolution order at runtime. Always statically determine " +"what type you are going to call, and call " +"its :c:member:`~PyTypeObject.tp_new` directly, or via ``type->tp_base-" +">tp_new``. If you do not do this, Python subclasses of your type that also " +"inherit from other Python-defined classes may not work correctly. " +"(Specifically, you may not be able to create instances of such subclasses " +"without getting a :exc:`TypeError`.)" +msgstr "" +"اگر در حال ایجاد یک :c:member:`~PyTypeObject.tp_new` همکار هستید (یکی " +"که :c:member:`~PyTypeObject.tp_new` نوع پایه یا :meth:`~object.__new__` را " +"فراخوانی می‌کند)، *نباید* سعی کنید در زمان اجرا با استفاده از ترتیب حل متد " +"تعیین کنید که کدام متد باید فراخوانی شود. همیشه به‌صورت ایستا تعیین کنید که " +"می‌خواهید کدام نوع را فراخوانی کنید و :c:member:`~PyTypeObject.tp_new` آن را " +"مستقیماً یا از طریق ``type->tp_base->tp_new`` فراخوانی کنید. اگر این کار را " +"نکنید، ممکن است زیرکلاس‌های پایتونی از نوع شما که از کلاس‌های دیگر تعریف‌شده " +"در پایتون نیز ارث‌بری می‌کنند، به‌درستی کار نکنند. (به‌طور خاص، ممکن است " +"نتوانید بدون دریافت :exc:`TypeError` نمونه‌هایی از چنین زیرکلاس‌هایی ایجاد " +"کنید.)" -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 which case they are set to ``NULL``. It would be better to prevent deletion of these attributes and to restrict the attribute values to be strings. We'll see how to do that in the next section." +msgid "" +"We also define an initialization function which accepts arguments to " +"provide initial values for our instance::" msgstr "" +"ما همچنین یک تابع مقداردهی اولیه تعریف می‌کنیم که آرگومان‌هایی را می‌پذیرد تا " +"مقادیر اولیه را برای نمونه‌ی ما فراهم کند::" -msgid "Now that we've defined the method, we need to create an array of method definitions::" +msgid "" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" msgstr "" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" + +msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" +msgstr "با پر کردن جایگاه :c:member:`~PyTypeObject.tp_init`. ::" + +msgid ".tp_init = Custom_init," +msgstr ".tp_init = Custom_init," + +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 created. Initializers always accept positional and keyword " +"arguments, and they should return either ``0`` on success or ``-1`` on " +"error." +msgstr "" +"جایگاه :c:member:`~PyTypeObject.tp_init` در پایتون به‌صورت " +"متد :meth:`~object.__init__` در دسترس قرار می‌گیرد. از این متد برای مقداردهی " +"اولیه‌ی شیء پس از ایجاد آن استفاده می‌شود. مقداردهنده‌های اولیه همیشه " +"آرگومان‌های جایگاهی و کلیدواژه‌ای را می‌پذیرند و باید در صورت موفقیت ``0`` و " +"در صورت خطا ``-1`` را برگردانند." + +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 " +"call :meth:`~object.__init__` on unpickled instances). It can also be " +"called multiple times. Anyone can call the :meth:`!__init__` method on our " +"objects. For this reason, we have to be extra careful when assigning the " +"new attribute values. We might be tempted, for example to assign the " +"``first`` member like this::" +msgstr "" +"برخلاف هندلر ``tp_new``، هیچ تضمینی وجود ندارد که ``tp_init`` اصلاً فراخوانی " +"شود (برای مثال، ماژول :mod:`pickle` به‌طور پیش‌فرض :meth:`~object.__init__` " +"را روی نمونه‌های پیکل‌گشایی‌شده فراخوانی نمی‌کند). همچنین ممکن است چندین بار " +"فراخوانی شود. هر کسی می‌تواند متد :meth:`!__init__` را روی اشیاء ما فراخوانی " +"کند. به همین دلیل، باید هنگام انتساب مقادیر جدید به ویژگی‌ها بسیار مراقب " +"باشیم. ممکن است، برای مثال، وسوسه شویم که عضو ``first`` را به این صورت " +"انتساب دهیم::" + +msgid "" +"if (first) {\n" +" Py_XDECREF(self->first);\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +"}" +msgstr "" +"if (first) {\n" +" Py_XDECREF(self->first);\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +"}" + +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 " +"destructor that causes code to be executed that tries to access the " +"``first`` member; or that destructor could detach the :term:`thread state " +"` and let arbitrary code run in other threads that " +"accesses and modifies our object." +msgstr "" +"اما این کار پرخطر خواهد بود. نوع ما نوع عضو ``first`` را محدود نمی‌کند، " +"بنابراین می‌تواند هر نوع شیء باشد. ممکن است مخربی داشته باشد که موجب اجرای " +"کدی شود که تلاش می‌کند به عضو ``first`` دسترسی پیدا کند؛ یا همان مخرب " +"می‌تواند :term:`وضعیت نخ ` را جدا کند و اجازه دهد کد " +"دلخواهی در نخ‌های دیگر اجرا شود که به شیء ما دسترسی پیدا می‌کند و آن را تغییر " +"می‌دهد." + +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 "" +"برای احتیاط افراطی و محافظت از خود در برابر این احتمال، تقریباً همیشه اعضا " +"را پیش از کاهش شمارش ارجاعشان مجدداً انتساب می‌کنیم. چه زمانی لازم نیست این " +"کار را انجام دهیم؟" + +msgid "when we absolutely know that the reference count is greater than 1;" +msgstr "وقتی به‌طور قطع می‌دانیم که شمارش ارجاع بزرگ‌تر از ۱ است؛" + +msgid "" +"when we know that deallocation of the object [#]_ will neither detach " +"the :term:`thread state ` nor cause any calls back " +"into our type's code;" +msgstr "" +"زمانی که می‌دانیم آزادسازی شیء [#]_ نه :term:`وضعیت نخ ` را جدا می‌کند و نه هیچ فراخوانی مجددی به کد نوع ما ایجاد می‌کند؛" + +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 "" +"هنگام کاهش شمارش ارجاع در هندلر :c:member:`~PyTypeObject.tp_dealloc` روی " +"نوعی که از زباله‌روبی چرخه‌ای پشتیبانی نمی‌کند [#]_." + +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 "" +"ما می‌خواهیم متغیرهای نمونه‌ی خود را به‌عنوان ویژگی‌ها در دسترس قرار دهیم. " +"راه‌های مختلفی برای انجام این کار وجود دارد. ساده‌ترین راه، تعریف تعریف‌های " +"عضو است::" + +msgid "" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" + +msgid "" +"and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" +msgstr "" +"و تعاریف را در جایگاه :c:member:`~PyTypeObject.tp_members` قرار دهید::" + +msgid ".tp_members = Custom_members," +msgstr ".tp_members = Custom_members," + +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 "" +"هر تعریف عضو دارای نام عضو، نوع، آفست، پرچم‌های دسترسی و رشته مستند است. " +"برای جزئیات، بخش :ref:`Generic-Attribute-Management` را در ادامه ببینید." + +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 expect the first and last names to be strings, but any " +"Python objects can be assigned. Further, the attributes can be deleted, " +"setting the C pointers to ``NULL``. Even though we can make sure the " +"members are initialized to non-``NULL`` values, the members can be set to " +"``NULL`` if the attributes are deleted." +msgstr "" +"یکی از معایب این رویکرد این است که راهی برای محدود کردن نوع اشیایی که " +"می‌توان به ویژگی‌های پایتون انتساب داد، فراهم نمی‌کند. انتظار داریم نام و نام " +"خانوادگی رشته باشند، اما هر شیء پایتونی می‌تواند انتساب داده شود. علاوه بر " +"این، ویژگی‌ها را می‌توان حذف کرد که این کار اشاره‌گرهای C را روی ``NULL`` قرار " +"می‌دهد. حتی اگر بتوانیم اطمینان حاصل کنیم که اعضا با مقادیر غیر ``NULL`` " +"مقداردهی اولیه شده‌اند، در صورت حذف ویژگی‌ها، اعضا می‌توانند روی ``NULL`` قرار " +"گیرند." + +msgid "" +"We define a single method, :meth:`!Custom.name`, that outputs the objects " +"name as the concatenation of the first and last names. ::" +msgstr "" +"ما یک متد واحد، :meth:`!Custom.name`، تعریف می‌کنیم که نام شیء را به‌صورت " +"الحاق نام کوچک و نام خانوادگی خروجی می‌دهد. ::" + +msgid "" +"static PyObject *\n" +"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}" +msgstr "" +"static PyObject *\n" +"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}" + +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 take an instance as the first argument. Methods often take " +"positional and keyword arguments as well, but in this case we don't take " +"any and don't need to accept a positional argument tuple or keyword " +"argument dictionary. This method is equivalent to the Python method:" +msgstr "" +"این متد به‌صورت یک تابع C پیاده‌سازی شده است که یک نمونه‌ی :class:`!Custom` " +"(یا زیرکلاس :class:`!Custom`) را به‌عنوان نخستین آرگومان می‌گیرد. متدها همیشه " +"یک نمونه را به‌عنوان نخستین آرگومان می‌گیرند. متدها اغلب آرگومان‌های جایگاهی و " +"کلیدواژه‌ای نیز می‌گیرند، اما در این مورد ما هیچ آرگومانی نمی‌گیریم و نیازی به " +"پذیرفتن تاپل آرگومان‌های جایگاهی یا دیکشنری آرگومان‌های کلیدواژه‌ای نداریم. " +"این متد معادل متد پایتونی زیر است:" + +msgid "" +"def name(self):\n" +" return \"%s %s\" % (self.first, self.last)" +msgstr "" +"def name(self):\n" +" return \"%s %s\" % (self.first, self.last)" + +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 which case they are set to ``NULL``. It would be better to " +"prevent deletion of these attributes and to restrict the attribute values " +"to be strings. We'll see how to do that in the next section." +msgstr "" +"توجه داشته باشید که باید احتمال ``NULL`` بودن اعضای :attr:`!first` " +"و :attr:`!last` خود را بررسی کنیم. دلیل این است که این اعضا ممکن است حذف " +"شوند، که در این صورت برابر ``NULL`` قرار می‌گیرند. بهتر است که از حذف این " +"ویژگی‌ها جلوگیری کرده و مقادیر ویژگی‌ها را به رشته‌ها محدود کنیم. در بخش بعدی " +"خواهیم دید که چگونه این کار را انجام دهیم." + +msgid "" +"Now that we've defined the method, we need to create an array of method " +"definitions::" +msgstr "" +"اکنون که متد را تعریف کرده‌ایم، باید آرایه‌ای از تعریف‌های متد ایجاد کنیم::" + +msgid "" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};" + +msgid "" +"(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " +"method is expecting no arguments other than *self*)" +msgstr "" +"(توجه کنید که از پرچم :c:macro:`METH_NOARGS` استفاده کردیم تا نشان دهیم که " +"متد به‌جز *self* هیچ آرگومانی انتظار ندارد)" + +msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" +msgstr "و آن را به جایگاه :c:member:`~PyTypeObject.tp_methods` اختصاص دهید::" + +msgid ".tp_methods = Custom_methods," +msgstr ".tp_methods = Custom_methods," + +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 about the type of the object being created or used, so all we " +"need to do is to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag " +"definition::" +msgstr "" +"در نهایت، نوع خود را طوری می‌سازیم که به‌عنوان کلاس پایه برای زیرکلاس‌گیری " +"قابل استفاده باشد. متدهای خود را تاکنون با دقت نوشته‌ایم تا هیچ فرضی درباره‌ی " +"نوع شیء در حال ایجاد یا استفاده نداشته باشند؛ بنابراین تنها کاری که باید " +"انجام دهیم این است که :c:macro:`Py_TPFLAGS_BASETYPE` را به تعریف پرچم کلاس " +"خود اضافه کنیم::" + +msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," +msgstr ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," + +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 "" +"نام :c:func:`!PyInit_custom` را به :c:func:`!PyInit_custom2` تغییر می‌دهیم، " +"نام ماژول را در ساختار :c:type:`PyModuleDef` به‌روزرسانی می‌کنیم و نام کامل " +"کلاس را در ساختار :c:type:`PyTypeObject` به‌روزرسانی می‌کنیم." + +msgid "" +"Finally, we update our :file:`setup.py` file to include the new module," +msgstr "" +"در نهایت، پرونده :file:`setup.py` خود را به‌روزرسانی می‌کنیم تا ماژول جدید را " +"در بر بگیرد،" + +msgid "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[\n" +" Extension(\"custom\", [\"custom.c\"]),\n" +" Extension(\"custom2\", [\"custom2.c\"]),\n" +"])" +msgstr "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[\n" +" Extension(\"custom\", [\"custom.c\"]),\n" +" Extension(\"custom2\", [\"custom2.c\"]),\n" +"])" + +msgid "and then we re-install so that we can ``import custom2``:" +msgstr "" +"و سپس آن را دوباره نصب می‌کنیم تا بتوانیم ``import custom2`` را اجرا کنیم:" + +msgid "Providing finer control over data attributes" +msgstr "فراهم کردن کنترل دقیق‌تر بر ویژگی‌های داده" + +msgid "" +"In this section, we'll provide finer control over how the :attr:`!first` " +"and :attr:`!last` attributes are set in the :class:`!Custom` example. In " +"the previous version of our module, the instance variables :attr:`!first` " +"and :attr:`!last` could be set to non-string values or even deleted. We " +"want to make sure that these attributes always contain strings." +msgstr "" +"در این بخش، کنترل دقیق‌تری بر نحوه‌ی تنظیم ویژگی‌های :attr:`!first` و :attr:`!" +"last` در مثال :class:`!Custom` ارائه خواهیم کرد. در نسخه‌ی قبلی ماژول ما، " +"متغیرهای نمونه‌ی :attr:`!first` و :attr:`!last` می‌توانستند به مقادیری غیر از " +"رشته تنظیم شوند یا حتی حذف شوند. می‌خواهیم مطمئن شویم که این ویژگی‌ها همیشه " +"حاوی رشته باشند." + +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", Custom_getfirst, Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", Custom_getlast, Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom3.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = Custom_init,\n" +" .tp_dealloc = Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static int\n" +"custom_module_exec(PyObject *m)\n" +"{\n" +" if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot custom_module_slots[] = {\n" +" {Py_mod_exec, custom_module_exec},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef custom_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom3\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = custom_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom3(void)\n" +"{\n" +" return PyModuleDef_Init(&custom_module);\n" +"}\n" +msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free(self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", Custom_getfirst, Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", Custom_getlast, Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom3.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = Custom_init,\n" +" .tp_dealloc = Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static int\n" +"custom_module_exec(PyObject *m)\n" +"{\n" +" if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot custom_module_slots[] = {\n" +" {Py_mod_exec, custom_module_exec},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef custom_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom3\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = custom_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom3(void)\n" +"{\n" +" return PyModuleDef_Init(&custom_module);\n" +"}\n" + +msgid "" +"To provide greater control, over the :attr:`!first` and :attr:`!last` " +"attributes, we'll use custom getter and setter functions. Here are the " +"functions for getting and setting the :attr:`!first` attribute::" +msgstr "" +"برای فراهم کردن کنترل بیشتر بر ویژگی‌های :attr:`!first` و :attr:`!last`، از " +"توابع سفارشی دریافت (getter) و تنظیم (setter) استفاده خواهیم کرد. در ادامه، " +"توابع دریافت و تنظیم ویژگی :attr:`!first` آمده‌اند::" + +msgid "" +"static PyObject *\n" +"Custom_getfirst(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_INCREF(self->first);\n" +" return self->first;\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" PyObject *tmp;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" tmp = self->first;\n" +" Py_INCREF(value);\n" +" self->first = value;\n" +" Py_DECREF(tmp);\n" +" return 0;\n" +"}" +msgstr "" +"static PyObject *\n" +"Custom_getfirst(PyObject *op, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_INCREF(self->first);\n" +" return self->first;\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" PyObject *tmp;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" tmp = self->first;\n" +" Py_INCREF(value);\n" +" self->first = value;\n" +" Py_DECREF(tmp);\n" +" return 0;\n" +"}" + +msgid "" +"The getter function is passed a :class:`!Custom` object and a \"closure\", " +"which is a void pointer. In this case, the closure is ignored. (The " +"closure supports an advanced usage in which definition data is passed to " +"the getter and setter. This could, for example, be used to allow a single " +"set of getter and setter functions that decide the attribute to get or set " +"based on data in the closure.)" +msgstr "" +"به تابع گیرنده (getter) یک شیء :class:`!Custom` و یک «بستار» که یک اشاره‌گر " +"void است، ارسال می‌شود. در این حالت، بستار نادیده گرفته می‌شود. (بستار از یک " +"کاربرد پیشرفته پشتیبانی می‌کند که در آن داده‌های تعریف به گیرنده و تنظیم‌کننده " +"(setter) ارسال می‌شود. این می‌تواند، برای مثال، برای این منظور استفاده شود که " +"تنها یک مجموعه از توابع گیرنده و تنظیم‌کننده داشته باشیم که بر اساس داده‌های " +"موجود در بستار تصمیم می‌گیرند کدام ویژگی را دریافت یا تنظیم کنند.)" + +msgid "" +"The setter function is passed the :class:`!Custom` object, the new value, " +"and the closure. The new value may be ``NULL``, in which case the " +"attribute is being deleted. In our setter, we raise an error if the " +"attribute is deleted or if its new value is not a string." +msgstr "" +"به تابع تنظیم‌کننده (setter)، شیء :class:`!Custom`، مقدار جدید و بستار پاس " +"داده می‌شود. مقدار جدید می‌تواند ``NULL`` باشد که در این صورت، ویژگی در حال " +"حذف شدن است. در تنظیم‌کننده‌ی ما، اگر ویژگی حذف شود یا مقدار جدید آن رشته " +"نباشد، خطایی مطرح می‌کنیم." + +msgid "We create an array of :c:type:`PyGetSetDef` structures::" +msgstr "ما آرایه‌ای از ساختار‌های :c:type:`PyGetSetDef` می‌سازیم::" + +msgid "" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", Custom_getfirst, Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", Custom_getlast, Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", Custom_getfirst, Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", Custom_getlast, Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};" + +msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" +msgstr "و آن را در جایگاه :c:member:`~PyTypeObject.tp_getset` ثبت کنید::" + +msgid ".tp_getset = Custom_getsetters," +msgstr ".tp_getset = Custom_getsetters," + +msgid "" +"The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " +"mentioned above. In this case, we aren't using a closure, so we just pass " +"``NULL``." +msgstr "" +"آخرین آیتم در ساختار :c:type:`PyGetSetDef` همان «بستار» است که در بالا ذکر " +"شد. در این حالت، ما از بستار استفاده نمی‌کنیم، بنابراین فقط ``NULL`` را " +"ارسال می‌کنیم." + +msgid "We also remove the member definitions for these attributes::" +msgstr "ما همچنین تعاریف اعضا را برای این ویژگی‌ها حذف می‌کنیم::" msgid "" -"static PyMethodDef Custom_methods[] = {\n" -" {\"name\", Custom_name, METH_NOARGS,\n" -" \"Return the name, combining the first and last name\"\n" -" },\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" " {NULL} /* Sentinel */\n" "};" msgstr "" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" -msgid "(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the method is expecting no arguments other than *self*)" +msgid "" +"We also need to update the :c:member:`~PyTypeObject.tp_init` handler to " +"only allow strings [#]_ to be passed::" msgstr "" +"همچنین باید هندلر :c:member:`~PyTypeObject.tp_init` را به‌روزرسانی کنیم تا " +"فقط رشته‌ها [#]_ به آن ارسال شوند::" -msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" +msgid "" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_DECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_DECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" msgstr "" +"static int\n" +"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_DECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_DECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" -msgid ".tp_methods = Custom_methods," -msgstr "" +msgid "" +"With these changes, we can assure that the ``first`` and ``last`` members " +"are never ``NULL`` so we can remove checks for ``NULL`` values in almost " +"all cases. This means that most of the :c:func:`Py_XDECREF` calls can be " +"converted to :c:func:`Py_DECREF` calls. The only place we can't change " +"these calls is in the ``tp_dealloc`` implementation, where there is the " +"possibility that the initialization of these members failed in ``tp_new``." +msgstr "" +"با این تغییرات، می‌توانیم اطمینان حاصل کنیم که اعضای ``first`` و ``last`` " +"هرگز ``NULL`` نیستند؛ بنابراین می‌توانیم بررسی‌های مربوط به مقادیر ``NULL`` " +"را در تقریباً همه‌ی موارد حذف کنیم. این بدان معناست که بیشتر " +"فراخوانی‌های :c:func:`Py_XDECREF` را می‌توان به " +"فراخوانی‌های :c:func:`Py_DECREF` تبدیل کرد. تنها جایی که نمی‌توانیم این " +"فراخوانی‌ها را تغییر دهیم، پیاده‌سازی ``tp_dealloc`` است، که در آن این احتمال " +"وجود دارد که مقداردهی اولیه‌ی این اعضا در ``tp_new`` شکست خورده باشد." -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 about the type of the object being created or used, so all we need to do is to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" +msgid "" +"We also rename the module initialization function and module name in the " +"initialization function, as we did before, and we add an extra definition " +"to the :file:`setup.py` file." msgstr "" +"ما همچنین، همان‌طور که پیش‌تر انجام دادیم، نام تابع مقداردهی اولیه‌ی ماژول و " +"نام ماژول در تابع مقداردهی اولیه را تغییر می‌دهیم و یک تعریف اضافی به " +"پرونده‌ی :file:`setup.py` می‌افزاییم." -msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," -msgstr "" +msgid "Supporting cyclic garbage collection" +msgstr "پشتیبانی از زباله‌روبی چرخه‌ای" -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." +msgid "" +"Python has a :term:`cyclic garbage collector (GC) ` " +"that can identify unneeded objects even when their reference counts are not " +"zero. This can happen when objects are involved in cycles. For example, " +"consider:" msgstr "" +"پایتون یک :term:`زباله‌روب چرخه‌ای (GC) ` دارد که می‌تواند " +"اشیاء غیرلازم را حتی زمانی که شمارش ارجاع آن‌ها صفر نیست، شناسایی کند. این " +"وضعیت می‌تواند هنگامی رخ دهد که اشیاء در چرخه‌ها درگیر باشند. برای مثال، در " +"نظر بگیرید:" -msgid "Finally, we update our :file:`setup.py` file to include the new module," +msgid "" +">>> l = []\n" +">>> l.append(l)\n" +">>> del l" msgstr "" +">>> l = []\n" +">>> l.append(l)\n" +">>> del l" msgid "" -"from setuptools import Extension, setup\n" -"setup(ext_modules=[\n" -" Extension(\"custom\", [\"custom.c\"]),\n" -" Extension(\"custom2\", [\"custom2.c\"]),\n" -"])" +"In this example, we create a list that contains itself. When we delete it, " +"it still has a reference from itself. Its reference count doesn't drop to " +"zero. Fortunately, Python's cyclic garbage collector will eventually figure " +"out that the list is garbage and free it." msgstr "" +"در این مثال، فهرستی ایجاد می‌کنیم که خودش را در بر می‌گیرد. وقتی آن را حذف " +"می‌کنیم، همچنان ارجاعی از خودش به آن وجود دارد. شمارش ارجاع آن به صفر " +"نمی‌رسد. خوشبختانه، زباله‌روب چرخه‌ای پایتون سرانجام درمی‌یابد که فهرست زباله " +"است و آن را آزاد می‌کند." -msgid "and then we re-install so that we can ``import custom2``:" -msgstr "" +msgid "" +"In the second version of the :class:`!Custom` example, we allowed any kind " +"of object to be stored in the :attr:`!first` or :attr:`!last` attributes " +"[#]_. Besides, in the second and third versions, we allowed " +"subclassing :class:`!Custom`, and subclasses may add arbitrary attributes. " +"For any of those two reasons, :class:`!Custom` objects can participate in " +"cycles:" +msgstr "" +"در نسخه‌ی دوم از مثال :class:`!Custom`، اجازه دادیم هر نوع شیء در " +"ویژگی‌های :attr:`!first` یا :attr:`!last` ذخیره شود [#]_. علاوه بر این، در " +"نسخه‌های دوم و سوم، اجازه دادیم که از :class:`!Custom` زیرکلاس‌سازی شود، و " +"زیرکلاس‌ها می‌توانند ویژگی‌های دلخواه اضافه کنند. به‌خاطر هر یک از این دو دلیل، " +"اشیای :class:`!Custom` می‌توانند در چرخه‌ها شرکت کنند:" -msgid "Providing finer control over data attributes" +msgid "" +">>> import custom3\n" +">>> class Derived(custom3.Custom): pass\n" +"...\n" +">>> n = Derived()\n" +">>> n.some_attribute = n" msgstr "" +">>> import custom3\n" +">>> class Derived(custom3.Custom): pass\n" +"...\n" +">>> n = Derived()\n" +">>> n.some_attribute = n" -msgid "In this section, we'll provide finer control over how the :attr:`!first` and :attr:`!last` attributes are set in the :class:`!Custom` example. In the previous version of our module, the instance variables :attr:`!first` and :attr:`!last` could be set to non-string values or even deleted. We want to make sure that these attributes always contain strings." +msgid "" +"To allow a :class:`!Custom` instance participating in a reference cycle to " +"be properly detected and collected by the cyclic GC, our :class:`!Custom` " +"type needs to fill two additional slots and to enable a flag that enables " +"these slots:" msgstr "" +"برای اینکه نمونه‌ای از :class:`!Custom` که در یک چرخه ارجاع درگیر است، " +"به‌درستی توسط GC چرخه‌ای تشخیص داده و جمع‌آوری شود، نوع :class:`!Custom` ما " +"باید دو جایگاه اضافی را پر کند و پرچمی را فعال کند که این جایگاه‌ها را فعال " +"می‌سازد:" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -731,13 +2239,30 @@ msgid "" " int number;\n" "} CustomObject;\n" "\n" +"static int\n" +"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}\n" +"\n" +"static int\n" +"Custom_clear(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}\n" +"\n" "static void\n" "Custom_dealloc(PyObject *op)\n" "{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free(self);\n" +" PyObject_GC_UnTrack(op);\n" +" (void)Custom_clear(op);\n" +" Py_TYPE(op)->tp_free(op);\n" "}\n" "\n" "static PyObject *\n" @@ -800,7 +2325,8 @@ msgid "" "{\n" " CustomObject *self = (CustomObject *) op;\n" " if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first attribute\");\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" " return -1;\n" " }\n" " if (!PyUnicode_Check(value)) {\n" @@ -808,7 +2334,7 @@ msgid "" " \"The first attribute value must be a string\");\n" " return -1;\n" " }\n" -" Py_SETREF(self->first, Py_NewRef(value));\n" +" Py_XSETREF(self->first, Py_NewRef(value));\n" " return 0;\n" "}\n" "\n" @@ -824,7 +2350,8 @@ msgid "" "{\n" " CustomObject *self = (CustomObject *) op;\n" " if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last attribute\");\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" " return -1;\n" " }\n" " if (!PyUnicode_Check(value)) {\n" @@ -832,7 +2359,7 @@ msgid "" " \"The last attribute value must be a string\");\n" " return -1;\n" " }\n" -" Py_SETREF(self->last, Py_NewRef(value));\n" +" Py_XSETREF(self->last, Py_NewRef(value));\n" " return 0;\n" "}\n" "\n" @@ -860,14 +2387,17 @@ msgid "" "\n" "static PyTypeObject CustomType = {\n" " .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom3.Custom\",\n" +" .tp_name = \"custom4.Custom\",\n" " .tp_doc = PyDoc_STR(\"Custom objects\"),\n" " .tp_basicsize = sizeof(CustomObject),\n" " .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | " +"Py_TPFLAGS_HAVE_GC,\n" " .tp_new = Custom_new,\n" " .tp_init = Custom_init,\n" " .tp_dealloc = Custom_dealloc,\n" +" .tp_traverse = Custom_traverse,\n" +" .tp_clear = Custom_clear,\n" " .tp_members = Custom_members,\n" " .tp_methods = Custom_methods,\n" " .tp_getset = Custom_getsetters,\n" @@ -875,180 +2405,40 @@ msgid "" "\n" "static int\n" "custom_module_exec(PyObject *m)\n" -"{\n" -" if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot custom_module_slots[] = {\n" -" {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef custom_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"custom3\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = custom_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_custom3(void)\n" -"{\n" -" return PyModuleDef_Init(&custom_module);\n" -"}\n" -msgstr "" - -msgid "To provide greater control, over the :attr:`!first` and :attr:`!last` attributes, we'll use custom getter and setter functions. Here are the functions for getting and setting the :attr:`!first` attribute::" -msgstr "" - -msgid "" -"static PyObject *\n" -"Custom_getfirst(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_INCREF(self->first);\n" -" return self->first;\n" -"}\n" -"\n" -"static int\n" -"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" PyObject *tmp;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The first attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" tmp = self->first;\n" -" Py_INCREF(value);\n" -" self->first = value;\n" -" Py_DECREF(tmp);\n" -" return 0;\n" -"}" -msgstr "" - -msgid "The getter function is passed a :class:`!Custom` object and a \"closure\", which is a void pointer. In this case, the closure is ignored. (The closure supports an advanced usage in which definition data is passed to the getter and setter. This could, for example, be used to allow a single set of getter and setter functions that decide the attribute to get or set based on data in the closure.)" -msgstr "" - -msgid "The setter function is passed the :class:`!Custom` object, the new value, and the closure. The new value may be ``NULL``, in which case the attribute is being deleted. In our setter, we raise an error if the attribute is deleted or if its new value is not a string." -msgstr "" - -msgid "We create an array of :c:type:`PyGetSetDef` structures::" -msgstr "" - -msgid "" -"static PyGetSetDef Custom_getsetters[] = {\n" -" {\"first\", Custom_getfirst, Custom_setfirst,\n" -" \"first name\", NULL},\n" -" {\"last\", Custom_getlast, Custom_setlast,\n" -" \"last name\", NULL},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" -msgstr "" - -msgid ".tp_getset = Custom_getsetters," -msgstr "" - -msgid "The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" mentioned above. In this case, we aren't using a closure, so we just pass ``NULL``." -msgstr "" - -msgid "We also remove the member definitions for these attributes::" -msgstr "" - -msgid "" -"static PyMemberDef Custom_members[] = {\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -msgid "We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only allow strings [#]_ to be passed::" -msgstr "" - -msgid "" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL, *tmp;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" tmp = self->first;\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -" Py_DECREF(tmp);\n" +"{\n" +" if (PyType_Ready(&CustomType) < 0) {\n" +" return -1;\n" " }\n" -" if (last) {\n" -" tmp = self->last;\n" -" Py_INCREF(last);\n" -" self->last = last;\n" -" Py_DECREF(tmp);\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" return -1;\n" " }\n" +"\n" " return 0;\n" -"}" -msgstr "" - -msgid "With these changes, we can assure that the ``first`` and ``last`` members are never ``NULL`` so we can remove checks for ``NULL`` values in almost all cases. This means that most of the :c:func:`Py_XDECREF` calls can be converted to :c:func:`Py_DECREF` calls. The only place we can't change these calls is in the ``tp_dealloc`` implementation, where there is the possibility that the initialization of these members failed in ``tp_new``." -msgstr "" - -msgid "We also rename the module initialization function and module name in the initialization function, as we did before, and we add an extra definition to the :file:`setup.py` file." -msgstr "" - -msgid "Supporting cyclic garbage collection" -msgstr "" - -msgid "Python has a :term:`cyclic garbage collector (GC) ` that can identify unneeded objects even when their reference counts are not zero. This can happen when objects are involved in cycles. For example, consider:" -msgstr "" - -msgid "" -">>> l = []\n" -">>> l.append(l)\n" -">>> del l" -msgstr "" - -msgid "In this example, we create a list that contains itself. When we delete it, it still has a reference from itself. Its reference count doesn't drop to zero. Fortunately, Python's cyclic garbage collector will eventually figure out that the list is garbage and free it." -msgstr "" - -msgid "In the second version of the :class:`!Custom` example, we allowed any kind of object to be stored in the :attr:`!first` or :attr:`!last` attributes [#]_. Besides, in the second and third versions, we allowed subclassing :class:`!Custom`, and subclasses may add arbitrary attributes. For any of those two reasons, :class:`!Custom` objects can participate in cycles:" -msgstr "" - -msgid "" -">>> import custom3\n" -">>> class Derived(custom3.Custom): pass\n" -"...\n" -">>> n = Derived()\n" -">>> n.some_attribute = n" -msgstr "" - -msgid "To allow a :class:`!Custom` instance participating in a reference cycle to be properly detected and collected by the cyclic GC, our :class:`!Custom` type needs to fill two additional slots and to enable a flag that enables these slots:" +"}\n" +"\n" +"static PyModuleDef_Slot custom_module_slots[] = {\n" +" {Py_mod_exec, custom_module_exec},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef custom_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom4\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = custom_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom4(void)\n" +"{\n" +" return PyModuleDef_Init(&custom_module);\n" +"}\n" msgstr "" - -msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" "#include /* for offsetof() */\n" @@ -1146,7 +2536,8 @@ msgid "" "{\n" " CustomObject *self = (CustomObject *) op;\n" " if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first attribute\");\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" " return -1;\n" " }\n" " if (!PyUnicode_Check(value)) {\n" @@ -1170,7 +2561,8 @@ msgid "" "{\n" " CustomObject *self = (CustomObject *) op;\n" " if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last attribute\");\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" " return -1;\n" " }\n" " if (!PyUnicode_Check(value)) {\n" @@ -1210,7 +2602,8 @@ msgid "" " .tp_doc = PyDoc_STR(\"Custom objects\"),\n" " .tp_basicsize = sizeof(CustomObject),\n" " .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | " +"Py_TPFLAGS_HAVE_GC,\n" " .tp_new = Custom_new,\n" " .tp_init = Custom_init,\n" " .tp_dealloc = Custom_dealloc,\n" @@ -1228,7 +2621,8 @@ msgid "" " return -1;\n" " }\n" "\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" " return -1;\n" " }\n" "\n" @@ -1237,7 +2631,8 @@ msgid "" "\n" "static PyModuleDef_Slot custom_module_slots[] = {\n" " {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" " {0, NULL}\n" "};\n" "\n" @@ -1254,10 +2649,13 @@ msgid "" "{\n" " return PyModuleDef_Init(&custom_module);\n" "}\n" -msgstr "" -msgid "First, the traversal method lets the cyclic GC know about subobjects that could participate in cycles::" +msgid "" +"First, the traversal method lets the cyclic GC know about subobjects that " +"could participate in cycles::" msgstr "" +"نخست، متد پیمایش به زباله‌روب چرخه‌ای اطلاع می‌دهد که کدام زیرشیءها ممکن است " +"در چرخه‌ها شرکت کنند::" msgid "" "static int\n" @@ -1278,12 +2676,45 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" int vret;\n" +" if (self->first) {\n" +" vret = visit(self->first, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" if (self->last) {\n" +" vret = visit(self->last, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" return 0;\n" +"}" -msgid "For each subobject that can participate in cycles, we need to call the :c:func:`!visit` function, which is passed to the traversal method. The :c:func:`!visit` function takes as arguments the subobject and the extra argument *arg* passed to the traversal method. It returns an integer value that must be returned if it is non-zero." -msgstr "" +msgid "" +"For each subobject that can participate in cycles, we need to call " +"the :c:func:`!visit` function, which is passed to the traversal method. " +"The :c:func:`!visit` function takes as arguments the subobject and the " +"extra argument *arg* passed to the traversal method. It returns an integer " +"value that must be returned if it is non-zero." +msgstr "" +"برای هر زیرشیء‌ای که می‌تواند در چرخه‌ها شرکت کند، باید تابع :c:func:`!visit` " +"را که به متد پیمایش پاس داده می‌شود، فراخوانی کنیم. تابع :c:func:`!visit` " +"زیرشیء و آرگومان اضافی *arg* را که به متد پیمایش پاس داده شده است، به‌عنوان " +"آرگومان می‌گیرد. این تابع یک مقدار عدد صحیح برمی‌گرداند که اگر غیرصفر باشد، " +"باید بازگردانده شود." -msgid "Python provides a :c:func:`Py_VISIT` macro that automates calling visit functions. With :c:func:`Py_VISIT`, we can minimize the amount of boilerplate in ``Custom_traverse``::" +msgid "" +"Python provides a :c:func:`Py_VISIT` macro that automates calling visit " +"functions. With :c:func:`Py_VISIT`, we can minimize the amount of " +"boilerplate in ``Custom_traverse``::" msgstr "" +"پایتون یک ماکروی :c:func:`Py_VISIT` فراهم می‌کند که فراخوانی توابع بازدید " +"(visit) را خودکار می‌کند. با :c:func:`Py_VISIT`، می‌توانیم میزان کد پیش‌ساخته " +"در ``Custom_traverse`` را به حداقل برسانیم::" msgid "" "static int\n" @@ -1295,12 +2726,29 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}" -msgid "The :c:member:`~PyTypeObject.tp_traverse` implementation must name its arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." +msgid "" +"The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " +"arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." msgstr "" +"پیاده‌سازی :c:member:`~PyTypeObject.tp_traverse` باید آرگومان‌های خود را " +"دقیقاً *visit* و *arg* نام‌گذاری کند تا بتواند از :c:func:`Py_VISIT` استفاده " +"کند." -msgid "Second, we need to provide a method for clearing any subobjects that can participate in cycles::" +msgid "" +"Second, we need to provide a method for clearing any subobjects that can " +"participate in cycles::" msgstr "" +"دوم، باید متدی برای پاک کردن هر زیرشیئی که می‌تواند در چرخه‌ها شرکت کند ارائه " +"دهیم::" msgid "" "static int\n" @@ -1312,12 +2760,32 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"Custom_clear(PyObject *op)\n" +"{\n" +" CustomObject *self = (CustomObject *) op;\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}" -msgid "Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and safe way to clear data attributes of arbitrary types while decrementing their reference counts. If you were to call :c:func:`Py_XDECREF` instead on the attribute before setting it to ``NULL``, there is a possibility that the attribute's destructor would call back into code that reads the attribute again (*especially* if there is a reference cycle)." -msgstr "" +msgid "" +"Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " +"safe way to clear data attributes of arbitrary types while decrementing " +"their reference counts. If you were to call :c:func:`Py_XDECREF` instead " +"on the attribute before setting it to ``NULL``, there is a possibility that " +"the attribute's destructor would call back into code that reads the " +"attribute again (*especially* if there is a reference cycle)." +msgstr "" +"به استفاده از ماکرو :c:func:`Py_CLEAR` توجه کنید. این روش توصیه‌شده و امن " +"برای پاک‌سازی ویژگی‌های داده‌ی نوع‌های دلخواه، همزمان با کاهش شمارش ارجاع " +"آن‌هاست. اگر به‌جای آن، پیش از تنظیم ویژگی به ``NULL``، :c:func:`Py_XDECREF` " +"را روی ویژگی فراخوانی کنید، این امکان وجود دارد که مخربِ ویژگی، فراخوانی " +"بازگشتی به کدی انجام دهد که دوباره ویژگی را می‌خواند (*به‌ویژه* اگر یک چرخه " +"ارجاع وجود داشته باشد)." msgid "You could emulate :c:func:`Py_CLEAR` by writing::" -msgstr "" +msgstr "می‌توانید :c:func:`Py_CLEAR` را با نوشتنِ کد زیر شبیه‌سازی کنید::" msgid "" "PyObject *tmp;\n" @@ -1325,12 +2793,33 @@ msgid "" "self->first = NULL;\n" "Py_XDECREF(tmp);" msgstr "" +"PyObject *tmp;\n" +"tmp = self->first;\n" +"self->first = NULL;\n" +"Py_XDECREF(tmp);" -msgid "Nevertheless, it is much easier and less error-prone to always use :c:func:`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the expense of robustness!" +msgid "" +"Nevertheless, it is much easier and less error-prone to always " +"use :c:func:`Py_CLEAR` when deleting an attribute. Don't try to micro-" +"optimize at the expense of robustness!" msgstr "" +"با این حال، همیشه استفاده از :c:func:`Py_CLEAR` هنگام حذف یک ویژگی بسیار " +"آسان‌تر و کمتر مستعد خطاست. سعی نکنید به قیمت استحکام، ریزبهینه‌سازی کنید!" -msgid "The deallocator ``Custom_dealloc`` may call arbitrary code when clearing attributes. It means the circular GC can be triggered inside the function. Since the GC assumes reference count is not zero, we need to untrack the object from the GC by calling :c:func:`PyObject_GC_UnTrack` before clearing members. Here is our reimplemented deallocator using :c:func:`PyObject_GC_UnTrack` and ``Custom_clear``::" -msgstr "" +msgid "" +"The deallocator ``Custom_dealloc`` may call arbitrary code when clearing " +"attributes. It means the circular GC can be triggered inside the function. " +"Since the GC assumes reference count is not zero, we need to untrack the " +"object from the GC by calling :c:func:`PyObject_GC_UnTrack` before clearing " +"members. Here is our reimplemented deallocator " +"using :c:func:`PyObject_GC_UnTrack` and ``Custom_clear``::" +msgstr "" +"آزادکننده (deallocator) ``Custom_dealloc`` ممکن است هنگام پاک کردن ویژگی‌ها " +"کد دلخواهی فراخوانی کند. این بدان معناست که GC چرخه‌ای می‌تواند درون تابع " +"فعال شود. از آنجا که GC فرض می‌کند شمارش ارجاع صفر نیست، باید پیش از پاک " +"کردن اعضا، شیء را با فراخوانی :c:func:`PyObject_GC_UnTrack` از ردیابی GC " +"خارج کنیم. در ادامه، آزادکننده‌ی بازپیاده‌سازی‌شده‌ی ما را که " +"از :c:func:`PyObject_GC_UnTrack` و ``Custom_clear`` استفاده می‌کند، می‌بینید::" msgid "" "static void\n" @@ -1341,24 +2830,62 @@ msgid "" " Py_TYPE(op)->tp_free(op);\n" "}" msgstr "" +"static void\n" +"Custom_dealloc(PyObject *op)\n" +"{\n" +" PyObject_GC_UnTrack(op);\n" +" (void)Custom_clear(op);\n" +" Py_TYPE(op)->tp_free(op);\n" +"}" -msgid "Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" +msgid "" +"Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" +"در نهایت، پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` را به پرچم‌های کلاس اضافه " +"می‌کنیم::" -msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," +msgid "" +".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," msgstr "" +".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," -msgid "That's pretty much it. If we had written custom :c:member:`~PyTypeObject.tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify them for cyclic garbage collection. Most extensions will use the versions automatically provided." -msgstr "" +msgid "" +"That's pretty much it. If we had written " +"custom :c:member:`~PyTypeObject.tp_alloc` " +"or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify them for " +"cyclic garbage collection. Most extensions will use the versions " +"automatically provided." +msgstr "" +"همه‌چیز تقریباً همین است. اگر هندلرهای " +"سفارشی :c:member:`~PyTypeObject.tp_alloc` " +"یا :c:member:`~PyTypeObject.tp_free` نوشته بودیم، باید آن‌ها را برای " +"زباله‌روبی چرخه‌ای تغییر می‌دادیم. بیشتر ماژول‌های توسعه‌ای از نسخه‌هایی که به‌طور " +"خودکار ارائه می‌شوند استفاده خواهند کرد." msgid "Subclassing other types" -msgstr "" +msgstr "زیرکلاس‌سازی نوع‌های دیگر" -msgid "It is possible to create new extension types that are derived from existing types. It is easiest to inherit from the built in types, since an extension can easily use the :c:type:`PyTypeObject` it needs. It can be difficult to share these :c:type:`PyTypeObject` structures between extension modules." +msgid "" +"It is possible to create new extension types that are derived from existing " +"types. It is easiest to inherit from the built in types, since an extension " +"can easily use the :c:type:`PyTypeObject` it needs. It can be difficult to " +"share these :c:type:`PyTypeObject` structures between extension modules." msgstr "" +"می‌توان نوع‌های توسعه‌ای جدیدی ایجاد کرد که از نوع‌های موجود مشتق شده‌اند. " +"ساده‌ترین کار، ارث‌بری از نوع‌های توکار است، زیرا یک توسعه می‌تواند به‌سادگی " +"از :c:type:`PyTypeObject` مورد نیاز خود استفاده کند. اشتراک‌گذاری این " +"ساختارهای :c:type:`PyTypeObject` بین ماژول‌های توسعه‌ای می‌تواند دشوار باشد." -msgid "In this example we will create a :class:`!SubList` type that inherits from the built-in :class:`list` type. The new type will be completely compatible with regular lists, but will have an additional :meth:`!increment` method that increases an internal counter:" +msgid "" +"In this example we will create a :class:`!SubList` type that inherits from " +"the built-in :class:`list` type. The new type will be completely compatible " +"with regular lists, but will have an additional :meth:`!increment` method " +"that increases an internal counter:" msgstr "" +"در این مثال یک نوع :class:`!SubList` ایجاد می‌کنیم که از نوع " +"توکار :class:`list` ارث‌بری می‌کند. نوع جدید کاملاً با فهرست‌های معمولی سازگار " +"خواهد بود، اما یک متد اضافی :meth:`!increment` خواهد داشت که یک شمارنده " +"داخلی را افزایش می‌دهد:" msgid "" ">>> import sublist\n" @@ -1371,6 +2898,15 @@ msgid "" ">>> print(s.increment())\n" "2" msgstr "" +">>> import sublist\n" +">>> s = sublist.SubList(range(3))\n" +">>> s.extend(s)\n" +">>> print(len(s))\n" +"6\n" +">>> print(s.increment())\n" +"1\n" +">>> print(s.increment())\n" +"2" msgid "" "#define PY_SSIZE_T_CLEAN\n" @@ -1424,7 +2960,8 @@ msgid "" " return -1;\n" " }\n" "\n" -" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < 0) {\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" " return -1;\n" " }\n" "\n" @@ -1433,7 +2970,8 @@ msgid "" "\n" "static PyModuleDef_Slot sublist_module_slots[] = {\n" " {Py_mod_exec, sublist_module_exec},\n" -" {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" " {0, NULL}\n" "};\n" "\n" @@ -1451,9 +2989,93 @@ msgid "" " return PyModuleDef_Init(&sublist_module);\n" "}\n" msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;\n" +"\n" +"static PyObject *\n" +"SubList_increment(PyObject *op, PyObject *Py_UNUSED(dummy))\n" +"{\n" +" SubListObject *self = (SubListObject *) op;\n" +" self->state++;\n" +" return PyLong_FromLong(self->state);\n" +"}\n" +"\n" +"static PyMethodDef SubList_methods[] = {\n" +" {\"increment\", SubList_increment, METH_NOARGS,\n" +" PyDoc_STR(\"increment state counter\")},\n" +" {NULL},\n" +"};\n" +"\n" +"static int\n" +"SubList_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" SubListObject *self = (SubListObject *) op;\n" +" if (PyList_Type.tp_init(op, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}\n" +"\n" +"static PyTypeObject SubListType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"sublist.SubList\",\n" +" .tp_doc = PyDoc_STR(\"SubList objects\"),\n" +" .tp_basicsize = sizeof(SubListObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_init = SubList_init,\n" +" .tp_methods = SubList_methods,\n" +"};\n" +"\n" +"static int\n" +"sublist_module_exec(PyObject *m)\n" +"{\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}\n" +"\n" +"static PyModuleDef_Slot sublist_module_slots[] = {\n" +" {Py_mod_exec, sublist_module_exec},\n" +" {Py_mod_multiple_interpreters, " +"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" +" {0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef sublist_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"sublist\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = 0,\n" +" .m_slots = sublist_module_slots,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_sublist(void)\n" +"{\n" +" return PyModuleDef_Init(&sublist_module);\n" +"}\n" -msgid "As you can see, the source code closely resembles the :class:`!Custom` examples in previous sections. We will break down the main differences between them. ::" +msgid "" +"As you can see, the source code closely resembles the :class:`!Custom` " +"examples in previous sections. We will break down the main differences " +"between them. ::" msgstr "" +"همان‌طور که می‌بینید، کد منبع شباهت بسیار زیادی به مثال‌های :class:`!Custom` " +"در بخش‌های قبلی دارد. تفاوت‌های اصلی میان آن‌ها را به‌تفصیل بررسی خواهیم کرد. ::" msgid "" "typedef struct {\n" @@ -1461,12 +3083,28 @@ msgid "" " int state;\n" "} SubListObject;" msgstr "" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;" -msgid "The primary difference for derived type objects is that the base type's object structure must be the first value. The base type will already include the :c:func:`PyObject_HEAD` at the beginning of its structure." +msgid "" +"The primary difference for derived type objects is that the base type's " +"object structure must be the first value. The base type will already " +"include the :c:func:`PyObject_HEAD` at the beginning of its structure." msgstr "" +"تفاوت اصلی برای اشیاء نوع مشتق‌شده این است که ساختار شیء نوع پایه باید " +"نخستین مقدار باشد. نوع پایه از قبل :c:func:`PyObject_HEAD` را در ابتدای " +"ساختار خود در بر دارد." -msgid "When a Python object is a :class:`!SubList` instance, its ``PyObject *`` pointer can be safely cast to both ``PyListObject *`` and ``SubListObject *``::" +msgid "" +"When a Python object is a :class:`!SubList` instance, its ``PyObject *`` " +"pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " +"*``::" msgstr "" +"وقتی یک شیء پایتون نمونه‌ای از :class:`!SubList` باشد، می‌توان اشاره‌گر " +"``PyObject *`` آن را به‌طور ایمن به هر دو ``PyListObject *`` و " +"``SubListObject *`` قالب‌ریزی کرد::" msgid "" "static int\n" @@ -1479,15 +3117,50 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int\n" +"SubList_init(PyObject *op, PyObject *args, PyObject *kwds)\n" +"{\n" +" SubListObject *self = (SubListObject *) op;\n" +" if (PyList_Type.tp_init(op, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}" -msgid "We see above how to call through to the :meth:`~object.__init__` method of the base type." +msgid "" +"We see above how to call through to the :meth:`~object.__init__` method of " +"the base type." msgstr "" +"در بالا می‌بینیم که چگونه می‌توان فراخوانی را به متد :meth:`~object.__init__` " +"نوع پایه منتقل کرد." -msgid "This pattern is important when writing a type with custom :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. The :c:member:`~PyTypeObject.tp_new` handler should not actually create the memory for the object with its :c:member:`~PyTypeObject.tp_alloc`, but let the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`." -msgstr "" +msgid "" +"This pattern is important when writing a type with " +"custom :c:member:`~PyTypeObject.tp_new` " +"and :c:member:`~PyTypeObject.tp_dealloc` members. " +"The :c:member:`~PyTypeObject.tp_new` handler should not actually create the " +"memory for the object with its :c:member:`~PyTypeObject.tp_alloc`, but let " +"the base class handle it by calling its " +"own :c:member:`~PyTypeObject.tp_new`." +msgstr "" +"این الگو هنگام نوشتن نوعی با اعضای سفارشی :c:member:`~PyTypeObject.tp_new` " +"و :c:member:`~PyTypeObject.tp_dealloc` اهمیت دارد. " +"هندلر :c:member:`~PyTypeObject.tp_new` نباید در واقع حافظه‌ی شیء را " +"با :c:member:`~PyTypeObject.tp_alloc` خود ایجاد کند، بلکه باید بگذارد کلاس " +"پایه آن را با فراخوانی :c:member:`~PyTypeObject.tp_new` خودش مدیریت کند." -msgid "The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject.tp_base` specifying the type's concrete base class. Due to cross-platform compiler issues, you can't fill that field directly with a reference to :c:type:`PyList_Type`; it should be done in the :c:data:`Py_mod_exec` function::" -msgstr "" +msgid "" +"The :c:type:`PyTypeObject` struct supports " +"a :c:member:`~PyTypeObject.tp_base` specifying the type's concrete base " +"class. Due to cross-platform compiler issues, you can't fill that field " +"directly with a reference to :c:type:`PyList_Type`; it should be done in " +"the :c:data:`Py_mod_exec` function::" +msgstr "" +"ساختار :c:type:`PyTypeObject` از :c:member:`~PyTypeObject.tp_base` پشتیبانی " +"می‌کند که کلاس پایه‌ی عینی نوع را مشخص می‌کند. به دلیل مشکلات کامپایلر در " +"سکوهای مختلف، نمی‌توانید آن فیلد را مستقیماً با ارجاعی " +"به :c:type:`PyList_Type` پر کنید؛ این کار باید در " +"تابع :c:data:`Py_mod_exec` انجام شود::" msgid "" "static int\n" @@ -1498,31 +3171,86 @@ msgid "" " return -1;\n" " }\n" "\n" -" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < 0) {\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" " return -1;\n" " }\n" "\n" " return 0;\n" "}" msgstr "" +"static int\n" +"sublist_module_exec(PyObject *m)\n" +"{\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0) {\n" +" return -1;\n" +" }\n" +"\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" +" return -1;\n" +" }\n" +"\n" +" return 0;\n" +"}" -msgid "Before calling :c:func:`PyType_Ready`, the type structure must have the :c:member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an existing type, it is not necessary to fill out the :c:member:`~PyTypeObject.tp_alloc` slot with :c:func:`PyType_GenericNew` -- the allocation function from the base type will be inherited." -msgstr "" +msgid "" +"Before calling :c:func:`PyType_Ready`, the type structure must have " +"the :c:member:`~PyTypeObject.tp_base` slot filled in. When we are deriving " +"an existing type, it is not necessary to fill out " +"the :c:member:`~PyTypeObject.tp_alloc` slot " +"with :c:func:`PyType_GenericNew` -- the allocation function from the base " +"type will be inherited." +msgstr "" +"پیش از فراخوانی :c:func:`PyType_Ready`، " +"جایگاه :c:member:`~PyTypeObject.tp_base` باید در ساختار نوع پر شده باشد. " +"هنگامی که از یک نوع موجود مشتق می‌گیریم، لازم نیست " +"جایگاه :c:member:`~PyTypeObject.tp_alloc` با :c:func:`PyType_GenericNew` پر " +"شود -- تابع تخصیص از نوع پایه به ارث می‌رسد." -msgid "After that, calling :c:func:`PyType_Ready` and adding the type object to the module is the same as with the basic :class:`!Custom` examples." +msgid "" +"After that, calling :c:func:`PyType_Ready` and adding the type object to " +"the module is the same as with the basic :class:`!Custom` examples." msgstr "" +"پس از آن، فراخوانی :c:func:`PyType_Ready` و افزودن شیء نوع به ماژول، همانند " +"مثال‌های پایه‌ی :class:`!Custom` است." msgid "Footnotes" -msgstr "" +msgstr "پانوشت‌ها" -msgid "This is true when we know that the object is a basic type, like a string or a float." +msgid "" +"This is true when we know that the object is a basic type, like a string or " +"a float." msgstr "" +"این هنگامی صادق است که بدانیم شیء یک نوع پایه‌ای است، مانند رشته یا اعشاری." -msgid "We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in this example, because our type doesn't support garbage collection." +msgid "" +"We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in " +"this example, because our type doesn't support garbage collection." msgstr "" +"در این مثال، ما در هندلر :c:member:`~PyTypeObject.tp_dealloc` به این موضوع " +"تکیه کردیم، زیرا نوع ما از زباله‌روبی پشتیبانی نمی‌کند." -msgid "We now know that the first and last members are strings, so perhaps we could be less careful about decrementing their reference counts, however, we accept instances of string subclasses. Even though deallocating normal strings won't call back into our objects, we can't guarantee that deallocating an instance of a string subclass won't call back into our objects." -msgstr "" +msgid "" +"We now know that the first and last members are strings, so perhaps we " +"could be less careful about decrementing their reference counts, however, " +"we accept instances of string subclasses. Even though deallocating normal " +"strings won't call back into our objects, we can't guarantee that " +"deallocating an instance of a string subclass won't call back into our " +"objects." +msgstr "" +"اکنون می‌دانیم که اعضای اول و آخر رشته‌اند، بنابراین شاید می‌توانستیم در کاهش " +"شمارش ارجاع آن‌ها احتیاط کمتری به خرج دهیم؛ اما ما نمونه‌هایی از زیرکلاس‌های " +"رشته را می‌پذیریم. هرچند آزاد کردن رشته‌های معمولی فراخوانی بازگشتی به اشیاء " +"ما انجام نمی‌دهد، نمی‌توانیم تضمین کنیم که آزاد کردن نمونه‌ای از زیرکلاس رشته، " +"فراخوانی بازگشتی به اشیاء ما انجام ندهد." -msgid "Also, even with our attributes restricted to strings instances, the user could pass arbitrary :class:`str` subclasses and therefore still create reference cycles." +msgid "" +"Also, even with our attributes restricted to strings instances, the user " +"could pass arbitrary :class:`str` subclasses and therefore still create " +"reference cycles." msgstr "" +"همچنین، حتی با محدود بودن ویژگی‌های ما به نمونه‌های رشته، کاربر می‌تواند هر " +"زیرکلاس دلخواهی از :class:`str` را ارسال کند و بنابراین همچنان چرخه‌های " +"ارجاع ایجاد کند." diff --git a/extending/windows.po b/extending/windows.po index ce5389ecb..63d5303ef 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -22,89 +22,295 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Building C and C++ Extensions on Windows" -msgstr "" +msgstr "ساخت ماژول‌های توسعه‌ای C و ++C در ویندوز" -msgid "This chapter briefly explains how to create a Windows extension module for Python using Microsoft Visual C++, and follows with more detailed background information on how it works. The explanatory material is useful for both the Windows programmer learning to build Python extensions and the Unix programmer interested in producing software which can be successfully built on both Unix and Windows." +msgid "" +"This chapter briefly explains how to create a Windows extension module for " +"Python using Microsoft Visual C++, and follows with more detailed background" +" information on how it works. The explanatory material is useful for both " +"the Windows programmer learning to build Python extensions and the Unix " +"programmer interested in producing software which can be successfully built " +"on both Unix and Windows." msgstr "" +"این فصل به‌طور خلاصه توضیح می‌دهد که چگونه می‌توان با استفاده از Microsoft " +"Visual C++ یک ماژول توسعه‌ای ویندوزی برای پایتون ایجاد کرد، و سپس با اطلاعات" +" پس‌زمینه‌ی دقیق‌تری درباره‌ی نحوه‌ی کارکرد آن ادامه می‌یابد. این مطالب " +"توضیحی هم برای برنامه‌نویس ویندوزی که در حال یادگیری ساخت توسعه‌های پایتون " +"است و هم برای برنامه‌نویس یونیکسی که علاقه‌مند به تولید نرم‌افزاری است که " +"می‌توان آن را با موفقیت هم روی یونیکس و هم روی ویندوز ساخت، مفید است." -msgid "Module authors are encouraged to use the distutils approach for building extension modules, instead of the one described in this section. You will still need the C compiler that was used to build Python; typically Microsoft Visual C++." +msgid "" +"Module authors are encouraged to use the distutils approach for building " +"extension modules, instead of the one described in this section. You will " +"still need the C compiler that was used to build Python; typically Microsoft" +" Visual C++." msgstr "" +"به نویسندگان ماژول‌ها توصیه می‌شود که برای ساخت ماژول‌های توسعه‌ای، به‌جای " +"روش توصیف‌شده در این بخش، از رویکرد distutils استفاده کنند. شما همچنان به " +"همان کامپایلر C که برای ساخت پایتون استفاده شده است نیاز خواهید داشت؛ که " +"معمولاً Microsoft Visual C++ است." -msgid "This chapter mentions a number of filenames that include an encoded Python version number. These filenames are represented with the version number shown as ``XY``; in practice, ``'X'`` will be the major version number and ``'Y'`` will be the minor version number of the Python release you're working with. For example, if you are using Python 2.2.1, ``XY`` will actually be ``22``." +msgid "" +"This chapter mentions a number of filenames that include an encoded Python " +"version number. These filenames are represented with the version number " +"shown as ``XY``; in practice, ``'X'`` will be the major version number and " +"``'Y'`` will be the minor version number of the Python release you're " +"working with. For example, if you are using Python 2.2.1, ``XY`` will " +"actually be ``22``." msgstr "" +"این فصل به تعدادی از نام‌های پرونده اشاره می‌کند که شامل شماره‌ی نسخه‌ی " +"کدگذاری‌شده‌ی پایتون هستند. این نام‌های پرونده با شماره‌ی نسخه‌ای که به‌صورت" +" ``XY`` نمایش داده شده بازنمایی می‌شوند؛ در عمل، ``'X'`` شماره‌ی نسخه‌ی اصلی" +" و ``'Y'`` شماره‌ی نسخه‌ی فرعی انتشار پایتونی است که با آن کار می‌کنید. برای" +" مثال، اگر از پایتون 2.2.1 استفاده می‌کنید، ``XY`` در واقع ``22`` خواهد بود." msgid "A Cookbook Approach" -msgstr "" +msgstr "رویکرد کتاب آشپزی" -msgid "There are two approaches to building extension modules on Windows, just as there are on Unix: use the ``setuptools`` package to control the build process, or do things manually. The setuptools approach works well for most extensions; documentation on using ``setuptools`` to build and package extension modules is available in :ref:`setuptools-index`. If you find you really need to do things manually, it may be instructive to study the project file for the :source:`winsound ` standard library module." +msgid "" +"There are two approaches to building extension modules on Windows, just as " +"there are on Unix: use the ``setuptools`` package to control the build " +"process, or do things manually. The setuptools approach works well for most" +" extensions; documentation on using ``setuptools`` to build and package " +"extension modules is available in :ref:`setuptools-index`. If you find you " +"really need to do things manually, it may be instructive to study the " +"project file for the :source:`winsound ` standard " +"library module." msgstr "" +"همان‌طور که در یونیکس، در ویندوز نیز دو رویکرد برای ساخت ماژول‌های توسعه‌ای " +"وجود دارد: استفاده از بسته‌ی ``setuptools`` برای کنترل فرایند ساخت، یا انجام" +" کارها به‌صورت دستی. رویکرد setuptools برای بیشتر ماژول‌های توسعه‌ای به‌خوبی" +" کار می‌کند؛ مستندات مربوط به استفاده از ``setuptools`` برای ساخت و " +"بسته‌بندی ماژول‌های توسعه‌ای در :ref:`setuptools-index` در دسترس است. اگر " +"دریافتید که واقعاً باید کارها را به‌صورت دستی انجام دهید، مطالعه‌ی پرونده‌ی " +"پروژه‌ی ماژول :source:`winsound ` از کتابخانه " +"استاندارد می‌تواند آموزنده باشد." msgid "Differences Between Unix and Windows" -msgstr "" +msgstr "تفاوت‌های بین Unix و Windows" -msgid "Unix and Windows use completely different paradigms for run-time loading of code. Before you try to build a module that can be dynamically loaded, be aware of how your system works." +msgid "" +"Unix and Windows use completely different paradigms for run-time loading of " +"code. Before you try to build a module that can be dynamically loaded, be " +"aware of how your system works." msgstr "" +"یونیکس و ویندوز از پارادایم‌های کاملاً متفاوتی برای بارگذاری کد در زمان اجرا" +" استفاده می‌کنند. پیش از آنکه تلاش کنید ماژولی بسازید که بتوان آن را به‌صورت" +" پویا بارگذاری کرد، از چگونگی کارکرد سیستم خود آگاه باشید." -msgid "In Unix, a shared object (:file:`.so`) file contains code to be used by the program, and also the names of functions and data that it expects to find in the program. When the file is joined to the program, all references to those functions and data in the file's code are changed to point to the actual locations in the program where the functions and data are placed in memory. This is basically a link operation." +msgid "" +"In Unix, a shared object (:file:`.so`) file contains code to be used by the " +"program, and also the names of functions and data that it expects to find in" +" the program. When the file is joined to the program, all references to " +"those functions and data in the file's code are changed to point to the " +"actual locations in the program where the functions and data are placed in " +"memory. This is basically a link operation." msgstr "" +"در یونیکس، یک پرونده‌ی شیء اشتراکی (shared object) (:file:`.so`) شامل کدی " +"است که قرار است توسط برنامه استفاده شود، و همچنین نام توابع و داده‌هایی که " +"انتظار دارد آن‌ها را در برنامه بیابد. هنگامی که پرونده به برنامه الحاق " +"می‌شود، تمام ارجاع‌ها به آن توابع و داده‌ها در کدِ پرونده تغییر می‌کنند تا " +"به مکان‌های واقعی در برنامه — جایی که توابع و داده‌ها در حافظه قرار " +"گرفته‌اند — اشاره کنند. این اساساً یک عملیات پیوند است." -msgid "In Windows, a dynamic-link library (:file:`.dll`) file has no dangling references. Instead, an access to functions or data goes through a lookup table. So the DLL code does not have to be fixed up at runtime to refer to the program's memory; instead, the code already uses the DLL's lookup table, and the lookup table is modified at runtime to point to the functions and data." +msgid "" +"In Windows, a dynamic-link library (:file:`.dll`) file has no dangling " +"references. Instead, an access to functions or data goes through a lookup " +"table. So the DLL code does not have to be fixed up at runtime to refer to " +"the program's memory; instead, the code already uses the DLL's lookup table," +" and the lookup table is modified at runtime to point to the functions and " +"data." msgstr "" +"در ویندوز، پرونده کتابخانه پیوند پویا (:file:`.dll`) هیچ ارجاع معلقی ندارد." +" در عوض، دسترسی به توابع یا داده‌ها از طریق یک جدول جستجو انجام می‌شود. " +"بنابراین، کد DLL لازم نیست در ران‌تایم برای ارجاع به حافظه برنامه اصلاح شود؛" +" در عوض، کد از پیش از جدول جستجوی DLL استفاده می‌کند و جدول جستجو در " +"ران‌تایم تغییر داده می‌شود تا به توابع و داده‌ها اشاره کند." -msgid "In Unix, there is only one type of library file (:file:`.a`) which contains code from several object files (:file:`.o`). During the link step to create a shared object file (:file:`.so`), the linker may find that it doesn't know where an identifier is defined. The linker will look for it in the object files in the libraries; if it finds it, it will include all the code from that object file." +msgid "" +"In Unix, there is only one type of library file (:file:`.a`) which contains " +"code from several object files (:file:`.o`). During the link step to create" +" a shared object file (:file:`.so`), the linker may find that it doesn't " +"know where an identifier is defined. The linker will look for it in the " +"object files in the libraries; if it finds it, it will include all the code " +"from that object file." msgstr "" +"در یونیکس، تنها یک نوع پرونده کتابخانه (:file:`.a`) وجود دارد که حاوی کد " +"چندین پرونده شیء (:file:`.o`) است. در طول مرحله پیوند برای ایجاد یک پرونده " +"شیء اشتراکی (:file:`.so`)، ممکن است پیونددهنده دریابد که نمی‌داند یک شناسه " +"در کجا تعریف شده است. پیونددهنده آن را در پرونده‌های شیء موجود در " +"کتابخانه‌ها جست‌وجو می‌کند؛ اگر آن را پیدا کند، تمام کد آن پرونده شیء را در " +"بر می‌گیرد." -msgid "In Windows, there are two types of library, a static library and an import library (both called :file:`.lib`). A static library is like a Unix :file:`.a` file; it contains code to be included as necessary. An import library is basically used only to reassure the linker that a certain identifier is legal, and will be present in the program when the DLL is loaded. So the linker uses the information from the import library to build the lookup table for using identifiers that are not included in the DLL. When an application or a DLL is linked, an import library may be generated, which will need to be used for all future DLLs that depend on the symbols in the application or DLL." +msgid "" +"In Windows, there are two types of library, a static library and an import " +"library (both called :file:`.lib`). A static library is like a Unix " +":file:`.a` file; it contains code to be included as necessary. An import " +"library is basically used only to reassure the linker that a certain " +"identifier is legal, and will be present in the program when the DLL is " +"loaded. So the linker uses the information from the import library to build" +" the lookup table for using identifiers that are not included in the DLL. " +"When an application or a DLL is linked, an import library may be generated, " +"which will need to be used for all future DLLs that depend on the symbols in" +" the application or DLL." msgstr "" +"در ویندوز، دو نوع کتابخانه وجود دارد: کتابخانه‌ی ایستا و کتابخانه‌ی ایمپورت " +"(هر دو :file:`.lib` نامیده می‌شوند). کتابخانه‌ی ایستا مانند پرونده‌ی " +":file:`.a` در یونیکس است؛ حاوی کدی است که در صورت نیاز گنجانده می‌شود. " +"کتابخانه‌ی ایمپورت اساساً فقط برای اطمینان‌دادن به پیونددهنده (linker) که " +"شناسه‌ی مشخصی معتبر است و هنگام بارگذاری DLL در برنامه موجود خواهد بود، " +"استفاده می‌شود. بنابراین پیونددهنده از اطلاعات کتابخانه‌ی ایمپورت برای ساخت " +"جدول جستجوی شناسه‌هایی که در DLL گنجانده نشده‌اند، استفاده می‌کند. هنگامی که" +" یک برنامه یا DLL پیوند داده می‌شود، ممکن است یک کتابخانه‌ی ایمپورت تولید " +"شود که باید برای تمام DLL‌های آینده‌ای که به نمادهای موجود در آن برنامه یا " +"DLL وابسته‌اند، استفاده شود." -msgid "Suppose you are building two dynamic-load modules, B and C, which should share another block of code A. On Unix, you would *not* pass :file:`A.a` to the linker for :file:`B.so` and :file:`C.so`; that would cause it to be included twice, so that B and C would each have their own copy. In Windows, building :file:`A.dll` will also build :file:`A.lib`. You *do* pass :file:`A.lib` to the linker for B and C. :file:`A.lib` does not contain code; it just contains information which will be used at runtime to access A's code." +msgid "" +"Suppose you are building two dynamic-load modules, B and C, which should " +"share another block of code A. On Unix, you would *not* pass :file:`A.a` to" +" the linker for :file:`B.so` and :file:`C.so`; that would cause it to be " +"included twice, so that B and C would each have their own copy. In Windows," +" building :file:`A.dll` will also build :file:`A.lib`. You *do* pass " +":file:`A.lib` to the linker for B and C. :file:`A.lib` does not contain " +"code; it just contains information which will be used at runtime to access " +"A's code." msgstr "" +"فرض کنید در حال ساخت دو ماژول بارگذاری پویا به نام B و C هستید که باید بلوک " +"کد دیگری به نام A را به اشتراک بگذارند. در یونیکس، شما :file:`A.a` را برای " +":file:`B.so` و :file:`C.so` به لینکر (linker) *نمی‌دهید*؛ این کار باعث " +"می‌شود که A دو بار گنجانده شود، به‌طوری که B و C هر یک نسخه‌ی خود را داشته " +"باشند. در ویندوز، با ساخت :file:`A.dll`، :file:`A.lib` نیز ساخته می‌شود. شما" +" :file:`A.lib` را برای B و C به لینکر *می‌دهید*. :file:`A.lib` حاوی کد نیست؛" +" فقط حاوی اطلاعاتی است که در زمان اجرا برای دسترسی به کد A استفاده خواهند " +"شد." -msgid "In Windows, using an import library is sort of like using ``import spam``; it gives you access to spam's names, but does not create a separate copy. On Unix, linking with a library is more like ``from spam import *``; it does create a separate copy." +msgid "" +"In Windows, using an import library is sort of like using ``import spam``; " +"it gives you access to spam's names, but does not create a separate copy. " +"On Unix, linking with a library is more like ``from spam import *``; it does" +" create a separate copy." msgstr "" +"در ویندوز، استفاده از کتابخانه ایمپورت (import library) تا حدی شبیه استفاده " +"از ``import spam`` است؛ به شما دسترسی به نام‌های spam می‌دهد، اما نسخه " +"جداگانه‌ای ایجاد نمی‌کند. در یونیکس، پیوند دادن با یک کتابخانه بیشتر شبیه " +"``from spam import *`` است؛ و نسخه جداگانه‌ای ایجاد می‌کند." -msgid "Turn off the implicit, ``#pragma``-based linkage with the Python library, performed inside CPython header files." +msgid "" +"Turn off the implicit, ``#pragma``-based linkage with the Python library, " +"performed inside CPython header files." msgstr "" +"پیوند ضمنی و مبتنی بر ``#pragma`` با کتابخانه‌ی پایتون را که درون پرونده‌های" +" سرآیند سی‌پایتون انجام می‌شود، غیرفعال کنید." msgid "Using DLLs in Practice" -msgstr "" +msgstr "استفاده از DLL‌ها در عمل" -msgid "Windows Python is built in Microsoft Visual C++; using other compilers may or may not work. The rest of this section is MSVC++ specific." +msgid "" +"Windows Python is built in Microsoft Visual C++; using other compilers may " +"or may not work. The rest of this section is MSVC++ specific." msgstr "" +"نسخه‌ی ویندوزی پایتون با Microsoft Visual C++ ساخته می‌شود؛ استفاده از " +"کامپایلرهای دیگر ممکن است کار کند یا نکند. بقیه‌ی این بخش ویژه‌ی MSVC++ است." -msgid "When creating DLLs in Windows, you can use the CPython library in two ways:" +msgid "" +"When creating DLLs in Windows, you can use the CPython library in two ways:" msgstr "" +"هنگام ساخت DLL‌ها در ویندوز، می‌توانید از کتابخانه سی‌پایتون به دو روش " +"استفاده کنید:" -msgid "By default, inclusion of :file:`PC/pyconfig.h` directly or via :file:`Python.h` triggers an implicit, configure-aware link with the library. The header file chooses :file:`pythonXY_d.lib` for Debug, :file:`pythonXY.lib` for Release, and :file:`pythonX.lib` for Release with the :ref:`Limited API ` enabled." +msgid "" +"By default, inclusion of :file:`PC/pyconfig.h` directly or via " +":file:`Python.h` triggers an implicit, configure-aware link with the " +"library. The header file chooses :file:`pythonXY_d.lib` for Debug, " +":file:`pythonXY.lib` for Release, and :file:`pythonX.lib` for Release with " +"the :ref:`Limited API ` enabled." msgstr "" +"به‌طور پیش‌فرض، گنجاندن :file:`PC/pyconfig.h` به‌صورت مستقیم یا از طریق " +":file:`Python.h` موجب برقراری یک پیوند ضمنی و آگاه از پیکربندی با کتابخانه " +"می‌شود. پرونده سرآیند برای Debug، :file:`pythonXY_d.lib`؛ برای Release، " +":file:`pythonXY.lib`؛ و برای Release با فعال بودن :ref:`API محدود `، :file:`pythonX.lib` را انتخاب می‌کند." -msgid "To build two DLLs, spam and ni (which uses C functions found in spam), you could use these commands::" +msgid "" +"To build two DLLs, spam and ni (which uses C functions found in spam), you " +"could use these commands::" msgstr "" +"برای ساخت دو DLL با نام‌های spam و ni (که از توابع C موجود در spam استفاده " +"می‌کند)، می‌توانید از این دستورها استفاده کنید::" msgid "" "cl /LD /I/python/include spam.c\n" "cl /LD /I/python/include ni.c spam.lib" msgstr "" +"cl /LD /I/python/include spam.c\n" +"cl /LD /I/python/include ni.c spam.lib" -msgid "The first command created three files: :file:`spam.obj`, :file:`spam.dll` and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find the Python code thanks to the implicitly linked :file:`pythonXY.lib`." +msgid "" +"The first command created three files: :file:`spam.obj`, :file:`spam.dll` " +"and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " +"functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find" +" the Python code thanks to the implicitly linked :file:`pythonXY.lib`." msgstr "" +"فرمان نخست سه پرونده ایجاد کرد: :file:`spam.obj`، :file:`spam.dll` و " +":file:`spam.lib`. :file:`Spam.dll` هیچ تابع پایتونی (مانند " +":c:func:`PyArg_ParseTuple`) ندارد، اما به لطف پیوند ضمنی " +":file:`pythonXY.lib` می‌داند که کد پایتون را چگونه پیدا کند." -msgid "The second command created :file:`ni.dll` (and :file:`.obj` and :file:`.lib`), which knows how to find the necessary functions from spam, and also from the Python executable." +msgid "" +"The second command created :file:`ni.dll` (and :file:`.obj` and " +":file:`.lib`), which knows how to find the necessary functions from spam, " +"and also from the Python executable." msgstr "" +"دستور دوم :file:`ni.dll` را ایجاد کرد (به همراه :file:`.obj` و " +":file:`.lib`)، که می‌داند چگونه توابع لازم را از spam و همچنین از فایل " +"اجرایی پایتون پیدا کند." -msgid "Manually by defining :c:macro:`Py_NO_LINK_LIB` macro before including :file:`Python.h`. You must pass :file:`pythonXY.lib` to the linker." +msgid "" +"Manually by defining :c:macro:`Py_NO_LINK_LIB` macro before including " +":file:`Python.h`. You must pass :file:`pythonXY.lib` to the linker." msgstr "" +"به‌صورت دستی، با تعریف ماکروی :c:macro:`Py_NO_LINK_LIB` پیش از شامل کردن " +"(include) :file:`Python.h`. باید :file:`pythonXY.lib` را به پیوند‌دهنده " +"(linker) بدهید." msgid "" "cl /LD /DPy_NO_LINK_LIB /I/python/include spam.c ../libs/pythonXY.lib\n" "cl /LD /DPy_NO_LINK_LIB /I/python/include ni.c spam.lib ../libs/pythonXY.lib" msgstr "" +"cl /LD /DPy_NO_LINK_LIB /I/python/include spam.c ../libs/pythonXY.lib\n" +"cl /LD /DPy_NO_LINK_LIB /I/python/include ni.c spam.lib ../libs/pythonXY.lib" -msgid "The first command created three files: :file:`spam.obj`, :file:`spam.dll` and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find the Python code thanks to :file:`pythonXY.lib`." +msgid "" +"The first command created three files: :file:`spam.obj`, :file:`spam.dll` " +"and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " +"functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find" +" the Python code thanks to :file:`pythonXY.lib`." msgstr "" +"دستور اول سه پرونده ایجاد کرد: :file:`spam.obj`، :file:`spam.dll` و " +":file:`spam.lib`. :file:`Spam.dll` هیچ تابع پایتونی (مانند " +":c:func:`PyArg_ParseTuple`) در بر نمی‌گیرد، اما به لطف :file:`pythonXY.lib` " +"می‌داند چگونه کد پایتون را پیدا کند." -msgid "Not every identifier is exported to the lookup table. If you want any other modules (including Python) to be able to see your identifiers, you have to say ``_declspec(dllexport)``, as in ``void _declspec(dllexport) initspam(void)`` or ``PyObject _declspec(dllexport) *NiGetSpamData(void)``." +msgid "" +"Not every identifier is exported to the lookup table. If you want any other" +" modules (including Python) to be able to see your identifiers, you have to " +"say ``_declspec(dllexport)``, as in ``void _declspec(dllexport) " +"initspam(void)`` or ``PyObject _declspec(dllexport) *NiGetSpamData(void)``." msgstr "" +"هر شناسه‌ای به جدول جستجو صادر نمی‌شود. اگر می‌خواهید ماژول‌های دیگر (از " +"جمله پایتون) بتوانند شناسه‌های شما را ببینند، باید ``_declspec(dllexport)`` " +"را بنویسید، مانند ``void _declspec(dllexport) initspam(void)`` یا ``PyObject" +" _declspec(dllexport) *NiGetSpamData(void)``." -msgid "Developer Studio will throw in a lot of import libraries that you do not really need, adding about 100K to your executable. To get rid of them, use the Project Settings dialog, Link tab, to specify *ignore default libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." +msgid "" +"Developer Studio will throw in a lot of import libraries that you do not " +"really need, adding about 100K to your executable. To get rid of them, use " +"the Project Settings dialog, Link tab, to specify *ignore default " +"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of " +"libraries." msgstr "" +"Developer Studio تعداد زیادی کتابخانه‌ی ایمپورت که واقعاً به آن‌ها نیاز " +"ندارید را اضافه می‌کند و حدود ۱۰۰ کیلوبایت به پرونده‌ی اجرایی شما می‌افزاید." +" برای خلاص شدن از آن‌ها، از کادر گفت‌وگوی Project Settings، زبانه‌ی Link، " +"برای مشخص کردن *ignore default libraries* استفاده کنید. کتابخانه‌ی مناسب " +":file:`msvcrt{xx}.lib` را به فهرست کتابخانه‌ها اضافه کنید." diff --git a/faq/design.po b/faq/design.po index 8e463720f..bcb73fdd8 100644 --- a/faq/design.po +++ b/faq/design.po @@ -25,19 +25,31 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Design and History FAQ" -msgstr "" +msgstr "پرسش‌های متداول درباره‌ی طراحی و تاریخچه" msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "Why does Python use indentation for grouping of statements?" -msgstr "" +msgstr "چرا پایتون از تورفتگی برای گروه‌بندی دستورها استفاده می‌کند؟" -msgid "Guido van Rossum believes that using indentation for grouping is extremely elegant and contributes a lot to the clarity of the average Python program. Most people learn to love this feature after a while." +msgid "" +"Guido van Rossum believes that using indentation for grouping is extremely " +"elegant and contributes a lot to the clarity of the average Python program. " +"Most people learn to love this feature after a while." msgstr "" +"گیدو ون روسوم معتقد است که استفاده از تورفتگی برای گروه‌بندی بسیار ظریف است " +"و سهم زیادی در وضوح برنامه‌های معمول پایتون دارد. بسیاری از افراد پس از مدتی" +" به این ویژگی علاقه‌مند می‌شوند." -msgid "Since there are no begin/end brackets there cannot be a disagreement between grouping perceived by the parser and the human reader. Occasionally C programmers will encounter a fragment of code like this::" +msgid "" +"Since there are no begin/end brackets there cannot be a disagreement between" +" grouping perceived by the parser and the human reader. Occasionally C " +"programmers will encounter a fragment of code like this::" msgstr "" +"از آن‌جا که هیچ براکت آغاز/پایانی وجود ندارد، هیچ ناهماهنگی‌ای میان " +"گروه‌بندی از دید پارسر و خواننده‌ی انسانی وجود نخواهد داشت. گاهی " +"برنامه‌نویسان C با قطعه‌کدی مانند این مواجه می‌شوند::" msgid "" "if (x <= y)\n" @@ -45,160 +57,399 @@ msgid "" " y--;\n" "z++;" msgstr "" +"if (x <= y)\n" +" x++;\n" +" y--;\n" +"z++;" -msgid "Only the ``x++`` statement is executed if the condition is true, but the indentation leads many to believe otherwise. Even experienced C programmers will sometimes stare at it a long time wondering as to why ``y`` is being decremented even for ``x > y``." +msgid "" +"Only the ``x++`` statement is executed if the condition is true, but the " +"indentation leads many to believe otherwise. Even experienced C programmers" +" will sometimes stare at it a long time wondering as to why ``y`` is being " +"decremented even for ``x > y``." msgstr "" +"در صورت برقرار بودن شرط، تنها دستور ``x++`` اجرا می‌شود، اما تورفتگی باعث " +"می‌شود بسیاری برداشت دیگری داشته باشند. حتی برنامه‌نویسان باتجربه‌ی C نیز " +"گاهی مدت‌ها به آن خیره می‌شوند و از خود می‌پرسند که چرا ``y`` حتی برای ``x >" +" y`` کاهش می‌یابد." -msgid "Because there are no begin/end brackets, Python is much less prone to coding-style conflicts. In C there are many different ways to place the braces. After becoming used to reading and writing code using a particular style, it is normal to feel somewhat uneasy when reading (or being required to write) in a different one." +msgid "" +"Because there are no begin/end brackets, Python is much less prone to " +"coding-style conflicts. In C there are many different ways to place the " +"braces. After becoming used to reading and writing code using a particular " +"style, it is normal to feel somewhat uneasy when reading (or being required " +"to write) in a different one." msgstr "" +"چون براکت‌های آغاز/پایان وجود ندارند، پایتون بسیار کمتر در معرض تعارض‌های " +"سبک کدنویسی است. در C روش‌های مختلفی برای قرار دادن آکولادها وجود دارد. پس " +"از آنکه به خواندن و نوشتن کد با یک سبک خاص عادت کردید، طبیعی است که هنگام " +"خواندن (یا ملزم بودن به نوشتن) با سبکی متفاوت، تا حدی احساس ناراحتی کنید." -msgid "Many coding styles place begin/end brackets on a line by themselves. This makes programs considerably longer and wastes valuable screen space, making it harder to get a good overview of a program. Ideally, a function should fit on one screen (say, 20--30 lines). 20 lines of Python can do a lot more work than 20 lines of C. This is not solely due to the lack of begin/end brackets -- the lack of declarations and the high-level data types are also responsible -- but the indentation-based syntax certainly helps." -msgstr "" +msgid "" +"Many coding styles place begin/end brackets on a line by themselves. This " +"makes programs considerably longer and wastes valuable screen space, making " +"it harder to get a good overview of a program. Ideally, a function should " +"fit on one screen (say, 20--30 lines). 20 lines of Python can do a lot more" +" work than 20 lines of C. This is not solely due to the lack of begin/end " +"brackets -- the lack of declarations and the high-level data types are also " +"responsible -- but the indentation-based syntax certainly helps." +msgstr "" +"سبک‌های کدنویسی بسیاری، براکت‌های begin/end را در یک خط جداگانه قرار " +"می‌دهند. این کار برنامه‌ها را به‌طور قابل‌توجهی طولانی‌تر می‌کند و فضای " +"ارزشمند صفحه را هدر می‌دهد و در نتیجه داشتن دید کلی خوب از برنامه را دشوارتر" +" می‌سازد. در حالت ایده‌آل، یک تابع باید در یک صفحه جا شود (مثلاً ۲۰ تا ۳۰ " +"خط). ۲۰ خط پایتون می‌تواند کار بسیار بیشتری نسبت به ۲۰ خط C انجام دهد. این " +"موضوع تنها به دلیل نبود براکت‌های begin/end نیست — نبود اعلان‌ها و انواع " +"داده سطح بالا نیز در آن نقش دارند — اما نحو مبتنی بر تورفتگی قطعاً کمک " +"می‌کند." msgid "Why am I getting strange results with simple arithmetic operations?" -msgstr "" +msgstr "چرا هنگام انجام عملیات حسابی ساده، نتایج عجیبی دریافت می‌کنم؟" msgid "See the next question." -msgstr "" +msgstr "پرسش بعدی را ببینید." msgid "Why are floating-point calculations so inaccurate?" -msgstr "" +msgstr "چرا محاسبات ممیز شناور این‌قدر نادقیق هستند؟" msgid "Users are often surprised by results like this::" -msgstr "" +msgstr "کاربران اغلب از نتایجی مانند این شگفت‌زده می‌شوند::" msgid "" ">>> 1.2 - 1.0\n" "0.19999999999999996" msgstr "" +">>> 1.2 - 1.0\n" +"0.19999999999999996" -msgid "and think it is a bug in Python. It's not. This has little to do with Python, and much more to do with how the underlying platform handles floating-point numbers." +msgid "" +"and think it is a bug in Python. It's not. This has little to do with " +"Python, and much more to do with how the underlying platform handles " +"floating-point numbers." msgstr "" +"و فکر می‌کنند که این یک باگ در پایتون است. این‌طور نیست. این موضوع ارتباط " +"کمی با پایتون دارد و ارتباط بسیار بیشتری با نحوه‌ی مدیریت اعداد ممیز شناور " +"توسط پلتفرم زیرین دارد." -msgid "The :class:`float` type in CPython uses a C ``double`` for storage. A :class:`float` object's value is stored in binary floating-point with a fixed precision (typically 53 bits) and Python uses C operations, which in turn rely on the hardware implementation in the processor, to perform floating-point operations. This means that as far as floating-point operations are concerned, Python behaves like many popular languages including C and Java." -msgstr "" +msgid "" +"The :class:`float` type in CPython uses a C ``double`` for storage. A " +":class:`float` object's value is stored in binary floating-point with a " +"fixed precision (typically 53 bits) and Python uses C operations, which in " +"turn rely on the hardware implementation in the processor, to perform " +"floating-point operations. This means that as far as floating-point " +"operations are concerned, Python behaves like many popular languages " +"including C and Java." +msgstr "" +"نوع :class:`float` در CPython برای ذخیره‌سازی از یک ``double`` در C استفاده " +"می‌کند. مقدار یک شیء :class:`float` به‌صورت ممیز شناور دودویی با دقت ثابت " +"(معمولاً ۵۳ بیت) ذخیره می‌شود و پایتون برای انجام عملیات ممیز شناور از " +"عملیات C استفاده می‌کند، که خود به پیاده‌سازی سخت‌افزاری در پردازنده متکی " +"هستند. این بدان معناست که تا جایی که به عملیات ممیز شناور مربوط می‌شود، " +"پایتون مانند بسیاری از زبان‌های محبوب از جمله C و Java رفتار می‌کند." -msgid "Many numbers that can be written easily in decimal notation cannot be expressed exactly in binary floating point. For example, after::" +msgid "" +"Many numbers that can be written easily in decimal notation cannot be " +"expressed exactly in binary floating point. For example, after::" msgstr "" +"بسیاری از اعدادی که به‌راحتی می‌توان آن‌ها را در نماد دهدهی نوشت، نمی‌توانند" +" دقیقاً در قالب ممیز شناور دودویی بیان شوند. برای مثال، پس از::" msgid ">>> x = 1.2" -msgstr "" +msgstr ">>> x = 1.2" -msgid "the value stored for ``x`` is a (very good) approximation to the decimal value ``1.2``, but is not exactly equal to it. On a typical machine, the actual stored value is::" +msgid "" +"the value stored for ``x`` is a (very good) approximation to the decimal " +"value ``1.2``, but is not exactly equal to it. On a typical machine, the " +"actual stored value is::" msgstr "" +"مقدار ذخیره‌شده برای ``x`` تقریبی (بسیار خوب) از مقدار دهدهی ``1.2`` است، " +"اما دقیقاً برابر با آن نیست. در یک ماشین معمول، مقدار ذخیره‌شده واقعی عبارت " +"است از::" msgid "1.0011001100110011001100110011001100110011001100110011 (binary)" -msgstr "" +msgstr "1.0011001100110011001100110011001100110011001100110011 (دودویی)" msgid "which is exactly::" -msgstr "" +msgstr "که دقیقاً به‌صورت زیر است::" msgid "1.1999999999999999555910790149937383830547332763671875 (decimal)" -msgstr "" +msgstr "1.1999999999999999555910790149937383830547332763671875 (دهدهی)" -msgid "The typical precision of 53 bits provides Python floats with 15--16 decimal digits of accuracy." +msgid "" +"The typical precision of 53 bits provides Python floats with 15--16 decimal " +"digits of accuracy." msgstr "" +"دقت معمول ۵۳ بیتی، برای اعداد اعشاری پایتون ۱۵ تا ۱۶ رقم اعشاری دقت فراهم " +"می‌کند." -msgid "For a fuller explanation, please see the :ref:`floating-point arithmetic ` chapter in the Python tutorial." +msgid "" +"For a fuller explanation, please see the :ref:`floating-point arithmetic " +"` chapter in the Python tutorial." msgstr "" +"برای توضیح کامل‌تر، لطفاً فصل :ref:`حساب ممیز شناور ` در " +"آموزش پایتون را ببینید." msgid "Why are Python strings immutable?" -msgstr "" +msgstr "چرا رشته‌های پایتون تغییرناپذیر هستند؟" msgid "There are several advantages." -msgstr "" +msgstr "چندین مزیت وجود دارد." -msgid "One is performance: knowing that a string is immutable means we can allocate space for it at creation time, and the storage requirements are fixed and unchanging. This is also one of the reasons for the distinction between tuples and lists." +msgid "" +"One is performance: knowing that a string is immutable means we can allocate" +" space for it at creation time, and the storage requirements are fixed and " +"unchanging. This is also one of the reasons for the distinction between " +"tuples and lists." msgstr "" +"یکی از آن‌ها کارایی است: دانستن اینکه یک رشته تغییرناپذیر است به این معناست " +"که می‌توانیم فضای آن را در زمان ایجاد تخصیص دهیم، و نیازهای ذخیره‌سازی ثابت " +"و بدون تغییر هستند. این نیز یکی از دلایل تمایز بین تاپل‌ها و فهرست‌ها است." -msgid "Another advantage is that strings in Python are considered as \"elemental\" as numbers. No amount of activity will change the value 8 to anything else, and in Python, no amount of activity will change the string \"eight\" to anything else." +msgid "" +"Another advantage is that strings in Python are considered as \"elemental\" " +"as numbers. No amount of activity will change the value 8 to anything else," +" and in Python, no amount of activity will change the string \"eight\" to " +"anything else." msgstr "" +"مزیت دیگر این است که رشته‌ها در پایتون به همان اندازه‌ی اعداد «بنیادی» محسوب " +"می‌شوند. هیچ میزان فعالیتی مقدار ۸ را به چیز دیگری تغییر نخواهد داد، و در " +"پایتون، هیچ میزان فعالیتی رشته‌ی \"eight\" را به چیز دیگری تغییر نخواهد داد." msgid "Why must 'self' be used explicitly in method definitions and calls?" -msgstr "" +msgstr "چرا باید از 'self' به‌صراحت در تعاریف و فراخوانی‌های متد استفاده شود؟" -msgid "The idea was borrowed from Modula-3. It turns out to be very useful, for a variety of reasons." +msgid "" +"The idea was borrowed from Modula-3. It turns out to be very useful, for a " +"variety of reasons." msgstr "" +"این ایده از Modula-3 اقتباس شده است. به دلایل گوناگونی، بسیار مفید است." -msgid "First, it's more obvious that you are using a method or instance attribute instead of a local variable. Reading ``self.x`` or ``self.meth()`` makes it absolutely clear that an instance variable or method is used even if you don't know the class definition by heart. In C++, you can sort of tell by the lack of a local variable declaration (assuming globals are rare or easily recognizable) -- but in Python, there are no local variable declarations, so you'd have to look up the class definition to be sure. Some C++ and Java coding standards call for instance attributes to have an ``m_`` prefix, so this explicitness is still useful in those languages, too." -msgstr "" +msgid "" +"First, it's more obvious that you are using a method or instance attribute " +"instead of a local variable. Reading ``self.x`` or ``self.meth()`` makes it" +" absolutely clear that an instance variable or method is used even if you " +"don't know the class definition by heart. In C++, you can sort of tell by " +"the lack of a local variable declaration (assuming globals are rare or " +"easily recognizable) -- but in Python, there are no local variable " +"declarations, so you'd have to look up the class definition to be sure. " +"Some C++ and Java coding standards call for instance attributes to have an " +"``m_`` prefix, so this explicitness is still useful in those languages, too." +msgstr "" +"اول، آشکارتر است که شما به‌جای یک متغیر محلی از یک متد یا ویژگی نمونه " +"استفاده می‌کنید. خواندن ``self.x`` یا ``self.meth()`` کاملاً روشن می‌سازد که" +" از یک متغیر نمونه یا متد استفاده شده است، حتی اگر تعریف کلاس را از حفظ " +"ندانید. در C++، تا حدی می‌توان از نبود اعلان متغیر محلی این موضوع را تشخیص " +"داد (با فرض اینکه متغیرهای سراسری نادر یا به‌راحتی قابل‌تشخیص باشند) — اما " +"در پایتون، هیچ اعلان متغیر محلی وجود ندارد، بنابراین برای اطمینان باید به " +"تعریف کلاس مراجعه کنید. برخی استانداردهای کدنویسی C++ و Java مقرر می‌دارند " +"که ویژگی‌های نمونه دارای پیشوند ``m_`` باشند، بنابراین این صراحت در آن " +"زبان‌ها نیز همچنان مفید است." -msgid "Second, it means that no special syntax is necessary if you want to explicitly reference or call the method from a particular class. In C++, if you want to use a method from a base class which is overridden in a derived class, you have to use the ``::`` operator -- in Python you can write ``baseclass.methodname(self, )``. This is particularly useful for :meth:`~object.__init__` methods, and in general in cases where a derived class method wants to extend the base class method of the same name and thus has to call the base class method somehow." -msgstr "" +msgid "" +"Second, it means that no special syntax is necessary if you want to " +"explicitly reference or call the method from a particular class. In C++, if" +" you want to use a method from a base class which is overridden in a derived" +" class, you have to use the ``::`` operator -- in Python you can write " +"``baseclass.methodname(self, )``. This is particularly " +"useful for :meth:`~object.__init__` methods, and in general in cases where a" +" derived class method wants to extend the base class method of the same name" +" and thus has to call the base class method somehow." +msgstr "" +"دوم، این بدان معناست که اگر بخواهید به‌صراحت به متدی از یک کلاس خاص ارجاع " +"دهید یا آن را فراخوانی کنید، نیازی به سینتکس خاصی نیست. در C++، اگر بخواهید " +"از متدی از کلاس پایه استفاده کنید که در یک کلاس مشتق‌شده بازنویسی شده است، " +"باید از عملگر ``::`` استفاده کنید — در پایتون می‌توانید " +"``baseclass.methodname(self, )`` را بنویسید. این موضوع " +"به‌ویژه برای متدهای :meth:`~object.__init__` مفید است، و به‌طور کلی در " +"مواردی که متد کلاس مشتق‌شده بخواهد متد کلاس پایه با همین نام را گسترش دهد و " +"از این رو لازم باشد متد کلاس پایه را به‌نحوی فراخوانی کند." -msgid "Finally, for instance variables it solves a syntactic problem with assignment: since local variables in Python are (by definition!) those variables to which a value is assigned in a function body (and that aren't explicitly declared global), there has to be some way to tell the interpreter that an assignment was meant to assign to an instance variable instead of to a local variable, and it should preferably be syntactic (for efficiency reasons). C++ does this through declarations, but Python doesn't have declarations and it would be a pity having to introduce them just for this purpose. Using the explicit ``self.var`` solves this nicely. Similarly, for using instance variables, having to write ``self.var`` means that references to unqualified names inside a method don't have to search the instance's directories. To put it another way, local variables and instance variables live in two different namespaces, and you need to tell Python which namespace to use." -msgstr "" +msgid "" +"Finally, for instance variables it solves a syntactic problem with " +"assignment: since local variables in Python are (by definition!) those " +"variables to which a value is assigned in a function body (and that aren't " +"explicitly declared global), there has to be some way to tell the " +"interpreter that an assignment was meant to assign to an instance variable " +"instead of to a local variable, and it should preferably be syntactic (for " +"efficiency reasons). C++ does this through declarations, but Python doesn't" +" have declarations and it would be a pity having to introduce them just for " +"this purpose. Using the explicit ``self.var`` solves this nicely. " +"Similarly, for using instance variables, having to write ``self.var`` means " +"that references to unqualified names inside a method don't have to search " +"the instance's directories. To put it another way, local variables and " +"instance variables live in two different namespaces, and you need to tell " +"Python which namespace to use." +msgstr "" +"در نهایت، برای متغیرهای نمونه، این موضوع یک مشکل نحوی در انتساب را حل " +"می‌کند: از آن‌جا که متغیرهای محلی در پایتون (طبق تعریف!) آن متغیرهایی " +"هستند که مقداری در بدنه یک تابع به آن‌ها انتساب داده می‌شود (و به‌صراحت " +"سراسری اعلام نشده‌اند)، باید راهی وجود داشته باشد تا به مفسر بگوییم که منظور" +" از یک انتساب، انتساب به یک متغیر نمونه است نه به یک متغیر محلی، و ترجیحاً " +"باید نحوی باشد (به دلایل کارایی). C++ این کار را از طریق اعلان‌ها انجام " +"می‌دهد، اما پایتون اعلان ندارد و حیف است که فقط برای این هدف مجبور شویم " +"آن‌ها را معرفی کنیم. استفاده صریح از ``self.var`` این مشکل را به‌خوبی حل " +"می‌کند. به‌طور مشابه، برای استفاده از متغیرهای نمونه، این که باید " +"``self.var`` نوشته شود به این معناست که ارجاع‌ها به نام‌های فاقد صلاحیت در " +"داخل یک متد نیازی به جستجوی پوشه‌های آن نمونه ندارند. به بیان دیگر، " +"متغیرهای محلی و متغیرهای نمونه در دو فضای نام متفاوت قرار دارند و شما باید" +" به پایتون بگویید که از کدام فضای نام استفاده کند." msgid "Why can't I use an assignment in an expression?" -msgstr "" +msgstr "چرا نمی‌توانم در یک عبارت از انتساب استفاده کنم؟" msgid "Starting in Python 3.8, you can!" -msgstr "" +msgstr "از پایتون 3.8 به بعد، می‌توانید!" -msgid "Assignment expressions using the walrus operator ``:=`` assign a variable in an expression::" +msgid "" +"Assignment expressions using the walrus operator ``:=`` assign a variable in" +" an expression::" msgstr "" +"عبارات انتسابی که از عملگر والروس (walrus operator) ``:=`` استفاده می‌کنند، " +"متغیری را در یک عبارت انتساب می‌دهند::" msgid "" "while chunk := fp.read(200):\n" " print(chunk)" msgstr "" +"while chunk := fp.read(200):\n" +" print(chunk)" msgid "See :pep:`572` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، :pep:`572` را ببینید." -msgid "Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?" +msgid "" +"Why does Python use methods for some functionality (e.g. list.index()) but " +"functions for other (e.g. len(list))?" msgstr "" +"چرا پایتون برای برخی قابلیت‌ها از متدها استفاده می‌کند (مثلاً list.index()) " +"اما برای برخی دیگر از توابع (مثلاً len(list))؟" msgid "As Guido said:" -msgstr "" +msgstr "همان‌طور که گایدو گفت:" -msgid "(a) For some operations, prefix notation just reads better than postfix -- prefix (and infix!) operations have a long tradition in mathematics which likes notations where the visuals help the mathematician thinking about a problem. Compare the easy with which we rewrite a formula like x*(a+b) into x*a + x*b to the clumsiness of doing the same thing using a raw OO notation." -msgstr "" +msgid "" +"(a) For some operations, prefix notation just reads better than postfix -- " +"prefix (and infix!) operations have a long tradition in mathematics which " +"likes notations where the visuals help the mathematician thinking about a " +"problem. Compare the easy with which we rewrite a formula like x*(a+b) into " +"x*a + x*b to the clumsiness of doing the same thing using a raw OO notation." +msgstr "" +"(a) برای برخی عملیات، نمادگذاری پیشوندی به‌سادگی خواناتر از پسوندی است — " +"عملیات پیشوندی (و میانوندی!) در ریاضیات سابقه‌ای طولانی دارند؛ ریاضیات " +"نمادگذاری‌هایی را می‌پسندد که در آن‌ها جنبه‌های بصری به ریاضی‌دان کمک " +"می‌کنند تا درباره‌ی یک مسئله بیندیشد. سهولتی را که با آن فرمولی مانند x*(a+b)" +" را به x*a + x*b بازنویسی می‌کنیم، با ناشیانه بودن انجام همان کار با استفاده" +" از یک نمادگذاری خام شیء‌گرا (OO) مقایسه کنید." -msgid "(b) When I read code that says len(x) I *know* that it is asking for the length of something. This tells me two things: the result is an integer, and the argument is some kind of container. To the contrary, when I read x.len(), I have to already know that x is some kind of container implementing an interface or inheriting from a class that has a standard len(). Witness the confusion we occasionally have when a class that is not implementing a mapping has a get() or keys() method, or something that isn't a file has a write() method." -msgstr "" +msgid "" +"(b) When I read code that says len(x) I *know* that it is asking for the " +"length of something. This tells me two things: the result is an integer, and" +" the argument is some kind of container. To the contrary, when I read " +"x.len(), I have to already know that x is some kind of container " +"implementing an interface or inheriting from a class that has a standard " +"len(). Witness the confusion we occasionally have when a class that is not " +"implementing a mapping has a get() or keys() method, or something that isn't" +" a file has a write() method." +msgstr "" +"(ب) هنگامی که کدی را می‌خوانم که len(x) دارد، *می‌دانم* که درخواست طول چیزی " +"را دارد. این موضوع دو چیز را به من می‌گوید: نتیجه یک عدد صحیح است و آرگومان " +"نوعی ظرف است. در مقابل، هنگامی که x.len() را می‌خوانم، باید از قبل بدانم که " +"x نوعی ظرف است که یک رابط را پیاده‌سازی می‌کند یا از کلاسی ارث می‌برد که یک " +"len() استاندارد دارد. به سردرگمی‌ای که گاهی با آن مواجه می‌شویم توجه کنید، " +"هنگامی که کلاسی که یک نگاشت را پیاده‌سازی نمی‌کند دارای متد get() یا keys() " +"است، یا چیزی که فایل نیست متد write() دارد." -msgid "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" +msgid "" +"https://mail.python.org/pipermail/python-3000/2006-November/004643.html" msgstr "" +"https://mail.python.org/pipermail/python-3000/2006-November/004643.html" msgid "Why is join() a string method instead of a list or tuple method?" -msgstr "" +msgstr "چرا join() یک متد رشته است، نه یک متد فهرست یا تاپل؟" -msgid "Strings became much more like other standard types starting in Python 1.6, when methods were added which give the same functionality that has always been available using the functions of the string module. Most of these new methods have been widely accepted, but the one which appears to make some programmers feel uncomfortable is::" -msgstr "" +msgid "" +"Strings became much more like other standard types starting in Python 1.6, " +"when methods were added which give the same functionality that has always " +"been available using the functions of the string module. Most of these new " +"methods have been widely accepted, but the one which appears to make some " +"programmers feel uncomfortable is::" +msgstr "" +"رشته‌ها از پایتون 1.6 بسیار شبیه‌تر به سایر انواع استاندارد شدند، زمانی که " +"متدهایی افزوده شدند که همان عملکردی را ارائه می‌دهند که همواره از طریق توابع" +" ماژول string در دسترس بوده است. بیشتر این متدهای جدید به‌طور گسترده پذیرفته" +" شده‌اند، اما آن متدی که به نظر می‌رسد باعث ناراحتی برخی برنامه‌نویسان " +"می‌شود، این است::" msgid "\", \".join(['1', '2', '4', '8', '16'])" -msgstr "" +msgstr "\", \".join(['1', '2', '4', '8', '16'])" msgid "which gives the result::" -msgstr "" +msgstr "که نتیجه زیر را می‌دهد::" msgid "\"1, 2, 4, 8, 16\"" -msgstr "" +msgstr "1, 2, 4, 8, 16" msgid "There are two common arguments against this usage." -msgstr "" +msgstr "دو آرگومان رایج در مخالفت با این کاربرد وجود دارد." -msgid "The first runs along the lines of: \"It looks really ugly using a method of a string literal (string constant)\", to which the answer is that it might, but a string literal is just a fixed value. If the methods are to be allowed on names bound to strings there is no logical reason to make them unavailable on literals." +msgid "" +"The first runs along the lines of: \"It looks really ugly using a method of " +"a string literal (string constant)\", to which the answer is that it might, " +"but a string literal is just a fixed value. If the methods are to be allowed" +" on names bound to strings there is no logical reason to make them " +"unavailable on literals." msgstr "" +"مورد اول این‌گونه است: «استفاده از یک متدِ رشته‌ی لفظی (ثابت رشته‌ای) واقعاً " +"زشت به نظر می‌رسد»، پاسخ این است که شاید چنین باشد، اما یک رشته‌ی لفظی صرفاً " +"یک مقدار ثابت است. اگر متدها روی نام‌های مقید به رشته‌ها مجاز باشند، هیچ " +"دلیل منطقی برای در دسترس نبودن آن‌ها روی رشته‌های لفظی وجود ندارد." -msgid "The second objection is typically cast as: \"I am really telling a sequence to join its members together with a string constant\". Sadly, you aren't. For some reason there seems to be much less difficulty with having :meth:`~str.split` as a string method, since in that case it is easy to see that ::" +msgid "" +"The second objection is typically cast as: \"I am really telling a sequence " +"to join its members together with a string constant\". Sadly, you aren't. " +"For some reason there seems to be much less difficulty with having " +":meth:`~str.split` as a string method, since in that case it is easy to see " +"that ::" msgstr "" +"اعتراض دوم معمولاً به این صورت بیان می‌شود: «من در واقع به یک دنباله می‌گویم" +" که اعضای خود را با یک ثابت رشته‌ای به هم بپیوندد». متأسفانه، شما این کار را" +" نمی‌کنید. به دلایلی، داشتن :meth:`~str.split` به‌عنوان یک متد رشته‌ای بسیار" +" کمتر دشوار به نظر می‌رسد، زیرا در آن حالت به‌راحتی می‌توان دید که ::" msgid "\"1, 2, 4, 8, 16\".split(\", \")" -msgstr "" +msgstr "\"1, 2, 4, 8, 16\".split(\", \")" -msgid "is an instruction to a string literal to return the substrings delimited by the given separator (or, by default, arbitrary runs of white space)." +msgid "" +"is an instruction to a string literal to return the substrings delimited by " +"the given separator (or, by default, arbitrary runs of white space)." msgstr "" +"دستوری به یک رشته‌ی لفظی برای بازگرداندن زیررشته‌هایی است که با جداکننده‌ی " +"داده‌شده جدا شده‌اند (یا به‌طور پیش‌فرض، دنباله‌های دلخواه فضای خالی)." -msgid ":meth:`~str.join` is a string method because in using it you are telling the separator string to iterate over a sequence of strings and insert itself between adjacent elements. This method can be used with any argument which obeys the rules for sequence objects, including any new classes you might define yourself. Similar methods exist for bytes and bytearray objects." -msgstr "" +msgid "" +":meth:`~str.join` is a string method because in using it you are telling the" +" separator string to iterate over a sequence of strings and insert itself " +"between adjacent elements. This method can be used with any argument which " +"obeys the rules for sequence objects, including any new classes you might " +"define yourself. Similar methods exist for bytes and bytearray objects." +msgstr "" +":meth:`~str.join` یک متد رشته است، زیرا هنگام استفاده از آن، شما به رشته‌ی " +"جداکننده می‌گویید که دنباله‌ای از رشته‌ها را پیمایش کند و خود را بین عناصر " +"مجاور درج کند. این متد را می‌توان با هر آرگومانی که از قوانین اشیاء " +"دنباله‌ای پیروی می‌کند، استفاده کرد؛ از جمله هر کلاس جدیدی که ممکن است " +"خودتان تعریف کنید. متدهای مشابهی برای اشیاء bytes و bytearray وجود دارند." msgid "How fast are exceptions?" -msgstr "" +msgstr "استثناها چقدر سریع هستند؟" -msgid "A :keyword:`try`/:keyword:`except` block is extremely efficient if no exceptions are raised. Actually catching an exception is expensive. In versions of Python prior to 2.0 it was common to use this idiom::" +msgid "" +"A :keyword:`try`/:keyword:`except` block is extremely efficient if no " +"exceptions are raised. Actually catching an exception is expensive. In " +"versions of Python prior to 2.0 it was common to use this idiom::" msgstr "" +"یک بلوک :keyword:`try`/:keyword:`except` اگر هیچ استثنایی پرتاب نشود، بسیار " +"کارآمد است. در واقع، گرفتن یک استثنا پرهزینه است. در نسخه‌های پیش از 2.0 " +"پایتون، استفاده از این اصطلاح رایج بود::" msgid "" "try:\n" @@ -207,9 +458,18 @@ msgid "" " mydict[key] = getvalue(key)\n" " value = mydict[key]" msgstr "" +"try:\n" +" value = mydict[key]\n" +"except KeyError:\n" +" mydict[key] = getvalue(key)\n" +" value = mydict[key]" -msgid "This only made sense when you expected the dict to have the key almost all the time. If that wasn't the case, you coded it like this::" +msgid "" +"This only made sense when you expected the dict to have the key almost all " +"the time. If that wasn't the case, you coded it like this::" msgstr "" +"این تنها زمانی منطقی بود که انتظار داشتید دیکشنری تقریباً همیشه کلید را " +"داشته باشد. اگر این‌طور نبود، آن را این‌گونه کدنویسی می‌کردید::" msgid "" "if key in mydict:\n" @@ -217,18 +477,49 @@ msgid "" "else:\n" " value = mydict[key] = getvalue(key)" msgstr "" +"if key in mydict:\n" +" value = mydict[key]\n" +"else:\n" +" value = mydict[key] = getvalue(key)" -msgid "For this specific case, you could also use ``value = dict.setdefault(key, getvalue(key))``, but only if the ``getvalue()`` call is cheap enough because it is evaluated in all cases." +msgid "" +"For this specific case, you could also use ``value = dict.setdefault(key, " +"getvalue(key))``, but only if the ``getvalue()`` call is cheap enough " +"because it is evaluated in all cases." msgstr "" +"برای این مورد خاص، می‌توانید از ``value = dict.setdefault(key, " +"getvalue(key))`` نیز استفاده کنید، اما تنها در صورتی که فراخوانی " +"``getvalue()`` به‌اندازه کافی کم‌هزینه باشد، زیرا در همه موارد ارزیابی " +"می‌شود." msgid "Why isn't there a switch or case statement in Python?" -msgstr "" +msgstr "چرا در پایتون دستور switch یا case وجود ندارد؟" -msgid "In general, structured switch statements execute one block of code when an expression has a particular value or set of values. Since Python 3.10 one can easily match literal values, or constants within a namespace, with a ``match ... case`` statement. See :ref:`the specification ` and :ref:`the tutorial ` for more information about :keyword:`match` statements. An older alternative is a sequence of ``if... elif... elif... else``." -msgstr "" +msgid "" +"In general, structured switch statements execute one block of code when an " +"expression has a particular value or set of values. Since Python 3.10 one " +"can easily match literal values, or constants within a namespace, with a " +"``match ... case`` statement. See :ref:`the specification ` and " +":ref:`the tutorial ` for more information about :keyword:`match` " +"statements. An older alternative is a sequence of ``if... elif... elif... " +"else``." +msgstr "" +"به‌طور کلی، دستورهای switch ساختاریافته یک بلوک کد را هنگامی اجرا می‌کنند " +"که یک عبارت دارای یک مقدار خاص یا مجموعه‌ای از مقادیر باشد. از پایتون 3.10، " +"می‌توانید به‌راحتی مقادیر لفظی یا ثابت‌های درون یک فضای نام را با دستور " +"``match ... case`` تطبیق دهید. برای اطلاعات بیشتر درباره دستورهای " +":keyword:`match`، :ref:`مشخصات ` و :ref:`آموزش ` را " +"ببینید. یک جایگزین قدیمی‌تر، دنباله‌ای از ``if... elif... elif... else`` " +"است." -msgid "For cases where you need to choose from a very large number of possibilities, you can create a dictionary mapping case values to functions to call. For example::" +msgid "" +"For cases where you need to choose from a very large number of " +"possibilities, you can create a dictionary mapping case values to functions " +"to call. For example::" msgstr "" +"برای مواردی که نیاز دارید از میان تعداد بسیار زیادی از حالت‌های ممکن انتخاب " +"کنید، می‌توانید یک دیکشنری برای نگاشت مقادیر حالت به توابعی که باید فراخوانی" +" شوند ایجاد کنید. برای مثال::" msgid "" "functions = {'a': function_1,\n" @@ -238,9 +529,19 @@ msgid "" "func = functions[value]\n" "func()" msgstr "" +"functions = {'a': function_1,\n" +" 'b': function_2,\n" +" 'c': self.method_1}\n" +"\n" +"func = functions[value]\n" +"func()" -msgid "For calling methods on objects, you can simplify yet further by using the :func:`getattr` built-in to retrieve methods with a particular name::" +msgid "" +"For calling methods on objects, you can simplify yet further by using the " +":func:`getattr` built-in to retrieve methods with a particular name::" msgstr "" +"برای فراخوانی متدها روی اشیاء، می‌توانید این کار را با استفاده از تابع توکار" +" :func:`getattr` برای واکشی متدهایی با نامی خاص، باز هم ساده‌تر کنید::" msgid "" "class MyVisitor:\n" @@ -252,152 +553,467 @@ msgid "" " method = getattr(self, method_name)\n" " method()" msgstr "" +"class MyVisitor:\n" +" def visit_a(self):\n" +" ...\n" +"\n" +" def dispatch(self, value):\n" +" method_name = 'visit_' + str(value)\n" +" method = getattr(self, method_name)\n" +" method()" -msgid "It's suggested that you use a prefix for the method names, such as ``visit_`` in this example. Without such a prefix, if values are coming from an untrusted source, an attacker would be able to call any method on your object." +msgid "" +"It's suggested that you use a prefix for the method names, such as " +"``visit_`` in this example. Without such a prefix, if values are coming " +"from an untrusted source, an attacker would be able to call any method on " +"your object." msgstr "" +"پیشنهاد می‌شود از یک پیشوند برای نام متدها استفاده کنید، مانند ``visit_`` " +"در این مثال. بدون چنین پیشوندی، اگر مقادیر از منبعی غیرقابل‌اعتماد دریافت " +"شوند، یک مهاجم می‌تواند هر متدی را روی شیء شما فراخوانی کند." -msgid "Imitating switch with fallthrough, as with C's switch-case-default, is possible, much harder, and less needed." +msgid "" +"Imitating switch with fallthrough, as with C's switch-case-default, is " +"possible, much harder, and less needed." msgstr "" +"تقلید switch با fallthrough، مانند switch-case-default در C، امکان‌پذیر است،" +" بسیار دشوارتر است و کمتر مورد نیاز است." -msgid "Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?" +msgid "" +"Can't you emulate threads in the interpreter instead of relying on an OS-" +"specific thread implementation?" msgstr "" +"آیا نمی‌توانید به جای تکیه بر یک پیاده‌سازی نخ مختص سیستم‌عامل، نخ‌ها را در " +"مفسر شبیه‌سازی کنید؟" -msgid "Answer 1: Unfortunately, the interpreter pushes at least one C stack frame for each Python stack frame. Also, extensions can call back into Python at almost random moments. Therefore, a complete threads implementation requires thread support for C." +msgid "" +"Answer 1: Unfortunately, the interpreter pushes at least one C stack frame " +"for each Python stack frame. Also, extensions can call back into Python at " +"almost random moments. Therefore, a complete threads implementation " +"requires thread support for C." msgstr "" +"پاسخ ۱: متأسفانه، مفسر برای هر فریم پشته‌ی پایتون، حداقل یک فریم پشته‌ی C را" +" روی پشته قرار می‌دهد. همچنین، افزونه‌ها می‌توانند در لحظاتی تقریباً تصادفی " +"فراخوانی بازگشتی به پایتون داشته باشند. بنابراین، یک پیاده‌سازی کامل نخ‌ها " +"به پشتیبانی از نخ برای C نیاز دارد." -msgid "Answer 2: Fortunately, there is `Stackless Python `_, which has a completely redesigned interpreter loop that avoids the C stack." +msgid "" +"Answer 2: Fortunately, there is `Stackless Python " +"`_, which has a completely " +"redesigned interpreter loop that avoids the C stack." msgstr "" +"پاسخ ۲: خوشبختانه، `Stackless Python `_ وجود دارد که حلقه مفسر آن به‌طور کامل بازطراحی شده است" +" و از پشته‌ی C اجتناب می‌کند." msgid "Why can't lambda expressions contain statements?" -msgstr "" +msgstr "چرا عبارت‌های لامبدا نمی‌توانند شامل دستورها باشند؟" -msgid "Python lambda expressions cannot contain statements because Python's syntactic framework can't handle statements nested inside expressions. However, in Python, this is not a serious problem. Unlike lambda forms in other languages, where they add functionality, Python lambdas are only a shorthand notation if you're too lazy to define a function." -msgstr "" +msgid "" +"Python lambda expressions cannot contain statements because Python's " +"syntactic framework can't handle statements nested inside expressions. " +"However, in Python, this is not a serious problem. Unlike lambda forms in " +"other languages, where they add functionality, Python lambdas are only a " +"shorthand notation if you're too lazy to define a function." +msgstr "" +"عبارت‌های lambda پایتون نمی‌توانند شامل دستور باشند، زیرا چارچوب نحوی پایتون" +" نمی‌تواند دستورهای تودرتو درون عبارت‌ها را مدیریت کند. با این حال، در " +"پایتون، این مشکل جدی‌ای نیست. برخلاف فرم‌های lambda در زبان‌های دیگر، که " +"قابلیت‌هایی اضافه می‌کنند، lambdaهای پایتون تنها یک نمادگذاری خلاصه هستند،" +" اگر حوصله‌ی تعریف یک تابع را نداشته باشید." -msgid "Functions are already first class objects in Python, and can be declared in a local scope. Therefore the only advantage of using a lambda instead of a locally defined function is that you don't need to invent a name for the function -- but that's just a local variable to which the function object (which is exactly the same type of object that a lambda expression yields) is assigned!" -msgstr "" +msgid "" +"Functions are already first class objects in Python, and can be declared in " +"a local scope. Therefore the only advantage of using a lambda instead of a " +"locally defined function is that you don't need to invent a name for the " +"function -- but that's just a local variable to which the function object " +"(which is exactly the same type of object that a lambda expression yields) " +"is assigned!" +msgstr "" +"توابع در پایتون از پیش اشیای درجه‌یک هستند و می‌توانند در یک محدوده محلی " +"تعریف شوند. بنابراین تنها مزیت استفاده از لامبدا به جای یک تابع تعریف‌شده " +"به‌صورت محلی این است که نیازی نیست برای تابع نامی ابداع کنید -- اما آن فقط " +"یک متغیر محلی است که شیء تابع (که دقیقاً همان نوع شیئی است که یک عبارت " +"لامبدا برمی‌گرداند) به آن انتساب داده می‌شود!" msgid "Can Python be compiled to machine code, C or some other language?" -msgstr "" +msgstr "آیا پایتون می‌تواند به کد ماشین، C یا زبان دیگری کامپایل شود؟" -msgid "`Cython `_ compiles a modified version of Python with optional annotations into C extensions. `Nuitka `_ is an up-and-coming compiler of Python into C++ code, aiming to support the full Python language." +msgid "" +"`Cython `_ compiles a modified version of Python with " +"optional annotations into C extensions. `Nuitka `_ is " +"an up-and-coming compiler of Python into C++ code, aiming to support the " +"full Python language." msgstr "" +"`Cython `_ نسخه‌ای اصلاح‌شده از پایتون را با " +"حاشیه‌نویسی‌های اختیاری به افزونه‌های C کامپایل می‌کند. `Nuitka " +"`_ یک کامپایلر نوظهور برای کامپایل پایتون به کد C++ است" +" که هدف آن پشتیبانی از کل زبان پایتون است." msgid "How does Python manage memory?" -msgstr "" +msgstr "پایتون چگونه حافظه را مدیریت می‌کند؟" -msgid "The details of Python memory management depend on the implementation. The standard implementation of Python, :term:`CPython`, uses reference counting to detect inaccessible objects, and another mechanism to collect reference cycles, periodically executing a cycle detection algorithm which looks for inaccessible cycles and deletes the objects involved. The :mod:`gc` module provides functions to perform a garbage collection, obtain debugging statistics, and tune the collector's parameters." -msgstr "" +msgid "" +"The details of Python memory management depend on the implementation. The " +"standard implementation of Python, :term:`CPython`, uses reference counting " +"to detect inaccessible objects, and another mechanism to collect reference " +"cycles, periodically executing a cycle detection algorithm which looks for " +"inaccessible cycles and deletes the objects involved. The :mod:`gc` module " +"provides functions to perform a garbage collection, obtain debugging " +"statistics, and tune the collector's parameters." +msgstr "" +"جزئیات مدیریت حافظه پایتون به پیاده‌سازی بستگی دارد. پیاده‌سازی استاندارد " +"پایتون، :term:`CPython`، از شمارش ارجاع برای تشخیص اشیای دسترس‌ناپذیر و از " +"سازوکار دیگری برای جمع‌آوری چرخه‌های ارجاع استفاده می‌کند و به‌صورت دوره‌ای " +"یک الگوریتم تشخیص چرخه را اجرا می‌کند که چرخه‌های دسترس‌ناپذیر را جستجو " +"می‌کند و اشیای درگیر را حذف می‌کند. ماژول :mod:`gc` توابعی برای انجام " +"زباله‌روبی، به‌دست آوردن آمار اشکال‌زدایی و تنظیم پارامترهای جمع‌کننده ارائه" +" می‌دهد." -msgid "Other implementations (such as `Jython `_ or `PyPy `_), however, can rely on a different mechanism such as a full-blown garbage collector. This difference can cause some subtle porting problems if your Python code depends on the behavior of the reference counting implementation." -msgstr "" +msgid "" +"Other implementations (such as `Jython `_ or `PyPy " +"`_), however, can rely on a different mechanism such as a " +"full-blown garbage collector. This difference can cause some subtle porting" +" problems if your Python code depends on the behavior of the reference " +"counting implementation." +msgstr "" +"با این حال، سایر پیاده‌سازی‌ها (مانند `Jython `_ یا " +"`PyPy `_) می‌توانند به مکانیزم متفاوتی مانند یک زباله‌رو " +"(garbage collector) کامل متکی باشند. این تفاوت می‌تواند در صورتی که کد " +"پایتون شما به رفتار پیاده‌سازی شمارش مرجع وابسته باشد، باعث برخی مشکلات ظریف" +" در انتقال شود." -msgid "In some Python implementations, the following code (which is fine in CPython) will probably run out of file descriptors::" +msgid "" +"In some Python implementations, the following code (which is fine in " +"CPython) will probably run out of file descriptors::" msgstr "" +"در برخی پیاده‌سازی‌های پایتون، کد زیر (که در CPython مشکلی ندارد) احتمالاً " +"با اتمام توصیف‌گرهای فایل مواجه می‌شود::" msgid "" "for file in very_long_list_of_files:\n" " f = open(file)\n" " c = f.read(1)" msgstr "" +"for file in very_long_list_of_files:\n" +" f = open(file)\n" +" c = f.read(1)" -msgid "Indeed, using CPython's reference counting and destructor scheme, each new assignment to ``f`` closes the previous file. With a traditional GC, however, those file objects will only get collected (and closed) at varying and possibly long intervals." +msgid "" +"Indeed, using CPython's reference counting and destructor scheme, each new " +"assignment to ``f`` closes the previous file. With a traditional GC, " +"however, those file objects will only get collected (and closed) at varying " +"and possibly long intervals." msgstr "" +"در واقع، با استفاده از طرح‌واره شمارش ارجاع و تخریب‌کننده‌ی CPython، هر " +"انتساب جدید به ``f`` فایل پیشین را می‌بندد. با این حال، با یک زباله‌روبی " +"سنتی، آن اشیای فایل تنها در فاصله‌های متغیر و احتمالاً طولانی جمع‌آوری (و " +"بسته) می‌شوند." -msgid "If you want to write code that will work with any Python implementation, you should explicitly close the file or use the :keyword:`with` statement; this will work regardless of memory management scheme::" +msgid "" +"If you want to write code that will work with any Python implementation, you" +" should explicitly close the file or use the :keyword:`with` statement; this" +" will work regardless of memory management scheme::" msgstr "" +"اگر می‌خواهید کدی بنویسید که با هر پیاده‌سازی پایتون کار کند، باید فایل را " +"به‌طور صریح ببندید یا از دستور :keyword:`with` استفاده کنید؛ این صرف‌نظر از " +"طرح‌واره مدیریت حافظه کار خواهد کرد::" msgid "" "for file in very_long_list_of_files:\n" " with open(file) as f:\n" " c = f.read(1)" msgstr "" +"for file in very_long_list_of_files:\n" +" with open(file) as f:\n" +" c = f.read(1)" msgid "Why doesn't CPython use a more traditional garbage collection scheme?" -msgstr "" +msgstr "چرا CPython از یک روش زباله‌روبی سنتی‌تر استفاده نمی‌کند؟" -msgid "For one thing, this is not a C standard feature and hence it's not portable. (Yes, we know about the Boehm GC library. It has bits of assembler code for *most* common platforms, not for all of them, and although it is mostly transparent, it isn't completely transparent; patches are required to get Python to work with it.)" -msgstr "" +msgid "" +"For one thing, this is not a C standard feature and hence it's not portable." +" (Yes, we know about the Boehm GC library. It has bits of assembler code " +"for *most* common platforms, not for all of them, and although it is mostly " +"transparent, it isn't completely transparent; patches are required to get " +"Python to work with it.)" +msgstr "" +"برای نمونه، این یک ویژگی استاندارد C نیست و بنابراین قابل‌حمل نیست. (بله، ما" +" در مورد کتابخانه Boehm GC می‌دانیم. این کتابخانه بخش‌هایی از کد اسمبلر را " +"برای *بیشتر* سکوهای رایج دارد، نه برای همه‌ی آن‌ها، و اگرچه عمدتاً شفاف است، " +"کاملاً شفاف نیست؛ برای اینکه پایتون بتواند با آن کار کند، به وصله‌ها نیاز " +"است.)" -msgid "Traditional GC also becomes a problem when Python is embedded into other applications. While in a standalone Python it's fine to replace the standard ``malloc()`` and ``free()`` with versions provided by the GC library, an application embedding Python may want to have its *own* substitute for ``malloc()`` and ``free()``, and may not want Python's. Right now, CPython works with anything that implements ``malloc()`` and ``free()`` properly." -msgstr "" +msgid "" +"Traditional GC also becomes a problem when Python is embedded into other " +"applications. While in a standalone Python it's fine to replace the " +"standard ``malloc()`` and ``free()`` with versions provided by the GC " +"library, an application embedding Python may want to have its *own* " +"substitute for ``malloc()`` and ``free()``, and may not want Python's. " +"Right now, CPython works with anything that implements ``malloc()`` and " +"``free()`` properly." +msgstr "" +"زباله‌روبی سنتی نیز هنگامی که پایتون در برنامه‌های دیگر جاسازی می‌شود، به یک" +" مشکل تبدیل می‌شود. در حالی که در یک پایتون مستقل، جایگزین کردن ``malloc()``" +" و ``free()`` استاندارد با نسخه‌های ارائه‌شده توسط کتابخانه زباله‌روبی مشکلی" +" ندارد، برنامه‌ای که پایتون را جاسازی می‌کند ممکن است بخواهد جایگزین *خود* " +"را برای ``malloc()`` و ``free()`` داشته باشد و ممکن است جایگزین پایتون را " +"نخواهد. در حال حاضر، CPython با هر چیزی که ``malloc()`` و ``free()`` را " +"به‌درستی پیاده‌سازی کند، کار می‌کند." msgid "Why isn't all memory freed when CPython exits?" -msgstr "" +msgstr "چرا هنگام خروج CPython، تمام حافظه آزاد نمی‌شود؟" -msgid "Objects referenced from the global namespaces of Python modules are not always deallocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object." -msgstr "" +msgid "" +"Objects referenced from the global namespaces of Python modules are not " +"always deallocated when Python exits. This may happen if there are circular" +" references. There are also certain bits of memory that are allocated by " +"the C library that are impossible to free (e.g. a tool like Purify will " +"complain about these). Python is, however, aggressive about cleaning up " +"memory on exit and does try to destroy every single object." +msgstr "" +"اشیایی که از فضای نام های سراسری ماژول‌های پایتون به آن‌ها ارجاع داده شده‌اند،" +" همیشه هنگام خروج پایتون آزاد نمی‌شوند. ممکن است این اتفاق در صورت وجود " +"ارجاع‌های حلقوی رخ دهد. همچنین بخش‌هایی از حافظه وجود دارند که توسط کتابخانه" +" C تخصیص داده شده‌اند و آزاد کردن آن‌ها غیرممکن است (برای مثال، ابزاری مانند" +" Purify درباره‌ی این موارد شکایت خواهد کرد). با این حال، پایتون در پاک‌سازی " +"حافظه هنگام خروج بسیار جدی است و واقعاً تلاش می‌کند تک‌تک اشیاء را نابود " +"کند." -msgid "If you want to force Python to delete certain things on deallocation use the :mod:`atexit` module to run a function that will force those deletions." +msgid "" +"If you want to force Python to delete certain things on deallocation use the" +" :mod:`atexit` module to run a function that will force those deletions." msgstr "" +"اگر می‌خواهید پایتون را وادار به حذف موارد مشخصی در زمان آزادسازی حافظه " +"کنید، از ماژول :mod:`atexit` برای اجرای تابعی استفاده کنید که آن حذف‌ها را " +"اجباری خواهد کرد." msgid "Why are there separate tuple and list data types?" -msgstr "" +msgstr "چرا انواع داده‌ی جداگانه‌ای برای تاپل و فهرست وجود دارند؟" -msgid "Lists and tuples, while similar in many respects, are generally used in fundamentally different ways. Tuples can be thought of as being similar to Pascal ``records`` or C ``structs``; they're small collections of related data which may be of different types which are operated on as a group. For example, a Cartesian coordinate is appropriately represented as a tuple of two or three numbers." -msgstr "" +msgid "" +"Lists and tuples, while similar in many respects, are generally used in " +"fundamentally different ways. Tuples can be thought of as being similar to " +"Pascal ``records`` or C ``structs``; they're small collections of related " +"data which may be of different types which are operated on as a group. For " +"example, a Cartesian coordinate is appropriately represented as a tuple of " +"two or three numbers." +msgstr "" +"فهرست‌ها و تاپل‌ها، با وجود شباهت‌های زیاد، معمولاً به‌طور بنیادین به " +"شیوه‌های متفاوتی استفاده می‌شوند. می‌توان تاپل‌ها را مشابه ``records`` در " +"پاسکال یا ``structs`` در C در نظر گرفت؛ آن‌ها مجموعه‌های کوچکی از داده‌های " +"مرتبط هستند که ممکن است از انواع مختلفی باشند و به‌عنوان یک گروه بر روی " +"آن‌ها عملیات انجام می‌شود. برای مثال، یک مختصات دکارتی به‌طور مناسب به‌صورت " +"یک تاپل از ۲ یا ۳ عدد نمایش داده می‌شود." -msgid "Lists, on the other hand, are more like arrays in other languages. They tend to hold a varying number of objects all of which have the same type and which are operated on one-by-one. For example, :func:`os.listdir('.') ` returns a list of strings representing the files in the current directory. Functions which operate on this output would generally not break if you added another file or two to the directory." -msgstr "" +msgid "" +"Lists, on the other hand, are more like arrays in other languages. They " +"tend to hold a varying number of objects all of which have the same type and" +" which are operated on one-by-one. For example, :func:`os.listdir('.') " +"` returns a list of strings representing the files in the " +"current directory. Functions which operate on this output would generally " +"not break if you added another file or two to the directory." +msgstr "" +"از سوی دیگر، فهرست‌ها بیشتر به آرایه‌ها در زبان‌های دیگر شبیه‌اند. آن‌ها " +"معمولاً تعداد متغیری از شیءها را نگه می‌دارند که همگی نوع یکسانی دارند و " +"یکی‌یکی روی آن‌ها عمل می‌شود. برای مثال، :func:`os.listdir('.') " +"` فهرستی از رشته‌ها را برمی‌گرداند که فایل‌های پوشه جاری را نشان" +" می‌دهند. توابعی که روی این خروجی عمل می‌کنند، معمولاً اگر یک یا دو فایل " +"دیگر به پوشه اضافه کنید، از کار نمی‌افتند." -msgid "Tuples are immutable, meaning that once a tuple has been created, you can't replace any of its elements with a new value. Lists are mutable, meaning that you can always change a list's elements. Only immutable elements can be used as dictionary keys, and hence only tuples and not lists can be used as keys." -msgstr "" +msgid "" +"Tuples are immutable, meaning that once a tuple has been created, you can't " +"replace any of its elements with a new value. Lists are mutable, meaning " +"that you can always change a list's elements. Only immutable elements can " +"be used as dictionary keys, and hence only tuples and not lists can be used " +"as keys." +msgstr "" +"تاپل‌ها تغییرناپذیر هستند، به این معنا که پس از ایجاد یک تاپل، نمی‌توانید " +"هیچ‌یک از عناصر آن را با مقدار جدیدی جایگزین کنید. فهرست‌ها تغییرپذیر هستند،" +" به این معنا که همیشه می‌توانید عناصر یک فهرست را تغییر دهید. فقط عناصر " +"تغییرناپذیر می‌توانند به‌عنوان کلیدهای دیکشنری استفاده شوند، و بنابراین فقط " +"تاپل‌ها و نه فهرست‌ها می‌توانند به‌عنوان کلید استفاده شوند." msgid "How are lists implemented in CPython?" -msgstr "" +msgstr "فهرست‌ها در CPython چگونه پیاده‌سازی شده‌اند؟" -msgid "CPython's lists are really variable-length arrays, not Lisp-style linked lists. The implementation uses a contiguous array of references to other objects, and keeps a pointer to this array and the array's length in a list head structure." +msgid "" +"CPython's lists are really variable-length arrays, not Lisp-style linked " +"lists. The implementation uses a contiguous array of references to other " +"objects, and keeps a pointer to this array and the array's length in a list " +"head structure." msgstr "" +"فهرست‌های CPython در واقع آرایه‌هایی با طول متغیر هستند، نه فهرست‌های پیوندی" +" به‌سبک Lisp. پیاده‌سازی از آرایه‌ای پیوسته از ارجاع‌ها به اشیاء دیگر " +"استفاده می‌کند و یک اشاره‌گر به این آرایه و طول آرایه را در یک ساختار سر " +"فهرست نگه می‌دارد." -msgid "This makes indexing a list ``a[i]`` an operation whose cost is independent of the size of the list or the value of the index." +msgid "" +"This makes indexing a list ``a[i]`` an operation whose cost is independent " +"of the size of the list or the value of the index." msgstr "" +"این باعث می‌شود که اندیس‌دهی به یک فهرست ``a[i]`` عملیاتی باشد که هزینه‌ی آن " +"مستقل از اندازه‌ی فهرست یا مقدار اندیس است." -msgid "When items are appended or inserted, the array of references is resized. Some cleverness is applied to improve the performance of appending items repeatedly; when the array must be grown, some extra space is allocated so the next few times don't require an actual resize." +msgid "" +"When items are appended or inserted, the array of references is resized. " +"Some cleverness is applied to improve the performance of appending items " +"repeatedly; when the array must be grown, some extra space is allocated so " +"the next few times don't require an actual resize." msgstr "" +"هنگامی که آیتم‌ها افزوده یا درج می‌شوند، اندازه‌ی آرایه‌ی ارجاع‌ها تغییر " +"می‌کند. تمهیداتی به کار گرفته شده است تا عملکرد افزودن مکرر آیتم‌ها بهبود " +"یابد؛ هنگامی که آرایه باید بزرگ شود، مقداری فضای اضافی تخصیص داده می‌شود تا " +"چند بار بعدی نیازی به تغییر اندازه‌ی واقعی نباشد." msgid "How are dictionaries implemented in CPython?" -msgstr "" +msgstr "دیکشنری‌ها در CPython چگونه پیاده‌سازی شده‌اند؟" -msgid "CPython's dictionaries are implemented as resizable hash tables. Compared to B-trees, this gives better performance for lookup (the most common operation by far) under most circumstances, and the implementation is simpler." +msgid "" +"CPython's dictionaries are implemented as resizable hash tables. Compared " +"to B-trees, this gives better performance for lookup (the most common " +"operation by far) under most circumstances, and the implementation is " +"simpler." msgstr "" +"دیکشنری‌های CPython به‌صورت جدول‌های هش با قابلیت تغییر اندازه پیاده‌سازی " +"شده‌اند. در مقایسه با درخت‌های B، این روش در بیشتر شرایط عملکرد بهتری برای " +"جستجو (رایج‌ترین عملیات با اختلاف زیاد) ارائه می‌دهد و پیاده‌سازی ساده‌تری " +"دارد." -msgid "Dictionaries work by computing a hash code for each key stored in the dictionary using the :func:`hash` built-in function. The hash code varies widely depending on the key and a per-process seed; for example, ``'Python'`` could hash to ``-539294296`` while ``'python'``, a string that differs by a single bit, could hash to ``1142331976``. The hash code is then used to calculate a location in an internal array where the value will be stored. Assuming that you're storing keys that all have different hash values, this means that dictionaries take constant time -- *O*\\ (1), in Big-O notation -- to retrieve a key." -msgstr "" +msgid "" +"Dictionaries work by computing a hash code for each key stored in the " +"dictionary using the :func:`hash` built-in function. The hash code varies " +"widely depending on the key and a per-process seed; for example, " +"``'Python'`` could hash to ``-539294296`` while ``'python'``, a string that " +"differs by a single bit, could hash to ``1142331976``. The hash code is " +"then used to calculate a location in an internal array where the value will " +"be stored. Assuming that you're storing keys that all have different hash " +"values, this means that dictionaries take constant time -- *O*\\ (1), in " +"Big-O notation -- to retrieve a key." +msgstr "" +"دیکشنری‌ها با محاسبه‌ی کد هش (hash code) برای هر کلید ذخیره‌شده در دیکشنری، " +"از طریق تابع توکار :func:`hash` کار می‌کنند. کد هش بسته به کلید و یک بذر " +"(seed) به‌ازای هر فرایند، تفاوت زیادی دارد؛ برای مثال، کد هش ``'Python'`` " +"می‌تواند ``-539294296`` باشد، در حالی که کد هش ``'python'``، رشته‌ای که تنها" +" یک بیت تفاوت دارد، می‌تواند ``1142331976`` باشد. سپس از کد هش برای محاسبه‌ی" +" محلی در یک آرایه‌ی داخلی استفاده می‌شود که مقدار در آن ذخیره خواهد شد. با " +"فرض این‌که شما کلیدهایی را ذخیره می‌کنید که همگی مقادیر هش متفاوتی دارند، " +"این بدان معناست که دیکشنری‌ها برای بازیابی یک کلید به زمان ثابت -- *O*\\ " +"(1)، در نمادگذاری Big-O -- نیاز دارند." msgid "Why must dictionary keys be immutable?" -msgstr "" +msgstr "چرا کلیدهای دیکشنری باید تغییرناپذیر باشند؟" -msgid "The hash table implementation of dictionaries uses a hash value calculated from the key value to find the key. If the key were a mutable object, its value could change, and thus its hash could also change. But since whoever changes the key object can't tell that it was being used as a dictionary key, it can't move the entry around in the dictionary. Then, when you try to look up the same object in the dictionary it won't be found because its hash value is different. If you tried to look up the old value it wouldn't be found either, because the value of the object found in that hash bin would be different." -msgstr "" +msgid "" +"The hash table implementation of dictionaries uses a hash value calculated " +"from the key value to find the key. If the key were a mutable object, its " +"value could change, and thus its hash could also change. But since whoever " +"changes the key object can't tell that it was being used as a dictionary " +"key, it can't move the entry around in the dictionary. Then, when you try " +"to look up the same object in the dictionary it won't be found because its " +"hash value is different. If you tried to look up the old value it wouldn't " +"be found either, because the value of the object found in that hash bin " +"would be different." +msgstr "" +"پیاده‌سازی جدول هش دیکشنری‌ها از یک مقدار هش محاسبه‌شده از مقدار کلید برای " +"پیدا کردن کلید استفاده می‌کند. اگر کلید یک شیء تغییرپذیر باشد، ممکن است " +"مقدار آن تغییر کند و در نتیجه هش آن نیز ممکن است تغییر کند. اما از آنجا که " +"هرکسی که شیء کلید را تغییر می‌دهد نمی‌تواند تشخیص دهد که از آن به‌عنوان کلید" +" دیکشنری استفاده می‌شده است، نمی‌تواند آیتم را در دیکشنری جابه‌جا کند. سپس، " +"وقتی سعی کنید همان شیء را در دیکشنری جستجو کنید، پیدا نخواهد شد، زیرا مقدار " +"هش آن متفاوت است. اگر سعی کنید مقدار قدیمی را جستجو کنید، آن هم پیدا نخواهد " +"شد، زیرا مقدار شیء یافت‌شده در آن سطل هش (hash bin) متفاوت خواهد بود." -msgid "If you want a dictionary indexed with a list, simply convert the list to a tuple first; the function ``tuple(L)`` creates a tuple with the same entries as the list ``L``. Tuples are immutable and can therefore be used as dictionary keys." +msgid "" +"If you want a dictionary indexed with a list, simply convert the list to a " +"tuple first; the function ``tuple(L)`` creates a tuple with the same entries" +" as the list ``L``. Tuples are immutable and can therefore be used as " +"dictionary keys." msgstr "" +"اگر دیکشنری‌ای می‌خواهید که با فهرست اندیس‌دهی شده باشد، کافی است ابتدا " +"فهرست را به تاپل تبدیل کنید؛ تابع ``tuple(L)`` تاپلی با همان آیتم‌های فهرست " +"``L`` می‌سازد. تاپل‌ها تغییرناپذیرند و بنابراین می‌توانند به‌عنوان کلیدهای " +"دیکشنری استفاده شوند." msgid "Some unacceptable solutions that have been proposed:" -msgstr "" +msgstr "برخی راه‌حل‌های غیرقابل‌قبول که پیشنهاد شده‌اند:" -msgid "Hash lists by their address (object ID). This doesn't work because if you construct a new list with the same value it won't be found; e.g.::" +msgid "" +"Hash lists by their address (object ID). This doesn't work because if you " +"construct a new list with the same value it won't be found; e.g.::" msgstr "" +"هش کردن فهرست‌ها بر اساس نشانی‌شان (شناسه‌ی شیء). این روش کار نمی‌کند، زیرا " +"اگر فهرست جدیدی با همان مقدار ایجاد کنید، پیدا نخواهد شد؛ برای مثال::" msgid "" "mydict = {[1, 2]: '12'}\n" "print(mydict[[1, 2]])" msgstr "" +"mydict = {[1, 2]: '12'}\n" +"print(mydict[[1, 2]])" -msgid "would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` used in the second line differs from that in the first line. In other words, dictionary keys should be compared using ``==``, not using :keyword:`is`." +msgid "" +"would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " +"used in the second line differs from that in the first line. In other " +"words, dictionary keys should be compared using ``==``, not using " +":keyword:`is`." msgstr "" +"استثنای :exc:`KeyError` را پرتاب می‌کند، زیرا شناسه‌ی ``[1, 2]`` استفاده‌شده" +" در خط دوم با شناسه‌ی آن در خط اول متفاوت است. به عبارت دیگر، کلیدهای " +"دیکشنری باید با استفاده از ``==`` مقایسه شوند، نه با استفاده از " +":keyword:`is`." -msgid "Make a copy when using a list as a key. This doesn't work because the list, being a mutable object, could contain a reference to itself, and then the copying code would run into an infinite loop." +msgid "" +"Make a copy when using a list as a key. This doesn't work because the list," +" being a mutable object, could contain a reference to itself, and then the " +"copying code would run into an infinite loop." msgstr "" +"هنگام استفاده از یک فهرست به‌عنوان کلید، یک کپی بسازید. این روش کار نمی‌کند،" +" زیرا فهرست به‌عنوان یک شیء تغییرپذیر می‌تواند شامل ارجاعی به خودش باشد و در" +" آن صورت کد کپی‌سازی وارد یک حلقه بی‌پایان می‌شود." -msgid "Allow lists as keys but tell the user not to modify them. This would allow a class of hard-to-track bugs in programs when you forgot or modified a list by accident. It also invalidates an important invariant of dictionaries: every value in ``d.keys()`` is usable as a key of the dictionary." +msgid "" +"Allow lists as keys but tell the user not to modify them. This would allow " +"a class of hard-to-track bugs in programs when you forgot or modified a list" +" by accident. It also invalidates an important invariant of dictionaries: " +"every value in ``d.keys()`` is usable as a key of the dictionary." msgstr "" +"اجازه دهید فهرست‌ها به‌عنوان کلید استفاده شوند، اما به کاربر بگویید آن‌ها را" +" تغییر ندهد. هنگامی که فراموش کنید یا فهرستی را به‌اشتباه تغییر دهید، این " +"کار موجب ایجاد دسته‌ای از باگ‌ها در برنامه‌ها می‌شود که پیگیری آن‌ها دشوار " +"است. همچنین یک ناوردا مهم دیکشنری‌ها را باطل می‌کند: هر مقدار موجود در " +"``d.keys()`` را می‌توان به‌عنوان کلید دیکشنری استفاده کرد." -msgid "Mark lists as read-only once they are used as a dictionary key. The problem is that it's not just the top-level object that could change its value; you could use a tuple containing a list as a key. Entering anything as a key into a dictionary would require marking all objects reachable from there as read-only -- and again, self-referential objects could cause an infinite loop." -msgstr "" +msgid "" +"Mark lists as read-only once they are used as a dictionary key. The problem" +" is that it's not just the top-level object that could change its value; you" +" could use a tuple containing a list as a key. Entering anything as a key " +"into a dictionary would require marking all objects reachable from there as " +"read-only -- and again, self-referential objects could cause an infinite " +"loop." +msgstr "" +"فهرست‌ها را به‌محض استفاده از آن‌ها به‌عنوان کلید دیکشنری، فقط‌خواندنی " +"علامت‌گذاری کنید. مشکل این است که تنها شیء سطح‌بالا نیست که ممکن است مقدارش " +"تغییر کند؛ شما می‌توانید از یک تاپل حاوی یک فهرست به‌عنوان کلید استفاده " +"کنید. وارد کردن هر چیز به‌عنوان کلید در یک دیکشنری، مستلزم علامت‌گذاری تمام " +"اشیای قابل‌دسترس از آنجا به‌عنوان فقط‌خواندنی است — و باز هم، اشیای خودارجاع" +" می‌توانند باعث ایجاد یک حلقه بی‌پایان شوند." -msgid "There is a trick to get around this if you need to, but use it at your own risk: You can wrap a mutable structure inside a class instance which has both a :meth:`~object.__eq__` and a :meth:`~object.__hash__` method. You must then make sure that the hash value for all such wrapper objects that reside in a dictionary (or other hash based structure), remain fixed while the object is in the dictionary (or other structure). ::" -msgstr "" +msgid "" +"There is a trick to get around this if you need to, but use it at your own " +"risk: You can wrap a mutable structure inside a class instance which has " +"both a :meth:`~object.__eq__` and a :meth:`~object.__hash__` method. You " +"must then make sure that the hash value for all such wrapper objects that " +"reside in a dictionary (or other hash based structure), remain fixed while " +"the object is in the dictionary (or other structure). ::" +msgstr "" +"ترفندی برای دور زدن این موضوع وجود دارد که در صورت نیاز می‌توانید از آن " +"استفاده کنید، اما با مسئولیت خودتان: می‌توانید یک ساختار تغییرپذیر را درون " +"یک نمونه کلاس بپیچید که هر دو متد :meth:`~object.__eq__` و " +":meth:`~object.__hash__` را دارد. سپس باید اطمینان حاصل کنید که مقدار هش " +"برای همه اشیاء پوششی از این قبیل که در یک دیکشنری (یا ساختار مبتنی بر هش " +"دیگر) قرار دارند، تا زمانی که شیء در دیکشنری (یا ساختار دیگر) است، ثابت " +"بماند. ::" msgid "" "class ListWrapper:\n" @@ -417,59 +1033,208 @@ msgid "" " result = (result % 7777777) + i * 333\n" " return result" msgstr "" +"class ListWrapper:\n" +" def __init__(self, the_list):\n" +" self.the_list = the_list\n" +"\n" +" def __eq__(self, other):\n" +" return self.the_list == other.the_list\n" +"\n" +" def __hash__(self):\n" +" l = self.the_list\n" +" result = 98767 - len(l)*555\n" +" for i, el in enumerate(l):\n" +" try:\n" +" result = result + (hash(el) % 9999999) * 1001 + i\n" +" except Exception:\n" +" result = (result % 7777777) + i * 333\n" +" return result" -msgid "Note that the hash computation is complicated by the possibility that some members of the list may be unhashable and also by the possibility of arithmetic overflow." +msgid "" +"Note that the hash computation is complicated by the possibility that some " +"members of the list may be unhashable and also by the possibility of " +"arithmetic overflow." msgstr "" +"توجه داشته باشید که محاسبه‌ی هش به دلیل احتمال هش‌ناپذیر بودن برخی اعضای " +"فهرست و نیز احتمال سرریز محاسباتی، پیچیده است." -msgid "Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1.__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == o2.__hash__()``), regardless of whether the object is in a dictionary or not. If you fail to meet these restrictions dictionaries and other hash based structures will misbehave." -msgstr "" +msgid "" +"Furthermore it must always be the case that if ``o1 == o2`` (ie " +"``o1.__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, " +"``o1.__hash__() == o2.__hash__()``), regardless of whether the object is in " +"a dictionary or not. If you fail to meet these restrictions dictionaries " +"and other hash based structures will misbehave." +msgstr "" +"علاوه بر این، همیشه باید اگر ``o1 == o2`` (یعنی ``o1.__eq__(o2) is True``)، " +"آنگاه ``hash(o1) == hash(o2)`` (یعنی ``o1.__hash__() == o2.__hash__()``) " +"برقرار باشد، صرف‌نظر از این‌که شیء در یک دیکشنری باشد یا نه. اگر این " +"محدودیت‌ها را رعایت نکنید، دیکشنری‌ها و سایر ساختارهای مبتنی بر هش به‌درستی " +"کار نخواهند کرد." -msgid "In the case of :class:`!ListWrapper`, whenever the wrapper object is in a dictionary the wrapped list must not change to avoid anomalies. Don't do this unless you are prepared to think hard about the requirements and the consequences of not meeting them correctly. Consider yourself warned." +msgid "" +"In the case of :class:`!ListWrapper`, whenever the wrapper object is in a " +"dictionary the wrapped list must not change to avoid anomalies. Don't do " +"this unless you are prepared to think hard about the requirements and the " +"consequences of not meeting them correctly. Consider yourself warned." msgstr "" +"در مورد :class:`!ListWrapper`، هر گاه شیء پوششی در یک دیکشنری باشد، فهرست " +"پوشیده‌شده نباید تغییر کند تا از ناهنجاری‌ها جلوگیری شود. این کار را انجام " +"ندهید مگر آنکه آماده باشید تا درباره الزامات و پیامدهای برآورده نکردن صحیح " +"آن‌ها به‌دقت بیندیشید. خود را هشدار داده‌شده بدانید." msgid "Why doesn't list.sort() return the sorted list?" -msgstr "" +msgstr "چرا list.sort() فهرست مرتب‌شده را برنمی‌گرداند؟" -msgid "In situations where performance matters, making a copy of the list just to sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in place. In order to remind you of that fact, it does not return the sorted list. This way, you won't be fooled into accidentally overwriting a list when you need a sorted copy but also need to keep the unsorted version around." -msgstr "" +msgid "" +"In situations where performance matters, making a copy of the list just to " +"sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in " +"place. In order to remind you of that fact, it does not return the sorted " +"list. This way, you won't be fooled into accidentally overwriting a list " +"when you need a sorted copy but also need to keep the unsorted version " +"around." +msgstr "" +"در موقعیت‌هایی که کارایی اهمیت دارد، ساختن یک کپی از فهرست صرفاً برای " +"مرتب‌سازی آن، اتلاف منابع خواهد بود. بنابراین، :meth:`list.sort` فهرست را " +"درجا مرتب می‌کند. برای یادآوری همین موضوع، فهرست مرتب‌شده را برنمی‌گرداند. " +"به این ترتیب، وقتی به یک کپی مرتب‌شده نیاز دارید اما همزمان باید نسخه‌ی " +"مرتب‌نشده را نیز نگه دارید، دچار این اشتباه نخواهید شد که به‌طور تصادفی یک " +"فهرست را بازنویسی کنید." -msgid "If you want to return a new list, use the built-in :func:`sorted` function instead. This function creates a new list from a provided iterable, sorts it and returns it. For example, here's how to iterate over the keys of a dictionary in sorted order::" +msgid "" +"If you want to return a new list, use the built-in :func:`sorted` function " +"instead. This function creates a new list from a provided iterable, sorts " +"it and returns it. For example, here's how to iterate over the keys of a " +"dictionary in sorted order::" msgstr "" +"اگر می‌خواهید یک فهرست جدید برگردانید، به‌جای آن از تابع توکار " +":func:`sorted` استفاده کنید. این تابع از یک پیمایش‌پذیر ارائه‌شده یک فهرست " +"جدید ایجاد می‌کند، آن را مرتب می‌کند و برمی‌گرداند. برای مثال، در اینجا " +"چگونگی پیمایش روی کلیدهای یک دیکشنری با ترتیب مرتب‌شده آمده است::" msgid "" "for key in sorted(mydict):\n" " ... # do whatever with mydict[key]..." msgstr "" +"for key in sorted(mydict):\n" +" ... # do whatever with mydict[key]..." msgid "How do you specify and enforce an interface spec in Python?" -msgstr "" +msgstr "چگونه مشخصات یک رابط را در پایتون تعیین و اعمال می‌کنید؟" -msgid "An interface specification for a module as provided by languages such as C++ and Java describes the prototypes for the methods and functions of the module. Many feel that compile-time enforcement of interface specifications helps in the construction of large programs." +msgid "" +"An interface specification for a module as provided by languages such as C++" +" and Java describes the prototypes for the methods and functions of the " +"module. Many feel that compile-time enforcement of interface specifications" +" helps in the construction of large programs." msgstr "" +"مشخصات رابط برای یک ماژول، همان‌طور که توسط زبان‌هایی مانند C++ و Java ارائه" +" می‌شود، پیش‌نمونه‌های متدها و توابع آن ماژول را توصیف می‌کند. بسیاری بر این" +" باورند که اعمال مشخصات رابط در زمان کامپایل، به ساخت برنامه‌های بزرگ کمک " +"می‌کند." -msgid "Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check whether an instance or a class implements a particular ABC. The :mod:`collections.abc` module defines a set of useful ABCs such as :class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and :class:`~collections.abc.MutableMapping`." -msgstr "" +msgid "" +"Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base " +"Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` " +"to check whether an instance or a class implements a particular ABC. The " +":mod:`collections.abc` module defines a set of useful ABCs such as " +":class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and" +" :class:`~collections.abc.MutableMapping`." +msgstr "" +"پایتون 2.6 ماژول :mod:`abc` را اضافه می‌کند که به شما امکان می‌دهد کلاس‌های " +"پایه انتزاعی (ABCs) را تعریف کنید. سپس می‌توانید از :func:`isinstance` و " +":func:`issubclass` برای بررسی اینکه آیا یک نمونه یا کلاس یک ABC خاص را " +"پیاده‌سازی می‌کند، استفاده کنید. ماژول :mod:`collections.abc` مجموعه‌ای از " +"ABCهای مفید را تعریف می‌کند، مانند :class:`~collections.abc.Iterable`، " +":class:`~collections.abc.Container` و " +":class:`~collections.abc.MutableMapping`." -msgid "For Python, many of the advantages of interface specifications can be obtained by an appropriate test discipline for components." +msgid "" +"For Python, many of the advantages of interface specifications can be " +"obtained by an appropriate test discipline for components." msgstr "" +"در پایتون، بسیاری از مزایای مشخصات رابط را می‌توان با نظم آزمون مناسب برای " +"کامپوننت‌ها به دست آورد." -msgid "A good test suite for a module can both provide a regression test and serve as a module interface specification and a set of examples. Many Python modules can be run as a script to provide a simple \"self test.\" Even modules which use complex external interfaces can often be tested in isolation using trivial \"stub\" emulations of the external interface. The :mod:`doctest` and :mod:`unittest` modules or third-party test frameworks can be used to construct exhaustive test suites that exercise every line of code in a module." -msgstr "" +msgid "" +"A good test suite for a module can both provide a regression test and serve " +"as a module interface specification and a set of examples. Many Python " +"modules can be run as a script to provide a simple \"self test.\" Even " +"modules which use complex external interfaces can often be tested in " +"isolation using trivial \"stub\" emulations of the external interface. The " +":mod:`doctest` and :mod:`unittest` modules or third-party test frameworks " +"can be used to construct exhaustive test suites that exercise every line of " +"code in a module." +msgstr "" +"یک مجموعه آزمون خوب برای یک ماژول می‌تواند هم یک آزمون رگرسیون فراهم کند و هم " +"به‌عنوان مشخصات رابط ماژول و مجموعه‌ای از مثال‌ها عمل کند. بسیاری از " +"ماژول‌های پایتون می‌توانند به‌صورت یک اسکریپت اجرا شوند تا یک «خودآزمایی» " +"ساده فراهم کنند. حتی ماژول‌هایی که از رابط‌های خارجی پیچیده استفاده می‌کنند،" +" اغلب می‌توانند با استفاده از stub ساده (stub) برای رابط خارجی، " +"به‌صورت مجزا آزمون شوند. می‌توان از ماژول‌های :mod:`doctest` و :mod:`unittest`" +" یا چارچوب‌های آزمون شخص ثالث برای ساخت مجموعه‌های آزمون جامعی استفاده کرد که هر" +" خط از کد یک ماژول را اجرا می‌کنند." -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 add new elements to the end of some internal list; an interface 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 "" +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 " +"add new elements to the end of some internal list; an interface " +"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 "" +"یک رویه مناسب آزمون، همان‌طور که داشتن مشخصات رابط کمک می‌کند، می‌تواند به " +"ساخت برنامه‌های بزرگ و پیچیده در پایتون کمک کند. در واقع، می‌تواند بهتر " +"باشد، زیرا مشخصات رابط نمی‌تواند برخی از ویژگی‌های یک برنامه را آزمون کند. " +"برای مثال، انتظار می‌رود متد :meth:`list.append` عناصر جدید را به انتهای یک " +"فهرست داخلی اضافه کند؛ مشخصات رابط نمی‌تواند آزمون کند که پیاده‌سازی " +":meth:`list.append` شما واقعاً این کار را به‌درستی انجام خواهد داد، اما " +"بررسی این ویژگی در یک مجموعه آزمون بسیار ساده است." -msgid "Writing test suites is very helpful, and you might want to design your code to make it easily tested. One increasingly popular technique, test-driven development, calls for writing parts of the test suite first, before you write any of the actual code. Of course Python allows you to be sloppy and not write test cases at all." -msgstr "" +msgid "" +"Writing test suites is very helpful, and you might want to design your code " +"to make it easily tested. One increasingly popular technique, test-driven " +"development, calls for writing parts of the test suite first, before you " +"write any of the actual code. Of course Python allows you to be sloppy and " +"not write test cases at all." +msgstr "" +"نوشتن مجموعه‌های آزمون بسیار مفید است، و شاید بخواهید کد خود را به‌گونه‌ای " +"طراحی کنید که به‌راحتی آزمون شود. یکی از تکنیک‌هایی که به‌طور فزاینده‌ای محبوب" +" شده است، توسعه آزمون‌محور است که ایجاب می‌کند ابتدا بخش‌هایی از مجموعه آزمون را" +" بنویسید، پیش از آنکه هیچ‌یک از کد واقعی را بنویسید. البته پایتون به شما " +"اجازه می‌دهد که سهل‌انگار باشید و اصلاً هیچ مورد آزمونی ننویسید." msgid "Why is there no goto?" -msgstr "" +msgstr "چرا goto وجود ندارد؟" -msgid "In the 1970s people realized that unrestricted goto could lead to messy \"spaghetti\" code that was hard to understand and revise. In a high-level language, it is also unneeded as long as there are ways to branch (in Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:`while` and :keyword:`for` statements, possibly containing :keyword:`continue` and :keyword:`break`)." -msgstr "" +msgid "" +"In the 1970s people realized that unrestricted goto could lead to messy " +"\"spaghetti\" code that was hard to understand and revise. In a high-level " +"language, it is also unneeded as long as there are ways to branch (in " +"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, and" +" :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:`while` " +"and :keyword:`for` statements, possibly containing :keyword:`continue` and " +":keyword:`break`)." +msgstr "" +"در دهه‌ی ۱۹۷۰، مشخص شد که goto بدون محدودیت می‌توانست به کد آشفته‌ی «اسپاگتی» " +"منجر شود که درک و اصلاح آن دشوار بود. در یک زبان سطح بالا نیز، تا زمانی که " +"راه‌هایی برای انشعاب (در پایتون، با دستورهای :keyword:`if` و عبارت‌های " +":keyword:`or`، :keyword:`and` و :keyword:`if`/:keyword:`else`) و حلقه (با " +"دستورهای :keyword:`while` و :keyword:`for`، که ممکن است شامل " +":keyword:`continue` و :keyword:`break` باشند) وجود داشته باشد، نیازی به آن " +"نیست." -msgid "One can also use exceptions to provide a \"structured goto\" that works even across function calls. Many feel that exceptions can conveniently emulate all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and other languages. For example::" +msgid "" +"One can also use exceptions to provide a \"structured goto\" that works even" +" across function calls. Many feel that exceptions can conveniently emulate " +"all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and " +"other languages. For example::" msgstr "" +"همچنین می‌توان از استثناها برای فراهم کردن یک «goto ساختاریافته» استفاده " +"کرد که حتی میان فراخوانی‌های تابع نیز کار می‌کند. بسیاری بر این باورند که " +"استثناها می‌توانند به‌راحتی تمام استفاده‌های معقول از ساختارهای ``go`` یا " +"``goto`` در C، Fortran و زبان‌های دیگر را شبیه‌سازی کنند. برای مثال::" msgid "" "class label(Exception): pass # declare a label\n" @@ -482,78 +1247,169 @@ msgid "" " pass\n" "..." msgstr "" +"class label(Exception): pass # declare a label\n" +"\n" +"try:\n" +" ...\n" +" if condition: raise label() # goto label\n" +" ...\n" +"except label: # where to goto\n" +" pass\n" +"..." -msgid "This doesn't allow you to jump into the middle of a loop, but that's usually considered an abuse of ``goto`` anyway. Use sparingly." +msgid "" +"This doesn't allow you to jump into the middle of a loop, but that's usually" +" considered an abuse of ``goto`` anyway. Use sparingly." msgstr "" +"این به شما اجازه نمی‌دهد به وسط یک حلقه بپرید، اما به هر حال چنین کاری " +"معمولاً سوءاستفاده از ``goto`` تلقی می‌شود. با احتیاط استفاده کنید." msgid "Why can't raw strings (r-strings) end with a backslash?" -msgstr "" +msgstr "چرا رشته‌های خام (r-strings) نمی‌توانند با بک‌اسلش پایان یابند؟" -msgid "More precisely, they can't end with an odd number of backslashes: the unpaired backslash at the end escapes the closing quote character, leaving an unterminated string." +msgid "" +"More precisely, they can't end with an odd number of backslashes: the " +"unpaired backslash at the end escapes the closing quote character, leaving " +"an unterminated string." msgstr "" +"دقیق‌تر، آن‌ها نمی‌توانند با تعداد فردی از بک‌اسلش‌ها پایان یابند: بک‌اسلش " +"جفت‌نشده در انتها، نویسه‌ی علامت نقل‌قول پایانی را خنثی می‌کند و باعث می‌شود " +"رشته‌ای پایان‌نیافته باقی بماند." -msgid "Raw strings were designed to ease creating input for processors (chiefly regular expression engines) that want to do their own backslash escape processing. Such processors consider an unmatched trailing backslash to be an error anyway, so raw strings disallow that. In return, they allow you to pass on the string quote character by escaping it with a backslash. These rules work well when r-strings are used for their intended purpose." -msgstr "" +msgid "" +"Raw strings were designed to ease creating input for processors (chiefly " +"regular expression engines) that want to do their own backslash escape " +"processing. Such processors consider an unmatched trailing backslash to be " +"an error anyway, so raw strings disallow that. In return, they allow you to" +" pass on the string quote character by escaping it with a backslash. These " +"rules work well when r-strings are used for their intended purpose." +msgstr "" +"رشته‌های خام برای آسان‌تر کردن ایجاد ورودی برای پردازنده‌هایی (عمدتاً " +"موتورهای عبارت باقاعده) طراحی شده‌اند که می‌خواهند پردازش خنثی‌سازی بک‌اسلش " +"خودشان را انجام دهند. این پردازنده‌ها در هر حال یک بک‌اسلش انتهایی بدون " +"تطابق را خطا می‌دانند، بنابراین رشته‌های خام آن را مجاز نمی‌شمارند. در عوض، " +"به شما اجازه می‌دهند که نویسه‌ی نقل‌قول رشته را با خنثی کردن آن به‌وسیله‌ی یک " +"بک‌اسلش منتقل کنید. این قوانین زمانی که رشته‌های r برای هدف مورد نظرشان " +"استفاده شوند، به‌خوبی کار می‌کنند." -msgid "If you're trying to build Windows pathnames, note that all Windows system calls accept forward slashes too::" +msgid "" +"If you're trying to build Windows pathnames, note that all Windows system " +"calls accept forward slashes too::" msgstr "" +"اگر در حال تلاش برای ساخت مسیرهای ویندوزی هستید، توجه داشته باشید که همه " +"فراخوانی‌های سیستمی ویندوز نیز اسلش‌های رو به جلو را می‌پذیرند::" msgid "f = open(\"/mydir/file.txt\") # works fine!" -msgstr "" +msgstr "f = open(\"/mydir/file.txt\") # به‌درستی کار می‌کند!" -msgid "If you're trying to build a pathname for a DOS command, try e.g. one of ::" +msgid "" +"If you're trying to build a pathname for a DOS command, try e.g. one of ::" msgstr "" +"اگر می‌خواهید یک مسیر برای دستور DOS بسازید، برای مثال یکی از موارد زیر را " +"امتحان کنید ::" msgid "" "dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n" "dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n" "dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\"" msgstr "" +"dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n" +"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n" +"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\"" msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" -msgstr "" +msgstr "چرا پایتون یک دستور \"with\" برای انتساب ویژگی‌ها ندارد؟" -msgid "Python has a :keyword:`with` statement that wraps the execution of a block, calling code on the entrance and exit from the block. Some languages have a construct that looks like this::" +msgid "" +"Python has a :keyword:`with` statement that wraps the execution of a block, " +"calling code on the entrance and exit from the block. Some languages have a" +" construct that looks like this::" msgstr "" +"پایتون یک دستور :keyword:`with` دارد که اجرای یک بلوک را دربر می‌گیرد و کدی " +"را در هنگام ورود به بلوک و خروج از آن فراخوانی می‌کند. برخی زبان‌ها ساختاری " +"دارند که به این شکل است::" msgid "" "with obj:\n" " a = 1 # equivalent to obj.a = 1\n" " total = total + 1 # obj.total = obj.total + 1" msgstr "" +"with obj:\n" +" a = 1 # equivalent to obj.a = 1\n" +" total = total + 1 # obj.total = obj.total + 1" msgid "In Python, such a construct would be ambiguous." -msgstr "" +msgstr "در پایتون، چنین ساختاری مبهم خواهد بود." -msgid "Other languages, such as Object Pascal, Delphi, and C++, use static types, so it's possible to know, in an unambiguous way, what member is being assigned to. This is the main point of static typing -- the compiler *always* knows the scope of every variable at compile time." +msgid "" +"Other languages, such as Object Pascal, Delphi, and C++, use static types, " +"so it's possible to know, in an unambiguous way, what member is being " +"assigned to. This is the main point of static typing -- the compiler " +"*always* knows the scope of every variable at compile time." msgstr "" +"زبان‌های دیگر، مانند Object Pascal، Delphi و C++، از انواع ایستا استفاده " +"می‌کنند، بنابراین می‌توان به‌شکلی بدون ابهام دانست که به کدام عضو انتساب " +"صورت می‌گیرد. این نکته اصلی نوع‌دهی ایستا است — کامپایلر *همیشه* محدوده هر " +"متغیر را در زمان کامپایل می‌داند." -msgid "Python uses dynamic types. It is impossible to know in advance which attribute will be referenced at runtime. Member attributes may be added or removed from objects on the fly. This makes it impossible to know, from a simple reading, what attribute is being referenced: a local one, a global one, or a member attribute?" -msgstr "" +msgid "" +"Python uses dynamic types. It is impossible to know in advance which " +"attribute will be referenced at runtime. Member attributes may be added or " +"removed from objects on the fly. This makes it impossible to know, from a " +"simple reading, what attribute is being referenced: a local one, a global " +"one, or a member attribute?" +msgstr "" +"پایتون از انواع پویا استفاده می‌کند. نمی‌توان از قبل دانست که در ران‌تایم به" +" کدام ویژگی ارجاع داده خواهد شد. ویژگی‌های عضو ممکن است در لحظه به شیء‌ها " +"اضافه یا از آن‌ها حذف شوند. این موضوع باعث می‌شود نتوان از یک خواندن ساده " +"فهمید که به کدام ویژگی ارجاع داده می‌شود: یک ویژگی محلی، یک ویژگی سراسری، یا" +" یک ویژگی عضو؟" msgid "For instance, take the following incomplete snippet::" -msgstr "" +msgstr "برای مثال، قطعه‌کد ناقص زیر را در نظر بگیرید::" msgid "" "def foo(a):\n" " with a:\n" " print(x)" msgstr "" +"def foo(a):\n" +" with a:\n" +" print(x)" -msgid "The snippet assumes that ``a`` must have a member attribute called ``x``. However, there is nothing in Python that tells the interpreter this. What should happen if ``a`` is, let us say, an integer? If there is a global variable named ``x``, will it be used inside the :keyword:`with` block? As you see, the dynamic nature of Python makes such choices much harder." -msgstr "" +msgid "" +"The snippet assumes that ``a`` must have a member attribute called ``x``. " +"However, there is nothing in Python that tells the interpreter this. What " +"should happen if ``a`` is, let us say, an integer? If there is a global " +"variable named ``x``, will it be used inside the :keyword:`with` block? As " +"you see, the dynamic nature of Python makes such choices much harder." +msgstr "" +"این قطعه کد فرض می‌کند که ``a`` باید یک ویژگی عضو به نام ``x`` داشته باشد. " +"با این حال، هیچ چیزی در پایتون وجود ندارد که این موضوع را به مفسر بگوید. اگر" +" ``a``، مثلاً، یک عدد صحیح باشد، چه اتفاقی باید بیفتد؟ اگر یک متغیر سراسری " +"به نام ``x`` وجود داشته باشد، آیا در داخل بلوک :keyword:`with` از آن استفاده" +" خواهد شد؟ همان‌طور که می‌بینید، ماهیت پویای پایتون چنین انتخاب‌هایی را " +"بسیار دشوارتر می‌کند." -msgid "The primary benefit of :keyword:`with` and similar language features (reduction of code volume) can, however, easily be achieved in Python by assignment. Instead of::" +msgid "" +"The primary benefit of :keyword:`with` and similar language features " +"(reduction of code volume) can, however, easily be achieved in Python by " +"assignment. Instead of::" msgstr "" +"با این حال، مزیت اصلی :keyword:`with` و ویژگی‌های زبانی مشابه (کاهش حجم کد) " +"را می‌توان به‌راحتی در پایتون با انتساب به دست آورد. به‌جای::" msgid "" "function(args).mydict[index][index].a = 21\n" "function(args).mydict[index][index].b = 42\n" "function(args).mydict[index][index].c = 63" msgstr "" +"function(args).mydict[index][index].a = 21\n" +"function(args).mydict[index][index].b = 42\n" +"function(args).mydict[index][index].c = 63" msgid "write this::" -msgstr "" +msgstr "این را بنویسید::" msgid "" "ref = function(args).mydict[index][index]\n" @@ -561,49 +1417,103 @@ msgid "" "ref.b = 42\n" "ref.c = 63" msgstr "" +"ref = function(args).mydict[index][index]\n" +"ref.a = 21\n" +"ref.b = 42\n" +"ref.c = 63" -msgid "This also has the side-effect of increasing execution speed because name bindings are resolved at run-time in Python, and the second version only needs to perform the resolution once." +msgid "" +"This also has the side-effect of increasing execution speed because name " +"bindings are resolved at run-time in Python, and the second version only " +"needs to perform the resolution once." msgstr "" +"این موضوع همچنین اثر جانبی افزایش سرعت اجرا را دارد، زیرا پیوندهای نام " +"(name bindings) در پایتون در ران‌تایم حل می‌شوند و نسخه دوم تنها لازم است " +"این حل را یک بار انجام دهد." -msgid "Similar proposals that would introduce syntax to further reduce code volume, such as using a 'leading dot', have been rejected in favour of explicitness (see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." +msgid "" +"Similar proposals that would introduce syntax to further reduce code volume," +" such as using a 'leading dot', have been rejected in favour of explicitness" +" (see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." msgstr "" +"پیشنهادهای مشابهی که سینتکسی را برای کاهش بیشتر حجم کد معرفی می‌کردند، مانند" +" استفاده از «نقطه آغازین»، به نفع صراحت رد شده‌اند (به " +"https://mail.python.org/pipermail/python-ideas/2016-May/040070.html مراجعه " +"کنید)." msgid "Why don't generators support the with statement?" -msgstr "" +msgstr "چرا تولیدگرها از دستور with پشتیبانی نمی‌کنند؟" -msgid "For technical reasons, a generator used directly as a context manager would not work correctly. When, as is most common, a generator is used as an iterator run to completion, no closing is needed. When it is, wrap it as :func:`contextlib.closing(generator) ` in the :keyword:`with` statement." -msgstr "" +msgid "" +"For technical reasons, a generator used directly as a context manager would " +"not work correctly. When, as is most common, a generator is used as an " +"iterator run to completion, no closing is needed. When it is, wrap it as " +":func:`contextlib.closing(generator) ` in the " +":keyword:`with` statement." +msgstr "" +"به دلایل فنی، تولیدگری که به‌طور مستقیم به‌عنوان مدیر زمینه استفاده شود، " +"به‌درستی کار نخواهد کرد. هنگامی که، همان‌طور که رایج‌ترین حالت است، یک " +"تولیدگر به‌عنوان پیمایش‌گرای استفاده می‌شود که تا پایان اجرا می‌شود، نیازی" +" به بستن نیست. هرگاه لازم باشد، آن را در دستور :keyword:`with` به‌صورت " +":func:`contextlib.closing(generator) ` قرار دهید." msgid "Why are colons required for the if/while/def/class statements?" -msgstr "" +msgstr "چرا دونقطه‌ها برای دستورات if/while/def/class الزامی هستند؟" -msgid "The colon is required primarily to enhance readability (one of the results of the experimental ABC language). Consider this::" +msgid "" +"The colon is required primarily to enhance readability (one of the results " +"of the experimental ABC language). Consider this::" msgstr "" +"دونقطه عمدتاً برای افزایش خوانایی لازم است (یکی از نتایج زبان آزمایشی ABC). " +"این را در نظر بگیرید::" msgid "" "if a == b\n" " print(a)" msgstr "" +"if a == b\n" +" print(a)" msgid "versus ::" -msgstr "" +msgstr "در مقایسه با ::" msgid "" "if a == b:\n" " print(a)" msgstr "" +"if a == b:\n" +" print(a)" -msgid "Notice how the second one is slightly easier to read. Notice further how a colon sets off the example in this FAQ answer; it's a standard usage in English." +msgid "" +"Notice how the second one is slightly easier to read. Notice further how a " +"colon sets off the example in this FAQ answer; it's a standard usage in " +"English." msgstr "" +"توجه کنید که چگونه مورد دوم کمی آسان‌تر خوانده می‌شود. همچنین توجه کنید که " +"چگونه یک دونقطه مثال را در این پاسخِ پرسش‌های متداول (FAQ) جدا می‌کند؛ این " +"یک کاربرد استاندارد در زبان انگلیسی است." -msgid "Another minor reason is that the colon makes it easier for editors with syntax highlighting; they can look for colons to decide when indentation needs to be increased instead of having to do a more elaborate parsing of the program text." +msgid "" +"Another minor reason is that the colon makes it easier for editors with " +"syntax highlighting; they can look for colons to decide when indentation " +"needs to be increased instead of having to do a more elaborate parsing of " +"the program text." msgstr "" +"دلیل فرعی دیگر این است که دونقطه کار را برای ویرایشگرهای دارای برجسته‌سازی " +"سینتکس آسان‌تر می‌کند؛ آن‌ها می‌توانند به‌دنبال دونقطه‌ها بگردند تا تشخیص " +"دهند چه زمانی تورفتگی باید افزایش یابد، به‌جای این‌که مجبور باشند تجزیه " +"پیچیده‌تری از متن برنامه انجام دهند." msgid "Why does Python allow commas at the end of lists and tuples?" msgstr "" +"چرا پایتون اجازه می‌دهد در انتهای فهرست‌ها و تاپل‌ها کاما وجود داشته باشد؟" -msgid "Python lets you add a trailing comma at the end of lists, tuples, and dictionaries::" +msgid "" +"Python lets you add a trailing comma at the end of lists, tuples, and " +"dictionaries::" msgstr "" +"پایتون به شما امکان می‌دهد یک کامای پایانی را در انتهای فهرست‌ها، تاپل‌ها و " +"دیکشنری‌ها اضافه کنید::" msgid "" "[1, 2, 3,]\n" @@ -613,15 +1523,33 @@ msgid "" " \"B\": [6, 7], # last trailing comma is optional but good style\n" "}" msgstr "" +"[1, 2, 3,]\n" +"('a', 'b', 'c',)\n" +"d = {\n" +" \"A\": [1, 5],\n" +" \"B\": [6, 7], # آخرین ویرگول پایانی اختیاری است، اما سبک خوبی است\n" +"}" msgid "There are several reasons to allow this." -msgstr "" +msgstr "دلایل متعددی برای مجاز دانستن این وجود دارد." -msgid "When you have a literal value for a list, tuple, or dictionary spread across multiple lines, it's easier to add more elements because you don't have to remember to add a comma to the previous line. The lines can also be reordered without creating a syntax error." +msgid "" +"When you have a literal value for a list, tuple, or dictionary spread across" +" multiple lines, it's easier to add more elements because you don't have to " +"remember to add a comma to the previous line. The lines can also be " +"reordered without creating a syntax error." msgstr "" +"هنگامی که یک مقدار لفظی برای فهرست، تاپل یا دیکشنری دارید که در چند خط پخش " +"شده است، افزودن عناصر بیشتر آسان‌تر است، زیرا لازم نیست به خاطر بسپارید که " +"باید یک ویرگول به خط قبلی اضافه کنید. همچنین می‌توان خطوط را بدون ایجاد خطای" +" سینتکسی جابه‌جا کرد." -msgid "Accidentally omitting the comma can lead to errors that are hard to diagnose. For example::" +msgid "" +"Accidentally omitting the comma can lead to errors that are hard to " +"diagnose. For example::" msgstr "" +"حذف تصادفی کاما می‌تواند منجر به خطاهایی شود که اشکال‌زدایی آن‌ها دشوار است." +" برای مثال::" msgid "" "x = [\n" @@ -631,9 +1559,25 @@ msgid "" " \"fum\"\n" "]" msgstr "" +"x = [\n" +" \"fee\",\n" +" \"fie\"\n" +" \"foo\",\n" +" \"fum\"\n" +"]" -msgid "This list looks like it has four elements, but it actually contains three: \"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source of error." +msgid "" +"This list looks like it has four elements, but it actually contains three: " +"\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source" +" of error." msgstr "" +"این فهرست به نظر می‌رسد چهار عنصر دارد، اما در واقع شامل سه عنصر است: " +"\"fee\"، \"fiefoo\" و \"fum\". افزودن همیشگی ویرگول از این منبع خطا جلوگیری " +"می‌کند." -msgid "Allowing the trailing comma may also make programmatic code generation easier." +msgid "" +"Allowing the trailing comma may also make programmatic code generation " +"easier." msgstr "" +"مجاز بودن کامای پایانی همچنین ممکن است تولید کد به‌صورت برنامه‌ای را آسان‌تر" +" کند." diff --git a/faq/extending.po b/faq/extending.po index 4b441631a..460e273bc 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -25,82 +25,178 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Extending/Embedding FAQ" -msgstr "" +msgstr "پرسش‌های متداول گسترش/جاسازی" msgid "Contents" -msgstr "" +msgstr "محتویات" msgid "Can I create my own functions in C?" -msgstr "" +msgstr "آیا می‌توانم توابع خود را در C بسازم؟" -msgid "Yes, you can create built-in modules containing functions, variables, exceptions and even new types in C. This is explained in the document :ref:`extending-index`." +msgid "" +"Yes, you can create built-in modules containing functions, variables, " +"exceptions and even new types in C. This is explained in the document " +":ref:`extending-index`." msgstr "" +"بله، شما می‌توانید ماژول‌های توکار حاوی توابع، متغیرها، استثناها و حتی انواع" +" جدید را در C ایجاد کنید. این موضوع در سند :ref:`extending-index` توضیح داده" +" شده است." msgid "Most intermediate or advanced Python books will also cover this topic." msgstr "" +"بیشتر کتاب‌های سطح متوسط یا پیشرفته پایتون نیز به این موضوع می‌پردازند." msgid "Can I create my own functions in C++?" -msgstr "" +msgstr "آیا می‌توانم توابع خودم را در C++ بسازم؟" -msgid "Yes, using the C compatibility features found in C++. Place ``extern \"C\" { ... }`` around the Python include files and put ``extern \"C\"`` before each function that is going to be called by the Python interpreter. Global or static C++ objects with constructors are probably not a good idea." +msgid "" +"Yes, using the C compatibility features found in C++. Place ``extern \"C\" " +"{ ... }`` around the Python include files and put ``extern \"C\"`` before " +"each function that is going to be called by the Python interpreter. Global " +"or static C++ objects with constructors are probably not a good idea." msgstr "" +"بله، با استفاده از ویژگی‌های سازگاری با C موجود در C++. ``extern \"C\" { ..." +" }`` را اطراف فایل‌های include پایتون قرار دهید و ``extern \"C\"`` را پیش از" +" هر تابعی که قرار است توسط مفسر پایتون فراخوانی شود، قرار دهید. اشیاء سراسری" +" یا ایستای C++ دارای سازنده احتمالاً ایده‌ی خوبی نیستند." msgid "Writing C is hard; are there any alternatives?" -msgstr "" +msgstr "نوشتن C دشوار است؛ آیا جایگزین‌هایی وجود دارد؟" -msgid "There are a number of alternatives to writing your own C extensions, depending on what you're trying to do. :ref:`Recommended third party tools ` offer both simpler and more sophisticated approaches to creating C and C++ extensions for Python." +msgid "" +"There are a number of alternatives to writing your own C extensions, " +"depending on what you're trying to do. :ref:`Recommended third party tools " +"` offer both simpler and more sophisticated approaches to " +"creating C and C++ extensions for Python." msgstr "" +"بسته به این‌که شما می‌خواهید چه کاری انجام دهید، جایگزین‌های متعددی برای " +"نوشتن افزونه‌های C خودتان وجود دارد. :ref:`ابزارهای شخص ثالث توصیه‌شده " +"` هم رویکردهایی ساده‌تر و هم پیشرفته‌تر برای ایجاد افزونه‌های C" +" و C++ برای پایتون ارائه می‌دهند." msgid "How can I execute arbitrary Python statements from C?" -msgstr "" +msgstr "چگونه می‌توانم دستورات دلخواه پایتون را از C اجرا کنم؟" -msgid "The highest-level function to do this is :c:func:`PyRun_SimpleString` which takes a single string argument to be executed in the context of the module ``__main__`` and returns ``0`` for success and ``-1`` when an exception occurred (including :exc:`SyntaxError`). If you want more control, use :c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in ``Python/pythonrun.c``." -msgstr "" +msgid "" +"The highest-level function to do this is :c:func:`PyRun_SimpleString` which " +"takes a single string argument to be executed in the context of the module " +"``__main__`` and returns ``0`` for success and ``-1`` when an exception " +"occurred (including :exc:`SyntaxError`). If you want more control, use " +":c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in " +"``Python/pythonrun.c``." +msgstr "" +"بالاترین تابع از نظر سطح برای انجام این کار :c:func:`PyRun_SimpleString` است" +" که یک آرگومان رشته‌ای واحد می‌گیرد تا در زمینه‌ی ماژول ``__main__`` اجرا شود" +" و در صورت موفقیت ``0`` و در صورت بروز استثنا (از جمله :exc:`SyntaxError`) " +"``-1`` برمی‌گرداند. اگر کنترل بیشتری می‌خواهید، از :c:func:`PyRun_String` " +"استفاده کنید؛ کد منبع :c:func:`PyRun_SimpleString` را در " +"``Python/pythonrun.c`` ببینید." msgid "How can I evaluate an arbitrary Python expression from C?" -msgstr "" +msgstr "چگونه می‌توانم یک عبارت پایتون دلخواه را از C ارزیابی کنم؟" -msgid "Call the function :c:func:`PyRun_String` from the previous question with the start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it and returns its value." +msgid "" +"Call the function :c:func:`PyRun_String` from the previous question with the" +" start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it" +" and returns its value." msgstr "" +"تابع :c:func:`PyRun_String` را از پرسش قبلی با نماد آغازین " +":c:data:`Py_eval_input` فراخوانی کنید؛ این تابع یک عبارت را تجزیه می‌کند، آن" +" را ارزیابی می‌کند و مقدار آن را برمی‌گرداند." msgid "How do I extract C values from a Python object?" -msgstr "" +msgstr "چگونه می‌توانم مقادیر C را از یک شیء پایتون استخراج کنم؟" -msgid "That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` returns its length and :c:func:`PyTuple_GetItem` returns the item at a specified index. Lists have similar functions, :c:func:`PyList_Size` and :c:func:`PyList_GetItem`." +msgid "" +"That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " +"returns its length and :c:func:`PyTuple_GetItem` returns the item at a " +"specified index. Lists have similar functions, :c:func:`PyList_Size` and " +":c:func:`PyList_GetItem`." msgstr "" +"این به نوع شیء بستگی دارد. اگر یک تاپل باشد، :c:func:`PyTuple_Size` طول آن " +"را برمی‌گرداند و :c:func:`PyTuple_GetItem` آیتم در یک اندیس مشخص را " +"برمی‌گرداند. فهرست‌ها توابع مشابهی دارند، :c:func:`PyList_Size` و " +":c:func:`PyList_GetItem`." -msgid "For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:`PyBytes_AsStringAndSize` provides a pointer to its value and its length. Note that Python bytes objects may contain null bytes so C's :c:func:`!strlen` should not be used." +msgid "" +"For bytes, :c:func:`PyBytes_Size` returns its length and " +":c:func:`PyBytes_AsStringAndSize` provides a pointer to its value and its " +"length. Note that Python bytes objects may contain null bytes so C's " +":c:func:`!strlen` should not be used." msgstr "" +"برای بایت‌ها، :c:func:`PyBytes_Size` طول آن را برمی‌گرداند و " +":c:func:`PyBytes_AsStringAndSize` اشاره‌گری به مقدار و طول آن در اختیار قرار" +" می‌دهد. توجه داشته باشید که اشیاء بایت پایتون ممکن است حاوی بایت‌های null " +"باشند، بنابراین نباید از :c:func:`!strlen` در C استفاده شود." -msgid "To test the type of an object, first make sure it isn't ``NULL``, and then use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:`PyList_Check`, etc." +msgid "" +"To test the type of an object, first make sure it isn't ``NULL``, and then " +"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, " +":c:func:`PyList_Check`, etc." msgstr "" +"برای بررسی نوع یک شیء، ابتدا مطمئن شوید که ``NULL`` نیست، سپس از " +":c:func:`PyBytes_Check`، :c:func:`PyTuple_Check`، :c:func:`PyList_Check` و " +"غیره استفاده کنید." -msgid "There is also a high-level API to Python objects which is provided by the so-called 'abstract' interface -- read ``Include/abstract.h`` for further details. It allows interfacing with any kind of Python sequence using calls like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as well as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et al.) and mappings in the PyMapping APIs." -msgstr "" +msgid "" +"There is also a high-level API to Python objects which is provided by the " +"so-called 'abstract' interface -- read ``Include/abstract.h`` for further " +"details. It allows interfacing with any kind of Python sequence using calls" +" like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as " +"well as many other useful protocols such as numbers " +"(:c:func:`PyNumber_Index` et al.) and mappings in the PyMapping APIs." +msgstr "" +"همچنین یک API سطح بالا برای اشیای پایتون وجود دارد که توسط رابط به‌اصطلاح " +"«انتزاعی» ارائه می‌شود — برای جزئیات بیشتر ``Include/abstract.h`` را " +"بخوانید. این رابط امکان کار با هر نوع دنباله‌ی پایتون را از طریق " +"فراخوانی‌هایی مانند :c:func:`PySequence_Length`، " +":c:func:`PySequence_GetItem` و غیره، و همچنین بسیاری از پروتکل‌های مفید دیگر" +" مانند اعداد (:c:func:`PyNumber_Index` و غیره) و نگاشت‌ها در APIهای " +"PyMapping فراهم می‌کند." msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" -msgstr "" +msgstr "چگونه از Py_BuildValue() برای ایجاد تاپلی با طول دلخواه استفاده کنم؟" msgid "You can't. Use :c:func:`PyTuple_Pack` instead." -msgstr "" +msgstr "نمی‌توانید. به‌جای آن از :c:func:`PyTuple_Pack` استفاده کنید." msgid "How do I call an object's method from C?" -msgstr "" +msgstr "چگونه می‌توانم متد یک شیء را از C فراخوانی کنم؟" -msgid "The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary method of an object. The parameters are the object, the name of the method to call, a format string like that used with :c:func:`Py_BuildValue`, and the argument values::" +msgid "" +"The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary " +"method of an object. The parameters are the object, the name of the method " +"to call, a format string like that used with :c:func:`Py_BuildValue`, and " +"the argument values::" msgstr "" +"تابع :c:func:`PyObject_CallMethod` می‌تواند برای فراخوانی یک متد دلخواه از " +"یک شیء استفاده شود. پارامترها عبارت‌اند از شیء، نام متد برای فراخوانی، یک " +"رشته قالب مانند آنچه با :c:func:`Py_BuildValue` استفاده می‌شود، و مقادیر " +"آرگومان::" msgid "" "PyObject *\n" "PyObject_CallMethod(PyObject *object, const char *method_name,\n" " const char *arg_format, ...);" msgstr "" +"PyObject *\n" +"PyObject_CallMethod(PyObject *object, const char *method_name,\n" +" const char *arg_format, ...);" -msgid "This works for any object that has methods -- whether built-in or user-defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the return value." +msgid "" +"This works for any object that has methods -- whether built-in or user-" +"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " +"return value." msgstr "" +"این برای هر شیئی که متد دارد، چه توکار و چه تعریف‌شده توسط کاربر، کار " +"می‌کند. شما مسئولید که در نهایت مقدار بازگشتی را :c:func:`Py_DECREF` کنید." -msgid "To call, e.g., a file object's \"seek\" method with arguments 10, 0 (assuming the file object pointer is \"f\")::" +msgid "" +"To call, e.g., a file object's \"seek\" method with arguments 10, 0 " +"(assuming the file object pointer is \"f\")::" msgstr "" +"برای فراخوانی متد \"seek\" یک شیء فایل، مثلاً با آرگومان‌های ۱۰، ۰ (با فرض " +"اینکه اشاره‌گر شیء فایل \"f\" باشد)::" msgid "" "res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" @@ -111,18 +207,46 @@ msgid "" " Py_DECREF(res);\n" "}" msgstr "" +"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" +"if (res == NULL) {\n" +" ... an exception occurred ...\n" +"}\n" +"else {\n" +" Py_DECREF(res);\n" +"}" -msgid "Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the argument list, to call a function without arguments, pass \"()\" for the format, and to call a function with one argument, surround the argument in parentheses, e.g. \"(i)\"." +msgid "" +"Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the" +" argument list, to call a function without arguments, pass \"()\" for the " +"format, and to call a function with one argument, surround the argument in " +"parentheses, e.g. \"(i)\"." msgstr "" +"توجه داشته باشید که از آن‌جا که :c:func:`PyObject_CallObject` *همیشه* برای " +"فهرست آرگومان‌ها یک تاپل می‌خواهد، برای فراخوانی یک تابع بدون آرگومان، " +"\"()\" را به‌عنوان قالب ارسال کنید، و برای فراخوانی یک تابع با یک آرگومان، " +"آرگومان را داخل پرانتز قرار دهید، برای مثال \"(i)\"." -msgid "How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?" +msgid "" +"How do I catch the output from PyErr_Print() (or anything that prints to " +"stdout/stderr)?" msgstr "" +"چگونه می‌توانم خروجی PyErr_Print() (یا هر چیزی که به stdout/stderr چاپ " +"می‌شود) را دریافت کنم؟" -msgid "In Python code, define an object that supports the ``write()`` method. Assign this object to :data:`sys.stdout` and :data:`sys.stderr`. Call print_error, or just allow the standard traceback mechanism to work. Then, the output will go wherever your ``write()`` method sends it." +msgid "" +"In Python code, define an object that supports the ``write()`` method. " +"Assign this object to :data:`sys.stdout` and :data:`sys.stderr`. Call " +"print_error, or just allow the standard traceback mechanism to work. Then, " +"the output will go wherever your ``write()`` method sends it." msgstr "" +"در کد پایتون، شیء‌ای تعریف کنید که از متد ``write()`` پشتیبانی می‌کند. این " +"شیء را به :data:`sys.stdout` و :data:`sys.stderr` اختصاص دهید. print_error " +"را فراخوانی کنید، یا فقط اجازه دهید سازوکار استاندارد ردگیری پشته کار کند. " +"سپس، خروجی به هر جایی می‌رود که متد ``write()`` شما آن را ارسال می‌کند." msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgstr "" +"ساده‌ترین راه برای انجام این کار استفاده از کلاس :class:`io.StringIO` است:" msgid "" ">>> import io, sys\n" @@ -133,9 +257,16 @@ msgid "" "foo\n" "hello world!" msgstr "" +">>> import io, sys\n" +">>> sys.stdout = io.StringIO()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(sys.stdout.getvalue())\n" +"foo\n" +"hello world!" msgid "A custom object to do the same would look like this:" -msgstr "" +msgstr "یک شیء سفارشی برای انجام همان کار به این شکل خواهد بود:" msgid "" ">>> import io, sys\n" @@ -153,57 +284,112 @@ msgid "" "foo\n" "hello world!" msgstr "" +">>> import io, sys\n" +">>> class StdoutCatcher(io.TextIOBase):\n" +"... def __init__(self):\n" +"... self.data = []\n" +"... def write(self, stuff):\n" +"... self.data.append(stuff)\n" +"...\n" +">>> import sys\n" +">>> sys.stdout = StdoutCatcher()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(''.join(sys.stdout.data))\n" +"foo\n" +"hello world!" msgid "How do I access a module written in Python from C?" -msgstr "" +msgstr "چگونه از C به یک ماژول نوشته‌شده با Python دسترسی پیدا کنم؟" msgid "You can get a pointer to the module object as follows::" -msgstr "" +msgstr "می‌توانید یک اشاره‌گر به شیء ماژول را به صورت زیر دریافت کنید::" msgid "module = PyImport_ImportModule(\"\");" -msgstr "" +msgstr "module = PyImport_ImportModule(\"\");" -msgid "If the module hasn't been imported yet (i.e. it is not yet present in :data:`sys.modules`), this initializes the module; otherwise it simply returns the value of ``sys.modules[\"\"]``. Note that it doesn't enter the module into any namespace -- it only ensures it has been initialized and is stored in :data:`sys.modules`." -msgstr "" +msgid "" +"If the module hasn't been imported yet (i.e. it is not yet present in " +":data:`sys.modules`), this initializes the module; otherwise it simply " +"returns the value of ``sys.modules[\"\"]``. Note that it " +"doesn't enter the module into any namespace -- it only ensures it has been " +"initialized and is stored in :data:`sys.modules`." +msgstr "" +"اگر ماژول هنوز ایمپورت‌نشده باشد (یعنی هنوز در :data:`sys.modules` موجود " +"نباشد)، این، ماژول را مقداردهی اولیه می‌کند؛ در غیر این صورت، صرفاً مقدار " +"``sys.modules[\"\"]`` را برمی‌گرداند. توجه داشته باشید که این، " +"ماژول را وارد هیچ فضای نامی نمی‌کند -- فقط اطمینان حاصل می‌کند که ماژول " +"مقداردهی اولیه شده و در :data:`sys.modules` ذخیره شده است." -msgid "You can then access the module's attributes (i.e. any name defined in the module) as follows::" +msgid "" +"You can then access the module's attributes (i.e. any name defined in the " +"module) as follows::" msgstr "" +"سپس می‌توانید به ویژگی‌های ماژول (یعنی هر نام تعریف‌شده در ماژول) به صورت " +"زیر دسترسی داشته باشید::" msgid "attr = PyObject_GetAttrString(module, \"\");" -msgstr "" +msgstr "attr = PyObject_GetAttrString(module, \"\");" -msgid "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the module also works." +msgid "" +"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " +"module also works." msgstr "" +"فراخوانی :c:func:`PyObject_SetAttrString` برای انتساب به متغیرهای درون ماژول" +" نیز کار می‌کند." msgid "How do I interface to C++ objects from Python?" -msgstr "" +msgstr "چگونه از پایتون با اشیاء C++ رابط برقرار کنم؟" -msgid "Depending on your requirements, there are many approaches. To do this manually, begin by reading :ref:`the \"Extending and Embedding\" document `. Realize that for the Python run-time system, there isn't a whole lot of difference between C and C++ -- so the strategy of building a new Python type around a C structure (pointer) type will also work for C++ objects." -msgstr "" +msgid "" +"Depending on your requirements, there are many approaches. To do this " +"manually, begin by reading :ref:`the \"Extending and Embedding\" document " +"`. Realize that for the Python run-time system, there " +"isn't a whole lot of difference between C and C++ -- so the strategy of " +"building a new Python type around a C structure (pointer) type will also " +"work for C++ objects." +msgstr "" +"بسته به نیازمندی‌های شما، رویکردهای زیادی وجود دارد. برای انجام این کار " +"به‌صورت دستی، با خواندن :ref:`سند \"Extending and Embedding\" ` آغاز کنید. توجه داشته باشید که از نظر سیستم ران‌تایم پایتون، تفاوت " +"چندانی میان C و C++ وجود ندارد — بنابراین راهبرد ساختن یک نوع جدید پایتون بر" +" پایه‌ی یک نوع ساختار C (اشاره‌گر) برای اشیاء C++ نیز کار خواهد کرد." msgid "For C++ libraries, see :ref:`c-wrapper-software`." -msgstr "" +msgstr "برای کتابخانه‌های C++، :ref:`c-wrapper-software` را ببینید." msgid "I added a module using the Setup file and the make fails; why?" msgstr "" +"من یک ماژول را با استفاده از فایل Setup اضافه کردم و make شکست می‌خورد؛ چرا؟" -msgid "Setup must end in a newline, if there is no newline there, the build process fails. (Fixing this requires some ugly shell script hackery, and this bug is so minor that it doesn't seem worth the effort.)" +msgid "" +"Setup must end in a newline, if there is no newline there, the build process" +" fails. (Fixing this requires some ugly shell script hackery, and this bug " +"is so minor that it doesn't seem worth the effort.)" msgstr "" +"Setup باید با یک خط جدید پایان یابد؛ اگر خط جدیدی در آنجا نباشد، فرآیند ساخت" +" شکست می‌خورد. (رفع این مشکل به چند ترفند زشت اسکریپت پوسته نیاز دارد، و این" +" باگ آن‌قدر جزئی است که به نظر نمی‌رسد ارزش تلاش داشته باشد.)" msgid "How do I debug an extension?" -msgstr "" +msgstr "چگونه یک افزونه را اشکال‌زدایی کنم؟" -msgid "When using GDB with dynamically loaded extensions, you can't set a breakpoint in your extension until your extension is loaded." +msgid "" +"When using GDB with dynamically loaded extensions, you can't set a " +"breakpoint in your extension until your extension is loaded." msgstr "" +"هنگام استفاده از GDB با افزونه‌های بارگذاری‌شده به‌صورت پویا، تا زمانی که " +"افزونه‌ی شما بارگذاری نشود، نمی‌توانید نقطه توقفی در افزونه‌ی خود تنظیم کنید." msgid "In your ``.gdbinit`` file (or interactively), add the command:" msgstr "" +"در فایل ``.gdbinit`` خود (یا به‌صورت تعاملی)، این دستور را اضافه کنید:" msgid "br _PyImport_LoadDynamicModule" -msgstr "" +msgstr "br _PyImport_LoadDynamicModule" msgid "Then, when you run GDB:" -msgstr "" +msgstr "سپس، هنگامی که GDB را اجرا می‌کنید:" msgid "" "$ gdb /local/bin/python\n" @@ -213,42 +399,110 @@ msgid "" "gdb) br myfunction.c:50\n" "gdb) continue" msgstr "" +"$ gdb /local/bin/python\n" +"gdb) run myscript.py\n" +"gdb) continue # repeat until your extension is loaded\n" +"gdb) finish # so that your extension is loaded\n" +"gdb) br myfunction.c:50\n" +"gdb) continue" -msgid "I want to compile a Python module on my Linux system, but some files are missing. Why?" +msgid "" +"I want to compile a Python module on my Linux system, but some files are " +"missing. Why?" msgstr "" +"می‌خواهم یک ماژول پایتون را روی سیستم لینوکسی خود کامپایل کنم، اما برخی " +"فایل‌ها وجود ندارند. چرا؟" -msgid "Most packaged versions of Python omit some files required for compiling Python extensions." +msgid "" +"Most packaged versions of Python omit some files required for compiling " +"Python extensions." msgstr "" +"بیشتر نسخه‌های بسته‌بندی‌شده‌ی پایتون، برخی از فایل‌های مورد نیاز برای " +"کامپایل افزونه‌های پایتون را شامل نمی‌شوند." msgid "For Red Hat, install the python3-devel RPM to get the necessary files." msgstr "" +"برای Red Hat، بسته‌ی RPM با نام python3-devel را نصب کنید تا فایل‌های ضروری " +"را دریافت کنید." msgid "For Debian, run ``apt-get install python3-dev``." -msgstr "" +msgstr "برای دبیان، ``apt-get install python3-dev`` را اجرا کنید." msgid "How do I tell \"incomplete input\" from \"invalid input\"?" -msgstr "" +msgstr "چگونه «ورودی ناقص» را از «ورودی نامعتبر» تشخیص دهم؟" -msgid "Sometimes you want to emulate the Python interactive interpreter's behavior, where it gives you a continuation prompt when the input is incomplete (e.g. you typed the start of an \"if\" statement or you didn't close your parentheses or triple string quotes), but it gives you a syntax error message immediately when the input is invalid." -msgstr "" +msgid "" +"Sometimes you want to emulate the Python interactive interpreter's behavior," +" where it gives you a continuation prompt when the input is incomplete (e.g." +" you typed the start of an \"if\" statement or you didn't close your " +"parentheses or triple string quotes), but it gives you a syntax error " +"message immediately when the input is invalid." +msgstr "" +"گاهی ممکن است بخواهید رفتار مفسر تعاملی پایتون را شبیه‌سازی کنید، که در آن " +"وقتی ورودی ناقص است (مثلاً شروع یک دستور \"if\" را تایپ کرده‌اید یا پرانتزها" +" یا علامت‌های نقل‌قول سه‌گانه‌ی رشته را نبسته‌اید)، یک اعلان ادامه به شما " +"می‌دهد، اما وقتی ورودی نامعتبر است، بلافاصله یک پیام خطای سینتکس به شما " +"می‌دهد." -msgid "In Python you can use the :mod:`codeop` module, which approximates the parser's behavior sufficiently. IDLE uses this, for example." +msgid "" +"In Python you can use the :mod:`codeop` module, which approximates the " +"parser's behavior sufficiently. IDLE uses this, for example." msgstr "" +"در پایتون می‌توانید از ماژول :mod:`codeop` استفاده کنید، که رفتار " +"پارسر (parser) را به‌اندازه‌ی کافی تقریب می‌زند. برای مثال، IDLE از این" +" استفاده می‌کند." -msgid "The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` (perhaps in a separate thread) and let the Python interpreter handle the input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` to point at your custom input function. See ``Modules/readline.c`` and ``Parser/myreadline.c`` for more hints." -msgstr "" +msgid "" +"The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " +"(perhaps in a separate thread) and let the Python interpreter handle the " +"input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` " +"to point at your custom input function. See ``Modules/readline.c`` and " +"``Parser/myreadline.c`` for more hints." +msgstr "" +"ساده‌ترین راه برای انجام این کار در C این است که " +":c:func:`PyRun_InteractiveLoop` را فراخوانی کنید (احتمالاً در یک نخ جداگانه)" +" و اجازه دهید مفسر پایتون ورودی را برای شما مدیریت کند. همچنین می‌توانید " +":c:func:`PyOS_ReadlineFunctionPointer` را طوری تنظیم کنید که به تابع ورودی " +"سفارشی شما اشاره کند. برای نکات بیشتر، ``Modules/readline.c`` و " +"``Parser/myreadline.c`` را ببینید." msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" msgstr "" +"چگونه می‌توانم نمادهای تعریف‌نشده‌ی g++ یعنی __builtin_new یا __pure_virtual" +" را پیدا کنم؟" -msgid "To dynamically load g++ extension modules, you must recompile Python, relink it using g++ (change LINKCC in the Python Modules Makefile), and link your extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)." +msgid "" +"To dynamically load g++ extension modules, you must recompile Python, relink" +" it using g++ (change LINKCC in the Python Modules Makefile), and link your " +"extension module using g++ (e.g., ``g++ -shared -o mymodule.so " +"mymodule.o``)." msgstr "" +"برای بارگذاری پویای ماژول‌های افزونه g++، باید پایتون را دوباره کامپایل " +"کنید، آن را با استفاده از g++ دوباره لینک کنید (LINKCC را در Makefile " +"ماژول‌های پایتون تغییر دهید) و ماژول افزونه خود را با استفاده از g++ لینک " +"کنید (برای مثال، ``g++ -shared -o mymodule.so mymodule.o``)." -msgid "Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)?" +msgid "" +"Can I create an object class with some methods implemented in C and others " +"in Python (e.g. through inheritance)?" msgstr "" +"آیا می‌توانم یک کلاس شیء بسازم که برخی از متدهای آن در C و برخی دیگر در " +"Python پیاده‌سازی‌شده باشند (برای مثال از طریق وراثت)؟" -msgid "Yes, you can inherit from built-in classes such as :class:`int`, :class:`list`, :class:`dict`, etc." +msgid "" +"Yes, you can inherit from built-in classes such as :class:`int`, " +":class:`list`, :class:`dict`, etc." msgstr "" +"بله، شما می‌توانید از کلاس‌های توکار مانند :class:`int`، :class:`list`، " +":class:`dict` و غیره ارث‌بری کنید." -msgid "The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index.html) provides a way of doing this from C++ (i.e. you can inherit from an extension class written in C++ using the BPL)." -msgstr "" +msgid "" +"The Boost Python Library (BPL, " +"https://www.boost.org/libs/python/doc/index.html) provides a way of doing " +"this from C++ (i.e. you can inherit from an extension class written in C++ " +"using the BPL)." +msgstr "" +"کتابخانه Boost Python (BPL، " +"https://www.boost.org/libs/python/doc/index.html) راهی برای انجام این کار از" +" C++ فراهم می‌کند (یعنی می‌توانید با استفاده از BPL از یک کلاس توسعه " +"نوشته‌شده به C++ ارث‌بری کنید)." diff --git a/faq/general.po b/faq/general.po index 6fb86a72d..fd8344366 100644 --- a/faq/general.po +++ b/faq/general.po @@ -25,286 +25,761 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "General Python FAQ" -msgstr "" +msgstr "پرسش‌های متداول عمومی پایتون" msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "General Information" -msgstr "" +msgstr "اطلاعات عمومی" msgid "What is Python?" -msgstr "" +msgstr "پایتون چیست؟" -msgid "Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. It supports multiple programming paradigms beyond object-oriented programming, such as procedural and functional programming. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants including Linux and macOS, and on Windows." -msgstr "" +msgid "" +"Python is an interpreted, interactive, object-oriented programming language." +" It incorporates modules, exceptions, dynamic typing, very high level " +"dynamic data types, and classes. It supports multiple programming paradigms" +" beyond object-oriented programming, such as procedural and functional " +"programming. Python combines remarkable power with very clear syntax. It has" +" interfaces to many system calls and libraries, as well as to various window" +" systems, and is extensible in C or C++. It is also usable as an extension " +"language for applications that need a programmable interface. Finally, " +"Python is portable: it runs on many Unix variants including Linux and macOS," +" and on Windows." +msgstr "" +"پایتون یک زبان برنامه‌نویسی مفسری، تعاملی و شیءگرا است. این زبان ماژول‌ها، " +"استثناها، نوع‌دهی پویا، انواع داده پویای بسیار سطح بالا و کلاس‌ها را در بر " +"دارد. این زبان فراتر از برنامه‌نویسی شیءگرا، از پارادایم‌های برنامه‌نویسی " +"متعددی مانند برنامه‌نویسی رویه‌ای و تابعی پشتیبانی می‌کند. پایتون قدرت " +"چشمگیری را با سینتکسی بسیار واضح ترکیب می‌کند. این زبان رابط‌هایی به بسیاری " +"از فراخوانی‌های سیستمی و کتابخانه‌ها، و همچنین به سیستم‌های پنجره‌ای گوناگون" +" دارد و در C یا C++ قابل توسعه است. همچنین می‌توان از آن به‌عنوان یک زبان " +"توسعه برای برنامه‌های کاربردی که به یک رابط برنامه‌پذیر نیاز دارند استفاده " +"کرد. در نهایت، پایتون قابل حمل است: این زبان روی بسیاری از گونه‌های یونیکس، " +"از جمله لینوکس و macOS، و روی ویندوز اجرا می‌شود." -msgid "To find out more, start with :ref:`tutorial-index`. The `Beginner's Guide to Python `_ links to other introductory tutorials and resources for learning Python." +msgid "" +"To find out more, start with :ref:`tutorial-index`. The `Beginner's Guide " +"to Python `_ links to other " +"introductory tutorials and resources for learning Python." msgstr "" +"برای آگاهی بیشتر، از :ref:`tutorial-index` شروع کنید. `راهنمای مبتدیان " +"پایتون `_ به سایر آموزش‌های " +"مقدماتی و منابعی برای یادگیری پایتون پیوند می‌دهد." msgid "What is the Python Software Foundation?" -msgstr "" +msgstr "بنیاد نرم‌افزار پایتون چیست؟" -msgid "The Python Software Foundation is an independent non-profit organization that holds the copyright on Python versions 2.1 and newer. The PSF's mission is to advance open source technology related to the Python programming language and to publicize the use of Python. The PSF's home page is at https://www.python.org/psf/." +msgid "" +"The Python Software Foundation is an independent non-profit organization " +"that holds the copyright on Python versions 2.1 and newer. The PSF's " +"mission is to advance open source technology related to the Python " +"programming language and to publicize the use of Python. The PSF's home " +"page is at https://www.python.org/psf/." msgstr "" +"بنیاد نرم‌افزار پایتون یک سازمان مستقل غیرانتفاعی است که حق نشر نسخه‌های 2.1" +" و جدیدتر پایتون را در اختیار دارد. مأموریت PSF پیشبرد فناوری متن‌باز مرتبط " +"با زبان برنامه‌نویسی پایتون و ترویج استفاده از پایتون است. صفحه اصلی PSF در " +"https://www.python.org/psf/ قرار دارد." -msgid "Donations to the PSF are tax-exempt in the US. If you use Python and find it helpful, please contribute via `the PSF donation page `_." +msgid "" +"Donations to the PSF are tax-exempt in the US. If you use Python and find " +"it helpful, please contribute via `the PSF donation page " +"`_." msgstr "" +"کمک‌های مالی به PSF در ایالات متحده از مالیات معاف است. اگر از پایتون " +"استفاده می‌کنید و آن را مفید می‌دانید، لطفاً از طریق `صفحه‌ی اهدای PSF " +"`_ مشارکت کنید." msgid "Are there copyright restrictions on the use of Python?" -msgstr "" +msgstr "آیا محدودیت‌های حق تکثیر برای استفاده از پایتون وجود دارد؟" -msgid "You can do anything you want with the source, as long as you leave the copyrights in and display those copyrights in any documentation about Python that you produce. If you honor the copyright rules, it's OK to use Python for commercial use, to sell copies of Python in source or binary form (modified or unmodified), or to sell products that incorporate Python in some form. We would still like to know about all commercial use of Python, of course." -msgstr "" +msgid "" +"You can do anything you want with the source, as long as you leave the " +"copyrights in and display those copyrights in any documentation about Python" +" that you produce. If you honor the copyright rules, it's OK to use Python " +"for commercial use, to sell copies of Python in source or binary form " +"(modified or unmodified), or to sell products that incorporate Python in " +"some form. We would still like to know about all commercial use of Python, " +"of course." +msgstr "" +"شما می‌توانید هر کاری که می‌خواهید با متن منبع انجام دهید، به شرطی که " +"اعلان‌های حق نشر را حفظ کنید و آن اعلان‌های حق نشر را در هر مستندی درباره " +"پایتون که تولید می‌کنید، نمایش دهید. اگر قوانین حق نشر را رعایت کنید، " +"استفاده تجاری از پایتون، فروش نسخه‌هایی از پایتون به شکل منبع یا دودویی " +"(تغییریافته یا تغییرنیافته)، یا فروش محصولاتی که پایتون را به شکلی در خود " +"دارند، بلامانع است. البته ما همچنان مایلیم از تمام استفاده‌های تجاری از " +"پایتون مطلع شویم." -msgid "See `the license page `_ to find further explanations and the full text of the PSF License." +msgid "" +"See `the license page `_ to find " +"further explanations and the full text of the PSF License." msgstr "" +"برای یافتن توضیحات بیشتر و متن کامل پروانه‌ی PSF، `صفحه‌ی پروانه " +"`_ را ببینید." -msgid "The Python logo is trademarked, and in certain cases permission is required to use it. Consult `the Trademark Usage Policy `__ for more information." +msgid "" +"The Python logo is trademarked, and in certain cases permission is required " +"to use it. Consult `the Trademark Usage Policy " +"`__ for more information." msgstr "" +"لوگوی پایتون یک علامت تجاری ثبت‌شده است و در موارد خاصی، استفاده از آن " +"مستلزم اجازه است. برای اطلاعات بیشتر، به `سیاست استفاده از علامت تجاری " +"`__ مراجعه کنید." msgid "Why was Python created in the first place?" -msgstr "" +msgstr "چرا پایتون در وهله‌ی اول ایجاد شد؟" -msgid "Here's a *very* brief summary of what started it all, written by Guido van Rossum:" +msgid "" +"Here's a *very* brief summary of what started it all, written by Guido van " +"Rossum:" msgstr "" +"در ادامه یک خلاصه‌ی *بسیار* کوتاه از آنچه همه‌چیز را آغاز کرد، نوشته‌ی گویدو " +"ون روسوم آمده است:" -msgid "I had extensive experience with implementing an interpreted language in the ABC group at CWI, and from working with this group I had learned a lot about language design. This is the origin of many Python features, including the use of indentation for statement grouping and the inclusion of very-high-level data types (although the details are all different in Python)." -msgstr "" +msgid "" +"I had extensive experience with implementing an interpreted language in the " +"ABC group at CWI, and from working with this group I had learned a lot about" +" language design. This is the origin of many Python features, including the" +" use of indentation for statement grouping and the inclusion of very-high-" +"level data types (although the details are all different in Python)." +msgstr "" +"من تجربه‌ی گسترده‌ای در پیاده‌سازی یک زبان تفسیری در گروه ABC در CWI داشتم و " +"از کار با این گروه، چیز زیادی درباره‌ی طراحی زبان آموخته بودم. این خاستگاه " +"بسیاری از ویژگی‌های پایتون است، از جمله استفاده از تورفتگی برای گروه‌بندی " +"دستورها و گنجاندن انواع داده‌ی بسیار سطح‌بالا (اگرچه همه‌ی جزئیات در پایتون " +"متفاوت است)." -msgid "I had a number of gripes about the ABC language, but also liked many of its features. It was impossible to extend the ABC language (or its implementation) to remedy my complaints -- in fact its lack of extensibility was one of its biggest problems. I had some experience with using Modula-2+ and talked with the designers of Modula-3 and read the Modula-3 report. Modula-3 is the origin of the syntax and semantics used for exceptions, and some other Python features." -msgstr "" +msgid "" +"I had a number of gripes about the ABC language, but also liked many of its " +"features. It was impossible to extend the ABC language (or its " +"implementation) to remedy my complaints -- in fact its lack of extensibility" +" was one of its biggest problems. I had some experience with using " +"Modula-2+ and talked with the designers of Modula-3 and read the Modula-3 " +"report. Modula-3 is the origin of the syntax and semantics used for " +"exceptions, and some other Python features." +msgstr "" +"من شکایت‌هایی از زبان ABC داشتم، اما بسیاری از ویژگی‌های آن را نیز دوست " +"داشتم. غیرممکن بود که زبان ABC (یا پیاده‌سازی آن) را برای رفع شکایت‌هایم " +"توسعه دهم — در واقع فقدان توسعه‌پذیری آن یکی از بزرگ‌ترین مشکلات آن بود. من " +"تجربه‌ای در استفاده از Modula-2+ داشتم و با طراحان Modula-3 صحبت کردم و " +"گزارش Modula-3 را خواندم. Modula-3 منشأ نحو و معناشناسی استفاده‌شده برای " +"استثناها و برخی دیگر از ویژگی‌های پایتون است." -msgid "I was working in the Amoeba distributed operating system group at CWI. We needed a better way to do system administration than by writing either C programs or Bourne shell scripts, since Amoeba had its own system call interface which wasn't easily accessible from the Bourne shell. My experience with error handling in Amoeba made me acutely aware of the importance of exceptions as a programming language feature." -msgstr "" +msgid "" +"I was working in the Amoeba distributed operating system group at CWI. We " +"needed a better way to do system administration than by writing either C " +"programs or Bourne shell scripts, since Amoeba had its own system call " +"interface which wasn't easily accessible from the Bourne shell. My " +"experience with error handling in Amoeba made me acutely aware of the " +"importance of exceptions as a programming language feature." +msgstr "" +"من در گروه سیستم‌عامل توزیع‌شده‌ی Amoeba در CWI کار می‌کردم. ما به روش بهتری " +"برای مدیریت سیستم نیاز داشتیم، به‌جای نوشتن برنامه‌های C یا اسکریپت‌های " +"پوسته Bourne، زیرا Amoeba رابط فراخوانی سیستم خاص خود را داشت که به‌راحتی از" +" پوسته Bourne قابل دسترسی نبود. تجربه‌ی من از مدیریت خطا در Amoeba باعث شد " +"به‌شدت به اهمیت استثناها به‌عنوان یک ویژگی زبان برنامه‌نویسی آگاه شوم." -msgid "It occurred to me that a scripting language with a syntax like ABC but with access to the Amoeba system calls would fill the need. I realized that it would be foolish to write an Amoeba-specific language, so I decided that I needed a language that was generally extensible." +msgid "" +"It occurred to me that a scripting language with a syntax like ABC but with " +"access to the Amoeba system calls would fill the need. I realized that it " +"would be foolish to write an Amoeba-specific language, so I decided that I " +"needed a language that was generally extensible." msgstr "" +"به ذهنم رسید که یک زبان اسکریپت‌نویسی با نحوی مانند ABC اما با دسترسی به " +"فراخوانی‌های سیستمی Amoeba می‌توانست این نیاز را برآورده کند. دریافتم که " +"نوشتن زبانی مختص Amoeba احمقانه خواهد بود، بنابراین تصمیم گرفتم که به زبانی " +"نیاز دارم که به‌طور کلی توسعه‌پذیر باشد." -msgid "During the 1989 Christmas holidays, I had a lot of time on my hand, so I decided to give it a try. During the next year, while still mostly working on it in my own time, Python was used in the Amoeba project with increasing success, and the feedback from colleagues made me add many early improvements." +msgid "" +"During the 1989 Christmas holidays, I had a lot of time on my hand, so I " +"decided to give it a try. During the next year, while still mostly working " +"on it in my own time, Python was used in the Amoeba project with increasing " +"success, and the feedback from colleagues made me add many early " +"improvements." msgstr "" +"در تعطیلات کریسمس سال ۱۹۸۹، وقت زیادی در اختیار داشتم، بنابراین تصمیم گرفتم " +"آن را امتحان کنم. در طول سال بعد، در حالی که هنوز بیشتر در اوقات فراغت خودم " +"روی آن کار می‌کردم، پایتون در پروژه Amoeba با موفقیت روزافزون استفاده شد و " +"بازخورد همکاران موجب شد بسیاری از بهبودهای اولیه را اضافه کنم." -msgid "In February 1991, after just over a year of development, I decided to post to USENET. The rest is in the ``Misc/HISTORY`` file." +msgid "" +"In February 1991, after just over a year of development, I decided to post " +"to USENET. The rest is in the ``Misc/HISTORY`` file." msgstr "" +"در فوریه ۱۹۹۱، پس از کمی بیش از یک سال توسعه، تصمیم گرفتم آن را در USENET " +"منتشر کنم. بقیه در فایل ``Misc/HISTORY`` قرار دارد." msgid "What is Python good for?" -msgstr "" +msgstr "پایتون برای چه مواردی مناسب است؟" -msgid "Python is a high-level general-purpose programming language that can be applied to many different classes of problems." +msgid "" +"Python is a high-level general-purpose programming language that can be " +"applied to many different classes of problems." msgstr "" +"پایتون یک زبان برنامه‌نویسی سطح بالا و همه‌منظوره است که می‌تواند برای " +"بسیاری از دسته‌های مختلف مسائل به کار رود." -msgid "The language comes with a large standard library that covers areas such as string processing (regular expressions, Unicode, calculating differences between files), internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP), software engineering (unit testing, logging, profiling, parsing Python code), and operating system interfaces (system calls, filesystems, TCP/IP sockets). Look at the table of contents for :ref:`library-index` to get an idea of what's available. A wide variety of third-party extensions are also available. Consult `the Python Package Index `_ to find packages of interest to you." -msgstr "" +msgid "" +"The language comes with a large standard library that covers areas such as " +"string processing (regular expressions, Unicode, calculating differences " +"between files), internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP), " +"software engineering (unit testing, logging, profiling, parsing Python " +"code), and operating system interfaces (system calls, filesystems, TCP/IP " +"sockets). Look at the table of contents for :ref:`library-index` to get an " +"idea of what's available. A wide variety of third-party extensions are also" +" available. Consult `the Python Package Index `_ to find " +"packages of interest to you." +msgstr "" +"این زبان دارای یک کتابخانه‌ی استاندارد بزرگ است که حوزه‌هایی مانند پردازش " +"رشته (عبارات باقاعده، یونیکد، محاسبه‌ی تفاوت‌های میان فایل‌ها)، پروتکل‌های " +"اینترنتی (HTTP، FTP، SMTP، XML-RPC، POP، IMAP)، مهندسی نرم‌افزار (آزمون واحد،" +" گزارش‌گیری، تحلیل کارایی، تجزیه‌ی کد پایتون) و رابط‌های سیستم‌عامل " +"(فراخوانی‌های سیستمی، فایل‌سیستم‌ها، سوکت‌های TCP/IP) را پوشش می‌دهد. برای " +"آشنایی با موارد موجود، به فهرست مطالب :ref:`library-index` نگاه کنید. " +"افزونه‌های شخص ثالث بسیار متنوعی نیز در دسترس است. برای یافتن بسته‌های مورد " +"علاقه‌ی خود، به `Python Package Index `_ مراجعه کنید." msgid "How does the Python version numbering scheme work?" -msgstr "" +msgstr "طرح شماره‌گذاری نسخه‌های پایتون چگونه کار می‌کند؟" msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" -msgstr "" +msgstr "نسخه‌های پایتون به‌صورت «A.B.C» یا «A.B» شماره‌گذاری می‌شوند:" -msgid "*A* is the major version number -- it is only incremented for really major changes in the language." +msgid "" +"*A* is the major version number -- it is only incremented for really major " +"changes in the language." msgstr "" +"*A* شماره‌ی نسخه‌ی اصلی است — این شماره تنها برای تغییرات بسیار اساسی در " +"زبان افزایش می‌یابد." -msgid "*B* is the minor version number -- it is incremented for less earth-shattering changes." -msgstr "" +msgid "" +"*B* is the minor version number -- it is incremented for less earth-" +"shattering changes." +msgstr "*B* شماره‌ی نسخه فرعی است — برای تغییرات کم‌اهمیت‌تر افزایش می‌یابد." -msgid "*C* is the micro version number -- it is incremented for each bugfix release." +msgid "" +"*C* is the micro version number -- it is incremented for each bugfix " +"release." msgstr "" +"*C* شماره‌ی نسخه‌ی میکرو است — برای هر انتشار رفع اشکال افزایش می‌یابد." -msgid "Not all releases are bugfix releases. In the run-up to a new feature release, a series of development releases are made, denoted as alpha, beta, or release candidate. Alphas are early releases in which interfaces aren't yet finalized; it's not unexpected to see an interface change between two alpha releases. Betas are more stable, preserving existing interfaces but possibly adding new modules, and release candidates are frozen, making no changes except as needed to fix critical bugs." -msgstr "" +msgid "" +"Not all releases are bugfix releases. In the run-up to a new feature " +"release, a series of development releases are made, denoted as alpha, beta, " +"or release candidate. Alphas are early releases in which interfaces aren't " +"yet finalized; it's not unexpected to see an interface change between two " +"alpha releases. Betas are more stable, preserving existing interfaces but " +"possibly adding new modules, and release candidates are frozen, making no " +"changes except as needed to fix critical bugs." +msgstr "" +"همه‌ی نسخه‌ها، نسخه‌های رفع اشکال نیستند. در آستانه‌ی انتشار یک نسخه‌ی جدید با " +"امکانات تازه، مجموعه‌ای از نسخه‌های توسعه‌ای منتشر می‌شوند که با عناوین " +"آلفا، بتا یا نامزد انتشار مشخص می‌شوند. نسخه‌های آلفا نسخه‌های اولیه‌ای " +"هستند که در آن‌ها رابط‌ها هنوز نهایی نشده‌اند؛ مشاهده‌ی تغییر در رابط میان ۲ " +"نسخه‌ی آلفا غیرمنتظره نیست. نسخه‌های بتا پایدارتر هستند و رابط‌های موجود را " +"حفظ می‌کنند، اما ممکن است ماژول‌های جدیدی به آن‌ها اضافه شوند، و نامزدهای " +"انتشار تثبیت‌شده‌اند و هیچ تغییری در آن‌ها داده نمی‌شود، مگر به میزانی که " +"برای رفع اشکالات حیاتی ضروری باشد." msgid "Alpha, beta and release candidate versions have an additional suffix:" -msgstr "" +msgstr "نسخه‌های آلفا، بتا و نامزد انتشار دارای یک پسوند اضافی هستند:" msgid "The suffix for an alpha version is \"aN\" for some small number *N*." -msgstr "" +msgstr "پسوند نسخه آلفا \"aN\" است، که *N* عدد کوچکی است." msgid "The suffix for a beta version is \"bN\" for some small number *N*." -msgstr "" +msgstr "پسوند نسخه‌ی بتا، \"bN\" برای عدد کوچکی *N* است." -msgid "The suffix for a release candidate version is \"rcN\" for some small number *N*." -msgstr "" +msgid "" +"The suffix for a release candidate version is \"rcN\" for some small number " +"*N*." +msgstr "پسوند نسخه‌ی نامزد انتشار، \"rcN\" است که در آن *N* یک عدد کوچک است." -msgid "In other words, all versions labeled *2.0aN* precede the versions labeled *2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." +msgid "" +"In other words, all versions labeled *2.0aN* precede the versions labeled " +"*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." msgstr "" +"به عبارت دیگر، همه‌ی نسخه‌های دارای برچسب *2.0aN* بر نسخه‌های دارای برچسب " +"*2.0bN* مقدم‌اند، که بر نسخه‌های دارای برچسب *2.0rcN* مقدم‌اند، و *آن‌ها* بر" +" 2.0 مقدم‌اند." -msgid "You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These are unreleased versions, built directly from the CPython development repository. In practice, after a final minor release is made, the version is incremented to the next minor version, which becomes the \"a0\" version, e.g. \"2.4a0\"." +msgid "" +"You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These" +" are unreleased versions, built directly from the CPython development " +"repository. In practice, after a final minor release is made, the version " +"is incremented to the next minor version, which becomes the \"a0\" version, " +"e.g. \"2.4a0\"." msgstr "" +"ممکن است همچنین شماره نسخه‌هایی را با پسوند «+» ببینید، مثلاً «2.2+». این‌ها" +" نسخه‌های منتشرنشده هستند که مستقیماً از مخزن توسعه CPython ساخته شده‌اند. " +"در عمل، پس از انجام یک انتشار فرعی نهایی، شماره نسخه به نسخه فرعی بعدی " +"افزایش می‌یابد که به‌عنوان نسخه «a0» شناخته می‌شود، مثلاً «2.4a0»." -msgid "See the `Developer's Guide `__ for more information about the development cycle, and :pep:`387` to learn more about Python's backward compatibility policy. See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and :data:`sys.version_info`." -msgstr "" +msgid "" +"See the `Developer's Guide `__ for more information about the development " +"cycle, and :pep:`387` to learn more about Python's backward compatibility " +"policy. See also the documentation for :data:`sys.version`, " +":data:`sys.hexversion`, and :data:`sys.version_info`." +msgstr "" +"برای اطلاعات بیشتر درباره چرخه توسعه، `راهنمای توسعه‌دهنده " +"`__ و " +"برای آشنایی بیشتر با سیاست سازگاری با نسخه‌های پیشین پایتون، :pep:`387` را " +"ببینید. همچنین مستندات :data:`sys.version`، :data:`sys.hexversion` و " +":data:`sys.version_info` را ببینید." msgid "How do I obtain a copy of the Python source?" -msgstr "" +msgstr "چگونه یک نسخه از کد منبع پایتون را به دست بیاورم؟" -msgid "The latest Python source distribution is always available from python.org, at https://www.python.org/downloads/. The latest development sources can be obtained at https://github.com/python/cpython/." +msgid "" +"The latest Python source distribution is always available from python.org, " +"at https://www.python.org/downloads/. The latest development sources can be" +" obtained at https://github.com/python/cpython/." msgstr "" +"آخرین توزیع کد منبع پایتون همیشه از python.org، در " +"https://www.python.org/downloads/ در دسترس است. آخرین کدهای منبع در حال " +"توسعه را می‌توانید از https://github.com/python/cpython/ دریافت کنید." -msgid "The source distribution is a gzipped tar file containing the complete C source, Sphinx-formatted documentation, Python library modules, example programs, and several useful pieces of freely distributable software. The source will compile and run out of the box on most UNIX platforms." +msgid "" +"The source distribution is a gzipped tar file containing the complete C " +"source, Sphinx-formatted documentation, Python library modules, example " +"programs, and several useful pieces of freely distributable software. The " +"source will compile and run out of the box on most UNIX platforms." msgstr "" +"توزیع منبع یک فایل tar فشرده‌شده با gzip است که شامل کد منبع کامل C، مستندات" +" قالب‌بندی‌شده با Sphinx، ماژول‌های کتابخانه پایتون، برنامه‌های نمونه، و " +"چندین بخش مفید از نرم‌افزارهای قابل توزیع آزاد است. این کد منبع در بیشتر " +"سکوهای UNIX بدون نیاز به هیچ‌گونه تنظیمات اضافی کامپایل و اجرا می‌شود." -msgid "Consult the `Getting Started section of the Python Developer's Guide `__ for more information on getting the source code and compiling it." +msgid "" +"Consult the `Getting Started section of the Python Developer's Guide " +"`__ for more information on getting the " +"source code and compiling it." msgstr "" +"برای اطلاعات بیشتر درباره‌ی دریافت کد منبع و کامپایل آن، به `بخش آغاز به کار " +"راهنمای توسعه‌دهندگان پایتون `__ مراجعه " +"کنید." msgid "How do I get documentation on Python?" -msgstr "" +msgstr "چگونه مستندات پایتون را دریافت کنم؟" -msgid "The standard documentation for the current stable version of Python is available at https://docs.python.org/3/. EPUB, plain text, and downloadable HTML versions are also available at https://docs.python.org/3/download.html." +msgid "" +"The standard documentation for the current stable version of Python is " +"available at https://docs.python.org/3/. EPUB, plain text, and downloadable" +" HTML versions are also available at " +"https://docs.python.org/3/download.html." msgstr "" +"مستندات استاندارد برای نسخه پایدار کنونی پایتون در " +"https://docs.python.org/3/ در دسترس است. نسخه‌های EPUB، متن ساده و HTML قابل" +" دانلود نیز در https://docs.python.org/3/download.html در دسترس هستند." -msgid "The documentation is written in reStructuredText and processed by `the Sphinx documentation tool `__. The reStructuredText source for the documentation is part of the Python source distribution." +msgid "" +"The documentation is written in reStructuredText and processed by `the " +"Sphinx documentation tool `__. The " +"reStructuredText source for the documentation is part of the Python source " +"distribution." msgstr "" +"مستندات به زبان reStructuredText نوشته شده است و توسط `ابزار مستندسازی " +"Sphinx `__ پردازش می‌شود. کد منبع " +"reStructuredText مستندات، بخشی از توزیع کد منبع پایتون است." msgid "I've never programmed before. Is there a Python tutorial?" -msgstr "" +msgstr "من تا به حال برنامه‌نویسی نکرده‌ام. آیا آموزشی برای پایتون وجود دارد؟" -msgid "There are numerous tutorials and books available. The standard documentation includes :ref:`tutorial-index`." +msgid "" +"There are numerous tutorials and books available. The standard " +"documentation includes :ref:`tutorial-index`." msgstr "" +"آموزش‌ها و کتاب‌های متعددی در دسترس است. مستندات استاندارد شامل " +":ref:`tutorial-index` است." -msgid "Consult `the Beginner's Guide `_ to find information for beginning Python programmers, including lists of tutorials." +msgid "" +"Consult `the Beginner's Guide " +"`_ to find information for " +"beginning Python programmers, including lists of tutorials." msgstr "" +"برای یافتن اطلاعات برای برنامه‌نویسان مبتدی پایتون، از جمله فهرست‌هایی از " +"آموزش‌ها، به `راهنمای مبتدیان " +"`_ مراجعه کنید." msgid "Is there a newsgroup or mailing list devoted to Python?" -msgstr "" +msgstr "آیا گروه خبری یا فهرست پستی اختصاص‌یافته به پایتون وجود دارد؟" -msgid "There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, `python-list `_. The newsgroup and mailing list are gatewayed into each other -- if you can read news it's unnecessary to subscribe to the mailing list. :newsgroup:`comp.lang.python` is high-traffic, receiving hundreds of postings every day, and Usenet readers are often more able to cope with this volume." -msgstr "" +msgid "" +"There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " +"`python-list `_. The " +"newsgroup and mailing list are gatewayed into each other -- if you can read " +"news it's unnecessary to subscribe to the mailing list. " +":newsgroup:`comp.lang.python` is high-traffic, receiving hundreds of " +"postings every day, and Usenet readers are often more able to cope with this" +" volume." +msgstr "" +"یک گروه خبری، :newsgroup:`comp.lang.python`، و یک فهرست پستی، `python-list " +"`_ وجود دارد. گروه " +"خبری و فهرست پستی به یکدیگر متصل هستند -- اگر می‌توانید اخبار را بخوانید، " +"نیازی به عضویت در فهرست پستی نیست. :newsgroup:`comp.lang.python` ترافیک " +"بالایی دارد و روزانه صدها پست دریافت می‌کند، و خوانندگان یوزنت معمولاً بهتر " +"می‌توانند با این حجم کنار بیایند." -msgid "Announcements of new software releases and events can be found in comp.lang.python.announce, a low-traffic moderated list that receives about five postings per day. It's available as `the python-announce mailing list `_." +msgid "" +"Announcements of new software releases and events can be found in " +"comp.lang.python.announce, a low-traffic moderated list that receives about " +"five postings per day. It's available as `the python-announce mailing list " +"`_." msgstr "" +"اعلامیه‌های انتشار نسخه‌های جدید نرم‌افزار و رویدادها را می‌توانید در " +"comp.lang.python.announce پیدا کنید؛ این یک فهرست کم‌ترافیک مدیریت‌شده است " +"که حدود ۵ پست در روز دریافت می‌کند. این فهرست به‌عنوان `فهرست پستی python-" +"announce `_ در دسترس است." -msgid "More info about other mailing lists and newsgroups can be found at https://www.python.org/community/lists/." +msgid "" +"More info about other mailing lists and newsgroups can be found at " +"https://www.python.org/community/lists/." msgstr "" +"اطلاعات بیشتر درباره سایر فهرست‌های پستی و گروه‌های خبری را می‌توانید در " +"https://www.python.org/community/lists/ بیابید." msgid "How do I get a beta test version of Python?" -msgstr "" +msgstr "چگونه می‌توانم یک نسخه آزمایشی بتا از پایتون دریافت کنم؟" -msgid "Alpha and beta releases are available from https://www.python.org/downloads/. All releases are announced on the comp.lang.python and comp.lang.python.announce newsgroups and on the Python home page at https://www.python.org/; an RSS feed of news is available." +msgid "" +"Alpha and beta releases are available from " +"https://www.python.org/downloads/. All releases are announced on the " +"comp.lang.python and comp.lang.python.announce newsgroups and on the Python " +"home page at https://www.python.org/; an RSS feed of news is available." msgstr "" +"نسخه‌های آلفا و بتا از https://www.python.org/downloads/ در دسترس هستند. " +"تمام نسخه‌ها در گروه‌های خبری comp.lang.python و comp.lang.python.announce و" +" در صفحه‌ی خانگی پایتون به نشانی https://www.python.org/ اعلام می‌شوند؛ یک " +"فید RSS از اخبار در دسترس است." -msgid "You can also access the development version of Python through Git. See `The Python Developer's Guide `_ for details." +msgid "" +"You can also access the development version of Python through Git. See `The" +" Python Developer's Guide `_ for details." msgstr "" +"همچنین می‌توانید از طریق Git به نسخه‌ی توسعه‌ی پایتون دسترسی پیدا کنید. برای " +"جزئیات `The Python Developer's Guide `_ را " +"ببینید." msgid "How do I submit bug reports and patches for Python?" -msgstr "" +msgstr "چگونه گزارش‌های اشکال و وصله‌ها را برای پایتون ارسال کنم؟" -msgid "To report a bug or submit a patch, use the issue tracker at https://github.com/python/cpython/issues." +msgid "" +"To report a bug or submit a patch, use the issue tracker at " +"https://github.com/python/cpython/issues." msgstr "" +"برای گزارش باگ یا ارسال وصله، از سامانه‌ی پیگیری مسائل در " +"https://github.com/python/cpython/issues استفاده کنید." -msgid "For more information on how Python is developed, consult `the Python Developer's Guide `_." +msgid "" +"For more information on how Python is developed, consult `the Python " +"Developer's Guide `_." msgstr "" +"برای اطلاعات بیشتر در مورد چگونگی توسعه پایتون، به `راهنمای توسعه‌دهندگان " +"پایتون `_ مراجعه کنید." msgid "Are there any published articles about Python that I can reference?" msgstr "" +"آیا مقاله‌های منتشرشده‌ای درباره پایتون وجود دارد که بتوانم به آن‌ها ارجاع " +"دهم؟" msgid "It's probably best to cite your favorite book about Python." -msgstr "" +msgstr "احتمالاً بهتر است کتاب مورد علاقه‌تان درباره پایتون را ارجاع دهید." -msgid "The `very first article `_ about Python was written in 1991 and is now quite outdated." +msgid "" +"The `very first article `_ about Python was " +"written in 1991 and is now quite outdated." msgstr "" +"`نخستین مقاله `_ درباره پایتون در سال ۱۹۹۱ " +"نوشته شد و اکنون تا حد زیادی منسوخ شده است." -msgid "Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 (December 1991), Amsterdam, pp 283--303." +msgid "" +"Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers " +"Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " +"(December 1991), Amsterdam, pp 283--303." msgstr "" +"Guido van Rossum و Jelke de Boer، \"Interactively Testing Remote Servers " +"Using the Python Programming Language\"، CWI Quarterly، جلد ۴، شماره ۴ " +"(دسامبر ۱۹۹۱)، آمستردام، ص ۲۸۳--۳۰۳." msgid "Are there any books on Python?" -msgstr "" +msgstr "آیا کتابی درباره پایتون وجود دارد؟" -msgid "Yes, there are many, and more are being published. See the python.org wiki at https://wiki.python.org/moin/PythonBooks for a list." +msgid "" +"Yes, there are many, and more are being published. See the python.org wiki " +"at https://wiki.python.org/moin/PythonBooks for a list." msgstr "" +"بله، تعداد زیادی وجود دارد و موارد بیشتری نیز منتشر می‌شوند. برای مشاهده " +"فهرست به ویکی python.org در https://wiki.python.org/moin/PythonBooks مراجعه " +"کنید." -msgid "You can also search online bookstores for \"Python\" and filter out the Monty Python references; or perhaps search for \"Python\" and \"language\"." +msgid "" +"You can also search online bookstores for \"Python\" and filter out the " +"Monty Python references; or perhaps search for \"Python\" and \"language\"." msgstr "" +"همچنین می‌توانید در کتاب‌فروشی‌های آنلاین برای «Python» جست‌وجو کنید و " +"ارجاع‌های Monty Python را حذف کنید؛ یا شاید برای «Python» و «language» " +"جست‌وجو کنید." msgid "Where in the world is www.python.org located?" -msgstr "" +msgstr "www.python.org در کجای دنیا قرار دارد؟" -msgid "The Python project's infrastructure is located all over the world and is managed by the Python Infrastructure Team. Details `here `__." +msgid "" +"The Python project's infrastructure is located all over the world and is " +"managed by the Python Infrastructure Team. Details `here " +"`__." msgstr "" +"زیرساخت پروژه‌ی پایتون در سراسر جهان قرار دارد و توسط تیم زیرساخت پایتون " +"مدیریت می‌شود. جزئیات `اینجا `__." msgid "Why is it called Python?" -msgstr "" +msgstr "چرا به آن پایتون گفته می‌شود؟" -msgid "When he began implementing Python, Guido van Rossum was also reading the published scripts from `\"Monty Python's Flying Circus\" `__, a BBC comedy series from the 1970s. Van Rossum thought he needed a name that was short, unique, and slightly mysterious, so he decided to call the language Python." -msgstr "" +msgid "" +"When he began implementing Python, Guido van Rossum was also reading the " +"published scripts from `\"Monty Python's Flying Circus\" " +"`__, a BBC comedy series from " +"the 1970s. Van Rossum thought he needed a name that was short, unique, and " +"slightly mysterious, so he decided to call the language Python." +msgstr "" +"هنگامی که گیدو ون روسوم پیاده‌سازی پایتون را آغاز کرد، در حال خواندن " +"فیلم‌نامه‌های منتشرشده‌ی `\"Monty Python's Flying Circus\" " +"`__ نیز بود، یک مجموعه‌ی کمدی BBC" +" از دهه‌ی ۱۹۷۰. ون روسوم فکر می‌کرد به نامی نیاز دارد که کوتاه، یکتا و کمی " +"مرموز باشد، بنابراین تصمیم گرفت این زبان را پایتون بنامد." msgid "Do I have to like \"Monty Python's Flying Circus\"?" -msgstr "" +msgstr "آیا باید «Monty Python's Flying Circus» را دوست داشته باشم؟" msgid "No, but it helps. :)" -msgstr "" +msgstr "خیر، اما کمک می‌کند. :)" msgid "Python in the real world" -msgstr "" +msgstr "پایتون در دنیای واقعی" msgid "How stable is Python?" -msgstr "" +msgstr "پایتون چقدر پایدار است؟" -msgid "Very stable. New, stable releases have been coming out roughly every 6 to 18 months since 1991, and this seems likely to continue. As of version 3.9, Python will have a new feature release every 12 months (:pep:`602`)." +msgid "" +"Very stable. New, stable releases have been coming out roughly every 6 to " +"18 months since 1991, and this seems likely to continue. As of version 3.9," +" Python will have a new feature release every 12 months (:pep:`602`)." msgstr "" +"بسیار پایدار. از سال ۱۹۹۱، نسخه‌های جدید و پایدار تقریباً هر ۶ تا ۱۸ ماه " +"منتشر شده‌اند و به نظر می‌رسد این روند ادامه داشته باشد. از نسخه 3.9، پایتون" +" هر ۱۲ ماه یک نسخه ویژگی جدید خواهد داشت (:pep:`602`)." -msgid "The developers issue bugfix releases of older versions, so the stability of existing releases gradually improves. Bugfix releases, indicated by a third component of the version number (e.g. 3.5.3, 3.6.2), are managed for stability; only fixes for known problems are included in a bugfix release, and it's guaranteed that interfaces will remain the same throughout a series of bugfix releases." -msgstr "" +msgid "" +"The developers issue bugfix releases of older versions, so the stability of " +"existing releases gradually improves. Bugfix releases, indicated by a third" +" component of the version number (e.g. 3.5.3, 3.6.2), are managed for " +"stability; only fixes for known problems are included in a bugfix release, " +"and it's guaranteed that interfaces will remain the same throughout a series" +" of bugfix releases." +msgstr "" +"توسعه‌دهندگان نسخه‌های رفع اشکال را برای نسخه‌های قدیمی‌تر منتشر می‌کنند، " +"بنابراین پایداری نسخه‌های موجود به‌تدریج بهبود می‌یابد. نسخه‌های رفع اشکال، " +"که با سومین مؤلفه‌ی شماره‌ی نسخه مشخص می‌شوند (مثلاً 3.5.3، 3.6.2)، برای " +"پایداری مدیریت می‌شوند؛ در یک نسخه‌ی رفع اشکال فقط اصلاحیه‌های مشکلات " +"شناخته‌شده گنجانده می‌شوند، و تضمین می‌شود که رابط‌ها در تمام طول یک سری از " +"نسخه‌های رفع اشکال بدون تغییر باقی بمانند." -msgid "The latest stable releases can always be found on the `Python download page `_. Python 3.x is the recommended version and supported by most widely used libraries. Python 2.x :pep:`is not maintained anymore <373>`." +msgid "" +"The latest stable releases can always be found on the `Python download page " +"`_. Python 3.x is the recommended version" +" and supported by most widely used libraries. Python 2.x :pep:`is not " +"maintained anymore <373>`." msgstr "" +"آخرین نسخه‌های پایدار را همیشه می‌توان در `صفحه‌ی دانلود پایتون " +"`_ یافت. پایتون 3.x نسخه‌ی توصیه‌شده است و" +" بیشتر کتابخانه‌های پرکاربرد از آن پشتیبانی می‌کنند. پایتون 2.x :pep:`دیگر " +"نگهداری نمی‌شود <373>`." msgid "How many people are using Python?" -msgstr "" +msgstr "چند نفر از پایتون استفاده می‌کنند؟" -msgid "There are probably millions of users, though it's difficult to obtain an exact count." +msgid "" +"There are probably millions of users, though it's difficult to obtain an " +"exact count." msgstr "" +"احتمالاً میلیون‌ها کاربر وجود دارد، اگرچه به‌دست آوردن تعداد دقیق آن دشوار " +"است." -msgid "Python is available for free download, so there are no sales figures, and it's available from many different sites and packaged with many Linux distributions, so download statistics don't tell the whole story either." +msgid "" +"Python is available for free download, so there are no sales figures, and " +"it's available from many different sites and packaged with many Linux " +"distributions, so download statistics don't tell the whole story either." msgstr "" +"پایتون برای دانلود رایگان در دسترس است، بنابراین هیچ آمار فروشی وجود ندارد، " +"و از سایت‌های بسیاری در دسترس است و همراه با بسیاری از توزیع‌های لینوکس " +"بسته‌بندی شده است، بنابراین آمار دانلود نیز تمام ماجرا را بیان نمی‌کند." -msgid "The comp.lang.python newsgroup is very active, but not all Python users post to the group or even read it." +msgid "" +"The comp.lang.python newsgroup is very active, but not all Python users post" +" to the group or even read it." msgstr "" +"گروه خبری comp.lang.python بسیار فعال است، اما همه‌ی کاربران پایتون در این " +"گروه پیام نمی‌فرستند یا حتی آن را نمی‌خوانند." msgid "Have any significant projects been done in Python?" -msgstr "" +msgstr "آیا پروژه‌های مهمی با پایتون انجام شده‌اند؟" -msgid "See https://www.python.org/about/success for a list of projects that use Python. Consulting the proceedings for `past Python conferences `_ will reveal contributions from many different companies and organizations." +msgid "" +"See https://www.python.org/about/success for a list of projects that use " +"Python. Consulting the proceedings for `past Python conferences " +"`_ will reveal contributions " +"from many different companies and organizations." msgstr "" +"برای مشاهده فهرستی از پروژه‌هایی که از پایتون استفاده می‌کنند، " +"https://www.python.org/about/success را ببینید. بررسی مجموعه‌مقالات " +"`کنفرانس‌های گذشته پایتون `_ " +"مشارکت‌های بسیاری از شرکت‌ها و سازمان‌های مختلف را آشکار خواهد کرد." -msgid "High-profile Python projects include `the Mailman mailing list manager `_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system administration software in Python. Companies that use Python internally include Google, Yahoo, and Lucasfilm Ltd." -msgstr "" +msgid "" +"High-profile Python projects include `the Mailman mailing list manager " +"`_ and `the Zope application server " +"`_. Several Linux distributions, most notably `Red " +"Hat `_, have written part or all of their installer " +"and system administration software in Python. Companies that use Python " +"internally include Google, Yahoo, and Lucasfilm Ltd." +msgstr "" +"از پروژه‌های برجسته پایتون می‌توان به `مدیر فهرست پستی Mailman " +"`_ و `سرور برنامه‌های کاربردی Zope " +"`_ اشاره کرد. چندین توزیع لینوکسی، به‌ویژه `Red Hat " +"`_، بخشی یا تمام نرم‌افزارهای نصب و مدیریت سیستم خود" +" را با پایتون نوشته‌اند. از جمله شرکت‌هایی که از پایتون به‌صورت داخلی " +"استفاده می‌کنند، می‌توان به Google، Yahoo و Lucasfilm Ltd. اشاره کرد." msgid "What new developments are expected for Python in the future?" -msgstr "" +msgstr "در آینده چه پیشرفت‌های جدیدی برای پایتون انتظار می‌رود؟" -msgid "See https://peps.python.org/ for the Python Enhancement Proposals (PEPs). PEPs are design documents describing a suggested new feature for Python, providing a concise technical specification and a rationale. Look for a PEP titled \"Python X.Y Release Schedule\", where X.Y is a version that hasn't been publicly released yet." -msgstr "" +msgid "" +"See https://peps.python.org/ for the Python Enhancement Proposals (PEPs). " +"PEPs are design documents describing a suggested new feature for Python, " +"providing a concise technical specification and a rationale. Look for a PEP" +" titled \"Python X.Y Release Schedule\", where X.Y is a version that hasn't " +"been publicly released yet." +msgstr "" +"برای مشاهده‌ی پیشنهادهای بهبود پایتون (PEPs) به https://peps.python.org/ " +"مراجعه کنید. PEPها اسناد طراحی هستند که یک ویژگی جدید پیشنهادی برای پایتون " +"را توصیف می‌کنند و مشخصات فنی مختصر و استدلال آن را ارائه می‌دهند. به دنبال " +"یک PEP با عنوان «Python X.Y Release Schedule» بگردید، که در آن X.Y نسخه‌ای " +"است که هنوز به‌صورت عمومی منتشر نشده است." -msgid "New development is discussed on `the python-dev mailing list `_." +msgid "" +"New development is discussed on `the python-dev mailing list " +"`_." msgstr "" +"توسعه جدید در `فهرست پستی python-dev " +"`_ مورد بحث " +"قرار می‌گیرد." msgid "Is it reasonable to propose incompatible changes to Python?" -msgstr "" +msgstr "آیا پیشنهاد تغییرات ناسازگار برای پایتون منطقی است؟" -msgid "In general, no. There are already millions of lines of Python code around the world, so any change in the language that invalidates more than a very small fraction of existing programs has to be frowned upon. Even if you can provide a conversion program, there's still the problem of updating all documentation; many books have been written about Python, and we don't want to invalidate them all at a single stroke." -msgstr "" +msgid "" +"In general, no. There are already millions of lines of Python code around " +"the world, so any change in the language that invalidates more than a very " +"small fraction of existing programs has to be frowned upon. Even if you can" +" provide a conversion program, there's still the problem of updating all " +"documentation; many books have been written about Python, and we don't want " +"to invalidate them all at a single stroke." +msgstr "" +"به‌طور کلی، خیر. در حال حاضر میلیون‌ها خط کد پایتون در سراسر جهان وجود دارد،" +" بنابراین هر تغییری در زبان که بیش از بخش بسیار کوچکی از برنامه‌های موجود را" +" نامعتبر کند، باید نامطلوب تلقی شود. حتی اگر بتوانید یک برنامه تبدیل ارائه " +"دهید، همچنان مشکل به‌روزرسانی تمام مستندات وجود دارد؛ کتاب‌های زیادی درباره " +"پایتون نوشته شده است و ما نمی‌خواهیم همه آن‌ها را با یک حرکت نامعتبر کنیم." -msgid "Providing a gradual upgrade path is necessary if a feature has to be changed. :pep:`5` describes the procedure followed for introducing backward-incompatible changes while minimizing disruption for users." +msgid "" +"Providing a gradual upgrade path is necessary if a feature has to be " +"changed. :pep:`5` describes the procedure followed for introducing backward-" +"incompatible changes while minimizing disruption for users." msgstr "" +"اگر لازم باشد قابلیتی تغییر کند، فراهم کردن مسیر ارتقای تدریجی ضروری است. " +":pep:`5` رویه‌ای را که برای معرفی تغییرات ناسازگار با نسخه‌های قبلی با " +"کمترین اختلال برای کاربران دنبال می‌شود، توصیف می‌کند." msgid "Is Python a good language for beginning programmers?" -msgstr "" +msgstr "آیا پایتون زبان خوبی برای برنامه‌نویسان مبتدی است؟" msgid "Yes." -msgstr "" +msgstr "بله." -msgid "It is still common to start students with a procedural and statically typed language such as Pascal, C, or a subset of C++ or Java. Students may be better served by learning Python as their first language. Python has a very simple and consistent syntax and a large standard library and, most importantly, using Python in a beginning programming course lets students concentrate on important programming skills such as problem decomposition and data type design. With Python, students can be quickly introduced to basic concepts such as loops and procedures. They can probably even work with user-defined objects in their very first course." -msgstr "" +msgid "" +"It is still common to start students with a procedural and statically typed " +"language such as Pascal, C, or a subset of C++ or Java. Students may be " +"better served by learning Python as their first language. Python has a very" +" simple and consistent syntax and a large standard library and, most " +"importantly, using Python in a beginning programming course lets students " +"concentrate on important programming skills such as problem decomposition " +"and data type design. With Python, students can be quickly introduced to " +"basic concepts such as loops and procedures. They can probably even work " +"with user-defined objects in their very first course." +msgstr "" +"هنوز رایج است که آموزش دانشجویان با یک زبان رویه‌ای و با نوع‌دهی ایستا مانند" +" پاسکال، C، یا زیرمجموعه‌ای از C++ یا Java آغاز شود. ممکن است یادگیری پایتون" +" به‌عنوان اولین زبان، برای دانشجویان مفیدتر باشد. پایتون دارای نحو بسیار " +"ساده و یکپارچه و کتابخانه استاندارد بزرگی است، و مهم‌تر از همه، استفاده از " +"پایتون در یک دوره برنامه‌نویسی مقدماتی به دانشجویان اجازه می‌دهد تا بر " +"مهارت‌های مهم برنامه‌نویسی مانند تجزیه مسئله و طراحی نوع داده تمرکز کنند. با" +" پایتون، دانشجویان می‌توانند به‌سرعت با مفاهیم پایه‌ای مانند حلقه‌ها و " +"رویه‌ها آشنا شوند. آن‌ها احتمالاً حتی می‌توانند در همان اولین دوره خود با " +"اشیاء تعریف‌شده توسط کاربر کار کنند." -msgid "For a student who has never programmed before, using a statically typed language seems unnatural. It presents additional complexity that the student must master and slows the pace of the course. The students are trying to learn to think like a computer, decompose problems, design consistent interfaces, and encapsulate data. While learning to use a statically typed language is important in the long term, it is not necessarily the best topic to address in the students' first programming course." -msgstr "" +msgid "" +"For a student who has never programmed before, using a statically typed " +"language seems unnatural. It presents additional complexity that the " +"student must master and slows the pace of the course. The students are " +"trying to learn to think like a computer, decompose problems, design " +"consistent interfaces, and encapsulate data. While learning to use a " +"statically typed language is important in the long term, it is not " +"necessarily the best topic to address in the students' first programming " +"course." +msgstr "" +"برای دانشجویی که هرگز پیش‌تر برنامه‌نویسی نکرده است، استفاده از یک زبان با " +"نوع‌دهی ایستا، غیرطبیعی به نظر می‌رسد. این کار پیچیدگی بیشتری را ایجاد " +"می‌کند که دانشجو باید بر آن مسلط شود و آهنگ دوره را کند می‌کند. دانشجویان " +"تلاش می‌کنند یاد بگیرند که مانند یک کامپیوتر بیندیشند، مسائل را تجزیه کنند، " +"رابط‌های سازگار طراحی کنند و داده‌ها را کپسوله‌سازی کنند. اگرچه یادگیری " +"استفاده از یک زبان با نوع‌دهی ایستا در بلندمدت مهم است، اما لزوماً بهترین " +"موضوع برای پرداختن در نخستین دوره برنامه‌نویسی دانشجویان نیست." -msgid "Many other aspects of Python make it a good first language. Like Java, Python has a large standard library so that students can be assigned programming projects very early in the course that *do* something. Assignments aren't restricted to the standard four-function calculator and check balancing programs. By using the standard library, students can gain the satisfaction of working on realistic applications as they learn the fundamentals of programming. Using the standard library also teaches students about code reuse. Third-party modules such as PyGame are also helpful in extending the students' reach." -msgstr "" +msgid "" +"Many other aspects of Python make it a good first language. Like Java, " +"Python has a large standard library so that students can be assigned " +"programming projects very early in the course that *do* something. " +"Assignments aren't restricted to the standard four-function calculator and " +"check balancing programs. By using the standard library, students can gain " +"the satisfaction of working on realistic applications as they learn the " +"fundamentals of programming. Using the standard library also teaches " +"students about code reuse. Third-party modules such as PyGame are also " +"helpful in extending the students' reach." +msgstr "" +"بسیاری از جنبه‌های دیگر پایتون، آن را به زبان مناسبی برای شروع تبدیل " +"می‌کنند. مانند جاوا، پایتون کتابخانه استاندارد بزرگی دارد، به‌طوری که " +"می‌توان در همان اوایل دوره پروژه‌های برنامه‌نویسی‌ای را به دانشجویان محول " +"کرد که کاری را *انجام* می‌دهند. تکالیف به برنامه‌های استاندارد ماشین‌حساب " +"چهارعملی و تراز چک محدود نمی‌شوند. با استفاده از کتابخانه استاندارد، " +"دانشجویان می‌توانند همزمان با یادگیری مبانی برنامه‌نویسی، رضایت کار روی " +"برنامه‌های کاربردی واقع‌گرایانه را تجربه کنند. استفاده از کتابخانه استاندارد" +" همچنین بازاستفاده از کد را به دانشجویان می‌آموزد. ماژول‌های شخص ثالث مانند" +" PyGame نیز به گسترش دسترسی دانشجویان کمک می‌کنند." -msgid "Python's interactive interpreter enables students to test language features while they're programming. They can keep a window with the interpreter running while they enter their program's source in another window. If they can't remember the methods for a list, they can do something like this::" +msgid "" +"Python's interactive interpreter enables students to test language features " +"while they're programming. They can keep a window with the interpreter " +"running while they enter their program's source in another window. If they " +"can't remember the methods for a list, they can do something like this::" msgstr "" +"مفسر تعاملی پایتون به دانشجویان امکان می‌دهد که ویژگی‌های زبان را در حین " +"برنامه‌نویسی آزمایش کنند. می‌توانند پنجره‌ای را که مفسر در آن در حال اجرا " +"است باز نگه دارند، در حالی که کد منبع برنامه‌شان را در پنجره‌ای دیگر وارد " +"می‌کنند. اگر متدهای یک فهرست را به یاد نیاورند، می‌توانند کاری مانند این " +"انجام دهند::" msgid "" ">>> L = []\n" @@ -331,12 +806,57 @@ msgid "" ">>> L\n" "[1]" msgstr "" +">>> L = []\n" +">>> dir(L)\n" +"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n" +"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n" +"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n" +"'__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',\n" +"'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',\n" +"'__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',\n" +"'__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',\n" +"'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',\n" +"'reverse', 'sort']\n" +">>> [d for d in dir(L) if '__' not in d]\n" +"['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']\n" +"\n" +">>> help(L.append)\n" +"Help on built-in function append:\n" +"\n" +"append(...)\n" +" L.append(object) -> None -- append object to end\n" +"\n" +">>> L.append(1)\n" +">>> L\n" +"[1]" -msgid "With the interpreter, documentation is never far from the student as they are programming." -msgstr "" +msgid "" +"With the interpreter, documentation is never far from the student as they " +"are programming." +msgstr "با مفسر، مستندات هرگز در حین برنامه‌نویسی از دانش‌آموز دور نیست." -msgid "There are also good IDEs for Python. IDLE is a cross-platform IDE for Python that is written in Python using Tkinter. Emacs users will be happy to know that there is a very good Python mode for Emacs. All of these programming environments provide syntax highlighting, auto-indenting, and access to the interactive interpreter while coding. Consult `the Python wiki `_ for a full list of Python editing environments." -msgstr "" +msgid "" +"There are also good IDEs for Python. IDLE is a cross-platform IDE for " +"Python that is written in Python using Tkinter. Emacs users will be happy to" +" know that there is a very good Python mode for Emacs. All of these " +"programming environments provide syntax highlighting, auto-indenting, and " +"access to the interactive interpreter while coding. Consult `the Python " +"wiki `_ for a full list of " +"Python editing environments." +msgstr "" +"همچنین محیط‌های توسعه یک‌پارچه (IDE) خوبی برای پایتون وجود دارد. IDLE یک IDE" +" میان‌سکویی برای پایتون است که به زبان پایتون و با استفاده از Tkinter نوشته " +"شده است. کاربران Emacs خوشحال خواهند شد که بدانند یک حالت پایتون (Python " +"mode) بسیار خوب برای Emacs وجود دارد. تمام این محیط‌های برنامه‌نویسی، " +"برجسته‌سازی سینتکس، تورفتگی خودکار و دسترسی به مفسر تعاملی را هنگام کدنویسی " +"فراهم می‌کنند. برای مشاهده فهرست کاملی از محیط‌های ویرایش پایتون، به `ویکی " +"پایتون `_ مراجعه کنید." -msgid "If you want to discuss Python's use in education, you may be interested in joining `the edu-sig mailing list `_." +msgid "" +"If you want to discuss Python's use in education, you may be interested in " +"joining `the edu-sig mailing list " +"`_." msgstr "" +"اگر می‌خواهید درباره‌ی استفاده از پایتون در آموزش گفتگو کنید، ممکن است به " +"پیوستن به `فهرست ایمیلی edu-sig " +"`_ علاقه‌مند باشید." diff --git a/faq/gui.po b/faq/gui.po index 28dfccd93..62e9321b5 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -25,49 +25,116 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Graphic User Interface FAQ" -msgstr "" +msgstr "پرسش‌های متداول رابط کاربری گرافیکی" msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "General GUI Questions" -msgstr "" +msgstr "پرسش‌های عمومی GUI" msgid "What GUI toolkits exist for Python?" -msgstr "" +msgstr "چه کیت‌های رابط کاربری گرافیکی (GUI) برای پایتون وجود دارد؟" -msgid "Standard builds of Python include an object-oriented interface to the Tcl/Tk widget set, called :ref:`tkinter `. This is probably the easiest to install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, including pointers to the source, see the `Tcl/Tk home page `_. Tcl/Tk is fully portable to the macOS, Windows, and Unix platforms." -msgstr "" +msgid "" +"Standard builds of Python include an object-oriented interface to the Tcl/Tk" +" widget set, called :ref:`tkinter `. This is probably the easiest " +"to install (since it comes included with most `binary distributions " +"`_ of Python) and use. For more info " +"about Tk, including pointers to the source, see the `Tcl/Tk home page " +"`_. Tcl/Tk is fully portable to the macOS, Windows, and" +" Unix platforms." +msgstr "" +"ساخت‌های استاندارد پایتون شامل یک رابط شیءگرا برای مجموعه ابزارک‌های Tcl/Tk " +"هستند که :ref:`tkinter ` نامیده می‌شود. این احتمالاً ساده‌ترین " +"گزینه برای نصب و استفاده است (زیرا همراه با بیشتر `توزیع‌های دودویی " +"`_ پایتون ارائه می‌شود). برای اطلاعات " +"بیشتر درباره Tk، از جمله پیوندهایی به کد منبع، `صفحه اصلی Tcl/Tk " +"`_ را ببینید. Tcl/Tk کاملاً برای پلتفرم‌های macOS، " +"Windows و Unix قابل حمل است." -msgid "Depending on what platform(s) you are aiming at, there are also several alternatives. A `list of cross-platform `_ and `platform-specific `_ GUI frameworks can be found on the python wiki." -msgstr "" +msgid "" +"Depending on what platform(s) you are aiming at, there are also several " +"alternatives. A `list of cross-platform " +"`_ " +"and `platform-specific " +"`_" +" GUI frameworks can be found on the python wiki." +msgstr "" +"بسته به این که چه سکو(هایی) را هدف گرفته‌اید، چندین جایگزین نیز وجود دارد. " +"فهرستی از چارچوب‌های رابط کاربری گرافیکی `چندسکویی " +"`_ و " +"`مختص سکو `_ را می‌توانید در ویکی پایتون پیدا کنید." msgid "Tkinter questions" -msgstr "" +msgstr "پرسش‌های Tkinter" msgid "How do I freeze Tkinter applications?" -msgstr "" +msgstr "چگونه می‌توانم برنامه‌های Tkinter را فریز (freeze) کنم؟" -msgid "Freeze is a tool to create stand-alone applications. When freezing Tkinter applications, the applications will not be truly stand-alone, as the application will still need the Tcl and Tk libraries." +msgid "" +"Freeze is a tool to create stand-alone applications. When freezing Tkinter " +"applications, the applications will not be truly stand-alone, as the " +"application will still need the Tcl and Tk libraries." msgstr "" +"Freeze ابزاری برای ایجاد برنامه‌های مستقل است. هنگام استفاده از Freeze برای " +"برنامه‌های Tkinter، این برنامه‌ها به‌طور کامل مستقل نخواهند بود، زیرا برنامه" +" همچنان به کتابخانه‌های Tcl و Tk نیاز دارد." -msgid "One solution is to ship the application with the Tcl and Tk libraries, and point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!TK_LIBRARY` environment variables." +msgid "" +"One solution is to ship the application with the Tcl and Tk libraries, and " +"point to them at run-time using the :envvar:`!TCL_LIBRARY` and " +":envvar:`!TK_LIBRARY` environment variables." msgstr "" +"یکی از راه‌حل‌ها این است که برنامه را همراه با کتابخانه‌های Tcl و Tk عرضه " +"کنید و در ران‌تایم با استفاده از متغیرهای محیطی :envvar:`!TCL_LIBRARY` و " +":envvar:`!TK_LIBRARY` به آن‌ها اشاره کنید." -msgid "Various third-party freeze libraries such as py2exe and cx_Freeze have handling for Tkinter applications built-in." +msgid "" +"Various third-party freeze libraries such as py2exe and cx_Freeze have " +"handling for Tkinter applications built-in." msgstr "" +"کتابخانه‌های فریز (freeze) شخص ثالث مختلفی مانند py2exe و cx_Freeze، " +"پشتیبانی توکار برای برنامه‌های Tkinter دارند." msgid "Can I have Tk events handled while waiting for I/O?" msgstr "" +"آیا می‌توانم در حین انتظار برای ورودی/خروجی، رویدادهای Tk را مدیریت کنم؟" -msgid "On platforms other than Windows, yes, and you don't even need threads! But you'll have to restructure your I/O code a bit. Tk has the equivalent of Xt's :c:func:`!XtAddInput` call, which allows you to register a callback function which will be called from the Tk mainloop when I/O is possible on a file descriptor. See :ref:`tkinter-file-handlers`." -msgstr "" +msgid "" +"On platforms other than Windows, yes, and you don't even need threads! But " +"you'll have to restructure your I/O code a bit. Tk has the equivalent of " +"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " +"function which will be called from the Tk mainloop when I/O is possible on a" +" file descriptor. See :ref:`tkinter-file-handlers`." +msgstr "" +"در سکوهای غیر از ویندوز، بله، و حتی نیازی به نخ‌ها ندارید! اما باید ساختار " +"کد ورودی/خروجی خود را کمی تغییر دهید. Tk معادلی از فراخوانی " +":c:func:`!XtAddInput` در Xt دارد، که به شما امکان می‌دهد یک تابع کال‌بک را " +"ثبت کنید تا هنگامی که ورودی/خروجی روی یک توصیف‌گر فایل امکان‌پذیر باشد، از " +"حلقه‌ی اصلی Tk فراخوانی شود. :ref:`tkinter-file-handlers` را ببینید." msgid "I can't get key bindings to work in Tkinter: why?" msgstr "" +"نمی‌توانم اتصال‌های کلید (key bindings) را در Tkinter به‌کار بیندازم: چرا؟" -msgid "An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when the appropriate key is pressed." +msgid "" +"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when" +" the appropriate key is pressed." msgstr "" +"شکایتی که اغلب شنیده می‌شود این است که هندلرهای رویداد :ref:`متصل ` به رویدادها با متد :meth:`!bind`، حتی زمانی که کلید مناسب فشرده" +" می‌شود، فراخوانی نمی‌شوند." -msgid "The most common cause is that the widget to which the binding applies doesn't have \"keyboard focus\". Check out the Tk documentation for the focus command. Usually a widget is given the keyboard focus by clicking in it (but not for labels; see the takefocus option)." -msgstr "" +msgid "" +"The most common cause is that the widget to which the binding applies " +"doesn't have \"keyboard focus\". Check out the Tk documentation for the " +"focus command. Usually a widget is given the keyboard focus by clicking in " +"it (but not for labels; see the takefocus option)." +msgstr "" +"شایع‌ترین علت این است که ابزارکی که اتصال به آن اعمال می‌شود، «تمرکز " +"صفحه‌کلید» ندارد. برای دستور focus به مستندات Tk مراجعه کنید. معمولاً با " +"کلیک کردن درون یک ابزارک، تمرکز صفحه‌کلید به آن داده می‌شود (اما نه برای " +"برچسب‌ها؛ گزینه takefocus را ببینید)." diff --git a/faq/index.po b/faq/index.po index 42f13aab8..fbafa9bbc 100644 --- a/faq/index.po +++ b/faq/index.po @@ -22,4 +22,4 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Python Frequently Asked Questions" -msgstr "" +msgstr "پرسش‌های متداول پایتون" diff --git a/faq/installed.po b/faq/installed.po index 66060f892..982edd1ca 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -24,46 +24,111 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "\"Why is Python Installed on my Computer?\" FAQ" -msgstr "" +msgstr "پرسش‌های متداول «چرا پایتون روی رایانه من نصب شده است؟»" msgid "What is Python?" -msgstr "" +msgstr "پایتون چیست؟" -msgid "Python is a programming language. It's used for many different applications. It's used in some high schools and colleges as an introductory programming language because Python is easy to learn, but it's also used by professional software developers at places such as Google, NASA, and Lucasfilm Ltd." -msgstr "" +msgid "" +"Python is a programming language. It's used for many different " +"applications. It's used in some high schools and colleges as an introductory" +" programming language because Python is easy to learn, but it's also used by" +" professional software developers at places such as Google, NASA, and " +"Lucasfilm Ltd." +msgstr "" +"پایتون یک زبان برنامه‌نویسی است. از آن برای کاربردهای بسیار گوناگونی استفاده" +" می‌شود. از پایتون در برخی دبیرستان‌ها و دانشکده‌ها به‌عنوان زبان " +"برنامه‌نویسی مقدماتی استفاده می‌شود، زیرا یادگیری پایتون آسان است، اما " +"توسعه‌دهندگان حرفه‌ای نرم‌افزار نیز در مکان‌هایی مانند Google، NASA و " +"Lucasfilm Ltd. از آن استفاده می‌کنند." -msgid "If you wish to learn more about Python, start with the `Beginner's Guide to Python `_." +msgid "" +"If you wish to learn more about Python, start with the `Beginner's Guide to " +"Python `_." msgstr "" +"اگر مایلید درباره پایتون بیشتر بیاموزید، با `راهنمای مبتدیان پایتون " +"`_ شروع کنید." msgid "Why is Python installed on my machine?" -msgstr "" +msgstr "چرا پایتون روی ماشین من نصب شده است؟" -msgid "If you find Python installed on your system but don't remember installing it, there are several possible ways it could have gotten there." +msgid "" +"If you find Python installed on your system but don't remember installing " +"it, there are several possible ways it could have gotten there." msgstr "" +"اگر پایتون را روی سیستم خود نصب‌شده یافتید اما به یاد نمی‌آورید که آن را نصب" +" کرده‌اید، چندین راه ممکن وجود دارد که به آن‌جا رسیده باشد." -msgid "Perhaps another user on the computer wanted to learn programming and installed it; you'll have to figure out who's been using the machine and might have installed it." +msgid "" +"Perhaps another user on the computer wanted to learn programming and " +"installed it; you'll have to figure out who's been using the machine and " +"might have installed it." msgstr "" +"شاید کاربر دیگری روی رایانه می‌خواسته برنامه‌نویسی یاد بگیرد و آن را نصب " +"کرده است؛ شما باید بررسی کنید که چه کسی از دستگاه استفاده می‌کرده و ممکن است" +" آن را نصب کرده باشد." -msgid "A third-party application installed on the machine might have been written in Python and included a Python installation. There are many such applications, from GUI programs to network servers and administrative scripts." -msgstr "" +msgid "" +"A third-party application installed on the machine might have been written " +"in Python and included a Python installation. There are many such " +"applications, from GUI programs to network servers and administrative " +"scripts." +msgstr "" +"ممکن است یک برنامه شخص ثالث نصب‌شده بر روی ماشین به زبان پایتون نوشته شده " +"باشد و شامل یک نصب پایتون نیز باشد. برنامه‌های زیادی از این دست وجود دارند، " +"از برنامه‌های رابط کاربری گرافیکی (GUI) تا سرورهای شبکه و اسکریپت‌های " +"مدیریتی." -msgid "Some Windows machines also have Python installed. At this writing we're aware of computers from Hewlett-Packard and Compaq that include Python. Apparently some of HP/Compaq's administrative tools are written in Python." -msgstr "" +msgid "" +"Some Windows machines also have Python installed. At this writing we're " +"aware of computers from Hewlett-Packard and Compaq that include Python. " +"Apparently some of HP/Compaq's administrative tools are written in Python." +msgstr "" +"برخی از رایانه‌های ویندوزی نیز دارای Python نصب‌شده هستند. در زمان نگارش این" +" متن، از رایانه‌هایی از Hewlett-Packard و Compaq آگاه هستیم که Python را " +"شامل می‌شوند. ظاهراً برخی از ابزارهای مدیریتی HP/Compaq با Python نوشته " +"شده‌اند." -msgid "Many Unix-compatible operating systems, such as macOS and some Linux distributions, have Python installed by default; it's included in the base installation." +msgid "" +"Many Unix-compatible operating systems, such as macOS and some Linux " +"distributions, have Python installed by default; it's included in the base " +"installation." msgstr "" +"در بسیاری از سیستم‌عامل‌های سازگار با یونیکس، مانند macOS و برخی توزیع‌های " +"لینوکس، پایتون به‌صورت پیش‌فرض نصب شده است؛ این زبان در نصب پایه گنجانده شده" +" است." msgid "Can I delete Python?" -msgstr "" +msgstr "آیا می‌توانم پایتون را حذف کنم؟" msgid "That depends on where Python came from." -msgstr "" +msgstr "این بستگی به این دارد که پایتون از کجا آمده باشد." -msgid "If someone installed it deliberately, you can remove it without hurting anything. On Windows, use the Add/Remove Programs icon in the Control Panel." +msgid "" +"If someone installed it deliberately, you can remove it without hurting " +"anything. On Windows, use the Add/Remove Programs icon in the Control " +"Panel." msgstr "" +"اگر کسی آن را عمداً نصب کرده است، می‌توانید بدون وارد کردن هیچ آسیبی آن را " +"حذف کنید. در ویندوز، از آیکون افزودن/حذف برنامه‌ها (Add/Remove Programs) در " +"کنترل پنل (Control Panel) استفاده کنید." -msgid "If Python was installed by a third-party application, you can also remove it, but that application will no longer work. You should use that application's uninstaller rather than removing Python directly." +msgid "" +"If Python was installed by a third-party application, you can also remove " +"it, but that application will no longer work. You should use that " +"application's uninstaller rather than removing Python directly." msgstr "" +"اگر پایتون توسط یک برنامه‌ی شخص ثالث نصب شده باشد، می‌توانید پایتون را نیز " +"حذف کنید، اما آن برنامه دیگر کار نخواهد کرد. باید به‌جای حذف مستقیم پایتون، " +"از حذف‌کننده‌ی آن برنامه استفاده کنید." -msgid "If Python came with your operating system, removing it is not recommended. If you remove it, whatever tools were written in Python will no longer run, and some of them might be important to you. Reinstalling the whole system would then be required to fix things again." -msgstr "" +msgid "" +"If Python came with your operating system, removing it is not recommended. " +"If you remove it, whatever tools were written in Python will no longer run, " +"and some of them might be important to you. Reinstalling the whole system " +"would then be required to fix things again." +msgstr "" +"اگر پایتون به همراه سیستم‌عامل شما نصب شده است، حذف آن توصیه نمی‌شود. اگر آن" +" را حذف کنید، هرکدام از ابزارهایی که به زبان پایتون نوشته شده باشند دیگر " +"اجرا نخواهند شد، و برخی از آن‌ها ممکن است برای شما مهم باشند. در آن صورت، " +"برای رفع مشکلات، نصب مجدد کل سیستم لازم خواهد بود." diff --git a/faq/library.po b/faq/library.po index 276d5c65f..d5d2f35a8 100644 --- a/faq/library.po +++ b/faq/library.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"PO-Revision-Date: 2026-08-28 11:10+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,77 +23,149 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Library and Extension FAQ" -msgstr "" +msgstr "پرسش‌های متداول کتابخانه و افزونه" msgid "Contents" -msgstr "" +msgstr "فهرست مطالب" msgid "General Library Questions" -msgstr "" +msgstr "پرسش‌های عمومی کتابخانه" msgid "How do I find a module or application to perform task X?" -msgstr "" +msgstr "چگونه می‌توانم یک ماژول یا برنامه برای انجام کار X پیدا کنم؟" -msgid "Check :ref:`the Library Reference ` to see if there's a relevant standard library module. (Eventually you'll learn what's in the standard library and will be able to skip this step.)" +msgid "" +"Check :ref:`the Library Reference ` to see if there's a " +"relevant standard library module. (Eventually you'll learn what's in the " +"standard library and will be able to skip this step.)" msgstr "" +"برای اینکه ببینید آیا ماژول مرتبطی در کتابخانه استاندارد وجود " +"دارد، :ref:`مرجع کتابخانه ` را بررسی کنید. (سرانجام یاد " +"خواهید گرفت که در کتابخانه استاندارد چه چیزهایی وجود دارد و خواهید توانست " +"این مرحله را رد کنید.)" -msgid "For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search engine. Searching for \"Python\" plus a keyword or two for your topic of interest will usually find something helpful." +msgid "" +"For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search " +"engine. Searching for \"Python\" plus a keyword or two for your topic of " +"interest will usually find something helpful." msgstr "" +"برای بسته‌های شخص ثالث، در `فهرست بسته‌های پایتون `_ جستجو " +"کنید یا `Google `_ یا موتور جستجوی وب دیگری را " +"امتحان کنید. جستجوی «Python» به‌همراه یک یا دو کلیدواژه برای موضوع مورد نظر " +"شما معمولاً به پیدا کردن موردی مفید منجر می‌شود." msgid "Where is the math.py (socket.py, regex.py, etc.) source file?" -msgstr "" +msgstr "فایل منبع math.py (socket.py، regex.py و غیره) کجاست؟" -msgid "If you can't find a source file for a module it may be a built-in or dynamically loaded module implemented in C, C++ or other compiled language. In this case you may not have the source file or it may be something like :file:`mathmodule.c`, somewhere in a C source directory (not on the Python Path)." -msgstr "" +msgid "" +"If you can't find a source file for a module it may be a built-in or " +"dynamically loaded module implemented in C, C++ or other compiled language. " +"In this case you may not have the source file or it may be something " +"like :file:`mathmodule.c`, somewhere in a C source directory (not on the " +"Python Path)." +msgstr "" +"اگر نمی‌توانید فایل منبعی برای یک ماژول پیدا کنید، ممکن است آن ماژول توکار " +"باشد یا ماژولی باشد که به‌صورت پویا بارگذاری می‌شود و در C، C++ یا زبان " +"کامپایل‌شده دیگری پیاده‌سازی شده است. در این حالت ممکن است فایل منبع را " +"نداشته باشید یا ممکن است چیزی مانند :file:`mathmodule.c` باشد، در جایی از " +"یک پوشه‌ی منبع C (نه در مسیر پایتون)." msgid "There are (at least) three kinds of modules in Python:" -msgstr "" +msgstr "در پایتون (دست‌کم) ۳ نوع ماژول وجود دارد:" msgid "modules written in Python (.py);" -msgstr "" +msgstr "ماژول‌های نوشته‌شده با پایتون (.py)؛" -msgid "modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);" +msgid "" +"modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);" msgstr "" +"ماژول‌های نوشته‌شده با C و بارگذاری‌شده به‌صورت پویا (.dll، .pyd، .so، .sl و " +"غیره)؛" -msgid "modules written in C and linked with the interpreter; to get a list of these, type::" +msgid "" +"modules written in C and linked with the interpreter; to get a list of " +"these, type::" msgstr "" +"ماژول‌هایی که به زبان C نوشته شده‌اند و با مفسر پیوند داده شده‌اند؛ برای " +"دریافت فهرستی از این موارد، تایپ کنید::" msgid "" "import sys\n" "print(sys.builtin_module_names)" msgstr "" +"import sys\n" +"print(sys.builtin_module_names)" msgid "How do I make a Python script executable on Unix?" -msgstr "" +msgstr "چگونه یک اسکریپت پایتون را در یونیکس قابل‌اجرا کنم؟" -msgid "You need to do two things: the script file's mode must be executable and the first line must begin with ``#!`` followed by the path of the Python interpreter." +msgid "" +"You need to do two things: the script file's mode must be executable and " +"the first line must begin with ``#!`` followed by the path of the Python " +"interpreter." msgstr "" +"شما باید دو کار انجام دهید: حالت فایل اسکریپت باید اجرایی باشد و خط اول " +"باید با ``#!`` آغاز شود و پس از آن مسیر مفسر پایتون قرار گیرد." -msgid "The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod 755 scriptfile``." +msgid "" +"The first is done by executing ``chmod +x scriptfile`` or perhaps ``chmod " +"755 scriptfile``." msgstr "" +"مورد اول با اجرای ``chmod +x scriptfile`` یا شاید ``chmod 755 scriptfile`` " +"انجام می‌شود." -msgid "The second can be done in a number of ways. The most straightforward way is to write ::" +msgid "" +"The second can be done in a number of ways. The most straightforward way " +"is to write ::" msgstr "" +"دومی را می‌توان به روش‌های مختلفی انجام داد. مستقیم‌ترین روش این است که " +"بنویسید ::" msgid "#!/usr/local/bin/python" -msgstr "" +msgstr "#!/usr/local/bin/python" -msgid "as the very first line of your file, using the pathname for where the Python interpreter is installed on your platform." +msgid "" +"as the very first line of your file, using the pathname for where the " +"Python interpreter is installed on your platform." msgstr "" +"به‌عنوان نخستین خط فایل شما، با استفاده از مسیر محل نصب مفسر پایتون در " +"پلتفرم شما." -msgid "If you would like the script to be independent of where the Python interpreter lives, you can use the :program:`env` program. Almost all Unix variants support the following, assuming the Python interpreter is in a directory on the user's :envvar:`PATH`::" +msgid "" +"If you would like the script to be independent of where the Python " +"interpreter lives, you can use the :program:`env` program. Almost all Unix " +"variants support the following, assuming the Python interpreter is in a " +"directory on the user's :envvar:`PATH`::" msgstr "" +"اگر می‌خواهید اسکریپت مستقل از محل قرارگیری مفسر پایتون باشد، می‌توانید از " +"برنامه‌ی :program:`env` استفاده کنید. تقریباً همه‌ی گونه‌های یونیکس از دستور زیر " +"پشتیبانی می‌کنند، با فرض اینکه مفسر پایتون در پوشه‌ای در :envvar:`PATH` کاربر " +"قرار داشته باشد::" msgid "#!/usr/bin/env python" -msgstr "" +msgstr "#!/usr/bin/env python" -msgid "*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI scripts is often very minimal, so you need to use the actual absolute pathname of the interpreter." +msgid "" +"*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI " +"scripts is often very minimal, so you need to use the actual absolute " +"pathname of the interpreter." msgstr "" +"این کار را برای اسکریپت‌های CGI *انجام ندهید*. متغیر :envvar:`PATH` برای " +"اسکریپت‌های CGI معمولاً بسیار محدود است، بنابراین باید از مسیر مطلق واقعی " +"مفسر استفاده کنید." -msgid "Occasionally, a user's environment is so full that the :program:`/usr/bin/env` program fails; or there's no env program at all. In that case, you can try the following hack (due to Alex Rezinsky):" +msgid "" +"Occasionally, a user's environment is so full that the :program:`/usr/bin/" +"env` program fails; or there's no env program at all. In that case, you " +"can try the following hack (due to Alex Rezinsky):" msgstr "" +"گاهی اوقات، محیط یک کاربر آن‌قدر پر است که برنامه‌ی :program:`/usr/bin/env` " +"شکست می‌خورد؛ یا اصلاً برنامه env وجود ندارد. در این صورت، می‌توانید ترفند زیر " +"را امتحان کنید (از الکس رزینسکی):" msgid "" "#! /bin/sh\n" @@ -101,114 +173,230 @@ msgid "" "exec python $0 ${1+\"$@\"}\n" "\"\"\"" msgstr "" +"#! /bin/sh\n" +"\"\"\":\"\n" +"exec python $0 ${1+\"$@\"}\n" +"\"\"\"" -msgid "The minor disadvantage is that this defines the script's __doc__ string. However, you can fix that by adding ::" +msgid "" +"The minor disadvantage is that this defines the script's __doc__ string. " +"However, you can fix that by adding ::" msgstr "" +"عیب جزئی این است که این کار رشته‌ی `__doc__` اسکریپت را تعریف می‌کند. با این " +"حال، می‌توانید با افزودن این علامت آن را برطرف کنید ::" msgid "__doc__ = \"\"\"...Whatever...\"\"\"" -msgstr "" +msgstr "__doc__ = \"\"\"...Whatever...\"\"\"" msgid "Is there a curses/termcap package for Python?" -msgstr "" +msgstr "آیا بسته‌ای برای curses/termcap در پایتون وجود دارد؟" -msgid "For Unix variants: The standard Python source distribution comes with a curses module in the :source:`Modules` subdirectory, though it's not compiled by default. (Note that this is not available in the Windows distribution -- there is no curses module for Windows.)" +msgid "" +"For Unix variants: The standard Python source distribution comes with a " +"curses module in the :source:`Modules` subdirectory, though it's not " +"compiled by default. (Note that this is not available in the Windows " +"distribution -- there is no curses module for Windows.)" msgstr "" +"برای انواع یونیکس: توزیع کد منبع استاندارد پایتون شامل ماژول curses در " +"زیرپوشه‌ی :source:`Modules` است، اگرچه به‌طور پیش‌فرض کامپایل نمی‌شود. (توجه " +"داشته باشید که این در توزیع ویندوز در دسترس نیست — ماژول curses برای ویندوز " +"وجود ندارد.)" -msgid "The :mod:`curses` module supports basic curses features as well as many additional functions from ncurses and SYSV curses such as colour, alternative character set support, pads, and mouse support. This means the module isn't compatible with operating systems that only have BSD curses, but there don't seem to be any currently maintained OSes that fall into this category." -msgstr "" +msgid "" +"The :mod:`curses` module supports basic curses features as well as many " +"additional functions from ncurses and SYSV curses such as colour, " +"alternative character set support, pads, and mouse support. This means the " +"module isn't compatible with operating systems that only have BSD curses, " +"but there don't seem to be any currently maintained OSes that fall into " +"this category." +msgstr "" +"ماژول :mod:`curses` از ویژگی‌های پایه‌ای curses و نیز بسیاری از توابع اضافی " +"ncurses و SYSV curses مانند رنگ، پشتیبانی از مجموعه نویسه‌های جایگزین، پدها " +"(pads) و پشتیبانی از ماوس پشتیبانی می‌کند. این بدان معناست که این ماژول با " +"سیستم‌عامل‌هایی که فقط دارای BSD curses هستند، سازگار نیست، اما به نظر نمی‌رسد " +"در حال حاضر هیچ سیستم‌عاملی که نگهداری می‌شود، در این دسته قرار داشته باشد." msgid "Is there an equivalent to C's onexit() in Python?" -msgstr "" +msgstr "آیا در پایتون معادلی برای onexit() در C وجود دارد؟" -msgid "The :mod:`atexit` module provides a register function that is similar to C's :c:func:`!onexit`." +msgid "" +"The :mod:`atexit` module provides a register function that is similar to " +"C's :c:func:`!onexit`." msgstr "" +"ماژول :mod:`atexit` یک تابع register فراهم می‌کند که مشابه :c:func:`!onexit` " +"در C است." msgid "Why don't my signal handlers work?" -msgstr "" +msgstr "چرا هندلرهای سیگنال من کار نمی‌کنند؟" -msgid "The most common problem is that the signal handler is declared with the wrong argument list. It is called as ::" +msgid "" +"The most common problem is that the signal handler is declared with the " +"wrong argument list. It is called as ::" msgstr "" +"رایج‌ترین مشکل این است که مدیر سیگنال با فهرست آرگومان نادرست تعریف شده " +"باشد. این تابع به‌صورت زیر فراخوانی می‌شود ::" msgid "handler(signum, frame)" -msgstr "" +msgstr "handler(signum, frame)" msgid "so it should be declared with two parameters::" -msgstr "" +msgstr "بنابراین باید با دو پارامتر تعریف شود::" msgid "" "def handler(signum, frame):\n" " ..." msgstr "" +"def handler(signum, frame):\n" +" ..." msgid "Common tasks" -msgstr "" +msgstr "وظایف رایج" msgid "How do I test a Python program or component?" -msgstr "" +msgstr "چگونه یک برنامه یا کامپوننت پایتون را آزمون کنم؟" -msgid "Python comes with two testing frameworks. The :mod:`doctest` module finds examples in the docstrings for a module and runs them, comparing the output with the expected output given in the docstring." +msgid "" +"Python comes with two testing frameworks. The :mod:`doctest` module finds " +"examples in the docstrings for a module and runs them, comparing the output " +"with the expected output given in the docstring." msgstr "" +"پایتون با دو چارچوب آزمون ارائه می‌شود. ماژول :mod:`doctest` مثال‌هایی را در " +"رشته مستندات‌های یک ماژول پیدا می‌کند، آن‌ها را اجرا می‌کند و خروجی را با خروجی " +"مورد انتظاری که در رشته مستندات آمده است مقایسه می‌کند." -msgid "The :mod:`unittest` module is a fancier testing framework modelled on Java and Smalltalk testing frameworks." +msgid "" +"The :mod:`unittest` module is a fancier testing framework modelled on Java " +"and Smalltalk testing frameworks." msgstr "" +"ماژول :mod:`unittest` یک چارچوب آزمون پیشرفته‌تر است که بر اساس چارچوب‌های آزمون " +"Java و Smalltalk الگوبرداری‌شده است." -msgid "To make testing easier, you should use good modular design in your program. Your program should have almost all functionality encapsulated in either functions or class methods -- and this sometimes has the surprising and delightful effect of making the program run faster (because local variable accesses are faster than global accesses). Furthermore the program should avoid depending on mutating global variables, since this makes testing much more difficult to do." -msgstr "" +msgid "" +"To make testing easier, you should use good modular design in your program. " +"Your program should have almost all functionality encapsulated in either " +"functions or class methods -- and this sometimes has the surprising and " +"delightful effect of making the program run faster (because local variable " +"accesses are faster than global accesses). Furthermore the program should " +"avoid depending on mutating global variables, since this makes testing much " +"more difficult to do." +msgstr "" +"برای آسان‌تر کردن آزمون، باید از طراحی ماژولار خوبی در برنامه خود استفاده " +"کنید. برنامه شما باید تقریباً تمام قابلیت‌ها را در قالب توابع یا متدهای کلاس " +"کپسوله کند -- و این گاهی اثر غافلگیرکننده و دلپذیری دارد که باعث می‌شود " +"برنامه سریع‌تر اجرا شود (زیرا دسترسی به متغیرهای محلی سریع‌تر از دسترسی به " +"متغیرهای سراسری است). علاوه بر این، برنامه باید از وابستگی به تغییر " +"متغیرهای سراسری پرهیز کند، زیرا این کار آزمون را بسیار دشوارتر می‌کند." msgid "The \"global main logic\" of your program may be as simple as ::" -msgstr "" +msgstr "«منطق اصلی سراسری» برنامه شما ممکن است به‌سادگی زیر باشد ::" msgid "" "if __name__ == \"__main__\":\n" " main_logic()" msgstr "" +"if __name__ == \"__main__\":\n" +" main_logic()" msgid "at the bottom of the main module of your program." -msgstr "" +msgstr "در انتهای ماژول اصلی برنامه‌تان." -msgid "Once your program is organized as a tractable collection of function and class behaviours, you should write test functions that exercise the behaviours. A test suite that automates a sequence of tests can be associated with each module. This sounds like a lot of work, but since Python is so terse and flexible it's surprisingly easy. You can make coding much more pleasant and fun by writing your test functions in parallel with the \"production code\", since this makes it easy to find bugs and even design flaws earlier." -msgstr "" +msgid "" +"Once your program is organized as a tractable collection of function and " +"class behaviours, you should write test functions that exercise the " +"behaviours. A test suite that automates a sequence of tests can be " +"associated with each module. This sounds like a lot of work, but since " +"Python is so terse and flexible it's surprisingly easy. You can make " +"coding much more pleasant and fun by writing your test functions in " +"parallel with the \"production code\", since this makes it easy to find " +"bugs and even design flaws earlier." +msgstr "" +"هنگامی که برنامه شما به‌صورت مجموعه‌ای قابل‌مدیریت از رفتارهای توابع و کلاس‌ها " +"سازمان‌دهی شد، باید توابع آزمونی بنویسید که این رفتارها را آزمایش کنند. برای " +"هر ماژول می‌توان یک مجموعه آزمون در نظر گرفت که دنباله‌ای از آزمون‌ها را خودکار " +"می‌کند. این کار ممکن است زیاد به نظر برسد، اما از آنجا که پایتون بسیار مختصر " +"و انعطاف‌پذیر است، به‌طرز شگفت‌آوری آسان است. شما می‌توانید با نوشتن توابع آزمون " +"خود به‌موازات «کد تولیدی»، کدنویسی را بسیار لذت‌بخش‌تر و سرگرم‌کننده‌تر کنید، " +"زیرا این کار یافتن باگ‌ها و حتی نقص‌های طراحی را زودتر آسان می‌کند." -msgid "\"Support modules\" that are not intended to be the main module of a program may include a self-test of the module. ::" +msgid "" +"\"Support modules\" that are not intended to be the main module of a " +"program may include a self-test of the module. ::" msgstr "" +"«ماژول‌های پشتیبانی» که به‌عنوان ماژول اصلی یک برنامه در نظر گرفته نشده‌اند، " +"ممکن است شامل خودآزمایی (self-test) ماژول باشند. ::" msgid "" "if __name__ == \"__main__\":\n" " self_test()" msgstr "" +"if __name__ == \"__main__\":\n" +" self_test()" -msgid "Even programs that interact with complex external interfaces may be tested when the external interfaces are unavailable by using \"fake\" interfaces implemented in Python." +msgid "" +"Even programs that interact with complex external interfaces may be tested " +"when the external interfaces are unavailable by using \"fake\" interfaces " +"implemented in Python." msgstr "" +"حتی برنامه‌هایی که با رابط‌های خارجی پیچیده تعامل دارند، می‌توانند هنگامی که " +"رابط‌های خارجی در دسترس نیستند، با استفاده از رابط‌های «جعلی» پیاده‌سازی‌شده در " +"پایتون آزمایش شوند." msgid "How do I create documentation from doc strings?" -msgstr "" +msgstr "چگونه از رشته‌های مستندسازی، مستندات بسازم؟" -msgid "The :mod:`pydoc` module can create HTML from the doc strings in your Python source code. An alternative for creating API documentation purely from docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." +msgid "" +"The :mod:`pydoc` module can create HTML from the doc strings in your Python " +"source code. An alternative for creating API documentation purely from " +"docstrings is `epydoc `_. `Sphinx " +"`_ can also include docstring content." msgstr "" +"ماژول :mod:`pydoc` می‌تواند از رشته مستندات در کد منبع پایتون " +"شما HTML تولید کند. یک جایگزین برای ایجاد مستندات API صرفاً از رشته مستندات " +"، `epydoc `_ است. `Sphinx " +"`_ نیز می‌تواند محتوای رشته مستندات " +"را شامل شود." msgid "How do I get a single keypress at a time?" -msgstr "" +msgstr "چگونه می‌توانم هر بار یک کلید را به‌صورت تکی دریافت کنم؟" -msgid "For Unix variants there are several solutions. It's straightforward to do this using curses, but curses is a fairly large module to learn." +msgid "" +"For Unix variants there are several solutions. It's straightforward to do " +"this using curses, but curses is a fairly large module to learn." msgstr "" +"برای گونه‌های یونیکس چندین راه‌حل وجود دارد. انجام این کار با استفاده از " +"curses ساده است، اما curses ماژول نسبتاً بزرگی برای یادگیری است." msgid "Threads" -msgstr "" +msgstr "نخ‌ها" msgid "How do I program using threads?" -msgstr "" +msgstr "چگونه با استفاده از نخ‌ها برنامه‌نویسی کنم؟" -msgid "Be sure to use the :mod:`threading` module and not the :mod:`_thread` module. The :mod:`threading` module builds convenient abstractions on top of the low-level primitives provided by the :mod:`_thread` module." +msgid "" +"Be sure to use the :mod:`threading` module and not the :mod:`_thread` " +"module. The :mod:`threading` module builds convenient abstractions on top " +"of the low-level primitives provided by the :mod:`_thread` module." msgstr "" +"حتماً از ماژول :mod:`threading` استفاده کنید، نه از ماژول :mod:`_thread`. " +"ماژول :mod:`threading` انتزاع‌های مناسبی بر پایه‌ی اولیه‌های سطح پایینِ " +"ارائه‌شده توسط ماژول :mod:`_thread` ایجاد می‌کند." msgid "None of my threads seem to run: why?" -msgstr "" +msgstr "به نظر می‌رسد هیچ‌کدام از نخ‌های من اجرا نمی‌شوند: چرا؟" -msgid "As soon as the main thread exits, all threads are killed. Your main thread is running too quickly, giving the threads no time to do any work." +msgid "" +"As soon as the main thread exits, all threads are killed. Your main thread " +"is running too quickly, giving the threads no time to do any work." msgstr "" +"به محض اینکه نخ اصلی خارج می‌شود، همه نخ‌ها از بین می‌روند. نخ اصلی شما بیش از " +"حد سریع اجرا می‌شود و هیچ زمانی برای انجام کار به نخ‌ها نمی‌دهد." -msgid "A simple fix is to add a sleep to the end of the program that's long enough for all the threads to finish::" +msgid "" +"A simple fix is to add a sleep to the end of the program that's long enough " +"for all the threads to finish::" msgstr "" +"یک راه‌حل ساده این است که یک توقف (sleep) به پایان برنامه اضافه کنید که به " +"اندازه کافی طولانی باشد تا همه نخ‌ها تمام شوند::" msgid "" "import threading, time\n" @@ -223,12 +411,31 @@ msgid "" "\n" "time.sleep(10) # <---------------------------!" msgstr "" +"import threading, time\n" +"\n" +"def thread_task(name, n):\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10) # <---------------------------!" -msgid "But now (on many platforms) the threads don't run in parallel, but appear to run sequentially, one at a time! The reason is that the OS thread scheduler doesn't start a new thread until the previous thread is blocked." +msgid "" +"But now (on many platforms) the threads don't run in parallel, but appear " +"to run sequentially, one at a time! The reason is that the OS thread " +"scheduler doesn't start a new thread until the previous thread is blocked." msgstr "" +"اما اکنون (در بسیاری از پلتفرم‌ها) نخ‌ها به‌صورت موازی اجرا نمی‌شوند، بلکه به " +"نظر می‌رسد به‌صورت ترتیبی، هر بار یک نخ، اجرا می‌شوند! دلیل آن این است که " +"زمان‌بند نخ‌های سیستم‌عامل تا زمانی که نخ قبلی مسدود نشده باشد، نخ جدیدی را " +"شروع نمی‌کند." msgid "A simple fix is to add a tiny sleep to the start of the run function::" msgstr "" +"یک راه‌حل ساده، افزودن یک توقف (sleep) بسیار کوتاه به ابتدای تابع run است::" msgid "" "def thread_task(name, n):\n" @@ -242,21 +449,57 @@ msgid "" "\n" "time.sleep(10)" msgstr "" +"def thread_task(name, n):\n" +" time.sleep(0.001) # <--------------------!\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10)" -msgid "Instead of trying to guess a good delay value for :func:`time.sleep`, it's better to use some kind of semaphore mechanism. One idea is to use the :mod:`queue` module to create a queue object, let each thread append a token to the queue when it finishes, and let the main thread read as many tokens from the queue as there are threads." -msgstr "" +msgid "" +"Instead of trying to guess a good delay value for :func:`time.sleep`, it's " +"better to use some kind of semaphore mechanism. One idea is to use " +"the :mod:`queue` module to create a queue object, let each thread append a " +"token to the queue when it finishes, and let the main thread read as many " +"tokens from the queue as there are threads." +msgstr "" +"به‌جای تلاش برای حدس زدن یک مقدار تأخیر مناسب برای :func:`time.sleep`، بهتر " +"است از نوعی سازوکار سمافور استفاده کنید. یک ایده این است که از " +"ماژول :mod:`queue` برای ایجاد یک شیء صف استفاده کنید، به هر نخ اجازه دهید " +"پس از پایان کار یک توکن به صف اضافه کند و نخ اصلی به تعداد نخ‌ها توکن از صف " +"بخواند." msgid "How do I parcel out work among a bunch of worker threads?" -msgstr "" +msgstr "چگونه کار را میان دسته‌ای از نخ‌های کارگر تقسیم کنم؟" -msgid "The easiest way is to use the :mod:`concurrent.futures` module, especially the :mod:`~concurrent.futures.ThreadPoolExecutor` class." +msgid "" +"The easiest way is to use the :mod:`concurrent.futures` module, especially " +"the :mod:`~concurrent.futures.ThreadPoolExecutor` class." msgstr "" +"ساده‌ترین راه، استفاده از ماژول :mod:`concurrent.futures`، به‌ویژه " +"کلاس :mod:`~concurrent.futures.ThreadPoolExecutor` است." -msgid "Or, if you want fine control over the dispatching algorithm, you can write your own logic manually. Use the :mod:`queue` module to create a queue containing a list of jobs. The :class:`~queue.Queue` class maintains a list of objects and has a ``.put(obj)`` method that adds items to the queue and a ``.get()`` method to return them. The class will take care of the locking necessary to ensure that each job is handed out exactly once." -msgstr "" +msgid "" +"Or, if you want fine control over the dispatching algorithm, you can write " +"your own logic manually. Use the :mod:`queue` module to create a queue " +"containing a list of jobs. The :class:`~queue.Queue` class maintains a " +"list of objects and has a ``.put(obj)`` method that adds items to the queue " +"and a ``.get()`` method to return them. The class will take care of the " +"locking necessary to ensure that each job is handed out exactly once." +msgstr "" +"یا، اگر می‌خواهید کنترل دقیقی بر الگوریتم توزیع داشته باشید، می‌توانید منطق " +"خود را به‌صورت دستی بنویسید. از ماژول :mod:`queue` برای ایجاد یک صف حاوی " +"فهرستی از کارها استفاده کنید. کلاس :class:`~queue.Queue` یک فهرست از شیء‌ها " +"را نگهداری می‌کند و دارای یک متد ``.put(obj)`` است که آیتم‌ها را به صف اضافه " +"می‌کند و یک متد ``.get()`` برای برگرداندن آن‌ها دارد. این کلاس قفل‌گذاری لازم " +"را برای اطمینان از اینکه هر کار دقیقاً یک بار تحویل داده شود، مدیریت می‌کند." msgid "Here's a trivial example::" -msgstr "" +msgstr "این یک مثال ساده است::" msgid "" "import threading, queue, time\n" @@ -295,9 +538,44 @@ msgid "" "print('Main thread sleeping')\n" "time.sleep(5)" msgstr "" +"import threading, queue, time\n" +"\n" +"# The worker thread gets jobs off the queue. When the queue is empty, it\n" +"# assumes there will be no more work and exits.\n" +"# (Realistically workers will run until terminated.)\n" +"def worker():\n" +" print('Running worker')\n" +" time.sleep(0.1)\n" +" while True:\n" +" try:\n" +" arg = q.get(block=False)\n" +" except queue.Empty:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('queue empty')\n" +" break\n" +" else:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('running with argument', arg)\n" +" time.sleep(0.5)\n" +"\n" +"# Create queue\n" +"q = queue.Queue()\n" +"\n" +"# Start a pool of 5 workers\n" +"for i in range(5):\n" +" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n" +" t.start()\n" +"\n" +"# Begin adding work to the queue\n" +"for i in range(50):\n" +" q.put(i)\n" +"\n" +"# Give threads time to run\n" +"print('Main thread sleeping')\n" +"time.sleep(5)" msgid "When run, this will produce the following output:" -msgstr "" +msgstr "هنگام اجرا، خروجی زیر تولید خواهد شد:" msgid "" "Running worker\n" @@ -314,21 +592,63 @@ msgid "" "Worker running with argument 5\n" "..." msgstr "" +"کارگر در حال اجرا\n" +"کارگر در حال اجرا\n" +"کارگر در حال اجرا\n" +"کارگر در حال اجرا\n" +"کارگر در حال اجرا\n" +"نخ اصلی متوقف شده است\n" +"کارگر با آرگومان ۰ در حال اجرا\n" +"کارگر با آرگومان ۱ در حال اجرا\n" +"کارگر با آرگومان ۲ در حال اجرا\n" +"کارگر با آرگومان ۳ در حال اجرا\n" +"کارگر با آرگومان ۴ در حال اجرا\n" +"کارگر با آرگومان ۵ در حال اجرا\n" +"..." -msgid "Consult the module's documentation for more details; the :class:`~queue.Queue` class provides a featureful interface." +msgid "" +"Consult the module's documentation for more details; " +"the :class:`~queue.Queue` class provides a featureful interface." msgstr "" +"برای جزئیات بیشتر، به مستندات ماژول مراجعه کنید؛ کلاس :class:`~queue.Queue` " +"رابطی پرامکانات ارائه می‌دهد." msgid "What kinds of global value mutation are thread-safe?" -msgstr "" +msgstr "چه انواعی از تغییر مقادیر سراسری ایمن در برابر نخ‌ها هستند؟" -msgid "A :term:`global interpreter lock` (GIL) is used internally to ensure that only one thread runs in the Python VM at a time. In general, Python offers to switch among threads only between bytecode instructions; how frequently it switches can be set via :func:`sys.setswitchinterval`. Each bytecode instruction and therefore all the C implementation code reached from each instruction is therefore atomic from the point of view of a Python program." -msgstr "" +msgid "" +"A :term:`global interpreter lock` (GIL) is used internally to ensure that " +"only one thread runs in the Python VM at a time. In general, Python offers " +"to switch among threads only between bytecode instructions; how frequently " +"it switches can be set via :func:`sys.setswitchinterval`. Each bytecode " +"instruction and therefore all the C implementation code reached from each " +"instruction is therefore atomic from the point of view of a Python program." +msgstr "" +"یک :term:`قفل سراسری مفسر ` (GIL) به‌صورت داخلی " +"استفاده می‌شود تا تضمین کند که در هر لحظه تنها یک نخ در ماشین مجازی پایتون " +"اجرا می‌شود. به‌طور کلی، پایتون تنها بین دستورالعمل‌های بایت‌کد امکان جابه‌جایی " +"میان نخ‌ها را فراهم می‌کند؛ میزان دفعات جابه‌جایی آن را می‌توان از " +"طریق :func:`sys.setswitchinterval` تنظیم کرد. هر دستورالعمل بایت‌کد، و " +"بنابراین تمام کد پیاده‌سازی C که از هر دستورالعمل قابل دسترسی است، از این رو " +"از دیدگاه یک برنامه پایتون اتمی محسوب می‌شود." -msgid "In theory, this means an exact accounting requires an exact understanding of the PVM bytecode implementation. In practice, it means that operations on shared variables of built-in data types (ints, lists, dicts, etc) that \"look atomic\" really are." +msgid "" +"In theory, this means an exact accounting requires an exact understanding " +"of the PVM bytecode implementation. In practice, it means that operations " +"on shared variables of built-in data types (ints, lists, dicts, etc) that " +"\"look atomic\" really are." msgstr "" +"از نظر تئوری، این بدان معناست که یک محاسبه‌ی دقیق نیازمند درک دقیق از " +"پیاده‌سازی بایت‌کد PVM است. در عمل، به این معناست که عملیات روی متغیرهای " +"مشترک از انواع داده‌ی توکار (اعداد صحیح، فهرست‌ها، دیکشنری‌ها و غیره) که «اتمی " +"به نظر می‌رسند»، واقعاً اتمی هستند." -msgid "For example, the following operations are all atomic (L, L1, L2 are lists, D, D1, D2 are dicts, x, y are objects, i, j are ints)::" +msgid "" +"For example, the following operations are all atomic (L, L1, L2 are lists, " +"D, D1, D2 are dicts, x, y are objects, i, j are ints)::" msgstr "" +"برای مثال، عملیات‌های زیر همگی اتمی هستند (L، L1 و L2 فهرست هستند، D، D1 و " +"D2 دیکشنری هستند، x و y شیء هستند، i و j عدد صحیح هستند)::" msgid "" "L.append(x)\n" @@ -343,9 +663,20 @@ msgid "" "D1.update(D2)\n" "D.keys()" msgstr "" +"L.append(x)\n" +"L1.extend(L2)\n" +"x = L[i]\n" +"x = L.pop()\n" +"L1[i:j] = L2\n" +"L.sort()\n" +"x = y\n" +"x.field = y\n" +"D[x] = y\n" +"D1.update(D2)\n" +"D.keys()" msgid "These aren't::" -msgstr "" +msgstr "این‌ها چنین نیستند::" msgid "" "i = i+1\n" @@ -353,66 +684,222 @@ msgid "" "L[i] = L[j]\n" "D[x] = D[x] + 1" msgstr "" +"i = i+1\n" +"L.append(L[-1])\n" +"L[i] = L[j]\n" +"D[x] = D[x] + 1" -msgid "Operations that replace other objects may invoke those other objects' :meth:`~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!" +msgid "" +"Operations that replace other objects may invoke those other " +"objects' :meth:`~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:`~object.__del__` آن‌ها را فراخوانی کنند، " +"و این می‌تواند بر مواردی اثر بگذارد. این موضوع به‌ویژه برای به‌روزرسانی‌های " +"انبوه دیکشنری‌ها و فهرست‌ها صادق است. در صورت تردید، از یک قفل (mutex) " +"استفاده کنید!" msgid "Can't we get rid of the Global Interpreter Lock?" -msgstr "" +msgstr "آیا نمی‌توانیم قفل سراسری مفسر را حذف کنیم؟" -msgid "The :term:`global interpreter lock` (GIL) is often seen as a hindrance to Python's deployment on high-end multiprocessor server machines, because a multi-threaded Python program effectively only uses one CPU, due to the insistence that (almost) all Python code can only run while the GIL is held." +msgid "" +"The :term:`global interpreter lock` (GIL) is often seen as a hindrance to " +"Python's deployment on high-end multiprocessor server machines, because a " +"multi-threaded Python program effectively only uses one CPU, due to the " +"insistence that (almost) all Python code can only run while the GIL is held." msgstr "" +":term:`global interpreter lock` (GIL) اغلب به‌عنوان مانعی برای استقرار " +"پایتون روی ماشین‌های سرور چندپردازنده‌ای رده‌بالا در نظر گرفته می‌شود، زیرا یک " +"برنامه چندنخی پایتون عملاً تنها از یک CPU استفاده می‌کند، به دلیل این الزام " +"که (تقریباً) تمام کد پایتون تنها زمانی می‌تواند اجرا شود که GIL در اختیار " +"گرفته شده باشد." -msgid "With the approval of :pep:`703` work is now underway to remove the GIL from the CPython implementation of Python. Initially it will be implemented as an optional compiler flag when building the interpreter, and so separate builds will be available with and without the GIL. Long-term, the hope is to settle on a single build, once the performance implications of removing the GIL are fully understood. Python 3.13 is likely to be the first release containing this work, although it may not be completely functional in this release." -msgstr "" +msgid "" +"With the approval of :pep:`703` work is now underway to remove the GIL from " +"the CPython implementation of Python. Initially it will be implemented as " +"an optional compiler flag when building the interpreter, and so separate " +"builds will be available with and without the GIL. Long-term, the hope is " +"to settle on a single build, once the performance implications of removing " +"the GIL are fully understood. Python 3.13 is likely to be the first " +"release containing this work, although it may not be completely functional " +"in this release." +msgstr "" +"با تصویب :pep:`703`، اکنون کار برای حذف GIL از پیاده‌سازی CPython از پایتون " +"در جریان است. در ابتدا، این کار به‌صورت یک پرچم اختیاری کامپایلر هنگام ساخت " +"مفسر پیاده‌سازی خواهد شد، بنابراین ساخت‌های جداگانه‌ای با GIL و بدون GIL در " +"دسترس خواهند بود. در بلندمدت، امید است پس از آنکه پیامدهای عملکردی حذف GIL " +"به‌طور کامل درک شوند، به یک ساخت واحد برسیم. احتمالاً پایتون 3.13 اولین " +"نسخه‌ای خواهد بود که شامل این کار می‌شود، اگرچه ممکن است در این نسخه کاملاً " +"کاربردی نباشد." -msgid "The current work to remove the GIL is based on a `fork of Python 3.9 with the GIL removed `_ by Sam Gross. Prior to that, in the days of Python 1.5, Greg Stein actually implemented a comprehensive patch set (the \"free threading\" patches) that removed the GIL and replaced it with fine-grained locking. Adam Olsen did a similar experiment in his `python-safethread `_ project. Unfortunately, both of these earlier experiments exhibited a sharp drop in single-thread performance (at least 30% slower), due to the amount of fine-grained locking necessary to compensate for the removal of the GIL. The Python 3.9 fork is the first attempt at removing the GIL with an acceptable performance impact." -msgstr "" +msgid "" +"The current work to remove the GIL is based on a `fork of Python 3.9 with " +"the GIL removed `_ by Sam Gross. Prior " +"to that, in the days of Python 1.5, Greg Stein actually implemented a " +"comprehensive patch set (the \"free threading\" patches) that removed the " +"GIL and replaced it with fine-grained locking. Adam Olsen did a similar " +"experiment in his `python-safethread `_ project. Unfortunately, both of these earlier " +"experiments exhibited a sharp drop in single-thread performance (at least " +"30% slower), due to the amount of fine-grained locking necessary to " +"compensate for the removal of the GIL. The Python 3.9 fork is the first " +"attempt at removing the GIL with an acceptable performance impact." +msgstr "" +"کار جاری برای حذف GIL بر پایه‌ی `انشعاب (fork) Python 3.9 با GIL حذف‌شده " +"`_ از Sam Gross است. پیش از آن، در " +"دوران Python 1.5، Greg Stein در واقع مجموعه‌ای جامع از وصله‌ها (وصله‌های «free " +"threading») را پیاده‌سازی کرد که GIL را حذف می‌کرد و آن را با قفل‌بندی ریزدانه " +"جایگزین می‌نمود. Adam Olsen آزمایش مشابهی را در پروژه‌ی `python-safethread " +"`_ خود انجام داد. " +"متأسفانه، هر دوی این آزمایش‌های پیشین افت شدیدی را در عملکرد تک‌نخی (حداقل " +"۳۰٪ کندتر) نشان دادند، که به دلیل میزان قفل‌بندی ریزدانه‌ای بود که برای جبران " +"حذف GIL لازم بود. انشعاب Python 3.9 نخستین تلاش برای حذف GIL با تأثیر " +"قابل‌قبول بر عملکرد است." -msgid "The presence of the GIL in current Python releases doesn't mean that you can't make good use of Python on multi-CPU machines! You just have to be creative with dividing the work up between multiple *processes* rather than multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` class in the new :mod:`concurrent.futures` module provides an easy way of doing so; the :mod:`multiprocessing` module provides a lower-level API in case you want more control over dispatching of tasks." -msgstr "" +msgid "" +"The presence of the GIL in current Python releases doesn't mean that you " +"can't make good use of Python on multi-CPU machines! You just have to be " +"creative with dividing the work up between multiple *processes* rather than " +"multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` " +"class in the new :mod:`concurrent.futures` module provides an easy way of " +"doing so; the :mod:`multiprocessing` module provides a lower-level API in " +"case you want more control over dispatching of tasks." +msgstr "" +"وجود GIL در نسخه‌های فعلی پایتون به این معنا نیست که نمی‌توانید از پایتون روی " +"ماشین‌های چندپردازنده به‌خوبی استفاده کنید! شما فقط باید در تقسیم کار میان " +"چندین *فرآیند* به‌جای چندین *نخ* خلاقانه عمل کنید. " +"کلاس :class:`~concurrent.futures.ProcessPoolExecutor` در ماژول " +"جدید :mod:`concurrent.futures` راه آسانی برای انجام این کار فراهم می‌کند؛ " +"ماژول :mod:`multiprocessing` یک API سطح پایین‌تر را در صورتی که بخواهید " +"کنترل بیشتری بر اعزام وظایف داشته باشید، فراهم می‌کند." -msgid "Judicious use of C extensions will also help; if you use a C extension to perform a time-consuming task, the extension can release the GIL while the thread of execution is in the C code and allow other threads to get some work done. Some standard library modules such as :mod:`zlib` and :mod:`hashlib` already do this." -msgstr "" +msgid "" +"Judicious use of C extensions will also help; if you use a C extension to " +"perform a time-consuming task, the extension can release the GIL while the " +"thread of execution is in the C code and allow other threads to get some " +"work done. Some standard library modules such as :mod:`zlib` " +"and :mod:`hashlib` already do this." +msgstr "" +"استفاده سنجیده از افزونه‌های C نیز کمک خواهد کرد؛ اگر از یک افزونه C برای " +"انجام یک کار زمان‌بر استفاده کنید، افزونه می‌تواند در حالی که نخ اجرا در کد C " +"است، GIL را آزاد کند و به نخ‌های دیگر اجازه دهد تا مقداری کار انجام دهند. " +"برخی از ماژول‌های کتابخانه استاندارد مانند :mod:`zlib` و :mod:`hashlib` از " +"قبل این کار را انجام می‌دهند." -msgid "An alternative approach to reducing the impact of the GIL is to make the GIL a per-interpreter-state lock rather than truly global. This was :ref:`first implemented in Python 3.12 ` and is available in the C API. A Python interface to it is expected in Python 3.13. The main limitation to it at the moment is likely to be 3rd party extension modules, since these must be written with multiple interpreters in mind in order to be usable, so many older extension modules will not be usable." -msgstr "" +msgid "" +"An alternative approach to reducing the impact of the GIL is to make the " +"GIL a per-interpreter-state lock rather than truly global. This " +"was :ref:`first implemented in Python 3.12 ` and is " +"available in the C API. A Python interface to it is expected in Python " +"3.13. The main limitation to it at the moment is likely to be 3rd party " +"extension modules, since these must be written with multiple interpreters " +"in mind in order to be usable, so many older extension modules will not be " +"usable." +msgstr "" +"یک رویکرد جایگزین برای کاهش تأثیر GIL این است که GIL به‌جای کاملاً سراسری " +"بودن، به قفلی به‌ازای هر وضعیت مفسر تبدیل شود. این مورد :ref:`برای نخستین " +"بار در Python 3.12 پیاده‌سازی شد ` و در C API در دسترس " +"است. انتظار می‌رود یک رابط پایتون برای آن در Python 3.13 ارائه شود. در حال " +"حاضر محدودیت اصلی آن احتمالاً ماژول‌های افزونه‌ای شخص ثالث هستند، زیرا این " +"ماژول‌ها برای قابل‌استفاده بودن باید با در نظر گرفتن چند مفسر نوشته شوند، " +"بنابراین بسیاری از ماژول‌های افزونه‌ای قدیمی‌تر قابل‌استفاده نخواهند بود." msgid "Input and Output" -msgstr "" +msgstr "ورودی و خروجی" msgid "How do I delete a file? (And other file questions...)" -msgstr "" +msgstr "چگونه یک فایل را حذف کنم؟ (و دیگر پرسش‌های مربوط به فایل...)" -msgid "Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, see the :mod:`os` module. The two functions are identical; :func:`~os.unlink` is simply the name of the Unix system call for this function." +msgid "" +"Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, " +"see the :mod:`os` module. The two functions are " +"identical; :func:`~os.unlink` is simply the name of the Unix system call " +"for this function." msgstr "" +"از ``os.remove(filename)`` یا ``os.unlink(filename)`` استفاده کنید؛ برای " +"مستندات، ماژول :mod:`os` را ببینید. این دو تابع یکسان " +"هستند؛ :func:`~os.unlink` صرفاً نام فراخوانی سیستمی یونیکس برای این تابع است." -msgid "To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create one. ``os.makedirs(path)`` will create any intermediate directories in ``path`` that don't exist. ``os.removedirs(path)`` will remove intermediate directories as long as they're empty; if you want to delete an entire directory tree and its contents, use :func:`shutil.rmtree`." -msgstr "" +msgid "" +"To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create " +"one. ``os.makedirs(path)`` will create any intermediate directories in " +"``path`` that don't exist. ``os.removedirs(path)`` will remove intermediate " +"directories as long as they're empty; if you want to delete an entire " +"directory tree and its contents, use :func:`shutil.rmtree`." +msgstr "" +"برای حذف یک پوشه، از :func:`os.rmdir` استفاده کنید؛ برای ایجاد یک پوشه، " +"از :func:`os.mkdir` استفاده کنید. ``os.makedirs(path)`` هر پوشه میانی در " +"``path`` را که وجود نداشته باشد ایجاد می‌کند. ``os.removedirs(path)`` " +"پوشه‌های میانی را تا زمانی که خالی باشند حذف می‌کند؛ اگر می‌خواهید کل درخت " +"پوشه و محتویات آن را حذف کنید، از :func:`shutil.rmtree` استفاده کنید." msgid "To rename a file, use ``os.rename(old_path, new_path)``." msgstr "" +"برای تغییر نام یک فایل، از ``os.rename(old_path, new_path)`` استفاده کنید." -msgid "To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use ``f.truncate(offset)``; offset defaults to the current seek position. There's also ``os.ftruncate(fd, offset)`` for files opened with :func:`os.open`, where *fd* is the file descriptor (a small integer)." +msgid "" +"To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use " +"``f.truncate(offset)``; offset defaults to the current seek position. " +"There's also ``os.ftruncate(fd, offset)`` for files opened " +"with :func:`os.open`, where *fd* is the file descriptor (a small integer)." msgstr "" +"برای بریدنیک فایل، آن را با استفاده از ``f = open(filename, " +"\"rb+\")`` باز کنید و از ``f.truncate(offset)`` استفاده کنید؛ مقدار پیش‌فرض " +"offset، موقعیت فعلی seek است. همچنین ``os.ftruncate(fd, offset)`` برای " +"فایل‌هایی که با :func:`os.open` باز شده‌اند نیز وجود دارد، که در آن *fd* " +"توصیف‌گر فایل (یک عدد صحیح کوچک) است." -msgid "The :mod:`shutil` module also contains a number of functions to work on files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :func:`~shutil.rmtree`." +msgid "" +"The :mod:`shutil` module also contains a number of functions to work on " +"files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, " +"and :func:`~shutil.rmtree`." msgstr "" +"ماژول :mod:`shutil` همچنین شامل تعدادی تابع برای کار بر روی فایل‌ها، از " +"جمله :func:`~shutil.copyfile`، :func:`~shutil.copytree` " +"و :func:`~shutil.rmtree` است." msgid "How do I copy a file?" -msgstr "" +msgstr "چگونه یک فایل را کپی کنم؟" -msgid "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note that on Windows NTFS volumes, it does not copy `alternate data streams `_ nor `resource forks `__ on macOS HFS+ volumes, though both are now rarely used. It also doesn't copy file permissions and metadata, though using :func:`shutil.copy2` instead will preserve most (though not all) of it." -msgstr "" +msgid "" +"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " +"that on Windows NTFS volumes, it does not copy `alternate data streams " +"`_ nor " +"`resource forks `__ on macOS " +"HFS+ volumes, though both are now rarely used. It also doesn't copy file " +"permissions and metadata, though using :func:`shutil.copy2` instead will " +"preserve most (though not all) of it." +msgstr "" +"ماژول :mod:`shutil` شامل یک تابع :func:`~shutil.copyfile` است. توجه داشته " +"باشید که این تابع در حجم‌های NTFS در ویندوز، `جریان‌های داده جایگزین " +"(alternate data streams) `_ و در " +"حجم‌های HFS+ در macOS، `فورک‌های منبع (resource forks) `__ را کپی نمی‌کند، اگرچه امروزه هر دو " +"به‌ندرت استفاده می‌شوند. همچنین مجوزها و فراداده‌های فایل را کپی نمی‌کند، اگرچه " +"استفاده از :func:`shutil.copy2` به‌جای آن، بیشتر آن‌ها را (هرچند نه همه) حفظ " +"می‌کند." msgid "How do I read (or write) binary data?" -msgstr "" +msgstr "چگونه داده‌های دودویی را بخوانم (یا بنویسم)؟" -msgid "To read or write complex binary data formats, it's best to use the :mod:`struct` module. It allows you to take a string containing binary data (usually numbers) and convert it to Python objects; and vice versa." +msgid "" +"To read or write complex binary data formats, it's best to use " +"the :mod:`struct` module. It allows you to take a string containing binary " +"data (usually numbers) and convert it to Python objects; and vice versa." msgstr "" +"برای خواندن یا نوشتن قالب‌های داده دودویی پیچیده، بهتر است از " +"ماژول :mod:`struct` استفاده کنید. این ماژول به شما امکان می‌دهد رشته‌ای حاوی " +"داده دودویی (معمولاً اعداد) را بگیرید و آن را به اشیای پایتون تبدیل کنید؛ و " +"برعکس." -msgid "For example, the following code reads two 2-byte integers and one 4-byte integer in big-endian format from a file::" +msgid "" +"For example, the following code reads two 2-byte integers and one 4-byte " +"integer in big-endian format from a file::" msgstr "" +"برای مثال، کد زیر دو عدد صحیح ۲ بایتی و یک عدد صحیح ۴ بایتی را در قالب " +"بزرگ‌اندیان (big-endian) از یک فایل می‌خواند::" msgid "" "import struct\n" @@ -421,87 +908,175 @@ msgid "" " s = f.read(8)\n" " x, y, z = struct.unpack(\">hhl\", s)" msgstr "" +"import struct\n" +"\n" +"with open(filename, \"rb\") as f:\n" +" s = f.read(8)\n" +" x, y, z = struct.unpack(\">hhl\", s)" -msgid "The '>' in the format string forces big-endian data; the letter 'h' reads one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 bytes) from the string." +msgid "" +"The '>' in the format string forces big-endian data; the letter 'h' reads " +"one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " +"bytes) from the string." msgstr "" +"'>' در رشته قالب، داده‌های بزرگ‌اندیان (big-endian) را تحمیل می‌کند؛ حرف 'h' " +"یک «عدد صحیح کوتاه» (۲ بایت) و 'l' یک «عدد صحیح بلند» (۴ بایت) را از رشته " +"می‌خواند." -msgid "For data that is more regular (e.g. a homogeneous list of ints or floats), you can also use the :mod:`array` module." +msgid "" +"For data that is more regular (e.g. a homogeneous list of ints or floats), " +"you can also use the :mod:`array` module." msgstr "" +"برای داده‌هایی که منظم‌تر هستند (مثلاً فهرستی همگن از اعداد صحیح یا شناور)، " +"همچنین می‌توانید از ماژول :mod:`array` استفاده کنید." -msgid "To read and write binary data, it is mandatory to open the file in binary mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` instead (the default), the file will be open in text mode and ``f.read()`` will return :class:`str` objects rather than :class:`bytes` objects." +msgid "" +"To read and write binary data, it is mandatory to open the file in binary " +"mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " +"instead (the default), the file will be open in text mode and ``f.read()`` " +"will return :class:`str` objects rather than :class:`bytes` objects." msgstr "" +"برای خواندن و نوشتن داده‌های دودویی، باز کردن فایل در حالت دودویی الزامی است " +"(در اینجا، با ارسال ``\"rb\"`` به :func:`open`). اگر به‌جای آن از ``\"r\"`` " +"استفاده کنید (پیش‌فرض)، فایل در حالت متنی باز خواهد شد و ``f.read()`` به‌جای " +"اشیای :class:`bytes `، اشیای :class:`str ` را برمی‌گرداند." msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" +"به نظر می‌رسد نمی‌توانم از os.read() روی یک پایپایجادشده با " +"os.popen() استفاده کنم؛ چرا؟" -msgid ":func:`os.read` is a low-level function which takes a file descriptor, a small integer representing the opened file. :func:`os.popen` creates a high-level file object, the same type returned by the built-in :func:`open` function. Thus, to read *n* bytes from a pipe *p* created with :func:`os.popen`, you need to use ``p.read(n)``." -msgstr "" +msgid "" +":func:`os.read` is a low-level function which takes a file descriptor, a " +"small integer representing the opened file. :func:`os.popen` creates a " +"high-level file object, the same type returned by the built-in :func:`open` " +"function. Thus, to read *n* bytes from a pipe *p* created " +"with :func:`os.popen`, you need to use ``p.read(n)``." +msgstr "" +":func:`os.read` یک تابع سطح پایین است که یک توصیف‌گر فایل (file descriptor)، " +"یعنی یک عدد صحیح کوچک که فایل باز شده را نشان می‌دهد، " +"می‌گیرد. :func:`os.popen` یک شیء فایل سطح بالا ایجاد می‌کند، همان نوعی که " +"تابع توکار :func:`open` برمی‌گرداند. بنابراین، برای خواندن *n* بایت از پایپ " +" *p* که با :func:`os.popen` ایجاد شده است، باید از ``p.read(n)`` " +"استفاده کنید." msgid "How do I access the serial (RS232) port?" -msgstr "" +msgstr "چگونه به درگاه سریال (RS232) دسترسی پیدا کنم؟" msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" -msgstr "" +msgstr "برای Win32، OSX، Linux، BSD، Jython، IronPython:" msgid ":pypi:`pyserial`" -msgstr "" +msgstr ":pypi:`pyserial`" msgid "For Unix, see a Usenet post by Mitch Chapman:" -msgstr "" +msgstr "برای یونیکس، یک پست یوزنت از میچ چپمن را ببینید:" msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" -msgstr "" +msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" -msgstr "" +msgstr "چرا بستن sys.stdout (stdin, stderr) واقعاً آن را نمی‌بندد؟" -msgid "Python :term:`file objects ` are a high-level layer of abstraction on low-level C file descriptors." +msgid "" +"Python :term:`file objects ` are a high-level layer of " +"abstraction on low-level C file descriptors." msgstr "" +":term:`اشیای فایل ` در پایتون، یک لایه انتزاعی سطح بالا بر روی " +"توصیف‌گرهای فایل سطح پایین C هستند." -msgid "For most file objects you create in Python via the built-in :func:`open` function, ``f.close()`` marks the Python file object as being closed from Python's point of view, and also arranges to close the underlying C file descriptor. This also happens automatically in ``f``'s destructor, when ``f`` becomes garbage." -msgstr "" +msgid "" +"For most file objects you create in Python via the built-in :func:`open` " +"function, ``f.close()`` marks the Python file object as being closed from " +"Python's point of view, and also arranges to close the underlying C file " +"descriptor. This also happens automatically in ``f``'s destructor, when " +"``f`` becomes garbage." +msgstr "" +"برای بیشتر اشیای فایلی که در پایتون از طریق تابع توکار :func:`open` ایجاد " +"می‌کنید، ``f.close()`` شیء فایل پایتون را از دید پایتون به‌عنوان بسته‌شده " +"علامت‌گذاری می‌کند و همچنین مقدمات بستن توصیف‌گر فایل زیربنایی C را فراهم " +"می‌کند. این اتفاق نیز به‌طور خودکار در تخریب‌کننده‌ی ``f``، هنگامی که ``f`` به " +"زباله تبدیل می‌شود، رخ می‌دهد." -msgid "But stdin, stdout and stderr are treated specially by Python, because of the special status also given to them by C. Running ``sys.stdout.close()`` marks the Python-level file object as being closed, but does *not* close the associated C file descriptor." +msgid "" +"But stdin, stdout and stderr are treated specially by Python, because of " +"the special status also given to them by C. Running ``sys.stdout.close()`` " +"marks the Python-level file object as being closed, but does *not* close " +"the associated C file descriptor." msgstr "" +"اما پایتون stdin، stdout و stderr را به‌طور ویژه مدیریت می‌کند، زیرا C نیز " +"وضعیت ویژه‌ای به آن‌ها داده است. اجرای ``sys.stdout.close()`` شیء فایل در سطح " +"پایتون را به‌عنوان بسته‌شده علامت‌گذاری می‌کند، اما توصیف‌گر فایل C مرتبط را " +"*نمی‌بندد*." -msgid "To close the underlying C file descriptor for one of these three, you should first be sure that's what you really want to do (e.g., you may confuse extension modules trying to do I/O). If it is, use :func:`os.close`::" +msgid "" +"To close the underlying C file descriptor for one of these three, you " +"should first be sure that's what you really want to do (e.g., you may " +"confuse extension modules trying to do I/O). If it is, " +"use :func:`os.close`::" msgstr "" +"برای بستن توصیف‌گر فایل C زیربنایی برای یکی از این سه مورد، ابتدا باید مطمئن " +"شوید که واقعاً همین کار را می‌خواهید انجام دهید (برای مثال، ممکن است ماژول‌های " +"توسعه‌ای را که سعی در انجام I/O دارند، دچار سردرگمی کنید). اگر چنین است، " +"از :func:`os.close` استفاده کنید::" msgid "" "os.close(stdin.fileno())\n" "os.close(stdout.fileno())\n" "os.close(stderr.fileno())" msgstr "" +"os.close(stdin.fileno())\n" +"os.close(stdout.fileno())\n" +"os.close(stderr.fileno())" msgid "Or you can use the numeric constants 0, 1 and 2, respectively." -msgstr "" +msgstr "یا می‌توانید به‌ترتیب از ثابت‌های عددی 0، 1 و 2 استفاده کنید." msgid "Network/Internet Programming" -msgstr "" +msgstr "برنامه‌نویسی شبکه/اینترنت" msgid "What WWW tools are there for Python?" -msgstr "" +msgstr "چه ابزارهای WWW برای پایتون وجود دارد؟" -msgid "See the chapters titled :ref:`internet` and :ref:`netdata` in the Library Reference Manual. Python has many modules that will help you build server-side and client-side web systems." +msgid "" +"See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " +"Reference Manual. Python has many modules that will help you build server-" +"side and client-side web systems." msgstr "" +"به فصل‌هایی با عنوان‌های :ref:`internet` و :ref:`netdata` در راهنمای مرجع " +"کتابخانه مراجعه کنید. پایتون ماژول‌های بسیاری دارد که به شما در ساخت " +"سیستم‌های وب سمت سرور و سمت کاربر کمک خواهند کرد." -msgid "A summary of available frameworks is maintained by Paul Boddie at https://wiki.python.org/moin/WebProgramming\\ ." +msgid "" +"A summary of available frameworks is maintained by Paul Boddie at https://" +"wiki.python.org/moin/WebProgramming\\ ." msgstr "" +"خلاصه‌ای از چارچوب‌های موجود توسط Paul Boddie در https://wiki.python.org/moin/" +"WebProgramming\\ نگهداری می‌شود." msgid "What module should I use to help with generating HTML?" -msgstr "" +msgstr "برای کمک به تولید HTML از چه ماژولی باید استفاده کنم؟" -msgid "You can find a collection of useful links on the `Web Programming wiki page `_." +msgid "" +"You can find a collection of useful links on the `Web Programming wiki page " +"`_." msgstr "" +"می‌توانید مجموعه‌ای از پیوندهای مفید را در `صفحه‌ی ویکی برنامه‌نویسی وب " +"`_ بیابید." msgid "How do I send mail from a Python script?" -msgstr "" +msgstr "چگونه از یک اسکریپت پایتون ایمیل ارسال کنم؟" msgid "Use the standard library module :mod:`smtplib`." -msgstr "" +msgstr "از ماژول کتابخانه استاندارد :mod:`smtplib` استفاده کنید." -msgid "Here's a very simple interactive mail sender that uses it. This method will work on any host that supports an SMTP listener. ::" +msgid "" +"Here's a very simple interactive mail sender that uses it. This method " +"will work on any host that supports an SMTP listener. ::" msgstr "" +"در اینجا یک فرستنده‌ی تعاملی بسیار ساده‌ی ایمیل آمده است که از آن استفاده " +"می‌کند. این روش روی هر میزبانی که از یک شنونده‌ی SMTP پشتیبانی کند کار خواهد " +"کرد. ::" msgid "" "import sys, smtplib\n" @@ -521,9 +1096,33 @@ msgid "" "server.sendmail(fromaddr, toaddrs, msg)\n" "server.quit()" msgstr "" +"import sys, smtplib\n" +"\n" +"fromaddr = input(\"From: \")\n" +"toaddrs = input(\"To: \").split(',')\n" +"print(\"Enter message, end with ^D:\")\n" +"msg = ''\n" +"while True:\n" +" line = sys.stdin.readline()\n" +" if not line:\n" +" break\n" +" msg += line\n" +"\n" +"# The actual mail send\n" +"server = smtplib.SMTP('localhost')\n" +"server.sendmail(fromaddr, toaddrs, msg)\n" +"server.quit()" -msgid "A Unix-only alternative uses sendmail. The location of the sendmail program varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/usr/sbin/sendmail``. The sendmail manual page will help you out. Here's some sample code::" +msgid "" +"A Unix-only alternative uses sendmail. The location of the sendmail " +"program varies between systems; sometimes it is ``/usr/lib/sendmail``, " +"sometimes ``/usr/sbin/sendmail``. The sendmail manual page will help you " +"out. Here's some sample code::" msgstr "" +"یک جایگزین مختص یونیکس از sendmail استفاده می‌کند. مکان برنامه‌ی sendmail در " +"سیستم‌های مختلف متفاوت است؛ گاهی ``/usr/lib/sendmail`` و گاهی ``/usr/sbin/" +"sendmail`` است. صفحه‌ی راهنمای sendmail به شما کمک خواهد کرد. در ادامه یک " +"نمونه کد آمده است::" msgid "" "import os\n" @@ -539,80 +1138,164 @@ msgid "" "if sts != 0:\n" " print(\"Sendmail exit status\", sts)" msgstr "" +"import os\n" +"\n" +"SENDMAIL = \"/usr/sbin/sendmail\" # sendmail location\n" +"p = os.popen(\"%s -t -i\" % SENDMAIL, \"w\")\n" +"p.write(\"To: receiver@example.com\\n\")\n" +"p.write(\"Subject: test\\n\")\n" +"p.write(\"\\n\") # blank line separating headers from body\n" +"p.write(\"Some text\\n\")\n" +"p.write(\"some more text\\n\")\n" +"sts = p.close()\n" +"if sts != 0:\n" +" print(\"Sendmail exit status\", sts)" msgid "How do I avoid blocking in the connect() method of a socket?" -msgstr "" +msgstr "چگونه از مسدود شدن در متد connect() یک سوکت جلوگیری کنم؟" -msgid "The :mod:`select` module is commonly used to help with asynchronous I/O on sockets." +msgid "" +"The :mod:`select` module is commonly used to help with asynchronous I/O on " +"sockets." msgstr "" +"ماژول :mod:`select` معمولاً برای کمک به ورودی/خروجی ناهمگام روی سوکت‌ها " +"استفاده می‌شود." -msgid "To prevent the TCP connect from blocking, you can set the socket to non-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 "" +msgid "" +"To prevent the TCP connect from blocking, you can set the socket to non-" +"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، می‌توانید سوکت را در حالت غیرمسدودکننده " +"قرار دهید. سپس وقتی :meth:`~socket.socket.connect` را فراخوانی می‌کنید، یا " +"بلافاصله متصل می‌شوید (که بعید است) یا استثنایی دریافت می‌کنید که حاوی شماره " +"خطا در ``.errno`` است. ``errno.EINPROGRESS`` نشان می‌دهد که اتصال در حال " +"انجام است، اما هنوز تمام نشده است. سیستم‌عامل‌های مختلف مقادیر متفاوتی " +"برمی‌گردانند، بنابراین باید بررسی کنید که در سیستم شما چه مقداری برگردانده " +"می‌شود." -msgid "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 "" +msgid "" +"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.socket.connect_ex` برای جلوگیری از ایجاد یک " +"استثنا استفاده کنید. این متد فقط مقدار errno را برمی‌گرداند. برای پایش، " +"می‌توانید بعداً دوباره :meth:`~socket.socket.connect_ex` را فراخوانی کنید — " +"``0`` یا ``errno.EISCONN`` نشان می‌دهند که شما متصل هستید — یا می‌توانید این " +"سوکت را به :meth:`select.select` بدهید تا قابل نوشتن بودن آن را بررسی کنید." -msgid "The :mod:`asyncio` module provides a general purpose single-threaded and concurrent asynchronous library, which can be used for writing non-blocking network code. The third-party `Twisted `_ library is a popular and feature-rich alternative." +msgid "" +"The :mod:`asyncio` module provides a general purpose single-threaded and " +"concurrent asynchronous library, which can be used for writing non-blocking " +"network code. The third-party `Twisted `_ library is " +"a popular and feature-rich alternative." msgstr "" +"ماژول :mod:`asyncio` یک کتابخانه همه‌منظوره، ناهمگام، تک‌نخی و همروند ارائه " +"می‌دهد که می‌توان از آن برای نوشتن کد شبکه غیرمسدودکننده استفاده کرد. " +"کتابخانه شخص ثالث `Twisted `_ یک جایگزین محبوب و " +"پرامکانات است." msgid "Databases" -msgstr "" +msgstr "پایگاه‌های داده" msgid "Are there any interfaces to database packages in Python?" -msgstr "" +msgstr "آیا در پایتون رابط‌هایی برای بسته‌های پایگاه داده وجود دارد؟" msgid "Yes." -msgstr "" +msgstr "بله." -msgid "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM ` are also included with standard Python. There is also the :mod:`sqlite3` module, which provides a lightweight disk-based relational database." +msgid "" +"Interfaces to disk-based hashes such as :mod:`DBM ` " +"and :mod:`GDBM ` are also included with standard Python. There is " +"also the :mod:`sqlite3` module, which provides a lightweight disk-based " +"relational database." msgstr "" +"رابط‌هایی برای هش‌های مبتنی بر دیسک مانند :mod:`DBM ` و :mod:`GDBM " +"` نیز در پایتون استاندارد گنجانده شده‌اند. همچنین " +"ماژول :mod:`sqlite3` وجود دارد که یک پایگاه داده‌ی رابطه‌ای سبک مبتنی بر دیسک " +"فراهم می‌کند." -msgid "Support for most relational databases is available. See the `DatabaseProgramming wiki page `_ for details." +msgid "" +"Support for most relational databases is available. See the " +"`DatabaseProgramming wiki page `_ for details." msgstr "" +"پشتیبانی از بیشتر پایگاه‌داده‌های رابطه‌ای در دسترس است. برای جزئیات، `صفحه‌ی " +"ویکی DatabaseProgramming `_ را ببینید." msgid "How do you implement persistent objects in Python?" -msgstr "" +msgstr "چگونه اشیاء پایا را در پایتون پیاده‌سازی می‌کنید؟" -msgid "The :mod:`pickle` library module solves this in a very general way (though you still can't store things like open files, sockets or windows), and the :mod:`shelve` library module uses pickle and (g)dbm to create persistent mappings containing arbitrary Python objects." +msgid "" +"The :mod:`pickle` library module solves this in a very general way (though " +"you still can't store things like open files, sockets or windows), and " +"the :mod:`shelve` library module uses pickle and (g)dbm to create " +"persistent mappings containing arbitrary Python objects." msgstr "" +"ماژول کتابخانه‌ای :mod:`pickle` این مسئله را به‌شکلی بسیار عمومی حل می‌کند " +"(هرچند هنوز نمی‌توانید چیزهایی مانند فایل‌های باز، سوکت‌ها یا پنجره‌ها را ذخیره " +"کنید)، و ماژول کتابخانه‌ای :mod:`shelve` از pickle و (g)dbm برای ایجاد " +"نگاشت‌های پایا شامل اشیاء پایتون دلخواه استفاده می‌کند." msgid "Mathematics and Numerics" -msgstr "" +msgstr "ریاضیات و محاسبات عددی" msgid "How do I generate random numbers in Python?" -msgstr "" +msgstr "چگونه در پایتون اعداد تصادفی تولید کنم؟" -msgid "The standard module :mod:`random` implements a random number generator. Usage is simple::" +msgid "" +"The standard module :mod:`random` implements a random number generator. " +"Usage is simple::" msgstr "" +"ماژول استاندارد :mod:`random` یک تولیدگر عدد تصادفی را پیاده‌سازی می‌کند. " +"نحوه استفاده ساده است::" msgid "" "import random\n" "random.random()" msgstr "" +"import random\n" +"random.random()" msgid "This returns a random floating-point number in the range [0, 1)." -msgstr "" +msgstr "این یک عدد ممیز شناور تصادفی در بازه‌ی [۰، ۱) برمی‌گرداند." -msgid "There are also many other specialized generators in this module, such as:" -msgstr "" +msgid "" +"There are also many other specialized generators in this module, such as:" +msgstr "در این ماژول، تولیدگرهای تخصصی بسیاری نیز وجود دارند، مانند:" msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." -msgstr "" +msgstr "``randrange(a, b)`` یک عدد صحیح را در بازه‌ی [a, b) انتخاب می‌کند." msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)." -msgstr "" +msgstr "``uniform(a, b)`` یک عدد ممیز شناور در بازه [a, b) انتخاب می‌کند." -msgid "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." -msgstr "" +msgid "" +"``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." +msgstr "``normalvariate(mean, sdev)`` از توزیع نرمال (گاوسی) نمونه‌گیری می‌کند." msgid "Some higher-level functions operate on sequences directly, such as:" -msgstr "" +msgstr "برخی از توابع سطح‌بالا مستقیماً روی دنباله‌ها عمل می‌کنند، از جمله:" msgid "``choice(S)`` chooses a random element from a given sequence." -msgstr "" +msgstr "``choice(S)`` یک المان تصادفی را از یک دنباله داده‌شده انتخاب می‌کند." msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" +"``shuffle(L)`` یک فهرست را درجا جابه‌جا می‌کند، یعنی آن را به‌صورت تصادفی " +"جایگشت می‌دهد." -msgid "There's also a ``Random`` class you can instantiate to create independent multiple random number generators." +msgid "" +"There's also a ``Random`` class you can instantiate to create independent " +"multiple random number generators." msgstr "" +"همچنین یک کلاس ``Random`` وجود دارد که می‌توانید نمونه‌ای از آن بسازید تا " +"چندین تولیدگر عدد تصادفی مستقل ایجاد کنید." diff --git a/faq/programming.po b/faq/programming.po index 2ce5cbea7..75e8fca36 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"PO-Revision-Date: 2026-08-28 11:12+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,153 +23,339 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Programming FAQ" -msgstr "" +msgstr "پرسش‌های متداول برنامه‌نویسی" msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "General questions" -msgstr "" +msgstr "پرسش‌های عمومی" -msgid "Is there a source code-level debugger with breakpoints and single-stepping?" -msgstr "" +msgid "" +"Is there a source code-level debugger with breakpoints and single-stepping?" +msgstr "آیا یک اشکال‌زدای سطح کد منبع با نقاط توقف و اجرای گام‌به‌گام وجود دارد؟" msgid "Yes." -msgstr "" +msgstr "بله." -msgid "Several debuggers for Python are described below, and the built-in function :func:`breakpoint` allows you to drop into any of them." +msgid "" +"Several debuggers for Python are described below, and the built-in " +"function :func:`breakpoint` allows you to drop into any of them." msgstr "" +"چندین اشکال‌زدا برای پایتون در زیر توضیح داده شده‌اند، و تابع " +"توکار :func:`breakpoint` به شما امکان می‌دهد وارد هر یک از آن‌ها شوید." -msgid "The pdb module is a simple but adequate console-mode debugger for Python. It is part of the standard Python library, and is :mod:`documented in the Library Reference Manual `. You can also write your own debugger by using the code for pdb as an example." +msgid "" +"The pdb module is a simple but adequate console-mode debugger for Python. " +"It is part of the standard Python library, and is :mod:`documented in the " +"Library Reference Manual `. You can also write your own debugger by " +"using the code for pdb as an example." msgstr "" +"ماژول pdb یک اشکال‌زدای ساده اما کافی در حالت کنسول برای پایتون است. این " +"ماژول بخشی از کتابخانه استاندارد پایتون است و :mod:`مستند شده در راهنمای " +"مرجع کتابخانه ` است. همچنین می‌توانید با استفاده از کد pdb به‌عنوان " +"مثال، اشکال‌زدای خودتان را بنویسید." -msgid "The IDLE interactive development environment, which is part of the standard Python distribution (normally available as :mod:`idlelib`), includes a graphical debugger." +msgid "" +"The IDLE interactive development environment, which is part of the standard " +"Python distribution (normally available as :mod:`idlelib`), includes a " +"graphical debugger." msgstr "" +"محیط توسعه تعاملی IDLE، که بخشی از توزیع استاندارد پایتون است (معمولاً " +"به‌صورت :mod:`idlelib` در دسترس است)، شامل یک اشکال‌زدا گرافیکی است." -msgid "PythonWin is a Python IDE that includes a GUI debugger based on pdb. The PythonWin debugger colors breakpoints and has quite a few cool features such as debugging non-PythonWin programs. PythonWin is available as part of `pywin32 `_ project and as a part of the `ActivePython `_ distribution." -msgstr "" +msgid "" +"PythonWin is a Python IDE that includes a GUI debugger based on pdb. The " +"PythonWin debugger colors breakpoints and has quite a few cool features " +"such as debugging non-PythonWin programs. PythonWin is available as part " +"of `pywin32 `_ project and as a part " +"of the `ActivePython `_ " +"distribution." +msgstr "" +"PythonWin یک محیط توسعه یکپارچه (IDE) برای پایتون است که شامل یک اشکال‌زدای " +"مبتنی بر pdb با رابط کاربری گرافیکی (GUI) است. اشکال‌زدای PythonWin نقاط " +"شکست را رنگی نمایش می‌دهد و قابلیت‌های جالب توجه متعددی مانند اشکال‌زدایی " +"برنامه‌هایی غیر از PythonWin دارد. PythonWin به‌عنوان بخشی از پروژه‌ی `pywin32 " +"`_ و به‌عنوان بخشی از توزیع " +"`ActivePython `_ در دسترس است." -msgid "`Eric `_ is an IDE built on PyQt and the Scintilla editing component." +msgid "" +"`Eric `_ is an IDE built on PyQt and " +"the Scintilla editing component." msgstr "" +"`Eric `_ یک IDE است که بر پایه PyQt " +"و کامپوننت ویرایش Scintilla ساخته شده است." -msgid "`trepan3k `_ is a gdb-like debugger." +msgid "" +"`trepan3k `_ is a gdb-like " +"debugger." msgstr "" +"`trepan3k `_ یک اشکال‌زدای شبیه به " +"gdb است." -msgid "`Visual Studio Code `_ is an IDE with debugging tools that integrates with version-control software." +msgid "" +"`Visual Studio Code `_ is an IDE with " +"debugging tools that integrates with version-control software." msgstr "" +"`Visual Studio Code `_ یک محیط توسعه " +"یکپارچه (IDE) با ابزارهای اشکال‌زدایی است که با نرم‌افزار کنترل نسخه یکپارچه " +"می‌شود." -msgid "There are a number of commercial Python IDEs that include graphical debuggers. They include:" +msgid "" +"There are a number of commercial Python IDEs that include graphical " +"debuggers. They include:" msgstr "" +"تعدادی IDE تجاری پایتون وجود دارند که شامل اشکال‌زداهای گرافیکی هستند. این " +"موارد شامل:" msgid "`Wing IDE `_" -msgstr "" +msgstr "`Wing IDE `_" msgid "`PyCharm `_" -msgstr "" +msgstr "`PyCharm `_" msgid "Are there tools to help find bugs or perform static analysis?" -msgstr "" +msgstr "آیا ابزارهایی برای کمک به یافتن خطاها یا انجام تحلیل ایستا وجود دارد؟" -msgid "`Ruff `__, `Pylint `__ and `Pyflakes `__ do basic checking that will help you catch bugs sooner." +msgid "" +"`Ruff `__, `Pylint `__ and `Pyflakes `__ do basic checking that will help you catch bugs sooner." msgstr "" +"`Ruff `__، `Pylint `__ و `Pyflakes `__ بررسی‌های پایه‌ای انجام می‌دهند که به شما کمک می‌کند اشکال‌ها را " +"زودتر پیدا کنید." -msgid "Static type checkers such as `mypy `__, `ty `__, `Pyrefly `__, and `pytype `__ can check type hints in Python source code." +msgid "" +"Static type checkers such as `mypy `__, `ty " +"`__, `Pyrefly `__, and " +"`pytype `__ can check type hints in " +"Python source code." msgstr "" +"بررسی‌کننده‌های نوع ایستا مانند `mypy `__، `ty " +"`__، `Pyrefly `__ و " +"`pytype `__ می‌توانند راهنمایی‌های نوع را " +"در کد منبع پایتون بررسی کنند." msgid "How can I create a stand-alone binary from a Python script?" -msgstr "" +msgstr "چگونه می‌توانم از یک اسکریپت پایتون یک دودویی مستقل بسازم؟" -msgid "You don't need the ability to compile Python to C code if all you want is a stand-alone program that users can download and run without having to install the Python distribution first. There are a number of tools that determine the set of modules required by a program and bind these modules together with a Python binary to produce a single executable." -msgstr "" +msgid "" +"You don't need the ability to compile Python to C code if all you want is a " +"stand-alone program that users can download and run without having to " +"install the Python distribution first. There are a number of tools that " +"determine the set of modules required by a program and bind these modules " +"together with a Python binary to produce a single executable." +msgstr "" +"اگر تمام خواسته شما برنامه‌ای مستقل است که کاربران بتوانند بدون نیاز به نصب " +"توزیع پایتون در ابتدا، آن را دانلود و اجرا کنند، نیازی به قابلیت کامپایل " +"پایتون به کد C ندارید. ابزارهای متعددی وجود دارند که مجموعه ماژول‌های مورد " +"نیاز یک برنامه را تعیین می‌کنند و این ماژول‌ها را به همراه یک دودویی پایتون " +"به هم مقید می‌کنند تا یک فایل اجرایی واحد تولید شود." -msgid "One is to use the freeze tool, which is included in the Python source tree as :source:`Tools/freeze`. It converts Python byte code to C arrays; with a C compiler you can embed all your modules into a new program, which is then linked with the standard Python modules." +msgid "" +"One is to use the freeze tool, which is included in the Python source tree " +"as :source:`Tools/freeze`. It converts Python byte code to C arrays; with a " +"C compiler you can embed all your modules into a new program, which is then " +"linked with the standard Python modules." msgstr "" +"یکی استفاده از ابزار freeze است که در درخت منبع پایتون " +"به‌صورت :source:`Tools/freeze` گنجانده شده است. این ابزار بایت‌کد پایتون را " +"به آرایه‌های C تبدیل می‌کند؛ با یک کامپایلر C می‌توانید همه ماژول‌های خود را در " +"یک برنامه جدید تعبیه کنید، که سپس با ماژول‌های استاندارد پایتون پیوند داده " +"می‌شود." -msgid "It works by scanning your source recursively for import statements (in both forms) and looking for the modules in the standard Python path as well as in the source directory (for built-in modules). It then turns the bytecode for modules written in Python into C code (array initializers that can be turned into code objects using the marshal module) and creates a custom-made config file that only contains those built-in modules which are actually used in the program. It then compiles the generated C code and links it with the rest of the Python interpreter to form a self-contained binary which acts exactly like your script." -msgstr "" +msgid "" +"It works by scanning your source recursively for import statements (in both " +"forms) and looking for the modules in the standard Python path as well as " +"in the source directory (for built-in modules). It then turns the bytecode " +"for modules written in Python into C code (array initializers that can be " +"turned into code objects using the marshal module) and creates a custom-" +"made config file that only contains those built-in modules which are " +"actually used in the program. It then compiles the generated C code and " +"links it with the rest of the Python interpreter to form a self-contained " +"binary which acts exactly like your script." +msgstr "" +"این ابزار با اسکن بازگشتی کد منبع شما به‌دنبال دستورات ایمپورت (در هر دو " +"شکل) و جست‌وجوی ماژول‌ها در مسیر استاندارد پایتون و همچنین در پوشه منبع (برای " +"ماژول‌های توکار) کار می‌کند. سپس بایت‌کد ماژول‌های نوشته‌شده با پایتون را به کد " +"C تبدیل می‌کند (مقداردهی‌های اولیه آرایه که می‌توان آن‌ها را با استفاده از " +"ماژول marshal به اشیای کد تبدیل کرد) و یک فایل پیکربندی سفارشی ایجاد می‌کند " +"که فقط شامل آن ماژول‌های توکاری است که واقعاً در برنامه به‌کار رفته‌اند. سپس کد " +"C تولیدشده را کامپایل می‌کند و آن را با بقیه مفسر پایتون پیوند می‌دهد تا یک " +"دودویی خودکفا تشکیل شود که دقیقاً مانند اسکریپت شما عمل می‌کند." -msgid "The following packages can help with the creation of console and GUI executables:" +msgid "" +"The following packages can help with the creation of console and GUI " +"executables:" msgstr "" +"بسته‌های زیر می‌توانند به ایجاد فایل‌های اجرایی برای کنسول و رابط کاربری " +"گرافیکی (GUI) کمک کنند:" msgid "`Nuitka `_ (Cross-platform)" -msgstr "" +msgstr "`Nuitka `_ (چندسکویی)" msgid "`PyInstaller `_ (Cross-platform)" -msgstr "" +msgstr "`PyInstaller `_ (چندسکویی)" -msgid "`PyOxidizer `_ (Cross-platform)" +msgid "" +"`PyOxidizer `_ (Cross-" +"platform)" msgstr "" +"`PyOxidizer `_ (چندسکویی)" -msgid "`cx_Freeze `_ (Cross-platform)" +msgid "" +"`cx_Freeze `_ (Cross-platform)" msgstr "" +"`cx_Freeze `_ (میان‌سکویی)" msgid "`py2app `_ (macOS only)" -msgstr "" +msgstr "`py2app `_ (فقط macOS)" msgid "`py2exe `_ (Windows only)" -msgstr "" +msgstr "`py2exe `_ (فقط ویندوز)" msgid "Are there coding standards or a style guide for Python programs?" msgstr "" +"آیا برای برنامه‌های پایتون، استانداردهای کدنویسی یا راهنمای سبکی وجود دارد؟" -msgid "Yes. The coding style required for standard library modules is documented as :pep:`8`." +msgid "" +"Yes. The coding style required for standard library modules is documented " +"as :pep:`8`." msgstr "" +"بله. سبک کدنویسی مورد نیاز برای ماژول‌های کتابخانه استاندارد، در :pep:`8` " +"مستند شده است." msgid "Core language" -msgstr "" +msgstr "زبان اصلی" msgid "Why am I getting an UnboundLocalError when the variable has a value?" -msgstr "" +msgstr "چرا وقتی متغیر دارای مقدار است، خطای UnboundLocalError دریافت می‌کنم؟" -msgid "It can be a surprise to get the :exc:`UnboundLocalError` in previously working code when it is modified by adding an assignment statement somewhere in the body of a function." +msgid "" +"It can be a surprise to get the :exc:`UnboundLocalError` in previously " +"working code when it is modified by adding an assignment statement " +"somewhere in the body of a function." msgstr "" +"ممکن است در کدی که پیش‌تر کار می‌کرد، پس از اصلاح آن با افزودن یک دستور " +"انتساب در جایی از بدنه یک تابع، دریافت :exc:`UnboundLocalError` " +"غافلگیرکننده باشد." msgid "This code:" -msgstr "" +msgstr "این کد:" msgid "works, but this code:" -msgstr "" +msgstr "کار می‌کند، اما این کد:" msgid "results in an :exc:`!UnboundLocalError`:" -msgstr "" +msgstr "منجر به :exc:`!UnboundLocalError` می‌شود:" -msgid "This is because when you make an assignment to a variable in a scope, that variable becomes local to that scope and shadows any similarly named variable in the outer scope. Since the last statement in foo assigns a new value to ``x``, the compiler recognizes it as a local variable. Consequently when the earlier ``print(x)`` attempts to print the uninitialized local variable and an error results." -msgstr "" +msgid "" +"This is because when you make an assignment to a variable in a scope, that " +"variable becomes local to that scope and shadows any similarly named " +"variable in the outer scope. Since the last statement in foo assigns a new " +"value to ``x``, the compiler recognizes it as a local variable. " +"Consequently when the earlier ``print(x)`` attempts to print the " +"uninitialized local variable and an error results." +msgstr "" +"این به این دلیل است که وقتی در یک محدوده به یک متغیر انتساب می‌دهید، آن " +"متغیر برای آن محدوده محلی می‌شود و هر متغیر هم‌نام در محدوده بیرونی را " +"می‌پوشاند. از آنجا که آخرین دستور در foo مقدار جدیدی به ``x`` اختصاص می‌دهد، " +"کامپایلر آن را به‌عنوان یک متغیر محلی می‌شناسد. در نتیجه، وقتی ``print(x)`` " +"قبلی تلاش می‌کند متغیر محلی مقداردهی‌نشده را چاپ کند، خطایی رخ می‌دهد." -msgid "In the example above you can access the outer scope variable by declaring it global:" +msgid "" +"In the example above you can access the outer scope variable by declaring " +"it global:" msgstr "" +"در مثال بالا می‌توانید با سراسری اعلام کردن متغیر محدوده بیرونی، به آن " +"دسترسی داشته باشید:" -msgid "This explicit declaration is required in order to remind you that (unlike the superficially analogous situation with class and instance variables) you are actually modifying the value of the variable in the outer scope:" +msgid "" +"This explicit declaration is required in order to remind you that (unlike " +"the superficially analogous situation with class and instance variables) " +"you are actually modifying the value of the variable in the outer scope:" msgstr "" +"این اعلام صریح لازم است تا به شما یادآوری کند که (برخلاف موقعیت به‌ظاهر " +"مشابه با متغیرهای کلاس و نمونه) شما در واقع مقدار متغیر را در محدوده بیرونی " +"تغییر می‌دهید:" -msgid "You can do a similar thing in a nested scope using the :keyword:`nonlocal` keyword:" +msgid "" +"You can do a similar thing in a nested scope using the :keyword:`nonlocal` " +"keyword:" msgstr "" +"شما می‌توانید کار مشابهی را در یک محدوده‌ی تودرتو با استفاده از " +"کلیدواژه :keyword:`nonlocal` انجام دهید:" msgid "What are the rules for local and global variables in Python?" -msgstr "" +msgstr "قوانین متغیرهای محلی و سراسری در پایتون چیست؟" -msgid "In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a value anywhere within the function's body, it's assumed to be a local unless explicitly declared as global." +msgid "" +"In Python, variables that are only referenced inside a function are " +"implicitly global. If a variable is assigned a value anywhere within the " +"function's body, it's assumed to be a local unless explicitly declared as " +"global." msgstr "" +"در پایتون، متغیرهایی که فقط درون یک تابع به آن‌ها ارجاع داده می‌شوند، به‌طور " +"ضمنی سراسری هستند. اگر به متغیری در هر جایی از بدنه‌ی تابع مقداری انتساب " +"داده شود، آن متغیر محلی فرض می‌شود، مگر اینکه به‌صراحت به‌عنوان سراسری اعلام " +"شود." -msgid "Though a bit surprising at first, a moment's consideration explains this. On one hand, requiring :keyword:`global` for assigned variables provides a bar against unintended side-effects. On the other hand, if ``global`` was required for all global references, you'd be using ``global`` all the time. You'd have to declare as global every reference to a built-in function or to a component of an imported module. This clutter would defeat the usefulness of the ``global`` declaration for identifying side-effects." -msgstr "" +msgid "" +"Though a bit surprising at first, a moment's consideration explains this. " +"On one hand, requiring :keyword:`global` for assigned variables provides a " +"bar against unintended side-effects. On the other hand, if ``global`` was " +"required for all global references, you'd be using ``global`` all the " +"time. You'd have to declare as global every reference to a built-in " +"function or to a component of an imported module. This clutter would " +"defeat the usefulness of the ``global`` declaration for identifying side-" +"effects." +msgstr "" +"هرچند این موضوع در ابتدا کمی تعجب‌آور است، اما با کمی تأمل قابل توضیح است. " +"از یک سو، الزام به استفاده از :keyword:`global` برای متغیرهایی که به آن‌ها " +"انتساب داده می‌شود، مانعی در برابر عوارض جانبی ناخواسته ایجاد می‌کند. از سوی " +"دیگر، اگر ``global`` برای همه ارجاعات سراسری الزامی بود، همواره از " +"``global`` استفاده می‌کردید. مجبور بودید هر ارجاع به یک تابع توکار یا به یک " +"کامپوننت از یک ماژول ایمپورت‌شده را به‌عنوان سراسری اعلام کنید. این شلوغی، " +"سودمندی اعلام ``global`` را برای شناسایی عوارض جانبی از بین می‌برد." -msgid "Why do lambdas defined in a loop with different values all return the same result?" +msgid "" +"Why do lambdas defined in a loop with different values all return the same " +"result?" msgstr "" +"چرا لامبداهای تعریف‌شده در یک حلقه با مقادیر مختلف، همگی نتیجه‌ی یکسانی را " +"برمی‌گردانند؟" -msgid "Assume you use a for loop to define a few different lambdas (or even plain functions), for example::" +msgid "" +"Assume you use a for loop to define a few different lambdas (or even plain " +"functions), for example::" msgstr "" +"فرض کنید با استفاده از یک حلقه for، چند لامبدای متفاوت (یا حتی توابع ساده) " +"تعریف می‌کنید، برای مثال::" msgid "" ">>> squares = []\n" ">>> for x in range(5):\n" "... squares.append(lambda: x**2)" msgstr "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda: x**2)" -msgid "This gives you a list that contains 5 lambdas that calculate ``x**2``. You might expect that, when called, they would return, respectively, ``0``, ``1``, ``4``, ``9``, and ``16``. However, when you actually try you will see that they all return ``16``::" +msgid "" +"This gives you a list that contains 5 lambdas that calculate ``x**2``. You " +"might expect that, when called, they would return, respectively, ``0``, " +"``1``, ``4``, ``9``, and ``16``. However, when you actually try you will " +"see that they all return ``16``::" msgstr "" +"این به شما فهرستی شامل ۵ لامبدا می‌دهد که ``x**2`` را محاسبه می‌کنند. ممکن " +"است انتظار داشته باشید که آن‌ها هنگام فراخوانی، به‌ترتیب ``0``، ``1``، ``4``، " +"``9`` و ``16`` را برگردانند. با این حال، وقتی واقعاً آن را امتحان کنید، " +"خواهید دید که همه‌ی آن‌ها ``16`` را برمی‌گردانند::" msgid "" ">>> squares[2]()\n" @@ -177,27 +363,63 @@ msgid "" ">>> squares[4]()\n" "16" msgstr "" +">>> squares[2]()\n" +"16\n" +">>> squares[4]()\n" +"16" -msgid "This happens because ``x`` is not local to the lambdas, but is defined in the outer scope, and it is accessed when the lambda is called --- not when it is defined. At the end of the loop, the value of ``x`` is ``4``, so all the functions now return ``4**2``, that is ``16``. You can also verify this by changing the value of ``x`` and see how the results of the lambdas change::" -msgstr "" +msgid "" +"This happens because ``x`` is not local to the lambdas, but is defined in " +"the outer scope, and it is accessed when the lambda is called --- not when " +"it is defined. At the end of the loop, the value of ``x`` is ``4``, so all " +"the functions now return ``4**2``, that is ``16``. You can also verify " +"this by changing the value of ``x`` and see how the results of the lambdas " +"change::" +msgstr "" +"این اتفاق به این دلیل رخ می‌دهد که ``x`` برای لامبداها محلی نیست، بلکه در " +"محدوده بیرونی تعریف شده است، و دسترسی به آن هنگام فراخوانی لامبدا انجام " +"می‌شود — نه هنگام تعریف آن. در پایان حلقه، مقدار ``x`` برابر ``4`` است، " +"بنابراین همه توابع اکنون ``4**2`` را برمی‌گردانند، یعنی ``16``. همچنین " +"می‌توانید این موضوع را با تغییر مقدار ``x`` تأیید کنید و ببینید نتایج " +"لامبداها چگونه تغییر می‌کنند::" msgid "" ">>> x = 8\n" ">>> squares[2]()\n" "64" msgstr "" +">>> x = 8\n" +">>> squares[2]()\n" +"64" -msgid "In order to avoid this, you need to save the values in variables local to the lambdas, so that they don't rely on the value of the global ``x``::" +msgid "" +"In order to avoid this, you need to save the values in variables local to " +"the lambdas, so that they don't rely on the value of the global ``x``::" msgstr "" +"برای اجتناب از این موضوع، باید مقادیر را در متغیرهای محلیِ lambdaها ذخیره " +"کنید، تا آن‌ها به مقدار ``x`` سراسری وابسته نباشند::" msgid "" ">>> squares = []\n" ">>> for x in range(5):\n" "... squares.append(lambda n=x: n**2)" msgstr "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda n=x: n**2)" -msgid "Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed when the lambda is defined so that it has the same value that ``x`` had at that point in the loop. This means that the value of ``n`` will be ``0`` in the first lambda, ``1`` in the second, ``2`` in the third, and so on. Therefore each lambda will now return the correct result::" -msgstr "" +msgid "" +"Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed " +"when the lambda is defined so that it has the same value that ``x`` had at " +"that point in the loop. This means that the value of ``n`` will be ``0`` " +"in the first lambda, ``1`` in the second, ``2`` in the third, and so on. " +"Therefore each lambda will now return the correct result::" +msgstr "" +"در اینجا، ``n=x`` یک متغیر جدید ``n`` ایجاد می‌کند که محلی برای لامبدا است و " +"هنگام تعریف لامبدا محاسبه می‌شود، به‌طوری که همان مقداری را دارد که ``x`` در " +"آن نقطه از حلقه داشت. این بدان معناست که مقدار ``n`` در اولین لامبدا ``0``، " +"در دومین لامبدا ``1``، در سومین لامبدا ``2`` و به‌همین ترتیب خواهد بود. " +"بنابراین هر لامبدا اکنون نتیجه‌ی صحیح را برمی‌گرداند::" msgid "" ">>> squares[2]()\n" @@ -205,83 +427,191 @@ msgid "" ">>> squares[4]()\n" "16" msgstr "" +">>> squares[2]()\n" +"4\n" +">>> squares[4]()\n" +"16" -msgid "Note that this behaviour is not peculiar to lambdas, but applies to regular functions too." +msgid "" +"Note that this behaviour is not peculiar to lambdas, but applies to regular " +"functions too." msgstr "" +"توجه داشته باشید که این رفتار مختص به لامبداها نیست، بلکه در مورد توابع " +"معمولی نیز صدق می‌کند." msgid "How do I share global variables across modules?" -msgstr "" +msgstr "چگونه می‌توانم متغیرهای سراسری را بین ماژول‌ها به اشتراک بگذارم؟" -msgid "The canonical way to share information across modules within a single program is to create a special module (often called config or cfg). Just import the config module in all modules of your application; the module then becomes available as a global name. Because there is only one instance of each module, any changes made to the module object get reflected everywhere. For example:" -msgstr "" +msgid "" +"The canonical way to share information across modules within a single " +"program is to create a special module (often called config or cfg). Just " +"import the config module in all modules of your application; the module " +"then becomes available as a global name. Because there is only one " +"instance of each module, any changes made to the module object get " +"reflected everywhere. For example:" +msgstr "" +"روش کانونیکال برای اشتراک‌گذاری اطلاعات میان ماژول‌ها در یک برنامه واحد، ایجاد " +"یک ماژول خاص (که اغلب config یا cfg نامیده می‌شود) است. کافی است ماژول " +"config را در همه ماژول‌های برنامه خود ایمپورت کنید؛ سپس این ماژول به‌عنوان یک " +"نام سراسری در دسترس قرار می‌گیرد. از آنجا که تنها یک نمونه از هر ماژول وجود " +"دارد، هر تغییری که در شیء ماژول انجام شود، در همه‌جا بازتاب می‌یابد. برای " +"مثال:" msgid "config.py::" -msgstr "" +msgstr "config.py::" msgid "x = 0 # Default value of the 'x' configuration setting" -msgstr "" +msgstr "x = 0 # مقدار پیش‌فرض تنظیم پیکربندی 'x'" msgid "mod.py::" -msgstr "" +msgstr "mod.py::" msgid "" "import config\n" "config.x = 1" msgstr "" +"import config\n" +"config.x = 1" msgid "main.py::" -msgstr "" +msgstr "main.py::" msgid "" "import config\n" "import mod\n" "print(config.x)" msgstr "" +"import config\n" +"import mod\n" +"print(config.x)" -msgid "Note that using a module is also the basis for implementing the singleton design pattern, for the same reason." +msgid "" +"Note that using a module is also the basis for implementing the singleton " +"design pattern, for the same reason." msgstr "" +"توجه داشته باشید که استفاده از یک ماژول نیز به همین دلیل، مبنای پیاده‌سازی " +"الگوی طراحی تک‌نمونه (singleton) است." msgid "What are the \"best practices\" for using import in a module?" -msgstr "" +msgstr "«بهترین روش‌ها» برای استفاده از ایمپورت در یک ماژول چیست؟" -msgid "In general, don't use ``from modulename import *``. Doing so clutters the importer's namespace, and makes it much harder for linters to detect undefined names." +msgid "" +"In general, don't use ``from modulename import *``. Doing so clutters the " +"importer's namespace, and makes it much harder for linters to detect " +"undefined names." msgstr "" +"به‌طور کلی، از ``from modulename import *`` استفاده نکنید. این کار باعث شلوغ " +"شدن فضای نام ایمپورت‌کننده می‌شود و تشخیص نام‌های تعریف‌نشده را برای لینترها " +"(linters) بسیار دشوارتر می‌کند." -msgid "Import modules at the top of a file. Doing so makes it clear what other modules your code requires and avoids questions of whether the module name is in scope. Using one import per line makes it easy to add and delete module imports, but using multiple imports per line uses less screen space." +msgid "" +"Import modules at the top of a file. Doing so makes it clear what other " +"modules your code requires and avoids questions of whether the module name " +"is in scope. Using one import per line makes it easy to add and delete " +"module imports, but using multiple imports per line uses less screen space." msgstr "" +"ماژول‌ها را در ابتدای فایل ایمپورت کنید. این کار مشخص می‌کند که کد شما به چه " +"ماژول‌های دیگری نیاز دارد و از تردید در این‌که نام ماژول در محدوده قرار دارد " +"جلوگیری می‌کند. استفاده از یک ایمپورت در هر خط، افزودن و حذف ایمپورت ماژول‌ها " +"را آسان می‌کند، اما استفاده از چند ایمپورت در هر خط فضای کمتری از صفحه را " +"اشغال می‌کند." msgid "It's good practice if you import modules in the following order:" -msgstr "" +msgstr "بهتر است ماژول‌ها را به ترتیب زیر ایمپورت کنید:" -msgid "standard library modules -- such as :mod:`sys`, :mod:`os`, :mod:`argparse`, :mod:`re`" +msgid "" +"standard library modules -- such " +"as :mod:`sys`, :mod:`os`, :mod:`argparse`, :mod:`re`" msgstr "" +"ماژول‌های کتابخانه‌ی استاندارد -- " +"مانند :mod:`sys`، :mod:`os`، :mod:`argparse`، :mod:`re`" -msgid "third-party library modules (anything installed in Python's site-packages directory) -- such as :pypi:`dateutil`, :pypi:`requests`, :pypi:`tzdata`" +msgid "" +"third-party library modules (anything installed in Python's site-packages " +"directory) -- such as :pypi:`dateutil`, :pypi:`requests`, :pypi:`tzdata`" msgstr "" +"ماژول‌های کتابخانه‌ای شخص ثالث (هر چیزی که در پوشه site-packages پایتون نصب " +"شده است) — مانند :pypi:`dateutil`، :pypi:`requests`، :pypi:`tzdata`" msgid "locally developed modules" -msgstr "" +msgstr "ماژول‌های توسعه‌یافته به‌صورت محلی" -msgid "It is sometimes necessary to move imports to a function or class to avoid problems with circular imports. Gordon McMillan says:" +msgid "" +"It is sometimes necessary to move imports to a function or class to avoid " +"problems with circular imports. Gordon McMillan says:" msgstr "" +"گاهی لازم است ایمپورت‌ها را به یک تابع یا کلاس منتقل کنید تا از مشکلات ناشی " +"از ایمپورت‌های چرخه‌ای اجتناب کنید. گوردون مک‌میلان می‌گوید:" -msgid "Circular imports are fine where both modules use the \"import \" form of import. They fail when the 2nd module wants to grab a name out of the first (\"from module import name\") and the import is at the top level. That's because names in the 1st are not yet available, because the first module is busy importing the 2nd." -msgstr "" +msgid "" +"Circular imports are fine where both modules use the \"import \" " +"form of import. They fail when the 2nd module wants to grab a name out of " +"the first (\"from module import name\") and the import is at the top " +"level. That's because names in the 1st are not yet available, because the " +"first module is busy importing the 2nd." +msgstr "" +"ایمپورت‌های حلقه‌ای در صورتی مشکلی ندارند که هر دو ماژول از شکل «import " +"» برای ایمپورت استفاده کنند. این ایمپورت‌ها زمانی شکست می‌خورند که " +"ماژول دوم بخواهد نامی را از ماژول اول بگیرد («from module import name») و " +"ایمپورت در سطح بالا باشد. دلیل این امر آن است که نام‌های ماژول اول هنوز در " +"دسترس نیستند، زیرا ماژول اول مشغول ایمپورت کردن ماژول دوم است." -msgid "In this case, if the second module is only used in one function, then the import can easily be moved into that function. By the time the import is called, the first module will have finished initializing, and the second module can do its import." +msgid "" +"In this case, if the second module is only used in one function, then the " +"import can easily be moved into that function. By the time the import is " +"called, the first module will have finished initializing, and the second " +"module can do its import." msgstr "" +"در این حالت، اگر ماژول دوم فقط در یک تابع استفاده شود، می‌توان ایمپورت را " +"به‌راحتی به آن تابع منتقل کرد. تا زمانی که ایمپورت فراخوانی شود، ماژول اول " +"مقداردهی اولیه‌ی خود را به پایان رسانده است و ماژول دوم می‌تواند ایمپورت خود " +"را انجام دهد." -msgid "It may also be necessary to move imports out of the top level of code if some of the modules are platform-specific. In that case, it may not even be possible to import all of the modules at the top of the file. In this case, importing the correct modules in the corresponding platform-specific code is a good option." +msgid "" +"It may also be necessary to move imports out of the top level of code if " +"some of the modules are platform-specific. In that case, it may not even " +"be possible to import all of the modules at the top of the file. In this " +"case, importing the correct modules in the corresponding platform-specific " +"code is a good option." msgstr "" +"ممکن است همچنین لازم باشد ایمپورت‌ها را به بیرون از سطح بالایی کد منتقل " +"کنید، اگر برخی از ماژول‌ها مختص پلتفرم باشند. در آن صورت، حتی ممکن است نتوان " +"تمام ماژول‌ها را در ابتدای فایل ایمپورت کرد. در این حالت، ایمپورت کردن " +"ماژول‌های صحیح در کد مختص پلتفرم متناظر، گزینه خوبی است." -msgid "Only move imports into a local scope, such as inside a function definition, if it's necessary to solve a problem such as avoiding a circular import or are trying to reduce the initialization time of a module. This technique is especially helpful if many of the imports are unnecessary depending on how the program executes. You may also want to move imports into a function if the modules are only ever used in that function. Note that loading a module the first time may be expensive because of the one time initialization of the module, but loading a module multiple times is virtually free, costing only a couple of dictionary lookups. Even if the module name has gone out of scope, the module is probably available in :data:`sys.modules`." -msgstr "" +msgid "" +"Only move imports into a local scope, such as inside a function definition, " +"if it's necessary to solve a problem such as avoiding a circular import or " +"are trying to reduce the initialization time of a module. This technique " +"is especially helpful if many of the imports are unnecessary depending on " +"how the program executes. You may also want to move imports into a " +"function if the modules are only ever used in that function. Note that " +"loading a module the first time may be expensive because of the one time " +"initialization of the module, but loading a module multiple times is " +"virtually free, costing only a couple of dictionary lookups. Even if the " +"module name has gone out of scope, the module is probably available " +"in :data:`sys.modules`." +msgstr "" +"فقط در صورتی ایمپورت‌ها را به یک محدوده محلی منتقل کنید، مانند درون تعریف یک " +"تابع، که این کار برای حل مشکلی مانند اجتناب از یک ایمپورت حلقوی (circular " +"import) ضروری باشد یا بخواهید زمان مقداردهی اولیه یک ماژول را کاهش دهید. " +"این تکنیک به‌ویژه زمانی مفید است که بسیاری از ایمپورت‌ها، بسته به نحوه اجرای " +"برنامه، غیرضروری باشند. همچنین ممکن است بخواهید ایمپورت‌ها را به یک تابع " +"منتقل کنید، اگر ماژول‌ها تنها در همان تابع استفاده شوند. توجه داشته باشید که " +"بارگذاری یک ماژول برای اولین بار ممکن است به دلیل مقداردهی اولیه یک‌باره " +"ماژول پرهزینه باشد، اما بارگذاری چندباره یک ماژول عملاً رایگان است و تنها " +"هزینه چند جستجوی دیکشنری را دارد. حتی اگر نام ماژول از محدوده خارج شده " +"باشد، آن ماژول احتمالاً در :data:`sys.modules` در دسترس است." msgid "Why are default values shared between objects?" -msgstr "" +msgstr "چرا مقادیر پیش‌فرض بین شیء‌ها مشترک هستند؟" -msgid "This type of bug commonly bites neophyte programmers. Consider this function::" +msgid "" +"This type of bug commonly bites neophyte programmers. Consider this " +"function::" msgstr "" +"این نوع اشکال معمولاً برنامه‌نویسان تازه‌کار را گرفتار می‌کند. این تابع را در " +"نظر بگیرید::" msgid "" "def foo(mydict={}): # Danger: shared reference to one dict for all calls\n" @@ -289,38 +619,88 @@ msgid "" " mydict[key] = value\n" " return mydict" msgstr "" +"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n" +" ... compute something ...\n" +" mydict[key] = value\n" +" return mydict" -msgid "The first time you call this function, ``mydict`` contains a single item. The second time, ``mydict`` contains two items because when ``foo()`` begins executing, ``mydict`` starts out with an item already in it." +msgid "" +"The first time you call this function, ``mydict`` contains a single item. " +"The second time, ``mydict`` contains two items because when ``foo()`` " +"begins executing, ``mydict`` starts out with an item already in it." msgstr "" +"بار اول که این تابع را فراخوانی می‌کنید، ``mydict`` شامل یک آیتم است. بار " +"دوم، ``mydict`` شامل دو آیتم است، زیرا هنگامی که ``foo()`` شروع به اجرا " +"می‌کند، ``mydict`` از قبل یک آیتم در خود دارد." -msgid "It is often expected that a function call creates new objects for default values. This is not what happens. Default values are created exactly once, when the function is defined. If that object is changed, like the dictionary in this example, subsequent calls to the function will refer to this changed object." +msgid "" +"It is often expected that a function call creates new objects for default " +"values. This is not what happens. Default values are created exactly once, " +"when the function is defined. If that object is changed, like the " +"dictionary in this example, subsequent calls to the function will refer to " +"this changed object." msgstr "" +"اغلب انتظار می‌رود که یک فراخوانی تابع، اشیای جدیدی برای مقادیر پیش‌فرض " +"ایجاد کند. این چیزی نیست که رخ می‌دهد. مقادیر پیش‌فرض دقیقاً یک بار، هنگامی که " +"تابع تعریف می‌شود، ایجاد می‌شوند. اگر آن شیء تغییر کند، مانند دیکشنری در این " +"مثال، فراخوانی‌های بعدی تابع به این شیء تغییریافته ارجاع خواهند داد." -msgid "By definition, immutable objects such as numbers, strings, tuples, and ``None``, are safe from change. Changes to mutable objects such as dictionaries, lists, and class instances can lead to confusion." +msgid "" +"By definition, immutable objects such as numbers, strings, tuples, and " +"``None``, are safe from change. Changes to mutable objects such as " +"dictionaries, lists, and class instances can lead to confusion." msgstr "" +"طبق تعریف، اشیاء تغییرناپذیر مانند اعداد، رشته‌ها، تاپل‌ها و ``None``، از " +"تغییر مصون هستند. تغییرات در اشیاء تغییرپذیر مانند دیکشنری‌ها، فهرست‌ها و " +"نمونه‌های کلاس می‌تواند باعث سردرگمی شود." -msgid "Because of this feature, it is good programming practice to not use mutable objects as default values. Instead, use ``None`` as the default value and inside the function, check if the parameter is ``None`` and create a new list/dictionary/whatever if it is. For example, don't write::" +msgid "" +"Because of this feature, it is good programming practice to not use mutable " +"objects as default values. Instead, use ``None`` as the default value and " +"inside the function, check if the parameter is ``None`` and create a new " +"list/dictionary/whatever if it is. For example, don't write::" msgstr "" +"به دلیل این ویژگی، تمرین خوب برنامه‌نویسی این است که از اشیای تغییرپذیر " +"به‌عنوان مقادیر پیش‌فرض استفاده نکنید. در عوض، از ``None`` به‌عنوان مقدار " +"پیش‌فرض استفاده کنید و داخل تابع بررسی کنید که آیا پارامتر ``None`` است یا " +"خیر، و در این صورت یک فهرست/دیکشنری/هرچیز جدید ایجاد کنید. برای مثال، " +"این‌گونه ننویسید::" msgid "" "def foo(mydict={}):\n" " ..." msgstr "" +"def foo(mydict={}):\n" +" ..." msgid "but::" -msgstr "" +msgstr "اما::" msgid "" "def foo(mydict=None):\n" " if mydict is None:\n" " mydict = {} # create a new dict for local namespace" msgstr "" +"def foo(mydict=None):\n" +" if mydict is None:\n" +" mydict = {} # ایجاد یک دیکشنری جدید برای فضای نام محلی" -msgid "This feature can be useful. When you have a function that's time-consuming to compute, a common technique is to cache the parameters and the resulting value of each call to the function, and return the cached value if the same value is requested again. This is called \"memoizing\", and can be implemented like this::" -msgstr "" +msgid "" +"This feature can be useful. When you have a function that's time-consuming " +"to compute, a common technique is to cache the parameters and the resulting " +"value of each call to the function, and return the cached value if the same " +"value is requested again. This is called \"memoizing\", and can be " +"implemented like this::" +msgstr "" +"این قابلیت می‌تواند مفید باشد. وقتی تابعی دارید که محاسبه‌ی آن زمان‌بر است، " +"روش رایج این است که پارامترها و مقدار حاصل از هر فراخوانی تابع را در " +"نهانگاه ذخیره کنید و اگر همان مقدار دوباره درخواست شد، مقدار ذخیره‌شده در " +"نهانگاه را برگردانید. به این کار «memoizing» می‌گویند و می‌توان آن را این‌گونه " +"پیاده‌سازی کرد::" msgid "" -"# Callers can only provide two parameters and optionally pass _cache by keyword\n" +"# Callers can only provide two parameters and optionally pass _cache by " +"keyword\n" "def expensive(arg1, arg2, *, _cache={}):\n" " if (arg1, arg2) in _cache:\n" " return _cache[(arg1, arg2)]\n" @@ -330,15 +710,42 @@ msgid "" " _cache[(arg1, arg2)] = result # Store result in the cache\n" " return result" msgstr "" +"# فراخوانندگان فقط می‌توانند دو پارامتر ارائه دهند و _cache را به‌صورت " +"اختیاری با کلیدواژه ارسال کنند\n" +"def expensive(arg1, arg2, *, _cache={}):\n" +" if (arg1, arg2) in _cache:\n" +" return _cache[(arg1, arg2)]\n" +"\n" +" # مقدار را محاسبه کنید\n" +" result = ... expensive computation ...\n" +" _cache[(arg1, arg2)] = result # نتیجه را در نهانگاه ذخیره " +"کنید\n" +" return result" -msgid "You could use a global variable containing a dictionary instead of the default value; it's a matter of taste." +msgid "" +"You could use a global variable containing a dictionary instead of the " +"default value; it's a matter of taste." msgstr "" +"می‌توانید به‌جای مقدار پیش‌فرض از یک متغیر سراسری شامل یک دیکشنری استفاده " +"کنید؛ این موضوع سلیقه‌ای است." -msgid "How can I pass optional or keyword parameters from one function to another?" +msgid "" +"How can I pass optional or keyword parameters from one function to another?" msgstr "" +"چگونه می‌توانم پارامترهای اختیاری یا کلیدواژه‌ای را از یک تابع به تابع دیگر " +"منتقل کنم؟" -msgid "Collect the arguments using the ``*`` and ``**`` specifiers in the function's parameter list; this gives you the positional arguments as a tuple and the keyword arguments as a dictionary. You can then pass these arguments when calling another function by using ``*`` and ``**``::" +msgid "" +"Collect the arguments using the ``*`` and ``**`` specifiers in the " +"function's parameter list; this gives you the positional arguments as a " +"tuple and the keyword arguments as a dictionary. You can then pass these " +"arguments when calling another function by using ``*`` and ``**``::" msgstr "" +"آرگومان‌ها را با استفاده از مشخص‌کننده‌های ``*`` و ``**`` در فهرست پارامترهای " +"تابع جمع‌آوری کنید؛ این کار آرگومان‌های جایگاهی را به‌صورت یک تاپل و " +"آرگومان‌های کلیدواژه‌ای را به‌صورت یک دیکشنری به شما می‌دهد. سپس می‌توانید این " +"آرگومان‌ها را هنگام فراخوانی تابعی دیگر با استفاده از ``*`` و ``**`` منتقل " +"کنید::" msgid "" "def f(x, *args, **kwargs):\n" @@ -347,32 +754,53 @@ msgid "" " ...\n" " g(x, *args, **kwargs)" msgstr "" +"def f(x, *args, **kwargs):\n" +" ...\n" +" kwargs['width'] = '14.3c'\n" +" ...\n" +" g(x, *args, **kwargs)" msgid "What is the difference between arguments and parameters?" -msgstr "" +msgstr "تفاوت آرگومان‌ها و پارامترها چیست؟" -msgid ":term:`Parameters ` are defined by the names that appear in a function definition, whereas :term:`arguments ` are the values actually passed to a function when calling it. Parameters define what :term:`kind of arguments ` a function can accept. For example, given the function definition::" -msgstr "" +msgid "" +":term:`Parameters ` are defined by the names that appear in a " +"function definition, whereas :term:`arguments ` are the values " +"actually passed to a function when calling it. Parameters define " +"what :term:`kind of arguments ` a function can accept. For " +"example, given the function definition::" +msgstr "" +":term:`پارامترها ` با نام‌هایی که در تعریف تابع ظاهر می‌شوند تعریف " +"می‌شوند، در حالی که :term:`آرگومان‌ها ` مقادیری هستند که هنگام " +"فراخوانی تابع واقعاً به تابع ارسال می‌شوند. پارامترها مشخص می‌کنند که تابع " +"چه :term:`نوع آرگومان‌هایی ` می‌تواند بپذیرد. برای مثال، با توجه " +"به تعریف تابع::" msgid "" "def func(foo, bar=None, **kwargs):\n" " pass" msgstr "" +"def func(foo, bar=None, **kwargs):\n" +" pass" -msgid "*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling ``func``, for example::" +msgid "" +"*foo*, *bar* and *kwargs* are parameters of ``func``. However, when " +"calling ``func``, for example::" msgstr "" +"*foo*، *bar* و *kwargs* پارامترهای ``func`` هستند. با این حال، هنگام " +"فراخوانی ``func``، برای مثال::" msgid "func(42, bar=314, extra=somevar)" -msgstr "" +msgstr "func(42, bar=314, extra=somevar)" msgid "the values ``42``, ``314``, and ``somevar`` are arguments." -msgstr "" +msgstr "مقادیر ``42``، ``314`` و ``somevar`` آرگومان هستند." msgid "Why did changing list 'y' also change list 'x'?" -msgstr "" +msgstr "چرا تغییر فهرست 'y' باعث تغییر فهرست 'x' نیز شد؟" msgid "If you wrote code like::" -msgstr "" +msgstr "اگر کدی مانند زیر نوشته باشید::" msgid "" ">>> x = []\n" @@ -383,24 +811,52 @@ msgid "" ">>> x\n" "[10]" msgstr "" +">>> x = []\n" +">>> y = x\n" +">>> y.append(10)\n" +">>> y\n" +"[10]\n" +">>> x\n" +"[10]" -msgid "you might be wondering why appending an element to ``y`` changed ``x`` too." +msgid "" +"you might be wondering why appending an element to ``y`` changed ``x`` too." msgstr "" +"شاید برایتان پرسش شده باشد که چرا افزودن یک عنصر به ``y``، ``x`` را نیز " +"تغییر داد." msgid "There are two factors that produce this result:" -msgstr "" +msgstr "دو عامل وجود دارند که این نتیجه را ایجاد می‌کنند:" -msgid "Variables are simply names that refer to objects. Doing ``y = x`` doesn't create a copy of the list -- it creates a new variable ``y`` that refers to the same object ``x`` refers to. This means that there is only one object (the list), and both ``x`` and ``y`` refer to it." +msgid "" +"Variables are simply names that refer to objects. Doing ``y = x`` doesn't " +"create a copy of the list -- it creates a new variable ``y`` that refers to " +"the same object ``x`` refers to. This means that there is only one object " +"(the list), and both ``x`` and ``y`` refer to it." msgstr "" +"متغیرها صرفاً نام‌هایی هستند که به شیء‌ها ارجاع می‌دهند. با انجام ``y = x`` " +"رونوشتی از فهرست ایجاد نمی‌شود، بلکه یک متغیر جدید ``y`` ایجاد می‌شود که به " +"همان شیئی ارجاع می‌دهد که ``x`` به آن ارجاع می‌دهد. این بدان معناست که تنها " +"یک شیء (فهرست) وجود دارد و هر دو ``x`` و ``y`` به آن ارجاع می‌دهند." -msgid "Lists are :term:`mutable`, which means that you can change their content." +msgid "" +"Lists are :term:`mutable`, which means that you can change their content." msgstr "" +"فهرست‌ها :term:`تغییرپذیر ` هستند، به این معنا که می‌توانید محتوای " +"آن‌ها را تغییر دهید." -msgid "After the call to :meth:`~sequence.append`, the content of the mutable object has changed from ``[]`` to ``[10]``. Since both the variables refer to the same object, using either name accesses the modified value ``[10]``." +msgid "" +"After the call to :meth:`~sequence.append`, the content of the mutable " +"object has changed from ``[]`` to ``[10]``. Since both the variables refer " +"to the same object, using either name accesses the modified value ``[10]``." msgstr "" +"پس از فراخوانی :meth:`~sequence.append`، محتوای شیء تغییرپذیر از ``[]`` به " +"``[10]`` تغییر کرده است. از آنجا که هر دو متغیر به یک شیء ارجاع دارند، با " +"استفاده از هر یک از نام‌ها می‌توان به مقدار تغییرکرده ``[10]`` دسترسی پیدا " +"کرد." msgid "If we instead assign an immutable object to ``x``::" -msgstr "" +msgstr "اگر به‌جای آن یک شیء تغییرناپذیر را به ``x`` انتساب دهیم::" msgid "" ">>> x = 5 # ints are immutable\n" @@ -411,36 +867,113 @@ msgid "" ">>> y\n" "5" msgstr "" +">>> x = 5 # ints are immutable\n" +">>> y = x\n" +">>> x = x + 1 # 5 can't be mutated, we are creating a new object here\n" +">>> x\n" +"6\n" +">>> y\n" +"5" -msgid "we can see that in this case ``x`` and ``y`` are not equal anymore. This is because integers are :term:`immutable`, and when we do ``x = x + 1`` we are not mutating the int ``5`` by incrementing its value; instead, we are creating a new object (the int ``6``) and assigning it to ``x`` (that is, changing which object ``x`` refers to). After this assignment we have two objects (the ints ``6`` and ``5``) and two variables that refer to them (``x`` now refers to ``6`` but ``y`` still refers to ``5``)." -msgstr "" +msgid "" +"we can see that in this case ``x`` and ``y`` are not equal anymore. This " +"is because integers are :term:`immutable`, and when we do ``x = x + 1`` we " +"are not mutating the int ``5`` by incrementing its value; instead, we are " +"creating a new object (the int ``6``) and assigning it to ``x`` (that is, " +"changing which object ``x`` refers to). After this assignment we have two " +"objects (the ints ``6`` and ``5``) and two variables that refer to them " +"(``x`` now refers to ``6`` but ``y`` still refers to ``5``)." +msgstr "" +"می‌توانیم ببینیم که در این حالت ``x`` و ``y`` دیگر برابر نیستند. این به این " +"دلیل است که اعداد صحیح :term:`تغییرناپذیر ` هستند، و هنگامی که " +"``x = x + 1`` را اجرا می‌کنیم، با افزایش مقدار آن، عدد صحیح ``5`` را تغییر " +"نمی‌دهیم؛ در عوض، یک شیء جدید (عدد صحیح ``6``) ایجاد می‌کنیم و آن را به ``x`` " +"اختصاص می‌دهیم (یعنی اینکه ``x`` به کدام شیء ارجاع دارد را تغییر می‌دهیم). پس " +"از این انتساب، دو شیء (اعداد صحیح ``6`` و ``5``) و دو متغیر داریم که به " +"آن‌ها ارجاع دارند (``x`` اکنون به ``6`` ارجاع دارد اما ``y`` هنوز به ``5`` " +"ارجاع دارد)." -msgid "Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the object, whereas superficially similar operations (for example ``y = y + [10]`` and :func:`sorted(y) `) create a new object. In general in Python (and in all cases in the standard library) a method that mutates an object will return ``None`` to help avoid getting the two types of operations confused. So if you mistakenly write ``y.sort()`` thinking it will give you a sorted copy of ``y``, you'll instead end up with ``None``, which will likely cause your program to generate an easily diagnosed error." -msgstr "" +msgid "" +"Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the " +"object, whereas superficially similar operations (for example ``y = y + " +"[10]`` and :func:`sorted(y) `) create a new object. In general in " +"Python (and in all cases in the standard library) a method that mutates an " +"object will return ``None`` to help avoid getting the two types of " +"operations confused. So if you mistakenly write ``y.sort()`` thinking it " +"will give you a sorted copy of ``y``, you'll instead end up with ``None``, " +"which will likely cause your program to generate an easily diagnosed error." +msgstr "" +"برخی عملیات (برای مثال ``y.append(10)`` و ``y.sort()``) شیء را تغییر " +"می‌دهند، در حالی که عملیات ظاهراً مشابه (برای مثال ``y = y + [10]`` " +"و :func:`sorted(y) `) شیء جدیدی ایجاد می‌کنند. به‌طور کلی در پایتون " +"(و در همه موارد در کتابخانه استاندارد)، متدی که یک شیء را تغییر می‌دهد مقدار " +"``None`` را برمی‌گرداند تا کمک کند این دو نوع عملیات با هم اشتباه گرفته " +"نشوند. بنابراین اگر به‌اشتباه ``y.sort()`` را بنویسید و فکر کنید که نسخه‌ای " +"مرتب‌شده از ``y`` به شما می‌دهد، در عوض مقدار ``None`` دریافت خواهید کرد که " +"احتمالاً باعث می‌شود برنامه شما خطایی تولید کند که به‌راحتی قابل تشخیص است." -msgid "However, there is one class of operations where the same operation sometimes has different behaviors with different types: the augmented assignment operators. For example, ``+=`` mutates lists but not tuples or ints (``a_list += [1, 2, 3]`` is equivalent to ``a_list.extend([1, 2, 3])`` and mutates ``a_list``, whereas ``some_tuple += (1, 2, 3)`` and ``some_int += 1`` create new objects)." -msgstr "" +msgid "" +"However, there is one class of operations where the same operation " +"sometimes has different behaviors with different types: the augmented " +"assignment operators. For example, ``+=`` mutates lists but not tuples or " +"ints (``a_list += [1, 2, 3]`` is equivalent to ``a_list.extend([1, 2, 3])`` " +"and mutates ``a_list``, whereas ``some_tuple += (1, 2, 3)`` and ``some_int " +"+= 1`` create new objects)." +msgstr "" +"با این حال، دسته‌ای از عملیات وجود دارد که در آن‌ها یک عملیات واحد گاهی با " +"انواع مختلف رفتارهای متفاوتی دارد: عملگرهای انتساب افزوده. برای مثال، " +"``+=`` فهرست‌ها را تغییر می‌دهد، اما تاپل‌ها یا اعداد صحیح را تغییر نمی‌دهد " +"(``a_list += [1, 2, 3]`` معادل ``a_list.extend([1, 2, 3])`` است و " +"``a_list`` را تغییر می‌دهد، در حالی که ``some_tuple += (1, 2, 3)`` و " +"``some_int += 1`` اشیاء جدیدی ایجاد می‌کنند)." msgid "In other words:" -msgstr "" +msgstr "به عبارت دیگر:" -msgid "If we have a mutable object (such as :class:`list`, :class:`dict`, :class:`set`), we can use some specific operations to mutate it and all the variables that refer to it will see the change." +msgid "" +"If we have a mutable object (such " +"as :class:`list`, :class:`dict`, :class:`set`), we can use some specific " +"operations to mutate it and all the variables that refer to it will see the " +"change." msgstr "" +"اگر یک شیء تغییرپذیر (مانند :class:`list`، :class:`dict`، :class:`set`) " +"داشته باشیم، می‌توانیم از برخی عملیات خاص برای تغییر آن استفاده کنیم و همه " +"متغیرهایی که به آن ارجاع دارند، تغییر را خواهند دید." -msgid "If we have an immutable object (such as :class:`str`, :class:`int`, :class:`tuple`), all the variables that refer to it will always see the same value, but operations that transform that value into a new value always return a new object." +msgid "" +"If we have an immutable object (such " +"as :class:`str`, :class:`int`, :class:`tuple`), all the variables that " +"refer to it will always see the same value, but operations that transform " +"that value into a new value always return a new object." msgstr "" +"اگر یک شیء تغییرناپذیر داشته باشیم " +"(مانند :class:`str`، :class:`int`، :class:`tuple`)، همه متغیرهایی که به آن " +"ارجاع می‌کنند همیشه مقدار یکسانی را مشاهده خواهند کرد، اما عملیاتی که آن " +"مقدار را به مقدار جدیدی تبدیل می‌کنند همیشه شیء جدیدی را برمی‌گردانند." -msgid "If you want to know if two variables refer to the same object or not, you can use the :keyword:`is` operator, or the built-in function :func:`id`." +msgid "" +"If you want to know if two variables refer to the same object or not, you " +"can use the :keyword:`is` operator, or the built-in function :func:`id`." msgstr "" +"اگر می‌خواهید بدانید که آیا دو متغیر به یک شیء ارجاع می‌دهند یا خیر، می‌توانید " +"از عملگر :keyword:`is` یا تابع توکار :func:`id` استفاده کنید." msgid "How do I write a function with output parameters (call by reference)?" -msgstr "" +msgstr "چگونه تابعی با پارامترهای خروجی (فراخوانی با ارجاع) بنویسم؟" -msgid "Remember that arguments are passed by assignment in Python. Since assignment just creates references to objects, there's no alias between an argument name in the caller and callee, and consequently no call-by-reference. You can achieve the desired effect in a number of ways." +msgid "" +"Remember that arguments are passed by assignment in Python. Since " +"assignment just creates references to objects, there's no alias between an " +"argument name in the caller and callee, and consequently no call-by-" +"reference. You can achieve the desired effect in a number of ways." msgstr "" +"به یاد داشته باشید که آرگومان‌ها در پایتون با انتساب ارسال می‌شوند. از آن‌جا " +"که انتساب صرفاً ارجاع‌هایی به شیءها ایجاد می‌کند، هیچ نام مستعاری بین نام یک " +"آرگومان در فراخواننده و فراخوانده وجود ندارد و در نتیجه هیچ فراخوانی با " +"ارجاعی وجود ندارد. شما می‌توانید به روش‌های گوناگونی به اثر مطلوب دست یابید." msgid "By returning a tuple of the results::" -msgstr "" +msgstr "با برگرداندن یک تاپل از نتایج::" msgid "" ">>> def func1(a, b):\n" @@ -452,15 +985,26 @@ msgid "" ">>> func1(x, y)\n" "('new-value', 100)" msgstr "" +">>> def func1(a, b):\n" +"... a = 'new-value' # a and b are local names\n" +"... b = b + 1 # assigned to new objects\n" +"... return a, b # return new values\n" +"...\n" +">>> x, y = 'old-value', 99\n" +">>> func1(x, y)\n" +"('new-value', 100)" msgid "This is almost always the clearest solution." -msgstr "" +msgstr "این تقریباً همیشه واضح‌ترین راه‌حل است." -msgid "By using global variables. This isn't thread-safe, and is not recommended." +msgid "" +"By using global variables. This isn't thread-safe, and is not recommended." msgstr "" +"با استفاده از متغیرهای سراسری. این روش ایمن نسبت به نخ (thread-safe) نیست و " +"توصیه نمی‌شود." msgid "By passing a mutable (changeable in-place) object::" -msgstr "" +msgstr "با ارسال یک شیء تغییرپذیر (قابل تغییر به‌صورت درجا)::" msgid "" ">>> def func2(a):\n" @@ -472,9 +1016,17 @@ msgid "" ">>> args\n" "['new-value', 100]" msgstr "" +">>> def func2(a):\n" +"... a[0] = 'new-value' # 'a' references a mutable list\n" +"... a[1] = a[1] + 1 # changes a shared object\n" +"...\n" +">>> args = ['old-value', 99]\n" +">>> func2(args)\n" +">>> args\n" +"['new-value', 100]" msgid "By passing in a dictionary that gets mutated::" -msgstr "" +msgstr "با پاس دادن یک دیکشنری که تغییر می‌یابد::" msgid "" ">>> def func3(args):\n" @@ -486,9 +1038,17 @@ msgid "" ">>> args\n" "{'a': 'new-value', 'b': 100}" msgstr "" +">>> def func3(args):\n" +"... args['a'] = 'new-value' # args is a mutable dictionary\n" +"... args['b'] = args['b'] + 1 # change it in-place\n" +"...\n" +">>> args = {'a': 'old-value', 'b': 99}\n" +">>> func3(args)\n" +">>> args\n" +"{'a': 'new-value', 'b': 100}" msgid "Or bundle up values in a class instance::" -msgstr "" +msgstr "یا مقادیر را در یک نمونه کلاس دسته‌بندی کنید::" msgid "" ">>> class Namespace:\n" @@ -505,18 +1065,39 @@ msgid "" ">>> vars(args)\n" "{'a': 'new-value', 'b': 100}" msgstr "" +">>> class Namespace:\n" +"... def __init__(self, /, **args):\n" +"... for key, value in args.items():\n" +"... setattr(self, key, value)\n" +"...\n" +">>> def func4(args):\n" +"... args.a = 'new-value' # args is a mutable Namespace\n" +"... args.b = args.b + 1 # change object in-place\n" +"...\n" +">>> args = Namespace(a='old-value', b=99)\n" +">>> func4(args)\n" +">>> vars(args)\n" +"{'a': 'new-value', 'b': 100}" msgid "There's almost never a good reason to get this complicated." -msgstr "" +msgstr "تقریباً هرگز دلیل خوبی برای این‌قدر پیچیده شدن وجود ندارد." msgid "Your best choice is to return a tuple containing the multiple results." -msgstr "" +msgstr "بهترین انتخاب شما برگرداندن یک تاپل حاوی نتایج متعدد است." msgid "How do you make a higher order function in Python?" -msgstr "" +msgstr "چگونه در پایتون یک تابع مرتبه بالاتر می‌سازید؟" -msgid "You have two choices: you can use nested scopes or you can use callable objects. For example, suppose you wanted to define ``linear(a,b)`` which returns a function ``f(x)`` that computes the value ``a*x+b``. Using nested scopes::" +msgid "" +"You have two choices: you can use nested scopes or you can use callable " +"objects. For example, suppose you wanted to define ``linear(a,b)`` which " +"returns a function ``f(x)`` that computes the value ``a*x+b``. Using " +"nested scopes::" msgstr "" +"شما دو گزینه دارید: می‌توانید از محدوده‌های تودرتو یا از اشیای قابل فراخوانی " +"استفاده کنید. برای مثال، فرض کنید می‌خواهید ``linear(a,b)`` را تعریف کنید که " +"تابع ``f(x)`` را برمی‌گرداند؛ تابعی که مقدار ``a*x+b`` را محاسبه می‌کند. با " +"استفاده از محدوده‌های تودرتو::" msgid "" "def linear(a, b):\n" @@ -524,9 +1105,13 @@ msgid "" " return a * x + b\n" " return result" msgstr "" +"def linear(a, b):\n" +" def result(x):\n" +" return a * x + b\n" +" return result" msgid "Or using a callable object::" -msgstr "" +msgstr "یا با استفاده از یک شیء فراخوان‌پذیر::" msgid "" "class linear:\n" @@ -537,18 +1122,31 @@ msgid "" " def __call__(self, x):\n" " return self.a * x + self.b" msgstr "" +"class linear:\n" +"\n" +" def __init__(self, a, b):\n" +" self.a, self.b = a, b\n" +"\n" +" def __call__(self, x):\n" +" return self.a * x + self.b" msgid "In both cases, ::" -msgstr "" +msgstr "در هر دو مورد، ::" msgid "taxes = linear(0.3, 2)" -msgstr "" +msgstr "taxes = linear(0.3, 2)" msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``." -msgstr "" +msgstr "یک شیء فراخوان‌پذیر می‌دهد که در آن ``taxes(10e6) == 0.3 * 10e6 + 2``." -msgid "The callable object approach has the disadvantage that it is a bit slower and results in slightly longer code. However, note that a collection of callables can share their signature via inheritance::" +msgid "" +"The callable object approach has the disadvantage that it is a bit slower " +"and results in slightly longer code. However, note that a collection of " +"callables can share their signature via inheritance::" msgstr "" +"رویکرد شیء فراخوانی‌پذیر این عیب را دارد که کمی کندتر است و منجر به کد کمی " +"طولانی‌تر می‌شود. با این حال، توجه داشته باشید که مجموعه‌ای از اشیاء " +"فراخوانی‌پذیر می‌توانند امضای خود را از طریق ارث‌بری به اشتراک بگذارند::" msgid "" "class exponential(linear):\n" @@ -556,9 +1154,13 @@ msgid "" " def __call__(self, x):\n" " return self.a * (x ** self.b)" msgstr "" +"class exponential(linear):\n" +" # __init__ inherited\n" +" def __call__(self, x):\n" +" return self.a * (x ** self.b)" msgid "Object can encapsulate state for several methods::" -msgstr "" +msgstr "شیء می‌تواند وضعیت را برای چندین متد کپسوله کند::" msgid "" "class counter:\n" @@ -577,39 +1179,80 @@ msgid "" "count = counter()\n" "inc, dec, reset = count.up, count.down, count.set" msgstr "" - -msgid "Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share the same counting variable." -msgstr "" - -msgid "How do I copy an object in Python?" -msgstr "" - -msgid "In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the general case. Not all objects can be copied, but most can." -msgstr "" - -msgid "Some objects can be copied more easily. Dictionaries have a :meth:`~dict.copy` method::" -msgstr "" - -msgid "newdict = olddict.copy()" -msgstr "" - -msgid "Sequences can be copied by slicing::" +"class counter:\n" +"\n" +" value = 0\n" +"\n" +" def set(self, x):\n" +" self.value = x\n" +"\n" +" def up(self):\n" +" self.value = self.value + 1\n" +"\n" +" def down(self):\n" +" self.value = self.value - 1\n" +"\n" +"count = counter()\n" +"inc, dec, reset = count.up, count.down, count.set" + +msgid "" +"Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share " +"the same counting variable." msgstr "" +"در اینجا ``inc()``، ``dec()`` و ``reset()`` مانند توابعی عمل می‌کنند که " +"متغیر شمارنده‌ی یکسانی را به اشتراک می‌گذارند." -msgid "new_l = l[:]" +msgid "How do I copy an object in Python?" +msgstr "چگونه می‌توانم یک شیء را در پایتون کپی کنم؟" + +msgid "" +"In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the general " +"case. Not all objects can be copied, but most can." msgstr "" +"به‌طور کلی، برای حالت عمومی، :func:`copy.copy` یا :func:`copy.deepcopy` را " +"امتحان کنید. همه‌ی اشیاء قابل کپی نیستند، اما بیشتر آن‌ها قابل کپی هستند." -msgid "How can I find the methods or attributes of an object?" +msgid "" +"Some objects can be copied more easily. Dictionaries have " +"a :meth:`~dict.copy` method::" msgstr "" +"برخی از اشیاء را می‌توان به‌سادگی بیشتری کپی کرد. دیکشنری‌ها دارای " +"متد :meth:`~dict.copy` هستند::" + +msgid "newdict = olddict.copy()" +msgstr "newdict = olddict.copy()" + +msgid "Sequences can be copied by slicing::" +msgstr "دنباله‌ها را می‌توان با برش‌دادن (slicing) کپی کرد::" + +msgid "new_l = l[:]" +msgstr "new_l = l[:]" + +msgid "How can I find the methods or attributes of an object?" +msgstr "چگونه می‌توانم متدها یا ویژگی‌های یک شیء را پیدا کنم؟" -msgid "For an instance ``x`` of a user-defined class, :func:`dir(x) ` returns an alphabetized list of the names containing the instance attributes and methods and attributes defined by its class." +msgid "" +"For an instance ``x`` of a user-defined class, :func:`dir(x) ` returns " +"an alphabetized list of the names containing the instance attributes and " +"methods and attributes defined by its class." msgstr "" +"برای یک نمونه ``x`` از یک کلاس تعریف‌شده توسط کاربر، :func:`dir(x) ` " +"فهرستی مرتب‌شده به ترتیب الفبا از نام‌ها را برمی‌گرداند که شامل ویژگی‌های " +"نمونه، متدها و ویژگی‌های تعریف‌شده توسط کلاس آن است." msgid "How can my code discover the name of an object?" -msgstr "" +msgstr "کد من چگونه می‌تواند نام یک شیء را کشف کند؟" -msgid "Generally speaking, it can't, because objects don't really have names. Essentially, assignment always binds a name to a value; the same is true of ``def`` and ``class`` statements, but in that case the value is a callable. Consider the following code::" +msgid "" +"Generally speaking, it can't, because objects don't really have names. " +"Essentially, assignment always binds a name to a value; the same is true of " +"``def`` and ``class`` statements, but in that case the value is a callable. " +"Consider the following code::" msgstr "" +"به‌طور کلی، امکان‌پذیر نیست، زیرا اشیاء واقعاً نام ندارند. در اصل، انتساب " +"همیشه یک نام را به یک مقدار مقید می‌کند؛ همین موضوع برای دستورهای ``def`` و " +"``class`` نیز صادق است، اما در آن حالت مقدار یک قابل‌فراخوانی (callable) " +"است. کد زیر را در نظر بگیرید::" msgid "" ">>> class A:\n" @@ -623,53 +1266,106 @@ msgid "" ">>> print(a)\n" "<__main__.A object at 0x16D07CC>" msgstr "" +">>> class A:\n" +"... pass\n" +"...\n" +">>> B = A\n" +">>> a = B()\n" +">>> b = a\n" +">>> print(b)\n" +"<__main__.A object at 0x16D07CC>\n" +">>> print(a)\n" +"<__main__.A object at 0x16D07CC>" -msgid "Arguably the class has a name: even though it is bound to two names and invoked through the name ``B`` the created instance is still reported as an instance of class ``A``. However, it is impossible to say whether the instance's name is ``a`` or ``b``, since both names are bound to the same value." +msgid "" +"Arguably the class has a name: even though it is bound to two names and " +"invoked through the name ``B`` the created instance is still reported as an " +"instance of class ``A``. However, it is impossible to say whether the " +"instance's name is ``a`` or ``b``, since both names are bound to the same " +"value." msgstr "" +"می‌توان گفت که کلاس دارای نام است: با وجود اینکه به دو نام مقید است و از " +"طریق نام ``B`` فراخوانی می‌شود، نمونه‌ی ایجادشده همچنان به‌عنوان نمونه‌ای از " +"کلاس ``A`` گزارش می‌شود. با این حال، نمی‌توان گفت که نام نمونه ``a`` است یا " +"``b``، زیرا هر دو نام به یک مقدار مقید هستند." -msgid "Generally speaking it should not be necessary for your code to \"know the names\" of particular values. Unless you are deliberately writing introspective programs, this is usually an indication that a change of approach might be beneficial." +msgid "" +"Generally speaking it should not be necessary for your code to \"know the " +"names\" of particular values. Unless you are deliberately writing " +"introspective programs, this is usually an indication that a change of " +"approach might be beneficial." msgstr "" +"به‌طور کلی، نباید ضرورتی داشته باشد که کد شما «نام‌های مقادیر خاص را بداند». " +"مگر اینکه عمداً در حال نوشتن برنامه‌های درون‌نگر (introspective) باشید، این " +"معمولاً نشانه‌ای است که تغییر رویکرد ممکن است مفید باشد." -msgid "In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer to this question:" +msgid "" +"In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer " +"to this question:" msgstr "" +"در comp.lang.python، Fredrik Lundh یک‌بار تمثیلی عالی در پاسخ به این پرسش " +"ارائه کرد:" -msgid "The same way as you get the name of that cat you found on your porch: the cat (object) itself cannot tell you its name, and it doesn't really care -- so the only way to find out what it's called is to ask all your neighbours (namespaces) if it's their cat (object)..." +msgid "" +"The same way as you get the name of that cat you found on your porch: the " +"cat (object) itself cannot tell you its name, and it doesn't really care -- " +"so the only way to find out what it's called is to ask all your neighbours " +"(namespaces) if it's their cat (object)..." msgstr "" +"به همان شیوه‌ای که نام آن گربه‌ای را که در ایوان خود پیدا کرده‌اید می‌فهمید: " +"خود گربه (شیء) نمی‌تواند نامش را به شما بگوید، و واقعاً برایش اهمیتی ندارد — " +"بنابراین تنها راه برای فهمیدن نام آن این است که از همه همسایه‌هایتان (فضای " +"نامها) بپرسید که آیا این گربه، گربه‌ی آن‌ها (شیء) است یا خیر..." -msgid "....and don't be surprised if you'll find that it's known by many names, or no name at all!" +msgid "" +"....and don't be surprised if you'll find that it's known by many names, or " +"no name at all!" msgstr "" +"....و تعجب نکنید اگر متوجه شدید که با نام‌های بسیاری شناخته می‌شود، یا اصلاً " +"نامی ندارد!" msgid "What's up with the comma operator's precedence?" -msgstr "" +msgstr "وضعیت اولویت عملگر ویرگول چیست؟" msgid "Comma is not an operator in Python. Consider this session::" -msgstr "" +msgstr "کاما در پایتون عملگر نیست. این نشست را در نظر بگیرید::" msgid "" ">>> \"a\" in \"b\", \"a\"\n" "(False, 'a')" msgstr "" +">>> \"a\" in \"b\", \"a\"\n" +"(False, 'a')" -msgid "Since the comma is not an operator, but a separator between expressions the above is evaluated as if you had entered::" +msgid "" +"Since the comma is not an operator, but a separator between expressions the " +"above is evaluated as if you had entered::" msgstr "" +"از آنجا که کاما یک عملگر نیست، بلکه جداکننده‌ای بین عبارت‌ها است، مورد بالا " +"طوری ارزیابی می‌شود که گویی شما وارد کرده‌اید::" msgid "(\"a\" in \"b\"), \"a\"" -msgstr "" +msgstr "(\"a\" in \"b\"), \"a\"" msgid "not::" -msgstr "" +msgstr "not::" msgid "\"a\" in (\"b\", \"a\")" -msgstr "" +msgstr "\"a\" in (\"b\", \"a\")" -msgid "The same is true of the various assignment operators (``=``, ``+=``, and so on). They are not truly operators but syntactic delimiters in assignment statements." +msgid "" +"The same is true of the various assignment operators (``=``, ``+=``, and so " +"on). They are not truly operators but syntactic delimiters in assignment " +"statements." msgstr "" +"همین موضوع در مورد انواع عملگرهای انتساب (``=``، ``+=`` و غیره) نیز صادق " +"است. آن‌ها واقعاً عملگر نیستند، بلکه جداکننده‌های نحوی در دستورات انتساب هستند." msgid "Is there an equivalent of C's \"?:\" ternary operator?" -msgstr "" +msgstr "آیا معادلی برای عملگر سه‌گانه‌ی \"?:\" در C وجود دارد؟" msgid "Yes, there is. The syntax is as follows::" -msgstr "" +msgstr "بله، وجود دارد. سینتکس به صورت زیر است::" msgid "" "[on_true] if [expression] else [on_false]\n" @@ -677,21 +1373,41 @@ msgid "" "x, y = 50, 25\n" "small = x if x < y else y" msgstr "" +"[on_true] if [expression] else [on_false]\n" +"\n" +"x, y = 50, 25\n" +"small = x if x < y else y" -msgid "Before this syntax was introduced in Python 2.5, a common idiom was to use logical operators::" +msgid "" +"Before this syntax was introduced in Python 2.5, a common idiom was to use " +"logical operators::" msgstr "" +"پیش از معرفی این سینتکس در Python 2.5، الگوی رایج این بود که از عملگرهای " +"منطقی استفاده شود::" msgid "[expression] and [on_true] or [on_false]" -msgstr "" +msgstr "[expression] and [on_true] or [on_false]" -msgid "However, this idiom is unsafe, as it can give wrong results when *on_true* has a false boolean value. Therefore, it is always better to use the ``... if ... else ...`` form." +msgid "" +"However, this idiom is unsafe, as it can give wrong results when *on_true* " +"has a false boolean value. Therefore, it is always better to use the ``... " +"if ... else ...`` form." msgstr "" +"با این حال، این شیوه ناامن است، زیرا هنگامی که *on_true* مقدار بولی نادرست " +"داشته باشد، می‌تواند نتایج اشتباهی بدهد. بنابراین، همیشه بهتر است از قالب " +"``... if ... else ...`` استفاده کنید." msgid "Is it possible to write obfuscated one-liners in Python?" -msgstr "" +msgstr "آیا امکان نوشتن تک‌خطی‌های مبهم در پایتون وجود دارد؟" -msgid "Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!lambda`. See the following three examples, slightly adapted from Ulf Bartelt::" +msgid "" +"Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!" +"lambda`. See the following three examples, slightly adapted from Ulf " +"Bartelt::" msgstr "" +"بله. معمولاً این کار با تودرتو کردن :keyword:`lambda` درون :keyword:`!" +"lambda` انجام می‌شود. ۳ مثال زیر را ببینید، که اندکی از Ulf Bartelt اقتباس " +"شده‌اند::" msgid "" "from functools import reduce\n" @@ -705,7 +1421,8 @@ msgid "" "f(x,f), range(10))))\n" "\n" "# Mandelbrot set\n" -"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda y,\n" +"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda " +"y,\n" "Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,\n" "Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,\n" "i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y\n" @@ -718,15 +1435,51 @@ msgid "" "# | |_________________ range on y axis\n" "# |____________________________ range on x axis" msgstr "" +"from functools import reduce\n" +"\n" +"# اعداد اول کوچک‌تر از ۱۰۰۰\n" +"print(list(filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,\n" +"map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))))\n" +"\n" +"# نخستین ۱۰ عدد فیبوناچی\n" +"print(list(map(lambda x,f=lambda x,f:(f(x-1,f)+f(x-2,f)) if x>1 else 1:\n" +"f(x,f), range(10))))\n" +"\n" +"# مجموعه‌ی مندل‌برو\n" +"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda " +"y,\n" +"Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,\n" +"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,\n" +"i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y\n" +">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(\n" +"64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy\n" +"))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24))\n" +"# \\___ ___/ \\___ ___/ | | |__ خطوط صفحه\n" +"# V V | |______ ستون‌های صفحه\n" +"# | | |__________ بیشینه‌ی «تکرارها»\n" +"# | |_________________ بازه‌ی محور y\n" +"# |____________________________ بازه‌ی محور x" msgid "Don't try this at home, kids!" -msgstr "" +msgstr "بچه‌ها، این کار را در خانه امتحان نکنید!" msgid "What does the slash(/) in the parameter list of a function mean?" -msgstr "" +msgstr "اسلش (/) در فهرست پارامترهای یک تابع چه معنایی دارد؟" -msgid "A slash in the argument list of a function denotes that the parameters prior to it are positional-only. Positional-only parameters are the ones without an externally usable name. Upon calling a function that accepts positional-only parameters, arguments are mapped to parameters based solely on their position. For example, :func:`divmod` is a function that accepts positional-only parameters. Its documentation looks like this::" -msgstr "" +msgid "" +"A slash in the argument list of a function denotes that the parameters " +"prior to it are positional-only. Positional-only parameters are the ones " +"without an externally usable name. Upon calling a function that accepts " +"positional-only parameters, arguments are mapped to parameters based solely " +"on their position. For example, :func:`divmod` is a function that accepts " +"positional-only parameters. Its documentation looks like this::" +msgstr "" +"اسلش در فهرست آرگومان‌های یک تابع نشان می‌دهد که پارامترهای پیش از آن فقط " +"جایگاهی هستند. پارامترهای فقط جایگاهی، پارامترهایی بدون نام قابل استفاده از " +"بیرون هستند. هنگام فراخوانی تابعی که پارامترهای فقط جایگاهی می‌پذیرد، " +"آرگومان‌ها صرفاً بر اساس جایگاهشان به پارامترها نگاشت می‌شوند. برای " +"مثال، :func:`divmod` تابعی است که پارامترهای فقط جایگاهی می‌پذیرد. مستندات " +"آن به این شکل است::" msgid "" ">>> help(divmod)\n" @@ -735,9 +1488,20 @@ msgid "" "divmod(x, y, /)\n" " Return the tuple (x//y, x%y). Invariant: div*y + mod == x." msgstr "" +">>> help(divmod)\n" +"Help on built-in function divmod in module builtins:\n" +"\n" +"divmod(x, y, /)\n" +" Return the tuple (x//y, x%y). Invariant: div*y + mod == x." -msgid "The slash at the end of the parameter list means that both parameters are positional-only. Thus, calling :func:`divmod` with keyword arguments would lead to an error::" +msgid "" +"The slash at the end of the parameter list means that both parameters are " +"positional-only. Thus, calling :func:`divmod` with keyword arguments would " +"lead to an error::" msgstr "" +"اسلش در انتهای فهرست پارامترها به این معناست که هر دو پارامتر فقط جایگاهی " +"هستند. بنابراین، فراخوانی :func:`divmod` با آرگومان‌های کلیدواژه‌ای منجر به " +"خطا خواهد شد::" msgid "" ">>> divmod(x=3, y=4)\n" @@ -745,24 +1509,43 @@ msgid "" " File \"\", line 1, in \n" "TypeError: divmod() takes no keyword arguments" msgstr "" +">>> divmod(x=3, y=4)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: divmod() takes no keyword arguments" msgid "Numbers and strings" -msgstr "" +msgstr "اعداد و رشته‌ها" msgid "How do I specify hexadecimal and octal integers?" -msgstr "" +msgstr "چگونه می‌توانم اعداد صحیح مبنای شانزده و مبنای هشت را مشخص کنم؟" -msgid "To specify an octal digit, precede the octal value with a zero, and then a lower or uppercase \"o\". For example, to set the variable \"a\" to the octal value \"10\" (8 in decimal), type::" +msgid "" +"To specify an octal digit, precede the octal value with a zero, and then a " +"lower or uppercase \"o\". For example, to set the variable \"a\" to the " +"octal value \"10\" (8 in decimal), type::" msgstr "" +"برای مشخص کردن یک رقم مبنای هشت، پیش از مقدار مبنای هشت یک صفر و سپس حرف " +"\"o\" کوچک یا بزرگ قرار دهید. برای مثال، برای تنظیم متغیر \"a\" به مقدار " +"مبنای هشت \"10\" (۸ در مبنای ده)، تایپ کنید::" msgid "" ">>> a = 0o10\n" ">>> a\n" "8" msgstr "" +">>> a = 0o10\n" +">>> a\n" +"8" -msgid "Hexadecimal is just as easy. Simply precede the hexadecimal number with a zero, and then a lower or uppercase \"x\". Hexadecimal digits can be specified in lower or uppercase. For example, in the Python interpreter::" +msgid "" +"Hexadecimal is just as easy. Simply precede the hexadecimal number with a " +"zero, and then a lower or uppercase \"x\". Hexadecimal digits can be " +"specified in lower or uppercase. For example, in the Python interpreter::" msgstr "" +"مبنای شانزده هم به همین سادگی است. کافی است پیش از عدد مبنای شانزده، یک صفر " +"و سپس یک «x» کوچک یا بزرگ قرار دهید. ارقام مبنای شانزده را می‌توان با حروف " +"کوچک یا بزرگ مشخص کرد. برای مثال، در مفسر پایتون::" msgid "" ">>> a = 0xa5\n" @@ -772,27 +1555,58 @@ msgid "" ">>> b\n" "178" msgstr "" +">>> a = 0xa5\n" +">>> a\n" +"165\n" +">>> b = 0XB2\n" +">>> b\n" +"178" msgid "Why does -22 // 10 return -3?" -msgstr "" +msgstr "چرا -22 // 10 مقدار -3 را برمی‌گرداند؟" -msgid "It's primarily driven by the desire that ``i % j`` have the same sign as ``j``. If you want that, and also want::" +msgid "" +"It's primarily driven by the desire that ``i % j`` have the same sign as " +"``j``. If you want that, and also want::" msgstr "" +"این موضوع عمدتاً ناشی از این خواسته است که ``i % j`` همان علامت ``j`` را " +"داشته باشد. اگر این را می‌خواهید، و همچنین می‌خواهید::" msgid "i == (i // j) * j + (i % j)" -msgstr "" +msgstr "i == (i // j) * j + (i % j)" -msgid "then integer division has to return the floor. C also requires that identity to hold, and then compilers that truncate ``i // j`` need to make ``i % j`` have the same sign as ``i``." +msgid "" +"then integer division has to return the floor. C also requires that " +"identity to hold, and then compilers that truncate ``i // j`` need to make " +"``i % j`` have the same sign as ``i``." msgstr "" +"در این صورت تقسیم عدد صحیح باید مقدار کف (floor) را برگرداند. زبان C نیز " +"برقرار بودن این اتحاد را الزامی می‌داند، و در این صورت کامپایلرهایی که " +"``i // j`` را قطع می‌کنند باید ``i % j`` را هم‌علامت با ``i`` کنند." -msgid "There are few real use cases for ``i % j`` when ``j`` is negative. When ``j`` is positive, there are many, and in virtually all of them it's more useful for ``i % j`` to be ``>= 0``. If the clock says 10 now, what did it say 200 hours ago? ``-190 % 12 == 2`` is useful; ``-190 % 12 == -10`` is a bug waiting to bite." -msgstr "" +msgid "" +"There are few real use cases for ``i % j`` when ``j`` is negative. When " +"``j`` is positive, there are many, and in virtually all of them it's more " +"useful for ``i % j`` to be ``>= 0``. If the clock says 10 now, what did it " +"say 200 hours ago? ``-190 % 12 == 2`` is useful; ``-190 % 12 == -10`` is a " +"bug waiting to bite." +msgstr "" +"وقتی ``j`` منفی است، موارد استفاده واقعی کمی برای ``i % j`` وجود دارد. وقتی " +"``j`` مثبت است، موارد زیادی وجود دارد، و تقریباً در همه‌ی آن‌ها، مفیدتر است که " +"``i % j`` ``>= 0`` باشد. اگر ساعت اکنون ۱۰ باشد، ۲۰۰ ساعت پیش چند بوده است؟ " +"``-190 % 12 == 2`` مفید است؛ ``-190 % 12 == -10`` باگی است که در کمین نشسته " +"تا مشکل‌ساز شود." msgid "How do I get int literal attribute instead of SyntaxError?" -msgstr "" +msgstr "چگونه می‌توانم به‌جای SyntaxError، ویژگی لفظی int را دریافت کنم؟" -msgid "Trying to lookup an ``int`` literal attribute in the normal manner gives a :exc:`SyntaxError` because the period is seen as a decimal point::" +msgid "" +"Trying to lookup an ``int`` literal attribute in the normal manner gives " +"a :exc:`SyntaxError` because the period is seen as a decimal point::" msgstr "" +"تلاش برای جست‌وجوی ویژگی یک لفظی ``int`` به روش معمول " +"باعث :exc:`SyntaxError` می‌شود، زیرا نقطه به‌عنوان نقطه‌ی اعشار در نظر گرفته " +"می‌شود::" msgid "" ">>> 1.__class__\n" @@ -801,36 +1615,101 @@ msgid "" " ^\n" "SyntaxError: invalid decimal literal" msgstr "" +">>> 1.__class__\n" +" File \"\", line 1\n" +" 1.__class__\n" +" ^\n" +"SyntaxError: invalid decimal literal" -msgid "The solution is to separate the literal from the period with either a space or parentheses." -msgstr "" +msgid "" +"The solution is to separate the literal from the period with either a space " +"or parentheses." +msgstr "راه‌حل این است که لفظی را با یک فاصله یا پرانتز از نقطه جدا کنید." msgid "How do I convert a string to a number?" -msgstr "" +msgstr "چگونه یک رشته را به عدد تبدیل کنم؟" -msgid "For integers, use the built-in :func:`int` type constructor, for example, ``int('144') == 144``. Similarly, :func:`float` converts to a floating-point number, for example, ``float('144') == 144.0``." +msgid "" +"For integers, use the built-in :func:`int` type constructor, for example, " +"``int('144') == 144``. Similarly, :func:`float` converts to a floating-" +"point number, for example, ``float('144') == 144.0``." msgstr "" +"برای اعداد صحیح، از سازنده‌ی نوع توکار :func:`int` استفاده کنید، برای مثال، " +"``int('144') == 144``. به‌طور مشابه، :func:`float` به یک عدد ممیز شناور " +"تبدیل می‌کند، برای مثال، ``float('144') == 144.0``." -msgid "By default, these interpret the number as decimal, so that ``int('0144') == 144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. ``int(string, base)`` takes the base to convert from as a second optional argument, so ``int( '0x144', 16) == 324``. If the base is specified as 0, the number is interpreted using Python's rules: a leading '0o' indicates octal, and '0x' indicates a hex number." -msgstr "" +msgid "" +"By default, these interpret the number as decimal, so that ``int('0144') == " +"144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. " +"``int(string, base)`` takes the base to convert from as a second optional " +"argument, so ``int( '0x144', 16) == 324``. If the base is specified as 0, " +"the number is interpreted using Python's rules: a leading '0o' indicates " +"octal, and '0x' indicates a hex number." +msgstr "" +"به‌طور پیش‌فرض، این‌ها عدد را به‌صورت مبنای ده تفسیر می‌کنند، به‌طوری که " +"``int('0144') == 144`` برقرار است و ``int('0x144')`` " +"استثنای :exc:`ValueError` را پرتاب می‌کند. ``int(string, base)`` مبنای تبدیل " +"را به‌عنوان آرگومان اختیاری دوم دریافت می‌کند، بنابراین ``int( '0x144', 16) " +"== 324``. اگر مبنا برابر ۰ مشخص شود، عدد با استفاده از قوانین پایتون تفسیر " +"می‌شود: پیشوند '0o' نشان‌دهنده‌ی عدد مبنای هشت است و '0x' نشان‌دهنده‌ی یک عدد " +"مبنای شانزده است." -msgid "Do not use the built-in function :func:`eval` if all you need is to convert strings to numbers. :func:`eval` will be significantly slower and it presents a security risk: someone could pass you a Python expression that might have unwanted side effects. For example, someone could pass ``__import__('os').system(\"rm -rf $HOME\")`` which would erase your home directory." -msgstr "" +msgid "" +"Do not use the built-in function :func:`eval` if all you need is to convert " +"strings to numbers. :func:`eval` will be significantly slower and it " +"presents a security risk: someone could pass you a Python expression that " +"might have unwanted side effects. For example, someone could pass " +"``__import__('os').system(\"rm -rf $HOME\")`` which would erase your home " +"directory." +msgstr "" +"اگر تنها نیاز شما تبدیل رشته‌ها به اعداد است، از تابع توکار :func:`eval` " +"استفاده نکنید. :func:`eval` به‌طور قابل‌توجهی کندتر خواهد بود و خطر امنیتی " +"ایجاد می‌کند: ممکن است شخصی یک عبارت پایتون را به شما بدهد که عوارض جانبی " +"ناخواسته‌ای داشته باشد. برای مثال، ممکن است شخصی " +"``__import__('os').system(\"rm -rf $HOME\")`` را ارسال کند که پوشه خانه شما " +"را پاک کند." -msgid ":func:`eval` also has the effect of interpreting numbers as Python expressions, so that, for example, ``eval('09')`` gives a syntax error because Python does not allow leading '0' in a decimal number (except '0')." +msgid "" +":func:`eval` also has the effect of interpreting numbers as Python " +"expressions, so that, for example, ``eval('09')`` gives a syntax error " +"because Python does not allow leading '0' in a decimal number (except '0')." msgstr "" +":func:`eval` همچنین اعداد را به‌عنوان عبارت‌های پایتون تفسیر می‌کند، به‌طوری که " +"برای مثال، ``eval('09')`` یک خطای نحو می‌دهد، زیرا پایتون اجازه نمی‌دهد '0' " +"در ابتدای یک عدد مبنای ده قرار گیرد (به‌جز '0')." msgid "How do I convert a number to a string?" -msgstr "" +msgstr "چگونه یک عدد را به رشته تبدیل کنم؟" -msgid "For example, to convert the number ``144`` to the string ``'144'``, use the built-in type constructor :func:`str`. If you want a hexadecimal or octal representation, use the built-in functions :func:`hex` or :func:`oct`. For fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` sections. For example, ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\".format(1.0/3.0)`` yields ``'0.333'``." -msgstr "" +msgid "" +"For example, to convert the number ``144`` to the string ``'144'``, use the " +"built-in type constructor :func:`str`. If you want a hexadecimal or octal " +"representation, use the built-in functions :func:`hex` or :func:`oct`. For " +"fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` " +"sections. For example, ``\"{:04d}\".format(144)`` yields ``'0144'`` and " +"``\"{:.3f}\".format(1.0/3.0)`` yields ``'0.333'``." +msgstr "" +"برای مثال، برای تبدیل عدد ``144`` به رشته‌ی ``'144'``، از سازنده‌ی نوع " +"توکار :func:`str` استفاده کنید. اگر نمایش مبنای شانزده یا مبنای هشت را " +"می‌خواهید، از توابع توکار :func:`hex` یا :func:`oct` استفاده کنید. برای " +"قالب‌بندی پیشرفته، بخش‌های :ref:`f-strings` و :ref:`formatstrings` را ببینید. " +"برای مثال، ``\"{:04d}\".format(144)`` مقدار ``'0144'`` را برمی‌گرداند و " +"``\"{:.3f}\".format(1.0/3.0)`` مقدار ``'0.333'`` را برمی‌گرداند." msgid "How do I modify a string in place?" -msgstr "" +msgstr "چگونه می‌توانم یک رشته را به‌صورت درجا تغییر دهم؟" -msgid "You can't, because strings are immutable. In most situations, you should simply construct a new string from the various parts you want to assemble it from. However, if you need an object with the ability to modify in-place Unicode data, try using an :class:`io.StringIO` object or the :mod:`array` module::" +msgid "" +"You can't, because strings are immutable. In most situations, you should " +"simply construct a new string from the various parts you want to assemble " +"it from. However, if you need an object with the ability to modify in-" +"place Unicode data, try using an :class:`io.StringIO` object or " +"the :mod:`array` module::" msgstr "" +"نمی‌توانید، زیرا رشته‌ها تغییرناپذیرند. در بیشتر مواقع، باید به‌سادگی رشته‌ی " +"جدیدی را از اجزای مختلفی که می‌خواهید از آن‌ها تشکیل شود، بسازید. با این حال، " +"اگر به شیئی با قابلیت اصلاح داده‌های یونیکد به‌صورت درجا نیاز دارید، سعی کنید " +"از یک شیء :class:`io.StringIO` یا ماژول :mod:`array` استفاده کنید::" msgid "" ">>> import io\n" @@ -855,15 +1734,44 @@ msgid "" ">>> a.tounicode()\n" "'yello, world'" msgstr "" +">>> import io\n" +">>> s = \"Hello, world\"\n" +">>> sio = io.StringIO(s)\n" +">>> sio.getvalue()\n" +"'Hello, world'\n" +">>> sio.seek(7)\n" +"7\n" +">>> sio.write(\"there!\")\n" +"6\n" +">>> sio.getvalue()\n" +"'Hello, there!'\n" +"\n" +">>> import array\n" +">>> a = array.array('w', s)\n" +">>> print(a)\n" +"array('w', 'Hello, world')\n" +">>> a[0] = 'y'\n" +">>> print(a)\n" +"array('w', 'yello, world')\n" +">>> a.tounicode()\n" +"'yello, world'" msgid "How do I use strings to call functions/methods?" -msgstr "" +msgstr "چگونه می‌توانم از رشته‌ها برای فراخوانی توابع/متدها استفاده کنم؟" msgid "There are various techniques." -msgstr "" +msgstr "روش‌های مختلفی وجود دارد." -msgid "The best is to use a dictionary that maps strings to functions. The primary advantage of this technique is that the strings do not need to match the names of the functions. This is also the primary technique used to emulate a case construct::" +msgid "" +"The best is to use a dictionary that maps strings to functions. The " +"primary advantage of this technique is that the strings do not need to " +"match the names of the functions. This is also the primary technique used " +"to emulate a case construct::" msgstr "" +"بهترین روش استفاده از یک دیکشنری است که رشته‌ها را به توابع نگاشت می‌کند. " +"مزیت اصلی این روش آن است که رشته‌ها نیازی نیست با نام توابع مطابقت داشته " +"باشند. این روش همچنین روش اصلی مورد استفاده برای شبیه‌سازی یک ساختار case " +"است::" msgid "" "def a():\n" @@ -876,20 +1784,35 @@ msgid "" "\n" "dispatch[get_input()]() # Note trailing parens to call function" msgstr "" +"def a():\n" +" pass\n" +"\n" +"def b():\n" +" pass\n" +"\n" +"dispatch = {'go': a, 'stop': b} # توجه: نبود پرانتز برای توابع\n" +"\n" +"dispatch[get_input()]() # توجه: پرانتز پایانی برای فراخوانی تابع" msgid "Use the built-in function :func:`getattr`::" -msgstr "" +msgstr "از تابع توکار :func:`getattr` استفاده کنید::" msgid "" "import foo\n" "getattr(foo, 'bar')()" msgstr "" +"import foo\n" +"getattr(foo, 'bar')()" -msgid "Note that :func:`getattr` works on any object, including classes, class instances, modules, and so on." +msgid "" +"Note that :func:`getattr` works on any object, including classes, class " +"instances, modules, and so on." msgstr "" +"توجه داشته باشید که :func:`getattr` روی هر شیئی کار می‌کند، از جمله کلاس‌ها، " +"نمونه‌های کلاس، ماژول‌ها و غیره." msgid "This is used in several places in the standard library, like this::" -msgstr "" +msgstr "این در چندین جای کتابخانه‌ی استاندارد استفاده می‌شود، مانند این::" msgid "" "class Foo:\n" @@ -902,9 +1825,18 @@ msgid "" "f = getattr(foo_instance, 'do_' + opname)\n" "f()" msgstr "" +"class Foo:\n" +" def do_foo(self):\n" +" ...\n" +"\n" +" def do_bar(self):\n" +" ...\n" +"\n" +"f = getattr(foo_instance, 'do_' + opname)\n" +"f()" msgid "Use :func:`locals` to resolve the function name::" -msgstr "" +msgstr "برای تعیین نام تابع از :func:`locals` استفاده کنید::" msgid "" "def myFunc():\n" @@ -915,12 +1847,32 @@ msgid "" "f = locals()[fname]\n" "f()" msgstr "" +"def myFunc():\n" +" print(\"hello\")\n" +"\n" +"fname = \"myFunc\"\n" +"\n" +"f = locals()[fname]\n" +"f()" -msgid "Is there an equivalent to Perl's ``chomp()`` for removing trailing newlines from strings?" +msgid "" +"Is there an equivalent to Perl's ``chomp()`` for removing trailing newlines " +"from strings?" msgstr "" +"آیا معادلی برای ``chomp()`` در Perl برای حذف خطوط جدید انتهایی از رشته‌ها " +"وجود دارد؟" -msgid "You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line terminator from the end of the string ``S`` without removing other trailing whitespace. If the string ``S`` represents more than one line, with several empty lines at the end, the line terminators for all the blank lines will be removed::" +msgid "" +"You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line " +"terminator from the end of the string ``S`` without removing other trailing " +"whitespace. If the string ``S`` represents more than one line, with " +"several empty lines at the end, the line terminators for all the blank " +"lines will be removed::" msgstr "" +"شما می‌توانید از ``S.rstrip(\"\\r\\n\")`` برای حذف همه‌ی موارد هر پایانگر خط " +"از انتهای رشته‌ی ``S`` بدون حذف دیگر فضاهای سفید انتهایی استفاده کنید. اگر " +"رشته‌ی ``S`` نمایانگر بیش از ۱ خط باشد، با چند خط خالی در انتها، پایانگرهای " +"خط برای همه‌ی خطوط خالی حذف خواهند شد::" msgid "" ">>> lines = (\"line 1 \\r\\n\"\n" @@ -929,33 +1881,62 @@ msgid "" ">>> lines.rstrip(\"\\n\\r\")\n" "'line 1 '" msgstr "" +">>> lines = (\"line 1 \\r\\n\"\n" +"... \"\\r\\n\"\n" +"... \"\\r\\n\")\n" +">>> lines.rstrip(\"\\n\\r\")\n" +"'line 1 '" -msgid "Since this is typically only desired when reading text one line at a time, using ``S.rstrip()`` this way works well." +msgid "" +"Since this is typically only desired when reading text one line at a time, " +"using ``S.rstrip()`` this way works well." msgstr "" +"از آنجا که این کار معمولاً تنها زمانی مطلوب است که متن را هر بار یک خط " +"می‌خوانید، استفاده از ``S.rstrip()`` به این شکل به‌خوبی کار می‌کند." msgid "Is there a ``scanf()`` or ``sscanf()`` equivalent?" -msgstr "" +msgstr "آیا معادلی برای ``scanf()`` یا ``sscanf()`` وجود دارد؟" msgid "Not as such." -msgstr "" +msgstr "نه به‌همین صورت." -msgid "For simple input parsing, the easiest approach is usually to split the line into whitespace-delimited words using the :meth:`~str.split` method of string objects and then convert decimal strings to numeric values using :func:`int` or :func:`float`. :meth:`!split` supports an optional \"sep\" parameter which is useful if the line uses something other than whitespace as a separator." -msgstr "" +msgid "" +"For simple input parsing, the easiest approach is usually to split the line " +"into whitespace-delimited words using the :meth:`~str.split` method of " +"string objects and then convert decimal strings to numeric values " +"using :func:`int` or :func:`float`. :meth:`!split` supports an optional " +"\"sep\" parameter which is useful if the line uses something other than " +"whitespace as a separator." +msgstr "" +"برای تجزیه ساده ورودی، معمولاً آسان‌ترین روش این است که خط را با استفاده از " +"متد :meth:`~str.split` در اشیای رشته‌ای به کلمات جداشده با فضای خالی تقسیم " +"کنید و سپس رشته‌های دهدهی را با استفاده از :func:`int` یا :func:`float` به " +"مقادیر عددی تبدیل کنید. :meth:`!split` از یک پارامتر اختیاری \"sep\" " +"پشتیبانی می‌کند که زمانی مفید است که خط از چیزی غیر از فضای خالی به‌عنوان " +"جداکننده استفاده کند." -msgid "For more complicated input parsing, regular expressions are more powerful than C's ``sscanf`` and better suited for the task." +msgid "" +"For more complicated input parsing, regular expressions are more powerful " +"than C's ``sscanf`` and better suited for the task." msgstr "" +"برای تجزیه ورودی پیچیده‌تر، عبارت‌های باقاعده قدرتمندتر از ``sscanf`` در C و " +"برای این کار مناسب‌تر هستند." msgid "What does ``UnicodeDecodeError`` or ``UnicodeEncodeError`` error mean?" -msgstr "" +msgstr "منظور از خطای ``UnicodeDecodeError`` یا ``UnicodeEncodeError`` چیست؟" msgid "See the :ref:`unicode-howto`." -msgstr "" +msgstr ":ref:`unicode-howto` را ببینید." msgid "Can I end a raw string with an odd number of backslashes?" -msgstr "" +msgstr "آیا می‌توانم یک رشته خام را با تعداد فردی از بک‌اسلش‌ها به پایان برسانم؟" -msgid "A raw string ending with an odd number of backslashes will escape the string's quote::" +msgid "" +"A raw string ending with an odd number of backslashes will escape the " +"string's quote::" msgstr "" +"رشته خامی که با تعداد فردی از بک‌اسلش‌ها تمام می‌شود، علامت نقل‌قول رشته را " +"خنثی می‌کند::" msgid "" ">>> r'C:\\this\\will\\not\\work\\'\n" @@ -964,95 +1945,220 @@ msgid "" " ^\n" "SyntaxError: unterminated string literal (detected at line 1)" msgstr "" +">>> r'C:\\this\\will\\not\\work\\'\n" +" File \"\", line 1\n" +" r'C:\\this\\will\\not\\work\\'\n" +" ^\n" +"SyntaxError: unterminated string literal (detected at line 1)" -msgid "There are several workarounds for this. One is to use regular strings and double the backslashes::" +msgid "" +"There are several workarounds for this. One is to use regular strings and " +"double the backslashes::" msgstr "" +"برای این موضوع چند راه‌حل جایگزین وجود دارد. یکی از آن‌ها استفاده از رشته‌های " +"معمولی و دو برابر کردن بک‌اسلش‌ها است::" msgid "" ">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" -msgid "Another is to concatenate a regular string containing an escaped backslash to the raw string::" -msgstr "" +msgid "" +"Another is to concatenate a regular string containing an escaped backslash " +"to the raw string::" +msgstr "راه دیگر، الحاق یک رشته معمولی حاوی بک‌اسلش خنثی‌شده به رشته خام است::" msgid "" ">>> r'C:\\this\\will\\work' '\\\\'\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> r'C:\\this\\will\\work' '\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" -msgid "It is also possible to use :func:`os.path.join` to append a backslash on Windows::" +msgid "" +"It is also possible to use :func:`os.path.join` to append a backslash on " +"Windows::" msgstr "" +"همچنین می‌توانید از :func:`os.path.join` برای افزودن یک بک‌اسلش در ویندوز " +"استفاده کنید::" msgid "" ">>> os.path.join(r'C:\\this\\will\\work', '')\n" "'C:\\\\this\\\\will\\\\work\\\\'" msgstr "" +">>> os.path.join(r'C:\\this\\will\\work', '')\n" +"'C:\\\\this\\\\will\\\\work\\\\'" -msgid "Note that while a backslash will \"escape\" a quote for the purposes of determining where the raw string ends, no escaping occurs when interpreting the value of the raw string. That is, the backslash remains present in the value of the raw string::" +msgid "" +"Note that while a backslash will \"escape\" a quote for the purposes of " +"determining where the raw string ends, no escaping occurs when interpreting " +"the value of the raw string. That is, the backslash remains present in the " +"value of the raw string::" msgstr "" +"توجه داشته باشید که اگرچه یک بک‌اسلش علامت نقل‌قول را برای تعیین محل پایان " +"رشته خام «خنثی» می‌کند، هنگام تفسیر مقدار رشته خام هیچ خنثی‌سازی رخ نمی‌دهد. " +"یعنی، بک‌اسلش در مقدار رشته خام باقی می‌ماند::" msgid "" ">>> r'backslash\\'preserved'\n" "\"backslash\\\\'preserved\"" msgstr "" +">>> r'backslash\\'preserved'\n" +"\"backslash\\\\'preserved\"" msgid "Also see the specification in the :ref:`language reference `." -msgstr "" +msgstr "همچنین مشخصات موجود در :ref:`مرجع زبان ` را ببینید." msgid "Performance" -msgstr "" +msgstr "کارایی" msgid "My program is too slow. How do I speed it up?" -msgstr "" +msgstr "برنامه‌ی من بسیار کند است. چگونه آن را سریع‌تر کنم؟" -msgid "That's a tough one, in general. First, here is a list of things to remember before diving further:" +msgid "" +"That's a tough one, in general. First, here is a list of things to " +"remember before diving further:" msgstr "" +"به‌طور کلی، این پرسش دشواری است. نخست، در اینجا فهرستی از مواردی که باید پیش " +"از ادامه‌ی عمیق‌تر به خاطر بسپارید آمده است:" -msgid "Performance characteristics vary across Python implementations. This FAQ focuses on :term:`CPython`." +msgid "" +"Performance characteristics vary across Python implementations. This FAQ " +"focuses on :term:`CPython`." msgstr "" +"ویژگی‌های عملکردی در پیاده‌سازی‌های مختلف پایتون متفاوت است. این پرسش‌های " +"متداول بر :term:`CPython` تمرکز دارد." -msgid "Behaviour can vary across operating systems, especially when talking about I/O or multi-threading." +msgid "" +"Behaviour can vary across operating systems, especially when talking about " +"I/O or multi-threading." msgstr "" +"رفتار ممکن است در سیستم‌عامل‌های مختلف متفاوت باشد، به‌ویژه هنگامی که صحبت از " +"ورودی/خروجی یا چندنخی می‌شود." -msgid "You should always find the hot spots in your program *before* attempting to optimize any code (see the :mod:`profile` module)." +msgid "" +"You should always find the hot spots in your program *before* attempting to " +"optimize any code (see the :mod:`profile` module)." msgstr "" +"شما باید همیشه نقاط داغ برنامه‌ی خود را *پیش از* تلاش برای بهینه‌سازی هر کدی " +"پیدا کنید (ماژول :mod:`profile` را ببینید)." -msgid "Writing benchmark scripts will allow you to iterate quickly when searching for improvements (see the :mod:`timeit` module)." +msgid "" +"Writing benchmark scripts will allow you to iterate quickly when searching " +"for improvements (see the :mod:`timeit` module)." msgstr "" +"نوشتن اسکریپت‌های محک به شما امکان می‌دهد هنگام جست‌وجو برای بهبودها، به‌سرعت " +"تکرار کنید (ماژول :mod:`timeit` را ببینید)." -msgid "It is highly recommended to have good code coverage (through unit testing or any other technique) before potentially introducing regressions hidden in sophisticated optimizations." +msgid "" +"It is highly recommended to have good code coverage (through unit testing " +"or any other technique) before potentially introducing regressions hidden " +"in sophisticated optimizations." msgstr "" +"اکیداً توصیه می‌شود پیش از آنکه به‌طور بالقوه پسرفت‌هایی پنهان در بهینه‌سازی‌های " +"پیچیده ایجاد کنید، پوشش کد خوبی (از طریق آزمون واحد یا هر تکنیک دیگری) داشته " +"باشید." -msgid "That being said, there are many tricks to speed up Python code. Here are some general principles which go a long way towards reaching acceptable performance levels:" +msgid "" +"That being said, there are many tricks to speed up Python code. Here are " +"some general principles which go a long way towards reaching acceptable " +"performance levels:" msgstr "" +"با این حال، ترفندهای زیادی برای سرعت بخشیدن به کد پایتون وجود دارد. در " +"اینجا برخی اصول کلی آورده شده است که کمک شایانی به رسیدن به سطوح عملکرد " +"قابل‌قبول می‌کنند:" -msgid "Making your algorithms faster (or changing to faster ones) can yield much larger benefits than trying to sprinkle micro-optimization tricks all over your code." +msgid "" +"Making your algorithms faster (or changing to faster ones) can yield much " +"larger benefits than trying to sprinkle micro-optimization tricks all over " +"your code." msgstr "" +"سریع‌تر کردن الگوریتم‌هایتان (یا تغییر به الگوریتم‌های سریع‌تر) می‌تواند مزایای " +"بسیار بزرگ‌تری نسبت به تلاش برای پخش کردن ترفندهای ریزبهینه‌سازی (micro-" +"optimization) در سراسر کدتان به همراه داشته باشد." -msgid "Use the right data structures. Study documentation for the :ref:`bltin-types` and the :mod:`collections` module." +msgid "" +"Use the right data structures. Study documentation for the :ref:`bltin-" +"types` and the :mod:`collections` module." msgstr "" +"از ساختارهای داده مناسب استفاده کنید. مستندات مربوط به :ref:`bltin-types` و " +"ماژول :mod:`collections` را مطالعه کنید." -msgid "When the standard library provides a primitive for doing something, it is likely (although not guaranteed) to be faster than any alternative you may come up with. This is doubly true for primitives written in C, such as builtins and some extension types. For example, be sure to use either the :meth:`list.sort` built-in method or the related :func:`sorted` function to do sorting (and see the :ref:`sortinghowto` for examples of moderately advanced usage)." -msgstr "" +msgid "" +"When the standard library provides a primitive for doing something, it is " +"likely (although not guaranteed) to be faster than any alternative you may " +"come up with. This is doubly true for primitives written in C, such as " +"builtins and some extension types. For example, be sure to use either " +"the :meth:`list.sort` built-in method or the related :func:`sorted` " +"function to do sorting (and see the :ref:`sortinghowto` for examples of " +"moderately advanced usage)." +msgstr "" +"هنگامی که کتابخانه استاندارد ساختار اولیه‌ای برای انجام کاری فراهم می‌کند، " +"احتمالاً (هرچند تضمینی نیست) سریع‌تر از هر جایگزینی است که ممکن است شما ارائه " +"دهید. این موضوع برای ساختارهای اولیه نوشته‌شده به زبان C، مانند توکارها و " +"برخی از انواع توسعه‌ای (extension types)، دوچندان صادق است. برای مثال، حتماً " +"برای مرتب‌سازی از متد توکار :meth:`list.sort` یا تابع مرتبط :func:`sorted` " +"استفاده کنید (و برای نمونه‌هایی از کاربرد نسبتاً پیشرفته، :ref:`sortinghowto` " +"را ببینید)." -msgid "Abstractions tend to create indirections and force the interpreter to work more. If the levels of indirection outweigh the amount of useful work done, your program will be slower. You should avoid excessive abstraction, especially under the form of tiny functions or methods (which are also often detrimental to readability)." +msgid "" +"Abstractions tend to create indirections and force the interpreter to work " +"more. If the levels of indirection outweigh the amount of useful work " +"done, your program will be slower. You should avoid excessive abstraction, " +"especially under the form of tiny functions or methods (which are also " +"often detrimental to readability)." msgstr "" +"انتزاع‌ها معمولاً باعث ایجاد ارجاع‌های غیرمستقیم می‌شوند و مفسر را مجبور به کار " +"بیشتر می‌کنند. اگر سطوح ارجاع غیرمستقیم بر مقدار کار مفید انجام‌شده غلبه کند، " +"برنامه شما کندتر خواهد شد. شما باید از انتزاع بیش‌ازحد، به‌ویژه در قالب توابع " +"یا متدهای بسیار کوچک (که اغلب به خوانایی نیز آسیب می‌زنند) اجتناب کنید." -msgid "If you have reached the limit of what pure Python can allow, there are tools to take you further away. For example, `Cython `_ can compile a slightly modified version of Python code into a C extension, and can be used on many different platforms. Cython can take advantage of compilation (and optional type annotations) to make your code significantly faster than when interpreted. If you are confident in your C programming skills, you can also :ref:`write a C extension module ` yourself." -msgstr "" +msgid "" +"If you have reached the limit of what pure Python can allow, there are " +"tools to take you further away. For example, `Cython `_ can compile a slightly modified version of Python code into a " +"C extension, and can be used on many different platforms. Cython can take " +"advantage of compilation (and optional type annotations) to make your code " +"significantly faster than when interpreted. If you are confident in your C " +"programming skills, you can also :ref:`write a C extension module " +"` yourself." +msgstr "" +"اگر به محدودیت آنچه پایتون خالص اجازه می‌دهد رسیده‌اید، ابزارهایی وجود دارند " +"که شما را فراتر می‌برند. برای مثال، `Cython `_ می‌تواند " +"نسخه‌ای اندکی تغییریافته از کد پایتون را به یک افزونه C کامپایل کند و " +"می‌تواند روی سکوهای مختلفی استفاده شود. Cython می‌تواند با بهره‌گیری از " +"کامپایل (و یادداشت‌های نوع اختیاری)، کد شما را به‌طور قابل‌توجهی سریع‌تر از " +"حالت تفسیرشده کند. اگر به مهارت‌های برنامه‌نویسی C خود اطمینان دارید، همچنین " +"می‌توانید خودتان :ref:`یک ماژول افزونه C بنویسید `." -msgid "The wiki page devoted to `performance tips `_." +msgid "" +"The wiki page devoted to `performance tips `_." msgstr "" +"صفحه‌ی ویکی اختصاص‌یافته به `نکات کارایی `_." msgid "What is the most efficient way to concatenate many strings together?" -msgstr "" +msgstr "کارآمدترین روش برای الحاق رشته‌های بسیاری به یکدیگر چیست؟" -msgid ":class:`str` and :class:`bytes` objects are immutable, therefore concatenating many strings together is inefficient as each concatenation creates a new object. In the general case, the total runtime cost is quadratic in the total string length." +msgid "" +":class:`str` and :class:`bytes` objects are immutable, therefore " +"concatenating many strings together is inefficient as each concatenation " +"creates a new object. In the general case, the total runtime cost is " +"quadratic in the total string length." msgstr "" +"اشیاء :class:`str` و :class:`bytes` تغییرناپذیر هستند، بنابراین الحاق " +"رشته‌های زیاد به یکدیگر ناکارآمد است، زیرا هر الحاق یک شیء جدید ایجاد می‌کند. " +"در حالت کلی، هزینه‌ی کل ران‌تایم نسبت به طول کل رشته‌ها درجه دو است." -msgid "To accumulate many :class:`str` objects, the recommended idiom is to place them into a list and call :meth:`str.join` at the end::" +msgid "" +"To accumulate many :class:`str` objects, the recommended idiom is to place " +"them into a list and call :meth:`str.join` at the end::" msgstr "" +"برای انباشتن تعداد زیادی شیء :class:`str`، روش توصیه‌شده این است که آن‌ها را " +"در یک فهرست قرار دهید و در پایان :meth:`str.join` را فراخوانی کنید::" msgid "" "chunks = []\n" @@ -1060,68 +2166,128 @@ msgid "" " chunks.append(s)\n" "result = ''.join(chunks)" msgstr "" +"chunks = []\n" +"for s in my_strings:\n" +" chunks.append(s)\n" +"result = ''.join(chunks)" msgid "(Another reasonably efficient idiom is to use :class:`io.StringIO`.)" -msgstr "" +msgstr "(یک روش نسبتاً کارآمد دیگر استفاده از :class:`io.StringIO` است.)" -msgid "To accumulate many :class:`bytes` objects, the recommended idiom is to extend a :class:`bytearray` object using in-place concatenation (the ``+=`` operator)::" +msgid "" +"To accumulate many :class:`bytes` objects, the recommended idiom is to " +"extend a :class:`bytearray` object using in-place concatenation (the ``+=`` " +"operator)::" msgstr "" +"برای انباشتن بسیاری از اشیای :class:`bytes`، روش توصیه‌شده این است که یک " +"شیء :class:`bytearray` را با استفاده از الحاق درجا (عملگر ``+=``) گسترش " +"دهید::" msgid "" "result = bytearray()\n" "for b in my_bytes_objects:\n" " result += b" msgstr "" +"result = bytearray()\n" +"for b in my_bytes_objects:\n" +" result += b" msgid "Sequences (tuples/lists)" -msgstr "" +msgstr "دنباله‌ها (تاپل‌ها/فهرست‌ها)" msgid "How do I convert between tuples and lists?" -msgstr "" +msgstr "چگونه تاپل‌ها و فهرست‌ها را به یکدیگر تبدیل کنم؟" -msgid "The type constructor ``tuple(seq)`` converts any sequence (actually, any iterable) into a tuple with the same items in the same order." +msgid "" +"The type constructor ``tuple(seq)`` converts any sequence (actually, any " +"iterable) into a tuple with the same items in the same order." msgstr "" +"سازنده‌ی نوع ``tuple(seq)`` هر دنباله‌ای (در واقع، هر پیمایش‌پذیری) را به یک " +"تاپل با همان آیتم‌ها و همان ترتیب تبدیل می‌کند." -msgid "For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a copy but returns the same object, so it is cheap to call :func:`tuple` when you aren't sure that an object is already a tuple." +msgid "" +"For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` " +"yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a " +"copy but returns the same object, so it is cheap to call :func:`tuple` when " +"you aren't sure that an object is already a tuple." msgstr "" +"برای مثال، ``tuple([1, 2, 3])`` مقدار ``(1, 2, 3)`` را حاصل می‌دهد و " +"``tuple('abc')`` مقدار ``('a', 'b', 'c')`` را حاصل می‌دهد. اگر آرگومان یک " +"تاپل باشد، نسخه‌ای نمی‌سازد بلکه همان شیء را برمی‌گرداند، بنابراین وقتی مطمئن " +"نیستید که یک شیء از قبل یک تاپل است، فراخوانی :func:`tuple` کم‌هزینه است." -msgid "The type constructor ``list(seq)`` converts any sequence or iterable into a list with the same items in the same order. For example, ``list((1, 2, 3))`` yields ``[1, 2, 3]`` and ``list('abc')`` yields ``['a', 'b', 'c']``. If the argument is a list, it makes a copy just like ``seq[:]`` would." +msgid "" +"The type constructor ``list(seq)`` converts any sequence or iterable into a " +"list with the same items in the same order. For example, ``list((1, 2, " +"3))`` yields ``[1, 2, 3]`` and ``list('abc')`` yields ``['a', 'b', 'c']``. " +"If the argument is a list, it makes a copy just like ``seq[:]`` would." msgstr "" +"سازنده‌ی نوع ``list(seq)`` هر دنباله یا پیمایش‌پذیری را به یک فهرست با همان " +"آیتم‌ها به همان ترتیب تبدیل می‌کند. برای مثال، ``list((1, 2, 3))`` مقدار " +"``[1, 2, 3]`` را برمی‌گرداند و ``list('abc')`` مقدار ``['a', 'b', 'c']`` را " +"برمی‌گرداند. اگر آرگومان یک فهرست باشد، دقیقاً مانند ``seq[:]`` یک کپی می‌سازد." msgid "What's a negative index?" -msgstr "" +msgstr "اندیس منفی چیست؟" -msgid "Python sequences are indexed with positive numbers and negative numbers. For positive numbers 0 is the first index 1 is the second index and so forth. For negative indices -1 is the last index and -2 is the penultimate (next to last) index and so forth. Think of ``seq[-n]`` as the same as ``seq[len(seq)-n]``." +msgid "" +"Python sequences are indexed with positive numbers and negative numbers. " +"For positive numbers 0 is the first index 1 is the second index and so " +"forth. For negative indices -1 is the last index and -2 is the penultimate " +"(next to last) index and so forth. Think of ``seq[-n]`` as the same as " +"``seq[len(seq)-n]``." msgstr "" +"دنباله‌های پایتون با اعداد مثبت و منفی اندیس‌دهی می‌شوند. برای اعداد مثبت، ۰ " +"اولین اندیس، ۱ دومین اندیس و به همین ترتیب است. برای اندیس‌های منفی، منفی ۱ " +"آخرین اندیس، منفی ۲ اندیس ماقبل آخر (یکی مانده به آخر) و به همین ترتیب است. " +"``seq[-n]`` را معادل ``seq[len(seq)-n]`` در نظر بگیرید." -msgid "Using negative indices can be very convenient. For example ``S[:-1]`` is all of the string except for its last character, which is useful for removing the trailing newline from a string." +msgid "" +"Using negative indices can be very convenient. For example ``S[:-1]`` is " +"all of the string except for its last character, which is useful for " +"removing the trailing newline from a string." msgstr "" +"استفاده از اندیس‌های منفی می‌تواند بسیار مفید باشد. برای مثال ``S[:-1]`` تمام " +"رشته به‌جز آخرین نویسه آن است، که برای حذف خط جدید پایانی از یک رشته مفید " +"است." msgid "How do I iterate over a sequence in reverse order?" -msgstr "" +msgstr "چگونه می‌توانم یک دنباله را در ترتیب معکوس پیمایش کنم؟" msgid "Use the :func:`reversed` built-in function::" -msgstr "" +msgstr "از تابع توکار :func:`reversed` استفاده کنید::" msgid "" "for x in reversed(sequence):\n" " ... # do something with x ..." msgstr "" +"for x in reversed(sequence):\n" +" ... # do something with x ..." -msgid "This won't touch your original sequence, but build a new copy with reversed order to iterate over." +msgid "" +"This won't touch your original sequence, but build a new copy with reversed " +"order to iterate over." msgstr "" +"این کار دنباله اصلی شما را تغییر نمی‌دهد، بلکه یک رونوشت جدید با ترتیب معکوس " +"برای پیمایش می‌سازد." msgid "How do you remove duplicates from a list?" -msgstr "" +msgstr "چگونه موارد تکراری را از یک فهرست حذف می‌کنید؟" msgid "See the Python Cookbook for a long discussion of many ways to do this:" msgstr "" +"برای بحث مفصل درباره‌ی راه‌های بسیاری برای انجام این کار، Python Cookbook را " +"ببینید:" msgid "https://code.activestate.com/recipes/52560/" -msgstr "" +msgstr "https://code.activestate.com/recipes/52560/" -msgid "If you don't mind reordering the list, sort it and then scan from the end of the list, deleting duplicates as you go::" +msgid "" +"If you don't mind reordering the list, sort it and then scan from the end " +"of the list, deleting duplicates as you go::" msgstr "" +"اگر با تغییر ترتیب فهرست مشکلی ندارید، آن را مرتب کنید و سپس از انتهای " +"فهرست پیمایش کنید و در حین پیشروی، موارد تکراری را حذف کنید::" msgid "" "if mylist:\n" @@ -1133,118 +2299,210 @@ msgid "" " else:\n" " last = mylist[i]" msgstr "" +"if mylist:\n" +" mylist.sort()\n" +" last = mylist[-1]\n" +" for i in range(len(mylist)-2, -1, -1):\n" +" if last == mylist[i]:\n" +" del mylist[i]\n" +" else:\n" +" last = mylist[i]" -msgid "If all elements of the list may be used as set keys (that is, they are all :term:`hashable`) this is often faster::" +msgid "" +"If all elements of the list may be used as set keys (that is, they are " +"all :term:`hashable`) this is often faster::" msgstr "" +"اگر بتوان از همه‌ی عناصر فهرست به‌عنوان کلیدهای مجموعه استفاده کرد (یعنی همه‌ی " +"آن‌ها :term:`hashable` باشند)، این کار معمولاً سریع‌تر است::" msgid "mylist = list(set(mylist))" -msgstr "" +msgstr "mylist = list(set(mylist))" -msgid "This converts the list into a set, thereby removing duplicates, and then back into a list." +msgid "" +"This converts the list into a set, thereby removing duplicates, and then " +"back into a list." msgstr "" +"این کار فهرست را به یک مجموعه تبدیل می‌کند، در نتیجه موارد تکراری حذف " +"می‌شوند، و سپس آن را دوباره به یک فهرست برمی‌گرداند." msgid "How do you remove multiple items from a list?" -msgstr "" +msgstr "چگونه چندین آیتم را از یک فهرست حذف می‌کنید؟" -msgid "As with removing duplicates, explicitly iterating in reverse with a delete condition is one possibility. However, it is easier and faster to use slice replacement with an implicit or explicit forward iteration. Here are three variations::" +msgid "" +"As with removing duplicates, explicitly iterating in reverse with a delete " +"condition is one possibility. However, it is easier and faster to use " +"slice replacement with an implicit or explicit forward iteration. Here are " +"three variations::" msgstr "" +"مانند حذف تکراری‌ها، پیمایش معکوس به‌صورت صریح همراه با یک شرط حذف یکی از " +"امکان‌ها است. با این حال، استفاده از جایگزینی برش با پیمایش رو به جلو به‌صورت " +"ضمنی یا صریح، ساده‌تر و سریع‌تر است. در اینجا سه حالت مختلف آمده است::" msgid "" "mylist[:] = filter(keep_function, mylist)\n" "mylist[:] = (x for x in mylist if keep_condition)\n" "mylist[:] = [x for x in mylist if keep_condition]" msgstr "" +"mylist[:] = filter(keep_function, mylist)\n" +"mylist[:] = (x for x in mylist if keep_condition)\n" +"mylist[:] = [x for x in mylist if keep_condition]" msgid "The list comprehension may be fastest." -msgstr "" +msgstr "درک فهرستی ممکن است سریع‌ترین باشد." msgid "How do you make an array in Python?" -msgstr "" +msgstr "چگونه در پایتون یک آرایه می‌سازید؟" msgid "Use a list::" -msgstr "" +msgstr "از یک فهرست استفاده کنید::" msgid "[\"this\", 1, \"is\", \"an\", \"array\"]" -msgstr "" +msgstr "[\"this\", 1, \"is\", \"an\", \"array\"]" -msgid "Lists are equivalent to C or Pascal arrays in their time complexity; the primary difference is that a Python list can contain objects of many different types." +msgid "" +"Lists are equivalent to C or Pascal arrays in their time complexity; the " +"primary difference is that a Python list can contain objects of many " +"different types." msgstr "" +"فهرست‌ها از نظر پیچیدگی زمانی معادل آرایه‌های C یا Pascal هستند؛ تفاوت اصلی " +"این است که یک فهرست پایتون می‌تواند شامل اشیایی از انواع گوناگون باشد." -msgid "The ``array`` module also provides methods for creating arrays of fixed types with compact representations, but they are slower to index than lists. Also note that `NumPy `_ and other third-party packages define array-like structures with various characteristics as well." +msgid "" +"The ``array`` module also provides methods for creating arrays of fixed " +"types with compact representations, but they are slower to index than " +"lists. Also note that `NumPy `_ and other third-party " +"packages define array-like structures with various characteristics as well." msgstr "" +"ماژول ``array`` همچنین متدهایی برای ایجاد آرایه‌هایی از انواع ثابت با " +"بازنمایی‌های فشرده فراهم می‌کند، اما اندیس‌دهی به آن‌ها کندتر از فهرست‌ها است. " +"همچنین توجه داشته باشید که `NumPy `_ و سایر بسته‌های شخص " +"ثالث نیز ساختارهای آرایه‌مانندی با ویژگی‌های مختلف تعریف می‌کنند." -msgid "To get Lisp-style linked lists, you can emulate *cons cells* using tuples::" +msgid "" +"To get Lisp-style linked lists, you can emulate *cons cells* using tuples::" msgstr "" +"برای داشتن فهرست‌های پیوندی به سبک Lisp، می‌توانید *cons cells* را با استفاده " +"از تاپل‌ها شبیه‌سازی کنید::" msgid "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" -msgstr "" +msgstr "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" -msgid "If mutability is desired, you could use lists instead of tuples. Here the analogue of a Lisp *car* is ``lisp_list[0]`` and the analogue of *cdr* is ``lisp_list[1]``. Only do this if you're sure you really need to, because it's usually a lot slower than using Python lists." +msgid "" +"If mutability is desired, you could use lists instead of tuples. Here the " +"analogue of a Lisp *car* is ``lisp_list[0]`` and the analogue of *cdr* is " +"``lisp_list[1]``. Only do this if you're sure you really need to, because " +"it's usually a lot slower than using Python lists." msgstr "" +"اگر تغییرپذیری مورد نظر باشد، می‌توانید به‌جای تاپل‌ها از فهرست‌ها استفاده " +"کنید. در اینجا معادل *car* در Lisp برابر ``lisp_list[0]`` و معادل *cdr* " +"برابر ``lisp_list[1]`` است. این کار را تنها در صورتی انجام دهید که مطمئن " +"هستید واقعاً به آن نیاز دارید، زیرا معمولاً بسیار کندتر از استفاده از " +"فهرست‌های پایتون است." msgid "How do I create a multidimensional list?" -msgstr "" +msgstr "چگونه یک فهرست چندبعدی ایجاد کنم؟" msgid "You probably tried to make a multidimensional array like this::" -msgstr "" +msgstr "احتمالاً سعی کرده‌اید یک آرایه چندبعدی مانند این بسازید::" msgid ">>> A = [[None] * 2] * 3" -msgstr "" +msgstr ">>> A = [[None] * 2] * 3" msgid "This looks correct if you print it:" -msgstr "" +msgstr "اگر آن را چاپ کنید، درست به نظر می‌رسد:" msgid "" ">>> A\n" "[[None, None], [None, None], [None, None]]" msgstr "" +">>> A\n" +"[[None, None], [None, None], [None, None]]" msgid "But when you assign a value, it shows up in multiple places:" -msgstr "" +msgstr "اما وقتی مقداری را انتساب می‌دهید، در چندین جا ظاهر می‌شود:" msgid "" ">>> A[0][0] = 5\n" ">>> A\n" "[[5, None], [5, None], [5, None]]" msgstr "" +">>> A[0][0] = 5\n" +">>> A\n" +"[[5, None], [5, None], [5, None]]" -msgid "The reason is that replicating a list with ``*`` doesn't create copies, it only creates references to the existing objects. The ``*3`` creates a list containing 3 references to the same list of length two. Changes to one row will show in all rows, which is almost certainly not what you want." +msgid "" +"The reason is that replicating a list with ``*`` doesn't create copies, it " +"only creates references to the existing objects. The ``*3`` creates a list " +"containing 3 references to the same list of length two. Changes to one row " +"will show in all rows, which is almost certainly not what you want." msgstr "" +"دلیل این است که تکثیر یک فهرست با ``*`` نسخه‌هایی ایجاد نمی‌کند، بلکه فقط " +"ارجاع‌هایی به اشیاء موجود ایجاد می‌کند. ``*3`` فهرستی شامل ۳ ارجاع به همان " +"فهرست با طول دو ایجاد می‌کند. تغییرات در یک ردیف در تمام ردیف‌ها نمایان خواهد " +"شد، که تقریباً به‌طور قطع آنچه شما می‌خواهید نیست." -msgid "The suggested approach is to create a list of the desired length first and then fill in each element with a newly created list::" +msgid "" +"The suggested approach is to create a list of the desired length first and " +"then fill in each element with a newly created list::" msgstr "" +"رویکرد پیشنهادی این است که ابتدا فهرستی به طول دلخواه ایجاد کنید و سپس هر " +"عنصر را با فهرستی که به‌تازگی ایجاد شده است پر کنید::" msgid "" "A = [None] * 3\n" "for i in range(3):\n" " A[i] = [None] * 2" msgstr "" +"A = [None] * 3\n" +"for i in range(3):\n" +" A[i] = [None] * 2" -msgid "This generates a list containing 3 different lists of length two. You can also use a list comprehension::" +msgid "" +"This generates a list containing 3 different lists of length two. You can " +"also use a list comprehension::" msgstr "" +"این یک فهرست شامل ۳ فهرست متفاوت به طول دو تولید می‌کند. شما همچنین می‌توانید " +"از یک درک فهرستی استفاده کنید::" msgid "" "w, h = 2, 3\n" "A = [[None] * w for i in range(h)]" msgstr "" +"w, h = 2, 3\n" +"A = [[None] * w for i in range(h)]" -msgid "Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known." +msgid "" +"Or, you can use an extension that provides a matrix datatype; `NumPy " +"`_ is the best known." msgstr "" +"یا می‌توانید از افزونه‌ای استفاده کنید که نوع داده ماتریسی را فراهم می‌کند؛ " +"`NumPy `_ شناخته‌شده‌ترین است." msgid "How do I apply a method or function to a sequence of objects?" -msgstr "" +msgstr "چگونه یک متد یا تابع را بر دنباله‌ای از شیء‌ها اعمال کنم؟" -msgid "To call a method or function and accumulate the return values in a list, a :term:`list comprehension` is an elegant solution::" +msgid "" +"To call a method or function and accumulate the return values in a list, " +"a :term:`list comprehension` is an elegant solution::" msgstr "" +"برای فراخوانی یک متد یا تابع و جمع‌آوری مقادیر بازگشتی در یک " +"فهرست، :term:`درک فهرستی ` راه‌حلی ظریف است::" msgid "" "result = [obj.method() for obj in mylist]\n" "\n" "result = [function(obj) for obj in mylist]" msgstr "" +"result = [obj.method() for obj in mylist]\n" +"\n" +"result = [function(obj) for obj in mylist]" -msgid "To just run the method or function without saving the return values, a plain :keyword:`for` loop will suffice::" +msgid "" +"To just run the method or function without saving the return values, a " +"plain :keyword:`for` loop will suffice::" msgstr "" +"برای اینکه فقط متد یا تابع را بدون ذخیره‌ی مقادیر بازگشتی اجرا کنید، یک " +"حلقه‌ی :keyword:`for` ساده کافی است::" msgid "" "for obj in mylist:\n" @@ -1253,18 +2511,36 @@ msgid "" "for obj in mylist:\n" " function(obj)" msgstr "" +"for obj in mylist:\n" +" obj.method()\n" +"\n" +"for obj in mylist:\n" +" function(obj)" -msgid "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" +msgid "" +"Why does a_tuple[i] += ['item'] raise an exception when the addition works?" msgstr "" +"چرا a_tuple[i] += ['item'] در حالی که عمل جمع کار می‌کند، استثنا پرتاب می‌کند؟" -msgid "This is because of a combination of the fact that augmented assignment operators are *assignment* operators, and the difference between mutable and immutable objects in Python." +msgid "" +"This is because of a combination of the fact that augmented assignment " +"operators are *assignment* operators, and the difference between mutable " +"and immutable objects in Python." msgstr "" +"این به‌دلیل ترکیبی از این واقعیت است که عملگرهای انتساب افزوده، عملگرهای " +"*انتساب* هستند و تفاوت میان اشیاء تغییرپذیر و تغییرناپذیر در پایتون." -msgid "This discussion applies in general when augmented assignment operators are applied to elements of a tuple that point to mutable objects, but we'll use a ``list`` and ``+=`` as our exemplar." +msgid "" +"This discussion applies in general when augmented assignment operators are " +"applied to elements of a tuple that point to mutable objects, but we'll use " +"a ``list`` and ``+=`` as our exemplar." msgstr "" +"این بحث به‌طور کلی زمانی صدق می‌کند که عملگرهای انتساب افزوده بر عناصری از یک " +"تاپل که به اشیاء تغییرپذیر اشاره می‌کنند، اعمال شوند، اما از یک ``list`` و " +"``+=`` به‌عنوان نمونه‌ی خود استفاده می‌کنیم." msgid "If you wrote::" -msgstr "" +msgstr "اگر نوشتید::" msgid "" ">>> a_tuple = (1, 2)\n" @@ -1273,12 +2549,30 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> a_tuple = (1, 2)\n" +">>> a_tuple[0] += 1\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" -msgid "The reason for the exception should be immediately clear: ``1`` is added to the object ``a_tuple[0]`` points to (``1``), producing the result object, ``2``, but when we attempt to assign the result of the computation, ``2``, to element ``0`` of the tuple, we get an error because we can't change what an element of a tuple points to." -msgstr "" +msgid "" +"The reason for the exception should be immediately clear: ``1`` is added to " +"the object ``a_tuple[0]`` points to (``1``), producing the result object, " +"``2``, but when we attempt to assign the result of the computation, ``2``, " +"to element ``0`` of the tuple, we get an error because we can't change what " +"an element of a tuple points to." +msgstr "" +"دلیل این استثنا باید بلافاصله روشن باشد: با اضافه شدن ``1`` به شیئی که " +"``a_tuple[0]`` به آن اشاره می‌کند (``1``)، شیء نتیجه، ``2``، تولید می‌شود، " +"اما وقتی تلاش می‌کنیم نتیجه‌ی محاسبه، ``2``، را به عنصر ``0`` تاپل انتساب " +"دهیم، با خطا مواجه می‌شویم، زیرا نمی‌توانیم آنچه را که یک عنصر از تاپل به آن " +"اشاره می‌کند تغییر دهیم." -msgid "Under the covers, what this augmented assignment statement is doing is approximately this::" +msgid "" +"Under the covers, what this augmented assignment statement is doing is " +"approximately this::" msgstr "" +"آنچه این دستور انتساب افزوده در پشت صحنه انجام می‌دهد، تقریباً این است::" msgid "" ">>> result = a_tuple[0] + 1\n" @@ -1287,12 +2581,20 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> result = a_tuple[0] + 1\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" -msgid "It is the assignment part of the operation that produces the error, since a tuple is immutable." +msgid "" +"It is the assignment part of the operation that produces the error, since a " +"tuple is immutable." msgstr "" +"این بخش انتساب عملیات است که خطا را ایجاد می‌کند، زیرا تاپل تغییرناپذیر است." msgid "When you write something like::" -msgstr "" +msgstr "هنگامی که چیزی مانند زیر می‌نویسید::" msgid "" ">>> a_tuple = (['foo'], 'bar')\n" @@ -1301,17 +2603,42 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> a_tuple = (['foo'], 'bar')\n" +">>> a_tuple[0] += ['item']\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" -msgid "The exception is a bit more surprising, and even more surprising is the fact that even though there was an error, the append worked::" +msgid "" +"The exception is a bit more surprising, and even more surprising is the " +"fact that even though there was an error, the append worked::" msgstr "" +"این استثنا کمی تعجب‌آورتر است، و حتی تعجب‌آورتر این واقعیت است که با وجود " +"خطا، append کار کرد::" msgid "" ">>> a_tuple[0]\n" "['foo', 'item']" msgstr "" +">>> a_tuple[0]\n" +"['foo', 'item']" -msgid "To see why this happens, you need to know that (a) if an object implements an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` augmented assignment is executed, and its return value is what gets used in the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent to calling :meth:`~sequence.extend` on the list and returning the list. That's why we say that for lists, ``+=`` is a \"shorthand\" for :meth:`list.extend`::" -msgstr "" +msgid "" +"To see why this happens, you need to know that (a) if an object implements " +"an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " +"augmented assignment is executed, and its return value is what gets used in " +"the assignment statement; and (b) for lists, :meth:`!__iadd__` is " +"equivalent to calling :meth:`~sequence.extend` on the list and returning " +"the list. That's why we say that for lists, ``+=`` is a \"shorthand\" " +"for :meth:`list.extend`::" +msgstr "" +"برای این‌که ببینید چرا این اتفاق می‌افتد، باید بدانید که (الف) اگر یک شیء متد " +"جادویی :meth:`~object.__iadd__` را پیاده‌سازی کرده باشد، هنگامی که انتساب " +"تقویت‌شده‌ی ``+=`` اجرا شود، آن متد فراخوانی می‌شود و مقدار بازگشتی آن چیزی است " +"که در دستور انتساب به کار می‌رود؛ و (ب) برای فهرست‌ها، :meth:`!__iadd__` " +"معادل فراخوانی :meth:`~sequence.extend` روی فهرست و برگرداندن فهرست است. به " +"همین دلیل است که می‌گوییم برای فهرست‌ها، ``+=`` «میان‌بر» " +"برای :meth:`list.extend` است::" msgid "" ">>> a_list = []\n" @@ -1319,20 +2646,34 @@ msgid "" ">>> a_list\n" "[1]" msgstr "" +">>> a_list = []\n" +">>> a_list += [1]\n" +">>> a_list\n" +"[1]" msgid "This is equivalent to::" -msgstr "" +msgstr "این معادل است با::" msgid "" ">>> result = a_list.__iadd__([1])\n" ">>> a_list = result" msgstr "" +">>> result = a_list.__iadd__([1])\n" +">>> a_list = result" -msgid "The object pointed to by a_list has been mutated, and the pointer to the mutated object is assigned back to ``a_list``. The end result of the assignment is a no-op, since it is a pointer to the same object that ``a_list`` was previously pointing to, but the assignment still happens." +msgid "" +"The object pointed to by a_list has been mutated, and the pointer to the " +"mutated object is assigned back to ``a_list``. The end result of the " +"assignment is a no-op, since it is a pointer to the same object that " +"``a_list`` was previously pointing to, but the assignment still happens." msgstr "" +"شیئی که a_list به آن اشاره دارد تغییریافته است و اشاره‌گر به شیء تغییریافته " +"دوباره به ``a_list`` منتسب می‌شود. نتیجه نهایی این انتساب، یک عملیات بی‌اثر " +"(no-op) است، زیرا این یک اشاره‌گر به همان شیئی است که ``a_list`` پیش‌تر به آن " +"اشاره می‌کرد، اما انتساب همچنان انجام می‌شود." msgid "Thus, in our tuple example what is happening is equivalent to::" -msgstr "" +msgstr "بنابراین، در مثال تاپل ما، آنچه رخ می‌دهد معادل است با::" msgid "" ">>> result = a_tuple[0].__iadd__(['item'])\n" @@ -1341,68 +2682,161 @@ msgid "" " ...\n" "TypeError: 'tuple' object does not support item assignment" msgstr "" +">>> result = a_tuple[0].__iadd__(['item'])\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" -msgid "The :meth:`!__iadd__` succeeds, and thus the list is extended, but even though ``result`` points to the same object that ``a_tuple[0]`` already points to, that final assignment still results in an error, because tuples are immutable." +msgid "" +"The :meth:`!__iadd__` succeeds, and thus the list is extended, but even " +"though ``result`` points to the same object that ``a_tuple[0]`` already " +"points to, that final assignment still results in an error, because tuples " +"are immutable." msgstr "" +":meth:`!__iadd__` با موفقیت اجرا می‌شود، و بنابراین فهرست گسترش می‌یابد، اما " +"با وجود اینکه ``result`` به همان شیئی اشاره می‌کند که ``a_tuple[0]`` از قبل " +"به آن اشاره می‌کند، آن انتساب نهایی همچنان منجر به خطا می‌شود، زیرا تاپل‌ها " +"تغییرناپذیر هستند." -msgid "I want to do a complicated sort: can you do a Schwartzian Transform in Python?" +msgid "" +"I want to do a complicated sort: can you do a Schwartzian Transform in " +"Python?" msgstr "" +"می‌خواهم یک مرتب‌سازی پیچیده انجام دهم: آیا می‌توانید تبدیل شوارتزی " +"(Schwartzian Transform) را در پایتون انجام دهید؟" -msgid "The technique, attributed to Randal Schwartz of the Perl community, sorts the elements of a list by a metric which maps each element to its \"sort value\". In Python, use the ``key`` argument for the :meth:`list.sort` method::" +msgid "" +"The technique, attributed to Randal Schwartz of the Perl community, sorts " +"the elements of a list by a metric which maps each element to its \"sort " +"value\". In Python, use the ``key`` argument for the :meth:`list.sort` " +"method::" msgstr "" +"این تکنیک، منسوب به رندال شوارتز از کامیونیتی Perl، عناصر یک فهرست را بر " +"اساس معیاری مرتب می‌کند که هر عنصر را به «مقدار مرتب‌سازی» آن نگاشت می‌کند. در " +"پایتون، از آرگومان ``key`` برای متد :meth:`list.sort` استفاده کنید::" msgid "" "Isorted = L[:]\n" "Isorted.sort(key=lambda s: int(s[10:15]))" msgstr "" +"Isorted = L[:]\n" +"Isorted.sort(key=lambda s: int(s[10:15]))" msgid "How can I sort one list by values from another list?" -msgstr "" +msgstr "چگونه می‌توانم یک فهرست را بر اساس مقادیر فهرست دیگر مرتب‌سازی کنم؟" -msgid "Merge them into an iterator of tuples, sort the resulting list, and then pick out the element you want." +msgid "" +"Merge them into an iterator of tuples, sort the resulting list, and then " +"pick out the element you want." msgstr "" +"آن‌ها را در یک پیمایش‌گر از تاپل‌ها ادغام کنید، فهرست حاصل را مرتب کنید و سپس " +"عنصری را که می‌خواهید انتخاب کنید." msgid "Objects" -msgstr "" +msgstr "اشیاء" msgid "What is a class?" -msgstr "" +msgstr "کلاس چیست؟" -msgid "A class is the particular object type created by executing a class statement. Class objects are used as templates to create instance objects, which embody both the data (attributes) and code (methods) specific to a datatype." +msgid "" +"A class is the particular object type created by executing a class " +"statement. Class objects are used as templates to create instance objects, " +"which embody both the data (attributes) and code (methods) specific to a " +"datatype." msgstr "" +"کلاس، نوع شیء خاصی است که با اجرای یک دستور کلاس ایجاد می‌شود. اشیای کلاس " +"به‌عنوان قالب‌هایی برای ایجاد اشیای نمونه استفاده می‌شوند که هم داده‌ها " +"(ویژگی‌ها) و هم کد (متدها) خاص یک نوع داده را در بر می‌گیرند." -msgid "A class can be based on one or more other classes, called its base class(es). It then inherits the attributes and methods of its base classes. This allows an object model to be successively refined by inheritance. You might have a generic ``Mailbox`` class that provides basic accessor methods for a mailbox, and subclasses such as ``MboxMailbox``, ``MaildirMailbox``, ``OutlookMailbox`` that handle various specific mailbox formats." -msgstr "" +msgid "" +"A class can be based on one or more other classes, called its base " +"class(es). It then inherits the attributes and methods of its base classes. " +"This allows an object model to be successively refined by inheritance. You " +"might have a generic ``Mailbox`` class that provides basic accessor methods " +"for a mailbox, and subclasses such as ``MboxMailbox``, ``MaildirMailbox``, " +"``OutlookMailbox`` that handle various specific mailbox formats." +msgstr "" +"یک کلاس می‌تواند بر پایه‌ی یک یا چند کلاس دیگر باشد که به آن‌ها کلاس‌های پایه‌ی آن " +"گفته می‌شود. سپس ویژگی‌ها و متدهای کلاس‌های پایه‌ی خود را به ارث می‌برد. این " +"امکان را فراهم می‌کند که یک مدل شیء به‌تدریج از طریق وراثت پالایش شود. ممکن " +"است شما یک کلاس ``Mailbox`` عام داشته باشید که متدهای دسترسی پایه برای یک " +"صندوق پستی را ارائه می‌کند، و زیرکلاس‌هایی مانند ``MboxMailbox``، " +"``MaildirMailbox`` و ``OutlookMailbox`` که قالب‌های مشخص مختلفی از صندوق " +"پستی را مدیریت می‌کنند." msgid "What is a method?" -msgstr "" +msgstr "متد چیست؟" -msgid "A method is a function on some object ``x`` that you normally call as ``x.name(arguments...)``. Methods are defined as functions inside the class definition::" +msgid "" +"A method is a function on some object ``x`` that you normally call as " +"``x.name(arguments...)``. Methods are defined as functions inside the " +"class definition::" msgstr "" +"متد، تابعی بر روی یک شیء ``x`` است که معمولاً آن را به‌صورت " +"``x.name(arguments...)`` فراخوانی می‌کنید. متدها به‌عنوان توابعی درون تعریف " +"کلاس تعریف می‌شوند::" msgid "" "class C:\n" " def meth(self, arg):\n" " return arg * 2 + self.attribute" msgstr "" +"class C:\n" +" def meth(self, arg):\n" +" return arg * 2 + self.attribute" msgid "What is self?" -msgstr "" +msgstr "self چیست؟" -msgid "Self is merely a conventional name for the first argument of a method. A method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, c)`` for some instance ``x`` of the class in which the definition occurs; the called method will think it is called as ``meth(x, a, b, c)``." +msgid "" +"Self is merely a conventional name for the first argument of a method. A " +"method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, " +"b, c)`` for some instance ``x`` of the class in which the definition " +"occurs; the called method will think it is called as ``meth(x, a, b, c)``." msgstr "" +"Self صرفاً نامی مرسوم برای اولین آرگومان یک متد است. متدی که به‌صورت " +"``meth(self, a, b, c)`` تعریف شده است، باید برای یک نمونه ``x`` از کلاسی که " +"تعریف در آن رخ می‌دهد، به‌صورت ``x.meth(a, b, c)`` فراخوانی شود؛ متد " +"فراخوانی‌شده فرض خواهد کرد که به‌صورت ``meth(x, a, b, c)`` فراخوانی شده است." msgid "See also :ref:`why-self`." -msgstr "" +msgstr "همچنین :ref:`why-self` را ببینید." -msgid "How do I check if an object is an instance of a given class or of a subclass of it?" +msgid "" +"How do I check if an object is an instance of a given class or of a " +"subclass of it?" msgstr "" +"چگونه می‌توانم بررسی کنم که آیا یک شیء نمونه‌ای از یک کلاس مشخص یا زیرکلاسی " +"از آن است؟" -msgid "Use the built-in function :func:`isinstance(obj, cls) `. You can check if an object is an instance of any of a number of classes by providing a tuple instead of a single class, for example, ``isinstance(obj, (class1, class2, ...))``, and can also check whether an object is one of Python's built-in types, for example, ``isinstance(obj, str)`` or ``isinstance(obj, (int, float, complex))``." -msgstr "" +msgid "" +"Use the built-in function :func:`isinstance(obj, cls) `. You " +"can check if an object is an instance of any of a number of classes by " +"providing a tuple instead of a single class, for example, ``isinstance(obj, " +"(class1, class2, ...))``, and can also check whether an object is one of " +"Python's built-in types, for example, ``isinstance(obj, str)`` or " +"``isinstance(obj, (int, float, complex))``." +msgstr "" +"از تابع توکار :func:`isinstance(obj, cls) ` استفاده کنید. شما " +"می‌توانید با ارائه یک تاپلبه‌جای یک کلاس واحد، بررسی کنید که آیا یک " +"شیء نمونه‌ای از هر یک از چند کلاس است یا خیر، برای مثال، ``isinstance(obj, " +"(class1, class2, ...))``، و همچنین می‌توانید بررسی کنید که آیا یک شیء یکی از " +"انواع توکار پایتون است یا خیر، برای مثال، ``isinstance(obj, str)`` یا " +"``isinstance(obj, (int, float, complex))``." -msgid "Note that :func:`isinstance` also checks for virtual inheritance from an :term:`abstract base class`. So, the test will return ``True`` for a registered class even if hasn't directly or indirectly inherited from it. To test for \"true inheritance\", scan the :term:`method resolution order` (MRO) of the class:" -msgstr "" +msgid "" +"Note that :func:`isinstance` also checks for virtual inheritance from " +"an :term:`abstract base class`. So, the test will return ``True`` for a " +"registered class even if hasn't directly or indirectly inherited from it. " +"To test for \"true inheritance\", scan the :term:`method resolution order` " +"(MRO) of the class:" +msgstr "" +"توجه داشته باشید که :func:`isinstance` همچنین وراثت مجازی از " +"یک :term:`abstract base class` را بررسی می‌کند. بنابراین، این آزمون برای یک " +"کلاس ثبت‌شده ``True`` را برمی‌گرداند، حتی اگر به‌طور مستقیم یا غیرمستقیم از آن " +"ارث نبرده باشد. برای آزمون «وراثت واقعی»، :term:`method resolution order` " +"(MRO) کلاس را پیمایش کنید:" msgid "" "from collections.abc import Mapping\n" @@ -1415,6 +2849,15 @@ msgid "" "\n" "Mapping.register(P)" msgstr "" +"from collections.abc import Mapping\n" +"\n" +"class P:\n" +" pass\n" +"\n" +"class C(P):\n" +" pass\n" +"\n" +"Mapping.register(P)" msgid "" ">>> c = C()\n" @@ -1433,9 +2876,36 @@ msgid "" ">>> Mapping in type(c).__mro__\n" "False" msgstr "" +">>> c = C()\n" +">>> isinstance(c, C) # direct\n" +"True\n" +">>> isinstance(c, P) # indirect\n" +"True\n" +">>> isinstance(c, Mapping) # virtual\n" +"True\n" +"\n" +"# Actual inheritance chain\n" +">>> type(c).__mro__\n" +"(, , )\n" +"\n" +"# Test for \"true inheritance\"\n" +">>> Mapping in type(c).__mro__\n" +"False" -msgid "Note that most programs do not use :func:`isinstance` on user-defined classes very often. If you are developing the classes yourself, a more proper object-oriented style is to define methods on the classes that encapsulate a particular behaviour, instead of checking the object's class and doing a different thing based on what class it is. For example, if you have a function that does something::" -msgstr "" +msgid "" +"Note that most programs do not use :func:`isinstance` on user-defined " +"classes very often. If you are developing the classes yourself, a more " +"proper object-oriented style is to define methods on the classes that " +"encapsulate a particular behaviour, instead of checking the object's class " +"and doing a different thing based on what class it is. For example, if you " +"have a function that does something::" +msgstr "" +"توجه داشته باشید که بیشتر برنامه‌ها استفاده‌ی زیادی از :func:`isinstance` روی " +"کلاس‌های تعریف‌شده توسط کاربر نمی‌کنند. اگر خودتان کلاس‌ها را توسعه می‌دهید، سبک " +"شیءگرای مناسب‌تر این است که متدهایی در کلاس‌ها تعریف کنید که رفتار خاصی را " +"کپسوله می‌کنند، به‌جای این‌که کلاس شیء را بررسی کنید و بر اساس این‌که شیء از چه " +"کلاسی است، کار متفاوتی انجام دهید. برای مثال، اگر تابعی دارید که کاری انجام " +"می‌دهد::" msgid "" "def search(obj):\n" @@ -1445,9 +2915,19 @@ msgid "" " ... # code to search a document\n" " elif ..." msgstr "" +"def search(obj):\n" +" if isinstance(obj, Mailbox):\n" +" ... # code to search a mailbox\n" +" elif isinstance(obj, Document):\n" +" ... # code to search a document\n" +" elif ..." -msgid "A better approach is to define a ``search()`` method on all the classes and just call it::" +msgid "" +"A better approach is to define a ``search()`` method on all the classes and " +"just call it::" msgstr "" +"رویکرد بهتر این است که یک متد ``search()`` در همه کلاس‌ها تعریف کنید و فقط " +"آن را فراخوانی کنید::" msgid "" "class Mailbox:\n" @@ -1460,15 +2940,40 @@ msgid "" "\n" "obj.search()" msgstr "" +"class Mailbox:\n" +" def search(self):\n" +" ... # code to search a mailbox\n" +"\n" +"class Document:\n" +" def search(self):\n" +" ... # code to search a document\n" +"\n" +"obj.search()" msgid "What is delegation?" -msgstr "" +msgstr "واگذاری (delegation) چیست؟" -msgid "Delegation is an object-oriented technique (also called a design pattern). Let's say you have an object ``x`` and want to change the behaviour of just one of its methods. You can create a new class that provides a new implementation of the method you're interested in changing and delegates all other methods to the corresponding method of ``x``." -msgstr "" +msgid "" +"Delegation is an object-oriented technique (also called a design pattern). " +"Let's say you have an object ``x`` and want to change the behaviour of just " +"one of its methods. You can create a new class that provides a new " +"implementation of the method you're interested in changing and delegates " +"all other methods to the corresponding method of ``x``." +msgstr "" +"واگذاری (delegation) یک تکنیک شیءگرا است (که به آن الگوی طراحی نیز گفته " +"می‌شود). فرض کنید شما یک شیء ``x`` دارید و می‌خواهید رفتار فقط یکی از متدهای " +"آن را تغییر دهید. می‌توانید یک کلاس جدید بسازید که پیاده‌سازی جدیدی از متدی " +"که قصد تغییر آن را دارید ارائه می‌دهد و تمام متدهای دیگر را به متد متناظر از " +"``x`` واگذار می‌کند." -msgid "Python programmers can easily implement delegation. For example, the following class implements a class that behaves like a file but converts all written data to uppercase::" +msgid "" +"Python programmers can easily implement delegation. For example, the " +"following class implements a class that behaves like a file but converts " +"all written data to uppercase::" msgstr "" +"برنامه‌نویسان پایتون می‌توانند به‌راحتی واگذاری (delegation) را پیاده‌سازی " +"کنند. برای مثال، کلاس زیر کلاسی را پیاده‌سازی می‌کند که مانند یک فایل رفتار " +"می‌کند، اما تمام داده‌های نوشته‌شده را به حروف بزرگ تبدیل می‌کند::" msgid "" "class UpperOut:\n" @@ -1482,12 +2987,44 @@ msgid "" " def __getattr__(self, name):\n" " return getattr(self._outfile, name)" msgstr "" +"class UpperOut:\n" +"\n" +" def __init__(self, outfile):\n" +" self._outfile = outfile\n" +"\n" +" def write(self, s):\n" +" self._outfile.write(s.upper())\n" +"\n" +" def __getattr__(self, name):\n" +" return getattr(self._outfile, name)" -msgid "Here the ``UpperOut`` class redefines the ``write()`` method to convert the argument string to uppercase before calling the underlying ``self._outfile.write()`` method. All other methods are delegated to the underlying ``self._outfile`` object. The delegation is accomplished via the :meth:`~object.__getattr__` method; consult :ref:`the language reference ` for more information about controlling attribute access." -msgstr "" +msgid "" +"Here the ``UpperOut`` class redefines the ``write()`` method to convert the " +"argument string to uppercase before calling the underlying " +"``self._outfile.write()`` method. All other methods are delegated to the " +"underlying ``self._outfile`` object. The delegation is accomplished via " +"the :meth:`~object.__getattr__` method; consult :ref:`the language " +"reference ` for more information about controlling " +"attribute access." +msgstr "" +"در اینجا کلاس ``UpperOut`` متد ``write()`` را بازتعریف می‌کند تا رشته‌ی " +"آرگومان را پیش از فراخوانی متد زیرین ``self._outfile.write()`` به حروف بزرگ " +"تبدیل کند. تمام متدهای دیگر به شیء زیرین ``self._outfile`` واگذار می‌شوند. " +"این واگذاری از طریق متد :meth:`~object.__getattr__` انجام می‌شود؛ برای " +"اطلاعات بیشتر درباره‌ی کنترل دسترسی به ویژگی، به :ref:`مرجع زبان ` مراجعه کنید." -msgid "Note that for more general cases delegation can get trickier. When attributes must be set as well as retrieved, the class must define a :meth:`~object.__setattr__` method too, and it must do so carefully. The basic implementation of :meth:`!__setattr__` is roughly equivalent to the following::" +msgid "" +"Note that for more general cases delegation can get trickier. When " +"attributes must be set as well as retrieved, the class must define " +"a :meth:`~object.__setattr__` method too, and it must do so carefully. The " +"basic implementation of :meth:`!__setattr__` is roughly equivalent to the " +"following::" msgstr "" +"توجه داشته باشید که در موارد کلی‌تر، واگذاری می‌تواند پیچیده‌تر شود. هنگامی که " +"ویژگی‌ها باید علاوه بر بازیابی، مقداردهی شوند، کلاس باید یک " +"متد :meth:`~object.__setattr__` نیز تعریف کند، و باید این کار را با دقت " +"انجام دهد. پیاده‌سازی پایه‌ی :meth:`!__setattr__` تقریباً معادل عبارت زیر است::" msgid "" "class X:\n" @@ -1496,9 +3033,20 @@ msgid "" " self.__dict__[name] = value\n" " ..." msgstr "" +"class X:\n" +" ...\n" +" def __setattr__(self, name, value):\n" +" self.__dict__[name] = value\n" +" ..." -msgid "Many :meth:`~object.__setattr__` implementations call :meth:`!object.__setattr__` to set an attribute on self without causing infinite recursion::" +msgid "" +"Many :meth:`~object.__setattr__` implementations call :meth:`!" +"object.__setattr__` to set an attribute on self without causing infinite " +"recursion::" msgstr "" +"بسیاری از پیاده‌سازی‌های :meth:`~object.__setattr__`، برای تنظیم یک ویژگی روی " +"self بدون ایجاد بازگشت بی‌پایان، :meth:`!object.__setattr__` را فراخوانی " +"می‌کنند::" msgid "" "class X:\n" @@ -1506,30 +3054,63 @@ msgid "" " # Custom logic here...\n" " object.__setattr__(self, name, value)" msgstr "" +"class X:\n" +" def __setattr__(self, name, value):\n" +" # Custom logic here...\n" +" object.__setattr__(self, name, value)" -msgid "Alternatively, it is possible to set attributes by inserting entries into :attr:`self.__dict__ ` directly." +msgid "" +"Alternatively, it is possible to set attributes by inserting entries " +"into :attr:`self.__dict__ ` directly." msgstr "" +"به‌عنوان جایگزین، می‌توان ویژگی‌ها را با درج مستقیم ورودی‌ها " +"در :attr:`self.__dict__ ` تنظیم کرد." -msgid "How do I call a method defined in a base class from a derived class that extends it?" +msgid "" +"How do I call a method defined in a base class from a derived class that " +"extends it?" msgstr "" +"چگونه یک متد تعریف‌شده در کلاس پایه را از یک کلاس مشتق که آن را گسترش می‌دهد " +"فراخوانی کنم؟" msgid "Use the built-in :func:`super` function::" -msgstr "" +msgstr "از تابع توکار :func:`super` استفاده کنید::" msgid "" "class Derived(Base):\n" " def meth(self):\n" " super().meth() # calls Base.meth" msgstr "" +"class Derived(Base):\n" +" def meth(self):\n" +" super().meth() # calls Base.meth" -msgid "In the example, :func:`super` will automatically determine the instance from which it was called (the ``self`` value), look up the :term:`method resolution order` (MRO) with ``type(self).__mro__``, and return the next in line after ``Derived`` in the MRO: ``Base``." +msgid "" +"In the example, :func:`super` will automatically determine the instance " +"from which it was called (the ``self`` value), look up the :term:`method " +"resolution order` (MRO) with ``type(self).__mro__``, and return the next in " +"line after ``Derived`` in the MRO: ``Base``." msgstr "" +"در این مثال، :func:`super` به‌طور خودکار نمونه‌ای را که از آن فراخوانی شده " +"است (مقدار ``self``) تعیین می‌کند، :term:`method resolution order` (MRO) را " +"با ``type(self).__mro__`` جستجو می‌کند، و مورد بعدی در ترتیب پس از " +"``Derived`` در MRO را برمی‌گرداند: ``Base``." msgid "How can I organize my code to make it easier to change the base class?" -msgstr "" +msgstr "چگونه می‌توانم کد خود را سازمان‌دهی کنم تا تغییر کلاس پایه آسان‌تر شود؟" -msgid "You could assign the base class to an alias and derive from the alias. Then all you have to change is the value assigned to the alias. Incidentally, this trick is also handy if you want to decide dynamically (such as depending on availability of resources) which base class to use. Example::" -msgstr "" +msgid "" +"You could assign the base class to an alias and derive from the alias. " +"Then all you have to change is the value assigned to the alias. " +"Incidentally, this trick is also handy if you want to decide dynamically " +"(such as depending on availability of resources) which base class to use. " +"Example::" +msgstr "" +"می‌توانید کلاس پایه را به یک نام مستعار اختصاص دهید و از آن نام مستعار مشتق " +"شوید. سپس تنها چیزی که باید تغییر دهید، مقدار اختصاص‌داده‌شده به نام مستعار " +"است. ضمناً، این ترفند زمانی هم که بخواهید به‌صورت پویا تصمیم بگیرید (مثلاً " +"بسته به دسترس‌پذیری منابع) از کدام کلاس پایه استفاده کنید، مفید است. " +"مثال::" msgid "" "class Base:\n" @@ -1540,15 +3121,30 @@ msgid "" "class Derived(BaseAlias):\n" " ..." msgstr "" +"class Base:\n" +" ...\n" +"\n" +"BaseAlias = Base\n" +"\n" +"class Derived(BaseAlias):\n" +" ..." msgid "How do I create static class data and static class methods?" -msgstr "" +msgstr "چگونه داده‌های ایستای کلاس و متدهای ایستای کلاس را ایجاد کنم؟" -msgid "Both static data and static methods (in the sense of C++ or Java) are supported in Python." +msgid "" +"Both static data and static methods (in the sense of C++ or Java) are " +"supported in Python." msgstr "" +"در پایتون، هم از داده‌های ایستا و هم از متدهای ایستا (به معنای C++ یا Java) " +"پشتیبانی می‌شود." -msgid "For static data, simply define a class attribute. To assign a new value to the attribute, you have to explicitly use the class name in the assignment::" +msgid "" +"For static data, simply define a class attribute. To assign a new value to " +"the attribute, you have to explicitly use the class name in the assignment::" msgstr "" +"برای داده‌های ایستا، کافی است یک ویژگی کلاس تعریف کنید. برای انتساب مقدار " +"جدید به ویژگی، باید در انتساب به‌صراحت از نام کلاس استفاده کنید::" msgid "" "class C:\n" @@ -1560,18 +3156,40 @@ msgid "" " def getcount(self):\n" " return C.count # or return self.count" msgstr "" +"class C:\n" +" count = 0 # number of times C.__init__ called\n" +"\n" +" def __init__(self):\n" +" C.count = C.count + 1\n" +"\n" +" def getcount(self):\n" +" return C.count # or return self.count" -msgid "``c.count`` also refers to ``C.count`` for any ``c`` such that ``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some class on the base-class search path from ``c.__class__`` back to ``C``." +msgid "" +"``c.count`` also refers to ``C.count`` for any ``c`` such that " +"``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " +"class on the base-class search path from ``c.__class__`` back to ``C``." msgstr "" +"``c.count`` همچنین برای هر ``c`` که ``isinstance(c, C)`` برقرار باشد، به " +"``C.count`` ارجاع می‌دهد، مگر اینکه خود ``c`` یا کلاسی در مسیر جستجوی کلاس " +"پایه از ``c.__class__`` تا ``C`` آن را بازنویسی کرده باشد." -msgid "Caution: within a method of C, an assignment like ``self.count = 42`` creates a new and unrelated instance named \"count\" in ``self``'s own dict. Rebinding of a class-static data name must always specify the class whether inside a method or not::" +msgid "" +"Caution: within a method of C, an assignment like ``self.count = 42`` " +"creates a new and unrelated instance named \"count\" in ``self``'s own " +"dict. Rebinding of a class-static data name must always specify the class " +"whether inside a method or not::" msgstr "" +"هشدار: در داخل یک متد از C، انتسابی مانند ``self.count = 42`` یک نمونه جدید " +"و نامرتبط به نام \"count\" در دیکشنری خود ``self`` ایجاد می‌کند. برای انتساب " +"مجدد یک نام داده‌ی ایستای کلاس، همیشه باید کلاس مشخص شود، چه داخل یک متد و چه " +"خارج از آن::" msgid "C.count = 314" -msgstr "" +msgstr "C.count = 314" msgid "Static methods are possible::" -msgstr "" +msgstr "متدهای ایستا امکان‌پذیر هستند::" msgid "" "class C:\n" @@ -1580,26 +3198,48 @@ msgid "" " # No 'self' parameter!\n" " ..." msgstr "" +"class C:\n" +" @staticmethod\n" +" def static(arg1, arg2, arg3):\n" +" # No 'self' parameter!\n" +" ..." -msgid "However, a far more straightforward way to get the effect of a static method is via a simple module-level function::" +msgid "" +"However, a far more straightforward way to get the effect of a static " +"method is via a simple module-level function::" msgstr "" +"با این حال، راه بسیار ساده‌تر برای به‌دست آوردن اثر یک متد ایستا، از طریق یک " +"تابع ساده در سطح ماژول است::" msgid "" "def getcount():\n" " return C.count" -msgstr "" +msgstr "" +"def getcount():\n" +" return C.count" -msgid "If your code is structured so as to define one class (or tightly related class hierarchy) per module, this supplies the desired encapsulation." +msgid "" +"If your code is structured so as to define one class (or tightly related " +"class hierarchy) per module, this supplies the desired encapsulation." msgstr "" +"اگر کد شما به‌گونه‌ای ساختار یافته باشد که در هر ماژول یک کلاس (یا " +"سلسله‌مراتبی از کلاس‌های کاملاً مرتبط) تعریف شود، این امر کپسوله‌سازی " +"(encapsulation) مطلوب را فراهم می‌کند." msgid "How can I overload constructors (or methods) in Python?" msgstr "" +"چگونه می‌توانم سازنده‌ها (یا متدها) را در پایتون سربارگذاری " +"(overload) کنم؟" -msgid "This answer actually applies to all methods, but the question usually comes up first in the context of constructors." +msgid "" +"This answer actually applies to all methods, but the question usually comes " +"up first in the context of constructors." msgstr "" +"این پاسخ در واقع در مورد همه متدها صدق می‌کند، اما این پرسش معمولاً ابتدا در " +"زمینه‌ی سازنده‌ها مطرح می‌شود." msgid "In C++ you'd write:" -msgstr "" +msgstr "در C++ شما می‌نویسید:" msgid "" "class C {\n" @@ -1607,9 +3247,17 @@ msgid "" " C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" "}" msgstr "" +"class C {\n" +" C() { cout << \"No arguments\\n\"; }\n" +" C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" +"}" -msgid "In Python you have to write a single constructor that catches all cases using default arguments. For example::" +msgid "" +"In Python you have to write a single constructor that catches all cases " +"using default arguments. For example::" msgstr "" +"در پایتون باید یک سازنده واحد بنویسید که با استفاده از آرگومان‌های پیش‌فرض، " +"همه حالت‌ها را پوشش می‌دهد. برای مثال::" msgid "" "class C:\n" @@ -1619,29 +3267,55 @@ msgid "" " else:\n" " print(\"Argument is\", i)" msgstr "" +"class C:\n" +" def __init__(self, i=None):\n" +" if i is None:\n" +" print(\"No arguments\")\n" +" else:\n" +" print(\"Argument is\", i)" msgid "This is not entirely equivalent, but close enough in practice." -msgstr "" +msgstr "این به‌طور کامل معادل نیست، اما در عمل به اندازه کافی نزدیک است." msgid "You could also try a variable-length argument list, for example::" msgstr "" +"همچنین می‌توانید یک فهرست آرگومان با طول متغیر را امتحان کنید، برای مثال::" msgid "" "def __init__(self, *args):\n" " ..." msgstr "" +"def __init__(self, *args):\n" +" ..." msgid "The same approach works for all method definitions." -msgstr "" +msgstr "همین رویکرد برای تمام تعریف‌های متد کار می‌کند." msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "" +"من سعی می‌کنم از __spam استفاده کنم و با خطایی درباره _SomeClassName__spam " +"مواجه می‌شوم." -msgid "Variable names with double leading underscores are \"mangled\" to provide a simple but effective way to define class private variables. Any identifier of the form ``__spam`` (at least two leading underscores, at most one trailing underscore) is textually replaced with ``_classname__spam``, where ``classname`` is the current class name with any leading underscores stripped." -msgstr "" +msgid "" +"Variable names with double leading underscores are \"mangled\" to provide a " +"simple but effective way to define class private variables. Any identifier " +"of the form ``__spam`` (at least two leading underscores, at most one " +"trailing underscore) is textually replaced with ``_classname__spam``, where " +"``classname`` is the current class name with any leading underscores " +"stripped." +msgstr "" +"نام متغیرهایی که دو زیرخط آغازین دارند، تغییر نام داده می‌شوند (mangled) تا " +"راهی ساده اما مؤثر برای تعریف متغیرهای خصوصی کلاس فراهم شود. هر شناسه‌ای " +"به‌شکل ``__spam`` (حداقل دو زیرخط آغازین و حداکثر یک زیرخط پایانی) به‌صورت " +"متنی با ``_classname__spam`` جایگزین می‌شود، که در آن ``classname`` نام کلاس " +"جاری است که هرگونه زیرخط آغازین آن حذف شده است." -msgid "The identifier can be used unchanged within the class, but to access it outside the class, the mangled name must be used:" +msgid "" +"The identifier can be used unchanged within the class, but to access it " +"outside the class, the mangled name must be used:" msgstr "" +"می‌توان از شناسه بدون تغییر درون کلاس استفاده کرد، اما برای دسترسی به آن " +"بیرون از کلاس، باید از نام تغییرشکل‌یافته (mangled name) استفاده کرد:" msgid "" "class A:\n" @@ -1656,72 +3330,210 @@ msgid "" "\n" "four = 4 * A()._A__one()" msgstr "" +"class A:\n" +" def __one(self):\n" +" return 1\n" +" def two(self):\n" +" return 2 * self.__one()\n" +"\n" +"class B(A):\n" +" def three(self):\n" +" return 3 * self._A__one()\n" +"\n" +"four = 4 * A()._A__one()" -msgid "In particular, this does not guarantee privacy since an outside user can still deliberately access the private attribute; many Python programmers never bother to use private variable names at all." +msgid "" +"In particular, this does not guarantee privacy since an outside user can " +"still deliberately access the private attribute; many Python programmers " +"never bother to use private variable names at all." msgstr "" +"به‌ویژه، این کار خصوصی بودن را تضمین نمی‌کند، زیرا یک کاربر بیرونی همچنان " +"می‌تواند عمداً به ویژگی خصوصی دسترسی پیدا کند؛ بسیاری از برنامه‌نویسان پایتون " +"اصلاً زحمت استفاده از نام‌های متغیر خصوصی را به خود نمی‌دهند." -msgid "The :ref:`private name mangling specifications ` for details and special cases." +msgid "" +"The :ref:`private name mangling specifications ` for " +"details and special cases." msgstr "" +"برای جزئیات و موارد خاص، :ref:`مشخصات تغییر نام خصوصی (private name " +"mangling) `." -msgid "My class defines __del__ but it is not called when I delete the object." +msgid "" +"My class defines __del__ but it is not called when I delete the object." msgstr "" +"کلاس من __del__ را تعریف می‌کند، اما هنگامی که شیء را حذف می‌کنم فراخوانی " +"نمی‌شود." msgid "There are several possible reasons for this." -msgstr "" +msgstr "دلایل متعددی ممکن است برای این موضوع وجود داشته باشد." -msgid "The :keyword:`del` statement does not necessarily call :meth:`~object.__del__` -- it simply decrements the object's reference count, and if this reaches zero :meth:`!__del__` is called." +msgid "" +"The :keyword:`del` statement does not necessarily " +"call :meth:`~object.__del__` -- it simply decrements the object's reference " +"count, and if this reaches zero :meth:`!__del__` is called." msgstr "" +"دستور :keyword:`del` لزوماً :meth:`~object.__del__` را فراخوانی نمی‌کند -- " +"صرفاً شمار ارجاع‌های شیء را کاهش می‌دهد، و اگر این شمار به صفر برسد، :meth:`!" +"__del__` فراخوانی می‌شود." -msgid "If your data structures contain circular links (for example, a tree where each child has a parent reference and each parent has a list of children) the reference counts will never go back to zero. Once in a while Python runs an algorithm to detect such cycles, but the garbage collector might run some time after the last reference to your data structure vanishes, so your :meth:`!__del__` method may be called at an inconvenient and random time. This is inconvenient if you're trying to reproduce a problem. Worse, the order in which object's :meth:`!__del__` methods are executed is arbitrary. You can run :func:`gc.collect` to force a collection, but there *are* pathological cases where objects will never be collected." -msgstr "" +msgid "" +"If your data structures contain circular links (for example, a tree where " +"each child has a parent reference and each parent has a list of children) " +"the reference counts will never go back to zero. Once in a while Python " +"runs an algorithm to detect such cycles, but the garbage collector might " +"run some time after the last reference to your data structure vanishes, so " +"your :meth:`!__del__` method may be called at an inconvenient and random " +"time. This is inconvenient if you're trying to reproduce a problem. Worse, " +"the order in which object's :meth:`!__del__` methods are executed is " +"arbitrary. You can run :func:`gc.collect` to force a collection, but there " +"*are* pathological cases where objects will never be collected." +msgstr "" +"اگر ساختارهای داده‌ی شما حاوی پیوندهای حلقه‌ای باشند (برای مثال، درختی که در " +"آن هر فرزند یک ارجاع به والد دارد و هر والد فهرستی از فرزندان دارد)، شمار " +"ارجاع‌ها هرگز به صفر بازنمی‌گردد. هر از گاهی پایتون الگوریتمی را برای تشخیص " +"چنین چرخه‌هایی اجرا می‌کند، اما ممکن است زباله‌روب مدتی پس از از بین رفتن " +"آخرین ارجاع به ساختار داده‌ی شما اجرا شود، بنابراین ممکن است متد :meth:`!" +"__del__` شما در زمانی نامناسب و تصادفی فراخوانی شود. اگر در تلاش برای " +"بازتولید یک مشکل باشید، این موضوع نامناسب است. بدتر آنکه ترتیبی که " +"متدهای :meth:`!__del__` اشیاء اجرا می‌شوند، دلخواه است. برای اجبار به " +"زباله‌روبی، می‌توانید :func:`gc.collect` را اجرا کنید، اما موارد مرضی *وجود " +"دارند* که اشیاء هرگز جمع‌آوری نمی‌شوند." -msgid "Despite the cycle collector, it's still a good idea to define an explicit ``close()`` method on objects to be called whenever you're done with them. The ``close()`` method can then remove attributes that refer to subobjects. Don't call :meth:`!__del__` directly -- :meth:`!__del__` should call ``close()`` and ``close()`` should make sure that it can be called more than once for the same object." -msgstr "" +msgid "" +"Despite the cycle collector, it's still a good idea to define an explicit " +"``close()`` method on objects to be called whenever you're done with them. " +"The ``close()`` method can then remove attributes that refer to " +"subobjects. Don't call :meth:`!__del__` directly -- :meth:`!__del__` " +"should call ``close()`` and ``close()`` should make sure that it can be " +"called more than once for the same object." +msgstr "" +"با وجود جمع‌کننده چرخه، هنوز هم بهتر است یک متد صریح ``close()`` برای شیء‌ها " +"تعریف کنید تا هرگاه کار شما با آن‌ها تمام شد، فراخوانی شود. سپس متد " +"``close()`` می‌تواند ویژگی‌هایی را که به زیرشیء‌ها ارجاع می‌دهند حذف " +"کند. :meth:`!__del__` را مستقیماً فراخوانی نکنید -- :meth:`!__del__` باید " +"``close()`` را فراخوانی کند و ``close()`` باید اطمینان حاصل کند که می‌توان " +"آن را بیش از یک بار برای یک شیء فراخوانی کرد." -msgid "Another way to avoid cyclical references is to use the :mod:`weakref` module, which allows you to point to objects without incrementing their reference count. Tree data structures, for instance, should use weak references for their parent and sibling references (if they need them!)." +msgid "" +"Another way to avoid cyclical references is to use the :mod:`weakref` " +"module, which allows you to point to objects without incrementing their " +"reference count. Tree data structures, for instance, should use weak " +"references for their parent and sibling references (if they need them!)." msgstr "" +"راه دیگر برای اجتناب از ارجاع‌های چرخه‌ای استفاده از ماژول :mod:`weakref` " +"است، که به شما امکان می‌دهد به اشیاء بدون افزایش شمار ارجاع‌هایشان اشاره " +"کنید. برای مثال، ساختارهای داده‌ای درختی باید برای ارجاع‌های والد و گره‌های " +"هم‌سطح خود (در صورت نیاز!) از ارجاع‌های ضعیف استفاده کنند." -msgid "Finally, if your :meth:`!__del__` method raises an exception, a warning message is printed to :data:`sys.stderr`." +msgid "" +"Finally, if your :meth:`!__del__` method raises an exception, a warning " +"message is printed to :data:`sys.stderr`." msgstr "" +"در نهایت، اگر متد :meth:`!__del__` شما استثنایی را پرتاب کند، یک پیام هشدار " +"در :data:`sys.stderr` چاپ می‌شود." msgid "How do I get a list of all instances of a given class?" -msgstr "" +msgstr "چگونه می‌توانم فهرستی از همه نمونه‌های یک کلاس مشخص را به دست آورم؟" -msgid "Python does not keep track of all instances of a class (or of a built-in type). You can program the class's constructor to keep track of all instances by keeping a list of weak references to each instance." +msgid "" +"Python does not keep track of all instances of a class (or of a built-in " +"type). You can program the class's constructor to keep track of all " +"instances by keeping a list of weak references to each instance." msgstr "" +"پایتون تمام نمونه‌های یک کلاس (یا یک نوع توکار) را پیگیری نمی‌کند. شما " +"می‌توانید سازنده‌ی کلاس را به‌گونه‌ای بنویسید که با نگه‌داری فهرستی از ارجاع‌های " +"ضعیف به هر نمونه، تمام نمونه‌ها را پیگیری کند." msgid "Why does the result of ``id()`` appear to be not unique?" -msgstr "" +msgstr "چرا به نظر می‌رسد نتیجه ``id()`` یکتا نیست؟" -msgid "The :func:`id` builtin returns an integer that is guaranteed to be unique during the lifetime of the object. Since in CPython, this is the object's memory address, it happens frequently that after an object is deleted from memory, the next freshly created object is allocated at the same position in memory. This is illustrated by this example:" +msgid "" +"The :func:`id` builtin returns an integer that is guaranteed to be unique " +"during the lifetime of the object. Since in CPython, this is the object's " +"memory address, it happens frequently that after an object is deleted from " +"memory, the next freshly created object is allocated at the same position " +"in memory. This is illustrated by this example:" msgstr "" +"تابع توکار :func:`id` یک عدد صحیح برمی‌گرداند که یکتا بودن آن در طول عمر شیء " +"تضمین شده است. از آنجا که در CPython، این مقدار نشانی حافظه‌ی شیء است، اغلب " +"اتفاق می‌افتد که پس از حذف یک شیء از حافظه، شیء تازه‌ساخته‌ی بعدی در همان " +"موقعیت حافظه تخصیص داده شود. این موضوع در این مثال نشان داده شده است:" -msgid "The two ids belong to different integer objects that are created before, and deleted immediately after execution of the ``id()`` call. To be sure that objects whose id you want to examine are still alive, create another reference to the object:" +msgid "" +"The two ids belong to different integer objects that are created before, " +"and deleted immediately after execution of the ``id()`` call. To be sure " +"that objects whose id you want to examine are still alive, create another " +"reference to the object:" msgstr "" +"دو شناسه به اشیای عدد صحیح متفاوتی تعلق دارند که پیش از اجرای فراخوانی " +"``id()`` ایجاد شده‌اند و بلافاصله پس از اجرای آن حذف می‌شوند. برای اطمینان از " +"زنده بودن اشیایی که می‌خواهید شناسه‌ی آن‌ها را بررسی کنید، یک ارجاع دیگر به شیء " +"ایجاد کنید:" msgid "When can I rely on identity tests with the *is* operator?" -msgstr "" +msgstr "چه زمانی می‌توانم به آزمون‌های هویت با عملگر *is* اتکا کنم؟" -msgid "The ``is`` operator tests for object identity. The test ``a is b`` is equivalent to ``id(a) == id(b)``." +msgid "" +"The ``is`` operator tests for object identity. The test ``a is b`` is " +"equivalent to ``id(a) == id(b)``." msgstr "" +"عملگر ``is`` هویت شیء را می‌آزماید. آزمون ``a is b`` معادل ``id(a) == " +"id(b)`` است." -msgid "The most important property of an identity test is that an object is always identical to itself, ``a is a`` always returns ``True``. Identity tests are usually faster than equality tests. And unlike equality tests, identity tests are guaranteed to return a boolean ``True`` or ``False``." +msgid "" +"The most important property of an identity test is that an object is always " +"identical to itself, ``a is a`` always returns ``True``. Identity tests " +"are usually faster than equality tests. And unlike equality tests, " +"identity tests are guaranteed to return a boolean ``True`` or ``False``." msgstr "" +"مهم‌ترین ویژگی یک آزمون هویت این است که یک شیء همیشه با خودش یکسان است، ``a " +"is a`` همیشه ``True`` را برمی‌گرداند. آزمون‌های هویت معمولاً سریع‌تر از " +"آزمون‌های برابری هستند. و برخلاف آزمون‌های برابری، تضمین شده است که آزمون‌های " +"هویت یک مقدار بولی ``True`` یا ``False`` برمی‌گردانند." -msgid "However, identity tests can *only* be substituted for equality tests when object identity is assured. Generally, there are three circumstances where identity is guaranteed:" +msgid "" +"However, identity tests can *only* be substituted for equality tests when " +"object identity is assured. Generally, there are three circumstances where " +"identity is guaranteed:" msgstr "" +"با این حال، آزمون‌های هویت *فقط* زمانی می‌توانند جایگزین آزمون‌های برابری شوند " +"که هویت شیء تضمین شده باشد. به‌طور کلی، ۳ حالت وجود دارد که در آن‌ها هویت " +"تضمین می‌شود:" -msgid "Assignments create new names but do not change object identity. After the assignment ``new = old``, it is guaranteed that ``new is old``." +msgid "" +"Assignments create new names but do not change object identity. After the " +"assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" +"انتساب‌ها نام‌های جدیدی ایجاد می‌کنند، اما هویت شیء را تغییر نمی‌دهند. پس از " +"انتساب ``new = old``، تضمین می‌شود که ``new is old``." -msgid "Putting an object in a container that stores object references does not change object identity. After the list assignment ``s[0] = x``, it is guaranteed that ``s[0] is x``." +msgid "" +"Putting an object in a container that stores object references does not " +"change object identity. After the list assignment ``s[0] = x``, it is " +"guaranteed that ``s[0] is x``." msgstr "" +"قرار دادن یک شیء در ظرفی که ارجاع‌های شیء را ذخیره می‌کند، هویت شیء را تغییر " +"نمی‌دهد. پس از انتساب ``s[0] = x`` در فهرست، تضمین می‌شود که ``s[0] is x``." -msgid "If an object is a singleton, it means that only one instance of that object can exist. After the assignments ``a = None`` and ``b = None``, it is guaranteed that ``a is b`` because ``None`` is a singleton." +msgid "" +"If an object is a singleton, it means that only one instance of that object " +"can exist. After the assignments ``a = None`` and ``b = None``, it is " +"guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" +"اگر شیئی تک‌نمونه (singleton) باشد، به این معناست که تنها یک نمونه از آن شیء " +"می‌تواند وجود داشته باشد. پس از انتساب‌های ``a = None`` و ``b = None``، تضمین " +"می‌شود که ``a is b`` زیرا ``None`` یک تک‌نمونه (singleton) است." -msgid "In most other circumstances, identity tests are inadvisable and equality tests are preferred. In particular, identity tests should not be used to check constants such as :class:`int` and :class:`str` which aren't guaranteed to be singletons::" +msgid "" +"In most other circumstances, identity tests are inadvisable and equality " +"tests are preferred. In particular, identity tests should not be used to " +"check constants such as :class:`int` and :class:`str` which aren't " +"guaranteed to be singletons::" msgstr "" +"در بیشتر شرایط دیگر، آزمون‌های هویت توصیه نمی‌شوند و آزمون‌های برابری ترجیح " +"داده می‌شوند. به‌ویژه، نباید از آزمون‌های هویت برای بررسی ثابت‌هایی " +"مانند :class:`int` و :class:`str` استفاده کرد، زیرا تضمین نمی‌شود که " +"نمونه‌های یکتا (singleton) باشند::" msgid "" ">>> a = 10_000_000\n" @@ -1736,9 +3548,20 @@ msgid "" ">>> a is c\n" "False" msgstr "" +">>> a = 10_000_000\n" +">>> b = 5_000_000\n" +">>> c = b + 5_000_000\n" +">>> a is c\n" +"False\n" +"\n" +">>> a = 'Python'\n" +">>> b = 'Py'\n" +">>> c = b + 'thon'\n" +">>> a is c\n" +"False" msgid "Likewise, new instances of mutable containers are never identical::" -msgstr "" +msgstr "به همین ترتیب، نمونه‌های جدید از ظرف‌های تغییرپذیر هرگز یکسان نیستند::" msgid "" ">>> a = []\n" @@ -1746,15 +3569,38 @@ msgid "" ">>> a is b\n" "False" msgstr "" +">>> a = []\n" +">>> b = []\n" +">>> a is b\n" +"False" -msgid "In the standard library code, you will see several common patterns for correctly using identity tests:" +msgid "" +"In the standard library code, you will see several common patterns for " +"correctly using identity tests:" msgstr "" +"در کد کتابخانه‌ی استاندارد، چندین الگوی رایج را برای استفاده‌ی صحیح از " +"آزمون‌های هویت خواهید دید:" -msgid "As recommended by :pep:`8`, an identity test is the preferred way to check for ``None``. This reads like plain English in code and avoids confusion with other objects that may have boolean values that evaluate to false." +msgid "" +"As recommended by :pep:`8`, an identity test is the preferred way to check " +"for ``None``. This reads like plain English in code and avoids confusion " +"with other objects that may have boolean values that evaluate to false." msgstr "" +"به توصیه‌ی :pep:`8`، آزمون هویت روش ارجح برای بررسی ``None`` است. این روش در " +"کد مانند انگلیسی ساده خوانده می‌شود و از اشتباه گرفتن آن با اشیاء دیگری که " +"ممکن است مقادیر بولی آن‌ها به false ارزیابی شوند، جلوگیری می‌کند." -msgid "Detecting optional arguments can be tricky when ``None`` is a valid input value. In those situations, you can create a singleton sentinel object guaranteed to be distinct from other objects. For example, here is how to implement a method that behaves like :meth:`dict.pop`:" +msgid "" +"Detecting optional arguments can be tricky when ``None`` is a valid input " +"value. In those situations, you can create a singleton sentinel object " +"guaranteed to be distinct from other objects. For example, here is how to " +"implement a method that behaves like :meth:`dict.pop`:" msgstr "" +"تشخیص آرگومان‌های اختیاری می‌تواند زمانی که ``None`` یک مقدار ورودی معتبر " +"است، دشوار باشد. در این شرایط، می‌توانید یک شیء نشانگر تک‌نمونه (singleton " +"sentinel object) ایجاد کنید که متمایز بودن آن از سایر اشیاء تضمین شده است. " +"برای مثال، در اینجا نحوه‌ی پیاده‌سازی متدی که مانند :meth:`dict.pop` رفتار " +"می‌کند آمده است:" msgid "" "_sentinel = object()\n" @@ -1768,12 +3614,32 @@ msgid "" " raise KeyError(key)\n" " return default" msgstr "" +"_sentinel = object()\n" +"\n" +"def pop(self, key, default=_sentinel):\n" +" if key in self:\n" +" value = self[key]\n" +" del self[key]\n" +" return value\n" +" if default is _sentinel:\n" +" raise KeyError(key)\n" +" return default" -msgid "Container implementations sometimes need to augment equality tests with identity tests. This prevents the code from being confused by objects such as ``float('NaN')`` that are not equal to themselves." +msgid "" +"Container implementations sometimes need to augment equality tests with " +"identity tests. This prevents the code from being confused by objects such " +"as ``float('NaN')`` that are not equal to themselves." msgstr "" +"پیاده‌سازی‌های ظرف (container) گاهی نیاز دارند آزمون‌های برابری را با آزمون‌های " +"هویت تکمیل کنند. این کار از سردرگم شدن کد در اثر اشیایی مانند " +"``float('NaN')`` که با خودشان برابر نیستند جلوگیری می‌کند." -msgid "For example, here is the implementation of :meth:`!collections.abc.Sequence.__contains__`::" +msgid "" +"For example, here is the implementation of :meth:`!" +"collections.abc.Sequence.__contains__`::" msgstr "" +"برای مثال، در اینجا پیاده‌سازی :meth:`!" +"collections.abc.Sequence.__contains__` آمده است::" msgid "" "def __contains__(self, value):\n" @@ -1782,15 +3648,33 @@ msgid "" " return True\n" " return False" msgstr "" +"def __contains__(self, value):\n" +" for v in self:\n" +" if v is value or v == value:\n" +" return True\n" +" return False" -msgid "How can a subclass control what data is stored in an immutable instance?" +msgid "" +"How can a subclass control what data is stored in an immutable instance?" msgstr "" +"چگونه یک زیرکلاس می‌تواند کنترل کند که چه داده‌هایی در یک نمونه‌ی تغییرناپذیر " +"ذخیره می‌شوند؟" -msgid "When subclassing an immutable type, override the :meth:`~object.__new__` method instead of the :meth:`~object.__init__` method. The latter only runs *after* an instance is created, which is too late to alter data in an immutable instance." +msgid "" +"When subclassing an immutable type, override the :meth:`~object.__new__` " +"method instead of the :meth:`~object.__init__` method. The latter only " +"runs *after* an instance is created, which is too late to alter data in an " +"immutable instance." msgstr "" +"هنگام زیرکلاس‌سازی از یک نوع تغییرناپذیر، به‌جای متد :meth:`~object.__init__ " +"<~object.__new__>`، متد :meth:`~object.__new__ <~object.__init__>` را " +"بازنویسی کنید. دومی تنها *پس از* ایجاد یک نمونه اجرا می‌شود، که برای تغییر " +"داده‌ها در یک نمونه تغییرناپذیر بسیار دیر است." -msgid "All of these immutable classes have a different signature than their parent class:" -msgstr "" +msgid "" +"All of these immutable classes have a different signature than their parent " +"class:" +msgstr "همه‌ی این کلاس‌های تغییرناپذیر، امضایی متفاوت از کلاس والد خود دارند:" msgid "" "import datetime as dt\n" @@ -1814,9 +3698,29 @@ msgid "" " s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" " return super().__new__(cls, s)" msgstr "" +"import datetime as dt\n" +"\n" +"class FirstOfMonthDate(dt.date):\n" +" \"Always choose the first day of the month\"\n" +" def __new__(cls, year, month, day):\n" +" return super().__new__(cls, year, month, 1)\n" +"\n" +"class NamedInt(int):\n" +" \"Allow text names for some numbers\"\n" +" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" +" def __new__(cls, value):\n" +" value = cls.xlat.get(value, value)\n" +" return super().__new__(cls, value)\n" +"\n" +"class TitleStr(str):\n" +" \"Convert str to name suitable for a URL path\"\n" +" def __new__(cls, s):\n" +" s = s.lower().replace(' ', '-')\n" +" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" +" return super().__new__(cls, s)" msgid "The classes can be used like this:" -msgstr "" +msgstr "می‌توان از این کلاس‌ها به این صورت استفاده کرد:" msgid "" ">>> FirstOfMonthDate(2012, 2, 14)\n" @@ -1828,27 +3732,67 @@ msgid "" ">>> TitleStr('Blog: Why Python Rocks')\n" "'blog-why-python-rocks'" msgstr "" +">>> FirstOfMonthDate(2012, 2, 14)\n" +"FirstOfMonthDate(2012, 2, 1)\n" +">>> NamedInt('ten')\n" +"10\n" +">>> NamedInt(20)\n" +"20\n" +">>> TitleStr('Blog: Why Python Rocks')\n" +"'blog-why-python-rocks'" msgid "How do I cache method calls?" -msgstr "" +msgstr "چگونه فراخوانی‌های متد را در نهانگاه ذخیره کنم؟" -msgid "The two principal tools for caching methods are :deco:`functools.cached_property` and :deco:`functools.lru_cache`. The former stores results at the instance level and the latter at the class level." +msgid "" +"The two principal tools for caching methods " +"are :deco:`functools.cached_property` and :deco:`functools.lru_cache`. The " +"former stores results at the instance level and the latter at the class " +"level." msgstr "" +"دو ابزار اصلی برای نهان‌سازی متدها، :deco:`functools.cached_property` " +"و :deco:`functools.lru_cache` هستند. اولی نتایج را در سطح نمونه ذخیره می‌کند " +"و دومی آن‌ها را در سطح کلاس." -msgid "The ``cached_property`` approach only works with methods that do not take any arguments. It does not create a reference to the instance. The cached method result will be kept only as long as the instance is alive." +msgid "" +"The ``cached_property`` approach only works with methods that do not take " +"any arguments. It does not create a reference to the instance. The cached " +"method result will be kept only as long as the instance is alive." msgstr "" +"روش ``cached_property`` فقط با متدهایی کار می‌کند که هیچ آرگومانی دریافت " +"نمی‌کنند. این روش ارجاعی به نمونه ایجاد نمی‌کند. نتیجه‌ی نهان‌شده‌ی متد فقط تا " +"زمانی که نمونه زنده است نگه داشته می‌شود." -msgid "The advantage is that when an instance is no longer used, the cached method result will be released right away. The disadvantage is that if instances accumulate, so too will the accumulated method results. They can grow without bound." +msgid "" +"The advantage is that when an instance is no longer used, the cached method " +"result will be released right away. The disadvantage is that if instances " +"accumulate, so too will the accumulated method results. They can grow " +"without bound." msgstr "" +"مزیت این است که هنگامی که دیگر از یک نمونه استفاده نمی‌شود، نتیجه‌ی نهان‌شده‌ی " +"متد بلافاصله آزاد می‌شود. عیب این است که اگر نمونه‌ها انباشته شوند، نتایج " +"متدها نیز انباشته خواهند شد. آن‌ها می‌توانند بدون محدودیت رشد کنند." -msgid "The ``lru_cache`` approach works with methods that have :term:`hashable` arguments. It creates a reference to the instance unless special efforts are made to pass in weak references." +msgid "" +"The ``lru_cache`` approach works with methods that have :term:`hashable` " +"arguments. It creates a reference to the instance unless special efforts " +"are made to pass in weak references." msgstr "" +"رویکرد ``lru_cache`` با متدهایی کار می‌کند که آرگومان‌های :term:`hashable` " +"دارند. این روش یک ارجاع به نمونه ایجاد می‌کند، مگر اینکه تلاش‌های ویژه‌ای برای " +"ارسال ارجاع‌های ضعیف انجام شود." -msgid "The advantage of the least recently used algorithm is that the cache is bounded by the specified *maxsize*. The disadvantage is that instances are kept alive until they age out of the cache or until the cache is cleared." +msgid "" +"The advantage of the least recently used algorithm is that the cache is " +"bounded by the specified *maxsize*. The disadvantage is that instances are " +"kept alive until they age out of the cache or until the cache is cleared." msgstr "" +"مزیت الگوریتم کمترین استفاده‌ی اخیر این است که نهانگاه به *maxsize* مشخص‌شده " +"محدود می‌شود. عیب آن این است که نمونه‌ها زنده نگه داشته می‌شوند تا زمانی که " +"به‌دلیل قدیمی شدن از نهانگاه خارج شوند یا نهانگاه پاک شود." msgid "This example shows the various techniques::" -msgstr "" +msgstr "این مثال تکنیک‌های مختلف را نشان می‌دهد::" msgid "" "class Weather:\n" @@ -1873,12 +3817,46 @@ msgid "" " \"Rainfall on a given date\"\n" " # Depends on the station_id, date, and units." msgstr "" +"class Weather:\n" +" \"Lookup weather information on a government website\"\n" +"\n" +" def __init__(self, station_id):\n" +" self._station_id = station_id\n" +" # The _station_id is private and immutable\n" +"\n" +" def current_temperature(self):\n" +" \"Latest hourly observation\"\n" +" # Do not cache this because old results\n" +" # can be out of date.\n" +"\n" +" @cached_property\n" +" def location(self):\n" +" \"Return the longitude/latitude coordinates of the station\"\n" +" # Result only depends on the station_id\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='mm'):\n" +" \"Rainfall on a given date\"\n" +" # Depends on the station_id, date, and units." -msgid "The above example assumes that the *station_id* never changes. If the relevant instance attributes are mutable, the ``cached_property`` approach can't be made to work because it cannot detect changes to the attributes." +msgid "" +"The above example assumes that the *station_id* never changes. If the " +"relevant instance attributes are mutable, the ``cached_property`` approach " +"can't be made to work because it cannot detect changes to the attributes." msgstr "" +"مثال بالا فرض می‌کند که *station_id* هرگز تغییر نمی‌کند. اگر ویژگی‌های مربوط " +"به نمونه تغییرپذیر باشند، نمی‌توان از رویکرد ``cached_property`` استفاده " +"کرد، زیرا نمی‌تواند تغییرات ویژگی‌ها را تشخیص دهد." -msgid "To make the ``lru_cache`` approach work when the *station_id* is mutable, the class needs to define the :meth:`~object.__eq__` and :meth:`~object.__hash__` methods so that the cache can detect relevant attribute updates::" +msgid "" +"To make the ``lru_cache`` approach work when the *station_id* is mutable, " +"the class needs to define the :meth:`~object.__eq__` " +"and :meth:`~object.__hash__` methods so that the cache can detect relevant " +"attribute updates::" msgstr "" +"برای اینکه رویکرد ``lru_cache`` زمانی که *station_id* تغییرپذیر است کار " +"کند، کلاس باید متدهای :meth:`~object.__eq__` و :meth:`~object.__hash__` را " +"تعریف کند تا نهانگاه بتواند به‌روزرسانی‌های مرتبط با ویژگی را تشخیص دهد::" msgid "" "class Weather:\n" @@ -1901,50 +3879,151 @@ msgid "" " 'Rainfall on a given date'\n" " # Depends on the station_id, date, and units." msgstr "" +"class Weather:\n" +" \"Example with a mutable station identifier\"\n" +"\n" +" def __init__(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def change_station(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def __eq__(self, other):\n" +" return self.station_id == other.station_id\n" +"\n" +" def __hash__(self):\n" +" return hash(self.station_id)\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='cm'):\n" +" 'Rainfall on a given date'\n" +" # Depends on the station_id, date, and units." msgid "Modules" -msgstr "" +msgstr "ماژول‌ها" msgid "How do I create a .pyc file?" -msgstr "" +msgstr "چگونه یک فایل .pyc ایجاد کنم؟" -msgid "When a module is imported for the first time (or when the source file has changed since the current compiled file was created) a ``.pyc`` file containing the compiled code should be created in a ``__pycache__`` subdirectory of the directory containing the ``.py`` file. The ``.pyc`` file will have a filename that starts with the same name as the ``.py`` file, and ends with ``.pyc``, with a middle component that depends on the particular ``python`` binary that created it. (See :pep:`3147` for details.)" -msgstr "" +msgid "" +"When a module is imported for the first time (or when the source file has " +"changed since the current compiled file was created) a ``.pyc`` file " +"containing the compiled code should be created in a ``__pycache__`` " +"subdirectory of the directory containing the ``.py`` file. The ``.pyc`` " +"file will have a filename that starts with the same name as the ``.py`` " +"file, and ends with ``.pyc``, with a middle component that depends on the " +"particular ``python`` binary that created it. (See :pep:`3147` for " +"details.)" +msgstr "" +"هنگامی که یک ماژول برای نخستین بار ایمپورت می‌شود (یا وقتی فایل منبع پس از " +"ایجاد فایل کامپایل‌شده‌ی فعلی تغییر کرده باشد)، یک فایل ``.pyc`` شامل کد " +"کامپایل‌شده باید در زیرپوشه‌ی ``__pycache__`` از پوشه‌ی حاوی فایل ``.py`` " +"ایجاد شود. نام فایل ``.pyc`` با همان نام فایل ``.py`` آغاز می‌شود و با " +"``.pyc`` پایان می‌یابد، و دارای یک کامپوننت میانی است که به دودویی " +"``python`` خاصی که آن را ایجاد کرده است بستگی دارد. (برای " +"جزئیات، :pep:`3147` را ببینید.)" -msgid "One reason that a ``.pyc`` file may not be created is a permissions problem with the directory containing the source file, meaning that the ``__pycache__`` subdirectory cannot be created. This can happen, for example, if you develop as one user but run as another, such as if you are testing with a web server." -msgstr "" +msgid "" +"One reason that a ``.pyc`` file may not be created is a permissions problem " +"with the directory containing the source file, meaning that the " +"``__pycache__`` subdirectory cannot be created. This can happen, for " +"example, if you develop as one user but run as another, such as if you are " +"testing with a web server." +msgstr "" +"یکی از دلایلی که ممکن است یک فایل ``.pyc`` ایجاد نشود، مشکل مجوزها در پوشه‌ی " +"حاوی فایل منبع است، به این معنا که زیرپوشه‌ی ``__pycache__`` نمی‌تواند ایجاد " +"شود. این موضوع می‌تواند، برای مثال، زمانی رخ دهد که شما به‌عنوان یک کاربر " +"توسعه می‌دهید اما به‌عنوان کاربر دیگری اجرا می‌کنید، مانند زمانی که با یک " +"وب‌سرور در حال آزمایش هستید." -msgid "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, creation of a .pyc file is automatic if you're importing a module and Python has the ability (permissions, free space, and so on) to create a ``__pycache__`` subdirectory and write the compiled module to that subdirectory." +msgid "" +"Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " +"creation of a .pyc file is automatic if you're importing a module and " +"Python has the ability (permissions, free space, and so on) to create a " +"``__pycache__`` subdirectory and write the compiled module to that " +"subdirectory." msgstr "" +"مگر اینکه متغیر محیطی :envvar:`PYTHONDONTWRITEBYTECODE` تنظیم‌شده باشد، " +"ایجاد یک فایل .pyc خودکار است، مشروط بر اینکه شما ماژولی را ایمپورت کنید و " +"پایتون توانایی لازم (دسترسی‌ها، فضای آزاد و غیره) را برای ایجاد یک زیرپوشه‌ی " +"``__pycache__`` و نوشتن ماژول کامپایل‌شده در آن زیرپوشه داشته باشد." -msgid "Running Python on a top-level script is not considered an import and no ``.pyc`` will be created. For example, if you have a top-level module ``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by typing ``python foo.py`` as a shell command), a ``.pyc`` will be created for ``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created for ``foo`` since ``foo.py`` isn't being imported." -msgstr "" +msgid "" +"Running Python on a top-level script is not considered an import and no " +"``.pyc`` will be created. For example, if you have a top-level module " +"``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by " +"typing ``python foo.py`` as a shell command), a ``.pyc`` will be created " +"for ``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be " +"created for ``foo`` since ``foo.py`` isn't being imported." +msgstr "" +"اجرای پایتون بر روی یک اسکریپت سطح بالا، به‌عنوان یک ایمپورت در نظر گرفته " +"نمی‌شود و هیچ فایل ``.pyc`` ایجاد نخواهد شد. برای مثال، اگر یک ماژول سطح " +"بالا به نام ``foo.py`` دارید که ماژول دیگری به نام ``xyz.py`` را ایمپورت " +"می‌کند، وقتی ``foo`` را اجرا می‌کنید (با وارد کردن ``python foo.py`` به‌عنوان " +"یک دستور پوسته)، یک فایل ``.pyc`` برای ``xyz`` ایجاد می‌شود، زیرا ``xyz`` " +"ایمپورت شده است، اما هیچ فایل ``.pyc`` برای ``foo`` ایجاد نخواهد شد، زیرا " +"``foo.py`` ایمپورت نمی‌شود." -msgid "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``.pyc`` file for a module that is not imported -- you can, using the :mod:`py_compile` and :mod:`compileall` modules." +msgid "" +"If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a " +"``.pyc`` file for a module that is not imported -- you can, using " +"the :mod:`py_compile` and :mod:`compileall` modules." msgstr "" +"اگر نیاز دارید یک فایل ``.pyc`` برای ``foo`` ایجاد کنید -- یعنی برای ماژولی " +"که ایمپورت ن‌شده است یک فایل ``.pyc`` ایجاد کنید -- می‌توانید این کار را با " +"استفاده از ماژول‌های :mod:`py_compile` و :mod:`compileall` انجام دهید." -msgid "The :mod:`py_compile` module can manually compile any module. One way is to use the ``compile()`` function in that module interactively::" +msgid "" +"The :mod:`py_compile` module can manually compile any module. One way is " +"to use the ``compile()`` function in that module interactively::" msgstr "" +"ماژول :mod:`py_compile` می‌تواند هر ماژولی را به‌صورت دستی کامپایل کند. یکی " +"از راه‌ها استفاده از تابع ``compile()`` در آن ماژول به‌صورت تعاملی است::" msgid "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py')" msgstr "" +">>> import py_compile\n" +">>> py_compile.compile('foo.py')" -msgid "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same location as ``foo.py`` (or you can override that with the optional parameter *cfile*)." +msgid "" +"This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " +"location as ``foo.py`` (or you can override that with the optional " +"parameter *cfile*)." msgstr "" +"این کار ``.pyc`` را در یک زیرپوشه‌ی ``__pycache__`` در همان محل ``foo.py`` " +"می‌نویسد (یا می‌توانید آن را با پارامتر اختیاری *cfile* تغییر دهید)." -msgid "You can also automatically compile all files in a directory or directories using the :mod:`compileall` module. You can do it from the shell prompt by running ``compileall.py`` and providing the path of a directory containing Python files to compile::" +msgid "" +"You can also automatically compile all files in a directory or directories " +"using the :mod:`compileall` module. You can do it from the shell prompt by " +"running ``compileall.py`` and providing the path of a directory containing " +"Python files to compile::" msgstr "" +"همچنین می‌توانید با استفاده از ماژول :mod:`compileall`، همه‌ی فایل‌های موجود در " +"یک پوشه یا چند پوشه را به‌صورت خودکار کامپایل کنید. می‌توانید این کار را از " +"خط فرمان پوسته با اجرای ``compileall.py`` و ارائه‌ی مسیر پوشه‌ای حاوی فایل‌های " +"پایتون برای کامپایل انجام دهید::" msgid "python -m compileall ." -msgstr "" +msgstr "python -m compileall ." msgid "How do I find the current module name?" -msgstr "" +msgstr "چگونه نام ماژول جاری را پیدا کنم؟" -msgid "A module can find out its own module name by looking at the predefined global variable ``__name__``. If this has the value ``'__main__'``, the program is running as a script. Many modules that are usually used by importing them also provide a command-line interface or a self-test, and only execute this code after checking ``__name__``::" -msgstr "" +msgid "" +"A module can find out its own module name by looking at the predefined " +"global variable ``__name__``. If this has the value ``'__main__'``, the " +"program is running as a script. Many modules that are usually used by " +"importing them also provide a command-line interface or a self-test, and " +"only execute this code after checking ``__name__``::" +msgstr "" +"یک ماژول می‌تواند با بررسی متغیر سراسری از پیش تعریف‌شده ``__name__``، نام " +"ماژول خود را پیدا کند. اگر این متغیر مقدار ``'__main__'`` داشته باشد، " +"برنامه به‌عنوان یک اسکریپت در حال اجرا است. بسیاری از ماژول‌ها که معمولاً با " +"ایمپورت کردن آن‌ها استفاده می‌شوند، یک رابط خط فرمان یا خودآزمایی نیز فراهم " +"می‌کنند و این کد را تنها پس از بررسی ``__name__`` اجرا می‌کنند::" msgid "" "def main():\n" @@ -1954,118 +4033,206 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"def main():\n" +" print('Running test...')\n" +" ...\n" +"\n" +"if __name__ == '__main__':\n" +" main()" msgid "How can I have modules that mutually import each other?" msgstr "" +"چگونه می‌توانم ماژول‌هایی داشته باشم که یکدیگر را به‌طور متقابل ایمپورت کنند؟" msgid "Suppose you have the following modules:" -msgstr "" +msgstr "فرض کنید ماژول‌های زیر را دارید:" msgid ":file:`foo.py`::" -msgstr "" +msgstr ":file:`foo.py`::" msgid "" "from bar import bar_var\n" "foo_var = 1" msgstr "" +"from bar import bar_var\n" +"foo_var = 1" msgid ":file:`bar.py`::" -msgstr "" +msgstr ":file:`bar.py`::" msgid "" "from foo import foo_var\n" "bar_var = 2" msgstr "" +"from foo import foo_var\n" +"bar_var = 2" msgid "The problem is that the interpreter will perform the following steps:" -msgstr "" +msgstr "مشکل این است که مفسر مراحل زیر را انجام خواهد داد:" msgid "main imports ``foo``" -msgstr "" +msgstr "main، ``foo`` را ایمپورت می‌کند" msgid "Empty globals for ``foo`` are created" -msgstr "" +msgstr "فضای نام سراسری خالی برای ``foo`` ایجاد می‌شود" msgid "``foo`` is compiled and starts executing" -msgstr "" +msgstr "``foo`` کامپایل می‌شود و اجرای آن آغاز می‌شود" msgid "``foo`` imports ``bar``" -msgstr "" +msgstr "``foo``، ``bar`` را ایمپورت می‌کند" msgid "Empty globals for ``bar`` are created" -msgstr "" +msgstr "متغیرهای سراسری خالی برای ``bar`` ایجاد می‌شوند" msgid "``bar`` is compiled and starts executing" -msgstr "" +msgstr "``bar`` کامپایل می‌شود و شروع به اجرا می‌کند" -msgid "``bar`` imports ``foo`` (which is a no-op since there already is a module named ``foo``)" +msgid "" +"``bar`` imports ``foo`` (which is a no-op since there already is a module " +"named ``foo``)" msgstr "" +"``bar`` ماژول ``foo`` را ایمپورت می‌کند (که یک عملیات بی‌اثر (no-op) است، " +"زیرا از قبل ماژولی به نام ``foo`` وجود دارد)" -msgid "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set ``bar.foo_var = foo.foo_var``" +msgid "" +"The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " +"``bar.foo_var = foo.foo_var``" msgstr "" +"سازوکار ایمپورت تلاش می‌کند ``foo_var`` را از متغیرهای سراسری ``foo`` " +"بخواند، تا ``bar.foo_var = foo.foo_var`` را تنظیم کند" -msgid "The last step fails, because Python isn't done with interpreting ``foo`` yet and the global symbol dictionary for ``foo`` is still empty." +msgid "" +"The last step fails, because Python isn't done with interpreting ``foo`` " +"yet and the global symbol dictionary for ``foo`` is still empty." msgstr "" +"آخرین مرحله شکست می‌خورد، زیرا پایتون هنوز تفسیر ``foo`` را به پایان نرسانده " +"است و دیکشنری نمادهای سراسری برای ``foo`` هنوز خالی است." -msgid "The same thing happens when you use ``import foo``, and then try to access ``foo.foo_var`` in global code." +msgid "" +"The same thing happens when you use ``import foo``, and then try to access " +"``foo.foo_var`` in global code." msgstr "" +"همین اتفاق زمانی رخ می‌دهد که از ``import foo`` استفاده کنید و سپس سعی کنید " +"در کد سراسری به ``foo.foo_var`` دسترسی پیدا کنید." msgid "There are (at least) three possible workarounds for this problem." -msgstr "" +msgstr "برای این مشکل (حداقل) ۳ راه‌حل جایگزین ممکن وجود دارد." -msgid "Guido van Rossum recommends avoiding all uses of ``from import ...``, and placing all code inside functions. Initializations of global variables and class variables should use constants or built-in functions only. This means everything from an imported module is referenced as ``.``." -msgstr "" +msgid "" +"Guido van Rossum recommends avoiding all uses of ``from " +"import ...``, and placing all code inside functions. Initializations of " +"global variables and class variables should use constants or built-in " +"functions only. This means everything from an imported module is " +"referenced as ``.``." +msgstr "" +"گیدو ون روسوم توصیه می‌کند که از هرگونه استفاده از ``from " +"import ...`` خودداری شود و تمام کد درون توابع قرار گیرد. برای مقداردهی " +"اولیه‌ی متغیرهای سراسری و متغیرهای کلاس باید فقط از ثابت‌ها یا توابع توکار " +"استفاده شود. این بدان معناست که همه‌چیز از یک ماژول ایمپورت‌شده به‌صورت " +"``.`` ارجاع داده می‌شود." -msgid "Jim Roskind suggests performing steps in the following order in each module:" +msgid "" +"Jim Roskind suggests performing steps in the following order in each module:" msgstr "" +"Jim Roskind پیشنهاد می‌کند که مراحل در هر ماژول به‌ترتیب زیر انجام شوند:" -msgid "exports (globals, functions, and classes that don't need imported base classes)" +msgid "" +"exports (globals, functions, and classes that don't need imported base " +"classes)" msgstr "" +"موارد صادرشده (متغیرهای سراسری، توابع و کلاس‌هایی که نیازی به کلاس‌های پایه‌ی " +"ایمپورت‌شده ندارند)" msgid "``import`` statements" -msgstr "" +msgstr "دستورهای ``import``" -msgid "active code (including globals that are initialized from imported values)." +msgid "" +"active code (including globals that are initialized from imported values)." msgstr "" +"کد فعال (شامل متغیرهای سراسری که از مقادیر ایمپورت‌شده مقداردهی اولیه " +"شده‌اند)." -msgid "Van Rossum doesn't like this approach much because the imports appear in a strange place, but it does work." +msgid "" +"Van Rossum doesn't like this approach much because the imports appear in a " +"strange place, but it does work." msgstr "" +"ون روسوم این رویکرد را چندان نمی‌پسندد، زیرا ایمپورت‌ها در جای عجیبی ظاهر " +"می‌شوند، اما این رویکرد کار می‌کند." -msgid "Matthias Urlichs recommends restructuring your code so that the recursive import is not necessary in the first place." +msgid "" +"Matthias Urlichs recommends restructuring your code so that the recursive " +"import is not necessary in the first place." msgstr "" +"ماتیاس اورلیکس توصیه می‌کند ساختار کد خود را به‌گونه‌ای تغییر دهید که اصلاً " +"نیازی به ایمپورت بازگشتی نباشد." msgid "These solutions are not mutually exclusive." -msgstr "" +msgstr "این راه‌حل‌ها مانع‌الجمع نیستند." msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "" +"__import__('x.y.z') را برمی‌گرداند؛ چگونه می‌توانم z را دریافت " +"کنم؟" -msgid "Consider using the convenience function :func:`~importlib.import_module` from :mod:`importlib` instead::" +msgid "" +"Consider using the convenience function :func:`~importlib.import_module` " +"from :mod:`importlib` instead::" msgstr "" +"بهتر است به‌جای آن از تابع کمکی :func:`~importlib.import_module` " +"در :mod:`importlib` استفاده کنید::" msgid "z = importlib.import_module('x.y.z')" -msgstr "" +msgstr "z = importlib.import_module('x.y.z')" -msgid "When I edit an imported module and reimport it, the changes don't show up. Why does this happen?" +msgid "" +"When I edit an imported module and reimport it, the changes don't show up. " +"Why does this happen?" msgstr "" +"هنگامی که یک ماژول ایمپورت‌شده را ویرایش می‌کنم و دوباره آن را ایمپورت می‌کنم، " +"تغییرات مشاهده نمی‌شوند. چرا این اتفاق می‌افتد؟" -msgid "For reasons of efficiency as well as consistency, Python only reads the module file on the first time a module is imported. If it didn't, in a program consisting of many modules where each one imports the same basic module, the basic module would be parsed and re-parsed many times. To force re-reading of a changed module, do this::" -msgstr "" +msgid "" +"For reasons of efficiency as well as consistency, Python only reads the " +"module file on the first time a module is imported. If it didn't, in a " +"program consisting of many modules where each one imports the same basic " +"module, the basic module would be parsed and re-parsed many times. To " +"force re-reading of a changed module, do this::" +msgstr "" +"به دلایل کارایی و همچنین سازگاری، پایتون فایل ماژول را فقط در اولین باری که " +"یک ماژول ایمپورت می‌شود می‌خواند. اگر این‌طور نبود، در برنامه‌ای متشکل از " +"ماژول‌های زیاد که هر کدام همان ماژول پایه را ایمپورت می‌کنند، ماژول پایه " +"بارها تجزیه و دوباره تجزیه می‌شد. برای وادار کردن به بازخوانی یک ماژول " +"تغییریافته، این کار را انجام دهید::" msgid "" "import importlib\n" "import modname\n" "importlib.reload(modname)" msgstr "" +"import importlib\n" +"import modname\n" +"importlib.reload(modname)" -msgid "Warning: this technique is not 100% fool-proof. In particular, modules containing statements like::" +msgid "" +"Warning: this technique is not 100% fool-proof. In particular, modules " +"containing statements like::" msgstr "" +"هشدار: این روش ۱۰۰٪ مصون از خطا نیست. به‌ویژه، ماژول‌های شامل دستورهایی " +"مانند::" msgid "from modname import some_objects" -msgstr "" +msgstr "from modname import some_objects" -msgid "will continue to work with the old version of the imported objects. If the module contains class definitions, existing class instances will *not* be updated to use the new class definition. This can result in the following paradoxical behaviour::" +msgid "" +"will continue to work with the old version of the imported objects. If the " +"module contains class definitions, existing class instances will *not* be " +"updated to use the new class definition. This can result in the following " +"paradoxical behaviour::" msgstr "" +"با نسخه‌ی قدیمی اشیای ایمپورت‌شده به کار خود ادامه خواهند داد. اگر ماژول حاوی " +"تعریف‌های کلاس باشد، نمونه‌های موجود کلاس برای استفاده از تعریف جدید کلاس " +"به‌روزرسانی *نخواهند شد*. این می‌تواند منجر به رفتار متناقض زیر شود::" msgid "" ">>> import importlib\n" @@ -2076,9 +4243,18 @@ msgid "" ">>> isinstance(c, cls.C) # isinstance is false?!?\n" "False" msgstr "" +">>> import importlib\n" +">>> import cls\n" +">>> c = cls.C() # Create an instance of C\n" +">>> importlib.reload(cls)\n" +"\n" +">>> isinstance(c, cls.C) # isinstance is false?!?\n" +"False" -msgid "The nature of the problem is made clear if you print out the \"identity\" of the class objects::" -msgstr "" +msgid "" +"The nature of the problem is made clear if you print out the \"identity\" " +"of the class objects::" +msgstr "اگر «هویت» اشیای کلاس را چاپ کنید، ماهیت مشکل روشن می‌شود::" msgid "" ">>> hex(id(c.__class__))\n" @@ -2086,15 +4262,19 @@ msgid "" ">>> hex(id(cls.C))\n" "'0x4198d0'" msgstr "" +">>> hex(id(c.__class__))\n" +"'0x7352a0'\n" +">>> hex(id(cls.C))\n" +"'0x4198d0'" msgid "argument" -msgstr "" +msgstr "آرگومان" msgid "difference from parameter" -msgstr "" +msgstr "تفاوت با پارامتر" msgid "parameter" -msgstr "" +msgstr "پارامتر" msgid "difference from argument" -msgstr "" +msgstr "تفاوت با آرگومان" diff --git a/faq/windows.po b/faq/windows.po index 7d493c64e..0e49b60df 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -25,52 +25,108 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Python on Windows FAQ" -msgstr "" +msgstr "پرسش‌های متداول پایتون در ویندوز" msgid "Contents" -msgstr "" +msgstr "محتویات" msgid "How do I run a Python program under Windows?" -msgstr "" +msgstr "چگونه یک برنامه پایتون را در ویندوز اجرا کنم؟" -msgid "This is not necessarily a straightforward question. If you are already familiar with running programs from the Windows command line then everything will seem obvious; otherwise, you might need a little more guidance." +msgid "" +"This is not necessarily a straightforward question. If you are already " +"familiar with running programs from the Windows command line then everything" +" will seem obvious; otherwise, you might need a little more guidance." msgstr "" +"این لزوماً پرسش ساده‌ای نیست. اگر از قبل با اجرای برنامه‌ها از طریق خط فرمان" +" ویندوز آشنا هستید، همه‌چیز بدیهی به نظر خواهد رسید؛ در غیر این صورت، ممکن " +"است به کمی راهنمایی بیشتری نیاز داشته باشید." -msgid "Unless you use some sort of integrated development environment, you will end up *typing* Windows commands into what is referred to as a \"Command prompt window\". Usually you can create such a window from your search bar by searching for ``cmd``. You should be able to recognize when you have started such a window because you will see a Windows \"command prompt\", which usually looks like this:" -msgstr "" +msgid "" +"Unless you use some sort of integrated development environment, you will end" +" up *typing* Windows commands into what is referred to as a \"Command prompt" +" window\". Usually you can create such a window from your search bar by " +"searching for ``cmd``. You should be able to recognize when you have " +"started such a window because you will see a Windows \"command prompt\", " +"which usually looks like this:" +msgstr "" +"مگر اینکه از نوعی محیط توسعه یکپارچه استفاده کنید، در نهایت دستورات ویندوز " +"را در آنچه «پنجره خط فرمان» نامیده می‌شود، *تایپ* خواهید کرد. معمولاً " +"می‌توانید چنین پنجره‌ای را از نوار جست‌وجوی خود با جست‌وجوی ``cmd`` ایجاد " +"کنید. باید بتوانید تشخیص دهید که چنین پنجره‌ای را راه‌اندازی کرده‌اید، زیرا " +"«خط فرمان» ویندوز را خواهید دید که معمولاً به این شکل است:" msgid "C:\\>" -msgstr "" +msgstr "C:\\>" -msgid "The letter may be different, and there might be other things after it, so you might just as easily see something like:" +msgid "" +"The letter may be different, and there might be other things after it, so " +"you might just as easily see something like:" msgstr "" +"ممکن است حرف متفاوت باشد و ممکن است چیزهای دیگری بعد از آن وجود داشته باشد، " +"بنابراین ممکن است به‌همین‌آسانی چیزی مانند این را ببینید:" msgid "D:\\YourName\\Projects\\Python>" -msgstr "" +msgstr "D:\\YourName\\Projects\\Python>" -msgid "depending on how your computer has been set up and what else you have recently done with it. Once you have started such a window, you are well on the way to running Python programs." +msgid "" +"depending on how your computer has been set up and what else you have " +"recently done with it. Once you have started such a window, you are well on" +" the way to running Python programs." msgstr "" +"بسته به این که رایانه‌ی شما چگونه پیکربندی شده است و اخیراً چه کارهای دیگری " +"با آن انجام داده‌اید. پس از راه‌اندازی چنین پنجره‌ای، به‌خوبی در مسیر اجرای " +"برنامه‌های پایتون هستید." -msgid "You need to realize that your Python scripts have to be processed by another program called the Python *interpreter*. The interpreter reads your script, compiles it into bytecodes, and then executes the bytecodes to run your program. So, how do you arrange for the interpreter to handle your Python?" +msgid "" +"You need to realize that your Python scripts have to be processed by another" +" program called the Python *interpreter*. The interpreter reads your " +"script, compiles it into bytecodes, and then executes the bytecodes to run " +"your program. So, how do you arrange for the interpreter to handle your " +"Python?" msgstr "" +"باید بدانید که اسکریپت‌های پایتون شما باید به‌وسیله‌ی برنامه‌ی دیگری به نام " +"*مفسر* پایتون پردازش شوند. مفسر اسکریپت شما را می‌خواند، آن را به بایت‌کدها " +"کامپایل می‌کند و سپس بایت‌کدها را اجرا می‌کند تا برنامه‌ی شما اجرا شود. " +"بنابراین، چگونه ترتیب می‌دهید که مفسر پایتون شما را پردازش کند؟" -msgid "First, you need to make sure that your command window recognises the word \"py\" as an instruction to start the interpreter. If you have opened a command window, you should try entering the command ``py`` and hitting return:" +msgid "" +"First, you need to make sure that your command window recognises the word " +"\"py\" as an instruction to start the interpreter. If you have opened a " +"command window, you should try entering the command ``py`` and hitting " +"return:" msgstr "" +"ابتدا باید اطمینان حاصل کنید که پنجره خط فرمان شما واژه «py» را به‌عنوان " +"دستوری برای راه‌اندازی مفسر می‌شناسد. اگر یک پنجره خط فرمان باز کرده‌اید، " +"باید فرمان ``py`` را وارد کرده و کلید بازگشت را بزنید:" msgid "C:\\Users\\YourName> py" -msgstr "" +msgstr "C:\\Users\\YourName> py" msgid "You should then see something like:" -msgstr "" +msgstr "سپس باید چیزی شبیه به این ببینید:" msgid "" "Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32\n" "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n" ">>>" msgstr "" +"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n" +">>>" -msgid "You have started the interpreter in \"interactive mode\". That means you can enter Python statements or expressions interactively and have them executed or evaluated while you wait. This is one of Python's strongest features. Check it by entering a few expressions of your choice and seeing the results:" -msgstr "" +msgid "" +"You have started the interpreter in \"interactive mode\". That means you can" +" enter Python statements or expressions interactively and have them executed" +" or evaluated while you wait. This is one of Python's strongest features. " +"Check it by entering a few expressions of your choice and seeing the " +"results:" +msgstr "" +"شما مفسر را در «حالت تعاملی» راه‌اندازی کرده‌اید. این بدان معناست که " +"می‌توانید دستورها یا عبارت‌های Python را به‌صورت تعاملی وارد کنید و در حالی " +"که منتظر می‌مانید، آن‌ها اجرا یا ارزیابی شوند. این یکی از قوی‌ترین ویژگی‌های" +" Python است. با وارد کردن چند عبارت دلخواه خود و دیدن نتایج، آن را بررسی " +"کنید:" msgid "" ">>> print(\"Hello\")\n" @@ -78,83 +134,261 @@ msgid "" ">>> \"Hello\" * 3\n" "'HelloHelloHello'" msgstr "" +">>> print(\"Hello\")\n" +"Hello\n" +">>> \"Hello\" * 3\n" +"'HelloHelloHello'" -msgid "Many people use the interactive mode as a convenient yet highly programmable calculator. When you want to end your interactive Python session, call the :func:`exit` function or hold the :kbd:`Ctrl` key down while you enter a :kbd:`Z`, then hit the \":kbd:`Enter`\" key to get back to your Windows command prompt." -msgstr "" +msgid "" +"Many people use the interactive mode as a convenient yet highly programmable" +" calculator. When you want to end your interactive Python session, call the" +" :func:`exit` function or hold the :kbd:`Ctrl` key down while you enter a " +":kbd:`Z`, then hit the \":kbd:`Enter`\" key to get back to your Windows " +"command prompt." +msgstr "" +"بسیاری از افراد از حالت تعاملی به‌عنوان ماشین‌حسابی راحت و در عین حال بسیار " +"برنامه‌پذیر استفاده می‌کنند. هنگامی که می‌خواهید نشست تعاملی پایتون خود را " +"پایان دهید، تابع :func:`exit` را فراخوانی کنید یا کلید :kbd:`Ctrl` را پایین " +"نگه دارید و همزمان :kbd:`Z` را وارد کنید، سپس کلید \":kbd:`Enter`\" را فشار" +" دهید تا به خط فرمان ویندوز خود بازگردید." -msgid "You may also find that you have a Start-menu entry such as :menuselection:`Start --> Programs --> Python 3.x --> Python (command line)` that results in you seeing the ``>>>`` prompt in a new window. If so, the window will disappear after you call the :func:`exit` function or enter the :kbd:`Ctrl-Z` character; Windows is running a single \"python\" command in the window, and closes it when you terminate the interpreter." -msgstr "" +msgid "" +"You may also find that you have a Start-menu entry such as " +":menuselection:`Start --> Programs --> Python 3.x --> Python (command line)`" +" that results in you seeing the ``>>>`` prompt in a new window. If so, the " +"window will disappear after you call the :func:`exit` function or enter the " +":kbd:`Ctrl-Z` character; Windows is running a single \"python\" command in " +"the window, and closes it when you terminate the interpreter." +msgstr "" +"ممکن است همچنین یک ورودی منوی Start مانند :menuselection:`Start --> Programs" +" --> Python 3.x --> Python (command line)` داشته باشید که باعث می‌شود اعلان " +"``>>>`` را در پنجره‌ای جدید ببینید. در این صورت، پنجره پس از اینکه تابع " +":func:`exit` را فراخوانی کنید یا نویسه‌ی :kbd:`Ctrl-Z` را وارد کنید ناپدید " +"خواهد شد؛ ویندوز در حال اجرای یک فرمان \"python\" واحد در پنجره است و هنگامی" +" که مفسر را خاتمه دهید، آن را می‌بندد." -msgid "Now that we know the ``py`` command is recognized, you can give your Python script to it. You'll have to give either an absolute or a relative path to the Python script. Let's say your Python script is located in your desktop and is named ``hello.py``, and your command prompt is nicely opened in your home directory so you're seeing something similar to::" -msgstr "" +msgid "" +"Now that we know the ``py`` command is recognized, you can give your Python " +"script to it. You'll have to give either an absolute or a relative path to " +"the Python script. Let's say your Python script is located in your desktop " +"and is named ``hello.py``, and your command prompt is nicely opened in your " +"home directory so you're seeing something similar to::" +msgstr "" +"اکنون که می‌دانیم دستور ``py`` شناخته می‌شود، می‌توانید اسکریپت پایتون خود " +"را به آن بدهید. شما باید مسیر مطلق یا نسبی اسکریپت پایتون را به آن بدهید. " +"فرض کنید اسکریپت پایتون شما روی دسکتاپ شما قرار دارد و نام آن ``hello.py`` " +"است، و خط فرمان شما به‌خوبی در پوشه خانه شما باز است، بنابراین چیزی مشابه " +"زیر را می‌بینید::" msgid "C:\\Users\\YourName>" -msgstr "" +msgstr "C:\\Users\\YourName>" -msgid "So now you'll ask the ``py`` command to give your script to Python by typing ``py`` followed by your script path::" +msgid "" +"So now you'll ask the ``py`` command to give your script to Python by typing" +" ``py`` followed by your script path::" msgstr "" +"بنابراین اکنون با تایپ ``py`` و سپس مسیر اسکریپت‌تان، از دستور ``py`` " +"می‌خواهید که اسکریپت شما را به پایتون بدهد::" msgid "" "C:\\Users\\YourName> py Desktop\\hello.py\n" "hello" msgstr "" +"C:\\Users\\YourName> py Desktop\\hello.py\n" +"hello" msgid "How do I make Python scripts executable?" -msgstr "" +msgstr "چگونه اسکریپت‌های پایتون را قابل‌اجرا کنم؟" -msgid "On Windows, the standard Python installer already associates the .py extension with a file type (Python.File) and gives that file type an open command that runs the interpreter (``D:\\Program Files\\Python\\python.exe \"%1\" %*``). This is enough to make scripts executable from the command prompt as 'foo.py'. If you'd rather be able to execute the script by simple typing 'foo' with no extension you need to add .py to the PATHEXT environment variable." -msgstr "" +msgid "" +"On Windows, the standard Python installer already associates the .py " +"extension with a file type (Python.File) and gives that file type an open " +"command that runs the interpreter (``D:\\Program Files\\Python\\python.exe " +"\"%1\" %*``). This is enough to make scripts executable from the command " +"prompt as 'foo.py'. If you'd rather be able to execute the script by simple" +" typing 'foo' with no extension you need to add .py to the PATHEXT " +"environment variable." +msgstr "" +"در ویندوز، نصب‌کننده استاندارد پایتون از قبل پسوند .py را به یک نوع فایل " +"(Python.File) مرتبط می‌کند و به آن نوع فایل یک دستور باز کردن می‌دهد که مفسر" +" را اجرا می‌کند (``D:\\Program Files\\Python\\python.exe \"%1\" %*``). این " +"کافی است تا اسکریپت‌ها از خط فرمان به‌صورت 'foo.py' قابل اجرا شوند. اگر " +"ترجیح می‌دهید بتوانید اسکریپت را صرفاً با تایپ 'foo' بدون پسوند اجرا کنید، " +"باید .py را به متغیر محیطی PATHEXT اضافه کنید." msgid "Why does Python sometimes take so long to start?" -msgstr "" +msgstr "چرا راه‌اندازی پایتون گاهی اوقات این‌قدر طول می‌کشد؟" -msgid "Usually Python starts very quickly on Windows, but occasionally there are bug reports that Python suddenly begins to take a long time to start up. This is made even more puzzling because Python will work fine on other Windows systems which appear to be configured identically." +msgid "" +"Usually Python starts very quickly on Windows, but occasionally there are " +"bug reports that Python suddenly begins to take a long time to start up. " +"This is made even more puzzling because Python will work fine on other " +"Windows systems which appear to be configured identically." msgstr "" +"معمولاً پایتون در ویندوز بسیار سریع راه‌اندازی می‌شود، اما گاهی گزارش‌هایی " +"از اشکال وجود دارد که راه‌اندازی پایتون ناگهان زمان‌بر می‌شود. این موضوع حتی" +" گیج‌کننده‌تر می‌شود، زیرا پایتون در سایر سیستم‌های ویندوزی که به نظر می‌رسد" +" پیکربندی یکسانی دارند، به‌خوبی کار می‌کند." -msgid "The problem may be caused by a misconfiguration of virus checking software on the problem machine. Some virus scanners have been known to introduce startup overhead of two orders of magnitude when the scanner is configured to monitor all reads from the filesystem. Try checking the configuration of virus scanning software on your systems to ensure that they are indeed configured identically. McAfee, when configured to scan all file system read activity, is a particular offender." -msgstr "" +msgid "" +"The problem may be caused by a misconfiguration of virus checking software " +"on the problem machine. Some virus scanners have been known to introduce " +"startup overhead of two orders of magnitude when the scanner is configured " +"to monitor all reads from the filesystem. Try checking the configuration of" +" virus scanning software on your systems to ensure that they are indeed " +"configured identically. McAfee, when configured to scan all file system read" +" activity, is a particular offender." +msgstr "" +"ممکن است این مشکل به دلیل پیکربندی نادرست نرم‌افزار ضدویروس روی سیستم " +"مشکل‌دار باشد. شناخته شده است که برخی اسکنرهای ضدویروس، وقتی اسکنر برای پایش" +" تمام خواندن‌ها از فایل سیستم پیکربندی شود، سربار راه‌اندازی را تا ۲ مرتبه " +"بزرگی افزایش می‌دهند. پیکربندی نرم‌افزار اسکن ضدویروس روی سیستم‌های خود را " +"بررسی کنید تا اطمینان حاصل شود که واقعاً به‌طور یکسان پیکربندی شده‌اند. " +"McAfee، وقتی برای اسکن تمام فعالیت‌های خواندن فایل سیستم پیکربندی شود، " +"به‌طور ویژه‌ای مشکل‌ساز است." msgid "How do I make an executable from a Python script?" -msgstr "" +msgstr "چگونه از یک اسکریپت پایتون یک فایل اجرایی بسازم؟" -msgid "See :ref:`faq-create-standalone-binary` for a list of tools that can be used to make executables." +msgid "" +"See :ref:`faq-create-standalone-binary` for a list of tools that can be used" +" to make executables." msgstr "" +"برای فهرستی از ابزارهایی که می‌توان برای ساخت فایل‌های اجرایی از آن‌ها " +"استفاده کرد، :ref:`faq-create-standalone-binary` را ببینید." msgid "Is a ``*.pyd`` file the same as a DLL?" -msgstr "" +msgstr "آیا فایل ``*.pyd`` همان DLL است؟" -msgid "Yes, .pyd files are dll's, but there are a few differences. If you have a DLL named ``foo.pyd``, then it must have a function ``PyInit_foo()``. You can then write Python \"import foo\", and Python will search for foo.pyd (as well as foo.py, foo.pyc) and if it finds it, will attempt to call ``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, as that would cause Windows to require the DLL to be present." -msgstr "" +msgid "" +"Yes, .pyd files are dll's, but there are a few differences. If you have a " +"DLL named ``foo.pyd``, then it must have a function ``PyInit_foo()``. You " +"can then write Python \"import foo\", and Python will search for foo.pyd (as" +" well as foo.py, foo.pyc) and if it finds it, will attempt to call " +"``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, " +"as that would cause Windows to require the DLL to be present." +msgstr "" +"بله، فایل‌های .pyd، DLL هستند، اما چند تفاوت وجود دارد. اگر یک DLL با نام " +"``foo.pyd`` دارید، باید تابعی به نام ``PyInit_foo()`` داشته باشد. سپس " +"می‌توانید در پایتون «import foo» را بنویسید، و پایتون foo.pyd (و همچنین " +"foo.py و foo.pyc) را جستجو می‌کند و در صورت یافتن آن، تلاش می‌کند " +"``PyInit_foo()`` را فراخوانی کند تا آن را مقداردهی اولیه کند. شما فایل .exe " +"خود را با foo.lib پیوند نمی‌دهید، زیرا این کار باعث می‌شود ویندوز نیازمند " +"موجود بودن DLL باشد." -msgid "Note that the search path for foo.pyd is PYTHONPATH, not the same as the path that Windows uses to search for foo.dll. Also, foo.pyd need not be present to run your program, whereas if you linked your program with a dll, the dll is required. Of course, foo.pyd is required if you want to say ``import foo``. In a DLL, linkage is declared in the source code with ``__declspec(dllexport)``. In a .pyd, linkage is defined in a list of available functions." -msgstr "" +msgid "" +"Note that the search path for foo.pyd is PYTHONPATH, not the same as the " +"path that Windows uses to search for foo.dll. Also, foo.pyd need not be " +"present to run your program, whereas if you linked your program with a dll, " +"the dll is required. Of course, foo.pyd is required if you want to say " +"``import foo``. In a DLL, linkage is declared in the source code with " +"``__declspec(dllexport)``. In a .pyd, linkage is defined in a list of " +"available functions." +msgstr "" +"توجه داشته باشید که مسیر جستجو برای foo.pyd، PYTHONPATH است و با مسیری که " +"ویندوز برای جستجوی foo.dll از آن استفاده می‌کند، یکسان نیست. همچنین، برای " +"اجرای برنامه‌تان لازم نیست foo.pyd وجود داشته باشد، در حالی که اگر " +"برنامه‌تان را با یک DLL پیوند داده باشید، آن DLL مورد نیاز است. البته، اگر " +"بخواهید ``import foo`` را بنویسید، foo.pyd مورد نیاز است. در یک DLL، پیوند " +"در کد منبع با ``__declspec(dllexport)`` اعلام می‌شود. در یک .pyd، پیوند در " +"فهرستی از توابع موجود تعریف می‌شود." msgid "How can I embed Python into a Windows application?" -msgstr "" +msgstr "چگونه می‌توانم پایتون را در یک برنامه ویندوزی جاسازی کنم؟" -msgid "Embedding the Python interpreter in a Windows app can be summarized as follows:" +msgid "" +"Embedding the Python interpreter in a Windows app can be summarized as " +"follows:" msgstr "" +"جاسازی مفسر پایتون در یک برنامه ویندوزی را می‌توان به‌صورت زیر خلاصه کرد:" -msgid "Do **not** build Python into your .exe file directly. On Windows, Python must be a DLL to handle importing modules that are themselves DLL's. (This is the first key undocumented fact.) Instead, link to :file:`python{NN}.dll`; it is typically installed in ``C:\\Windows\\System``. *NN* is the Python version, a number such as \"33\" for Python 3.3." -msgstr "" +msgid "" +"Do **not** build Python into your .exe file directly. On Windows, Python " +"must be a DLL to handle importing modules that are themselves DLL's. (This " +"is the first key undocumented fact.) Instead, link to " +":file:`python{NN}.dll`; it is typically installed in " +"``C:\\Windows\\System``. *NN* is the Python version, a number such as " +"\"33\" for Python 3.3." +msgstr "" +"پایتون را مستقیماً در فایل .exe خود **قرار ندهید**. در ویندوز، پایتون باید " +"یک DLL باشد تا بتواند ایمپورت ماژول‌هایی را که خودشان DLL هستند مدیریت کند. " +"(این نخستین نکته کلیدی مستندنشده است.) در عوض، به :file:`python{NN}.dll` " +"پیوند دهید؛ این فایل معمولاً در ``C:\\Windows\\System`` نصب شده است. *NN* " +"نسخه پایتون است، عددی مانند «33» برای پایتون 3.3." -msgid "You can link to Python in two different ways. Load-time linking means linking against :file:`python{NN}.lib`, while run-time linking means linking against :file:`python{NN}.dll`. (General note: :file:`python{NN}.lib` is the so-called \"import lib\" corresponding to :file:`python{NN}.dll`. It merely defines symbols for the linker.)" -msgstr "" +msgid "" +"You can link to Python in two different ways. Load-time linking means " +"linking against :file:`python{NN}.lib`, while run-time linking means linking" +" against :file:`python{NN}.dll`. (General note: :file:`python{NN}.lib` is " +"the so-called \"import lib\" corresponding to :file:`python{NN}.dll`. It " +"merely defines symbols for the linker.)" +msgstr "" +"شما می‌توانید به دو روش مختلف به Python پیوند بدهید. پیوند در زمان بارگذاری " +"به معنای پیوند دادن با :file:`python{NN}.lib` است، در حالی که پیوند در " +"ران‌تایم به معنای پیوند دادن با :file:`python{NN}.dll` است. (نکته عمومی: " +":file:`python{NN}.lib` به‌اصطلاح کتابخانه ایمپورت (import lib) متناظر با " +":file:`python{NN}.dll` است. این فایل صرفاً نمادها را برای پیونددهنده " +"(linker) تعریف می‌کند.)" -msgid "Run-time linking greatly simplifies link options; everything happens at run time. Your code must load :file:`python{NN}.dll` using the Windows ``LoadLibraryEx()`` routine. The code must also use access routines and data in :file:`python{NN}.dll` (that is, Python's C API's) using pointers obtained by the Windows ``GetProcAddress()`` routine. Macros can make using these pointers transparent to any C code that calls routines in Python's C API." -msgstr "" +msgid "" +"Run-time linking greatly simplifies link options; everything happens at run " +"time. Your code must load :file:`python{NN}.dll` using the Windows " +"``LoadLibraryEx()`` routine. The code must also use access routines and " +"data in :file:`python{NN}.dll` (that is, Python's C API's) using pointers " +"obtained by the Windows ``GetProcAddress()`` routine. Macros can make using" +" these pointers transparent to any C code that calls routines in Python's C " +"API." +msgstr "" +"پیوندسازی در ران‌تایم، گزینه‌های پیوند را به‌طور چشمگیری ساده می‌کند؛ " +"همه‌چیز در ران‌تایم اتفاق می‌افتد. کد شما باید :file:`python{NN}.dll` را با " +"استفاده از روتین ``LoadLibraryEx()`` ویندوز بارگذاری کند. این کد همچنین باید" +" از روتین‌های دسترسی و داده‌های موجود در :file:`python{NN}.dll` (یعنی API C " +"پایتون) از طریق اشاره‌گرهای دریافت‌شده از روتین ``GetProcAddress()`` ویندوز " +"استفاده کند. ماکروها می‌توانند استفاده از این اشاره‌گرها را برای هر کد C که " +"روتین‌های API C پایتون را فراخوانی می‌کند، شفاف کنند." -msgid "If you use SWIG, it is easy to create a Python \"extension module\" that will make the app's data and methods available to Python. SWIG will handle just about all the grungy details for you. The result is C code that you link *into* your .exe file (!) You do **not** have to create a DLL file, and this also simplifies linking." -msgstr "" +msgid "" +"If you use SWIG, it is easy to create a Python \"extension module\" that " +"will make the app's data and methods available to Python. SWIG will handle " +"just about all the grungy details for you. The result is C code that you " +"link *into* your .exe file (!) You do **not** have to create a DLL file, " +"and this also simplifies linking." +msgstr "" +"اگر از SWIG استفاده کنید، ایجاد یک «ماژول توسعه‌ای» (extension module) برای " +"پایتون آسان است که داده‌ها و متدهای برنامه را در دسترس پایتون قرار می‌دهد. " +"SWIG تقریباً تمام جزئیات ناخوشایند را برای شما مدیریت می‌کند. نتیجه کد C است" +" که شما آن را *به درون* فایل .exe خود پیوند می‌دهید (!) شما **نیازی** به " +"ایجاد یک فایل DLL ندارید، و این موضوع نیز پیوند دادن را ساده‌تر می‌کند." -msgid "SWIG will create an init function (a C function) whose name depends on the name of the extension module. For example, if the name of the module is leo, the init function will be called initleo(). If you use SWIG shadow classes, as you should, the init function will be called initleoc(). This initializes a mostly hidden helper class used by the shadow class." -msgstr "" +msgid "" +"SWIG will create an init function (a C function) whose name depends on the " +"name of the extension module. For example, if the name of the module is " +"leo, the init function will be called initleo(). If you use SWIG shadow " +"classes, as you should, the init function will be called initleoc(). This " +"initializes a mostly hidden helper class used by the shadow class." +msgstr "" +"SWIG یک تابع مقداردهی اولیه (یک تابع C) ایجاد می‌کند که نام آن به نام ماژول " +"الحاقی بستگی دارد. برای مثال، اگر نام ماژول leo باشد، تابع مقداردهی اولیه با" +" نام initleo() خواهد بود. اگر از کلاس‌های سایه SWIG (shadow classes) استفاده" +" کنید، همان‌طور که باید، تابع مقداردهی اولیه با نام initleoc() خواهد بود. " +"این تابع یک کلاس کمکی عمدتاً پنهان را مقداردهی اولیه می‌کند که توسط کلاس " +"سایه استفاده می‌شود." -msgid "The reason you can link the C code in step 2 into your .exe file is that calling the initialization function is equivalent to importing the module into Python! (This is the second key undocumented fact.)" +msgid "" +"The reason you can link the C code in step 2 into your .exe file is that " +"calling the initialization function is equivalent to importing the module " +"into Python! (This is the second key undocumented fact.)" msgstr "" +"دلیل اینکه می‌توانید کد C را در مرحله‌ی ۲ به فایل .exe خود پیوند دهید این است" +" که فراخوانی تابع مقداردهی اولیه معادل ایمپورت کردن ماژول به پایتون است! " +"(این دومین واقعیت کلیدی مستندنشده است.)" -msgid "In short, you can use the following code to initialize the Python interpreter with your extension module." +msgid "" +"In short, you can use the following code to initialize the Python " +"interpreter with your extension module." msgstr "" +"به‌طور خلاصه، می‌توانید از کد زیر برای مقداردهی اولیه مفسر پایتون با ماژول " +"توسعه‌ای خود استفاده کنید." msgid "" "#include \n" @@ -163,54 +397,146 @@ msgid "" "initmyAppc(); // Initialize (import) the helper class.\n" "PyRun_SimpleString(\"import myApp\"); // Import the shadow class." msgstr "" +"#include \n" +"...\n" +"Py_Initialize(); // Initialize Python.\n" +"initmyAppc(); // Initialize (import) the helper class.\n" +"PyRun_SimpleString(\"import myApp\"); // Import the shadow class." -msgid "There are two problems with Python's C API which will become apparent if you use a compiler other than MSVC, the compiler used to build pythonNN.dll." +msgid "" +"There are two problems with Python's C API which will become apparent if you" +" use a compiler other than MSVC, the compiler used to build pythonNN.dll." msgstr "" +"دو مشکل در C API پایتون وجود دارد که اگر از کامپایلری غیر از MSVC، کامپایلری" +" که برای ساخت pythonNN.dll استفاده شده است، استفاده کنید، آشکار خواهند شد." -msgid "Problem 1: The so-called \"Very High Level\" functions that take ``FILE *`` arguments will not work in a multi-compiler environment because each compiler's notion of a ``struct FILE`` will be different. From an implementation standpoint these are very low level functions." +msgid "" +"Problem 1: The so-called \"Very High Level\" functions that take ``FILE *`` " +"arguments will not work in a multi-compiler environment because each " +"compiler's notion of a ``struct FILE`` will be different. From an " +"implementation standpoint these are very low level functions." msgstr "" +"مشکل ۱: به‌اصطلاح توابع «بسیار سطح بالا» که آرگومان‌های ``FILE *`` می‌گیرند،" +" در محیطی با چند کامپایلر کار نخواهند کرد، زیرا درک هر کامپایلر از ``struct " +"FILE`` متفاوت خواهد بود. از دیدگاه پیاده‌سازی، این‌ها توابع بسیار سطح پایینی" +" هستند." -msgid "Problem 2: SWIG generates the following code when generating wrappers to void functions:" +msgid "" +"Problem 2: SWIG generates the following code when generating wrappers to " +"void functions:" msgstr "" +"مشکل ۲: SWIG هنگام تولید پوشش‌ها برای توابع void، کد زیر را تولید می‌کند:" msgid "" "Py_INCREF(Py_None);\n" "_resultobj = Py_None;\n" "return _resultobj;" msgstr "" +"Py_INCREF(Py_None);\n" +"_resultobj = Py_None;\n" +"return _resultobj;" -msgid "Alas, Py_None is a macro that expands to a reference to a complex data structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will fail in a mult-compiler environment. Replace such code by:" +msgid "" +"Alas, Py_None is a macro that expands to a reference to a complex data " +"structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " +"fail in a mult-compiler environment. Replace such code by:" msgstr "" +"متأسفانه، Py_None یک ماکرو است که به ارجاعی به یک ساختار داده پیچیده به نام " +"_Py_NoneStruct در pythonNN.dll بسط می‌یابد. باز هم، این کد در یک محیط " +"چندکامپایلری شکست خواهد خورد. چنین کدی را با این جایگزین کنید:" msgid "return Py_BuildValue(\"\");" -msgstr "" +msgstr "return Py_BuildValue(\"\");" -msgid "It may be possible to use SWIG's ``%typemap`` command to make the change automatically, though I have not been able to get this to work (I'm a complete SWIG newbie)." +msgid "" +"It may be possible to use SWIG's ``%typemap`` command to make the change " +"automatically, though I have not been able to get this to work (I'm a " +"complete SWIG newbie)." msgstr "" +"ممکن است بتوان از دستور ``%typemap`` مربوط به SWIG برای ایجاد تغییر به‌صورت " +"خودکار استفاده کرد، هرچند من نتوانسته‌ام آن را به کار بیندازم (من در SWIG " +"کاملاً تازه‌کار هستم)." -msgid "Using a Python shell script to put up a Python interpreter window from inside your Windows app is not a good idea; the resulting window will be independent of your app's windowing system. Rather, you (or the wxPythonWindow class) should create a \"native\" interpreter window. It is easy to connect that window to the Python interpreter. You can redirect Python's i/o to _any_ object that supports read and write, so all you need is a Python object (defined in your extension module) that contains read() and write() methods." -msgstr "" +msgid "" +"Using a Python shell script to put up a Python interpreter window from " +"inside your Windows app is not a good idea; the resulting window will be " +"independent of your app's windowing system. Rather, you (or the " +"wxPythonWindow class) should create a \"native\" interpreter window. It is " +"easy to connect that window to the Python interpreter. You can redirect " +"Python's i/o to _any_ object that supports read and write, so all you need " +"is a Python object (defined in your extension module) that contains read() " +"and write() methods." +msgstr "" +"استفاده از یک اسکریپت پوسته پایتون برای باز کردن یک پنجره‌ی مفسر پایتون از " +"داخل برنامه‌ی ویندوزی شما ایده‌ی خوبی نیست؛ پنجره‌ی حاصل، مستقل از سیستم " +"پنجره‌بندی برنامه‌ی شما خواهد بود. در عوض، شما (یا کلاس wxPythonWindow) باید" +" یک پنجره‌ی مفسر «بومی» ایجاد کنید. اتصال آن پنجره به مفسر پایتون آسان است. " +"شما می‌توانید ورودی/خروجی پایتون را به _هر_ شیء که از read و write پشتیبانی " +"می‌کند تغییر مسیر دهید، بنابراین تنها چیزی که نیاز دارید، یک شیء پایتون " +"(تعریف‌شده در ماژول توسعه شما) است که شامل متدهای read() و write() باشد." msgid "How do I keep editors from inserting tabs into my Python source?" -msgstr "" +msgstr "چگونه از درج تب‌ها توسط ویرایشگرها در کد منبع پایتون خود جلوگیری کنم؟" -msgid "The FAQ does not recommend using tabs, and the Python style guide, :pep:`8`, recommends 4 spaces for distributed Python code; this is also the Emacs python-mode default." +msgid "" +"The FAQ does not recommend using tabs, and the Python style guide, :pep:`8`," +" recommends 4 spaces for distributed Python code; this is also the Emacs " +"python-mode default." msgstr "" +"در پرسش‌های متداول (FAQ)، استفاده از تب‌ها توصیه نمی‌شود، و راهنمای سبک " +"پایتون، :pep:`8`، برای کد پایتون توزیع‌شده ۴ فاصله را توصیه می‌کند؛ این، " +"پیش‌فرض python-mode در Emacs نیز هست." -msgid "Under any editor, mixing tabs and spaces is a bad idea. MSVC is no different in this respect, and is easily configured to use spaces: Take :menuselection:`Tools --> Options --> Tabs`, and for file type \"Default\" set \"Tab size\" and \"Indent size\" to 4, and select the \"Insert spaces\" radio button." -msgstr "" +msgid "" +"Under any editor, mixing tabs and spaces is a bad idea. MSVC is no " +"different in this respect, and is easily configured to use spaces: Take " +":menuselection:`Tools --> Options --> Tabs`, and for file type \"Default\" " +"set \"Tab size\" and \"Indent size\" to 4, and select the \"Insert spaces\" " +"radio button." +msgstr "" +"در هر ویرایشگری، ترکیب تب‌ها و فاصله‌ها ایده خوبی نیست. MSVC در این زمینه " +"تفاوتی ندارد و به‌راحتی برای استفاده از فاصله‌ها پیکربندی می‌شود: " +":menuselection:`Tools --> Options --> Tabs` را انتخاب کنید، و برای نوع فایل " +"\"Default\" مقادیر \"Tab size\" و \"Indent size\" را روی ۴ تنظیم کنید و دکمه" +" رادیویی \"Insert spaces\" را انتخاب کنید." -msgid "Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs and spaces are causing problems in leading whitespace. You may also run the :mod:`tabnanny` module to check a directory tree in batch mode." +msgid "" +"Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs and " +"spaces are causing problems in leading whitespace. You may also run the " +":mod:`tabnanny` module to check a directory tree in batch mode." msgstr "" +"پایتون در صورتی که ترکیبی از تب‌ها و فاصله‌ها در فضای سفید ابتدایی مشکل " +"ایجاد کند، :exc:`IndentationError` یا :exc:`TabError` را پرتاب می‌کند. " +"همچنین می‌توانید ماژول :mod:`tabnanny` را برای بررسی یک درخت پوشه در حالت " +"دسته‌ای اجرا کنید." msgid "How do I check for a keypress without blocking?" -msgstr "" +msgstr "چگونه بدون مسدود شدن، فشردن یک کلید را بررسی کنم؟" -msgid "Use the :mod:`msvcrt` module. This is a standard Windows-specific extension module. It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it." +msgid "" +"Use the :mod:`msvcrt` module. This is a standard Windows-specific extension" +" module. It defines a function ``kbhit()`` which checks whether a keyboard " +"hit is present, and ``getch()`` which gets one character without echoing it." msgstr "" +"از ماژول :mod:`msvcrt` استفاده کنید. این یک ماژول توسعه‌ای استاندارد مختص " +"ویندوز است. این ماژول تابع ``kbhit()`` را تعریف می‌کند که بررسی می‌کند آیا " +"ضربه‌ای به صفحه‌کلید وارد شده است یا خیر، و ``getch()`` که یک نویسه را بدون " +"بازتاب آن دریافت می‌کند." msgid "How do I solve the missing api-ms-win-crt-runtime-l1-1-0.dll error?" -msgstr "" +msgstr "چگونه خطای نبود api-ms-win-crt-runtime-l1-1-0.dll را برطرف کنم؟" -msgid "This can occur on Python 3.5 and later when using Windows 8.1 or earlier without all updates having been installed. First ensure your operating system is supported and is up to date, and if that does not resolve the issue, visit the `Microsoft support page `_ for guidance on manually installing the C Runtime update." -msgstr "" +msgid "" +"This can occur on Python 3.5 and later when using Windows 8.1 or earlier " +"without all updates having been installed. First ensure your operating " +"system is supported and is up to date, and if that does not resolve the " +"issue, visit the `Microsoft support page `_ for guidance on manually installing the C Runtime " +"update." +msgstr "" +"این موضوع ممکن است در پایتون 3.5 و نسخه‌های جدیدتر، هنگام استفاده از ویندوز " +"8.1 یا نسخه‌های قدیمی‌تر بدون نصب همه به‌روزرسانی‌ها رخ دهد. ابتدا اطمینان " +"حاصل کنید که سیستم‌عامل شما پشتیبانی می‌شود و به‌روز است، و اگر این کار مشکل" +" را حل نکرد، برای راهنمایی درباره نصب دستی به‌روزرسانی C Runtime، به `صفحه " +"پشتیبانی مایکروسافت `_ " +"مراجعه کنید." diff --git a/glossary.json b/glossary.json new file mode 100644 index 000000000..f68d858c4 --- /dev/null +++ b/glossary.json @@ -0,0 +1,488 @@ +{ + "__pycache__": "__pycache__", + "ABC": "کلاس پایه انتزاعی", + "abstract base class": "کلاس پایه انتزاعی", + "accessibility": "دسترسی‌پذیری", + "action": "اکشن، کنش", + "anchor": "لنگر", + "annotate": "حاشیه‌نویسی کردن", + "annotation": "حاشیه‌نویسی", + "API": "API", + "argument": "آرگومان", + "ASCII": "اسکی", + "assertion": "ادعا، شرط", + "async": "ناهمگام، غیرهمگام", + "asynchronous context manager": "مدیر زمینه ناهمگام", + "asynchronous generator": "تولیدگر ناهمگام", + "asynchronous iterable": "پیمایش‌پذیر ناهمگام", + "asynchronous iterator": "پیمایش‌گر ناهمگام", + "attribute": "ویژگی، صفت، شاخصه", + "attribute reference": "ارجاع به ویژگی", + "audit": "حسابرسی", + "autospeccing": "مشخصه‌گذاری خودکار", + "availability": "دسترس‌پذیری", + "await": "await", + "awaitable": "انتظارپذیر، awaitable", + "backend": "بک‌اند", + "backreference": "بازارجاع", + "backslash": "بک‌اسلش", + "backspace": "بک‌اسپیس، پس‌بر", + "barrier": "سد", + "BDFL": "BDFL (دیکتاتور خیرخواه مادام‌العمر)", + "big-endian": "بزرگ‌اندیان", + "binary": "دودویی", + "binary file": "پرونده دودویی", + "bind": "مقید کردن", + "bitmap": "بیت‌مپ", + "bitmask": "نقاب بیتی", + "bitwise mask": "نقاب بیتی", + "blob": "بلاب", + "boilerplate": "کد پیش‌ساخته، متن قالبی", + "bom, byte-order mark": "نشانگر ترتیب بایت", + "boolean": "بولی", + "bootstrapping": "بوت‌استرپینگ", + "borrowed reference": "ارجاع امانتی", + "bot": "بات", + "bottom tee": "tee پایین", + "bounding box": "جعبه‌ی محدودکننده", + "bound": "کران", + "broadcast (network/event)": "پخش", + "broadcasting (array)": "بسط‌دهی", + "buffer": "بافر", + "built-in": "توکار، درونی، درون‌ساخته", + "by-name": "نام‌محور", + "bytecode": "بایت‌کد", + "bytes-like object": "شیء شبه‌بایت", + "CA": "مرجع صدور گواهی", + "cache": "نهانگاه", + "calendar": "گاه‌شماری", + "callable": "فراخوانی‌پذیر", + "callback": "کال‌بک، فراخوانی بازگشتی", + "canonical": "کانونیکال", + "capture pattern": "الگوی ثبت‌کننده", + "capturing group": "گروه ثبت‌کننده", + "cardinality": "کاردینالیتی", + "carriage return": "بازگشت به ابتدای سطر", + "cast": "تبدیل نوع، قالب‌ریزی", + "certification": "گواهی‌سازی", + "certificate": "گواهی", + "character": "نویسه", + "checkbutton": "دکمه‌ی انتخابی", + "checksum": "جمع‌آزما", + "chunked": "بخش‌بندی‌شده", + "cipher": "رمز", + "class": "کلاس", + "class method": "متد کلاس", + "class variable": "متغیر کلاس", + "classmethod": "classmethod", + "CLI": "رابط خط فرمان، CLI", + "clone": "رونوشت", + "closure": "بستار", + "code point": "نقطه‌کد", + "coercion": "تبدیل ضمنی نوع", + "collation": "ترتیب‌گذاری", + "column": "ستون", + "combobox": "جعبه انتخاب", + "command line": "خط فرمان", + "comment": "کامنت", + "commit (database transaction)": "ثبت نهایی", + "community": "کامیونیتی", + "compile": "کامپایل", + "compiled": "کامپایل‌شده", + "component": "کامپوننت، جزء", + "container": "ظرف", + "context": "زمینه", + "context management": "مدیریت زمینه", + "context manager": "مدیر زمینه", + "context variable": "متغیر زمینه", + "contiguous": "پیوسته", + "contravariant": "پادوردا", + "converter": "مبدل", + "converter function": "تابع تبدیل‌کننده", + "coroutine": "هم‌روال", + "covariant": "هم‌وردا", + "CPU-bound": "محدود به CPU", + "CPython": "سی‌پایتون", + "crash": "فروپاشی", + "CRL": "فهرست لغو گواهی", + "cursor": "مکان‌نما", + "cursor (database)": "نشانگر", + "custom": "سفارشی، اختصاصی", + "daemon": "دِیمِن", + "dataclass": "دیتاکلاس", + "debugging": "اشکال‌زدایی، دیباگ کردن", + "decoding": "کدگشایی", + "decompressor": "واگشا", + "decorator": "دکوراتور، آراینده", + "deferred reference counting": "شمارش ارجاعِ معوق", + "delegation": "واگذاری", + "delta": "دلتا", + "dependency": "وابستگی", + "dependency resolution": "حل وابستگی", + "deprecated": "منسوخ، از رده خارج شده", + "deque": "صف دوطرفه", + "descriptor": "توصیف‌گر", + "deserialization": "سریال‌زدایی", + "deserialize": "سریال‌زدایی کردن", + "deserializer": "سریال‌زدا", + "dialect": "گویش", + "dictionary": "دیکشنری", + "dictionary comprehension": "درک دیکشنری", + "dictionary view": "نمای دیکشنری", + "directive": "دایرکتیو", + "directory": "پوشه", + "disassemble": "واسازی کردن", + "disassembler": "واساز", + "dispatch table": "جدول نگاشت", + "docstring": "رشته مستند", + "DOM": "DOM", + "double (double precision)": "ممیز شناور با دقت مضاعف", + "drop-in": "جایگزین مستقیم", + "duck-typing": "نوع‌دهی اردکی", + "dump": "برون‌ریزی", + "EAFP": "EAFP (بهتر است پوزش بخواهی تا اجازه)", + "ecosystem": "اکوسیستم", + "element": "المان، عنصر", + "ellipsis": "سه‌نقطه", + "Ellipsis": "Ellipsis", + "encoding": "کدگذاری", + "endian": "اندیان", + "endianness": "ترتیب بایت", + "endpoint": "پایانه", + "entitlement": "حق دسترسی", + "entity": "موجودیت", + "enum": "enum", + "envelope": "پاکت", + "EOF": "EOF، پایان پرونده", + "epoch": "مبدأ زمان", + "escape": "خنثی کردن، گریز", + "event": "رویداد", + "exception": "استثنا", + "executor": "اجراکننده", + "expression": "عبارت", + "extended hex alphabet": "الفبای مبنای شانزده‌ی توسعه‌یافته", + "extension module": "ماژول توسعه‌ای", + "extension types": "نوع‌های توسعه‌ای", + "f-string": "اف‌استرینگ", + "facility": "امکان، دسته گزارش", + "factory function": "تابع کارخانه‌ای", + "fallback": "جایگزین", + "file object": "شیء پرونده", + "file-like object": "شیء شبه‌پرونده", + "filesystem encoding": "کدگذاری فایل‌سیستم", + "finalizer": "نهایی‌ساز", + "finder": "یابنده", + "fixture": "ثابت آزمایشی", + "flattening": "تخت‌سازی", + "float (type)": "اعشاری", + "float (value)": "عدد اعشاری", + "floating point (adj., representation)": "ممیز شناور", + "floating-point arithmetic": "محاسبات ممیز شناور", + "floating-point number": "عدد ممیز شناور", + "floor division": "تقسیم کف", + "folding": "تا کردن", + "fork": "انشعاب، فورک", + "form feed": "تغذیه‌ی صفحه", + "formatter": "قالب‌بند", + "forward reference": "ارجاع پیشرو", + "free threading": "نخ‌بندی آزاد", + "free variable": "متغیر آزاد", + "free-threaded": "نخ‌آزاد", + "function": "تابع", + "function annotation": "حاشیه‌نویسی تابع", + "futures": "آینده‌نماها، فیوچرز", + "garbage collection": "زباله‌روبی", + "generator": "تولیدگر", + "generator expression": "عبارت تولیدگر", + "generic": "عام", + "generic function": "تابع عام، تابع عمومی", + "generic type": "نوع عام", + "GIL": "قفل مفسر سراسری", + "global": "سراسری، عمومی", + "guard": "نگهبان", + "handshake": "دست‌دهی", + "handle": "دسته", + "handler": "هندلر", + "hash-based pyc": "pyc مبتنی بر هش", + "hashable": "هش‌پذیر", + "header": "سرآیند", + "heap": "هیپ", + "hex": "مبنای شانزده", + "hexadecimal": "مبنای شانزده", + "hook": "قلاب", + "howto": "راهنمای عملی", + "IDE": "IDE, محیط توسعه یکپارچه", + "idempotent": "هم‌توان", + "IDN": "IDN، دامنه اینترنتی بین‌المللی", + "immortal": "نامیرا", + "immutable": "تغییرناپذیر", + "import": "ایمپورت", + "import path": "مسیر ایمپورت", + "importing": "ایمپورت کردن", + "index": "اندیس، شماره", + "inode": "آی‌نود", + "instance": "نمونه", + "integer": "عدد صحیح", + "interactive": "تعاملی", + "interface": "رابط", + "interpolation": "درون‌یابی", + "interpreted": "تفسیرشده", + "interpreter": "مفسر", + "invariant": "ناوردا", + "IPC": "ارتباط بین‌فرایندی", + "item": "آیتم", + "iterable": "پیمایش‌پذیر", + "iterate": "پیمایش کردن", + "iteration": "پیمایش", + "iterator": "پیمایش‌گر", + "join": "پیوستن، الحاق", + "junction": "اتصال", + "key function": "تابع کلید", + "keybinding": "کلیدبندی", + "keyword": "کلیدواژه", + "keyword argument": "آرگومان کلیدواژه‌ای", + "lambda": "لامبدا", + "LBYL": "LBYL (نگاه کن پیش از پریدن)", + "line": "سطر", + "line feed": "تغذیه‌ی سطر", + "list": "فهرست", + "list comprehension": "درک فهرستی", + "literal": "لفظی", + "literals": "مقادیر لفظی", + "little-endian": "کوچک‌اندیان", + "load": "بارگذاری", + "loader": "بارگذار", + "local": "محلی", + "locale": "locale", + "logger": "گزارش‌گیر", + "logging": "گزارش‌گیری", + "long distance matcher": "تطبیق‌گر فاصله بلند", + "lookahead assertion": "شرط پیش‌نگر", + "lookbehind assertion": "شرط پس‌نگر", + "loop": "حلقه", + "magic method": "متد ویژه", + "manager": "مدیر", + "map": "نگاشت", + "mapped": "نگاشت‌شده", + "mapping": "نگاشت", + "marshal": "مارشال‌کردن", + "marshaling/marshalling": "مارشالینگ", + "mask": "نقاب", + "master (pty)": "اصلی", + "match finder": "تطبیق‌یاب", + "max-heap": "هیپ بیشینه", + "meta path finder": "یابنده مسیر فرا", + "metaclass": "فراکلاس", + "method": "متد، روش", + "method resolution order (MRO)": "ترتیب حل متد", + "min-heap": "هیپ کمینه", + "mix-in": "میکس‌این", + "mixed-in": "افزوده‌شده، میکس‌این", + "mock": "ماک", + "mode": "حالت", + "module": "ماژول", + "module spec": "مشخصه ماژول", + "monkey-patch": "مانکی‌پچ", + "mutable": "تغییرپذیر", + "mutex": "قفل متقابل", + "name resolution": "حل نام", + "named tuple": "تاپل نام‌دار", + "namespace": "فضای نام", + "namespace package": "بسته فضای‌نام", + "NaN": "NaN", + "nested scope": "محدوده تودرتو", + "no-op": "عملیات بی‌اثر", + "non-capturing group": "گروه غیرثبت‌کننده", + "notation": "نمادگذاری، نماد", + "nul": "تهی", + "object": "شیء", + "octet": "هشت‌بیتی", + "offset": "آفست", + "opcode": "کدعمل", + "operator": "عملگر", + "optimized scope": "محدوده بهینه‌شده", + "ordinal": "ترتیبی", + "overload": "سربارگذاری", + "overloaded": "سربارگذاری‌شده", + "package": "بسته", + "padding": "پُرکننده، پدینگ", + "pane": "بخش", + "parallelism": "موازی‌سازی", + "parameter": "پارامتر", + "parser": "پارسر", + "patch": "وصل", + "path entry": "ورودی مسیر", + "path entry finder": "یابنده ورودی مسیر", + "path entry hook": "قلاب ورودی مسیر", + "path-based finder": "یابنده مبتنی بر مسیر", + "path-like object": "شیء شبه‌مسیر", + "pathname": "مسیرنام", + "payload": "بار", + "PEP": "PEP (پیشنهاد بهبود پایتون)", + "persistence": "ماندگاری", + "persistent": "پایا", + "picklable": "پیکل‌پذیر", + "pickle": "پیکل", + "pickler": "پیکل‌ساز", + "pipe": "پایپ", + "placeholder": "جای‌نگهدار", + "poll": "پایش", + "polling": "پایش", + "portion": "بخش", + "positional": "جایگاهی", + "positional argument": "آرگومان جایگاهی", + "post-mortem debugging": "اشکال‌زدایی پس از خاتمه", + "precision": "دقت", + "predicate": "محمول", + "process": "فرایند", + "process-local": "فرایندمحلی", + "process-safe": "فرایندایمن", + "profiler": "پروفایل‌گیر", + "profiling": "پروفایل‌گیری", + "proleptic Gregorian": "گاه‌شماری میلادی تعمیم‌یافته", + "prompt": "اعلان", + "property": "ویژگی، پراپرتی، خصوصیت", + "protocol": "پروتکل", + "prototype": "پیش‌نمونه", + "provisional API": "API آزمایشی", + "proxy": "پراکسی", + "pseudo-terminal": "شبه‌پایانه", + "qualified": "کامل", + "qualified name": "نام کامل", + "qualifier": "مشخص‌کننده", + "quantifier": "کمیت‌گذار", + "quotation": "علامت نقل‌قول", + "quoted-printable": "quoted-printable", + "race": "رقابت", + "realm": "قلمرو", + "reentrancy": "بازورودپذیری", + "reentrant": "بازورودپذیر", + "refcount": "شمارش ارجاع", + "reference": "ارجاع", + "reference counting": "شمارش ارجاع", + "register": "ثبت کردن", + "registry": "رجیستری", + "regular expression/RE": "عبارت باقاعده", + "regular package": "بسته معمولی", + "REPL": "REPL، پوسته تعاملی پایتون", + "resolution": "حل، وضوح", + "resolve": "حل کردن", + "return": "بازگشت، برگرداندن", + "reverse solidus": "اسلش معکوس", + "rollback": "بازگردانی", + "rollover": "چرخش", + "row": "ردیف", + "run time, run-time": "زمان اجرا", + "runtime": "ران‌تایم", + "salt": "نمک", + "sandbox": "سندباکس", + "sash": "نوار جداکننده", + "scheme": "طرح‌واره، طرح", + "scope": "محدوده", + "seal": "مهر و موم", + "seed": "بذر", + "seek": "مکان‌یابی کردن", + "seeking": "مکان‌یابی", + "segmentation fault": "خطای قطعه‌بندی (segmentation fault)", + "sentinel": "نشانگر", + "sequence": "دنباله", + "serialization": "سریال‌سازی", + "set": "مجموعه", + "set comprehension": "درک مجموعه", + "shadowing": "پوشاندن", + "shelf": "قفسه", + "shell": "پوسته", + "signal": "سیگنال", + "single dispatch": "ارسال تک‌گانه", + "single precision": "دقت منفرد", + "singleton": "تک‌نمونه", + "slave (pty)": "پیرو", + "sleep": "توقف", + "slice": "اسلایس", + "slot": "جایگاه", + "snapshot": "تصویر لحظه‌ای", + "spec": "مشخصات", + "special method": "متد ویژه", + "spinbox": "اسپین‌باکس", + "stack traceback": "ردگیری پشته", + "state": "وضعیت", + "statement": "دستور", + "static method": "متد ایستا", + "staticmethod": "staticmethod", + "stipple": "نقطه‌نگاری", + "string": "رشته", + "stringifier": "رشته‌ساز", + "struct sequence": "دنباله ساختاری", + "stub": "stub", + "subnormal": "زیرنرمال", + "subscript": "زیرنویس", + "subscription": "زیرنویسی", + "suite": "بدنه", + "surrogate": "جانشین", + "symlink": "پیوند نمادین", + "syntactic sugar": "قند نحوی", + "syntax": "سینتکس، نحو", + "t-string": "تی‌استرینگ", + "task": "وظیفه", + "test": "آزمون", + "test fixture": "ثابت آزمایشی", + "text encoding": "کدگذاری متن", + "text file": "پرونده متنی", + "thread": "نخ", + "thread-local": "نخ‌محلی", + "thread-safe": "نخ‌ایمن", + "time tuple": "تاپل زمانی", + "timeout": "مهلت زمانی", + "titlecase": "نگارش عنوان‌نویسی", + "titlecased": "عنوان‌نویسی‌شده", + "TLS": "TLS", + "token": "توکن", + "tokenizer": "توکن‌ساز", + "trace": "ردگیری", + "tracking": "پیگیری", + "trampoline": "ترامپولین", + "transcode": "بازکدگذاری کردن", + "transcoding": "بازکدگذاری", + "transformer": "تبدیل کننده", + "Transport Layer Security": "امنیت لایه انتقال", + "trap (catch/intercept)": "گرفتن، رهگیری کردن", + "trap (decimal signal mechanism)": "تله", + "treeview": "نمای درختی", + "triple-quoted string": "رشته سه‌نقل‌قولی", + "turtle": "turtle، لاک‌پشت", + "type": "نوع، نوع داده، تایپ", + "type alias": "مستعار نوع", + "type hint": "راهنمای نوع", + "typeahead": "پیش‌تایپ", + "unary": "یک‌عملوندی", + "undo buffer": "بافر لغو", + "unhashable": "هش‌ناپذیر", + "unicode": "یونیکد", + "unit test": "آزمون واحد", + "universal": "همگانی", + "universal newlines": "سطرهای جدید همگانی", + "unmarshal": "مارشال‌گشایی کردن", + "unmarshaling": "مارشال‌گشایی", + "unpacking": "واگشایی", + "unpacking assignments": "انتساب‌های واگشایی", + "unpickle": "پیکل‌گشایی", + "UTC": "UTC، زمان هماهنگ جهانی", + "value": "مقدار", + "variable": "متغیر", + "variable annotation": "حاشیه‌نویسی متغیر", + "view": "نما", + "virtual environment": "محیط مجازی", + "walrus operator": "عملگر گراز دریایی", + "weak reference": "ارجاع ضعیف", + "wide": "پهن", + "widget": "ابزارک", + "wildcard": "وایلدکارد", + "wrap": "پوشش دادن، دربرگرفتن", + "wrapper": "پوششی، دربرگیرنده", + "write-back": "بازنوشت", + "write-through": "نوشتن‌همزمان", + "zero-padded": "پرشده با صفر", + "zero-padding": "پدینگ صفر", + "zero-width assertion": "شرط با عرض صفر", + "zip application": "برنامه zip" +} \ No newline at end of file diff --git a/glossary.po b/glossary.po index e4bfe397f..5e5423722 100644 --- a/glossary.po +++ b/glossary.po @@ -33,8 +33,13 @@ msgstr "واژه‌نامه" msgid "``>>>``" msgstr "``>>>``" -msgid "The default Python prompt of the :term:`interactive` shell. Often seen for code examples which can be executed interactively in the interpreter." -msgstr "اعلان پیش‌فرض پایتون در پوستهٔ :term:`تعاملی `. اغلب برای نمونه‌های کدی دیده می‌شود که می‌توان آن‌ها را به‌صورت تعاملی در مفسر اجرا کرد." +msgid "" +"The default Python prompt of the :term:`interactive` shell. Often seen for " +"code examples which can be executed interactively in the interpreter." +msgstr "" +"اعلان پیش‌فرض پایتون در پوسته‌ی :term:`تعاملی `. اغلب برای " +"نمونه‌های کدی دیده می‌شود که می‌توان آن‌ها را به‌صورت تعاملی در مفسر اجرا " +"کرد." msgid "``...``" msgstr "``...``" @@ -42,44 +47,116 @@ msgstr "``...``" msgid "Can refer to:" msgstr "می‌تواند به موارد زیر اشاره کند:" -msgid "The default Python prompt of the :term:`interactive` shell when entering the code for an indented code block, when within a pair of matching left and right delimiters (parentheses, square brackets, curly braces or triple quotes), or after specifying a decorator." -msgstr "اعلان پیش‌فرض پایتون در پوستهٔ :term:`تعاملی ` هنگام وارد کردن کد برای یک بلوک کد تورفته، زمانی که درون یک جفت جداکنندهٔ چپ و راست متناظر (پرانتزها، کروشه‌ها، آکولادها یا علامت‌های نقل‌قول سه‌گانه) قرار دارید، یا پس از مشخص کردن یک دکوراتور." +msgid "" +"The default Python prompt of the :term:`interactive` shell when entering the" +" code for an indented code block, when within a pair of matching left and " +"right delimiters (parentheses, square brackets, curly braces or triple " +"quotes), or after specifying a decorator." +msgstr "" +"اعلان پیش‌فرض پایتون در پوسته‌ی :term:`تعاملی ` هنگام وارد کردن " +"کد برای یک بلوک کد تورفته، زمانی که درون یک جفت جداکننده‌ی چپ و راست متناظر " +"(پرانتزها، کروشه‌ها، آکولادها یا علامت‌های نقل‌قول سه‌گانه) قرار دارید، یا " +"پس از مشخص کردن یک دکوراتور." -msgid "The three dots form of the :ref:`Ellipsis ` object." +msgid "" +"The three dots form of the :ref:`Ellipsis ` object." msgstr "شکل سه‌نقطه‌ای شیء :ref:`Ellipsis `." msgid "abstract base class" -msgstr "کلاس پایهٔ انتزاعی" +msgstr "کلاس پایه‌ی انتزاعی" -msgid "Abstract base classes complement :term:`duck-typing` by providing a way to define interfaces when other techniques like :func:`hasattr` would be clumsy or subtly wrong (for example with :ref:`magic methods `). ABCs introduce virtual subclasses, which are classes that don't inherit from a class but are still recognized by :func:`isinstance` and :func:`issubclass`; see the :mod:`abc` module documentation. Python comes with many built-in ABCs for data structures (in the :mod:`collections.abc` module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` module), import finders and loaders (in the :mod:`importlib.abc` module). You can create your own ABCs with the :mod:`abc` module." -msgstr "کلاس‌های پایهٔ انتزاعی با فراهم کردن روشی برای تعریف رابط‌ها، زمانی که تکنیک‌های دیگری مانند :func:`hasattr` دست‌وپاگیر یا به‌طور ضمنی نادرست هستند (برای مثال با :ref:`magic methods `)، :term:`نوع‌دهی اردکی ` را تکمیل می‌کنند. ABCها زیرکلاس‌های مجازی معرفی می‌کنند، که کلاس‌هایی هستند که از یک کلاس دیگر به ارث نمی‌برند اما همچنان توسط :func:`isinstance` و :func:`issubclass` شناخته می‌شوند؛ مستندات ماژول :mod:`abc` را ببینید. پایتون همراه با ABCهای توکار بسیاری برای ساختارهای داده (در ماژول :mod:`collections.abc`)، اعداد (در ماژول :mod:`numbers`)، جریان‌ها (در ماژول :mod:`io`)، یابنده‌ها و بارگذارهای ایمپورت (در ماژول :mod:`importlib.abc`) ارائه می‌شود. شما می‌توانید ABCهای سفارشی خود را با ماژول :mod:`abc` ایجاد کنید." +msgid "" +"Abstract base classes complement :term:`duck-typing` by providing a way to " +"define interfaces when other techniques like :func:`hasattr` would be clumsy" +" or subtly wrong (for example with :ref:`magic methods `). " +"ABCs introduce virtual subclasses, which are classes that don't inherit from" +" a class but are still recognized by :func:`isinstance` and " +":func:`issubclass`; see the :mod:`abc` module documentation. Python comes " +"with many built-in ABCs for data structures (in the :mod:`collections.abc` " +"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " +"module), import finders and loaders (in the :mod:`importlib.abc` module). " +"You can create your own ABCs with the :mod:`abc` module." +msgstr "" +"کلاس‌های پایه‌ی انتزاعی با فراهم کردن روشی برای تعریف رابط‌ها، زمانی که " +"تکنیک‌های دیگری مانند :func:`hasattr` دست‌وپاگیر یا به‌طور ضمنی نادرست هستند" +" (برای مثال با :ref:`magic methods `)، :term:`نوع‌دهی اردکی " +"` را تکمیل می‌کنند. ABCها زیرکلاس‌های مجازی معرفی می‌کنند، که " +"کلاس‌هایی هستند که از یک کلاس دیگر به ارث نمی‌برند اما همچنان توسط " +":func:`isinstance` و :func:`issubclass` شناخته می‌شوند؛ مستندات ماژول " +":mod:`abc` را ببینید. پایتون همراه با ABCهای توکار بسیاری برای ساختارهای " +"داده (در ماژول :mod:`collections.abc`)، اعداد (در ماژول :mod:`numbers`)، " +"جریان‌ها (در ماژول :mod:`io`)، یابنده‌ها و بارگذارهای ایمپورت (در ماژول " +":mod:`importlib.abc`) ارائه می‌شود. شما می‌توانید ABCهای سفارشی خود را با " +"ماژول :mod:`abc` ایجاد کنید." msgid "annotate function" msgstr "توابع حاشیه‌گذاری" -msgid "A callable that can be called to retrieve the :term:`annotations ` of an object. Annotate functions are usually :term:`functions `, automatically generated as the :attr:`~object.__annotate__` attribute of functions, classes, and modules. Annotate functions are a subset of :term:`evaluate functions `." -msgstr "فراخوانی‌پذیری که می‌توان آن را برای بازیابی :term:`حاشیه‌گذاری ` یک شیء فراخوانی کرد. توابع حاشیه‌گذاری معمولاً :term:`توابعی ` هستند که به‌صورت خودکار به‌عنوان ویژگی :attr:`~object.__annotate__` توابع، کلاس‌ها و ماژول‌ها تولید می‌شوند. توابع حاشیه‌گذاری زیرمجموعه‌ای از :term:`توابع ارزیابی ` هستند." +msgid "" +"A callable that can be called to retrieve the :term:`annotations " +"` of an object. Annotate functions are usually :term:`functions " +"`, automatically generated as the :attr:`~object.__annotate__` " +"attribute of functions, classes, and modules. Annotate functions are a " +"subset of :term:`evaluate functions `." +msgstr "" +"فراخوانی‌پذیری که می‌توان آن را برای بازیابی :term:`حاشیه‌گذاری " +"` یک شیء فراخوانی کرد. توابع حاشیه‌گذاری معمولاً :term:`توابعی " +"` هستند که به‌صورت خودکار به‌عنوان ویژگی " +":attr:`~object.__annotate__` توابع، کلاس‌ها و ماژول‌ها تولید می‌شوند. توابع " +"حاشیه‌گذاری زیرمجموعه‌ای از :term:`توابع ارزیابی ` هستند." msgid "annotation" msgstr "حاشیه‌گذاری" -msgid "A label associated with a variable, a class attribute or a function parameter or return value, used by convention as a :term:`type hint`." -msgstr "برچسبی مرتبط با یک متغیر، یک ویژگی کلاس، یا یک پارامتر تابع یا مقدار بازگشتی، که طبق قرارداد به‌عنوان یک :term:`راهنمای نوع ` استفاده می‌شود." +msgid "" +"A label associated with a variable, a class attribute or a function " +"parameter or return value, used by convention as a :term:`type hint`." +msgstr "" +"برچسبی مرتبط با یک متغیر، یک ویژگی کلاس، یا یک پارامتر تابع یا مقدار " +"بازگشتی، که طبق قرارداد به‌عنوان یک :term:`راهنمای نوع ` استفاده " +"می‌شود." -msgid "Annotations of local variables cannot be accessed at runtime, but annotations of global variables, class attributes, and functions can be retrieved by calling :func:`annotationlib.get_annotations` on modules, classes, and functions, respectively." -msgstr "حاشیه‌گذاری‌های متغیرهای محلی را نمی‌توان در زمان ران‌تایم دسترسی کرد، اما حاشیه‌گذاری‌های متغیرهای سراسری، ویژگی‌های کلاس و توابع را می‌توان با فراخوانی :func:`annotationlib.get_annotations` به‌ترتیب روی ماژول‌ها، کلاس‌ها و توابع بازیابی کرد." +msgid "" +"Annotations of local variables cannot be accessed at runtime, but " +"annotations of global variables, class attributes, and functions can be " +"retrieved by calling :func:`annotationlib.get_annotations` on modules, " +"classes, and functions, respectively." +msgstr "" +"حاشیه‌گذاری‌های متغیرهای محلی را نمی‌توان در زمان ران‌تایم دسترسی کرد، اما " +"حاشیه‌گذاری‌های متغیرهای سراسری، ویژگی‌های کلاس و توابع را می‌توان با " +"فراخوانی :func:`annotationlib.get_annotations` به‌ترتیب روی ماژول‌ها، " +"کلاس‌ها و توابع بازیابی کرد." -msgid "See :term:`variable annotation`, :term:`function annotation`, :pep:`484`, :pep:`526`, and :pep:`649`, which describe this functionality. Also see :ref:`annotations-howto` for best practices on working with annotations." -msgstr "همچنین به :term:`حاشیه‌نویسی متغیر `، :term:`حاشیه‌گذاری تابع `، :pep:`484`، :pep:`526` و :pep:`649` مراجعه کنید که این قابلیت را توضیح می‌دهند. همچنین برای بهترین روش‌ها در کار با حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." +msgid "" +"See :term:`variable annotation`, :term:`function annotation`, :pep:`484`, " +":pep:`526`, and :pep:`649`, which describe this functionality. Also see " +":ref:`annotations-howto` for best practices on working with annotations." +msgstr "" +"همچنین به :term:`حاشیه‌نویسی متغیر `، " +":term:`حاشیه‌گذاری تابع `، :pep:`484`، :pep:`526` و " +":pep:`649` مراجعه کنید که این قابلیت را توضیح می‌دهند. همچنین برای بهترین " +"روش‌ها در کار با حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." msgid "argument" msgstr "آرگومان" -msgid "A value passed to a :term:`function` (or :term:`method`) when calling the function. There are two kinds of argument:" -msgstr "مقداری که هنگام فراخوانی یک :term:`تابع ` (یا :term:`متد `) به آن تابع ارسال می‌شود. دو نوع آرگومان وجود دارد:" +msgid "" +"A value passed to a :term:`function` (or :term:`method`) when calling the " +"function. There are two kinds of argument:" +msgstr "" +"مقداری که هنگام فراخوانی یک :term:`تابع ` (یا :term:`متد " +"`) به آن تابع ارسال می‌شود. دو نوع آرگومان وجود دارد:" -msgid ":dfn:`keyword argument`: an argument preceded by an identifier (e.g. ``name=``) in a function call or passed as a value in a dictionary preceded by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the following calls to :func:`complex`::" -msgstr ":dfn:`keyword argument`: آرگومانی که در فراخوانی تابع با یک شناسه (برای مثال ``name=``) پیش از آن قرار گرفته است، یا به‌عنوان مقداری در یک دیکشنری که پیش از آن ``**`` آمده است، ارسال می‌شود. برای مثال، ``3`` و ``5`` هر دو در فراخوانی‌های زیر از :func:`complex` آرگومان کلیدواژه‌ای هستند::" +msgid "" +":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " +"``name=``) in a function call or passed as a value in a dictionary preceded " +"by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the " +"following calls to :func:`complex`::" +msgstr "" +":dfn:`keyword argument`: آرگومانی که در فراخوانی تابع با یک شناسه (برای مثال" +" ``name=``) پیش از آن قرار گرفته است، یا به‌عنوان مقداری در یک دیکشنری که " +"پیش از آن ``**`` آمده است، ارسال می‌شود. برای مثال، ``3`` و ``5`` هر دو در " +"فراخوانی‌های زیر از :func:`complex` آرگومان کلیدواژه‌ای هستند::" msgid "" "complex(real=3, imag=5)\n" @@ -88,8 +165,17 @@ msgstr "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" -msgid ":dfn:`positional argument`: an argument that is not a keyword argument. Positional arguments can appear at the beginning of an argument list and/or be passed as elements of an :term:`iterable` preceded by ``*``. For example, ``3`` and ``5`` are both positional arguments in the following calls::" -msgstr ":dfn:`positional argument`: آرگومانی که آرگومان کلیدواژه‌ای نیست. آرگومان‌های جایگاهی می‌توانند در ابتدای یک فهرست آرگومان ظاهر شوند و/یا به‌عنوان عناصر یک :term:`تکرارپذیر ` که پیش از آن ``*`` آمده است، ارسال شوند. برای مثال، ``3`` و ``5`` هر دو در فراخوانی‌های زیر آرگومان جایگاهی هستند::" +msgid "" +":dfn:`positional argument`: an argument that is not a keyword argument. " +"Positional arguments can appear at the beginning of an argument list and/or " +"be passed as elements of an :term:`iterable` preceded by ``*``. For example," +" ``3`` and ``5`` are both positional arguments in the following calls::" +msgstr "" +":dfn:`positional argument`: آرگومانی که آرگومان کلیدواژه‌ای نیست. " +"آرگومان‌های جایگاهی می‌توانند در ابتدای یک فهرست آرگومان ظاهر شوند و/یا " +"به‌عنوان عناصر یک :term:`پیمایش‌پذیر ` که پیش از آن ``*`` آمده است، " +"ارسال شوند. برای مثال، ``3`` و ``5`` هر دو در فراخوانی‌های زیر آرگومان " +"جایگاهی هستند::" msgid "" "complex(3, 5)\n" @@ -98,173 +184,439 @@ msgstr "" "complex(3, 5)\n" "complex(*(3, 5))" -msgid "Arguments are assigned to the named local variables in a function body. See the :ref:`calls` section for the rules governing this assignment. Syntactically, any expression can be used to represent an argument; the evaluated value is assigned to the local variable." -msgstr "آرگومان‌ها به متغیرهای محلی نام‌گذاری‌شده در بدنهٔ یک تابع اختصاص داده می‌شوند. برای قوانین حاکم بر این تخصیص، بخش :ref:`calls` را ببینید. از نظر سینتکس، هر عبارتی می‌تواند برای نمایش یک آرگومان استفاده شود؛ مقدار ارزیابی‌شده به متغیر محلی اختصاص داده می‌شود." +msgid "" +"Arguments are assigned to the named local variables in a function body. See " +"the :ref:`calls` section for the rules governing this assignment. " +"Syntactically, any expression can be used to represent an argument; the " +"evaluated value is assigned to the local variable." +msgstr "" +"آرگومان‌ها به متغیرهای محلی نام‌گذاری‌شده در بدنه‌ی یک تابع اختصاص داده " +"می‌شوند. برای قوانین حاکم بر این تخصیص، بخش :ref:`calls` را ببینید. از نظر " +"سینتکس، هر عبارتی می‌تواند برای نمایش یک آرگومان استفاده شود؛ مقدار " +"ارزیابی‌شده به متغیر محلی اختصاص داده می‌شود." -msgid "See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the difference between arguments and parameters `, and :pep:`362`." -msgstr "همچنین به ورودی واژه‌نامه‌ای :term:`پارامتر `، پرسش متداول دربارهٔ :ref:`تفاوت بین آرگومان‌ها و پارامترها ` و :pep:`362` مراجعه کنید." +msgid "" +"See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the" +" difference between arguments and parameters `, " +"and :pep:`362`." +msgstr "" +"همچنین به ورودی واژه‌نامه‌ای :term:`پارامتر `، پرسش متداول " +"درباره‌ی :ref:`تفاوت بین آرگومان‌ها و پارامترها ` " +"و :pep:`362` مراجعه کنید." msgid "asynchronous context manager" -msgstr "مدیر زمینهٔ ناهمگام" +msgstr "مدیر زمینه‌ی ناهمگام" -msgid "An object which controls the environment seen in an :keyword:`async with` statement by defining :meth:`~object.__aenter__` and :meth:`~object.__aexit__` methods. Introduced by :pep:`492`." -msgstr "شی‌ءای که با تعریف متدهای :meth:`~object.__aenter__` و :meth:`~object.__aexit__`، محیط مشاهده‌شده در یک دستور :keyword:`async with` را کنترل می‌کند. این قابلیت توسط :pep:`492` معرفی شد." +msgid "" +"An object which controls the environment seen in an :keyword:`async with` " +"statement by defining :meth:`~object.__aenter__` and " +":meth:`~object.__aexit__` methods. Introduced by :pep:`492`." +msgstr "" +"شی‌ءای که با تعریف متدهای :meth:`~object.__aenter__` و " +":meth:`~object.__aexit__`، محیط مشاهده‌شده در یک دستور :keyword:`async with`" +" را کنترل می‌کند. این قابلیت توسط :pep:`492` معرفی شد." msgid "asynchronous generator" msgstr "تولیدگر ناهمگام" -msgid "Informally used to mean either an :term:`asynchronous generator function` or an :term:`asynchronous generator iterator`, depending on context. The formal terms :term:`asynchronous generator function` and :term:`asynchronous generator iterator` are uncommon in practice; \"asynchronous generator\" alone is almost always sufficient." -msgstr "به‌صورت غیررسمی برای اشاره به یک :term:`تابع تولیدگر ناهمگام ` یا یک :term:`تکرارگر تولیدگر ناهمگام `، بسته به زمینه، استفاده می‌شود. اصطلاحات رسمی :term:`تابع تولیدگر ناهمگام ` و :term:`تکرارگر تولیدگر ناهمگام ` در عمل کمتر استفاده می‌شوند؛ «تولیدگر ناهمگام» به‌تنهایی تقریباً همیشه کافی است." +msgid "" +"Informally used to mean either an :term:`asynchronous generator function` or" +" an :term:`asynchronous generator iterator`, depending on context. The " +"formal terms :term:`asynchronous generator function` and :term:`asynchronous" +" generator iterator` are uncommon in practice; \"asynchronous generator\" " +"alone is almost always sufficient." +msgstr "" +"به‌صورت غیررسمی برای اشاره به یک :term:`تابع تولیدگر ناهمگام ` یا یک :term:`پیمایش‌گر تولیدگر ناهمگام `، بسته به زمینه، استفاده می‌شود. اصطلاحات رسمی " +":term:`تابع تولیدگر ناهمگام ` و " +":term:`پیمایش‌گر تولیدگر ناهمگام ` در عمل " +"کمتر استفاده می‌شوند؛ «تولیدگر ناهمگام» به‌تنهایی تقریباً همیشه کافی است." msgid "asynchronous generator function" msgstr "تابع تولیدگر ناهمگام" -msgid "A function which returns an :term:`asynchronous generator iterator`. It looks like a coroutine function defined with :keyword:`async def` except that it contains :keyword:`yield` expressions for producing a series of values usable in an :keyword:`async for` loop. See :pep:`525`." -msgstr "تابعی که یک :term:`تکرارگر تولیدگر ناهمگام ` بازمی‌گرداند. این تابع شبیه یک تابع هم‌روال که با :keyword:`async def` تعریف شده است به نظر می‌رسد، با این تفاوت که شامل عبارت‌های :keyword:`yield` برای تولید مجموعه‌ای از مقادیر قابل استفاده در یک حلقهٔ :keyword:`async for` است. :pep:`525` را ببینید." +msgid "" +"A function which returns an :term:`asynchronous generator iterator`. It " +"looks like a coroutine function defined with :keyword:`async def` except " +"that it contains :keyword:`yield` expressions for producing a series of " +"values usable in an :keyword:`async for` loop. See :pep:`525`." +msgstr "" +"تابعی که یک :term:`پیمایش‌گر تولیدگر ناهمگام ` بازمی‌گرداند. این تابع شبیه یک تابع هم‌روال که با :keyword:`async" +" def` تعریف شده است به نظر می‌رسد، با این تفاوت که شامل عبارت‌های " +":keyword:`yield` برای تولید مجموعه‌ای از مقادیر قابل استفاده در یک حلقه‌ی " +":keyword:`async for` است. :pep:`525` را ببینید." -msgid "An asynchronous generator function may contain :keyword:`await` expressions as well as :keyword:`async for`, and :keyword:`async with` statements." -msgstr "یک تابع تولیدگر ناهمگام ممکن است علاوه بر عبارت‌های :keyword:`async for` و دستورهای :keyword:`async with`، شامل عبارت‌های :keyword:`await` نیز باشد." +msgid "" +"An asynchronous generator function may contain :keyword:`await` expressions " +"as well as :keyword:`async for`, and :keyword:`async with` statements." +msgstr "" +"یک تابع تولیدگر ناهمگام ممکن است علاوه بر عبارت‌های :keyword:`async for " +"` و دستورهای :keyword:`async with `، شامل عبارت‌های " +":keyword:`await ` نیز باشد." msgid "asynchronous generator iterator" -msgstr "تکرارگر تولیدگر ناهمگام" +msgstr "پیمایش‌گر تولیدگر ناهمگام" msgid "An object created by an :term:`asynchronous generator function`." -msgstr "شی‌ءای که توسط یک :term:`تابع تولیدگر ناهمگام ` ایجاد می‌شود." +msgstr "" +"شی‌ءای که توسط یک :term:`تابع تولیدگر ناهمگام ` ایجاد می‌شود." -msgid "This is an :term:`asynchronous iterator` which when called using the :meth:`~object.__anext__` method returns an awaitable object which will execute the body of the asynchronous generator function until the next :keyword:`yield` expression." -msgstr "این یک :term:`تکرارگر ناهمگام ` است که هنگام فراخوانی با استفاده از متد :meth:`~object.__anext__`، یک شیء awaitable بازمی‌گرداند که بدنهٔ تابع تولیدگر ناهمگام را تا عبارت :keyword:`yield` بعدی اجرا خواهد کرد." +msgid "" +"This is an :term:`asynchronous iterator` which when called using the " +":meth:`~object.__anext__` method returns an awaitable object which will " +"execute the body of the asynchronous generator function until the next " +":keyword:`yield` expression." +msgstr "" +"این یک :term:`پیمایش‌گر ناهمگام ` است که هنگام فراخوانی" +" با استفاده از متد :meth:`~object.__anext__`، یک شیء awaitable بازمی‌گرداند " +"که بدنه‌ی تابع تولیدگر ناهمگام را تا عبارت :keyword:`yield` بعدی اجرا خواهد " +"کرد." -msgid "Each :keyword:`yield` temporarily suspends processing, remembering the execution state (including local variables and pending try-statements). When the *asynchronous generator iterator* effectively resumes with another awaitable returned by :meth:`~object.__anext__`, it picks up where it left off. See :pep:`492` and :pep:`525`." -msgstr "هر :keyword:`yield` پردازش را به‌طور موقت متوقف می‌کند و وضعیت اجرا (شامل متغیرهای محلی و دستورهای try در انتظار) را به خاطر می‌سپارد. هنگامی که *تکرارگر تولیدگر ناهمگام* عملاً با یک شیء awaitable دیگر که توسط :meth:`~object.__anext__` بازگردانده شده است ادامه می‌یابد، از همان نقطه‌ای که متوقف شده بود ادامه می‌دهد. :pep:`492` و :pep:`525` را ببینید." +msgid "" +"Each :keyword:`yield` temporarily suspends processing, remembering the " +"execution state (including local variables and pending try-statements). " +"When the *asynchronous generator iterator* effectively resumes with another " +"awaitable returned by :meth:`~object.__anext__`, it picks up where it left " +"off. See :pep:`492` and :pep:`525`." +msgstr "" +"هر :keyword:`yield` پردازش را به‌طور موقت متوقف می‌کند و وضعیت اجرا (شامل " +"متغیرهای محلی و دستورهای try در انتظار) را به خاطر می‌سپارد. هنگامی که " +"*پیمایش‌گر تولیدگر ناهمگام* عملاً با یک شیء awaitable دیگر که توسط " +":meth:`~object.__anext__` بازگردانده شده است ادامه می‌یابد، از همان نقطه‌ای " +"که متوقف شده بود ادامه می‌دهد. :pep:`492` و :pep:`525` را ببینید." msgid "asynchronous iterable" -msgstr "تکرارپذیر ناهمگام" +msgstr "پیمایش‌پذیر ناهمگام" -msgid "An object, that can be used in an :keyword:`async for` statement. Must return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` method. Introduced by :pep:`492`." -msgstr "شی‌ءای که می‌تواند در یک دستور :keyword:`async for` استفاده شود. باید از متد :meth:`~object.__aiter__` خود یک :term:`تکرارگر ناهمگام ` بازگرداند. این قابلیت توسط :pep:`492` معرفی شد." +msgid "" +"An object, that can be used in an :keyword:`async for` statement. Must " +"return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " +"method. Introduced by :pep:`492`." +msgstr "" +"شی‌ءای که می‌تواند در یک دستور :keyword:`async for` استفاده شود. باید از متد" +" :meth:`~object.__aiter__` خود یک :term:`پیمایش‌گر ناهمگام ` بازگرداند. این قابلیت توسط :pep:`492` معرفی شد." msgid "asynchronous iterator" -msgstr "تکرارگر ناهمگام" +msgstr "پیمایش‌گر ناهمگام" -msgid "An object that implements the :meth:`~object.__aiter__` and :meth:`~object.__anext__` methods. :meth:`~object.__anext__` must return an :term:`awaitable` object. :keyword:`async for` resolves the awaitables returned by an asynchronous iterator's :meth:`~object.__anext__` method until it raises a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." -msgstr "شی‌ءای که متدهای :meth:`~object.__aiter__` و :meth:`~object.__anext__` را پیاده‌سازی می‌کند. :meth:`~object.__anext__` باید یک شیء :term:`awaitable ` بازگرداند. :keyword:`async for` اشیای awaitable بازگردانده‌شده توسط متد :meth:`~object.__anext__` یک تکرارگر ناهمگام را تا زمانی که یک استثنای :exc:`StopAsyncIteration` پرتاب شود، حل می‌کند. این قابلیت توسط :pep:`492` معرفی شد." +msgid "" +"An object that implements the :meth:`~object.__aiter__` and " +":meth:`~object.__anext__` methods. :meth:`~object.__anext__` must return an" +" :term:`awaitable` object. :keyword:`async for` resolves the awaitables " +"returned by an asynchronous iterator's :meth:`~object.__anext__` method " +"until it raises a :exc:`StopAsyncIteration` exception. Introduced by " +":pep:`492`." +msgstr "" +"شی‌ءای که متدهای :meth:`~object.__aiter__` و :meth:`~object.__anext__` را " +"پیاده‌سازی می‌کند. :meth:`~object.__anext__` باید یک شیء :term:`awaitable " +"` بازگرداند. :keyword:`async for` اشیای awaitable بازگردانده‌شده " +"توسط متد :meth:`~object.__anext__` یک پیمایش‌گر ناهمگام را تا زمانی که یک " +"استثنای :exc:`StopAsyncIteration` پرتاب شود، حل می‌کند. این قابلیت توسط " +":pep:`492` معرفی شد." msgid "atomic operation" msgstr "عملیات اتمی" -msgid "An operation that appears to execute as a single, indivisible step: no other thread can observe it half-done, and its effects become visible all at once. Python does not guarantee that high-level statements are atomic (for example, ``x += 1`` performs multiple bytecode operations and is not atomic). Atomicity is only guaranteed where explicitly documented. See also :term:`race condition` and :term:`data race`." -msgstr "عملیاتی که به نظر می‌رسد به‌عنوان یک گام واحد و تقسیم‌ناپذیر اجرا می‌شود: هیچ نخ دیگری نمی‌تواند اجرای ناقص آن را مشاهده کند و اثرات آن یکباره قابل مشاهده می‌شوند. پایتون تضمین نمی‌کند که دستورهای سطح بالا اتمی باشند (برای مثال، ``x += 1`` چندین عملیات بایت‌کد انجام می‌دهد و اتمی نیست). اتمی بودن فقط در مواردی تضمین می‌شود که به‌صراحت مستند شده باشند. همچنین :term:`شرط رقابت ` و :term:`رقابت داده ` را ببینید." +msgid "" +"An operation that appears to execute as a single, indivisible step: no other" +" thread can observe it half-done, and its effects become visible all at " +"once. Python does not guarantee that high-level statements are atomic (for " +"example, ``x += 1`` performs multiple bytecode operations and is not " +"atomic). Atomicity is only guaranteed where explicitly documented. See " +"also :term:`race condition` and :term:`data race`." +msgstr "" +"عملیاتی که به نظر می‌رسد به‌عنوان یک گام واحد و تقسیم‌ناپذیر اجرا می‌شود: " +"هیچ نخ دیگری نمی‌تواند اجرای ناقص آن را مشاهده کند و اثرات آن یکباره قابل " +"مشاهده می‌شوند. پایتون تضمین نمی‌کند که دستورهای سطح بالا اتمی باشند (برای " +"مثال، ``x += 1`` چندین عملیات بایت‌کد انجام می‌دهد و اتمی نیست). اتمی بودن " +"فقط در مواردی تضمین می‌شود که به‌صراحت مستند شده باشند. همچنین :term:`شرط " +"رقابت ` و :term:`رقابت داده ` را ببینید." msgid "attached thread state" msgstr "وضعیت نخ متصل" msgid "A :term:`thread state` that is active for the current OS thread." -msgstr "یک :term:`وضعیت نخ اجرایی ` که برای نخ فعلی سیستم‌عامل فعال است." +msgstr "" +"یک :term:`وضعیت نخ اجرایی ` که برای نخ فعلی سیستم‌عامل فعال " +"است." -msgid "When a :term:`thread state` is attached, the OS thread has access to the full Python C API and can safely invoke the bytecode interpreter." -msgstr "هنگامی که یک :term:`وضعیت نخ اجرایی ` متصل است، نخ سیستم‌عامل به تمام API زبان C پایتون دسترسی دارد و می‌تواند به‌طور ایمن مفسر بایت‌کد را فراخوانی کند." +msgid "" +"When a :term:`thread state` is attached, the OS thread has access to the " +"full Python C API and can safely invoke the bytecode interpreter." +msgstr "" +"هنگامی که یک :term:`وضعیت نخ اجرایی ` متصل است، نخ سیستم‌عامل " +"به تمام API زبان C پایتون دسترسی دارد و می‌تواند به‌طور ایمن مفسر بایت‌کد را" +" فراخوانی کند." -msgid "Unless a function explicitly notes otherwise, attempting to call the C API without an attached thread state will result in a fatal error or undefined behavior. A thread state can be attached and detached explicitly by the user through the C API, or implicitly by the runtime, including during blocking C calls and by the bytecode interpreter in between calls." -msgstr "مگر این‌که یک تابع به‌طور صریح خلاف آن را ذکر کند، تلاش برای فراخوانی API زبان C بدون یک وضعیت نخ متصل، به یک خطای مهلک یا رفتار تعریف‌نشده منجر خواهد شد. یک وضعیت نخ می‌تواند به‌صورت صریح توسط کاربر از طریق API زبان C متصل و جدا شود، یا به‌صورت ضمنی توسط ران‌تایم، از جمله در طول فراخوانی‌های C مسدودکننده و توسط مفسر بایت‌کد در بین فراخوانی‌ها، مدیریت شود." +msgid "" +"Unless a function explicitly notes otherwise, attempting to call the C API " +"without an attached thread state will result in a fatal error or undefined " +"behavior. A thread state can be attached and detached explicitly by the " +"user through the C API, or implicitly by the runtime, including during " +"blocking C calls and by the bytecode interpreter in between calls." +msgstr "" +"مگر این‌که یک تابع به‌طور صریح خلاف آن را ذکر کند، تلاش برای فراخوانی API " +"زبان C بدون یک وضعیت نخ متصل، به یک خطای مهلک یا رفتار تعریف‌نشده منجر خواهد" +" شد. یک وضعیت نخ می‌تواند به‌صورت صریح توسط کاربر از طریق API زبان C متصل و " +"جدا شود، یا به‌صورت ضمنی توسط ران‌تایم، از جمله در طول فراخوانی‌های C " +"مسدودکننده و توسط مفسر بایت‌کد در بین فراخوانی‌ها، مدیریت شود." -msgid "On most builds of Python, having an attached thread state implies that the caller holds the :term:`GIL` for the current interpreter, so only one OS thread can have an attached thread state at a given moment. In :term:`free-threaded builds ` of Python, threads can concurrently hold an attached thread state, allowing for true parallelism of the bytecode interpreter." -msgstr "در بیشتر ساخت‌های پایتون، داشتن یک وضعیت نخ متصل به این معناست که فراخواننده :term:`GIL ` را برای مفسر فعلی در اختیار دارد، بنابراین در یک لحظهٔ مشخص فقط یک نخ سیستم‌عامل می‌تواند یک وضعیت نخ متصل داشته باشد. در :term:`ساخت نخ‌آزاد ` پایتون، نخ‌ها می‌توانند به‌طور هم‌زمان وضعیت نخ متصل داشته باشند، که امکان موازی‌سازی واقعی مفسر بایت‌کد را فراهم می‌کند." +msgid "" +"On most builds of Python, having an attached thread state implies that the " +"caller holds the :term:`GIL` for the current interpreter, so only one OS " +"thread can have an attached thread state at a given moment. In :term:`free-" +"threaded builds ` of Python, threads can concurrently " +"hold an attached thread state, allowing for true parallelism of the bytecode" +" interpreter." +msgstr "" +"در بیشتر ساخت‌های پایتون، داشتن یک وضعیت نخ متصل به این معناست که فراخواننده" +" :term:`GIL ` را برای مفسر فعلی در اختیار دارد، بنابراین در یک لحظه‌ی " +"مشخص فقط یک نخ سیستم‌عامل می‌تواند یک وضعیت نخ متصل داشته باشد. در " +":term:`ساخت نخ‌آزاد ` پایتون، نخ‌ها می‌توانند به‌طور " +"همزمان وضعیت نخ متصل داشته باشند، که امکان موازی‌سازی واقعی مفسر بایت‌کد را" +" فراهم می‌کند." msgid "attribute" msgstr "ویژگی" -msgid "A value associated with an object which is usually referenced by name using dotted expressions. For example, if an object *o* has an attribute *a* it would be referenced as *o.a*." -msgstr "مقداری مرتبط با یک شیء که معمولاً با استفاده از عبارت‌های نقطه‌ای و با نام به آن ارجاع داده می‌شود. برای مثال، اگر یک شیء *o* دارای یک ویژگی *a* باشد، با *o.a* به آن ارجاع داده خواهد شد." +msgid "" +"A value associated with an object which is usually referenced by name using " +"dotted expressions. For example, if an object *o* has an attribute *a* it " +"would be referenced as *o.a*." +msgstr "" +"مقداری مرتبط با یک شیء که معمولاً با استفاده از عبارت‌های نقطه‌ای و با نام " +"به آن ارجاع داده می‌شود. برای مثال، اگر یک شیء *o* دارای یک ویژگی *a* باشد، " +"با *o.a* به آن ارجاع داده خواهد شد." -msgid "It is possible to give an object an attribute whose name is not an identifier as defined by :ref:`identifiers`, for example using :func:`setattr`, if the object allows it. Such an attribute will not be accessible using a dotted expression, and would instead need to be retrieved with :func:`getattr`." -msgstr "اگر شیء اجازه دهد، می‌توان با استفاده از :func:`setattr`، ویژگی‌ای با نامی که یک شناسه مطابق تعریف :ref:`identifiers` نیست به آن اختصاص داد. چنین ویژگی‌ای با استفاده از یک عبارت نقطه‌ای قابل دسترسی نخواهد بود و باید در عوض با :func:`getattr` بازیابی شود." +msgid "" +"It is possible to give an object an attribute whose name is not an " +"identifier as defined by :ref:`identifiers`, for example using " +":func:`setattr`, if the object allows it. Such an attribute will not be " +"accessible using a dotted expression, and would instead need to be retrieved" +" with :func:`getattr`." +msgstr "" +"اگر شیء اجازه دهد، می‌توان با استفاده از :func:`setattr`، ویژگی‌ای با نامی " +"که یک شناسه مطابق تعریف :ref:`identifiers` نیست به آن اختصاص داد. چنین " +"ویژگی‌ای با استفاده از یک عبارت نقطه‌ای قابل دسترسی نخواهد بود و باید در عوض" +" با :func:`getattr` بازیابی شود." msgid "awaitable" msgstr "awaitable" -msgid "An object that can be used in an :keyword:`await` expression. Can be a :term:`coroutine` or an object with an :meth:`~object.__await__` method. See also :pep:`492`." -msgstr "شیءای که می‌تواند در یک عبارت :keyword:`await` استفاده شود. می‌تواند یک :term:`هم‌روال ` یا شی‌ءای با متد :meth:`~object.__await__` باشد. همچنین :pep:`492` را ببینید." +msgid "" +"An object that can be used in an :keyword:`await` expression. Can be a " +":term:`coroutine` or an object with an :meth:`~object.__await__` method. See" +" also :pep:`492`." +msgstr "" +"شیءای که می‌تواند در یک عبارت :keyword:`await` استفاده شود. می‌تواند یک " +":term:`هم‌روال ` یا شی‌ءای با متد :meth:`~object.__await__` باشد." +" همچنین :pep:`492` را ببینید." msgid "BDFL" msgstr "BDFL" -msgid "Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." -msgstr "Benevolent Dictator For Life، نام دیگر `Guido van Rossum `_، خالق پایتون." +msgid "" +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum " +"`_, Python's creator." +msgstr "" +"Benevolent Dictator For Life،نام دیگر `Guido van Rossum " +"`_، خالق پایتون." msgid "binary file" msgstr "فایل دودویی" -msgid "A :term:`file object` able to read and write :term:`bytes-like objects `. Examples of binary files are files opened in binary mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io.BytesIO` and :class:`gzip.GzipFile`." -msgstr "یک :term:`شیء فایل ` که می‌تواند :term:`شیء شبه‌بایت ` را بخواند و بنویسد. نمونه‌هایی از فایل‌های دودویی، فایل‌هایی هستند که در حالت دودویی باز شده‌اند (``'rb'``، ``'wb'`` یا ``'rb+'``)، :data:`sys.stdin.buffer `، :data:`sys.stdout.buffer ` و نمونه‌هایی از :class:`io.BytesIO` و :class:`gzip.GzipFile`." +msgid "" +"A :term:`file object` able to read and write :term:`bytes-like objects " +"`. Examples of binary files are files opened in binary " +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer " +"`, :data:`sys.stdout.buffer `, and instances of " +":class:`io.BytesIO` and :class:`gzip.GzipFile`." +msgstr "" +"یک :term:`شیء فایل ` که می‌تواند :term:`شیء شبه‌بایت ` را بخواند و بنویسد. نمونه‌هایی از فایل‌های دودویی، فایل‌هایی " +"هستند که در حالت دودویی باز شده‌اند (``'rb'``، ``'wb'`` یا ``'rb+'``)، " +":data:`sys.stdin.buffer `، :data:`sys.stdout.buffer `" +" و نمونه‌هایی از :class:`io.BytesIO` و :class:`gzip.GzipFile`." -msgid "See also :term:`text file` for a file object able to read and write :class:`str` objects." -msgstr "همچنین :term:`فایل متنی ` را برای یک شیء فایل که می‌تواند اشیای :class:`str` را بخواند و بنویسد ببینید." +msgid "" +"See also :term:`text file` for a file object able to read and write " +":class:`str` objects." +msgstr "" +"همچنین :term:`فایل متنی ` را برای یک شیء فایل که می‌تواند اشیای " +":class:`str` را بخواند و بنویسد ببینید." msgid "borrowed reference" msgstr "ارجاع قرض‌گرفته‌شده" -msgid "In Python's C API, a borrowed reference is a reference to an object, where the code using the object does not own the reference. It becomes a dangling pointer if the object is destroyed. For example, a garbage collection can remove the last :term:`strong reference` to the object and so destroy it." -msgstr "در API زبان C پایتون، ارجاع قرض‌گرفته‌شده ارجاعی به یک شیء است که در آن کدی که از شیء استفاده می‌کند مالک ارجاع نیست. اگر شیء نابود شود، این ارجاع به یک اشاره‌گر آویزان تبدیل می‌شود. برای مثال، جمع‌آوری زباله می‌تواند آخرین :term:`ارجاع قوی ` به شیء را حذف کند و در نتیجه آن را نابود کند." +msgid "" +"In Python's C API, a borrowed reference is a reference to an object, where " +"the code using the object does not own the reference. It becomes a dangling " +"pointer if the object is destroyed. For example, a garbage collection can " +"remove the last :term:`strong reference` to the object and so destroy it." +msgstr "" +"در API زبان C پایتون، ارجاع قرض‌گرفته‌شده ارجاعی به یک شیء است که در آن کدی " +"که از شیء استفاده می‌کند مالک ارجاع نیست. اگر شیء نابود شود، این ارجاع به یک" +" اشاره‌گر آویزان تبدیل می‌شود. برای مثال، جمع‌آوری زباله می‌تواند آخرین " +":term:`ارجاع قوی ` به شیء را حذف کند و در نتیجه آن را " +"نابود کند." -msgid "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended to convert it to a :term:`strong reference` in-place, except when the object cannot be destroyed before the last usage of the borrowed reference. The :c:func:`Py_NewRef` function can be used to create a new :term:`strong reference`." -msgstr "فراخوانی :c:func:`Py_INCREF` روی :term:`ارجاع قرض‌گرفته‌شده ` توصیه می‌شود تا آن را درجا به یک :term:`ارجاع قوی ` تبدیل کند، مگر زمانی که شیء نمی‌تواند پیش از آخرین استفاده از ارجاع قرض‌گرفته‌شده نابود شود. تابع :c:func:`Py_NewRef` می‌تواند برای ایجاد یک :term:`ارجاع قوی ` جدید استفاده شود." +msgid "" +"Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended" +" to convert it to a :term:`strong reference` in-place, except when the " +"object cannot be destroyed before the last usage of the borrowed reference. " +"The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " +"reference`." +msgstr "" +"فراخوانی :c:func:`Py_INCREF` روی :term:`ارجاع قرض‌گرفته‌شده ` توصیه می‌شود تا آن را درجا به یک :term:`ارجاع قوی ` تبدیل کند، مگر زمانی که شیء نمی‌تواند پیش از آخرین استفاده از " +"ارجاع قرض‌گرفته‌شده نابود شود. تابع :c:func:`Py_NewRef` می‌تواند برای ایجاد " +"یک :term:`ارجاع قوی ` جدید استفاده شود." msgid "bytes-like object" msgstr "شیء شبه‌بایت" -msgid "An object that supports the :ref:`bufferobjects` and can export a C-:term:`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, and :class:`array.array` objects, as well as many common :class:`memoryview` objects. Bytes-like objects can be used for various operations that work with binary data; these include compression, saving to a binary file, and sending over a socket." -msgstr "شی‌ءای که از :ref:`bufferobjects` پشتیبانی می‌کند و می‌تواند یک بافر C-:term:`پیوسته ` صادر کند. این شامل همهٔ اشیای :class:`bytes`، :class:`bytearray` و :class:`array.array` و همچنین بسیاری از اشیای رایج :class:`memoryview` می‌شود. اشیای شبه‌بایت می‌توانند برای عملیات مختلفی که با داده‌های دودویی کار می‌کنند استفاده شوند؛ از جمله فشرده‌سازی، ذخیره در یک فایل دودویی و ارسال از طریق یک سوکت." +msgid "" +"An object that supports the :ref:`bufferobjects` and can export a " +"C-:term:`contiguous` buffer. This includes all :class:`bytes`, " +":class:`bytearray`, and :class:`array.array` objects, as well as many common" +" :class:`memoryview` objects. Bytes-like objects can be used for various " +"operations that work with binary data; these include compression, saving to " +"a binary file, and sending over a socket." +msgstr "" +"شی‌ءای که از :ref:`bufferobjects` پشتیبانی می‌کند و می‌تواند یک بافر " +"C-:term:`پیوسته ` صادر کند. این شامل همه‌ی اشیای :class:`bytes`، " +":class:`bytearray` و :class:`array.array` و همچنین بسیاری از اشیای رایج " +":class:`memoryview` می‌شود. اشیای شبه‌بایت می‌توانند برای عملیات مختلفی که " +"با داده‌های دودویی کار می‌کنند استفاده شوند؛ از جمله فشرده‌سازی، ذخیره در یک" +" فایل دودویی و ارسال از طریق یک سوکت." -msgid "Some operations need the binary data to be mutable. The documentation often refers to these as \"read-write bytes-like objects\". Example mutable buffer objects include :class:`bytearray` and a :class:`memoryview` of a :class:`bytearray`. Other operations require the binary data to be stored in immutable objects (\"read-only bytes-like objects\"); examples of these include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." -msgstr "برخی عملیات‌ها نیاز دارند که داده‌های دودویی تغییرپذیر باشند. مستندات اغلب به این موارد با عنوان «اشیای شبه‌بایت خواندن-نوشتن» اشاره می‌کنند. نمونه‌هایی از اشیای بافر تغییرپذیر شامل :class:`bytearray` و یک :class:`memoryview` از یک :class:`bytearray` هستند. عملیات‌های دیگر نیاز دارند که داده‌های دودویی در اشیای تغییرناپذیر ذخیره شوند («اشیای شبه‌بایت فقط‌خواندنی»)؛ نمونه‌هایی از این موارد شامل :class:`bytes` و یک :class:`memoryview` از یک شیء :class:`bytes` هستند." +msgid "" +"Some operations need the binary data to be mutable. The documentation often" +" refers to these as \"read-write bytes-like objects\". Example mutable " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a " +":class:`bytearray`. Other operations require the binary data to be stored in" +" immutable objects (\"read-only bytes-like objects\"); examples of these " +"include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." +msgstr "" +"برخی عملیات‌ها نیاز دارند که داده‌های دودویی تغییرپذیر باشند. مستندات اغلب " +"به این موارد با عنوان «اشیای شبه‌بایت خواندن-نوشتن» اشاره می‌کنند. " +"نمونه‌هایی از اشیای بافر تغییرپذیر شامل :class:`bytearray` و یک " +":class:`memoryview` از یک :class:`bytearray` هستند. عملیات‌های دیگر نیاز " +"دارند که داده‌های دودویی در اشیای تغییرناپذیر ذخیره شوند («اشیای شبه‌بایت " +"فقط‌خواندنی»)؛ نمونه‌هایی از این موارد شامل :class:`bytes` و یک " +":class:`memoryview` از یک شیء :class:`bytes` هستند." msgid "bytecode" msgstr "بایت‌کد" -msgid "Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. The bytecode is also cached in ``.pyc`` files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This \"intermediate language\" is said to run on a :term:`virtual machine` that executes the machine code corresponding to each bytecode. Do note that bytecodes are not expected to work between different Python virtual machines, nor to be stable between Python releases." -msgstr "کد منبع پایتون به بایت‌کد کامپایل می‌شود؛ بایت‌کد نمایش داخلی یک برنامهٔ پایتون در مفسر CPython است. بایت‌کد همچنین در فایل‌های ``.pyc`` ذخیره می‌شود تا اجرای همان فایل در بار دوم سریع‌تر باشد (می‌توان از کامپایل دوباره از منبع به بایت‌کد جلوگیری کرد). گفته می‌شود این «زبان میانی» روی یک :term:`ماشین مجازی ` اجرا می‌شود که کد ماشین متناظر با هر بایت‌کد را اجرا می‌کند. توجه داشته باشید که انتظار نمی‌رود بایت‌کدها بین ماشین‌های مجازی مختلف پایتون کار کنند یا بین نسخه‌های مختلف پایتون پایدار باشند." +msgid "" +"Python source code is compiled into bytecode, the internal representation of" +" a Python program in the CPython interpreter. The bytecode is also cached " +"in ``.pyc`` files so that executing the same file is faster the second time " +"(recompilation from source to bytecode can be avoided). This \"intermediate" +" language\" is said to run on a :term:`virtual machine` that executes the " +"machine code corresponding to each bytecode. Do note that bytecodes are not " +"expected to work between different Python virtual machines, nor to be stable" +" between Python releases." +msgstr "" +"کد منبع پایتون به بایت‌کد کامپایل می‌شود؛ بایت‌کد نمایش داخلی یک برنامه‌ی " +"پایتون در مفسر CPython است. بایت‌کد همچنین در فایل‌های ``.pyc`` ذخیره می‌شود" +" تا اجرای همان فایل در بار دوم سریع‌تر باشد (می‌توان از کامپایل دوباره از " +"منبع به بایت‌کد جلوگیری کرد). گفته می‌شود این «زبان میانی» روی یک " +":term:`ماشین مجازی ` اجرا می‌شود که کد ماشین متناظر با هر " +"بایت‌کد را اجرا می‌کند. توجه داشته باشید که انتظار نمی‌رود بایت‌کدها بین " +"ماشین‌های مجازی مختلف پایتون کار کنند یا بین نسخه‌های مختلف پایتون پایدار " +"باشند." -msgid "A list of bytecode instructions can be found in the documentation for :ref:`the dis module `." -msgstr "فهرستی از دستورهای بایت‌کد را می‌توان در مستندات :ref:`the dis module ` یافت." +msgid "" +"A list of bytecode instructions can be found in the documentation for " +":ref:`the dis module `." +msgstr "" +"فهرستی از دستورهای بایت‌کد را می‌توان در مستندات :ref:`the dis module " +"` یافت." msgid "callable" msgstr "فراخوانی‌پذیر" -msgid "A callable is an object that can be called, possibly with a set of arguments (see :term:`argument`), with the following syntax::" -msgstr "یک فراخوانی‌پذیر شی‌ءای است که می‌توان آن را، احتمالاً با مجموعه‌ای از آرگومان‌ها (به :term:`آرگومان ` مراجعه کنید)، با سینتکس زیر فراخوانی کرد::" +msgid "" +"A callable is an object that can be called, possibly with a set of arguments" +" (see :term:`argument`), with the following syntax::" +msgstr "" +"یک فراخوانی‌پذیر شی‌ءای است که می‌توان آن را، احتمالاً با مجموعه‌ای از " +"آرگومان‌ها (به :term:`آرگومان ` مراجعه کنید)، با سینتکس زیر " +"فراخوانی کرد::" msgid "callable(argument1, argument2, argumentN)" msgstr "callable(argument1, argument2, argumentN)" -msgid "A :term:`function`, and by extension a :term:`method`, is a callable. An instance of a class that implements the :meth:`~object.__call__` method is also a callable." -msgstr "یک :term:`تابع ` و به‌تبع آن یک :term:`متد `، یک فراخوانی‌پذیر است. یک نمونه از یک کلاس که متد :meth:`~object.__call__` را پیاده‌سازی می‌کند نیز یک فراخوانی‌پذیر است." +msgid "" +"A :term:`function`, and by extension a :term:`method`, is a callable. An " +"instance of a class that implements the :meth:`~object.__call__` method is " +"also a callable." +msgstr "" +"یک :term:`تابع ` و به‌تبع آن یک :term:`متد `، یک " +"فراخوانی‌پذیر است. یک نمونه از یک کلاس که متد :meth:`~object.__call__` را " +"پیاده‌سازی می‌کند نیز یک فراخوانی‌پذیر است." msgid "callback" msgstr "کال‌بک" -msgid "A subroutine function which is passed as an argument to be executed at some point in the future." -msgstr "یک تابع زیرروال که به‌عنوان آرگومان ارسال می‌شود تا در نقطه‌ای در آینده اجرا شود." +msgid "" +"A subroutine function which is passed as an argument to be executed at some " +"point in the future." +msgstr "" +"یک تابع زیرروال که به‌عنوان آرگومان ارسال می‌شود تا در نقطه‌ای در آینده اجرا" +" شود." msgid "class" msgstr "کلاس" -msgid "A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class." -msgstr "الگویی برای ایجاد اشیای تعریف‌شده توسط کاربر. تعریف‌های کلاس معمولاً شامل تعریف‌های متد هستند که روی نمونه‌های کلاس عمل می‌کنند." +msgid "" +"A template for creating user-defined objects. Class definitions normally " +"contain method definitions which operate on instances of the class." +msgstr "" +"الگویی برای ایجاد اشیای تعریف‌شده توسط کاربر. تعریف‌های کلاس معمولاً شامل " +"تعریف‌های متد هستند که روی نمونه‌های کلاس عمل می‌کنند." msgid "class variable" msgstr "متغیر کلاس" -msgid "A variable defined in a class and intended to be modified only at class level (i.e., not in an instance of the class)." -msgstr "متغیری که در یک کلاس تعریف شده است و قرار است فقط در سطح کلاس تغییر داده شود (یعنی نه در یک نمونه از کلاس)." +msgid "" +"A variable defined in a class and intended to be modified only at class " +"level (i.e., not in an instance of the class)." +msgstr "" +"متغیری که در یک کلاس تعریف شده است و قرار است فقط در سطح کلاس تغییر داده شود" +" (یعنی نه در یک نمونه از کلاس)." msgid "closure variable" msgstr "متغیر بستار" -msgid "A :term:`free variable` referenced from a :term:`nested scope` that is defined in an outer scope rather than being resolved at runtime from the globals or builtin namespaces. May be explicitly defined with the :keyword:`nonlocal` keyword to allow write access, or implicitly defined if the variable is only being read." -msgstr "یک :term:`متغیر آزاد ` که از یک :term:`محدودهٔ تو‌در‌تو ` ارجاع داده می‌شود و در یک محدودهٔ بیرونی تعریف شده است، به‌جای این‌که در زمان ران‌تایم از نام‌فضاهای سراسری یا توکار حل شود. ممکن است به‌طور صریح با کلیدواژهٔ :keyword:`nonlocal` تعریف شود تا امکان دسترسی نوشتن فراهم شود، یا اگر متغیر فقط خوانده می‌شود، به‌طور ضمنی تعریف شود." +msgid "" +"A :term:`free variable` referenced from a :term:`nested scope` that is " +"defined in an outer scope rather than being resolved at runtime from the " +"globals or builtin namespaces. May be explicitly defined with the " +":keyword:`nonlocal` keyword to allow write access, or implicitly defined if " +"the variable is only being read." +msgstr "" +"یک :term:`متغیر آزاد ` که از یک :term:`محدوده‌ی تودرتو " +"` ارجاع داده می‌شود و در یک محدوده‌ی بیرونی تعریف شده است، " +"به‌جای این‌که در زمان ران‌تایم از فضای نام های سراسری یا توکار حل شود. ممکن " +"است به‌طور صریح با کلیدواژه‌ی :keyword:`nonlocal` تعریف شود تا امکان دسترسی " +"نوشتن فراهم شود، یا اگر متغیر فقط خوانده می‌شود، به‌طور ضمنی تعریف شود." -msgid "For example, in the ``inner`` function in the following code, both ``x`` and ``print`` are :term:`free variables `, but only ``x`` is a *closure variable*::" -msgstr "برای مثال، در تابع ``inner`` در کد زیر، هر دو مورد ``x`` و ``print`` :term:`متغیر آزاد ` هستند، اما فقط ``x`` یک *متغیر بستار* است::" +msgid "" +"For example, in the ``inner`` function in the following code, both ``x`` and" +" ``print`` are :term:`free variables `, but only ``x`` is a " +"*closure variable*::" +msgstr "" +"برای مثال، در تابع ``inner`` در کد زیر، هر دو مورد ``x`` و ``print`` " +":term:`متغیر آزاد ` هستند، اما فقط ``x`` یک *متغیر بستار* " +"است::" msgid "" "def outer():\n" @@ -283,116 +635,306 @@ msgstr "" " print(x)\n" " return inner" -msgid "Due to the :attr:`codeobject.co_freevars` attribute (which, despite its name, only includes the names of closure variables rather than listing all referenced free variables), the more general :term:`free variable` term is sometimes used even when the intended meaning is to refer specifically to closure variables." -msgstr "به‌دلیل ویژگی :attr:`codeobject.co_freevars` (که با وجود نامش، فقط نام‌های متغیرهای بستار را شامل می‌شود و همهٔ متغیرهای آزاد ارجاع‌داده‌شده را فهرست نمی‌کند)، اصطلاح کلی‌تر :term:`متغیر آزاد ` گاهی حتی زمانی استفاده می‌شود که معنای مورد نظر به‌طور مشخص اشاره به متغیرهای بستار دارد." +msgid "" +"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " +"name, only includes the names of closure variables rather than listing all " +"referenced free variables), the more general :term:`free variable` term is " +"sometimes used even when the intended meaning is to refer specifically to " +"closure variables." +msgstr "" +"به‌دلیل ویژگی :attr:`codeobject.co_freevars` (که با وجود نامش، فقط نام‌های " +"متغیرهای بستار را شامل می‌شود و همه‌ی متغیرهای آزاد ارجاع‌داده‌شده را فهرست " +"نمی‌کند)، اصطلاح کلی‌تر :term:`متغیر آزاد ` گاهی حتی زمانی " +"استفاده می‌شود که معنای مورد نظر به‌طور مشخص اشاره به متغیرهای بستار دارد." msgid "complex number" msgstr "عدد مختلط" -msgid "An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary numbers are real multiples of the imaginary unit (the square root of ``-1``), often written ``i`` in mathematics or ``j`` in engineering. Python has built-in support for complex numbers, which are written with this latter notation; the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. Use of complex numbers is a fairly advanced mathematical feature. If you're not aware of a need for them, it's almost certain you can safely ignore them." -msgstr "گسترشی از سیستم آشنای اعداد حقیقی که در آن همهٔ اعداد به‌صورت مجموع یک بخش حقیقی و یک بخش موهومی بیان می‌شوند. اعداد موهومی مضرب‌های حقیقی واحد موهومی (ریشهٔ دوم ``-1``) هستند که در ریاضیات اغلب با ``i`` و در مهندسی با ``j`` نوشته می‌شود. پایتون پشتیبانی توکار از اعداد مختلط دارد که با این نمادگذاری اخیر نوشته می‌شوند؛ بخش موهومی با پسوند ``j`` نوشته می‌شود، برای مثال ``3+1j``. برای دسترسی به معادل‌های مختلط ماژول :mod:`math`، از :mod:`cmath` استفاده کنید. استفاده از اعداد مختلط یک ویژگی نسبتاً پیشرفتهٔ ریاضی است. اگر از نیاز به آن‌ها آگاه نیستید، تقریباً قطعی است که می‌توانید با خیال راحت آن‌ها را نادیده بگیرید." +msgid "" +"An extension of the familiar real number system in which all numbers are " +"expressed as a sum of a real part and an imaginary part. Imaginary numbers " +"are real multiples of the imaginary unit (the square root of ``-1``), often " +"written ``i`` in mathematics or ``j`` in engineering. Python has built-in " +"support for complex numbers, which are written with this latter notation; " +"the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get " +"access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. " +"Use of complex numbers is a fairly advanced mathematical feature. If you're" +" not aware of a need for them, it's almost certain you can safely ignore " +"them." +msgstr "" +"گسترشی از سیستم آشنای اعداد حقیقی که در آن همه‌ی اعداد به‌صورت مجموع یک بخش " +"حقیقی و یک بخش موهومی بیان می‌شوند. اعداد موهومی مضرب‌های حقیقی واحد موهومی " +"(ریشه‌ی دوم ``-1``) هستند که در ریاضیات اغلب با ``i`` و در مهندسی با ``j`` " +"نوشته می‌شود. پایتون پشتیبانی توکار از اعداد مختلط دارد که با این نمادگذاری " +"اخیر نوشته می‌شوند؛ بخش موهومی با پسوند ``j`` نوشته می‌شود، برای مثال " +"``3+1j``. برای دسترسی به معادل‌های مختلط ماژول :mod:`math`، از :mod:`cmath` " +"استفاده کنید. استفاده از اعداد مختلط یک ویژگی نسبتاً پیشرفته‌ی ریاضی است. اگر" +" از نیاز به آن‌ها آگاه نیستید، تقریباً قطعی است که می‌توانید با خیال راحت " +"آن‌ها را نادیده بگیرید." msgid "concurrency" -msgstr "هم‌زمانی" +msgstr "همزمانی" -msgid "The ability of a computer program to perform multiple tasks at the same time. Python provides libraries for writing programs that make use of different forms of concurrency. :mod:`asyncio` is a library for dealing with asynchronous tasks and coroutines. :mod:`threading` provides access to operating system threads and :mod:`multiprocessing` to operating system processes. Multi-core processors can execute threads and processes on different CPU cores at the same time (see :term:`parallelism`)." -msgstr "توانایی یک برنامهٔ کامپیوتری برای انجام چندین کار در یک زمان. پایتون کتابخانه‌هایی برای نوشتن برنامه‌هایی که از شکل‌های مختلف هم‌زمانی استفاده می‌کنند فراهم می‌کند. :mod:`asyncio` کتابخانه‌ای برای کار با وظایف ناهمگام و coroutineها است. :mod:`threading` دسترسی به نخ‌های سیستم‌عامل و :mod:`multiprocessing` دسترسی به پردازه‌های سیستم‌عامل را فراهم می‌کنند. پردازنده‌های چند‌هسته‌ای می‌توانند نخ‌ها و پردازه‌ها را روی هسته‌های مختلف CPU به‌طور هم‌زمان اجرا کنند (به :term:`موازی‌سازی ` مراجعه کنید)." +msgid "" +"The ability of a computer program to perform multiple tasks at the same " +"time. Python provides libraries for writing programs that make use of " +"different forms of concurrency. :mod:`asyncio` is a library for dealing " +"with asynchronous tasks and coroutines. :mod:`threading` provides access to" +" operating system threads and :mod:`multiprocessing` to operating system " +"processes. Multi-core processors can execute threads and processes on " +"different CPU cores at the same time (see :term:`parallelism`)." +msgstr "" +"توانایی یک برنامه‌ی کامپیوتری برای انجام چندین کار در یک زمان. پایتون " +"کتابخانه‌هایی برای نوشتن برنامه‌هایی که از شکل‌های مختلف همزمانی استفاده " +"می‌کنند فراهم می‌کند. :mod:`asyncio` کتابخانه‌ای برای کار با وظایف ناهمگام و" +" coroutineها است. :mod:`threading` دسترسی به نخ‌های سیستم‌عامل و " +":mod:`multiprocessing` دسترسی به پردازه‌های سیستم‌عامل را فراهم می‌کنند. " +"پردازنده‌های چندهسته‌ای می‌توانند نخ‌ها و پردازه‌ها را روی هسته‌های مختلف " +"CPU به‌طور همزمان اجرا کنند (به :term:`موازی‌سازی ` مراجعه " +"کنید)." msgid "concurrent modification" -msgstr "تغییر هم‌زمان" +msgstr "تغییر همزمان" -msgid "When multiple threads modify shared data at the same time. Concurrent modification without proper synchronization can cause :term:`race conditions `, and might also trigger a :term:`data race `, data corruption, or both." -msgstr "هنگامی که چندین نخ در یک زمان داده‌های اشتراکی را تغییر می‌دهند. تغییر هم‌زمان بدون همگام‌سازی مناسب می‌تواند باعث :term:`شرط رقابت ` شود و همچنین ممکن است یک :term:`رقابت داده `، خرابی داده یا هر دو را ایجاد کند." +msgid "" +"When multiple threads modify shared data at the same time. Concurrent " +"modification without proper synchronization can cause :term:`race conditions" +" `, and might also trigger a :term:`data race `, " +"data corruption, or both." +msgstr "" +"هنگامی که چندین نخ در یک زمان داده‌های اشتراکی را تغییر می‌دهند. تغییر " +"همزمان بدون همگام‌سازی مناسب می‌تواند باعث :term:`شرط رقابت ` شود و همچنین ممکن است یک :term:`رقابت داده `، خرابی " +"داده یا هر دو را ایجاد کند." msgid "context" msgstr "زمینه" -msgid "This term has different meanings depending on where and how it is used. Some common meanings:" -msgstr "این اصطلاح بسته به محل و نحوهٔ استفاده، معانی متفاوتی دارد. برخی از معانی رایج:" +msgid "" +"This term has different meanings depending on where and how it is used. Some" +" common meanings:" +msgstr "" +"این اصطلاح بسته به محل و نحوه‌ی استفاده، معانی متفاوتی دارد. برخی از معانی " +"رایج:" + +msgid "" +"The temporary state or environment established by a :term:`context manager` " +"via a :keyword:`with` statement." +msgstr "" +"وضعیت یا محیط موقتی که توسط یک :term:`مدیر زمینه ` از طریق " +"یک دستور :keyword:`with` ایجاد می‌شود." -msgid "The temporary state or environment established by a :term:`context manager` via a :keyword:`with` statement." -msgstr "وضعیت یا محیط موقتی که توسط یک :term:`مدیر زمینه ` از طریق یک دستور :keyword:`with` ایجاد می‌شود." +msgid "" +"The collection of key­value bindings associated with a particular " +":class:`contextvars.Context` object and accessed via " +":class:`~contextvars.ContextVar` objects. Also see :term:`context " +"variable`." +msgstr "" +"مجموعه‌ی مقیدسازی‌های کلید-مقدار مرتبط با یک شیء :class:`contextvars.Context` خاص و قابل دسترسی از طریق اشیای :class:`~contextvars.ContextVar`." +" همچنین :term:`متغیر زمینه ` را ببینید." -msgid "The collection of key­value bindings associated with a particular :class:`contextvars.Context` object and accessed via :class:`~contextvars.ContextVar` objects. Also see :term:`context variable`." -msgstr "مجموعهٔ اتصال‌های کلید-مقدار مرتبط با یک شیء :class:`contextvars.Context` خاص و قابل دسترسی از طریق اشیای :class:`~contextvars.ContextVar`. همچنین :term:`متغیر زمینه ` را ببینید." -msgid "A :class:`contextvars.Context` object. Also see :term:`current context`." -msgstr "یک شیء :class:`contextvars.Context`. همچنین :term:`زمینه فعلی ` را ببینید." +msgid "" +"A :class:`contextvars.Context` object. Also see :term:`current context`." +msgstr "" +"یک شیء :class:`contextvars.Context`. همچنین :term:`زمینه فعلی ` را ببینید." msgid "context management protocol" msgstr "پروتکل مدیریت زمینه" -msgid "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by the :keyword:`with` statement. See :pep:`343`." -msgstr "متدهای :meth:`~object.__enter__` و :meth:`~object.__exit__` که توسط دستور :keyword:`with` فراخوانی می‌شوند. :pep:`343` را ببینید." +msgid "" +"The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by" +" the :keyword:`with` statement. See :pep:`343`." +msgstr "" +"متدهای :meth:`~object.__enter__` و :meth:`~object.__exit__` که توسط دستور " +":keyword:`with` فراخوانی می‌شوند. :pep:`343` را ببینید." msgid "context manager" msgstr "مدیر زمینه" -msgid "An object which implements the :term:`context management protocol` and controls the environment seen in a :keyword:`with` statement. See :pep:`343`." -msgstr "شی‌ءای که :term:`پروتکل مدیریت زمینه ` را پیاده‌سازی می‌کند و محیط مشاهده‌شده در یک دستور :keyword:`with` را کنترل می‌کند. :pep:`343` را ببینید." +msgid "" +"An object which implements the :term:`context management protocol` and " +"controls the environment seen in a :keyword:`with` statement. See " +":pep:`343`." +msgstr "" +"شی‌ءای که :term:`پروتکل مدیریت زمینه ` را " +"پیاده‌سازی می‌کند و محیط مشاهده‌شده در یک دستور :keyword:`with` را کنترل " +"می‌کند. :pep:`343` را ببینید." msgid "context variable" msgstr "متغیر زمینه" -msgid "A variable whose value depends on which context is the :term:`current context`. Values are accessed via :class:`contextvars.ContextVar` objects. Context variables are primarily used to isolate state between concurrent asynchronous tasks." -msgstr "متغیری که مقدار آن به این بستگی دارد که کدام زمینه :term:`زمینه فعلی ` است. مقادیر از طریق اشیای :class:`contextvars.ContextVar` قابل دسترسی هستند. متغیرهای زمینه عمدتاً برای جداسازی وضعیت بین وظایف ناهمگام هم‌زمان استفاده می‌شوند." +msgid "" +"A variable whose value depends on which context is the :term:`current " +"context`. Values are accessed via :class:`contextvars.ContextVar` objects." +" Context variables are primarily used to isolate state between concurrent " +"asynchronous tasks." +msgstr "" +"متغیری که مقدار آن به این بستگی دارد که کدام زمینه :term:`زمینه فعلی " +"` است. مقادیر از طریق اشیای :class:`contextvars.ContextVar`" +" قابل دسترسی هستند. متغیرهای زمینه عمدتاً برای جداسازی وضعیت بین وظایف " +"ناهمگام همزمان استفاده می‌شوند." msgid "contiguous" msgstr "پیوسته" -msgid "A buffer is considered contiguous exactly if it is either *C-contiguous* or *Fortran contiguous*. Zero-dimensional buffers are C and Fortran contiguous. In one-dimensional arrays, the items must be laid out in memory next to each other, in order of increasing indexes starting from zero. In multidimensional C-contiguous arrays, the last index varies the fastest when visiting items in order of memory address. However, in Fortran contiguous arrays, the first index varies the fastest." -msgstr "یک بافر دقیقاً پیوسته در نظر گرفته می‌شود اگر یا *C-contiguous* یا *Fortran contiguous* باشد. بافرهای صفر‌بعدی هم C و هم Fortran پیوسته هستند. در آرایه‌های یک‌بعدی، آیتم‌ها باید در حافظه در کنار یکدیگر و به‌ترتیب اندیس‌های افزایشی که از صفر شروع می‌شوند قرار گرفته باشند. در آرایه‌های چندبعدی C-contiguous، هنگام بازدید از آیتم‌ها به‌ترتیب آدرس حافظه، آخرین اندیس سریع‌ترین تغییر را دارد. با این حال، در آرایه‌های Fortran contiguous، اولین اندیس سریع‌ترین تغییر را دارد." +msgid "" +"A buffer is considered contiguous exactly if it is either *C-contiguous* or " +"*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " +"contiguous. In one-dimensional arrays, the items must be laid out in memory" +" next to each other, in order of increasing indexes starting from zero. In " +"multidimensional C-contiguous arrays, the last index varies the fastest when" +" visiting items in order of memory address. However, in Fortran contiguous " +"arrays, the first index varies the fastest." +msgstr "" +"یک بافر دقیقاً پیوسته در نظر گرفته می‌شود اگر یا *C-contiguous* یا *Fortran " +"contiguous* باشد. بافرهای صفربعدی هم C و هم Fortran پیوسته هستند. در " +"آرایه‌های یک‌بعدی، آیتم‌ها باید در حافظه در کنار یکدیگر و به‌ترتیب اندیس‌های" +" افزایشی که از صفر شروع می‌شوند قرار گرفته باشند. در آرایه‌های چندبعدی " +"C-contiguous، هنگام بازدید از آیتم‌ها به‌ترتیب آدرس حافظه، آخرین اندیس " +"سریع‌ترین تغییر را دارد. با این حال، در آرایه‌های Fortran contiguous، اولین " +"اندیس سریع‌ترین تغییر را دارد." msgid "coroutine" msgstr "هم‌روال" -msgid "Coroutines are a more generalized form of subroutines. Subroutines are entered at one point and exited at another point. Coroutines can be entered, exited, and resumed at many different points. They can be implemented with the :keyword:`async def` statement. See also :pep:`492`." -msgstr "هم‌روال‌ها شکل کلی‌تری از زیرروال‌ها هستند. زیرروال‌ها از یک نقطه وارد و از نقطه‌ای دیگر خارج می‌شوند. هم‌روال‌ها می‌توانند از نقاط مختلفی وارد، خارج و از سر گرفته شوند. آن‌ها می‌توانند با دستور :keyword:`async def` پیاده‌سازی شوند. همچنین :pep:`492` را ببینید." +msgid "" +"Coroutines are a more generalized form of subroutines. Subroutines are " +"entered at one point and exited at another point. Coroutines can be " +"entered, exited, and resumed at many different points. They can be " +"implemented with the :keyword:`async def` statement. See also :pep:`492`." +msgstr "" +"هم‌روال‌ها شکل کلی‌تری از زیرروال‌ها هستند. زیرروال‌ها از یک نقطه وارد و از " +"نقطه‌ای دیگر خارج می‌شوند. هم‌روال‌ها می‌توانند از نقاط مختلفی وارد، خارج و " +"از سر گرفته شوند. آن‌ها می‌توانند با دستور :keyword:`async def` پیاده‌سازی " +"شوند. همچنین :pep:`492` را ببینید." msgid "coroutine function" msgstr "تابع هم‌روال" -msgid "A function which returns a :term:`coroutine` object. A coroutine function may be defined with the :keyword:`async def` statement, and may contain :keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. These were introduced by :pep:`492`." -msgstr "تابعی که یک شیء :term:`هم‌روال ` بازمی‌گرداند. یک تابع هم‌روال می‌تواند با دستور :keyword:`async def` تعریف شود و می‌تواند شامل کلیدواژه‌های :keyword:`await`، :keyword:`async for` و :keyword:`async with` باشد. این موارد توسط :pep:`492` معرفی شدند." +msgid "" +"A function which returns a :term:`coroutine` object. A coroutine function " +"may be defined with the :keyword:`async def` statement, and may contain " +":keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords." +" These were introduced by :pep:`492`." +msgstr "" +"تابعی که یک شیء :term:`هم‌روال ` بازمی‌گرداند. یک تابع هم‌روال " +"می‌تواند با دستور :keyword:`async def` تعریف شود و می‌تواند شامل " +"کلیدواژه‌های :keyword:`await`، :keyword:`async for` و :keyword:`async with` " +"باشد. این موارد توسط :pep:`492` معرفی شدند." msgid "CPython" msgstr "CPython" -msgid "The canonical implementation of the Python programming language, as distributed on `python.org `_. The term \"CPython\" is used when necessary to distinguish this implementation from others such as Jython or IronPython." -msgstr "پیاده‌سازی مرجع زبان برنامه‌نویسی پایتون، همان‌طور که در `python.org `_ توزیع می‌شود. اصطلاح «CPython» در مواقعی استفاده می‌شود که لازم باشد این پیاده‌سازی از موارد دیگری مانند Jython یا IronPython متمایز شود." +msgid "" +"The canonical implementation of the Python programming language, as " +"distributed on `python.org `_. The term \"CPython\"" +" is used when necessary to distinguish this implementation from others such " +"as Jython or IronPython." +msgstr "" +"پیاده‌سازی کانونیکال زبان برنامه‌نویسی پایتون، همان‌طور که در `python.org " +"`_ توزیع می‌شود. اصطلاح «CPython» در مواقعی استفاده " +"می‌شود که لازم باشد این پیاده‌سازی از موارد دیگری مانند Jython یا IronPython" +" متمایز شود." msgid "current context" msgstr "زمینه فعلی" -msgid "The :term:`context` (:class:`contextvars.Context` object) that is currently used by :class:`~contextvars.ContextVar` objects to access (get or set) the values of :term:`context variables `. Each thread has its own current context. Frameworks for executing asynchronous tasks (see :mod:`asyncio`) associate each task with a context which becomes the current context whenever the task starts or resumes execution." -msgstr ":term:`زمینه ` (:class:`contextvars.Context`) که در حال حاضر توسط اشیای :class:`~contextvars.ContextVar` برای دسترسی (دریافت یا تنظیم) مقادیر :term:`متغیر زمینه ` استفاده می‌شود. هر نخ، زمینهٔ فعلی خود را دارد. چارچوب‌های اجرای وظایف ناهمگام (به :mod:`asyncio` مراجعه کنید) هر وظیفه را با یک زمینه مرتبط می‌کنند که هر زمان وظیفه شروع یا ادامهٔ اجرا می‌دهد، به زمینهٔ فعلی تبدیل می‌شود." +msgid "" +"The :term:`context` (:class:`contextvars.Context` object) that is currently " +"used by :class:`~contextvars.ContextVar` objects to access (get or set) the " +"values of :term:`context variables `. Each thread has its" +" own current context. Frameworks for executing asynchronous tasks (see " +":mod:`asyncio`) associate each task with a context which becomes the current" +" context whenever the task starts or resumes execution." +msgstr "" +":term:`زمینه ` (:class:`contextvars.Context`) که در حال حاضر توسط " +"اشیای :class:`~contextvars.ContextVar` برای دسترسی (دریافت یا تنظیم) مقادیر " +":term:`متغیر زمینه ` استفاده می‌شود. هر نخ، زمینه‌ی فعلی " +"خود را دارد. چارچوب‌های اجرای وظایف ناهمگام (به :mod:`asyncio` مراجعه کنید) " +"هر وظیفه را با یک زمینه مرتبط می‌کنند که هر زمان وظیفه شروع یا ادامه‌ی اجرا " +"می‌دهد، به زمینه‌ی فعلی تبدیل می‌شود." msgid "cyclic isolate" -msgstr "جدایهٔ چرخه‌ای" +msgstr "جدایه‌ی چرخه‌ای" -msgid "A subgroup of one or more objects that reference each other in a reference cycle, but are not referenced by objects outside the group. The goal of the :term:`cyclic garbage collector ` is to identify these groups and break the reference cycles so that the memory can be reclaimed." -msgstr "زیرگروهی شامل یک یا چند شیء که در یک چرخهٔ ارجاع به یکدیگر ارجاع می‌دهند، اما توسط اشیای خارج از گروه ارجاع داده نمی‌شوند. هدف :term:`زباله‌روبی ` شناسایی این گروه‌ها و شکستن چرخه‌های ارجاع است تا حافظه بتواند بازیابی شود." +msgid "" +"A subgroup of one or more objects that reference each other in a reference " +"cycle, but are not referenced by objects outside the group. The goal of the" +" :term:`cyclic garbage collector ` is to identify these " +"groups and break the reference cycles so that the memory can be reclaimed." +msgstr "" +"زیرگروهی شامل یک یا چند شیء که در یک چرخه‌ی ارجاع به یکدیگر ارجاع می‌دهند، " +"اما توسط اشیای خارج از گروه ارجاع داده نمی‌شوند. هدف :term:`زباله‌روبی " +"` شناسایی این گروه‌ها و شکستن چرخه‌های ارجاع است تا " +"حافظه بتواند بازیابی شود." msgid "data race" msgstr "رقابت داده" -msgid "A situation where multiple threads access the same memory location concurrently, at least one of the accesses is a write, and the threads do not use any synchronization to control their access. Data races lead to :term:`non-deterministic` behavior and can cause data corruption. Proper use of :term:`locks ` and other :term:`synchronization primitives ` prevents data races. Note that data races can only happen in native code, but that :term:`native code` might be exposed in a Python API. See also :term:`race condition` and :term:`thread-safe`." -msgstr "وضعیتی که در آن چندین نخ به یک محل حافظهٔ یکسان به‌طور هم‌زمان دسترسی دارند، دست‌کم یکی از دسترسی‌ها نوشتن است و نخ‌ها برای کنترل دسترسی خود از هیچ همگام‌سازی‌ای استفاده نمی‌کنند. رقابت‌های داده به رفتار :term:`غیرقطعی ` منجر می‌شوند و می‌توانند باعث خرابی داده شوند. استفادهٔ درست از :term:`قفل ` و دیگر :term:`اولیه ` از رقابت‌های داده جلوگیری می‌کند. توجه داشته باشید که رقابت‌های داده فقط در کد بومی رخ می‌دهند، اما آن :term:`کد بومی ` ممکن است در یک API پایتون در معرض استفاده قرار گرفته باشد. همچنین :term:`شرط رقابت ` و :term:`ایمن برای نخ‌های اجرایی ` را ببینید." +msgid "" +"A situation where multiple threads access the same memory location " +"concurrently, at least one of the accesses is a write, and the threads do " +"not use any synchronization to control their access. Data races lead to " +":term:`non-deterministic` behavior and can cause data corruption. Proper use" +" of :term:`locks ` and other :term:`synchronization primitives " +"` prevents data races. Note that data races can " +"only happen in native code, but that :term:`native code` might be exposed in" +" a Python API. See also :term:`race condition` and :term:`thread-safe`." +msgstr "" +"وضعیتی که در آن چندین نخ به یک محل حافظه‌ی یکسان به‌طور همزمان دسترسی دارند،" +" دست‌کم یکی از دسترسی‌ها نوشتن است و نخ‌ها برای کنترل دسترسی خود از هیچ " +"همگام‌سازی‌ای استفاده نمی‌کنند. رقابت‌های داده به رفتار :term:`غیرقطعی ` منجر می‌شوند و می‌توانند باعث خرابی داده شوند. استفاده‌ی درست" +" از :term:`قفل ` و دیگر :term:`اولیه ` از " +"رقابت‌های داده جلوگیری می‌کند. توجه داشته باشید که رقابت‌های داده فقط در کد " +"بومی رخ می‌دهند، اما آن :term:`کد بومی ` ممکن است در یک API " +"پایتون در معرض استفاده قرار گرفته باشد. همچنین :term:`شرط رقابت ` و :term:`ایمن برای نخ‌های اجرایی ` را ببینید." msgid "deadlock" msgstr "بن‌بست" -msgid "A situation in which two or more tasks (threads, processes, or coroutines) wait indefinitely for each other to release resources or complete actions, preventing any from making progress. For example, if thread A holds lock 1 and waits for lock 2, while thread B holds lock 2 and waits for lock 1, both threads will wait indefinitely. In Python this often arises from acquiring multiple locks in conflicting orders or from circular join/await dependencies. Deadlocks can be avoided by always acquiring multiple :term:`locks ` in a consistent order. See also :term:`lock` and :term:`reentrant`." -msgstr "وضعیتی که در آن دو یا چند وظیفه (نخ‌ها، پردازه‌ها یا هم‌روال‌ها) به‌طور نامحدود منتظر می‌مانند تا یکدیگر منابع را آزاد کنند یا اقداماتی را کامل کنند، و در نتیجه هیچ‌کدام نمی‌توانند پیشرفت کنند. برای مثال، اگر نخ A قفل ۱ را در اختیار داشته باشد و منتظر قفل ۲ باشد، در حالی که نخ B قفل ۲ را در اختیار دارد و منتظر قفل ۱ است، هر دو نخ به‌طور نامحدود منتظر خواهند ماند. در پایتون، این وضعیت اغلب از دریافت چندین قفل با ترتیب‌های ناسازگار یا از وابستگی‌های join/await چرخه‌ای ایجاد می‌شود. می‌توان با همیشه دریافت کردن چندین :term:`قفل ` به یک ترتیب ثابت از بن‌بست‌ها جلوگیری کرد. همچنین :term:`قفل ` و :term:`بازورودپذیر ` را ببینید." +msgid "" +"A situation in which two or more tasks (threads, processes, or coroutines) " +"wait indefinitely for each other to release resources or complete actions, " +"preventing any from making progress. For example, if thread A holds lock 1 " +"and waits for lock 2, while thread B holds lock 2 and waits for lock 1, both" +" threads will wait indefinitely. In Python this often arises from acquiring" +" multiple locks in conflicting orders or from circular join/await " +"dependencies. Deadlocks can be avoided by always acquiring multiple " +":term:`locks ` in a consistent order. See also :term:`lock` and " +":term:`reentrant`." +msgstr "" +"وضعیتی که در آن دو یا چند وظیفه (نخ‌ها، پردازه‌ها یا هم‌روال‌ها) به‌طور " +"نامحدود منتظر می‌مانند تا یکدیگر منابع را آزاد کنند یا اقداماتی را کامل " +"کنند، و در نتیجه هیچ‌کدام نمی‌توانند پیشرفت کنند. برای مثال، اگر نخ A قفل ۱ " +"را در اختیار داشته باشد و منتظر قفل ۲ باشد، در حالی که نخ B قفل ۲ را در " +"اختیار دارد و منتظر قفل ۱ است، هر دو نخ به‌طور نامحدود منتظر خواهند ماند. در" +" پایتون، این وضعیت اغلب از دریافت چندین قفل با ترتیب‌های ناسازگار یا از " +"وابستگی‌های join/await چرخه‌ای ایجاد می‌شود. می‌توان با همیشه دریافت کردن " +"چندین :term:`قفل ` به یک ترتیب ثابت از بن‌بست‌ها جلوگیری کرد. همچنین " +":term:`قفل ` و :term:`بازورودپذیر ` را ببینید." msgid "decorator" msgstr "دکوراتور" -msgid "A function returning another function, usually applied as a function transformation using the ``@wrapper`` syntax. Common examples for decorators are :deco:`classmethod` and :deco:`staticmethod`." -msgstr "تابعی که تابع دیگری را بازمی‌گرداند و معمولاً با استفاده از سینتکس ``@wrapper`` به‌عنوان یک تبدیل تابع اعمال می‌شود. نمونه‌های رایج دکوراتورها :func:`classmethod` و :func:`staticmethod` هستند." +msgid "" +"A function returning another function, usually applied as a function " +"transformation using the ``@wrapper`` syntax. Common examples for " +"decorators are :deco:`classmethod` and :deco:`staticmethod`." +msgstr "" +"تابعی که تابع دیگری را بازمی‌گرداند و معمولاً با استفاده از سینتکس " +"``@wrapper`` به‌عنوان یک تبدیل تابع اعمال می‌شود. نمونه‌های رایج دکوراتورها " +":func:`classmethod` و :func:`staticmethod` هستند." -msgid "The decorator syntax is merely syntactic sugar, the following two function definitions are semantically equivalent::" -msgstr "سینتکس دکوراتور صرفاً یک قند نحوی (syntactic sugar) است؛ دو تعریف تابع زیر از نظر معنایی معادل هستند::" +msgid "" +"The decorator syntax is merely syntactic sugar, the following two function " +"definitions are semantically equivalent::" +msgstr "" +"سینتکس دکوراتور صرفاً یک قند نحوی (syntactic sugar) است؛ دو تعریف تابع زیر " +"از نظر معنایی معادل هستند::" msgid "" "def f(arg):\n" @@ -411,77 +953,194 @@ msgstr "" "def f(arg):\n" " ..." -msgid "The same concept exists for classes, but is less commonly used there. See the documentation for :ref:`function definitions ` and :ref:`class definitions ` for more about decorators." -msgstr "همین مفهوم برای کلاس‌ها نیز وجود دارد، اما استفاده از آن در آنجا کمتر رایج است. برای اطلاعات بیشتر دربارهٔ دکوراتورها، مستندات :ref:`function definitions ` و :ref:`class definitions ` را ببینید." +msgid "" +"The same concept exists for classes, but is less commonly used there. See " +"the documentation for :ref:`function definitions ` and :ref:`class" +" definitions ` for more about decorators." +msgstr "" +"همین مفهوم برای کلاس‌ها نیز وجود دارد، اما استفاده از آن در آنجا کمتر رایج است. برای اطلاعات بیشتر درباره‌ی دکوراتورها، مستندات :ref:`تابع ` و :ref:`کلاس ` را ببینید." msgid "descriptor" msgstr "توصیف‌گر" -msgid "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`. When a class attribute is a descriptor, its special binding behavior is triggered upon attribute lookup. Normally, using *a.b* to get, set or delete an attribute looks up the object named *b* in the class dictionary for *a*, but if *b* is a descriptor, the respective descriptor method gets called. Understanding descriptors is a key to a deep understanding of Python because they are the basis for many features including functions, methods, properties, class methods, static methods, and reference to super classes." -msgstr "هر شی‌ءای که متدهای :meth:`~object.__get__`، :meth:`~object.__set__` یا :meth:`~object.__delete__` را تعریف کند. هنگامی که یک ویژگی کلاس یک توصیف‌گر باشد، رفتار اتصال ویژهٔ آن هنگام جست‌وجوی ویژگی فعال می‌شود. معمولاً استفاده از *a.b* برای دریافت، تنظیم یا حذف یک ویژگی، شیء با نام *b* را در دیکشنری کلاس *a* جست‌وجو می‌کند، اما اگر *b* یک توصیف‌گر باشد، متد مربوط به توصیف‌گر فراخوانی می‌شود. درک توصیف‌گرها کلیدی برای درک عمیق پایتون است، زیرا آن‌ها پایهٔ بسیاری از قابلیت‌ها از جمله توابع، متدها، ویژگی‌ها، متدهای کلاس، متدهای ایستا و ارجاع به کلاس‌های بالادستی هستند." +msgid "" +"Any object which defines the methods :meth:`~object.__get__`, " +":meth:`~object.__set__`, or :meth:`~object.__delete__`. When a class " +"attribute is a descriptor, its special binding behavior is triggered upon " +"attribute lookup. Normally, using *a.b* to get, set or delete an attribute " +"looks up the object named *b* in the class dictionary for *a*, but if *b* is" +" a descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" +"هر شی‌ءای که متدهای :meth:`~object.__get__`، :meth:`~object.__set__` یا " +":meth:`~object.__delete__` را تعریف کند. هنگامی که یک ویژگی کلاس یک توصیف‌گر" +" باشد، رفتار اتصال ویژه‌ی آن هنگام جست‌وجوی ویژگی فعال می‌شود. معمولاً " +"استفاده از *a.b* برای دریافت، تنظیم یا حذف یک ویژگی، شیء با نام *b* را در " +"دیکشنری کلاس *a* جست‌وجو می‌کند، اما اگر *b* یک توصیف‌گر باشد، متد مربوط به " +"توصیف‌گر فراخوانی می‌شود. درک توصیف‌گرها کلیدی برای درک عمیق پایتون است، " +"زیرا آن‌ها پایه‌ی بسیاری از قابلیت‌ها از جمله توابع، متدها، ویژگی‌ها، متدهای " +"کلاس، متدهای ایستا و ارجاع به کلاس‌های بالادستی هستند." -msgid "For more information about descriptors' methods, see :ref:`descriptors` or the :ref:`Descriptor How To Guide `." -msgstr "برای اطلاعات بیشتر دربارهٔ متدهای توصیف‌گرها، :ref:`descriptors` یا :ref:`Descriptor How To Guide ` را ببینید." +msgid "" +"For more information about descriptors' methods, see :ref:`descriptors` or " +"the :ref:`Descriptor How To Guide `." +msgstr "" +"برای اطلاعات بیشتر درباره‌ی متدهای توصیف‌گرها، :ref:`descriptors` یا " +":ref:`Descriptor How To Guide ` را ببینید." msgid "dictionary" msgstr "دیکشنری" -msgid "An associative array, where arbitrary keys are mapped to values. The keys can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` methods. Called a hash in Perl." -msgstr "یک آرایهٔ انجمنی که در آن کلیدهای دلخواه به مقادیر نگاشت می‌شوند. کلیدها می‌توانند هر شیءای باشند که متدهای :meth:`~object.__hash__` و :meth:`~object.__eq__` را داشته باشد. در Perl به آن hash گفته می‌شود." +msgid "" +"An associative array, where arbitrary keys are mapped to values. The keys " +"can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " +"methods. Called a hash in Perl." +msgstr "" +"یک آرایه‌ی انجمنی که در آن کلیدهای دلخواه به مقادیر نگاشت می‌شوند. کلیدها " +"می‌توانند هر شیءای باشند که متدهای :meth:`~object.__hash__` و " +":meth:`~object.__eq__` را داشته باشد. در Perl به آن hash گفته می‌شود." msgid "dictionary comprehension" msgstr "درک دیکشنری" -msgid "A compact way to process all or part of the elements in an iterable and return a dictionary with the results. ``results = {n: n ** 2 for n in range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n ** 2``. See :ref:`comprehensions`." -msgstr "روشی فشرده برای پردازش همه یا بخشی از عناصر یک تکرارپذیر و بازگرداندن یک دیکشنری با نتایج. ``results = {n: n ** 2 for n in range(10)}`` یک دیکشنری ایجاد می‌کند که شامل کلید ``n`` نگاشت‌شده به مقدار ``n ** 2`` است. :ref:`comprehensions` را ببینید." +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a dictionary with the results. ``results = {n: n ** 2 for n in " +"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n" +" ** 2``. See :ref:`comprehensions`." +msgstr "" +"روشی فشرده برای پردازش همه یا بخشی از عناصر یک پیمایش‌پذیر و بازگرداندن یک " +"دیکشنری با نتایج. ``results = {n: n ** 2 for n in range(10)}`` یک دیکشنری " +"ایجاد می‌کند که شامل کلید ``n`` نگاشت‌شده به مقدار ``n ** 2`` است. " +":ref:`comprehensions` را ببینید." msgid "dictionary view" msgstr "نمای دیکشنری" -msgid "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:`dict.items` are called dictionary views. They provide a dynamic view on the dictionary’s entries, which means that when the dictionary changes, the view reflects these changes. To force the dictionary view to become a full list use ``list(dictview)``. See :ref:`dict-views`." -msgstr "اشیایی که توسط :meth:`dict.keys`، :meth:`dict.values` و :meth:`dict.items` بازگردانده می‌شوند، نماهای دیکشنری نامیده می‌شوند. آن‌ها نمایی پویا از ورودی‌های دیکشنری فراهم می‌کنند، به این معنا که هنگام تغییر دیکشنری، نما نیز این تغییرات را منعکس می‌کند. برای تبدیل نمای دیکشنری به یک فهرست کامل از ``list(dictview)`` استفاده کنید. :ref:`dict-views` را ببینید." +msgid "" +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and " +":meth:`dict.items` are called dictionary views. They provide a dynamic view " +"on the dictionary’s entries, which means that when the dictionary changes, " +"the view reflects these changes. To force the dictionary view to become a " +"full list use ``list(dictview)``. See :ref:`dict-views`." +msgstr "" +"اشیایی که توسط :meth:`dict.keys`، :meth:`dict.values` و :meth:`dict.items` " +"بازگردانده می‌شوند، نماهای دیکشنری نامیده می‌شوند. آن‌ها نمایی پویا از " +"ورودی‌های دیکشنری فراهم می‌کنند، به این معنا که هنگام تغییر دیکشنری، نما نیز" +" این تغییرات را منعکس می‌کند. برای تبدیل نمای دیکشنری به یک فهرست کامل از " +"``list(dictview)`` استفاده کنید. :ref:`dict-views` را ببینید." msgid "docstring" -msgstr "رشتهٔ مستندات" +msgstr "رشته‌ی مستندات" -msgid "A string literal which appears as the first expression in a class, function or module. While ignored when the suite is executed, it is recognized by the compiler and put into the :attr:`~definition.__doc__` attribute of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object." -msgstr "یک مقدار رشته‌ای که به‌عنوان اولین عبارت در یک کلاس، تابع یا ماژول ظاهر می‌شود. اگرچه هنگام اجرای مجموعه نادیده گرفته می‌شود، توسط کامپایلر شناسایی شده و در ویژگی :attr:`~definition.__doc__` کلاس، تابع یا ماژول دربرگیرنده قرار داده می‌شود. از آنجا که از طریق درون‌بینی در دسترس است، مکان استاندارد برای مستندسازی شیء محسوب می‌شود." +msgid "" +"A string literal which appears as the first expression in a class, function " +"or module. While ignored when the suite is executed, it is recognized by " +"the compiler and put into the :attr:`~definition.__doc__` attribute of the " +"enclosing class, function or module. Since it is available via " +"introspection, it is the canonical place for documentation of the object." +msgstr "" +"یک مقدار رشته‌ای که به‌عنوان اولین عبارت در یک کلاس، تابع یا ماژول ظاهر " +"می‌شود. اگرچه هنگام اجرای مجموعه نادیده گرفته می‌شود، توسط کامپایلر شناسایی " +"شده و در ویژگی :attr:`~definition.__doc__` کلاس، تابع یا ماژول دربرگیرنده " +"قرار داده می‌شود. از آنجا که از طریق درون‌بینی در دسترس است، مکان کانونیکال " +"برای مستندسازی شیء محسوب می‌شود." msgid "duck-typing" msgstr "نوع‌دهی اردکی" -msgid "A programming style which does not look at an object's type to determine if it has the right interface; instead, the method or attribute is simply called or used (\"If it looks like a duck and quacks like a duck, it must be a duck.\") By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck-typing avoids tests using :func:`type` or :func:`isinstance`. (Note, however, that duck-typing can be complemented with :term:`abstract base classes `.) Instead, it typically employs :func:`hasattr` tests or :term:`EAFP` programming." -msgstr "سبک برنامه‌نویسی‌ای که برای تعیین داشتن رابط مناسب توسط یک شیء، به نوع آن نگاه نمی‌کند؛ در عوض، متد یا ویژگی به‌سادگی فراخوانی یا استفاده می‌شود («اگر شبیه اردک است و مانند اردک صدا می‌دهد، پس باید اردک باشد.»). با تأکید بر رابط‌ها به‌جای نوع‌های خاص، کد با طراحی خوب با امکان جایگزینی چندریخت، انعطاف‌پذیری خود را افزایش می‌دهد. نوع‌دهی اردکی از آزمون‌های مبتنی بر :func:`type` یا :func:`isinstance` اجتناب می‌کند. (با این حال، توجه داشته باشید که نوع‌دهی اردکی می‌تواند با :term:`کلاس پایهٔ انتزاعی ` تکمیل شود.) در عوض، معمولاً از آزمون‌های :func:`hasattr` یا برنامه‌نویسی :term:`EAFP ` استفاده می‌کند." +msgid "" +"A programming style which does not look at an object's type to determine if " +"it has the right interface; instead, the method or attribute is simply " +"called or used (\"If it looks like a duck and quacks like a duck, it must be" +" a duck.\") By emphasizing interfaces rather than specific types, well-" +"designed code improves its flexibility by allowing polymorphic substitution." +" Duck-typing avoids tests using :func:`type` or :func:`isinstance`. (Note," +" however, that duck-typing can be complemented with :term:`abstract base " +"classes `.) Instead, it typically employs " +":func:`hasattr` tests or :term:`EAFP` programming." +msgstr "" +"سبک برنامه‌نویسی‌ای که برای تعیین داشتن رابط مناسب توسط یک شیء، به نوع آن " +"نگاه نمی‌کند؛ در عوض، متد یا ویژگی به‌سادگی فراخوانی یا استفاده می‌شود («اگر" +" شبیه اردک است و مانند اردک صدا می‌دهد، پس باید اردک باشد.»). با تأکید بر " +"رابط‌ها به‌جای نوع‌های خاص، کد با طراحی خوب با امکان جایگزینی چندریخت، " +"انعطاف‌پذیری خود را افزایش می‌دهد. نوع‌دهی اردکی از آزمون‌های مبتنی بر " +":func:`type` یا :func:`isinstance` اجتناب می‌کند. (با این حال، توجه داشته " +"باشید که نوع‌دهی اردکی می‌تواند با :term:`کلاس پایه‌ی انتزاعی ` تکمیل شود.) در عوض، معمولاً از آزمون‌های :func:`hasattr` یا " +"برنامه‌نویسی :term:`EAFP ` استفاده می‌کند." msgid "dunder" msgstr "داندر" -msgid "An informal short-hand for \"double underscore\", used when talking about a :term:`special method`. For example, ``__init__`` is often pronounced \"dunder init\"." -msgstr "یک شکل کوتاه و غیررسمی برای «دو زیرخط» که هنگام صحبت دربارهٔ یک :term:`متد ویژه ` استفاده می‌شود. برای مثال، ``__init__`` اغلب «داندر اینیت» تلفظ می‌شود." +msgid "" +"An informal short-hand for \"double underscore\", used when talking about a " +":term:`special method`. For example, ``__init__`` is often pronounced " +"\"dunder init\"." +msgstr "" +"یک شکل کوتاه و غیررسمی برای «دو زیرخط» که هنگام صحبت درباره‌ی یک :term:`متد " +"ویژه ` استفاده می‌شود. برای مثال، ``__init__`` اغلب «داندر " +"اینیت» تلفظ می‌شود." msgid "EAFP" msgstr "EAFP" -msgid "Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many :keyword:`try` and :keyword:`except` statements. The technique contrasts with the :term:`LBYL` style common to many other languages such as C." -msgstr "آسان‌تر است که درخواست بخشش کنید تا اجازه. این سبک رایج کدنویسی پایتون وجود کلیدها یا ویژگی‌های معتبر را فرض می‌کند و اگر این فرض نادرست باشد، استثناها را دریافت می‌کند. این سبک پاک و سریع با وجود تعداد زیادی دستورهای :keyword:`try` و :keyword:`except` شناخته می‌شود. این روش در تضاد با سبک :term:`LBYL ` است که در بسیاری از زبان‌های دیگر مانند C رایج است." +msgid "" +"Easier to ask for forgiveness than permission. This common Python coding " +"style assumes the existence of valid keys or attributes and catches " +"exceptions if the assumption proves false. This clean and fast style is " +"characterized by the presence of many :keyword:`try` and :keyword:`except` " +"statements. The technique contrasts with the :term:`LBYL` style common to " +"many other languages such as C." +msgstr "" +"آسان‌تر است که درخواست بخشش کنید تا اجازه. این سبک رایج کدنویسی پایتون وجود " +"کلیدها یا ویژگی‌های معتبر را فرض می‌کند و اگر این فرض نادرست باشد، استثناها " +"را دریافت می‌کند. این سبک پاک و سریع با وجود تعداد زیادی دستورهای " +":keyword:`try` و :keyword:`except` شناخته می‌شود. این روش در تضاد با سبک " +":term:`LBYL ` است که در بسیاری از زبان‌های دیگر مانند C رایج است." msgid "evaluate function" msgstr "تابع ارزیابی" -msgid "A function that can be called to evaluate a lazily evaluated attribute of an object, such as the value of type aliases created with the :keyword:`type` statement." -msgstr "تابعی که می‌توان آن را برای ارزیابی یک ویژگی با ارزیابی تنبل یک شیء فراخوانی کرد، مانند مقدار نام‌های مستعار نوع که با دستور :keyword:`type` ایجاد شده‌اند." +msgid "" +"A function that can be called to evaluate a lazily evaluated attribute of an" +" object, such as the value of type aliases created with the :keyword:`type` " +"statement." +msgstr "" +"تابعی که می‌توان آن را برای ارزیابی یک ویژگی با ارزیابی تنبل یک شیء فراخوانی" +" کرد، مانند مقدار نام‌های مستعار نوع که با دستور :keyword:`type` ایجاد " +"شده‌اند." msgid "expression" msgstr "عبارت" -msgid "A piece of syntax which can be evaluated to some value. In other words, an expression is an accumulation of expression elements like literals, names, attribute access, operators or function calls which all return a value. In contrast to many other languages, not all language constructs are expressions. There are also :term:`statement`\\s which cannot be used as expressions, such as :keyword:`while`. Assignments are also statements, not expressions." -msgstr "بخشی از سینتکس که می‌تواند به یک مقدار ارزیابی شود. به بیان دیگر، یک عبارت مجموعه‌ای از عناصر عبارت مانند لفظ‌ها، نام‌ها، دسترسی به ویژگی، عملگرها یا فراخوانی‌های تابع است که همه مقداری بازمی‌گردانند. برخلاف بسیاری از زبان‌های دیگر، همهٔ ساختارهای زبان عبارت نیستند. همچنین :term:`دستور `\\هایی وجود دارند که نمی‌توان از آن‌ها به‌عنوان عبارت استفاده کرد، مانند :keyword:`while`. تخصیص‌ها نیز دستور هستند، نه عبارت." +msgid "" +"A piece of syntax which can be evaluated to some value. In other words, an " +"expression is an accumulation of expression elements like literals, names, " +"attribute access, operators or function calls which all return a value. In " +"contrast to many other languages, not all language constructs are " +"expressions. There are also :term:`statement`\\s which cannot be used as " +"expressions, such as :keyword:`while`. Assignments are also statements, not" +" expressions." +msgstr "" +"بخشی از سینتکس که می‌تواند به یک مقدار ارزیابی شود. به بیان دیگر، یک عبارت " +"مجموعه‌ای از عناصر عبارت مانند لفظ‌ها، نام‌ها، دسترسی به ویژگی، عملگرها یا " +"فراخوانی‌های تابع است که همه مقداری بازمی‌گردانند. برخلاف بسیاری از زبان‌های" +" دیگر، همه‌ی ساختارهای زبان عبارت نیستند. همچنین :term:`دستور " +"`\\هایی وجود دارند که نمی‌توان از آن‌ها به‌عنوان عبارت استفاده " +"کرد، مانند :keyword:`while`. تخصیص‌ها نیز دستور هستند، نه عبارت." msgid "extension module" msgstr "ماژول افزونه" -msgid "A module written in C or C++, using Python's C API to interact with the core and with user code." -msgstr "ماژول نوشته‌شده به زبان C یا C++ که از API زبان C پایتون برای تعامل با هسته و کد کاربر استفاده می‌کند." +msgid "" +"A module written in C or C++, using Python's C API to interact with the core" +" and with user code." +msgstr "" +"ماژول نوشته‌شده به زبان C یا C++ که از API زبان C پایتون برای تعامل با هسته " +"و کد کاربر استفاده می‌کند." msgid "f-string" msgstr "اف‌استرینگ" @@ -489,17 +1148,42 @@ msgstr "اف‌استرینگ" msgid "f-strings" msgstr "اف‌استرینگ‌ها" -msgid "String literals prefixed with ``f`` or ``F`` are commonly called \"f-strings\" which is short for :ref:`formatted string literals `. See also :pep:`498`." -msgstr "رشته‌های لفظی که با ``f`` یا ``F`` پیشوندگذاری شده‌اند، معمولاً «اف‌استرینگ» نامیده می‌شوند که کوتاه‌شدهٔ :ref:`formatted string literals ` است. همچنین :pep:`498` را ببینید." +msgid "" +"String literals prefixed with ``f`` or ``F`` are commonly called " +"\"f-strings\" which is short for :ref:`formatted string literals " +"`. See also :pep:`498`." +msgstr "" +"رشته‌های لفظی که با ``f`` یا ``F`` پیشوندگذاری شده‌اند، معمولاً «اف‌استرینگ» نامیده می‌شوند که کوتاه‌شده‌ی :ref:`اف‌استرینگ‌ها ` است. همچنین :pep:`498` را ببینید." msgid "file object" msgstr "شیء فایل" -msgid "An object exposing a file-oriented API (with methods such as :meth:`!read` or :meth:`!write`) to an underlying resource. Depending on the way it was created, a file object can mediate access to a real on-disk file or to another type of storage or communication device (for example standard input/output, in-memory buffers, sockets, pipes, etc.). File objects are also called :dfn:`file-like objects` or :dfn:`streams`." -msgstr "شی‌ءای که یک API فایل‌محور (با متدهایی مانند :meth:`!read` یا :meth:`!write`) برای یک منبع زیربنایی ارائه می‌دهد. بسته به نحوهٔ ایجاد آن، یک شیء فایل می‌تواند دسترسی به یک فایل واقعی روی دیسک یا نوع دیگری از فضای ذخیره‌سازی یا دستگاه ارتباطی را مدیریت کند (برای مثال ورودی/خروجی استاندارد، بافرهای درون‌حافظه‌ای، سوکت‌ها، پایپ‌ها و غیره). اشیای فایل همچنین با نام‌های :dfn:`file-like objects` یا :dfn:`streams` شناخته می‌شوند." +msgid "" +"An object exposing a file-oriented API (with methods such as :meth:`!read` " +"or :meth:`!write`) to an underlying resource. Depending on the way it was " +"created, a file object can mediate access to a real on-disk file or to " +"another type of storage or communication device (for example standard " +"input/output, in-memory buffers, sockets, pipes, etc.). File objects are " +"also called :dfn:`file-like objects` or :dfn:`streams`." +msgstr "" +"شی‌ءای که یک API فایل‌محور (با متدهایی مانند :meth:`!read` یا " +":meth:`!write`) برای یک منبع زیربنایی ارائه می‌دهد. بسته به نحوه‌ی ایجاد آن، " +"یک شیء فایل می‌تواند دسترسی به یک فایل واقعی روی دیسک یا نوع دیگری از فضای " +"ذخیره‌سازی یا دستگاه ارتباطی را مدیریت کند (برای مثال ورودی/خروجی استاندارد،" +" بافرهای درون‌حافظه‌ای، سوکت‌ها، پایپ‌ها و غیره). اشیای فایل همچنین با " +"نام‌های :dfn:`file-like objects` یا :dfn:`streams` شناخته می‌شوند." -msgid "There are actually three categories of file objects: raw :term:`binary files `, buffered :term:`binary files ` and :term:`text files `. Their interfaces are defined in the :mod:`io` module. The canonical way to create a file object is by using the :func:`open` function." -msgstr "در واقع سه دسته از اشیای فایل وجود دارد: :term:`فایل دودویی ` خام، :term:`فایل دودویی ` بافرشده و :term:`فایل متنی `. رابط‌های آن‌ها در ماژول :mod:`io` تعریف شده‌اند. روش استاندارد ایجاد یک شیء فایل، استفاده از تابع :func:`open` است." +msgid "" +"There are actually three categories of file objects: raw :term:`binary files" +" `, buffered :term:`binary files ` and :term:`text" +" files `. Their interfaces are defined in the :mod:`io` module. " +"The canonical way to create a file object is by using the :func:`open` " +"function." +msgstr "" +"در واقع سه دسته از اشیای فایل وجود دارد: :term:`فایل دودویی ` " +"خام، :term:`فایل دودویی ` بافرشده و :term:`فایل متنی `. رابط‌های آن‌ها در ماژول :mod:`io` تعریف شده‌اند. روش کانونیکال ایجاد" +" یک شیء فایل، استفاده از تابع :func:`open` است." msgid "file-like object" msgstr "شیء شبه‌فایل" @@ -508,52 +1192,112 @@ msgid "A synonym for :term:`file object`." msgstr "هم‌معنای :term:`شیء فایل `." msgid "filesystem encoding and error handler" -msgstr "کدگذاری سیستم فایل و مدیریت‌کنندهٔ خطا" +msgstr "کدگذاری سیستم فایل و هندلر خطا" -msgid "Encoding and error handler used by Python to decode bytes from the operating system and encode Unicode to the operating system." -msgstr "کدگذاری و مدیریت‌کنندهٔ خطایی که پایتون برای کدگشایی بایت‌ها از سیستم‌عامل و کدگذاری یونیکد به سیستم‌عامل استفاده می‌کند." +msgid "" +"Encoding and error handler used by Python to decode bytes from the operating" +" system and encode Unicode to the operating system." +msgstr "" +"کدگذاری و هندلر خطایی که پایتون برای کدگشایی بایت‌ها از سیستم‌عامل و" +" کدگذاری یونیکد به سیستم‌عامل استفاده می‌کند." -msgid "The filesystem encoding must guarantee to successfully decode all bytes below 128. If the file system encoding fails to provide this guarantee, API functions can raise :exc:`UnicodeError`." -msgstr "کدگذاری سیستم فایل باید تضمین کند که همهٔ بایت‌های کمتر از ۱۲۸ را با موفقیت کدگشایی می‌کند. اگر کدگذاری سیستم فایل نتواند این تضمین را ارائه دهد، توابع API ممکن است استثنای :exc:`UnicodeError` ایجاد کنند." +msgid "" +"The filesystem encoding must guarantee to successfully decode all bytes " +"below 128. If the file system encoding fails to provide this guarantee, API " +"functions can raise :exc:`UnicodeError`." +msgstr "" +"کدگذاری سیستم فایل باید تضمین کند که همه‌ی بایت‌های کمتر از ۱۲۸ را با موفقیت " +"کدگشایی می‌کند. اگر کدگذاری سیستم فایل نتواند این تضمین را ارائه دهد، توابع " +"API ممکن است استثنای :exc:`UnicodeError` ایجاد کنند." -msgid "The :func:`sys.getfilesystemencoding` and :func:`sys.getfilesystemencodeerrors` functions can be used to get the filesystem encoding and error handler." -msgstr "از توابع :func:`sys.getfilesystemencoding` و :func:`sys.getfilesystemencodeerrors` می‌توان برای دریافت کدگذاری سیستم فایل و مدیریت‌کنندهٔ خطا استفاده کرد." +msgid "" +"The :func:`sys.getfilesystemencoding` and " +":func:`sys.getfilesystemencodeerrors` functions can be used to get the " +"filesystem encoding and error handler." +msgstr "" +"از توابع :func:`sys.getfilesystemencoding` و " +":func:`sys.getfilesystemencodeerrors` می‌توان برای دریافت کدگذاری سیستم فایل" +" و هندلر خطا استفاده کرد." -msgid "The :term:`filesystem encoding and error handler` are configured at Python startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." -msgstr ":term:`کدگذاری سیستم فایل و مدیریت‌کنندهٔ خطا ` در هنگام راه‌اندازی پایتون توسط تابع :c:func:`PyConfig_Read` پیکربندی می‌شوند: اعضای :c:member:`~PyConfig.filesystem_encoding` و :c:member:`~PyConfig.filesystem_errors` از :c:type:`PyConfig` را ببینید." +msgid "" +"The :term:`filesystem encoding and error handler` are configured at Python " +"startup by the :c:func:`PyConfig_Read` function: see " +":c:member:`~PyConfig.filesystem_encoding` and " +":c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +msgstr "" +":term:`کدگذاری سیستم فایل و هندلر خطا ` در هنگام راه‌اندازی پایتون توسط تابع :c:func:`PyConfig_Read` " +"پیکربندی می‌شوند: اعضای :c:member:`~PyConfig.filesystem_encoding` و " +":c:member:`~PyConfig.filesystem_errors` از :c:type:`PyConfig` را ببینید." msgid "See also the :term:`locale encoding`." -msgstr "همچنین :term:`کدگذاری محلی ` را ببینید." +msgstr "همچنین :term:`کدگذاری locale ` را ببینید." msgid "finder" msgstr "یابنده" -msgid "An object that tries to find the :term:`loader` for a module that is being imported." -msgstr "شیءای که تلاش می‌کند :term:`بارگذار ` مربوط به ماژولی را که در حال ایمپورت شدن است پیدا کند." +msgid "" +"An object that tries to find the :term:`loader` for a module that is being " +"imported." +msgstr "" +"شیءای که تلاش می‌کند :term:`بارگذار ` مربوط به ماژولی را که در حال " +"ایمپورت شدن است پیدا کند." -msgid "There are two types of finder: :term:`meta path finders ` for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." -msgstr "دو نوع یابنده وجود دارد: :term:`یابندهٔ مسیر فراداده ` برای استفاده با :data:`sys.meta_path` و :term:`یابندهٔ ورودی مسیر ` برای استفاده با :data:`sys.path_hooks`." +msgid "" +"There are two types of finder: :term:`meta path finders ` " +"for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." +msgstr "" +"دو نوع یابنده وجود دارد: :term:`یابنده‌ی مسیر فراداده ` " +"برای استفاده با :data:`sys.meta_path` و :term:`یابنده‌ی ورودی مسیر ` برای استفاده با :data:`sys.path_hooks`." -msgid "See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." -msgstr "برای جزئیات بسیار بیشتر، :ref:`finders-and-loaders` و :mod:`importlib` را ببینید." +msgid "" +"See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." +msgstr "" +"برای جزئیات بسیار بیشتر، :ref:`finders-and-loaders` و :mod:`importlib` را " +"ببینید." msgid "floor division" msgstr "تقسیم کف" -msgid "Mathematical division that rounds down to nearest integer. The floor division operator is ``//``. For example, the expression ``11 // 4`` evaluates to ``2`` in contrast to the ``2.75`` returned by float true division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` rounded *downward*. See :pep:`238`." -msgstr "تقسیم ریاضی که به نزدیک‌ترین عدد صحیح پایین گرد می‌شود. عملگر تقسیم کف ``//`` است. برای مثال، عبارت ``11 // 4`` به ``2`` ارزیابی می‌شود، در حالی که تقسیم حقیقی با عدد اعشاری مقدار ``2.75`` را بازمی‌گرداند. توجه داشته باشید که ``(-11) // 4`` برابر ``-3`` است، زیرا ``-2.75`` به سمت *پایین* گرد می‌شود. :pep:`238` را ببینید." +msgid "" +"Mathematical division that rounds down to nearest integer. The floor " +"division operator is ``//``. For example, the expression ``11 // 4`` " +"evaluates to ``2`` in contrast to the ``2.75`` returned by float true " +"division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` " +"rounded *downward*. See :pep:`238`." +msgstr "" +"تقسیم ریاضی که به نزدیک‌ترین عدد صحیح پایین گرد می‌شود. عملگر تقسیم کف " +"``//`` است. برای مثال، عبارت ``11 // 4`` به ``2`` ارزیابی می‌شود، در حالی که" +" تقسیم حقیقی با عدد اعشاری مقدار ``2.75`` را بازمی‌گرداند. توجه داشته باشید " +"که ``(-11) // 4`` برابر ``-3`` است، زیرا ``-2.75`` به سمت *پایین* گرد " +"می‌شود. :pep:`238` را ببینید." msgid "free threading" msgstr "نخ‌گذاری آزاد" -msgid "A threading model where multiple threads can run Python bytecode simultaneously within the same interpreter. This is in contrast to the :term:`global interpreter lock` which allows only one thread to execute Python bytecode at a time. See :pep:`703`." -msgstr "مدل نخ‌ای که در آن چندین نخ می‌توانند بایت‌کد پایتون را به‌طور هم‌زمان درون همان مفسر اجرا کنند. این در تضاد با :term:`قفل مفسر سراسری ` است که اجازه می‌دهد فقط یک نخ در هر زمان بایت‌کد پایتون را اجرا کند. :pep:`703` را ببینید." +msgid "" +"A threading model where multiple threads can run Python bytecode " +"simultaneously within the same interpreter. This is in contrast to the " +":term:`global interpreter lock` which allows only one thread to execute " +"Python bytecode at a time. See :pep:`703`." +msgstr "" +"مدل نخ‌ای که در آن چندین نخ می‌توانند بایت‌کد پایتون را به‌طور همزمان درون " +"همان مفسر اجرا کنند. این در تضاد با :term:`قفل مفسر سراسری ` است که اجازه می‌دهد فقط یک نخ در هر زمان بایت‌کد پایتون " +"را اجرا کند. :pep:`703` را ببینید." msgid "free-threaded build" msgstr "ساخت نخ‌آزاد" -msgid "A build of :term:`CPython` that supports :term:`free threading`, configured using the :option:`--disable-gil` option before compilation." -msgstr "ساختی از :term:`CPython ` که از :term:`نخ‌گذاری آزاد ` پشتیبانی می‌کند و با استفاده از گزینهٔ :option:`--disable-gil` پیش از کامپایل پیکربندی شده است." +msgid "" +"A build of :term:`CPython` that supports :term:`free threading`, configured " +"using the :option:`--disable-gil` option before compilation." +msgstr "" +"ساختی از :term:`CPython ` که از :term:`نخ‌گذاری آزاد ` پشتیبانی می‌کند و با استفاده از گزینه‌ی :option:`--disable-gil` " +"پیش از کامپایل پیکربندی شده است." msgid "See :ref:`freethreading-python-howto`." msgstr ":ref:`freethreading-python-howto` را ببینید." @@ -561,23 +1305,47 @@ msgstr ":ref:`freethreading-python-howto` را ببینید." msgid "free variable" msgstr "متغیر آزاد" -msgid "Formally, as defined in the :ref:`language execution model `, a free variable is any variable used in a namespace which is not a local variable in that namespace. See :term:`closure variable` for an example. Pragmatically, due to the name of the :attr:`codeobject.co_freevars` attribute, the term is also sometimes used as a synonym for :term:`closure variable`." -msgstr "به‌صورت رسمی، همان‌طور که در :ref:`language execution model ` تعریف شده است، یک متغیر آزاد هر متغیری است که در یک نام‌فضا استفاده می‌شود اما در آن نام‌فضا یک متغیر محلی نیست. برای نمونه، :term:`متغیر بستار ` را ببینید. از نظر عملی، به‌دلیل نام ویژگی :attr:`codeobject.co_freevars`، این اصطلاح گاهی به‌عنوان مترادفی برای :term:`متغیر بستار ` نیز استفاده می‌شود." +msgid "" +"Formally, as defined in the :ref:`language execution model `, a " +"free variable is any variable used in a namespace which is not a local " +"variable in that namespace. See :term:`closure variable` for an example. " +"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " +"attribute, the term is also sometimes used as a synonym for :term:`closure " +"variable`." +msgstr "" +"به‌صورت رسمی، همان‌طور که در :ref:`language execution model ` " +"تعریف شده است، یک متغیر آزاد هر متغیری است که در یک فضای نام استفاده می‌شود " +"اما در آن فضای نام یک متغیر محلی نیست. برای نمونه، :term:`متغیر بستار " +"` را ببینید. از نظر عملی، به‌دلیل نام ویژگی " +":attr:`codeobject.co_freevars`، این اصطلاح گاهی به‌عنوان مترادفی برای " +":term:`متغیر بستار ` نیز استفاده می‌شود." msgid "function" msgstr "تابع" -msgid "A series of statements which returns some value to a caller. It can also be passed zero or more :term:`arguments ` which may be used in the execution of the body. See also :term:`parameter`, :term:`method`, and the :ref:`function` section." -msgstr "مجموعه‌ای از دستورها که مقداری را به یک فراخواننده بازمی‌گرداند. همچنین می‌تواند صفر یا چند :term:`آرگومان ` دریافت کند که ممکن است در اجرای بدنه استفاده شوند. همچنین :term:`پارامتر `، :term:`متد ` و بخش :ref:`function` را ببینید." +msgid "" +"A series of statements which returns some value to a caller. It can also be " +"passed zero or more :term:`arguments ` which may be used in the " +"execution of the body. See also :term:`parameter`, :term:`method`, and the " +":ref:`function` section." +msgstr "" +"مجموعه‌ای از دستورها که مقداری را به یک فراخواننده بازمی‌گرداند. همچنین می‌تواند صفر یا چند :term:`آرگومان ` دریافت کند که ممکن است در اجرای بدنه استفاده شوند. همچنین :term:`پارامتر `، :term:`متد ` و بخش :ref:`تابع ` را ببینید." msgid "function annotation" msgstr "حاشیه‌گذاری تابع" msgid "An :term:`annotation` of a function parameter or return value." -msgstr "یک :term:`حاشیه‌گذاری ` برای پارامتر یک تابع یا مقدار بازگشتی." +msgstr "" +"یک :term:`حاشیه‌گذاری ` برای پارامتر یک تابع یا مقدار بازگشتی." -msgid "Function annotations are usually used for :term:`type hints `: for example, this function is expected to take two :class:`int` arguments and is also expected to have an :class:`int` return value::" -msgstr "حاشیه‌گذاری‌های تابع معمولاً برای :term:`راهنمای نوع ` استفاده می‌شوند: برای مثال، انتظار می‌رود این تابع دو آرگومان :class:`int` دریافت کند و همچنین یک مقدار بازگشتی :class:`int` داشته باشد::" +msgid "" +"Function annotations are usually used for :term:`type hints `: " +"for example, this function is expected to take two :class:`int` arguments " +"and is also expected to have an :class:`int` return value::" +msgstr "" +"حاشیه‌گذاری‌های تابع معمولاً برای :term:`راهنمای نوع ` استفاده " +"می‌شوند: برای مثال، انتظار می‌رود این تابع دو آرگومان :class:`int` دریافت " +"کند و همچنین یک مقدار بازگشتی :class:`int` داشته باشد::" msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" @@ -587,16 +1355,36 @@ msgstr "" " return a + b" msgid "Function annotation syntax is explained in section :ref:`function`." -msgstr "نحو حاشیه‌گذاری تابع در بخش :ref:`function` توضیح داده شده است." +msgstr "نحو حاشیه‌گذاری تابع در بخش :ref:`تابع ` توضیح داده شده است." -msgid "See :term:`variable annotation` and :pep:`484`, which describe this functionality. Also see :ref:`annotations-howto` for best practices on working with annotations." -msgstr "به :term:`حاشیه‌نویسی متغیر ` و :pep:`484` مراجعه کنید که این قابلیت را توضیح می‌دهند. همچنین برای بهترین روش‌ها در کار با حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." +msgid "" +"See :term:`variable annotation` and :pep:`484`, which describe this " +"functionality. Also see :ref:`annotations-howto` for best practices on " +"working with annotations." +msgstr "" +"به :term:`حاشیه‌نویسی متغیر ` و :pep:`484` مراجعه کنید " +"که این قابلیت را توضیح می‌دهند. همچنین برای بهترین روش‌ها در کار با " +"حاشیه‌گذاری‌ها، :ref:`annotations-howto` را ببینید." msgid "__future__" msgstr "__future__" -msgid "A :ref:`future statement `, ``from __future__ import ``, directs the compiler to compile the current module using syntax or semantics that will become standard in a future release of Python. The :mod:`__future__` module documents the possible values of *feature*. By importing this module and evaluating its variables, you can see when a new feature was first added to the language and when it will (or did) become the default::" -msgstr "یک :ref:`future statement `، یعنی ``from __future__ import ``, به کامپایلر دستور می‌دهد ماژول فعلی را با استفاده از سینتکس یا معناشناسی‌ای کامپایل کند که در یک انتشار آیندهٔ پایتون استاندارد خواهد شد. ماژول :mod:`__future__` مقادیر ممکن *feature* را مستند می‌کند. با ایمپورت این ماژول و ارزیابی متغیرهای آن، می‌توانید ببینید چه زمانی یک ویژگی جدید برای اولین بار به زبان اضافه شده است و چه زمانی به حالت پیش‌فرض تبدیل خواهد شد (یا شده است)::" +msgid "" +"A :ref:`future statement `, ``from __future__ import ``, " +"directs the compiler to compile the current module using syntax or semantics" +" that will become standard in a future release of Python. The " +":mod:`__future__` module documents the possible values of *feature*. By " +"importing this module and evaluating its variables, you can see when a new " +"feature was first added to the language and when it will (or did) become the" +" default::" +msgstr "" +"یک :ref:`future statement `، یعنی ``from __future__ import " +"``, به کامپایلر دستور می‌دهد ماژول فعلی را با استفاده از سینتکس یا " +"معناشناسی‌ای کامپایل کند که در یک انتشار آینده‌ی پایتون استاندارد خواهد شد. " +"ماژول :mod:`__future__` مقادیر ممکن *feature* را مستند می‌کند. با ایمپورت " +"این ماژول و ارزیابی متغیرهای آن، می‌توانید ببینید چه زمانی یک ویژگی جدید " +"برای اولین بار به زبان اضافه شده است و چه زمانی به حالت پیش‌فرض تبدیل خواهد " +"شد (یا شده است)::" msgid "" ">>> import __future__\n" @@ -610,38 +1398,92 @@ msgstr "" msgid "garbage collection" msgstr "زباله‌روبی" -msgid "The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. The garbage collector can be controlled using the :mod:`gc` module." -msgstr "فرایند آزادسازی حافظه هنگامی که دیگر استفاده نمی‌شود. پایتون زباله‌روبی را از طریق شمارش ارجاع‌ها و یک زباله‌روب چرخه‌ای که قادر به شناسایی و شکستن چرخه‌های ارجاع است انجام می‌دهد. زباله‌روب را می‌توان با استفاده از ماژول :mod:`gc` کنترل کرد." +msgid "" +"The process of freeing memory when it is not used anymore. Python performs " +"garbage collection via reference counting and a cyclic garbage collector " +"that is able to detect and break reference cycles. The garbage collector " +"can be controlled using the :mod:`gc` module." +msgstr "" +"فرایند آزادسازی حافظه هنگامی که دیگر استفاده نمی‌شود. پایتون زباله‌روبی را " +"از طریق شمارش ارجاع‌ها و یک زباله‌روب چرخه‌ای که قادر به شناسایی و شکستن " +"چرخه‌های ارجاع است انجام می‌دهد. زباله‌روب را می‌توان با استفاده از ماژول " +":mod:`gc` کنترل کرد." msgid "generator" msgstr "تولیدگر" -msgid "Informally used to mean either a :term:`generator function` or a :term:`generator iterator`, depending on context. The formal terms :term:`generator function` and :term:`generator iterator` are uncommon in practice; \"generator\" alone is almost always sufficient." -msgstr "به‌صورت غیررسمی برای اشاره به یک :term:`تابع تولیدگر ` یا یک :term:`تکرارگر تولیدگر `، بسته به زمینه، استفاده می‌شود. اصطلاحات رسمی :term:`تابع تولیدگر ` و :term:`تکرارگر تولیدگر ` در عمل کمتر استفاده می‌شوند؛ «تولیدگر» به‌تنهایی تقریباً همیشه کافی است." +msgid "" +"Informally used to mean either a :term:`generator function` or a " +":term:`generator iterator`, depending on context. The formal terms " +":term:`generator function` and :term:`generator iterator` are uncommon in " +"practice; \"generator\" alone is almost always sufficient." +msgstr "" +"به‌صورت غیررسمی برای اشاره به یک :term:`تابع تولیدگر ` " +"یا یک :term:`پیمایش‌گر تولیدگر `، بسته به زمینه، استفاده " +"می‌شود. اصطلاحات رسمی :term:`تابع تولیدگر ` و " +":term:`پیمایش‌گر تولیدگر ` در عمل کمتر استفاده می‌شوند؛ " +"«تولیدگر» به‌تنهایی تقریباً همیشه کافی است." msgid "generator function" msgstr "تابع تولیدگر" -msgid "A function which returns a :term:`generator` object. It looks like a normal function except that it contains :keyword:`yield` expressions for producing a series of values usable in a :keyword:`for`\\-loop or that can be retrieved one at a time with the :func:`next` function. See :ref:`yieldexpr`." -msgstr "تابعی که یک شیء :term:`تولیدگر ` بازمی‌گرداند. این تابع شبیه یک تابع معمولی است، با این تفاوت که شامل عبارت‌های :keyword:`yield` برای تولید مجموعه‌ای از مقادیر قابل استفاده در یک حلقهٔ :keyword:`for` یا قابل بازیابی یکی‌یکی با تابع :func:`next` است. :ref:`yieldexpr` را ببینید." +msgid "" +"A function which returns a :term:`generator` object. It looks like a normal" +" function except that it contains :keyword:`yield` expressions for producing" +" a series of values usable in a :keyword:`for`\\-loop or that can be " +"retrieved one at a time with the :func:`next` function. See " +":ref:`yieldexpr`." +msgstr "" +"تابعی که یک شیء :term:`تولیدگر ` بازمی‌گرداند. این تابع شبیه یک " +"تابع معمولی است، با این تفاوت که شامل عبارت‌های :keyword:`yield` برای تولید " +"مجموعه‌ای از مقادیر قابل استفاده در یک حلقه‌ی :keyword:`for` یا قابل بازیابی " +"یکی‌یکی با تابع :func:`next` است. :ref:`yieldexpr` را ببینید." msgid "generator iterator" -msgstr "تکرارگر تولیدگر" +msgstr "پیمایش‌گر تولیدگر" -msgid "An object created by a :term:`generator function` or a :term:`generator expression`." -msgstr "شیءای که توسط یک :term:`تابع تولیدگر ` یا یک :term:`عبارت تولیدگر ` ایجاد می‌شود." +msgid "" +"An object created by a :term:`generator function` or a :term:`generator " +"expression`." +msgstr "" +"شیءای که توسط یک :term:`تابع تولیدگر ` یا یک " +":term:`عبارت تولیدگر ` ایجاد می‌شود." -msgid "Each :keyword:`yield` temporarily suspends processing, remembering the execution state (including local variables and pending try-statements). When the *generator iterator* resumes, it picks up where it left off (in contrast to functions which start fresh on every invocation)." -msgstr "هر :keyword:`yield` پردازش را به‌طور موقت متوقف می‌کند و وضعیت اجرا (شامل متغیرهای محلی و دستورهای try در انتظار) را به خاطر می‌سپارد. هنگامی که *تکرارگر تولیدگر* ادامهٔ اجرا می‌دهد، از همان نقطه‌ای که متوقف شده بود ادامه می‌دهد (برخلاف توابع که در هر فراخوانی از ابتدا شروع می‌شوند)." +msgid "" +"Each :keyword:`yield` temporarily suspends processing, remembering the " +"execution state (including local variables and pending try-statements). When" +" the *generator iterator* resumes, it picks up where it left off (in " +"contrast to functions which start fresh on every invocation)." +msgstr "" +"هر :keyword:`yield` پردازش را به‌طور موقت متوقف می‌کند و وضعیت اجرا (شامل " +"متغیرهای محلی و دستورهای try در انتظار) را به خاطر می‌سپارد. هنگامی که " +"*پیمایش‌گر تولیدگر* ادامه‌ی اجرا می‌دهد، از همان نقطه‌ای که متوقف شده بود ادامه" +" می‌دهد (برخلاف توابع که در هر فراخوانی از ابتدا شروع می‌شوند)." -msgid "Generator iterators also implement the :meth:`~generator.send` method to send a value into the suspended generator, and the :meth:`~generator.throw` method to raise an exception at the point where the generator was paused. See :ref:`generator-methods`." -msgstr "تکرارگرهای تولیدگر همچنین متد :meth:`~generator.send` را برای ارسال یک مقدار به تولیدگر متوقف‌شده و متد :meth:`~generator.throw` را برای پرتاب یک استثنا در نقطه‌ای که تولیدگر در آن متوقف شده است، پیاده‌سازی می‌کنند. بخش :ref:`generator-methods` را ببینید." +msgid "" +"Generator iterators also implement the :meth:`~generator.send` method to " +"send a value into the suspended generator, and the :meth:`~generator.throw` " +"method to raise an exception at the point where the generator was paused. " +"See :ref:`generator-methods`." +msgstr "" +"پیمایش‌گرهای تولیدگر همچنین متد :meth:`~generator.send` را برای ارسال یک مقدار" +" به تولیدگر متوقف‌شده و متد :meth:`~generator.throw` را برای پرتاب یک استثنا" +" در نقطه‌ای که تولیدگر در آن متوقف شده است، پیاده‌سازی می‌کنند. بخش " +":ref:`generator-methods` را ببینید." msgid "generator expression" msgstr "عبارت تولیدگر" -msgid "An :term:`expression` that returns an :term:`iterator`. It looks like a normal expression followed by a :keyword:`!for` clause defining a loop variable, range, and an optional :keyword:`!if` clause. The combined expression generates values for an enclosing function::" -msgstr "یک :term:`عبارت ` که یک :term:`تکرارگر ` بازمی‌گرداند. این عبارت شبیه یک عبارت معمولی است که پس از آن یک بند :keyword:`!for` برای تعریف متغیر حلقه، محدوده و یک بند اختیاری :keyword:`!if` قرار گرفته است. عبارت ترکیبی، مقادیری را برای یک تابع دربرگیرنده تولید می‌کند::" +msgid "" +"An :term:`expression` that returns an :term:`iterator`. It looks like a " +"normal expression followed by a :keyword:`!for` clause defining a loop " +"variable, range, and an optional :keyword:`!if` clause. The combined " +"expression generates values for an enclosing function::" +msgstr "" +"یک :term:`عبارت ` که یک :term:`پیمایش‌گر ` بازمی‌گرداند." +" این عبارت شبیه یک عبارت معمولی است که پس از آن یک بند :keyword:`!for` برای " +"تعریف متغیر حلقه، محدوده و یک بند اختیاری :keyword:`!if` قرار گرفته است. " +"عبارت ترکیبی، مقادیری را برای یک تابع دربرگیرنده تولید می‌کند::" msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" @@ -651,22 +1493,43 @@ msgstr "" "285" msgid "generic function" -msgstr "تابع عمومی" +msgstr "تابع عام" -msgid "A function composed of multiple functions implementing the same operation for different types. Which implementation should be used during a call is determined by the dispatch algorithm." -msgstr "تابعی که از چندین تابع تشکیل شده است که یک عملیات یکسان را برای نوع‌های مختلف پیاده‌سازی می‌کنند. این‌که هنگام یک فراخوانی کدام پیاده‌سازی استفاده شود، توسط الگوریتم ارسال تعیین می‌شود." +msgid "" +"A function composed of multiple functions implementing the same operation " +"for different types. Which implementation should be used during a call is " +"determined by the dispatch algorithm." +msgstr "" +"تابعی که از چندین تابع تشکیل شده است که یک عملیات یکسان را برای نوع‌های " +"مختلف پیاده‌سازی می‌کنند. این‌که هنگام یک فراخوانی کدام پیاده‌سازی استفاده " +"شود، توسط الگوریتم ارسال تعیین می‌شود." -msgid "See also the :term:`single dispatch` glossary entry, the :deco:`functools.singledispatch` decorator, and :pep:`443`." -msgstr "همچنین به ورودی واژه‌نامه‌ای :term:`توزیع تک‌گانه `، دکوریتور :func:`functools.singledispatch` و :pep:`443` مراجعه کنید." +msgid "" +"See also the :term:`single dispatch` glossary entry, the " +":deco:`functools.singledispatch` decorator, and :pep:`443`." +msgstr "" +"همچنین به ورودی واژه‌نامه‌ای :term:`توزیع تک‌گانه `، " +"دکوریتور :func:`functools.singledispatch` و :pep:`443` مراجعه کنید." msgid "generic type" -msgstr "نوع عمومی" +msgstr "نوع عام" -msgid "A :term:`type` that can be parameterized; typically a :ref:`container class` such as :class:`list` or :class:`dict`. Used for :term:`type hints ` and :term:`annotations `." -msgstr "یک :term:`نوع ` که می‌تواند پارامتری شود؛ معمولاً یک :ref:`container class` مانند :class:`list` یا :class:`dict`. برای :term:`راهنمای نوع ` و :term:`حاشیه‌گذاری ` استفاده می‌شود." +msgid "" +"A :term:`type` that can be parameterized; typically a :ref:`container " +"class` such as :class:`list` or :class:`dict`. Used for " +":term:`type hints ` and :term:`annotations `." +msgstr "" +"یک :term:`نوع ` که می‌تواند پارامتری شود؛ معمولاً یک :ref:`container " +"class` مانند :class:`list` یا :class:`dict`. برای " +":term:`راهنمای نوع ` و :term:`حاشیه‌گذاری ` استفاده " +"می‌شود." -msgid "For more details, see :ref:`generic alias types`, :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." -msgstr "برای جزئیات بیشتر، :ref:`generic alias types`، :pep:`483`، :pep:`484`، :pep:`585` و ماژول :mod:`typing` را ببینید." +msgid "" +"For more details, see :ref:`generic alias types`, " +":pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." +msgstr "" +"برای جزئیات بیشتر، :ref:`generic alias types`، " +":pep:`483`، :pep:`484`، :pep:`585` و ماژول :mod:`typing` را ببینید." msgid "GIL" msgstr "GIL" @@ -677,95 +1540,239 @@ msgstr ":term:`قفل مفسر سراسری ` را بب msgid "global interpreter lock" msgstr "قفل مفسر سراسری" -msgid "The mechanism used by the :term:`CPython` interpreter to assure that only one thread executes Python :term:`bytecode` at a time. This simplifies the CPython implementation by making the object model (including critical built-in types such as :class:`dict`) implicitly safe against concurrent access. Locking the entire interpreter makes it easier for the interpreter to be multi-threaded, at the expense of much of the parallelism afforded by multi-processor machines." -msgstr "سازوکاری که توسط مفسر :term:`CPython ` استفاده می‌شود تا تضمین کند در هر زمان فقط یک نخ :term:`بایت‌کد ` پایتون را اجرا می‌کند. این کار پیاده‌سازی CPython را ساده‌تر می‌کند، زیرا مدل شیء (شامل نوع‌های توکار مهمی مانند :class:`dict`) به‌طور ضمنی در برابر دسترسی هم‌زمان ایمن می‌شود. قفل کردن کل مفسر باعث می‌شود چندنخی کردن مفسر آسان‌تر شود، اما به قیمت از دست دادن بخش زیادی از موازی‌سازی‌ای که ماشین‌های چندپردازنده‌ای فراهم می‌کنند." +msgid "" +"The mechanism used by the :term:`CPython` interpreter to assure that only " +"one thread executes Python :term:`bytecode` at a time. This simplifies the " +"CPython implementation by making the object model (including critical built-" +"in types such as :class:`dict`) implicitly safe against concurrent access. " +"Locking the entire interpreter makes it easier for the interpreter to be " +"multi-threaded, at the expense of much of the parallelism afforded by multi-" +"processor machines." +msgstr "" +"سازوکاری که توسط مفسر :term:`CPython ` استفاده می‌شود تا تضمین کند " +"در هر زمان فقط یک نخ :term:`بایت‌کد ` پایتون را اجرا می‌کند. این " +"کار پیاده‌سازی CPython را ساده‌تر می‌کند، زیرا مدل شیء (شامل نوع‌های توکار " +"مهمی مانند :class:`dict`) به‌طور ضمنی در برابر دسترسی همزمان ایمن می‌شود. " +"قفل کردن کل مفسر باعث می‌شود چندنخی کردن مفسر آسان‌تر شود، اما به قیمت از " +"دست دادن بخش زیادی از موازی‌سازی‌ای که ماشین‌های چندپردازنده‌ای فراهم " +"می‌کنند." -msgid "However, some extension modules, either standard or third-party, are designed so as to release the GIL when doing computationally intensive tasks such as compression or hashing. Also, the GIL is always released when doing I/O." -msgstr "با این حال، برخی ماژول‌های افزونه، چه استاندارد و چه شخص ثالث، به‌گونه‌ای طراحی شده‌اند که هنگام انجام وظایف محاسباتی سنگین مانند فشرده‌سازی یا درهم‌سازی، GIL را آزاد کنند. همچنین، GIL همیشه هنگام انجام عملیات ورودی/خروجی آزاد می‌شود." +msgid "" +"However, some extension modules, either standard or third-party, are " +"designed so as to release the GIL when doing computationally intensive tasks" +" such as compression or hashing. Also, the GIL is always released when " +"doing I/O." +msgstr "" +"با این حال، برخی ماژول‌های افزونه، چه استاندارد و چه شخص ثالث، به‌گونه‌ای " +"طراحی شده‌اند که هنگام انجام وظایف محاسباتی سنگین مانند فشرده‌سازی یا " +"درهم‌سازی، GIL را آزاد کنند. همچنین، GIL همیشه هنگام انجام عملیات " +"ورودی/خروجی آزاد می‌شود." -msgid "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` build configuration. After building Python with this option, code must be run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 ` environment variable. This feature enables improved performance for multi-threaded applications and makes it easier to use multi-core CPUs efficiently. For more details, see :pep:`703`." -msgstr "از پایتون ۳.۱۳، می‌توان GIL را با استفاده از پیکربندی ساخت :option:`--disable-gil` غیرفعال کرد. پس از ساخت پایتون با این گزینه، کد باید با :option:`-X gil=0 <-X>` یا پس از تنظیم متغیر محیطی :envvar:`PYTHON_GIL=0 ` اجرا شود. این ویژگی عملکرد بهتر برای برنامه‌های چندنخی را فراهم می‌کند و استفادهٔ مؤثرتر از CPUهای چند‌هسته‌ای را آسان‌تر می‌سازد. برای جزئیات بیشتر، :pep:`703` را ببینید." +msgid "" +"As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil`" +" build configuration. After building Python with this option, code must be " +"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " +"` environment variable. This feature enables improved " +"performance for multi-threaded applications and makes it easier to use " +"multi-core CPUs efficiently. For more details, see :pep:`703`." +msgstr "" +"از پایتون ۳.۱۳، می‌توان GIL را با استفاده از پیکربندی ساخت " +":option:`--disable-gil` غیرفعال کرد. پس از ساخت پایتون با این گزینه، کد باید" +" با :option:`-X gil=0 <-X>` یا پس از تنظیم متغیر محیطی :envvar:`PYTHON_GIL=0" +" ` اجرا شود. این ویژگی عملکرد بهتر برای برنامه‌های چندنخی را " +"فراهم می‌کند و استفاده‌ی مؤثرتر از CPUهای چندهسته‌ای را آسان‌تر می‌سازد. " +"برای جزئیات بیشتر، :pep:`703` را ببینید." -msgid "In prior versions of Python's C API, a function might declare that it requires the GIL to be held in order to use it. This refers to having an :term:`attached thread state`." -msgstr "در نسخه‌های پیشین API زبان C پایتون، یک تابع ممکن بود اعلام کند که برای استفاده از آن، لازم است GIL در اختیار گرفته شده باشد. این موضوع به داشتن یک :term:`وضعیت نخ متصل ` اشاره دارد." +msgid "" +"In prior versions of Python's C API, a function might declare that it " +"requires the GIL to be held in order to use it. This refers to having an " +":term:`attached thread state`." +msgstr "" +"در نسخه‌های پیشین API زبان C پایتون، یک تابع ممکن بود اعلام کند که برای " +"استفاده از آن، لازم است GIL در اختیار گرفته شده باشد. این موضوع به داشتن یک " +":term:`وضعیت نخ متصل ` اشاره دارد." msgid "global state" msgstr "وضعیت سراسری" -msgid "Data that is accessible throughout a program, such as module-level variables, class variables, or C static variables in :term:`extension modules `. In multi-threaded programs, global state shared between threads typically requires synchronization to avoid :term:`race conditions ` and :term:`data races `." -msgstr "داده‌ای که در سراسر یک برنامه قابل دسترسی است، مانند متغیرهای سطح ماژول، متغیرهای کلاس یا متغیرهای ایستای C در :term:`ماژول افزونه `. در برنامه‌های چندنخی، وضعیت سراسری اشتراک‌گذاری‌شده بین نخ‌ها معمولاً برای جلوگیری از :term:`شرط رقابت ` و :term:`رقابت داده ` به همگام‌سازی نیاز دارد." +msgid "" +"Data that is accessible throughout a program, such as module-level " +"variables, class variables, or C static variables in :term:`extension " +"modules `. In multi-threaded programs, global state " +"shared between threads typically requires synchronization to avoid " +":term:`race conditions ` and :term:`data races `." +msgstr "" +"داده‌ای که در سراسر یک برنامه قابل دسترسی است، مانند متغیرهای سطح ماژول، " +"متغیرهای کلاس یا متغیرهای ایستای C در :term:`ماژول افزونه `. در برنامه‌های چندنخی، وضعیت سراسری اشتراک‌گذاری‌شده بین نخ‌ها " +"معمولاً برای جلوگیری از :term:`شرط رقابت ` و :term:`رقابت " +"داده ` به همگام‌سازی نیاز دارد." msgid "hash-based pyc" msgstr "pyc مبتنی بر هش" -msgid "A bytecode cache file that uses the hash rather than the last-modified time of the corresponding source file to determine its validity. See :ref:`pyc-invalidation`." -msgstr "یک فایل نهانگاه بایت‌کد که به‌جای زمان آخرین تغییر فایل منبع متناظر، از هش آن برای تعیین اعتبار خود استفاده می‌کند. :ref:`pyc-invalidation` را ببینید." +msgid "" +"A bytecode cache file that uses the hash rather than the last-modified time " +"of the corresponding source file to determine its validity. See :ref:`pyc-" +"invalidation`." +msgstr "" +"یک فایل نهانگاه بایت‌کد که به‌جای زمان آخرین تغییر فایل منبع متناظر، از هش " +"آن برای تعیین اعتبار خود استفاده می‌کند. :ref:`pyc-invalidation` را ببینید." msgid "hashable" msgstr "قابل درهم‌سازی" -msgid "An object is *hashable* if it has a hash value which never changes during its lifetime (it needs a :meth:`~object.__hash__` method), and can be compared to other objects (it needs an :meth:`~object.__eq__` method). Hashable objects which compare equal must have the same hash value." -msgstr "یک شیء *قابل درهم‌سازی* است اگر دارای یک مقدار هش باشد که در طول عمر آن هرگز تغییر نمی‌کند (به یک متد :meth:`~object.__hash__` نیاز دارد) و بتوان آن را با اشیای دیگر مقایسه کرد (به یک متد :meth:`~object.__eq__` نیاز دارد). اشیای قابل درهم‌سازی که برابر مقایسه می‌شوند باید مقدار هش یکسانی داشته باشند." +msgid "" +"An object is *hashable* if it has a hash value which never changes during " +"its lifetime (it needs a :meth:`~object.__hash__` method), and can be " +"compared to other objects (it needs an :meth:`~object.__eq__` method). " +"Hashable objects which compare equal must have the same hash value." +msgstr "" +"یک شیء *قابل درهم‌سازی* است اگر دارای یک مقدار هش باشد که در طول عمر آن هرگز" +" تغییر نمی‌کند (به یک متد :meth:`~object.__hash__` نیاز دارد) و بتوان آن را " +"با اشیای دیگر مقایسه کرد (به یک متد :meth:`~object.__eq__` نیاز دارد). اشیای" +" قابل درهم‌سازی که برابر مقایسه می‌شوند باید مقدار هش یکسانی داشته باشند." -msgid "Hashability makes an object usable as a dictionary key and a set member, because these data structures use the hash value internally." -msgstr "قابل درهم‌سازی بودن باعث می‌شود یک شیء به‌عنوان کلید دیکشنری و عضو مجموعه قابل استفاده باشد، زیرا این ساختارهای داده مقدار هش را به‌صورت داخلی استفاده می‌کنند." +msgid "" +"Hashability makes an object usable as a dictionary key and a set member, " +"because these data structures use the hash value internally." +msgstr "" +"قابل درهم‌سازی بودن باعث می‌شود یک شیء به‌عنوان کلید دیکشنری و عضو مجموعه " +"قابل استفاده باشد، زیرا این ساختارهای داده مقدار هش را به‌صورت داخلی استفاده" +" می‌کنند." -msgid "Most of Python's immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not; immutable containers (such as tuples and frozensets) are only hashable if their elements are hashable. Objects which are instances of user-defined classes are hashable by default. They all compare unequal (except with themselves), and their hash value is derived from their :func:`id`." -msgstr "بیشتر اشیای توکار تغییرناپذیر پایتون قابل درهم‌سازی هستند؛ محفظه‌های تغییرپذیر (مانند فهرست‌ها یا دیکشنری‌ها) قابل درهم‌سازی نیستند؛ محفظه‌های تغییرناپذیر (مانند تاپل‌ها یا frozensetها) فقط در صورتی قابل درهم‌سازی هستند که عناصرشان قابل درهم‌سازی باشند. اشیایی که نمونه‌هایی از کلاس‌های تعریف‌شده توسط کاربر هستند، به‌طور پیش‌فرض قابل درهم‌سازی هستند. همهٔ آن‌ها نابرابر مقایسه می‌شوند (به‌جز با خودشان) و مقدار هش آن‌ها از :func:`id` آن‌ها مشتق می‌شود." +msgid "" +"Most of Python's immutable built-in objects are hashable; mutable containers" +" (such as lists or dictionaries) are not; immutable containers (such as " +"tuples and frozensets) are only hashable if their elements are hashable. " +"Objects which are instances of user-defined classes are hashable by default." +" They all compare unequal (except with themselves), and their hash value is" +" derived from their :func:`id`." +msgstr "" +"بیشتر اشیای توکار تغییرناپذیر پایتون قابل درهم‌سازی هستند؛ محفظه‌های " +"تغییرپذیر (مانند فهرست‌ها یا دیکشنری‌ها) قابل درهم‌سازی نیستند؛ محفظه‌های " +"تغییرناپذیر (مانند تاپل‌ها یا frozensetها) فقط در صورتی قابل درهم‌سازی هستند" +" که عناصرشان قابل درهم‌سازی باشند. اشیایی که نمونه‌هایی از کلاس‌های " +"تعریف‌شده توسط کاربر هستند، به‌طور پیش‌فرض قابل درهم‌سازی هستند. همه‌ی آن‌ها " +"نابرابر مقایسه می‌شوند (به‌جز با خودشان) و مقدار هش آن‌ها از :func:`id` " +"آن‌ها مشتق می‌شود." msgid "IDLE" msgstr "IDLE" -msgid "An Integrated Development and Learning Environment for Python. :ref:`idle` is a basic editor and interpreter environment which ships with the standard distribution of Python." -msgstr "یک محیط توسعه و یادگیری یکپارچه برای پایتون. :ref:`idle` یک محیط ویرایشگر و مفسر پایه است که همراه با توزیع استاندارد پایتون ارائه می‌شود." +msgid "" +"An Integrated Development and Learning Environment for Python. :ref:`idle` " +"is a basic editor and interpreter environment which ships with the standard " +"distribution of Python." +msgstr "" +"یک محیط توسعه و یادگیری یکپارچه برای پایتون. :ref:`idle` یک محیط ویرایشگر و " +"مفسر پایه است که همراه با توزیع استاندارد پایتون ارائه می‌شود." msgid "immortal" msgstr "نامیرا" -msgid "*Immortal objects* are a CPython implementation detail introduced in :pep:`683`." -msgstr "*اشیای نامیرا* یک جزئیات پیاده‌سازی CPython هستند که در :pep:`683` معرفی شده‌اند." +msgid "" +"*Immortal objects* are a CPython implementation detail introduced in " +":pep:`683`." +msgstr "" +"*اشیای نامیرا* یک جزئیات پیاده‌سازی CPython هستند که در :pep:`683` معرفی " +"شده‌اند." -msgid "If an object is immortal, its :term:`reference count` is never modified, and therefore it is never deallocated while the interpreter is running. For example, :const:`True` and :const:`None` are immortal in CPython." -msgstr "اگر یک شیء نامیرا باشد، :term:`شمارندهٔ ارجاع ` آن هرگز تغییر نمی‌کند و بنابراین تا زمانی که مفسر در حال اجرا است، هرگز آزاد نمی‌شود. برای مثال، :const:`True` و :const:`None` در CPython نامیرا هستند." +msgid "" +"If an object is immortal, its :term:`reference count` is never modified, and" +" therefore it is never deallocated while the interpreter is running. For " +"example, :const:`True` and :const:`None` are immortal in CPython." +msgstr "" +"اگر یک شیء نامیرا باشد، :term:`شمارنده‌ی ارجاع ` آن هرگز " +"تغییر نمی‌کند و بنابراین تا زمانی که مفسر در حال اجرا است، هرگز آزاد " +"نمی‌شود. برای مثال، :const:`True` و :const:`None` در CPython نامیرا هستند." -msgid "Immortal objects can be identified via :func:`sys._is_immortal`, or via :c:func:`PyUnstable_IsImmortal` in the C API." -msgstr "اشیای نامیرا را می‌توان از طریق :func:`sys._is_immortal` یا از طریق :c:func:`PyUnstable_IsImmortal` در API زبان C شناسایی کرد." +msgid "" +"Immortal objects can be identified via :func:`sys._is_immortal`, or via " +":c:func:`PyUnstable_IsImmortal` in the C API." +msgstr "" +"اشیای نامیرا را می‌توان از طریق :func:`sys._is_immortal` یا از طریق " +":c:func:`PyUnstable_IsImmortal` در API زبان C شناسایی کرد." msgid "immutable" msgstr "تغییرناپذیر" -msgid "An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary. Immutable objects are inherently :term:`thread-safe` because their state cannot be modified after creation, eliminating concerns about improperly synchronized :term:`concurrent modification`." -msgstr "شیءای با مقدار ثابت. اشیای تغییرناپذیر شامل اعداد، نخ‌ها و تاپل‌ها هستند. چنین شی‌ءای نمی‌تواند تغییر داده شود. اگر لازم باشد مقدار متفاوتی ذخیره شود، باید شیء جدیدی ایجاد شود. آن‌ها در جاهایی که مقدار هش ثابت لازم است، برای مثال به‌عنوان یک کلید در یک دیکشنری، نقش مهمی دارند. اشیای تغییرناپذیر ذاتاً :term:`ایمن برای نخ‌های اجرایی ` هستند، زیرا وضعیت آن‌ها پس از ایجاد قابل تغییر نیست و نگرانی‌ها دربارهٔ :term:`تغییر هم‌زمان ` که به‌درستی همگام‌سازی نشده است، از بین می‌رود." +msgid "" +"An object with a fixed value. Immutable objects include numbers, strings " +"and tuples. Such an object cannot be altered. A new object has to be " +"created if a different value has to be stored. They play an important role " +"in places where a constant hash value is needed, for example as a key in a " +"dictionary. Immutable objects are inherently :term:`thread-safe` because " +"their state cannot be modified after creation, eliminating concerns about " +"improperly synchronized :term:`concurrent modification`." +msgstr "" +"شیءای با مقدار ثابت. اشیای تغییرناپذیر شامل اعداد، نخ‌ها و تاپل‌ها هستند. " +"چنین شی‌ءای نمی‌تواند تغییر داده شود. اگر لازم باشد مقدار متفاوتی ذخیره شود،" +" باید شیء جدیدی ایجاد شود. آن‌ها در جاهایی که مقدار هش ثابت لازم است، برای " +"مثال به‌عنوان یک کلید در یک دیکشنری، نقش مهمی دارند. اشیای تغییرناپذیر ذاتاً" +" :term:`ایمن برای نخ‌های اجرایی ` هستند، زیرا وضعیت آن‌ها پس از" +" ایجاد قابل تغییر نیست و نگرانی‌ها درباره‌ی :term:`تغییر همزمان ` که به‌درستی همگام‌سازی نشده است، از بین می‌رود." msgid "import path" msgstr "مسیر ایمپورت" -msgid "A list of locations (or :term:`path entries `) that are searched by the :term:`path based finder` for modules to import. During import, this list of locations usually comes from :data:`sys.path`, but for subpackages it may also come from the parent package's ``__path__`` attribute." -msgstr "فهرستی از مکان‌ها (یا :term:`ورودی مسیر `) که توسط :term:`یابندهٔ مبتنی بر مسیر ` برای ماژول‌های قابل ایمپورت جست‌وجو می‌شود. هنگام ایمپورت، این فهرست از مکان‌ها معمولاً از :data:`sys.path` می‌آید، اما برای زیر‌بسته‌ها ممکن است از ویژگی ``__path__`` بستهٔ والد نیز به‌دست آید." +msgid "" +"A list of locations (or :term:`path entries `) that are searched" +" by the :term:`path based finder` for modules to import. During import, this" +" list of locations usually comes from :data:`sys.path`, but for subpackages " +"it may also come from the parent package's ``__path__`` attribute." +msgstr "" +"فهرستی از مکان‌ها (یا :term:`ورودی مسیر `) که توسط " +":term:`یابنده‌ی مبتنی بر مسیر ` برای ماژول‌های قابل " +"ایمپورت جست‌وجو می‌شود. هنگام ایمپورت، این فهرست از مکان‌ها معمولاً از " +":data:`sys.path` می‌آید، اما برای زیربسته‌ها ممکن است از ویژگی ``__path__``" +" بسته‌ی والد نیز به‌دست آید." msgid "importing" msgstr "ایمپورت کردن" -msgid "The process by which Python code in one module is made available to Python code in another module." -msgstr "فرایندی که طی آن کد پایتون در یک ماژول برای کد پایتون در ماژولی دیگر در دسترس قرار می‌گیرد." +msgid "" +"The process by which Python code in one module is made available to Python " +"code in another module." +msgstr "" +"فرایندی که طی آن کد پایتون در یک ماژول برای کد پایتون در ماژولی دیگر در " +"دسترس قرار می‌گیرد." msgid "importer" msgstr "ایمپورت‌کننده" -msgid "An object that both finds and loads a module; both a :term:`finder` and :term:`loader` object." -msgstr "شی‌ءای که هم یک ماژول را پیدا می‌کند و هم آن را بارگذاری می‌کند؛ هم یک شیء :term:`یابنده ` و هم یک شیء :term:`بارگذار `." +msgid "" +"An object that both finds and loads a module; both a :term:`finder` and " +":term:`loader` object." +msgstr "" +"شی‌ءای که هم یک ماژول را پیدا می‌کند و هم آن را بارگذاری می‌کند؛ هم یک شیء " +":term:`یابنده ` و هم یک شیء :term:`بارگذار `." msgid "index" msgstr "اندیس" -msgid "A numeric value that represents the position of an element in a :term:`sequence`." -msgstr "مقداری عددی که موقعیت یک المان را در یک :term:`دنباله ` نشان می‌دهد." +msgid "" +"A numeric value that represents the position of an element in a " +":term:`sequence`." +msgstr "" +"مقداری عددی که موقعیت یک المان را در یک :term:`دنباله ` نشان " +"می‌دهد." -msgid "In Python, indexing starts at zero. For example, ``things[0]`` names the *first* element of ``things``; ``things[1]`` names the second one." -msgstr "در پایتون، اندیس‌گذاری از صفر شروع می‌شود. برای مثال، ``things[0]`` نخستین المان ``things`` را نام‌گذاری می‌کند؛ ``things[1]`` دومین مورد را نام‌گذاری می‌کند." +msgid "" +"In Python, indexing starts at zero. For example, ``things[0]`` names the " +"*first* element of ``things``; ``things[1]`` names the second one." +msgstr "" +"در پایتون، اندیس‌گذاری از صفر شروع می‌شود. برای مثال، ``things[0]`` نخستین " +"المان ``things`` را نام‌گذاری می‌کند؛ ``things[1]`` دومین مورد را نام‌گذاری " +"می‌کند." -msgid "In some contexts, Python allows negative indexes for counting from the end of a sequence, and indexing using :term:`slices `." -msgstr "در برخی زمینه‌ها، پایتون اجازه می‌دهد از اندیس‌های منفی برای شمارش از انتهای یک دنباله و از اندیس‌گذاری با استفاده از :term:`برش ` استفاده شود." +msgid "" +"In some contexts, Python allows negative indexes for counting from the end " +"of a sequence, and indexing using :term:`slices `." +msgstr "" +"در برخی زمینه‌ها، پایتون اجازه می‌دهد از اندیس‌های منفی برای شمارش از انتهای" +" یک دنباله و از اندیس‌گذاری با استفاده از :term:`برش ` استفاده شود." msgid "See also :term:`subscript`." msgstr "همچنین :term:`زیرنویس ` را ببینید." @@ -773,62 +1780,211 @@ msgstr "همچنین :term:`زیرنویس ` را ببینید." msgid "interactive" msgstr "تعاملی" -msgid "Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately execute them and see their results. Just launch ``python`` with no arguments (possibly by selecting it from your computer's main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember ``help(x)``). For more on interactive mode, see :ref:`tut-interac`." -msgstr "پایتون یک مفسر تعاملی دارد، یعنی می‌توانید دستورها و عبارت‌ها را در اعلان مفسر وارد کنید، آن‌ها را بلافاصله اجرا کنید و نتایجشان را ببینید. فقط ``python`` را بدون آرگومان اجرا کنید (احتمالاً با انتخاب آن از منوی اصلی رایانهٔ خود). این روش بسیار قدرتمندی برای آزمایش ایده‌های جدید یا بررسی ماژول‌ها و بسته‌ها است (``help(x)`` را به خاطر داشته باشید). برای اطلاعات بیشتر دربارهٔ حالت تعاملی، :ref:`tut-interac` را ببینید." +msgid "" +"Python has an interactive interpreter which means you can enter statements " +"and expressions at the interpreter prompt, immediately execute them and see " +"their results. Just launch ``python`` with no arguments (possibly by " +"selecting it from your computer's main menu). It is a very powerful way to " +"test out new ideas or inspect modules and packages (remember ``help(x)``). " +"For more on interactive mode, see :ref:`tut-interac`." +msgstr "" +"پایتون یک مفسر تعاملی دارد، یعنی می‌توانید دستورها و عبارت‌ها را در اعلان " +"مفسر وارد کنید، آن‌ها را بلافاصله اجرا کنید و نتایجشان را ببینید. فقط " +"``python`` را بدون آرگومان اجرا کنید (احتمالاً با انتخاب آن از منوی اصلی " +"رایانه‌ی خود). این روش بسیار قدرتمندی برای آزمایش ایده‌های جدید یا بررسی " +"ماژول‌ها و بسته‌ها است (``help(x)`` را به خاطر داشته باشید). برای اطلاعات " +"بیشتر درباره‌ی حالت تعاملی، :ref:`tut-interac` را ببینید." msgid "interpreted" msgstr "تفسیری" -msgid "Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler. This means that source files can be run directly without explicitly creating an executable which is then run. Interpreted languages typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly. See also :term:`interactive`." -msgstr "پایتون زبانی تفسیری است، در مقابل زبان‌های کامپایل‌شده، هرچند به‌دلیل وجود کامپایلر بایت‌کد، این تمایز می‌تواند مبهم باشد. این یعنی فایل‌های منبع را می‌توان بدون ایجاد صریح یک فایل اجرایی که سپس اجرا شود، مستقیماً اجرا کرد. زبان‌های تفسیری معمولاً چرخهٔ توسعه/اشکال‌زدایی کوتاه‌تری نسبت به زبان‌های کامپایل‌شده دارند، هرچند برنامه‌های آن‌ها معمولاً کندتر اجرا می‌شوند. همچنین :term:`تعاملی ` را ببینید." +msgid "" +"Python is an interpreted language, as opposed to a compiled one, though the " +"distinction can be blurry because of the presence of the bytecode compiler." +" This means that source files can be run directly without explicitly " +"creating an executable which is then run. Interpreted languages typically " +"have a shorter development/debug cycle than compiled ones, though their " +"programs generally also run more slowly. See also :term:`interactive`." +msgstr "" +"پایتون زبانی تفسیری است، در مقابل زبان‌های کامپایل‌شده، هرچند به‌دلیل وجود " +"کامپایلر بایت‌کد، این تمایز می‌تواند مبهم باشد. این یعنی فایل‌های منبع را " +"می‌توان بدون ایجاد صریح یک فایل اجرایی که سپس اجرا شود، مستقیماً اجرا کرد. " +"زبان‌های تفسیری معمولاً چرخه‌ی توسعه/اشکال‌زدایی کوتاه‌تری نسبت به زبان‌های " +"کامپایل‌شده دارند، هرچند برنامه‌های آن‌ها معمولاً کندتر اجرا می‌شوند. همچنین" +" :term:`تعاملی ` را ببینید." msgid "interpreter shutdown" msgstr "خاموشی مفسر" -msgid "When asked to shut down, the Python interpreter enters a special phase where it gradually releases all allocated resources, such as modules and various critical internal structures. It also makes several calls to the :term:`garbage collector `. This can trigger the execution of code in user-defined destructors or weakref callbacks. Code executed during the shutdown phase can encounter various exceptions as the resources it relies on may not function anymore (common examples are library modules or the warnings machinery)." -msgstr "هنگامی که از مفسر پایتون خواسته می‌شود خاموش شود، وارد مرحلهٔ ویژه‌ای می‌شود که در آن به‌تدریج همهٔ منابع تخصیص‌یافته، مانند ماژول‌ها و ساختارهای داخلی مهم مختلف، آزاد می‌شوند. همچنین چندین فراخوانی به :term:`زباله‌روبی ` انجام می‌دهد. این کار می‌تواند اجرای کد در نابودگرهای تعریف‌شده توسط کاربر یا کال‌بک‌های weakref را فعال کند. کدی که در مرحلهٔ خاموشی اجرا می‌شود ممکن است با استثناهای مختلفی روبه‌رو شود، زیرا منابعی که به آن‌ها وابسته است ممکن است دیگر کار نکنند (نمونه‌های رایج شامل ماژول‌های کتابخانه یا سازوکار هشدارها هستند)." +msgid "" +"When asked to shut down, the Python interpreter enters a special phase where" +" it gradually releases all allocated resources, such as modules and various " +"critical internal structures. It also makes several calls to the " +":term:`garbage collector `. This can trigger the " +"execution of code in user-defined destructors or weakref callbacks. Code " +"executed during the shutdown phase can encounter various exceptions as the " +"resources it relies on may not function anymore (common examples are library" +" modules or the warnings machinery)." +msgstr "" +"هنگامی که از مفسر پایتون خواسته می‌شود خاموش شود، وارد مرحله‌ی ویژه‌ای می‌شود" +" که در آن به‌تدریج همه‌ی منابع تخصیص‌یافته، مانند ماژول‌ها و ساختارهای داخلی " +"مهم مختلف، آزاد می‌شوند. همچنین چندین فراخوانی به :term:`زباله‌روبی ` انجام می‌دهد. این کار می‌تواند اجرای کد در نابودگرهای " +"تعریف‌شده توسط کاربر یا کال‌بک‌های weakref را فعال کند. کدی که در مرحله‌ی " +"خاموشی اجرا می‌شود ممکن است با استثناهای مختلفی روبه‌رو شود، زیرا منابعی که " +"به آن‌ها وابسته است ممکن است دیگر کار نکنند (نمونه‌های رایج شامل ماژول‌های " +"کتابخانه یا سازوکار هشدارها هستند)." -msgid "The main reason for interpreter shutdown is that the ``__main__`` module or the script being run has finished executing." -msgstr "دلیل اصلی خاموشی مفسر این است که ماژول ``__main__`` یا اسکریپتی که در حال اجرا است، اجرای خود را به پایان رسانده است." +msgid "" +"The main reason for interpreter shutdown is that the ``__main__`` module or " +"the script being run has finished executing." +msgstr "" +"دلیل اصلی خاموشی مفسر این است که ماژول ``__main__`` یا اسکریپتی که در حال " +"اجرا است، اجرای خود را به پایان رسانده است." msgid "iterable" -msgstr "تکرارپذیر" +msgstr "پیمایش‌پذیر" -msgid "An object capable of returning its members one at a time. Examples of iterables include all sequence types (such as :class:`list`, :class:`str`, and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:`file objects `, and objects of any classes you define with an :meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method that implements :term:`sequence` semantics." -msgstr "شیءای که قادر است اعضای خود را یکی‌یکی بازگرداند. نمونه‌هایی از تکرارپذیرها شامل همهٔ نوع‌های دنباله‌ای (مانند :class:`list`، :class:`str` و :class:`tuple`) و برخی نوع‌های غیرتوالی مانند :class:`dict`، :term:`شیء فایل ` و اشیای هر کلاسی که شما با متد :meth:`~object.__iter__` یا با متد :meth:`~object.__getitem__` که معناشناسی :term:`دنباله ` را پیاده‌سازی می‌کند تعریف می‌کنید، هستند." +msgid "" +"An object capable of returning its members one at a time. Examples of " +"iterables include all sequence types (such as :class:`list`, :class:`str`, " +"and :class:`tuple`) and some non-sequence types like :class:`dict`, " +":term:`file objects `, and objects of any classes you define " +"with an :meth:`~object.__iter__` method or with a " +":meth:`~object.__getitem__` method that implements :term:`sequence` " +"semantics." +msgstr "" +"شیءای که قادر است اعضای خود را یکی‌یکی بازگرداند. نمونه‌هایی از پیمایش‌پذیرها " +"شامل همه‌ی نوع‌های دنباله‌ای (مانند :class:`list`، :class:`str` و " +":class:`tuple`) و برخی نوع‌های غیرتوالی مانند :class:`dict`، :term:`شیء فایل" +" ` و اشیای هر کلاسی که شما با متد :meth:`~object.__iter__` یا " +"با متد :meth:`~object.__getitem__` که معناشناسی :term:`دنباله ` را" +" پیاده‌سازی می‌کند تعریف می‌کنید، هستند." -msgid "Iterables can be used in a :keyword:`for` loop and in many other places where a sequence is needed (:func:`zip`, :func:`map`, ...). When an iterable object is passed as an argument to the built-in function :func:`iter`, it returns an iterator for the object. This iterator is good for one pass over the set of values. When using iterables, it is usually not necessary to call :func:`iter` or deal with iterator objects yourself. The :keyword:`for` statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." -msgstr "تکرارپذیرها را می‌توان در یک حلقهٔ :keyword:`for` و در بسیاری از مکان‌های دیگری که یک دنباله لازم است (:func:`zip`، :func:`map` و ...) استفاده کرد. هنگامی که یک شیء تکرارپذیر به‌عنوان آرگومان به تابع توکار :func:`iter` داده می‌شود، یک تکرارگر برای آن شیء بازمی‌گرداند. این تکرارگر برای یک بار پیمایش مجموعهٔ مقادیر مناسب است. هنگام استفاده از تکرارپذیرها، معمولاً لازم نیست خودتان :func:`iter` را فراخوانی کنید یا با اشیای تکرارگر سروکار داشته باشید. دستور :keyword:`for` این کار را به‌طور خودکار برای شما انجام می‌دهد و یک متغیر موقتِ بدون نام ایجاد می‌کند تا در طول حلقه تکرارگر را نگه دارد. همچنین :term:`تکرارگر `، :term:`دنباله ` و :term:`تولیدگر ` را ببینید." +msgid "" +"Iterables can be used in a :keyword:`for` loop and in many other places " +"where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " +"iterable object is passed as an argument to the built-in function " +":func:`iter`, it returns an iterator for the object. This iterator is good " +"for one pass over the set of values. When using iterables, it is usually " +"not necessary to call :func:`iter` or deal with iterator objects yourself. " +"The :keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" +"پیمایش‌پذیرها را می‌توان در یک حلقه‌ی :keyword:`for` و در بسیاری از مکان‌های " +"دیگری که یک دنباله لازم است (:func:`zip`، :func:`map` و ...) استفاده کرد. " +"هنگامی که یک شیء پیمایش‌پذیر به‌عنوان آرگومان به تابع توکار :func:`iter` داده " +"می‌شود، یک پیمایش‌گر برای آن شیء بازمی‌گرداند. این پیمایش‌گر برای یک بار پیمایش " +"مجموعه‌ی مقادیر مناسب است. هنگام استفاده از پیمایش‌پذیرها، معمولاً لازم نیست " +"خودتان :func:`iter` را فراخوانی کنید یا با اشیای پیمایش‌گر سروکار داشته باشید." +" دستور :keyword:`for` این کار را به‌طور خودکار برای شما انجام می‌دهد و یک " +"متغیر موقتِ بدون نام ایجاد می‌کند تا در طول حلقه پیمایش‌گر را نگه دارد. همچنین" +" :term:`پیمایش‌گر `، :term:`دنباله ` و :term:`تولیدگر " +"` را ببینید." msgid "iterator" -msgstr "تکرارگر" +msgstr "پیمایش‌گر" -msgid "An object representing a stream of data. Repeated calls to the iterator's :meth:`~iterator.__next__` method (or passing it to the built-in function :func:`next`) return successive items in the stream. When no more data are available a :exc:`StopIteration` exception is raised instead. At this point, the iterator object is exhausted and any further calls to its :meth:`!__next__` method just raise :exc:`StopIteration` again. Iterators are required to have an :meth:`~iterator.__iter__` method that returns the iterator object itself so every iterator is also iterable and may be used in most places where other iterables are accepted. One notable exception is code which attempts multiple iteration passes. A container object (such as a :class:`list`) produces a fresh new iterator each time you pass it to the :func:`iter` function or use it in a :keyword:`for` loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container." -msgstr "شیءای که جریانی از داده‌ها را نمایش می‌دهد. فراخوانی‌های تکراری متد :meth:`~iterator.__next__` تکرارگر (یا ارسال آن به تابع توکار :func:`next`) آیتم‌های پیاپی در جریان را بازمی‌گرداند. هنگامی که دادهٔ بیشتری در دسترس نباشد، به‌جای آن استثنای :exc:`StopIteration` پرتاب می‌شود. در این نقطه، شیء تکرارگر تمام شده است و هر فراخوانی بعدی متد :meth:`!__next__` آن، دوباره فقط استثنای :exc:`StopIteration` ایجاد می‌کند. تکرارگرها باید متد :meth:`~iterator.__iter__` داشته باشند که خود شیء تکرارگر را بازمی‌گرداند، بنابراین هر تکرارگر تکرارپذیر نیز هست و می‌تواند در بیشتر جاهایی که تکرارپذیرهای دیگر پذیرفته می‌شوند استفاده شود. یک استثنای قابل توجه، کدی است که تلاش می‌کند چندین بار پیمایش انجام دهد. یک شیء محفظه‌ای (مانند :class:`list`) هر بار که به تابع :func:`iter` داده شود یا در یک حلقهٔ :keyword:`for` استفاده شود، یک تکرارگر جدید تولید می‌کند. تلاش برای انجام این کار با یک تکرارگر، فقط همان شیء تکرارگر تمام‌شده‌ای را بازمی‌گرداند که در پیمایش قبلی استفاده شده بود و باعث می‌شود مانند یک محفظهٔ خالی به نظر برسد." +msgid "" +"An object representing a stream of data. Repeated calls to the iterator's " +":meth:`~iterator.__next__` method (or passing it to the built-in function " +":func:`next`) return successive items in the stream. When no more data are " +"available a :exc:`StopIteration` exception is raised instead. At this " +"point, the iterator object is exhausted and any further calls to its " +":meth:`!__next__` method just raise :exc:`StopIteration` again. Iterators " +"are required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in" +" most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the " +":func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in" +" the previous iteration pass, making it appear like an empty container." +msgstr "" +"شیءای که جریانی از داده‌ها را نمایش می‌دهد. فراخوانی‌های تکراری متد " +":meth:`~iterator.__next__` پیمایش‌گر (یا ارسال آن به تابع توکار :func:`next`) " +"آیتم‌های پیاپی در جریان را بازمی‌گرداند. هنگامی که داده‌ی بیشتری در دسترس " +"نباشد، به‌جای آن استثنای :exc:`StopIteration` پرتاب می‌شود. در این نقطه، شیء" +" پیمایش‌گر تمام شده است و هر فراخوانی بعدی متد :meth:`!__next__` آن، دوباره " +"فقط استثنای :exc:`StopIteration` ایجاد می‌کند. پیمایش‌گرها باید متد " +":meth:`~iterator.__iter__` داشته باشند که خود شیء پیمایش‌گر را بازمی‌گرداند، " +"بنابراین هر پیمایش‌گر پیمایش‌پذیر نیز هست و می‌تواند در بیشتر جاهایی که " +"پیمایش‌پذیرهای دیگر پذیرفته می‌شوند استفاده شود. یک استثنای قابل توجه، کدی است" +" که تلاش می‌کند چندین بار پیمایش انجام دهد. یک شیء محفظه‌ای (مانند " +":class:`list`) هر بار که به تابع :func:`iter` داده شود یا در یک حلقه‌ی " +":keyword:`for` استفاده شود، یک پیمایش‌گر جدید تولید می‌کند. تلاش برای انجام " +"این کار با یک پیمایش‌گر، فقط همان شیء پیمایش‌گر تمام‌شده‌ای را بازمی‌گرداند که " +"در پیمایش قبلی استفاده شده بود و باعث می‌شود مانند یک محفظه‌ی خالی به نظر " +"برسد." msgid "More information can be found in :ref:`typeiter`." msgstr "اطلاعات بیشتر را می‌توان در :ref:`typeiter` یافت." -msgid "CPython does not consistently apply the requirement that an iterator define :meth:`~iterator.__iter__`. And also please note that :term:`free-threaded ` CPython does not guarantee :term:`thread-safe` behavior of iterator operations." -msgstr "CPython به‌طور سازگار الزام تعریف متد :meth:`~iterator.__iter__` برای یک تکرارگر را اعمال نمی‌کند. همچنین توجه داشته باشید که CPython :term:`نخ‌گذاری آزاد ` رفتار :term:`ایمن برای نخ‌های اجرایی ` را برای عملیات تکرارگرها تضمین نمی‌کند." +msgid "" +"CPython does not consistently apply the requirement that an iterator define " +":meth:`~iterator.__iter__`. And also please note that :term:`free-threaded " +"` CPython does not guarantee :term:`thread-safe` behavior of" +" iterator operations." +msgstr "" +"CPython به‌طور سازگار الزام تعریف متد :meth:`~iterator.__iter__` برای یک " +"پیمایش‌گر را اعمال نمی‌کند. همچنین توجه داشته باشید که CPython :term:`نخ‌گذاری" +" آزاد ` رفتار :term:`ایمن برای نخ‌های اجرایی ` " +"را برای عملیات پیمایش‌گرها تضمین نمی‌کند." msgid "key" msgstr "کلید" -msgid "A value that identifies an entry in a :term:`mapping`. See also :term:`subscript`." -msgstr "مقداری که یک ورودی را در یک :term:`نگاشت ` شناسایی می‌کند. همچنین :term:`زیرنویس ` را ببینید." +msgid "" +"A value that identifies an entry in a :term:`mapping`. See also " +":term:`subscript`." +msgstr "" +"مقداری که یک ورودی را در یک :term:`نگاشت ` شناسایی می‌کند. همچنین " +":term:`زیرنویس ` را ببینید." msgid "key function" msgstr "تابع کلید" -msgid "A key function or collation function is a callable that returns a value used for sorting or ordering. For example, :func:`locale.strxfrm` is used to produce a sort key that is aware of locale specific sort conventions." -msgstr "یک تابع کلید یا تابع هم‌ترازی، یک شیء قابل فراخوانی است که مقداری را بازمی‌گرداند که برای مرتب‌سازی یا ترتیب‌دهی استفاده می‌شود. برای مثال، :func:`locale.strxfrm` برای تولید یک کلید مرتب‌سازی که از قراردادهای مرتب‌سازی خاص یک محلی آگاه است استفاده می‌شود." +msgid "" +"A key function or collation function is a callable that returns a value used" +" for sorting or ordering. For example, :func:`locale.strxfrm` is used to " +"produce a sort key that is aware of locale specific sort conventions." +msgstr "" +"یک تابع کلید یا تابع هم‌ترازی، یک شیء قابل فراخوانی است که مقداری را " +"بازمی‌گرداند که برای مرتب‌سازی یا ترتیب‌دهی استفاده می‌شود. برای مثال، " +":func:`locale.strxfrm` برای تولید یک کلید مرتب‌سازی که از قراردادهای " +"مرتب‌سازی خاص یک locale آگاه است استفاده می‌شود." -msgid "A number of tools in Python accept key functions to control how elements are ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, and :func:`itertools.groupby`." -msgstr "تعدادی از ابزارهای پایتون، توابع کلید را برای کنترل نحوهٔ ترتیب‌دهی یا گروه‌بندی المان‌ها می‌پذیرند. این ابزارها شامل :func:`min`، :func:`max`، :func:`sorted`، :meth:`list.sort`، :func:`heapq.merge`، :func:`heapq.nsmallest`، :func:`heapq.nlargest` و :func:`itertools.groupby` هستند." +msgid "" +"A number of tools in Python accept key functions to control how elements are" +" ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`," +" :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, " +":func:`heapq.nlargest`, and :func:`itertools.groupby`." +msgstr "" +"تعدادی از ابزارهای پایتون، توابع کلید را برای کنترل نحوه‌ی ترتیب‌دهی یا " +"گروه‌بندی المان‌ها می‌پذیرند. این ابزارها شامل :func:`min`، :func:`max`، " +":func:`sorted`، :meth:`list.sort`، :func:`heapq.merge`، " +":func:`heapq.nsmallest`، :func:`heapq.nlargest` و :func:`itertools.groupby` " +"هستند." -msgid "There are several ways to create a key function. For example. the :meth:`str.casefold` method can serve as a key function for case insensitive sorts. Alternatively, a key function can be built from a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` are three key function constructors. See the :ref:`Sorting HOW TO ` for examples of how to create and use key functions." -msgstr "چندین روش برای ایجاد یک تابع کلید وجود دارد. برای مثال، متد :meth:`str.casefold` می‌تواند به‌عنوان یک تابع کلید برای مرتب‌سازی‌های بدون حساسیت به بزرگی و کوچکی حروف استفاده شود. همچنین، یک تابع کلید می‌تواند از یک عبارت :keyword:`lambda` مانند ``lambda r: (r[0], r[2])`` ساخته شود. علاوه بر این، :func:`operator.attrgetter`، :func:`operator.itemgetter` و :func:`operator.methodcaller` سه سازندهٔ تابع کلید هستند. برای نمونه‌هایی از نحوهٔ ایجاد و استفاده از توابع کلید، :ref:`Sorting HOW TO ` را ببینید." +msgid "" +"There are several ways to create a key function. For example. the " +":meth:`str.casefold` method can serve as a key function for case insensitive" +" sorts. Alternatively, a key function can be built from a :keyword:`lambda`" +" expression such as ``lambda r: (r[0], r[2])``. Also, " +":func:`operator.attrgetter`, :func:`operator.itemgetter`, and " +":func:`operator.methodcaller` are three key function constructors. See the " +":ref:`Sorting HOW TO ` for examples of how to create and use " +"key functions." +msgstr "" +"چندین روش برای ایجاد یک تابع کلید وجود دارد. برای مثال، متد " +":meth:`str.casefold` می‌تواند به‌عنوان یک تابع کلید برای مرتب‌سازی‌های بدون " +"حساسیت به بزرگی و کوچکی حروف استفاده شود. همچنین، یک تابع کلید می‌تواند از " +"یک عبارت :keyword:`lambda` مانند ``lambda r: (r[0], r[2])`` ساخته شود. علاوه" +" بر این، :func:`operator.attrgetter`، :func:`operator.itemgetter` و " +":func:`operator.methodcaller` سه سازنده‌ی تابع کلید هستند. برای نمونه‌هایی از" +" نحوه‌ی ایجاد و استفاده از توابع کلید، :ref:`Sorting HOW TO ` " +"را ببینید." msgid "keyword argument" msgstr "آرگومان کلیدواژه‌ای" @@ -839,17 +1995,44 @@ msgstr ":term:`آرگومان ` را ببینید." msgid "lambda" msgstr "lambda" -msgid "An anonymous inline function consisting of a single :term:`expression` which is evaluated when the function is called. The syntax to create a lambda function is ``lambda [parameters]: expression``" -msgstr "یک تابع درون‌خطی بی‌نام که از یک :term:`عبارت ` واحد تشکیل شده است و هنگام فراخوانی تابع ارزیابی می‌شود. سینتکس ایجاد یک تابع lambda به‌صورت ``lambda [parameters]: expression`` است" +msgid "" +"An anonymous inline function consisting of a single :term:`expression` which" +" is evaluated when the function is called. The syntax to create a lambda " +"function is ``lambda [parameters]: expression``" +msgstr "" +"یک تابع درون‌خطی بی‌نام که از یک :term:`عبارت ` واحد تشکیل شده " +"است و هنگام فراخوانی تابع ارزیابی می‌شود. سینتکس ایجاد یک تابع lambda " +"به‌صورت ``lambda [parameters]: expression`` است" msgid "LBYL" msgstr "LBYL" -msgid "Look before you leap. This coding style explicitly tests for pre-conditions before making calls or lookups. This style contrasts with the :term:`EAFP` approach and is characterized by the presence of many :keyword:`if` statements." -msgstr "پیش از جهش نگاه کنید. این سبک کدنویسی پیش‌شرط‌ها را پیش از انجام فراخوانی‌ها یا جست‌وجوها به‌طور صریح آزمایش می‌کند. این سبک در تضاد با رویکرد :term:`EAFP ` است و با وجود تعداد زیادی دستور :keyword:`if` شناخته می‌شود." +msgid "" +"Look before you leap. This coding style explicitly tests for pre-conditions" +" before making calls or lookups. This style contrasts with the :term:`EAFP`" +" approach and is characterized by the presence of many :keyword:`if` " +"statements." +msgstr "" +"پیش از جهش نگاه کنید. این سبک کدنویسی پیش‌شرط‌ها را پیش از انجام فراخوانی‌ها" +" یا جست‌وجوها به‌طور صریح آزمایش می‌کند. این سبک در تضاد با رویکرد " +":term:`EAFP ` است و با وجود تعداد زیادی دستور :keyword:`if` شناخته " +"می‌شود." -msgid "In a multi-threaded environment, the LBYL approach can risk introducing a :term:`race condition` between \"the looking\" and \"the leaping\". For example, the code, ``if key in mapping: return mapping[key]`` can fail if another thread removes *key* from *mapping* after the test, but before the lookup. This issue can be solved with :term:`locks ` or by using the :term:`EAFP` approach. See also :term:`thread-safe`." -msgstr "در یک محیط چندنخی، رویکرد LBYL می‌تواند خطر ایجاد یک :term:`شرط رقابت ` بین «نگاه کردن» و «جهش کردن» را به همراه داشته باشد. برای مثال، کد ``if key in mapping: return mapping[key]`` ممکن است شکست بخورد اگر نخ‌ای دیگر پس از آزمون، اما پیش از جست‌وجو، *key* را از *mapping* حذف کند. این مشکل را می‌توان با :term:`قفل ` یا با استفاده از رویکرد :term:`EAFP ` حل کرد. همچنین :term:`ایمن برای نخ‌های اجرایی ` را ببینید." +msgid "" +"In a multi-threaded environment, the LBYL approach can risk introducing a " +":term:`race condition` between \"the looking\" and \"the leaping\". For " +"example, the code, ``if key in mapping: return mapping[key]`` can fail if " +"another thread removes *key* from *mapping* after the test, but before the " +"lookup. This issue can be solved with :term:`locks ` or by using the " +":term:`EAFP` approach. See also :term:`thread-safe`." +msgstr "" +"در یک محیط چندنخی، رویکرد LBYL می‌تواند خطر ایجاد یک :term:`شرط رقابت ` بین «نگاه کردن» و «جهش کردن» را به همراه داشته باشد. برای مثال، " +"کد ``if key in mapping: return mapping[key]`` ممکن است شکست بخورد اگر نخ‌ای " +"دیگر پس از آزمون، اما پیش از جست‌وجو، *key* را از *mapping* حذف کند. این " +"مشکل را می‌توان با :term:`قفل ` یا با استفاده از رویکرد :term:`EAFP " +"` حل کرد. همچنین :term:`ایمن برای نخ‌های اجرایی ` را " +"ببینید." msgid "lexical analyzer" msgstr "تحلیلگر واژگانی" @@ -860,32 +2043,95 @@ msgstr "نام رسمی برای *tokenizer*؛ :term:`توکن ` را ب msgid "list" msgstr "فهرست" -msgid "A built-in Python :term:`sequence`. Despite its name it is more akin to an array in other languages than to a linked list since access to elements is *O*\\ (1)." -msgstr "یک :term:`دنباله ` توکار پایتون. با وجود نام آن، این نوع بیشتر شبیه یک آرایه در زبان‌های دیگر است تا یک فهرست پیوندی، زیرا دسترسی به المان‌ها *O*\\ (1) است." +msgid "" +"A built-in Python :term:`sequence`. Despite its name it is more akin to an " +"array in other languages than to a linked list since access to elements is " +"*O*\\ (1)." +msgstr "" +"یک :term:`دنباله ` توکار پایتون. با وجود نام آن، این نوع بیشتر " +"شبیه یک آرایه در زبان‌های دیگر است تا یک فهرست پیوندی، زیرا دسترسی به " +"المان‌ها *O*\\ (1) است." msgid "list comprehension" msgstr "درک فهرستی" -msgid "A compact way to process all or part of the elements in a sequence and return a list with the results. ``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` generates a list of strings containing even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is optional. If omitted, all elements in ``range(256)`` are processed." -msgstr "روشی فشرده برای پردازش همه یا بخشی از المان‌های یک دنباله و بازگرداندن یک فهرست با نتایج. ``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` فهرستی از نخ‌ها شامل اعداد مبنای شانزده زوج (0x..) در محدودهٔ ۰ تا ۲۵۵ تولید می‌کند. بند :keyword:`if` اختیاری است. اگر حذف شود، همهٔ المان‌های ``range(256)`` پردازش می‌شوند." +msgid "" +"A compact way to process all or part of the elements in a sequence and " +"return a list with the results. ``result = ['{:#04x}'.format(x) for x in " +"range(256) if x % 2 == 0]`` generates a list of strings containing even hex " +"numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " +"optional. If omitted, all elements in ``range(256)`` are processed." +msgstr "" +"روشی فشرده برای پردازش همه یا بخشی از المان‌های یک دنباله و بازگرداندن یک " +"فهرست با نتایج. ``result = ['{:#04x}'.format(x) for x in range(256) if x % 2" +" == 0]`` فهرستی از نخ‌ها شامل اعداد مبنای شانزده زوج (0x..) در محدوده‌ی ۰ تا " +"۲۵۵ تولید می‌کند. بند :keyword:`if` اختیاری است. اگر حذف شود، همه‌ی المان‌های" +" ``range(256)`` پردازش می‌شوند." msgid "lock" msgstr "قفل" -msgid "A :term:`synchronization primitive` that allows only one thread at a time to access a shared resource. A thread must acquire a lock before accessing the protected resource and release it afterward. If a thread attempts to acquire a lock that is already held by another thread, it will block until the lock becomes available. Python's :mod:`threading` module provides :class:`~threading.Lock` (a basic lock) and :class:`~threading.RLock` (a :term:`reentrant` lock). Locks are used to prevent :term:`race conditions ` and ensure :term:`thread-safe` access to shared data. Alternative design patterns to locks exist such as queues, producer/consumer patterns, and thread-local state. See also :term:`deadlock`, and :term:`reentrant`." -msgstr "یک :term:`اولیه ` که در هر زمان فقط به یک نخ اجازهٔ دسترسی به یک منبع اشتراکی را می‌دهد. یک نخ باید پیش از دسترسی به منبع محافظت‌شده، یک قفل را به‌دست آورد و پس از آن آن را آزاد کند. اگر یک نخ تلاش کند قفلی را به‌دست آورد که پیش‌تر توسط نخ‌ای دیگر در اختیار گرفته شده است، تا زمانی که قفل در دسترس قرار گیرد مسدود می‌شود. ماژول :mod:`threading` پایتون، :class:`~threading.Lock` (یک قفل پایه) و :class:`~threading.RLock` (یک قفل :term:`بازورودپذیر `) را فراهم می‌کند. قفل‌ها برای جلوگیری از :term:`شرط رقابت ` و تضمین دسترسی :term:`ایمن برای نخ‌های اجرایی ` به داده‌های اشتراکی استفاده می‌شوند. الگوهای طراحی جایگزین برای قفل‌ها وجود دارند، مانند صف‌ها، الگوهای تولیدکننده/مصرف‌کننده و وضعیت محلی نخ. همچنین :term:`بن‌بست ` و :term:`بازورودپذیر ` را ببینید." +msgid "" +"A :term:`synchronization primitive` that allows only one thread at a time to" +" access a shared resource. A thread must acquire a lock before accessing " +"the protected resource and release it afterward. If a thread attempts to " +"acquire a lock that is already held by another thread, it will block until " +"the lock becomes available. Python's :mod:`threading` module provides " +":class:`~threading.Lock` (a basic lock) and :class:`~threading.RLock` (a " +":term:`reentrant` lock). Locks are used to prevent :term:`race conditions " +"` and ensure :term:`thread-safe` access to shared data. " +"Alternative design patterns to locks exist such as queues, producer/consumer" +" patterns, and thread-local state. See also :term:`deadlock`, and " +":term:`reentrant`." +msgstr "" +"یک :term:`اولیه ` که در هر زمان فقط به یک نخ " +"اجازه‌ی دسترسی به یک منبع اشتراکی را می‌دهد. یک نخ باید پیش از دسترسی به منبع" +" محافظت‌شده، یک قفل را به‌دست آورد و پس از آن آن را آزاد کند. اگر یک نخ تلاش" +" کند قفلی را به‌دست آورد که پیش‌تر توسط نخ‌ای دیگر در اختیار گرفته شده است، " +"تا زمانی که قفل در دسترس قرار گیرد مسدود می‌شود. ماژول :mod:`threading` " +"پایتون، :class:`~threading.Lock` (یک قفل پایه) و :class:`~threading.RLock` " +"(یک قفل :term:`بازورودپذیر `) را فراهم می‌کند. قفل‌ها برای " +"جلوگیری از :term:`شرط رقابت ` و تضمین دسترسی :term:`ایمن " +"برای نخ‌های اجرایی ` به داده‌های اشتراکی استفاده می‌شوند. " +"الگوهای طراحی جایگزین برای قفل‌ها وجود دارند، مانند صف‌ها، الگوهای " +"تولیدکننده/مصرف‌کننده و وضعیت محلی نخ. همچنین :term:`بن‌بست ` و " +":term:`بازورودپذیر ` را ببینید." msgid "lock-free" msgstr "بدون قفل" -msgid "An operation that does not acquire any :term:`lock` and uses atomic CPU instructions to ensure correctness. Lock-free operations can execute concurrently without blocking each other and cannot be blocked by operations that hold locks. In :term:`free-threaded ` Python, built-in types like :class:`dict` and :class:`list` provide lock-free read operations, which means other threads may observe intermediate states during multi-step modifications even when those modifications hold the :term:`per-object lock`." -msgstr "عملیاتی که هیچ :term:`قفل‌ `\\ ای به‌دست نمی‌آورد و برای تضمین درستی از دستورهای اتمی CPU استفاده می‌کند. عملیات‌های بدون قفل می‌توانند به‌طور هم‌زمان و بدون مسدود کردن یکدیگر اجرا شوند و نمی‌توانند توسط عملیات‌هایی که قفل‌ها را در اختیار دارند مسدود شوند. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` عملیات‌های خواندن بدون قفل ارائه می‌کنند، یعنی نخ‌های دیگر ممکن است در طول تغییرات چندمرحله‌ای، حتی زمانی که آن تغییرات :term:`قفلِ هر شیء ` را نگه داشته‌اند، وضعیت‌های میانی را مشاهده کنند." +msgid "" +"An operation that does not acquire any :term:`lock` and uses atomic CPU " +"instructions to ensure correctness. Lock-free operations can execute " +"concurrently without blocking each other and cannot be blocked by operations" +" that hold locks. In :term:`free-threaded ` Python, built-in" +" types like :class:`dict` and :class:`list` provide lock-free read " +"operations, which means other threads may observe intermediate states during" +" multi-step modifications even when those modifications hold the :term:`per-" +"object lock`." +msgstr "" +"عملیاتی که هیچ :term:`قفل `\\ ای به‌دست نمی‌آورد و برای تضمین درستی " +"از دستورهای اتمی CPU استفاده می‌کند. عملیات‌های بدون قفل می‌توانند به‌طور " +"همزمان و بدون مسدود کردن یکدیگر اجرا شوند و نمی‌توانند توسط عملیات‌هایی که " +"قفل‌ها را در اختیار دارند مسدود شوند. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` عملیات‌های " +"خواندن بدون قفل ارائه می‌کنند، یعنی نخ‌های دیگر ممکن است در طول تغییرات " +"چندمرحله‌ای، حتی زمانی که آن تغییرات :term:`قفلِ هر شیء ` " +"را نگه داشته‌اند، وضعیت‌های میانی را مشاهده کنند." msgid "loader" msgstr "بارگذار" -msgid "An object that loads a module. It must define the :meth:`!exec_module` and :meth:`!create_module` methods to implement the :class:`~importlib.abc.Loader` interface. A loader is typically returned by a :term:`finder`. See also:" -msgstr "شیءای که یک ماژول را بارگذاری می‌کند. برای پیاده‌سازی رابط :class:`~importlib.abc.Loader` باید متدهای :meth:`!exec_module` و :meth:`!create_module` را تعریف کند. یک بارگذار معمولاً توسط یک :term:`یابنده ` بازگردانده می‌شود. همچنین ببینید:" +msgid "" +"An object that loads a module. It must define the :meth:`!exec_module` and " +":meth:`!create_module` methods to implement the " +":class:`~importlib.abc.Loader` interface. A loader is typically returned by " +"a :term:`finder`. See also:" +msgstr "" +"شیءای که یک ماژول را بارگذاری می‌کند. برای پیاده‌سازی رابط " +":class:`~importlib.abc.Loader` باید متدهای :meth:`!exec_module` و " +":meth:`!create_module` را تعریف کند. یک بارگذار معمولاً توسط یک " +":term:`یابنده ` بازگردانده می‌شود. همچنین ببینید:" msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" @@ -897,22 +2143,32 @@ msgid ":pep:`302`" msgstr ":pep:`302`" msgid "locale encoding" -msgstr "کدگذاری محلی" +msgstr "کدگذاری locale" -msgid "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:`locale.setlocale(locale.LC_CTYPE, new_locale) `." -msgstr "در یونیکس، این همان کدگذاری محلی LC_CTYPE است. می‌توان آن را با :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` تنظیم کرد." +msgid "" +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with " +":func:`locale.setlocale(locale.LC_CTYPE, new_locale) `." +msgstr "" +"در یونیکس، این همان کدگذاری locale LC_CTYPE است. می‌توان آن را با " +":func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` " +"تنظیم کرد." msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." -msgstr "در ویندوز، این همان صفحهٔ کد ANSI است (برای مثال ``\"cp1252\"``)." +msgstr "در ویندوز، این همان صفحه‌ی کد ANSI است (برای مثال ``\"cp1252\"``)." msgid "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." -msgstr "در Android و VxWorks، پایتون از ``\"utf-8\"`` به‌عنوان کدگذاری محلی استفاده می‌کند." +msgstr "" +"در Android و VxWorks، پایتون از ``\"utf-8\"`` به‌عنوان کدگذاری locale استفاده " +"می‌کند." msgid ":func:`locale.getencoding` can be used to get the locale encoding." -msgstr "از :func:`locale.getencoding` می‌توان برای دریافت کدگذاری محلی استفاده کرد." +msgstr "" +"از :func:`locale.getencoding` می‌توان برای دریافت کدگذاری locale استفاده کرد." msgid "See also the :term:`filesystem encoding and error handler`." -msgstr "همچنین :term:`کدگذاری سیستم فایل و مدیریت‌کنندهٔ خطا ` را ببینید." +msgstr "" +"همچنین :term:`کدگذاری سیستم فایل و هندلر خطا ` را ببینید." msgid "magic method" msgstr "متد جادویی" @@ -923,23 +2179,63 @@ msgstr "یک مترادف غیررسمی برای :term:`متد ویژه `. Examples include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` and :class:`collections.Counter`." -msgstr "یک شیء محفظه‌ای که از جست‌وجوی کلیدهای دلخواه پشتیبانی می‌کند و متدهای مشخص‌شده در :class:`collections.abc.Mapping` یا :class:`collections.abc.MutableMapping` :ref:`abstract base classes ` را پیاده‌سازی می‌کند. نمونه‌ها شامل :class:`dict`، :class:`collections.defaultdict`، :class:`collections.OrderedDict` و :class:`collections.Counter` هستند." +msgid "" +"A container object that supports arbitrary key lookups and implements the " +"methods specified in the :class:`collections.abc.Mapping` or " +":class:`collections.abc.MutableMapping` :ref:`abstract base classes " +"`. Examples include :class:`dict`, " +":class:`collections.defaultdict`, :class:`collections.OrderedDict` and " +":class:`collections.Counter`." +msgstr "" +"یک شیء محفظه‌ای که از جست‌وجوی کلیدهای دلخواه پشتیبانی می‌کند و متدهای " +"مشخص‌شده در :class:`collections.abc.Mapping` یا " +":class:`collections.abc.MutableMapping` :ref:`abstract base classes " +"` را پیاده‌سازی می‌کند. نمونه‌ها شامل " +":class:`dict`، :class:`collections.defaultdict`، " +":class:`collections.OrderedDict` و :class:`collections.Counter` هستند." msgid "meta path finder" -msgstr "یابندهٔ مسیر فراداده" +msgstr "یابنده‌ی مسیر فراداده" -msgid "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path finders are related to, but different from :term:`path entry finders `." -msgstr "یک :term:`یابنده ` که از جست‌وجوی :data:`sys.meta_path` بازگردانده می‌شود. یابنده‌های مسیر فراداده با :term:`یابندهٔ ورودی مسیر ` مرتبط هستند، اما با آن‌ها تفاوت دارند." +msgid "" +"A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " +"finders are related to, but different from :term:`path entry finders `." +msgstr "" +"یک :term:`یابنده ` که از جست‌وجوی :data:`sys.meta_path` بازگردانده " +"می‌شود. یابنده‌های مسیر فراداده با :term:`یابنده‌ی ورودی مسیر ` مرتبط هستند، اما با آن‌ها تفاوت دارند." -msgid "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path finders implement." -msgstr "برای متدهایی که یابنده‌های مسیر فراداده پیاده‌سازی می‌کنند، :class:`importlib.abc.MetaPathFinder` را ببینید." +msgid "" +"See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " +"finders implement." +msgstr "" +"برای متدهایی که یابنده‌های مسیر فراداده پیاده‌سازی می‌کنند، " +":class:`importlib.abc.MetaPathFinder` را ببینید." msgid "metaclass" msgstr "فراکلاس" -msgid "The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for taking those three arguments and creating the class. Most object oriented programming languages provide a default implementation. What makes Python special is that it is possible to create custom metaclasses. Most users never need this tool, but when the need arises, metaclasses can provide powerful, elegant solutions. They have been used for logging attribute access, adding thread-safety, tracking object creation, implementing singletons, and many other tasks." -msgstr "کلاس یک کلاس. تعریف‌های کلاس یک نام کلاس، یک دیکشنری کلاس و یک فهرست از کلاس‌های پایه ایجاد می‌کنند. فراکلاس مسئول دریافت این سه آرگومان و ایجاد کلاس است. بیشتر زبان‌های برنامه‌نویسی شیءگرا یک پیاده‌سازی پیش‌فرض ارائه می‌کنند. چیزی که پایتون را ویژه می‌کند این است که امکان ایجاد فراکلاس‌های سفارشی وجود دارد. بیشتر کاربران هرگز به این ابزار نیاز پیدا نمی‌کنند، اما هنگامی که نیاز به آن پیش بیاید، فراکلاس‌ها می‌توانند راه‌حل‌های قدرتمند و ظریفی ارائه دهند. از آن‌ها برای ثبت دسترسی به ویژگی‌ها، افزودن ایمنی نخ‌ای، پیگیری ایجاد شیء، پیاده‌سازی تک‌نمونه‌ها و بسیاری کارهای دیگر استفاده شده است." +msgid "" +"The class of a class. Class definitions create a class name, a class " +"dictionary, and a list of base classes. The metaclass is responsible for " +"taking those three arguments and creating the class. Most object oriented " +"programming languages provide a default implementation. What makes Python " +"special is that it is possible to create custom metaclasses. Most users " +"never need this tool, but when the need arises, metaclasses can provide " +"powerful, elegant solutions. They have been used for logging attribute " +"access, adding thread-safety, tracking object creation, implementing " +"singletons, and many other tasks." +msgstr "" +"کلاس یک کلاس. تعریف‌های کلاس یک نام کلاس، یک دیکشنری کلاس و یک فهرست از " +"کلاس‌های پایه ایجاد می‌کنند. فراکلاس مسئول دریافت این سه آرگومان و ایجاد " +"کلاس است. بیشتر زبان‌های برنامه‌نویسی شیءگرا یک پیاده‌سازی پیش‌فرض ارائه " +"می‌کنند. چیزی که پایتون را ویژه می‌کند این است که امکان ایجاد فراکلاس‌های " +"سفارشی وجود دارد. بیشتر کاربران هرگز به این ابزار نیاز پیدا نمی‌کنند، اما " +"هنگامی که نیاز به آن پیش بیاید، فراکلاس‌ها می‌توانند راه‌حل‌های قدرتمند و " +"ظریفی ارائه دهند. از آن‌ها برای ثبت دسترسی به ویژگی‌ها، افزودن ایمنی نخ‌ای، " +"پیگیری ایجاد شیء، پیاده‌سازی تک‌نمونه‌ها و بسیاری کارهای دیگر استفاده شده " +"است." msgid "More information can be found in :ref:`metaclasses`." msgstr "اطلاعات بیشتر را می‌توان در :ref:`metaclasses` یافت." @@ -947,20 +2243,40 @@ msgstr "اطلاعات بیشتر را می‌توان در :ref:`metaclasses` msgid "method" msgstr "متد" -msgid "A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first :term:`argument` (which is usually called ``self``). See :term:`function` and :term:`nested scope`." -msgstr "تابعی که درون بدنهٔ یک کلاس تعریف شده است. اگر به‌عنوان یک ویژگی از یک نمونهٔ آن کلاس فراخوانی شود، متد شیء نمونه را به‌عنوان نخستین :term:`آرگومان ` خود دریافت می‌کند (که معمولاً ``self`` نامیده می‌شود). :term:`تابع ` و :term:`محدودهٔ تو‌در‌تو ` را ببینید." +msgid "" +"A function which is defined inside a class body. If called as an attribute " +"of an instance of that class, the method will get the instance object as its" +" first :term:`argument` (which is usually called ``self``). See " +":term:`function` and :term:`nested scope`." +msgstr "" +"تابعی که درون بدنه‌ی یک کلاس تعریف شده است. اگر به‌عنوان یک ویژگی از یک " +"نمونه‌ی آن کلاس فراخوانی شود، متد شیء نمونه را به‌عنوان نخستین :term:`آرگومان" +" ` خود دریافت می‌کند (که معمولاً ``self`` نامیده می‌شود). " +":term:`تابع ` و :term:`محدوده‌ی تودرتو ` را ببینید." msgid "method resolution order" msgstr "ترتیب حل متد" -msgid "Method Resolution Order is the order in which base classes are searched for a member during lookup. See :ref:`python_2.3_mro` for details of the algorithm used by the Python interpreter since the 2.3 release." -msgstr "ترتیب حل متد، ترتیبی است که در آن کلاس‌های پایه هنگام جست‌وجوی یک عضو بررسی می‌شوند. برای جزئیات الگوریتمی که مفسر پایتون از انتشار ۲.۳ به بعد استفاده می‌کند، :ref:`python_2.3_mro` را ببینید." +msgid "" +"Method Resolution Order is the order in which base classes are searched for " +"a member during lookup. See :ref:`python_2.3_mro` for details of the " +"algorithm used by the Python interpreter since the 2.3 release." +msgstr "" +"ترتیب حل متد، ترتیبی است که در آن کلاس‌های پایه هنگام جست‌وجوی یک عضو بررسی " +"می‌شوند. برای جزئیات الگوریتمی که مفسر پایتون از انتشار ۲.۳ به بعد استفاده " +"می‌کند، :ref:`python_2.3_mro` را ببینید." msgid "module" msgstr "ماژول" -msgid "An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of :term:`importing`." -msgstr "شیءای که به‌عنوان واحد سازمان‌دهی کد پایتون عمل می‌کند. ماژول‌ها یک نام‌فضا دارند که شامل اشیای دلخواه پایتون است. ماژول‌ها از طریق فرایند :term:`ایمپورت کردن ` در پایتون بارگذاری می‌شوند." +msgid "" +"An object that serves as an organizational unit of Python code. Modules " +"have a namespace containing arbitrary Python objects. Modules are loaded " +"into Python by the process of :term:`importing`." +msgstr "" +"شیءای که به‌عنوان واحد سازمان‌دهی کد پایتون عمل می‌کند. ماژول‌ها یک فضای نام " +"دارند که شامل اشیای دلخواه پایتون است. ماژول‌ها از طریق فرایند " +":term:`ایمپورت کردن ` در پایتون بارگذاری می‌شوند." msgid "See also :term:`package`." msgstr "همچنین :term:`بسته ` را ببینید." @@ -968,8 +2284,12 @@ msgstr "همچنین :term:`بسته ` را ببینید." msgid "module spec" msgstr "مشخصات ماژول" -msgid "A namespace containing the import-related information used to load a module. An instance of :class:`importlib.machinery.ModuleSpec`." -msgstr "نام‌فضایی که شامل اطلاعات مرتبط با ایمپورت است و برای بارگذاری یک ماژول استفاده می‌شود. یک نمونه از :class:`importlib.machinery.ModuleSpec`." +msgid "" +"A namespace containing the import-related information used to load a module." +" An instance of :class:`importlib.machinery.ModuleSpec`." +msgstr "" +"فضای نامی که شامل اطلاعات مرتبط با ایمپورت است و برای بارگذاری یک ماژول " +"استفاده می‌شود. یک نمونه از :class:`importlib.machinery.ModuleSpec`." msgid "See also :ref:`module-specs`." msgstr "همچنین :ref:`module-specs` را ببینید." @@ -983,17 +2303,41 @@ msgstr ":term:`ترتیب حل متد ` را ببینی msgid "mutable" msgstr "تغییرپذیر" -msgid "An :term:`object` with state that is allowed to change during the course of the program. In multi-threaded programs, mutable objects that are shared between threads require careful synchronization to avoid :term:`race conditions `. See also :term:`immutable`, :term:`thread-safe`, and :term:`concurrent modification`." -msgstr "یک :term:`شیء ` که وضعیت آن در طول اجرای برنامه اجازهٔ تغییر دارد. در برنامه‌های چندنخی، اشیای تغییرپذیری که بین نخ‌ها اشتراک‌گذاری می‌شوند، برای جلوگیری از :term:`شرط رقابت ` به همگام‌سازی دقیق نیاز دارند. همچنین :term:`تغییرناپذیر `، :term:`ایمن برای نخ‌های اجرایی ` و :term:`تغییر هم‌زمان ` را ببینید." +msgid "" +"An :term:`object` with state that is allowed to change during the course of " +"the program. In multi-threaded programs, mutable objects that are shared " +"between threads require careful synchronization to avoid :term:`race " +"conditions `. See also :term:`immutable`, :term:`thread-" +"safe`, and :term:`concurrent modification`." +msgstr "" +"یک :term:`شیء ` که وضعیت آن در طول اجرای برنامه اجازه‌ی تغییر دارد. " +"در برنامه‌های چندنخی، اشیای تغییرپذیری که بین نخ‌ها اشتراک‌گذاری می‌شوند، " +"برای جلوگیری از :term:`شرط رقابت ` به همگام‌سازی دقیق نیاز " +"دارند. همچنین :term:`تغییرناپذیر `، :term:`ایمن برای نخ‌های " +"اجرایی ` و :term:`تغییر همزمان ` را " +"ببینید." msgid "named tuple" msgstr "تاپل نام‌دار" -msgid "The term \"named tuple\" applies to any type or class that inherits from tuple and whose indexable elements are also accessible using named attributes. The type or class may have other features as well." -msgstr "اصطلاح «تاپل نام‌دار» برای هر نوع یا کلاسی به‌کار می‌رود که از tuple ارث‌بری می‌کند و المان‌های قابل دسترسی با اندیس آن، با استفاده از ویژگی‌های نام‌دار نیز قابل دسترسی هستند. این نوع یا کلاس ممکن است ویژگی‌های دیگری نیز داشته باشد." +msgid "" +"The term \"named tuple\" applies to any type or class that inherits from " +"tuple and whose indexable elements are also accessible using named " +"attributes. The type or class may have other features as well." +msgstr "" +"اصطلاح «تاپل نام‌دار» برای هر نوع یا کلاسی به‌کار می‌رود که از tuple ارث‌بری" +" می‌کند و المان‌های قابل دسترسی با اندیس آن، با استفاده از ویژگی‌های نام‌دار" +" نیز قابل دسترسی هستند. این نوع یا کلاس ممکن است ویژگی‌های دیگری نیز داشته " +"باشد." -msgid "Several built-in types are named tuples, including the values returned by :func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys.float_info`::" -msgstr "چندین نوع توکار، تاپل نام‌دار هستند، از جمله مقادیری که توسط :func:`time.localtime` و :func:`os.stat` بازگردانده می‌شوند. نمونهٔ دیگر :data:`sys.float_info` است::" +msgid "" +"Several built-in types are named tuples, including the values returned by " +":func:`time.localtime` and :func:`os.stat`. Another example is " +":data:`sys.float_info`::" +msgstr "" +"چندین نوع توکار، تاپل نام‌دار هستند، از جمله مقادیری که توسط " +":func:`time.localtime` و :func:`os.stat` بازگردانده می‌شوند. نمونه‌ی دیگر " +":data:`sys.float_info` است::" msgid "" ">>> sys.float_info[1] # indexed access\n" @@ -1010,26 +2354,76 @@ msgstr "" ">>> isinstance(sys.float_info, tuple) # نوعی تاپل\n" "True" -msgid "Some named tuples are built-in types (such as the above examples). Alternatively, a named tuple can be created from a regular class definition that inherits from :class:`tuple` and that defines named fields. Such a class can be written by hand, or it can be created by inheriting :class:`typing.NamedTuple`, or with the factory function :func:`collections.namedtuple`. The latter techniques also add some extra methods that may not be found in hand-written or built-in named tuples." -msgstr "برخی تاپل‌های نام‌دار، نوع‌های توکار هستند (مانند نمونه‌های بالا). روش دیگر، ایجاد یک تاپل نام‌دار از طریق یک تعریف کلاس معمولی است که از :class:`tuple` ارث‌بری می‌کند و فیلدهای نام‌دار را تعریف می‌کند. چنین کلاسی را می‌توان به‌صورت دستی نوشت، یا با ارث‌بری از :class:`typing.NamedTuple`، یا با تابع کارخانهٔ :func:`collections.namedtuple` ایجاد کرد. دو روش اخیر همچنین چند متد اضافی اضافه می‌کنند که ممکن است در تاپل‌های نام‌دار دست‌نویس یا توکار وجود نداشته باشند." +msgid "" +"Some named tuples are built-in types (such as the above examples). " +"Alternatively, a named tuple can be created from a regular class definition " +"that inherits from :class:`tuple` and that defines named fields. Such a " +"class can be written by hand, or it can be created by inheriting " +":class:`typing.NamedTuple`, or with the factory function " +":func:`collections.namedtuple`. The latter techniques also add some extra " +"methods that may not be found in hand-written or built-in named tuples." +msgstr "" +"برخی تاپل‌های نام‌دار، نوع‌های توکار هستند (مانند نمونه‌های بالا). روش دیگر،" +" ایجاد یک تاپل نام‌دار از طریق یک تعریف کلاس معمولی است که از :class:`tuple`" +" ارث‌بری می‌کند و فیلدهای نام‌دار را تعریف می‌کند. چنین کلاسی را می‌توان " +"به‌صورت دستی نوشت، یا با ارث‌بری از :class:`typing.NamedTuple`، یا با تابع " +"کارخانه‌ی :func:`collections.namedtuple` ایجاد کرد. دو روش اخیر همچنین چند " +"متد اضافی اضافه می‌کنند که ممکن است در تاپل‌های نام‌دار دست‌نویس یا توکار " +"وجود نداشته باشند." msgid "namespace" -msgstr "نام‌فضا" +msgstr "فضای نام" -msgid "The place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and built-in namespaces as well as nested namespaces in objects (in methods). Namespaces support modularity by preventing naming conflicts. For instance, the functions :func:`builtins.open <.open>` and :func:`os.open` are distinguished by their namespaces. Namespaces also aid readability and maintainability by making it clear which module implements a function. For instance, writing :func:`random.seed` or :func:`itertools.islice` makes it clear that those functions are implemented by the :mod:`random` and :mod:`itertools` modules, respectively." -msgstr "محلی که یک متغیر در آن ذخیره می‌شود. نام‌فضاها به‌صورت دیکشنری پیاده‌سازی می‌شوند. نام‌فضاهای محلی، سراسری و توکار، همچنین نام‌فضاهای تو‌در‌تو در اشیا (در متدها) وجود دارند. نام‌فضاها با جلوگیری از تداخل نام‌ها، پیمانه‌ای بودن را پشتیبانی می‌کنند. برای نمونه، تابع‌های :func:`builtins.open <.open>` و :func:`os.open` با استفاده از نام‌فضاهای خود از یکدیگر متمایز می‌شوند. نام‌فضاها همچنین با مشخص کردن اینکه کدام ماژول یک تابع را پیاده‌سازی می‌کند، به خوانایی و نگه‌داری‌پذیری کمک می‌کنند. برای نمونه، نوشتن :func:`random.seed` یا :func:`itertools.islice` مشخص می‌کند که این تابع‌ها به‌ترتیب توسط ماژول‌های :mod:`random` و :mod:`itertools` پیاده‌سازی شده‌اند." +msgid "" +"The place where a variable is stored. Namespaces are implemented as " +"dictionaries. There are the local, global and built-in namespaces as well " +"as nested namespaces in objects (in methods). Namespaces support modularity" +" by preventing naming conflicts. For instance, the functions " +":func:`builtins.open <.open>` and :func:`os.open` are distinguished by their" +" namespaces. Namespaces also aid readability and maintainability by making " +"it clear which module implements a function. For instance, writing " +":func:`random.seed` or :func:`itertools.islice` makes it clear that those " +"functions are implemented by the :mod:`random` and :mod:`itertools` modules," +" respectively." +msgstr "" +"محلی که یک متغیر در آن ذخیره می‌شود. فضای نامها به‌صورت دیکشنری پیاده‌سازی " +"می‌شوند. فضای نام های محلی، سراسری و توکار، همچنین فضای نام های تودرتو در اشیا" +" (در متدها) وجود دارند. فضای نامها با جلوگیری از تداخل نام‌ها، پیمانه‌ای بودن" +" را پشتیبانی می‌کنند. برای نمونه، تابع‌های :func:`builtins.open <.open>` و " +":func:`os.open` با استفاده از فضای نام های خود از یکدیگر متمایز می‌شوند. " +"فضای نامها همچنین با مشخص کردن اینکه کدام ماژول یک تابع را پیاده‌سازی می‌کند،" +" به خوانایی و نگه‌داری‌پذیری کمک می‌کنند. برای نمونه، نوشتن " +":func:`random.seed` یا :func:`itertools.islice` مشخص می‌کند که این تابع‌ها " +"به‌ترتیب توسط ماژول‌های :mod:`random` و :mod:`itertools` پیاده‌سازی شده‌اند." msgid "namespace package" -msgstr "بستهٔ نام‌فضا" +msgstr "بسته‌ی فضای نام" -msgid "A :term:`package` which serves only as a container for subpackages. Namespace packages may have no physical representation, and specifically are not like a :term:`regular package` because they have no ``__init__.py`` file." -msgstr "یک :term:`بسته ` که فقط به‌عنوان محفظه‌ای برای زیربسته‌ها عمل می‌کند. بسته‌های نام‌فضا ممکن است نمایش فیزیکی نداشته باشند و به‌طور مشخص مانند یک :term:`بستهٔ معمولی ` نیستند، زیرا فایل ``__init__.py`` ندارند." +msgid "" +"A :term:`package` which serves only as a container for subpackages. " +"Namespace packages may have no physical representation, and specifically are" +" not like a :term:`regular package` because they have no ``__init__.py`` " +"file." +msgstr "" +"یک :term:`بسته ` که فقط به‌عنوان محفظه‌ای برای زیربسته‌ها عمل " +"می‌کند. بسته‌های فضای نام ممکن است نمایش فیزیکی نداشته باشند و به‌طور مشخص " +"مانند یک :term:`بسته‌ی معمولی ` نیستند، زیرا فایل " +"``__init__.py`` ندارند." -msgid "Namespace packages allow several individually installable packages to have a common parent package. Otherwise, it is recommended to use a :term:`regular package`." -msgstr "بسته‌های نام‌فضا به چندین بستهٔ قابل نصب مستقل اجازه می‌دهند که یک بستهٔ والد مشترک داشته باشند. در غیر این صورت، توصیه می‌شود از یک :term:`بستهٔ معمولی ` استفاده کنید." +msgid "" +"Namespace packages allow several individually installable packages to have a" +" common parent package. Otherwise, it is recommended to use a :term:`regular" +" package`." +msgstr "" +"بسته‌های فضای نام به چندین بسته‌ی قابل نصب مستقل اجازه می‌دهند که یک بسته‌ی " +"والد مشترک داشته باشند. در غیر این صورت، توصیه می‌شود از یک :term:`بسته‌ی " +"معمولی ` استفاده کنید." -msgid "For more information, see :pep:`420` and :ref:`reference-namespace-package`." -msgstr "برای اطلاعات بیشتر، :pep:`420` و :ref:`reference-namespace-package` را ببینید." +msgid "" +"For more information, see :pep:`420` and :ref:`reference-namespace-package`." +msgstr "" +"برای اطلاعات بیشتر، :pep:`420` و :ref:`reference-namespace-package` را " +"ببینید." msgid "See also :term:`module`." msgstr "همچنین :term:`ماژول ` را ببینید." @@ -1037,149 +2431,375 @@ msgstr "همچنین :term:`ماژول ` را ببینید." msgid "native code" msgstr "کد بومی" -msgid "Code that is compiled to machine instructions and runs directly on the processor, as opposed to code that is interpreted or runs in a virtual machine. In the context of Python, native code typically refers to C, C++, Rust or Fortran code in :term:`extension modules ` that can be called from Python. See also :term:`extension module`." -msgstr "کدی که به دستورهای ماشین کامپایل شده و مستقیماً روی پردازنده اجرا می‌شود، برخلاف کدی که تفسیر می‌شود یا در یک ماشین مجازی اجرا می‌شود. در زمینهٔ پایتون، کد بومی معمولاً به کد C، C++، Rust یا Fortran در :term:`ماژول افزونه ` اشاره دارد که می‌توانند از پایتون فراخوانی شوند. همچنین :term:`ماژول افزونه ` را ببینید." +msgid "" +"Code that is compiled to machine instructions and runs directly on the " +"processor, as opposed to code that is interpreted or runs in a virtual " +"machine. In the context of Python, native code typically refers to C, C++, " +"Rust or Fortran code in :term:`extension modules ` that " +"can be called from Python. See also :term:`extension module`." +msgstr "" +"کدی که به دستورهای ماشین کامپایل شده و مستقیماً روی پردازنده اجرا می‌شود، " +"برخلاف کدی که تفسیر می‌شود یا در یک ماشین مجازی اجرا می‌شود. در زمینه‌ی " +"پایتون، کد بومی معمولاً به کد C، C++، Rust یا Fortran در :term:`ماژول افزونه" +" ` اشاره دارد که می‌توانند از پایتون فراخوانی شوند. همچنین" +" :term:`ماژول افزونه ` را ببینید." msgid "nested scope" -msgstr "محدودهٔ تو‌در‌تو" +msgstr "محدوده‌ی تودرتو" -msgid "The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested scopes by default work only for reference and not for assignment. Local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace. The :keyword:`nonlocal` allows writing to outer scopes." -msgstr "توانایی ارجاع به یک متغیر در یک تعریف دربرگیرنده. برای مثال، تابعی که داخل تابع دیگری تعریف شده است می‌تواند به متغیرهای تابع بیرونی دسترسی داشته باشد. توجه کنید که محدوده‌های تو‌در‌تو به‌صورت پیش‌فرض فقط برای ارجاع دادن و نه برای انتساب کار می‌کنند. متغیرهای محلی هم در نزدیک‌ترین محدوده خوانده و نوشته می‌شوند. به همین ترتیب، متغیرهای سراسری از نام‌فضای سراسری خوانده و در آن نوشته می‌شوند. کلیدواژهٔ :keyword:`nonlocal` امکان نوشتن در محدوده‌های بیرونی را فراهم می‌کند." +msgid "" +"The ability to refer to a variable in an enclosing definition. For " +"instance, a function defined inside another function can refer to variables " +"in the outer function. Note that nested scopes by default work only for " +"reference and not for assignment. Local variables both read and write in " +"the innermost scope. Likewise, global variables read and write to the " +"global namespace. The :keyword:`nonlocal` allows writing to outer scopes." +msgstr "" +"توانایی ارجاع به یک متغیر در یک تعریف دربرگیرنده. برای مثال، تابعی که داخل " +"تابع دیگری تعریف شده است می‌تواند به متغیرهای تابع بیرونی دسترسی داشته باشد." +" توجه کنید که محدوده‌های تودرتو به‌صورت پیش‌فرض فقط برای ارجاع دادن و نه " +"برای انتساب کار می‌کنند. متغیرهای محلی هم در نزدیک‌ترین محدوده خوانده و " +"نوشته می‌شوند. به همین ترتیب، متغیرهای سراسری از فضای نام سراسری خوانده و در" +" آن نوشته می‌شوند. کلیدواژه‌ی :keyword:`nonlocal` امکان نوشتن در محدوده‌های " +"بیرونی را فراهم می‌کند." msgid "new-style class" msgstr "کلاس سبک جدید" -msgid "Old name for the flavor of classes now used for all class objects. In earlier Python versions, only new-style classes could use Python's newer, versatile features like :attr:`~object.__slots__`, descriptors, properties, :meth:`~object.__getattribute__`, class methods, and static methods." -msgstr "نام قدیمی برای گونه‌ای از کلاس‌ها که اکنون برای همهٔ اشیای کلاس استفاده می‌شود. در نسخه‌های قدیمی‌تر پایتون، فقط کلاس‌های سبک جدید می‌توانستند از قابلیت‌های جدیدتر و انعطاف‌پذیر پایتون مانند :attr:`~object.__slots__`، توصیف‌گرها، ویژگی‌ها، :meth:`~object.__getattribute__`، متدهای کلاس و متدهای ایستا استفاده کنند." +msgid "" +"Old name for the flavor of classes now used for all class objects. In " +"earlier Python versions, only new-style classes could use Python's newer, " +"versatile features like :attr:`~object.__slots__`, descriptors, properties, " +":meth:`~object.__getattribute__`, class methods, and static methods." +msgstr "" +"نام قدیمی برای گونه‌ای از کلاس‌ها که اکنون برای همه‌ی اشیای کلاس استفاده " +"می‌شود. در نسخه‌های قدیمی‌تر پایتون، فقط کلاس‌های سبک جدید می‌توانستند از " +"قابلیت‌های جدیدتر و انعطاف‌پذیر پایتون مانند :attr:`~object.__slots__`، " +"توصیف‌گرها، ویژگی‌ها، :meth:`~object.__getattribute__`، متدهای کلاس و متدهای" +" ایستا استفاده کنند." msgid "non-deterministic" msgstr "غیرقطعی" -msgid "Behavior where the outcome of a program can vary between executions with the same inputs. In multi-threaded programs, non-deterministic behavior often results from :term:`race conditions ` where the relative timing or interleaving of threads affects the result. Proper synchronization using :term:`locks ` and other :term:`synchronization primitives ` helps ensure deterministic behavior." -msgstr "رفتاری که در آن نتیجهٔ یک برنامه می‌تواند بین اجراهای مختلف با ورودی‌های یکسان متفاوت باشد. در برنامه‌های چندنخی، رفتار غیرقطعی اغلب از :term:`شرط رقابت ` ناشی می‌شود که در آن زمان‌بندی نسبی یا درهم‌تنیدگی نخ‌ها بر نتیجه تأثیر می‌گذارد. همگام‌سازی مناسب با استفاده از :term:`قفل ` و دیگر :term:`اولیه ` به تضمین رفتار قطعی کمک می‌کند." +msgid "" +"Behavior where the outcome of a program can vary between executions with the" +" same inputs. In multi-threaded programs, non-deterministic behavior often " +"results from :term:`race conditions ` where the relative " +"timing or interleaving of threads affects the result. Proper synchronization" +" using :term:`locks ` and other :term:`synchronization primitives " +"` helps ensure deterministic behavior." +msgstr "" +"رفتاری که در آن نتیجه‌ی یک برنامه می‌تواند بین اجراهای مختلف با ورودی‌های " +"یکسان متفاوت باشد. در برنامه‌های چندنخی، رفتار غیرقطعی اغلب از :term:`شرط " +"رقابت ` ناشی می‌شود که در آن زمان‌بندی نسبی یا درهم‌تنیدگی " +"نخ‌ها بر نتیجه تأثیر می‌گذارد. همگام‌سازی مناسب با استفاده از :term:`قفل " +"` و دیگر :term:`اولیه ` به تضمین رفتار قطعی" +" کمک می‌کند." msgid "object" msgstr "شیء" -msgid "Any data with state (attributes or value) and defined behavior (methods). Also the ultimate base class of any :term:`new-style class`." -msgstr "هر داده‌ای با وضعیت (ویژگی‌ها یا مقدار) و رفتار تعریف‌شده (متدها). همچنین کلاس پایهٔ نهایی هر :term:`کلاس سبک جدید `." +msgid "" +"Any data with state (attributes or value) and defined behavior (methods). " +"Also the ultimate base class of any :term:`new-style class`." +msgstr "" +"هر داده‌ای با وضعیت (ویژگی‌ها یا مقدار) و رفتار تعریف‌شده (متدها). همچنین " +"کلاس پایه‌ی نهایی هر :term:`کلاس سبک جدید `." msgid "optimized scope" -msgstr "محدودهٔ بهینه‌شده" +msgstr "محدوده‌ی بهینه‌شده" -msgid "A scope where target local variable names are reliably known to the compiler when the code is compiled, allowing optimization of read and write access to these names. The local namespaces for functions, generators, coroutines, comprehensions, and generator expressions are optimized in this fashion. Note: most interpreter optimizations are applied to all scopes, only those relying on a known set of local and nonlocal variable names are restricted to optimized scopes." -msgstr "محدوده‌ای که در آن نام‌های متغیرهای محلی هدف هنگام کامپایل کد به‌طور قابل اطمینانی برای کامپایلر شناخته شده‌اند و امکان بهینه‌سازی دسترسی خواندن و نوشتن به این نام‌ها فراهم می‌شود. نام‌فضاهای محلی برای تابع‌ها، تولیدگرها، هم‌روال‌ها، درک‌ها و عبارت‌های تولیدگر به این روش بهینه می‌شوند. توجه کنید: بیشتر بهینه‌سازی‌های مفسر روی همهٔ محدوده‌ها اعمال می‌شوند؛ تنها بهینه‌سازی‌هایی که به مجموعهٔ شناخته‌شده‌ای از نام‌های متغیرهای محلی و غیرمحلی وابسته هستند، به محدوده‌های بهینه‌شده محدود می‌شوند." +msgid "" +"A scope where target local variable names are reliably known to the compiler" +" when the code is compiled, allowing optimization of read and write access " +"to these names. The local namespaces for functions, generators, coroutines, " +"comprehensions, and generator expressions are optimized in this fashion. " +"Note: most interpreter optimizations are applied to all scopes, only those " +"relying on a known set of local and nonlocal variable names are restricted " +"to optimized scopes." +msgstr "" +"محدوده‌ای که در آن نام‌های متغیرهای محلی هدف هنگام کامپایل کد به‌طور قابل " +"اطمینانی برای کامپایلر شناخته شده‌اند و امکان بهینه‌سازی دسترسی خواندن و " +"نوشتن به این نام‌ها فراهم می‌شود. فضای نام های محلی برای تابع‌ها، تولیدگرها، " +"هم‌روال‌ها، درک‌ها و عبارت‌های تولیدگر به این روش بهینه می‌شوند. توجه کنید: " +"بیشتر بهینه‌سازی‌های مفسر روی همه‌ی محدوده‌ها اعمال می‌شوند؛ تنها " +"بهینه‌سازی‌هایی که به مجموعه‌ی شناخته‌شده‌ای از نام‌های متغیرهای محلی و " +"غیرمحلی وابسته هستند، به محدوده‌های بهینه‌شده محدود می‌شوند." msgid "optional module" msgstr "ماژول اختیاری" -msgid "An :term:`extension module` that is part of the :term:`standard library`, but may be absent in some builds of :term:`CPython`, usually due to missing third-party libraries or because the module is not available for a given platform." -msgstr "یک :term:`ماژول افزونه ` که بخشی از :term:`کتابخانهٔ استاندارد ` است، اما ممکن است در برخی ساخت‌های :term:`CPython ` وجود نداشته باشد؛ معمولاً به دلیل نبود کتابخانه‌های شخص ثالث یا در دسترس نبودن ماژول برای یک سکوی مشخص." +msgid "" +"An :term:`extension module` that is part of the :term:`standard library`, " +"but may be absent in some builds of :term:`CPython`, usually due to missing " +"third-party libraries or because the module is not available for a given " +"platform." +msgstr "" +"یک :term:`ماژول افزونه ` که بخشی از :term:`کتابخانه‌ی " +"استاندارد ` است، اما ممکن است در برخی ساخت‌های " +":term:`CPython ` وجود نداشته باشد؛ معمولاً به دلیل نبود " +"کتابخانه‌های شخص ثالث یا در دسترس نبودن ماژول برای یک سکوی مشخص." -msgid "See :ref:`optional-module-requirements` for a list of optional modules that require third-party libraries." -msgstr "برای فهرستی از ماژول‌های اختیاری که به کتابخانه‌های شخص ثالث نیاز دارند، :ref:`optional-module-requirements` را ببینید." +msgid "" +"See :ref:`optional-module-requirements` for a list of optional modules that " +"require third-party libraries." +msgstr "" +"برای فهرستی از ماژول‌های اختیاری که به کتابخانه‌های شخص ثالث نیاز دارند، " +":ref:`optional-module-requirements` را ببینید." msgid "package" msgstr "بسته" -msgid "A Python :term:`module` which can contain submodules or recursively, subpackages. Technically, a package is a Python module with a ``__path__`` attribute." -msgstr "یک :term:`ماژول ` پایتون که می‌تواند شامل زیرماژول‌ها یا به‌صورت بازگشتی، زیربسته‌ها باشد. از نظر فنی، یک بسته یک ماژول پایتون با ویژگی ``__path__`` است." +msgid "" +"A Python :term:`module` which can contain submodules or recursively, " +"subpackages. Technically, a package is a Python module with a ``__path__`` " +"attribute." +msgstr "" +"یک :term:`ماژول ` پایتون که می‌تواند شامل زیرماژول‌ها یا به‌صورت " +"بازگشتی، زیربسته‌ها باشد. از نظر فنی، یک بسته یک ماژول پایتون با ویژگی " +"``__path__`` است." msgid "See also :term:`regular package` and :term:`namespace package`." -msgstr "همچنین :term:`بستهٔ معمولی ` و :term:`بستهٔ نام‌فضا ` را ببینید." +msgstr "" +"همچنین :term:`بسته‌ی معمولی ` و :term:`بسته‌ی فضای نام " +"` را ببینید." msgid "parallelism" msgstr "موازی‌سازی" -msgid "Executing multiple operations at the same time (e.g. on multiple CPU cores). In Python builds with the :term:`global interpreter lock (GIL) `, only one thread runs Python bytecode at a time, so taking advantage of multiple CPU cores typically involves multiple processes (e.g. :mod:`multiprocessing`) or native extensions that release the GIL. In :term:`free-threaded ` Python, multiple Python threads can run Python code simultaneously on different cores." -msgstr "اجرای چندین عملیات در یک زمان (برای مثال روی چند هستهٔ CPU). در ساخت‌های پایتون با :term:`قفل مفسر سراسری `، تنها یک نخ در هر لحظه بایت‌کد پایتون را اجرا می‌کند، بنابراین بهره‌گیری از چند هستهٔ CPU معمولاً شامل چند فرایند (برای مثال :mod:`multiprocessing`) یا افزونه‌های بومی است که GIL را آزاد می‌کنند. در پایتون :term:`نخ‌گذاری آزاد `، چندین نخ پایتون می‌توانند به‌طور هم‌زمان کد پایتون را روی هسته‌های مختلف اجرا کنند." +msgid "" +"Executing multiple operations at the same time (e.g. on multiple CPU cores)." +" In Python builds with the :term:`global interpreter lock (GIL) `, only one thread runs Python bytecode at a time, so " +"taking advantage of multiple CPU cores typically involves multiple processes" +" (e.g. :mod:`multiprocessing`) or native extensions that release the GIL. In" +" :term:`free-threaded ` Python, multiple Python threads can " +"run Python code simultaneously on different cores." +msgstr "" +"اجرای چندین عملیات در یک زمان (برای مثال روی چند هسته‌ی CPU). در ساخت‌های " +"پایتون با :term:`قفل مفسر سراسری `، تنها یک نخ در " +"هر لحظه بایت‌کد پایتون را اجرا می‌کند، بنابراین بهره‌گیری از چند هسته‌ی CPU " +"معمولاً شامل چند فرایند (برای مثال :mod:`multiprocessing`) یا افزونه‌های " +"بومی است که GIL را آزاد می‌کنند. در پایتون :term:`نخ‌گذاری آزاد `، چندین نخ پایتون می‌توانند به‌طور همزمان کد پایتون را روی " +"هسته‌های مختلف اجرا کنند." msgid "parameter" msgstr "پارامتر" -msgid "A named entity in a :term:`function` (or method) definition that specifies an :term:`argument` (or in some cases, arguments) that the function can accept. There are five kinds of parameter:" -msgstr "یک موجودیت نام‌گذاری‌شده در تعریف یک :term:`تابع ` (یا متد) که یک :term:`آرگومان ` (یا در برخی موارد، آرگومان‌ها) را مشخص می‌کند که تابع می‌تواند بپذیرد. پنج نوع پارامتر وجود دارد:" +msgid "" +"A named entity in a :term:`function` (or method) definition that specifies " +"an :term:`argument` (or in some cases, arguments) that the function can " +"accept. There are five kinds of parameter:" +msgstr "" +"یک موجودیت نام‌گذاری‌شده در تعریف یک :term:`تابع ` (یا متد) که یک " +":term:`آرگومان ` (یا در برخی موارد، آرگومان‌ها) را مشخص می‌کند که " +"تابع می‌تواند بپذیرد. پنج نوع پارامتر وجود دارد:" -msgid ":dfn:`positional-or-keyword`: specifies an argument that can be passed either :term:`positionally ` or as a :term:`keyword argument `. This is the default kind of parameter, for example *foo* and *bar* in the following::" -msgstr ":dfn:`positional-or-keyword`: آرگومانی را مشخص می‌کند که می‌تواند به‌صورت :term:`آرگومان جایگاهی ` یا به‌عنوان یک :term:`آرگومان کلیدواژه‌ای ` ارسال شود. این نوع پیش‌فرض پارامتر است، برای مثال *foo* و *bar* در موارد زیر::" +msgid "" +":dfn:`positional-or-keyword`: specifies an argument that can be passed " +"either :term:`positionally ` or as a :term:`keyword argument " +"`. This is the default kind of parameter, for example *foo* and " +"*bar* in the following::" +msgstr "" +":dfn:`positional-or-keyword`: آرگومانی را مشخص می‌کند که می‌تواند به‌صورت " +":term:`آرگومان جایگاهی ` یا به‌عنوان یک :term:`آرگومان کلیدواژه‌ای" +" ` ارسال شود. این نوع پیش‌فرض پارامتر است، برای مثال *foo* و *bar*" +" در موارد زیر::" msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -msgid ":dfn:`positional-only`: specifies an argument that can be supplied only by position. Positional-only parameters can be defined by including a ``/`` character in the parameter list of the function definition after them, for example *posonly1* and *posonly2* in the following::" -msgstr ":dfn:`positional-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند بر اساس جایگاه ارائه شود. پارامترهای فقط-جایگاهی را می‌توان با قرار دادن یک نویسهٔ ``/`` در فهرست پارامترهای تعریف تابع پس از آن‌ها تعریف کرد، برای مثال *posonly1* و *posonly2* در موارد زیر::" +msgid "" +":dfn:`positional-only`: specifies an argument that can be supplied only by " +"position. Positional-only parameters can be defined by including a ``/`` " +"character in the parameter list of the function definition after them, for " +"example *posonly1* and *posonly2* in the following::" +msgstr "" +":dfn:`positional-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند بر اساس " +"جایگاه ارائه شود. پارامترهای فقط-جایگاهی را می‌توان با قرار دادن یک نویسه‌ی " +"``/`` در فهرست پارامترهای تعریف تابع پس از آن‌ها تعریف کرد، برای مثال " +"*posonly1* و *posonly2* در موارد زیر::" msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -msgid ":dfn:`keyword-only`: specifies an argument that can be supplied only by keyword. Keyword-only parameters can be defined by including a single var-positional parameter or bare ``*`` in the parameter list of the function definition before them, for example *kw_only1* and *kw_only2* in the following::" -msgstr ":dfn:`keyword-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند با کلیدواژه ارسال شود. پارامترهای فقط کلیدواژه‌ای را می‌توان با قرار دادن یک پارامتر var-positional یا ``*`` بدون نام در فهرست پارامترهای تعریف تابع پیش از آن‌ها تعریف کرد، برای مثال *kw_only1* و *kw_only2* در موارد زیر::" +msgid "" +":dfn:`keyword-only`: specifies an argument that can be supplied only by " +"keyword. Keyword-only parameters can be defined by including a single var-" +"positional parameter or bare ``*`` in the parameter list of the function " +"definition before them, for example *kw_only1* and *kw_only2* in the " +"following::" +msgstr "" +":dfn:`keyword-only`: آرگومانی را مشخص می‌کند که فقط می‌تواند با کلیدواژه " +"ارسال شود. پارامترهای فقط کلیدواژه‌ای را می‌توان با قرار دادن یک پارامتر " +"var-positional یا ``*`` بدون نام در فهرست پارامترهای تعریف تابع پیش از آن‌ها" +" تعریف کرد، برای مثال *kw_only1* و *kw_only2* در موارد زیر::" msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -msgid ":dfn:`var-positional`: specifies that an arbitrary sequence of positional arguments can be provided (in addition to any positional arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with ``*``, for example *args* in the following::" -msgstr ":dfn:`var-positional`: مشخص می‌کند که یک دنبالهٔ دلخواه از آرگومان‌های جایگاهی می‌تواند ارائه شود (علاوه بر هر آرگومان جایگاهی که پیش‌تر توسط پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``*`` به ابتدای نام پارامتر تعریف کرد، برای مثال *args* در موارد زیر::" +msgid "" +":dfn:`var-positional`: specifies that an arbitrary sequence of positional " +"arguments can be provided (in addition to any positional arguments already " +"accepted by other parameters). Such a parameter can be defined by " +"prepending the parameter name with ``*``, for example *args* in the " +"following::" +msgstr "" +":dfn:`var-positional`: مشخص می‌کند که یک دنباله‌ی دلخواه از آرگومان‌های " +"جایگاهی می‌تواند ارائه شود (علاوه بر هر آرگومان جایگاهی که پیش‌تر توسط " +"پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``*`` " +"به ابتدای نام پارامتر تعریف کرد، برای مثال *args* در موارد زیر::" msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -msgid ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be provided (in addition to any keyword arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with ``**``, for example *kwargs* in the example above." -msgstr ":dfn:`var-keyword`: مشخص می‌کند که تعداد دلخواهی از آرگومان‌های کلیدواژه‌ای می‌تواند ارائه شود (علاوه بر هر آرگومان کلیدواژه‌ای که پیش‌تر توسط پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``**`` به ابتدای نام پارامتر تعریف کرد، برای مثال *kwargs* در مثال بالا." +msgid "" +":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be" +" provided (in addition to any keyword arguments already accepted by other " +"parameters). Such a parameter can be defined by prepending the parameter " +"name with ``**``, for example *kwargs* in the example above." +msgstr "" +":dfn:`var-keyword`: مشخص می‌کند که تعداد دلخواهی از آرگومان‌های کلیدواژه‌ای " +"می‌تواند ارائه شود (علاوه بر هر آرگومان کلیدواژه‌ای که پیش‌تر توسط " +"پارامترهای دیگر پذیرفته شده است). چنین پارامتری را می‌توان با افزودن ``**`` " +"به ابتدای نام پارامتر تعریف کرد، برای مثال *kwargs* در مثال بالا." -msgid "Parameters can specify both optional and required arguments, as well as default values for some optional arguments." -msgstr "پارامترها می‌توانند هم آرگومان‌های اختیاری و ضروری، و هم مقدارهای پیش‌فرض برای برخی آرگومان‌های اختیاری را مشخص کنند." +msgid "" +"Parameters can specify both optional and required arguments, as well as " +"default values for some optional arguments." +msgstr "" +"پارامترها می‌توانند هم آرگومان‌های اختیاری و ضروری، و هم مقدارهای پیش‌فرض " +"برای برخی آرگومان‌های اختیاری را مشخص کنند." -msgid "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the difference between arguments and parameters `, the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:`362`." -msgstr "همچنین مدخل واژه‌نامهٔ :term:`آرگومان `، پرسش متداول دربارهٔ :ref:`تفاوت بین آرگومان‌ها و پارامترها `، کلاس :class:`inspect.Parameter`، بخش :ref:`function` و :pep:`362` را ببینید." +msgid "" +"See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " +"difference between arguments and parameters `, " +"the :class:`inspect.Parameter` class, the :ref:`function` section, and " +":pep:`362`." +msgstr "" +"همچنین مدخل واژه‌نامه‌ی :term:`آرگومان `، پرسش متداول درباره‌ی :ref:`تفاوت بین آرگومان‌ها و پارامترها `، کلاس :class:`inspect.Parameter`، بخش :ref:`تابع ` و :pep:`362` را ببینید." msgid "per-object lock" msgstr "قفلِ هر شیء" -msgid "A :term:`lock` associated with an individual object instance rather than a global lock shared across all objects. In :term:`free-threaded ` Python, built-in types like :class:`dict` and :class:`list` use per-object locks to allow concurrent operations on different objects while serializing operations on the same object. Operations that hold the per-object lock prevent other locking operations on the same object from proceeding, but do not block :term:`lock-free` operations." -msgstr "یک :term:`قفل ` مرتبط با یک نمونهٔ شیء منفرد، به‌جای یک قفل سراسری که بین همهٔ اشیا اشتراک‌گذاری شده باشد. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` از قفل‌های هر شیء استفاده می‌کنند تا امکان عملیات هم‌زمان روی اشیای مختلف را فراهم کنند، در حالی که عملیات روی همان شیء را به‌صورت ترتیبی اجرا می‌کنند. عملیات‌هایی که قفل هر شیء را نگه می‌دارند، از ادامهٔ دیگر عملیات‌های قفل‌کننده روی همان شیء جلوگیری می‌کنند، اما عملیات‌های :term:`بدون قفل ` را مسدود نمی‌کنند." +msgid "" +"A :term:`lock` associated with an individual object instance rather than a " +"global lock shared across all objects. In :term:`free-threaded ` Python, built-in types like :class:`dict` and :class:`list` use " +"per-object locks to allow concurrent operations on different objects while " +"serializing operations on the same object. Operations that hold the per-" +"object lock prevent other locking operations on the same object from " +"proceeding, but do not block :term:`lock-free` operations." +msgstr "" +"یک :term:`قفل ` مرتبط با یک نمونه‌ی شیء منفرد، به‌جای یک قفل سراسری که " +"بین همه‌ی اشیا اشتراک‌گذاری شده باشد. در پایتون :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict` و :class:`list` از قفل‌های هر" +" شیء استفاده می‌کنند تا امکان عملیات همزمان روی اشیای مختلف را فراهم کنند، " +"در حالی که عملیات روی همان شیء را به‌صورت ترتیبی اجرا می‌کنند. عملیات‌هایی " +"که قفل هر شیء را نگه می‌دارند، از ادامه‌ی دیگر عملیات‌های قفل‌کننده روی همان " +"شیء جلوگیری می‌کنند، اما عملیات‌های :term:`بدون قفل ` را مسدود " +"نمی‌کنند." msgid "path entry" msgstr "ورودی مسیر" -msgid "A single location on the :term:`import path` which the :term:`path based finder` consults to find modules for importing." -msgstr "یک مکان منفرد در :term:`ایمپورت مسیر ` که :term:`یابندهٔ مبتنی بر مسیر ` برای یافتن ماژول‌ها جهت ایمپورت بررسی می‌کند." +msgid "" +"A single location on the :term:`import path` which the :term:`path based " +"finder` consults to find modules for importing." +msgstr "" +"یک مکان منفرد در :term:`ایمپورت مسیر ` که :term:`یابنده‌ی مبتنی " +"بر مسیر ` برای یافتن ماژول‌ها جهت ایمپورت بررسی می‌کند." msgid "path entry finder" -msgstr "یابندهٔ ورودی مسیر" +msgstr "یابنده‌ی ورودی مسیر" -msgid "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :term:`path entry hook`) which knows how to locate modules given a :term:`path entry`." -msgstr "یک :term:`یابنده ` که توسط یک فراخوانی‌پذیر در :data:`sys.path_hooks` (یعنی یک :term:`قلاب ورودی مسیر `) بازگردانده می‌شود و می‌داند چگونه با داشتن یک :term:`ورودی مسیر `، ماژول‌ها را پیدا کند." +msgid "" +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a " +":term:`path entry hook`) which knows how to locate modules given a " +":term:`path entry`." +msgstr "" +"یک :term:`یابنده ` که توسط یک فراخوانی‌پذیر در " +":data:`sys.path_hooks` (یعنی یک :term:`قلاب ورودی مسیر `) " +"بازگردانده می‌شود و می‌داند چگونه با داشتن یک :term:`ورودی مسیر `، ماژول‌ها را پیدا کند." -msgid "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry finders implement." -msgstr "برای متدهایی که یابنده‌های ورودی مسیر پیاده‌سازی می‌کنند، :class:`importlib.abc.PathEntryFinder` را ببینید." +msgid "" +"See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " +"finders implement." +msgstr "" +"برای متدهایی که یابنده‌های ورودی مسیر پیاده‌سازی می‌کنند، " +":class:`importlib.abc.PathEntryFinder` را ببینید." msgid "path entry hook" msgstr "قلاب ورودی مسیر" -msgid "A callable on the :data:`sys.path_hooks` list which returns a :term:`path entry finder` if it knows how to find modules on a specific :term:`path entry`." -msgstr "یک فراخوانی‌پذیر در فهرست :data:`sys.path_hooks` که اگر بداند چگونه ماژول‌ها را در یک :term:`ورودی مسیر ` مشخص پیدا کند، یک :term:`یابندهٔ ورودی مسیر ` بازمی‌گرداند." +msgid "" +"A callable on the :data:`sys.path_hooks` list which returns a :term:`path " +"entry finder` if it knows how to find modules on a specific :term:`path " +"entry`." +msgstr "" +"یک فراخوانی‌پذیر در فهرست :data:`sys.path_hooks` که اگر بداند چگونه ماژول‌ها" +" را در یک :term:`ورودی مسیر ` مشخص پیدا کند، یک :term:`یابنده‌ی " +"ورودی مسیر ` بازمی‌گرداند." msgid "path based finder" -msgstr "یابندهٔ مبتنی بر مسیر" +msgstr "یابنده‌ی مبتنی بر مسیر" -msgid "One of the default :term:`meta path finders ` which searches an :term:`import path` for modules." -msgstr "یکی از :term:`یابندهٔ مسیر فراداده ` پیش‌فرض که یک :term:`ایمپورت مسیر ` را برای یافتن ماژول‌ها جست‌وجو می‌کند." +msgid "" +"One of the default :term:`meta path finders ` which " +"searches an :term:`import path` for modules." +msgstr "" +"یکی از :term:`یابنده‌ی مسیر فراداده ` پیش‌فرض که یک " +":term:`ایمپورت مسیر ` را برای یافتن ماژول‌ها جست‌وجو می‌کند." msgid "path-like object" msgstr "شیء شبه‌مسیر" -msgid "An object representing a file system path. A path-like object is either a :class:`str` or :class:`bytes` object representing a path, or an object implementing the :class:`os.PathLike` protocol. An object that supports the :class:`os.PathLike` protocol can be converted to a :class:`str` or :class:`bytes` file system path by calling the :func:`os.fspath` function; :func:`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:`str` or :class:`bytes` result instead, respectively. Introduced by :pep:`519`." -msgstr "شی‌ءای که یک مسیر سامانهٔ فایل را نمایش می‌دهد. یک شیء شبه‌مسیر یا یک شیء :class:`str` یا :class:`bytes` است که یک مسیر را نمایش می‌دهد، یا شی‌ءای است که پروتکل :class:`os.PathLike` را پیاده‌سازی می‌کند. شی‌ءای که از پروتکل :class:`os.PathLike` پشتیبانی می‌کند، می‌تواند با فراخوانی تابع :func:`os.fspath` به یک مسیر سامانهٔ فایل :class:`str` یا :class:`bytes` تبدیل شود؛ :func:`os.fsdecode` و :func:`os.fsencode` می‌توانند به‌ترتیب برای تضمین نتیجهٔ :class:`str` یا :class:`bytes` استفاده شوند. معرفی‌شده در :pep:`519`." +msgid "" +"An object representing a file system path. A path-like object is either a " +":class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the " +":class:`os.PathLike` protocol can be converted to a :class:`str` or " +":class:`bytes` file system path by calling the :func:`os.fspath` function; " +":func:`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a " +":class:`str` or :class:`bytes` result instead, respectively. Introduced by " +":pep:`519`." +msgstr "" +"شی‌ءای که یک مسیر سامانه‌ی فایل را نمایش می‌دهد. یک شیء شبه‌مسیر یا یک شیء " +":class:`str` یا :class:`bytes` است که یک مسیر را نمایش می‌دهد، یا شی‌ءای است" +" که پروتکل :class:`os.PathLike` را پیاده‌سازی می‌کند. شی‌ءای که از پروتکل " +":class:`os.PathLike` پشتیبانی می‌کند، می‌تواند با فراخوانی تابع " +":func:`os.fspath` به یک مسیر سامانه‌ی فایل :class:`str` یا :class:`bytes` " +"تبدیل شود؛ :func:`os.fsdecode` و :func:`os.fsencode` می‌توانند به‌ترتیب برای" +" تضمین نتیجه‌ی :class:`str` یا :class:`bytes` استفاده شوند. معرفی‌شده در " +":pep:`519`." msgid "PEP" msgstr "PEP" -msgid "Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. PEPs should provide a concise technical specification and a rationale for proposed features." -msgstr "پیشنهاد بهبود پایتون. یک PEP یک سند طراحی است که اطلاعاتی را برای کامیونیتی پایتون ارائه می‌کند، یا یک ویژگی جدید برای پایتون، فرایندهای آن یا محیط آن را توصیف می‌کند. PEPها باید یک مشخصات فنی مختصر و یک منطق برای ویژگی‌های پیشنهادی ارائه کنند." +msgid "" +"Python Enhancement Proposal. A PEP is a design document providing " +"information to the Python community, or describing a new feature for Python " +"or its processes or environment. PEPs should provide a concise technical " +"specification and a rationale for proposed features." +msgstr "" +"پیشنهاد بهبود پایتون. یک PEP یک سند طراحی است که اطلاعاتی را برای کامیونیتی " +"پایتون ارائه می‌کند، یا یک ویژگی جدید برای پایتون، فرایندهای آن یا محیط آن " +"را توصیف می‌کند. PEPها باید یک مشخصات فنی مختصر و یک منطق برای ویژگی‌های " +"پیشنهادی ارائه کنند." -msgid "PEPs are intended to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions." -msgstr "PEP ها برای این طراحی شده‌اند که سازوکارهای اصلی پیشنهاد ویژگی‌های بزرگ جدید، جمع‌آوری نظرهای کامیونیتی دربارهٔ یک موضوع و مستندسازی تصمیم‌های طراحی گرفته‌شده برای پایتون باشند. نویسندهٔ PEP مسئول ایجاد توافق در کامیونیتی و مستندسازی دیدگاه‌های مخالف است." +msgid "" +"PEPs are intended to be the primary mechanisms for proposing major new " +"features, for collecting community input on an issue, and for documenting " +"the design decisions that have gone into Python. The PEP author is " +"responsible for building consensus within the community and documenting " +"dissenting opinions." +msgstr "" +"PEP ها برای این طراحی شده‌اند که سازوکارهای اصلی پیشنهاد ویژگی‌های بزرگ " +"جدید، جمع‌آوری نظرهای کامیونیتی درباره‌ی یک موضوع و مستندسازی تصمیم‌های طراحی" +" گرفته‌شده برای پایتون باشند. نویسنده‌ی PEP مسئول ایجاد توافق در کامیونیتی و " +"مستندسازی دیدگاه‌های مخالف است." msgid "See :pep:`1`." msgstr ":pep:`1` را ببینید." @@ -1187,8 +2807,13 @@ msgstr ":pep:`1` را ببینید." msgid "portion" msgstr "بخش" -msgid "A set of files in a single directory (possibly stored in a zip file) that contribute to a namespace package, as defined in :pep:`420`." -msgstr "مجموعه‌ای از فایل‌ها در یک پوشهٔ واحد (که ممکن است در یک فایل zip ذخیره شده باشند) که در یک بستهٔ نام‌فضا، همان‌طور که در :pep:`420` تعریف شده است، مشارکت می‌کنند." +msgid "" +"A set of files in a single directory (possibly stored in a zip file) that " +"contribute to a namespace package, as defined in :pep:`420`." +msgstr "" +"مجموعه‌ای از فایل‌ها در یک پوشه‌ی واحد (که ممکن است در یک فایل zip ذخیره شده " +"باشند) که در یک بسته‌ی فضای نام، همان‌طور که در :pep:`420` تعریف شده است، " +"مشارکت می‌کنند." msgid "positional argument" msgstr "آرگومان جایگاهی" @@ -1196,17 +2821,43 @@ msgstr "آرگومان جایگاهی" msgid "provisional API" msgstr "API موقت" -msgid "A provisional API is one which has been deliberately excluded from the standard library's backwards compatibility guarantees. While major changes to such interfaces are not expected, as long as they are marked provisional, backwards incompatible changes (up to and including removal of the interface) may occur if deemed necessary by core developers. Such changes will not be made gratuitously -- they will occur only if serious fundamental flaws are uncovered that were missed prior to the inclusion of the API." -msgstr "یک API موقت، رابطی است که به‌طور عمدی از تضمین‌های سازگاری رو‌به‌عقب کتابخانهٔ استاندارد خارج شده است. با اینکه تغییرات بزرگ در چنین رابط‌هایی انتظار نمی‌رود، تا زمانی که موقت علامت‌گذاری شده باشند، اگر توسعه‌دهندگان اصلی آن را ضروری بدانند، تغییرات ناسازگار با نسخه‌های پیشین (تا حذف کامل رابط نیز) ممکن است رخ دهد. چنین تغییراتی بدون دلیل انجام نخواهند شد؛ آن‌ها تنها در صورتی رخ می‌دهند که نقص‌های بنیادی و جدی‌ای کشف شوند که پیش از اضافه شدن API از آن‌ها چشم‌پوشی شده بود." +msgid "" +"A provisional API is one which has been deliberately excluded from the " +"standard library's backwards compatibility guarantees. While major changes " +"to such interfaces are not expected, as long as they are marked provisional," +" backwards incompatible changes (up to and including removal of the " +"interface) may occur if deemed necessary by core developers. Such changes " +"will not be made gratuitously -- they will occur only if serious fundamental" +" flaws are uncovered that were missed prior to the inclusion of the API." +msgstr "" +"یک API موقت، رابطی است که به‌طور عمدی از تضمین‌های سازگاری روبه‌عقب " +"کتابخانه‌ی استاندارد خارج شده است. با اینکه تغییرات بزرگ در چنین رابط‌هایی " +"انتظار نمی‌رود، تا زمانی که موقت علامت‌گذاری شده باشند، اگر توسعه‌دهندگان " +"اصلی آن را ضروری بدانند، تغییرات ناسازگار با نسخه‌های پیشین (تا حذف کامل " +"رابط نیز) ممکن است رخ دهد. چنین تغییراتی بدون دلیل انجام نخواهند شد؛ آن‌ها " +"تنها در صورتی رخ می‌دهند که نقص‌های بنیادی و جدی‌ای کشف شوند که پیش از اضافه" +" شدن API از آن‌ها چشم‌پوشی شده بود." -msgid "Even for provisional APIs, backwards incompatible changes are seen as a \"solution of last resort\" - every attempt will still be made to find a backwards compatible resolution to any identified problems." -msgstr "حتی برای APIهای موقت، تغییرات ناسازگار با نسخه‌های پیشین به‌عنوان «راه‌حل آخر» در نظر گرفته می‌شوند؛ همچنان هر تلاشی برای یافتن راه‌حلی سازگار با نسخه‌های پیشین برای مشکلات شناسایی‌شده انجام خواهد شد." +msgid "" +"Even for provisional APIs, backwards incompatible changes are seen as a " +"\"solution of last resort\" - every attempt will still be made to find a " +"backwards compatible resolution to any identified problems." +msgstr "" +"حتی برای APIهای موقت، تغییرات ناسازگار با نسخه‌های پیشین به‌عنوان «راه‌حل " +"آخر» در نظر گرفته می‌شوند؛ همچنان هر تلاشی برای یافتن راه‌حلی سازگار با " +"نسخه‌های پیشین برای مشکلات شناسایی‌شده انجام خواهد شد." -msgid "This process allows the standard library to continue to evolve over time, without locking in problematic design errors for extended periods of time. See :pep:`411` for more details." -msgstr "این فرایند به کتابخانهٔ استاندارد اجازه می‌دهد در طول زمان به تکامل خود ادامه دهد، بدون اینکه خطاهای طراحی مشکل‌ساز را برای دوره‌های طولانی تثبیت کند. برای جزئیات بیشتر، :pep:`411` را ببینید." +msgid "" +"This process allows the standard library to continue to evolve over time, " +"without locking in problematic design errors for extended periods of time. " +"See :pep:`411` for more details." +msgstr "" +"این فرایند به کتابخانه‌ی استاندارد اجازه می‌دهد در طول زمان به تکامل خود " +"ادامه دهد، بدون اینکه خطاهای طراحی مشکل‌ساز را برای دوره‌های طولانی تثبیت " +"کند. برای جزئیات بیشتر، :pep:`411` را ببینید." msgid "provisional package" -msgstr "بستهٔ موقت" +msgstr "بسته‌ی موقت" msgid "See :term:`provisional API`." msgstr ":term:`API موقت ` را ببینید." @@ -1214,14 +2865,32 @@ msgstr ":term:`API موقت ` را ببینید." msgid "Python 3000" msgstr "پایتون ۳۰۰۰" -msgid "Nickname for the Python 3.x release line (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated \"Py3k\"." -msgstr "نام مستعار برای خط انتشار Python ۳.x (که مدت‌ها پیش، زمانی که انتشار نسخهٔ ۳ چیزی در آیندهٔ دور بود، ساخته شد.) این عبارت همچنین به‌صورت «Py3k» کوتاه می‌شود." +msgid "" +"Nickname for the Python 3.x release line (coined long ago when the release " +"of version 3 was something in the distant future.) This is also abbreviated" +" \"Py3k\"." +msgstr "" +"نام مستعار برای خط انتشار Python ۳.x (که مدت‌ها پیش، زمانی که انتشار نسخه‌ی ۳" +" چیزی در آینده‌ی دور بود، ساخته شد.) این عبارت همچنین به‌صورت «Py3k» کوتاه " +"می‌شود." msgid "Pythonic" msgstr "پایتونی" -msgid "An idea or piece of code which closely follows the most common idioms of the Python language, rather than implementing code using concepts common to other languages. For example, a common idiom in Python is to loop over all elements of an iterable using a :keyword:`for` statement. Many other languages don't have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead::" -msgstr "ایده یا بخشی از کد که به‌جای پیاده‌سازی با مفاهیم رایج در زبان‌های دیگر، به‌طور نزدیک از شیوه‌های رایج زبان پایتون پیروی می‌کند. برای مثال، یک شیوهٔ رایج در پایتون این است که با استفاده از دستور :keyword:`for` روی همهٔ المان‌های یک تکرارپذیر حلقه زده شود. بسیاری از زبان‌های دیگر چنین ساختاری ندارند، بنابراین افرادی که با پایتون آشنا نیستند گاهی به‌جای آن از یک شمارندهٔ عددی استفاده می‌کنند::" +msgid "" +"An idea or piece of code which closely follows the most common idioms of the" +" Python language, rather than implementing code using concepts common to " +"other languages. For example, a common idiom in Python is to loop over all " +"elements of an iterable using a :keyword:`for` statement. Many other " +"languages don't have this type of construct, so people unfamiliar with " +"Python sometimes use a numerical counter instead::" +msgstr "" +"ایده یا بخشی از کد که به‌جای پیاده‌سازی با مفاهیم رایج در زبان‌های دیگر، " +"به‌طور نزدیک از شیوه‌های رایج زبان پایتون پیروی می‌کند. برای مثال، یک شیوه‌ی " +"رایج در پایتون این است که با استفاده از دستور :keyword:`for` روی همه‌ی " +"المان‌های یک پیمایش‌پذیر حلقه زده شود. بسیاری از زبان‌های دیگر چنین ساختاری " +"ندارند، بنابراین افرادی که با پایتون آشنا نیستند گاهی به‌جای آن از یک " +"شمارنده‌ی عددی استفاده می‌کنند::" msgid "" "for i in range(len(food)):\n" @@ -1241,10 +2910,17 @@ msgstr "" " print(piece)" msgid "qualified name" -msgstr "نام واجد شرایط" +msgstr "نام کامل" -msgid "A dotted name showing the \"path\" from a module's global scope to a class, function or method defined in that module, as defined in :pep:`3155`. For top-level functions and classes, the qualified name is the same as the object's name::" -msgstr "نامی نقطه‌گذاری‌شده که «مسیر» از محدودهٔ سراسری یک ماژول تا یک کلاس، تابع یا متد تعریف‌شده در آن ماژول را نشان می‌دهد، همان‌طور که در :pep:`3155` تعریف شده است. برای تابع‌ها و کلاس‌های سطح بالا، نام واجد شرایط همان نام شیء است::" +msgid "" +"A dotted name showing the \"path\" from a module's global scope to a class, " +"function or method defined in that module, as defined in :pep:`3155`. For " +"top-level functions and classes, the qualified name is the same as the " +"object's name::" +msgstr "" +"نامی نقطه‌گذاری‌شده که «مسیر» از محدوده‌ی سراسری یک ماژول تا یک کلاس، تابع یا" +" متد تعریف‌شده در آن ماژول را نشان می‌دهد، همان‌طور که در :pep:`3155` تعریف " +"شده است. برای تابع‌ها و کلاس‌های سطح بالا، نام کامل همان نام شیء است::" msgid "" ">>> class C:\n" @@ -1271,8 +2947,14 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -msgid "When used to refer to modules, the *fully qualified name* means the entire dotted path to the module, including any parent packages, e.g. ``email.mime.text``::" -msgstr "هنگامی که برای اشاره به ماژول‌ها استفاده می‌شود، *نام کاملاً واجد شرایط* به معنای کل مسیر نقطه‌گذاری‌شده به ماژول است که شامل هر بستهٔ والد نیز می‌شود، برای مثال ``email.mime.text``::" +msgid "" +"When used to refer to modules, the *fully qualified name* means the entire " +"dotted path to the module, including any parent packages, e.g. " +"``email.mime.text``::" +msgstr "" +"هنگامی که برای اشاره به ماژول‌ها استفاده می‌شود، *نام کامل* به " +"معنای کل مسیر نقطه‌گذاری‌شده به ماژول است که شامل هر بسته‌ی والد نیز می‌شود، " +"برای مثال ``email.mime.text``::" msgid "" ">>> import email.mime.text\n" @@ -1286,38 +2968,105 @@ msgstr "" msgid "race condition" msgstr "شرط رقابت" -msgid "A condition of a program where the behavior depends on the relative timing or ordering of events, particularly in multi-threaded programs. Race conditions can lead to :term:`non-deterministic` behavior and bugs that are difficult to reproduce. A :term:`data race` is a specific type of race condition involving unsynchronized access to shared memory. The :term:`LBYL` coding style is particularly susceptible to race conditions in multi-threaded code. Using :term:`locks ` and other :term:`synchronization primitives ` helps prevent race conditions." -msgstr "شرایطی در یک برنامه که در آن رفتار به زمان‌بندی نسبی یا ترتیب رویدادها وابسته است، به‌ویژه در برنامه‌های چندنخی. شرایط رقابت می‌توانند به رفتار :term:`غیرقطعی ` و خطاهایی منجر شوند که بازتولید آن‌ها دشوار است. یک :term:`رقابت داده ` نوع خاصی از شرط رقابت است که شامل دسترسی بدون همگام‌سازی به حافظهٔ اشتراکی می‌شود. سبک کدنویسی :term:`LBYL ` در کد چندنخی به‌طور ویژه در برابر شرایط رقابت آسیب‌پذیر است. استفاده از :term:`قفل ` و دیگر :term:`اولیه ` به جلوگیری از شرایط رقابت کمک می‌کند." +msgid "" +"A condition of a program where the behavior depends on the relative timing " +"or ordering of events, particularly in multi-threaded programs. Race " +"conditions can lead to :term:`non-deterministic` behavior and bugs that are " +"difficult to reproduce. A :term:`data race` is a specific type of race " +"condition involving unsynchronized access to shared memory. The " +":term:`LBYL` coding style is particularly susceptible to race conditions in " +"multi-threaded code. Using :term:`locks ` and other " +":term:`synchronization primitives ` helps prevent" +" race conditions." +msgstr "" +"شرایطی در یک برنامه که در آن رفتار به زمان‌بندی نسبی یا ترتیب رویدادها " +"وابسته است، به‌ویژه در برنامه‌های چندنخی. شرایط رقابت می‌توانند به رفتار " +":term:`غیرقطعی ` و خطاهایی منجر شوند که بازتولید آن‌ها " +"دشوار است. یک :term:`رقابت داده ` نوع خاصی از شرط رقابت است که " +"شامل دسترسی بدون همگام‌سازی به حافظه‌ی اشتراکی می‌شود. سبک کدنویسی " +":term:`LBYL ` در کد چندنخی به‌طور ویژه در برابر شرایط رقابت آسیب‌پذیر " +"است. استفاده از :term:`قفل ` و دیگر :term:`اولیه ` به جلوگیری از شرایط رقابت کمک می‌کند." msgid "reference count" -msgstr "شمارندهٔ ارجاع" +msgstr "شمارنده‌ی ارجاع" -msgid "The number of references to an object. When the reference count of an object drops to zero, it is deallocated. Some objects are :term:`immortal` and have reference counts that are never modified, and therefore the objects are never deallocated. Reference counting is generally not visible to Python code, but it is a key element of the :term:`CPython` implementation. Programmers can call the :func:`sys.getrefcount` function to return the reference count for a particular object." -msgstr "تعداد ارجاع‌ها به یک شیء. هنگامی که تعداد ارجاع‌های یک شیء به صفر کاهش یابد، آن شیء از حافظه آزاد می‌شود. برخی اشیاء :term:`نامیرا ` هستند و تعداد ارجاع‌های آن‌ها هرگز تغییر نمی‌کند و بنابراین این اشیاء هرگز از حافظه آزاد نمی‌شوند. شمارش ارجاع‌ها عموماً برای کد پایتون قابل مشاهده نیست، اما یکی از عناصر کلیدی پیاده‌سازی :term:`CPython ` است. برنامه‌نویسان می‌توانند تابع :func:`sys.getrefcount` را فراخوانی کنند تا تعداد ارجاع‌های یک شیء خاص را برگرداند." +msgid "" +"The number of references to an object. When the reference count of an " +"object drops to zero, it is deallocated. Some objects are :term:`immortal` " +"and have reference counts that are never modified, and therefore the objects" +" are never deallocated. Reference counting is generally not visible to " +"Python code, but it is a key element of the :term:`CPython` implementation." +" Programmers can call the :func:`sys.getrefcount` function to return the " +"reference count for a particular object." +msgstr "" +"تعداد ارجاع‌ها به یک شیء. هنگامی که تعداد ارجاع‌های یک شیء به صفر کاهش یابد،" +" آن شیء از حافظه آزاد می‌شود. برخی اشیاء :term:`نامیرا ` هستند و " +"تعداد ارجاع‌های آن‌ها هرگز تغییر نمی‌کند و بنابراین این اشیاء هرگز از حافظه " +"آزاد نمی‌شوند. شمارش ارجاع‌ها عموماً برای کد پایتون قابل مشاهده نیست، اما " +"یکی از عناصر کلیدی پیاده‌سازی :term:`CPython ` است. برنامه‌نویسان " +"می‌توانند تابع :func:`sys.getrefcount` را فراخوانی کنند تا تعداد ارجاع‌های " +"یک شیء خاص را برگرداند." -msgid "In :term:`CPython`, reference counts are not considered to be stable or well-defined values; the number of references to an object, and how that number is affected by Python code, may be different between versions." -msgstr "در :term:`CPython `، تعداد ارجاع‌ها مقادیر پایدار یا به‌خوبی تعریف‌شده‌ای در نظر گرفته نمی‌شوند؛ تعداد ارجاع‌ها به یک شیء و نحوه تأثیرپذیری این تعداد از کد پایتون ممکن است بین نسخه‌ها متفاوت باشد." +msgid "" +"In :term:`CPython`, reference counts are not considered to be stable or " +"well-defined values; the number of references to an object, and how that " +"number is affected by Python code, may be different between versions." +msgstr "" +"در :term:`CPython `، تعداد ارجاع‌ها مقادیر پایدار یا به‌خوبی " +"تعریف‌شده‌ای در نظر گرفته نمی‌شوند؛ تعداد ارجاع‌ها به یک شیء و نحوه " +"تأثیرپذیری این تعداد از کد پایتون ممکن است بین نسخه‌ها متفاوت باشد." msgid "regular package" -msgstr "بستهٔ معمولی" +msgstr "بسته‌ی معمولی" -msgid "A traditional :term:`package`, such as a directory containing an ``__init__.py`` file." -msgstr "یک :term:`بسته ` سنتی، مانند پوشه‌ای که شامل یک فایل ``__init__.py`` است." +msgid "" +"A traditional :term:`package`, such as a directory containing an " +"``__init__.py`` file." +msgstr "" +"یک :term:`بسته ` سنتی، مانند پوشه‌ای که شامل یک فایل " +"``__init__.py`` است." msgid "See also :term:`namespace package`." -msgstr "همچنین :term:`بستهٔ نام‌فضا ` را ببینید." +msgstr "همچنین :term:`بسته‌ی فضای نام ` را ببینید." msgid "reentrant" msgstr "بازورودپذیر" -msgid "A property of a function or :term:`lock` that allows it to be called or acquired multiple times by the same thread without causing errors or a :term:`deadlock`." -msgstr "ویژگی یک تابع یا :term:`قفل ` که به آن اجازه می‌دهد بدون ایجاد خطا یا یک :term:`بن‌بست `، چندین بار توسط یک نخ اجرایی یکسان فراخوانی یا دریافت شود." +msgid "" +"A property of a function or :term:`lock` that allows it to be called or " +"acquired multiple times by the same thread without causing errors or a " +":term:`deadlock`." +msgstr "" +"ویژگی یک تابع یا :term:`قفل ` که به آن اجازه می‌دهد بدون ایجاد خطا یا " +"یک :term:`بن‌بست `، چندین بار توسط یک نخ اجرایی یکسان فراخوانی یا " +"دریافت شود." -msgid "For functions, reentrancy means the function can be safely called again before a previous invocation has completed, which is important when functions may be called recursively or from signal handlers. Thread-unsafe functions may be :term:`non-deterministic` if they're called reentrantly in a multithreaded program." -msgstr "در مورد توابع، بازورودپذیری به این معناست که می‌توان تابع را پیش از کامل‌شدن یک فراخوانی قبلی، دوباره با ایمنی فراخوانی کرد؛ این موضوع زمانی اهمیت دارد که توابع ممکن است به‌صورت بازگشتی یا از درون دستگردان‌های سیگنال فراخوانی شوند. توابع ناایمن برای نخ‌های اجرایی ممکن است در صورتی که در یک برنامهٔ چندنخی به‌صورت بازورودپذیر فراخوانی شوند، :term:`غیرقطعی ` باشند." +msgid "" +"For functions, reentrancy means the function can be safely called again " +"before a previous invocation has completed, which is important when " +"functions may be called recursively or from signal handlers. Thread-unsafe " +"functions may be :term:`non-deterministic` if they're called reentrantly in " +"a multithreaded program." +msgstr "" +"در مورد توابع، بازورودپذیری به این معناست که می‌توان تابع را پیش از کامل‌شدن" +" یک فراخوانی قبلی، دوباره با ایمنی فراخوانی کرد؛ این موضوع زمانی اهمیت دارد " +"که توابع ممکن است به‌صورت بازگشتی یا از درون دستگردان‌های سیگنال فراخوانی " +"شوند. توابع ناایمن برای نخ‌های اجرایی ممکن است در صورتی که در یک برنامه‌ی " +"چندنخی به‌صورت بازورودپذیر فراخوانی شوند، :term:`غیرقطعی ` باشند." -msgid "For locks, Python's :class:`threading.RLock` (reentrant lock) is reentrant, meaning a thread that already holds the lock can acquire it again without blocking. In contrast, :class:`threading.Lock` is not reentrant - attempting to acquire it twice from the same thread will cause a deadlock." -msgstr "در مورد قفل‌ها، :class:`threading.RLock` پایتون (قفل بازورودپذیر) بازورودپذیر است؛ یعنی نخ اجرایی‌ای که از پیش قفل را در اختیار دارد، می‌تواند دوباره آن را دریافت کند، بدون آنکه مسدود شود. در مقابل، :class:`threading.Lock` بازورودپذیر نیست؛ تلاش برای دریافت آن دو بار از همان نخ اجرایی باعث یک بن‌بست می‌شود." +msgid "" +"For locks, Python's :class:`threading.RLock` (reentrant lock) is reentrant, " +"meaning a thread that already holds the lock can acquire it again without " +"blocking. In contrast, :class:`threading.Lock` is not reentrant - " +"attempting to acquire it twice from the same thread will cause a deadlock." +msgstr "" +"در مورد قفل‌ها، :class:`threading.RLock` پایتون (قفل بازورودپذیر) " +"بازورودپذیر است؛ یعنی نخ اجرایی‌ای که از پیش قفل را در اختیار دارد، می‌تواند" +" دوباره آن را دریافت کند، بدون آنکه مسدود شود. در مقابل، " +":class:`threading.Lock` بازورودپذیر نیست؛ تلاش برای دریافت آن دو بار از همان" +" نخ اجرایی باعث یک بن‌بست می‌شود." msgid "See also :term:`lock` and :term:`deadlock`." msgstr "همچنین :term:`قفل ` و :term:`بن‌بست ` را ببینید." @@ -1325,92 +3074,213 @@ msgstr "همچنین :term:`قفل ` و :term:`بن‌بست ` msgid "REPL" msgstr "REPL" -msgid "An acronym for the \"read–eval–print loop\", another name for the :term:`interactive` interpreter shell." -msgstr "سرواژهٔ «read–eval–print loop» و نام دیگری برای پوستهٔ مفسر :term:`تعاملی ` است." +msgid "" +"An acronym for the \"read–eval–print loop\", another name for the " +":term:`interactive` interpreter shell." +msgstr "" +"سرواژه‌ی «read–eval–print loop» و نام دیگری برای پوسته‌ی مفسر :term:`تعاملی " +"` است." msgid "__slots__" msgstr "__slots__" -msgid "A declaration inside a class that saves memory by pre-declaring space for instance attributes and eliminating instance dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application." -msgstr "یک اعلان درون یک کلاس که با پیش‌اعلام فضای موردنیاز برای ویژگی‌های نمونه و حذف دیکشنری‌های نمونه، در حافظه صرفه‌جویی می‌کند. با وجود محبوبیت این روش، پیاده‌سازی درست آن تا حدی دشوار است و بهتر است آن را به موارد نادری محدود کنید که تعداد نمونه‌ها زیاد است و برنامه از نظر حافظه حساس است." +msgid "" +"A declaration inside a class that saves memory by pre-declaring space for " +"instance attributes and eliminating instance dictionaries. Though popular, " +"the technique is somewhat tricky to get right and is best reserved for rare " +"cases where there are large numbers of instances in a memory-critical " +"application." +msgstr "" +"یک اعلان درون یک کلاس که با پیش‌اعلام فضای موردنیاز برای ویژگی‌های نمونه و " +"حذف دیکشنری‌های نمونه، در حافظه صرفه‌جویی می‌کند. با وجود محبوبیت این روش، " +"پیاده‌سازی درست آن تا حدی دشوار است و بهتر است آن را به موارد نادری محدود " +"کنید که تعداد نمونه‌ها زیاد است و برنامه از نظر حافظه حساس است." msgid "sequence" msgstr "دنباله" -msgid "An :term:`iterable` which supports efficient element access using integer indices via the :meth:`~object.__getitem__` special method and defines a :meth:`~object.__len__` method that returns the length of the sequence. Some built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object.__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a sequence because the lookups use arbitrary :term:`hashable` keys rather than integers." -msgstr "یک :term:`تکرارپذیر ` که از دسترسی کارآمد به المان‌ها با استفاده از اندیس‌های عدد صحیح از طریق متد ویژهٔ :meth:`~object.__getitem__` پشتیبانی می‌کند و متد :meth:`~object.__len__` را تعریف می‌کند که طول دنباله را برمی‌گرداند. برخی از انواع دنبالهٔ توکار عبارت‌اند از :class:`list`، :class:`str`، :class:`tuple` و :class:`bytes`. توجه کنید که :class:`dict` نیز از :meth:`~object.__getitem__` و :meth:`!__len__` پشتیبانی می‌کند، اما به‌جای دنباله، نگاشت در نظر گرفته می‌شود، زیرا جست‌وجوها از کلیدهای :term:`قابل درهم‌سازی ` دلخواه به‌جای اعداد صحیح استفاده می‌کنند." +msgid "" +"An :term:`iterable` which supports efficient element access using integer " +"indices via the :meth:`~object.__getitem__` special method and defines a " +":meth:`~object.__len__` method that returns the length of the sequence. Some" +" built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports " +":meth:`~object.__getitem__` and :meth:`!__len__`, but is considered a " +"mapping rather than a sequence because the lookups use arbitrary " +":term:`hashable` keys rather than integers." +msgstr "" +"یک :term:`پیمایش‌پذیر ` که از دسترسی کارآمد به المان‌ها با استفاده " +"از اندیس‌های عدد صحیح از طریق متد ویژه‌ی :meth:`~object.__getitem__` پشتیبانی" +" می‌کند و متد :meth:`~object.__len__` را تعریف می‌کند که طول دنباله را " +"برمی‌گرداند. برخی از انواع دنباله‌ی توکار عبارت‌اند از :class:`list`، " +":class:`str`، :class:`tuple` و :class:`bytes`. توجه کنید که :class:`dict` " +"نیز از :meth:`~object.__getitem__` و :meth:`!__len__` پشتیبانی می‌کند، اما " +"به‌جای دنباله، نگاشت در نظر گرفته می‌شود، زیرا جست‌وجوها از کلیدهای " +":term:`قابل درهم‌سازی ` دلخواه به‌جای اعداد صحیح استفاده می‌کنند." -msgid "The :class:`collections.abc.Sequence` abstract base class defines a much richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:`~object.__len__`, adding :meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~object.__contains__`, and :meth:`~object.__reversed__`. Types that implement this expanded interface can be registered explicitly using :func:`~abc.ABCMeta.register`. For more documentation on sequence methods generally, see :ref:`Common Sequence Operations `." -msgstr "کلاس پایهٔ انتزاعی :class:`collections.abc.Sequence` رابط بسیار غنی‌تری را تعریف می‌کند که فراتر از صرفاً :meth:`~object.__getitem__` و :meth:`~object.__len__` است و :meth:`~sequence.count`، :meth:`~sequence.index`، :meth:`~object.__contains__` و :meth:`~object.__reversed__` را نیز اضافه می‌کند. نوع‌هایی که این رابط گسترش‌یافته را پیاده‌سازی می‌کنند، می‌توانند به‌طور صریح با استفاده از :func:`~abc.ABCMeta.register` ثبت شوند. برای مستندات بیشتر دربارهٔ متدهای دنباله به‌طور کلی، :ref:`Common Sequence Operations ` را ببینید." +msgid "" +"The :class:`collections.abc.Sequence` abstract base class defines a much " +"richer interface that goes beyond just :meth:`~object.__getitem__` and " +":meth:`~object.__len__`, adding :meth:`~sequence.count`, " +":meth:`~sequence.index`, :meth:`~object.__contains__`, and " +":meth:`~object.__reversed__`. Types that implement this expanded interface " +"can be registered explicitly using :func:`~abc.ABCMeta.register`. For more " +"documentation on sequence methods generally, see :ref:`Common Sequence " +"Operations `." +msgstr "" +"کلاس پایه‌ی انتزاعی :class:`collections.abc.Sequence` رابط بسیار غنی‌تری را " +"تعریف می‌کند که فراتر از صرفاً :meth:`~object.__getitem__` و " +":meth:`~object.__len__` است و :meth:`~sequence.count`، " +":meth:`~sequence.index`، :meth:`~object.__contains__` و " +":meth:`~object.__reversed__` را نیز اضافه می‌کند. نوع‌هایی که این رابط " +"گسترش‌یافته را پیاده‌سازی می‌کنند، می‌توانند به‌طور صریح با استفاده از " +":func:`~abc.ABCMeta.register` ثبت شوند. برای مستندات بیشتر درباره‌ی متدهای " +"دنباله به‌طور کلی، :ref:`Common Sequence Operations ` را " +"ببینید." msgid "set comprehension" msgstr "درک مجموعه‌ای" -msgid "A compact way to process all or part of the elements in an iterable and return a set with the results. ``results = {c for c in 'abracadabra' if c not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:`comprehensions`." -msgstr "روشی فشرده برای پردازش همه یا بخشی از المان‌های یک تکرارپذیر و بازگرداندن یک مجموعه با نتایج. ``results = {c for c in 'abracadabra' if c not in 'abc'}`` مجموعه‌ای از رشته‌ها به‌شکل ``{'r', 'd'}`` تولید می‌کند. :ref:`comprehensions` را ببینید." +msgid "" +"A compact way to process all or part of the elements in an iterable and " +"return a set with the results. ``results = {c for c in 'abracadabra' if c " +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See " +":ref:`comprehensions`." +msgstr "" +"روشی فشرده برای پردازش همه یا بخشی از المان‌های یک پیمایش‌پذیر و بازگرداندن یک" +" مجموعه با نتایج. ``results = {c for c in 'abracadabra' if c not in 'abc'}``" +" مجموعه‌ای از رشته‌ها به‌شکل ``{'r', 'd'}`` تولید می‌کند. " +":ref:`comprehensions` را ببینید." msgid "single dispatch" msgstr "توزیع تک‌گانه" -msgid "A form of :term:`generic function` dispatch where the implementation is chosen based on the type of a single argument." -msgstr "نوعی توزیع :term:`تابع عمومی ` که در آن پیاده‌سازی بر اساس نوع یک آرگومان واحد انتخاب می‌شود." +msgid "" +"A form of :term:`generic function` dispatch where the implementation is " +"chosen based on the type of a single argument." +msgstr "" +"نوعی توزیع :term:`تابع عام ` که در آن پیاده‌سازی بر اساس" +" نوع یک آرگومان واحد انتخاب می‌شود." msgid "slice" msgstr "برش" -msgid "An object of type :class:`slice`, used to describe a portion of a :term:`sequence`. A slice object is created when using the :ref:`slicing ` form of :ref:`subscript notation `, with colons inside square brackets, such as in ``variable_name[1:3:5]``." -msgstr "یک شیء از نوع :class:`slice` که برای توصیف بخشی از یک :term:`دنباله ` استفاده می‌شود. یک شیء برش هنگام استفاده از شکل :ref:`slicing ` در :ref:`subscript notation `، با دو نقطه درون کروشه‌ها، مانند ``variable_name[1:3:5]``، ایجاد می‌شود." +msgid "" +"An object of type :class:`slice`, used to describe a portion of a " +":term:`sequence`. A slice object is created when using the :ref:`slicing " +"` form of :ref:`subscript notation `, with colons " +"inside square brackets, such as in ``variable_name[1:3:5]``." +msgstr "" +"یک شیء از نوع :class:`slice` که برای توصیف بخشی از یک :term:`دنباله " +"` استفاده می‌شود. یک شیء برش هنگام استفاده از شکل :ref:`slicing " +"` در :ref:`نمادگذاری زیرنویسی `، با دو نقطه درون " +"کروشه‌ها، مانند ``variable_name[1:3:5]``، ایجاد می‌شود." msgid "soft deprecated" msgstr "منسوخ‌سازی نرم" -msgid "A soft deprecated API should not be used in new code, but it is safe for already existing code to use it. The API remains documented and tested, but will not be enhanced further." -msgstr "از یک API که به‌صورت منسوخ‌سازی نرم علامت‌گذاری شده است نباید در کد جدید استفاده شود، اما استفاده از آن در کدهای موجود ایمن است. این API همچنان مستندسازی و آزمایش می‌شود، اما دیگر بهبود داده نخواهد شد." +msgid "" +"A soft deprecated API should not be used in new code, but it is safe for " +"already existing code to use it. The API remains documented and tested, but " +"will not be enhanced further." +msgstr "" +"از یک API که به‌صورت منسوخ‌سازی نرم علامت‌گذاری شده است نباید در کد جدید " +"استفاده شود، اما استفاده از آن در کدهای موجود ایمن است. این API همچنان " +"مستندسازی و آزمایش می‌شود، اما دیگر بهبود داده نخواهد شد." -msgid "Soft deprecation, unlike normal deprecation, does not plan on removing the API and will not emit warnings." -msgstr "منسوخ‌سازی نرم، برخلاف منسوخ‌سازی معمولی، قصد حذف API را ندارد و هیچ هشداری نیز ایجاد نمی‌کند." +msgid "" +"Soft deprecation, unlike normal deprecation, does not plan on removing the " +"API and will not emit warnings." +msgstr "" +"منسوخ‌سازی نرم، برخلاف منسوخ‌سازی معمولی، قصد حذف API را ندارد و هیچ هشداری " +"نیز ایجاد نمی‌کند." -msgid "See `PEP 387: Soft Deprecation `_." -msgstr "`PEP 387: Soft Deprecation `_ را نیز ببینید." +msgid "" +"See `PEP 387: Soft Deprecation `_." +msgstr "" +"`PEP 387: Soft Deprecation `_ را نیز ببینید." msgid "special method" msgstr "متد ویژه" -msgid "A method that is called implicitly by Python to execute a certain operation on a type, such as addition. Such methods have names starting and ending with double underscores. Special methods are documented in :ref:`specialnames`." -msgstr "متدی که به‌طور ضمنی توسط پایتون فراخوانی می‌شود تا عملیاتی خاص را روی یک نوع، مانند جمع، اجرا کند. نام این متدها با دو زیرخط آغاز و با دو زیرخط پایان می‌یابد. متدهای ویژه در :ref:`specialnames` مستند شده‌اند." +msgid "" +"A method that is called implicitly by Python to execute a certain operation " +"on a type, such as addition. Such methods have names starting and ending " +"with double underscores. Special methods are documented in " +":ref:`specialnames`." +msgstr "" +"متدی که به‌طور ضمنی توسط پایتون فراخوانی می‌شود تا عملیاتی خاص را روی یک " +"نوع، مانند جمع، اجرا کند. نام این متدها با دو زیرخط آغاز و با دو زیرخط پایان" +" می‌یابد. متدهای ویژه در :ref:`specialnames` مستند شده‌اند." msgid "standard library" -msgstr "کتابخانهٔ استاندارد" +msgstr "کتابخانه‌ی استاندارد" -msgid "The collection of :term:`packages `, :term:`modules ` and :term:`extension modules ` distributed as a part of the official Python interpreter package. The exact membership of the collection may vary based on platform, available system libraries, or other criteria. Documentation can be found at :ref:`library-index`." -msgstr "مجموعه‌ای از :term:`بسته `، :term:`ماژول ` و :term:`ماژول افزونه ` که به‌عنوان بخشی از بستهٔ رسمی مفسر پایتون توزیع می‌شوند. اعضای دقیق این مجموعه ممکن است بر اساس سکو، کتابخانه‌های سیستمی موجود یا معیارهای دیگر متفاوت باشند. مستندات آن را می‌توانید در :ref:`library-index` پیدا کنید." +msgid "" +"The collection of :term:`packages `, :term:`modules ` and " +":term:`extension modules ` distributed as a part of the " +"official Python interpreter package. The exact membership of the collection" +" may vary based on platform, available system libraries, or other criteria." +" Documentation can be found at :ref:`library-index`." +msgstr "" +"مجموعه‌ای از :term:`بسته `، :term:`ماژول ` و :term:`ماژول " +"افزونه ` که به‌عنوان بخشی از بسته‌ی رسمی مفسر پایتون توزیع " +"می‌شوند. اعضای دقیق این مجموعه ممکن است بر اساس سکو، کتابخانه‌های سیستمی " +"موجود یا معیارهای دیگر متفاوت باشند. مستندات آن را می‌توانید در " +":ref:`library-index` پیدا کنید." -msgid "See also :data:`sys.stdlib_module_names` for a list of all possible standard library module names." -msgstr "همچنین :data:`sys.stdlib_module_names` را برای فهرستی از همهٔ نام‌های ممکن ماژول‌های کتابخانهٔ استاندارد ببینید." +msgid "" +"See also :data:`sys.stdlib_module_names` for a list of all possible standard" +" library module names." +msgstr "" +"همچنین :data:`sys.stdlib_module_names` را برای فهرستی از همه‌ی نام‌های ممکن " +"ماژول‌های کتابخانه‌ی استاندارد ببینید." msgid "statement" msgstr "دستور" -msgid "A statement is part of a suite (a \"block\" of code). A statement is either an :term:`expression` or one of several constructs with a keyword, such as :keyword:`if`, :keyword:`while` or :keyword:`for`." -msgstr "دستور بخشی از یک مجموعه (یک «بلوک» کد) است. یک دستور یا یک :term:`عبارت ` است یا یکی از چند ساختار دارای کلیدواژه، مانند :keyword:`if`، :keyword:`while` یا :keyword:`for`." +msgid "" +"A statement is part of a suite (a \"block\" of code). A statement is either" +" an :term:`expression` or one of several constructs with a keyword, such as " +":keyword:`if`, :keyword:`while` or :keyword:`for`." +msgstr "" +"دستور بخشی از یک مجموعه (یک «بلوک» کد) است. یک دستور یا یک :term:`عبارت " +"` است یا یکی از چند ساختار دارای کلیدواژه، مانند :keyword:`if`، " +":keyword:`while` یا :keyword:`for`." msgid "static type checker" -msgstr "بررسی‌کنندهٔ نوع ایستا" +msgstr "بررسی‌کننده‌ی نوع ایستا" -msgid "An external tool that reads Python code and analyzes it, looking for issues such as incorrect types. See also :term:`type hints ` and the :mod:`typing` module." -msgstr "یک ابزار خارجی که کد پایتون را می‌خواند و آن را تحلیل می‌کند و به‌دنبال مشکلاتی مانند نوع‌های نادرست می‌گردد. همچنین :term:`راهنمای نوع ` و ماژول :mod:`typing` را ببینید." +msgid "" +"An external tool that reads Python code and analyzes it, looking for issues " +"such as incorrect types. See also :term:`type hints ` and the " +":mod:`typing` module." +msgstr "" +"یک ابزار خارجی که کد پایتون را می‌خواند و آن را تحلیل می‌کند و به‌دنبال " +"مشکلاتی مانند نوع‌های نادرست می‌گردد. همچنین :term:`راهنمای نوع `" +" و ماژول :mod:`typing` را ببینید." msgid "stdlib" msgstr "stdlib" msgid "An abbreviation of :term:`standard library`." -msgstr "شکل کوتاه‌شدهٔ :term:`کتابخانهٔ استاندارد `." +msgstr "شکل کوتاه‌شده‌ی :term:`کتابخانه‌ی استاندارد `." msgid "steal" msgstr "دزدیدن" -msgid "In Python's C API, \"*stealing*\" an argument means that ownership of the argument is transferred to the called function. The caller must not use that reference after the call. Generally, functions that \"steal\" an argument do so even if they fail." -msgstr "در C API پایتون، «دزدیدن» یک آرگومان به این معناست که مالکیت آرگومان به تابع فراخوانی‌شده منتقل می‌شود. فراخواننده نباید پس از فراخوانی از آن ارجاع استفاده کند. به‌طور کلی، توابعی که یک آرگومان را «می‌دزدند»، این کار را حتی در صورت شکست نیز انجام می‌دهند." +msgid "" +"In Python's C API, \"*stealing*\" an argument means that ownership of the " +"argument is transferred to the called function. The caller must not use that" +" reference after the call. Generally, functions that \"steal\" an argument " +"do so even if they fail." +msgstr "" +"در C API پایتون، «دزدیدن» یک آرگومان به این معناست که مالکیت آرگومان به تابع" +" فراخوانی‌شده منتقل می‌شود. فراخواننده نباید پس از فراخوانی از آن ارجاع " +"استفاده کند. به‌طور کلی، توابعی که یک آرگومان را «می‌دزدند»، این کار را حتی " +"در صورت شکست نیز انجام می‌دهند." msgid "See :ref:`api-refcountdetails` for a full explanation." msgstr "برای توضیح کامل، بخش :ref:`api-refcountdetails` را ببینید." @@ -1418,11 +3288,26 @@ msgstr "برای توضیح کامل، بخش :ref:`api-refcountdetails` را ب msgid "strong reference" msgstr "ارجاع قوی" -msgid "In Python's C API, a strong reference is a reference to an object which is owned by the code holding the reference. The strong reference is taken by calling :c:func:`Py_INCREF` when the reference is created and released with :c:func:`Py_DECREF` when the reference is deleted." -msgstr "در API زبان C پایتون، ارجاع قوی ارجاعی به یک شیء است که کدی که ارجاع را در اختیار دارد، مالک آن است. ارجاع قوی هنگام ایجاد ارجاع با فراخوانی :c:func:`Py_INCREF` گرفته می‌شود و هنگام حذف ارجاع با :c:func:`Py_DECREF` آزاد می‌شود." +msgid "" +"In Python's C API, a strong reference is a reference to an object which is " +"owned by the code holding the reference. The strong reference is taken by " +"calling :c:func:`Py_INCREF` when the reference is created and released with " +":c:func:`Py_DECREF` when the reference is deleted." +msgstr "" +"در API زبان C پایتون، ارجاع قوی ارجاعی به یک شیء است که کدی که ارجاع را در " +"اختیار دارد، مالک آن است. ارجاع قوی هنگام ایجاد ارجاع با فراخوانی " +":c:func:`Py_INCREF` گرفته می‌شود و هنگام حذف ارجاع با :c:func:`Py_DECREF` " +"آزاد می‌شود." -msgid "The :c:func:`Py_NewRef` function can be used to create a strong reference to an object. Usually, the :c:func:`Py_DECREF` function must be called on the strong reference before exiting the scope of the strong reference, to avoid leaking one reference." -msgstr "از تابع :c:func:`Py_NewRef` می‌توان برای ایجاد یک ارجاع قوی به یک شیء استفاده کرد. معمولاً باید تابع :c:func:`Py_DECREF` پیش از خروج از محدودهٔ ارجاع قوی، روی آن فراخوانی شود تا از نشت یک ارجاع جلوگیری شود." +msgid "" +"The :c:func:`Py_NewRef` function can be used to create a strong reference to" +" an object. Usually, the :c:func:`Py_DECREF` function must be called on the " +"strong reference before exiting the scope of the strong reference, to avoid " +"leaking one reference." +msgstr "" +"از تابع :c:func:`Py_NewRef` می‌توان برای ایجاد یک ارجاع قوی به یک شیء " +"استفاده کرد. معمولاً باید تابع :c:func:`Py_DECREF` پیش از خروج از محدوده‌ی " +"ارجاع قوی، روی آن فراخوانی شود تا از نشت یک ارجاع جلوگیری شود." msgid "See also :term:`borrowed reference`." msgstr "همچنین :term:`ارجاع قرض‌گرفته‌شده ` را ببینید." @@ -1430,14 +3315,44 @@ msgstr "همچنین :term:`ارجاع قرض‌گرفته‌شده `, for example, the ``3`` in ``items[3]``. Usually used to select an element of a container. Also called a :term:`key` when subscripting a :term:`mapping`, or an :term:`index` when subscripting a :term:`sequence`." -msgstr "عبارت درون کروشه‌های یک :ref:`subscription expression `، برای مثال ``3`` در ``items[3]``. معمولاً برای انتخاب یک المان از یک کانتینر استفاده می‌شود. هنگام زیرنویس‌گذاری یک :term:`نگاشت `، به آن :term:`کلید ` نیز گفته می‌شود و هنگام زیرنویس‌گذاری یک :term:`دنباله `، به آن :term:`اندیس ` گفته می‌شود." +msgid "" +"The expression in square brackets of a :ref:`subscription expression " +"`, for example, the ``3`` in ``items[3]``. Usually used to " +"select an element of a container. Also called a :term:`key` when " +"subscripting a :term:`mapping`, or an :term:`index` when subscripting a " +":term:`sequence`." +msgstr "" +"عبارت درون کروشه‌های یک :ref:`نمادگذاری زیرنویسی `، برای" +" مثال ``3`` در ``items[3]``. معمولاً برای انتخاب یک المان از یک ظرف " +"استفاده می‌شود. هنگام زیرنویس‌گذاری یک :term:`نگاشت `، به آن " +":term:`کلید ` نیز گفته می‌شود و هنگام زیرنویس‌گذاری یک :term:`دنباله " +"`، به آن :term:`اندیس ` گفته می‌شود." msgid "synchronization primitive" msgstr "اولیه" -msgid "A basic building block for coordinating (synchronizing) the execution of multiple threads to ensure :term:`thread-safe` access to shared resources. Python's :mod:`threading` module provides several synchronization primitives including :class:`~threading.Lock`, :class:`~threading.RLock`, :class:`~threading.Semaphore`, :class:`~threading.Condition`, :class:`~threading.Event`, and :class:`~threading.Barrier`. Additionally, the :mod:`queue` module provides multi-producer, multi-consumer queues that are especially useful in multithreaded programs. These primitives help prevent :term:`race conditions ` and coordinate thread execution. See also :term:`lock`." -msgstr "یک سازهٔ پایه برای هماهنگ‌سازی اجرای چند نخ اجرایی، با هدف اطمینان از دسترسی :term:`ایمن برای نخ‌های اجرایی ` به منابع مشترک. ماژول :mod:`threading` پایتون چندین اولیهٔ همگام‌سازی، از جمله :class:`~threading.Lock`، :class:`~threading.RLock`، :class:`~threading.Semaphore`، :class:`~threading.Condition`، :class:`~threading.Event` و :class:`~threading.Barrier` را فراهم می‌کند. افزون بر این، ماژول :mod:`queue` صف‌های چندتولیدکننده، چندمصرف‌کننده‌ای را فراهم می‌کند که به‌ویژه در برنامه‌های چندنخی مفید هستند. این اولیه‌ها به جلوگیری از :term:`شرط رقابت ` و هماهنگ‌سازی اجرای نخ‌های اجرایی کمک می‌کنند. همچنین :term:`قفل ` را ببینید." +msgid "" +"A basic building block for coordinating (synchronizing) the execution of " +"multiple threads to ensure :term:`thread-safe` access to shared resources. " +"Python's :mod:`threading` module provides several synchronization primitives" +" including :class:`~threading.Lock`, :class:`~threading.RLock`, " +":class:`~threading.Semaphore`, :class:`~threading.Condition`, " +":class:`~threading.Event`, and :class:`~threading.Barrier`. Additionally, " +"the :mod:`queue` module provides multi-producer, multi-consumer queues that " +"are especially useful in multithreaded programs. These primitives help " +"prevent :term:`race conditions ` and coordinate thread " +"execution. See also :term:`lock`." +msgstr "" +"یک سازه‌ی پایه برای هماهنگ‌سازی اجرای چند نخ اجرایی، با هدف اطمینان از دسترسی" +" :term:`ایمن برای نخ‌های اجرایی ` به منابع مشترک. ماژول " +":mod:`threading` پایتون چندین اولیه‌ی همگام‌سازی، از جمله " +":class:`~threading.Lock`، :class:`~threading.RLock`، " +":class:`~threading.Semaphore`، :class:`~threading.Condition`، " +":class:`~threading.Event` و :class:`~threading.Barrier` را فراهم می‌کند. " +"افزون بر این، ماژول :mod:`queue` صف‌های چندتولیدکننده، چندمصرف‌کننده‌ای را " +"فراهم می‌کند که به‌ویژه در برنامه‌های چندنخی مفید هستند. این اولیه‌ها به " +"جلوگیری از :term:`شرط رقابت ` و هماهنگ‌سازی اجرای نخ‌های " +"اجرایی کمک می‌کنند. همچنین :term:`قفل ` را ببینید." msgid "t-string" msgstr "تی‌استرینگ" @@ -1445,74 +3360,190 @@ msgstr "تی‌استرینگ" msgid "t-strings" msgstr "تی‌استرینگ‌ها" -msgid "String literals prefixed with ``t`` or ``T`` are commonly called \"t-strings\" which is short for :ref:`template string literals `." -msgstr "لیترال‌های رشته‌ای که با ``t`` یا ``T`` پیشوندگذاری شده‌اند، معمولاً «t-string» نامیده می‌شوند که شکل کوتاه‌شدهٔ :ref:`template string literals ` است." +msgid "" +"String literals prefixed with ``t`` or ``T`` are commonly called " +"\"t-strings\" which is short for :ref:`template string literals " +"`." +msgstr "" +"مقادیر لفظی رشته‌ای که با ``t`` یا ``T`` پیشوندگذاری شده‌اند، معمولاً «t-string» نامیده می‌شوند که شکل کوتاه‌شده‌ی :ref:`تی‌استرینگ‌ها ` است." msgid "text encoding" msgstr "کدگذاری متن" -msgid "A string in Python is a sequence of Unicode code points (in range ``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be serialized as a sequence of bytes." -msgstr "یک رشته در پایتون دنباله‌ای از نقاط کد یونیکد است (در محدودهٔ ``U+0000``--``U+10FFFF``). برای ذخیره یا انتقال یک رشته، لازم است آن را به‌صورت دنباله‌ای از بایت‌ها سریال‌سازی کرد." +msgid "" +"A string in Python is a sequence of Unicode code points (in range " +"``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " +"serialized as a sequence of bytes." +msgstr "" +"یک رشته در پایتون دنباله‌ای از نقاط کد یونیکد است (در محدوده‌ی " +"``U+0000``--``U+10FFFF``). برای ذخیره یا انتقال یک رشته، لازم است آن را " +"به‌صورت دنباله‌ای از بایت‌ها سریال‌سازی کرد." -msgid "Serializing a string into a sequence of bytes is known as \"encoding\", and recreating the string from the sequence of bytes is known as \"decoding\"." -msgstr "سریال‌سازی یک رشته به‌صورت دنباله‌ای از بایت‌ها «کدگذاری» نامیده می‌شود و بازسازی رشته از دنبالهٔ بایت‌ها «کدگشایی» نام دارد." +msgid "" +"Serializing a string into a sequence of bytes is known as \"encoding\", and " +"recreating the string from the sequence of bytes is known as \"decoding\"." +msgstr "" +"سریال‌سازی یک رشته به‌صورت دنباله‌ای از بایت‌ها «کدگذاری» نامیده می‌شود و " +"بازسازی رشته از دنباله‌ی بایت‌ها «کدگشایی» نام دارد." -msgid "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." -msgstr "انواع مختلفی از :ref:`codecs ` برای سریال‌سازی متن وجود دارند که در مجموع «کدگذاری‌های متن» نامیده می‌شوند." +msgid "" +"There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." +msgstr "" +"انواع مختلفی از :ref:`codecs ` برای سریال‌سازی متن وجود " +"دارند که در مجموع «کدگذاری‌های متن» نامیده می‌شوند." msgid "text file" msgstr "فایل متنی" -msgid "A :term:`file object` able to read and write :class:`str` objects. Often, a text file actually accesses a byte-oriented datastream and handles the :term:`text encoding` automatically. Examples of text files are files opened in text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and instances of :class:`io.StringIO`." -msgstr "یک :term:`شیء فایل ` که می‌تواند اشیای :class:`str` را بخواند و بنویسد. یک فایل متنی اغلب در واقع به یک جریان دادهٔ بایت‌محور دسترسی دارد و :term:`کدگذاری متن ` را به‌طور خودکار مدیریت می‌کند. نمونه‌هایی از فایل‌های متنی، فایل‌هایی هستند که در حالت متنی باز شده‌اند (``'r'`` یا ``'w'``)، :data:`sys.stdin`، :data:`sys.stdout` و نمونه‌های :class:`io.StringIO`." +msgid "" +"A :term:`file object` able to read and write :class:`str` objects. Often, a " +"text file actually accesses a byte-oriented datastream and handles the " +":term:`text encoding` automatically. Examples of text files are files opened" +" in text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, " +"and instances of :class:`io.StringIO`." +msgstr "" +"یک :term:`شیء فایل ` که می‌تواند اشیای :class:`str` را بخواند و" +" بنویسد. یک فایل متنی اغلب در واقع به یک جریان داده‌ی بایت‌محور دسترسی دارد و" +" :term:`کدگذاری متن ` را به‌طور خودکار مدیریت می‌کند. " +"نمونه‌هایی از فایل‌های متنی، فایل‌هایی هستند که در حالت متنی باز شده‌اند " +"(``'r'`` یا ``'w'``)، :data:`sys.stdin`، :data:`sys.stdout` و نمونه‌های " +":class:`io.StringIO`." -msgid "See also :term:`binary file` for a file object able to read and write :term:`bytes-like objects `." -msgstr "همچنین برای یک شیء فایل که می‌تواند :term:`شیء شبه‌بایت ` را بخواند و بنویسد، :term:`فایل دودویی ` را ببینید." +msgid "" +"See also :term:`binary file` for a file object able to read and write " +":term:`bytes-like objects `." +msgstr "" +"همچنین برای یک شیء فایل که می‌تواند :term:`شیء شبه‌بایت `" +" را بخواند و بنویسد، :term:`فایل دودویی ` را ببینید." msgid "thread state" msgstr "وضعیت نخ اجرایی" -msgid "The information used by the :term:`CPython` runtime to run in an OS thread. For example, this includes the current exception, if any, and the state of the bytecode interpreter." -msgstr "اطلاعاتی که :term:`CPython ` ران‌تایم برای اجرا در یک نخ اجرایی سیستم‌عامل استفاده می‌کند. برای مثال، این اطلاعات شامل استثنای فعلی، در صورت وجود، و وضعیت مفسر بایت‌کد است." +msgid "" +"The information used by the :term:`CPython` runtime to run in an OS thread. " +"For example, this includes the current exception, if any, and the state of " +"the bytecode interpreter." +msgstr "" +"اطلاعاتی که :term:`CPython ` ران‌تایم برای اجرا در یک نخ اجرایی " +"سیستم‌عامل استفاده می‌کند. برای مثال، این اطلاعات شامل استثنای فعلی، در صورت" +" وجود، و وضعیت مفسر بایت‌کد است." -msgid "Each thread state is bound to a single OS thread, but threads may have many thread states available. At most, one of them may be :term:`attached ` at once." -msgstr "هر وضعیت نخ اجرایی به یک نخ اجرایی سیستم‌عامل واحد وابسته است، اما نخ‌های اجرایی ممکن است وضعیت‌های نخ اجرایی متعددی در دسترس داشته باشند. در هر لحظه حداکثر یکی از آن‌ها می‌تواند :term:`وضعیت نخ متصل ` باشد." +msgid "" +"Each thread state is bound to a single OS thread, but threads may have many " +"thread states available. At most, one of them may be :term:`attached " +"` at once." +msgstr "" +"هر وضعیت نخ اجرایی به یک نخ اجرایی سیستم‌عامل واحد وابسته است، اما نخ‌های " +"اجرایی ممکن است وضعیت‌های نخ اجرایی متعددی در دسترس داشته باشند. در هر لحظه " +"حداکثر یکی از آن‌ها می‌تواند :term:`وضعیت نخ متصل ` " +"باشد." -msgid "An :term:`attached thread state` is required to call most of Python's C API, unless a function explicitly documents otherwise. The bytecode interpreter only runs under an attached thread state." -msgstr "برای فراخوانی بیشتر API زبان C پایتون، یک :term:`وضعیت نخ متصل ` لازم است، مگر اینکه تابعی صراحتاً خلاف آن را مستند کرده باشد. مفسر بایت‌کد فقط در یک وضعیت نخ اجرایی پیوست‌شده اجرا می‌شود." +msgid "" +"An :term:`attached thread state` is required to call most of Python's C API," +" unless a function explicitly documents otherwise. The bytecode interpreter " +"only runs under an attached thread state." +msgstr "" +"برای فراخوانی بیشتر API زبان C پایتون، یک :term:`وضعیت نخ متصل ` لازم است، مگر اینکه تابعی صراحتاً خلاف آن را مستند کرده باشد." +" مفسر بایت‌کد فقط در یک وضعیت نخ اجرایی پیوست‌شده اجرا می‌شود." -msgid "Each thread state belongs to a single interpreter, but each interpreter may have many thread states, including multiple for the same OS thread. Thread states from multiple interpreters may be bound to the same thread, but only one can be :term:`attached ` in that thread at any given moment." -msgstr "هر وضعیت نخ اجرایی به یک مفسر واحد تعلق دارد، اما هر مفسر ممکن است وضعیت‌های نخ اجرایی متعددی داشته باشد، از جمله چند وضعیت برای یک نخ اجرایی سیستم‌عامل یکسان. وضعیت‌های نخ اجرایی از مفسرهای متعدد ممکن است به یک نخ اجرایی یکسان وابسته باشند، اما در هر لحظه فقط یکی از آن‌ها می‌تواند در آن نخ اجرایی :term:`وضعیت نخ متصل ` باشد." +msgid "" +"Each thread state belongs to a single interpreter, but each interpreter may " +"have many thread states, including multiple for the same OS thread. Thread " +"states from multiple interpreters may be bound to the same thread, but only " +"one can be :term:`attached ` in that thread at any " +"given moment." +msgstr "" +"هر وضعیت نخ اجرایی به یک مفسر واحد تعلق دارد، اما هر مفسر ممکن است وضعیت‌های" +" نخ اجرایی متعددی داشته باشد، از جمله چند وضعیت برای یک نخ اجرایی سیستم‌عامل" +" یکسان. وضعیت‌های نخ اجرایی از مفسرهای متعدد ممکن است به یک نخ اجرایی یکسان " +"وابسته باشند، اما در هر لحظه فقط یکی از آن‌ها می‌تواند در آن نخ اجرایی " +":term:`وضعیت نخ متصل ` باشد." -msgid "See :ref:`Thread State and the Global Interpreter Lock ` for more information." -msgstr "برای اطلاعات بیشتر، :ref:`Thread State and the Global Interpreter Lock ` را ببینید." +msgid "" +"See :ref:`Thread State and the Global Interpreter Lock ` for more " +"information." +msgstr "" +"برای اطلاعات بیشتر، :ref:`Thread State and the Global Interpreter Lock " +"` را ببینید." msgid "thread-safe" msgstr "ایمن برای نخ‌های اجرایی" -msgid "A module, function, or class that behaves correctly when used by multiple threads concurrently. Thread-safe code uses appropriate :term:`synchronization primitives ` like :term:`locks ` to protect shared mutable state, or is designed to avoid shared mutable state entirely. In the :term:`free-threaded ` build, built-in types like :class:`dict`, :class:`list`, and :class:`set` use internal locking to make many operations thread-safe, although thread safety is not necessarily guaranteed. Code that is not thread-safe may experience :term:`race conditions ` and :term:`data races ` when used in multi-threaded programs." -msgstr "یک ماژول، تابع یا کلاس که هنگام استفادهٔ هم‌زمان توسط چند نخ اجرایی، به‌درستی رفتار می‌کند. کد ایمن برای نخ‌های اجرایی از :term:`اولیه ` مناسب، مانند :term:`قفل `، برای محافظت از وضعیت تغییرپذیر مشترک استفاده می‌کند یا به‌گونه‌ای طراحی شده است که به‌طور کامل از وضعیت تغییرپذیر مشترک اجتناب کند. در ساخت :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict`، :class:`list` و :class:`set` از قفل‌گذاری داخلی برای ایمن‌کردن بسیاری از عملیات در برابر اجرای هم‌زمان نخ‌های اجرایی استفاده می‌کنند، هرچند ایمنی در برابر نخ‌های اجرایی لزوماً تضمین‌شده نیست. کدی که برای نخ‌های اجرایی ایمن نیست، هنگام استفاده در برنامه‌های چندنخی ممکن است دچار :term:`شرط رقابت ` و :term:`رقابت داده ` شود." +msgid "" +"A module, function, or class that behaves correctly when used by multiple " +"threads concurrently. Thread-safe code uses appropriate " +":term:`synchronization primitives ` like " +":term:`locks ` to protect shared mutable state, or is designed to " +"avoid shared mutable state entirely. In the :term:`free-threaded ` build, built-in types like :class:`dict`, :class:`list`, and " +":class:`set` use internal locking to make many operations thread-safe, " +"although thread safety is not necessarily guaranteed. Code that is not " +"thread-safe may experience :term:`race conditions ` and " +":term:`data races ` when used in multi-threaded programs." +msgstr "" +"یک ماژول، تابع یا کلاس که هنگام استفاده‌ی همزمان توسط چند نخ اجرایی، " +"به‌درستی رفتار می‌کند. کد ایمن برای نخ‌های اجرایی از :term:`اولیه " +"` مناسب، مانند :term:`قفل `، برای محافظت از" +" وضعیت تغییرپذیر مشترک استفاده می‌کند یا به‌گونه‌ای طراحی شده است که به‌طور " +"کامل از وضعیت تغییرپذیر مشترک اجتناب کند. در ساخت :term:`نخ‌گذاری آزاد `، نوع‌های توکار مانند :class:`dict`، :class:`list` و " +":class:`set` از قفل‌گذاری داخلی برای ایمن‌کردن بسیاری از عملیات در برابر " +"اجرای همزمان نخ‌های اجرایی استفاده می‌کنند، هرچند ایمنی در برابر نخ‌های " +"اجرایی لزوماً تضمین‌شده نیست. کدی که برای نخ‌های اجرایی ایمن نیست، هنگام " +"استفاده در برنامه‌های چندنخی ممکن است دچار :term:`شرط رقابت ` و :term:`رقابت داده ` شود." msgid "token" msgstr "توکن" -msgid "A small unit of source code, generated by the :ref:`lexical analyzer ` (also called the *tokenizer*). Names, numbers, strings, operators, newlines and similar are represented by tokens." -msgstr "واحد کوچکی از کد منبع که توسط :ref:`lexical analyzer ` (که *tokenizer* نیز نامیده می‌شود) تولید می‌شود. نام‌ها، اعداد، رشته‌ها، عملگرها، نویسه‌های خط جدید و موارد مشابه به‌صورت توکن نمایش داده می‌شوند." +msgid "" +"A small unit of source code, generated by the :ref:`lexical analyzer " +"` (also called the *tokenizer*). Names, numbers, strings, " +"operators, newlines and similar are represented by tokens." +msgstr "" +"واحد کوچکی از کد منبع که توسط :ref:`lexical analyzer ` (که " +"*tokenizer* نیز نامیده می‌شود) تولید می‌شود. نام‌ها، اعداد، رشته‌ها، " +"عملگرها، نویسه‌های خط جدید و موارد مشابه به‌صورت توکن نمایش داده می‌شوند." -msgid "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:`token` module contains information on the various types of tokens." -msgstr "ماژول :mod:`tokenize` تحلیل‌گر واژگانی پایتون را در دسترس قرار می‌دهد. ماژول :mod:`token` حاوی اطلاعاتی دربارهٔ انواع مختلف توکن‌ها است." +msgid "" +"The :mod:`tokenize` module exposes Python's lexical analyzer. The " +":mod:`token` module contains information on the various types of tokens." +msgstr "" +"ماژول :mod:`tokenize` تحلیل‌گر واژگانی پایتون را در دسترس قرار می‌دهد. ماژول" +" :mod:`token` حاوی اطلاعاتی درباره‌ی انواع مختلف توکن‌ها است." msgid "triple-quoted string" -msgstr "رشتهٔ سه‌نقل‌قولی" +msgstr "رشته‌ی سه‌نقل‌قولی" -msgid "A string which is bound by three instances of either a quotation mark (\") or an apostrophe ('). While they don't provide any functionality not available with single-quoted strings, they are useful for a number of reasons. They allow you to include unescaped single and double quotes within a string and they can span multiple lines without the use of the continuation character, making them especially useful when writing docstrings." -msgstr "رشته‌ای که با سه نمونه از یکی از علامت‌های نقل‌قول (\") یا آپاستروف (') محصور شده است. با اینکه این رشته‌ها قابلیت جدیدی فراتر از رشته‌های تک‌نقل‌قولی فراهم نمی‌کنند، به دلایل متعددی مفید هستند. آن‌ها به شما اجازه می‌دهند علامت‌های نقل‌قول تکی و دوتایی را بدون خنثی‌سازی درون یک رشته قرار دهید و می‌توانند بدون استفاده از نویسهٔ ادامهٔ خط، چندین خط را دربر بگیرند؛ بنابراین هنگام نوشتن docstringها به‌ویژه مفید هستند." +msgid "" +"A string which is bound by three instances of either a quotation mark (\") " +"or an apostrophe ('). While they don't provide any functionality not " +"available with single-quoted strings, they are useful for a number of " +"reasons. They allow you to include unescaped single and double quotes " +"within a string and they can span multiple lines without the use of the " +"continuation character, making them especially useful when writing " +"docstrings." +msgstr "" +"رشته‌ای که با سه نمونه از یکی از علامت‌های نقل‌قول (\") یا آپاستروف (') " +"محصور شده است. با اینکه این رشته‌ها قابلیت جدیدی فراتر از رشته‌های " +"تک‌نقل‌قولی فراهم نمی‌کنند، به دلایل متعددی مفید هستند. آن‌ها به شما اجازه " +"می‌دهند علامت‌های نقل‌قول تکی و دوتایی را بدون خنثی‌سازی درون یک رشته قرار " +"دهید و می‌توانند بدون استفاده از نویسه‌ی ادامه‌ی خط، چندین خط را دربر بگیرند؛ " +"بنابراین هنگام نوشتن رشته مستندات به‌ویژه مفید هستند." msgid "type" msgstr "نوع" -msgid "The type of a Python object determines what kind of object it is; every object has a type. An object's type is accessible as its :attr:`~object.__class__` attribute or can be retrieved with ``type(obj)``." -msgstr "نوع یک شیء پایتون تعیین می‌کند که آن شیء از چه نوعی است؛ هر شیء یک نوع دارد. نوع یک شیء به‌عنوان ویژگی :attr:`~object.__class__` آن در دسترس است یا می‌توان آن را با ``type(obj)`` به‌دست آورد." +msgid "" +"The type of a Python object determines what kind of object it is; every " +"object has a type. An object's type is accessible as its " +":attr:`~object.__class__` attribute or can be retrieved with ``type(obj)``." +msgstr "" +"نوع یک شیء پایتون تعیین می‌کند که آن شیء از چه نوعی است؛ هر شیء یک نوع دارد." +" نوع یک شیء به‌عنوان ویژگی :attr:`~object.__class__` آن در دسترس است یا " +"می‌توان آن را با ``type(obj)`` به‌دست آورد." msgid "type alias" msgstr "نام مستعار نوع" @@ -1520,8 +3551,12 @@ msgstr "نام مستعار نوع" msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "مترادفی برای یک نوع که با نسبت‌دادن نوع به یک شناسه ایجاد می‌شود." -msgid "Type aliases are useful for simplifying :term:`type hints `. For example::" -msgstr "نام‌های مستعار نوع برای ساده‌سازی :term:`راهنمای نوع ` مفید هستند. برای مثال::" +msgid "" +"Type aliases are useful for simplifying :term:`type hints `. For " +"example::" +msgstr "" +"نام‌های مستعار نوع برای ساده‌سازی :term:`راهنمای نوع ` مفید " +"هستند. برای مثال::" msgid "" "def remove_gray_shades(\n" @@ -1552,20 +3587,43 @@ msgstr "برای توضیح این قابلیت، :mod:`typing` و :pep:`484` ر msgid "type hint" msgstr "راهنمای نوع" -msgid "An :term:`annotation` that specifies the expected type for a variable, a class attribute, or a function parameter or return value." -msgstr "یک :term:`حاشیه‌گذاری ` که نوع مورد انتظار برای یک متغیر، یک ویژگی کلاس، یا یک پارامتر یا مقدار بازگشتی تابع را مشخص می‌کند." +msgid "" +"An :term:`annotation` that specifies the expected type for a variable, a " +"class attribute, or a function parameter or return value." +msgstr "" +"یک :term:`حاشیه‌گذاری ` که نوع مورد انتظار برای یک متغیر، یک " +"ویژگی کلاس، یا یک پارامتر یا مقدار بازگشتی تابع را مشخص می‌کند." -msgid "Type hints are optional and are not enforced by Python but they are useful to :term:`static type checkers `. They can also aid IDEs with code completion and refactoring." -msgstr "راهنماهای نوع اختیاری هستند و پایتون آن‌ها را اعمال نمی‌کند، اما برای :term:`بررسی‌کنندهٔ نوع ایستا ` مفید هستند. آن‌ها همچنین می‌توانند به IDEها در تکمیل کد و بازآرایی کد کمک کنند." +msgid "" +"Type hints are optional and are not enforced by Python but they are useful " +"to :term:`static type checkers `. They can also aid " +"IDEs with code completion and refactoring." +msgstr "" +"راهنماهای نوع اختیاری هستند و پایتون آن‌ها را اعمال نمی‌کند، اما برای " +":term:`بررسی‌کننده‌ی نوع ایستا ` مفید هستند. آن‌ها " +"همچنین می‌توانند به IDEها در تکمیل کد و بازآرایی کد کمک کنند." -msgid "Type hints of global variables, class attributes, and functions, but not local variables, can be accessed using :func:`typing.get_type_hints`." -msgstr "راهنماهای نوع متغیرهای سراسری، ویژگی‌های کلاس و توابع، اما نه متغیرهای محلی، با استفاده از :func:`typing.get_type_hints` قابل دسترسی هستند." +msgid "" +"Type hints of global variables, class attributes, and functions, but not " +"local variables, can be accessed using :func:`typing.get_type_hints`." +msgstr "" +"راهنماهای نوع متغیرهای سراسری، ویژگی‌های کلاس و توابع، اما نه متغیرهای محلی،" +" با استفاده از :func:`typing.get_type_hints` قابل دسترسی هستند." msgid "universal newlines" -msgstr "خط جدید همگانی" +msgstr "سطرهای جدید همگانی" -msgid "A manner of interpreting text streams in which all of the following are recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the Windows convention ``'\\r\\n'``, and the old Macintosh convention ``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes.splitlines` for an additional use." -msgstr "روشی برای تفسیر جریان‌های متنی که در آن همهٔ موارد زیر به‌عنوان پایان یک خط شناخته می‌شوند: قرارداد پایان خط یونیکس ``'\\n'``، قرارداد ویندوز ``'\\r\\n'`` و قرارداد قدیمی مکینتاش ``'\\r'``. همچنین :pep:`278` و :pep:`3116` و نیز :func:`bytes.splitlines` را برای کاربردی دیگر ببینید." +msgid "" +"A manner of interpreting text streams in which all of the following are " +"recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " +"Windows convention ``'\\r\\n'``, and the old Macintosh convention ``'\\r'``." +" See :pep:`278` and :pep:`3116`, as well as :func:`bytes.splitlines` for an" +" additional use." +msgstr "" +"روشی برای تفسیر جریان‌های متنی که در آن همه‌ی موارد زیر به‌عنوان پایان یک خط " +"شناخته می‌شوند: قرارداد پایان خط یونیکس ``'\\n'``، قرارداد ویندوز " +"``'\\r\\n'`` و قرارداد قدیمی مکینتاش ``'\\r'``. همچنین :pep:`278` و " +":pep:`3116` و نیز :func:`bytes.splitlines` را برای کاربردی دیگر ببینید." msgid "variable annotation" msgstr "حاشیه‌نویسی متغیر" @@ -1573,7 +3631,8 @@ msgstr "حاشیه‌نویسی متغیر" msgid "An :term:`annotation` of a variable or a class attribute." msgstr "یک :term:`حاشیه‌گذاری ` برای یک متغیر یا یک ویژگی کلاس." -msgid "When annotating a variable or a class attribute, assignment is optional::" +msgid "" +"When annotating a variable or a class attribute, assignment is optional::" msgstr "هنگام حاشیه‌نویسی یک متغیر یا یک ویژگی کلاس، انتساب اختیاری است::" msgid "" @@ -1583,8 +3642,12 @@ msgstr "" "class C:\n" " field: 'annotation'" -msgid "Variable annotations are usually used for :term:`type hints `: for example this variable is expected to take :class:`int` values::" -msgstr "حاشیه‌نویسی‌های متغیر معمولاً برای :term:`راهنمای نوع ` استفاده می‌شوند؛ برای مثال، انتظار می‌رود این متغیر مقادیر :class:`int` را بپذیرد::" +msgid "" +"Variable annotations are usually used for :term:`type hints `: " +"for example this variable is expected to take :class:`int` values::" +msgstr "" +"حاشیه‌نویسی‌های متغیر معمولاً برای :term:`راهنمای نوع ` استفاده " +"می‌شوند؛ برای مثال، انتظار می‌رود این متغیر مقادیر :class:`int` را بپذیرد::" msgid "count: int = 0" msgstr "count: int = 0" @@ -1592,14 +3655,27 @@ msgstr "count: int = 0" msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "سینتکس حاشیه‌نویسی متغیر در بخش :ref:`annassign` توضیح داده شده است." -msgid "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe this functionality. Also see :ref:`annotations-howto` for best practices on working with annotations." -msgstr "همچنین :term:`حاشیه‌گذاری تابع `، :pep:`484` و :pep:`526` را که این قابلیت را توصیف می‌کنند، ببینید. برای بهترین روش‌های کار با حاشیه‌نویسی‌ها نیز :ref:`annotations-howto` را ببینید." +msgid "" +"See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " +"this functionality. Also see :ref:`annotations-howto` for best practices on " +"working with annotations." +msgstr "" +"همچنین :term:`حاشیه‌گذاری تابع `، :pep:`484` و " +":pep:`526` را که این قابلیت را توصیف می‌کنند، ببینید. برای بهترین روش‌های " +"کار با حاشیه‌نویسی‌ها نیز :ref:`annotations-howto` را ببینید." msgid "virtual environment" msgstr "محیط مجازی" -msgid "A cooperatively isolated runtime environment that allows Python users and applications to install and upgrade Python distribution packages without interfering with the behaviour of other Python applications running on the same system." -msgstr "یک محیط ران‌تایم ایزوله‌شدهٔ مشارکتی که به کاربران و برنامه‌های پایتون اجازه می‌دهد بسته‌های توزیعی پایتون را بدون تداخل با رفتار سایر برنامه‌های پایتونی در حال اجرا روی همان سیستم، نصب و ارتقا دهند." +msgid "" +"A cooperatively isolated runtime environment that allows Python users and " +"applications to install and upgrade Python distribution packages without " +"interfering with the behaviour of other Python applications running on the " +"same system." +msgstr "" +"یک محیط ران‌تایم ایزوله‌شده‌ی مشارکتی که به کاربران و برنامه‌های پایتون اجازه" +" می‌دهد بسته‌های توزیعی پایتون را بدون تداخل با رفتار سایر برنامه‌های " +"پایتونی در حال اجرا روی همان سیستم، نصب و ارتقا دهند." msgid "See also :mod:`venv`." msgstr "همچنین :mod:`venv` را ببینید." @@ -1607,26 +3683,42 @@ msgstr "همچنین :mod:`venv` را ببینید." msgid "virtual machine" msgstr "ماشین مجازی" -msgid "A computer defined entirely in software. Python's virtual machine executes the :term:`bytecode` emitted by the bytecode compiler." -msgstr "یک رایانه که به‌طور کامل در نرم‌افزار تعریف شده است. ماشین مجازی پایتون :term:`بایت‌کد ` تولیدشده توسط کامپایلر بایت‌کد را اجرا می‌کند." +msgid "" +"A computer defined entirely in software. Python's virtual machine executes " +"the :term:`bytecode` emitted by the bytecode compiler." +msgstr "" +"یک رایانه که به‌طور کامل در نرم‌افزار تعریف شده است. ماشین مجازی پایتون " +":term:`بایت‌کد ` تولیدشده توسط کامپایلر بایت‌کد را اجرا می‌کند." msgid "walrus operator" msgstr "عملگر والروس" -msgid "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you turn your head." -msgstr "روشی شوخ‌طبعانه برای اشاره به عملگر :ref:`assignment expression ` یعنی ``:=``، زیرا اگر سرتان را کمی کج کنید، ظاهر آن تا حدی شبیه یک والروس است." +msgid "" +"A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " +"turn your head." +msgstr "" +"روشی شوخ‌طبعانه برای اشاره به عملگر :ref:`assignment expression ` یعنی ``:=``، زیرا اگر سرتان را کمی کج کنید، ظاهر آن تا حدی " +"شبیه یک والروس است." msgid "Zen of Python" msgstr "ذن پایتون" -msgid "Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing \"``import this``\" at the interactive prompt." -msgstr "فهرستی از اصول و فلسفه‌های طراحی پایتون که برای درک و استفاده از این زبان مفید هستند. این فهرست با واردکردن «``import this``» در اعلان تعاملی قابل مشاهده است." +msgid "" +"Listing of Python design principles and philosophies that are helpful in " +"understanding and using the language. The listing can be found by typing " +"\"``import this``\" at the interactive prompt." +msgstr "" +"فهرستی از اصول و فلسفه‌های طراحی پایتون که برای درک و استفاده از این زبان " +"مفید هستند. این فهرست با واردکردن «``import this``» در اعلان تعاملی قابل " +"مشاهده است." msgid "..." msgstr "..." msgid "ellipsis literal" -msgstr "لیترال سه‌نقطه" +msgstr "لفظی سه‌نقطه" msgid "C-contiguous" msgstr "پیوسته در C" @@ -1640,8 +3732,20 @@ msgstr "جادو" msgid "special" msgstr "ویژه" -#~ msgid "Usually refers to an asynchronous generator function, but may refer to an *asynchronous generator iterator* in some contexts. In cases where the intended meaning isn't clear, using the full terms avoids ambiguity." -#~ msgstr "معمولاً به یک تابع تولیدگر ناهمگام اشاره دارد، اما در برخی زمینه‌ها ممکن است به یک *تکرارگر تولیدگر ناهمگام* اشاره کند. در مواردی که معنای مورد نظر واضح نیست، استفاده از اصطلاحات کامل از ابهام جلوگیری می‌کند." - -#~ msgid "Usually refers to a generator function, but may refer to a *generator iterator* in some contexts. In cases where the intended meaning isn't clear, using the full terms avoids ambiguity." -#~ msgstr "معمولاً به یک تابع تولیدگر اشاره دارد، اما در برخی زمینه‌ها ممکن است به یک *تکرارگر تولیدگر* اشاره کند. در مواردی که معنای مورد نظر واضح نیست، استفاده از اصطلاحات کامل از ابهام جلوگیری می‌کند." +#~ msgid "" +#~ "Usually refers to an asynchronous generator function, but may refer to an " +#~ "*asynchronous generator iterator* in some contexts. In cases where the " +#~ "intended meaning isn't clear, using the full terms avoids ambiguity." +#~ msgstr "" +#~ "معمولاً به یک تابع تولیدگر ناهمگام اشاره دارد، اما در برخی زمینه‌ها ممکن است" +#~ " به یک *پیمایش‌گر تولیدگر ناهمگام* اشاره کند. در مواردی که معنای مورد نظر واضح" +#~ " نیست، استفاده از اصطلاحات کامل از ابهام جلوگیری می‌کند." + +#~ msgid "" +#~ "Usually refers to a generator function, but may refer to a *generator " +#~ "iterator* in some contexts. In cases where the intended meaning isn't " +#~ "clear, using the full terms avoids ambiguity." +#~ msgstr "" +#~ "معمولاً به یک تابع تولیدگر اشاره دارد، اما در برخی زمینه‌ها ممکن است به یک " +#~ "*پیمایش‌گر تولیدگر* اشاره کند. در مواردی که معنای مورد نظر واضح نیست، استفاده " +#~ "از اصطلاحات کامل از ابهام جلوگیری می‌کند." diff --git a/howto/a-conceptual-overview-of-asyncio.po b/howto/a-conceptual-overview-of-asyncio.po index 9f790843e..b837e4e63 100644 --- a/howto/a-conceptual-overview-of-asyncio.po +++ b/howto/a-conceptual-overview-of-asyncio.po @@ -20,49 +20,131 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "A Conceptual Overview of :mod:`!asyncio`" -msgstr "" +msgstr "مروری مفهومی بر :mod:`!asyncio`" -msgid "This :ref:`HOWTO ` article seeks to help you build a sturdy mental model of how :mod:`asyncio` fundamentally works, helping you understand the how and why behind the recommended patterns." +msgid "" +"This :ref:`HOWTO ` article seeks to help you build a sturdy mental " +"model of how :mod:`asyncio` fundamentally works, helping you understand the " +"how and why behind the recommended patterns." msgstr "" +"این مقاله‌ی :ref:`HOWTO ` در پی آن است که به شما کمک کند مدلی ذهنی " +"مستحکم از اینکه :mod:`asyncio` در بنیاد چگونه کار می‌کند بسازید و چگونگی و " +"چرایی پشت الگوهای توصیه‌شده را درک کنید." -msgid "You might be curious about some key :mod:`!asyncio` concepts. By the end of this article, you'll be able to comfortably answer these questions:" +msgid "" +"You might be curious about some key :mod:`!asyncio` concepts. By the end of " +"this article, you'll be able to comfortably answer these questions:" msgstr "" +"ممکن است درباره‌ی برخی مفاهیم کلیدی :mod:`!asyncio` کنجکاو باشید. در پایان " +"این مقاله، می‌توانید به‌راحتی به این پرسش‌ها پاسخ دهید:" msgid "What's happening behind the scenes when an object is awaited?" -msgstr "" +msgstr "هنگامی که یک شیء await می‌شود، در پشت صحنه چه اتفاقی می‌افتد؟" -msgid "How does :mod:`!asyncio` differentiate between a task which doesn't need CPU time (such as a network request or file read) as opposed to a task that does (such as computing n-factorial)?" +msgid "" +"How does :mod:`!asyncio` differentiate between a task which doesn't need CPU" +" time (such as a network request or file read) as opposed to a task that " +"does (such as computing n-factorial)?" msgstr "" +":mod:`!asyncio` چگونه بین وظیفه‌ایکه به زمان پردازنده نیاز ندارد " +"(مانند درخواست شبکه یا خواندن فایل) و وظیفه‌ای که به آن نیاز دارد (مانند " +"محاسبه‌ی فاکتوریل n) تمایز قائل می‌شود؟" -msgid "How to write an asynchronous variant of an operation, such as an async sleep or database request." +msgid "" +"How to write an asynchronous variant of an operation, such as an async sleep" +" or database request." msgstr "" +"چگونگی نوشتن یک گونه‌ی ناهمگام از یک عملیات، مانند توقف ناهمگام یا درخواست " +"پایگاه داده." -msgid "The `guide `_ that inspired this HOWTO article, by Alexander Nordin." +msgid "" +"The `guide `_ that inspired this HOWTO article, by Alexander Nordin." msgstr "" +"`راهنمایی `_ که این مقاله‌ی HOWTO از آن الهام گرفته است، اثر الکساندر نوردین." -msgid "This in-depth `YouTube tutorial series `_ on ``asyncio`` created by Python core team member, Łukasz Langa." +msgid "" +"This in-depth `YouTube tutorial series `_ on " +"``asyncio`` created by Python core team member, Łukasz Langa." msgstr "" +"این `مجموعه‌ی آموزشی عمیق یوتیوب `_ درباره " +"``asyncio``، ساخته‌شده توسط عضو تیم اصلی پایتون، Łukasz Langa." -msgid "`500 Lines or Less: A Web Crawler With asyncio Coroutines `_ by A. Jesse Jiryu Davis and Guido van Rossum." +msgid "" +"`500 Lines or Less: A Web Crawler With asyncio Coroutines `_ by A. " +"Jesse Jiryu Davis and Guido van Rossum." msgstr "" +"`۵۰۰ خط یا کمتر: یک خزنده وب با هم‌روال‌های asyncio `_ اثر A. " +"Jesse Jiryu Davis و Guido van Rossum." msgid "A conceptual overview part 1: the high-level" -msgstr "" +msgstr "مرور مفهومی بخش ۱: سطح بالا" -msgid "In part 1, we'll cover the main, high-level building blocks of :mod:`!asyncio`: the event loop, coroutine functions, coroutine objects, tasks, and ``await``." +msgid "" +"In part 1, we'll cover the main, high-level building blocks of " +":mod:`!asyncio`: the event loop, coroutine functions, coroutine objects, " +"tasks, and ``await``." msgstr "" +"در بخش ۱، اجزای سازنده‌ی اصلی و سطح بالای :mod:`!asyncio` را پوشش خواهیم " +"داد: حلقه‌ی رویداد، توابع هم‌روال، اشیاء هم‌روال، وظایف (tasks) و " +"``await``." msgid "Event Loop" -msgstr "" +msgstr "حلقه رویداد" -msgid "Everything in :mod:`!asyncio` happens relative to the event loop. It's the star of the show. It's like an orchestra conductor. It's behind the scenes managing resources. Some power is explicitly granted to it, but a lot of its ability to get things done comes from the respect and cooperation of its worker bees." +msgid "" +"Everything in :mod:`!asyncio` happens relative to the event loop. It's the " +"star of the show. It's like an orchestra conductor. It's behind the scenes " +"managing resources. Some power is explicitly granted to it, but a lot of its" +" ability to get things done comes from the respect and cooperation of its " +"worker bees." msgstr "" +"همه‌چیز در :mod:`!asyncio` نسبت به حلقه رویداد رخ می‌دهد. آن ستاره نمایش " +"است. مانند رهبر ارکستر است. پشت صحنه منابع را مدیریت می‌کند. برخی قدرت‌ها " +"به‌طور صریح به آن اعطا شده‌اند، اما بخش زیادی از توانایی آن برای انجام کارها" +" از احترام و همکاری زنبورهای کارگرش ناشی می‌شود." -msgid "In more technical terms, the event loop contains a collection of jobs to be run. Some jobs are added directly by you, and some indirectly by :mod:`!asyncio`. The event loop takes a job from its backlog of work and invokes it (or \"gives it control\"), similar to calling a function, and then that job runs. Once it pauses or completes, it returns control to the event loop. The event loop will then select another job from its pool and invoke it. You can *roughly* think of the collection of jobs as a queue: jobs are added and then processed one at a time, generally (but not always) in order. This process repeats indefinitely, with the event loop cycling endlessly onwards. If there are no more jobs pending execution, the event loop is smart enough to rest and avoid needlessly wasting CPU cycles, and will come back when there's more work to be done." -msgstr "" +msgid "" +"In more technical terms, the event loop contains a collection of jobs to be " +"run. Some jobs are added directly by you, and some indirectly by " +":mod:`!asyncio`. The event loop takes a job from its backlog of work and " +"invokes it (or \"gives it control\"), similar to calling a function, and " +"then that job runs. Once it pauses or completes, it returns control to the " +"event loop. The event loop will then select another job from its pool and " +"invoke it. You can *roughly* think of the collection of jobs as a queue: " +"jobs are added and then processed one at a time, generally (but not always) " +"in order. This process repeats indefinitely, with the event loop cycling " +"endlessly onwards. If there are no more jobs pending execution, the event " +"loop is smart enough to rest and avoid needlessly wasting CPU cycles, and " +"will come back when there's more work to be done." +msgstr "" +"به بیان فنی‌تر، حلقه رویداد شامل مجموعه‌ای از کارها برای اجراست. برخی " +"کارها مستقیماً توسط شما و برخی به‌صورت غیرمستقیم توسط :mod:`!asyncio` اضافه" +" می‌شوند. حلقه رویداد یک کار را از فهرست کارهای معوق خود می‌گیرد و آن را " +"فراخوانی می‌کند (یا «کنترل را به آن می‌دهد»)، شبیه به فراخوانی یک تابع، و " +"سپس آن کار اجرا می‌شود. هنگامی که آن کار مکث کند یا به پایان برسد، کنترل را " +"به حلقه رویداد بازمی‌گرداند. سپس حلقه رویداد کار دیگری را از مخزن خود انتخاب" +" می‌کند و آن را فراخوانی می‌کند. شما *تقریباً* می‌توانید مجموعه کارها را یک" +" صف در نظر بگیرید: کارها اضافه می‌شوند و سپس یکی‌یکی پردازش می‌شوند، " +"معمولاً (اما نه همیشه) به‌ترتیب. این فرآیند به‌طور نامحدود تکرار می‌شود، در " +"حالی که حلقه رویداد بی‌پایان به چرخه خود ادامه می‌دهد. اگر دیگر کاری در " +"انتظار اجرا نباشد، حلقه رویداد به‌اندازه کافی هوشمند است که استراحت کند و از" +" هدر دادن بیهوده چرخه‌های CPU جلوگیری کند، و هنگامی که کار بیشتری برای انجام" +" وجود داشته باشد بازمی‌گردد." -msgid "Effective execution relies on jobs sharing well and cooperating; a greedy job could hog control and leave the other jobs to starve, rendering the overall event loop approach rather useless." +msgid "" +"Effective execution relies on jobs sharing well and cooperating; a greedy " +"job could hog control and leave the other jobs to starve, rendering the " +"overall event loop approach rather useless." msgstr "" +"اجرای کارآمد به اشتراک‌گذاری و همکاری مناسب کارها وابسته است؛ یک کار حریص " +"می‌تواند کنترل را تصاحب کند و سایر کارها را محروم نگه دارد، و در نتیجه " +"رویکرد کلی حلقه رویداد را عملاً بی‌فایده می‌سازد." msgid "" "import asyncio\n" @@ -72,12 +154,18 @@ msgid "" "event_loop = asyncio.new_event_loop()\n" "event_loop.run_forever()" msgstr "" +"import asyncio\n" +"\n" +"# این یک حلقه رویداد ایجاد می‌کند و به‌طور نامحدود در میان\n" +"# مجموعه کارهای آن می‌چرخد.\n" +"event_loop = asyncio.new_event_loop()\n" +"event_loop.run_forever()" msgid "Asynchronous functions and coroutines" -msgstr "" +msgstr "توابع ناهمگام و هم‌روال‌ها" msgid "This is a basic, boring Python function::" -msgstr "" +msgstr "این یک تابع ساده و خسته‌کننده در پایتون است::" msgid "" "def hello_printer():\n" @@ -87,18 +175,33 @@ msgid "" " \"partner in crime.\"\n" " )" msgstr "" +"def hello_printer():\n" +" print(\n" +" \"Hi, I am a lowly, simple printer, though I have all I \"\n" +" \"need in life -- \\nfresh paper and my dearly beloved octopus \"\n" +" \"partner in crime.\"\n" +" )" msgid "Calling a regular function invokes its logic or body::" -msgstr "" +msgstr "فراخوانی یک تابع معمولی، منطق یا بدنه‌ی آن را اجرا می‌کند::" msgid "" ">>> hello_printer()\n" "Hi, I am a lowly, simple printer, though I have all I need in life --\n" "fresh paper and my dearly beloved octopus partner in crime." msgstr "" +">>> hello_printer()\n" +"Hi, I am a lowly, simple printer, though I have all I need in life --\n" +"fresh paper and my dearly beloved octopus partner in crime." -msgid "The :ref:`async def `, as opposed to just a plain ``def``, makes this an asynchronous function (or \"coroutine function\"). Calling it creates and returns a :ref:`coroutine ` object." +msgid "" +"The :ref:`async def `, as opposed to just a plain ``def``, makes " +"this an asynchronous function (or \"coroutine function\"). Calling it " +"creates and returns a :ref:`coroutine ` object." msgstr "" +":ref:`async def `، برخلاف تنها یک ``def`` ساده، این را به یک تابع" +" ناهمگام (یا «تابع هم‌روال») تبدیل می‌کند. فراخوانی آن یک شیء :ref:`هم‌روال" +" ` را ایجاد می‌کند و بازمی‌گرداند." msgid "" "async def loudmouth_penguin(magic_number: int):\n" @@ -107,23 +210,63 @@ msgid "" " f\"By the way, my lucky number is: {magic_number}.\"\n" " )" msgstr "" +"async def loudmouth_penguin(magic_number: int):\n" +" print(\n" +" \"I am a super special talking penguin. Far cooler than that printer. \"\n" +" f\"By the way, my lucky number is: {magic_number}.\"\n" +" )" -msgid "Calling the async function, ``loudmouth_penguin``, does not execute the print statement; instead, it creates a coroutine object::" +msgid "" +"Calling the async function, ``loudmouth_penguin``, does not execute the " +"print statement; instead, it creates a coroutine object::" msgstr "" +"فراخوانی تابع ناهمگام ``loudmouth_penguin``، دستور print را اجرا نمی‌کند؛ در" +" عوض، یک شیء هم‌روال ایجاد می‌کند::" msgid "" ">>> loudmouth_penguin(magic_number=3)\n" "" msgstr "" +">>> loudmouth_penguin(magic_number=3)\n" +"" -msgid "The terms \"coroutine function\" and \"coroutine object\" are often conflated as coroutine. That can be confusing! In this article, coroutine specifically refers to a coroutine object, or more precisely, an instance of :class:`types.CoroutineType` (native coroutine). Note that coroutines can also exist as instances of :class:`collections.abc.Coroutine` -- a distinction that matters for type checking." -msgstr "" +msgid "" +"The terms \"coroutine function\" and \"coroutine object\" are often " +"conflated as coroutine. That can be confusing! In this article, coroutine " +"specifically refers to a coroutine object, or more precisely, an instance of" +" :class:`types.CoroutineType` (native coroutine). Note that coroutines can " +"also exist as instances of :class:`collections.abc.Coroutine` -- a " +"distinction that matters for type checking." +msgstr "" +"اصطلاح‌های «تابع هم‌روال» و «شیء هم‌روال» اغلب به‌عنوان هم‌روال با هم خلط " +"می‌شوند. این می‌تواند گیج‌کننده باشد! در این مقاله، هم‌روال به‌طور مشخص به " +"یک شیء هم‌روال اشاره دارد، یا دقیق‌تر، به یک نمونه از " +":class:`types.CoroutineType` (هم‌روال بومی). توجه داشته باشید که هم‌روال‌ها " +"می‌توانند به‌عنوان نمونه‌هایی از :class:`collections.abc.Coroutine` نیز وجود" +" داشته باشند — تمایزی که برای بررسی نوع اهمیت دارد." -msgid "A coroutine represents the function's body or logic. A coroutine has to be explicitly started; again, merely creating the coroutine does not start it. Notably, the coroutine can be paused and resumed at various points within the function's body. That pausing and resuming ability is what allows for asynchronous behavior!" +msgid "" +"A coroutine represents the function's body or logic. A coroutine has to be " +"explicitly started; again, merely creating the coroutine does not start it. " +"Notably, the coroutine can be paused and resumed at various points within " +"the function's body. That pausing and resuming ability is what allows for " +"asynchronous behavior!" msgstr "" +"یک هم‌روال نمایانگر بدنه یا منطق تابع است. یک هم‌روال باید به‌صراحت آغاز " +"شود؛ باز هم، صرفاً ایجاد کردن هم‌روال، آن را آغاز نمی‌کند. به‌ویژه، هم‌روال " +"می‌تواند در نقاط مختلفی از بدنه تابع متوقف و از سر گرفته شود. همین توانایی " +"توقف و از سرگیری است که امکان رفتار ناهمگام را فراهم می‌کند!" -msgid "Coroutines and coroutine functions were built by leveraging the functionality of :term:`generators ` and :term:`generator functions `. Recall, a generator function is a function that :keyword:`yield`\\s, like this one::" +msgid "" +"Coroutines and coroutine functions were built by leveraging the " +"functionality of :term:`generators ` and " +":term:`generator functions `. Recall, a generator function is a " +"function that :keyword:`yield`\\s, like this one::" msgstr "" +"هم‌روال‌ها و توابع هم‌روال با بهره‌گیری از قابلیت :term:`تولیدگرها " +"` و :term:`توابع تولیدگر ` ساخته شده‌اند. به " +"یاد داشته باشید که تابع تولیدگر، تابعی است که :keyword:`yield` می‌کند، مانند" +" این تابع::" msgid "" "def get_random_number():\n" @@ -136,17 +279,37 @@ msgid "" " yield 4\n" " ..." msgstr "" +"def get_random_number():\n" +" # This would be a bad random number generator!\n" +" print(\"Hi\")\n" +" yield 1\n" +" print(\"Hello\")\n" +" yield 7\n" +" print(\"Howdy\")\n" +" yield 4\n" +" ..." -msgid "Similar to a coroutine function, calling a generator function does not run it. Instead, it creates a generator object::" +msgid "" +"Similar to a coroutine function, calling a generator function does not run " +"it. Instead, it creates a generator object::" msgstr "" +"همانند یک تابع هم‌روال، فراخوانی یک تابع تولیدگر آن را اجرا نمی‌کند. در عوض،" +" یک شیء تولیدگر ایجاد می‌کند::" msgid "" ">>> get_random_number()\n" "" msgstr "" +">>> get_random_number()\n" +"" -msgid "You can proceed to the next ``yield`` of a generator by using the built-in function :func:`next`. In other words, the generator runs, then pauses. For example::" +msgid "" +"You can proceed to the next ``yield`` of a generator by using the built-in " +"function :func:`next`. In other words, the generator runs, then pauses. For " +"example::" msgstr "" +"می‌توانید با استفاده از تابع توکار :func:`next` به ``yield`` بعدی یک تولیدگر" +" بروید. به عبارت دیگر، تولیدگر اجرا می‌شود، سپس مکث می‌کند. برای مثال::" msgid "" ">>> generator = get_random_number()\n" @@ -157,27 +320,73 @@ msgid "" "Hello\n" "7" msgstr "" +">>> generator = get_random_number()\n" +">>> next(generator)\n" +"Hi\n" +"1\n" +">>> next(generator)\n" +"Hello\n" +"7" msgid "Tasks" -msgstr "" +msgstr "وظایف" -msgid "Roughly speaking, :ref:`tasks ` are coroutines (not coroutine functions) tied to an event loop. A task also maintains a list of callback functions whose importance will become clear in a moment when we discuss :keyword:`await`. The recommended way to create tasks is via :func:`asyncio.create_task`." -msgstr "" +msgid "" +"Roughly speaking, :ref:`tasks ` are coroutines (not " +"coroutine functions) tied to an event loop. A task also maintains a list of " +"callback functions whose importance will become clear in a moment when we " +"discuss :keyword:`await`. The recommended way to create tasks is via " +":func:`asyncio.create_task`." +msgstr "" +"به‌طور تقریبی، :ref:`وظایف (tasks) ` هم‌روال‌هایی (نه " +"توابع هم‌روال) هستند که به یک حلقه رویداد وابسته‌اند. یک وظیفه نیز فهرستی از " +"توابع کال‌بک را نگه‌داری می‌کند که اهمیت آن‌ها لحظه‌ای دیگر، هنگامی که " +"درباره :keyword:`await` بحث می‌کنیم، روشن خواهد شد. روش توصیه‌شده برای ایجاد" +" وظایف، استفاده از :func:`asyncio.create_task` است." -msgid "Creating a task automatically schedules it for execution (by adding a callback to run it in the event loop's to-do list, that is, collection of jobs)." +msgid "" +"Creating a task automatically schedules it for execution (by adding a " +"callback to run it in the event loop's to-do list, that is, collection of " +"jobs)." msgstr "" +"ایجاد یک وظیفهبه‌طور خودکار آن را برای اجرا زمان‌بندی می‌کند (با " +"افزودن یک کال‌بک برای اجرای آن در فهرست کارهای حلقه رویداد، یعنی مجموعه‌ای " +"از کارها)." -msgid ":mod:`!asyncio` automatically associates tasks with the event loop for you. This automatic association was purposely designed into :mod:`!asyncio` for the sake of simplicity. Without it, you'd have to keep track of the event loop object and pass it to any coroutine function that wants to create tasks, adding redundant clutter to your code." -msgstr "" +msgid "" +":mod:`!asyncio` automatically associates tasks with the event loop for you. " +"This automatic association was purposely designed into :mod:`!asyncio` for " +"the sake of simplicity. Without it, you'd have to keep track of the event " +"loop object and pass it to any coroutine function that wants to create " +"tasks, adding redundant clutter to your code." +msgstr "" +":mod:`!asyncio` به‌طور خودکار وظایف (tasks) را برای شما به حلقه رویداد " +"مرتبط می‌کند. این ارتباط خودکار عمداً برای سادگی در :mod:`!asyncio` طراحی " +"شده است. بدون آن، شما باید شیء حلقه رویداد را پیگیری کنید و آن را به هر تابع" +" هم‌روالی که بخواهد وظایف را ایجاد کند، بفرستید، که این کار باعث ایجاد " +"شلوغی اضافی در کد شما می‌شود." msgid "" "coroutine = loudmouth_penguin(magic_number=5)\n" "# This creates a Task object and schedules its execution via the event loop.\n" "task = asyncio.create_task(coroutine)" msgstr "" +"coroutine = loudmouth_penguin(magic_number=5)\n" +"# این یک شیء Task ایجاد می‌کند و اجرای آن را از طریق حلقه رویداد زمان‌بندی می‌کند.\n" +"task = asyncio.create_task(coroutine)" -msgid "Earlier, we manually created the event loop and set it to run forever. In practice, it's recommended to use (and common to see) :func:`asyncio.run`, which takes care of managing the event loop and ensuring the provided coroutine finishes before advancing. For example, many async programs follow this setup::" -msgstr "" +msgid "" +"Earlier, we manually created the event loop and set it to run forever. In " +"practice, it's recommended to use (and common to see) :func:`asyncio.run`, " +"which takes care of managing the event loop and ensuring the provided " +"coroutine finishes before advancing. For example, many async programs follow" +" this setup::" +msgstr "" +"پیش‌تر، حلقه رویداد را به‌صورت دستی ایجاد کردیم و آن را تنظیم کردیم تا برای " +"همیشه اجرا شود. در عمل، توصیه می‌شود (و رایج است) از :func:`asyncio.run` " +"استفاده کنید، که مدیریت حلقه رویداد را بر عهده می‌گیرد و تضمین می‌کند که " +"هم‌روال ارائه‌شده پیش از ادامه به پایان برسد. برای مثال، بسیاری از " +"برنامه‌های ناهمگام از این پیکربندی پیروی می‌کنند::" msgid "" "import asyncio\n" @@ -192,9 +401,28 @@ msgid "" " # coroutine main() finishes.\n" " print(\"coroutine main() is done!\")" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" # Perform all sorts of wacky, wild asynchronous things...\n" +" ...\n" +"\n" +"if __name__ == \"__main__\":\n" +" asyncio.run(main())\n" +" # The program will not reach the following print statement until the\n" +" # coroutine main() finishes.\n" +" print(\"coroutine main() is done!\")" -msgid "It's important to be aware that the task itself is not added to the event loop, only a callback to the task is. This matters if the task object you created is garbage collected before it's called by the event loop. For example, consider this program:" +msgid "" +"It's important to be aware that the task itself is not added to the event " +"loop, only a callback to the task is. This matters if the task object you " +"created is garbage collected before it's called by the event loop. For " +"example, consider this program:" msgstr "" +"مهم است بدانید که خود وظیفهبه حلقه رویداد اضافه نمی‌شود، بلکه تنها " +"یک کال‌بک به آن اضافه می‌شود. اگر شیء وظیفه‌ای که شما ایجاد کرده‌اید پیش از " +"آنکه توسط حلقه رویداد فراخوانی شود زباله‌روبی شود، این موضوع اهمیت دارد. " +"برای مثال، این برنامه را در نظر بگیرید:" msgid "" "async def hello():\n" @@ -208,26 +436,73 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def hello():\n" +" print(\"hello!\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(hello())\n" +" # سایر دستورالعمل‌های ناهمگام که برای مدتی اجرا می‌شوند\n" +" # و کنترل را به حلقه رویداد واگذار می‌کنند...\n" +" ...\n" +"\n" +"asyncio.run(main())" -msgid "Because there's no reference to the task object created on line 5, it *might* be garbage collected before the event loop invokes it. Later instructions in the coroutine ``main()`` hand control back to the event loop so it can invoke other jobs. When the event loop eventually tries to run the task, it might fail and discover the task object does not exist! This can also happen even if a coroutine keeps a reference to a task but completes before that task finishes. When the coroutine exits, local variables go out of scope and may be subject to garbage collection. In practice, ``asyncio`` and Python's garbage collector work pretty hard to ensure this sort of thing doesn't happen. But that's no reason to be reckless!" -msgstr "" +msgid "" +"Because there's no reference to the task object created on line 5, it " +"*might* be garbage collected before the event loop invokes it. Later " +"instructions in the coroutine ``main()`` hand control back to the event loop" +" so it can invoke other jobs. When the event loop eventually tries to run " +"the task, it might fail and discover the task object does not exist! This " +"can also happen even if a coroutine keeps a reference to a task but " +"completes before that task finishes. When the coroutine exits, local " +"variables go out of scope and may be subject to garbage collection. In " +"practice, ``asyncio`` and Python's garbage collector work pretty hard to " +"ensure this sort of thing doesn't happen. But that's no reason to be " +"reckless!" +msgstr "" +"از آنجا که هیچ ارجاعی به شیء وظیفه‌ی ایجادشده در خط ۵ وجود ندارد، *ممکن است*" +" پیش از آنکه حلقه رویداد آن را فراخوانی کند، زباله‌روبی شود. دستورهای بعدی " +"در هم‌روال ``main()`` کنترل را به حلقه رویداد بازمی‌گردانند تا بتواند کارهای" +" دیگر را فراخوانی کند. وقتی حلقه رویداد سرانجام تلاش می‌کند تا وظیفه را اجرا" +" کند، ممکن است با شکست مواجه شود و متوجه شود که شیء وظیفه وجود ندارد! این " +"اتفاق نیز ممکن است حتی در صورتی رخ دهد که یک هم‌روال ارجاعی به یک وظیفه نگه " +"دارد، اما پیش از آنکه آن وظیفه تمام شود، به پایان برسد. هنگامی که هم‌روال " +"خارج می‌شود، متغیرهای محلی از محدوده خارج می‌شوند و ممکن است مشمول " +"زباله‌روبی شوند. در عمل، ``asyncio`` و زباله‌روی پایتون تلاش زیادی می‌کنند " +"تا اطمینان حاصل کنند که این قبیل موارد رخ نمی‌دهد. اما این دلیلی برای " +"بی‌احتیاطی نیست!" msgid "await" -msgstr "" +msgstr "await" -msgid ":keyword:`await` is a Python keyword that's commonly used in one of two different ways::" +msgid "" +":keyword:`await` is a Python keyword that's commonly used in one of two " +"different ways::" msgstr "" +":keyword:`await` یک کلیدواژه پایتون است که معمولاً به یکی از دو روش متفاوت " +"استفاده می‌شود::" msgid "" "await task\n" "await coroutine" msgstr "" +"await task\n" +"await coroutine" -msgid "In a crucial way, the behavior of ``await`` depends on the type of object being awaited." +msgid "" +"In a crucial way, the behavior of ``await`` depends on the type of object " +"being awaited." msgstr "" +"به‌شکلی اساسی، رفتار ``await`` به نوع شیء‌ای که await می‌شود بستگی دارد." -msgid "Awaiting a task will cede control from the current task or coroutine to the event loop. In the process of relinquishing control, a few important things happen. We'll use the following code example to illustrate::" +msgid "" +"Awaiting a task will cede control from the current task or coroutine to the " +"event loop. In the process of relinquishing control, a few important things " +"happen. We'll use the following code example to illustrate::" msgstr "" +"await کردن یک task، کنترل را از task یا هم‌روال فعلی به حلقه رویداد واگذار " +"می‌کند. در فرآیند واگذاری کنترل، چند اتفاق مهم رخ می‌دهد. برای نشان دادن این" +" موضوع از مثال کد زیر استفاده می‌کنیم::" msgid "" "async def plant_a_tree():\n" @@ -237,18 +512,63 @@ msgid "" " # Other instructions associated with planting a tree.\n" " ..." msgstr "" +"async def plant_a_tree():\n" +" dig_the_hole_task = asyncio.create_task(dig_the_hole())\n" +" await dig_the_hole_task\n" +"\n" +" # Other instructions associated with planting a tree.\n" +" ..." -msgid "In this example, imagine the event loop has passed control to the start of the coroutine ``plant_a_tree()``. As seen above, the coroutine creates a task and then awaits it. The ``await dig_the_hole_task`` instruction adds a callback (which will resume ``plant_a_tree()``) to the ``dig_the_hole_task`` object's list of callbacks. And then, the instruction cedes control to the event loop. Some time later, the event loop will pass control to ``dig_the_hole_task`` and the task will finish whatever it needs to do. Once the task finishes, it will add its various callbacks to the event loop, in this case, a call to resume ``plant_a_tree()``." -msgstr "" +msgid "" +"In this example, imagine the event loop has passed control to the start of " +"the coroutine ``plant_a_tree()``. As seen above, the coroutine creates a " +"task and then awaits it. The ``await dig_the_hole_task`` instruction adds a " +"callback (which will resume ``plant_a_tree()``) to the ``dig_the_hole_task``" +" object's list of callbacks. And then, the instruction cedes control to the " +"event loop. Some time later, the event loop will pass control to " +"``dig_the_hole_task`` and the task will finish whatever it needs to do. Once" +" the task finishes, it will add its various callbacks to the event loop, in " +"this case, a call to resume ``plant_a_tree()``." +msgstr "" +"در این مثال، تصور کنید حلقه رویداد کنترل را به آغاز هم‌روال " +"``plant_a_tree()`` واگذار کرده است. همان‌طور که در بالا دیده شد، این هم‌روال" +" یک وظیفهایجاد می‌کند و سپس آن را await می‌کند. دستور ``await " +"dig_the_hole_task`` یک کال‌بک (که ``plant_a_tree()`` را از سر خواهد گرفت) به" +" فهرست کال‌بک‌های شیء ``dig_the_hole_task`` اضافه می‌کند. و سپس، این دستور " +"کنترل را به حلقه رویداد واگذار می‌کند. چندی بعد، حلقه رویداد کنترل را به " +"``dig_the_hole_task`` واگذار خواهد کرد و وظیفه هر کاری را که لازم است انجام " +"دهد به پایان خواهد رساند. پس از پایان وظیفه، وظیفه کال‌بک‌های مختلف خود را به " +"حلقه رویداد اضافه خواهد کرد که در این مورد، یک فراخوانی برای از سرگیری " +"``plant_a_tree()`` است." -msgid "Generally speaking, when the awaited task finishes (``dig_the_hole_task``), the original task or coroutine (``plant_a_tree()``) is added back to the event loop's to-do list to be resumed." +msgid "" +"Generally speaking, when the awaited task finishes (``dig_the_hole_task``), " +"the original task or coroutine (``plant_a_tree()``) is added back to the " +"event loop's to-do list to be resumed." msgstr "" +"به‌طور کلی، هنگامی که وظیفه awaitشده (``dig_the_hole_task``) تمام می‌شود، وظیفه" +" یا هم‌روال اصلی (``plant_a_tree()``) دوباره به فهرست کارهای حلقه رویداد " +"اضافه می‌شود تا از سر گرفته شود." -msgid "This is a basic, yet reliable mental model. In practice, the control handoffs are slightly more complex, but not by much. In part 2, we'll walk through the details that make this possible." +msgid "" +"This is a basic, yet reliable mental model. In practice, the control " +"handoffs are slightly more complex, but not by much. In part 2, we'll walk " +"through the details that make this possible." msgstr "" +"این یک مدل ذهنی پایه‌ای، اما قابل‌اتکا است. در عمل، انتقال‌های کنترل کمی " +"پیچیده‌تر هستند، اما نه چندان زیاد. در بخش ۲، جزئیاتی را که این امر را ممکن " +"می‌سازند، بررسی خواهیم کرد." -msgid "**Unlike tasks, awaiting a coroutine does not hand control back to the event loop!** Wrapping a coroutine in a task first, then awaiting that would cede control. The behavior of ``await coroutine`` is effectively the same as invoking a regular, synchronous Python function. Consider this program::" +msgid "" +"**Unlike tasks, awaiting a coroutine does not hand control back to the event" +" loop!** Wrapping a coroutine in a task first, then awaiting that would cede" +" control. The behavior of ``await coroutine`` is effectively the same as " +"invoking a regular, synchronous Python function. Consider this program::" msgstr "" +"برخلاف وظایف ، await کردن یک هم‌روال کنترل را به حلقه رویداد " +"بازنمی‌گرداند! قرار دادن یک هم‌روال در یک وظیفه و سپس await کردن آن، کنترل " +"را واگذار می‌کند. رفتار ``await coroutine`` عملاً همانند فراخوانی یک تابع " +"پایتون عادی و همگام است. این برنامه را در نظر بگیرید::" msgid "" "import asyncio\n" @@ -268,9 +588,34 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def coro_a():\n" +" print(\"I am coro_a(). Hi!\")\n" +"\n" +"async def coro_b():\n" +" print(\"I am coro_b(). I sure hope no one hogs the event loop...\")\n" +"\n" +"async def main():\n" +" task_b = asyncio.create_task(coro_b())\n" +" num_repeats = 3\n" +" for _ in range(num_repeats):\n" +" await coro_a()\n" +" await task_b\n" +"\n" +"asyncio.run(main())" -msgid "The first statement in the coroutine ``main()`` creates ``task_b`` and schedules it for execution via the event loop. Then, ``coro_a()`` is repeatedly awaited. Control never cedes to the event loop, which is why we see the output of all three ``coro_a()`` invocations before ``coro_b()``'s output:" +msgid "" +"The first statement in the coroutine ``main()`` creates ``task_b`` and " +"schedules it for execution via the event loop. Then, ``coro_a()`` is " +"repeatedly awaited. Control never cedes to the event loop, which is why we " +"see the output of all three ``coro_a()`` invocations before ``coro_b()``'s " +"output:" msgstr "" +"اولین دستور در هم‌روال ``main()``، ``task_b`` را ایجاد می‌کند و آن را برای " +"اجرا از طریق حلقه رویداد زمان‌بندی می‌کند. سپس، ``coro_a()`` به‌طور مکرر " +"await می‌شود. کنترل هرگز به حلقه رویداد واگذار نمی‌شود، به همین دلیل خروجی " +"هر سه فراخوانی ``coro_a()`` را پیش از خروجی ``coro_b()`` می‌بینیم:" msgid "" "I am coro_a(). Hi!\n" @@ -278,9 +623,23 @@ msgid "" "I am coro_a(). Hi!\n" "I am coro_b(). I sure hope no one hogs the event loop..." msgstr "" +"من coro_a() هستم. سلام!\n" +"من coro_a() هستم. سلام!\n" +"من coro_a() هستم. سلام!\n" +"من coro_b() هستم. واقعاً امیدوارم هیچ‌کس حلقه رویداد را در انحصار خود نگیرد..." -msgid "If we change ``await coro_a()`` to ``await asyncio.create_task(coro_a())``, the behavior changes. The coroutine ``main()`` cedes control to the event loop with that statement. The event loop then proceeds through its backlog of work, calling ``task_b`` and then the task which wraps ``coro_a()`` before resuming the coroutine ``main()``." -msgstr "" +msgid "" +"If we change ``await coro_a()`` to ``await asyncio.create_task(coro_a())``, " +"the behavior changes. The coroutine ``main()`` cedes control to the event " +"loop with that statement. The event loop then proceeds through its backlog " +"of work, calling ``task_b`` and then the task which wraps ``coro_a()`` " +"before resuming the coroutine ``main()``." +msgstr "" +"اگر ``await coro_a()`` را به ``await asyncio.create_task(coro_a())`` تغییر " +"دهیم، رفتار تغییر می‌کند. هم‌روال ``main()`` با آن دستور، کنترل را به حلقه " +"رویداد واگذار می‌کند. سپس حلقه رویداد کارهای معوق خود را پیش می‌برد، " +"``task_b`` و سپس وظیفهی را که ``coro_a()`` را می‌پوشاند فراخوانی می‌کند، پیش " +"از آنکه هم‌روال ``main()`` را از سر بگیرد." msgid "" "I am coro_b(). I sure hope no one hogs the event loop...\n" @@ -288,27 +647,74 @@ msgid "" "I am coro_a(). Hi!\n" "I am coro_a(). Hi!" msgstr "" +"من coro_b() هستم. واقعاً امیدوارم هیچ‌کس حلقه رویداد را تصاحب نکند...\n" +"من coro_a() هستم. سلام!\n" +"من coro_a() هستم. سلام!\n" +"من coro_a() هستم. سلام!" -msgid "This behavior of ``await coroutine`` can trip a lot of people up! That example highlights how using only ``await coroutine`` could unintentionally hog control from other tasks and effectively stall the event loop. :func:`asyncio.run` can help you detect such occurrences via the ``debug=True`` flag, which enables :ref:`debug mode `. Among other things, it will log any coroutines that monopolize execution for 100ms or longer." -msgstr "" +msgid "" +"This behavior of ``await coroutine`` can trip a lot of people up! That " +"example highlights how using only ``await coroutine`` could unintentionally " +"hog control from other tasks and effectively stall the event loop. " +":func:`asyncio.run` can help you detect such occurrences via the " +"``debug=True`` flag, which enables :ref:`debug mode `. " +"Among other things, it will log any coroutines that monopolize execution for" +" 100ms or longer." +msgstr "" +"این رفتار ``await coroutine`` می‌تواند بسیاری از افراد را دچار اشتباه کند! " +"آن مثال نشان می‌دهد که چگونه استفاده‌ی صرف از ``await coroutine`` می‌تواند " +"به‌طور غیرعمدی کنترل را از سایر وظایف تصاحب کند و عملاً حلقه رویداد را متوقف" +" کند. :func:`asyncio.run` می‌تواند به شما کمک کند تا چنین مواردی را از طریق " +"پرچم ``debug=True`` تشخیص دهید، که :ref:`حالت اشکال‌زدایی ` را فعال می‌کند. در میان سایر موارد، این حالت هر هم‌روالی را که اجرا " +"را برای ۱۰۰ میلی‌ثانیه یا بیشتر در انحصار خود می‌گیرد، ثبت می‌کند." -msgid "The design intentionally trades off some conceptual clarity around usage of ``await`` for improved performance. Each time a task is awaited, control needs to be passed all the way up the call stack to the event loop. That might sound minor, but in a large program with many ``await`` statements and a deep call stack, that overhead can add up to a meaningful performance drag." -msgstr "" +msgid "" +"The design intentionally trades off some conceptual clarity around usage of " +"``await`` for improved performance. Each time a task is awaited, control " +"needs to be passed all the way up the call stack to the event loop. That " +"might sound minor, but in a large program with many ``await`` statements and" +" a deep call stack, that overhead can add up to a meaningful performance " +"drag." +msgstr "" +"طراحی عمداً تا حدی وضوح مفهومی پیرامون استفاده از ``await`` را با بهبود " +"عملکرد معاوضه می‌کند. هر بار که یک وظیفه در انتظار قرار می‌گیرد، " +"کنترل باید از کل پشته فراخوانی به حلقه رویداد منتقل شود. ممکن است این موضوع " +"جزئی به نظر برسد، اما در یک برنامه بزرگ با تعداد زیادی دستور ``await`` و " +"پشته فراخوانی عمیق، این سربار می‌تواند به افت عملکرد قابل‌توجهی منجر شود." msgid "A conceptual overview part 2: the nuts and bolts" -msgstr "" +msgstr "مرور کلی مفهومی، بخش ۲: جزئیات عملی" -msgid "Part 2 goes into detail on the mechanisms :mod:`!asyncio` uses to manage control flow. This is where the magic happens. You'll come away from this section knowing what ``await`` does behind the scenes and how to make your own asynchronous operators." +msgid "" +"Part 2 goes into detail on the mechanisms :mod:`!asyncio` uses to manage " +"control flow. This is where the magic happens. You'll come away from this " +"section knowing what ``await`` does behind the scenes and how to make your " +"own asynchronous operators." msgstr "" +"بخش ۲ به تفصیل به سازوکارهایی می‌پردازد که :mod:`!asyncio` برای مدیریت جریان" +" کنترل به کار می‌برد. اینجاست که جادو رخ می‌دهد. پس از این بخش، خواهید دانست" +" که ``await`` در پشت صحنه چه کاری انجام می‌دهد و چگونه عملگرهای ناهمگام " +"خودتان را بسازید." msgid "The inner workings of coroutines" -msgstr "" +msgstr "سازوکار درونی هم‌روال‌ها" msgid ":mod:`!asyncio` leverages four components to pass around control." -msgstr "" +msgstr ":mod:`!asyncio` برای جابه‌جایی کنترل از چهار کامپوننت بهره می‌گیرد." -msgid ":meth:`coroutine.send(arg) ` is the method used to start or resume a coroutine. If the coroutine was paused and is now being resumed, the argument ``arg`` will be sent in as the return value of the ``yield`` statement which originally paused it. If the coroutine is being used for the first time (as opposed to being resumed), ``arg`` must be ``None``." -msgstr "" +msgid "" +":meth:`coroutine.send(arg) ` is the method used to start or " +"resume a coroutine. If the coroutine was paused and is now being resumed, " +"the argument ``arg`` will be sent in as the return value of the ``yield`` " +"statement which originally paused it. If the coroutine is being used for the" +" first time (as opposed to being resumed), ``arg`` must be ``None``." +msgstr "" +":meth:`coroutine.send(arg) ` متدی است که برای آغاز یا از سر " +"گرفتن یک هم‌روال به کار می‌رود. اگر هم‌روال متوقف شده باشد و اکنون از سر " +"گرفته شود، آرگومان ``arg`` به‌عنوان مقدار بازگشتی دستور ``yield`` که در " +"ابتدا آن را متوقف کرده بود، فرستاده می‌شود. اگر هم‌روال برای اولین بار " +"استفاده شود (نه اینکه از سر گرفته شود)، ``arg`` باید ``None`` باشد." msgid "" "class Rock:\n" @@ -336,15 +742,63 @@ msgid "" " returned_value = e.value\n" "print(f\"Coroutine main() finished and provided value: {returned_value}.\")" msgstr "" +"class Rock:\n" +" def __await__(self):\n" +" value_sent_in = yield 7\n" +" print(f\"Rock.__await__ resuming with value: {value_sent_in}.\")\n" +" return value_sent_in\n" +"\n" +"async def main():\n" +" print(\"Beginning coroutine main().\")\n" +" rock = Rock()\n" +" print(\"Awaiting rock...\")\n" +" value_from_rock = await rock\n" +" print(f\"Coroutine received value: {value_from_rock} from rock.\")\n" +" return 23\n" +"\n" +"coroutine = main()\n" +"intermediate_result = coroutine.send(None)\n" +"print(f\"Coroutine paused and returned intermediate value: {intermediate_result}.\")\n" +"\n" +"print(f\"Resuming coroutine and sending in value: 42.\")\n" +"try:\n" +" coroutine.send(42)\n" +"except StopIteration as e:\n" +" returned_value = e.value\n" +"print(f\"Coroutine main() finished and provided value: {returned_value}.\")" -msgid ":ref:`yield `, as usual, pauses execution and returns control to the caller. In the example above, the ``yield``, on line 3, is called by ``... = await rock`` on line 11. More broadly speaking, ``await`` calls the :meth:`~object.__await__` method of the given object. ``await`` also does one more very special thing: it propagates (or \"passes along\") any ``yield``\\ s it receives up the call chain. In this case, that's back to ``... = coroutine.send(None)`` on line 16." -msgstr "" +msgid "" +":ref:`yield `, as usual, pauses execution and returns control to " +"the caller. In the example above, the ``yield``, on line 3, is called by " +"``... = await rock`` on line 11. More broadly speaking, ``await`` calls the " +":meth:`~object.__await__` method of the given object. ``await`` also does " +"one more very special thing: it propagates (or \"passes along\") any " +"``yield``\\ s it receives up the call chain. In this case, that's back to " +"``... = coroutine.send(None)`` on line 16." +msgstr "" +":ref:`yield `، مانند همیشه، اجرا را متوقف می‌کند و کنترل را به " +"فراخوان بازمی‌گرداند. در مثال بالا، ``yield`` در خط ۳ توسط ``... = await " +"rock`` در خط ۱۱ فراخوانی می‌شود. به‌طور کلی‌تر، ``await`` متد " +":meth:`~object.__await__` شیء داده‌شده را فراخوانی می‌کند. ``await`` یک کار " +"بسیار خاص دیگر نیز انجام می‌دهد: هر ``yield``\\ s را که دریافت می‌کند، در " +"زنجیره‌ی فراخوانی به بالا منتشر (یا «منتقل») می‌کند. در این حالت، این مورد به" +" ``... = coroutine.send(None)`` در خط ۱۶ بازمی‌گردد." -msgid "The coroutine is resumed via the ``coroutine.send(42)`` call on line 21. The coroutine picks back up from where it ``yield``\\ ed (or paused) on line 3 and executes the remaining statements in its body. When a coroutine finishes, it raises a :exc:`StopIteration` exception with the return value attached in the :attr:`~StopIteration.value` attribute." -msgstr "" +msgid "" +"The coroutine is resumed via the ``coroutine.send(42)`` call on line 21. The" +" coroutine picks back up from where it ``yield``\\ ed (or paused) on line 3 " +"and executes the remaining statements in its body. When a coroutine " +"finishes, it raises a :exc:`StopIteration` exception with the return value " +"attached in the :attr:`~StopIteration.value` attribute." +msgstr "" +"هم‌روال از طریق فراخوانی ``coroutine.send(42)`` در خط ۲۱ از سر گرفته می‌شود." +" هم‌روال از همان جایی که در خط ۳ ``yield`` داده بود (یا مکث کرده بود) ادامه " +"می‌یابد و دستورهای باقی‌مانده در بدنه‌ی خود را اجرا می‌کند. هنگامی که یک " +"هم‌روال به پایان می‌رسد، استثنای :exc:`StopIteration` را همراه با مقدار " +"بازگشتی پیوست‌شده در ویژگی :attr:`~StopIteration.value` پرتاب می‌کند." msgid "That snippet produces this output:" -msgstr "" +msgstr "آن قطعه‌کد این خروجی را تولید می‌کند:" msgid "" "Beginning coroutine main().\n" @@ -355,42 +809,132 @@ msgid "" "Coroutine received value: 42 from rock.\n" "Coroutine main() finished and provided value: 23." msgstr "" +"آغاز هم‌روال main().\n" +"در حال await برای rock...\n" +"هم‌روال مکث کرد و مقدار میانی را برگرداند: ۷.\n" +"از سرگیری هم‌روال و ارسال مقدار: ۴۲.\n" +"از سرگیری Rock.__await__ با مقدار: ۴۲.\n" +"هم‌روال مقدار را دریافت کرد: ۴۲ از rock.\n" +"هم‌روال main() پایان یافت و مقدار را ارائه کرد: ۲۳." -msgid "It's worth pausing for a moment here and making sure you followed the various ways that control flow and values were passed. A lot of important ideas were covered and it's worth ensuring your understanding is firm." +msgid "" +"It's worth pausing for a moment here and making sure you followed the " +"various ways that control flow and values were passed. A lot of important " +"ideas were covered and it's worth ensuring your understanding is firm." msgstr "" +"ارزش دارد که در اینجا لحظه‌ای درنگ کنید و اطمینان حاصل کنید که روش‌های " +"مختلفی را که جریان کنترل و مقادیر از طریق آن‌ها منتقل می‌شدند، دنبال " +"کرده‌اید. ایده‌های مهم بسیاری پوشش داده شد و ارزش دارد که اطمینان حاصل کنید " +"درک شما استوار است." -msgid "The only way to yield (or effectively cede control) from a coroutine is to ``await`` an object that ``yield``\\ s in its ``__await__`` method. That might sound odd to you. You might be thinking:" +msgid "" +"The only way to yield (or effectively cede control) from a coroutine is to " +"``await`` an object that ``yield``\\ s in its ``__await__`` method. That " +"might sound odd to you. You might be thinking:" msgstr "" +"تنها راه برای yield کردن از یک هم‌روال (یا عملاً واگذار کردن کنترل) این است " +"که شیئی را ``await`` کنید که در متد ``__await__`` خود ``yield`` می‌کند. ممکن" +" است این موضوع برای شما عجیب به نظر برسد. شاید فکر کنید:" -msgid "1. What about a ``yield`` directly within the coroutine function? The coroutine function becomes an :ref:`async generator function `, a different beast entirely." +msgid "" +"1. What about a ``yield`` directly within the coroutine function? The " +"coroutine function becomes an :ref:`async generator function `, a different beast entirely." msgstr "" +"۱. اگر یک ``yield`` به‌طور مستقیم درون تابع هم‌روال باشد چطور؟ تابع هم‌روال " +"به یک :ref:`تابع تولیدگر ناهمگام ` تبدیل " +"می‌شود، که به‌کلی مقوله‌ای متفاوت است." -msgid "2. What about a :ref:`yield from ` within the coroutine function to a (plain) generator? That causes the error: ``SyntaxError: yield from not allowed in a coroutine.`` This was intentionally designed for the sake of simplicity -- mandating only one way of using coroutines. Initially ``yield`` was barred as well, but was re-accepted to allow for async generators. Despite that, ``yield from`` and ``await`` effectively do the same thing." -msgstr "" +msgid "" +"2. What about a :ref:`yield from ` within the coroutine function " +"to a (plain) generator? That causes the error: ``SyntaxError: yield from not" +" allowed in a coroutine.`` This was intentionally designed for the sake of " +"simplicity -- mandating only one way of using coroutines. Initially " +"``yield`` was barred as well, but was re-accepted to allow for async " +"generators. Despite that, ``yield from`` and ``await`` effectively do the " +"same thing." +msgstr "" +"۲. اگر درون تابع هم‌روال، یک :ref:`yield from ` به یک تولیدگر " +"(ساده) داشته باشید، چه؟ این باعث خطای زیر می‌شود: ``SyntaxError: yield from " +"not allowed in a coroutine.`` این به‌عمد به‌خاطر سادگی طراحی شده است — تا " +"تنها یک روش برای استفاده از هم‌روال‌ها الزامی باشد. در ابتدا ``yield`` نیز " +"ممنوع بود، اما برای امکان‌پذیر شدن تولیدگرهای ناهمگام دوباره پذیرفته شد. با " +"وجود این، ``yield from`` و ``await`` عملاً کار یکسانی انجام می‌دهند." msgid "Futures" -msgstr "" +msgstr "آینده‌نماها (Futures)" -msgid "A :ref:`future ` is an object meant to represent a computation's status and result. The term is a nod to the idea of something still to come or not yet happened, and the object is a way to keep an eye on that something." +msgid "" +"A :ref:`future ` is an object meant to represent a " +"computation's status and result. The term is a nod to the idea of something " +"still to come or not yet happened, and the object is a way to keep an eye on" +" that something." msgstr "" +"یک :ref:`future ` شیئی است که برای نمایش وضعیت و نتیجه‌ی " +"یک محاسبه در نظر گرفته شده است. این اصطلاح اشاره‌ای به مفهوم چیزی است که " +"هنوز در راه است یا هنوز رخ نداده است، و این شیء راهی برای نظارت بر آن چیز " +"است." -msgid "A future has a few important attributes. One is its state, which can be either \"pending\", \"cancelled\", or \"done\". Another is its result, which is set when the state transitions to done. Unlike a coroutine, a future does not represent the actual computation to be done; instead, it represents the status and result of that computation, kind of like a status light (red, yellow, or green) or indicator." -msgstr "" +msgid "" +"A future has a few important attributes. One is its state, which can be " +"either \"pending\", \"cancelled\", or \"done\". Another is its result, which" +" is set when the state transitions to done. Unlike a coroutine, a future " +"does not represent the actual computation to be done; instead, it represents" +" the status and result of that computation, kind of like a status light " +"(red, yellow, or green) or indicator." +msgstr "" +"یک آینده (future) چند ویژگی مهم دارد. یکی از آن‌ها وضعیت آن است، که می‌تواند" +" \"pending\"، \"cancelled\" یا \"done\" باشد. دیگری نتیجه آن است، که با " +"تغییر وضعیت به done تنظیم می‌شود. برخلاف یک هم‌روال، آینده (future) بیانگر " +"محاسبه واقعی که قرار است انجام شود نیست؛ در عوض، وضعیت و نتیجه آن محاسبه را " +"نشان می‌دهد، تقریباً مانند چراغ وضعیت (قرمز، زرد یا سبز) یا نشانگر." -msgid ":class:`asyncio.Task` subclasses :class:`asyncio.Future` in order to gain these various capabilities. The prior section said tasks store a list of callbacks, which wasn't entirely accurate. It's actually the ``Future`` class that implements this logic, which ``Task`` inherits." +msgid "" +":class:`asyncio.Task` subclasses :class:`asyncio.Future` in order to gain " +"these various capabilities. The prior section said tasks store a list of " +"callbacks, which wasn't entirely accurate. It's actually the ``Future`` " +"class that implements this logic, which ``Task`` inherits." msgstr "" +":class:`asyncio.Task` زیرکلاسی از :class:`asyncio.Future` است تا این " +"قابلیت‌های گوناگون را کسب کند. در بخش پیشین گفته شد که Taskها فهرستی از " +"کال‌بک‌ها را ذخیره می‌کنند، که کاملاً دقیق نبود. در واقع این کلاس ``Future``" +" است که این منطق را پیاده‌سازی می‌کند و ``Task`` آن را به ارث می‌برد." -msgid "Futures may also be used directly (not via tasks). Tasks mark themselves as done when their coroutine is complete. Futures are much more versatile and will be marked as done when you say so. In this way, they're the flexible interface for you to make your own conditions for waiting and resuming." -msgstr "" +msgid "" +"Futures may also be used directly (not via tasks). Tasks mark themselves as " +"done when their coroutine is complete. Futures are much more versatile and " +"will be marked as done when you say so. In this way, they're the flexible " +"interface for you to make your own conditions for waiting and resuming." +msgstr "" +"همچنین می‌توان از آینده‌نماها (Futures) به‌صورت مستقیم (نه از طریق وظایف " +"(tasks)) استفاده کرد. وظایف خود را هنگامی که هم‌روال آن‌ها به پایان برسد، " +"به‌عنوان انجام‌شده علامت‌گذاری می‌کنند. آینده‌نماها بسیار چندمنظوره‌تر هستند و " +"هنگامی که شما تعیین کنید، به‌عنوان انجام‌شده علامت‌گذاری می‌شوند. به این " +"ترتیب، آن‌ها رابطی انعطاف‌پذیر هستند که به شما امکان می‌دهند شرایط خودتان را" +" برای انتظار و ازسرگیری ایجاد کنید." msgid "A homemade asyncio.sleep" -msgstr "" +msgstr "یک asyncio.sleep دست‌ساز" -msgid "We'll go through an example of how you could leverage a future to create your own variant of asynchronous sleep (``async_sleep``) which mimics :func:`asyncio.sleep`." +msgid "" +"We'll go through an example of how you could leverage a future to create " +"your own variant of asynchronous sleep (``async_sleep``) which mimics " +":func:`asyncio.sleep`." msgstr "" +"در مثالی بررسی می‌کنیم که چگونه می‌توانید از یک آینده (future) برای ایجاد " +"نسخه‌ی اختصاصی خودتان از توقف ناهمگام (``async_sleep``) که همانند " +":func:`asyncio.sleep` رفتار می‌کند، بهره بگیرید." -msgid "This snippet registers a few tasks with the event loop and then awaits the task created by ``asyncio.create_task``, which wraps the ``async_sleep(3)`` coroutine. We want that task to finish only after three seconds have elapsed, but without preventing other tasks from running." +msgid "" +"This snippet registers a few tasks with the event loop and then awaits the " +"task created by ``asyncio.create_task``, which wraps the ``async_sleep(3)`` " +"coroutine. We want that task to finish only after three seconds have " +"elapsed, but without preventing other tasks from running." msgstr "" +"این قطعه‌کد چند وظیفهرا در حلقه‌ی رویداد ثبت می‌کند و سپس وظیفه‌ی " +"ایجادشده توسط ``asyncio.create_task`` را await می‌کند، که هم‌روال " +"``async_sleep(3)`` را در بر می‌گیرد. ما می‌خواهیم آن وظیفه تنها پس از گذشت " +"سه ثانیه به پایان برسد، اما بدون این‌که مانع اجرای سایر وظایف شود." msgid "" "async def other_work():\n" @@ -416,9 +960,44 @@ msgid "" " # asyncio.gather effectively awaits each task in the collection.\n" " await asyncio.gather(*work_tasks)" msgstr "" +"async def other_work():\n" +" print(\"I like work. Work work.\")\n" +"\n" +"async def main():\n" +" # Add a few other tasks to the event loop, so there's something\n" +" # to do while asynchronously sleeping.\n" +" work_tasks = [\n" +" asyncio.create_task(other_work()),\n" +" asyncio.create_task(other_work()),\n" +" asyncio.create_task(other_work())\n" +" ]\n" +" print(\n" +" \"Beginning asynchronous sleep at time: \"\n" +" f\"{datetime.datetime.now().strftime(\"%H:%M:%S\")}.\"\n" +" )\n" +" await asyncio.create_task(async_sleep(3))\n" +" print(\n" +" \"Done asynchronous sleep at time: \"\n" +" f\"{datetime.datetime.now().strftime(\"%H:%M:%S\")}.\"\n" +" )\n" +" # asyncio.gather effectively awaits each task in the collection.\n" +" await asyncio.gather(*work_tasks)" -msgid "Below, we use a future to enable custom control over when that task will be marked as done. If :meth:`future.set_result() ` (the method responsible for marking that future as done) is never called, then this task will never finish. We've also enlisted the help of another task, which we'll see in a moment, that will monitor how much time has elapsed and, accordingly, call ``future.set_result()``." -msgstr "" +msgid "" +"Below, we use a future to enable custom control over when that task will be " +"marked as done. If :meth:`future.set_result() ` " +"(the method responsible for marking that future as done) is never called, " +"then this task will never finish. We've also enlisted the help of another " +"task, which we'll see in a moment, that will monitor how much time has " +"elapsed and, accordingly, call ``future.set_result()``." +msgstr "" +"در زیر، از یک فیوچر (future) استفاده می‌کنیم تا امکان کنترل سفارشی بر زمان " +"علامت‌گذاری آن وظیفهبه‌عنوان انجام‌شده فراهم شود. اگر " +":meth:`future.set_result() ` (متد مسئول " +"علامت‌گذاری آن فیوچر به‌عنوان انجام‌شده) هرگز فراخوانی نشود، این وظیفه هرگز به" +" پایان نخواهد رسید. ما همچنین از کمک وظیفه دیگری بهره گرفته‌ایم که اندکی بعد " +"آن را خواهیم دید؛ این وظیفه میزان زمان سپری‌شده را پایش خواهد کرد و بر همین " +"اساس، ``future.set_result()`` را فراخوانی خواهد کرد." msgid "" "async def async_sleep(seconds: float):\n" @@ -429,12 +1008,52 @@ msgid "" " # Block until the future is marked as done.\n" " await future" msgstr "" +"async def async_sleep(seconds: float):\n" +" future = asyncio.Future()\n" +" time_to_wake = time.time() + seconds\n" +" # وظیفه‌ی ناظر (watcher-task) را به حلقه رویداد اضافه کنید.\n" +" watcher_task = asyncio.create_task(_sleep_watcher(future, time_to_wake))\n" +" # تا زمانی که future به‌عنوان انجام‌شده علامت‌گذاری شود، مسدود می‌شود.\n" +" await future" -msgid "Below, we use a rather bare ``YieldToEventLoop()`` object to ``yield`` from its ``__await__`` method, ceding control to the event loop. This is effectively the same as calling ``asyncio.sleep(0)``, but this approach offers more clarity, not to mention it's somewhat cheating to use ``asyncio.sleep`` when showcasing how to implement it!" -msgstr "" +msgid "" +"Below, we use a rather bare ``YieldToEventLoop()`` object to ``yield`` from " +"its ``__await__`` method, ceding control to the event loop. This is " +"effectively the same as calling ``asyncio.sleep(0)``, but this approach " +"offers more clarity, not to mention it's somewhat cheating to use " +"``asyncio.sleep`` when showcasing how to implement it!" +msgstr "" +"در زیر، از یک شیء نسبتاً ساده‌ی ``YieldToEventLoop()`` استفاده می‌کنیم تا از" +" متد ``__await__`` آن ``yield`` کنیم و کنترل را به حلقه‌ی رویداد واگذار " +"کنیم. این عملاً همان فراخوانی ``asyncio.sleep(0)`` است، اما این رویکرد وضوح " +"بیشتری دارد؛ جدا از این‌که استفاده از ``asyncio.sleep`` هنگام نمایش چگونگی " +"پیاده‌سازی آن تا حدی تقلب محسوب می‌شود!" -msgid "As usual, the event loop cycles through its tasks, giving them control and receiving control back when they pause or finish. The ``watcher_task``, which runs the coroutine ``_sleep_watcher(...)``, will be invoked once per full cycle of the event loop. On each resumption, it'll check the time and if not enough has elapsed, then it'll pause once again and hand control back to the event loop. Once enough time has elapsed, ``_sleep_watcher(...)`` marks the future as done and completes by exiting its infinite ``while`` loop. Given this helper task is only invoked once per cycle of the event loop, you'd be correct to note that this asynchronous sleep will sleep *at least* three seconds, rather than exactly three seconds. Note this is also true of ``asyncio.sleep``." -msgstr "" +msgid "" +"As usual, the event loop cycles through its tasks, giving them control and " +"receiving control back when they pause or finish. The ``watcher_task``, " +"which runs the coroutine ``_sleep_watcher(...)``, will be invoked once per " +"full cycle of the event loop. On each resumption, it'll check the time and " +"if not enough has elapsed, then it'll pause once again and hand control back" +" to the event loop. Once enough time has elapsed, ``_sleep_watcher(...)`` " +"marks the future as done and completes by exiting its infinite ``while`` " +"loop. Given this helper task is only invoked once per cycle of the event " +"loop, you'd be correct to note that this asynchronous sleep will sleep *at " +"least* three seconds, rather than exactly three seconds. Note this is also " +"true of ``asyncio.sleep``." +msgstr "" +"مانند همیشه، حلقه رویداد میان وظایف خود می‌چرخد، کنترل را به آن‌ها می‌دهد و " +"هنگامی که مکث می‌کنند یا به پایان می‌رسند، کنترل را پس می‌گیرد. " +"``watcher_task``، که هم‌روال ``_sleep_watcher(...)`` را اجرا می‌کند، یک‌بار " +"در هر چرخه‌ی کامل حلقه رویداد فراخوانی می‌شود. در هر بار ازسرگیری، زمان را " +"بررسی می‌کند و اگر به اندازه کافی زمان سپری نشده باشد، دوباره مکث می‌کند و " +"کنترل را به حلقه رویداد بازمی‌گرداند. هنگامی که به اندازه کافی زمان سپری شد،" +" ``_sleep_watcher(...)`` آینده (future) را به‌عنوان انجام‌شده علامت‌گذاری " +"می‌کند و با خروج از حلقه‌ی ``while`` بی‌پایان خود به پایان می‌رسد. با توجه " +"به این‌که این وظیفه کمکی تنها یک‌بار در هر چرخه‌ی حلقه رویداد فراخوانی " +"می‌شود، درست است که بگویید این توقف ناهمگام *حداقل* ۳ ثانیه طول می‌کشد، نه " +"دقیقاً ۳ ثانیه. توجه داشته باشید که این موضوع درباره‌ی ``asyncio.sleep`` نیز" +" صادق است." msgid "" "class YieldToEventLoop:\n" @@ -450,9 +1069,21 @@ msgid "" " else:\n" " await YieldToEventLoop()" msgstr "" +"class YieldToEventLoop:\n" +" def __await__(self):\n" +" yield\n" +"\n" +"async def _sleep_watcher(future, time_to_wake):\n" +" while True:\n" +" if time.time() >= time_to_wake:\n" +" # This marks the future as done.\n" +" future.set_result(None)\n" +" break\n" +" else:\n" +" await YieldToEventLoop()" msgid "Here is the full program's output:" -msgstr "" +msgstr "در اینجا خروجی کامل برنامه آمده است:" msgid "" "$ python custom-async-sleep.py\n" @@ -462,9 +1093,25 @@ msgid "" "I like work. Work work.\n" "Done asynchronous sleep at time: 14:52:25." msgstr "" +"$ python custom-async-sleep.py\n" +"Beginning asynchronous sleep at time: 14:52:22.\n" +"I like work. Work work.\n" +"I like work. Work work.\n" +"I like work. Work work.\n" +"Done asynchronous sleep at time: 14:52:25." -msgid "You might feel this implementation of asynchronous sleep was unnecessarily convoluted. And, well, it was. The example was meant to showcase the versatility of futures with a simple example that could be mimicked for more complex needs. For reference, you could implement it without futures, like so::" -msgstr "" +msgid "" +"You might feel this implementation of asynchronous sleep was unnecessarily " +"convoluted. And, well, it was. The example was meant to showcase the " +"versatility of futures with a simple example that could be mimicked for more" +" complex needs. For reference, you could implement it without futures, like " +"so::" +msgstr "" +"ممکن است احساس کنید این پیاده‌سازی توقف ناهمگام بی‌مورد پیچیده بوده است. و " +"خب، همین‌طور بود. این مثال برای نشان دادن تطبیق‌پذیری آینده‌نماها (futures) با " +"مثالی ساده در نظر گرفته شده بود که می‌توان از آن برای نیازهای پیچیده‌تر الگو" +" گرفت. برای مرجع، می‌توانید آن را بدون آینده‌نماها (futures) پیاده‌سازی کنید، به" +" این صورت::" msgid "" "async def simpler_async_sleep(seconds):\n" @@ -475,6 +1122,19 @@ msgid "" " else:\n" " await YieldToEventLoop()" msgstr "" +"async def simpler_async_sleep(seconds):\n" +" time_to_wake = time.time() + seconds\n" +" while True:\n" +" if time.time() >= time_to_wake:\n" +" return\n" +" else:\n" +" await YieldToEventLoop()" -msgid "But that's all for now. Hopefully you're ready to more confidently dive into some async programming or check out advanced topics in the :mod:`rest of the documentation `." +msgid "" +"But that's all for now. Hopefully you're ready to more confidently dive into" +" some async programming or check out advanced topics in the :mod:`rest of " +"the documentation `." msgstr "" +"اما برای اکنون، همین کافی است. امیدواریم شما آماده باشید تا با اطمینان " +"بیشتری وارد برنامه‌نویسی ناهمگام شوید یا موضوعات پیشرفته را در :mod:`بقیه " +"مستندات ` مرور کنید." diff --git a/howto/annotations.po b/howto/annotations.po index c2199d078..bf65e5ab2 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"PO-Revision-Date: 2026-08-28 10:58+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,57 +23,167 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Annotations Best Practices" -msgstr "" +msgstr "بهترین شیوه‌های حاشیه‌نویسی" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "Larry Hastings" -msgstr "" +msgstr "لری هیستینگز" msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "This document is designed to encapsulate the best practices for working with annotations dicts. If you write Python code that examines ``__annotations__`` on Python objects, we encourage you to follow the guidelines described below." +msgid "" +"This document is designed to encapsulate the best practices for working " +"with annotations dicts. If you write Python code that examines " +"``__annotations__`` on Python objects, we encourage you to follow the " +"guidelines described below." msgstr "" +"این سند طراحی شده است تا بهترین شیوه‌ها را برای کار با دیکشنری‌های حاشیه‌نویسی " +" در بر بگیرد. اگر کد پایتونی می‌نویسید که ``__annotations__`` " +"را روی اشیای پایتون بررسی می‌کند، توصیه می‌کنیم دستورالعمل‌های شرح‌داده‌شده در " +"زیر را دنبال کنید." -msgid "The document is organized into four sections: best practices for accessing the annotations of an object in Python versions 3.10 and newer, best practices for accessing the annotations of an object in Python versions 3.9 and older, other best practices for ``__annotations__`` that apply to any Python version, and quirks of ``__annotations__``." -msgstr "" +msgid "" +"The document is organized into four sections: best practices for accessing " +"the annotations of an object in Python versions 3.10 and newer, best " +"practices for accessing the annotations of an object in Python versions 3.9 " +"and older, other best practices for ``__annotations__`` that apply to any " +"Python version, and quirks of ``__annotations__``." +msgstr "" +"این سند در چهار بخش سازمان‌دهی شده است: بهترین شیوه‌های دسترسی به " +"حاشیه‌نویسی‌های یک شیء در نسخه‌های 3.10 و جدیدتر پایتون، بهترین " +"شیوه‌های دسترسی به حاشیه‌نویسی‌های یک شیءدر نسخه‌های 3.9 و " +"قدیمی‌تر پایتون، سایر بهترین شیوه‌ها برای ``__annotations__`` که برای همه " +"نسخه‌های پایتون اعمال می‌شوند، و نکات خاص ``__annotations__``." -msgid "Note that this document is specifically about working with ``__annotations__``, not uses *for* annotations. If you're looking for information on how to use \"type hints\" in your code, please see the :mod:`typing` module." +msgid "" +"Note that this document is specifically about working with " +"``__annotations__``, not uses *for* annotations. If you're looking for " +"information on how to use \"type hints\" in your code, please see " +"the :mod:`typing` module." msgstr "" +"توجه داشته باشید که این سند به‌طور خاص درباره‌ی کار با ``__annotations__`` " +"است، نه کاربردهایی *برای* annotations. اگر به دنبال اطلاعاتی درباره‌ی نحوه‌ی " +"استفاده از «راهنمای نوع» (type hints) در کد خود هستید، لطفاً " +"ماژول :mod:`typing` را ببینید." msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" -msgstr "" +msgstr "دسترسی به دیکشنری یادداشت‌های یک شیء در پایتون 3.10 و جدیدتر" -msgid "Python 3.10 adds a new function to the standard library: :func:`inspect.get_annotations`. In Python versions 3.10 through 3.13, calling this function is the best practice for accessing the annotations dict of any object that supports annotations. This function can also \"un-stringize\" stringized annotations for you." -msgstr "" +msgid "" +"Python 3.10 adds a new function to the standard " +"library: :func:`inspect.get_annotations`. In Python versions 3.10 through " +"3.13, calling this function is the best practice for accessing the " +"annotations dict of any object that supports annotations. This function " +"can also \"un-stringize\" stringized annotations for you." +msgstr "" +"پایتون 3.10 یک تابع جدید به کتابخانه استاندارد " +"می‌افزاید: :func:`inspect.get_annotations`. در نسخه‌های 3.10 تا 3.13 پایتون، " +"فراخوانی این تابع بهترین روش برای دسترسی به دیکشنری حاشیه‌نویسی‌های هر شیء‌ای " +"است که از حاشیه‌نویسی پشتیبانی می‌کند. این تابع همچنین می‌تواند حاشیه‌نویسی‌های " +"رشته‌ای‌شده را برای شما از حالت رشته‌ای خارج کند (un-stringize)." -msgid "In Python 3.14, there is a new :mod:`annotationlib` module with functionality for working with annotations. This includes a :func:`annotationlib.get_annotations` function, which supersedes :func:`inspect.get_annotations`." +msgid "" +"In Python 3.14, there is a new :mod:`annotationlib` module with " +"functionality for working with annotations. This includes " +"a :func:`annotationlib.get_annotations` function, which " +"supersedes :func:`inspect.get_annotations`." msgstr "" +"در پایتون 3.14، ماژول جدید :mod:`annotationlib` با قابلیت‌هایی برای کار با " +"حاشیه‌نویسی‌هاوجود دارد. این ماژول شامل یک " +"تابع :func:`annotationlib.get_annotations` است که " +"جایگزین :func:`inspect.get_annotations` شده است." -msgid "If for some reason :func:`inspect.get_annotations` isn't viable for your use case, you may access the ``__annotations__`` data member manually. Best practice for this changed in Python 3.10 as well: as of Python 3.10, ``o.__annotations__`` is guaranteed to *always* work on Python functions, classes, and modules. If you're certain the object you're examining is one of these three *specific* objects, you may simply use ``o.__annotations__`` to get at the object's annotations dict." -msgstr "" +msgid "" +"If for some reason :func:`inspect.get_annotations` isn't viable for your " +"use case, you may access the ``__annotations__`` data member manually. " +"Best practice for this changed in Python 3.10 as well: as of Python 3.10, " +"``o.__annotations__`` is guaranteed to *always* work on Python functions, " +"classes, and modules. If you're certain the object you're examining is one " +"of these three *specific* objects, you may simply use ``o.__annotations__`` " +"to get at the object's annotations dict." +msgstr "" +"اگر به هر دلیلی :func:`inspect.get_annotations` برای مورد استفاده شما " +"قابل‌استفاده نیست، می‌توانید به‌صورت دستی به عضو داده‌ای ``__annotations__`` " +"دسترسی پیدا کنید. بهترین رویه برای این کار نیز در Python 3.10 تغییر کرد: از " +"Python 3.10 به بعد، تضمین شده است که ``o.__annotations__`` *همیشه* برای " +"توابع، کلاس‌ها و ماژول‌های پایتون کار می‌کند. اگر مطمئن هستید شیء مورد بررسی " +"شما یکی از این سه شیء *خاص* است، می‌توانید به‌سادگی از ``o.__annotations__`` " +"برای دسترسی به دیکشنری حاشیه‌نویسی‌های شیء استفاده کنید." -msgid "However, other types of callables--for example, callables created by :func:`functools.partial`--may not have an ``__annotations__`` attribute defined. When accessing the ``__annotations__`` of a possibly unknown object, best practice in Python versions 3.10 and newer is to call :func:`getattr` with three arguments, for example ``getattr(o, '__annotations__', None)``." -msgstr "" +msgid "" +"However, other types of callables--for example, callables created " +"by :func:`functools.partial`--may not have an ``__annotations__`` attribute " +"defined. When accessing the ``__annotations__`` of a possibly unknown " +"object, best practice in Python versions 3.10 and newer is to " +"call :func:`getattr` with three arguments, for example ``getattr(o, " +"'__annotations__', None)``." +msgstr "" +"با این حال، سایر انواع اشیای قابل‌فراخوانی—برای مثال، آن‌هایی که " +"توسط :func:`functools.partial` ایجاد شده‌اند—ممکن است ویژگی " +"``__annotations__`` تعریف‌شده‌ای نداشته باشند. هنگام دسترسی به " +"``__annotations__`` شیء‌ای که ممکن است ناشناخته باشد، بهترین روش در نسخه‌های " +"3.10 و جدیدتر پایتون این است که :func:`getattr` را با ۳ آرگومان فراخوانی " +"کنید، برای مثال ``getattr(o, '__annotations__', None)``." -msgid "Before Python 3.10, accessing ``__annotations__`` on a class that defines no annotations but that has a parent class with annotations would return the parent's ``__annotations__``. In Python 3.10 and newer, the child class's annotations will be an empty dict instead." +msgid "" +"Before Python 3.10, accessing ``__annotations__`` on a class that defines " +"no annotations but that has a parent class with annotations would return " +"the parent's ``__annotations__``. In Python 3.10 and newer, the child " +"class's annotations will be an empty dict instead." msgstr "" +"پیش از پایتون 3.10، دسترسی به ``__annotations__`` در کلاسی که هیچ " +"حاشیه‌نویسی‌ایتعریف نمی‌کند، اما کلاس والد آن حاشیه‌نویسی " +" دارد، ``__annotations__`` کلاس والد را برمی‌گرداند. در پایتون " +"3.10 و نسخه‌های جدیدتر، حاشیه‌نویسی‌های کلاس فرزند در عوض یک دیکشنری خالی " +"خواهد بود." msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" msgstr "" +"دسترسی به دیکشنری یادداشت‌هامتعلق به یک شیء در پایتون 3.9 و " +"قدیمی‌تر" -msgid "In Python 3.9 and older, accessing the annotations dict of an object is much more complicated than in newer versions. The problem is a design flaw in these older versions of Python, specifically to do with class annotations." +msgid "" +"In Python 3.9 and older, accessing the annotations dict of an object is " +"much more complicated than in newer versions. The problem is a design flaw " +"in these older versions of Python, specifically to do with class " +"annotations." msgstr "" +"در پایتون 3.9 و نسخه‌های قدیمی‌تر، دسترسی به دیکشنری حاشیه‌نویسی‌ها " +" برای یک شیء، بسیار پیچیده‌تر از نسخه‌های جدیدتر است. این مشکل " +"یک نقص طراحی در این نسخه‌های قدیمی‌تر پایتون است، به‌ویژه مربوط به " +"حاشیه‌نویسی‌های کلاس (class annotations)." -msgid "Best practice for accessing the annotations dict of other objects--functions, other callables, and modules--is the same as best practice for 3.10, assuming you aren't calling :func:`inspect.get_annotations`: you should use three-argument :func:`getattr` to access the object's ``__annotations__`` attribute." -msgstr "" +msgid "" +"Best practice for accessing the annotations dict of other objects--" +"functions, other callables, and modules--is the same as best practice for " +"3.10, assuming you aren't calling :func:`inspect.get_annotations`: you " +"should use three-argument :func:`getattr` to access the object's " +"``__annotations__`` attribute." +msgstr "" +"بهترین روش برای دسترسی به دیکشنری حاشیه‌نویسی‌هادر اشیای دیگر--" +"توابع، سایر اشیای قابل‌فراخوانی (callables) و ماژول‌ها--همان بهترین روش برای " +"3.10 است، با فرض اینکه شما :func:`inspect.get_annotations` را فراخوانی " +"نمی‌کنید: باید برای دسترسی به ویژگی ``__annotations__`` شیء، " +"از :func:`getattr` با سه آرگومان استفاده کنید." -msgid "Unfortunately, this isn't best practice for classes. The problem is that, since ``__annotations__`` is optional on classes, and because classes can inherit attributes from their base classes, accessing the ``__annotations__`` attribute of a class may inadvertently return the annotations dict of a *base class.* As an example::" -msgstr "" +msgid "" +"Unfortunately, this isn't best practice for classes. The problem is that, " +"since ``__annotations__`` is optional on classes, and because classes can " +"inherit attributes from their base classes, accessing the " +"``__annotations__`` attribute of a class may inadvertently return the " +"annotations dict of a *base class.* As an example::" +msgstr "" +"متأسفانه، این بهترین روش برای کلاس‌ها نیست. مشکل این است که از آن‌جا که " +"``__annotations__`` در کلاس‌ها اختیاری است و چون کلاس‌ها می‌توانند ویژگی‌ها را " +"از کلاس‌های پایه خود به ارث ببرند، دسترسی به ویژگی ``__annotations__`` یک " +"کلاس ممکن است ناخواسته دیکشنری حاشیه‌نویسی‌های یک *کلاس پایه* را برگرداند. " +"به‌عنوان مثال::" msgid "" "class Base:\n" @@ -85,15 +195,44 @@ msgid "" "\n" "print(Derived.__annotations__)" msgstr "" +"class Base:\n" +" a: int = 3\n" +" b: str = 'abc'\n" +"\n" +"class Derived(Base):\n" +" pass\n" +"\n" +"print(Derived.__annotations__)" msgid "This will print the annotations dict from ``Base``, not ``Derived``." msgstr "" +"این، دیکشنری حاشیه‌نویسیرا از ``Base`` چاپ می‌کند، نه " +"``Derived``." -msgid "Your code will have to have a separate code path if the object you're examining is a class (``isinstance(o, type)``). In that case, best practice relies on an implementation detail of Python 3.9 and before: if a class has annotations defined, they are stored in the class's :attr:`~type.__dict__` dictionary. Since the class may or may not have annotations defined, best practice is to call the :meth:`~dict.get` method on the class dict." -msgstr "" +msgid "" +"Your code will have to have a separate code path if the object you're " +"examining is a class (``isinstance(o, type)``). In that case, best practice " +"relies on an implementation detail of Python 3.9 and before: if a class has " +"annotations defined, they are stored in the class's :attr:`~type.__dict__` " +"dictionary. Since the class may or may not have annotations defined, best " +"practice is to call the :meth:`~dict.get` method on the class dict." +msgstr "" +"اگر شیئی که بررسی می‌کنید یک کلاس باشد (``isinstance(o, type)``)، کد شما " +"باید مسیر کد جداگانه‌ای داشته باشد. در این صورت، بهترین روش به یک جزئیات " +"پیاده‌سازی در پایتون 3.9 و نسخه‌های پیش از آن متکی است: اگر برای کلاسی " +"حاشیه‌نویسی‌هاییتعریف شده باشند، آن‌ها در " +"دیکشنری :attr:`~type.__dict__` کلاس ذخیره می‌شوند. از آن‌جا که ممکن است برای " +"کلاس حاشیه‌نویسی‌هاییتعریف شده باشند یا نشده باشند، بهترین روش " +"این است که متد :meth:`~dict.get` را روی دیکشنری کلاس فراخوانی کنید." -msgid "To put it all together, here is some sample code that safely accesses the ``__annotations__`` attribute on an arbitrary object in Python 3.9 and before::" +msgid "" +"To put it all together, here is some sample code that safely accesses the " +"``__annotations__`` attribute on an arbitrary object in Python 3.9 and " +"before::" msgstr "" +"برای جمع‌بندی همه موارد، در ادامه کد نمونه‌ای آمده است که به‌طور امن به ویژگی " +"``__annotations__`` یک شیء دلخواه در پایتون 3.9 و پیش از آن دسترسی پیدا " +"می‌کند::" msgid "" "if isinstance(o, type):\n" @@ -101,84 +240,239 @@ msgid "" "else:\n" " ann = getattr(o, '__annotations__', None)" msgstr "" +"if isinstance(o, type):\n" +" ann = o.__dict__.get('__annotations__', None)\n" +"else:\n" +" ann = getattr(o, '__annotations__', None)" -msgid "After running this code, ``ann`` should be either a dictionary or ``None``. You're encouraged to double-check the type of ``ann`` using :func:`isinstance` before further examination." +msgid "" +"After running this code, ``ann`` should be either a dictionary or " +"``None``. You're encouraged to double-check the type of ``ann`` " +"using :func:`isinstance` before further examination." msgstr "" +"پس از اجرای این کد، ``ann`` باید یا یک دیکشنری باشد یا ``None``. توصیه " +"می‌شود پیش از بررسی بیشتر، نوع ``ann`` را با استفاده از :func:`isinstance` " +"دوباره بررسی کنید." -msgid "Note that some exotic or malformed type objects may not have a :attr:`~type.__dict__` attribute, so for extra safety you may also wish to use :func:`getattr` to access :attr:`!__dict__`." +msgid "" +"Note that some exotic or malformed type objects may not have " +"a :attr:`~type.__dict__` attribute, so for extra safety you may also wish " +"to use :func:`getattr` to access :attr:`!__dict__`." msgstr "" +"توجه داشته باشید که برخی اشیای نوع غیرعادی یا نقص‌دار ممکن است " +"ویژگی :attr:`~type.__dict__` را نداشته باشند، بنابراین برای احتیاط بیشتر، " +"ممکن است بخواهید برای دسترسی به :attr:`!__dict__` از :func:`getattr` نیز " +"استفاده کنید." msgid "Manually Un-Stringizing Stringized Annotations" -msgstr "" +msgstr "غیررشته‌ای‌سازی دستی حاشیه‌نویسی‌های رشته‌ای‌شده" -msgid "In situations where some annotations may be \"stringized\", and you wish to evaluate those strings to produce the Python values they represent, it really is best to call :func:`inspect.get_annotations` to do this work for you." +msgid "" +"In situations where some annotations may be \"stringized\", and you wish to " +"evaluate those strings to produce the Python values they represent, it " +"really is best to call :func:`inspect.get_annotations` to do this work for " +"you." msgstr "" +"در موقعیت‌هایی که برخی حاشیه‌نویسی‌هاممکن است «رشته‌ای‌شده» " +"(stringized) باشند و شما می‌خواهید آن رشته‌ها را ارزیابی کنید تا مقادیر " +"پایتونی متناظر با آن‌ها تولید شوند، واقعاً بهترین کار این است " +"که :func:`inspect.get_annotations` را فراخوانی کنید تا این کار را برای شما " +"انجام دهد." -msgid "If you're using Python 3.9 or older, or if for some reason you can't use :func:`inspect.get_annotations`, you'll need to duplicate its logic. You're encouraged to examine the implementation of :func:`inspect.get_annotations` in the current Python version and follow a similar approach." -msgstr "" +msgid "" +"If you're using Python 3.9 or older, or if for some reason you can't " +"use :func:`inspect.get_annotations`, you'll need to duplicate its logic. " +"You're encouraged to examine the implementation " +"of :func:`inspect.get_annotations` in the current Python version and follow " +"a similar approach." +msgstr "" +"اگر از پایتون 3.9 یا نسخه‌های قدیمی‌تر استفاده می‌کنید، یا اگر به هر دلیلی " +"نمی‌توانید از :func:`inspect.get_annotations` استفاده کنید، باید همان منطق " +"را پیاده‌سازی کنید. به شما توصیه می‌شود " +"پیاده‌سازی :func:`inspect.get_annotations` را در نسخه‌ی فعلی پایتون بررسی " +"کنید و رویکرد مشابهی را دنبال کنید." -msgid "In a nutshell, if you wish to evaluate a stringized annotation on an arbitrary object ``o``:" +msgid "" +"In a nutshell, if you wish to evaluate a stringized annotation on an " +"arbitrary object ``o``:" msgstr "" +"به‌طور خلاصه، اگر می‌خواهید یک حاشیه‌نویسی رشته‌شده (stringized annotation) را " +"روی یک شیء دلخواه ``o`` ارزیابی کنید:" -msgid "If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :func:`eval`." +msgid "" +"If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when " +"calling :func:`eval`." msgstr "" +"اگر ``o`` یک ماژول باشد، از ``o.__dict__`` به‌عنوان ``globals`` هنگام " +"فراخوانی :func:`eval` استفاده کنید." -msgid "If ``o`` is a class, use ``sys.modules[o.__module__].__dict__`` as the ``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:`eval`." +msgid "" +"If ``o`` is a class, use ``sys.modules[o.__module__].__dict__`` as the " +"``globals``, and ``dict(vars(o))`` as the ``locals``, when " +"calling :func:`eval`." msgstr "" +"اگر ``o`` یک کلاس باشد، هنگام فراخوانی :func:`eval`، از " +"``sys.modules[o.__module__].__dict__`` به‌عنوان ``globals`` و از " +"``dict(vars(o))`` به‌عنوان ``locals`` استفاده کنید." -msgid "If ``o`` is a wrapped callable using :func:`functools.update_wrapper`, :deco:`functools.wraps`, or :func:`functools.partial`, iteratively unwrap it by accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you have found the root unwrapped function." -msgstr "" +msgid "" +"If ``o`` is a wrapped callable " +"using :func:`functools.update_wrapper`, :deco:`functools.wraps`, " +"or :func:`functools.partial`, iteratively unwrap it by accessing either " +"``o.__wrapped__`` or ``o.func`` as appropriate, until you have found the " +"root unwrapped function." +msgstr "" +"اگر ``o`` یک فراخوان‌پذیر پوششی‌شده با استفاده " +"از :func:`functools.update_wrapper`، :deco:`functools.wraps` " +"یا :func:`functools.partial` باشد، آن را به‌صورت تکراری با دسترسی به " +"``o.__wrapped__`` یا ``o.func`` بسته به مورد از پوشش خارج کنید، تا تابع " +"ریشه‌ای بدون پوشش را پیدا کنید." -msgid "If ``o`` is a callable (but not a class), use :attr:`o.__globals__ ` as the globals when calling :func:`eval`." +msgid "" +"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ " +"` as the globals when calling :func:`eval`." msgstr "" +"اگر ``o`` قابل فراخوانی باشد (اما کلاس نباشد)، هنگام فراخوانی :func:`eval` " +"از :attr:`o.__globals__ ` به‌عنوان سراسری‌ها استفاده " +"کنید." -msgid "However, not all string values used as annotations can be successfully turned into Python values by :func:`eval`. String values could theoretically contain any valid string, and in practice there are valid use cases for type hints that require annotating with string values that specifically *can't* be evaluated. For example:" -msgstr "" +msgid "" +"However, not all string values used as annotations can be successfully " +"turned into Python values by :func:`eval`. String values could " +"theoretically contain any valid string, and in practice there are valid use " +"cases for type hints that require annotating with string values that " +"specifically *can't* be evaluated. For example:" +msgstr "" +"با این حال، نمی‌توان همه‌ی مقادیر رشته‌ای را که به‌عنوان حاشیه‌نویسی " +"استفاده می‌شوند، با موفقیت به‌وسیله‌ی :func:`eval` به مقادیر پایتون تبدیل کرد. " +"مقادیر رشته‌ای از نظر تئوری می‌توانند شامل هر رشته‌ی معتبری باشند و در عمل " +"موارد استفاده‌ی معتبری برای راهنمایی‌های نوع (type hints) وجود دارد که مستلزم " +"حاشیه‌نویسی با مقادیری رشته‌ای هستند که مشخصاً *نمی‌توانند* ارزیابی شوند. برای " +"مثال:" -msgid ":pep:`604` union types using ``|``, before support for this was added to Python 3.10." +msgid "" +":pep:`604` union types using ``|``, before support for this was added to " +"Python 3.10." msgstr "" +"انواع اجتماعی (union types) :pep:`604` با استفاده از ``|``، پیش از آنکه " +"پشتیبانی از این قابلیت به Python 3.10 اضافه شود." -msgid "Definitions that aren't needed at runtime, only imported when :const:`typing.TYPE_CHECKING` is true." +msgid "" +"Definitions that aren't needed at runtime, only imported " +"when :const:`typing.TYPE_CHECKING` is true." msgstr "" +"تعریف‌هایی که در ران‌تایم نیازی به آن‌ها نیست و فقط زمانی ایمپورت می‌شوند " +"که :const:`typing.TYPE_CHECKING` درست باشد." -msgid "If :func:`eval` attempts to evaluate such values, it will fail and raise an exception. So, when designing a library API that works with annotations, it's recommended to only attempt to evaluate string values when explicitly requested to by the caller." +msgid "" +"If :func:`eval` attempts to evaluate such values, it will fail and raise an " +"exception. So, when designing a library API that works with annotations, " +"it's recommended to only attempt to evaluate string values when explicitly " +"requested to by the caller." msgstr "" +"اگر :func:`eval` سعی در ارزیابی چنین مقادیری داشته باشد، شکست خواهد خورد و " +"استثنایی پرتاب خواهد کرد. بنابراین، هنگام طراحی API یک کتابخانه که با " +"حاشیه‌نویسی‌ها کار می‌کند، توصیه می‌شود تنها زمانی برای ارزیابی مقادیر رشته‌ای " +"اقدام کنید که فراخواننده به‌صراحت این کار را درخواست کرده باشد." msgid "Best Practices For ``__annotations__`` In Any Python Version" -msgstr "" +msgstr "بهترین شیوه‌ها برای ``__annotations__`` در هر نسخه‌ای از پایتون" -msgid "You should avoid assigning to the ``__annotations__`` member of objects directly. Let Python manage setting ``__annotations__``." +msgid "" +"You should avoid assigning to the ``__annotations__`` member of objects " +"directly. Let Python manage setting ``__annotations__``." msgstr "" +"باید از انتساب مستقیم به عضو ``__annotations__`` شیء‌ها خودداری کنید. اجازه " +"دهید پایتون تنظیم ``__annotations__`` را مدیریت کند." -msgid "If you do assign directly to the ``__annotations__`` member of an object, you should always set it to a ``dict`` object." +msgid "" +"If you do assign directly to the ``__annotations__`` member of an object, " +"you should always set it to a ``dict`` object." msgstr "" +"اگر مستقیماً به عضو ``__annotations__`` یک شیء انتساب می‌دهید، باید همیشه آن " +"را روی یک شیء ``dict`` تنظیم کنید." -msgid "You should avoid accessing ``__annotations__`` directly on any object. Instead, use :func:`annotationlib.get_annotations` (Python 3.14+) or :func:`inspect.get_annotations` (Python 3.10+)." +msgid "" +"You should avoid accessing ``__annotations__`` directly on any object. " +"Instead, use :func:`annotationlib.get_annotations` (Python 3.14+) " +"or :func:`inspect.get_annotations` (Python 3.10+)." msgstr "" +"باید از دسترسی مستقیم به ``__annotations__`` روی هر شیء اجتناب کنید. به‌جای " +"آن، از :func:`annotationlib.get_annotations` (پایتون 3.14+) " +"یا :func:`inspect.get_annotations` (پایتون 3.10+) استفاده کنید." -msgid "If you do directly access the ``__annotations__`` member of an object, you should ensure that it's a dictionary before attempting to examine its contents." +msgid "" +"If you do directly access the ``__annotations__`` member of an object, you " +"should ensure that it's a dictionary before attempting to examine its " +"contents." msgstr "" +"اگر مستقیماً به عضو ``__annotations__`` یک شیء دسترسی دارید، باید پیش از " +"تلاش برای بررسی محتوای آن، اطمینان حاصل کنید که یک دیکشنری است." msgid "You should avoid modifying ``__annotations__`` dicts." -msgstr "" +msgstr "شما باید از تغییر دیکشنری‌های ``__annotations__`` خودداری کنید." -msgid "You should avoid deleting the ``__annotations__`` attribute of an object." -msgstr "" +msgid "" +"You should avoid deleting the ``__annotations__`` attribute of an object." +msgstr "شما باید از حذف ویژگی ``__annotations__`` یک شیء خودداری کنید." msgid "``__annotations__`` Quirks" -msgstr "" +msgstr "رفتارهای عجیب ``__annotations__``" -msgid "In all versions of Python 3, function objects lazy-create an annotations dict if no annotations are defined on that object. You can delete the ``__annotations__`` attribute using ``del fn.__annotations__``, but if you then access ``fn.__annotations__`` the object will create a new empty dict that it will store and return as its annotations. Deleting the annotations on a function before it has lazily created its annotations dict will throw an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is guaranteed to always throw an ``AttributeError``." -msgstr "" +msgid "" +"In all versions of Python 3, function objects lazy-create an annotations " +"dict if no annotations are defined on that object. You can delete the " +"``__annotations__`` attribute using ``del fn.__annotations__``, but if you " +"then access ``fn.__annotations__`` the object will create a new empty dict " +"that it will store and return as its annotations. Deleting the annotations " +"on a function before it has lazily created its annotations dict will throw " +"an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is " +"guaranteed to always throw an ``AttributeError``." +msgstr "" +"در تمام نسخه‌های Python 3، اشیای تابع اگر هیچ‌یک از حاشیه‌نویسی‌ها " +" برای آن‌ها تعریف نشده باشد، یک دیکشنری حاشیه‌نویسی‌ها را به‌صورت " +"تنبل (lazy-create) ایجاد می‌کنند. شما می‌توانید ویژگی ``__annotations__`` را " +"با استفاده از ``del fn.__annotations__`` حذف کنید، اما اگر سپس به " +"``fn.__annotations__`` دسترسی پیدا کنید، شیء یک دیکشنری خالی جدید ایجاد " +"می‌کند که آن را ذخیره می‌کند و به‌عنوان حاشیه‌نویسی‌های خود بازمی‌گرداند. حذف " +"حاشیه‌نویسی‌های یک تابع پیش از آنکه دیکشنری حاشیه‌نویسی‌های خود را به‌صورت تنبل " +"ایجاد کرده باشد، یک ``AttributeError`` را پرتاب می‌کند؛ تضمین می‌شود که " +"استفاده از ``del fn.__annotations__`` دو بار پشت سر هم، همیشه یک " +"``AttributeError`` را پرتاب کند." -msgid "Everything in the above paragraph also applies to class and module objects in Python 3.10 and newer." +msgid "" +"Everything in the above paragraph also applies to class and module objects " +"in Python 3.10 and newer." msgstr "" +"همه موارد پاراگراف بالا، در پایتون 3.10 و نسخه‌های جدیدتر، برای اشیای کلاس " +"و ماژول نیز اعمال می‌شود." -msgid "In all versions of Python 3, you can set ``__annotations__`` on a function object to ``None``. However, subsequently accessing the annotations on that object using ``fn.__annotations__`` will lazy-create an empty dictionary as per the first paragraph of this section. This is *not* true of modules and classes, in any Python version; those objects permit setting ``__annotations__`` to any Python value, and will retain whatever value is set." -msgstr "" +msgid "" +"In all versions of Python 3, you can set ``__annotations__`` on a function " +"object to ``None``. However, subsequently accessing the annotations on " +"that object using ``fn.__annotations__`` will lazy-create an empty " +"dictionary as per the first paragraph of this section. This is *not* true " +"of modules and classes, in any Python version; those objects permit setting " +"``__annotations__`` to any Python value, and will retain whatever value is " +"set." +msgstr "" +"در همه نسخه‌های پایتون 3، می‌توانید ``__annotations__`` را روی یک شیء تابع به " +"``None`` تنظیم کنید. با این حال، دسترسی بعدی به حاشیه‌نویسی‌های آن شیء با " +"استفاده از ``fn.__annotations__``، مطابق پاراگراف اول این بخش، یک دیکشنری " +"خالی را به‌صورت تنبل ایجاد می‌کند. این موضوع در هیچ نسخه‌ای از پایتون برای " +"ماژول‌ها و کلاس‌ها *صادق نیست*؛ آن اشیاء اجازه می‌دهند ``__annotations__`` را " +"به هر مقدار پایتون تنظیم کنید، و هر مقداری را که تنظیم شده باشد حفظ می‌کنند." -msgid "If Python stringizes your annotations for you (using ``from __future__ import annotations``), and you specify a string as an annotation, the string will itself be quoted. In effect the annotation is quoted *twice.* For example::" +msgid "" +"If Python stringizes your annotations for you (using ``from __future__ " +"import annotations``), and you specify a string as an annotation, the " +"string will itself be quoted. In effect the annotation is quoted *twice.* " +"For example::" msgstr "" +"اگر پایتون حاشیه‌نویسی‌های شمارا برایتان به رشته تبدیل کند (با " +"استفاده از ``from __future__ import annotations``) و شما یک رشته را به‌عنوان " +"حاشیه‌نویسی مشخص کنید، خود رشته داخل علامت نقل‌قول قرار خواهد گرفت. در عمل، " +"حاشیه‌نویسی داخل علامت نقل‌قول قرار می‌گیرد، *دو بار.* برای مثال::" msgid "" "from __future__ import annotations\n" @@ -186,12 +480,46 @@ msgid "" "\n" "print(foo.__annotations__)" msgstr "" +"from __future__ import annotations\n" +"def foo(a: \"str\"): pass\n" +"\n" +"print(foo.__annotations__)" -msgid "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a \"quirk\"; it's mentioned here simply because it might be surprising." +msgid "" +"This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " +"\"quirk\"; it's mentioned here simply because it might be surprising." msgstr "" +"این ``{'a': \"'str'\"}`` را چاپ می‌کند. این واقعاً نباید یک «رفتار عجیب» تلقی " +"شود؛ اینجا صرفاً به این دلیل ذکر شده است که ممکن است غافلگیرکننده باشد." -msgid "If you use a class with a custom metaclass and access ``__annotations__`` on the class, you may observe unexpected behavior; see :pep:`749 <749#pep749-metaclasses>` for some examples. You can avoid these quirks by using :func:`annotationlib.get_annotations` on Python 3.14+ or :func:`inspect.get_annotations` on Python 3.10+. On earlier versions of Python, you can avoid these bugs by accessing the annotations from the class's :attr:`~type.__dict__` (for example, ``cls.__dict__.get('__annotations__', None)``)." -msgstr "" +msgid "" +"If you use a class with a custom metaclass and access ``__annotations__`` " +"on the class, you may observe unexpected behavior; see :pep:`749 " +"<749#pep749-metaclasses>` for some examples. You can avoid these quirks by " +"using :func:`annotationlib.get_annotations` on Python 3.14+ " +"or :func:`inspect.get_annotations` on Python 3.10+. On earlier versions of " +"Python, you can avoid these bugs by accessing the annotations from the " +"class's :attr:`~type.__dict__` (for example, " +"``cls.__dict__.get('__annotations__', None)``)." +msgstr "" +"اگر از کلاسی با فراکلاس سفارشی استفاده کنید و به ``__annotations__`` کلاس " +"دسترسی پیدا کنید، ممکن است رفتار غیرمنتظره‌ای را مشاهده کنید؛ برای مشاهده " +"چند مثال، :pep:`749 <749#pep749-metaclasses>` را ببینید. می‌توانید با " +"استفاده از :func:`annotationlib.get_annotations` در پایتون 3.14+ " +"یا :func:`inspect.get_annotations` در پایتون 3.10+ از این رفتارهای عجیب " +"اجتناب کنید. در نسخه‌های پیشین پایتون، می‌توانید با دسترسی به حاشیه‌نویسی‌ها " +" از طریق :attr:`~type.__dict__` کلاس، از این اشکال‌ها اجتناب " +"کنید (برای مثال، ``cls.__dict__.get('__annotations__', None)``)." -msgid "In some versions of Python, instances of classes may have an ``__annotations__`` attribute. However, this is not supported functionality. If you need the annotations of an instance, you can use :func:`type` to access its class (for example, ``annotationlib.get_annotations(type(myinstance))`` on Python 3.14+)." -msgstr "" +msgid "" +"In some versions of Python, instances of classes may have an " +"``__annotations__`` attribute. However, this is not supported " +"functionality. If you need the annotations of an instance, you can " +"use :func:`type` to access its class (for example, " +"``annotationlib.get_annotations(type(myinstance))`` on Python 3.14+)." +msgstr "" +"در برخی نسخه‌های پایتون، نمونه‌های کلاس‌ها ممکن است دارای ویژگی " +"``__annotations__`` باشند. با این حال، این یک قابلیت پشتیبانی‌شده نیست. اگر " +"به حاشیه‌نویسی‌های یک نمونهنیاز دارید، می‌توانید " +"از :func:`type` برای دسترسی به کلاس آن استفاده کنید (برای مثال، " +"``annotationlib.get_annotations(type(myinstance))`` در پایتون 3.14+)." diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index 4ecf29ef8..ad9471f22 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -24,61 +24,140 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Migrating ``optparse`` code to ``argparse``" -msgstr "" +msgstr "مهاجرت کد ``optparse`` به ``argparse``" -msgid "The :mod:`argparse` module offers several higher level features not natively provided by the :mod:`optparse` module, including:" +msgid "" +"The :mod:`argparse` module offers several higher level features not natively" +" provided by the :mod:`optparse` module, including:" msgstr "" +"ماژول :mod:`argparse` چندین قابلیت سطح بالاتر ارائه می‌دهد که به‌صورت ذاتی " +"توسط ماژول :mod:`optparse` ارائه نمی‌شوند، از جمله:" msgid "Handling positional arguments." -msgstr "" +msgstr "مدیریت آرگومان‌های جایگاهی." msgid "Supporting subcommands." -msgstr "" +msgstr "پشتیبانی از زیردستورها." msgid "Allowing alternative option prefixes like ``+`` and ``/``." -msgstr "" +msgstr "اجازه دادن به پیشوندهای جایگزین گزینه مانند ``+`` و ``/``." msgid "Handling zero-or-more and one-or-more style arguments." -msgstr "" +msgstr "مدیریت آرگومان‌هایی با سبک صفر-یا-بیشتر و یک-یا-بیشتر." msgid "Producing more informative usage messages." -msgstr "" +msgstr "تولید پیام‌های کاربرد آگاه‌کننده‌تر." msgid "Providing a much simpler interface for custom ``type`` and ``action``." -msgstr "" +msgstr "فراهم کردن رابطی بسیار ساده‌تر برای ``type`` و ``action`` سفارشی." -msgid "Originally, the :mod:`argparse` module attempted to maintain compatibility with :mod:`optparse`. However, the fundamental design differences between supporting declarative command line option processing (while leaving positional argument processing to application code), and supporting both named options and positional arguments in the declarative interface mean that the API has diverged from that of ``optparse`` over time." -msgstr "" +msgid "" +"Originally, the :mod:`argparse` module attempted to maintain compatibility " +"with :mod:`optparse`. However, the fundamental design differences between " +"supporting declarative command line option processing (while leaving " +"positional argument processing to application code), and supporting both " +"named options and positional arguments in the declarative interface mean " +"that the API has diverged from that of ``optparse`` over time." +msgstr "" +"در ابتدا، ماژول :mod:`argparse` تلاش می‌کرد سازگاری با :mod:`optparse` را " +"حفظ کند. با این حال، تفاوت‌های بنیادین طراحی میان پشتیبانی از پردازش " +"گزینه‌های خط فرمان به‌صورت اعلانی (در حالی که پردازش آرگومان‌های جایگاهی به " +"کد برنامه واگذار شده است)، و پشتیبانی از گزینه‌های نام‌دار و همچنین " +"آرگومان‌های جایگاهی در رابط اعلانی به این معناست که API به‌مرور زمان از " +"``optparse`` فاصله گرفته است." -msgid "As described in :ref:`choosing-an-argument-parser`, applications that are currently using :mod:`optparse` and are happy with the way it works can just continue to use ``optparse``." +msgid "" +"As described in :ref:`choosing-an-argument-parser`, applications that are " +"currently using :mod:`optparse` and are happy with the way it works can just" +" continue to use ``optparse``." msgstr "" +"همان‌طور که در :ref:`choosing-an-argument-parser` توضیح داده شده است، " +"برنامه‌هایی که در حال حاضر از :mod:`optparse` استفاده می‌کنند و از روش کار " +"آن رضایت دارند، می‌توانند صرفاً به استفاده از ``optparse`` ادامه دهند." -msgid "Application developers that are considering migrating should also review the list of intrinsic behavioural differences described in that section before deciding whether or not migration is desirable." +msgid "" +"Application developers that are considering migrating should also review the" +" list of intrinsic behavioural differences described in that section before " +"deciding whether or not migration is desirable." msgstr "" +"توسعه‌دهندگان برنامه‌های کاربردی که مهاجرت را مدنظر دارند، باید پیش از " +"تصمیم‌گیری درباره‌ی اینکه آیا مهاجرت مطلوب است یا خیر، فهرست تفاوت‌های رفتاری" +" ذاتی توصیف‌شده در آن بخش را نیز بررسی کنند." -msgid "For applications that do choose to migrate from :mod:`optparse` to :mod:`argparse`, the following suggestions should be helpful:" +msgid "" +"For applications that do choose to migrate from :mod:`optparse` to " +":mod:`argparse`, the following suggestions should be helpful:" msgstr "" +"برای برنامه‌هایی که مهاجرت از :mod:`optparse` به :mod:`argparse` را انتخاب " +"می‌کنند، پیشنهادهای زیر باید مفید باشد:" -msgid "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:`ArgumentParser.add_argument` calls." +msgid "" +"Replace all :meth:`optparse.OptionParser.add_option` calls with " +":meth:`ArgumentParser.add_argument` calls." msgstr "" +"تمام فراخوانی‌های :meth:`optparse.OptionParser.add_option` را با " +"فراخوانی‌های :meth:`ArgumentParser.add_argument` جایگزین کنید." -msgid "Replace ``(options, args) = parser.parse_args()`` with ``args = parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls for the positional arguments. Keep in mind that what was previously called ``options``, now in the :mod:`argparse` context is called ``args``." +msgid "" +"Replace ``(options, args) = parser.parse_args()`` with ``args = " +"parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument`" +" calls for the positional arguments. Keep in mind that what was previously " +"called ``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" +"``(options, args) = parser.parse_args()`` را با ``args = " +"parser.parse_args()`` جایگزین کنید و فراخوانی‌های بیشتری از " +":meth:`ArgumentParser.add_argument` را برای آرگومان‌های جایگاهی اضافه کنید. " +"به خاطر داشته باشید که آنچه پیش‌تر ``options`` نامیده می‌شد، اکنون در زمینه‌ی" +" :mod:`argparse`، ``args`` نامیده می‌شود." -msgid "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:`~ArgumentParser.parse_args`." +msgid "" +"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using " +":meth:`~ArgumentParser.parse_intermixed_args` instead of " +":meth:`~ArgumentParser.parse_args`." msgstr "" +"برای جایگزینی :meth:`optparse.OptionParser.disable_interspersed_args`، " +"به‌جای :meth:`~ArgumentParser.parse_args " +"<~ArgumentParser.parse_intermixed_args>` از " +":meth:`~ArgumentParser.parse_intermixed_args <~ArgumentParser.parse_args>` " +"استفاده کنید." -msgid "Replace callback actions and the ``callback_*`` keyword arguments with ``type`` or ``action`` arguments." +msgid "" +"Replace callback actions and the ``callback_*`` keyword arguments with " +"``type`` or ``action`` arguments." msgstr "" +"کنش‌های کال‌بک و آرگومان‌های کلیدواژه‌ای ``callback_*`` را با آرگومان‌های " +"``type`` یا ``action`` جایگزین کنید." -msgid "Replace string names for ``type`` keyword arguments with the corresponding type objects (e.g. int, float, complex, etc)." +msgid "" +"Replace string names for ``type`` keyword arguments with the corresponding " +"type objects (e.g. int, float, complex, etc)." msgstr "" +"نام‌های رشته‌ای برای آرگومان‌های کلیدواژه‌ای ``type`` را با اشیای نوع متناظر" +" جایگزین کنید (مثلاً int، float، complex و غیره)." -msgid "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse.OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." +msgid "" +"Replace :class:`optparse.Values` with :class:`Namespace` and " +":exc:`optparse.OptionError` and :exc:`optparse.OptionValueError` with " +":exc:`ArgumentError`." msgstr "" +":class:`optparse.Values` را با :class:`Namespace`، و " +":exc:`optparse.OptionError` و :exc:`optparse.OptionValueError` را با " +":exc:`ArgumentError` جایگزین کنید." -msgid "Replace strings with implicit arguments such as ``%default`` or ``%prog`` with the standard Python syntax to use dictionaries to format strings, that is, ``%(default)s`` and ``%(prog)s``." +msgid "" +"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " +"with the standard Python syntax to use dictionaries to format strings, that " +"is, ``%(default)s`` and ``%(prog)s``." msgstr "" +"رشته‌های دارای آرگومان‌های ضمنی مانند ``%default`` یا ``%prog`` را با سینتکس" +" استاندارد پایتون برای استفاده از دیکشنری‌ها جهت قالب‌بندی رشته‌ها، یعنی " +"``%(default)s`` و ``%(prog)s``، جایگزین کنید." -msgid "Replace the OptionParser constructor ``version`` argument with a call to ``parser.add_argument('--version', action='version', version='')``." +msgid "" +"Replace the OptionParser constructor ``version`` argument with a call to " +"``parser.add_argument('--version', action='version', version='')``." msgstr "" +"آرگومان ``version`` سازنده‌ی OptionParser را با فراخوانی " +"``parser.add_argument('--version', action='version', version='')`` جایگزین کنید." diff --git a/howto/argparse.po b/howto/argparse.po index 63e20c9be..c5eccbe31 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -25,25 +25,53 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Argparse Tutorial" -msgstr "" +msgstr "آموزش Argparse" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "Tshepang Mbambo" -msgstr "" +msgstr "Tshepang Mbambo" -msgid "This tutorial is intended to be a gentle introduction to :mod:`argparse`, the recommended command-line parsing module in the Python standard library." +msgid "" +"This tutorial is intended to be a gentle introduction to :mod:`argparse`, " +"the recommended command-line parsing module in the Python standard library." msgstr "" +"این آموزش در نظر دارد مقدمه‌ای ملایم به :mod:`argparse`، ماژول توصیه‌شده " +"برای تجزیه خط فرمان در کتابخانه استاندارد پایتون، باشد." -msgid "The standard library includes two other libraries directly related to command-line parameter processing: the lower level :mod:`optparse` module (which may require more code to configure for a given application, but also allows an application to request behaviors that ``argparse`` doesn't support), and the very low level :mod:`getopt` (which specifically serves as an equivalent to the :c:func:`!getopt` family of functions available to C programmers). While neither of those modules is covered directly in this guide, many of the core concepts in ``argparse`` first originated in ``optparse``, so some aspects of this tutorial will also be relevant to ``optparse`` users." -msgstr "" +msgid "" +"The standard library includes two other libraries directly related to " +"command-line parameter processing: the lower level :mod:`optparse` module " +"(which may require more code to configure for a given application, but also " +"allows an application to request behaviors that ``argparse`` doesn't " +"support), and the very low level :mod:`getopt` (which specifically serves as" +" an equivalent to the :c:func:`!getopt` family of functions available to C " +"programmers). While neither of those modules is covered directly in this " +"guide, many of the core concepts in ``argparse`` first originated in " +"``optparse``, so some aspects of this tutorial will also be relevant to " +"``optparse`` users." +msgstr "" +"کتابخانه استاندارد شامل دو کتابخانه دیگر است که مستقیماً به پردازش " +"پارامترهای خط فرمان مرتبط هستند: ماژول :mod:`optparse` در سطح پایین‌تر (که " +"ممکن است برای پیکربندی یک برنامه مشخص به کد بیشتری نیاز داشته باشد، اما " +"همچنین به برنامه اجازه می‌دهد رفتارهایی را درخواست کند که ``argparse`` از " +"آن‌ها پشتیبانی نمی‌کند)، و :mod:`getopt` بسیار سطح پایین (که مشخصاً به‌عنوان" +" معادلی برای خانواده توابع :c:func:`!getopt` در دسترس برنامه‌نویسان C عمل " +"می‌کند). اگرچه هیچ‌کدام از این ماژول‌ها مستقیماً در این راهنما پوشش داده " +"نمی‌شوند، بسیاری از مفاهیم اصلی ``argparse`` ابتدا در ``optparse`` پدید " +"آمدند، بنابراین برخی از جنبه‌های این آموزش برای کاربران ``optparse`` نیز " +"مرتبط خواهند بود." msgid "Concepts" -msgstr "" +msgstr "مفاهیم" -msgid "Let's show the sort of functionality that we are going to explore in this introductory tutorial by making use of the :command:`ls` command:" +msgid "" +"Let's show the sort of functionality that we are going to explore in this " +"introductory tutorial by making use of the :command:`ls` command:" msgstr "" +"بیایید با استفاده از دستور :command:`ls`، نوع قابلیت‌هایی را که در این آموزش" +" مقدماتی بررسی خواهیم کرد، نشان دهیم:" msgid "" "$ ls\n" @@ -63,36 +91,88 @@ msgid "" "Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" "..." msgstr "" +"$ ls\n" +"cpython devguide prog.py pypy rm-unused-function.patch\n" +"$ ls pypy\n" +"ctypes_configure demo dotviewer include lib_pypy lib-python ...\n" +"$ ls -l\n" +"total 20\n" +"drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython\n" +"drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide\n" +"-rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py\n" +"drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy\n" +"-rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch\n" +"$ ls --help\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"..." msgid "A few concepts we can learn from the four commands:" -msgstr "" +msgstr "چند مفهوم که می‌توانیم از ۴ دستور بیاموزیم:" -msgid "The :command:`ls` command is useful when run without any options at all. It defaults to displaying the contents of the current directory." +msgid "" +"The :command:`ls` command is useful when run without any options at all. It " +"defaults to displaying the contents of the current directory." msgstr "" +"فرمان :command:`ls` زمانی که بدون هیچ گزینه‌ای اجرا شود، مفید است. این فرمان" +" به‌طور پیش‌فرض محتویات پوشه جاری را نمایش می‌دهد." -msgid "If we want beyond what it provides by default, we tell it a bit more. In this case, we want it to display a different directory, ``pypy``. What we did is specify what is known as a positional argument. It's named so because the program should know what to do with the value, solely based on where it appears on the command line. This concept is more relevant to a command like :command:`cp`, whose most basic usage is ``cp SRC DEST``. The first position is *what you want copied,* and the second position is *where you want it copied to*." -msgstr "" +msgid "" +"If we want beyond what it provides by default, we tell it a bit more. In " +"this case, we want it to display a different directory, ``pypy``. What we " +"did is specify what is known as a positional argument. It's named so because" +" the program should know what to do with the value, solely based on where it" +" appears on the command line. This concept is more relevant to a command " +"like :command:`cp`, whose most basic usage is ``cp SRC DEST``. The first " +"position is *what you want copied,* and the second position is *where you " +"want it copied to*." +msgstr "" +"اگر بخواهیم فراتر از آنچه به‌طور پیش‌فرض فراهم می‌کند، کمی بیشتر به آن " +"می‌گوییم. در این حالت، می‌خواهیم پوشه‌ای متفاوت، یعنی ``pypy`` را نمایش دهد." +" کاری که انجام دادیم مشخص کردن چیزی است که به‌عنوان آرگومان جایگاهی شناخته " +"می‌شود. این‌گونه نام‌گذاری شده است زیرا برنامه باید صرفاً بر اساس محل " +"قرارگیری آن در خط فرمان بداند با مقدار چه کاری انجام دهد. این مفهوم بیشتر به" +" دستوری مانند :command:`cp` مربوط است، که ابتدایی‌ترین کاربرد آن ``cp SRC " +"DEST`` است. جایگاه اول *چیزی است که می‌خواهید کپی شود،* و جایگاه دوم *جایی " +"است که می‌خواهید به آن کپی شود*." -msgid "Now, say we want to change behaviour of the program. In our example, we display more info for each file instead of just showing the file names. The ``-l`` in that case is known as an optional argument." +msgid "" +"Now, say we want to change behaviour of the program. In our example, we " +"display more info for each file instead of just showing the file names. The " +"``-l`` in that case is known as an optional argument." msgstr "" +"حال، فرض کنید می‌خواهیم رفتار برنامه را تغییر دهیم. در مثال خود، به‌جای " +"نمایش فقط نام فایل‌ها، اطلاعات بیشتری برای هر فایل نمایش می‌دهیم. در این " +"حالت، ``-l`` به‌عنوان یک آرگومان اختیاری شناخته می‌شود." -msgid "That's a snippet of the help text. It's very useful in that you can come across a program you have never used before, and can figure out how it works simply by reading its help text." +msgid "" +"That's a snippet of the help text. It's very useful in that you can come " +"across a program you have never used before, and can figure out how it works" +" simply by reading its help text." msgstr "" +"این قطعه‌ای از متن راهنما است. این بسیار مفید است، زیرا می‌توانید با " +"برنامه‌ای مواجه شوید که هرگز پیش‌تر از آن استفاده نکرده‌اید و صرفاً با " +"خواندن متن راهنمای آن بفهمید که چگونه کار می‌کند." msgid "The basics" -msgstr "" +msgstr "مبانی" msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "" +"بیایید با مثال بسیار ساده‌ای شروع کنیم که (تقریباً) هیچ کاری انجام نمی‌دهد::" msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" "parser.parse_args()" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.parse_args()" msgid "Following is a result of running the code:" -msgstr "" +msgstr "نتیجه‌ی اجرای کد به شرح زیر است:" msgid "" "$ python prog.py\n" @@ -108,24 +188,52 @@ msgid "" "usage: prog.py [-h]\n" "prog.py: error: unrecognized arguments: foo" msgstr "" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py --verbose\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: --verbose\n" +"$ python prog.py foo\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: foo" msgid "Here is what is happening:" -msgstr "" +msgstr "آنچه اتفاق می‌افتد به این صورت است:" -msgid "Running the script without any options results in nothing displayed to stdout. Not so useful." +msgid "" +"Running the script without any options results in nothing displayed to " +"stdout. Not so useful." msgstr "" +"اجرای اسکریپت بدون هیچ گزینه‌ای باعث می‌شود چیزی در stdout نمایش داده نشود. " +"چندان مفید نیست." -msgid "The second one starts to display the usefulness of the :mod:`argparse` module. We have done almost nothing, but already we get a nice help message." +msgid "" +"The second one starts to display the usefulness of the :mod:`argparse` " +"module. We have done almost nothing, but already we get a nice help message." msgstr "" +"دومی شروع به نمایش سودمندی ماژول :mod:`argparse` می‌کند. ما تقریباً هیچ کاری" +" انجام نداده‌ایم، اما از همین حالا یک پیام راهنمای مناسب دریافت می‌کنیم." -msgid "The ``--help`` option, which can also be shortened to ``-h``, is the only option we get for free (i.e. no need to specify it). Specifying anything else results in an error. But even then, we do get a useful usage message, also for free." +msgid "" +"The ``--help`` option, which can also be shortened to ``-h``, is the only " +"option we get for free (i.e. no need to specify it). Specifying anything " +"else results in an error. But even then, we do get a useful usage message, " +"also for free." msgstr "" +"گزینه‌ی ``--help``، که می‌توان آن را به ``-h`` نیز مخفف کرد، تنها گزینه‌ای " +"است که به‌رایگان در اختیار داریم (یعنی نیازی به مشخص کردن آن نیست). مشخص " +"کردن هر چیز دیگری منجر به خطا می‌شود. اما حتی در آن حالت نیز یک پیام کاربرد " +"مفید، به‌رایگان دریافت می‌کنیم." msgid "Introducing Positional arguments" -msgstr "" +msgstr "معرفی آرگومان‌های جایگاهی" msgid "An example::" -msgstr "" +msgstr "یک مثال::" msgid "" "import argparse\n" @@ -134,9 +242,14 @@ msgid "" "args = parser.parse_args()\n" "print(args.echo)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" msgid "And running the code:" -msgstr "" +msgstr "و اجرای کد:" msgid "" "$ python prog.py\n" @@ -153,24 +266,66 @@ msgid "" "$ python prog.py foo\n" "foo" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] echo\n" +"prog.py: error: the following arguments are required: echo\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py foo\n" +"foo" msgid "Here is what's happening:" -msgstr "" +msgstr "آنچه در حال رخ دادن است:" -msgid "We've added the :meth:`~ArgumentParser.add_argument` method, which is what we use to specify which command-line options the program is willing to accept. In this case, I've named it ``echo`` so that it's in line with its function." +msgid "" +"We've added the :meth:`~ArgumentParser.add_argument` method, which is what " +"we use to specify which command-line options the program is willing to " +"accept. In this case, I've named it ``echo`` so that it's in line with its " +"function." msgstr "" +"ما متد :meth:`~ArgumentParser.add_argument` را اضافه کرده‌ایم، که از آن برای" +" مشخص کردن این‌که برنامه مایل به پذیرش کدام گزینه‌های خط فرمان است، استفاده " +"می‌کنیم. در این مورد، من آن را ``echo`` نام‌گذاری کرده‌ام تا با تابع خود " +"هماهنگ باشد." msgid "Calling our program now requires us to specify an option." -msgstr "" +msgstr "اکنون برای فراخوانی برنامه‌ی خود باید یک گزینه را مشخص کنیم." -msgid "The :meth:`~ArgumentParser.parse_args` method actually returns some data from the options specified, in this case, ``echo``." +msgid "" +"The :meth:`~ArgumentParser.parse_args` method actually returns some data " +"from the options specified, in this case, ``echo``." msgstr "" +"متد :meth:`~ArgumentParser.parse_args` در واقع مقداری داده از گزینه‌های " +"مشخص‌شده برمی‌گرداند، در این حالت، ``echo``." -msgid "The variable is some form of 'magic' that :mod:`argparse` performs for free (i.e. no need to specify which variable that value is stored in). You will also notice that its name matches the string argument given to the method, ``echo``." +msgid "" +"The variable is some form of 'magic' that :mod:`argparse` performs for free " +"(i.e. no need to specify which variable that value is stored in). You will " +"also notice that its name matches the string argument given to the method, " +"``echo``." msgstr "" +"این متغیر نوعی «جادو» است که :mod:`argparse` بدون نیاز به اقدام اضافه از سوی" +" شما انجام می‌دهد (یعنی نیازی نیست مشخص کنید آن مقدار در کدام متغیر ذخیره " +"می‌شود). همچنین متوجه خواهید شد که نام آن با آرگومان رشته‌ای داده‌شده به " +"متد، ``echo``، مطابقت دارد." -msgid "Note however that, although the help display looks nice and all, it currently is not as helpful as it can be. For example we see that we got ``echo`` as a positional argument, but we don't know what it does, other than by guessing or by reading the source code. So, let's make it a bit more useful::" +msgid "" +"Note however that, although the help display looks nice and all, it " +"currently is not as helpful as it can be. For example we see that we got " +"``echo`` as a positional argument, but we don't know what it does, other " +"than by guessing or by reading the source code. So, let's make it a bit more" +" useful::" msgstr "" +"با این حال توجه داشته باشید که، اگرچه نمایش راهنما زیبا به نظر می‌رسد، اما " +"در حال حاضر آن‌قدر که می‌تواند مفید نیست. برای مثال می‌بینیم که ``echo`` را " +"به‌عنوان یک آرگومان جایگاهی داریم، اما نمی‌دانیم چه کاری انجام می‌دهد، مگر " +"با حدس زدن یا خواندن کد منبع. بنابراین، بیایید آن را کمی مفیدتر کنیم::" msgid "" "import argparse\n" @@ -179,9 +334,14 @@ msgid "" "args = parser.parse_args()\n" "print(args.echo)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\", help=\"echo the string you use here\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" msgid "And we get:" -msgstr "" +msgstr "و این نتیجه را می‌گیریم:" msgid "" "$ python prog.py -h\n" @@ -193,9 +353,17 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +"$ python prog.py -h\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo echo the string you use here\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" msgid "Now, how about doing something even more useful::" -msgstr "" +msgstr "حال، چطور است کاری حتی مفیدتر انجام دهیم::" msgid "" "import argparse\n" @@ -204,6 +372,11 @@ msgid "" "args = parser.parse_args()\n" "print(args.square**2)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given number\")\n" +"args = parser.parse_args()\n" +"print(args.square**2)" msgid "" "$ python prog.py 4\n" @@ -212,9 +385,21 @@ msgid "" " print(args.square**2)\n" "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" msgstr "" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 5, in \n" +" print(args.square**2)\n" +"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" -msgid "That didn't go so well. That's because :mod:`argparse` treats the options we give it as strings, unless we tell it otherwise. So, let's tell :mod:`argparse` to treat that input as an integer::" +msgid "" +"That didn't go so well. That's because :mod:`argparse` treats the options we" +" give it as strings, unless we tell it otherwise. So, let's tell " +":mod:`argparse` to treat that input as an integer::" msgstr "" +"این کار چندان خوب پیش نرفت. دلیلش این است که :mod:`argparse` گزینه‌هایی را " +"که به آن می‌دهیم به‌صورت رشته در نظر می‌گیرد، مگر اینکه طور دیگری به آن " +"بگوییم. پس، بیایید به :mod:`argparse` بگوییم آن ورودی را به‌صورت عدد صحیح در" +" نظر بگیرد::" msgid "" "import argparse\n" @@ -224,6 +409,12 @@ msgid "" "args = parser.parse_args()\n" "print(args.square**2)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given number\",\n" +" type=int)\n" +"args = parser.parse_args()\n" +"print(args.square**2)" msgid "" "$ python prog.py 4\n" @@ -232,15 +423,28 @@ msgid "" "usage: prog.py [-h] square\n" "prog.py: error: argument square: invalid int value: 'four'" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py four\n" +"usage: prog.py [-h] square\n" +"prog.py: error: argument square: invalid int value: 'four'" -msgid "That went well. The program now even helpfully quits on bad illegal input before proceeding." +msgid "" +"That went well. The program now even helpfully quits on bad illegal input " +"before proceeding." msgstr "" +"این به‌خوبی پیش رفت. برنامه اکنون حتی در صورت ورودی بد و غیرمجاز، پیش از " +"ادامه به‌صورت مفیدی خارج می‌شود." msgid "Introducing Optional arguments" -msgstr "" +msgstr "معرفی آرگومان‌های اختیاری" -msgid "So far we have been playing with positional arguments. Let us have a look on how to add optional ones::" +msgid "" +"So far we have been playing with positional arguments. Let us have a look on" +" how to add optional ones::" msgstr "" +"تاکنون با آرگومان‌های جایگاهی کار کرده‌ایم. بگذارید نگاهی بیندازیم به چگونگی" +" افزودن آرگومان‌های اختیاری::" msgid "" "import argparse\n" @@ -250,9 +454,15 @@ msgid "" "if args.verbosity:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbosity\", help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"if args.verbosity:\n" +" print(\"verbosity turned on\")" msgid "And the output:" -msgstr "" +msgstr "و خروجی:" msgid "" "$ python prog.py --verbosity 1\n" @@ -269,21 +479,58 @@ msgid "" "usage: prog.py [-h] [--verbosity VERBOSITY]\n" "prog.py: error: argument --verbosity: expected one argument" msgstr "" +"$ python prog.py --verbosity 1\n" +"verbosity turned on\n" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbosity VERBOSITY\n" +" increase output verbosity\n" +"$ python prog.py --verbosity\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"prog.py: error: argument --verbosity: expected one argument" -msgid "The program is written so as to display something when ``--verbosity`` is specified and display nothing when not." +msgid "" +"The program is written so as to display something when ``--verbosity`` is " +"specified and display nothing when not." msgstr "" +"این برنامه به‌گونه‌ای نوشته شده است که هنگام مشخص شدن ``--verbosity`` چیزی " +"نمایش دهد و در غیر این صورت هیچ چیز نمایش ندهد." -msgid "To show that the option is actually optional, there is no error when running the program without it. Note that by default, if an optional argument isn't used, the relevant variable, in this case ``args.verbosity``, is given ``None`` as a value, which is the reason it fails the truth test of the :keyword:`if` statement." -msgstr "" +msgid "" +"To show that the option is actually optional, there is no error when running" +" the program without it. Note that by default, if an optional argument isn't" +" used, the relevant variable, in this case ``args.verbosity``, is given " +"``None`` as a value, which is the reason it fails the truth test of the " +":keyword:`if` statement." +msgstr "" +"برای نشان دادن این که گزینه واقعاً اختیاری است، هنگام اجرای برنامه بدون آن " +"هیچ خطایی رخ نمی‌دهد. توجه داشته باشید که به‌طور پیش‌فرض، اگر یک آرگومان " +"اختیاری استفاده نشود، به متغیر مربوطه، در این مورد ``args.verbosity``، مقدار" +" ``None`` داده می‌شود، که به همین دلیل در آزمون درستی دستور :keyword:`if` " +"مردود می‌شود." msgid "The help message is a bit different." -msgstr "" +msgstr "پیام راهنما کمی متفاوت است." -msgid "When using the ``--verbosity`` option, one must also specify some value, any value." +msgid "" +"When using the ``--verbosity`` option, one must also specify some value, any" +" value." msgstr "" +"هنگام استفاده از گزینه ``--verbosity``، باید مقداری را نیز مشخص کنید؛ هر " +"مقداری." -msgid "The above example accepts arbitrary integer values for ``--verbosity``, but for our simple program, only two values are actually useful, ``True`` or ``False``. Let's modify the code accordingly::" +msgid "" +"The above example accepts arbitrary integer values for ``--verbosity``, but " +"for our simple program, only two values are actually useful, ``True`` or " +"``False``. Let's modify the code accordingly::" msgstr "" +"مثال بالا هر مقدار عدد صحیحی را برای ``--verbosity`` می‌پذیرد، اما برای " +"برنامه ساده ما، تنها دو مقدار واقعاً مفید هستند: ``True`` یا ``False``. " +"بیایید کد را بر همین اساس اصلاح کنیم::" msgid "" "import argparse\n" @@ -294,6 +541,13 @@ msgid "" "if args.verbose:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbose\", help=\"increase output verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" msgid "" "$ python prog.py --verbose\n" @@ -308,21 +562,51 @@ msgid "" " -h, --help show this help message and exit\n" " --verbose increase output verbosity" msgstr "" +"$ python prog.py --verbose\n" +"verbosity turned on\n" +"$ python prog.py --verbose 1\n" +"usage: prog.py [-h] [--verbose]\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbose]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbose increase output verbosity" -msgid "The option is now more of a flag than something that requires a value. We even changed the name of the option to match that idea. Note that we now specify a new keyword, ``action``, and give it the value ``\"store_true\"``. This means that, if the option is specified, assign the value ``True`` to ``args.verbose``. Not specifying it implies ``False``." -msgstr "" +msgid "" +"The option is now more of a flag than something that requires a value. We " +"even changed the name of the option to match that idea. Note that we now " +"specify a new keyword, ``action``, and give it the value ``\"store_true\"``." +" This means that, if the option is specified, assign the value ``True`` to " +"``args.verbose``. Not specifying it implies ``False``." +msgstr "" +"این گزینه اکنون بیشتر یک پرچم است تا چیزی که به یک مقدار نیاز داشته باشد. ما" +" حتی نام گزینه را برای هماهنگی با همین ایده تغییر دادیم. توجه کنید که اکنون " +"یک کلیدواژه جدید، ``action``، مشخص می‌کنیم و مقدار ``\"store_true\"`` را به " +"آن می‌دهیم. این بدان معناست که اگر گزینه مشخص شده باشد، مقدار ``True`` به " +"``args.verbose`` اختصاص داده می‌شود. مشخص نکردن آن به‌معنای ``False`` است." -msgid "It complains when you specify a value, in true spirit of what flags actually are." +msgid "" +"It complains when you specify a value, in true spirit of what flags actually" +" are." msgstr "" +"هنگامی که مقداری را تعیین می‌کنید، اعتراض می‌کند؛ دقیقاً مطابق با ماهیت " +"واقعی پرچم‌ها (flags)." msgid "Notice the different help text." -msgstr "" +msgstr "به متن راهنمای متفاوت توجه کنید." msgid "Short options" -msgstr "" +msgstr "گزینه‌های کوتاه" -msgid "If you are familiar with command line usage, you will notice that I haven't yet touched on the topic of short versions of the options. It's quite simple::" +msgid "" +"If you are familiar with command line usage, you will notice that I haven't " +"yet touched on the topic of short versions of the options. It's quite " +"simple::" msgstr "" +"اگر با استفاده از خط فرمان آشنا باشید، متوجه خواهید شد که هنوز به موضوع " +"شکل‌های کوتاه گزینه‌ها نپرداخته‌ام. این موضوع کاملاً ساده است::" msgid "" "import argparse\n" @@ -333,9 +617,16 @@ msgid "" "if args.verbose:\n" " print(\"verbosity turned on\")" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"-v\", \"--verbose\", help=\"increase output verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" msgid "And here goes:" -msgstr "" +msgstr "و به این صورت است:" msgid "" "$ python prog.py -v\n" @@ -347,15 +638,23 @@ msgid "" " -h, --help show this help message and exit\n" " -v, --verbose increase output verbosity" msgstr "" +"$ python prog.py -v\n" +"پرگویی روشن شد\n" +"$ python prog.py --help\n" +"طرز استفاده: prog.py [-h] [-v]\n" +"\n" +"گزینه‌ها:\n" +" -h, --help نمایش این پیام راهنما و خروج\n" +" -v, --verbose افزایش پرگویی خروجی" msgid "Note that the new ability is also reflected in the help text." -msgstr "" +msgstr "توجه داشته باشید که قابلیت جدید نیز در متن راهنما منعکس شده است." msgid "Combining Positional and Optional arguments" -msgstr "" +msgstr "ترکیب آرگومان‌های جایگاهی و اختیاری" msgid "Our program keeps growing in complexity::" -msgstr "" +msgstr "برنامه‌ی ما از نظر پیچیدگی همچنان در حال رشد است::" msgid "" "import argparse\n" @@ -371,9 +670,21 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbose\", action=\"store_true\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbose:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"else:\n" +" print(answer)" msgid "And now the output:" -msgstr "" +msgstr "و اکنون خروجی:" msgid "" "$ python prog.py\n" @@ -386,15 +697,29 @@ msgid "" "$ python prog.py --verbose 4\n" "the square of 4 equals 16" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: the following arguments are required: square\n" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 --verbose\n" +"the square of 4 equals 16\n" +"$ python prog.py --verbose 4\n" +"the square of 4 equals 16" msgid "We've brought back a positional argument, hence the complaint." msgstr "" +"ما یک آرگومان جایگاهی را بازگردانده‌ایم، به همین دلیل این شکایت وجود دارد." msgid "Note that the order does not matter." -msgstr "" +msgstr "توجه داشته باشید که ترتیب مهم نیست." -msgid "How about we give this program of ours back the ability to have multiple verbosity values, and actually get to use them::" +msgid "" +"How about we give this program of ours back the ability to have multiple " +"verbosity values, and actually get to use them::" msgstr "" +"چطور است که توانایی داشتن چندین مقدار پرگویی (verbosity) را به این " +"برنامه‌مان بازگردانیم و واقعاً از آن‌ها استفاده کنیم::" msgid "" "import argparse\n" @@ -412,6 +737,20 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" msgid "" "$ python prog.py 4\n" @@ -426,9 +765,26 @@ msgid "" "$ python prog.py 4 -v 3\n" "16" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"usage: prog.py [-h] [-v VERBOSITY] square\n" +"prog.py: error: argument -v/--verbosity: expected one argument\n" +"$ python prog.py 4 -v 1\n" +"4^2 == 16\n" +"$ python prog.py 4 -v 2\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 3\n" +"16" -msgid "These all look good except the last one, which exposes a bug in our program. Let's fix it by restricting the values the ``--verbosity`` option can accept::" +msgid "" +"These all look good except the last one, which exposes a bug in our program." +" Let's fix it by restricting the values the ``--verbosity`` option can " +"accept::" msgstr "" +"همه‌ی این‌ها خوب به نظر می‌رسند، به‌جز آخرین مورد که یک خطا را در برنامه‌ی " +"ما آشکار می‌کند. بیایید آن را با محدود کردن مقادیری که گزینه‌ی " +"``--verbosity`` می‌تواند بپذیرد، اصلاح کنیم::" msgid "" "import argparse\n" @@ -446,6 +802,20 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int, choices=[0, 1, 2],\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" msgid "" "$ python prog.py 4 -v 3\n" @@ -462,18 +832,42 @@ msgid "" " -v, --verbosity {0,1,2}\n" " increase output verbosity" msgstr "" - -msgid "Note that the change also reflects both in the error message as well as the help string." -msgstr "" - -msgid "Now, let's use a different approach of playing with verbosity, which is pretty common. It also matches the way the CPython executable handles its own verbosity argument (check the output of ``python --help``)::" -msgstr "" - -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display the square of a given number\")\n" +"$ python prog.py 4 -v 3\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, 1, 2)\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity {0,1,2}\n" +" increase output verbosity" + +msgid "" +"Note that the change also reflects both in the error message as well as the " +"help string." +msgstr "" +"توجه داشته باشید که این تغییر هم در پیام خطا و هم در رشته راهنما منعکس " +"می‌شود." + +msgid "" +"Now, let's use a different approach of playing with verbosity, which is " +"pretty common. It also matches the way the CPython executable handles its " +"own verbosity argument (check the output of ``python --help``)::" +msgstr "" +"اکنون، بیایید از رویکرد متفاوتی برای بازی با سطح جزئیات استفاده کنیم، که " +"نسبتاً رایج است. این روش همچنین با شیوه‌ای که فایل اجرایی CPython آرگومان " +"سطح جزئیات خود را مدیریت می‌کند مطابقت دارد (خروجی ``python --help`` را " +"بررسی کنید)::" + +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display the square of a given number\")\n" "parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" " help=\"increase output verbosity\")\n" "args = parser.parse_args()\n" @@ -485,9 +879,27 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display the square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" -msgid "We have introduced another action, \"count\", to count the number of occurrences of specific options." +msgid "" +"We have introduced another action, \"count\", to count the number of " +"occurrences of specific options." msgstr "" +"ما اکشن دیگری به نام \"count\" برای شمارش تعداد دفعات استفاده از " +"گزینه‌های خاص معرفی کرده‌ایم." msgid "" "$ python prog.py 4\n" @@ -513,30 +925,74 @@ msgid "" "$ python prog.py 4 -vvv\n" "16" msgstr "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 -vv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 --verbosity --verbosity\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 1\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity increase output verbosity\n" +"$ python prog.py 4 -vvv\n" +"16" -msgid "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the previous version of our script. That should explain the complaint." +msgid "" +"Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " +"previous version of our script. That should explain the complaint." msgstr "" +"بله، اکنون در نسخه‌ی پیشین اسکریپت ما، بیشتر حکم یک پرچم را دارد (مشابه " +"``action=\"store_true\"``). این باید دلیل آن شکایت را توضیح دهد." msgid "It also behaves similar to \"store_true\" action." -msgstr "" +msgstr "همچنین رفتاری مشابه اکشن \"store_true\" دارد." -msgid "Now here's a demonstration of what the \"count\" action gives. You've probably seen this sort of usage before." +msgid "" +"Now here's a demonstration of what the \"count\" action gives. You've " +"probably seen this sort of usage before." msgstr "" +"اکنون در اینجا نمونه‌ای از آنچه کنش «count» ارائه می‌دهد آمده است. شما " +"احتمالاً پیش‌تر این نوع استفاده را دیده‌اید." -msgid "And if you don't specify the ``-v`` flag, that flag is considered to have ``None`` value." +msgid "" +"And if you don't specify the ``-v`` flag, that flag is considered to have " +"``None`` value." msgstr "" +"و اگر پرچم ``-v`` را مشخص نکنید، آن پرچم دارای مقدار ``None`` در نظر گرفته " +"می‌شود." -msgid "As should be expected, specifying the long form of the flag, we should get the same output." +msgid "" +"As should be expected, specifying the long form of the flag, we should get " +"the same output." msgstr "" +"همان‌طور که انتظار می‌رود، با مشخص کردن شکل بلند پرچم، باید همان خروجی را " +"دریافت کنیم." -msgid "Sadly, our help output isn't very informative on the new ability our script has acquired, but that can always be fixed by improving the documentation for our script (e.g. via the ``help`` keyword argument)." +msgid "" +"Sadly, our help output isn't very informative on the new ability our script " +"has acquired, but that can always be fixed by improving the documentation " +"for our script (e.g. via the ``help`` keyword argument)." msgstr "" +"متأسفانه، خروجی راهنمای ما چندان درباره قابلیت جدیدی که اسکریپت ما کسب کرده " +"است، گویا نیست، اما همیشه می‌توان این مشکل را با بهبود مستندات اسکریپت خود " +"برطرف کرد (مثلاً از طریق آرگومان کلیدواژه‌ای ``help``)." msgid "That last output exposes a bug in our program." -msgstr "" +msgstr "آن آخرین خروجی، اشکالی را در برنامه‌ی ما آشکار می‌کند." msgid "Let's fix::" -msgstr "" +msgstr "بیایید آن را اصلاح کنیم::" msgid "" "import argparse\n" @@ -556,9 +1012,25 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"\n" +"# bugfix: replace == with >=\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" msgid "And this is what it gives:" -msgstr "" +msgstr "و این چیزی است که به دست می‌دهد:" msgid "" "$ python prog.py 4 -vvv\n" @@ -571,15 +1043,28 @@ msgid "" " if args.verbosity >= 2:\n" "TypeError: '>=' not supported between instances of 'NoneType' and 'int'" msgstr "" +"$ python prog.py 4 -vvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -vvvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 11, in \n" +" if args.verbosity >= 2:\n" +"TypeError: '>=' not supported between instances of 'NoneType' and 'int'" -msgid "First output went well, and fixes the bug we had before. That is, we want any value >= 2 to be as verbose as possible." +msgid "" +"First output went well, and fixes the bug we had before. That is, we want " +"any value >= 2 to be as verbose as possible." msgstr "" +"خروجی نخست به‌خوبی پیش رفت و اشکالی را که پیش‌تر داشتیم برطرف می‌کند. یعنی " +"می‌خواهیم هر مقدار >= 2 تا حد ممکن پُرگویی داشته باشد." msgid "Third output not so good." -msgstr "" +msgstr "خروجی سوم چندان خوب نیست." msgid "Let's fix that bug::" -msgstr "" +msgstr "بیایید آن اشکال را برطرف کنیم::" msgid "" "import argparse\n" @@ -597,26 +1082,62 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" -msgid "We've just introduced yet another keyword, ``default``. We've set it to ``0`` in order to make it comparable to the other int values. Remember that by default, if an optional argument isn't specified, it gets the ``None`` value, and that cannot be compared to an int value (hence the :exc:`TypeError` exception)." -msgstr "" +msgid "" +"We've just introduced yet another keyword, ``default``. We've set it to " +"``0`` in order to make it comparable to the other int values. Remember that " +"by default, if an optional argument isn't specified, it gets the ``None`` " +"value, and that cannot be compared to an int value (hence the " +":exc:`TypeError` exception)." +msgstr "" +"ما همین حالا کلیدواژه‌ی دیگری به نام ``default`` را معرفی کردیم. ما آن را " +"روی ``0`` تنظیم کرده‌ایم تا بتوان آن را با سایر مقادیر عدد صحیح مقایسه کرد. " +"به خاطر داشته باشید که به‌طور پیش‌فرض، اگر آرگومان اختیاری مشخص نشده باشد، " +"مقدار ``None`` را دریافت می‌کند و نمی‌توان آن را با یک مقدار عدد صحیح مقایسه" +" کرد (از این رو استثنای :exc:`TypeError` رخ می‌دهد)." msgid "And:" -msgstr "" +msgstr "و:" msgid "" "$ python prog.py 4\n" "16" msgstr "" +"$ python prog.py 4\n" +"16" -msgid "You can go quite far just with what we've learned so far, and we have only scratched the surface. The :mod:`argparse` module is very powerful, and we'll explore a bit more of it before we end this tutorial." +msgid "" +"You can go quite far just with what we've learned so far, and we have only " +"scratched the surface. The :mod:`argparse` module is very powerful, and " +"we'll explore a bit more of it before we end this tutorial." msgstr "" +"شما می‌توانید فقط با آنچه تاکنون آموخته‌ایم بسیار پیش بروید، و ما تنها سطح " +"آن را خراش داده‌ایم. ماژول :mod:`argparse` بسیار قدرتمند است و پیش از پایان " +"این آموزش، کمی بیشتر آن را بررسی خواهیم کرد." msgid "Getting a little more advanced" -msgstr "" +msgstr "کمی پیشرفته‌تر" -msgid "What if we wanted to expand our tiny program to perform other powers, not just squares::" +msgid "" +"What if we wanted to expand our tiny program to perform other powers, not " +"just squares::" msgstr "" +"اگر بخواهیم برنامه‌ی کوچک خود را برای محاسبه‌ی توان‌های دیگر، نه فقط مربع‌ها، " +"گسترش دهیم::" msgid "" "import argparse\n" @@ -633,9 +1154,22 @@ msgid "" "else:\n" " print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == {answer}\")\n" +"else:\n" +" print(answer)" msgid "Output:" -msgstr "" +msgstr "خروجی:" msgid "" "$ python prog.py\n" @@ -654,9 +1188,30 @@ msgid "" "$ python prog.py 4 2 -v\n" "4^2 == 16" msgstr "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] x y\n" +"prog.py: error: the following arguments are required: x, y\n" +"$ python prog.py -h\n" +"usage: prog.py [-h] [-v] x y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16" -msgid "Notice that so far we've been using verbosity level to *change* the text that gets displayed. The following example instead uses verbosity level to display *more* text instead::" +msgid "" +"Notice that so far we've been using verbosity level to *change* the text " +"that gets displayed. The following example instead uses verbosity level to " +"display *more* text instead::" msgstr "" +"توجه کنید که تاکنون از سطح پرگویی برای *تغییر* متنی که نمایش داده می‌شود " +"استفاده کرده‌ایم. مثال زیر به‌جای آن از سطح پرگویی برای نمایش متن *بیشتر* " +"استفاده می‌کند::" msgid "" "import argparse\n" @@ -672,6 +1227,18 @@ msgid "" " print(f\"{args.x}^{args.y} == \", end=\"\")\n" "print(answer)" msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"Running '{__file__}'\")\n" +"if args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == \", end=\"\")\n" +"print(answer)" msgid "" "$ python prog.py 4 2\n" @@ -682,12 +1249,26 @@ msgid "" "Running 'prog.py'\n" "4^2 == 16" msgstr "" +"$ python prog.py 4 2\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -vv\n" +"Running 'prog.py'\n" +"4^2 == 16" msgid "Specifying ambiguous arguments" -msgstr "" +msgstr "مشخص کردن آرگومان‌های مبهم" -msgid "When there is ambiguity in deciding whether an argument is positional or for an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` that everything after that is a positional argument::" +msgid "" +"When there is ambiguity in deciding whether an argument is positional or for" +" an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " +"that everything after that is a positional argument::" msgstr "" +"هنگامی که در تشخیص اینکه یک آرگومان جایگاهی است یا برای یک آرگومان است، " +"ابهام وجود داشته باشد، می‌توان از ``--`` استفاده کرد تا به " +":meth:`~ArgumentParser.parse_args` گفته شود که همه‌چیز پس از آن یک آرگومان " +"جایگاهی است::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -709,12 +1290,43 @@ msgid "" ">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" "Namespace(args=['2', '3'], n=['1'])" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-n', nargs='+')\n" +">>> parser.add_argument('args', nargs='*')\n" +"\n" +">>> # ambiguous, so parse_args assumes it's an option\n" +">>> parser.parse_args(['-f'])\n" +"usage: PROG [-h] [-n N [N ...]] [args ...]\n" +"PROG: error: unrecognized arguments: -f\n" +"\n" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(args=['-f'], n=None)\n" +"\n" +">>> # ambiguous, so the -n option greedily accepts arguments\n" +">>> parser.parse_args(['-n', '1', '2', '3'])\n" +"Namespace(args=[], n=['1', '2', '3'])\n" +"\n" +">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" +"Namespace(args=['2', '3'], n=['1'])" msgid "Conflicting options" -msgstr "" +msgstr "گزینه‌های متعارض" -msgid "So far, we have been working with two methods of an :class:`argparse.ArgumentParser` instance. Let's introduce a third one, :meth:`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to specify options that conflict with each other. Let's also change the rest of the program so that the new functionality makes more sense: we'll introduce the ``--quiet`` option, which will be the opposite of the ``--verbose`` one::" -msgstr "" +msgid "" +"So far, we have been working with two methods of an " +":class:`argparse.ArgumentParser` instance. Let's introduce a third one, " +":meth:`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to " +"specify options that conflict with each other. Let's also change the rest of" +" the program so that the new functionality makes more sense: we'll introduce" +" the ``--quiet`` option, which will be the opposite of the ``--verbose`` " +"one::" +msgstr "" +"تاکنون، با دو متد از یک نمونه‌ی :class:`argparse.ArgumentParser` کار " +"کرده‌ایم. بیایید متد سومی را معرفی کنیم، " +":meth:`~ArgumentParser.add_mutually_exclusive_group`. این متد به ما امکان " +"می‌دهد گزینه‌هایی را مشخص کنیم که با یکدیگر ناسازگارند. بیایید همچنین سایر " +"بخش‌های برنامه را تغییر دهیم تا قابلیت جدید منطقی‌تر باشد: گزینه‌ی " +"``--quiet`` را معرفی خواهیم کرد، که متضاد گزینه‌ی ``--verbose`` خواهد بود::" msgid "" "import argparse\n" @@ -735,9 +1347,30 @@ msgid "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" -msgid "Our program is now simpler, and we've lost some functionality for the sake of demonstration. Anyways, here's the output:" +msgid "" +"Our program is now simpler, and we've lost some functionality for the sake " +"of demonstration. Anyways, here's the output:" msgstr "" +"برنامه‌ی ما اکنون ساده‌تر است و برخی قابلیت‌ها را به‌منظور نمایش از دست " +"داده‌ایم. به هر حال، خروجی به این صورت است:" msgid "" "$ python prog.py 4 2\n" @@ -753,12 +1386,34 @@ msgid "" "usage: prog.py [-h] [-v | -q] x y\n" "prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" msgstr "" +"$ python prog.py 4 2\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -q\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4 to the power 2 equals 16\n" +"$ python prog.py 4 2 -vq\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose\n" +"$ python prog.py 4 2 -v --quiet\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" -msgid "That should be easy to follow. I've added that last output so you can see the sort of flexibility you get, i.e. mixing long form options with short form ones." +msgid "" +"That should be easy to follow. I've added that last output so you can see " +"the sort of flexibility you get, i.e. mixing long form options with short " +"form ones." msgstr "" +"این باید به‌راحتی قابل‌فهم باشد. آن خروجی پایانی را افزوده‌ام تا بتوانید نوع" +" انعطاف‌پذیری‌ای را که در اختیار دارید ببینید، یعنی ترکیب گزینه‌های بلندبا " +"با گزینه‌های کوتاه‌با." -msgid "Before we conclude, you probably want to tell your users the main purpose of your program, just in case they don't know::" +msgid "" +"Before we conclude, you probably want to tell your users the main purpose of" +" your program, just in case they don't know::" msgstr "" +"پیش از آنکه به پایان برسیم، احتمالاً می‌خواهید هدف اصلی برنامه‌ی خود را به " +"کاربران خود بگویید، فقط برای حالتی که نمی‌دانند::" msgid "" "import argparse\n" @@ -779,9 +1434,32 @@ msgid "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(description=\"calculate X to the power of Y\")\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" -msgid "Note that slight difference in the usage text. Note the ``[-v | -q]``, which tells us that we can either use ``-v`` or ``-q``, but not both at the same time:" +msgid "" +"Note that slight difference in the usage text. Note the ``[-v | -q]``, which" +" tells us that we can either use ``-v`` or ``-q``, but not both at the same " +"time:" msgstr "" +"توجه کنید که تفاوت اندکی در متن کاربرد وجود دارد. به ``[-v | -q]`` توجه " +"کنید، که به ما می‌گوید می‌توانیم از ``-v`` یا ``-q`` استفاده کنیم، اما نه هر" +" دو به‌طور همزمان:" msgid "" "$ python prog.py --help\n" @@ -798,53 +1476,128 @@ msgid "" " -v, --verbose\n" " -q, --quiet" msgstr "" +"$ python prog.py --help\n" +"نحوه استفاده: prog.py [-h] [-v | -q] x y\n" +"\n" +"X را به توان Y محاسبه می‌کند\n" +"\n" +"آرگومان‌های جایگاهی:\n" +" x پایه\n" +" y توان\n" +"\n" +"گزینه‌ها:\n" +" -h, --help نمایش این پیام راهنما و خروج\n" +" -v, --verbose\n" +" -q, --quiet" msgid "How to translate the argparse output" -msgstr "" +msgstr "چگونه خروجی argparse را ترجمه کنیم" -msgid "The output of the :mod:`argparse` module such as its help text and error messages are all made translatable using the :mod:`gettext` module. This allows applications to easily localize messages produced by :mod:`argparse`. See also :ref:`i18n-howto`." +msgid "" +"The output of the :mod:`argparse` module such as its help text and error " +"messages are all made translatable using the :mod:`gettext` module. This " +"allows applications to easily localize messages produced by :mod:`argparse`." +" See also :ref:`i18n-howto`." msgstr "" +"خروجی‌های ماژول :mod:`argparse` مانند متن راهنما و پیام‌های خطای آن، همگی با" +" استفاده از ماژول :mod:`gettext` قابل ترجمه می‌شوند. این امکان را به " +"برنامه‌ها می‌دهد تا پیام‌های تولیدشده توسط :mod:`argparse` را به‌سادگی " +"بومی‌سازی کنند. همچنین :ref:`i18n-howto` را ببینید." msgid "For instance, in this :mod:`argparse` output:" -msgstr "" +msgstr "برای مثال، در این خروجی :mod:`argparse`:" -msgid "The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show this help message and exit`` are all translatable." +msgid "" +"The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " +"this help message and exit`` are all translatable." msgstr "" +"رشته‌های ``usage:``، ``positional arguments:``، ``options:`` و ``show this " +"help message and exit`` همگی قابل ترجمه هستند." -msgid "In order to translate these strings, they must first be extracted into a ``.po`` file. For example, using `Babel `__, run this command:" +msgid "" +"In order to translate these strings, they must first be extracted into a " +"``.po`` file. For example, using `Babel `__, run " +"this command:" msgstr "" +"برای ترجمه‌ی این رشته‌ها، ابتدا باید آن‌ها را به یک فایل ``.po`` استخراج " +"کنید. برای مثال، با استفاده از `Babel `__، این " +"فرمان را اجرا کنید:" msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" -msgstr "" +msgstr "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" -msgid "This command will extract all translatable strings from the :mod:`argparse` module and output them into a file named ``messages.po``. This command assumes that your Python installation is in ``/usr/lib``." +msgid "" +"This command will extract all translatable strings from the :mod:`argparse` " +"module and output them into a file named ``messages.po``. This command " +"assumes that your Python installation is in ``/usr/lib``." msgstr "" +"این دستور تمام رشته‌های ترجمه‌پذیر را از ماژول :mod:`argparse` استخراج " +"می‌کند و آن‌ها را در فایلی به نام ``messages.po`` خروجی می‌دهد. این دستور " +"فرض می‌کند که نصب پایتون شما در ``/usr/lib`` قرار دارد." -msgid "You can find out the location of the :mod:`argparse` module on your system using this script::" +msgid "" +"You can find out the location of the :mod:`argparse` module on your system " +"using this script::" msgstr "" +"شما می‌توانید با استفاده از این اسکریپت، محل ماژول :mod:`argparse` را در " +"سیستم خود بیابید::" msgid "" "import argparse\n" "print(argparse.__file__)" msgstr "" +"import argparse\n" +"print(argparse.__file__)" -msgid "Once the messages in the ``.po`` file are translated and the translations are installed using :mod:`gettext`, :mod:`argparse` will be able to display the translated messages." +msgid "" +"Once the messages in the ``.po`` file are translated and the translations " +"are installed using :mod:`gettext`, :mod:`argparse` will be able to display " +"the translated messages." msgstr "" +"پس از اینکه پیام‌های موجود در فایل ``.po`` ترجمه شدند و ترجمه‌ها با استفاده " +"از :mod:`gettext` نصب شدند، :mod:`argparse` می‌تواند پیام‌های ترجمه‌شده را " +"نمایش دهد." -msgid "To translate your own strings in the :mod:`argparse` output, use :mod:`gettext`." +msgid "" +"To translate your own strings in the :mod:`argparse` output, use " +":mod:`gettext`." msgstr "" +"برای ترجمه‌ی رشته‌های خودتان در خروجی :mod:`argparse`، از :mod:`gettext` " +"استفاده کنید." msgid "Custom type converters" -msgstr "" +msgstr "مبدل‌های نوع سفارشی" -msgid "The :mod:`argparse` module allows you to specify custom type converters for your command-line arguments. This allows you to modify user input before it's stored in the :class:`argparse.Namespace`. This can be useful when you need to pre-process the input before it is used in your program." +msgid "" +"The :mod:`argparse` module allows you to specify custom type converters for " +"your command-line arguments. This allows you to modify user input before " +"it's stored in the :class:`argparse.Namespace`. This can be useful when you " +"need to pre-process the input before it is used in your program." msgstr "" +"ماژول :mod:`argparse` به شما امکان می‌دهد مبدل‌های نوع سفارشی برای " +"آرگومان‌های خط فرمان خود تعیین کنید. این امکان به شما اجازه می‌دهد ورودی " +"کاربر را پیش از ذخیره شدن در :class:`argparse.Namespace` تغییر دهید. این " +"می‌تواند زمانی مفید باشد که نیاز دارید ورودی را پیش از استفاده در برنامه‌تان" +" پیش‌پردازش کنید." -msgid "When using a custom type converter, you can use any callable that takes a single string argument (the argument value) and returns the converted value. However, if you need to handle more complex scenarios, you can use a custom action class with the **action** parameter instead." +msgid "" +"When using a custom type converter, you can use any callable that takes a " +"single string argument (the argument value) and returns the converted value." +" However, if you need to handle more complex scenarios, you can use a custom" +" action class with the **action** parameter instead." msgstr "" +"هنگام استفاده از یک مبدل نوع سفارشی، می‌توانید از هر فراخوان‌پذیری که یک " +"آرگومان رشته‌ای دریافت می‌کند (مقدار آرگومان) و مقدار تبدیل‌شده را " +"برمی‌گرداند، استفاده کنید. با این حال، اگر نیاز به مدیریت حالت‌های پیچیده‌تر" +" دارید، می‌توانید به‌جای آن از یک کلاس اکشنسفارشی با پارامتر " +"**action** استفاده کنید." -msgid "For example, let's say you want to handle arguments with different prefixes and process them accordingly::" +msgid "" +"For example, let's say you want to handle arguments with different prefixes " +"and process them accordingly::" msgstr "" +"برای مثال، فرض کنید می‌خواهید آرگومان‌هایی با پیشوندهای مختلف را مدیریت کنید" +" و آن‌ها را بر همان اساس پردازش کنید::" msgid "" "import argparse\n" @@ -859,26 +1612,63 @@ msgid "" "args = parser.parse_args()\n" "print(args)" msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" msgid "" "$ python prog.py -a value1 +a value2\n" "Namespace(a=[('-', 'value1'), ('+', 'value2')])" msgstr "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" msgid "In this example, we:" -msgstr "" +msgstr "در این مثال، ما:" -msgid "Created a parser with custom prefix characters using the ``prefix_chars`` parameter." +msgid "" +"Created a parser with custom prefix characters using the ``prefix_chars`` " +"parameter." msgstr "" +"یک پارسر با نویسه‌های پیشوند سفارشی با استفاده از پارامتر ``prefix_chars`` " +"ایجاد شد." -msgid "Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter to create custom type converters to store the value in a tuple with the prefix." +msgid "" +"Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " +"to create custom type converters to store the value in a tuple with the " +"prefix." msgstr "" +"دو آرگومان ``-a`` و ``+a`` تعریف شدند که از پارامتر ``type`` برای ایجاد " +"مبدل‌های نوع سفارشی استفاده می‌کردند تا مقدار را در یک تاپلهمراه با" +" پیشوند ذخیره کنند." -msgid "Without the custom type converters, the arguments would have treated the ``-a`` and ``+a`` as the same argument, which would have been undesirable. By using custom type converters, we were able to differentiate between the two arguments." +msgid "" +"Without the custom type converters, the arguments would have treated the " +"``-a`` and ``+a`` as the same argument, which would have been undesirable. " +"By using custom type converters, we were able to differentiate between the " +"two arguments." msgstr "" +"بدون مبدل‌های نوع سفارشی، ``-a`` و ``+a`` به‌عنوان یک آرگومان یکسان تلقی " +"می‌شدند، که این موضوع نامطلوب بود. با استفاده از مبدل‌های نوع سفارشی، " +"توانستیم بین این دو آرگومان تمایز قائل شویم." msgid "Conclusion" -msgstr "" +msgstr "نتیجه‌گیری" -msgid "The :mod:`argparse` module offers a lot more than shown here. Its docs are quite detailed and thorough, and full of examples. Having gone through this tutorial, you should easily digest them without feeling overwhelmed." -msgstr "" +msgid "" +"The :mod:`argparse` module offers a lot more than shown here. Its docs are " +"quite detailed and thorough, and full of examples. Having gone through this " +"tutorial, you should easily digest them without feeling overwhelmed." +msgstr "" +"ماژول :mod:`argparse` امکانات بسیار بیشتری نسبت به آنچه در اینجا نشان داده " +"شد ارائه می‌دهد. مستندات آن کاملاً دقیق و جامع و سرشار از مثال است. پس از " +"گذراندن این آموزش، باید بتوانید به‌راحتی آن‌ها را درک کنید، بدون آن‌که احساس" +" کنید مطالب برایتان سنگین است." diff --git a/howto/clinic.po b/howto/clinic.po index 3ae078fca..37debba34 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -24,7 +24,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Argument Clinic How-To" -msgstr "" +msgstr "راهنمای Argument Clinic" -msgid "The Argument Clinic How-TO has been moved to the `Python Developer's Guide `__." +msgid "" +"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " +"`__." msgstr "" +"راهنمای Argument Clinic به `راهنمای توسعه‌دهندگان پایتون " +"`__ منتقل شده است." diff --git a/howto/cporting.po b/howto/cporting.po index eefa4d00b..9e1c6f112 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -22,16 +22,36 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Porting Extension Modules to Python 3" -msgstr "" +msgstr "انتقال ماژول‌های توسعه به Python 3" -msgid "We recommend the following resources for porting extension modules to Python 3:" -msgstr "" +msgid "" +"We recommend the following resources for porting extension modules to Python" +" 3:" +msgstr "برای انتقال ماژول‌های توسعه به Python 3، منابع زیر را توصیه می‌کنیم:" -msgid "The `Migrating C extensions`_ chapter from *Supporting Python 3: An in-depth guide*, a book on moving from Python 2 to Python 3 in general, guides the reader through porting an extension module." +msgid "" +"The `Migrating C extensions`_ chapter from *Supporting Python 3: An in-depth" +" guide*, a book on moving from Python 2 to Python 3 in general, guides the " +"reader through porting an extension module." msgstr "" +"فصل `Migrating C extensions`_ از کتاب *Supporting Python 3: An in-depth " +"guide*، کتابی درباره‌ی مهاجرت از Python 2 به Python 3 به‌طور کلی، خواننده را " +"در انتقال یک ماژول توسعه راهنمایی می‌کند." -msgid "The `Porting guide`_ from the *py3c* project provides opinionated suggestions with supporting code." +msgid "" +"The `Porting guide`_ from the *py3c* project provides opinionated " +"suggestions with supporting code." msgstr "" +"`Porting guide`_ از پروژه *py3c* پیشنهادهای مبتنی بر نظر را به همراه کد " +"پشتیبانی ارائه می‌دهد." -msgid ":ref:`Recommended third party tools ` offer abstractions over the Python's C API. Extensions generally need to be re-written to use one of them, but the library then handles differences between various Python versions and implementations." +msgid "" +":ref:`Recommended third party tools ` offer abstractions over " +"the Python's C API. Extensions generally need to be re-written to use one of" +" them, but the library then handles differences between various Python " +"versions and implementations." msgstr "" +":ref:`ابزارهای شخص ثالث توصیه‌شده ` سطوح انتزاعی بر فراز C API " +"پایتون ارائه می‌دهند. افزونه‌ها عموماً باید برای استفاده از یکی از آن‌ها " +"بازنویسی شوند، اما در این صورت کتابخانه تفاوت‌های میان نسخه‌ها و " +"پیاده‌سازی‌های مختلف پایتون را مدیریت می‌کند." diff --git a/howto/curses.po b/howto/curses.po index 94c94c121..fb449d8e6 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -25,102 +25,263 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Curses Programming with Python" -msgstr "" +msgstr "برنامه‌نویسی Curses با پایتون" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "A.M. Kuchling, Eric S. Raymond" -msgstr "" +msgstr "A.M. Kuchling, Eric S. Raymond" msgid "Release" -msgstr "" +msgstr "انتشار" msgid "2.04" -msgstr "" +msgstr "2.04" msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "This document describes how to use the :mod:`curses` extension module to control text-mode displays." +msgid "" +"This document describes how to use the :mod:`curses` extension module to " +"control text-mode displays." msgstr "" +"این سند چگونگی استفاده از ماژول افزونه‌ی :mod:`curses` را برای کنترل " +"نمایشگرهای حالت متنی توضیح می‌دهد." msgid "What is curses?" -msgstr "" +msgstr "curses چیست؟" -msgid "The curses library supplies a terminal-independent screen-painting and keyboard-handling facility for text-based terminals; such terminals include VT100s, the Linux console, and the simulated terminal provided by various programs. Display terminals support various control codes to perform common operations such as moving the cursor, scrolling the screen, and erasing areas. Different terminals use widely differing codes, and often have their own minor quirks." -msgstr "" +msgid "" +"The curses library supplies a terminal-independent screen-painting and " +"keyboard-handling facility for text-based terminals; such terminals include " +"VT100s, the Linux console, and the simulated terminal provided by various " +"programs. Display terminals support various control codes to perform common" +" operations such as moving the cursor, scrolling the screen, and erasing " +"areas. Different terminals use widely differing codes, and often have their" +" own minor quirks." +msgstr "" +"کتابخانه‌ی curses سازوکار ترسیم صفحه و مدیریت صفحه‌کلید مستقل از پایانه را " +"برای پایانه‌های مبتنی بر متن فراهم می‌کند؛ چنین پایانه‌هایی شامل پایانه‌های " +"VT100، کنسول لینوکس و پایانه شبیه‌سازی‌شده‌ای می‌شوند که برنامه‌های مختلف آن" +" را فراهم می‌کنند. پایانه‌های نمایشی از کدهای کنترلی گوناگونی برای انجام " +"عملیات رایج مانند جابه‌جایی مکان‌نما، پیمایش صفحه و پاک‌سازی ناحیه‌ها " +"پشتیبانی می‌کنند. پایانه‌های مختلف از کدهای بسیار متفاوتی استفاده می‌کنند و " +"اغلب رفتارهای خاص جزئی خود را دارند." -msgid "In a world of graphical displays, one might ask \"why bother\"? It's true that character-cell display terminals are an obsolete technology, but there are niches in which being able to do fancy things with them are still valuable. One niche is on small-footprint or embedded Unixes that don't run an X server. Another is tools such as OS installers and kernel configurators that may have to run before any graphical support is available." -msgstr "" +msgid "" +"In a world of graphical displays, one might ask \"why bother\"? It's true " +"that character-cell display terminals are an obsolete technology, but there " +"are niches in which being able to do fancy things with them are still " +"valuable. One niche is on small-footprint or embedded Unixes that don't run" +" an X server. Another is tools such as OS installers and kernel " +"configurators that may have to run before any graphical support is " +"available." +msgstr "" +"در دنیای نمایشگرهای گرافیکی، ممکن است کسی بپرسد «چرا زحمت بکشیم؟». درست است" +" که پایانه‌های نمایشی مبتنی بر سلول‌های نویسه‌ای یک فناوری منسوخ هستند، اما " +"حوزه‌هایی وجود دارند که در آن‌ها توانایی انجام کارهای پیشرفته با آن‌ها " +"همچنان ارزشمند است. یکی از این حوزه‌ها، یونیکس‌های کم‌حجم یا نهفته هستند که " +"کارساز X را اجرا نمی‌کنند. حوزه‌ی دیگر، ابزارهایی مانند نصب‌کننده‌های " +"سیستم‌عامل و پیکربندی‌کننده‌های هسته هستند که ممکن است لازم باشد پیش از در " +"دسترس بودن هرگونه پشتیبانی گرافیکی اجرا شوند." -msgid "The curses library provides fairly basic functionality, providing the programmer with an abstraction of a display containing multiple non-overlapping windows of text. The contents of a window can be changed in various ways---adding text, erasing it, changing its appearance---and the curses library will figure out what control codes need to be sent to the terminal to produce the right output. curses doesn't provide many user-interface concepts such as buttons, checkboxes, or dialogs; if you need such features, consider a user interface library such as :pypi:`Urwid`." -msgstr "" +msgid "" +"The curses library provides fairly basic functionality, providing the " +"programmer with an abstraction of a display containing multiple non-" +"overlapping windows of text. The contents of a window can be changed in " +"various ways---adding text, erasing it, changing its appearance---and the " +"curses library will figure out what control codes need to be sent to the " +"terminal to produce the right output. curses doesn't provide many user-" +"interface concepts such as buttons, checkboxes, or dialogs; if you need such" +" features, consider a user interface library such as :pypi:`Urwid`." +msgstr "" +"کتابخانه‌ی curses قابلیت‌های نسبتاً پایه‌ای را فراهم می‌کند و انتزاعی از یک " +"صفحه‌نمایش حاوی چند پنجره‌ی متنی بدون هم‌پوشانی را در اختیار برنامه‌نویس قرار" +" می‌دهد. محتوای یک پنجره را می‌توان به روش‌های مختلفی تغییر داد — افزودن " +"متن، پاک کردن آن، تغییر ظاهر آن — و کتابخانه‌ی curses تشخیص می‌دهد که چه " +"کدهای کنترلی باید به پایانه ارسال شوند تا خروجی صحیح تولید شود. curses " +"مفاهیم زیادی از رابط کاربری مانند دکمه‌ها، جعبه‌های انتخاب یا کادرهای " +"محاوره را فراهم نمی‌کند؛ اگر به چنین امکاناتی نیاز دارید، یک کتابخانه‌ی رابط " +"کاربری مانند :pypi:`Urwid` را در نظر بگیرید." -msgid "The curses library was originally written for BSD Unix; the later System V versions of Unix from AT&T added many enhancements and new functions. BSD curses is no longer maintained, having been replaced by ncurses, which is an open-source implementation of the AT&T interface. If you're using an open-source Unix such as Linux or FreeBSD, your system almost certainly uses ncurses. Since most current commercial Unix versions are based on System V code, all the functions described here will probably be available. The older versions of curses carried by some proprietary Unixes may not support everything, though." -msgstr "" +msgid "" +"The curses library was originally written for BSD Unix; the later System V " +"versions of Unix from AT&T added many enhancements and new functions. BSD " +"curses is no longer maintained, having been replaced by ncurses, which is an" +" open-source implementation of the AT&T interface. If you're using an open-" +"source Unix such as Linux or FreeBSD, your system almost certainly uses " +"ncurses. Since most current commercial Unix versions are based on System V " +"code, all the functions described here will probably be available. The " +"older versions of curses carried by some proprietary Unixes may not support " +"everything, though." +msgstr "" +"کتابخانه curses در ابتدا برای BSD Unix نوشته شد؛ نسخه‌های بعدی Unix از نوع " +"System V که از سوی AT&T ارائه شدند، بهبودها و توابع جدید بسیاری را افزودند. " +"BSD curses دیگر نگهداری نمی‌شود و با ncurses جایگزین شده است؛ ncurses " +"پیاده‌سازی متن‌بازی از رابط AT&T است. اگر از یک Unix متن‌باز مانند Linux یا " +"FreeBSD استفاده می‌کنید، سیستم شما تقریباً به‌طور قطع از ncurses استفاده " +"می‌کند. از آنجا که بیشتر نسخه‌های تجاری کنونی Unix مبتنی بر کد System V " +"هستند، احتمالاً همه توابع توصیف‌شده در اینجا در دسترس خواهند بود. البته ممکن" +" است نسخه‌های قدیمی‌تر curses موجود در برخی Unixهای اختصاصی از همه موارد " +"پشتیبانی نکنند." -msgid "The Windows version of Python doesn't include the :mod:`curses` module. The third-party :pypi:`windows-curses` package provides the same interface on Windows." +msgid "" +"The Windows version of Python doesn't include the :mod:`curses` module. The " +"third-party :pypi:`windows-curses` package provides the same interface on " +"Windows." msgstr "" +"نسخه پایتون برای ویندوز شامل ماژول :mod:`curses` نمی‌شود. بسته شخص ثالث " +":pypi:`windows-curses` همان رابط را در ویندوز فراهم می‌کند." msgid "The Python curses module" -msgstr "" +msgstr "ماژول curses پایتون" -msgid "The Python module is a fairly simple wrapper over the C functions provided by curses; if you're already familiar with curses programming in C, it's really easy to transfer that knowledge to Python. The biggest difference is that the Python interface makes things simpler by merging different C functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and :c:func:`!mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see this covered in more detail later." -msgstr "" +msgid "" +"The Python module is a fairly simple wrapper over the C functions provided " +"by curses; if you're already familiar with curses programming in C, it's " +"really easy to transfer that knowledge to Python. The biggest difference is" +" that the Python interface makes things simpler by merging different C " +"functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and " +":c:func:`!mvwaddstr` into a single :meth:`~curses.window.addstr` method. " +"You'll see this covered in more detail later." +msgstr "" +"ماژول پایتون، پوششی نسبتاً ساده بر روی توابع C ارائه‌شده توسط curses است؛ " +"اگر از قبل با برنامه‌نویسی curses در C آشنا هستید، انتقال آن دانش به پایتون " +"بسیار آسان است. بزرگ‌ترین تفاوت این است که رابط پایتون با ادغام توابع مختلف " +"C مانند :c:func:`!addstr`، :c:func:`!mvaddstr` و :c:func:`!mvwaddstr` در یک " +"متد :meth:`~curses.window.addstr` واحد، کارها را ساده‌تر می‌کند. این موضوع " +"را بعداً با جزئیات بیشتری خواهید دید." -msgid "This HOWTO is an introduction to writing text-mode programs with curses and Python. It doesn't attempt to be a complete guide to the curses API; for that, see the Python library guide's section on ncurses, and the C manual pages for ncurses. It will, however, give you the basic ideas." +msgid "" +"This HOWTO is an introduction to writing text-mode programs with curses and " +"Python. It doesn't attempt to be a complete guide to the curses API; for " +"that, see the Python library guide's section on ncurses, and the C manual " +"pages for ncurses. It will, however, give you the basic ideas." msgstr "" +"این HOWTO مقدمه‌ای است برای نوشتن برنامه‌های حالت متنی با curses و پایتون. " +"این راهنما تلاش نمی‌کند راهنمای کاملی برای API curses باشد؛ برای آن، بخش " +"مربوط به ncurses در راهنمای کتابخانه‌ی پایتون و صفحات راهنمای C برای ncurses" +" را ببینید. با این حال، ایده‌های پایه را به شما ارائه می‌دهد." msgid "Starting and ending a curses application" -msgstr "" +msgstr "شروع و پایان یک برنامه curses" -msgid "Before doing anything, curses must be initialized. This is done by calling the :func:`~curses.initscr` function, which will determine the terminal type, send any required setup codes to the terminal, and create various internal data structures. If successful, :func:`!initscr` returns a window object representing the entire screen; this is usually called ``stdscr`` after the name of the corresponding C variable. ::" -msgstr "" +msgid "" +"Before doing anything, curses must be initialized. This is done by calling " +"the :func:`~curses.initscr` function, which will determine the terminal " +"type, send any required setup codes to the terminal, and create various " +"internal data structures. If successful, :func:`!initscr` returns a window " +"object representing the entire screen; this is usually called ``stdscr`` " +"after the name of the corresponding C variable. ::" +msgstr "" +"پیش از انجام هر کاری، باید curses راه‌اندازی شود. این کار با فراخوانی تابع " +":func:`~curses.initscr` انجام می‌شود؛ این تابع نوع پایانه را مشخص می‌کند، " +"کدهای راه‌اندازی لازم را به پایانه ارسال می‌کند و ساختارهای داده درونی " +"مختلفی را ایجاد می‌کند. در صورت موفقیت، :func:`!initscr` یک شیء پنجره را " +"برمی‌گرداند که نمایانگر تمام صفحه است؛ این شیء معمولاً ``stdscr`` نامیده " +"می‌شود، برگرفته از نام متغیر متناظر در C. ::" msgid "" "import curses\n" "stdscr = curses.initscr()" msgstr "" +"import curses\n" +"stdscr = curses.initscr()" -msgid "Usually curses applications turn off automatic echoing of keys to the screen, in order to be able to read keys and only display them under certain circumstances. This requires calling the :func:`~curses.noecho` function. ::" +msgid "" +"Usually curses applications turn off automatic echoing of keys to the " +"screen, in order to be able to read keys and only display them under certain" +" circumstances. This requires calling the :func:`~curses.noecho` function. " +"::" msgstr "" +"معمولاً برنامه‌های curses بازتاب خودکار کلیدها در صفحه را خاموش می‌کنند، تا " +"بتوانند کلیدها را بخوانند و تنها تحت شرایط خاصی آن‌ها را نمایش دهند. این کار" +" نیازمند فراخوانی تابع :func:`~curses.noecho` است. ::" msgid "curses.noecho()" -msgstr "" +msgstr "curses.noecho()" -msgid "Applications will also commonly need to react to keys instantly, without requiring the Enter key to be pressed; this is called cbreak mode, as opposed to the usual buffered input mode. ::" +msgid "" +"Applications will also commonly need to react to keys instantly, without " +"requiring the Enter key to be pressed; this is called cbreak mode, as " +"opposed to the usual buffered input mode. ::" msgstr "" +"برنامه‌ها نیز معمولاً نیاز دارند که به کلیدها بلافاصله واکنش نشان دهند، بدون" +" نیاز به فشرده شدن کلید Enter؛ به این حالت، حالت cbreak گفته می‌شود، در " +"مقابل حالت معمول ورودی بافرشده. ::" msgid "curses.cbreak()" -msgstr "" +msgstr "curses.cbreak()" -msgid "Terminals usually return special keys, such as the cursor keys or navigation keys such as Page Up and Home, as a multibyte escape sequence. While you could write your application to expect such sequences and process them accordingly, curses can do it for you, returning a special value such as :const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to enable keypad mode. ::" -msgstr "" +msgid "" +"Terminals usually return special keys, such as the cursor keys or navigation" +" keys such as Page Up and Home, as a multibyte escape sequence. While you " +"could write your application to expect such sequences and process them " +"accordingly, curses can do it for you, returning a special value such as " +":const:`curses.KEY_LEFT`. To get curses to do the job, you'll have to " +"enable keypad mode. ::" +msgstr "" +"ترمینال‌ها معمولاً کلیدهای خاصی، مانند کلیدهای مکان‌نما یا کلیدهای پیمایش" +" مانند Page Up و Home را به‌صورت یک دنباله‌ی گریز چندبایتی برمی‌گردانند. " +"اگرچه می‌توانستید برنامه‌ی خود را طوری بنویسید که چنین دنباله‌هایی را انتظار" +" داشته باشد و آن‌ها را متناسب با آن پردازش کند، اما curses می‌تواند این کار " +"را برای شما انجام دهد و مقدار خاصی مانند :const:`curses.KEY_LEFT` را " +"برگرداند. برای اینکه curses این کار را انجام دهد، باید حالت keypad را فعال " +"کنید. ::" msgid "stdscr.keypad(True)" -msgstr "" +msgstr "stdscr.keypad(True)" -msgid "Terminating a curses application is much easier than starting one. You'll need to call::" +msgid "" +"Terminating a curses application is much easier than starting one. You'll " +"need to call::" msgstr "" +"پایان دادن به یک برنامه‌ی curses بسیار آسان‌تر از آغاز آن است. باید آن را " +"فراخوانی کنید::" msgid "" "curses.nocbreak()\n" "stdscr.keypad(False)\n" "curses.echo()" msgstr "" +"curses.nocbreak()\n" +"stdscr.keypad(False)\n" +"curses.echo()" -msgid "to reverse the curses-friendly terminal settings. Then call the :func:`~curses.endwin` function to restore the terminal to its original operating mode. ::" +msgid "" +"to reverse the curses-friendly terminal settings. Then call the " +":func:`~curses.endwin` function to restore the terminal to its original " +"operating mode. ::" msgstr "" +"برای معکوس کردن تنظیمات ترمینال سازگار با curses. سپس تابع " +":func:`~curses.endwin` را فراخوانی کنید تا ترمینال به حالت عملیاتی اصلی خود " +"بازگردد. ::" msgid "curses.endwin()" -msgstr "" +msgstr "curses.endwin()" -msgid "A common problem when debugging a curses application is to get your terminal messed up when the application dies without restoring the terminal to its previous state. In Python this commonly happens when your code is buggy and raises an uncaught exception. Keys are no longer echoed to the screen when you type them, for example, which makes using the shell difficult." -msgstr "" +msgid "" +"A common problem when debugging a curses application is to get your terminal" +" messed up when the application dies without restoring the terminal to its " +"previous state. In Python this commonly happens when your code is buggy and" +" raises an uncaught exception. Keys are no longer echoed to the screen when" +" you type them, for example, which makes using the shell difficult." +msgstr "" +"یک مشکل رایج هنگام اشکال‌زدایی از یک برنامه curses این است که وقتی برنامه " +"بدون بازگرداندن پایانه به وضعیت پیشین خود از کار می‌افتد، پایانه شما به‌هم " +"بریزد. در پایتون، این اتفاق معمولاً زمانی رخ می‌دهد که کد شما دارای اشکال " +"باشد و یک استثنای گرفته‌نشده را پرتاب کند. برای مثال، کلیدها دیگر هنگام تایپ" +" روی صفحه بازتاب داده نمی‌شوند، که این موضوع استفاده از پوسته را دشوار " +"می‌کند." -msgid "In Python you can avoid these complications and make debugging much easier by importing the :func:`curses.wrapper` function and using it like this::" +msgid "" +"In Python you can avoid these complications and make debugging much easier " +"by importing the :func:`curses.wrapper` function and using it like this::" msgstr "" +"در پایتون می‌توانید با ایمپورت کردن تابع :func:`curses.wrapper` و استفاده از" +" آن به این شکل، از این پیچیدگی‌ها اجتناب کنید و اشکال‌زدایی را بسیار آسان‌تر" +" سازید::" msgid "" "from curses import wrapper\n" @@ -139,42 +300,161 @@ msgid "" "\n" "wrapper(main)" msgstr "" +"from curses import wrapper\n" +"\n" +"def main(stdscr):\n" +" # پاک‌سازی صفحه\n" +" stdscr.clear()\n" +"\n" +" # این عبارت هنگامی که i == 10 باشد، ZeroDivisionError را پرتاب می‌کند.\n" +" for i in range(0, 11):\n" +" v = i-10\n" +" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" +"\n" +" stdscr.refresh()\n" +" stdscr.getkey()\n" +"\n" +"wrapper(main)" -msgid "The :func:`~curses.wrapper` function takes a callable object and does the initializations described above, also initializing colors if color support is present. :func:`!wrapper` then runs your provided callable. Once the callable returns, :func:`!wrapper` will restore the original state of the terminal. The callable is called inside a :keyword:`try`...\\ :keyword:`except` that catches exceptions, restores the state of the terminal, and then re-raises the exception. Therefore your terminal won't be left in a funny state on exception and you'll be able to read the exception's message and traceback." -msgstr "" +msgid "" +"The :func:`~curses.wrapper` function takes a callable object and does the " +"initializations described above, also initializing colors if color support " +"is present. :func:`!wrapper` then runs your provided callable. Once the " +"callable returns, :func:`!wrapper` will restore the original state of the " +"terminal. The callable is called inside a :keyword:`try`...\\ " +":keyword:`except` that catches exceptions, restores the state of the " +"terminal, and then re-raises the exception. Therefore your terminal won't " +"be left in a funny state on exception and you'll be able to read the " +"exception's message and traceback." +msgstr "" +"تابع :func:`~curses.wrapper` یک شیء فراخوانی‌پذیر می‌گیرد، مقداردهی‌های " +"اولیه‌ی توصیف‌شده در بالا را انجام می‌دهد و در صورت وجود پشتیبانی از رنگ، " +"رنگ‌ها را نیز مقداردهی اولیه می‌کند. سپس :func:`!wrapper` فراخوانی‌پذیر " +"ارائه‌شده‌ی شما را اجرا می‌کند. پس از بازگشت فراخوانی‌پذیر، :func:`!wrapper`" +" وضعیت اصلی پایانه را بازیابی خواهد کرد. فراخوانی‌پذیر درون یک " +":keyword:`try`...\\ :keyword:`except` فراخوانی می‌شود که استثناها را " +"می‌گیرد، وضعیت پایانه را بازیابی می‌کند و سپس استثنا را دوباره پرتاب می‌کند." +" بنابراین در صورت بروز استثنا، پایانه‌ی شما در وضعیت نامناسبی باقی نخواهد " +"ماند و می‌توانید پیام و ردگیری پشته‌ی استثنا را بخوانید." msgid "Windows and Pads" -msgstr "" +msgstr "پنجره‌ها و پدها" -msgid "Windows are the basic abstraction in curses. A window object represents a rectangular area of the screen, and supports methods to display text, erase it, allow the user to input strings, and so forth." +msgid "" +"Windows are the basic abstraction in curses. A window object represents a " +"rectangular area of the screen, and supports methods to display text, erase " +"it, allow the user to input strings, and so forth." msgstr "" +"پنجره‌ها انتزاع پایه در curses هستند. یک شیء پنجره نشان‌دهنده‌ی یک ناحیه‌ی " +"مستطیلی از صفحه است و از متدهایی برای نمایش متن، پاک کردن آن، اجازه دادن به " +"کاربر برای وارد کردن رشته‌ها و غیره پشتیبانی می‌کند." -msgid "The ``stdscr`` object returned by the :func:`~curses.initscr` function is a window object that covers the entire screen. Many programs may need only this single window, but you might wish to divide the screen into smaller windows, in order to redraw or clear them separately. The :func:`~curses.newwin` function creates a new window of a given size, returning the new window object. ::" -msgstr "" +msgid "" +"The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " +"window object that covers the entire screen. Many programs may need only " +"this single window, but you might wish to divide the screen into smaller " +"windows, in order to redraw or clear them separately. The " +":func:`~curses.newwin` function creates a new window of a given size, " +"returning the new window object. ::" +msgstr "" +"شیء ``stdscr`` که توسط تابع :func:`~curses.initscr` برگردانده می‌شود، یک شیء" +" پنجره است که کل صفحه را می‌پوشاند. بسیاری از برنامه‌ها ممکن است تنها به " +"همین یک پنجره نیاز داشته باشند، اما شما ممکن است بخواهید صفحه را به " +"پنجره‌های کوچک‌تر تقسیم کنید تا آن‌ها را به‌طور جداگانه بازترسیم یا پاک " +"کنید. تابع :func:`~curses.newwin` یک پنجره جدید با اندازه‌ای مشخص ایجاد " +"می‌کند و شیء پنجره جدید را برمی‌گرداند. ::" msgid "" "begin_x = 20; begin_y = 7\n" "height = 5; width = 40\n" "win = curses.newwin(height, width, begin_y, begin_x)" msgstr "" +"begin_x = 20; begin_y = 7\n" +"height = 5; width = 40\n" +"win = curses.newwin(height, width, begin_y, begin_x)" -msgid "Note that the coordinate system used in curses is unusual. Coordinates are always passed in the order *y,x*, and the top-left corner of a window is coordinate (0,0). This breaks the normal convention for handling coordinates where the *x* coordinate comes first. This is an unfortunate difference from most other computer applications, but it's been part of curses since it was first written, and it's too late to change things now." -msgstr "" +msgid "" +"Note that the coordinate system used in curses is unusual. Coordinates are " +"always passed in the order *y,x*, and the top-left corner of a window is " +"coordinate (0,0). This breaks the normal convention for handling " +"coordinates where the *x* coordinate comes first. This is an unfortunate " +"difference from most other computer applications, but it's been part of " +"curses since it was first written, and it's too late to change things now." +msgstr "" +"توجه داشته باشید که دستگاه مختصات استفاده‌شده در curses غیرمعمول است. مختصات" +" همیشه به ترتیب *y,x* ارسال می‌شود و گوشه‌ی بالا سمت چپ یک پنجره، مختصات " +"(۰،۰) است. این امر قرارداد رایج برای مدیریت مختصات را می‌شکند؛ قراردادی که " +"در آن مختصات *x* ابتدا می‌آید. این یک تفاوت ناخوشایند با بیشتر برنامه‌های " +"کاربردی رایانه‌ای دیگر است، اما از زمان نخستین نگارش curses بخشی از آن بوده " +"است و اکنون برای تغییر این موارد خیلی دیر است." -msgid "Your application can determine the size of the screen by using the :data:`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* sizes. Legal coordinates will then extend from ``(0,0)`` to ``(curses.LINES - 1, curses.COLS - 1)``." +msgid "" +"Your application can determine the size of the screen by using the " +":data:`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and" +" *x* sizes. Legal coordinates will then extend from ``(0,0)`` to " +"``(curses.LINES - 1, curses.COLS - 1)``." msgstr "" +"برنامه‌ی شما می‌تواند با استفاده از متغیرهای :data:`curses.LINES` و " +":data:`curses.COLS` اندازه‌ی صفحه را تعیین کند تا اندازه‌های *y* و *x* را به" +" دست آورد. در این صورت، مختصات مجاز از ``(0,0)`` تا ``(curses.LINES - 1, " +"curses.COLS - 1)`` خواهد بود." -msgid "When you call a method to display or erase text, the effect doesn't immediately show up on the display. Instead you must call the :meth:`~curses.window.refresh` method of window objects to update the screen." +msgid "" +"When you call a method to display or erase text, the effect doesn't " +"immediately show up on the display. Instead you must call the " +":meth:`~curses.window.refresh` method of window objects to update the " +"screen." msgstr "" +"هنگامی که یک متد را برای نمایش یا پاک کردن متن فراخوانی می‌کنید، اثر آن " +"بلافاصله روی نمایشگر ظاهر نمی‌شود. در عوض، باید متد " +":meth:`~curses.window.refresh` اشیای پنجره را فراخوانی کنید تا صفحه " +"به‌روزرسانی شود." -msgid "This is because curses was originally written with slow 300-baud terminal connections in mind; with these terminals, minimizing the time required to redraw the screen was very important. Instead curses accumulates changes to the screen and displays them in the most efficient manner when you call :meth:`!refresh`. For example, if your program displays some text in a window and then clears the window, there's no need to send the original text because they're never visible." -msgstr "" +msgid "" +"This is because curses was originally written with slow 300-baud terminal " +"connections in mind; with these terminals, minimizing the time required to " +"redraw the screen was very important. Instead curses accumulates changes to" +" the screen and displays them in the most efficient manner when you call " +":meth:`!refresh`. For example, if your program displays some text in a " +"window and then clears the window, there's no need to send the original text" +" because they're never visible." +msgstr "" +"دلیل این امر آن است که curses در ابتدا با در نظر گرفتن اتصالات پایانه‌ای کند" +" با نرخ ۳۰۰ بود نوشته شده بود؛ در این پایانه‌ها، به حداقل رساندن زمان لازم " +"برای بازترسیم صفحه بسیار مهم بود. در عوض، curses تغییرات صفحه را انباشته " +"می‌کند و هنگامی که شما :meth:`!refresh` را فراخوانی می‌کنید، آن‌ها را به " +"کارآمدترین شیوه نمایش می‌دهد. برای مثال، اگر برنامه شما متنی را در یک پنجره " +"نمایش دهد و سپس پنجره را پاک کند، نیازی به ارسال متن اصلی نیست، زیرا هرگز " +"قابل مشاهده نیست." -msgid "In practice, explicitly telling curses to redraw a window doesn't really complicate programming with curses much. Most programs go into a flurry of activity, and then pause waiting for a keypress or some other action on the part of the user. All you have to do is to be sure that the screen has been redrawn before pausing to wait for user input, by first calling :meth:`!stdscr.refresh` or the :meth:`!refresh` method of some other relevant window." -msgstr "" +msgid "" +"In practice, explicitly telling curses to redraw a window doesn't really " +"complicate programming with curses much. Most programs go into a flurry of " +"activity, and then pause waiting for a keypress or some other action on the " +"part of the user. All you have to do is to be sure that the screen has been" +" redrawn before pausing to wait for user input, by first calling " +":meth:`!stdscr.refresh` or the :meth:`!refresh` method of some other " +"relevant window." +msgstr "" +"در عمل، اینکه به‌صراحت به curses بگوییم یک پنجره را دوباره ترسیم کند، چندان " +"برنامه‌نویسی با curses را پیچیده نمی‌کند. بیشتر برنامه‌ها وارد دوره‌ای از " +"فعالیت فشرده می‌شوند و سپس برای انتظار فشردن یک کلید یا اقدام دیگری از سوی " +"کاربر مکث می‌کنند. تنها کاری که باید انجام دهید این است که پیش از مکث برای " +"انتظار ورودی کاربر، ابتدا با فراخوانی :meth:`!stdscr.refresh` یا متد " +":meth:`!refresh` یک پنجره مرتبط دیگر، مطمئن شوید که صفحه دوباره ترسیم شده " +"است." -msgid "A pad is a special case of a window; it can be larger than the actual display screen, and only a portion of the pad displayed at a time. Creating a pad requires the pad's height and width, while refreshing a pad requires giving the coordinates of the on-screen area where a subsection of the pad will be displayed. ::" +msgid "" +"A pad is a special case of a window; it can be larger than the actual " +"display screen, and only a portion of the pad displayed at a time. Creating " +"a pad requires the pad's height and width, while refreshing a pad requires " +"giving the coordinates of the on-screen area where a subsection of the pad " +"will be displayed. ::" msgstr "" +"یک پد (pad) حالت خاصی از یک پنجره است؛ می‌تواند بزرگ‌تر از صفحه‌ی نمایش واقعی" +" باشد و تنها بخشی از پد در هر زمان نمایش داده شود. ایجاد یک پد به ارتفاع و " +"عرض پد نیاز دارد، در حالی که تازه‌سازی یک پد نیازمند ارائه مختصات ناحیه‌ی روی" +" صفحه‌ای است که زیربخشی از پد در آن نمایش داده خواهد شد. ::" msgid "" "pad = curses.newpad(100, 100)\n" @@ -192,194 +472,482 @@ msgid "" "# : filled with pad content.\n" "pad.refresh( 0,0, 5,5, 20,75)" msgstr "" +"pad = curses.newpad(100, 100)\n" +"# These loops fill the pad with letters; addch() is\n" +"# explained in the next section\n" +"for y in range(0, 99):\n" +" for x in range(0, 99):\n" +" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n" +"\n" +"# Displays a section of the pad in the middle of the screen.\n" +"# (0,0) : coordinate of upper-left corner of pad area to display.\n" +"# (5,5) : coordinate of upper-left corner of window area to be filled\n" +"# with pad content.\n" +"# (20, 75) : coordinate of lower-right corner of window area to be\n" +"# : filled with pad content.\n" +"pad.refresh( 0,0, 5,5, 20,75)" -msgid "The :meth:`!refresh` call displays a section of the pad in the rectangle extending from coordinate (5,5) to coordinate (20,75) on the screen; the upper left corner of the displayed section is coordinate (0,0) on the pad. Beyond that difference, pads are exactly like ordinary windows and support the same methods." +msgid "" +"The :meth:`!refresh` call displays a section of the pad in the rectangle " +"extending from coordinate (5,5) to coordinate (20,75) on the screen; the " +"upper left corner of the displayed section is coordinate (0,0) on the pad. " +"Beyond that difference, pads are exactly like ordinary windows and support " +"the same methods." msgstr "" +"فراخوانی :meth:`!refresh` بخشی از پد (pad) را در مستطیلی که از مختصات (۵،۵) " +"تا مختصات (۲۰،۷۵) روی صفحه امتداد دارد، نمایش می‌دهد؛ گوشه‌ی بالا سمت چپ بخش" +" نمایش‌داده‌شده، مختصات (۰،۰) روی پد است. جدای از این تفاوت، پدها دقیقاً " +"مانند پنجره‌های معمولی هستند و از همان متدها پشتیبانی می‌کنند." -msgid "If you have multiple windows and pads on screen there is a more efficient way to update the screen and prevent annoying screen flicker as each part of the screen gets updated. :meth:`!refresh` actually does two things:" +msgid "" +"If you have multiple windows and pads on screen there is a more efficient " +"way to update the screen and prevent annoying screen flicker as each part of" +" the screen gets updated. :meth:`!refresh` actually does two things:" msgstr "" +"اگر چندین پنجره و پد روی صفحه دارید، راه کارآمدتری برای به‌روزرسانی صفحه و " +"جلوگیری از سوسوی آزاردهنده‌ی صفحه هنگام به‌روزرسانی هر بخش از آن وجود دارد. " +":meth:`!refresh` در واقع دو کار انجام می‌دهد:" -msgid "Calls the :meth:`~curses.window.noutrefresh` method of each window to update an underlying data structure representing the desired state of the screen." +msgid "" +"Calls the :meth:`~curses.window.noutrefresh` method of each window to update" +" an underlying data structure representing the desired state of the screen." msgstr "" +"متد :meth:`~curses.window.noutrefresh` هر پنجره را فراخوانی می‌کند تا یک " +"ساختار داده زیربنایی را که وضعیت مطلوب صفحه را نشان می‌دهد به‌روزرسانی کند." -msgid "Calls the function :func:`~curses.doupdate` function to change the physical screen to match the desired state recorded in the data structure." +msgid "" +"Calls the function :func:`~curses.doupdate` function to change the physical " +"screen to match the desired state recorded in the data structure." msgstr "" +"تابع :func:`~curses.doupdate` را فراخوانی می‌کند تا صفحه فیزیکی را با وضعیت " +"دلخواه ثبت‌شده در ساختار داده هماهنگ کند." -msgid "Instead you can call :meth:`!noutrefresh` on a number of windows to update the data structure, and then call :func:`!doupdate` to update the screen." +msgid "" +"Instead you can call :meth:`!noutrefresh` on a number of windows to update " +"the data structure, and then call :func:`!doupdate` to update the screen." msgstr "" +"در عوض می‌توانید :meth:`!noutrefresh` را روی تعدادی از پنجره‌ها فراخوانی " +"کنید تا ساختار داده به‌روزرسانی شود، و سپس :func:`!doupdate` را برای " +"به‌روزرسانی صفحه فراخوانی کنید." msgid "Displaying Text" -msgstr "" +msgstr "نمایش متن" -msgid "From a C programmer's point of view, curses may sometimes look like a twisty maze of functions, all subtly different. For example, :c:func:`!addstr` displays a string at the current cursor location in the ``stdscr`` window, while :c:func:`!mvaddstr` moves to a given y,x coordinate first before displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, but allows specifying a window to use instead of using ``stdscr`` by default. :c:func:`!mvwaddstr` allows specifying both a window and a coordinate." -msgstr "" +msgid "" +"From a C programmer's point of view, curses may sometimes look like a twisty" +" maze of functions, all subtly different. For example, :c:func:`!addstr` " +"displays a string at the current cursor location in the ``stdscr`` window, " +"while :c:func:`!mvaddstr` moves to a given y,x coordinate first before " +"displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, " +"but allows specifying a window to use instead of using ``stdscr`` by " +"default. :c:func:`!mvwaddstr` allows specifying both a window and a " +"coordinate." +msgstr "" +"از دیدگاه یک برنامه‌نویس C، ممکن است curses گاهی شبیه هزارتوی پیچ‌درپیچ از " +"توابع باشد که همگی تفاوت‌های ظریفی با یکدیگر دارند. برای مثال، " +":c:func:`!addstr` یک رشته را در موقعیت فعلی مکان‌نما در پنجره ``stdscr`` " +"نمایش می‌دهد، در حالی که :c:func:`!mvaddstr` پیش از نمایش رشته، ابتدا به یک " +"مختصات y,x داده‌شده می‌رود. :c:func:`!waddstr` درست مانند :c:func:`!addstr` " +"است، اما امکان تعیین یک پنجره برای استفاده به‌جای استفاده پیش‌فرض از " +"``stdscr`` را می‌دهد. :c:func:`!mvwaddstr` امکان تعیین هم یک پنجره و هم یک " +"مختصات را می‌دهد." -msgid "Fortunately the Python interface hides all these details. ``stdscr`` is a window object like any other, and methods such as :meth:`~curses.window.addstr` accept multiple argument forms. Usually there are four different forms." +msgid "" +"Fortunately the Python interface hides all these details. ``stdscr`` is a " +"window object like any other, and methods such as " +":meth:`~curses.window.addstr` accept multiple argument forms. Usually there" +" are four different forms." msgstr "" +"خوشبختانه رابط پایتون تمام این جزئیات را پنهان می‌کند. ``stdscr`` یک شیء " +"پنجره مانند هر شیء دیگری است و متدهایی مانند :meth:`~curses.window.addstr` " +"چندین شکل آرگومان را می‌پذیرند. معمولاً ۴ شکل مختلف وجود دارد." msgid "Form" -msgstr "" +msgstr "فرم" msgid "Description" -msgstr "" +msgstr "توضیحات" msgid "*str* or *ch*" -msgstr "" +msgstr "*str* یا *ch*" msgid "Display the string *str* or character *ch* at the current position" -msgstr "" +msgstr "نمایش رشته‌ی *str* یا نویسه‌ی *ch* در موقعیت فعلی" msgid "*str* or *ch*, *attr*" -msgstr "" +msgstr "*str* یا *ch*، *attr*" -msgid "Display the string *str* or character *ch*, using attribute *attr* at the current position" +msgid "" +"Display the string *str* or character *ch*, using attribute *attr* at the " +"current position" msgstr "" +"رشته‌ی *str* یا نویسه‌ی *ch* را با استفاده از ویژگی *attr* در موقعیت فعلی " +"نمایش دهید" msgid "*y*, *x*, *str* or *ch*" -msgstr "" +msgstr "*y*، *x*، *str* یا *ch*" msgid "Move to position *y,x* within the window, and display *str* or *ch*" -msgstr "" +msgstr "به موقعیت *y,x* درون پنجره بروید و *str* یا *ch* را نمایش دهید" msgid "*y*, *x*, *str* or *ch*, *attr*" -msgstr "" +msgstr "*y*، *x*، *str* یا *ch*، *attr*" -msgid "Move to position *y,x* within the window, and display *str* or *ch*, using attribute *attr*" +msgid "" +"Move to position *y,x* within the window, and display *str* or *ch*, using " +"attribute *attr*" msgstr "" +"به موقعیت *y,x* درون پنجره بروید و *str* یا *ch* را با استفاده از ویژگی " +"*attr* نمایش دهید." -msgid "Attributes allow displaying text in highlighted forms such as boldface, underline, reverse code, or in color. They'll be explained in more detail in the next subsection." +msgid "" +"Attributes allow displaying text in highlighted forms such as boldface, " +"underline, reverse code, or in color. They'll be explained in more detail " +"in the next subsection." msgstr "" +"ویژگی‌ها امکان نمایش متن در قالب‌های برجسته مانند پررنگ، زیرخط، کد معکوس یا " +"رنگی را فراهم می‌کنند. این ویژگی‌ها در زیربخش بعدی با جزئیات بیشتر توضیح " +"داده خواهند شد." -msgid "The :meth:`~curses.window.addstr` method takes a Python string or bytestring as the value to be displayed. The contents of bytestrings are sent to the terminal as-is. Strings are encoded to bytes using the value of the window's :attr:`~window.encoding` attribute; this defaults to the default system encoding as returned by :func:`locale.getencoding`." -msgstr "" +msgid "" +"The :meth:`~curses.window.addstr` method takes a Python string or bytestring" +" as the value to be displayed. The contents of bytestrings are sent to the " +"terminal as-is. Strings are encoded to bytes using the value of the " +"window's :attr:`~window.encoding` attribute; this defaults to the default " +"system encoding as returned by :func:`locale.getencoding`." +msgstr "" +"متد :meth:`~curses.window.addstr` یک رشته یا رشته‌بایتی (bytestring) پایتون " +"را به‌عنوان مقدار برای نمایش می‌گیرد. محتوای رشته‌بایتی‌ها به‌صورت " +"دست‌نخورده به پایانه فرستاده می‌شود. رشته‌ها با استفاده از مقدار ویژگی " +":attr:`~window.encoding` پنجره به بایت کدگذاری می‌شوند؛ این مقدار به‌طور " +"پیش‌فرض برابر با کدگذاری پیش‌فرض سیستم است که توسط " +":func:`locale.getencoding` برگردانده می‌شود." -msgid "The :meth:`~curses.window.addch` methods take a character, which can be either a string of length 1, a bytestring of length 1, or an integer." +msgid "" +"The :meth:`~curses.window.addch` methods take a character, which can be " +"either a string of length 1, a bytestring of length 1, or an integer." msgstr "" +"متدهای :meth:`~curses.window.addch` یک نویسه دریافت می‌کنند، که می‌تواند یک " +"رشته به طول ۱، یک رشته‌بایت (bytestring) به طول ۱، یا یک عدد صحیح باشد." -msgid "Constants are provided for extension characters; these constants are integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- symbol, and :const:`ACS_ULCORNER` is the upper left corner of a box (handy for drawing borders). You can also use the appropriate Unicode character." +msgid "" +"Constants are provided for extension characters; these constants are " +"integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- " +"symbol, and :const:`ACS_ULCORNER` is the upper left corner of a box (handy " +"for drawing borders). You can also use the appropriate Unicode character." msgstr "" +"ثابت‌هایی برای نویسه‌های توسعه‌ای ارائه شده‌اند؛ این ثابت‌ها اعداد صحیحی " +"بزرگ‌تر از ۲۵۵ هستند. برای مثال، :const:`ACS_PLMINUS` یک نماد +/- است، و " +":const:`ACS_ULCORNER` گوشه‌ی بالا سمت چپ یک جعبه است (برای رسم خطوط مرزی مفید" +" است). شما همچنین می‌توانید از نویسه‌ی یونیکد مناسب استفاده کنید." -msgid "Windows remember where the cursor was left after the last operation, so if you leave out the *y,x* coordinates, the string or character will be displayed wherever the last operation left off. You can also move the cursor with the ``move(y,x)`` method. Because some terminals always display a flashing cursor, you may want to ensure that the cursor is positioned in some location where it won't be distracting; it can be confusing to have the cursor blinking at some apparently random location." -msgstr "" +msgid "" +"Windows remember where the cursor was left after the last operation, so if " +"you leave out the *y,x* coordinates, the string or character will be " +"displayed wherever the last operation left off. You can also move the " +"cursor with the ``move(y,x)`` method. Because some terminals always display" +" a flashing cursor, you may want to ensure that the cursor is positioned in " +"some location where it won't be distracting; it can be confusing to have the" +" cursor blinking at some apparently random location." +msgstr "" +"پنجره‌ها به یاد می‌آورند که مکان‌نما پس از آخرین عملیات کجا مانده است، " +"بنابراین اگر مختصات *y,x* را وارد نکنید، رشته یا نویسه در هر جایی که آخرین " +"عملیات مکان‌نما را رها کرده است نمایش داده می‌شود. همچنین می‌توانید مکان‌نما" +" را با متد ``move(y,x)`` جابه‌جا کنید. از آنجا که برخی پایانه‌ها همیشه یک " +"مکان‌نمای چشمک‌زن را نمایش می‌دهند، ممکن است بخواهید اطمینان حاصل کنید که " +"مکان‌نما در موقعیتی قرار گرفته است که باعث حواس‌پرتی نمی‌شود؛ چشمک زدن " +"مکان‌نما در موقعیتی که ظاهراً تصادفی است می‌تواند گیج‌کننده باشد." -msgid "If your application doesn't need a blinking cursor at all, you can call ``curs_set(False)`` to make it invisible. For compatibility with older curses versions, there's a ``leaveok(bool)`` function that's a synonym for :func:`~curses.curs_set`. When *bool* is true, the curses library will attempt to suppress the flashing cursor, and you won't need to worry about leaving it in odd locations." -msgstr "" +msgid "" +"If your application doesn't need a blinking cursor at all, you can call " +"``curs_set(False)`` to make it invisible. For compatibility with older " +"curses versions, there's a ``leaveok(bool)`` function that's a synonym for " +":func:`~curses.curs_set`. When *bool* is true, the curses library will " +"attempt to suppress the flashing cursor, and you won't need to worry about " +"leaving it in odd locations." +msgstr "" +"اگر برنامه‌ی شما اصلاً به یک مکان‌نمای چشمک‌زن نیاز ندارد، می‌توانید " +"``curs_set(False)`` را فراخوانی کنید تا آن را نامرئی کنید. برای سازگاری با " +"نسخه‌های قدیمی‌تر curses، تابع ``leaveok(bool)`` وجود دارد که مترادف " +":func:`~curses.curs_set` است. هنگامی که *bool* true باشد، کتابخانه curses " +"تلاش می‌کند مکان‌نمای چشمک‌زن را مهار کند، و شما نیازی نیست نگران باقی ماندن" +" آن در موقعیت‌های غیرعادی باشید." msgid "Attributes and Color" -msgstr "" +msgstr "ویژگی‌ها و رنگ" -msgid "Characters can be displayed in different ways. Status lines in a text-based application are commonly shown in reverse video, or a text viewer may need to highlight certain words. curses supports this by allowing you to specify an attribute for each cell on the screen." +msgid "" +"Characters can be displayed in different ways. Status lines in a text-based" +" application are commonly shown in reverse video, or a text viewer may need " +"to highlight certain words. curses supports this by allowing you to specify" +" an attribute for each cell on the screen." msgstr "" +"نویسه‌ها را می‌توان به روش‌های مختلفی نمایش داد. ردیف‌های وضعیت در یک برنامه‌ی" +" مبتنی بر متن معمولاً به‌حالت معکوس (reverse video) نمایش داده می‌شوند، یا " +"ممکن است یک نمایشگر متن نیاز داشته باشد که کلمات خاصی را برجسته کند. curses " +"از این موضوع پشتیبانی می‌کند و به شما اجازه می‌دهد برای هر سلول روی صفحه یک " +"ویژگی تعیین کنید." -msgid "An attribute is an integer, each bit representing a different attribute. You can try to display text with multiple attribute bits set, but curses doesn't guarantee that all the possible combinations are available, or that they're all visually distinct. That depends on the ability of the terminal being used, so it's safest to stick to the most commonly available attributes, listed here." -msgstr "" +msgid "" +"An attribute is an integer, each bit representing a different attribute. " +"You can try to display text with multiple attribute bits set, but curses " +"doesn't guarantee that all the possible combinations are available, or that " +"they're all visually distinct. That depends on the ability of the terminal " +"being used, so it's safest to stick to the most commonly available " +"attributes, listed here." +msgstr "" +"یک ویژگی یک عدد صحیح است که هر بیت آن نشان‌دهنده‌ی یک ویژگی متفاوت است. شما " +"می‌توانید سعی کنید متنی را با چند بیت ویژگی فعال نمایش دهید، اما curses " +"تضمین نمی‌کند که همه‌ی ترکیب‌های ممکن در دسترس باشند، یا اینکه همه‌ی آن‌ها " +"از نظر بصری متمایز باشند. این امر به توانایی پایانه‌ی مورد استفاده بستگی " +"دارد، بنابراین امن‌تر است که به رایج‌ترین ویژگی‌های در دسترس، که در اینجا " +"فهرست شده‌اند، پایبند باشید." msgid "Attribute" -msgstr "" +msgstr "ویژگی" msgid ":const:`A_BLINK`" -msgstr "" +msgstr ":const:`A_BLINK`" msgid "Blinking text" -msgstr "" +msgstr "متن چشمک‌زن" msgid ":const:`A_BOLD`" -msgstr "" +msgstr ":const:`A_BOLD`" msgid "Extra bright or bold text" -msgstr "" +msgstr "متن بسیار روشن یا پررنگ" msgid ":const:`A_DIM`" -msgstr "" +msgstr ":const:`A_DIM`" msgid "Half bright text" -msgstr "" +msgstr "متن نیمه‌روشن" msgid ":const:`A_REVERSE`" -msgstr "" +msgstr ":const:`A_REVERSE`" msgid "Reverse-video text" -msgstr "" +msgstr "متن ویدیویی معکوس" msgid ":const:`A_STANDOUT`" -msgstr "" +msgstr ":const:`A_STANDOUT`" msgid "The best highlighting mode available" -msgstr "" +msgstr "بهترین حالت برجسته‌سازی موجود" msgid ":const:`A_UNDERLINE`" -msgstr "" +msgstr ":const:`A_UNDERLINE`" msgid "Underlined text" -msgstr "" +msgstr "متن زیرخط‌دار" -msgid "So, to display a reverse-video status line on the top line of the screen, you could code::" +msgid "" +"So, to display a reverse-video status line on the top line of the screen, " +"you could code::" msgstr "" +"بنابراین، برای نمایش یک خط وضعیت با نمایش معکوس در خط بالای صفحه، می‌توانید " +"این‌گونه کد بنویسید::" msgid "" "stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" " curses.A_REVERSE)\n" "stdscr.refresh()" msgstr "" +"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" +" curses.A_REVERSE)\n" +"stdscr.refresh()" -msgid "The curses library also supports color on those terminals that provide it. The most common such terminal is probably the Linux console, followed by color xterms." +msgid "" +"The curses library also supports color on those terminals that provide it. " +"The most common such terminal is probably the Linux console, followed by " +"color xterms." msgstr "" +"کتابخانه curses همچنین از رنگ در آن پایانه‌هایی که آن را فراهم می‌کنند، " +"پشتیبانی می‌کند. رایج‌ترین پایانه از این نوع احتمالاً کنسول لینوکس است و پس " +"از آن پایانه‌های xterm رنگی قرار دارند." -msgid "To use color, you must call the :func:`~curses.start_color` function soon after calling :func:`~curses.initscr`, to initialize the default color set (the :func:`curses.wrapper` function does this automatically). Once that's done, the :func:`~curses.has_colors` function returns TRUE if the terminal in use can actually display color. (Note: curses uses the American spelling 'color', instead of the Canadian/British spelling 'colour'. If you're used to the British spelling, you'll have to resign yourself to misspelling it for the sake of these functions.)" -msgstr "" +msgid "" +"To use color, you must call the :func:`~curses.start_color` function soon " +"after calling :func:`~curses.initscr`, to initialize the default color set " +"(the :func:`curses.wrapper` function does this automatically). Once that's " +"done, the :func:`~curses.has_colors` function returns TRUE if the terminal " +"in use can actually display color. (Note: curses uses the American spelling" +" 'color', instead of the Canadian/British spelling 'colour'. If you're used" +" to the British spelling, you'll have to resign yourself to misspelling it " +"for the sake of these functions.)" +msgstr "" +"برای استفاده از رنگ، باید تابع :func:`~curses.start_color` را بلافاصله پس از" +" فراخوانی :func:`~curses.initscr` صدا بزنید تا مجموعه‌رنگ پیش‌فرض راه‌اندازی" +" شود (تابع :func:`curses.wrapper` این کار را به‌طور خودکار انجام می‌دهد). پس" +" از انجام این کار، اگر پایانه‌ی مورد استفاده واقعاً بتواند رنگ را نمایش دهد، " +"تابع :func:`~curses.has_colors` مقدار TRUE را برمی‌گرداند. (توجه: curses از " +"املای آمریکایی 'color' به‌جای املای کانادایی/بریتانیایی 'colour' استفاده " +"می‌کند. اگر به املای بریتانیایی عادت دارید، باید بپذیرید که به‌خاطر این " +"توابع آن را با املای اشتباه بنویسید.)" -msgid "The curses library maintains a finite number of color pairs, containing a foreground (or text) color and a background color. You can get the attribute value corresponding to a color pair with the :func:`~curses.color_pair` function; this can be bitwise-OR'ed with other attributes such as :const:`A_REVERSE`, but again, such combinations are not guaranteed to work on all terminals." -msgstr "" +msgid "" +"The curses library maintains a finite number of color pairs, containing a " +"foreground (or text) color and a background color. You can get the " +"attribute value corresponding to a color pair with the " +":func:`~curses.color_pair` function; this can be bitwise-OR'ed with other " +"attributes such as :const:`A_REVERSE`, but again, such combinations are not " +"guaranteed to work on all terminals." +msgstr "" +"کتابخانه curses تعداد محدودی جفت‌رنگ را نگه می‌دارد که حاوی یک رنگ پیش‌زمینه" +" (یا رنگ متن) و یک رنگ پس‌زمینه هستند. می‌توانید مقدار ویژگی متناظر با یک " +"جفت‌رنگ را با تابع :func:`~curses.color_pair` دریافت کنید؛ می‌توان این مقدار" +" را با ویژگی‌های دیگر مانند :const:`A_REVERSE` با OR بیتی ترکیب کرد، اما باز" +" هم، کار کردن چنین ترکیب‌هایی در تمام پایانه‌ها تضمین نمی‌شود." msgid "An example, which displays a line of text using color pair 1::" msgstr "" +"مثالی که خطی از متن را با استفاده از جفت‌رنگ (color pair) ۱ نمایش می‌دهد::" msgid "" "stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" "stdscr.refresh()" msgstr "" +"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" +"stdscr.refresh()" -msgid "As I said before, a color pair consists of a foreground and background color. The ``init_pair(n, f, b)`` function changes the definition of color pair *n*, to foreground color f and background color b. Color pair 0 is hard-wired to white on black, and cannot be changed." +msgid "" +"As I said before, a color pair consists of a foreground and background " +"color. The ``init_pair(n, f, b)`` function changes the definition of color " +"pair *n*, to foreground color f and background color b. Color pair 0 is " +"hard-wired to white on black, and cannot be changed." msgstr "" +"همان‌طور که پیش‌تر گفتم، یک جفت‌رنگ از یک رنگ پیش‌زمینه و یک رنگ پس‌زمینه " +"تشکیل شده است. تابع ``init_pair(n, f, b)`` تعریف جفت‌رنگ *n* را به رنگ " +"پیش‌زمینه f و رنگ پس‌زمینه b تغییر می‌دهد. جفت‌رنگ ۰ به‌صورت ذاتی سفید روی " +"سیاه است و نمی‌توان آن را تغییر داد." -msgid "Colors are numbered, and :func:`start_color` initializes 8 basic colors when it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:blue, 5:magenta, 6:cyan, and 7:white. The :mod:`curses` module defines named constants for each of these colors: :const:`curses.COLOR_BLACK`, :const:`curses.COLOR_RED`, and so forth." -msgstr "" +msgid "" +"Colors are numbered, and :func:`start_color` initializes 8 basic colors when" +" it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, " +"4:blue, 5:magenta, 6:cyan, and 7:white. The :mod:`curses` module defines " +"named constants for each of these colors: :const:`curses.COLOR_BLACK`, " +":const:`curses.COLOR_RED`, and so forth." +msgstr "" +"رنگ‌ها شماره‌گذاری شده‌اند و :func:`start_color` هنگام فعال‌سازی حالت رنگ، ۸" +" رنگ پایه را مقداردهی اولیه می‌کند. این رنگ‌ها عبارت‌اند از: ۰:سیاه، ۱:قرمز،" +" ۲:سبز، ۳:زرد، ۴:آبی، ۵:سرخابی، ۶:فیروزه‌ای و ۷:سفید. ماژول :mod:`curses` " +"برای هر یک از این رنگ‌ها ثابت‌های نام‌دار تعریف می‌کند: " +":const:`curses.COLOR_BLACK`، :const:`curses.COLOR_RED` و غیره." -msgid "Let's put all this together. To change color 1 to red text on a white background, you would call::" +msgid "" +"Let's put all this together. To change color 1 to red text on a white " +"background, you would call::" msgstr "" +"بیایید همه این‌ها را کنار هم بگذاریم. برای تغییر رنگ ۱ به متن قرمز روی زمینه" +" سفید، باید این‌گونه فراخوانی کنید::" msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" -msgstr "" +msgstr "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" -msgid "When you change a color pair, any text already displayed using that color pair will change to the new colors. You can also display new text in this color with::" +msgid "" +"When you change a color pair, any text already displayed using that color " +"pair will change to the new colors. You can also display new text in this " +"color with::" msgstr "" +"هنگامی که یک جفت‌رنگ را تغییر می‌دهید، هر متنی که از قبل با استفاده از آن " +"جفت‌رنگ نمایش داده شده باشد، به رنگ‌های جدید تغییر خواهد کرد. همچنین " +"می‌توانید متن جدیدی را با این رنگ به‌صورت زیر نمایش دهید::" msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" -msgstr "" +msgstr "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" -msgid "Very fancy terminals can change the definitions of the actual colors to a given RGB value. This lets you change color 1, which is usually red, to purple or blue or any other color you like. Unfortunately, the Linux console doesn't support this, so I'm unable to try it out, and can't provide any examples. You can check if your terminal can do this by calling :func:`~curses.can_change_color`, which returns ``True`` if the capability is there. If you're lucky enough to have such a talented terminal, consult your system's man pages for more information." -msgstr "" +msgid "" +"Very fancy terminals can change the definitions of the actual colors to a " +"given RGB value. This lets you change color 1, which is usually red, to " +"purple or blue or any other color you like. Unfortunately, the Linux " +"console doesn't support this, so I'm unable to try it out, and can't provide" +" any examples. You can check if your terminal can do this by calling " +":func:`~curses.can_change_color`, which returns ``True`` if the capability " +"is there. If you're lucky enough to have such a talented terminal, consult " +"your system's man pages for more information." +msgstr "" +"پایانه‌های بسیار پیشرفته می‌توانند تعاریف رنگ‌های واقعی را به یک مقدار RGB " +"داده‌شده تغییر دهند. این امکان را به شما می‌دهد که رنگ ۱ را، که معمولاً قرمز" +" است، به بنفش یا آبی یا هر رنگ دیگری که بخواهید تغییر دهید. متأسفانه، کنسول " +"لینوکس از این قابلیت پشتیبانی نمی‌کند، بنابراین من نمی‌توانم آن را امتحان " +"کنم و نمی‌توانم هیچ مثالی ارائه دهم. می‌توانید با فراخوانی " +":func:`~curses.can_change_color`، که در صورت وجود این قابلیت ``True`` را " +"برمی‌گرداند، بررسی کنید که آیا پایانه شما این کار را انجام می‌دهد یا خیر. " +"اگر آن‌قدر خوش‌شانس هستید که چنین پایانه توانمندی دارید، برای اطلاعات بیشتر " +"به صفحات man سیستم خود مراجعه کنید." msgid "User Input" -msgstr "" +msgstr "ورودی کاربر" -msgid "The C curses library offers only very simple input mechanisms. Python's :mod:`curses` module adds a basic text-input widget. (Other libraries such as :pypi:`Urwid` have more extensive collections of widgets.)" +msgid "" +"The C curses library offers only very simple input mechanisms. Python's " +":mod:`curses` module adds a basic text-input widget. (Other libraries such " +"as :pypi:`Urwid` have more extensive collections of widgets.)" msgstr "" +"کتابخانه curses در C فقط سازوکارهای ورودی بسیار ساده‌ای را ارائه می‌دهد. " +"ماژول :mod:`curses` پایتون یک ابزارک پایه برای ورودی متن می‌افزاید. (سایر " +"کتابخانه‌ها مانند :pypi:`Urwid` مجموعه‌های گسترده‌تری از ابزارک‌ها دارند.)" msgid "There are two methods for getting input from a window:" -msgstr "" +msgstr "برای دریافت ورودی از یک پنجره، دو متد وجود دارد:" -msgid ":meth:`~curses.window.getch` refreshes the screen and then waits for the user to hit a key, displaying the key if :func:`~curses.echo` has been called earlier. You can optionally specify a coordinate to which the cursor should be moved before pausing." +msgid "" +":meth:`~curses.window.getch` refreshes the screen and then waits for the " +"user to hit a key, displaying the key if :func:`~curses.echo` has been " +"called earlier. You can optionally specify a coordinate to which the cursor" +" should be moved before pausing." msgstr "" +":meth:`~curses.window.getch` صفحه را تازه‌سازی می‌کند و سپس منتظر می‌ماند تا" +" کاربر کلیدی را فشار دهد، و در صورتی که پیش‌تر :func:`~curses.echo` فراخوانی" +" شده باشد، آن کلید را نمایش می‌دهد. شما می‌توانید به‌اختیار مختصاتی را مشخص " +"کنید که مکان‌نما باید پیش از مکث به آن منتقل شود." -msgid ":meth:`~curses.window.getkey` does the same thing but converts the integer to a string. Individual characters are returned as 1-character strings, and special keys such as function keys return longer strings containing a key name such as ``KEY_UP`` or ``^G``." +msgid "" +":meth:`~curses.window.getkey` does the same thing but converts the integer " +"to a string. Individual characters are returned as 1-character strings, and" +" special keys such as function keys return longer strings containing a key " +"name such as ``KEY_UP`` or ``^G``." msgstr "" +":meth:`~curses.window.getkey` همین کار را انجام می‌دهد، اما عدد صحیح را به " +"رشته تبدیل می‌کند. نویسه‌های منفرد به‌صورت رشته‌های تک‌نویسه‌ای برگردانده " +"می‌شوند و برای کلیدهای خاص مانند کلیدهای تابعی، رشته‌های طولانی‌تری " +"برگردانده می‌شوند که شامل یک نام کلیدی مانند ``KEY_UP`` یا ``^G`` است." -msgid "It's possible to not wait for the user using the :meth:`~curses.window.nodelay` window method. After ``nodelay(True)``, :meth:`!getch` and :meth:`!getkey` for the window become non-blocking. To signal that no input is ready, :meth:`!getch` returns ``curses.ERR`` (a value of -1) and :meth:`!getkey` raises an exception. There's also a :func:`~curses.halfdelay` function, which can be used to (in effect) set a timer on each :meth:`!getch`; if no input becomes available within a specified delay (measured in tenths of a second), curses raises an exception." -msgstr "" +msgid "" +"It's possible to not wait for the user using the " +":meth:`~curses.window.nodelay` window method. After ``nodelay(True)``, " +":meth:`!getch` and :meth:`!getkey` for the window become non-blocking. To " +"signal that no input is ready, :meth:`!getch` returns ``curses.ERR`` (a " +"value of -1) and :meth:`!getkey` raises an exception. There's also a " +":func:`~curses.halfdelay` function, which can be used to (in effect) set a " +"timer on each :meth:`!getch`; if no input becomes available within a " +"specified delay (measured in tenths of a second), curses raises an " +"exception." +msgstr "" +"می‌توانید با استفاده از متد پنجره‌ی :meth:`~curses.window.nodelay`، منتظر " +"کاربر نمانید. پس از ``nodelay(True)``، :meth:`!getch` و :meth:`!getkey` برای" +" پنجره غیرمسدودکننده می‌شوند. برای نشان دادن اینکه هیچ ورودی آماده نیست، " +":meth:`!getch` ``curses.ERR`` (مقداری -۱) را برمی‌گرداند و :meth:`!getkey` " +"یک استثنا پرتاب می‌کند. همچنین تابع :func:`~curses.halfdelay` وجود دارد که " +"می‌توان از آن عملاً برای تنظیم یک زمان‌سنج برای هر :meth:`!getch` استفاده " +"کرد؛ اگر هیچ ورودی ظرف یک تأخیر مشخص (که بر حسب دهم‌های ثانیه اندازه‌گیری " +"می‌شود) در دسترس قرار نگیرد، curses یک استثنا پرتاب می‌کند." -msgid "The :meth:`!getch` method returns an integer; if it's between 0 and 255, it represents the ASCII code of the key pressed. Values greater than 255 are special keys such as Page Up, Home, or the cursor keys. You can compare the value returned to constants such as :const:`curses.KEY_PPAGE`, :const:`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`. The main loop of your program may look something like this::" -msgstr "" +msgid "" +"The :meth:`!getch` method returns an integer; if it's between 0 and 255, it " +"represents the ASCII code of the key pressed. Values greater than 255 are " +"special keys such as Page Up, Home, or the cursor keys. You can compare the " +"value returned to constants such as :const:`curses.KEY_PPAGE`, " +":const:`curses.KEY_HOME`, or :const:`curses.KEY_LEFT`. The main loop of " +"your program may look something like this::" +msgstr "" +"متد :meth:`!getch` یک عدد صحیح برمی‌گرداند؛ اگر بین ۰ و ۲۵۵ باشد، " +"نشان‌دهنده‌ی کد ASCII کلید فشرده‌شده است. مقادیر بزرگ‌تر از ۲۵۵ نشان‌دهنده‌ی" +" کلیدهای خاصی مانند Page Up، Home یا کلیدهای مکان‌نما هستند. می‌توانید مقدار" +" برگردانده‌شده را با ثابت‌هایی مانند :const:`curses.KEY_PPAGE`، " +":const:`curses.KEY_HOME` یا :const:`curses.KEY_LEFT` مقایسه کنید. ممکن است " +"حلقه‌ی اصلی برنامه‌ی شما چیزی شبیه به این باشد::" msgid "" "while True:\n" @@ -391,12 +959,43 @@ msgid "" " elif c == curses.KEY_HOME:\n" " x = y = 0" msgstr "" +"while True:\n" +" c = stdscr.getch()\n" +" if c == ord('p'):\n" +" PrintDocument()\n" +" elif c == ord('q'):\n" +" break # Exit the while loop\n" +" elif c == curses.KEY_HOME:\n" +" x = y = 0" -msgid "The :mod:`curses.ascii` module supplies ASCII class membership functions that take either integer or 1-character string arguments; these may be useful in writing more readable tests for such loops. It also supplies conversion functions that take either integer or 1-character-string arguments and return the same type. For example, :func:`curses.ascii.ctrl` returns the control character corresponding to its argument." -msgstr "" +msgid "" +"The :mod:`curses.ascii` module supplies ASCII class membership functions " +"that take either integer or 1-character string arguments; these may be " +"useful in writing more readable tests for such loops. It also supplies " +"conversion functions that take either integer or 1-character-string " +"arguments and return the same type. For example, :func:`curses.ascii.ctrl` " +"returns the control character corresponding to its argument." +msgstr "" +"ماژول :mod:`curses.ascii` توابع عضویت در کلاس‌های ASCII را فراهم می‌کند که " +"آرگومان‌هایی از نوع عدد صحیح یا رشته‌ی تک‌نویسه‌ای می‌پذیرند؛ این توابع ممکن " +"است در نوشتن آزمون‌های خواناتر برای چنین حلقه‌هایی مفید باشند. این ماژول " +"همچنین توابع تبدیل را فراهم می‌کند که آرگومان‌هایی از نوع عدد صحیح یا رشته‌ی " +"تک‌نویسه‌ای می‌پذیرند و همان نوع را برمی‌گردانند. برای مثال، " +":func:`curses.ascii.ctrl` نویسه‌ی کنترلی متناظر با آرگومان خود را " +"برمی‌گرداند." -msgid "There's also a method to retrieve an entire string, :meth:`~curses.window.getstr`. It isn't used very often, because its functionality is quite limited; the only editing keys available are the backspace key and the Enter key, which terminates the string. It can optionally be limited to a fixed number of characters. ::" -msgstr "" +msgid "" +"There's also a method to retrieve an entire string, " +":meth:`~curses.window.getstr`. It isn't used very often, because its " +"functionality is quite limited; the only editing keys available are the " +"backspace key and the Enter key, which terminates the string. It can " +"optionally be limited to a fixed number of characters. ::" +msgstr "" +"همچنین متدی برای دریافت یک رشته‌ی کامل وجود دارد، " +":meth:`~curses.window.getstr`. این متد چندان زیاد استفاده نمی‌شود، زیرا " +"قابلیت آن بسیار محدود است؛ تنها کلیدهای ویرایش موجود، کلید Backspace و کلید " +"Enter هستند و کلید Enter رشته را خاتمه می‌دهد. به‌صورت اختیاری می‌توان آن را" +" به تعداد ثابتی از نویسه‌ها محدود کرد. ::" msgid "" "curses.echo() # Enable echoing of characters\n" @@ -404,9 +1003,23 @@ msgid "" "# Get a 15-character string, with the cursor on the top line\n" "s = stdscr.getstr(0,0, 15)" msgstr "" +"curses.echo() # فعال‌سازی بازتاب نویسه‌ها\n" +"\n" +"# گرفتن یک رشته‌ی ۱۵ نویسه‌ای، با مکان‌نما در خط بالایی\n" +"s = stdscr.getstr(0,0, 15)" -msgid "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-like set of keybindings. Various methods of the :class:`~curses.textpad.Textbox` class support editing with input validation and gathering the edit results either with or without trailing spaces. Here's an example::" -msgstr "" +msgid "" +"The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" +"like set of keybindings. Various methods of the " +":class:`~curses.textpad.Textbox` class support editing with input validation" +" and gathering the edit results either with or without trailing spaces. " +"Here's an example::" +msgstr "" +"ماژول :mod:`curses.textpad` یک جعبه‌ی متن فراهم می‌کند که از مجموعه‌ای از " +" کلیدبندی‌ها (keybindings) شبیه به Emacs پشتیبانی می‌کند. متدهای مختلفی از" +" کلاس :class:`~curses.textpad.Textbox` از ویرایش با اعتبارسنجی ورودی و " +"جمع‌آوری نتایج ویرایش، چه با فاصله‌های انتهایی و چه بدون آن‌ها، پشتیبانی " +"می‌کنند. در ادامه مثالی آمده است::" msgid "" "import curses\n" @@ -427,33 +1040,104 @@ msgid "" " # Get resulting contents\n" " message = box.gather()" msgstr "" +"import curses\n" +"from curses.textpad import Textbox, rectangle\n" +"\n" +"def main(stdscr):\n" +" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n" +"\n" +" editwin = curses.newwin(5,30, 2,1)\n" +" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n" +" stdscr.refresh()\n" +"\n" +" box = Textbox(editwin)\n" +"\n" +" # Let the user edit until Ctrl-G is struck.\n" +" box.edit()\n" +"\n" +" # Get resulting contents\n" +" message = box.gather()" -msgid "See the library documentation on :mod:`curses.textpad` for more details." +msgid "" +"See the library documentation on :mod:`curses.textpad` for more details." msgstr "" +"برای جزئیات بیشتر، مستندات کتابخانه در مورد :mod:`curses.textpad` را ببینید." msgid "For More Information" -msgstr "" +msgstr "برای اطلاعات بیشتر" -msgid "This HOWTO doesn't cover some advanced topics, such as reading the contents of the screen or capturing mouse events from an xterm instance, but the Python library page for the :mod:`curses` module is now reasonably complete. You should browse it next." +msgid "" +"This HOWTO doesn't cover some advanced topics, such as reading the contents " +"of the screen or capturing mouse events from an xterm instance, but the " +"Python library page for the :mod:`curses` module is now reasonably complete." +" You should browse it next." msgstr "" +"این HOWTO برخی موضوعات پیشرفته را پوشش نمی‌دهد، مانند خواندن محتوای صفحه یا " +"گرفتن رویدادهای ماوس از یک نمونه xterm، اما صفحه کتابخانه پایتون برای ماژول " +":mod:`curses` اکنون نسبتاً کامل است. بهتر است در ادامه آن را مرور کنید." -msgid "If you're in doubt about the detailed behavior of the curses functions, consult the manual pages for your curses implementation, whether it's ncurses or a proprietary Unix vendor's. The manual pages will document any quirks, and provide complete lists of all the functions, attributes, and :ref:`ACS_\\* ` characters available to you." -msgstr "" +msgid "" +"If you're in doubt about the detailed behavior of the curses functions, " +"consult the manual pages for your curses implementation, whether it's " +"ncurses or a proprietary Unix vendor's. The manual pages will document any " +"quirks, and provide complete lists of all the functions, attributes, and " +":ref:`ACS_\\* ` characters available to you." +msgstr "" +"اگر در مورد رفتار دقیق تابع‌های curses تردید دارید، به صفحه‌های راهنمای " +"پیاده‌سازی curses خود مراجعه کنید، چه ncurses باشد و چه پیاده‌سازی یک " +"فروشنده‌ی یونیکس اختصاصی. صفحه‌های راهنما هرگونه رفتار غیرعادی را مستند " +"می‌کنند و فهرست‌های کاملی از همه‌ی تابع‌ها، ویژگی‌ها و نویسه‌های " +":ref:`ACS_\\* ` در دسترس شما ارائه می‌دهند." -msgid "Because the curses API is so large, some functions aren't supported in the Python interface. Often this isn't because they're difficult to implement, but because no one has needed them yet. Also, Python doesn't yet support the menu library associated with ncurses. Patches adding support for these would be welcome; see `the Python Developer's Guide `_ to learn more about submitting patches to Python." -msgstr "" +msgid "" +"Because the curses API is so large, some functions aren't supported in the " +"Python interface. Often this isn't because they're difficult to implement, " +"but because no one has needed them yet. Also, Python doesn't yet support " +"the menu library associated with ncurses. Patches adding support for these " +"would be welcome; see `the Python Developer's Guide " +"`_ to learn more about submitting patches to " +"Python." +msgstr "" +"از آنجا که API curses بسیار بزرگ است، برخی از تابع‌ها در رابط پایتون " +"پشتیبانی نمی‌شوند. اغلب این موضوع به این دلیل نیست که پیاده‌سازی آن‌ها دشوار" +" است، بلکه به این دلیل است که هنوز کسی به آن‌ها نیاز نداشته است. همچنین، " +"پایتون هنوز از کتابخانه‌ی menu مرتبط با ncurses پشتیبانی نمی‌کند. از " +"وصله‌هایی که پشتیبانی از این موارد را اضافه کنند استقبال می‌شود؛ برای آموختن" +" بیشتر در مورد ارسال وصله‌ها به پایتون، `راهنمای توسعه‌دهنده‌ی پایتون " +"`_ را ببینید." -msgid "`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." +msgid "" +"`Writing Programs with NCURSES `_: a lengthy tutorial for C " +"programmers." msgstr "" +"`Writing Programs with NCURSES `_: آموزشی مفصل برای برنامه‌نویسان C." msgid "`The ncurses man page `_" -msgstr "" +msgstr "`صفحه‌ی man مربوط به ncurses `_" -msgid "`The ncurses FAQ `_" +msgid "" +"`The ncurses FAQ `_" msgstr "" +"`پرسش‌های متداول ncurses `_" -msgid "`\"Use curses... don't swear\" `_: video of a PyCon 2013 talk on controlling terminals using curses or Urwid." +msgid "" +"`\"Use curses... don't `swear\"" +" `_: video of a PyCon 2013 talk" +" on controlling terminals using curses or Urwid." msgstr "" +"`\"Use curses... don't swear\" " +"`_: ویدیویی از یک سخنرانی PyCon" +" ۲۰۱۳ در مورد کنترل پایانه‌ها با استفاده از curses یا Urwid." -msgid "`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some applications written using Urwid." -msgstr "" +msgid "" +"`\"Console Applications with Urwid\" " +"`_: video of" +" a PyCon CA 2012 talk demonstrating some applications written using Urwid." +msgstr "" +"`\"Console Applications with Urwid\" " +"`_: ویدیویی " +"از یک سخنرانی در PyCon CA 2012 که برخی برنامه‌های نوشته‌شده با استفاده از " +"Urwid را نمایش می‌دهد." diff --git a/howto/descriptor.po b/howto/descriptor.po index bd41fb893..a631a3f40 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -25,70 +25,119 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Descriptor Guide" -msgstr "" +msgstr "راهنمای توصیف‌گر" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "Raymond Hettinger" -msgstr "" +msgstr "ریموند هتینگر" msgid "Contact" -msgstr "" +msgstr "تماس" msgid "" -msgstr "" +msgstr "" msgid "Contents" -msgstr "" +msgstr "فهرست مطالب" -msgid ":term:`Descriptors ` let objects customize attribute lookup, storage, and deletion." +msgid "" +":term:`Descriptors ` let objects customize attribute lookup, " +"storage, and deletion." msgstr "" +":term:`توصیف‌گرها (Descriptors) ` به اشیاء امکان می‌دهند تا " +"جستجو، ذخیره‌سازی و حذف ویژگی‌ها را سفارشی‌سازی کنند." msgid "This guide has four major sections:" -msgstr "" +msgstr "این راهنما دارای ۴ بخش اصلی است:" -msgid "The \"primer\" gives a basic overview, moving gently from simple examples, adding one feature at a time. Start here if you're new to descriptors." +msgid "" +"The \"primer\" gives a basic overview, moving gently from simple examples, " +"adding one feature at a time. Start here if you're new to descriptors." msgstr "" +"«primer» یک مرور کلی مقدماتی ارائه می‌دهد و به‌آرامی از مثال‌های ساده پیش " +"می‌رود و هر بار یک قابلیت را اضافه می‌کند. اگر با توصیف‌گرها (descriptors) " +"تازه‌کار هستید، از اینجا شروع کنید." -msgid "The second section shows a complete, practical descriptor example. If you already know the basics, start there." +msgid "" +"The second section shows a complete, practical descriptor example. If you " +"already know the basics, start there." msgstr "" +"بخش دوم نمونه‌ای کامل و کاربردی از توصیف‌گر (descriptor) را نشان می‌دهد. اگر" +" از قبل مبانی را می‌دانید، از همان‌جا شروع کنید." -msgid "The third section provides a more technical tutorial that goes into the detailed mechanics of how descriptors work. Most people don't need this level of detail." +msgid "" +"The third section provides a more technical tutorial that goes into the " +"detailed mechanics of how descriptors work. Most people don't need this " +"level of detail." msgstr "" +"بخش سوم، آموزش فنی‌تری ارائه می‌دهد که به سازوکار دقیق چگونگی کار توصیف‌گرها" +" (descriptors) می‌پردازد. بیشتر افراد به این سطح از جزئیات نیازی ندارند." -msgid "The last section has pure Python equivalents for built-in descriptors that are written in C. Read this if you're curious about how functions turn into bound methods or about the implementation of common tools like :deco:`classmethod`, :deco:`staticmethod`, :deco:`property`, and :term:`__slots__`." +msgid "" +"The last section has pure Python equivalents for built-in descriptors that " +"are written in C. Read this if you're curious about how functions turn into" +" bound methods or about the implementation of common tools like " +":deco:`classmethod`, :deco:`staticmethod`, :deco:`property`, and " +":term:`__slots__`." msgstr "" +"بخش آخر شامل معادل‌های پایتون خالص برای توصیف‌گرهای توکاری است که به زبان C " +"نوشته شده‌اند. اگر درباره چگونگی تبدیل توابع به متدهای مقید یا پیاده‌سازی " +"ابزارهای رایجی مانند :deco:`classmethod`، :deco:`staticmethod`، " +":deco:`property` و :term:`__slots__` کنجکاوید، این بخش را بخوانید." msgid "Primer" -msgstr "" +msgstr "مقدمات" -msgid "In this primer, we start with the most basic possible example and then we'll add new capabilities one by one." +msgid "" +"In this primer, we start with the most basic possible example and then we'll" +" add new capabilities one by one." msgstr "" +"در این آموزش مقدماتی، با ساده‌ترین مثال ممکن شروع می‌کنیم و سپس قابلیت‌های " +"جدید را یکی‌یکی اضافه خواهیم کرد." msgid "Simple example: A descriptor that returns a constant" -msgstr "" +msgstr "مثال ساده: یک توصیف‌گر (descriptor) که یک مقدار ثابت برمی‌گرداند" -msgid "The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method always returns the constant ``10``:" +msgid "" +"The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method" +" always returns the constant ``10``:" msgstr "" +"کلاس :class:`!Ten` یک توصیف‌گر (descriptor) است که متد " +":meth:`~object.__get__` آن همیشه ثابت ``10`` را برمی‌گرداند:" msgid "" "class Ten:\n" " def __get__(self, obj, objtype=None):\n" " return 10" msgstr "" +"class Ten:\n" +" def __get__(self, obj, objtype=None):\n" +" return 10" -msgid "To use the descriptor, it must be stored as a class variable in another class:" +msgid "" +"To use the descriptor, it must be stored as a class variable in another " +"class:" msgstr "" +"برای استفاده از توصیف‌گر (descriptor)، باید آن را به‌عنوان یک متغیر کلاس در " +"کلاس دیگری ذخیره کنید:" msgid "" "class A:\n" " x = 5 # Regular class attribute\n" " y = Ten() # Descriptor instance" msgstr "" +"class A:\n" +" x = 5 # Regular class attribute\n" +" y = Ten() # Descriptor instance" -msgid "An interactive session shows the difference between normal attribute lookup and descriptor lookup:" +msgid "" +"An interactive session shows the difference between normal attribute lookup " +"and descriptor lookup:" msgstr "" +"یک نشست تعاملی تفاوت میان جستجوی عادی ویژگی و جستجوی توصیف‌گر (descriptor) " +"را نشان می‌دهد:" msgid "" ">>> a = A() # Make an instance of class A\n" @@ -97,24 +146,49 @@ msgid "" ">>> a.y # Descriptor lookup\n" "10" msgstr "" +">>> a = A() # Make an instance of class A\n" +">>> a.x # Normal attribute lookup\n" +"5\n" +">>> a.y # Descriptor lookup\n" +"10" -msgid "In the ``a.x`` attribute lookup, the dot operator finds ``'x': 5`` in the class dictionary. In the ``a.y`` lookup, the dot operator finds a descriptor instance, recognized by its ``__get__`` method. Calling that method returns ``10``." +msgid "" +"In the ``a.x`` attribute lookup, the dot operator finds ``'x': 5`` in the " +"class dictionary. In the ``a.y`` lookup, the dot operator finds a " +"descriptor instance, recognized by its ``__get__`` method. Calling that " +"method returns ``10``." msgstr "" +"در جست‌وجوی ویژگی ``a.x``، عملگر نقطه ``'x': 5`` را در دیکشنری کلاس می‌یابد." +" در جست‌وجوی ``a.y``، عملگر نقطه یک نمونه‌ی توصیف‌گر (descriptor) را می‌یابد " +"که با متد ``__get__`` خود شناخته می‌شود. فراخوانی آن متد ``10`` را " +"برمی‌گرداند." -msgid "Note that the value ``10`` is not stored in either the class dictionary or the instance dictionary. Instead, the value ``10`` is computed on demand." +msgid "" +"Note that the value ``10`` is not stored in either the class dictionary or " +"the instance dictionary. Instead, the value ``10`` is computed on demand." msgstr "" +"توجه داشته باشید که مقدار ``10`` در هیچ‌یک از دیکشنری کلاس یا دیکشنری نمونه " +"ذخیره نمی‌شود. در عوض، مقدار ``10`` در صورت درخواست محاسبه می‌شود." -msgid "This example shows how a simple descriptor works, but it isn't very useful. For retrieving constants, normal attribute lookup would be better." +msgid "" +"This example shows how a simple descriptor works, but it isn't very useful. " +"For retrieving constants, normal attribute lookup would be better." msgstr "" +"این مثال نشان می‌دهد که یک توصیف‌گر ساده چگونه کار می‌کند، اما چندان مفید " +"نیست. برای بازیابی ثابت‌ها، جستجوی عادی ویژگی بهتر است." -msgid "In the next section, we'll create something more useful, a dynamic lookup." -msgstr "" +msgid "" +"In the next section, we'll create something more useful, a dynamic lookup." +msgstr "در بخش بعدی، چیزی مفیدتر ایجاد خواهیم کرد: یک جستجوی پویا." msgid "Dynamic lookups" -msgstr "" +msgstr "جستجوهای پویا" -msgid "Interesting descriptors typically run computations instead of returning constants:" +msgid "" +"Interesting descriptors typically run computations instead of returning " +"constants:" msgstr "" +"توصیف‌گرهای جالب معمولاً به‌جای برگرداندن ثابت‌ها، محاسبات را اجرا می‌کنند:" msgid "" "import os\n" @@ -131,9 +205,26 @@ msgid "" " def __init__(self, dirname):\n" " self.dirname = dirname # Regular instance attribute" msgstr "" +"import os\n" +"\n" +"class DirectorySize:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return len(os.listdir(obj.dirname))\n" +"\n" +"class Directory:\n" +"\n" +" size = DirectorySize() # Descriptor instance\n" +"\n" +" def __init__(self, dirname):\n" +" self.dirname = dirname # Regular instance attribute" -msgid "An interactive session shows that the lookup is dynamic — it computes different, updated answers each time::" +msgid "" +"An interactive session shows that the lookup is dynamic — it computes " +"different, updated answers each time::" msgstr "" +"یک نشست تعاملی نشان می‌دهد که جستجو پویا است — هر بار پاسخ‌هایی متفاوت و " +"به‌روز محاسبه می‌کند::" msgid "" ">>> s = Directory('songs')\n" @@ -146,18 +237,54 @@ msgid "" ">>> g.size # File count is automatically updated\n" "2" msgstr "" +">>> s = Directory('songs')\n" +">>> g = Directory('games')\n" +">>> s.size # The songs directory has twenty files\n" +"20\n" +">>> g.size # The games directory has three files\n" +"3\n" +">>> os.remove('games/chess') # Delete a game\n" +">>> g.size # File count is automatically updated\n" +"2" -msgid "Besides showing how descriptors can run computations, this example also reveals the purpose of the parameters to :meth:`~object.__get__`. The *self* parameter is *size*, an instance of *DirectorySize*. The *obj* parameter is either *g* or *s*, an instance of *Directory*. It is the *obj* parameter that lets the :meth:`~object.__get__` method learn the target directory. The *objtype* parameter is the class *Directory*." -msgstr "" +msgid "" +"Besides showing how descriptors can run computations, this example also " +"reveals the purpose of the parameters to :meth:`~object.__get__`. The " +"*self* parameter is *size*, an instance of *DirectorySize*. The *obj* " +"parameter is either *g* or *s*, an instance of *Directory*. It is the *obj*" +" parameter that lets the :meth:`~object.__get__` method learn the target " +"directory. The *objtype* parameter is the class *Directory*." +msgstr "" +"علاوه بر نشان دادن این که توصیف‌گرها چگونه می‌توانند محاسبات را اجرا کنند، " +"این مثال همچنین هدف از پارامترهای :meth:`~object.__get__` را آشکار می‌کند. " +"پارامتر *self*، *size* است که یک نمونه از *DirectorySize* است. پارامتر *obj*" +" یا *g* است یا *s*، یعنی یک نمونه از *Directory*. این پارامتر *obj* است که " +"به متد :meth:`~object.__get__` امکان می‌دهد پوشه هدف را بشناسد. پارامتر " +"*objtype*، کلاس *Directory* است." msgid "Managed attributes" -msgstr "" +msgstr "ویژگی‌های مدیریت‌شده" -msgid "A popular use for descriptors is managing access to instance data. The descriptor is assigned to a public attribute in the class dictionary while the actual data is stored as a private attribute in the instance dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object.__set__` methods are triggered when the public attribute is accessed." -msgstr "" +msgid "" +"A popular use for descriptors is managing access to instance data. The " +"descriptor is assigned to a public attribute in the class dictionary while " +"the actual data is stored as a private attribute in the instance dictionary." +" The descriptor's :meth:`~object.__get__` and :meth:`~object.__set__` " +"methods are triggered when the public attribute is accessed." +msgstr "" +"یک کاربرد رایج توصیف‌گرها (descriptors)، مدیریت دسترسی به داده‌های نمونه " +"است. توصیف‌گر به یک ویژگی عمومی در دیکشنری کلاس اختصاص داده می‌شود، در حالی " +"که داده واقعی به‌صورت یک ویژگی خصوصی در دیکشنری نمونه ذخیره می‌شود. متدهای " +":meth:`~object.__get__` و :meth:`~object.__set__` توصیف‌گر، هنگام دسترسی به " +"ویژگی عمومی فراخوانی می‌شوند." -msgid "In the following example, *age* is the public attribute and *_age* is the private attribute. When the public attribute is accessed, the descriptor logs the lookup or update:" +msgid "" +"In the following example, *age* is the public attribute and *_age* is the " +"private attribute. When the public attribute is accessed, the descriptor " +"logs the lookup or update:" msgstr "" +"در مثال زیر، *age* ویژگی عمومی و *_age* ویژگی خصوصی است. هنگام دسترسی به " +"ویژگی عمومی، توصیف‌گر جست‌وجو یا به‌روزرسانی را ثبت می‌کند:" msgid "" "import logging\n" @@ -186,9 +313,38 @@ msgid "" " def birthday(self):\n" " self.age += 1 # Calls both __get__() and __set__()" msgstr "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAgeAccess:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = obj._age\n" +" logging.info('Accessing %r giving %r', 'age', value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', 'age', value)\n" +" obj._age = value\n" +"\n" +"class Person:\n" +"\n" +" age = LoggedAgeAccess() # Descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Regular instance attribute\n" +" self.age = age # Calls __set__()\n" +"\n" +" def birthday(self):\n" +" self.age += 1 # Calls both __get__() and __set__()" -msgid "An interactive session shows that all access to the managed attribute *age* is logged, but that the regular attribute *name* is not logged:" +msgid "" +"An interactive session shows that all access to the managed attribute *age* " +"is logged, but that the regular attribute *name* is not logged:" msgstr "" +"یک نشست تعاملی نشان می‌دهد که همه دسترسی‌ها به ویژگی مدیریت‌شده *age* ثبت " +"می‌شوند، اما ویژگی معمولی *name* ثبت نمی‌شود:" msgid "" ">>> mary = Person('Mary M', 30) # The initial age update is logged\n" @@ -214,18 +370,62 @@ msgid "" "INFO:root:Accessing 'age' giving 40\n" "40" msgstr "" +">>> mary = Person('Mary M', 30) # The initial age update is logged\n" +"INFO:root:Updating 'age' to 30\n" +">>> dave = Person('David D', 40)\n" +"INFO:root:Updating 'age' to 40\n" +"\n" +">>> vars(mary) # The actual data is in a private attribute\n" +"{'name': 'Mary M', '_age': 30}\n" +">>> vars(dave)\n" +"{'name': 'David D', '_age': 40}\n" +"\n" +">>> mary.age # Access the data and log the lookup\n" +"INFO:root:Accessing 'age' giving 30\n" +"30\n" +">>> mary.birthday() # Updates are logged as well\n" +"INFO:root:Accessing 'age' giving 30\n" +"INFO:root:Updating 'age' to 31\n" +"\n" +">>> dave.name # Regular attribute lookup isn't logged\n" +"'David D'\n" +">>> dave.age # Only the managed attribute is logged\n" +"INFO:root:Accessing 'age' giving 40\n" +"40" -msgid "One major issue with this example is that the private name *_age* is hardwired in the *LoggedAgeAccess* class. That means that each instance can only have one logged attribute and that its name is unchangeable. In the next example, we'll fix that problem." +msgid "" +"One major issue with this example is that the private name *_age* is " +"hardwired in the *LoggedAgeAccess* class. That means that each instance can" +" only have one logged attribute and that its name is unchangeable. In the " +"next example, we'll fix that problem." msgstr "" +"یکی از مشکلات اساسی این مثال این است که نام خصوصی *_age* در کلاس " +"*LoggedAgeAccess* به‌صورت سخت‌کد تعریف شده است. این بدان معناست که هر نمونه " +"فقط می‌تواند یک ویژگی ثبت‌شده داشته باشد و نام آن تغییرناپذیر است. در مثال " +"بعدی، این مشکل را برطرف خواهیم کرد." msgid "Customized names" -msgstr "" +msgstr "نام‌های سفارشی" -msgid "When a class uses descriptors, it can inform each descriptor about which variable name was used." +msgid "" +"When a class uses descriptors, it can inform each descriptor about which " +"variable name was used." msgstr "" +"هنگامی که یک کلاس از توصیف‌گرها (descriptors) استفاده می‌کند، می‌تواند به هر" +" توصیف‌گر اطلاع دهد که کدام نام متغیر استفاده شده است." -msgid "In this example, the :class:`!Person` class has two descriptor instances, *name* and *age*. When the :class:`!Person` class is defined, it makes a callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field names can be recorded, giving each descriptor its own *public_name* and *private_name*:" -msgstr "" +msgid "" +"In this example, the :class:`!Person` class has two descriptor instances, " +"*name* and *age*. When the :class:`!Person` class is defined, it makes a " +"callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field" +" names can be recorded, giving each descriptor its own *public_name* and " +"*private_name*:" +msgstr "" +"در این مثال، کلاس :class:`!Person` دارای دو نمونه از توصیف‌گرها، *name* و " +"*age* است. هنگامی که کلاس :class:`!Person` تعریف می‌شود، یک فراخوانی بازگشتی" +" به :meth:`~object.__set_name__` در *LoggedAccess* انجام می‌دهد تا نام " +"فیلدها بتوانند ثبت شوند و به هر توصیف‌گر، *public_name* و *private_name* " +"خودش داده شود:" msgid "" "import logging\n" @@ -259,9 +459,46 @@ msgid "" " def birthday(self):\n" " self.age += 1" msgstr "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAccess:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.public_name = name\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = getattr(obj, self.private_name)\n" +" logging.info('Accessing %r giving %r', self.public_name, value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', self.public_name, value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +"class Person:\n" +"\n" +" name = LoggedAccess() # First descriptor instance\n" +" age = LoggedAccess() # Second descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Calls the first descriptor\n" +" self.age = age # Calls the second descriptor\n" +"\n" +" def birthday(self):\n" +" self.age += 1" -msgid "An interactive session shows that the :class:`!Person` class has called :meth:`~object.__set_name__` so that the field names would be recorded. Here we call :func:`vars` to look up the descriptor without triggering it:" +msgid "" +"An interactive session shows that the :class:`!Person` class has called " +":meth:`~object.__set_name__` so that the field names would be recorded. " +"Here we call :func:`vars` to look up the descriptor without triggering it:" msgstr "" +"یک نشست تعاملی نشان می‌دهد که کلاس :class:`!Person` متد " +":meth:`~object.__set_name__` را فراخوانی کرده است تا نام فیلدها ثبت شوند. در" +" اینجا :func:`vars` را فراخوانی می‌کنیم تا توصیف‌گر را بدون فعال‌سازی آن " +"جستجو کنیم:" msgid "" ">>> vars(vars(Person)['name'])\n" @@ -269,9 +506,13 @@ msgid "" ">>> vars(vars(Person)['age'])\n" "{'public_name': 'age', 'private_name': '_age'}" msgstr "" +">>> vars(vars(Person)['name'])\n" +"{'public_name': 'name', 'private_name': '_name'}\n" +">>> vars(vars(Person)['age'])\n" +"{'public_name': 'age', 'private_name': '_age'}" msgid "The new class now logs access to both *name* and *age*:" -msgstr "" +msgstr "کلاس جدید اکنون دسترسی به هر دو *name* و *age* را ثبت می‌کند:" msgid "" ">>> pete = Person('Peter P', 10)\n" @@ -281,9 +522,15 @@ msgid "" "INFO:root:Updating 'name' to 'Catherine C'\n" "INFO:root:Updating 'age' to 20" msgstr "" +">>> pete = Person('Peter P', 10)\n" +"INFO:root:Updating 'name' to 'Peter P'\n" +"INFO:root:Updating 'age' to 10\n" +">>> kate = Person('Catherine C', 20)\n" +"INFO:root:Updating 'name' to 'Catherine C'\n" +"INFO:root:Updating 'age' to 20" msgid "The two *Person* instances contain only the private names:" -msgstr "" +msgstr "این دو نمونه‌ی *Person* فقط شامل نام‌های خصوصی هستند:" msgid "" ">>> vars(pete)\n" @@ -291,45 +538,111 @@ msgid "" ">>> vars(kate)\n" "{'_name': 'Catherine C', '_age': 20}" msgstr "" +">>> vars(pete)\n" +"{'_name': 'Peter P', '_age': 10}\n" +">>> vars(kate)\n" +"{'_name': 'Catherine C', '_age': 20}" msgid "Closing thoughts" -msgstr "" +msgstr "سخن پایانی" -msgid "A :term:`descriptor` is what we call any object that defines :meth:`~object.__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." +msgid "" +"A :term:`descriptor` is what we call any object that defines " +":meth:`~object.__get__`, :meth:`~object.__set__`, or " +":meth:`~object.__delete__`." msgstr "" +"به هر شیء‌ای که :meth:`~object.__get__`، :meth:`~object.__set__`، یا " +":meth:`~object.__delete__` را تعریف می‌کند، یک :term:`descriptor` گفته " +"می‌شود." -msgid "Optionally, descriptors can have a :meth:`~object.__set_name__` method. This is only used in cases where a descriptor needs to know either the class where it was created or the name of class variable it was assigned to. (This method, if present, is called even if the class is not a descriptor.)" +msgid "" +"Optionally, descriptors can have a :meth:`~object.__set_name__` method. " +"This is only used in cases where a descriptor needs to know either the class" +" where it was created or the name of class variable it was assigned to. " +"(This method, if present, is called even if the class is not a descriptor.)" msgstr "" +"به‌صورت اختیاری، توصیف‌گرها می‌توانند یک متد :meth:`~object.__set_name__` " +"داشته باشند. این متد فقط در مواردی استفاده می‌شود که یک توصیف‌گر نیاز دارد " +"بداند یا کلاسی که در آن ایجاد شده است یا نام متغیر کلاسی که به آن اختصاص " +"داده شده است. (این متد، در صورت وجود، حتی اگر کلاس یک توصیف‌گر نباشد نیز " +"فراخوانی می‌شود.)" -msgid "Descriptors get invoked by the dot operator during attribute lookup. If a descriptor is accessed indirectly with ``vars(some_class)[descriptor_name]``, the descriptor instance is returned without invoking it." +msgid "" +"Descriptors get invoked by the dot operator during attribute lookup. If a " +"descriptor is accessed indirectly with " +"``vars(some_class)[descriptor_name]``, the descriptor instance is returned " +"without invoking it." msgstr "" +"توصیف‌گرها (descriptors) در حین جست‌وجوی ویژگی، به‌وسیله عملگر نقطه فراخوانی" +" می‌شوند. اگر به یک توصیف‌گر به‌طور غیرمستقیم از طریق " +"``vars(some_class)[descriptor_name]`` دسترسی پیدا شود، نمونه‌ی توصیف‌گر بدون" +" فراخوانی آن برگردانده می‌شود." -msgid "Descriptors only work when used as class variables. When put in instances, they have no effect." +msgid "" +"Descriptors only work when used as class variables. When put in instances, " +"they have no effect." msgstr "" +"توصیف‌گرها تنها زمانی کار می‌کنند که به‌عنوان متغیرهای کلاس استفاده شوند. " +"هنگامی که در نمونه‌ها قرار داده شوند، هیچ تأثیری ندارند." -msgid "The main motivation for descriptors is to provide a hook allowing objects stored in class variables to control what happens during attribute lookup." +msgid "" +"The main motivation for descriptors is to provide a hook allowing objects " +"stored in class variables to control what happens during attribute lookup." msgstr "" +"انگیزه‌ی اصلی توصیف‌گرها، فراهم کردن قلابی است که به اشیاء ذخیره‌شده در " +"متغیرهای کلاس اجازه می‌دهد کنترل کنند در هنگام جست‌وجوی ویژگی چه اتفاقی " +"می‌افتد." -msgid "Traditionally, the calling class controls what happens during lookup. Descriptors invert that relationship and allow the data being looked-up to have a say in the matter." +msgid "" +"Traditionally, the calling class controls what happens during lookup. " +"Descriptors invert that relationship and allow the data being looked-up to " +"have a say in the matter." msgstr "" +"به‌طور سنتی، کلاس فراخوان کنترل می‌کند که در حین جستجو چه اتفاقی بیفتد. " +"توصیف‌گرها (descriptors) آن رابطه را معکوس می‌کنند و به داده‌ی مورد جستجو " +"اجازه می‌دهند در این موضوع دخالت داشته باشد." -msgid "Descriptors are used throughout the language. It is how functions turn into bound methods. Common tools like :deco:`classmethod`, :deco:`staticmethod`, :deco:`property`, and :deco:`functools.cached_property` are all implemented as descriptors." +msgid "" +"Descriptors are used throughout the language. It is how functions turn into" +" bound methods. Common tools like :deco:`classmethod`, " +":deco:`staticmethod`, :deco:`property`, and " +":deco:`functools.cached_property` are all implemented as descriptors." msgstr "" +"توصیف‌گرها (descriptors) در سراسر زبان استفاده می‌شوند. این سازوکاری است که" +" از طریق آن توابع به متدهای مقید (bound methods) تبدیل می‌شوند. ابزارهای " +"رایجی مانند :deco:`classmethod`، :deco:`staticmethod`، :deco:`property` و " +":deco:`functools.cached_property` همگی به‌عنوان توصیف‌گر پیاده‌سازی شده‌اند." msgid "Complete Practical Example" -msgstr "" +msgstr "مثال عملی کامل" -msgid "In this example, we create a practical and powerful tool for locating notoriously hard to find data corruption bugs." +msgid "" +"In this example, we create a practical and powerful tool for locating " +"notoriously hard to find data corruption bugs." msgstr "" +"در این مثال، یک ابزار کاربردی و قدرتمند برای یافتن اشکال‌های خرابی داده که " +"یافتنشان بسیار دشوار است، می‌سازیم." msgid "Validator class" -msgstr "" +msgstr "کلاس اعتبارسنج" -msgid "A validator is a descriptor for managed attribute access. Prior to storing any data, it verifies that the new value meets various type and range restrictions. If those restrictions aren't met, it raises an exception to prevent data corruption at its source." +msgid "" +"A validator is a descriptor for managed attribute access. Prior to storing " +"any data, it verifies that the new value meets various type and range " +"restrictions. If those restrictions aren't met, it raises an exception to " +"prevent data corruption at its source." msgstr "" +"اعتبارسنج توصیف‌گری برای دسترسی مدیریت‌شده به ویژگی است. پیش از ذخیره هرگونه" +" داده، بررسی می‌کند که مقدار جدید محدودیت‌های مختلف نوع و دامنه را برآورده " +"می‌کند. اگر این محدودیت‌ها برآورده نشوند، استثنایی را پرتاب می‌کند تا از " +"فساد داده در مبدأ جلوگیری شود." -msgid "This :class:`!Validator` class is both an :term:`abstract base class` and a managed attribute descriptor:" +msgid "" +"This :class:`!Validator` class is both an :term:`abstract base class` and a " +"managed attribute descriptor:" msgstr "" +"این کلاس :class:`!Validator` هم یک :term:`کلاس پایه انتزاعی ` و هم یک توصیف‌گر ویژگی مدیریت‌شده است:" msgid "" "from abc import ABC, abstractmethod\n" @@ -350,24 +663,63 @@ msgid "" " def validate(self, value):\n" " pass" msgstr "" +"from abc import ABC, abstractmethod\n" +"\n" +"class Validator(ABC):\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return getattr(obj, self.private_name)\n" +"\n" +" def __set__(self, obj, value):\n" +" self.validate(value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +" @abstractmethod\n" +" def validate(self, value):\n" +" pass" -msgid "Custom validators need to inherit from :class:`!Validator` and must supply a :meth:`!validate` method to test various restrictions as needed." +msgid "" +"Custom validators need to inherit from :class:`!Validator` and must supply a" +" :meth:`!validate` method to test various restrictions as needed." msgstr "" +"اعتبارسنج‌های سفارشی باید از :class:`!Validator` ارث‌بری کنند و یک متد " +":meth:`!validate` برای آزمایش محدودیت‌های مختلف در صورت نیاز فراهم کنند." msgid "Custom validators" -msgstr "" +msgstr "اعتبارسنج‌های سفارشی" msgid "Here are three practical data validation utilities:" -msgstr "" +msgstr "در اینجا سه ابزار کاربردی برای اعتبارسنجی داده‌ها آمده است:" -msgid ":class:`!OneOf` verifies that a value is one of a restricted set of options." +msgid "" +":class:`!OneOf` verifies that a value is one of a restricted set of options." msgstr "" +":class:`!OneOf` تأیید می‌کند که یک مقدار یکی از اعضای مجموعه‌ای محدود از " +"گزینه‌ها است." -msgid ":class:`!Number` verifies that a value is either an :class:`int` or :class:`float`. Optionally, it verifies that a value is between a given minimum or maximum." +msgid "" +":class:`!Number` verifies that a value is either an :class:`int` or " +":class:`float`. Optionally, it verifies that a value is between a given " +"minimum or maximum." msgstr "" +":class:`!Number` تأیید می‌کند که یک مقدار یا :class:`int` است یا " +":class:`float`. به‌صورت اختیاری، تأیید می‌کند که یک مقدار بین یک کمینه یا " +"بیشینه‌ی داده‌شده باشد." -msgid ":class:`!String` verifies that a value is a :class:`str`. Optionally, it validates a given minimum or maximum length. It can validate a user-defined `predicate `_ as well." +msgid "" +":class:`!String` verifies that a value is a :class:`str`. Optionally, it " +"validates a given minimum or maximum length. It can validate a user-defined" +" `predicate `_" +" as well." msgstr "" +":class:`!String` تأیید می‌کند که یک مقدار از نوع :class:`str` است. به‌صورت " +"اختیاری، حداقل یا حداکثر طول داده‌شده را اعتبارسنجی می‌کند. همچنین می‌تواند " +"یک `محمول (predicate) " +"`_ تعریف‌شده " +"توسط کاربر را نیز اعتبارسنجی کند." msgid "" "class OneOf(Validator):\n" @@ -422,12 +774,64 @@ msgid "" " f'Expected {self.predicate} to be true for {value!r}'\n" " )" msgstr "" +"class OneOf(Validator):\n" +"\n" +" def __init__(self, *options):\n" +" self.options = set(options)\n" +"\n" +" def validate(self, value):\n" +" if value not in self.options:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be one of {self.options!r}'\n" +" )\n" +"\n" +"class Number(Validator):\n" +"\n" +" def __init__(self, minvalue=None, maxvalue=None):\n" +" self.minvalue = minvalue\n" +" self.maxvalue = maxvalue\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, (int, float)):\n" +" raise TypeError(f'Expected {value!r} to be an int or float')\n" +" if self.minvalue is not None and value < self.minvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be at least {self.minvalue!r}'\n" +" )\n" +" if self.maxvalue is not None and value > self.maxvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no more than {self.maxvalue!r}'\n" +" )\n" +"\n" +"class String(Validator):\n" +"\n" +" def __init__(self, minsize=None, maxsize=None, predicate=None):\n" +" self.minsize = minsize\n" +" self.maxsize = maxsize\n" +" self.predicate = predicate\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, str):\n" +" raise TypeError(f'Expected {value!r} to be a str')\n" +" if self.minsize is not None and len(value) < self.minsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no smaller than {self.minsize!r}'\n" +" )\n" +" if self.maxsize is not None and len(value) > self.maxsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no bigger than {self.maxsize!r}'\n" +" )\n" +" if self.predicate is not None and not self.predicate(value):\n" +" raise ValueError(\n" +" f'Expected {self.predicate} to be true for {value!r}'\n" +" )" msgid "Practical application" -msgstr "" +msgstr "کاربرد عملی" msgid "Here's how the data validators can be used in a real class:" msgstr "" +"در اینجا چگونگی استفاده از اعتبارسنج‌های داده در یک کلاس واقعی آمده است:" msgid "" "class Component:\n" @@ -441,9 +845,19 @@ msgid "" " self.kind = kind\n" " self.quantity = quantity" msgstr "" +"class Component:\n" +"\n" +" name = String(minsize=3, maxsize=10, predicate=str.isupper)\n" +" kind = OneOf('wood', 'metal', 'plastic')\n" +" quantity = Number(minvalue=0)\n" +"\n" +" def __init__(self, name, kind, quantity):\n" +" self.name = name\n" +" self.kind = kind\n" +" self.quantity = quantity" msgid "The descriptors prevent invalid instances from being created:" -msgstr "" +msgstr "توصیف‌گرها از ایجاد نمونه‌های نامعتبر جلوگیری می‌کنند:" msgid "" ">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all uppercase\n" @@ -468,84 +882,223 @@ msgid "" "\n" ">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" msgstr "" +">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all uppercase\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected to be true for 'Widget'\n" +"\n" +">>> Component('WIDGET', 'metle', 5) # Blocked: 'metle' is misspelled\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected 'metle' to be one of {'metal', 'plastic', 'wood'}\n" +"\n" +">>> Component('WIDGET', 'metal', -5) # Blocked: -5 is negative\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected -5 to be at least 0\n" +"\n" +">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: Expected 'V' to be an int or float\n" +"\n" +">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" msgid "Technical Tutorial" -msgstr "" +msgstr "آموزش فنی" -msgid "What follows is a more technical tutorial for the mechanics and details of how descriptors work." +msgid "" +"What follows is a more technical tutorial for the mechanics and details of " +"how descriptors work." msgstr "" +"آنچه در ادامه می‌آید، آموزش فنی‌تری درباره‌ی سازوکار و جزئیات چگونگی کار " +"توصیف‌گرها (descriptors) است." msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "Defines descriptors, summarizes the protocol, and shows how descriptors are called. Provides an example showing how object relational mappings work." +msgid "" +"Defines descriptors, summarizes the protocol, and shows how descriptors are " +"called. Provides an example showing how object relational mappings work." msgstr "" +"توصیف‌گرها را تعریف می‌کند، پروتکل را خلاصه می‌کند و نحوه فراخوانی " +"توصیف‌گرها را نشان می‌دهد. مثالی ارائه می‌کند که نشان می‌دهد نگاشت‌های " +"شیء-رابطه‌ای چگونه کار می‌کنند." -msgid "Learning about descriptors not only provides access to a larger toolset, it creates a deeper understanding of how Python works." +msgid "" +"Learning about descriptors not only provides access to a larger toolset, it " +"creates a deeper understanding of how Python works." msgstr "" +"یادگیری توصیف‌گرها (descriptors) نه‌تنها دسترسی به مجموعه‌ابزار بزرگ‌تری را " +"فراهم می‌کند، بلکه درک عمیق‌تری از نحوه کارکرد پایتون ایجاد می‌کند." msgid "Definition and introduction" -msgstr "" +msgstr "تعریف و مقدمه" -msgid "In general, a descriptor is an attribute value that has one of the methods in the descriptor protocol. Those methods are :meth:`~object.__get__`, :meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those methods are defined for an attribute, it is said to be a :term:`descriptor`." +msgid "" +"In general, a descriptor is an attribute value that has one of the methods " +"in the descriptor protocol. Those methods are :meth:`~object.__get__`, " +":meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " +"methods are defined for an attribute, it is said to be a :term:`descriptor`." msgstr "" +"به‌طور کلی، توصیف‌گر یک مقدار ویژگی است که یکی از متدهای پروتکل توصیف‌گر را " +"دارد. آن متدها عبارت‌اند از :meth:`~object.__get__`، :meth:`~object.__set__`" +" و :meth:`~object.__delete__`. اگر هر یک از آن متدها برای یک ویژگی تعریف شده" +" باشد، به آن :term:`توصیف‌گر ` گفته می‌شود." -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 chain starting with ``a.__dict__['x']``, then ``type(a).__dict__['x']``, and continuing through the method resolution order of ``type(a)``. If the looked-up value is an object defining one of the descriptor methods, then Python may override the default behavior and invoke the descriptor method instead. Where this occurs in the precedence chain depends on which descriptor methods were defined." -msgstr "" +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 " +"chain starting with ``a.__dict__['x']``, then ``type(a).__dict__['x']``, and" +" continuing through the method resolution order of ``type(a)``. If the " +"looked-up value is an object defining one of the descriptor methods, then " +"Python may override the default behavior and invoke the descriptor method " +"instead. Where this occurs in the precedence chain depends on which " +"descriptor methods were defined." +msgstr "" +"رفتار پیش‌فرض برای دسترسی به ویژگی این است که ویژگی از دیکشنری یک شیء " +"دریافت، تنظیم یا حذف شود. برای مثال، ``a.x`` یک زنجیره جستجو دارد که با " +"``a.__dict__['x']`` شروع می‌شود، سپس به ``type(a).__dict__['x']`` می‌رسد و " +"از طریق ترتیب حل متد ``type(a)`` ادامه می‌یابد. اگر مقدار جستجوشده شیئی " +"باشد که یکی از متدهای توصیف‌گر (descriptor) را تعریف می‌کند، پایتون ممکن است" +" رفتار پیش‌فرض را نادیده بگیرد و در عوض متد توصیف‌گر را فراخوانی کند. اینکه " +"این اتفاق در کجای زنجیره اولویت رخ می‌دهد، به این بستگی دارد که کدام متدهای " +"توصیف‌گر تعریف شده‌اند." -msgid "Descriptors are a powerful, general purpose protocol. They are the mechanism behind properties, methods, static methods, class methods, and :func:`super`. They are used throughout Python itself. Descriptors simplify the underlying C code and offer a flexible set of new tools for everyday Python programs." -msgstr "" +msgid "" +"Descriptors are a powerful, general purpose protocol. They are the " +"mechanism behind properties, methods, static methods, class methods, and " +":func:`super`. They are used throughout Python itself. Descriptors " +"simplify the underlying C code and offer a flexible set of new tools for " +"everyday Python programs." +msgstr "" +"توصیف‌گرها یک پروتکل قدرتمند و با کاربرد عمومی هستند. آن‌ها سازوکار پشت " +"ویژگی‌ها، متدها، متدهای ایستا، متدهای کلاس و :func:`super` هستند. آن‌ها در " +"سراسر خود پایتون استفاده می‌شوند. توصیف‌گرها کد C زیربنایی را ساده می‌کنند و" +" مجموعه‌ای انعطاف‌پذیر از ابزارهای جدید برای برنامه‌های روزمره پایتون ارائه " +"می‌دهند." msgid "Descriptor protocol" -msgstr "" +msgstr "پروتکل توصیف‌گر" msgid "``descr.__get__(self, obj, type=None)``" -msgstr "" +msgstr "``descr.__get__(self, obj, type=None)``" msgid "``descr.__set__(self, obj, value)``" -msgstr "" +msgstr "``descr.__set__(self, obj, value)``" msgid "``descr.__delete__(self, obj)``" -msgstr "" +msgstr "``descr.__delete__(self, obj)``" -msgid "That is all there is to it. Define any of these methods and an object is considered a descriptor and can override default behavior upon being looked up as an attribute." +msgid "" +"That is all there is to it. Define any of these methods and an object is " +"considered a descriptor and can override default behavior upon being looked " +"up as an attribute." msgstr "" +"تمام مطلب همین است. هر یک از این متدها را تعریف کنید، آن شیء یک توصیف‌گر " +"(descriptor) محسوب می‌شود و می‌تواند رفتار پیش‌فرض را هنگامی که به‌عنوان یک " +"ویژگی مورد جستجو قرار می‌گیرد، بازنویسی کند." -msgid "If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, it is considered a data descriptor. Descriptors that only define :meth:`~object.__get__` are called non-data descriptors (they are often used for methods but other uses are possible)." +msgid "" +"If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " +"it is considered a data descriptor. Descriptors that only define " +":meth:`~object.__get__` are called non-data descriptors (they are often used" +" for methods but other uses are possible)." msgstr "" +"اگر یک شیء :meth:`~object.__set__` یا :meth:`~object.__delete__` را تعریف " +"کند، یک توصیف‌گر داده محسوب می‌شود. توصیف‌گرهایی که فقط " +":meth:`~object.__get__` را تعریف می‌کنند، توصیف‌گرهای غیرداده نامیده می‌شوند" +" (آن‌ها اغلب برای متدها استفاده می‌شوند، اما ممکن است کاربردهای دیگری نیز " +"داشته باشند)." -msgid "Data and non-data descriptors differ in how overrides are calculated with respect to entries in an instance's dictionary. If an instance's dictionary has an entry with the same name as a data descriptor, the data descriptor takes precedence. If an instance's dictionary has an entry with the same name as a non-data descriptor, the dictionary entry takes precedence." -msgstr "" +msgid "" +"Data and non-data descriptors differ in how overrides are calculated with " +"respect to entries in an instance's dictionary. If an instance's dictionary" +" has an entry with the same name as a data descriptor, the data descriptor " +"takes precedence. If an instance's dictionary has an entry with the same " +"name as a non-data descriptor, the dictionary entry takes precedence." +msgstr "" +"توصیف‌گرهای داده‌ای و غیرداده‌ای در نحوه محاسبه بازنویسی‌ها نسبت به " +"ورودی‌های دیکشنری یک نمونه تفاوت دارند. اگر دیکشنری یک نمونه ورودی‌ای با " +"همان نام یک توصیف‌گر داده‌ای داشته باشد، توصیف‌گر داده‌ای اولویت دارد. اگر " +"دیکشنری یک نمونه ورودی‌ای با همان نام یک توصیف‌گر غیرداده‌ای داشته باشد، " +"ورودی دیکشنری اولویت دارد." -msgid "To make a read-only data descriptor, define both :meth:`~object.__get__` and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:`AttributeError` when called. Defining the :meth:`~object.__set__` method with an exception raising placeholder is enough to make it a data descriptor." -msgstr "" +msgid "" +"To make a read-only data descriptor, define both :meth:`~object.__get__` and" +" :meth:`~object.__set__` with the :meth:`~object.__set__` raising an " +":exc:`AttributeError` when called. Defining the :meth:`~object.__set__` " +"method with an exception raising placeholder is enough to make it a data " +"descriptor." +msgstr "" +"برای ساخت یک توصیف‌گر داده‌ی فقط‌خواندنی، هر دو :meth:`~object.__get__` و " +":meth:`~object.__set__` را تعریف کنید، به‌گونه‌ای که :meth:`~object.__set__`" +" هنگام فراخوانی یک :exc:`AttributeError` پرتاب کند. تعریف متد " +":meth:`~object.__set__` با یک جای‌نگهدار که استثنا پرتاب می‌کند، برای تبدیل " +"آن به یک توصیف‌گر داده کافی است." msgid "Overview of descriptor invocation" -msgstr "" +msgstr "نمای کلی از فراخوانی توصیف‌گر" -msgid "A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc.__get__(None, cls)``." +msgid "" +"A descriptor can be called directly with ``desc.__get__(obj)`` or " +"``desc.__get__(None, cls)``." msgstr "" +"می‌توان یک توصیف‌گر (descriptor) را مستقیماً با ``desc.__get__(obj)`` یا " +"``desc.__get__(None, cls)`` فراخوانی کرد." -msgid "But it is more common for a descriptor to be invoked automatically from attribute access." +msgid "" +"But it is more common for a descriptor to be invoked automatically from " +"attribute access." msgstr "" +"اما رایج‌تر است که یک توصیف‌گر (descriptor) به‌طور خودکار از طریق دسترسی به " +"ویژگی فراخوانی شود." -msgid "The expression ``obj.x`` looks up the attribute ``x`` in the chain of namespaces for ``obj``. If the search finds a descriptor outside of the instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is invoked according to the precedence rules listed below." +msgid "" +"The expression ``obj.x`` looks up the attribute ``x`` in the chain of " +"namespaces for ``obj``. If the search finds a descriptor outside of the " +"instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is " +"invoked according to the precedence rules listed below." msgstr "" +"عبارت ``obj.x`` ویژگی ``x`` را در زنجیره‌ای از فضای نامها برای ``obj`` جستجو " +"می‌کند. اگر جستجو یک توصیف‌گر (descriptor) را خارج از " +":attr:`~object.__dict__` نمونه بیابد، متد :meth:`~object.__get__` آن بر " +"اساس قواعد تقدم فهرست‌شده در زیر فراخوانی می‌شود." -msgid "The details of invocation depend on whether ``obj`` is an object, class, or instance of super." +msgid "" +"The details of invocation depend on whether ``obj`` is an object, class, or " +"instance of super." msgstr "" +"جزئیات فراخوانی به این بستگی دارد که ``obj`` یک شیء، کلاس یا نمونه‌ای از " +"super باشد." msgid "Invocation from an instance" -msgstr "" +msgstr "فراخوانی از یک نمونه" -msgid "Instance lookup scans through a chain of namespaces giving data descriptors the highest priority, followed by instance variables, then non-data descriptors, then class variables, and lastly :meth:`~object.__getattr__` if it is provided." +msgid "" +"Instance lookup scans through a chain of namespaces giving data descriptors " +"the highest priority, followed by instance variables, then non-data " +"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if" +" it is provided." msgstr "" +"جستجوی نمونه، زنجیره‌ای از فضای نامها را پیمایش می‌کند و بیشترین اولویت را به" +" توصیف‌گرهای داده‌ای می‌دهد؛ پس از آن‌ها متغیرهای نمونه، سپس توصیف‌گرهای " +"غیرداده‌ای، سپس متغیرهای کلاس و در نهایت :meth:`~object.__getattr__`، اگر " +"فراهم شده باشد، قرار دارند." -msgid "If a descriptor is found for ``a.x``, then it is invoked with: ``desc.__get__(a, type(a))``." +msgid "" +"If a descriptor is found for ``a.x``, then it is invoked with: " +"``desc.__get__(a, type(a))``." msgstr "" +"اگر توصیف‌گری برای ``a.x`` یافت شود، سپس با ``desc.__get__(a, type(a))`` " +"فراخوانی می‌شود." -msgid "The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here is a pure Python equivalent:" +msgid "" +"The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " +"is a pure Python equivalent:" msgstr "" +"منطق جستجوی نقطه‌دار در :meth:`object.__getattribute__` قرار دارد. در اینجا " +"یک معادل پایتون خالص آمده است:" msgid "" "def find_name_in_mro(cls, name, default):\n" @@ -573,12 +1126,54 @@ msgid "" " return cls_var # class variable\n" " raise AttributeError(name)" msgstr "" +"def find_name_in_mro(cls, name, default):\n" +" \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" +" for base in cls.__mro__:\n" +" if name in vars(base):\n" +" return vars(base)[name]\n" +" return default\n" +"\n" +"def object_getattribute(obj, name):\n" +" \"Emulate PyObject_GenericGetAttr() in Objects/object.c\"\n" +" null = object()\n" +" objtype = type(obj)\n" +" cls_var = find_name_in_mro(objtype, name, null)\n" +" descr_get = getattr(type(cls_var), '__get__', null)\n" +" if descr_get is not null:\n" +" if (hasattr(type(cls_var), '__set__')\n" +" or hasattr(type(cls_var), '__delete__')):\n" +" return descr_get(cls_var, obj, objtype) # data descriptor\n" +" if hasattr(obj, '__dict__') and name in vars(obj):\n" +" return vars(obj)[name] # instance variable\n" +" if descr_get is not null:\n" +" return descr_get(cls_var, obj, objtype) # non-data descriptor\n" +" if cls_var is not null:\n" +" return cls_var # class variable\n" +" raise AttributeError(name)" -msgid "Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object.__getattribute__` code. That is why calling :meth:`~object.__getattribute__` directly or with ``super().__getattribute__`` will bypass :meth:`~object.__getattr__` entirely." +msgid "" +"Note, there is no :meth:`~object.__getattr__` hook in the " +":meth:`~object.__getattribute__` code. That is why calling " +":meth:`~object.__getattribute__` directly or with " +"``super().__getattribute__`` will bypass :meth:`~object.__getattr__` " +"entirely." msgstr "" +"توجه داشته باشید که در کد :meth:`~object.__getattribute__` هیچ قلاب " +":meth:`~object.__getattr__` وجود ندارد. به همین دلیل است که فراخوانی مستقیم " +":meth:`~object.__getattribute__` یا از طریق ``super().__getattribute__``، " +":meth:`~object.__getattr__` را به‌طور کامل دور می‌زند." -msgid "Instead, it is the dot operator and the :func:`getattr` function that are responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object.__getattribute__` raises an :exc:`AttributeError`. Their logic is encapsulated in a helper function:" +msgid "" +"Instead, it is the dot operator and the :func:`getattr` function that are " +"responsible for invoking :meth:`~object.__getattr__` whenever " +":meth:`~object.__getattribute__` raises an :exc:`AttributeError`. Their " +"logic is encapsulated in a helper function:" msgstr "" +"در عوض، این عملگر نقطه و تابع :func:`getattr` هستند که هرگاه " +":meth:`~object.__getattribute__ <~object.__getattr__>` استثنای " +":exc:`AttributeError` را پرتاب کند، مسئول فراخوانی " +":meth:`~object.__getattr__ <~object.__getattribute__>` هستند. منطق آن‌ها در " +"یک تابع کمکی کپسوله شده است:" msgid "" "def getattr_hook(obj, name):\n" @@ -590,78 +1185,182 @@ msgid "" " raise\n" " return type(obj).__getattr__(obj, name) # __getattr__" msgstr "" +"def getattr_hook(obj, name):\n" +" \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" +" try:\n" +" return obj.__getattribute__(name)\n" +" except AttributeError:\n" +" if not hasattr(type(obj), '__getattr__'):\n" +" raise\n" +" return type(obj).__getattr__(obj, name) # __getattr__" msgid "Invocation from a class" -msgstr "" +msgstr "فراخوانی از یک کلاس" -msgid "The logic for a dotted lookup such as ``A.x`` is in :meth:`!type.__getattribute__`. The steps are similar to those for :meth:`!object.__getattribute__` but the instance dictionary lookup is replaced by a search through the class's :term:`method resolution order`." +msgid "" +"The logic for a dotted lookup such as ``A.x`` is in " +":meth:`!type.__getattribute__`. The steps are similar to those for " +":meth:`!object.__getattribute__` but the instance dictionary lookup is " +"replaced by a search through the class's :term:`method resolution order`." msgstr "" +"منطق جستجوی نقطه‌دار مانند ``A.x`` در :meth:`!type.__getattribute__` قرار " +"دارد. این مراحل مشابه مراحل :meth:`!object.__getattribute__` هستند، اما " +"جستجوی دیکشنری نمونه با جستجو در :term:`ترتیب حل متد ` کلاس جایگزین می‌شود." -msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." +msgid "" +"If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" +"اگر یک توصیف‌گر (descriptor) یافت شود، با ``desc.__get__(None, A)`` فراخوانی" +" می‌شود." -msgid "The full C implementation can be found in :c:func:`!type_getattro` and :c:func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." +msgid "" +"The full C implementation can be found in :c:func:`!type_getattro` and " +":c:func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." msgstr "" +"پیاده‌سازی کامل به زبان C را می‌توان در :c:func:`!type_getattro` و " +":c:func:`!_PyType_Lookup` در :source:`Objects/typeobject.c` یافت." msgid "Invocation from super" -msgstr "" +msgstr "فراخوانی از super" -msgid "The logic for super's dotted lookup is in the :meth:`~object.__getattribute__` method for object returned by :func:`super`." +msgid "" +"The logic for super's dotted lookup is in the " +":meth:`~object.__getattribute__` method for object returned by " +":func:`super`." msgstr "" +"منطق جستجوی نقطه‌دار super در متد :meth:`~object.__getattribute__` برای شیء " +"برگردانده‌شده توسط :func:`super` قرار دارد." -msgid "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__.__mro__`` for the base class ``B`` immediately following ``A`` and then returns ``B.__dict__['m'].__get__(obj, A)``. If not a descriptor, ``m`` is returned unchanged." +msgid "" +"A dotted lookup such as ``super(A, obj).m`` searches " +"``obj.__class__.__mro__`` for the base class ``B`` immediately following " +"``A`` and then returns ``B.__dict__['m'].__get__(obj, A)``. If not a " +"descriptor, ``m`` is returned unchanged." msgstr "" +"یک جستجوی نقطه‌ای مانند ``super(A, obj).m`` در ``obj.__class__.__mro__`` به " +"دنبال کلاس پایه ``B`` می‌گردد که بلافاصله پس از ``A`` قرار دارد و سپس " +"``B.__dict__['m'].__get__(obj, A)`` را برمی‌گرداند. اگر توصیف‌گر نباشد، " +"``m`` بدون تغییر برمی‌گردد." -msgid "The full C implementation can be found in :c:func:`!super_getattro` in :source:`Objects/typeobject.c`. A pure Python equivalent can be found in `Guido's Tutorial `_." +msgid "" +"The full C implementation can be found in :c:func:`!super_getattro` in " +":source:`Objects/typeobject.c`. A pure Python equivalent can be found in " +"`Guido's Tutorial " +"`_." msgstr "" +"پیاده‌سازی کامل C را می‌توان در :c:func:`!super_getattro` در " +":source:`Objects/typeobject.c` یافت. یک معادل پایتون خالص را می‌توان در " +"`Guido's Tutorial " +"`_ " +"یافت." msgid "Summary of invocation logic" -msgstr "" +msgstr "خلاصه منطق فراخوانی" -msgid "The mechanism for descriptors is embedded in the :meth:`~object.__getattribute__` methods for :class:`object`, :class:`type`, and :func:`super`." +msgid "" +"The mechanism for descriptors is embedded in the " +":meth:`~object.__getattribute__` methods for :class:`object`, :class:`type`," +" and :func:`super`." msgstr "" +"سازوکار توصیف‌گرها (descriptors) در متدهای :meth:`~object.__getattribute__` " +"برای :class:`object`، :class:`type` و :func:`super` تعبیه شده است." msgid "The important points to remember are:" -msgstr "" +msgstr "نکات مهمی که باید به خاطر داشته باشید:" -msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." +msgid "" +"Descriptors are invoked by the :meth:`~object.__getattribute__` method." msgstr "" +"توصیف‌گرها توسط متد :meth:`~object.__getattribute__` فراخوانی می‌شوند." -msgid "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:`super`." +msgid "" +"Classes inherit this machinery from :class:`object`, :class:`type`, or " +":func:`super`." msgstr "" +"کلاس‌ها این سازوکار را از :class:`object`، :class:`type` یا :func:`super` به" +" ارث می‌برند." -msgid "Overriding :meth:`~object.__getattribute__` prevents automatic descriptor calls because all the descriptor logic is in that method." +msgid "" +"Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " +"calls because all the descriptor logic is in that method." msgstr "" +"بازنویسی :meth:`~object.__getattribute__` از فراخوانی‌های خودکار توصیف‌گر " +"(descriptor) جلوگیری می‌کند، زیرا تمام منطق توصیف‌گر (descriptor) در آن متد " +"قرار دارد." -msgid ":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make different calls to :meth:`~object.__get__`. The first includes the instance and may include the class. The second puts in ``None`` for the instance and always includes the class." +msgid "" +":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " +"different calls to :meth:`~object.__get__`. The first includes the instance" +" and may include the class. The second puts in ``None`` for the instance " +"and always includes the class." msgstr "" +":meth:`!object.__getattribute__` و :meth:`!type.__getattribute__` " +":meth:`~object.__get__` را به‌صورت متفاوتی فراخوانی می‌کنند. فراخوانی اول " +"شامل نمونه است و ممکن است شامل کلاس باشد. فراخوانی دوم برای نمونه ``None`` " +"قرار می‌دهد و همیشه شامل کلاس است." msgid "Data descriptors always override instance dictionaries." -msgstr "" +msgstr "توصیف‌گرهای داده همیشه بر دیکشنری‌های نمونه اولویت دارند." msgid "Non-data descriptors may be overridden by instance dictionaries." -msgstr "" +msgstr "توصیف‌گرهای غیرداده‌ای ممکن است توسط دیکشنری‌های نمونه پوشانده شوند." msgid "Automatic name notification" -msgstr "" +msgstr "اطلاع‌رسانی خودکار نام" -msgid "Sometimes it is desirable for a descriptor to know what class variable name it was assigned to. When a new class is created, the :class:`type` metaclass scans the dictionary of the new class. If any of the entries are descriptors and if they define :meth:`~object.__set_name__`, that method is called with two arguments. The *owner* is the class where the descriptor is used, and the *name* is the class variable the descriptor was assigned to." -msgstr "" +msgid "" +"Sometimes it is desirable for a descriptor to know what class variable name " +"it was assigned to. When a new class is created, the :class:`type` " +"metaclass scans the dictionary of the new class. If any of the entries are " +"descriptors and if they define :meth:`~object.__set_name__`, that method is " +"called with two arguments. The *owner* is the class where the descriptor is" +" used, and the *name* is the class variable the descriptor was assigned to." +msgstr "" +"گاهی مطلوب است که یک توصیف‌گر بداند به نام کدام متغیر کلاس اختصاص داده شده " +"است. هنگامی که یک کلاس جدید ایجاد می‌شود، فراکلاس :class:`type` دیکشنری کلاس" +" جدید را پیمایش می‌کند. اگر هر یک از آیتم‌ها توصیف‌گر باشند و اگر " +":meth:`~object.__set_name__` را تعریف کرده باشند، آن متد با دو آرگومان " +"فراخوانی می‌شود. *owner* کلاسی است که توصیف‌گر در آن استفاده می‌شود، و " +"*name* متغیر کلاس است که توصیف‌گر به آن اختصاص داده شده است." -msgid "The implementation details are in :c:func:`!type_new` and :c:func:`!set_names` in :source:`Objects/typeobject.c`." +msgid "" +"The implementation details are in :c:func:`!type_new` and " +":c:func:`!set_names` in :source:`Objects/typeobject.c`." msgstr "" +"جزئیات پیاده‌سازی در :c:func:`!type_new` و :c:func:`!set_names` در " +":source:`Objects/typeobject.c` قرار دارد." -msgid "Since the update logic is in :meth:`!type.__new__`, notifications only take place at the time of class creation. If descriptors are added to the class afterwards, :meth:`~object.__set_name__` will need to be called manually." +msgid "" +"Since the update logic is in :meth:`!type.__new__`, notifications only take " +"place at the time of class creation. If descriptors are added to the class " +"afterwards, :meth:`~object.__set_name__` will need to be called manually." msgstr "" +"از آن‌جا که منطق به‌روزرسانی در :meth:`!type.__new__` قرار دارد، اعلان‌ها " +"فقط در زمان ایجاد کلاس رخ می‌دهند. اگر توصیف‌گرها بعداً به کلاس اضافه شوند، " +"باید :meth:`~object.__set_name__` به‌صورت دستی فراخوانی شود." msgid "ORM example" -msgstr "" +msgstr "مثال ORM" -msgid "The following code is a simplified skeleton showing how data descriptors could be used to implement an `object relational mapping `_." +msgid "" +"The following code is a simplified skeleton showing how data descriptors " +"could be used to implement an `object relational mapping " +"`_." msgstr "" +"کد زیر اسکلت ساده‌شده‌ای است که نشان می‌دهد چگونه می‌توان از توصیف‌گرهای " +"داده برای پیاده‌سازی یک `نگاشت شیء-رابطه‌ای " +"`_ استفاده " +"کرد." -msgid "The essential idea is that the data is stored in an external database. The Python instances only hold keys to the database's tables. Descriptors take care of lookups or updates:" +msgid "" +"The essential idea is that the data is stored in an external database. The " +"Python instances only hold keys to the database's tables. Descriptors take " +"care of lookups or updates:" msgstr "" +"ایده اصلی این است که داده‌ها در یک پایگاه داده خارجی ذخیره می‌شوند. " +"نمونه‌های پایتون تنها کلیدهای جدول‌های پایگاه داده را نگه می‌دارند. " +"توصیف‌گرها به جست‌وجوها یا به‌روزرسانی‌ها رسیدگی می‌کنند:" msgid "" "class Field:\n" @@ -677,9 +1376,27 @@ msgid "" " conn.execute(self.store, [value, obj.key])\n" " conn.commit()" msgstr "" +"class Field:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.fetch = f'SELECT {name} FROM {owner.table} WHERE {owner.key}=?;'\n" +" self.store = f'UPDATE {owner.table} SET {name}=? WHERE {owner.key}=?;'\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return conn.execute(self.fetch, [obj.key]).fetchone()[0]\n" +"\n" +" def __set__(self, obj, value):\n" +" conn.execute(self.store, [value, obj.key])\n" +" conn.commit()" -msgid "We can use the :class:`!Field` class to define `models `_ that describe the schema for each table in a database:" +msgid "" +"We can use the :class:`!Field` class to define `models " +"`_ that describe the schema " +"for each table in a database:" msgstr "" +"می‌توانیم از کلاس :class:`!Field` برای تعریف `مدل‌ها " +"`_ استفاده کنیم که طرح‌واره هر" +" جدول در یک پایگاه داده را توصیف می‌کنند:" msgid "" "class Movie:\n" @@ -701,17 +1418,41 @@ msgid "" " def __init__(self, key):\n" " self.key = key" msgstr "" +"class Movie:\n" +" table = 'Movies' # Table name\n" +" key = 'title' # Primary key\n" +" director = Field()\n" +" year = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key\n" +"\n" +"class Song:\n" +" table = 'Music'\n" +" key = 'title'\n" +" artist = Field()\n" +" year = Field()\n" +" genre = Field()\n" +"\n" +" def __init__(self, key):\n" +" self.key = key" msgid "To use the models, first connect to the database::" -msgstr "" +msgstr "برای استفاده از مدل‌ها، ابتدا به پایگاه داده متصل شوید::" msgid "" ">>> import sqlite3\n" ">>> conn = sqlite3.connect('entertainment.db')" msgstr "" +">>> import sqlite3\n" +">>> conn = sqlite3.connect('entertainment.db')" -msgid "An interactive session shows how data is retrieved from the database and how it can be updated:" +msgid "" +"An interactive session shows how data is retrieved from the database and how" +" it can be updated:" msgstr "" +"یک نشست تعاملی نشان می‌دهد که چگونه داده‌ها از پایگاه داده بازیابی می‌شوند و" +" چگونه می‌توان آن‌ها را به‌روزرسانی کرد:" msgid "" ">>> Movie('Star Wars').director\n" @@ -727,24 +1468,52 @@ msgid "" ">>> Movie('Star Wars').director\n" "'J.J. Abrams'" msgstr "" +">>> Movie('Star Wars').director\n" +"'George Lucas'\n" +">>> jaws = Movie('Jaws')\n" +">>> f'Released in {jaws.year} by {jaws.director}'\n" +"'Released in 1975 by Steven Spielberg'\n" +"\n" +">>> Song('Country Roads').artist\n" +"'John Denver'\n" +"\n" +">>> Movie('Star Wars').director = 'J.J. Abrams'\n" +">>> Movie('Star Wars').director\n" +"'J.J. Abrams'" msgid "Pure Python Equivalents" -msgstr "" +msgstr "معادل‌های پایتون خالص" -msgid "The descriptor protocol is simple and offers exciting possibilities. Several use cases are so common that they have been prepackaged into built-in tools. Properties, bound methods, static methods, class methods, and \\_\\_slots\\_\\_ are all based on the descriptor protocol." +msgid "" +"The descriptor protocol is simple and offers exciting possibilities. " +"Several use cases are so common that they have been prepackaged into built-" +"in tools. Properties, bound methods, static methods, class methods, and " +"\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" +"پروتکل توصیف‌گر ساده است و امکانات هیجان‌انگیزی را فراهم می‌کند. چندین مورد " +"استفاده آن‌قدر رایج هستند که از پیش در قالب ابزارهای توکار بسته‌بندی " +"شده‌اند. پراپرتی‌ها، متدهای مقید، متدهای ایستا، متدهای کلاس و " +"\\_\\_slots\\_\\_ همگی مبتنی بر پروتکل توصیف‌گر هستند." msgid "Properties" -msgstr "" +msgstr "ویژگی‌ها" -msgid "Calling :func:`property` is a succinct way of building a data descriptor that triggers a function call upon access to an attribute. Its signature is::" +msgid "" +"Calling :func:`property` is a succinct way of building a data descriptor " +"that triggers a function call upon access to an attribute. Its signature " +"is::" msgstr "" +"فراخوانی :func:`property` روشی مختصر برای ساختن یک توصیف‌گر داده (data " +"descriptor) است که هنگام دسترسی به یک ویژگی، باعث فراخوانی یک تابع می‌شود. " +"امضای آن به این صورت است::" msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" -msgstr "" +msgstr "property(fget=None, fset=None, fdel=None, doc=None) -> property" -msgid "The documentation shows a typical use to define a managed attribute ``x``:" +msgid "" +"The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" +"مستندات یک کاربرد معمول برای تعریف یک ویژگی مدیریت‌شده ``x`` را نشان می‌دهد:" msgid "" "class C:\n" @@ -753,9 +1522,20 @@ msgid "" " def delx(self): del self.__x\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" msgstr "" +"class C:\n" +" def getx(self): return self.__x\n" +" def setx(self, value): self.__x = value\n" +" def delx(self): del self.__x\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" -msgid "To see how :func:`property` is implemented in terms of the descriptor protocol, here is a pure Python equivalent that implements most of the core functionality:" +msgid "" +"To see how :func:`property` is implemented in terms of the descriptor " +"protocol, here is a pure Python equivalent that implements most of the core " +"functionality:" msgstr "" +"برای اینکه ببینید :func:`property` چگونه بر اساس پروتکل توصیف‌گر (descriptor" +" protocol) پیاده‌سازی شده است، در اینجا یک معادل پایتون خالص آمده است که " +"بیشتر قابلیت‌های اصلی را پیاده‌سازی می‌کند:" msgid "" "class Property:\n" @@ -798,12 +1578,68 @@ msgid "" " def deleter(self, fdel):\n" " return type(self)(self.fget, self.fset, fdel, self.__doc__)" msgstr "" +"class Property:\n" +" \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" +"\n" +" def __init__(self, fget=None, fset=None, fdel=None, doc=None):\n" +" self.fget = fget\n" +" self.fset = fset\n" +" self.fdel = fdel\n" +" if doc is None and fget is not None:\n" +" doc = fget.__doc__\n" +" self.__doc__ = doc\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.__name__ = name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" if obj is None:\n" +" return self\n" +" if self.fget is None:\n" +" raise AttributeError\n" +" return self.fget(obj)\n" +"\n" +" def __set__(self, obj, value):\n" +" if self.fset is None:\n" +" raise AttributeError\n" +" self.fset(obj, value)\n" +"\n" +" def __delete__(self, obj):\n" +" if self.fdel is None:\n" +" raise AttributeError\n" +" self.fdel(obj)\n" +"\n" +" def getter(self, fget):\n" +" return type(self)(fget, self.fset, self.fdel, self.__doc__)\n" +"\n" +" def setter(self, fset):\n" +" return type(self)(self.fget, fset, self.fdel, self.__doc__)\n" +"\n" +" def deleter(self, fdel):\n" +" return type(self)(self.fget, self.fset, fdel, self.__doc__)" -msgid "The :func:`property` builtin helps whenever a user interface has granted attribute access and then subsequent changes require the intervention of a method." +msgid "" +"The :func:`property` builtin helps whenever a user interface has granted " +"attribute access and then subsequent changes require the intervention of a " +"method." msgstr "" +"تابع توکار :func:`property` هرگاه که یک رابط کاربری دسترسی به ویژگی‌ها را " +"اعطا کرده باشد و سپس تغییرات بعدی نیازمند مداخله‌ی یک متد باشند، به کمک " +"می‌آید." -msgid "For instance, a spreadsheet class may grant access to a cell value through ``Cell('b10').value``. Subsequent improvements to the program require the cell to be recalculated on every access; however, the programmer does not want to affect existing client code accessing the attribute directly. The solution is to wrap access to the value attribute in a property data descriptor:" -msgstr "" +msgid "" +"For instance, a spreadsheet class may grant access to a cell value through " +"``Cell('b10').value``. Subsequent improvements to the program require the " +"cell to be recalculated on every access; however, the programmer does not " +"want to affect existing client code accessing the attribute directly. The " +"solution is to wrap access to the value attribute in a property data " +"descriptor:" +msgstr "" +"برای مثال، یک کلاس صفحه گسترده ممکن است دسترسی به مقدار یک سلول را از طریق " +"``Cell('b10').value`` فراهم کند. بهبودهای بعدی برنامه ایجاب می‌کنند که سلول " +"در هر بار دسترسی دوباره محاسبه شود؛ با این حال، برنامه‌نویس نمی‌خواهد بر کد " +"کلاینت موجود که به‌طور مستقیم به ویژگی دسترسی دارد، تأثیر بگذارد. راه‌حل، " +"قرار دادن دسترسی به ویژگی value در یک توصیف‌گر داده از نوع property است:" msgid "" "class Cell:\n" @@ -815,21 +1651,50 @@ msgid "" " self.recalc()\n" " return self._value" msgstr "" +"class Cell:\n" +" ...\n" +"\n" +" @property\n" +" def value(self):\n" +" \"Recalculate the cell before returning value\"\n" +" self.recalc()\n" +" return self._value" -msgid "Either the built-in :func:`property` or our :func:`!Property` equivalent would work in this example." +msgid "" +"Either the built-in :func:`property` or our :func:`!Property` equivalent " +"would work in this example." msgstr "" +"در این مثال، هم می‌توان از :func:`property` توکار و هم از معادل " +":func:`!Property` خودمان استفاده کرد." msgid "Functions and methods" -msgstr "" +msgstr "توابع و متدها" -msgid "Python's object oriented features are built upon a function based environment. Using non-data descriptors, the two are merged seamlessly." +msgid "" +"Python's object oriented features are built upon a function based " +"environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" +"ویژگی‌های شیء‌گرای پایتون بر پایه‌ی یک محیط مبتنی بر تابع بنا شده‌اند. با " +"استفاده از توصیف‌گرهای غیرداده‌ای (non-data descriptors)، این دو به‌صورت " +"یکپارچه در هم ادغام می‌شوند." -msgid "Functions stored in class dictionaries get turned into methods when invoked. Methods only differ from regular functions in that the object instance is prepended to the other arguments. By convention, the instance is called *self* but could be called *this* or any other variable name." +msgid "" +"Functions stored in class dictionaries get turned into methods when invoked." +" Methods only differ from regular functions in that the object instance is " +"prepended to the other arguments. By convention, the instance is called " +"*self* but could be called *this* or any other variable name." msgstr "" +"توابع ذخیره‌شده در دیکشنری‌های کلاس، هنگام فراخوانی به متد تبدیل می‌شوند. " +"متدها تنها در این با توابع معمولی تفاوت دارند که نمونه شیء به ابتدای " +"آرگومان‌های دیگر افزوده می‌شود. طبق قرارداد، نمونه *self* نامیده می‌شود، اما" +" می‌تواند *this* یا هر نام متغیر دیگری باشد." -msgid "Methods can be created manually with :class:`types.MethodType` which is roughly equivalent to:" +msgid "" +"Methods can be created manually with :class:`types.MethodType` which is " +"roughly equivalent to:" msgstr "" +"متدها را می‌توان به‌صورت دستی با :class:`types.MethodType` ایجاد کرد، که " +"تقریباً معادل است با:" msgid "" "class MethodType:\n" @@ -858,9 +1723,42 @@ msgid "" " \"Emulate method_descr_get() in Objects/classobject.c\"\n" " return self" msgstr "" +"class MethodType:\n" +" \"Emulate PyMethod_Type in Objects/classobject.c\"\n" +"\n" +" def __init__(self, func, obj):\n" +" self.__func__ = func\n" +" self.__self__ = obj\n" +"\n" +" def __call__(self, *args, **kwargs):\n" +" func = self.__func__\n" +" obj = self.__self__\n" +" return func(obj, *args, **kwargs)\n" +"\n" +" def __getattribute__(self, name):\n" +" \"Emulate method_getset() in Objects/classobject.c\"\n" +" if name == '__doc__':\n" +" return self.__func__.__doc__\n" +" return object.__getattribute__(self, name)\n" +"\n" +" def __getattr__(self, name):\n" +" \"Emulate method_getattro() in Objects/classobject.c\"\n" +" return getattr(self.__func__, name)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Emulate method_descr_get() in Objects/classobject.c\"\n" +" return self" -msgid "To support automatic creation of methods, functions include the :meth:`~object.__get__` method for binding methods during attribute access. This means that functions are non-data descriptors that return bound methods during dotted lookup from an instance. Here's how it works:" +msgid "" +"To support automatic creation of methods, functions include the " +":meth:`~object.__get__` method for binding methods during attribute access." +" This means that functions are non-data descriptors that return bound " +"methods during dotted lookup from an instance. Here's how it works:" msgstr "" +"برای پشتیبانی از ایجاد خودکار متدها، توابع شامل متد :meth:`~object.__get__`" +" برای اتصال متدها در حین دسترسی به ویژگی هستند. این بدان معناست که توابع، " +"توصیف‌گرهای غیرداده‌ای هستند که متدهای متصل را در حین جستجوی نقطه‌ای از یک" +" نمونه بازمی‌گردانند. نحوه‌ی کار به این صورت است:" msgid "" "class Function:\n" @@ -872,9 +1770,21 @@ msgid "" " return self\n" " return MethodType(self, obj)" msgstr "" +"class Function:\n" +" ...\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Simulate func_descr_get() in Objects/funcobject.c\"\n" +" if obj is None:\n" +" return self\n" +" return MethodType(self, obj)" -msgid "Running the following class in the interpreter shows how the function descriptor works in practice:" +msgid "" +"Running the following class in the interpreter shows how the function " +"descriptor works in practice:" msgstr "" +"اجرای کلاس زیر در مفسر نشان می‌دهد که توصیف‌گر تابع (function descriptor) در" +" عمل چگونه کار می‌کند:" msgid "" "class D:\n" @@ -884,42 +1794,80 @@ msgid "" "class D2:\n" " pass" msgstr "" +"class D:\n" +" def f(self):\n" +" return self\n" +"\n" +"class D2:\n" +" pass" -msgid "The function has a :term:`qualified name` attribute to support introspection:" +msgid "" +"The function has a :term:`qualified name` attribute to support " +"introspection:" msgstr "" +"این تابع دارای ویژگی :term:`qualified name` برای پشتیبانی از درون‌نگری " +"(introspection) است:" msgid "" ">>> D.f.__qualname__\n" "'D.f'" msgstr "" +">>> D.f.__qualname__\n" +"'D.f'" -msgid "Accessing the function through the class dictionary does not invoke :meth:`~object.__get__`. Instead, it just returns the underlying function object::" +msgid "" +"Accessing the function through the class dictionary does not invoke " +":meth:`~object.__get__`. Instead, it just returns the underlying function " +"object::" msgstr "" +"دسترسی به تابع از طریق دیکشنری کلاس، :meth:`~object.__get__` را فراخوانی " +"نمی‌کند. در عوض، فقط شیء تابع زیرین را برمی‌گرداند::" msgid "" ">>> D.__dict__['f']\n" "" msgstr "" +">>> D.__dict__['f']\n" +"" -msgid "Dotted access from a class calls :meth:`~object.__get__` which just returns the underlying function unchanged::" +msgid "" +"Dotted access from a class calls :meth:`~object.__get__` which just returns " +"the underlying function unchanged::" msgstr "" +"دسترسی نقطه‌ای از یک کلاس، :meth:`~object.__get__` را فراخوانی می‌کند که " +"صرفاً تابع زیربنایی را بدون تغییر برمی‌گرداند::" msgid "" ">>> D.f\n" "" msgstr "" +">>> D.f\n" +"" -msgid "The interesting behavior occurs during dotted access from an instance. The dotted lookup calls :meth:`~object.__get__` which returns a bound method object::" +msgid "" +"The interesting behavior occurs during dotted access from an instance. The " +"dotted lookup calls :meth:`~object.__get__` which returns a bound method " +"object::" msgstr "" +"رفتار جالب‌توجه در حین دسترسی نقطه‌ای از یک نمونه رخ می‌دهد. جست‌وجوی " +"نقطه‌ای، :meth:`~object.__get__` را فراخوانی می‌کند که یک شیء متد مقید را " +"برمی‌گرداند::" msgid "" ">>> d = D()\n" ">>> d.f\n" ">" -msgstr "" +msgstr "" +">>> d = D()\n" +">>> d.f\n" +">" -msgid "Internally, the bound method stores the underlying function and the bound instance::" +msgid "" +"Internally, the bound method stores the underlying function and the bound " +"instance::" msgstr "" +"به‌صورت داخلی، متد مقید (bound method) تابع زیربنایی و نمونه‌ی مقید را ذخیره" +" می‌کند::" msgid "" ">>> d.f.__func__\n" @@ -928,66 +1876,122 @@ msgid "" ">>> d.f.__self__\n" "<__main__.D object at 0x00B18C90>" msgstr "" +">>> d.f.__func__\n" +"\n" +"\n" +">>> d.f.__self__\n" +"<__main__.D object at 0x00B18C90>" -msgid "If you have ever wondered where *self* comes from in regular methods or where *cls* comes from in class methods, this is it!" +msgid "" +"If you have ever wondered where *self* comes from in regular methods or " +"where *cls* comes from in class methods, this is it!" msgstr "" +"اگر تاکنون از خود پرسیده‌اید که *self* در متدهای معمولی یا *cls* در متدهای " +"کلاس از کجا می‌آید، همین‌جا همان جاست!" msgid "Kinds of methods" -msgstr "" +msgstr "انواع متدها" -msgid "Non-data descriptors provide a simple mechanism for variations on the usual patterns of binding functions into methods." +msgid "" +"Non-data descriptors provide a simple mechanism for variations on the usual " +"patterns of binding functions into methods." msgstr "" +"توصیف‌گرهای غیرداده‌ای سازوکاری ساده برای حالت‌های مختلف الگوهای معمول اتصال" +" توابع به متدها فراهم می‌کنند." -msgid "To recap, functions have a :meth:`~object.__get__` method so that they can be converted to a method when accessed as attributes. The non-data descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``cls.f(*args)`` becomes ``f(*args)``." +msgid "" +"To recap, functions have a :meth:`~object.__get__` method so that they can " +"be converted to a method when accessed as attributes. The non-data " +"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " +"Calling ``cls.f(*args)`` becomes ``f(*args)``." msgstr "" +"برای جمع‌بندی، توابع یک متد :meth:`~object.__get__` دارند تا بتوانند هنگام " +"دسترسی به‌عنوان ویژگی، به یک متد تبدیل شوند. توصیف‌گر غیرداده‌ای یک فراخوانی" +" ``obj.f(*args)`` را به ``f(obj, *args)`` تبدیل می‌کند. فراخوانی " +"``cls.f(*args)`` به ``f(*args)`` تبدیل می‌شود." msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" +"این نمودار اتصال (binding) و دو مورد از مفیدترین گونه‌های آن را خلاصه " +"می‌کند:" msgid "Transformation" -msgstr "" +msgstr "تبدیل" msgid "Called from an object" -msgstr "" +msgstr "فراخوانی‌شده از یک شیء" msgid "Called from a class" -msgstr "" +msgstr "فراخوانی‌شده از یک کلاس" msgid "function" -msgstr "" +msgstr "تابع" msgid "f(obj, \\*args)" -msgstr "" +msgstr "f(obj, \\*args)" msgid "f(\\*args)" -msgstr "" +msgstr "f(\\*args)" msgid "staticmethod" -msgstr "" +msgstr "staticmethod" msgid "classmethod" -msgstr "" +msgstr "classmethod" msgid "f(type(obj), \\*args)" -msgstr "" +msgstr "f(type(obj), \\*args)" msgid "f(cls, \\*args)" -msgstr "" +msgstr "f(cls, \\*args)" msgid "Static methods" -msgstr "" +msgstr "متدهای ایستا" -msgid "Static methods return the underlying function without changes. Calling either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object.__getattribute__(c, \"f\")`` or ``object.__getattribute__(C, \"f\")``. As a result, the function becomes identically accessible from either an object or a class." +msgid "" +"Static methods return the underlying function without changes. Calling " +"either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into " +"``object.__getattribute__(c, \"f\")`` or ``object.__getattribute__(C, " +"\"f\")``. As a result, the function becomes identically accessible from " +"either an object or a class." msgstr "" +"متدهای ایستا تابع زیربنایی را بدون تغییر برمی‌گردانند. فراخوانی هر یک از " +"``c.f`` یا ``C.f`` معادل جستجوی مستقیم در ``object.__getattribute__(c, " +"\"f\")`` یا ``object.__getattribute__(C, \"f\")`` است. در نتیجه، تابع به‌طور" +" یکسان از یک شیء یا یک کلاس قابل دسترسی می‌شود." -msgid "Good candidates for static methods are methods that do not reference the ``self`` variable." +msgid "" +"Good candidates for static methods are methods that do not reference the " +"``self`` variable." msgstr "" +"گزینه‌های مناسب برای متدهای ایستا، متدهایی هستند که به متغیر ``self`` ارجاع " +"نمی‌دهند." -msgid "For instance, a statistics package may include a container class for experimental data. The class provides normal methods for computing the average, mean, median, and other descriptive statistics that depend on the data. However, there may be useful functions which are conceptually related but do not depend on the data. For instance, ``erf(x)`` is handy conversion routine that comes up in statistical work but does not directly depend on a particular dataset. It can be called either from an object or the class: ``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." -msgstr "" +msgid "" +"For instance, a statistics package may include a container class for " +"experimental data. The class provides normal methods for computing the " +"average, mean, median, and other descriptive statistics that depend on the " +"data. However, there may be useful functions which are conceptually related " +"but do not depend on the data. For instance, ``erf(x)`` is handy conversion" +" routine that comes up in statistical work but does not directly depend on a" +" particular dataset. It can be called either from an object or the class: " +"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." +msgstr "" +"برای مثال، یک بسته‌ی آمار ممکن است شامل یک کلاس ظرف برای داده‌های آزمایشی " +"باشد. این کلاس متدهای معمولی را برای محاسبه‌ی معدل، میانگین، میانه و سایر " +"آمارهای توصیفی فراهم می‌کند که به داده‌ها وابسته‌اند. با این حال، ممکن است " +"توابع مفیدی وجود داشته باشند که از نظر مفهومی مرتبط‌اند اما به داده‌ها " +"وابسته نیستند. برای مثال، ``erf(x)`` یک روال تبدیل کاربردی است که در کارهای" +" آماری پیش می‌آید، اما مستقیماً به یک مجموعه‌داده‌ی خاص وابسته نیست. می‌توان" +" آن را از یک شیء یا از کلاس فراخوانی کرد: ``s.erf(1.5) --> 0.9332`` یا " +"``Sample.erf(1.5) --> 0.9332``." -msgid "Since static methods return the underlying function with no changes, the example calls are unexciting:" +msgid "" +"Since static methods return the underlying function with no changes, the " +"example calls are unexciting:" msgstr "" +"از آن‌جا که متدهای ایستا تابع زیربنایی را بدون هیچ تغییری برمی‌گردانند، " +"فراخوانی‌های مثال چندان جالب نیستند:" msgid "" "class E:\n" @@ -995,6 +1999,10 @@ msgid "" " def f(x):\n" " return x * 10" msgstr "" +"class E:\n" +" @staticmethod\n" +" def f(x):\n" +" return x * 10" msgid "" ">>> E.f(3)\n" @@ -1002,9 +2010,17 @@ msgid "" ">>> E().f(3)\n" "30" msgstr "" +">>> E.f(3)\n" +"30\n" +">>> E().f(3)\n" +"30" -msgid "Using the non-data descriptor protocol, a pure Python version of :deco:`staticmethod` would look like this:" +msgid "" +"Using the non-data descriptor protocol, a pure Python version of " +":deco:`staticmethod` would look like this:" msgstr "" +"با استفاده از پروتکل توصیف‌گر غیرداده‌ای (non-data descriptor protocol)، " +"نسخه‌ی پایتون خالصِ :deco:`staticmethod` به این شکل خواهد بود:" msgid "" "import functools\n" @@ -1026,15 +2042,48 @@ msgid "" " def __annotations__(self):\n" " return self.f.__annotations__" msgstr "" +"import functools\n" +"\n" +"class StaticMethod:\n" +" \"Emulate PyStaticMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return self.f\n" +"\n" +" def __call__(self, *args, **kwds):\n" +" return self.f(*args, **kwds)\n" +"\n" +" @property\n" +" def __annotations__(self):\n" +" return self.f.__annotations__" -msgid "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute that refers to the underlying function. Also it carries forward the attributes necessary to make the wrapper look like the wrapped function, including :attr:`~function.__name__`, :attr:`~function.__qualname__`, and :attr:`~function.__doc__`." +msgid "" +"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " +"that refers to the underlying function. Also it carries forward the " +"attributes necessary to make the wrapper look like the wrapped function, " +"including :attr:`~function.__name__`, :attr:`~function.__qualname__`, and " +":attr:`~function.__doc__`." msgstr "" +"فراخوان :func:`functools.update_wrapper` یک ویژگی ``__wrapped__`` می‌افزاید " +"که به تابع زیرین ارجاع دارد. همچنین ویژگی‌های لازم را منتقل می‌کند تا تابع " +"پوششی شبیه تابع پوشیده‌شده به نظر برسد، از جمله :attr:`~function.__name__`، " +":attr:`~function.__qualname__` و :attr:`~function.__doc__`." msgid "Class methods" -msgstr "" +msgstr "متدهای کلاس" -msgid "Unlike static methods, class methods prepend the class reference to the argument list before calling the function. This format is the same for whether the caller is an object or a class:" +msgid "" +"Unlike static methods, class methods prepend the class reference to the " +"argument list before calling the function. This format is the same for " +"whether the caller is an object or a class:" msgstr "" +"برخلاف متدهای ایستا، متدهای کلاس پیش از فراخوانی تابع، ارجاع کلاس را به " +"ابتدای فهرست آرگومان‌ها اضافه می‌کنند. این قالب چه فراخواننده یک شیء باشد و " +"چه یک کلاس، یکسان است:" msgid "" "class F:\n" @@ -1042,6 +2091,10 @@ msgid "" " def f(cls, x):\n" " return cls.__name__, x" msgstr "" +"class F:\n" +" @classmethod\n" +" def f(cls, x):\n" +" return cls.__name__, x" msgid "" ">>> F.f(3)\n" @@ -1049,9 +2102,23 @@ msgid "" ">>> F().f(3)\n" "('F', 3)" msgstr "" +">>> F.f(3)\n" +"('F', 3)\n" +">>> F().f(3)\n" +"('F', 3)" -msgid "This behavior is useful whenever the method only needs to have a class reference and does not rely on data stored in a specific instance. One use for class methods is to create alternate class constructors. For example, the classmethod :func:`dict.fromkeys` creates a new dictionary from a list of keys. The pure Python equivalent is:" -msgstr "" +msgid "" +"This behavior is useful whenever the method only needs to have a class " +"reference and does not rely on data stored in a specific instance. One use " +"for class methods is to create alternate class constructors. For example, " +"the classmethod :func:`dict.fromkeys` creates a new dictionary from a list " +"of keys. The pure Python equivalent is:" +msgstr "" +"این رفتار هر زمان که متد فقط به یک ارجاع به کلاس نیاز داشته باشد و به " +"داده‌های ذخیره‌شده در یک نمونه‌ی خاص متکی نباشد، مفید است. یکی از کاربردهای " +"متدهای کلاس، ایجاد سازنده‌های جایگزین برای کلاس است. برای مثال، متد کلاس " +":func:`dict.fromkeys` یک دیکشنری جدید از فهرستی از کلیدها ایجاد می‌کند. " +"معادل پایتون خالص آن به صورت زیر است:" msgid "" "class Dict(dict):\n" @@ -1063,9 +2130,17 @@ msgid "" " d[key] = value\n" " return d" msgstr "" +"class Dict(dict):\n" +" @classmethod\n" +" def fromkeys(cls, iterable, value=None):\n" +" \"Emulate dict_fromkeys() in Objects/dictobject.c\"\n" +" d = cls()\n" +" for key in iterable:\n" +" d[key] = value\n" +" return d" msgid "Now a new dictionary of unique keys can be constructed like this:" -msgstr "" +msgstr "اکنون می‌توان یک دیکشنری جدید با کلیدهای یکتا را به این صورت ساخت:" msgid "" ">>> d = Dict.fromkeys('abracadabra')\n" @@ -1074,9 +2149,18 @@ msgid "" ">>> d\n" "{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" msgstr "" +">>> d = Dict.fromkeys('abracadabra')\n" +">>> type(d) is Dict\n" +"True\n" +">>> d\n" +"{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" -msgid "Using the non-data descriptor protocol, a pure Python version of :deco:`classmethod` would look like this:" +msgid "" +"Using the non-data descriptor protocol, a pure Python version of " +":deco:`classmethod` would look like this:" msgstr "" +"با استفاده از پروتکل توصیف‌گر غیرداده‌ای (non-data descriptor protocol)، یک " +"نسخه‌ی پایتون خالص از :deco:`classmethod` به این شکل خواهد بود:" msgid "" "import functools\n" @@ -1093,23 +2177,59 @@ msgid "" " cls = type(obj)\n" " return MethodType(self.f, cls)" msgstr "" +"import functools\n" +"\n" +"class ClassMethod:\n" +" \"Emulate PyClassMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, cls=None):\n" +" if cls is None:\n" +" cls = type(obj)\n" +" return MethodType(self.f, cls)" -msgid "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a ``__wrapped__`` attribute that refers to the underlying function. Also it carries forward the attributes necessary to make the wrapper look like the wrapped function: :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__`, and :attr:`~function.__annotations__`." -msgstr "" +msgid "" +"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " +"``__wrapped__`` attribute that refers to the underlying function. Also it " +"carries forward the attributes necessary to make the wrapper look like the " +"wrapped function: :attr:`~function.__name__`, " +":attr:`~function.__qualname__`, :attr:`~function.__doc__`, and " +":attr:`~function.__annotations__`." +msgstr "" +"فراخوان :func:`functools.update_wrapper` در ``ClassMethod`` ویژگی " +"``__wrapped__`` را می‌افزاید که به تابع زیربنایی ارجاع می‌دهد. همچنین این " +"فراخوان ویژگی‌های لازم را منتقل می‌کند تا دربرگیرنده شبیه به تابع پوشیده‌شده" +" به نظر برسد: :attr:`~function.__name__`، :attr:`~function.__qualname__`، " +":attr:`~function.__doc__` و :attr:`~function.__annotations__`." msgid "Member objects and __slots__" -msgstr "" +msgstr "اشیای عضو و __slots__" -msgid "When a class defines ``__slots__``, it replaces instance dictionaries with a fixed-length array of slot values. From a user point of view that has several effects:" +msgid "" +"When a class defines ``__slots__``, it replaces instance dictionaries with a" +" fixed-length array of slot values. From a user point of view that has " +"several effects:" msgstr "" +"هنگامی که یک کلاس ``__slots__`` را تعریف می‌کند، دیکشنری‌های نمونه را با " +"آرایه‌ای با طول ثابت از مقادیر جایگاه (slot) جایگزین می‌کند. از دیدگاه کاربر،" +" این موضوع چندین اثر دارد:" -msgid "1. Provides immediate detection of bugs due to misspelled attribute assignments. Only attribute names specified in ``__slots__`` are allowed:" +msgid "" +"1. Provides immediate detection of bugs due to misspelled attribute " +"assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" +"۱. امکان تشخیص فوری اشکال‌های ناشی از اشتباه املایی در انتساب ویژگی‌ها را " +"فراهم می‌کند. فقط نام ویژگی‌های مشخص‌شده در ``__slots__`` مجاز است:" msgid "" "class Vehicle:\n" " __slots__ = ('id_number', 'make', 'model')" msgstr "" +"class Vehicle:\n" +" __slots__ = ('id_number', 'make', 'model')" msgid "" ">>> auto = Vehicle()\n" @@ -1118,9 +2238,19 @@ msgid "" " ...\n" "AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" msgstr "" +">>> auto = Vehicle()\n" +">>> auto.id_nubmer = 'VYE483814LQEX'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" -msgid "2. Helps create immutable objects where descriptors manage access to private attributes stored in ``__slots__``:" +msgid "" +"2. Helps create immutable objects where descriptors manage access to private" +" attributes stored in ``__slots__``:" msgstr "" +"۲. به ایجاد اشیای تغییرناپذیری کمک می‌کند که در آن‌ها توصیف‌گرها " +"(descriptors) دسترسی به ویژگی‌های خصوصی ذخیره‌شده در ``__slots__`` را مدیریت" +" می‌کنند:" msgid "" "class Immutable:\n" @@ -1139,6 +2269,21 @@ msgid "" " def name(self): # Read-only descriptor\n" " return self._name" msgstr "" +"class Immutable:\n" +"\n" +" __slots__ = ('_dept', '_name') # Replace the instance dictionary\n" +"\n" +" def __init__(self, dept, name):\n" +" self._dept = dept # Store to private attribute\n" +" self._name = name # Store to private attribute\n" +"\n" +" @property # Read-only descriptor\n" +" def dept(self):\n" +" return self._dept\n" +"\n" +" @property\n" +" def name(self): # Read-only descriptor\n" +" return self._name" msgid "" ">>> mark = Immutable('Botany', 'Mark Watney')\n" @@ -1153,15 +2298,44 @@ msgid "" " ...\n" "AttributeError: 'Immutable' object has no attribute 'location'" msgstr "" +">>> mark = Immutable('Botany', 'Mark Watney')\n" +">>> mark.dept\n" +"'Botany'\n" +">>> mark.dept = 'Space Pirate'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: property 'dept' of 'Immutable' object has no setter\n" +">>> mark.location = 'Mars'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Immutable' object has no attribute 'location'" -msgid "3. Saves memory. On a 64-bit Linux build, an instance with two attributes takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight design pattern `_ likely only matters when a large number of instances are going to be created." +msgid "" +"3. Saves memory. On a 64-bit Linux build, an instance with two attributes " +"takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " +"design pattern `_ likely " +"only matters when a large number of instances are going to be created." msgstr "" +"۳. در حافظه صرفه‌جویی می‌کند. در یک ساخت لینوکس ۶۴ بیتی، یک نمونه با دو " +"ویژگی، با ``__slots__`` برابر ۴۸ بایت و بدون آن ۱۵۲ بایت فضا اشغال می‌کند. " +"این `الگوی طراحی فلایت‌ویت (flyweight design pattern) " +"`_ احتمالاً تنها زمانی " +"اهمیت دارد که قرار باشد تعداد زیادی نمونه ایجاد شوند." -msgid "4. Improves speed. Reading instance variables is 35% faster with ``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." +msgid "" +"4. Improves speed. Reading instance variables is 35% faster with " +"``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" +"۴. سرعت را بهبود می‌بخشد. خواندن متغیرهای نمونه با ``__slots__`` ۳۵٪ سریع‌تر" +" است (همان‌طور که با پایتون 3.10 روی پردازنده‌ی Apple M1 اندازه‌گیری شده " +"است)." -msgid "5. Blocks tools like :deco:`functools.cached_property` which require an instance dictionary to function correctly:" +msgid "" +"5. Blocks tools like :deco:`functools.cached_property` which require an " +"instance dictionary to function correctly:" msgstr "" +"۵. ابزارهایی مانند :deco:`functools.cached_property` را که برای عملکرد صحیح " +"به یک دیکشنری نمونه نیاز دارند، مسدود می‌کند:" msgid "" "from functools import cached_property\n" @@ -1174,6 +2348,15 @@ msgid "" " return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" " for n in reversed(range(100_000)))" msgstr "" +"from functools import cached_property\n" +"\n" +"class CP:\n" +" __slots__ = () # دیکشنری نمونه را حذف می‌کند\n" +"\n" +" @cached_property # به یک دیکشنری نمونه نیاز دارد\n" +" def pi(self):\n" +" return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" +" for n in reversed(range(100_000)))" msgid "" ">>> CP().pi\n" @@ -1181,9 +2364,25 @@ msgid "" " ...\n" "TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." msgstr "" +">>> CP().pi\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." -msgid "It is not possible to create an exact drop-in pure Python version of ``__slots__`` because it requires direct access to C structures and control over object memory allocation. However, we can build a mostly faithful simulation where the actual C structure for slots is emulated by a private ``_slotvalues`` list. Reads and writes to that private structure are managed by member descriptors:" -msgstr "" +msgid "" +"It is not possible to create an exact drop-in pure Python version of " +"``__slots__`` because it requires direct access to C structures and control " +"over object memory allocation. However, we can build a mostly faithful " +"simulation where the actual C structure for slots is emulated by a private " +"``_slotvalues`` list. Reads and writes to that private structure are " +"managed by member descriptors:" +msgstr "" +"ایجاد یک نسخه‌ی پایتون خالصِ دقیق و کاملاً جایگزین (drop-in) از " +"``__slots__`` ممکن نیست، زیرا به دسترسی مستقیم به ساختارهای C و کنترل بر " +"تخصیص حافظه‌ی شیء نیاز دارد. با این حال، می‌توانیم یک شبیه‌سازی تا حد زیادی " +"وفادار بسازیم که در آن ساختار C واقعی جایگاه‌ها با یک فهرست خصوصی " +"``_slotvalues`` شبیه‌سازی می‌شود. عملیات خواندن و نوشتن روی آن ساختار خصوصی " +"توسط توصیف‌گرهای عضو مدیریت می‌شود:" msgid "" "null = object()\n" @@ -1222,9 +2421,48 @@ msgid "" " 'Emulate member_repr() in Objects/descrobject.c'\n" " return f''" msgstr "" +"null = object()\n" +"\n" +"class Member:\n" +"\n" +" def __init__(self, name, clsname, offset):\n" +" 'Emulate PyMemberDef in Include/descrobject.h'\n" +" # Also see descr_new() in Objects/descrobject.c\n" +" self.name = name\n" +" self.clsname = clsname\n" +" self.offset = offset\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" 'Emulate member_get() in Objects/descrobject.c'\n" +" # Also see PyMember_GetOne() in Python/structmember.c\n" +" if obj is None:\n" +" return self\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" 'Emulate member_set() in Objects/descrobject.c'\n" +" obj._slotvalues[self.offset] = value\n" +"\n" +" def __delete__(self, obj):\n" +" 'Emulate member_delete() in Objects/descrobject.c'\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" obj._slotvalues[self.offset] = null\n" +"\n" +" def __repr__(self):\n" +" 'Emulate member_repr() in Objects/descrobject.c'\n" +" return f''" -msgid "The :meth:`!type.__new__` method takes care of adding member objects to class variables:" +msgid "" +"The :meth:`!type.__new__` method takes care of adding member objects to " +"class variables:" msgstr "" +"متد :meth:`!type.__new__` افزودن اشیای عضو به متغیرهای کلاس را بر عهده " +"دارد:" msgid "" "class Type(type):\n" @@ -1238,9 +2476,25 @@ msgid "" " mapping[name] = Member(name, clsname, offset)\n" " return type.__new__(mcls, clsname, bases, mapping, **kwargs)" msgstr "" +"class Type(type):\n" +" 'Simulate how the type metaclass adds member objects for slots'\n" +"\n" +" def __new__(mcls, clsname, bases, mapping, **kwargs):\n" +" 'Emulate type_new() in Objects/typeobject.c'\n" +" # type_new() calls PyTypeReady() which calls add_methods()\n" +" slot_names = mapping.get('slot_names', [])\n" +" for offset, name in enumerate(slot_names):\n" +" mapping[name] = Member(name, clsname, offset)\n" +" return type.__new__(mcls, clsname, bases, mapping, **kwargs)" -msgid "The :meth:`object.__new__` method takes care of creating instances that have slots instead of an instance dictionary. Here is a rough simulation in pure Python:" +msgid "" +"The :meth:`object.__new__` method takes care of creating instances that have" +" slots instead of an instance dictionary. Here is a rough simulation in " +"pure Python:" msgstr "" +"متد :meth:`object.__new__` مسئول ایجاد نمونه‌هایی است که به‌جای دیکشنری " +"نمونه، جایگاه‌ها (slots) دارند. در اینجا یک شبیه‌سازی تقریبی در پایتون خالص " +"آمده است:" msgid "" "class Object:\n" @@ -1272,9 +2526,40 @@ msgid "" " )\n" " super().__delattr__(name)" msgstr "" +"class Object:\n" +" 'Simulate how object.__new__() allocates memory for __slots__'\n" +"\n" +" def __new__(cls, *args, **kwargs):\n" +" 'Emulate object_new() in Objects/typeobject.c'\n" +" inst = super().__new__(cls)\n" +" if hasattr(cls, 'slot_names'):\n" +" empty_slots = [null] * len(cls.slot_names)\n" +" object.__setattr__(inst, '_slotvalues', empty_slots)\n" +" return inst\n" +"\n" +" def __setattr__(self, name, value):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__setattr__(name, value)\n" +"\n" +" def __delattr__(self, name):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__delattr__(name)" -msgid "To use the simulation in a real class, just inherit from :class:`!Object` and set the :term:`metaclass` to :class:`Type`:" +msgid "" +"To use the simulation in a real class, just inherit from :class:`!Object` " +"and set the :term:`metaclass` to :class:`Type`:" msgstr "" +"برای استفاده از شبیه‌سازی در یک کلاس واقعی، کافی است از :class:`!Object` ارث‌بری کنید و :term:`فراکلاس ` را روی :class:`Type` تنظیم کنید:" msgid "" "class H(Object, metaclass=Type):\n" @@ -1286,9 +2571,18 @@ msgid "" " self.x = x\n" " self.y = y" msgstr "" +"class H(Object, metaclass=Type):\n" +" 'Instance variables stored in slots'\n" +"\n" +" slot_names = ['x', 'y']\n" +"\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y" -msgid "At this point, the metaclass has loaded member objects for *x* and *y*::" -msgstr "" +msgid "" +"At this point, the metaclass has loaded member objects for *x* and *y*::" +msgstr "در این نقطه، فراکلاس اشیای عضو برای *x* و *y* را بارگذاری کرده است::" msgid "" ">>> from pprint import pp\n" @@ -1300,9 +2594,21 @@ msgid "" " 'x': ,\n" " 'y': }" msgstr "" +">>> from pprint import pp\n" +">>> pp(dict(vars(H)))\n" +"{'__module__': '__main__',\n" +" '__doc__': 'Instance variables stored in slots',\n" +" 'slot_names': ['x', 'y'],\n" +" '__init__': ,\n" +" 'x': ,\n" +" 'y': }" -msgid "When instances are created, they have a ``slot_values`` list where the attributes are stored:" +msgid "" +"When instances are created, they have a ``slot_values`` list where the " +"attributes are stored:" msgstr "" +"هنگامی که نمونه‌ها ایجاد می‌شوند، آن‌ها یک فهرست ``slot_values`` دارند که " +"ویژگی‌ها در آن ذخیره می‌شوند:" msgid "" ">>> h = H(10, 20)\n" @@ -1312,9 +2618,17 @@ msgid "" ">>> vars(h)\n" "{'_slotvalues': [55, 20]}" msgstr "" +">>> h = H(10, 20)\n" +">>> vars(h)\n" +"{'_slotvalues': [10, 20]}\n" +">>> h.x = 55\n" +">>> vars(h)\n" +"{'_slotvalues': [55, 20]}" msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" +"ویژگی‌هایی که به‌اشتباه نوشته شده یا تخصیص داده نشده باشند، یک استثنا پرتاب " +"خواهند کرد:" msgid "" ">>> h.xz\n" @@ -1322,3 +2636,7 @@ msgid "" " ...\n" "AttributeError: 'H' object has no attribute 'xz'" msgstr "" +">>> h.xz\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'H' object has no attribute 'xz'" diff --git a/howto/enum.po b/howto/enum.po index 9d5d1f866..89871f1b8 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -25,13 +25,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Enum HOWTO" -msgstr "" +msgstr "راهنمای عملی Enum" -msgid "An :class:`Enum` is a set of symbolic names bound to unique values. They are similar to global variables, but they offer a more useful :func:`repr`, grouping, type-safety, and a few other features." +msgid "" +"An :class:`Enum` is a set of symbolic names bound to unique values. They " +"are similar to global variables, but they offer a more useful :func:`repr`, " +"grouping, type-safety, and a few other features." msgstr "" +"یک :class:`Enum` مجموعه‌ای از نام‌های نمادین است که به مقادیر یکتا متصل " +"شده‌اند. آن‌ها شبیه متغیرهای سراسری هستند، اما :func:`repr` مفیدتری، " +"گروه‌بندی، ایمنی نوع و چند قابلیت دیگر ارائه می‌دهند." -msgid "They are most useful when you have a variable that can take one of a limited selection of values. For example, the days of the week::" +msgid "" +"They are most useful when you have a variable that can take one of a limited" +" selection of values. For example, the days of the week::" msgstr "" +"آن‌ها زمانی بیشترین کاربرد را دارند که متغیری دارید که می‌تواند یکی از " +"مقادیر یک مجموعه محدود را بگیرد. برای مثال، روزهای هفته::" msgid "" ">>> from enum import Enum\n" @@ -44,9 +54,18 @@ msgid "" "... SATURDAY = 6\n" "... SUNDAY = 7" msgstr "" +">>> from enum import Enum\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7" msgid "Or perhaps the RGB primary colors::" -msgstr "" +msgstr "یا شاید رنگ‌های اصلی RGB::" msgid "" ">>> from enum import Enum\n" @@ -55,34 +74,65 @@ msgid "" "... GREEN = 2\n" "... BLUE = 3" msgstr "" +">>> from enum import Enum\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3" -msgid "As you can see, creating an :class:`Enum` is as simple as writing a class that inherits from :class:`Enum` itself." +msgid "" +"As you can see, creating an :class:`Enum` is as simple as writing a class " +"that inherits from :class:`Enum` itself." msgstr "" +"همان‌طور که می‌بینید، ایجاد یک :class:`Enum` به‌سادگی نوشتن کلاسی است که از " +"خود :class:`Enum` به ارث می‌برد." msgid "Case of Enum Members" -msgstr "" +msgstr "بزرگی و کوچکی حروف اعضای Enum" -msgid "Because Enums are used to represent constants, and to help avoid issues with name clashes between mixin-class methods/attributes and enum names, we strongly recommend using UPPER_CASE names for members, and will be using that style in our examples." +msgid "" +"Because Enums are used to represent constants, and to help avoid issues with" +" name clashes between mixin-class methods/attributes and enum names, we " +"strongly recommend using UPPER_CASE names for members, and will be using " +"that style in our examples." msgstr "" +"از آن‌جا که Enumها برای نمایش ثابت‌ها استفاده می‌شوند، و برای کمک به " +"جلوگیری از مشکلات ناشی از تداخل نام‌ها میان متدها/ویژگی‌های کلاس‌های mixin و" +" نام‌های enum، اکیداً توصیه می‌کنیم برای اعضا از نام‌های UPPER_CASE استفاده " +"کنید، و در مثال‌های خود نیز از همین سبک استفاده خواهیم کرد." -msgid "Depending on the nature of the enum a member's value may or may not be important, but either way that value can be used to get the corresponding member::" +msgid "" +"Depending on the nature of the enum a member's value may or may not be " +"important, but either way that value can be used to get the corresponding " +"member::" msgstr "" +"بسته به ماهیت enum، مقدار یک عضو ممکن است مهم باشد یا نباشد، اما در هر صورت " +"می‌توان از آن مقدار برای دریافت عضو متناظر استفاده کرد::" msgid "" ">>> Weekday(3)\n" "" msgstr "" +">>> Weekday(3)\n" +"" -msgid "As you can see, the ``repr()`` of a member shows the enum name, the member name, and the value. The ``str()`` of a member shows only the enum name and member name::" +msgid "" +"As you can see, the ``repr()`` of a member shows the enum name, the member " +"name, and the value. The ``str()`` of a member shows only the enum name and" +" member name::" msgstr "" +"همان‌طور که می‌بینید، ``repr()`` یک عضو، نام enum، نام عضو و مقدار را نشان " +"می‌دهد. ``str()`` یک عضو فقط نام enum و نام عضو را نشان می‌دهد::" msgid "" ">>> print(Weekday.THURSDAY)\n" "Weekday.THURSDAY" msgstr "" +">>> print(Weekday.THURSDAY)\n" +"Weekday.THURSDAY" msgid "The *type* of an enumeration member is the enum it belongs to::" -msgstr "" +msgstr "*نوع* یک عضو شمارش، همان enum است که به آن تعلق دارد::" msgid "" ">>> type(Weekday.MONDAY)\n" @@ -90,34 +140,63 @@ msgid "" ">>> isinstance(Weekday.FRIDAY, Weekday)\n" "True" msgstr "" +">>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True" -msgid "Enum members have an attribute that contains just their :attr:`!name`::" +msgid "" +"Enum members have an attribute that contains just their :attr:`!name`::" msgstr "" +"اعضای Enum دارای ویژگی‌ای هستند که فقط شامل :attr:`!name` آن‌ها می‌شود::" msgid "" ">>> print(Weekday.TUESDAY.name)\n" "TUESDAY" msgstr "" +">>> print(Weekday.TUESDAY.name)\n" +"TUESDAY" msgid "Likewise, they have an attribute for their :attr:`!value`::" -msgstr "" +msgstr "به همین ترتیب، آن‌ها یک ویژگی برای :attr:`!value` خود دارند::" msgid "" ">>> Weekday.WEDNESDAY.value\n" "3" msgstr "" +">>> Weekday.WEDNESDAY.value\n" +"3" -msgid "Unlike many languages that treat enumerations solely as name/value pairs, Python Enums can have behavior added. For example, :class:`datetime.date` has two methods for returning the weekday: :meth:`~datetime.date.weekday` and :meth:`~datetime.date.isoweekday`. The difference is that one of them counts from 0-6 and the other from 1-7. Rather than keep track of that ourselves we can add a method to the :class:`!Weekday` enum to extract the day from the :class:`~datetime.date` instance and return the matching enum member::" +msgid "" +"Unlike many languages that treat enumerations solely as name/value pairs, " +"Python Enums can have behavior added. For example, :class:`datetime.date` " +"has two methods for returning the weekday: :meth:`~datetime.date.weekday` " +"and :meth:`~datetime.date.isoweekday`. The difference is that one of them " +"counts from 0-6 and the other from 1-7. Rather than keep track of that " +"ourselves we can add a method to the :class:`!Weekday` enum to extract the " +"day from the :class:`~datetime.date` instance and return the matching enum " +"member::" msgstr "" +"برخلاف بسیاری از زبان‌ها که شمارش‌ها را صرفاً به‌عنوان جفت‌های نام/مقدار در " +"نظر می‌گیرند، می‌توان به شمارش‌های پایتون رفتار اضافه کرد. برای مثال، " +":class:`datetime.date` دو متد برای برگرداندن روز هفته دارد: " +":meth:`~datetime.date.weekday` و :meth:`~datetime.date.isoweekday`. تفاوت " +"این است که یکی از آن‌ها از ۰ تا ۶ و دیگری از ۱ تا ۷ می‌شمارد. به‌جای این‌که " +"خودمان این موضوع را پیگیری کنیم، می‌توانیم متدی به شمارش :class:`!Weekday` " +"اضافه کنیم تا روز را از نمونه :class:`~datetime.date` استخراج کند و عضو " +"متناظر شمارش را برگرداند::" msgid "" "@classmethod\n" "def from_date(cls, date):\n" " return cls(date.isoweekday())" msgstr "" +"@classmethod\n" +"def from_date(cls, date):\n" +" return cls(date.isoweekday())" msgid "The complete :class:`!Weekday` enum now looks like this::" -msgstr "" +msgstr "شمارش (enum) کامل :class:`!Weekday` اکنون به این شکل است::" msgid "" ">>> class Weekday(Enum):\n" @@ -133,21 +212,46 @@ msgid "" "... def from_date(cls, date):\n" "... return cls(date.isoweekday())" msgstr "" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... #\n" +"... @classmethod\n" +"... def from_date(cls, date):\n" +"... return cls(date.isoweekday())" msgid "Now we can find out what today is! Observe::" -msgstr "" +msgstr "اکنون می‌توانیم بفهمیم امروز چه روزی است! مشاهده کنید::" msgid "" ">>> import datetime as dt\n" ">>> Weekday.from_date(dt.date.today())\n" "" msgstr "" +">>> import datetime as dt\n" +">>> Weekday.from_date(dt.date.today())\n" +"" -msgid "Of course, if you're reading this on some other day, you'll see that day instead." -msgstr "" +msgid "" +"Of course, if you're reading this on some other day, you'll see that day " +"instead." +msgstr "البته، اگر این متن را در روز دیگری می‌خوانید، آن روز را خواهید دید." -msgid "This :class:`!Weekday` enum is great if our variable only needs one day, but what if we need several? Maybe we're writing a function to plot chores during a week, and don't want to use a :class:`list` -- we could use a different type of :class:`Enum`::" +msgid "" +"This :class:`!Weekday` enum is great if our variable only needs one day, but" +" what if we need several? Maybe we're writing a function to plot chores " +"during a week, and don't want to use a :class:`list` -- we could use a " +"different type of :class:`Enum`::" msgstr "" +"این شمارش :class:`!Weekday` زمانی عالی است که متغیر ما فقط به یک روز " +"نیاز داشته باشد، اما اگر به چندین روز نیاز داشته باشیم چطور؟ شاید در حال " +"نوشتن تابعی برای رسم کارها در طول هفته باشیم و نمی‌خواهیم از :class:`list` " +"استفاده کنیم -- می‌توانیم از نوع متفاوتی از :class:`Enum` استفاده کنیم::" msgid "" ">>> from enum import Flag\n" @@ -160,30 +264,57 @@ msgid "" "... SATURDAY = 32\n" "... SUNDAY = 64" msgstr "" +">>> from enum import Flag\n" +">>> class Weekday(Flag):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 4\n" +"... THURSDAY = 8\n" +"... FRIDAY = 16\n" +"... SATURDAY = 32\n" +"... SUNDAY = 64" -msgid "We've changed two things: we're inherited from :class:`Flag`, and the values are all powers of 2." +msgid "" +"We've changed two things: we're inherited from :class:`Flag`, and the values" +" are all powers of 2." msgstr "" +"ما دو چیز را تغییر داده‌ایم: از :class:`Flag` ارث می‌بریم، و مقدارها همگی " +"توان‌های ۲ هستند." -msgid "Just like the original :class:`!Weekday` enum above, we can have a single selection::" +msgid "" +"Just like the original :class:`!Weekday` enum above, we can have a single " +"selection::" msgstr "" +"درست مانند enum اصلی :class:`!Weekday` در بالا، می‌توانیم یک انتخاب واحد " +"داشته باشیم::" msgid "" ">>> first_week_day = Weekday.MONDAY\n" ">>> first_week_day\n" "" msgstr "" +">>> first_week_day = Weekday.MONDAY\n" +">>> first_week_day\n" +"" -msgid "But :class:`Flag` also allows us to combine several members into a single variable::" +msgid "" +"But :class:`Flag` also allows us to combine several members into a single " +"variable::" msgstr "" +"اما :class:`Flag` همچنین به ما اجازه می‌دهد چند عضو را در یک متغیر ترکیب " +"کنیم::" msgid "" ">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" ">>> weekend\n" "" msgstr "" +">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" +">>> weekend\n" +"" msgid "You can even iterate over a :class:`Flag` variable::" -msgstr "" +msgstr "شما حتی می‌توانید یک متغیر :class:`Flag` را پیمایش کنید::" msgid "" ">>> for day in weekend:\n" @@ -191,9 +322,13 @@ msgid "" "Weekday.SATURDAY\n" "Weekday.SUNDAY" msgstr "" +">>> for day in weekend:\n" +"... print(day)\n" +"Weekday.SATURDAY\n" +"Weekday.SUNDAY" msgid "Okay, let's get some chores set up::" -msgstr "" +msgstr "بسیار خوب، بیایید چند کار را راه‌اندازی کنیم::" msgid "" ">>> chores_for_ethan = {\n" @@ -202,9 +337,14 @@ msgid "" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" msgstr "" +">>> chores_for_ethan = {\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday.FRIDAY,\n" +"... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" +"... 'answer SO questions': Weekday.SATURDAY,\n" +"... }" msgid "And a function to display the chores for a given day::" -msgstr "" +msgstr "و تابعی برای نمایش کارهای یک روز مشخص::" msgid "" ">>> def show_chores(chores, day):\n" @@ -215,9 +355,20 @@ msgid "" ">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" "answer SO questions" msgstr "" +">>> def show_chores(chores, day):\n" +"... for chore, days in chores.items():\n" +"... if day in days:\n" +"... print(chore)\n" +"...\n" +">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" +"answer SO questions" -msgid "In cases where the actual values of the members do not matter, you can save yourself some work and use :func:`auto` for the values::" +msgid "" +"In cases where the actual values of the members do not matter, you can save " +"yourself some work and use :func:`auto` for the values::" msgstr "" +"در مواردی که مقادیر واقعی اعضا اهمیت ندارند، می‌توانید کمی کار خود را " +"ساده‌تر کنید و برای مقادیر از :func:`auto` استفاده کنید::" msgid "" ">>> from enum import auto\n" @@ -231,12 +382,28 @@ msgid "" "... SUNDAY = auto()\n" "... WEEKEND = SATURDAY | SUNDAY" msgstr "" +">>> from enum import auto\n" +">>> class Weekday(Flag):\n" +"... MONDAY = auto()\n" +"... TUESDAY = auto()\n" +"... WEDNESDAY = auto()\n" +"... THURSDAY = auto()\n" +"... FRIDAY = auto()\n" +"... SATURDAY = auto()\n" +"... SUNDAY = auto()\n" +"... WEEKEND = SATURDAY | SUNDAY" msgid "Programmatic access to enumeration members and their attributes" -msgstr "" +msgstr "دسترسی برنامه‌ای به اعضای شمارش و ویژگی‌های آن‌ها" -msgid "Sometimes it's useful to access members in enumerations programmatically (i.e. situations where ``Color.RED`` won't do because the exact color is not known at program-writing time). ``Enum`` allows such access::" +msgid "" +"Sometimes it's useful to access members in enumerations programmatically " +"(i.e. situations where ``Color.RED`` won't do because the exact color is not" +" known at program-writing time). ``Enum`` allows such access::" msgstr "" +"گاهی دسترسی به اعضای شمارش‌ها به‌صورت برنامه‌ای مفید است (یعنی شرایطی که " +"``Color.RED`` کارساز نیست، زیرا رنگ دقیق در زمان نوشتن برنامه مشخص نیست). " +"``Enum`` چنین دسترسی‌ای را فراهم می‌کند::" msgid "" ">>> Color(1)\n" @@ -244,9 +411,15 @@ msgid "" ">>> Color(3)\n" "" msgstr "" +">>> Color(1)\n" +"\n" +">>> Color(3)\n" +"" msgid "If you want to access enum members by *name*, use item access::" msgstr "" +"اگر می‌خواهید به اعضای enum با *نام* دسترسی پیدا کنید، از دسترسی آیتمی " +"استفاده کنید::" msgid "" ">>> Color['RED']\n" @@ -254,9 +427,15 @@ msgid "" ">>> Color['GREEN']\n" "" msgstr "" +">>> Color['RED']\n" +"\n" +">>> Color['GREEN']\n" +"" -msgid "If you have an enum member and need its :attr:`!name` or :attr:`!value`::" +msgid "" +"If you have an enum member and need its :attr:`!name` or :attr:`!value`::" msgstr "" +"اگر یک عضو enum دارید و به :attr:`!name` یا :attr:`!value` آن نیاز دارید::" msgid "" ">>> member = Color.RED\n" @@ -265,12 +444,17 @@ msgid "" ">>> member.value\n" "1" msgstr "" +">>> member = Color.RED\n" +">>> member.name\n" +"'RED'\n" +">>> member.value\n" +"1" msgid "Duplicating enum members and values" -msgstr "" +msgstr "تکرار اعضای enum و مقدارهای آن" msgid "Having two enum members with the same name is invalid::" -msgstr "" +msgstr "داشتن دو عضو enum با نام یکسان نامعتبر است::" msgid "" ">>> class Shape(Enum):\n" @@ -281,9 +465,27 @@ msgid "" "...\n" "TypeError: 'SQUARE' already defined as 2" msgstr "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... SQUARE = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: 'SQUARE' already defined as 2" -msgid "However, an enum member can have other names associated with it. Given two entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` is an alias for the member ``A``. By-value lookup of the value of ``A`` will return the member ``A``. By-name lookup of ``A`` will return the member ``A``. By-name lookup of ``B`` will also return the member ``A``::" +msgid "" +"However, an enum member can have other names associated with it. Given two " +"entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B``" +" is an alias for the member ``A``. By-value lookup of the value of ``A`` " +"will return the member ``A``. By-name lookup of ``A`` will return the " +"member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" +"با این حال، یک عضو enum می‌تواند نام‌های دیگری نیز داشته باشد که به آن مرتبط" +" هستند. با فرض دو ورودی ``A`` و ``B`` با مقدار یکسان (و ``A`` ابتدا تعریف " +"شده باشد)، ``B`` نام مستعاری برای عضو ``A`` است. جست‌وجوی بر اساس مقدار برای" +" مقدار ``A``، عضو ``A`` را برمی‌گرداند. جست‌وجوی بر اساس نام برای ``A``، عضو" +" ``A`` را برمی‌گرداند. جست‌وجوی بر اساس نام برای ``B`` نیز عضو ``A`` را " +"برمی‌گرداند::" msgid "" ">>> class Shape(Enum):\n" @@ -299,15 +501,38 @@ msgid "" ">>> Shape(2)\n" "" msgstr "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... DIAMOND = 1\n" +"... CIRCLE = 3\n" +"... ALIAS_FOR_SQUARE = 2\n" +"...\n" +">>> Shape.SQUARE\n" +"\n" +">>> Shape.ALIAS_FOR_SQUARE\n" +"\n" +">>> Shape(2)\n" +"" -msgid "Attempting to create a member with the same name as an already defined attribute (another member, a method, etc.) or attempting to create an attribute with the same name as a member is not allowed." +msgid "" +"Attempting to create a member with the same name as an already defined " +"attribute (another member, a method, etc.) or attempting to create an " +"attribute with the same name as a member is not allowed." msgstr "" +"تلاش برای ایجاد عضوی هم‌نام با یک ویژگی از پیش تعریف‌شده (عضوی دیگر، یک متد " +"و غیره) یا تلاش برای ایجاد ویژگی هم‌نام با یک عضو مجاز نیست." msgid "Ensuring unique enumeration values" -msgstr "" +msgstr "اطمینان از یکتایی مقادیر شمارش" -msgid "By default, enumerations allow multiple names as aliases for the same value. When this behavior isn't desired, you can use the :deco:`unique` decorator::" +msgid "" +"By default, enumerations allow multiple names as aliases for the same value." +" When this behavior isn't desired, you can use the :deco:`unique` " +"decorator::" msgstr "" +"به‌طور پیش‌فرض، شمارش‌ها اجازه می‌دهند چندین نام به‌عنوان نام‌های مستعار " +"برای یک مقدار یکسان استفاده شوند. هنگامی که این رفتار مطلوب نباشد، می‌توانید" +" از دکوراتور :deco:`unique` استفاده کنید::" msgid "" ">>> from enum import Enum, unique\n" @@ -322,12 +547,23 @@ msgid "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" msgstr "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" msgid "Using automatic values" -msgstr "" +msgstr "استفاده از مقادیر خودکار" msgid "If the exact value is unimportant you can use :class:`auto`::" -msgstr "" +msgstr "اگر مقدار دقیق مهم نیست، می‌توانید از :class:`auto` استفاده کنید::" msgid "" ">>> from enum import Enum, auto\n" @@ -339,9 +575,21 @@ msgid "" ">>> [member.value for member in Color]\n" "[1, 2, 3]" msgstr "" +">>> from enum import Enum, auto\n" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> [member.value for member in Color]\n" +"[1, 2, 3]" -msgid "The values are chosen by :func:`~Enum._generate_next_value_`, which can be overridden::" +msgid "" +"The values are chosen by :func:`~Enum._generate_next_value_`, which can be " +"overridden::" msgstr "" +"مقادیر توسط :func:`~Enum._generate_next_value_` انتخاب می‌شوند، که می‌توان " +"آن را بازنویسی کرد::" msgid "" ">>> class AutoName(Enum):\n" @@ -358,15 +606,31 @@ msgid "" ">>> [member.value for member in Ordinal]\n" "['NORTH', 'SOUTH', 'EAST', 'WEST']" msgstr "" +">>> class AutoName(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return name\n" +"...\n" +">>> class Ordinal(AutoName):\n" +"... NORTH = auto()\n" +"... SOUTH = auto()\n" +"... EAST = auto()\n" +"... WEST = auto()\n" +"...\n" +">>> [member.value for member in Ordinal]\n" +"['NORTH', 'SOUTH', 'EAST', 'WEST']" -msgid "The :meth:`~Enum._generate_next_value_` method must be defined before any members." +msgid "" +"The :meth:`~Enum._generate_next_value_` method must be defined before any " +"members." msgstr "" +"متد :meth:`~Enum._generate_next_value_` باید پیش از هر عضوی تعریف شود." msgid "Iteration" -msgstr "" +msgstr "تکرار" msgid "Iterating over the members of an enum does not provide the aliases::" -msgstr "" +msgstr "پیمایش اعضای یک enum، نام‌های مستعار را ارائه نمی‌دهد::" msgid "" ">>> list(Shape)\n" @@ -374,12 +638,25 @@ msgid "" ">>> list(Weekday)\n" "[, , , , , , ]" msgstr "" +">>> list(Shape)\n" +"[, , ]\n" +">>> list(Weekday)\n" +"[, , , , , , ]" -msgid "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` aren't shown." +msgid "" +"Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " +"aren't shown." msgstr "" +"توجه داشته باشید که نام‌های مستعار ``Shape.ALIAS_FOR_SQUARE`` و " +"``Weekday.WEEKEND`` نمایش داده نمی‌شوند." -msgid "The special attribute ``__members__`` is a read-only ordered mapping of names to members. It includes all names defined in the enumeration, including the aliases::" +msgid "" +"The special attribute ``__members__`` is a read-only ordered mapping of " +"names to members. It includes all names defined in the enumeration, " +"including the aliases::" msgstr "" +"ویژگی خاص ``__members__`` یک نگاشت مرتب فقط‌خواندنی از نام‌ها به اعضا است. " +"این ویژگی شامل تمام نام‌های تعریف‌شده در شمارش، از جمله نام‌های مستعار است::" msgid "" ">>> for name, member in Shape.__members__.items():\n" @@ -390,23 +667,40 @@ msgid "" "('CIRCLE', )\n" "('ALIAS_FOR_SQUARE', )" msgstr "" +">>> for name, member in Shape.__members__.items():\n" +"... name, member\n" +"...\n" +"('SQUARE', )\n" +"('DIAMOND', )\n" +"('CIRCLE', )\n" +"('ALIAS_FOR_SQUARE', )" -msgid "The ``__members__`` attribute can be used for detailed programmatic access to the enumeration members. For example, finding all the aliases::" +msgid "" +"The ``__members__`` attribute can be used for detailed programmatic access " +"to the enumeration members. For example, finding all the aliases::" msgstr "" +"می‌توان از ویژگی ``__members__`` برای دسترسی برنامه‌ای با جزئیات به اعضای " +"شمارش استفاده کرد. برای مثال، یافتن همه‌ی نام‌های مستعار::" msgid "" ">>> [name for name, member in Shape.__members__.items() if member.name != name]\n" "['ALIAS_FOR_SQUARE']" msgstr "" +">>> [name for name, member in Shape.__members__.items() if member.name != name]\n" +"['ALIAS_FOR_SQUARE']" -msgid "Aliases for flags include values with multiple flags set, such as ``3``, and no flags set, i.e. ``0``." +msgid "" +"Aliases for flags include values with multiple flags set, such as ``3``, and" +" no flags set, i.e. ``0``." msgstr "" +"نام‌های مستعار پرچم‌ها شامل مقادیری با چند پرچم فعال، مانند ``3``، و بدون " +"پرچم فعال، یعنی ``0`` می‌شوند." msgid "Comparisons" -msgstr "" +msgstr "مقایسه‌ها" msgid "Enumeration members are compared by identity::" -msgstr "" +msgstr "اعضای شمارش بر اساس هویت مقایسه می‌شوند::" msgid "" ">>> Color.RED is Color.RED\n" @@ -416,9 +710,19 @@ msgid "" ">>> Color.RED is not Color.BLUE\n" "True" msgstr "" +">>> Color.RED is Color.RED\n" +"True\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED is not Color.BLUE\n" +"True" -msgid "Ordered comparisons between enumeration values are *not* supported. Enum members are not integers (but see `IntEnum`_ below)::" +msgid "" +"Ordered comparisons between enumeration values are *not* supported. Enum " +"members are not integers (but see `IntEnum`_ below)::" msgstr "" +"مقایسه‌های ترتیبی بین مقادیر enum پشتیبانی *نمی‌شوند*. اعضای Enum عدد صحیح " +"نیستند (اما در ادامه `IntEnum`_ را ببینید)::" msgid "" ">>> Color.RED < Color.BLUE\n" @@ -426,9 +730,13 @@ msgid "" " File \"\", line 1, in \n" "TypeError: '<' not supported between instances of 'Color' and 'Color'" msgstr "" +">>> Color.RED < Color.BLUE\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: '<' not supported between instances of 'Color' and 'Color'" msgid "Equality comparisons are defined though::" -msgstr "" +msgstr "با این حال، مقایسه‌های برابری تعریف شده‌اند::" msgid "" ">>> Color.BLUE == Color.RED\n" @@ -438,26 +746,59 @@ msgid "" ">>> Color.BLUE == Color.BLUE\n" "True" msgstr "" +">>> Color.BLUE == Color.RED\n" +"False\n" +">>> Color.BLUE != Color.RED\n" +"True\n" +">>> Color.BLUE == Color.BLUE\n" +"True" -msgid "Comparisons against non-enumeration values will always compare not equal (again, :class:`IntEnum` was explicitly designed to behave differently, see below)::" +msgid "" +"Comparisons against non-enumeration values will always compare not equal " +"(again, :class:`IntEnum` was explicitly designed to behave differently, see " +"below)::" msgstr "" +"مقایسه‌ها با مقادیر غیرشمارشی همیشه نابرابر ارزیابی می‌شوند (باز هم، " +":class:`IntEnum` به‌صراحت برای رفتار متفاوتی طراحی شده است، در زیر ببینید)::" msgid "" ">>> Color.BLUE == 2\n" "False" msgstr "" +">>> Color.BLUE == 2\n" +"False" -msgid "It is possible to reload modules -- if a reloaded module contains enums, they will be recreated, and the new members may not compare identical/equal to the original members." +msgid "" +"It is possible to reload modules -- if a reloaded module contains enums, " +"they will be recreated, and the new members may not compare identical/equal " +"to the original members." msgstr "" +"بارگذاری مجدد ماژول‌ها امکان‌پذیر است — اگر ماژولی که دوباره بارگذاری‌شده " +"است شامل enumها (enums) باشد، آن‌ها دوباره ایجاد می‌شوند و ممکن است اعضای " +"جدید در مقایسه با اعضای اصلی یکسان/برابر نباشند." msgid "Allowed members and attributes of enumerations" -msgstr "" +msgstr "اعضا و ویژگی‌های مجاز شمارش‌ها" -msgid "Most of the examples above use integers for enumeration values. Using integers is short and handy (and provided by default by the `Functional API`_), but not strictly enforced. In the vast majority of use-cases, one doesn't care what the actual value of an enumeration is. But if the value *is* important, enumerations can have arbitrary values." +msgid "" +"Most of the examples above use integers for enumeration values. Using " +"integers is short and handy (and provided by default by the `Functional " +"API`_), but not strictly enforced. In the vast majority of use-cases, one " +"doesn't care what the actual value of an enumeration is. But if the value " +"*is* important, enumerations can have arbitrary values." msgstr "" +"بیشتر مثال‌های بالا از اعداد صحیح برای مقادیر شمارش استفاده می‌کنند. استفاده" +" از اعداد صحیح کوتاه و راحت است (و به‌طور پیش‌فرض توسط `Functional API`_ " +"فراهم می‌شود)، اما به‌طور اکید اعمال نمی‌شود. در اکثر قریب به اتفاق موارد " +"استفاده، اهمیت ندارد که مقدار واقعی یک شمارش چیست. اما اگر مقدار *مهم* باشد،" +" شمارش‌ها می‌توانند مقادیر دلخواهی داشته باشند." -msgid "Enumerations are Python classes, and can have methods and special methods as usual. If we have this enumeration::" +msgid "" +"Enumerations are Python classes, and can have methods and special methods as" +" usual. If we have this enumeration::" msgstr "" +"شمارش‌ها کلاس‌های پایتون هستند و می‌توانند مانند معمول متدها و متدهای خاص " +"داشته باشند. اگر این شمارش را داشته باشیم::" msgid "" ">>> class Mood(Enum):\n" @@ -477,9 +818,25 @@ msgid "" "... return cls.HAPPY\n" "..." msgstr "" +">>> class Mood(Enum):\n" +"... FUNKY = 1\n" +"... HAPPY = 3\n" +"...\n" +"... def describe(self):\n" +"... # self is the member here\n" +"... return self.name, self.value\n" +"...\n" +"... def __str__(self):\n" +"... return 'my custom str! {0}'.format(self.value)\n" +"...\n" +"... @classmethod\n" +"... def favorite_mood(cls):\n" +"... # cls here is the enumeration\n" +"... return cls.HAPPY\n" +"..." msgid "Then::" -msgstr "" +msgstr "سپس::" msgid "" ">>> Mood.favorite_mood()\n" @@ -489,29 +846,73 @@ msgid "" ">>> str(Mood.FUNKY)\n" "'my custom str! 1'" msgstr "" +">>> Mood.favorite_mood()\n" +"\n" +">>> Mood.HAPPY.describe()\n" +"('HAPPY', 3)\n" +">>> str(Mood.FUNKY)\n" +"'my custom str! 1'" -msgid "The rules for what is allowed are as follows: names that start and end with a single underscore are reserved by enum and cannot be used; all other attributes defined within an enumeration will become members of this enumeration, with the exception of special methods (:meth:`~object.__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also descriptors), and variable names listed in :attr:`~Enum._ignore_`." +msgid "" +"The rules for what is allowed are as follows: names that start and end with " +"a single underscore are reserved by enum and cannot be used; all other " +"attributes defined within an enumeration will become members of this " +"enumeration, with the exception of special methods (:meth:`~object.__str__`," +" :meth:`~object.__add__`, etc.), descriptors (methods are also descriptors)," +" and variable names listed in :attr:`~Enum._ignore_`." msgstr "" +"قواعد مربوط به آنچه مجاز است به شرح زیر است: نام‌هایی که با یک زیرخط آغاز " +"می‌شوند و با یک زیرخط ختم می‌شوند، توسط enum رزرو شده‌اند و نمی‌توان از " +"آن‌ها استفاده کرد؛ تمام ویژگی‌های دیگری که در یک شمارش تعریف می‌شوند، به " +"اعضای این شمارش تبدیل خواهند شد، به استثنای متدهای ویژه " +"(:meth:`~object.__str__`، :meth:`~object.__add__` و غیره)، توصیف‌گرها (متدها" +" نیز توصیف‌گر هستند) و نام متغیرهای فهرست‌شده در :attr:`~Enum._ignore_`." -msgid "Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:`~object.__init__`, any value(s) given to the enum member will be passed into those methods. See `Planet`_ for an example." +msgid "" +"Note: if your enumeration defines :meth:`~object.__new__` and/or " +":meth:`~object.__init__`, any value(s) given to the enum member will be " +"passed into those methods. See `Planet`_ for an example." msgstr "" +"توجه: اگر شمارش شما :meth:`~object.__new__` و/یا :meth:`~object.__init__` را" +" تعریف کند، هر مقدار(هایی) که به عضو شمارش داده شود، به آن متدها پاس داده " +"می‌شود. برای یک مثال `Planet`_ را ببینید." -msgid "The :meth:`~object.__new__` method, if defined, is used during creation of the Enum members; it is then replaced by Enum's :meth:`~object.__new__` which is used after class creation for lookup of existing members. See :ref:`new-vs-init` for more details." +msgid "" +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members. See " +":ref:`new-vs-init` for more details." msgstr "" +"متد :meth:`~object.__new__`، در صورت تعریف شدن، در هنگام ایجاد اعضای Enum " +"استفاده می‌شود؛ سپس با متد :meth:`~object.__new__` خود Enum جایگزین می‌شود " +"که پس از ایجاد کلاس برای جست‌وجوی اعضای موجود استفاده می‌شود. برای جزئیات " +"بیشتر :ref:`new-vs-init` را ببینید." msgid "Restricted Enum subclassing" -msgstr "" +msgstr "زیرکلاس‌سازی محدود Enum" -msgid "A new :class:`Enum` class must have one base enum class, up to one concrete data type, and as many :class:`object`-based mixin classes as needed. The order of these base classes is::" +msgid "" +"A new :class:`Enum` class must have one base enum class, up to one concrete " +"data type, and as many :class:`object`-based mixin classes as needed. The " +"order of these base classes is::" msgstr "" +"یک کلاس :class:`Enum` جدید باید یک کلاس enum پایه، حداکثر یک نوع داده مشخص، " +"و هر تعداد کلاس میکسین مبتنی بر :class:`object` که لازم باشد، داشته " +"باشد. ترتیب این کلاس‌های پایه به این صورت است::" msgid "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" msgstr "" +"class EnumName([mix-in, ...,] [data-type,] base-enum):\n" +" pass" -msgid "Also, subclassing an enumeration is allowed only if the enumeration does not define any members. So this is forbidden::" +msgid "" +"Also, subclassing an enumeration is allowed only if the enumeration does not" +" define any members. So this is forbidden::" msgstr "" +"همچنین، زیرکلاس‌سازی از یک شمارش تنها در صورتی مجاز است که آن شمارش هیچ عضوی" +" را تعریف نکرده باشد. بنابراین این کار ممنوع است::" msgid "" ">>> class MoreColor(Color):\n" @@ -521,9 +922,15 @@ msgid "" "...\n" "TypeError: cannot extend " msgstr "" +">>> class MoreColor(Color):\n" +"... PINK = 17\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: cannot extend " msgid "But this is allowed::" -msgstr "" +msgstr "اما این مجاز است::" msgid "" ">>> class Foo(Enum):\n" @@ -535,15 +942,35 @@ msgid "" "... SAD = 2\n" "..." msgstr "" +">>> class Foo(Enum):\n" +"... def some_behavior(self):\n" +"... pass\n" +"...\n" +">>> class Bar(Foo):\n" +"... HAPPY = 1\n" +"... SAD = 2\n" +"..." -msgid "Allowing subclassing of enums that define members would lead to a violation of some important invariants of types and instances. On the other hand, it makes sense to allow sharing some common behavior between a group of enumerations. (See `OrderedEnum`_ for an example.)" +msgid "" +"Allowing subclassing of enums that define members would lead to a violation " +"of some important invariants of types and instances. On the other hand, it " +"makes sense to allow sharing some common behavior between a group of " +"enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" +"مجاز کردن زیرکلاس‌سازی از enumهایی که اعضا را تعریف می‌کنند، منجر به نقض " +"برخی از ناورداهای مهم انواع و نمونه‌ها می‌شود. از سوی دیگر، منطقی است " +"که اجازه داده شود برخی رفتارهای مشترک میان گروهی از enumها به اشتراک گذاشته" +" شود. (برای نمونه `OrderedEnum`_ را ببینید.)" msgid "Dataclass support" -msgstr "" +msgstr "پشتیبانی از دیتاکلاس (Dataclass)" -msgid "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum.__repr__` omits the inherited class' name. For example::" +msgid "" +"When inheriting from a :class:`~dataclasses.dataclass`, the " +":meth:`~Enum.__repr__` omits the inherited class' name. For example::" msgstr "" +"هنگام ارث‌بردن از یک :class:`~dataclasses.dataclass`، متد " +":meth:`~Enum.__repr__` نام کلاس به‌ارث‌برده‌شده را حذف می‌کند. برای مثال::" msgid "" ">>> from dataclasses import dataclass, field\n" @@ -560,15 +987,44 @@ msgid "" ">>> Creature.DOG\n" "" msgstr "" +">>> from dataclasses import dataclass, field\n" +">>> @dataclass\n" +"... class CreatureDataMixin:\n" +"... size: str\n" +"... legs: int\n" +"... tail: bool = field(repr=False, default=True)\n" +"...\n" +">>> class Creature(CreatureDataMixin, Enum):\n" +"... BEETLE = 'small', 6\n" +"... DOG = 'medium', 4\n" +"...\n" +">>> Creature.DOG\n" +"" -msgid "Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the standard :func:`repr`." +msgid "" +"Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " +"standard :func:`repr`." msgstr "" +"برای استفاده از :func:`repr <~dataclasses.dataclass>` استاندارد، از آرگومان " +"``repr=False`` در :func:`~dataclasses.dataclass ` استفاده کنید." -msgid "Only the dataclass fields are shown in the value area, not the dataclass' name." +msgid "" +"Only the dataclass fields are shown in the value area, not the dataclass' " +"name." msgstr "" +"تنها فیلدهای دیتاکلاس (dataclass) در ناحیه‌ی مقدار نمایش داده می‌شوند، نه " +"نام دیتاکلاس." -msgid "Adding :deco:`~dataclasses.dataclass` decorator to :class:`Enum` and its subclasses is not supported. It will not raise any errors, but it will produce very strange results at runtime, such as members being equal to each other::" +msgid "" +"Adding :deco:`~dataclasses.dataclass` decorator to :class:`Enum` and its " +"subclasses is not supported. It will not raise any errors, but it will " +"produce very strange results at runtime, such as members being equal to each" +" other::" msgstr "" +"افزودن دکوراتور :deco:`~dataclasses.dataclass` به :class:`Enum` و " +"زیرکلاس‌های آن پشتیبانی نمی‌شود. این کار هیچ خطایی را پرتاب نمی‌کند، اما " +"نتایج بسیار عجیبی در ران‌تایم تولید می‌کند، مانند برابر بودن اعضا با " +"یکدیگر::" msgid "" ">>> @dataclass # don't do this: it does not make any sense\n" @@ -581,12 +1037,21 @@ msgid "" ">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" "True" msgstr "" +">>> @dataclass # don't do this: it does not make any sense\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... BLUE = 2\n" +"...\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" +"True" msgid "Pickling" -msgstr "" +msgstr "پیکل‌کردن (Pickling)" msgid "Enumerations can be pickled and unpickled::" -msgstr "" +msgstr "می‌توان شمارش‌ها را پیکل (pickle) و پیکل‌گشایی (unpickle) کرد::" msgid "" ">>> from test.test_enum import Fruit\n" @@ -594,30 +1059,61 @@ msgid "" ">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" "True" msgstr "" +">>> from test.test_enum import Fruit\n" +">>> from pickle import dumps, loads\n" +">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" +"True" -msgid "The usual restrictions for pickling apply: picklable enums must be defined in the top level of a module, since unpickling requires them to be importable from that module." +msgid "" +"The usual restrictions for pickling apply: picklable enums must be defined " +"in the top level of a module, since unpickling requires them to be " +"importable from that module." msgstr "" +"محدودیت‌های معمول برای پیکل‌کردن (pickling) اعمال می‌شوند: enumهای قابل " +"پیکل‌کردن باید در بالاترین سطح یک ماژول تعریف شوند، زیرا برای بازگردانی از " +"پیکل‌کردن (unpickling) لازم است که بتوان آن‌ها را از آن ماژول ایمپورت کرد." -msgid "With pickle protocol version 4 it is possible to easily pickle enums nested in other classes." +msgid "" +"With pickle protocol version 4 it is possible to easily pickle enums nested " +"in other classes." msgstr "" +"با نسخه‌ی ۴ پروتکل پیکل (pickle)، می‌توان enumهای تودرتو در کلاس‌های دیگر را" +" به‌سادگی پیکل کرد." -msgid "It is possible to modify how enum members are pickled/unpickled by defining :meth:`~object.__reduce_ex__` in the enumeration class. The default method is by-value, but enums with complicated values may want to use by-name::" +msgid "" +"It is possible to modify how enum members are pickled/unpickled by defining " +":meth:`~object.__reduce_ex__` in the enumeration class. The default method " +"is by-value, but enums with complicated values may want to use by-name::" msgstr "" +"می‌توان با تعریف :meth:`~object.__reduce_ex__` در کلاس enum، نحوه‌ی " +"پیکل‌کردن/از پیکل خارج‌شدن اعضای enum را تغییر داد. روش " +"پیش‌فرض بر اساس مقدار (by-value) است، اما enumهایی با مقادیر پیچیده ممکن " +"است بخواهند از روش نام‌محور (by-name) استفاده کنند::" msgid "" ">>> import enum\n" ">>> class MyEnum(enum.Enum):\n" "... __reduce_ex__ = enum.pickle_by_enum_name" msgstr "" +">>> import enum\n" +">>> class MyEnum(enum.Enum):\n" +"... __reduce_ex__ = enum.pickle_by_enum_name" -msgid "Using by-name for flags is not recommended, as unnamed aliases will not unpickle." +msgid "" +"Using by-name for flags is not recommended, as unnamed aliases will not " +"unpickle." msgstr "" +"استفاده از روش نام‌محور (by-name) برای پرچم‌ها توصیه نمی‌شود، زیرا نام‌های " +"مستعار بی‌نام پیکل‌گشایی (unpickle) نخواهند شد." msgid "Functional API" -msgstr "" +msgstr "API تابعی" -msgid "The :class:`Enum` class is callable, providing the following functional API::" +msgid "" +"The :class:`Enum` class is callable, providing the following functional " +"API::" msgstr "" +"کلاس :class:`Enum` قابل فراخوانی است و API تابعی زیر را فراهم می‌کند::" msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" @@ -628,12 +1124,39 @@ msgid "" ">>> list(Animal)\n" "[, , , ]" msgstr "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" +">>> Animal\n" +"\n" +">>> Animal.ANT\n" +"\n" +">>> list(Animal)\n" +"[, , , ]" -msgid "The semantics of this API resemble :class:`~collections.namedtuple`. The first argument of the call to :class:`Enum` is the name of the enumeration." +msgid "" +"The semantics of this API resemble :class:`~collections.namedtuple`. The " +"first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" +"معناشناسی این API به :class:`~collections.namedtuple` شبیه است. اولین " +"آرگومان فراخوانی :class:`Enum` نام شمارش است." -msgid "The second argument is the *source* of enumeration member names. It can be a whitespace-separated string of names, a sequence of names, a sequence of 2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to values. The last two options enable assigning arbitrary values to enumerations; the others auto-assign increasing integers starting with 1 (use the ``start`` parameter to specify a different starting value). A new class derived from :class:`Enum` is returned. In other words, the above assignment to :class:`!Animal` is equivalent to::" +msgid "" +"The second argument is the *source* of enumeration member names. It can be " +"a whitespace-separated string of names, a sequence of names, a sequence of " +"2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to " +"values. The last two options enable assigning arbitrary values to " +"enumerations; the others auto-assign increasing integers starting with 1 " +"(use the ``start`` parameter to specify a different starting value). A new " +"class derived from :class:`Enum` is returned. In other words, the above " +"assignment to :class:`!Animal` is equivalent to::" msgstr "" +"آرگومان دوم، *منبع* نام‌های اعضای شمارش است. این آرگومان می‌تواند رشته‌ای از" +" نام‌ها که با فضای خالی از هم جدا شده‌اند، دنباله‌ای از نام‌ها، دنباله‌ای از" +" تاپل‌های دوتایی با جفت‌های کلید/مقدار، یا نگاشتی (مثلاً دیکشنری) از نام‌ها " +"به مقادیر باشد. دو گزینه آخر امکان اختصاص مقادیر دلخواه به شمارش‌ها را فراهم" +" می‌کنند؛ سایر گزینه‌ها به‌طور خودکار اعداد صحیح افزایشی را از ۱ اختصاص " +"می‌دهند (برای تعیین مقدار شروع متفاوت، از پارامتر ``start`` استفاده کنید). " +"کلاس جدیدی مشتق‌شده از :class:`Enum` بازگردانده می‌شود. به عبارت دیگر، " +"انتساب بالا به :class:`!Animal` معادل است با::" msgid "" ">>> class Animal(Enum):\n" @@ -643,27 +1166,66 @@ msgid "" "... DOG = 4\n" "..." msgstr "" +">>> class Animal(Enum):\n" +"... ANT = 1\n" +"... BEE = 2\n" +"... CAT = 3\n" +"... DOG = 4\n" +"..." -msgid "The reason for defaulting to ``1`` as the starting number and not ``0`` is that ``0`` is ``False`` in a boolean sense, but by default enum members all evaluate to ``True``." +msgid "" +"The reason for defaulting to ``1`` as the starting number and not ``0`` is " +"that ``0`` is ``False`` in a boolean sense, but by default enum members all " +"evaluate to ``True``." msgstr "" +"دلیل پیش‌فرض قرار دادن ``1`` به‌عنوان عدد آغازین و نه ``0`` این است که ``0``" +" از نظر بولی ``False`` است، اما به‌طور پیش‌فرض همه اعضای enum به ``True`` " +"ارزیابی می‌شوند." -msgid "Pickling enums created with the functional API can be tricky as frame stack implementation details are used to try and figure out which module the enumeration is being created in (e.g. it will fail if you use a utility function in a separate module, and also may not work on IronPython or Jython). The solution is to specify the module name explicitly as follows::" +msgid "" +"Pickling enums created with the functional API can be tricky as frame stack " +"implementation details are used to try and figure out which module the " +"enumeration is being created in (e.g. it will fail if you use a utility " +"function in a separate module, and also may not work on IronPython or " +"Jython). The solution is to specify the module name explicitly as follows::" msgstr "" +"پیکل‌کردن (pickling) enumهای ایجادشده با API تابعی ممکن است دشوار باشد، " +"زیرا جزئیات پیاده‌سازی پشته‌ی فریم‌ها برای تلاش و تشخیص اینکه enum در کدام " +"ماژول ایجاد می‌شود به کار می‌روند (برای مثال، اگر از یک تابع کمکی در یک " +"ماژول جداگانه استفاده کنید، این کار شکست می‌خورد و همچنین ممکن است روی " +"IronPython یا Jython کار نکند). راه‌حل این است که نام ماژول را به‌صورت صریح " +"به شرح زیر مشخص کنید::" msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -msgstr "" +msgstr ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -msgid "If ``module`` is not supplied, and Enum cannot determine what it is, the new Enum members will not be unpicklable; to keep errors closer to the source, pickling will be disabled." +msgid "" +"If ``module`` is not supplied, and Enum cannot determine what it is, the new" +" Enum members will not be unpicklable; to keep errors closer to the source, " +"pickling will be disabled." msgstr "" +"اگر ``module`` ارائه‌نشده باشد و Enum نتواند تشخیص دهد که چیست، اعضای جدید " +"Enum غیرقابل پیکل (unpicklable) نخواهند بود؛ برای نزدیک‌تر نگه‌داشتن خطاها " +"به منبع، پیکل‌کردن (pickling) غیرفعال خواهد شد." -msgid "The new pickle protocol 4 also, in some circumstances, relies on :attr:`~type.__qualname__` being set to the location where pickle will be able to find the class. For example, if the class was made available in class SomeData in the global scope::" +msgid "" +"The new pickle protocol 4 also, in some circumstances, relies on " +":attr:`~type.__qualname__` being set to the location where pickle will be " +"able to find the class. For example, if the class was made available in " +"class SomeData in the global scope::" msgstr "" +"پروتکل ۴ جدید pickle همچنین، در برخی شرایط، به این موضوع متکی است که " +":attr:`~type.__qualname__` روی مکانی تنظیم شده باشد که pickle بتواند کلاس را" +" بیابد. برای مثال، اگر کلاس در کلاس SomeData در محدوده سراسری در دسترس قرار " +"گرفته باشد::" -msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" +msgid "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgstr "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgid "The complete signature is::" -msgstr "" +msgstr "امضای کامل به این صورت است::" msgid "" "Enum(\n" @@ -676,57 +1238,79 @@ msgid "" " start=1,\n" " )" msgstr "" +"Enum(\n" +" value='NewEnumName',\n" +" names=<...>,\n" +" *,\n" +" module='...',\n" +" qualname='...',\n" +" type=,\n" +" start=1,\n" +" )" msgid "*value*: What the new enum class will record as its name." -msgstr "" +msgstr "*value*: آنچه کلاس enum جدید به‌عنوان نام خود ثبت خواهد کرد." -msgid "*names*: The enum members. This can be a whitespace- or comma-separated string (values will start at 1 unless otherwise specified)::" +msgid "" +"*names*: The enum members. This can be a whitespace- or comma-separated " +"string (values will start at 1 unless otherwise specified)::" msgstr "" +"*names*: اعضای enum. این می‌تواند رشته‌ای جداشده با فضای خالی یا ویرگول باشد" +" (مقادیر از ۱ شروع خواهند شد مگر اینکه خلاف آن مشخص شده باشد)::" msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" -msgstr "" +msgstr "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" msgid "or an iterator of names::" -msgstr "" +msgstr "یا یک پیمایش‌گر از نام‌ها::" msgid "['RED', 'GREEN', 'BLUE']" -msgstr "" +msgstr "['RED', 'GREEN', 'BLUE']" msgid "or an iterator of (name, value) pairs::" -msgstr "" +msgstr "یا پیمایش‌گری از جفت‌های (نام، مقدار)::" msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" -msgstr "" +msgstr "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" msgid "or a mapping::" -msgstr "" +msgstr "یا یک نگاشت::" msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" -msgstr "" +msgstr "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" msgid "*module*: name of module where new enum class can be found." -msgstr "" +msgstr "*module*: نام ماژولی که کلاس enum جدید در آن یافت می‌شود." msgid "*qualname*: where in module new enum class can be found." -msgstr "" +msgstr "*qualname*: جایگاهی در ماژول که کلاس enum جدید در آن یافت می‌شود." msgid "*type*: type to mix in to new enum class." -msgstr "" +msgstr "*type*: نوعی که باید در کلاس enum جدید ادغامشود." msgid "*start*: number to start counting at if only names are passed in." msgstr "" +"*start*: عددی که اگر فقط نام‌ها ارسال شده باشند، شمارش از آن آغاز می‌شود." msgid "The *start* parameter was added." -msgstr "" +msgstr "پارامتر *start* اضافه شد." msgid "Derived Enumerations" -msgstr "" +msgstr "شمارش‌های مشتق‌شده" msgid "IntEnum" -msgstr "" +msgstr "IntEnum" -msgid "The first variation of :class:`Enum` that is provided is also a subclass of :class:`int`. Members of an :class:`IntEnum` can be compared to integers; by extension, integer enumerations of different types can also be compared to each other::" +msgid "" +"The first variation of :class:`Enum` that is provided is also a subclass of " +":class:`int`. Members of an :class:`IntEnum` can be compared to integers; " +"by extension, integer enumerations of different types can also be compared " +"to each other::" msgstr "" +"اولین گونه از :class:`Enum` که ارائه شده است، همچنین زیرکلاسی از " +":class:`int` است. اعضای یک :class:`IntEnum` می‌توانند با اعداد صحیح مقایسه " +"شوند؛ به‌تبع، شمارش‌های عدد صحیح از انواع مختلف نیز می‌توانند با یکدیگر " +"مقایسه شوند::" msgid "" ">>> from enum import IntEnum\n" @@ -745,9 +1329,28 @@ msgid "" ">>> Shape.CIRCLE == Request.POST\n" "True" msgstr "" +">>> from enum import IntEnum\n" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Request(IntEnum):\n" +"... POST = 1\n" +"... GET = 2\n" +"...\n" +">>> Shape == 1\n" +"False\n" +">>> Shape.CIRCLE == 1\n" +"True\n" +">>> Shape.CIRCLE == Request.POST\n" +"True" -msgid "However, they still can't be compared to standard :class:`Enum` enumerations::" +msgid "" +"However, they still can't be compared to standard :class:`Enum` " +"enumerations::" msgstr "" +"با این حال، همچنان نمی‌توان آن‌ها را با شمارش‌های استاندارد :class:`Enum` " +"مقایسه کرد::" msgid "" ">>> class Shape(IntEnum):\n" @@ -761,9 +1364,22 @@ msgid "" ">>> Shape.CIRCLE == Color.RED\n" "False" msgstr "" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"...\n" +">>> Shape.CIRCLE == Color.RED\n" +"False" -msgid ":class:`IntEnum` values behave like integers in other ways you'd expect::" +msgid "" +":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" +"مقادیر :class:`IntEnum` در سایر مواردی که انتظار دارید، مانند اعداد صحیح " +"رفتار می‌کنند::" msgid "" ">>> int(Shape.CIRCLE)\n" @@ -773,27 +1389,61 @@ msgid "" ">>> [i for i in range(Shape.SQUARE)]\n" "[0, 1]" msgstr "" +">>> int(Shape.CIRCLE)\n" +"1\n" +">>> ['a', 'b', 'c'][Shape.CIRCLE]\n" +"'b'\n" +">>> [i for i in range(Shape.SQUARE)]\n" +"[0, 1]" msgid "StrEnum" -msgstr "" +msgstr "StrEnum" -msgid "The second variation of :class:`Enum` that is provided is also a subclass of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; by extension, string enumerations of different types can also be compared to each other." +msgid "" +"The second variation of :class:`Enum` that is provided is also a subclass of" +" :class:`str`. Members of a :class:`StrEnum` can be compared to strings; by" +" extension, string enumerations of different types can also be compared to " +"each other." msgstr "" +"دومین گونه‌ی ارائه‌شده از :class:`Enum` نیز زیرکلاسی از :class:`str` است. " +"می‌توان اعضای یک :class:`StrEnum` را با رشته‌ها مقایسه کرد؛ به‌تبع آن، " +"شمارش‌های رشته‌ای از انواع مختلف نیز می‌توانند با یکدیگر مقایسه شوند." msgid "IntFlag" -msgstr "" +msgstr "IntFlag" -msgid "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based on :class:`int`. The difference being :class:`IntFlag` members can be combined using the bitwise operators (&, \\|, ^, ~) and the result is still an :class:`IntFlag` member, if possible. Like :class:`IntEnum`, :class:`IntFlag` members are also integers and can be used wherever an :class:`int` is used." +msgid "" +"The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " +"based on :class:`int`. The difference being :class:`IntFlag` members can be" +" combined using the bitwise operators (&, \\|, ^, ~) and the result is still" +" an :class:`IntFlag` member, if possible. Like :class:`IntEnum`, " +":class:`IntFlag` members are also integers and can be used wherever an " +":class:`int` is used." msgstr "" +"گونه‌ی بعدی ارائه‌شده از :class:`Enum`، یعنی :class:`IntFlag`، نیز بر پایه‌ی" +" :class:`int` است. تفاوت این است که اعضای :class:`IntFlag` را می‌توان با " +"عملگرهای بیتی (&, \\|, ^, ~) ترکیب کرد و نتیجه در صورت امکان همچنان عضوی از " +":class:`IntFlag` است. مانند :class:`IntEnum`، اعضای :class:`IntFlag` نیز " +"اعداد صحیح هستند و می‌توانند در هر جایی که از :class:`int` استفاده می‌شود، " +"به کار بروند." -msgid "Any operation on an :class:`IntFlag` member besides the bit-wise operations will lose the :class:`IntFlag` membership." +msgid "" +"Any operation on an :class:`IntFlag` member besides the bit-wise operations " +"will lose the :class:`IntFlag` membership." msgstr "" +"هر عملیاتی بر روی یک عضو :class:`IntFlag`، به‌جز عملیات بیتی، منجر به از دست" +" رفتن عضویت :class:`IntFlag` می‌شود." -msgid "Bit-wise operations that result in invalid :class:`IntFlag` values will lose the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." +msgid "" +"Bit-wise operations that result in invalid :class:`IntFlag` values will lose" +" the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" +"عملیات‌های بیتی که به مقدارهای نامعتبر :class:`IntFlag` منجر شوند، عضویت در" +" :class:`IntFlag` را از دست می‌دهند. برای جزئیات، :class:`FlagBoundary` را " +"ببینید." msgid "Sample :class:`IntFlag` class::" -msgstr "" +msgstr "نمونه کلاس :class:`IntFlag`::" msgid "" ">>> from enum import IntFlag\n" @@ -810,9 +1460,22 @@ msgid "" ">>> Perm.R in RW\n" "True" msgstr "" +">>> from enum import IntFlag\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> Perm.R | Perm.W\n" +"\n" +">>> Perm.R + Perm.W\n" +"6\n" +">>> RW = Perm.R | Perm.W\n" +">>> Perm.R in RW\n" +"True" msgid "It is also possible to name the combinations::" -msgstr "" +msgstr "همچنین می‌توان ترکیب‌ها را نام‌گذاری کرد::" msgid "" ">>> class Perm(IntFlag):\n" @@ -828,12 +1491,34 @@ msgid "" ">>> Perm(7)\n" "" msgstr "" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"... RWX = 7\n" +"...\n" +">>> Perm.RWX\n" +"\n" +">>> ~Perm.RWX\n" +"\n" +">>> Perm(7)\n" +"" -msgid "Named combinations are considered aliases. Aliases do not show up during iteration, but can be returned from by-value lookups." +msgid "" +"Named combinations are considered aliases. Aliases do not show up during " +"iteration, but can be returned from by-value lookups." msgstr "" +"ترکیب‌های نام‌دار به‌عنوان نام مستعار در نظر گرفته می‌شوند. نام‌های مستعار " +"در حین پیمایش نمایش داده نمی‌شوند، اما می‌توانند از طریق جستجوهای بر اساس " +"مقدار برگردانده شوند." -msgid "Another important difference between :class:`IntFlag` and :class:`Enum` is that if no flags are set (the value is 0), its boolean evaluation is :data:`False`::" +msgid "" +"Another important difference between :class:`IntFlag` and :class:`Enum` is " +"that if no flags are set (the value is 0), its boolean evaluation is " +":data:`False`::" msgstr "" +"تفاوت مهم دیگر میان :class:`IntFlag` و :class:`Enum` این است که اگر هیچ " +"پرچمی تنظیم نشده باشد (مقدار ۰ باشد)، ارزیابی بولی آن :data:`False` است::" msgid "" ">>> Perm.R & Perm.X\n" @@ -841,9 +1526,18 @@ msgid "" ">>> bool(Perm.R & Perm.X)\n" "False" msgstr "" +">>> Perm.R & Perm.X\n" +"\n" +">>> bool(Perm.R & Perm.X)\n" +"False" -msgid "Because :class:`IntFlag` members are also subclasses of :class:`int` they can be combined with them (but may lose :class:`IntFlag` membership::" +msgid "" +"Because :class:`IntFlag` members are also subclasses of :class:`int` they " +"can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" +"از آن‌جا که اعضای :class:`IntFlag` نیز زیرکلاس‌هایی از :class:`int` هستند، " +"می‌توانند با آن‌ها ترکیب شوند (اما ممکن است عضویت در :class:`IntFlag` را از " +"دست بدهند::" msgid "" ">>> Perm.X | 4\n" @@ -852,31 +1546,59 @@ msgid "" ">>> Perm.X + 8\n" "9" msgstr "" +">>> Perm.X | 4\n" +"\n" +"\n" +">>> Perm.X + 8\n" +"9" -msgid "The negation operator, ``~``, always returns an :class:`IntFlag` member with a positive value::" +msgid "" +"The negation operator, ``~``, always returns an :class:`IntFlag` member with" +" a positive value::" msgstr "" +"عملگر نقض، ``~``، همیشه یک عضو :class:`IntFlag` با مقدار مثبت برمی‌گرداند::" msgid "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" msgstr "" +">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" +"True" msgid ":class:`IntFlag` members can also be iterated over::" -msgstr "" +msgstr "همچنین می‌توان اعضای :class:`IntFlag` را نیز پیمایش کرد::" msgid "" ">>> list(RW)\n" "[, ]" msgstr "" +">>> list(RW)\n" +"[, ]" msgid "Flag" -msgstr "" +msgstr "پرچم" -msgid "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :class:`IntFlag`, they cannot be combined with, nor compared against, any other :class:`Flag` enumeration, nor :class:`int`. While it is possible to specify the values directly it is recommended to use :class:`auto` as the value and let :class:`Flag` select an appropriate value." +msgid "" +"The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " +"members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike " +":class:`IntFlag`, they cannot be combined with, nor compared against, any " +"other :class:`Flag` enumeration, nor :class:`int`. While it is possible to " +"specify the values directly it is recommended to use :class:`auto` as the " +"value and let :class:`Flag` select an appropriate value." msgstr "" +"آخرین گونه :class:`Flag` است. مانند :class:`IntFlag`، می‌توان اعضای " +":class:`Flag` را با استفاده از عملگرهای بیتی (&, \\|, ^, ~) ترکیب کرد. " +"برخلاف :class:`IntFlag`، نمی‌توان آن‌ها را با هیچ شمارش :class:`Flag` دیگری " +"و نه با :class:`int` ترکیب کرد یا مقایسه نمود. اگرچه امکان تعیین مستقیم " +"مقادیر وجود دارد، توصیه می‌شود از :class:`auto` به‌عنوان مقدار استفاده کنید " +"و اجازه دهید :class:`Flag` مقدار مناسبی را انتخاب کند." -msgid "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no flags being set, the boolean evaluation is :data:`False`::" +msgid "" +"Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " +"no flags being set, the boolean evaluation is :data:`False`::" msgstr "" +"مانند :class:`IntFlag`، اگر ترکیبی از اعضای :class:`Flag` منجر به تنظیم نشدن" +" هیچ پرچمی شود، ارزیابی بولی :data:`False` است::" msgid "" ">>> from enum import Flag, auto\n" @@ -890,9 +1612,23 @@ msgid "" ">>> bool(Color.RED & Color.GREEN)\n" "False" msgstr "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.RED & Color.GREEN\n" +"\n" +">>> bool(Color.RED & Color.GREEN)\n" +"False" -msgid "Individual flags should have values that are powers of two (1, 2, 4, 8, ...), while combinations of flags will not::" +msgid "" +"Individual flags should have values that are powers of two (1, 2, 4, 8, " +"...), while combinations of flags will not::" msgstr "" +"پرچم‌های منفرد باید مقادیری داشته باشند که توان‌هایی از دو هستند (۱، ۲، ۴، " +"۸، ...)، در حالی که ترکیب‌هایی از پرچم‌ها این‌گونه نخواهند بود::" msgid "" ">>> class Color(Flag):\n" @@ -904,9 +1640,20 @@ msgid "" ">>> Color.WHITE\n" "" msgstr "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"... WHITE = RED | BLUE | GREEN\n" +"...\n" +">>> Color.WHITE\n" +"" -msgid "Giving a name to the \"no flags set\" condition does not change its boolean value::" +msgid "" +"Giving a name to the \"no flags set\" condition does not change its boolean " +"value::" msgstr "" +"نام‌گذاری وضعیت «هیچ پرچمی تنظیم نشده است» مقدار بولی آن را تغییر نمی‌دهد::" msgid "" ">>> class Color(Flag):\n" @@ -920,68 +1667,171 @@ msgid "" ">>> bool(Color.BLACK)\n" "False" msgstr "" +">>> class Color(Flag):\n" +"... BLACK = 0\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.BLACK\n" +"\n" +">>> bool(Color.BLACK)\n" +"False" msgid ":class:`Flag` members can also be iterated over::" -msgstr "" +msgstr "می‌توان روی اعضای :class:`Flag` نیز تکرار کرد::" msgid "" ">>> purple = Color.RED | Color.BLUE\n" ">>> list(purple)\n" "[, ]" msgstr "" +">>> purple = Color.RED | Color.BLUE\n" +">>> list(purple)\n" +"[, ]" -msgid "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic promises of an enumeration (by being comparable to integers, and thus by transitivity to other unrelated enumerations). :class:`IntEnum` and :class:`IntFlag` should be used only in cases where :class:`Enum` and :class:`Flag` will not do; for example, when integer constants are replaced with enumerations, or for interoperability with other systems." +msgid "" +"For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " +"recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic" +" promises of an enumeration (by being comparable to integers, and thus by " +"transitivity to other unrelated enumerations). :class:`IntEnum` and " +":class:`IntFlag` should be used only in cases where :class:`Enum` and " +":class:`Flag` will not do; for example, when integer constants are replaced " +"with enumerations, or for interoperability with other systems." msgstr "" +"برای بیشتر کدهای جدید، استفاده از :class:`Enum` و :class:`Flag` به‌شدت توصیه" +" می‌شود، زیرا :class:`IntEnum` و :class:`IntFlag` برخی وعده‌های معنایی یک " +"شمارش (enumeration) را نقض می‌کنند (با قابل مقایسه بودن با اعداد صحیح، و در " +"نتیجه قابل مقایسه بودن با شمارش‌های غیرمرتبط دیگر از طریق تعدی). " +":class:`IntEnum` و :class:`IntFlag` باید فقط در مواردی استفاده شوند که " +":class:`Enum` و :class:`Flag` کارساز نباشند؛ برای مثال، وقتی ثابت‌های عدد " +"صحیح با شمارش‌ها جایگزین می‌شوند، یا برای تعامل‌پذیری با سیستم‌های دیگر." msgid "Others" -msgstr "" +msgstr "سایر" -msgid "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very simple to implement independently::" +msgid "" +"While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " +"simple to implement independently::" msgstr "" +"اگرچه :class:`IntEnum` بخشی از ماژول :mod:`enum` است، پیاده‌سازی مستقل آن " +"بسیار ساده است::" msgid "" "class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" " pass" msgstr "" +"class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" +" pass" -msgid "This demonstrates how similar derived enumerations can be defined; for example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:`int`." +msgid "" +"This demonstrates how similar derived enumerations can be defined; for " +"example a :class:`!FloatEnum` that mixes in :class:`float` instead of " +":class:`int`." msgstr "" +"این نشان می‌دهد که چگونه می‌توان شمارش‌های مشتق‌شده مشابه را تعریف کرد؛ برای" +" مثال، یک :class:`!FloatEnum` که :class:`float` را به‌جای :class:`int` " +"به‌صورت میکس‌این به‌کار می‌گیرد." msgid "Some rules:" -msgstr "" +msgstr "برخی قوانین:" -msgid "When subclassing :class:`Enum`, mix-in types must appear before the :class:`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` example above." +msgid "" +"When subclassing :class:`Enum`, mix-in types must appear before the " +":class:`Enum` class itself in the sequence of bases, as in the " +":class:`IntEnum` example above." msgstr "" +"هنگام زیرکلاس‌سازی از :class:`Enum`، انواع میکس‌اینباید در دنباله‌ی " +"پایه‌ها پیش از خود کلاس :class:`Enum` قرار بگیرند، همان‌طور که در مثال " +":class:`IntEnum` بالا آمده است." -msgid "Mix-in types must be subclassable. For example, :class:`bool` and :class:`range` are not subclassable and will throw an error during Enum creation if used as the mix-in type." +msgid "" +"Mix-in types must be subclassable. For example, :class:`bool` and " +":class:`range` are not subclassable and will throw an error during Enum " +"creation if used as the mix-in type." msgstr "" +"انواع میکس‌اینباید قابل زیرکلاس‌سازی باشند. برای مثال، :class:`bool`" +" و :class:`range` قابل زیرکلاس‌سازی نیستند و در صورت استفاده به‌عنوان نوع " +"میکس‌این ، هنگام ایجاد Enum خطایی پرتاب می‌کنند." -msgid "While :class:`Enum` can have members of any type, once you mix in an additional type, all the members must have values of that type, e.g. :class:`int` above. This restriction does not apply to mix-ins which only add methods and don't specify another type." +msgid "" +"While :class:`Enum` can have members of any type, once you mix in an " +"additional type, all the members must have values of that type, e.g. " +":class:`int` above. This restriction does not apply to mix-ins which only " +"add methods and don't specify another type." msgstr "" +"در حالی که :class:`Enum` می‌تواند اعضایی از هر نوعی داشته باشد، هنگامی که یک" +" نوع اضافی را به‌صورت میکس‌ایناضافه می‌کنید، همه اعضا باید مقادیری " +"از آن نوع داشته باشند، برای مثال :class:`int` در بالا. این محدودیت در مورد " +"کلاس‌های میکس‌اینکه فقط متدها را اضافه می‌کنند و نوع دیگری را مشخص " +"نمی‌کنند، اعمال نمی‌شود." -msgid "When another data type is mixed in, the :attr:`~Enum.value` attribute is *not the same* as the enum member itself, although it is equivalent and will compare equal." +msgid "" +"When another data type is mixed in, the :attr:`~Enum.value` attribute is " +"*not the same* as the enum member itself, although it is equivalent and will" +" compare equal." msgstr "" +"هنگامی که نوع داده دیگری در آن آمیخته شود، ویژگی :attr:`~Enum.value` *با خود" +" عضو enum یکسان نیست*، هرچند معادل آن است و در مقایسه برابر خواهد بود." -msgid "A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:`~dataclasses.dataclass`" +msgid "" +"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a " +":class:`~dataclasses.dataclass`" msgstr "" +"یک ``data type`` یک میکسیناست که :meth:`~object.__new__` را تعریف " +"می‌کند، یا یک :class:`~dataclasses.dataclass` است" -msgid "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:`~object.__str__` and :meth:`~object.__repr__` respectively; other codes (such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in type." +msgid "" +"%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's " +":meth:`~object.__str__` and :meth:`~object.__repr__` respectively; other " +"codes (such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its " +"mixed-in type." msgstr "" +"قالب‌بندی %-style: ``%s`` و ``%r`` به‌ترتیب :meth:`~object.__str__` و " +":meth:`~object.__repr__` کلاس :class:`Enum` را فراخوانی می‌کنند؛ سایر کدها " +"(مانند ``%i`` یا ``%h`` برای IntEnum) با عضو enum به‌عنوان نوع آمیخته‌ی آن " +"(mixed-in type) رفتار می‌کنند." -msgid ":ref:`Formatted string literals `, :meth:`str.format`, and :func:`format` will use the enum's :meth:`~object.__str__` method." +msgid "" +":ref:`Formatted string literals `, :meth:`str.format`, and " +":func:`format` will use the enum's :meth:`~object.__str__` method." msgstr "" +":ref:`رشته‌های قالب‌بندی‌شده `، :meth:`str.format` و " +":func:`format` از متد :meth:`~object.__str__` enum استفاده خواهند کرد." -msgid "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are designed to be drop-in replacements for existing constants, their :meth:`~object.__str__` method has been reset to their data types' :meth:`~object.__str__` method." +msgid "" +"Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " +"designed to be drop-in replacements for existing constants, their " +":meth:`~object.__str__` method has been reset to their data types' " +":meth:`~object.__str__` method." msgstr "" +"از آنجا که :class:`IntEnum`، :class:`IntFlag` و :class:`StrEnum` به‌عنوان " +"جایگزین‌های مستقیم برای ثابت‌های موجود طراحی شده‌اند، متد " +":meth:`~object.__str__` آن‌ها به متد :meth:`~object.__str__` انواع داده‌ی " +"آن‌ها بازنشانی شده است." msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" msgstr "" +"چه زمانی از :meth:`~object.__new__` در مقابل :meth:`~object.__init__` " +"استفاده کنیم" -msgid ":meth:`~object.__new__` must be used whenever you want to customize the actual value of the :class:`Enum` member. Any other modifications may go in either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:`~object.__init__` being preferred." +msgid "" +":meth:`~object.__new__` must be used whenever you want to customize the " +"actual value of the :class:`Enum` member. Any other modifications may go in" +" either :meth:`~object.__new__` or :meth:`~object.__init__`, with " +":meth:`~object.__init__` being preferred." msgstr "" +":meth:`~object.__new__` باید هرگاه بخواهید مقدار واقعی عضو :class:`Enum` را " +"سفارشی کنید، استفاده شود. هرگونه تغییر دیگر را می‌توان در " +":meth:`~object.__new__` یا :meth:`~object.__init__` انجام داد، که " +":meth:`~object.__init__` ترجیح داده می‌شود." -msgid "For example, if you want to pass several items to the constructor, but only want one of them to be the value::" +msgid "" +"For example, if you want to pass several items to the constructor, but only " +"want one of them to be the value::" msgstr "" +"برای مثال، اگر می‌خواهید چند آیتم را به سازنده ارسال کنید، اما فقط می‌خواهید" +" یکی از آن‌ها مقدار باشد::" msgid "" ">>> class Coordinate(bytes, Enum):\n" @@ -1006,36 +1856,88 @@ msgid "" ">>> print(Coordinate(3))\n" "Coordinate.VY" msgstr "" +">>> class Coordinate(bytes, Enum):\n" +"... \"\"\"\n" +"... Coordinate with binary codes that can be indexed by the int code.\n" +"... \"\"\"\n" +"... def __new__(cls, value, label, unit):\n" +"... obj = bytes.__new__(cls, [value])\n" +"... obj._value_ = value\n" +"... obj.label = label\n" +"... obj.unit = unit\n" +"... return obj\n" +"... PX = (0, 'P.X', 'km')\n" +"... PY = (1, 'P.Y', 'km')\n" +"... VX = (2, 'V.X', 'km/s')\n" +"... VY = (3, 'V.Y', 'km/s')\n" +"...\n" +"\n" +">>> print(Coordinate['PY'])\n" +"Coordinate.PY\n" +"\n" +">>> print(Coordinate(3))\n" +"Coordinate.VY" -msgid "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the one that is found; instead, use the data type directly." -msgstr "" - -msgid "Finer Points" -msgstr "" - -msgid "Supported ``__dunder__`` and ``_sunder_`` names" +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly." msgstr "" +"``super().__new__()`` را *فراخوانی نکنید*، زیرا ``__new__`` که فقط جستجو " +"(lookup-only) است، همان چیزی است که یافت می‌شود؛ در عوض، مستقیماً از نوع " +"داده استفاده کنید." + +msgid "Finer Points" +msgstr "نکات دقیق‌تر" + +msgid "Supported ``__dunder__`` and ``_sunder_`` names" +msgstr "نام‌های ``__dunder__`` و ``_sunder_`` پشتیبانی‌شده" -msgid "The supported ``__dunder__`` and ``_sunder_`` names can be found in the :ref:`Enum API documentation `." +msgid "" +"The supported ``__dunder__`` and ``_sunder_`` names can be found in the " +":ref:`Enum API documentation `." msgstr "" +"نام‌های ``__dunder__`` و ``_sunder_`` پشتیبانی‌شده را می‌توانید در " +":ref:`مستندات API Enum ` بیابید." msgid "_Private__names" -msgstr "" +msgstr "_Private__names" -msgid ":ref:`Private names ` are not converted to enum members, but remain normal attributes." +msgid "" +":ref:`Private names ` are not converted to enum " +"members, but remain normal attributes." msgstr "" +":ref:`نام‌های خصوصی ` به اعضای enum تبدیل نمی‌شوند، " +"بلکه به‌عنوان ویژگی‌های عادی باقی می‌مانند." msgid "``Enum`` member type" -msgstr "" +msgstr "نوع عضو ``Enum``" -msgid "Enum members are instances of their enum class, and are normally accessed as ``EnumClass.member``. In certain situations, such as writing custom enum behavior, being able to access one member directly from another is useful, and is supported; however, in order to avoid name clashes between member names and attributes/methods from mixed-in classes, upper-case names are strongly recommended." +msgid "" +"Enum members are instances of their enum class, and are normally accessed as" +" ``EnumClass.member``. In certain situations, such as writing custom enum " +"behavior, being able to access one member directly from another is useful, " +"and is supported; however, in order to avoid name clashes between member " +"names and attributes/methods from mixed-in classes, upper-case names are " +"strongly recommended." msgstr "" +"اعضای Enum، نمونه‌هایی از کلاس Enum خود هستند و دسترسی به آن‌ها معمولاً " +"به‌صورت ``EnumClass.member`` انجام می‌شود. در شرایط خاص، مانند نوشتن رفتار " +"سفارشی برای Enum، امکان دسترسی مستقیم به یک عضو از یک عضو دیگر مفید است و " +"پشتیبانی می‌شود؛ با این حال، برای جلوگیری از تداخل نام بین نام‌های اعضا و " +"ویژگی‌ها/متدهای کلاس‌های میکس‌این (mixed-in)، استفاده از نام‌های با حروف بزرگ " +"به‌شدت توصیه می‌شود." msgid "Creating members that are mixed with other data types" -msgstr "" +msgstr "ایجاد اعضایی که با انواع داده دیگر آمیخته شده‌اند" -msgid "When subclassing other data types, such as :class:`int` or :class:`str`, with an :class:`Enum`, all values after the ``=`` are passed to that data type's constructor. For example::" +msgid "" +"When subclassing other data types, such as :class:`int` or :class:`str`, " +"with an :class:`Enum`, all values after the ``=`` are passed to that data " +"type's constructor. For example::" msgstr "" +"هنگام زیرکلاس‌سازی از سایر انواع داده، مانند :class:`int` یا :class:`str`، " +"به‌همراه یک :class:`Enum`، همه‌ی مقادیر بعد از ``=`` به سازنده‌ی آن نوع داده " +"فرستاده می‌شوند. برای مثال::" msgid "" ">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" @@ -1044,26 +1946,49 @@ msgid "" ">>> MyEnum.example.value # and hex(11) is...\n" "17" msgstr "" +">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" +"... example = '11', 16 # so x='11' and base=16\n" +"...\n" +">>> MyEnum.example.value # and hex(11) is...\n" +"17" msgid "Boolean value of ``Enum`` classes and members" -msgstr "" +msgstr "مقدار بولی کلاس‌ها و اعضای ``Enum``" -msgid "Enum classes that are mixed with non-:class:`Enum` types (such as :class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's rules; otherwise, all members evaluate as :data:`True`. To make your own enum's boolean evaluation depend on the member's value add the following to your class::" +msgid "" +"Enum classes that are mixed with non-:class:`Enum` types (such as " +":class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " +"type's rules; otherwise, all members evaluate as :data:`True`. To make your" +" own enum's boolean evaluation depend on the member's value add the " +"following to your class::" msgstr "" +"کلاس‌های Enum که با انواعی غیر از :class:`Enum` (مانند :class:`int`، " +":class:`str` و غیره) آمیخته شده‌اند، بر اساس قواعد نوع افزوده‌شده ارزیابی " +"می‌شوند؛ در غیر این صورت، تمام اعضا به‌عنوان :data:`True` ارزیابی می‌شوند. " +"برای اینکه ارزیابی بولی enum خودتان به مقدار عضو وابسته باشد، موارد زیر را " +"به کلاس خود اضافه کنید::" msgid "" "def __bool__(self):\n" " return bool(self.value)" msgstr "" +"def __bool__(self):\n" +" return bool(self.value)" msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" +"کلاس‌های ساده‌ی :class:`Enum` همیشه به‌عنوان :data:`True` ارزیابی می‌شوند." msgid "``Enum`` classes with methods" -msgstr "" +msgstr "کلاس‌های ``Enum`` دارای متد" -msgid "If you give your enum subclass extra methods, like the `Planet`_ class below, those methods will show up in a :func:`dir` of the member, but not of the class::" +msgid "" +"If you give your enum subclass extra methods, like the `Planet`_ class " +"below, those methods will show up in a :func:`dir` of the member, but not of" +" the class::" msgstr "" +"اگر به زیرکلاس enum خود متدهای اضافی بدهید، مانند کلاس `Planet`_ در زیر، آن " +"متدها در :func:`dir` عضو نمایش داده می‌شوند، اما نه برای کلاس::" msgid "" ">>> dir(Planet)\n" @@ -1071,12 +1996,20 @@ msgid "" ">>> dir(Planet.EARTH)\n" "['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']" msgstr "" +">>> dir(Planet)\n" +"['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" +">>> dir(Planet.EARTH)\n" +"['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']" msgid "Combining members of ``Flag``" -msgstr "" +msgstr "ترکیب اعضای ``Flag``" -msgid "Iterating over a combination of :class:`Flag` members will only return the members that are comprised of a single bit::" +msgid "" +"Iterating over a combination of :class:`Flag` members will only return the " +"members that are comprised of a single bit::" msgstr "" +"پیمایش روی ترکیبی از اعضای :class:`Flag` فقط اعضایی را برمی‌گرداند که از یک " +"بیت تشکیل‌شده‌اند::" msgid "" ">>> class Color(Flag):\n" @@ -1092,12 +2025,24 @@ msgid "" ">>> Color(7) # not named combination\n" "" msgstr "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"... MAGENTA = RED | BLUE\n" +"... YELLOW = RED | GREEN\n" +"... CYAN = GREEN | BLUE\n" +"...\n" +">>> Color(3) # named combination\n" +"\n" +">>> Color(7) # not named combination\n" +"" msgid "``Flag`` and ``IntFlag`` minutia" -msgstr "" +msgstr "ریزجزئیات ``Flag`` و ``IntFlag``" msgid "Using the following snippet for our examples::" -msgstr "" +msgstr "از قطعه‌کد زیر برای مثال‌هایمان استفاده می‌کنیم::" msgid "" ">>> class Color(IntFlag):\n" @@ -1109,26 +2054,40 @@ msgid "" "... WHITE = RED | GREEN | BLUE\n" "..." msgstr "" +">>> class Color(IntFlag):\n" +"... BLACK = 0\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... PURPLE = RED | BLUE\n" +"... WHITE = RED | GREEN | BLUE\n" +"..." msgid "the following are true:" -msgstr "" +msgstr "موارد زیر برقرار است:" msgid "single-bit flags are canonical" -msgstr "" +msgstr "پرچم‌های تک‌بیتی کانونیکال (canonical) هستند" msgid "multi-bit and zero-bit flags are aliases" -msgstr "" +msgstr "پرچم‌های چندبیتی و صفربیتی نام‌های مستعار هستند" msgid "only canonical flags are returned during iteration::" -msgstr "" +msgstr "در حین تکرار، تنها پرچم‌های کانونیکال بازگردانده می‌شوند::" msgid "" ">>> list(Color.WHITE)\n" "[, , ]" msgstr "" +">>> list(Color.WHITE)\n" +"[, , ]" -msgid "negating a flag or flag set returns a new flag/flag set with the corresponding positive integer value::" +msgid "" +"negating a flag or flag set returns a new flag/flag set with the " +"corresponding positive integer value::" msgstr "" +"منفی کردن یک پرچم یا مجموعه پرچم، یک پرچم/مجموعه پرچم جدید با مقدار عدد صحیح" +" مثبت متناظر برمی‌گرداند::" msgid "" ">>> Color.BLUE\n" @@ -1137,9 +2096,14 @@ msgid "" ">>> ~Color.BLUE\n" "" msgstr "" +">>> Color.BLUE\n" +"\n" +"\n" +">>> ~Color.BLUE\n" +"" msgid "names of pseudo-flags are constructed from their members' names::" -msgstr "" +msgstr "نام‌های شبه‌پرچم‌ها (pseudo-flags) از نام اعضای آن‌ها ساخته می‌شوند::" msgid "" ">>> (Color.RED | Color.GREEN).name\n" @@ -1153,9 +2117,21 @@ msgid "" ">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" "True" msgstr "" +">>> (Color.RED | Color.GREEN).name\n" +"'RED|GREEN'\n" +"\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" +"True" msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" +"پرچم‌های چندبیتی، که به نام‌های مستعار نیز شناخته می‌شوند، می‌توانند از " +"عملیات برگردانده شوند::" msgid "" ">>> Color.RED | Color.BLUE\n" @@ -1167,17 +2143,35 @@ msgid "" ">>> Color(0)\n" "" msgstr "" +">>> Color.RED | Color.BLUE\n" +"\n" +"\n" +">>> Color(7) # or Color(-1)\n" +"\n" +"\n" +">>> Color(0)\n" +"" -msgid "membership / containment checking: zero-valued flags are always considered to be contained::" +msgid "" +"membership / containment checking: zero-valued flags are always considered " +"to be contained::" msgstr "" +"بررسی عضویت / شامل بودن: پرچم‌های با مقدار صفر همیشه به‌عنوان شامل‌شده در " +"نظر گرفته می‌شوند::" msgid "" ">>> Color.BLACK in Color.WHITE\n" "True" msgstr "" +">>> Color.BLACK in Color.WHITE\n" +"True" -msgid "otherwise, only if all bits of one flag are in the other flag will True be returned::" +msgid "" +"otherwise, only if all bits of one flag are in the other flag will True be " +"returned::" msgstr "" +"در غیر این صورت، تنها در صورتی True برگردانده می‌شود که تمام بیت‌های یک پرچم" +" در پرچم دیگر وجود داشته باشند::" msgid "" ">>> Color.PURPLE in Color.WHITE\n" @@ -1186,120 +2180,220 @@ msgid "" ">>> Color.GREEN in Color.PURPLE\n" "False" msgstr "" +">>> Color.PURPLE in Color.WHITE\n" +"True\n" +"\n" +">>> Color.GREEN in Color.PURPLE\n" +"False" -msgid "There is a new boundary mechanism that controls how out-of-range / invalid bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" +msgid "" +"There is a new boundary mechanism that controls how out-of-range / invalid " +"bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" +"یک سازوکار مرزی جدید وجود دارد که نحوه‌ی مدیریت بیت‌های خارج از محدوده / " +"نامعتبر را کنترل می‌کند: ``STRICT``، ``CONFORM``، ``EJECT`` و ``KEEP``:" msgid "STRICT --> raises an exception when presented with invalid values" -msgstr "" +msgstr "STRICT --> در صورت ارائه مقادیر نامعتبر، یک استثنا پرتاب می‌کند" msgid "CONFORM --> discards any invalid bits" -msgstr "" +msgstr "CONFORM --> هر بیت نامعتبر را دور می‌اندازد" -msgid "EJECT --> lose Flag status and become a normal int with the given value" +msgid "" +"EJECT --> lose Flag status and become a normal int with the given value" msgstr "" +"EJECT --> وضعیت Flag را از دست می‌دهد و به یک int معمولی با مقدار داده‌شده " +"تبدیل می‌شود" msgid "KEEP --> keep the extra bits" -msgstr "" +msgstr "KEEP --> بیت‌های اضافی را حفظ کنید" msgid "keeps Flag status and extra bits" -msgstr "" +msgstr "وضعیت Flag و بیت‌های اضافی را حفظ می‌کند" msgid "extra bits do not show up in iteration" -msgstr "" +msgstr "بیت‌های اضافی در تکرار ظاهر نمی‌شوند" msgid "extra bits do show up in repr() and str()" -msgstr "" +msgstr "بیت‌های اضافی در repr() و str() نمایش داده می‌شوند." -msgid "The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an example of when ``KEEP`` is needed)." +msgid "" +"The default for Flag is ``STRICT``, the default for ``IntFlag`` is " +"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see " +"``ssl.Options`` for an example of when ``KEEP`` is needed)." msgstr "" +"پیش‌فرض برای Flag برابر ``STRICT`` است، پیش‌فرض برای ``IntFlag`` برابر " +"``EJECT`` است، و پیش‌فرض برای ``_convert_`` برابر ``KEEP`` است (برای " +"نمونه‌ای از زمانی که به ``KEEP`` نیاز است، ``ssl.Options`` را ببینید)." msgid "How are Enums and Flags different?" -msgstr "" +msgstr "Enumها و Flagها چه تفاوتی با هم دارند؟" -msgid "Enums have a custom metaclass that affects many aspects of both derived :class:`Enum` classes and their instances (members)." +msgid "" +"Enums have a custom metaclass that affects many aspects of both derived " +":class:`Enum` classes and their instances (members)." msgstr "" +"Enumها یک فراکلاس سفارشی دارند که بر جنبه‌های زیادی هم از کلاس‌های مشتق‌شده " +"از :class:`Enum` و هم از نمونه‌های آن‌ها (اعضا) تأثیر می‌گذارد." msgid "Enum Classes" -msgstr "" - -msgid "The :class:`EnumType` metaclass is responsible for providing the :meth:`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` and other methods that allow one to do things with an :class:`Enum` class that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in Color``. :class:`EnumType` is responsible for ensuring that various other methods on the final :class:`Enum` class are correct (such as :meth:`~object.__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:`~object.__repr__`)." -msgstr "" +msgstr "کلاس‌های Enum" + +msgid "" +"The :class:`EnumType` metaclass is responsible for providing the " +":meth:`~object.__contains__`, :meth:`~object.__dir__`, " +":meth:`~object.__iter__` and other methods that allow one to do things with " +"an :class:`Enum` class that fail on a typical class, such as ``list(Color)``" +" or ``some_enum_var in Color``. :class:`EnumType` is responsible for " +"ensuring that various other methods on the final :class:`Enum` class are " +"correct (such as :meth:`~object.__new__`, :meth:`~object.__getnewargs__`, " +":meth:`~object.__str__` and :meth:`~object.__repr__`)." +msgstr "" +"فراکلاس :class:`EnumType` مسئول فراهم کردن :meth:`~object.__contains__`، " +":meth:`~object.__dir__`، :meth:`~object.__iter__` و سایر متدهایی است که به " +"شما اجازه می‌دهند با یک کلاس :class:`Enum` کارهایی را انجام دهید که در یک " +"کلاس معمولی با شکست مواجه می‌شوند، مانند ``list(Color)`` یا ``some_enum_var " +"in Color``. :class:`EnumType` مسئول اطمینان از صحیح بودن سایر متدهای " +"گوناگون کلاس :class:`Enum` نهایی است (مانند :meth:`~object.__new__`، " +":meth:`~object.__getnewargs__`، :meth:`~object.__str__` و " +":meth:`~object.__repr__`)." msgid "Flag Classes" -msgstr "" +msgstr "کلاس‌های Flag" -msgid "Flags have an expanded view of aliasing: to be canonical, the value of a flag needs to be a power-of-two value, and not a duplicate name. So, in addition to the :class:`Enum` definition of alias, a flag with no value (a.k.a. ``0``) or with more than one power-of-two value (e.g. ``3``) is considered an alias." +msgid "" +"Flags have an expanded view of aliasing: to be canonical, the value of a " +"flag needs to be a power-of-two value, and not a duplicate name. So, in " +"addition to the :class:`Enum` definition of alias, a flag with no value " +"(a.k.a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " +"considered an alias." msgstr "" +"پرچم‌ها نگاه گسترده‌تری به نام‌مستعارسازی دارند: برای اینکه یک پرچم کانونیکال " +"باشد، مقدار آن باید یک مقدار توانی از دو باشد و نام آن تکراری نباشد. " +"بنابراین، علاوه بر تعریف نام‌مستعار در :class:`Enum`، پرچمی بدون مقدار (یعنی" +" ``0``) یا دارای بیش از یک مقدار توانی از دو (مثلاً ``3``) یک نام‌مستعار " +"محسوب می‌شود." msgid "Enum Members (aka instances)" -msgstr "" +msgstr "اعضای Enum (معروف به نمونه‌ها)" -msgid "The most interesting thing about enum members is that they are singletons. :class:`EnumType` creates them all while it is creating the enum class itself, and then puts a custom :meth:`~object.__new__` in place to ensure that no new ones are ever instantiated by returning only the existing member instances." +msgid "" +"The most interesting thing about enum members is that they are singletons. " +":class:`EnumType` creates them all while it is creating the enum class " +"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " +"that no new ones are ever instantiated by returning only the existing member" +" instances." msgstr "" +"جالب‌ترین نکته در مورد اعضای enum این است که آن‌ها تک‌نمونه هستند. " +":class:`EnumType` تمام آن‌ها را در حین ایجاد خود کلاس enum می‌سازد و سپس یک " +":meth:`~object.__new__` سفارشی را جایگزین می‌کند تا با بازگرداندن تنها " +"نمونه‌های موجودِ اعضا، اطمینان حاصل شود که هرگز نمونه‌های جدیدی ایجاد " +"نمی‌شوند." msgid "Flag Members" -msgstr "" +msgstr "اعضای Flag" -msgid "Flag members can be iterated over just like the :class:`Flag` class, and only the canonical members will be returned. For example::" +msgid "" +"Flag members can be iterated over just like the :class:`Flag` class, and " +"only the canonical members will be returned. For example::" msgstr "" +"می‌توان اعضای Flag را درست مانند کلاس :class:`Flag` پیمایش کرد، و فقط اعضای " +"کانونیکال (canonical) برگردانده می‌شوند. برای مثال::" msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" +">>> list(Color)\n" +"[, , ]" msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" +"(توجه داشته باشید که ``BLACK``، ``PURPLE`` و ``WHITE`` نمایش داده نمی‌شوند.)" -msgid "Inverting a flag member returns the corresponding positive value, rather than a negative value --- for example::" +msgid "" +"Inverting a flag member returns the corresponding positive value, rather " +"than a negative value --- for example::" msgstr "" +"وارونه کردن یک عضو پرچم، مقدار مثبت متناظر را برمی‌گرداند، نه یک مقدار منفی " +"--- برای مثال::" msgid "" ">>> ~Color.RED\n" "" msgstr "" +">>> ~Color.RED\n" +"" -msgid "Flag members have a length corresponding to the number of power-of-two values they contain. For example::" +msgid "" +"Flag members have a length corresponding to the number of power-of-two " +"values they contain. For example::" msgstr "" +"طول اعضای Flag با تعداد مقادیر توان ۲ موجود در آن‌ها متناظر است. برای مثال::" msgid "" ">>> len(Color.PURPLE)\n" "2" msgstr "" +">>> len(Color.PURPLE)\n" +"2" msgid "Enum Cookbook" -msgstr "" +msgstr "کتاب آشپزی Enum" -msgid "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :class:`IntFlag` are expected to cover the majority of use-cases, they cannot cover them all. Here are recipes for some different types of enumerations that can be used directly, or as examples for creating one's own." +msgid "" +"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and " +":class:`IntFlag` are expected to cover the majority of use-cases, they " +"cannot cover them all. Here are recipes for some different types of " +"enumerations that can be used directly, or as examples for creating one's " +"own." msgstr "" +"اگرچه انتظار می‌رود :class:`Enum`، :class:`IntEnum`، :class:`StrEnum`، " +":class:`Flag` و :class:`IntFlag` اکثر موارد استفاده را پوشش دهند، اما " +"نمی‌توانند همه‌ی آن‌ها را پوشش دهند. در اینجا دستورالعمل‌هایی برای چند نوع " +"مختلف از شمارش‌ها آورده شده است که می‌توانند مستقیماً استفاده شوند، یا " +"به‌عنوان نمونه‌هایی برای ایجاد شمارش‌های خودتان به کار روند." msgid "Omitting values" -msgstr "" +msgstr "حذف مقادیر" -msgid "In many use-cases, one doesn't care what the actual value of an enumeration is. There are several ways to define this type of simple enumeration:" +msgid "" +"In many use-cases, one doesn't care what the actual value of an enumeration " +"is. There are several ways to define this type of simple enumeration:" msgstr "" +"در بسیاری از موارد استفاده، اهمیت ندارد که مقدار واقعی یک شمارش چه باشد. " +"چندین روش برای تعریف این نوع از شمارش ساده وجود دارد:" msgid "use instances of :class:`auto` for the value" -msgstr "" +msgstr "از نمونه‌های :class:`auto` برای مقدار استفاده کنید" msgid "use instances of :class:`object` as the value" -msgstr "" +msgstr "از نمونه‌های :class:`object` به‌عنوان مقدار استفاده کنید" msgid "use a descriptive string as the value" -msgstr "" +msgstr "از یک رشته توصیفی به‌عنوان مقدار استفاده کنید" -msgid "use a tuple as the value and a custom :meth:`~object.__new__` to replace the tuple with an :class:`int` value" +msgid "" +"use a tuple as the value and a custom :meth:`~object.__new__` to replace the" +" tuple with an :class:`int` value" msgstr "" +"از یک تاپل به‌عنوان مقدار و از یک :meth:`~object.__new__` سفارشی برای " +"جایگزینی تاپل با یک مقدار :class:`int` استفاده کنید" -msgid "Using any of these methods signifies to the user that these values are not important, and also enables one to add, remove, or reorder members without having to renumber the remaining members." +msgid "" +"Using any of these methods signifies to the user that these values are not " +"important, and also enables one to add, remove, or reorder members without " +"having to renumber the remaining members." msgstr "" +"استفاده از هر یک از این متدها به کاربر نشان می‌دهد که این مقادیر اهمیت " +"ندارند، و همچنین به شما امکان می‌دهد که اعضا را بدون نیاز به شماره‌گذاری " +"مجدد اعضای باقی‌مانده، اضافه، حذف یا مرتب‌سازی مجدد کنید." msgid "Using :class:`auto`" -msgstr "" +msgstr "استفاده از :class:`auto`" msgid "Using :class:`auto` would look like::" -msgstr "" +msgstr "استفاده از :class:`auto` به این شکل خواهد بود::" msgid "" ">>> class Color(Enum):\n" @@ -1310,12 +2404,19 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.GREEN\n" +"" msgid "Using :class:`object`" -msgstr "" +msgstr "استفاده از :class:`object`" msgid "Using :class:`object` would look like::" -msgstr "" +msgstr "استفاده از :class:`object` به این شکل خواهد بود::" msgid "" ">>> class Color(Enum):\n" @@ -1326,9 +2427,20 @@ msgid "" ">>> Color.GREEN\n" ">" msgstr "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"...\n" +">>> Color.GREEN\n" +">" -msgid "This is also a good example of why you might want to write your own :meth:`~object.__repr__`::" +msgid "" +"This is also a good example of why you might want to write your own " +":meth:`~object.__repr__`::" msgstr "" +"این نیز مثال خوبی است از اینکه چرا ممکن است بخواهید :meth:`~object.__repr__`" +" خودتان را بنویسید::" msgid "" ">>> class Color(Enum):\n" @@ -1341,12 +2453,21 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"... def __repr__(self):\n" +"... return \"<%s.%s>\" % (self.__class__.__name__, self._name_)\n" +"...\n" +">>> Color.GREEN\n" +"" msgid "Using a descriptive string" -msgstr "" +msgstr "استفاده از یک رشته توصیفی" msgid "Using a string as the value would look like::" -msgstr "" +msgstr "استفاده از یک رشته به‌عنوان مقدار به این شکل خواهد بود::" msgid "" ">>> class Color(Enum):\n" @@ -1357,12 +2478,21 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class Color(Enum):\n" +"... RED = 'stop'\n" +"... GREEN = 'go'\n" +"... BLUE = 'too fast!'\n" +"...\n" +">>> Color.GREEN\n" +"" msgid "Using a custom :meth:`~object.__new__`" -msgstr "" +msgstr "استفاده از :meth:`~object.__new__` سفارشی" msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" msgstr "" +"استفاده از یک :meth:`~object.__new__` با شماره‌گذاری خودکار به این شکل خواهد" +" بود::" msgid "" ">>> class AutoNumber(Enum):\n" @@ -1380,9 +2510,27 @@ msgid "" ">>> Color.GREEN\n" "" msgstr "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls):\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"...\n" +">>> class Color(AutoNumber):\n" +"... RED = ()\n" +"... GREEN = ()\n" +"... BLUE = ()\n" +"...\n" +">>> Color.GREEN\n" +"" -msgid "To make a more general purpose ``AutoNumber``, add ``*args`` to the signature::" +msgid "" +"To make a more general purpose ``AutoNumber``, add ``*args`` to the " +"signature::" msgstr "" +"برای ساخت یک ``AutoNumber`` با کاربرد عمومی‌تر، ``*args`` را به امضا اضافه " +"کنید::" msgid "" ">>> class AutoNumber(Enum):\n" @@ -1393,9 +2541,20 @@ msgid "" "... return obj\n" "..." msgstr "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls, *args): # this is the only change from above\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"..." -msgid "Then when you inherit from ``AutoNumber`` you can write your own ``__init__`` to handle any extra arguments::" +msgid "" +"Then when you inherit from ``AutoNumber`` you can write your own " +"``__init__`` to handle any extra arguments::" msgstr "" +"سپس وقتی از ``AutoNumber`` ارث می‌برید، می‌توانید ``__init__`` خودتان را " +"بنویسید تا آرگومان‌های اضافی را مدیریت کند::" msgid "" ">>> class Swatch(AutoNumber):\n" @@ -1412,21 +2571,51 @@ msgid "" ">>> Swatch.BLEACHED_CORAL.pantone\n" "'unknown'" msgstr "" +">>> class Swatch(AutoNumber):\n" +"... def __init__(self, pantone='unknown'):\n" +"... self.pantone = pantone\n" +"... AUBURN = '3497'\n" +"... SEA_GREEN = '1246'\n" +"... BLEACHED_CORAL = () # New color, no Pantone code yet!\n" +"...\n" +">>> Swatch.SEA_GREEN\n" +"\n" +">>> Swatch.SEA_GREEN.pantone\n" +"'1246'\n" +">>> Swatch.BLEACHED_CORAL.pantone\n" +"'unknown'" -msgid "The :meth:`~object.__new__` method, if defined, is used during creation of the Enum members; it is then replaced by Enum's :meth:`~object.__new__` which is used after class creation for lookup of existing members." +msgid "" +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members." msgstr "" +"متد :meth:`~object.__new__`، در صورت تعریف شدن، در هنگام ایجاد اعضای Enum " +"استفاده می‌شود؛ سپس با :meth:`~object.__new__` مربوط به Enum جایگزین می‌شود " +"که پس از ایجاد کلاس برای جست‌وجوی اعضای موجود استفاده می‌شود." -msgid "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the one that is found; instead, use the data type directly -- e.g.::" +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly -- e.g.::" msgstr "" +"``super().__new__()`` را *فراخوانی نکنید*، زیرا ``__new__``\\ فقط برای جستج" +"و همان چیزی است که پیدا می‌شود؛ در عوض، مستقیماً از نوع داده استفاده کنید -" +"- مثلاً::" msgid "obj = int.__new__(cls, value)" -msgstr "" +msgstr "obj = int.__new__(cls, value)" msgid "OrderedEnum" -msgstr "" +msgstr "OrderedEnum" -msgid "An ordered enumeration that is not based on :class:`IntEnum` and so maintains the normal :class:`Enum` invariants (such as not being comparable to other enumerations)::" +msgid "" +"An ordered enumeration that is not based on :class:`IntEnum` and so " +"maintains the normal :class:`Enum` invariants (such as not being comparable " +"to other enumerations)::" msgstr "" +"یک شمارش ترتیب‌دار که مبتنی بر :class:`IntEnum` نیست و بنابراین ویژگی‌های " +"ناورداهای معمول :class:`Enum` را حفظ می‌کند (مانند قابل‌مقایسه نبودن با " +"سایر شمارش‌ها)::" msgid "" ">>> class OrderedEnum(Enum):\n" @@ -1457,12 +2646,43 @@ msgid "" ">>> Grade.C < Grade.A\n" "True" msgstr "" +">>> class OrderedEnum(Enum):\n" +"... def __ge__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value >= other.value\n" +"... return NotImplemented\n" +"... def __gt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value > other.value\n" +"... return NotImplemented\n" +"... def __le__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value <= other.value\n" +"... return NotImplemented\n" +"... def __lt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value < other.value\n" +"... return NotImplemented\n" +"...\n" +">>> class Grade(OrderedEnum):\n" +"... A = 5\n" +"... B = 4\n" +"... C = 3\n" +"... D = 2\n" +"... F = 1\n" +"...\n" +">>> Grade.C < Grade.A\n" +"True" msgid "DuplicateFreeEnum" -msgstr "" +msgstr "DuplicateFreeEnum" -msgid "Raises an error if a duplicate member value is found instead of creating an alias::" +msgid "" +"Raises an error if a duplicate member value is found instead of creating an " +"alias::" msgstr "" +"در صورت یافتن مقدار تکراری برای یک عضو، به‌جای ایجاد نام مستعار، یک خطا " +"پرتاب می‌کند::" msgid "" ">>> class DuplicateFreeEnum(Enum):\n" @@ -1485,15 +2705,41 @@ msgid "" " ...\n" "ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" msgstr "" +">>> class DuplicateFreeEnum(Enum):\n" +"... def __init__(self, *args):\n" +"... cls = self.__class__\n" +"... if any(self.value == e.value for e in cls):\n" +"... a = self.name\n" +"... e = cls(self.value).name\n" +"... raise ValueError(\n" +"... \"aliases not allowed in DuplicateFreeEnum: %r --> %r\"\n" +"... % (a, e))\n" +"...\n" +">>> class Color(DuplicateFreeEnum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... GRENE = 2\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" -msgid "This is a useful example for subclassing Enum to add or change other behaviors as well as disallowing aliases. If the only desired change is disallowing aliases, the :func:`unique` decorator can be used instead." +msgid "" +"This is a useful example for subclassing Enum to add or change other " +"behaviors as well as disallowing aliases. If the only desired change is " +"disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" +"این مثال مفیدی برای زیرکلاس‌سازی از Enum به‌منظور افزودن یا تغییر سایر " +"رفتارها و همچنین غیرمجاز کردن نام‌های مستعار است. اگر تنها تغییر مورد نظر " +"غیرمجاز کردن نام‌های مستعار باشد، می‌توان به‌جای آن از دکوراتور " +":func:`unique` استفاده کرد." msgid "MultiValueEnum" -msgstr "" +msgstr "MultiValueEnum" msgid "Supports having more than one value per member::" -msgstr "" +msgstr "از داشتن بیش از یک مقدار برای هر عضو پشتیبانی می‌کند::" msgid "" ">>> class MultiValueEnum(Enum):\n" @@ -1513,12 +2759,32 @@ msgid "" ">>> DType(9)\n" "" msgstr "" +">>> class MultiValueEnum(Enum):\n" +"... def __new__(cls, value, *values):\n" +"... self = object.__new__(cls)\n" +"... self._value_ = value\n" +"... for v in values:\n" +"... self._add_value_alias_(v)\n" +"... return self\n" +"...\n" +">>> class DType(MultiValueEnum):\n" +"... float32 = 'f', 8\n" +"... double64 = 'd', 9\n" +"...\n" +">>> DType('f')\n" +"\n" +">>> DType(9)\n" +"" msgid "Planet" -msgstr "" +msgstr "سیاره" -msgid "If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value of the enum member will be passed to those methods::" +msgid "" +"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value" +" of the enum member will be passed to those methods::" msgstr "" +"اگر :meth:`~object.__new__` یا :meth:`~object.__init__` تعریف شده باشد، " +"مقدار عضو enum به آن متدها پاس داده می‌شود::" msgid "" ">>> class Planet(Enum):\n" @@ -1544,12 +2810,34 @@ msgid "" ">>> Planet.EARTH.surface_gravity\n" "9.802652743337129" msgstr "" +">>> class Planet(Enum):\n" +"... MERCURY = (3.303e+23, 2.4397e6)\n" +"... VENUS = (4.869e+24, 6.0518e6)\n" +"... EARTH = (5.976e+24, 6.37814e6)\n" +"... MARS = (6.421e+23, 3.3972e6)\n" +"... JUPITER = (1.9e+27, 7.1492e7)\n" +"... SATURN = (5.688e+26, 6.0268e7)\n" +"... URANUS = (8.686e+25, 2.5559e7)\n" +"... NEPTUNE = (1.024e+26, 2.4746e7)\n" +"... def __init__(self, mass, radius):\n" +"... self.mass = mass # in kilograms\n" +"... self.radius = radius # in meters\n" +"... @property\n" +"... def surface_gravity(self):\n" +"... # universal gravitational constant (m3 kg-1 s-2)\n" +"... G = 6.67300E-11\n" +"... return G * self.mass / (self.radius * self.radius)\n" +"...\n" +">>> Planet.EARTH.value\n" +"(5.976e+24, 6378140.0)\n" +">>> Planet.EARTH.surface_gravity\n" +"9.802652743337129" msgid "TimePeriod" -msgstr "" +msgstr "TimePeriod" msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" -msgstr "" +msgstr "مثالی برای نمایش ویژگی :attr:`~Enum._ignore_` در حال استفاده::" msgid "" ">>> import datetime as dt\n" @@ -1565,9 +2853,28 @@ msgid "" ">>> list(Period)[-2:]\n" "[, ]" msgstr "" +">>> import datetime as dt\n" +">>> class Period(dt.timedelta, Enum):\n" +"... \"different lengths of time\"\n" +"... _ignore_ = 'Period i'\n" +"... Period = vars()\n" +"... for i in range(367):\n" +"... Period['day_%d' % i] = i\n" +"...\n" +">>> list(Period)[:2]\n" +"[, ]\n" +">>> list(Period)[-2:]\n" +"[, ]" msgid "Subclassing EnumType" -msgstr "" +msgstr "زیرکلاس‌سازی از EnumType" -msgid "While most enum needs can be met by customizing :class:`Enum` subclasses, either with class decorators or custom functions, :class:`EnumType` can be subclassed to provide a different Enum experience." +msgid "" +"While most enum needs can be met by customizing :class:`Enum` subclasses, " +"either with class decorators or custom functions, :class:`EnumType` can be " +"subclassed to provide a different Enum experience." msgstr "" +"اگرچه بیشتر نیازهای مربوط به enum را می‌توان با سفارشی‌سازی زیرکلاس‌های " +":class:`Enum`، چه با دکوراتورهای کلاس و چه با توابع سفارشی، برطرف کرد، " +"می‌توان از :class:`EnumType` نیز زیرکلاس ساخت تا تجربه‌ای متفاوت از Enum " +"ارائه شود." diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index 05ee711c9..501df2f2e 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2024-06-20 06:42+0000\n" +"PO-Revision-Date: 2026-08-28 10:54+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,42 +22,91 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "C API Extension Support for Free Threading" -msgstr "" +msgstr "پشتیبانی افزونه‌های C API از نخ‌بندی آزاد (Free Threading)" -msgid "Starting with the 3.13 release, CPython has support for running with the :term:`global interpreter lock` (GIL) disabled in a configuration called :term:`free threading`. This document describes how to adapt C API extensions to support free threading." +msgid "" +"Starting with the 3.13 release, CPython has support for running with " +"the :term:`global interpreter lock` (GIL) disabled in a configuration " +"called :term:`free threading`. This document describes how to adapt C API " +"extensions to support free threading." msgstr "" +"از نسخه‌ی 3.13 به بعد، CPython از اجرا در پیکربندی‌ای به نام :term:`free " +"threading ` پشتیبانی می‌کند که در آن :term:`global " +"interpreter lock ` (GIL) غیرفعال است. این سند نحوه‌ی سازگار " +"کردن افزونه‌های C API برای پشتیبانی از free threading را توضیح می‌دهد." msgid "Identifying the Free-Threaded Build in C" -msgstr "" +msgstr "شناسایی ساخت نخ‌آزادی در C" -msgid "The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-threaded build it's defined to ``1``, and in the regular build it's not defined. You can use it to enable code that only runs under the free-threaded build::" +msgid "" +"The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-" +"threaded build it's defined to ``1``, and in the regular build it's not " +"defined. You can use it to enable code that only runs under the free-" +"threaded build::" msgstr "" +"API زبان C در CPython ماکروی ``Py_GIL_DISABLED`` را در معرض قرار می‌دهد: در " +"ساخت نخ‌آزاد (free-threaded build) به مقدار ``1`` تعریف شده است و در ساخت " +"معمولی تعریف نشده است. می‌توانید از آن برای فعال کردن کدی استفاده کنید که " +"فقط در ساخت نخ‌آزاد اجرا می‌شود::" msgid "" "#ifdef Py_GIL_DISABLED\n" "/* code that only runs in the free-threaded build */\n" "#endif" msgstr "" +"#ifdef Py_GIL_DISABLED\n" +"/* code that only runs in the free-threaded build */\n" +"#endif" -msgid "On Windows, this macro is not defined automatically, but must be specified to the compiler when building. The :func:`sysconfig.get_config_var` function can be used to determine whether the current running interpreter had the macro defined." +msgid "" +"On Windows, this macro is not defined automatically, but must be specified " +"to the compiler when building. The :func:`sysconfig.get_config_var` " +"function can be used to determine whether the current running interpreter " +"had the macro defined." msgstr "" +"در ویندوز، این ماکرو به‌طور خودکار تعریف نمی‌شود، بلکه باید هنگام ساخت به " +"کامپایلر اعلام شود. برای تشخیص این‌که آیا این ماکرو در مفسر در حال اجرای " +"فعلی تعریف شده است یا نه، می‌توانید از تابع :func:`sysconfig.get_config_var` " +"استفاده کنید." msgid "Module Initialization" -msgstr "" +msgstr "مقداردهی اولیه ماژول" -msgid "Extension modules need to explicitly indicate that they support running with the GIL disabled; otherwise importing the extension will raise a warning and enable the GIL at runtime." +msgid "" +"Extension modules need to explicitly indicate that they support running " +"with the GIL disabled; otherwise importing the extension will raise a " +"warning and enable the GIL at runtime." msgstr "" +"ماژول‌های الحاقی باید به‌صراحت اعلام کنند که از اجرا با GIL غیرفعال پشتیبانی " +"می‌کنند؛ در غیر این صورت، ایمپورت کردن ماژول الحاقی باعث پرتاب یک هشدار " +"می‌شود و GIL را در ران‌تایم فعال می‌کند." -msgid "There are two ways to indicate that an extension module supports running with the GIL disabled depending on whether the extension uses multi-phase or single-phase initialization." +msgid "" +"There are two ways to indicate that an extension module supports running " +"with the GIL disabled depending on whether the extension uses multi-phase " +"or single-phase initialization." msgstr "" +"بسته به اینکه یک ماژول توسعه از مقداردهی اولیه‌ی چندمرحله‌ای یا تک‌مرحله‌ای " +"استفاده کند، دو روش برای نشان دادن پشتیبانی آن از اجرا با GIL غیرفعال وجود " +"دارد." msgid "Multi-Phase Initialization" -msgstr "" +msgstr "مقداردهی اولیه‌ی چندمرحله‌ای" -msgid "Extensions that use multi-phase initialization (i.e., :c:func:`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the module definition. If your extension supports older versions of CPython, you should guard the slot with a :c:data:`PY_VERSION_HEX` check." +msgid "" +"Extensions that use multi-phase initialization " +"(i.e., :c:func:`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot " +"in the module definition. If your extension supports older versions of " +"CPython, you should guard the slot with a :c:data:`PY_VERSION_HEX` check." msgstr "" +"افزونه‌هایی که از مقداردهی اولیه چندمرحله‌ای " +"(یعنی :c:func:`PyModuleDef_Init`) استفاده می‌کنند، باید یک جایگاه " +"(slot) :c:data:`Py_mod_gil` در تعریف ماژول اضافه کنند. اگر افزونه‌ی شما از " +"نسخه‌های قدیمی‌تر CPython پشتیبانی می‌کند، باید این جایگاه را با یک " +"بررسی :c:data:`PY_VERSION_HEX` محافظت کنید." msgid "" "static struct PyModuleDef_Slot module_slots[] = {\n" @@ -74,12 +123,37 @@ msgid "" " ...\n" "};" msgstr "" +"static struct PyModuleDef_Slot module_slots[] = {\n" +" ...\n" +"#if PY_VERSION_HEX >= 0x030D0000\n" +" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" +"#endif\n" +" {0, NULL}\n" +"};\n" +"\n" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_slots = module_slots,\n" +" ...\n" +"};" msgid "Single-Phase Initialization" -msgstr "" +msgstr "مقداردهی اولیه‌ی تک‌مرحله‌ای" -msgid "Extensions that use single-phase initialization (i.e., :c:func:`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to indicate that they support running with the GIL disabled. The function is only defined in the free-threaded build, so you should guard the call with ``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build." -msgstr "" +msgid "" +"Extensions that use single-phase initialization " +"(i.e., :c:func:`PyModule_Create`) should " +"call :c:func:`PyUnstable_Module_SetGIL` to indicate that they support " +"running with the GIL disabled. The function is only defined in the free-" +"threaded build, so you should guard the call with ``#ifdef " +"Py_GIL_DISABLED`` to avoid compilation errors in the regular build." +msgstr "" +"افزونه‌هایی که از راه‌اندازی تک‌مرحله‌ای (یعنی :c:func:`PyModule_Create`) " +"استفاده می‌کنند، باید :c:func:`PyUnstable_Module_SetGIL` را فراخوانی کنند تا " +"نشان دهند که از اجرا با GIL غیرفعال پشتیبانی می‌کنند. این تابع فقط در ساخت " +"آزادنخیتعریف شده است، بنابراین باید فراخوانی را با " +"``#ifdef Py_GIL_DISABLED`` محافظت کنید تا از خطاهای کامپایل در ساخت معمولی " +"جلوگیری شود." msgid "" "static struct PyModuleDef moduledef = {\n" @@ -100,33 +174,90 @@ msgid "" " return m;\n" "}" msgstr "" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_mymodule(void)\n" +"{\n" +" PyObject *m = PyModule_Create(&moduledef);\n" +" if (m == NULL) {\n" +" return NULL;\n" +" }\n" +"#ifdef Py_GIL_DISABLED\n" +" PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);\n" +"#endif\n" +" return m;\n" +"}" msgid "General API Guidelines" -msgstr "" +msgstr "دستورالعمل‌های کلی API" msgid "Most of the C API is thread-safe, but there are some exceptions." -msgstr "" +msgstr "بیشتر C API ایمن در برابر نخ است، اما استثناهایی وجود دارد." -msgid "**Struct Fields**: Accessing fields in Python C API objects or structs directly is not thread-safe if the field may be concurrently modified." +msgid "" +"**Struct Fields**: Accessing fields in Python C API objects or structs " +"directly is not thread-safe if the field may be concurrently modified." msgstr "" +"**فیلدهای ساختار**: دسترسی مستقیم به فیلدها در اشیاء یا ساختارهای Python C " +"API، اگر فیلد ممکن است به‌طور همزمان تغییر کند، ایمن در برابر نخ نیست." -msgid "**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`, :c:macro:`PyList_SET_ITEM`, and macros like :c:macro:`PySequence_Fast_GET_SIZE` that use the object returned by :c:func:`PySequence_Fast` do not perform any error checking or locking. These macros are not thread-safe if the container object may be modified concurrently." -msgstr "" +msgid "" +"**Macros**: Accessor macros " +"like :c:macro:`PyList_GET_ITEM`, :c:macro:`PyList_SET_ITEM`, and macros " +"like :c:macro:`PySequence_Fast_GET_SIZE` that use the object returned " +"by :c:func:`PySequence_Fast` do not perform any error checking or locking. " +"These macros are not thread-safe if the container object may be modified " +"concurrently." +msgstr "" +"**ماکروها**: ماکروهای دسترسی‌گر " +"مانند :c:macro:`PyList_GET_ITEM`، :c:macro:`PyList_SET_ITEM` و ماکروهایی " +"مانند :c:macro:`PySequence_Fast_GET_SIZE` که از شیء برگردانده‌شده " +"توسط :c:func:`PySequence_Fast` استفاده می‌کنند، هیچ‌گونه بررسی خطا یا " +"قفل‌گذاری‌ای انجام نمی‌دهند. این ماکروها ایمن در برابر نخ (thread-safe) نیستند " +"اگر ممکن باشد شیء نگهدارنده همزمان تغییر داده شود." -msgid "**Borrowed References**: C API functions that return :term:`borrowed references ` may not be thread-safe if the containing object is modified concurrently. See the section on :ref:`borrowed references ` for more information." +msgid "" +"**Borrowed References**: C API functions that return :term:`borrowed " +"references ` may not be thread-safe if the containing " +"object is modified concurrently. See the section on :ref:`borrowed " +"references ` for more information." msgstr "" +"**ارجاع‌های قرضی**: توابع C API که :term:`ارجاع‌های قرضی ` را برمی‌گردانند، ممکن است در صورتی که شیء دربردارنده به‌طور " +"همزمان تغییر کند، ایمن در برابر نخ نباشند. برای اطلاعات بیشتر، " +"بخش :ref:`ارجاع‌های قرضی ` را ببینید." msgid "Container Thread Safety" -msgstr "" +msgstr "ایمنی نخ در ظرف" -msgid "Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:struct:`PySetObject` perform internal locking in the free-threaded build. For example, the :c:func:`PyList_Append` will lock the list before appending an item." +msgid "" +"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, " +"and :c:struct:`PySetObject` perform internal locking in the free-threaded " +"build. For example, the :c:func:`PyList_Append` will lock the list before " +"appending an item." msgstr "" +"ظرف‌هایی مانند :c:struct:`PyListObject`، :c:struct:`PyDictObject` " +"و :c:struct:`PySetObject` در ساخت آزادنخیقفل‌گذاری داخلی " +"انجام می‌دهند. برای مثال، :c:func:`PyList_Append` پیش از افزودن یک آیتم، " +"فهرست را قفل می‌کند." msgid "``PyDict_Next``" -msgstr "" +msgstr "``PyDict_Next``" -msgid "A notable exception is :c:func:`PyDict_Next`, which does not lock the dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect the dictionary while iterating over it if the dictionary may be concurrently modified::" +msgid "" +"A notable exception is :c:func:`PyDict_Next`, which does not lock the " +"dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect " +"the dictionary while iterating over it if the dictionary may be " +"concurrently modified::" msgstr "" +"یک استثنای قابل‌توجه :c:func:`PyDict_Next` است، که دیکشنری را قفل نمی‌کند. " +"اگر ممکن است دیکشنری به‌صورت همزمان تغییر داده شود، شما باید برای محافظت از " +"دیکشنری در حین پیمایش آن از :c:macro:`Py_BEGIN_CRITICAL_SECTION` استفاده " +"کنید::" msgid "" "Py_BEGIN_CRITICAL_SECTION(dict);\n" @@ -137,156 +268,305 @@ msgid "" "}\n" "Py_END_CRITICAL_SECTION();" msgstr "" +"Py_BEGIN_CRITICAL_SECTION(dict);\n" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"while (PyDict_Next(dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" msgid "Borrowed References" -msgstr "" +msgstr "ارجاع‌های قرضی" -msgid "Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is modified concurrently. For example, it's not safe to use :c:func:`PyList_GetItem` if the list may be modified concurrently." +msgid "" +"Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " +"modified concurrently. For example, it's not safe to " +"use :c:func:`PyList_GetItem` if the list may be modified concurrently." msgstr "" +"برخی از توابع C API، :term:`ارجاع‌های قرضی ` را " +"بازمی‌گردانند. این APIها در صورتی که شیء حاوی آن‌ها به‌طور همزمان تغییر کند، " +"ایمن در برابر نخ نیستند. برای مثال، اگر ممکن است فهرست به‌طور همزمان تغییر " +"کند، استفاده از :c:func:`PyList_GetItem` ایمن نیست." -msgid "The following table lists some borrowed reference APIs and their replacements that return :term:`strong references `." +msgid "" +"The following table lists some borrowed reference APIs and their " +"replacements that return :term:`strong references `." msgstr "" +"جدول زیر برخی APIهای ارجاع قرضی (borrowed reference) و جایگزین‌های آن‌ها را " +"که :term:`ارجاع‌های قوی ` را برمی‌گردانند، فهرست می‌کند." msgid "Borrowed reference API" -msgstr "" +msgstr "API ارجاع قرضی" msgid "Strong reference API" -msgstr "" +msgstr "API ارجاع قوی" msgid ":c:func:`PyList_GetItem`" -msgstr "" +msgstr ":c:func:`PyList_GetItem`" msgid ":c:func:`PyList_GetItemRef`" -msgstr "" +msgstr ":c:func:`PyList_GetItemRef`" msgid ":c:func:`PyList_GET_ITEM`" -msgstr "" +msgstr ":c:func:`PyList_GET_ITEM`" msgid ":c:func:`PyDict_GetItem`" -msgstr "" +msgstr ":c:func:`PyDict_GetItem`" msgid ":c:func:`PyDict_GetItemRef`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemRef`" msgid ":c:func:`PyDict_GetItemWithError`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemWithError`" msgid ":c:func:`PyDict_GetItemString`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemString`" msgid ":c:func:`PyDict_GetItemStringRef`" -msgstr "" +msgstr ":c:func:`PyDict_GetItemStringRef`" msgid ":c:func:`PyDict_SetDefault`" -msgstr "" +msgstr ":c:func:`PyDict_SetDefault`" msgid ":c:func:`PyDict_SetDefaultRef`" -msgstr "" +msgstr ":c:func:`PyDict_SetDefaultRef`" msgid ":c:func:`PyDict_Next`" -msgstr "" +msgstr ":c:func:`PyDict_Next`" msgid "none (see :ref:`PyDict_Next`)" -msgstr "" +msgstr "هیچ (به :ref:`PyDict_Next` رجوع کنید)" msgid ":c:func:`PyWeakref_GetObject`" -msgstr "" +msgstr ":c:func:`PyWeakref_GetObject`" msgid ":c:func:`PyWeakref_GetRef`" -msgstr "" +msgstr ":c:func:`PyWeakref_GetRef`" msgid ":c:func:`PyWeakref_GET_OBJECT`" -msgstr "" +msgstr ":c:func:`PyWeakref_GET_OBJECT`" msgid ":c:func:`PyImport_AddModule`" -msgstr "" +msgstr ":c:func:`PyImport_AddModule`" msgid ":c:func:`PyImport_AddModuleRef`" -msgstr "" +msgstr ":c:func:`PyImport_AddModuleRef`" msgid ":c:func:`PyCell_GET`" -msgstr "" +msgstr ":c:func:`PyCell_GET`" msgid ":c:func:`PyCell_Get`" -msgstr "" +msgstr ":c:func:`PyCell_Get`" -msgid "Not all APIs that return borrowed references are problematic. For example, :c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, not all uses of the above APIs are problematic. For example, :c:func:`PyDict_GetItem` is often used for parsing keyword argument dictionaries in function calls; those keyword argument dictionaries are effectively private (not accessible by other threads), so using borrowed references in that context is safe." -msgstr "" +msgid "" +"Not all APIs that return borrowed references are problematic. For " +"example, :c:func:`PyTuple_GetItem` is safe because tuples are immutable. " +"Similarly, not all uses of the above APIs are problematic. For " +"example, :c:func:`PyDict_GetItem` is often used for parsing keyword " +"argument dictionaries in function calls; those keyword argument " +"dictionaries are effectively private (not accessible by other threads), so " +"using borrowed references in that context is safe." +msgstr "" +"همه‌ی APIهایی که ارجاع‌های قرضی (borrowed references) را برمی‌گردانند، مشکل‌ساز " +"نیستند. برای مثال، :c:func:`PyTuple_GetItem` ایمن است، زیرا تاپل‌ها " +"تغییرناپذیر هستند. به‌طور مشابه، همه‌ی استفاده‌های APIهای بالا مشکل‌ساز نیستند. " +"برای مثال، :c:func:`PyDict_GetItem` اغلب برای تجزیه‌ی دیکشنری‌های آرگومان " +"کلیدواژه‌ای در فراخوانی‌های تابع استفاده می‌شود؛ آن دیکشنری‌های آرگومان " +"کلیدواژه‌ای عملاً خصوصی هستند (برای نخ‌های دیگر قابل دسترسی نیستند)، بنابراین " +"استفاده از ارجاع‌های قرضی در آن زمینه ایمن است." -msgid "Some of these functions were added in Python 3.13. You can use the `pythoncapi-compat `_ package to provide implementations of these functions for older Python versions." +msgid "" +"Some of these functions were added in Python 3.13. You can use the " +"`pythoncapi-compat `_ package " +"to provide implementations of these functions for older Python versions." msgstr "" +"برخی از این توابع در پایتون 3.13 افزوده شده‌اند. شما می‌توانید از بسته‌ی " +"`pythoncapi-compat `_ برای " +"فراهم کردن پیاده‌سازی این توابع برای نسخه‌های قدیمی‌تر پایتون استفاده کنید." msgid "Memory Allocation APIs" -msgstr "" +msgstr "APIهای تخصیص حافظه" -msgid "Python's memory management C API provides functions in three different :ref:`allocation domains `: \"raw\", \"mem\", and \"object\". For thread-safety, the free-threaded build requires that only Python objects are allocated using the object domain, and that all Python objects are allocated using that domain. This differs from the prior Python versions, where this was only a best practice and not a hard requirement." -msgstr "" +msgid "" +"Python's memory management C API provides functions in three " +"different :ref:`allocation domains `: \"raw\", \"mem\", " +"and \"object\". For thread-safety, the free-threaded build requires that " +"only Python objects are allocated using the object domain, and that all " +"Python objects are allocated using that domain. This differs from the " +"prior Python versions, where this was only a best practice and not a hard " +"requirement." +msgstr "" +"C API مدیریت حافظه‌ی پایتون، توابعی را در سه :ref:`دامنه‌ی تخصیص ` متفاوت فراهم می‌کند: \"raw\"، \"mem\" و \"object\". برای ایمنی " +"نخ‌ها، ساخت free-threaded ایجاب می‌کند که تنها اشیای پایتون با استفاده از " +"دامنه‌ی object تخصیص داده شوند و همه‌ی اشیای پایتون نیز با استفاده از آن " +"دامنه تخصیص داده شوند. این با نسخه‌های پیشین پایتون تفاوت دارد؛ در آن " +"نسخه‌ها، این فقط یک بهترین روش بود و نه یک الزام سخت." -msgid "Search for uses of :c:func:`PyObject_Malloc` in your extension and check that the allocated memory is used for Python objects. Use :c:func:`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." +msgid "" +"Search for uses of :c:func:`PyObject_Malloc` in your extension and check " +"that the allocated memory is used for Python objects. " +"Use :c:func:`PyMem_Malloc` to allocate buffers instead " +"of :c:func:`PyObject_Malloc`." msgstr "" +"موارد استفاده از :c:func:`PyObject_Malloc` را در افزونه خود جستجو کنید و " +"بررسی کنید که حافظه تخصیص‌یافته برای اشیای پایتون استفاده می‌شود. برای تخصیص " +"بافرها به جای :c:func:`PyObject_Malloc` از :c:func:`PyMem_Malloc` استفاده " +"کنید." msgid "Thread State and GIL APIs" -msgstr "" +msgstr "وضعیت نخ و APIهای GIL" -msgid "Python provides a set of functions and macros to manage thread state and the GIL, such as:" +msgid "" +"Python provides a set of functions and macros to manage thread state and " +"the GIL, such as:" msgstr "" +"پایتون مجموعه‌ای از توابع و ماکروها را برای مدیریت وضعیت نخ و GIL فراهم " +"می‌کند، مانند:" msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" -msgstr "" +msgstr ":c:func:`PyGILState_Ensure` و :c:func:`PyGILState_Release`" msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" -msgstr "" +msgstr ":c:func:`PyEval_SaveThread` و :c:func:`PyEval_RestoreThread`" msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" -msgstr "" +msgstr ":c:macro:`Py_BEGIN_ALLOW_THREADS` و :c:macro:`Py_END_ALLOW_THREADS`" -msgid "These functions should still be used in the free-threaded build to manage thread state even when the :term:`GIL` is disabled. For example, if you create a thread outside of Python, you must call :c:func:`PyGILState_Ensure` before calling into the Python API to ensure that the thread has a valid Python thread state." -msgstr "" +msgid "" +"These functions should still be used in the free-threaded build to manage " +"thread state even when the :term:`GIL` is disabled. For example, if you " +"create a thread outside of Python, you must " +"call :c:func:`PyGILState_Ensure` before calling into the Python API to " +"ensure that the thread has a valid Python thread state." +msgstr "" +"همچنان باید از این توابع در ساخت با نخ‌های آزاد (free-threaded build) برای " +"مدیریت وضعیت نخ استفاده شود، حتی زمانی که :term:`GIL` غیرفعال باشد. برای " +"مثال، اگر نخی خارج از پایتون ایجاد می‌کنید، باید پیش از فراخوانی API " +"پایتون، :c:func:`PyGILState_Ensure` را فراخوانی کنید تا اطمینان حاصل شود که " +"آن نخ دارای وضعیت نخ پایتون معتبری است." -msgid "You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock acquisitions, to allow other threads to run the :term:`cyclic garbage collector `." +msgid "" +"You should continue to call :c:func:`PyEval_SaveThread` " +"or :c:macro:`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/" +"O or lock acquisitions, to allow other threads to run the :term:`cyclic " +"garbage collector `." msgstr "" +"شما باید همچنان :c:func:`PyEval_SaveThread` " +"یا :c:macro:`Py_BEGIN_ALLOW_THREADS` را در اطراف عملیات مسدودکننده، مانند I/" +"O یا کسب قفل، فراخوانی کنید تا نخ‌های دیگر بتوانند :term:`زباله‌روبی چرخه‌ای " +"` را اجرا کنند." msgid "Protecting Internal Extension State" -msgstr "" +msgstr "محافظت از وضعیت داخلی افزونه" -msgid "Your extension may have internal state that was previously protected by the GIL. You may need to add locking to protect this state. The approach will depend on your extension, but some common patterns include:" +msgid "" +"Your extension may have internal state that was previously protected by the " +"GIL. You may need to add locking to protect this state. The approach will " +"depend on your extension, but some common patterns include:" msgstr "" +"ممکن است افزونه شما وضعیت داخلی داشته باشد که پیش‌تر توسط GIL محافظت می‌شد. " +"ممکن است لازم باشد برای محافظت از این وضعیت، قفل‌گذاری اضافه کنید. رویکرد " +"مورد استفاده به افزونه شما بستگی دارد، اما برخی الگوهای رایج عبارت‌اند از:" -msgid "**Caches**: global caches are a common source of shared state. Consider using a lock to protect the cache or disabling it in the free-threaded build if the cache is not critical for performance." +msgid "" +"**Caches**: global caches are a common source of shared state. Consider " +"using a lock to protect the cache or disabling it in the free-threaded " +"build if the cache is not critical for performance." msgstr "" +"**نهانگاه‌ها**: نهانگاه‌های سراسری منبع رایجی از وضعیت مشترک هستند. اگر " +"نهانگاه برای کارایی حیاتی نیست، استفاده از یک قفل برای محافظت از نهانگاه یا " +"غیرفعال کردن آن در ساخت نخ‌آزادرا در نظر بگیرید." -msgid "**Global State**: global state may need to be protected by a lock or moved to thread local storage. C11 and C++11 provide the ``thread_local`` or ``_Thread_local`` for `thread-local storage `_." +msgid "" +"**Global State**: global state may need to be protected by a lock or moved " +"to thread local storage. C11 and C++11 provide the ``thread_local`` or " +"``_Thread_local`` for `thread-local storage `_." msgstr "" +"**وضعیت سراسری**: ممکن است لازم باشد وضعیت سراسری با یک قفل محافظت شود یا " +"به فضای ذخیره‌سازی محلی نخ منتقل شود. C11 و C++11 برای `فضای ذخیره‌سازی محلی " +"نخ `_، " +"``thread_local`` یا ``_Thread_local`` را ارائه می‌کنند." msgid "Critical Sections" -msgstr "" +msgstr "بخش‌های بحرانی" -msgid "In the free-threaded build, CPython provides a mechanism called \"critical sections\" to protect data that would otherwise be protected by the GIL. While extension authors may not interact with the internal critical section implementation directly, understanding their behavior is crucial when using certain C API functions or managing shared state in the free-threaded build." -msgstr "" +msgid "" +"In the free-threaded build, CPython provides a mechanism called \"critical " +"sections\" to protect data that would otherwise be protected by the GIL. " +"While extension authors may not interact with the internal critical section " +"implementation directly, understanding their behavior is crucial when using " +"certain C API functions or managing shared state in the free-threaded build." +msgstr "" +"در ساخت آزادنخی (free-threaded build)، CPython برای محافظت از داده‌هایی که " +"در غیر این صورت توسط GIL محافظت می‌شدند، سازوکاری به نام «بخش‌های بحرانی» " +"فراهم می‌کند. اگرچه ممکن است نویسندگان افزونه‌ها مستقیماً با پیاده‌سازی داخلی " +"بخش‌های بحرانی تعامل نداشته باشند، درک رفتار آن‌ها هنگام استفاده از برخی از " +"تابع‌های C API یا مدیریت وضعیت مشترک در ساخت آزادنخی بسیار مهم است." msgid "What Are Critical Sections?" -msgstr "" +msgstr "بخش‌های بحرانی چیستند؟" -msgid "Conceptually, critical sections act as a deadlock avoidance layer built on top of simple mutexes. Each thread maintains a stack of active critical sections. When a thread needs to acquire a lock associated with a critical section (e.g., implicitly when calling a thread-safe C API function like :c:func:`PyDict_SetItem`, or explicitly using macros), it attempts to acquire the underlying mutex." -msgstr "" +msgid "" +"Conceptually, critical sections act as a deadlock avoidance layer built on " +"top of simple mutexes. Each thread maintains a stack of active critical " +"sections. When a thread needs to acquire a lock associated with a critical " +"section (e.g., implicitly when calling a thread-safe C API function " +"like :c:func:`PyDict_SetItem`, or explicitly using macros), it attempts to " +"acquire the underlying mutex." +msgstr "" +"از نظر مفهومی، بخش‌های بحرانی به‌عنوان لایه‌ای برای اجتناب از بن‌بست عمل می‌کنند " +"که بر روی قفل‌های متقابل ساده (mutex) ساخته شده‌اند. هر نخ، پشته‌ای از بخش‌های " +"بحرانی فعال را نگه می‌دارد. هرگاه نخی نیاز به کسب قفلی مرتبط با یک بخش " +"بحرانی داشته باشد (برای مثال، به‌صورت ضمنی هنگام فراخوانی تابعی ایمن برای نخ " +"از API C مانند :c:func:`PyDict_SetItem`، یا به‌صورت صریح با استفاده از " +"ماکروها)، تلاش می‌کند قفل متقابل زیربنایی را کسب کند." msgid "Using Critical Sections" -msgstr "" +msgstr "استفاده از بخش‌های بحرانی" msgid "The primary APIs for using critical sections are:" -msgstr "" +msgstr "APIهای اصلی برای استفاده از بخش‌های بحرانی عبارتند از:" -msgid ":c:macro:`Py_BEGIN_CRITICAL_SECTION` and :c:macro:`Py_END_CRITICAL_SECTION` - For locking a single object" +msgid "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION` and :c:macro:`Py_END_CRITICAL_SECTION` " +"- For locking a single object" msgstr "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION` و :c:macro:`Py_END_CRITICAL_SECTION` - " +"برای قفل‌کردن یک شیء واحد" -msgid ":c:macro:`Py_BEGIN_CRITICAL_SECTION2` and :c:macro:`Py_END_CRITICAL_SECTION2` - For locking two objects simultaneously" +msgid "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` " +"and :c:macro:`Py_END_CRITICAL_SECTION2` - For locking two objects " +"simultaneously" msgstr "" +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` و :c:macro:`Py_END_CRITICAL_SECTION2` " +"- برای قفل کردن همزمان دو شیء" -msgid "These macros must be used in matching pairs and must appear in the same C scope, since they establish a new local scope. These macros are no-ops in non-free-threaded builds, so they can be safely added to code that needs to support both build types." +msgid "" +"These macros must be used in matching pairs and must appear in the same C " +"scope, since they establish a new local scope. These macros are no-ops in " +"non-free-threaded builds, so they can be safely added to code that needs to " +"support both build types." msgstr "" +"این ماکروها باید به‌صورت جفت‌های متناظر استفاده شوند و در یک محدوده C یکسان " +"ظاهر شوند، زیرا آن‌ها یک محدوده محلی جدید ایجاد می‌کنند. این ماکروها در " +"ساخت‌های non-free-threaded بدون عملیات هستند، بنابراین می‌توان آن‌ها را با " +"اطمینان به کدی که نیاز به پشتیبانی از هر دو نوع ساخت دارد، اضافه کرد." -msgid "A common use of a critical section would be to lock an object while accessing an internal attribute of it. For example, if an extension type has an internal count field, you could use a critical section while reading or writing that field::" +msgid "" +"A common use of a critical section would be to lock an object while " +"accessing an internal attribute of it. For example, if an extension type " +"has an internal count field, you could use a critical section while reading " +"or writing that field::" msgstr "" +"یک استفاده رایج از بخش بحرانی این است که هنگام دسترسی به یک ویژگی داخلی یک " +"شیء، آن شیء را قفل کنید. برای مثال، اگر یک نوع توسعه‌ای دارای یک فیلد شمارش " +"داخلی باشد، می‌توانید هنگام خواندن یا نوشتن آن فیلد از یک بخش بحرانی استفاده " +"کنید::" msgid "" "// read the count, returns new reference to internal count value\n" @@ -301,93 +581,255 @@ msgid "" "obj->count = new_count;\n" "Py_END_CRITICAL_SECTION();" msgstr "" +"// خواندن count، یک ارجاع جدید به مقدار داخلی count برمی‌گرداند\n" +"PyObject *result;\n" +"Py_BEGIN_CRITICAL_SECTION(obj);\n" +"result = Py_NewRef(obj->count);\n" +"Py_END_CRITICAL_SECTION();\n" +"return result;\n" +"\n" +"// نوشتن count، ارجاع new_count را مصرف می‌کند\n" +"Py_BEGIN_CRITICAL_SECTION(obj);\n" +"obj->count = new_count;\n" +"Py_END_CRITICAL_SECTION();" msgid "How Critical Sections Work" -msgstr "" +msgstr "نحوه کار بخش‌های بحرانی" -msgid "Unlike traditional locks, critical sections do not guarantee exclusive access throughout their entire duration. If a thread would block while holding a critical section (e.g., by acquiring another lock or performing I/O), the critical section is temporarily suspended—all locks are released—and then resumed when the blocking operation completes." -msgstr "" +msgid "" +"Unlike traditional locks, critical sections do not guarantee exclusive " +"access throughout their entire duration. If a thread would block while " +"holding a critical section (e.g., by acquiring another lock or performing I/" +"O), the critical section is temporarily suspended—all locks are released—" +"and then resumed when the blocking operation completes." +msgstr "" +"برخلاف قفل‌های سنتی، بخش‌های بحرانی دسترسی انحصاری را در تمام مدت خود تضمین " +"نمی‌کنند. اگر نخی در حالی که یک بخش بحرانی را در اختیار دارد مسدود شود (مثلاً " +"با به دست آوردن قفلی دیگر یا انجام I/O)، آن بخش بحرانی به‌طور موقت معلق می‌شود" +"—همه قفل‌ها آزاد می‌شوند—و سپس هنگامی که عملیات مسدودکننده کامل شود، از سر " +"گرفته می‌شود." -msgid "This behavior is similar to what happens with the GIL when a thread makes a blocking call. The key differences are:" +msgid "" +"This behavior is similar to what happens with the GIL when a thread makes a " +"blocking call. The key differences are:" msgstr "" +"این رفتار مشابه اتفاقی است که با GIL هنگامی رخ می‌دهد که یک نخ یک فراخوانی " +"مسدودکننده انجام می‌دهد. تفاوت‌های اصلی عبارتند از:" msgid "Critical sections operate on a per-object basis rather than globally" -msgstr "" +msgstr "بخش‌های بحرانی به‌ازای هر شیء عمل می‌کنند، نه به‌صورت سراسری" -msgid "Critical sections follow a stack discipline within each thread (the \"begin\" and \"end\" macros enforce this since they must be paired and within the same scope)" +msgid "" +"Critical sections follow a stack discipline within each thread (the " +"\"begin\" and \"end\" macros enforce this since they must be paired and " +"within the same scope)" msgstr "" +"بخش‌های بحرانی در هر نخ از یک نظم پشته‌ای پیروی می‌کنند (ماکروهای «begin» و " +"«end» این موضوع را اعمال می‌کنند، زیرا باید به‌صورت جفت و در یک محدوده یکسان " +"استفاده شوند)" -msgid "Critical sections automatically release and reacquire locks around potential blocking operations" +msgid "" +"Critical sections automatically release and reacquire locks around " +"potential blocking operations" msgstr "" +"بخش‌های بحرانی به‌طور خودکار قفل‌ها را پیرامون عملیات‌های مسدودکننده‌ی احتمالی " +"آزاد کرده و دوباره تصاحب می‌کنند" msgid "Deadlock Avoidance" -msgstr "" +msgstr "اجتناب از بن‌بست" msgid "Critical sections help avoid deadlocks in two ways:" -msgstr "" +msgstr "بخش‌های بحرانی به دو روش در جلوگیری از بن‌بست‌ها کمک می‌کنند:" -msgid "If a thread tries to acquire a lock that's already held by another thread, it first suspends all of its active critical sections, temporarily releasing their locks" +msgid "" +"If a thread tries to acquire a lock that's already held by another thread, " +"it first suspends all of its active critical sections, temporarily " +"releasing their locks" msgstr "" +"اگر یک نخ تلاش کند قفلی را که از قبل در اختیار نخ دیگری است به دست آورد، " +"ابتدا تمام بخش‌های بحرانی فعال خود را معلق می‌کند و قفل‌های آن‌ها را به‌طور موقت " +"آزاد می‌کند" -msgid "When the blocking operation completes, only the top-most critical section is reacquired first" +msgid "" +"When the blocking operation completes, only the top-most critical section " +"is reacquired first" msgstr "" +"هنگامی که عملیات مسدودکننده کامل می‌شود، ابتدا تنها بالاترین بخش بحرانی " +"دوباره به دست می‌آید" -msgid "This means you cannot rely on nested critical sections to lock multiple objects at once, as the inner critical section may suspend the outer ones. Instead, use :c:macro:`Py_BEGIN_CRITICAL_SECTION2` to lock two objects simultaneously." +msgid "" +"This means you cannot rely on nested critical sections to lock multiple " +"objects at once, as the inner critical section may suspend the outer ones. " +"Instead, use :c:macro:`Py_BEGIN_CRITICAL_SECTION2` to lock two objects " +"simultaneously." msgstr "" +"این بدان معناست که نمی‌توانید برای قفل کردن چندین شیء به‌طور همزمان، به " +"بخش‌های بحرانی تودرتو اتکا کنید، زیرا بخش بحرانی داخلی ممکن است بخش‌های " +"بحرانی بیرونی را معلق کند. در عوض، برای قفل کردن همزمان دو شیء " +"از :c:macro:`Py_BEGIN_CRITICAL_SECTION2` استفاده کنید." -msgid "Note that the locks described above are only :c:type:`PyMutex` based locks. The critical section implementation does not know about or affect other locking mechanisms that might be in use, like POSIX mutexes. Also note that while blocking on any :c:type:`PyMutex` causes the critical sections to be suspended, only the mutexes that are part of the critical sections are released. If :c:type:`PyMutex` is used without a critical section, it will not be released and therefore does not get the same deadlock avoidance." -msgstr "" +msgid "" +"Note that the locks described above are only :c:type:`PyMutex` based locks. " +"The critical section implementation does not know about or affect other " +"locking mechanisms that might be in use, like POSIX mutexes. Also note " +"that while blocking on any :c:type:`PyMutex` causes the critical sections " +"to be suspended, only the mutexes that are part of the critical sections " +"are released. If :c:type:`PyMutex` is used without a critical section, it " +"will not be released and therefore does not get the same deadlock avoidance." +msgstr "" +"توجه داشته باشید که قفل‌های توصیف‌شده در بالا فقط قفل‌های مبتنی " +"بر :c:type:`PyMutex` هستند. پیاده‌سازی بخش بحرانی از سایر سازوکارهای قفل‌سازی " +"که ممکن است در حال استفاده باشند، مانند موتکس‌های POSIX، آگاه نیست و آن‌ها را " +"تحت تأثیر قرار نمی‌دهد. همچنین توجه داشته باشید که هرچند مسدود شدن در انتظار " +"هر :c:type:`PyMutex` باعث تعلیق بخش‌های بحرانی می‌شود، فقط موتکس‌هایی که بخشی " +"از بخش‌های بحرانی هستند آزاد می‌شوند. اگر :c:type:`PyMutex` بدون یک بخش " +"بحرانی استفاده شود، آزاد نخواهد شد و بنابراین از همان اجتناب از بن‌بست " +"بهره‌مند نمی‌شود." msgid "Important Considerations" -msgstr "" +msgstr "ملاحظات مهم" -msgid "Critical sections may temporarily release their locks, allowing other threads to modify the protected data. Be careful about making assumptions about the state of the data after operations that might block." +msgid "" +"Critical sections may temporarily release their locks, allowing other " +"threads to modify the protected data. Be careful about making assumptions " +"about the state of the data after operations that might block." msgstr "" +"بخش‌های بحرانی ممکن است قفل‌های خود را به‌طور موقت آزاد کنند و به نخ‌های دیگر " +"اجازه دهند داده‌های محافظت‌شده را تغییر دهند. هنگام فرض‌سازی درباره وضعیت " +"داده‌ها پس از عملیاتی که ممکن است مسدودکننده باشند، احتیاط کنید." -msgid "Because locks can be temporarily released (suspended), entering a critical section does not guarantee exclusive access to the protected resource throughout the section's duration. If code within a critical section calls another function that blocks (e.g., acquires another lock, performs blocking I/O), all locks held by the thread via critical sections will be released. This is similar to how the GIL can be released during blocking calls." -msgstr "" +msgid "" +"Because locks can be temporarily released (suspended), entering a critical " +"section does not guarantee exclusive access to the protected resource " +"throughout the section's duration. If code within a critical section calls " +"another function that blocks (e.g., acquires another lock, performs " +"blocking I/O), all locks held by the thread via critical sections will be " +"released. This is similar to how the GIL can be released during blocking " +"calls." +msgstr "" +"چون قفل‌ها می‌توانند به‌طور موقت آزاد (معلق) شوند، ورود به یک بخش بحرانی، " +"دسترسی انحصاری به منبع محافظت‌شده را در تمام مدت آن بخش تضمین نمی‌کند. اگر کد " +"درون یک بخش بحرانی تابع دیگری را فراخوانی کند که مسدودکننده است (برای مثال، " +"قفل دیگری را به دست می‌آورد یا ورودی/خروجی مسدودکننده انجام می‌دهد)، تمام " +"قفل‌هایی که نخ از طریق بخش‌های بحرانی در اختیار دارد آزاد خواهند شد. این شبیه " +"به حالتی است که GIL می‌تواند در حین فراخوانی‌های مسدودکننده آزاد شود." -msgid "Only the lock(s) associated with the most recently entered (top-most) critical section are guaranteed to be held at any given time. Locks for outer, nested critical sections might have been suspended." +msgid "" +"Only the lock(s) associated with the most recently entered (top-most) " +"critical section are guaranteed to be held at any given time. Locks for " +"outer, nested critical sections might have been suspended." msgstr "" +"تنها قفل(ها)ی مرتبط با آخرین بخش بحرانی واردشده (بالاترین) تضمین می‌شود که " +"در هر لحظه نگه‌داشته شده باشند. قفل‌های بخش‌های بحرانی بیرونی و تودرتو ممکن " +"است معلق شده باشند." -msgid "You can lock at most two objects simultaneously with these APIs. If you need to lock more objects, you'll need to restructure your code." +msgid "" +"You can lock at most two objects simultaneously with these APIs. If you " +"need to lock more objects, you'll need to restructure your code." msgstr "" +"شما می‌توانید با این APIها حداکثر ۲ شیء را به‌طور همزمان قفل کنید. اگر نیاز " +"دارید اشیاء بیشتری را قفل کنید، باید ساختار کد خود را بازآرایی کنید." -msgid "While critical sections will not deadlock if you attempt to lock the same object twice, they are less efficient than purpose-built reentrant locks for this use case." +msgid "" +"While critical sections will not deadlock if you attempt to lock the same " +"object twice, they are less efficient than purpose-built reentrant locks " +"for this use case." msgstr "" +"اگرچه بخش‌های بحرانی در صورت تلاش برای قفل کردن دوباره‌ی یک شیء دچار بن‌بست " +"نمی‌شوند، اما برای این مورد استفاده، کارآمدی کمتری نسبت به قفل‌های بازورودپذیر " +"(reentrant locks) دارند که برای همین منظور ساخته شده‌اند." -msgid "When using :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, the order of the objects doesn't affect correctness (the implementation handles deadlock avoidance), but it's good practice to always lock objects in a consistent order." +msgid "" +"When using :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, the order of the objects " +"doesn't affect correctness (the implementation handles deadlock avoidance), " +"but it's good practice to always lock objects in a consistent order." msgstr "" +"هنگام استفاده از :c:macro:`Py_BEGIN_CRITICAL_SECTION2`، ترتیب شیء‌ها بر صحت " +"تأثیر نمی‌گذارد (پیاده‌سازی اجتناب از بن‌بست را مدیریت می‌کند)، اما بهتر است " +"همیشه شیء‌ها را با ترتیبی ثابت قفل کنید." -msgid "Remember that the critical section macros are primarily for protecting access to *Python objects* that might be involved in internal CPython operations susceptible to the deadlock scenarios described above. For protecting purely internal extension state, standard mutexes or other synchronization primitives might be more appropriate." -msgstr "" +msgid "" +"Remember that the critical section macros are primarily for protecting " +"access to *Python objects* that might be involved in internal CPython " +"operations susceptible to the deadlock scenarios described above. For " +"protecting purely internal extension state, standard mutexes or other " +"synchronization primitives might be more appropriate." +msgstr "" +"به یاد داشته باشید که ماکروهای بخش بحرانی عمدتاً برای محافظت از دسترسی به " +"*اشیای پایتون* به کار می‌روند؛ این اشیاء ممکن است در عملیات داخلی CPython که " +"مستعد سناریوهای بن‌بست توصیف‌شده در بالا هستند، دخیل باشند. برای محافظت از " +"وضعیت کاملاً داخلی افزونه، ممکن است موتکس‌های استاندارد یا دیگر سازوکارهای " +"همگام‌سازی مناسب‌تر باشند." msgid "Building Extensions for the Free-Threaded Build" -msgstr "" +msgstr "ساخت افزونه‌ها برای ساخت آزادنخ (Free-Threaded Build)" -msgid "C API extensions need to be built specifically for the free-threaded build. The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." +msgid "" +"C API extensions need to be built specifically for the free-threaded build. " +"The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." msgstr "" +"افزونه‌های C API باید به‌طور خاص برای ساخت نخ‌آزادی ساخته " +"شوند. wheelها، کتابخانه‌های مشترک و دودویی‌ها با پسوند ``t`` مشخص می‌شوند." -msgid "`pypa/manylinux `_ supports the free-threaded build, with the ``t`` suffix, such as ``python3.14t``." +msgid "" +"`pypa/manylinux `_ supports the free-" +"threaded build, with the ``t`` suffix, such as ``python3.14t``." msgstr "" +"`pypa/manylinux `_ از ساخت آزادنخ (free-" +"threaded) با پسوند ``t``، مانند ``python3.14t``، پشتیبانی می‌کند." -msgid "`pypa/cibuildwheel `_ supports building wheels for the free-threaded build of Python 3.14 and newer." +msgid "" +"`pypa/cibuildwheel `_ supports " +"building wheels for the free-threaded build of Python 3.14 and newer." msgstr "" +"`pypa/cibuildwheel `_ از ساخت wheelها " +"برای نسخه‌ی ساخت نخ‌آزادی پایتون 3.14 و جدیدتر پشتیبانی " +"می‌کند." msgid "Limited C API and Stable ABI" -msgstr "" +msgstr "API محدود C و ABI پایدار" -msgid "The free-threaded build does not currently support the :ref:`Limited C API ` or the stable ABI. If you use `setuptools `_ to build your extension and currently set ``py_limited_api=True`` you can use ``py_limited_api=not sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` to opt out of the limited API when building with the free-threaded build." -msgstr "" +msgid "" +"The free-threaded build does not currently support the :ref:`Limited C API " +"` or the stable ABI. If you use `setuptools `_ to build your extension and " +"currently set ``py_limited_api=True`` you can use ``py_limited_api=not " +"sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` to opt out of the limited " +"API when building with the free-threaded build." +msgstr "" +"ساخت نخ‌آزادی (free-threaded build) در حال حاضر از :ref:`Limited C API " +"` یا ABI پایدار پشتیبانی نمی‌کند. اگر برای ساخت افزونه خود از " +"`setuptools `_ " +"استفاده می‌کنید و در حال حاضر ``py_limited_api=True`` را تنظیم کرده‌اید، " +"می‌توانید برای خارج شدن از API محدود هنگام ساخت با ساخت نخ‌آزادی، از " +"``py_limited_api=not sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` " +"استفاده کنید." -msgid "You will need to build separate wheels specifically for the free-threaded build. If you currently use the stable ABI, you can continue to build a single wheel for multiple non-free-threaded Python versions." +msgid "" +"You will need to build separate wheels specifically for the free-threaded " +"build. If you currently use the stable ABI, you can continue to build a " +"single wheel for multiple non-free-threaded Python versions." msgstr "" +"شما باید wheelهای جداگانه‌ای را به‌طور خاص برای ساخت نخ‌آزاد " +"بسازید. اگر در حال حاضر از ABI پایدار استفاده می‌کنید، می‌توانید به ساخت یک " +"wheel واحد برای چندین نسخه‌ی پایتون غیرنخ‌آزاد (non-free-threaded) ادامه " +"دهید." msgid "Windows" -msgstr "" +msgstr "ویندوز" -msgid "Due to a limitation of the official Windows installer, you will need to manually define ``Py_GIL_DISABLED=1`` when building extensions from source." +msgid "" +"Due to a limitation of the official Windows installer, you will need to " +"manually define ``Py_GIL_DISABLED=1`` when building extensions from source." msgstr "" +"به دلیل محدودیتی در نصب‌کننده رسمی ویندوز، هنگام ساخت افزونه‌ها از منبع، باید " +"به‌صورت دستی ``Py_GIL_DISABLED=1`` را تعریف کنید." -msgid "`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for extension authors." +msgid "" +"`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " +"extension authors." msgstr "" +"`پورت ماژول‌های افزونه برای پشتیبانی از Free-Threading `_: یک راهنمای پورت نگهداری‌شده توسط کامیونیتی " +"برای نویسندگان افزونه." diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index bae52914d..914fe3ee1 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2024-10-04 14:19+0000\n" +"PO-Revision-Date: 2026-08-28 10:55+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,204 +22,551 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Python support for free threading" -msgstr "" +msgstr "پشتیبانی پایتون از نخ‌بندی آزاد" -msgid "Starting with the 3.13 release, CPython has support for a build of Python called :term:`free threading` where the :term:`global interpreter lock` (GIL) is disabled. Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores. While not all software will benefit from this automatically, programs designed with threading in mind will run faster on multi-core hardware." -msgstr "" +msgid "" +"Starting with the 3.13 release, CPython has support for a build of Python " +"called :term:`free threading` where the :term:`global interpreter lock` " +"(GIL) is disabled. Free-threaded execution allows for full utilization of " +"the available processing power by running threads in parallel on available " +"CPU cores. While not all software will benefit from this automatically, " +"programs designed with threading in mind will run faster on multi-core " +"hardware." +msgstr "" +"از نسخه‌ی 3.13، CPython از ساختی از پایتون به نام نخ‌بندی آزاد (:term:`free " +"threading`) پشتیبانی می‌کند که در آن قفل سراسری مفسر (:term:`global " +"interpreter lock`، GIL) غیرفعال است. اجرای نخ‌بندی آزاد امکان بهره‌برداری " +"کامل از توان پردازشی موجود را با اجرای موازی نخ‌ها بر روی هسته‌های CPU موجود " +"فراهم می‌کند. اگرچه همه‌ی نرم‌افزارها به‌طور خودکار از آن بهره‌مند نخواهند شد، " +"برنامه‌هایی که با در نظر گرفتن نخ‌بندی طراحی شده‌اند، روی سخت‌افزار چندهسته‌ای " +"سریع‌تر اجرا خواهند شد." -msgid "Some third-party packages, in particular ones with an :term:`extension module`, may not be ready for use in a free-threaded build, and will re-enable the :term:`GIL`." +msgid "" +"Some third-party packages, in particular ones with an :term:`extension " +"module`, may not be ready for use in a free-threaded build, and will re-" +"enable the :term:`GIL`." msgstr "" +"برخی بسته‌های شخص ثالث، به‌ویژه آن‌هایی که یک :term:`extension module` دارند، " +"ممکن است برای استفاده در یک ساخت نخ‌آزادی (free-threaded build) آماده " +"نباشند، و :term:`GIL` را دوباره فعال خواهند کرد." -msgid "This document describes the implications of free threading for Python code. See :ref:`freethreading-extensions-howto` for information on how to write C extensions that support the free-threaded build." +msgid "" +"This document describes the implications of free threading for Python " +"code. See :ref:`freethreading-extensions-howto` for information on how to " +"write C extensions that support the free-threaded build." msgstr "" +"این سند پیامدهای نخ‌بندی آزاد (free threading) برای کد پایتون را توضیح " +"می‌دهد. برای اطلاع از نحوه نوشتن افزونه‌های C که از ساخت آزادنخی (free-" +"threaded build) پشتیبانی می‌کنند، :ref:`freethreading-extensions-howto` را " +"ببینید." -msgid ":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an overall description of free-threaded Python." +msgid "" +":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " +"overall description of free-threaded Python." msgstr "" +":pep:`703` – اختیاری کردن قفل سراسری مفسر در CPython، برای توصیفی کلی از " +"پایتون نخ‌آزاد (free-threaded Python)." msgid "Installation" -msgstr "" +msgstr "نصب" -msgid "Starting with Python 3.13, the official macOS and Windows installers optionally support installing free-threaded Python binaries. The installers are available at https://www.python.org/downloads/." +msgid "" +"Starting with Python 3.13, the official macOS and Windows installers " +"optionally support installing free-threaded Python binaries. The " +"installers are available at https://www.python.org/downloads/." msgstr "" +"از پایتون 3.13 به بعد، نصب‌کننده‌های رسمی macOS و Windows به‌صورت اختیاری از " +"نصب دودویی‌های پایتون آزادنخپشتیبانی می‌کنند. این نصب‌کننده‌ها " +"در https://www.python.org/downloads/ در دسترس هستند." -msgid "For information on other platforms, see the `Installing a Free-Threaded Python `_, a community-maintained installation guide for installing free-threaded Python." +msgid "" +"For information on other platforms, see the `Installing a Free-Threaded " +"Python `_, a " +"community-maintained installation guide for installing free-threaded Python." msgstr "" +"برای اطلاعات درباره‌ی سایر پلتفرم‌ها، `نصب پایتون آزادنخ " +"`_ را ببینید، یک " +"راهنمای نصب نگهداری‌شده توسط کامیونیتی برای نصب پایتون آزادنخ." -msgid "When building CPython from source, the :option:`--disable-gil` configure option should be used to build a free-threaded Python interpreter." +msgid "" +"When building CPython from source, the :option:`--disable-gil` configure " +"option should be used to build a free-threaded Python interpreter." msgstr "" +"هنگام ساخت CPython از منبع، برای ساخت یک مفسر پایتون آزادنخ " +"باید از گزینه‌ی :option:`--disable-gil` در configure استفاده شود." msgid "Identifying free-threaded Python" -msgstr "" +msgstr "شناسایی پایتون آزادنخ " -msgid "To check if the current interpreter supports free-threading, :option:`python -VV <-V>` and :data:`sys.version` contain \"free-threading build\". The new :func:`sys._is_gil_enabled` function can be used to check whether the GIL is actually disabled in the running process." +msgid "" +"To check if the current interpreter supports free-" +"threading, :option:`python -VV <-V>` and :data:`sys.version` contain \"free-" +"threading build\". The new :func:`sys._is_gil_enabled` function can be used " +"to check whether the GIL is actually disabled in the running process." msgstr "" +"برای بررسی این‌که آیا مفسر فعلی از نخ‌آزاد (free-threading) پشتیبانی " +"می‌کند، :option:`python -VV <-V>` و :data:`sys.version` شامل \"free-" +"threading build\" هستند. می‌توانید از تابع جدید :func:`sys._is_gil_enabled` " +"برای بررسی این‌که آیا قفل سراسری مفسر (GIL) در فرایند در حال اجرا واقعاً " +"غیرفعال است، استفاده کنید." -msgid "The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable can be used to determine whether the build supports free threading. If the variable is set to ``1``, then the build supports free threading. This is the recommended mechanism for decisions related to the build configuration." -msgstr "" +msgid "" +"The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration " +"variable can be used to determine whether the build supports free " +"threading. If the variable is set to ``1``, then the build supports free " +"threading. This is the recommended mechanism for decisions related to the " +"build configuration." +msgstr "" +"می‌توان از متغیر پیکربندی ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` " +"برای تعیین اینکه آیا ساخت از نخ‌بندی آزاد (free threading) پشتیبانی می‌کند، " +"استفاده کرد. اگر این متغیر روی ``1`` تنظیم شده باشد، ساخت از نخ‌بندی آزاد " +"پشتیبانی می‌کند. این سازوکار توصیه‌شده برای تصمیم‌های مربوط به پیکربندی ساخت " +"است." msgid "The global interpreter lock in free-threaded Python" -msgstr "" +msgstr "قفل سراسری مفسر در پایتون آزادنخی " -msgid "Free-threaded builds of CPython support optionally running with the GIL enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or the command-line option :option:`-X gil`." +msgid "" +"Free-threaded builds of CPython support optionally running with the GIL " +"enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " +"the command-line option :option:`-X gil`." msgstr "" +"ساخت‌های نخ‌آزادی CPython از اجرای اختیاری با GIL فعال در " +"ران‌تایم، با استفاده از متغیر محیطی :envvar:`PYTHON_GIL` یا گزینه‌ی خط " +"فرمان :option:`-X gil` پشتیبانی می‌کنند." -msgid "The GIL may also automatically be enabled when importing a C-API extension module that is not explicitly marked as supporting free threading. A warning will be printed in this case." +msgid "" +"The GIL may also automatically be enabled when importing a C-API extension " +"module that is not explicitly marked as supporting free threading. A " +"warning will be printed in this case." msgstr "" +"ممکن است GIL همچنین به‌صورت خودکار هنگام ایمپورت کردن یک ماژول توسعه‌ی C-API " +"که به‌صراحت به‌عنوان پشتیبانی‌کننده از نخ‌بندی آزاد (free threading) علامت‌گذاری " +"نشده باشد، فعال شود. در این حالت هشداری چاپ خواهد شد." -msgid "In addition to individual package documentation, the following websites track the status of popular packages support for free threading:" +msgid "" +"In addition to individual package documentation, the following websites " +"track the status of popular packages support for free threading:" msgstr "" +"علاوه بر مستندات هر بسته، وب‌سایت‌های زیر وضعیت پشتیبانی بسته‌های محبوب از " +"نخ‌بندی آزاد (free threading) را پیگیری می‌کنند:" msgid "https://py-free-threading.github.io/tracking/" -msgstr "" +msgstr "https://py-free-threading.github.io/tracking/" msgid "https://hugovk.github.io/free-threaded-wheels/" -msgstr "" +msgstr "https://hugovk.github.io/free-threaded-wheels/" msgid "Thread safety" -msgstr "" +msgstr "ایمنی نخ" -msgid "The free-threaded build of CPython aims to provide similar thread-safety behavior at the Python level to the default GIL-enabled build. Built-in types like :class:`dict`, :class:`list`, and :class:`set` use internal locks to protect against concurrent modifications in ways that behave similarly to the GIL. However, Python has not historically guaranteed specific behavior for concurrent modifications to these built-in types, so this should be treated as a description of the current implementation, not a guarantee of current or future behavior." -msgstr "" +msgid "" +"The free-threaded build of CPython aims to provide similar thread-safety " +"behavior at the Python level to the default GIL-enabled build. Built-in " +"types like :class:`dict`, :class:`list`, and :class:`set` use internal " +"locks to protect against concurrent modifications in ways that behave " +"similarly to the GIL. However, Python has not historically guaranteed " +"specific behavior for concurrent modifications to these built-in types, so " +"this should be treated as a description of the current implementation, not " +"a guarantee of current or future behavior." +msgstr "" +"ساخت آزادنخی CPython هدف دارد در سطح پایتون، رفتار ایمنی " +"نخی مشابهی با ساخت پیش‌فرض دارای GIL فعال فراهم کند. انواع توکار " +"مانند :class:`dict`، :class:`list` و :class:`set` از قفل‌های داخلی برای " +"محافظت در برابر تغییرات همزمان به روش‌هایی استفاده می‌کنند که رفتاری مشابه " +"GIL دارند. با این حال، پایتون از نظر تاریخی رفتار مشخصی را برای تغییرات " +"همزمان روی این انواع توکار تضمین نکرده است، بنابراین این موضوع باید به‌عنوان " +"توصیفی از پیاده‌سازی کنونی در نظر گرفته شود، نه تضمینی برای رفتار کنونی یا " +"آینده." -msgid "It's recommended to use the :class:`threading.Lock` or other synchronization primitives instead of relying on the internal locks of built-in types, when possible." +msgid "" +"It's recommended to use the :class:`threading.Lock` or other " +"synchronization primitives instead of relying on the internal locks of " +"built-in types, when possible." msgstr "" +"توصیه می‌شود در صورت امکان به‌جای تکیه بر قفل‌های داخلی انواع توکار، " +"از :class:`threading.Lock` یا دیگر اولیه‌های همگام‌سازی (synchronization " +"primitives) استفاده کنید." msgid "Known limitations" -msgstr "" +msgstr "محدودیت‌های شناخته‌شده" -msgid "This section describes known limitations of the free-threaded CPython build." +msgid "" +"This section describes known limitations of the free-threaded CPython build." msgstr "" +"این بخش محدودیت‌های شناخته‌شده‌ی ساخت CPython با نخ‌های آزادرا " +"شرح می‌دهد." msgid "Immortalization" -msgstr "" +msgstr "نامیراسازی" -msgid "In the free-threaded build, some objects are :term:`immortal`. Immortal objects are not deallocated and have reference counts that are never modified. This is done to avoid reference count contention that would prevent efficient multi-threaded scaling." +msgid "" +"In the free-threaded build, some objects are :term:`immortal`. Immortal " +"objects are not deallocated and have reference counts that are never " +"modified. This is done to avoid reference count contention that would " +"prevent efficient multi-threaded scaling." msgstr "" +"در ساخت free-threaded، برخی اشیاء :term:`نامیرا ` هستند. اشیاء " +"نامیرا آزاد نمی‌شوند و شمارش ارجاع آن‌ها هرگز تغییر نمی‌کند. این کار برای " +"اجتناب از رقابت بر سر شمارش ارجاع انجام می‌شود که مانع از مقیاس‌پذیری کارآمد " +"چندنخی می‌شود." msgid "As of the 3.14 release, immortalization is limited to:" -msgstr "" +msgstr "از زمان انتشار نسخه‌ی 3.14، نامیرا شدن محدود است به:" -msgid "Code constants: numeric literals, string literals, and tuple literals composed of other constants." +msgid "" +"Code constants: numeric literals, string literals, and tuple literals " +"composed of other constants." msgstr "" +"مقادیر ثابت کد: مقادیر لفظی عددی، رشته‌ای و تاپلی تشکیل‌شده از " +"ثابت‌های دیگر." msgid "Strings interned by :func:`sys.intern`." -msgstr "" +msgstr "رشته‌های اینترن‌شده (interned) توسط :func:`sys.intern`." msgid "Frame objects" -msgstr "" +msgstr "اشیای فریم" -msgid "It is not safe to access :attr:`frame.f_locals` from a :ref:`frame ` object if that frame is currently executing in another thread, and doing so may crash the interpreter." +msgid "" +"It is not safe to access :attr:`frame.f_locals` from a :ref:`frame ` object if that frame is currently executing in another thread, " +"and doing so may crash the interpreter." msgstr "" +"دسترسی به :attr:`frame.f_locals` از یک شیء :ref:`فریم ` در " +"صورتی که آن فریم در حال حاضر در نخ دیگری در حال اجرا است، ایمن نیست و انجام " +"این کار ممکن است باعث از کار افتادن مفسر شود." msgid "Iterators" -msgstr "" +msgstr "پیمایش‌گرها" -msgid "It is generally not thread-safe to access the same iterator object from multiple threads concurrently, and threads may see duplicate or missing elements." +msgid "" +"It is generally not thread-safe to access the same iterator object from " +"multiple threads concurrently, and threads may see duplicate or missing " +"elements." msgstr "" +"دسترسی همزمان به یک شیء پیمایش‌گر یکسان از طریق چندین نخ، عموماً ایمن در برابر " +"نخ (thread-safe) نیست و نخ‌ها ممکن است عناصر تکراری یا ازدست‌رفته را مشاهده " +"کنند." msgid "Single-threaded performance" -msgstr "" +msgstr "عملکرد تک‌نخی" -msgid "The free-threaded build has additional overhead when executing Python code compared to the default GIL-enabled build. The amount of overhead depends on the workload and hardware. On the pyperformance benchmark suite, the average overhead ranges from about 1% on macOS aarch64 to 8% on x86-64 Linux systems." +msgid "" +"The free-threaded build has additional overhead when executing Python code " +"compared to the default GIL-enabled build. The amount of overhead depends " +"on the workload and hardware. On the pyperformance benchmark suite, the " +"average overhead ranges from about 1% on macOS aarch64 to 8% on x86-64 " +"Linux systems." msgstr "" +"ساخت آزادنخی (free-threaded build) در مقایسه با ساخت پیش‌فرض با GIL فعال، " +"هنگام اجرای کد پایتون سربار اضافی دارد. میزان سربار به بار کاری و سخت‌افزار " +"بستگی دارد. در مجموعه بنچمارک pyperformance، میانگین سربار از حدود ۱٪ در " +"macOS aarch64 تا ۸٪ در سیستم‌های لینوکس x86-64 متغیر است." msgid "Behavioral changes" -msgstr "" +msgstr "تغییرات رفتاری" -msgid "This section describes CPython behavioural changes with the free-threaded build." +msgid "" +"This section describes CPython behavioural changes with the free-threaded " +"build." msgstr "" +"این بخش تغییرات رفتاری CPython را در ساخت نخ‌آزاد (free-threaded build) " +"توصیف می‌کند." msgid "Context variables" -msgstr "" +msgstr "متغیرهای زمینه" -msgid "In the free-threaded build, the flag :data:`~sys.flags.thread_inherit_context` is set to true by default which causes threads created with :class:`threading.Thread` to start with a copy of the :class:`~contextvars.Context()` of the caller of :meth:`~threading.Thread.start`. In the default GIL-enabled build, the flag defaults to false so threads start with an empty :class:`~contextvars.Context()`." -msgstr "" +msgid "" +"In the free-threaded build, the " +"flag :data:`~sys.flags.thread_inherit_context` is set to true by default " +"which causes threads created with :class:`threading.Thread` to start with a " +"copy of the :class:`~contextvars.Context()` of the caller " +"of :meth:`~threading.Thread.start`. In the default GIL-enabled build, the " +"flag defaults to false so threads start with an " +"empty :class:`~contextvars.Context()`." +msgstr "" +"در ساخت آزادنخی ، " +"پرچم :data:`~sys.flags.thread_inherit_context` به‌طور پیش‌فرض روی true تنظیم " +"شده است که باعث می‌شود نخ‌های ایجادشده با :class:`threading.Thread` با یک کپی " +"از :class:`~contextvars.Context()` متعلق به " +"فراخواننده‌ی :meth:`~threading.Thread.start` آغاز شوند. در ساخت پیش‌فرض با " +"GIL فعال (GIL-enabled)، این پرچم به‌طور پیش‌فرض false است، بنابراین نخ‌ها با " +"یک :class:`~contextvars.Context()` خالی آغاز می‌شوند." msgid "Warning filters" -msgstr "" +msgstr "فیلترهای هشدار" -msgid "In the free-threaded build, the flag :data:`~sys.flags.context_aware_warnings` is set to true by default. In the default GIL-enabled build, the flag defaults to false. If the flag is true then the :class:`warnings.catch_warnings` context manager uses a context variable for warning filters. If the flag is false then :class:`~warnings.catch_warnings` modifies the global filters list, which is not thread-safe. See the :mod:`warnings` module for more details." -msgstr "" +msgid "" +"In the free-threaded build, the " +"flag :data:`~sys.flags.context_aware_warnings` is set to true by default. " +"In the default GIL-enabled build, the flag defaults to false. If the flag " +"is true then the :class:`warnings.catch_warnings` context manager uses a " +"context variable for warning filters. If the flag is false " +"then :class:`~warnings.catch_warnings` modifies the global filters list, " +"which is not thread-safe. See the :mod:`warnings` module for more details." +msgstr "" +"در ساخت نخ‌آزادی ، " +"پرچم :data:`~sys.flags.context_aware_warnings` به‌صورت پیش‌فرض روی درست تنظیم " +"شده است. در ساخت پیش‌فرض با GIL فعال (GIL-enabled)، این پرچم به‌طور پیش‌فرض " +"نادرست است. اگر پرچم درست باشد، مدیر زمینه :class:`warnings.catch_warnings` " +"از یک متغیر زمینه برای فیلترهای هشدار استفاده می‌کند. اگر پرچم نادرست " +"باشد، :class:`~warnings.catch_warnings` فهرست فیلترهای سراسری را تغییر " +"می‌دهد، که ایمن برای نخ‌ها (thread-safe) نیست. برای جزئیات بیشتر، " +"ماژول :mod:`warnings` را ببینید." msgid "Increased memory usage" -msgstr "" +msgstr "افزایش مصرف حافظه" -msgid "The free-threaded build will typically use more memory compared to the default build. There are multiple reasons for this, mostly due to design decisions." +msgid "" +"The free-threaded build will typically use more memory compared to the " +"default build. There are multiple reasons for this, mostly due to design " +"decisions." msgstr "" +"ساخت با نخ‌های آزادبه‌طور معمول در مقایسه با ساخت پیش‌فرض از " +"حافظه‌ی بیشتری استفاده می‌کند. دلایل متعددی برای این موضوع وجود دارد که عمدتاً " +"به‌دلیل تصمیم‌های طراحی است." msgid "All interned strings are immortal" -msgstr "" +msgstr "همه‌ی رشته‌های اینترن‌شده (interned) نامیرا هستند" -msgid "For modern Python versions (since version 2.3), interning a string (e.g. with :func:`sys.intern`) does not cause it to become immortal. Instead, if the last reference to that string disappears, it will be removed from the interned string table. This is not the case for the free-threaded build and any interned string will become immortal, surviving until interpreter shutdown." -msgstr "" +msgid "" +"For modern Python versions (since version 2.3), interning a string (e.g. " +"with :func:`sys.intern`) does not cause it to become immortal. Instead, if " +"the last reference to that string disappears, it will be removed from the " +"interned string table. This is not the case for the free-threaded build " +"and any interned string will become immortal, surviving until interpreter " +"shutdown." +msgstr "" +"در نسخه‌های مدرن پایتون (از نسخه‌ی 2.3)، اینترن کردن (interning) یک رشته " +"(برای نمونه با :func:`sys.intern`) باعث نامیرا شدن آن نمی‌شود. در عوض، اگر " +"آخرین ارجاع به آن رشته از بین برود، آن رشته از جدول رشته‌های اینترن‌شده " +"(interned string table) حذف خواهد شد. این موضوع در مورد ساخته‌ی نخ‌آزادی " +"(free-threaded build) صدق نمی‌کند و هر رشته‌ی اینترن‌شده‌ای نامیرا خواهد شد و " +"تا خاموش شدن مفسر باقی خواهد ماند." msgid "Non-GC objects have a larger object header" -msgstr "" +msgstr "اشیای غیر GC سرآیند شیء بزرگ‌تری دارند" -msgid "The free-threaded build uses a different :c:type:`PyObject` structure. Instead of having the GC related information allocated before the :c:type:`PyObject` structure, like in the default build, the GC related info is part of the normal object header. For example, on the AMD64 platform, ``None`` uses 32 bytes on the free-threaded build vs 16 bytes for the default build. GC objects (such as dicts and lists) are the same size for both builds since the free-threaded build does not use additional space for the GC info." -msgstr "" +msgid "" +"The free-threaded build uses a different :c:type:`PyObject` structure. " +"Instead of having the GC related information allocated before " +"the :c:type:`PyObject` structure, like in the default build, the GC related " +"info is part of the normal object header. For example, on the AMD64 " +"platform, ``None`` uses 32 bytes on the free-threaded build vs 16 bytes for " +"the default build. GC objects (such as dicts and lists) are the same size " +"for both builds since the free-threaded build does not use additional space " +"for the GC info." +msgstr "" +"ساخت آزادنخاز ساختار :c:type:`PyObject` متفاوتی استفاده " +"می‌کند. به جای این که اطلاعات مربوط به زباله‌روبی، مانند ساخت پیش‌فرض، پیش از " +"ساختار :c:type:`PyObject` تخصیص داده شود، این اطلاعات بخشی از سرآیند معمولی " +"شیء است. برای نمونه، در سکوی AMD64، ``None`` در ساخت آزادنخ از ۳۲ بایت " +"استفاده می‌کند، در مقابل ۱۶ بایت برای ساخت پیش‌فرض. اشیای تحت مدیریت " +"زباله‌روبی (مانند دیکشنری‌ها و فهرست‌ها) در هر دو ساخت اندازه یکسانی دارند، " +"زیرا ساخت آزادنخ از فضای اضافی برای اطلاعات مربوط به زباله‌روبی استفاده " +"نمی‌کند." msgid "QSBR can delay freeing of memory" -msgstr "" +msgstr "QSBR می‌تواند آزادسازی حافظه را به تأخیر بیندازد" -msgid "In order to safely implement lock-free data structures, a safe memory reclamation (SMR) scheme is used, known as quiescent state-based reclamation (QSBR). This means that the memory backing data structures allowing lock-free access will use QSBR, which defers the free operation, rather than immediately freeing the memory. Two examples of these data structures are the list object and the dictionary keys object. See ``InternalDocs/qsbr.md`` in the CPython source tree for more details on how QSBR is implemented. Running :func:`gc.collect` should cause all memory being held by QSBR to be actually freed. Note that even when QSBR frees the memory, the underlying memory allocator may not immediately return that memory to the OS and so the resident set size (RSS) of the process might not decrease." -msgstr "" +msgid "" +"In order to safely implement lock-free data structures, a safe memory " +"reclamation (SMR) scheme is used, known as quiescent state-based " +"reclamation (QSBR). This means that the memory backing data structures " +"allowing lock-free access will use QSBR, which defers the free operation, " +"rather than immediately freeing the memory. Two examples of these data " +"structures are the list object and the dictionary keys object. See " +"``InternalDocs/qsbr.md`` in the CPython source tree for more details on how " +"QSBR is implemented. Running :func:`gc.collect` should cause all memory " +"being held by QSBR to be actually freed. Note that even when QSBR frees " +"the memory, the underlying memory allocator may not immediately return that " +"memory to the OS and so the resident set size (RSS) of the process might " +"not decrease." +msgstr "" +"برای پیاده‌سازی امن ساختارهای داده بدون قفل (lock-free)، از یک طرح بازیابی " +"امن حافظه (SMR) استفاده می‌شود که با نام بازیابی مبتنی بر حالت سکون (QSBR) " +"شناخته می‌شود. این بدان معناست که حافظه پشتیبان ساختارهای داده‌ای که دسترسی " +"بدون قفل را ممکن می‌سازند، از QSBR استفاده می‌کند؛ این طرح عملیات آزادسازی را " +"به تعویق می‌اندازد، نه اینکه حافظه را بلافاصله آزاد کند. دو نمونه از این " +"ساختارهای داده، شیء فهرست و شیء کلیدهای دیکشنری هستند. برای جزئیات بیشتر " +"درباره نحوه پیاده‌سازی QSBR، فایل ``InternalDocs/qsbr.md`` را در درخت منبع " +"CPython ببینید. اجرای :func:`gc.collect` باید موجب شود تمام حافظه‌ای که توسط " +"QSBR نگه‌داری می‌شود، به‌طور واقعی آزاد شود. توجه داشته باشید که حتی وقتی QSBR " +"حافظه را آزاد می‌کند، تخصیص‌دهنده حافظه زیرین ممکن است بلافاصله آن حافظه را " +"به سیستم‌عامل برنگرداند و بنابراین اندازه مجموعه مقیم (RSS) فرایند ممکن است " +"کاهش نیابد." msgid "mimalloc allocator vs pymalloc" -msgstr "" +msgstr "تخصیص‌دهنده‌ی mimalloc در مقابل pymalloc" -msgid "The default build will normally use the \"pymalloc\" memory allocator for small allocations (512 bytes or smaller). The free-threaded build does not use pymalloc and allocates all Python objects using the \"mimalloc\" allocator. The pymalloc allocator has the following properties that help keep memory usage low: small per-allocated-block overhead, effective memory fragmentation prevention, and quick return of free memory to the operating system. The mimalloc allocator does quite well in these respects as well but can have some more overhead." -msgstr "" +msgid "" +"The default build will normally use the \"pymalloc\" memory allocator for " +"small allocations (512 bytes or smaller). The free-threaded build does not " +"use pymalloc and allocates all Python objects using the \"mimalloc\" " +"allocator. The pymalloc allocator has the following properties that help " +"keep memory usage low: small per-allocated-block overhead, effective memory " +"fragmentation prevention, and quick return of free memory to the operating " +"system. The mimalloc allocator does quite well in these respects as well " +"but can have some more overhead." +msgstr "" +"ساخت پیش‌فرض معمولاً از تخصیص‌دهنده‌ی حافظه‌ی \"pymalloc\" برای تخصیص‌های کوچک (۵۱۲ " +"بایت یا کوچک‌تر) استفاده می‌کند. ساخت آزادنخاز pymalloc " +"استفاده نمی‌کند و همه‌ی اشیای پایتون را با استفاده از تخصیص‌دهنده‌ی \"mimalloc\" " +"تخصیص می‌دهد. تخصیص‌دهنده‌ی pymalloc ویژگی‌های زیر را دارد که به پایین نگه‌داشتن " +"مصرف حافظه کمک می‌کنند: سربار کم به ازای هر بلوک تخصیص‌داده‌شده، جلوگیری مؤثر " +"از تکه‌تکه شدن حافظه، و بازگرداندن سریع حافظه‌ی آزاد به سیستم‌عامل. تخصیص‌دهنده‌ی " +"mimalloc نیز در این زمینه‌ها عملکرد بسیار خوبی دارد، اما ممکن است سربار " +"بیشتری داشته باشد." -msgid "In the free-threaded build, mimalloc manages memory in a number of separate heaps (currently four). For example, all GC supporting objects are allocated from their own heap. Using separate heaps means that free memory in one heap cannot be used for an allocation that uses another heap. Also, some heaps are configured to use QSBR (quiescent-state based reclamation) when freeing the memory that backs up the heap (known as \"pages\" in mimalloc terminology). The use of QSBR creates a delay between all memory blocks for a page being freed and the memory page being released, either for new allocations or back to the OS." -msgstr "" +msgid "" +"In the free-threaded build, mimalloc manages memory in a number of separate " +"heaps (currently four). For example, all GC supporting objects are " +"allocated from their own heap. Using separate heaps means that free memory " +"in one heap cannot be used for an allocation that uses another heap. Also, " +"some heaps are configured to use QSBR (quiescent-state based reclamation) " +"when freeing the memory that backs up the heap (known as \"pages\" in " +"mimalloc terminology). The use of QSBR creates a delay between all memory " +"blocks for a page being freed and the memory page being released, either " +"for new allocations or back to the OS." +msgstr "" +"در ساخت نخ‌آزاد ، mimalloc حافظه را در تعدادی هیپ " +"جداگانه مدیریت می‌کند (در حال حاضر چهار). برای مثال، همه اشیایی که از GC " +"پشتیبانی می‌کنند، از هیپ خودشان تخصیص داده می‌شوند. استفاده از هیپ‌های " +"جداگانه به این معناست که حافظه آزاد در یک هیپ نمی‌تواند برای تخصیصی به‌کار " +"رود که از هیپ دیگری استفاده می‌کند. همچنین، برخی هیپ‌ها به‌گونه‌ای پیکربندی " +"شده‌اند که هنگام آزادسازی حافظه‌ای که زیربنای هیپ است (و در اصطلاح mimalloc " +"به آن «page» گفته می‌شود)، از QSBR (بازپس‌گیری مبتنی بر حالت سکون) استفاده " +"کنند. استفاده از QSBR بین آزاد شدن همه بلوک‌های حافظه یک صفحه و رهاسازی صفحه " +"حافظه، چه برای تخصیص‌های جدید و چه برای بازگشت به سیستم‌عامل، تأخیر ایجاد " +"می‌کند." -msgid "The mimalloc allocator also defers returning freed memory back to the OS. You can reduce that delay by setting the environment variable :envvar:`!MIMALLOC_PURGE_DELAY` to ``0``. Note that this will likely reduce the performance of the allocator." +msgid "" +"The mimalloc allocator also defers returning freed memory back to the OS. " +"You can reduce that delay by setting the environment variable :envvar:`!" +"MIMALLOC_PURGE_DELAY` to ``0``. Note that this will likely reduce the " +"performance of the allocator." msgstr "" +"تخصیص‌دهنده‌ی mimalloc همچنین بازگرداندن حافظه‌ی آزادشده به سیستم‌عامل را به " +"تعویق می‌اندازد. شما می‌توانید این تأخیر را با تنظیم متغیر محیطی :envvar:`!" +"MIMALLOC_PURGE_DELAY` روی ``0`` کاهش دهید. توجه داشته باشید که این کار " +"احتمالاً عملکرد تخصیص‌دهنده را کاهش می‌دهد." msgid "Free-threaded reference counting can cause objects to live longer" msgstr "" +"شمارش ارجاع نخ‌آزادمی‌تواند باعث شود " +"اشیاء بیشتر زنده بمانند" -msgid "In the default build, when an object's reference count reaches zero, it is normally deallocated. The free-threaded build uses \"biased reference counting\", with a fast-path for objects \"owned\" by the current thread and a slow path for other objects. See :pep:`703` for additional details. Any time an object's reference count ends up in a \"queued\" state, deallocation can be deferred. The queued state is cleared from the \"eval breaker\" section of the bytecode evaluator." -msgstr "" +msgid "" +"In the default build, when an object's reference count reaches zero, it is " +"normally deallocated. The free-threaded build uses \"biased reference " +"counting\", with a fast-path for objects \"owned\" by the current thread " +"and a slow path for other objects. See :pep:`703` for additional details. " +"Any time an object's reference count ends up in a \"queued\" state, " +"deallocation can be deferred. The queued state is cleared from the \"eval " +"breaker\" section of the bytecode evaluator." +msgstr "" +"در ساخت پیش‌فرض، وقتی شمار ارجاع یک شیء به صفر می‌رسد، آن شیء معمولاً آزاد " +"می‌شود. ساخت نخ‌آزادی از «شمارش ارجاع سوگیرانه» (biased " +"reference counting) استفاده می‌کند که دارای یک مسیر سریع برای اشیاء «متعلق» " +"به نخ جاری و یک مسیر کند برای اشیاء دیگر است. برای جزئیات بیشتر :pep:`703` " +"را ببینید. هر زمان که شمار ارجاع یک شیء در وضعیت «در صف» (queued) قرار " +"گیرد، آزادسازی می‌تواند به تعویق بیفتد. وضعیت در صف از بخش «eval breaker» " +"ارزیاب بایت‌کد پاک می‌شود." -msgid "The free-threaded build also allows a different mode of reference counting, known as \"deferred reference counting\". This mode is enabled by setting a flag on a per-object basis. Deferred reference counting is enabled for the following types:" +msgid "" +"The free-threaded build also allows a different mode of reference counting, " +"known as \"deferred reference counting\". This mode is enabled by setting " +"a flag on a per-object basis. Deferred reference counting is enabled for " +"the following types:" msgstr "" +"ساخت نخ‌آزادهمچنین حالت متفاوتی از شمارش ارجاع را فراهم " +"می‌کند که با نام «شمارش ارجاع معوق (deferred reference counting)» شناخته " +"می‌شود. این حالت با تنظیم پرچمی به‌ازای هر شیء فعال می‌شود. شمارش ارجاع معوق " +"برای انواع زیر فعال است:" msgid "module objects" -msgstr "" +msgstr "اشیای ماژول" msgid "module top-level functions" -msgstr "" +msgstr "توابع سطح بالای ماژول" msgid "class methods defined in the class scope" -msgstr "" +msgstr "متدهای کلاس تعریف‌شده در محدوده کلاس" msgid "descriptor objects" -msgstr "" +msgstr "اشیای توصیف‌گر" msgid "thread-local objects, created by :class:`threading.local`" -msgstr "" +msgstr "اشیای محلی نخ، ایجادشده توسط :class:`threading.local`" -msgid "When deferred reference counting is enabled, references from Python function stacks are not added to the reference count. This scheme reduces the overhead of reference counting, especially for objects used from multiple threads. Because the stack references are not counted, objects with deferred reference counting are not immediately freed when their internal reference count goes to zero. Instead, they are examined by the next GC run and, if no stack references to them are found, they are freed. This means these objects are freed by the GC and not when their reference count goes to zero, as is typical." -msgstr "" +msgid "" +"When deferred reference counting is enabled, references from Python " +"function stacks are not added to the reference count. This scheme reduces " +"the overhead of reference counting, especially for objects used from " +"multiple threads. Because the stack references are not counted, objects " +"with deferred reference counting are not immediately freed when their " +"internal reference count goes to zero. Instead, they are examined by the " +"next GC run and, if no stack references to them are found, they are freed. " +"This means these objects are freed by the GC and not when their reference " +"count goes to zero, as is typical." +msgstr "" +"هنگامی که شمارش ارجاع معوق (deferred reference counting) فعال باشد، " +"ارجاع‌ها از پشته‌های تابع پایتون به شمار ارجاع‌ها افزوده نمی‌شوند. این سازوکار " +"سربار شمارش ارجاع را کاهش می‌دهد، به‌ویژه برای اشیایی که توسط چندین نخ " +"استفاده می‌شوند. از آن‌جا که ارجاع‌های پشته شمرده نمی‌شوند، اشیایی که شمارش " +"ارجاع تعویقی دارند، هنگامی که شمار ارجاع داخلی آن‌ها به صفر می‌رسد، بلافاصله " +"آزاد نمی‌شوند. در عوض، آن‌ها در اجرای بعدی زباله‌روبی بررسی می‌شوند و اگر هیچ " +"ارجاعی از پشته به آن‌ها یافت نشود، آزاد می‌شوند. این یعنی این شیء‌ها به‌جای " +"آزاد شدن مانند حالت معمول با صفر شدن شمار ارجاعشان، توسط زباله‌روبی آزاد " +"می‌شوند." msgid "Per-thread reference counting can delay freeing objects" -msgstr "" +msgstr "شمارش ارجاع به‌ازای هر نخ می‌تواند آزادسازی اشیاء را به تأخیر بیندازد" -msgid "To avoid contention on the reference count fields of frequently shared objects, the free-threaded build also uses \"per-thread reference counting\" for a few selected object types. Rather than updating a single shared reference count, each thread maintains its own local reference count array, indexed by a unique id assigned to the object. The true reference count is only computed by summing the per-thread counts when the object's local count drops to zero. Per-thread reference counting is currently used for:" -msgstr "" +msgid "" +"To avoid contention on the reference count fields of frequently shared " +"objects, the free-threaded build also uses \"per-thread reference " +"counting\" for a few selected object types. Rather than updating a single " +"shared reference count, each thread maintains its own local reference count " +"array, indexed by a unique id assigned to the object. The true reference " +"count is only computed by summing the per-thread counts when the object's " +"local count drops to zero. Per-thread reference counting is currently used " +"for:" +msgstr "" +"برای اجتناب از رقابت بر سر فیلدهای شمارش ارجاع اشیایی که به‌طور مکرر به " +"اشتراک گذاشته می‌شوند، ساخت آزادنخنیز از «شمارش ارجاع " +"به‌ازای هر نخ» برای چند نوع شیء انتخاب‌شده استفاده می‌کند. به‌جای به‌روزرسانی یک " +"شمارش ارجاع مشترک واحد، هر نخ آرایه شمارش ارجاع محلی خود را نگه‌داری می‌کند؛ " +"این آرایه با شناسه‌ای یکتا که به شیء اختصاص داده شده است، اندیس‌دهی می‌شود. " +"شمارش ارجاع واقعی تنها زمانی با جمع‌کردن شمارش‌های به‌ازای هر نخ محاسبه می‌شود " +"که شمارش محلی شیء به ۰ برسد. شمارش ارجاع به‌ازای هر نخ در حال حاضر برای " +"موارد زیر استفاده می‌شود:" msgid "heap type objects (classes created in Python)" -msgstr "" +msgstr "اشیای نوع هیپ (کلاس‌های ایجادشده در پایتون)" msgid "code objects" -msgstr "" +msgstr "اشیای کد" msgid "the ``__dict__`` of module objects" -msgstr "" +msgstr "``__dict__`` اشیای ماژول" -msgid "Because the per-thread counts must be merged back to the object before it can be deallocated, objects using per-thread reference counting are typically freed later than they would be in the default build. In particular, such an object is usually not freed until the thread that referenced it reaches a safe point (for example, in the \"eval breaker\" section of the bytecode evaluator) or exits. Running :func:`gc.collect` will merge the per-thread counts and allow these objects to be freed." -msgstr "" +msgid "" +"Because the per-thread counts must be merged back to the object before it " +"can be deallocated, objects using per-thread reference counting are " +"typically freed later than they would be in the default build. In " +"particular, such an object is usually not freed until the thread that " +"referenced it reaches a safe point (for example, in the \"eval breaker\" " +"section of the bytecode evaluator) or exits. Running :func:`gc.collect` " +"will merge the per-thread counts and allow these objects to be freed." +msgstr "" +"از آن‌جا که شمارش‌های ارجاع به‌ازای هر نخ باید پیش از امکان آزادسازی شیء، " +"دوباره با آن ادغام شوند، اشیایی که از شمارش ارجاع به‌ازای هر نخ استفاده " +"می‌کنند معمولاً دیرتر از زمانی آزاد می‌شوند که در ساخت پیش‌فرض آزاد می‌شدند. " +"به‌ویژه، چنین شیئی معمولاً تا زمانی آزاد نمی‌شود که نخی که به آن ارجاع داده " +"است به یک نقطه امن برسد (برای مثال، در بخش «eval breaker» ارزیاب بایت‌کد) یا " +"خارج شود. اجرای :func:`gc.collect` شمارش‌های ارجاع به‌ازای هر نخ را ادغام " +"می‌کند و اجازه می‌دهد این اشیاء آزاد شوند." diff --git a/howto/functional.po b/howto/functional.po index 73ed84b7e..7c4269fe2 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -25,136 +25,399 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Functional Programming HOWTO" -msgstr "" +msgstr "چگونگی برنامه‌نویسی تابعی" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "\\A. M. Kuchling" -msgstr "" +msgstr "\\A. M. Kuchling" msgid "Release" -msgstr "" +msgstr "انتشار" msgid "0.32" -msgstr "" +msgstr "0.32" -msgid "In this document, we'll take a tour of Python's features suitable for implementing programs in a functional style. After an introduction to the concepts of functional programming, we'll look at language features such as :term:`iterator`\\s and :term:`generator`\\s and relevant library modules such as :mod:`itertools` and :mod:`functools`." +msgid "" +"In this document, we'll take a tour of Python's features suitable for " +"implementing programs in a functional style. After an introduction to the " +"concepts of functional programming, we'll look at language features such as " +":term:`iterator`\\s and :term:`generator`\\s and relevant library modules " +"such as :mod:`itertools` and :mod:`functools`." msgstr "" +"در این سند، مروری بر ویژگی‌های پایتون مناسب برای پیاده‌سازی برنامه‌ها به سبک تابعی خواهیم داشت. پس از مقدمه‌ای بر مفاهیم برنامه‌نویسی تابعی، به ویژگی‌های زبانی مانند :term:`iterator`\\s و :term:`تولیدگر `\\s و ماژول‌های کتابخانه‌ای مرتبط مانند :mod:`itertools` و :mod:`functools` می‌پردازیم." msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "This section explains the basic concept of functional programming; if you're just interested in learning about Python language features, skip to the next section on :ref:`functional-howto-iterators`." +msgid "" +"This section explains the basic concept of functional programming; if you're" +" just interested in learning about Python language features, skip to the " +"next section on :ref:`functional-howto-iterators`." msgstr "" +"این بخش مفهوم پایه‌ی برنامه‌نویسی تابعی را توضیح می‌دهد؛ اگر فقط به یادگیری " +"ویژگی‌های زبان پایتون علاقه دارید، به بخش بعدی درباره‌ی :ref:`functional-" +"howto-iterators` بروید." -msgid "Programming languages support decomposing problems in several different ways:" +msgid "" +"Programming languages support decomposing problems in several different " +"ways:" msgstr "" +"زبان‌های برنامه‌نویسی امکان تجزیه مسائل را به چندین روش مختلف فراهم می‌کنند:" -msgid "Most programming languages are **procedural**: programs are lists of instructions that tell the computer what to do with the program's input. C, Pascal, and even Unix shells are procedural languages." +msgid "" +"Most programming languages are **procedural**: programs are lists of " +"instructions that tell the computer what to do with the program's input. C," +" Pascal, and even Unix shells are procedural languages." msgstr "" +"بیشتر زبان‌های برنامه‌نویسی **رویه‌ای** هستند: برنامه‌ها فهرست‌هایی از " +"دستورالعمل‌ها هستند که به رایانه می‌گویند با ورودی برنامه چه کاری انجام دهد." +" C، Pascal و حتی پوسته‌های یونیکس زبان‌های رویه‌ای هستند." -msgid "In **declarative** languages, you write a specification that describes the problem to be solved, and the language implementation figures out how to perform the computation efficiently. SQL is the declarative language you're most likely to be familiar with; a SQL query describes the data set you want to retrieve, and the SQL engine decides whether to scan tables or use indexes, which subclauses should be performed first, etc." -msgstr "" +msgid "" +"In **declarative** languages, you write a specification that describes the " +"problem to be solved, and the language implementation figures out how to " +"perform the computation efficiently. SQL is the declarative language you're" +" most likely to be familiar with; a SQL query describes the data set you " +"want to retrieve, and the SQL engine decides whether to scan tables or use " +"indexes, which subclauses should be performed first, etc." +msgstr "" +"در زبان‌های **اعلانی**، شما مشخصاتی می‌نویسید که مسئله‌ی موردحل را توصیف " +"می‌کند و پیاده‌سازی زبان تشخیص می‌دهد که چگونه محاسبات را به‌صورت کارآمد " +"انجام دهد. SQL زبان اعلانی‌ای است که احتمالاً بیش از همه با آن آشنا هستید؛ " +"یک پرس‌وجوی SQL مجموعه‌داده‌ای را که می‌خواهید بازیابی کنید توصیف می‌کند و " +"موتور SQL تصمیم می‌گیرد که آیا جدول‌ها را پویش کند یا از اندیس‌ها استفاده " +"کند، کدام زیربند باید ابتدا اجرا شود و غیره." -msgid "**Object-oriented** programs manipulate collections of objects. Objects have internal state and support methods that query or modify this internal state in some way. Smalltalk and Java are object-oriented languages. C++ and Python are languages that support object-oriented programming, but don't force the use of object-oriented features." -msgstr "" +msgid "" +"**Object-oriented** programs manipulate collections of objects. Objects " +"have internal state and support methods that query or modify this internal " +"state in some way. Smalltalk and Java are object-oriented languages. C++ " +"and Python are languages that support object-oriented programming, but don't" +" force the use of object-oriented features." +msgstr "" +"برنامه‌های **شیء‌گرا** مجموعه‌هایی از اشیاء را دستکاری می‌کنند. اشیاء دارای " +"وضعیت داخلی هستند و از متدهایی پشتیبانی می‌کنند که این وضعیت داخلی را به " +"شکلی پرس‌وجو یا تغییر می‌دهند. Smalltalk و Java زبان‌های شیء‌گرا هستند. C++ " +"و Python زبان‌هایی هستند که از برنامه‌نویسی شیء‌گرا پشتیبانی می‌کنند، اما " +"استفاده از قابلیت‌های شیء‌گرا را تحمیل نمی‌کنند." -msgid "**Functional** programming decomposes a problem into a set of functions. Ideally, functions only take inputs and produce outputs, and don't have any internal state that affects the output produced for a given input. Well-known functional languages include the ML family (Standard ML, OCaml, and other variants) and Haskell." -msgstr "" +msgid "" +"**Functional** programming decomposes a problem into a set of functions. " +"Ideally, functions only take inputs and produce outputs, and don't have any " +"internal state that affects the output produced for a given input. Well-" +"known functional languages include the ML family (Standard ML, OCaml, and " +"other variants) and Haskell." +msgstr "" +"برنامه‌نویسی تابعی یک مسئله را به مجموعه‌ای از توابع تجزیه می‌کند. در حالت " +"ایده‌آل، توابع تنها ورودی‌ها را دریافت می‌کنند و خروجی‌ها را تولید می‌کنند و" +" هیچ وضعیت داخلی‌ای ندارند که بر خروجی تولیدشده برای یک ورودی مشخص تأثیر " +"بگذارد. زبان‌های تابعی شناخته‌شده شامل خانواده ML (شامل Standard ML، OCaml و" +" سایر گونه‌ها) و Haskell هستند." -msgid "The designers of some computer languages choose to emphasize one particular approach to programming. This often makes it difficult to write programs that use a different approach. Other languages are multi-paradigm languages that support several different approaches. Lisp, C++, and Python are multi-paradigm; you can write programs or libraries that are largely procedural, object-oriented, or functional in all of these languages. In a large program, different sections might be written using different approaches; the GUI might be object-oriented while the processing logic is procedural or functional, for example." -msgstr "" +msgid "" +"The designers of some computer languages choose to emphasize one particular " +"approach to programming. This often makes it difficult to write programs " +"that use a different approach. Other languages are multi-paradigm languages" +" that support several different approaches. Lisp, C++, and Python are multi-" +"paradigm; you can write programs or libraries that are largely procedural, " +"object-oriented, or functional in all of these languages. In a large " +"program, different sections might be written using different approaches; the" +" GUI might be object-oriented while the processing logic is procedural or " +"functional, for example." +msgstr "" +"طراحان برخی زبان‌های رایانه‌ای انتخاب می‌کنند که بر یک رویکرد خاص به " +"برنامه‌نویسی تأکید کنند. این موضوع اغلب نوشتن برنامه‌هایی را که از رویکرد " +"متفاوتی استفاده می‌کنند دشوار می‌کند. سایر زبان‌ها، زبان‌های چندپارادایمی " +"هستند که از چندین رویکرد متفاوت پشتیبانی می‌کنند. Lisp، C++ و Python " +"چندپارادایمی هستند؛ شما می‌توانید در همه‌ی این زبان‌ها برنامه‌ها یا " +"کتابخانه‌هایی بنویسید که عمدتاً رویه‌ای، شیءگرا یا تابعی هستند. در یک " +"برنامه‌ی بزرگ، ممکن است بخش‌های مختلف با استفاده از رویکردهای متفاوتی نوشته " +"شوند؛ برای مثال، ممکن است GUI شیءگرا باشد، در حالی که منطق پردازش رویه‌ای یا" +" تابعی است." -msgid "In a functional program, input flows through a set of functions. Each function operates on its input and produces some output. Functional style discourages functions with side effects that modify internal state or make other changes that aren't visible in the function's return value. Functions that have no side effects at all are called **purely functional**. Avoiding side effects means not using data structures that get updated as a program runs; every function's output must only depend on its input." -msgstr "" +msgid "" +"In a functional program, input flows through a set of functions. Each " +"function operates on its input and produces some output. Functional style " +"discourages functions with side effects that modify internal state or make " +"other changes that aren't visible in the function's return value. Functions" +" that have no side effects at all are called **purely functional**. " +"Avoiding side effects means not using data structures that get updated as a " +"program runs; every function's output must only depend on its input." +msgstr "" +"در یک برنامه تابعی، ورودی از میان مجموعه‌ای از توابع عبور می‌کند. هر تابع " +"روی ورودی خود عمل می‌کند و خروجی‌ای تولید می‌کند. سبک تابعی از توابع دارای " +"عوارض جانبی‌ای که وضعیت داخلی را تغییر می‌دهند یا تغییرات دیگری ایجاد " +"می‌کنند که در مقدار بازگشتی تابع قابل مشاهده نیستند، پرهیز می‌کند. به توابعی" +" که هیچ‌گونه عارضه جانبی ندارند، **کاملاً تابعی** گفته می‌شود. اجتناب از " +"عوارض جانبی به معنای عدم استفاده از ساختارهای داده‌ای است که در حین اجرای " +"برنامه به‌روزرسانی می‌شوند؛ خروجی هر تابع باید تنها به ورودی آن وابسته باشد." -msgid "Some languages are very strict about purity and don't even have assignment statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all side effects, such as printing to the screen or writing to a disk file. Another example is a call to the :func:`print` or :func:`time.sleep` function, neither of which returns a useful value. Both are called only for their side effects of sending some text to the screen or pausing execution for a second." -msgstr "" +msgid "" +"Some languages are very strict about purity and don't even have assignment " +"statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all" +" side effects, such as printing to the screen or writing to a disk file. " +"Another example is a call to the :func:`print` or :func:`time.sleep` " +"function, neither of which returns a useful value. Both are called only for " +"their side effects of sending some text to the screen or pausing execution " +"for a second." +msgstr "" +"برخی زبان‌ها در مورد خلوص بسیار سخت‌گیر هستند و حتی دستور انتسابی مانند " +"``a=3`` یا ``c = a + b`` ندارند، اما اجتناب از تمام عوارض جانبی، مانند چاپ " +"روی صفحه‌نمایش یا نوشتن در یک فایل روی دیسک، دشوار است. مثالی دیگر، فراخوانی" +" تابع :func:`print` یا :func:`time.sleep` است که هیچ‌کدام مقدار مفیدی " +"برنمی‌گرداند. هر دو فقط برای عوارض جانبی‌شان، یعنی ارسال مقداری متن به " +"صفحه‌نمایش یا مکث در اجرا برای یک ثانیه، فراخوانی می‌شوند." -msgid "Python programs written in functional style usually won't go to the extreme of avoiding all I/O or all assignments; instead, they'll provide a functional-appearing interface but will use non-functional features internally. For example, the implementation of a function will still use assignments to local variables, but won't modify global variables or have other side effects." -msgstr "" +msgid "" +"Python programs written in functional style usually won't go to the extreme " +"of avoiding all I/O or all assignments; instead, they'll provide a " +"functional-appearing interface but will use non-functional features " +"internally. For example, the implementation of a function will still use " +"assignments to local variables, but won't modify global variables or have " +"other side effects." +msgstr "" +"برنامه‌های پایتون نوشته‌شده به سبک تابعی معمولاً تا سرحد اجتناب کامل از تمام" +" ورودی/خروجی‌ها یا تمام انتساب‌ها پیش نمی‌روند؛ در عوض، رابطی با ظاهر تابعی " +"ارائه می‌دهند، اما به‌صورت درونی از قابلیت‌های غیرتابعی استفاده می‌کنند. " +"برای مثال، پیاده‌سازی یک تابع همچنان از انتساب‌ها به متغیرهای محلی استفاده " +"می‌کند، اما متغیرهای سراسری را تغییر نمی‌دهد و عوارض جانبی دیگری ندارد." -msgid "Functional programming can be considered the opposite of object-oriented programming. Objects are little capsules containing some internal state along with a collection of method calls that let you modify this state, and programs consist of making the right set of state changes. Functional programming wants to avoid state changes as much as possible and works with data flowing between functions. In Python you might combine the two approaches by writing functions that take and return instances representing objects in your application (e-mail messages, transactions, etc.)." -msgstr "" +msgid "" +"Functional programming can be considered the opposite of object-oriented " +"programming. Objects are little capsules containing some internal state " +"along with a collection of method calls that let you modify this state, and " +"programs consist of making the right set of state changes. Functional " +"programming wants to avoid state changes as much as possible and works with " +"data flowing between functions. In Python you might combine the two " +"approaches by writing functions that take and return instances representing " +"objects in your application (e-mail messages, transactions, etc.)." +msgstr "" +"برنامه‌نویسی تابعی می‌تواند متضاد برنامه‌نویسی شیء‌گرا در نظر گرفته شود. " +"شیء‌ها کپسول‌های کوچکی هستند که حاوی وضعیتی داخلی به همراه مجموعه‌ای از " +"فراخوانی‌های متد هستند که به شما اجازه می‌دهند این وضعیت را تغییر دهید، و " +"برنامه‌ها از ایجاد مجموعه‌ای درست از تغییرات وضعیت تشکیل شده‌اند. " +"برنامه‌نویسی تابعی می‌خواهد تا حد امکان از تغییرات وضعیت اجتناب کند و با " +"جریان داده بین توابع کار می‌کند. در پایتون ممکن است این دو رویکرد را با " +"نوشتن توابعی ترکیب کنید که نمونه‌هایی نشان‌دهنده‌ی اشیایی در برنامه شما " +"(پیام‌های ایمیل، تراکنش‌ها و غیره) را دریافت می‌کنند و برمی‌گردانند." -msgid "Functional design may seem like an odd constraint to work under. Why should you avoid objects and side effects? There are theoretical and practical advantages to the functional style:" +msgid "" +"Functional design may seem like an odd constraint to work under. Why should" +" you avoid objects and side effects? There are theoretical and practical " +"advantages to the functional style:" msgstr "" +"طراحی تابعی ممکن است محدودیتی عجیب برای کار کردن تحت آن به نظر برسد. چرا " +"باید از اشیاء و عوارض جانبی اجتناب کنید؟ سبک تابعی مزایای نظری و عملی دارد:" msgid "Formal provability." -msgstr "" +msgstr "اثبات‌پذیری صوری." msgid "Modularity." -msgstr "" +msgstr "پیمانه‌ای بودن." msgid "Composability." -msgstr "" +msgstr "ترکیب‌پذیری." msgid "Ease of debugging and testing." -msgstr "" +msgstr "سهولت اشکال‌زدایی و آزمون." msgid "Formal provability" -msgstr "" +msgstr "اثبات‌پذیری رسمی" -msgid "A theoretical benefit is that it's easier to construct a mathematical proof that a functional program is correct." +msgid "" +"A theoretical benefit is that it's easier to construct a mathematical proof " +"that a functional program is correct." msgstr "" +"یک مزیت نظری این است که ساختن اثبات ریاضی برای صحیح بودن یک برنامه تابعی " +"آسان‌تر است." -msgid "For a long time researchers have been interested in finding ways to mathematically prove programs correct. This is different from testing a program on numerous inputs and concluding that its output is usually correct, or reading a program's source code and concluding that the code looks right; the goal is instead a rigorous proof that a program produces the right result for all possible inputs." -msgstr "" +msgid "" +"For a long time researchers have been interested in finding ways to " +"mathematically prove programs correct. This is different from testing a " +"program on numerous inputs and concluding that its output is usually " +"correct, or reading a program's source code and concluding that the code " +"looks right; the goal is instead a rigorous proof that a program produces " +"the right result for all possible inputs." +msgstr "" +"برای مدت طولانی، پژوهشگران به یافتن راه‌هایی برای اثبات ریاضیاتی صحت " +"برنامه‌ها علاقه‌مند بوده‌اند. این امر با آزمایش یک برنامه روی ورودی‌های " +"متعدد و نتیجه‌گیری اینکه خروجی آن معمولاً صحیح است، یا خواندن کد منبع یک " +"برنامه و نتیجه‌گیری اینکه کد درست به نظر می‌رسد، متفاوت است؛ در عوض، هدف " +"اثبات دقیقی است که نشان می‌دهد یک برنامه نتیجه درست را برای تمام ورودی‌های " +"ممکن تولید می‌کند." -msgid "The technique used to prove programs correct is to write down **invariants**, properties of the input data and of the program's variables that are always true. For each line of code, you then show that if invariants X and Y are true **before** the line is executed, the slightly different invariants X' and Y' are true **after** the line is executed. This continues until you reach the end of the program, at which point the invariants should match the desired conditions on the program's output." -msgstr "" +msgid "" +"The technique used to prove programs correct is to write down " +"**invariants**, properties of the input data and of the program's variables " +"that are always true. For each line of code, you then show that if " +"invariants X and Y are true **before** the line is executed, the slightly " +"different invariants X' and Y' are true **after** the line is executed. " +"This continues until you reach the end of the program, at which point the " +"invariants should match the desired conditions on the program's output." +msgstr "" +"روشی که برای اثبات صحت برنامه‌ها به کار می‌رود، نوشتن **ناورداها** است؛" +" یعنی ویژگی‌هایی از داده‌های ورودی و متغیرهای برنامه که همیشه برقرار هستند. " +"سپس برای هر خط کد، نشان می‌دهید که اگر ناورداهای X و Y **پیش از** اجرای" +" آن خط برقرار باشند، ناورداهای اندکی متفاوت X' و Y' **پس از** اجرای آن " +"خط برقرار خواهند بود. این کار تا رسیدن شما به پایان برنامه ادامه می‌یابد؛ در" +" آن نقطه، ناورداها باید با شرایط مطلوب برای خروجی برنامه مطابقت کنند." -msgid "Functional programming's avoidance of assignments arose because assignments are difficult to handle with this technique; assignments can break invariants that were true before the assignment without producing any new invariants that can be propagated onward." +msgid "" +"Functional programming's avoidance of assignments arose because assignments " +"are difficult to handle with this technique; assignments can break " +"invariants that were true before the assignment without producing any new " +"invariants that can be propagated onward." msgstr "" +"پرهیز برنامه‌نویسی تابعی از انتساب‌ها به این دلیل به‌وجود آمد که مدیریت " +"انتساب‌ها با این روش دشوار است؛ انتساب‌ها می‌توانند ناورداهایی را که پیش از " +"انتساب برقرار بودند نقض کنند، بدون آن‌که ناوردای جدیدی ایجاد کنند که " +"بتوان آن را به مراحل بعدی منتقل کرد." -msgid "Unfortunately, proving programs correct is largely impractical and not relevant to Python software. Even trivial programs require proofs that are several pages long; the proof of correctness for a moderately complicated program would be enormous, and few or none of the programs you use daily (the Python interpreter, your XML parser, your web browser) could be proven correct. Even if you wrote down or generated a proof, there would then be the question of verifying the proof; maybe there's an error in it, and you wrongly believe you've proved the program correct." -msgstr "" +msgid "" +"Unfortunately, proving programs correct is largely impractical and not " +"relevant to Python software. Even trivial programs require proofs that are " +"several pages long; the proof of correctness for a moderately complicated " +"program would be enormous, and few or none of the programs you use daily " +"(the Python interpreter, your XML parser, your web browser) could be proven " +"correct. Even if you wrote down or generated a proof, there would then be " +"the question of verifying the proof; maybe there's an error in it, and you " +"wrongly believe you've proved the program correct." +msgstr "" +"متأسفانه، اثبات صحت برنامه‌ها تا حد زیادی غیرعملی است و ارتباطی به نرم‌افزار" +" پایتون ندارد. حتی برنامه‌های بدیهی نیز به اثبات‌هایی چندین‌صفحه‌ای نیاز " +"دارند؛ اثبات صحت یک برنامه‌ی نسبتاً پیچیده بسیار بزرگ خواهد بود، و بسیار کم " +"یا هیچ‌کدام از برنامه‌هایی که روزانه استفاده می‌کنید (مفسر پایتون، " +"پارسرٔ XML شما، مرورگر وب شما) را نمی‌توان اثبات صحت کرد. حتی اگر " +"اثباتی را یادداشت یا تولید کنید، آنگاه مسئله‌ی تأیید آن اثبات مطرح می‌شود؛ " +"شاید خطایی در آن وجود داشته باشد و شما به‌اشتباه باور داشته باشید که صحت " +"برنامه را اثبات کرده‌اید." msgid "Modularity" -msgstr "" +msgstr "ماژولار بودن" -msgid "A more practical benefit of functional programming is that it forces you to break apart your problem into small pieces. Programs are more modular as a result. It's easier to specify and write a small function that does one thing than a large function that performs a complicated transformation. Small functions are also easier to read and to check for errors." -msgstr "" +msgid "" +"A more practical benefit of functional programming is that it forces you to " +"break apart your problem into small pieces. Programs are more modular as a " +"result. It's easier to specify and write a small function that does one " +"thing than a large function that performs a complicated transformation. " +"Small functions are also easier to read and to check for errors." +msgstr "" +"یک مزیت عملی‌تر برنامه‌نویسی تابعی این است که شما را وادار می‌کند مسئله‌ی " +"خود را به بخش‌های کوچک تقسیم کنید. در نتیجه، برنامه‌ها ماژولارتر می‌شوند. " +"مشخص کردن و نوشتن یک تابع کوچک که یک کار انجام می‌دهد، آسان‌تر از مشخص کردن " +"و نوشتن یک تابع بزرگ است که یک تبدیل پیچیده را انجام می‌دهد. توابع کوچک نیز " +"برای خواندن و بررسی خطاها آسان‌تر هستند." msgid "Ease of debugging and testing" -msgstr "" +msgstr "سهولت اشکال‌زدایی و آزمون" msgid "Testing and debugging a functional-style program is easier." -msgstr "" +msgstr "آزمون و اشکال‌زدایی یک برنامه به سبک تابعی آسان‌تر است." -msgid "Debugging is simplified because functions are generally small and clearly specified. When a program doesn't work, each function is an interface point where you can check that the data are correct. You can look at the intermediate inputs and outputs to quickly isolate the function that's responsible for a bug." +msgid "" +"Debugging is simplified because functions are generally small and clearly " +"specified. When a program doesn't work, each function is an interface point" +" where you can check that the data are correct. You can look at the " +"intermediate inputs and outputs to quickly isolate the function that's " +"responsible for a bug." msgstr "" +"اشکال‌زدایی ساده‌تر می‌شود، زیرا توابع عموماً کوچک و به‌وضوح مشخص‌شده‌اند. " +"هنگامی که برنامه‌ای کار نمی‌کند، هر تابع یک نقطه‌ی رابط است که می‌توانید در " +"آن درست بودن داده‌ها را بررسی کنید. شما می‌توانید با بررسی ورودی‌ها و " +"خروجی‌های میانی، تابعی را که مسئول یک اشکال است، به‌سرعت جدا کنید." -msgid "Testing is easier because each function is a potential subject for a unit test. Functions don't depend on system state that needs to be replicated before running a test; instead you only have to synthesize the right input and then check that the output matches expectations." +msgid "" +"Testing is easier because each function is a potential subject for a unit " +"test. Functions don't depend on system state that needs to be replicated " +"before running a test; instead you only have to synthesize the right input " +"and then check that the output matches expectations." msgstr "" +"آزمون آسان‌تر است، زیرا هر تابع موضوع بالقوه‌ای برای یک آزمون واحد است. توابع" +" به وضعیت سیستمی که باید پیش از اجرای یک آزمون بازتولید شود وابسته نیستند؛ " +"در عوض فقط باید ورودی درست را بسازید و سپس بررسی کنید که خروجی با انتظارات " +"مطابقت دارد." msgid "Composability" -msgstr "" +msgstr "ترکیب‌پذیری" -msgid "As you work on a functional-style program, you'll write a number of functions with varying inputs and outputs. Some of these functions will be unavoidably specialized to a particular application, but others will be useful in a wide variety of programs. For example, a function that takes a directory path and returns all the XML files in the directory, or a function that takes a filename and returns its contents, can be applied to many different situations." -msgstr "" +msgid "" +"As you work on a functional-style program, you'll write a number of " +"functions with varying inputs and outputs. Some of these functions will be " +"unavoidably specialized to a particular application, but others will be " +"useful in a wide variety of programs. For example, a function that takes a " +"directory path and returns all the XML files in the directory, or a function" +" that takes a filename and returns its contents, can be applied to many " +"different situations." +msgstr "" +"هنگامی که روی برنامه‌ای به سبک تابعی کار می‌کنید، تعدادی تابع با ورودی‌ها و " +"خروجی‌های متفاوت خواهید نوشت. برخی از این توابع ناگزیر برای یک کاربرد خاص " +"تخصصی خواهند بود، اما برخی دیگر در طیف وسیعی از برنامه‌ها مفید خواهند بود. " +"برای مثال، تابعی که مسیر یک پوشه را دریافت می‌کند و همه فایل‌های XML موجود " +"در آن پوشه را برمی‌گرداند، یا تابعی که نام یک فایل را دریافت می‌کند و " +"محتویات آن را برمی‌گرداند، می‌تواند در موقعیت‌های مختلف بسیاری کاربرد داشته " +"باشد." -msgid "Over time you'll form a personal library of utilities. Often you'll assemble new programs by arranging existing functions in a new configuration and writing a few functions specialized for the current task." +msgid "" +"Over time you'll form a personal library of utilities. Often you'll " +"assemble new programs by arranging existing functions in a new configuration" +" and writing a few functions specialized for the current task." msgstr "" +"به‌مرور زمان، شما کتابخانه‌ای شخصی از ابزارهای کاربردی تشکیل خواهید داد. " +"اغلب، برنامه‌های جدید را با چیدمان توابع موجود در یک پیکربندی جدید و نوشتن " +"چند تابع مخصوص وظیفه‌ی جاری خواهید ساخت." msgid "Iterators" -msgstr "" +msgstr "پیمایش‌گرها" -msgid "I'll start by looking at a Python language feature that's an important foundation for writing functional-style programs: iterators." +msgid "" +"I'll start by looking at a Python language feature that's an important " +"foundation for writing functional-style programs: iterators." msgstr "" +"با بررسی ویژگی‌ای از زبان پایتون آغاز می‌کنم که پایه‌ای مهم برای نوشتن " +"برنامه‌ها به‌سبک تابعی است: پیمایش‌گرها (iterators)." -msgid "An iterator is an object representing a stream of data; this object returns the data one element at a time. A Python iterator must support a method called :meth:`~iterator.__next__` that takes no arguments and always returns the next element of the stream. If there are no more elements in the stream, :meth:`~iterator.__next__` must raise the :exc:`StopIteration` exception. Iterators don't have to be finite, though; it's perfectly reasonable to write an iterator that produces an infinite stream of data." -msgstr "" +msgid "" +"An iterator is an object representing a stream of data; this object returns " +"the data one element at a time. A Python iterator must support a method " +"called :meth:`~iterator.__next__` that takes no arguments and always returns" +" the next element of the stream. If there are no more elements in the " +"stream, :meth:`~iterator.__next__` must raise the :exc:`StopIteration` " +"exception. Iterators don't have to be finite, though; it's perfectly " +"reasonable to write an iterator that produces an infinite stream of data." +msgstr "" +"پیمایشگر شیئی است که جریانی از داده را نشان می‌دهد؛ این شیء داده‌ها را هر " +"بار یک عنصر برمی‌گرداند. یک پیمایشگر پایتون باید از متدی به نام " +":meth:`~iterator.__next__` پشتیبانی کند که هیچ آرگومانی نمی‌گیرد و همیشه " +"عنصر بعدی جریان را برمی‌گرداند. اگر دیگر عنصری در جریان وجود نداشته باشد، " +":meth:`~iterator.__next__` باید استثنای :exc:`StopIteration` را پرتاب کند. " +"البته پیمایشگرها لازم نیست متناهی باشند؛ نوشتن پیمایشگری که جریان نامتناهی " +"از داده تولید می‌کند، کاملاً معقول است." -msgid "The built-in :func:`iter` function takes an arbitrary object and tries to return an iterator that will return the object's contents or elements, raising :exc:`TypeError` if the object doesn't support iteration. Several of Python's built-in data types support iteration, the most common being lists and dictionaries. An object is called :term:`iterable` if you can get an iterator for it." +msgid "" +"The built-in :func:`iter` function takes an arbitrary object and tries to " +"return an iterator that will return the object's contents or elements, " +"raising :exc:`TypeError` if the object doesn't support iteration. Several " +"of Python's built-in data types support iteration, the most common being " +"lists and dictionaries. An object is called :term:`iterable` if you can get" +" an iterator for it." msgstr "" +"تابع توکار :func:`iter` یک شیء دلخواه را می‌گیرد و تلاش می‌کند پیمایش‌گری برگرداند که محتویات یا عناصر شیء را برمی‌گرداند، و اگر شیء از تکرار پشتیبانی نکند، :exc:`TypeError` را پرتاب می‌کند. چندین نوع داده‌ی توکار پایتون از تکرار پشتیبانی می‌کنند، که رایج‌ترین آن‌ها فهرست‌ها و دیکشنری‌ها هستند. یک شیء :term:`پیمایش‌پذیر ` (پیمایش‌پذیر) نامیده می‌شود اگر بتوانید پیمایش‌گری برای آن دریافت کنید." msgid "You can experiment with the iteration interface manually:" -msgstr "" +msgstr "می‌توانید رابط تکرار را به‌صورت دستی آزمایش کنید:" -msgid "Python expects iterable objects in several different contexts, the most important being the :keyword:`for` statement. In the statement ``for X in Y``, Y must be an iterator or some object for which :func:`iter` can create an iterator. These two statements are equivalent::" +msgid "" +"Python expects iterable objects in several different contexts, the most " +"important being the :keyword:`for` statement. In the statement ``for X in " +"Y``, Y must be an iterator or some object for which :func:`iter` can create " +"an iterator. These two statements are equivalent::" msgstr "" +"پایتون در چندین زمینه مختلف، اشیاء پیمایش‌پذیر را انتظار دارد، مهم‌ترین آن‌ها " +"دستور :keyword:`for` است. در دستور ``for X in Y``، Y باید یک پیمایش‌گر باشد یا" +" شیئی که :func:`iter` بتواند برای آن یک پیمایش‌گر ایجاد کند. این دو دستور " +"معادل هستند::" msgid "" "for i in iter(obj):\n" @@ -163,27 +426,78 @@ msgid "" "for i in obj:\n" " print(i)" msgstr "" +"for i in iter(obj):\n" +" print(i)\n" +"\n" +"for i in obj:\n" +" print(i)" -msgid "Iterators can be materialized as lists or tuples by using the :func:`list` or :func:`tuple` constructor functions:" +msgid "" +"Iterators can be materialized as lists or tuples by using the :func:`list` " +"or :func:`tuple` constructor functions:" msgstr "" +"پیمایش‌گرها را می‌توان با استفاده از توابع سازنده‌ی :func:`list` یا " +":func:`tuple` به‌صورت فهرست یا تاپل درآورد:" -msgid "Sequence unpacking also supports iterators: if you know an iterator will return N elements, you can unpack them into an N-tuple:" +msgid "" +"Sequence unpacking also supports iterators: if you know an iterator will " +"return N elements, you can unpack them into an N-tuple:" msgstr "" +"واگشایی دنباله همچنین از پیمایش‌گرها پشتیبانی می‌کند: اگر می‌دانید یک پیمایش‌گر " +"N عنصر برمی‌گرداند، می‌توانید آن‌ها را در یک N-تایی واگشایی کنید:" -msgid "Built-in functions such as :func:`max` and :func:`min` can take a single iterator argument and will return the largest or smallest element. The ``\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in iterator`` is true if X is found in the stream returned by the iterator. You'll run into obvious problems if the iterator is infinite; :func:`max`, :func:`min` will never return, and if the element X never appears in the stream, the ``\"in\"`` and ``\"not in\"`` operators won't return either." -msgstr "" +msgid "" +"Built-in functions such as :func:`max` and :func:`min` can take a single " +"iterator argument and will return the largest or smallest element. The " +"``\"in\"`` and ``\"not in\"`` operators also support iterators: ``X in " +"iterator`` is true if X is found in the stream returned by the iterator. " +"You'll run into obvious problems if the iterator is infinite; :func:`max`, " +":func:`min` will never return, and if the element X never appears in the " +"stream, the ``\"in\"`` and ``\"not in\"`` operators won't return either." +msgstr "" +"توابع توکار مانند :func:`max` و :func:`min` می‌توانند یک آرگومان پیمایش‌گر " +"بگیرند و بزرگ‌ترین یا کوچک‌ترین عنصر را برمی‌گردانند. عملگرهای ``\"in\"`` و " +"``\"not in\"`` نیز از پیمایش‌گرها پشتیبانی می‌کنند: ``X in iterator`` زمانی " +"درست است که X در جریان برگردانده‌شده توسط پیمایش‌گر پیدا شود. اگر پیمایش‌گر " +"بی‌پایان باشد، با مشکلات آشکاری مواجه خواهید شد؛ :func:`max` و :func:`min` " +"هرگز برنمی‌گردند، و اگر عنصر X هرگز در جریان ظاهر نشود، عملگرهای ``\"in\"`` " +"و ``\"not in\"`` نیز برنمی‌گردند." -msgid "Note that you can only go forward in an iterator; there's no way to get the previous element, reset the iterator, or make a copy of it. Iterator objects can optionally provide these additional capabilities, but the iterator protocol only specifies the :meth:`~iterator.__next__` method. Functions may therefore consume all of the iterator's output, and if you need to do something different with the same stream, you'll have to create a new iterator." -msgstr "" +msgid "" +"Note that you can only go forward in an iterator; there's no way to get the " +"previous element, reset the iterator, or make a copy of it. Iterator " +"objects can optionally provide these additional capabilities, but the " +"iterator protocol only specifies the :meth:`~iterator.__next__` method. " +"Functions may therefore consume all of the iterator's output, and if you " +"need to do something different with the same stream, you'll have to create a" +" new iterator." +msgstr "" +"توجه داشته باشید که در یک پیمایش‌گر فقط می‌توانید به جلو بروید؛ هیچ راهی " +"برای دریافت عنصر قبلی، بازنشانی پیمایش‌گر، یا ایجاد یک کپی از آن وجود " +"ندارد. اشیای پیمایش‌گر می‌توانند به‌صورت اختیاری این قابلیت‌های اضافی را " +"فراهم کنند، اما پروتکل پیمایش‌گر فقط متد :meth:`~iterator.__next__` را مشخص" +" می‌کند. بنابراین توابع ممکن است تمام خروجی پیمایش‌گر را مصرف کنند، و اگر " +"نیاز دارید کار متفاوتی با همان جریان انجام دهید، باید یک پیمایش‌گر جدید " +"ایجاد کنید." msgid "Data Types That Support Iterators" -msgstr "" +msgstr "انواع داده‌ای که از پیمایشگرها پشتیبانی می‌کنند" -msgid "We've already seen how lists and tuples support iterators. In fact, any Python sequence type, such as strings, will automatically support creation of an iterator." +msgid "" +"We've already seen how lists and tuples support iterators. In fact, any " +"Python sequence type, such as strings, will automatically support creation " +"of an iterator." msgstr "" +"پیش‌تر دیده‌ایم که فهرست‌ها و تاپل‌ها از پیمایش‌گرها پشتیبانی می‌کنند. در " +"واقع، هر نوع دنباله‌ای در پایتون، مانند رشته‌ها، به‌طور خودکار از ایجاد یک " +"پیمایش‌گر پشتیبانی می‌کند." -msgid "Calling :func:`iter` on a dictionary returns an iterator that will loop over the dictionary's keys::" +msgid "" +"Calling :func:`iter` on a dictionary returns an iterator that will loop over" +" the dictionary's keys::" msgstr "" +"فراخوانی :func:`iter` روی یک دیکشنری، پیمایش‌گری برمی‌گرداند که روی کلیدهای " +"دیکشنری حلقه می‌زند::" msgid "" ">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" @@ -203,27 +517,76 @@ msgid "" "Nov 11\n" "Dec 12" msgstr "" +">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" +"... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" +">>> for key in m:\n" +"... print(key, m[key])\n" +"Jan 1\n" +"Feb 2\n" +"Mar 3\n" +"Apr 4\n" +"May 5\n" +"Jun 6\n" +"Jul 7\n" +"Aug 8\n" +"Sep 9\n" +"Oct 10\n" +"Nov 11\n" +"Dec 12" -msgid "Note that starting with Python 3.7, dictionary iteration order is guaranteed to be the same as the insertion order. In earlier versions, the behaviour was unspecified and could vary between implementations." +msgid "" +"Note that starting with Python 3.7, dictionary iteration order is guaranteed" +" to be the same as the insertion order. In earlier versions, the behaviour " +"was unspecified and could vary between implementations." msgstr "" +"توجه داشته باشید که از Python 3.7 به بعد، تضمین می‌شود که ترتیب تکرار " +"دیکشنری همان ترتیب درج باشد. در نسخه‌های پیشین، این رفتار مشخص نشده بود و " +"می‌توانست بین پیاده‌سازی‌ها متفاوت باشد." -msgid "Applying :func:`iter` to a dictionary always loops over the keys, but dictionaries have methods that return other iterators. If you want to iterate over values or key/value pairs, you can explicitly call the :meth:`~dict.values` or :meth:`~dict.items` methods to get an appropriate iterator." -msgstr "" +msgid "" +"Applying :func:`iter` to a dictionary always loops over the keys, but " +"dictionaries have methods that return other iterators. If you want to " +"iterate over values or key/value pairs, you can explicitly call the " +":meth:`~dict.values` or :meth:`~dict.items` methods to get an appropriate " +"iterator." +msgstr "" +"اعمال :func:`iter` روی یک دیکشنری همیشه روی کلیدها حلقه می‌زند، اما " +"دیکشنری‌ها متدهایی دارند که پیمایش‌گرهای دیگری برمی‌گردانند. اگر بخواهید روی " +"مقادیر یا جفت‌های کلید/مقدار پیمایش کنید، می‌توانید به‌صراحت متدهای " +":meth:`~dict.values` یا :meth:`~dict.items` را فراخوانی کنید تا پیمایش‌گر " +"مناسبی به دست آورید." -msgid "The :func:`dict` constructor can accept an iterator that returns a finite stream of ``(key, value)`` tuples:" +msgid "" +"The :func:`dict` constructor can accept an iterator that returns a finite " +"stream of ``(key, value)`` tuples:" msgstr "" +"سازنده‌ی :func:`dict` می‌تواند پیمایش‌گری را بپذیرد که جریان متناهی از " +"تاپل‌های ``(key, value)`` را برمی‌گرداند:" -msgid "Files also support iteration by calling the :meth:`~io.TextIOBase.readline` method until there are no more lines in the file. This means you can read each line of a file like this::" +msgid "" +"Files also support iteration by calling the :meth:`~io.TextIOBase.readline` " +"method until there are no more lines in the file. This means you can read " +"each line of a file like this::" msgstr "" +"فایل‌ها همچنین از تکرار از طریق فراخوانی متد :meth:`~io.TextIOBase.readline`" +" تا زمانی که دیگر خطی در فایل وجود نداشته باشد، پشتیبانی می‌کنند. این بدان " +"معناست که می‌توانید هر خط از یک فایل را به این صورت بخوانید::" msgid "" "for line in file:\n" " # do something for each line\n" " ..." msgstr "" +"for line in file:\n" +" # do something for each line\n" +" ..." -msgid "Sets can take their contents from an iterable and let you iterate over the set's elements::" +msgid "" +"Sets can take their contents from an iterable and let you iterate over the " +"set's elements::" msgstr "" +"مجموعه‌ها می‌توانند محتوای خود را از یک پیمایش‌پذیر بگیرند و به شما اجازه دهند" +" عناصر مجموعه را پیمایش کنید::" msgid "" ">>> S = {2, 3, 5, 7, 11, 13}\n" @@ -236,15 +599,42 @@ msgid "" "11\n" "13" msgstr "" +">>> S = {2, 3, 5, 7, 11, 13}\n" +">>> for i in S:\n" +"... print(i)\n" +"2\n" +"3\n" +"5\n" +"7\n" +"11\n" +"13" msgid "Generator expressions and list comprehensions" -msgstr "" +msgstr "عبارت‌های تولیدگر و درک‌های فهرستی" -msgid "Two common operations on an iterator's output are 1) performing some operation for every element, 2) selecting a subset of elements that meet some condition. For example, given a list of strings, you might want to strip off trailing whitespace from each line or extract all the strings containing a given substring." -msgstr "" +msgid "" +"Two common operations on an iterator's output are 1) performing some " +"operation for every element, 2) selecting a subset of elements that meet " +"some condition. For example, given a list of strings, you might want to " +"strip off trailing whitespace from each line or extract all the strings " +"containing a given substring." +msgstr "" +"دو عملیات رایج روی خروجی یک پیمایشگر (iterator) عبارت‌اند از ۱) انجام " +"عملیاتی برای هر عنصر، ۲) انتخاب زیرمجموعه‌ای از عناصر که شرطی را برآورده " +"می‌کنند. برای مثال، با داشتن فهرستی از رشته‌ها، ممکن است بخواهید فضای سفید " +"انتهایی هر خط را حذف کنید یا تمام رشته‌هایی که حاوی یک زیررشته‌ی مشخص هستند " +"را استخراج کنید." -msgid "List comprehensions and generator expressions (short form: \"listcomps\" and \"genexps\") are a concise notation for such operations, borrowed from the functional programming language Haskell (https://www.haskell.org/). You can strip all the whitespace from a stream of strings with the following code::" +msgid "" +"List comprehensions and generator expressions (short form: \"listcomps\" and" +" \"genexps\") are a concise notation for such operations, borrowed from the " +"functional programming language Haskell (https://www.haskell.org/). You can" +" strip all the whitespace from a stream of strings with the following code::" msgstr "" +"درک‌های فهرستی و عبارات تولیدگر (شکل کوتاه: «listcomps» و «genexps») " +"نمادگذاری مختصری برای چنین عملیاتی هستند که از زبان برنامه‌نویسی تابعی " +"Haskell (https://www.haskell.org/) وام گرفته شده‌اند. می‌توانید با کد زیر " +"تمام فضای سفید را از یک جریان از رشته‌ها حذف کنید::" msgid "" ">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" @@ -255,20 +645,49 @@ msgid "" ">>> # List comprehension -- returns list\n" ">>> stripped_list = [line.strip() for line in line_list]" msgstr "" +">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" +"\n" +">>> # Generator expression -- returns iterator\n" +">>> stripped_iter = (line.strip() for line in line_list)\n" +"\n" +">>> # List comprehension -- returns list\n" +">>> stripped_list = [line.strip() for line in line_list]" msgid "You can select only certain elements by adding an ``\"if\"`` condition::" msgstr "" +"شما می‌توانید با افزودن یک شرط ``\"if\"``، فقط عناصر خاصی را انتخاب کنید::" msgid "" ">>> stripped_list = [line.strip() for line in line_list\n" "... if line != \"\"]" msgstr "" +">>> stripped_list = [line.strip() for line in line_list\n" +"... if line != \"\"]" -msgid "With a list comprehension, you get back a Python list; ``stripped_list`` is a list containing the resulting lines, not an iterator. Generator expressions return an iterator that computes the values as necessary, not needing to materialize all the values at once. This means that list comprehensions aren't useful if you're working with iterators that return an infinite stream or a very large amount of data. Generator expressions are preferable in these situations." -msgstr "" +msgid "" +"With a list comprehension, you get back a Python list; ``stripped_list`` is " +"a list containing the resulting lines, not an iterator. Generator " +"expressions return an iterator that computes the values as necessary, not " +"needing to materialize all the values at once. This means that list " +"comprehensions aren't useful if you're working with iterators that return an" +" infinite stream or a very large amount of data. Generator expressions are " +"preferable in these situations." +msgstr "" +"با یک درک فهرستی، شما یک فهرست پایتون دریافت می‌کنید؛ ``stripped_list`` " +"فهرستی شامل ردیف‌های حاصل است، نه یک پیمایش‌گر. عبارت‌های تولیدگر یک پیمایش‌گر " +"برمی‌گردانند که مقادیر را در حد نیاز محاسبه می‌کند و نیازی به ایجاد همه " +"مقادیر به‌صورت یک‌جا ندارد. این بدان معناست که اگر با پیمایش‌گرهایی کار " +"می‌کنید که یک جریان بی‌نهایت یا مقدار بسیار زیادی از داده را برمی‌گردانند، " +"درک‌های فهرستی مفید نیستند. در این موقعیت‌ها، عبارت‌های تولیدگر ترجیح داده " +"می‌شوند." -msgid "Generator expressions are surrounded by parentheses (\"()\") and list comprehensions are surrounded by square brackets (\"[]\"). Generator expressions have the form::" +msgid "" +"Generator expressions are surrounded by parentheses (\"()\") and list " +"comprehensions are surrounded by square brackets (\"[]\"). Generator " +"expressions have the form::" msgstr "" +"عبارت‌های تولیدگر در میان پرانتز (\"()\") و درک‌های فهرستی در میان کروشه " +"(\"[]\") قرار دارند. عبارت‌های تولیدگر به این شکل هستند::" msgid "" "( expression for expr in sequence1\n" @@ -281,24 +700,64 @@ msgid "" " for exprN in sequenceN\n" " if conditionN )" msgstr "" +"( expression for expr in sequence1\n" +" if condition1\n" +" for expr2 in sequence2\n" +" if condition2\n" +" for expr3 in sequence3\n" +" ...\n" +" if condition3\n" +" for exprN in sequenceN\n" +" if conditionN )" -msgid "Again, for a list comprehension only the outside brackets are different (square brackets instead of parentheses)." +msgid "" +"Again, for a list comprehension only the outside brackets are different " +"(square brackets instead of parentheses)." msgstr "" +"باز هم، برای درک فهرستی تنها کروشه‌های بیرونی متفاوت هستند (کروشه‌های مربع " +"به‌جای پرانتزها)." -msgid "The elements of the generated output will be the successive values of ``expression``. The ``if`` clauses are all optional; if present, ``expression`` is only evaluated and added to the result when ``condition`` is true." +msgid "" +"The elements of the generated output will be the successive values of " +"``expression``. The ``if`` clauses are all optional; if present, " +"``expression`` is only evaluated and added to the result when ``condition`` " +"is true." msgstr "" +"عناصر خروجی تولیدشده، مقادیر متوالی ``expression`` خواهند بود. بندهای ``if``" +" همگی اختیاری هستند؛ در صورت وجود، ``expression`` تنها زمانی ارزیابی و به " +"نتیجه اضافه می‌شود که ``condition`` درست باشد." -msgid "Generator expressions always have to be written inside parentheses, but the parentheses signalling a function call also count. If you want to create an iterator that will be immediately passed to a function you can write::" +msgid "" +"Generator expressions always have to be written inside parentheses, but the " +"parentheses signalling a function call also count. If you want to create an" +" iterator that will be immediately passed to a function you can write::" msgstr "" +"عبارت‌های تولیدگر همیشه باید داخل پرانتز نوشته شوند، اما پرانتزهای " +"نشان‌دهنده‌ی فراخوانی تابع نیز به‌حساب می‌آیند. اگر بخواهید پیمایش‌گری بسازید " +"که بلافاصله به یک تابع پاس داده شود، می‌توانید بنویسید::" msgid "obj_total = sum(obj.count for obj in list_all_objects())" -msgstr "" +msgstr "obj_total = sum(obj.count for obj in list_all_objects())" -msgid "The ``for...in`` clauses contain the sequences to be iterated over. The sequences do not have to be the same length, because they are iterated over from left to right, **not** in parallel. For each element in ``sequence1``, ``sequence2`` is looped over from the beginning. ``sequence3`` is then looped over for each resulting pair of elements from ``sequence1`` and ``sequence2``." -msgstr "" +msgid "" +"The ``for...in`` clauses contain the sequences to be iterated over. The " +"sequences do not have to be the same length, because they are iterated over " +"from left to right, **not** in parallel. For each element in ``sequence1``," +" ``sequence2`` is looped over from the beginning. ``sequence3`` is then " +"looped over for each resulting pair of elements from ``sequence1`` and " +"``sequence2``." +msgstr "" +"بندهای ``for...in`` شامل دنباله‌هایی هستند که باید پیمایش شوند. دنباله‌ها " +"لازم نیست هم‌طول باشند، زیرا از چپ به راست پیمایش می‌شوند، **نه** به‌صورت " +"موازی. برای هر عنصر در ``sequence1``، روی ``sequence2`` از ابتدا حلقه زده " +"می‌شود. سپس ``sequence3`` برای هر جفت عنصر حاصل از ``sequence1`` و " +"``sequence2`` حلقه زده می‌شود." -msgid "To put it another way, a list comprehension or generator expression is equivalent to the following Python code::" +msgid "" +"To put it another way, a list comprehension or generator expression is " +"equivalent to the following Python code::" msgstr "" +"به‌بیان دیگر، یک درک فهرستی یا عبارت تولیدگر معادل کد پایتون زیر است::" msgid "" "for expr1 in sequence1:\n" @@ -315,12 +774,38 @@ msgid "" " # Output the value of\n" " # the expression." msgstr "" +"for expr1 in sequence1:\n" +" if not (condition1):\n" +" continue # Skip this element\n" +" for expr2 in sequence2:\n" +" if not (condition2):\n" +" continue # Skip this element\n" +" ...\n" +" for exprN in sequenceN:\n" +" if not (conditionN):\n" +" continue # Skip this element\n" +"\n" +" # Output the value of\n" +" # the expression." -msgid "This means that when there are multiple ``for...in`` clauses but no ``if`` clauses, the length of the resulting output will be equal to the product of the lengths of all the sequences. If you have two lists of length 3, the output list is 9 elements long:" +msgid "" +"This means that when there are multiple ``for...in`` clauses but no ``if`` " +"clauses, the length of the resulting output will be equal to the product of " +"the lengths of all the sequences. If you have two lists of length 3, the " +"output list is 9 elements long:" msgstr "" +"این بدان معناست که وقتی چندین بند ``for...in`` وجود داشته باشد اما هیچ بند " +"``if`` وجود نداشته باشد، طول خروجی حاصل برابر با حاصل‌ضرب طول همه دنباله‌ها " +"خواهد بود. اگر دو فهرست به طول ۳ داشته باشید، فهرست خروجی ۹ عنصر طول دارد:" -msgid "To avoid introducing an ambiguity into Python's grammar, if ``expression`` is creating a tuple, it must be surrounded with parentheses. The first list comprehension below is a syntax error, while the second one is correct::" +msgid "" +"To avoid introducing an ambiguity into Python's grammar, if ``expression`` " +"is creating a tuple, it must be surrounded with parentheses. The first list" +" comprehension below is a syntax error, while the second one is correct::" msgstr "" +"برای جلوگیری از ایجاد ابهام در دستور زبان پایتون، اگر ``expression`` یک تاپل" +" ایجاد کند، باید درون پرانتز قرار گیرد. نخستین درک فهرستی زیر یک " +"خطای سینتکسی است، در حالی که دومی صحیح است::" msgid "" "# Syntax error\n" @@ -328,39 +813,120 @@ msgid "" "# Correct\n" "[(x, y) for x in seq1 for y in seq2]" msgstr "" +"# Syntax error\n" +"[x, y for x in seq1 for y in seq2]\n" +"# Correct\n" +"[(x, y) for x in seq1 for y in seq2]" msgid "Generators" -msgstr "" +msgstr "تولیدگرها" -msgid "Generators are a special class of functions that simplify the task of writing iterators. Regular functions compute a value and return it, but generators return an iterator that returns a stream of values." +msgid "" +"Generators are a special class of functions that simplify the task of " +"writing iterators. Regular functions compute a value and return it, but " +"generators return an iterator that returns a stream of values." msgstr "" +"تولیدگرها کلاسی خاص از توابع هستند که کار نوشتن پیمایش‌گرها را ساده می‌کنند. " +"توابع معمولی یک مقدار را محاسبه می‌کنند و آن را برمی‌گردانند، اما تولیدگرها " +"پیمایش‌گری را برمی‌گردانند که جریانی از مقادیر را برمی‌گرداند." -msgid "You're doubtless familiar with how regular function calls work in Python or C. When you call a function, it gets a private namespace where its local variables are created. When the function reaches a ``return`` statement, the local variables are destroyed and the value is returned to the caller. A later call to the same function creates a new private namespace and a fresh set of local variables. But, what if the local variables weren't thrown away on exiting a function? What if you could later resume the function where it left off? This is what generators provide; they can be thought of as resumable functions." -msgstr "" +msgid "" +"You're doubtless familiar with how regular function calls work in Python or " +"C. When you call a function, it gets a private namespace where its local " +"variables are created. When the function reaches a ``return`` statement, " +"the local variables are destroyed and the value is returned to the caller. " +"A later call to the same function creates a new private namespace and a " +"fresh set of local variables. But, what if the local variables weren't " +"thrown away on exiting a function? What if you could later resume the " +"function where it left off? This is what generators provide; they can be " +"thought of as resumable functions." +msgstr "" +"شما بدون شک با چگونگی کار فراخوانی‌های معمول تابع در پایتون یا C آشنا هستید." +" هنگامی که تابعی را فراخوانی می‌کنید، یک فضای نام خصوصی برای آن ایجاد می‌شود" +" که متغیرهای محلی‌اش در آن ساخته می‌شوند. وقتی تابع به یک دستور ``return`` " +"می‌رسد، متغیرهای محلی از بین می‌روند و مقدار به فراخواننده بازگردانده " +"می‌شود. فراخوانی بعدی همان تابع، یک فضای نام خصوصی جدید و مجموعه‌ای تازه از " +"متغیرهای محلی ایجاد می‌کند. اما چه می‌شد اگر متغیرهای محلی هنگام خروج از یک " +"تابع دور انداخته نمی‌شدند؟ چه می‌شد اگر می‌توانستید بعداً تابع را از " +"همان‌جایی که متوقف شده بود از سر بگیرید؟ این همان چیزی است که تولیدگرها " +"فراهم می‌کنند؛ می‌توان آن‌ها را توابعی قابل از سرگیری دانست." msgid "Here's the simplest example of a generator function:" -msgstr "" +msgstr "در اینجا ساده‌ترین مثال از یک تابع تولیدگر آمده است:" -msgid "Any function containing a :keyword:`yield` keyword is a generator function; this is detected by Python's :term:`bytecode` compiler which compiles the function specially as a result." +msgid "" +"Any function containing a :keyword:`yield` keyword is a generator function; " +"this is detected by Python's :term:`bytecode` compiler which compiles the " +"function specially as a result." msgstr "" +"هر تابعی که شامل کلیدواژه‌ی :keyword:`yield` باشد، یک تابع تولیدگر است؛ این " +"موضوع را کامپایلر :term:`bytecode` پایتون تشخیص می‌دهد و در نتیجه، تابع را " +"به‌صورت ویژه کامپایل می‌کند." -msgid "When you call a generator function, it doesn't return a single value; instead it returns a generator object that supports the iterator protocol. On executing the ``yield`` expression, the generator outputs the value of ``i``, similar to a ``return`` statement. The big difference between ``yield`` and a ``return`` statement is that on reaching a ``yield`` the generator's state of execution is suspended and local variables are preserved. On the next call to the generator's :meth:`~generator.__next__` method, the function will resume executing." -msgstr "" +msgid "" +"When you call a generator function, it doesn't return a single value; " +"instead it returns a generator object that supports the iterator protocol. " +"On executing the ``yield`` expression, the generator outputs the value of " +"``i``, similar to a ``return`` statement. The big difference between " +"``yield`` and a ``return`` statement is that on reaching a ``yield`` the " +"generator's state of execution is suspended and local variables are " +"preserved. On the next call to the generator's :meth:`~generator.__next__` " +"method, the function will resume executing." +msgstr "" +"وقتی یک تابع تولیدگر را فراخوانی می‌کنید، مقدار واحدی را برنمی‌گرداند؛ بلکه " +"یک شیء تولیدگر برمی‌گرداند که از پروتکل پیمایش‌گر (iterator protocol) پشتیبانی" +" می‌کند. با اجرای عبارت ``yield``، تولیدگر مقدار ``i`` را خروجی می‌دهد، " +"مشابه یک دستور ``return``. تفاوت بزرگ میان ``yield`` و یک دستور ``return`` " +"این است که با رسیدن به ``yield``، وضعیت اجرای تولیدگر به حالت تعلیق درمی‌آید" +" و متغیرهای محلی حفظ می‌شوند. در فراخوانی بعدی متد " +":meth:`~generator.__next__` تولیدگر، تابع اجرای خود را از سر می‌گیرد." msgid "Here's a sample usage of the ``generate_ints()`` generator:" -msgstr "" +msgstr "در اینجا یک نمونه استفاده از تولیدگر ``generate_ints()`` آمده است:" -msgid "You could equally write ``for i in generate_ints(5)``, or ``a, b, c = generate_ints(3)``." +msgid "" +"You could equally write ``for i in generate_ints(5)``, or ``a, b, c = " +"generate_ints(3)``." msgstr "" +"همچنین می‌توانید ``for i in generate_ints(5)`` یا ``a, b, c = " +"generate_ints(3)`` را بنویسید." -msgid "Inside a generator function, ``return value`` causes ``StopIteration(value)`` to be raised from the :meth:`~generator.__next__` method. Once this happens, or the bottom of the function is reached, the procession of values ends and the generator cannot yield any further values." +msgid "" +"Inside a generator function, ``return value`` causes " +"``StopIteration(value)`` to be raised from the :meth:`~generator.__next__` " +"method. Once this happens, or the bottom of the function is reached, the " +"procession of values ends and the generator cannot yield any further values." msgstr "" +"درون یک تابع تولیدگر، ``return value`` باعث پرتاب ``StopIteration(value)`` " +"از متد :meth:`~generator.__next__` می‌شود. پس از وقوع این حالت، یا پس از " +"رسیدن به انتهای تابع، دنباله‌ی مقادیر پایان می‌یابد و تولیدگر نمی‌تواند " +"مقادیر بیشتری تولید کند." -msgid "You could achieve the effect of generators manually by writing your own class and storing all the local variables of the generator as instance variables. For example, returning a list of integers could be done by setting ``self.count`` to 0, and having the :meth:`~iterator.__next__` method increment ``self.count`` and return it. However, for a moderately complicated generator, writing a corresponding class can be much messier." -msgstr "" +msgid "" +"You could achieve the effect of generators manually by writing your own " +"class and storing all the local variables of the generator as instance " +"variables. For example, returning a list of integers could be done by " +"setting ``self.count`` to 0, and having the :meth:`~iterator.__next__` " +"method increment ``self.count`` and return it. However, for a moderately " +"complicated generator, writing a corresponding class can be much messier." +msgstr "" +"می‌توانید اثر تولیدگرها را به‌صورت دستی با نوشتن کلاس خودتان و ذخیره کردن " +"تمام متغیرهای محلی تولیدگر به‌عنوان متغیرهای نمونه به دست آورید. برای مثال، " +"برگرداندن فهرستی از اعداد صحیح می‌تواند با تنظیم ``self.count`` روی ۰ و " +"افزایش ``self.count`` در متد :meth:`~iterator.__next__` و برگرداندن آن انجام" +" شود. با این حال، برای یک تولیدگر نسبتاً پیچیده، نوشتن کلاس متناظر می‌تواند " +"بسیار آشفته‌تر باشد." -msgid "The test suite included with Python's library, :source:`Lib/test/test_generators.py`, contains a number of more interesting examples. Here's one generator that implements an in-order traversal of a tree using generators recursively. ::" +msgid "" +"The test suite included with Python's library, " +":source:`Lib/test/test_generators.py`, contains a number of more interesting" +" examples. Here's one generator that implements an in-order traversal of a " +"tree using generators recursively. ::" msgstr "" +"مجموعه‌ی آزمون موجود در کتابخانه‌ی پایتون، " +":source:`Lib/test/test_generators.py`، شامل چندین مثال جالب‌تر است. در " +"اینجا یک تولیدگر آمده است که پیمایش میان‌ترتیب یک درخت را با استفاده‌ی " +"بازگشتی از تولیدگرها پیاده‌سازی می‌کند. ::" msgid "" "# A recursive generator that generates Tree leaves in in-order.\n" @@ -374,33 +940,102 @@ msgid "" " for x in inorder(t.right):\n" " yield x" msgstr "" +"# یک تولیدگر بازگشتی که برگ‌های Tree را به‌ترتیب in-order تولید می‌کند.\n" +"def inorder(t):\n" +" if t:\n" +" for x in inorder(t.left):\n" +" yield x\n" +"\n" +" yield t.label\n" +"\n" +" for x in inorder(t.right):\n" +" yield x" -msgid "Two other examples in ``test_generators.py`` produce solutions for the N-Queens problem (placing N queens on an NxN chess board so that no queen threatens another) and the Knight's Tour (finding a route that takes a knight to every square of an NxN chessboard without visiting any square twice)." -msgstr "" +msgid "" +"Two other examples in ``test_generators.py`` produce solutions for the " +"N-Queens problem (placing N queens on an NxN chess board so that no queen " +"threatens another) and the Knight's Tour (finding a route that takes a " +"knight to every square of an NxN chessboard without visiting any square " +"twice)." +msgstr "" +"دو مثال دیگر در ``test_generators.py`` راه‌حل‌هایی برای مسئله‌ی N وزیر " +"(N-Queens، قرار دادن N وزیر روی یک صفحه‌ی شطرنج NxN به‌گونه‌ای که هیچ وزیری " +"وزیر دیگری را تهدید نکند) و گشت اسب (Knight's Tour، یافتن مسیری که یک اسب را" +" به همه‌ی خانه‌های یک صفحه‌ی شطرنج NxN ببرد، بدون آنکه از هیچ خانه‌ای دو بار " +"بازدید شود) تولید می‌کنند." msgid "Passing values into a generator" -msgstr "" +msgstr "ارسال مقادیر به یک تولیدگر" -msgid "In Python 2.4 and earlier, generators only produced output. Once a generator's code was invoked to create an iterator, there was no way to pass any new information into the function when its execution is resumed. You could hack together this ability by making the generator look at a global variable or by passing in some mutable object that callers then modify, but these approaches are messy." -msgstr "" +msgid "" +"In Python 2.4 and earlier, generators only produced output. Once a " +"generator's code was invoked to create an iterator, there was no way to pass" +" any new information into the function when its execution is resumed. You " +"could hack together this ability by making the generator look at a global " +"variable or by passing in some mutable object that callers then modify, but " +"these approaches are messy." +msgstr "" +"در پایتون 2.4 و نسخه‌های پیش از آن، تولیدگرها تنها خروجی تولید می‌کردند. پس " +"از فراخوانی کد یک تولیدگر برای ایجاد یک پیمایشگر (iterator)، هیچ راهی برای " +"ارسال اطلاعات جدید به تابع در زمان از سرگیری اجرای آن وجود نداشت. شما " +"می‌توانستید این قابلیت را به‌صورت دست‌وپاشکسته با وادار کردن تولیدگر به " +"بررسی یک متغیر سراسری یا با ارسال یک شیء تغییرپذیر که فراخوان‌کنندگان سپس آن" +" را تغییر می‌دهند، پیاده‌سازی کنید، اما این روش‌ها آشفته هستند." -msgid "In Python 2.5 there's a simple way to pass values into a generator. :keyword:`yield` became an expression, returning a value that can be assigned to a variable or otherwise operated on::" +msgid "" +"In Python 2.5 there's a simple way to pass values into a generator. " +":keyword:`yield` became an expression, returning a value that can be " +"assigned to a variable or otherwise operated on::" msgstr "" +"در پایتون 2.5 راه ساده‌ای برای ارسال مقادیر به یک تولیدگر وجود دارد. " +":keyword:`yield` به یک عبارت تبدیل شد و مقداری را برمی‌گرداند که می‌توان آن " +"را به یک متغیر انتساب داد یا عملیات دیگری روی آن انجام داد::" msgid "val = (yield i)" -msgstr "" +msgstr "val = (yield i)" -msgid "I recommend that you **always** put parentheses around a ``yield`` expression when you're doing something with the returned value, as in the above example. The parentheses aren't always necessary, but it's easier to always add them instead of having to remember when they're needed." +msgid "" +"I recommend that you **always** put parentheses around a ``yield`` " +"expression when you're doing something with the returned value, as in the " +"above example. The parentheses aren't always necessary, but it's easier to " +"always add them instead of having to remember when they're needed." msgstr "" +"توصیه می‌کنم که **همیشه** اطراف عبارت ``yield`` پرانتز قرار دهید، هنگامی که " +"با مقدار برگردانده‌شده کاری انجام می‌دهید، همان‌گونه که در مثال بالا آمده " +"است. پرانتزها همیشه ضروری نیستند، اما افزودن همیشگی آن‌ها آسان‌تر است تا " +"اینکه به یاد داشته باشید چه زمانی لازم هستند." -msgid "(:pep:`342` explains the exact rules, which are that a ``yield``-expression must always be parenthesized except when it occurs at the top-level expression on the right-hand side of an assignment. This means you can write ``val = yield i`` but have to use parentheses when there's an operation, as in ``val = (yield i) + 12``.)" -msgstr "" +msgid "" +"(:pep:`342` explains the exact rules, which are that a ``yield``-expression " +"must always be parenthesized except when it occurs at the top-level " +"expression on the right-hand side of an assignment. This means you can " +"write ``val = yield i`` but have to use parentheses when there's an " +"operation, as in ``val = (yield i) + 12``.)" +msgstr "" +"(:pep:`342` قوانین دقیق را توضیح می‌دهد، که بر اساس آن‌ها عبارت ``yield`` " +"باید همیشه داخل پرانتز قرار گیرد، مگر وقتی که به‌عنوان عبارت سطح بالا در سمت" +" راست یک انتساب ظاهر شود. این بدان معناست که می‌توانید ``val = yield i`` " +"بنویسید، اما وقتی عملیاتی وجود دارد باید از پرانتز استفاده کنید، مانند ``val" +" = (yield i) + 12``.)" -msgid "Values are sent into a generator by calling its :meth:`send(value) ` method. This method resumes the generator's code and the ``yield`` expression returns the specified value. If the regular :meth:`~generator.__next__` method is called, the ``yield`` returns ``None``." +msgid "" +"Values are sent into a generator by calling its :meth:`send(value) " +"` method. This method resumes the generator's code and the " +"``yield`` expression returns the specified value. If the regular " +":meth:`~generator.__next__` method is called, the ``yield`` returns " +"``None``." msgstr "" +"مقادیر با فراخوانی متد :meth:`send(value) ` یک تولیدگر، به " +"آن ارسال می‌شوند. این متد کد تولیدگر را از سر می‌گیرد و عبارت ``yield`` " +"مقدار مشخص‌شده را بازمی‌گرداند. اگر متد معمولی :meth:`~generator.__next__` " +"فراخوانی شود، ``yield`` مقدار ``None`` را بازمی‌گرداند." -msgid "Here's a simple counter that increments by 1 and allows changing the value of the internal counter." +msgid "" +"Here's a simple counter that increments by 1 and allows changing the value " +"of the internal counter." msgstr "" +"در اینجا یک شمارنده ساده آمده است که به اندازه ۱ افزایش می‌یابد و امکان " +"تغییر مقدار شمارنده داخلی را فراهم می‌کند." msgid "" "def counter(maximum):\n" @@ -413,57 +1048,145 @@ msgid "" " else:\n" " i += 1" msgstr "" +"def counter(maximum):\n" +" i = 0\n" +" while i < maximum:\n" +" val = (yield i)\n" +" # If value provided, change counter\n" +" if val is not None:\n" +" i = val\n" +" else:\n" +" i += 1" msgid "And here's an example of changing the counter:" -msgstr "" +msgstr "و در اینجا مثالی از تغییر شمارنده آمده است:" -msgid "Because ``yield`` will often be returning ``None``, you should always check for this case. Don't just use its value in expressions unless you're sure that the :meth:`~generator.send` method will be the only method used to resume your generator function." +msgid "" +"Because ``yield`` will often be returning ``None``, you should always check " +"for this case. Don't just use its value in expressions unless you're sure " +"that the :meth:`~generator.send` method will be the only method used to " +"resume your generator function." msgstr "" +"از آنجا که ``yield`` اغلب مقدار ``None`` را برمی‌گرداند، باید همیشه این حالت" +" را بررسی کنید. مقدار آن را به‌سادگی در عبارت‌ها به کار نبرید، مگر اینکه " +"مطمئن باشید متد :meth:`~generator.send` تنها متدی است که برای از سرگیری تابع" +" تولیدگر شما استفاده می‌شود." -msgid "In addition to :meth:`~generator.send`, there are two other methods on generators:" -msgstr "" +msgid "" +"In addition to :meth:`~generator.send`, there are two other methods on " +"generators:" +msgstr "علاوه بر :meth:`~generator.send`، تولیدگرها دو متد دیگر نیز دارند:" -msgid ":meth:`throw(value) ` is used to raise an exception inside the generator; the exception is raised by the ``yield`` expression where the generator's execution is paused." +msgid "" +":meth:`throw(value) ` is used to raise an exception inside " +"the generator; the exception is raised by the ``yield`` expression where the" +" generator's execution is paused." msgstr "" +":meth:`throw(value) ` برای پرتاب استثنا درون تولیدگر " +"استفاده می‌شود؛ این استثنا توسط عبارت ``yield`` در نقطه‌ای که اجرای تولیدگر " +"مکث کرده است پرتاب می‌شود." -msgid ":meth:`~generator.close` sends a :exc:`GeneratorExit` exception to the generator to terminate the iteration. On receiving this exception, the generator's code must either raise :exc:`GeneratorExit` or :exc:`StopIteration`; catching the exception and doing anything else is illegal and will trigger a :exc:`RuntimeError`. :meth:`~generator.close` will also be called by Python's garbage collector when the generator is garbage-collected." -msgstr "" +msgid "" +":meth:`~generator.close` sends a :exc:`GeneratorExit` exception to the " +"generator to terminate the iteration. On receiving this exception, the " +"generator's code must either raise :exc:`GeneratorExit` or " +":exc:`StopIteration`; catching the exception and doing anything else is " +"illegal and will trigger a :exc:`RuntimeError`. :meth:`~generator.close` " +"will also be called by Python's garbage collector when the generator is " +"garbage-collected." +msgstr "" +":meth:`~generator.close` استثنای :exc:`GeneratorExit` را به تولیدگر می‌فرستد" +" تا تکرار را پایان دهد. هنگام دریافت این استثنا، کد تولیدگر باید یا " +":exc:`GeneratorExit` یا :exc:`StopIteration` را پرتاب کند؛ گرفتن این استثنا " +"و انجام هر کار دیگری غیرمجاز است و باعث پرتاب :exc:`RuntimeError` می‌شود. " +"همچنین وقتی تولیدگر زباله‌روبی می‌شود، :meth:`~generator.close` توسط " +"زباله‌روب پایتون فراخوانی می‌شود." -msgid "If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I suggest using a ``try: ... finally:`` suite instead of catching :exc:`GeneratorExit`." +msgid "" +"If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " +"suggest using a ``try: ... finally:`` suite instead of catching " +":exc:`GeneratorExit`." msgstr "" +"اگر نیاز دارید هنگام رخ دادن :exc:`GeneratorExit` کد پاک‌سازی را اجرا کنید، " +"پیشنهاد می‌کنم به‌جای گرفتن :exc:`GeneratorExit` از یک بلوک ``try: ... " +"finally:`` استفاده کنید." -msgid "The cumulative effect of these changes is to turn generators from one-way producers of information into both producers and consumers." +msgid "" +"The cumulative effect of these changes is to turn generators from one-way " +"producers of information into both producers and consumers." msgstr "" +"اثر تجمعی این تغییرات این است که تولیدگرها را از تولیدکنندگان یک‌طرفه‌ی " +"اطلاعات به هر دو تولیدکننده و مصرف‌کننده تبدیل می‌کند." -msgid "Generators also become **coroutines**, a more generalized form of subroutines. Subroutines are entered at one point and exited at another point (the top of the function, and a ``return`` statement), but coroutines can be entered, exited, and resumed at many different points (the ``yield`` statements)." +msgid "" +"Generators also become **coroutines**, a more generalized form of " +"subroutines. Subroutines are entered at one point and exited at another " +"point (the top of the function, and a ``return`` statement), but coroutines " +"can be entered, exited, and resumed at many different points (the ``yield`` " +"statements)." msgstr "" +"تولیدگرها همچنین به **هم‌روال‌ها** تبدیل می‌شوند، شکل تعمیم‌یافته‌تری از " +"زیربرنامه‌ها. زیربرنامه‌ها در یک نقطه وارد می‌شوند و از نقطه‌ای دیگر خارج " +"می‌شوند (ابتدای تابع و یک دستور ``return``)، اما هم‌روال‌ها می‌توانند در " +"نقاط مختلفی وارد شوند، خارج شوند و از سر گرفته شوند (دستورهای ``yield``)." msgid "Built-in functions" -msgstr "" +msgstr "توابع توکار" -msgid "Let's look in more detail at built-in functions often used with iterators." +msgid "" +"Let's look in more detail at built-in functions often used with iterators." msgstr "" +"بگذارید توابع توکاری را که اغلب با پیمایش‌گرها استفاده می‌شوند، با جزئیات " +"بیشتری بررسی کنیم." -msgid "Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the features of generator expressions:" +msgid "" +"Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate" +" the features of generator expressions:" msgstr "" +"دو مورد از توابع توکار پایتون، :func:`map` و :func:`filter`، قابلیت‌های " +"عبارات تولیدگر را تکرار می‌کنند:" -msgid ":func:`map(f, iterA, iterB, ...) ` returns an iterator over the sequence" +msgid "" +":func:`map(f, iterA, iterB, ...) ` returns an iterator over the " +"sequence" msgstr "" +":func:`map(f, iterA, iterB, ...) ` یک پیمایش‌گر بر روی دنباله برمی‌گرداند" -msgid "``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." +msgid "" +"``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), " +"...``." msgstr "" +"``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), " +"...``." msgid "You can of course achieve the same effect with a list comprehension." msgstr "" +"البته می‌توانید با استفاده از یک درک فهرستی نیز همان اثر را ایجاد کنید." -msgid ":func:`filter(predicate, iter) ` returns an iterator over all the sequence elements that meet a certain condition, and is similarly duplicated by list comprehensions. A **predicate** is a function that returns the truth value of some condition; for use with :func:`filter`, the predicate must take a single value." -msgstr "" +msgid "" +":func:`filter(predicate, iter) ` returns an iterator over all the " +"sequence elements that meet a certain condition, and is similarly duplicated" +" by list comprehensions. A **predicate** is a function that returns the " +"truth value of some condition; for use with :func:`filter`, the predicate " +"must take a single value." +msgstr "" +":func:`filter(predicate, iter) ` یک پیمایش‌گر بر روی تمام عناصر " +"دنباله‌ای که شرط خاصی را برآورده می‌کنند، برمی‌گرداند و به‌طور مشابه می‌توان" +" آن را با درک فهرستی پیاده‌سازی کرد. یک **تابع محمول** (predicate) تابعی است " +"که مقدار درستی یک شرط را برمی‌گرداند؛ برای استفاده با :func:`filter`، تابع " +"محمول باید یک مقدار واحد دریافت کند." msgid "This can also be written as a list comprehension:" -msgstr "" +msgstr "این را می‌توان به‌صورت یک درک فهرستی نیز نوشت:" -msgid ":func:`enumerate(iter, start=0) ` counts off the elements in the iterable returning 2-tuples containing the count (from *start*) and each element. ::" +msgid "" +":func:`enumerate(iter, start=0) ` counts off the elements in the " +"iterable returning 2-tuples containing the count (from *start*) and each " +"element. ::" msgstr "" +":func:`enumerate(iter, start=0) ` عناصر موجود در پیمایش‌پذیر را " +"می‌شمارد و تاپل‌های دوتایی (2-tuples) شامل شماره (از *start*) و هر عنصر را " +"برمی‌گرداند. ::" msgid "" ">>> for item in enumerate(['subject', 'verb', 'object']):\n" @@ -472,9 +1195,18 @@ msgid "" "(1, 'verb')\n" "(2, 'object')" msgstr "" +">>> for item in enumerate(['subject', 'verb', 'object']):\n" +"... print(item)\n" +"(0, 'subject')\n" +"(1, 'verb')\n" +"(2, 'object')" -msgid ":func:`enumerate` is often used when looping through a list and recording the indexes at which certain conditions are met::" +msgid "" +":func:`enumerate` is often used when looping through a list and recording " +"the indexes at which certain conditions are met::" msgstr "" +":func:`enumerate` اغلب هنگام پیمایش یک فهرست با حلقه و ثبت اندیس‌هایی که " +"شرایط خاصی در آن‌ها برقرار است استفاده می‌شود::" msgid "" "f = open('data.txt', 'r')\n" @@ -482,9 +1214,21 @@ msgid "" " if line.strip() == '':\n" " print('Blank line at line #%i' % i)" msgstr "" +"f = open('data.txt', 'r')\n" +"for i, line in enumerate(f):\n" +" if line.strip() == '':\n" +" print('Blank line at line #%i' % i)" -msgid ":func:`sorted(iterable, key=None, reverse=False) ` collects all the elements of the iterable into a list, sorts the list, and returns the sorted result. The *key* and *reverse* arguments are passed through to the constructed list's :meth:`~list.sort` method. ::" +msgid "" +":func:`sorted(iterable, key=None, reverse=False) ` collects all the " +"elements of the iterable into a list, sorts the list, and returns the sorted" +" result. The *key* and *reverse* arguments are passed through to the " +"constructed list's :meth:`~list.sort` method. ::" msgstr "" +":func:`sorted(iterable, key=None, reverse=False) ` تمام عناصر یک شیء" +" پیمایش‌پذیر را در یک فهرست گردآوری می‌کند، فهرست را مرتب می‌کند و نتیجه‌ی " +"مرتب‌شده را برمی‌گرداند. آرگومان‌های *key* و *reverse* به متد " +":meth:`~list.sort` فهرست ساخته‌شده منتقل می‌شوند. ::" msgid "" ">>> import random\n" @@ -497,61 +1241,124 @@ msgid "" ">>> sorted(rand_list, reverse=True)\n" "[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" msgstr "" +">>> import random\n" +">>> # Generate 8 random numbers between [0, 10000)\n" +">>> rand_list = random.sample(range(10000), 8)\n" +">>> rand_list\n" +"[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" +">>> sorted(rand_list)\n" +"[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" +">>> sorted(rand_list, reverse=True)\n" +"[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" -msgid "(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" +msgid "" +"(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" msgstr "" +"(برای بحثی با جزئیات بیشتر درباره مرتب‌سازی، :ref:`sortinghowto` را ببینید.)" -msgid "The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at the truth values of an iterable's contents. :func:`any` returns ``True`` if any element in the iterable is a true value, and :func:`all` returns ``True`` if all of the elements are true values:" +msgid "" +"The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at " +"the truth values of an iterable's contents. :func:`any` returns ``True`` if" +" any element in the iterable is a true value, and :func:`all` returns " +"``True`` if all of the elements are true values:" msgstr "" +"توابع توکار :func:`any(iter) ` و :func:`all(iter) ` مقادیر درستی " +"محتوای یک پیمایش‌پذیر را بررسی می‌کنند. :func:`any` اگر یکی از المان‌های " +"پیمایش‌پذیر مقدار درست باشد، ``True`` را برمی‌گرداند، و :func:`all` اگر تمام " +"المان‌ها مقادیر درست باشند، ``True`` را برمی‌گرداند:" -msgid ":func:`zip(iterA, iterB, ...) ` takes one element from each iterable and returns them in a tuple::" +msgid "" +":func:`zip(iterA, iterB, ...) ` takes one element from each iterable " +"and returns them in a tuple::" msgstr "" +":func:`zip(iterA, iterB, ...) ` یک عنصر از هر پیمایش‌پذیر می‌گیرد و آن‌ها" +" را در قالب یک تاپلبرمی‌گرداند::" msgid "" "zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" " ('a', 1), ('b', 2), ('c', 3)" msgstr "" +"zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2), ('c', 3)" -msgid "It doesn't construct an in-memory list and exhaust all the input iterators before returning; instead tuples are constructed and returned only if they're requested. (The technical term for this behaviour is `lazy evaluation `__.)" +msgid "" +"It doesn't construct an in-memory list and exhaust all the input iterators " +"before returning; instead tuples are constructed and returned only if " +"they're requested. (The technical term for this behaviour is `lazy " +"evaluation `__.)" msgstr "" +"این تابع پیش از بازگشت، فهرستی در حافظه نمی‌سازد و تمام پیمایش‌گرهای ورودی را" +" به‌طور کامل مصرف نمی‌کند؛ در عوض، تاپل‌ها تنها در صورتی که درخواست شوند " +"ساخته و برگردانده می‌شوند. (اصطلاح فنی این رفتار `ارزیابی تنبل " +"`__ است.)" -msgid "This iterator is intended to be used with iterables that are all of the same length. If the iterables are of different lengths, the resulting stream will be the same length as the shortest iterable. ::" +msgid "" +"This iterator is intended to be used with iterables that are all of the same" +" length. If the iterables are of different lengths, the resulting stream " +"will be the same length as the shortest iterable. ::" msgstr "" +"این پیمایش‌گر (iterator) برای استفاده با پیمایش‌پذیرهایی در نظر گرفته شده است " +"که همگی طول یکسانی دارند. اگر پیمایش‌پذیرها طول‌های متفاوتی داشته باشند، " +"جریان حاصل هم‌طول با کوتاه‌ترین پیمایش‌پذیر خواهد بود. ::" msgid "" "zip(['a', 'b'], (1, 2, 3)) =>\n" " ('a', 1), ('b', 2)" msgstr "" +"zip(['a', 'b'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2)" -msgid "You should avoid doing this, though, because an element may be taken from the longer iterators and discarded. This means you can't go on to use the iterators further because you risk skipping a discarded element." +msgid "" +"You should avoid doing this, though, because an element may be taken from " +"the longer iterators and discarded. This means you can't go on to use the " +"iterators further because you risk skipping a discarded element." msgstr "" +"با این حال، باید از انجام این کار خودداری کنید، زیرا ممکن است عنصری از " +"پیمایش‌گرهای طولانی‌تر گرفته و دور انداخته شود. این بدان معناست که نمی‌توانید " +"به استفاده بیشتر از پیمایش‌گرها ادامه دهید، زیرا ممکن است یک عنصر دور " +"انداخته‌شده را از قلم بیندازید." msgid "The itertools module" -msgstr "" +msgstr "ماژول itertools" -msgid "The :mod:`itertools` module contains a number of commonly used iterators as well as functions for combining several iterators. This section will introduce the module's contents by showing small examples." +msgid "" +"The :mod:`itertools` module contains a number of commonly used iterators as " +"well as functions for combining several iterators. This section will " +"introduce the module's contents by showing small examples." msgstr "" +"ماژول :mod:`itertools` شامل تعدادی پیمایش‌گر پرکاربرد و همچنین توابعی برای " +"ترکیب چندین پیمایش‌گر است. این بخش با نمایش مثال‌های کوچک، محتوای این ماژول را" +" معرفی می‌کند." msgid "The module's functions fall into a few broad classes:" -msgstr "" +msgstr "توابع این ماژول به چند کلاس کلی تقسیم می‌شوند:" msgid "Functions that create a new iterator based on an existing iterator." msgstr "" +"تابع‌هایی که یک پیمایش‌گر (iterator) جدید را بر اساس یک پیمایش‌گر موجود ایجاد " +"می‌کنند." msgid "Functions for treating an iterator's elements as function arguments." -msgstr "" +msgstr "توابعی برای در نظر گرفتن عناصر یک پیمایش‌گر به‌عنوان آرگومان‌های تابع." msgid "Functions for selecting portions of an iterator's output." -msgstr "" +msgstr "توابعی برای انتخاب بخش‌هایی از خروجی یک پیمایشگر (iterator)." msgid "A function for grouping an iterator's output." -msgstr "" +msgstr "تابعی برای گروه‌بندی خروجی یک پیمایش‌گر." msgid "Creating new iterators" -msgstr "" +msgstr "ایجاد پیمایشگرهای جدید" -msgid ":func:`itertools.count(start, step) ` returns an infinite stream of evenly spaced values. You can optionally supply the starting number, which defaults to 0, and the interval between numbers, which defaults to 1::" +msgid "" +":func:`itertools.count(start, step) ` returns an infinite " +"stream of evenly spaced values. You can optionally supply the starting " +"number, which defaults to 0, and the interval between numbers, which " +"defaults to 1::" msgstr "" +":func:`itertools.count(start, step) ` یک جریان بی‌پایان از " +"مقادیر با فاصله‌های مساوی بازمی‌گرداند. به‌صورت اختیاری می‌توانید عدد شروع " +"را که پیش‌فرض آن ۰ است و فاصله بین اعداد را که پیش‌فرض آن ۱ است، مشخص کنید::" msgid "" "itertools.count() =>\n" @@ -561,17 +1368,39 @@ msgid "" "itertools.count(10, 5) =>\n" " 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." msgstr "" +"itertools.count() =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"itertools.count(10) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"itertools.count(10, 5) =>\n" +" 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." -msgid ":func:`itertools.cycle(iter) ` saves a copy of the contents of a provided iterable and returns a new iterator that returns its elements from first to last. The new iterator will repeat these elements infinitely. ::" +msgid "" +":func:`itertools.cycle(iter) ` saves a copy of the contents" +" of a provided iterable and returns a new iterator that returns its elements" +" from first to last. The new iterator will repeat these elements " +"infinitely. ::" msgstr "" +":func:`itertools.cycle(iter) ` یک کپی از محتوای پیمایش‌پذیر " +"ارائه‌شده ذخیره می‌کند و پیمایش‌گر جدیدی بازمی‌گرداند که عناصر آن را از اولین " +"تا آخرین بازمی‌گرداند. این پیمایش‌گر جدید، این عناصر را به‌طور بی‌نهایت تکرار " +"خواهد کرد. ::" msgid "" "itertools.cycle([1, 2, 3, 4, 5]) =>\n" " 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." msgstr "" +"itertools.cycle([1, 2, 3, 4, 5]) =>\n" +" 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." -msgid ":func:`itertools.repeat(elem, [n]) ` returns the provided element *n* times, or returns the element endlessly if *n* is not provided. ::" +msgid "" +":func:`itertools.repeat(elem, [n]) ` returns the provided " +"element *n* times, or returns the element endlessly if *n* is not provided. " +"::" msgstr "" +":func:`itertools.repeat(elem, [n]) ` المان ارائه‌شده را " +"*n* بار برمی‌گرداند، یا اگر *n* ارائه نشده باشد، المان را بی‌پایان " +"برمی‌گرداند. ::" msgid "" "itertools.repeat('abc') =>\n" @@ -579,17 +1408,44 @@ msgid "" "itertools.repeat('abc', 5) =>\n" " abc, abc, abc, abc, abc" msgstr "" +"itertools.repeat('abc') =>\n" +" abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" +"itertools.repeat('abc', 5) =>\n" +" abc, abc, abc, abc, abc" -msgid ":func:`itertools.chain(iterA, iterB, ...) ` takes an arbitrary number of iterables as input, and returns all the elements of the first iterator, then all the elements of the second, and so on, until all of the iterables have been exhausted. ::" +msgid "" +":func:`itertools.chain(iterA, iterB, ...) ` takes an " +"arbitrary number of iterables as input, and returns all the elements of the " +"first iterator, then all the elements of the second, and so on, until all of" +" the iterables have been exhausted. ::" msgstr "" +":func:`itertools.chain(iterA, iterB, ...) ` تعداد دلخواهی " +"از پیمایش‌پذیرها را به‌عنوان ورودی می‌گیرد و تمام عناصر پیمایش‌گر نخست، سپس " +"تمام عناصر پیمایش‌گر دوم و به همین ترتیب را برمی‌گرداند، تا زمانی که همه " +"پیمایش‌پذیرها به پایان برسند. ::" msgid "" "itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" " a, b, c, 1, 2, 3" msgstr "" +"itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" a, b, c, 1, 2, 3" -msgid ":func:`itertools.islice(iter, [start], stop, [step]) ` returns a stream that's a slice of the iterator. With a single *stop* argument, it will return the first *stop* elements. If you supply a starting index, you'll get *stop-start* elements, and if you supply a value for *step*, elements will be skipped accordingly. Unlike Python's string and list slicing, you can't use negative values for *start*, *stop*, or *step*. ::" -msgstr "" +msgid "" +":func:`itertools.islice(iter, [start], stop, [step]) ` " +"returns a stream that's a slice of the iterator. With a single *stop* " +"argument, it will return the first *stop* elements. If you supply a " +"starting index, you'll get *stop-start* elements, and if you supply a value " +"for *step*, elements will be skipped accordingly. Unlike Python's string " +"and list slicing, you can't use negative values for *start*, *stop*, or " +"*step*. ::" +msgstr "" +":func:`itertools.islice(iter, [start], stop, [step]) ` " +"جریانی را برمی‌گرداند که برشی از پیمایش‌گر است. با تنها یک آرگومان *stop*، " +"نخستین *stop* عنصر را برمی‌گرداند. اگر یک اندیس آغاز ارائه دهید، *stop-" +"start* عنصر دریافت خواهید کرد، و اگر مقداری برای *step* ارائه دهید، مطابق آن" +" از روی عناصر پرش خواهد شد. برخلاف برش رشته و فهرست در پایتون، نمی‌توانید از" +" مقادیر منفی برای *start*، *stop* یا *step* استفاده کنید. ::" msgid "" "itertools.islice(range(10), 8) =>\n" @@ -599,9 +1455,27 @@ msgid "" "itertools.islice(range(10), 2, 8, 2) =>\n" " 2, 4, 6" msgstr "" +"itertools.islice(range(10), 8) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8) =>\n" +" 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8, 2) =>\n" +" 2, 4, 6" -msgid ":func:`itertools.tee(iter, [n]) ` replicates an iterator; it returns *n* independent iterators that will all return the contents of the source iterator. If you don't supply a value for *n*, the default is 2. Replicating iterators requires saving some of the contents of the source iterator, so this can consume significant memory if the iterator is large and one of the new iterators is consumed more than the others. ::" -msgstr "" +msgid "" +":func:`itertools.tee(iter, [n]) ` replicates an iterator; it " +"returns *n* independent iterators that will all return the contents of the " +"source iterator. If you don't supply a value for *n*, the default is 2. " +"Replicating iterators requires saving some of the contents of the source " +"iterator, so this can consume significant memory if the iterator is large " +"and one of the new iterators is consumed more than the others. ::" +msgstr "" +":func:`itertools.tee(iter, [n]) ` یک پیمایش‌گر را تکثیر " +"می‌کند؛ این تابع *n* پیمایش‌گر مستقل برمی‌گرداند که همگی محتوای پیمایش‌گر " +"منبع را برمی‌گردانند. اگر مقداری برای *n* ارائه ندهید، مقدار پیش‌فرض ۲ است. " +"تکثیر پیمایش‌گرها نیازمند ذخیره کردن بخشی از محتوای پیمایش‌گر منبع است، " +"بنابراین اگر پیمایش‌گر بزرگ باشد و یکی از پیمایش‌گرهای جدید بیشتر از بقیه" +" مصرف شود، می‌تواند حافظه قابل‌توجهی مصرف کند. ::" msgid "" "itertools.tee( itertools.count() ) =>\n" @@ -613,15 +1487,40 @@ msgid "" "and iterB ->\n" " 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." msgstr "" +"itertools.tee( itertools.count() ) =>\n" +" iterA, iterB\n" +"\n" +"که در آن iterA ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"\n" +"و iterB ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." msgid "Calling functions on elements" -msgstr "" +msgstr "فراخوانی توابع بر روی المان‌ها" -msgid "The :mod:`operator` module contains a set of functions corresponding to Python's operators. Some examples are :func:`operator.add(a, b) ` (adds two values), :func:`operator.ne(a, b) ` (same as ``a != b``), and :func:`operator.attrgetter('id') ` (returns a callable that fetches the ``.id`` attribute)." -msgstr "" +msgid "" +"The :mod:`operator` module contains a set of functions corresponding to " +"Python's operators. Some examples are :func:`operator.add(a, b) " +"` (adds two values), :func:`operator.ne(a, b) ` " +"(same as ``a != b``), and :func:`operator.attrgetter('id') " +"` (returns a callable that fetches the ``.id`` " +"attribute)." +msgstr "" +"ماژول :mod:`operator` شامل مجموعه‌ای از توابع متناظر با عملگرهای پایتون است." +" برخی نمونه‌ها عبارت‌اند از :func:`operator.add(a, b) ` (دو " +"مقدار را جمع می‌کند)، :func:`operator.ne(a, b) ` (معادل ``a !=" +" b`` است)، و :func:`operator.attrgetter('id') ` (یک " +"قابل فراخوانی برمی‌گرداند که ویژگی ``.id`` را دریافت می‌کند)." -msgid ":func:`itertools.starmap(func, iter) ` assumes that the iterable will return a stream of tuples, and calls *func* using these tuples as the arguments::" +msgid "" +":func:`itertools.starmap(func, iter) ` assumes that the " +"iterable will return a stream of tuples, and calls *func* using these tuples" +" as the arguments::" msgstr "" +":func:`itertools.starmap(func, iter) ` فرض می‌کند که " +"پیمایش‌پذیر جریانی از تاپل‌ها را برمی‌گرداند، و *func* را با استفاده از این " +"تاپل‌ها به‌عنوان آرگومان‌ها فراخوانی می‌کند::" msgid "" "itertools.starmap(os.path.join,\n" @@ -630,23 +1529,46 @@ msgid "" "=>\n" " /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" msgstr "" +"itertools.starmap(os.path.join,\n" +" [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" +" ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])\n" +"=>\n" +" /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" msgid "Selecting elements" -msgstr "" +msgstr "انتخاب عناصر" -msgid "Another group of functions chooses a subset of an iterator's elements based on a predicate." +msgid "" +"Another group of functions chooses a subset of an iterator's elements based " +"on a predicate." msgstr "" +"گروه دیگری از توابع، زیرمجموعه‌ای از عناصر یک پیمایش‌گر را بر اساس یک محک " +"(predicate) انتخاب می‌کنند." -msgid ":func:`itertools.filterfalse(predicate, iter) ` is the opposite of :func:`filter`, returning all elements for which the predicate returns false::" +msgid "" +":func:`itertools.filterfalse(predicate, iter) ` is " +"the opposite of :func:`filter`, returning all elements for which the " +"predicate returns false::" msgstr "" +":func:`itertools.filterfalse(predicate, iter) ` نقطه " +"مقابل :func:`filter` است و همه عناصری را برمی‌گرداند که محک برای آن‌ها false" +" برمی‌گرداند::" msgid "" "itertools.filterfalse(is_even, itertools.count()) =>\n" " 1, 3, 5, 7, 9, 11, 13, 15, ..." msgstr "" +"itertools.filterfalse(is_even, itertools.count()) =>\n" +" 1, 3, 5, 7, 9, 11, 13, 15, ..." -msgid ":func:`itertools.takewhile(predicate, iter) ` returns elements for as long as the predicate returns true. Once the predicate returns false, the iterator will signal the end of its results. ::" +msgid "" +":func:`itertools.takewhile(predicate, iter) ` returns " +"elements for as long as the predicate returns true. Once the predicate " +"returns false, the iterator will signal the end of its results. ::" msgstr "" +":func:`itertools.takewhile(predicate, iter) ` عناصر را " +"تا زمانی که شرط مقدار درست را برگرداند، برمی‌گرداند. هنگامی که شرط مقدار " +"نادرست را برگرداند، پیمایش‌گر پایان نتایج خود را اعلام می‌کند. ::" msgid "" "def less_than_10(x):\n" @@ -658,9 +1580,23 @@ msgid "" "itertools.takewhile(is_even, itertools.count()) =>\n" " 0" msgstr "" +"def less_than_10(x):\n" +" return x < 10\n" +"\n" +"itertools.takewhile(less_than_10, itertools.count()) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n" +"\n" +"itertools.takewhile(is_even, itertools.count()) =>\n" +" 0" -msgid ":func:`itertools.dropwhile(predicate, iter) ` discards elements while the predicate returns true, and then returns the rest of the iterable's results. ::" +msgid "" +":func:`itertools.dropwhile(predicate, iter) ` discards " +"elements while the predicate returns true, and then returns the rest of the " +"iterable's results. ::" msgstr "" +":func:`itertools.dropwhile(predicate, iter) ` عناصر را " +"تا زمانی که شرط مقدار درست را برگرداند نادیده می‌گیرد، و سپس باقی‌مانده‌ی " +"نتایج تکرارپذیر را برمی‌گرداند. ::" msgid "" "itertools.dropwhile(less_than_10, itertools.count()) =>\n" @@ -669,20 +1605,40 @@ msgid "" "itertools.dropwhile(is_even, itertools.count()) =>\n" " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." msgstr "" +"itertools.dropwhile(less_than_10, itertools.count()) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"\n" +"itertools.dropwhile(is_even, itertools.count()) =>\n" +" 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." -msgid ":func:`itertools.compress(data, selectors) ` takes two iterators and returns only those elements of *data* for which the corresponding element of *selectors* is true, stopping whenever either one is exhausted::" +msgid "" +":func:`itertools.compress(data, selectors) ` takes two " +"iterators and returns only those elements of *data* for which the " +"corresponding element of *selectors* is true, stopping whenever either one " +"is exhausted::" msgstr "" +":func:`itertools.compress(data, selectors) ` دو پیمایش‌گر " +"می‌گیرد و فقط آن عناصری از *data* را برمی‌گرداند که عنصر متناظر آن‌ها در " +"*selectors* درست باشد، و هرگاه هرکدام از آن‌ها تمام شود، متوقف می‌شود::" msgid "" "itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" " 1, 2, 5" msgstr "" +"itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" +" 1, 2, 5" msgid "Combinatoric functions" -msgstr "" +msgstr "توابع ترکیبیاتی" -msgid "The :func:`itertools.combinations(iterable, r) ` returns an iterator giving all possible *r*-tuple combinations of the elements contained in *iterable*. ::" +msgid "" +"The :func:`itertools.combinations(iterable, r) ` " +"returns an iterator giving all possible *r*-tuple combinations of the " +"elements contained in *iterable*. ::" msgstr "" +":func:`itertools.combinations(iterable, r) ` یک " +"پیمایش‌گر برمی‌گرداند که همه‌ی ترکیب‌های ممکن به‌صورت تاپل‌های *r* عضوی از " +"عناصر موجود در *iterable* را می‌دهد. ::" msgid "" "itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" @@ -696,9 +1652,30 @@ msgid "" " (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" " (3, 4, 5)" msgstr "" +"itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 3), (2, 4), (2, 5),\n" +" (3, 4), (3, 5),\n" +" (4, 5)\n" +"\n" +"itertools.combinations([1, 2, 3, 4, 5], 3) =>\n" +" (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),\n" +" (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" +" (3, 4, 5)" -msgid "The elements within each tuple remain in the same order as *iterable* returned them. For example, the number 1 is always before 2, 3, 4, or 5 in the examples above. A similar function, :func:`itertools.permutations(iterable, r=None) `, removes this constraint on the order, returning all possible arrangements of length *r*::" -msgstr "" +msgid "" +"The elements within each tuple remain in the same order as *iterable* " +"returned them. For example, the number 1 is always before 2, 3, 4, or 5 in " +"the examples above. A similar function, " +":func:`itertools.permutations(iterable, r=None) `, " +"removes this constraint on the order, returning all possible arrangements of" +" length *r*::" +msgstr "" +"عناصر هر تاپل به همان ترتیبی که *iterable* آن‌ها را برگردانده است باقی " +"می‌مانند. برای مثال، عدد ۱ همیشه قبل از ۲، ۳، ۴ یا ۵ در مثال‌های بالا قرار " +"دارد. تابعی مشابه، :func:`itertools.permutations(iterable, r=None) " +"`، این محدودیت روی ترتیب را برمی‌دارد و همه‌ی " +"آرایش‌های ممکن به طول *r* را برمی‌گرداند::" msgid "" "itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" @@ -713,24 +1690,59 @@ msgid "" " ...\n" " (5, 4, 3, 2, 1)" msgstr "" +"itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 1), (2, 3), (2, 4), (2, 5),\n" +" (3, 1), (3, 2), (3, 4), (3, 5),\n" +" (4, 1), (4, 2), (4, 3), (4, 5),\n" +" (5, 1), (5, 2), (5, 3), (5, 4)\n" +"\n" +"itertools.permutations([1, 2, 3, 4, 5]) =>\n" +" (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),\n" +" ...\n" +" (5, 4, 3, 2, 1)" -msgid "If you don't supply a value for *r* the length of the iterable is used, meaning that all the elements are permuted." +msgid "" +"If you don't supply a value for *r* the length of the iterable is used, " +"meaning that all the elements are permuted." msgstr "" +"اگر مقداری برای *r* ارائه ندهید، از طول پیمایش‌پذیر استفاده می‌شود، به این " +"معنا که همه عناصر جایگشت داده می‌شوند." -msgid "Note that these functions produce all of the possible combinations by position and don't require that the contents of *iterable* are unique::" +msgid "" +"Note that these functions produce all of the possible combinations by " +"position and don't require that the contents of *iterable* are unique::" msgstr "" +"توجه داشته باشید که این توابع تمام ترکیب‌های ممکن را بر اساس جایگاه تولید " +"می‌کنند و نیازی نیست که محتویات *iterable* یکتا باشند::" msgid "" "itertools.permutations('aba', 3) =>\n" " ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" " ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" msgstr "" +"itertools.permutations('aba', 3) =>\n" +" ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" +" ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" -msgid "The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' strings came from different positions." +msgid "" +"The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' " +"strings came from different positions." msgstr "" +"تاپل یکسان ``('a', 'a', 'b')`` دو بار ظاهر می‌شود، اما دو رشته‌ی 'a' از " +"موقعیت‌های متفاوتی آمده‌اند." -msgid "The :func:`itertools.combinations_with_replacement(iterable, r) ` function relaxes a different constraint: elements can be repeated within a single tuple. Conceptually an element is selected for the first position of each tuple and then is replaced before the second element is selected. ::" +msgid "" +"The :func:`itertools.combinations_with_replacement(iterable, r) " +"` function relaxes a different " +"constraint: elements can be repeated within a single tuple. Conceptually an" +" element is selected for the first position of each tuple and then is " +"replaced before the second element is selected. ::" msgstr "" +"تابع :func:`itertools.combinations_with_replacement(iterable, r) " +"` محدودیت دیگری را برمی‌دارد: عناصر" +" می‌توانند در یک تاپل تکرار شوند. از نظر مفهومی، یک عنصر برای جایگاه نخست " +"هر تاپل انتخاب می‌شود و سپس پیش از انتخاب عنصر دوم، بازگردانده می‌شود. ::" msgid "" "itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" @@ -740,15 +1752,38 @@ msgid "" " (4, 4), (4, 5),\n" " (5, 5)" msgstr "" +"itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" +" (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 2), (2, 3), (2, 4), (2, 5),\n" +" (3, 3), (3, 4), (3, 5),\n" +" (4, 4), (4, 5),\n" +" (5, 5)" msgid "Grouping elements" -msgstr "" +msgstr "گروه‌بندی عناصر" -msgid "The last function I'll discuss, :func:`itertools.groupby(iter, key_func=None) `, is the most complicated. ``key_func(elem)`` is a function that can compute a key value for each element returned by the iterable. If you don't supply a key function, the key is simply each element itself." -msgstr "" +msgid "" +"The last function I'll discuss, :func:`itertools.groupby(iter, " +"key_func=None) `, is the most complicated. " +"``key_func(elem)`` is a function that can compute a key value for each " +"element returned by the iterable. If you don't supply a key function, the " +"key is simply each element itself." +msgstr "" +"آخرین تابعی که بررسی خواهم کرد، :func:`itertools.groupby(iter, " +"key_func=None) `، پیچیده‌ترین است. ``key_func(elem)`` " +"تابعی است که می‌تواند یک مقدار کلید برای هر المان بازگردانده‌شده از " +"پیمایش‌پذیر محاسبه کند. اگر تابع کلید را ارائه نکنید، کلید صرفاً خود هر المان " +"است." -msgid ":func:`~itertools.groupby` collects all the consecutive elements from the underlying iterable that have the same key value, and returns a stream of 2-tuples containing a key value and an iterator for the elements with that key." +msgid "" +":func:`~itertools.groupby` collects all the consecutive elements from the " +"underlying iterable that have the same key value, and returns a stream of " +"2-tuples containing a key value and an iterator for the elements with that " +"key." msgstr "" +":func:`~itertools.groupby` تمام عناصر متوالیِ پیمایش‌پذیر زیرین را که مقدار " +"کلید یکسانی دارند، جمع‌آوری می‌کند و جریانی از تاپل‌های دوتایی شامل یک مقدار" +" کلید و یک پیمایش‌گر برای عناصر با آن کلید را برمی‌گرداند." msgid "" "city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" @@ -773,24 +1808,81 @@ msgid "" "iterator-3 =>\n" " ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" msgstr "" +"city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" +" ('Anchorage', 'AK'), ('Nome', 'AK'),\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),\n" +" ...\n" +" ]\n" +"\n" +"def get_state(city_state):\n" +" return city_state[1]\n" +"\n" +"itertools.groupby(city_list, get_state) =>\n" +" ('AL', iterator-1),\n" +" ('AK', iterator-2),\n" +" ('AZ', iterator-3), ...\n" +"\n" +"که در آن\n" +"iterator-1 =>\n" +" ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')\n" +"iterator-2 =>\n" +" ('Anchorage', 'AK'), ('Nome', 'AK')\n" +"iterator-3 =>\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" -msgid ":func:`~itertools.groupby` assumes that the underlying iterable's contents will already be sorted based on the key. Note that the returned iterators also use the underlying iterable, so you have to consume the results of iterator-1 before requesting iterator-2 and its corresponding key." +msgid "" +":func:`~itertools.groupby` assumes that the underlying iterable's contents " +"will already be sorted based on the key. Note that the returned iterators " +"also use the underlying iterable, so you have to consume the results of " +"iterator-1 before requesting iterator-2 and its corresponding key." msgstr "" +":func:`~itertools.groupby` فرض می‌کند که محتوای پیمایش‌پذیر زیربنایی از قبل بر" +" اساس کلید مرتب شده باشد. توجه داشته باشید که پیمایش‌گرهای برگردانده‌شده نیز " +"از پیمایش‌پذیر زیربنایی استفاده می‌کنند، بنابراین باید نتایج پیمایش‌گر ۱ را پیش " +"از درخواست پیمایش‌گر ۲ و کلید متناظر آن مصرف کنید." msgid "The functools module" -msgstr "" +msgstr "ماژول functools" -msgid "The :mod:`functools` module contains some higher-order functions. A **higher-order function** takes one or more functions as input and returns a new function. The most useful tool in this module is the :func:`functools.partial` function." +msgid "" +"The :mod:`functools` module contains some higher-order functions. A " +"**higher-order function** takes one or more functions as input and returns a" +" new function. The most useful tool in this module is the " +":func:`functools.partial` function." msgstr "" +"ماژول :mod:`functools` شامل برخی توابع مرتبه بالاتر است. یک **تابع مرتبه " +"بالاتر** یک یا چند تابع را به‌عنوان ورودی می‌گیرد و یک تابع جدید را " +"برمی‌گرداند. مفیدترین ابزار در این ماژول، تابع :func:`functools.partial` " +"است." -msgid "For programs written in a functional style, you'll sometimes want to construct variants of existing functions that have some of the parameters filled in. Consider a Python function ``f(a, b, c)``; you may wish to create a new function ``g(b, c)`` that's equivalent to ``f(1, b, c)``; you're filling in a value for one of ``f()``'s parameters. This is called \"partial function application\"." -msgstr "" +msgid "" +"For programs written in a functional style, you'll sometimes want to " +"construct variants of existing functions that have some of the parameters " +"filled in. Consider a Python function ``f(a, b, c)``; you may wish to create" +" a new function ``g(b, c)`` that's equivalent to ``f(1, b, c)``; you're " +"filling in a value for one of ``f()``'s parameters. This is called " +"\"partial function application\"." +msgstr "" +"برای برنامه‌هایی که به سبک تابعی نوشته شده‌اند، گاهی ممکن است بخواهید " +"نسخه‌هایی از توابع موجود بسازید که برخی از پارامترهای آن‌ها از قبل پر شده " +"باشند. یک تابع پایتون ``f(a, b, c)`` را در نظر بگیرید؛ ممکن است بخواهید یک " +"تابع جدید ``g(b, c)`` بسازید که معادل ``f(1, b, c)`` باشد؛ شما مقداری را " +"برای یکی از پارامترهای ``f()`` جایگذاری می‌کنید. به این کار «کاربرد جزئی " +"تابع» (partial function application) گفته می‌شود." -msgid "The constructor for :func:`~functools.partial` takes the arguments ``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. The resulting object is callable, so you can just call it to invoke ``function`` with the filled-in arguments." +msgid "" +"The constructor for :func:`~functools.partial` takes the arguments " +"``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. The " +"resulting object is callable, so you can just call it to invoke ``function``" +" with the filled-in arguments." msgstr "" +"سازنده‌ی :func:`~functools.partial` آرگومان‌های ``(function, arg1, arg2, ...," +" kwarg1=value1, kwarg2=value2)`` را دریافت می‌کند. شیء حاصل قابل فراخوانی " +"است، بنابراین کافی است آن را فراخوانی کنید تا ``function`` با آرگومان‌های " +"مقداردهی‌شده فراخوانی شود." msgid "Here's a small but realistic example::" -msgstr "" +msgstr "در اینجا مثالی کوچک اما واقع‌بینانه آمده است::" msgid "" "import functools\n" @@ -803,9 +1895,40 @@ msgid "" "server_log = functools.partial(log, subsystem='server')\n" "server_log('Unable to open socket')" msgstr "" +"import functools\n" +"\n" +"def log(message, subsystem):\n" +" \"\"\"Write the contents of 'message' to the specified subsystem.\"\"\"\n" +" print('%s: %s' % (subsystem, message))\n" +" ...\n" +"\n" +"server_log = functools.partial(log, subsystem='server')\n" +"server_log('Unable to open socket')" -msgid ":func:`functools.reduce(func, iter, [initial_value]) ` cumulatively performs an operation on all the iterable's elements and, therefore, can't be applied to infinite iterables. *func* must be a function that takes two elements and returns a single value. :func:`functools.reduce` takes the first two elements A and B returned by the iterator and calculates ``func(A, B)``. It then requests the third element, C, calculates ``func(func(A, B), C)``, combines this result with the fourth element returned, and continues until the iterable is exhausted. If the iterable returns no values at all, a :exc:`TypeError` exception is raised. If the initial value is supplied, it's used as a starting point and ``func(initial_value, A)`` is the first calculation. ::" -msgstr "" +msgid "" +":func:`functools.reduce(func, iter, [initial_value]) ` " +"cumulatively performs an operation on all the iterable's elements and, " +"therefore, can't be applied to infinite iterables. *func* must be a function" +" that takes two elements and returns a single value. " +":func:`functools.reduce` takes the first two elements A and B returned by " +"the iterator and calculates ``func(A, B)``. It then requests the third " +"element, C, calculates ``func(func(A, B), C)``, combines this result with " +"the fourth element returned, and continues until the iterable is exhausted." +" If the iterable returns no values at all, a :exc:`TypeError` exception is " +"raised. If the initial value is supplied, it's used as a starting point and" +" ``func(initial_value, A)`` is the first calculation. ::" +msgstr "" +":func:`functools.reduce(func, iter, [initial_value]) ` " +"به‌صورت تجمیعی عملیاتی را روی همه عناصر پیمایش‌پذیر انجام می‌دهد و بنابراین، " +"نمی‌توان آن را روی پیمایش‌پذیرهای بی‌نهایت اعمال کرد. *func* باید تابعی باشد " +"که دو عنصر را دریافت می‌کند و یک مقدار واحد برمی‌گرداند. " +":func:`functools.reduce` دو عنصر نخست A و B را که پیمایش‌گر برمی‌گرداند دریافت" +" می‌کند و ``func(A, B)`` را محاسبه می‌کند. سپس عنصر سوم، C، را درخواست " +"می‌کند، ``func(func(A, B), C)`` را محاسبه می‌کند، این نتیجه را با چهارمین " +"عنصر برگردانده‌شده ترکیب می‌کند و ادامه می‌دهد تا پیمایش‌پذیر به پایان برسد. " +"اگر پیمایش‌پذیر اصلاً هیچ مقداری برنگرداند، استثنای :exc:`TypeError` پرتاب " +"می‌شود. اگر initial_value ارائه شود، به‌عنوان نقطه شروع استفاده می‌شود و " +"``func(initial_value, A)`` نخستین محاسبه است. ::" msgid "" ">>> import operator, functools\n" @@ -820,12 +1943,33 @@ msgid "" ">>> functools.reduce(operator.mul, [], 1)\n" "1" msgstr "" +">>> import operator, functools\n" +">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" +"'ABBC'\n" +">>> functools.reduce(operator.concat, [])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: reduce() of empty iterable with no initial value\n" +">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"6\n" +">>> functools.reduce(operator.mul, [], 1)\n" +"1" -msgid "If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up all the elements of the iterable. This case is so common that there's a special built-in called :func:`sum` to compute it:" +msgid "" +"If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up" +" all the elements of the iterable. This case is so common that there's a " +"special built-in called :func:`sum` to compute it:" msgstr "" +"اگر از :func:`operator.add` همراه با :func:`functools.reduce` استفاده کنید، " +"تمام عناصر پیمایش‌پذیر را با هم جمع می‌کنید. این حالت آن‌قدر رایج است که یک " +"تابع توکار ویژه به نام :func:`sum` برای محاسبه‌ی آن وجود دارد:" -msgid "For many uses of :func:`functools.reduce`, though, it can be clearer to just write the obvious :keyword:`for` loop::" +msgid "" +"For many uses of :func:`functools.reduce`, though, it can be clearer to just" +" write the obvious :keyword:`for` loop::" msgstr "" +"با این حال، برای بسیاری از کاربردهای :func:`functools.reduce`، نوشتن همان " +"حلقه :keyword:`for` آشکار می‌تواند خواناتر باشد::" msgid "" "import functools\n" @@ -837,9 +1981,26 @@ msgid "" "for i in [1, 2, 3]:\n" " product *= i" msgstr "" +"import functools\n" +"# Instead of:\n" +"product = functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"\n" +"# You can write:\n" +"product = 1\n" +"for i in [1, 2, 3]:\n" +" product *= i" -msgid "A related function is :func:`itertools.accumulate(iterable, func=operator.add) `. It performs the same calculation, but instead of returning only the final result, :func:`~itertools.accumulate` returns an iterator that also yields each partial result::" +msgid "" +"A related function is :func:`itertools.accumulate(iterable, " +"func=operator.add) `. It performs the same " +"calculation, but instead of returning only the final result, " +":func:`~itertools.accumulate` returns an iterator that also yields each " +"partial result::" msgstr "" +"یک تابع مرتبط، :func:`itertools.accumulate(iterable, func=operator.add) " +"` است. این تابع همان محاسبه را انجام می‌دهد، اما " +"به‌جای برگرداندن تنها نتیجه نهایی، :func:`~itertools.accumulate` " +"پیمایش‌گرای برمی‌گرداند که هر نتیجه جزئی را نیز تولید می‌کند::" msgid "" "itertools.accumulate([1, 2, 3, 4, 5]) =>\n" @@ -848,59 +2009,104 @@ msgid "" "itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" " 1, 2, 6, 24, 120" msgstr "" +"itertools.accumulate([1, 2, 3, 4, 5]) =>\n" +" 1, 3, 6, 10, 15\n" +"\n" +"itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" +" 1, 2, 6, 24, 120" msgid "The operator module" -msgstr "" +msgstr "ماژول operator" -msgid "The :mod:`operator` module was mentioned earlier. It contains a set of functions corresponding to Python's operators. These functions are often useful in functional-style code because they save you from writing trivial functions that perform a single operation." +msgid "" +"The :mod:`operator` module was mentioned earlier. It contains a set of " +"functions corresponding to Python's operators. These functions are often " +"useful in functional-style code because they save you from writing trivial " +"functions that perform a single operation." msgstr "" +"ماژول :mod:`operator` پیش‌تر ذکر شد. این ماژول شامل مجموعه‌ای از توابع است " +"که متناظر با عملگرهای پایتون هستند. این توابع اغلب در کد با سبک تابعی مفید " +"هستند، زیرا شما را از نوشتن توابع ساده‌ای که تنها یک عمل واحد را انجام " +"می‌دهند بی‌نیاز می‌کنند." msgid "Some of the functions in this module are:" -msgstr "" +msgstr "برخی از توابع این ماژول عبارتند از:" -msgid "Math operations: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, ``abs()``, ..." +msgid "" +"Math operations: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, ``abs()``," +" ..." msgstr "" +"عملیات ریاضی: ``add()``، ``sub()``، ``mul()``، ``floordiv()``، ``abs()``، " +"..." msgid "Logical operations: ``not_()``, ``truth()``." -msgstr "" +msgstr "عملیات منطقی: ``not_()``، ``truth()``." msgid "Bitwise operations: ``and_()``, ``or_()``, ``invert()``." -msgstr "" +msgstr "عملیات‌های بیتی: ``and_()``، ``or_()``، ``invert()``." -msgid "Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``." +msgid "" +"Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``." msgstr "" +"مقایسه‌ها: ``eq()``، ``ne()``، ``lt()``، ``le()``، ``gt()`` و ``ge()``." msgid "Object identity: ``is_()``, ``is_not()``." -msgstr "" +msgstr "هویت شیء: ``is_()``، ``is_not()``." msgid "Consult the operator module's documentation for a complete list." -msgstr "" +msgstr "برای فهرستی کامل، به مستندات ماژول operator مراجعه کنید." msgid "Small functions and the lambda expression" -msgstr "" +msgstr "توابع کوچک و عبارت لامبدا" -msgid "When writing functional-style programs, you'll often need little functions that act as predicates or that combine elements in some way." +msgid "" +"When writing functional-style programs, you'll often need little functions " +"that act as predicates or that combine elements in some way." msgstr "" +"هنگام نوشتن برنامه‌هایی با سبک تابعی، اغلب به توابع کوچکی نیاز خواهید داشت " +"که به‌عنوان محمول (predicate) عمل کنند یا عناصر را به شکلی با هم ترکیب کنند." -msgid "If there's a Python built-in or a module function that's suitable, you don't need to define a new function at all::" +msgid "" +"If there's a Python built-in or a module function that's suitable, you don't" +" need to define a new function at all::" msgstr "" +"اگر یک تابع توکار پایتون یا یک تابع ماژول مناسب وجود داشته باشد، اصلاً نیازی" +" نیست که تابع جدیدی تعریف کنید::" msgid "" "stripped_lines = [line.strip() for line in lines]\n" "existing_files = filter(os.path.exists, file_list)" msgstr "" +"stripped_lines = [line.strip() for line in lines]\n" +"existing_files = filter(os.path.exists, file_list)" -msgid "If the function you need doesn't exist, you need to write it. One way to write small functions is to use the :keyword:`lambda` expression. ``lambda`` takes a number of parameters and an expression combining these parameters, and creates an anonymous function that returns the value of the expression::" +msgid "" +"If the function you need doesn't exist, you need to write it. One way to " +"write small functions is to use the :keyword:`lambda` expression. " +"``lambda`` takes a number of parameters and an expression combining these " +"parameters, and creates an anonymous function that returns the value of the " +"expression::" msgstr "" +"اگر تابع مورد نیاز شما وجود ندارد، باید آن را بنویسید. یکی از راه‌های نوشتن " +"توابع کوچک، استفاده از عبارت :keyword:`lambda` است. ``lambda`` تعدادی " +"پارامتر و یک عبارت که این پارامترها را ترکیب می‌کند می‌گیرد و یک تابع ناشناس" +" می‌سازد که مقدار عبارت را برمی‌گرداند::" msgid "" "adder = lambda x, y: x+y\n" "\n" "print_assign = lambda name, value: name + '=' + str(value)" msgstr "" +"adder = lambda x, y: x+y\n" +"\n" +"print_assign = lambda name, value: name + '=' + str(value)" -msgid "An alternative is to just use the ``def`` statement and define a function in the usual way::" +msgid "" +"An alternative is to just use the ``def`` statement and define a function in" +" the usual way::" msgstr "" +"یک جایگزین این است که صرفاً از دستور ``def`` استفاده کنید و تابعی را به روش " +"معمول تعریف کنید::" msgid "" "def adder(x, y):\n" @@ -909,20 +2115,49 @@ msgid "" "def print_assign(name, value):\n" " return name + '=' + str(value)" msgstr "" +"def adder(x, y):\n" +" return x + y\n" +"\n" +"def print_assign(name, value):\n" +" return name + '=' + str(value)" -msgid "Which alternative is preferable? That's a style question; my usual course is to avoid using ``lambda``." +msgid "" +"Which alternative is preferable? That's a style question; my usual course " +"is to avoid using ``lambda``." msgstr "" +"کدام جایگزین ارجح است؟ این پرسشی درباره‌ی سبک است؛ روش همیشگی من پرهیز از " +"استفاده از ``lambda`` است." -msgid "One reason for my preference is that ``lambda`` is quite limited in the functions it can define. The result has to be computable as a single expression, which means you can't have multiway ``if... elif... else`` comparisons or ``try... except`` statements. If you try to do too much in a ``lambda`` statement, you'll end up with an overly complicated expression that's hard to read. Quick, what's the following code doing? ::" -msgstr "" +msgid "" +"One reason for my preference is that ``lambda`` is quite limited in the " +"functions it can define. The result has to be computable as a single " +"expression, which means you can't have multiway ``if... elif... else`` " +"comparisons or ``try... except`` statements. If you try to do too much in a" +" ``lambda`` statement, you'll end up with an overly complicated expression " +"that's hard to read. Quick, what's the following code doing? ::" +msgstr "" +"یکی از دلایل ترجیح من این است که ``lambda`` در توابعی که می‌تواند تعریف کند،" +" بسیار محدود است. نتیجه باید به‌صورت یک عبارت قابل محاسبه باشد، به این معنا " +"که نمی‌توانید مقایسه‌های چندشاخه‌ای ``if... elif... else`` یا دستورهای " +"``try... except`` داشته باشید. اگر سعی کنید کار زیادی در یک دستور ``lambda``" +" انجام دهید، در نهایت عبارتی بیش از حد پیچیده خواهید داشت که خواندن آن دشوار" +" است. سریع، کد زیر چه کاری انجام می‌دهد؟ ::" msgid "" "import functools\n" "total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" msgstr "" +"import functools\n" +"total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" -msgid "You can figure it out, but it takes time to disentangle the expression to figure out what's going on. Using a short nested ``def`` statements makes things a little bit better::" +msgid "" +"You can figure it out, but it takes time to disentangle the expression to " +"figure out what's going on. Using a short nested ``def`` statements makes " +"things a little bit better::" msgstr "" +"می‌توانید آن را بفهمید، اما گره‌گشایی از عبارت برای دریافتن اینکه چه اتفاقی " +"می‌افتد زمان‌بر است. استفاده از دستورهای ``def`` تودرتوی کوتاه، اوضاع را کمی" +" بهتر می‌کند::" msgid "" "import functools\n" @@ -931,114 +2166,208 @@ msgid "" "\n" "total = functools.reduce(combine, items)[1]" msgstr "" +"import functools\n" +"def combine(a, b):\n" +" return 0, a[1] + b[1]\n" +"\n" +"total = functools.reduce(combine, items)[1]" msgid "But it would be best of all if I had simply used a ``for`` loop::" msgstr "" +"اما بهترین حالت این بود که به‌سادگی از یک حلقه ``for`` استفاده کرده بودم::" msgid "" "total = 0\n" "for a, b in items:\n" " total += b" msgstr "" +"total = 0\n" +"for a, b in items:\n" +" total += b" msgid "Or the :func:`sum` built-in and a generator expression::" -msgstr "" +msgstr "یا تابع توکار :func:`sum` و یک عبارت تولیدگر::" msgid "total = sum(b for a, b in items)" -msgstr "" +msgstr "total = sum(b for a, b in items)" -msgid "Many uses of :func:`functools.reduce` are clearer when written as ``for`` loops." +msgid "" +"Many uses of :func:`functools.reduce` are clearer when written as ``for`` " +"loops." msgstr "" +"بسیاری از کاربردهای :func:`functools.reduce` هنگامی که به‌صورت حلقه‌های " +"``for`` نوشته شوند، واضح‌تر هستند." -msgid "Fredrik Lundh once suggested the following set of rules for refactoring uses of ``lambda``:" +msgid "" +"Fredrik Lundh once suggested the following set of rules for refactoring uses" +" of ``lambda``:" msgstr "" +"فریدریک لوند زمانی مجموعه‌ای از قواعد زیر را برای بازسازی موارد استفاده از " +"``lambda`` پیشنهاد کرد:" msgid "Write a lambda function." -msgstr "" +msgstr "یک تابع lambda بنویسید." msgid "Write a comment explaining what the heck that lambda does." -msgstr "" +msgstr "کامنتی بنویسید که توضیح دهد آن lambda دقیقاً چه کاری انجام می‌دهد." -msgid "Study the comment for a while, and think of a name that captures the essence of the comment." -msgstr "" +msgid "" +"Study the comment for a while, and think of a name that captures the essence" +" of the comment." +msgstr "مدتی کامنت را بررسی کنید و به نامی بیندیشید که بیانگر ماهیت آن باشد." msgid "Convert the lambda to a def statement, using that name." -msgstr "" +msgstr "لامبدا را با استفاده از آن نام، به یک دستور def تبدیل کنید." msgid "Remove the comment." -msgstr "" +msgstr "کامنت را حذف کنید." -msgid "I really like these rules, but you're free to disagree about whether this lambda-free style is better." +msgid "" +"I really like these rules, but you're free to disagree about whether this " +"lambda-free style is better." msgstr "" +"من این قوانین را بسیار می‌پسندم، اما شما آزادید درباره‌ی اینکه آیا این سبک " +"بدون lambda بهتر است یا خیر، نظر متفاوتی داشته باشید." msgid "Revision History and Acknowledgements" -msgstr "" +msgstr "تاریخچه‌ی بازبینی و سپاسگزاری‌ها" -msgid "The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this article: Ian Bicking, Nick Coghlan, Nick Efford, Raymond Hettinger, Jim Jewett, Mike Krell, Leandro Lameiro, Jussi Salmela, Collin Winter, Blake Winton." +msgid "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article:" +" Ian Bicking, Nick Coghlan, Nick Efford, Raymond Hettinger, Jim Jewett, Mike" +" Krell, Leandro Lameiro, Jussi Salmela, Collin Winter, Blake Winton." msgstr "" +"نویسنده مایل است از افراد زیر برای ارائه پیشنهادها، اصلاحات و کمک در " +"پیش‌نویس‌های مختلف این مقاله قدردانی کند: Ian Bicking، Nick Coghlan، Nick " +"Efford، Raymond Hettinger، Jim Jewett، Mike Krell، Leandro Lameiro، Jussi " +"Salmela، Collin Winter، Blake Winton." msgid "Version 0.1: posted June 30 2006." -msgstr "" +msgstr "نسخه‌ی 0.1: منتشرشده در ۳۰ ژوئن ۲۰۰۶." msgid "Version 0.11: posted July 1 2006. Typo fixes." -msgstr "" +msgstr "نسخه 0.11: منتشرشده در ۱ ژوئیه ۲۰۰۶. اصلاح اشتباهات تایپی." -msgid "Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into one. Typo fixes." +msgid "" +"Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " +"one. Typo fixes." msgstr "" +"نسخه 0.2: منتشرشده در ۱۰ ژوئیه ۲۰۰۶. بخش‌های genexp و listcomp در یک بخش " +"ادغام شدند. اصلاح غلط‌های تایپی." -msgid "Version 0.21: Added more references suggested on the tutor mailing list." +msgid "" +"Version 0.21: Added more references suggested on the tutor mailing list." msgstr "" +"نسخه 0.21: مراجع بیشتری که در فهرست پستی tutor پیشنهاد شده بودند، افزوده " +"شدند." -msgid "Version 0.30: Adds a section on the ``functional`` module written by Collin Winter; adds short section on the operator module; a few other edits." +msgid "" +"Version 0.30: Adds a section on the ``functional`` module written by Collin " +"Winter; adds short section on the operator module; a few other edits." msgstr "" +"نسخه‌ی 0.30: بخشی درباره‌ی ماژول ``functional`` نوشته‌شده توسط Collin Winter " +"اضافه می‌کند؛ بخش کوتاهی درباره‌ی ماژول operator اضافه می‌کند؛ چند ویرایش " +"دیگر." msgid "References" -msgstr "" +msgstr "ارجاع‌ها" msgid "General" -msgstr "" +msgstr "عمومی" -msgid "**Structure and Interpretation of Computer Programs**, by Harold Abelson and Gerald Jay Sussman with Julie Sussman. The book can be found at https://mitpress.mit.edu/sicp. In this classic textbook of computer science, chapters 2 and 3 discuss the use of sequences and streams to organize the data flow inside a program. The book uses Scheme for its examples, but many of the design approaches described in these chapters are applicable to functional-style Python code." -msgstr "" +msgid "" +"**Structure and Interpretation of Computer Programs**, by Harold Abelson and" +" Gerald Jay Sussman with Julie Sussman. The book can be found at " +"https://mitpress.mit.edu/sicp. In this classic textbook of computer " +"science, chapters 2 and 3 discuss the use of sequences and streams to " +"organize the data flow inside a program. The book uses Scheme for its " +"examples, but many of the design approaches described in these chapters are " +"applicable to functional-style Python code." +msgstr "" +"**ساختار و تفسیر برنامه‌های کامپیوتری**، اثر هارولد ابلسون و جرالد جی ساسمن " +"با همکاری جولی ساسمن. این کتاب را می‌توانید در https://mitpress.mit.edu/sicp" +" بیابید. در این کتاب درسی کلاسیک علوم کامپیوتر، فصل‌های ۲ و ۳ به بررسی " +"استفاده از دنباله‌ها و جریان‌ها برای سازمان‌دهی جریان داده درون یک برنامه " +"می‌پردازند. این کتاب در مثال‌های خود از Scheme استفاده می‌کند، اما بسیاری از" +" رویکردهای طراحی توصیف‌شده در این فصل‌ها بر کد پایتون به‌سبک تابعی " +"قابل‌اعمال هستند." -msgid "https://defmacro.org/2006/06/19/fp.html: A general introduction to functional programming that uses Java examples and has a lengthy historical introduction." +msgid "" +"https://defmacro.org/2006/06/19/fp.html: A general introduction to " +"functional programming that uses Java examples and has a lengthy historical " +"introduction." msgstr "" +"https://defmacro.org/2006/06/19/fp.html: مقدمه‌ای عمومی بر برنامه‌نویسی " +"تابعی که از مثال‌های جاوا استفاده می‌کند و دارای مقدمه‌ای تاریخی و مفصل است." -msgid "https://en.wikipedia.org/wiki/Functional_programming: General Wikipedia entry describing functional programming." +msgid "" +"https://en.wikipedia.org/wiki/Functional_programming: General Wikipedia " +"entry describing functional programming." msgstr "" +"https://fa.wikipedia.org/wiki/برنامه‌نویسی_تابعی: مدخل عمومی ویکی‌پدیا " +"که برنامه‌نویسی تابعی را توصیف می‌کند." msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." -msgstr "" +msgstr "https://en.wikipedia.org/wiki/Coroutine: مدخل هم‌روال‌ها." -msgid "https://en.wikipedia.org/wiki/Partial_application: Entry for the concept of partial function application." +msgid "" +"https://en.wikipedia.org/wiki/Partial_application: Entry for the concept of " +"partial function application." msgstr "" +"https://en.wikipedia.org/wiki/Partial_application: مدخلی برای مفهوم اعمال " +"جزئی تابع (partial function application)." -msgid "https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." +msgid "" +"https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." msgstr "" +"https://en.wikipedia.org/wiki/Currying: مدخلی برای مفهوم کری‌کردن " +"(currying)." msgid "Python-specific" -msgstr "" +msgstr "مختص پایتون" -msgid "https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-reference:`Text Processing in Python` discusses functional programming for text processing, in the section titled \"Utilizing Higher-Order Functions in Text Processing\"." +msgid "" +"https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" +"reference:`Text Processing in Python` discusses functional programming for " +"text processing, in the section titled \"Utilizing Higher-Order Functions in" +" Text Processing\"." msgstr "" +"https://gnosis.cx/TPiP/: فصل نخست کتاب دیوید مرتز :title-reference:`Text " +"Processing in Python` در بخشی با عنوان «به‌کارگیری توابع مرتبه بالاتر در " +"پردازش متن» به برنامه‌نویسی تابعی برای پردازش متن می‌پردازد." -msgid "Mertz also wrote a 3-part series of articles on functional programming for IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, and `part 3 `__," -msgstr "" +msgid "" +"Mertz also wrote a 3-part series of articles on functional programming for " +"IBM's DeveloperWorks site; see `part 1 " +"`__, `part 2 " +"`__, and `part 3 " +"`__," +msgstr "" +"مرتز همچنین مجموعه‌ای ۳ قسمتی از مقالات درباره‌ی برنامه‌نویسی تابعی برای " +"وب‌سایت DeveloperWorks شرکت IBM نوشت؛ `بخش ۱ " +"`__، `بخش ۲ " +"`__، و `بخش ۳ " +"`__ را ببینید،" msgid "Python documentation" -msgstr "" +msgstr "مستندات پایتون" msgid "Documentation for the :mod:`itertools` module." -msgstr "" +msgstr "مستندات ماژول :mod:`itertools`." msgid "Documentation for the :mod:`functools` module." -msgstr "" +msgstr "مستندات ماژول :mod:`functools`." msgid "Documentation for the :mod:`operator` module." -msgstr "" +msgstr "مستندات ماژول :mod:`operator`." msgid ":pep:`289`: \"Generator Expressions\"" -msgstr "" +msgstr ":pep:`289`: «عبارت‌های تولیدگر»" -msgid ":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new generator features in Python 2.5." +msgid "" +":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " +"generator features in Python 2.5." msgstr "" +":pep:`342`: «Coroutines via Enhanced Generators» قابلیت‌های جدید تولیدگر در " +"پایتون 2.5 را توصیف می‌کند." diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 9fbd0970f..5e087bb89 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -23,108 +23,212 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Debugging C API extensions and CPython Internals with GDB" -msgstr "" +msgstr "اشکال‌زدایی افزونه‌های C API و درونی‌های CPython با GDB" -msgid "This document explains how the Python GDB extension, ``python-gdb.py``, can be used with the GDB debugger to debug CPython extensions and the CPython interpreter itself." +msgid "" +"This document explains how the Python GDB extension, ``python-gdb.py``, can " +"be used with the GDB debugger to debug CPython extensions and the CPython " +"interpreter itself." msgstr "" +"این سند توضیح می‌دهد که چگونه می‌توان از افزونه GDB پایتون، ``python-" +"gdb.py``، به همراه اشکال‌زدای GDB برای اشکال‌زدایی افزونه‌های CPython و خود " +"مفسر CPython استفاده کرد." -msgid "When debugging low-level problems such as crashes or deadlocks, a low-level debugger, such as GDB, is useful to diagnose and correct the issue. By default, GDB (or any of its front-ends) doesn't support high-level information specific to the CPython interpreter." +msgid "" +"When debugging low-level problems such as crashes or deadlocks, a low-level " +"debugger, such as GDB, is useful to diagnose and correct the issue. By " +"default, GDB (or any of its front-ends) doesn't support high-level " +"information specific to the CPython interpreter." msgstr "" +"هنگام اشکال‌زدایی از مشکلات سطح پایین مانند فروپاشی‌ها یا بن‌بست‌ها، یک " +"اشکال‌زدای سطح پایین مانند GDB برای تشخیص و اصلاح مشکل مفید است. به‌طور " +"پیش‌فرض، GDB (یا هر یک از پیشانه‌های آن) از اطلاعات سطح بالایی که مختص مفسر " +"CPython است پشتیبانی نمی‌کند." -msgid "The ``python-gdb.py`` extension adds CPython interpreter information to GDB. The extension helps introspect the stack of currently executing Python functions. Given a Python object represented by a :c:expr:`PyObject *` pointer, the extension surfaces the type and value of the object." +msgid "" +"The ``python-gdb.py`` extension adds CPython interpreter information to GDB." +" The extension helps introspect the stack of currently executing Python " +"functions. Given a Python object represented by a :c:expr:`PyObject *` " +"pointer, the extension surfaces the type and value of the object." msgstr "" +"افزونه ``python-gdb.py`` اطلاعات مفسر CPython را به GDB اضافه می‌کند. این " +"افزونه به درون‌نگری پشته توابع پایتونی که در حال حاضر اجرا می‌شوند، کمک " +"می‌کند. با داشتن یک شیء پایتون که با یک اشاره‌گر :c:expr:`PyObject *` نمایش " +"داده می‌شود، این افزونه نوع و مقدار آن شیء را نمایان می‌کند." -msgid "Developers who are working on CPython extensions or tinkering with parts of CPython that are written in C can use this document to learn how to use the ``python-gdb.py`` extension with GDB." +msgid "" +"Developers who are working on CPython extensions or tinkering with parts of " +"CPython that are written in C can use this document to learn how to use the " +"``python-gdb.py`` extension with GDB." msgstr "" +"توسعه‌دهندگانی که روی افزونه‌های CPython کار می‌کنند یا بخش‌هایی از CPython " +"را که به زبان C نوشته شده‌اند دستکاری می‌کنند، می‌توانند از این سند برای " +"یادگیری نحوه استفاده از افزونه ``python-gdb.py`` در GDB استفاده کنند." -msgid "This document assumes that you are familiar with the basics of GDB and the CPython C API. It consolidates guidance from the `devguide `_ and the `Python wiki `_." +msgid "" +"This document assumes that you are familiar with the basics of GDB and the " +"CPython C API. It consolidates guidance from the `devguide " +"`_ and the `Python wiki " +"`_." msgstr "" +"این سند فرض می‌کند که شما با مبانی GDB و CPython C API آشنا هستید. این سند " +"راهنمایی‌هایی را از `devguide `_ و `ویکی پایتون" +" `_ گردآوری می‌کند." msgid "Prerequisites" -msgstr "" +msgstr "پیش‌نیازها" msgid "You need to have:" -msgstr "" +msgstr "شما باید داشته باشید:" -msgid "GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the sources of Python 3.11 or earlier.)" +msgid "" +"GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the " +"sources of Python 3.11 or earlier.)" msgstr "" +"GDB 7 یا جدیدتر. (برای نسخه‌های قدیمی‌تر GDB، به ``Misc/gdbinit`` در کد منبع" +" پایتون 3.11 یا قدیمی‌تر مراجعه کنید.)" -msgid "GDB-compatible debugging information for Python and any extension you are debugging." +msgid "" +"GDB-compatible debugging information for Python and any extension you are " +"debugging." msgstr "" +"اطلاعات اشکال‌زدایی سازگار با GDB برای پایتون و هر افزونه‌ای که در حال " +"اشکال‌زدایی آن هستید." msgid "The ``python-gdb.py`` extension." -msgstr "" +msgstr "افزونه‌ی ``python-gdb.py``." -msgid "The extension is built with Python, but might be distributed separately or not at all. Below, we include tips for a few common systems as examples. Note that even if the instructions match your system, they might be outdated." +msgid "" +"The extension is built with Python, but might be distributed separately or " +"not at all. Below, we include tips for a few common systems as examples. " +"Note that even if the instructions match your system, they might be " +"outdated." msgstr "" +"این افزونه با پایتون ساخته می‌شود، اما ممکن است به‌صورت جداگانه توزیع شود یا" +" اصلاً توزیع نشود. در ادامه، نکاتی برای چند سیستم رایج به‌عنوان مثال " +"آورده‌ایم. توجه داشته باشید که حتی اگر دستورالعمل‌ها با سیستم شما مطابقت " +"داشته باشند، ممکن است قدیمی باشند." msgid "Setup with Python built from source" -msgstr "" +msgstr "راه‌اندازی با پایتون ساخته‌شده از منبع" -msgid "When you build CPython from source, debugging information should be available, and the build should add a ``python-gdb.py`` file to the root directory of your repository." +msgid "" +"When you build CPython from source, debugging information should be " +"available, and the build should add a ``python-gdb.py`` file to the root " +"directory of your repository." msgstr "" +"هنگامی که CPython را از منبع می‌سازید، اطلاعات اشکال‌زدایی باید در دسترس " +"باشد و فرآیند ساخت باید فایل ``python-gdb.py`` را به پوشه‌ی ریشه‌ی مخزن شما " +"اضافه کند." -msgid "To activate support, you must add the directory containing ``python-gdb.py`` to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions of GDB will print out a warning with instructions on how to do this." +msgid "" +"To activate support, you must add the directory containing ``python-gdb.py``" +" to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions" +" of GDB will print out a warning with instructions on how to do this." msgstr "" +"برای فعال‌سازی پشتیبانی، باید پوشه‌ی حاوی ``python-gdb.py`` را به \"auto-" +"load-safe-path\" در GDB اضافه کنید. اگر این کار را انجام نداده‌اید، نسخه‌های" +" اخیر GDB هشدار همراه با دستورالعمل‌هایی درباره چگونگی انجام این کار نمایش " +"می‌دهند." -msgid "If you do not see instructions for your version of GDB, put this in your configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" +msgid "" +"If you do not see instructions for your version of GDB, put this in your " +"configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" msgstr "" +"اگر دستورالعمل‌هایی برای نسخه GDB خود نمی‌بینید، این را در فایل پیکربندی خود" +" (``~/.gdbinit`` یا ``~/.config/gdb/gdbinit``) قرار دهید::" msgid "add-auto-load-safe-path /path/to/cpython" -msgstr "" +msgstr "add-auto-load-safe-path /path/to/cpython" msgid "You can also add multiple paths, separated by ``:``." -msgstr "" +msgstr "همچنین می‌توانید چندین مسیر را که با ``:`` جدا شده‌اند، اضافه کنید." msgid "Setup for Python from a Linux distro" -msgstr "" +msgstr "راه‌اندازی پایتون از یک توزیع لینوکس" -msgid "Most Linux systems provide debug information for the system Python in a package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" +msgid "" +"Most Linux systems provide debug information for the system Python in a " +"package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" msgstr "" +"بیشتر سیستم‌های لینوکسی اطلاعات اشکال‌زدایی برای پایتون سیستم را در بسته‌ای " +"به نام ``python-debuginfo``، ``python-dbg`` یا مشابه آن ارائه می‌دهند. برای " +"مثال:" msgid "Fedora:" -msgstr "" +msgstr "فدورا:" msgid "" "sudo dnf install gdb\n" "sudo dnf debuginfo-install python3" msgstr "" +"sudo dnf install gdb\n" +"sudo dnf debuginfo-install python3" msgid "Ubuntu:" -msgstr "" +msgstr "اوبونتو:" msgid "sudo apt install gdb python3-dbg" -msgstr "" +msgstr "sudo apt install gdb python3-dbg" -msgid "On several recent Linux systems, GDB can download debugging symbols automatically using *debuginfod*. However, this will not install the ``python-gdb.py`` extension; you generally do need to install the debug info package separately." +msgid "" +"On several recent Linux systems, GDB can download debugging symbols " +"automatically using *debuginfod*. However, this will not install the " +"``python-gdb.py`` extension; you generally do need to install the debug info" +" package separately." msgstr "" +"در چندین سیستم لینوکسی اخیر، GDB می‌تواند نمادهای اشکال‌زدایی را به‌صورت " +"خودکار با استفاده از *debuginfod* بارگیری کند. با این حال، این کار افزونه‌ی " +"``python-gdb.py`` را نصب نمی‌کند؛ شما معمولاً باید بسته‌ی اطلاعات " +"اشکال‌زدایی را به‌صورت جداگانه نصب کنید." msgid "Using the Debug build and Development mode" -msgstr "" +msgstr "استفاده از ساخت اشکال‌زدایی و حالت توسعه" msgid "For easier debugging, you might want to:" -msgstr "" +msgstr "برای اشکال‌زدایی آسان‌تر، ممکن است بخواهید:" -msgid "Use a :ref:`debug build ` of Python. (When building from source, use ``configure --with-pydebug``. On Linux distros, install and run a package like ``python-debug`` or ``python-dbg``, if available.)" +msgid "" +"Use a :ref:`debug build ` of Python. (When building from " +"source, use ``configure --with-pydebug``. On Linux distros, install and run " +"a package like ``python-debug`` or ``python-dbg``, if available.)" msgstr "" +"از یک :ref:`ساخت اشکال‌زدایی ` پایتون استفاده کنید. (هنگام ساخت" +" از منبع، از ``configure --with-pydebug`` استفاده کنید. در توزیع‌های لینوکس،" +" بسته‌ای مانند ``python-debug`` یا ``python-dbg`` را در صورت وجود نصب و اجرا" +" کنید.)" msgid "Use the runtime :ref:`development mode ` (``-X dev``)." -msgstr "" +msgstr "از :ref:`حالت توسعه‌ی ران‌تایم ` (``-X dev``) استفاده کنید." -msgid "Both enable extra assertions and disable some optimizations. Sometimes this hides the bug you are trying to find, but in most cases they make the process easier." +msgid "" +"Both enable extra assertions and disable some optimizations. Sometimes this " +"hides the bug you are trying to find, but in most cases they make the " +"process easier." msgstr "" +"هر دو ادعاهای اضافی را فعال می‌کنند و برخی بهینه‌سازی‌ها را غیرفعال می‌کنند." +" گاهی اوقات این کار، اشکالی را که سعی در یافتن آن دارید پنهان می‌کند، اما در" +" بیشتر موارد فرایند را آسان‌تر می‌کنند." msgid "Using the ``python-gdb`` extension" -msgstr "" +msgstr "استفاده از افزونه‌ی ``python-gdb``" -msgid "When the extension is loaded, it provides two main features: pretty printers for Python values, and additional commands." +msgid "" +"When the extension is loaded, it provides two main features: pretty printers" +" for Python values, and additional commands." msgstr "" +"هنگامی که افزونه بارگذاری می‌شود، دو قابلیت اصلی ارائه می‌دهد: چاپگرهای زیبا" +" (pretty printers) برای مقادیر پایتون و دستورات اضافی." msgid "Pretty-printers" -msgstr "" +msgstr "زیبانویس‌ها (Pretty-printers)" -msgid "This is what a GDB backtrace looks like (truncated) when this extension is enabled::" +msgid "" +"This is what a GDB backtrace looks like (truncated) when this extension is " +"enabled::" msgstr "" +"هنگامی که این افزونه فعال باشد، یک ردگیری پشته GDB به این شکل است " +"(کوتاه‌شده)::" msgid "" "#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at address 0x7fffff7fefe8\n" @@ -143,12 +247,38 @@ msgid "" " {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': , 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': , '__doc__': None}, key=\n" " 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" msgstr "" +"#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at address 0x7fffff7fefe8\n" +") at Objects/obmalloc.c:748\n" +"#1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) at Objects/obmalloc.c:1445\n" +"#2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/obmalloc.c:1412\n" +"#3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/unicodeobject.c:346\n" +"#4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d \"__lltrace__\", size=11, errors=0x0, consumed=\n" +" 0x0) at Objects/unicodeobject.c:2531\n" +"#5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d \"__lltrace__\", size=11, errors=0x0)\n" +" at Objects/unicodeobject.c:2495\n" +"#6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d \"__lltrace__\", size=11)\n" +" at Objects/unicodeobject.c:551\n" +"#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d \"__lltrace__\") at Objects/unicodeobject.c:569\n" +"#8 0x0000000000584abd in PyDict_GetItemString (v=\n" +" {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': , 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': , '__doc__': None}, key=\n" +" 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" -msgid "Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed as its ``repr()``, rather than an opaque ``PyObject *`` pointer." +msgid "" +"Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " +"as its ``repr()``, rather than an opaque ``PyObject *`` pointer." msgstr "" +"توجه کنید که چگونه آرگومان دیکشنریِ ``PyDict_GetItemString`` به‌صورت " +"``repr()`` آن نمایش داده می‌شود، نه به‌صورت یک اشاره‌گر مبهم ``PyObject *``." -msgid "The extension works by supplying a custom printing routine for values of type ``PyObject *``. If you need to access lower-level details of an object, then cast the value to a pointer of the appropriate type. For example::" +msgid "" +"The extension works by supplying a custom printing routine for values of " +"type ``PyObject *``. If you need to access lower-level details of an " +"object, then cast the value to a pointer of the appropriate type. For " +"example::" msgstr "" +"این افزونه با ارائه یک روال چاپ سفارشی برای مقادیری از نوع ``PyObject *`` " +"کار می‌کند. اگر نیاز دارید به جزئیات سطح پایین‌تر یک شیء دسترسی پیدا کنید، " +"مقدار را به اشاره‌گری از نوع مناسب تبدیل کنید. برای مثال::" msgid "" "(gdb) p globals\n" @@ -170,12 +300,44 @@ msgid "" "{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" " me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" msgstr "" +"(gdb) p globals\n" +"$1 = {'__builtins__': , '__name__':\n" +"'__main__', 'ctypes': , '__doc__': None,\n" +"'__package__': None}\n" +"\n" +"(gdb) p *(PyDictObject*)globals\n" +"$2 = {ob_refcnt = 3, ob_type = 0x3dbdf85820, ma_fill = 5, ma_used = 5,\n" +"ma_mask = 7, ma_table = 0x63d0f8, ma_lookup = 0x3dbdc7ea70\n" +", ma_smalltable = {{me_hash = 7065186196740147912,\n" +"me_key = '__builtins__', me_value = },\n" +"{me_hash = -368181376027291943, me_key = '__name__',\n" +"me_value ='__main__'}, {me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = -9177857982131165996, me_key = 'ctypes',\n" +"me_value = },\n" +"{me_hash = -8518757509529533123, me_key = '__doc__', me_value = None},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" +" me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" -msgid "Note that the pretty-printers do not actually call ``repr()``. For basic types, they try to match its result closely." +msgid "" +"Note that the pretty-printers do not actually call ``repr()``. For basic " +"types, they try to match its result closely." msgstr "" +"توجه داشته باشید که زیبانویس‌ها (pretty-printers) در واقع ``repr()`` را " +"فراخوانی نمی‌کنند. برای انواع پایه، آن‌ها تلاش می‌کنند تا حد زیادی با " +"نتیجه‌ی آن مطابقت داشته باشند." -msgid "An area that can be confusing is that the custom printer for some types look a lot like GDB's built-in printer for standard types. For example, the pretty-printer for a Python ``int`` (:c:expr:`PyLongObject *`) gives a representation that is not distinguishable from one of a regular machine-level integer::" +msgid "" +"An area that can be confusing is that the custom printer for some types look" +" a lot like GDB's built-in printer for standard types. For example, the " +"pretty-printer for a Python ``int`` (:c:expr:`PyLongObject *`) gives a " +"representation that is not distinguishable from one of a regular machine-" +"level integer::" msgstr "" +"یکی از مواردی که ممکن است باعث سردرگمی شود این است که چاپگر سفارشی برخی از " +"انواع، بسیار شبیه چاپگر توکار GDB برای انواع استاندارد است. برای مثال، " +" زیبانویس (pretty-printer) برای ``int`` پایتون (:c:expr:`PyLongObject *`) نمایشی" +" ارائه می‌دهد که از نمایش یک عدد صحیح معمولی در سطح ماشین قابل تشخیص نیست::" msgid "" "(gdb) p some_machine_integer\n" @@ -184,46 +346,86 @@ msgid "" "(gdb) p some_python_integer\n" "$4 = 42" msgstr "" +"(gdb) p some_machine_integer\n" +"$3 = 42\n" +"\n" +"(gdb) p some_python_integer\n" +"$4 = 42" -msgid "The internal structure can be revealed with a cast to :c:expr:`PyLongObject *`::" +msgid "" +"The internal structure can be revealed with a cast to :c:expr:`PyLongObject " +"*`::" msgstr "" +"ساختار داخلی را می‌توان با یک تبدیل نوع (cast) به :c:expr:`PyLongObject *` " +"نمایان کرد::" msgid "" "(gdb) p *(PyLongObject*)some_python_integer\n" "$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1},\n" "ob_digit = {42}}" msgstr "" +"(gdb) p *(PyLongObject*)some_python_integer\n" +"$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1},\n" +"ob_digit = {42}}" -msgid "A similar confusion can arise with the ``str`` type, where the output looks a lot like gdb's built-in printer for ``char *``::" +msgid "" +"A similar confusion can arise with the ``str`` type, where the output looks " +"a lot like gdb's built-in printer for ``char *``::" msgstr "" +"ممکن است سردرگمی مشابهی در مورد نوع ``str`` پیش بیاید، که خروجی آن بسیار " +"شبیه به چاپگر توکار gdb برای ``char *`` است::" msgid "" "(gdb) p ptr_to_python_str\n" "$6 = '__builtins__'" msgstr "" +"(gdb) p ptr_to_python_str\n" +"$6 = '__builtins__'" -msgid "The pretty-printer for ``str`` instances defaults to using single-quotes (as does Python's ``repr`` for strings) whereas the standard printer for ``char *`` values uses double-quotes and contains a hexadecimal address::" +msgid "" +"The pretty-printer for ``str`` instances defaults to using single-quotes (as" +" does Python's ``repr`` for strings) whereas the standard printer for ``char" +" *`` values uses double-quotes and contains a hexadecimal address::" msgstr "" +" زیبانویس (pretty-printer) برای نمونه‌های ``str`` به‌طور پیش‌فرض از علامت " +"نقل‌قول تکی استفاده می‌کند (همان‌گونه که ``repr`` پایتون برای رشته‌ها عمل " +"می‌کند)، در حالی که چاپگر استاندارد برای مقادیر ``char *`` از علامت نقل‌قول " +"دوتایی استفاده می‌کند و شامل یک نشانی مبنای شانزده است::" msgid "" "(gdb) p ptr_to_char_star\n" "$7 = 0x6d72c0 \"hello world\"" msgstr "" +"(gdb) p ptr_to_char_star\n" +"$7 = 0x6d72c0 \"hello world\"" -msgid "Again, the implementation details can be revealed with a cast to :c:expr:`PyUnicodeObject *`::" +msgid "" +"Again, the implementation details can be revealed with a cast to " +":c:expr:`PyUnicodeObject *`::" msgstr "" +"بار دیگر، جزئیات پیاده‌سازی را می‌توان با یک تبدیل نوع (cast) به " +":c:expr:`PyUnicodeObject *` آشکار کرد::" msgid "" "(gdb) p *(PyUnicodeObject*)$6\n" "$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" "str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" msgstr "" +"(gdb) p *(PyUnicodeObject*)$6\n" +"$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" +"str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" msgid "``py-list``" -msgstr "" +msgstr "``py-list``" -msgid "The extension adds a ``py-list`` command, which lists the Python source code (if any) for the current frame in the selected thread. The current line is marked with a \">\"::" +msgid "" +"The extension adds a ``py-list`` command, which lists the Python source code" +" (if any) for the current frame in the selected thread. The current line is" +" marked with a \">\"::" msgstr "" +"این افزونه دستور ``py-list`` را اضافه می‌کند، که کد منبع پایتون (در صورت " +"وجود) برای فریم جاری در نخ انتخاب‌شده را فهرست می‌کند. خط جاری با «>» مشخص " +"می‌شود::" msgid "" "(gdb) py-list\n" @@ -239,24 +441,58 @@ msgid "" " 910 except KeyboardInterrupt:\n" " 911 # properly quit on a keyboard interrupt..." msgstr "" +"(gdb) py-list\n" +" 901 if options.profile:\n" +" 902 options.profile = False\n" +" 903 profile_me()\n" +" 904 return\n" +" 905\n" +">906 u = UI()\n" +" 907 if not u.quit:\n" +" 908 try:\n" +" 909 gtk.main()\n" +" 910 except KeyboardInterrupt:\n" +" 911 # properly quit on a keyboard interrupt..." -msgid "Use ``py-list START`` to list at a different line number within the Python source, and ``py-list START,END`` to list a specific range of lines within the Python source." +msgid "" +"Use ``py-list START`` to list at a different line number within the Python " +"source, and ``py-list START,END`` to list a specific range of lines within " +"the Python source." msgstr "" +"برای فهرست کردن خطوط از یک شماره‌خط متفاوت در کد منبع پایتون، از ``py-list " +"START`` و برای فهرست کردن محدوده مشخصی از خطوط در کد منبع پایتون، از ``py-" +"list START,END`` استفاده کنید." msgid "``py-up`` and ``py-down``" -msgstr "" +msgstr "``py-up`` و ``py-down``" -msgid "The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up`` and ``down`` commands, but try to move at the level of CPython frames, rather than C frames." +msgid "" +"The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up``" +" and ``down`` commands, but try to move at the level of CPython frames, " +"rather than C frames." msgstr "" +"دستورهای ``py-up`` و ``py-down`` مشابه دستورهای معمولی ``up`` و ``down`` " +"در GDB هستند، اما تلاش می‌کنند در سطح فریم‌های CPython حرکت کنند، نه " +"فریم‌های C." -msgid "GDB is not always able to read the relevant frame information, depending on the optimization level with which CPython was compiled. Internally, the commands look for C frames that are executing the default frame evaluation function (that is, the core bytecode interpreter loop within CPython) and look up the value of the related ``PyFrameObject *``." -msgstr "" +msgid "" +"GDB is not always able to read the relevant frame information, depending on " +"the optimization level with which CPython was compiled. Internally, the " +"commands look for C frames that are executing the default frame evaluation " +"function (that is, the core bytecode interpreter loop within CPython) and " +"look up the value of the related ``PyFrameObject *``." +msgstr "" +"GDB همیشه قادر به خواندن اطلاعات فریممرتبط نیست؛ این موضوع به سطح " +"بهینه‌سازی مورد استفاده در کامپایل CPython بستگی دارد. در سطح داخلی، این " +"دستورات به دنبال فریم‌های C می‌گردند که در حال اجرای تابع ارزیابی فریم " +"پیش‌فرض هستند (یعنی حلقه اصلی مفسر بایت‌کد در CPython) و مقدار " +"``PyFrameObject *`` مرتبط را پیدا می‌کنند." msgid "They emit the frame number (at the C level) within the thread." -msgstr "" +msgstr "آن‌ها شماره‌ی فریم (در سطح C) را درون نخ صادر می‌کنند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "(gdb) py-up\n" @@ -270,15 +506,31 @@ msgid "" "(gdb) py-up\n" "Unable to find an older python frame" msgstr "" +"(gdb) py-up\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-up\n" +"#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=)\n" +" main.start_game()\n" +"(gdb) py-up\n" +"Unable to find an older python frame" msgid "so we're at the top of the Python stack." -msgstr "" +msgstr "بنابراین، در بالای پشته‌ی پایتون هستیم." -msgid "The frame numbers correspond to those displayed by GDB's standard ``backtrace`` command. The command skips C frames which are not executing Python code." +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command. The command skips C frames which are not executing " +"Python code." msgstr "" +"شماره فریم‌ها با شماره‌هایی که توسط فرمان استاندارد ``backtrace`` در GDB " +"نمایش داده می‌شوند، مطابقت دارند. این فرمان، فریم‌های C را که در حال اجرای " +"کد پایتون نیستند، نادیده می‌گیرد." msgid "Going back down::" -msgstr "" +msgstr "بازگشت به پایین::" msgid "" "(gdb) py-down\n" @@ -301,12 +553,38 @@ msgid "" "(gdb) py-down\n" "Unable to find a newer python frame" msgstr "" +"(gdb) py-down\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-down\n" +"#34 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#23 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#19 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/game_selector.py, line 201, in run_swallowed_dialog (self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, 'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=, main_page=0) at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"(gdb) py-down\n" +"#8 (unable to read python frame information)\n" +"(gdb) py-down\n" +"Unable to find a newer python frame" msgid "and we're at the bottom of the Python stack." -msgstr "" +msgstr "و در پایین پشته‌ی پایتون قرار داریم." -msgid "Note that in Python 3.12 and newer, the same C stack frame can be used for multiple Python stack frames. This means that ``py-up`` and ``py-down`` may move multiple Python frames at once. For example::" +msgid "" +"Note that in Python 3.12 and newer, the same C stack frame can be used for " +"multiple Python stack frames. This means that ``py-up`` and ``py-down`` may " +"move multiple Python frames at once. For example::" msgstr "" +"توجه داشته باشید که در پایتون 3.12 و نسخه‌های جدیدتر، می‌توان از یک قاب " +"پشته‌ی C برای چندین قاب پشته‌ی پایتون استفاده کرد. این بدان معناست که ``py-" +"up`` و ``py-down`` ممکن است چندین قاب پایتون را همزمان جابه‌جا کنند. برای " +"مثال::" msgid "" "(gdb) py-up\n" @@ -327,12 +605,33 @@ msgid "" "(gdb) py-up\n" "Unable to find an older python frame" msgstr "" +"(gdb) py-up\n" +"#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function (n=0)\n" +" time.sleep(5)\n" +"#6 Frame 0x7ffff7fb6240, for file /tmp/rec.py, line 7, in recursive_function (n=1)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb61d0, for file /tmp/rec.py, line 7, in recursive_function (n=2)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6160, for file /tmp/rec.py, line 7, in recursive_function (n=3)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb60f0, for file /tmp/rec.py, line 7, in recursive_function (n=4)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6080, for file /tmp/rec.py, line 7, in recursive_function (n=5)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6020, for file /tmp/rec.py, line 9, in ()\n" +" recursive_function(5)\n" +"(gdb) py-up\n" +"Unable to find an older python frame" msgid "``py-bt``" -msgstr "" +msgstr "``py-bt``" -msgid "The ``py-bt`` command attempts to display a Python-level backtrace of the current thread." +msgid "" +"The ``py-bt`` command attempts to display a Python-level backtrace of the " +"current thread." msgstr "" +"فرمان ``py-bt`` تلاش می‌کند یک ردگیری پشته در سطح پایتون از نخ جاری را نمایش" +" دهد." msgid "" "(gdb) py-bt\n" @@ -349,15 +648,38 @@ msgid "" "#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/gnome_sudoku/gnome_sudoku.py, line 22, in start_game (main=)\n" " main.start_game()" msgstr "" +"(gdb) py-bt\n" +"#8 (unable to read python frame information)\n" +"#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/dialog_swallower.py, line 48, in run_dialog (self=, main_page=0) at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/game_selector.py, line 201, in run_swallowed_dialog (self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, 'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=)\n" +" main.start_game()" -msgid "The frame numbers correspond to those displayed by GDB's standard ``backtrace`` command." +msgid "" +"The frame numbers correspond to those displayed by GDB's standard " +"``backtrace`` command." msgstr "" +"شماره‌های قاب با شماره‌هایی که دستور استاندارد ``backtrace`` در GDB نمایش " +"می‌دهد، مطابقت دارند." msgid "``py-print``" -msgstr "" +msgstr "``py-print``" -msgid "The ``py-print`` command looks up a Python name and tries to print it. It looks in locals within the current thread, then globals, then finally builtins::" +msgid "" +"The ``py-print`` command looks up a Python name and tries to print it. It " +"looks in locals within the current thread, then globals, then finally " +"builtins::" msgstr "" +"فرمان ``py-print`` یک نام پایتون را جستجو می‌کند و سعی می‌کند آن را چاپ کند." +" این فرمان در متغیرهای محلی در نخ جاری، سپس در متغیرهای سراسری، و در نهایت " +"در توکارها جستجو می‌کند::" msgid "" "(gdb) py-print self\n" @@ -370,15 +692,32 @@ msgid "" "(gdb) py-print scarlet_pimpernel\n" "'scarlet_pimpernel' not found" msgstr "" +"(gdb) py-print self\n" +"local 'self' = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"(gdb) py-print __name__\n" +"global '__name__' = 'gnome_sudoku.dialog_swallower'\n" +"(gdb) py-print len\n" +"builtin 'len' = \n" +"(gdb) py-print scarlet_pimpernel\n" +"'scarlet_pimpernel' not found" -msgid "If the current C frame corresponds to multiple Python frames, ``py-print`` only considers the first one." +msgid "" +"If the current C frame corresponds to multiple Python frames, ``py-print`` " +"only considers the first one." msgstr "" +"اگر فریم C فعلی با چندین فریم پایتون متناظر باشد، ``py-print`` فقط اولین " +"فریم را در نظر می‌گیرد." msgid "``py-locals``" -msgstr "" +msgstr "``py-locals``" -msgid "The ``py-locals`` command looks up all Python locals within the current Python frame in the selected thread, and prints their representations::" +msgid "" +"The ``py-locals`` command looks up all Python locals within the current " +"Python frame in the selected thread, and prints their representations::" msgstr "" +"دستور ``py-locals`` همه‌ی متغیرهای محلی پایتون را در فریم پایتون جاری در نخ " +"انتخاب‌شده جست‌وجو می‌کند و بازنمایی‌های آن‌ها را چاپ می‌کند::" msgid "" "(gdb) py-locals\n" @@ -386,9 +725,17 @@ msgid "" "main_page=0) at remote 0x98fa6e4>\n" "d = " msgstr "" +"(gdb) py-locals\n" +"self = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"d = " -msgid "If the current C frame corresponds to multiple Python frames, locals from all of them will be shown::" +msgid "" +"If the current C frame corresponds to multiple Python frames, locals from " +"all of them will be shown::" msgstr "" +"اگر فریم C جاری با چندین فریم پایتون متناظر باشد، متغیرهای محلی همه‌ی آن‌ها " +"نمایش داده خواهند شد::" msgid "" "(gdb) py-locals\n" @@ -406,12 +753,33 @@ msgid "" "n = 5\n" "Locals for " msgstr "" +"(gdb) py-locals\n" +"Locals for recursive_function\n" +"n = 0\n" +"Locals for recursive_function\n" +"n = 1\n" +"Locals for recursive_function\n" +"n = 2\n" +"Locals for recursive_function\n" +"n = 3\n" +"Locals for recursive_function\n" +"n = 4\n" +"Locals for recursive_function\n" +"n = 5\n" +"Locals for " msgid "Use with GDB commands" -msgstr "" +msgstr "استفاده با دستورات GDB" -msgid "The extension commands complement GDB's built-in commands. For example, you can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go a specific frame within the selected thread, like this::" +msgid "" +"The extension commands complement GDB's built-in commands. For example, you " +"can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go " +"a specific frame within the selected thread, like this::" msgstr "" +"فرمان‌های افزونه‌ای، فرمان‌های توکار GDB را تکمیل می‌کنند. برای مثال، " +"می‌توانید از شماره‌های قاب نمایش‌داده‌شده توسط ``py-bt`` همراه با فرمان " +"``frame`` برای رفتن به یک قاب مشخص در نخ انتخاب‌شده استفاده کنید، به این " +"صورت::" msgid "" "(gdb) py-bt\n" @@ -429,9 +797,27 @@ msgid "" "1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" ">1548 main()" msgstr "" +"(gdb) py-bt\n" +"(output snipped)\n" +"#68 Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in ()\n" +" main()\n" +"(gdb) frame 68\n" +"#68 0x00000000004cd1e6 in PyEval_EvalFrameEx (f=Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in (), throwflag=0) at Python/ceval.c:2665\n" +"2665 x = call_function(&sp, oparg);\n" +"(gdb) py-list\n" +"1543 # Run the tests in a context manager that temporary changes the CWD to a\n" +"1544 # temporary and writable directory. If it's not possible to create or\n" +"1545 # change the CWD, the original CWD will be used. The original CWD is\n" +"1546 # available from test_support.SAVEDCWD.\n" +"1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" +">1548 main()" -msgid "The ``info threads`` command will give you a list of the threads within the process, and you can use the ``thread`` command to select a different one::" +msgid "" +"The ``info threads`` command will give you a list of the threads within the " +"process, and you can use the ``thread`` command to select a different one::" msgstr "" +"دستور ``info threads`` فهرستی از نخ‌های درون فرایند را به شما می‌دهد، و " +"می‌توانید از دستور ``thread`` برای انتخاب یک نخ دیگر استفاده کنید::" msgid "" "(gdb) info threads\n" @@ -439,9 +825,19 @@ msgid "" " 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86\n" "* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../sysdeps/unix/syscall-template.S:82" msgstr "" +"(gdb) info threads\n" +" 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86\n" +" 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86\n" +"* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../sysdeps/unix/syscall-template.S:82" -msgid "You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to run a command on all threads. With ``py-bt``, this lets you see what every thread is doing at the Python level::" +msgid "" +"You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to" +" run a command on all threads. With ``py-bt``, this lets you see what every" +" thread is doing at the Python level::" msgstr "" +"می‌توانید از ``thread apply all COMMAND`` یا (``t a a COMMAND`` به‌صورت " +"مخفف) برای اجرای یک دستور روی همه نخ‌ها استفاده کنید. با ``py-bt``، این کار " +"به شما امکان می‌دهد ببینید هر نخ در سطح پایتون چه کاری انجام می‌دهد::" msgid "" "(gdb) t a a py-bt\n" @@ -472,3 +868,30 @@ msgid "" "#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 378, in _check_notify (self=, skipped=[], _mirrorOutput=False, testsRun=39, buffer=False, _original_stderr=, _stdout_buffer=, _stderr_buffer=, _moduleSetUpFailed=False, expectedFailures=[], errors=[], _previousTestClass=, unexpectedSuccesses=[], failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, _threads=(0,), _cleanups=[], _type_equality_funcs={: , : , : , : , , _RLock__count=1) at remote 0xd7ff40>, count_owner=(1, 140737213728528), count=1, owner=140737213728528)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffac001640, for file /home/david/coding/python-svn/Lib/threading.py, line 269, in wait (self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, _release_save=, release=, _acquire_restore=, _Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, timeout=None, waiter=, saved_state=(1, 140737213728528))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffb8001a10, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffb8001c40, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 37, in task (tid=140737213728528)\n" +" f()\n" +"\n" +"Thread 104 (Thread 0x7fffdf5fe710 (LWP 10259)):\n" +"#5 Frame 0x7fffe4001580, for file /home/david/coding/python-svn/Lib/threading.py, line 155, in _acquire_restore (self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, count_owner=(1, 140736940992272), count=1, owner=140736940992272)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffc8002090, for file /home/david/coding/python-svn/Lib/threading.py, line 269, in wait (self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, _release_save=, release=, _acquire_restore=, _Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, timeout=None, waiter=, saved_state=(1, 140736940992272))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffac001c90, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffac0011c0, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 37, in task (tid=140736940992272)\n" +" f()\n" +"\n" +"Thread 1 (Thread 0x7ffff7fe2700 (LWP 10145)):\n" +"#5 Frame 0xcb5380, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 16, in _wait ()\n" +" time.sleep(0.01)\n" +"#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/lock_tests.py, line 378, in _check_notify (self=, skipped=[], _mirrorOutput=False, testsRun=39, buffer=False, _original_stderr=, _stdout_buffer=, _stderr_buffer=, _moduleSetUpFailed=False, expectedFailures=[], errors=[], _previousTestClass=, unexpectedSuccesses=[], failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, _threads=(0,), _cleanups=[], _type_equality_funcs={: , : , : , : , 1);\n" msgid "Python HOWTOs" -msgstr "" +msgstr "راهنماهای عملی پایتون" -msgid "Python HOWTOs are documents that cover a specific topic in-depth. Modeled on the Linux Documentation Project's HOWTO collection, this collection is an effort to foster documentation that's more detailed than the Python Library Reference." +msgid "" +"Python HOWTOs are documents that cover a specific topic in-depth. Modeled on" +" the Linux Documentation Project's HOWTO collection, this collection is an " +"effort to foster documentation that's more detailed than the Python Library " +"Reference." msgstr "" +"راهنماهای عملی پایتون (Python HOWTOs) اسنادی هستند که یک موضوع خاص را " +"به‌صورت عمیق پوشش می‌دهند. این مجموعه با الگوبرداری از مجموعه HOWTO پروژه " +"مستندات لینوکس، تلاشی است برای ترویج مستنداتی که جزئیات بیشتری نسبت به مرجع " +"کتابخانه پایتون دارند." msgid "General:" -msgstr "" +msgstr "عمومی:" msgid ":ref:`a-conceptual-overview-of-asyncio`" -msgstr "" +msgstr ":ref:`a-conceptual-overview-of-asyncio`" msgid ":ref:`annotations-howto`" -msgstr "" +msgstr ":ref:`annotations-howto`" msgid ":ref:`argparse-tutorial`" -msgstr "" +msgstr ":ref:`argparse-tutorial`" msgid ":ref:`descriptorhowto`" -msgstr "" +msgstr ":ref:`descriptorhowto`" msgid ":ref:`enum-howto`" -msgstr "" +msgstr ":ref:`enum-howto`" msgid ":ref:`functional-howto`" -msgstr "" +msgstr ":ref:`functional-howto`" msgid ":ref:`ipaddress-howto`" -msgstr "" +msgstr ":ref:`ipaddress-howto`" msgid ":ref:`logging-howto`" -msgstr "" +msgstr ":ref:`logging-howto`" msgid ":ref:`logging-cookbook`" -msgstr "" +msgstr ":ref:`logging-cookbook`" msgid ":ref:`regex-howto`" -msgstr "" +msgstr ":ref:`regex-howto`" msgid ":ref:`sortinghowto`" -msgstr "" +msgstr ":ref:`sortinghowto`" msgid ":ref:`unicode-howto`" -msgstr "" +msgstr ":ref:`unicode-howto`" msgid ":ref:`urllib-howto`" -msgstr "" +msgstr ":ref:`urllib-howto`" msgid "Advanced development:" -msgstr "" +msgstr "توسعه پیشرفته:" msgid ":ref:`curses-howto`" -msgstr "" +msgstr ":ref:`curses-howto`" msgid ":ref:`freethreading-python-howto`" -msgstr "" +msgstr ":ref:`freethreading-python-howto`" msgid ":ref:`freethreading-extensions-howto`" -msgstr "" +msgstr ":ref:`freethreading-extensions-howto`" msgid ":ref:`isolating-extensions-howto`" -msgstr "" +msgstr ":ref:`isolating-extensions-howto`" msgid ":ref:`python_2.3_mro`" -msgstr "" +msgstr ":ref:`python_2.3_mro`" msgid ":ref:`socket-howto`" -msgstr "" +msgstr ":ref:`socket-howto`" msgid ":ref:`timerfd-howto`" -msgstr "" +msgstr ":ref:`timerfd-howto`" msgid ":ref:`cporting-howto`" -msgstr "" +msgstr ":ref:`cporting-howto`" msgid "Debugging and profiling:" -msgstr "" +msgstr "اشکال‌زدایی و پروفایل‌گیری:" msgid ":ref:`gdb`" -msgstr "" +msgstr ":ref:`gdb`" msgid ":ref:`instrumentation`" -msgstr "" +msgstr ":ref:`instrumentation`" msgid ":ref:`perf_profiling`" -msgstr "" +msgstr ":ref:`perf_profiling`" msgid ":ref:`remote-debugging`" -msgstr "" +msgstr ":ref:`remote-debugging`" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 9081e7ba7..8cf4f1d34 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -26,61 +26,99 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Instrumenting CPython with DTrace and SystemTap" -msgstr "" +msgstr "ابزارسازی CPython با DTrace و SystemTap" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "David Malcolm" -msgstr "" +msgstr "دیوید مالکوم" msgid "Łukasz Langa" -msgstr "" +msgstr "Łukasz Langa" -msgid "DTrace and SystemTap are monitoring tools, each providing a way to inspect what the processes on a computer system are doing. They both use domain-specific languages allowing a user to write scripts which:" +msgid "" +"DTrace and SystemTap are monitoring tools, each providing a way to inspect " +"what the processes on a computer system are doing. They both use domain-" +"specific languages allowing a user to write scripts which:" msgstr "" +"DTrace و SystemTap ابزارهای پایش هستند که هر کدام راهی برای بررسی کارهایی که" +" فرایندهای یک سیستم کامپیوتری انجام می‌دهند، فراهم می‌کنند. هر دوی آن‌ها از " +"زبان‌های خاص‌منظوره استفاده می‌کنند که به کاربر امکان می‌دهند اسکریپت‌هایی " +"بنویسد که:" msgid "filter which processes are to be observed" -msgstr "" +msgstr "فیلتر کردن فرایندهایی که باید مشاهده شوند" msgid "gather data from the processes of interest" -msgstr "" +msgstr "جمع‌آوری داده‌ها از فرآیندهای مورد نظر" msgid "generate reports on the data" -msgstr "" +msgstr "تولید گزارش درباره‌ی داده‌ها" -msgid "As of Python 3.6, CPython can be built with embedded \"markers\", also known as \"probes\", that can be observed by a DTrace or SystemTap script, making it easier to monitor what the CPython processes on a system are doing." +msgid "" +"As of Python 3.6, CPython can be built with embedded \"markers\", also known" +" as \"probes\", that can be observed by a DTrace or SystemTap script, making" +" it easier to monitor what the CPython processes on a system are doing." msgstr "" +"از پایتون 3.6 به بعد، می‌توان CPython را با نشانگرهای تعبیه‌شده‌ای ساخت که " +"با نام «پروب‌ها» (probes) نیز شناخته می‌شوند و می‌توان آن‌ها را با یک " +"اسکریپت DTrace یا SystemTap مشاهده کرد؛ این امر پایش آنچه را که فرآیندهای " +"CPython بر روی یک سیستم انجام می‌دهند، آسان‌تر می‌کند." -msgid "DTrace markers are implementation details of the CPython interpreter. No guarantees are made about probe compatibility between versions of CPython. DTrace scripts can stop working or work incorrectly without warning when changing CPython versions." +msgid "" +"DTrace markers are implementation details of the CPython interpreter. No " +"guarantees are made about probe compatibility between versions of CPython. " +"DTrace scripts can stop working or work incorrectly without warning when " +"changing CPython versions." msgstr "" +"نشانگرهای DTrace جزئیات پیاده‌سازی مفسر CPython هستند. هیچ تضمینی درباره‌ی " +"سازگاری پروب (probe) بین نسخه‌های CPython داده نمی‌شود. اسکریپت‌های DTrace " +"ممکن است هنگام تغییر نسخه‌های CPython بدون هشدار از کار بیفتند یا نادرست کار" +" کنند." msgid "Enabling the static markers" -msgstr "" +msgstr "فعال‌سازی نشانگرهای ایستا" -msgid "macOS comes with built-in support for DTrace. On Linux, in order to build CPython with the embedded markers for SystemTap, the SystemTap development tools must be installed." +msgid "" +"macOS comes with built-in support for DTrace. On Linux, in order to build " +"CPython with the embedded markers for SystemTap, the SystemTap development " +"tools must be installed." msgstr "" +"macOS دارای پشتیبانی توکار از DTrace است. در لینوکس، برای ساخت CPython با " +"نشانگرهای تعبیه‌شده برای SystemTap، باید ابزارهای توسعه SystemTap نصب‌شده " +"باشند." msgid "On a Linux machine, this can be done via::" -msgstr "" +msgstr "در یک ماشین لینوکسی، این کار را می‌توان از این طریق انجام داد::" msgid "$ yum install systemtap-sdt-devel" -msgstr "" +msgstr "$ yum install systemtap-sdt-devel" msgid "or::" -msgstr "" +msgstr "یا::" msgid "$ sudo apt-get install systemtap-sdt-dev" -msgstr "" +msgstr "$ sudo apt-get install systemtap-sdt-dev" -msgid "CPython must then be :option:`configured with the --with-dtrace option <--with-dtrace>`:" +msgid "" +"CPython must then be :option:`configured with the --with-dtrace option " +"<--with-dtrace>`:" msgstr "" +"سپس CPython باید :option:`با گزینه --with-dtrace پیکربندی شود <--with-" +"dtrace>`:" msgid "checking for --with-dtrace... yes" -msgstr "" +msgstr "بررسی برای --with-dtrace... بله" -msgid "On macOS, you can list available DTrace probes by running a Python process in the background and listing all probes made available by the Python provider::" +msgid "" +"On macOS, you can list available DTrace probes by running a Python process " +"in the background and listing all probes made available by the Python " +"provider::" msgstr "" +"در macOS، می‌توانید پروب‌های DTrace در دسترس را با اجرای یک فرایند پایتون در" +" پس‌زمینه و فهرست کردن تمام پروب‌هایی که فراهم‌کننده پایتون در دسترس قرار " +"داده است، فهرست کنید::" msgid "" "$ python3.6 -q &\n" @@ -96,25 +134,51 @@ msgid "" "29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" "29571 python18035 python3.6 maybe_dtrace_line line" msgstr "" +"$ python3.6 -q &\n" +"$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" +"\n" +" ID PROVIDER MODULE FUNCTION NAME\n" +"29564 python18035 python3.6 _PyEval_EvalFrameDefault function-entry\n" +"29565 python18035 python3.6 dtrace_function_entry function-entry\n" +"29566 python18035 python3.6 _PyEval_EvalFrameDefault function-return\n" +"29567 python18035 python3.6 dtrace_function_return function-return\n" +"29568 python18035 python3.6 collect gc-done\n" +"29569 python18035 python3.6 collect gc-start\n" +"29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" +"29571 python18035 python3.6 maybe_dtrace_line line" -msgid "On Linux, you can verify if the SystemTap static markers are present in the built binary by seeing if it contains a \".note.stapsdt\" section." +msgid "" +"On Linux, you can verify if the SystemTap static markers are present in the " +"built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" +"در لینوکس، می‌توانید با بررسی اینکه آیا دودویی ساخته‌شده شامل بخش " +"\".note.stapsdt\" است، وجود نشانگرهای ایستای SystemTap را تأیید کنید." msgid "" "$ readelf -S ./python | grep .note.stapsdt\n" "[30] .note.stapsdt NOTE 0000000000000000 00308d78" msgstr "" +"$ readelf -S ./python | grep .note.stapsdt\n" +"[30] .note.stapsdt NOTE 0000000000000000 00308d78" -msgid "If you've built Python as a shared library (with the :option:`--enable-shared` configure option), you need to look instead within the shared library. For example::" +msgid "" +"If you've built Python as a shared library (with the :option:`--enable-" +"shared` configure option), you need to look instead within the shared " +"library. For example::" msgstr "" +"اگر پایتون را به‌عنوان یک کتابخانه اشتراکی (با گزینه‌ی پیکربندی " +":option:`--enable-shared`) ساخته‌اید، باید به‌جای آن درون کتابخانه اشتراکی " +"را بررسی کنید. برای مثال::" msgid "" "$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" "[29] .note.stapsdt NOTE 0000000000000000 00365b68" msgstr "" +"$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" +"[29] .note.stapsdt NOTE 0000000000000000 00365b68" msgid "Sufficiently modern readelf can print the metadata::" -msgstr "" +msgstr "readelf به‌اندازه کافی جدید می‌تواند فراداده را چاپ کند::" msgid "" "$ readelf -n ./python\n" @@ -152,15 +216,64 @@ msgid "" " Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: 0x00000000008d6bea\n" " Arguments: 8@%rbp 8@%r12 -4@%eax" msgstr "" +"$ readelf -n ./python\n" +"\n" +"Displaying notes found at file offset 0x00000254 with length 0x00000020:\n" +" Owner Data size Description\n" +" GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)\n" +" OS: Linux, ABI: 2.6.32\n" +"\n" +"Displaying notes found at file offset 0x00000274 with length 0x00000024:\n" +" Owner Data size Description\n" +" GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)\n" +" Build ID: df924a2b08a7e89f6e11251d4602022977af2670\n" +"\n" +"Displaying notes found at file offset 0x002d6c30 with length 0x00000144:\n" +" Owner Data size Description\n" +" stapsdt 0x00000031 NT_STAPSDT (SystemTap probe descriptors)\n" +" Provider: python\n" +" Name: gc__start\n" +" Location: 0x00000000004371c3, Base: 0x0000000000630ce2, Semaphore: 0x00000000008d6bf6\n" +" Arguments: -4@%ebx\n" +" stapsdt 0x00000030 NT_STAPSDT (SystemTap probe descriptors)\n" +" Provider: python\n" +" Name: gc__done\n" +" Location: 0x00000000004374e1, Base: 0x0000000000630ce2, Semaphore: 0x00000000008d6bf8\n" +" Arguments: -8@%rax\n" +" stapsdt 0x00000045 NT_STAPSDT (SystemTap probe descriptors)\n" +" Provider: python\n" +" Name: function__entry\n" +" Location: 0x000000000053db6c, Base: 0x0000000000630ce2, Semaphore: 0x00000000008d6be8\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax\n" +" stapsdt 0x00000046 NT_STAPSDT (SystemTap probe descriptors)\n" +" Provider: python\n" +" Name: function__return\n" +" Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: 0x00000000008d6bea\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax" -msgid "The above metadata contains information for SystemTap describing how it can patch strategically placed machine code instructions to enable the tracing hooks used by a SystemTap script." +msgid "" +"The above metadata contains information for SystemTap describing how it can " +"patch strategically placed machine code instructions to enable the tracing " +"hooks used by a SystemTap script." msgstr "" +"فراداده‌ی بالا شامل اطلاعاتی برای SystemTap است که توضیح می‌دهد چگونه " +"می‌تواند دستورالعمل‌های کد ماشین را که به‌طور راهبردی قرار داده شده‌اند وصله" +" کند تا قلاب‌های ردگیری (tracing hooks) مورد استفاده‌ی یک اسکریپت SystemTap " +"فعال شوند." msgid "Static DTrace probes" -msgstr "" +msgstr "پروب‌های ایستای DTrace" -msgid "The following example DTrace script can be used to show the call/return hierarchy of a Python script, only tracing within the invocation of a function called \"start\". In other words, import-time function invocations are not going to be listed:" +msgid "" +"The following example DTrace script can be used to show the call/return " +"hierarchy of a Python script, only tracing within the invocation of a " +"function called \"start\". In other words, import-time function invocations " +"are not going to be listed:" msgstr "" +"می‌توان از اسکریپت نمونه DTrace زیر برای نمایش سلسله‌مراتب فراخوانی/بازگشت " +"یک اسکریپت پایتون استفاده کرد، به‌طوری‌که فقط درون فراخوانی تابعی به نام " +"\"start\" ردگیری انجام می‌شود. به بیان دیگر، فراخوانی‌های تابع در زمان " +"ایمپورت فهرست نخواهند شد:" msgid "" "self int indent;\n" @@ -195,15 +308,46 @@ msgid "" " self->trace = 0;\n" "}" msgstr "" +"self int indent;\n" +"\n" +"python$target:::function-entry\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 1;\n" +"}\n" +"\n" +"python$target:::function-entry\n" +"/self->trace/\n" +"{\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), arg2);\n" +" self->indent++;\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/self->trace/\n" +"{\n" +" self->indent--;\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), arg2);\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 0;\n" +"}" msgid "It can be invoked like this::" -msgstr "" +msgstr "می‌توان آن را به این صورت فراخوانی کرد::" msgid "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" -msgstr "" +msgstr "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" msgid "The output looks like this:" -msgstr "" +msgstr "خروجی به این شکل است:" msgid "" "156641360502280 function-entry:call_stack.py:start:23\n" @@ -225,15 +369,43 @@ msgid "" "156641360732567 function-return: call_stack.py:function_5:21\n" "156641360747370 function-return:call_stack.py:start:28" msgstr "" +"156641360502280 function-entry:call_stack.py:start:23\n" +"156641360518804 function-entry: call_stack.py:function_1:1\n" +"156641360532797 function-entry: call_stack.py:function_3:9\n" +"156641360546807 function-return: call_stack.py:function_3:10\n" +"156641360563367 function-return: call_stack.py:function_1:2\n" +"156641360578365 function-entry: call_stack.py:function_2:5\n" +"156641360591757 function-entry: call_stack.py:function_1:1\n" +"156641360605556 function-entry: call_stack.py:function_3:9\n" +"156641360617482 function-return: call_stack.py:function_3:10\n" +"156641360629814 function-return: call_stack.py:function_1:2\n" +"156641360642285 function-return: call_stack.py:function_2:6\n" +"156641360656770 function-entry: call_stack.py:function_3:9\n" +"156641360669707 function-return: call_stack.py:function_3:10\n" +"156641360687853 function-entry: call_stack.py:function_4:13\n" +"156641360700719 function-return: call_stack.py:function_4:14\n" +"156641360719640 function-entry: call_stack.py:function_5:18\n" +"156641360732567 function-return: call_stack.py:function_5:21\n" +"156641360747370 function-return:call_stack.py:start:28" msgid "Static SystemTap markers" -msgstr "" +msgstr "نشانگرهای ایستای SystemTap" -msgid "The low-level way to use the SystemTap integration is to use the static markers directly. This requires you to explicitly state the binary file containing them." +msgid "" +"The low-level way to use the SystemTap integration is to use the static " +"markers directly. This requires you to explicitly state the binary file " +"containing them." msgstr "" +"روش سطح پایین برای استفاده از یکپارچه‌سازی SystemTap، استفاده مستقیم از " +"نشانگرهای ایستا است. این کار مستلزم آن است که فایل دودویی حاوی آن‌ها را " +"به‌صراحت مشخص کنید." -msgid "For example, this SystemTap script can be used to show the call/return hierarchy of a Python script:" +msgid "" +"For example, this SystemTap script can be used to show the call/return " +"hierarchy of a Python script:" msgstr "" +"برای مثال، می‌توان از این اسکریپت SystemTap برای نمایش سلسله‌مراتب " +"فراخوانی/بازگشت یک اسکریپت پایتون استفاده کرد:" msgid "" "probe process(\"python\").mark(\"function__entry\") {\n" @@ -254,12 +426,32 @@ msgid "" " thread_indent(-1), funcname, filename, lineno);\n" "}" msgstr "" +"probe process(\"python\").mark(\"function__entry\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s => %s in %s:%d\\\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe process(\"python\").mark(\"function__return\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s <= %s in %s:%d\\\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" msgid "" "$ stap \\\n" " show-call-hierarchy.stp \\\n" " -c \"./python test.py\"" msgstr "" +"$ stap \\\n" +" show-call-hierarchy.stp \\\n" +" -c \"./python test.py\"" msgid "" "11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" @@ -269,156 +461,259 @@ msgid "" "11428 python(8274): <= __getitem__ in Lib/os.py:426\n" "11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" msgstr "" +"11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" +"11414 python(8274): => __getitem__ in Lib/os.py:425\n" +"11418 python(8274): => encode in Lib/os.py:490\n" +"11424 python(8274): <= encode in Lib/os.py:493\n" +"11428 python(8274): <= __getitem__ in Lib/os.py:426\n" +"11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" msgid "where the columns are:" -msgstr "" +msgstr "که ستون‌ها عبارت‌اند از:" msgid "time in microseconds since start of script" -msgstr "" +msgstr "زمان بر حسب میکروثانیه از آغاز اسکریپت" msgid "name of executable" -msgstr "" +msgstr "نام فایل اجرایی" msgid "PID of process" -msgstr "" +msgstr "شناسه فرایند (PID)" -msgid "and the remainder indicates the call/return hierarchy as the script executes." +msgid "" +"and the remainder indicates the call/return hierarchy as the script " +"executes." msgstr "" +"و بخش باقی‌مانده سلسله‌مراتب فراخوانی/بازگشت را در حین اجرای اسکریپت نشان " +"می‌دهد." -msgid "For a :option:`--enable-shared` build of CPython, the markers are contained within the libpython shared library, and the probe's dotted path needs to reflect this. For example, this line from the above example:" +msgid "" +"For a :option:`--enable-shared` build of CPython, the markers are contained " +"within the libpython shared library, and the probe's dotted path needs to " +"reflect this. For example, this line from the above example:" msgstr "" +"برای ساخت CPython با :option:`--enable-shared`، نشانگرها درون کتابخانه‌ی " +"اشتراکی libpython قرار دارند و مسیر نقطه‌دار پروب (probe) باید این موضوع را " +"منعکس کند. برای مثال، این خط از مثال بالا:" msgid "probe process(\"python\").mark(\"function__entry\") {" -msgstr "" +msgstr "probe process(\"python\").mark(\"function__entry\") {" msgid "should instead read:" -msgstr "" +msgstr "در عوض باید این‌گونه خوانده شود:" -msgid "probe process(\"python\").library(\"libpython3.6dm.so.1.0\").mark(\"function__entry\") {" +msgid "" +"probe " +"process(\"python\").library(\"libpython3.6dm.so.1.0\").mark(\"function__entry\")" +" {" msgstr "" +"probe " +"process(\"python\").library(\"libpython3.6dm.so.1.0\").mark(\"function__entry\")" +" {" msgid "(assuming a :ref:`debug build ` of CPython 3.6)" -msgstr "" +msgstr "(با فرض :ref:`ساخت اشکال‌زدایی ` از CPython 3.6)" msgid "Available static markers" -msgstr "" +msgstr "نشانگرهای ایستای در دسترس" -msgid "This marker indicates that execution of a Python function has begun. It is only triggered for pure-Python (bytecode) functions." +msgid "" +"This marker indicates that execution of a Python function has begun. It is " +"only triggered for pure-Python (bytecode) functions." msgstr "" +"این نشانگر نشان می‌دهد که اجرای یک تابع پایتون آغاز شده است. این نشانگر فقط " +"برای توابع پایتون خالص (bytecode) فعال می‌شود." -msgid "The filename, function name, and line number are provided back to the tracing script as positional arguments, which must be accessed using ``$arg1``, ``$arg2``, ``$arg3``:" +msgid "" +"The filename, function name, and line number are provided back to the " +"tracing script as positional arguments, which must be accessed using " +"``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" +"نام فایل، نام تابع و شماره خط به اسکریپت ردگیری به‌عنوان آرگومان‌های جایگاهی" +" بازگردانده می‌شوند، که باید با استفاده از ``$arg1``، ``$arg2`` و ``$arg3`` " +"به آن‌ها دسترسی یافت:" -msgid "``$arg1`` : ``(const char *)`` filename, accessible using ``user_string($arg1)``" +msgid "" +"``$arg1`` : ``(const char *)`` filename, accessible using " +"``user_string($arg1)``" msgstr "" +"``$arg1`` : ``(const char *)`` نام فایل، قابل دسترسی با استفاده از " +"``user_string($arg1)``" -msgid "``$arg2`` : ``(const char *)`` function name, accessible using ``user_string($arg2)``" +msgid "" +"``$arg2`` : ``(const char *)`` function name, accessible using " +"``user_string($arg2)``" msgstr "" +"``$arg2`` : ``(const char *)`` نام تابع، قابل دسترسی با " +"``user_string($arg2)``" msgid "``$arg3`` : ``int`` line number" -msgstr "" +msgstr "``$arg3`` : ``int`` شماره‌ی خط" -msgid "This marker is the converse of :c:func:`!function__entry`, and indicates that execution of a Python function has ended (either via ``return``, or via an exception). It is only triggered for pure-Python (bytecode) functions." +msgid "" +"This marker is the converse of :c:func:`!function__entry`, and indicates " +"that execution of a Python function has ended (either via ``return``, or via" +" an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" +"این نشانگر، معکوس :c:func:`!function__entry` است و نشان می‌دهد که اجرای یک " +"تابع پایتون به پایان رسیده است (چه از طریق ``return`` و چه از طریق یک " +"استثنا). این نشانگر فقط برای توابع پایتون خالص (بایت‌کد) فعال می‌شود." msgid "The arguments are the same as for :c:func:`!function__entry`" -msgstr "" +msgstr "آرگومان‌ها همانند :c:func:`!function__entry` هستند" -msgid "This marker indicates a Python line is about to be executed. It is the equivalent of line-by-line tracing with a Python profiler. It is not triggered within C functions." +msgid "" +"This marker indicates a Python line is about to be executed. It is the " +"equivalent of line-by-line tracing with a Python profiler. It is not " +"triggered within C functions." msgstr "" +"این نشانگر نشان می‌دهد که یک خط پایتون در آستانه‌ی اجراست. این معادل ردگیری " +"خط‌به‌خط با یک پروفایلر پایتون (Python profiler) است. این نشانگر درون توابع " +"C فعال نمی‌شود." msgid "The arguments are the same as for :c:func:`!function__entry`." -msgstr "" +msgstr "آرگومان‌ها همان آرگومان‌های :c:func:`!function__entry` هستند." -msgid "Fires when the Python interpreter starts a garbage collection cycle. ``arg0`` is the generation to scan, like :func:`gc.collect`." +msgid "" +"Fires when the Python interpreter starts a garbage collection cycle. " +"``arg0`` is the generation to scan, like :func:`gc.collect`." msgstr "" +"هنگامی که مفسر پایتون یک چرخه‌ی زباله‌روبی را آغاز می‌کند، رخ می‌دهد. " +"``arg0`` نسلی است که باید پویش شود، مانند :func:`gc.collect`." -msgid "Fires when the Python interpreter finishes a garbage collection cycle. ``arg0`` is the number of collected objects." +msgid "" +"Fires when the Python interpreter finishes a garbage collection cycle. " +"``arg0`` is the number of collected objects." msgstr "" +"هنگامی که مفسر پایتون یک چرخه زباله‌روبی را به پایان می‌رساند، راه‌اندازی " +"می‌شود. ``arg0`` تعداد اشیاء جمع‌آوری‌شده است." -msgid "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` is the module name." +msgid "" +"Fires before :mod:`importlib` attempts to find and load the module. ``arg0``" +" is the module name." msgstr "" +"پیش از تلاش :mod:`importlib` برای یافتن و بارگذاری ماژول، شلیک می‌شود. " +"``arg0`` نام ماژول است." -msgid "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is the module name, ``arg1`` indicates if module was successfully loaded." +msgid "" +"Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is" +" the module name, ``arg1`` indicates if module was successfully loaded." msgstr "" +"پس از فراخوانی تابع find_and_load در :mod:`importlib` رخ می‌دهد. ``arg0`` " +"نام ماژول است و ``arg1`` نشان می‌دهد که آیا ماژول با موفقیت بارگذاری شده " +"است." -msgid "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a tuple object." +msgid "" +"Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is" +" the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " +"tuple object." msgstr "" +"هنگامی که :func:`sys.audit` یا :c:func:`PySys_Audit` فراخوانی شود، رخ " +"می‌دهد. ``arg0`` نام رویداد به‌صورت یک رشته C است، و ``arg1`` یک اشاره‌گر " +":c:type:`PyObject` به یک شیء تاپل است." msgid "C Entry Points" -msgstr "" +msgstr "نقاط ورود C" -msgid "To simplify triggering of DTrace markers, Python's C API comes with a number of helper functions that mirror each static marker. On builds of Python without DTrace enabled, these do nothing." +msgid "" +"To simplify triggering of DTrace markers, Python's C API comes with a number" +" of helper functions that mirror each static marker. On builds of Python " +"without DTrace enabled, these do nothing." msgstr "" +"برای ساده‌سازی فعال‌سازی نشانگرهای DTrace، C API پایتون شامل تعدادی تابع " +"کمکی است که با هر نشانگر ایستا متناظر هستند. در ساخت‌های پایتون که DTrace در" +" آن‌ها فعال نیست، این توابع هیچ کاری انجام نمی‌دهند." -msgid "In general, it is not necessary to call these yourself, as Python will do it for you." +msgid "" +"In general, it is not necessary to call these yourself, as Python will do it" +" for you." msgstr "" +"به‌طور کلی، لازم نیست این‌ها را خودتان فراخوانی کنید، زیرا پایتون این کار را" +" برای شما انجام خواهد داد." msgid "C API Function" -msgstr "" +msgstr "تابع API C" msgid "Static Marker" -msgstr "" +msgstr "نشانگر ایستا" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid ":c:func:`!line`" -msgstr "" +msgstr ":c:func:`!line`" msgid ":c:func:`!function__entry`" -msgstr "" +msgstr ":c:func:`!function__entry`" msgid ":c:func:`!function__return`" -msgstr "" +msgstr ":c:func:`!function__return`" msgid ":c:func:`!gc__start`" -msgstr "" +msgstr ":c:func:`!gc__start`" msgid ":c:func:`!gc__done`" -msgstr "" +msgstr ":c:func:`!gc__done`" msgid ":c:func:`!instance__new__start`" -msgstr "" +msgstr ":c:func:`!instance__new__start`" msgid "Not used by Python" -msgstr "" +msgstr "توسط پایتون استفاده نمی‌شود" msgid ":c:func:`!instance__new__done`" -msgstr "" +msgstr ":c:func:`!instance__new__done`" msgid ":c:func:`!instance__delete__start`" -msgstr "" +msgstr ":c:func:`!instance__delete__start`" msgid ":c:func:`!instance__delete__done`" -msgstr "" +msgstr ":c:func:`!instance__delete__done`" msgid ":c:func:`!import__find__load__start`" -msgstr "" +msgstr ":c:func:`!import__find__load__start`" msgid ":c:func:`!import__find__load__done`" -msgstr "" +msgstr ":c:func:`!import__find__load__done`" msgid ":c:func:`!audit`" -msgstr "" +msgstr ":c:func:`!audit`" msgid "C Probing Checks" -msgstr "" +msgstr "بررسی‌های کاوشی C" -msgid "All calls to ``PyDTrace`` functions must be guarded by a call to one of these functions. This allows Python to minimize performance impact when probing is disabled." +msgid "" +"All calls to ``PyDTrace`` functions must be guarded by a call to one of " +"these functions. This allows Python to minimize performance impact when " +"probing is disabled." msgstr "" +"همه فراخوانی‌های توابع ``PyDTrace`` باید با فراخوانی یکی از این توابع محافظت" +" شوند. این امر به پایتون امکان می‌دهد هنگام غیرفعال بودن پایش (probing)، " +"تأثیر بر کارایی را به حداقل برساند." -msgid "On builds without DTrace enabled, these functions do nothing and return ``0``." +msgid "" +"On builds without DTrace enabled, these functions do nothing and return " +"``0``." msgstr "" +"در ساخت‌هایی که DTrace در آن‌ها فعال نیست، این توابع هیچ کاری انجام نمی‌دهند" +" و ``0`` را برمی‌گردانند." msgid "SystemTap Tapsets" -msgstr "" +msgstr "Tapsetهای SystemTap" -msgid "The higher-level way to use the SystemTap integration is to use a \"tapset\": SystemTap's equivalent of a library, which hides some of the lower-level details of the static markers." +msgid "" +"The higher-level way to use the SystemTap integration is to use a " +"\"tapset\": SystemTap's equivalent of a library, which hides some of the " +"lower-level details of the static markers." msgstr "" +"روش سطح بالاتر برای استفاده از یکپارچه‌سازی SystemTap، استفاده از یک " +"«tapset» است: معادل یک کتابخانه در SystemTap، که برخی از جزئیات سطح پایین‌تر" +" نشانگرهای ایستا را می‌پوشاند." msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "" +"در اینجا یک پرونده‌ی tapset، بر پایه‌ی یک ساخت غیراشتراکی از CPython، آمده " +"است:" msgid "" "/*\n" @@ -440,21 +735,63 @@ msgid "" " frameptr = $arg4\n" "}" msgstr "" +"/*\n" +" Provide a higher-level wrapping around the function__entry and\n" +" function__return markers:\n" +" \\*/\n" +"probe python.function.entry = process(\"python\").mark(\"function__entry\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}\n" +"probe python.function.return = process(\"python\").mark(\"function__return\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}" -msgid "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/systemtap/tapset``), then these additional probepoints become available:" +msgid "" +"If this file is installed in SystemTap's tapset directory (e.g. " +"``/usr/share/systemtap/tapset``), then these additional probepoints become " +"available:" msgstr "" +"اگر این فایل در پوشه‌ی tapset متعلق به SystemTap نصب شده باشد (برای مثال " +"``/usr/share/systemtap/tapset``)، آنگاه این نقاط پروب (probepoints) اضافی در" +" دسترس قرار می‌گیرند:" -msgid "This probe point indicates that execution of a Python function has begun. It is only triggered for pure-Python (bytecode) functions." +msgid "" +"This probe point indicates that execution of a Python function has begun. It" +" is only triggered for pure-Python (bytecode) functions." msgstr "" +"این نقطه پروب (probe point) نشان می‌دهد که اجرای یک تابع پایتون آغاز شده " +"است. این فقط برای توابع پایتون خالص (بایت‌کد) فعال می‌شود." -msgid "This probe point is the converse of ``python.function.return``, and indicates that execution of a Python function has ended (either via ``return``, or via an exception). It is only triggered for pure-Python (bytecode) functions." +msgid "" +"This probe point is the converse of ``python.function.return``, and " +"indicates that execution of a Python function has ended (either via " +"``return``, or via an exception). It is only triggered for pure-Python " +"(bytecode) functions." msgstr "" +"این نقطه‌ی پروب (probe point)، نقطه‌ی مقابل ``python.function.return`` است و" +" نشان می‌دهد که اجرای یک تابع پایتون به پایان رسیده است (چه از طریق " +"``return`` و چه از طریق یک استثنا). این نقطه فقط برای توابع پایتون خالص " +"(bytecode) فعال می‌شود." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "This SystemTap script uses the tapset above to more cleanly implement the example given above of tracing the Python function-call hierarchy, without needing to directly name the static markers:" +msgid "" +"This SystemTap script uses the tapset above to more cleanly implement the " +"example given above of tracing the Python function-call hierarchy, without " +"needing to directly name the static markers:" msgstr "" +"این اسکریپت SystemTap از tapset بالا استفاده می‌کند تا مثال ارائه‌شده در " +"بالا برای ردگیری سلسله‌مراتب فراخوانی تابع پایتون را به‌صورت تمیزتری " +"پیاده‌سازی کند، بدون نیاز به نام‌گذاری مستقیم نشانگرهای ایستا:" msgid "" "probe python.function.entry\n" @@ -469,9 +806,26 @@ msgid "" " thread_indent(-1), funcname, filename, lineno);\n" "}" msgstr "" +"probe python.function.entry\n" +"{\n" +" printf(\"%s => %s in %s:%d\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe python.function.return\n" +"{\n" +" printf(\"%s <= %s in %s:%d\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" -msgid "The following script uses the tapset above to provide a top-like view of all running CPython code, showing the top 20 most frequently entered bytecode frames, each second, across the whole system:" +msgid "" +"The following script uses the tapset above to provide a top-like view of all" +" running CPython code, showing the top 20 most frequently entered bytecode " +"frames, each second, across the whole system:" msgstr "" +"اسکریپت زیر از tapset بالا برای ارائه نمایی مشابه top از تمام کدهای CPython " +"در حال اجرا استفاده می‌کند و هر ثانیه، ۲۰ فریم بایت‌کد با بیشترین تعداد ورود" +" در سراسر سیستم را نشان می‌دهد:" msgid "" "global fn_calls;\n" @@ -493,3 +847,21 @@ msgid "" " delete fn_calls;\n" "}" msgstr "" +"global fn_calls;\n" +"\n" +"probe python.function.entry\n" +"{\n" +" fn_calls[pid(), filename, funcname, lineno] += 1;\n" +"}\n" +"\n" +"probe timer.ms(1000) {\n" +" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n" +" printf(\"%6s %80s %6s %30s %6s\\n\",\n" +" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n" +" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n" +" printf(\"%6d %80s %6d %30s %6d\\n\",\n" +" pid, filename, lineno, funcname,\n" +" fn_calls[pid, filename, funcname, lineno]);\n" +" }\n" +" delete fn_calls;\n" +"}" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index c798f6eda..35fd507d8 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -25,46 +25,93 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "An introduction to the ipaddress module" -msgstr "" +msgstr "مقدمه‌ای بر ماژول ipaddress" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "Peter Moody" -msgstr "" +msgstr "پیتر مودی" msgid "Nick Coghlan" -msgstr "" +msgstr "Nick Coghlan" msgid "Overview" -msgstr "" +msgstr "مرور کلی" -msgid "This document aims to provide a gentle introduction to the :mod:`ipaddress` module. It is aimed primarily at users that aren't already familiar with IP networking terminology, but may also be useful to network engineers wanting an overview of how :mod:`ipaddress` represents IP network addressing concepts." +msgid "" +"This document aims to provide a gentle introduction to the :mod:`ipaddress` " +"module. It is aimed primarily at users that aren't already familiar with IP " +"networking terminology, but may also be useful to network engineers wanting " +"an overview of how :mod:`ipaddress` represents IP network addressing " +"concepts." msgstr "" +"هدف این سند ارائه‌ی مقدمه‌ای ملایم برای ماژول :mod:`ipaddress` است. این سند " +"عمدتاً برای کاربرانی در نظر گرفته شده است که از پیش با اصطلاحات شبکه‌سازی IP" +" آشنا نیستند، اما ممکن است برای مهندسان شبکه‌ای که به دنبال مروری بر چگونگی " +"نمایش مفاهیم آدرس‌دهی شبکه‌های IP توسط :mod:`ipaddress` هستند نیز مفید باشد." msgid "Creating Address/Network/Interface objects" -msgstr "" +msgstr "ایجاد اشیاء نشانی/شبکه/رابط" -msgid "Since :mod:`ipaddress` is a module for inspecting and manipulating IP addresses, the first thing you'll want to do is create some objects. You can use :mod:`ipaddress` to create objects from strings and integers." +msgid "" +"Since :mod:`ipaddress` is a module for inspecting and manipulating IP " +"addresses, the first thing you'll want to do is create some objects. You " +"can use :mod:`ipaddress` to create objects from strings and integers." msgstr "" +"از آن‌جا که :mod:`ipaddress` ماژولی برای بررسی و دست‌کاری آدرس‌های IP است، " +"اولین کاری که می‌خواهید انجام دهید ایجاد چند شیء است. می‌توانید از " +":mod:`ipaddress` برای ایجاد شیءها از رشته‌ها و اعداد صحیح استفاده کنید." msgid "A Note on IP Versions" -msgstr "" +msgstr "یادداشتی درباره نسخه‌های IP" -msgid "For readers that aren't particularly familiar with IP addressing, it's important to know that the Internet Protocol (IP) is currently in the process of moving from version 4 of the protocol to version 6. This transition is occurring largely because version 4 of the protocol doesn't provide enough addresses to handle the needs of the whole world, especially given the increasing number of devices with direct connections to the internet." -msgstr "" +msgid "" +"For readers that aren't particularly familiar with IP addressing, it's " +"important to know that the Internet Protocol (IP) is currently in the " +"process of moving from version 4 of the protocol to version 6. This " +"transition is occurring largely because version 4 of the protocol doesn't " +"provide enough addresses to handle the needs of the whole world, especially " +"given the increasing number of devices with direct connections to the " +"internet." +msgstr "" +"برای خوانندگانی که به‌ویژه با آدرس‌دهی IP آشنا نیستند، مهم است بدانند که " +"پروتکل اینترنت (IP) در حال حاضر در حال گذار از نسخه 4 این پروتکل به نسخه 6 " +"است. این گذار عمدتاً به این دلیل رخ می‌دهد که نسخه 4 پروتکل، آدرس‌های کافی " +"برای پاسخ‌گویی به نیازهای کل جهان را فراهم نمی‌کند، به‌ویژه با توجه به " +"افزایش تعداد دستگاه‌هایی که اتصال مستقیم به اینترنت دارند." -msgid "Explaining the details of the differences between the two versions of the protocol is beyond the scope of this introduction, but readers need to at least be aware that these two versions exist, and it will sometimes be necessary to force the use of one version or the other." +msgid "" +"Explaining the details of the differences between the two versions of the " +"protocol is beyond the scope of this introduction, but readers need to at " +"least be aware that these two versions exist, and it will sometimes be " +"necessary to force the use of one version or the other." msgstr "" +"توضیح جزئیات تفاوت‌های میان دو نسخه از پروتکل خارج از دامنه این مقدمه است، " +"اما شما باید دست‌کم از وجود این دو نسخه آگاه باشید، و گاهی لازم است استفاده " +"از یکی از این دو نسخه را تحمیل کنید." msgid "IP Host Addresses" -msgstr "" +msgstr "آدرس‌های میزبان IP" -msgid "Addresses, often referred to as \"host addresses\" are the most basic unit when working with IP addressing. The simplest way to create addresses is to use the :func:`ipaddress.ip_address` factory function, which automatically determines whether to create an IPv4 or IPv6 address based on the passed in value:" +msgid "" +"Addresses, often referred to as \"host addresses\" are the most basic unit " +"when working with IP addressing. The simplest way to create addresses is to " +"use the :func:`ipaddress.ip_address` factory function, which automatically " +"determines whether to create an IPv4 or IPv6 address based on the passed in " +"value:" msgstr "" +"نشانی‌ها، که اغلب با عنوان «نشانی‌های میزبان» شناخته می‌شوند، پایه‌ای‌ترین " +"واحد هنگام کار با نشانی‌دهی IP هستند. ساده‌ترین راه برای ایجاد نشانی‌ها، " +"استفاده از تابع کارخانه‌ایٔ :func:`ipaddress.ip_address` است، که به‌طور خودکار " +"بر اساس مقدار ورودی تعیین می‌کند که یک نشانی IPv4 ایجاد شود یا IPv6:" -msgid "Addresses can also be created directly from integers. Values that will fit within 32 bits are assumed to be IPv4 addresses::" +msgid "" +"Addresses can also be created directly from integers. Values that will fit " +"within 32 bits are assumed to be IPv4 addresses::" msgstr "" +"نشانی‌ها همچنین می‌توانند مستقیماً از اعداد صحیح ساخته شوند. مقادیری که در " +"۳۲ بیت جای می‌گیرند، نشانی‌های IPv4 فرض می‌شوند::" msgid "" ">>> ipaddress.ip_address(3221225985)\n" @@ -72,9 +119,19 @@ msgid "" ">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" "IPv6Address('2001:db8::1')" msgstr "" +">>> ipaddress.ip_address(3221225985)\n" +"IPv4Address('192.0.2.1')\n" +">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" +"IPv6Address('2001:db8::1')" -msgid "To force the use of IPv4 or IPv6 addresses, the relevant classes can be invoked directly. This is particularly useful to force creation of IPv6 addresses for small integers::" +msgid "" +"To force the use of IPv4 or IPv6 addresses, the relevant classes can be " +"invoked directly. This is particularly useful to force creation of IPv6 " +"addresses for small integers::" msgstr "" +"برای وادار کردن به استفاده از نشانی‌های IPv4 یا IPv6، می‌توان کلاس‌های " +"مربوطه را مستقیماً فراخوانی کرد. این کار به‌ویژه برای وادار کردن به ایجاد " +"نشانی‌های IPv6 برای اعداد صحیح کوچک مفید است::" msgid "" ">>> ipaddress.ip_address(1)\n" @@ -84,15 +141,41 @@ msgid "" ">>> ipaddress.IPv6Address(1)\n" "IPv6Address('::1')" msgstr "" +">>> ipaddress.ip_address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv4Address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv6Address(1)\n" +"IPv6Address('::1')" msgid "Defining Networks" -msgstr "" +msgstr "تعریف شبکه‌ها" -msgid "Host addresses are usually grouped together into IP networks, so :mod:`ipaddress` provides a way to create, inspect and manipulate network definitions. IP network objects are constructed from strings that define the range of host addresses that are part of that network. The simplest form for that information is a \"network address/network prefix\" pair, where the prefix defines the number of leading bits that are compared to determine whether or not an address is part of the network and the network address defines the expected value of those bits." -msgstr "" +msgid "" +"Host addresses are usually grouped together into IP networks, so " +":mod:`ipaddress` provides a way to create, inspect and manipulate network " +"definitions. IP network objects are constructed from strings that define the" +" range of host addresses that are part of that network. The simplest form " +"for that information is a \"network address/network prefix\" pair, where the" +" prefix defines the number of leading bits that are compared to determine " +"whether or not an address is part of the network and the network address " +"defines the expected value of those bits." +msgstr "" +"نشانی‌های میزبان معمولاً با یکدیگر در شبکه‌های IP گروه‌بندی می‌شوند، " +"بنابراین :mod:`ipaddress` راهی برای ایجاد، بررسی و دستکاری تعریف‌های شبکه " +"فراهم می‌کند. اشیاء شبکه‌ی IP از رشته‌هایی ساخته می‌شوند که بازه‌ی نشانی‌های" +" میزبانی که بخشی از آن شبکه هستند را تعریف می‌کنند. ساده‌ترین شکل برای این " +"اطلاعات، یک جفت «نشانی شبکه/پیشوند شبکه» است، که در آن پیشوند تعداد بیت‌های " +"پیشرویی را تعریف می‌کند که برای تعیین اینکه آیا یک نشانی بخشی از شبکه است یا" +" خیر مقایسه می‌شوند و نشانی شبکه مقدار مورد انتظار آن بیت‌ها را تعریف " +"می‌کند." -msgid "As for addresses, a factory function is provided that determines the correct IP version automatically::" +msgid "" +"As for addresses, a factory function is provided that determines the correct" +" IP version automatically::" msgstr "" +"در مورد آدرس‌ها، یک تابع کارخانه‌ای ارائه شده است که نسخه صحیح IP را به‌طور " +"خودکار تعیین می‌کند::" msgid "" ">>> ipaddress.ip_network('192.0.2.0/24')\n" @@ -100,12 +183,33 @@ msgid "" ">>> ipaddress.ip_network('2001:db8::0/96')\n" "IPv6Network('2001:db8::/96')" msgstr "" +">>> ipaddress.ip_network('192.0.2.0/24')\n" +"IPv4Network('192.0.2.0/24')\n" +">>> ipaddress.ip_network('2001:db8::0/96')\n" +"IPv6Network('2001:db8::/96')" -msgid "Network objects cannot have any host bits set. The practical effect of this is that ``192.0.2.1/24`` does not describe a network. Such definitions are referred to as interface objects since the ip-on-a-network notation is commonly used to describe network interfaces of a computer on a given network and are described further in the next section." -msgstr "" +msgid "" +"Network objects cannot have any host bits set. The practical effect of this" +" is that ``192.0.2.1/24`` does not describe a network. Such definitions are" +" referred to as interface objects since the ip-on-a-network notation is " +"commonly used to describe network interfaces of a computer on a given " +"network and are described further in the next section." +msgstr "" +"اشیاء شبکه نمی‌توانند هیچ بیت میزبان تنظیم‌شده‌ای داشته باشند. اثر عملی این " +"موضوع آن است که ``192.0.2.1/24`` یک شبکه را توصیف نمی‌کند. چنین تعاریفی " +"به‌عنوان اشیاء رابط شناخته می‌شوند، زیرا نمادگذاری آی‌پی روی شبکه (ip-on-" +"a-network) معمولاً برای توصیف رابط‌های شبکه‌ی یک کامپیوتر در یک شبکه‌ی مشخص " +"به کار می‌رود و در بخش بعدی بیشتر توضیح داده شده‌اند." -msgid "By default, attempting to create a network object with host bits set will result in :exc:`ValueError` being raised. To request that the additional bits instead be coerced to zero, the flag ``strict=False`` can be passed to the constructor::" +msgid "" +"By default, attempting to create a network object with host bits set will " +"result in :exc:`ValueError` being raised. To request that the additional " +"bits instead be coerced to zero, the flag ``strict=False`` can be passed to " +"the constructor::" msgstr "" +"به‌طور پیش‌فرض، تلاش برای ایجاد یک شیء شبکه با بیت‌های میزبانِ تنظیم‌شده، " +"باعث پرتاب :exc:`ValueError` می‌شود. برای درخواست اینکه بیت‌های اضافی درعوض " +"به صفر تبدیل شوند، می‌توان پرچم ``strict=False`` را به سازنده ارسال کرد::" msgid "" ">>> ipaddress.ip_network('192.0.2.1/24')\n" @@ -115,9 +219,23 @@ msgid "" ">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" "IPv4Network('192.0.2.0/24')" msgstr "" +">>> ipaddress.ip_network('192.0.2.1/24')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: 192.0.2.1/24 has host bits set\n" +">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" +"IPv4Network('192.0.2.0/24')" -msgid "While the string form offers significantly more flexibility, networks can also be defined with integers, just like host addresses. In this case, the network is considered to contain only the single address identified by the integer, so the network prefix includes the entire network address::" +msgid "" +"While the string form offers significantly more flexibility, networks can " +"also be defined with integers, just like host addresses. In this case, the " +"network is considered to contain only the single address identified by the " +"integer, so the network prefix includes the entire network address::" msgstr "" +"اگرچه شکل رشته‌ای انعطاف‌پذیری بسیار بیشتری فراهم می‌کند، شبکه‌ها را می‌توان" +" درست مانند آدرس‌های میزبان، با اعداد صحیح نیز تعریف کرد. در این حالت، شبکه " +"تنها شامل آدرس شناسایی‌شده توسط آن عدد صحیح در نظر گرفته می‌شود، بنابراین " +"پیشوند شبکه، کل آدرس شبکه را شامل می‌شود::" msgid "" ">>> ipaddress.ip_network(3221225984)\n" @@ -125,27 +243,65 @@ msgid "" ">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" "IPv6Network('2001:db8::/128')" msgstr "" +">>> ipaddress.ip_network(3221225984)\n" +"IPv4Network('192.0.2.0/32')\n" +">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" +"IPv6Network('2001:db8::/128')" -msgid "As with addresses, creation of a particular kind of network can be forced by calling the class constructor directly instead of using the factory function." +msgid "" +"As with addresses, creation of a particular kind of network can be forced by" +" calling the class constructor directly instead of using the factory " +"function." msgstr "" +"همانند آدرس‌ها، می‌توان با فراخوانی مستقیم سازنده‌ی کلاس به‌جای استفاده از " +"تابع کارخانه (factory function)، ایجاد یک نوع خاص از شبکه را اجباری کرد." msgid "Host Interfaces" -msgstr "" +msgstr "رابط‌های میزبان" -msgid "As mentioned just above, if you need to describe an address on a particular network, neither the address nor the network classes are sufficient. Notation like ``192.0.2.1/24`` is commonly used by network engineers and the people who write tools for firewalls and routers as shorthand for \"the host ``192.0.2.1`` on the network ``192.0.2.0/24``\", Accordingly, :mod:`ipaddress` provides a set of hybrid classes that associate an address with a particular network. The interface for creation is identical to that for defining network objects, except that the address portion isn't constrained to being a network address." -msgstr "" +msgid "" +"As mentioned just above, if you need to describe an address on a particular " +"network, neither the address nor the network classes are sufficient. " +"Notation like ``192.0.2.1/24`` is commonly used by network engineers and the" +" people who write tools for firewalls and routers as shorthand for \"the " +"host ``192.0.2.1`` on the network ``192.0.2.0/24``\", Accordingly, " +":mod:`ipaddress` provides a set of hybrid classes that associate an address " +"with a particular network. The interface for creation is identical to that " +"for defining network objects, except that the address portion isn't " +"constrained to being a network address." +msgstr "" +"همان‌طور که درست در بالا اشاره شد، اگر نیاز دارید نشانی‌ای در یک شبکه خاص را" +" توصیف کنید، نه کلاس‌های نشانی و نه کلاس‌های شبکه کافی نیستند. مهندسان شبکه " +"و افرادی که ابزارهایی برای فایروال‌ها و مسیریاب‌ها می‌نویسند، معمولاً از " +"نمادگذاری مانند ``192.0.2.1/24`` به‌عنوان خلاصه‌ای برای «میزبان " +"``192.0.2.1`` در شبکه ``192.0.2.0/24``» استفاده می‌کنند. بر همین اساس، " +":mod:`ipaddress` مجموعه‌ای از کلاس‌های ترکیبی را فراهم می‌کند که یک نشانی را" +" با یک شبکه خاص مرتبط می‌کنند. رابط ایجاد آن‌ها کاملاً مشابه رابط تعریف " +"اشیاء شبکه است، با این تفاوت که بخش نشانی محدود به نشانی شبکه نیست." -msgid "Integer inputs are accepted (as with networks), and use of a particular IP version can be forced by calling the relevant constructor directly." +msgid "" +"Integer inputs are accepted (as with networks), and use of a particular IP " +"version can be forced by calling the relevant constructor directly." msgstr "" +"ورودی‌های عدد صحیح پذیرفته می‌شوند (همان‌طور که در شبکه‌ها نیز چنین است)، و " +"می‌توان با فراخوانی مستقیم سازنده مربوطه، استفاده از نسخه خاصی از IP را " +"الزامی کرد." msgid "Inspecting Address/Network/Interface Objects" -msgstr "" +msgstr "بررسی اشیاء آدرس/شبکه/رابط" -msgid "You've gone to the trouble of creating an IPv(4|6)(Address|Network|Interface) object, so you probably want to get information about it. :mod:`ipaddress` tries to make doing this easy and intuitive." +msgid "" +"You've gone to the trouble of creating an " +"IPv(4|6)(Address|Network|Interface) object, so you probably want to get " +"information about it. :mod:`ipaddress` tries to make doing this easy and " +"intuitive." msgstr "" +"شما زحمت ایجاد یک شیء IPv(4|6)(Address|Network|Interface) را به خود " +"داده‌اید، بنابراین احتمالاً می‌خواهید اطلاعاتی درباره‌ی آن کسب کنید. " +":mod:`ipaddress` تلاش می‌کند انجام این کار را آسان و شهودی کند." msgid "Extracting the IP version::" -msgstr "" +msgstr "استخراج نسخه IP::" msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" @@ -155,9 +311,15 @@ msgid "" ">>> addr4.version\n" "4" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" +">>> addr6.version\n" +"6\n" +">>> addr4.version\n" +"4" msgid "Obtaining the network from an interface::" -msgstr "" +msgstr "به دست آوردن شبکه از یک رابط::" msgid "" ">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" @@ -167,9 +329,15 @@ msgid "" ">>> host6.network\n" "IPv6Network('2001:db8::/96')" msgstr "" +">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" +">>> host4.network\n" +"IPv4Network('192.0.2.0/24')\n" +">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n" +">>> host6.network\n" +"IPv6Network('2001:db8::/96')" msgid "Finding out how many individual addresses are in a network::" -msgstr "" +msgstr "یافتن تعداد آدرس‌های منفرد موجود در یک شبکه::" msgid "" ">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" @@ -179,9 +347,15 @@ msgid "" ">>> net6.num_addresses\n" "4294967296" msgstr "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> net4.num_addresses\n" +"256\n" +">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n" +">>> net6.num_addresses\n" +"4294967296" msgid "Iterating through the \"usable\" addresses on a network::" -msgstr "" +msgstr "پیمایش آدرس‌های «قابل‌استفاده» در یک شبکه::" msgid "" ">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" @@ -196,12 +370,27 @@ msgid "" "192.0.2.253\n" "192.0.2.254" msgstr "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> for x in net4.hosts():\n" +"... print(x)\n" +"192.0.2.1\n" +"192.0.2.2\n" +"192.0.2.3\n" +"192.0.2.4\n" +"...\n" +"192.0.2.252\n" +"192.0.2.253\n" +"192.0.2.254" -msgid "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or the hostmask (any bits that are not part of the netmask):" +msgid "" +"Obtaining the netmask (i.e. set bits corresponding to the network prefix) or" +" the hostmask (any bits that are not part of the netmask):" msgstr "" +"به‌دست آوردن netmask (یعنی بیت‌های تنظیم‌شده متناظر با پیشوند شبکه) یا " +"hostmask (هر بیتی که بخشی از netmask نیست):" msgid "Exploding or compressing the address::" -msgstr "" +msgstr "بسط یا فشرده‌سازی نشانی::" msgid "" ">>> addr6.exploded\n" @@ -213,15 +402,35 @@ msgid "" ">>> net6.compressed\n" "'2001:db8::/96'" msgstr "" +">>> addr6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0001'\n" +">>> addr6.compressed\n" +"'2001:db8::1'\n" +">>> net6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n" +">>> net6.compressed\n" +"'2001:db8::/96'" -msgid "While IPv4 doesn't support explosion or compression, the associated objects still provide the relevant properties so that version neutral code can easily ensure the most concise or most verbose form is used for IPv6 addresses while still correctly handling IPv4 addresses." +msgid "" +"While IPv4 doesn't support explosion or compression, the associated objects " +"still provide the relevant properties so that version neutral code can " +"easily ensure the most concise or most verbose form is used for IPv6 " +"addresses while still correctly handling IPv4 addresses." msgstr "" +"اگرچه IPv4 از بسط (explosion) یا فشرده‌سازی پشتیبانی نمی‌کند، اشیاء مرتبط " +"همچنان ویژگی‌های مربوطه را فراهم می‌کنند تا کد مستقل از نسخه بتواند به‌راحتی" +" اطمینان حاصل کند که مختصرترین یا مفصل‌ترین فرم برای آدرس‌های IPv6 استفاده " +"می‌شود و در عین حال آدرس‌های IPv4 به‌درستی مدیریت می‌شوند." msgid "Networks as lists of Addresses" -msgstr "" +msgstr "شبکه‌ها به‌عنوان فهرست‌هایی از نشانی‌ها" -msgid "It's sometimes useful to treat networks as lists. This means it is possible to index them like this::" +msgid "" +"It's sometimes useful to treat networks as lists. This means it is possible" +" to index them like this::" msgstr "" +"گاهی مفید است که با شبکه‌ها مانند فهرست‌ها رفتار کنید. این بدان معناست که " +"می‌توانید آن‌ها را به این شکل اندیس‌گذاری کنید::" msgid "" ">>> net4[1]\n" @@ -233,17 +442,33 @@ msgid "" ">>> net6[-1]\n" "IPv6Address('2001:db8::ffff:ffff')" msgstr "" +">>> net4[1]\n" +"IPv4Address('192.0.2.1')\n" +">>> net4[-1]\n" +"IPv4Address('192.0.2.255')\n" +">>> net6[1]\n" +"IPv6Address('2001:db8::1')\n" +">>> net6[-1]\n" +"IPv6Address('2001:db8::ffff:ffff')" -msgid "It also means that network objects lend themselves to using the list membership test syntax like this::" +msgid "" +"It also means that network objects lend themselves to using the list " +"membership test syntax like this::" msgstr "" +"این همچنین به این معناست که اشیاء شبکه‌ای را می‌توان با سینتکس آزمون عضویت " +"در فهرست به این صورت استفاده کرد::" msgid "" "if address in network:\n" " # do something" msgstr "" +"if address in network:\n" +" # do something" msgid "Containment testing is done efficiently based on the network prefix::" msgstr "" +"آزمون دربرگیری (containment testing) به‌صورت کارآمد بر اساس پیشوند شبکه " +"انجام می‌شود::" msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" @@ -252,26 +477,47 @@ msgid "" ">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" "False" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" +"True\n" +">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" +"False" msgid "Comparisons" -msgstr "" +msgstr "مقایسه‌ها" -msgid ":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare objects, where it makes sense::" +msgid "" +":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare " +"objects, where it makes sense::" msgstr "" +":mod:`ipaddress` روش‌های ساده‌ای ارائه می‌دهد که امید است شهودی باشند، برای " +"مقایسه‌ی اشیاء در مواردی که منطقی باشد::" msgid "" ">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" "True" msgstr "" +">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" +"True" -msgid "A :exc:`TypeError` exception is raised if you try to compare objects of different versions or different types." +msgid "" +"A :exc:`TypeError` exception is raised if you try to compare objects of " +"different versions or different types." msgstr "" +"اگر سعی کنید اشیایی با نسخه‌ها یا انواع مختلف را مقایسه کنید، استثنای " +":exc:`TypeError` پرتاب می‌شود." msgid "Using IP Addresses with other modules" -msgstr "" +msgstr "استفاده از آدرس‌های IP با سایر ماژول‌ها" -msgid "Other modules that use IP addresses (such as :mod:`socket`) usually won't accept objects from this module directly. Instead, they must be coerced to an integer or string that the other module will accept::" +msgid "" +"Other modules that use IP addresses (such as :mod:`socket`) usually won't " +"accept objects from this module directly. Instead, they must be coerced to " +"an integer or string that the other module will accept::" msgstr "" +"ماژول‌های دیگری که از آدرس‌های IP استفاده می‌کنند (مانند :mod:`socket`) " +"معمولاً اشیاء این ماژول را مستقیماً نمی‌پذیرند. در عوض، باید به یک عدد صحیح " +"یا رشته‌ای تبدیل شوند که ماژول دیگر بپذیرد::" msgid "" ">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" @@ -280,18 +526,47 @@ msgid "" ">>> int(addr4)\n" "3221225985" msgstr "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> str(addr4)\n" +"'192.0.2.1'\n" +">>> int(addr4)\n" +"3221225985" msgid "Getting more detail when instance creation fails" -msgstr "" +msgstr "دریافت جزئیات بیشتر در صورت شکست در ایجاد نمونه" -msgid "When creating address/network/interface objects using the version-agnostic factory functions, any errors will be reported as :exc:`ValueError` with a generic error message that simply says the passed in value was not recognized as an object of that type. The lack of a specific error is because it's necessary to know whether the value is *supposed* to be IPv4 or IPv6 in order to provide more detail on why it has been rejected." -msgstr "" +msgid "" +"When creating address/network/interface objects using the version-agnostic " +"factory functions, any errors will be reported as :exc:`ValueError` with a " +"generic error message that simply says the passed in value was not " +"recognized as an object of that type. The lack of a specific error is " +"because it's necessary to know whether the value is *supposed* to be IPv4 or" +" IPv6 in order to provide more detail on why it has been rejected." +msgstr "" +"هنگام ایجاد اشیای نشانی/شبکه/رابط با استفاده از توابع کارخانه‌ای مستقل از " +"نسخه، هر خطایی به‌صورت :exc:`ValueError` با پیام خطای عام گزارش می‌شود که " +"صرفاً می‌گوید مقدار داده‌شده به‌عنوان شیئی از آن نوع شناسایی نشد. دلیل نبود " +"خطای مشخص این است که برای ارائه جزئیات بیشتر درباره‌ی علت رد شدن مقدار، لازم " +"است بدانیم که آیا مقدار *باید* IPv4 باشد یا IPv6." -msgid "To support use cases where it is useful to have access to this additional detail, the individual class constructors actually raise the :exc:`ValueError` subclasses :exc:`ipaddress.AddressValueError` and :exc:`ipaddress.NetmaskValueError` to indicate exactly which part of the definition failed to parse correctly." +msgid "" +"To support use cases where it is useful to have access to this additional " +"detail, the individual class constructors actually raise the " +":exc:`ValueError` subclasses :exc:`ipaddress.AddressValueError` and " +":exc:`ipaddress.NetmaskValueError` to indicate exactly which part of the " +"definition failed to parse correctly." msgstr "" +"برای پشتیبانی از موارد استفاده‌ای که دسترسی به این جزئیات اضافی در آن‌ها " +"مفید است، سازنده‌های هر کلاس در واقع استثناهای زیرکلاس :exc:`ValueError`، " +"یعنی :exc:`ipaddress.AddressValueError` و :exc:`ipaddress.NetmaskValueError`" +" را پرتاب می‌کنند تا دقیقاً مشخص کنند کدام بخش از تعریف به‌درستی تجزیه نشد." -msgid "The error messages are significantly more detailed when using the class constructors directly. For example::" +msgid "" +"The error messages are significantly more detailed when using the class " +"constructors directly. For example::" msgstr "" +"پیام‌های خطا هنگامی که مستقیماً از سازنده‌های کلاس استفاده می‌کنید، به‌طور " +"قابل‌توجهی جزئی‌تر هستند. برای مثال::" msgid "" ">>> ipaddress.ip_address(\"192.168.0.256\")\n" @@ -312,9 +587,32 @@ msgid "" " ...\n" "ipaddress.NetmaskValueError: '64' is not a valid netmask" msgstr "" +">>> ipaddress.ip_address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n" +">>> ipaddress.IPv4Address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in '192.168.0.256'\n" +"\n" +">>> ipaddress.ip_network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n" +">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.NetmaskValueError: '64' is not a valid netmask" -msgid "However, both of the module specific exceptions have :exc:`ValueError` as their parent class, so if you're not concerned with the particular type of error, you can still write code like the following::" +msgid "" +"However, both of the module specific exceptions have :exc:`ValueError` as " +"their parent class, so if you're not concerned with the particular type of " +"error, you can still write code like the following::" msgstr "" +"با این حال، کلاس والد هر دو استثنای مختص ماژول، :exc:`ValueError` است، " +"بنابراین اگر نگران نوع خاصی از خطا نیستید، همچنان می‌توانید کدی مانند زیر " +"بنویسید::" msgid "" "try:\n" @@ -322,3 +620,7 @@ msgid "" "except ValueError:\n" " print('address/netmask is invalid for IPv4:', address)" msgstr "" +"try:\n" +" network = ipaddress.IPv4Network(address)\n" +"except ValueError:\n" +" print('address/netmask is invalid for IPv4:', address)" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 328ff8620..ec8f86b8a 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -25,64 +25,168 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Isolating Extension Modules" -msgstr "" +msgstr "جداسازی ماژول‌های توسعه" msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "Traditionally, state belonging to Python extension modules was kept in C ``static`` variables, which have process-wide scope. This document describes problems of such per-process state and shows a safer way: per-module state." +msgid "" +"Traditionally, state belonging to Python extension modules was kept in C " +"``static`` variables, which have process-wide scope. This document describes" +" problems of such per-process state and shows a safer way: per-module state." msgstr "" +"به‌طور سنتی، وضعیت متعلق به ماژول‌های افزونه‌ای پایتون در متغیرهای " +"``static`` زبان C نگهداری می‌شد که محدوده‌ای در سطح کل فرایند دارند. این سند" +" مشکلات چنین وضعیت به‌ازای هر فرایند را توضیح می‌دهد و روش امن‌تری را نشان " +"می‌دهد: وضعیت به‌ازای هر ماژول." -msgid "The document also describes how to switch to per-module state where possible. This transition involves allocating space for that state, potentially switching from static types to heap types, and—perhaps most importantly—accessing per-module state from code." +msgid "" +"The document also describes how to switch to per-module state where " +"possible. This transition involves allocating space for that state, " +"potentially switching from static types to heap types, and—perhaps most " +"importantly—accessing per-module state from code." msgstr "" +"این سند همچنین نحوه‌ی تغییر به وضعیت به‌ازای هر ماژول را در صورت امکان توصیف " +"می‌کند. این گذار شامل تخصیص فضا برای آن وضعیت، احتمالاً تغییر از انواع ایستا" +" به انواع heap، و—شاید مهم‌تر از همه—دسترسی به وضعیت به‌ازای هر ماژول از کد " +"است." msgid "Who should read this" -msgstr "" +msgstr "چه کسانی باید این را بخوانند" -msgid "This guide is written for maintainers of :ref:`C-API ` extensions who would like to make that extension safer to use in applications where Python itself is used as a library." +msgid "" +"This guide is written for maintainers of :ref:`C-API ` " +"extensions who would like to make that extension safer to use in " +"applications where Python itself is used as a library." msgstr "" +"این راهنما برای نگهدارندگان افزونه‌های :ref:`C-API ` نوشته شده " +"است که می‌خواهند استفاده از آن افزونه را در برنامه‌هایی که خود پایتون " +"به‌عنوان کتابخانه استفاده می‌شود، ایمن‌تر کنند." msgid "Background" -msgstr "" +msgstr "پیش‌زمینه" -msgid "An *interpreter* is the context in which Python code runs. It contains configuration (e.g. the import path) and runtime state (e.g. the set of imported modules)." +msgid "" +"An *interpreter* is the context in which Python code runs. It contains " +"configuration (e.g. the import path) and runtime state (e.g. the set of " +"imported modules)." msgstr "" +"یک *مفسر* زمینه‌ای است که کد پایتون در آن اجرا می‌شود. این شامل پیکربندی " +"(برای مثال مسیر ایمپورت) و وضعیت ران‌تایم (برای مثال مجموعه ماژول‌های " +"ایمپورت‌شده) است." -msgid "Python supports running multiple interpreters in one process. There are two cases to think about—users may run interpreters:" +msgid "" +"Python supports running multiple interpreters in one process. There are two " +"cases to think about—users may run interpreters:" msgstr "" +"پایتون از اجرای چندین مفسر در یک فرایند پشتیبانی می‌کند. دو حالت برای در نظر" +" گرفتن وجود دارد—ممکن است کاربران مفسرها را اجرا کنند:" -msgid "in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` cycles, and" +msgid "" +"in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " +"cycles, and" msgstr "" +"به‌صورت متوالی، با چندین چرخه‌ی " +":c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx`، و" -msgid "in parallel, managing \"sub-interpreters\" using :c:func:`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." +msgid "" +"in parallel, managing \"sub-interpreters\" using " +":c:func:`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." msgstr "" +"به‌صورت موازی، مدیریت «زیرمفسرها» با استفاده از " +":c:func:`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." -msgid "Both cases (and combinations of them) would be most useful when embedding Python within a library. Libraries generally shouldn't make assumptions about the application that uses them, which include assuming a process-wide \"main Python interpreter\"." +msgid "" +"Both cases (and combinations of them) would be most useful when embedding " +"Python within a library. Libraries generally shouldn't make assumptions " +"about the application that uses them, which include assuming a process-wide " +"\"main Python interpreter\"." msgstr "" +"هر دو حالت (و ترکیب‌های آن‌ها) بیشترین کاربرد را هنگام جاسازی پایتون در یک " +"کتابخانه خواهند داشت. کتابخانه‌ها عموماً نباید درباره‌ی برنامه‌ای که از " +"آن‌ها استفاده می‌کند فرض‌هایی داشته باشند؛ از جمله فرض وجود یک «مفسر اصلی " +"پایتون» در سطح کل فرایند." -msgid "Historically, Python extension modules don't handle this use case well. Many extension modules (and even some stdlib modules) use *per-process* global state, because C ``static`` variables are extremely easy to use. Thus, data that should be specific to an interpreter ends up being shared between interpreters. Unless the extension developer is careful, it is very easy to introduce edge cases that lead to crashes when a module is loaded in more than one interpreter in the same process." -msgstr "" +msgid "" +"Historically, Python extension modules don't handle this use case well. Many" +" extension modules (and even some stdlib modules) use *per-process* global " +"state, because C ``static`` variables are extremely easy to use. Thus, data " +"that should be specific to an interpreter ends up being shared between " +"interpreters. Unless the extension developer is careful, it is very easy to " +"introduce edge cases that lead to crashes when a module is loaded in more " +"than one interpreter in the same process." +msgstr "" +"از نظر تاریخی، ماژول‌های توسعه پایتون این مورد استفاده را به‌خوبی مدیریت " +"نمی‌کنند. بسیاری از ماژول‌های توسعه (و حتی برخی ماژول‌های stdlib) از وضعیت " +"سراسری *به‌ازای هر فرایند* استفاده می‌کنند، زیرا استفاده از متغیرهای " +"``static`` در C بسیار آسان است. در نتیجه، داده‌هایی که باید مختص به یک مفسر " +"باشند، در نهایت بین مفسرها مشترک می‌شوند. مگر اینکه توسعه‌دهنده ماژول توسعه " +"محتاط باشد، ایجاد حالت‌های مرزی که منجر به ازکارافتادگی می‌شوند، هنگامی که " +"یک ماژول در بیش از یک مفسر در همان فرایند بارگذاری می‌شود، بسیار آسان است." -msgid "Unfortunately, *per-interpreter* state is not easy to achieve. Extension authors tend to not keep multiple interpreters in mind when developing, and it is currently cumbersome to test the behavior." +msgid "" +"Unfortunately, *per-interpreter* state is not easy to achieve. Extension " +"authors tend to not keep multiple interpreters in mind when developing, and " +"it is currently cumbersome to test the behavior." msgstr "" +"متأسفانه، وضعیت *به‌ازای هر مفسر* به‌آسانی قابل دستیابی نیست. نویسندگان " +"افزونه‌ها معمولاً هنگام توسعه، چندین مفسر را در نظر نمی‌گیرند و آزمایش این " +"رفتار در حال حاضر دشوار است." msgid "Enter Per-Module State" -msgstr "" +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 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 "" +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 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 "" +"به جای تمرکز بر وضعیت به‌ازای هر مفسر، C API پایتون در حال تکامل است تا از " +"وضعیت ریزدانه‌ترِ *به‌ازای هر ماژول* بهتر پشتیبانی کند. این بدان معناست که " +"داده‌های سطح C باید به یک *شیء ماژول* متصل شوند. هر مفسر شیء ماژول خود را " +"ایجاد می‌کند و داده‌ها را جدا نگه می‌دارد. برای آزمایش جداسازی، حتی می‌توان " +"چندین شیء ماژول متناظر با یک افزونه را در یک مفسر واحد بارگذاری کرد." -msgid "Per-module state provides an easy way to think about lifetime and resource ownership: the extension module will initialize when a module object is created, and clean up when it's freed. In this regard, a module is just like any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" hooks to think—or forget—about." -msgstr "" +msgid "" +"Per-module state provides an easy way to think about lifetime and resource " +"ownership: the extension module will initialize when a module object is " +"created, and clean up when it's freed. In this regard, a module is just like" +" any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" " +"hooks to think—or forget—about." +msgstr "" +"وضعیت به‌ازای هر ماژول، راه ساده‌ای برای فکر کردن درباره طول عمر و مالکیت " +"منابع فراهم می‌کند: ماژول الحاقی در زمان ایجاد یک شیء ماژول، مقداردهی اولیه " +"می‌شود و در زمان آزاد شدن، پاک‌سازی می‌شود. از این نظر، یک ماژول دقیقاً " +"مانند هر :c:expr:`PyObject *` دیگری است؛ هیچ قلابیبرای «خاموش شدن " +"مفسر» وجود ندارد که بخواهید درباره آن فکر کنید—یا آن را فراموش کنید." -msgid "Note that there are use cases for different kinds of \"globals\": per-process, per-interpreter, per-thread or per-task state. With per-module state as the default, these are still possible, but you should treat them as exceptional cases: if you need them, you should give them additional care and testing. (Note that this guide does not cover them.)" -msgstr "" +msgid "" +"Note that there are use cases for different kinds of \"globals\": per-" +"process, per-interpreter, per-thread or per-task state. With per-module " +"state as the default, these are still possible, but you should treat them as" +" exceptional cases: if you need them, you should give them additional care " +"and testing. (Note that this guide does not cover them.)" +msgstr "" +"توجه داشته باشید که برای انواع مختلف «سراسری‌ها» موارد استفاده وجود دارد: " +"وضعیت به‌ازای هر فرایند، به‌ازای هر مفسر، به‌ازای هر نخ یا به‌ازای هر وظیفه " +". با وضعیت به‌ازای هر ماژول به‌عنوان پیش‌فرض، این موارد همچنان " +"امکان‌پذیر هستند، اما باید با آن‌ها به‌عنوان موارد استثنایی رفتار کنید: اگر " +"به آن‌ها نیاز دارید، باید مراقبت و آزمون بیشتری برای آن‌ها در نظر بگیرید. " +"(توجه داشته باشید که این راهنما آن‌ها را پوشش نمی‌دهد.)" msgid "Isolated Module Objects" -msgstr "" +msgstr "اشیای ماژول جداشده" -msgid "The key point to keep in mind when developing an extension module is that several module objects can be created from a single shared library. For example:" +msgid "" +"The key point to keep in mind when developing an extension module is that " +"several module objects can be created from a single shared library. For " +"example:" msgstr "" +"نکته کلیدی که باید هنگام توسعه‌ی یک ماژول توسعه در نظر داشته باشید این است که" +" می‌توان چندین شیء ماژول را از یک کتابخانه مشترک واحد ایجاد کرد. برای مثال:" msgid "" ">>> import sys\n" @@ -93,18 +197,55 @@ msgid "" ">>> old_binascii == binascii\n" "False" msgstr "" +">>> import sys\n" +">>> import binascii\n" +">>> old_binascii = binascii\n" +">>> del sys.modules['binascii']\n" +">>> import binascii # create a new module object\n" +">>> old_binascii == binascii\n" +"False" -msgid "As a rule of thumb, the two modules should be completely independent. All objects and state specific to the module should be encapsulated within the module object, not shared with other module objects, and cleaned up when the module object is deallocated. Since this just is a rule of thumb, exceptions are possible (see `Managing Global State`_), but they will need more thought and attention to edge cases." -msgstr "" +msgid "" +"As a rule of thumb, the two modules should be completely independent. All " +"objects and state specific to the module should be encapsulated within the " +"module object, not shared with other module objects, and cleaned up when the" +" module object is deallocated. Since this just is a rule of thumb, " +"exceptions are possible (see `Managing Global State`_), but they will need " +"more thought and attention to edge cases." +msgstr "" +"به‌عنوان یک قاعده سرانگشتی، این دو ماژول باید کاملاً مستقل باشند. تمام اشیاء" +" و وضعیت خاص ماژول باید درون شیء ماژول کپسوله شوند، با دیگر اشیاء ماژول " +"به‌اشتراک گذاشته نشوند و هنگام آزادسازی شیء ماژول پاک‌سازی شوند. از آنجا که " +"این صرفاً یک قاعده سرانگشتی است، ممکن است استثناهایی وجود داشته باشد (به " +"`Managing Global State`_ مراجعه کنید)، اما آن‌ها به تفکر و توجه بیشتری نسبت " +"به حالت‌های مرزی نیاز دارند." -msgid "While some modules could do with less stringent restrictions, isolated modules make it easier to set clear expectations and guidelines that work across a variety of use cases." +msgid "" +"While some modules could do with less stringent restrictions, isolated " +"modules make it easier to set clear expectations and guidelines that work " +"across a variety of use cases." msgstr "" +"در حالی که برخی ماژول‌ها ممکن است با محدودیت‌های کمتر سخت‌گیرانه نیز کار " +"کنند، ماژول‌های ایزوله تعیین انتظارات و دستورالعمل‌های مشخصی را که در طیف " +"متنوعی از موارد استفاده کاربرد دارند، آسان‌تر می‌کنند." msgid "Surprising Edge Cases" -msgstr "" +msgstr "حالت‌های مرزی غافلگیرکننده" -msgid "Note that isolated modules do create some surprising edge cases. Most notably, each module object will typically not share its classes and exceptions with other similar modules. Continuing from the `example above `__, note that ``old_binascii.Error`` and ``binascii.Error`` are separate objects. In the following code, the exception is *not* caught:" -msgstr "" +msgid "" +"Note that isolated modules do create some surprising edge cases. Most " +"notably, each module object will typically not share its classes and " +"exceptions with other similar modules. Continuing from the `example above " +"`__, note that ``old_binascii.Error`` and " +"``binascii.Error`` are separate objects. In the following code, the " +"exception is *not* caught:" +msgstr "" +"توجه داشته باشید که ماژول‌های ایزوله برخی حالت‌های مرزی غافلگیرکننده ایجاد " +"می‌کنند. به‌ویژه، هر شیء ماژول به‌طور معمول کلاس‌ها و استثناهای خود را با " +"سایر ماژول‌های مشابه به اشتراک نمی‌گذارد. در ادامه‌ی `مثال بالا `__، توجه داشته باشید که ``old_binascii.Error`` و " +"``binascii.Error`` اشیاء جداگانه‌ای هستند. در کد زیر، استثنا گرفته " +"*نمی‌شود*:" msgid "" ">>> old_binascii.Error == binascii.Error\n" @@ -118,60 +259,163 @@ msgid "" " File \"\", line 2, in \n" "binascii.Error: Non-hexadecimal digit found" msgstr "" +">>> old_binascii.Error == binascii.Error\n" +"False\n" +">>> try:\n" +"... old_binascii.unhexlify(b'qwertyuiop')\n" +"... except binascii.Error:\n" +"... print('boo')\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +"binascii.Error: Non-hexadecimal digit found" -msgid "This is expected. Notice that pure-Python modules behave the same way: it is a part of how Python works." +msgid "" +"This is expected. Notice that pure-Python modules behave the same way: it is" +" a part of how Python works." msgstr "" +"این مورد انتظار است. توجه داشته باشید که ماژول‌های پایتون خالص نیز به همین " +"شکل رفتار می‌کنند: این بخشی از نحوه‌ی کار پایتون است." -msgid "The goal is to make extension modules safe at the C level, not to make hacks behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." +msgid "" +"The goal is to make extension modules safe at the C level, not to make hacks" +" behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." msgstr "" +"هدف این است که ماژول‌های توسعه در سطح C امن باشند، نه اینکه هک‌ها رفتاری " +"شهودی داشته باشند. تغییر ``sys.modules`` به‌صورت «دستی» یک هک محسوب می‌شود." msgid "Making Modules Safe with Multiple Interpreters" -msgstr "" +msgstr "ایمن‌سازی ماژول‌ها با چند مفسر" msgid "Managing Global State" -msgstr "" +msgstr "مدیریت وضعیت سراسری" -msgid "Sometimes, the state associated with a Python module is not specific to that module, but to the entire process (or something else \"more global\" than a module). For example:" +msgid "" +"Sometimes, the state associated with a Python module is not specific to that" +" module, but to the entire process (or something else \"more global\" than a" +" module). For example:" msgstr "" +"گاهی اوقات، وضعیت مرتبط با یک ماژول پایتون مختص به آن ماژول نیست، بلکه به کل" +" فرایند (یا چیزی «سراسری‌تر» از یک ماژول) مربوط می‌شود. برای مثال:" msgid "The ``readline`` module manages *the* terminal." -msgstr "" +msgstr "ماژول ``readline`` *پایانه* را مدیریت می‌کند." -msgid "A module running on a circuit board wants to control *the* on-board LED." +msgid "" +"A module running on a circuit board wants to control *the* on-board LED." msgstr "" +"ماژولی که روی یک برد مدار اجرا می‌شود، می‌خواهد *همان* LED روی برد را کنترل " +"کند." -msgid "In these cases, the Python module should provide *access* to the global state, rather than *own* it. If possible, write the module so that multiple copies of it can access the state independently (along with other libraries, whether for Python or other languages). If that is not possible, consider explicit locking." -msgstr "" +msgid "" +"In these cases, the Python module should provide *access* to the global " +"state, rather than *own* it. If possible, write the module so that multiple " +"copies of it can access the state independently (along with other libraries," +" whether for Python or other languages). If that is not possible, consider " +"explicit locking." +msgstr "" +"در این موارد، ماژول پایتون باید به‌جای *مالکیت* وضعیت سراسری، *دسترسی* به آن" +" را فراهم کند. در صورت امکان، ماژول را به‌گونه‌ای بنویسید که چندین نسخه از " +"آن بتوانند مستقل از یکدیگر به وضعیت دسترسی داشته باشند (در کنار سایر " +"کتابخانه‌ها، چه برای پایتون و چه برای زبان‌های دیگر). اگر این ممکن نیست، قفل" +" صریح را در نظر بگیرید." -msgid "If it is necessary to use process-global state, the simplest way to avoid issues with multiple interpreters is to explicitly prevent a module from being loaded more than once per process—see :ref:`isolating-extensions-optout`." +msgid "" +"If it is necessary to use process-global state, the simplest way to avoid " +"issues with multiple interpreters is to explicitly prevent a module from " +"being loaded more than once per process—see :ref:`isolating-extensions-" +"optout`." msgstr "" +"اگر استفاده از وضعیت سراسری در سطح فرایند ضروری است، ساده‌ترین راه برای " +"اجتناب از مشکلات مربوط به چندین مفسر، جلوگیری صریح از بارگذاری یک ماژول بیش " +"از یک بار در هر فرایند است—:ref:`isolating-extensions-optout` را ببینید." msgid "Managing Per-Module State" -msgstr "" +msgstr "مدیریت وضعیت هر ماژول" -msgid "To use per-module state, use :ref:`multi-phase extension module initialization `. This signals that your module supports multiple interpreters correctly." +msgid "" +"To use per-module state, use :ref:`multi-phase extension module " +"initialization `. This signals that your module " +"supports multiple interpreters correctly." msgstr "" +"برای استفاده از وضعیت به‌ازای هر ماژول، از :ref:`multi-phase extension " +"module initialization ` استفاده کنید. این نشان " +"می‌دهد که ماژول شما به‌درستی از چندین مفسر پشتیبانی می‌کند." -msgid "Set ``PyModuleDef.m_size`` to a positive number to request that many bytes of storage local to the module. Usually, this will be set to the size of some module-specific ``struct``, which can store all of the module's C-level state. In particular, it is where you should put pointers to classes (including exceptions, but excluding static types) and settings (e.g. ``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to function." -msgstr "" +msgid "" +"Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " +"of storage local to the module. Usually, this will be set to the size of " +"some module-specific ``struct``, which can store all of the module's C-level" +" state. In particular, it is where you should put pointers to classes " +"(including exceptions, but excluding static types) and settings (e.g. " +"``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to " +"function." +msgstr "" +"``PyModuleDef.m_size`` را روی یک عدد مثبت تنظیم کنید تا آن تعداد بایت حافظه‌ی" +" محلی ماژول درخواست شود. معمولاً، این مقدار روی اندازه‌ی یک ``struct`` " +"اختصاصی برای ماژول تنظیم می‌شود که می‌تواند تمام وضعیت ماژول در سطح C را " +"ذخیره کند. به‌طور خاص، این جایی است که باید اشاره‌گرهایی به کلاس‌ها (شامل " +"استثناها، اما به‌جز انواع ایستا) و تنظیماتی (مانند " +":py:data:`~csv.field_size_limit` در ``csv``) را قرار دهید که کد C برای کار " +"کردن به آن‌ها نیاز دارد." -msgid "Another option is to store state in the module's ``__dict__``, but you must avoid crashing when users modify ``__dict__`` from Python code. This usually means error- and type-checking at the C level, which is easy to get wrong and hard to test sufficiently." +msgid "" +"Another option is to store state in the module's ``__dict__``, but you must " +"avoid crashing when users modify ``__dict__`` from Python code. This usually" +" means error- and type-checking at the C level, which is easy to get wrong " +"and hard to test sufficiently." msgstr "" +"گزینه دیگر این است که وضعیت را در ``__dict__`` ماژول ذخیره کنید، اما باید " +"هنگامی که کاربران ``__dict__`` را از کد پایتون تغییر می‌دهند، از فروپاشی جلوگیری" +" کنید. این معمولاً به معنای بررسی خطاها و نوع‌ها در سطح C است، که پیاده‌سازی" +" نادرست آن آسان و آزمایش کافی آن دشوار است." -msgid "However, if module state is not needed in C code, storing it in ``__dict__`` only is a good idea." +msgid "" +"However, if module state is not needed in C code, storing it in ``__dict__``" +" only is a good idea." msgstr "" +"با این حال، اگر وضعیت ماژول در کد C مورد نیاز نیست، ذخیره آن فقط در " +"``__dict__`` ایده خوبی است." -msgid "If the module state includes ``PyObject`` pointers, the module object must hold references to those objects and implement the module-level hooks ``m_traverse``, ``m_clear`` and ``m_free``. These work like ``tp_traverse``, ``tp_clear`` and ``tp_free`` of a class. Adding them will require some work and make the code longer; this is the price for modules which can be unloaded cleanly." -msgstr "" +msgid "" +"If the module state includes ``PyObject`` pointers, the module object must " +"hold references to those objects and implement the module-level hooks " +"``m_traverse``, ``m_clear`` and ``m_free``. These work like ``tp_traverse``," +" ``tp_clear`` and ``tp_free`` of a class. Adding them will require some work" +" and make the code longer; this is the price for modules which can be " +"unloaded cleanly." +msgstr "" +"اگر وضعیت ماژول شامل اشاره‌گرهای ``PyObject`` باشد، شیء ماژول باید ارجاع‌ها " +"به آن اشیاء را حفظ کند و قلاب‌های سطح ماژول ``m_traverse``، ``m_clear`` و " +"``m_free`` را پیاده‌سازی کند. این‌ها مانند ``tp_traverse``، ``tp_clear`` و " +"``tp_free`` در یک کلاس کار می‌کنند. افزودن آن‌ها نیازمند کمی کار است و کد را" +" طولانی‌تر می‌کند؛ این بهای ماژول‌هایی است که می‌توانند به‌تمیزی باربرداری " +"شوند." -msgid "An example of a module with per-module state is currently available as `xxlimited `__; example module initialization shown at the bottom of the file." +msgid "" +"An example of a module with per-module state is currently available as " +"`xxlimited " +"`__; " +"example module initialization shown at the bottom of the file." msgstr "" +"نمونه‌ای از یک ماژول با وضعیت به‌ازای هر ماژول، در حال حاضر به‌عنوان " +"`xxlimited " +"`__ در " +"دسترس است؛ مقداردهی اولیه ماژول نمونه در پایان پرونده نشان داده شده است." msgid "Opt-Out: Limiting to One Module Object per Process" -msgstr "" +msgstr "انصراف: محدود کردن به یک شیء ماژول در هر فرایند" -msgid "A non-negative ``PyModuleDef.m_size`` signals that a module supports multiple interpreters correctly. If this is not yet the case for your module, you can explicitly make your module loadable only once per process. For example::" +msgid "" +"A non-negative ``PyModuleDef.m_size`` signals that a module supports " +"multiple interpreters correctly. If this is not yet the case for your " +"module, you can explicitly make your module loadable only once per process. " +"For example::" msgstr "" +"مقدار غیرمنفی ``PyModuleDef.m_size`` نشان می‌دهد که ماژول به‌درستی از چند " +"مفسر پشتیبانی می‌کند. اگر این وضعیت هنوز برای ماژول شما برقرار نیست، " +"می‌توانید به‌صراحت ماژول خود را فقط یک‌بار در هر فرایند قابل بارگذاری کنید. " +"برای مثال::" msgid "" "// A process-wide flag\n" @@ -195,15 +439,51 @@ msgid "" " // ... rest of initialization\n" "}" msgstr "" +"// A process-wide flag\n" +"static int loaded = 0;\n" +"\n" +"// Mutex to provide thread safety (only needed for free-threaded Python)\n" +"static PyMutex modinit_mutex = {0};\n" +"\n" +"static int\n" +"exec_module(PyObject* module)\n" +"{\n" +" PyMutex_Lock(&modinit_mutex);\n" +" if (loaded) {\n" +" PyMutex_Unlock(&modinit_mutex);\n" +" PyErr_SetString(PyExc_ImportError,\n" +" \"cannot load module more than once per process\");\n" +" return -1;\n" +" }\n" +" loaded = 1;\n" +" PyMutex_Unlock(&modinit_mutex);\n" +" // ... rest of initialization\n" +"}" -msgid "If your module's :c:member:`PyModuleDef.m_clear` function is able to prepare for future re-initialization, it should clear the ``loaded`` flag. In this case, your module won't support multiple instances existing *concurrently*, but it will, for example, support being loaded after Python runtime shutdown (:c:func:`Py_FinalizeEx`) and re-initialization (:c:func:`Py_Initialize`)." -msgstr "" +msgid "" +"If your module's :c:member:`PyModuleDef.m_clear` function is able to prepare" +" for future re-initialization, it should clear the ``loaded`` flag. In this " +"case, your module won't support multiple instances existing *concurrently*, " +"but it will, for example, support being loaded after Python runtime shutdown" +" (:c:func:`Py_FinalizeEx`) and re-initialization (:c:func:`Py_Initialize`)." +msgstr "" +"اگر تابع :c:member:`PyModuleDef.m_clear` ماژول شما قادر است برای مقداردهی " +"اولیه مجدد در آینده آماده شود، باید پرچم ``loaded`` را پاک کند. در این صورت،" +" ماژول شما از وجود *همزمان* چندین نمونه پشتیبانی نخواهد کرد، اما برای مثال،" +" از بارگذاری شدن پس از خاموش شدن ران‌تایم پایتون (:c:func:`Py_FinalizeEx`) و" +" مقداردهی اولیه مجدد (:c:func:`Py_Initialize`) پشتیبانی خواهد کرد." msgid "Module State Access from Functions" -msgstr "" +msgstr "دسترسی به وضعیت ماژول از توابع" -msgid "Accessing the state from module-level functions is straightforward. Functions get the module object as their first argument; for extracting the state, you can use ``PyModule_GetState``::" +msgid "" +"Accessing the state from module-level functions is straightforward. " +"Functions get the module object as their first argument; for extracting the " +"state, you can use ``PyModule_GetState``::" msgstr "" +"دسترسی به وضعیت از توابع سطح ماژول ساده است. توابع شیء ماژول را به‌عنوان " +"نخستین آرگومان خود دریافت می‌کنند؛ برای استخراج وضعیت، می‌توانید از " +"``PyModule_GetState`` استفاده کنید::" msgid "" "static PyObject *\n" @@ -216,81 +496,211 @@ msgid "" " // ... rest of logic\n" "}" msgstr "" +"static PyObject *\n" +"func(PyObject *module, PyObject *args)\n" +"{\n" +" my_struct *state = (my_struct*)PyModule_GetState(module);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" // ... rest of logic\n" +"}" -msgid "``PyModule_GetState`` may return ``NULL`` without setting an exception if there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own module, you're in control of ``m_size``, so this is easy to prevent." +msgid "" +"``PyModule_GetState`` may return ``NULL`` without setting an exception if " +"there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " +"module, you're in control of ``m_size``, so this is easy to prevent." msgstr "" +"``PyModule_GetState`` ممکن است در صورتی که وضعیت ماژول وجود نداشته باشد، " +"یعنی ``PyModuleDef.m_size`` صفر بوده است، ``NULL`` را بدون اینکه استثنایی " +"تنظیم کند برگرداند. در ماژول خودتان، شما بر ``m_size`` کنترل دارید، بنابراین" +" جلوگیری از این موضوع آسان است." msgid "Heap Types" -msgstr "" +msgstr "انواع Heap" -msgid "Traditionally, types defined in C code are *static*; that is, ``static PyTypeObject`` structures defined directly in code and initialized using ``PyType_Ready()``." +msgid "" +"Traditionally, types defined in C code are *static*; that is, ``static " +"PyTypeObject`` structures defined directly in code and initialized using " +"``PyType_Ready()``." msgstr "" +"به‌طور سنتی، نوع‌های تعریف‌شده در کد C *ایستا* هستند؛ یعنی ساختارهای " +"``static PyTypeObject`` که مستقیماً در کد تعریف شده‌اند و با استفاده از " +"``PyType_Ready()`` مقداردهی اولیه می‌شوند." -msgid "Such types are necessarily shared across the process. Sharing them between module objects requires paying attention to any state they own or access. To limit the possible issues, static types are immutable at the Python level: for example, you can't set ``str.myattribute = 123``." +msgid "" +"Such types are necessarily shared across the process. Sharing them between " +"module objects requires paying attention to any state they own or access. To" +" limit the possible issues, static types are immutable at the Python level: " +"for example, you can't set ``str.myattribute = 123``." msgstr "" +"چنین نوع‌هایی لزوماً در سراسر فرایند به‌اشتراک گذاشته می‌شوند. به‌اشتراک " +"گذاشتن آن‌ها بین اشیای ماژول نیازمند توجه به هر وضعیتی است که مالک آن هستند " +"یا به آن دسترسی دارند. برای محدود کردن مسائل احتمالی، نوع‌های ایستا در سطح " +"پایتون تغییرناپذیر هستند: برای مثال، نمی‌توانید ``str.myattribute = 123`` را" +" انتساب دهید." -msgid "Sharing truly immutable objects between interpreters is fine, as long as they don't provide access to mutable objects. However, in CPython, every Python object has a mutable implementation detail: the reference count. Changes to the refcount are guarded by the GIL. Thus, code that shares any Python objects across interpreters implicitly depends on CPython's current, process-wide GIL." -msgstr "" +msgid "" +"Sharing truly immutable objects between interpreters is fine, as long as " +"they don't provide access to mutable objects. However, in CPython, every " +"Python object has a mutable implementation detail: the reference count. " +"Changes to the refcount are guarded by the GIL. Thus, code that shares any " +"Python objects across interpreters implicitly depends on CPython's current, " +"process-wide GIL." +msgstr "" +"اشتراک‌گذاری اشیاء واقعاً تغییرناپذیر میان مفسرها مشکلی ندارد، تا زمانی که " +"آن‌ها دسترسی به اشیاء تغییرپذیر فراهم نکنند. با این حال، در CPython، هر شیء " +"پایتون یک جزئیات پیاده‌سازی تغییرپذیر دارد: شمار ارجاع. تغییرات شمار ارجاع " +"توسط GIL محافظت می‌شود. بنابراین، کدی که هر شیء پایتون را میان مفسرها به " +"اشتراک می‌گذارد، به‌طور ضمنی به GIL فعلی CPython در سطح فرآیند وابسته است." -msgid "Because they are immutable and process-global, static types cannot access \"their\" module state. If any method of such a type requires access to module state, the type must be converted to a *heap-allocated type*, or *heap type* for short. These correspond more closely to classes created by Python's ``class`` statement." -msgstr "" +msgid "" +"Because they are immutable and process-global, static types cannot access " +"\"their\" module state. If any method of such a type requires access to " +"module state, the type must be converted to a *heap-allocated type*, or " +"*heap type* for short. These correspond more closely to classes created by " +"Python's ``class`` statement." +msgstr "" +"از آن‌جا که انواع ایستا تغییرناپذیر و سراسری در سطح فرایند هستند، امکان " +"دسترسی به وضعیت ماژول «خود» را ندارند. اگر هر متدی از چنین نوعی نیازمند " +"دسترسی به وضعیت ماژول باشد، آن نوع باید به یک *نوع تخصیص‌یافته در heap* " +"(heap-allocated type)، یا به‌اختصار *نوع heap* (heap type) تبدیل شود. این " +"موارد بیشتر با کلاس‌های ایجادشده با دستور ``class`` پایتون مطابقت دارند." msgid "For new modules, using heap types by default is a good rule of thumb." msgstr "" +"برای ماژول‌های جدید، استفاده از انواع heap (heap types) به‌صورت پیش‌فرض، " +"قاعده سرانگشتی خوبی است." msgid "Changing Static Types to Heap Types" -msgstr "" +msgstr "تغییر نوع‌های ایستا به نوع‌های Heap" -msgid "Static types can be converted to heap types, but note that the heap type API was not designed for \"lossless\" conversion from static types—that is, creating a type that works exactly like a given static type. So, when rewriting the class definition in a new API, you are likely to unintentionally change a few details (e.g. pickleability or inherited slots). Always test the details that are important to you." -msgstr "" +msgid "" +"Static types can be converted to heap types, but note that the heap type API" +" was not designed for \"lossless\" conversion from static types—that is, " +"creating a type that works exactly like a given static type. So, when " +"rewriting the class definition in a new API, you are likely to " +"unintentionally change a few details (e.g. pickleability or inherited " +"slots). Always test the details that are important to you." +msgstr "" +"می‌توان انواع ایستا را به انواع heap (heap types) تبدیل کرد، اما توجه داشته " +"باشید که API نوع heap برای تبدیل «بدون اتلاف» انواع ایستا طراحی نشده " +"است—یعنی ایجاد نوعی که دقیقاً مانند یک نوع ایستای مشخص رفتار کند. بنابراین، " +"هنگام بازنویسی تعریف کلاس در یک API جدید، احتمال دارد به‌طور ناخواسته چند " +"جزئیات را تغییر دهید (مثلاً قابلیت pickle یا جایگاه‌های ارثی). همیشه جزئیاتی " +"را که برای شما مهم هستند آزمایش کنید." -msgid "Watch out for the following two points in particular (but note that this is not a comprehensive list):" +msgid "" +"Watch out for the following two points in particular (but note that this is " +"not a comprehensive list):" msgstr "" +"به‌ویژه به دو نکته‌ی زیر توجه داشته باشید (اما توجه داشته باشید که این یک " +"فهرست جامع نیست):" -msgid "Unlike static types, heap type objects are mutable by default. Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." +msgid "" +"Unlike static types, heap type objects are mutable by default. Use the " +":c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" +"برخلاف انواع ایستا، اشیای نوع heap به‌طور پیش‌فرض تغییرپذیر هستند. برای " +"جلوگیری از تغییرپذیری، از پرچم :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` استفاده " +"کنید." -msgid "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may become possible to instantiate them from Python code. You can prevent this with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." +msgid "" +"Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " +"become possible to instantiate them from Python code. You can prevent this " +"with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" +"انواع Heap به‌طور پیش‌فرض :c:member:`~PyTypeObject.tp_new` را به ارث " +"می‌برند، بنابراین ممکن است امکان نمونه‌سازی آن‌ها از کد پایتون فراهم شود. " +"می‌توانید با پرچم :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` از این موضوع " +"جلوگیری کنید." msgid "Defining Heap Types" -msgstr "" +msgstr "تعریف انواع هیپ " -msgid "Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a description or \"blueprint\" of a class, and calling :c:func:`PyType_FromModuleAndSpec` to construct a new class object." +msgid "" +"Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " +"description or \"blueprint\" of a class, and calling " +":c:func:`PyType_FromModuleAndSpec` to construct a new class object." msgstr "" +"انواع Heap را می‌توان با پر کردن یک ساختار :c:struct:`PyType_Spec`، یک توصیف" +" یا «نقشه» از یک کلاس، و فراخوانی :c:func:`PyType_FromModuleAndSpec` برای " +"ساخت یک شیء کلاس جدید ایجاد کرد." -msgid "Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, allowing access to the module state from methods." +msgid "" +"Other functions, like :c:func:`PyType_FromSpec`, can also create heap types," +" but :c:func:`PyType_FromModuleAndSpec` associates the module with the " +"class, allowing access to the module state from methods." msgstr "" +"توابع دیگر، مانند :c:func:`PyType_FromSpec`، نیز می‌توانند نوع‌های heap " +"(heap types) را ایجاد کنند، اما :c:func:`PyType_FromModuleAndSpec` ماژول را " +"به کلاس مرتبط می‌کند و امکان دسترسی به وضعیت ماژول را از طریق متدها فراهم " +"می‌کند." -msgid "The class should generally be stored in *both* the module state (for safe access from C) and the module's ``__dict__`` (for access from Python code)." +msgid "" +"The class should generally be stored in *both* the module state (for safe " +"access from C) and the module's ``__dict__`` (for access from Python code)." msgstr "" +"این کلاس عموماً باید در *هر دو* وضعیت ماژول (برای دسترسی ایمن از C) و " +"``__dict__`` ماژول (برای دسترسی از کد پایتون) ذخیره شود." msgid "Garbage-Collection Protocol" -msgstr "" +msgstr "پروتکل زباله‌روبی" -msgid "Instances of heap types hold a reference to their type. This ensures that the type isn't destroyed before all its instances are, but may result in reference cycles that need to be broken by the garbage collector." +msgid "" +"Instances of heap types hold a reference to their type. This ensures that " +"the type isn't destroyed before all its instances are, but may result in " +"reference cycles that need to be broken by the garbage collector." msgstr "" +"نمونه‌های انواع heap، ارجاعی به نوع خود نگه می‌دارند. این امر تضمین می‌کند " +"که نوع پیش از آنکه همه‌ی نمونه‌هایش نابود شوند، از بین نرود، اما ممکن است به " +"چرخه‌های ارجاعی منجر شود که باید توسط زباله‌رو شکسته شوند." -msgid "To avoid memory leaks, instances of heap types must implement the garbage collection protocol. That is, heap types should:" +msgid "" +"To avoid memory leaks, instances of heap types must implement the garbage " +"collection protocol. That is, heap types should:" msgstr "" +"برای جلوگیری از نشت حافظه، نمونه‌های انواع heap (heap types) باید پروتکل " +"زباله‌روبی را پیاده‌سازی کنند. یعنی، انواع heap باید:" msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" +msgstr "پرچم :c:macro:`Py_TPFLAGS_HAVE_GC` را داشته باشد." -msgid "Define a traverse function using :c:data:`Py_tp_traverse`, which visits the type (e.g. using ``Py_VISIT(Py_TYPE(self))``)." +msgid "" +"Define a traverse function using :c:data:`Py_tp_traverse`, which visits the " +"type (e.g. using ``Py_VISIT(Py_TYPE(self))``)." msgstr "" +"یک تابع پیمایش (traverse) با استفاده از :c:data:`Py_tp_traverse` تعریف کنید،" +" که از نوع بازدید می‌کند (برای مثال با استفاده از " +"``Py_VISIT(Py_TYPE(self))``)." -msgid "Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for additional considerations." +msgid "" +"Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and " +":c:member:`~PyTypeObject.tp_traverse` for additional considerations." msgstr "" +"برای ملاحظات بیشتر، لطفاً به مستندات :c:macro:`Py_TPFLAGS_HAVE_GC` و " +":c:member:`~PyTypeObject.tp_traverse` مراجعه کنید." -msgid "The API for defining heap types grew organically, leaving it somewhat awkward to use in its current state. The following sections will guide you through common issues." +msgid "" +"The API for defining heap types grew organically, leaving it somewhat " +"awkward to use in its current state. The following sections will guide you " +"through common issues." msgstr "" +"API برای تعریف انواع heap به‌صورت طبیعی رشد کرده است، به‌طوری که استفاده از " +"آن در وضعیت کنونی تا حدی دشوار است. بخش‌های زیر شما را درباره‌ی مشکلات رایج " +"راهنمایی می‌کنند." msgid "``tp_traverse`` in Python 3.8 and lower" -msgstr "" +msgstr "``tp_traverse`` در پایتون 3.8 و پایین‌تر" -msgid "The requirement to visit the type from ``tp_traverse`` was added in Python 3.9. If you support Python 3.8 and lower, the traverse function must *not* visit the type, so it must be more complicated::" +msgid "" +"The requirement to visit the type from ``tp_traverse`` was added in Python " +"3.9. If you support Python 3.8 and lower, the traverse function must *not* " +"visit the type, so it must be more complicated::" msgstr "" +"الزام به بازدید از نوع از ``tp_traverse`` در Python 3.9 افزوده شد. اگر از " +"Python 3.8 و پایین‌تر پشتیبانی می‌کنید، تابع پیمایش *نباید* از نوع بازدید " +"کند، بنابراین باید پیچیده‌تر باشد::" msgid "" "static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" @@ -301,30 +711,57 @@ msgid "" " return 0;\n" "}" msgstr "" +"static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" +"{\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +" return 0;\n" +"}" -msgid "Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a replacement, use:" +msgid "" +"Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " +"replacement, use:" msgstr "" +"متأسفانه، :c:data:`Py_Version` تنها در پایتون 3.11 اضافه شده است. به‌عنوان " +"جایگزین، از این استفاده کنید:" msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" msgstr "" +":c:macro:`PY_VERSION_HEX`، در صورت عدم استفاده از ABI پایدار (stable ABI)، " +"یا" -msgid ":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:`PyArg_ParseTuple`)." +msgid "" +":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and " +":c:func:`PyArg_ParseTuple`)." msgstr "" +":py:data:`sys.version_info` (از طریق :c:func:`PySys_GetObject` و " +":c:func:`PyArg_ParseTuple`)." msgid "Delegating ``tp_traverse``" -msgstr "" +msgstr "واگذاری ``tp_traverse``" -msgid "If your traverse function delegates to the :c:member:`~PyTypeObject.tp_traverse` of its base class (or another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that only heap type are expected to visit the type in ``tp_traverse``." +msgid "" +"If your traverse function delegates to the " +":c:member:`~PyTypeObject.tp_traverse` of its base class (or another type), " +"ensure that ``Py_TYPE(self)`` is visited only once. Note that only heap type" +" are expected to visit the type in ``tp_traverse``." msgstr "" +"اگر تابع پیمایش (traverse) شما به :c:member:`~PyTypeObject.tp_traverse` کلاس" +" پایه خود (یا نوع دیگری) واگذار می‌کند، اطمینان حاصل کنید که " +"``Py_TYPE(self)`` تنها یک بار بازدید می‌شود. توجه داشته باشید که فقط انواع " +"heap (heap type) انتظار می‌رود که نوع را در ``tp_traverse`` بازدید کنند." msgid "For example, if your traverse function includes::" -msgstr "" +msgstr "برای مثال، اگر تابع پیمایش شما شامل موارد زیر باشد::" msgid "base->tp_traverse(self, visit, arg)" -msgstr "" +msgstr "base->tp_traverse(self, visit, arg)" msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" +"... و ``base`` ممکن است یک نوع ایستا باشد، در این صورت باید شامل موارد زیر " +"نیز باشد::" msgid "" "if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" @@ -335,24 +772,45 @@ msgid "" " }\n" "}" msgstr "" +"if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" +" // a heap type's tp_traverse already visited Py_TYPE(self)\n" +"} else {\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +"}" -msgid "It is not necessary to handle the type's reference count in :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." +msgid "" +"It is not necessary to handle the type's reference count in " +":c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." msgstr "" +"لازم نیست شمار ارجاعِ نوع در :c:member:`~PyTypeObject.tp_new` و " +":c:member:`~PyTypeObject.tp_clear` مدیریت شود." msgid "Defining ``tp_dealloc``" -msgstr "" +msgstr "تعریف ``tp_dealloc``" -msgid "If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it needs to:" +msgid "" +"If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " +"needs to:" msgstr "" +"اگر نوع شما تابع :c:member:`~PyTypeObject.tp_dealloc` سفارشی دارد، باید:" -msgid "call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" +msgid "" +"call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" msgstr "" +":c:func:`PyObject_GC_UnTrack` را پیش از آنکه فیلدها بی‌اعتبار شوند فراخوانی " +"کنید، و" msgid "decrement the reference count of the type." -msgstr "" +msgstr "شمار ارجاع‌های نوع را کاهش دهید." -msgid "To keep the type valid while ``tp_free`` is called, the type's refcount needs to be decremented *after* the instance is deallocated. For example::" +msgid "" +"To keep the type valid while ``tp_free`` is called, the type's refcount " +"needs to be decremented *after* the instance is deallocated. For example::" msgstr "" +"برای معتبر نگه‌داشتن نوع در حین فراخوانی ``tp_free``، شمارنده ارجاع " +"(refcount) نوع باید *پس از* آزادسازی نمونه کاهش یابد. برای مثال::" msgid "" "static void my_dealloc(PyObject *self)\n" @@ -364,51 +822,98 @@ msgid "" " Py_DECREF(type);\n" "}" msgstr "" +"static void my_dealloc(PyObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" ...\n" +" PyTypeObject *type = Py_TYPE(self);\n" +" type->tp_free(self);\n" +" Py_DECREF(type);\n" +"}" -msgid "The default ``tp_dealloc`` function does this, so if your type does *not* override ``tp_dealloc`` you don't need to add it." +msgid "" +"The default ``tp_dealloc`` function does this, so if your type does *not* " +"override ``tp_dealloc`` you don't need to add it." msgstr "" +"تابع پیش‌فرض ``tp_dealloc`` این کار را انجام می‌دهد، بنابراین اگر نوع شما " +"``tp_dealloc`` را بازنویسی *نمی‌کند*، نیازی نیست آن را اضافه کنید." msgid "Not overriding ``tp_free``" -msgstr "" +msgstr "عدم بازنویسی ``tp_free``" -msgid "The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:func:`PyObject_GC_Del`. This is the default; do not override it." +msgid "" +"The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to " +":c:func:`PyObject_GC_Del`. This is the default; do not override it." msgstr "" +"جایگاه :c:member:`~PyTypeObject.tp_free` در یک نوع heap باید روی " +":c:func:`PyObject_GC_Del` تنظیم شود. این پیش‌فرض است؛ آن را بازنویسی نکنید." msgid "Avoiding ``PyObject_New``" -msgstr "" +msgstr "پرهیز از ``PyObject_New``" msgid "GC-tracked objects need to be allocated using GC-aware functions." msgstr "" +"اشیای پیگیری‌شده توسط زباله‌روبی باید با استفاده از توابع آگاه از " +"زباله‌روبی تخصیص داده شوند." msgid "If you use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" msgstr "" +"اگر از :c:func:`PyObject_New` یا :c:func:`PyObject_NewVar` استفاده می‌کنید:" -msgid "Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" +msgid "" +"Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " +"That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" msgstr "" +"در صورت امکان، جایگاه :c:member:`~PyTypeObject.tp_alloc` نوع را دریافت کرده و" +" فراخوانی کنید. یعنی ``TYPE *o = PyObject_New(TYPE, typeobj)`` را با این " +"جایگزین کنید::" msgid "TYPE *o = typeobj->tp_alloc(typeobj, 0);" -msgstr "" +msgstr "TYPE *o = typeobj->tp_alloc(typeobj, 0);" -msgid "Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use size instead of the 0." +msgid "" +"Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " +"size instead of the 0." msgstr "" +"``o = PyObject_NewVar(TYPE, typeobj, size)`` را با همان جایگزین کنید، اما " +"به‌جای 0 از size استفاده کنید." -msgid "If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" +msgid "" +"If the above is not possible (e.g. inside a custom ``tp_alloc``), call " +":c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" msgstr "" +"اگر مورد بالا ممکن نیست (برای مثال داخل یک ``tp_alloc`` سفارشی)، " +":c:func:`PyObject_GC_New` یا :c:func:`PyObject_GC_NewVar` را فراخوانی کنید::" msgid "" "TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" "\n" "TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" msgstr "" +"TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" +"\n" +"TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" msgid "Module State Access from Classes" -msgstr "" +msgstr "دسترسی به وضعیت ماژول از کلاس‌ها" -msgid "If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, you can call :c:func:`PyType_GetModule` to get the associated module, and then :c:func:`PyModule_GetState` to get the module's state." +msgid "" +"If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " +"you can call :c:func:`PyType_GetModule` to get the associated module, and " +"then :c:func:`PyModule_GetState` to get the module's state." msgstr "" +"اگر یک شیء نوع تعریف‌شده با :c:func:`PyType_FromModuleAndSpec` دارید، " +"می‌توانید :c:func:`PyType_GetModule` را فراخوانی کنید تا ماژول مرتبط را " +"دریافت کنید، و سپس :c:func:`PyModule_GetState` را فراخوانی کنید تا وضعیت " +"ماژول را دریافت کنید." -msgid "To save a some tedious error-handling boilerplate code, you can combine these two steps with :c:func:`PyType_GetModuleState`, resulting in::" +msgid "" +"To save a some tedious error-handling boilerplate code, you can combine " +"these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" +"برای پرهیز از برخی کدهای پیش‌ساخته ملال‌آور مدیریت خطا، می‌توانید این دو " +"مرحله را با :c:func:`PyType_GetModuleState` ترکیب کنید، که نتیجه به این صورت" +" است::" msgid "" "my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" @@ -416,21 +921,48 @@ msgid "" " return NULL;\n" "}" msgstr "" +"my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" msgid "Module State Access from Regular Methods" -msgstr "" +msgstr "دسترسی به وضعیت ماژول از متدهای معمولی" -msgid "Accessing the module-level state from methods of a class is somewhat more complicated, but is possible thanks to API introduced in Python 3.9. To get the state, you need to first get the *defining class*, and then get the module state from it." +msgid "" +"Accessing the module-level state from methods of a class is somewhat more " +"complicated, but is possible thanks to API introduced in Python 3.9. To get " +"the state, you need to first get the *defining class*, and then get the " +"module state from it." msgstr "" +"دسترسی به وضعیت سطح ماژول از متدهای یک کلاس تا حدی پیچیده‌تر است، اما به‌لطف" +" API معرفی‌شده در پایتون 3.9 امکان‌پذیر است. برای دریافت وضعیت، باید ابتدا " +"*کلاس تعریف‌کننده* را دریافت کنید و سپس وضعیت ماژول را از آن بگیرید." -msgid "The largest roadblock is getting *the class a method was defined in*, or that method's \"defining class\" for short. The defining class can have a reference to the module it is part of." +msgid "" +"The largest roadblock is getting *the class a method was defined in*, or " +"that method's \"defining class\" for short. The defining class can have a " +"reference to the module it is part of." msgstr "" +"بزرگ‌ترین مانع، به دست آوردن *کلاسی که یک متد در آن تعریف شده است*، یا " +"به‌اختصار «کلاس تعریف‌کننده»ی آن متد است. کلاس تعریف‌کننده می‌تواند ارجاعی " +"به ماژولی داشته باشد که بخشی از آن است." -msgid "Do not confuse the defining class with ``Py_TYPE(self)``. If the method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that subclass, which may be defined in different module than yours." +msgid "" +"Do not confuse the defining class with ``Py_TYPE(self)``. If the method is " +"called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " +"subclass, which may be defined in different module than yours." msgstr "" +"کلاس تعریف‌کننده را با ``Py_TYPE(self)`` اشتباه نگیرید. اگر متد بر روی یک " +"*زیرکلاس* از نوع شما فراخوانی شود، ``Py_TYPE(self)`` به آن زیرکلاس ارجاع " +"خواهد داشت، که ممکن است در ماژولی متفاوت از ماژول شما تعریف شده باشد." -msgid "The following Python code can illustrate the concept. ``Base.get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" +msgid "" +"The following Python code can illustrate the concept. " +"``Base.get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" +"کد پایتون زیر می‌تواند این مفهوم را نشان دهد. ``Base.get_defining_class`` " +"حتی اگر ``type(self) == Sub`` باشد، ``Base`` را برمی‌گرداند:" msgid "" "class Base:\n" @@ -443,9 +975,26 @@ msgid "" "class Sub(Base):\n" " pass" msgstr "" +"class Base:\n" +" def get_type_of_self(self):\n" +" return type(self)\n" +"\n" +" def get_defining_class(self):\n" +" return __class__\n" +"\n" +"class Sub(Base):\n" +" pass" -msgid "For a method to get its \"defining class\", it must use the :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the corresponding :c:type:`PyCMethod` signature::" +msgid "" +"For a method to get its \"defining class\", it must use the " +":ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and" +" the corresponding :c:type:`PyCMethod` signature::" msgstr "" +"برای اینکه یک متد «کلاس تعریف‌کننده» خود را دریافت کند، باید از " +":ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`قرارداد فراخوانی ` و " +"امضای متناظر :c:type:`PyCMethod` استفاده کند::" msgid "" "PyObject *PyCMethod(\n" @@ -455,12 +1004,22 @@ msgid "" " Py_ssize_t nargs, // length of \"args\"\n" " PyObject *kwnames) // NULL, or dict of keyword arguments" msgstr "" +"PyObject *PyCMethod(\n" +" PyObject *self, // object the method was called on\n" +" PyTypeObject *defining_class, // defining class\n" +" PyObject *const *args, // C array of arguments\n" +" Py_ssize_t nargs, // length of \"args\"\n" +" PyObject *kwnames) // NULL, or dict of keyword arguments" -msgid "Once you have the defining class, call :c:func:`PyType_GetModuleState` to get the state of its associated module." +msgid "" +"Once you have the defining class, call :c:func:`PyType_GetModuleState` to " +"get the state of its associated module." msgstr "" +"پس از اینکه کلاس تعریف‌کننده را در اختیار داشتید، برای دریافت وضعیت ماژول " +"مرتبط با آن، :c:func:`PyType_GetModuleState` را فراخوانی کنید." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "static PyObject *\n" @@ -487,18 +1046,63 @@ msgid "" " {NULL},\n" "}" msgstr "" +"static PyObject *\n" +"example_method(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)\n" +"{\n" +" my_struct *state = (my_struct*)PyType_GetModuleState(defining_class);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" ... // rest of logic\n" +"}\n" +"\n" +"PyDoc_STRVAR(example_method_doc, \"...\");\n" +"\n" +"static PyMethodDef my_methods[] = {\n" +" {\"example_method\",\n" +" (PyCFunction)(void(*)(void))example_method,\n" +" METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n" +" example_method_doc}\n" +" {NULL},\n" +"}" msgid "Module State Access from Slot Methods, Getters and Setters" msgstr "" +"دسترسی به وضعیت ماژول از متدهای جایگاه (slot)، دریابندهها (getters) و " +"تنظیم‌کننده‌ها (setters)" msgid "This is new in Python 3.11." -msgstr "" +msgstr "این مورد در پایتون 3.11 جدید است." -msgid "Slot methods—the fast C equivalents for special methods, such as :c:member:`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or :c:member:`~PyTypeObject.tp_new` for initialization—have a very simple API that doesn't allow passing in the defining class, unlike with :c:type:`PyCMethod`. The same goes for getters and setters defined with :c:type:`PyGetSetDef`." -msgstr "" +msgid "" +"Slot methods—the fast C equivalents for special methods, such as " +":c:member:`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or " +":c:member:`~PyTypeObject.tp_new` for initialization—have a very simple API " +"that doesn't allow passing in the defining class, unlike with " +":c:type:`PyCMethod`. The same goes for getters and setters defined with " +":c:type:`PyGetSetDef`." +msgstr "" +"متدهای جایگاه (slot methods)—معادل‌های سریع C برای متدهای ویژه، مانند " +":c:member:`~PyNumberMethods.nb_add` برای :py:attr:`~object.__add__` یا " +":c:member:`~PyTypeObject.tp_new` برای مقداردهی اولیه—دارای API بسیار ساده‌ای" +" هستند که برخلاف :c:type:`PyCMethod` اجازه‌ی ارسال کلاس تعریف‌کننده را " +"نمی‌دهد. همین موضوع برای دریابندهها و تنظیم‌کننده‌ها (getters and " +"setters) که با :c:type:`PyGetSetDef` تعریف‌شده‌اند نیز صدق می‌کند." -msgid "To access the module state in these cases, use the :c:func:`PyType_GetModuleByDef` function, and pass in the module definition. Once you have the module, call :c:func:`PyModule_GetState` to get the state::" +msgid "" +"To access the module state in these cases, use the " +":c:func:`PyType_GetModuleByDef` function, and pass in the module definition." +" Once you have the module, call :c:func:`PyModule_GetState` to get the " +"state::" msgstr "" +"برای دسترسی به وضعیت ماژول در این موارد، از تابع " +":c:func:`PyType_GetModuleByDef` استفاده کنید و تعریف ماژول را به آن ارسال " +"کنید. هنگامی که ماژول را دریافت کردید، برای دریافت وضعیت، " +":c:func:`PyModule_GetState` را فراخوانی کنید::" msgid "" "PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" @@ -507,39 +1111,90 @@ msgid "" " return NULL;\n" "}" msgstr "" +"PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" +"my_struct *state = (my_struct*)PyModule_GetState(module);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" -msgid ":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method resolution order` (i.e. all superclasses) for the first superclass that has a corresponding module." +msgid "" +":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " +"resolution order` (i.e. all superclasses) for the first superclass that has " +"a corresponding module." msgstr "" +":c:func:`!PyType_GetModuleByDef` با جست‌وجو در :term:`method resolution " +"order` (یعنی همه‌ی ابرکلاس‌ها) برای نخستین ابرکلاسی که ماژول متناظر دارد، " +"کار می‌کند." -msgid "In very exotic cases (inheritance chains spanning multiple modules created from the same definition), :c:func:`!PyType_GetModuleByDef` might not return the module of the true defining class. However, it will always return a module with the same definition, ensuring a compatible C memory layout." +msgid "" +"In very exotic cases (inheritance chains spanning multiple modules created " +"from the same definition), :c:func:`!PyType_GetModuleByDef` might not return" +" the module of the true defining class. However, it will always return a " +"module with the same definition, ensuring a compatible C memory layout." msgstr "" +"در موارد بسیار خاص (زنجیره‌های وراثتی که چندین ماژول ایجادشده از یک تعریف را" +" در بر می‌گیرند)، ممکن است :c:func:`!PyType_GetModuleByDef` ماژولِ کلاس " +"تعریف‌کننده واقعی را برنگرداند. با این حال، همیشه ماژولی با همان تعریف را " +"برمی‌گرداند و چیدمان حافظه‌ای سازگار در C را تضمین می‌کند." msgid "Lifetime of the Module State" -msgstr "" +msgstr "طول عمر وضعیت ماژول" -msgid "When a module object is garbage-collected, its module state is freed. For each pointer to (a part of) the module state, you must hold a reference to the module object." +msgid "" +"When a module object is garbage-collected, its module state is freed. For " +"each pointer to (a part of) the module state, you must hold a reference to " +"the module object." msgstr "" +"وقتی یک شیء ماژول زباله‌روبی می‌شود، وضعیت ماژول آن آزاد می‌شود. برای هر " +"اشاره‌گر به (بخشی از) وضعیت ماژول، باید یک ارجاع به شیء ماژول نگه دارید." -msgid "Usually this is not an issue, because types created with :c:func:`PyType_FromModuleAndSpec`, and their instances, hold a reference to the module. However, you must be careful in reference counting when you reference module state from other places, such as callbacks for external libraries." -msgstr "" +msgid "" +"Usually this is not an issue, because types created with " +":c:func:`PyType_FromModuleAndSpec`, and their instances, hold a reference to" +" the module. However, you must be careful in reference counting when you " +"reference module state from other places, such as callbacks for external " +"libraries." +msgstr "" +"معمولاً این مسئله مشکلی نیست، زیرا انواع ساخته‌شده با " +":c:func:`PyType_FromModuleAndSpec` و نمونه‌هایشان، یک ارجاع به ماژول نگه " +"می‌دارند. با این حال، وقتی از جاهای دیگر، مانند کال‌بک‌هایی برای " +"کتابخانه‌های خارجی، به وضعیت ماژول ارجاع می‌دهید، باید در شمارش ارجاع دقت " +"کنید." msgid "Open Issues" -msgstr "" +msgstr "مسائل باز" msgid "Several issues around per-module state and heap types are still open." msgstr "" +"چندین مسئله پیرامون وضعیت به‌ازای هر ماژول و انواع heap (heap types) هنوز " +"باز هستند." -msgid "Discussions about improving the situation are best held on the `discuss forum under c-api tag `__." +msgid "" +"Discussions about improving the situation are best held on the `discuss " +"forum under c-api tag `__." msgstr "" +"بهتر است بحث‌های مربوط به بهبود وضعیت در `انجمن discuss ذیل برچسب c-api " +"`__ انجام شوند." msgid "Per-Class Scope" -msgstr "" +msgstr "محدوده به‌ازای هر کلاس" -msgid "It is currently (as of Python 3.11) not possible to attach state to individual *types* without relying on CPython implementation details (which may change in the future—perhaps, ironically, to allow a proper solution for per-class scope)." +msgid "" +"It is currently (as of Python 3.11) not possible to attach state to " +"individual *types* without relying on CPython implementation details (which " +"may change in the future—perhaps, ironically, to allow a proper solution for" +" per-class scope)." msgstr "" +"در حال حاضر (در پایتون 3.11) امکان الصاق وضعیت به *انواع* منفرد بدون تکیه بر" +" جزئیات پیاده‌سازی CPython وجود ندارد (که ممکن است در آینده تغییر کنند—شاید،" +" از سر طعنه، تا راه‌حل مناسبی برای محدوده به‌ازای هر کلاس فراهم شود)." msgid "Lossless Conversion to Heap Types" -msgstr "" +msgstr "تبدیل بدون اتلاف به نوع‌های Heap" -msgid "The heap type API was not designed for \"lossless\" conversion from static types; that is, creating a type that works exactly like a given static type." +msgid "" +"The heap type API was not designed for \"lossless\" conversion from static " +"types; that is, creating a type that works exactly like a given static type." msgstr "" +"API نوع heap برای تبدیل «بدون اتلاف» از انواع ایستا طراحی نشده است؛ یعنی " +"ایجاد نوعی که دقیقاً مانند یک نوع ایستای معین کار کند." diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 3418e11ef..4f40fcbdb 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"PO-Revision-Date: 2026-08-28 10:59+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,24 +23,31 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Logging Cookbook" -msgstr "" +msgstr "کتاب آشپزی گزارش‌گیری (Logging Cookbook)" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "Vinay Sajip " -msgstr "" +msgstr "Vinay Sajip " msgid "This page contains a number of recipes related to logging, which have been found useful in the past. For links to tutorial and reference information, please see :ref:`cookbook-ref-links`." -msgstr "" +msgstr "این صفحه حاوی تعدادی دستورالعمل مرتبط با گزارش‌کردن (logging) است که در گذشته مفید شناخته شده‌اند. برای پیوندهایی به اطلاعات آموزشی و مرجع، لطفاً :ref:`cookbook-ref-links` را ببینید." msgid "Using logging in multiple modules" -msgstr "" +msgstr "استفاده از گزارش‌گیری (logging) در ماژول‌های متعدد" -msgid "Multiple calls to ``logging.getLogger('someLogger')`` return a reference to the same logger object. This is true not only within the same module, but also across modules as long as it is in the same Python interpreter process. It is true for references to the same object; additionally, application code can define and configure a parent logger in one module and create (but not configure) a child logger in a separate module, and all logger calls to the child will pass up to the parent. Here is a main module::" +msgid "" +"Multiple calls to ``logging.getLogger('someLogger')`` return a reference to the same logger object. This is true not only within the same module, but also across modules as long as it is in the " +"same Python interpreter process. It is true for references to the same object; additionally, application code can define and configure a parent logger in one module and create (but not " +"configure) a child logger in a separate module, and all logger calls to the child will pass up to the parent. Here is a main module::" msgstr "" +"چندین فراخوانی ``logging.getLogger('someLogger')`` ارجاعی به همان شیء گزارش‌گیر (logger) برمی‌گردانند. این موضوع نه‌تنها در داخل همان ماژول، بلکه بین ماژول‌ها نیز تا زمانی که در یک فرآیند مفسر پایتون " +"یکسان باشند، صادق است. این امر برای ارجاع‌ها به همان شیء نیز صادق است؛ علاوه بر این، کد برنامه می‌تواند یک گزارش‌گیر والد را در یک ماژول تعریف و پیکربندی کند و یک گزارش‌گیر فرزند را در ماژولی جداگانه ایجاد " +"کند (اما آن را پیکربندی نکند)، و همه‌ی فراخوانی‌های گزارش‌گیر فرزند، به گزارش‌گیر والد منتقل خواهند شد. در ادامه یک ماژول اصلی آمده است::" msgid "" "import logging\n" @@ -73,9 +80,38 @@ msgid "" "auxiliary_module.some_function()\n" "logger.info('done with auxiliary_module.some_function()')" msgstr "" +"import logging\n" +"import auxiliary_module\n" +"\n" +"# create logger with 'spam_application'\n" +"logger = logging.getLogger('spam_application')\n" +"logger.setLevel(logging.DEBUG)\n" +"# create file handler which logs even debug messages\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# create console handler with a higher log level\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# create formatter and add it to the handlers\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n" +"fh.setFormatter(formatter)\n" +"ch.setFormatter(formatter)\n" +"# add the handlers to the logger\n" +"logger.addHandler(fh)\n" +"logger.addHandler(ch)\n" +"\n" +"logger.info('creating an instance of auxiliary_module.Auxiliary')\n" +"a = auxiliary_module.Auxiliary()\n" +"logger.info('created an instance of auxiliary_module.Auxiliary')\n" +"logger.info('calling auxiliary_module.Auxiliary.do_something')\n" +"a.do_something()\n" +"logger.info('finished auxiliary_module.Auxiliary.do_something')\n" +"logger.info('calling auxiliary_module.some_function()')\n" +"auxiliary_module.some_function()\n" +"logger.info('done with auxiliary_module.some_function()')" msgid "Here is the auxiliary module::" -msgstr "" +msgstr "در اینجا ماژول کمکی آمده است::" msgid "" "import logging\n" @@ -96,9 +132,26 @@ msgid "" "def some_function():\n" " module_logger.info('received a call to \"some_function\"')" msgstr "" +"import logging\n" +"\n" +"# create logger\n" +"module_logger = logging.getLogger('spam_application.auxiliary')\n" +"\n" +"class Auxiliary:\n" +" def __init__(self):\n" +" self.logger = logging.getLogger('spam_application.auxiliary.Auxiliary')\n" +" self.logger.info('creating an instance of Auxiliary')\n" +"\n" +" def do_something(self):\n" +" self.logger.info('doing something')\n" +" a = 1 + 1\n" +" self.logger.info('done doing something')\n" +"\n" +"def some_function():\n" +" module_logger.info('received a call to \"some_function\"')" msgid "The output looks like this:" -msgstr "" +msgstr "خروجی به این شکل است:" msgid "" "2005-03-23 23:47:11,663 - spam_application - INFO -\n" @@ -122,12 +175,32 @@ msgid "" "2005-03-23 23:47:11,673 - spam_application - INFO -\n" " done with auxiliary_module.some_function()" msgstr "" +"2005-03-23 23:47:11,663 - spam_application - INFO -\n" +" creating an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -\n" +" creating an instance of Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application - INFO -\n" +" created an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,668 - spam_application - INFO -\n" +" calling auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -\n" +" doing something\n" +"2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -\n" +" done doing something\n" +"2005-03-23 23:47:11,670 - spam_application - INFO -\n" +" finished auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,671 - spam_application - INFO -\n" +" calling auxiliary_module.some_function()\n" +"2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -\n" +" received a call to 'some_function'\n" +"2005-03-23 23:47:11,673 - spam_application - INFO -\n" +" done with auxiliary_module.some_function()" msgid "Logging from multiple threads" -msgstr "" +msgstr "ثبت گزارش از چندین نخ" msgid "Logging from multiple threads requires no special effort. The following example shows logging from the main (initial) thread and another thread::" -msgstr "" +msgstr "گزارش‌گیری از چندین نخ نیازمند تلاش خاصی نیست. مثال زیر گزارش‌گیری از نخ اصلی (آغازین) و نخی دیگر را نشان می‌دهد::" msgid "" "import logging\n" @@ -156,9 +229,34 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import logging\n" +"import threading\n" +"import time\n" +"\n" +"def worker(arg):\n" +" while not arg['stop']:\n" +" logging.debug('Hi from myfunc')\n" +" time.sleep(0.5)\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d %(threadName)s %(message)s')\n" +" info = {'stop': False}\n" +" thread = threading.Thread(target=worker, args=(info,))\n" +" thread.start()\n" +" while True:\n" +" try:\n" +" logging.debug('Hello from main')\n" +" time.sleep(0.75)\n" +" except KeyboardInterrupt:\n" +" info['stop'] = True\n" +" break\n" +" thread.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" msgid "When run, the script should print something like the following:" -msgstr "" +msgstr "هنگام اجرا، اسکریپت باید چیزی شبیه به مورد زیر چاپ کند:" msgid "" " 0 Thread-1 Hi from myfunc\n" @@ -179,15 +277,38 @@ msgid "" "4513 MainThread Hello from main\n" "4518 Thread-1 Hi from myfunc" msgstr "" +" 0 Thread-1 Hi from myfunc\n" +" 3 MainThread Hello from main\n" +" 505 Thread-1 Hi from myfunc\n" +" 755 MainThread Hello from main\n" +"1007 Thread-1 Hi from myfunc\n" +"1507 MainThread Hello from main\n" +"1508 Thread-1 Hi from myfunc\n" +"2010 Thread-1 Hi from myfunc\n" +"2258 MainThread Hello from main\n" +"2512 Thread-1 Hi from myfunc\n" +"3009 MainThread Hello from main\n" +"3013 Thread-1 Hi from myfunc\n" +"3515 Thread-1 Hi from myfunc\n" +"3761 MainThread Hello from main\n" +"4017 Thread-1 Hi from myfunc\n" +"4513 MainThread Hello from main\n" +"4518 Thread-1 Hi from myfunc" msgid "This shows the logging output interspersed as one might expect. This approach works for more threads than shown here, of course." -msgstr "" +msgstr "این، خروجی گزارش‌گیری (logging) را به‌صورت درهم‌آمیخته، همان‌طور که انتظار می‌رود، نشان می‌دهد. البته این روش برای نخ‌های بیشتری نسبت به آنچه در اینجا نشان داده شده است نیز کار می‌کند." msgid "Multiple handlers and formatters" -msgstr "" +msgstr "هندلرها و قالب‌بندهای متعدد" -msgid "Loggers are plain Python objects. The :meth:`~Logger.addHandler` method has no minimum or maximum quota for the number of handlers you may add. Sometimes it will be beneficial for an application to log all messages of all severities to a text file while simultaneously logging errors or above to the console. To set this up, simply configure the appropriate handlers. The logging calls in the application code will remain unchanged. Here is a slight modification to the previous simple module-based configuration example::" +msgid "" +"Loggers are plain Python objects. The :meth:`~Logger.addHandler` method has no minimum or maximum quota for the number of handlers you may add. Sometimes it will be beneficial for an " +"application to log all messages of all severities to a text file while simultaneously logging errors or above to the console. To set this up, simply configure the appropriate handlers. The " +"logging calls in the application code will remain unchanged. Here is a slight modification to the previous simple module-based configuration example::" msgstr "" +"گزارش‌گیرها (loggers) اشیای ساده پایتون هستند. متد :meth:`~Logger.addHandler` هیچ حداقل یا حداکثر سهمیه‌ای برای تعداد هندلرهایی (handlers) که می‌توانید اضافه کنید، ندارد. گاهی اوقات برای یک برنامه " +"کاربردی مفید خواهد بود که تمام پیام‌ها با تمام سطوح شدت را در یک فایل متنی گزارش کند و همزمان خطاها یا سطوح بالاتر را در کنسول گزارش کند. برای تنظیم این حالت، کافی است هندلرهای مناسب را پیکربندی کنید. " +"فراخوانی‌های گزارش در کد برنامه بدون تغییر باقی خواهند ماند. در ادامه تغییری جزئی در مثال پیکربندی ساده مبتنی بر ماژول قبلی آمده است::" msgid "" "import logging\n" @@ -215,18 +336,52 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"# ایجاد یک هندلری فایل که حتی پیام‌های debug را نیز ثبت می‌کند\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# ایجاد یک هندلری کنسول با سطح گزارش بالاتر\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# ایجاد قالب‌بند و افزودن آن به هندلرها\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n" +"ch.setFormatter(formatter)\n" +"fh.setFormatter(formatter)\n" +"# افزودن هندلرها به logger\n" +"logger.addHandler(ch)\n" +"logger.addHandler(fh)\n" +"\n" +"# کد «برنامه»\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" msgid "Notice that the 'application' code does not care about multiple handlers. All that changed was the addition and configuration of a new handler named *fh*." -msgstr "" +msgstr "توجه داشته باشید که کد «برنامه» به چند هندلر (handler) اهمیتی نمی‌دهد. تنها چیزی که تغییر کرد، افزودن و پیکربندی یک هندلر (handler) جدید به نام *fh* بود." -msgid "The ability to create new handlers with higher- or lower-severity filters can be very helpful when writing and testing an application. Instead of using many ``print`` statements for debugging, use ``logger.debug``: Unlike the print statements, which you will have to delete or comment out later, the logger.debug statements can remain intact in the source code and remain dormant until you need them again. At that time, the only change that needs to happen is to modify the severity level of the logger and/or handler to debug." +msgid "" +"The ability to create new handlers with higher- or lower-severity filters can be very helpful when writing and testing an application. Instead of using many ``print`` statements for debugging, " +"use ``logger.debug``: Unlike the print statements, which you will have to delete or comment out later, the logger.debug statements can remain intact in the source code and remain dormant until " +"you need them again. At that time, the only change that needs to happen is to modify the severity level of the logger and/or handler to debug." msgstr "" +"توانایی ایجاد هندلرهای جدید با فیلترهایی با شدت بالاتر یا پایین‌تر می‌تواند هنگام نوشتن و آزمایش یک برنامه کاربردی بسیار مفید باشد. به جای استفاده از دستورهای ``print`` زیاد برای اشکال‌زدایی، از " +"``logger.debug`` استفاده کنید: برخلاف دستورهای print که بعداً مجبور خواهید بود آن‌ها را حذف یا کامنت کنید، دستورهای logger.debug می‌توانند دست‌نخورده در کد منبع باقی بمانند و تا زمانی که دوباره به " +"آن‌ها نیاز دارید، غیرفعال بمانند. در آن زمان، تنها تغییر لازم، تغییر سطح شدت logger و/یا هندلر (handler) به debug است." msgid "Logging to multiple destinations" -msgstr "" +msgstr "گزارش‌برداری در چندین مقصد" -msgid "Let's say you want to log to console and file with different message formats and in differing circumstances. Say you want to log messages with levels of DEBUG and higher to file, and those messages at level INFO and higher to the console. Let's also assume that the file should contain timestamps, but the console messages should not. Here's how you can achieve this::" +msgid "" +"Let's say you want to log to console and file with different message formats and in differing circumstances. Say you want to log messages with levels of DEBUG and higher to file, and those " +"messages at level INFO and higher to the console. Let's also assume that the file should contain timestamps, but the console messages should not. Here's how you can achieve this::" msgstr "" +"فرض کنید می‌خواهید گزارش‌ها را با قالب‌های پیام متفاوت و در شرایط مختلف در کنسول و فایل ثبت کنید. فرض کنید می‌خواهید پیام‌هایی با سطوح DEBUG و بالاتر را در فایل و پیام‌هایی با سطح INFO و بالاتر را در " +"کنسول ثبت کنید. همچنین فرض کنید فایل باید شامل برچسب‌های زمانی باشد، اما پیام‌های کنسول نباید شامل برچسب‌های زمانی باشند. در ادامه، چگونگی دستیابی به این هدف آمده است::" msgid "" "import logging\n" @@ -261,9 +416,40 @@ msgid "" "logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" "logger2.error('The five boxing wizards jump quickly.')" msgstr "" +"import logging\n" +"\n" +"# set up logging to file - see previous section for more details\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',\n" +" datefmt='%m-%d %H:%M',\n" +" filename='/tmp/myapp.log',\n" +" filemode='w')\n" +"# define a Handler which writes INFO messages or higher to the sys.stderr\n" +"console = logging.StreamHandler()\n" +"console.setLevel(logging.INFO)\n" +"# set a format which is simpler for console use\n" +"formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')\n" +"# tell the handler to use this format\n" +"console.setFormatter(formatter)\n" +"# add the handler to the root logger\n" +"logging.getLogger().addHandler(console)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" msgid "When you run this, on the console you will see" -msgstr "" +msgstr "هنگامی که این را اجرا می‌کنید، در کنسول خواهید دید" msgid "" "root : INFO Jackdaws love my big sphinx of quartz.\n" @@ -271,9 +457,13 @@ msgid "" "myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" "myapp.area2 : ERROR The five boxing wizards jump quickly." msgstr "" +"root : INFO کلاغ‌ها عاشق ابوالهول بزرگ کوارتزی من هستند.\n" +"myapp.area1 : INFO گورخرهای جهنده‌ی احمق چقدر سریع آزار می‌دهند.\n" +"myapp.area2 : WARNING روباه ماده‌ی پرشور را که دستمزد را از شارلاتان قاپید زندانی کنید.\n" +"myapp.area2 : ERROR پنج جادوگر بوکسور به‌سرعت می‌پرند." msgid "and in the file you will see something like" -msgstr "" +msgstr "و در فایل چیزی شبیه به این خواهید دید" msgid "" "10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" @@ -282,33 +472,46 @@ msgid "" "10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" "10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." msgstr "" +"10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" +"10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +"10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +"10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +"10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." msgid "As you can see, the DEBUG message only shows up in the file. The other messages are sent to both destinations." -msgstr "" +msgstr "همان‌طور که می‌بینید، پیام DEBUG فقط در فایل نمایش داده می‌شود. سایر پیام‌ها به هر دو مقصد ارسال می‌شوند." msgid "This example uses console and file handlers, but you can use any number and combination of handlers you choose." -msgstr "" +msgstr "این مثال از هندلرهای (handlers) کنسول و فایل استفاده می‌کند، اما شما می‌توانید از هر تعداد و ترکیبی از هندلرها (handlers) که بخواهید استفاده کنید." -msgid "Note that the above choice of log filename ``/tmp/myapp.log`` implies use of a standard location for temporary files on POSIX systems. On Windows, you may need to choose a different directory name for the log - just ensure that the directory exists and that you have the permissions to create and update files in it." +msgid "" +"Note that the above choice of log filename ``/tmp/myapp.log`` implies use of a standard location for temporary files on POSIX systems. On Windows, you may need to choose a different directory " +"name for the log - just ensure that the directory exists and that you have the permissions to create and update files in it." msgstr "" +"توجه داشته باشید که انتخاب نام فایل گزارش ``/tmp/myapp.log`` در بالا، به معنای استفاده از یک مکان استاندارد برای فایل‌های موقت در سیستم‌های POSIX است. در ویندوز، ممکن است لازم باشد نام پوشه متفاوتی " +"را برای گزارش انتخاب کنید؛ فقط اطمینان حاصل کنید که پوشه وجود دارد و شما دسترسی لازم برای ایجاد و به‌روزرسانی فایل‌ها در آن را دارید." msgid "Custom handling of levels" -msgstr "" +msgstr "مدیریت سفارشی سطح‌ها" -msgid "Sometimes, you might want to do something slightly different from the standard handling of levels in handlers, where all levels above a threshold get processed by a handler. To do this, you need to use filters. Let's look at a scenario where you want to arrange things as follows:" +msgid "" +"Sometimes, you might want to do something slightly different from the standard handling of levels in handlers, where all levels above a threshold get processed by a handler. To do this, you need " +"to use filters. Let's look at a scenario where you want to arrange things as follows:" msgstr "" +"گاهی ممکن است بخواهید کاری کمی متفاوت از روش استاندارد پردازش سطوح در هندلرها (handlers) انجام دهید، که در آن تمام سطوح بالاتر از یک آستانه توسط یک هندلر پردازش می‌شوند. برای این کار، باید از " +"فیلترها استفاده کنید. بیایید سناریویی را بررسی کنیم که می‌خواهید موارد را به‌صورت زیر مرتب کنید:" msgid "Send messages of severity ``INFO`` and ``WARNING`` to ``sys.stdout``" -msgstr "" +msgstr "پیام‌هایی با شدت ``INFO`` و ``WARNING`` را به ``sys.stdout`` ارسال کنید" msgid "Send messages of severity ``ERROR`` and above to ``sys.stderr``" -msgstr "" +msgstr "پیام‌های با شدت ``ERROR`` و بالاتر را به ``sys.stderr`` ارسال کنید" msgid "Send messages of severity ``DEBUG`` and above to file ``app.log``" -msgstr "" +msgstr "پیام‌هایی با شدت ``DEBUG`` و بالاتر را به فایل ``app.log`` ارسال کنید" msgid "Suppose you configure logging with the following JSON:" -msgstr "" +msgstr "فرض کنید گزارش‌گیری را با JSON زیر پیکربندی می‌کنید:" msgid "" "{\n" @@ -349,9 +552,52 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\"\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}" -msgid "This configuration does *almost* what we want, except that ``sys.stdout`` would show messages of severity ``ERROR`` and only events of this severity and higher will be tracked as well as ``INFO`` and ``WARNING`` messages. To prevent this, we can set up a filter which excludes those messages and add it to the relevant handler. This can be configured by adding a ``filters`` section parallel to ``formatters`` and ``handlers``:" +msgid "" +"This configuration does *almost* what we want, except that ``sys.stdout`` would show messages of severity ``ERROR`` and only events of this severity and higher will be tracked as well as ``INFO`` " +"and ``WARNING`` messages. To prevent this, we can set up a filter which excludes those messages and add it to the relevant handler. This can be configured by adding a ``filters`` section parallel " +"to ``formatters`` and ``handlers``:" msgstr "" +"این پیکربندی *تقریباً* آنچه می‌خواهیم انجام می‌دهد، با این استثنا که ``sys.stdout`` پیام‌هایی با شدت ``ERROR`` را نشان می‌دهد و تنها رویدادهایی با این شدت و بالاتر، به‌همراه پیام‌های ``INFO`` و " +"``WARNING`` نیز پیگیری می‌شوند. برای جلوگیری از این موضوع، می‌توانیم فیلتری تنظیم کنیم که آن پیام‌ها را حذف کند و آن را به هندلر (handler) مربوطه اضافه کنیم. این کار را می‌توان با افزودن یک بخش " +"``filters`` هم‌سطح با ``formatters`` و ``handlers`` پیکربندی کرد:" msgid "" "{\n" @@ -363,9 +609,17 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" }\n" +"}" msgid "and changing the section on the ``stdout`` handler to add it:" -msgstr "" +msgstr "و تغییر بخش مربوط به مدیر (handler) ``stdout`` برای افزودن آن:" msgid "" "{\n" @@ -378,9 +632,18 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" }\n" +"}" msgid "A filter is just a function, so we can define the ``filter_maker`` (a factory function) as follows:" -msgstr "" +msgstr "یک فیلتر فقط یک تابع است، بنابراین می‌توانیم ``filter_maker`` (یک تابع کارخانه) را به‌صورت زیر تعریف کنیم:" msgid "" "def filter_maker(level):\n" @@ -391,12 +654,25 @@ msgid "" "\n" " return filter" msgstr "" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter" -msgid "This converts the string argument passed in to a numeric level, and returns a function which only returns ``True`` if the level of the passed in record is at or below the specified level. Note that in this example I have defined the ``filter_maker`` in a test script ``main.py`` that I run from the command line, so its module will be ``__main__`` - hence the ``__main__.filter_maker`` in the filter configuration. You will need to change that if you define it in a different module." +msgid "" +"This converts the string argument passed in to a numeric level, and returns a function which only returns ``True`` if the level of the passed in record is at or below the specified level. Note " +"that in this example I have defined the ``filter_maker`` in a test script ``main.py`` that I run from the command line, so its module will be ``__main__`` - hence the ``__main__.filter_maker`` in " +"the filter configuration. You will need to change that if you define it in a different module." msgstr "" +"این، آرگومان رشته‌ای داده‌شده را به یک سطح عددی تبدیل می‌کند و تابعی را برمی‌گرداند که فقط در صورتی ``True`` را برمی‌گرداند که سطح رکورد داده‌شده برابر با سطح مشخص‌شده یا پایین‌تر از آن باشد. توجه داشته " +"باشید که در این مثال، ``filter_maker`` را در یک اسکریپت آزمایشی به نام ``main.py`` تعریف کرده‌ام که آن را از خط فرمان اجرا می‌کنم؛ بنابراین ماژول آن ``__main__`` خواهد بود؛ از این رو " +"``__main__.filter_maker`` در پیکربندی فیلتر آمده است. اگر آن را در ماژول دیگری تعریف کنید، باید آن را تغییر دهید." msgid "With the filter added, we can run ``main.py``, which in full is:" -msgstr "" +msgstr "با افزودن فیلتر، می‌توانیم ``main.py`` را اجرا کنیم، که به‌طور کامل به این صورت است:" msgid "" "import json\n" @@ -465,15 +741,80 @@ msgid "" "logging.error('An ERROR message')\n" "logging.critical('A CRITICAL message')" msgstr "" +"import json\n" +"import logging\n" +"import logging.config\n" +"\n" +"CONFIG = '''\n" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}\n" +"'''\n" +"\n" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter\n" +"\n" +"logging.config.dictConfig(json.loads(CONFIG))\n" +"logging.debug('A DEBUG message')\n" +"logging.info('An INFO message')\n" +"logging.warning('A WARNING message')\n" +"logging.error('An ERROR message')\n" +"logging.critical('A CRITICAL message')" msgid "And after running it like this:" -msgstr "" +msgstr "و پس از اجرای آن به این صورت:" msgid "python main.py 2>stderr.log >stdout.log" -msgstr "" +msgstr "python main.py 2>stderr.log >stdout.log" msgid "We can see the results are as expected:" -msgstr "" +msgstr "می‌توانیم ببینیم که نتایج مطابق انتظار هستند:" msgid "" "$ more *.log\n" @@ -496,12 +837,31 @@ msgid "" "INFO - An INFO message\n" "WARNING - A WARNING message" msgstr "" +"$ more *.log\n" +"::::::::::::::\n" +"app.log\n" +"::::::::::::::\n" +"DEBUG - A DEBUG message\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stderr.log\n" +"::::::::::::::\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stdout.log\n" +"::::::::::::::\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message" msgid "Configuration server example" -msgstr "" +msgstr "مثال سرور پیکربندی" msgid "Here is an example of a module using the logging configuration server::" -msgstr "" +msgstr "در اینجا نمونه‌ای از یک ماژول که از کارساز پیکربندی گزارش‌گیری (logging configuration server) استفاده می‌کند، آمده است::" msgid "" "import logging\n" @@ -533,9 +893,37 @@ msgid "" " logging.config.stopListening()\n" " t.join()" msgstr "" +"import logging\n" +"import logging.config\n" +"import time\n" +"import os\n" +"\n" +"# read initial config file\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create and start listener on port 9999\n" +"t = logging.config.listen(9999)\n" +"t.start()\n" +"\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"try:\n" +" # loop through logging calls to see the difference\n" +" # new configurations make, until Ctrl+C is pressed\n" +" while True:\n" +" logger.debug('debug message')\n" +" logger.info('info message')\n" +" logger.warning('warn message')\n" +" logger.error('error message')\n" +" logger.critical('critical message')\n" +" time.sleep(5)\n" +"except KeyboardInterrupt:\n" +" # cleanup\n" +" logging.config.stopListening()\n" +" t.join()" msgid "And here is a script that takes a filename and sends that file to the server, properly preceded with the binary-encoded length, as the new logging configuration::" -msgstr "" +msgstr "و در اینجا اسکریپتی آمده است که یک نام فایل می‌گیرد و آن فایل را به‌عنوان پیکربندی جدید گزارش‌گیری، به‌همراه طول کدگذاری‌شده‌ی دودویی که به‌درستی پیش از آن قرار گرفته است، به سرور ارسال می‌کند::" msgid "" "#!/usr/bin/env python\n" @@ -555,27 +943,71 @@ msgid "" "s.close()\n" "print('complete')" msgstr "" +"#!/usr/bin/env python\n" +"import socket, sys, struct\n" +"\n" +"with open(sys.argv[1], 'rb') as f:\n" +" data_to_send = f.read()\n" +"\n" +"HOST = 'localhost'\n" +"PORT = 9999\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"print('connecting...')\n" +"s.connect((HOST, PORT))\n" +"print('sending config...')\n" +"s.send(struct.pack('>L', len(data_to_send)))\n" +"s.send(data_to_send)\n" +"s.close()\n" +"print('complete')" msgid "Dealing with handlers that block" -msgstr "" +msgstr "مدیریت هندلرهایی که مسدود می‌کنند" -msgid "Sometimes you have to get your logging handlers to do their work without blocking the thread you're logging from. This is common in web applications, though of course it also occurs in other scenarios." +msgid "" +"Sometimes you have to get your logging handlers to do their work without blocking the thread you're logging from. This is common in web applications, though of course it also occurs in other " +"scenarios." msgstr "" +"گاهی اوقات لازم است کاری کنید که هندلرهای گزارش‌گیری (logging handlers) کار خود را بدون مسدود کردن نخی که از آن گزارش‌گیری می‌کنید، انجام دهند. این حالت در برنامه‌های وب رایج است، هرچند البته در " +"سناریوهای دیگر نیز رخ می‌دهد." -msgid "A common culprit which demonstrates sluggish behaviour is the :class:`SMTPHandler`: sending emails can take a long time, for a number of reasons outside the developer's control (for example, a poorly performing mail or network infrastructure). But almost any network-based handler can block: Even a :class:`SocketHandler` operation may do a DNS query under the hood which is too slow (and this query can be deep in the socket library code, below the Python layer, and outside your control)." +msgid "" +"A common culprit which demonstrates sluggish behaviour is the :class:`SMTPHandler`: sending emails can take a long time, for a number of reasons outside the developer's control (for example, a " +"poorly performing mail or network infrastructure). But almost any network-based handler can block: Even a :class:`SocketHandler` operation may do a DNS query under the hood which is too slow (and " +"this query can be deep in the socket library code, below the Python layer, and outside your control)." msgstr "" +"یکی از عوامل رایج که رفتار کندی از خود نشان می‌دهد، :class:`SMTPHandler` است: ارسال ایمیل‌ها ممکن است به دلایل متعددی خارج از کنترل توسعه‌دهنده زمان زیادی ببرد (برای مثال، زیرساخت ایمیل یا شبکه با " +"عملکرد ضعیف). اما تقریباً هر هندلر مبتنی بر شبکه‌ای می‌تواند مسدودکننده باشد: حتی یک عملیات :class:`SocketHandler` ممکن است در پشت صحنه یک پرس‌وجوی DNS انجام دهد که بیش از حد کند است (و این پرس‌وجو " +"می‌تواند در عمق کد کتابخانه سوکت، پایین‌تر از لایه پایتون و خارج از کنترل شما باشد)." -msgid "One solution is to use a two-part approach. For the first part, attach only a :class:`QueueHandler` to those loggers which are accessed from performance-critical threads. They simply write to their queue, which can be sized to a large enough capacity or initialized with no upper bound to their size. The write to the queue will typically be accepted quickly, though you will probably need to catch the :exc:`queue.Full` exception as a precaution in your code. If you are a library developer who has performance-critical threads in their code, be sure to document this (together with a suggestion to attach only ``QueueHandlers`` to your loggers) for the benefit of other developers who will use your code." +msgid "" +"One solution is to use a two-part approach. For the first part, attach only a :class:`QueueHandler` to those loggers which are accessed from performance-critical threads. They simply write to " +"their queue, which can be sized to a large enough capacity or initialized with no upper bound to their size. The write to the queue will typically be accepted quickly, though you will probably " +"need to catch the :exc:`queue.Full` exception as a precaution in your code. If you are a library developer who has performance-critical threads in their code, be sure to document this (together " +"with a suggestion to attach only ``QueueHandlers`` to your loggers) for the benefit of other developers who will use your code." msgstr "" +"یک راه‌حل، استفاده از یک رویکرد دوبخشی است. برای بخش نخست، فقط یک :class:`QueueHandler` را به آن دسته از ثبت‌کننده‌های گزارش (loggers) که از نخ‌های حساس به عملکرد به آن‌ها دسترسی می‌شود، متصل کنید. " +"آن‌ها به‌سادگی در صف خود می‌نویسند؛ صفی که می‌توان آن را با ظرفیتی به‌اندازه کافی بزرگ تنظیم کرد یا بدون کران بالا برای اندازه‌اش مقداردهی اولیه کرد. نوشتن در صف معمولاً به‌سرعت پذیرفته می‌شود، هرچند " +"احتمالاً لازم است استثنای :exc:`queue.Full` را به‌عنوان اقدام احتیاطی در کد خود مهار کنید. اگر توسعه‌دهنده کتابخانه هستید و نخ‌های حساس به عملکرد در کد خود دارید، حتماً این موضوع را (به‌همراه پیشنهادی " +"مبنی بر اینکه فقط ``QueueHandlers`` را به ثبت‌کننده‌های گزارش شما متصل کنند) برای بهره‌مندی سایر توسعه‌دهندگانی که از کد شما استفاده خواهند کرد، مستند کنید." -msgid "The second part of the solution is :class:`QueueListener`, which has been designed as the counterpart to :class:`QueueHandler`. A :class:`QueueListener` is very simple: it's passed a queue and some handlers, and it fires up an internal thread which listens to its queue for LogRecords sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that matter). The ``LogRecords`` are removed from the queue and passed to the handlers for processing." +msgid "" +"The second part of the solution is :class:`QueueListener`, which has been designed as the counterpart to :class:`QueueHandler`. A :class:`QueueListener` is very simple: it's passed a queue and " +"some handlers, and it fires up an internal thread which listens to its queue for LogRecords sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that matter). The " +"``LogRecords`` are removed from the queue and passed to the handlers for processing." msgstr "" +"بخش دوم راه‌حل :class:`QueueListener` است که به‌عنوان همتای :class:`QueueHandler` طراحی شده است. یک :class:`QueueListener` بسیار ساده است: یک صف و چند هندلر به آن داده می‌شود و آن یک نخ داخلی " +"راه‌اندازی می‌کند که به صف خود برای دریافت LogRecords ارسال‌شده از ``QueueHandlers`` (یا هر منبع دیگری از ``LogRecords``، در این خصوص) گوش می‌دهد. ``LogRecords`` از صف حذف می‌شوند و برای پردازش به " +"هندلرها داده می‌شوند." -msgid "The advantage of having a separate :class:`QueueListener` class is that you can use the same instance to service multiple ``QueueHandlers``. This is more resource-friendly than, say, having threaded versions of the existing handler classes, which would eat up one thread per handler for no particular benefit." +msgid "" +"The advantage of having a separate :class:`QueueListener` class is that you can use the same instance to service multiple ``QueueHandlers``. This is more resource-friendly than, say, having " +"threaded versions of the existing handler classes, which would eat up one thread per handler for no particular benefit." msgstr "" +"مزیت داشتن یک کلاس :class:`QueueListener` جداگانه این است که می‌توانید از یک نمونه‌ی واحد برای سرویس‌دهی به چندین ``QueueHandlers`` استفاده کنید. این کار از نظر مصرف منابع به‌صرفه‌تر از، مثلاً، داشتن " +"نسخه‌های مبتنی بر نخ از کلاس‌های هندلر (handler) موجود است؛ نسخه‌هایی که به ازای هر handler یک نخ را بدون هیچ مزیت خاصی مصرف می‌کردند." msgid "An example of using these two classes follows (imports omitted)::" -msgstr "" +msgstr "در ادامه مثالی از استفاده از این دو کلاس آمده است (ایمپورت‌ها حذف شده‌اند)::" msgid "" "que = queue.Queue(-1) # no limit on size\n" @@ -594,21 +1026,47 @@ msgid "" "root.warning('Look out!')\n" "listener.stop()" msgstr "" +"que = queue.Queue(-1) # بدون محدودیت در اندازه\n" +"queue_handler = QueueHandler(que)\n" +"handler = logging.StreamHandler()\n" +"listener = QueueListener(que, handler)\n" +"root = logging.getLogger()\n" +"root.addHandler(queue_handler)\n" +"formatter = logging.Formatter('%(threadName)s: %(message)s')\n" +"handler.setFormatter(formatter)\n" +"listener.start()\n" +"# خروجی گزارش، نخی را که رویداد را تولید کرده است (نخ اصلی)\n" +"# نمایش می‌دهد، نه نخ داخلی که صف داخلی را پایش می‌کند.\n" +"# این همان چیزی است که می‌خواهید اتفاق بیفتد.\n" +"root.warning('Look out!')\n" +"listener.stop()" msgid "which, when run, will produce:" -msgstr "" +msgstr "که با اجرای آن، خروجی زیر تولید می‌شود:" msgid "MainThread: Look out!" -msgstr "" +msgstr "MainThread: مراقب باشید!" -msgid "Although the earlier discussion wasn't specifically talking about async code, but rather about slow logging handlers, it should be noted that when logging from async code, network and even file handlers could lead to problems (blocking the event loop) because some logging is done from :mod:`asyncio` internals. It might be best, if any async code is used in an application, to use the above approach for logging, so that any blocking code runs only in the ``QueueListener`` thread." +msgid "" +"Although the earlier discussion wasn't specifically talking about async code, but rather about slow logging handlers, it should be noted that when logging from async code, network and even file " +"handlers could lead to problems (blocking the event loop) because some logging is done from :mod:`asyncio` internals. It might be best, if any async code is used in an application, to use the " +"above approach for logging, so that any blocking code runs only in the ``QueueListener`` thread." msgstr "" +"اگرچه بحث پیشین به‌طور مشخص درباره‌ی کد ناهمگام نبود، بلکه درباره‌ی هندلرهای کند گزارش‌گیری بود، باید توجه داشت که هنگام گزارش‌گیری از کد ناهمگام، هندلرهای شبکه و حتی فایل می‌توانند به مشکلاتی " +"منجر شوند (مسدود کردن حلقه‌ی رویداد)، زیرا بخشی از گزارش‌گیری از درونی :mod:`asyncio` انجام می‌شود. اگر در یک برنامه از هرگونه کد ناهمگام استفاده می‌شود، ممکن است بهتر باشد برای گزارش‌گیری از روش بالا " +"استفاده کنید، تا هر کد مسدودکننده‌ای فقط در نخ ``QueueListener`` اجرا شود." -msgid "Prior to Python 3.5, the :class:`QueueListener` always passed every message received from the queue to every handler it was initialized with. (This was because it was assumed that level filtering was all done on the other side, where the queue is filled.) From 3.5 onwards, this behaviour can be changed by passing a keyword argument ``respect_handler_level=True`` to the listener's constructor. When this is done, the listener compares the level of each message with the handler's level, and only passes a message to a handler if it's appropriate to do so." +msgid "" +"Prior to Python 3.5, the :class:`QueueListener` always passed every message received from the queue to every handler it was initialized with. (This was because it was assumed that level filtering " +"was all done on the other side, where the queue is filled.) From 3.5 onwards, this behaviour can be changed by passing a keyword argument ``respect_handler_level=True`` to the listener's " +"constructor. When this is done, the listener compares the level of each message with the handler's level, and only passes a message to a handler if it's appropriate to do so." msgstr "" +"پیش از پایتون 3.5، :class:`QueueListener` همیشه هر پیام دریافت‌شده از صف را به هر مدیر (handler) که شنونده با آن مقداردهی اولیه شده بود، ارسال می‌کرد. (این به این دلیل بود که فرض می‌شد تمام پالایش " +"سطح در سمت دیگر، جایی که صف پر می‌شود، انجام می‌شود.) از 3.5 به بعد، می‌توان این رفتار را با ارسال یک آرگومان کلیدواژه‌ای ``respect_handler_level=True`` به سازنده‌ی شنونده تغییر داد. هنگامی که این کار " +"انجام شود، شنونده سطح هر پیام را با سطح مدیر مقایسه می‌کند و تنها در صورتی یک پیام را به یک مدیر ارسال می‌کند که این کار مناسب باشد." msgid "The :class:`QueueListener` can be started (and stopped) via the :keyword:`with` statement. For example:" -msgstr "" +msgstr "می‌توان :class:`QueueListener` را از طریق دستور :keyword:`with` راه‌اندازی (و متوقف) کرد. برای مثال:" msgid "" "with QueueListener(que, handler) as listener:\n" @@ -618,12 +1076,22 @@ msgid "" "# The queue listener automatically stops once\n" "# the 'with' block is exited." msgstr "" +"with QueueListener(que, handler) as listener:\n" +" # شنونده صف به‌طور خودکار هنگام ورود به بلوک 'with'\n" +" # آغاز می‌شود.\n" +" pass\n" +"# شنونده صف به‌طور خودکار پس از خروج از بلوک 'with'\n" +"# متوقف می‌شود." msgid "Sending and receiving logging events across a network" -msgstr "" +msgstr "ارسال و دریافت رویدادهای گزارش در سراسر شبکه" -msgid "Let's say you want to send logging events across a network, and handle them at the receiving end. A simple way of doing this is attaching a :class:`SocketHandler` instance to the root logger at the sending end::" +msgid "" +"Let's say you want to send logging events across a network, and handle them at the receiving end. A simple way of doing this is attaching a :class:`SocketHandler` instance to the root logger at " +"the sending end::" msgstr "" +"فرض کنید می‌خواهید رویدادهای گزارش را از طریق شبکه ارسال کنید و آن‌ها را در سمت دریافت‌کننده پردازش کنید. یک راه ساده برای انجام این کار، اتصال یک نمونه از :class:`SocketHandler` به گزارش‌گیر ریشه در سمت " +"فرستنده است::" msgid "" "import logging, logging.handlers\n" @@ -650,9 +1118,32 @@ msgid "" "logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" "logger2.error('The five boxing wizards jump quickly.')" msgstr "" +"import logging, logging.handlers\n" +"\n" +"rootLogger = logging.getLogger()\n" +"rootLogger.setLevel(logging.DEBUG)\n" +"socketHandler = logging.handlers.SocketHandler('localhost',\n" +" logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" +"# don't bother with a formatter, since a socket handler sends the event as\n" +"# an unformatted pickle\n" +"rootLogger.addHandler(socketHandler)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" msgid "At the receiving end, you can set up a receiver using the :mod:`socketserver` module. Here is a basic working example::" -msgstr "" +msgstr "در سمت دریافت، می‌توانید با استفاده از ماژول :mod:`socketserver` یک گیرنده راه‌اندازی کنید. در ادامه یک مثال پایه‌ی کارآمد آمده است::" msgid "" "import pickle\n" @@ -740,129 +1231,264 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" - -msgid "First run the server, and then the client. On the client side, nothing is printed on the console; on the server side, you should see something like:" -msgstr "" - -msgid "" -"About to start TCP server...\n" -" 59 root INFO Jackdaws love my big sphinx of quartz.\n" -" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" -" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" -" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" -" 69 myapp.area2 ERROR The five boxing wizards jump quickly." -msgstr "" - -msgid "Note that there are some security issues with pickle in some scenarios. If these affect you, you can use an alternative serialization scheme by overriding the :meth:`~SocketHandler.makePickle` method and implementing your alternative there, as well as adapting the above script to use your alternative serialization." -msgstr "" - -msgid "Running a logging socket listener in production" -msgstr "" - -msgid "To run a logging listener in production, you may need to use a process-management tool such as `Supervisor `_. `Here is a Gist `__ which provides the bare-bones files to run the above functionality using Supervisor. It consists of the following files:" -msgstr "" - -msgid "File" -msgstr "" - -msgid "Purpose" -msgstr "" - -msgid ":file:`prepare.sh`" -msgstr "" - -msgid "A Bash script to prepare the environment for testing" -msgstr "" - -msgid ":file:`supervisor.conf`" -msgstr "" - -msgid "The Supervisor configuration file, which has entries for the listener and a multi-process web application" -msgstr "" - -msgid ":file:`ensure_app.sh`" -msgstr "" - -msgid "A Bash script to ensure that Supervisor is running with the above configuration" -msgstr "" - -msgid ":file:`log_listener.py`" -msgstr "" - -msgid "The socket listener program which receives log events and records them to a file" -msgstr "" - -msgid ":file:`main.py`" -msgstr "" - -msgid "A simple web application which performs logging via a socket connected to the listener" -msgstr "" - -msgid ":file:`webapp.json`" -msgstr "" - -msgid "A JSON configuration file for the web application" -msgstr "" - -msgid ":file:`client.py`" -msgstr "" - -msgid "A Python script to exercise the web application" -msgstr "" - -msgid "The web application uses `Gunicorn `_, which is a popular web application server that starts multiple worker processes to handle requests. This example setup shows how the workers can write to the same log file without conflicting with one another --- they all go through the socket listener." -msgstr "" - -msgid "To test these files, do the following in a POSIX environment:" +"import pickle\n" +"import logging\n" +"import logging.handlers\n" +"import socketserver\n" +"import struct\n" +"\n" +"\n" +"class LogRecordStreamHandler(socketserver.StreamRequestHandler):\n" +" \"\"\"هندلر (Handler) برای یک درخواست گزارش‌گیری جریانی.\n" +"\n" +" این کلاس اساساً رکورد را با استفاده از هر سیاست گزارش‌گیری که به‌صورت محلی\n" +" پیکربندی‌شده است، ثبت می‌کند.\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" \"\"\"\n" +" به چندین درخواست رسیدگی می‌کند - انتظار می‌رود هر کدام شامل یک طول ۴ بایتی باشد\n" +" که پس از آن LogRecord در قالب pickle می‌آید. رکورد را مطابق هر سیاستی که\n" +" به‌صورت محلی پیکربندی‌شده است، ثبت می‌کند.\n" +" \"\"\"\n" +" while True:\n" +" chunk = self.connection.recv(4)\n" +" if len(chunk) < 4:\n" +" break\n" +" slen = struct.unpack('>L', chunk)[0]\n" +" chunk = self.connection.recv(slen)\n" +" while len(chunk) < slen:\n" +" chunk = chunk + self.connection.recv(slen - len(chunk))\n" +" obj = self.unPickle(chunk)\n" +" record = logging.makeLogRecord(obj)\n" +" self.handleLogRecord(record)\n" +"\n" +" def unPickle(self, data):\n" +" return pickle.loads(data)\n" +"\n" +" def handleLogRecord(self, record):\n" +" # اگر یک نام مشخص شده باشد، از گزارش‌گیر نام‌گذاری‌شده به‌جای موردی\n" +" # که توسط رکورد تلویحاً مشخص شده است، استفاده می‌کنیم.\n" +" if self.server.logname is not None:\n" +" name = self.server.logname\n" +" else:\n" +" name = record.name\n" +" logger = logging.getLogger(name)\n" +" # توجه: همه رکوردها ثبت می‌شوند. دلیل این است که Logger.handle\n" +" # معمولاً پس از فیلتر کردن در سطح گزارش‌گیر فراخوانی می‌شود. اگر\n" +" # می‌خواهید فیلتر کردن انجام دهید، آن را در سمت کارخواه انجام دهید تا از\n" +" # هدر رفتن چرخه‌های پردازش و پهنای باند شبکه جلوگیری شود!\n" +" logger.handle(record)\n" +"\n" +"class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):\n" +" \"\"\"\n" +" دریافت‌کننده ساده گزارش‌گیری مبتنی بر سوکت TCP که برای آزمایش مناسب است.\n" +" \"\"\"\n" +"\n" +" allow_reuse_address = True\n" +"\n" +" def __init__(self, host='localhost',\n" +" port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,\n" +" handler=LogRecordStreamHandler):\n" +" socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)\n" +" self.abort = 0\n" +" self.timeout = 1\n" +" self.logname = None\n" +"\n" +" def serve_until_stopped(self):\n" +" import select\n" +" abort = 0\n" +" while not abort:\n" +" rd, wr, ex = select.select([self.socket.fileno()],\n" +" [], [],\n" +" self.timeout)\n" +" if rd:\n" +" self.handle_request()\n" +" abort = self.abort\n" +"\n" +"def main():\n" +" logging.basicConfig(\n" +" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s %(message)s')\n" +" tcpserver = LogRecordSocketReceiver()\n" +" print('About to start TCP server...')\n" +" tcpserver.serve_until_stopped()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" + +msgid "First run the server, and then the client. On the client side, nothing is printed on the console; on the server side, you should see something like:" +msgstr "ابتدا سرور و سپس کلاینت را اجرا کنید. در سمت کلاینت، هیچ چیزی در کنسول چاپ نمی‌شود؛ در سمت سرور، باید چیزی شبیه به این ببینید:" + +msgid "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." msgstr "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." -msgid "Download `the Gist `__ as a ZIP archive using the :guilabel:`Download ZIP` button." +msgid "" +"Note that there are some security issues with pickle in some scenarios. If these affect you, you can use an alternative serialization scheme by overriding the :meth:`~SocketHandler.makePickle` " +"method and implementing your alternative there, as well as adapting the above script to use your alternative serialization." msgstr "" +"توجه داشته باشید که استفاده از pickle در برخی حالت‌ها دارای مسائل امنیتی است. اگر این مسائل شما را تحت تأثیر قرار می‌دهند، می‌توانید با بازنویسی متد :meth:`~SocketHandler.makePickle` و پیاده‌سازی روش " +"جایگزین خود در آن، و همچنین تطبیق اسکریپت بالا برای استفاده از سریال‌سازی جایگزین خود، از یک روش سریال‌سازی جایگزین استفاده کنید." -msgid "Unzip the above files from the archive into a scratch directory." +msgid "Running a logging socket listener in production" +msgstr "اجرای یک شنونده‌ی سوکت گزارش‌گیری در محیط عملیاتی" + +msgid "" +"To run a logging listener in production, you may need to use a process-management tool such as `Supervisor `_. `Here is a Gist `__ which provides " +"the bare-bones files to run the above functionality using Supervisor. It consists of the following files:" msgstr "" +"برای اجرای یک شنونده‌ی گزارش‌گیری در محیط عملیاتی، ممکن است لازم باشد از یک ابزار مدیریت فرایند مانند `Supervisor `_ استفاده کنید. `در اینجا یک Gist `__ ارائه شده است که فایل‌های پایه را برای اجرای قابلیت فوق با استفاده از Supervisor فراهم می‌کند. این مجموعه شامل فایل‌های زیر است:" + +msgid "File" +msgstr "فایل" -msgid "In the scratch directory, run ``bash prepare.sh`` to get things ready. This creates a :file:`run` subdirectory to contain Supervisor-related and log files, and a :file:`venv` subdirectory to contain a virtual environment into which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." +msgid "Purpose" +msgstr "هدف" + +msgid ":file:`prepare.sh`" +msgstr ":file:`prepare.sh`" + +msgid "A Bash script to prepare the environment for testing" +msgstr "یک اسکریپت Bash برای آماده‌سازی محیط جهت آزمون" + +msgid ":file:`supervisor.conf`" +msgstr ":file:`supervisor.conf`" + +msgid "The Supervisor configuration file, which has entries for the listener and a multi-process web application" +msgstr "فایل پیکربندی Supervisor، که دارای مدخل‌هایی برای شنونده (listener) و یک برنامه وب چندفرایندی است" + +msgid ":file:`ensure_app.sh`" +msgstr ":file:`ensure_app.sh`" + +msgid "A Bash script to ensure that Supervisor is running with the above configuration" +msgstr "یک اسکریپت Bash برای اطمینان از اینکه Supervisor با پیکربندی بالا در حال اجرا است" + +msgid ":file:`log_listener.py`" +msgstr ":file:`log_listener.py`" + +msgid "The socket listener program which receives log events and records them to a file" +msgstr "برنامه‌ی شنونده سوکت که رویدادهای گزارش را دریافت می‌کند و آن‌ها را در یک فایل ثبت می‌کند" + +msgid ":file:`main.py`" +msgstr ":file:`main.py`" + +msgid "A simple web application which performs logging via a socket connected to the listener" +msgstr "یک برنامه وب ساده که گزارش‌گیری را از طریق سوکتی متصل به شنونده انجام می‌دهد" + +msgid ":file:`webapp.json`" +msgstr ":file:`webapp.json`" + +msgid "A JSON configuration file for the web application" +msgstr "یک پرونده‌ی پیکربندی JSON برای برنامه‌ی وب" + +msgid ":file:`client.py`" +msgstr ":file:`client.py`" + +msgid "A Python script to exercise the web application" +msgstr "یک اسکریپت پایتونی برای آزمودن وب‌اپلیکیشن" + +msgid "" +"The web application uses `Gunicorn `_, which is a popular web application server that starts multiple worker processes to handle requests. This example setup shows how the " +"workers can write to the same log file without conflicting with one another --- they all go through the socket listener." msgstr "" +"برنامه کاربردی وب از `Gunicorn `_ استفاده می‌کند، که سرور برنامه کاربردی وب محبوبی است و چند فرایند کارگر (worker process) را برای رسیدگی به درخواست‌ها راه‌اندازی می‌کند. این " +"پیکربندی نمونه نشان می‌دهد که کارگرها چگونه می‌توانند بدون تداخل با یکدیگر در یک فایل گزارش مشترک بنویسند --- همه‌ی آن‌ها از طریق شنونده‌ی سوکت (socket listener) عبور می‌کنند." -msgid "Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the above configuration." +msgid "To test these files, do the following in a POSIX environment:" +msgstr "برای آزمایش این فایل‌ها، در یک محیط POSIX موارد زیر را انجام دهید:" + +msgid "Download `the Gist `__ as a ZIP archive using the :guilabel:`Download ZIP` button." +msgstr "`the Gist `__ را با استفاده از دکمه‌ی :guilabel:`Download ZIP` به‌صورت یک آرشیو ZIP دانلود کنید." + +msgid "Unzip the above files from the archive into a scratch directory." +msgstr "فایل‌های بالا را از بایگانی به یک پوشه موقت استخراج کنید." + +msgid "" +"In the scratch directory, run ``bash prepare.sh`` to get things ready. This creates a :file:`run` subdirectory to contain Supervisor-related and log files, and a :file:`venv` subdirectory to " +"contain a virtual environment into which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." msgstr "" +"در پوشه‌ی scratch، دستور ``bash prepare.sh`` را برای آماده‌سازی اجرا کنید. این دستور یک زیرپوشه‌ی :file:`run` برای نگهداری فایل‌های مربوط به Supervisor و فایل‌های گزارش، و یک زیرپوشه‌ی :file:`venv` " +"برای نگهداری یک محیط مجازی ایجاد می‌کند که ``bottle``، ``gunicorn`` و ``supervisor`` در آن نصب می‌شوند." + +msgid "Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the above configuration." +msgstr "برای اطمینان از اینکه Supervisor با پیکربندی بالا در حال اجرا است، ``bash ensure_app.sh`` را اجرا کنید." msgid "Run ``venv/bin/python client.py`` to exercise the web application, which will lead to records being written to the log." -msgstr "" +msgstr "برای آزمایش برنامه وب، ``venv/bin/python client.py`` را اجرا کنید، که منجر به نوشته شدن رکوردها در گزارش می‌شود." -msgid "Inspect the log files in the :file:`run` subdirectory. You should see the most recent log lines in files matching the pattern :file:`app.log*`. They won't be in any particular order, since they have been handled concurrently by different worker processes in a non-deterministic way." +msgid "" +"Inspect the log files in the :file:`run` subdirectory. You should see the most recent log lines in files matching the pattern :file:`app.log*`. They won't be in any particular order, since they " +"have been handled concurrently by different worker processes in a non-deterministic way." msgstr "" +"فایل‌های گزارش را در زیرپوشه‌ی :file:`run` بررسی کنید. شما باید جدیدترین خط‌های گزارش را در فایل‌هایی که با الگوی :file:`app.log*` مطابقت دارند ببینید. این خط‌ها در هیچ ترتیب خاصی نخواهند بود، زیرا " +"به‌صورت همزمان توسط فرآیندهای کارگر مختلف به‌شکلی غیرقطعی پردازش شده‌اند." msgid "You can shut down the listener and the web application by running ``venv/bin/supervisorctl -c supervisor.conf shutdown``." -msgstr "" +msgstr "شما می‌توانید با اجرای ``venv/bin/supervisorctl -c supervisor.conf shutdown``، شنونده و برنامه کاربردی وب را خاموش کنید." msgid "You may need to tweak the configuration files in the unlikely event that the configured ports clash with something else in your test environment." -msgstr "" +msgstr "ممکن است لازم باشد فایل‌های پیکربندی را تنظیم کنید، در صورتی که، هرچند بعید، پورت‌های پیکربندی‌شده با مورد دیگری در محیط آزمایشی شما تداخل داشته باشند." msgid "The default configuration uses a TCP socket on port 9020. You can use a Unix Domain socket instead of a TCP socket by doing the following:" -msgstr "" +msgstr "پیکربندی پیش‌فرض از یک سوکت TCP روی پورت ۹۰۲۰ استفاده می‌کند. شما می‌توانید با انجام موارد زیر به‌جای سوکت TCP از یک سوکت دامنه یونیکس استفاده کنید:" -msgid "In :file:`listener.json`, add a ``socket`` key with the path to the domain socket you want to use. If this key is present, the listener listens on the corresponding domain socket and not on a TCP socket (the ``port`` key is ignored)." +msgid "" +"In :file:`listener.json`, add a ``socket`` key with the path to the domain socket you want to use. If this key is present, the listener listens on the corresponding domain socket and not on a TCP " +"socket (the ``port`` key is ignored)." msgstr "" +"در :file:`listener.json`، یک کلید ``socket`` همراه با مسیر سوکت دامنه (domain socket) که می‌خواهید از آن استفاده کنید، اضافه کنید. اگر این کلید وجود داشته باشد، شنونده روی سوکت دامنه مربوطه گوش " +"می‌دهد و روی سوکت TCP گوش نمی‌دهد (کلید ``port`` نادیده گرفته می‌شود)." msgid "In :file:`webapp.json`, change the socket handler configuration dictionary so that the ``host`` value is the path to the domain socket, and set the ``port`` value to ``null``." -msgstr "" +msgstr "در :file:`webapp.json`، دیکشنری پیکربندی هندلری سوکت (socket handler) را تغییر دهید تا مقدار ``host`` مسیر سوکت دامنه (domain socket) باشد و مقدار ``port`` را روی ``null`` تنظیم کنید." msgid "Adding contextual information to your logging output" -msgstr "" +msgstr "افزودن اطلاعات زمینه‌ای به خروجی گزارش شما" -msgid "Sometimes you want logging output to contain contextual information in addition to the parameters passed to the logging call. For example, in a networked application, it may be desirable to log client-specific information in the log (e.g. remote client's username, or IP address). Although you could use the *extra* parameter to achieve this, it's not always convenient to pass the information in this way. While it might be tempting to create :class:`Logger` instances on a per-connection basis, this is not a good idea because these instances are not garbage collected. While this is not a problem in practice, when the number of :class:`Logger` instances is dependent on the level of granularity you want to use in logging an application, it could be hard to manage if the number of :class:`Logger` instances becomes effectively unbounded." +msgid "" +"Sometimes you want logging output to contain contextual information in addition to the parameters passed to the logging call. For example, in a networked application, it may be desirable to log " +"client-specific information in the log (e.g. remote client's username, or IP address). Although you could use the *extra* parameter to achieve this, it's not always convenient to pass the " +"information in this way. While it might be tempting to create :class:`Logger` instances on a per-connection basis, this is not a good idea because these instances are not garbage collected. While " +"this is not a problem in practice, when the number of :class:`Logger` instances is dependent on the level of granularity you want to use in logging an application, it could be hard to manage if " +"the number of :class:`Logger` instances becomes effectively unbounded." msgstr "" +"گاهی می‌خواهید خروجی گزارش علاوه بر پارامترهای ارسال‌شده به فراخوانی گزارش، حاوی اطلاعات زمینه‌ای باشد. برای مثال، در یک برنامه شبکه‌ای، ممکن است مطلوب باشد که اطلاعات مختص کلاینت در گزارش ثبت شود (مثلاً " +"نام کاربری کلاینت راه دور یا نشانی IP). اگرچه می‌توانید برای دستیابی به این هدف از پارامتر *extra* استفاده کنید، اما ارسال اطلاعات به این روش همیشه آسان نیست. هرچند ممکن است ایجاد " +"نمونه‌های :class:`Logger` به‌ازای هر اتصال وسوسه‌انگیز باشد، اما این کار ایده خوبی نیست؛ زیرا این نمونه‌ها زباله‌روبی نمی‌شوند. هرچند این موضوع در عمل مشکلی ایجاد نمی‌کند، اما وقتی تعداد " +"نمونه‌های :class:`Logger` به سطح دانه‌بندی‌ای وابسته باشد که می‌خواهید هنگام گزارش کردن یک برنامه از آن استفاده کنید، اگر تعداد نمونه‌های :class:`Logger` عملاً بی‌کران شود، مدیریت آن می‌تواند دشوار باشد." msgid "Using LoggerAdapters to impart contextual information" -msgstr "" +msgstr "استفاده از LoggerAdapters برای انتقال اطلاعات زمینه‌ای" -msgid "An easy way in which you can pass contextual information to be output along with logging event information is to use the :class:`LoggerAdapter` class. This class is designed to look like a :class:`Logger`, so that you can call :meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`, :meth:`exception`, :meth:`critical` and :meth:`log`. These methods have the same signatures as their counterparts in :class:`Logger`, so you can use the two types of instances interchangeably." +msgid "" +"An easy way in which you can pass contextual information to be output along with logging event information is to use the :class:`LoggerAdapter` class. This class is designed to look like " +"a :class:`Logger`, so that you can call :meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`, :meth:`exception`, :meth:`critical` and :meth:`log`. These methods have the same signatures as " +"their counterparts in :class:`Logger`, so you can use the two types of instances interchangeably." msgstr "" +"راهی آسان برای ارسال اطلاعات زمینه‌ای تا همراه با اطلاعات رویداد گزارش خروجی داده شود، استفاده از کلاس :class:`LoggerAdapter` است. این کلاس به‌گونه‌ای طراحی شده است که شبیه یک :class:`Logger` به نظر " +"برسد، به‌طوری که شما می‌توانید :meth:`debug`، :meth:`info`، :meth:`warning`، :meth:`error`، :meth:`exception`، :meth:`critical` و :meth:`log` را فراخوانی کنید. این متدها امضاهای یکسانی با همتایان " +"خود در :class:`Logger` دارند، بنابراین می‌توانید از نمونه‌های این دو نوع به‌جای یکدیگر استفاده کنید." -msgid "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:`Logger` instance and a dict-like object which contains your contextual information. When you call one of the logging methods on an instance of :class:`LoggerAdapter`, it delegates the call to the underlying instance of :class:`Logger` passed to its constructor, and arranges to pass the contextual information in the delegated call. Here's a snippet from the code of :class:`LoggerAdapter`::" +msgid "" +"When you create an instance of :class:`LoggerAdapter`, you pass it a :class:`Logger` instance and a dict-like object which contains your contextual information. When you call one of the logging " +"methods on an instance of :class:`LoggerAdapter`, it delegates the call to the underlying instance of :class:`Logger` passed to its constructor, and arranges to pass the contextual information in " +"the delegated call. Here's a snippet from the code of :class:`LoggerAdapter`::" msgstr "" +"هنگامی که یک نمونه از :class:`LoggerAdapter` ایجاد می‌کنید، به آن یک نمونه از :class:`Logger` و یک شیء دیکشنری‌مانند که حاوی اطلاعات زمینه‌ای شما است می‌دهید. هنگامی که یکی از متدهای گزارش‌برداری را روی " +"یک نمونه از :class:`LoggerAdapter` فراخوانی می‌کنید، آن فراخوانی را به نمونه زیرین :class:`Logger` که به سازنده‌اش داده شده است واگذار می‌کند و ترتیبی می‌دهد که اطلاعات زمینه‌ای در فراخوانی واگذارشده " +"ارسال شود. در ادامه قطعه‌ای از کد :class:`LoggerAdapter` آمده است::" msgid "" "def debug(self, msg, /, *args, **kwargs):\n" @@ -873,12 +1499,32 @@ msgid "" " msg, kwargs = self.process(msg, kwargs)\n" " self.logger.debug(msg, *args, **kwargs)" msgstr "" +"def debug(self, msg, /, *args, **kwargs):\n" +" \"\"\"\n" +" یک فراخوانی debug را پس از افزودن اطلاعات زمینه‌ای از این نمونه‌ی آداپتور،\n" +" به گزارش‌گیر زیرین محول می‌کند.\n" +" \"\"\"\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.debug(msg, *args, **kwargs)" -msgid "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where the contextual information is added to the logging output. It's passed the message and keyword arguments of the logging call, and it passes back (potentially) modified versions of these to use in the call to the underlying logger. The default implementation of this method leaves the message alone, but inserts an 'extra' key in the keyword argument whose value is the dict-like object passed to the constructor. Of course, if you had passed an 'extra' keyword argument in the call to the adapter, it will be silently overwritten." +msgid "" +"The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where the contextual information is added to the logging output. It's passed the message and keyword arguments of the " +"logging call, and it passes back (potentially) modified versions of these to use in the call to the underlying logger. The default implementation of this method leaves the message alone, but " +"inserts an 'extra' key in the keyword argument whose value is the dict-like object passed to the constructor. Of course, if you had passed an 'extra' keyword argument in the call to the adapter, " +"it will be silently overwritten." msgstr "" +"متد :meth:`~LoggerAdapter.process` در کلاس :class:`LoggerAdapter` جایی است که اطلاعات زمینه‌ای به خروجی گزارش افزوده می‌شود. پیام و آرگومان‌های کلیدواژه‌ای فراخوانی گزارش به آن داده می‌شوند، و این متد " +"نسخه‌های (احتمالاً) تغییریافته‌ی آن‌ها را برای استفاده در فراخوانی گزارش‌گیر زیربنایی بازمی‌گرداند. پیاده‌سازی پیش‌فرض این متد، پیام را دست‌نخورده باقی می‌گذارد، اما یک کلید 'extra' در آرگومان کلیدواژه‌ای درج " +"می‌کند که مقدار آن شیء دیکشنری‌مانندی است که به سازنده داده شده است. البته، اگر در فراخوانی آداپتور یک آرگومان کلیدواژه‌ای 'extra' داده باشید، بدون هشدار بازنویسی خواهد شد." -msgid "The advantage of using 'extra' is that the values in the dict-like object are merged into the :class:`LogRecord` instance's __dict__, allowing you to use customized strings with your :class:`Formatter` instances which know about the keys of the dict-like object. If you need a different method, e.g. if you want to prepend or append the contextual information to the message string, you just need to subclass :class:`LoggerAdapter` and override :meth:`~LoggerAdapter.process` to do what you need. Here is a simple example::" +msgid "" +"The advantage of using 'extra' is that the values in the dict-like object are merged into the :class:`LogRecord` instance's __dict__, allowing you to use customized strings with " +"your :class:`Formatter` instances which know about the keys of the dict-like object. If you need a different method, e.g. if you want to prepend or append the contextual information to the " +"message string, you just need to subclass :class:`LoggerAdapter` and override :meth:`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" +"مزیت استفاده از 'extra' این است که مقادیر موجود در شیء دیکشنری‌مانند در __dict__ نمونه‌ی :class:`LogRecord` ادغام می‌شوند، بنابراین می‌توانید از رشته‌های سفارشی همراه با نمونه‌های :class:`Formatter` " +"خود استفاده کنید که از کلیدهای شیء دیکشنری‌مانند آگاه هستند. اگر به متد متفاوتی نیاز دارید، برای مثال اگر می‌خواهید اطلاعات زمینه‌ای را به ابتدای رشته پیام اضافه کنید یا به انتهای آن بیفزایید، کافی " +"است یک زیرکلاس از :class:`LoggerAdapter` بسازید و :meth:`~LoggerAdapter.process` را بازنویسی کنید تا آنچه نیاز دارید انجام شود. در ادامه یک مثال ساده آمده است::" msgid "" "class CustomAdapter(logging.LoggerAdapter):\n" @@ -889,32 +1535,55 @@ msgid "" " def process(self, msg, kwargs):\n" " return '[%s] %s' % (self.extra['connid'], msg), kwargs" msgstr "" +"class CustomAdapter(logging.LoggerAdapter):\n" +" \"\"\"\n" +" این آداپتور نمونه انتظار دارد شیء دیکشنری‌مانندِ ارسال‌شده دارای کلید 'connid' باشد،\n" +" که مقدار آن داخل کروشه به ابتدای پیام گزارش اضافه می‌شود.\n" +" \"\"\"\n" +" def process(self, msg, kwargs):\n" +" return '[%s] %s' % (self.extra['connid'], msg), kwargs" msgid "which you can use like this::" -msgstr "" +msgstr "که می‌توانید به این شکل استفاده کنید::" msgid "" "logger = logging.getLogger(__name__)\n" "adapter = CustomAdapter(logger, {'connid': some_conn_id})" msgstr "" +"logger = logging.getLogger(__name__)\n" +"adapter = CustomAdapter(logger, {'connid': some_conn_id})" msgid "Then any events that you log to the adapter will have the value of ``some_conn_id`` prepended to the log messages." -msgstr "" +msgstr "سپس برای هر رویدادی که در آداپتور ثبت کنید، مقدار ``some_conn_id`` به ابتدای پیام‌های گزارش اضافه می‌شود." msgid "Using objects other than dicts to pass contextual information" -msgstr "" +msgstr "استفاده از اشیایی غیر از دیکشنری‌ها برای انتقال اطلاعات زمینه‌ای" -msgid "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you could pass an instance of a class which implements ``__getitem__`` and ``__iter__`` so that it looks like a dict to logging. This would be useful if you want to generate values dynamically (whereas the values in a dict would be constant)." +msgid "" +"You don't need to pass an actual dict to a :class:`LoggerAdapter` - you could pass an instance of a class which implements ``__getitem__`` and ``__iter__`` so that it looks like a dict to " +"logging. This would be useful if you want to generate values dynamically (whereas the values in a dict would be constant)." msgstr "" +"شما نیازی به ارسال یک دیکشنری واقعی به :class:`LoggerAdapter` ندارید؛ می‌توانید نمونه‌ای از کلاسی که ``__getitem__`` و ``__iter__`` را پیاده‌سازی می‌کند ارسال کنید، به‌طوری که از نظر logging شبیه یک " +"دیکشنری به نظر برسد. این در صورتی مفید است که بخواهید مقادیر را به‌صورت پویا تولید کنید (در حالی که مقادیر در یک دیکشنری ثابت خواهند بود)." msgid "Using Filters to impart contextual information" -msgstr "" +msgstr "استفاده از فیلترها برای انتقال اطلاعات زمینه‌ای" -msgid "You can also add contextual information to log output using a user-defined :class:`Filter`. ``Filter`` instances are allowed to modify the ``LogRecords`` passed to them, including adding additional attributes which can then be output using a suitable format string, or if needed a custom :class:`Formatter`." +msgid "" +"You can also add contextual information to log output using a user-defined :class:`Filter`. ``Filter`` instances are allowed to modify the ``LogRecords`` passed to them, including adding " +"additional attributes which can then be output using a suitable format string, or if needed a custom :class:`Formatter`." msgstr "" +"شما همچنین می‌توانید اطلاعات زمینه‌ای را با استفاده از یک :class:`Filter` تعریف‌شده توسط کاربر به خروجی گزارش اضافه کنید. نمونه‌های ``Filter`` مجازند ``LogRecords`` های ارسال‌شده به خود را تغییر دهند، " +"از جمله افزودن ویژگی‌های اضافی که سپس می‌توان آن‌ها را با استفاده از یک رشته قالب مناسب خروجی داد، یا در صورت نیاز با یک :class:`Formatter` سفارشی." -msgid "For example in a web application, the request being processed (or at least, the interesting parts of it) can be stored in a threadlocal (:class:`threading.local`) variable, and then accessed from a ``Filter`` to add, say, information from the request - say, the remote IP address and remote user's username - to the ``LogRecord``, using the attribute names 'ip' and 'user' as in the ``LoggerAdapter`` example above. In that case, the same format string can be used to get similar output to that shown above. Here's an example script::" +msgid "" +"For example in a web application, the request being processed (or at least, the interesting parts of it) can be stored in a threadlocal (:class:`threading.local`) variable, and then accessed from " +"a ``Filter`` to add, say, information from the request - say, the remote IP address and remote user's username - to the ``LogRecord``, using the attribute names 'ip' and 'user' as in the " +"``LoggerAdapter`` example above. In that case, the same format string can be used to get similar output to that shown above. Here's an example script::" msgstr "" +"برای مثال در یک برنامه وب، می‌توان درخواست در حال پردازش (یا حداقل بخش‌های جالب‌توجه آن) را در یک متغیر محلی نخ (threadlocal، :class:`threading.local`) ذخیره کرد و سپس از یک ``Filter`` به آن دسترسی " +"پیدا کرد تا مثلاً اطلاعاتی از درخواست — مثلاً نشانی IP راه‌دور و نام کاربری کاربر راه‌دور — با استفاده از نام ویژگی‌های 'ip' و 'user'، همان‌طور که در مثال ``LoggerAdapter`` بالا نشان داده شد، به " +"``LogRecord`` اضافه شود. در این صورت، می‌توان از همان رشته قالب برای گرفتن خروجی مشابه آنچه در بالا نشان داده شد استفاده کرد. در ادامه یک اسکریپت نمونه آمده است::" msgid "" "import logging\n" @@ -954,9 +1623,45 @@ msgid "" " lvlname = logging.getLevelName(lvl)\n" " a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters')" msgstr "" +"import logging\n" +"from random import choice\n" +"\n" +"class ContextFilter(logging.Filter):\n" +" \"\"\"\n" +" This is a filter which injects contextual information into the log.\n" +"\n" +" Rather than use actual contextual information, we just use random\n" +" data in this demo.\n" +" \"\"\"\n" +"\n" +" USERS = ['jim', 'fred', 'sheila']\n" +" IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']\n" +"\n" +" def filter(self, record):\n" +"\n" +" record.ip = choice(ContextFilter.IPS)\n" +" record.user = choice(ContextFilter.USERS)\n" +" return True\n" +"\n" +"if __name__ == '__main__':\n" +" levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)\n" +" logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s')\n" +" a1 = logging.getLogger('a.b.c')\n" +" a2 = logging.getLogger('d.e.f')\n" +"\n" +" f = ContextFilter()\n" +" a1.addFilter(f)\n" +" a2.addFilter(f)\n" +" a1.debug('A debug message')\n" +" a1.info('An info message with %s', 'some parameters')\n" +" for x in range(10):\n" +" lvl = choice(levels)\n" +" lvlname = logging.getLevelName(lvl)\n" +" a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters')" msgid "which, when run, produces something like:" -msgstr "" +msgstr "که هنگام اجرا، چیزی شبیه به این تولید می‌کند:" msgid "" "2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A debug message\n" @@ -972,18 +1677,42 @@ msgid "" "2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A message at DEBUG level with 2 parameters\n" "2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A message at INFO level with 2 parameters" msgstr "" +"2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A debug message\n" +"2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An info message with some parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A message at INFO level with 2 parameters" msgid "Use of ``contextvars``" -msgstr "" +msgstr "استفاده از ``contextvars``" -msgid "Since Python 3.7, the :mod:`contextvars` module has provided context-local storage which works for both :mod:`threading` and :mod:`asyncio` processing needs. This type of storage may thus be generally preferable to thread-locals. The following example shows how, in a multi-threaded environment, logs can populated with contextual information such as, for example, request attributes handled by web applications." +msgid "" +"Since Python 3.7, the :mod:`contextvars` module has provided context-local storage which works for both :mod:`threading` and :mod:`asyncio` processing needs. This type of storage may thus be " +"generally preferable to thread-locals. The following example shows how, in a multi-threaded environment, logs can populated with contextual information such as, for example, request attributes " +"handled by web applications." msgstr "" +"از پایتون 3.7، ماژول :mod:`contextvars` ذخیره‌سازی محلی در زمینه (context-local storage) را فراهم کرده است که برای نیازهای پردازشی هر دو :mod:`threading` و :mod:`asyncio` به کار می‌رود. بنابراین، " +"این نوع ذخیره‌سازی ممکن است عموماً به متغیرهای نخ‌محلی (thread-locals) ترجیح داده شود. مثال زیر نشان می‌دهد که در یک محیط چندنخی، چگونه می‌توان گزارش‌ها را با اطلاعات زمینه‌ای پر کرد، از جمله، برای " +"مثال، با ویژگی‌های درخواستی که توسط برنامه‌های وب مدیریت می‌شوند." -msgid "For the purposes of illustration, say that you have different web applications, each independent of the other but running in the same Python process and using a library common to them. How can each of these applications have their own log, where all logging messages from the library (and other request processing code) are directed to the appropriate application's log file, while including in the log additional contextual information such as client IP, HTTP request method and client username?" +msgid "" +"For the purposes of illustration, say that you have different web applications, each independent of the other but running in the same Python process and using a library common to them. How can " +"each of these applications have their own log, where all logging messages from the library (and other request processing code) are directed to the appropriate application's log file, while " +"including in the log additional contextual information such as client IP, HTTP request method and client username?" msgstr "" +"برای روشن‌تر شدن موضوع، فرض کنید چند برنامه‌ی وب مختلف دارید که هرکدام مستقل از دیگری هستند، اما در یک فرایند پایتون مشترک اجرا می‌شوند و از یک کتابخانه‌ی مشترک میان آن‌ها استفاده می‌کنند. چگونه هرکدام " +"از این برنامه‌ها می‌توانند گزارش مستقل خود را داشته باشند، به‌طوری‌که تمام پیام‌های گزارش‌دهی از کتابخانه (و سایر کدهای پردازش درخواست) به فایل گزارش برنامه‌ی مربوطه هدایت شوند و در عین حال اطلاعات " +"زمینه‌ای بیشتری مانند IP کلاینت، متد درخواست HTTP و نام کاربری کلاینت نیز در گزارش گنجانده شود؟" msgid "Let's assume that the library can be simulated by the following code:" -msgstr "" +msgstr "فرض کنید که کتابخانه را می‌توان با کد زیر شبیه‌سازی کرد:" msgid "" "# webapplib.py\n" @@ -998,9 +1727,23 @@ msgid "" " # Just sleep for a bit so other threads get to run\n" " time.sleep(0.01)" msgstr "" +"# webapplib.py\n" +"import logging\n" +"import time\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def useful():\n" +" # Just a representative event logged from the library\n" +" logger.debug('Hello from webapplib!')\n" +" # Just sleep for a bit so other threads get to run\n" +" time.sleep(0.01)" -msgid "We can simulate the multiple web applications by means of two simple classes, ``Request`` and ``WebApp``. These simulate how real threaded web applications work - each request is handled by a thread:" +msgid "" +"We can simulate the multiple web applications by means of two simple classes, ``Request`` and ``WebApp``. These simulate how real threaded web applications work - each request is handled by a " +"thread:" msgstr "" +"ما می‌توانیم چندین برنامه‌ی وب را به‌وسیله‌ی دو کلاس ساده، ``Request`` و ``WebApp`` شبیه‌سازی کنیم. این‌ها چگونگی کار برنامه‌های وب نخی واقعی را شبیه‌سازی می‌کنند - هر درخواست توسط یک نخ رسیدگی می‌شود:" msgid "" "# main.py\n" @@ -1141,28 +1884,171 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" - -msgid "If you run the above, you should find that roughly half the requests go into :file:`app1.log` and the rest into :file:`app2.log`, and the all the requests are logged to :file:`app.log`. Each webapp-specific log will contain only log entries for only that webapp, and the request information will be displayed consistently in the log (i.e. the information in each dummy request will always appear together in a log line). This is illustrated by the following shell output:" -msgstr "" - -msgid "" -"~/logging-contextual-webapp$ python main.py\n" -"app1 processed 51 requests\n" -"app2 processed 49 requests\n" -"~/logging-contextual-webapp$ wc -l *.log\n" -" 153 app1.log\n" -" 147 app2.log\n" -" 300 app.log\n" -" 600 total\n" -"~/logging-contextual-webapp$ head -3 app1.log\n" -"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" -"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello from webapplib!\n" -"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" -"~/logging-contextual-webapp$ head -3 app2.log\n" -"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request processing started\n" -"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello from webapplib!\n" -"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request processing started\n" -"~/logging-contextual-webapp$ head app.log\n" +"# main.py\n" +"import argparse\n" +"from contextvars import ContextVar\n" +"import logging\n" +"import os\n" +"from random import choice\n" +"import threading\n" +"import webapplib\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.DEBUG)\n" +"\n" +"class Request:\n" +" \"\"\"\n" +" A simple dummy request class which just holds dummy HTTP request method,\n" +" client IP address and client username\n" +" \"\"\"\n" +" def __init__(self, method, ip, user):\n" +" self.method = method\n" +" self.ip = ip\n" +" self.user = user\n" +"\n" +"# A dummy set of requests which will be used in the simulation - we'll just pick\n" +"# from this list randomly. Note that all GET requests are from 192.168.2.XXX\n" +"# addresses, whereas POST requests are from 192.16.3.XXX addresses. Three users\n" +"# are represented in the sample requests.\n" +"\n" +"REQUESTS = [\n" +" Request('GET', '192.168.2.20', 'jim'),\n" +" Request('POST', '192.168.3.20', 'fred'),\n" +" Request('GET', '192.168.2.21', 'sheila'),\n" +" Request('POST', '192.168.3.21', 'jim'),\n" +" Request('GET', '192.168.2.22', 'fred'),\n" +" Request('POST', '192.168.3.22', 'sheila'),\n" +"]\n" +"\n" +"# Note that the format string includes references to request context information\n" +"# such as HTTP method, client IP and username\n" +"\n" +"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s %(user)-6s %(ip)s %(method)-4s %(message)s')\n" +"\n" +"# Create our context variables. These will be filled at the start of request\n" +"# processing, and used in the logging that happens during that processing\n" +"\n" +"ctx_request = ContextVar('request')\n" +"ctx_appname = ContextVar('appname')\n" +"\n" +"class InjectingFilter(logging.Filter):\n" +" \"\"\"\n" +" A filter which injects context-specific information into logs and ensures\n" +" that only information for a specific webapp is included in its log\n" +" \"\"\"\n" +" def __init__(self, app):\n" +" self.app = app\n" +"\n" +" def filter(self, record):\n" +" request = ctx_request.get()\n" +" record.method = request.method\n" +" record.ip = request.ip\n" +" record.user = request.user\n" +" record.appName = appName = ctx_appname.get()\n" +" return appName == self.app.name\n" +"\n" +"class WebApp:\n" +" \"\"\"\n" +" A dummy web application class which has its own handler and filter for a\n" +" webapp-specific log.\n" +" \"\"\"\n" +" def __init__(self, name):\n" +" self.name = name\n" +" handler = logging.FileHandler(name + '.log', 'w')\n" +" f = InjectingFilter(self)\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(f)\n" +" root.addHandler(handler)\n" +" self.num_requests = 0\n" +"\n" +" def process_request(self, request):\n" +" \"\"\"\n" +" This is the dummy method for processing a request. It's called on a\n" +" different thread for every request. We store the context information into\n" +" the context vars before doing anything else.\n" +" \"\"\"\n" +" ctx_request.set(request)\n" +" ctx_appname.set(self.name)\n" +" self.num_requests += 1\n" +" logger.debug('Request processing started')\n" +" webapplib.useful()\n" +" logger.debug('Request processing finished')\n" +"\n" +"def main():\n" +" fn = os.path.splitext(os.path.basename(__file__))[0]\n" +" adhf = argparse.ArgumentDefaultsHelpFormatter\n" +" ap = argparse.ArgumentParser(formatter_class=adhf, prog=fn,\n" +" description='Simulate a couple of web '\n" +" 'applications handling some '\n" +" 'requests, showing how request '\n" +" 'context can be used to '\n" +" 'populate logs')\n" +" aa = ap.add_argument\n" +" aa('--count', '-c', type=int, default=100, help='How many requests to simulate')\n" +" options = ap.parse_args()\n" +"\n" +" # Create the dummy webapps and put them in a list which we can use to select\n" +" # from randomly\n" +" app1 = WebApp('app1')\n" +" app2 = WebApp('app2')\n" +" apps = [app1, app2]\n" +" threads = []\n" +" # Add a common handler which will capture all events\n" +" handler = logging.FileHandler('app.log', 'w')\n" +" handler.setFormatter(formatter)\n" +" root.addHandler(handler)\n" +"\n" +" # Generate calls to process requests\n" +" for i in range(options.count):\n" +" try:\n" +" # Pick an app at random and a request for it to process\n" +" app = choice(apps)\n" +" request = choice(REQUESTS)\n" +" # Process the request in its own thread\n" +" t = threading.Thread(target=app.process_request, args=(request,))\n" +" threads.append(t)\n" +" t.start()\n" +" except KeyboardInterrupt:\n" +" break\n" +"\n" +" # Wait for the threads to terminate\n" +" for t in threads:\n" +" t.join()\n" +"\n" +" for app in apps:\n" +" print('%s processed %s requests' % (app.name, app.num_requests))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" + +msgid "" +"If you run the above, you should find that roughly half the requests go into :file:`app1.log` and the rest into :file:`app2.log`, and the all the requests are logged to :file:`app.log`. Each " +"webapp-specific log will contain only log entries for only that webapp, and the request information will be displayed consistently in the log (i.e. the information in each dummy request will " +"always appear together in a log line). This is illustrated by the following shell output:" +msgstr "" +"اگر مورد بالا را اجرا کنید، باید ببینید که تقریباً نیمی از درخواست‌ها به :file:`app1.log` و بقیه به :file:`app2.log` می‌روند و همه‌ی درخواست‌ها در :file:`app.log` ثبت می‌شوند. هر گزارش مختص وب‌اپلیکیشن " +"فقط شامل ورودی‌های گزارش همان وب‌اپلیکیشن خواهد بود و اطلاعات درخواست به‌صورت یکنواخت در گزارش نمایش داده خواهد شد (یعنی اطلاعات هر درخواست ساختگی همیشه با هم در یک خط گزارش ظاهر خواهد شد). این " +"موضوع در خروجی پوسته‌ی زیر نشان داده شده است:" + +msgid "" +"~/logging-contextual-webapp$ python main.py\n" +"app1 processed 51 requests\n" +"app2 processed 49 requests\n" +"~/logging-contextual-webapp$ wc -l *.log\n" +" 153 app1.log\n" +" 147 app2.log\n" +" 300 app.log\n" +" 600 total\n" +"~/logging-contextual-webapp$ head -3 app1.log\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello from webapplib!\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"~/logging-contextual-webapp$ head -3 app2.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request processing started\n" +"~/logging-contextual-webapp$ head app.log\n" "Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request processing started\n" "Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello from webapplib!\n" "Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request processing started\n" @@ -1182,12 +2068,51 @@ msgid "" "~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" "147" msgstr "" +"~/logging-contextual-webapp$ python main.py\n" +"app1 processed 51 requests\n" +"app2 processed 49 requests\n" +"~/logging-contextual-webapp$ wc -l *.log\n" +" 153 app1.log\n" +" 147 app2.log\n" +" 300 app.log\n" +" 600 total\n" +"~/logging-contextual-webapp$ head -3 app1.log\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello from webapplib!\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"~/logging-contextual-webapp$ head -3 app2.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request processing started\n" +"~/logging-contextual-webapp$ head app.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request processing started\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"Thread-2 (process_request) app2 webapplib jim 192.168.2.20 GET Hello from webapplib!\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello from webapplib!\n" +"Thread-4 (process_request) app2 __main__ fred 192.168.2.22 GET Request processing started\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"Thread-4 (process_request) app2 webapplib fred 192.168.2.22 GET Hello from webapplib!\n" +"Thread-6 (process_request) app1 __main__ jim 192.168.3.21 POST Request processing started\n" +"~/logging-contextual-webapp$ grep app1 app1.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app2.log | wc -l\n" +"147\n" +"~/logging-contextual-webapp$ grep app1 app.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" +"147" msgid "Imparting contextual information in handlers" -msgstr "" +msgstr "انتقال اطلاعات زمینه‌ای در هندلرها" -msgid "Each :class:`~Handler` has its own chain of filters. If you want to add contextual information to a :class:`LogRecord` without leaking it to other handlers, you can use a filter that returns a new :class:`~LogRecord` instead of modifying it in-place, as shown in the following script::" +msgid "" +"Each :class:`~Handler` has its own chain of filters. If you want to add contextual information to a :class:`LogRecord` without leaking it to other handlers, you can use a filter that returns a " +"new :class:`~LogRecord` instead of modifying it in-place, as shown in the following script::" msgstr "" +"هر :class:`~Handler` زنجیره‌ای از فیلترهای خاص خود دارد. اگر می‌خواهید اطلاعات زمینه‌ای را به یک :class:`LogRecord` اضافه کنید، بدون نشت این اطلاعات به سایر handlerها، می‌توانید از فیلتری استفاده " +"کنید که به‌جای تغییر آن به‌صورت درجا، یک :class:`~LogRecord` جدید را برمی‌گرداند، همان‌طور که در اسکریپت زیر نشان داده شده است::" msgid "" "import copy\n" @@ -1209,18 +2134,58 @@ msgid "" "\n" " logger.info('A log message')" msgstr "" +"import copy\n" +"import logging\n" +"\n" +"def filter(record: logging.LogRecord):\n" +" record = copy.copy(record)\n" +" record.user = 'jim'\n" +" return record\n" +"\n" +"if __name__ == '__main__':\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.INFO)\n" +" handler = logging.StreamHandler()\n" +" formatter = logging.Formatter('%(message)s from %(user)-8s')\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(filter)\n" +" logger.addHandler(handler)\n" +"\n" +" logger.info('A log message')" msgid "Logging to a single file from multiple processes" -msgstr "" +msgstr "گزارش‌گیری در یک فایل واحد از چندین فرآیند" -msgid "Although logging is thread-safe, and logging to a single file from multiple threads in a single process *is* supported, logging to a single file from *multiple processes* is *not* supported, because there is no standard way to serialize access to a single file across multiple processes in Python. If you need to log to a single file from multiple processes, one way of doing this is to have all the processes log to a :class:`~handlers.SocketHandler`, and have a separate process which implements a socket server which reads from the socket and logs to file. (If you prefer, you can dedicate one thread in one of the existing processes to perform this function.) :ref:`This section ` documents this approach in more detail and includes a working socket receiver which can be used as a starting point for you to adapt in your own applications." -msgstr "" +msgid "" +"Although logging is thread-safe, and logging to a single file from multiple threads in a single process *is* supported, logging to a single file from *multiple processes* is *not* supported, " +"because there is no standard way to serialize access to a single file across multiple processes in Python. If you need to log to a single file from multiple processes, one way of doing this is to " +"have all the processes log to a :class:`~handlers.SocketHandler`, and have a separate process which implements a socket server which reads from the socket and logs to file. (If you prefer, you " +"can dedicate one thread in one of the existing processes to perform this function.) :ref:`This section ` documents this approach in more detail and includes a working socket " +"receiver which can be used as a starting point for you to adapt in your own applications." +msgstr "" +"اگرچه گزارش‌گیری ایمن نسبت به نخ است، و از گزارش‌گیری در یک فایل واحد از چندین نخ در یک فرآیند واحد پشتیبانی *می‌شود*، اما از گزارش‌گیری در یک فایل واحد از *چندین فرآیند* پشتیبانی *نمی‌شود*، زیرا هیچ " +"روش استانداردی برای سریال‌سازی دسترسی به یک فایل واحد در میان چندین فرآیند در پایتون وجود ندارد. اگر نیاز دارید وقایع را از چندین فرآیند در یک فایل واحد ثبت کنید، یکی از راه‌های انجام این کار این " +"است که همه فرآیندها وقایع را به یک :class:`~handlers.SocketHandler` ارسال کنند و فرآیند جداگانه‌ای وجود داشته باشد که یک سرور سوکت را پیاده‌سازی کند تا از سوکت بخواند و وقایع را در فایل ثبت کند. " +"(اگر ترجیح می‌دهید، می‌توانید یک نخ در یکی از فرآیندهای موجود را به انجام این وظیفه اختصاص دهید.) :ref:`این بخش ` این روش را با جزئیات بیشتر مستند می‌کند و شامل یک گیرنده سوکت " +"کاربردی است که می‌توانید از آن به‌عنوان نقطه شروعی برای تطبیق دادن در برنامه‌های خودتان استفاده کنید." -msgid "You could also write your own handler which uses the :class:`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to serialize access to the file from your processes. The stdlib :class:`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." +msgid "" +"You could also write your own handler which uses the :class:`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to serialize access to the file from your processes. The " +"stdlib :class:`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" +"همچنین می‌توانید هندلر (handler) اختصاصی خودتان را بنویسید که از کلاس :class:`~multiprocessing.Lock` در ماژول :mod:`multiprocessing` برای سریال‌سازی (serialize) دسترسی فرآیندهای شما به فایل " +"استفاده کند. :class:`FileHandler` و زیرکلاس‌های آن در کتابخانه‌ی استاندارد از :mod:`multiprocessing` استفاده نمی‌کنند." -msgid "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send all logging events to one of the processes in your multi-process application. The following example script demonstrates how you can do this; in the example a separate listener process listens for events sent by other processes and logs them according to its own logging configuration. Although the example only demonstrates one way of doing it (for example, you may want to use a listener thread rather than a separate listener process -- the implementation would be analogous) it does allow for completely different logging configurations for the listener and the other processes in your application, and can be used as the basis for code meeting your own specific requirements::" +msgid "" +"Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send all logging events to one of the processes in your multi-process application. The following example script demonstrates " +"how you can do this; in the example a separate listener process listens for events sent by other processes and logs them according to its own logging configuration. Although the example only " +"demonstrates one way of doing it (for example, you may want to use a listener thread rather than a separate listener process -- the implementation would be analogous) it does allow for completely " +"different logging configurations for the listener and the other processes in your application, and can be used as the basis for code meeting your own specific requirements::" msgstr "" +"به‌عنوان جایگزین، می‌توانید از یک ``Queue`` و یک :class:`QueueHandler` برای ارسال همه‌ی رویدادهای گزارش به یکی از فرایندهای برنامه‌ی چندفرایندی خود استفاده کنید. اسکریپت نمونه‌ی زیر نشان می‌دهد که چگونه " +"می‌توانید این کار را انجام دهید؛ در این نمونه، یک فرایند شنونده‌ی جداگانه به رویدادهای ارسال‌شده توسط فرایندهای دیگر گوش می‌دهد و آن‌ها را مطابق پیکربندی گزارش خود ثبت می‌کند. اگرچه این نمونه تنها یک روش " +"برای انجام این کار را نشان می‌دهد (برای مثال، ممکن است بخواهید به‌جای یک فرایند شنونده‌ی جداگانه از یک نخ شنونده استفاده کنید -- پیاده‌سازی آن مشابه خواهد بود)، اما امکان استفاده از پیکربندی‌های گزارش " +"کاملاً متفاوت برای شنونده و سایر فرایندهای برنامه‌ی شما را فراهم می‌کند و می‌تواند به‌عنوان پایه‌ای برای کدی که نیازمندی‌های خاص شما را برآورده می‌کند استفاده شود::" msgid "" "# You'll need these imports in your own code\n" @@ -1328,41 +2293,145 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" - -msgid "A variant of the above script keeps the logging in the main process, in a separate thread::" -msgstr "" - -msgid "" +"# You'll need these imports in your own code\n" "import logging\n" -"import logging.config\n" "import logging.handlers\n" -"from multiprocessing import Process, Queue\n" -"import random\n" -"import threading\n" -"import time\n" -"\n" -"def logger_thread(q):\n" -" while True:\n" -" record = q.get()\n" -" if record is None:\n" -" break\n" -" logger = logging.getLogger(record.name)\n" -" logger.handle(record)\n" -"\n" +"import multiprocessing\n" "\n" -"def worker_process(q):\n" -" qh = logging.handlers.QueueHandler(q)\n" -" root = logging.getLogger()\n" -" root.setLevel(logging.DEBUG)\n" -" root.addHandler(qh)\n" -" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" -" logging.CRITICAL]\n" -" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" -" 'spam', 'spam.ham', 'spam.ham.eggs']\n" -" for i in range(100):\n" -" lvl = random.choice(levels)\n" -" logger = logging.getLogger(random.choice(loggers))\n" -" logger.log(lvl, 'Message no. %d', i)\n" +"# Next two import lines for this demo only\n" +"from random import choice, random\n" +"import time\n" +"\n" +"#\n" +"# Because you'll want to define the logging configurations for listener and workers, the\n" +"# listener and worker process functions take a configurer parameter which is a callable\n" +"# for configuring logging for that process. These functions are also passed the queue,\n" +"# which they use for communication.\n" +"#\n" +"# In practice, you can configure the listener however you want, but note that in this\n" +"# simple example, the listener does not apply level or filter logic to received records.\n" +"# In practice, you would probably want to do this logic in the worker processes, to avoid\n" +"# sending events which would be filtered out between processes.\n" +"#\n" +"# The size of the rotated files is made small so you can see the results easily.\n" +"def listener_configurer():\n" +" root = logging.getLogger()\n" +" h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" +" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s %(levelname)-8s %(message)s')\n" +" h.setFormatter(f)\n" +" root.addHandler(h)\n" +"\n" +"# This is the listener process top-level loop: wait for logging events\n" +"# (LogRecords)on the queue and handle them, quit when you get a None for a\n" +"# LogRecord.\n" +"def listener_process(queue, configurer):\n" +" configurer()\n" +" while True:\n" +" try:\n" +" record = queue.get()\n" +" if record is None: # We send this as a sentinel to tell the listener to quit.\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record) # No level or filter logic applied - just do it!\n" +" except Exception:\n" +" import sys, traceback\n" +" print('Whoops! Problem:', file=sys.stderr)\n" +" traceback.print_exc(file=sys.stderr)\n" +"\n" +"# Arrays used for random selections in this demo\n" +"\n" +"LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,\n" +" logging.ERROR, logging.CRITICAL]\n" +"\n" +"LOGGERS = ['a.b.c', 'd.e.f']\n" +"\n" +"MESSAGES = [\n" +" 'Random message #1',\n" +" 'Random message #2',\n" +" 'Random message #3',\n" +"]\n" +"\n" +"# The worker configuration is done at the start of the worker process run.\n" +"# Note that on Windows you can't rely on fork semantics, so each process\n" +"# will run the logging configuration code when it starts.\n" +"def worker_configurer(queue):\n" +" h = logging.handlers.QueueHandler(queue) # Just the one handler needed\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # send all messages, for demo; no other level or filter logic applied.\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"# This is the worker process top-level loop, which just logs ten events with\n" +"# random intervening delays before terminating.\n" +"# The print messages are just so you know it's doing something!\n" +"def worker_process(queue, configurer):\n" +" configurer(queue)\n" +" name = multiprocessing.current_process().name\n" +" print('Worker started: %s' % name)\n" +" for i in range(10):\n" +" time.sleep(random())\n" +" logger = logging.getLogger(choice(LOGGERS))\n" +" level = choice(LEVELS)\n" +" message = choice(MESSAGES)\n" +" logger.log(level, message)\n" +" print('Worker finished: %s' % name)\n" +"\n" +"# Here's where the demo gets orchestrated. Create the queue, create and start\n" +"# the listener, create ten workers and start them, wait for them to finish,\n" +"# then send a None to the queue to tell the listener to finish.\n" +"def main():\n" +" queue = multiprocessing.Queue(-1)\n" +" listener = multiprocessing.Process(target=listener_process,\n" +" args=(queue, listener_configurer))\n" +" listener.start()\n" +" workers = []\n" +" for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +" for w in workers:\n" +" w.join()\n" +" queue.put_nowait(None)\n" +" listener.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" + +msgid "A variant of the above script keeps the logging in the main process, in a separate thread::" +msgstr "گونه‌ای از اسکریپت بالا، گزارش‌گیری (logging) را در فرایند اصلی و در نخی جداگانه نگه می‌دارد::" + +msgid "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue\n" +"import random\n" +"import threading\n" +"import time\n" +"\n" +"def logger_thread(q):\n" +" while True:\n" +" record = q.get()\n" +" if record is None:\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record)\n" +"\n" +"\n" +"def worker_process(q):\n" +" qh = logging.handlers.QueueHandler(q)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(qh)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" "\n" "if __name__ == '__main__':\n" " q = Queue()\n" @@ -1425,27 +2494,124 @@ msgid "" " q.put(None)\n" " lp.join()" msgstr "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue\n" +"import random\n" +"import threading\n" +"import time\n" +"\n" +"def logger_thread(q):\n" +" while True:\n" +" record = q.get()\n" +" if record is None:\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record)\n" +"\n" +"\n" +"def worker_process(q):\n" +" qh = logging.handlers.QueueHandler(q)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(qh)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +"\n" +"if __name__ == '__main__':\n" +" q = Queue()\n" +" d = {\n" +" 'version': 1,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s %(processName)-10s %(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO',\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'level': 'ERROR',\n" +" 'formatter': 'detailed',\n" +" },\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console', 'file', 'errors']\n" +" },\n" +" }\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1), args=(q,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logging.config.dictConfig(d)\n" +" lp = threading.Thread(target=logger_thread, args=(q,))\n" +" lp.start()\n" +" # At this point, the main process could do some useful work of its own\n" +" # Once it's done that, it can wait for the workers to terminate...\n" +" for wp in workers:\n" +" wp.join()\n" +" # And now tell the logging thread to finish up, too\n" +" q.put(None)\n" +" lp.join()" -msgid "This variant shows how you can e.g. apply configuration for particular loggers - e.g. the ``foo`` logger has a special handler which stores all events in the ``foo`` subsystem in a file ``mplog-foo.log``. This will be used by the logging machinery in the main process (even though the logging events are generated in the worker processes) to direct the messages to the appropriate destinations." +msgid "" +"This variant shows how you can e.g. apply configuration for particular loggers - e.g. the ``foo`` logger has a special handler which stores all events in the ``foo`` subsystem in a file ``mplog-" +"foo.log``. This will be used by the logging machinery in the main process (even though the logging events are generated in the worker processes) to direct the messages to the appropriate " +"destinations." msgstr "" +"این گونه نشان می‌دهد که چگونه می‌توانید برای مثال پیکربندی را برای گزارش‌گیرهای خاص (logger) اعمال کنید؛ برای مثال، گزارش‌گیر ``foo`` یک هندلر (handler) ویژه دارد که همه رویدادهای زیرسیستم ``foo`` " +"(subsystem) را در یک فایل ``mplog-foo.log`` ذخیره می‌کند. این مورد توسط سازوکار گزارش‌گیری (logging machinery) در فرایند اصلی استفاده خواهد شد (اگرچه رویدادهای گزارش‌گیری در فرایندهای کارگر تولید " +"می‌شوند) تا پیام‌ها را به مقصدهای مناسب هدایت کند." msgid "Using concurrent.futures.ProcessPoolExecutor" -msgstr "" +msgstr "استفاده از concurrent.futures.ProcessPoolExecutor" msgid "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start your worker processes, you need to create the queue slightly differently. Instead of" -msgstr "" +msgstr "اگر می‌خواهید از :class:`concurrent.futures.ProcessPoolExecutor` برای راه‌اندازی فرایندهای کارگر خود استفاده کنید، باید صف را به‌شکل کمی متفاوتی ایجاد کنید. به جای" msgid "queue = multiprocessing.Queue(-1)" -msgstr "" +msgstr "queue = multiprocessing.Queue(-1)" msgid "you should use" -msgstr "" +msgstr "شما باید استفاده کنید" msgid "queue = multiprocessing.Manager().Queue(-1) # also works with the examples above" -msgstr "" +msgstr "queue = multiprocessing.Manager().Queue(-1) # همچنین با مثال‌های بالا کار می‌کند" msgid "and you can then replace the worker creation from this::" -msgstr "" +msgstr "و سپس می‌توانید ایجادگر worker را از این بخش جایگزین کنید:" msgid "" "workers = []\n" @@ -1457,27 +2623,49 @@ msgid "" "for w in workers:\n" " w.join()" msgstr "" +"workers = []\n" +"for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +"for w in workers:\n" +" w.join()" msgid "to this (remembering to first import :mod:`concurrent.futures`)::" -msgstr "" +msgstr "به این (به یاد داشته باشید که ابتدا :mod:`concurrent.futures` را ایمپورت کنید)::" msgid "" "with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" " for i in range(10):\n" " executor.submit(worker_process, queue, worker_configurer)" msgstr "" +"with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" +" for i in range(10):\n" +" executor.submit(worker_process, queue, worker_configurer)" msgid "Deploying web applications using Gunicorn and uWSGI" -msgstr "" +msgstr "استقرار برنامه‌های وب با استفاده از Gunicorn و uWSGI" -msgid "When deploying web applications using `Gunicorn `_ or `uWSGI `_ (or similar), multiple worker processes are created to handle client requests. In such environments, avoid creating file-based handlers directly in your web application. Instead, use a :class:`SocketHandler` to log from the web application to a listener in a separate process. This can be set up using a process management tool such as Supervisor - see `Running a logging socket listener in production`_ for more details." +msgid "" +"When deploying web applications using `Gunicorn `_ or `uWSGI `_ (or similar), multiple worker processes are created to handle " +"client requests. In such environments, avoid creating file-based handlers directly in your web application. Instead, use a :class:`SocketHandler` to log from the web application to a listener in " +"a separate process. This can be set up using a process management tool such as Supervisor - see `Running a logging socket listener in production`_ for more details." msgstr "" +"هنگام استقرار برنامه‌های کاربردی وب با استفاده از `Gunicorn `_ یا `uWSGI `_ (یا مشابه آن‌ها)، چندین فرایند کارگر برای رسیدگی به " +"درخواست‌های کلاینت ایجاد می‌شود. در چنین محیط‌هایی، از ایجاد هندلرهای مبتنی بر فایل به‌صورت مستقیم در برنامه کاربردی وب خودداری کنید. در عوض، برای ارسال رویدادها از برنامه کاربردی وب به یک شنونده در " +"یک فرایند جداگانه، از یک :class:`SocketHandler` استفاده کنید. این کار را می‌توان با استفاده از یک ابزار مدیریت فرایند مانند Supervisor راه‌اندازی کرد؛ برای جزئیات بیشتر `Running a logging socket " +"listener in production`_ را ببینید." msgid "Using file rotation" -msgstr "" +msgstr "استفاده از چرخش فایل" -msgid "Sometimes you want to let a log file grow to a certain size, then open a new file and log to that. You may want to keep a certain number of these files, and when that many files have been created, rotate the files so that the number of files and the size of the files both remain bounded. For this usage pattern, the logging package provides a :class:`RotatingFileHandler`::" +msgid "" +"Sometimes you want to let a log file grow to a certain size, then open a new file and log to that. You may want to keep a certain number of these files, and when that many files have been " +"created, rotate the files so that the number of files and the size of the files both remain bounded. For this usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" +"گاهی می‌خواهید اجازه دهید یک فایل گزارش تا اندازه‌ای مشخص رشد کند، سپس فایل جدیدی باز کنید و گزارش‌ها را در آن ثبت کنید. ممکن است بخواهید تعداد مشخصی از این فایل‌ها را نگه دارید و وقتی آن تعداد فایل " +"ایجاد شده باشد، فایل‌ها را بچرخانید تا هم تعداد فایل‌ها و هم اندازه‌ی فایل‌ها محدود باقی بمانند. برای این الگوی استفاده، بسته‌ی logging یک :class:`RotatingFileHandler` ارائه می‌دهد::" msgid "" "import glob\n" @@ -1506,33 +2694,80 @@ msgid "" "for filename in logfiles:\n" " print(filename)" msgstr "" +"import glob\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"LOG_FILENAME = 'logging_rotatingfile_example.out'\n" +"\n" +"# Set up a specific logger with our desired output level\n" +"my_logger = logging.getLogger('MyLogger')\n" +"my_logger.setLevel(logging.DEBUG)\n" +"\n" +"# Add the log message handler to the logger\n" +"handler = logging.handlers.RotatingFileHandler(\n" +" LOG_FILENAME, maxBytes=20, backupCount=5)\n" +"\n" +"my_logger.addHandler(handler)\n" +"\n" +"# Log some messages\n" +"for i in range(20):\n" +" my_logger.debug('i = %d' % i)\n" +"\n" +"# See what files are created\n" +"logfiles = glob.glob('%s*' % LOG_FILENAME)\n" +"\n" +"for filename in logfiles:\n" +" print(filename)" + +msgid "The result should be 6 separate files, each with part of the log history for the application:" +msgstr "نتیجه باید ۶ فایل جداگانه باشد، که هرکدام بخشی از تاریخچه‌ی گزارش‌های برنامه را شامل می‌شوند:" + +msgid "" +"logging_rotatingfile_example.out\n" +"logging_rotatingfile_example.out.1\n" +"logging_rotatingfile_example.out.2\n" +"logging_rotatingfile_example.out.3\n" +"logging_rotatingfile_example.out.4\n" +"logging_rotatingfile_example.out.5" +msgstr "" +"logging_rotatingfile_example.out\n" +"logging_rotatingfile_example.out.1\n" +"logging_rotatingfile_example.out.2\n" +"logging_rotatingfile_example.out.3\n" +"logging_rotatingfile_example.out.4\n" +"logging_rotatingfile_example.out.5" -msgid "The result should be 6 separate files, each with part of the log history for the application:" -msgstr "" - -msgid "" -"logging_rotatingfile_example.out\n" -"logging_rotatingfile_example.out.1\n" -"logging_rotatingfile_example.out.2\n" -"logging_rotatingfile_example.out.3\n" -"logging_rotatingfile_example.out.4\n" -"logging_rotatingfile_example.out.5" -msgstr "" - -msgid "The most current file is always :file:`logging_rotatingfile_example.out`, and each time it reaches the size limit it is renamed with the suffix ``.1``. Each of the existing backup files is renamed to increment the suffix (``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." +msgid "" +"The most current file is always :file:`logging_rotatingfile_example.out`, and each time it reaches the size limit it is renamed with the suffix ``.1``. Each of the existing backup files is " +"renamed to increment the suffix (``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" +"فایل جاری همیشه :file:`logging_rotatingfile_example.out` است و هر بار که به محدودیت اندازه برسد، با پسوند ``.1`` تغییر نام داده می‌شود. هر یک از فایل‌های پشتیبان موجود برای افزایش پسوند تغییر نام " +"داده می‌شوند (``.1`` به ``.2`` تبدیل می‌شود، و غیره) و فایل ``.6`` حذف می‌شود." msgid "Obviously this example sets the log length much too small as an extreme example. You would want to set *maxBytes* to an appropriate value." -msgstr "" +msgstr "بدیهی است که این مثال، طول گزارش را به‌عنوان یک مثال افراطی، بیش‌ازحد کوچک تنظیم می‌کند. بهتر است *maxBytes* را روی مقدار مناسبی تنظیم کنید." msgid "Use of alternative formatting styles" -msgstr "" +msgstr "استفاده از سبک‌های جایگزین قالب‌بندی" -msgid "When logging was added to the Python standard library, the only way of formatting messages with variable content was to use the %-formatting method. Since then, Python has gained two new formatting approaches: :class:`string.Template` (added in Python 2.4) and :meth:`str.format` (added in Python 2.6)." +msgid "" +"When logging was added to the Python standard library, the only way of formatting messages with variable content was to use the %-formatting method. Since then, Python has gained two new " +"formatting approaches: :class:`string.Template` (added in Python 2.4) and :meth:`str.format` (added in Python 2.6)." msgstr "" +"هنگامی که گزارش‌گیری (logging) به کتابخانه استاندارد پایتون اضافه شد، تنها راه قالب‌بندی پیام‌ها با محتوای متغیر، استفاده از روش قالب‌بندی درصدی (%-formatting) بود. از آن زمان، دو روش قالب‌بندی جدید به " +"پایتون اضافه شده است: :class:`string.Template` (در پایتون 2.4 اضافه شد) و :meth:`str.format` (در پایتون 2.6 اضافه شد)." -msgid "Logging (as of 3.2) provides improved support for these two additional formatting styles. The :class:`Formatter` class been enhanced to take an additional, optional keyword parameter named ``style``. This defaults to ``'%'``, but other possible values are ``'{'`` and ``'$'``, which correspond to the other two formatting styles. Backwards compatibility is maintained by default (as you would expect), but by explicitly specifying a style parameter, you get the ability to specify format strings which work with :meth:`str.format` or :class:`string.Template`. Here's an example console session to show the possibilities:" +msgid "" +"Logging (as of 3.2) provides improved support for these two additional formatting styles. The :class:`Formatter` class been enhanced to take an additional, optional keyword parameter named " +"``style``. This defaults to ``'%'``, but other possible values are ``'{'`` and ``'$'``, which correspond to the other two formatting styles. Backwards compatibility is maintained by default (as " +"you would expect), but by explicitly specifying a style parameter, you get the ability to specify format strings which work with :meth:`str.format` or :class:`string.Template`. Here's an example " +"console session to show the possibilities:" msgstr "" +"Logging (از نسخه‌ی 3.2) پشتیبانی بهتری برای این دو سبک قالب‌بندی اضافی فراهم می‌کند. کلاس :class:`Formatter` بهبود یافته است تا یک پارامتر کلیدواژه‌ای اضافی و اختیاری به نام ``style`` بپذیرد. مقدار " +"پیش‌فرض این پارامتر ``'%'`` است، اما مقادیر ممکن دیگر ``'{'`` و ``'$'`` هستند، که متناظر با دو سبک قالب‌بندی دیگر هستند. سازگاری با نسخه‌های پیشین به‌صورت پیش‌فرض حفظ می‌شود (همان‌طور که انتظار دارید)، " +"اما با مشخص کردن صریح پارامتر style، می‌توانید رشته‌های قالبی را مشخص کنید که با :meth:`str.format` یا :class:`string.Template` کار می‌کنند. در ادامه یک نشست کنسول نمونه برای نشان دادن این امکانات " +"آمده است:" msgid "" ">>> import logging\n" @@ -1557,21 +2792,63 @@ msgid "" "2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" ">>>" msgstr "" +">>> import logging\n" +">>> root = logging.getLogger()\n" +">>> root.setLevel(logging.DEBUG)\n" +">>> handler = logging.StreamHandler()\n" +">>> bf = logging.Formatter('{asctime} {name} {levelname:8s} {message}',\n" +"... style='{')\n" +">>> handler.setFormatter(bf)\n" +">>> root.addHandler(handler)\n" +">>> logger = logging.getLogger('foo.bar')\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:11:55,341 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:12:11,526 foo.bar CRITICAL This is a CRITICAL message\n" +">>> df = logging.Formatter('$asctime $name ${levelname} $message',\n" +"... style='$')\n" +">>> handler.setFormatter(df)\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:13:06,924 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" +">>>" -msgid "Note that the formatting of logging messages for final output to logs is completely independent of how an individual logging message is constructed. That can still use %-formatting, as shown here::" +msgid "" +"Note that the formatting of logging messages for final output to logs is completely independent of how an individual logging message is constructed. That can still use %-formatting, as shown " +"here::" msgstr "" +"توجه داشته باشید که قالب‌بندی پیام‌های گزارش برای خروجی نهایی به گزارش‌ها، کاملاً مستقل از چگونگی ساخت یک پیام گزارش منفرد است. برای ساخت آن هنوز می‌توان از قالب‌بندی %- (%-formatting) استفاده کرد، همان‌طور " +"که در اینجا نشان داده شده است::" msgid "" ">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" "2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" ">>>" msgstr "" +">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" +"2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" +">>>" -msgid "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take positional parameters for the actual logging message itself, with keyword parameters used only for determining options for how to handle the actual logging call (e.g. the ``exc_info`` keyword parameter to indicate that traceback information should be logged, or the ``extra`` keyword parameter to indicate additional contextual information to be added to the log). So you cannot directly make logging calls using :meth:`str.format` or :class:`string.Template` syntax, because internally the logging package uses %-formatting to merge the format string and the variable arguments. There would be no changing this while preserving backward compatibility, since all logging calls which are out there in existing code will be using %-format strings." -msgstr "" +msgid "" +"Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take positional parameters for the actual logging message itself, with keyword parameters used only for determining options for how " +"to handle the actual logging call (e.g. the ``exc_info`` keyword parameter to indicate that traceback information should be logged, or the ``extra`` keyword parameter to indicate additional " +"contextual information to be added to the log). So you cannot directly make logging calls using :meth:`str.format` or :class:`string.Template` syntax, because internally the logging package uses " +"%-formatting to merge the format string and the variable arguments. There would be no changing this while preserving backward compatibility, since all logging calls which are out there in " +"existing code will be using %-format strings." +msgstr "" +"فراخوانی‌های گزارش‌گیری (``logger.debug()``، ``logger.info()`` و غیره) فقط پارامترهای جایگاهی برای خود پیام گزارش‌گیری واقعی می‌پذیرند، و پارامترهای کلیدواژه‌ای فقط برای تعیین گزینه‌هایی درباره‌ی نحوه‌ی مدیریت " +"فراخوانی گزارش‌گیری واقعی به کار می‌روند (برای مثال، پارامتر کلیدواژه‌ای ``exc_info`` برای نشان دادن اینکه اطلاعات ردگیری پشته باید ثبت شود، یا پارامتر کلیدواژه‌ای ``extra`` برای نشان دادن اطلاعات " +"زمینه‌ای اضافی که باید به گزارش اضافه شود). بنابراین نمی‌توانید به‌طور مستقیم فراخوانی‌های گزارش‌گیری را با سینتکس :meth:`str.format` یا :class:`string.Template` انجام دهید، زیرا بسته‌ی logging به‌صورت داخلی " +"از %-formatting برای ادغام رشته‌ی قالب و آرگومان‌های متغیر استفاده می‌کند. در عین حفظ سازگاری با عقب‌گرد، امکان تغییر این موضوع وجود نخواهد داشت، زیرا همه‌ی فراخوانی‌های گزارش‌گیری موجود در کدهای موجود از " +"رشته‌های %-format استفاده خواهند کرد." -msgid "There is, however, a way that you can use {}- and $- formatting to construct your individual log messages. Recall that for a message you can use an arbitrary object as a message format string, and that the logging package will call ``str()`` on that object to get the actual format string. Consider the following two classes::" +msgid "" +"There is, however, a way that you can use {}- and $- formatting to construct your individual log messages. Recall that for a message you can use an arbitrary object as a message format string, " +"and that the logging package will call ``str()`` on that object to get the actual format string. Consider the following two classes::" msgstr "" +"با این حال، راهی وجود دارد که می‌توانید از قالب‌بندی {} و $ برای ساخت پیام‌های گزارش جداگانه‌ی خود استفاده کنید. به یاد داشته باشید که برای یک پیام می‌توانید از یک شیء دلخواه به‌عنوان رشته‌ی قالب پیام " +"استفاده کنید، و بسته‌ی logging ``str()`` را روی آن شیء فراخوانی می‌کند تا رشته‌ی قالب واقعی را به دست آورد. دو کلاس زیر را در نظر بگیرید::" msgid "" "class BraceMessage:\n" @@ -1592,12 +2869,39 @@ msgid "" " from string import Template\n" " return Template(self.fmt).substitute(**self.kwargs)" msgstr "" +"class BraceMessage:\n" +" def __init__(self, fmt, /, *args, **kwargs):\n" +" self.fmt = fmt\n" +" self.args = args\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args, **self.kwargs)\n" +"\n" +"class DollarMessage:\n" +" def __init__(self, fmt, /, **kwargs):\n" +" self.fmt = fmt\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" from string import Template\n" +" return Template(self.fmt).substitute(**self.kwargs)" -msgid "Either of these can be used in place of a format string, to allow {}- or $-formatting to be used to build the actual \"message\" part which appears in the formatted log output in place of \"%(message)s\" or \"{message}\" or \"$message\". It's a little unwieldy to use the class names whenever you want to log something, but it's quite palatable if you use an alias such as __ (double underscore --- not to be confused with _, the single underscore used as a synonym/alias for :func:`gettext.gettext` or its brethren)." +msgid "" +"Either of these can be used in place of a format string, to allow {}- or $-formatting to be used to build the actual \"message\" part which appears in the formatted log output in place of \"%" +"(message)s\" or \"{message}\" or \"$message\". It's a little unwieldy to use the class names whenever you want to log something, but it's quite palatable if you use an alias such as __ (double " +"underscore --- not to be confused with _, the single underscore used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" +"هر یک از این‌ها می‌توانند به‌جای یک رشته‌قالب استفاده شوند، تا بتوان از قالب‌بندی {} یا $ برای ساخت بخش «پیام» واقعی استفاده کرد؛ بخشی که در خروجی گزارش قالب‌بندی‌شده به‌جای \"%(message)s\" یا \"{message}" +"\" یا \"$message\" ظاهر می‌شود. استفاده از نام کلاس‌ها هر بار که بخواهید چیزی را گزارش کنید کمی دست‌وپاگیر است، اما اگر از نام مستعاری مانند __ (دو زیرخط --- نباید با _، زیرخط تکی که به‌عنوان مترادف/" +"نام مستعار برای :func:`gettext.gettext` یا هم‌خانواده‌های آن استفاده می‌شود، اشتباه گرفته شود) استفاده کنید، کاملاً قابل‌قبول است." -msgid "The above classes are not included in Python, though they're easy enough to copy and paste into your own code. They can be used as follows (assuming that they're declared in a module called ``wherever``):" +msgid "" +"The above classes are not included in Python, though they're easy enough to copy and paste into your own code. They can be used as follows (assuming that they're declared in a module called " +"``wherever``):" msgstr "" +"کلاس‌های بالا در پایتون گنجانده نشده‌اند، هرچند کپی و پیست کردن آن‌ها در کد خودتان به‌اندازه کافی آسان است. می‌توان از آن‌ها به‌صورت زیر استفاده کرد (با فرض اینکه در ماژولی به نام ``wherever`` تعریف " +"شده‌اند):" msgid "" ">>> from wherever import BraceMessage as __\n" @@ -1616,15 +2920,36 @@ msgid "" "Message with 2 placeholders\n" ">>>" msgstr "" +">>> from wherever import BraceMessage as __\n" +">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})',\n" +"... point=p))\n" +"Message with coordinates: (0.50, 0.50)\n" +">>> from wherever import DollarMessage as __\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" msgid "While the above examples use ``print()`` to show how the formatting works, you would of course use ``logger.debug()`` or similar to actually log using this approach." -msgstr "" +msgstr "هرچند مثال‌های بالا از ``print()`` برای نشان دادن چگونگی کارکرد قالب‌بندی استفاده می‌کنند، البته برای گزارش کردن واقعی با این روش از ``logger.debug()`` یا مشابه آن استفاده خواهید کرد." -msgid "One thing to note is that you pay no significant performance penalty with this approach: the actual formatting happens not when you make the logging call, but when (and if) the logged message is actually about to be output to a log by a handler. So the only slightly unusual thing which might trip you up is that the parentheses go around the format string and the arguments, not just the format string. That's because the __ notation is just syntax sugar for a constructor call to one of the :samp:`{XXX}Message` classes." +msgid "" +"One thing to note is that you pay no significant performance penalty with this approach: the actual formatting happens not when you make the logging call, but when (and if) the logged message is " +"actually about to be output to a log by a handler. So the only slightly unusual thing which might trip you up is that the parentheses go around the format string and the arguments, not just the " +"format string. That's because the __ notation is just syntax sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" +"نکته‌ای که باید به آن توجه داشته باشید این است که با این رویکرد، شما هیچ هزینه‌ی عملکردی قابل‌توجهی متحمل نمی‌شوید: قالب‌بندی واقعی نه هنگامی اتفاق می‌افتد که فراخوانی logging را انجام می‌دهید، بلکه " +"هنگامی (و اگر) پیام گزارش‌شده واقعاً در آستانه‌ی آن باشد که توسط یک مدیر (handler) به یک گزارش خروجی داده شود. بنابراین، تنها نکته‌ی کمی غیرمعمول که ممکن است شما را به اشتباه بیندازد این است که پرانتزها " +"در اطراف رشته‌ی قالب و آرگومان‌ها قرار می‌گیرند، نه فقط رشته‌ی قالب. این به این دلیل است که نمادگذاری __ صرفاً قند نحوی برای فراخوانی سازنده‌ی یکی از کلاس‌های :samp:`{XXX}Message` است." msgid "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar effect to the above, as in the following example::" -msgstr "" +msgstr "در صورت تمایل، می‌توانید از یک :class:`LoggerAdapter` برای دستیابی به نتیجه‌ای مشابه مورد بالا استفاده کنید، همان‌طور که در مثال زیر آمده است::" msgid "" "import logging\n" @@ -1653,48 +2978,107 @@ msgid "" " logging.basicConfig(level=logging.DEBUG)\n" " main()" msgstr "" +"import logging\n" +"\n" +"class Message:\n" +" def __init__(self, fmt, args):\n" +" self.fmt = fmt\n" +" self.args = args\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args)\n" +"\n" +"class StyleAdapter(logging.LoggerAdapter):\n" +" def log(self, level, msg, /, *args, stacklevel=1, **kwargs):\n" +" if self.isEnabledFor(level):\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.log(level, Message(msg, args), **kwargs,\n" +" stacklevel=stacklevel+1)\n" +"\n" +"logger = StyleAdapter(logging.getLogger(__name__))\n" +"\n" +"def main():\n" +" logger.debug('Hello, {}', 'world!')\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" main()" msgid "The above script should log the message ``Hello, world!`` when run with Python 3.8 or later." -msgstr "" +msgstr "اسکریپت بالا باید هنگام اجرا با پایتون 3.8 یا بالاتر، پیام ``Hello, world!`` را ثبت کند." msgid "Customizing ``LogRecord``" -msgstr "" +msgstr "سفارشی‌سازی ``LogRecord``" -msgid "Every logging event is represented by a :class:`LogRecord` instance. When an event is logged and not filtered out by a logger's level, a :class:`LogRecord` is created, populated with information about the event and then passed to the handlers for that logger (and its ancestors, up to and including the logger where further propagation up the hierarchy is disabled). Before Python 3.2, there were only two places where this creation was done:" +msgid "" +"Every logging event is represented by a :class:`LogRecord` instance. When an event is logged and not filtered out by a logger's level, a :class:`LogRecord` is created, populated with information " +"about the event and then passed to the handlers for that logger (and its ancestors, up to and including the logger where further propagation up the hierarchy is disabled). Before Python 3.2, " +"there were only two places where this creation was done:" msgstr "" +"هر رویداد گزارش‌گیری با یک نمونه از :class:`LogRecord` بازنمایی می‌شود. هنگامی که رویدادی ثبت می‌شود و توسط سطح گزارش‌گیر فیلتر نمی‌شود، یک :class:`LogRecord` ایجاد می‌شود، با اطلاعات مربوط به رویداد پر " +"می‌شود و سپس به هندلرهای آن گزارش‌گیر (و گزارش‌گیرهای بالادستی آن، تا و شامل گزارش‌گیری که انتشار بیشتر به سمت بالای سلسله‌مراتب در آن غیرفعال شده است) ارسال می‌شود. پیش از پایتون 3.2، تنها دو مکان وجود داشت که " +"این ایجاد در آن‌ها صورت می‌گرفت:" msgid ":meth:`Logger.makeRecord`, which is called in the normal process of logging an event. This invoked :class:`LogRecord` directly to create an instance." -msgstr "" +msgstr ":meth:`Logger.makeRecord`، که در فرآیند عادی ثبت یک رویداد فراخوانی می‌شود. این متد :class:`LogRecord` را به‌طور مستقیم برای ایجاد یک نمونه فراخوانی می‌کند." -msgid ":func:`makeLogRecord`, which is called with a dictionary containing attributes to be added to the LogRecord. This is typically invoked when a suitable dictionary has been received over the network (e.g. in pickle form via a :class:`~handlers.SocketHandler`, or in JSON form via an :class:`~handlers.HTTPHandler`)." +msgid "" +":func:`makeLogRecord`, which is called with a dictionary containing attributes to be added to the LogRecord. This is typically invoked when a suitable dictionary has been received over the " +"network (e.g. in pickle form via a :class:`~handlers.SocketHandler`, or in JSON form via an :class:`~handlers.HTTPHandler`)." msgstr "" +":func:`makeLogRecord`، که با یک دیکشنری حاوی ویژگی‌هایی فراخوانی می‌شود که باید به LogRecord افزوده شوند. این معمولاً زمانی فراخوانی می‌شود که یک دیکشنری مناسب از طریق شبکه دریافت شده باشد (برای مثال " +"در قالب pickle از طریق یک :class:`~handlers.SocketHandler`، یا در قالب JSON از طریق یک :class:`~handlers.HTTPHandler`)." msgid "This has usually meant that if you need to do anything special with a :class:`LogRecord`, you've had to do one of the following." -msgstr "" +msgstr "این معمولاً به این معنا بوده است که اگر نیاز داشته باشید کار خاصی با یک :class:`LogRecord` انجام دهید، مجبور بوده‌اید یکی از موارد زیر را انجام دهید." msgid "Create your own :class:`Logger` subclass, which overrides :meth:`Logger.makeRecord`, and set it using :func:`~logging.setLoggerClass` before any loggers that you care about are instantiated." msgstr "" +"زیرکلاس اختصاصی خود از :class:`Logger` را بسازید که :meth:`Logger.makeRecord` را بازنویسی می‌کند، و آن را پیش از نمونه‌سازی هر گزارش‌گیری که برایتان اهمیت دارد، با استفاده " +"از :func:`~logging.setLoggerClass` تنظیم کنید." msgid "Add a :class:`Filter` to a logger or handler, which does the necessary special manipulation you need when its :meth:`~Filter.filter` method is called." -msgstr "" +msgstr "یک :class:`Filter` را به یک گزارش‌گیر (logger) یا هندلر (handler) اضافه کنید، که دستکاری خاص مورد نیاز شما را هنگام فراخوانی متد :meth:`~Filter.filter` آن انجام می‌دهد." -msgid "The first approach would be a little unwieldy in the scenario where (say) several different libraries wanted to do different things. Each would attempt to set its own :class:`Logger` subclass, and the one which did this last would win." +msgid "" +"The first approach would be a little unwieldy in the scenario where (say) several different libraries wanted to do different things. Each would attempt to set its own :class:`Logger` subclass, " +"and the one which did this last would win." msgstr "" +"رویکرد اول در سناریویی که (مثلاً) چند کتابخانه‌ی مختلف بخواهند کارهای متفاوتی انجام دهند، کمی دست‌وپاگیر خواهد بود. هرکدام تلاش می‌کند زیرکلاس :class:`Logger` خود را تنظیم کند، و آخرین موردی که این " +"کار را انجام دهد برنده می‌شود." -msgid "The second approach works reasonably well for many cases, but does not allow you to e.g. use a specialized subclass of :class:`LogRecord`. Library developers can set a suitable filter on their loggers, but they would have to remember to do this every time they introduced a new logger (which they would do simply by adding new packages or modules and doing ::" +msgid "" +"The second approach works reasonably well for many cases, but does not allow you to e.g. use a specialized subclass of :class:`LogRecord`. Library developers can set a suitable filter on their " +"loggers, but they would have to remember to do this every time they introduced a new logger (which they would do simply by adding new packages or modules and doing ::" msgstr "" +"رویکرد دوم برای بسیاری از موارد نسبتاً خوب کار می‌کند، اما به شما اجازه نمی‌دهد که برای مثال از یک زیرکلاس تخصصی از :class:`LogRecord` استفاده کنید. توسعه‌دهندگان کتابخانه می‌توانند فیلتر مناسبی را " +"روی گزارش‌گیرهای خود تنظیم کنند، اما باید به یاد داشته باشند که هر بار که گزارش‌گیر جدیدی معرفی می‌کنند، این کار را انجام دهند (که این کار را صرفاً با افزودن بسته‌ها یا ماژول‌های جدید و انجام دادن ::" msgid "logger = logging.getLogger(__name__)" -msgstr "" +msgstr "logger = logging.getLogger(__name__)" -msgid "at module level). It's probably one too many things to think about. Developers could also add the filter to a :class:`~logging.NullHandler` attached to their top-level logger, but this would not be invoked if an application developer attached a handler to a lower-level library logger --- so output from that handler would not reflect the intentions of the library developer." +msgid "" +"at module level). It's probably one too many things to think about. Developers could also add the filter to a :class:`~logging.NullHandler` attached to their top-level logger, but this would not " +"be invoked if an application developer attached a handler to a lower-level library logger --- so output from that handler would not reflect the intentions of the library developer." msgstr "" +"در سطح ماژول). این احتمالاً یک مورد اضافی برای فکر کردن است. توسعه‌دهندگان همچنین می‌توانند فیلتر را به یک :class:`~logging.NullHandler` متصل به گزارش‌گیر (logger) سطح بالای خود اضافه کنند، اما اگر " +"توسعه‌دهنده‌ی برنامه یک هندلر (handler) را به یک گزارش‌گیر کتابخانه در سطح پایین‌تر متصل کند، این فیلتر فراخوانی نمی‌شود—بنابراین خروجی آن هندلر، نیات توسعه‌دهنده‌ی کتابخانه را بازتاب نمی‌دهد." -msgid "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done through a factory, which you can specify. The factory is just a callable you can set with :func:`~logging.setLogRecordFactory`, and interrogate with :func:`~logging.getLogRecordFactory`. The factory is invoked with the same signature as the :class:`~logging.LogRecord` constructor, as :class:`LogRecord` is the default setting for the factory." +msgid "" +"In Python 3.2 and later, :class:`~logging.LogRecord` creation is done through a factory, which you can specify. The factory is just a callable you can set " +"with :func:`~logging.setLogRecordFactory`, and interrogate with :func:`~logging.getLogRecordFactory`. The factory is invoked with the same signature as the :class:`~logging.LogRecord` " +"constructor, as :class:`LogRecord` is the default setting for the factory." msgstr "" +"در پایتون 3.2 و نسخه‌های بعدی، ایجاد :class:`~logging.LogRecord` از طریق یک کارخانه انجام می‌شود که شما می‌توانید آن را تعیین کنید. کارخانه فقط یک شیء فراخوانی‌پذیر است که می‌توانید آن را " +"با :func:`~logging.setLogRecordFactory` تنظیم کنید و با :func:`~logging.getLogRecordFactory` بازخوانی کنید. کارخانه با همان امضای سازنده‌ی :class:`~logging.LogRecord` فراخوانی می‌شود، " +"زیرا :class:`LogRecord` تنظیم پیش‌فرض برای کارخانه است." -msgid "This approach allows a custom factory to control all aspects of LogRecord creation. For example, you could return a subclass, or just add some additional attributes to the record once created, using a pattern similar to this::" +msgid "" +"This approach allows a custom factory to control all aspects of LogRecord creation. For example, you could return a subclass, or just add some additional attributes to the record once created, " +"using a pattern similar to this::" msgstr "" +"این رویکرد به یک کارخانه سفارشی اجازه می‌دهد تا تمام جنبه‌های ایجاد LogRecord را کنترل کند. برای مثال، می‌توانید یک زیرکلاس را برگردانید، یا صرفاً چند ویژگی اضافی را پس از ایجاد، به رکورد اضافه کنید؛ " +"با استفاده از الگویی مشابه این::" msgid "" "old_factory = logging.getLogRecordFactory()\n" @@ -1706,18 +3090,36 @@ msgid "" "\n" "logging.setLogRecordFactory(record_factory)" msgstr "" +"old_factory = logging.getLogRecordFactory()\n" +"\n" +"def record_factory(*args, **kwargs):\n" +" record = old_factory(*args, **kwargs)\n" +" record.custom_attribute = 0xdecafbad\n" +" return record\n" +"\n" +"logging.setLogRecordFactory(record_factory)" -msgid "This pattern allows different libraries to chain factories together, and as long as they don't overwrite each other's attributes or unintentionally overwrite the attributes provided as standard, there should be no surprises. However, it should be borne in mind that each link in the chain adds run-time overhead to all logging operations, and the technique should only be used when the use of a :class:`Filter` does not provide the desired result." +msgid "" +"This pattern allows different libraries to chain factories together, and as long as they don't overwrite each other's attributes or unintentionally overwrite the attributes provided as standard, " +"there should be no surprises. However, it should be borne in mind that each link in the chain adds run-time overhead to all logging operations, and the technique should only be used when the use " +"of a :class:`Filter` does not provide the desired result." msgstr "" +"این الگو به کتابخانه‌های مختلف اجازه می‌دهد کارخانه‌ها را به‌صورت زنجیره‌ای به هم متصل کنند، و تا زمانی که ویژگی‌های یکدیگر را بازنویسی نکنند یا ویژگی‌های ارائه‌شده به‌عنوان استاندارد را به‌طور غیرعمدی " +"بازنویسی نکنند، نباید مورد غیرمنتظره‌ای پیش بیاید. با این حال، باید توجه داشت که هر پیوند در زنجیره به تمام عملیات گزارش‌گیری سربار ران‌تایم اضافه می‌کند، و این تکنیک فقط زمانی باید استفاده شود که " +"استفاده از یک :class:`Filter` نتیجه دلخواه را فراهم نکند." msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" -msgstr "" +msgstr "زیرکلاس‌سازی از QueueHandler و QueueListener — نمونه‌ای با ZeroMQ" msgid "Subclass ``QueueHandler``" -msgstr "" +msgstr "زیرکلاس ``QueueHandler``" -msgid "You can use a :class:`QueueHandler` subclass to send messages to other kinds of queues, for example a ZeroMQ 'publish' socket. In the example below,the socket is created separately and passed to the handler (as its 'queue')::" +msgid "" +"You can use a :class:`QueueHandler` subclass to send messages to other kinds of queues, for example a ZeroMQ 'publish' socket. In the example below,the socket is created separately and passed to " +"the handler (as its 'queue')::" msgstr "" +"شما می‌توانید از زیرکلاسی از :class:`QueueHandler` برای ارسال پیام‌ها به انواع دیگر صف‌ها استفاده کنید، برای مثال یک سوکت 'publish' از ZeroMQ. در مثال زیر، سوکت به‌صورت جداگانه ایجاد می‌شود و به " +"هندلر (handler) (به‌عنوان 'queue' آن) داده می‌شود::" msgid "" "import zmq # using pyzmq, the Python binding for ZeroMQ\n" @@ -1734,9 +3136,22 @@ msgid "" "\n" "handler = ZeroMQSocketHandler(sock)" msgstr "" +"import zmq # using pyzmq, the Python binding for ZeroMQ\n" +"import json # for serializing records portably\n" +"\n" +"ctx = zmq.Context()\n" +"sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value\n" +"sock.bind('tcp://*:5556') # or wherever\n" +"\n" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +"\n" +"handler = ZeroMQSocketHandler(sock)" msgid "Of course there are other ways of organizing this, for example passing in the data needed by the handler to create the socket::" -msgstr "" +msgstr "البته راه‌های دیگری برای سازمان‌دهی این کار وجود دارد، برای مثال، ارسال داده‌های مورد نیاز هندلر (handler) برای ایجاد سوکت::" msgid "" "class ZeroMQSocketHandler(QueueHandler):\n" @@ -1752,12 +3167,24 @@ msgid "" " def close(self):\n" " self.queue.close()" msgstr "" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" +" self.ctx = ctx or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, socktype)\n" +" socket.bind(uri)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +" def close(self):\n" +" self.queue.close()" msgid "Subclass ``QueueListener``" -msgstr "" +msgstr "زیرکلاس ``QueueListener``" msgid "You can also subclass :class:`QueueListener` to get messages from other kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" -msgstr "" +msgstr "همچنین می‌توانید :class:`QueueListener` را زیرکلاس‌سازی کنید تا پیام‌ها را از انواع دیگر صف‌ها دریافت کنید، برای مثال از یک سوکت 'subscribe' در ZeroMQ. در اینجا یک مثال آمده است::" msgid "" "class ZeroMQSocketListener(QueueListener):\n" @@ -1772,12 +3199,27 @@ msgid "" " msg = self.queue.recv_json()\n" " return logging.makeLogRecord(msg)" msgstr "" +"class ZeroMQSocketListener(QueueListener):\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" self.ctx = kwargs.get('ctx') or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, zmq.SUB)\n" +" socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to everything\n" +" socket.connect(uri)\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self):\n" +" msg = self.queue.recv_json()\n" +" return logging.makeLogRecord(msg)" msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" -msgstr "" +msgstr "زیرکلاس‌سازی از QueueHandler و QueueListener - یک مثال ``pynng``" -msgid "In a similar way to the above section, we can implement a listener and handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor to ZeroMQ. The following snippets illustrate -- you can test them in an environment which has ``pynng`` installed. Just for variety, we present the listener first." +msgid "" +"In a similar way to the above section, we can implement a listener and handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor " +"to ZeroMQ. The following snippets illustrate -- you can test them in an environment which has ``pynng`` installed. Just for variety, we present the listener first." msgstr "" +"به شیوه‌ای مشابه بخش بالا، می‌توانیم یک شنونده و هندلر با استفاده از :pypi:`pynng` پیاده‌سازی کنیم، که یک اتصال (binding) پایتون به `NNG `_ است و به‌عنوان جانشین معنوی " +"ZeroMQ معرفی می‌شود. قطعه‌کدهای زیر این موضوع را نشان می‌دهند — می‌توانید آن‌ها را در محیطی که ``pynng`` در آن نصب شده است آزمایش کنید. فقط برای تنوع، ابتدا شنونده را ارائه می‌کنیم." msgid "" "# listener.py\n" @@ -1838,38 +3280,95 @@ msgid "" "finally:\n" " listener.stop()" msgstr "" - -msgid "" -"# sender.py\n" +"# listener.py\n" "import json\n" "import logging\n" "import logging.handlers\n" -"import time\n" -"import random\n" "\n" "import pynng\n" "\n" "DEFAULT_ADDR = \"tcp://localhost:13232\"\n" "\n" -"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"interrupted = False\n" "\n" -" def __init__(self, uri):\n" -" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" -" super().__init__(socket)\n" +"class NNGSocketListener(logging.handlers.QueueListener):\n" "\n" -" def enqueue(self, record):\n" -" # Send the record as UTF-8 encoded JSON\n" -" d = dict(record.__dict__)\n" -" data = json.dumps(d)\n" -" self.queue.send(data.encode('utf-8'))\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" # Have a timeout for interruptibility, and open a\n" +" # subscriber socket\n" +" socket = pynng.Sub0(listen=uri, recv_timeout=500)\n" +" # The b'' subscription matches all topics\n" +" topics = kwargs.pop('topics', None) or b''\n" +" socket.subscribe(topics)\n" +" # We treat the socket as a queue\n" +" super().__init__(socket, *handlers, **kwargs)\n" "\n" -" def close(self):\n" -" self.queue.close()\n" +" def dequeue(self, block):\n" +" data = None\n" +" # Keep looping while not interrupted and no data received over the\n" +" # socket\n" +" while not interrupted:\n" +" try:\n" +" data = self.queue.recv(block=block)\n" +" break\n" +" except pynng.Timeout:\n" +" pass\n" +" except pynng.Closed: # sometimes happens when you hit Ctrl-C\n" +" break\n" +" if data is None:\n" +" return None\n" +" # Get the logging event sent from a publisher\n" +" event = json.loads(data.decode('utf-8'))\n" +" return logging.makeLogRecord(event)\n" +"\n" +" def enqueue_sentinel(self):\n" +" # Not used in this implementation, as the socket isn't really a\n" +" # queue\n" +" pass\n" "\n" "logging.getLogger('pynng').propagate = False\n" -"handler = NNGSocketHandler(DEFAULT_ADDR)\n" -"# Make sure the process ID is in the output\n" -"logging.basicConfig(level=logging.DEBUG,\n" +"listener = NNGSocketListener(DEFAULT_ADDR, logging.StreamHandler(), topics=b'')\n" +"listener.start()\n" +"print('Press Ctrl-C to stop.')\n" +"try:\n" +" while True:\n" +" pass\n" +"except KeyboardInterrupt:\n" +" interrupted = True\n" +"finally:\n" +" listener.stop()" + +msgid "" +"# sender.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"import time\n" +"import random\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"\n" +" def __init__(self, uri):\n" +" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" # Send the record as UTF-8 encoded JSON\n" +" d = dict(record.__dict__)\n" +" data = json.dumps(d)\n" +" self.queue.send(data.encode('utf-8'))\n" +"\n" +" def close(self):\n" +" self.queue.close()\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"handler = NNGSocketHandler(DEFAULT_ADDR)\n" +"# Make sure the process ID is in the output\n" +"logging.basicConfig(level=logging.DEBUG,\n" " handlers=[logging.StreamHandler(), handler],\n" " format='%(levelname)-8s %(name)10s %(process)6s %(message)s')\n" "levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" @@ -1885,9 +3384,56 @@ msgid "" " delay = random.random() * 2 + 0.5\n" " time.sleep(delay)" msgstr "" +"# sender.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"import time\n" +"import random\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"\n" +" def __init__(self, uri):\n" +" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" # Send the record as UTF-8 encoded JSON\n" +" d = dict(record.__dict__)\n" +" data = json.dumps(d)\n" +" self.queue.send(data.encode('utf-8'))\n" +"\n" +" def close(self):\n" +" self.queue.close()\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"handler = NNGSocketHandler(DEFAULT_ADDR)\n" +"# Make sure the process ID is in the output\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" handlers=[logging.StreamHandler(), handler],\n" +" format='%(levelname)-8s %(name)10s %(process)6s %(message)s')\n" +"levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" +"msgno = 1\n" +"while True:\n" +" # Just randomly select some loggers and levels and log away\n" +" level = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(logger_names))\n" +" logger.log(level, 'Message no. %5d' % msgno)\n" +" msgno += 1\n" +" delay = random.random() * 2 + 0.5\n" +" time.sleep(delay)" -msgid "You can run the above two snippets in separate command shells. If we run the listener in one shell and run the sender in two separate shells, we should see something like the following. In the first sender shell:" +msgid "" +"You can run the above two snippets in separate command shells. If we run the listener in one shell and run the sender in two separate shells, we should see something like the following. In the " +"first sender shell:" msgstr "" +"شما می‌توانید دو قطعه‌کد بالا را در پوسته‌های خط فرمان جداگانه اجرا کنید. اگر شنونده را در یک پوسته و فرستنده را در دو پوسته جداگانه اجرا کنید، باید چیزی شبیه به زیر ببینید. در اولین پوسته فرستنده:" msgid "" "$ python sender.py\n" @@ -1901,9 +3447,19 @@ msgid "" "INFO myapp.lib1 613 Message no. 8\n" "(and so on)" msgstr "" +"$ python sender.py\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"(و به همین ترتیب)" msgid "In the second sender shell:" -msgstr "" +msgstr "در دومین پوسته‌ی فرستنده:" msgid "" "$ python sender.py\n" @@ -1917,9 +3473,19 @@ msgid "" "DEBUG myapp.lib1 657 Message no. 8\n" "(and so on)" msgstr "" +"$ python sender.py\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(و غیره)" msgid "In the listener shell:" -msgstr "" +msgstr "در پوسته‌ی شنونده:" msgid "" "$ python listener.py\n" @@ -1942,15 +3508,38 @@ msgid "" "DEBUG myapp.lib1 657 Message no. 8\n" "(and so on)" msgstr "" +"$ python listener.py\n" +"Press Ctrl-C to stop.\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" msgid "As you can see, the logging from the two sender processes is interleaved in the listener's output." -msgstr "" +msgstr "همان‌طور که می‌بینید، گزارش‌های دو فرآیند فرستنده در خروجی شنونده درهم‌آمیخته شده‌اند." msgid "An example dictionary-based configuration" -msgstr "" +msgstr "یک نمونه پیکربندی مبتنی بر دیکشنری" -msgid "Below is an example of a logging configuration dictionary - it's taken from the `documentation on the Django project `_. This dictionary is passed to :func:`~config.dictConfig` to put the configuration into effect::" +msgid "" +"Below is an example of a logging configuration dictionary - it's taken from the `documentation on the Django project `_. This dictionary is passed to :func:`~config.dictConfig` to put the configuration into effect::" msgstr "" +"در زیر نمونه‌ای از یک دیکشنری پیکربندی گزارش آمده است؛ این نمونه از `مستندات پروژه جنگو `_ گرفته شده است. این دیکشنری " +"به :func:`~config.dictConfig` ارسال می‌شود تا پیکربندی اعمال شود::" msgid "" "LOGGING = {\n" @@ -2002,15 +3591,63 @@ msgid "" " }\n" "}" msgstr "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'verbose': {\n" +" 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',\n" +" 'style': '{',\n" +" },\n" +" 'simple': {\n" +" 'format': '{levelname} {message}',\n" +" 'style': '{',\n" +" },\n" +" },\n" +" 'filters': {\n" +" 'special': {\n" +" '()': 'project.logging.SpecialFilter',\n" +" 'foo': 'bar',\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'level': 'INFO',\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" },\n" +" 'mail_admins': {\n" +" 'level': 'ERROR',\n" +" 'class': 'django.utils.log.AdminEmailHandler',\n" +" 'filters': ['special']\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'django': {\n" +" 'handlers': ['console'],\n" +" 'propagate': True,\n" +" },\n" +" 'django.request': {\n" +" 'handlers': ['mail_admins'],\n" +" 'level': 'ERROR',\n" +" 'propagate': False,\n" +" },\n" +" 'myproject.custom': {\n" +" 'handlers': ['console', 'mail_admins'],\n" +" 'level': 'INFO',\n" +" 'filters': ['special']\n" +" }\n" +" }\n" +"}" msgid "For more information about this configuration, you can see the `relevant section `_ of the Django documentation." -msgstr "" +msgstr "برای اطلاعات بیشتر درباره این پیکربندی، می‌توانید `بخش مربوطه `_ را در مستندات جنگو مشاهده کنید." msgid "Using a rotator and namer to customize log rotation processing" -msgstr "" +msgstr "استفاده از چرخاننده (rotator) و نام‌گذار (namer) برای سفارشی‌سازی پردازش چرخش گزارش" msgid "An example of how you can define a namer and rotator is given in the following runnable script, which shows gzip compression of the log file::" -msgstr "" +msgstr "مثالی از چگونگی تعریف یک نام‌گذار (namer) و چرخاننده (rotator) در اسکریپت قابل‌اجرای زیر ارائه شده است که فشرده‌سازی فایل گزارش با gzip را نشان می‌دهد::" msgid "" "import gzip\n" @@ -2041,9 +3678,36 @@ msgid "" "for i in range(1000):\n" " root.info(f'Message no. {i + 1}')" msgstr "" +"import gzip\n" +"import logging\n" +"import logging.handlers\n" +"import os\n" +"import shutil\n" +"\n" +"def namer(name):\n" +" return name + \".gz\"\n" +"\n" +"def rotator(source, dest):\n" +" with open(source, 'rb') as f_in:\n" +" with gzip.open(dest, 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)\n" +" os.remove(source)\n" +"\n" +"\n" +"rh = logging.handlers.RotatingFileHandler('rotated.log', maxBytes=128, backupCount=5)\n" +"rh.rotator = rotator\n" +"rh.namer = namer\n" +"\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.INFO)\n" +"root.addHandler(rh)\n" +"f = logging.Formatter('%(asctime)s %(message)s')\n" +"rh.setFormatter(f)\n" +"for i in range(1000):\n" +" root.info(f'Message no. {i + 1}')" msgid "After running this, you will see six new files, five of which are compressed:" -msgstr "" +msgstr "پس از اجرای این، ۶ فایل جدید خواهید دید که ۵ مورد از آن‌ها فشرده هستند:" msgid "" "$ ls rotated.log*\n" @@ -2054,18 +3718,36 @@ msgid "" "2023-01-20 02:28:17,767 Message no. 997\n" "2023-01-20 02:28:17,767 Message no. 998" msgstr "" +"$ ls rotated.log*\n" +"rotated.log rotated.log.2.gz rotated.log.4.gz\n" +"rotated.log.1.gz rotated.log.3.gz rotated.log.5.gz\n" +"$ zcat rotated.log.1.gz\n" +"2023-01-20 02:28:17,767 Message no. 996\n" +"2023-01-20 02:28:17,767 Message no. 997\n" +"2023-01-20 02:28:17,767 Message no. 998" msgid "A more elaborate multiprocessing example" -msgstr "" +msgstr "نمونه‌ای مفصل‌تر از چندپردازشی" -msgid "The following working example shows how logging can be used with multiprocessing using configuration files. The configurations are fairly simple, but serve to illustrate how more complex ones could be implemented in a real multiprocessing scenario." +msgid "" +"The following working example shows how logging can be used with multiprocessing using configuration files. The configurations are fairly simple, but serve to illustrate how more complex ones " +"could be implemented in a real multiprocessing scenario." msgstr "" +"مثال عملی زیر نشان می‌دهد که چگونه می‌توان از گزارش‌برداری (logging) همراه با چندپردازشی (multiprocessing) و با استفاده از فایل‌های پیکربندی استفاده کرد. این پیکربندی‌ها نسبتاً ساده هستند، اما نشان " +"می‌دهند که چگونه می‌توان پیکربندی‌های پیچیده‌تر را در یک سناریوی واقعی چندپردازشی پیاده‌سازی کرد." -msgid "In the example, the main process spawns a listener process and some worker processes. Each of the main process, the listener and the workers have three separate configurations (the workers all share the same configuration). We can see logging in the main process, how the workers log to a QueueHandler and how the listener implements a QueueListener and a more complex logging configuration, and arranges to dispatch events received via the queue to the handlers specified in the configuration. Note that these configurations are purely illustrative, but you should be able to adapt this example to your own scenario." +msgid "" +"In the example, the main process spawns a listener process and some worker processes. Each of the main process, the listener and the workers have three separate configurations (the workers all " +"share the same configuration). We can see logging in the main process, how the workers log to a QueueHandler and how the listener implements a QueueListener and a more complex logging " +"configuration, and arranges to dispatch events received via the queue to the handlers specified in the configuration. Note that these configurations are purely illustrative, but you should be " +"able to adapt this example to your own scenario." msgstr "" +"در این مثال، فرایند اصلی یک فرایند شنونده و چند فرایند کارگر را ایجاد می‌کند. فرایند اصلی، شنونده و کارگرها سه پیکربندی جداگانه دارند (همه‌ی کارگرها پیکربندی یکسانی دارند). می‌توانیم گزارش کردن در " +"فرایند اصلی را ببینیم، این‌که کارگرها چگونه به یک QueueHandler گزارش می‌فرستند و شنونده چگونه یک QueueListener و یک پیکربندی گزارش پیچیده‌تر را پیاده‌سازی می‌کند و ترتیبی می‌دهد که رویدادهای دریافت‌شده از " +"طریق صف به هندلرهای مشخص‌شده در پیکربندی ارسال شوند. توجه داشته باشید که این پیکربندی‌ها صرفاً جنبه‌ی توضیحی دارند، اما باید بتوانید این مثال را با سناریوی خودتان تطبیق دهید." msgid "Here's the script - the docstrings and the comments hopefully explain how it works::" -msgstr "" +msgstr "این هم اسکریپت - امید است رشته مستندها (docstrings) و کامنت‌ها چگونگی کارکرد آن را توضیح دهند::" msgid "" "import logging\n" @@ -2275,52 +3957,288 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" - -msgid "Inserting a BOM into messages sent to a SysLogHandler" -msgstr "" - -msgid ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a set of bytes which have the following structure: an optional pure-ASCII component, followed by a UTF-8 Byte Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the :rfc:`relevant section of the specification <5424#section-6>`.)" -msgstr "" - -msgid "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but unfortunately, it was implemented incorrectly, with the BOM appearing at the beginning of the message and hence not allowing any pure-ASCII component to appear before it." -msgstr "" - -msgid "As this behaviour is broken, the incorrect BOM insertion code is being removed from Python 3.2.4 and later. However, it is not being replaced, and if you want to produce :rfc:`5424`-compliant messages which include a BOM, an optional pure-ASCII sequence before it and arbitrary Unicode after it, encoded using UTF-8, then you need to do the following:" -msgstr "" - -msgid "Attach a :class:`~logging.Formatter` instance to your :class:`~logging.handlers.SysLogHandler` instance, with a format string such as::" -msgstr "" - -msgid "'ASCII section\\ufeffUnicode section'" -msgstr "" - -msgid "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." -msgstr "" - -msgid "Replace the ASCII section with whatever placeholders you like, but make sure that the data that appears in there after substitution is always ASCII (that way, it will remain unchanged after UTF-8 encoding)." -msgstr "" - -msgid "Replace the Unicode section with whatever placeholders you like; if the data which appears there after substitution contains characters outside the ASCII range, that's fine -- it will be encoded using UTF-8." -msgstr "" - -msgid "The formatted message *will* be encoded using UTF-8 encoding by ``SysLogHandler``. If you follow the above rules, you should be able to produce :rfc:`5424`-compliant messages. If you don't, logging may not complain, but your messages will not be RFC 5424-compliant, and your syslog daemon may complain." -msgstr "" - -msgid "Implementing structured logging" -msgstr "" - -msgid "Although most logging messages are intended for reading by humans, and thus not readily machine-parseable, there might be circumstances where you want to output messages in a structured format which *is* capable of being parsed by a program (without needing complex regular expressions to parse the log message). This is straightforward to achieve using the logging package. There are a number of ways in which this could be achieved, but the following is a simple approach which uses JSON to serialise the event in a machine-parseable manner::" -msgstr "" - -msgid "" -"import json\n" "import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue, Event, current_process\n" +"import os\n" +"import random\n" +"import time\n" +"\n" +"class MyHandler:\n" +" \"\"\"\n" +" A simple handler for logging events. It runs in the listener process and\n" +" dispatches events to loggers based on the name in the received record,\n" +" which then get dispatched, by the logging system, to the handlers\n" +" configured for those loggers.\n" +" \"\"\"\n" +"\n" +" def handle(self, record):\n" +" if record.name == \"root\":\n" +" logger = logging.getLogger()\n" +" else:\n" +" logger = logging.getLogger(record.name)\n" +"\n" +" if logger.isEnabledFor(record.levelno):\n" +" # The process name is transformed just to show that it's the listener\n" +" # doing the logging to files and console\n" +" record.processName = '%s (for %s)' % (current_process().name, record.processName)\n" +" logger.handle(record)\n" +"\n" +"def listener_process(q, stop_event, config):\n" +" \"\"\"\n" +" This could be done in the main process, but is just done in a separate\n" +" process for illustrative purposes.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" starts the listener and waits for the main process to signal completion\n" +" via the event. The listener is then stopped, and the process exits.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" listener = logging.handlers.QueueListener(q, MyHandler())\n" +" listener.start()\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled logger ...')\n" +" stop_event.wait()\n" +" listener.stop()\n" +"\n" +"def worker_process(config):\n" +" \"\"\"\n" +" A number of these are spawned for the purpose of illustration. In\n" +" practice, they could be a heterogeneous bunch of processes rather than\n" +" ones which are identical to each other.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" and logs a hundred messages with random levels to randomly selected\n" +" loggers.\n" +"\n" +" A small sleep is added to allow other processes a chance to run. This\n" +" is not strictly needed, but it mixes the output from the different\n" +" processes a bit more than if it's left out.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled logger ...')\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +" time.sleep(0.01)\n" +"\n" +"def main():\n" +" q = Queue()\n" +" # The main process gets a simple configuration which prints to the console.\n" +" config_initial = {\n" +" 'version': 1,\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO'\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The worker process configuration is just a QueueHandler attached to the\n" +" # root logger, which allows all messages to be sent to the queue.\n" +" # We disable existing loggers to disable the \"setup\" logger used in the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_worker = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'handlers': {\n" +" 'queue': {\n" +" 'class': 'logging.handlers.QueueHandler',\n" +" 'queue': q\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['queue'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The listener process configuration shows that the full flexibility of\n" +" # logging configuration is available to dispatch events to handlers however\n" +" # you want.\n" +" # We disable existing loggers to disable the \"setup\" logger used in the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_listener = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s %(processName)-10s %(message)s'\n" +" },\n" +" 'simple': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s %(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" 'level': 'INFO'\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" 'level': 'ERROR'\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console', 'file', 'errors'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # Log some initial events, just to show that logging in the parent works\n" +" # normally.\n" +" logging.config.dictConfig(config_initial)\n" +" logger = logging.getLogger('setup')\n" +" logger.info('About to create workers ...')\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1),\n" +" args=(config_worker,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logger.info('Started worker: %s', wp.name)\n" +" logger.info('About to create listener ...')\n" +" stop_event = Event()\n" +" lp = Process(target=listener_process, name='listener',\n" +" args=(q, stop_event, config_listener))\n" +" lp.start()\n" +" logger.info('Started listener')\n" +" # We now hang around for the workers to finish their work.\n" +" for wp in workers:\n" +" wp.join()\n" +" # Workers all done, listening can now stop.\n" +" # Logging in the parent still works normally.\n" +" logger.info('Telling listener to stop ...')\n" +" stop_event.set()\n" +" lp.join()\n" +" logger.info('All done.')\n" +"\n" +"if __name__ == '__main__':\n" +" main()" + +msgid "Inserting a BOM into messages sent to a SysLogHandler" +msgstr "درج BOM در پیام‌های ارسالی به SysLogHandler" + +msgid "" +":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a set of bytes which have the following structure: an optional pure-ASCII component, followed by a UTF-8 Byte Order Mark " +"(BOM), followed by Unicode encoded using UTF-8. (See the :rfc:`relevant section of the specification <5424#section-6>`.)" +msgstr "" +":rfc:`5424` الزام می‌کند که یک پیام یونیکدی به‌صورت مجموعه‌ای از بایت‌ها با ساختار زیر به دیمن syslog ارسال شود: یک کامپوننت اختیاری ASCII خالص، پس از آن یک نشانگر ترتیب بایت UTF-8 (BOM)، و پس از آن " +"یونیکد کدگذاری‌شده با UTF-8. (به :rfc:`بخش مرتبط از مشخصات <5424#section-6>` مراجعه کنید.)" + +msgid "" +"In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but unfortunately, it was implemented incorrectly, with the BOM appearing at the " +"beginning of the message and hence not allowing any pure-ASCII component to appear before it." +msgstr "" +"در پایتون 3.1، کدی به :class:`~logging.handlers.SysLogHandler` اضافه شد تا یک BOM را در پیام درج کند، اما متأسفانه پیاده‌سازی آن نادرست بود، به‌طوری که BOM در ابتدای پیام قرار می‌گرفت و بنابراین " +"اجازه نمی‌داد هیچ کامپوننت ASCII خالصی پیش از آن قرار بگیرد." + +msgid "" +"As this behaviour is broken, the incorrect BOM insertion code is being removed from Python 3.2.4 and later. However, it is not being replaced, and if you want to produce :rfc:`5424`-compliant " +"messages which include a BOM, an optional pure-ASCII sequence before it and arbitrary Unicode after it, encoded using UTF-8, then you need to do the following:" +msgstr "" +"از آن‌جا که این رفتار معیوب است، کد درج نادرست BOM از Python 3.2.4 و نسخه‌های بعدی حذف می‌شود. با این حال، جایگزینی برای آن در نظر گرفته نمی‌شود، و اگر می‌خواهید پیام‌هایی مطابق :rfc:`5424` تولید کنید " +"که شامل یک BOM، یک دنباله‌ی اختیاری ASCII خالص پیش از آن و یونیکد دلخواه پس از آن باشند و با UTF-8 کدگذاری شده باشند، باید کارهای زیر را انجام دهید:" + +msgid "Attach a :class:`~logging.Formatter` instance to your :class:`~logging.handlers.SysLogHandler` instance, with a format string such as::" +msgstr "نمونه‌ای از :class:`~logging.Formatter` را به نمونه‌ای از :class:`~logging.handlers.SysLogHandler` خود متصل کنید، با رشته قالبی مانند::" + +msgid "'ASCII section\\ufeffUnicode section'" +msgstr "بخش ASCIIبخش یونیکد" + +msgid "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." +msgstr "نقطه‌کد یونیکد U+FEFF، هنگام کدگذاری با UTF-8، به‌صورت UTF-8 BOM کدگذاری خواهد شد — رشته‌بایت ``b'\\xef\\xbb\\xbf'``." + +msgid "" +"Replace the ASCII section with whatever placeholders you like, but make sure that the data that appears in there after substitution is always ASCII (that way, it will remain unchanged after UTF-8 " +"encoding)." +msgstr "" +"بخش ASCII را با هر جای‌نگهدار دلخواهی (placeholder) جایگزین کنید، اما اطمینان حاصل کنید که داده‌ای که پس از جایگزینی در آنجا ظاهر می‌شود، همیشه ASCII باشد (به این ترتیب، پس از کدگذاری UTF-8 بدون تغییر " +"باقی خواهد ماند)." + +msgid "" +"Replace the Unicode section with whatever placeholders you like; if the data which appears there after substitution contains characters outside the ASCII range, that's fine -- it will be encoded " +"using UTF-8." +msgstr "" +"بخش یونیکد را با هر جانگهداری که می‌خواهید جایگزین کنید؛ اگر داده‌ای که پس از جایگزینی در آنجا ظاهر می‌شود شامل نویسه‌هایی خارج از محدوده‌ی ASCII باشد، اشکالی ندارد -- با استفاده از UTF-8 کدگذاری " +"خواهد شد." + +msgid "" +"The formatted message *will* be encoded using UTF-8 encoding by ``SysLogHandler``. If you follow the above rules, you should be able to produce :rfc:`5424`-compliant messages. If you don't, " +"logging may not complain, but your messages will not be RFC 5424-compliant, and your syslog daemon may complain." +msgstr "" +"پیام قالب‌بندی‌شده با استفاده از کدگذاری UTF-8 توسط ``SysLogHandler`` کدگذاری *خواهد شد*. اگر قواعد بالا را دنبال کنید، باید بتوانید پیام‌های سازگار با :rfc:`5424` تولید کنید. اگر این کار را نکنید، " +"ممکن است logging شکایتی نکند، اما پیام‌های شما با RFC 5424 سازگار نخواهند بود و ممکن است دیمن syslog شما شکایت کند." + +msgid "Implementing structured logging" +msgstr "پیاده‌سازی گزارش‌برداری ساختاریافته (structured logging)" + +msgid "" +"Although most logging messages are intended for reading by humans, and thus not readily machine-parseable, there might be circumstances where you want to output messages in a structured format " +"which *is* capable of being parsed by a program (without needing complex regular expressions to parse the log message). This is straightforward to achieve using the logging package. There are a " +"number of ways in which this could be achieved, but the following is a simple approach which uses JSON to serialise the event in a machine-parseable manner::" +msgstr "" +"اگرچه بیشتر پیام‌های logging برای خواندن توسط انسان در نظر گرفته شده‌اند و بنابراین به‌راحتی قابل تجزیه توسط ماشین نیستند، ممکن است شرایطی وجود داشته باشد که بخواهید پیام‌ها را در یک قالب ساختاریافته " +"خروجی دهید که قابل تجزیه توسط یک برنامه *باشد* (بدون نیاز به عبارات باقاعده‌ی پیچیده برای تجزیه‌ی پیام logging). دستیابی به این هدف با استفاده از بسته‌ی logging ساده است. روش‌های متعددی برای رسیدن به " +"این هدف وجود دارد، اما روش زیر یک رویکرد ساده است که از JSON برای سریال‌سازی رویداد به شیوه‌ای قابل تجزیه توسط ماشین استفاده می‌کند::" + +msgid "" +"import json\n" +"import logging\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" "\n" -"class StructuredMessage:\n" -" def __init__(self, message, /, **kwargs):\n" -" self.message = message\n" -" self.kwargs = kwargs\n" -"\n" " def __str__(self):\n" " return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" "\n" @@ -2329,18 +4247,33 @@ msgid "" "logging.basicConfig(level=logging.INFO, format='%(message)s')\n" "logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgstr "" +"import json\n" +"import logging\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +"logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgid "If the above script is run, it prints:" -msgstr "" +msgstr "اگر اسکریپت بالا اجرا شود، خروجی زیر را چاپ می‌کند:" msgid "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": \"bar\"}" -msgstr "" +msgstr "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": \"bar\"}" msgid "Note that the order of items might be different according to the version of Python used." -msgstr "" +msgstr "توجه داشته باشید که ترتیب آیتم‌ها ممکن است بسته به نسخه پایتون مورد استفاده متفاوت باشد." msgid "If you need more specialised processing, you can use a custom JSON encoder, as in the following complete example::" -msgstr "" +msgstr "اگر به پردازش تخصصی‌تر نیاز دارید، می‌توانید از یک کدگذار JSON سفارشی استفاده کنید، مانند مثال کامل زیر::" msgid "" "import json\n" @@ -2373,18 +4306,53 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import json\n" +"import logging\n" +"\n" +"\n" +"class Encoder(json.JSONEncoder):\n" +" def default(self, o):\n" +" if isinstance(o, set):\n" +" return tuple(o)\n" +" elif isinstance(o, str):\n" +" return o.encode('unicode_escape').decode('ascii')\n" +" return super().default(o)\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" s = Encoder().encode(self.kwargs)\n" +" return '%s >>> %s' % (self.message, s)\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +" logging.info(_('message 1', set_value={1, 2, 3}, snowman='\\u2603'))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" msgid "When the above script is run, it prints:" -msgstr "" +msgstr "هنگامی که اسکریپت بالا اجرا می‌شود، خروجی زیر را چاپ می‌کند:" msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" -msgstr "" +msgstr "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" msgid "Customizing handlers with :func:`dictConfig`" -msgstr "" +msgstr "سفارشی‌سازی هندلرها (handlers) با :func:`dictConfig`" -msgid "There are times when you want to customize logging handlers in particular ways, and if you use :func:`dictConfig` you may be able to do this without subclassing. As an example, consider that you may want to set the ownership of a log file. On POSIX, this is easily done using :func:`shutil.chown`, but the file handlers in the stdlib don't offer built-in support. You can customize handler creation using a plain function such as::" +msgid "" +"There are times when you want to customize logging handlers in particular ways, and if you use :func:`dictConfig` you may be able to do this without subclassing. As an example, consider that you " +"may want to set the ownership of a log file. On POSIX, this is easily done using :func:`shutil.chown`, but the file handlers in the stdlib don't offer built-in support. You can customize handler " +"creation using a plain function such as::" msgstr "" +"زمان‌هایی وجود دارد که می‌خواهید هندلرهای گزارش‌گیری را به شیوه‌های خاصی سفارشی‌سازی کنید، و اگر از :func:`dictConfig` استفاده کنید، ممکن است بتوانید این کار را بدون زیرکلاس‌سازی انجام دهید. به‌عنوان مثال، " +"در نظر بگیرید که ممکن است بخواهید مالکیت یک فایل گزارش را تنظیم کنید. در POSIX، این کار به‌راحتی با استفاده از :func:`shutil.chown` انجام می‌شود، اما هندلرهای فایل در stdlib پشتیبانی توکار ارائه " +"نمی‌دهند. می‌توانید ایجاد هندلر را با استفاده از یک تابع ساده مانند::" msgid "" "def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" @@ -2394,9 +4362,15 @@ msgid "" " shutil.chown(filename, *owner)\n" " return logging.FileHandler(filename, mode, encoding)" msgstr "" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)" msgid "You can then specify, in a logging configuration passed to :func:`dictConfig`, that a logging handler be created by calling this function::" -msgstr "" +msgstr "سپس می‌توانید در یک پیکربندی گزارش (logging configuration) که به :func:`dictConfig` داده می‌شود، مشخص کنید که یک هندلری گزارش (logging handler) با فراخوانی این تابع ایجاد شود::" msgid "" "LOGGING = {\n" @@ -2429,9 +4403,38 @@ msgid "" " },\n" "}" msgstr "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # مقادیر زیر از این دیکشنری برداشته می‌شوند و\n" +" # برای ایجاد هندلر (handler)، تنظیم سطح هندلر و\n" +" # قالب‌بند (formatter) آن به کار می‌روند.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # مقادیر زیر به‌عنوان آرگومان‌های کلیدواژه‌ای\n" +" # به فراخوان‌پذیر (callable) ایجادکننده هندلر ارسال می‌شوند.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}" msgid "In this example I am setting the ownership using the ``pulse`` user and group, just for the purposes of illustration. Putting it together into a working script, ``chowntest.py``::" -msgstr "" +msgstr "در این مثال، من مالکیت را صرفاً برای اهداف نمایشی، با استفاده از کاربر و گروه ``pulse`` تنظیم می‌کنم. با ترکیب این موارد در یک اسکریپت کاربردی، ``chowntest.py``::" msgid "" "import logging, logging.config, os, shutil\n" @@ -2477,9 +4480,51 @@ msgid "" "logger = logging.getLogger('mylogger')\n" "logger.debug('A debug message')" msgstr "" +"import logging, logging.config, os, shutil\n" +"\n" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # The values below are popped from this dictionary and\n" +" # used to create the handler, set the handler's level and\n" +" # its formatter.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # The values below are passed to the handler creator callable\n" +" # as keyword arguments.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}\n" +"\n" +"logging.config.dictConfig(LOGGING)\n" +"logger = logging.getLogger('mylogger')\n" +"logger.debug('A debug message')" msgid "To run this, you will probably need to run as ``root``:" -msgstr "" +msgstr "برای اجرای این، احتمالاً باید آن را به‌عنوان ``root`` اجرا کنید:" msgid "" "$ sudo python3.3 chowntest.py\n" @@ -2488,66 +4533,126 @@ msgid "" "$ ls -l chowntest.log\n" "-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" msgstr "" +"$ sudo python3.3 chowntest.py\n" +"$ cat chowntest.log\n" +"2013-11-05 09:34:51,128 DEBUG mylogger A debug message\n" +"$ ls -l chowntest.log\n" +"-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" -msgid "Note that this example uses Python 3.3 because that's where :func:`shutil.chown` makes an appearance. This approach should work with any Python version that supports :func:`dictConfig` - namely, Python 2.7, 3.2 or later. With pre-3.3 versions, you would need to implement the actual ownership change using e.g. :func:`os.chown`." +msgid "" +"Note that this example uses Python 3.3 because that's where :func:`shutil.chown` makes an appearance. This approach should work with any Python version that supports :func:`dictConfig` - namely, " +"Python 2.7, 3.2 or later. With pre-3.3 versions, you would need to implement the actual ownership change using e.g. :func:`os.chown`." msgstr "" +"توجه داشته باشید که این مثال از پایتون 3.3 استفاده می‌کند، زیرا :func:`shutil.chown` در همین نسخه معرفی شده است. این روش باید با هر نسخه‌ای از پایتون که از :func:`dictConfig` پشتیبانی می‌کند کار " +"کند؛ یعنی پایتون 2.7، 3.2 یا جدیدتر. در نسخه‌های پیش از 3.3، شما باید تغییر واقعی مالکیت را مثلاً با استفاده از :func:`os.chown` پیاده‌سازی کنید." msgid "In practice, the handler-creating function may be in a utility module somewhere in your project. Instead of the line in the configuration::" -msgstr "" +msgstr "در عمل، ممکن است تابع ایجادکننده‌ی هندلر (handler) در یک ماژول کمکی در جایی از پروژه‌ی شما باشد. به‌جای خط موجود در پیکربندی::" msgid "'()': owned_file_handler," -msgstr "" +msgstr "'()': owned_file_handler," msgid "you could use e.g.::" -msgstr "" +msgstr "می‌توانید برای مثال از آن استفاده کنید::" msgid "'()': 'ext://project.util.owned_file_handler'," -msgstr "" +msgstr "'()': 'ext://project.util.owned_file_handler'," -msgid "where ``project.util`` can be replaced with the actual name of the package where the function resides. In the above working script, using ``'ext://__main__.owned_file_handler'`` should work. Here, the actual callable is resolved by :func:`dictConfig` from the ``ext://`` specification." +msgid "" +"where ``project.util`` can be replaced with the actual name of the package where the function resides. In the above working script, using ``'ext://__main__.owned_file_handler'`` should work. " +"Here, the actual callable is resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" +"که در آن می‌توانید ``project.util`` را با نام واقعی بسته‌ای که تابع در آن قرار دارد جایگزین کنید. در اسکریپت قابل‌اجرای بالا، استفاده از ``'ext://__main__.owned_file_handler'`` باید کار کند. در " +"اینجا، شیء قابل فراخوانی واقعی توسط :func:`dictConfig` از مشخصه‌ی ``ext://`` تعیین می‌شود." msgid "This example hopefully also points the way to how you could implement other types of file change - e.g. setting specific POSIX permission bits - in the same way, using :func:`os.chmod`." msgstr "" +"امید است این نمونه همچنین نشان دهد که چگونه می‌توانید انواع دیگر تغییر فایل را نیز به همین روش پیاده‌سازی کنید؛ برای مثال، تنظیم بیت‌های دسترسی مشخص POSIX (POSIX permission bits) با استفاده " +"از :func:`os.chmod`." -msgid "Of course, the approach could also be extended to types of handler other than a :class:`~logging.FileHandler` - for example, one of the rotating file handlers, or a different type of handler altogether." -msgstr "" +msgid "" +"Of course, the approach could also be extended to types of handler other than a :class:`~logging.FileHandler` - for example, one of the rotating file handlers, or a different type of handler " +"altogether." +msgstr "البته، می‌توان این رویکرد را به انواع دیگری از هندلر، غیر از :class:`~logging.FileHandler` نیز گسترش داد؛ برای مثال، یکی از هندلرهای فایل چرخشی، یا نوع کاملاً متفاوتی از هندلر." msgid "Using particular formatting styles throughout your application" -msgstr "" +msgstr "استفاده از سبک‌های قالب‌بندی خاص در سراسر برنامه شما" -msgid "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword parameter which, while defaulting to ``%`` for backward compatibility, allowed the specification of ``{`` or ``$`` to support the formatting approaches supported by :meth:`str.format` and :class:`string.Template`. Note that this governs the formatting of logging messages for final output to logs, and is completely orthogonal to how an individual logging message is constructed." +msgid "" +"In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword parameter which, while defaulting to ``%`` for backward compatibility, allowed the specification of ``{`` or ``$`` to " +"support the formatting approaches supported by :meth:`str.format` and :class:`string.Template`. Note that this governs the formatting of logging messages for final output to logs, and is " +"completely orthogonal to how an individual logging message is constructed." msgstr "" +"در پایتون 3.2، یک پارامتر کلیدواژه‌ای ``style`` به :class:`~logging.Formatter` اضافه شد که با وجود داشتن مقدار پیش‌فرض ``%`` برای سازگاری با نسخه‌های قبلی، امکان تعیین ``{`` یا ``$`` را برای " +"پشتیبانی از شیوه‌های قالب‌بندی پشتیبانی‌شده در :meth:`str.format` و :class:`string.Template` فراهم می‌کرد. توجه داشته باشید که این گزینه قالب‌بندی پیام‌های گزارش را برای خروجی نهایی به گزارش‌ها تعیین می‌کند " +"و کاملاً مستقل از چگونگی ساخت یک پیام گزارش منفرد است." -msgid "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take positional parameters for the actual logging message itself, with keyword parameters used only for determining options for how to handle the logging call (e.g. the ``exc_info`` keyword parameter to indicate that traceback information should be logged, or the ``extra`` keyword parameter to indicate additional contextual information to be added to the log). So you cannot directly make logging calls using :meth:`str.format` or :class:`string.Template` syntax, because internally the logging package uses %-formatting to merge the format string and the variable arguments. There would be no changing this while preserving backward compatibility, since all logging calls which are out there in existing code will be using %-format strings." -msgstr "" +msgid "" +"Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take positional parameters for the actual logging message itself, with keyword parameters used only for determining options " +"for how to handle the logging call (e.g. the ``exc_info`` keyword parameter to indicate that traceback information should be logged, or the ``extra`` keyword parameter to indicate additional " +"contextual information to be added to the log). So you cannot directly make logging calls using :meth:`str.format` or :class:`string.Template` syntax, because internally the logging package uses " +"%-formatting to merge the format string and the variable arguments. There would be no changing this while preserving backward compatibility, since all logging calls which are out there in " +"existing code will be using %-format strings." +msgstr "" +"فراخوانی‌های گزارش (:meth:`~Logger.debug`، :meth:`~Logger.info` و غیره) فقط پارامترهای جایگاهی را برای خودِ پیام گزارش واقعی می‌پذیرند و پارامترهای کلیدواژه‌ای تنها برای تعیین گزینه‌هایی درباره‌ی نحوه‌ی " +"مدیریت فراخوانی گزارش استفاده می‌شوند (برای مثال، پارامتر کلیدواژه‌ای ``exc_info`` برای نشان دادن اینکه اطلاعات ردگیری پشته باید ثبت شود، یا پارامتر کلیدواژه‌ای ``extra`` برای نشان دادن اطلاعات " +"زمینه‌ای اضافی که باید به گزارش اضافه شود). بنابراین نمی‌توانید مستقیماً فراخوانی‌های گزارش را با سینتکس :meth:`str.format` یا :class:`string.Template` انجام دهید، زیرا بسته‌ی logging به‌صورت داخلی از %-" +"formatting برای ادغام رشته‌ی قالب و آرگومان‌های متغیر استفاده می‌کند. در صورت حفظ سازگاری با عقب، این قابل تغییر نخواهد بود، زیرا تمام فراخوانی‌های گزارش در کدهای موجود از رشته‌های %-format استفاده " +"خواهند کرد." -msgid "There have been suggestions to associate format styles with specific loggers, but that approach also runs into backward compatibility problems because any existing code could be using a given logger name and using %-formatting." +msgid "" +"There have been suggestions to associate format styles with specific loggers, but that approach also runs into backward compatibility problems because any existing code could be using a given " +"logger name and using %-formatting." msgstr "" +"پیشنهادهایی برای مرتبط کردن سبک‌های قالب‌بندی با گزارش‌گیرهای خاص مطرح شده است، اما آن رویکرد نیز با مشکلات سازگاری با نسخه‌های پیشین مواجه می‌شود، زیرا هر کد موجودی ممکن است از یک نام گزارش‌گیر مشخص و از %-" +"formatting استفاده کند." -msgid "For logging to work interoperably between any third-party libraries and your code, decisions about formatting need to be made at the level of the individual logging call. This opens up a couple of ways in which alternative formatting styles can be accommodated." +msgid "" +"For logging to work interoperably between any third-party libraries and your code, decisions about formatting need to be made at the level of the individual logging call. This opens up a couple " +"of ways in which alternative formatting styles can be accommodated." msgstr "" +"برای اینکه گزارش کردن (logging) میان هر کتابخانه شخص ثالثی و کد شما به‌صورت تعامل‌پذیر کار کند، تصمیم‌های مربوط به قالب‌بندی باید در سطح تک‌تک فراخوانی‌های گزارش اتخاذ شوند. این موضوع چند راه برای پشتیبانی " +"از سبک‌های قالب‌بندی جایگزین باز می‌کند." msgid "Using LogRecord factories" -msgstr "" +msgstr "استفاده از کارخانه‌های LogRecord" -msgid "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned above, the logging package gained the ability to allow users to set their own :class:`LogRecord` subclasses, using the :func:`setLogRecordFactory` function. You can use this to set your own subclass of :class:`LogRecord`, which does the Right Thing by overriding the :meth:`~LogRecord.getMessage` method. The base class implementation of this method is where the ``msg % args`` formatting happens, and where you can substitute your alternate formatting; however, you should be careful to support all formatting styles and allow %-formatting as the default, to ensure interoperability with other code. Care should also be taken to call ``str(self.msg)``, just as the base implementation does." +msgid "" +"In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned above, the logging package gained the ability to allow users to set their own :class:`LogRecord` subclasses, using " +"the :func:`setLogRecordFactory` function. You can use this to set your own subclass of :class:`LogRecord`, which does the Right Thing by overriding the :meth:`~LogRecord.getMessage` method. The " +"base class implementation of this method is where the ``msg % args`` formatting happens, and where you can substitute your alternate formatting; however, you should be careful to support all " +"formatting styles and allow %-formatting as the default, to ensure interoperability with other code. Care should also be taken to call ``str(self.msg)``, just as the base implementation does." msgstr "" +"در Python 3.2، همراه با تغییرات :class:`~logging.Formatter` که در بالا ذکر شد، بسته‌ی logging این قابلیت را یافت که به کاربران اجازه دهد زیرکلاس‌های :class:`LogRecord` خودشان را با استفاده از " +"تابع :func:`setLogRecordFactory` تنظیم کنند. شما می‌توانید از این امکان برای تنظیم زیرکلاس خودتان از :class:`LogRecord` استفاده کنید، به‌طوری که با بازنویسی متد :meth:`~LogRecord.getMessage` رفتار " +"درست را داشته باشد. پیاده‌سازی این متد در کلاس پایه، جایی است که قالب‌بندی ``msg % args`` انجام می‌شود و شما می‌توانید قالب‌بندی جایگزین خود را به‌جای آن به‌کار ببرید؛ با این حال، باید دقت کنید که از " +"همه‌ی سبک‌های قالب‌بندی پشتیبانی کنید و قالب‌بندی درصدی (%-formatting) را به‌عنوان پیش‌فرض مجاز بدانید، تا تعامل‌پذیری با سایر کدها تضمین شود. همچنین باید دقت کنید که ``str(self.msg)`` را فراخوانی کنید، " +"درست همان‌طور که پیاده‌سازی پایه این کار را انجام می‌دهد." msgid "Refer to the reference documentation on :func:`setLogRecordFactory` and :class:`LogRecord` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، به مستندات مرجع درباره :func:`setLogRecordFactory` و :class:`LogRecord` مراجعه کنید." msgid "Using custom message objects" -msgstr "" +msgstr "استفاده از اشیای پیام سفارشی" -msgid "There is another, perhaps simpler way that you can use {}- and $- formatting to construct your individual log messages. You may recall (from :ref:`arbitrary-object-messages`) that when logging you can use an arbitrary object as a message format string, and that the logging package will call :func:`str` on that object to get the actual format string. Consider the following two classes::" +msgid "" +"There is another, perhaps simpler way that you can use {}- and $- formatting to construct your individual log messages. You may recall (from :ref:`arbitrary-object-messages`) that when logging " +"you can use an arbitrary object as a message format string, and that the logging package will call :func:`str` on that object to get the actual format string. Consider the following two classes::" msgstr "" +"راه دیگری وجود دارد، شاید ساده‌تر، که می‌توانید از قالب‌بندی {}- و $- برای ساخت پیام‌های گزارش مستقل خود استفاده کنید. ممکن است به یاد داشته باشید (از :ref:`arbitrary-object-messages`) که هنگام گزارش‌گیری " +"می‌توانید از یک شیء دلخواه به‌عنوان رشته‌ی قالب پیام استفاده کنید و اینکه بسته‌ی logging تابع :func:`str` را روی آن شیء فراخوانی می‌کند تا رشته‌ی قالب واقعی به دست آید. دو کلاس زیر را در نظر بگیرید::" -msgid "Either of these can be used in place of a format string, to allow {}- or $-formatting to be used to build the actual \"message\" part which appears in the formatted log output in place of “%(message)s” or “{message}” or “$message”. If you find it a little unwieldy to use the class names whenever you want to log something, you can make it more palatable if you use an alias such as ``M`` or ``_`` for the message (or perhaps ``__``, if you are using ``_`` for localization)." +msgid "" +"Either of these can be used in place of a format string, to allow {}- or $-formatting to be used to build the actual \"message\" part which appears in the formatted log output in place of “%" +"(message)s” or “{message}” or “$message”. If you find it a little unwieldy to use the class names whenever you want to log something, you can make it more palatable if you use an alias such as " +"``M`` or ``_`` for the message (or perhaps ``__``, if you are using ``_`` for localization)." msgstr "" +"می‌توان از هر یک از این دو به‌جای یک رشته‌ی قالب استفاده کرد تا امکان به‌کارگیری قالب‌بندی {} یا $ برای ساخت بخش واقعی «پیام» فراهم شود؛ بخشی که در خروجی گزارش قالب‌بندی‌شده به‌جای «%(message)s» یا " +"«{message}» یا «$message» ظاهر می‌شود. اگر هر بار که می‌خواهید چیزی را گزارش کنید، استفاده از نام کلاس‌ها را کمی دشوار می‌دانید، می‌توانید با استفاده از یک نام مستعار مانند ``M`` یا ``_`` برای پیام، آن " +"را مطلوب‌تر کنید (یا شاید ``__``، اگر از ``_`` برای محلی‌سازی استفاده می‌کنید)." msgid "Examples of this approach are given below. Firstly, formatting with :meth:`str.format`::" -msgstr "" +msgstr "نمونه‌هایی از این رویکرد در زیر آمده است. ابتدا، قالب‌بندی با :meth:`str.format`::" msgid "" ">>> __ = BraceMessage\n" @@ -2561,9 +4666,19 @@ msgid "" ">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', point=p))\n" "Message with coordinates: (0.50, 0.50)" msgstr "" +">>> __ = BraceMessage\n" +">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', point=p))\n" +"Message with coordinates: (0.50, 0.50)" msgid "Secondly, formatting with :class:`string.Template`::" -msgstr "" +msgstr "دوم، قالب‌بندی با :class:`string.Template`::" msgid "" ">>> __ = DollarMessage\n" @@ -2571,15 +4686,33 @@ msgid "" "Message with 2 placeholders\n" ">>>" msgstr "" +">>> __ = DollarMessage\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" -msgid "One thing to note is that you pay no significant performance penalty with this approach: the actual formatting happens not when you make the logging call, but when (and if) the logged message is actually about to be output to a log by a handler. So the only slightly unusual thing which might trip you up is that the parentheses go around the format string and the arguments, not just the format string. That’s because the __ notation is just syntax sugar for a constructor call to one of the :samp:`{XXX}Message` classes shown above." +msgid "" +"One thing to note is that you pay no significant performance penalty with this approach: the actual formatting happens not when you make the logging call, but when (and if) the logged message is " +"actually about to be output to a log by a handler. So the only slightly unusual thing which might trip you up is that the parentheses go around the format string and the arguments, not just the " +"format string. That’s because the __ notation is just syntax sugar for a constructor call to one of the :samp:`{XXX}Message` classes shown above." msgstr "" +"نکته‌ای که باید به آن توجه کنید این است که با این رویکرد هزینه‌ی عملکردی قابل‌توجهی نمی‌پردازید: قالب‌بندی واقعی نه زمانی که فراخوانی گزارش‌گیری (logging) را انجام می‌دهید، بلکه زمانی (و در صورتی) انجام " +"می‌شود که پیام گزارش‌شده واقعاً در آستانه‌ی خروجی به یک گزارش توسط یک هندلر (handler) باشد. بنابراین تنها نکته‌ی کمی غیرمعمول که ممکن است شما را به اشتباه بیندازد این است که پرانتزها دور رشته‌ی قالب و " +"آرگومان‌ها قرار می‌گیرند، نه فقط دور رشته‌ی قالب. دلیلش این است که نمادگذاری __ صرفاً قند نحوی برای فراخوانی سازنده‌ی یکی از کلاس‌های :samp:`{XXX}Message` است که در بالا نشان داده شده‌اند." msgid "Configuring filters with :func:`dictConfig`" -msgstr "" +msgstr "پیکربندی فیلترها با :func:`dictConfig`" -msgid "You *can* configure filters using :func:`~logging.config.dictConfig`, though it might not be obvious at first glance how to do it (hence this recipe). Since :class:`~logging.Filter` is the only filter class included in the standard library, and it is unlikely to cater to many requirements (it's only there as a base class), you will typically need to define your own :class:`~logging.Filter` subclass with an overridden :meth:`~logging.Filter.filter` method. To do this, specify the ``()`` key in the configuration dictionary for the filter, specifying a callable which will be used to create the filter (a class is the most obvious, but you can provide any callable which returns a :class:`~logging.Filter` instance). Here is a complete example::" +msgid "" +"You *can* configure filters using :func:`~logging.config.dictConfig`, though it might not be obvious at first glance how to do it (hence this recipe). Since :class:`~logging.Filter` is the only " +"filter class included in the standard library, and it is unlikely to cater to many requirements (it's only there as a base class), you will typically need to define your " +"own :class:`~logging.Filter` subclass with an overridden :meth:`~logging.Filter.filter` method. To do this, specify the ``()`` key in the configuration dictionary for the filter, specifying a " +"callable which will be used to create the filter (a class is the most obvious, but you can provide any callable which returns a :class:`~logging.Filter` instance). Here is a complete example::" msgstr "" +"شما *می‌توانید* فیلترها را با استفاده از :func:`~logging.config.dictConfig` پیکربندی کنید، هرچند ممکن است در نگاه اول نحوه انجام این کار واضح نباشد (به همین دلیل این دستور ارائه شده است). از آنجا " +"که :class:`~logging.Filter` تنها کلاس فیلتر موجود در کتابخانه استاندارد است و بعید است نیازمندی‌های زیادی را پوشش دهد (این کلاس فقط به‌عنوان یک کلاس پایه وجود دارد)، معمولاً باید زیرکلاس خود " +"از :class:`~logging.Filter` را با یک متد :meth:`~logging.Filter.filter` بازنویسی‌شده تعریف کنید. برای این کار، کلید ``()`` را در دیکشنری پیکربندی فیلتر مشخص کنید و یک فراخوان‌پذیر را تعیین کنید که " +"برای ایجاد فیلتر استفاده خواهد شد (یک کلاس واضح‌ترین گزینه است، اما می‌توانید هر فراخوان‌پذیری را ارائه دهید که یک نمونه از :class:`~logging.Filter` را برمی‌گرداند). در ادامه یک مثال کامل آمده است::" msgid "" "import logging\n" @@ -2624,30 +4757,84 @@ msgid "" " logging.debug('hello')\n" " logging.debug('hello - noshow')" msgstr "" +"import logging\n" +"import logging.config\n" +"import sys\n" +"\n" +"class MyFilter(logging.Filter):\n" +" def __init__(self, param=None):\n" +" self.param = param\n" +"\n" +" def filter(self, record):\n" +" if self.param is None:\n" +" allow = True\n" +" else:\n" +" allow = self.param not in record.msg\n" +" if allow:\n" +" record.msg = 'changed: ' + record.msg\n" +" return allow\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'filters': {\n" +" 'myfilter': {\n" +" '()': MyFilter,\n" +" 'param': 'noshow',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'filters': ['myfilter']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console']\n" +" },\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.debug('hello')\n" +" logging.debug('hello - noshow')" msgid "This example shows how you can pass configuration data to the callable which constructs the instance, in the form of keyword parameters. When run, the above script will print:" -msgstr "" +msgstr "این مثال نشان می‌دهد که چگونه می‌توانید داده‌های پیکربندی را در قالب پارامترهای کلیدواژه‌ای به شیء فراخوان‌پذیری که نمونه را می‌سازد، منتقل کنید. هنگام اجرا، اسکریپت بالا چاپ خواهد کرد:" msgid "changed: hello" -msgstr "" +msgstr "تغییر کرد: سلام" msgid "which shows that the filter is working as configured." -msgstr "" +msgstr "که نشان می‌دهد فیلتر همان‌طور که پیکربندی شده است کار می‌کند." msgid "A couple of extra points to note:" -msgstr "" +msgstr "چند نکته‌ی اضافی برای توجه:" -msgid "If you can't refer to the callable directly in the configuration (e.g. if it lives in a different module, and you can't import it directly where the configuration dictionary is), you can use the form ``ext://...`` as described in :ref:`logging-config-dict-externalobj`. For example, you could have used the text ``'ext://__main__.MyFilter'`` instead of ``MyFilter`` in the above example." +msgid "" +"If you can't refer to the callable directly in the configuration (e.g. if it lives in a different module, and you can't import it directly where the configuration dictionary is), you can use the " +"form ``ext://...`` as described in :ref:`logging-config-dict-externalobj`. For example, you could have used the text ``'ext://__main__.MyFilter'`` instead of ``MyFilter`` in the above example." msgstr "" +"اگر نمی‌توانید در پیکربندی مستقیماً به فراخوان‌پذیر ارجاع دهید (برای نمونه، اگر در ماژول دیگری قرار دارد و نمی‌توانید آن را مستقیماً در جایی که دیکشنری پیکربندی قرار دارد ایمپورت کنید)، می‌توانید از " +"قالب ``ext://...`` همان‌طور که در :ref:`logging-config-dict-externalobj` توضیح داده شده است استفاده کنید. برای نمونه، می‌توانستید در مثال بالا به‌جای ``MyFilter`` از متن ``'ext://" +"__main__.MyFilter'`` استفاده کنید." -msgid "As well as for filters, this technique can also be used to configure custom handlers and formatters. See :ref:`logging-config-dict-userdef` for more information on how logging supports using user-defined objects in its configuration, and see the other cookbook recipe :ref:`custom-handlers` above." +msgid "" +"As well as for filters, this technique can also be used to configure custom handlers and formatters. See :ref:`logging-config-dict-userdef` for more information on how logging supports using user-" +"defined objects in its configuration, and see the other cookbook recipe :ref:`custom-handlers` above." msgstr "" +"علاوه بر فیلترها، این روش می‌تواند برای پیکربندی هندلرهای سفارشی و قالب‌بندهای سفارشی نیز به‌کار رود. برای اطلاعات بیشتر درباره‌ی نحوه‌ی پشتیبانی گزارش‌گیری از استفاده از اشیای تعریف‌شده توسط کاربر در " +"پیکربندی خود، :ref:`logging-config-dict-userdef` را ببینید و دستور پخت دیگر :ref:`custom-handlers` را در بالا ببینید." msgid "Customized exception formatting" -msgstr "" +msgstr "قالب‌بندی سفارشی استثنا" -msgid "There might be times when you want to do customized exception formatting - for argument's sake, let's say you want exactly one line per logged event, even when exception information is present. You can do this with a custom formatter class, as shown in the following example::" +msgid "" +"There might be times when you want to do customized exception formatting - for argument's sake, let's say you want exactly one line per logged event, even when exception information is present. " +"You can do this with a custom formatter class, as shown in the following example::" msgstr "" +"ممکن است گاهی بخواهید قالب‌بندی سفارشی استثنا را انجام دهید — برای مثال، فرض کنید دقیقاً یک خط به‌ازای هر رویداد ثبت‌شده می‌خواهید، حتی زمانی که اطلاعات استثنا وجود دارد. می‌توانید این کار را با یک " +"کلاس قالب‌بند سفارشی انجام دهید، همان‌طور که در مثال زیر نشان داده شده است::" msgid "" "import logging\n" @@ -2686,23 +4873,71 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import logging\n" +"\n" +"class OneLineExceptionFormatter(logging.Formatter):\n" +" def formatException(self, exc_info):\n" +" \"\"\"\n" +" Format an exception so that it prints on a single line.\n" +" \"\"\"\n" +" result = super().formatException(exc_info)\n" +" return repr(result) # or format into one line however you want to\n" +"\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" if record.exc_text:\n" +" s = s.replace('\\n', '') + '|'\n" +" return s\n" +"\n" +"def configure_logging():\n" +" fh = logging.FileHandler('output.txt', 'w')\n" +" f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',\n" +" '%d/%m/%Y %H:%M:%S')\n" +" fh.setFormatter(f)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(fh)\n" +"\n" +"def main():\n" +" configure_logging()\n" +" logging.info('Sample message')\n" +" try:\n" +" x = 1 / 0\n" +" except ZeroDivisionError as e:\n" +" logging.exception('ZeroDivisionError: %s', e)\n" +"\n" +"if __name__ == '__main__':\n" +" main()" msgid "When run, this produces a file with exactly two lines:" -msgstr "" +msgstr "هنگام اجرا، این یک فایل با دقیقاً دو خط ایجاد می‌کند:" msgid "" "28/01/2015 07:21:23|INFO|Sample message|\n" "28/01/2015 07:21:23|ERROR|ZeroDivisionError: division by zero|'Traceback (most recent call last):\\n File \"logtest7.py\", line 30, in main\\n x = 1 / 0\\nZeroDivisionError: division by zero'|" msgstr "" +"28/01/2015 07:21:23|INFO|Sample message|\n" +"28/01/2015 07:21:23|ERROR|ZeroDivisionError: division by zero|'Traceback (most recent call last):\\n File \"logtest7.py\", line 30, in main\\n x = 1 / 0\\nZeroDivisionError: division by zero'|" -msgid "While the above treatment is simplistic, it points the way to how exception information can be formatted to your liking. The :mod:`traceback` module may be helpful for more specialized needs." -msgstr "" +msgid "" +"While the above treatment is simplistic, it points the way to how exception information can be formatted to your liking. The :mod:`traceback` module may be helpful for more specialized needs." +msgstr "اگرچه روش فوق ساده است، اما نشان می‌دهد که چگونه می‌توان اطلاعات استثنا را مطابق میل شما قالب‌بندی کرد. ماژول :mod:`traceback` ممکن است برای نیازهای تخصصی‌تر مفید باشد." msgid "Speaking logging messages" -msgstr "" +msgstr "بیان پیام‌های گزارش‌گیری" -msgid "There might be situations when it is desirable to have logging messages rendered in an audible rather than a visible format. This is easy to do if you have text-to-speech (TTS) functionality available in your system, even if it doesn't have a Python binding. Most TTS systems have a command line program you can run, and this can be invoked from a handler using :mod:`subprocess`. It's assumed here that TTS command line programs won't expect to interact with users or take a long time to complete, and that the frequency of logged messages will be not so high as to swamp the user with messages, and that it's acceptable to have the messages spoken one at a time rather than concurrently, The example implementation below waits for one message to be spoken before the next is processed, and this might cause other handlers to be kept waiting. Here is a short example showing the approach, which assumes that the ``espeak`` TTS package is available::" -msgstr "" +msgid "" +"There might be situations when it is desirable to have logging messages rendered in an audible rather than a visible format. This is easy to do if you have text-to-speech (TTS) functionality " +"available in your system, even if it doesn't have a Python binding. Most TTS systems have a command line program you can run, and this can be invoked from a handler using :mod:`subprocess`. It's " +"assumed here that TTS command line programs won't expect to interact with users or take a long time to complete, and that the frequency of logged messages will be not so high as to swamp the user " +"with messages, and that it's acceptable to have the messages spoken one at a time rather than concurrently, The example implementation below waits for one message to be spoken before the next is " +"processed, and this might cause other handlers to be kept waiting. Here is a short example showing the approach, which assumes that the ``espeak`` TTS package is available::" +msgstr "" +"ممکن است موقعیت‌هایی وجود داشته باشد که مطلوب است پیام‌های گزارش به‌جای قالب دیداری، در قالب شنیداری ارائه شوند. اگر قابلیت تبدیل متن به گفتار (TTS) در سیستم شما در دسترس باشد، انجام این کار آسان است، " +"حتی اگر اتصال پایتون (Python binding) نداشته باشد. بیشتر سیستم‌های TTS یک برنامه‌ی خط فرمان دارند که می‌توانید آن را اجرا کنید، و می‌توان آن را از یک هندلر (handler) با استفاده از :mod:`subprocess` " +"فراخوانی کرد. در اینجا فرض بر این است که برنامه‌های خط فرمان TTS انتظار تعامل با کاربران را ندارند یا برای تکمیل شدن به زمان زیادی نیاز ندارند، و اینکه نرخ پیام‌های گزارش‌شده آن‌قدر بالا نیست که کاربر " +"را با پیام‌ها غرق کند، و اینکه قابل قبول است پیام‌ها یکی‌یکی به‌جای همزمان گفته شوند. پیاده‌سازی مثال زیر، پیش از پردازش پیام بعدی، منتظر می‌ماند تا یک پیام گفته شود، و این ممکن است باعث شود سایر " +"هندلرها در انتظار بمانند. در اینجا یک مثال کوتاه برای نشان دادن این رویکرد آمده است که فرض می‌کند بسته‌ی TTS ``espeak`` در دسترس است::" msgid "" "import logging\n" @@ -2734,30 +4969,83 @@ msgid "" " configure_logging()\n" " sys.exit(main())" msgstr "" +"import logging\n" +"import subprocess\n" +"import sys\n" +"\n" +"class TTSHandler(logging.Handler):\n" +" def emit(self, record):\n" +" msg = self.format(record)\n" +" # Speak slowly in a female English voice\n" +" cmd = ['espeak', '-s150', '-ven+f3', msg]\n" +" p = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n" +" stderr=subprocess.STDOUT)\n" +" # wait for the program to finish\n" +" p.communicate()\n" +"\n" +"def configure_logging():\n" +" h = TTSHandler()\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # the default formatter just returns the message\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"def main():\n" +" logging.info('Hello')\n" +" logging.debug('Goodbye')\n" +"\n" +"if __name__ == '__main__':\n" +" configure_logging()\n" +" sys.exit(main())" msgid "When run, this script should say \"Hello\" and then \"Goodbye\" in a female voice." -msgstr "" +msgstr "هنگام اجرا، این اسکریپت باید «سلام» و سپس «خداحافظ» را با صدای زن بگوید." msgid "The above approach can, of course, be adapted to other TTS systems and even other systems altogether which can process messages via external programs run from a command line." msgstr "" +"البته می‌توان رویکرد بالا را با سامانه‌های متن به گفتار (TTS) دیگر و حتی سامانه‌های دیگری به‌کلی تطبیق داد، سامانه‌هایی که می‌توانند پیام‌ها را از طریق برنامه‌های خارجی که از خط فرمان اجرا می‌شوند پردازش " +"کنند." msgid "Buffering logging messages and outputting them conditionally" -msgstr "" +msgstr "بافر کردن پیام‌های گزارش‌دهی و خروجی دادن آن‌ها به‌صورت شرطی" -msgid "There might be situations where you want to log messages in a temporary area and only output them if a certain condition occurs. For example, you may want to start logging debug events in a function, and if the function completes without errors, you don't want to clutter the log with the collected debug information, but if there is an error, you want all the debug information to be output as well as the error." +msgid "" +"There might be situations where you want to log messages in a temporary area and only output them if a certain condition occurs. For example, you may want to start logging debug events in a " +"function, and if the function completes without errors, you don't want to clutter the log with the collected debug information, but if there is an error, you want all the debug information to be " +"output as well as the error." msgstr "" +"ممکن است شرایطی وجود داشته باشد که بخواهید پیام‌ها را در یک ناحیه موقت ثبت کنید و تنها در صورت بروز یک شرط خاص آن‌ها را خروجی دهید. برای مثال، ممکن است بخواهید ثبت رویدادهای اشکال‌زدایی را در یک " +"تابع آغاز کنید و اگر تابع بدون خطا به پایان برسد، نخواهید گزارش را با اطلاعات اشکال‌زدایی جمع‌آوری‌شده شلوغ کنید، اما اگر خطایی رخ دهد، بخواهید تمام اطلاعات اشکال‌زدایی نیز همراه با خطا خروجی داده شود." -msgid "Here is an example which shows how you could do this using a decorator for your functions where you want logging to behave this way. It makes use of the :class:`logging.handlers.MemoryHandler`, which allows buffering of logged events until some condition occurs, at which point the buffered events are ``flushed`` - passed to another handler (the ``target`` handler) for processing. By default, the ``MemoryHandler`` flushed when its buffer gets filled up or an event whose level is greater than or equal to a specified threshold is seen. You can use this recipe with a more specialised subclass of ``MemoryHandler`` if you want custom flushing behavior." +msgid "" +"Here is an example which shows how you could do this using a decorator for your functions where you want logging to behave this way. It makes use of the :class:`logging.handlers.MemoryHandler`, " +"which allows buffering of logged events until some condition occurs, at which point the buffered events are ``flushed`` - passed to another handler (the ``target`` handler) for processing. By " +"default, the ``MemoryHandler`` flushed when its buffer gets filled up or an event whose level is greater than or equal to a specified threshold is seen. You can use this recipe with a more " +"specialised subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" +"در اینجا مثالی وجود دارد که نشان می‌دهد چگونه می‌توانید این کار را با استفاده از یک دکوراتور برای توابعی انجام دهید که می‌خواهید گزارش‌گیری در آن‌ها به این شکل رفتار کند. این مثال " +"از :class:`logging.handlers.MemoryHandler` استفاده می‌کند، که امکان بافر کردن رویدادهای گزارش‌شده را تا زمانی که شرطی رخ دهد فراهم می‌کند؛ در آن نقطه، رویدادهای بافر شده ``flushed`` می‌شوند؛ یعنی برای " +"پردازش به یک هندلر دیگر (هندلر ``target``) فرستاده می‌شوند. به‌طور پیش‌فرض، ``MemoryHandler`` زمانی تخلیه می‌شود که بافر آن پر شود یا رویدادی که سطح آن بزرگ‌تر یا مساوی با یک آستانه مشخص است مشاهده " +"شود. اگر رفتار تخلیه سفارشی می‌خواهید، می‌توانید از این راهکار با یک زیرکلاس تخصصی‌تر از ``MemoryHandler`` استفاده کنید." -msgid "The example script has a simple function, ``foo``, which just cycles through all the logging levels, writing to ``sys.stderr`` to say what level it's about to log at, and then actually logging a message at that level. You can pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." +msgid "" +"The example script has a simple function, ``foo``, which just cycles through all the logging levels, writing to ``sys.stderr`` to say what level it's about to log at, and then actually logging a " +"message at that level. You can pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" +"اسکریپت نمونه یک تابع ساده، ``foo``، دارد که فقط تمام سطوح گزارش را طی می‌کند، در ``sys.stderr`` می‌نویسد که قرار است در چه سطحی گزارش کند، و سپس در عمل پیامی را در آن سطح گزارش می‌کند. شما می‌توانید " +"پارامتری به ``foo`` بدهید که اگر مقدار آن true باشد، در سطوح ERROR و CRITICAL گزارش می‌کند؛ در غیر این صورت، فقط در سطوح DEBUG، INFO و WARNING گزارش می‌کند." -msgid "The script just arranges to decorate ``foo`` with a decorator which will do the conditional logging that's required. The decorator takes a logger as a parameter and attaches a memory handler for the duration of the call to the decorated function. The decorator can be additionally parameterised using a target handler, a level at which flushing should occur, and a capacity for the buffer (number of records buffered). These default to a :class:`~logging.StreamHandler` which writes to ``sys.stderr``, ``logging.ERROR`` and ``100`` respectively." +msgid "" +"The script just arranges to decorate ``foo`` with a decorator which will do the conditional logging that's required. The decorator takes a logger as a parameter and attaches a memory handler for " +"the duration of the call to the decorated function. The decorator can be additionally parameterised using a target handler, a level at which flushing should occur, and a capacity for the buffer " +"(number of records buffered). These default to a :class:`~logging.StreamHandler` which writes to ``sys.stderr``, ``logging.ERROR`` and ``100`` respectively." msgstr "" +"این اسکریپت فقط مقدمات آراستن ``foo`` با یک دکوراتور را فراهم می‌کند؛ دکوراتوری که گزارش کردن شرطی مورد نیاز را انجام می‌دهد. این دکوراتور یک گزارش‌گیر را به‌عنوان پارامتر می‌گیرد و یک هندلر حافظه را در طول " +"فراخوانی تابع آراسته‌شده متصل می‌کند. علاوه بر این، می‌توان این دکوراتور را با استفاده از یک هندلر هدف، سطحی که تخلیه باید در آن انجام شود، و ظرفیت بافر (تعداد رکوردهای موجود در بافر) نیز پارامتریزه " +"کرد. مقادیر پیش‌فرض این موارد به‌ترتیب عبارت‌اند از یک :class:`~logging.StreamHandler` که به ``sys.stderr`` می‌نویسد، ``logging.ERROR`` و ``100``." msgid "Here's the script::" -msgstr "" +msgstr "این هم اسکریپت::" msgid "" "import logging\n" @@ -2821,9 +5109,69 @@ msgid "" " write_line('Calling decorated foo with True')\n" " assert decorated_foo(True)" msgstr "" +"import logging\n" +"from logging.handlers import MemoryHandler\n" +"import sys\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"logger.addHandler(logging.NullHandler())\n" +"\n" +"def log_if_errors(logger, target_handler=None, flush_level=None, capacity=None):\n" +" if target_handler is None:\n" +" target_handler = logging.StreamHandler()\n" +" if flush_level is None:\n" +" flush_level = logging.ERROR\n" +" if capacity is None:\n" +" capacity = 100\n" +" handler = MemoryHandler(capacity, flushLevel=flush_level, target=target_handler)\n" +"\n" +" def decorator(fn):\n" +" def wrapper(*args, **kwargs):\n" +" logger.addHandler(handler)\n" +" try:\n" +" return fn(*args, **kwargs)\n" +" except Exception:\n" +" logger.exception('call failed')\n" +" raise\n" +" finally:\n" +" super(MemoryHandler, handler).flush()\n" +" logger.removeHandler(handler)\n" +" return wrapper\n" +"\n" +" return decorator\n" +"\n" +"def write_line(s):\n" +" sys.stderr.write('%s\\n' % s)\n" +"\n" +"def foo(fail=False):\n" +" write_line('about to log at DEBUG ...')\n" +" logger.debug('Actually logged at DEBUG')\n" +" write_line('about to log at INFO ...')\n" +" logger.info('Actually logged at INFO')\n" +" write_line('about to log at WARNING ...')\n" +" logger.warning('Actually logged at WARNING')\n" +" if fail:\n" +" write_line('about to log at ERROR ...')\n" +" logger.error('Actually logged at ERROR')\n" +" write_line('about to log at CRITICAL ...')\n" +" logger.critical('Actually logged at CRITICAL')\n" +" return fail\n" +"\n" +"decorated_foo = log_if_errors(logger)(foo)\n" +"\n" +"if __name__ == '__main__':\n" +" logger.setLevel(logging.DEBUG)\n" +" write_line('Calling undecorated foo with False')\n" +" assert not foo(False)\n" +" write_line('Calling undecorated foo with True')\n" +" assert foo(True)\n" +" write_line('Calling decorated foo with False')\n" +" assert not decorated_foo(False)\n" +" write_line('Calling decorated foo with True')\n" +" assert decorated_foo(True)" msgid "When this script is run, the following output should be observed:" -msgstr "" +msgstr "هنگامی که این اسکریپت اجرا می‌شود، باید خروجی زیر مشاهده شود:" msgid "" "Calling undecorated foo with False\n" @@ -2852,26 +5200,123 @@ msgid "" "about to log at CRITICAL ...\n" "Actually logged at CRITICAL" msgstr "" +"Calling undecorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling undecorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"about to log at CRITICAL ...\n" +"Calling decorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling decorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"Actually logged at DEBUG\n" +"Actually logged at INFO\n" +"Actually logged at WARNING\n" +"Actually logged at ERROR\n" +"about to log at CRITICAL ...\n" +"Actually logged at CRITICAL" msgid "As you can see, actual logging output only occurs when an event is logged whose severity is ERROR or greater, but in that case, any previous events at lower severities are also logged." msgstr "" +"همان‌طور که می‌بینید، خروجی واقعی گزارش کردن (logging) تنها زمانی رخ می‌دهد که رویدادی گزارش شود که شدت آن ERROR یا بالاتر باشد، اما در آن حالت، هر یک از رویدادهای قبلی با شدت‌های پایین‌تر نیز گزارش می‌شوند." msgid "You can of course use the conventional means of decoration::" -msgstr "" +msgstr "البته می‌توانید از روش‌های مرسوم دکوراسیون استفاده کنید::" msgid "" "@log_if_errors(logger)\n" "def foo(fail=False):\n" " ..." msgstr "" +"@log_if_errors(logger)\n" +"def foo(fail=False):\n" +" ..." msgid "Sending logging messages to email, with buffering" +msgstr "ارسال پیام‌های گزارش به ایمیل، همراه با بافرینگ (buffering)" + +msgid "" +"To illustrate how you can send log messages via email, so that a set number of messages are sent per email, you can subclass :class:`~logging.handlers.BufferingHandler`. In the following " +"example, which you can adapt to suit your specific needs, a simple test harness is provided which allows you to run the script with command line arguments specifying what you typically need to " +"send things via SMTP. (Run the downloaded script with the ``-h`` argument to see the required and optional arguments.)" msgstr "" +"برای نشان دادن این‌که چگونه می‌توانید پیام‌های گزارش را از طریق ایمیل ارسال کنید، به‌گونه‌ای که تعداد مشخصی پیام در هر ایمیل فرستاده شود، می‌توانید زیرکلاسی از :class:`~logging.handlers.BufferingHandler` " +"بسازید. در مثال زیر، که می‌توانید آن را متناسب با نیازهای خاص خود تطبیق دهید، یک مهار آزمون (test harness) ساده فراهم شده است که به شما امکان می‌دهد اسکریپت را با آرگومان‌های خط فرمان اجرا کنید؛ این " +"آرگومان‌ها آنچه را که معمولاً برای ارسال موارد از طریق SMTP به آن نیاز دارید مشخص می‌کنند. (برای دیدن آرگومان‌های ضروری و اختیاری، اسکریپت بارگیری‌شده را با آرگومان ``-h`` اجرا کنید.)" -msgid "To illustrate how you can send log messages via email, so that a set number of messages are sent per email, you can subclass :class:`~logging.handlers.BufferingHandler`. In the following example, which you can adapt to suit your specific needs, a simple test harness is provided which allows you to run the script with command line arguments specifying what you typically need to send things via SMTP. (Run the downloaded script with the ``-h`` argument to see the required and optional arguments.)" +msgid "" +"import logging\n" +"import logging.handlers\n" +"import smtplib\n" +"\n" +"class BufferingSMTPHandler(logging.handlers.BufferingHandler):\n" +" def __init__(self, mailhost, port, username, password, fromaddr, toaddrs,\n" +" subject, capacity):\n" +" logging.handlers.BufferingHandler.__init__(self, capacity)\n" +" self.mailhost = mailhost\n" +" self.mailport = port\n" +" self.username = username\n" +" self.password = password\n" +" self.fromaddr = fromaddr\n" +" if isinstance(toaddrs, str):\n" +" toaddrs = [toaddrs]\n" +" self.toaddrs = toaddrs\n" +" self.subject = subject\n" +" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s %(message)s\"))\n" +"\n" +" def flush(self):\n" +" if len(self.buffer) > 0:\n" +" try:\n" +" smtp = smtplib.SMTP(self.mailhost, self.mailport)\n" +" smtp.starttls()\n" +" smtp.login(self.username, self.password)\n" +" msg = \"From: %s\\r\\nTo: %s\\r\\nSubject: %s\\r\\n\\r\\n\" % (self.fromaddr, ','.join(self.toaddrs), self.subject)\n" +" for record in self.buffer:\n" +" s = self.format(record)\n" +" msg = msg + s + \"\\r\\n\"\n" +" smtp.sendmail(self.fromaddr, self.toaddrs, msg)\n" +" smtp.quit()\n" +" except Exception:\n" +" if logging.raiseExceptions:\n" +" raise\n" +" self.buffer = []\n" +"\n" +"if __name__ == '__main__':\n" +" import argparse\n" +"\n" +" ap = argparse.ArgumentParser()\n" +" aa = ap.add_argument\n" +" aa('host', metavar='HOST', help='SMTP server')\n" +" aa('--port', '-p', type=int, default=587, help='SMTP port')\n" +" aa('user', metavar='USER', help='SMTP username')\n" +" aa('password', metavar='PASSWORD', help='SMTP password')\n" +" aa('to', metavar='TO', help='Addressee for emails')\n" +" aa('sender', metavar='SENDER', help='Sender email address')\n" +" aa('--subject', '-s',\n" +" default='Test Logging email from Python logging module (buffering)',\n" +" help='Subject of email')\n" +" options = ap.parse_args()\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.DEBUG)\n" +" h = BufferingSMTPHandler(options.host, options.port, options.user,\n" +" options.password, options.sender,\n" +" options.to, options.subject, 10)\n" +" logger.addHandler(h)\n" +" for i in range(102):\n" +" logger.info(\"Info index = %d\", i)\n" +" h.flush()\n" +" h.close()" msgstr "" - -msgid "" "import logging\n" "import logging.handlers\n" "import smtplib\n" @@ -2933,16 +5378,19 @@ msgid "" " logger.info(\"Info index = %d\", i)\n" " h.flush()\n" " h.close()" -msgstr "" -msgid "If you run this script and your SMTP server is correctly set up, you should find that it sends eleven emails to the addressee you specify. The first ten emails will each have ten log messages, and the eleventh will have two messages. That makes up 102 messages as specified in the script." +msgid "" +"If you run this script and your SMTP server is correctly set up, you should find that it sends eleven emails to the addressee you specify. The first ten emails will each have ten log messages, " +"and the eleventh will have two messages. That makes up 102 messages as specified in the script." msgstr "" +"اگر این اسکریپت را اجرا کنید و سرور SMTP شما به‌درستی پیکربندی شده باشد، متوجه خواهید شد که این اسکریپت یازده ایمیل به گیرنده‌ای که مشخص می‌کنید ارسال می‌کند. هر یک از ده ایمیل اول ده پیام گزارش " +"خواهند داشت و ایمیل یازدهم دو پیام خواهد داشت. این‌ها در مجموع ۱۰۲ پیام را تشکیل می‌دهند، همان‌طور که در اسکریپت مشخص شده است." msgid "Formatting times using UTC (GMT) via configuration" -msgstr "" +msgstr "قالب‌بندی زمان‌ها با استفاده از UTC (GMT) از طریق پیکربندی" msgid "Sometimes you want to format times using UTC, which can be done using a class such as ``UTCFormatter``, shown below::" -msgstr "" +msgstr "گاهی ممکن است بخواهید زمان‌ها را با استفاده از UTC قالب‌بندی کنید، که این کار را می‌توان با استفاده از کلاسی مانند ``UTCFormatter`` انجام داد، همان‌طور که در ادامه نشان داده شده است::" msgid "" "import logging\n" @@ -2951,9 +5399,18 @@ msgid "" "class UTCFormatter(logging.Formatter):\n" " converter = time.gmtime" msgstr "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" -msgid "and you can then use the ``UTCFormatter`` in your code instead of :class:`~logging.Formatter`. If you want to do that via configuration, you can use the :func:`~logging.config.dictConfig` API with an approach illustrated by the following complete example::" +msgid "" +"and you can then use the ``UTCFormatter`` in your code instead of :class:`~logging.Formatter`. If you want to do that via configuration, you can use the :func:`~logging.config.dictConfig` API " +"with an approach illustrated by the following complete example::" msgstr "" +"و سپس می‌توانید از ``UTCFormatter`` در کد خود به جای :class:`~logging.Formatter` استفاده کنید. اگر می‌خواهید این کار را از طریق پیکربندی انجام دهید، می‌توانید از " +"API :func:`~logging.config.dictConfig` با رویکردی که در مثال کامل زیر نشان داده شده است استفاده کنید::" msgid "" "import logging\n" @@ -2994,23 +5451,68 @@ msgid "" " logging.config.dictConfig(LOGGING)\n" " logging.warning('The local time is %s', time.asctime())" msgstr "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'utc': {\n" +" '()': UTCFormatter,\n" +" 'format': '%(asctime)s %(message)s',\n" +" },\n" +" 'local': {\n" +" 'format': '%(asctime)s %(message)s',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console1': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'utc',\n" +" },\n" +" 'console2': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'local',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console1', 'console2'],\n" +" }\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.warning('The local time is %s', time.asctime())" msgid "When this script is run, it should print something like:" -msgstr "" +msgstr "هنگامی که این اسکریپت اجرا می‌شود، باید چیزی شبیه به این چاپ کند:" msgid "" "2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" "2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgstr "" +"2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" +"2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgid "showing how the time is formatted both as local time and UTC, one for each handler." -msgstr "" +msgstr "که نشان می‌دهد زمان چگونه هم به‌صورت زمان محلی و هم به‌صورت UTC قالب‌بندی می‌شود، یکی برای هر هندلر (handler)." msgid "Using a context manager for selective logging" -msgstr "" +msgstr "استفاده از مدیر زمینه برای گزارش‌گیری انتخابی" -msgid "There are times when it would be useful to temporarily change the logging configuration and revert it back after doing something. For this, a context manager is the most obvious way of saving and restoring the logging context. Here is a simple example of such a context manager, which allows you to optionally change the logging level and add a logging handler purely in the scope of the context manager::" +msgid "" +"There are times when it would be useful to temporarily change the logging configuration and revert it back after doing something. For this, a context manager is the most obvious way of saving and " +"restoring the logging context. Here is a simple example of such a context manager, which allows you to optionally change the logging level and add a logging handler purely in the scope of the " +"context manager::" msgstr "" +"مواردی وجود دارد که تغییر موقت پیکربندی گزارش (logging configuration) و بازگرداندن آن به حالت پیشین پس از انجام کاری مفید است. برای این منظور، مدیر زمینه (context manager) آشکارترین راه برای ذخیره " +"و بازیابی زمینه‌ی گزارش (logging context) است. در اینجا یک مثال ساده از چنین مدیر زمینه‌ای آمده است که به شما امکان می‌دهد به‌صورت اختیاری سطح گزارش (logging level) را تغییر دهید و یک هندلر گزارش (logging " +"handler) را صرفاً در محدوده‌ی مدیر زمینه اضافه کنید::" msgid "" "import logging\n" @@ -3039,12 +5541,41 @@ msgid "" " self.handler.close()\n" " # implicit return of None => don't swallow exceptions" msgstr "" +"import logging\n" +"import sys\n" +"\n" +"class LoggingContext:\n" +" def __init__(self, logger, level=None, handler=None, close=True):\n" +" self.logger = logger\n" +" self.level = level\n" +" self.handler = handler\n" +" self.close = close\n" +"\n" +" def __enter__(self):\n" +" if self.level is not None:\n" +" self.old_level = self.logger.level\n" +" self.logger.setLevel(self.level)\n" +" if self.handler:\n" +" self.logger.addHandler(self.handler)\n" +"\n" +" def __exit__(self, et, ev, tb):\n" +" if self.level is not None:\n" +" self.logger.setLevel(self.old_level)\n" +" if self.handler:\n" +" self.logger.removeHandler(self.handler)\n" +" if self.handler and self.close:\n" +" self.handler.close()\n" +" # implicit return of None => don't swallow exceptions" -msgid "If you specify a level value, the logger's level is set to that value in the scope of the with block covered by the context manager. If you specify a handler, it is added to the logger on entry to the block and removed on exit from the block. You can also ask the manager to close the handler for you on block exit - you could do this if you don't need the handler any more." +msgid "" +"If you specify a level value, the logger's level is set to that value in the scope of the with block covered by the context manager. If you specify a handler, it is added to the logger on entry " +"to the block and removed on exit from the block. You can also ask the manager to close the handler for you on block exit - you could do this if you don't need the handler any more." msgstr "" +"اگر یک مقدار سطح مشخص کنید، سطح گزارش‌گیر در محدوده‌ی بلوک with که توسط مدیر زمینه پوشش داده شده است، روی آن مقدار تنظیم می‌شود. اگر یک هندلر مشخص کنید، هنگام ورود به بلوک به گزارش‌گیر اضافه می‌شود و هنگام " +"خروج از بلوک حذف می‌شود. همچنین می‌توانید از مدیر بخواهید که در زمان خروج از بلوک، هندلر را برای شما ببندد — اگر دیگر به آن هندلر نیازی ندارید، می‌توانید این کار را انجام دهید." msgid "To illustrate how it works, we can add the following block of code to the above::" -msgstr "" +msgstr "برای نشان دادن نحوه‌ی عملکرد آن، می‌توانیم قطعه‌کد زیر را به مورد بالا اضافه کنیم::" msgid "" "if __name__ == '__main__':\n" @@ -3062,12 +5593,34 @@ msgid "" " logger.info('6. This should appear just once on stderr.')\n" " logger.debug('7. This should not appear.')" msgstr "" +"if __name__ == '__main__':\n" +" logger = logging.getLogger('foo')\n" +" logger.addHandler(logging.StreamHandler())\n" +" logger.setLevel(logging.INFO)\n" +" logger.info('1. This should appear just once on stderr.')\n" +" logger.debug('2. This should not appear.')\n" +" with LoggingContext(logger, level=logging.DEBUG):\n" +" logger.debug('3. This should appear once on stderr.')\n" +" logger.debug('4. This should not appear.')\n" +" h = logging.StreamHandler(sys.stdout)\n" +" with LoggingContext(logger, level=logging.DEBUG, handler=h, close=True):\n" +" logger.debug('5. This should appear twice - once on stderr and once on stdout.')\n" +" logger.info('6. This should appear just once on stderr.')\n" +" logger.debug('7. This should not appear.')" -msgid "We initially set the logger's level to ``INFO``, so message #1 appears and message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the following ``with`` block, and so message #3 appears. After the block exits, the logger's level is restored to ``INFO`` and so message #4 doesn't appear. In the next ``with`` block, we set the level to ``DEBUG`` again but also add a handler writing to ``sys.stdout``. Thus, message #5 appears twice on the console (once via ``stderr`` and once via ``stdout``). After the ``with`` statement's completion, the status is as it was before so message #6 appears (like message #1) whereas message #7 doesn't (just like message #2)." +msgid "" +"We initially set the logger's level to ``INFO``, so message #1 appears and message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the following ``with`` block, and so message #3 " +"appears. After the block exits, the logger's level is restored to ``INFO`` and so message #4 doesn't appear. In the next ``with`` block, we set the level to ``DEBUG`` again but also add a handler " +"writing to ``sys.stdout``. Thus, message #5 appears twice on the console (once via ``stderr`` and once via ``stdout``). After the ``with`` statement's completion, the status is as it was before " +"so message #6 appears (like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" +"ابتدا سطح گزارش‌گیر را روی ``INFO`` تنظیم می‌کنیم، بنابراین پیام ۱ نمایش داده می‌شود و پیام ۲ نمایش داده نمی‌شود. سپس سطح را به‌طور موقت در بلوک ``with`` زیر به ``DEBUG`` تغییر می‌دهیم، بنابراین پیام ۳ " +"نمایش داده می‌شود. پس از خروج از بلوک، سطح گزارش‌گیر به ``INFO`` بازگردانده می‌شود و بنابراین پیام ۴ نمایش داده نمی‌شود. در بلوک ``with`` بعدی، دوباره سطح را روی ``DEBUG`` تنظیم می‌کنیم، اما همچنین یک " +"هندلر برای نوشتن در ``sys.stdout`` اضافه می‌کنیم. بنابراین، پیام ۵ دو بار در کنسول نمایش داده می‌شود (یک بار از طریق ``stderr`` و یک بار از طریق ``stdout``). پس از تکمیل دستور ``with``، وضعیت مانند " +"قبل است، بنابراین پیام ۶ نمایش داده می‌شود (مانند پیام ۱) در حالی که پیام ۷ نمایش داده نمی‌شود (دقیقاً مانند پیام ۲)." msgid "If we run the resulting script, the result is as follows:" -msgstr "" +msgstr "اگر اسکریپت حاصل را اجرا کنیم، نتیجه به‌صورت زیر است:" msgid "" "$ python logctx.py\n" @@ -3077,17 +5630,25 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py\n" +"۱. این باید فقط یک‌بار در stderr نمایش داده شود.\n" +"۳. این باید یک‌بار در stderr نمایش داده شود.\n" +"۵. این باید دو بار نمایش داده شود - یک‌بار در stderr و یک‌بار در stdout.\n" +"۵. این باید دو بار نمایش داده شود - یک‌بار در stderr و یک‌بار در stdout.\n" +"۶. این باید فقط یک‌بار در stderr نمایش داده شود." msgid "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the following, which is the only message written to ``stdout``:" -msgstr "" +msgstr "اگر دوباره آن را اجرا کنیم، اما ``stderr`` را به ``/dev/null`` هدایت کنیم، مورد زیر را می‌بینیم که تنها پیام نوشته‌شده در ``stdout`` است:" msgid "" "$ python logctx.py 2>/dev/null\n" "5. This should appear twice - once on stderr and once on stdout." msgstr "" +"$ python logctx.py 2>/dev/null\n" +"۵. این باید دو بار نمایش داده شود - یک بار در stderr و یک بار در stdout." msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" -msgstr "" +msgstr "بار دیگر، اما با pipe کردن (piping) ``stdout`` به ``/dev/null``، این خروجی را دریافت می‌کنیم:" msgid "" "$ python logctx.py >/dev/null\n" @@ -3096,30 +5657,41 @@ msgid "" "5. This should appear twice - once on stderr and once on stdout.\n" "6. This should appear just once on stderr." msgstr "" +"$ python logctx.py >/dev/null\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." msgid "In this case, the message #5 printed to ``stdout`` doesn't appear, as expected." -msgstr "" +msgstr "در این حالت، پیام شماره‌ی ۵ چاپ‌شده در ``stdout``، همان‌طور که انتظار می‌رود ظاهر نمی‌شود." msgid "Of course, the approach described here can be generalised, for example to attach logging filters temporarily. Note that the above code works in Python 2 as well as Python 3." -msgstr "" +msgstr "البته، رویکرد توصیف‌شده در اینجا می‌تواند تعمیم داده شود، برای مثال برای اتصال موقت فیلترهای گزارش (logging filters). توجه داشته باشید که کد فوق در Python 2 و همچنین در Python 3 کار می‌کند." msgid "A CLI application starter template" -msgstr "" +msgstr "قالب شروع برنامه خط فرمان" msgid "Here's an example which shows how you can:" -msgstr "" +msgstr "در اینجا مثالی آمده است که نشان می‌دهد چگونه می‌توانید:" msgid "Use a logging level based on command-line arguments" -msgstr "" +msgstr "استفاده از سطح گزارش‌گذاری بر اساس آرگومان‌های خط فرمان" msgid "Dispatch to multiple subcommands in separate files, all logging at the same level in a consistent way" -msgstr "" +msgstr "اعزام به چند زیرفرمان در فایل‌های جداگانه، به‌گونه‌ای که همه‌ی آن‌ها گزارش‌گیری را در یک سطح و به‌شکلی یکسان انجام دهند" msgid "Make use of simple, minimal configuration" -msgstr "" +msgstr "از پیکربندی ساده و حداقلی استفاده کنید" -msgid "Suppose we have a command-line application whose job is to stop, start or restart some services. This could be organised for the purposes of illustration as a file ``app.py`` that is the main script for the application, with individual commands implemented in ``start.py``, ``stop.py`` and ``restart.py``. Suppose further that we want to control the verbosity of the application via a command-line argument, defaulting to ``logging.INFO``. Here's one way that ``app.py`` could be written::" +msgid "" +"Suppose we have a command-line application whose job is to stop, start or restart some services. This could be organised for the purposes of illustration as a file ``app.py`` that is the main " +"script for the application, with individual commands implemented in ``start.py``, ``stop.py`` and ``restart.py``. Suppose further that we want to control the verbosity of the application via a " +"command-line argument, defaulting to ``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" +"فرض کنید یک برنامه‌ی خط فرمانی داریم که وظیفه‌ی آن توقف، راه‌اندازی یا راه‌اندازی مجدد برخی سرویس‌ها است. این برنامه می‌تواند برای مقاصد نمایشی به‌صورت فایل ``app.py`` سازمان‌دهی شود که اسکریپت اصلی " +"برنامه است و دستورات جداگانه در ``start.py``، ``stop.py`` و ``restart.py`` پیاده‌سازی شده‌اند. همچنین فرض کنید می‌خواهیم سطح جزئیات برنامه را از طریق یک آرگومان خط فرمان کنترل کنیم، با مقدار پیش‌فرض " +"``logging.INFO``. در ادامه یک روش برای نوشتن ``app.py`` آمده است::" msgid "" "import argparse\n" @@ -3163,9 +5735,49 @@ msgid "" "if __name__ == '__main__':\n" " sys.exit(main())" msgstr "" +"import argparse\n" +"import importlib\n" +"import logging\n" +"import os\n" +"import sys\n" +"\n" +"def main(args=None):\n" +" scriptname = os.path.basename(__file__)\n" +" parser = argparse.ArgumentParser(scriptname)\n" +" levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')\n" +" parser.add_argument('--log-level', default='INFO', choices=levels)\n" +" subparsers = parser.add_subparsers(dest='command',\n" +" help='Available commands:')\n" +" start_cmd = subparsers.add_parser('start', help='Start a service')\n" +" start_cmd.add_argument('name', metavar='NAME',\n" +" help='Name of service to start')\n" +" stop_cmd = subparsers.add_parser('stop',\n" +" help='Stop one or more services')\n" +" stop_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to stop')\n" +" restart_cmd = subparsers.add_parser('restart',\n" +" help='Restart one or more services')\n" +" restart_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to restart')\n" +" options = parser.parse_args()\n" +" # the code to dispatch commands could all be in this file. For the purposes\n" +" # of illustration only, we implement each command in a separate module.\n" +" try:\n" +" mod = importlib.import_module(options.command)\n" +" cmd = getattr(mod, 'command')\n" +" except (ImportError, AttributeError):\n" +" print('Unable to find the code for command \\'%s\\'' % options.command)\n" +" return 1\n" +" # Could get fancy here and load configuration from file or dictionary\n" +" logging.basicConfig(level=options.log_level,\n" +" format='%(levelname)s %(name)s %(message)s')\n" +" cmd(options)\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main())" msgid "And the ``start``, ``stop`` and ``restart`` commands can be implemented in separate modules, like so for starting::" -msgstr "" +msgstr "و می‌توان فرمان‌های ``start``، ``stop`` و ``restart`` را در ماژول‌های جداگانه پیاده‌سازی کرد، مثلاً برای شروع به این صورت::" msgid "" "# start.py\n" @@ -3178,9 +5790,18 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" +"# start.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" logger.debug('About to start %s', options.name)\n" +" # actually do the command processing here ...\n" +" logger.info('Started the \\'%s\\' service.', options.name)" msgid "and thus for stopping::" -msgstr "" +msgstr "و بنابراین برای توقف::" msgid "" "# stop.py\n" @@ -3202,9 +5823,27 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" +"# stop.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to stop %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Stopped the %s service%s.', services, plural)" msgid "and similarly for restarting::" -msgstr "" +msgstr "و به‌طور مشابه برای راه‌اندازی مجدد::" msgid "" "# restart.py\n" @@ -3226,11 +5865,38 @@ msgid "" " # actually do the command processing here ...\n" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" +"# restart.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to restart %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Restarted the %s service%s.', services, plural)" msgid "If we run this application with the default log level, we get output like this:" +msgstr "اگر این برنامه را با سطح گزارش پیش‌فرض اجرا کنیم، خروجی‌ای مانند این دریافت می‌کنیم:" + +msgid "" +"$ python app.py start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py stop foo bar\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py restart foo bar baz\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" - -msgid "" "$ python app.py start foo\n" "INFO start Started the 'foo' service.\n" "\n" @@ -3239,13 +5905,12 @@ msgid "" "\n" "$ python app.py restart foo bar baz\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." -msgstr "" msgid "The first word is the logging level, and the second word is the module or package name of the place where the event was logged." -msgstr "" +msgstr "واژه اول سطح گزارش‌دهی است، و واژه دوم نام ماژول یا بسته‌ی محلی است که رویداد در آن ثبت شده است." msgid "If we change the logging level, then we can change the information sent to the log. For example, if we want more information:" -msgstr "" +msgstr "اگر سطح گزارش‌دهی را تغییر دهیم، می‌توانیم اطلاعاتی را که به گزارش فرستاده می‌شود، تغییر دهیم. برای مثال، اگر اطلاعات بیشتری بخواهیم:" msgid "" "$ python app.py --log-level DEBUG start foo\n" @@ -3260,35 +5925,295 @@ msgid "" "DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" +"$ python app.py --log-level DEBUG start foo\n" +"DEBUG start About to start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py --log-level DEBUG stop foo bar\n" +"DEBUG stop About to stop 'foo' and 'bar'\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py --log-level DEBUG restart foo bar baz\n" +"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgid "And if we want less:" -msgstr "" +msgstr "و اگر کمتر بخواهیم:" msgid "" "$ python app.py --log-level WARNING start foo\n" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" +"$ python app.py --log-level WARNING start foo\n" +"$ python app.py --log-level WARNING stop foo bar\n" +"$ python app.py --log-level WARNING restart foo bar baz" msgid "In this case, the commands don't print anything to the console, since nothing at ``WARNING`` level or above is logged by them." -msgstr "" +msgstr "در این حالت، دستورها چیزی را در کنسول چاپ نمی‌کنند، زیرا هیچ چیزی در سطح ``WARNING`` یا بالاتر توسط آن‌ها ثبت نمی‌شود." msgid "A Qt GUI for logging" +msgstr "یک رابط کاربری گرافیکی Qt برای گزارش‌گیری" + +msgid "" +"A question that comes up from time to time is about how to log to a GUI application. The `Qt `_ framework is a popular cross-platform UI framework with Python bindings " +"using :pypi:`PySide2` or :pypi:`PyQt5` libraries." msgstr "" +"پرسشی که هر از چند گاهی مطرح می‌شود، درباره‌ی نحوه‌ی ثبت گزارش در یک برنامه‌ی GUI است. چارچوب `Qt `_ یک چارچوب رابط کاربری محبوب و بین‌سکویی است که اتصال‌های پایتون را با استفاده از " +"کتابخانه‌های :pypi:`PySide2` یا :pypi:`PyQt5` فراهم می‌کند." -msgid "A question that comes up from time to time is about how to log to a GUI application. The `Qt `_ framework is a popular cross-platform UI framework with Python bindings using :pypi:`PySide2` or :pypi:`PyQt5` libraries." +msgid "" +"The following example shows how to log to a Qt GUI. This introduces a simple ``QtHandler`` class which takes a callable, which should be a slot in the main thread that does GUI updates. A worker " +"thread is also created to show how you can log to the GUI from both the UI itself (via a button for manual logging) as well as a worker thread doing work in the background (here, just logging " +"messages at random levels with random short delays in between)." msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان گزارش‌ها را در یک GUI Qt ثبت کرد. این مثال یک کلاس ساده ``QtHandler`` را معرفی می‌کند که یک شیء قابل فراخوانی می‌گیرد. این شیء باید یک جایگاه (slot) در نخ اصلی باشد " +"و به‌روزرسانی‌های GUI را انجام دهد. همچنین یک نخ کاری ایجاد می‌شود تا نشان داده شود که چگونه می‌توانید گزارش‌ها را هم از خود UI (از طریق یک دکمه برای ثبت گزارش دستی) و هم از یک نخ کاری که کاری را در " +"پس‌زمینه انجام می‌دهد، در GUI ثبت کنید (در اینجا، فقط پیام‌ها را در سطوح تصادفی و با تأخیرهای کوتاه تصادفی بین آن‌ها ثبت می‌کند)." -msgid "The following example shows how to log to a Qt GUI. This introduces a simple ``QtHandler`` class which takes a callable, which should be a slot in the main thread that does GUI updates. A worker thread is also created to show how you can log to the GUI from both the UI itself (via a button for manual logging) as well as a worker thread doing work in the background (here, just logging messages at random levels with random short delays in between)." +msgid "" +"The worker thread is implemented using Qt's ``QThread`` class rather than the :mod:`threading` module, as there are circumstances where one has to use ``QThread``, which offers better integration " +"with other ``Qt`` components." msgstr "" +"نخ کارگر به جای ماژول :mod:`threading`، با استفاده از کلاس ``QThread`` در Qt پیاده‌سازی شده است، زیرا شرایطی وجود دارد که باید از ``QThread`` استفاده کرد، که یکپارچگی بهتری با سایر کامپوننت‌های " +"``Qt`` دارد." -msgid "The worker thread is implemented using Qt's ``QThread`` class rather than the :mod:`threading` module, as there are circumstances where one has to use ``QThread``, which offers better integration with other ``Qt`` components." +msgid "" +"The code should work with recent releases of any of ``PySide6``, ``PyQt6``, ``PySide2`` or ``PyQt5``. You should be able to adapt the approach to earlier versions of Qt. Please refer to the " +"comments in the code snippet for more detailed information." msgstr "" +"این کد باید با نسخه‌های اخیر هر یک از ``PySide6``، ``PyQt6``، ``PySide2`` یا ``PyQt5`` کار کند. شما باید بتوانید این رویکرد را با نسخه‌های پیشین Qt تطبیق دهید. لطفاً برای اطلاعات دقیق‌تر به کامنت‌های " +"موجود در قطعه‌کد مراجعه کنید." -msgid "The code should work with recent releases of any of ``PySide6``, ``PyQt6``, ``PySide2`` or ``PyQt5``. You should be able to adapt the approach to earlier versions of Qt. Please refer to the comments in the code snippet for more detailed information." +msgid "" +"import logging\n" +"import random\n" +"import sys\n" +"import time\n" +"\n" +"# Deal with minor differences between different Qt packages\n" +"try:\n" +" from PySide6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +"except ImportError:\n" +" try:\n" +" from PyQt6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +" except ImportError:\n" +" try:\n" +" from PySide2 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +" except ImportError:\n" +" from PyQt5 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"\n" +"#\n" +"# Signals need to be contained in a QObject or subclass in order to be correctly\n" +"# initialized.\n" +"#\n" +"class Signaller(QtCore.QObject):\n" +" signal = Signal(str, logging.LogRecord)\n" +"\n" +"#\n" +"# Output to a Qt GUI is only supposed to happen on the main thread. So, this\n" +"# handler is designed to take a slot function which is set up to run in the main\n" +"# thread. In this example, the function takes a string argument which is a\n" +"# formatted log message, and the log record which generated it. The formatted\n" +"# string is just a convenience - you could format a string for output any way\n" +"# you like in the slot function itself.\n" +"#\n" +"# You specify the slot function to do whatever GUI updates you want. The handler\n" +"# doesn't know or care about specific UI elements.\n" +"#\n" +"class QtHandler(logging.Handler):\n" +" def __init__(self, slotfunc, *args, **kwargs):\n" +" super().__init__(*args, **kwargs)\n" +" self.signaller = Signaller()\n" +" self.signaller.signal.connect(slotfunc)\n" +"\n" +" def emit(self, record):\n" +" s = self.format(record)\n" +" self.signaller.signal.emit(s, record)\n" +"\n" +"#\n" +"# This example uses QThreads, which means that the threads at the Python level\n" +"# are named something like \"Dummy-1\". The function below gets the Qt name of the\n" +"# current thread.\n" +"#\n" +"def ctname():\n" +" return QtCore.QThread.currentThread().objectName()\n" +"\n" +"\n" +"#\n" +"# Used to generate random levels for logging.\n" +"#\n" +"LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"\n" +"#\n" +"# This worker class represents work that is done in a thread separate to the\n" +"# main thread. The way the thread is kicked off to do work is via a button press\n" +"# that connects to a slot in the worker.\n" +"#\n" +"# Because the default threadName value in the LogRecord isn't much use, we add\n" +"# a qThreadName which contains the QThread name as computed above, and pass that\n" +"# value in an \"extra\" dictionary which is used to update the LogRecord with the\n" +"# QThread name.\n" +"#\n" +"# This example worker just outputs messages sequentially, interspersed with\n" +"# random delays of the order of a few seconds.\n" +"#\n" +"class Worker(QtCore.QObject):\n" +" @Slot()\n" +" def start(self):\n" +" extra = {'qThreadName': ctname() }\n" +" logger.debug('Started work', extra=extra)\n" +" i = 1\n" +" # Let the thread run until interrupted. This allows reasonably clean\n" +" # thread termination.\n" +" while not QtCore.QThread.currentThread().isInterruptionRequested():\n" +" delay = 0.5 + random.random() * 2\n" +" time.sleep(delay)\n" +" try:\n" +" if random.random() < 0.1:\n" +" raise ValueError('Exception raised: %d' % i)\n" +" else:\n" +" level = random.choice(LEVELS)\n" +" logger.log(level, 'Message after delay of %3.1f: %d', delay, i, extra=extra)\n" +" except ValueError as e:\n" +" logger.exception('Failed: %s', e, extra=extra)\n" +" i += 1\n" +"\n" +"#\n" +"# Implement a simple UI for this cookbook example. This contains:\n" +"#\n" +"# * A read-only text edit window which holds formatted log messages\n" +"# * A button to start work and log stuff in a separate thread\n" +"# * A button to log something from the main thread\n" +"# * A button to clear the log window\n" +"#\n" +"class Window(QtWidgets.QWidget):\n" +"\n" +" COLORS = {\n" +" logging.DEBUG: 'black',\n" +" logging.INFO: 'blue',\n" +" logging.WARNING: 'orange',\n" +" logging.ERROR: 'red',\n" +" logging.CRITICAL: 'purple',\n" +" }\n" +"\n" +" def __init__(self, app):\n" +" super().__init__()\n" +" self.app = app\n" +" self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" +" # Set whatever the default monospace font is for the platform\n" +" f = QtGui.QFont('nosuchfont')\n" +" if hasattr(f, 'Monospace'):\n" +" f.setStyleHint(f.Monospace)\n" +" else:\n" +" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" +" te.setFont(f)\n" +" te.setReadOnly(True)\n" +" PB = QtWidgets.QPushButton\n" +" self.work_button = PB('Start background work', self)\n" +" self.log_button = PB('Log a message at a random level', self)\n" +" self.clear_button = PB('Clear log window', self)\n" +" self.handler = h = QtHandler(self.update_status)\n" +" # Remember to use qThreadName rather than threadName in the format string.\n" +" fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" +" formatter = logging.Formatter(fs)\n" +" h.setFormatter(formatter)\n" +" logger.addHandler(h)\n" +" # Set up to terminate the QThread when we exit\n" +" app.aboutToQuit.connect(self.force_quit)\n" +"\n" +" # Lay out all the widgets\n" +" layout = QtWidgets.QVBoxLayout(self)\n" +" layout.addWidget(te)\n" +" layout.addWidget(self.work_button)\n" +" layout.addWidget(self.log_button)\n" +" layout.addWidget(self.clear_button)\n" +" self.setFixedSize(900, 400)\n" +"\n" +" # Connect the non-worker slots and signals\n" +" self.log_button.clicked.connect(self.manual_update)\n" +" self.clear_button.clicked.connect(self.clear_display)\n" +"\n" +" # Start a new worker thread and connect the slots for the worker\n" +" self.start_thread()\n" +" self.work_button.clicked.connect(self.worker.start)\n" +" # Once started, the button should be disabled\n" +" self.work_button.clicked.connect(lambda : self.work_button.setEnabled(False))\n" +"\n" +" def start_thread(self):\n" +" self.worker = Worker()\n" +" self.worker_thread = QtCore.QThread()\n" +" self.worker.setObjectName('Worker')\n" +" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" +" self.worker.moveToThread(self.worker_thread)\n" +" # This will start an event loop in the worker thread\n" +" self.worker_thread.start()\n" +"\n" +" def kill_thread(self):\n" +" # Just tell the worker to stop, then tell it to quit and wait for that\n" +" # to happen\n" +" self.worker_thread.requestInterruption()\n" +" if self.worker_thread.isRunning():\n" +" self.worker_thread.quit()\n" +" self.worker_thread.wait()\n" +" else:\n" +" print('worker has already exited.')\n" +"\n" +" def force_quit(self):\n" +" # For use when the window is closed\n" +" if self.worker_thread.isRunning():\n" +" self.kill_thread()\n" +"\n" +" # The functions below update the UI and run in the main thread because\n" +" # that's where the slots are set up\n" +"\n" +" @Slot(str, logging.LogRecord)\n" +" def update_status(self, status, record):\n" +" color = self.COLORS.get(record.levelno, 'black')\n" +" s = '
%s
' % (color, status)\n" +" self.textedit.appendHtml(s)\n" +"\n" +" @Slot()\n" +" def manual_update(self):\n" +" # This function uses the formatted message passed in, but also uses\n" +" # information from the record to format the message in an appropriate\n" +" # color according to its severity (level).\n" +" level = random.choice(LEVELS)\n" +" extra = {'qThreadName': ctname() }\n" +" logger.log(level, 'Manually logged!', extra=extra)\n" +"\n" +" @Slot()\n" +" def clear_display(self):\n" +" self.textedit.clear()\n" +"\n" +"\n" +"def main():\n" +" QtCore.QThread.currentThread().setObjectName('MainThread')\n" +" logging.getLogger().setLevel(logging.DEBUG)\n" +" app = QtWidgets.QApplication(sys.argv)\n" +" example = Window(app)\n" +" example.show()\n" +" if hasattr(app, 'exec'):\n" +" rc = app.exec()\n" +" else:\n" +" rc = app.exec_()\n" +" sys.exit(rc)\n" +"\n" +"if __name__=='__main__':\n" +" main()" msgstr "" - -msgid "" "import logging\n" "import random\n" "import sys\n" @@ -3516,16 +6441,25 @@ msgid "" "\n" "if __name__=='__main__':\n" " main()" -msgstr "" msgid "Logging to syslog with RFC5424 support" -msgstr "" +msgstr "گزارش‌گیری در syslog با پشتیبانی از RFC5424" -msgid "Although :rfc:`5424` dates from 2009, most syslog servers are configured by default to use the older :rfc:`3164`, which hails from 2001. When ``logging`` was added to Python in 2003, it supported the earlier (and only existing) protocol at the time. Since RFC 5424 came out, as there has not been widespread deployment of it in syslog servers, the :class:`~logging.handlers.SysLogHandler` functionality has not been updated." +msgid "" +"Although :rfc:`5424` dates from 2009, most syslog servers are configured by default to use the older :rfc:`3164`, which hails from 2001. When ``logging`` was added to Python in 2003, it supported " +"the earlier (and only existing) protocol at the time. Since RFC 5424 came out, as there has not been widespread deployment of it in syslog servers, the :class:`~logging.handlers.SysLogHandler` " +"functionality has not been updated." msgstr "" +"اگرچه :rfc:`5424` به سال ۲۰۰۹ بازمی‌گردد، بیشتر کارگزارهای syslog به‌طور پیش‌فرض برای استفاده از :rfc:`3164` قدیمی‌تر پیکربندی شده‌اند، که به سال ۲۰۰۱ بازمی‌گردد. هنگامی که ``logging`` در سال ۲۰۰۳ به " +"پایتون افزوده شد، از پروتکل پیشین (و تنها پروتکل موجود) در آن زمان پشتیبانی می‌کرد. از زمان انتشار RFC 5424، از آنجا که پیاده‌سازی گسترده‌ای از آن در کارگزارهای syslog صورت نگرفته است، " +"قابلیت :class:`~logging.handlers.SysLogHandler` به‌روزرسانی نشده است." -msgid "RFC 5424 contains some useful features such as support for structured data, and if you need to be able to log to a syslog server with support for it, you can do so with a subclassed handler which looks something like this::" +msgid "" +"RFC 5424 contains some useful features such as support for structured data, and if you need to be able to log to a syslog server with support for it, you can do so with a subclassed handler which " +"looks something like this::" msgstr "" +"RFC 5424 شامل برخی ویژگی‌های مفید مانند پشتیبانی از داده‌های ساختاریافته است، و اگر نیاز دارید بتوانید به یک کارساز syslog که از آن پشتیبانی می‌کند گزارش بفرستید، می‌توانید این کار را با یک هندلری " +"زیرکلاس‌شده که چیزی شبیه به این است، انجام دهید::" msgid "" "import datetime as dt\n" @@ -3590,9 +6524,74 @@ msgid "" " sdata = ''.join(parts)\n" " return f'{version} {asctime} {hostname} {appname} {procid} {msgid} {sdata} {msg}'" msgstr "" +"import datetime as dt\n" +"import logging.handlers\n" +"import re\n" +"import socket\n" +"import time\n" +"\n" +"class SysLogHandler5424(logging.handlers.SysLogHandler):\n" +"\n" +" tz_offset = re.compile(r'([+-]\\d{2})(\\d{2})$')\n" +" escaped = re.compile(r'([\\]\"\\\\])')\n" +"\n" +" def __init__(self, *args, **kwargs):\n" +" self.msgid = kwargs.pop('msgid', None)\n" +" self.appname = kwargs.pop('appname', None)\n" +" super().__init__(*args, **kwargs)\n" +"\n" +" def format(self, record):\n" +" version = 1\n" +" asctime = dt.datetime.fromtimestamp(record.created).isoformat()\n" +" m = self.tz_offset.match(time.strftime('%z'))\n" +" has_offset = False\n" +" if m and time.timezone:\n" +" hrs, mins = m.groups()\n" +" if int(hrs) or int(mins):\n" +" has_offset = True\n" +" if not has_offset:\n" +" asctime += 'Z'\n" +" else:\n" +" asctime += f'{hrs}:{mins}'\n" +" try:\n" +" hostname = socket.gethostname()\n" +" except Exception:\n" +" hostname = '-'\n" +" appname = self.appname or '-'\n" +" procid = record.process\n" +" msgid = '-'\n" +" msg = super().format(record)\n" +" sdata = '-'\n" +" if hasattr(record, 'structured_data'):\n" +" sd = record.structured_data\n" +" # This should be a dict where the keys are SD-ID and the value is a\n" +" # dict mapping PARAM-NAME to PARAM-VALUE (refer to the RFC for what these\n" +" # mean)\n" +" # There's no error checking here - it's purely for illustration, and you\n" +" # can adapt this code for use in production environments\n" +" parts = []\n" +"\n" +" def replacer(m):\n" +" g = m.groups()\n" +" return '\\\\' + g[0]\n" +"\n" +" for sdid, dv in sd.items():\n" +" part = f'[{sdid}'\n" +" for k, v in dv.items():\n" +" s = str(v)\n" +" s = self.escaped.sub(replacer, s)\n" +" part += f' {k}=\"{s}\"'\n" +" part += ']'\n" +" parts.append(part)\n" +" sdata = ''.join(parts)\n" +" return f'{version} {asctime} {hostname} {appname} {procid} {msgid} {sdata} {msg}'" -msgid "You'll need to be familiar with RFC 5424 to fully understand the above code, and it may be that you have slightly different needs (e.g. for how you pass structural data to the log). Nevertheless, the above should be adaptable to your speciric needs. With the above handler, you'd pass structured data using something like this::" +msgid "" +"You'll need to be familiar with RFC 5424 to fully understand the above code, and it may be that you have slightly different needs (e.g. for how you pass structural data to the log). Nevertheless, " +"the above should be adaptable to your speciric needs. With the above handler, you'd pass structured data using something like this::" msgstr "" +"برای درک کامل کد بالا، لازم است با RFC 5424 آشنا باشید، و ممکن است نیازهای شما کمی متفاوت باشد (مثلاً در مورد نحوه‌ی ارسال داده‌های ساختاریافته به گزارش). با این حال، مورد بالا باید قابل انطباق با " +"نیازهای خاص شما باشد. با هندلر بالا، داده‌های ساختاریافته را با استفاده از چیزی مانند این ارسال می‌کنید::" msgid "" "sd = {\n" @@ -3603,12 +6602,23 @@ msgid "" "i = 1\n" "logger.debug('Message %d', i, extra=extra)" msgstr "" +"sd = {\n" +" 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" +" 'foo@54321': {'rab': 'baz', 'zab': 'bozz', 'zzif': r'buzz'}\n" +"}\n" +"extra = {'structured_data': sd}\n" +"i = 1\n" +"logger.debug('Message %d', i, extra=extra)" msgid "How to treat a logger like an output stream" -msgstr "" +msgstr "چگونه با یک گزارش‌گیر مانند یک جریان خروجی رفتار کنیم" -msgid "Sometimes, you need to interface to a third-party API which expects a file-like object to write to, but you want to direct the API's output to a logger. You can do this using a class which wraps a logger with a file-like API. Here's a short script illustrating such a class:" +msgid "" +"Sometimes, you need to interface to a third-party API which expects a file-like object to write to, but you want to direct the API's output to a logger. You can do this using a class which wraps " +"a logger with a file-like API. Here's a short script illustrating such a class:" msgstr "" +"گاهی اوقات، نیاز دارید با یک API شخص ثالث ارتباط برقرار کنید که انتظار دارد یک شیء فایل‌مانند برای نوشتن در آن دریافت کند، اما می‌خواهید خروجی API را به یک گزارش‌گیر هدایت کنید. می‌توانید این کار را با " +"استفاده از کلاسی که یک گزارش‌گیر را با یک API فایل‌مانند دربر می‌گیرد، انجام دهید. در ادامه یک اسکریپت کوتاه آمده است که چنین کلاسی را نشان می‌دهد:" msgid "" "import logging\n" @@ -3644,17 +6654,51 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import logging\n" +"\n" +"class LoggerWriter:\n" +" def __init__(self, logger, level):\n" +" self.logger = logger\n" +" self.level = level\n" +"\n" +" def write(self, message):\n" +" if message != '\\n': # avoid printing bare newlines, if you like\n" +" self.logger.log(self.level, message)\n" +"\n" +" def flush(self):\n" +" # doesn't actually do anything, but might be expected of a file-like\n" +" # object - so optional depending on your situation\n" +" pass\n" +"\n" +" def close(self):\n" +" # doesn't actually do anything, but might be expected of a file-like\n" +" # object - so optional depending on your situation. You might want\n" +" # to set a flag so that later calls to write raise an exception\n" +" pass\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" logger = logging.getLogger('demo')\n" +" info_fp = LoggerWriter(logger, logging.INFO)\n" +" debug_fp = LoggerWriter(logger, logging.DEBUG)\n" +" print('An INFO message', file=info_fp)\n" +" print('A DEBUG message', file=debug_fp)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" msgid "When this script is run, it prints" -msgstr "" +msgstr "هنگامی که این اسکریپت اجرا می‌شود، چاپ می‌کند" msgid "" "INFO:demo:An INFO message\n" "DEBUG:demo:A DEBUG message" msgstr "" +"INFO:demo:یک پیام INFO\n" +"DEBUG:demo:یک پیام DEBUG" msgid "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys.stderr`` by doing something like this:" -msgstr "" +msgstr "همچنین می‌توانید با انجام کاری مانند این، از ``LoggerWriter`` برای تغییر مسیر ``sys.stdout`` و ``sys.stderr`` استفاده کنید:" msgid "" "import sys\n" @@ -3662,9 +6706,17 @@ msgid "" "sys.stdout = LoggerWriter(logger, logging.INFO)\n" "sys.stderr = LoggerWriter(logger, logging.WARNING)" msgstr "" +"import sys\n" +"\n" +"sys.stdout = LoggerWriter(logger, logging.INFO)\n" +"sys.stderr = LoggerWriter(logger, logging.WARNING)" -msgid "You should do this *after* configuring logging for your needs. In the above example, the :func:`~logging.basicConfig` call does this (using the ``sys.stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). Then, you'd get this kind of result:" +msgid "" +"You should do this *after* configuring logging for your needs. In the above example, the :func:`~logging.basicConfig` call does this (using the ``sys.stderr`` value *before* it is overwritten by " +"a ``LoggerWriter`` instance). Then, you'd get this kind of result:" msgstr "" +"شما باید این کار را *پس از* پیکربندی گزارش‌برداری (logging) برای نیازهای خود انجام دهید. در مثال بالا، فراخوانی :func:`~logging.basicConfig` این کار را انجام می‌دهد (با استفاده از مقدار " +"``sys.stderr`` *پیش از* آنکه توسط یک نمونه از ``LoggerWriter`` بازنویسی شود). سپس، نتیجه‌ای از این دست دریافت خواهید کرد:" msgid "" ">>> print('Foo')\n" @@ -3673,20 +6725,31 @@ msgid "" "WARNING:demo:Bar\n" ">>>" msgstr "" +">>> print('Foo')\n" +"INFO:demo:Foo\n" +">>> print('Bar', file=sys.stderr)\n" +"WARNING:demo:Bar\n" +">>>" msgid "Of course, the examples above show output according to the format used by :func:`~logging.basicConfig`, but you can use a different formatter when you configure logging." -msgstr "" +msgstr "البته، مثال‌های بالا خروجی را مطابق قالب مورد استفاده‌ی :func:`~logging.basicConfig` نشان می‌دهند، اما شما می‌توانید هنگام پیکربندی گزارش‌گیری از یک قالب‌بند (formatter) متفاوت استفاده کنید." -msgid "Note that with the above scheme, you are somewhat at the mercy of buffering and the sequence of write calls which you are intercepting. For example, with the definition of ``LoggerWriter`` above, if you have the snippet" +msgid "" +"Note that with the above scheme, you are somewhat at the mercy of buffering and the sequence of write calls which you are intercepting. For example, with the definition of ``LoggerWriter`` above, " +"if you have the snippet" msgstr "" +"توجه داشته باشید که با روش بالا، تا حدی تحت رحمت بافرینگ (buffering) و ترتیب فراخوانی‌های write که آن‌ها را رهگیری می‌کنید، هستید. برای مثال، با تعریف ``LoggerWriter`` در بالا، اگر قطعه‌کد زیر را " +"داشته باشید" msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" +"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" +"1 / 0" msgid "then running the script results in" -msgstr "" +msgstr "سپس اجرای اسکریپت منجر می‌شود به" msgid "" "WARNING:demo:Traceback (most recent call last):\n" @@ -3703,9 +6766,26 @@ msgid "" "WARNING:demo::\n" "WARNING:demo:division by zero" msgstr "" +"WARNING:demo:Traceback (most recent call last):\n" +"\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, in \n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, in main\n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:1 / 0\n" +"WARNING:demo:ZeroDivisionError\n" +"WARNING:demo::\n" +"WARNING:demo:division by zero" -msgid "As you can see, this output isn't ideal. That's because the underlying code which writes to ``sys.stderr`` makes multiple writes, each of which results in a separate logged line (for example, the last three lines above). To get around this problem, you need to buffer things and only output log lines when newlines are seen. Let's use a slightly better implementation of ``LoggerWriter``:" +msgid "" +"As you can see, this output isn't ideal. That's because the underlying code which writes to ``sys.stderr`` makes multiple writes, each of which results in a separate logged line (for example, the " +"last three lines above). To get around this problem, you need to buffer things and only output log lines when newlines are seen. Let's use a slightly better implementation of ``LoggerWriter``:" msgstr "" +"همان‌طور که می‌بینید، این خروجی ایده‌آل نیست. دلیل آن این است که کد زیرساختی که در ``sys.stderr`` می‌نویسد، چندین عملیات نوشتن انجام می‌دهد که هر یک به یک خط گزارش‌شده جداگانه منجر می‌شود (برای مثال، سه " +"خط آخر بالا). برای رفع این مشکل، باید داده‌ها را بافر کنید و خطوط گزارش را تنها زمانی که نویسه‌های خط جدید دیده می‌شوند خروجی دهید. بیایید از یک پیاده‌سازی کمی بهتر از ``LoggerWriter`` استفاده کنیم:" msgid "" "class BufferingLoggerWriter(LoggerWriter):\n" @@ -3725,9 +6805,25 @@ msgid "" " for part in parts:\n" " self.logger.log(self.level, part)" msgstr "" +"class BufferingLoggerWriter(LoggerWriter):\n" +" def __init__(self, logger, level):\n" +" super().__init__(logger, level)\n" +" self.buffer = ''\n" +"\n" +" def write(self, message):\n" +" if '\\n' not in message:\n" +" self.buffer += message\n" +" else:\n" +" parts = message.split('\\n')\n" +" if self.buffer:\n" +" s = self.buffer + parts.pop(0)\n" +" self.logger.log(self.level, s)\n" +" self.buffer = parts.pop()\n" +" for part in parts:\n" +" self.logger.log(self.level, part)" msgid "This just buffers up stuff until a newline is seen, and then logs complete lines. With this approach, you get better output:" -msgstr "" +msgstr "این کار فقط داده‌ها را تا مشاهده‌ی یک خط جدید بافر می‌کند و سپس خطوط کامل را ثبت می‌کند. با این روش، خروجی بهتری دریافت می‌کنید:" msgid "" "WARNING:demo:Traceback (most recent call last):\n" @@ -3737,12 +6833,24 @@ msgid "" "WARNING:demo: 1/0\n" "WARNING:demo:ZeroDivisionError: division by zero" msgstr "" +"WARNING:demo:Traceback (most recent call last):\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, in \n" +"WARNING:demo: main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 52, in main\n" +"WARNING:demo: 1/0\n" +"WARNING:demo:ZeroDivisionError: division by zero" msgid "How to uniformly handle newlines in logging output" -msgstr "" +msgstr "چگونه خطوط جدید را در خروجی گزارش به‌طور یکنواخت مدیریت کنیم" -msgid "Usually, messages that are logged (say to console or file) consist of a single line of text. However, sometimes there is a need to handle messages with multiple lines - whether because a logging format string contains newlines, or logged data contains newlines. If you want to handle such messages uniformly, so that each line in the logged message appears uniformly formatted as if it was logged separately, you can do this using a handler mixin, as in the following snippet:" +msgid "" +"Usually, messages that are logged (say to console or file) consist of a single line of text. However, sometimes there is a need to handle messages with multiple lines - whether because a logging " +"format string contains newlines, or logged data contains newlines. If you want to handle such messages uniformly, so that each line in the logged message appears uniformly formatted as if it was " +"logged separately, you can do this using a handler mixin, as in the following snippet:" msgstr "" +"معمولاً پیام‌هایی که گزارش می‌شوند (مثلاً در کنسول یا فایل) از یک خط متن تشکیل شده‌اند. با این حال، گاهی نیاز است پیام‌هایی با چند خط مدیریت شوند — خواه به این دلیل که رشته قالب گزارش شامل نویسه‌های خط جدید " +"باشد، خواه داده گزارش‌شده شامل نویسه‌های خط جدید باشد. اگر می‌خواهید چنین پیام‌هایی را به‌صورت یکنواخت مدیریت کنید، به‌طوری که هر خط در پیام گزارش‌شده به‌صورت یکنواخت قالب‌بندی‌شده به نظر برسد، گویی جداگانه " +"گزارش شده است، می‌توانید این کار را با استفاده از یک میکسین هندلر (handler mixin) انجام دهید، همان‌طور که در قطعه کد زیر آمده است:" msgid "" "# Assume this is in a module mymixins.py\n" @@ -3761,9 +6869,24 @@ msgid "" " rec.msg = line\n" " super().emit(rec)" msgstr "" +"# Assume this is in a module mymixins.py\n" +"import copy\n" +"\n" +"class MultilineMixin:\n" +" def emit(self, record):\n" +" s = record.getMessage()\n" +" if '\\n' not in s:\n" +" super().emit(record)\n" +" else:\n" +" lines = s.splitlines()\n" +" rec = copy.copy(record)\n" +" rec.args = None\n" +" for line in lines:\n" +" rec.msg = line\n" +" super().emit(rec)" msgid "You can use the mixin as in the following script:" -msgstr "" +msgstr "می‌توانید از میکسینمانند اسکریپت زیر استفاده کنید:" msgid "" "import logging\n" @@ -3783,9 +6906,25 @@ msgid "" " logger.debug('Another single line')\n" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled again')" msgstr "" +"import logging\n" +"\n" +"from mymixins import MultilineMixin\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class StreamHandler(MultilineMixin, logging.StreamHandler):\n" +" pass\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-9s %(message)s',\n" +" handlers = [StreamHandler()])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled again')" msgid "The script, when run, prints something like:" -msgstr "" +msgstr "این اسکریپت، هنگام اجرا، چیزی شبیه به این را چاپ می‌کند:" msgid "" "2025-07-02 13:54:47,234 DEBUG Single line\n" @@ -3796,9 +6935,20 @@ msgid "" "2025-07-02 13:54:47,234 DEBUG fool me ...\n" "2025-07-02 13:54:47,234 DEBUG can't get fooled again" msgstr "" +"2025-07-02 13:54:47,234 DEBUG Single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me once ...\n" +"2025-07-02 13:54:47,234 DEBUG Another single line\n" +"2025-07-02 13:54:47,234 DEBUG Multiple lines:\n" +"2025-07-02 13:54:47,234 DEBUG fool me ...\n" +"2025-07-02 13:54:47,234 DEBUG can't get fooled again" -msgid "If, on the other hand, you are concerned about `log injection `_, you can use a formatter which escapes newlines, as per the following example:" +msgid "" +"If, on the other hand, you are concerned about `log injection `_, you can use a formatter which escapes newlines, as per the following " +"example:" msgstr "" +"اگر، از سوی دیگر، نگران `تزریق گزارش (log injection) `_ هستید، می‌توانید از قالب‌بند (formatter) استفاده کنید که نویسه‌های خط جدید را خنثی می‌کند، " +"مطابق مثال زیر:" msgid "" "import logging\n" @@ -3819,9 +6969,26 @@ msgid "" " logger.debug('Another single line')\n" " logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled again')" msgstr "" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"class EscapingFormatter(logging.Formatter):\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" return s.replace('\\n', r'\\n')\n" +"\n" +"if __name__ == '__main__':\n" +" h = logging.StreamHandler()\n" +" h.setFormatter(EscapingFormatter('%(asctime)s %(levelname)-9s %(message)s'))\n" +" logging.basicConfig(level=logging.DEBUG, handlers = [h])\n" +" logger.debug('Single line')\n" +" logger.debug('Multiple lines:\\nfool me once ...')\n" +" logger.debug('Another single line')\n" +" logger.debug('Multiple lines:\\n%s', 'fool me ...\\ncan\\'t get fooled again')" msgid "You can, of course, use whatever escaping scheme makes the most sense for you. The script, when run, should produce output like this:" -msgstr "" +msgstr "البته می‌توانید از هر روش خنثی‌سازی که برای شما مناسب‌تر است استفاده کنید. اسکریپت، هنگام اجرا، باید خروجی‌ای مانند این تولید کند:" msgid "" "2025-07-09 06:47:33,783 DEBUG Single line\n" @@ -3829,84 +6996,121 @@ msgid "" "2025-07-09 06:47:33,783 DEBUG Another single line\n" "2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get fooled again" msgstr "" +"2025-07-09 06:47:33,783 DEBUG Single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me once ...\n" +"2025-07-09 06:47:33,783 DEBUG Another single line\n" +"2025-07-09 06:47:33,783 DEBUG Multiple lines:\\nfool me ...\\ncan't get fooled again" msgid "Escaping behaviour can't be the stdlib default , as it would break backwards compatibility." -msgstr "" +msgstr "رفتار خنثی‌کردن نمی‌تواند پیش‌فرض کتابخانه استاندارد (stdlib) باشد، زیرا سازگاری با نسخه‌های پیشین را نقض می‌کند." msgid "Patterns to avoid" -msgstr "" +msgstr "الگوهایی که باید از آن‌ها اجتناب کرد" -msgid "Although the preceding sections have described ways of doing things you might need to do or deal with, it is worth mentioning some usage patterns which are *unhelpful*, and which should therefore be avoided in most cases. The following sections are in no particular order." +msgid "" +"Although the preceding sections have described ways of doing things you might need to do or deal with, it is worth mentioning some usage patterns which are *unhelpful*, and which should therefore " +"be avoided in most cases. The following sections are in no particular order." msgstr "" +"اگرچه بخش‌های پیشین روش‌هایی برای انجام کارهایی که ممکن است لازم باشد انجام دهید یا با آن‌ها سروکار داشته باشید را شرح داده‌اند، اما ذکر برخی الگوهای استفاده که *غیرمفید* هستند و بنابراین در بیشتر " +"موارد باید از آن‌ها اجتناب شود، ارزشمند است. بخش‌های زیر ترتیب خاصی ندارند." msgid "Opening the same log file multiple times" -msgstr "" +msgstr "باز کردن چندباره‌ی همان فایل گزارش" -msgid "On Windows, you will generally not be able to open the same file multiple times as this will lead to a \"file is in use by another process\" error. However, on POSIX platforms you'll not get any errors if you open the same file multiple times. This could be done accidentally, for example by:" +msgid "" +"On Windows, you will generally not be able to open the same file multiple times as this will lead to a \"file is in use by another process\" error. However, on POSIX platforms you'll not get any " +"errors if you open the same file multiple times. This could be done accidentally, for example by:" msgstr "" +"در ویندوز، معمولاً نمی‌توانید همان فایل را چندین بار باز کنید، زیرا این کار منجر به خطای «file is in use by another process» می‌شود. با این حال، در پلتفرم‌های POSIX اگر همان فایل را چندین بار باز " +"کنید، هیچ خطایی دریافت نخواهید کرد. این کار ممکن است به‌صورت تصادفی انجام شود، برای مثال با:" msgid "Adding a file handler more than once which references the same file (e.g. by a copy/paste/forget-to-change error)." -msgstr "" +msgstr "افزودن هندلر فایل (file handler) بیش از یک بار که به همان فایل ارجاع می‌دهد (مثلاً بر اثر خطای کپی/چسباندن/فراموشی تغییر)." msgid "Opening two files that look different, as they have different names, but are the same because one is a symbolic link to the other." -msgstr "" +msgstr "باز کردن دو فایلی که متفاوت به نظر می‌رسند، زیرا نام‌های متفاوتی دارند، اما یکسان هستند، چون یکی از آن‌ها پیوند نمادین (symbolic link) به دیگری است." msgid "Forking a process, following which both parent and child have a reference to the same file. This might be through use of the :mod:`multiprocessing` module, for example." -msgstr "" +msgstr "انشعاب (forking) یک فرایند، که پس از آن هر دو والد و فرزند به یک فایل ارجاع دارند. این ممکن است برای مثال از طریق استفاده از ماژول :mod:`multiprocessing` رخ دهد." msgid "Opening a file multiple times might *appear* to work most of the time, but can lead to a number of problems in practice:" -msgstr "" +msgstr "باز کردن یک فایل چندین بار ممکن است *به نظر برسد* که بیشتر مواقع کار می‌کند، اما می‌تواند در عمل به تعدادی مشکل منجر شود:" -msgid "Logging output can be garbled because multiple threads or processes try to write to the same file. Although logging guards against concurrent use of the same handler instance by multiple threads, there is no such protection if concurrent writes are attempted by two different threads using two different handler instances which happen to point to the same file." +msgid "" +"Logging output can be garbled because multiple threads or processes try to write to the same file. Although logging guards against concurrent use of the same handler instance by multiple threads, " +"there is no such protection if concurrent writes are attempted by two different threads using two different handler instances which happen to point to the same file." msgstr "" +"خروجی گزارش‌گیری (logging) ممکن است به‌هم‌ریخته شود، زیرا چندین نخ یا فرایند سعی می‌کنند در یک فایل مشترک بنویسند. اگرچه گزارش‌گیری در برابر استفاده‌ی همزمان چندین نخ از یک نمونه‌ی هندلر (handler) یکسان " +"محافظت می‌کند، اما اگر دو نخ متفاوت با استفاده از دو نمونه‌ی هندلری متفاوت که اتفاقاً به یک فایل مشترک اشاره می‌کنند، اقدام به نوشتن همزمان کنند، چنین محافظتی وجود ندارد." -msgid "An attempt to delete a file (e.g. during file rotation) silently fails, because there is another reference pointing to it. This can lead to confusion and wasted debugging time - log entries end up in unexpected places, or are lost altogether. Or a file that was supposed to be moved remains in place, and grows in size unexpectedly despite size-based rotation being supposedly in place." +msgid "" +"An attempt to delete a file (e.g. during file rotation) silently fails, because there is another reference pointing to it. This can lead to confusion and wasted debugging time - log entries end " +"up in unexpected places, or are lost altogether. Or a file that was supposed to be moved remains in place, and grows in size unexpectedly despite size-based rotation being supposedly in place." msgstr "" +"تلاش برای حذف یک فایل (مثلاً هنگام چرخش فایل) بی‌صدا شکست می‌خورد، زیرا ارجاع دیگری به آن اشاره می‌کند. این موضوع می‌تواند به سردرگمی و هدر رفتن زمان اشکال‌زدایی منجر شود — ورودی‌های گزارش در مکان‌های " +"غیرمنتظره‌ای قرار می‌گیرند، یا به‌کلی از بین می‌روند. یا فایلی که قرار بود جابه‌جا شود، در جای خود باقی می‌ماند و با وجود اینکه چرخش مبتنی بر اندازه ظاهراً برقرار است، اندازه‌اش به‌طور غیرمنتظره‌ای افزایش " +"می‌یابد." msgid "Use the techniques outlined in :ref:`multiple-processes` to circumvent such issues." -msgstr "" +msgstr "برای اجتناب از چنین مشکلاتی، از روش‌های شرح‌داده‌شده در :ref:`multiple-processes` استفاده کنید." msgid "Using loggers as attributes in a class or passing them as parameters" -msgstr "" +msgstr "استفاده از گزارش‌گیرها به‌عنوان ویژگی در یک کلاس یا ارسال آن‌ها به‌عنوان پارامتر" -msgid "While there might be unusual cases where you'll need to do this, in general there is no point because loggers are singletons. Code can always access a given logger instance by name using ``logging.getLogger(name)``, so passing instances around and holding them as instance attributes is pointless. Note that in other languages such as Java and C#, loggers are often static class attributes. However, this pattern doesn't make sense in Python, where the module (and not the class) is the unit of software decomposition." +msgid "" +"While there might be unusual cases where you'll need to do this, in general there is no point because loggers are singletons. Code can always access a given logger instance by name using " +"``logging.getLogger(name)``, so passing instances around and holding them as instance attributes is pointless. Note that in other languages such as Java and C#, loggers are often static class " +"attributes. However, this pattern doesn't make sense in Python, where the module (and not the class) is the unit of software decomposition." msgstr "" +"اگرچه ممکن است موارد غیرمعمولی وجود داشته باشد که به انجام این کار نیاز داشته باشید، اما به‌طور کلی دلیلی برای این کار وجود ندارد، زیرا گزارش‌گیرها (loggers) تک‌نمونه هستند. کد همیشه می‌تواند با استفاده " +"از ``logging.getLogger(name)`` از طریق نام به نمونه گزارش‌گیر موردنظر دسترسی پیدا کند، بنابراین جابه‌جایی نمونه‌ها و نگه‌داشتن آن‌ها به‌عنوان ویژگی‌های نمونه بی‌فایده است. توجه داشته باشید که در زبان‌های دیگر " +"مانند Java و C#، گزارش‌گیرها اغلب ویژگی‌های static کلاس هستند. با این حال، این الگو در پایتون معنایی ندارد، جایی که ماژول (و نه کلاس) واحد تجزیه نرم‌افزاری است." msgid "Adding handlers other than :class:`~logging.NullHandler` to a logger in a library" -msgstr "" +msgstr "افزودن هندلرهایی غیر از :class:`~logging.NullHandler` به یک گزارش‌گیر در یک کتابخانه" -msgid "Configuring logging by adding handlers, formatters and filters is the responsibility of the application developer, not the library developer. If you are maintaining a library, ensure that you don't add handlers to any of your loggers other than a :class:`~logging.NullHandler` instance." +msgid "" +"Configuring logging by adding handlers, formatters and filters is the responsibility of the application developer, not the library developer. If you are maintaining a library, ensure that you " +"don't add handlers to any of your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" +"پیکربندی گزارش‌گیری (logging) با افزودن هندلرها (handlers)، قالب‌بندها (formatters) و فیلترها (filters)، بر عهده توسعه‌دهنده برنامه است، نه توسعه‌دهنده کتابخانه. اگر در حال نگهداری یک کتابخانه " +"هستید، اطمینان حاصل کنید که به هیچ‌یک از گزارش‌گیرهای (loggers) خود هندلری اضافه نمی‌کنید، مگر یک نمونه از :class:`~logging.NullHandler`." msgid "Creating a lot of loggers" -msgstr "" +msgstr "ایجاد تعداد زیادی گزارش‌گیر (logger)" -msgid "Loggers are singletons that are never freed during a script execution, and so creating lots of loggers will use up memory which can't then be freed. Rather than create a logger per e.g. file processed or network connection made, use the :ref:`existing mechanisms ` for passing contextual information into your logs and restrict the loggers created to those describing areas within your application (generally modules, but occasionally slightly more fine-grained than that)." +msgid "" +"Loggers are singletons that are never freed during a script execution, and so creating lots of loggers will use up memory which can't then be freed. Rather than create a logger per e.g. file " +"processed or network connection made, use the :ref:`existing mechanisms ` for passing contextual information into your logs and restrict the loggers created to those describing " +"areas within your application (generally modules, but occasionally slightly more fine-grained than that)." msgstr "" +"گزارش‌گیرها (Loggers) تک‌نمونه‌هایی هستند که هرگز در طول اجرای یک اسکریپت آزاد نمی‌شوند، بنابراین ایجاد تعداد زیادی گزارش‌گیر حافظه‌ای را مصرف می‌کند که سپس نمی‌توان آن را آزاد کرد. به‌جای ایجاد یک گزارش‌گیر به‌ازای " +"مثلاً هر فایل پردازش‌شده یا هر اتصال شبکه‌ای که برقرار می‌شود، از :ref:`مکانیزم‌های موجود ` برای انتقال اطلاعات زمینه‌ای به گزارش‌هایتان استفاده کنید و گزارش‌گیرهای ایجادشده را به آن‌هایی که " +"بخش‌هایی درون برنامه‌تان را توصیف می‌کنند محدود کنید (معمولاً ماژول‌ها، اما گاهی کمی ریزدانه‌تر از آن)." msgid "Other resources" -msgstr "" +msgstr "منابع دیگر" msgid "Module :mod:`logging`" -msgstr "" +msgstr "ماژول :mod:`logging`" msgid "API reference for the logging module." -msgstr "" +msgstr "مرجع API ماژول logging." msgid "Module :mod:`logging.config`" -msgstr "" +msgstr "ماژول :mod:`logging.config`" msgid "Configuration API for the logging module." -msgstr "" +msgstr "API پیکربندی ماژول logging." msgid "Module :mod:`logging.handlers`" -msgstr "" +msgstr "ماژول :mod:`logging.handlers`" msgid "Useful handlers included with the logging module." -msgstr "" +msgstr "هندلرهای مفید (handlers) ارائه‌شده همراه با ماژول logging." msgid ":ref:`Basic Tutorial `" -msgstr "" +msgstr ":ref:`خودآموز مقدماتی `" msgid ":ref:`Advanced Tutorial `" -msgstr "" +msgstr ":ref:`آموزش پیشرفته `" diff --git a/howto/logging.po b/howto/logging.po index 110464564..4503b97e3 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"PO-Revision-Date: 2026-08-28 10:55+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,160 +23,307 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Logging HOWTO" -msgstr "" +msgstr "راهنمای گزارش‌برداری (Logging)" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "Vinay Sajip " -msgstr "" +msgstr "Vinay Sajip " -msgid "This page contains tutorial information. For links to reference information and a logging cookbook, please see :ref:`tutorial-ref-links`." +msgid "" +"This page contains tutorial information. For links to reference information " +"and a logging cookbook, please see :ref:`tutorial-ref-links`." msgstr "" +"این صفحه شامل اطلاعات آموزشی است. برای پیوندهایی به اطلاعات مرجع و یک " +"کتابچه‌ی آشپزی برای گزارش‌گیری (logging cookbook)، لطفاً :ref:`tutorial-ref-" +"links` را ببینید." msgid "Basic Logging Tutorial" -msgstr "" +msgstr "آموزش مقدماتی گزارش‌گیری (Logging)" -msgid "Logging is a means of tracking events that happen when some software runs. The software's developer adds logging calls to their code to indicate that certain events have occurred. An event is described by a descriptive message which can optionally contain variable data (i.e. data that is potentially different for each occurrence of the event). Events also have an importance which the developer ascribes to the event; the importance can also be called the *level* or *severity*." -msgstr "" +msgid "" +"Logging is a means of tracking events that happen when some software runs. " +"The software's developer adds logging calls to their code to indicate that " +"certain events have occurred. An event is described by a descriptive message " +"which can optionally contain variable data (i.e. data that is potentially " +"different for each occurrence of the event). Events also have an importance " +"which the developer ascribes to the event; the importance can also be called " +"the *level* or *severity*." +msgstr "" +"ثبت رویداد (logging) راهی برای پیگیری رویدادهایی است که هنگام اجرای یک " +"نرم‌افزار رخ می‌دهند. توسعه‌دهنده‌ی نرم‌افزار فراخوانی‌های ثبت رویداد را به کد خود " +"اضافه می‌کند تا نشان دهد رویدادهای خاصی رخ داده‌اند. یک رویداد با یک پیام " +"توصیفی توصیف می‌شود که می‌تواند به‌صورت اختیاری حاوی داده‌های متغیر باشد (یعنی " +"داده‌هایی که ممکن است برای هر وقوع رویداد متفاوت باشند). رویدادها همچنین " +"دارای اهمیتی هستند که توسعه‌دهنده به رویداد نسبت می‌دهد؛ این اهمیت را می‌توان " +"*سطح* یا *شدت* نیز نامید." msgid "When to use logging" -msgstr "" +msgstr "چه زمانی از گزارش‌گیری استفاده کنیم" -msgid "You can access logging functionality by creating a logger via ``logger = logging.getLogger(__name__)``, and then calling the logger's :meth:`~Logger.debug`, :meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error` and :meth:`~Logger.critical` methods. To determine when to use logging, and to see which logger methods to use when, see the table below. It states, for each of a set of common tasks, the best tool to use for that task." -msgstr "" +msgid "" +"You can access logging functionality by creating a logger via ``logger = " +"logging.getLogger(__name__)``, and then calling the " +"logger's :meth:`~Logger.debug`, :meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error` " +"and :meth:`~Logger.critical` methods. To determine when to use logging, and " +"to see which logger methods to use when, see the table below. It states, for " +"each of a set of common tasks, the best tool to use for that task." +msgstr "" +"شما می‌توانید با ایجاد یک گزارش‌گیر (logger) از طریق ``logger = " +"logging.getLogger(__name__)`` و سپس فراخوانی " +"متدهای :meth:`~Logger.debug`، :meth:`~Logger.info`، :meth:`~Logger.warning`، :meth:`~Logger.error` " +"و :meth:`~Logger.critical` آن، به قابلیت گزارش‌گیری (logging) دسترسی پیدا کنید. " +"برای تشخیص اینکه چه زمانی از گزارش‌گیری استفاده کنید و ببینید چه زمانی از کدام " +"متدهای گزارش‌گیر استفاده کنید، به جدول زیر مراجعه کنید. این جدول برای هر یک از " +"مجموعه‌ای از وظایف رایج، بهترین ابزار برای استفاده در آن وظیفه را بیان می‌کند." msgid "Task you want to perform" -msgstr "" +msgstr "کاری که می‌خواهید انجام دهید" msgid "The best tool for the task" -msgstr "" +msgstr "بهترین ابزار برای این کار" -msgid "Display console output for ordinary usage of a command line script or program" -msgstr "" +msgid "" +"Display console output for ordinary usage of a command line script or program" +msgstr "نمایش خروجی کنسول برای استفاده معمول از یک اسکریپت یا برنامه خط فرمان" msgid ":func:`print`" -msgstr "" +msgstr ":func:`print`" -msgid "Report events that occur during normal operation of a program (e.g. for status monitoring or fault investigation)" +msgid "" +"Report events that occur during normal operation of a program (e.g. for " +"status monitoring or fault investigation)" msgstr "" +"گزارش رویدادهایی که در حین عملکرد عادی یک برنامه رخ می‌دهند (برای مثال برای " +"پایش وضعیت یا بررسی خطا)" -msgid "A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very detailed output for diagnostic purposes)" +msgid "" +"A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very " +"detailed output for diagnostic purposes)" msgstr "" +"متد :meth:`~Logger.info` یک گزارش‌گیر (یا متد :meth:`~Logger.debug` برای خروجی با " +"جزئیات بسیار برای اهداف تشخیصی)" msgid "Issue a warning regarding a particular runtime event" -msgstr "" +msgstr "صدور یک هشدار در مورد یک رویداد ران‌تایم خاص" -msgid ":func:`warnings.warn` in library code if the issue is avoidable and the client application should be modified to eliminate the warning" +msgid "" +":func:`warnings.warn` in library code if the issue is avoidable and the " +"client application should be modified to eliminate the warning" msgstr "" +":func:`warnings.warn` در کد کتابخانه‌ای، اگر مشکل قابل‌اجتناب است و برنامه‌ی " +"کلاینت باید برای حذف هشدار اصلاح شود" -msgid "A logger's :meth:`~Logger.warning` method if there is nothing the client application can do about the situation, but the event should still be noted" +msgid "" +"A logger's :meth:`~Logger.warning` method if there is nothing the client " +"application can do about the situation, but the event should still be noted" msgstr "" +"متد :meth:`~Logger.warning` گزارش‌گیر (logger)، اگر برنامه کلاینت نتواند هیچ کاری " +"درباره آن موقعیت انجام دهد، اما رویداد همچنان باید ثبت شود" msgid "Report an error regarding a particular runtime event" -msgstr "" +msgstr "گزارش یک خطا در مورد یک رویداد ران‌تایم خاص" msgid "Raise an exception" -msgstr "" +msgstr "پرتاب یک استثنا" -msgid "Report suppression of an error without raising an exception (e.g. error handler in a long-running server process)" +msgid "" +"Report suppression of an error without raising an exception (e.g. error " +"handler in a long-running server process)" msgstr "" +"گزارش فرونشانی یک خطا بدون پرتاب استثنا (مثلاً هندلر خطا در یک فرآیند " +"سرور طولانی‌مدت)" -msgid "A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` or :meth:`~Logger.critical` method as appropriate for the specific error and application domain" +msgid "" +"A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` " +"or :meth:`~Logger.critical` method as appropriate for the specific error and " +"application domain" msgstr "" +"متد :meth:`~Logger.error`، :meth:`~Logger.exception` " +"یا :meth:`~Logger.critical` یک گزارش‌گیر (logger)، متناسب با خطای مشخص و حوزه‌ی " +"کاربرد" -msgid "The logger methods are named after the level or severity of the events they are used to track. The standard levels and their applicability are described below (in increasing order of severity):" +msgid "" +"The logger methods are named after the level or severity of the events they " +"are used to track. The standard levels and their applicability are described " +"below (in increasing order of severity):" msgstr "" +"متدهای گزارش‌گیر (logger) بر اساس سطح یا شدت رویدادهایی که برای پیگیری آن‌ها " +"استفاده می‌شوند، نام‌گذاری شده‌اند. سطح‌های استاندارد و موارد کاربرد آن‌ها در زیر " +"شرح داده شده‌اند (به‌ترتیب افزایشی شدت):" msgid "Level" -msgstr "" +msgstr "سطح" msgid "When it's used" -msgstr "" +msgstr "هنگامی که استفاده می‌شود" msgid "``DEBUG``" -msgstr "" +msgstr "``DEBUG``" -msgid "Detailed information, typically of interest only when diagnosing problems." -msgstr "" +msgid "" +"Detailed information, typically of interest only when diagnosing problems." +msgstr "اطلاعات دقیق، معمولاً فقط هنگام اشکال‌زدایی مشکلات مورد توجه است." msgid "``INFO``" -msgstr "" +msgstr "``INFO``" msgid "Confirmation that things are working as expected." -msgstr "" +msgstr "تأیید اینکه همه‌چیز مطابق انتظار کار می‌کند." msgid "``WARNING``" -msgstr "" +msgstr "``WARNING``" -msgid "An indication that something unexpected happened, or indicative of some problem in the near future (e.g. 'disk space low'). The software is still working as expected." +msgid "" +"An indication that something unexpected happened, or indicative of some " +"problem in the near future (e.g. 'disk space low'). The software is still " +"working as expected." msgstr "" +"نشانه‌ای از اینکه اتفاق غیرمنتظره‌ای رخ داده است، یا نشان‌دهنده‌ی مشکلی در آینده‌ی " +"نزدیک (مثلاً «فضای دیسک کم است»). نرم‌افزار همچنان مطابق انتظار کار می‌کند." msgid "``ERROR``" -msgstr "" +msgstr "``ERROR``" -msgid "Due to a more serious problem, the software has not been able to perform some function." -msgstr "" +msgid "" +"Due to a more serious problem, the software has not been able to perform " +"some function." +msgstr "به دلیل مشکلی جدی‌تر، نرم‌افزار نتوانسته است برخی عملکردها را انجام دهد." msgid "``CRITICAL``" -msgstr "" +msgstr "``CRITICAL``" -msgid "A serious error, indicating that the program itself may be unable to continue running." +msgid "" +"A serious error, indicating that the program itself may be unable to " +"continue running." msgstr "" +"یک خطای جدی، که نشان می‌دهد خود برنامه ممکن است نتواند به اجرا ادامه دهد." -msgid "The default level is ``WARNING``, which means that only events of this severity and higher will be tracked, unless the logging package is configured to do otherwise." +msgid "" +"The default level is ``WARNING``, which means that only events of this " +"severity and higher will be tracked, unless the logging package is " +"configured to do otherwise." msgstr "" +"سطح پیش‌فرض ``WARNING`` است، یعنی فقط رویدادهای این شدت و بالاتر از آن پیگیری " +"می‌شوند، مگر اینکه بسته‌ی logging به‌گونه‌ای دیگر پیکربندی شده باشد." -msgid "Events that are tracked can be handled in different ways. The simplest way of handling tracked events is to print them to the console. Another common way is to write them to a disk file." +msgid "" +"Events that are tracked can be handled in different ways. The simplest way " +"of handling tracked events is to print them to the console. Another common " +"way is to write them to a disk file." msgstr "" +"رویدادهایی که پیگیری می‌شوند را می‌توان به روش‌های مختلفی مدیریت کرد. ساده‌ترین " +"روش برای مدیریت رویدادهای پیگیری‌شده، چاپ آن‌ها در کنسول است. یک روش رایج " +"دیگر، نوشتن آن‌ها در یک فایل روی دیسک است." msgid "A simple example" -msgstr "" +msgstr "یک مثال ساده" msgid "A very simple example is::" -msgstr "" +msgstr "یک مثال بسیار ساده::" msgid "" "import logging\n" "logging.warning('Watch out!') # will print a message to the console\n" "logging.info('I told you so') # will not print anything" msgstr "" +"import logging\n" +"logging.warning('Watch out!') # will print a message to the console\n" +"logging.info('I told you so') # will not print anything" msgid "If you type these lines into a script and run it, you'll see:" -msgstr "" +msgstr "اگر این خطوط را در یک اسکریپت وارد کنید و آن را اجرا کنید، خواهید دید:" msgid "WARNING:root:Watch out!" -msgstr "" +msgstr "WARNING:root:مراقب باشید!" -msgid "printed out on the console. The ``INFO`` message doesn't appear because the default level is ``WARNING``. The printed message includes the indication of the level and the description of the event provided in the logging call, i.e. 'Watch out!'. The actual output can be formatted quite flexibly if you need that; formatting options will also be explained later." -msgstr "" +msgid "" +"printed out on the console. The ``INFO`` message doesn't appear because the " +"default level is ``WARNING``. The printed message includes the indication of " +"the level and the description of the event provided in the logging call, " +"i.e. 'Watch out!'. The actual output can be formatted quite flexibly if you " +"need that; formatting options will also be explained later." +msgstr "" +"در کنسول چاپ می‌شود. پیام ``INFO`` نمایش داده نمی‌شود زیرا سطح پیش‌فرض " +"``WARNING`` است. پیام چاپ‌شده شامل نشانگر سطح و شرح رویداد ارائه‌شده در " +"فراخوانی logging است، یعنی 'Watch out!'. در صورت نیاز، می‌توان خروجی واقعی را " +"با انعطاف‌پذیری بالایی قالب‌بندی کرد؛ گزینه‌های قالب‌بندی نیز بعداً توضیح داده " +"خواهند شد." -msgid "Notice that in this example, we use functions directly on the ``logging`` module, like ``logging.debug``, rather than creating a logger and calling functions on it. These functions operate on the root logger, but can be useful as they will call :func:`~logging.basicConfig` for you if it has not been called yet, like in this example. In larger programs you'll usually want to control the logging configuration explicitly however - so for that reason as well as others, it's better to create loggers and call their methods." -msgstr "" +msgid "" +"Notice that in this example, we use functions directly on the ``logging`` " +"module, like ``logging.debug``, rather than creating a logger and calling " +"functions on it. These functions operate on the root logger, but can be " +"useful as they will call :func:`~logging.basicConfig` for you if it has not " +"been called yet, like in this example. In larger programs you'll usually " +"want to control the logging configuration explicitly however - so for that " +"reason as well as others, it's better to create loggers and call their " +"methods." +msgstr "" +"توجه داشته باشید که در این مثال، به‌جای ایجاد یک گزارش‌گیر و فراخوانی توابع آن، " +"مستقیماً از توابع ماژول ``logging``، مانند ``logging.debug``، استفاده می‌کنیم. " +"این توابع بر روی گزارش‌گیر ریشه عمل می‌کنند، اما می‌توانند مفید باشند، زیرا " +"اگر :func:`~logging.basicConfig` هنوز فراخوانی نشده باشد، آن را برای شما " +"فراخوانی می‌کنند، همان‌طور که در این مثال دیده می‌شود. با این حال، در برنامه‌های " +"بزرگ‌تر معمولاً می‌خواهید پیکربندی گزارش‌گیری را به‌صراحت کنترل کنید؛ بنابراین به " +"همین دلیل و دلایل دیگر، بهتر است گزارش‌گیرها را ایجاد کنید و متدهای آن‌ها را " +"فراخوانی کنید." msgid "Logging to a file" -msgstr "" +msgstr "گزارش‌گیری در یک فایل" -msgid "A very common situation is that of recording logging events in a file, so let's look at that next. Be sure to try the following in a newly started Python interpreter, and don't just continue from the session described above::" +msgid "" +"A very common situation is that of recording logging events in a file, so " +"let's look at that next. Be sure to try the following in a newly started " +"Python interpreter, and don't just continue from the session described " +"above::" msgstr "" +"یک حالت بسیار رایج، ثبت رویدادهای گزارش (logging) در یک فایل است، بنابراین در " +"ادامه به بررسی آن می‌پردازیم. حتماً موارد زیر را در یک مفسر پایتون که به‌تازگی " +"آغاز شده است آزمایش کنید و صرفاً از نشست توصیف‌شده در بالا ادامه ندهید::" msgid "" "import logging\n" "logger = logging.getLogger(__name__)\n" -"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', " +"level=logging.DEBUG)\n" "logger.debug('This message should go to the log file')\n" "logger.info('So should this')\n" "logger.warning('And this, too')\n" "logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" msgstr "" +"import logging\n" +"logger = logging.getLogger(__name__)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', " +"level=logging.DEBUG)\n" +"logger.debug('This message should go to the log file')\n" +"logger.info('So should this')\n" +"logger.warning('And this, too')\n" +"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" -msgid "The *encoding* argument was added. In earlier Python versions, or if not specified, the encoding used is the default value used by :func:`open`. While not shown in the above example, an *errors* argument can also now be passed, which determines how encoding errors are handled. For available values and the default, see the documentation for :func:`open`." -msgstr "" +msgid "" +"The *encoding* argument was added. In earlier Python versions, or if not " +"specified, the encoding used is the default value used by :func:`open`. " +"While not shown in the above example, an *errors* argument can also now be " +"passed, which determines how encoding errors are handled. For available " +"values and the default, see the documentation for :func:`open`." +msgstr "" +"آرگومان *encoding* افزوده شد. در نسخه‌های پیشین پایتون، یا اگر مشخص نشده " +"باشد، کدگذاری استفاده‌شده مقدار پیش‌فرضی است که توسط :func:`open` استفاده " +"می‌شود. اگرچه در مثال بالا نشان داده نشده است، اکنون می‌توان آرگومان *errors* " +"را نیز ارسال کرد که تعیین می‌کند خطاهای کدگذاری چگونه مدیریت شوند. برای " +"مقادیر موجود و مقدار پیش‌فرض، مستندات :func:`open` را ببینید." -msgid "And now if we open the file and look at what we have, we should find the log messages:" +msgid "" +"And now if we open the file and look at what we have, we should find the log " +"messages:" msgstr "" +"و اکنون اگر فایل را باز کنیم و به آنچه داریم نگاه کنیم، باید پیام‌های گزارش را " +"پیدا کنیم:" msgid "" "DEBUG:__main__:This message should go to the log file\n" @@ -184,24 +331,45 @@ msgid "" "WARNING:__main__:And this, too\n" "ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" msgstr "" +"DEBUG:__main__:این پیام باید به فایل گزارش برود\n" +"INFO:__main__:این پیام هم همین‌طور\n" +"WARNING:__main__:و این هم همین‌طور\n" +"ERROR:__main__:و موارد غیر اسکی (non-ASCII) نیز، مانند Øresund و Malmö" -msgid "This example also shows how you can set the logging level which acts as the threshold for tracking. In this case, because we set the threshold to ``DEBUG``, all of the messages were printed." +msgid "" +"This example also shows how you can set the logging level which acts as the " +"threshold for tracking. In this case, because we set the threshold to " +"``DEBUG``, all of the messages were printed." msgstr "" +"این مثال همچنین نشان می‌دهد که چگونه می‌توانید سطح گزارش‌گیری را تنظیم کنید که " +"به‌عنوان آستانه‌ای برای پیگیری عمل می‌کند. در این مورد، چون آستانه را روی " +"``DEBUG`` تنظیم کردیم، تمام پیام‌ها چاپ شدند." -msgid "If you want to set the logging level from a command-line option such as:" -msgstr "" +msgid "" +"If you want to set the logging level from a command-line option such as:" +msgstr "اگر می‌خواهید سطح گزارش را از طریق یک گزینه‌ی خط فرمان تنظیم کنید، مانند:" msgid "--log=INFO" -msgstr "" +msgstr "--log=INFO" -msgid "and you have the value of the parameter passed for ``--log`` in some variable *loglevel*, you can use::" +msgid "" +"and you have the value of the parameter passed for ``--log`` in some " +"variable *loglevel*, you can use::" msgstr "" +"و مقدار پارامتر داده‌شده برای ``--log`` را در متغیری به نام *loglevel* دارید، " +"می‌توانید به این صورت استفاده کنید::" msgid "getattr(logging, loglevel.upper())" -msgstr "" +msgstr "getattr(logging, loglevel.upper())" -msgid "to get the value which you'll pass to :func:`basicConfig` via the *level* argument. You may want to error check any user input value, perhaps as in the following example::" +msgid "" +"to get the value which you'll pass to :func:`basicConfig` via the *level* " +"argument. You may want to error check any user input value, perhaps as in " +"the following example::" msgstr "" +"برای دریافت مقداری که آن را از طریق آرگومان *level* به :func:`basicConfig` " +"می‌دهید. ممکن است بخواهید هر مقدار ورودی کاربر را از نظر خطا بررسی کنید، شاید " +"مانند مثال زیر::" msgid "" "# assuming loglevel is bound to the string value obtained from the\n" @@ -212,286 +380,744 @@ msgid "" " raise ValueError('Invalid log level: %s' % loglevel)\n" "logging.basicConfig(level=numeric_level, ...)" msgstr "" +"# با فرض اینکه loglevel به مقدار رشته‌ای حاصل از\n" +"# آرگومان خط فرمان متصل است. برای اینکه کاربر بتواند\n" +"# --log=DEBUG یا --log=debug را مشخص کند، آن را به حروف بزرگ تبدیل کنید\n" +"numeric_level = getattr(logging, loglevel.upper(), None)\n" +"if not isinstance(numeric_level, int):\n" +" raise ValueError('Invalid log level: %s' % loglevel)\n" +"logging.basicConfig(level=numeric_level, ...)" -msgid "The call to :func:`basicConfig` should come *before* any calls to a logger's methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, that logging event may not be handled in the desired manner." +msgid "" +"The call to :func:`basicConfig` should come *before* any calls to a logger's " +"methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, " +"that logging event may not be handled in the desired manner." msgstr "" +"فراخوانی :func:`basicConfig` باید *پیش از* هر فراخوانی از متدهای گزارش‌گیر " +"مانند :meth:`~Logger.debug`، :meth:`~Logger.info` و غیره انجام شود. در غیر " +"این صورت، ممکن است آن رویداد گزارش به روش دلخواه مدیریت نشود." -msgid "If you run the above script several times, the messages from successive runs are appended to the file *example.log*. If you want each run to start afresh, not remembering the messages from earlier runs, you can specify the *filemode* argument, by changing the call in the above example to::" +msgid "" +"If you run the above script several times, the messages from successive runs " +"are appended to the file *example.log*. If you want each run to start " +"afresh, not remembering the messages from earlier runs, you can specify the " +"*filemode* argument, by changing the call in the above example to::" msgstr "" +"اگر اسکریپت بالا را چند بار اجرا کنید، پیام‌های اجراهای پیاپی به فایل " +"*example.log* افزوده می‌شوند. اگر می‌خواهید هر اجرا از نو آغاز شود و پیام‌های " +"اجراهای پیشین را به خاطر نداشته باشد، می‌توانید با تغییر فراخوانی در مثال " +"بالا به شکل زیر، آرگومان *filemode* را مشخص کنید::" -msgid "logging.basicConfig(filename='example.log', filemode='w', level=logging.DEBUG)" +msgid "" +"logging.basicConfig(filename='example.log', filemode='w', " +"level=logging.DEBUG)" msgstr "" +"logging.basicConfig(filename='example.log', filemode='w', " +"level=logging.DEBUG)" -msgid "The output will be the same as before, but the log file is no longer appended to, so the messages from earlier runs are lost." +msgid "" +"The output will be the same as before, but the log file is no longer " +"appended to, so the messages from earlier runs are lost." msgstr "" +"خروجی مانند قبل خواهد بود، اما دیگر به فایل گزارش الحاق نمی‌شود، بنابراین " +"پیام‌های اجراهای پیشین از دست می‌روند." msgid "Logging variable data" -msgstr "" +msgstr "ثبت داده‌های متغیر" -msgid "To log variable data, use a format string for the event description message and append the variable data as arguments. For example::" +msgid "" +"To log variable data, use a format string for the event description message " +"and append the variable data as arguments. For example::" msgstr "" +"برای ثبت داده‌های متغیر، از یک رشته قالب برای پیام توصیف رویداد استفاده کنید " +"و داده‌های متغیر را به‌عنوان آرگومان اضافه کنید. برای مثال::" msgid "" "import logging\n" "logging.warning('%s before you %s', 'Look', 'leap!')" msgstr "" +"import logging\n" +"logging.warning('%s before you %s', 'Look', 'leap!')" msgid "will display:" -msgstr "" +msgstr "نمایش خواهد داد:" msgid "WARNING:root:Look before you leap!" -msgstr "" +msgstr "WARNING:root:پیش از اقدام، تأمل کنید!" -msgid "As you can see, merging of variable data into the event description message uses the old, %-style of string formatting. This is for backwards compatibility: the logging package pre-dates newer formatting options such as :meth:`str.format` and :class:`string.Template`. These newer formatting options *are* supported, but exploring them is outside the scope of this tutorial: see :ref:`formatting-styles` for more information." -msgstr "" +msgid "" +"As you can see, merging of variable data into the event description message " +"uses the old, %-style of string formatting. This is for backwards " +"compatibility: the logging package pre-dates newer formatting options such " +"as :meth:`str.format` and :class:`string.Template`. These newer formatting " +"options *are* supported, but exploring them is outside the scope of this " +"tutorial: see :ref:`formatting-styles` for more information." +msgstr "" +"همان‌طور که می‌بینید، ادغام داده‌های متغیر در پیام توصیف رویداد از سبک قدیمی " +"قالب‌بندی رشته با %-style استفاده می‌کند. این برای سازگاری با نسخه‌های قدیمی " +"است: بسته‌ی logging پیش از گزینه‌های قالب‌بندی جدیدتری مانند :meth:`str.format` " +"و :class:`string.Template` وجود داشته است. این گزینه‌های قالب‌بندی جدیدتر " +"*پشتیبانی می‌شوند*، اما بررسی آن‌ها خارج از محدوده این آموزش است: برای اطلاعات " +"بیشتر :ref:`formatting-styles` را ببینید." msgid "Changing the format of displayed messages" -msgstr "" +msgstr "تغییر قالب پیام‌های نمایش‌داده‌شده" -msgid "To change the format which is used to display messages, you need to specify the format you want to use::" +msgid "" +"To change the format which is used to display messages, you need to specify " +"the format you want to use::" msgstr "" +"برای تغییر قالبی که برای نمایش پیام‌ها استفاده می‌شود، باید قالبی را که " +"می‌خواهید استفاده کنید، مشخص کنید::" msgid "" "import logging\n" -"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', " +"level=logging.DEBUG)\n" "logging.debug('This message should appear on the console')\n" "logging.info('So should this')\n" "logging.warning('And this, too')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', " +"level=logging.DEBUG)\n" +"logging.debug('This message should appear on the console')\n" +"logging.info('So should this')\n" +"logging.warning('And this, too')" msgid "which would print:" -msgstr "" +msgstr "که این را چاپ خواهد کرد:" msgid "" "DEBUG:This message should appear on the console\n" "INFO:So should this\n" "WARNING:And this, too" msgstr "" +"DEBUG:این پیام باید در کنسول ظاهر شود\n" +"INFO:این پیام نیز همین‌طور\n" +"WARNING:و این پیام نیز همین‌طور" -msgid "Notice that the 'root' which appeared in earlier examples has disappeared. For a full set of things that can appear in format strings, you can refer to the documentation for :ref:`logrecord-attributes`, but for simple usage, you just need the *levelname* (severity), *message* (event description, including variable data) and perhaps to display when the event occurred. This is described in the next section." -msgstr "" +msgid "" +"Notice that the 'root' which appeared in earlier examples has disappeared. " +"For a full set of things that can appear in format strings, you can refer to " +"the documentation for :ref:`logrecord-attributes`, but for simple usage, you " +"just need the *levelname* (severity), *message* (event description, " +"including variable data) and perhaps to display when the event occurred. " +"This is described in the next section." +msgstr "" +"توجه داشته باشید که 'root' که در مثال‌های پیشین ظاهر شده بود، ناپدید شده است. " +"برای مشاهده مجموعه کاملی از مواردی که می‌توانند در رشته‌های قالب ظاهر شوند، " +"می‌توانید به مستندات :ref:`logrecord-attributes` مراجعه کنید، اما برای " +"استفاده ساده، فقط به *levelname* (شدت)، *message* (توصیف رویداد، شامل " +"داده‌های متغیر) و احتمالاً به نمایش زمان وقوع رویداد نیاز دارید. این موضوع در " +"بخش بعدی توضیح داده شده است." msgid "Displaying the date/time in messages" -msgstr "" +msgstr "نمایش تاریخ/زمان در پیام‌ها" -msgid "To display the date and time of an event, you would place '%(asctime)s' in your format string::" +msgid "" +"To display the date and time of an event, you would place '%(asctime)s' in " +"your format string::" msgstr "" +"برای نمایش تاریخ و زمان یک رویداد، '%(asctime)s' را در رشته قالب خود قرار " +"می‌دهید::" msgid "" "import logging\n" "logging.basicConfig(format='%(asctime)s %(message)s')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s')\n" +"logging.warning('is when this event was logged.')" msgid "which should print something like this:" -msgstr "" +msgstr "که باید چیزی شبیه به این چاپ کند:" msgid "2010-12-12 11:41:42,612 is when this event was logged." -msgstr "" +msgstr "2010-12-12 11:41:42,612 زمانی است که این رویداد ثبت شد." -msgid "The default format for date/time display (shown above) is like ISO8601 or :rfc:`3339`. If you need more control over the formatting of the date/time, provide a *datefmt* argument to ``basicConfig``, as in this example::" +msgid "" +"The default format for date/time display (shown above) is like ISO8601 " +"or :rfc:`3339`. If you need more control over the formatting of the date/" +"time, provide a *datefmt* argument to ``basicConfig``, as in this example::" msgstr "" +"قالب پیش‌فرض برای نمایش تاریخ/زمان (که در بالا نشان داده شد) مانند ISO8601 " +"یا :rfc:`3339` است. اگر به کنترل بیشتری بر قالب‌بندی تاریخ/زمان نیاز دارید، " +"یک آرگومان *datefmt* به ``basicConfig`` ارائه دهید، همان‌طور که در این مثال " +"آمده است::" msgid "" "import logging\n" -"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" "logging.warning('is when this event was logged.')" msgstr "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" +"logging.warning('is when this event was logged.')" msgid "which would display something like this:" -msgstr "" +msgstr "که چیزی شبیه به این را نمایش می‌دهد:" msgid "12/12/2010 11:46:36 AM is when this event was logged." -msgstr "" +msgstr "این رویداد در ۱۲/۱۲/۲۰۱۰ ۱۱:۴۶:۳۶ ق.ظ ثبت شده است." -msgid "The format of the *datefmt* argument is the same as supported by :func:`time.strftime`." +msgid "" +"The format of the *datefmt* argument is the same as supported " +"by :func:`time.strftime`." msgstr "" +"قالب آرگومان *datefmt* همان قالبی است که :func:`time.strftime` از آن " +"پشتیبانی می‌کند." msgid "Next Steps" -msgstr "" +msgstr "گام‌های بعدی" -msgid "That concludes the basic tutorial. It should be enough to get you up and running with logging. There's a lot more that the logging package offers, but to get the best out of it, you'll need to invest a little more of your time in reading the following sections. If you're ready for that, grab some of your favourite beverage and carry on." +msgid "" +"That concludes the basic tutorial. It should be enough to get you up and " +"running with logging. There's a lot more that the logging package offers, " +"but to get the best out of it, you'll need to invest a little more of your " +"time in reading the following sections. If you're ready for that, grab some " +"of your favourite beverage and carry on." msgstr "" +"این آموزش مقدماتی به پایان رسید. این باید برای شروع کار شما با logging کافی " +"باشد. بسته‌ی logging امکانات بسیار بیشتری ارائه می‌دهد، اما برای بهره‌مندی هرچه " +"بهتر از آن، لازم است کمی بیشتر زمان خود را صرف خواندن بخش‌های بعدی کنید. اگر " +"برای این کار آماده‌اید، نوشیدنی دلخواه‌تان را بردارید و ادامه دهید." -msgid "If your logging needs are simple, then use the above examples to incorporate logging into your own scripts, and if you run into problems or don't understand something, please post a question in the Help category of the `Python discussion forum `_ and you should receive help before too long." +msgid "" +"If your logging needs are simple, then use the above examples to incorporate " +"logging into your own scripts, and if you run into problems or don't " +"understand something, please post a question in the Help category of the " +"`Python discussion forum `_ and you " +"should receive help before too long." msgstr "" +"اگر نیازهای شما به گزارش (logging) ساده هستند، از مثال‌های بالا برای گنجاندن " +"گزارش در اسکریپت‌های خود استفاده کنید و اگر با مشکلی مواجه شدید یا چیزی را " +"متوجه نشدید، لطفاً پرسش خود را در دسته‌ی Help در `انجمن گفتگوی پایتون `_ ارسال کنید؛ باید به‌زودی کمک دریافت کنید." -msgid "Still here? You can carry on reading the next few sections, which provide a slightly more advanced/in-depth tutorial than the basic one above. After that, you can take a look at the :ref:`logging-cookbook`." +msgid "" +"Still here? You can carry on reading the next few sections, which provide a " +"slightly more advanced/in-depth tutorial than the basic one above. After " +"that, you can take a look at the :ref:`logging-cookbook`." msgstr "" +"هنوز اینجا هستید؟ می‌توانید به خواندن چند بخش بعدی ادامه دهید، که آموزشی کمی " +"پیشرفته‌تر/عمیق‌تر از آموزش پایه‌ی بالا ارائه می‌دهند. پس از آن، می‌توانید نگاهی " +"به :ref:`logging-cookbook` بیندازید." msgid "Advanced Logging Tutorial" -msgstr "" +msgstr "آموزش پیشرفته گزارش‌برداری" -msgid "The logging library takes a modular approach and offers several categories of components: loggers, handlers, filters, and formatters." +msgid "" +"The logging library takes a modular approach and offers several categories " +"of components: loggers, handlers, filters, and formatters." msgstr "" +"کتابخانه‌ی logging رویکردی ماژولار دارد و چندین دسته از کامپوننت‌ها را ارائه " +"می‌دهد: گزارش‌گیرها (loggers)، هندلرها (handlers)، فیلترها (filters) و " +"قالب‌بندها (formatters)." msgid "Loggers expose the interface that application code directly uses." msgstr "" +"گزارش‌گیرها رابطی را که کد برنامه به‌طور مستقیم از آن استفاده می‌کند، در دسترس قرار " +"می‌دهند." -msgid "Handlers send the log records (created by loggers) to the appropriate destination." +msgid "" +"Handlers send the log records (created by loggers) to the appropriate " +"destination." msgstr "" +"هندلرها (Handlers) رکوردهای گزارش (log records) را که توسط گزارش‌گیرها " +"(loggers) ایجاد شده‌اند، به مقصد مناسب ارسال می‌کنند." -msgid "Filters provide a finer grained facility for determining which log records to output." +msgid "" +"Filters provide a finer grained facility for determining which log records " +"to output." msgstr "" +"فیلترها امکان دقیق‌تری را برای تعیین اینکه کدام رکوردهای گزارش باید خروجی داده " +"شوند، فراهم می‌کنند." msgid "Formatters specify the layout of log records in the final output." -msgstr "" +msgstr "قالب‌بندها چیدمان رکوردهای گزارش را در خروجی نهایی مشخص می‌کنند." -msgid "Log event information is passed between loggers, handlers, filters and formatters in a :class:`LogRecord` instance." +msgid "" +"Log event information is passed between loggers, handlers, filters and " +"formatters in a :class:`LogRecord` instance." msgstr "" +"اطلاعات رویداد گزارش بین گزارش‌گیرها، هندلرها، فیلترها و فرمترها در یک نمونه " +"از :class:`LogRecord` منتقل می‌شود." -msgid "Logging is performed by calling methods on instances of the :class:`Logger` class (hereafter called :dfn:`loggers`). Each instance has a name, and they are conceptually arranged in a namespace hierarchy using dots (periods) as separators. For example, a logger named 'scan' is the parent of loggers 'scan.text', 'scan.html' and 'scan.pdf'. Logger names can be anything you want, and indicate the area of an application in which a logged message originates." -msgstr "" +msgid "" +"Logging is performed by calling methods on instances of the :class:`Logger` " +"class (hereafter called :dfn:`loggers`). Each instance has a name, and they " +"are conceptually arranged in a namespace hierarchy using dots (periods) as " +"separators. For example, a logger named 'scan' is the parent of loggers " +"'scan.text', 'scan.html' and 'scan.pdf'. Logger names can be anything you " +"want, and indicate the area of an application in which a logged message " +"originates." +msgstr "" +"گزارش کردن (logging) با فراخوانی متدهای نمونه‌هایی از کلاس :class:`Logger` (که " +"از این پس :dfn:`loggers` نامیده می‌شوند) انجام می‌شود. هر نمونه یک نام دارد، و " +"آن‌ها به‌صورت مفهومی در یک سلسله‌مراتب فضای نام با استفاده از نقطه‌ها (periods) " +"به‌عنوان جداکننده چیده شده‌اند. برای مثال، یک گزارش‌گیر (logger) با نام 'scan' والد " +"گزارش‌گیرهای 'scan.text'، 'scan.html' و 'scan.pdf' است. نام‌های گزارش‌گیر می‌توانند هر " +"چیزی باشند که شما بخواهید، و بخشی از یک برنامه را که یک پیام گزارش‌شده از آن " +"سرچشمه می‌گیرد، نشان می‌دهند." -msgid "A good convention to use when naming loggers is to use a module-level logger, in each module which uses logging, named as follows::" +msgid "" +"A good convention to use when naming loggers is to use a module-level " +"logger, in each module which uses logging, named as follows::" msgstr "" +"یک قرارداد خوب هنگام نام‌گذاری گزارش‌گیرها این است که در هر ماژولی که از گزارش‌گیری " +"(logging) استفاده می‌کند، از یک گزارش‌گیر سطح ماژول با نام زیر استفاده کنید::" msgid "logger = logging.getLogger(__name__)" -msgstr "" +msgstr "logger = logging.getLogger(__name__)" -msgid "This means that logger names track the package/module hierarchy, and it's intuitively obvious where events are logged just from the logger name." +msgid "" +"This means that logger names track the package/module hierarchy, and it's " +"intuitively obvious where events are logged just from the logger name." msgstr "" +"این بدان معناست که نام‌های گزارش‌گیر (logger) سلسله‌مراتب بسته/ماژول را پیگیری " +"می‌کنند، و تنها از روی نام گزارش‌گیر به‌طور شهودی آشکار است که رویدادها کجا ثبت " +"می‌شوند." -msgid "The root of the hierarchy of loggers is called the root logger. That's the logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and :func:`critical`, which just call the same-named method of the root logger. The functions and the methods have the same signatures. The root logger's name is printed as 'root' in the logged output." -msgstr "" +msgid "" +"The root of the hierarchy of loggers is called the root logger. That's the " +"logger used by the " +"functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` " +"and :func:`critical`, which just call the same-named method of the root " +"logger. The functions and the methods have the same signatures. The root " +"logger's name is printed as 'root' in the logged output." +msgstr "" +"ریشه‌ی سلسله‌مراتب گزارش‌گیرها، گزارش‌گیر ریشه نامیده می‌شود. این همان گزارش‌گیری است که " +"توابع :func:`debug`، :func:`info`، :func:`warning`، :func:`error` " +"و :func:`critical` از آن استفاده می‌کنند و صرفاً متد هم‌نام گزارش‌گیر ریشه را " +"فراخوانی می‌کنند. این توابع و متدها امضاهای یکسانی دارند. نام گزارش‌گیر ریشه در " +"خروجی گزارش‌شده به‌صورت 'root' چاپ می‌شود." -msgid "It is, of course, possible to log messages to different destinations. Support is included in the package for writing log messages to files, HTTP GET/POST locations, email via SMTP, generic sockets, queues, or OS-specific logging mechanisms such as syslog or the Windows NT event log. Destinations are served by :dfn:`handler` classes. You can create your own log destination class if you have special requirements not met by any of the built-in handler classes." -msgstr "" +msgid "" +"It is, of course, possible to log messages to different destinations. " +"Support is included in the package for writing log messages to files, HTTP " +"GET/POST locations, email via SMTP, generic sockets, queues, or OS-specific " +"logging mechanisms such as syslog or the Windows NT event log. Destinations " +"are served by :dfn:`handler` classes. You can create your own log " +"destination class if you have special requirements not met by any of the " +"built-in handler classes." +msgstr "" +"البته، امکان ثبت پیام‌های گزارش در مقصدهای مختلف وجود دارد. پشتیبانی برای نوشتن " +"پیام‌های گزارش در فایل‌ها، مکان‌های HTTP GET/POST، ایمیل از طریق SMTP، سوکت‌های " +"عام، صف‌ها، یا سازوکارهای گزارش مختص سیستم‌عامل مانند syslog یا گزارش رویداد " +"ویندوز NT در این بسته گنجانده شده است. مقصدها توسط کلاس‌های :dfn:`handler` " +"سرویس‌دهی می‌شوند. اگر نیازهای خاصی دارید که توسط هیچ‌یک از کلاس‌های handler " +"توکار برآورده نمی‌شوند، می‌توانید کلاس مقصد گزارش خود را بسازید." -msgid "By default, no destination is set for any logging messages. You can specify a destination (such as console or file) by using :func:`basicConfig` as in the tutorial examples. If you call the functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and :func:`critical`, they will check to see if no destination is set; and if one is not set, they will set a destination of the console (``sys.stderr``) and a default format for the displayed message before delegating to the root logger to do the actual message output." -msgstr "" +msgid "" +"By default, no destination is set for any logging messages. You can specify " +"a destination (such as console or file) by using :func:`basicConfig` as in " +"the tutorial examples. If you call the " +"functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` " +"and :func:`critical`, they will check to see if no destination is set; and " +"if one is not set, they will set a destination of the console " +"(``sys.stderr``) and a default format for the displayed message before " +"delegating to the root logger to do the actual message output." +msgstr "" +"به‌طور پیش‌فرض، هیچ مقصدی برای پیام‌های گزارش تنظیم نشده است. می‌توانید با استفاده " +"از :func:`basicConfig` همان‌طور که در مثال‌های آموزش آمده است، یک مقصد (مانند " +"کنسول یا فایل) را مشخص کنید. اگر " +"توابع :func:`debug`، :func:`info`، :func:`warning`، :func:`error` " +"و :func:`critical` را فراخوانی کنید، آن‌ها بررسی می‌کنند که آیا هیچ مقصدی " +"تنظیم نشده است؛ و اگر مقصدی تنظیم نشده باشد، پیش از واگذاری خروجی واقعی پیام " +"به گزارش‌گیر ریشه، یک مقصد از نوع کنسول (``sys.stderr``) و یک قالب پیش‌فرض برای " +"پیام نمایش‌داده‌شده تنظیم می‌کنند." msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "" +"قالب پیش‌فرضی که :func:`basicConfig` برای پیام‌ها تنظیم می‌کند، عبارت است از:" msgid "severity:logger name:message" -msgstr "" +msgstr "severity:logger name:message" -msgid "You can change this by passing a format string to :func:`basicConfig` with the *format* keyword argument. For all options regarding how a format string is constructed, see :ref:`formatter-objects`." +msgid "" +"You can change this by passing a format string to :func:`basicConfig` with " +"the *format* keyword argument. For all options regarding how a format string " +"is constructed, see :ref:`formatter-objects`." msgstr "" +"شما می‌توانید این را با فرستادن یک رشته‌ی قالب به :func:`basicConfig` از طریق " +"آرگومان کلیدواژه‌ای *format* تغییر دهید. برای همه‌ی گزینه‌های مربوط به نحوه‌ی ساخت " +"یک رشته‌ی قالب، :ref:`formatter-objects` را ببینید." msgid "Logging Flow" -msgstr "" +msgstr "جریان گزارش‌گیری" -msgid "The flow of log event information in loggers and handlers is illustrated in the following diagram." +msgid "" +"The flow of log event information in loggers and handlers is illustrated in " +"the following diagram." msgstr "" +"جریان اطلاعات رویداد گزارش در گزارش‌گیرها و هندلرها در نمودار زیر نشان داده شده است." msgid "Loggers" -msgstr "" +msgstr "گزارش‌گیرها" -msgid ":class:`Logger` objects have a threefold job. First, they expose several methods to application code so that applications can log messages at runtime. Second, logger objects determine which log messages to act upon based upon severity (the default filtering facility) or filter objects. Third, logger objects pass along relevant log messages to all interested log handlers." -msgstr "" +msgid "" +":class:`Logger` objects have a threefold job. First, they expose several " +"methods to application code so that applications can log messages at " +"runtime. Second, logger objects determine which log messages to act upon " +"based upon severity (the default filtering facility) or filter objects. " +"Third, logger objects pass along relevant log messages to all interested log " +"handlers." +msgstr "" +"اشیای :class:`Logger` وظیفه‌ای سه‌گانه دارند. نخست، آن‌ها چندین متد را در " +"اختیار کد برنامه قرار می‌دهند تا برنامه‌ها بتوانند پیام‌های گزارش را در ران‌تایم " +"ثبت کنند. دوم، اشیای گزارش‌گیر بر اساس شدت (سازوکار فیلتر پیش‌فرض) یا اشیای فیلتر، " +"تعیین می‌کنند که کدام پیام‌های گزارش پردازش شوند. سوم، اشیای گزارش‌گیر پیام‌های گزارش " +"مرتبط را به تمام هندلرهای گزارش علاقه‌مند منتقل می‌کنند." -msgid "The most widely used methods on logger objects fall into two categories: configuration and message sending." +msgid "" +"The most widely used methods on logger objects fall into two categories: " +"configuration and message sending." msgstr "" +"پرکاربردترین متدهای اشیای گزارش‌گیر به دو دسته تقسیم می‌شوند: پیکربندی و ارسال " +"پیام." msgid "These are the most common configuration methods:" -msgstr "" +msgstr "این‌ها رایج‌ترین متدهای پیکربندی هستند:" -msgid ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger will handle, where debug is the lowest built-in severity level and critical is the highest built-in severity. For example, if the severity level is INFO, the logger will handle only INFO, WARNING, ERROR, and CRITICAL messages and will ignore DEBUG messages." +msgid "" +":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " +"will handle, where debug is the lowest built-in severity level and critical " +"is the highest built-in severity. For example, if the severity level is " +"INFO, the logger will handle only INFO, WARNING, ERROR, and CRITICAL " +"messages and will ignore DEBUG messages." msgstr "" +":meth:`Logger.setLevel` پایین‌ترین سطح شدت پیام گزارشی را مشخص می‌کند که یک گزارش‌گیر " +"رسیدگی خواهد کرد، که در آن debug پایین‌ترین سطح شدت توکار و critical بالاترین " +"شدت توکار است. برای مثال، اگر سطح شدت INFO باشد، گزارش‌گیر فقط پیام‌های INFO، " +"WARNING، ERROR و CRITICAL را رسیدگی می‌کند و پیام‌های DEBUG را نادیده می‌گیرد." -msgid ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove handler objects from the logger object. Handlers are covered in more detail in :ref:`handler-basic`." +msgid "" +":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " +"handler objects from the logger object. Handlers are covered in more detail " +"in :ref:`handler-basic`." msgstr "" +":meth:`Logger.addHandler` و :meth:`Logger.removeHandler` اشیای handler را به " +"شیء logger اضافه و از آن حذف می‌کنند. handlerها با جزئیات بیشتر " +"در :ref:`handler-basic` پوشش داده شده‌اند." -msgid ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove filter objects from the logger object. Filters are covered in more detail in :ref:`filter`." +msgid "" +":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " +"filter objects from the logger object. Filters are covered in more detail " +"in :ref:`filter`." msgstr "" +":meth:`Logger.addFilter` و :meth:`Logger.removeFilter` اشیای فیلتر را به شیء " +"گزارش‌گیر اضافه و از آن حذف می‌کنند. فیلترها با جزئیات بیشتر در :ref:`filter` " +"بررسی شده‌اند." -msgid "You don't need to always call these methods on every logger you create. See the last two paragraphs in this section." +msgid "" +"You don't need to always call these methods on every logger you create. See " +"the last two paragraphs in this section." msgstr "" +"نیازی نیست همیشه این متدها را روی هر گزارش‌گیر (logger) که ایجاد می‌کنید فراخوانی " +"کنید. دو پاراگراف آخر این بخش را ببینید." -msgid "With the logger object configured, the following methods create log messages:" -msgstr "" +msgid "" +"With the logger object configured, the following methods create log messages:" +msgstr "با پیکربندی شیء logger، متدهای زیر پیام‌های گزارش ایجاد می‌کنند:" -msgid ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:`Logger.error`, and :meth:`Logger.critical` all create log records with a message and a level that corresponds to their respective method names. The message is actually a format string, which may contain the standard string substitution syntax of ``%s``, ``%d``, ``%f``, and so on. The rest of their arguments is a list of objects that correspond with the substitution fields in the message. With regard to ``**kwargs``, the logging methods care only about a keyword of ``exc_info`` and use it to determine whether to log exception information." -msgstr "" +msgid "" +":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:`Logger.error`, " +"and :meth:`Logger.critical` all create log records with a message and a " +"level that corresponds to their respective method names. The message is " +"actually a format string, which may contain the standard string substitution " +"syntax of ``%s``, ``%d``, ``%f``, and so on. The rest of their arguments is " +"a list of objects that correspond with the substitution fields in the " +"message. With regard to ``**kwargs``, the logging methods care only about a " +"keyword of ``exc_info`` and use it to determine whether to log exception " +"information." +msgstr "" +":meth:`Logger.debug`، :meth:`Logger.info`، :meth:`Logger.warning`، :meth:`Logger.error` " +"و :meth:`Logger.critical` همگی رکوردهای گزارش را ایجاد می‌کنند که دارای یک پیام " +"و یک سطح هستند و سطح آن‌ها با نام متدهای مربوطه مطابقت دارد. پیام در واقع یک " +"رشته‌ی قالب است که ممکن است حاوی سینتکس استاندارد جایگذاری رشته مانند ``%s``، " +"``%d``، ``%f`` و غیره باشد. سایر آرگومان‌های آن‌ها فهرستی از شیء‌ها است که با " +"فیلدهای جایگذاری در پیام مطابقت دارند. در مورد ``**kwargs``، متدهای گزارش تنها " +"به کلیدواژه‌ای با نام ``exc_info`` توجه می‌کنند و از آن برای تعیین اینکه آیا " +"اطلاعات استثنا در گزارش ثبت شود یا خیر استفاده می‌کنند." -msgid ":meth:`Logger.exception` creates a log message similar to :meth:`Logger.error`. The difference is that :meth:`Logger.exception` dumps a stack trace along with it. Call this method only from an exception handler." +msgid "" +":meth:`Logger.exception` creates a log message similar " +"to :meth:`Logger.error`. The difference is that :meth:`Logger.exception` " +"dumps a stack trace along with it. Call this method only from an exception " +"handler." msgstr "" +":meth:`Logger.exception` یک پیام گزارش مشابه :meth:`Logger.error` ایجاد " +"می‌کند. تفاوت این است که :meth:`Logger.exception` یک ردگیری پشته را نیز همراه " +"آن خروجی می‌دهد. این متد را فقط از داخل یک هندلر استثنا فراخوانی کنید." -msgid ":meth:`Logger.log` takes a log level as an explicit argument. This is a little more verbose for logging messages than using the log level convenience methods listed above, but this is how to log at custom log levels." +msgid "" +":meth:`Logger.log` takes a log level as an explicit argument. This is a " +"little more verbose for logging messages than using the log level " +"convenience methods listed above, but this is how to log at custom log " +"levels." msgstr "" +":meth:`Logger.log` یک سطح گزارش را به‌عنوان آرگومان صریح دریافت می‌کند. این روش " +"برای گزارش کردن پیام‌ها کمی طولانی‌تر از استفاده از متدهای سهولت‌بخش سطح گزارش " +"فهرست‌شده در بالا است، اما روش گزارش کردن در سطح‌های گزارش سفارشی همین است." -msgid ":func:`getLogger` returns a reference to a logger instance with the specified name if it is provided, or ``root`` if not. The names are period-separated hierarchical structures. Multiple calls to :func:`getLogger` with the same name will return a reference to the same logger object. Loggers that are further down in the hierarchical list are children of loggers higher up in the list. For example, given a logger with a name of ``foo``, loggers with names of ``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all descendants of ``foo``." -msgstr "" +msgid "" +":func:`getLogger` returns a reference to a logger instance with the " +"specified name if it is provided, or ``root`` if not. The names are period-" +"separated hierarchical structures. Multiple calls to :func:`getLogger` with " +"the same name will return a reference to the same logger object. Loggers " +"that are further down in the hierarchical list are children of loggers " +"higher up in the list. For example, given a logger with a name of ``foo``, " +"loggers with names of ``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all " +"descendants of ``foo``." +msgstr "" +":func:`getLogger` در صورت ارائه شدن نام مشخص‌شده، ارجاعی به یک نمونه گزارش‌گیر با " +"آن نام را برمی‌گرداند، و در غیر این صورت ``root`` را برمی‌گرداند. نام‌ها " +"ساختارهای سلسله‌مراتبی هستند که با نقطه از هم جدا شده‌اند. فراخوانی‌های " +"متعدد :func:`getLogger` با نام یکسان، ارجاعی به همان شیء گزارش‌گیر را برمی‌گرداند. " +"گزارش‌گیرهای پایین‌تر در فهرست سلسله‌مراتبی، فرزندان گزارش‌گیرهای بالاتر در فهرست هستند. " +"برای مثال، با فرض یک گزارش‌گیر با نام ``foo``، گزارش‌گیرهای دارای نام‌های ``foo.bar``، " +"``foo.bar.baz`` و ``foo.bam`` همگی از نوادگان ``foo`` هستند." -msgid "Loggers have a concept of *effective level*. If a level is not explicitly set on a logger, the level of its parent is used instead as its effective level. If the parent has no explicit level set, *its* parent is examined, and so on - all ancestors are searched until an explicitly set level is found. The root logger always has an explicit level set (``WARNING`` by default). When deciding whether to process an event, the effective level of the logger is used to determine whether the event is passed to the logger's handlers." -msgstr "" +msgid "" +"Loggers have a concept of *effective level*. If a level is not explicitly " +"set on a logger, the level of its parent is used instead as its effective " +"level. If the parent has no explicit level set, *its* parent is examined, " +"and so on - all ancestors are searched until an explicitly set level is " +"found. The root logger always has an explicit level set (``WARNING`` by " +"default). When deciding whether to process an event, the effective level of " +"the logger is used to determine whether the event is passed to the logger's " +"handlers." +msgstr "" +"گزارش‌گیرها مفهومی به نام *سطح مؤثر* دارند. اگر سطحی به‌صراحت روی یک گزارش‌گیر تنظیم " +"نشده باشد، در عوض سطح والد آن به‌عنوان سطح مؤثر آن استفاده می‌شود. اگر والد " +"سطح صریحی تنظیم‌شده نداشته باشد، والد *آن* بررسی می‌شود، و به همین ترتیب — " +"تمام نیاکان جستجو می‌شوند تا سطحی که به‌صراحت تنظیم شده باشد پیدا شود. گزارش‌گیر " +"ریشه همیشه سطح صریحی تنظیم‌شده دارد (به‌طور پیش‌فرض ``WARNING``). هنگام " +"تصمیم‌گیری برای پردازش یک رویداد، از سطح مؤثر گزارش‌گیر برای تعیین اینکه آیا " +"رویداد به هندلرهای گزارش‌گیر ارسال می‌شود یا خیر استفاده می‌شود." -msgid "Child loggers propagate messages up to the handlers associated with their ancestor loggers. Because of this, it is unnecessary to define and configure handlers for all the loggers an application uses. It is sufficient to configure handlers for a top-level logger and create child loggers as needed. (You can, however, turn off propagation by setting the *propagate* attribute of a logger to ``False``.)" -msgstr "" +msgid "" +"Child loggers propagate messages up to the handlers associated with their " +"ancestor loggers. Because of this, it is unnecessary to define and configure " +"handlers for all the loggers an application uses. It is sufficient to " +"configure handlers for a top-level logger and create child loggers as " +"needed. (You can, however, turn off propagation by setting the *propagate* " +"attribute of a logger to ``False``.)" +msgstr "" +"گزارش‌گیرهای فرزند پیام‌ها را به هندلرهای مرتبط با گزارش‌گیرهای اجدادی خود منتشر " +"می‌کنند. به همین دلیل، نیازی به تعریف و پیکربندی هندلرها برای تمام گزارش‌گیرهایی " +"که یک برنامه از آن‌ها استفاده می‌کند، نیست. کافی است هندلرها را برای یک گزارش‌گیر " +"سطح بالا پیکربندی کنید و گزارش‌گیرهای فرزند را در صورت نیاز ایجاد کنید. (با این " +"حال، می‌توانید با تنظیم ویژگی *propagate* یک گزارش‌گیر روی ``False``، انتشار را " +"غیرفعال کنید.)" msgid "Handlers" -msgstr "" +msgstr "هندلرها (Handlers)" -msgid ":class:`~logging.Handler` objects are responsible for dispatching the appropriate log messages (based on the log messages' severity) to the handler's specified destination. :class:`Logger` objects can add zero or more handler objects to themselves with an :meth:`~Logger.addHandler` method. As an example scenario, an application may want to send all log messages to a log file, all log messages of error or higher to stdout, and all messages of critical to an email address. This scenario requires three individual handlers where each handler is responsible for sending messages of a specific severity to a specific location." -msgstr "" +msgid "" +":class:`~logging.Handler` objects are responsible for dispatching the " +"appropriate log messages (based on the log messages' severity) to the " +"handler's specified destination. :class:`Logger` objects can add zero or " +"more handler objects to themselves with an :meth:`~Logger.addHandler` " +"method. As an example scenario, an application may want to send all log " +"messages to a log file, all log messages of error or higher to stdout, and " +"all messages of critical to an email address. This scenario requires three " +"individual handlers where each handler is responsible for sending messages " +"of a specific severity to a specific location." +msgstr "" +"اشیاء :class:`~logging.Handler` مسئول ارسال پیام‌های گزارش مناسب (بر اساس شدت " +"پیام‌های گزارش) به مقصد مشخص‌شده‌ی handler هستند. اشیاء :class:`Logger` می‌توانند " +"با متد :meth:`~Logger.addHandler` صفر یا چند شیء handler را به خود اضافه " +"کنند. به‌عنوان یک سناریوی نمونه، یک برنامه ممکن است بخواهد تمام پیام‌های گزارش " +"را به یک فایل گزارش، تمام پیام‌های گزارش با سطح خطا یا بالاتر را به stdout و " +"تمام پیام‌های سطح بحرانی را به یک نشانی ایمیل ارسال کند. این سناریو به سه " +"handler جداگانه نیاز دارد که هر handler مسئول ارسال پیام‌هایی با شدتی مشخص به " +"مکانی مشخص است." -msgid "The standard library includes quite a few handler types (see :ref:`useful-handlers`); the tutorials use mainly :class:`StreamHandler` and :class:`FileHandler` in its examples." +msgid "" +"The standard library includes quite a few handler types (see :ref:`useful-" +"handlers`); the tutorials use mainly :class:`StreamHandler` " +"and :class:`FileHandler` in its examples." msgstr "" +"کتابخانه استاندارد شامل تعداد نسبتاً زیادی از انواع هندلر (handler) است " +"(به :ref:`useful-handlers` مراجعه کنید)؛ آموزش‌ها در مثال‌های خود عمدتاً " +"از :class:`StreamHandler` و :class:`FileHandler` استفاده می‌کنند." -msgid "There are very few methods in a handler for application developers to concern themselves with. The only handler methods that seem relevant for application developers who are using the built-in handler objects (that is, not creating custom handlers) are the following configuration methods:" +msgid "" +"There are very few methods in a handler for application developers to " +"concern themselves with. The only handler methods that seem relevant for " +"application developers who are using the built-in handler objects (that is, " +"not creating custom handlers) are the following configuration methods:" msgstr "" +"در یک هندلر، متدهای بسیار کمی وجود دارد که توسعه‌دهندگان برنامه باید به آن‌ها " +"بپردازند. تنها متدهای هندلر که به نظر می‌رسد برای توسعه‌دهندگان برنامه‌ای که از " +"اشیای هندلر توکار استفاده می‌کنند (یعنی هندلرهای سفارشی ایجاد نمی‌کنند) مرتبط " +"باشند، متدهای پیکربندی زیر هستند:" -msgid "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies the lowest severity that will be dispatched to the appropriate destination. Why are there two :meth:`~Handler.setLevel` methods? The level set in the logger determines which severity of messages it will pass to its handlers. The level set in each handler determines which messages that handler will send on." -msgstr "" +msgid "" +"The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " +"the lowest severity that will be dispatched to the appropriate destination. " +"Why are there two :meth:`~Handler.setLevel` methods? The level set in the " +"logger determines which severity of messages it will pass to its handlers. " +"The level set in each handler determines which messages that handler will " +"send on." +msgstr "" +"متد :meth:`~Handler.setLevel`، همان‌طور که در اشیای logger نیز چنین است، " +"کمترین سطح شدتی را که به مقصد مناسب ارسال خواهد شد مشخص می‌کند. چرا دو " +"متد :meth:`~Handler.setLevel` وجود دارد؟ سطح تنظیم‌شده در logger تعیین می‌کند " +"که پیام‌ها با چه شدتی به handlerهای آن منتقل شوند. سطح تنظیم‌شده در هر handler " +"تعیین می‌کند که آن handler کدام پیام‌ها را ارسال کند." -msgid ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to use." +msgid "" +":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " +"use." msgstr "" +":meth:`~Handler.setFormatter` یک شیء Formatter را برای این هندلر " +"(handler) انتخاب می‌کند تا از آن استفاده کند." -msgid ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively configure and deconfigure filter objects on handlers." +msgid "" +":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " +"configure and deconfigure filter objects on handlers." msgstr "" +":meth:`~Handler.addFilter` و :meth:`~Handler.removeFilter` به‌ترتیب اشیای " +"فیلتر را بر روی Handlerها پیکربندی و از پیکربندی خارج می‌کنند." -msgid "Application code should not directly instantiate and use instances of :class:`Handler`. Instead, the :class:`Handler` class is a base class that defines the interface that all handlers should have and establishes some default behavior that child classes can use (or override)." +msgid "" +"Application code should not directly instantiate and use instances " +"of :class:`Handler`. Instead, the :class:`Handler` class is a base class " +"that defines the interface that all handlers should have and establishes " +"some default behavior that child classes can use (or override)." msgstr "" +"کد برنامه نباید مستقیماً از :class:`Handler` نمونه‌سازی کند و از نمونه‌های آن " +"استفاده کند. در عوض، کلاس :class:`Handler` یک کلاس پایه است که رابطی را " +"تعریف می‌کند که همه‌ی handlerها باید داشته باشند و برخی رفتارهای پیش‌فرض را " +"تعیین می‌کند که کلاس‌های فرزند می‌توانند از آن‌ها استفاده کنند (یا آن‌ها را " +"بازنویسی کنند)." msgid "Formatters" -msgstr "" +msgstr "قالب‌بندها" -msgid "Formatter objects configure the final order, structure, and contents of the log message. Unlike the base :class:`logging.Handler` class, application code may instantiate formatter classes, although you could likely subclass the formatter if your application needs special behavior. The constructor takes three optional arguments -- a message format string, a date format string and a style indicator." -msgstr "" +msgid "" +"Formatter objects configure the final order, structure, and contents of the " +"log message. Unlike the base :class:`logging.Handler` class, application " +"code may instantiate formatter classes, although you could likely subclass " +"the formatter if your application needs special behavior. The constructor " +"takes three optional arguments -- a message format string, a date format " +"string and a style indicator." +msgstr "" +"اشیاء قالب‌بند (Formatter) ترتیب نهایی، ساختار و محتوای پیام گزارش را پیکربندی " +"می‌کنند. برخلاف کلاس پایه‌ی :class:`logging.Handler`، کد برنامه می‌تواند کلاس‌های " +"قالب‌بند را نمونه‌سازی کند، هرچند اگر برنامه شما به رفتار خاصی نیاز داشته " +"باشد، به احتمال زیاد می‌توانید یک زیرکلاس از قالب‌بند ایجاد کنید. سازنده سه " +"آرگومان اختیاری دریافت می‌کند -- یک رشته‌ی قالب پیام، یک رشته‌ی قالب تاریخ و یک " +"نشانگر سبک." -msgid "If there is no message format string, the default is to use the raw message. If there is no date format string, the default date format is:" +msgid "" +"If there is no message format string, the default is to use the raw " +"message. If there is no date format string, the default date format is:" msgstr "" +"اگر رشته‌ی قالب پیام وجود نداشته باشد، به‌طور پیش‌فرض از پیام خام استفاده می‌شود. " +"اگر رشته‌ی قالب تاریخ وجود نداشته باشد، قالب تاریخ پیش‌فرض عبارت است از:" msgid "%Y-%m-%d %H:%M:%S" -msgstr "" +msgstr "%Y-%m-%d %H:%M:%S" -msgid "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, ``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be used." +msgid "" +"with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " +"``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " +"used." msgstr "" +"با میلی‌ثانیه‌هایی که در انتها اضافه شده‌اند. ``style`` یکی از ``'%'``، ``'{'`` " +"یا ``'$'`` است. اگر یکی از این موارد تعیین نشده باشد، از ``'%'`` استفاده " +"خواهد شد." -msgid "If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :ref:`logrecord-attributes`. If the style is ``'{'``, the message format string is assumed to be compatible with :meth:`str.format` (using keyword arguments), while if the style is ``'$'`` then the message format string should conform to what is expected by :meth:`string.Template.substitute`." -msgstr "" +msgid "" +"If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented " +"in :ref:`logrecord-attributes`. If the style is ``'{'``, the message format " +"string is assumed to be compatible with :meth:`str.format` (using keyword " +"arguments), while if the style is ``'$'`` then the message format string " +"should conform to what is expected by :meth:`string.Template.substitute`." +msgstr "" +"اگر ``style`` برابر ``'%'`` باشد، رشته قالب پیام از جایگزینی رشته به‌سبک ``%" +"()s`` استفاده می‌کند؛ کلیدهای ممکن در :ref:`logrecord-" +"attributes` مستند شده‌اند. اگر سبک برابر ``'{'`` باشد، فرض می‌شود رشته قالب " +"پیام با :meth:`str.format` (با استفاده از آرگومان‌های کلیدواژه‌ای) سازگار " +"باشد، در حالی که اگر سبک برابر ``'$'`` باشد، رشته قالب پیام باید با " +"آنچه :meth:`string.Template.substitute` انتظار دارد مطابقت داشته باشد." msgid "Added the ``style`` parameter." -msgstr "" +msgstr "پارامتر ``style`` اضافه شد." -msgid "The following message format string will log the time in a human-readable format, the severity of the message, and the contents of the message, in that order::" +msgid "" +"The following message format string will log the time in a human-readable " +"format, the severity of the message, and the contents of the message, in " +"that order::" msgstr "" +"رشته‌ی قالب پیام زیر، زمان را در قالبی خوانا برای انسان، شدت پیام و محتوای " +"پیام را به همین ترتیب ثبت می‌کند::" msgid "'%(asctime)s - %(levelname)s - %(message)s'" -msgstr "" +msgstr "'%(asctime)s - %(levelname)s - %(message)s'" -msgid "Formatters use a user-configurable function to convert the creation time of a record to a tuple. By default, :func:`time.localtime` is used; to change this for a particular formatter instance, set the ``converter`` attribute of the instance to a function with the same signature as :func:`time.localtime` or :func:`time.gmtime`. To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ``converter`` attribute in the Formatter class (to ``time.gmtime`` for GMT display)." -msgstr "" +msgid "" +"Formatters use a user-configurable function to convert the creation time of " +"a record to a tuple. By default, :func:`time.localtime` is used; to change " +"this for a particular formatter instance, set the ``converter`` attribute of " +"the instance to a function with the same signature as :func:`time.localtime` " +"or :func:`time.gmtime`. To change it for all formatters, for example if you " +"want all logging times to be shown in GMT, set the ``converter`` attribute " +"in the Formatter class (to ``time.gmtime`` for GMT display)." +msgstr "" +"قالب‌بندکننده‌ها از یک تابع قابل‌پیکربندی توسط کاربر برای تبدیل زمان ایجاد یک " +"رکورد به یک تاپل استفاده می‌کنند. به‌طور پیش‌فرض، از :func:`time.localtime` " +"استفاده می‌شود؛ برای تغییر این موضوع برای یک نمونه‌ی خاص از قالب‌بندکننده، ویژگی " +"``converter`` آن نمونه را روی تابعی با همان امضای :func:`time.localtime` " +"یا :func:`time.gmtime` تنظیم کنید. برای تغییر آن برای همه‌ی قالب‌بندکننده‌ها، " +"برای مثال اگر می‌خواهید همه‌ی زمان‌های گزارش‌گیری به‌صورت GMT نمایش داده شوند، " +"ویژگی ``converter`` را در کلاس Formatter تنظیم کنید (برای نمایش GMT، روی " +"``time.gmtime``)." msgid "Configuring Logging" -msgstr "" +msgstr "پیکربندی گزارش‌گیری (logging)" msgid "Programmers can configure logging in three ways:" -msgstr "" +msgstr "برنامه‌نویسان می‌توانند گزارش‌گیری (logging) را به سه روش پیکربندی کنند:" -msgid "Creating loggers, handlers, and formatters explicitly using Python code that calls the configuration methods listed above." +msgid "" +"Creating loggers, handlers, and formatters explicitly using Python code that " +"calls the configuration methods listed above." msgstr "" +"ایجاد ثبت‌کننده‌ها، هندلرها و قالب‌بندها " +"به‌صورت صریح با استفاده از کد پایتونی که متدهای پیکربندی فهرست‌شده در بالا را " +"فراخوانی می‌کند." -msgid "Creating a logging config file and reading it using the :func:`fileConfig` function." +msgid "" +"Creating a logging config file and reading it using the :func:`fileConfig` " +"function." msgstr "" +"ایجاد یک پرونده‌ی پیکربندی گزارش‌گیری و خواندن آن با استفاده از " +"تابع :func:`fileConfig`." -msgid "Creating a dictionary of configuration information and passing it to the :func:`dictConfig` function." +msgid "" +"Creating a dictionary of configuration information and passing it to " +"the :func:`dictConfig` function." msgstr "" +"ایجاد یک دیکشنری از اطلاعات پیکربندی و ارسال آن به تابع :func:`dictConfig`." -msgid "For the reference documentation on the last two options, see :ref:`logging-config-api`. The following example configures a very simple logger, a console handler, and a simple formatter using Python code::" +msgid "" +"For the reference documentation on the last two options, see :ref:`logging-" +"config-api`. The following example configures a very simple logger, a " +"console handler, and a simple formatter using Python code::" msgstr "" +"برای مستندات مرجع در مورد دو گزینه‌ی آخر، به :ref:`logging-config-api` مراجعه " +"کنید. مثال زیر با استفاده از کد پایتون، یک گزارش‌گیر (logger) بسیار ساده، یک " +"هندلر کنسول (console handler) و یک قالب‌بند (formatter) ساده را پیکربندی " +"می‌کند::" msgid "" "import logging\n" @@ -505,7 +1131,8 @@ msgid "" "ch.setLevel(logging.DEBUG)\n" "\n" "# create formatter\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %" +"(message)s')\n" "\n" "# add formatter to ch\n" "ch.setFormatter(formatter)\n" @@ -520,9 +1147,36 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"\n" +"# create console handler and set level to debug\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.DEBUG)\n" +"\n" +"# create formatter\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %" +"(message)s')\n" +"\n" +"# add formatter to ch\n" +"ch.setFormatter(formatter)\n" +"\n" +"# add ch to logger\n" +"logger.addHandler(ch)\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" -msgid "Running this module from the command line produces the following output:" -msgstr "" +msgid "" +"Running this module from the command line produces the following output:" +msgstr "اجرای این ماژول از خط فرمان، خروجی زیر را تولید می‌کند:" msgid "" "$ python simple_logging_module.py\n" @@ -532,9 +1186,21 @@ msgid "" "2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" "2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" msgstr "" +"$ python simple_logging_module.py\n" +"2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" +"2005-03-19 15:10:26,620 - simple_example - INFO - info message\n" +"2005-03-19 15:10:26,695 - simple_example - WARNING - warn message\n" +"2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" +"2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" -msgid "The following Python module creates a logger, handler, and formatter nearly identical to those in the example listed above, with the only difference being the names of the objects::" +msgid "" +"The following Python module creates a logger, handler, and formatter nearly " +"identical to those in the example listed above, with the only difference " +"being the names of the objects::" msgstr "" +"ماژول پایتون زیر یک گزارش‌گیر (logger)، هندلر (handler) و قالب‌بند (formatter) " +"تقریباً یکسان با موارد موجود در مثال ذکرشده در بالا ایجاد می‌کند، با این تفاوت " +"که تنها نام اشیاء متفاوت است::" msgid "" "import logging\n" @@ -552,9 +1218,23 @@ msgid "" "logger.error('error message')\n" "logger.critical('critical message')" msgstr "" +"import logging\n" +"import logging.config\n" +"\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" msgid "Here is the logging.conf file:" -msgstr "" +msgstr "در اینجا فایل logging.conf آمده است:" msgid "" "[loggers]\n" @@ -585,9 +1265,37 @@ msgid "" "[formatter_simpleFormatter]\n" "format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" msgstr "" +"[loggers]\n" +"keys=root,simpleExample\n" +"\n" +"[handlers]\n" +"keys=consoleHandler\n" +"\n" +"[formatters]\n" +"keys=simpleFormatter\n" +"\n" +"[logger_root]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"\n" +"[logger_simpleExample]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"qualname=simpleExample\n" +"propagate=0\n" +"\n" +"[handler_consoleHandler]\n" +"class=StreamHandler\n" +"level=DEBUG\n" +"formatter=simpleFormatter\n" +"args=(sys.stdout,)\n" +"\n" +"[formatter_simpleFormatter]\n" +"format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" -msgid "The output is nearly identical to that of the non-config-file-based example:" -msgstr "" +msgid "" +"The output is nearly identical to that of the non-config-file-based example:" +msgstr "خروجی تقریباً با خروجی مثال غیرمبتنی بر فایل پیکربندی یکسان است:" msgid "" "$ python simple_logging_config.py\n" @@ -597,24 +1305,101 @@ msgid "" "2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" "2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" msgstr "" +"$ python simple_logging_config.py\n" +"2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" +"2005-03-19 15:38:55,979 - simpleExample - INFO - info message\n" +"2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message\n" +"2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" +"2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" -msgid "You can see that the config file approach has a few advantages over the Python code approach, mainly separation of configuration and code and the ability of noncoders to easily modify the logging properties." +msgid "" +"You can see that the config file approach has a few advantages over the " +"Python code approach, mainly separation of configuration and code and the " +"ability of noncoders to easily modify the logging properties." msgstr "" +"می‌توانید ببینید که روش فایل پیکربندی چند مزیت نسبت به روش کد پایتون دارد، " +"عمدتاً جداسازی پیکربندی و کد و توانایی افراد غیربرنامه‌نویس برای تغییر آسان " +"ویژگی‌های گزارش‌گیری." -msgid "The :func:`fileConfig` function takes a default parameter, ``disable_existing_loggers``, which defaults to ``True`` for reasons of backward compatibility. This may or may not be what you want, since it will cause any non-root loggers existing before the :func:`fileConfig` call to be disabled unless they (or an ancestor) are explicitly named in the configuration. Please refer to the reference documentation for more information, and specify ``False`` for this parameter if you wish." -msgstr "" +msgid "" +"The :func:`fileConfig` function takes a default parameter, " +"``disable_existing_loggers``, which defaults to ``True`` for reasons of " +"backward compatibility. This may or may not be what you want, since it will " +"cause any non-root loggers existing before the :func:`fileConfig` call to be " +"disabled unless they (or an ancestor) are explicitly named in the " +"configuration. Please refer to the reference documentation for more " +"information, and specify ``False`` for this parameter if you wish." +msgstr "" +"تابع :func:`fileConfig` یک پارامتر پیش‌فرض به نام " +"``disable_existing_loggers`` دارد که به دلایل سازگاری با نسخه‌های قبلی، مقدار " +"پیش‌فرض آن ``True`` است. این ممکن است مطابق خواسته شما باشد یا نباشد، زیرا " +"باعث می‌شود هر گزارش‌گیر غیرریشه‌ای که پیش از فراخوانی :func:`fileConfig` وجود " +"دارد، غیرفعال شود؛ مگر آنکه آن گزارش‌گیر (یا والد آن) به‌صراحت در پیکربندی نام " +"برده شود. لطفاً برای اطلاعات بیشتر به مستندات مرجع مراجعه کنید و در صورت " +"تمایل، مقدار ``False`` را برای این پارامتر مشخص کنید." -msgid "The dictionary passed to :func:`dictConfig` can also specify a Boolean value with key ``disable_existing_loggers``, which if not specified explicitly in the dictionary also defaults to being interpreted as ``True``. This leads to the logger-disabling behaviour described above, which may not be what you want - in which case, provide the key explicitly with a value of ``False``." -msgstr "" +msgid "" +"The dictionary passed to :func:`dictConfig` can also specify a Boolean value " +"with key ``disable_existing_loggers``, which if not specified explicitly in " +"the dictionary also defaults to being interpreted as ``True``. This leads to " +"the logger-disabling behaviour described above, which may not be what you " +"want - in which case, provide the key explicitly with a value of ``False``." +msgstr "" +"دیکشنری داده‌شده به :func:`dictConfig` همچنین می‌تواند یک مقدار بولی با کلید " +"``disable_existing_loggers`` را مشخص کند، که اگر به‌طور صریح در دیکشنری مشخص " +"نشده باشد، به‌صورت پیش‌فرض نیز به‌عنوان ``True`` تفسیر می‌شود. این امر به رفتار " +"غیرفعال‌سازی گزارش‌گیرها که در بالا توضیح داده شد منجر می‌شود، که ممکن است آنچه شما " +"می‌خواهید نباشد؛ در این صورت، کلید را به‌طور صریح با مقدار ``False`` ارائه " +"دهید." -msgid "Note that the class names referenced in config files need to be either relative to the logging module, or absolute values which can be resolved using normal import mechanisms. Thus, you could use either :class:`~logging.handlers.WatchedFileHandler` (relative to the logging module) or ``mypackage.mymodule.MyHandler`` (for a class defined in package ``mypackage`` and module ``mymodule``, where ``mypackage`` is available on the Python import path)." -msgstr "" +msgid "" +"Note that the class names referenced in config files need to be either " +"relative to the logging module, or absolute values which can be resolved " +"using normal import mechanisms. Thus, you could use " +"either :class:`~logging.handlers.WatchedFileHandler` (relative to the " +"logging module) or ``mypackage.mymodule.MyHandler`` (for a class defined in " +"package ``mypackage`` and module ``mymodule``, where ``mypackage`` is " +"available on the Python import path)." +msgstr "" +"توجه داشته باشید که نام کلاس‌های ارجاع‌شده در فایل‌های پیکربندی باید یا نسبت به " +"ماژول logging نسبی باشند، یا مقادیر مطلقی باشند که بتوان آن‌ها را با استفاده " +"از سازوکارهای عادی ایمپورت حل کرد. بنابراین، می‌توانید " +"از :class:`~logging.handlers.WatchedFileHandler` (نسبت به ماژول logging) یا " +"``mypackage.mymodule.MyHandler`` (برای کلاسی که در بسته‌ی ``mypackage`` و " +"ماژول ``mymodule`` تعریف شده باشد و ``mypackage`` در مسیر ایمپورت پایتون در " +"دسترس باشد) استفاده کنید." -msgid "In Python 3.2, a new means of configuring logging has been introduced, using dictionaries to hold configuration information. This provides a superset of the functionality of the config-file-based approach outlined above, and is the recommended configuration method for new applications and deployments. Because a Python dictionary is used to hold configuration information, and since you can populate that dictionary using different means, you have more options for configuration. For example, you can use a configuration file in JSON format, or, if you have access to YAML processing functionality, a file in YAML format, to populate the configuration dictionary. Or, of course, you can construct the dictionary in Python code, receive it in pickled form over a socket, or use whatever approach makes sense for your application." -msgstr "" +msgid "" +"In Python 3.2, a new means of configuring logging has been introduced, using " +"dictionaries to hold configuration information. This provides a superset of " +"the functionality of the config-file-based approach outlined above, and is " +"the recommended configuration method for new applications and deployments. " +"Because a Python dictionary is used to hold configuration information, and " +"since you can populate that dictionary using different means, you have more " +"options for configuration. For example, you can use a configuration file in " +"JSON format, or, if you have access to YAML processing functionality, a file " +"in YAML format, to populate the configuration dictionary. Or, of course, you " +"can construct the dictionary in Python code, receive it in pickled form over " +"a socket, or use whatever approach makes sense for your application." +msgstr "" +"در پایتون 3.2، روش جدیدی برای پیکربندی گزارش‌گیری (logging) معرفی شده است که " +"در آن از دیکشنری‌ها برای نگه‌داری اطلاعات پیکربندی استفاده می‌شود. این روش، " +"ابرمجموعه‌ای از قابلیت‌های رویکرد مبتنی بر فایل پیکربندیِ ذکرشده در بالا را " +"فراهم می‌کند و روش پیکربندی توصیه‌شده برای برنامه‌ها و استقرارهای جدید است. از " +"آنجا که از یک دیکشنری پایتون برای نگه‌داری اطلاعات پیکربندی استفاده می‌شود، و " +"از آنجا که می‌توانید آن دیکشنری را با روش‌های مختلفی پر کنید، گزینه‌های بیشتری " +"برای پیکربندی دارید. برای مثال، می‌توانید از یک فایل پیکربندی در قالب JSON، " +"یا در صورت دسترسی به قابلیت پردازش YAML، از یک فایل در قالب YAML، برای پر " +"کردن دیکشنری پیکربندی استفاده کنید. یا البته، می‌توانید دیکشنری را در کد " +"پایتون بسازید، آن را به‌صورت pickled از طریق یک سوکت دریافت کنید، یا از هر " +"رویکردی که برای برنامه شما مناسب است استفاده کنید." -msgid "Here's an example of the same configuration as above, in YAML format for the new dictionary-based approach:" +msgid "" +"Here's an example of the same configuration as above, in YAML format for the " +"new dictionary-based approach:" msgstr "" +"در اینجا نمونه‌ای از همان پیکربندی بالا، در قالب YAML برای رویکرد جدید مبتنی " +"بر دیکشنری آمده است:" msgid "" "version: 1\n" @@ -636,278 +1421,724 @@ msgid "" " level: DEBUG\n" " handlers: [console]" msgstr "" +"version: 1\n" +"formatters:\n" +" simple:\n" +" format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n" +"handlers:\n" +" console:\n" +" class: logging.StreamHandler\n" +" level: DEBUG\n" +" formatter: simple\n" +" stream: ext://sys.stdout\n" +"loggers:\n" +" simpleExample:\n" +" level: DEBUG\n" +" handlers: [console]\n" +" propagate: no\n" +"root:\n" +" level: DEBUG\n" +" handlers: [console]" -msgid "For more information about logging using a dictionary, see :ref:`logging-config-api`." +msgid "" +"For more information about logging using a dictionary, see :ref:`logging-" +"config-api`." msgstr "" +"برای اطلاعات بیشتر درباره‌ی گزارش‌کردن (logging) با استفاده از یک " +"دیکشنری، :ref:`logging-config-api` را ببینید." msgid "What happens if no configuration is provided" -msgstr "" +msgstr "اگر هیچ پیکربندی ارائه نشود، چه اتفاقی می‌افتد" -msgid "If no logging configuration is provided, it is possible to have a situation where a logging event needs to be output, but no handlers can be found to output the event." +msgid "" +"If no logging configuration is provided, it is possible to have a situation " +"where a logging event needs to be output, but no handlers can be found to " +"output the event." msgstr "" +"اگر هیچ پیکربندی گزارش‌گیری (logging) ارائه نشده باشد، ممکن است موقعیتی پیش " +"بیاید که یک رویداد گزارش‌گیری نیاز به خروجی داشته باشد، اما هیچ هندلری (handler) " +"برای خروجی آن رویداد نتوان یافت." -msgid "The event is output using a 'handler of last resort', stored in :data:`lastResort`. This internal handler is not associated with any logger, and acts like a :class:`~logging.StreamHandler` which writes the event description message to the current value of ``sys.stderr`` (therefore respecting any redirections which may be in effect). No formatting is done on the message - just the bare event description message is printed. The handler's level is set to ``WARNING``, so all events at this and greater severities will be output." -msgstr "" +msgid "" +"The event is output using a 'handler of last resort', stored " +"in :data:`lastResort`. This internal handler is not associated with any " +"logger, and acts like a :class:`~logging.StreamHandler` which writes the " +"event description message to the current value of ``sys.stderr`` (therefore " +"respecting any redirections which may be in effect). No formatting is done " +"on the message - just the bare event description message is printed. The " +"handler's level is set to ``WARNING``, so all events at this and greater " +"severities will be output." +msgstr "" +"این رویداد با استفاده از یک «هندلر آخرین چاره» (handler of last resort) که " +"در :data:`lastResort` ذخیره شده است، خروجی داده می‌شود. این هندلر داخلی به " +"هیچ گزارش‌گیری (logger) مرتبط نیست و مانند یک :class:`~logging.StreamHandler` عمل " +"می‌کند که پیام شرح رویداد را در مقدار فعلی ``sys.stderr`` می‌نویسد (بنابراین " +"هرگونه تغییرمسیری را که ممکن است فعال باشد رعایت می‌کند). هیچ قالب‌بندی روی " +"پیام انجام نمی‌شود؛ فقط پیام شرح رویداد به‌صورت خام چاپ می‌شود. سطح این هندلر " +"روی ``WARNING`` تنظیم شده است، بنابراین همه رویدادها با این شدت و شدت‌های " +"بیشتر خروجی داده خواهند شد." msgid "For versions of Python prior to 3.2, the behaviour is as follows:" -msgstr "" +msgstr "در نسخه‌های پایتون پیش از 3.2، رفتار به شرح زیر است:" -msgid "If :data:`raiseExceptions` is ``False`` (production mode), the event is silently dropped." +msgid "" +"If :data:`raiseExceptions` is ``False`` (production mode), the event is " +"silently dropped." msgstr "" +"اگر :data:`raiseExceptions` برابر ``False`` باشد (حالت تولید)، رویداد به‌صورت " +"بی‌صدا حذف می‌شود." -msgid "If :data:`raiseExceptions` is ``True`` (development mode), a message 'No handlers could be found for logger X.Y.Z' is printed once." +msgid "" +"If :data:`raiseExceptions` is ``True`` (development mode), a message 'No " +"handlers could be found for logger X.Y.Z' is printed once." msgstr "" +"اگر :data:`raiseExceptions` برابر ``True`` باشد (حالت توسعه)، پیام 'No " +"handlers could be found for logger X.Y.Z' یک بار چاپ می‌شود." -msgid "To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." +msgid "" +"To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." msgstr "" +"برای به دست آوردن رفتار پیش از 3.2، می‌توان :data:`lastResort` را روی " +"``None`` تنظیم کرد." msgid "Configuring Logging for a Library" -msgstr "" +msgstr "پیکربندی گزارش برای یک کتابخانه" -msgid "When developing a library which uses logging, you should take care to document how the library uses logging - for example, the names of loggers used. Some consideration also needs to be given to its logging configuration. If the using application does not use logging, and library code makes logging calls, then (as described in the previous section) events of severity ``WARNING`` and greater will be printed to ``sys.stderr``. This is regarded as the best default behaviour." -msgstr "" +msgid "" +"When developing a library which uses logging, you should take care to " +"document how the library uses logging - for example, the names of loggers " +"used. Some consideration also needs to be given to its logging " +"configuration. If the using application does not use logging, and library " +"code makes logging calls, then (as described in the previous section) events " +"of severity ``WARNING`` and greater will be printed to ``sys.stderr``. This " +"is regarded as the best default behaviour." +msgstr "" +"هنگام توسعه‌ی کتابخانه‌ای که از گزارش‌گیری (logging) استفاده می‌کند، باید دقت کنید " +"که نحوه‌ی استفاده‌ی کتابخانه از گزارش‌گیری را مستند کنید، برای مثال، نام گزارش‌گیرهای " +"استفاده‌شده. همچنین باید به پیکربندی گزارش‌گیری آن نیز توجه شود. اگر برنامه‌ی " +"استفاده‌کننده از گزارش‌گیری استفاده نکند و کد کتابخانه فراخوانی‌های گزارش‌گیری انجام " +"دهد، آنگاه (همان‌طور که در بخش قبلی توضیح داده شد) رویدادهایی با شدت " +"``WARNING`` و بالاتر در ``sys.stderr`` چاپ خواهند شد. این رفتار به‌عنوان " +"بهترین رفتار پیش‌فرض در نظر گرفته می‌شود." -msgid "If for some reason you *don't* want these messages printed in the absence of any logging configuration, you can attach a do-nothing handler to the top-level logger for your library. This avoids the message being printed, since a handler will always be found for the library's events: it just doesn't produce any output. If the library user configures logging for application use, presumably that configuration will add some handlers, and if levels are suitably configured then logging calls made in library code will send output to those handlers, as normal." -msgstr "" +msgid "" +"If for some reason you *don't* want these messages printed in the absence of " +"any logging configuration, you can attach a do-nothing handler to the top-" +"level logger for your library. This avoids the message being printed, since " +"a handler will always be found for the library's events: it just doesn't " +"produce any output. If the library user configures logging for application " +"use, presumably that configuration will add some handlers, and if levels are " +"suitably configured then logging calls made in library code will send output " +"to those handlers, as normal." +msgstr "" +"اگر به هر دلیلی *نمی‌خواهید* این پیام‌ها در نبود هرگونه پیکربندی گزارش (logging) " +"چاپ شوند، می‌توانید یک هندلر (handler) بی‌عمل را به گزارش‌گیر (logger) سطح بالای " +"کتابخانه‌ی خود متصل کنید. این کار از چاپ پیام جلوگیری می‌کند، زیرا همیشه برای " +"رویدادهای کتابخانه یک هندلر پیدا خواهد شد: فقط هیچ خروجی‌ای تولید نمی‌کند. اگر " +"کاربر کتابخانه گزارش را برای استفاده‌ی برنامه پیکربندی کند، احتمالاً آن پیکربندی " +"چند هندلر اضافه خواهد کرد، و اگر سطوح به‌طور مناسبی پیکربندی شده باشند، " +"فراخوانی‌های گزارش انجام‌شده در کد کتابخانه، خروجی را مانند حالت عادی به آن " +"هندلرها ارسال خواهند کرد." -msgid "A do-nothing handler is included in the logging package: :class:`~logging.NullHandler` (since Python 3.1). An instance of this handler could be added to the top-level logger of the logging namespace used by the library (*if* you want to prevent your library's logged events being output to ``sys.stderr`` in the absence of logging configuration). If all logging by a library *foo* is done using loggers with names matching 'foo.x', 'foo.x.y', etc. then the code::" -msgstr "" +msgid "" +"A do-nothing handler is included in the logging " +"package: :class:`~logging.NullHandler` (since Python 3.1). An instance of " +"this handler could be added to the top-level logger of the logging namespace " +"used by the library (*if* you want to prevent your library's logged events " +"being output to ``sys.stderr`` in the absence of logging configuration). If " +"all logging by a library *foo* is done using loggers with names matching " +"'foo.x', 'foo.x.y', etc. then the code::" +msgstr "" +"یک هندلر بدون عملیات در بسته‌ی logging گنجانده شده " +"است: :class:`~logging.NullHandler` (از پایتون 3.1). می‌توان یک نمونه از این " +"هندلر را به گزارش‌گیر سطح بالای فضای نام گزارش‌گیری مورد استفاده‌ی کتابخانه اضافه کرد " +"(*اگر* بخواهید در نبود پیکربندی گزارش‌گیری، از نوشته شدن رویدادهای گزارش‌شده‌ی " +"کتابخانه‌تان در ``sys.stderr`` جلوگیری کنید). اگر تمام گزارش‌گیری کتابخانه‌ی *foo* " +"با استفاده از گزارش‌گیرهایی با نام‌های مطابق با 'foo.x'، 'foo.x.y' و غیره انجام " +"شود، آنگاه کد::" msgid "" "import logging\n" "logging.getLogger('foo').addHandler(logging.NullHandler())" msgstr "" +"import logging\n" +"logging.getLogger('foo').addHandler(logging.NullHandler())" -msgid "should have the desired effect. If an organisation produces a number of libraries, then the logger name specified can be 'orgname.foo' rather than just 'foo'." +msgid "" +"should have the desired effect. If an organisation produces a number of " +"libraries, then the logger name specified can be 'orgname.foo' rather than " +"just 'foo'." msgstr "" +"باید اثر مطلوب را داشته باشد. اگر سازمانی تعدادی کتابخانه تولید کند، آنگاه " +"نام گزارش‌گیر (logger) مشخص‌شده می‌تواند به‌جای فقط 'foo'، 'orgname.foo' باشد." -msgid "It is strongly advised that you *do not log to the root logger* in your library. Instead, use a logger with a unique and easily identifiable name, such as the ``__name__`` for your library's top-level package or module. Logging to the root logger will make it difficult or impossible for the application developer to configure the logging verbosity or handlers of your library as they wish." -msgstr "" +msgid "" +"It is strongly advised that you *do not log to the root logger* in your " +"library. Instead, use a logger with a unique and easily identifiable name, " +"such as the ``__name__`` for your library's top-level package or module. " +"Logging to the root logger will make it difficult or impossible for the " +"application developer to configure the logging verbosity or handlers of your " +"library as they wish." +msgstr "" +"اکیداً توصیه می‌شود که در کتابخانه‌ی خود *به گزارش‌گیر ریشه گزارش نکنید*. در عوض، از " +"گزارش‌گیری با نام یکتا و به‌راحتی قابل‌تشخیص استفاده کنید، مانند ``__name__`` برای " +"بسته یا ماژول سطح بالای کتابخانه‌ی خود. گزارش کردن به گزارش‌گیر ریشه، پیکربندی سطح " +"جزئیات گزارش یا handlerهای کتابخانه‌ی شما را برای توسعه‌دهنده‌ی برنامه، آن‌گونه که " +"بخواهد دشوار یا غیرممکن می‌سازد." -msgid "It is strongly advised that you *do not add any handlers other than* :class:`~logging.NullHandler` *to your library's loggers*. This is because the configuration of handlers is the prerogative of the application developer who uses your library. The application developer knows their target audience and what handlers are most appropriate for their application: if you add handlers 'under the hood', you might well interfere with their ability to carry out unit tests and deliver logs which suit their requirements." -msgstr "" +msgid "" +"It is strongly advised that you *do not add any handlers other " +"than* :class:`~logging.NullHandler` *to your library's loggers*. This is " +"because the configuration of handlers is the prerogative of the application " +"developer who uses your library. The application developer knows their " +"target audience and what handlers are most appropriate for their " +"application: if you add handlers 'under the hood', you might well interfere " +"with their ability to carry out unit tests and deliver logs which suit their " +"requirements." +msgstr "" +"اکیداً توصیه می‌شود که *هیچ هندلرای به‌جز* :class:`~logging.NullHandler` " +"*به گزارش‌گیرهای کتابخانه خود اضافه نکنید*. دلیل این امر آن است که پیکربندی " +"هندلرها در اختیار توسعه‌دهنده‌ی برنامه‌ای است که از کتابخانه شما استفاده " +"می‌کند. توسعه‌دهنده‌ی برنامه مخاطبان هدف و مناسب‌ترین هندلرها برای برنامه‌اش " +"را می‌داند: اگر «در پشت صحنه» هندلرهایی اضافه کنید، ممکن است در توانایی " +"او برای اجرای آزمون واحد‌ها و ارائه گزارش‌هایی که نیازهایش را برآورده می‌کنند، " +"اختلال ایجاد کنید." msgid "Logging Levels" -msgstr "" +msgstr "سطوح گزارش" -msgid "The numeric values of logging levels are given in the following table. These are primarily of interest if you want to define your own levels, and need them to have specific values relative to the predefined levels. If you define a level with the same numeric value, it overwrites the predefined value; the predefined name is lost." -msgstr "" +msgid "" +"The numeric values of logging levels are given in the following table. These " +"are primarily of interest if you want to define your own levels, and need " +"them to have specific values relative to the predefined levels. If you " +"define a level with the same numeric value, it overwrites the predefined " +"value; the predefined name is lost." +msgstr "" +"مقادیر عددی سطوح گزارش‌گیری (logging) در جدول زیر آمده است. این مقادیر عمدتاً " +"زمانی اهمیت دارند که بخواهید سطوح خودتان را تعریف کنید و لازم باشد که آن‌ها " +"مقادیر مشخصی نسبت به سطوح از پیش تعریف‌شده داشته باشند. اگر سطحی با همان " +"مقدار عددی تعریف کنید، مقدار از پیش تعریف‌شده را بازنویسی می‌کند؛ نام از پیش " +"تعریف‌شده از بین می‌رود." msgid "Numeric value" -msgstr "" +msgstr "مقدار عددی" msgid "50" -msgstr "" +msgstr "50" msgid "40" -msgstr "" +msgstr "40" msgid "30" -msgstr "" +msgstr "30" msgid "20" -msgstr "" +msgstr "20" msgid "10" -msgstr "" +msgstr "10" msgid "``NOTSET``" -msgstr "" +msgstr "``NOTSET``" msgid "0" -msgstr "" +msgstr "0" -msgid "Levels can also be associated with loggers, being set either by the developer or through loading a saved logging configuration. When a logging method is called on a logger, the logger compares its own level with the level associated with the method call. If the logger's level is higher than the method call's, no logging message is actually generated. This is the basic mechanism controlling the verbosity of logging output." -msgstr "" +msgid "" +"Levels can also be associated with loggers, being set either by the " +"developer or through loading a saved logging configuration. When a logging " +"method is called on a logger, the logger compares its own level with the " +"level associated with the method call. If the logger's level is higher than " +"the method call's, no logging message is actually generated. This is the " +"basic mechanism controlling the verbosity of logging output." +msgstr "" +"سطح‌ها می‌توانند به گزارش‌گیرها (logger) نیز مرتبط باشند و توسط توسعه‌دهنده یا از " +"طریق بارگذاری یک پیکربندی گزارش‌گیری (logging) ذخیره‌شده تنظیم شوند. هنگامی که یک " +"متد گزارش‌گیری روی یک گزارش‌گیر فراخوانی می‌شود، گزارش‌گیر سطح خود را با سطح مرتبط با " +"فراخوانی متد مقایسه می‌کند. اگر سطح گزارش‌گیر بالاتر از سطح فراخوانی متد باشد، در " +"عمل هیچ پیام گزارش‌گیریی تولید نمی‌شود. این مکانیزم اساسی کنترل پرگویی خروجی " +"گزارش‌گیری است." -msgid "Logging messages are encoded as instances of the :class:`~logging.LogRecord` class. When a logger decides to actually log an event, a :class:`~logging.LogRecord` instance is created from the logging message." +msgid "" +"Logging messages are encoded as instances of the :class:`~logging.LogRecord` " +"class. When a logger decides to actually log an event, " +"a :class:`~logging.LogRecord` instance is created from the logging message." msgstr "" +"پیام‌های ثبت رویداد به‌صورت نمونه‌هایی از کلاس :class:`~logging.LogRecord` " +"کدگذاری می‌شوند. هنگامی که یک گزارش‌گیر تصمیم می‌گیرد واقعاً رویدادی را ثبت کند، " +"نمونه‌ای از :class:`~logging.LogRecord` بر اساس پیام ثبت رویداد ایجاد می‌شود." -msgid "Logging messages are subjected to a dispatch mechanism through the use of :dfn:`handlers`, which are instances of subclasses of the :class:`Handler` class. Handlers are responsible for ensuring that a logged message (in the form of a :class:`LogRecord`) ends up in a particular location (or set of locations) which is useful for the target audience for that message (such as end users, support desk staff, system administrators, developers). Handlers are passed :class:`LogRecord` instances intended for particular destinations. Each logger can have zero, one or more handlers associated with it (via the :meth:`~Logger.addHandler` method of :class:`Logger`). In addition to any handlers directly associated with a logger, *all handlers associated with all ancestors of the logger* are called to dispatch the message (unless the *propagate* flag for a logger is set to a false value, at which point the passing to ancestor handlers stops)." -msgstr "" +msgid "" +"Logging messages are subjected to a dispatch mechanism through the use " +"of :dfn:`handlers`, which are instances of subclasses of " +"the :class:`Handler` class. Handlers are responsible for ensuring that a " +"logged message (in the form of a :class:`LogRecord`) ends up in a particular " +"location (or set of locations) which is useful for the target audience for " +"that message (such as end users, support desk staff, system administrators, " +"developers). Handlers are passed :class:`LogRecord` instances intended for " +"particular destinations. Each logger can have zero, one or more handlers " +"associated with it (via the :meth:`~Logger.addHandler` method " +"of :class:`Logger`). In addition to any handlers directly associated with a " +"logger, *all handlers associated with all ancestors of the logger* are " +"called to dispatch the message (unless the *propagate* flag for a logger is " +"set to a false value, at which point the passing to ancestor handlers stops)." +msgstr "" +"پیام‌های گزارش با استفاده از :dfn:`handlers` تحت یک سازوکار توزیع قرار می‌گیرند؛ " +"هندلرها نمونه‌هایی از زیرکلاس‌های کلاس :class:`Handler` هستند. هندلرها مسئول " +"اطمینان از این هستند که پیام گزارش‌شده (در قالب :class:`LogRecord`) در مکان " +"خاصی (یا مجموعه‌ای از مکان‌ها) قرار گیرد که برای مخاطبان هدف آن پیام مفید باشد " +"(مانند کاربران نهایی، کارکنان میز پشتیبانی، مدیران سیستم، توسعه‌دهندگان). " +"نمونه‌های :class:`LogRecord` که برای مقاصد خاصی در نظر گرفته شده‌اند، به " +"هندلرها ارسال می‌شوند. هر گزارش‌گیر می‌تواند صفر، یک یا چند هندلر مرتبط با خود " +"داشته باشد (از طریق متد :meth:`~Logger.addHandler` کلاس :class:`Logger`). " +"علاوه بر هر هندلری که مستقیماً با یک گزارش‌گیر مرتبط است، *تمام هندلرهای مرتبط با " +"تمام اجداد آن گزارش‌گیر* برای توزیع پیام فراخوانی می‌شوند (مگر اینکه پرچم " +"*propagate* برای یک گزارش‌گیر روی مقدار نادرست تنظیم شده باشد، که در آن حالت، " +"ارسال به هندلرهای اجداد متوقف می‌شود)." -msgid "Just as for loggers, handlers can have levels associated with them. A handler's level acts as a filter in the same way as a logger's level does. If a handler decides to actually dispatch an event, the :meth:`~Handler.emit` method is used to send the message to its destination. Most user-defined subclasses of :class:`Handler` will need to override this :meth:`~Handler.emit`." -msgstr "" +msgid "" +"Just as for loggers, handlers can have levels associated with them. A " +"handler's level acts as a filter in the same way as a logger's level does. " +"If a handler decides to actually dispatch an event, " +"the :meth:`~Handler.emit` method is used to send the message to its " +"destination. Most user-defined subclasses of :class:`Handler` will need to " +"override this :meth:`~Handler.emit`." +msgstr "" +"همانند گزارش‌گیرها (loggers)، هندلرها (handlers) نیز می‌توانند سطح‌هایی مرتبط با " +"خود داشته باشند. سطح یک هندلر نیز همانند سطح یک گزارش‌گیر به‌عنوان یک فیلتر عمل " +"می‌کند. اگر یک هندلر تصمیم بگیرد واقعاً رویدادی را ارسال کند، از " +"متد :meth:`~Handler.emit` برای فرستادن پیام به مقصد آن استفاده می‌شود. بیشتر " +"زیرکلاس‌های :class:`Handler` که توسط کاربر تعریف شده‌اند، نیاز خواهند داشت که " +"این متد :meth:`~Handler.emit` را بازنویسی کنند." msgid "Custom Levels" -msgstr "" +msgstr "سطوح سفارشی" -msgid "Defining your own levels is possible, but should not be necessary, as the existing levels have been chosen on the basis of practical experience. However, if you are convinced that you need custom levels, great care should be exercised when doing this, and it is possibly *a very bad idea to define custom levels if you are developing a library*. That's because if multiple library authors all define their own custom levels, there is a chance that the logging output from such multiple libraries used together will be difficult for the using developer to control and/or interpret, because a given numeric value might mean different things for different libraries." -msgstr "" +msgid "" +"Defining your own levels is possible, but should not be necessary, as the " +"existing levels have been chosen on the basis of practical experience. " +"However, if you are convinced that you need custom levels, great care should " +"be exercised when doing this, and it is possibly *a very bad idea to define " +"custom levels if you are developing a library*. That's because if multiple " +"library authors all define their own custom levels, there is a chance that " +"the logging output from such multiple libraries used together will be " +"difficult for the using developer to control and/or interpret, because a " +"given numeric value might mean different things for different libraries." +msgstr "" +"تعریف سطوح خودتان ممکن است، اما نباید ضروری باشد، زیرا سطوح موجود بر اساس " +"تجربه عملی انتخاب شده‌اند. با این حال، اگر متقاعد شده‌اید که به سطوح سفارشی " +"نیاز دارید، باید هنگام انجام این کار بسیار احتیاط کنید، و ممکن است *تعریف " +"سطوح سفارشی در صورتی که در حال توسعه‌ی یک کتابخانه هستید، ایده بسیار بدی " +"باشد*. این به آن دلیل است که اگر چندین نویسنده کتابخانه همگی سطوح سفارشی خود " +"را تعریف کنند، این احتمال وجود دارد که کنترل و/یا تفسیر خروجی گزارش‌گیری " +"(logging) چنین کتابخانه‌هایی که با هم استفاده می‌شوند، برای توسعه‌دهنده " +"استفاده‌کننده دشوار باشد، زیرا یک مقدار عددی معین ممکن است برای کتابخانه‌های " +"مختلف معانی متفاوتی داشته باشد." msgid "Useful Handlers" -msgstr "" +msgstr "هندلرهای مفید (Handlers)" -msgid "In addition to the base :class:`Handler` class, many useful subclasses are provided:" +msgid "" +"In addition to the base :class:`Handler` class, many useful subclasses are " +"provided:" msgstr "" +"علاوه بر کلاس پایه :class:`Handler`، زیرکلاس‌های مفید زیادی ارائه شده‌اند:" -msgid ":class:`StreamHandler` instances send messages to streams (file-like objects)." +msgid "" +":class:`StreamHandler` instances send messages to streams (file-like " +"objects)." msgstr "" +"نمونه‌های :class:`StreamHandler` پیام‌ها را به جریان‌ها (اشیاء فایل‌مانند) ارسال " +"می‌کنند." msgid ":class:`FileHandler` instances send messages to disk files." -msgstr "" +msgstr "نمونه‌های :class:`FileHandler` پیام‌ها را به فایل‌های دیسک ارسال می‌کنند." -msgid ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that rotate log files at a certain point. It is not meant to be instantiated directly. Instead, use :class:`~handlers.RotatingFileHandler` or :class:`~handlers.TimedRotatingFileHandler`." +msgid "" +":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " +"rotate log files at a certain point. It is not meant to be instantiated " +"directly. Instead, use :class:`~handlers.RotatingFileHandler` " +"or :class:`~handlers.TimedRotatingFileHandler`." msgstr "" +":class:`~handlers.BaseRotatingHandler` کلاس پایه برای هندلرهایی (handlers) " +"است که فایل‌های گزارش را در نقطه‌ای معین می‌چرخانند. این کلاس برای نمونه‌سازی " +"مستقیم در نظر گرفته نشده است. در عوض، " +"از :class:`~handlers.RotatingFileHandler` " +"یا :class:`~handlers.TimedRotatingFileHandler` استفاده کنید." -msgid ":class:`~handlers.RotatingFileHandler` instances send messages to disk files, with support for maximum log file sizes and log file rotation." +msgid "" +":class:`~handlers.RotatingFileHandler` instances send messages to disk " +"files, with support for maximum log file sizes and log file rotation." msgstr "" +"نمونه‌های :class:`~handlers.RotatingFileHandler` پیام‌ها را به فایل‌های دیسک " +"ارسال می‌کنند و از حداکثر اندازه فایل‌های گزارش و چرخش فایل گزارش پشتیبانی " +"می‌کنند." -msgid ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk files, rotating the log file at certain timed intervals." +msgid "" +":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " +"files, rotating the log file at certain timed intervals." msgstr "" +"نمونه‌های :class:`~handlers.TimedRotatingFileHandler` پیام‌ها را به فایل‌های " +"دیسک ارسال می‌کنند و فایل گزارش را در بازه‌های زمانی مشخصی می‌چرخانند." -msgid ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. Since 3.4, Unix domain sockets are also supported." +msgid "" +":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " +"Since 3.4, Unix domain sockets are also supported." msgstr "" +"نمونه‌های :class:`~handlers.SocketHandler` پیام‌ها را به سوکت‌های TCP/IP ارسال " +"می‌کنند. از نسخه 3.4، از سوکت‌های دامنه یونیکس (Unix domain sockets) نیز " +"پشتیبانی می‌شود." -msgid ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. Since 3.4, Unix domain sockets are also supported." +msgid "" +":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " +"Since 3.4, Unix domain sockets are also supported." msgstr "" +"نمونه‌های :class:`~handlers.DatagramHandler` پیام‌ها را به سوکت‌های UDP ارسال " +"می‌کنند. از 3.4، سوکت‌های دامنه یونیکس نیز پشتیبانی می‌شوند." -msgid ":class:`~handlers.SMTPHandler` instances send messages to a designated email address." +msgid "" +":class:`~handlers.SMTPHandler` instances send messages to a designated email " +"address." msgstr "" +"نمونه‌های :class:`~handlers.SMTPHandler` پیام‌ها را به یک نشانی ایمیل تعیین‌شده " +"ارسال می‌کنند." -msgid ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog daemon, possibly on a remote machine." +msgid "" +":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " +"daemon, possibly on a remote machine." msgstr "" +"نمونه‌های :class:`~handlers.SysLogHandler` پیام‌ها را به یک دیمون syslog در " +"یونیکس ارسال می‌کنند، احتمالاً روی یک ماشین راه دور." -msgid ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows NT/2000/XP event log." +msgid "" +":class:`~handlers.NTEventLogHandler` instances send messages to a Windows NT/" +"2000/XP event log." msgstr "" +"نمونه‌های :class:`~handlers.NTEventLogHandler` پیام‌ها را به گزارش رویداد " +"ویندوز NT/2000/XP ارسال می‌کنند." -msgid ":class:`~handlers.MemoryHandler` instances send messages to a buffer in memory, which is flushed whenever specific criteria are met." +msgid "" +":class:`~handlers.MemoryHandler` instances send messages to a buffer in " +"memory, which is flushed whenever specific criteria are met." msgstr "" +"نمونه‌های :class:`~handlers.MemoryHandler` پیام‌ها را به بافری در حافظه ارسال " +"می‌کنند که هر زمان معیارهای خاصی برآورده شوند، تخلیه می‌شود." -msgid ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server using either ``GET`` or ``POST`` semantics." +msgid "" +":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " +"using either ``GET`` or ``POST`` semantics." msgstr "" +"نمونه‌های :class:`~handlers.HTTPHandler` پیام‌ها را با استفاده از معنای " +"``GET`` یا ``POST`` به یک کارساز HTTP ارسال می‌کنند." -msgid ":class:`~handlers.WatchedFileHandler` instances watch the file they are logging to. If the file changes, it is closed and reopened using the file name. This handler is only useful on Unix-like systems; Windows does not support the underlying mechanism used." +msgid "" +":class:`~handlers.WatchedFileHandler` instances watch the file they are " +"logging to. If the file changes, it is closed and reopened using the file " +"name. This handler is only useful on Unix-like systems; Windows does not " +"support the underlying mechanism used." msgstr "" +"نمونه‌های :class:`~handlers.WatchedFileHandler` فایلی را که در آن گزارش می‌کنند، " +"پایش می‌کنند. اگر فایل تغییر کند، بسته می‌شود و با استفاده از نام فایل دوباره " +"باز می‌شود. این هندلر (handler) فقط در سیستم‌های شبه‌یونیکس مفید است؛ " +"ویندوز از سازوکار زیربنایی مورد استفاده پشتیبانی نمی‌کند." -msgid ":class:`~handlers.QueueHandler` instances send messages to a queue, such as those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." +msgid "" +":class:`~handlers.QueueHandler` instances send messages to a queue, such as " +"those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" +"نمونه‌های :class:`~handlers.QueueHandler` پیام‌ها را به یک صف ارسال می‌کنند، " +"مانند صف‌هایی که در ماژول‌های :mod:`queue` یا :mod:`multiprocessing` پیاده‌سازی " +"شده‌اند." -msgid ":class:`NullHandler` instances do nothing with error messages. They are used by library developers who want to use logging, but want to avoid the 'No handlers could be found for logger *XXX*' message which can be displayed if the library user has not configured logging. See :ref:`library-config` for more information." -msgstr "" +msgid "" +":class:`NullHandler` instances do nothing with error messages. They are used " +"by library developers who want to use logging, but want to avoid the 'No " +"handlers could be found for logger *XXX*' message which can be displayed if " +"the library user has not configured logging. See :ref:`library-config` for " +"more information." +msgstr "" +"نمونه‌های :class:`NullHandler` هیچ کاری با پیام‌های خطا انجام نمی‌دهند. " +"توسعه‌دهندگان کتابخانه‌ها که می‌خواهند از گزارش‌گیری (logging) استفاده کنند، اما " +"می‌خواهند از پیام «No handlers could be found for logger *XXX*» اجتناب کنند، " +"از این نمونه‌ها استفاده می‌کنند؛ پیامی که ممکن است در صورتی که کاربر کتابخانه " +"گزارش‌گیری (logging) را پیکربندی نکرده باشد، نمایش داده شود. برای اطلاعات " +"بیشتر :ref:`library-config` را ببینید." msgid "The :class:`NullHandler` class." -msgstr "" +msgstr "کلاس :class:`NullHandler`." msgid "The :class:`~handlers.QueueHandler` class." -msgstr "" +msgstr "کلاس :class:`~handlers.QueueHandler`." -msgid "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` classes are defined in the core logging package. The other handlers are defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-module, :mod:`logging.config`, for configuration functionality.)" +msgid "" +"The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " +"classes are defined in the core logging package. The other handlers are " +"defined in a sub-module, :mod:`logging.handlers`. (There is also another sub-" +"module, :mod:`logging.config`, for configuration functionality.)" msgstr "" +"کلاس‌های :class:`NullHandler`، :class:`StreamHandler` و :class:`FileHandler` " +"در بسته‌ی اصلی logging تعریف شده‌اند. سایر هندلرها (handler) در یک " +"زیرماژول، :mod:`logging.handlers` تعریف شده‌اند. (همچنین زیرماژول " +"دیگری، :mod:`logging.config`، برای قابلیت پیکربندی وجود دارد.)" -msgid "Logged messages are formatted for presentation through instances of the :class:`Formatter` class. They are initialized with a format string suitable for use with the % operator and a dictionary." +msgid "" +"Logged messages are formatted for presentation through instances of " +"the :class:`Formatter` class. They are initialized with a format string " +"suitable for use with the % operator and a dictionary." msgstr "" +"پیام‌های ثبت‌شده برای نمایش از طریق نمونه‌هایی از کلاس :class:`Formatter` " +"قالب‌بندی می‌شوند. آن‌ها با یک رشته قالب مناسب برای استفاده با عملگر % و یک " +"دیکشنری مقداردهی اولیه می‌شوند." -msgid "For formatting multiple messages in a batch, instances of :class:`BufferingFormatter` can be used. In addition to the format string (which is applied to each message in the batch), there is provision for header and trailer format strings." +msgid "" +"For formatting multiple messages in a batch, instances " +"of :class:`BufferingFormatter` can be used. In addition to the format string " +"(which is applied to each message in the batch), there is provision for " +"header and trailer format strings." msgstr "" +"برای قالب‌بندی چندین پیام در یک دسته، می‌توان از " +"نمونه‌های :class:`BufferingFormatter` استفاده کرد. علاوه بر رشته‌ی قالب (که به " +"هر پیام در دسته اعمال می‌شود)، امکانی برای رشته‌های قالب سرآیند و پایانی وجود " +"دارد." -msgid "When filtering based on logger level and/or handler level is not enough, instances of :class:`Filter` can be added to both :class:`Logger` and :class:`Handler` instances (through their :meth:`~Handler.addFilter` method). Before deciding to process a message further, both loggers and handlers consult all their filters for permission. If any filter returns a false value, the message is not processed further." -msgstr "" +msgid "" +"When filtering based on logger level and/or handler level is not enough, " +"instances of :class:`Filter` can be added to both :class:`Logger` " +"and :class:`Handler` instances (through their :meth:`~Handler.addFilter` " +"method). Before deciding to process a message further, both loggers and " +"handlers consult all their filters for permission. If any filter returns a " +"false value, the message is not processed further." +msgstr "" +"هنگامی که فیلتر کردن بر اساس سطح logger و/یا سطح handler کافی نباشد، می‌توان " +"نمونه‌هایی از :class:`Filter` را به هر دو نمونه‌ی :class:`Logger` " +"و :class:`Handler` اضافه کرد (از طریق متد :meth:`~Handler.addFilter` آن‌ها). " +"پیش از تصمیم به ادامه‌ی پردازش یک پیام، logger و handler هر دو برای کسب اجازه " +"تمام فیلترهای خود را بررسی می‌کنند. اگر هر یک از فیلترها مقدار نادرستی " +"برگرداند، پیام بیش از این پردازش نمی‌شود." -msgid "The basic :class:`Filter` functionality allows filtering by specific logger name. If this feature is used, messages sent to the named logger and its children are allowed through the filter, and all others dropped." +msgid "" +"The basic :class:`Filter` functionality allows filtering by specific logger " +"name. If this feature is used, messages sent to the named logger and its " +"children are allowed through the filter, and all others dropped." msgstr "" +"قابلیت پایه‌ای :class:`Filter` امکان فیلتر کردن بر اساس نام گزارش‌گیر مشخص را " +"فراهم می‌کند. اگر از این قابلیت استفاده شود، پیام‌های ارسال‌شده به گزارش‌گیر نام‌برده " +"و فرزندان آن از فیلتر عبور داده می‌شوند و تمام پیام‌های دیگر حذف می‌شوند." msgid "Exceptions raised during logging" -msgstr "" +msgstr "استثناهای پرتاب‌شده هنگام گزارش کردن (logging)" -msgid "The logging package is designed to swallow exceptions which occur while logging in production. This is so that errors which occur while handling logging events - such as logging misconfiguration, network or other similar errors - do not cause the application using logging to terminate prematurely." +msgid "" +"The logging package is designed to swallow exceptions which occur while " +"logging in production. This is so that errors which occur while handling " +"logging events - such as logging misconfiguration, network or other similar " +"errors - do not cause the application using logging to terminate prematurely." msgstr "" +"بسته‌ی گزارش‌گیری (logging) به‌گونه‌ای طراحی شده است که استثناهایی را که هنگام " +"گزارش‌گیری در محیط عملیاتی رخ می‌دهند، ببلعد. این برای آن است که خطاهایی که " +"هنگام مدیریت رویدادهای گزارش‌گیری رخ می‌دهند — مانند پیکربندی نادرست گزارش‌گیری، " +"خطاهای شبکه یا دیگر خطاهای مشابه — باعث خاتمه‌ی زودهنگام برنامه‌ی کاربردی‌ای که " +"از گزارش‌گیری استفاده می‌کند، نشوند." -msgid ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never swallowed. Other exceptions which occur during the :meth:`~Handler.emit` method of a :class:`Handler` subclass are passed to its :meth:`~Handler.handleError` method." +msgid "" +":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " +"swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " +"method of a :class:`Handler` subclass are passed to " +"its :meth:`~Handler.handleError` method." msgstr "" +"استثناهای :class:`SystemExit` و :class:`KeyboardInterrupt` هرگز نادیده گرفته " +"نمی‌شوند. سایر استثناهایی که در حین اجرای متد :meth:`~Handler.emit` یک کلاس " +"فرعی از :class:`Handler` رخ می‌دهند، به متد :meth:`~Handler.handleError` آن " +"ارسال می‌شوند." -msgid "The default implementation of :meth:`~Handler.handleError` in :class:`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed." +msgid "" +"The default implementation of :meth:`~Handler.handleError` " +"in :class:`Handler` checks to see if a module-level " +"variable, :data:`raiseExceptions`, is set. If set, a traceback is printed " +"to :data:`sys.stderr`. If not set, the exception is swallowed." msgstr "" +"پیاده‌سازی پیش‌فرض :meth:`~Handler.handleError` در :class:`Handler` بررسی " +"می‌کند که آیا یک متغیر سطح ماژول به نام :data:`raiseExceptions` تنظیم شده است " +"یا خیر. اگر تنظیم شده باشد، یک ردگیری پشته در :data:`sys.stderr` چاپ می‌شود. " +"اگر تنظیم نشده باشد، استثنا نادیده گرفته می‌شود." -msgid "The default value of :data:`raiseExceptions` is ``True``. This is because during development, you typically want to be notified of any exceptions that occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production usage." +msgid "" +"The default value of :data:`raiseExceptions` is ``True``. This is because " +"during development, you typically want to be notified of any exceptions that " +"occur. It's advised that you set :data:`raiseExceptions` to ``False`` for " +"production usage." msgstr "" +"مقدار پیش‌فرض :data:`raiseExceptions` برابر ``True`` است. این به این دلیل است " +"که در طول توسعه، معمولاً می‌خواهید از هر استثنایی که رخ می‌دهد مطلع شوید. توصیه " +"می‌شود برای استفاده در محیط عملیاتی، :data:`raiseExceptions` را روی ``False`` " +"تنظیم کنید." msgid "Using arbitrary objects as messages" -msgstr "" +msgstr "استفاده از اشیاء دلخواه به‌عنوان پیام" -msgid "In the preceding sections and examples, it has been assumed that the message passed when logging the event is a string. However, this is not the only possibility. You can pass an arbitrary object as a message, and its :meth:`~object.__str__` method will be called when the logging system needs to convert it to a string representation. In fact, if you want to, you can avoid computing a string representation altogether - for example, the :class:`~handlers.SocketHandler` emits an event by pickling it and sending it over the wire." -msgstr "" +msgid "" +"In the preceding sections and examples, it has been assumed that the message " +"passed when logging the event is a string. However, this is not the only " +"possibility. You can pass an arbitrary object as a message, and " +"its :meth:`~object.__str__` method will be called when the logging system " +"needs to convert it to a string representation. In fact, if you want to, you " +"can avoid computing a string representation altogether - for example, " +"the :class:`~handlers.SocketHandler` emits an event by pickling it and " +"sending it over the wire." +msgstr "" +"در بخش‌ها و مثال‌های پیشین، فرض بر این بوده است که پیامی که هنگام ثبت رویداد " +"ارسال می‌شود، یک رشته است. با این حال، این تنها حالت ممکن نیست. شما می‌توانید " +"یک شیء دلخواه را به‌عنوان پیام ارسال کنید، و هنگامی که سیستم ثبت رویداد نیاز " +"داشته باشد آن را به یک بازنمایی رشته‌ای تبدیل کند، " +"متد :meth:`~object.__str__` آن فراخوانی خواهد شد. در واقع، اگر بخواهید، " +"می‌توانید به‌طور کامل از محاسبه‌ی بازنمایی رشته‌ای اجتناب کنید — برای " +"مثال، :class:`~handlers.SocketHandler` یک رویداد را با پیکل‌کردن (pickling) " +"آن و ارسال آن از طریق شبکه منتشر می‌کند." msgid "Optimization" -msgstr "" +msgstr "بهینه‌سازی" -msgid "Formatting of message arguments is deferred until it cannot be avoided. However, computing the arguments passed to the logging method can also be expensive, and you may want to avoid doing it if the logger will just throw away your event. To decide what to do, you can call the :meth:`~Logger.isEnabledFor` method which takes a level argument and returns true if the event would be created by the Logger for that level of call. You can write code like this::" -msgstr "" +msgid "" +"Formatting of message arguments is deferred until it cannot be avoided. " +"However, computing the arguments passed to the logging method can also be " +"expensive, and you may want to avoid doing it if the logger will just throw " +"away your event. To decide what to do, you can call " +"the :meth:`~Logger.isEnabledFor` method which takes a level argument and " +"returns true if the event would be created by the Logger for that level of " +"call. You can write code like this::" +msgstr "" +"قالب‌بندی آرگومان‌های پیام تا زمانی که نتوان از آن اجتناب کرد، به تعویق " +"می‌افتد. با این حال، محاسبه آرگومان‌هایی که به متد گزارش‌کردن (logging) ارسال " +"می‌شوند نیز می‌تواند پرهزینه باشد، و ممکن است بخواهید از انجام آن اجتناب کنید " +"اگر گزارش‌گیر (logger) قرار باشد صرفاً رویداد شما را دور بیندازد. برای تصمیم‌گیری " +"درباره اینکه چه کاری انجام دهید، می‌توانید متد :meth:`~Logger.isEnabledFor` " +"را فراخوانی کنید که یک آرگومان سطح می‌گیرد و در صورتی مقدار true را " +"برمی‌گرداند که رویداد برای آن سطح از فراخوانی توسط Logger ایجاد شود. می‌توانید " +"کدی مانند زیر بنویسید::" msgid "" "if logger.isEnabledFor(logging.DEBUG):\n" " logger.debug('Message with %s, %s', expensive_func1(),\n" " expensive_func2())" msgstr "" +"if logger.isEnabledFor(logging.DEBUG):\n" +" logger.debug('Message with %s, %s', expensive_func1(),\n" +" expensive_func2())" -msgid "so that if the logger's threshold is set above ``DEBUG``, the calls to ``expensive_func1`` and ``expensive_func2`` are never made." +msgid "" +"so that if the logger's threshold is set above ``DEBUG``, the calls to " +"``expensive_func1`` and ``expensive_func2`` are never made." msgstr "" +"به‌گونه‌ای که اگر آستانه‌ی گزارش‌گیر بالاتر از ``DEBUG`` تنظیم شده باشد، فراخوانی‌های " +"``expensive_func1`` و ``expensive_func2`` هرگز انجام نمی‌شوند." -msgid "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive than you'd like (e.g. for deeply nested loggers where an explicit level is only set high up in the logger hierarchy). In such cases (or if you want to avoid calling a method in tight loops), you can cache the result of a call to :meth:`~Logger.isEnabledFor` in a local or instance variable, and use that instead of calling the method each time. Such a cached value would only need to be recomputed when the logging configuration changes dynamically while the application is running (which is not all that common)." -msgstr "" +msgid "" +"In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " +"than you'd like (e.g. for deeply nested loggers where an explicit level is " +"only set high up in the logger hierarchy). In such cases (or if you want to " +"avoid calling a method in tight loops), you can cache the result of a call " +"to :meth:`~Logger.isEnabledFor` in a local or instance variable, and use " +"that instead of calling the method each time. Such a cached value would only " +"need to be recomputed when the logging configuration changes dynamically " +"while the application is running (which is not all that common)." +msgstr "" +"در برخی موارد، خود :meth:`~Logger.isEnabledFor` می‌تواند پرهزینه‌تر از آن باشد " +"که مایلید (برای مثال، برای گزارش‌گیرهای عمیقاً تودرتو که در آن‌ها یک سطح صریح فقط " +"در سطوح بالای سلسله‌مراتب گزارش‌گیرها تنظیم شده است). در چنین مواردی (یا اگر " +"می‌خواهید از فراخوانی یک متد در حلقه‌های فشرده اجتناب کنید)، می‌توانید نتیجه‌ی " +"فراخوانی :meth:`~Logger.isEnabledFor` را در یک متغیر محلی یا نمونه به‌عنوان " +"نهانگاه ذخیره کنید و به‌جای فراخوانی متد در هر بار، از آن استفاده کنید. چنین " +"مقدار نهان‌شده‌ای تنها زمانی نیاز به بازمحاسبه دارد که پیکربندی گزارش‌گیری در حین " +"اجرای برنامه به‌صورت پویا تغییر کند (که چندان رایج نیست)." -msgid "There are other optimizations which can be made for specific applications which need more precise control over what logging information is collected. Here's a list of things you can do to avoid processing during logging which you don't need:" +msgid "" +"There are other optimizations which can be made for specific applications " +"which need more precise control over what logging information is collected. " +"Here's a list of things you can do to avoid processing during logging which " +"you don't need:" msgstr "" +"برای برنامه‌های کاربردی خاصی که به کنترل دقیق‌تری بر اطلاعات گزارش جمع‌آوری‌شده " +"نیاز دارند، می‌توان بهینه‌سازی‌های دیگری نیز انجام داد. در اینجا فهرستی از " +"کارهایی آمده است که می‌توانید برای اجتناب از پردازش‌هایی که در حین گزارش کردن به " +"آن‌ها نیاز ندارید، انجام دهید:" msgid "What you don't want to collect" -msgstr "" +msgstr "آنچه نمی‌خواهید جمع‌آوری شود" msgid "How to avoid collecting it" -msgstr "" +msgstr "چگونه از زباله‌روبی آن اجتناب کنیم" msgid "Information about where calls were made from." -msgstr "" +msgstr "اطلاعات درباره‌ی این که فراخوانی‌ها از کجا انجام شده‌اند." -msgid "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys._getframe`, which may help to speed up your code in environments like PyPy (which can't speed up code that uses :func:`sys._getframe`)." +msgid "" +"Set ``logging._srcfile`` to ``None``. This avoids " +"calling :func:`sys._getframe`, which may help to speed up your code in " +"environments like PyPy (which can't speed up code that " +"uses :func:`sys._getframe`)." msgstr "" +"``logging._srcfile`` را روی ``None`` تنظیم کنید. این کار از " +"فراخوانی :func:`sys._getframe` جلوگیری می‌کند، که ممکن است به افزایش سرعت کد " +"شما در محیط‌هایی مانند PyPy کمک کند (که نمی‌تواند سرعت کدی را که " +"از :func:`sys._getframe` استفاده می‌کند افزایش دهد)." msgid "Threading information." -msgstr "" +msgstr "اطلاعات نخ‌بندی." msgid "Set ``logging.logThreads`` to ``False``." -msgstr "" +msgstr "``logging.logThreads`` را روی ``False`` تنظیم کنید." msgid "Current process ID (:func:`os.getpid`)" -msgstr "" +msgstr "شناسه فرایند جاری (:func:`os.getpid`)" msgid "Set ``logging.logProcesses`` to ``False``." -msgstr "" +msgstr "``logging.logProcesses`` را روی ``False`` تنظیم کنید." -msgid "Current process name when using ``multiprocessing`` to manage multiple processes." +msgid "" +"Current process name when using ``multiprocessing`` to manage multiple " +"processes." msgstr "" +"نام فرایند فعلی هنگام استفاده از ``multiprocessing`` برای مدیریت چندین " +"فرایند." msgid "Set ``logging.logMultiprocessing`` to ``False``." -msgstr "" +msgstr "``logging.logMultiprocessing`` را روی ``False`` تنظیم کنید." msgid "Current :class:`asyncio.Task` name when using ``asyncio``." -msgstr "" +msgstr "نام فعلی :class:`asyncio.Task` هنگام استفاده از ``asyncio``." msgid "Set ``logging.logAsyncioTasks`` to ``False``." -msgstr "" +msgstr "``logging.logAsyncioTasks`` را روی ``False`` تنظیم کنید." -msgid "Also note that the core logging module only includes the basic handlers. If you don't import :mod:`logging.handlers` and :mod:`logging.config`, they won't take up any memory." +msgid "" +"Also note that the core logging module only includes the basic handlers. If " +"you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " +"won't take up any memory." msgstr "" +"همچنین توجه داشته باشید که ماژول اصلی logging فقط شامل هندلرهای پایه " +"(handlers) است. اگر :mod:`logging.handlers` و :mod:`logging.config` را " +"ایمپورت نکنید، آن‌ها هیچ حافظه‌ای را اشغال نخواهند کرد." msgid "Other resources" -msgstr "" +msgstr "منابع دیگر" msgid "Module :mod:`logging`" -msgstr "" +msgstr "ماژول :mod:`logging`" msgid "API reference for the logging module." -msgstr "" +msgstr "مرجع API برای ماژول logging." msgid "Module :mod:`logging.config`" -msgstr "" +msgstr "ماژول :mod:`logging.config`" msgid "Configuration API for the logging module." -msgstr "" +msgstr "API پیکربندی برای ماژول logging." msgid "Module :mod:`logging.handlers`" -msgstr "" +msgstr "ماژول :mod:`logging.handlers`" msgid "Useful handlers included with the logging module." -msgstr "" +msgstr "هندلرهای (handlers) مفید موجود در ماژول logging." msgid ":ref:`A logging cookbook `" -msgstr "" +msgstr ":ref:`کتابچه آشپزی ثبت رویداد `" diff --git a/howto/mro.po b/howto/mro.po index 061fb3d18..a07db8ba6 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -24,76 +24,211 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "The Python 2.3 Method Resolution Order" -msgstr "" +msgstr "ترتیب حل متد در پایتون 2.3" -msgid "This is a historical document, provided as an appendix to the official documentation. The Method Resolution Order discussed here was *introduced* in Python 2.3, but it is still used in later versions -- including Python 3." +msgid "" +"This is a historical document, provided as an appendix to the official " +"documentation. The Method Resolution Order discussed here was *introduced* " +"in Python 2.3, but it is still used in later versions -- including Python 3." msgstr "" +"این یک سند تاریخی است که به‌عنوان پیوستی برای مستندات رسمی ارائه شده است. " +"ترتیب حل متدکه در اینجا مورد بحث قرار گرفته، در " +"Python 2.3 *معرفی* شد، اما همچنان در نسخه‌های بعدی — از جمله Python 3 — " +"استفاده می‌شود." msgid "By `Michele Simionato `__." -msgstr "" +msgstr "نوشته‌شده توسط `Michele Simionato `__." msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "*This document is intended for Python programmers who want to understand the C3 Method Resolution Order used in Python 2.3. Although it is not intended for newbies, it is quite pedagogical with many worked out examples. I am not aware of other publicly available documents with the same scope, therefore it should be useful.*" -msgstr "" +msgid "" +"*This document is intended for Python programmers who want to understand the" +" C3 Method Resolution Order used in Python 2.3. Although it is not intended " +"for newbies, it is quite pedagogical with many worked out examples. I am " +"not aware of other publicly available documents with the same scope, " +"therefore it should be useful.*" +msgstr "" +"*این سند برای برنامه‌نویسان پایتون در نظر گرفته شده است که می‌خواهند ترتیب " +"حل متد C3 (C3 Method Resolution Order) را که در پایتون 2.3 استفاده می‌شود، " +"درک کنند. اگرچه این سند برای تازه‌کاران در نظر گرفته نشده است، اما با " +"مثال‌های حل‌شده‌ی متعدد، کاملاً آموزشی است. من از اسناد دیگری که به‌صورت " +"عمومی در دسترس باشند و همان محدوده را داشته باشند، آگاه نیستم؛ بنابراین باید" +" مفید باشد.*" msgid "Disclaimer:" -msgstr "" +msgstr "سلب مسئولیت:" -msgid "*I donate this document to the Python Software Foundation, under the Python 2.3 license. As usual in these circumstances, I warn the reader that what follows* should *be correct, but I don't give any warranty. Use it at your own risk and peril!*" +msgid "" +"*I donate this document to the Python Software Foundation, under the Python " +"2.3 license. As usual in these circumstances, I warn the reader that what " +"follows* should *be correct, but I don't give any warranty. Use it at your " +"own risk and peril!*" msgstr "" +"*من این سند را تحت پروانه‌ی Python 2.3 به بنیاد نرم‌افزار پایتون اهدا " +"می‌کنم. همان‌طور که در این شرایط معمول است، به شما، خواننده، هشدار می‌دهم که" +" آنچه در ادامه می‌آید* باید *صحیح باشد، اما هیچ ضمانتی نمی‌دهم. با مسئولیت و" +" خطر خودتان از آن استفاده کنید!*" msgid "Acknowledgments:" -msgstr "" +msgstr "سپاسگزاری‌ها:" -msgid "*All the people of the Python mailing list who sent me their support. Paul Foley who pointed out various imprecisions and made me to add the part on local precedence ordering. David Goodger for help with the formatting in reStructuredText. David Mertz for help with the editing. Finally, Guido van Rossum who enthusiastically added this document to the official Python 2.3 home-page.*" -msgstr "" +msgid "" +"*All the people of the Python mailing list who sent me their support. Paul " +"Foley who pointed out various imprecisions and made me to add the part on " +"local precedence ordering. David Goodger for help with the formatting in " +"reStructuredText. David Mertz for help with the editing. Finally, Guido van " +"Rossum who enthusiastically added this document to the official Python 2.3 " +"home-page.*" +msgstr "" +"*همه‌ی افراد فهرست پستی پایتون که حمایت خود را برایم فرستادند. Paul Foley که " +"بی‌دقتی‌های مختلفی را گوشزد کرد و مرا بر آن داشت تا بخش مربوط به ترتیب " +"اولویت محلی را اضافه کنم. David Goodger برای کمک در قالب‌بندی در " +"reStructuredText. David Mertz برای کمک در ویرایش. در نهایت، Guido van Rossum" +" که با اشتیاق این سند را به صفحه‌ی اصلی رسمی پایتون 2.3 افزود.*" msgid "The beginning" -msgstr "" +msgstr "آغاز" msgid "*Felix qui potuit rerum cognoscere causas* -- Virgilius" -msgstr "" +msgstr "*خوشبخت کسی است که توانسته است علل چیزها را بشناسد* -- ویرژیل" -msgid "Everything started with a post by Samuele Pedroni to the Python development mailing list [#]_. In his post, Samuele showed that the Python 2.2 method resolution order is not monotonic and he proposed to replace it with the C3 method resolution order. Guido agreed with his arguments and therefore now Python 2.3 uses C3. The C3 method itself has nothing to do with Python, since it was invented by people working on Dylan and it is described in a paper intended for lispers [#]_. The present paper gives a (hopefully) readable discussion of the C3 algorithm for Pythonistas who want to understand the reasons for the change." -msgstr "" +msgid "" +"Everything started with a post by Samuele Pedroni to the Python development " +"mailing list [#]_. In his post, Samuele showed that the Python 2.2 method " +"resolution order is not monotonic and he proposed to replace it with the C3 " +"method resolution order. Guido agreed with his arguments and therefore now " +"Python 2.3 uses C3. The C3 method itself has nothing to do with Python, " +"since it was invented by people working on Dylan and it is described in a " +"paper intended for lispers [#]_. The present paper gives a (hopefully) " +"readable discussion of the C3 algorithm for Pythonistas who want to " +"understand the reasons for the change." +msgstr "" +"همه‌چیز با پیامی از Samuele Pedroni در فهرست ایمیلی توسعه پایتون آغاز شد " +"[#]_. در پیام خود، Samuele نشان داد که ترتیب حل متد (method resolution " +"order) در پایتون 2.2 یک‌نواخت نیست و پیشنهاد داد آن را با ترتیب حل متد C3 " +"جایگزین کند. Guido با استدلال‌های او موافقت کرد و بنابراین اکنون پایتون 2.3 " +"از C3 استفاده می‌کند. خود روش C3 هیچ ارتباطی به پایتون ندارد، زیرا توسط " +"افرادی که بر روی Dylan کار می‌کردند ابداع شده است و در مقاله‌ای که برای " +"برنامه‌نویسان Lisp در نظر گرفته شده است، توصیف شده است [#]_. مقاله حاضر بحثی" +" (امیدواریم) خواندنی از الگوریتم C3 را برای پایتون‌کاران (Pythonistas) ارائه" +" می‌دهد که می‌خواهند دلایل این تغییر را درک کنند." -msgid "First of all, let me point out that what I am going to say only applies to the *new style classes* introduced in Python 2.2: *classic classes* maintain their old method resolution order, depth first and then left to right. Therefore, there is no breaking of old code for classic classes; and even if in principle there could be breaking of code for Python 2.2 new style classes, in practice the cases in which the C3 resolution order differs from the Python 2.2 method resolution order are so rare that no real breaking of code is expected. Therefore:" -msgstr "" +msgid "" +"First of all, let me point out that what I am going to say only applies to " +"the *new style classes* introduced in Python 2.2: *classic classes* " +"maintain their old method resolution order, depth first and then left to " +"right. Therefore, there is no breaking of old code for classic classes; and" +" even if in principle there could be breaking of code for Python 2.2 new " +"style classes, in practice the cases in which the C3 resolution order " +"differs from the Python 2.2 method resolution order are so rare that no real" +" breaking of code is expected. Therefore:" +msgstr "" +"پیش از هر چیز، اجازه دهید اشاره کنم که آنچه می‌خواهم بگویم فقط در مورد " +"*کلاس‌های جدید* معرفی‌شده در Python 2.2 صدق می‌کند: *کلاس‌های کلاسیک* ترتیب " +"حل متد قدیمی خود، یعنی عمق‌اول و سپس چپ‌به‌راست، را حفظ می‌کنند. بنابراین، " +"برای کلاس‌های کلاسیک هیچ شکستی در کد قدیمی رخ نمی‌دهد؛ و حتی اگر از نظر " +"اصولی ممکن است شکستی در کد برای کلاس‌های جدید Python 2.2 وجود داشته باشد، در" +" عمل مواردی که ترتیب حل C3 با ترتیب حل متد Python 2.2 تفاوت دارد، آن‌قدر " +"نادر هستند که انتظار نمی‌رود هیچ شکست واقعی در کد رخ دهد. بنابراین:" msgid "*Don't be scared!*" -msgstr "" +msgstr "*نترسید!*" -msgid "Moreover, unless you make strong use of multiple inheritance and you have non-trivial hierarchies, you don't need to understand the C3 algorithm, and you can easily skip this paper. On the other hand, if you really want to know how multiple inheritance works, then this paper is for you. The good news is that things are not as complicated as you might expect." -msgstr "" +msgid "" +"Moreover, unless you make strong use of multiple inheritance and you have " +"non-trivial hierarchies, you don't need to understand the C3 algorithm, and " +"you can easily skip this paper. On the other hand, if you really want to " +"know how multiple inheritance works, then this paper is for you. The good " +"news is that things are not as complicated as you might expect." +msgstr "" +"علاوه بر این، مگر اینکه از وراثت چندگانه به‌طور گسترده استفاده کنید و " +"سلسله‌مراتب‌های غیربدیهی داشته باشید، نیازی نیست الگوریتم C3 را درک کنید و " +"می‌توانید به‌راحتی از این مقاله بگذرید. از سوی دیگر، اگر واقعاً می‌خواهید " +"بدانید که وراثت چندگانه چگونه کار می‌کند، این مقاله برای شماست. خبر خوب این " +"است که مسائل آن‌گونه که ممکن است انتظار داشته باشید، پیچیده نیستند." msgid "Let me begin with some basic definitions." -msgstr "" +msgstr "اجازه دهید با چند تعریف پایه آغاز کنم." -msgid "Given a class C in a complicated multiple inheritance hierarchy, it is a non-trivial task to specify the order in which methods are overridden, i.e. to specify the order of the ancestors of C." +msgid "" +"Given a class C in a complicated multiple inheritance hierarchy, it is a " +"non-trivial task to specify the order in which methods are overridden, i.e. " +"to specify the order of the ancestors of C." msgstr "" +"با داشتن یک کلاس C در یک سلسله‌مراتب پیچیده‌ی وراثت چندگانه، مشخص کردن ترتیبی" +" که متدها در آن بازنویسی (override) می‌شوند، یعنی مشخص کردن ترتیب اجداد C، " +"کار ساده‌ای نیست." -msgid "The list of the ancestors of a class C, including the class itself, ordered from the nearest ancestor to the furthest, is called the class precedence list or the *linearization* of C." +msgid "" +"The list of the ancestors of a class C, including the class itself, ordered " +"from the nearest ancestor to the furthest, is called the class precedence " +"list or the *linearization* of C." msgstr "" +"فهرست نیاکان یک کلاس C، شامل خود کلاس، که از نزدیک‌ترین نیاکان تا دورترین " +"مرتب شده باشد، فهرست تقدم کلاس یا *خطی‌سازی* C نامیده می‌شود." -msgid "The *Method Resolution Order* (MRO) is the set of rules that construct the linearization. In the Python literature, the idiom \"the MRO of C\" is also used as a synonymous for the linearization of the class C." +msgid "" +"The *Method Resolution Order* (MRO) is the set of rules that construct the " +"linearization. In the Python literature, the idiom \"the MRO of C\" is also" +" used as a synonymous for the linearization of the class C." msgstr "" +"*ترتیب حل متد* مجموعه‌ای از قوانین است که " +"خطی‌سازیرا تشکیل می‌دهد. در ادبیات پایتون، اصطلاح «the MRO " +"of C» نیز به‌عنوان مترادفی برای خطی‌سازی کلاس C به کار می‌رود." -msgid "For instance, in the case of single inheritance hierarchy, if C is a subclass of C1, and C1 is a subclass of C2, then the linearization of C is simply the list [C, C1 , C2]. However, with multiple inheritance hierarchies, the construction of the linearization is more cumbersome, since it is more difficult to construct a linearization that respects *local precedence ordering* and *monotonicity*." -msgstr "" +msgid "" +"For instance, in the case of single inheritance hierarchy, if C is a " +"subclass of C1, and C1 is a subclass of C2, then the linearization of C is " +"simply the list [C, C1 , C2]. However, with multiple inheritance " +"hierarchies, the construction of the linearization is more cumbersome, since" +" it is more difficult to construct a linearization that respects *local " +"precedence ordering* and *monotonicity*." +msgstr "" +"برای مثال، در مورد سلسله‌مراتب وراثت تکی، اگر C زیرکلاسی از C1 باشد و C1 " +"زیرکلاسی از C2 باشد، آنگاه خطی‌سازی C صرفاً فهرست [C, C1 , C2] است. با این " +"حال، در سلسله‌مراتب‌های وراثت چندگانه، ساختن خطی‌سازی دشوارتر است، زیرا " +"ساختن خطی‌سازی‌ای که *ترتیب تقدم محلی* و *یکنواختی* را رعایت کند، دشوارتر " +"است." -msgid "I will discuss the local precedence ordering later, but I can give the definition of monotonicity here. A MRO is monotonic when the following is true: *if C1 precedes C2 in the linearization of C, then C1 precedes C2 in the linearization of any subclass of C*. Otherwise, the innocuous operation of deriving a new class could change the resolution order of methods, potentially introducing very subtle bugs. Examples where this happens will be shown later." -msgstr "" +msgid "" +"I will discuss the local precedence ordering later, but I can give the " +"definition of monotonicity here. A MRO is monotonic when the following is " +"true: *if C1 precedes C2 in the linearization of C, then C1 precedes C2 in " +"the linearization of any subclass of C*. Otherwise, the innocuous operation " +"of deriving a new class could change the resolution order of methods, " +"potentially introducing very subtle bugs. Examples where this happens will " +"be shown later." +msgstr "" +"من ترتیب تقدم محلی را بعداً بررسی خواهم کرد، اما می‌توانم تعریف یک‌نواختی را" +" در اینجا ارائه دهم. یک MRO زمانی یک‌نواخت است که شرط زیر برقرار باشد: *اگر " +"C1 در خطی‌سازی C پیش از C2 بیاید، آنگاه C1 در خطی‌سازی هر زیرکلاسی از C پیش" +" از C2 خواهد آمد*. در غیر این صورت، عملیات بی‌ضرر اشتقاق یک کلاس جدید " +"می‌تواند ترتیب حل متدها را تغییر دهد و به‌طور بالقوه باعث ایجاد باگ‌های " +"بسیار ظریف شود. مثال‌هایی که در آن‌ها این اتفاق می‌افتد، بعداً نشان داده " +"خواهند شد." -msgid "Not all classes admit a linearization. There are cases, in complicated hierarchies, where it is not possible to derive a class such that its linearization respects all the desired properties." +msgid "" +"Not all classes admit a linearization. There are cases, in complicated " +"hierarchies, where it is not possible to derive a class such that its " +"linearization respects all the desired properties." msgstr "" +"همه‌ی کلاس‌ها یک خطی‌سازیرا نمی‌پذیرند. در سلسله‌مراتب‌های " +"پیچیده، مواردی وجود دارد که نمی‌توان کلاسی را مشتق کرد، به‌گونه‌ای که " +"خطی‌سازیآن همه‌ی ویژگی‌های مطلوب را رعایت کند." msgid "Here I give an example of this situation. Consider the hierarchy" msgstr "" +"در اینجا مثالی از این موقعیت ارائه می‌شود. سلسله‌مراتب را در نظر بگیرید" -msgid "which can be represented with the following inheritance graph, where I have denoted with O the ``object`` class, which is the beginning of any hierarchy for new style classes:" +msgid "" +"which can be represented with the following inheritance graph, where I have " +"denoted with O the ``object`` class, which is the beginning of any hierarchy" +" for new style classes:" msgstr "" +"که می‌توان آن را با نمودار وراثت زیر نمایش داد، که در آن کلاس ``object`` را " +"با O نشان داده‌ام، کلاسی که آغاز هر سلسله‌مراتبی برای کلاس‌های به‌سبک جدید " +"است:" msgid "" " -----------\n" @@ -107,93 +242,166 @@ msgid "" " \\ /\n" " ?" msgstr "" +" -----------\n" +"| |\n" +"| O |\n" +"| / \\ |\n" +" - X Y /\n" +" | / | /\n" +" | / |/\n" +" A B\n" +" \\ /\n" +" ?" -msgid "In this case, it is not possible to derive a new class C from A and B, since X precedes Y in A, but Y precedes X in B, therefore the method resolution order would be ambiguous in C." +msgid "" +"In this case, it is not possible to derive a new class C from A and B, since" +" X precedes Y in A, but Y precedes X in B, therefore the method resolution " +"order would be ambiguous in C." msgstr "" +"در این حالت، نمی‌توان یک کلاس جدید C را از A و B مشتق کرد، زیرا X در A پیش " +"از Y قرار دارد، اما Y در B پیش از X قرار دارد، بنابراین ترتیب حل متد (method" +" resolution order) در C مبهم خواهد بود." -msgid "Python 2.3 raises an exception in this situation (TypeError: MRO conflict among bases Y, X) forbidding the naive programmer from creating ambiguous hierarchies. Python 2.2 instead does not raise an exception, but chooses an *ad hoc* ordering (CABXYO in this case)." +msgid "" +"Python 2.3 raises an exception in this situation (TypeError: MRO conflict " +"among bases Y, X) forbidding the naive programmer from creating ambiguous " +"hierarchies. Python 2.2 instead does not raise an exception, but chooses an" +" *ad hoc* ordering (CABXYO in this case)." msgstr "" +"پایتون 2.3 در این شرایط یک استثنا پرتاب می‌کند (TypeError: MRO conflict " +"among bases Y, X) و برنامه‌نویس ناآگاه را از ایجاد سلسله‌مراتب‌های مبهم " +"بازمی‌دارد. پایتون 2.2 در عوض استثنا پرتاب نمی‌کند، بلکه یک ترتیب *موردی* را" +" انتخاب می‌کند (در این مورد CABXYO)." msgid "The C3 Method Resolution Order" -msgstr "" +msgstr "ترتیب حل متد C3" -msgid "Let me introduce a few simple notations which will be useful for the following discussion. I will use the shortcut notation::" +msgid "" +"Let me introduce a few simple notations which will be useful for the " +"following discussion. I will use the shortcut notation::" msgstr "" +"اجازه دهید چند نمادگذاری ساده را معرفی کنم که برای بحث پیش رو مفید خواهند " +"بود. من از نمادگذاری میان‌بر زیر استفاده خواهم کرد::" msgid "C1 C2 ... CN" -msgstr "" +msgstr "C1 C2 ... CN" msgid "to indicate the list of classes [C1, C2, ... , CN]." -msgstr "" +msgstr "برای نشان دادن فهرست کلاس‌ها [C1, C2, ... , CN]." msgid "The *head* of the list is its first element::" -msgstr "" +msgstr "*سر* فهرست، نخستین عنصر آن است::" msgid "head = C1" -msgstr "" +msgstr "head = C1" msgid "whereas the *tail* is the rest of the list::" -msgstr "" +msgstr "در حالی که *دم* باقی‌مانده‌ی فهرست است::" msgid "tail = C2 ... CN." -msgstr "" +msgstr "tail = C2 ... CN." msgid "I shall also use the notation::" -msgstr "" +msgstr "من همچنین از نمادگذاری زیر استفاده خواهم کرد::" msgid "C + (C1 C2 ... CN) = C C1 C2 ... CN" -msgstr "" +msgstr "C + (C1 C2 ... CN) = C C1 C2 ... CN" msgid "to denote the sum of the lists [C] + [C1, C2, ... ,CN]." -msgstr "" +msgstr "برای نشان دادن مجموع فهرست‌های [C] + [C1, C2, ... ,CN]." msgid "Now I can explain how the MRO works in Python 2.3." -msgstr "" +msgstr "اکنون می‌توانم توضیح دهم که MRO در پایتون 2.3 چگونه کار می‌کند." -msgid "Consider a class C in a multiple inheritance hierarchy, with C inheriting from the base classes B1, B2, ... , BN. We want to compute the linearization L[C] of the class C. The rule is the following:" +msgid "" +"Consider a class C in a multiple inheritance hierarchy, with C inheriting " +"from the base classes B1, B2, ... , BN. We want to compute the " +"linearization L[C] of the class C. The rule is the following:" msgstr "" +"کلاس C را در یک سلسله‌مراتب ارث چندگانه در نظر بگیرید، که در آن C از " +"کلاس‌های پایه B1، B2، ...، BN ارث می‌برد. می‌خواهیم خطی‌سازی " +" کلاس C یعنی L[C] را محاسبه کنیم. قاعده به این صورت است:" -msgid "*the linearization of C is the sum of C plus the merge of the linearizations of the parents and the list of the parents.*" +msgid "" +"*the linearization of C is the sum of C plus the merge of the linearizations" +" of the parents and the list of the parents.*" msgstr "" +"*خطی‌سازی C، حاصل‌جمع C به‌علاوه ادغام خطی‌سازی‌های والدین و فهرست والدین " +"است.*" msgid "In symbolic notation::" -msgstr "" +msgstr "در نمادگذاری نمادین::" msgid "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" -msgstr "" +msgstr "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" -msgid "In particular, if C is the ``object`` class, which has no parents, the linearization is trivial::" +msgid "" +"In particular, if C is the ``object`` class, which has no parents, the " +"linearization is trivial::" msgstr "" +"به‌ویژه، اگر C کلاس ``object`` باشد که هیچ والدی ندارد، خطی‌سازی بدیهی است::" msgid "L[object] = object." -msgstr "" +msgstr "L[object] = object." -msgid "However, in general one has to compute the merge according to the following prescription:" +msgid "" +"However, in general one has to compute the merge according to the following " +"prescription:" msgstr "" +"با این حال، به‌طور کلی باید ادغام را مطابق دستورالعمل زیر محاسبه کنید:" -msgid "*take the head of the first list, i.e L[B1][0]; if this head is not in the tail of any of the other lists, then add it to the linearization of C and remove it from the lists in the merge, otherwise look at the head of the next list and take it, if it is a good head. Then repeat the operation until all the class are removed or it is impossible to find good heads. In this case, it is impossible to construct the merge, Python 2.3 will refuse to create the class C and will raise an exception.*" -msgstr "" +msgid "" +"*take the head of the first list, i.e L[B1][0]; if this head is not in the " +"tail of any of the other lists, then add it to the linearization of C and " +"remove it from the lists in the merge, otherwise look at the head of the " +"next list and take it, if it is a good head. Then repeat the operation " +"until all the class are removed or it is impossible to find good heads. In " +"this case, it is impossible to construct the merge, Python 2.3 will refuse " +"to create the class C and will raise an exception.*" +msgstr "" +"*سر نخستین فهرست را بردارید، یعنی L[B1][0]؛ اگر این سر در دم هیچ‌یک از " +"فهرست‌های دیگر وجود نداشته باشد، آن را به خطی‌سازی C اضافه کنید و آن را از " +"فهرست‌های موجود در ادغام حذف کنید، در غیر این صورت، به سر فهرست بعدی نگاه " +"کنید و اگر سر مناسبی است، آن را بردارید. سپس این عمل را تکرار کنید تا همه " +"کلاس‌ها حذف شوند یا یافتن سرهای مناسب ممکن نباشد. در این حالت، ساخت ادغام " +"ممکن نیست؛ Python 2.3 از ایجاد کلاس C خودداری می‌کند و یک استثنا پرتاب " +"می‌کند.*" -msgid "This prescription ensures that the merge operation *preserves* the ordering, if the ordering can be preserved. On the other hand, if the order cannot be preserved (as in the example of serious order disagreement discussed above) then the merge cannot be computed." +msgid "" +"This prescription ensures that the merge operation *preserves* the ordering," +" if the ordering can be preserved. On the other hand, if the order cannot " +"be preserved (as in the example of serious order disagreement discussed " +"above) then the merge cannot be computed." msgstr "" +"این قاعده تضمین می‌کند که عملیات ادغام، ترتیب را *حفظ می‌کند*، اگر ترتیب " +"قابل حفظ باشد. از سوی دیگر، اگر ترتیب قابل حفظ نباشد (مانند مثال اختلاف جدی " +"در ترتیب که در بالا بحث شد)، آنگاه ادغام قابل محاسبه نیست." -msgid "The computation of the merge is trivial if C has only one parent (single inheritance); in this case::" +msgid "" +"The computation of the merge is trivial if C has only one parent (single " +"inheritance); in this case::" msgstr "" +"اگر C تنها یک والد داشته باشد (وراثت تکی)، محاسبه‌ی ادغام بسیار ساده است؛ در" +" این حالت::" msgid "L[C(B)] = C + merge(L[B],B) = C + L[B]" -msgstr "" +msgstr "L[C(B)] = C + merge(L[B],B) = C + L[B]" -msgid "However, in the case of multiple inheritance things are more cumbersome and I don't expect you can understand the rule without a couple of examples ;-)" +msgid "" +"However, in the case of multiple inheritance things are more cumbersome and " +"I don't expect you can understand the rule without a couple of examples ;-)" msgstr "" +"با این حال، در حالت وراثت چندگانه، موضوع پیچیده‌تر است و انتظار ندارم شما " +"بتوانید قاعده را بدون چند مثال درک کنید ;-)" msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "First example. Consider the following hierarchy:" -msgstr "" +msgstr "مثال اول. سلسله‌مراتب زیر را در نظر بگیرید:" msgid "In this case the inheritance graph can be drawn as:" -msgstr "" +msgstr "در این حالت می‌توان نمودار وراثت را به این شکل رسم کرد:" msgid "" " 6\n" @@ -218,9 +426,30 @@ msgid "" "Level 0 0 | A | (more specialized)\n" " ---" msgstr "" +" 6\n" +" ---\n" +"Level 3 | O | (کلی‌تر)\n" +" / --- \\\n" +" / | \\ |\n" +" / | \\ |\n" +" / | \\ |\n" +" --- --- --- |\n" +"Level 2 3 | D | 4| E | | F | 5 |\n" +" --- --- --- |\n" +" \\ \\ _ / | |\n" +" \\ / \\ _ | |\n" +" \\ / \\ | |\n" +" --- --- |\n" +"Level 1 1 | B | | C | 2 |\n" +" --- --- |\n" +" \\ / |\n" +" \\ / \\ /\n" +" ---\n" +"Level 0 0 | A | (تخصصی‌تر)\n" +" ---" msgid "The linearizations of O,D,E and F are trivial::" -msgstr "" +msgstr "خطی‌سازی‌های O، D، E و F بدیهی هستند::" msgid "" "L[O] = O\n" @@ -228,21 +457,35 @@ msgid "" "L[E] = E O\n" "L[F] = F O" msgstr "" +"L[O] = O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[F] = F O" msgid "The linearization of B can be computed as::" -msgstr "" +msgstr "خطی‌سازی B را می‌توان به‌صورت زیر محاسبه کرد::" msgid "L[B] = B + merge(DO, EO, DE)" -msgstr "" +msgstr "L[B] = B + merge(DO, EO, DE)" -msgid "We see that D is a good head, therefore we take it and we are reduced to compute ``merge(O,EO,E)``. Now O is not a good head, since it is in the tail of the sequence EO. In this case the rule says that we have to skip to the next sequence. Then we see that E is a good head; we take it and we are reduced to compute ``merge(O,O)`` which gives O. Therefore::" -msgstr "" +msgid "" +"We see that D is a good head, therefore we take it and we are reduced to " +"compute ``merge(O,EO,E)``. Now O is not a good head, since it is in the " +"tail of the sequence EO. In this case the rule says that we have to skip to" +" the next sequence. Then we see that E is a good head; we take it and we " +"are reduced to compute ``merge(O,O)`` which gives O. Therefore::" +msgstr "" +"می‌بینیم که D یک سر مناسب است، بنابراین آن را برمی‌داریم و مسئله به محاسبه‌ی " +"``merge(O,EO,E)`` تقلیل می‌یابد. اکنون O یک سر مناسب نیست، زیرا در دم دنباله" +" EO قرار دارد. در این حالت، قاعده می‌گوید که باید به دنباله بعدی برویم. سپس " +"می‌بینیم که E یک سر مناسب است؛ آن را برمی‌داریم و مسئله به محاسبه‌ی " +"``merge(O,O)`` تقلیل می‌یابد که O را می‌دهد. بنابراین::" msgid "L[B] = B D E O" -msgstr "" +msgstr "L[B] = B D E O" msgid "Using the same procedure one finds::" -msgstr "" +msgstr "با استفاده از همان روش، می‌توان یافت::" msgid "" "L[C] = C + merge(DO,FO,DF)\n" @@ -250,9 +493,13 @@ msgid "" " = C + D + F + merge(O,O)\n" " = C D F O" msgstr "" +"L[C] = C + merge(DO,FO,DF)\n" +" = C + D + merge(O,FO,F)\n" +" = C + D + F + merge(O,O)\n" +" = C D F O" msgid "Now we can compute::" -msgstr "" +msgstr "اکنون می‌توانیم محاسبه کنیم::" msgid "" "L[A] = A + merge(BDEO,CDFO,BC)\n" @@ -263,15 +510,39 @@ msgid "" " = A + B + C + D + E + F + merge(O,O)\n" " = A B C D E F O" msgstr "" +"L[A] = A + merge(BDEO,CDFO,BC)\n" +" = A + B + merge(DEO,CDFO,C)\n" +" = A + B + C + merge(DEO,DFO)\n" +" = A + B + C + D + merge(EO,FO)\n" +" = A + B + C + D + E + merge(O,FO)\n" +" = A + B + C + D + E + F + merge(O,O)\n" +" = A B C D E F O" -msgid "In this example, the linearization is ordered in a pretty nice way according to the inheritance level, in the sense that lower levels (i.e. more specialized classes) have higher precedence (see the inheritance graph). However, this is not the general case." +msgid "" +"In this example, the linearization is ordered in a pretty nice way according" +" to the inheritance level, in the sense that lower levels (i.e. more " +"specialized classes) have higher precedence (see the inheritance graph). " +"However, this is not the general case." msgstr "" +"در این مثال، خطی‌سازیبه‌شکلی بسیار مناسب بر اساس سطح " +"ارث‌بری مرتب شده است، به این معنا که سطوح پایین‌تر (یعنی کلاس‌های تخصصی‌تر) " +"اولویت بالاتری دارند (به نمودار ارث‌بری مراجعه کنید). با این حال، این حالت " +"کلی نیست." -msgid "I leave as an exercise for the reader to compute the linearization for my second example:" +msgid "" +"I leave as an exercise for the reader to compute the linearization for my " +"second example:" msgstr "" +"محاسبه‌ی خطی‌سازی دومین مثال خود را به‌عنوان تمرینی برای خواننده باقی " +"می‌گذارم:" -msgid "The only difference with the previous example is the change B(D,E) --> B(E,D); however even such a little modification completely changes the ordering of the hierarchy:" +msgid "" +"The only difference with the previous example is the change B(D,E) --> " +"B(E,D); however even such a little modification completely changes the " +"ordering of the hierarchy:" msgstr "" +"تنها تفاوت با مثال پیشین، تغییر B(D,E) --> B(E,D) است؛ با این حال حتی چنین " +"تغییر کوچکی نیز به‌طور کامل ترتیب سلسله‌مراتب را تغییر می‌دهد:" msgid "" " 6\n" @@ -296,15 +567,54 @@ msgid "" "Level 0 0 | A |\n" " ---" msgstr "" +" 6\n" +" ---\n" +"Level 3 | O |\n" +" / --- \\\n" +" / | \\\n" +" / | \\\n" +" / | \\\n" +" --- --- ---\n" +"Level 2 2 | E | 4 | D | | F | 5\n" +" --- --- ---\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" --- ---\n" +"Level 1 1 | B | | C | 3\n" +" --- ---\n" +" \\ /\n" +" \\ /\n" +" ---\n" +"Level 0 0 | A |\n" +" ---" -msgid "Notice that the class E, which is in the second level of the hierarchy, precedes the class C, which is in the first level of the hierarchy, i.e. E is more specialized than C, even if it is in a higher level." +msgid "" +"Notice that the class E, which is in the second level of the hierarchy, " +"precedes the class C, which is in the first level of the hierarchy, i.e. E " +"is more specialized than C, even if it is in a higher level." msgstr "" +"توجه داشته باشید که کلاس E، که در سطح دوم سلسله‌مراتب قرار دارد، بر کلاس C، " +"که در سطح اول سلسله‌مراتب قرار دارد، مقدم است؛ یعنی E حتی اگر در سطح بالاتری" +" باشد، تخصصی‌تر از C است." -msgid "A lazy programmer can obtain the MRO directly from Python 2.2, since in this case it coincides with the Python 2.3 linearization. It is enough to invoke the :meth:`~type.mro` method of class A:" +msgid "" +"A lazy programmer can obtain the MRO directly from Python 2.2, since in this" +" case it coincides with the Python 2.3 linearization. It is enough to " +"invoke the :meth:`~type.mro` method of class A:" msgstr "" +"یک برنامه‌نویس تنبل می‌تواند MRO را مستقیماً از Python 2.2 به دست آورد، زیرا" +" در این حالت با خطی‌سازی Python 2.3 منطبق است. کافی است متد " +":meth:`~type.mro` کلاس A را فراخوانی کنید:" -msgid "Finally, let me consider the example discussed in the first section, involving a serious order disagreement. In this case, it is straightforward to compute the linearizations of O, X, Y, A and B:" +msgid "" +"Finally, let me consider the example discussed in the first section, " +"involving a serious order disagreement. In this case, it is straightforward" +" to compute the linearizations of O, X, Y, A and B:" msgstr "" +"در نهایت، اجازه دهید مثال مطرح‌شده در بخش نخست را که شامل یک اختلاف جدی در " +"ترتیب است، در نظر بگیریم. در این حالت، محاسبه‌ی خطی‌سازی‌های O، X، Y، A و B " +"ساده است:" msgid "" "L[O] = 0\n" @@ -313,30 +623,59 @@ msgid "" "L[A] = A X Y O\n" "L[B] = B Y X O" msgstr "" +"L[O] = 0\n" +"L[X] = X O\n" +"L[Y] = Y O\n" +"L[A] = A X Y O\n" +"L[B] = B Y X O" -msgid "However, it is impossible to compute the linearization for a class C that inherits from A and B::" +msgid "" +"However, it is impossible to compute the linearization for a class C that " +"inherits from A and B::" msgstr "" +"با این حال، محاسبه‌ی خطی‌سازیبرای کلاس C که از A و B ارث‌بری" +" می‌کند، غیرممکن است::" msgid "" "L[C] = C + merge(AXYO, BYXO, AB)\n" " = C + A + merge(XYO, BYXO, B)\n" " = C + A + B + merge(XYO, YXO)" msgstr "" +"L[C] = C + merge(AXYO, BYXO, AB)\n" +" = C + A + merge(XYO, BYXO, B)\n" +" = C + A + B + merge(XYO, YXO)" -msgid "At this point we cannot merge the lists XYO and YXO, since X is in the tail of YXO whereas Y is in the tail of XYO: therefore there are no good heads and the C3 algorithm stops. Python 2.3 raises an error and refuses to create the class C." +msgid "" +"At this point we cannot merge the lists XYO and YXO, since X is in the tail " +"of YXO whereas Y is in the tail of XYO: therefore there are no good heads " +"and the C3 algorithm stops. Python 2.3 raises an error and refuses to " +"create the class C." msgstr "" +"در این نقطه نمی‌توانیم فهرست‌های XYO و YXO را ادغام کنیم، زیرا X در دم YXO " +"قرار دارد در حالی که Y در دم XYO قرار دارد: بنابراین هیچ سر مناسبی وجود " +"ندارد و الگوریتم C3 متوقف می‌شود. پایتون 2.3 خطایی پرتاب می‌کند و از ایجاد " +"کلاس C سرباز می‌زند." msgid "Bad Method Resolution Orders" -msgstr "" +msgstr "ترتیب‌های نامعتبر حل متد" -msgid "A MRO is *bad* when it breaks such fundamental properties as local precedence ordering and monotonicity. In this section, I will show that both the MRO for classic classes and the MRO for new style classes in Python 2.2 are bad." +msgid "" +"A MRO is *bad* when it breaks such fundamental properties as local " +"precedence ordering and monotonicity. In this section, I will show that " +"both the MRO for classic classes and the MRO for new style classes in Python" +" 2.2 are bad." msgstr "" +"یک MRO زمانی *بد* است که ویژگی‌های بنیادی مانند ترتیب تقدم محلی و یک‌نوایی " +"را نقض کند. در این بخش، نشان خواهم داد که هم MRO برای کلاس‌های کلاسیک و هم " +"MRO برای کلاس‌های به‌سبک جدید در Python 2.2 بد هستند." -msgid "It is easier to start with the local precedence ordering. Consider the following example:" -msgstr "" +msgid "" +"It is easier to start with the local precedence ordering. Consider the " +"following example:" +msgstr "شروع با ترتیب اولویت محلی آسان‌تر است. مثال زیر را در نظر بگیرید:" msgid "with inheritance diagram" -msgstr "" +msgstr "با نمودار وراثت" msgid "" " O\n" @@ -349,33 +688,81 @@ msgid "" "\n" " (buy eggs or spam ?)" msgstr "" +" O\n" +" |\n" +"(خرید اسپم) F\n" +" | \\\n" +" | E (خرید تخم‌مرغ)\n" +" | /\n" +" G\n" +"\n" +" (خرید تخم‌مرغ یا اسپم؟)" -msgid "We see that class G inherits from F and E, with F *before* E: therefore we would expect the attribute *G.remember2buy* to be inherited by *F.remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" +msgid "" +"We see that class G inherits from F and E, with F *before* E: therefore we " +"would expect the attribute *G.remember2buy* to be inherited by " +"*F.remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" msgstr "" +"می‌بینیم که کلاس G از F و E ارث می‌برد، به‌طوری که F *قبل از* E قرار دارد: " +"بنابراین انتظار داریم ویژگی *G.remember2buy* از *F.remember2buy* به‌ارث برده" +" شود و نه از *E.remember2buy*: با این حال Python 2.2 می‌دهد" -msgid "This is a breaking of local precedence ordering since the order in the local precedence list, i.e. the list of the parents of G, is not preserved in the Python 2.2 linearization of G::" +msgid "" +"This is a breaking of local precedence ordering since the order in the local" +" precedence list, i.e. the list of the parents of G, is not preserved in the" +" Python 2.2 linearization of G::" msgstr "" +"این نقض ترتیب تقدم محلی است، زیرا ترتیب در فهرست تقدم محلی، یعنی فهرست " +"والدین G، در خطی‌سازی G در پایتون 2.2 حفظ نمی‌شود::" msgid "L[G,P22]= G E F object # F *follows* E" -msgstr "" +msgstr "L[G,P22]= G E F object # F *follows* E" -msgid "One could argue that the reason why F follows E in the Python 2.2 linearization is that F is less specialized than E, since F is the superclass of E; nevertheless the breaking of local precedence ordering is quite non-intuitive and error prone. This is particularly true since it is a different from old style classes:" +msgid "" +"One could argue that the reason why F follows E in the Python 2.2 " +"linearization is that F is less specialized than E, since F is the " +"superclass of E; nevertheless the breaking of local precedence ordering is " +"quite non-intuitive and error prone. This is particularly true since it is " +"a different from old style classes:" msgstr "" +"می‌توان استدلال کرد که دلیل اینکه F در خطی‌سازیپایتون 2.2 " +"پس از E قرار می‌گیرد، این است که F نسبت به E کمتر تخصصی است، زیرا F ابرکلاس " +"E است؛ با این حال، نقض ترتیب تقدم محلی کاملاً غیرشهودی و مستعد خطا است. این " +"موضوع به‌ویژه از آن رو درست است که با کلاس‌های قدیمی‌سبک متفاوت است:" -msgid "In this case the MRO is GFEF and the local precedence ordering is preserved." -msgstr "" +msgid "" +"In this case the MRO is GFEF and the local precedence ordering is preserved." +msgstr "در این حالت، MRO برابر GFEF است و ترتیب اولویت محلی حفظ می‌شود." -msgid "As a general rule, hierarchies such as the previous one should be avoided, since it is unclear if F should override E or vice-versa. Python 2.3 solves the ambiguity by raising an exception in the creation of class G, effectively stopping the programmer from generating ambiguous hierarchies. The reason for that is that the C3 algorithm fails when the merge::" -msgstr "" +msgid "" +"As a general rule, hierarchies such as the previous one should be avoided, " +"since it is unclear if F should override E or vice-versa. Python 2.3 solves " +"the ambiguity by raising an exception in the creation of class G, " +"effectively stopping the programmer from generating ambiguous hierarchies. " +"The reason for that is that the C3 algorithm fails when the merge::" +msgstr "" +"به‌عنوان یک قاعده‌ی کلی، باید از سلسله‌مراتب‌هایی مانند مورد قبلی اجتناب کرد،" +" زیرا مشخص نیست که آیا F باید E را بازنویسی (override) کند یا برعکس. پایتون " +"2.3 این ابهام را با پرتاب یک استثنا هنگام ایجاد کلاس G حل می‌کند و عملاً " +"برنامه‌نویس را از تولید سلسله‌مراتب‌های مبهم باز می‌دارد. دلیل آن این است که" +" الگوریتم C3 هنگام ادغام (merge) شکست می‌خورد::" msgid "merge(FO,EFO,FE)" -msgstr "" +msgstr "merge(FO,EFO,FE)" -msgid "cannot be computed, because F is in the tail of EFO and E is in the tail of FE." -msgstr "" +msgid "" +"cannot be computed, because F is in the tail of EFO and E is in the tail of " +"FE." +msgstr "نمی‌تواند محاسبه شود، زیرا F در دم EFO و E در دم FE قرار دارد." -msgid "The real solution is to design a non-ambiguous hierarchy, i.e. to derive G from E and F (the more specific first) and not from F and E; in this case the MRO is GEF without any doubt." +msgid "" +"The real solution is to design a non-ambiguous hierarchy, i.e. to derive G " +"from E and F (the more specific first) and not from F and E; in this case " +"the MRO is GEF without any doubt." msgstr "" +"راه‌حل واقعی این است که یک سلسله‌مراتب غیرمبهم طراحی کنید، یعنی G را از E و " +"F (خاص‌تر در ابتدا) مشتق کنید، نه از F و E؛ در این حالت MRO بدون هیچ تردیدی " +"GEF خواهد بود." msgid "" " O\n" @@ -387,30 +774,69 @@ msgid "" " G\n" " (eggs, no doubt)" msgstr "" +" O\n" +" |\n" +" F (spam)\n" +" / |\n" +"(eggs) E |\n" +" \\ |\n" +" G\n" +" (eggs, no doubt)" -msgid "Python 2.3 forces the programmer to write good hierarchies (or, at least, less error-prone ones)." +msgid "" +"Python 2.3 forces the programmer to write good hierarchies (or, at least, " +"less error-prone ones)." msgstr "" +"پایتون 2.3 برنامه‌نویس را وادار می‌کند که سلسله‌مراتب‌های خوبی بنویسد (یا " +"دست‌کم، سلسله‌مراتب‌های کمتر مستعد خطا)." -msgid "On a related note, let me point out that the Python 2.3 algorithm is smart enough to recognize obvious mistakes, as the duplication of classes in the list of parents:" +msgid "" +"On a related note, let me point out that the Python 2.3 algorithm is smart " +"enough to recognize obvious mistakes, as the duplication of classes in the " +"list of parents:" msgstr "" +"در نکته‌ای مرتبط، اجازه دهید اشاره کنم که الگوریتم پایتون 2.3 به اندازه کافی" +" هوشمند است تا اشتباهات آشکار را، مانند تکرار کلاس‌ها در فهرست والدین، تشخیص" +" دهد:" -msgid "Python 2.2 (both for classic classes and new style classes) in this situation, would not raise any exception." +msgid "" +"Python 2.2 (both for classic classes and new style classes) in this " +"situation, would not raise any exception." msgstr "" +"پایتون 2.2 (هم برای کلاس‌های کلاسیک و هم برای کلاس‌های سبک جدید) در این " +"موقعیت، هیچ استثنایی را پرتاب نمی‌کرد." -msgid "Finally, I would like to point out two lessons we have learned from this example:" -msgstr "" +msgid "" +"Finally, I would like to point out two lessons we have learned from this " +"example:" +msgstr "در نهایت، مایلم به دو درسی که از این مثال آموخته‌ایم اشاره کنم:" -msgid "despite the name, the MRO determines the resolution order of attributes, not only of methods;" -msgstr "" +msgid "" +"despite the name, the MRO determines the resolution order of attributes, not" +" only of methods;" +msgstr "با وجود این نام، MRO ترتیب حل ویژگی‌ها را تعیین می‌کند، نه فقط متدها؛" -msgid "the default food for Pythonistas is spam ! (but you already knew that ;-)" +msgid "" +"the default food for Pythonistas is spam ! (but you already knew that ;-)" msgstr "" +"غذای پیش‌فرض پایتونیست‌ها اسپم است! (اما شما از قبل این موضوع را می‌دانستید " +";-)" -msgid "Having discussed the issue of local precedence ordering, let me now consider the issue of monotonicity. My goal is to show that neither the MRO for classic classes nor that for Python 2.2 new style classes is monotonic." +msgid "" +"Having discussed the issue of local precedence ordering, let me now consider" +" the issue of monotonicity. My goal is to show that neither the MRO for " +"classic classes nor that for Python 2.2 new style classes is monotonic." msgstr "" +"پس از بحث درباره‌ی موضوع ترتیب تقدم محلی، اکنون موضوع یکنواختی را بررسی " +"می‌کنم. هدف من این است که نشان دهم نه MRO کلاس‌های کلاسیک یکنواخت است و نه " +"MRO کلاس‌های سبک جدید Python 2.2." -msgid "To prove that the MRO for classic classes is non-monotonic is rather trivial, it is enough to look at the diamond diagram:" +msgid "" +"To prove that the MRO for classic classes is non-monotonic is rather " +"trivial, it is enough to look at the diamond diagram:" msgstr "" +"اثبات غیریک‌نواخت بودن ترتیب حل متد (MRO) برای کلاس‌های کلاسیک نسبتاً بدیهی " +"است؛ کافی است به نمودار الماسی نگاه کنید:" msgid "" " C\n" @@ -421,29 +847,62 @@ msgid "" " \\ /\n" " D" msgstr "" +" C\n" +" / \\\n" +" / \\\n" +"A B\n" +" \\ /\n" +" \\ /\n" +" D" msgid "One easily discerns the inconsistency::" -msgstr "" +msgstr "به‌راحتی می‌توان ناسازگاری را تشخیص داد::" msgid "" "L[B,P21] = B C # B precedes C : B's methods win\n" "L[D,P21] = D A C B C # B follows C : C's methods win!" msgstr "" +"L[B,P21] = B C # B پیش از C قرار دارد : متدهای B برنده می‌شوند\n" +"L[D,P21] = D A C B C # B پس از C قرار دارد : متدهای C برنده می‌شوند!" -msgid "On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, they give both::" +msgid "" +"On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, " +"they give both::" msgstr "" +"از سوی دیگر، هیچ مشکلی با MROهای پایتون 2.2 و 2.3 وجود ندارد، آن‌ها هر دو را" +" ارائه می‌دهند::" msgid "L[D] = D A B C" -msgstr "" +msgstr "L[D] = D A B C" -msgid "Guido points out in his essay [#]_ that the classic MRO is not so bad in practice, since one can typically avoids diamonds for classic classes. But all new style classes inherit from ``object``, therefore diamonds are unavoidable and inconsistencies shows up in every multiple inheritance graph." +msgid "" +"Guido points out in his essay [#]_ that the classic MRO is not so bad in " +"practice, since one can typically avoids diamonds for classic classes. But " +"all new style classes inherit from ``object``, therefore diamonds are " +"unavoidable and inconsistencies shows up in every multiple inheritance " +"graph." msgstr "" +"گیدو در مقاله‌ی خود [#]_ اشاره می‌کند که MRO کلاسیک در عمل آن‌قدرها هم بد " +"نیست، زیرا معمولاً می‌توان در کلاس‌های کلاسیک از الماس‌ها اجتناب کرد. اما " +"همه‌ی کلاس‌های جدید از ``object`` ارث می‌برند، بنابراین الماس‌ها " +"اجتناب‌ناپذیرند و ناهماهنگی‌ها در هر گراف وراثت چندگانه آشکار می‌شوند." -msgid "The MRO of Python 2.2 makes breaking monotonicity difficult, but not impossible. The following example, originally provided by Samuele Pedroni, shows that the MRO of Python 2.2 is non-monotonic:" +msgid "" +"The MRO of Python 2.2 makes breaking monotonicity difficult, but not " +"impossible. The following example, originally provided by Samuele Pedroni, " +"shows that the MRO of Python 2.2 is non-monotonic:" msgstr "" +"MRO در پایتون 2.2 نقض یکنواختی را دشوار می‌سازد، اما آن را غیرممکن نمی‌کند. " +"مثال زیر، که در اصل توسط Samuele Pedroni ارائه شده است، نشان می‌دهد که MRO " +"در پایتون 2.2 یکنواخت نیست:" -msgid "Here are the linearizations according to the C3 MRO (the reader should verify these linearizations as an exercise and draw the inheritance diagram ;-) ::" +msgid "" +"Here are the linearizations according to the C3 MRO (the reader should " +"verify these linearizations as an exercise and draw the inheritance diagram " +";-) ::" msgstr "" +"در اینجا خطی‌سازی‌ها بر اساس C3 MRO آمده‌اند (شما باید این خطی‌سازی‌ها را " +"به‌عنوان تمرین صحت‌سنجی کنید و نمودار وراثت را رسم کنید ;-) ::" msgid "" "L[A] = A O\n" @@ -456,21 +915,70 @@ msgid "" "L[K3]= K3 D A O\n" "L[Z] = Z K1 K2 K3 D A B C E O" msgstr "" +"L[A] = A O\n" +"L[B] = B O\n" +"L[C] = C O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[K1]= K1 A B C O\n" +"L[K2]= K2 D B E O\n" +"L[K3]= K3 D A O\n" +"L[Z] = Z K1 K2 K3 D A B C E O" -msgid "Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 and K3, but a different linearization for Z::" +msgid "" +"Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 " +"and K3, but a different linearization for Z::" msgstr "" +"پایتون 2.2 دقیقاً همان خطی‌سازی‌ها را برای A، B، C، D، E، K1، K2 و K3 ارائه " +"می‌دهد، اما خطی‌سازی متفاوتی برای Z::" msgid "L[Z,P22] = Z K1 K3 A K2 D B C E O" -msgstr "" +msgstr "L[Z,P22] = Z K1 K3 A K2 D B C E O" -msgid "It is clear that this linearization is *wrong*, since A comes before D whereas in the linearization of K3 A comes *after* D. In other words, in K3 methods derived by D override methods derived by A, but in Z, which still is a subclass of K3, methods derived by A override methods derived by D! This is a violation of monotonicity. Moreover, the Python 2.2 linearization of Z is also inconsistent with local precedence ordering, since the local precedence list of the class Z is [K1, K2, K3] (K2 precedes K3), whereas in the linearization of Z K2 *follows* K3. These problems explain why the 2.2 rule has been dismissed in favor of the C3 rule." -msgstr "" +msgid "" +"It is clear that this linearization is *wrong*, since A comes before D " +"whereas in the linearization of K3 A comes *after* D. In other words, in K3 " +"methods derived by D override methods derived by A, but in Z, which still is" +" a subclass of K3, methods derived by A override methods derived by D! This" +" is a violation of monotonicity. Moreover, the Python 2.2 linearization of " +"Z is also inconsistent with local precedence ordering, since the local " +"precedence list of the class Z is [K1, K2, K3] (K2 precedes K3), whereas in " +"the linearization of Z K2 *follows* K3. These problems explain why the 2.2 " +"rule has been dismissed in favor of the C3 rule." +msgstr "" +"واضح است که این خطی‌سازی *نادرست* است، زیرا A پیش از D " +"می‌آید، در حالی که در خطی‌سازی K3، A *پس از* D می‌آید. به بیان دیگر، در K3، " +"متدهای مشتق‌شده از D، متدهای مشتق‌شده از A را بازتعریف می‌کنند، اما در Z، که" +" همچنان زیرکلاسی از K3 است، متدهای مشتق‌شده از A، متدهای مشتق‌شده از D را " +"بازتعریف می‌کنند! این نقض یکنواختی (monotonicity) است. علاوه بر این، " +"خطی‌سازی Z در پایتون 2.2 نیز با ترتیب تقدم محلی (local precedence ordering) " +"ناسازگار است، زیرا فهرست تقدم محلی کلاس Z [K1, K2, K3] است (K2 پیش از K3 " +"می‌آید)، در حالی که در خطی‌سازی Z، K2 *پس از* K3 می‌آید. این مشکلات توضیح " +"می‌دهند که چرا قانون 2.2 به نفع قانون C3 کنار گذاشته شده است." msgid "The end" -msgstr "" +msgstr "پایان" -msgid "This section is for the impatient reader, who skipped all the previous sections and jumped immediately to the end. This section is for the lazy programmer too, who didn't want to exercise her/his brain. Finally, it is for the programmer with some hubris, otherwise s/he would not be reading a paper on the C3 method resolution order in multiple inheritance hierarchies ;-) These three virtues taken all together (and *not* separately) deserve a prize: the prize is a short Python 2.2 script that allows you to compute the 2.3 MRO without risk to your brain. Simply change the last line to play with the various examples I have discussed in this paper.::" -msgstr "" +msgid "" +"This section is for the impatient reader, who skipped all the previous " +"sections and jumped immediately to the end. This section is for the lazy " +"programmer too, who didn't want to exercise her/his brain. Finally, it is " +"for the programmer with some hubris, otherwise s/he would not be reading a " +"paper on the C3 method resolution order in multiple inheritance hierarchies " +";-) These three virtues taken all together (and *not* separately) deserve a " +"prize: the prize is a short Python 2.2 script that allows you to compute " +"the 2.3 MRO without risk to your brain. Simply change the last line to play" +" with the various examples I have discussed in this paper.::" +msgstr "" +"این بخش برای خواننده‌ی عجولی است که همه‌ی بخش‌های پیشین را رد کرده و " +"بلافاصله به انتها پریده است. این بخش برای برنامه‌نویس تنبل نیز هست که " +"نمی‌خواست مغز خود را ورزش دهد. سرانجام، این بخش برای برنامه‌نویسی است که کمی" +" غرور دارد، وگرنه او مقاله‌ای درباره‌ی ترتیب حل متد C3 در سلسله‌مراتب‌های " +"ارث‌بری چندگانه نمی‌خواند ;-) این سه فضیلت در کنار هم (و *نه* به‌طور " +"جداگانه) شایسته‌ی یک جایزه هستند: جایزه یک اسکریپت کوتاه پایتون 2.2 است که " +"به شما امکان می‌دهد MRO 2.3 را بدون خطر برای مغزتان محاسبه کنید. به‌سادگی خط" +" آخر را تغییر دهید تا با مثال‌های مختلفی که در این مقاله به آن‌ها پرداخته‌ام" +" بازی کنید.::" msgid "" "#\n" @@ -555,21 +1063,114 @@ msgid "" "\n" "#" msgstr "" +"#\n" +"\n" +"\"\"\"C3 algorithm by Samuele Pedroni (with readability enhanced by me).\"\"\"\n" +"\n" +"class __metaclass__(type):\n" +" \"All classes are metamagically modified to be nicely printed\"\n" +" __repr__ = lambda cls: cls.__name__\n" +"\n" +"class ex_2:\n" +" \"Serious order disagreement\" #From Guido\n" +" class O: pass\n" +" class X(O): pass\n" +" class Y(O): pass\n" +" class A(X,Y): pass\n" +" class B(Y,X): pass\n" +" try:\n" +" class Z(A,B): pass #creates Z(A,B) in Python 2.2\n" +" except TypeError:\n" +" pass # Z(A,B) cannot be created in Python 2.3\n" +"\n" +"class ex_5:\n" +" \"My first example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(D,E): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_6:\n" +" \"My second example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(E,D): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_9:\n" +" \"Difference between Python 2.2 MRO and C3\" #From Samuele\n" +" class O: pass\n" +" class A(O): pass\n" +" class B(O): pass\n" +" class C(O): pass\n" +" class D(O): pass\n" +" class E(O): pass\n" +" class K1(A,B,C): pass\n" +" class K2(D,B,E): pass\n" +" class K3(D,A): pass\n" +" class Z(K1,K2,K3): pass\n" +"\n" +"def merge(seqs):\n" +" print '\\n\\nCPL[%s]=%s' % (seqs[0][0],seqs),\n" +" res = []; i=0\n" +" while 1:\n" +" nonemptyseqs=[seq for seq in seqs if seq]\n" +" if not nonemptyseqs: return res\n" +" i+=1; print '\\n',i,'round: candidates...',\n" +" for seq in nonemptyseqs: # find merge candidates among seq heads\n" +" cand = seq[0]; print ' ',cand,\n" +" nothead=[s for s in nonemptyseqs if cand in s[1:]]\n" +" if nothead: cand=None #reject candidate\n" +" else: break\n" +" if not cand: raise \"Inconsistent hierarchy\"\n" +" res.append(cand)\n" +" for seq in nonemptyseqs: # remove cand\n" +" if seq[0] == cand: del seq[0]\n" +"\n" +"def mro(C):\n" +" \"Compute the class precedence list (mro) according to C3\"\n" +" return merge([[C]]+map(mro,C.__bases__)+[list(C.__bases__)])\n" +"\n" +"def print_mro(C):\n" +" print '\\nMRO[%s]=%s' % (C,mro(C))\n" +" print '\\nP22 MRO[%s]=%s' % (C,C.mro())\n" +"\n" +"print_mro(ex_9.Z)\n" +"\n" +"#" msgid "That's all folks," -msgstr "" +msgstr "همین و بس، دوستان،" msgid "enjoy !" -msgstr "" +msgstr "لذت ببرید!" msgid "Resources" -msgstr "" +msgstr "منابع" -msgid "The thread on python-dev started by Samuele Pedroni: https://mail.python.org/pipermail/python-dev/2002-October/029035.html" +msgid "" +"The thread on python-dev started by Samuele Pedroni: " +"https://mail.python.org/pipermail/python-dev/2002-October/029035.html" msgstr "" +"رشته‌ی python-dev که Samuele Pedroni آن را آغاز کرد: " +"https://mail.python.org/pipermail/python-dev/2002-October/029035.html" -msgid "The paper *A Monotonic Superclass Linearization for Dylan*: https://doi.org/10.1145/236337.236343" +msgid "" +"The paper *A Monotonic Superclass Linearization for Dylan*: " +"https://doi.org/10.1145/236337.236343" msgstr "" +"مقاله‌ی *A Monotonic Superclass Linearization for Dylan*: " +"https://doi.org/10.1145/236337.236343" -msgid "Guido van Rossum's essay, *Unifying types and classes in Python 2.2*: https://web.archive.org/web/20140210194412/http://www.python.org/download/releases/2.2.2/descrintro" +msgid "" +"Guido van Rossum's essay, *Unifying types and classes in Python 2.2*: " +"https://web.archive.org/web/20140210194412/http://www.python.org/download/releases/2.2.2/descrintro" msgstr "" +"مقاله‌ی گیدو ون روسوم، *یکپارچه‌سازی نوع‌ها و کلاس‌ها در Python 2.2*: " +"https://web.archive.org/web/20140210194412/http://www.python.org/download/releases/2.2.2/descrintro" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index a1f5bcf2b..f993636a0 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -24,28 +24,65 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Python support for the Linux ``perf`` profiler" -msgstr "" +msgstr "پشتیبانی پایتون از نمایه‌ساز ``perf`` لینوکس" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "Pablo Galindo" -msgstr "" +msgstr "پابلو گالیندو" -msgid "`The Linux perf profiler `_ is a very powerful tool that allows you to profile and obtain information about the performance of your application. ``perf`` also has a very vibrant ecosystem of tools that aid with the analysis of the data that it produces." +msgid "" +"`The Linux perf profiler `_ is a very powerful" +" tool that allows you to profile and obtain information about the " +"performance of your application. ``perf`` also has a very vibrant ecosystem " +"of tools that aid with the analysis of the data that it produces." msgstr "" +"`پروفایلر perf لینوکس `_ ابزاری بسیار قدرتمند " +"است که به شما امکان می‌دهد برنامه‌ی خود را پروفایل کنید و اطلاعاتی درباره‌ی " +"عملکرد آن به دست آورید. ``perf`` همچنین اکوسیستم بسیار پویایی از ابزارها " +"دارد که به تحلیل داده‌هایی که تولید می‌کند کمک می‌کنند." -msgid "The main problem with using the ``perf`` profiler with Python applications is that ``perf`` only gets information about native symbols, that is, the names of functions and procedures written in C. This means that the names and file names of Python functions in your code will not appear in the output of ``perf``." +msgid "" +"The main problem with using the ``perf`` profiler with Python applications " +"is that ``perf`` only gets information about native symbols, that is, the " +"names of functions and procedures written in C. This means that the names " +"and file names of Python functions in your code will not appear in the " +"output of ``perf``." msgstr "" +"مشکل اصلی استفاده از پروفایلر (profiler) ``perf`` در برنامه‌های پایتونی این " +"است که ``perf`` فقط اطلاعاتی درباره‌ی نمادهای بومی دریافت می‌کند، یعنی نام " +"توابع و رویه‌هایی که به زبان C نوشته شده‌اند. این بدان معناست که نام توابع " +"پایتونی و نام فایل‌های آن‌ها در کد شما، در خروجی ``perf`` ظاهر نخواهند شد." -msgid "Since Python 3.12, the interpreter can run in a special mode that allows Python functions to appear in the output of the ``perf`` profiler. When this mode is enabled, the interpreter will interpose a small piece of code compiled on the fly before the execution of every Python function and it will teach ``perf`` the relationship between this piece of code and the associated Python function using :doc:`perf map files <../c-api/perfmaps>`." -msgstr "" +msgid "" +"Since Python 3.12, the interpreter can run in a special mode that allows " +"Python functions to appear in the output of the ``perf`` profiler. When this" +" mode is enabled, the interpreter will interpose a small piece of code " +"compiled on the fly before the execution of every Python function and it " +"will teach ``perf`` the relationship between this piece of code and the " +"associated Python function using :doc:`perf map files <../c-api/perfmaps>`." +msgstr "" +"از پایتون 3.12، مفسر می‌تواند در حالت ویژه‌ای اجرا شود که به توابع پایتون " +"اجازه می‌دهد در خروجی پروفایلر ``perf`` ظاهر شوند. هنگامی که این حالت فعال " +"باشد، مفسر پیش از اجرای هر تابع پایتون، یک قطعه‌کد کوچک را که در لحظه " +"کامپایل می‌شود، درج می‌کند و با استفاده از :doc:`perf map files " +"<../c-api/perfmaps>`، رابطه بین این قطعه‌کد و تابع پایتون مرتبط را به " +"``perf`` می‌آموزد." -msgid "Support for the ``perf`` profiler is currently only available for Linux on select architectures. Check the output of the ``configure`` build step or check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to see if your system is supported." +msgid "" +"Support for the ``perf`` profiler is currently only available for Linux on " +"select architectures. Check the output of the ``configure`` build step or " +"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to " +"see if your system is supported." msgstr "" +"پشتیبانی از پروفایلر (profiler) ``perf`` در حال حاضر فقط برای لینوکس در " +"معماری‌های منتخب در دسترس است. برای اینکه ببینید آیا سیستم شما پشتیبانی " +"می‌شود، خروجی مرحله‌ی ساخت ``configure`` یا خروجی ``python -m sysconfig | " +"grep HAVE_PERF_TRAMPOLINE`` را بررسی کنید." msgid "For example, consider the following script:" -msgstr "" +msgstr "برای مثال، اسکریپت زیر را در نظر بگیرید:" msgid "" "def foo(n):\n" @@ -63,15 +100,31 @@ msgid "" "if __name__ == \"__main__\":\n" " baz(1000000)" msgstr "" +"def foo(n):\n" +" result = 0\n" +" for _ in range(n):\n" +" result += 1\n" +" return result\n" +"\n" +"def bar(n):\n" +" foo(n)\n" +"\n" +"def baz(n):\n" +" bar(n)\n" +"\n" +"if __name__ == \"__main__\":\n" +" baz(1000000)" msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" msgstr "" +"می‌توانیم ``perf`` را برای نمونه‌برداری از ردگیری‌های پشته‌ی CPU با نرخ ۹۹۹۹ " +"هرتز اجرا کنیم::" msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" -msgstr "" +msgstr "$ perf record -F 9999 -g -o perf.data python my_script.py" msgid "Then we can use ``perf report`` to analyze the data:" -msgstr "" +msgstr "سپس می‌توانید از ``perf report`` برای تحلیل داده‌ها استفاده کنید:" msgid "" "$ perf report --stdio -n -g\n" @@ -111,12 +164,61 @@ msgid "" " | | | | | |--2.97%--_PyObject_Malloc\n" "..." msgstr "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. ..........................................\n" +"#\n" +" 91.08% 0.00% 0 python.exe python.exe [.] _start\n" +" |\n" +" ---_start\n" +" |\n" +" --90.71%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--56.88%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--56.13%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--55.02%--run_mod\n" +" | | | |\n" +" | | | --54.65%--PyEval_EvalCode\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | |\n" +" | | | |--51.67%--_PyEval_EvalFrameDefault\n" +" | | | | |\n" +" | | | | |--11.52%--_PyLong_Add\n" +" | | | | | |\n" +" | | | | | |--2.97%--_PyObject_Malloc\n" +"..." -msgid "As you can see, the Python functions are not shown in the output, only ``_PyEval_EvalFrameDefault`` (the function that evaluates the Python bytecode) shows up. Unfortunately that's not very useful because all Python functions use the same C function to evaluate bytecode so we cannot know which Python function corresponds to which bytecode-evaluating function." -msgstr "" +msgid "" +"As you can see, the Python functions are not shown in the output, only " +"``_PyEval_EvalFrameDefault`` (the function that evaluates the Python " +"bytecode) shows up. Unfortunately that's not very useful because all Python " +"functions use the same C function to evaluate bytecode so we cannot know " +"which Python function corresponds to which bytecode-evaluating function." +msgstr "" +"همان‌طور که می‌بینید، توابع پایتون در خروجی نمایش داده نمی‌شوند و تنها " +"``_PyEval_EvalFrameDefault`` (تابعی که بایت‌کد پایتون را ارزیابی می‌کند) " +"نمایش داده می‌شود. متأسفانه این موضوع چندان مفید نیست، زیرا تمام توابع " +"پایتون برای ارزیابی بایت‌کد از یک تابع C یکسان استفاده می‌کنند؛ بنابراین " +"نمی‌توانیم بدانیم کدام تابع پایتون با کدام تابع ارزیابی بایت‌کد متناظر است." -msgid "Instead, if we run the same experiment with ``perf`` support enabled we get:" +msgid "" +"Instead, if we run the same experiment with ``perf`` support enabled we get:" msgstr "" +"در عوض، اگر همان آزمایش را با فعال بودن پشتیبانی ``perf`` اجرا کنیم، به این " +"نتیجه می‌رسیم:" msgid "" "$ perf report --stdio -n -g\n" @@ -159,34 +261,90 @@ msgid "" " | | | | | |\n" " | | | | | |--3.26%--_PyObject_Malloc" msgstr "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. .....................................................................\n" +"#\n" +" 90.58% 0.36% 1 python.exe python.exe [.] _start\n" +" |\n" +" ---_start\n" +" |\n" +" --89.86%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--55.43%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--54.71%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--53.62%--run_mod\n" +" | | | |\n" +" | | | --53.26%--PyEval_EvalCode\n" +" | | | py:::/src/script.py\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | py::baz:/src/script.py\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | py::bar:/src/script.py\n" +" | | | _PyEval_EvalFrameDefault\n" +" | | | PyObject_Vectorcall\n" +" | | | _PyEval_Vector\n" +" | | | py::foo:/src/script.py\n" +" | | | |\n" +" | | | |--51.81%--_PyEval_EvalFrameDefault\n" +" | | | | |\n" +" | | | | |--13.77%--_PyLong_Add\n" +" | | | | | |\n" +" | | | | | |--3.26%--_PyObject_Malloc" msgid "How to enable ``perf`` profiling support" -msgstr "" +msgstr "چگونه پشتیبانی از پروفایل‌گیری ``perf`` را فعال کنیم" -msgid "``perf`` profiling support can be enabled either from the start using the environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :func:`sys.deactivate_stack_trampoline`." +msgid "" +"``perf`` profiling support can be enabled either from the start using the " +"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf " +"<-X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and" +" :func:`sys.deactivate_stack_trampoline`." msgstr "" +"می‌توان پشتیبانی از پروفایل‌گیری (profiling) ``perf`` را یا از ابتدا با " +"استفاده از متغیر محیطی :envvar:`PYTHONPERFSUPPORT` یا گزینه‌ی :option:`-X " +"perf <-X>`، یا به‌صورت پویا با استفاده از " +":func:`sys.activate_stack_trampoline` و " +":func:`sys.deactivate_stack_trampoline` فعال کرد." -msgid "The :mod:`!sys` functions take precedence over the :option:`!-X` option, the :option:`!-X` option takes precedence over the environment variable." +msgid "" +"The :mod:`!sys` functions take precedence over the :option:`!-X` option, the" +" :option:`!-X` option takes precedence over the environment variable." msgstr "" +"توابع :mod:`!sys` بر گزینه‌ی :option:`!-X` اولویت دارند، گزینه‌ی :option:`!-X`" +" بر متغیر محیطی اولویت دارد." msgid "Example, using the environment variable::" -msgstr "" +msgstr "مثال، با استفاده از متغیر محیطی::" msgid "" "$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script.py\n" "$ perf report -g -i perf.data" msgstr "" +"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script.py\n" +"$ perf report -g -i perf.data" msgid "Example, using the :option:`!-X` option::" -msgstr "" +msgstr "مثال، با استفاده از گزینه :option:`!-X`::" msgid "" "$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" "$ perf report -g -i perf.data" msgstr "" +"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" +"$ perf report -g -i perf.data" msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" -msgstr "" +msgstr "مثال، استفاده از APIهای :mod:`sys` در فایل :file:`example.py`:" msgid "" "import sys\n" @@ -197,86 +355,220 @@ msgid "" "\n" "non_profiled_stuff()" msgstr "" +"import sys\n" +"\n" +"sys.activate_stack_trampoline(\"perf\")\n" +"do_profiled_stuff()\n" +"sys.deactivate_stack_trampoline()\n" +"\n" +"non_profiled_stuff()" msgid "...then::" -msgstr "" +msgstr "...سپس::" msgid "" "$ perf record -F 9999 -g -o perf.data python ./example.py\n" "$ perf report -g -i perf.data" msgstr "" +"$ perf record -F 9999 -g -o perf.data python ./example.py\n" +"$ perf report -g -i perf.data" msgid "How to obtain the best results" -msgstr "" +msgstr "چگونه بهترین نتایج را به دست آوریم" -msgid "For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind using only the frame pointer and not on DWARF debug information. This is because as the code that is interposed to allow ``perf`` support is dynamically generated it doesn't have any DWARF debugging information available." -msgstr "" +msgid "" +"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" +"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " +"using only the frame pointer and not on DWARF debug information. This is " +"because as the code that is interposed to allow ``perf`` support is " +"dynamically generated it doesn't have any DWARF debugging information " +"available." +msgstr "" +"برای رسیدن به بهترین نتایج، پایتون باید با ``CFLAGS=\"-fno-omit-frame-" +"pointer -mno-omit-leaf-frame-pointer\"`` کامپایل شود، زیرا این کار به " +"ابزارهای پروفایل‌گیری (profilers) اجازه می‌دهد تا فقط با استفاده از اشاره‌گر" +" قاب (frame pointer) و بدون اتکا به اطلاعات اشکال‌زدایی DWARF، پشته را باز " +"کنند (unwind). دلیل این امر آن است که چون کدی که برای امکان‌پذیر کردن " +"پشتیبانی از ``perf`` میان‌گذاری می‌شود به‌صورت پویا تولید می‌شود، هیچ " +"اطلاعات اشکال‌زدایی DWARF برای آن در دسترس نیست." -msgid "You can check if your system has been compiled with this flag by running::" +msgid "" +"You can check if your system has been compiled with this flag by running::" msgstr "" +"می‌توانید با اجرای دستور زیر بررسی کنید که آیا سیستم شما با این پرچم کامپایل" +" شده است::" msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'" -msgstr "" +msgstr "$ python -m sysconfig | grep 'no-omit-frame-pointer'" -msgid "If you don't see any output it means that your interpreter has not been compiled with frame pointers and therefore it may not be able to show Python functions in the output of ``perf``." +msgid "" +"If you don't see any output it means that your interpreter has not been " +"compiled with frame pointers and therefore it may not be able to show Python" +" functions in the output of ``perf``." msgstr "" +"اگر هیچ خروجی نمی‌بینید، به این معناست که مفسر شما با اشاره‌گرهای قاب (frame" +" pointers) کامپایل نشده است و بنابراین ممکن است نتواند توابع پایتون را در " +"خروجی ``perf`` نمایش دهد." msgid "How to work without frame pointers" -msgstr "" +msgstr "چگونه بدون اشاره‌گرهای فریمکار کنیم" -msgid "If you are working with a Python interpreter that has been compiled without frame pointers, you can still use the ``perf`` profiler, but the overhead will be a bit higher because Python needs to generate unwinding information for every Python function call on the fly. Additionally, ``perf`` will take more time to process the data because it will need to use the DWARF debugging information to unwind the stack and this is a slow process." -msgstr "" +msgid "" +"If you are working with a Python interpreter that has been compiled without " +"frame pointers, you can still use the ``perf`` profiler, but the overhead " +"will be a bit higher because Python needs to generate unwinding information " +"for every Python function call on the fly. Additionally, ``perf`` will take " +"more time to process the data because it will need to use the DWARF " +"debugging information to unwind the stack and this is a slow process." +msgstr "" +"اگر با مفسر پایتونی کار می‌کنید که بدون اشاره‌گرهای فریم " +"کامپایل شده است، همچنان می‌توانید از پروفایلر ``perf`` استفاده کنید، اما " +"سربار آن کمی بیشتر خواهد بود، زیرا پایتون باید برای هر فراخوانی تابع پایتون،" +" اطلاعات باز کردن پشته (unwinding) را در لحظه تولید کند. علاوه بر این، " +"``perf`` برای پردازش داده‌ها زمان بیشتری نیاز خواهد داشت، زیرا باید از " +"اطلاعات اشکال‌زدایی DWARF برای باز کردن پشته استفاده کند و این فرآیندی کند " +"است." -msgid "To enable this mode, you can use the environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which will enable the JIT mode for the ``perf`` profiler." +msgid "" +"To enable this mode, you can use the environment variable " +":envvar:`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, " +"which will enable the JIT mode for the ``perf`` profiler." msgstr "" +"برای فعال کردن این حالت، می‌توانید از متغیر محیطی " +":envvar:`PYTHON_PERF_JIT_SUPPORT` یا گزینه‌ی :option:`-X perf_jit <-X>` " +"استفاده کنید، که حالت JIT را برای پروفایلر (profiler) ``perf`` فعال می‌کند." -msgid "Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 will work with the JIT mode. The fix was also backported to the v6.7.2 version of the tool." +msgid "" +"Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 " +"will work with the JIT mode. The fix was also backported to the v6.7.2 " +"version of the tool." msgstr "" +"به دلیل وجود یک اشکال در ابزار ``perf``، فقط نسخه‌های ``perf`` بالاتر از " +"v6.8 با حالت JIT کار می‌کنند. این اصلاحیه همچنین به نسخه v6.7.2 این ابزار " +"نیز منتقل شده است." -msgid "Note that when checking the version of the ``perf`` tool (which can be done by running ``perf version``) you must take into account that some distros add some custom version numbers including a ``-`` character. This means that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." +msgid "" +"Note that when checking the version of the ``perf`` tool (which can be done " +"by running ``perf version``) you must take into account that some distros " +"add some custom version numbers including a ``-`` character. This means " +"that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." msgstr "" +"توجه داشته باشید که هنگام بررسی نسخه‌ی ابزار ``perf`` (که این کار را می‌توان" +" با اجرای ``perf version`` انجام داد)، باید در نظر داشته باشید که برخی " +"توزیع‌ها شماره‌های نسخه‌ی سفارشی شامل نویسه‌ی ``-`` را اضافه می‌کنند. این " +"بدان معناست که ``perf 6.7-3`` لزوماً ``perf 6.7.3`` نیست." -msgid "When using the perf JIT mode, you need an extra step before you can run ``perf report``. You need to call the ``perf inject`` command to inject the JIT information into the ``perf.data`` file.::" +msgid "" +"When using the perf JIT mode, you need an extra step before you can run " +"``perf report``. You need to call the ``perf inject`` command to inject the " +"JIT information into the ``perf.data`` file.::" msgstr "" +"هنگام استفاده از حالت JIT در perf، پیش از آنکه بتوانید ``perf report`` را " +"اجرا کنید، به یک مرحله اضافی نیاز دارید. باید دستور ``perf inject`` را " +"فراخوانی کنید تا اطلاعات JIT را به فایل ``perf.data`` وارد کنید.::" msgid "" "$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -Xperf_jit my_script.py\n" "$ perf inject -i perf.data --jit --output perf.jit.data\n" "$ perf report -g -i perf.jit.data" msgstr "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -Xperf_jit my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" msgid "or using the environment variable::" -msgstr "" +msgstr "یا با استفاده از متغیر محیطی::" msgid "" "$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o perf.data python my_script.py\n" "$ perf inject -i perf.data --jit --output perf.jit.data\n" "$ perf report -g -i perf.jit.data" msgstr "" +"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o perf.data python my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" -msgid "``perf inject --jit`` command will read ``perf.data``, automatically pick up the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and then create ``perf.jit.data`` which merges all the JIT information together. It should also create a lot of ``jitted-XXXX-N.so`` files in the current directory which are ELF images for all the JIT trampolines that were created by Python." -msgstr "" +msgid "" +"``perf inject --jit`` command will read ``perf.data``, automatically pick up" +" the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and " +"then create ``perf.jit.data`` which merges all the JIT information together." +" It should also create a lot of ``jitted-XXXX-N.so`` files in the current " +"directory which are ELF images for all the JIT trampolines that were created" +" by Python." +msgstr "" +"فرمان ``perf inject --jit`` فایل ``perf.data`` را می‌خواند، به‌طور خودکار " +"فایل برون‌ریزی (dump) perf را که پایتون ایجاد می‌کند (در ``/tmp/perf-$PID.dump``)" +" دریافت می‌کند و سپس ``perf.jit.data`` را ایجاد می‌کند که همه‌ی اطلاعات JIT " +"را با یکدیگر ادغام می‌کند. همچنین باید تعداد زیادی فایل ``jitted-XXXX-N.so``" +" در پوشه‌ی جاری ایجاد کند که تصویرهای ELF برای همه‌ی ترمپولین‌های JIT (JIT " +"trampolines) ایجادشده توسط پایتون هستند." -msgid "When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of the stack of the process being profiled and save the information in the ``perf.data`` file. By default, the size of the stack dump is 8192 bytes, but you can change the size by passing it after a comma like ``--call-graph dwarf,16384``." -msgstr "" +msgid "" +"When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of " +"the stack of the process being profiled and save the information in the " +"``perf.data`` file. By default, the size of the stack dump is 8192 bytes, " +"but you can change the size by passing it after a comma like ``--call-graph " +"dwarf,16384``." +msgstr "" +"هنگام استفاده از ``--call-graph dwarf``، ابزار ``perf`` تصویرهای فوری از " +"پشته‌ی فرایندی که پروفایل‌گیری می‌شود می‌گیرد و اطلاعات را در فایل " +"``perf.data`` ذخیره می‌کند. به‌طور پیش‌فرض، اندازه‌ی برون‌ریزی پشته (stack " +"dump) ۸۱۹۲ بایت است، اما می‌توانید اندازه را با قرار دادن آن پس از یک " +"ویرگول، مانند ``--call-graph dwarf,16384``، تغییر دهید." -msgid "The size of the stack dump is important because if the size is too small ``perf`` will not be able to unwind the stack and the output will be incomplete. On the other hand, if the size is too big, then ``perf`` won't be able to sample the process as frequently as it would like as the overhead will be higher." +msgid "" +"The size of the stack dump is important because if the size is too small " +"``perf`` will not be able to unwind the stack and the output will be " +"incomplete. On the other hand, if the size is too big, then ``perf`` won't " +"be able to sample the process as frequently as it would like as the overhead" +" will be higher." msgstr "" +"اندازه‌ی برون‌ریزی پشتهمهم است، زیرا اگر اندازه بیش از حد کوچک باشد،" +" ``perf`` نمی‌تواند پشته را باز کند و خروجی ناقص خواهد بود. از طرف دیگر، اگر" +" اندازه بیش از حد بزرگ باشد، ``perf`` نمی‌تواند به دفعات دلخواه از فرایند " +"نمونه‌برداری کند، زیرا سربار بیشتر خواهد بود." -msgid "The stack size is particularly important when profiling Python code compiled with low optimization levels (like ``-O0``), as these builds tend to have larger stack frames. If you are compiling Python with ``-O0`` and not seeing Python functions in your profiling output, try increasing the stack dump size to 65528 bytes (the maximum)::" -msgstr "" +msgid "" +"The stack size is particularly important when profiling Python code compiled" +" with low optimization levels (like ``-O0``), as these builds tend to have " +"larger stack frames. If you are compiling Python with ``-O0`` and not seeing" +" Python functions in your profiling output, try increasing the stack dump " +"size to 65528 bytes (the maximum)::" +msgstr "" +"اندازه‌ی پشته به‌ویژه هنگام پروفایل‌گیری کد پایتون کامپایل‌شده با سطح‌های " +"بهینه‌سازی پایین (مانند ``-O0``) اهمیت دارد، زیرا این ساخت‌ها معمولاً " +"فریم‌های پشته بزرگ‌تری دارند. اگر پایتون را با ``-O0`` کامپایل می‌کنید و " +"توابع پایتون را در خروجی پروفایل‌گیری خود نمی‌بینید، سعی کنید اندازه‌ی تخلیه‌ی " +"پشته را به ۶۵۵۲۸ بایت (حداکثر) افزایش دهید::" -msgid "$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -Xperf_jit my_script.py" +msgid "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python " +"-Xperf_jit my_script.py" msgstr "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python " +"-Xperf_jit my_script.py" msgid "Different compilation flags can significantly impact stack sizes:" msgstr "" +"پرچم‌های مختلف کامپایل می‌توانند به‌طور قابل‌توجهی بر اندازه‌های پشته تأثیر " +"بگذارند:" -msgid "Builds with ``-O0`` typically have much larger stack frames than those with ``-O1`` or higher" +msgid "" +"Builds with ``-O0`` typically have much larger stack frames than those with " +"``-O1`` or higher" msgstr "" +"ساخت‌های با ``-O0`` معمولاً فریم‌های پشته بسیار بزرگ‌تری نسبت به ساخت‌های با" +" ``-O1`` یا بالاتر دارند." -msgid "Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" +msgid "" +"Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" msgstr "" +"افزودن بهینه‌سازی‌ها (``-O1``، ``-O2`` و غیره) معمولاً اندازه پشته را کاهش " +"می‌دهد" -msgid "Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable stack unwinding" +msgid "" +"Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable" +" stack unwinding" msgstr "" +"اشاره‌گرهای قاب (``-fno-omit-frame-pointer``) معمولاً باز شدن " +"قابل‌اطمینان‌تر پشته را فراهم می‌کنند" diff --git a/howto/pyporting.po b/howto/pyporting.po index 78c71295a..204901a1a 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -25,40 +25,70 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "How to port Python 2 Code to Python 3" -msgstr "" +msgstr "چگونه کد پایتون 2 را به پایتون 3 منتقل کنیم" msgid "author" -msgstr "" +msgstr "نویسنده" msgid "Brett Cannon" -msgstr "" +msgstr "Brett Cannon" -msgid "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: see :pep:`373` and `status of Python versions `_." +msgid "" +"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: see :pep:`373` and `status of Python versions " +"`_." msgstr "" +"پایتون 2 در آغاز سال ۲۰۲۰ به پایان عمر رسمی خود رسید. این بدان معناست که " +"دیگر هیچ گزارش اشکال، رفع اشکال یا تغییر جدیدی برای پایتون 2 انجام نخواهد شد" +" — این نسخه دیگر پشتیبانی نمی‌شود: :pep:`373` و `وضعیت نسخه‌های پایتون " +"`_ را ببینید." -msgid "If you are looking to port an extension module instead of pure Python code, please see :ref:`cporting-howto`." +msgid "" +"If you are looking to port an extension module instead of pure Python code, " +"please see :ref:`cporting-howto`." msgstr "" +"اگر به‌جای کد پایتون خالص، قصد پورت کردن یک ماژول افزونه را دارید، لطفاً " +":ref:`cporting-howto` را ببینید." -msgid "The archived python-porting_ mailing list may contain some useful guidance." +msgid "" +"The archived python-porting_ mailing list may contain some useful guidance." msgstr "" +"فهرست ایمیلی بایگانی‌شده‌ی python-porting_ ممکن است شامل برخی راهنمایی‌های " +"مفید باشد." -msgid "Since Python 3.11 the original porting guide was discontinued. You can find the old guide in the `archive `_." +msgid "" +"Since Python 3.11 the original porting guide was discontinued. You can find " +"the old guide in the `archive " +"`_." msgstr "" +"از پایتون 3.11، راهنمای اصلی انتقال (porting) از رده خارج شده است. شما " +"می‌توانید راهنمای قدیمی را در `بایگانی " +"`_ پیدا کنید." msgid "Third-party guides" -msgstr "" +msgstr "راهنماهای شخص ثالث" msgid "There are also multiple third-party guides that might be useful:" -msgstr "" +msgstr "همچنین چندین راهنمای شخص ثالث نیز وجود دارد که ممکن است مفید باشند:" msgid "`Guide by Fedora `_" -msgstr "" +msgstr "`راهنمای Fedora `_" msgid "`PyCon 2020 tutorial `_" -msgstr "" +msgstr "`آموزش PyCon 2020 `_" -msgid "`Guide by DigitalOcean `_" +msgid "" +"`Guide by `DigitalOcean" +" `_" msgstr "" +"راهنمای `DigitalOcean `_" -msgid "`Guide by ActiveState `_" +msgid "" +"`Guide by ActiveState `_" msgstr "" +"`راهنمای ActiveState `_" diff --git a/howto/regex.po b/howto/regex.po index 619594ca5..9ed39c84f 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"PO-Revision-Date: 2026-08-28 10:54+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,237 +23,528 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Regular expression HOWTO" -msgstr "" +msgstr "راهنمای عبارت باقاعده" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "A.M. Kuchling " -msgstr "" +msgstr "A.M. Kuchling " msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "This document is an introductory tutorial to using regular expressions in Python with the :mod:`re` module. It provides a gentler introduction than the corresponding section in the Library Reference." +msgid "" +"This document is an introductory tutorial to using regular expressions in Python " +"with the :mod:`re` module. It provides a gentler introduction than the " +"corresponding section in the Library Reference." msgstr "" +"این سند آموزشی مقدماتی برای استفاده از عبارات منظم در پایتون با ماژول :mod:`re` " +"است. این سند در مقایسه با بخش متناظر در مرجع کتابخانه، مقدمه‌ای ساده‌تر ارائه می‌دهد." msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "Regular expressions (called REs, or regexes, or regex patterns) are essentially a tiny, highly specialized programming language embedded inside Python and made available through the :mod:`re` module. Using this little language, you specify the rules for the set of possible strings that you want to match; this set might contain English sentences, or e-mail addresses, or TeX commands, or anything you like. You can then ask questions such as \"Does this string match the pattern?\", or \"Is there a match for the pattern anywhere in this string?\". You can also use REs to modify a string or to split it apart in various ways." -msgstr "" +msgid "" +"Regular expressions (called REs, or regexes, or regex patterns) are essentially a " +"tiny, highly specialized programming language embedded inside Python and made " +"available through the :mod:`re` module. Using this little language, you specify the " +"rules for the set of possible strings that you want to match; this set might " +"contain English sentences, or e-mail addresses, or TeX commands, or anything you " +"like. You can then ask questions such as \"Does this string match the pattern?\", " +"or \"Is there a match for the pattern anywhere in this string?\". You can also use " +"REs to modify a string or to split it apart in various ways." +msgstr "" +"عبارت‌های باقاعده (که به آن‌ها RE، regex یا الگوهای regex گفته می‌شود) در واقع یک زبان " +"برنامه‌نویسی کوچک و بسیار تخصصی است که درون پایتون تعبیه شده و از طریق " +"ماژول :mod:`re` در دسترس قرار می‌گیرد. با استفاده از این زبان کوچک، قواعد مجموعه‌ای " +"از رشته‌های ممکن را که می‌خواهید با آن‌ها تطابق انجام دهید مشخص می‌کنید؛ این مجموعه " +"ممکن است شامل جملات انگلیسی، نشانی‌های ایمیل، دستورات TeX یا هر چیزی باشد که " +"بخواهید. سپس می‌توانید پرسش‌هایی مانند «آیا این رشته با الگو تطابق دارد؟» یا «آیا " +"تطابقی برای الگو در هر جای این رشته وجود دارد؟» بپرسید. همچنین می‌توانید از REها " +"برای تغییر یک رشته یا تقسیم آن به روش‌های مختلف استفاده کنید." -msgid "Regular expression patterns are compiled into a series of bytecodes which are then executed by a matching engine written in C. For advanced use, it may be necessary to pay careful attention to how the engine will execute a given RE, and write the RE in a certain way in order to produce bytecode that runs faster. Optimization isn't covered in this document, because it requires that you have a good understanding of the matching engine's internals." -msgstr "" +msgid "" +"Regular expression patterns are compiled into a series of bytecodes which are then " +"executed by a matching engine written in C. For advanced use, it may be necessary " +"to pay careful attention to how the engine will execute a given RE, and write the " +"RE in a certain way in order to produce bytecode that runs faster. Optimization " +"isn't covered in this document, because it requires that you have a good " +"understanding of the matching engine's internals." +msgstr "" +"الگوهای عبارت باقاعده به رشته‌ای از بایت‌کدها کامپایل می‌شوند که سپس توسط یک موتور " +"تطبیق نوشته‌شده به زبان C اجرا می‌شوند. برای استفاده‌ی پیشرفته، ممکن است لازم باشد " +"به‌دقت به نحوه‌ی اجرای یک RE مشخص توسط موتور توجه کنید و RE را به شکل خاصی بنویسید تا " +"بایت‌کدی تولید شود که سریع‌تر اجرا می‌شود. بهینه‌سازی در این سند پوشش داده نمی‌شود، زیرا " +"نیاز دارد که شما درک خوبی از جزئیات داخلی موتور تطبیق داشته باشید." -msgid "The regular expression language is relatively small and restricted, so not all possible string processing tasks can be done using regular expressions. There are also tasks that *can* be done with regular expressions, but the expressions turn out to be very complicated. In these cases, you may be better off writing Python code to do the processing; while Python code will be slower than an elaborate regular expression, it will also probably be more understandable." -msgstr "" +msgid "" +"The regular expression language is relatively small and restricted, so not all " +"possible string processing tasks can be done using regular expressions. There are " +"also tasks that *can* be done with regular expressions, but the expressions turn " +"out to be very complicated. In these cases, you may be better off writing Python " +"code to do the processing; while Python code will be slower than an elaborate " +"regular expression, it will also probably be more understandable." +msgstr "" +"زبان عبارت‌های منظم نسبتاً کوچک و محدود است، بنابراین نمی‌توان همه‌ی کارهای ممکن در " +"پردازش رشته را با عبارت‌های منظم انجام داد. همچنین کارهایی وجود دارند که *می‌توان* " +"آن‌ها را با عبارت‌های منظم انجام داد، اما عبارت‌ها بسیار پیچیده می‌شوند. در این موارد، " +"ممکن است بهتر باشد برای انجام پردازش کد پایتون بنویسید؛ اگرچه کد پایتون از یک عبارت " +"منظم مفصل کندتر خواهد بود، اما احتمالاً قابل‌فهم‌تر نیز خواهد بود." msgid "Simple patterns" -msgstr "" +msgstr "الگوهای ساده" -msgid "We'll start by learning about the simplest possible regular expressions. Since regular expressions are used to operate on strings, we'll begin with the most common task: matching characters." +msgid "" +"We'll start by learning about the simplest possible regular expressions. Since " +"regular expressions are used to operate on strings, we'll begin with the most " +"common task: matching characters." msgstr "" +"با یادگیری ساده‌ترین عبارات باقاعده‌ی ممکن آغاز می‌کنیم. از آن‌جا که عبارات باقاعده برای " +"انجام عملیات روی رشته‌ها به کار می‌روند، با رایج‌ترین وظیفه شروع می‌کنیم: تطبیق نویسه‌ها." -msgid "For a detailed explanation of the computer science underlying regular expressions (deterministic and non-deterministic finite automata), you can refer to almost any textbook on writing compilers." +msgid "" +"For a detailed explanation of the computer science underlying regular expressions " +"(deterministic and non-deterministic finite automata), you can refer to almost any " +"textbook on writing compilers." msgstr "" +"برای توضیحی دقیق درباره علوم کامپیوتری که زیربنای عبارت‌های باقاعده است (اتوماتای " +"متناهی قطعی و غیرقطعی)، می‌توانید به تقریباً هر کتاب درسی درباره نوشتن کامپایلرها " +"مراجعه کنید." msgid "Matching characters" -msgstr "" +msgstr "تطبیق نویسه‌ها" -msgid "Most letters and characters will simply match themselves. For example, the regular expression ``test`` will match the string ``test`` exactly. (You can enable a case-insensitive mode that would let this RE match ``Test`` or ``TEST`` as well; more about this later.)" +msgid "" +"Most letters and characters will simply match themselves. For example, the regular " +"expression ``test`` will match the string ``test`` exactly. (You can enable a case-" +"insensitive mode that would let this RE match ``Test`` or ``TEST`` as well; more " +"about this later.)" msgstr "" +"بیشتر حروف و نویسه‌ها به‌سادگی با خودشان مطابقت دارند. برای مثال، عبارت باقاعده‌ی " +"``test`` دقیقاً با رشته‌ی ``test`` مطابقت خواهد داشت. (می‌توانید حالت بدون حساسیت به " +"بزرگی و کوچکی حروف را فعال کنید تا این عبارت باقاعده بتواند با ``Test`` یا ``TEST`` " +"نیز مطابقت داشته باشد؛ بعداً بیشتر درباره‌ی این موضوع توضیح داده می‌شود.)" -msgid "There are exceptions to this rule; some characters are special :dfn:`metacharacters`, and don't match themselves. Instead, they signal that some out-of-the-ordinary thing should be matched, or they affect other portions of the RE by repeating them or changing their meaning. Much of this document is devoted to discussing various metacharacters and what they do." -msgstr "" +msgid "" +"There are exceptions to this rule; some characters are " +"special :dfn:`metacharacters`, and don't match themselves. Instead, they signal " +"that some out-of-the-ordinary thing should be matched, or they affect other " +"portions of the RE by repeating them or changing their meaning. Much of this " +"document is devoted to discussing various metacharacters and what they do." +msgstr "" +"برای این قاعده استثناهایی وجود دارد؛ برخی از نویسه‌ها، :dfn:`metacharacters` ویژه‌ای " +"هستند و با خودشان تطابق ندارند. در عوض، آن‌ها نشان می‌دهند که باید چیز غیرمعمولی " +"تطابق داده شود، یا با تکرار آن‌ها یا تغییر معنایشان، بر بخش‌های دیگری از عبارت " +"باقاعده تأثیر می‌گذارند. بخش عمده‌ای از این سند به بحث درباره‌ی فرانویسه‌های گوناگون و " +"کاری که انجام می‌دهند اختصاص دارد." -msgid "Here's a complete list of the metacharacters; their meanings will be discussed in the rest of this HOWTO." +msgid "" +"Here's a complete list of the metacharacters; their meanings will be discussed in " +"the rest of this HOWTO." msgstr "" +"در اینجا فهرست کاملی از فرانویسه‌ها (metacharacters) آمده است؛ معانی آن‌ها در ادامه‌ی " +"این HOWTO بحث خواهد شد." msgid ". ^ $ * + ? { } [ ] \\ | ( )" -msgstr "" +msgstr ". ^ $ * + ? { } [ ] \\ | ( )" -msgid "The first metacharacters we'll look at are ``[`` and ``]``. They're used for specifying a character class, which is a set of characters that you wish to match. Characters can be listed individually, or a range of characters can be indicated by giving two characters and separating them by a ``'-'``. For example, ``[abc]`` will match any of the characters ``a``, ``b``, or ``c``; this is the same as ``[a-c]``, which uses a range to express the same set of characters. If you wanted to match only lowercase letters, your RE would be ``[a-z]``." -msgstr "" +msgid "" +"The first metacharacters we'll look at are ``[`` and ``]``. They're used for " +"specifying a character class, which is a set of characters that you wish to match. " +"Characters can be listed individually, or a range of characters can be indicated by " +"giving two characters and separating them by a ``'-'``. For example, ``[abc]`` " +"will match any of the characters ``a``, ``b``, or ``c``; this is the same as ``[a-" +"c]``, which uses a range to express the same set of characters. If you wanted to " +"match only lowercase letters, your RE would be ``[a-z]``." +msgstr "" +"اولین فرانویسه‌هایی که بررسی خواهیم کرد، ``[`` و ``]`` هستند. آن‌ها برای تعیین یک " +"کلاس نویسه به کار می‌روند که مجموعه‌ای از نویسه‌هایی است که می‌خواهید آن‌ها را تطبیق " +"دهید. نویسه‌ها می‌توانند به‌صورت جداگانه فهرست شوند، یا می‌توان یک بازه از نویسه‌ها را " +"با دادن دو نویسه و جدا کردن آن‌ها با یک ``'-'`` مشخص کرد. برای مثال، ``[abc]`` با هر " +"یک از نویسه‌های ``a``، ``b`` یا ``c`` تطابق دارد؛ این معادل ``[a-c]`` است که از یک " +"بازه برای بیان همان مجموعه از نویسه‌ها استفاده می‌کند. اگر بخواهید فقط حروف کوچک را " +"تطبیق دهید، RE شما ``[a-z]`` خواهد بود." -msgid "Metacharacters (except ``\\``) are not active inside classes. For example, ``[akm$]`` will match any of the characters ``'a'``, ``'k'``, ``'m'``, or ``'$'``; ``'$'`` is usually a metacharacter, but inside a character class it's stripped of its special nature." +msgid "" +"Metacharacters (except ``\\``) are not active inside classes. For example, " +"``[akm$]`` will match any of the characters ``'a'``, ``'k'``, ``'m'``, or ``'$'``; " +"``'$'`` is usually a metacharacter, but inside a character class it's stripped of " +"its special nature." msgstr "" +"فرانویسه‌ها (به جز ``\\``) درون کلاس‌ها فعال نیستند. برای مثال، ``[akm$]`` با هر یک " +"از نویسه‌های ``'a'``، ``'k'``، ``'m'`` یا ``'$'`` مطابقت دارد؛ ``'$'`` معمولاً یک " +"فرانویسه است، اما درون یک کلاس نویسه، خاصیت ویژه‌ی آن حذف می‌شود." -msgid "You can match the characters not listed within the class by :dfn:`complementing` the set. This is indicated by including a ``'^'`` as the first character of the class. For example, ``[^5]`` will match any character except ``'5'``. If the caret appears elsewhere in a character class, it does not have special meaning. For example: ``[5^]`` will match either a ``'5'`` or a ``'^'``." -msgstr "" +msgid "" +"You can match the characters not listed within the class by :dfn:`complementing` " +"the set. This is indicated by including a ``'^'`` as the first character of the " +"class. For example, ``[^5]`` will match any character except ``'5'``. If the caret " +"appears elsewhere in a character class, it does not have special meaning. For " +"example: ``[5^]`` will match either a ``'5'`` or a ``'^'``." +msgstr "" +"می‌توانید با :dfn:`متمم‌سازی ` مجموعه، نویسه‌هایی را که در کلاس فهرست " +"نشده‌اند تطبیق دهید. این کار با قرار دادن ``'^'`` به‌عنوان اولین نویسه‌ی کلاس مشخص " +"می‌شود. برای مثال، ``[^5]`` هر نویسه‌ای به جز ``'5'`` را تطبیق می‌دهد. اگر نویسه‌ی ^ در " +"جای دیگری از یک کلاس نویسه ظاهر شود، معنای خاصی ندارد. برای مثال: ``[5^]`` یا " +"``'5'`` یا ``'^'`` را تطبیق می‌دهد." -msgid "Perhaps the most important metacharacter is the backslash, ``\\``. As in Python string literals, the backslash can be followed by various characters to signal various special sequences. It's also used to escape all the metacharacters so you can still match them in patterns; for example, if you need to match a ``[`` or ``\\``, you can precede them with a backslash to remove their special meaning: ``\\[`` or ``\\\\``." -msgstr "" +msgid "" +"Perhaps the most important metacharacter is the backslash, ``\\``. As in Python " +"string literals, the backslash can be followed by various characters to signal " +"various special sequences. It's also used to escape all the metacharacters so you " +"can still match them in patterns; for example, if you need to match a ``[`` or " +"``\\``, you can precede them with a backslash to remove their special meaning: ``\\" +"[`` or ``\\\\``." +msgstr "" +"شاید مهم‌ترین فرانویسه ، بک‌اسلش، ``\\`` باشد. مانند مقادیر لفظی رشته " +"پایتون، پس از بک‌اسلش می‌توان از نویسه‌های مختلفی استفاده کرد تا دنباله‌های ویژه‌ی " +"گوناگون نشان داده شوند. همچنین از آن برای خنثی کردن همه‌ی فرانویسه‌ها استفاده می‌شود تا " +"همچنان بتوانید آن‌ها را در الگوها تطبیق دهید؛ برای مثال، اگر نیاز دارید ``[`` یا " +"``\\`` را تطبیق دهید، می‌توانید پیش از آن‌ها یک بک‌اسلش قرار دهید تا معنای خاص آن‌ها از " +"بین برود: ``\\[`` یا ``\\\\``." -msgid "Some of the special sequences beginning with ``'\\'`` represent predefined sets of characters that are often useful, such as the set of digits, the set of letters, or the set of anything that isn't whitespace." +msgid "" +"Some of the special sequences beginning with ``'\\'`` represent predefined sets of " +"characters that are often useful, such as the set of digits, the set of letters, or " +"the set of anything that isn't whitespace." msgstr "" +"برخی از دنباله‌های خاص که با ``'\\'`` آغاز می‌شوند، بیانگر مجموعه‌های از پیش " +"تعریف‌شده‌ای از نویسه‌ها هستند که اغلب مفید هستند، مانند مجموعه ارقام، مجموعه حروف، یا " +"مجموعه هر چیزی غیر از فضای سفید." -msgid "Let's take an example: ``\\w`` matches any alphanumeric character. If the regex pattern is expressed in bytes, this is equivalent to the class ``[a-zA-Z0-9_]``. If the regex pattern is a string, ``\\w`` will match all the characters marked as letters in the Unicode database provided by the :mod:`unicodedata` module. You can use the more restricted definition of ``\\w`` in a string pattern by supplying the :const:`re.ASCII` flag when compiling the regular expression." -msgstr "" +msgid "" +"Let's take an example: ``\\w`` matches any alphanumeric character. If the regex " +"pattern is expressed in bytes, this is equivalent to the class ``[a-zA-Z0-9_]``. " +"If the regex pattern is a string, ``\\w`` will match all the characters marked as " +"letters in the Unicode database provided by the :mod:`unicodedata` module. You can " +"use the more restricted definition of ``\\w`` in a string pattern by supplying " +"the :const:`re.ASCII` flag when compiling the regular expression." +msgstr "" +"مثالی را در نظر بگیرید: ``\\w`` با هر نویسه‌ی الفبایی‌عددی مطابقت دارد. اگر الگوی " +"عبارت باقاعده به‌صورت بایت بیان شده باشد، این معادل کلاس ``[a-zA-Z0-9_]`` است. اگر " +"الگوی عبارت باقاعده یک رشته باشد، ``\\w`` با تمام نویسه‌هایی که در پایگاه داده‌ی " +"یونیکد ارائه‌شده توسط ماژول :mod:`unicodedata` به‌عنوان حرف علامت‌گذاری شده‌اند، مطابقت " +"خواهد کرد. شما می‌توانید با استفاده از پرچم :const:`re.ASCII` هنگام کامپایل عبارت " +"باقاعده، از تعریف محدودتر ``\\w`` در یک الگوی رشته‌ای استفاده کنید." -msgid "The following list of special sequences isn't complete. For a complete list of sequences and expanded class definitions for Unicode string patterns, see the last part of :ref:`Regular Expression Syntax ` in the Standard Library reference. In general, the Unicode versions match any character that's in the appropriate category in the Unicode database." +msgid "" +"The following list of special sequences isn't complete. For a complete list of " +"sequences and expanded class definitions for Unicode string patterns, see the last " +"part of :ref:`Regular Expression Syntax ` in the Standard Library " +"reference. In general, the Unicode versions match any character that's in the " +"appropriate category in the Unicode database." msgstr "" +"فهرست زیر از دنباله‌های ویژه کامل نیست. برای فهرست کاملی از دنباله‌ها و تعریف‌های " +"گسترش‌یافته کلاس برای الگوهای رشته یونیکد، بخش پایانی :ref:`نحو عبارت باقاعده ` را در مرجع کتابخانه استاندارد ببینید. به‌طور کلی، نسخه‌های یونیکد با هر " +"نویسه‌ای که در دسته مناسب در پایگاه داده یونیکد قرار دارد، مطابقت می‌کنند." msgid "``\\d``" -msgstr "" +msgstr "``\\d``" msgid "Matches any decimal digit; this is equivalent to the class ``[0-9]``." -msgstr "" +msgstr "با هر رقم ده‌دهی مطابقت دارد؛ این معادل کلاس ``[0-9]`` است." msgid "``\\D``" -msgstr "" +msgstr "``\\D``" msgid "Matches any non-digit character; this is equivalent to the class ``[^0-9]``." -msgstr "" +msgstr "با هر نویسه‌ی غیررقمی مطابقت دارد؛ این معادل کلاس ``[^0-9]`` است." msgid "``\\s``" -msgstr "" +msgstr "``\\s``" -msgid "Matches any whitespace character; this is equivalent to the class ``[ \\t\\n\\r\\f\\v]``." -msgstr "" +msgid "" +"Matches any whitespace character; this is equivalent to the class " +"``[ \\t\\n\\r\\f\\v]``." +msgstr "با هر نویسه فضای سفید مطابقت دارد؛ این معادل کلاس ``[ \\t\\n\\r\\f\\v]`` است." msgid "``\\S``" -msgstr "" +msgstr "``\\S``" -msgid "Matches any non-whitespace character; this is equivalent to the class ``[^ \\t\\n\\r\\f\\v]``." +msgid "" +"Matches any non-whitespace character; this is equivalent to the class ``[^ " +"\\t\\n\\r\\f\\v]``." msgstr "" +"با هر نویسه‌ای که فضای خالی نیست مطابقت دارد؛ این معادل کلاس ``[^ \\t\\n\\r\\f\\v]`` " +"است." msgid "``\\w``" -msgstr "" +msgstr "``\\w``" -msgid "Matches any alphanumeric character; this is equivalent to the class ``[a-zA-Z0-9_]``." -msgstr "" +msgid "" +"Matches any alphanumeric character; this is equivalent to the class ``[a-zA-" +"Z0-9_]``." +msgstr "با هر نویسه‌ی الفبایی-عددی مطابقت دارد؛ این معادل کلاس ``[a-zA-Z0-9_]`` است." msgid "``\\W``" -msgstr "" +msgstr "``\\W``" -msgid "Matches any non-alphanumeric character; this is equivalent to the class ``[^a-zA-Z0-9_]``." +msgid "" +"Matches any non-alphanumeric character; this is equivalent to the class ``[^a-zA-" +"Z0-9_]``." msgstr "" +"با هر نویسه‌ی غیرالفبایی-عددی مطابقت دارد؛ این معادل کلاس ``[^a-zA-Z0-9_]`` است." -msgid "These sequences can be included inside a character class. For example, ``[\\s,.]`` is a character class that will match any whitespace character, or ``','`` or ``'.'``." +msgid "" +"These sequences can be included inside a character class. For example, ``[\\s,.]`` " +"is a character class that will match any whitespace character, or ``','`` or " +"``'.'``." msgstr "" +"این توالی‌ها می‌توانند درون یک کلاس نویسه گنجانده شوند. برای مثال، ``[\\s,.]`` یک " +"کلاس نویسه است که با هر نویسه فضای سفید، یا ``','`` یا ``'.'`` مطابقت خواهد داشت." -msgid "The final metacharacter in this section is ``.``. It matches anything except a newline character, and there's an alternate mode (:const:`re.DOTALL`) where it will match even a newline. ``.`` is often used where you want to match \"any character\"." +msgid "" +"The final metacharacter in this section is ``.``. It matches anything except a " +"newline character, and there's an alternate mode (:const:`re.DOTALL`) where it will " +"match even a newline. ``.`` is often used where you want to match \"any " +"character\"." msgstr "" +"آخرین فرانویسسرآیند این بخش ``.`` است. این با هر چیزی به‌جز نویسه‌ی خط " +"جدید تطابق دارد و حالت جایگزینی (:const:`re.DOTALL`) وجود دارد که در آن حتی با خط " +"جدید نیز تطابق خواهد داشت. از ``.`` اغلب در جایی استفاده می‌شود که بخواهید با «هر " +"نویسه‌ای» تطابق داشته باشید." msgid "Repeating things" -msgstr "" +msgstr "تکرار چیزها" -msgid "Being able to match varying sets of characters is the first thing regular expressions can do that isn't already possible with the methods available on strings. However, if that was the only additional capability of regexes, they wouldn't be much of an advance. Another capability is that you can specify that portions of the RE must be repeated a certain number of times." -msgstr "" +msgid "" +"Being able to match varying sets of characters is the first thing regular " +"expressions can do that isn't already possible with the methods available on " +"strings. However, if that was the only additional capability of regexes, they " +"wouldn't be much of an advance. Another capability is that you can specify that " +"portions of the RE must be repeated a certain number of times." +msgstr "" +"توانایی تطبیق مجموعه‌های متفاوتی از نویسه‌ها نخستین کاری است که عبارت‌های باقاعده " +"می‌توانند انجام دهند و با متدهای موجود برای رشته‌ها از پیش امکان‌پذیر نیست. با این " +"حال، اگر این تنها قابلیت اضافی عبارت‌های باقاعده بود، پیشرفت چندانی محسوب نمی‌شدند. " +"قابلیت دیگر این است که می‌توانید مشخص کنید بخش‌هایی از عبارت باقاعده باید تعداد معینی " +"تکرار شوند." -msgid "The first metacharacter for repeating things that we'll look at is ``*``. ``*`` doesn't match the literal character ``'*'``; instead, it specifies that the previous character can be matched zero or more times, instead of exactly once." +msgid "" +"The first metacharacter for repeating things that we'll look at is ``*``. ``*`` " +"doesn't match the literal character ``'*'``; instead, it specifies that the " +"previous character can be matched zero or more times, instead of exactly once." msgstr "" +"اولین فرانویسهبرای تکرار که بررسی خواهیم کرد، ``*`` است. ``*`` با " +"نویسه‌ی عینی ``'*'`` تطابق ندارد؛ در عوض، مشخص می‌کند که نویسه‌ی قبلی می‌تواند به جای " +"دقیقاً یک بار، صفر بار یا بیشتر تطابق داشته باشد." -msgid "For example, ``ca*t`` will match ``'ct'`` (0 ``'a'`` characters), ``'cat'`` (1 ``'a'``), ``'caaat'`` (3 ``'a'`` characters), and so forth." +msgid "" +"For example, ``ca*t`` will match ``'ct'`` (0 ``'a'`` characters), ``'cat'`` (1 " +"``'a'``), ``'caaat'`` (3 ``'a'`` characters), and so forth." msgstr "" +"برای مثال، ``ca*t`` با ``'ct'`` (۰ نویسه ``'a'``)، ``'cat'`` (۱ ``'a'``)، " +"``'caaat'`` (۳ نویسه ``'a'``) و غیره مطابقت دارد." -msgid "Repetitions such as ``*`` are :dfn:`greedy`; when repeating a RE, the matching engine will try to repeat it as many times as possible. If later portions of the pattern don't match, the matching engine will then back up and try again with fewer repetitions." +msgid "" +"Repetitions such as ``*`` are :dfn:`greedy`; when repeating a RE, the matching " +"engine will try to repeat it as many times as possible. If later portions of the " +"pattern don't match, the matching engine will then back up and try again with fewer " +"repetitions." msgstr "" +"تکرارهایی مانند ``*`` :dfn:`حریص ` هستند؛ هنگام تکرار یک RE، موتور تطبیق " +"تلاش می‌کند آن را تا حد ممکن تکرار کند. اگر بخش‌های بعدی الگو مطابقت نداشته باشند، " +"موتور تطبیق سپس عقب‌گرد می‌کند و دوباره با تکرارهای کمتر تلاش می‌کند." -msgid "A step-by-step example will make this more obvious. Let's consider the expression ``a[bcd]*b``. This matches the letter ``'a'``, zero or more letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now imagine matching this RE against the string ``'abcbd'``." +msgid "" +"A step-by-step example will make this more obvious. Let's consider the expression " +"``a[bcd]*b``. This matches the letter ``'a'``, zero or more letters from the class " +"``[bcd]``, and finally ends with a ``'b'``. Now imagine matching this RE against " +"the string ``'abcbd'``." msgstr "" +"یک مثال گام‌به‌گام این موضوع را روشن‌تر می‌کند. عبارت ``a[bcd]*b`` را در نظر بگیرید. " +"این عبارت با نویسه ``'a'``، صفر یا چند نویسه از کلاس ``[bcd]`` مطابقت می‌کند و در " +"نهایت با یک ``'b'`` تمام می‌شود. حال مطابقت این عبارت باقاعده (RE) با رشته " +"``'abcbd'`` را تصور کنید." msgid "Step" -msgstr "" +msgstr "مرحله" msgid "Matched" -msgstr "" +msgstr "تطبیق‌شده" msgid "Explanation" -msgstr "" +msgstr "توضیح" msgid "1" -msgstr "" +msgstr "1" msgid "``a``" -msgstr "" +msgstr "``a``" msgid "The ``a`` in the RE matches." -msgstr "" +msgstr "``a`` در RE مطابقت می‌کند." msgid "2" -msgstr "" +msgstr "2" msgid "``abcbd``" -msgstr "" +msgstr "``abcbd``" -msgid "The engine matches ``[bcd]*``, going as far as it can, which is to the end of the string." +msgid "" +"The engine matches ``[bcd]*``, going as far as it can, which is to the end of the " +"string." msgstr "" +"موتور، ``[bcd]*`` را تطابق می‌دهد و تا جایی که می‌تواند پیش می‌رود، یعنی تا انتهای " +"رشته." msgid "3" -msgstr "" +msgstr "3" msgid "*Failure*" -msgstr "" +msgstr "*شکست*" -msgid "The engine tries to match ``b``, but the current position is at the end of the string, so it fails." +msgid "" +"The engine tries to match ``b``, but the current position is at the end of the " +"string, so it fails." msgstr "" +"موتور تلاش می‌کند ``b`` را تطبیق دهد، اما موقعیت فعلی در انتهای رشته قرار دارد، " +"بنابراین شکست می‌خورد." msgid "4" -msgstr "" +msgstr "4" msgid "``abcb``" -msgstr "" +msgstr "``abcb``" msgid "Back up, so that ``[bcd]*`` matches one less character." -msgstr "" +msgstr "به عقب برگردید، تا ``[bcd]*`` با یک نویسه کمتر مطابقت داشته باشد." msgid "5" -msgstr "" +msgstr "۵" -msgid "Try ``b`` again, but the current position is at the last character, which is a ``'d'``." +msgid "" +"Try ``b`` again, but the current position is at the last character, which is a " +"``'d'``." msgstr "" +"بار دیگر ``b`` را امتحان کنید، اما موقعیت فعلی روی آخرین نویسه قرار دارد که یک " +"``'d'`` است." msgid "6" -msgstr "" +msgstr "6" msgid "``abc``" -msgstr "" +msgstr "``abc``" msgid "Back up again, so that ``[bcd]*`` is only matching ``bc``." -msgstr "" +msgstr "دوباره عقب‌گرد کنید، به‌طوری‌که ``[bcd]*`` فقط ``bc`` را تطبیق دهد." msgid "7" -msgstr "" +msgstr "۷" -msgid "Try ``b`` again. This time the character at the current position is ``'b'``, so it succeeds." +msgid "" +"Try ``b`` again. This time the character at the current position is ``'b'``, so it " +"succeeds." msgstr "" +"دوباره ``b`` را امتحان کنید. این بار نویسه‌ی موقعیت فعلی ``'b'`` است، بنابراین موفق " +"می‌شود." -msgid "The end of the RE has now been reached, and it has matched ``'abcb'``. This demonstrates how the matching engine goes as far as it can at first, and if no match is found it will then progressively back up and retry the rest of the RE again and again. It will back up until it has tried zero matches for ``[bcd]*``, and if that subsequently fails, the engine will conclude that the string doesn't match the RE at all." -msgstr "" +msgid "" +"The end of the RE has now been reached, and it has matched ``'abcb'``. This " +"demonstrates how the matching engine goes as far as it can at first, and if no " +"match is found it will then progressively back up and retry the rest of the RE " +"again and again. It will back up until it has tried zero matches for ``[bcd]*``, " +"and if that subsequently fails, the engine will conclude that the string doesn't " +"match the RE at all." +msgstr "" +"اکنون به انتهای RE رسیده‌ایم و آن با ``'abcb'`` مطابقت کرده است. این نشان می‌دهد که " +"موتور تطبیق در ابتدا تا جایی که می‌تواند پیش می‌رود و اگر هیچ تطابقی پیدا نشود، سپس " +"به‌تدریج عقب می‌رود و بقیه‌ی RE را بارها و بارها دوباره امتحان می‌کند. آن‌قدر عقب می‌رود " +"تا صفر تطابق را برای ``[bcd]*`` امتحان کند و اگر سپس شکست بخورد، موتور نتیجه می‌گیرد " +"که رشته اصلاً با RE مطابقت ندارد." -msgid "Another repeating metacharacter is ``+``, which matches one or more times. Pay careful attention to the difference between ``*`` and ``+``; ``*`` matches *zero* or more times, so whatever's being repeated may not be present at all, while ``+`` requires at least *one* occurrence. To use a similar example, ``ca+t`` will match ``'cat'`` (1 ``'a'``), ``'caaat'`` (3 ``'a'``\\ s), but won't match ``'ct'``." -msgstr "" +msgid "" +"Another repeating metacharacter is ``+``, which matches one or more times. Pay " +"careful attention to the difference between ``*`` and ``+``; ``*`` matches *zero* " +"or more times, so whatever's being repeated may not be present at all, while ``+`` " +"requires at least *one* occurrence. To use a similar example, ``ca+t`` will match " +"``'cat'`` (1 ``'a'``), ``'caaat'`` (3 ``'a'``\\ s), but won't match ``'ct'``." +msgstr "" +"یکی دیگر از فرانویسه‌های تکرار، ``+`` است که یک یا چند بار تطابق دارد. به تفاوت میان " +"``*`` و ``+`` با دقت توجه کنید؛ ``*`` *صفر* یا چند بار تطابق دارد، بنابراین ممکن " +"است هر آنچه تکرار می‌شود اصلاً وجود نداشته باشد، در حالی که ``+`` حداقل به *یک* بار " +"نیاز دارد. برای استفاده از مثالی مشابه، ``ca+t`` با ``'cat'`` (۱ ``'a'``)، " +"``'caaat'`` (۳ ``'a'``) تطابق خواهد داشت، اما با ``'ct'`` تطابق نخواهد داشت." -msgid "There are two more repeating operators or quantifiers. The question mark character, ``?``, matches either once or zero times; you can think of it as marking something as being optional. For example, ``home-?brew`` matches either ``'homebrew'`` or ``'home-brew'``." +msgid "" +"There are two more repeating operators or quantifiers. The question mark " +"character, ``?``, matches either once or zero times; you can think of it as marking " +"something as being optional. For example, ``home-?brew`` matches either " +"``'homebrew'`` or ``'home-brew'``." msgstr "" +"دو عملگر تکرار یا کمیت‌گذار دیگر نیز وجود دارد. نویسه‌ی علامت سؤال، ``?``، یا یک بار یا " +"صفر بار تطابق می‌یابد؛ می‌توانید آن را به‌عنوان علامت‌گذاری اختیاری بودن چیزی در نظر " +"بگیرید. برای مثال، ``home-?brew`` یا با ``'homebrew'`` یا با ``'home-brew'`` تطابق " +"دارد." -msgid "The most complicated quantifier is ``{m,n}``, where *m* and *n* are decimal integers. This quantifier means there must be at least *m* repetitions, and at most *n*. For example, ``a/{1,3}b`` will match ``'a/b'``, ``'a//b'``, and ``'a///b'``. It won't match ``'ab'``, which has no slashes, or ``'a////b'``, which has four." -msgstr "" +msgid "" +"The most complicated quantifier is ``{m,n}``, where *m* and *n* are decimal " +"integers. This quantifier means there must be at least *m* repetitions, and at " +"most *n*. For example, ``a/{1,3}b`` will match ``'a/b'``, ``'a//b'``, and ``'a///" +"b'``. It won't match ``'ab'``, which has no slashes, or ``'a////b'``, which has " +"four." +msgstr "" +"پیچیده‌ترین کمیت‌گذار (quantifier) ``{m,n}`` است که در آن *m* و *n* اعداد " +"صحیح مبنای ده هستند. این کمیت‌گذار به این معناست که باید حداقل *m* تکرار و " +"حداکثر *n* تکرار وجود داشته باشد. برای مثال، ``a/{1,3}b`` با ``'a/b'``، ``'a//b'`` " +"و ``'a///b'`` مطابقت خواهد کرد. این الگو با ``'ab'`` که هیچ اسلشی ندارد، یا ``'a////" +"b'`` که چهار اسلش دارد، مطابقت نخواهد کرد." -msgid "You can omit either *m* or *n*; in that case, a reasonable value is assumed for the missing value. Omitting *m* is interpreted as a lower limit of 0, while omitting *n* results in an upper bound of infinity." +msgid "" +"You can omit either *m* or *n*; in that case, a reasonable value is assumed for the " +"missing value. Omitting *m* is interpreted as a lower limit of 0, while omitting " +"*n* results in an upper bound of infinity." msgstr "" +"می‌توانید *m* یا *n* را حذف کنید؛ در این صورت، یک مقدار معقول برای مقدار غایب فرض " +"می‌شود. حذف *m* به‌عنوان کران پایین ۰ تفسیر می‌شود، در حالی که حذف *n* به کران بالای " +"بی‌نهایت منجر می‌شود." -msgid "The simplest case ``{m}`` matches the preceding item exactly *m* times. For example, ``a/{2}b`` will only match ``'a//b'``." +msgid "" +"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " +"example, ``a/{2}b`` will only match ``'a//b'``." msgstr "" +"ساده‌ترین حالت ``{m}`` دقیقاً *m* بار با آیتم پیشین مطابقت دارد. برای مثال، ``a/{2}" +"b`` فقط با ``'a//b'`` مطابقت خواهد داشت." -msgid "Readers of a reductionist bent may notice that the three other quantifiers can all be expressed using this notation. ``{0,}`` is the same as ``*``, ``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's better to use ``*``, ``+``, or ``?`` when you can, simply because they're shorter and easier to read." +msgid "" +"Readers of a reductionist bent may notice that the three other quantifiers can all " +"be expressed using this notation. ``{0,}`` is the same as ``*``, ``{1,}`` is " +"equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's better to use ``*``, " +"``+``, or ``?`` when you can, simply because they're shorter and easier to read." msgstr "" +"خوانندگان با گرایش تقلیل‌گرایانه ممکن است متوجه شوند که سه کمیت‌گذار دیگر را می‌توان با " +"استفاده از این نمادگذاری بیان کرد. ``{0,}`` همان ``*`` است، ``{1,}`` معادل ``+`` " +"است، و ``{0,1}`` همان ``?`` است. بهتر است در صورت امکان از ``*``، ``+`` یا ``?`` " +"استفاده کنید، صرفاً به این دلیل که کوتاه‌تر و خواناتر هستند." msgid "Using regular expressions" -msgstr "" +msgstr "استفاده از عبارات باقاعده" -msgid "Now that we've looked at some simple regular expressions, how do we actually use them in Python? The :mod:`re` module provides an interface to the regular expression engine, allowing you to compile REs into objects and then perform matches with them." +msgid "" +"Now that we've looked at some simple regular expressions, how do we actually use " +"them in Python? The :mod:`re` module provides an interface to the regular " +"expression engine, allowing you to compile REs into objects and then perform " +"matches with them." msgstr "" +"اکنون که برخی عبارت‌های باقاعده ساده را بررسی کردیم، چگونه واقعاً از آن‌ها در پایتون " +"استفاده کنیم؟ ماژول :mod:`re` رابطی به موتور عبارت‌های باقاعده فراهم می‌کند و به شما " +"امکان می‌دهد REها را به اشیاء کامپایل کنید و سپس با آن‌ها تطبیق‌ها را انجام دهید." msgid "Compiling regular expressions" -msgstr "" +msgstr "کامپایل عبارت‌های منظم" -msgid "Regular expressions are compiled into pattern objects, which have methods for various operations such as searching for pattern matches or performing string substitutions. ::" +msgid "" +"Regular expressions are compiled into pattern objects, which have methods for " +"various operations such as searching for pattern matches or performing string " +"substitutions. ::" msgstr "" +"عبارت‌های منظم به اشیای الگو کامپایل می‌شوند، که متدهایی برای عملیات مختلف مانند " +"جست‌وجو برای تطابق‌های الگو یا انجام جایگزینی‌های رشته‌ای دارند. ::" msgid "" ">>> import re\n" @@ -261,126 +552,229 @@ msgid "" ">>> p\n" "re.compile('ab*')" msgstr "" +">>> import re\n" +">>> p = re.compile('ab*')\n" +">>> p\n" +"re.compile('ab*')" -msgid ":func:`re.compile` also accepts an optional *flags* argument, used to enable various special features and syntax variations. We'll go over the available settings later, but for now a single example will do::" +msgid "" +":func:`re.compile` also accepts an optional *flags* argument, used to enable " +"various special features and syntax variations. We'll go over the available " +"settings later, but for now a single example will do::" msgstr "" +":func:`re.compile` همچنین یک آرگومان اختیاری *flags* را می‌پذیرد که برای فعال‌سازی " +"قابلیت‌های ویژه و تغییرات سینتکسی گوناگون استفاده می‌شود. بعداً تنظیمات موجود را بررسی " +"خواهیم کرد، اما فعلاً یک مثال کافی است::" msgid ">>> p = re.compile('ab*', re.IGNORECASE)" -msgstr "" +msgstr ">>> p = re.compile('ab*', re.IGNORECASE)" -msgid "The RE is passed to :func:`re.compile` as a string. REs are handled as strings because regular expressions aren't part of the core Python language, and no special syntax was created for expressing them. (There are applications that don't need REs at all, so there's no need to bloat the language specification by including them.) Instead, the :mod:`re` module is simply a C extension module included with Python, just like the :mod:`socket` or :mod:`zlib` modules." -msgstr "" +msgid "" +"The RE is passed to :func:`re.compile` as a string. REs are handled as strings " +"because regular expressions aren't part of the core Python language, and no special " +"syntax was created for expressing them. (There are applications that don't need " +"REs at all, so there's no need to bloat the language specification by including " +"them.) Instead, the :mod:`re` module is simply a C extension module included with " +"Python, just like the :mod:`socket` or :mod:`zlib` modules." +msgstr "" +"RE به‌صورت یک رشته به :func:`re.compile` ارسال می‌شود. REها به‌صورت رشته پردازش " +"می‌شوند، زیرا عبارت‌های باقاعده بخشی از زبان اصلی پایتون نیستند و هیچ نحو خاصی برای " +"بیان آن‌ها ایجاد نشده است. (برنامه‌هایی وجود دارند که اصلاً به RE نیاز ندارند، " +"بنابراین نیازی به حجیم کردن مشخصات زبان با گنجاندن آن‌ها نیست.) در عوض، " +"ماژول :mod:`re` صرفاً یک ماژول توسعه C است که همراه با پایتون گنجانده شده است، درست " +"مانند ماژول‌های :mod:`socket` یا :mod:`zlib`." -msgid "Putting REs in strings keeps the Python language simpler, but has one disadvantage which is the topic of the next section." +msgid "" +"Putting REs in strings keeps the Python language simpler, but has one disadvantage " +"which is the topic of the next section." msgstr "" +"قرار دادن عبارت‌های باقاعده در رشته‌ها، زبان پایتون را ساده‌تر نگه می‌دارد، اما یک عیب " +"دارد که موضوع بخش بعدی است." msgid "The backslash plague" -msgstr "" +msgstr "آفت بک‌اسلش" -msgid "As stated earlier, regular expressions use the backslash character (``'\\'``) to indicate special forms or to allow special characters to be used without invoking their special meaning. This conflicts with Python's usage of the same character for the same purpose in string literals." +msgid "" +"As stated earlier, regular expressions use the backslash character (``'\\'``) to " +"indicate special forms or to allow special characters to be used without invoking " +"their special meaning. This conflicts with Python's usage of the same character for " +"the same purpose in string literals." msgstr "" +"همان‌طور که پیش‌تر گفته شد، عبارات باقاعده از نویسه‌ی بک‌اسلش (``'\\'``) استفاده می‌کنند " +"تا شکل‌های ویژه را نشان دهند یا اجازه دهند که نویسه‌های ویژه بدون فراخوانی معنای " +"ویژه‌ی آن‌ها به کار گرفته شوند. این موضوع با استفاده‌ی پایتون از همان نویسه برای همان " +"هدف در رشته‌های لفظی (string literals) تعارض دارد." -msgid "Let's say you want to write a RE that matches the string ``\\section``, which might be found in a LaTeX file. To figure out what to write in the program code, start with the desired string to be matched. Next, you must escape any backslashes and other metacharacters by preceding them with a backslash, resulting in the string ``\\\\section``. The resulting string that must be passed to :func:`re.compile` must be ``\\\\section``. However, to express this as a Python string literal, both backslashes must be escaped *again*." -msgstr "" +msgid "" +"Let's say you want to write a RE that matches the string ``\\section``, which might " +"be found in a LaTeX file. To figure out what to write in the program code, start " +"with the desired string to be matched. Next, you must escape any backslashes and " +"other metacharacters by preceding them with a backslash, resulting in the string " +"``\\\\section``. The resulting string that must be passed to :func:`re.compile` " +"must be ``\\\\section``. However, to express this as a Python string literal, both " +"backslashes must be escaped *again*." +msgstr "" +"فرض کنید می‌خواهید یک عبارت باقاعده (RE) بنویسید که با رشته‌ی ``\\section`` مطابقت " +"کند، که ممکن است در یک فایل LaTeX یافت شود. برای این‌که بدانید در کد برنامه چه " +"بنویسید، با رشته‌ی موردنظر برای مطابقت شروع کنید. سپس باید هر بک‌اسلش و سایر " +"متانویسه‌ها را با قرار دادن یک بک‌اسلش پیش از آن‌ها خنثی کنید، که در نتیجه رشته‌ی ``\\" +"\\section`` به دست می‌آید. رشته‌ی حاصل که باید به :func:`re.compile` داده شود، باید " +"``\\\\section`` باشد. با این حال، برای بیان این به‌عنوان یک رشته‌ی لفظی پایتون، هر دو " +"بک‌اسلش باید *دوباره* خنثی شوند." msgid "Characters" -msgstr "" +msgstr "نویسه‌ها" msgid "Stage" -msgstr "" +msgstr "مرحله" msgid "``\\section``" -msgstr "" +msgstr "``\\section``" msgid "Text string to be matched" -msgstr "" +msgstr "رشته‌ی متنی برای تطبیق" msgid "``\\\\section``" -msgstr "" +msgstr "``\\\\section``" msgid "Escaped backslash for :func:`re.compile`" -msgstr "" +msgstr "بک‌اسلش خنثی‌شده برای :func:`re.compile`" msgid "``\"\\\\\\\\section\"``" -msgstr "" +msgstr "``\"\\\\\\\\section\"``" msgid "Escaped backslashes for a string literal" -msgstr "" +msgstr "بک‌اسلش‌های خنثی‌شده برای یک رشته‌ی لفظی" -msgid "In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as the RE string, because the regular expression must be ``\\\\``, and each backslash must be expressed as ``\\\\`` inside a regular Python string literal. In REs that feature backslashes repeatedly, this leads to lots of repeated backslashes and makes the resulting strings difficult to understand." -msgstr "" +msgid "" +"In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as the RE " +"string, because the regular expression must be ``\\\\``, and each backslash must be " +"expressed as ``\\\\`` inside a regular Python string literal. In REs that feature " +"backslashes repeatedly, this leads to lots of repeated backslashes and makes the " +"resulting strings difficult to understand." +msgstr "" +"به‌طور خلاصه، برای تطبیق یک بک‌اسلش به‌صورت تحت‌اللفظی، باید ``'\\\\\\\\'`` را به‌عنوان " +"رشته‌ی عبارت باقاعده بنویسید، زیرا عبارت باقاعده باید ``\\\\`` باشد و هر بک‌اسلش باید " +"داخل یک رشته‌ی معمولی پایتون به‌صورت ``\\\\`` بیان شود. در عبارت‌های باقاعده‌ای که شامل " +"بک‌اسلش‌های مکرر هستند، این موضوع به تکرار زیاد بک‌اسلش‌ها منجر می‌شود و درک رشته‌های " +"حاصل را دشوار می‌سازد." -msgid "The solution is to use Python's raw string notation for regular expressions; backslashes are not handled in any special way in a string literal prefixed with ``'r'``, so ``r\"\\n\"`` is a two-character string containing ``'\\'`` and ``'n'``, while ``\"\\n\"`` is a one-character string containing a newline. Regular expressions will often be written in Python code using this raw string notation." -msgstr "" +msgid "" +"The solution is to use Python's raw string notation for regular expressions; " +"backslashes are not handled in any special way in a string literal prefixed with " +"``'r'``, so ``r\"\\n\"`` is a two-character string containing ``'\\'`` and ``'n'``, " +"while ``\"\\n\"`` is a one-character string containing a newline. Regular " +"expressions will often be written in Python code using this raw string notation." +msgstr "" +"راه‌حل این است که از نمادگذاری رشته‌ی خام پایتون برای عبارات منظم استفاده کنید؛ " +"بک‌اسلش‌ها در یک رشته‌ی ادبی با پیشوند ``'r'`` به هیچ شکل خاصی پردازش نمی‌شوند، بنابراین " +"``r\"\\n\"`` یک رشته‌ی دو نویسه‌ای است که شامل ``'\\'`` و ``'n'`` است، در حالی که " +"``\"\\n\"`` یک رشته‌ی تک‌نویسه‌ای است که شامل یک خط جدید است. عبارات منظم اغلب با " +"استفاده از این نمادگذاری رشته‌ی خام در کد پایتون نوشته می‌شوند." -msgid "In addition, special escape sequences that are valid in regular expressions, but not valid as Python string literals, now result in a :exc:`SyntaxWarning` and will eventually become a :exc:`SyntaxError`, which means the sequences will be invalid if raw string notation or escaping the backslashes isn't used." +msgid "" +"In addition, special escape sequences that are valid in regular expressions, but " +"not valid as Python string literals, now result in a :exc:`SyntaxWarning` and will " +"eventually become a :exc:`SyntaxError`, which means the sequences will be invalid " +"if raw string notation or escaping the backslashes isn't used." msgstr "" +"به‌علاوه، دنباله‌های خنثی‌سازی خاصی که در عبارات باقاعده معتبرند، اما به‌عنوان " +"مقادیر لفظی رشته پایتون معتبر نیستند، اکنون منجر به :exc:`SyntaxWarning` می‌شوند و " +"سرانجام به :exc:`SyntaxError` تبدیل خواهند شد؛ این بدان معناست که اگر از نمادگذاری " +"رشته خام یا خنثی کردن بک‌اسلش‌ها استفاده نشود، این دنباله‌ها نامعتبر خواهند بود." msgid "Regular String" -msgstr "" +msgstr "رشته معمولی" msgid "Raw string" -msgstr "" +msgstr "رشته خام" msgid "``\"ab*\"``" -msgstr "" +msgstr "``\"ab*\"``" msgid "``r\"ab*\"``" -msgstr "" +msgstr "``r\"ab*\"``" msgid "``r\"\\\\section\"``" -msgstr "" +msgstr "``r\"\\\\section\"``" msgid "``\"\\\\w+\\\\s+\\\\1\"``" -msgstr "" +msgstr "``\"\\\\w+\\\\s+\\\\1\"``" msgid "``r\"\\w+\\s+\\1\"``" -msgstr "" +msgstr "``r\"\\w+\\s+\\1\"``" msgid "Performing matches" -msgstr "" +msgstr "انجام تطبیق‌ها" -msgid "Once you have an object representing a compiled regular expression, what do you do with it? Pattern objects have several methods and attributes. Only the most significant ones will be covered here; consult the :mod:`re` docs for a complete listing." +msgid "" +"Once you have an object representing a compiled regular expression, what do you do " +"with it? Pattern objects have several methods and attributes. Only the most " +"significant ones will be covered here; consult the :mod:`re` docs for a complete " +"listing." msgstr "" +"هنگامی که یک شیء نشان‌دهنده یک عبارت باقاعده کامپایل‌شده دارید، با آن چه کار می‌کنید؟ " +"اشیای الگو چندین متد و ویژگی دارند. در اینجا فقط مهم‌ترین آن‌ها بررسی می‌شود؛ برای " +"فهرست کامل به مستندات :mod:`re` مراجعه کنید." msgid "Method/Attribute" -msgstr "" +msgstr "متد/ویژگی" msgid "Purpose" -msgstr "" +msgstr "هدف" msgid "``match()``" -msgstr "" +msgstr "``match()``" msgid "Determine if the RE matches at the beginning of the string." -msgstr "" +msgstr "تعیین می‌کند که آیا عبارت باقاعده در ابتدای رشته تطابق دارد یا خیر." msgid "``search()``" -msgstr "" +msgstr "``search()``" msgid "Scan through a string, looking for any location where this RE matches." msgstr "" +"یک رشته را پیمایش می‌کند و به دنبال هر موقعیتی می‌گردد که این عبارت باقاعده در آن مطابقت " +"دارد." msgid "``findall()``" -msgstr "" +msgstr "``findall()``" msgid "Find all substrings where the RE matches, and return them as a list." msgstr "" +"همه زیررشته‌هایی را که RE با آن‌ها مطابقت دارد پیدا می‌کند و آن‌ها را به‌صورت یک فهرست " +"برمی‌گرداند." msgid "``finditer()``" -msgstr "" +msgstr "``finditer()``" -msgid "Find all substrings where the RE matches, and return them as an :term:`iterator`." +msgid "" +"Find all substrings where the RE matches, and return them as an :term:`iterator`." msgstr "" +"تمام زیررشته‌هایی را که RE با آن‌ها مطابقت دارد پیدا کنید و آن‌ها را به‌عنوان " +"یک :term:`iterator` برگردانید." -msgid ":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if no match can be found. If they're successful, a :ref:`match object ` instance is returned, containing information about the match: where it starts and ends, the substring it matched, and more." +msgid "" +":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if no " +"match can be found. If they're successful, a :ref:`match object ` " +"instance is returned, containing information about the match: where it starts and " +"ends, the substring it matched, and more." msgstr "" +":meth:`~re.Pattern.match` و :meth:`~re.Pattern.search` در صورتی که هیچ تطابقی یافت " +"نشود، ``None`` برمی‌گردانند. اگر موفق باشند، نمونه‌ای از :ref:`شیء تطابق ` برگردانده می‌شود که حاوی اطلاعاتی درباره‌ی تطابق است: محل شروع و پایان آن، " +"زیررشته‌ای که با آن تطابق داشته است، و موارد دیگر." -msgid "You can learn about this by interactively experimenting with the :mod:`re` module." -msgstr "" +msgid "" +"You can learn about this by interactively experimenting with the :mod:`re` module." +msgstr "می‌توانید با آزمایش تعاملی ماژول :mod:`re`، درباره این موضوع بیاموزید." -msgid "This HOWTO uses the standard Python interpreter for its examples. First, run the Python interpreter, import the :mod:`re` module, and compile a RE::" +msgid "" +"This HOWTO uses the standard Python interpreter for its examples. First, run the " +"Python interpreter, import the :mod:`re` module, and compile a RE::" msgstr "" +"این HOWTO برای مثال‌های خود از مفسر استاندارد پایتون استفاده می‌کند. ابتدا مفسر " +"پایتون را اجرا کنید، ماژول :mod:`re` را ایمپورت کنید و یک RE را کامپایل کنید::" msgid "" ">>> import re\n" @@ -388,54 +782,87 @@ msgid "" ">>> p\n" "re.compile('[a-z]+')" msgstr "" +">>> import re\n" +">>> p = re.compile('[a-z]+')\n" +">>> p\n" +"re.compile('[a-z]+')" -msgid "Now, you can try matching various strings against the RE ``[a-z]+``. An empty string shouldn't match at all, since ``+`` means 'one or more repetitions'. :meth:`~re.Pattern.match` should return ``None`` in this case, which will cause the interpreter to print no output. You can explicitly print the result of :meth:`!match` to make this clear. ::" -msgstr "" +msgid "" +"Now, you can try matching various strings against the RE ``[a-z]+``. An empty " +"string shouldn't match at all, since ``+`` means 'one or more " +"repetitions'. :meth:`~re.Pattern.match` should return ``None`` in this case, which " +"will cause the interpreter to print no output. You can explicitly print the result " +"of :meth:`!match` to make this clear. ::" +msgstr "" +"اکنون می‌توانید تطبیق رشته‌های مختلف با عبارت باقاعده (RE) ``[a-z]+`` را امتحان کنید. یک " +"رشته خالی به‌هیچ‌وجه نباید تطبیق پیدا کند، زیرا ``+`` به معنای «یک یا چند تکرار» است. " +"در این حالت :meth:`~re.Pattern.match` باید ``None`` برگرداند، که باعث می‌شود مفسر " +"هیچ خروجی چاپ نکند. می‌توانید برای روشن‌تر شدن این موضوع، نتیجه :meth:`!match` را " +"به‌صورت صریح چاپ کنید. ::" msgid "" ">>> p.match(\"\")\n" ">>> print(p.match(\"\"))\n" "None" msgstr "" +">>> p.match(\"\")\n" +">>> print(p.match(\"\"))\n" +"None" -msgid "Now, let's try it on a string that it should match, such as ``tempo``. In this case, :meth:`~re.Pattern.match` will return a :ref:`match object `, so you should store the result in a variable for later use. ::" +msgid "" +"Now, let's try it on a string that it should match, such as ``tempo``. In this " +"case, :meth:`~re.Pattern.match` will return a :ref:`match object `, " +"so you should store the result in a variable for later use. ::" msgstr "" +"اکنون، بیایید آن را روی رشته‌ای که باید با آن تطبیق داشته باشد، مانند ``tempo`` " +"امتحان کنیم. در این حالت، :meth:`~re.Pattern.match` یک :ref:`شیء تطبیق ` برمی‌گرداند، بنابراین باید نتیجه را برای استفاده بعدی در یک متغیر ذخیره " +"کنید. ::" msgid "" ">>> m = p.match('tempo')\n" ">>> m\n" "" msgstr "" +">>> m = p.match('tempo')\n" +">>> m\n" +"" -msgid "Now you can query the :ref:`match object ` for information about the matching string. Match object instances also have several methods and attributes; the most important ones are:" +msgid "" +"Now you can query the :ref:`match object ` for information about the " +"matching string. Match object instances also have several methods and attributes; " +"the most important ones are:" msgstr "" +"اکنون می‌توانید برای دریافت اطلاعات درباره رشته‌ی تطبیق‌یافته، از :ref:`شیء تطبیق " +"` پرس‌وجو کنید. نمونه‌های شیء تطبیق همچنین چندین متد و ویژگی دارند؛ " +"مهم‌ترین آن‌ها عبارت‌اند از:" msgid "``group()``" -msgstr "" +msgstr "``group()``" msgid "Return the string matched by the RE" -msgstr "" +msgstr "رشته‌ی تطبیق‌یافته با RE را برمی‌گرداند" msgid "``start()``" -msgstr "" +msgstr "``start()``" msgid "Return the starting position of the match" -msgstr "" +msgstr "موقعیت شروع تطبیق را برمی‌گرداند" msgid "``end()``" -msgstr "" +msgstr "``end()``" msgid "Return the ending position of the match" -msgstr "" +msgstr "موقعیت پایانی تطابق را برمی‌گرداند" msgid "``span()``" -msgstr "" +msgstr "``span()``" msgid "Return a tuple containing the (start, end) positions of the match" -msgstr "" +msgstr "یک تاپل شامل موقعیت‌های (start, end) تطبیق را برمی‌گرداند" msgid "Trying these methods will soon clarify their meaning::" -msgstr "" +msgstr "آزمودن این متدها به‌زودی معنای آن‌ها را روشن خواهد کرد::" msgid "" ">>> m.group()\n" @@ -445,9 +872,29 @@ msgid "" ">>> m.span()\n" "(0, 5)" msgstr "" +">>> m.group()\n" +"'tempo'\n" +">>> m.start(), m.end()\n" +"(0, 5)\n" +">>> m.span()\n" +"(0, 5)" -msgid ":meth:`~re.Match.group` returns the substring that was matched by the RE. :meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and ending index of the match. :meth:`~re.Match.span` returns both start and end indexes in a single tuple. Since the :meth:`~re.Pattern.match` method only checks if the RE matches at the start of a string, :meth:`!start` will always be zero. However, the :meth:`~re.Pattern.search` method of patterns scans through the string, so the match may not start at zero in that case. ::" -msgstr "" +msgid "" +":meth:`~re.Match.group` returns the substring that was matched by the " +"RE. :meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " +"ending index of the match. :meth:`~re.Match.span` returns both start and end " +"indexes in a single tuple. Since the :meth:`~re.Pattern.match` method only checks " +"if the RE matches at the start of a string, :meth:`!start` will always be zero. " +"However, the :meth:`~re.Pattern.search` method of patterns scans through the " +"string, so the match may not start at zero in that case. ::" +msgstr "" +":meth:`~re.Match.group` زیررشته‌ای را برمی‌گرداند که با عبارت باقاعده مطابقت داشته " +"است. :meth:`~re.Match.start` و :meth:`~re.Match.end` اندیس‌های شروع و پایان تطابق " +"را برمی‌گردانند. :meth:`~re.Match.span` هر دو اندیس شروع و پایان را در یک تاپل واحد " +"برمی‌گرداند. از آن‌جا که متد :meth:`~re.Pattern.match` فقط بررسی می‌کند که آیا عبارت " +"باقاعده در ابتدای یک رشته تطابق دارد یا خیر، :meth:`!start` همیشه ۰ خواهد بود. با " +"این حال، متد :meth:`~re.Pattern.search` الگوها، رشته را پیمایش می‌کند، بنابراین در " +"آن حالت ممکن است تطابق از ۰ شروع نشود. ::" msgid "" ">>> print(p.match('::: message'))\n" @@ -459,9 +906,23 @@ msgid "" ">>> m.span()\n" "(4, 11)" msgstr "" +">>> print(p.match('::: message'))\n" +"None\n" +">>> m = p.search('::: message'); print(m)\n" +"\n" +">>> m.group()\n" +"'message'\n" +">>> m.span()\n" +"(4, 11)" -msgid "In actual programs, the most common style is to store the :ref:`match object ` in a variable, and then check if it was ``None``. This usually looks like::" +msgid "" +"In actual programs, the most common style is to store the :ref:`match object ` in a variable, and then check if it was ``None``. This usually looks " +"like::" msgstr "" +"در برنامه‌های واقعی، رایج‌ترین سبک این است که :ref:`شیء تطبیق ` را در " +"یک متغیر ذخیره کنید و سپس بررسی کنید که آیا ``None`` است یا خیر. این معمولاً به این " +"شکل است::" msgid "" "p = re.compile( ... )\n" @@ -471,21 +932,49 @@ msgid "" "else:\n" " print('No match')" msgstr "" +"p = re.compile( ... )\n" +"m = p.match( 'string goes here' )\n" +"if m:\n" +" print('Match found: ', m.group())\n" +"else:\n" +" print('No match')" -msgid "Two pattern methods return all of the matches for a pattern. :meth:`~re.Pattern.findall` returns a list of matching strings::" +msgid "" +"Two pattern methods return all of the matches for a " +"pattern. :meth:`~re.Pattern.findall` returns a list of matching strings::" msgstr "" +"دو متد الگو، همه‌ی تطابق‌های یک الگو را برمی‌گردانند. :meth:`~re.Pattern.findall` " +"فهرستی از رشته‌های مطابقت‌کننده را برمی‌گرداند::" msgid "" ">>> p = re.compile(r'\\d+')\n" ">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" "['12', '11', '10']" msgstr "" +">>> p = re.compile(r'\\d+')\n" +">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" +"['12', '11', '10']" -msgid "The ``r`` prefix, making the literal a raw string literal, is needed in this example because escape sequences in a normal \"cooked\" string literal that are not recognized by Python, as opposed to regular expressions, now result in a :exc:`SyntaxWarning` and will eventually become a :exc:`SyntaxError`. See :ref:`the-backslash-plague`." +msgid "" +"The ``r`` prefix, making the literal a raw string literal, is needed in this " +"example because escape sequences in a normal \"cooked\" string literal that are not " +"recognized by Python, as opposed to regular expressions, now result in " +"a :exc:`SyntaxWarning` and will eventually become a :exc:`SyntaxError`. " +"See :ref:`the-backslash-plague`." msgstr "" +"پیشوند ``r`` که این رشته را به یک رشته‌ی خام تبدیل می‌کند، در این مثال لازم است، زیرا " +"دنباله‌های فرار در یک رشته‌ی معمولی «پخته» (cooked) که توسط پایتون، برخلاف عبارات " +"باقاعده، شناسایی نمی‌شوند، اکنون منجر به :exc:`SyntaxWarning` می‌شوند و سرانجام " +"به :exc:`SyntaxError` تبدیل خواهند شد. به :ref:`the-backslash-plague` مراجعه کنید." -msgid ":meth:`~re.Pattern.findall` has to create the entire list before it can be returned as the result. The :meth:`~re.Pattern.finditer` method returns a sequence of :ref:`match object ` instances as an :term:`iterator`::" +msgid "" +":meth:`~re.Pattern.findall` has to create the entire list before it can be returned " +"as the result. The :meth:`~re.Pattern.finditer` method returns a sequence " +"of :ref:`match object ` instances as an :term:`iterator`::" msgstr "" +":meth:`~re.Pattern.findall` باید کل فهرست را ایجاد کند تا بتواند آن را به‌عنوان " +"نتیجه بازگرداند. متد :meth:`~re.Pattern.finditer` دنباله‌ای از نمونه‌های :ref:`شیء " +"تطبیق ` را به‌صورت یک :term:`پیمایش‌گر ` برمی‌گرداند::" msgid "" ">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" @@ -498,12 +987,33 @@ msgid "" "(22, 24)\n" "(29, 31)" msgstr "" +">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" +">>> iterator\n" +"\n" +">>> for match in iterator:\n" +"... print(match.span())\n" +"...\n" +"(0, 2)\n" +"(22, 24)\n" +"(29, 31)" msgid "Module-level functions" -msgstr "" +msgstr "توابع سطح ماژول" -msgid "You don't have to create a pattern object and call its methods; the :mod:`re` module also provides top-level functions called :func:`~re.match`, :func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, and so forth. These functions take the same arguments as the corresponding pattern method with the RE string added as the first argument, and still return either ``None`` or a :ref:`match object ` instance. ::" -msgstr "" +msgid "" +"You don't have to create a pattern object and call its methods; the :mod:`re` " +"module also provides top-level functions " +"called :func:`~re.match`, :func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, " +"and so forth. These functions take the same arguments as the corresponding pattern " +"method with the RE string added as the first argument, and still return either " +"``None`` or a :ref:`match object ` instance. ::" +msgstr "" +"شما مجبور نیستید یک شیء الگو ایجاد کنید و متدهای آن را فراخوانی کنید؛ " +"ماژول :mod:`re` همچنین توابع سطح بالایی به " +"نام‌های :func:`~re.match`، :func:`~re.search`، :func:`~re.findall`، :func:`~re.sub` " +"و غیره ارائه می‌دهد. این توابع همان آرگومان‌های متد متناظر الگو را، با اضافه شدن رشته " +"RE به‌عنوان اولین آرگومان، می‌پذیرند، و همچنان یا ``None`` یا نمونه‌ای از :ref:`شیء " +"تطبیق ` را برمی‌گردانند. ::" msgid "" ">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" @@ -511,90 +1021,231 @@ msgid "" ">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" "" msgstr "" +">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" +"None\n" +">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" +"" -msgid "Under the hood, these functions simply create a pattern object for you and call the appropriate method on it. They also store the compiled object in a cache, so future calls using the same RE won't need to parse the pattern again and again." +msgid "" +"Under the hood, these functions simply create a pattern object for you and call the " +"appropriate method on it. They also store the compiled object in a cache, so " +"future calls using the same RE won't need to parse the pattern again and again." msgstr "" +"در پشت صحنه، این توابع به‌سادگی یک شیء الگو برای شما ایجاد می‌کنند و متد مناسب را روی " +"آن فراخوانی می‌کنند. همچنین شیء کامپایل‌شده را در نهانگاه ذخیره می‌کنند، بنابراین " +"فراخوانی‌های آینده با استفاده از همان RE نیازی ندارند که الگو را دوباره و دوباره " +"تجزیه کنند." -msgid "Should you use these module-level functions, or should you get the pattern and call its methods yourself? If you're accessing a regex within a loop, pre-compiling it will save a few function calls. Outside of loops, there's not much difference thanks to the internal cache." +msgid "" +"Should you use these module-level functions, or should you get the pattern and call " +"its methods yourself? If you're accessing a regex within a loop, pre-compiling it " +"will save a few function calls. Outside of loops, there's not much difference " +"thanks to the internal cache." msgstr "" +"آیا باید از این توابع سطح ماژول استفاده کنید، یا باید خودتان الگو را دریافت کنید و " +"متدهای آن را فراخوانی کنید؟ اگر در یک حلقه از یک عبارت باقاعده استفاده می‌کنید، از " +"پیش کامپایل کردن آن باعث صرفه‌جویی در چند فراخوانی تابع می‌شود. خارج از حلقه‌ها، به " +"لطف نهانگاه داخلی تفاوت چندانی وجود ندارد." msgid "Compilation flags" -msgstr "" +msgstr "پرچم‌های کامپایل" -msgid "Compilation flags let you modify some aspects of how regular expressions work. Flags are available in the :mod:`re` module under two names, a long name such as :const:`IGNORECASE` and a short, one-letter form such as :const:`I`. (If you're familiar with Perl's pattern modifiers, the one-letter forms use the same letters; the short form of :const:`re.VERBOSE` is :const:`re.X`, for example.) Multiple flags can be specified by bitwise OR-ing them; ``re.I | re.M`` sets both the :const:`I` and :const:`M` flags, for example." -msgstr "" +msgid "" +"Compilation flags let you modify some aspects of how regular expressions work. " +"Flags are available in the :mod:`re` module under two names, a long name such " +"as :const:`IGNORECASE` and a short, one-letter form such as :const:`I`. (If you're " +"familiar with Perl's pattern modifiers, the one-letter forms use the same letters; " +"the short form of :const:`re.VERBOSE` is :const:`re.X`, for example.) Multiple " +"flags can be specified by bitwise OR-ing them; ``re.I | re.M`` sets both " +"the :const:`I` and :const:`M` flags, for example." +msgstr "" +"پرچم‌های کامپایل به شما امکان می‌دهند برخی جنبه‌های نحوه‌ی کار عبارات باقاعده را تغییر " +"دهید. پرچم‌ها در ماژول :mod:`re` با دو نام در دسترس هستند: نامی بلند " +"مانند :const:`IGNORECASE` و صورتی کوتاه و تک‌حرفی مانند :const:`I`. (اگر با " +"اصلاح‌کننده‌های الگوی Perl آشنا هستید، صورت‌های تک‌حرفی از همان حروف استفاده می‌کنند؛ " +"برای مثال، صورت کوتاه :const:`re.VERBOSE` برابر :const:`re.X` است.) می‌توان چند پرچم " +"را با OR بیتی کردن آن‌ها مشخص کرد؛ برای مثال، ``re.I | re.M`` هر دو پرچم :const:`I` " +"و :const:`M` را تنظیم می‌کند." -msgid "Here's a table of the available flags, followed by a more detailed explanation of each one." +msgid "" +"Here's a table of the available flags, followed by a more detailed explanation of " +"each one." msgstr "" +"در اینجا جدولی از پرچم‌های موجود آمده است و در ادامه، توضیح دقیق‌تری برای هر یک ارائه " +"می‌شود." msgid "Flag" -msgstr "" +msgstr "پرچم" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid ":const:`ASCII`, :const:`A`" -msgstr "" +msgstr ":const:`ASCII`, :const:`A`" -msgid "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only on ASCII characters with the respective property." +msgid "" +"Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only on " +"ASCII characters with the respective property." msgstr "" +"باعث می‌شود چندین دنباله‌ی خنثی‌سازی مانند ``\\w``، ``\\b``، ``\\s`` و ``\\d`` فقط با " +"نویسه‌های ASCII دارای ویژگی مربوطه مطابقت کنند." msgid ":const:`DOTALL`, :const:`S`" -msgstr "" +msgstr ":const:`DOTALL`, :const:`S`" msgid "Make ``.`` match any character, including newlines." -msgstr "" +msgstr "باعث می‌شود ``.`` با هر نویسه‌ای، از جمله خط‌های جدید، تطبیق داده شود." msgid ":const:`IGNORECASE`, :const:`I`" -msgstr "" +msgstr ":const:`IGNORECASE`, :const:`I`" msgid "Do case-insensitive matches." -msgstr "" +msgstr "تطبیق‌های بدون حساسیت به بزرگی و کوچکی حروف را انجام دهید." msgid ":const:`LOCALE`, :const:`L`" -msgstr "" +msgstr ":const:`LOCALE`, :const:`L`" msgid "Do a locale-aware match." -msgstr "" +msgstr "یک تطبیق آگاه از locale انجام دهید." msgid ":const:`MULTILINE`, :const:`M`" -msgstr "" +msgstr ":const:`MULTILINE`, :const:`M`" msgid "Multi-line matching, affecting ``^`` and ``$``." -msgstr "" +msgstr "تطبیق چندخطی، که بر ``^`` و ``$`` تأثیر می‌گذارد." msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" -msgstr "" +msgstr ":const:`VERBOSE`، :const:`X` (برای «گسترده»)" msgid "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" +"فعال‌سازی عبارت‌های باقاعده خوانا (verbose REs)، که می‌توان آن‌ها را منظم‌تر و قابل‌فهم‌تر " +"سازمان‌دهی کرد." -msgid "Perform case-insensitive matching; character class and literal strings will match letters by ignoring case. For example, ``[A-Z]`` will match lowercase letters, too. Full Unicode matching also works unless the :const:`ASCII` flag is used to disable non-ASCII matches. When the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, ``'spAM'``, or ``'ſpam'`` (the latter is matched only in Unicode mode). This lowercasing doesn't take the current locale into account; it will if you also set the :const:`LOCALE` flag." -msgstr "" +msgid "" +"Perform case-insensitive matching; character class and literal strings will match " +"letters by ignoring case. For example, ``[A-Z]`` will match lowercase letters, " +"too. Full Unicode matching also works unless the :const:`ASCII` flag is used to " +"disable non-ASCII matches. When the Unicode patterns ``[a-z]`` or ``[A-Z]`` are " +"used in combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " +"letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital letter I " +"with dot above), 'ı' (U+0131, Latin small letter dotless i), 'ſ' (U+017F, Latin " +"small letter long s) and 'K' (U+212A, Kelvin sign). ``Spam`` will match " +"``'Spam'``, ``'spam'``, ``'spAM'``, or ``'ſpam'`` (the latter is matched only in " +"Unicode mode). This lowercasing doesn't take the current locale into account; it " +"will if you also set the :const:`LOCALE` flag." +msgstr "" +"تطبیق بدون حساسیت به بزرگی و کوچکی حروف انجام می‌شود؛ کلاس‌های نویسه و رشته‌های " +"تحت‌اللفظی، حروف را با چشم‌پوشی از بزرگی و کوچکی تطبیق می‌دهند. برای مثال، ``[A-Z]`` " +"حروف کوچک را نیز تطبیق می‌دهد. تطبیق کامل یونیکد نیز کار می‌کند، مگر اینکه از " +"پرچم :const:`ASCII` برای غیرفعال‌سازی تطبیق‌های غیر ASCII استفاده شود. هنگامی که " +"الگوهای یونیکد ``[a-z]`` یا ``[A-Z]`` به همراه پرچم :const:`IGNORECASE` استفاده " +"شوند، آن‌ها ۵۲ حرف ASCII و ۴ حرف غیر ASCII دیگر را تطبیق خواهند داد: 'İ' (U+0130، " +"حرف بزرگ لاتین I با نقطه بالا)، 'ı' (U+0131، حرف کوچک لاتین i بدون نقطه)، 'ſ' " +"(U+017F، حرف کوچک لاتین s بلند) و 'K' (U+212A، علامت کلوین). ``Spam`` با " +"``'Spam'``، ``'spam'``، ``'spAM'`` یا ``'ſpam'`` تطبیق خواهد داشت (مورد آخر فقط در " +"حالت یونیکد تطبیق داده می‌شود). این تبدیل به حروف کوچک، locale (locale) فعلی را در نظر " +"نمی‌گیرد؛ اگر پرچم :const:`LOCALE` را نیز تنظیم کنید، در نظر خواهد گرفت." -msgid "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching dependent on the current locale instead of the Unicode database." +msgid "" +"Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching dependent on " +"the current locale instead of the Unicode database." msgstr "" +"تطبیق ``\\w``، ``\\W``، ``\\b``، ``\\B`` و تطبیق بدون حساسیت به بزرگی و کوچکی حروف " +"را به جای پایگاه داده‌ی یونیکد، به locale جاری وابسته می‌کند." -msgid "Locales are a feature of the C library intended to help in writing programs that take account of language differences. For example, if you're processing encoded French text, you'd want to be able to write ``\\w+`` to match words, but ``\\w`` only matches the character class ``[A-Za-z]`` in bytes patterns; it won't match bytes corresponding to ``é`` or ``ç``. If your system is configured properly and a French locale is selected, certain C functions will tell the program that the byte corresponding to ``é`` should also be considered a letter. Setting the :const:`LOCALE` flag when compiling a regular expression will cause the resulting compiled object to use these C functions for ``\\w``; this is slower, but also enables ``\\w+`` to match French words as you'd expect. The use of this flag is discouraged in Python 3 as the locale mechanism is very unreliable, it only handles one \"culture\" at a time, and it only works with 8-bit locales. Unicode matching is already enabled by default in Python 3 for Unicode (str) patterns, and it is able to handle different locales/languages." -msgstr "" +msgid "" +"Locales are a feature of the C library intended to help in writing programs that " +"take account of language differences. For example, if you're processing encoded " +"French text, you'd want to be able to write ``\\w+`` to match words, but ``\\w`` " +"only matches the character class ``[A-Za-z]`` in bytes patterns; it won't match " +"bytes corresponding to ``é`` or ``ç``. If your system is configured properly and a " +"French locale is selected, certain C functions will tell the program that the byte " +"corresponding to ``é`` should also be considered a letter. Setting " +"the :const:`LOCALE` flag when compiling a regular expression will cause the " +"resulting compiled object to use these C functions for ``\\w``; this is slower, but " +"also enables ``\\w+`` to match French words as you'd expect. The use of this flag " +"is discouraged in Python 3 as the locale mechanism is very unreliable, it only " +"handles one \"culture\" at a time, and it only works with 8-bit locales. Unicode " +"matching is already enabled by default in Python 3 for Unicode (str) patterns, and " +"it is able to handle different locales/languages." +msgstr "" +"locales (locales) یکی از امکانات کتابخانه‌ی C هستند که برای کمک به نوشتن برنامه‌هایی در " +"نظر گرفته شده‌اند که تفاوت‌های زبانی را در نظر می‌گیرند. برای مثال، اگر در حال پردازش " +"متن فرانسوی کدگذاری‌شده باشید، ممکن است بخواهید بتوانید ``\\w+`` را بنویسید تا " +"واژه‌ها را تطبیق دهد، اما ``\\w`` در الگوهای بایتی فقط با کلاس نویسه ``[A-Za-z]`` " +"تطبیق می‌کند؛ این با بایت‌های متناظر با ``é`` یا ``ç`` تطبیق نخواهد کرد. اگر سیستم " +"شما به‌درستی پیکربندی شده باشد و یک locale فرانسوی انتخاب شده باشد، برخی توابع C به " +"برنامه خواهند گفت که بایت متناظر با ``é`` نیز باید به‌عنوان یک حرف در نظر گرفته شود. " +"تنظیم پرچم :const:`LOCALE` هنگام کامپایل یک عبارت باقاعده باعث می‌شود شیء کامپایل‌شده‌ی " +"حاصل برای ``\\w`` از این توابع C استفاده کند؛ این کار کندتر است، اما همچنین امکان " +"می‌دهد ``\\w+`` همان‌طور که انتظار دارید با واژه‌های فرانسوی تطبیق کند. استفاده از این " +"پرچم در Python 3 توصیه نمی‌شود، زیرا سازوکار locale بسیار غیرقابل‌اعتماد است، در هر " +"زمان فقط یک «فرهنگ» را مدیریت می‌کند و فقط با localeهای ۸ بیتی کار می‌کند. تطبیق یونیکد " +"در Python 3 از قبل برای الگوهای یونیکد (str) به‌طور پیش‌فرض فعال است و می‌تواند localeها/" +"زبان‌های مختلف را مدیریت کند." -msgid "(``^`` and ``$`` haven't been explained yet; they'll be introduced in section :ref:`more-metacharacters`.)" +msgid "" +"(``^`` and ``$`` haven't been explained yet; they'll be introduced in " +"section :ref:`more-metacharacters`.)" msgstr "" +"(``^`` و ``$`` هنوز توضیح داده نشده‌اند؛ آن‌ها در بخش :ref:`more-metacharacters` " +"معرفی خواهند شد.)" -msgid "Usually ``^`` matches only at the beginning of the string, and ``$`` matches only at the end of the string and immediately before the newline (if any) at the end of the string. When this flag is specified, ``^`` matches at the beginning of the string and at the beginning of each line within the string, immediately following each newline. Similarly, the ``$`` metacharacter matches either at the end of the string and at the end of each line (immediately preceding each newline)." -msgstr "" +msgid "" +"Usually ``^`` matches only at the beginning of the string, and ``$`` matches only " +"at the end of the string and immediately before the newline (if any) at the end of " +"the string. When this flag is specified, ``^`` matches at the beginning of the " +"string and at the beginning of each line within the string, immediately following " +"each newline. Similarly, the ``$`` metacharacter matches either at the end of the " +"string and at the end of each line (immediately preceding each newline)." +msgstr "" +"معمولاً ``^`` تنها در ابتدای رشته تطابق دارد، و ``$`` تنها در پایان رشته و دقیقاً پیش " +"از خط جدید (در صورت وجود) در پایان رشته تطابق دارد. هنگامی که این پرچم تعیین شده " +"باشد، ``^`` در ابتدای رشته و در ابتدای هر خط درون رشته، دقیقاً پس از هر خط جدید، " +"تطابق دارد. به‌طور مشابه، فرانویسه‌ی ``$`` یا در پایان رشته یا در پایان هر خط (دقیقاً " +"پیش از هر خط جدید) تطابق دارد." -msgid "Makes the ``'.'`` special character match any character at all, including a newline; without this flag, ``'.'`` will match anything *except* a newline." +msgid "" +"Makes the ``'.'`` special character match any character at all, including a " +"newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" +"باعث می‌شود نویسه‌ی خاص ``'.'`` با هر نویسه‌ای، از جمله خط جدید، مطابقت کند؛ بدون این " +"پرچم، ``'.'`` با هر چیزی *به‌جز* خط جدید مطابقت خواهد کرد." -msgid "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-only matching instead of full Unicode matching. This is only meaningful for Unicode patterns, and is ignored for byte patterns." +msgid "" +"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-only " +"matching instead of full Unicode matching. This is only meaningful for Unicode " +"patterns, and is ignored for byte patterns." msgstr "" +"باعث می‌شود ``\\w``، ``\\W``، ``\\b``، ``\\B``، ``\\s`` و ``\\S`` به‌جای تطبیق کامل " +"یونیکد، تطبیق فقط ASCII را انجام دهند. این موضوع فقط برای الگوهای یونیکدی معنادار " +"است و برای الگوهای بایتی نادیده گرفته می‌شود." -msgid "This flag allows you to write regular expressions that are more readable by granting you more flexibility in how you can format them. When this flag has been specified, whitespace within the RE string is ignored, except when the whitespace is in a character class or preceded by an unescaped backslash; this lets you organize and indent the RE more clearly. This flag also lets you put comments within a RE that will be ignored by the engine; comments are marked by a ``'#'`` that's neither in a character class nor preceded by an unescaped backslash." -msgstr "" +msgid "" +"This flag allows you to write regular expressions that are more readable by " +"granting you more flexibility in how you can format them. When this flag has been " +"specified, whitespace within the RE string is ignored, except when the whitespace " +"is in a character class or preceded by an unescaped backslash; this lets you " +"organize and indent the RE more clearly. This flag also lets you put comments " +"within a RE that will be ignored by the engine; comments are marked by a ``'#'`` " +"that's neither in a character class nor preceded by an unescaped backslash." +msgstr "" +"این پرچم به شما امکان می‌دهد عبارت‌های باقاعده خواناتری بنویسید، زیرا انعطاف‌پذیری " +"بیشتری در نحوه قالب‌بندی آن‌ها در اختیار شما قرار می‌دهد. هنگامی که این پرچم مشخص شده " +"باشد، فضای سفید درون رشته عبارت باقاعده نادیده گرفته می‌شود، مگر وقتی که فضای سفید " +"در یک کلاس نویسه باشد یا پیش از آن یک بک‌اسلش خنثی‌نشده قرار داشته باشد؛ این امر به " +"شما امکان می‌دهد عبارت باقاعده را واضح‌تر سازمان‌دهی و تورفتگی‌گذاری کنید. این پرچم " +"همچنین به شما امکان می‌دهد کامنت‌هایی را درون یک عبارت باقاعده قرار دهید که توسط موتور " +"نادیده گرفته می‌شوند؛ کامنت‌ها با یک ``'#'`` مشخص می‌شوند که نه در یک کلاس نویسه باشد " +"و نه پیش از آن یک بک‌اسلش خنثی‌نشده قرار داشته باشد." -msgid "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier it is to read? ::" +msgid "" +"For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier it is " +"to read? ::" msgstr "" +"برای مثال، در اینجا یک عبارت باقاعده (RE) آمده است که از :const:`re.VERBOSE` " +"استفاده می‌کند؛ ببینید چقدر خواندن آن آسان‌تر است؟ ::" msgid "" "charref = re.compile(r\"\"\"\n" @@ -607,51 +1258,117 @@ msgid "" " ; # Trailing semicolon\n" "\"\"\", re.VERBOSE)" msgstr "" +"charref = re.compile(r\"\"\"\n" +" &[#] # Start of a numeric entity reference\n" +" (\n" +" 0[0-7]+ # Octal form\n" +" | [0-9]+ # Decimal form\n" +" | x[0-9a-fA-F]+ # Hexadecimal form\n" +" )\n" +" ; # Trailing semicolon\n" +"\"\"\", re.VERBOSE)" msgid "Without the verbose setting, the RE would look like this::" -msgstr "" +msgstr "بدون تنظیم verbose، RE به این شکل خواهد بود::" msgid "" "charref = re.compile(\"&#(0[0-7]+\"\n" " \"|[0-9]+\"\n" " \"|x[0-9a-fA-F]+);\")" msgstr "" +"charref = re.compile(\"&#(0[0-7]+\"\n" +" \"|[0-9]+\"\n" +" \"|x[0-9a-fA-F]+);\")" -msgid "In the above example, Python's automatic concatenation of string literals has been used to break up the RE into smaller pieces, but it's still more difficult to understand than the version using :const:`re.VERBOSE`." +msgid "" +"In the above example, Python's automatic concatenation of string literals has been " +"used to break up the RE into smaller pieces, but it's still more difficult to " +"understand than the version using :const:`re.VERBOSE`." msgstr "" +"در مثال بالا، از الحاق خودکار رشته‌های ثابت در پایتون برای شکستن عبارت باقاعده (RE) به " +"قطعات کوچک‌تر استفاده شده است، اما درک آن هنوز از نسخه‌ای که از :const:`re.VERBOSE` " +"استفاده می‌کند، دشوارتر است." msgid "More pattern power" -msgstr "" +msgstr "قدرت بیشتر الگوها" -msgid "So far we've only covered a part of the features of regular expressions. In this section, we'll cover some new metacharacters, and how to use groups to retrieve portions of the text that was matched." +msgid "" +"So far we've only covered a part of the features of regular expressions. In this " +"section, we'll cover some new metacharacters, and how to use groups to retrieve " +"portions of the text that was matched." msgstr "" +"تاکنون تنها بخشی از قابلیت‌های عبارت‌های باقاعده را بررسی کرده‌ایم. در این بخش، برخی " +"فرانویسه‌های جدید و چگونگی استفاده از گروه‌ها برای بازیابی بخش‌هایی از متنی که تطبیق " +"داده شده است را بررسی خواهیم کرد." msgid "More metacharacters" -msgstr "" +msgstr "فرانویسه‌های بیشتر" -msgid "There are some metacharacters that we haven't covered yet. Most of them will be covered in this section." +msgid "" +"There are some metacharacters that we haven't covered yet. Most of them will be " +"covered in this section." msgstr "" +"هنوز برخی از فرانویسه‌ها پوشش داده نشده‌اند. بیشتر آن‌ها در این بخش پوشش داده خواهند " +"شد." -msgid "Some of the remaining metacharacters to be discussed are :dfn:`zero-width assertions`. They don't cause the engine to advance through the string; instead, they consume no characters at all, and simply succeed or fail. For example, ``\\b`` is an assertion that the current position is located at a word boundary; the position isn't changed by the ``\\b`` at all. This means that zero-width assertions should never be repeated, because if they match once at a given location, they can obviously be matched an infinite number of times." -msgstr "" +msgid "" +"Some of the remaining metacharacters to be discussed are :dfn:`zero-width " +"assertions`. They don't cause the engine to advance through the string; instead, " +"they consume no characters at all, and simply succeed or fail. For example, " +"``\\b`` is an assertion that the current position is located at a word boundary; " +"the position isn't changed by the ``\\b`` at all. This means that zero-width " +"assertions should never be repeated, because if they match once at a given " +"location, they can obviously be matched an infinite number of times." +msgstr "" +"برخی از فرانویسه‌های باقی‌مانده که مورد بحث قرار خواهند گرفت، :dfn:` شرط‌های با عرض صفر " +"` هستند. آن‌ها باعث نمی‌شوند موتور در رشته پیشروی کند؛ در عوض، " +"اصلاً هیچ نویسه‌ای مصرف نمی‌کنند و صرفاً موفق یا ناموفق می‌شوند. برای مثال، ``\\b`` " +"ادعایی است مبنی بر اینکه موقعیت فعلی در یک مرز کلمه قرار دارد؛ موقعیت به‌هیچ‌وجه توسط " +"``\\b`` تغییر نمی‌کند. این بدان معناست که شرط‌های با عرض صفر هرگز نباید تکرار شوند، زیرا " +"اگر یک بار در یک مکان مشخص تطابق داشته باشند، بدیهی است که می‌توانند بی‌نهایت بار " +"تطابق یابند." msgid "``|``" -msgstr "" +msgstr "``|``" -msgid "Alternation, or the \"or\" operator. If *A* and *B* are regular expressions, ``A|B`` will match any string that matches either *A* or *B*. ``|`` has very low precedence in order to make it work reasonably when you're alternating multi-character strings. ``Crow|Servo`` will match either ``'Crow'`` or ``'Servo'``, not ``'Cro'``, a ``'w'`` or an ``'S'``, and ``'ervo'``." -msgstr "" +msgid "" +"Alternation, or the \"or\" operator. If *A* and *B* are regular expressions, ``A|" +"B`` will match any string that matches either *A* or *B*. ``|`` has very low " +"precedence in order to make it work reasonably when you're alternating multi-" +"character strings. ``Crow|Servo`` will match either ``'Crow'`` or ``'Servo'``, not " +"``'Cro'``, a ``'w'`` or an ``'S'``, and ``'ervo'``." +msgstr "" +"جایگزینی، یا عملگر «یا». اگر *A* و *B* عبارت‌های باقاعده باشند، ``A|B`` با هر رشته‌ای " +"که با *A* یا *B* مطابقت داشته باشد، مطابقت می‌کند. ``|`` اولویت بسیار پایینی دارد تا " +"هنگام جایگزینی بین رشته‌های چند نویسه‌ای به‌طور معقولی کار کند. ``Crow|Servo`` با " +"``'Crow'`` یا ``'Servo'`` مطابقت می‌کند، نه با ``'Cro'``، یک ``'w'`` یا یک ``'S'``، " +"و ``'ervo'``." -msgid "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character class, as in ``[|]``." +msgid "" +"To match a literal ``'|'``, use ``\\|``, or enclose it inside a character class, as " +"in ``[|]``." msgstr "" +"برای تطبیق ``'|'`` به‌صورت تحت‌اللفظی، از ``\\|`` استفاده کنید، یا آن را داخل یک کلاس " +"نویسه قرار دهید، مانند ``[|]``." msgid "``^``" -msgstr "" +msgstr "``^``" -msgid "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has been set, this will only match at the beginning of the string. In :const:`MULTILINE` mode, this also matches immediately after each newline within the string." +msgid "" +"Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has been " +"set, this will only match at the beginning of the string. In :const:`MULTILINE` " +"mode, this also matches immediately after each newline within the string." msgstr "" +"در ابتدای خطوط تطابق می‌یابد. مگر اینکه پرچم :const:`MULTILINE` تنظیم شده باشد، این " +"فقط در ابتدای رشته تطابق خواهد یافت. در حالت :const:`MULTILINE`، این بلافاصله پس از " +"هر خط جدید در داخل رشته نیز تطابق می‌یابد." -msgid "For example, if you wish to match the word ``From`` only at the beginning of a line, the RE to use is ``^From``. ::" +msgid "" +"For example, if you wish to match the word ``From`` only at the beginning of a " +"line, the RE to use is ``^From``. ::" msgstr "" +"برای مثال، اگر می‌خواهید کلمه ``From`` فقط در ابتدای یک خط تطابق داده شود، عبارت " +"باقاعده‌ای که باید استفاده کنید ``^From`` است. ::" msgid "" ">>> print(re.search('^From', 'From Here to Eternity'))\n" @@ -659,15 +1376,23 @@ msgid "" ">>> print(re.search('^From', 'Reciting From Memory'))\n" "None" msgstr "" +">>> print(re.search('^From', 'From Here to Eternity'))\n" +"\n" +">>> print(re.search('^From', 'Reciting From Memory'))\n" +"None" msgid "To match a literal ``'^'``, use ``\\^``." -msgstr "" +msgstr "برای تطبیق یک ``'^'`` تحت‌اللفظی، از ``\\^`` استفاده کنید." msgid "``$``" -msgstr "" +msgstr "``$``" -msgid "Matches at the end of a line, which is defined as either the end of the string, or any location followed by a newline character. ::" +msgid "" +"Matches at the end of a line, which is defined as either the end of the string, or " +"any location followed by a newline character. ::" msgstr "" +"در پایان یک خط تطابق پیدا می‌کند؛ پایان خط به‌صورت پایان رشته یا هر مکانی که پس از آن " +"یک نویسه‌ی خط جدید باشد تعریف می‌شود. ::" msgid "" ">>> print(re.search('}$', '{block}'))\n" @@ -677,36 +1402,64 @@ msgid "" ">>> print(re.search('}$', '{block}\\n'))\n" "" msgstr "" +">>> print(re.search('}$', '{block}'))\n" +"\n" +">>> print(re.search('}$', '{block} '))\n" +"None\n" +">>> print(re.search('}$', '{block}\\n'))\n" +"" -msgid "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character class, as in ``[$]``." +msgid "" +"To match a literal ``'$'``, use ``\\$`` or enclose it inside a character class, as " +"in ``[$]``." msgstr "" +"برای تطبیق ``'$'`` به‌صورت تحت‌اللفظی، از ``\\$`` استفاده کنید یا آن را درون یک کلاس " +"نویسه قرار دهید، مانند ``[$]``." msgid "``\\A``" -msgstr "" +msgstr "``\\A``" -msgid "Matches only at the start of the string. When not in :const:`MULTILINE` mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` mode, they're different: ``\\A`` still matches only at the beginning of the string, but ``^`` may match at any location inside the string that follows a newline character." +msgid "" +"Matches only at the start of the string. When not in :const:`MULTILINE` mode, " +"``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` mode, they're " +"different: ``\\A`` still matches only at the beginning of the string, but ``^`` may " +"match at any location inside the string that follows a newline character." msgstr "" +"فقط در ابتدای رشته مطابقت می‌کند. هنگامی که حالت :const:`MULTILINE` فعال نباشد، " +"``\\A`` و ``^`` عملاً یکسان هستند. در حالت :const:`MULTILINE`، این دو متفاوت هستند: " +"``\\A`` همچنان فقط در ابتدای رشته مطابقت می‌کند، اما ``^`` ممکن است در هر جای داخل " +"رشته که پس از یک نویسه‌ی خط جدید قرار داشته باشد، مطابقت کند." msgid "``\\z``" -msgstr "" +msgstr "``\\z``" msgid "Matches only at the end of the string." -msgstr "" +msgstr "فقط در انتهای رشته مطابقت می‌کند." msgid "``\\Z``" -msgstr "" +msgstr "``\\Z``" msgid "The same as ``\\z``. For compatibility with old Python versions." -msgstr "" +msgstr "همان ``\\z`` است. برای سازگاری با نسخه‌های قدیمی پایتون." msgid "``\\b``" -msgstr "" +msgstr "``\\b``" -msgid "Word boundary. This is a zero-width assertion that matches only at the beginning or end of a word. A word is defined as a sequence of alphanumeric characters, so the end of a word is indicated by whitespace or a non-alphanumeric character." +msgid "" +"Word boundary. This is a zero-width assertion that matches only at the beginning " +"or end of a word. A word is defined as a sequence of alphanumeric characters, so " +"the end of a word is indicated by whitespace or a non-alphanumeric character." msgstr "" +"صفر مرز کلمه. این یک شرط با عرض صفر (zero-width assertion) است که فقط در آغاز یا پایان " +"یک کلمه تطابق می‌یابد. یک کلمه به‌عنوان دنباله‌ای از نویسه‌های الفبایی-عددی تعریف " +"می‌شود، بنابراین پایان یک کلمه با فضای خالی یا نویسه‌ای غیرالفبایی-عددی مشخص می‌شود." -msgid "The following example matches ``class`` only when it's a complete word; it won't match when it's contained inside another word. ::" +msgid "" +"The following example matches ``class`` only when it's a complete word; it won't " +"match when it's contained inside another word. ::" msgstr "" +"مثال زیر فقط زمانی ``class`` را تطبیق می‌دهد که یک کلمه کامل باشد؛ وقتی درون کلمه‌ای " +"دیگر قرار داشته باشد، تطبیق داده نخواهد شد. ::" msgid "" ">>> p = re.compile(r'\\bclass\\b')\n" @@ -717,9 +1470,30 @@ msgid "" ">>> print(p.search('one subclass is'))\n" "None" msgstr "" +">>> p = re.compile(r'\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"\n" +">>> print(p.search('the declassified algorithm'))\n" +"None\n" +">>> print(p.search('one subclass is'))\n" +"None" -msgid "There are two subtleties you should remember when using this special sequence. First, this is the worst collision between Python's string literals and regular expression sequences. In Python's string literals, ``\\b`` is the backspace character, ASCII value 8. If you're not using raw strings, then Python will convert the ``\\b`` to a backspace, and your RE won't match as you expect it to. The following example looks the same as our previous RE, but omits the ``'r'`` in front of the RE string. ::" -msgstr "" +msgid "" +"There are two subtleties you should remember when using this special sequence. " +"First, this is the worst collision between Python's string literals and regular " +"expression sequences. In Python's string literals, ``\\b`` is the backspace " +"character, ASCII value 8. If you're not using raw strings, then Python will " +"convert the ``\\b`` to a backspace, and your RE won't match as you expect it to. " +"The following example looks the same as our previous RE, but omits the ``'r'`` in " +"front of the RE string. ::" +msgstr "" +"دو نکته‌ی ظریف وجود دارد که باید هنگام استفاده از این دنباله‌ی خاص آن‌ها را به‌خاطر " +"بسپارید. اول، این بدترین تداخل میان رشته‌های لفظی پایتون و دنباله‌های عبارت باقاعده " +"است. در رشته‌های لفظی پایتون، ``\\b`` نویسه‌ی پس‌بر (backspace) با مقدار ASCII ۸ است. " +"اگر از رشته‌های خام استفاده نمی‌کنید، پایتون ``\\b`` را به یک پس‌بر (backspace) تبدیل " +"می‌کند و عبارت باقاعده‌ی شما آن‌طور که انتظار دارید تطابق نخواهد کرد. مثال زیر همانند " +"عبارت باقاعده‌ی قبلی ما به نظر می‌رسد، اما ``'r'`` را از ابتدای رشته‌ی عبارت باقاعده " +"حذف می‌کند. ::" msgid "" ">>> p = re.compile('\\bclass\\b')\n" @@ -728,21 +1502,44 @@ msgid "" ">>> print(p.search('\\b' + 'class' + '\\b'))\n" "" msgstr "" +">>> p = re.compile('\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"None\n" +">>> print(p.search('\\b' + 'class' + '\\b'))\n" +"" -msgid "Second, inside a character class, where there's no use for this assertion, ``\\b`` represents the backspace character, for compatibility with Python's string literals." +msgid "" +"Second, inside a character class, where there's no use for this assertion, ``\\b`` " +"represents the backspace character, for compatibility with Python's string literals." msgstr "" +"دوم، داخل یک کلاس نویسه، جایی که این ادعا کاربردی ندارد، ``\\b`` نشان‌دهنده‌ی نویسه‌ی " +"پس‌بر (backspace) است، برای سازگاری با مقادیر لفظی رشته‌ای پایتون." msgid "``\\B``" -msgstr "" +msgstr "``\\B``" -msgid "Another zero-width assertion, this is the opposite of ``\\b``, only matching when the current position is not at a word boundary." +msgid "" +"Another zero-width assertion, this is the opposite of ``\\b``, only matching when " +"the current position is not at a word boundary." msgstr "" +"یک شرط با عرض صفر (zero-width assertion) دیگر، این متضاد ``\\b`` است و فقط زمانی " +"مطابقت می‌کند که موقعیت فعلی در مرز واژه نباشد." msgid "Grouping" -msgstr "" +msgstr "گروه‌بندی" -msgid "Frequently you need to obtain more information than just whether the RE matched or not. Regular expressions are often used to dissect strings by writing a RE divided into several subgroups which match different components of interest. For example, an RFC-822 header line is divided into a header name and a value, separated by a ``':'``, like this:" -msgstr "" +msgid "" +"Frequently you need to obtain more information than just whether the RE matched or " +"not. Regular expressions are often used to dissect strings by writing a RE divided " +"into several subgroups which match different components of interest. For example, " +"an RFC-822 header line is divided into a header name and a value, separated by a " +"``':'``, like this:" +msgstr "" +"اغلب نیاز دارید اطلاعات بیشتری بیش از صرفاً اینکه آیا عبارت باقاعده تطابق داشته است " +"یا خیر، به دست آورید. از عبارات باقاعده اغلب برای تجزیه رشته‌ها با نوشتن یک عبارت " +"باقاعده تقسیم‌شده به چند زیرگروه که با اجزای مختلف مورد نظر تطابق دارند، استفاده " +"می‌شود. برای مثال، یک خط سرآیند RFC-822 به یک نام سرآیند و یک مقدار تقسیم می‌شود که با " +"یک ``':'`` از هم جدا شده‌اند؛ مانند این:" msgid "" "From: author@example.com\n" @@ -750,21 +1547,58 @@ msgid "" "MIME-Version: 1.0\n" "To: editor@example.com" msgstr "" +"From: author@example.com\n" +"User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" +"MIME-Version: 1.0\n" +"To: editor@example.com" -msgid "This can be handled by writing a regular expression which matches an entire header line, and has one group which matches the header name, and another group which matches the header's value." +msgid "" +"This can be handled by writing a regular expression which matches an entire header " +"line, and has one group which matches the header name, and another group which " +"matches the header's value." msgstr "" +"این مورد را می‌توان با نوشتن یک عبارت باقاعده مدیریت کرد که با کل خط سرآیند تطابق " +"دارد و دارای یک گروه است که با نام سرآیند تطابق دارد، و گروه دیگری که با مقدار سرآیند " +"تطابق دارد." -msgid "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and ``')'`` have much the same meaning as they do in mathematical expressions; they group together the expressions contained inside them, and you can repeat the contents of a group with a quantifier, such as ``*``, ``+``, ``?``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more repetitions of ``ab``. ::" -msgstr "" +msgid "" +"Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and ``')'`` have " +"much the same meaning as they do in mathematical expressions; they group together " +"the expressions contained inside them, and you can repeat the contents of a group " +"with a quantifier, such as ``*``, ``+``, ``?``, or ``{m,n}``. For example, " +"``(ab)*`` will match zero or more repetitions of ``ab``. ::" +msgstr "" +"گروه‌ها با فرانویسه‌های ``'('`` و ``')'`` مشخص می‌شوند. ``'('`` و ``')'`` تقریباً همان " +"معنایی را دارند که در عبارات ریاضی دارند؛ آن‌ها عبارات درون خود را با هم گروه‌بندی " +"می‌کنند، و شما می‌توانید محتوای یک گروه را با یک کمیت‌گذار (quantifier)، مانند ``*``، " +"``+``، ``?`` یا ``{m,n}`` تکرار کنید. برای مثال، ``(ab)*`` با صفر یا چند تکرار از " +"``ab`` مطابقت می‌کند. ::" msgid "" ">>> p = re.compile('(ab)*')\n" ">>> print(p.match('ababababab').span())\n" "(0, 10)" msgstr "" +">>> p = re.compile('(ab)*')\n" +">>> print(p.match('ababababab').span())\n" +"(0, 10)" -msgid "Groups indicated with ``'('``, ``')'`` also capture the starting and ending index of the text that they match; this can be retrieved by passing an argument to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re.Match.end`, and :meth:`~re.Match.span`. Groups are numbered starting with 0. Group 0 is always present; it's the whole RE, so :ref:`match object ` methods all have group 0 as their default argument. Later we'll see how to express groups that don't capture the span of text that they match. ::" -msgstr "" +msgid "" +"Groups indicated with ``'('``, ``')'`` also capture the starting and ending index " +"of the text that they match; this can be retrieved by passing an argument " +"to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re.Match.end`, " +"and :meth:`~re.Match.span`. Groups are numbered starting with 0. Group 0 is " +"always present; it's the whole RE, so :ref:`match object ` methods " +"all have group 0 as their default argument. Later we'll see how to express groups " +"that don't capture the span of text that they match. ::" +msgstr "" +"گروه‌های مشخص‌شده با ``'('`` و ``')'`` همچنین اندیس‌های آغاز و پایان متنی را که تطبیق " +"می‌دهند ضبط می‌کنند؛ این را می‌توان با ارسال یک آرگومان " +"به :meth:`~re.Match.group`، :meth:`~re.Match.start`، :meth:`~re.Match.end` " +"و :meth:`~re.Match.span` بازیابی کرد. گروه‌ها از ۰ شماره‌گذاری می‌شوند. گروه ۰ همیشه " +"وجود دارد؛ این گروه کل RE است، بنابراین تمام متدهای :ref:`شیء تطبیق ` گروه ۰ را به‌عنوان آرگومان پیش‌فرض خود دارند. در ادامه خواهیم دید که چگونه " +"گروه‌هایی را بیان کنیم که بازه‌ی متنی را که تطبیق می‌دهند ضبط نمی‌کنند. ::" msgid "" ">>> p = re.compile('(a)b')\n" @@ -774,9 +1608,20 @@ msgid "" ">>> m.group(0)\n" "'ab'" msgstr "" +">>> p = re.compile('(a)b')\n" +">>> m = p.match('ab')\n" +">>> m.group()\n" +"'ab'\n" +">>> m.group(0)\n" +"'ab'" -msgid "Subgroups are numbered from left to right, from 1 upward. Groups can be nested; to determine the number, just count the opening parenthesis characters, going from left to right. ::" +msgid "" +"Subgroups are numbered from left to right, from 1 upward. Groups can be nested; to " +"determine the number, just count the opening parenthesis characters, going from " +"left to right. ::" msgstr "" +"زیرگروه‌ها از چپ به راست، از ۱ به بعد شماره‌گذاری می‌شوند. گروه‌ها می‌توانند تودرتو " +"باشند؛ برای تعیین شماره، کافی است نویسه‌های پرانتز باز را از چپ به راست بشمارید. ::" msgid "" ">>> p = re.compile('(a(b)c)d')\n" @@ -788,58 +1633,152 @@ msgid "" ">>> m.group(2)\n" "'b'" msgstr "" +">>> p = re.compile('(a(b)c)d')\n" +">>> m = p.match('abcd')\n" +">>> m.group(0)\n" +"'abcd'\n" +">>> m.group(1)\n" +"'abc'\n" +">>> m.group(2)\n" +"'b'" -msgid ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in which case it will return a tuple containing the corresponding values for those groups. ::" +msgid "" +":meth:`~re.Match.group` can be passed multiple group numbers at a time, in which " +"case it will return a tuple containing the corresponding values for those groups. ::" msgstr "" +"می‌توان چندین شماره گروه را به‌صورت همزمان به :meth:`~re.Match.group` ارسال کرد، که " +"در این صورت یک تاپل شامل مقادیر متناظر برای آن گروه‌ها برمی‌گرداند. ::" msgid "" ">>> m.group(2,1,2)\n" "('b', 'abc', 'b')" msgstr "" +">>> m.group(2,1,2)\n" +"('b', 'abc', 'b')" -msgid "The :meth:`~re.Match.groups` method returns a tuple containing the strings for all the subgroups, from 1 up to however many there are. ::" +msgid "" +"The :meth:`~re.Match.groups` method returns a tuple containing the strings for all " +"the subgroups, from 1 up to however many there are. ::" msgstr "" +"متد :meth:`~re.Match.groups` یک تاپل شامل رشته‌های تمام زیرگروه‌ها، از ۱ تا هر تعداد " +"که وجود داشته باشد، برمی‌گرداند. ::" msgid "" ">>> m.groups()\n" "('abc', 'b')" msgstr "" +">>> m.groups()\n" +"('abc', 'b')" -msgid "Backreferences in a pattern allow you to specify that the contents of an earlier capturing group must also be found at the current location in the string. For example, ``\\1`` will succeed if the exact contents of group 1 can be found at the current position, and fails otherwise. Remember that Python's string literals also use a backslash followed by numbers to allow including arbitrary characters in a string, so be sure to use a raw string when incorporating backreferences in a RE." -msgstr "" +msgid "" +"Backreferences in a pattern allow you to specify that the contents of an earlier " +"capturing group must also be found at the current location in the string. For " +"example, ``\\1`` will succeed if the exact contents of group 1 can be found at the " +"current position, and fails otherwise. Remember that Python's string literals also " +"use a backslash followed by numbers to allow including arbitrary characters in a " +"string, so be sure to use a raw string when incorporating backreferences in a RE." +msgstr "" +"بازارجاع‌ها در یک الگو به شما امکان می‌دهند مشخص کنید که محتوای یک گروه " +"گیرانداز پیشین نیز باید در موقعیت فعلی در رشته یافت شود. برای مثال، اگر محتوای دقیق " +"گروه ۱ در موقعیت فعلی یافت شود، ``\\1`` موفق می‌شود و در غیر این صورت شکست می‌خورد. " +"به یاد داشته باشید که مقادیر لفظی رشته در پایتون نیز از یک بک‌اسلش و سپس اعداد برای " +"امکان گنجاندن نویسه‌های دلخواه در رشته استفاده می‌کنند، بنابراین هنگام به‌کارگیری " +"بازارجاع‌ها در یک RE، حتماً از یک رشته خام استفاده کنید." msgid "For example, the following RE detects doubled words in a string. ::" -msgstr "" +msgstr "برای مثال، عبارت باقاعده (RE) زیر کلمات تکراری در یک رشته را تشخیص می‌دهد. ::" msgid "" ">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" ">>> p.search('Paris in the the spring').group()\n" "'the the'" msgstr "" +">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" -msgid "Backreferences like this aren't often useful for just searching through a string --- there are few text formats which repeat data in this way --- but you'll soon find out that they're *very* useful when performing string substitutions." +msgid "" +"Backreferences like this aren't often useful for just searching through a string " +"--- there are few text formats which repeat data in this way --- but you'll soon " +"find out that they're *very* useful when performing string substitutions." msgstr "" +"این‌گونه بازارجاع‌ها (backreferences) معمولاً صرفاً برای جست‌وجو در یک رشته چندان " +"مفید نیستند --- قالب‌های متنی کمی وجود دارند که داده‌ها را به این شکل تکرار می‌کنند " +"--- اما به‌زودی متوجه خواهید شد که هنگام انجام جایگزینی‌های رشته‌ای *بسیار* مفید هستند." msgid "Non-capturing and named groups" -msgstr "" +msgstr "گروه‌های غیرگیرنده و نام‌دار" -msgid "Elaborate REs may use many groups, both to capture substrings of interest, and to group and structure the RE itself. In complex REs, it becomes difficult to keep track of the group numbers. There are two features which help with this problem. Both of them use a common syntax for regular expression extensions, so we'll look at that first." -msgstr "" +msgid "" +"Elaborate REs may use many groups, both to capture substrings of interest, and to " +"group and structure the RE itself. In complex REs, it becomes difficult to keep " +"track of the group numbers. There are two features which help with this problem. " +"Both of them use a common syntax for regular expression extensions, so we'll look " +"at that first." +msgstr "" +"عبارات باقاعده مفصل ممکن است از گروه‌های زیادی استفاده کنند، هم برای گرفتن " +"زیررشته‌های موردنظر و هم برای گروه‌بندی و ساختاردهی خود عبارت باقاعده. در عبارات " +"باقاعده پیچیده، پیگیری شماره‌های گروه دشوار می‌شود. دو قابلیت وجود دارند که به حل این " +"مشکل کمک می‌کنند. هر دوی آن‌ها از یک سینتکس مشترک برای افزونه‌های عبارت باقاعده " +"استفاده می‌کنند، بنابراین ابتدا آن را بررسی خواهیم کرد." -msgid "Perl 5 is well known for its powerful additions to standard regular expressions. For these new features the Perl developers couldn't choose new single-keystroke metacharacters or new special sequences beginning with ``\\`` without making Perl's regular expressions confusingly different from standard REs. If they chose ``&`` as a new metacharacter, for example, old expressions would be assuming that ``&`` was a regular character and wouldn't have escaped it by writing ``\\&`` or ``[&]``." -msgstr "" +msgid "" +"Perl 5 is well known for its powerful additions to standard regular expressions. " +"For these new features the Perl developers couldn't choose new single-keystroke " +"metacharacters or new special sequences beginning with ``\\`` without making Perl's " +"regular expressions confusingly different from standard REs. If they chose ``&`` " +"as a new metacharacter, for example, old expressions would be assuming that ``&`` " +"was a regular character and wouldn't have escaped it by writing ``\\&`` or ``[&]``." +msgstr "" +"Perl 5 به دلیل افزودنی‌های قدرتمندش به عبارت‌های باقاعده استاندارد به‌خوبی شناخته شده " +"است. برای این قابلیت‌های جدید، توسعه‌دهندگان Perl نمی‌توانستند متانویسه‌های تک‌کلیدی " +"جدید یا دنباله‌های خاص جدیدی را که با ``\\`` آغاز می‌شوند انتخاب کنند، بدون آنکه " +"عبارت‌های باقاعده Perl را به‌شکلی گیج‌کننده از REهای استاندارد متفاوت کنند. برای مثال، " +"اگر آن‌ها ``&`` را به‌عنوان یک متانویسه جدید انتخاب می‌کردند، عبارت‌های قدیمی فرض " +"می‌کردند که ``&`` یک نویسه معمولی است و آن را با نوشتن ``\\&`` یا ``[&]`` خنثی " +"نمی‌کردند." -msgid "The solution chosen by the Perl developers was to use ``(?...)`` as the extension syntax. ``?`` immediately after a parenthesis was a syntax error because the ``?`` would have nothing to repeat, so this didn't introduce any compatibility problems. The characters immediately after the ``?`` indicate what extension is being used, so ``(?=foo)`` is one thing (a positive lookahead assertion) and ``(?:foo)`` is something else (a non-capturing group containing the subexpression ``foo``)." -msgstr "" +msgid "" +"The solution chosen by the Perl developers was to use ``(?...)`` as the extension " +"syntax. ``?`` immediately after a parenthesis was a syntax error because the ``?`` " +"would have nothing to repeat, so this didn't introduce any compatibility problems. " +"The characters immediately after the ``?`` indicate what extension is being used, " +"so ``(?=foo)`` is one thing (a positive lookahead assertion) and ``(?:foo)`` is " +"something else (a non-capturing group containing the subexpression ``foo``)." +msgstr "" +"راه‌حلی که توسعه‌دهندگان Perl انتخاب کردند، استفاده از ``(?...)`` به‌عنوان سینتکس " +"گسترش بود. ``?`` بلافاصله پس از یک پرانتز یک خطای سینتکسی بود، زیرا ``?`` هیچ چیزی " +"برای تکرار نداشت؛ بنابراین این موضوع هیچ مشکل سازگاری‌ای ایجاد نکرد. نویسه‌های " +"بلافاصله پس از ``?`` نشان می‌دهند که کدام گسترش استفاده می‌شود، بنابراین ``(?=foo)`` " +"یک چیز است (یک ادعای پیش‌نگر مثبت (positive lookahead assertion)) و ``(?:foo)`` چیز " +"دیگری است (یک گروه غیرثبت‌کننده (non-capturing group) شامل زیرعبارت ``foo``)." -msgid "Python supports several of Perl's extensions and adds an extension syntax to Perl's extension syntax. If the first character after the question mark is a ``P``, you know that it's an extension that's specific to Python." +msgid "" +"Python supports several of Perl's extensions and adds an extension syntax to Perl's " +"extension syntax. If the first character after the question mark is a ``P``, you " +"know that it's an extension that's specific to Python." msgstr "" +"پایتون از چندین افزونه‌ی پرل پشتیبانی می‌کند و یک نحو افزونه را به نحو افزونه‌ی پرل " +"اضافه می‌کند. اگر اولین نویسه پس از علامت سؤال ``P`` باشد، می‌دانید که این یک افزونه‌ی " +"مختص پایتون است." -msgid "Now that we've looked at the general extension syntax, we can return to the features that simplify working with groups in complex REs." +msgid "" +"Now that we've looked at the general extension syntax, we can return to the " +"features that simplify working with groups in complex REs." msgstr "" +"اکنون که سینتکس کلی گسترش را بررسی کردیم، می‌توانیم به قابلیت‌هایی بازگردیم که کار با " +"گروه‌ها را در عبارات باقاعده‌ی پیچیده ساده می‌کنند." -msgid "Sometimes you'll want to use a group to denote a part of a regular expression, but aren't interested in retrieving the group's contents. You can make this fact explicit by using a non-capturing group: ``(?:...)``, where you can replace the ``...`` with any other regular expression. ::" +msgid "" +"Sometimes you'll want to use a group to denote a part of a regular expression, but " +"aren't interested in retrieving the group's contents. You can make this fact " +"explicit by using a non-capturing group: ``(?:...)``, where you can replace the " +"``...`` with any other regular expression. ::" msgstr "" +"گاهی ممکن است بخواهید از یک گروه برای مشخص کردن بخشی از یک عبارت باقاعده استفاده کنید، " +"اما مایل به بازیابی محتوای گروه نباشید. می‌توانید این موضوع را با استفاده از یک گروه " +"غیرثبت‌کننده (non-capturing group) به‌صراحت بیان کنید: ``(?:...)``، که در آن " +"می‌توانید ``...`` را با هر عبارت باقاعده دیگری جایگزین کنید. ::" msgid "" ">>> m = re.match(\"([abc])+\", \"abc\")\n" @@ -849,15 +1788,55 @@ msgid "" ">>> m.groups()\n" "()" msgstr "" +">>> m = re.match(\"([abc])+\", \"abc\")\n" +">>> m.groups()\n" +"('c',)\n" +">>> m = re.match(\"(?:[abc])+\", \"abc\")\n" +">>> m.groups()\n" +"()" -msgid "Except for the fact that you can't retrieve the contents of what the group matched, a non-capturing group behaves exactly the same as a capturing group; you can put anything inside it, repeat it with a repetition metacharacter such as ``*``, and nest it within other groups (capturing or non-capturing). ``(?:...)`` is particularly useful when modifying an existing pattern, since you can add new groups without changing how all the other groups are numbered. It should be mentioned that there's no performance difference in searching between capturing and non-capturing groups; neither form is any faster than the other." -msgstr "" +msgid "" +"Except for the fact that you can't retrieve the contents of what the group matched, " +"a non-capturing group behaves exactly the same as a capturing group; you can put " +"anything inside it, repeat it with a repetition metacharacter such as ``*``, and " +"nest it within other groups (capturing or non-capturing). ``(?:...)`` is " +"particularly useful when modifying an existing pattern, since you can add new " +"groups without changing how all the other groups are numbered. It should be " +"mentioned that there's no performance difference in searching between capturing and " +"non-capturing groups; neither form is any faster than the other." +msgstr "" +"به‌جز این واقعیت که نمی‌توانید محتوای آنچه را که گروه با آن مطابقت کرده است بازیابی " +"کنید، گروه غیرثبت‌کننده دقیقاً مانند گروه گیرنده رفتار می‌کند؛ می‌توانید هر چیزی را درون " +"آن قرار دهید، آن را با یک فرانویسه‌ی تکرار مانند ``*`` تکرار کنید و آن را درون " +"گروه‌های دیگر (ثبت‌کننده یا غیرثبت‌کننده) تودرتو کنید. ``(?:...)`` به‌ویژه هنگام تغییر یک " +"الگوی موجود مفید است، زیرا می‌توانید بدون آنکه نحوه‌ی شماره‌گذاری همه‌ی گروه‌های دیگر " +"تغییر کند، گروه‌های جدیدی اضافه کنید. لازم است ذکر شود که هیچ تفاوت عملکردی در جستجو " +"میان گروه‌های ثبت‌کننده و غیرثبت‌کننده وجود ندارد؛ هیچ‌یک از این دو شکل سریع‌تر از دیگری " +"نیست." -msgid "A more significant feature is named groups: instead of referring to them by numbers, groups can be referenced by a name." +msgid "" +"A more significant feature is named groups: instead of referring to them by " +"numbers, groups can be referenced by a name." msgstr "" +"ویژگی مهم‌تر، گروه‌های نام‌گذاری‌شده است: به‌جای ارجاع به آن‌ها با شماره‌ها، می‌توان گروه‌ها " +"را با یک نام ارجاع داد." -msgid "The syntax for a named group is one of the Python-specific extensions: ``(?P...)``. *name* is, obviously, the name of the group. Named groups behave exactly like capturing groups, and additionally associate a name with a group. The :ref:`match object ` methods that deal with capturing groups all accept either integers that refer to the group by number or strings that contain the desired group's name. Named groups are still given numbers, so you can retrieve information about a group in two ways::" -msgstr "" +msgid "" +"The syntax for a named group is one of the Python-specific extensions: ``(?" +"P...)``. *name* is, obviously, the name of the group. Named groups behave " +"exactly like capturing groups, and additionally associate a name with a group. " +"The :ref:`match object ` methods that deal with capturing groups all " +"accept either integers that refer to the group by number or strings that contain " +"the desired group's name. Named groups are still given numbers, so you can " +"retrieve information about a group in two ways::" +msgstr "" +"نحو یک گروه نام‌دار یکی از افزونه‌های خاص پایتون است: ``(?P...)``. *name*، " +"همان‌طور که پیداست، نام گروه است. گروه‌های نام‌دار دقیقاً مانند گروه‌های گیرانداز رفتار " +"می‌کنند و علاوه بر این، نامی را به یک گروه مرتبط می‌سازند. متدهای :ref:`شیء تطبیق " +"` که با گروه‌های گیرانداز سروکار دارند، همگی یا اعداد صحیحی را " +"می‌پذیرند که با شماره به گروه ارجاع می‌دهند یا رشته‌هایی را که شامل نام گروه موردنظر " +"هستند. گروه‌های نام‌دار همچنان شماره‌گذاری می‌شوند، بنابراین می‌توانید اطلاعات مربوط به " +"یک گروه را به دو روش بازیابی کنید::" msgid "" ">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" @@ -867,18 +1846,36 @@ msgid "" ">>> m.group(1)\n" "'Lots'" msgstr "" +">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" +">>> m = p.search( '(((( Lots of punctuation )))' )\n" +">>> m.group('word')\n" +"'Lots'\n" +">>> m.group(1)\n" +"'Lots'" -msgid "Additionally, you can retrieve named groups as a dictionary with :meth:`~re.Match.groupdict`::" +msgid "" +"Additionally, you can retrieve named groups as a dictionary " +"with :meth:`~re.Match.groupdict`::" msgstr "" +"علاوه بر این، می‌توانید گروه‌های نام‌گذاری‌شده را با :meth:`~re.Match.groupdict` " +"به‌عنوان یک دیکشنری بازیابی کنید::" msgid "" ">>> m = re.match(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" ">>> m.groupdict()\n" "{'first': 'Jane', 'last': 'Doe'}" msgstr "" +">>> m = re.match(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" +">>> m.groupdict()\n" +"{'first': 'Jane', 'last': 'Doe'}" -msgid "Named groups are handy because they let you use easily remembered names, instead of having to remember numbers. Here's an example RE from the :mod:`imaplib` module::" +msgid "" +"Named groups are handy because they let you use easily remembered names, instead of " +"having to remember numbers. Here's an example RE from the :mod:`imaplib` module::" msgstr "" +"گروه‌های نام‌گذاری‌شده مفید هستند، زیرا به شما اجازه می‌دهند به‌جای اینکه مجبور باشید " +"اعداد را به‌خاطر بیاورید، از نام‌هایی که به‌راحتی به‌خاطر سپرده می‌شوند استفاده کنید. در " +"اینجا یک نمونه RE از ماژول :mod:`imaplib` آمده است::" msgid "" "InternalDate = re.compile(r'INTERNALDATE \"'\n" @@ -888,123 +1885,274 @@ msgid "" " r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" " r'\"')" msgstr "" +"InternalDate = re.compile(r'INTERNALDATE \"'\n" +" r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" +" r'(?P[0-9][0-9][0-9][0-9])'\n" +" r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'\n" +" r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" +" r'\"')" -msgid "It's obviously much easier to retrieve ``m.group('zonem')``, instead of having to remember to retrieve group 9." +msgid "" +"It's obviously much easier to retrieve ``m.group('zonem')``, instead of having to " +"remember to retrieve group 9." msgstr "" +"بدیهی است که بازیابی ``m.group('zonem')`` بسیار آسان‌تر است، به‌جای اینکه مجبور باشید " +"به یاد داشته باشید که گروه ۹ را بازیابی کنید." -msgid "The syntax for backreferences in an expression such as ``(...)\\1`` refers to the number of the group. There's naturally a variant that uses the group name instead of the number. This is another Python extension: ``(?P=name)`` indicates that the contents of the group called *name* should again be matched at the current point. The regular expression for finding doubled words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?P\\w+)\\s+(?P=word)\\b``::" -msgstr "" +msgid "" +"The syntax for backreferences in an expression such as ``(...)\\1`` refers to the " +"number of the group. There's naturally a variant that uses the group name instead " +"of the number. This is another Python extension: ``(?P=name)`` indicates that the " +"contents of the group called *name* should again be matched at the current point. " +"The regular expression for finding doubled words, ``\\b(\\w+)\\s+\\1\\b`` can also " +"be written as ``\\b(?P\\w+)\\s+(?P=word)\\b``::" +msgstr "" +"سینتکس ارجاع به عقب (backreference) در عبارتی مانند ``(...)\\1`` به شماره‌ی گروه " +"اشاره می‌کند. طبیعتاً گونه‌ای وجود دارد که به‌جای شماره از نام گروه استفاده می‌کند. این " +"یک افزونه‌ی دیگر از پایتون است: ``(?P=name)`` نشان می‌دهد که محتوای گروهی به نام " +"*name* باید دوباره در موقعیت فعلی تطبیق داده شود. عبارت باقاعده برای یافتن کلمات " +"تکراری، ``\\b(\\w+)\\s+\\1\\b`` را همچنین می‌توان به‌صورت ``\\b(?P\\w+)\\s+(?" +"P=word)\\b`` نوشت::" msgid "" ">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" ">>> p.search('Paris in the the spring').group()\n" "'the the'" msgstr "" +">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" msgid "Lookahead assertions" -msgstr "" +msgstr "ادعاهای پیش‌نگر (Lookahead assertions)" -msgid "Another zero-width assertion is the lookahead assertion. Lookahead assertions are available in both positive and negative form, and look like this:" +msgid "" +"Another zero-width assertion is the lookahead assertion. Lookahead assertions are " +"available in both positive and negative form, and look like this:" msgstr "" +"یک شرط با عرض‌صفر (zero-width assertion) دیگر، ادعای پیش‌نگر (lookahead assertion) " +"است. ادعاهای پیش‌نگر در هر دو صورت مثبت و منفی در دسترس هستند و به این شکل‌اند:" msgid "``(?=...)``" -msgstr "" +msgstr "``(?=...)``" -msgid "Positive lookahead assertion. This succeeds if the contained regular expression, represented here by ``...``, successfully matches at the current location, and fails otherwise. But, once the contained expression has been tried, the matching engine doesn't advance at all; the rest of the pattern is tried right where the assertion started." -msgstr "" +msgid "" +"Positive lookahead assertion. This succeeds if the contained regular expression, " +"represented here by ``...``, successfully matches at the current location, and " +"fails otherwise. But, once the contained expression has been tried, the matching " +"engine doesn't advance at all; the rest of the pattern is tried right where the " +"assertion started." +msgstr "" +"ادعای پیش‌نگر مثبت . این ادعا در صورتی موفق می‌شود که " +"عبارت باقاعده‌ی داخلی، که در اینجا با ``...`` نمایش داده شده است، در موقعیت فعلی با " +"موفقیت تطبیق یابد، و در غیر این صورت ناموفق می‌شود. اما، پس از اینکه عبارت داخلی " +"آزمایش شد، موتور تطبیق به هیچ وجه جلو نمی‌رود؛ بقیه‌ی الگو دقیقاً در همان‌جایی که ادعا " +"شروع شده بود آزمایش می‌شود." msgid "``(?!...)``" -msgstr "" +msgstr "``(?!...)``" -msgid "Negative lookahead assertion. This is the opposite of the positive assertion; it succeeds if the contained expression *doesn't* match at the current position in the string." +msgid "" +"Negative lookahead assertion. This is the opposite of the positive assertion; it " +"succeeds if the contained expression *doesn't* match at the current position in the " +"string." msgstr "" +"ادعای پیش‌نگر منفی (negative lookahead assertion). این ادعا نقطه مقابل ادعای مثبت " +"است؛ اگر عبارت درون آن در موقعیت فعلی رشته *مطابقت نداشته باشد*، موفق می‌شود." -msgid "To make this concrete, let's look at a case where a lookahead is useful. Consider a simple pattern to match a filename and split it apart into a base name and an extension, separated by a ``.``. For example, in ``news.rc``, ``news`` is the base name, and ``rc`` is the filename's extension." +msgid "" +"To make this concrete, let's look at a case where a lookahead is useful. Consider a " +"simple pattern to match a filename and split it apart into a base name and an " +"extension, separated by a ``.``. For example, in ``news.rc``, ``news`` is the base " +"name, and ``rc`` is the filename's extension." msgstr "" +"برای ملموس‌تر کردن این موضوع، موردی را بررسی می‌کنیم که در آن یک پیش‌نگری (lookahead) " +"مفید است. یک الگوی ساده را برای تطبیق یک نام فایل و تقسیم آن به نام پایه و پسوند، " +"که با ``.`` از هم جدا شده‌اند، در نظر بگیرید. برای مثال، در ``news.rc``، ``news`` " +"نام پایه است و ``rc`` پسوند نام فایل است." msgid "The pattern to match this is quite simple:" -msgstr "" +msgstr "الگو برای تطبیق این بسیار ساده است:" msgid "``.*[.].*$``" -msgstr "" +msgstr "``.*[.].*$``" -msgid "Notice that the ``.`` needs to be treated specially because it's a metacharacter, so it's inside a character class to only match that specific character. Also notice the trailing ``$``; this is added to ensure that all the rest of the string must be included in the extension. This regular expression matches ``foo.bar`` and ``autoexec.bat`` and ``sendmail.cf`` and ``printers.conf``." -msgstr "" +msgid "" +"Notice that the ``.`` needs to be treated specially because it's a metacharacter, " +"so it's inside a character class to only match that specific character. Also " +"notice the trailing ``$``; this is added to ensure that all the rest of the string " +"must be included in the extension. This regular expression matches ``foo.bar`` and " +"``autoexec.bat`` and ``sendmail.cf`` and ``printers.conf``." +msgstr "" +"توجه داشته باشید که ``.`` باید به‌صورت خاصی با آن رفتار شود، زیرا یک فرانویسه است؛ " +"بنابراین داخل یک کلاس نویسه قرار گرفته است تا فقط همان نویسه‌ی خاص را تطبیق دهد. " +"همچنین به ``$`` پایانی توجه داشته باشید؛ این مورد اضافه شده است تا اطمینان حاصل شود " +"که تمام باقی‌مانده‌ی رشته باید در پسوند گنجانده شود. این عبارت باقاعده با ``foo.bar`` " +"و ``autoexec.bat`` و ``sendmail.cf`` و ``printers.conf`` تطبیق دارد." -msgid "Now, consider complicating the problem a bit; what if you want to match filenames where the extension is not ``bat``? Some incorrect attempts:" +msgid "" +"Now, consider complicating the problem a bit; what if you want to match filenames " +"where the extension is not ``bat``? Some incorrect attempts:" msgstr "" +"اکنون، مسئله را کمی پیچیده‌تر در نظر بگیرید؛ اگر بخواهید نام فایل‌هایی را تطبیق دهید " +"که پسوندشان ``bat`` نیست، چه؟ چند تلاش نادرست:" msgid "``.*[.][^b].*$``" -msgstr "" +msgstr "``.*[.][^b].*$``" -msgid "The first attempt above tries to exclude ``bat`` by requiring that the first character of the extension is not a ``b``. This is wrong, because the pattern also doesn't match ``foo.bar``." +msgid "" +"The first attempt above tries to exclude ``bat`` by requiring that the first " +"character of the extension is not a ``b``. This is wrong, because the pattern also " +"doesn't match ``foo.bar``." msgstr "" +"نخستین تلاش در بالا سعی می‌کند ``bat`` را با این شرط که نخستین نویسه‌ی پسوند یک ``b`` " +"نباشد، مستثنا کند. این اشتباه است، زیرا الگو نیز با ``foo.bar`` مطابقت ندارد." msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" -msgstr "" +msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -msgid "The expression gets messier when you try to patch up the first solution by requiring one of the following cases to match: the first character of the extension isn't ``b``; the second character isn't ``a``; or the third character isn't ``t``. This accepts ``foo.bar`` and rejects ``autoexec.bat``, but it requires a three-letter extension and won't accept a filename with a two-letter extension such as ``sendmail.cf``. We'll complicate the pattern again in an effort to fix it." -msgstr "" +msgid "" +"The expression gets messier when you try to patch up the first solution by " +"requiring one of the following cases to match: the first character of the extension " +"isn't ``b``; the second character isn't ``a``; or the third character isn't ``t``. " +"This accepts ``foo.bar`` and rejects ``autoexec.bat``, but it requires a three-" +"letter extension and won't accept a filename with a two-letter extension such as " +"``sendmail.cf``. We'll complicate the pattern again in an effort to fix it." +msgstr "" +"هنگامی که سعی کنید راه‌حل اول را با الزام تطابق یکی از حالت‌های زیر اصلاح کنید، عبارت " +"آشفته‌تر می‌شود: نویسه اول پسوند ``b`` نباشد؛ نویسه دوم ``a`` نباشد؛ یا نویسه سوم " +"``t`` نباشد. این عبارت ``foo.bar`` را می‌پذیرد و ``autoexec.bat`` را رد می‌کند، اما " +"به یک پسوند سه‌حرفی نیاز دارد و نام فایلی با پسوند دوحرفی مانند ``sendmail.cf`` را " +"نمی‌پذیرد. در تلاش برای اصلاح آن، بار دیگر الگو را پیچیده خواهیم کرد." msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -msgstr "" +msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -msgid "In the third attempt, the second and third letters are all made optional in order to allow matching extensions shorter than three characters, such as ``sendmail.cf``." +msgid "" +"In the third attempt, the second and third letters are all made optional in order " +"to allow matching extensions shorter than three characters, such as ``sendmail.cf``." msgstr "" +"در سومین تلاش، دومین و سومین نویسه هر دو اختیاری شده‌اند تا امکان تطبیق پسوندهایی که " +"کوتاه‌تر از ۳ نویسه هستند، مانند ``sendmail.cf`` فراهم شود." -msgid "The pattern's getting really complicated now, which makes it hard to read and understand. Worse, if the problem changes and you want to exclude both ``bat`` and ``exe`` as extensions, the pattern would get even more complicated and confusing." +msgid "" +"The pattern's getting really complicated now, which makes it hard to read and " +"understand. Worse, if the problem changes and you want to exclude both ``bat`` and " +"``exe`` as extensions, the pattern would get even more complicated and confusing." msgstr "" +"الگو اکنون واقعاً پیچیده شده است، که همین موضوع خواندن و درک آن را دشوار می‌کند. بدتر " +"از آن، اگر مسئله تغییر کند و بخواهید هر دو ``bat`` و ``exe`` را به‌عنوان پسوند " +"مستثنا کنید، الگو حتی پیچیده‌تر و گیج‌کننده‌تر می‌شود." msgid "A negative lookahead cuts through all this confusion:" -msgstr "" +msgstr "یک پیش‌نگر منفی (negative lookahead) تمام این سردرگمی را برطرف می‌کند:" msgid "``.*[.](?!bat$)[^.]*$``" -msgstr "" +msgstr "``.*[.](?!bat$)[^.]*$``" -msgid "The negative lookahead means: if the expression ``bat`` doesn't match at this point, try the rest of the pattern; if ``bat$`` does match, the whole pattern will fail. The trailing ``$`` is required to ensure that something like ``sample.batch``, where the extension only starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that the pattern works when there are multiple dots in the filename." -msgstr "" +msgid "" +"The negative lookahead means: if the expression ``bat`` doesn't match at this " +"point, try the rest of the pattern; if ``bat$`` does match, the whole pattern will " +"fail. The trailing ``$`` is required to ensure that something like " +"``sample.batch``, where the extension only starts with ``bat``, will be allowed. " +"The ``[^.]*`` makes sure that the pattern works when there are multiple dots in the " +"filename." +msgstr "" +"منظور از پیش‌نگری منفی (negative lookahead) این است: اگر عبارت ``bat`` در این نقطه " +"مطابقت نداشته باشد، بقیه‌ی الگو امتحان می‌شود؛ اگر ``bat$`` مطابقت داشته باشد، کل " +"الگو شکست خواهد خورد. ``$`` پایانی لازم است تا اطمینان حاصل شود که موردی مانند " +"``sample.batch``، که پسوند آن فقط با ``bat`` شروع می‌شود، مجاز خواهد بود. ``[^.]*`` " +"اطمینان حاصل می‌کند که الگو در صورت وجود چند نقطه در نام فایل کار می‌کند." -msgid "Excluding another filename extension is now easy; simply add it as an alternative inside the assertion. The following pattern excludes filenames that end in either ``bat`` or ``exe``:" +msgid "" +"Excluding another filename extension is now easy; simply add it as an alternative " +"inside the assertion. The following pattern excludes filenames that end in either " +"``bat`` or ``exe``:" msgstr "" +"مستثنی کردن یک پسوند نام فایل دیگر اکنون آسان است؛ کافی است آن را به‌عنوان یک " +"جایگزین درون ادعا (assertion) اضافه کنید. الگوی زیر نام فایل‌هایی را که به ``bat`` " +"یا ``exe`` ختم می‌شوند، مستثنی می‌کند:" msgid "``.*[.](?!bat$|exe$)[^.]*$``" -msgstr "" +msgstr "``.*[.](?!bat$|exe$)[^.]*$``" msgid "Modifying strings" -msgstr "" +msgstr "تغییر رشته‌ها" -msgid "Up to this point, we've simply performed searches against a static string. Regular expressions are also commonly used to modify strings in various ways, using the following pattern methods:" +msgid "" +"Up to this point, we've simply performed searches against a static string. Regular " +"expressions are also commonly used to modify strings in various ways, using the " +"following pattern methods:" msgstr "" +"تا این مرحله، ما صرفاً جست‌وجوهایی را روی یک رشته‌ی ثابت انجام داده‌ایم. عبارت‌های " +"باقاعده همچنین معمولاً برای اصلاح رشته‌ها به روش‌های مختلف، با استفاده از متدهای الگوی " +"زیر به کار می‌روند:" msgid "``split()``" -msgstr "" +msgstr "``split()``" msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" +"رشته را به یک فهرست تقسیم می‌کند، به‌گونه‌ای که در هر جایی که RE تطابق داشته باشد، " +"تقسیم می‌شود." msgid "``sub()``" -msgstr "" +msgstr "``sub()``" -msgid "Find all substrings where the RE matches, and replace them with a different string" +msgid "" +"Find all substrings where the RE matches, and replace them with a different string" msgstr "" +"تمام زیررشته‌هایی را که عبارت باقاعده با آن‌ها مطابقت دارد، پیدا کنید و آن‌ها را با " +"رشته دیگری جایگزین کنید" msgid "``subn()``" -msgstr "" +msgstr "``subn()``" -msgid "Does the same thing as :meth:`!sub`, but returns the new string and the number of replacements" +msgid "" +"Does the same thing as :meth:`!sub`, but returns the new string and the number of " +"replacements" msgstr "" +"همان کار :meth:`!sub` را انجام می‌دهد، اما رشته جدید و تعداد جایگزینی‌ها را " +"برمی‌گرداند." msgid "Splitting strings" -msgstr "" +msgstr "جداسازی رشته‌ها" -msgid "The :meth:`~re.Pattern.split` method of a pattern splits a string apart wherever the RE matches, returning a list of the pieces. It's similar to the :meth:`~str.split` method of strings but provides much more generality in the delimiters that you can split by; string :meth:`!split` only supports splitting by whitespace or by a fixed string. As you'd expect, there's a module-level :func:`re.split` function, too." -msgstr "" +msgid "" +"The :meth:`~re.Pattern.split` method of a pattern splits a string apart wherever " +"the RE matches, returning a list of the pieces. It's similar to " +"the :meth:`~str.split` method of strings but provides much more generality in the " +"delimiters that you can split by; string :meth:`!split` only supports splitting by " +"whitespace or by a fixed string. As you'd expect, there's a module-" +"level :func:`re.split` function, too." +msgstr "" +"متد :meth:`~re.Pattern.split` یک الگو، رشته را در هر جایی که عبارت باقاعده تطابق داشته " +"باشد از هم جدا می‌کند و فهرستی از تکه‌ها را برمی‌گرداند. این متد مشابه " +"متد :meth:`~str.split` رشته‌ها است، اما در جداکننده‌هایی که می‌توانید بر اساس آن‌ها " +"تقسیم کنید، عمومیت بسیار بیشتری فراهم می‌کند؛ متد :meth:`!split` رشته فقط از تقسیم " +"بر اساس فضای سفید یا یک رشته ثابت پشتیبانی می‌کند. همان‌طور که انتظار دارید، یک " +"تابع :func:`re.split` در سطح ماژول نیز وجود دارد." -msgid "Split *string* by the matches of the regular expression. If capturing parentheses are used in the RE, then their contents will also be returned as part of the resulting list. If *maxsplit* is nonzero, at most *maxsplit* splits are performed." +msgid "" +"Split *string* by the matches of the regular expression. If capturing parentheses " +"are used in the RE, then their contents will also be returned as part of the " +"resulting list. If *maxsplit* is nonzero, at most *maxsplit* splits are performed." msgstr "" +"*string* را بر اساس تطابق‌های عبارت باقاعده جدا می‌کند. اگر از پرانتزهای گیرانداز " +"(capturing parentheses) در عبارت باقاعده استفاده شود، محتویات آن‌ها نیز به‌عنوان بخشی از " +"فهرست حاصل برگردانده می‌شود. اگر *maxsplit* غیرصفر باشد، حداکثر *maxsplit* جداسازی " +"انجام می‌شود." -msgid "You can limit the number of splits made, by passing a value for *maxsplit*. When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the remainder of the string is returned as the final element of the list. In the following example, the delimiter is any sequence of non-alphanumeric characters. ::" +msgid "" +"You can limit the number of splits made, by passing a value for *maxsplit*. When " +"*maxsplit* is nonzero, at most *maxsplit* splits will be made, and the remainder of " +"the string is returned as the final element of the list. In the following example, " +"the delimiter is any sequence of non-alphanumeric characters. ::" msgstr "" +"شما می‌توانید با ارسال یک مقدار برای *maxsplit*، تعداد جداسازی‌های انجام‌شده را محدود " +"کنید. هنگامی که *maxsplit* غیرصفر باشد، حداکثر *maxsplit* جداسازی انجام خواهد شد و " +"باقی‌مانده‌ی رشته به‌عنوان آخرین عنصر فهرست بازگردانده می‌شود. در مثال زیر، جداکننده هر " +"دنباله‌ای از نویسه‌های غیرالفبایی-عددی است. ::" msgid "" ">>> p = re.compile(r'\\W+')\n" @@ -1013,9 +2161,21 @@ msgid "" ">>> p.split('This is a test, short and sweet, of split().', 3)\n" "['This', 'is', 'a', 'test, short and sweet, of split().']" msgstr "" +">>> p = re.compile(r'\\W+')\n" +">>> p.split('This is a test, short and sweet, of split().')\n" +"['This', 'is', 'a', 'test', 'short', 'and', 'sweet', 'of', 'split', '']\n" +">>> p.split('This is a test, short and sweet, of split().', 3)\n" +"['This', 'is', 'a', 'test, short and sweet, of split().']" -msgid "Sometimes you're not only interested in what the text between delimiters is, but also need to know what the delimiter was. If capturing parentheses are used in the RE, then their values are also returned as part of the list. Compare the following calls::" +msgid "" +"Sometimes you're not only interested in what the text between delimiters is, but " +"also need to know what the delimiter was. If capturing parentheses are used in the " +"RE, then their values are also returned as part of the list. Compare the following " +"calls::" msgstr "" +"گاهی شما نه‌تنها به این علاقه‌مندید که متن بین جداکننده‌ها چیست، بلکه نیاز دارید " +"بدانید جداکننده چه بوده است. اگر در RE از پرانتزهای گیرنده استفاده شود، مقادیر آن‌ها " +"نیز به‌عنوان بخشی از فهرست برگردانده می‌شوند. فراخوانی‌های زیر را مقایسه کنید::" msgid "" ">>> p = re.compile(r'\\W+')\n" @@ -1025,9 +2185,19 @@ msgid "" ">>> p2.split('This... is a test.')\n" "['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" msgstr "" +">>> p = re.compile(r'\\W+')\n" +">>> p2 = re.compile(r'(\\W+)')\n" +">>> p.split('This... is a test.')\n" +"['This', 'is', 'a', 'test', '']\n" +">>> p2.split('This... is a test.')\n" +"['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" -msgid "The module-level function :func:`re.split` adds the RE to be used as the first argument, but is otherwise the same. ::" +msgid "" +"The module-level function :func:`re.split` adds the RE to be used as the first " +"argument, but is otherwise the same. ::" msgstr "" +"تابع سطح ماژول :func:`re.split`، RE را برای استفاده به‌عنوان اولین آرگومان اضافه " +"می‌کند، اما در غیر این صورت یکسان است. ::" msgid "" ">>> re.split(r'[\\W]+', 'Words, words, words.')\n" @@ -1037,21 +2207,48 @@ msgid "" ">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" "['Words', 'words, words.']" msgstr "" +">>> re.split(r'[\\W]+', 'Words, words, words.')\n" +"['Words', 'words', 'words', '']\n" +">>> re.split(r'([\\W]+)', 'Words, words, words.')\n" +"['Words', ', ', 'words', ', ', 'words', '.', '']\n" +">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" +"['Words', 'words, words.']" msgid "Search and replace" -msgstr "" +msgstr "جستجو و جایگزینی" -msgid "Another common task is to find all the matches for a pattern, and replace them with a different string. The :meth:`~re.Pattern.sub` method takes a replacement value, which can be either a string or a function, and the string to be processed." +msgid "" +"Another common task is to find all the matches for a pattern, and replace them with " +"a different string. The :meth:`~re.Pattern.sub` method takes a replacement value, " +"which can be either a string or a function, and the string to be processed." msgstr "" +"یکی دیگر از وظایف رایج، پیدا کردن همه‌ی تطابق‌های یک الگو و جایگزینی آن‌ها با رشته‌ای " +"متفاوت است. متد :meth:`~re.Pattern.sub` یک مقدار جایگزینی را می‌گیرد، که می‌تواند " +"رشته یا تابع باشد، و نیز رشته‌ای را که باید پردازش شود." -msgid "Returns the string obtained by replacing the leftmost non-overlapping occurrences of the RE in *string* by the replacement *replacement*. If the pattern isn't found, *string* is returned unchanged." +msgid "" +"Returns the string obtained by replacing the leftmost non-overlapping occurrences " +"of the RE in *string* by the replacement *replacement*. If the pattern isn't " +"found, *string* is returned unchanged." msgstr "" +"رشته‌ی حاصل از جایگزینی چپ‌ترین رخدادهای غیرهم‌پوشان عبارت باقاعده (RE) در *string* با " +"جایگزین *replacement* را برمی‌گرداند. اگر الگو یافت نشود، *string* بدون تغییر " +"برگردانده می‌شود." -msgid "The optional argument *count* is the maximum number of pattern occurrences to be replaced; *count* must be a non-negative integer. The default value of 0 means to replace all occurrences." +msgid "" +"The optional argument *count* is the maximum number of pattern occurrences to be " +"replaced; *count* must be a non-negative integer. The default value of 0 means to " +"replace all occurrences." msgstr "" +"آرگومان اختیاری *count* حداکثر تعداد رخدادهای الگو برای جایگزینی است؛ *count* باید " +"یک عدد صحیح غیرمنفی باشد. مقدار پیش‌فرض ۰ به معنای جایگزینی تمام رخدادها است." -msgid "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It replaces colour names with the word ``colour``::" +msgid "" +"Here's a simple example of using the :meth:`~re.Pattern.sub` method. It replaces " +"colour names with the word ``colour``::" msgstr "" +"در اینجا یک مثال ساده از استفاده از متد :meth:`~re.Pattern.sub` آمده است. این مثال " +"نام رنگ‌ها را با کلمه ``colour`` جایگزین می‌کند::" msgid "" ">>> p = re.compile('(blue|white|red)')\n" @@ -1060,9 +2257,19 @@ msgid "" ">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" "'colour socks and red shoes'" msgstr "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.sub('colour', 'blue socks and red shoes')\n" +"'colour socks and colour shoes'\n" +">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" +"'colour socks and red shoes'" -msgid "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-tuple containing the new string value and the number of replacements that were performed::" +msgid "" +"The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-tuple " +"containing the new string value and the number of replacements that were " +"performed::" msgstr "" +"متد :meth:`~re.Pattern.subn` همان کار را انجام می‌دهد، اما یک تاپل دوتایی شامل مقدار " +"رشته‌ی جدید و تعداد جایگزینی‌های انجام‌شده را بازمی‌گرداند::" msgid "" ">>> p = re.compile('(blue|white|red)')\n" @@ -1071,30 +2278,75 @@ msgid "" ">>> p.subn('colour', 'no colours at all')\n" "('no colours at all', 0)" msgstr "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.subn('colour', 'blue socks and red shoes')\n" +"('colour socks and colour shoes', 2)\n" +">>> p.subn('colour', 'no colours at all')\n" +"('no colours at all', 0)" -msgid "Empty matches are replaced only when they're not adjacent to a previous empty match. ::" +msgid "" +"Empty matches are replaced only when they're not adjacent to a previous empty " +"match. ::" msgstr "" +"تطابق‌های خالی تنها زمانی جایگزین می‌شوند که مجاور یک تطابق خالی پیشین نباشند. ::" msgid "" ">>> p = re.compile('x*')\n" ">>> p.sub('-', 'abxd')\n" "'-a-b--d-'" msgstr "" +">>> p = re.compile('x*')\n" +">>> p.sub('-', 'abxd')\n" +"'-a-b--d-'" -msgid "If *replacement* is a string, any backslash escapes in it are processed. That is, ``\\n`` is converted to a single newline character, ``\\r`` is converted to a carriage return, and so forth. Unknown escapes such as ``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with the substring matched by the corresponding group in the RE. This lets you incorporate portions of the original text in the resulting replacement string." -msgstr "" +msgid "" +"If *replacement* is a string, any backslash escapes in it are processed. That is, " +"``\\n`` is converted to a single newline character, ``\\r`` is converted to a " +"carriage return, and so forth. Unknown escapes such as ``\\&`` are left alone. " +"Backreferences, such as ``\\6``, are replaced with the substring matched by the " +"corresponding group in the RE. This lets you incorporate portions of the original " +"text in the resulting replacement string." +msgstr "" +"اگر *replacement* یک رشته باشد، هرگونه دنباله‌ی خنثی‌سازی با بک‌اسلش در آن پردازش " +"می‌شود. یعنی ``\\n`` به یک نویسه‌ی خط جدید تبدیل می‌شود، ``\\r`` به یک بازگشت به ابتدای سطر " +"تبدیل می‌شود، و غیره. دنباله‌های خنثی‌سازی ناشناخته مانند ``\\&`` دست‌نخورده باقی " +"می‌مانند. بازارجاع‌ها (backreferences)، مانند ``\\6``، با زیررشته‌ای که گروه " +"متناظر در عبارت باقاعده آن را تطبیق داده است جایگزین می‌شوند. این امکان را به شما " +"می‌دهد تا بخش‌هایی از متن اصلی را در رشته‌ی جایگزینی حاصل بگنجانید." -msgid "This example matches the word ``section`` followed by a string enclosed in ``{``, ``}``, and changes ``section`` to ``subsection``::" +msgid "" +"This example matches the word ``section`` followed by a string enclosed in ``{``, " +"``}``, and changes ``section`` to ``subsection``::" msgstr "" +"این مثال با کلمه ``section`` و به دنبال آن رشته‌ای که در ``{`` و ``}`` محصور شده است " +"مطابقت می‌کند و ``section`` را به ``subsection`` تغییر می‌دهد::" msgid "" ">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" ">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" "'subsection{First} subsection{second}'" msgstr "" +">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" +"'subsection{First} subsection{second}'" -msgid "There's also a syntax for referring to named groups as defined by the ``(?P...)`` syntax. ``\\g`` will use the substring matched by the group named ``name``, and ``\\g`` uses the corresponding group number. ``\\g<2>`` is therefore equivalent to ``\\2``, but isn't ambiguous in a replacement string such as ``\\g<2>0``. (``\\20`` would be interpreted as a reference to group 20, not a reference to group 2 followed by the literal character ``'0'``.) The following substitutions are all equivalent, but use all three variations of the replacement string. ::" -msgstr "" +msgid "" +"There's also a syntax for referring to named groups as defined by the ``(?" +"P...)`` syntax. ``\\g`` will use the substring matched by the group " +"named ``name``, and ``\\g`` uses the corresponding group number. " +"``\\g<2>`` is therefore equivalent to ``\\2``, but isn't ambiguous in a " +"replacement string such as ``\\g<2>0``. (``\\20`` would be interpreted as a " +"reference to group 20, not a reference to group 2 followed by the literal character " +"``'0'``.) The following substitutions are all equivalent, but use all three " +"variations of the replacement string. ::" +msgstr "" +"همچنین سینتکسی برای ارجاع به گروه‌های نام‌دار وجود دارد، همان‌طور که با سینتکس ``(?" +"P...)`` تعریف شده است. ``\\g`` از زیررشته‌ی مطابقت‌داده‌شده توسط گروهی به " +"نام ``name`` استفاده می‌کند، و ``\\g`` از شماره‌ی گروه متناظر استفاده می‌کند. " +"بنابراین ``\\g<2>`` معادل ``\\2`` است، اما در رشته‌ی جایگزینی مانند ``\\g<2>0`` مبهم " +"نیست. (``\\20`` به‌عنوان ارجاعی به گروه ۲۰ تفسیر می‌شود، نه ارجاعی به گروه ۲ که به " +"دنبال آن نویسه‌ی تحت‌اللفظی ``'0'`` آمده است.) همه‌ی جایگزینی‌های زیر معادل هستند، اما " +"از هر سه شکل رشته‌ی جایگزینی استفاده می‌کنند. ::" msgid "" ">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" @@ -1105,12 +2357,31 @@ msgid "" ">>> p.sub(r'subsection{\\g}','section{First}')\n" "'subsection{First}'" msgstr "" +">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g<1>}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g}','section{First}')\n" +"'subsection{First}'" -msgid "*replacement* can also be a function, which gives you even more control. If *replacement* is a function, the function is called for every non-overlapping occurrence of *pattern*. On each call, the function is passed a :ref:`match object ` argument for the match and can use this information to compute the desired replacement string and return it." -msgstr "" +msgid "" +"*replacement* can also be a function, which gives you even more control. If " +"*replacement* is a function, the function is called for every non-overlapping " +"occurrence of *pattern*. On each call, the function is passed a :ref:`match object " +"` argument for the match and can use this information to compute the " +"desired replacement string and return it." +msgstr "" +"*replacement* همچنین می‌تواند یک تابع باشد، که کنترل حتی بیشتری به شما می‌دهد. اگر " +"*replacement* یک تابع باشد، تابع برای هر رخداد غیرهم‌پوشان *pattern* فراخوانی می‌شود. " +"در هر فراخوانی، یک آرگومان :ref:`شیء تطبیق ` برای تطبیق به تابع داده " +"می‌شود و می‌تواند از این اطلاعات برای محاسبه رشته جایگزینی مورد نظر و برگرداندن آن " +"استفاده کند." -msgid "In the following example, the replacement function translates decimals into hexadecimal::" -msgstr "" +msgid "" +"In the following example, the replacement function translates decimals into " +"hexadecimal::" +msgstr "در مثال زیر، تابع جایگزینی اعداد مبنای ده را به مبنای شانزده تبدیل می‌کند::" msgid "" ">>> def hexrepl(match):\n" @@ -1122,36 +2393,111 @@ msgid "" ">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" "'Call 0xffd2 for printing, 0xc000 for user code.'" msgstr "" +">>> def hexrepl(match):\n" +"... \"Return the hex string for a decimal number\"\n" +"... value = int(match.group())\n" +"... return hex(value)\n" +"...\n" +">>> p = re.compile(r'\\d+')\n" +">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" +"'Call 0xffd2 for printing, 0xc000 for user code.'" -msgid "When using the module-level :func:`re.sub` function, the pattern is passed as the first argument. The pattern may be provided as an object or as a string; if you need to specify regular expression flags, you must either use a pattern object as the first parameter, or use embedded modifiers in the pattern string, e.g. ``sub(\"(?i)b+\", \"x\", \"bbbb BBBB\")`` returns ``'x x'``." -msgstr "" +msgid "" +"When using the module-level :func:`re.sub` function, the pattern is passed as the " +"first argument. The pattern may be provided as an object or as a string; if you " +"need to specify regular expression flags, you must either use a pattern object as " +"the first parameter, or use embedded modifiers in the pattern string, e.g. " +"``sub(\"(?i)b+\", \"x\", \"bbbb BBBB\")`` returns ``'x x'``." +msgstr "" +"هنگام استفاده از تابع :func:`re.sub` در سطح ماژول، الگو به‌عنوان اولین آرگومان ارسال " +"می‌شود. الگو می‌تواند به‌صورت یک شیء یا یک رشته ارائه شود؛ اگر نیاز به تعیین پرچم‌های " +"عبارت باقاعده دارید، باید یا از یک شیء الگو به‌عنوان اولین پارامتر استفاده کنید، یا " +"از تغییردهنده‌های تعبیه‌شده در رشته الگو استفاده کنید، برای مثال ``sub(\"(?i)b+\", " +"\"x\", \"bbbb BBBB\")`` مقدار ``'x x'`` را برمی‌گرداند." msgid "Common problems" -msgstr "" +msgstr "مشکلات رایج" -msgid "Regular expressions are a powerful tool for some applications, but in some ways their behaviour isn't intuitive and at times they don't behave the way you may expect them to. This section will point out some of the most common pitfalls." +msgid "" +"Regular expressions are a powerful tool for some applications, but in some ways " +"their behaviour isn't intuitive and at times they don't behave the way you may " +"expect them to. This section will point out some of the most common pitfalls." msgstr "" +"عبارات باقاعده برای برخی از کاربردها ابزار قدرتمندی هستند، اما رفتار آن‌ها از برخی " +"جهات شهودی نیست و گاهی آن‌طور که ممکن است انتظار داشته باشید رفتار نمی‌کنند. این بخش " +"به برخی از رایج‌ترین دام‌ها اشاره می‌کند." msgid "Use string methods" -msgstr "" +msgstr "از متدهای رشته استفاده کنید" -msgid "Sometimes using the :mod:`re` module is a mistake. If you're matching a fixed string, or a single character class, and you're not using any :mod:`re` features such as the :const:`~re.IGNORECASE` flag, then the full power of regular expressions may not be required. Strings have several methods for performing operations with fixed strings and they're usually much faster, because the implementation is a single small C loop that's been optimized for the purpose, instead of the large, more generalized regular expression engine." -msgstr "" +msgid "" +"Sometimes using the :mod:`re` module is a mistake. If you're matching a fixed " +"string, or a single character class, and you're not using any :mod:`re` features " +"such as the :const:`~re.IGNORECASE` flag, then the full power of regular " +"expressions may not be required. Strings have several methods for performing " +"operations with fixed strings and they're usually much faster, because the " +"implementation is a single small C loop that's been optimized for the purpose, " +"instead of the large, more generalized regular expression engine." +msgstr "" +"گاهی استفاده از ماژول :mod:`re` یک اشتباه است. اگر در حال تطبیق یک رشته ثابت یا یک " +"کلاس نویسه واحد هستید و از هیچ‌یک از قابلیت‌های :mod:`re` مانند " +"پرچم :const:`~re.IGNORECASE` استفاده نمی‌کنید، ممکن است به قدرت کامل عبارات باقاعده " +"نیازی نباشد. رشته‌ها چندین متد برای انجام عملیات روی رشته‌های ثابت دارند و معمولاً " +"بسیار سریع‌تر هستند، زیرا پیاده‌سازی آن‌ها یک حلقه‌ی C کوچک واحد است که برای همین منظور " +"بهینه‌سازی شده است، نه موتور بزرگ و عمومی‌تر عبارات باقاعده." -msgid "One example might be replacing a single fixed string with another one; for example, you might replace ``word`` with ``deed``. :func:`re.sub` seems like the function to use for this, but consider the :meth:`~str.replace` method. Note that :meth:`!replace` will also replace ``word`` inside words, turning ``swordfish`` into ``sdeedfish``, but the naive RE ``word`` would have done that, too. (To avoid performing the substitution on parts of words, the pattern would have to be ``\\bword\\b``, in order to require that ``word`` have a word boundary on either side. This takes the job beyond :meth:`!replace`'s abilities.)" -msgstr "" +msgid "" +"One example might be replacing a single fixed string with another one; for example, " +"you might replace ``word`` with ``deed``. :func:`re.sub` seems like the function " +"to use for this, but consider the :meth:`~str.replace` method. Note that :meth:`!" +"replace` will also replace ``word`` inside words, turning ``swordfish`` into " +"``sdeedfish``, but the naive RE ``word`` would have done that, too. (To avoid " +"performing the substitution on parts of words, the pattern would have to be " +"``\\bword\\b``, in order to require that ``word`` have a word boundary on either " +"side. This takes the job beyond :meth:`!replace`'s abilities.)" +msgstr "" +"یک مثال ممکن است جایگزین کردن یک رشته ثابت با رشته‌ای دیگر باشد؛ برای مثال، ممکن است " +"بخواهید ``word`` را با ``deed`` جایگزین کنید. :func:`re.sub` به نظر می‌رسد تابع " +"مناسبی برای این کار باشد، اما متد :meth:`~str.replace` را در نظر بگیرید. توجه داشته " +"باشید که :meth:`!replace` نیز ``word`` را درون کلمات جایگزین می‌کند و ``swordfish`` " +"را به ``sdeedfish`` تبدیل می‌کند، اما عبارت باقاعده‌ی ساده‌ی ``word`` نیز همین کار را " +"انجام می‌داد. (برای جلوگیری از اعمال جایگزینی بر بخش‌هایی از کلمات، الگو باید " +"``\\bword\\b`` باشد تا وجود یک مرز کلمه در هر دو طرف ``word`` الزامی شود. این کار " +"فراتر از توانایی‌های :meth:`!replace` است.)" -msgid "Another common task is deleting every occurrence of a single character from a string or replacing it with another single character. You might do this with something like ``re.sub('\\n', ' ', S)``, but :meth:`~str.translate` is capable of doing both tasks and will be faster than any regular expression operation can be." +msgid "" +"Another common task is deleting every occurrence of a single character from a " +"string or replacing it with another single character. You might do this with " +"something like ``re.sub('\\n', ' ', S)``, but :meth:`~str.translate` is capable of " +"doing both tasks and will be faster than any regular expression operation can be." msgstr "" +"یک کار رایج دیگر، حذف تمام رخدادهای یک نویسه از یک رشته یا جایگزینی آن با یک نویسه‌ی " +"دیگر است. ممکن است این کار را با چیزی مانند ``re.sub('\\n', ' ', S)`` انجام دهید، " +"اما :meth:`~str.translate` قادر به انجام هر دو کار است و سریع‌تر از هر عملیات عبارت " +"باقاعده خواهد بود." -msgid "In short, before turning to the :mod:`re` module, consider whether your problem can be solved with a faster and simpler string method." +msgid "" +"In short, before turning to the :mod:`re` module, consider whether your problem can " +"be solved with a faster and simpler string method." msgstr "" +"به‌طور خلاصه، پیش از مراجعه به ماژول :mod:`re`، در نظر بگیرید که آیا مسئله شما " +"می‌تواند با یک متد رشته‌ای سریع‌تر و ساده‌تر حل شود." msgid "match() versus search()" -msgstr "" +msgstr "match() در برابر search()" -msgid "The :func:`~re.match` function only checks if the RE matches at the beginning of the string while :func:`~re.search` will scan forward through the string for a match. It's important to keep this distinction in mind. Remember, :func:`!match` will only report a successful match which will start at 0; if the match wouldn't start at zero, :func:`!match` will *not* report it. ::" -msgstr "" +msgid "" +"The :func:`~re.match` function only checks if the RE matches at the beginning of " +"the string while :func:`~re.search` will scan forward through the string for a " +"match. It's important to keep this distinction in mind. Remember, :func:`!match` " +"will only report a successful match which will start at 0; if the match wouldn't " +"start at zero, :func:`!match` will *not* report it. ::" +msgstr "" +"تابع :func:`~re.match` فقط بررسی می‌کند که آیا RE در ابتدای رشته مطابقت دارد یا خیر، " +"در حالی که :func:`~re.search` رشته را برای یافتن یک مطابقت به سمت جلو پیمایش می‌کند. " +"مهم است که این تمایز را در نظر داشته باشید. به یاد داشته باشید، :func:`!match` فقط " +"مطابقت موفقی را گزارش می‌کند که از ۰ شروع شود؛ اگر مطابقت از صفر شروع نشود، :func:`!" +"match` آن را گزارش *نخواهد کرد*. ::" msgid "" ">>> print(re.match('super', 'superstition').span())\n" @@ -1159,9 +2505,17 @@ msgid "" ">>> print(re.match('super', 'insuperable'))\n" "None" msgstr "" +">>> print(re.match('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.match('super', 'insuperable'))\n" +"None" -msgid "On the other hand, :func:`~re.search` will scan forward through the string, reporting the first match it finds. ::" +msgid "" +"On the other hand, :func:`~re.search` will scan forward through the string, " +"reporting the first match it finds. ::" msgstr "" +"از سوی دیگر، :func:`~re.search` رشته را به سمت جلو پیمایش می‌کند و اولین تطابقی را " +"که پیدا کند گزارش می‌دهد. ::" msgid "" ">>> print(re.search('super', 'superstition').span())\n" @@ -1169,18 +2523,53 @@ msgid "" ">>> print(re.search('super', 'insuperable').span())\n" "(2, 7)" msgstr "" +">>> print(re.search('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.search('super', 'insuperable').span())\n" +"(2, 7)" -msgid "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``.*`` to the front of your RE. Resist this temptation and use :func:`re.search` instead. The regular expression compiler does some analysis of REs in order to speed up the process of looking for a match. One such analysis figures out what the first character of a match must be; for example, a pattern starting with ``Crow`` must match starting with a ``'C'``. The analysis lets the engine quickly scan through the string looking for the starting character, only trying the full match if a ``'C'`` is found." -msgstr "" +msgid "" +"Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``.*`` to " +"the front of your RE. Resist this temptation and use :func:`re.search` instead. " +"The regular expression compiler does some analysis of REs in order to speed up the " +"process of looking for a match. One such analysis figures out what the first " +"character of a match must be; for example, a pattern starting with ``Crow`` must " +"match starting with a ``'C'``. The analysis lets the engine quickly scan through " +"the string looking for the starting character, only trying the full match if a " +"``'C'`` is found." +msgstr "" +"گاهی ممکن است وسوسه شوید که همچنان از :func:`re.match` استفاده کنید و فقط ``.*`` را " +"به ابتدای عبارت باقاعده‌ی خود اضافه کنید. در برابر این وسوسه مقاومت کنید و به‌جای آن " +"از :func:`re.search` استفاده کنید. کامپایلر عبارت باقاعده، عبارت‌های باقاعده را تا " +"حدی تحلیل می‌کند تا فرایند جست‌وجو برای تطبیق را سرعت بخشد. یکی از این تحلیل‌ها مشخص " +"می‌کند که اولین نویسه‌ی یک تطبیق باید چه باشد؛ برای مثال، الگویی که با ``Crow`` شروع " +"می‌شود باید تطبیق را با یک ``'C'`` آغاز کند. این تحلیل به موتور اجازه می‌دهد رشته را " +"به‌سرعت برای یافتن نویسه‌ی آغازین پیمایش کند و تنها در صورتی که یک ``'C'`` یافت شود، " +"تطبیق کامل را بیازماید." -msgid "Adding ``.*`` defeats this optimization, requiring scanning to the end of the string and then backtracking to find a match for the rest of the RE. Use :func:`re.search` instead." +msgid "" +"Adding ``.*`` defeats this optimization, requiring scanning to the end of the " +"string and then backtracking to find a match for the rest of the RE. " +"Use :func:`re.search` instead." msgstr "" +"افزودن ``.*`` این بهینه‌سازی را بی‌اثر می‌کند و به پیمایش تا پایان رشته و سپس پس‌گرد " +"برای یافتن تطابق برای بقیه‌ی RE نیاز دارد. در عوض از :func:`re.search` استفاده کنید." msgid "Greedy versus non-greedy" -msgstr "" +msgstr "حریصانه در برابر غیرحریصانه" -msgid "When repeating a regular expression, as in ``a*``, the resulting action is to consume as much of the pattern as possible. This fact often bites you when you're trying to match a pair of balanced delimiters, such as the angle brackets surrounding an HTML tag. The naive pattern for matching a single HTML tag doesn't work because of the greedy nature of ``.*``. ::" -msgstr "" +msgid "" +"When repeating a regular expression, as in ``a*``, the resulting action is to " +"consume as much of the pattern as possible. This fact often bites you when you're " +"trying to match a pair of balanced delimiters, such as the angle brackets " +"surrounding an HTML tag. The naive pattern for matching a single HTML tag doesn't " +"work because of the greedy nature of ``.*``. ::" +msgstr "" +"هنگام تکرار یک عبارت باقاعده، مانند ``a*``، رفتار حاصل این است که تا حد ممکن از " +"الگو مصرف می‌شود. این واقعیت اغلب هنگامی که در حال تلاش برای تطبیق یک جفت از " +"جداکننده‌های متوازن هستید، شما را گرفتار می‌کند، مانند کروشه‌های زاویه‌ای که یک برچسب " +"HTML را احاطه کرده‌اند. الگوی ساده برای تطبیق یک برچسب HTML به دلیل ماهیت حریصانه‌ی " +"``.*`` کار نمی‌کند. ::" msgid "" ">>> s = 'Title'\n" @@ -1191,32 +2580,100 @@ msgid "" ">>> print(re.match('<.*>', s).group())\n" "Title" msgstr "" +">>> s = 'Title'\n" +">>> len(s)\n" +"32\n" +">>> print(re.match('<.*>', s).span())\n" +"(0, 32)\n" +">>> print(re.match('<.*>', s).group())\n" +"Title" -msgid "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest of the string. There's still more left in the RE, though, and the ``>`` can't match at the end of the string, so the regular expression engine has to backtrack character by character until it finds a match for the ``>``. The final match extends from the ``'<'`` in ``''`` to the ``'>'`` in ``''``, which isn't what you want." -msgstr "" +msgid "" +"The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest of the " +"string. There's still more left in the RE, though, and the ``>`` can't match at " +"the end of the string, so the regular expression engine has to backtrack character " +"by character until it finds a match for the ``>``. The final match extends from " +"the ``'<'`` in ``''`` to the ``'>'`` in ``''``, which isn't what you " +"want." +msgstr "" +"عبارت باقاعده با ``'<'`` در ``''`` مطابقت می‌کند، و ``.*`` باقی‌مانده‌ی رشته را " +"مصرف می‌کند. با این حال، هنوز بخش‌های بیشتری از عبارت باقاعده باقی مانده است، و ``>`` " +"نمی‌تواند در پایان رشته مطابقت کند، بنابراین موتور عبارت باقاعده باید نویسه‌به‌نویسه " +"عقب‌گرد کند تا اینکه تطابقی برای ``>`` بیابد. تطابق نهایی از ``'<'`` در ``''`` " +"تا ``'>'`` در ``''`` ادامه دارد، که این چیزی نیست که شما می‌خواهید." -msgid "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the above example, the ``'>'`` is tried immediately after the first ``'<'`` matches, and when it fails, the engine advances a character at a time, retrying the ``'>'`` at every step. This produces just the right result::" -msgstr "" +msgid "" +"In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?``, ``??" +"``, or ``{m,n}?``, which match as *little* text as possible. In the above example, " +"the ``'>'`` is tried immediately after the first ``'<'`` matches, and when it " +"fails, the engine advances a character at a time, retrying the ``'>'`` at every " +"step. This produces just the right result::" +msgstr "" +"در این حالت، راه‌حل استفاده از کمیت‌گذارهای غیرحریص ``*?``، ``+?``، ``??`` یا ``{m,n}?" +"`` است، که تا حد امکان متن *کمی* را تطبیق می‌دهند. در مثال بالا، بلافاصله پس از " +"تطبیق اولین ``'<'``، تلاش برای تطبیق ``'>'`` انجام می‌شود، و وقتی این تلاش شکست " +"می‌خورد، موتور هر بار یک نویسه جلو می‌رود و در هر مرحله برای تطبیق ``'>'`` دوباره " +"تلاش می‌کند. این دقیقاً نتیجه درست را تولید می‌کند::" msgid "" ">>> print(re.match('<.*?>', s).group())\n" "" msgstr "" +">>> print(re.match('<.*?>', s).group())\n" +"" -msgid "(Note that parsing HTML or XML with regular expressions is painful. Quick-and-dirty patterns will handle common cases, but HTML and XML have special cases that will break the obvious regular expression; by the time you've written a regular expression that handles all of the possible cases, the patterns will be *very* complicated. Use an HTML or XML parser module for such tasks.)" -msgstr "" +msgid "" +"(Note that parsing HTML or XML with regular expressions is painful. Quick-and-dirty " +"patterns will handle common cases, but HTML and XML have special cases that will " +"break the obvious regular expression; by the time you've written a regular " +"expression that handles all of the possible cases, the patterns will be *very* " +"complicated. Use an HTML or XML parser module for such tasks.)" +msgstr "" +"(توجه داشته باشید که تجزیه‌ی HTML یا XML با عبارت‌های باقاعده دشوار است. الگوهای سریع " +"و سرسری حالت‌های رایج را پوشش می‌دهند، اما HTML و XML حالت‌های خاصی دارند که عبارت " +"باقاعده‌ی بدیهی را از کار می‌اندازند؛ تا وقتی که عبارت باقاعده‌ای بنویسید که تمام " +"حالت‌های ممکن را پوشش دهد، الگوها *بسیار* پیچیده خواهند شد. برای چنین کارهایی از یک " +"ماژول پارسر HTML یا XML استفاده کنید.)" msgid "Using re.VERBOSE" -msgstr "" +msgstr "استفاده از re.VERBOSE" -msgid "By now you've probably noticed that regular expressions are a very compact notation, but they're not terribly readable. REs of moderate complexity can become lengthy collections of backslashes, parentheses, and metacharacters, making them difficult to read and understand." +msgid "" +"By now you've probably noticed that regular expressions are a very compact " +"notation, but they're not terribly readable. REs of moderate complexity can become " +"lengthy collections of backslashes, parentheses, and metacharacters, making them " +"difficult to read and understand." msgstr "" +"احتمالاً تاکنون متوجه شده‌اید که عبارات باقاعده نمادگذاری بسیار فشرده‌ای هستند، اما " +"چندان خوانا نیستند. عبارات باقاعده با پیچیدگی متوسط می‌توانند به مجموعه‌های بلندی از " +"بک‌اسلش‌ها، پرانتزها و فرانویسه‌ها (metacharacters) تبدیل شوند، که خواندن و درک آن‌ها " +"را دشوار می‌سازد." -msgid "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the regular expression can be helpful, because it allows you to format the regular expression more clearly." +msgid "" +"For such REs, specifying the :const:`re.VERBOSE` flag when compiling the regular " +"expression can be helpful, because it allows you to format the regular expression " +"more clearly." msgstr "" +"برای چنین عبارت‌های باقاعده‌ای، تعیین پرچم :const:`re.VERBOSE` هنگام کامپایل عبارت " +"باقاعده می‌تواند مفید باشد، زیرا به شما امکان می‌دهد عبارت باقاعده را واضح‌تر قالب‌بندی " +"کنید." -msgid "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular expression that *isn't* inside a character class is ignored. This means that an expression such as ``dog | cat`` is equivalent to the less readable ``dog|cat``, but ``[a b]`` will still match the characters ``'a'``, ``'b'``, or a space. In addition, you can also put comments inside a RE; comments extend from a ``#`` character to the next newline. When used with triple-quoted strings, this enables REs to be formatted more neatly::" -msgstr "" +msgid "" +"The ``re.VERBOSE`` flag has several effects. Whitespace in the regular expression " +"that *isn't* inside a character class is ignored. This means that an expression " +"such as ``dog | cat`` is equivalent to the less readable ``dog|cat``, but ``[a b]`` " +"will still match the characters ``'a'``, ``'b'``, or a space. In addition, you can " +"also put comments inside a RE; comments extend from a ``#`` character to the next " +"newline. When used with triple-quoted strings, this enables REs to be formatted " +"more neatly::" +msgstr "" +"پرچم ``re.VERBOSE`` چندین اثر دارد. فضای خالی در عبارت باقاعده که داخل یک کلاس " +"نویسه *نباشد* نادیده گرفته می‌شود. این بدان معناست که عبارتی مانند ``dog | cat`` " +"معادل ``dog|cat`` با خوانایی کمتر است، اما ``[a b]`` همچنان با نویسه‌های ``'a'``، " +"``'b'`` یا یک فاصله مطابقت خواهد کرد. علاوه بر این، می‌توانید کامنت‌هایی را نیز داخل " +"یک عبارت باقاعده قرار دهید؛ کامنت از یک نویسه ``#`` تا خط جدید بعدی ادامه " +"می‌یابند. هنگامی که با رشته‌های دارای سه علامت نقل‌قول استفاده شود، این امر امکان " +"می‌دهد عبارت‌های باقاعده به‌صورت مرتب‌تری قالب‌بندی شوند::" msgid "" "pat = re.compile(r\"\"\"\n" @@ -1228,18 +2685,48 @@ msgid "" " \\s*$ # Trailing whitespace to end-of-line\n" "\"\"\", re.VERBOSE)" msgstr "" +"pat = re.compile(r\"\"\"\n" +" \\s* # Skip leading whitespace\n" +" (?P
[^:]+) # Header name\n" +" \\s* : # Whitespace, and a colon\n" +" (?P.*?) # The header's value -- *? used to\n" +" # lose the following trailing whitespace\n" +" \\s*$ # Trailing whitespace to end-of-line\n" +"\"\"\", re.VERBOSE)" msgid "This is far more readable than::" -msgstr "" +msgstr "این بسیار خواناتر از این است::" msgid "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" -msgstr "" +msgstr "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" msgid "Feedback" -msgstr "" +msgstr "بازخورد" -msgid "Regular expressions are a complicated topic. Did this document help you understand them? Were there parts that were unclear, or problems you encountered that weren't covered here? If so, please send suggestions for improvements to the :ref:`issue tracker `." +msgid "" +"Regular expressions are a complicated topic. Did this document help you understand " +"them? Were there parts that were unclear, or problems you encountered that weren't " +"covered here? If so, please send suggestions for improvements to the :ref:`issue " +"tracker `." msgstr "" +"عبارات منظم موضوعی پیچیده هستند. آیا این سند به شما کمک کرد تا آن‌ها را درک کنید؟ " +"آیا بخش‌هایی مبهم بودند، یا مشکلاتی که با آن‌ها مواجه شدید و در اینجا پوشش داده " +"نشده‌اند؟ در این صورت، لطفاً پیشنهادهای بهبود را به :ref:`پیگیری مشکلات (issue " +"tracker) ` ارسال کنید." -msgid "The most complete book on regular expressions is almost certainly Jeffrey Friedl's Mastering Regular Expressions, published by O'Reilly. Unfortunately, it exclusively concentrates on Perl and Java's flavours of regular expressions, and doesn't contain any Python material at all, so it won't be useful as a reference for programming in Python. (The first edition covered Python's now-removed :mod:`!regex` module, which won't help you much.) Consider checking it out from your library." -msgstr "" +msgid "" +"The most complete book on regular expressions is almost certainly Jeffrey Friedl's " +"Mastering Regular Expressions, published by O'Reilly. Unfortunately, it " +"exclusively concentrates on Perl and Java's flavours of regular expressions, and " +"doesn't contain any Python material at all, so it won't be useful as a reference " +"for programming in Python. (The first edition covered Python's now-removed :mod:`!" +"regex` module, which won't help you much.) Consider checking it out from your " +"library." +msgstr "" +"کامل‌ترین کتاب درباره عبارت‌های باقاعده تقریباً با قطعیت کتاب Mastering Regular " +"Expressions اثر Jeffrey Friedl است که توسط O'Reilly منتشر شده است. متأسفانه، این " +"کتاب منحصراً بر گونه‌های عبارت‌های باقاعده در Perl و Java تمرکز دارد و اصلاً هیچ مطلبی " +"درباره پایتون ندارد، بنابراین به‌عنوان مرجعی برای برنامه‌نویسی پایتون مفید نخواهد " +"بود. (نخستین ویرایش این کتاب ماژول :mod:`!regex` پایتون را پوشش می‌داد که اکنون حذف " +"شده است و کمک چندانی به شما نخواهد کرد.) امانت گرفتن آن را از کتابخانه خود در نظر " +"داشته باشید." diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po index 4b907f07b..1a82c9900 100644 --- a/howto/remote_debugging.po +++ b/howto/remote_debugging.po @@ -11,169 +11,327 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-07-25 12:59+0330\n" +"PO-Revision-Date: 2026-08-28 10:54+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: none\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" msgid "Remote debugging attachment protocol" -msgstr "" +msgstr "پروتکل اتصال اشکال‌زدایی راه دور" -msgid "This protocol enables external tools to attach to a running CPython process and execute Python code remotely." +msgid "" +"This protocol enables external tools to attach to a running CPython process " +"and execute Python code remotely." msgstr "" +"این پروتکل به ابزارهای خارجی امکان می‌دهد به یک فرآیند در حال اجرای CPython " +"متصل شوند و کد پایتون را از راه دور اجرا کنند." -msgid "Most platforms require elevated privileges to attach to another Python process." +msgid "" +"Most platforms require elevated privileges to attach to another Python " +"process." msgstr "" +"بیشتر سکوها برای اتصال به یک فرآیند پایتون دیگر به دسترسی‌های ارتقاء‌یافته " +"نیاز دارند." msgid "Disabling remote debugging" -msgstr "" +msgstr "غیرفعال‌سازی اشکال‌زدایی از راه دور" msgid "To disable remote debugging support, use any of the following:" msgstr "" +"برای غیرفعال کردن پشتیبانی از اشکال‌زدایی از راه دور، از یکی از موارد زیر " +"استفاده کنید:" -msgid "Set the :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable to ``1`` before starting the interpreter." +msgid "" +"Set the :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable to ``1`` " +"before starting the interpreter." msgstr "" +"متغیر محیطی :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` را پیش از راه‌اندازی مفسر " +"روی ``1`` تنظیم کنید." msgid "Use the :option:`-X disable_remote_debug` command-line option." -msgstr "" +msgstr "از گزینه‌ی خط فرمان :option:`-X disable_remote_debug` استفاده کنید." msgid "Compile Python with the :option:`--without-remote-debug` build flag." -msgstr "" +msgstr "پایتون را با پرچم ساخت :option:`--without-remote-debug` کامپایل کنید." msgid "Permission requirements" -msgstr "" +msgstr "الزامات دسترسی" -msgid "Attaching to a running Python process for remote debugging requires elevated privileges on most platforms. The specific requirements and troubleshooting steps depend on your operating system:" +msgid "" +"Attaching to a running Python process for remote debugging requires " +"elevated privileges on most platforms. The specific requirements and " +"troubleshooting steps depend on your operating system:" msgstr "" +"اتصال به یک فرایند پایتون در حال اجرا برای اشکال‌زدایی از راه دور، در بیشتر " +"پلتفرم‌ها به دسترسی‌های ارتقاء‌یافته نیاز دارد. نیازمندی‌های خاص و مراحل " +"عیب‌یابی به سیستم‌عامل شما بستگی دارند:" msgid "Linux" -msgstr "" +msgstr "لینوکس" -msgid "The tracer process must have the ``CAP_SYS_PTRACE`` capability or equivalent privileges. You can only trace processes you own and can signal. Tracing may fail if the process is already being traced, or if it is running with set-user-ID or set-group-ID. Security modules like Yama may further restrict tracing." -msgstr "" +msgid "" +"The tracer process must have the ``CAP_SYS_PTRACE`` capability or " +"equivalent privileges. You can only trace processes you own and can signal. " +"Tracing may fail if the process is already being traced, or if it is " +"running with set-user-ID or set-group-ID. Security modules like Yama may " +"further restrict tracing." +msgstr "" +"فرایند ردیاب باید قابلیت ``CAP_SYS_PTRACE`` یا امتیازات معادل آن را داشته " +"باشد. شما فقط می‌توانید فرایندهایی را ردگیری کنید که مالک آن‌ها هستید و " +"می‌توانید به آن‌ها سیگنال بفرستید. اگر فرایند از قبل در حال ردگیری باشد، یا " +"با set-user-ID یا set-group-ID اجرا شود، ممکن است ردگیری با شکست مواجه شود. " +"ماژول‌های امنیتی مانند Yama ممکن است ردگیری را بیشتر محدود کنند." msgid "To temporarily relax ptrace restrictions (until reboot), run:" -msgstr "" +msgstr "برای کاهش موقت محدودیت‌های ptrace (تا راه‌اندازی مجدد)، اجرا کنید:" msgid "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" -msgstr "" +msgstr "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" -msgid "Disabling ``ptrace_scope`` reduces system hardening and should only be done in trusted environments." +msgid "" +"Disabling ``ptrace_scope`` reduces system hardening and should only be done " +"in trusted environments." msgstr "" +"غیرفعال کردن ``ptrace_scope`` مستحکم‌سازی سیستم را کاهش می‌دهد و باید فقط در " +"محیط‌های مورد اعتماد انجام شود." -msgid "If running inside a container, use ``--cap-add=SYS_PTRACE`` or ``--privileged``, and run as root if needed." +msgid "" +"If running inside a container, use ``--cap-add=SYS_PTRACE`` or ``--" +"privileged``, and run as root if needed." msgstr "" +"اگر داخل یک ظرف اجرا می‌شود، از ``--cap-add=SYS_PTRACE`` یا ``--" +"privileged`` استفاده کنید و در صورت نیاز، به‌عنوان root اجرا کنید." msgid "Try re-running the command with elevated privileges:" -msgstr "" +msgstr "دستور را دوباره با دسترسی‌های ارتقاء‌یافته اجرا کنید:" msgid "``sudo -E !!``" -msgstr "" +msgstr "``sudo -E !!``" msgid "macOS" -msgstr "" +msgstr "macOS" -msgid "To attach to another process, you typically need to run your debugging tool with elevated privileges. This can be done by using ``sudo`` or running as root." +msgid "" +"To attach to another process, you typically need to run your debugging tool " +"with elevated privileges. This can be done by using ``sudo`` or running as " +"root." msgstr "" +"برای اتصال به یک فرایند دیگر، معمولاً باید ابزار اشکال‌زدایی خود را با " +"دسترسی‌های بالاتر اجرا کنید. این کار را می‌توان با استفاده از ``sudo`` یا " +"اجرا به‌عنوان root انجام داد." -msgid "Even when attaching to processes you own, macOS may block debugging unless the debugger is run with root privileges due to system security restrictions." +msgid "" +"Even when attaching to processes you own, macOS may block debugging unless " +"the debugger is run with root privileges due to system security " +"restrictions." msgstr "" +"حتی هنگام اتصال به فرایندهایی که متعلق به شما هستند، ممکن است macOS به دلیل " +"محدودیت‌های امنیتی سیستم، اشکال‌زدایی را مسدود کند، مگر اینکه اشکال‌زدا با " +"امتیازات root اجرا شود." msgid "Windows" -msgstr "" +msgstr "ویندوز" -msgid "To attach to another process, you usually need to run your debugging tool with administrative privileges. Start the command prompt or terminal as Administrator." +msgid "" +"To attach to another process, you usually need to run your debugging tool " +"with administrative privileges. Start the command prompt or terminal as " +"Administrator." msgstr "" +"برای اتصال به یک فرایند دیگر، معمولاً باید ابزار اشکال‌زدایی خود را با دسترسی " +"مدیریتی اجرا کنید. خط فرمان یا پایانه را به‌عنوان مدیر اجرا کنید." -msgid "Some processes may still be inaccessible even with Administrator rights, unless you have the ``SeDebugPrivilege`` privilege enabled." +msgid "" +"Some processes may still be inaccessible even with Administrator rights, " +"unless you have the ``SeDebugPrivilege`` privilege enabled." msgstr "" +"برخی فرایندها ممکن است حتی با حقوق مدیر (Administrator) نیز همچنان " +"غیرقابل‌دسترس باشند، مگر اینکه امتیاز ``SeDebugPrivilege`` را فعال کرده " +"باشید." -msgid "To resolve file or folder access issues, adjust the security permissions:" -msgstr "" +msgid "" +"To resolve file or folder access issues, adjust the security permissions:" +msgstr "برای حل مشکلات دسترسی به فایل یا پوشه، مجوزهای امنیتی را تنظیم کنید:" msgid "Right-click the file or folder and select **Properties**." -msgstr "" +msgstr "روی فایل یا پوشه راست‌کلیک کنید و **Properties** را انتخاب کنید." msgid "Go to the **Security** tab to view users and groups with access." msgstr "" +"برای مشاهده کاربران و گروه‌های دارای دسترسی، به زبانه **Security** بروید." msgid "Click **Edit** to modify permissions." -msgstr "" +msgstr "برای تغییر مجوزها، روی **Edit** کلیک کنید." msgid "Select your user account." -msgstr "" +msgstr "حساب کاربری خود را انتخاب کنید." msgid "In **Permissions**, check **Read** or **Full control** as needed." msgstr "" +"در **مجوزها**، **خواندن** یا **کنترل کامل** را در صورت نیاز علامت بزنید." msgid "Click **Apply**, then **OK** to confirm." -msgstr "" +msgstr "روی **Apply** کلیک کنید، سپس برای تأیید روی **OK** کلیک کنید." -msgid "Ensure you've satisfied all :ref:`permission-requirements` before proceeding." +msgid "" +"Ensure you've satisfied all :ref:`permission-requirements` before " +"proceeding." msgstr "" +"پیش از ادامه، اطمینان حاصل کنید که تمام :ref:`permission-requirements` را " +"برآورده کرده‌اید." -msgid "This section describes the low-level protocol that enables external tools to inject and execute a Python script within a running CPython process." +msgid "" +"This section describes the low-level protocol that enables external tools " +"to inject and execute a Python script within a running CPython process." msgstr "" +"این بخش پروتکل سطح پایینی را توصیف می‌کند که به ابزارهای خارجی امکان می‌دهد " +"یک اسکریپت پایتون را درون یک فرآیند در حال اجرای CPython تزریق و اجرا کنند." -msgid "This mechanism forms the basis of the :func:`sys.remote_exec` function, which instructs a remote Python process to execute a ``.py`` file. However, this section does not document the usage of that function. Instead, it provides a detailed explanation of the underlying protocol, which takes as input the ``pid`` of a target Python process and the path to a Python source file to be executed. This information supports independent reimplementation of the protocol, regardless of programming language." -msgstr "" +msgid "" +"This mechanism forms the basis of the :func:`sys.remote_exec` function, " +"which instructs a remote Python process to execute a ``.py`` file. However, " +"this section does not document the usage of that function. Instead, it " +"provides a detailed explanation of the underlying protocol, which takes as " +"input the ``pid`` of a target Python process and the path to a Python " +"source file to be executed. This information supports independent " +"reimplementation of the protocol, regardless of programming language." +msgstr "" +"این سازوکار مبنای تابع :func:`sys.remote_exec` را تشکیل می‌دهد، که به یک " +"فرآیند پایتون راه دور دستور می‌دهد یک فایل ``.py`` را اجرا کند. با این حال، " +"این بخش به مستندسازی نحوه‌ی استفاده از آن تابع نمی‌پردازد. در عوض، توضیح دقیقی " +"درباره پروتکل زیربنایی ارائه می‌دهد که به‌عنوان ورودی، ``pid`` یک فرآیند " +"پایتون هدف و مسیر یک فایل منبع پایتون که باید اجرا شود را دریافت می‌کند. این " +"اطلاعات از پیاده‌سازی مستقل پروتکل، صرف‌نظر از زبان برنامه‌نویسی، پشتیبانی " +"می‌کند." -msgid "The execution of the injected script depends on the interpreter reaching a safe evaluation point. As a result, execution may be delayed depending on the runtime state of the target process." +msgid "" +"The execution of the injected script depends on the interpreter reaching a " +"safe evaluation point. As a result, execution may be delayed depending on " +"the runtime state of the target process." msgstr "" +"اجرای اسکریپت تزریق‌شده، به رسیدن مفسر به یک نقطه ارزیابی ایمن وابسته است. " +"در نتیجه، ممکن است اجرا بسته به وضعیت ران‌تایم فرایند هدف به تأخیر بیفتد." -msgid "Once injected, the script is executed by the interpreter within the target process the next time a safe evaluation point is reached. This approach enables remote execution capabilities without modifying the behavior or structure of the running Python application." +msgid "" +"Once injected, the script is executed by the interpreter within the target " +"process the next time a safe evaluation point is reached. This approach " +"enables remote execution capabilities without modifying the behavior or " +"structure of the running Python application." msgstr "" +"پس از تزریق، اسکریپت در دفعه‌ی بعد که به یک نقطه‌ی ارزیابی امن رسیده شود، توسط " +"مفسر درون فرایند هدف اجرا می‌شود. این رویکرد قابلیت‌های اجرای از راه دور را " +"بدون تغییر رفتار یا ساختار برنامه پایتون در حال اجرا فراهم می‌کند." -msgid "Subsequent sections provide a step-by-step description of the protocol, including techniques for locating interpreter structures in memory, safely accessing internal fields, and triggering code execution. Platform-specific variations are noted where applicable, and example implementations are included to clarify each operation." +msgid "" +"Subsequent sections provide a step-by-step description of the protocol, " +"including techniques for locating interpreter structures in memory, safely " +"accessing internal fields, and triggering code execution. Platform-specific " +"variations are noted where applicable, and example implementations are " +"included to clarify each operation." msgstr "" +"بخش‌های بعدی توصیفی گام‌به‌گام از پروتکل ارائه می‌دهند، شامل تکنیک‌هایی برای " +"یافتن ساختارهای مفسر در حافظه، دسترسی ایمن به فیلدهای داخلی و فعال‌سازی " +"اجرای کد. تفاوت‌های خاص پلتفرم در موارد قابل اعمال ذکر شده‌اند و پیاده‌سازی‌های " +"نمونه برای روشن‌سازی هر عملیات گنجانده شده‌اند." msgid "Locating the PyRuntime structure" -msgstr "" +msgstr "یافتن ساختار PyRuntime" -msgid "CPython places the ``PyRuntime`` structure in a dedicated binary section to help external tools find it at runtime. The name and format of this section vary by platform. For example, ``.PyRuntime`` is used on ELF systems, and ``__DATA,__PyRuntime`` is used on macOS. Tools can find the offset of this structure by examining the binary on disk." -msgstr "" +msgid "" +"CPython places the ``PyRuntime`` structure in a dedicated binary section to " +"help external tools find it at runtime. The name and format of this section " +"vary by platform. For example, ``.PyRuntime`` is used on ELF systems, and " +"``__DATA,__PyRuntime`` is used on macOS. Tools can find the offset of this " +"structure by examining the binary on disk." +msgstr "" +"CPython ساختار ``PyRuntime`` را در یک بخش دودویی اختصاصی قرار می‌دهد تا " +"ابزارهای خارجی بتوانند آن را در زمان ران‌تایم بیابند. نام و قالب این بخش بر " +"حسب پلتفرم متفاوت است. برای مثال، در سیستم‌های ELF از ``.PyRuntime`` و در " +"macOS از ``__DATA,__PyRuntime`` استفاده می‌شود. ابزارها می‌توانند با بررسی " +"دودویی روی دیسک، آفست این ساختار را بیابند." -msgid "The ``PyRuntime`` structure contains CPython’s global interpreter state and provides access to other internal data, including the list of interpreters, thread states, and debugger support fields." +msgid "" +"The ``PyRuntime`` structure contains CPython’s global interpreter state and " +"provides access to other internal data, including the list of interpreters, " +"thread states, and debugger support fields." msgstr "" +"ساختار ``PyRuntime`` شامل وضعیت سراسری مفسر CPython است و دسترسی به سایر " +"داده‌های داخلی، از جمله فهرست مفسرها، وضعیت‌های نخ و فیلدهای پشتیبانی " +"اشکال‌زدا را فراهم می‌کند." -msgid "To work with a remote Python process, a debugger must first find the memory address of the ``PyRuntime`` structure in the target process. This address can’t be hardcoded or calculated from a symbol name, because it depends on where the operating system loaded the binary." +msgid "" +"To work with a remote Python process, a debugger must first find the memory " +"address of the ``PyRuntime`` structure in the target process. This address " +"can’t be hardcoded or calculated from a symbol name, because it depends on " +"where the operating system loaded the binary." msgstr "" +"برای کار با یک فرایند پایتون راه‌دور، اشکال‌زدا باید ابتدا نشانی حافظه‌ی " +"ساختار ``PyRuntime`` را در فرایند هدف پیدا کند. این نشانی را نمی‌توان به‌صورت " +"سخت‌کدشده تعیین کرد یا از روی نام نماد محاسبه کرد، زیرا به این بستگی دارد که " +"سیستم‌عامل فایل دودویی را کجا بارگذاری کرده است." -msgid "The method for finding ``PyRuntime`` depends on the platform, but the steps are the same in general:" +msgid "" +"The method for finding ``PyRuntime`` depends on the platform, but the steps " +"are the same in general:" msgstr "" +"روش یافتن ``PyRuntime`` به پلتفرم بستگی دارد، اما مراحل به‌طور کلی یکسان " +"هستند:" -msgid "Find the base address where the Python binary or shared library was loaded in the target process." +msgid "" +"Find the base address where the Python binary or shared library was loaded " +"in the target process." msgstr "" +"آدرس پایه‌ای را بیابید که دودویی پایتون یا کتابخانه اشتراکی در فرایند هدف در " +"آن بارگذاری شده است." -msgid "Use the on-disk binary to locate the offset of the ``.PyRuntime`` section." +msgid "" +"Use the on-disk binary to locate the offset of the ``.PyRuntime`` section." msgstr "" +"از پرونده‌ی دودویی روی دیسک برای یافتن آفست بخش ``.PyRuntime`` استفاده کنید." -msgid "Add the section offset to the base address to compute the address in memory." -msgstr "" +msgid "" +"Add the section offset to the base address to compute the address in memory." +msgstr "برای محاسبه‌ی آدرس در حافظه، آفست بخش را به آدرس پایه اضافه کنید." -msgid "The sections below explain how to do this on each supported platform and include example code." +msgid "" +"The sections below explain how to do this on each supported platform and " +"include example code." msgstr "" +"بخش‌های زیر توضیح می‌دهند که چگونه این کار را در هر سکوی پشتیبانی‌شده انجام " +"دهید و شامل کد نمونه هستند." msgid "Linux (ELF)" -msgstr "" +msgstr "لینوکس (ELF)" msgid "To find the ``PyRuntime`` structure on Linux:" -msgstr "" +msgstr "برای یافتن ساختار ``PyRuntime`` در لینوکس:" -msgid "Read the process’s memory map (for example, ``/proc//maps``) to find the address where the Python executable or ``libpython`` was loaded." +msgid "" +"Read the process’s memory map (for example, ``/proc//maps``) to find " +"the address where the Python executable or ``libpython`` was loaded." msgstr "" +"نقشه‌ی حافظه‌ی فرایند را بخوانید (برای مثال، ``/proc//maps``) تا نشانی‌ای " +"را بیابید که فایل اجرایی پایتون یا ``libpython`` در آن بارگذاری شده است." -msgid "Parse the ELF section headers in the binary to get the offset of the ``.PyRuntime`` section." +msgid "" +"Parse the ELF section headers in the binary to get the offset of the " +"``.PyRuntime`` section." msgstr "" +"سرآیندهای بخش ELF را در فایل دودویی تجزیه کنید تا آفست بخش ``.PyRuntime`` به " +"دست آید." -msgid "Add that offset to the base address from step 1 to get the memory address of ``PyRuntime``." +msgid "" +"Add that offset to the base address from step 1 to get the memory address " +"of ``PyRuntime``." msgstr "" +"آن آفست (offset) را به آدرس پایه‌ی مرحله‌ی ۱ اضافه کنید تا آدرس حافظه‌ی " +"``PyRuntime`` به‌دست آید." msgid "The following is an example implementation::" -msgstr "" +msgstr "در ادامه یک پیاده‌سازی نمونه آمده است::" msgid "" "def find_py_runtime_linux(pid: int) -> int:\n" @@ -196,30 +354,110 @@ msgid "" " # Step 4: Compute PyRuntime address in memory\n" " return base_address + section_offset" msgstr "" +"def find_py_runtime_linux(pid: int) -> int:\n" +" # Step 1: Try to find the Python executable in memory\n" +" binary_path, base_address = find_mapped_binary(\n" +" pid, name_contains=\"python\"\n" +" )\n" +"\n" +" # Step 2: Fallback to shared library if executable is not found\n" +" if binary_path is None:\n" +" binary_path, base_address = find_mapped_binary(\n" +" pid, name_contains=\"libpython\"\n" +" )\n" +"\n" +" # Step 3: Parse ELF headers to get .PyRuntime section offset\n" +" section_offset = parse_elf_section_offset(\n" +" binary_path, \".PyRuntime\"\n" +" )\n" +"\n" +" # Step 4: Compute PyRuntime address in memory\n" +" return base_address + section_offset" -msgid "On Linux systems, there are two main approaches to read memory from another process. The first is through the ``/proc`` filesystem, specifically by reading from ``/proc/[pid]/mem`` which provides direct access to the process's memory. This requires appropriate permissions - either being the same user as the target process or having root access. The second approach is using the ``process_vm_readv()`` system call which provides a more efficient way to copy memory between processes. While ptrace's ``PTRACE_PEEKTEXT`` operation can also be used to read memory, it is significantly slower as it only reads one word at a time and requires multiple context switches between the tracer and tracee processes." -msgstr "" +msgid "" +"On Linux systems, there are two main approaches to read memory from another " +"process. The first is through the ``/proc`` filesystem, specifically by " +"reading from ``/proc/[pid]/mem`` which provides direct access to the " +"process's memory. This requires appropriate permissions - either being the " +"same user as the target process or having root access. The second approach " +"is using the ``process_vm_readv()`` system call which provides a more " +"efficient way to copy memory between processes. While ptrace's " +"``PTRACE_PEEKTEXT`` operation can also be used to read memory, it is " +"significantly slower as it only reads one word at a time and requires " +"multiple context switches between the tracer and tracee processes." +msgstr "" +"در سیستم‌های لینوکسی، دو روش اصلی برای خواندن حافظه از یک فرایند دیگر وجود " +"دارد. روش اول از طریق سیستم‌فایل ``/proc`` است، به‌ویژه با خواندن از ``/proc/" +"[pid]/mem`` که دسترسی مستقیمی به حافظه‌ی فرایند فراهم می‌کند. این کار به " +"مجوزهای مناسب نیاز دارد؛ یا باید همان کاربرِ فرایند هدف باشید یا دسترسی root " +"داشته باشید. روش دوم استفاده از فراخوانی سیستمی ``process_vm_readv()`` است " +"که راهی کارآمدتر برای کپی حافظه بین فرایندها فراهم می‌کند. اگرچه می‌توان از " +"عملیات ``PTRACE_PEEKTEXT`` در ptrace نیز برای خواندن حافظه استفاده کرد، اما " +"این روش به‌طور قابل‌توجهی کندتر است، زیرا هر بار فقط یک کلمه را می‌خواند و به " +"چندین تعویض زمینه بین فرایندهای ردیاب و ردگیری‌شونده نیاز دارد." -msgid "For parsing ELF sections, the process involves reading and interpreting the ELF file format structures from the binary file on disk. The ELF header contains a pointer to the section header table. Each section header contains metadata about a section including its name (stored in a separate string table), offset, and size. To find a specific section like .PyRuntime, you need to walk through these headers and match the section name. The section header then provides the offset where that section exists in the file, which can be used to calculate its runtime address when the binary is loaded into memory." -msgstr "" +msgid "" +"For parsing ELF sections, the process involves reading and interpreting the " +"ELF file format structures from the binary file on disk. The ELF header " +"contains a pointer to the section header table. Each section header " +"contains metadata about a section including its name (stored in a separate " +"string table), offset, and size. To find a specific section " +"like .PyRuntime, you need to walk through these headers and match the " +"section name. The section header then provides the offset where that " +"section exists in the file, which can be used to calculate its runtime " +"address when the binary is loaded into memory." +msgstr "" +"برای تجزیه‌ی بخش‌های ELF، این فرآیند شامل خواندن و تفسیر ساختارهای قالب فایل " +"ELF از فایل دودویی روی دیسک است. سرآیند ELF شامل اشاره‌گری به جدول سرآیند " +"بخش‌ها است. هر سرآیند بخش شامل فراداده‌ای درباره‌ی یک بخش است، از جمله نام آن " +"(که در یک جدول رشته‌ای جداگانه ذخیره‌شده است)، آفست و اندازه. برای یافتن بخش " +"خاصی مانند .PyRuntime، باید این سرآیندها را پیمایش کنید و نام بخش را تطبیق " +"دهید. سپس سرآیند بخش آفست محل قرارگیری آن بخش در فایل را ارائه می‌دهد، که " +"می‌توان از آن برای محاسبه‌ی آدرس ران‌تایم آن هنگام بارگذاری فایل دودویی در " +"حافظه استفاده کرد." -msgid "You can read more about the ELF file format in the `ELF specification `_." +msgid "" +"You can read more about the ELF file format in the `ELF specification " +"`_." msgstr "" +"می‌توانید درباره‌ی قالب فایل ELF در `مشخصات ELF `_ بیشتر بخوانید." msgid "macOS (Mach-O)" -msgstr "" +msgstr "macOS (Mach-O)" msgid "To find the ``PyRuntime`` structure on macOS:" -msgstr "" +msgstr "برای یافتن ساختار ``PyRuntime`` در macOS:" -msgid "Call ``task_for_pid()`` to get the ``mach_port_t`` task port for the target process. This handle is needed to read memory using APIs like ``mach_vm_read_overwrite`` and ``mach_vm_region``." +msgid "" +"Call ``task_for_pid()`` to get the ``mach_port_t`` task port for the target " +"process. This handle is needed to read memory using APIs like " +"``mach_vm_read_overwrite`` and ``mach_vm_region``." msgstr "" +"برای دریافت پورت task (task port) از نوع ``mach_port_t`` برای فرایند هدف، " +"``task_for_pid()`` را فراخوانی کنید. برای خواندن حافظه با استفاده از " +"APIهایی مانند ``mach_vm_read_overwrite`` و ``mach_vm_region`` به این " +"دسته (handle) نیاز است." -msgid "Scan the memory regions to find the one containing the Python executable or ``libpython``." +msgid "" +"Scan the memory regions to find the one containing the Python executable or " +"``libpython``." msgstr "" +"ناحیه‌های حافظه را پویش کنید تا ناحیه‌ای را که شامل فایل اجرایی Python یا " +"``libpython`` است بیابید." -msgid "Load the binary file from disk and parse the Mach-O headers to find the section named ``PyRuntime`` in the ``__DATA`` segment. On macOS, symbol names are automatically prefixed with an underscore, so the ``PyRuntime`` symbol appears as ``_PyRuntime`` in the symbol table, but the section name is not affected." -msgstr "" +msgid "" +"Load the binary file from disk and parse the Mach-O headers to find the " +"section named ``PyRuntime`` in the ``__DATA`` segment. On macOS, symbol " +"names are automatically prefixed with an underscore, so the ``PyRuntime`` " +"symbol appears as ``_PyRuntime`` in the symbol table, but the section name " +"is not affected." +msgstr "" +"فایل دودویی را از دیسک بارگذاری کنید و سرصفحه‌های Mach-O را تجزیه کنید تا " +"بخشی به نام ``PyRuntime`` در سگمنت ``__DATA`` را بیابید. در macOS، به‌طور " +"خودکار یک زیرخط به ابتدای نام نمادها اضافه می‌شود، بنابراین نماد " +"``PyRuntime`` در جدول نمادها به‌صورت ``_PyRuntime`` ظاهر می‌شود، اما نام بخش " +"تحت تأثیر قرار نمی‌گیرد." msgid "" "def find_py_runtime_macos(pid: int) -> int:\n" @@ -237,7 +475,8 @@ msgid "" " handle, name_contains=\"libpython\"\n" " )\n" "\n" -" # Step 4: Parse Mach-O headers to get __DATA,__PyRuntime section offset\n" +" # Step 4: Parse Mach-O headers to get __DATA,__PyRuntime section " +"offset\n" " section_offset = parse_macho_section_offset(\n" " binary_path, \"__DATA\", \"__PyRuntime\"\n" " )\n" @@ -245,36 +484,129 @@ msgid "" " # Step 5: Compute the PyRuntime address in memory\n" " return base_address + section_offset" msgstr "" +"def find_py_runtime_macos(pid: int) -> int:\n" +" # Step 1: Get access to the process's memory\n" +" handle = get_memory_access_handle(pid)\n" +"\n" +" # Step 2: Try to find the Python executable in memory\n" +" binary_path, base_address = find_mapped_binary(\n" +" handle, name_contains=\"python\"\n" +" )\n" +"\n" +" # Step 3: Fallback to libpython if the executable is not found\n" +" if binary_path is None:\n" +" binary_path, base_address = find_mapped_binary(\n" +" handle, name_contains=\"libpython\"\n" +" )\n" +"\n" +" # Step 4: Parse Mach-O headers to get __DATA,__PyRuntime section " +"offset\n" +" section_offset = parse_macho_section_offset(\n" +" binary_path, \"__DATA\", \"__PyRuntime\"\n" +" )\n" +"\n" +" # Step 5: Compute the PyRuntime address in memory\n" +" return base_address + section_offset" -msgid "On macOS, accessing another process's memory requires using Mach-O specific APIs and file formats. The first step is obtaining a ``task_port`` handle via ``task_for_pid()``, which provides access to the target process's memory space. This handle enables memory operations through APIs like ``mach_vm_read_overwrite()``." -msgstr "" +msgid "" +"On macOS, accessing another process's memory requires using Mach-O specific " +"APIs and file formats. The first step is obtaining a ``task_port`` handle " +"via ``task_for_pid()``, which provides access to the target process's " +"memory space. This handle enables memory operations through APIs like " +"``mach_vm_read_overwrite()``." +msgstr "" +"در macOS، دسترسی به حافظه‌ی یک فرایند دیگر نیازمند استفاده از APIها و " +"قالب‌های فایل خاص Mach-O است. نخستین گام، به دست آوردن یک دسته‌ی " +"``task_port`` از طریق ``task_for_pid()`` است که دسترسی به فضای حافظه‌ی " +"فرایند هدف را فراهم می‌کند. این دسته عملیات حافظه را از طریق APIهایی " +"مانند ``mach_vm_read_overwrite()`` امکان‌پذیر می‌سازد." -msgid "The process memory can be examined using ``mach_vm_region()`` to scan through the virtual memory space, while ``proc_regionfilename()`` helps identify which binary files are loaded at each memory region. When the Python binary or library is found, its Mach-O headers need to be parsed to locate the ``PyRuntime`` structure." -msgstr "" +msgid "" +"The process memory can be examined using ``mach_vm_region()`` to scan " +"through the virtual memory space, while ``proc_regionfilename()`` helps " +"identify which binary files are loaded at each memory region. When the " +"Python binary or library is found, its Mach-O headers need to be parsed to " +"locate the ``PyRuntime`` structure." +msgstr "" +"می‌توان حافظه‌ی فرایند را با استفاده از ``mach_vm_region()`` برای پیمایش فضای " +"حافظه‌ی مجازی بررسی کرد، در حالی که ``proc_regionfilename()`` کمک می‌کند تا " +"شناسایی شود کدام فایل‌های دودویی در هر ناحیه‌ی حافظه بارگذاری شده‌اند. هنگامی " +"که دودویی یا کتابخانه‌ی پایتون پیدا شد، باید سرآیندهای Mach-O آن تجزیه شوند تا " +"محل ساختار ``PyRuntime`` پیدا شود." -msgid "The Mach-O format organizes code and data into segments and sections. The ``PyRuntime`` structure lives in a section named ``__PyRuntime`` within the ``__DATA`` segment. The actual runtime address calculation involves finding the ``__TEXT`` segment which serves as the binary's base address, then locating the ``__DATA`` segment containing our target section. The final address is computed by combining the base address with the appropriate section offsets from the Mach-O headers." -msgstr "" +msgid "" +"The Mach-O format organizes code and data into segments and sections. The " +"``PyRuntime`` structure lives in a section named ``__PyRuntime`` within the " +"``__DATA`` segment. The actual runtime address calculation involves finding " +"the ``__TEXT`` segment which serves as the binary's base address, then " +"locating the ``__DATA`` segment containing our target section. The final " +"address is computed by combining the base address with the appropriate " +"section offsets from the Mach-O headers." +msgstr "" +"قالب Mach-O کد و داده را در قالب قطعه‌ها و بخش‌ها سازمان‌دهی می‌کند. ساختار " +"``PyRuntime`` در بخشی به نام ``__PyRuntime`` درون قطعه‌ی ``__DATA`` قرار " +"دارد. محاسبه‌ی نشانی ران‌تایم واقعی مستلزم پیدا کردن قطعه‌ی ``__TEXT``، که " +"به‌عنوان نشانی پایه‌ی دودویی عمل می‌کند، و سپس یافتن قطعه‌ی ``__DATA`` حاوی بخش " +"هدف ما است. نشانی نهایی با ترکیب نشانی پایه با آفست‌های مناسب بخش‌ها از " +"سرآیندهای Mach-O محاسبه می‌شود." -msgid "Note that accessing another process's memory on macOS typically requires elevated privileges - either root access or special security entitlements granted to the debugging process." +msgid "" +"Note that accessing another process's memory on macOS typically requires " +"elevated privileges - either root access or special security entitlements " +"granted to the debugging process." msgstr "" +"توجه داشته باشید که دسترسی به حافظه‌ی یک فرایند دیگر در macOS معمولاً به " +"امتیازات بالاتری نیاز دارد - یا دسترسی root یا مجوزهای امنیتی خاص " +"(entitlements) که به فرایند اشکال‌زدایی اعطا شده‌اند." msgid "Windows (PE)" -msgstr "" +msgstr "ویندوز (PE)" msgid "To find the ``PyRuntime`` structure on Windows:" -msgstr "" +msgstr "برای یافتن ساختار ``PyRuntime`` در ویندوز:" -msgid "Use the ToolHelp API to enumerate all modules loaded in the target process. This is done using functions such as `CreateToolhelp32Snapshot `_, `Module32First `_, and `Module32Next `_." -msgstr "" +msgid "" +"Use the ToolHelp API to enumerate all modules loaded in the target process. " +"This is done using functions such as `CreateToolhelp32Snapshot `_, `Module32First `_, and " +"`Module32Next `_." +msgstr "" +"برای برشماری همه ماژول‌های بارگذاری‌شده در فرایند هدف از ToolHelp API استفاده " +"کنید. این کار با استفاده از توابعی مانند `CreateToolhelp32Snapshot `_، `Module32First `_ و `Module32Next " +"`_ انجام می‌شود." -msgid "Identify the module corresponding to :file:`python.exe` or :file:`python{XY}.dll`, where ``X`` and ``Y`` are the major and minor version numbers of the Python version, and record its base address." +msgid "" +"Identify the module corresponding to :file:`python.exe` " +"or :file:`python{XY}.dll`, where ``X`` and ``Y`` are the major and minor " +"version numbers of the Python version, and record its base address." msgstr "" +"ماژول متناظر با :file:`python.exe` یا :file:`python{XY}.dll` را شناسایی " +"کنید، که در آن ``X`` و ``Y`` شماره‌های اصلی و فرعی نسخه پایتون هستند، و آدرس " +"پایه‌ی آن را ثبت کنید." -msgid "Locate the ``PyRuntim`` section. Due to the PE format's 8-character limit on section names (defined as ``IMAGE_SIZEOF_SHORT_NAME``), the original name ``PyRuntime`` is truncated. This section contains the ``PyRuntime`` structure." +msgid "" +"Locate the ``PyRuntim`` section. Due to the PE format's 8-character limit " +"on section names (defined as ``IMAGE_SIZEOF_SHORT_NAME``), the original " +"name ``PyRuntime`` is truncated. This section contains the ``PyRuntime`` " +"structure." msgstr "" +"بخش ``PyRuntim`` را بیابید. به دلیل محدودیت ۸ نویسه‌ای قالب PE برای نام " +"بخش‌ها (که به‌صورت ``IMAGE_SIZEOF_SHORT_NAME`` تعریف شده است)، نام اصلی " +"``PyRuntime`` کوتاه شده است. این بخش شامل ساختار ``PyRuntime`` است." -msgid "Retrieve the section’s relative virtual address (RVA) and add it to the base address of the module." +msgid "" +"Retrieve the section’s relative virtual address (RVA) and add it to the " +"base address of the module." msgstr "" +"آدرس مجازی نسبی بخش (RVA) را بازیابی کنید و آن را به آدرس پایه ماژول اضافه " +"کنید." msgid "" "def find_py_runtime_windows(pid: int) -> int:\n" @@ -292,60 +624,164 @@ msgid "" "\n" " # Step 3: Parse PE section headers to get the RVA of the PyRuntime\n" " # section. The section name appears as \"PyRuntim\" due to the\n" -" # 8-character limit defined by the PE format (IMAGE_SIZEOF_SHORT_NAME).\n" +" # 8-character limit defined by the PE format " +"(IMAGE_SIZEOF_SHORT_NAME).\n" " section_rva = parse_pe_section_offset(binary_path, \"PyRuntim\")\n" "\n" " # Step 4: Compute PyRuntime address in memory\n" " return base_address + section_rva" msgstr "" +"def find_py_runtime_windows(pid: int) -> int:\n" +" # مرحله ۱: تلاش برای یافتن فایل اجرایی پایتون در حافظه\n" +" binary_path, base_address = find_loaded_module(\n" +" pid, name_contains=\"python\"\n" +" )\n" +"\n" +" # مرحله ۲: در صورت یافت نشدن فایل اجرایی، از pythonXY.dll اشتراکی\n" +" # استفاده می‌شود\n" +" if binary_path is None:\n" +" binary_path, base_address = find_loaded_module(\n" +" pid, name_contains=\"python3\"\n" +" )\n" +"\n" +" # مرحله ۳: تحلیل سرآیندهای بخش PE برای دریافت RVA بخش PyRuntime.\n" +" # نام بخش به دلیل محدودیت ۸ نویسه‌ای تعریف‌شده توسط قالب PE " +"(IMAGE_SIZEOF_SHORT_NAME)\n" +" # به‌صورت \"PyRuntim\" نمایش داده می‌شود.\n" +" section_rva = parse_pe_section_offset(binary_path, \"PyRuntim\")\n" +"\n" +" # مرحله ۴: محاسبه نشانی PyRuntime در حافظه\n" +" return base_address + section_rva" -msgid "On Windows, accessing another process's memory requires using the Windows API functions like ``CreateToolhelp32Snapshot()`` and ``Module32First()/Module32Next()`` to enumerate loaded modules. The ``OpenProcess()`` function provides a handle to access the target process's memory space, enabling memory operations through ``ReadProcessMemory()``." -msgstr "" +msgid "" +"On Windows, accessing another process's memory requires using the Windows " +"API functions like ``CreateToolhelp32Snapshot()`` and ``Module32First()/" +"Module32Next()`` to enumerate loaded modules. The ``OpenProcess()`` " +"function provides a handle to access the target process's memory space, " +"enabling memory operations through ``ReadProcessMemory()``." +msgstr "" +"در ویندوز، دسترسی به حافظه‌ی یک فرایند دیگر نیازمند استفاده از توابع API " +"ویندوز مانند ``CreateToolhelp32Snapshot()`` و ``Module32First()/" +"Module32Next()`` برای برشماری ماژول‌های بارگذاری‌شده است. تابع " +"``OpenProcess()`` یک دسته (handle) برای دسترسی به فضای حافظه‌ی فرایند هدف " +"فراهم می‌کند و عملیات حافظه را از طریق ``ReadProcessMemory()`` ممکن می‌سازد." -msgid "The process memory can be examined by enumerating loaded modules to find the Python binary or DLL. When found, its PE headers need to be parsed to locate the ``PyRuntime`` structure." +msgid "" +"The process memory can be examined by enumerating loaded modules to find " +"the Python binary or DLL. When found, its PE headers need to be parsed to " +"locate the ``PyRuntime`` structure." msgstr "" +"حافظه‌ی فرایند را می‌توان با فهرست‌گیری ماژول‌های بارگذاری‌شده برای یافتن دودویی " +"یا DLL پایتون بررسی کرد. هنگامی که پیدا شد، باید سرآیندهای PE آن تجزیه شوند " +"تا ساختار ``PyRuntime`` مکان‌یابی شود." -msgid "The PE format organizes code and data into sections. The ``PyRuntime`` structure lives in a section named \"PyRuntim\" (truncated from \"PyRuntime\" due to PE's 8-character name limit). The actual runtime address calculation involves finding the module's base address from the module entry, then locating our target section in the PE headers. The final address is computed by combining the base address with the section's virtual address from the PE section headers." -msgstr "" +msgid "" +"The PE format organizes code and data into sections. The ``PyRuntime`` " +"structure lives in a section named \"PyRuntim\" (truncated from " +"\"PyRuntime\" due to PE's 8-character name limit). The actual runtime " +"address calculation involves finding the module's base address from the " +"module entry, then locating our target section in the PE headers. The final " +"address is computed by combining the base address with the section's " +"virtual address from the PE section headers." +msgstr "" +"قالب PE، کد و داده را در بخش‌ها سازمان‌دهی می‌کند. ساختار ``PyRuntime`` در " +"بخشی به نام \"PyRuntim\" قرار دارد (که به دلیل محدودیت ۸ نویسه‌ای نام در PE، " +"از \"PyRuntime\" کوتاه شده است). محاسبه نشانی واقعی ران‌تایم شامل یافتن " +"نشانی پایه ماژول از مدخل ماژول، و سپس یافتن بخش هدف ما در سرآیندهای PE است. " +"نشانی نهایی با ترکیب نشانی پایه با نشانی مجازی بخش، از سرآیندهای بخش در PE " +"محاسبه می‌شود." -msgid "Note that accessing another process's memory on Windows typically requires appropriate privileges - either administrative access or the ``SeDebugPrivilege`` privilege granted to the debugging process." +msgid "" +"Note that accessing another process's memory on Windows typically requires " +"appropriate privileges - either administrative access or the " +"``SeDebugPrivilege`` privilege granted to the debugging process." msgstr "" +"توجه داشته باشید که دسترسی به حافظه‌ی فرایندی دیگر در ویندوز معمولاً به " +"امتیازات مناسب نیاز دارد؛ خواه دسترسی مدیریتی، خواه امتیاز " +"``SeDebugPrivilege`` که به فرایند اشکال‌زدایی اعطا شده است." msgid "Reading _Py_DebugOffsets" -msgstr "" +msgstr "خواندن _Py_DebugOffsets" -msgid "Once the address of the ``PyRuntime`` structure has been determined, the next step is to read the ``_Py_DebugOffsets`` structure located at the beginning of the ``PyRuntime`` block." +msgid "" +"Once the address of the ``PyRuntime`` structure has been determined, the " +"next step is to read the ``_Py_DebugOffsets`` structure located at the " +"beginning of the ``PyRuntime`` block." msgstr "" +"پس از تعیین نشانی ساختار ``PyRuntime``، گام بعدی خواندن ساختار " +"``_Py_DebugOffsets`` است که در ابتدای بلوک ``PyRuntime`` قرار دارد." -msgid "This structure provides version-specific field offsets that are needed to safely read interpreter and thread state memory. These offsets vary between CPython versions and must be checked before use to ensure they are compatible." +msgid "" +"This structure provides version-specific field offsets that are needed to " +"safely read interpreter and thread state memory. These offsets vary between " +"CPython versions and must be checked before use to ensure they are " +"compatible." msgstr "" +"این ساختار، آفست‌های فیلد خاص هر نسخه را فراهم می‌کند که برای خواندن ایمن " +"حافظه‌ی وضعیت مفسر و نخ لازم هستند. این آفست‌ها در نسخه‌های مختلف CPython " +"متفاوت‌اند و باید پیش از استفاده بررسی شوند تا از سازگاری آن‌ها اطمینان حاصل " +"شود." msgid "To read and check the debug offsets, follow these steps:" -msgstr "" +msgstr "برای خواندن و بررسی آفست‌های اشکال‌زدایی، مراحل زیر را دنبال کنید:" -msgid "Read memory from the target process starting at the ``PyRuntime`` address, covering the same number of bytes as the ``_Py_DebugOffsets`` structure. This structure is located at the very start of the ``PyRuntime`` memory block. Its layout is defined in CPython’s internal headers and stays the same within a given minor version, but may change in major versions." -msgstr "" +msgid "" +"Read memory from the target process starting at the ``PyRuntime`` address, " +"covering the same number of bytes as the ``_Py_DebugOffsets`` structure. " +"This structure is located at the very start of the ``PyRuntime`` memory " +"block. Its layout is defined in CPython’s internal headers and stays the " +"same within a given minor version, but may change in major versions." +msgstr "" +"حافظه‌ی فرایند هدف را، شروع از نشانی ``PyRuntime``، بخوانید، به‌گونه‌ای که " +"همان تعداد بایتِ ساختار ``_Py_DebugOffsets`` را پوشش دهد. این ساختار درست در " +"ابتدای بلوک حافظه‌ی ``PyRuntime`` قرار دارد. چیدمان آن در سرصفحه‌های داخلی " +"CPython تعریف شده است و در یک نسخه‌ی فرعی مشخص ثابت می‌ماند، اما ممکن است در " +"نسخه‌های اصلی تغییر کند." msgid "Check that the structure contains valid data:" -msgstr "" +msgstr "بررسی کنید که ساختار حاوی داده‌های معتبر باشد:" msgid "The ``cookie`` field must match the expected debug marker." msgstr "" +"فیلد ``cookie`` باید با نشانگر اشکال‌زدایی مورد انتظار مطابقت داشته باشد." -msgid "The ``version`` field must match the version of the Python interpreter used by the debugger." +msgid "" +"The ``version`` field must match the version of the Python interpreter used " +"by the debugger." msgstr "" +"فیلد ``version`` باید با نسخه‌ی مفسر پایتونی که اشکال‌زدا از آن استفاده می‌کند، " +"مطابقت داشته باشد." -msgid "If either the debugger or the target process is using a pre-release version (for example, an alpha, beta, or release candidate), the versions must match exactly." +msgid "" +"If either the debugger or the target process is using a pre-release version " +"(for example, an alpha, beta, or release candidate), the versions must " +"match exactly." msgstr "" +"اگر اشکال‌زدا یا فرایند هدف از یک نسخه‌ی پیش‌انتشار (برای مثال، آلفا، بتا یا " +"نامزد انتشار) استفاده کند، نسخه‌ها باید دقیقاً با هم مطابقت داشته باشند." -msgid "The ``free_threaded`` field must have the same value in both the debugger and the target process." +msgid "" +"The ``free_threaded`` field must have the same value in both the debugger " +"and the target process." msgstr "" +"فیلد ``free_threaded`` باید هم در اشکال‌زدا و هم در فرایند هدف مقدار یکسانی " +"داشته باشد." -msgid "If the structure is valid, the offsets it contains can be used to locate fields in memory. If any check fails, the debugger should stop the operation to avoid reading memory in the wrong format." +msgid "" +"If the structure is valid, the offsets it contains can be used to locate " +"fields in memory. If any check fails, the debugger should stop the " +"operation to avoid reading memory in the wrong format." msgstr "" +"اگر ساختار معتبر باشد، می‌توان از آفست‌های موجود در آن برای مکان‌یابی فیلدها " +"در حافظه استفاده کرد. اگر هر یک از بررسی‌ها شکست بخورد، اشکال‌زدا باید عملیات " +"را متوقف کند تا از خواندن حافظه در قالب نادرست جلوگیری شود." -msgid "The following is an example implementation that reads and checks ``_Py_DebugOffsets``::" +msgid "" +"The following is an example implementation that reads and checks " +"``_Py_DebugOffsets``::" msgstr "" +"در ادامه یک پیاده‌سازی نمونه آمده است که ``_Py_DebugOffsets`` را می‌خواند و " +"بررسی می‌کند::" msgid "" "def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" @@ -369,57 +805,173 @@ msgid "" "\n" " return debug_offsets" msgstr "" +"def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" +" # Step 1: Read memory from the target process at the PyRuntime address\n" +" data = read_process_memory(\n" +" pid, address=py_runtime_addr, size=DEBUG_OFFSETS_SIZE\n" +" )\n" +"\n" +" # Step 2: Deserialize the raw bytes into a _Py_DebugOffsets structure\n" +" debug_offsets = parse_debug_offsets(data)\n" +"\n" +" # Step 3: Validate the contents of the structure\n" +" if debug_offsets.cookie != EXPECTED_COOKIE:\n" +" raise RuntimeError(\"Invalid or missing debug cookie\")\n" +" if debug_offsets.version != LOCAL_PYTHON_VERSION:\n" +" raise RuntimeError(\n" +" \"Mismatch between caller and target Python versions\"\n" +" )\n" +" if debug_offsets.free_threaded != LOCAL_FREE_THREADED:\n" +" raise RuntimeError(\"Mismatch in free-threaded configuration\")\n" +"\n" +" return debug_offsets" msgid "**Process suspension recommended**" -msgstr "" +msgstr "تعلیق فرایند توصیه می‌شود" -msgid "To avoid race conditions and ensure memory consistency, it is strongly recommended that the target process be suspended before performing any operations that read or write internal interpreter state. The Python runtime may concurrently mutate interpreter data structures—such as creating or destroying threads—during normal execution. This can result in invalid memory reads or writes." -msgstr "" +msgid "" +"To avoid race conditions and ensure memory consistency, it is strongly " +"recommended that the target process be suspended before performing any " +"operations that read or write internal interpreter state. The Python " +"runtime may concurrently mutate interpreter data structures—such as " +"creating or destroying threads—during normal execution. This can result in " +"invalid memory reads or writes." +msgstr "" +"برای اجتناب از شرایط رقابتی و اطمینان از سازگاری حافظه، به‌شدت توصیه می‌شود " +"که فرایند هدف پیش از انجام هر عملیاتی که وضعیت داخلی مفسر را می‌خواند یا " +"می‌نویسد، معلق شود. ران‌تایم پایتون ممکن است در حین اجرای عادی، همزمان " +"ساختارهای داده مفسر را تغییر دهد—مانند ایجاد یا از بین بردن نخ‌ها. این " +"می‌تواند منجر به خواندن یا نوشتن نامعتبر حافظه شود." -msgid "A debugger may suspend execution by attaching to the process with ``ptrace`` or by sending a ``SIGSTOP`` signal. Execution should only be resumed after debugger-side memory operations are complete." +msgid "" +"A debugger may suspend execution by attaching to the process with " +"``ptrace`` or by sending a ``SIGSTOP`` signal. Execution should only be " +"resumed after debugger-side memory operations are complete." msgstr "" +"یک اشکال‌زدا ممکن است اجرا را با اتصال به فرایند از طریق ``ptrace`` یا با " +"ارسال سیگنال ``SIGSTOP`` معلق کند. اجرا باید تنها پس از کامل شدن عملیات " +"حافظه‌ای در سمت اشکال‌زدا از سر گرفته شود." -msgid "Some tools, such as profilers or sampling-based debuggers, may operate on a running process without suspension. In such cases, tools must be explicitly designed to handle partially updated or inconsistent memory. For most debugger implementations, suspending the process remains the safest and most robust approach." -msgstr "" +msgid "" +"Some tools, such as profilers or sampling-based debuggers, may operate on a " +"running process without suspension. In such cases, tools must be explicitly " +"designed to handle partially updated or inconsistent memory. For most " +"debugger implementations, suspending the process remains the safest and " +"most robust approach." +msgstr "" +"برخی ابزارها، مانند پروفایل‌گیرها (profilers) یا اشکال‌زداهای مبتنی بر " +"نمونه‌برداری، ممکن است بدون تعلیق، روی یک فرایند در حال اجرا عمل کنند. در " +"چنین مواردی، ابزارها باید به‌صراحت برای مدیریت حافظه‌ای که به‌طور ناقص " +"به‌روزرسانی شده یا ناسازگار است، طراحی شده باشند. برای بیشتر پیاده‌سازی‌های " +"اشکال‌زدا، تعلیق فرایند همچنان ایمن‌ترین و پایدارترین رویکرد باقی می‌ماند." msgid "Locating the interpreter and thread state" -msgstr "" +msgstr "یافتن وضعیت مفسر و نخ" -msgid "Before code can be injected and executed in a remote Python process, the debugger must choose a thread in which to schedule execution. This is necessary because the control fields used to perform remote code injection are located in the ``_PyRemoteDebuggerSupport`` structure, which is embedded in a ``PyThreadState`` object. These fields are modified by the debugger to request execution of injected scripts." -msgstr "" +msgid "" +"Before code can be injected and executed in a remote Python process, the " +"debugger must choose a thread in which to schedule execution. This is " +"necessary because the control fields used to perform remote code injection " +"are located in the ``_PyRemoteDebuggerSupport`` structure, which is " +"embedded in a ``PyThreadState`` object. These fields are modified by the " +"debugger to request execution of injected scripts." +msgstr "" +"پیش از آنکه بتوان کد را در یک فرایند پایتون راه‌دور تزریق و اجرا کرد، " +"اشکال‌زدا باید نخی را انتخاب کند که اجرای کد در آن زمان‌بندی شود. این کار " +"ضروری است، زیرا فیلدهای کنترلی استفاده‌شده برای انجام تزریق کد از راه دور در " +"ساختار ``_PyRemoteDebuggerSupport`` قرار دارند که در یک شیء " +"``PyThreadState`` جاسازی شده است. این فیلدها توسط اشکال‌زدا تغییر داده " +"می‌شوند تا اجرای اسکریپت‌های تزریق‌شده درخواست شود." -msgid "The ``PyThreadState`` structure represents a thread running inside a Python interpreter. It maintains the thread’s evaluation context and contains the fields required for debugger coordination. Locating a valid ``PyThreadState`` is therefore a key prerequisite for triggering execution remotely." +msgid "" +"The ``PyThreadState`` structure represents a thread running inside a Python " +"interpreter. It maintains the thread’s evaluation context and contains the " +"fields required for debugger coordination. Locating a valid " +"``PyThreadState`` is therefore a key prerequisite for triggering execution " +"remotely." msgstr "" +"ساختار ``PyThreadState`` یک نخ در حال اجرا درون یک مفسر پایتون را نشان " +"می‌دهد. این ساختار زمینه‌ی ارزیابی نخ را نگه می‌دارد و شامل فیلدهای مورد نیاز " +"برای هماهنگی اشکال‌زدا است. بنابراین، یافتن یک ``PyThreadState`` معتبر، " +"پیش‌نیازی کلیدی برای راه‌اندازی اجرا از راه دور است." -msgid "A thread is typically selected based on its role or ID. In most cases, the main thread is used, but some tools may target a specific thread by its native thread ID. Once the target thread is chosen, the debugger must locate both the interpreter and the associated thread state structures in memory." +msgid "" +"A thread is typically selected based on its role or ID. In most cases, the " +"main thread is used, but some tools may target a specific thread by its " +"native thread ID. Once the target thread is chosen, the debugger must " +"locate both the interpreter and the associated thread state structures in " +"memory." msgstr "" +"یک نخ معمولاً بر اساس نقش یا شناسه آن انتخاب می‌شود. در بیشتر موارد، از نخ " +"اصلی استفاده می‌شود، اما برخی ابزارها ممکن است نخ خاصی را با شناسه نخ بومی " +"آن هدف قرار دهند. پس از انتخاب نخ هدف، اشکال‌زدا باید هم مفسر و هم ساختارهای " +"وضعیت نخ مرتبط را در حافظه پیدا کند." msgid "The relevant internal structures are defined as follows:" -msgstr "" +msgstr "ساختارهای درونی مرتبط به‌صورت زیر تعریف شده‌اند:" -msgid "``PyInterpreterState`` represents an isolated Python interpreter instance. Each interpreter maintains its own set of imported modules, built-in state, and thread state list. Although most Python applications use a single interpreter, CPython supports multiple interpreters in the same process." +msgid "" +"``PyInterpreterState`` represents an isolated Python interpreter instance. " +"Each interpreter maintains its own set of imported modules, built-in state, " +"and thread state list. Although most Python applications use a single " +"interpreter, CPython supports multiple interpreters in the same process." msgstr "" +"``PyInterpreterState`` بیانگر نمونه‌ای مجزا از مفسر پایتون است. هر مفسر " +"مجموعه‌ای از ماژول‌های ایمپورت‌شده، وضعیت توکار و فهرست وضعیت نخ‌های خود را نگه " +"می‌دارد. اگرچه بیشتر برنامه‌های پایتون از یک مفسر واحد استفاده می‌کنند، " +"CPython از چندین مفسر در یک فرایند پشتیبانی می‌کند." -msgid "``PyThreadState`` represents a thread running within an interpreter. It contains execution state and the control fields used by the debugger." +msgid "" +"``PyThreadState`` represents a thread running within an interpreter. It " +"contains execution state and the control fields used by the debugger." msgstr "" +"``PyThreadState`` نشان‌دهنده‌ی یک نخ در حال اجرا درون یک مفسر است. این شامل " +"وضعیت اجرا و فیلدهای کنترلی است که اشکال‌زدا از آن‌ها استفاده می‌کند." msgid "To locate a thread:" -msgstr "" +msgstr "برای پیدا کردن یک نخ:" -msgid "Use the offset ``runtime_state.interpreters_head`` to obtain the address of the first interpreter in the ``PyRuntime`` structure. This is the entry point to the linked list of active interpreters." +msgid "" +"Use the offset ``runtime_state.interpreters_head`` to obtain the address of " +"the first interpreter in the ``PyRuntime`` structure. This is the entry " +"point to the linked list of active interpreters." msgstr "" +"از آفست ``runtime_state.interpreters_head`` برای به‌دست آوردن نشانی نخستین " +"مفسر در ساختار ``PyRuntime`` استفاده کنید. این، نقطه‌ی ورود به فهرست پیوندی " +"مفسرهای فعال است." -msgid "Use the offset ``interpreter_state.threads_main`` to access the main thread state associated with the selected interpreter. This is typically the most reliable thread to target." +msgid "" +"Use the offset ``interpreter_state.threads_main`` to access the main thread " +"state associated with the selected interpreter. This is typically the most " +"reliable thread to target." msgstr "" +"از آفست (offset) ``interpreter_state.threads_main`` برای دسترسی به وضعیت نخ " +"اصلی مرتبط با مفسر انتخاب‌شده استفاده کنید. این معمولاً قابل‌اطمینان‌ترین نخ " +"برای هدف قرار دادن است." -msgid "Optionally, use the offset ``interpreter_state.threads_head`` to iterate through the linked list of all thread states. Each ``PyThreadState`` structure contains a ``native_thread_id`` field, which may be compared to a target thread ID to find a specific thread." +msgid "" +"Optionally, use the offset ``interpreter_state.threads_head`` to iterate " +"through the linked list of all thread states. Each ``PyThreadState`` " +"structure contains a ``native_thread_id`` field, which may be compared to a " +"target thread ID to find a specific thread." msgstr "" +"به‌صورت اختیاری، برای پیمایش فهرست پیوندی تمام وضعیت‌های نخ، از آفست (offset) " +"``interpreter_state.threads_head`` استفاده کنید. هر ساختار " +"``PyThreadState`` شامل یک فیلد ``native_thread_id`` است که می‌توان آن را با " +"یک شناسه نخ هدف مقایسه کرد تا یک نخ خاص پیدا شود." -msgid "Once a valid ``PyThreadState`` has been found, its address can be used in later steps of the protocol, such as writing debugger control fields and scheduling execution." +msgid "" +"Once a valid ``PyThreadState`` has been found, its address can be used in " +"later steps of the protocol, such as writing debugger control fields and " +"scheduling execution." msgstr "" +"پس از یافتن یک ``PyThreadState`` معتبر، می‌توان از نشانی آن در مراحل بعدی " +"پروتکل استفاده کرد، مانند نوشتن فیلدهای کنترل اشکال‌زدا و زمان‌بندی اجرا." -msgid "The following is an example implementation that locates the main thread state::" -msgstr "" +msgid "" +"The following is an example implementation that locates the main thread " +"state::" +msgstr "در ادامه یک پیاده‌سازی نمونه آمده است که وضعیت نخ اصلی را پیدا می‌کند::" msgid "" "def find_main_thread_state(\n" @@ -443,9 +995,32 @@ msgid "" "\n" " return thread_state_addr" msgstr "" +"def find_main_thread_state(\n" +" pid: int, py_runtime_addr: int, debug_offsets: DebugOffsets,\n" +") -> int:\n" +" # Step 1: Read interpreters_head from PyRuntime\n" +" interp_head_ptr = (\n" +" py_runtime_addr + debug_offsets.runtime_state.interpreters_head\n" +" )\n" +" interp_addr = read_pointer(pid, interp_head_ptr)\n" +" if interp_addr == 0:\n" +" raise RuntimeError(\"No interpreter found in the target process\")\n" +"\n" +" # Step 2: Read the threads_main pointer from the interpreter\n" +" threads_main_ptr = (\n" +" interp_addr + debug_offsets.interpreter_state.threads_main\n" +" )\n" +" thread_state_addr = read_pointer(pid, threads_main_ptr)\n" +" if thread_state_addr == 0:\n" +" raise RuntimeError(\"Main thread state is not available\")\n" +"\n" +" return thread_state_addr" -msgid "The following example demonstrates how to locate a thread by its native thread ID::" +msgid "" +"The following example demonstrates how to locate a thread by its native " +"thread ID::" msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان یک نخ را با شناسه نخ بومی آن پیدا کرد::" msgid "" "def find_thread_by_id(\n" @@ -474,39 +1049,108 @@ msgid "" "\n" " raise RuntimeError(\"Thread with the given ID was not found\")" msgstr "" +"def find_thread_by_id(\n" +" pid: int,\n" +" interp_addr: int,\n" +" debug_offsets: DebugOffsets,\n" +" target_tid: int,\n" +") -> int:\n" +" # Start at threads_head and walk the linked list\n" +" thread_ptr = read_pointer(\n" +" pid,\n" +" interp_addr + debug_offsets.interpreter_state.threads_head\n" +" )\n" +"\n" +" while thread_ptr:\n" +" native_tid_ptr = (\n" +" thread_ptr + debug_offsets.thread_state.native_thread_id\n" +" )\n" +" native_tid = read_int(pid, native_tid_ptr)\n" +" if native_tid == target_tid:\n" +" return thread_ptr\n" +" thread_ptr = read_pointer(\n" +" pid,\n" +" thread_ptr + debug_offsets.thread_state.next\n" +" )\n" +"\n" +" raise RuntimeError(\"Thread with the given ID was not found\")" -msgid "Once a valid thread state has been located, the debugger can proceed with modifying its control fields and scheduling execution, as described in the next section." +msgid "" +"Once a valid thread state has been located, the debugger can proceed with " +"modifying its control fields and scheduling execution, as described in the " +"next section." msgstr "" +"پس از یافتن یک وضعیت نخ معتبر، اشکال‌زدا می‌تواند به اصلاح فیلدهای کنترلی آن " +"و زمان‌بندی اجرا ادامه دهد، همان‌طور که در بخش بعدی توضیح داده شده است." msgid "Writing control information" -msgstr "" +msgstr "نوشتن اطلاعات کنترلی" -msgid "Once a valid ``PyThreadState`` structure has been identified, the debugger may modify control fields within it to schedule the execution of a specified Python script. These control fields are checked periodically by the interpreter, and when set correctly, they trigger the execution of remote code at a safe point in the evaluation loop." +msgid "" +"Once a valid ``PyThreadState`` structure has been identified, the debugger " +"may modify control fields within it to schedule the execution of a " +"specified Python script. These control fields are checked periodically by " +"the interpreter, and when set correctly, they trigger the execution of " +"remote code at a safe point in the evaluation loop." msgstr "" +"پس از شناسایی یک ساختار ``PyThreadState`` معتبر، اشکال‌زدا می‌تواند فیلدهای " +"کنترلی درون آن را برای زمان‌بندی اجرای یک اسکریپت پایتون مشخص تغییر دهد. این " +"فیلدهای کنترلی به‌طور دوره‌ای توسط مفسر بررسی می‌شوند و هنگامی که به‌درستی " +"تنظیم شوند، باعث اجرای کد راه‌دور در یک نقطه امن در حلقه ارزیابی می‌شوند." -msgid "Each ``PyThreadState`` contains a ``_PyRemoteDebuggerSupport`` structure used for communication between the debugger and the interpreter. The locations of its fields are defined by the ``_Py_DebugOffsets`` structure and include the following:" +msgid "" +"Each ``PyThreadState`` contains a ``_PyRemoteDebuggerSupport`` structure " +"used for communication between the debugger and the interpreter. The " +"locations of its fields are defined by the ``_Py_DebugOffsets`` structure " +"and include the following:" msgstr "" +"هر ``PyThreadState`` شامل یک ساختار ``_PyRemoteDebuggerSupport`` است که " +"برای ارتباط بین اشکال‌زدا و مفسر به کار می‌رود. محل‌های فیلدهای آن توسط ساختار " +"``_Py_DebugOffsets`` تعریف شده‌اند و شامل موارد زیر هستند:" -msgid "``debugger_script_path``: A fixed-size buffer that holds the full path to a Python source file (``.py``). This file must be accessible and readable by the target process when execution is triggered." +msgid "" +"``debugger_script_path``: A fixed-size buffer that holds the full path to a " +"Python source file (``.py``). This file must be accessible and readable by " +"the target process when execution is triggered." msgstr "" +"``debugger_script_path``: یک بافربا اندازه‌ی ثابت که مسیر کامل یک " +"فایل منبع پایتون (``.py``) را در خود نگه می‌دارد. این فایل باید هنگامی که " +"اجرا راه‌اندازی می‌شود، برای فرایند هدف قابل دسترسی و خواندن باشد." -msgid "``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the interpreter that a script is ready to be executed." +msgid "" +"``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the " +"interpreter that a script is ready to be executed." msgstr "" +"``debugger_pending_call``: یک پرچم عدد صحیح. تنظیم این مقدار روی ``1`` به " +"مفسر اطلاع می‌دهد که یک اسکریپت آماده‌ی اجرا است." -msgid "``eval_breaker``: A field checked by the interpreter during execution. Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this field causes the interpreter to pause and check for debugger activity." +msgid "" +"``eval_breaker``: A field checked by the interpreter during execution. " +"Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this " +"field causes the interpreter to pause and check for debugger activity." msgstr "" +"``eval_breaker``: فیلدی که مفسر در حین اجرا آن را بررسی می‌کند. تنظیم بیت ۵ " +"(``_PY_EVAL_PLEASE_STOP_BIT``، مقدار ``1U << 5``) در این فیلد باعث می‌شود " +"مفسر مکث کند و فعالیت اشکال‌زدا را بررسی کند." -msgid "To complete the injection, the debugger must perform the following steps:" -msgstr "" +msgid "" +"To complete the injection, the debugger must perform the following steps:" +msgstr "برای تکمیل تزریق، اشکال‌زدا باید مراحل زیر را انجام دهد:" msgid "Write the full script path into the ``debugger_script_path`` buffer." -msgstr "" +msgstr "مسیر کامل اسکریپت را در بافر ``debugger_script_path`` بنویسید." msgid "Set ``debugger_pending_call`` to ``1``." -msgstr "" +msgstr "``debugger_pending_call`` را روی ``1`` تنظیم کنید." -msgid "Read the current value of ``eval_breaker``, set bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``), and write the updated value back. This signals the interpreter to check for debugger activity." +msgid "" +"Read the current value of ``eval_breaker``, set bit 5 " +"(``_PY_EVAL_PLEASE_STOP_BIT``), and write the updated value back. This " +"signals the interpreter to check for debugger activity." msgstr "" +"مقدار فعلی ``eval_breaker`` را بخوانید، بیت ۵ " +"(``_PY_EVAL_PLEASE_STOP_BIT``) را تنظیم کنید و مقدار به‌روزشده را دوباره " +"بنویسید. این کار به مفسر علامت می‌دهد تا فعالیت اشکال‌زدا را بررسی کند." msgid "" "def inject_script(\n" @@ -545,75 +1189,217 @@ msgid "" " breaker |= (1 << 5)\n" " write_int(pid, eval_breaker_ptr, breaker)" msgstr "" +"def inject_script(\n" +" pid: int,\n" +" thread_state_addr: int,\n" +" debug_offsets: DebugOffsets,\n" +" script_path: str\n" +") -> None:\n" +" # محاسبه‌ی آفست پایه برای _PyRemoteDebuggerSupport\n" +" support_base = (\n" +" thread_state_addr +\n" +" debug_offsets.debugger_support.remote_debugger_support\n" +" )\n" +"\n" +" # مرحله‌ی ۱: نوشتن مسیر اسکریپت در debugger_script_path\n" +" script_path_ptr = (\n" +" support_base +\n" +" debug_offsets.debugger_support.debugger_script_path\n" +" )\n" +" write_string(pid, script_path_ptr, script_path)\n" +"\n" +" # مرحله‌ی ۲: تنظیم debugger_pending_call روی 1\n" +" pending_ptr = (\n" +" support_base +\n" +" debug_offsets.debugger_support.debugger_pending_call\n" +" )\n" +" write_int(pid, pending_ptr, 1)\n" +"\n" +" # مرحله‌ی ۳: تنظیم _PY_EVAL_PLEASE_STOP_BIT (بیت ۵، مقدار 1 << 5) در\n" +" # eval_breaker\n" +" eval_breaker_ptr = (\n" +" thread_state_addr +\n" +" debug_offsets.debugger_support.eval_breaker\n" +" )\n" +" breaker = read_int(pid, eval_breaker_ptr)\n" +" breaker |= (1 << 5)\n" +" write_int(pid, eval_breaker_ptr, breaker)" -msgid "Once these fields are set, the debugger may resume the process (if it was suspended). The interpreter will process the request at the next safe evaluation point, load the script from disk, and execute it." +msgid "" +"Once these fields are set, the debugger may resume the process (if it was " +"suspended). The interpreter will process the request at the next safe " +"evaluation point, load the script from disk, and execute it." msgstr "" +"پس از تنظیم این فیلدها، اشکال‌زدا می‌تواند فرایند را از سر گیرد (اگر تعلیق " +"شده باشد). مفسر درخواست را در نقطه ارزیابی امن بعدی پردازش می‌کند، اسکریپت " +"را از دیسک بارگذاری می‌کند و آن را اجرا می‌کند." -msgid "It is the responsibility of the debugger to ensure that the script file remains present and accessible to the target process during execution." +msgid "" +"It is the responsibility of the debugger to ensure that the script file " +"remains present and accessible to the target process during execution." msgstr "" +"بر عهده‌ی اشکال‌زدا است که اطمینان حاصل کند فایل اسکریپت در حین اجرا برای " +"فرایند هدف موجود و دسترس‌پذیر باقی می‌ماند." -msgid "Script execution is asynchronous. The script file cannot be deleted immediately after injection. The debugger should wait until the injected script has produced an observable effect before removing the file. This effect depends on what the script is designed to do. For example, a debugger might wait until the remote process connects back to a socket before removing the script. Once such an effect is observed, it is safe to assume the file is no longer needed." -msgstr "" +msgid "" +"Script execution is asynchronous. The script file cannot be deleted " +"immediately after injection. The debugger should wait until the injected " +"script has produced an observable effect before removing the file. This " +"effect depends on what the script is designed to do. For example, a " +"debugger might wait until the remote process connects back to a socket " +"before removing the script. Once such an effect is observed, it is safe to " +"assume the file is no longer needed." +msgstr "" +"اجرای اسکریپت ناهمگام است. فایل اسکریپت نمی‌تواند بلافاصله پس از تزریق حذف " +"شود. اشکال‌زدا باید پیش از حذف فایل صبر کند تا اسکریپت تزریق‌شده اثر " +"مشاهده‌پذیری ایجاد کند. این اثر به کاری بستگی دارد که اسکریپت برای انجام آن " +"طراحی شده است. برای مثال، یک اشکال‌زدا ممکن است پیش از حذف اسکریپت صبر کند " +"تا فرایند راه‌دور به یک سوکت اتصال برگشتی برقرار کند. هنگامی که چنین اثری " +"مشاهده شد، می‌توان با اطمینان فرض کرد که فایل دیگر مورد نیاز نیست." msgid "Summary" -msgstr "" +msgstr "خلاصه" msgid "To inject and execute a Python script in a remote process:" -msgstr "" +msgstr "برای تزریق و اجرای یک اسکریپت پایتون در یک فرایند راه‌دور:" msgid "Locate the ``PyRuntime`` structure in the target process’s memory." -msgstr "" +msgstr "ساختار ``PyRuntime`` را در حافظه‌ی فرایند هدف پیدا کنید." -msgid "Read and validate the ``_Py_DebugOffsets`` structure at the beginning of ``PyRuntime``." +msgid "" +"Read and validate the ``_Py_DebugOffsets`` structure at the beginning of " +"``PyRuntime``." msgstr "" +"ساختار ``_Py_DebugOffsets`` را در ابتدای ``PyRuntime`` بخوانید و اعتبارسنجی " +"کنید." msgid "Use the offsets to locate a valid ``PyThreadState``." -msgstr "" +msgstr "از آفست‌ها برای پیدا کردن یک ``PyThreadState`` معتبر استفاده کنید." msgid "Write the path to a Python script into ``debugger_script_path``." -msgstr "" +msgstr "مسیر یک اسکریپت پایتون را در ``debugger_script_path`` بنویسید." msgid "Set the ``debugger_pending_call`` flag to ``1``." -msgstr "" +msgstr "پرچم ``debugger_pending_call`` را روی ``1`` تنظیم کنید." msgid "Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field." -msgstr "" +msgstr "``_PY_EVAL_PLEASE_STOP_BIT`` را در فیلد ``eval_breaker`` تنظیم کنید." -msgid "Resume the process (if suspended). The script will execute at the next safe evaluation point." +msgid "" +"Resume the process (if suspended). The script will execute at the next safe " +"evaluation point." msgstr "" +"از سرگیری فرایند (در صورت تعلیق). اسکریپت در نقطه‌ی ارزیابی امن بعدی اجرا " +"خواهد شد." msgid "Security and threat model" -msgstr "" +msgstr "امنیت و مدل تهدید" -msgid "The remote debugging protocol relies on the same operating system primitives used by native debuggers such as GDB and LLDB. Attaching to a process requires the **same privileges** that those debuggers require, for example ``ptrace`` / Yama LSM on Linux, ``task_for_pid`` on macOS, and ``SeDebugPrivilege`` on Windows. Python does not introduce any new privilege escalation path; if an attacker already possesses the permissions needed to attach to a process, they could equally use GDB to read memory or inject code." -msgstr "" +msgid "" +"The remote debugging protocol relies on the same operating system " +"primitives used by native debuggers such as GDB and LLDB. Attaching to a " +"process requires the **same privileges** that those debuggers require, for " +"example ``ptrace`` / Yama LSM on Linux, ``task_for_pid`` on macOS, and " +"``SeDebugPrivilege`` on Windows. Python does not introduce any new " +"privilege escalation path; if an attacker already possesses the permissions " +"needed to attach to a process, they could equally use GDB to read memory or " +"inject code." +msgstr "" +"پروتکل اشکال‌زدایی از راه دور به همان امکانات اولیه‌ی سیستم‌عامل متکی است که " +"اشکال‌زداهای بومی مانند GDB و LLDB از آن‌ها استفاده می‌کنند. اتصال به یک " +"فرایند نیازمند **همان امتیازها** است که آن اشکال‌زداها نیاز دارند، برای مثال " +"``ptrace`` / Yama LSM در لینوکس، ``task_for_pid`` در macOS و " +"``SeDebugPrivilege`` در ویندوز. پایتون هیچ مسیر جدیدی برای ارتقاء امتیاز " +"معرفی نمی‌کند؛ اگر مهاجم از قبل دارای دسترسی‌های لازم برای اتصال به یک فرایند " +"باشد، می‌تواند به‌طور مشابه از GDB برای خواندن حافظه یا تزریق کد استفاده کند." -msgid "The following principles define what is, and is not, considered a security vulnerability in this feature:" +msgid "" +"The following principles define what is, and is not, considered a security " +"vulnerability in this feature:" msgstr "" +"اصول زیر مشخص می‌کنند که چه چیزی در این قابلیت، آسیب‌پذیری امنیتی محسوب می‌شود " +"و چه چیزی محسوب نمی‌شود:" msgid "Attaching requires OS-level privileges" -msgstr "" +msgstr "اتصال نیازمند دسترسی‌های سطح سیستم‌عامل است" -msgid "On every supported platform the operating system gates cross-process memory access behind privilege checks (``CAP_SYS_PTRACE``, root, or administrator rights). A report that demonstrates an issue only after these privileges have already been obtained is **not** a vulnerability in CPython, since the OS security boundary was already crossed." -msgstr "" +msgid "" +"On every supported platform the operating system gates cross-process memory " +"access behind privilege checks (``CAP_SYS_PTRACE``, root, or administrator " +"rights). A report that demonstrates an issue only after these privileges " +"have already been obtained is **not** a vulnerability in CPython, since the " +"OS security boundary was already crossed." +msgstr "" +"در همه‌ی پلتفرم‌های پشتیبانی‌شده، سیستم‌عامل دسترسی بین‌فرایندی به حافظه را منوط " +"به بررسی‌های امتیاز می‌کند (``CAP_SYS_PTRACE``، root یا حقوق مدیر). گزارشی که " +"یک مشکل را تنها پس از آنکه این امتیازها از قبل کسب شده‌اند نشان دهد، یک " +"آسیب‌پذیری در CPython **نیست**، زیرا از مرز امنیتی سیستم‌عامل از قبل عبور شده " +"است." -msgid "Crashes or memory errors when reading a compromised process are not vulnerabilities" +msgid "" +"Crashes or memory errors when reading a compromised process are not " +"vulnerabilities" msgstr "" +"خرابی‌ها یا خطاهای حافظه هنگام خواندن یک فرایند به‌خطر افتاده، آسیب‌پذیری " +"محسوب نمی‌شوند" -msgid "A tool that reads internal interpreter state from a target process must trust that memory to be well-formed. If the target process has been corrupted or is controlled by an attacker, the debugger or profiler may crash, produce garbage output, or behave unpredictably. This is the same risk accepted by every ``ptrace``-based debugger. Bugs in this category (buffer overflows, segmentation faults, or undefined behaviour triggered by reading corrupted state) are **not** treated as security issues, though fixes that improve robustness are welcome." -msgstr "" +msgid "" +"A tool that reads internal interpreter state from a target process must " +"trust that memory to be well-formed. If the target process has been " +"corrupted or is controlled by an attacker, the debugger or profiler may " +"crash, produce garbage output, or behave unpredictably. This is the same " +"risk accepted by every ``ptrace``-based debugger. Bugs in this category " +"(buffer overflows, segmentation faults, or undefined behaviour triggered by " +"reading corrupted state) are **not** treated as security issues, though " +"fixes that improve robustness are welcome." +msgstr "" +"ابزاری که وضعیت داخلی مفسر را از یک فرایند هدف می‌خواند، باید فرض کند که آن " +"حافظه خوش‌ساخت است. اگر فرایند هدف تخریب‌شده باشد یا تحت کنترل مهاجم باشد، " +"اشکال‌زدا یا پروفایلر ممکن است از کار بیفتد، خروجی نامعتبر تولید کند، یا " +"به‌صورت غیرقابل پیش‌بینی رفتار کند. این همان ریسکی است که هر اشکال‌زدای مبتنی " +"بر ``ptrace`` آن را می‌پذیرد. اشکال‌های این دسته (سرریزهای بافر، خطاهای " +"قطعه‌بندی (segmentation faults)، یا رفتار تعریف‌نشده ناشی از خواندن وضعیت تخریب‌شده) به‌عنوان مسائل " +"امنیتی تلقی **نمی‌شوند**، هرچند از اصلاحاتی که استحکام را بهبود می‌بخشند " +"استقبال می‌شود." msgid "Vulnerabilities in the target process are not in scope" -msgstr "" +msgstr "آسیب‌پذیری‌های فرایند هدف در محدوده نیستند" -msgid "If the Python process being debugged has already been compromised, the attacker already controls execution in that process. Demonstrating further impact from that starting point does not constitute a vulnerability in the remote debugging protocol." +msgid "" +"If the Python process being debugged has already been compromised, the " +"attacker already controls execution in that process. Demonstrating further " +"impact from that starting point does not constitute a vulnerability in the " +"remote debugging protocol." msgstr "" +"اگر فرایند پایتونِ در حال اشکال‌زدایی از قبل به خطر افتاده باشد، مهاجم از قبل " +"کنترل اجرا در آن فرایند را در دست دارد. نشان دادن تأثیر بیشتر از آن نقطه " +"آغاز، آسیب‌پذیری در پروتکل اشکال‌زدایی راه دور محسوب نمی‌شود." msgid "When to use ``PYTHON_DISABLE_REMOTE_DEBUG``" -msgstr "" +msgstr "زمان استفاده از ``PYTHON_DISABLE_REMOTE_DEBUG``" -msgid "The environment variable :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` (and the equivalent :option:`-X disable_remote_debug` flag) allows operators to disable the in-process side of the protocol as a **defence-in-depth** measure. This may be useful in hardened or sandboxed deployment environments where no debugging or profiling of the process is expected and reducing attack surface is a priority, even though the OS-level privilege checks already prevent unprivileged access." -msgstr "" +msgid "" +"The environment variable :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` (and the " +"equivalent :option:`-X disable_remote_debug` flag) allows operators to " +"disable the in-process side of the protocol as a **defence-in-depth** " +"measure. This may be useful in hardened or sandboxed deployment " +"environments where no debugging or profiling of the process is expected and " +"reducing attack surface is a priority, even though the OS-level privilege " +"checks already prevent unprivileged access." +msgstr "" +"متغیر محیطی :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` (و پرچم معادل :option:`-X " +"disable_remote_debug`) به راهبران اجازه می‌دهد سمت درون‌فرایندی پروتکل را " +"به‌عنوان تدبیری برای **دفاع در عمق** غیرفعال کنند. این ممکن است در محیط‌های " +"استقرار ایمن‌سازی‌شده یا سندباکس‌شده مفید باشد؛ محیط‌هایی که انتظار نمی‌رود " +"هیچ‌گونه اشکال‌زدایی یا پروفایل‌گیری از فرایند در آن‌ها انجام شود و کاهش سطح " +"حمله اولویت دارد، حتی اگر بررسی‌های امتیاز در سطح سیستم‌عامل از پیش از دسترسی " +"فاقد امتیاز جلوگیری کنند." -msgid "Setting this variable does **not** affect other OS-level debugging interfaces (``ptrace``, ``/proc``, ``task_for_pid``, etc.), which remain available according to their own permission models." +msgid "" +"Setting this variable does **not** affect other OS-level debugging " +"interfaces (``ptrace``, ``/proc``, ``task_for_pid``, etc.), which remain " +"available according to their own permission models." msgstr "" +"تنظیم این متغیر بر سایر رابط‌های اشکال‌زدایی در سطح سیستم‌عامل تأثیر " +"**نمی‌گذارد** (``ptrace``، ``/proc``، ``task_for_pid`` و غیره)، که بر اساس " +"مدل‌های مجوز خود در دسترس باقی می‌مانند." diff --git a/howto/sockets.po b/howto/sockets.po index 627cad844..55d220f45 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -25,43 +25,104 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Socket Programming HOWTO" -msgstr "" +msgstr "راهنمای عملی برنامه‌نویسی سوکت" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "Gordon McMillan" -msgstr "" +msgstr "گوردون مک‌میلان" msgid "Abstract" -msgstr "" +msgstr "چکیده" -msgid "Sockets are used nearly everywhere, but are one of the most severely misunderstood technologies around. This is a 10,000 foot overview of sockets. It's not really a tutorial - you'll still have work to do in getting things operational. It doesn't cover the fine points (and there are a lot of them), but I hope it will give you enough background to begin using them decently." -msgstr "" +msgid "" +"Sockets are used nearly everywhere, but are one of the most severely " +"misunderstood technologies around. This is a 10,000 foot overview of " +"sockets. It's not really a tutorial - you'll still have work to do in " +"getting things operational. It doesn't cover the fine points (and there are " +"a lot of them), but I hope it will give you enough background to begin using" +" them decently." +msgstr "" +"سوکت‌ها تقریباً همه‌جا استفاده می‌شوند، اما یکی از فناوری‌هایی هستند که " +"بیشترین سوءتفاهم درباره‌ی آن‌ها وجود دارد. این یک نمای کلی از ارتفاع ۱۰٬۰۰۰ " +"پایی از سوکت‌هاست. این واقعاً یک آموزش نیست؛ شما همچنان برای راه‌اندازی " +"عملیاتی آن‌ها کارهایی برای انجام خواهید داشت. این نمای کلی نکات ظریف را پوشش" +" نمی‌دهد (و تعداد آن‌ها زیاد است)، اما امیدوارم پیش‌زمینه‌ی کافی برای شروع " +"استفاده‌ی مناسب از آن‌ها به شما بدهد." msgid "Sockets" -msgstr "" +msgstr "سوکت‌ها" -msgid "I'm only going to talk about INET (i.e. IPv4) sockets, but they account for at least 99% of the sockets in use. And I'll only talk about STREAM (i.e. TCP) sockets - unless you really know what you're doing (in which case this HOWTO isn't for you!), you'll get better behavior and performance from a STREAM socket than anything else. I will try to clear up the mystery of what a socket is, as well as some hints on how to work with blocking and non-blocking sockets. But I'll start by talking about blocking sockets. You'll need to know how they work before dealing with non-blocking sockets." -msgstr "" +msgid "" +"I'm only going to talk about INET (i.e. IPv4) sockets, but they account for " +"at least 99% of the sockets in use. And I'll only talk about STREAM (i.e. " +"TCP) sockets - unless you really know what you're doing (in which case this " +"HOWTO isn't for you!), you'll get better behavior and performance from a " +"STREAM socket than anything else. I will try to clear up the mystery of what" +" a socket is, as well as some hints on how to work with blocking and non-" +"blocking sockets. But I'll start by talking about blocking sockets. You'll " +"need to know how they work before dealing with non-blocking sockets." +msgstr "" +"من فقط قصد دارم درباره‌ی سوکت‌های INET (یعنی IPv4) صحبت کنم، اما این سوکت‌ها " +"دست‌کم ۹۹٪ از سوکت‌های مورد استفاده را تشکیل می‌دهند. و فقط درباره‌ی سوکت‌های" +" STREAM (یعنی TCP) صحبت خواهم کرد — مگر اینکه واقعاً بدانید چه کار می‌کنید " +"(که در این صورت این راهنمای عملی بدرد شما نمیخورد!)، از یک سوکت STREAM رفتار و کارایی " +"بهتری نسبت به هر چیز دیگری خواهید گرفت. سعی می‌کنم ابهام درباره‌ی چیستی سوکت " +"را برطرف کنم، و همچنین نکاتی درباره‌ی نحوه‌ی کار با سوکت‌های مسدودکننده و " +"غیرمسدودکننده ارائه دهم. اما صحبت را با سوکت‌های مسدودکننده آغاز می‌کنم. پیش" +" از کار با سوکت‌های غیرمسدودکننده، باید بدانید که آن‌ها چگونه کار می‌کنند." -msgid "Part of the trouble with understanding these things is that \"socket\" can mean a number of subtly different things, depending on context. So first, let's make a distinction between a \"client\" socket - an endpoint of a conversation, and a \"server\" socket, which is more like a switchboard operator. The client application (your browser, for example) uses \"client\" sockets exclusively; the web server it's talking to uses both \"server\" sockets and \"client\" sockets." -msgstr "" +msgid "" +"Part of the trouble with understanding these things is that \"socket\" can " +"mean a number of subtly different things, depending on context. So first, " +"let's make a distinction between a \"client\" socket - an endpoint of a " +"conversation, and a \"server\" socket, which is more like a switchboard " +"operator. The client application (your browser, for example) uses \"client\"" +" sockets exclusively; the web server it's talking to uses both \"server\" " +"sockets and \"client\" sockets." +msgstr "" +"بخشی از دشواری درک این موارد آن است که «سوکت» می‌تواند بسته به زمینه، به چند" +" چیز با تفاوت‌های ظریف اشاره داشته باشد. بنابراین ابتدا، بیایید میان یک سوکت" +" «کلاینت»، یعنی پایانه‌ی یک مکالمه، و یک سوکت «سرور» که بیشتر شبیه یک " +"اپراتور تلفن‌خانه است، تمایز قائل شویم. برنامه‌ی کلاینت (برای مثال، مرورگر " +"شما) منحصراً از سوکت‌های «کلاینت» استفاده می‌کند؛ سرور وبی که با آن گفت‌وگو " +"می‌کند، هم از سوکت‌های «سرور» و هم از سوکت‌های «کلاینت» استفاده می‌کند." msgid "History" -msgstr "" +msgstr "تاریخچه" -msgid "Of the various forms of :abbr:`IPC (Inter Process Communication)`, sockets are by far the most popular. On any given platform, there are likely to be other forms of IPC that are faster, but for cross-platform communication, sockets are about the only game in town." +msgid "" +"Of the various forms of :abbr:`IPC (Inter Process Communication)`, sockets " +"are by far the most popular. On any given platform, there are likely to be " +"other forms of IPC that are faster, but for cross-platform communication, " +"sockets are about the only game in town." msgstr "" +"از میان اشکال گوناگون :abbr:`IPC (Inter Process Communication)`، سوکت‌ها با " +"اختلاف محبوب‌ترین هستند. در هر سکوی معین، احتمال دارد اشکال دیگری از IPC " +"وجود داشته باشند که سریع‌تر باشند، اما برای ارتباط بین‌فرایندی، سوکت‌ها " +"تقریباً تنها گزینه موجود هستند." -msgid "They were invented in Berkeley as part of the BSD flavor of Unix. They spread like wildfire with the internet. With good reason --- the combination of sockets with INET makes talking to arbitrary machines around the world unbelievably easy (at least compared to other schemes)." +msgid "" +"They were invented in Berkeley as part of the BSD flavor of Unix. They " +"spread like wildfire with the internet. With good reason --- the combination" +" of sockets with INET makes talking to arbitrary machines around the world " +"unbelievably easy (at least compared to other schemes)." msgstr "" +"آن‌ها در برکلی به‌عنوان بخشی از نسخه‌ی BSD از یونیکس ابداع شدند. با اینترنت،" +" مانند آتش در علف خشک گسترش یافتند. به‌دلیل موجهی --- ترکیب سوکت‌ها با INET،" +" ارتباط با هر ماشین دلخواهی در سراسر جهان را به‌طرز باورنکردنی آسان می‌کند " +"(حداقل در مقایسه با روش‌های دیگر)." msgid "Creating a Socket" -msgstr "" +msgstr "ایجاد یک سوکت" -msgid "Roughly speaking, when you clicked on the link that brought you to this page, your browser did something like the following::" +msgid "" +"Roughly speaking, when you clicked on the link that brought you to this " +"page, your browser did something like the following::" msgstr "" +"به‌طور تقریبی، هنگامی که روی پیوندی که شما را به این صفحه آورد کلیک کردید، " +"مرورگر شما کاری مشابه زیر انجام داد::" msgid "" "# create an INET, STREAMing socket\n" @@ -69,12 +130,28 @@ msgid "" "# now connect to the web server on port 80 - the normal http port\n" "s.connect((\"www.python.org\", 80))" msgstr "" +"# ایجاد یک سوکت INET، جریانی\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# اکنون به سرور وب روی پورت ۸۰ - پورت معمول http - متصل شوید\n" +"s.connect((\"www.python.org\", 80))" -msgid "When the ``connect`` completes, the socket ``s`` can be used to send in a request for the text of the page. The same socket will read the reply, and then be destroyed. That's right, destroyed. Client sockets are normally only used for one exchange (or a small set of sequential exchanges)." +msgid "" +"When the ``connect`` completes, the socket ``s`` can be used to send in a " +"request for the text of the page. The same socket will read the reply, and " +"then be destroyed. That's right, destroyed. Client sockets are normally only" +" used for one exchange (or a small set of sequential exchanges)." msgstr "" +"هنگامی که ``connect`` کامل می‌شود، می‌توان از سوکت ``s`` برای ارسال درخواستی" +" برای متن صفحه استفاده کرد. همان سوکت پاسخ را می‌خواند و سپس نابود می‌شود. " +"درست است، نابود می‌شود. سوکت‌های کلاینت معمولاً تنها برای یک تبادل (یا " +"مجموعه کوچکی از تبادل‌های متوالی) استفاده می‌شوند." -msgid "What happens in the web server is a bit more complex. First, the web server creates a \"server socket\"::" +msgid "" +"What happens in the web server is a bit more complex. First, the web server " +"creates a \"server socket\"::" msgstr "" +"آنچه در وب‌سرور رخ می‌دهد کمی پیچیده‌تر است. ابتدا، وب‌سرور یک «سوکت سرور» " +"ایجاد می‌کند::" msgid "" "# create an INET, STREAMing socket\n" @@ -84,18 +161,53 @@ msgid "" "# become a server socket\n" "serversocket.listen(5)" msgstr "" +"# ایجاد یک سوکت INET از نوع جریانی\n" +"serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# اتصال سوکت به یک میزبان عمومی و یک پورت شناخته‌شده\n" +"serversocket.bind((socket.gethostname(), 80))\n" +"# تبدیل شدن به یک سوکت سرور\n" +"serversocket.listen(5)" -msgid "A couple things to notice: we used ``socket.gethostname()`` so that the socket would be visible to the outside world. If we had used ``s.bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would still have a \"server\" socket, but one that was only visible within the same machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any address the machine happens to have." -msgstr "" +msgid "" +"A couple things to notice: we used ``socket.gethostname()`` so that the " +"socket would be visible to the outside world. If we had used " +"``s.bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would " +"still have a \"server\" socket, but one that was only visible within the " +"same machine. ``s.bind(('', 80))`` specifies that the socket is reachable " +"by any address the machine happens to have." +msgstr "" +"چند نکته قابل توجه: ما از ``socket.gethostname()`` استفاده کردیم تا سوکت " +"برای دنیای بیرون قابل مشاهده باشد. اگر از ``s.bind(('localhost', 80))`` یا " +"``s.bind(('127.0.0.1', 80))`` استفاده کرده بودیم، همچنان یک سوکت «سرور» " +"داشتیم، اما سوکتی که فقط در همان ماشین قابل مشاهده بود. ``s.bind(('', 80))``" +" مشخص می‌کند که سوکت از طریق هر نشانی که ماشین ممکن است داشته باشد، قابل " +"دسترسی است." -msgid "A second thing to note: low number ports are usually reserved for \"well known\" services (HTTP, SNMP etc). If you're playing around, use a nice high number (4 digits)." +msgid "" +"A second thing to note: low number ports are usually reserved for \"well " +"known\" services (HTTP, SNMP etc). If you're playing around, use a nice high" +" number (4 digits)." msgstr "" +"دومین نکته: پورت‌های با شماره کم معمولاً برای سرویس‌های «شناخته‌شده» (HTTP، " +"SNMP و غیره) رزرو شده‌اند. اگر در حال آزمایش هستید، از یک شماره بالا و مناسب" +" (۴ رقمی) استفاده کنید." -msgid "Finally, the argument to ``listen`` tells the socket library that we want it to queue up as many as 5 connect requests (the normal max) before refusing outside connections. If the rest of the code is written properly, that should be plenty." +msgid "" +"Finally, the argument to ``listen`` tells the socket library that we want it" +" to queue up as many as 5 connect requests (the normal max) before refusing " +"outside connections. If the rest of the code is written properly, that " +"should be plenty." msgstr "" +"در نهایت، آرگومان ``listen`` به کتابخانه‌ی سوکت می‌گوید که ما می‌خواهیم تا ۵" +" درخواست اتصال (حداکثر معمول) را پیش از رد کردن اتصال‌های بیرونی در صف قرار " +"دهد. اگر بقیه‌ی کد به‌درستی نوشته شده باشد، این مقدار باید کافی باشد." -msgid "Now that we have a \"server\" socket, listening on port 80, we can enter the mainloop of the web server::" +msgid "" +"Now that we have a \"server\" socket, listening on port 80, we can enter the" +" mainloop of the web server::" msgstr "" +"اکنون که یک سوکت «سرور» داریم که به پورت ۸۰ گوش می‌دهد، می‌توانیم وارد حلقه‌ی" +" اصلی وب‌سرور شویم::" msgid "" "while True:\n" @@ -106,42 +218,172 @@ msgid "" " ct = make_client_thread(clientsocket)\n" " ct.start()" msgstr "" +"while True:\n" +" # accept connections from outside\n" +" (clientsocket, address) = serversocket.accept()\n" +" # now do something with the clientsocket\n" +" # in this case, we'll pretend this is a threaded server\n" +" ct = make_client_thread(clientsocket)\n" +" ct.start()" -msgid "There's actually 3 general ways in which this loop could work - dispatching a thread to handle ``clientsocket``, create a new process to handle ``clientsocket``, or restructure this app to use non-blocking sockets, and multiplex between our \"server\" socket and any active ``clientsocket``\\ s using ``select``. More about that later. The important thing to understand now is this: this is *all* a \"server\" socket does. It doesn't send any data. It doesn't receive any data. It just produces \"client\" sockets. Each ``clientsocket`` is created in response to some *other* \"client\" socket doing a ``connect()`` to the host and port we're bound to. As soon as we've created that ``clientsocket``, we go back to listening for more connections. The two \"clients\" are free to chat it up - they are using some dynamically allocated port which will be recycled when the conversation ends." -msgstr "" +msgid "" +"There's actually 3 general ways in which this loop could work - dispatching " +"a thread to handle ``clientsocket``, create a new process to handle " +"``clientsocket``, or restructure this app to use non-blocking sockets, and " +"multiplex between our \"server\" socket and any active ``clientsocket``\\ s " +"using ``select``. More about that later. The important thing to understand " +"now is this: this is *all* a \"server\" socket does. It doesn't send any " +"data. It doesn't receive any data. It just produces \"client\" sockets. Each" +" ``clientsocket`` is created in response to some *other* \"client\" socket " +"doing a ``connect()`` to the host and port we're bound to. As soon as we've " +"created that ``clientsocket``, we go back to listening for more connections." +" The two \"clients\" are free to chat it up - they are using some " +"dynamically allocated port which will be recycled when the conversation " +"ends." +msgstr "" +"در واقع این حلقه می‌تواند به ۳ روش کلی کار کند - راه‌اندازی یک نخ برای " +"رسیدگی به ``clientsocket``، ایجاد یک فرایند جدید برای رسیدگی به " +"``clientsocket``، یا تغییر ساختار این برنامه برای استفاده از سوکت‌های " +"غیرمسدودکننده و مالتی‌پلکس کردن (multiplex) بین سوکت «سرور» خودمان و هر " +"``clientsocket`` فعالی با استفاده از ``select``. بعداً درباره‌ی آن بیشتر صحبت" +" خواهیم کرد. نکته مهمی که اکنون باید درک کنید این است: این *تمام* کاری است " +"که یک سوکت «سرور» انجام می‌دهد. هیچ داده‌ای ارسال نمی‌کند. هیچ داده‌ای " +"دریافت نمی‌کند. فقط سوکت‌های «کلاینت» تولید می‌کند. هر ``clientsocket`` در " +"پاسخ به ``connect()`` کردن یک سوکت «کلاینت» *دیگر* به میزبان و پورتی که به " +"آن‌ها مقید شده‌ایم، ایجاد می‌شود. به‌محض ایجاد آن ``clientsocket``، دوباره " +"به گوش‌دادن برای اتصال‌های بیشتر بازمی‌گردیم. دو «کلاینت» آزادند با یکدیگر " +"گفتگو کنند - آن‌ها از پورتی که به‌صورت پویا تخصیص‌یافته است استفاده می‌کنند،" +" که پس از پایان گفتگو بازیافت می‌شود." msgid "IPC" -msgstr "" +msgstr "ارتباط بین‌فرایندی (IPC)" -msgid "If you need fast IPC between two processes on one machine, you should look into pipes or shared memory. If you do decide to use AF_INET sockets, bind the \"server\" socket to ``'localhost'``. On most platforms, this will take a shortcut around a couple of layers of network code and be quite a bit faster." -msgstr "" +msgid "" +"If you need fast IPC between two processes on one machine, you should look " +"into pipes or shared memory. If you do decide to use AF_INET sockets, bind " +"the \"server\" socket to ``'localhost'``. On most platforms, this will take " +"a shortcut around a couple of layers of network code and be quite a bit " +"faster." +msgstr "" +"اگر به ارتباط بین‌فرایندی (IPC) سریع بین دو پردازه روی یک ماشین نیاز دارید، " +"باید پایپ‌ها (pipes) یا حافظه مشترک را بررسی کنید. اگر تصمیم گرفتید از " +"سوکت‌های AF_INET استفاده کنید، سوکت «سرور» را به ``'localhost'`` اختصاص " +"(bind) دهید. در بیشتر پلتفرم‌ها، این کار با میان‌بر زدن چند لایه از کد شبکه،" +" به‌مراتب سریع‌تر خواهد بود." -msgid "The :mod:`multiprocessing` integrates cross-platform IPC into a higher-level API." +msgid "" +"The :mod:`multiprocessing` integrates cross-platform IPC into a higher-level" +" API." msgstr "" +":mod:`multiprocessing` ارتباط بین‌فرایندی بین‌سکویی (IPC) را در یک API سطح " +"بالاتر ادغام می‌کند." msgid "Using a Socket" -msgstr "" +msgstr "استفاده از سوکت" -msgid "The first thing to note, is that the web browser's \"client\" socket and the web server's \"client\" socket are identical beasts. That is, this is a \"peer to peer\" conversation. Or to put it another way, *as the designer, you will have to decide what the rules of etiquette are for a conversation*. Normally, the ``connect``\\ ing socket starts the conversation, by sending in a request, or perhaps a signon. But that's a design decision - it's not a rule of sockets." -msgstr "" +msgid "" +"The first thing to note, is that the web browser's \"client\" socket and the" +" web server's \"client\" socket are identical beasts. That is, this is a " +"\"peer to peer\" conversation. Or to put it another way, *as the designer, " +"you will have to decide what the rules of etiquette are for a conversation*." +" Normally, the ``connect``\\ ing socket starts the conversation, by sending " +"in a request, or perhaps a signon. But that's a design decision - it's not a" +" rule of sockets." +msgstr "" +"نخستین نکته‌ای که باید به آن توجه کنید این است که سوکت «کلاینت» مرورگر وب و " +"سوکت «کلاینت» وب‌سرور، هر دو کاملاً یکسان هستند. یعنی این یک گفت‌وگوی «همتا " +"به همتا» است. یا به بیان دیگر، *به‌عنوان طراح، شما باید تصمیم بگیرید که آداب" +" گفت‌وگو چیست*. به‌طور معمول، سوکتی که ``connect`` را فراخوانی می‌کند، " +"گفت‌وگو را با ارسال یک درخواست، یا شاید یک ورود (signon)، آغاز می‌کند. اما " +"این یک تصمیم طراحی است؛ قانون سوکت‌ها نیست." -msgid "Now there are two sets of verbs to use for communication. You can use ``send`` and ``recv``, or you can transform your client socket into a file-like beast and use ``read`` and ``write``. The latter is the way Java presents its sockets. I'm not going to talk about it here, except to warn you that you need to use ``flush`` on sockets. These are buffered \"files\", and a common mistake is to ``write`` something, and then ``read`` for a reply. Without a ``flush`` in there, you may wait forever for the reply, because the request may still be in your output buffer." -msgstr "" +msgid "" +"Now there are two sets of verbs to use for communication. You can use " +"``send`` and ``recv``, or you can transform your client socket into a file-" +"like beast and use ``read`` and ``write``. The latter is the way Java " +"presents its sockets. I'm not going to talk about it here, except to warn " +"you that you need to use ``flush`` on sockets. These are buffered \"files\"," +" and a common mistake is to ``write`` something, and then ``read`` for a " +"reply. Without a ``flush`` in there, you may wait forever for the reply, " +"because the request may still be in your output buffer." +msgstr "" +"اکنون دو مجموعه از فعل‌ها برای استفاده در ارتباط وجود دارد. شما می‌توانید از" +" ``send`` و ``recv`` استفاده کنید، یا می‌توانید سوکت کلاینت خود را به چیزی " +"شبیه فایل تبدیل کنید و از ``read`` و ``write`` استفاده کنید. روش دوم شیوه‌ای" +" است که Java سوکت‌های خود را ارائه می‌دهد. من قصد ندارم اینجا درباره آن صحبت" +" کنم، مگر برای هشدار دادن به شما که باید روی سوکت‌ها از ``flush`` استفاده " +"کنید. این‌ها «فایل‌هایی» دارای بافر هستند، و یک اشتباه رایج این است که چیزی " +"را ``write`` کنید و سپس برای دریافت پاسخ ``read`` کنید. بدون یک ``flush`` در" +" این میان، ممکن است برای همیشه منتظر پاسخ بمانید، زیرا ممکن است درخواست هنوز" +" در بافر خروجی شما باشد." -msgid "Now we come to the major stumbling block of sockets - ``send`` and ``recv`` operate on the network buffers. They do not necessarily handle all the bytes you hand them (or expect from them), because their major focus is handling the network buffers. In general, they return when the associated network buffers have been filled (``send``) or emptied (``recv``). They then tell you how many bytes they handled. It is *your* responsibility to call them again until your message has been completely dealt with." -msgstr "" +msgid "" +"Now we come to the major stumbling block of sockets - ``send`` and ``recv`` " +"operate on the network buffers. They do not necessarily handle all the bytes" +" you hand them (or expect from them), because their major focus is handling " +"the network buffers. In general, they return when the associated network " +"buffers have been filled (``send``) or emptied (``recv``). They then tell " +"you how many bytes they handled. It is *your* responsibility to call them " +"again until your message has been completely dealt with." +msgstr "" +"اکنون به مانع اصلی سوکت‌ها می‌رسیم — ``send`` و ``recv`` بر روی بافرهای " +"شبکه عمل می‌کنند. آن‌ها لزوماً همه‌ی بایت‌هایی را که به آن‌ها می‌سپارید (یا " +"از آن‌ها انتظار دارید) پردازش نمی‌کنند، زیرا تمرکز اصلی آن‌ها رسیدگی به " +"بافرهای شبکه است. به‌طور کلی، آن‌ها زمانی برمی‌گردند که بافرهای شبکه‌ی " +"مرتبط پر شده (``send``) یا خالی شده (``recv``) باشند. سپس به شما می‌گویند که" +" چند بایت را پردازش کرده‌اند. این وظیفه‌ی *شما* است که آن‌ها را دوباره " +"فراخوانی کنید تا پیام شما به‌طور کامل رسیدگی شود." -msgid "When a ``recv`` returns 0 bytes, it means the other side has closed (or is in the process of closing) the connection. You will not receive any more data on this connection. Ever. You may be able to send data successfully; I'll talk more about this later." +msgid "" +"When a ``recv`` returns 0 bytes, it means the other side has closed (or is " +"in the process of closing) the connection. You will not receive any more " +"data on this connection. Ever. You may be able to send data successfully; " +"I'll talk more about this later." msgstr "" +"وقتی ``recv`` ۰ بایت برمی‌گرداند، به این معنا است که طرف مقابل اتصال را بسته" +" است (یا در حال بستن آن است). شما دیگر هیچ داده‌ای را بر روی این اتصال " +"دریافت نخواهید کرد. هرگز. ممکن است بتوانید داده‌ها را با موفقیت ارسال کنید؛ " +"بعداً بیشتر در این مورد صحبت خواهم کرد." -msgid "A protocol like HTTP uses a socket for only one transfer. The client sends a request, then reads a reply. That's it. The socket is discarded. This means that a client can detect the end of the reply by receiving 0 bytes." +msgid "" +"A protocol like HTTP uses a socket for only one transfer. The client sends a" +" request, then reads a reply. That's it. The socket is discarded. This " +"means that a client can detect the end of the reply by receiving 0 bytes." msgstr "" +"پروتکلی مانند HTTP از یک سوکت فقط برای یک انتقال استفاده می‌کند. کلاینت " +"درخواستی ارسال می‌کند، سپس پاسخی را می‌خواند. همین کافی است. سوکت دور " +"انداخته می‌شود. این بدان معناست که یک کلاینت می‌تواند با دریافت ۰ بایت، " +"پایان پاسخ را تشخیص دهد." -msgid "But if you plan to reuse your socket for further transfers, you need to realize that *there is no* :abbr:`EOT (End of Transfer)` *on a socket.* I repeat: if a socket ``send`` or ``recv`` returns after handling 0 bytes, the connection has been broken. If the connection has *not* been broken, you may wait on a ``recv`` forever, because the socket will *not* tell you that there's nothing more to read (for now). Now if you think about that a bit, you'll come to realize a fundamental truth of sockets: *messages must either be fixed length* (yuck), *or be delimited* (shrug), *or indicate how long they are* (much better), *or end by shutting down the connection*. The choice is entirely yours, (but some ways are righter than others)." -msgstr "" +msgid "" +"But if you plan to reuse your socket for further transfers, you need to " +"realize that *there is no* :abbr:`EOT (End of Transfer)` *on a socket.* I " +"repeat: if a socket ``send`` or ``recv`` returns after handling 0 bytes, the" +" connection has been broken. If the connection has *not* been broken, you " +"may wait on a ``recv`` forever, because the socket will *not* tell you that " +"there's nothing more to read (for now). Now if you think about that a bit, " +"you'll come to realize a fundamental truth of sockets: *messages must either" +" be fixed length* (yuck), *or be delimited* (shrug), *or indicate how long " +"they are* (much better), *or end by shutting down the connection*. The " +"choice is entirely yours, (but some ways are righter than others)." +msgstr "" +"اما اگر قصد دارید از سوکت خود برای انتقال‌های بعدی دوباره استفاده کنید، باید" +" بدانید که *هیچ* :abbr:`EOT (End of Transfer)` *روی یک سوکت وجود ندارد.* " +"تکرار می‌کنم: اگر ``send`` یا ``recv`` یک سوکت پس از پردازش ۰ بایت بازگشت " +"کند، اتصال قطع شده است. اگر اتصال قطع *نشده* باشد، ممکن است برای همیشه منتظر" +" ``recv`` بمانید، زیرا سوکت به شما *نخواهد گفت* که دیگر چیزی برای خواندن " +"وجود ندارد (فعلاً). حال اگر کمی درباره آن بیندیشید، به یک حقیقت بنیادی " +"سوکت‌ها پی خواهید برد: *پیام‌ها باید یا طول ثابتی داشته باشند* (چندش‌آور)، " +"*یا جداشده باشند* (شانه بالا انداختن)، *یا طول خود را مشخص کنند* (بسیار " +"بهتر)، *یا با خاموش کردن اتصال پایان‌یابند*. انتخاب کاملاً با شماست، (اما " +"برخی روش‌ها از سایر روش‌ها درست‌تر هستند)." -msgid "Assuming you don't want to end the connection, the simplest solution is a fixed length message::" +msgid "" +"Assuming you don't want to end the connection, the simplest solution is a " +"fixed length message::" msgstr "" +"با فرض اینکه نمی‌خواهید اتصال را پایان دهید، ساده‌ترین راه‌حل، پیامی با طول " +"ثابت است::" msgid "" "class MySocket:\n" @@ -178,69 +420,296 @@ msgid "" " bytes_recd = bytes_recd + len(chunk)\n" " return b''.join(chunks)" msgstr "" +"class MySocket:\n" +" \"\"\"demonstration class only\n" +" - coded for clarity, not efficiency\n" +" \"\"\"\n" +"\n" +" def __init__(self, sock=None):\n" +" if sock is None:\n" +" self.sock = socket.socket(\n" +" socket.AF_INET, socket.SOCK_STREAM)\n" +" else:\n" +" self.sock = sock\n" +"\n" +" def connect(self, host, port):\n" +" self.sock.connect((host, port))\n" +"\n" +" def mysend(self, msg):\n" +" totalsent = 0\n" +" while totalsent < MSGLEN:\n" +" sent = self.sock.send(msg[totalsent:])\n" +" if sent == 0:\n" +" raise RuntimeError(\"socket connection broken\")\n" +" totalsent = totalsent + sent\n" +"\n" +" def myreceive(self):\n" +" chunks = []\n" +" bytes_recd = 0\n" +" while bytes_recd < MSGLEN:\n" +" chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))\n" +" if chunk == b'':\n" +" raise RuntimeError(\"socket connection broken\")\n" +" chunks.append(chunk)\n" +" bytes_recd = bytes_recd + len(chunk)\n" +" return b''.join(chunks)" -msgid "The sending code here is usable for almost any messaging scheme - in Python you send strings, and you can use ``len()`` to determine its length (even if it has embedded ``\\0`` characters). It's mostly the receiving code that gets more complex. (And in C, it's not much worse, except you can't use ``strlen`` if the message has embedded ``\\0``\\ s.)" -msgstr "" +msgid "" +"The sending code here is usable for almost any messaging scheme - in Python " +"you send strings, and you can use ``len()`` to determine its length (even if" +" it has embedded ``\\0`` characters). It's mostly the receiving code that " +"gets more complex. (And in C, it's not much worse, except you can't use " +"``strlen`` if the message has embedded ``\\0``\\ s.)" +msgstr "" +"کد ارسال در اینجا برای تقریباً هر روش پیام‌رسانی قابل استفاده است - در " +"پایتون شما رشته‌ها را ارسال می‌کنید، و می‌توانید از ``len()`` برای تعیین طول" +" آن‌ها استفاده کنید (حتی اگر دارای نویسه‌های ``\\0`` نهفته باشند). این " +"عمدتاً کد دریافت است که پیچیده‌تر می‌شود. (و در C، خیلی بدتر نیست، به جز " +"اینکه اگر پیام دارای نویسه‌های ``\\0`` نهفته باشد، نمی‌توانید از ``strlen`` " +"استفاده کنید.)" -msgid "The easiest enhancement is to make the first character of the message an indicator of message type, and have the type determine the length. Now you have two ``recv``\\ s - the first to get (at least) that first character so you can look up the length, and the second in a loop to get the rest. If you decide to go the delimited route, you'll be receiving in some arbitrary chunk size, (4096 or 8192 is frequently a good match for network buffer sizes), and scanning what you've received for a delimiter." -msgstr "" +msgid "" +"The easiest enhancement is to make the first character of the message an " +"indicator of message type, and have the type determine the length. Now you " +"have two ``recv``\\ s - the first to get (at least) that first character so " +"you can look up the length, and the second in a loop to get the rest. If you" +" decide to go the delimited route, you'll be receiving in some arbitrary " +"chunk size, (4096 or 8192 is frequently a good match for network buffer " +"sizes), and scanning what you've received for a delimiter." +msgstr "" +"ساده‌ترین بهبود این است که نخستین نویسه‌ی پیام را نشانگر نوع پیام قرار دهید،" +" و نوع، طول را تعیین کند. اکنون دو ``recv``\\ s دارید — اولی برای دریافت " +"(حداقل) همان نخستین نویسه است تا بتوانید طول را پیدا کنید، و دومی در یک حلقه" +" برای دریافت باقی‌مانده است. اگر تصمیم بگیرید از روش جداکننده‌دار استفاده " +"کنید، دریافت در اندازه‌ی تکه‌ی دلخواهی (chunk) انجام خواهد شد، (۴۰۹۶ یا ۸۱۹۲" +" اغلب تطابق خوبی با اندازه‌های بافر شبکه دارد)، و آنچه را دریافت کرده‌اید " +"برای یافتن یک جداکننده پویش خواهید کرد." -msgid "One complication to be aware of: if your conversational protocol allows multiple messages to be sent back to back (without some kind of reply), and you pass ``recv`` an arbitrary chunk size, you may end up reading the start of a following message. You'll need to put that aside and hold onto it, until it's needed." +msgid "" +"One complication to be aware of: if your conversational protocol allows " +"multiple messages to be sent back to back (without some kind of reply), and " +"you pass ``recv`` an arbitrary chunk size, you may end up reading the start " +"of a following message. You'll need to put that aside and hold onto it, " +"until it's needed." msgstr "" +"یک پیچیدگی که باید از آن آگاه باشید: اگر پروتکل گفتگویی شما اجازه دهد چندین " +"پیام به‌صورت پشت‌سرهم (بدون دریافت پاسخی) ارسال شوند و به ``recv`` یک " +"اندازه‌ی تکه‌ی دلخواه (chunk size) بدهید، ممکن است در نهایت آغاز پیام بعدی را " +"بخوانید. باید آن را کنار بگذارید و نگه دارید، تا زمانی که به آن نیاز باشد." -msgid "Prefixing the message with its length (say, as 5 numeric characters) gets more complex, because (believe it or not), you may not get all 5 characters in one ``recv``. In playing around, you'll get away with it; but in high network loads, your code will very quickly break unless you use two ``recv`` loops - the first to determine the length, the second to get the data part of the message. Nasty. This is also when you'll discover that ``send`` does not always manage to get rid of everything in one pass. And despite having read this, you will eventually get bit by it!" -msgstr "" +msgid "" +"Prefixing the message with its length (say, as 5 numeric characters) gets " +"more complex, because (believe it or not), you may not get all 5 characters " +"in one ``recv``. In playing around, you'll get away with it; but in high " +"network loads, your code will very quickly break unless you use two ``recv``" +" loops - the first to determine the length, the second to get the data part " +"of the message. Nasty. This is also when you'll discover that ``send`` does " +"not always manage to get rid of everything in one pass. And despite having " +"read this, you will eventually get bit by it!" +msgstr "" +"قرار دادن طول پیام به‌عنوان پیشوند آن (مثلاً به‌صورت ۵ نویسه عددی) پیچیده‌تر" +" می‌شود، زیرا (باور کنید یا نه)، ممکن است همه ۵ نویسه را در یک ``recv`` " +"دریافت نکنید. در آزمایش‌های ساده، ممکن است مشکلی پیش نیاید؛ اما در بارهای " +"شبکه‌ای بالا، کد شما بسیار سریع از کار می‌افتد، مگر اینکه از دو حلقه " +"``recv`` استفاده کنید: اولی برای تعیین طول و دومی برای دریافت بخش داده‌ای " +"پیام. آزاردهنده است. در همین زمان است که متوجه می‌شوید ``send`` همیشه " +"نمی‌تواند همه‌چیز را در یک مرحله ارسال کند. و با وجود خواندن این مطلب، در " +"نهایت گرفتار آن خواهید شد!" -msgid "In the interests of space, building your character, (and preserving my competitive position), these enhancements are left as an exercise for the reader. Lets move on to cleaning up." +msgid "" +"In the interests of space, building your character, (and preserving my " +"competitive position), these enhancements are left as an exercise for the " +"reader. Lets move on to cleaning up." msgstr "" +"به‌خاطر صرفه‌جویی در فضا، پرورش شخصیت شما، (و حفظ جایگاه رقابتی من)، این " +"بهبودها به‌عنوان تمرینی برای خواننده باقی گذاشته شده‌اند. بیایید به پاک‌سازی" +" بپردازیم." msgid "Binary Data" -msgstr "" +msgstr "داده‌های دودویی" -msgid "It is perfectly possible to send binary data over a socket. The major problem is that not all machines use the same formats for binary data. For example, `network byte order `_ is big-endian, with the most significant byte first, so a 16 bit integer with the value ``1`` would be the two hex bytes ``00 01``. However, most common processors (x86/AMD64, ARM, RISC-V), are little-endian, with the least significant byte first - that same ``1`` would be ``01 00``." -msgstr "" +msgid "" +"It is perfectly possible to send binary data over a socket. The major " +"problem is that not all machines use the same formats for binary data. For " +"example, `network byte order " +"`_ is big-endian, with " +"the most significant byte first, so a 16 bit integer with the value ``1`` " +"would be the two hex bytes ``00 01``. However, most common processors " +"(x86/AMD64, ARM, RISC-V), are little-endian, with the least significant byte" +" first - that same ``1`` would be ``01 00``." +msgstr "" +"ارسال داده‌های دودویی از طریق یک سوکت کاملاً ممکن است. مشکل اصلی این است که " +"همه‌ی ماشین‌ها از قالب‌های یکسانی برای داده‌های دودویی استفاده نمی‌کنند. " +"برای مثال، `ترتیب بایت شبکه " +"`_ به‌صورت بزرگ‌اندیان " +"(big-endian) است و پرارزش‌ترین بایت در ابتدا قرار می‌گیرد؛ بنابراین یک عدد " +"صحیح ۱۶ بیتی با مقدار ``1`` به‌صورت دو بایت مبنای شانزده ``00 01`` خواهد " +"بود. با این حال، بیشتر پردازنده‌های رایج (x86/AMD64، ARM، RISC-V) " +"کوچک‌اندیان (little-endian) هستند و کم‌ارزش‌ترین بایت در ابتدا قرار می‌گیرد " +"— همان ``1`` به‌صورت ``01 00`` خواهد بود." -msgid "Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, \"s\" means *short* and \"l\" means *long*. Where network order is host order, these do nothing, but where the machine is byte-reversed, these swap the bytes around appropriately." -msgstr "" +msgid "" +"Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl," +" htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " +"\"s\" means *short* and \"l\" means *long*. Where network order is host " +"order, these do nothing, but where the machine is byte-reversed, these swap " +"the bytes around appropriately." +msgstr "" +"کتابخانه‌های سوکت فراخوانی‌هایی برای تبدیل اعداد صحیح ۱۶ بیتی و ۳۲ بیتی " +"دارند - ``ntohl, htonl, ntohs, htons`` که در آن‌ها «n» به معنای *network* " +"(شبکه)، «h» به معنای *host* (میزبان)، «s» به معنای *short* (کوتاه) و «l» به " +"معنای *long* (بلند) است. هر جا که ترتیب شبکه همان ترتیب میزبان باشد، این " +"فراخوانی‌ها هیچ کاری انجام نمی‌دهند، اما هر جا که ترتیب بایت‌های ماشین معکوس" +" باشد، این فراخوانی‌ها بایت‌ها را به‌شکل مناسب جابه‌جا می‌کنند." -msgid "In these days of 64-bit machines, the ASCII representation of binary data is frequently smaller than the binary representation. That's because a surprising amount of the time, most integers have the value 0, or maybe 1. The string ``\"0\"`` would be two bytes, while a full 64-bit integer would be 8. Of course, this doesn't fit well with fixed-length messages. Decisions, decisions." -msgstr "" +msgid "" +"In these days of 64-bit machines, the ASCII representation of binary data is" +" frequently smaller than the binary representation. That's because a " +"surprising amount of the time, most integers have the value 0, or maybe 1. " +"The string ``\"0\"`` would be two bytes, while a full 64-bit integer would " +"be 8. Of course, this doesn't fit well with fixed-length messages. " +"Decisions, decisions." +msgstr "" +"در این روزگار ماشین‌های ۶۴ بیتی، نمایش ASCII داده‌های دودویی اغلب کوچک‌تر از" +" نمایش دودویی آن‌ها است. دلیلش این است که در کمال تعجب، در بیشتر مواقع، اغلب" +" اعداد صحیح مقدار ۰ دارند، یا شاید ۱. رشته‌ی ``\"0\"`` دو بایت خواهد بود، در" +" حالی که یک عدد صحیح ۶۴ بیتی کامل ۸ بایت خواهد بود. البته، این موضوع با " +"پیام‌های با طول ثابت سازگاری خوبی ندارد. تصمیم‌ها، تصمیم‌ها." msgid "Disconnecting" -msgstr "" +msgstr "قطع اتصال" -msgid "Strictly speaking, you're supposed to use ``shutdown`` on a socket before you ``close`` it. The ``shutdown`` is an advisory to the socket at the other end. Depending on the argument you pass it, it can mean \"I'm not going to send anymore, but I'll still listen\", or \"I'm not listening, good riddance!\". Most socket libraries, however, are so used to programmers neglecting to use this piece of etiquette that normally a ``close`` is the same as ``shutdown(); close()``. So in most situations, an explicit ``shutdown`` is not needed." -msgstr "" +msgid "" +"Strictly speaking, you're supposed to use ``shutdown`` on a socket before " +"you ``close`` it. The ``shutdown`` is an advisory to the socket at the " +"other end. Depending on the argument you pass it, it can mean \"I'm not " +"going to send anymore, but I'll still listen\", or \"I'm not listening, good" +" riddance!\". Most socket libraries, however, are so used to programmers " +"neglecting to use this piece of etiquette that normally a ``close`` is the " +"same as ``shutdown(); close()``. So in most situations, an explicit " +"``shutdown`` is not needed." +msgstr "" +"اگر بخواهیم دقیق باشیم، شما باید پیش از ``close`` کردن یک سوکت، از " +"``shutdown`` بر روی آن استفاده کنید. ``shutdown`` یک اعلان به سوکت سمت دیگر " +"است. بسته به آرگومانی که به آن می‌دهید، می‌تواند به معنای «دیگر چیزی ارسال " +"نخواهم کرد، اما همچنان گوش می‌دهم» یا «دیگر گوش نمی‌دهم، راحت شدم!» باشد. با" +" این حال، بیشتر کتابخانه‌های سوکت چنان به غفلت برنامه‌نویسان از رعایت این " +"آداب عادت کرده‌اند که معمولاً ``close`` همان ``shutdown(); close()`` است. " +"بنابراین در بیشتر موارد، به ``shutdown`` صریح نیازی نیست." -msgid "One way to use ``shutdown`` effectively is in an HTTP-like exchange. The client sends a request and then does a ``shutdown(1)``. This tells the server \"This client is done sending, but can still receive.\" The server can detect \"EOF\" by a receive of 0 bytes. It can assume it has the complete request. The server sends a reply. If the ``send`` completes successfully then, indeed, the client was still receiving." -msgstr "" +msgid "" +"One way to use ``shutdown`` effectively is in an HTTP-like exchange. The " +"client sends a request and then does a ``shutdown(1)``. This tells the " +"server \"This client is done sending, but can still receive.\" The server " +"can detect \"EOF\" by a receive of 0 bytes. It can assume it has the " +"complete request. The server sends a reply. If the ``send`` completes " +"successfully then, indeed, the client was still receiving." +msgstr "" +"یکی از راه‌های استفاده‌ی مؤثر از ``shutdown``، در یک تبادل شبیه به HTTP است." +" کلاینت درخواستی ارسال می‌کند و سپس ``shutdown(1)`` را فراخوانی می‌کند. این " +"کار به سرور می‌گوید: «این کلاینت ارسال را به پایان رسانده است، اما هنوز " +"می‌تواند دریافت کند.» سرور می‌تواند با دریافت ۰ بایت، «EOF» را تشخیص دهد. " +"می‌تواند فرض کند که درخواست کامل را دریافت کرده است. سرور پاسخی می‌فرستد. " +"اگر ``send`` با موفقیت کامل شود، در واقع کلاینت هنوز در حال دریافت بوده است." -msgid "Python takes the automatic shutdown a step further, and says that when a socket is garbage collected, it will automatically do a ``close`` if it's needed. But relying on this is a very bad habit. If your socket just disappears without doing a ``close``, the socket at the other end may hang indefinitely, thinking you're just being slow. *Please* ``close`` your sockets when you're done." -msgstr "" +msgid "" +"Python takes the automatic shutdown a step further, and says that when a " +"socket is garbage collected, it will automatically do a ``close`` if it's " +"needed. But relying on this is a very bad habit. If your socket just " +"disappears without doing a ``close``, the socket at the other end may hang " +"indefinitely, thinking you're just being slow. *Please* ``close`` your " +"sockets when you're done." +msgstr "" +"پایتون خاموش شدن خودکار را یک گام فراتر می‌برد و می‌گوید که وقتی یک سوکت " +"زباله‌روبی می‌شود، در صورت نیاز به‌طور خودکار ``close`` را انجام می‌دهد. اما" +" اتکا به این موضوع عادت بسیار بدی است. اگر سوکت شما بدون انجام ``close`` " +"صرفاً ناپدید شود، سوکت سمت مقابل ممکن است به‌طور نامعلومی معلق بماند، به این" +" گمان که شما صرفاً کند هستید. *لطفاً* پس از اتمام کار، سوکت‌های خود را " +"``close`` کنید." msgid "When Sockets Die" -msgstr "" +msgstr "هنگامی که سوکت‌ها می‌میرند" -msgid "Probably the worst thing about using blocking sockets is what happens when the other side comes down hard (without doing a ``close``). Your socket is likely to hang. TCP is a reliable protocol, and it will wait a long, long time before giving up on a connection. If you're using threads, the entire thread is essentially dead. There's not much you can do about it. As long as you aren't doing something dumb, like holding a lock while doing a blocking read, the thread isn't really consuming much in the way of resources. Do *not* try to kill the thread - part of the reason that threads are more efficient than processes is that they avoid the overhead associated with the automatic recycling of resources. In other words, if you do manage to kill the thread, your whole process is likely to be screwed up." -msgstr "" +msgid "" +"Probably the worst thing about using blocking sockets is what happens when " +"the other side comes down hard (without doing a ``close``). Your socket is " +"likely to hang. TCP is a reliable protocol, and it will wait a long, long " +"time before giving up on a connection. If you're using threads, the entire " +"thread is essentially dead. There's not much you can do about it. As long as" +" you aren't doing something dumb, like holding a lock while doing a blocking" +" read, the thread isn't really consuming much in the way of resources. Do " +"*not* try to kill the thread - part of the reason that threads are more " +"efficient than processes is that they avoid the overhead associated with the" +" automatic recycling of resources. In other words, if you do manage to kill " +"the thread, your whole process is likely to be screwed up." +msgstr "" +"احتمالاً بدترین نکته در استفاده از سوکت‌های مسدودکننده همان چیزی است که وقتی" +" طرف مقابل به‌طور ناگهانی از کار می‌افتد (بدون انجام یک ``close``) رخ " +"می‌دهد. به‌احتمال زیاد سوکت شما آویزان می‌شود. TCP پروتکلی قابل‌اعتماد است و" +" مدت بسیار، بسیار طولانی منتظر می‌ماند تا از یک اتصال دست بکشد. اگر از نخ‌ها" +" استفاده می‌کنید، آن نخ عملاً به‌طور کامل مرده است. کار زیادی از دست شما " +"برنمی‌آید. تا زمانی که کار احمقانه‌ای مانند نگه‌داشتن یک قفل هنگام انجام یک " +"خواندن مسدودکننده انجام نمی‌دهید، نخ واقعاً منابع زیادی مصرف نمی‌کند. سعی " +"*نکنید* نخ را بکشید — بخشی از دلیل کارآمدتر بودن نخ‌ها نسبت به فرایندها این" +" است که آن‌ها از سربار مرتبط با بازیافت خودکار منابع اجتناب می‌کنند. به " +"عبارت دیگر، اگر واقعاً موفق به کشتن نخ شوید، احتمالاً کل فرایند شما دچار " +"مشکل جدی می‌شود." msgid "Non-blocking Sockets" -msgstr "" +msgstr "سوکت‌های غیرمسدودکننده" -msgid "If you've understood the preceding, you already know most of what you need to know about the mechanics of using sockets. You'll still use the same calls, in much the same ways. It's just that, if you do it right, your app will be almost inside-out." +msgid "" +"If you've understood the preceding, you already know most of what you need " +"to know about the mechanics of using sockets. You'll still use the same " +"calls, in much the same ways. It's just that, if you do it right, your app " +"will be almost inside-out." msgstr "" +"اگر مطالب پیشین را درک کرده باشید، از پیش بیشترِ آنچه را که باید درباره‌ی " +"سازوکار استفاده از سوکت‌ها بدانید، می‌دانید. شما همچنان از همان فراخوانی‌ها،" +" به تقریباً همان شیوه‌ها استفاده خواهید کرد. فقط این است که اگر این کار را " +"درست انجام دهید، برنامه‌ی شما تقریباً وارونه خواهد شد." -msgid "In Python, you use ``socket.setblocking(False)`` to make it non-blocking. In C, it's more complex, (for one thing, you'll need to choose between the BSD flavor ``O_NONBLOCK`` and the almost indistinguishable POSIX flavor ``O_NDELAY``, which is completely different from ``TCP_NODELAY``), but it's the exact same idea. You do this after creating the socket, but before using it. (Actually, if you're nuts, you can switch back and forth.)" -msgstr "" +msgid "" +"In Python, you use ``socket.setblocking(False)`` to make it non-blocking. In" +" C, it's more complex, (for one thing, you'll need to choose between the BSD" +" flavor ``O_NONBLOCK`` and the almost indistinguishable POSIX flavor " +"``O_NDELAY``, which is completely different from ``TCP_NODELAY``), but it's " +"the exact same idea. You do this after creating the socket, but before using" +" it. (Actually, if you're nuts, you can switch back and forth.)" +msgstr "" +"در پایتون، برای غیرمسدود کردن آن از ``socket.setblocking(False)`` استفاده " +"می‌کنید. در C، این کار پیچیده‌تر است، (برای مثال، باید بین نوع BSD یعنی " +"``O_NONBLOCK`` و نوع POSIX یعنی ``O_NDELAY`` که تقریباً غیرقابل‌تشخیص است و " +"کاملاً با ``TCP_NODELAY`` تفاوت دارد، یکی را انتخاب کنید)، اما ایده دقیقاً " +"همان است. شما این کار را پس از ایجاد سوکت، اما پیش از استفاده از آن انجام " +"می‌دهید. (البته اگر دیوانه باشید، می‌توانید بین این دو حالت جابه‌جا شوید.)" -msgid "The major mechanical difference is that ``send``, ``recv``, ``connect`` and ``accept`` can return without having done anything. You have (of course) a number of choices. You can check return code and error codes and generally drive yourself crazy. If you don't believe me, try it sometime. Your app will grow large, buggy and suck CPU. So let's skip the brain-dead solutions and do it right." -msgstr "" +msgid "" +"The major mechanical difference is that ``send``, ``recv``, ``connect`` and " +"``accept`` can return without having done anything. You have (of course) a " +"number of choices. You can check return code and error codes and generally " +"drive yourself crazy. If you don't believe me, try it sometime. Your app " +"will grow large, buggy and suck CPU. So let's skip the brain-dead solutions " +"and do it right." +msgstr "" +"تفاوت سازوکاری اصلی این است که ``send``، ``recv``، ``connect`` و ``accept`` " +"می‌توانند بدون اینکه کاری انجام داده باشند، بازگردند. شما (البته) گزینه‌های " +"متعددی دارید. می‌توانید کد بازگشتی و کدهای خطا را بررسی کنید و به‌طور کلی " +"خود را دیوانه کنید. اگر باور نمی‌کنید، گاهی آن را امتحان کنید. برنامه‌تان " +"بزرگ و پر از اشکال خواهد شد و منابع پردازنده را به‌شدت مصرف خواهد کرد. پس " +"بیایید راه‌حل‌های نابخردانه را کنار بگذاریم و کار را درست انجام دهیم." msgid "Use ``select``." -msgstr "" +msgstr "از ``select`` استفاده کنید." -msgid "In C, coding ``select`` is fairly complex. In Python, it's a piece of cake, but it's close enough to the C version that if you understand ``select`` in Python, you'll have little trouble with it in C::" +msgid "" +"In C, coding ``select`` is fairly complex. In Python, it's a piece of cake, " +"but it's close enough to the C version that if you understand ``select`` in " +"Python, you'll have little trouble with it in C::" msgstr "" +"در C، کدنویسی ``select`` نسبتاً پیچیده است. در پایتون، این کار بسیار آسان " +"است، اما به اندازه کافی به نسخه C نزدیک است که اگر ``select`` را در پایتون " +"درک کنید، در C با مشکل چندانی مواجه نخواهید شد::" msgid "" "ready_to_read, ready_to_write, in_error = \\\n" @@ -250,21 +719,93 @@ msgid "" " potential_errs,\n" " timeout)" msgstr "" +"ready_to_read, ready_to_write, in_error = \\\n" +" select.select(\n" +" potential_readers,\n" +" potential_writers,\n" +" potential_errs,\n" +" timeout)" -msgid "You pass ``select`` three lists: the first contains all sockets that you might want to try reading; the second all the sockets you might want to try writing to, and the last (normally left empty) those that you want to check for errors. You should note that a socket can go into more than one list. The ``select`` call is blocking, but you can give it a timeout. This is generally a sensible thing to do - give it a nice long timeout (say a minute) unless you have good reason to do otherwise." -msgstr "" +msgid "" +"You pass ``select`` three lists: the first contains all sockets that you " +"might want to try reading; the second all the sockets you might want to try " +"writing to, and the last (normally left empty) those that you want to check " +"for errors. You should note that a socket can go into more than one list. " +"The ``select`` call is blocking, but you can give it a timeout. This is " +"generally a sensible thing to do - give it a nice long timeout (say a " +"minute) unless you have good reason to do otherwise." +msgstr "" +"شما به ``select`` سه فهرست می‌دهید: اولی شامل همه سوکت‌هایی است که ممکن است " +"بخواهید خواندن از آن‌ها را امتحان کنید؛ دومی شامل همه سوکت‌هایی است که ممکن " +"است بخواهید نوشتن به آن‌ها را امتحان کنید، و سومی (که معمولاً خالی گذاشته " +"می‌شود) شامل سوکت‌هایی است که می‌خواهید آن‌ها را از نظر خطاها بررسی کنید. " +"باید توجه داشته باشید که یک سوکت می‌تواند در بیش از یک فهرست قرار بگیرد. " +"فراخوانی ``select`` مسدودکننده است، اما می‌توانید برای آن یک مهلت تعیین " +"کنید. این کار معمولاً عاقلانه‌ای است — مگر اینکه دلیل خوبی برای انجام خلاف " +"این کار داشته باشید، یک مهلت طولانی و مناسب برای آن تعیین کنید (مثلاً یک " +"دقیقه)." -msgid "In return, you will get three lists. They contain the sockets that are actually readable, writable and in error. Each of these lists is a subset (possibly empty) of the corresponding list you passed in." +msgid "" +"In return, you will get three lists. They contain the sockets that are " +"actually readable, writable and in error. Each of these lists is a subset " +"(possibly empty) of the corresponding list you passed in." msgstr "" +"در ازای آن، سه فهرست دریافت خواهید کرد. این فهرست‌ها شامل سوکت‌هایی هستند که" +" در واقع قابل‌خواندن، قابل‌نوشتن و دارای خطا هستند. هر یک از این فهرست‌ها " +"زیرمجموعه‌ای (احتمالاً خالی) از فهرست متناظری است که شما به‌عنوان ورودی " +"داده‌اید." -msgid "If a socket is in the output readable list, you can be as-close-to-certain-as-we-ever-get-in-this-business that a ``recv`` on that socket will return *something*. Same idea for the writable list. You'll be able to send *something*. Maybe not all you want to, but *something* is better than nothing. (Actually, any reasonably healthy socket will return as writable - it just means outbound network buffer space is available.)" -msgstr "" +msgid "" +"If a socket is in the output readable list, you can be as-close-to-certain-" +"as-we-ever-get-in-this-business that a ``recv`` on that socket will return " +"*something*. Same idea for the writable list. You'll be able to send " +"*something*. Maybe not all you want to, but *something* is better than " +"nothing. (Actually, any reasonably healthy socket will return as writable -" +" it just means outbound network buffer space is available.)" +msgstr "" +"اگر یک سوکت در فهرست خروجی خواندنی باشد، می‌توانید تا حدی که در این کار ممکن" +" است مطمئن باشید که یک ``recv`` روی آن سوکت *چیزی* را برمی‌گرداند. همین " +"مفهوم برای فهرست نوشتنی نیز صادق است. شما می‌توانید *چیزی* ارسال کنید. شاید " +"نه همه‌ی آن چیزی که می‌خواهید، اما *چیزی* بهتر از هیچ است. (در واقع، هر سوکت " +"نسبتاً سالمی به‌عنوان نوشتنی بازگردانده می‌شود؛ این صرفاً به این معناست که " +"فضای بافر شبکه‌ی خروجی در دسترس است.)" -msgid "If you have a \"server\" socket, put it in the potential_readers list. If it comes out in the readable list, your ``accept`` will (almost certainly) work. If you have created a new socket to ``connect`` to someone else, put it in the potential_writers list. If it shows up in the writable list, you have a decent chance that it has connected." -msgstr "" +msgid "" +"If you have a \"server\" socket, put it in the potential_readers list. If it" +" comes out in the readable list, your ``accept`` will (almost certainly) " +"work. If you have created a new socket to ``connect`` to someone else, put " +"it in the potential_writers list. If it shows up in the writable list, you " +"have a decent chance that it has connected." +msgstr "" +"اگر یک سوکت «سرور» دارید، آن را در فهرست potential_readers قرار دهید. اگر در" +" فهرست readable ظاهر شود، ``accept`` شما (تقریباً به‌طور قطع) کار خواهد کرد." +" اگر یک سوکت جدید برای ``connect`` به طرف دیگر ایجاد کرده‌اید، آن را در " +"فهرست potential_writers قرار دهید. اگر در فهرست writable ظاهر شود، احتمال " +"مناسبی وجود دارد که متصل شده باشد." -msgid "Actually, ``select`` can be handy even with blocking sockets. It's one way of determining whether you will block - the socket returns as readable when there's something in the buffers. However, this still doesn't help with the problem of determining whether the other end is done, or just busy with something else." -msgstr "" +msgid "" +"Actually, ``select`` can be handy even with blocking sockets. It's one way " +"of determining whether you will block - the socket returns as readable when " +"there's something in the buffers. However, this still doesn't help with the" +" problem of determining whether the other end is done, or just busy with " +"something else." +msgstr "" +"در واقع، ``select`` حتی با سوکت‌های مسدودکننده هم می‌تواند مفید باشد. این " +"یکی از راه‌های تعیین این است که آیا مسدود خواهید شد یا خیر؛ هنگامی که چیزی " +"در بافرها وجود دارد، سوکت به‌عنوان قابل‌خواندن بازگردانده می‌شود. با این " +"حال، این هنوز به مسئله‌ی تعیین اینکه آیا طرف مقابل کار را تمام کرده است یا " +"صرفاً مشغول کار دیگری است، کمکی نمی‌کند." -msgid "**Portability alert**: On Unix, ``select`` works both with the sockets and files. Don't try this on Windows. On Windows, ``select`` works with sockets only. Also note that in C, many of the more advanced socket options are done differently on Windows. In fact, on Windows I usually use threads (which work very, very well) with my sockets." -msgstr "" +msgid "" +"**Portability alert**: On Unix, ``select`` works both with the sockets and " +"files. Don't try this on Windows. On Windows, ``select`` works with sockets " +"only. Also note that in C, many of the more advanced socket options are done" +" differently on Windows. In fact, on Windows I usually use threads (which " +"work very, very well) with my sockets." +msgstr "" +"**هشدار قابلیت حمل**: در یونیکس، ``select`` هم با سوکت‌ها و هم با فایل‌ها " +"کار می‌کند. این کار را در ویندوز امتحان نکنید. در ویندوز، ``select`` فقط با " +"سوکت‌ها کار می‌کند. همچنین توجه داشته باشید که در C، بسیاری از گزینه‌های " +"پیشرفته‌تر سوکت در ویندوز به شکل متفاوتی انجام می‌شوند. در واقع، در ویندوز " +"من معمولاً از نخ‌ها (که بسیار، بسیار خوب کار می‌کنند) همراه با سوکت‌هایم " +"استفاده می‌کنم." diff --git a/howto/sorting.po b/howto/sorting.po index e2137d947..7aab830a0 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -25,33 +25,57 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Sorting Techniques" -msgstr "" +msgstr "روش‌های مرتب‌سازی" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "Andrew Dalke and Raymond Hettinger" -msgstr "" +msgstr "Andrew Dalke و Raymond Hettinger" -msgid "Python lists have a built-in :meth:`list.sort` method that modifies the list in-place. There is also a :func:`sorted` built-in function that builds a new sorted list from an iterable." +msgid "" +"Python lists have a built-in :meth:`list.sort` method that modifies the list" +" in-place. There is also a :func:`sorted` built-in function that builds a " +"new sorted list from an iterable." msgstr "" +"فهرست‌های پایتون یک متد توکار :meth:`list.sort` دارند که فهرست را به‌صورت " +"درجا تغییر می‌دهد. همچنین یک تابع توکار :func:`sorted` وجود دارد که یک فهرست" +" مرتب‌شده‌ی جدید از یک پیمایش‌پذیر می‌سازد." -msgid "In this document, we explore the various techniques for sorting data using Python." +msgid "" +"In this document, we explore the various techniques for sorting data using " +"Python." msgstr "" +"در این سند، روش‌های مختلف مرتب‌سازی داده‌ها با استفاده از پایتون را بررسی " +"می‌کنیم." msgid "Sorting Basics" -msgstr "" +msgstr "مبانی مرتب‌سازی" -msgid "A simple ascending sort is very easy: just call the :func:`sorted` function. It returns a new sorted list:" +msgid "" +"A simple ascending sort is very easy: just call the :func:`sorted` function." +" It returns a new sorted list:" msgstr "" +"یک مرتب‌سازی صعودی ساده بسیار آسان است: کافی است تابع :func:`sorted` را " +"فراخوانی کنید. این تابع یک فهرست مرتب‌شده‌ی جدید برمی‌گرداند:" msgid "" ">>> sorted([5, 2, 3, 1, 4])\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> sorted([5, 2, 3, 1, 4])\n" +"[1, 2, 3, 4, 5]" -msgid "You can also use the :meth:`list.sort` method. It modifies the list in-place (and returns ``None`` to avoid confusion). Usually it's less convenient than :func:`sorted` - but if you don't need the original list, it's slightly more efficient." +msgid "" +"You can also use the :meth:`list.sort` method. It modifies the list in-place" +" (and returns ``None`` to avoid confusion). Usually it's less convenient " +"than :func:`sorted` - but if you don't need the original list, it's slightly" +" more efficient." msgstr "" +"همچنین می‌توانید از متد :meth:`list.sort` استفاده کنید. این متد فهرست را " +"به‌صورت درجا تغییر می‌دهد (و برای جلوگیری از سردرگمی، ``None`` را " +"برمی‌گرداند). معمولاً به اندازه :func:`sorted` راحت نیست، اما اگر نیازی به " +"فهرست اصلی ندارید، کمی کارآمدتر است." msgid "" ">>> a = [5, 2, 3, 1, 4]\n" @@ -59,34 +83,69 @@ msgid "" ">>> a\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> a = [5, 2, 3, 1, 4]\n" +">>> a.sort()\n" +">>> a\n" +"[1, 2, 3, 4, 5]" -msgid "Another difference is that the :meth:`list.sort` method is only defined for lists. In contrast, the :func:`sorted` function accepts any iterable." +msgid "" +"Another difference is that the :meth:`list.sort` method is only defined for " +"lists. In contrast, the :func:`sorted` function accepts any iterable." msgstr "" +"تفاوت دیگر این است که متد :meth:`list.sort` فقط برای فهرست‌ها تعریف شده است." +" در مقابل، تابع :func:`sorted` هر پیمایش‌پذیری را می‌پذیرد." msgid "" ">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" "[1, 2, 3, 4, 5]" msgstr "" +">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" +"[1, 2, 3, 4, 5]" msgid "Key Functions" -msgstr "" +msgstr "توابع کلیدی" -msgid "The :meth:`list.sort` method and the functions :func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nsmallest`, and :func:`heapq.nlargest` have a *key* parameter to specify a function (or other callable) to be called on each list element prior to making comparisons." +msgid "" +"The :meth:`list.sort` method and the functions :func:`sorted`, :func:`min`, " +":func:`max`, :func:`heapq.nsmallest`, and :func:`heapq.nlargest` have a " +"*key* parameter to specify a function (or other callable) to be called on " +"each list element prior to making comparisons." msgstr "" +"متد :meth:`list.sort` و توابع :func:`sorted`، :func:`min`، :func:`max`، " +":func:`heapq.nsmallest` و :func:`heapq.nlargest` یک پارامتر *key* دارند که " +"برای مشخص کردن تابعی (یا شیء قابل فراخوانی دیگر) به کار می‌رود تا پیش از " +"انجام مقایسه‌ها روی هر عنصر فهرست فراخوانی شود." -msgid "For example, here's a case-insensitive string comparison using :meth:`str.casefold`:" +msgid "" +"For example, here's a case-insensitive string comparison using " +":meth:`str.casefold`:" msgstr "" +"برای مثال، در اینجا یک مقایسه‌ی رشته‌ای بدون حساسیت به بزرگی و کوچکی حروف با " +"استفاده از :meth:`str.casefold` آمده است:" msgid "" ">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" "['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" msgstr "" +">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" +"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" -msgid "The value of the *key* parameter should be a function (or other callable) that takes a single argument and returns a key to use for sorting purposes. This technique is fast because the key function is called exactly once for each input record." +msgid "" +"The value of the *key* parameter should be a function (or other callable) " +"that takes a single argument and returns a key to use for sorting purposes. " +"This technique is fast because the key function is called exactly once for " +"each input record." msgstr "" +"مقدار پارامتر *key* باید تابعی (یا یک شیء فراخوان‌پذیر دیگر) باشد که یک " +"آرگومان می‌گیرد و کلیدی برای استفاده در مرتب‌سازی برمی‌گرداند. این روش سریع " +"است زیرا تابع کلید دقیقاً یک بار برای هر رکورد ورودی فراخوانی می‌شود." -msgid "A common pattern is to sort complex objects using some of the object's indices as keys. For example:" +msgid "" +"A common pattern is to sort complex objects using some of the object's " +"indices as keys. For example:" msgstr "" +"یک الگوی رایج، مرتب‌سازی اشیاء پیچیده با استفاده از برخی از اندیس‌های شیء " +"به‌عنوان کلید است. برای مثال:" msgid "" ">>> student_tuples = [\n" @@ -97,9 +156,18 @@ msgid "" ">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> student_tuples = [\n" +"... ('john', 'A', 15),\n" +"... ('jane', 'B', 12),\n" +"... ('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "The same technique works for objects with named attributes. For example:" +msgid "" +"The same technique works for objects with named attributes. For example:" msgstr "" +"همین روش برای اشیاء دارای ویژگی‌های نام‌دار نیز کار می‌کند. برای مثال:" msgid "" ">>> class Student:\n" @@ -118,18 +186,48 @@ msgid "" ">>> sorted(student_objects, key=lambda student: student.age) # sort by age\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> class Student:\n" +"... def __init__(self, name, grade, age):\n" +"... self.name = name\n" +"... self.grade = grade\n" +"... self.age = age\n" +"... def __repr__(self):\n" +"... return repr((self.name, self.grade, self.age))\n" +"\n" +">>> student_objects = [\n" +"... Student('john', 'A', 15),\n" +"... Student('jane', 'B', 12),\n" +"... Student('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_objects, key=lambda student: student.age) # sort by age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "Objects with named attributes can be made by a regular class as shown above, or they can be instances of :class:`~dataclasses.dataclass` or a :term:`named tuple`." +msgid "" +"Objects with named attributes can be made by a regular class as shown above," +" or they can be instances of :class:`~dataclasses.dataclass` or a " +":term:`named tuple`." msgstr "" +"اشیاء دارای ویژگی‌های نام‌دار می‌توانند با یک کلاس معمولی، همان‌طور که در " +"بالا نشان داده شد، ساخته شوند، یا می‌توانند نمونه‌هایی از " +":class:`~dataclasses.dataclass` یا یک :term:`named tuple` باشند." msgid "Operator Module Functions and Partial Function Evaluation" -msgstr "" +msgstr "توابع ماژول operator و ارزیابی جزئی تابع" -msgid "The :term:`key function` patterns shown above are very common, so Python provides convenience functions to make accessor functions easier and faster. The :mod:`operator` module has :func:`~operator.itemgetter`, :func:`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." +msgid "" +"The :term:`key function` patterns shown above are very common, so Python " +"provides convenience functions to make accessor functions easier and faster." +" The :mod:`operator` module has :func:`~operator.itemgetter`, " +":func:`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" +"الگوهای :term:`تابع کلید ` نشان‌داده‌شده در بالا بسیار رایج " +"هستند، بنابراین پایتون توابع کمکی برای ساده‌تر و سریع‌تر کردن توابع دسترسی " +"فراهم می‌کند. ماژول :mod:`operator` دارای توابع " +":func:`~operator.itemgetter`، :func:`~operator.attrgetter` و " +":func:`~operator.methodcaller` است." msgid "Using those functions, the above examples become simpler and faster:" -msgstr "" +msgstr "با استفاده از آن توابع، مثال‌های بالا ساده‌تر و سریع‌تر می‌شوند:" msgid "" ">>> from operator import itemgetter, attrgetter\n" @@ -140,9 +238,20 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('age'))\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> from operator import itemgetter, attrgetter\n" +"\n" +">>> sorted(student_tuples, key=itemgetter(2))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "The operator module functions allow multiple levels of sorting. For example, to sort by *grade* then by *age*:" +msgid "" +"The operator module functions allow multiple levels of sorting. For example," +" to sort by *grade* then by *age*:" msgstr "" +"توابع ماژول operator امکان مرتب‌سازی در چند سطح را فراهم می‌کنند. برای مثال،" +" برای مرتب‌سازی بر اساس *grade* و سپس بر اساس *age*:" msgid "" ">>> sorted(student_tuples, key=itemgetter(1,2))\n" @@ -151,9 +260,22 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" "[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" msgstr "" +">>> sorted(student_tuples, key=itemgetter(1,2))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" -msgid "The :mod:`functools` module provides another helpful tool for making key-functions. The :func:`~functools.partial` function can reduce the `arity `_ of a multi-argument function making it suitable for use as a key-function." +msgid "" +"The :mod:`functools` module provides another helpful tool for making key-" +"functions. The :func:`~functools.partial` function can reduce the `arity " +"`_ of a multi-argument function making " +"it suitable for use as a key-function." msgstr "" +"ماژول :mod:`functools` ابزار مفید دیگری برای ساخت تابع‌های کلید فراهم " +"می‌کند. تابع :func:`~functools.partial` می‌تواند `تعداد آرگومان‌ها (arity) " +"`_ یک تابع با چند آرگومان را کاهش دهد و" +" آن را برای استفاده به‌عنوان یک تابع کلید مناسب کند." msgid "" ">>> from functools import partial\n" @@ -167,12 +289,28 @@ msgid "" ">>> sorted(names, key=partial(normalize, 'NFC'))\n" "['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" msgstr "" +">>> from functools import partial\n" +">>> from unicodedata import normalize\n" +"\n" +">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFD'))\n" +"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFC'))\n" +"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" msgid "Ascending and Descending" -msgstr "" +msgstr "صعودی و نزولی" -msgid "Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with a boolean value. This is used to flag descending sorts. For example, to get the student data in reverse *age* order:" +msgid "" +"Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with " +"a boolean value. This is used to flag descending sorts. For example, to get " +"the student data in reverse *age* order:" msgstr "" +"هر دو :meth:`list.sort` و :func:`sorted` یک پارامتر *reverse* با مقدار بولی " +"می‌پذیرند. این برای مشخص کردن مرتب‌سازی نزولی استفاده می‌شود. برای مثال، " +"برای دریافت داده‌های دانشجویی به ترتیب معکوس *سن*:" msgid "" ">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" @@ -181,33 +319,68 @@ msgid "" ">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" "[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" msgstr "" +">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" msgid "Sort Stability and Complex Sorts" -msgstr "" +msgstr "پایداری مرتب‌سازی و مرتب‌سازی‌های پیچیده" -msgid "Sorts are guaranteed to be `stable `_\\. That means that when multiple records have the same key, their original order is preserved." +msgid "" +"Sorts are guaranteed to be `stable " +"`_\\. That means " +"that when multiple records have the same key, their original order is " +"preserved." msgstr "" +"تضمین می‌شود که مرتب‌سازی‌ها `پایدار " +"`_ باشند. این " +"بدان معناست که هنگامی که چندین رکورد کلید یکسانی دارند، ترتیب اصلی آن‌ها حفظ" +" می‌شود." msgid "" ">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" ">>> sorted(data, key=itemgetter(0))\n" "[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" msgstr "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> sorted(data, key=itemgetter(0))\n" +"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" -msgid "Notice how the two records for *blue* retain their original order so that ``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." +msgid "" +"Notice how the two records for *blue* retain their original order so that " +"``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." msgstr "" +"توجه کنید که چگونه دو رکورد برای *blue* ترتیب اصلی خود را حفظ می‌کنند، " +"به‌طوری که تضمین می‌شود ``('blue', 1)`` پیش از ``('blue', 2)`` قرار دارد." -msgid "This wonderful property lets you build complex sorts in a series of sorting steps. For example, to sort the student data by descending *grade* and then ascending *age*, do the *age* sort first and then sort again using *grade*:" +msgid "" +"This wonderful property lets you build complex sorts in a series of sorting " +"steps. For example, to sort the student data by descending *grade* and then " +"ascending *age*, do the *age* sort first and then sort again using *grade*:" msgstr "" +"این ویژگی فوق‌العاده به شما امکان می‌دهد مرتب‌سازی‌های پیچیده را در " +"مجموعه‌ای از گام‌های مرتب‌سازی ایجاد کنید. برای مثال، برای مرتب‌سازی " +"داده‌های دانش‌آموز بر اساس *نمره* به‌صورت نزولی و سپس *سن* به‌صورت صعودی، " +"ابتدا مرتب‌سازی بر اساس *سن* را انجام دهید و سپس دوباره با استفاده از *نمره*" +" مرتب کنید:" msgid "" ">>> s = sorted(student_objects, key=attrgetter('age')) # sort on secondary key\n" ">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> s = sorted(student_objects, key=attrgetter('age')) # sort on secondary key\n" +">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on primary key, descending\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "This can be abstracted out into a wrapper function that can take a list and tuples of field and order to sort them on multiple passes." +msgid "" +"This can be abstracted out into a wrapper function that can take a list and " +"tuples of field and order to sort them on multiple passes." msgstr "" +"این را می‌توان به‌صورت یک تابع پوششی انتزاع کرد که بتواند یک فهرست و " +"تاپل‌هایی از فیلد و ترتیب را برای مرتب‌سازی آن‌ها در چندین گذر دریافت کند." msgid "" ">>> def multisort(xs, specs):\n" @@ -218,27 +391,53 @@ msgid "" ">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> def multisort(xs, specs):\n" +"... for key, reverse in reversed(specs):\n" +"... xs.sort(key=attrgetter(key), reverse=reverse)\n" +"... return xs\n" +"\n" +">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "The `Timsort `_ algorithm used in Python does multiple sorts efficiently because it can take advantage of any ordering already present in a dataset." +msgid "" +"The `Timsort `_ algorithm used in " +"Python does multiple sorts efficiently because it can take advantage of any " +"ordering already present in a dataset." msgstr "" +"الگوریتم `Timsort `_ به‌کاررفته در " +"پایتون، مرتب‌سازی‌های متعدد را به‌طور کارآمد انجام می‌دهد، زیرا می‌تواند از " +"هرگونه ترتیب از پیش موجود در یک مجموعه داده بهره ببرد." msgid "Decorate-Sort-Undecorate" -msgstr "" +msgstr "آرایش-مرتب‌سازی-ناآرایش (Decorate-Sort-Undecorate)" msgid "This idiom is called Decorate-Sort-Undecorate after its three steps:" msgstr "" +"این اصطلاح به نام Decorate-Sort-Undecorate نامیده می‌شود که برگرفته از سه " +"مرحله‌ی آن است:" -msgid "First, the initial list is decorated with new values that control the sort order." +msgid "" +"First, the initial list is decorated with new values that control the sort " +"order." msgstr "" +"ابتدا، فهرست اولیه با مقادیر جدیدی که ترتیب مرتب‌سازی را کنترل می‌کنند، " +"آراسته می‌شود." msgid "Second, the decorated list is sorted." -msgstr "" +msgstr "دوم، فهرست دکورشده مرتب می‌شود." -msgid "Finally, the decorations are removed, creating a list that contains only the initial values in the new order." +msgid "" +"Finally, the decorations are removed, creating a list that contains only the" +" initial values in the new order." msgstr "" +"در نهایت، آرایش‌ها (decorations) حذف می‌شوند و فهرستی ایجاد می‌شود که فقط " +"شامل مقادیر اولیه به ترتیب جدید است." -msgid "For example, to sort the student data by *grade* using the DSU approach:" +msgid "" +"For example, to sort the student data by *grade* using the DSU approach:" msgstr "" +"برای مثال، برای مرتب‌سازی داده‌های دانش‌آموزان بر اساس *نمره* با استفاده از " +"رویکرد DSU:" msgid "" ">>> decorated = [(student.grade, i, student) for i, student in enumerate(student_objects)]\n" @@ -246,63 +445,137 @@ msgid "" ">>> [student for grade, i, student in decorated] # undecorate\n" "[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" msgstr "" +">>> decorated = [(student.grade, i, student) for i, student in enumerate(student_objects)]\n" +">>> decorated.sort()\n" +">>> [student for grade, i, student in decorated] # undecorate\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" -msgid "This idiom works because tuples are compared lexicographically; the first items are compared; if they are the same then the second items are compared, and so on." +msgid "" +"This idiom works because tuples are compared lexicographically; the first " +"items are compared; if they are the same then the second items are compared," +" and so on." msgstr "" +"این روش کار می‌کند زیرا چندتایی‌ها به‌صورت لغت‌نامه‌ای مقایسه می‌شوند؛ " +"آیتم‌های اول مقایسه می‌شوند؛ اگر یکسان باشند، آیتم‌های دوم مقایسه می‌شوند و " +"به همین ترتیب." -msgid "It is not strictly necessary in all cases to include the index *i* in the decorated list, but including it gives two benefits:" +msgid "" +"It is not strictly necessary in all cases to include the index *i* in the " +"decorated list, but including it gives two benefits:" msgstr "" +"در همه موارد، آوردن اندیس *i* در فهرست آراسته اکیداً ضروری نیست، اما گنجاندن" +" آن دو مزیت دارد:" -msgid "The sort is stable -- if two items have the same key, their order will be preserved in the sorted list." +msgid "" +"The sort is stable -- if two items have the same key, their order will be " +"preserved in the sorted list." msgstr "" +"مرتب‌سازی پایدار است — اگر دو آیتم کلید یکسانی داشته باشند، ترتیب آن‌ها در " +"فهرست مرتب‌شده حفظ می‌شود." -msgid "The original items do not have to be comparable because the ordering of the decorated tuples will be determined by at most the first two items. So for example the original list could contain complex numbers which cannot be sorted directly." +msgid "" +"The original items do not have to be comparable because the ordering of the " +"decorated tuples will be determined by at most the first two items. So for " +"example the original list could contain complex numbers which cannot be " +"sorted directly." msgstr "" +"آیتم‌های اصلی لازم نیست قابل مقایسه باشند، زیرا ترتیب تاپل‌های دکورشده " +"حداکثر بر اساس دو آیتم اول تعیین می‌شود. بنابراین برای مثال، فهرست اصلی " +"می‌تواند شامل اعداد مختلط باشد که نمی‌توان آن‌ها را به‌طور مستقیم مرتب کرد." -msgid "Another name for this idiom is `Schwartzian transform `_\\, after Randal L. Schwartz, who popularized it among Perl programmers." +msgid "" +"Another name for this idiom is `Schwartzian transform " +"`_\\, after Randal L. " +"Schwartz, who popularized it among Perl programmers." msgstr "" +"نام دیگر این اصطلاح `Schwartzian transform " +"`_\\، برگرفته از نام " +"Randal L. Schwartz است که آن را میان برنامه‌نویسان Perl رواج داد." -msgid "Now that Python sorting provides key-functions, this technique is not often needed." +msgid "" +"Now that Python sorting provides key-functions, this technique is not often " +"needed." msgstr "" +"اکنون که مرتب‌سازی پایتون توابع کلید را فراهم می‌کند، اغلب نیازی به این روش " +"نیست." msgid "Comparison Functions" -msgstr "" +msgstr "توابع مقایسه" -msgid "Unlike key functions that return an absolute value for sorting, a comparison function computes the relative ordering for two inputs." +msgid "" +"Unlike key functions that return an absolute value for sorting, a comparison" +" function computes the relative ordering for two inputs." msgstr "" +"برخلاف توابع کلید که یک مقدار مطلق را برای مرتب‌سازی برمی‌گردانند، یک تابع " +"مقایسه ترتیب نسبی دو ورودی را محاسبه می‌کند." -msgid "For example, a `balance scale `_ compares two samples giving a relative ordering: lighter, equal, or heavier. Likewise, a comparison function such as ``cmp(a, b)`` will return a negative value for less-than, zero if the inputs are equal, or a positive value for greater-than." -msgstr "" +msgid "" +"For example, a `balance scale " +"`_" +" compares two samples giving a relative ordering: lighter, equal, or " +"heavier. Likewise, a comparison function such as ``cmp(a, b)`` will return a" +" negative value for less-than, zero if the inputs are equal, or a positive " +"value for greater-than." +msgstr "" +"برای مثال، یک `ترازوی دوکفه‌ای " +"`_" +" دو نمونه را مقایسه می‌کند و یک ترتیب نسبی ارائه می‌دهد: سبک‌تر، برابر، یا " +"سنگین‌تر. به همین ترتیب، یک تابع مقایسه مانند ``cmp(a, b)`` مقدار منفی برای " +"کوچک‌تر بودن، صفر اگر ورودی‌ها برابر باشند، یا مقدار مثبت برای بزرگ‌تر بودن " +"برمی‌گرداند." -msgid "It is common to encounter comparison functions when translating algorithms from other languages. Also, some libraries provide comparison functions as part of their API. For example, :func:`locale.strcoll` is a comparison function." +msgid "" +"It is common to encounter comparison functions when translating algorithms " +"from other languages. Also, some libraries provide comparison functions as " +"part of their API. For example, :func:`locale.strcoll` is a comparison " +"function." msgstr "" +"معمول است که هنگام ترجمه الگوریتم‌ها از زبان‌های دیگر با توابع مقایسه مواجه " +"شوید. همچنین، برخی کتابخانه‌ها توابع مقایسه را به‌عنوان بخشی از API خود " +"ارائه می‌کنند. برای مثال، :func:`locale.strcoll` یک تابع مقایسه است." -msgid "To accommodate those situations, Python provides :class:`functools.cmp_to_key` to wrap the comparison function to make it usable as a key function::" +msgid "" +"To accommodate those situations, Python provides " +":class:`functools.cmp_to_key` to wrap the comparison function to make it " +"usable as a key function::" msgstr "" +"برای سازگاری با این موقعیت‌ها، پایتون :class:`functools.cmp_to_key` را فراهم" +" می‌کند تا تابع مقایسه را در بر بگیرد و آن را به‌عنوان تابع کلید " +"قابل‌استفاده کند::" msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" -msgstr "" +msgstr "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" msgid "Strategies For Unorderable Types and Values" -msgstr "" +msgstr "راهبردهایی برای انواع و مقادیر غیرقابل‌مرتب‌سازی" -msgid "A number of type and value issues can arise when sorting. Here are some strategies that can help:" +msgid "" +"A number of type and value issues can arise when sorting. Here are some " +"strategies that can help:" msgstr "" +"هنگام مرتب‌سازی ممکن است مسائل مختلفی مربوط به نوع و مقدار پیش بیاید. در " +"اینجا چند راهبرد آمده است که می‌تواند کمک کند:" msgid "Convert non-comparable input types to strings prior to sorting:" -msgstr "" +msgstr "انواع ورودی غیرقابل‌مقایسه را پیش از مرتب‌سازی به رشته تبدیل کنید:" msgid "" ">>> data = ['twelve', '11', 10]\n" ">>> sorted(map(str, data))\n" "['10', '11', 'twelve']" msgstr "" +">>> data = ['twelve', '11', 10]\n" +">>> sorted(map(str, data))\n" +"['10', '11', 'twelve']" -msgid "This is needed because most cross-type comparisons raise a :exc:`TypeError`." +msgid "" +"This is needed because most cross-type comparisons raise a :exc:`TypeError`." msgstr "" +"این مورد لازم است، زیرا بیشتر مقایسه‌های بین‌نوعی یک :exc:`TypeError` پرتاب " +"می‌کنند." msgid "Remove special values prior to sorting:" -msgstr "" +msgstr "مقادیر خاص را پیش از مرتب‌سازی حذف کنید:" msgid "" ">>> from math import isnan\n" @@ -311,54 +584,102 @@ msgid "" ">>> sorted(filterfalse(isnan, data))\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> from math import isnan\n" +">>> from itertools import filterfalse\n" +">>> data = [3.3, float('nan'), 1.1, 2.2]\n" +">>> sorted(filterfalse(isnan, data))\n" +"[1.1, 2.2, 3.3]" -msgid "This is needed because the `IEEE-754 standard `_ specifies that, \"Every NaN shall compare unordered with everything, including itself.\"" +msgid "" +"This is needed because the `IEEE-754 standard " +"`_ specifies that, \"Every NaN shall" +" compare unordered with everything, including itself.\"" msgstr "" +"این لازم است زیرا `استاندارد IEEE-754 " +"`_ تصریح می‌کند که: «هر NaN باید در " +"مقایسه با هر چیزی، از جمله خودش، نامرتب باشد.»" msgid "Likewise, ``None`` can be stripped from datasets as well:" -msgstr "" +msgstr "به همین ترتیب، می‌توان ``None`` را نیز از مجموعه‌داده‌ها حذف کرد:" msgid "" ">>> data = [3.3, None, 1.1, 2.2]\n" ">>> sorted(x for x in data if x is not None)\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> data = [3.3, None, 1.1, 2.2]\n" +">>> sorted(x for x in data if x is not None)\n" +"[1.1, 2.2, 3.3]" msgid "This is needed because ``None`` is not comparable to other types." -msgstr "" +msgstr "این مورد لازم است زیرا ``None`` با انواع دیگر قابل‌مقایسه نیست." msgid "Convert mapping types into sorted item lists before sorting:" msgstr "" +"پیش از مرتب‌سازی، انواع نگاشت را به فهرست‌های مرتب‌شده از آیتم‌ها تبدیل " +"کنید:" msgid "" ">>> data = [{'a': 1}, {'b': 2}]\n" ">>> sorted(data, key=lambda d: sorted(d.items()))\n" "[{'a': 1}, {'b': 2}]" msgstr "" +">>> data = [{'a': 1}, {'b': 2}]\n" +">>> sorted(data, key=lambda d: sorted(d.items()))\n" +"[{'a': 1}, {'b': 2}]" -msgid "This is needed because dict-to-dict comparisons raise a :exc:`TypeError`." +msgid "" +"This is needed because dict-to-dict comparisons raise a :exc:`TypeError`." msgstr "" +"این کار لازم است، زیرا مقایسه‌ی دیکشنری با دیکشنری باعث پرتاب " +":exc:`TypeError` می‌شود." msgid "Convert set types into sorted lists before sorting:" msgstr "" +"پیش از مرتب‌سازی، انواع مجموعه (set) را به فهرست‌های مرتب‌شده تبدیل کنید:" msgid "" ">>> data = [{'a', 'b', 'c'}, {'b', 'c', 'd'}]\n" ">>> sorted(map(sorted, data))\n" "[['a', 'b', 'c'], ['b', 'c', 'd']]" msgstr "" +">>> data = [{'a', 'b', 'c'}, {'b', 'c', 'd'}]\n" +">>> sorted(map(sorted, data))\n" +"[['a', 'b', 'c'], ['b', 'c', 'd']]" -msgid "This is needed because the elements contained in set types do not have a deterministic order. For example, ``list({'a', 'b'})`` may produce either ``['a', 'b']`` or ``['b', 'a']``." +msgid "" +"This is needed because the elements contained in set types do not have a " +"deterministic order. For example, ``list({'a', 'b'})`` may produce either " +"``['a', 'b']`` or ``['b', 'a']``." msgstr "" +"این امر لازم است زیرا المان‌های موجود در انواع مجموعه‌ای (set) ترتیب قطعی " +"ندارند. برای مثال، ``list({'a', 'b'})`` ممکن است ``['a', 'b']`` یا ``['b', " +"'a']`` را تولید کند." msgid "Odds and Ends" -msgstr "" +msgstr "موارد متفرقه" -msgid "For locale aware sorting, use :func:`locale.strxfrm` for a key function or :func:`locale.strcoll` for a comparison function. This is necessary because \"alphabetical\" sort orderings can vary across cultures even if the underlying alphabet is the same." +msgid "" +"For locale aware sorting, use :func:`locale.strxfrm` for a key function or " +":func:`locale.strcoll` for a comparison function. This is necessary because" +" \"alphabetical\" sort orderings can vary across cultures even if the " +"underlying alphabet is the same." msgstr "" +"برای مرتب‌سازی آگاه از locale، از :func:`locale.strxfrm` به‌عنوان تابع کلید " +"یا از :func:`locale.strcoll` به‌عنوان تابع مقایسه استفاده کنید. این کار " +"ضروری است، زیرا ترتیب‌های مرتب‌سازی «الفبایی» می‌توانند بین فرهنگ‌ها متفاوت " +"باشند، حتی اگر الفبای زیربنایی یکسان باشد." -msgid "The *reverse* parameter still maintains sort stability (so that records with equal keys retain the original order). Interestingly, that effect can be simulated without the parameter by using the builtin :func:`reversed` function twice:" +msgid "" +"The *reverse* parameter still maintains sort stability (so that records with" +" equal keys retain the original order). Interestingly, that effect can be " +"simulated without the parameter by using the builtin :func:`reversed` " +"function twice:" msgstr "" +"پارامتر *reverse* همچنان پایداری مرتب‌سازی را حفظ می‌کند (به‌طوری که " +"رکوردهایی با کلیدهای برابر، ترتیب اصلی خود را حفظ می‌کنند). جالب است که " +"می‌توان آن اثر را بدون این پارامتر، با دو بار استفاده از تابع توکار " +":func:`reversed` شبیه‌سازی کرد:" msgid "" ">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" @@ -368,21 +689,56 @@ msgid "" ">>> standard_way\n" "[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" msgstr "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" +">>> double_reversed = list(reversed(sorted(reversed(data), key=itemgetter(0))))\n" +">>> assert standard_way == double_reversed\n" +">>> standard_way\n" +"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" -msgid "The sort routines use ``<`` when making comparisons between two objects. So, it is easy to add a standard sort order to a class by defining an :meth:`~object.__lt__` method:" +msgid "" +"The sort routines use ``<`` when making comparisons between two objects. So," +" it is easy to add a standard sort order to a class by defining an " +":meth:`~object.__lt__` method:" msgstr "" +"روال‌های مرتب‌سازی هنگام مقایسه‌ی دو شیء از ``<`` استفاده می‌کنند. بنابراین،" +" افزودن یک ترتیب مرتب‌سازی استاندارد به یک کلاس با تعریف یک متد " +":meth:`~object.__lt__` آسان است:" msgid "" ">>> Student.__lt__ = lambda self, other: self.age < other.age\n" ">>> sorted(student_objects)\n" "[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" msgstr "" +">>> Student.__lt__ = lambda self, other: self.age < other.age\n" +">>> sorted(student_objects)\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgid "However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for details on the mechanics). To avoid surprises, :pep:`8` recommends that all six comparison methods be implemented. The :deco:`~functools.total_ordering` decorator is provided to make that task easier." -msgstr "" +msgid "" +"However, note that ``<`` can fall back to using :meth:`~object.__gt__` if " +":meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for " +"details on the mechanics). To avoid surprises, :pep:`8` recommends that all" +" six comparison methods be implemented. The " +":deco:`~functools.total_ordering` decorator is provided to make that task " +"easier." +msgstr "" +"با این حال، توجه داشته باشید که اگر :meth:`~object.__lt__ <~object.__gt__>` " +"پیاده‌سازی نشده باشد، ``<`` می‌تواند به استفاده از :meth:`~object.__gt__ " +"<~object.__lt__>` روی بیاورد (برای جزئیات سازوکار، :func:`object.__lt__` را " +"ببینید). برای جلوگیری از موارد غیرمنتظره، :pep:`8` توصیه می‌کند که هر شش متد" +" مقایسه‌ای پیاده‌سازی شوند. دکوراتور :deco:`~functools.total_ordering` برای " +"آسان‌تر کردن این کار ارائه شده است." -msgid "Key functions need not depend directly on the objects being sorted. A key function can also access external resources. For instance, if the student grades are stored in a dictionary, they can be used to sort a separate list of student names:" +msgid "" +"Key functions need not depend directly on the objects being sorted. A key " +"function can also access external resources. For instance, if the student " +"grades are stored in a dictionary, they can be used to sort a separate list " +"of student names:" msgstr "" +"توابع کلید لازم نیست مستقیماً به اشیایی که مرتب می‌شوند وابسته باشند. یک " +"تابع کلید همچنین می‌تواند به منابع خارجی دسترسی داشته باشد. برای مثال، اگر " +"نمرات دانش‌آموزان در یک دیکشنری ذخیره‌شده باشد، می‌توان از آن‌ها برای " +"مرتب‌سازی فهرستی جداگانه از نام‌های دانش‌آموزان استفاده کرد:" msgid "" ">>> students = ['dave', 'john', 'jane']\n" @@ -390,18 +746,51 @@ msgid "" ">>> sorted(students, key=newgrades.__getitem__)\n" "['jane', 'dave', 'john']" msgstr "" +">>> students = ['dave', 'john', 'jane']\n" +">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" +">>> sorted(students, key=newgrades.__getitem__)\n" +"['jane', 'dave', 'john']" msgid "Partial Sorts" -msgstr "" +msgstr "مرتب‌سازی‌های جزئی" -msgid "Some applications require only some of the data to be ordered. The standard library provides several tools that do less work than a full sort:" +msgid "" +"Some applications require only some of the data to be ordered. The standard" +" library provides several tools that do less work than a full sort:" msgstr "" +"برخی کاربردها تنها نیاز دارند که بخشی از داده‌ها مرتب باشد. کتابخانه " +"استاندارد چندین ابزار ارائه می‌دهد که کار کمتری نسبت به مرتب‌سازی کامل انجام" +" می‌دهند:" -msgid ":func:`min` and :func:`max` return the smallest and largest values, respectively. These functions make a single pass over the input data and require almost no auxiliary memory." +msgid "" +":func:`min` and :func:`max` return the smallest and largest values, " +"respectively. These functions make a single pass over the input data and " +"require almost no auxiliary memory." msgstr "" +":func:`min` و :func:`max` به‌ترتیب کوچک‌ترین و بزرگ‌ترین مقادیر را " +"برمی‌گردانند. این توابع یک پیمایش واحد روی داده‌های ورودی انجام می‌دهند و " +"تقریباً به هیچ حافظه کمکی نیاز ندارند." -msgid ":func:`heapq.nsmallest` and :func:`heapq.nlargest` return the *n* smallest and largest values, respectively. These functions make a single pass over the data keeping only *n* elements in memory at a time. For values of *n* that are small relative to the number of inputs, these functions make far fewer comparisons than a full sort." -msgstr "" +msgid "" +":func:`heapq.nsmallest` and :func:`heapq.nlargest` return the *n* smallest " +"and largest values, respectively. These functions make a single pass over " +"the data keeping only *n* elements in memory at a time. For values of *n* " +"that are small relative to the number of inputs, these functions make far " +"fewer comparisons than a full sort." +msgstr "" +":func:`heapq.nsmallest` و :func:`heapq.nlargest` به‌ترتیب *n* مقدار " +"کوچک‌ترین و *n* مقدار بزرگ‌ترین را برمی‌گردانند. این توابع داده‌ها را در یک " +"گذر واحد پیمایش می‌کنند و در هر لحظه فقط *n* عنصر را در حافظه نگه می‌دارند. " +"برای مقادیر *n* که نسبت به تعداد ورودی‌ها کوچک هستند، این توابع مقایسه‌های " +"بسیار کمتری نسبت به یک مرتب‌سازی کامل انجام می‌دهند." -msgid ":func:`heapq.heappush` and :func:`heapq.heappop` create and maintain a partially sorted arrangement of data that keeps the smallest element at position ``0``. These functions are suitable for implementing priority queues which are commonly used for task scheduling." -msgstr "" +msgid "" +":func:`heapq.heappush` and :func:`heapq.heappop` create and maintain a " +"partially sorted arrangement of data that keeps the smallest element at " +"position ``0``. These functions are suitable for implementing priority " +"queues which are commonly used for task scheduling." +msgstr "" +":func:`heapq.heappush` و :func:`heapq.heappop` یک چیدمان تا حدی مرتب‌شده از " +"داده‌ها ایجاد و نگهداری می‌کنند که کوچک‌ترین عنصر را در موقعیت ``0`` نگه " +"می‌دارد. این توابع برای پیاده‌سازی صف‌های اولویتی که معمولاً برای زمان‌بندی " +"وظایف استفاده می‌شوند، مناسب هستند." diff --git a/howto/timerfd.po b/howto/timerfd.po index 4950f295a..af2c13ca3 100644 --- a/howto/timerfd.po +++ b/howto/timerfd.po @@ -24,22 +24,28 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "timer file descriptor HOWTO" -msgstr "" +msgstr "راهنمای عملی (HOWTO) توصیف‌گر فایل زمان‌سنج" msgid "Release" -msgstr "" +msgstr "انتشار" msgid "1.13" -msgstr "" +msgstr "1.13" -msgid "This HOWTO discusses Python's support for the linux timer file descriptor." +msgid "" +"This HOWTO discusses Python's support for the linux timer file descriptor." msgstr "" +"این راهنمای عملی پشتیبانی پایتون از توصیف‌گر فایل تایمر در لینوکس را بررسی می‌کند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "The following example shows how to use a timer file descriptor to execute a function twice a second:" +msgid "" +"The following example shows how to use a timer file descriptor to execute a " +"function twice a second:" msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان از یک توصیف‌گر فایل زمان‌ساز برای " +"اجرای یک تابع دو بار در ثانیه استفاده کرد:" msgid "" "# Practical scripts should use really use a non-blocking timer,\n" @@ -62,12 +68,42 @@ msgid "" " # Remember to close the timer file descriptor!\n" " os.close(fd)" msgstr "" +"# اسکریپت‌های کاربردی واقعاً باید از تایمر غیرمسدودکننده استفاده کنند،\n" +"# ما در اینجا برای سادگی از تایمر مسدودکننده استفاده می‌کنیم.\n" +"import os, time\n" +"\n" +"# ایجاد توصیف‌گر فایل تایمر\n" +"fd = os.timerfd_create(time.CLOCK_REALTIME)\n" +"\n" +"# شروع تایمر پس از ۱ ثانیه، با بازه‌ی نیم ثانیه\n" +"os.timerfd_settime(fd, initial=1, interval=0.5)\n" +"\n" +"try:\n" +" # رویدادهای تایمر را چهار بار پردازش کنید.\n" +" for _ in range(4):\n" +" # read() تا منقضی شدن تایمر مسدود می‌شود\n" +" _ = os.read(fd, 8)\n" +" print(\"Timer expired\")\n" +"finally:\n" +" # به یاد داشته باشید که توصیف‌گر فایل تایمر را ببندید!\n" +" os.close(fd)" -msgid "To avoid the precision loss caused by the :class:`float` type, timer file descriptors allow specifying initial expiration and interval in integer nanoseconds with ``_ns`` variants of the functions." +msgid "" +"To avoid the precision loss caused by the :class:`float` type, timer file " +"descriptors allow specifying initial expiration and interval in integer " +"nanoseconds with ``_ns`` variants of the functions." msgstr "" +"برای پرهیز از کاهش دقت ناشی از نوع :class:`float`، توصیف‌گرهای فایل زمان‌سنج" +" امکان مشخص کردن انقضای اولیه و بازه زمانی را به‌صورت نانوثانیه‌های عدد صحیح" +" از طریق نسخه‌های ``_ns`` توابع فراهم می‌کنند." -msgid "This example shows how :func:`~select.epoll` can be used with timer file descriptors to wait until the file descriptor is ready for reading:" +msgid "" +"This example shows how :func:`~select.epoll` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" msgstr "" +"این مثال نشان می‌دهد که چگونه می‌توان از :func:`~select.epoll` همراه با " +"توصیف‌گرهای فایل زمان‌سنج برای انتظار تا زمانی که توصیف‌گر فایل برای خواندن " +"آماده شود، استفاده کرد:" msgid "" "import os, time, select, socket, sys\n" @@ -174,9 +210,117 @@ msgid "" " os.close(fd)\n" " ep.close()" msgstr "" +"import os, time, select, socket, sys\n" +"\n" +"# Create an epoll object\n" +"ep = select.epoll()\n" +"\n" +"# In this example, use loopback address to send \"stop\" command to the server.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"ep.register(sock, select.EPOLLIN)\n" +"\n" +"# Create timer file descriptors in non-blocking mode.\n" +"num = 3\n" +"fds = []\n" +"for _ in range(num):\n" +" fd = os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" fds.append(fd)\n" +" # Register the timer file descriptor for read events\n" +" ep.register(fd, select.EPOLLIN)\n" +"\n" +"# Start the timer with os.timerfd_settime_ns() in nanoseconds.\n" +"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" +"for i, fd in enumerate(fds, start=1):\n" +" one_sec_in_nsec = 10**9\n" +" i = i * one_sec_in_nsec\n" +" os.timerfd_settime_ns(fd, initial=i//4, interval=i//4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # Wait for the timer to expire for 3 seconds.\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" # fd is a file descriptor.\n" +" # sock and conn[=returned value of socket.accept()] are socket objects, not file descriptors.\n" +" # So use sock.fileno() and conn.fileno() to get the file descriptors.\n" +" events = ep.poll(timeout)\n" +"\n" +" # If more than one timer file descriptors are ready for reading at once,\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" #\n" +" # In this example settings,\n" +" # 1st timer fires every 0.25 seconds in 0.25 seconds. (0.25, 0.5, 0.75, 1.0, ...)\n" +" # 2nd timer every 0.5 seconds in 0.5 seconds. (0.5, 1.0, 1.5, 2.0, ...)\n" +" # 3rd timer every 0.75 seconds in 0.75 seconds. (0.75, 1.5, 2.25, 3.0, ...)\n" +" #\n" +" # In 0.25 seconds, only 1st timer fires.\n" +" # In 0.5 seconds, 1st timer and 2nd timer fires at once.\n" +" # In 0.75 seconds, 1st timer and 3rd timer fires at once.\n" +" # In 1.5 seconds, 1st timer, 2nd timer and 3rd timer fires at once.\n" +" #\n" +" # If a timer file descriptor is signaled more than once since\n" +" # the last os.read() call, os.read() returns the number of signaled\n" +" # as host order of class bytes.\n" +" print(f\"Signaled events={events}\")\n" +" for fd, event in events:\n" +" if event & select.EPOLLIN:\n" +" if fd == sock.fileno():\n" +" # Check if there is a connection request.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" ep.register(conn, select.EPOLLIN)\n" +" elif conn and fd == conn.fileno():\n" +" # Check if there is data to read.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # You should catch UnicodeDecodeError exception for safety.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # No more data, close connection\n" +" print(f\"Closing connection {fd}\")\n" +" ep.unregister(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys.byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" ep.unregister(fd)\n" +" os.close(fd)\n" +" ep.close()" -msgid "This example shows how :func:`~select.select` can be used with timer file descriptors to wait until the file descriptor is ready for reading:" +msgid "" +"This example shows how :func:`~select.select` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" msgstr "" +"این مثال نشان می‌دهد که چگونه می‌توان از :func:`~select.select` همراه با " +"توصیف‌گرهای فایل زمان‌سنج برای منتظر ماندن تا زمانی که توصیف‌گر فایل برای " +"خواندن آماده شود، استفاده کرد:" msgid "" "import os, time, select, socket, sys\n" @@ -252,3 +396,75 @@ msgid "" " sock.close()\n" " sock = None" msgstr "" +"import os, time, select, socket, sys\n" +"\n" +"# در این مثال، از نشانی حلقه‌ای (loopback) برای ارسال فرمان \"stop\" به سرور استفاده کنید.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# در حال تلاش برای 127.0.0.1...\n" +"# به 127.0.0.1 متصل شد.\n" +"# نویسه‌ی گریز '^]' است.\n" +"# stop\n" +"# اتصال توسط میزبان خارجی بسته شد.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"\n" +"# توصیف‌گرهای فایل زمان‌سنج را در حالت غیرمسدود ایجاد کنید.\n" +"num = 3\n" +"fds = [os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" for _ in range(num)]\n" +"select_fds = fds + [sock]\n" +"\n" +"# زمان‌سنج‌ها را با os.timerfd_settime() بر حسب ثانیه راه‌اندازی کنید.\n" +"# زمان‌سنج ۱ هر ۰٫۲۵ ثانیه فعال می‌شود؛ زمان‌سنج ۲ هر ۰٫۵ ثانیه؛ و غیره\n" +"for i, fd in enumerate(fds, start=1):\n" +" os.timerfd_settime(fd, initial=i/4, interval=i/4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # به مدت ۳ ثانیه منتظر انقضای زمان‌سنج بمانید.\n" +" # select.select() فهرستی از توصیف‌گرهای فایل یا شیء‌ها را برمی‌گرداند.\n" +" rfd, wfd, xfd = select.select(select_fds, select_fds, select_fds, timeout)\n" +" for fd in rfd:\n" +" if fd == sock:\n" +" # بررسی کنید که آیا درخواست اتصالی وجود دارد یا خیر.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" select_fds.append(conn)\n" +" elif conn and fd == conn:\n" +" # بررسی کنید که آیا داده‌ای برای خواندن وجود دارد یا خیر.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # برای ایمنی، باید استثنای UnicodeDecodeError را بگیرید.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # دیگر داده‌ای وجود ندارد، اتصال را ببندید\n" +" print(f\"Closing connection {fd}\")\n" +" select_fds.remove(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys.byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" os.close(fd)\n" +" sock.close()\n" +" sock = None" diff --git a/howto/unicode.po b/howto/unicode.po index 9acbbca1a..dad5a3838 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -25,37 +25,96 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Unicode HOWTO" -msgstr "" +msgstr "راهنمای یونیکد" msgid "Release" -msgstr "" +msgstr "انتشار" msgid "1.12" -msgstr "" +msgstr "1.12" -msgid "This HOWTO discusses Python's support for the Unicode specification for representing textual data, and explains various problems that people commonly encounter when trying to work with Unicode." +msgid "" +"This HOWTO discusses Python's support for the Unicode specification for " +"representing textual data, and explains various problems that people " +"commonly encounter when trying to work with Unicode." msgstr "" +"این راهنمای عملی پشتیبانی پایتون از مشخصات یونیکد برای بازنمایی داده‌های متنی را " +"بررسی می‌کند و مشکلات مختلفی را توضیح می‌دهد که افراد معمولاً هنگام تلاش " +"برای کار با یونیکد با آن‌ها مواجه می‌شوند." msgid "Introduction to Unicode" -msgstr "" +msgstr "مقدمه‌ای بر یونیکد" msgid "Definitions" -msgstr "" +msgstr "تعاریف" -msgid "Today's programs need to be able to handle a wide variety of characters. Applications are often internationalized to display messages and output in a variety of user-selectable languages; the same program might need to output an error message in English, French, Japanese, Hebrew, or Russian. Web content can be written in any of these languages and can also include a variety of emoji symbols. Python's string type uses the Unicode Standard for representing characters, which lets Python programs work with all these different possible characters." -msgstr "" +msgid "" +"Today's programs need to be able to handle a wide variety of characters. " +"Applications are often internationalized to display messages and output in a" +" variety of user-selectable languages; the same program might need to output" +" an error message in English, French, Japanese, Hebrew, or Russian. Web " +"content can be written in any of these languages and can also include a " +"variety of emoji symbols. Python's string type uses the Unicode Standard for" +" representing characters, which lets Python programs work with all these " +"different possible characters." +msgstr "" +"برنامه‌های امروزی باید بتوانند تنوع گسترده‌ای از نویسه‌ها را مدیریت کنند. " +"برنامه‌های کاربردی اغلب بین‌المللی‌سازی می‌شوند تا پیام‌ها و خروجی‌ها را به " +"زبان‌های مختلف قابل انتخاب توسط کاربر نمایش دهند؛ ممکن است همان برنامه نیاز " +"داشته باشد پیام خطایی را به انگلیسی، فرانسوی، ژاپنی، عبری یا روسی نمایش دهد." +" محتوای وب می‌تواند به هر یک از این زبان‌ها نوشته شود و همچنین می‌تواند شامل" +" انواع نمادهای ایموجی باشد. نوع رشته پایتون از استاندارد یونیکد برای نمایش " +"نویسه‌ها استفاده می‌کند، که به برنامه‌های پایتون امکان می‌دهد با تمام این " +"نویسه‌های ممکن متفاوت کار کنند." -msgid "Unicode (https://www.unicode.org/) is a specification that aims to list every character used by human languages and give each character its own unique code. The Unicode specifications are continually revised and updated to add new languages and symbols." +msgid "" +"Unicode (https://www.unicode.org/) is a specification that aims to list " +"every character used by human languages and give each character its own " +"unique code. The Unicode specifications are continually revised and updated" +" to add new languages and symbols." msgstr "" +"یونیکد (https://www.unicode.org/) مشخصاتی است که هدف آن فهرست کردن تمام " +"نویسه‌های مورد استفاده در زبان‌های انسانی و اختصاص یک کد یکتا به هر نویسه " +"است. مشخصات یونیکد به‌طور مداوم برای افزودن زبان‌ها و نمادهای جدید بازنگری و" +" به‌روزرسانی می‌شود." -msgid "A **character** is the smallest possible component of a text. 'A', 'B', 'C', etc., are all different characters. So are 'È' and 'Í'. Characters vary depending on the language or context you're talking about. For example, there's a character for \"Roman Numeral One\", 'Ⅰ', that's separate from the uppercase letter 'I'. They'll usually look the same, but these are two different characters that have different meanings." -msgstr "" +msgid "" +"A **character** is the smallest possible component of a text. 'A', 'B', " +"'C', etc., are all different characters. So are 'È' and 'Í'. Characters " +"vary depending on the language or context you're talking about. For " +"example, there's a character for \"Roman Numeral One\", 'Ⅰ', that's separate" +" from the uppercase letter 'I'. They'll usually look the same, but these " +"are two different characters that have different meanings." +msgstr "" +"**نویسه** کوچک‌ترین کامپوننت ممکن یک متن است. 'A'، 'B'، 'C' و غیره، همگی " +"نویسه‌های متفاوتی هستند. 'È' و 'Í' نیز همین‌طور هستند. نویسه‌ها بسته به زبان" +" یا زمینه‌ای که در مورد آن صحبت می‌کنید، متفاوت هستند. برای مثال، نویسه‌ای " +"برای «عدد رومی یک»، 'Ⅰ'، وجود دارد که از حرف بزرگ 'I' جدا است. این دو " +"معمولاً یکسان به نظر می‌رسند، اما این‌ها دو نویسه متفاوت هستند که معانی " +"متفاوتی دارند." -msgid "The Unicode standard describes how characters are represented by **code points**. A code point value is an integer in the range 0 to 0x10FFFF (about 1.1 million values, the `actual number assigned `_ is less than that). In the standard and in this document, a code point is written using the notation ``U+265E`` to mean the character with value ``0x265e`` (9,822 in decimal)." -msgstr "" +msgid "" +"The Unicode standard describes how characters are represented by **code " +"points**. A code point value is an integer in the range 0 to 0x10FFFF " +"(about 1.1 million values, the `actual number assigned " +"`_ is less than that). In " +"the standard and in this document, a code point is written using the " +"notation ``U+265E`` to mean the character with value ``0x265e`` (9,822 in " +"decimal)." +msgstr "" +"استاندارد یونیکد توصیف می‌کند که نویسه‌ها چگونه با **نقاط کد (code points)**" +" نشان داده می‌شوند. مقدار یک نقطه کد، یک عدد صحیح در بازه‌ی ۰ تا 0x10FFFF است" +" (حدود ۱٫۱ میلیون مقدار، `تعداد واقعی اختصاص‌داده‌شده " +"`_ کمتر از آن است). در " +"استاندارد و در این سند، یک نقطه کد با استفاده از نماد ``U+265E`` نوشته " +"می‌شود که به معنای نویسه‌ای با مقدار ``0x265e`` (۹٬۸۲۲ در مبنای ده) است." -msgid "The Unicode standard contains a lot of tables listing characters and their corresponding code points:" +msgid "" +"The Unicode standard contains a lot of tables listing characters and their " +"corresponding code points:" msgstr "" +"استاندارد یونیکد شامل جدول‌های بسیاری است که نویسه‌ها و نقاط کد متناظر " +"آن‌ها را فهرست می‌کنند:" msgid "" "0061 'a'; LATIN SMALL LETTER A\n" @@ -74,105 +133,289 @@ msgid "" "1F609 '😉'; WINKING FACE\n" "..." msgstr "" +"0061 'a'; LATIN SMALL LETTER A\n" +"0062 'b'; LATIN SMALL LETTER B\n" +"0063 'c'; LATIN SMALL LETTER C\n" +"...\n" +"007B '{'; LEFT CURLY BRACKET\n" +"...\n" +"2167 'Ⅷ'; ROMAN NUMERAL EIGHT\n" +"2168 'Ⅸ'; ROMAN NUMERAL NINE\n" +"...\n" +"265E '♞'; BLACK CHESS KNIGHT\n" +"265F '♟'; BLACK CHESS PAWN\n" +"...\n" +"1F600 '😀'; GRINNING FACE\n" +"1F609 '😉'; WINKING FACE\n" +"..." -msgid "Strictly, these definitions imply that it's meaningless to say 'this is character ``U+265E``'. ``U+265E`` is a code point, which represents some particular character; in this case, it represents the character 'BLACK CHESS KNIGHT', '♞'. In informal contexts, this distinction between code points and characters will sometimes be forgotten." +msgid "" +"Strictly, these definitions imply that it's meaningless to say 'this is " +"character ``U+265E``'. ``U+265E`` is a code point, which represents some " +"particular character; in this case, it represents the character 'BLACK CHESS" +" KNIGHT', '♞'. In informal contexts, this distinction between code points " +"and characters will sometimes be forgotten." msgstr "" +"به‌طور دقیق، این تعاریف ایجاب می‌کنند که گفتن «این نویسه ``U+265E`` است» " +"بی‌معنا باشد. ``U+265E`` یک نقطه کد (code point) است که نمایانگر نویسه‌ای " +"خاص است؛ در این مورد، نمایانگر نویسه‌ی «BLACK CHESS KNIGHT»، «♞» است. در " +"بافت‌های غیررسمی، گاهی این تمایز میان نقاط کد و نویسه‌ها فراموش می‌شود." -msgid "A character is represented on a screen or on paper by a set of graphical elements that's called a **glyph**. The glyph for an uppercase A, for example, is two diagonal strokes and a horizontal stroke, though the exact details will depend on the font being used. Most Python code doesn't need to worry about glyphs; figuring out the correct glyph to display is generally the job of a GUI toolkit or a terminal's font renderer." -msgstr "" +msgid "" +"A character is represented on a screen or on paper by a set of graphical " +"elements that's called a **glyph**. The glyph for an uppercase A, for " +"example, is two diagonal strokes and a horizontal stroke, though the exact " +"details will depend on the font being used. Most Python code doesn't need " +"to worry about glyphs; figuring out the correct glyph to display is " +"generally the job of a GUI toolkit or a terminal's font renderer." +msgstr "" +"یک نویسه روی نمایشگر یا روی کاغذ با مجموعه‌ای از عناصر گرافیکی نمایش داده " +"می‌شود که به آن **گلیف** (glyph) می‌گویند. برای مثال، گلیف یک نویسه‌ی A بزرگ" +" از دو خط مورب و یک خط افقی تشکیل شده است، اگرچه جزئیات دقیق به قلم " +"استفاده‌شده بستگی دارد. در بیشتر کدهای Python، نیازی به نگرانی درباره " +"گلیف‌ها نیست؛ تعیین گلیف صحیح برای نمایش معمولاً وظیفه‌ی یک ابزارک GUI یا " +"رندرکننده‌ی قلم پایانه است." msgid "Encodings" -msgstr "" +msgstr "کدگذاری‌ها" -msgid "To summarize the previous section: a Unicode string is a sequence of code points, which are numbers from 0 through ``0x10FFFF`` (1,114,111 decimal). This sequence of code points needs to be represented in memory as a set of **code units**, and **code units** are then mapped to 8-bit bytes. The rules for translating a Unicode string into a sequence of bytes are called a **character encoding**, or just an **encoding**." -msgstr "" +msgid "" +"To summarize the previous section: a Unicode string is a sequence of code " +"points, which are numbers from 0 through ``0x10FFFF`` (1,114,111 decimal). " +"This sequence of code points needs to be represented in memory as a set of " +"**code units**, and **code units** are then mapped to 8-bit bytes. The " +"rules for translating a Unicode string into a sequence of bytes are called a" +" **character encoding**, or just an **encoding**." +msgstr "" +"برای جمع‌بندی بخش پیشین: یک رشته‌ی یونیکد، دنباله‌ای از نقاط کد است که " +"اعدادی از ۰ تا ``0x10FFFF`` (۱٬۱۱۴٬۱۱۱ در مبنای ده) هستند. این دنباله از " +"نقاط کد باید در حافظه به‌صورت مجموعه‌ای از **واحدهای کد** بازنمایی شود، و " +"سپس **واحدهای کد** به بایت‌های ۸ بیتی نگاشت می‌شوند. قواعد تبدیل یک رشته‌ی " +"یونیکد به دنباله‌ای از بایت‌ها، **کدگذاری نویسه** یا صرفاً یک **کدگذاری** " +"نامیده می‌شوند." -msgid "The first encoding you might think of is using 32-bit integers as the code unit, and then using the CPU's representation of 32-bit integers. In this representation, the string \"Python\" might look like this:" +msgid "" +"The first encoding you might think of is using 32-bit integers as the code " +"unit, and then using the CPU's representation of 32-bit integers. In this " +"representation, the string \"Python\" might look like this:" msgstr "" +"اولین کدگذاری که ممکن است به آن فکر کنید، استفاده از اعداد صحیح ۳۲ بیتی " +"به‌عنوان واحد کد (code unit) و سپس استفاده از بازنمایی CPU از اعداد صحیح ۳۲ " +"بیتی است. در این بازنمایی، رشته‌ی \"Python\" ممکن است به این شکل باشد:" msgid "" " P y t h o n\n" "0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" " 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" msgstr "" +" P y t h o n\n" +"0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" +" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" -msgid "This representation is straightforward but using it presents a number of problems." -msgstr "" +msgid "" +"This representation is straightforward but using it presents a number of " +"problems." +msgstr "این بازنمایی ساده است، اما استفاده از آن تعدادی مشکل ایجاد می‌کند." msgid "It's not portable; different processors order the bytes differently." msgstr "" +"قابل‌حمل نیست؛ پردازنده‌های مختلف، بایت‌ها را به ترتیب متفاوتی مرتب می‌کنند." -msgid "It's very wasteful of space. In most texts, the majority of the code points are less than 127, or less than 255, so a lot of space is occupied by ``0x00`` bytes. The above string takes 24 bytes compared to the 6 bytes needed for an ASCII representation. Increased RAM usage doesn't matter too much (desktop computers have gigabytes of RAM, and strings aren't usually that large), but expanding our usage of disk and network bandwidth by a factor of 4 is intolerable." -msgstr "" +msgid "" +"It's very wasteful of space. In most texts, the majority of the code points" +" are less than 127, or less than 255, so a lot of space is occupied by " +"``0x00`` bytes. The above string takes 24 bytes compared to the 6 bytes " +"needed for an ASCII representation. Increased RAM usage doesn't matter too " +"much (desktop computers have gigabytes of RAM, and strings aren't usually " +"that large), but expanding our usage of disk and network bandwidth by a " +"factor of 4 is intolerable." +msgstr "" +"این روش بسیار اتلاف‌کننده‌ی فضا است. در بیشتر متن‌ها، بیشتر نقاط کد (code " +"points) کمتر از ۱۲۷ یا کمتر از ۲۵۵ هستند، بنابراین فضای زیادی توسط بایت‌های " +"``0x00`` اشغال می‌شود. رشته‌ی بالا در مقایسه با ۶ بایت مورد نیاز برای نمایش " +"ASCII، ۲۴ بایت فضا اشغال می‌کند. افزایش مصرف RAM اهمیت چندانی ندارد " +"(رایانه‌های رومیزی گیگابایت‌ها RAM دارند و رشته‌ها معمولاً آن‌قدر بزرگ " +"نیستند)، اما افزایش استفاده‌ی ما از پهنای باند دیسک و شبکه با ضریب ۴ " +"تحمل‌ناپذیر است." -msgid "It's not compatible with existing C functions such as ``strlen()``, so a new family of wide string functions would need to be used." +msgid "" +"It's not compatible with existing C functions such as ``strlen()``, so a new" +" family of wide string functions would need to be used." msgstr "" +"این با توابع موجود C مانند ``strlen()`` سازگار نیست، بنابراین باید از " +"خانواده‌ی جدیدی از توابع رشته‌ی پهن (wide string) استفاده شود." -msgid "Therefore this encoding isn't used very much, and people instead choose other encodings that are more efficient and convenient, such as UTF-8." +msgid "" +"Therefore this encoding isn't used very much, and people instead choose " +"other encodings that are more efficient and convenient, such as UTF-8." msgstr "" +"بنابراین این کدگذاری چندان استفاده نمی‌شود و در عوض، افراد کدگذاری‌های دیگری" +" را انتخاب می‌کنند که کارآمدتر و مناسب‌تر هستند، مانند UTF-8." -msgid "UTF-8 is one of the most commonly used encodings, and Python often defaults to using it. UTF stands for \"Unicode Transformation Format\", and the '8' means that 8-bit values are used in the encoding. (There are also UTF-16 and UTF-32 encodings, but they are less frequently used than UTF-8.) UTF-8 uses the following rules:" -msgstr "" +msgid "" +"UTF-8 is one of the most commonly used encodings, and Python often defaults " +"to using it. UTF stands for \"Unicode Transformation Format\", and the '8' " +"means that 8-bit values are used in the encoding. (There are also UTF-16 " +"and UTF-32 encodings, but they are less frequently used than UTF-8.) UTF-8 " +"uses the following rules:" +msgstr "" +"UTF-8 یکی از پرکاربردترین کدگذاری‌ها است و پایتون اغلب به‌طور پیش‌فرض از آن " +"استفاده می‌کند. UTF مخفف «Unicode Transformation Format» است و «8» به این " +"معناست که در این کدگذاری از مقادیر ۸ بیتی استفاده می‌شود. (کدگذاری‌های " +"UTF-16 و UTF-32 نیز وجود دارند، اما کمتر از UTF-8 استفاده می‌شوند.) UTF-8 از" +" قواعد زیر پیروی می‌کند:" -msgid "If the code point is < 128, it's represented by the corresponding byte value." +msgid "" +"If the code point is < 128, it's represented by the corresponding byte " +"value." msgstr "" +"اگر نقطه‌کد (code point) کمتر از ۱۲۸ باشد، با مقدار بایت متناظر بازنمایی " +"می‌شود." -msgid "If the code point is >= 128, it's turned into a sequence of two, three, or four bytes, where each byte of the sequence is between 128 and 255." +msgid "" +"If the code point is >= 128, it's turned into a sequence of two, three, or " +"four bytes, where each byte of the sequence is between 128 and 255." msgstr "" +"اگر نقطه‌کد (code point) بزرگ‌تر یا مساوی ۱۲۸ باشد، به دنباله‌ای از دو، سه " +"یا چهار بایت تبدیل می‌شود، که در آن هر بایتِ دنباله بین ۱۲۸ و ۲۵۵ است." msgid "UTF-8 has several convenient properties:" -msgstr "" +msgstr "UTF-8 دارای چندین ویژگی مناسب است:" msgid "It can handle any Unicode code point." -msgstr "" +msgstr "می‌تواند هر نقطه‌کد یونیکد را پردازش کند." -msgid "A Unicode string is turned into a sequence of bytes that contains embedded zero bytes only where they represent the null character (U+0000). This means that UTF-8 strings can be processed by C functions such as ``strcpy()`` and sent through protocols that can't handle zero bytes for anything other than end-of-string markers." -msgstr "" +msgid "" +"A Unicode string is turned into a sequence of bytes that contains embedded " +"zero bytes only where they represent the null character (U+0000). This means" +" that UTF-8 strings can be processed by C functions such as ``strcpy()`` and" +" sent through protocols that can't handle zero bytes for anything other than" +" end-of-string markers." +msgstr "" +"یک رشته یونیکدی به دنباله‌ای از بایت‌ها تبدیل می‌شود که فقط در جاهایی حاوی " +"بایت‌های صفر جاسازی‌شده است که این بایت‌ها نمایانگر نویسه تهی (U+0000) " +"باشند. این بدان معناست که رشته‌های UTF-8 می‌توانند توسط توابع C مانند " +"``strcpy()`` پردازش شوند و از طریق پروتکل‌هایی که نمی‌توانند بایت‌های صفر را" +" برای هیچ منظوری به‌جز نشانگرهای پایان رشته مدیریت کنند، ارسال شوند." msgid "A string of ASCII text is also valid UTF-8 text." -msgstr "" +msgstr "یک رشته از متن ASCII، یک متن UTF-8 معتبر نیز هست." -msgid "UTF-8 is fairly compact; the majority of commonly used characters can be represented with one or two bytes." +msgid "" +"UTF-8 is fairly compact; the majority of commonly used characters can be " +"represented with one or two bytes." msgstr "" +"UTF-8 نسبتاً فشرده است؛ بیشتر نویسه‌های پرکاربرد را می‌توان با یک یا دو بایت" +" نمایش داد." -msgid "If bytes are corrupted or lost, it's possible to determine the start of the next UTF-8-encoded code point and resynchronize. It's also unlikely that random 8-bit data will look like valid UTF-8." +msgid "" +"If bytes are corrupted or lost, it's possible to determine the start of the " +"next UTF-8-encoded code point and resynchronize. It's also unlikely that " +"random 8-bit data will look like valid UTF-8." msgstr "" +"اگر بایت‌ها خراب یا از دست رفته باشند، می‌توان آغاز نقطه کد بعدیِ " +"کدگذاری‌شده با UTF-8 را تعیین کرد و همگام‌سازی مجدد انجام داد. همچنین بعید " +"است که داده‌های تصادفی ۸ بیتی شبیه UTF-8 معتبر به نظر برسند." -msgid "UTF-8 is a byte oriented encoding. The encoding specifies that each character is represented by a specific sequence of one or more bytes. This avoids the byte-ordering issues that can occur with integer and word oriented encodings, like UTF-16 and UTF-32, where the sequence of bytes varies depending on the hardware on which the string was encoded." -msgstr "" +msgid "" +"UTF-8 is a byte oriented encoding. The encoding specifies that each " +"character is represented by a specific sequence of one or more bytes. This " +"avoids the byte-ordering issues that can occur with integer and word " +"oriented encodings, like UTF-16 and UTF-32, where the sequence of bytes " +"varies depending on the hardware on which the string was encoded." +msgstr "" +"UTF-8 یک کدگذاری بایت‌محور است. این کدگذاری مشخص می‌کند که هر نویسه با " +"دنباله‌ای مشخص از یک یا چند بایت نمایش داده می‌شود. این امر از مسائل ترتیب " +"بایت‌ها که ممکن است در کدگذاری‌های عدد صحیح‌محور و کلمه‌محور، مانند UTF-16 و" +" UTF-32، رخ دهد، جلوگیری می‌کند؛ در این کدگذاری‌ها، دنباله‌ی بایت‌ها بسته به " +"سخت‌افزاری که رشته روی آن کدگذاری شده است، متفاوت است." msgid "References" -msgstr "" +msgstr "ارجاع‌ها" -msgid "The `Unicode Consortium site `_ has character charts, a glossary, and PDF versions of the Unicode specification. Be prepared for some difficult reading. `A chronology `_ of the origin and development of Unicode is also available on the site." +msgid "" +"The `Unicode Consortium site `_ has character " +"charts, a glossary, and PDF versions of the Unicode specification. Be " +"prepared for some difficult reading. `A chronology " +"`_ of the origin and development of " +"Unicode is also available on the site." msgstr "" +"`وب‌سایت کنسرسیوم یونیکد `_ دارای جدول‌های " +"نویسه‌ها، واژه‌نامه و نسخه‌های PDF از مشخصات یونیکد است. برای مطالعه‌ای " +"دشوار آماده باشید. `گاه‌شماری `_ از پیدایش" +" و گسترش یونیکد نیز در این وب‌سایت در دسترس است." -msgid "On the Computerphile Youtube channel, Tom Scott briefly `discusses the history of Unicode and UTF-8 `_ (9 minutes 36 seconds)." +msgid "" +"On the Computerphile Youtube channel, Tom Scott briefly `discusses the " +"history of Unicode and UTF-8 `_" +" (9 minutes 36 seconds)." msgstr "" +"در کانال یوتیوب Computerphile، تام اسکات `تاریخچه‌ی یونیکد و UTF-8 را " +"به‌اختصار بررسی می‌کند `_ (۹ " +"دقیقه و ۳۶ ثانیه)." -msgid "To help understand the standard, Jukka Korpela has written `an introductory guide `_ to reading the Unicode character tables." +msgid "" +"To help understand the standard, Jukka Korpela has written `an introductory " +"guide `_ to reading the Unicode " +"character tables." msgstr "" +"برای کمک به درک این استاندارد، Jukka Korpela یک `راهنمای مقدماتی " +"`_ برای خواندن جدول‌های نویسه‌های " +"یونیکد نوشته است." -msgid "Another `good introductory article `_ was written by Joel Spolsky. If this introduction didn't make things clear to you, you should try reading this alternate article before continuing." -msgstr "" +msgid "" +"Another `good introductory article " +"`_ was written by Joel Spolsky. If this " +"introduction didn't make things clear to you, you should try reading this " +"alternate article before continuing." +msgstr "" +"یک `مقاله‌ی مقدماتی خوب `_ دیگر توسط Joel Spolsky نوشته" +" شده است. اگر این مقدمه مطالب را برای شما روشن نکرد، باید سعی کنید پیش از " +"ادامه، این مقاله‌ی جایگزین را بخوانید." -msgid "Wikipedia entries are often helpful; see the entries for \"`character encoding `_\" and `UTF-8 `_, for example." +msgid "" +"Wikipedia entries are often helpful; see the entries for \"`character " +"encoding `_\" and `UTF-8 " +"`_, for example." msgstr "" +"مقاله‌های ویکی‌پدیا اغلب مفید هستند؛ برای مثال، مقاله‌های «`کدگذاری نویسه " +"`_» و `UTF-8 " +"`_ را ببینید." msgid "Python's Unicode Support" -msgstr "" +msgstr "پشتیبانی پایتون از یونیکد" -msgid "Now that you've learned the rudiments of Unicode, we can look at Python's Unicode features." +msgid "" +"Now that you've learned the rudiments of Unicode, we can look at Python's " +"Unicode features." msgstr "" +"اکنون که مبانی یونیکد را آموخته‌اید، می‌توانیم ویژگی‌های یونیکد پایتون را " +"بررسی کنیم." msgid "The String Type" -msgstr "" +msgstr "نوع رشته" -msgid "Since Python 3.0, the language's :class:`str` type contains Unicode characters, meaning any string created using ``\"unicode rocks!\"``, ``'unicode rocks!'``, or the triple-quoted string syntax is stored as Unicode." +msgid "" +"Since Python 3.0, the language's :class:`str` type contains Unicode " +"characters, meaning any string created using ``\"unicode rocks!\"``, " +"``'unicode rocks!'``, or the triple-quoted string syntax is stored as " +"Unicode." msgstr "" +"از پایتون 3.0، نوع :class:`str` این زبان شامل نویسه‌های یونیکد است، به این " +"معنا که هر رشته‌ای که با استفاده از ``\"unicode rocks!\"``، ``'unicode " +"rocks!'`` یا نحو رشته‌های دارای سه علامت نقل‌قول ایجاد شود، به‌صورت یونیکد " +"ذخیره می‌شود." -msgid "The default encoding for Python source code is UTF-8, so you can simply include a Unicode character in a string literal::" +msgid "" +"The default encoding for Python source code is UTF-8, so you can simply " +"include a Unicode character in a string literal::" msgstr "" +"کدگذاری پیش‌فرض برای کد منبع پایتون UTF-8 است، بنابراین می‌توانید به‌سادگی " +"یک نویسه‌ی یونیکد را در یک رشته‌ی صریح (string literal) قرار دهید::" msgid "" "try:\n" @@ -182,18 +425,38 @@ msgid "" " # 'File not found' error message.\n" " print(\"Fichier non trouvé\")" msgstr "" +"try:\n" +" with open('/tmp/input.txt', 'r') as f:\n" +" ...\n" +"except OSError:\n" +" # 'File not found' error message.\n" +" print(\"Fichier non trouvé\")" -msgid "Side note: Python 3 also supports using Unicode characters in identifiers::" +msgid "" +"Side note: Python 3 also supports using Unicode characters in identifiers::" msgstr "" +"نکته جانبی: پایتون 3 همچنین از نویسه‌های یونیکد در شناسه‌ها پشتیبانی " +"می‌کند::" msgid "" "répertoire = \"/tmp/records.log\"\n" "with open(répertoire, \"w\") as f:\n" " f.write(\"test\\n\")" msgstr "" +"répertoire = \"/tmp/records.log\"\n" +"with open(répertoire, \"w\") as f:\n" +" f.write(\"test\\n\")" -msgid "If you can't enter a particular character in your editor or want to keep the source code ASCII-only for some reason, you can also use escape sequences in string literals. (Depending on your system, you may see the actual capital-delta glyph instead of a \\u escape.) ::" +msgid "" +"If you can't enter a particular character in your editor or want to keep the" +" source code ASCII-only for some reason, you can also use escape sequences " +"in string literals. (Depending on your system, you may see the actual " +"capital-delta glyph instead of a \\u escape.) ::" msgstr "" +"اگر نمی‌توانید نویسه خاصی را در ویرایشگر خود وارد کنید یا به هر دلیلی " +"می‌خواهید کد منبع فقط ASCII باقی بماند، می‌توانید از دنباله‌های خنثی‌سازی در" +" رشته‌نوشته‌ها استفاده کنید. (بسته به سامانه شما، ممکن است به جای یک دنباله " +"خنثی‌سازی \\u، نگاشتک واقعی دلتای بزرگ را ببینید.) ::" msgid "" ">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" @@ -203,12 +466,37 @@ msgid "" ">>> \"\\U00000394\" # Using a 32-bit hex value\n" "'\\u0394'" msgstr "" +">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" +"'\\u0394'\n" +">>> \"\\u0394\" # Using a 16-bit hex value\n" +"'\\u0394'\n" +">>> \"\\U00000394\" # Using a 32-bit hex value\n" +"'\\u0394'" -msgid "In addition, one can create a string using the :func:`~bytes.decode` method of :class:`bytes`. This method takes an *encoding* argument, such as ``UTF-8``, and optionally an *errors* argument." +msgid "" +"In addition, one can create a string using the :func:`~bytes.decode` method " +"of :class:`bytes`. This method takes an *encoding* argument, such as " +"``UTF-8``, and optionally an *errors* argument." msgstr "" +"علاوه بر این، می‌توانید با استفاده از متد :func:`~bytes.decode` کلاس " +":class:`bytes` یک رشته ایجاد کنید. این متد یک آرگومان *encoding*، مانند " +"``UTF-8``، و به‌اختیار یک آرگومان *errors* می‌گیرد." -msgid "The *errors* argument specifies the response when the input string can't be converted according to the encoding's rules. Legal values for this argument are ``'strict'`` (raise a :exc:`UnicodeDecodeError` exception), ``'replace'`` (use ``U+FFFD``, ``REPLACEMENT CHARACTER``), ``'ignore'`` (just leave the character out of the Unicode result), or ``'backslashreplace'`` (inserts a ``\\xNN`` escape sequence). The following examples show the differences::" -msgstr "" +msgid "" +"The *errors* argument specifies the response when the input string can't be " +"converted according to the encoding's rules. Legal values for this argument" +" are ``'strict'`` (raise a :exc:`UnicodeDecodeError` exception), " +"``'replace'`` (use ``U+FFFD``, ``REPLACEMENT CHARACTER``), ``'ignore'`` " +"(just leave the character out of the Unicode result), or " +"``'backslashreplace'`` (inserts a ``\\xNN`` escape sequence). The following " +"examples show the differences::" +msgstr "" +"آرگومان *errors* پاسخ را زمانی که رشته ورودی نمی‌تواند بر اساس قواعد کدگذاری" +" تبدیل شود، مشخص می‌کند. مقادیر مجاز برای این آرگومان عبارت‌اند از " +"``'strict'`` (پرتاب استثنای :exc:`UnicodeDecodeError`)، ``'replace'`` " +"(استفاده از ``U+FFFD``، ``REPLACEMENT CHARACTER``)، ``'ignore'`` (فقط نویسه " +"را از نتیجه‌ی یونیکد حذف می‌کند)، یا ``'backslashreplace'`` (یک دنباله‌ی " +"خنثی‌سازی ``\\xNN`` درج می‌کند). مثال‌های زیر تفاوت‌ها را نشان می‌دهند::" msgid "" ">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" @@ -223,12 +511,42 @@ msgid "" ">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" "'abc'" msgstr "" +">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" +" invalid start byte\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"replace\")\n" +"'\\ufffdabc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"backslashreplace\")\n" +"'\\\\x80abc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" +"'abc'" -msgid "Encodings are specified as strings containing the encoding's name. Python comes with roughly 100 different encodings; see the Python Library Reference at :ref:`standard-encodings` for a list. Some encodings have multiple names; for example, ``'latin-1'``, ``'iso_8859_1'`` and ``'8859``' are all synonyms for the same encoding." -msgstr "" +msgid "" +"Encodings are specified as strings containing the encoding's name. Python " +"comes with roughly 100 different encodings; see the Python Library Reference" +" at :ref:`standard-encodings` for a list. Some encodings have multiple " +"names; for example, ``'latin-1'``, ``'iso_8859_1'`` and ``'8859``' are all " +"synonyms for the same encoding." +msgstr "" +"کدگذاری‌ها به‌صورت رشته‌هایی شامل نام کدگذاری مشخص می‌شوند. پایتون دارای " +"حدود ۱۰۰ کدگذاری مختلف است؛ برای دیدن فهرست آن‌ها به مرجع کتابخانه پایتون در" +" :ref:`standard-encodings` مراجعه کنید. برخی کدگذاری‌ها چندین نام دارند؛ " +"برای مثال، ``'latin-1'``، ``'iso_8859_1'`` و ``'8859``' همه نام‌های مترادف " +"برای یک کدگذاری هستند." -msgid "One-character Unicode strings can also be created with the :func:`chr` built-in function, which takes integers and returns a Unicode string of length 1 that contains the corresponding code point. The reverse operation is the built-in :func:`ord` function that takes a one-character Unicode string and returns the code point value::" +msgid "" +"One-character Unicode strings can also be created with the :func:`chr` " +"built-in function, which takes integers and returns a Unicode string of " +"length 1 that contains the corresponding code point. The reverse operation " +"is the built-in :func:`ord` function that takes a one-character Unicode " +"string and returns the code point value::" msgstr "" +"رشته‌های یونیکد تک‌نویسه‌ای را همچنین می‌توان با تابع توکار :func:`chr` " +"ایجاد کرد، که اعداد صحیح را می‌گیرد و رشته‌ای یونیکد به طول ۱ برمی‌گرداند " +"که حاوی نقطه کد متناظر است. عملیات معکوس، تابع توکار :func:`ord` است که یک " +"رشته یونیکد تک‌نویسه‌ای را می‌گیرد و مقدار نقطه کد را برمی‌گرداند::" msgid "" ">>> chr(57344)\n" @@ -236,18 +554,42 @@ msgid "" ">>> ord('\\ue000')\n" "57344" msgstr "" +">>> chr(57344)\n" +"'\\ue000'\n" +">>> ord('\\ue000')\n" +"57344" msgid "Converting to Bytes" -msgstr "" +msgstr "تبدیل به بایت" -msgid "The opposite method of :meth:`bytes.decode` is :meth:`str.encode`, which returns a :class:`bytes` representation of the Unicode string, encoded in the requested *encoding*." +msgid "" +"The opposite method of :meth:`bytes.decode` is :meth:`str.encode`, which " +"returns a :class:`bytes` representation of the Unicode string, encoded in " +"the requested *encoding*." msgstr "" +"متد معکوس :meth:`bytes.decode`، :meth:`str.encode` است که یک بازنمایی " +":class:`bytes` از رشته یونیکد را برمی‌گرداند؛ این بازنمایی با *کدگذاری* " +"درخواستی کدگذاری شده است." -msgid "The *errors* parameter is the same as the parameter of the :meth:`~bytes.decode` method but supports a few more possible handlers. As well as ``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case inserts a question mark instead of the unencodable character), there is also ``'xmlcharrefreplace'`` (inserts an XML character reference), ``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and ``namereplace`` (inserts a ``\\N{...}`` escape sequence)." -msgstr "" +msgid "" +"The *errors* parameter is the same as the parameter of the " +":meth:`~bytes.decode` method but supports a few more possible handlers. As " +"well as ``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case " +"inserts a question mark instead of the unencodable character), there is also" +" ``'xmlcharrefreplace'`` (inserts an XML character reference), " +"``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and " +"``namereplace`` (inserts a ``\\N{...}`` escape sequence)." +msgstr "" +"پارامتر *errors* همان پارامتر متد :meth:`~bytes.decode` است، اما از چند مدیر" +" ممکن دیگر نیز پشتیبانی می‌کند. علاوه بر ``'strict'``، ``'ignore'`` و " +"``'replace'`` (که در این حالت به‌جای نویسه غیرقابل کدگذاری، یک علامت سؤال " +"درج می‌کند)، ``'xmlcharrefreplace'`` (که یک ارجاع نویسه XML درج می‌کند)، " +"``backslashreplace`` (که یک دنباله خنثی‌سازی ``\\uNNNN`` درج می‌کند) و " +"``namereplace`` (که یک دنباله خنثی‌سازی ``\\N{...}`` درج می‌کند) نیز وجود " +"دارند." msgid "The following example shows the different results::" -msgstr "" +msgstr "مثال زیر نتایج متفاوت را نشان می‌دهد::" msgid "" ">>> u = chr(40960) + 'abcd' + chr(1972)\n" @@ -269,15 +611,52 @@ msgid "" ">>> u.encode('ascii', 'namereplace')\n" "b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" msgstr "" +">>> u = chr(40960) + 'abcd' + chr(1972)\n" +">>> u.encode('utf-8')\n" +"b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" +">>> u.encode('ascii')\n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" +" position 0: ordinal not in range(128)\n" +">>> u.encode('ascii', 'ignore')\n" +"b'abcd'\n" +">>> u.encode('ascii', 'replace')\n" +"b'?abcd?'\n" +">>> u.encode('ascii', 'xmlcharrefreplace')\n" +"b'ꀀabcd޴'\n" +">>> u.encode('ascii', 'backslashreplace')\n" +"b'\\\\ua000abcd\\\\u07b4'\n" +">>> u.encode('ascii', 'namereplace')\n" +"b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" -msgid "The low-level routines for registering and accessing the available encodings are found in the :mod:`codecs` module. Implementing new encodings also requires understanding the :mod:`codecs` module. However, the encoding and decoding functions returned by this module are usually more low-level than is comfortable, and writing new encodings is a specialized task, so the module won't be covered in this HOWTO." -msgstr "" +msgid "" +"The low-level routines for registering and accessing the available encodings" +" are found in the :mod:`codecs` module. Implementing new encodings also " +"requires understanding the :mod:`codecs` module. However, the encoding and " +"decoding functions returned by this module are usually more low-level than " +"is comfortable, and writing new encodings is a specialized task, so the " +"module won't be covered in this HOWTO." +msgstr "" +"روال‌های سطح پایین برای ثبت و دسترسی به کدگذاری‌های موجود در ماژول " +":mod:`codecs` قرار دارند. پیاده‌سازی کدگذاری‌های جدید نیز نیازمند درک ماژول " +":mod:`codecs` است. با این حال، توابع کدگذاری و کدگشایی که این ماژول " +"برمی‌گرداند معمولاً سطح پایین‌تری از حد راحت دارند و نوشتن کدگذاری‌های جدید " +"وظیفه‌ای تخصصی است، بنابراین این ماژول در این راهنمای عملی پوشش داده نخواهد شد." msgid "Unicode Literals in Python Source Code" -msgstr "" +msgstr "مقادیر لفظی یونیکد در کد منبع پایتون" -msgid "In Python source code, specific Unicode code points can be written using the ``\\u`` escape sequence, which is followed by four hex digits giving the code point. The ``\\U`` escape sequence is similar, but expects eight hex digits, not four::" +msgid "" +"In Python source code, specific Unicode code points can be written using the" +" ``\\u`` escape sequence, which is followed by four hex digits giving the " +"code point. The ``\\U`` escape sequence is similar, but expects eight hex " +"digits, not four::" msgstr "" +"در کد منبع پایتون، نقاط کد مشخص یونیکد را می‌توان با استفاده از دنباله‌ی " +"خنثی‌سازی ``\\u`` نوشت که پس از آن ۴ رقم مبنای شانزده می‌آید و نقطه‌کد را " +"مشخص می‌کند. دنباله‌ی خنثی‌سازی ``\\U`` مشابه است، اما به ۸ رقم مبنای شانزده" +" نیاز دارد، نه ۴::" msgid "" ">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" @@ -287,15 +666,48 @@ msgid "" ">>> [ord(c) for c in s]\n" "[97, 172, 4660, 8364, 32768]" msgstr "" +">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" +"... # ^^^^ two-digit hex escape\n" +"... # ^^^^^^ four-digit Unicode escape\n" +"... # ^^^^^^^^^^ eight-digit Unicode escape\n" +">>> [ord(c) for c in s]\n" +"[97, 172, 4660, 8364, 32768]" -msgid "Using escape sequences for code points greater than 127 is fine in small doses, but becomes an annoyance if you're using many accented characters, as you would in a program with messages in French or some other accent-using language. You can also assemble strings using the :func:`chr` built-in function, but this is even more tedious." -msgstr "" +msgid "" +"Using escape sequences for code points greater than 127 is fine in small " +"doses, but becomes an annoyance if you're using many accented characters, as" +" you would in a program with messages in French or some other accent-using " +"language. You can also assemble strings using the :func:`chr` built-in " +"function, but this is even more tedious." +msgstr "" +"استفاده از دنباله‌های خنثی‌سازی برای نقاط کد بزرگ‌تر از ۱۲۷ در مقادیر کم " +"مشکلی ندارد، اما اگر از نویسه‌های لهجه‌دار زیادی استفاده کنید، آزاردهنده " +"می‌شود؛ همان‌طور که در برنامه‌ای با پیام‌هایی به فرانسوی یا زبان دیگری که از" +" علامت‌های تلفظی استفاده می‌کند، چنین خواهد بود. همچنین می‌توانید رشته‌ها را" +" با استفاده از تابع توکار :func:`chr` بسازید، اما این کار حتی خسته‌کننده‌تر " +"است." -msgid "Ideally, you'd want to be able to write literals in your language's natural encoding. You could then edit Python source code with your favorite editor which would display the accented characters naturally, and have the right characters used at runtime." +msgid "" +"Ideally, you'd want to be able to write literals in your language's natural " +"encoding. You could then edit Python source code with your favorite editor " +"which would display the accented characters naturally, and have the right " +"characters used at runtime." msgstr "" +"در حالت ایده‌آل، شما مایلید بتوانید مقادیر لفظی (literals) را با کدگذاری طبیعی" +" زبان خود بنویسید. سپس می‌توانید کد منبع پایتون را با ویرایشگر دلخواه خود " +"ویرایش کنید، به‌طوری که این ویرایشگر نویسه‌های دارای علامت تلفظ را به‌صورت " +"طبیعی نمایش می‌دهد و در ران‌تایم از نویسه‌های درست استفاده می‌شود." -msgid "Python supports writing source code in UTF-8 by default, but you can use almost any encoding if you declare the encoding being used. This is done by including a special comment as either the first or second line of the source file::" +msgid "" +"Python supports writing source code in UTF-8 by default, but you can use " +"almost any encoding if you declare the encoding being used. This is done by" +" including a special comment as either the first or second line of the " +"source file::" msgstr "" +"پایتون به‌طور پیش‌فرض از نوشتن کد منبع به‌صورت UTF-8 پشتیبانی می‌کند، اما " +"اگر کدگذاری استفاده‌شده را اعلام کنید، می‌توانید تقریباً از هر کدگذاری " +"استفاده کنید. این کار با قرار دادن یک کامنت ویژه به‌عنوان خط اول یا دوم فایل" +" منبع انجام می‌شود::" msgid "" "#!/usr/bin/env python\n" @@ -304,21 +716,55 @@ msgid "" "u = 'abcdé'\n" "print(ord(u[-1]))" msgstr "" +"#!/usr/bin/env python\n" +"# -*- coding: latin-1 -*-\n" +"\n" +"u = 'abcdé'\n" +"print(ord(u[-1]))" -msgid "The syntax is inspired by Emacs's notation for specifying variables local to a file. Emacs supports many different variables, but Python only supports 'coding'. The ``-*-`` symbols indicate to Emacs that the comment is special; they have no significance to Python but are a convention. Python looks for ``coding: name`` or ``coding=name`` in the comment." -msgstr "" +msgid "" +"The syntax is inspired by Emacs's notation for specifying variables local to" +" a file. Emacs supports many different variables, but Python only supports " +"'coding'. The ``-*-`` symbols indicate to Emacs that the comment is " +"special; they have no significance to Python but are a convention. Python " +"looks for ``coding: name`` or ``coding=name`` in the comment." +msgstr "" +"این نحو از نمادگذاری Emacs برای مشخص کردن متغیرهای محلی یک فایل الهام " +"گرفته است. Emacs از متغیرهای مختلفی پشتیبانی می‌کند، اما Python فقط از " +"'coding' پشتیبانی می‌کند. نمادهای ``-*-`` به Emacs نشان می‌دهند که آن کامنت " +"ویژه است؛ این نمادها برای Python هیچ معنایی ندارند، اما یک قرارداد هستند. " +"Python در کامنت به دنبال ``coding: name`` یا ``coding=name`` می‌گردد." -msgid "If you don't include such a comment, the default encoding used will be UTF-8 as already mentioned. See also :pep:`263` for more information." +msgid "" +"If you don't include such a comment, the default encoding used will be UTF-8" +" as already mentioned. See also :pep:`263` for more information." msgstr "" +"اگر چنین کامنتی را وارد نکنید، همان‌طور که پیش‌تر ذکر شد، کدگذاری پیش‌فرض " +"به‌کاررفته UTF-8 خواهد بود. برای اطلاعات بیشتر، :pep:`263` را نیز ببینید." msgid "Unicode Properties" -msgstr "" +msgstr "ویژگی‌های یونیکد" -msgid "The Unicode specification includes a database of information about code points. For each defined code point, the information includes the character's name, its category, the numeric value if applicable (for characters representing numeric concepts such as the Roman numerals, fractions such as one-third and four-fifths, etc.). There are also display-related properties, such as how to use the code point in bidirectional text." -msgstr "" +msgid "" +"The Unicode specification includes a database of information about code " +"points. For each defined code point, the information includes the " +"character's name, its category, the numeric value if applicable (for " +"characters representing numeric concepts such as the Roman numerals, " +"fractions such as one-third and four-fifths, etc.). There are also display-" +"related properties, such as how to use the code point in bidirectional text." +msgstr "" +"مشخصات یونیکد شامل پایگاه داده‌ای از اطلاعات درباره نقاط کد است. برای هر " +"نقطه‌کد تعریف‌شده، این اطلاعات شامل نام نویسه، دسته‌ی آن، و مقدار عددی در " +"صورت وجود (برای نویسه‌هایی که مفاهیم عددی را نشان می‌دهند، مانند اعداد رومی،" +" کسرهایی مانند یک‌سوم و چهارپنجم و غیره) است. همچنین ویژگی‌های مربوط به " +"نمایش نیز وجود دارند، مانند چگونگی استفاده از نقطه‌کد در متن دوجهته." -msgid "The following program displays some information about several characters, and prints the numeric value of one particular character::" +msgid "" +"The following program displays some information about several characters, " +"and prints the numeric value of one particular character::" msgstr "" +"برنامه زیر اطلاعاتی درباره‌ی چند نویسه نمایش می‌دهد و مقدار عددی یک نویسه خاص" +" را چاپ می‌کند::" msgid "" "import unicodedata\n" @@ -332,9 +778,19 @@ msgid "" "# Get numeric value of second character\n" "print(unicodedata.numeric(u[1]))" msgstr "" +"import unicodedata\n" +"\n" +"u = chr(233) + chr(0x0bf2) + chr(3972) + chr(6000) + chr(13231)\n" +"\n" +"for i, c in enumerate(u):\n" +" print(i, '%04x' % ord(c), unicodedata.category(c), end=\" \")\n" +" print(unicodedata.name(c))\n" +"\n" +"# دریافت مقدار عددی نویسه دوم\n" +"print(unicodedata.numeric(u[1]))" msgid "When run, this prints:" -msgstr "" +msgstr "هنگام اجرا، این چاپ می‌شود:" msgid "" "0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" @@ -344,27 +800,88 @@ msgid "" "4 33af So SQUARE RAD OVER S SQUARED\n" "1000.0" msgstr "" +"0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" +"1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" +"2 0f84 Mn TIBETAN MARK HALANTA\n" +"3 1770 Lo TAGBANWA LETTER SA\n" +"4 33af So SQUARE RAD OVER S SQUARED\n" +"1000.0" -msgid "The category codes are abbreviations describing the nature of the character. These are grouped into categories such as \"Letter\", \"Number\", \"Punctuation\", or \"Symbol\", which in turn are broken up into subcategories. To take the codes from the above output, ``'Ll'`` means 'Letter, lowercase', ``'No'`` means \"Number, other\", ``'Mn'`` is \"Mark, nonspacing\", and ``'So'`` is \"Symbol, other\". See `the General Category Values section of the Unicode Character Database documentation `_ for a list of category codes." -msgstr "" +msgid "" +"The category codes are abbreviations describing the nature of the character." +" These are grouped into categories such as \"Letter\", \"Number\", " +"\"Punctuation\", or \"Symbol\", which in turn are broken up into " +"subcategories. To take the codes from the above output, ``'Ll'`` means " +"'Letter, lowercase', ``'No'`` means \"Number, other\", ``'Mn'`` is \"Mark, " +"nonspacing\", and ``'So'`` is \"Symbol, other\". See `the General Category " +"Values section of the Unicode Character Database documentation " +"`_ for a list" +" of category codes." +msgstr "" +"کدهای دسته، مخفف‌هایی هستند که ماهیت نویسه را توصیف می‌کنند. این کدها در " +"دسته‌هایی مانند «حرف (Letter)»، «عدد (Number)»، «نمادگذاری (Punctuation)» " +"یا «نماد (Symbol)» گروه‌بندی می‌شوند و این دسته‌ها خود به زیردسته‌هایی تقسیم" +" می‌شوند. با در نظر گرفتن کدهای خروجی بالا، ``'Ll'`` به معنای «حرف، کوچک " +"(Letter, lowercase)»، ``'No'`` به معنای «عدد، دیگر (Number, other)»، " +"``'Mn'`` به معنای «علامت، بدون فاصله (Mark, nonspacing)» و ``'So'`` به معنای" +" «نماد، دیگر (Symbol, other)» است. برای مشاهده‌ی فهرستی از کدهای دسته، `بخش " +"General Category Values در مستندات Unicode Character Database " +"`_ را ببینید." msgid "Comparing Strings" -msgstr "" +msgstr "مقایسه رشته‌ها" -msgid "Unicode adds some complication to comparing strings, because the same set of characters can be represented by different sequences of code points. For example, a letter like 'ê' can be represented as a single code point U+00EA, or as U+0065 U+0302, which is the code point for 'e' followed by a code point for 'COMBINING CIRCUMFLEX ACCENT'. These will produce the same output when printed, but one is a string of length 1 and the other is of length 2." -msgstr "" +msgid "" +"Unicode adds some complication to comparing strings, because the same set of" +" characters can be represented by different sequences of code points. For " +"example, a letter like 'ê' can be represented as a single code point U+00EA," +" or as U+0065 U+0302, which is the code point for 'e' followed by a code " +"point for 'COMBINING CIRCUMFLEX ACCENT'. These will produce the same output" +" when printed, but one is a string of length 1 and the other is of length 2." +msgstr "" +"یونیکد مقایسه‌ی رشته‌ها را تا حدی پیچیده می‌کند، زیرا مجموعه‌ی یکسانی از " +"نویسه‌ها می‌تواند با دنباله‌های متفاوتی از نقطه‌کدها (code points) نمایش " +"داده شود. برای مثال، نویسه‌ای مانند 'ê' می‌تواند به‌صورت یک نقطه‌کد U+00EA، " +"یا به‌صورت U+0065 U+0302 نمایش داده شود، یعنی نقطه‌کدِ 'e' که پس از آن " +"نقطه‌کدی برای 'COMBINING CIRCUMFLEX ACCENT' می‌آید. این دو هنگام چاپ خروجی " +"یکسانی تولید می‌کنند، اما یکی رشته‌ای به طول ۱ و دیگری رشته‌ای به طول ۲ است." -msgid "One tool for a case-insensitive comparison is the :meth:`~str.casefold` string method that converts a string to a case-insensitive form following an algorithm described by the Unicode Standard. This algorithm has special handling for characters such as the German letter 'ß' (code point U+00DF), which becomes the pair of lowercase letters 'ss'." -msgstr "" +msgid "" +"One tool for a case-insensitive comparison is the :meth:`~str.casefold` " +"string method that converts a string to a case-insensitive form following an" +" algorithm described by the Unicode Standard. This algorithm has special " +"handling for characters such as the German letter 'ß' (code point U+00DF), " +"which becomes the pair of lowercase letters 'ss'." +msgstr "" +"یکی از ابزارها برای مقایسه‌ی بدون حساسیت به بزرگی و کوچکی حروف، متد رشته‌ای " +":meth:`~str.casefold` است که رشته را با پیروی از الگوریتمی توصیف‌شده در " +"استاندارد یونیکد به شکلی بدون حساسیت به بزرگی و کوچکی حروف تبدیل می‌کند. " +"این الگوریتم برای نویسه‌هایی مانند حرف آلمانی 'ß' (نقطه کد U+00DF) که به جفت" +" حرف کوچک 'ss' تبدیل می‌شود، برخورد ویژه‌ای دارد." msgid "" ">>> street = 'Gürzenichstraße'\n" ">>> street.casefold()\n" "'gürzenichstrasse'" msgstr "" +">>> street = 'Gürzenichstraße'\n" +">>> street.casefold()\n" +"'gürzenichstrasse'" -msgid "A second tool is the :mod:`unicodedata` module's :func:`~unicodedata.normalize` function that converts strings to one of several normal forms, where letters followed by a combining character are replaced with single characters. :func:`~unicodedata.normalize` can be used to perform string comparisons that won't falsely report inequality if two strings use combining characters differently:" -msgstr "" +msgid "" +"A second tool is the :mod:`unicodedata` module's " +":func:`~unicodedata.normalize` function that converts strings to one of " +"several normal forms, where letters followed by a combining character are " +"replaced with single characters. :func:`~unicodedata.normalize` can be used" +" to perform string comparisons that won't falsely report inequality if two " +"strings use combining characters differently:" +msgstr "" +"ابزار دوم، تابع :func:`~unicodedata.normalize` در ماژول :mod:`unicodedata` " +"است که رشته‌ها را به یکی از چند صورت نرمال تبدیل می‌کند؛ در این صورت‌های " +"نرمال، حروفی که پس از آن‌ها یک نویسه ترکیبی آمده است با نویسه‌های تکی " +"جایگزین می‌شوند. می‌توان از :func:`~unicodedata.normalize` برای انجام " +"مقایسه‌ی رشته‌ها استفاده کرد تا اگر دو رشته به‌شکل متفاوتی از نویسه‌های " +"ترکیبی استفاده می‌کنند، نابرابری به‌اشتباه گزارش نشود:" msgid "" "import unicodedata\n" @@ -381,9 +898,22 @@ msgid "" "print('length of second string=', len(multiple_chars))\n" "print(compare_strs(single_char, multiple_chars))" msgstr "" +"import unicodedata\n" +"\n" +"def compare_strs(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(s1) == NFD(s2)\n" +"\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN SMALL LETTER E}\\N{COMBINING CIRCUMFLEX ACCENT}'\n" +"print('length of first string=', len(single_char))\n" +"print('length of second string=', len(multiple_chars))\n" +"print(compare_strs(single_char, multiple_chars))" msgid "When run, this outputs:" -msgstr "" +msgstr "هنگام اجرا، این خروجی را می‌دهد:" msgid "" "$ python compare-strs.py\n" @@ -391,12 +921,24 @@ msgid "" "length of second string= 2\n" "True" msgstr "" +"$ python compare-strs.py\n" +"length of first string= 1\n" +"length of second string= 2\n" +"True" -msgid "The first argument to the :func:`~unicodedata.normalize` function is a string giving the desired normalization form, which can be one of 'NFC', 'NFKC', 'NFD', and 'NFKD'." +msgid "" +"The first argument to the :func:`~unicodedata.normalize` function is a " +"string giving the desired normalization form, which can be one of 'NFC', " +"'NFKC', 'NFD', and 'NFKD'." msgstr "" +"اولین آرگومان تابع :func:`~unicodedata.normalize` رشته‌ای است که فرم " +"نرمال‌سازی مورد نظر را مشخص می‌کند و می‌تواند یکی از 'NFC'، 'NFKC'، 'NFD' و " +"'NFKD' باشد." msgid "The Unicode Standard also specifies how to do caseless comparisons::" msgstr "" +"استاندارد یونیکد همچنین چگونگی انجام مقایسه‌های بدون حساسیت به بزرگی و کوچکی" +" حروف را مشخص می‌کند::" msgid "" "import unicodedata\n" @@ -413,18 +955,54 @@ msgid "" "\n" "print(compare_caseless(single_char, multiple_chars))" msgstr "" +"import unicodedata\n" +"\n" +"def compare_caseless(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(NFD(s1).casefold()) == NFD(NFD(s2).casefold())\n" +"\n" +"# Example usage\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN CAPITAL LETTER E}\\N{COMBINING CIRCUMFLEX ACCENT}'\n" +"\n" +"print(compare_caseless(single_char, multiple_chars))" -msgid "This will print ``True``. (Why is :func:`!NFD` invoked twice? Because there are a few characters that make :meth:`~str.casefold` return a non-normalized string, so the result needs to be normalized again. See section 3.13 of the Unicode Standard for a discussion and an example.)" +msgid "" +"This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " +"there are a few characters that make :meth:`~str.casefold` return a non-" +"normalized string, so the result needs to be normalized again. See section " +"3.13 of the Unicode Standard for a discussion and an example.)" msgstr "" +"این ``True`` را چاپ می‌کند. (چرا :func:`!NFD` دو بار فراخوانی می‌شود؟ زیرا " +"چند نویسه باعث می‌شوند :meth:`~str.casefold` یک رشته‌ی غیرنرمال را " +"بازگرداند، بنابراین نتیجه باید دوباره نرمال‌سازی شود. برای توضیح و یک نمونه،" +" بخش 3.13 استاندارد یونیکد را ببینید.)" msgid "Unicode Regular Expressions" -msgstr "" +msgstr "عبارت‌های باقاعده یونیکد" -msgid "The regular expressions supported by the :mod:`re` module can be provided either as bytes or strings. Some of the special character sequences such as ``\\d`` and ``\\w`` have different meanings depending on whether the pattern is supplied as bytes or a string. For example, ``\\d`` will match the characters ``[0-9]`` in bytes but in strings will match any character that's in the ``'Nd'`` category." -msgstr "" +msgid "" +"The regular expressions supported by the :mod:`re` module can be provided " +"either as bytes or strings. Some of the special character sequences such as" +" ``\\d`` and ``\\w`` have different meanings depending on whether the " +"pattern is supplied as bytes or a string. For example, ``\\d`` will match " +"the characters ``[0-9]`` in bytes but in strings will match any character " +"that's in the ``'Nd'`` category." +msgstr "" +"عبارت‌های باقاعده پشتیبانی‌شده توسط ماژول :mod:`re` را می‌توان به‌صورت بایت " +"یا رشته ارائه کرد. برخی از دنباله‌های نویسه‌ای خاص مانند ``\\d`` و ``\\w`` " +"معانی متفاوتی دارند، بسته به اینکه الگو به‌صورت بایت یا رشته ارائه شود. برای" +" مثال، ``\\d`` در بایت‌ها با نویسه‌های ``[0-9]`` مطابقت می‌کند، اما در " +"رشته‌ها با هر نویسه‌ای که در دسته ``'Nd'`` باشد مطابقت می‌کند." -msgid "The string in this example has the number 57 written in both Thai and Arabic numerals::" +msgid "" +"The string in this example has the number 57 written in both Thai and Arabic" +" numerals::" msgstr "" +"در این مثال، عدد ۵۷ در رشته هم با ارقام تایلندی و هم با ارقام عربی نوشته شده" +" است::" msgid "" "import re\n" @@ -434,63 +1012,177 @@ msgid "" "m = p.search(s)\n" "print(repr(m.group()))" msgstr "" +"import re\n" +"p = re.compile(r'\\d+')\n" +"\n" +"s = \"Over \\u0e55\\u0e57 57 flavours\"\n" +"m = p.search(s)\n" +"print(repr(m.group()))" -msgid "When executed, ``\\d+`` will match the Thai numerals and print them out. If you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will match the substring \"57\" instead." +msgid "" +"When executed, ``\\d+`` will match the Thai numerals and print them out. If" +" you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will" +" match the substring \"57\" instead." msgstr "" +"هنگام اجرا، ``\\d+`` با ارقام تایلندی تطابق پیدا می‌کند و آن‌ها را چاپ " +"می‌کند. اگر پرچم :const:`re.ASCII` را به :func:`~re.compile` بدهید، ``\\d+``" +" در عوض با زیررشته‌ی «57» تطابق پیدا می‌کند." -msgid "Similarly, ``\\w`` matches a wide variety of Unicode characters but only ``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." +msgid "" +"Similarly, ``\\w`` matches a wide variety of Unicode characters but only " +"``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` " +"will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." msgstr "" +"به‌طور مشابه، ``\\w`` با طیف وسیعی از نویسه‌های یونیکد مطابقت می‌کند، اما " +"در بایت‌ها یا اگر :const:`re.ASCII` ارائه شده باشد، فقط با ``[a-zA-Z0-9_]`` " +"مطابقت می‌کند، و ``\\s`` با نویسه‌های فضای سفید یونیکد یا ``[ " +"\\t\\n\\r\\f\\v]`` مطابقت خواهد کرد." msgid "Some good alternative discussions of Python's Unicode support are:" msgstr "" +"برخی بحث‌های جایگزین خوب درباره‌ی پشتیبانی پایتون از یونیکد عبارتند از:" -msgid "`Processing Text Files in Python 3 `_, by Nick Coghlan." +msgid "" +"`Processing Text Files in Python 3 `_, " +"by Nick Coghlan." msgstr "" +"`پردازش فایل‌های متنی در پایتون 3 `_، " +"اثر Nick Coghlan." -msgid "`Pragmatic Unicode `_, a PyCon 2012 presentation by Ned Batchelder." +msgid "" +"`Pragmatic Unicode `_, a PyCon " +"2012 presentation by Ned Batchelder." msgstr "" +"`Pragmatic Unicode `_، ارائه‌ای" +" از Ned Batchelder در PyCon ۲۰۱۲." -msgid "The :class:`str` type is described in the Python library reference at :ref:`textseq`." +msgid "" +"The :class:`str` type is described in the Python library reference at " +":ref:`textseq`." msgstr "" +"نوع :class:`str` در مرجع کتابخانه‌ی پایتون، در :ref:`textseq` شرح داده شده " +"است." msgid "The documentation for the :mod:`unicodedata` module." -msgstr "" +msgstr "مستندات ماژول :mod:`unicodedata`." msgid "The documentation for the :mod:`codecs` module." -msgstr "" +msgstr "مستندات ماژول :mod:`codecs`." -msgid "Marc-André Lemburg gave `a presentation titled \"Python and Unicode\" (PDF slides) `_ at EuroPython 2002. The slides are an excellent overview of the design of Python 2's Unicode features (where the Unicode string type is called ``unicode`` and literals start with ``u``)." -msgstr "" +msgid "" +"Marc-André Lemburg gave `a presentation titled \"Python and Unicode\" (PDF " +"slides) `_ at " +"EuroPython 2002. The slides are an excellent overview of the design of " +"Python 2's Unicode features (where the Unicode string type is called " +"``unicode`` and literals start with ``u``)." +msgstr "" +"مارک آندره لمبورگ در EuroPython 2002 `ارائه‌ای با عنوان «Python and Unicode»" +" (اسلایدهای PDF) `_ داشت. این اسلایدها مروری عالی بر طراحی قابلیت‌های " +"یونیکد Python 2 است (که در آن نوع رشته یونیکد ``unicode`` نامیده می‌شود و " +"لفظ‌ها با ``u`` شروع می‌شوند)." msgid "Reading and Writing Unicode Data" -msgstr "" +msgstr "خواندن و نوشتن داده‌های یونیکد" -msgid "Once you've written some code that works with Unicode data, the next problem is input/output. How do you get Unicode strings into your program, and how do you convert Unicode into a form suitable for storage or transmission?" +msgid "" +"Once you've written some code that works with Unicode data, the next problem" +" is input/output. How do you get Unicode strings into your program, and how" +" do you convert Unicode into a form suitable for storage or transmission?" msgstr "" +"پس از اینکه کدی نوشتید که با داده‌های یونیکد کار می‌کند، مسئله‌ی بعدی " +"ورودی/خروجی است. چگونه رشته‌های یونیکد را وارد برنامه‌تان کنید، و چگونه " +"یونیکد را به شکلی مناسب برای ذخیره‌سازی یا انتقال تبدیل کنید؟" -msgid "It's possible that you may not need to do anything depending on your input sources and output destinations; you should check whether the libraries used in your application support Unicode natively. XML parsers often return Unicode data, for example. Many relational databases also support Unicode-valued columns and can return Unicode values from an SQL query." -msgstr "" +msgid "" +"It's possible that you may not need to do anything depending on your input " +"sources and output destinations; you should check whether the libraries used" +" in your application support Unicode natively. XML parsers often return " +"Unicode data, for example. Many relational databases also support Unicode-" +"valued columns and can return Unicode values from an SQL query." +msgstr "" +"ممکن است بسته به منابع ورودی و مقاصد خروجی خود نیازی به انجام هیچ کاری " +"نداشته باشید؛ باید بررسی کنید که آیا کتابخانه‌های استفاده‌شده در برنامه شما " +"به‌صورت بومی از یونیکد (Unicode) پشتیبانی می‌کنند یا خیر. برای مثال، " +"پارسرهای XML اغلب داده‌های یونیکد را برمی‌گردانند. بسیاری از " +"پایگاه‌های داده رابطه‌ای نیز از ستون‌هایی با مقادیر یونیکد پشتیبانی می‌کنند " +"و می‌توانند مقادیر یونیکد را از یک پرس‌وجوی SQL برگردانند." -msgid "Unicode data is usually converted to a particular encoding before it gets written to disk or sent over a socket. It's possible to do all the work yourself: open a file, read an 8-bit bytes object from it, and convert the bytes with ``bytes.decode(encoding)``. However, the manual approach is not recommended." -msgstr "" +msgid "" +"Unicode data is usually converted to a particular encoding before it gets " +"written to disk or sent over a socket. It's possible to do all the work " +"yourself: open a file, read an 8-bit bytes object from it, and convert the " +"bytes with ``bytes.decode(encoding)``. However, the manual approach is not " +"recommended." +msgstr "" +"داده‌های یونیکد معمولاً پیش از آنکه روی دیسک نوشته شوند یا از طریق سوکت " +"ارسال شوند، به یک کدگذاری مشخص تبدیل می‌شوند. می‌توانید تمام این کارها را " +"خودتان انجام دهید: فایلی را باز کنید، یک شیء بایتی ۸‌بیتی از آن بخوانید و " +"بایت‌ها را با ``bytes.decode(encoding)`` تبدیل کنید. با این حال، روش دستی " +"توصیه نمی‌شود." -msgid "One problem is the multi-byte nature of encodings; one Unicode character can be represented by several bytes. If you want to read the file in arbitrary-sized chunks (say, 1024 or 4096 bytes), you need to write error-handling code to catch the case where only part of the bytes encoding a single Unicode character are read at the end of a chunk. One solution would be to read the entire file into memory and then perform the decoding, but that prevents you from working with files that are extremely large; if you need to read a 2 GiB file, you need 2 GiB of RAM. (More, really, since for at least a moment you'd need to have both the encoded string and its Unicode version in memory.)" -msgstr "" +msgid "" +"One problem is the multi-byte nature of encodings; one Unicode character can" +" be represented by several bytes. If you want to read the file in " +"arbitrary-sized chunks (say, 1024 or 4096 bytes), you need to write error-" +"handling code to catch the case where only part of the bytes encoding a " +"single Unicode character are read at the end of a chunk. One solution would" +" be to read the entire file into memory and then perform the decoding, but " +"that prevents you from working with files that are extremely large; if you " +"need to read a 2 GiB file, you need 2 GiB of RAM. (More, really, since for " +"at least a moment you'd need to have both the encoded string and its Unicode" +" version in memory.)" +msgstr "" +"یکی از مشکلات، ماهیت چندبایتی کدگذاری‌هاست؛ یک نویسه‌ی یونیکد می‌تواند با " +"چند بایت بازنمایی شود. اگر بخواهید پرونده را به‌صورت تکه‌هایی با اندازه‌ی " +"دلخواه (مثلاً ۱۰۲۴ یا ۴۰۹۶ بایت) بخوانید، باید کد مدیریت خطایی برای پوشش " +"حالتی بنویسید که در آن تنها بخشی از بایت‌هایی که یک نویسه‌ی یونیکد را " +"کدگذاری می‌کنند، در انتهای یک تکه خوانده می‌شود. یک راه‌حل می‌تواند این باشد" +" که کل پرونده را در حافظه بخوانید و سپس کدگشایی را انجام دهید، اما این کار " +"شما را از کار با پرونده‌های بسیار بزرگ بازمی‌دارد؛ اگر نیاز داشته باشید " +"پرونده‌ی ۲ GiB را بخوانید، به ۲ GiB حافظه‌ی RAM نیاز دارید. (در واقع بیشتر، " +"زیرا حداقل برای یک لحظه باید هم رشته‌ی کدگذاری‌شده و هم نسخه‌ی یونیکد آن را" +" در حافظه داشته باشید.)" -msgid "The solution would be to use the low-level decoding interface to catch the case of partial coding sequences. The work of implementing this has already been done for you: the built-in :func:`open` function can return a file-like object that assumes the file's contents are in a specified encoding and accepts Unicode parameters for methods such as :meth:`~io.TextIOBase.read` and :meth:`~io.TextIOBase.write`. This works through :func:`open`\\'s *encoding* and *errors* parameters which are interpreted just like those in :meth:`str.encode` and :meth:`bytes.decode`." -msgstr "" +msgid "" +"The solution would be to use the low-level decoding interface to catch the " +"case of partial coding sequences. The work of implementing this has already" +" been done for you: the built-in :func:`open` function can return a file-" +"like object that assumes the file's contents are in a specified encoding and" +" accepts Unicode parameters for methods such as :meth:`~io.TextIOBase.read` " +"and :meth:`~io.TextIOBase.write`. This works through :func:`open`\\'s " +"*encoding* and *errors* parameters which are interpreted just like those in " +":meth:`str.encode` and :meth:`bytes.decode`." +msgstr "" +"راه‌حل این است که از رابط کدگشایی سطح پایین برای تشخیص حالت دنباله‌های " +"کدگذاری ناقص استفاده شود. کار پیاده‌سازی این مورد قبلاً برای شما انجام شده " +"است: تابع توکار :func:`open` می‌تواند یک شیء فایل‌مانند برگرداند که فرض " +"می‌کند محتوای فایل در یک کدگذاری مشخص قرار دارد و پارامترهای یونیکد را برای " +"متدهایی مانند :meth:`~io.TextIOBase.read` و :meth:`~io.TextIOBase.write` " +"می‌پذیرد. این کار از طریق پارامترهای *encoding* و *errors* در :func:`open` " +"انجام می‌شود که دقیقاً مانند پارامترهای موجود در :meth:`str.encode` و " +":meth:`bytes.decode` تفسیر می‌شوند." msgid "Reading Unicode from a file is therefore simple::" -msgstr "" +msgstr "بنابراین، خواندن یونیکد از یک فایل ساده است::" msgid "" "with open('unicode.txt', encoding='utf-8') as f:\n" " for line in f:\n" " print(repr(line))" msgstr "" +"with open('unicode.txt', encoding='utf-8') as f:\n" +" for line in f:\n" +" print(repr(line))" -msgid "It's also possible to open files in update mode, allowing both reading and writing::" +msgid "" +"It's also possible to open files in update mode, allowing both reading and " +"writing::" msgstr "" +"همچنین می‌توانید فایل‌ها را در حالت به‌روزرسانی باز کنید، که امکان خواندن و " +"نوشتن را فراهم می‌کند::" msgid "" "with open('test', encoding='utf-8', mode='w+') as f:\n" @@ -498,33 +1190,119 @@ msgid "" " f.seek(0)\n" " print(repr(f.readline()[:1]))" msgstr "" +"with open('test', encoding='utf-8', mode='w+') as f:\n" +" f.write('\\u4500 blah blah blah\\n')\n" +" f.seek(0)\n" +" print(repr(f.readline()[:1]))" -msgid "The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is often written as the first character of a file in order to assist with autodetection of the file's byte ordering. Some encodings, such as UTF-16, expect a BOM to be present at the start of a file; when such an encoding is used, the BOM will be automatically written as the first character and will be silently dropped when the file is read. There are variants of these encodings, such as 'utf-16-le' and 'utf-16-be' for little-endian and big-endian encodings, that specify one particular byte ordering and don't skip the BOM." -msgstr "" +msgid "" +"The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is " +"often written as the first character of a file in order to assist with " +"autodetection of the file's byte ordering. Some encodings, such as UTF-16, " +"expect a BOM to be present at the start of a file; when such an encoding is " +"used, the BOM will be automatically written as the first character and will " +"be silently dropped when the file is read. There are variants of these " +"encodings, such as 'utf-16-le' and 'utf-16-be' for little-endian and big-" +"endian encodings, that specify one particular byte ordering and don't skip " +"the BOM." +msgstr "" +"نویسه‌ی یونیکد ``U+FEFF`` به‌عنوان نشانگر ترتیب بایت (BOM) استفاده می‌شود و " +"اغلب به‌عنوان نخستین نویسه‌ی یک فایل نوشته می‌شود تا به تشخیص خودکار ترتیب " +"بایت‌های فایل کمک کند. برخی کدگذاری‌ها، مانند UTF-16، انتظار دارند که یک BOM" +" در ابتدای فایل وجود داشته باشد؛ هنگامی که از چنین کدگذاری‌ای استفاده شود، " +"BOM به‌صورت خودکار به‌عنوان نخستین نویسه نوشته می‌شود و هنگام خواندن فایل، " +"به‌طور خاموش حذف می‌شود. گونه‌هایی از این کدگذاری‌ها وجود دارند، مانند " +"'utf-16-le' و 'utf-16-be' برای کدگذاری‌هایی با بایت کوچک‌اندیان " +"(little-endian) و بزرگ‌اندیان (big-endian)، که یک ترتیب بایت مشخص " +"را تعیین می‌کنند و BOM را نادیده نمی‌گیرند." -msgid "In some areas, it is also convention to use a \"BOM\" at the start of UTF-8 encoded files; the name is misleading since UTF-8 is not byte-order dependent. The mark simply announces that the file is encoded in UTF-8. For reading such files, use the 'utf-8-sig' codec to automatically skip the mark if present." -msgstr "" +msgid "" +"In some areas, it is also convention to use a \"BOM\" at the start of UTF-8 " +"encoded files; the name is misleading since UTF-8 is not byte-order " +"dependent. The mark simply announces that the file is encoded in UTF-8. For" +" reading such files, use the 'utf-8-sig' codec to automatically skip the " +"mark if present." +msgstr "" +"در برخی حوزه‌ها، همچنین مرسوم است که از «BOM» در ابتدای فایل‌های کدگذاری‌شده" +" با UTF-8 استفاده شود؛ این نام گمراه‌کننده است، زیرا UTF-8 به ترتیب بایت‌ها " +"وابسته نیست. این نشانه صرفاً اعلام می‌کند که فایل با UTF-8 کدگذاری شده است. " +"برای خواندن چنین فایل‌هایی، از کدک 'utf-8-sig' استفاده کنید تا در صورت وجود " +"نشانه، به‌طور خودکار آن را نادیده بگیرد." msgid "Unicode filenames" -msgstr "" +msgstr "نام‌فایل‌های یونیکد" -msgid "Most of the operating systems in common use today support filenames that contain arbitrary Unicode characters. Usually this is implemented by converting the Unicode string into some encoding that varies depending on the system. Today Python is converging on using UTF-8: Python on MacOS has used UTF-8 for several versions, and Python 3.6 switched to using UTF-8 on Windows as well. On Unix systems, there will only be a :term:`filesystem encoding `. if you've set the ``LANG`` or ``LC_CTYPE`` environment variables; if you haven't, the default encoding is again UTF-8." -msgstr "" +msgid "" +"Most of the operating systems in common use today support filenames that " +"contain arbitrary Unicode characters. Usually this is implemented by " +"converting the Unicode string into some encoding that varies depending on " +"the system. Today Python is converging on using UTF-8: Python on MacOS has " +"used UTF-8 for several versions, and Python 3.6 switched to using UTF-8 on " +"Windows as well. On Unix systems, there will only be a :term:`filesystem " +"encoding `. if you've set the " +"``LANG`` or ``LC_CTYPE`` environment variables; if you haven't, the default " +"encoding is again UTF-8." +msgstr "" +"بیشتر سیستم‌عامل‌های رایج امروزی از نام فایل‌هایی که حاوی نویسه‌های یونیکد " +"دلخواه هستند پشتیبانی می‌کنند. معمولاً این کار با تبدیل رشته یونیکدی به یک " +"کدگذاری خاص پیاده‌سازی می‌شود که بسته به سیستم متفاوت است. امروزه پایتون در " +"حال همگرایی به سمت استفاده از UTF-8 است: پایتون در MacOS برای چندین نسخه از " +"UTF-8 استفاده کرده است و پایتون 3.6 نیز در ویندوز به استفاده از UTF-8 روی " +"آورد. در سیستم‌های یونیکسی، تنها در صورتی یک :term:`کدگذاری فایل‌سیستم " +"` وجود خواهد داشت که متغیرهای محیطی " +"``LANG`` یا ``LC_CTYPE`` را تنظیم کرده باشید؛ در غیر این صورت، کدگذاری " +"پیش‌فرض باز هم UTF-8 است." -msgid "The :func:`sys.getfilesystemencoding` function returns the encoding to use on your current system, in case you want to do the encoding manually, but there's not much reason to bother. When opening a file for reading or writing, you can usually just provide the Unicode string as the filename, and it will be automatically converted to the right encoding for you::" -msgstr "" +msgid "" +"The :func:`sys.getfilesystemencoding` function returns the encoding to use " +"on your current system, in case you want to do the encoding manually, but " +"there's not much reason to bother. When opening a file for reading or " +"writing, you can usually just provide the Unicode string as the filename, " +"and it will be automatically converted to the right encoding for you::" +msgstr "" +"تابع :func:`sys.getfilesystemencoding` کدگذاری مورد استفاده در سیستم فعلی " +"شما را برمی‌گرداند، در صورتی که بخواهید کدگذاری را به‌صورت دستی انجام دهید، " +"اما دلیل چندانی برای زحمت کشیدن وجود ندارد. هنگام باز کردن یک فایل برای " +"خواندن یا نوشتن، معمولاً می‌توانید فقط رشته‌ی Unicode را به‌عنوان نام فایل " +"ارائه دهید، و به‌طور خودکار به کدگذاری مناسب برای شما تبدیل می‌شود::" msgid "" "filename = 'filename\\u4500abc'\n" "with open(filename, 'w') as f:\n" " f.write('blah\\n')" msgstr "" +"filename = 'filename\\u4500abc'\n" +"with open(filename, 'w') as f:\n" +" f.write('blah\\n')" -msgid "Functions in the :mod:`os` module such as :func:`os.stat` will also accept Unicode filenames." +msgid "" +"Functions in the :mod:`os` module such as :func:`os.stat` will also accept " +"Unicode filenames." msgstr "" +"تابع‌های ماژول :mod:`os` مانند :func:`os.stat` همچنین نام فایل‌های یونیکد را" +" می‌پذیرند." -msgid "The :func:`os.listdir` function returns filenames, which raises an issue: should it return the Unicode version of filenames, or should it return bytes containing the encoded versions? :func:`os.listdir` can do both, depending on whether you provided the directory path as bytes or a Unicode string. If you pass a Unicode string as the path, filenames will be decoded using the filesystem's encoding and a list of Unicode strings will be returned, while passing a byte path will return the filenames as bytes. For example, assuming the default :term:`filesystem encoding ` is UTF-8, running the following program::" -msgstr "" +msgid "" +"The :func:`os.listdir` function returns filenames, which raises an issue: " +"should it return the Unicode version of filenames, or should it return bytes" +" containing the encoded versions? :func:`os.listdir` can do both, depending" +" on whether you provided the directory path as bytes or a Unicode string. " +"If you pass a Unicode string as the path, filenames will be decoded using " +"the filesystem's encoding and a list of Unicode strings will be returned, " +"while passing a byte path will return the filenames as bytes. For example, " +"assuming the default :term:`filesystem encoding ` is UTF-8, running the following program::" +msgstr "" +"تابع :func:`os.listdir` نام فایل‌ها را برمی‌گرداند، که این موضوع مسئله‌ای را" +" مطرح می‌کند: آیا باید نسخه‌ی یونیکد نام فایل‌ها را برگرداند، یا باید " +"بایت‌هایی شامل نسخه‌های کدگذاری‌شده را برگرداند؟ :func:`os.listdir` می‌تواند" +" هر دو کار را انجام دهد، بسته به این‌که مسیر پوشه را به‌صورت بایت یا یک " +"رشته‌ی یونیکد ارائه کرده باشید. اگر یک رشته‌ی یونیکد را به‌عنوان مسیر بدهید، " +"نام فایل‌ها با استفاده از کدگذاری سیستم‌فایل کدگشایی می‌شوند و فهرستی از " +"رشته‌های یونیکد برگردانده می‌شود، در حالی که دادن یک مسیر بایتی، نام فایل‌ها" +" را به‌صورت بایت برمی‌گرداند. برای مثال، با فرض این‌که :term:`کدگذاری " +"سیستم‌فایل ` پیش‌فرض UTF-8 باشد، " +"اجرای برنامه‌ی زیر::" msgid "" "fn = 'filename\\u4500abc'\n" @@ -535,48 +1313,117 @@ msgid "" "print(os.listdir(b'.'))\n" "print(os.listdir('.'))" msgstr "" +"fn = 'filename\\u4500abc'\n" +"f = open(fn, 'w')\n" +"f.close()\n" +"\n" +"import os\n" +"print(os.listdir(b'.'))\n" +"print(os.listdir('.'))" msgid "will produce the following output:" -msgstr "" +msgstr "خروجی زیر را تولید خواهد کرد:" msgid "" "$ python listdir-test.py\n" "[b'filename\\xe4\\x94\\x80abc', ...]\n" "['filename\\u4500abc', ...]" msgstr "" +"$ python listdir-test.py\n" +"[b'filename\\xe4\\x94\\x80abc', ...]\n" +"['filename\\u4500abc', ...]" -msgid "The first list contains UTF-8-encoded filenames, and the second list contains the Unicode versions." +msgid "" +"The first list contains UTF-8-encoded filenames, and the second list " +"contains the Unicode versions." msgstr "" +"نخستین فهرست شامل نام فایل‌های کدگذاری‌شده با UTF-8 است، و دومین فهرست شامل " +"نسخه‌های یونیکد است." -msgid "Note that on most occasions, you should can just stick with using Unicode with these APIs. The bytes APIs should only be used on systems where undecodable file names can be present; that's pretty much only Unix systems now." +msgid "" +"Note that on most occasions, you should can just stick with using Unicode " +"with these APIs. The bytes APIs should only be used on systems where " +"undecodable file names can be present; that's pretty much only Unix systems " +"now." msgstr "" +"توجه داشته باشید که در بیشتر موارد، می‌توانید صرفاً به استفاده از Unicode با" +" این APIها اکتفا کنید. APIهای bytes فقط باید در سیستم‌هایی استفاده شوند که " +"ممکن است نام فایل‌های غیرقابل کدگشایی در آن‌ها وجود داشته باشد؛ این موضوع " +"امروزه تقریباً فقط در مورد سیستم‌های یونیکس صدق می‌کند." msgid "Tips for Writing Unicode-aware Programs" -msgstr "" +msgstr "نکاتی برای نوشتن برنامه‌های آگاه از یونیکد" -msgid "This section provides some suggestions on writing software that deals with Unicode." +msgid "" +"This section provides some suggestions on writing software that deals with " +"Unicode." msgstr "" +"این بخش چند پیشنهاد درباره‌ی نوشتن نرم‌افزاری که با یونیکد سروکار دارد ارائه " +"می‌دهد." msgid "The most important tip is:" -msgstr "" +msgstr "مهم‌ترین نکته این است:" -msgid "Software should only work with Unicode strings internally, decoding the input data as soon as possible and encoding the output only at the end." +msgid "" +"Software should only work with Unicode strings internally, decoding the " +"input data as soon as possible and encoding the output only at the end." msgstr "" +"نرم‌افزار باید در درون خود فقط با رشته‌های یونیکد کار کند، داده‌های ورودی را" +" هرچه زودتر کدگشایی کند و خروجی را فقط در پایان کدگذاری کند." -msgid "If you attempt to write processing functions that accept both Unicode and byte strings, you will find your program vulnerable to bugs wherever you combine the two different kinds of strings. There is no automatic encoding or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be raised." -msgstr "" +msgid "" +"If you attempt to write processing functions that accept both Unicode and " +"byte strings, you will find your program vulnerable to bugs wherever you " +"combine the two different kinds of strings. There is no automatic encoding " +"or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be " +"raised." +msgstr "" +"اگر تلاش کنید توابع پردازشی بنویسید که هم رشته‌های یونیکد و هم رشته‌های " +"بایتی را می‌پذیرند، متوجه خواهید شد که برنامه‌ی شما هر جا که این دو نوع " +"مختلف رشته را با هم ترکیب کنید، در برابر اشکال‌ها آسیب‌پذیر است. هیچ کدگذاری" +" یا کدگشایی خودکاری وجود ندارد: اگر برای مثال ``str + bytes`` را انجام دهید،" +" یک :exc:`TypeError` پرتاب خواهد شد." -msgid "When using data coming from a web browser or some other untrusted source, a common technique is to check for illegal characters in a string before using the string in a generated command line or storing it in a database. If you're doing this, be careful to check the decoded string, not the encoded bytes data; some encodings may have interesting properties, such as not being bijective or not being fully ASCII-compatible. This is especially true if the input data also specifies the encoding, since the attacker can then choose a clever way to hide malicious text in the encoded bytestream." -msgstr "" +msgid "" +"When using data coming from a web browser or some other untrusted source, a " +"common technique is to check for illegal characters in a string before using" +" the string in a generated command line or storing it in a database. If " +"you're doing this, be careful to check the decoded string, not the encoded " +"bytes data; some encodings may have interesting properties, such as not " +"being bijective or not being fully ASCII-compatible. This is especially " +"true if the input data also specifies the encoding, since the attacker can " +"then choose a clever way to hide malicious text in the encoded bytestream." +msgstr "" +"هنگام استفاده از داده‌هایی که از یک مرورگر وب یا منبع دیگری غیرقابل‌اعتماد " +"می‌آیند، روشی رایج این است که پیش از استفاده از یک رشته در خط فرمان " +"تولیدشده یا ذخیره آن در پایگاه داده، وجود نویسه‌های غیرمجاز در آن رشته " +"بررسی شود. اگر این کار را انجام می‌دهید، دقت کنید که رشته کدگشایی‌شده را " +"بررسی کنید، نه داده بایتی کدگذاری‌شده را؛ برخی کدگذاری‌ها ممکن است ویژگی‌های" +" قابل‌توجهی داشته باشند، مانند دوسویی نبودن یا به‌طور کامل با ASCII سازگار " +"نبودن. این موضوع به‌ویژه زمانی صادق است که داده ورودی نیز کدگذاری را مشخص " +"کند، زیرا در این صورت مهاجم می‌تواند راهی هوشمندانه برای پنهان کردن متن مخرب" +" در جریان بایتی کدگذاری‌شده انتخاب کند." msgid "Converting Between File Encodings" -msgstr "" +msgstr "تبدیل بین کدگذاری‌های فایل" -msgid "The :class:`~codecs.StreamRecoder` class can transparently convert between encodings, taking a stream that returns data in encoding #1 and behaving like a stream returning data in encoding #2." +msgid "" +"The :class:`~codecs.StreamRecoder` class can transparently convert between " +"encodings, taking a stream that returns data in encoding #1 and behaving " +"like a stream returning data in encoding #2." msgstr "" +"کلاس :class:`~codecs.StreamRecoder` می‌تواند به‌صورت شفاف بین کدگذاری‌ها " +"تبدیل انجام دهد؛ این کلاس جریانی را می‌گیرد که داده‌ها را در کدگذاری #۱ " +"برمی‌گرداند و مانند جریانی رفتار می‌کند که داده‌ها را در کدگذاری #۲ " +"برمی‌گرداند." -msgid "For example, if you have an input file *f* that's in Latin-1, you can wrap it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" +msgid "" +"For example, if you have an input file *f* that's in Latin-1, you can wrap " +"it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" msgstr "" +"برای مثال، اگر یک فایل ورودی *f* دارید که با Latin-1 کدگذاری شده است، " +"می‌توانید آن را با یک :class:`~codecs.StreamRecoder` بپیچید تا بایت‌های " +"کدگذاری‌شده با UTF-8 را برگرداند::" msgid "" "new_f = codecs.StreamRecoder(f,\n" @@ -587,12 +1434,27 @@ msgid "" " # reader/writer: used to read and write to the stream.\n" " codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" msgstr "" +"new_f = codecs.StreamRecoder(f,\n" +" # en/decoder: used by read() to encode its results and\n" +" # by write() to decode its input.\n" +" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n" +"\n" +" # reader/writer: used to read and write to the stream.\n" +" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" msgid "Files in an Unknown Encoding" -msgstr "" +msgstr "فایل‌هایی با کدگذاری ناشناخته" -msgid "What can you do if you need to make a change to a file, but don't know the file's encoding? If you know the encoding is ASCII-compatible and only want to examine or modify the ASCII parts, you can open the file with the ``surrogateescape`` error handler::" +msgid "" +"What can you do if you need to make a change to a file, but don't know the " +"file's encoding? If you know the encoding is ASCII-compatible and only want" +" to examine or modify the ASCII parts, you can open the file with the " +"``surrogateescape`` error handler::" msgstr "" +"اگر نیاز داشته باشید تغییری در یک فایل ایجاد کنید، اما کدگذاری فایل را " +"ندانید، چه کاری می‌توانید انجام دهید؟ اگر می‌دانید کدگذاری آن با ASCII " +"سازگار است و فقط می‌خواهید بخش‌های ASCII را بررسی یا تغییر دهید، می‌توانید " +"فایل را با مدیر خطای ``surrogateescape`` باز کنید::" msgid "" "with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" @@ -604,24 +1466,80 @@ msgid "" " encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" " f.write(data)" msgstr "" +"with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" data = f.read()\n" +"\n" +"# تغییراتی در رشته‌ی 'data' ایجاد کنید\n" +"\n" +"with open(fname + '.new', 'w',\n" +" encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" f.write(data)" -msgid "The ``surrogateescape`` error handler will decode any non-ASCII bytes as code points in a special range running from U+DC80 to U+DCFF. These code points will then turn back into the same bytes when the ``surrogateescape`` error handler is used to encode the data and write it back out." +msgid "" +"The ``surrogateescape`` error handler will decode any non-ASCII bytes as " +"code points in a special range running from U+DC80 to U+DCFF. These code " +"points will then turn back into the same bytes when the ``surrogateescape`` " +"error handler is used to encode the data and write it back out." msgstr "" +"هندلر خطای ``surrogateescape`` هر بایت غیر ASCII را به‌صورت نقاط کد " +"در بازه‌ای خاص از U+DC80 تا U+DCFF کدگشایی می‌کند. سپس وقتی از هندلر" +" خطای ``surrogateescape`` برای کدگذاری داده و نوشتن مجدد آن استفاده شود، این" +" نقاط کد به همان بایت‌ها تبدیل می‌شوند." -msgid "One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David Beazley, discusses text processing and binary data handling." +msgid "" +"One section of `Mastering Python 3 Input/Output " +"`_, a " +"PyCon 2010 talk by David Beazley, discusses text processing and binary data " +"handling." msgstr "" +"بخشی از `Mastering Python 3 Input/Output " +"`_، یک " +"سخنرانی PyCon 2010 از David Beazley، به پردازش متن و مدیریت داده‌های دودویی " +"می‌پردازد." -msgid "The `PDF slides for Marc-André Lemburg's presentation \"Writing Unicode-aware Applications in Python\" `_ discuss questions of character encodings as well as how to internationalize and localize an application. These slides cover Python 2.x only." -msgstr "" +msgid "" +"The `PDF slides for Marc-André Lemburg's presentation \"Writing Unicode-" +"aware Applications in Python\" " +"`_ discuss questions of character encodings as " +"well as how to internationalize and localize an application. These slides " +"cover Python 2.x only." +msgstr "" +"`اسلایدهای PDF مربوط به ارائه مارک-آندره لمبورگ با عنوان \"Writing Unicode-" +"aware Applications in Python\" " +"`_ به بررسی مسائل کدگذاری نویسه‌ها و همچنین " +"چگونگی بین‌المللی‌سازی و بومی‌سازی یک برنامه می‌پردازد. این اسلایدها تنها " +"پایتون 2.x را پوشش می‌دهند." -msgid "`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that discusses the internal Unicode representation in Python 3.3." +msgid "" +"`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that " +"discusses the internal Unicode representation in Python 3.3." msgstr "" +"`The Guts of Unicode in Python `_ یک سخنرانی در PyCon 2013 از بنجامین پترسون است که به " +"بررسی بازنمایی داخلی یونیکد در پایتون 3.3 می‌پردازد." msgid "Acknowledgements" -msgstr "" +msgstr "قدردانی‌ها" -msgid "The initial draft of this document was written by Andrew Kuchling. It has since been revised further by Alexander Belopolsky, Georg Brandl, Andrew Kuchling, and Ezio Melotti." +msgid "" +"The initial draft of this document was written by Andrew Kuchling. It has " +"since been revised further by Alexander Belopolsky, Georg Brandl, Andrew " +"Kuchling, and Ezio Melotti." msgstr "" +"پیش‌نویس اولیه این سند توسط Andrew Kuchling نوشته شد. از آن زمان تاکنون، این" +" سند توسط Alexander Belopolsky، Georg Brandl، Andrew Kuchling و Ezio Melotti" +" بیشتر بازبینی شده است." -msgid "Thanks to the following people who have noted errors or offered suggestions on this article: Éric Araujo, Nicholas Bastin, Nick Coghlan, Marius Gedminas, Kent Johnson, Ken Krugler, Marc-André Lemburg, Martin von Löwis, Terry J. Reedy, Serhiy Storchaka, Eryk Sun, Chad Whitacre, Graham Wideman." -msgstr "" +msgid "" +"Thanks to the following people who have noted errors or offered suggestions " +"on this article: Éric Araujo, Nicholas Bastin, Nick Coghlan, Marius " +"Gedminas, Kent Johnson, Ken Krugler, Marc-André Lemburg, Martin von Löwis, " +"Terry J. Reedy, Serhiy Storchaka, Eryk Sun, Chad Whitacre, Graham Wideman." +msgstr "" +"با تشکر از افراد زیر که به خطاهای این مقاله اشاره کرده یا پیشنهادهایی " +"درباره آن ارائه کرده‌اند: Éric Araujo، Nicholas Bastin، Nick Coghlan، Marius" +" Gedminas، Kent Johnson، Ken Krugler، Marc-André Lemburg، Martin von Löwis، " +"Terry J. Reedy، Serhiy Storchaka، Eryk Sun، Chad Whitacre و Graham Wideman." diff --git a/howto/urllib2.po b/howto/urllib2.po index 60c308766..008140f01 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -25,49 +25,106 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "HOWTO Fetch Internet Resources Using The urllib Package" -msgstr "" +msgstr "راهنمای واکشی منابع اینترنتی با استفاده از بسته urllib" msgid "Author" -msgstr "" +msgstr "نویسنده" msgid "`Michael Foord `_" -msgstr "" +msgstr "`Michael Foord `_" msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "You may also find useful the following article on fetching web resources with Python:" +msgid "" +"You may also find useful the following article on fetching web resources " +"with Python:" msgstr "" +"همچنین ممکن است مقاله‌ی زیر درباره‌ی واکشی منابع وب با پایتون برایتان مفید " +"باشد:" -msgid "`Basic Authentication `__" +msgid "" +"`Basic Authentication " +"`__" msgstr "" +"احراز هویت `پایه" +" `__" msgid "A tutorial on *Basic Authentication*, with examples in Python." msgstr "" +"آموزشی درباره‌ی *احراز هویت پایه* (Basic Authentication)، با مثال‌هایی در " +"پایتون." -msgid "**urllib.request** is a Python module for fetching URLs (Uniform Resource Locators). It offers a very simple interface, in the form of the *urlopen* function. This is capable of fetching URLs using a variety of different protocols. It also offers a slightly more complex interface for handling common situations - like basic authentication, cookies, proxies and so on. These are provided by objects called handlers and openers." -msgstr "" +msgid "" +"**urllib.request** is a Python module for fetching URLs (Uniform Resource " +"Locators). It offers a very simple interface, in the form of the *urlopen* " +"function. This is capable of fetching URLs using a variety of different " +"protocols. It also offers a slightly more complex interface for handling " +"common situations - like basic authentication, cookies, proxies and so on. " +"These are provided by objects called handlers and openers." +msgstr "" +"**urllib.request** یک ماژول پایتون برای واکشی URLها (نشانی‌های یکدست منابع)" +" است. این ماژول یک رابط بسیار ساده را در قالب تابع *urlopen* ارائه می‌دهد. " +"این تابع می‌تواند URLها را با استفاده از پروتکل‌های گوناگون واکشی کند. " +"همچنین یک رابط کمی پیچیده‌تر برای مدیریت موقعیت‌های رایج ارائه می‌دهد — " +"مانند احراز هویت پایه، کوکی‌ها، پراکسی‌ها و غیره. این موارد توسط اشیایی به " +"نام handler و opener ارائه می‌شوند." -msgid "urllib.request supports fetching URLs for many \"URL schemes\" (identified by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the URL scheme of ``\"ftp://python.org/\"``) using their associated network protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, HTTP." -msgstr "" +msgid "" +"urllib.request supports fetching URLs for many \"URL schemes\" (identified " +"by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the " +"URL scheme of ``\"ftp://python.org/\"``) using their associated network " +"protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, " +"HTTP." +msgstr "" +"urllib.request از واکشی URLها برای بسیاری از «طرح‌های URL» (URL schemes) با" +" استفاده از پروتکل‌های شبکه‌ی مرتبط با آن‌ها (مانند FTP، HTTP) پشتیبانی " +"می‌کند؛ این طرح‌ها با رشته‌ی پیش از ``\":\"`` در URL شناسایی می‌شوند، برای " +"مثال ``\"ftp\"`` طرح‌واره URL مربوط به ``\"ftp://python.org/\"`` است. این آموزش " +"بر رایج‌ترین حالت، یعنی HTTP، تمرکز دارد." -msgid "For straightforward situations *urlopen* is very easy to use. But as soon as you encounter errors or non-trivial cases when opening HTTP URLs, you will need some understanding of the HyperText Transfer Protocol. The most comprehensive and authoritative reference to HTTP is :rfc:`2616`. This is a technical document and not intended to be easy to read. This HOWTO aims to illustrate using *urllib*, with enough detail about HTTP to help you through. It is not intended to replace the :mod:`urllib.request` docs, but is supplementary to them." -msgstr "" +msgid "" +"For straightforward situations *urlopen* is very easy to use. But as soon as" +" you encounter errors or non-trivial cases when opening HTTP URLs, you will " +"need some understanding of the HyperText Transfer Protocol. The most " +"comprehensive and authoritative reference to HTTP is :rfc:`2616`. This is a " +"technical document and not intended to be easy to read. This HOWTO aims to " +"illustrate using *urllib*, with enough detail about HTTP to help you " +"through. It is not intended to replace the :mod:`urllib.request` docs, but " +"is supplementary to them." +msgstr "" +"برای موقعیت‌های ساده، استفاده از *urlopen* بسیار آسان است. اما به محض اینکه " +"هنگام باز کردن URLهای HTTP با خطاها یا موارد غیربدیهی مواجه شوید، به درکی " +"از پروتکل انتقال ابرمتن (HyperText Transfer Protocol) نیاز خواهید داشت. " +"جامع‌ترین و معتبرترین مرجع برای HTTP، :rfc:`2616` است. این سند فنی است و " +"برای خواندن آسان در نظر گرفته نشده است. این راهنمای عملی (HOWTO) هدف دارد " +"استفاده از *urllib* را با جزئیات کافی درباره HTTP نشان دهد تا شما را در " +"پیشبرد کار یاری کند. هدف آن جایگزینی مستندات :mod:`urllib.request` نیست، " +"بلکه مکملی برای آن‌ها است." msgid "Fetching URLs" -msgstr "" +msgstr "واکشی URLها" msgid "The simplest way to use urllib.request is as follows::" -msgstr "" +msgstr "ساده‌ترین راه برای استفاده از urllib.request به‌صورت زیر است::" msgid "" "import urllib.request\n" "with urllib.request.urlopen('http://python.org/') as response:\n" " html = response.read()" msgstr "" +"import urllib.request\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" html = response.read()" -msgid "If you wish to retrieve a resource via URL and store it in a temporary location, you can do so via the :func:`shutil.copyfileobj` and :func:`tempfile.NamedTemporaryFile` functions::" +msgid "" +"If you wish to retrieve a resource via URL and store it in a temporary " +"location, you can do so via the :func:`shutil.copyfileobj` and " +":func:`tempfile.NamedTemporaryFile` functions::" msgstr "" +"اگر می‌خواهید منبعی را از طریق URL بازیابی کنید و آن را در یک مکان موقت " +"ذخیره کنید، می‌توانید این کار را با توابع :func:`shutil.copyfileobj` و " +":func:`tempfile.NamedTemporaryFile` انجام دهید::" msgid "" "import shutil\n" @@ -81,12 +138,44 @@ msgid "" "with open(tmp_file.name) as html:\n" " pass" msgstr "" +"import shutil\n" +"import tempfile\n" +"import urllib.request\n" +"\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" with tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n" +" shutil.copyfileobj(response, tmp_file)\n" +"\n" +"with open(tmp_file.name) as html:\n" +" pass" -msgid "Many uses of urllib will be that simple (note that instead of an 'http:' URL we could have used a URL starting with 'ftp:', 'file:', etc.). However, it's the purpose of this tutorial to explain the more complicated cases, concentrating on HTTP." +msgid "" +"Many uses of urllib will be that simple (note that instead of an 'http:' URL" +" we could have used a URL starting with 'ftp:', 'file:', etc.). However, " +"it's the purpose of this tutorial to explain the more complicated cases, " +"concentrating on HTTP." msgstr "" +"بسیاری از کاربردهای urllib به همین سادگی خواهند بود (توجه داشته باشید که " +"به‌جای یک URL با 'http:' می‌توانستیم از یک URL استفاده کنیم که با 'ftp:'، " +"'file:' و غیره شروع می‌شود). با این حال، هدف این آموزش توضیح موارد " +"پیچیده‌تر، با تمرکز بر HTTP است." -msgid "HTTP is based on requests and responses - the client makes requests and servers send responses. urllib.request mirrors this with a ``Request`` object which represents the HTTP request you are making. In its simplest form you create a Request object that specifies the URL you want to fetch. Calling ``urlopen`` with this Request object returns a response object for the URL requested. This response is a file-like object, which means you can for example call ``.read()`` on the response::" -msgstr "" +msgid "" +"HTTP is based on requests and responses - the client makes requests and " +"servers send responses. urllib.request mirrors this with a ``Request`` " +"object which represents the HTTP request you are making. In its simplest " +"form you create a Request object that specifies the URL you want to fetch. " +"Calling ``urlopen`` with this Request object returns a response object for " +"the URL requested. This response is a file-like object, which means you can " +"for example call ``.read()`` on the response::" +msgstr "" +"HTTP مبتنی بر درخواست‌ها و پاسخ‌ها است؛ کلاینت درخواست‌ها را ارسال می‌کند و " +"سرورها پاسخ‌ها را ارسال می‌کنند. urllib.request این موضوع را با یک شیء " +"``Request`` بازتاب می‌دهد که نشان‌دهنده درخواست HTTP است که شما ارسال " +"می‌کنید. در ساده‌ترین حالت، شما یک شیء Request ایجاد می‌کنید که URL مورد نظر" +" برای واکشی را مشخص می‌کند. فراخوانی ``urlopen`` با این شیء Request، یک شیء " +"پاسخ برای URL درخواست‌شده برمی‌گرداند. این پاسخ یک شیء شبه‌فایل است، به این " +"معنا که می‌توانید برای مثال ``.read()`` را روی پاسخ فراخوانی کنید::" msgid "" "import urllib.request\n" @@ -95,21 +184,60 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.request\n" +"\n" +"req = urllib.request.Request('http://python.org/')\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" -msgid "Note that urllib.request makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so::" +msgid "" +"Note that urllib.request makes use of the same Request interface to handle " +"all URL schemes. For example, you can make an FTP request like so::" msgstr "" +"توجه داشته باشید که urllib.request از همان رابط Request برای مدیریت تمام " +"طرح‌های URL استفاده می‌کند. برای مثال، می‌توانید یک درخواست FTP را به این " +"صورت انجام دهید::" msgid "req = urllib.request.Request('ftp://example.com/')" -msgstr "" +msgstr "req = urllib.request.Request('ftp://example.com/')" -msgid "In the case of HTTP, there are two extra things that Request objects allow you to do: First, you can pass data to be sent to the server. Second, you can pass extra information (\"metadata\") *about* the data or about the request itself, to the server - this information is sent as HTTP \"headers\". Let's look at each of these in turn." -msgstr "" +msgid "" +"In the case of HTTP, there are two extra things that Request objects allow " +"you to do: First, you can pass data to be sent to the server. Second, you " +"can pass extra information (\"metadata\") *about* the data or about the " +"request itself, to the server - this information is sent as HTTP " +"\"headers\". Let's look at each of these in turn." +msgstr "" +"در مورد HTTP، دو کار اضافی وجود دارد که اشیای Request به شما اجازه می‌دهند " +"انجام دهید: اول، می‌توانید داده‌هایی را بفرستید تا به سرور ارسال شوند. دوم، " +"می‌توانید اطلاعات اضافی («فراداده») *درباره‌ی* داده‌ها یا درباره‌ی خود " +"درخواست را به سرور بفرستید - این اطلاعات به‌صورت «سرآیندهای HTTP» ارسال " +"می‌شود. بیایید هر یک از این موارد را به‌نوبت بررسی کنیم." msgid "Data" -msgstr "" +msgstr "داده" -msgid "Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script or other web application). With HTTP, this is often done using what's known as a **POST** request. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as the ``data`` argument. The encoding is done using a function from the :mod:`urllib.parse` library. ::" -msgstr "" +msgid "" +"Sometimes you want to send data to a URL (often the URL will refer to a CGI " +"(Common Gateway Interface) script or other web application). With HTTP, this" +" is often done using what's known as a **POST** request. This is often what " +"your browser does when you submit a HTML form that you filled in on the web." +" Not all POSTs have to come from forms: you can use a POST to transmit " +"arbitrary data to your own application. In the common case of HTML forms, " +"the data needs to be encoded in a standard way, and then passed to the " +"Request object as the ``data`` argument. The encoding is done using a " +"function from the :mod:`urllib.parse` library. ::" +msgstr "" +"گاهی می‌خواهید داده‌ها را به یک URL بفرستید (اغلب URL به یک اسکریپت CGI " +"(رابط دروازه مشترک) یا یک برنامه کاربردی وب دیگر اشاره دارد). در HTTP، این " +"کار معمولاً با استفاده از آنچه به عنوان درخواست **POST** شناخته می‌شود انجام" +" می‌شود. این معمولاً همان کاری است که مرورگر شما هنگام ارسال یک فرم HTML که " +"در وب پر کرده‌اید انجام می‌دهد. لازم نیست همه درخواست‌های POST از فرم‌ها " +"بیایند: شما می‌توانید از یک POST برای انتقال داده‌های دلخواه به برنامه " +"خودتان استفاده کنید. در حالت رایج فرم‌های HTML، داده‌ها باید به روش " +"استانداردی کدگذاری شوند و سپس به‌عنوان آرگومان ``data`` به شیء Request ارسال" +" شوند. کدگذاری با استفاده از تابعی از کتابخانه :mod:`urllib.parse` انجام " +"می‌شود. ::" msgid "" "import urllib.parse\n" @@ -126,15 +254,55 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"values = {'name' : 'Michael Foord',\n" +" 'location' : 'Northampton',\n" +" 'language' : 'Python' }\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii') # data should be bytes\n" +"req = urllib.request.Request(url, data)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" -msgid "Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see `HTML Specification, Form Submission `_ for more details)." +msgid "" +"Note that other encodings are sometimes required (e.g. for file upload from " +"HTML forms - see `HTML Specification, Form Submission " +"`_ for more " +"details)." msgstr "" +"توجه داشته باشید که گاهی به کدگذاری‌های دیگری نیاز است (برای مثال برای " +"بارگذاری فایل از فرم‌های HTML - برای جزئیات بیشتر `HTML Specification, Form " +"Submission `_ " +"را ببینید)." -msgid "If you do not pass the ``data`` argument, urllib uses a **GET** request. One way in which GET and POST requests differ is that POST requests often have \"side-effects\": they change the state of the system in some way (for example by placing an order with the website for a hundredweight of tinned spam to be delivered to your door). Though the HTTP standard makes it clear that POSTs are intended to *always* cause side-effects, and GET requests *never* to cause side-effects, nothing prevents a GET request from having side-effects, nor a POST requests from having no side-effects. Data can also be passed in an HTTP GET request by encoding it in the URL itself." -msgstr "" +msgid "" +"If you do not pass the ``data`` argument, urllib uses a **GET** request. One" +" way in which GET and POST requests differ is that POST requests often have " +"\"side-effects\": they change the state of the system in some way (for " +"example by placing an order with the website for a hundredweight of tinned " +"spam to be delivered to your door). Though the HTTP standard makes it clear" +" that POSTs are intended to *always* cause side-effects, and GET requests " +"*never* to cause side-effects, nothing prevents a GET request from having " +"side-effects, nor a POST requests from having no side-effects. Data can also" +" be passed in an HTTP GET request by encoding it in the URL itself." +msgstr "" +"اگر آرگومان ``data`` را ارسال نکنید، urllib از یک درخواست **GET** استفاده " +"می‌کند. یکی از تفاوت‌های درخواست‌های GET و POST این است که درخواست‌های POST " +"اغلب «عوارض جانبی» دارند: آن‌ها وضعیت سامانه را به شکلی تغییر می‌دهند (برای " +"مثال با ثبت سفارش در وب‌سایت برای یک hundredweight کنسرو اسپم که به درب منزل" +" شما تحویل داده شود). اگرچه استاندارد HTTP به‌وضوح مشخص می‌کند که " +"درخواست‌های POST در نظر گرفته شده‌اند که *همیشه* عوارض جانبی ایجاد کنند و " +"درخواست‌های GET در نظر گرفته شده‌اند که *هرگز* عوارض جانبی ایجاد نکنند، اما " +"هیچ‌چیز مانع از داشتن عوارض جانبی در یک درخواست GET، یا بدون عوارض جانبی " +"بودن یک درخواست POST نمی‌شود. همچنین می‌توان داده را در یک درخواست HTTP GET " +"با کدگذاری آن در خود URL ارسال کرد." msgid "This is done as follows::" -msgstr "" +msgstr "این کار به‌صورت زیر انجام می‌شود::" msgid "" ">>> import urllib.request\n" @@ -150,18 +318,56 @@ msgid "" ">>> full_url = url + '?' + url_values\n" ">>> data = urllib.request.urlopen(full_url)" msgstr "" +">>> import urllib.request\n" +">>> import urllib.parse\n" +">>> data = {}\n" +">>> data['name'] = 'Somebody Here'\n" +">>> data['location'] = 'Northampton'\n" +">>> data['language'] = 'Python'\n" +">>> url_values = urllib.parse.urlencode(data)\n" +">>> print(url_values) # The order may differ from below.\n" +"name=Somebody+Here&language=Python&location=Northampton\n" +">>> url = 'http://www.example.com/example.cgi'\n" +">>> full_url = url + '?' + url_values\n" +">>> data = urllib.request.urlopen(full_url)" -msgid "Notice that the full URL is created by adding a ``?`` to the URL, followed by the encoded values." +msgid "" +"Notice that the full URL is created by adding a ``?`` to the URL, followed " +"by the encoded values." msgstr "" +"توجه داشته باشید که URL کامل با افزودن یک ``?`` به URL و سپس مقادیر " +"کدگذاری‌شده ساخته می‌شود." msgid "Headers" -msgstr "" +msgstr "سرصفحه‌ها" -msgid "We'll discuss here one particular HTTP header, to illustrate how to add headers to your HTTP request." +msgid "" +"We'll discuss here one particular HTTP header, to illustrate how to add " +"headers to your HTTP request." msgstr "" +"در اینجا یک سرآیند HTTP خاص را بررسی می‌کنیم تا نحوه افزودن سرآیندها به " +"درخواست HTTP شما را نشان دهیم." -msgid "Some websites [#]_ dislike being browsed by programs, or send different versions to different browsers [#]_. By default urllib identifies itself as ``Python-urllib/x.y`` (where ``x`` and ``y`` are the major and minor version numbers of the Python release, e.g. ``Python-urllib/2.5``), which may confuse the site, or just plain not work. The way a browser identifies itself is through the ``User-Agent`` header [#]_. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer [#]_. ::" -msgstr "" +msgid "" +"Some websites [#]_ dislike being browsed by programs, or send different " +"versions to different browsers [#]_. By default urllib identifies itself as " +"``Python-urllib/x.y`` (where ``x`` and ``y`` are the major and minor version" +" numbers of the Python release, e.g. ``Python-urllib/2.5``), which may " +"confuse the site, or just plain not work. The way a browser identifies " +"itself is through the ``User-Agent`` header [#]_. When you create a Request " +"object you can pass a dictionary of headers in. The following example makes " +"the same request as above, but identifies itself as a version of Internet " +"Explorer [#]_. ::" +msgstr "" +"برخی وب‌سایت‌ها [#]_ دوست ندارند توسط برنامه‌ها مرور شوند، یا نسخه‌های " +"متفاوتی را به مرورگرهای مختلف [#]_ ارسال می‌کنند. به‌طور پیش‌فرض، urllib خود" +" را به‌عنوان ``Python-urllib/x.y`` معرفی می‌کند (که ``x`` و ``y`` شماره‌های " +"اصلی و فرعی نسخه پایتون هستند، برای مثال ``Python-urllib/2.5``)، که ممکن است" +" باعث سردرگمی سایت شود، یا اصلاً کار نکند. روشی که یک مرورگر خود را معرفی " +"می‌کند، از طریق سرآیند ``User-Agent`` [#]_ است. هنگام ایجاد یک شیء Request، " +"می‌توانید یک دیکشنری از سرآیندها را نیز ارسال کنید. مثال زیر همان درخواست " +"بالا را انجام می‌دهد، اما خود را به‌عنوان نسخه‌ای از Internet Explorer [#]_ " +"معرفی می‌کند. ::" msgid "" "import urllib.parse\n" @@ -180,30 +386,70 @@ msgid "" "with urllib.request.urlopen(req) as response:\n" " the_page = response.read()" msgstr "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'\n" +"values = {'name': 'Michael Foord',\n" +" 'location': 'Northampton',\n" +" 'language': 'Python' }\n" +"headers = {'User-Agent': user_agent}\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii')\n" +"req = urllib.request.Request(url, data, headers)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" -msgid "The response also has two useful methods. See the section on `info and geturl`_ which comes after we have a look at what happens when things go wrong." +msgid "" +"The response also has two useful methods. See the section on `info and " +"geturl`_ which comes after we have a look at what happens when things go " +"wrong." msgstr "" +"پاسخ همچنین دارای دو متد مفید است. بخش `info and geturl`_ را ببینید که پس از" +" بررسی آنچه هنگام بروز مشکل رخ می‌دهد، آمده است." msgid "Handling Exceptions" -msgstr "" +msgstr "مدیریت استثناها" -msgid "*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a response (though as usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:`TypeError` etc. may also be raised)." +msgid "" +"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " +"response (though as usual with Python APIs, built-in exceptions such as " +":exc:`ValueError`, :exc:`TypeError` etc. may also be raised)." msgstr "" +"*urlopen* زمانی که نتواند پاسخی را مدیریت کند، :exc:`~urllib.error.URLError`" +" را پرتاب می‌کند (اگرچه همان‌طور که در APIهای پایتون معمول است، استثناهای " +"توکار مانند :exc:`ValueError`، :exc:`TypeError` و غیره نیز ممکن است پرتاب " +"شوند)." -msgid ":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error.URLError` raised in the specific case of HTTP URLs." +msgid "" +":exc:`~urllib.error.HTTPError` is the subclass of " +":exc:`~urllib.error.URLError` raised in the specific case of HTTP URLs." msgstr "" +":exc:`~urllib.error.HTTPError` زیرکلاسی از :exc:`~urllib.error.URLError` است" +" که در مورد خاص URLهای HTTP پرتاب می‌شود." -msgid "The exception classes are exported from the :mod:`urllib.error` module." -msgstr "" +msgid "" +"The exception classes are exported from the :mod:`urllib.error` module." +msgstr "کلاس‌های استثنا از ماژول :mod:`urllib.error` صادر می‌شوند." msgid "URLError" -msgstr "" +msgstr "URLError" -msgid "Often, URLError is raised because there is no network connection (no route to the specified server), or the specified server doesn't exist. In this case, the exception raised will have a 'reason' attribute, which is a tuple containing an error code and a text error message." +msgid "" +"Often, URLError is raised because there is no network connection (no route " +"to the specified server), or the specified server doesn't exist. In this " +"case, the exception raised will have a 'reason' attribute, which is a tuple " +"containing an error code and a text error message." msgstr "" +"اغلب، URLError به این دلیل پرتاب می‌شود که هیچ اتصال شبکه‌ای وجود ندارد " +"(مسیری به سرور مشخص‌شده وجود ندارد)، یا سرور مشخص‌شده وجود ندارد. در این " +"حالت، استثنای پرتاب‌شده دارای ویژگی 'reason' خواهد بود که یک تاپل " +"شامل یک کد خطا و یک پیام خطای متنی است." msgid "e.g. ::" -msgstr "" +msgstr "مثلاً ::" msgid "" ">>> req = urllib.request.Request('http://www.pretend_server.org')\n" @@ -213,27 +459,67 @@ msgid "" "...\n" "(4, 'getaddrinfo failed')" msgstr "" +">>> req = urllib.request.Request('http://www.pretend_server.org')\n" +">>> try: urllib.request.urlopen(req)\n" +"... except urllib.error.URLError as e:\n" +"... print(e.reason)\n" +"...\n" +"(4, 'getaddrinfo failed')" msgid "HTTPError" -msgstr "" +msgstr "HTTPError" -msgid "Every HTTP response from the server contains a numeric \"status code\". Sometimes the status code indicates that the server is unable to fulfil the request. The default handlers will handle some of these responses for you (for example, if the response is a \"redirection\" that requests the client fetch the document from a different URL, urllib will handle that for you). For those it can't handle, urlopen will raise an :exc:`~urllib.error.HTTPError`. Typical errors include '404' (page not found), '403' (request forbidden), and '401' (authentication required)." -msgstr "" +msgid "" +"Every HTTP response from the server contains a numeric \"status code\". " +"Sometimes the status code indicates that the server is unable to fulfil the " +"request. The default handlers will handle some of these responses for you " +"(for example, if the response is a \"redirection\" that requests the client " +"fetch the document from a different URL, urllib will handle that for you). " +"For those it can't handle, urlopen will raise an " +":exc:`~urllib.error.HTTPError`. Typical errors include '404' (page not " +"found), '403' (request forbidden), and '401' (authentication required)." +msgstr "" +"هر پاسخ HTTP از سرور حاوی یک «کد وضعیت» عددی است. گاهی کد وضعیت نشان می‌دهد " +"که سرور قادر به برآوردن درخواست نیست. هندلرهای پیش‌فرض برخی از این " +"پاسخ‌ها را برای شما مدیریت می‌کنند (برای مثال، اگر پاسخ یک «تغییر مسیر» باشد" +" که از کلاینت می‌خواهد سند را از یک URL متفاوت واکشی کند، urllib آن را برای " +"شما مدیریت می‌کند). برای آن‌هایی که قابل مدیریت نیستند، urlopen یک " +":exc:`~urllib.error.HTTPError` پرتاب می‌کند. خطاهای رایج شامل '404' (صفحه " +"پیدا نشد)، '403' (درخواست ممنوع) و '401' (نیاز به احراز هویت) هستند." -msgid "See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." +msgid "" +"See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." msgstr "" +"برای مراجعه به مرجعی درباره‌ی تمام کدهای خطای HTTP، بخش ۱۰ از :rfc:`2616` " +"را ببینید." -msgid "The :exc:`~urllib.error.HTTPError` instance raised will have an integer 'code' attribute, which corresponds to the error sent by the server." +msgid "" +"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " +"'code' attribute, which corresponds to the error sent by the server." msgstr "" +"نمونه‌ی پرتاب‌شده‌ی :exc:`~urllib.error.HTTPError` یک ویژگی 'code' از نوع " +"عدد صحیح خواهد داشت که متناظر با خطای ارسال‌شده از سوی سرور است." msgid "Error Codes" -msgstr "" +msgstr "کدهای خطا" -msgid "Because the default handlers handle redirects (codes in the 300 range), and codes in the 100--299 range indicate success, you will usually only see error codes in the 400--599 range." +msgid "" +"Because the default handlers handle redirects (codes in the 300 range), and " +"codes in the 100--299 range indicate success, you will usually only see " +"error codes in the 400--599 range." msgstr "" +"از آنجا که هندلرهای پیش‌فرض تغییرمسیرها را مدیریت می‌کنند (کدهای " +"بازه‌ی ۳۰۰)، و کدهای بازه‌ی ۱۰۰--۲۹۹ نشان‌دهنده‌ی موفقیت هستند، معمولاً فقط " +"کدهای خطا را در بازه‌ی ۴۰۰--۵۹۹ مشاهده خواهید کرد." -msgid ":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary of response codes that shows all the response codes used by :rfc:`2616`. An excerpt from the dictionary is shown below ::" +msgid "" +":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary " +"of response codes that shows all the response codes used by :rfc:`2616`. An " +"excerpt from the dictionary is shown below ::" msgstr "" +":attr:`http.server.BaseHTTPRequestHandler.responses` یک دیکشنری مفید از " +"کدهای پاسخ است که تمام کدهای پاسخ استفاده‌شده در :rfc:`2616` را نشان می‌دهد." +" گزیده‌ای از این دیکشنری در زیر نشان داده شده است ::" msgid "" "responses = {\n" @@ -256,9 +542,39 @@ msgid "" " ...\n" " }" msgstr "" +"responses = {\n" +" ...\n" +" : ('OK', 'Request fulfilled, document follows'),\n" +" ...\n" +" : ('Forbidden',\n" +" 'Request forbidden -- authorization will '\n" +" 'not help'),\n" +" : ('Not Found',\n" +" 'Nothing matches the given URI'),\n" +" ...\n" +" : (\"I'm a Teapot\",\n" +" 'Server refuses to brew coffee because '\n" +" 'it is a teapot'),\n" +" ...\n" +" : ('Service Unavailable',\n" +" 'The server cannot process the '\n" +" 'request due to a high load'),\n" +" ...\n" +" }" -msgid "When an error is raised the server responds by returning an HTTP error code *and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance as a response on the page returned. This means that as well as the code attribute, it also has read, geturl, and info, methods as returned by the ``urllib.response`` module::" -msgstr "" +msgid "" +"When an error is raised the server responds by returning an HTTP error code " +"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance" +" as a response on the page returned. This means that as well as the code " +"attribute, it also has read, geturl, and info, methods as returned by the " +"``urllib.response`` module::" +msgstr "" +"هنگامی که خطایی پرتاب می‌شود، سرور با بازگرداندن یک کد خطای HTTP *و* یک " +"صفحه‌ی خطا پاسخ می‌دهد. شما می‌توانید از نمونه‌ی " +":exc:`~urllib.error.HTTPError` به‌عنوان پاسخ برای صفحه‌ی بازگردانده‌شده " +"استفاده کنید. این بدان معناست که علاوه بر ویژگی code، دارای متدهای read، " +"geturl و info نیز هست، همان‌طور که توسط ماژول ``urllib.response`` بازگردانده" +" می‌شوند::" msgid "" ">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" @@ -275,15 +591,34 @@ msgid "" " Page Not Found\\n\n" " ..." msgstr "" +">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" +">>> try:\n" +"... urllib.request.urlopen(req)\n" +"... except urllib.error.HTTPError as e:\n" +"... print(e.code)\n" +"... print(e.read())\n" +"...\n" +"404\n" +"b'\\n\\n\\nPage Not Found\\n\n" +" ..." msgid "Wrapping it Up" -msgstr "" +msgstr "جمع‌بندی" -msgid "So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:`~urllib.error.URLError` there are two basic approaches. I prefer the second approach." +msgid "" +"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* " +":exc:`~urllib.error.URLError` there are two basic approaches. I prefer the " +"second approach." msgstr "" +"بنابراین اگر می‌خواهید برای :exc:`~urllib.error.HTTPError` *یا* " +":exc:`~urllib.error.URLError` آماده باشید، دو رویکرد اساسی وجود دارد. من " +"رویکرد دوم را ترجیح می‌دهم." msgid "Number 1" -msgstr "" +msgstr "عدد ۱" msgid "" "from urllib.request import Request, urlopen\n" @@ -300,12 +635,29 @@ msgid "" "else:\n" " # everything is fine" msgstr "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError, HTTPError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except HTTPError as e:\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"except URLError as e:\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +"else:\n" +" # everything is fine" -msgid "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` will *also* catch an :exc:`~urllib.error.HTTPError`." +msgid "" +"The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " +"will *also* catch an :exc:`~urllib.error.HTTPError`." msgstr "" +"``except HTTPError`` *باید* ابتدا قرار بگیرد، در غیر این صورت ``except " +"URLError`` یک :exc:`~urllib.error.HTTPError` را *نیز* می‌گیرد." msgid "Number 2" -msgstr "" +msgstr "عدد ۲" msgid "" "from urllib.request import Request, urlopen\n" @@ -323,69 +675,210 @@ msgid "" "else:\n" " # everything is fine" msgstr "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except URLError as e:\n" +" if hasattr(e, 'reason'):\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +" elif hasattr(e, 'code'):\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"else:\n" +" # everything is fine" msgid "info and geturl" -msgstr "" +msgstr "info و geturl" -msgid "The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is defined in the module :mod:`urllib.response`." +msgid "" +"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " +"instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is " +"defined in the module :mod:`urllib.response`." msgstr "" +"پاسخ برگردانده‌شده توسط urlopen (یا نمونه :exc:`~urllib.error.HTTPError`) " +"دارای دو متد مفید :meth:`!info` و :meth:`!geturl` است و در ماژول " +":mod:`urllib.response` تعریف شده است." -msgid "**geturl** - this returns the real URL of the page fetched. This is useful because ``urlopen`` (or the opener object used) may have followed a redirect. The URL of the page fetched may not be the same as the URL requested." +msgid "" +"**geturl** - this returns the real URL of the page fetched. This is useful " +"because ``urlopen`` (or the opener object used) may have followed a " +"redirect. The URL of the page fetched may not be the same as the URL " +"requested." msgstr "" +"**geturl** - URL واقعی صفحه واکشی‌شده را برمی‌گرداند. این مفید است، زیرا " +"ممکن است ``urlopen`` (یا شیء opener مورد استفاده) از یک تغییر مسیر پیروی " +"کرده باشد. ممکن است URL صفحه واکشی‌شده با URL درخواست‌شده یکسان نباشد." -msgid "**info** - this returns a dictionary-like object that describes the page fetched, particularly the headers sent by the server. It is currently an :class:`http.client.HTTPMessage` instance." +msgid "" +"**info** - this returns a dictionary-like object that describes the page " +"fetched, particularly the headers sent by the server. It is currently an " +":class:`http.client.HTTPMessage` instance." msgstr "" +"**info** - این یک شیء دیکشنری‌مانند برمی‌گرداند که صفحه واکشی‌شده را توصیف " +"می‌کند، به‌ویژه سرآیندهای ارسال‌شده از سوی سرور. این در حال حاضر یک نمونه " +":class:`http.client.HTTPMessage` است." -msgid "Typical headers include 'Content-length', 'Content-type', and so on. See the `Quick Reference to HTTP Headers `_ for a useful listing of HTTP headers with brief explanations of their meaning and use." +msgid "" +"Typical headers include 'Content-length', 'Content-type', and so on. See the" +" `Quick Reference to HTTP Headers `_ for a " +"useful listing of HTTP headers with brief explanations of their meaning and " +"use." msgstr "" +"سرآیندهای معمول شامل 'Content-length'، 'Content-type' و غیره هستند. برای " +"مشاهده‌ی فهرستی مفید از سرآیندهای HTTP با توضیحاتی مختصر درباره‌ی معنا و کاربرد " +"آن‌ها، `Quick Reference to HTTP Headers `_ را" +" ببینید." msgid "Openers and Handlers" -msgstr "" +msgstr "بازکننده‌ها و هندلرها" -msgid "When you fetch a URL you use an opener (an instance of the perhaps confusingly named :class:`urllib.request.OpenerDirector`). Normally we have been using the default opener - via ``urlopen`` - but you can create custom openers. Openers use handlers. All the \"heavy lifting\" is done by the handlers. Each handler knows how to open URLs for a particular URL scheme (http, ftp, etc.), or how to handle an aspect of URL opening, for example HTTP redirections or HTTP cookies." -msgstr "" +msgid "" +"When you fetch a URL you use an opener (an instance of the perhaps " +"confusingly named :class:`urllib.request.OpenerDirector`). Normally we have " +"been using the default opener - via ``urlopen`` - but you can create custom " +"openers. Openers use handlers. All the \"heavy lifting\" is done by the " +"handlers. Each handler knows how to open URLs for a particular URL scheme " +"(http, ftp, etc.), or how to handle an aspect of URL opening, for example " +"HTTP redirections or HTTP cookies." +msgstr "" +"هنگامی که یک URL را واکشی می‌کنید، از یک بازکننده (opener) استفاده می‌کنید " +"(نمونه‌ای از :class:`urllib.request.OpenerDirector` که شاید نام آن کمی " +"گیج‌کننده است). معمولاً از بازکننده‌ی پیش‌فرض، از طریق ``urlopen``، استفاده " +"کرده‌ایم، اما می‌توانید بازکننده‌های سفارشی ایجاد کنید. بازکننده‌ها از " +"هندلرها (handler) استفاده می‌کنند. تمام «کار سنگین» را هندلرها انجام" +" می‌دهند. هر هندلر می‌داند چگونه URL ها را برای یک طرح‌واره URL خاص (http، ftp" +" و غیره) باز کند، یا چگونه جنبه‌ای از باز کردن URL را مدیریت کند، برای مثال " +"تغییرمسیرهای HTTP یا کوکی‌های HTTP." -msgid "You will want to create openers if you want to fetch URLs with specific handlers installed, for example to get an opener that handles cookies, or to get an opener that does not handle redirections." +msgid "" +"You will want to create openers if you want to fetch URLs with specific " +"handlers installed, for example to get an opener that handles cookies, or to" +" get an opener that does not handle redirections." msgstr "" +"اگر بخواهید URLها را با هندلرهای (handlers) خاصی نصب‌شده واکشی کنید، " +"احتمالاً می‌خواهید بازکننده‌ها (openers) ایجاد کنید؛ برای مثال برای به دست " +"آوردن بازکننده‌ای که کوکی‌ها (cookies) را مدیریت می‌کند، یا بازکننده‌ای که " +"تغییرمسیرها (redirections) را مدیریت نمی‌کند." -msgid "To create an opener, instantiate an ``OpenerDirector``, and then call ``.add_handler(some_handler_instance)`` repeatedly." +msgid "" +"To create an opener, instantiate an ``OpenerDirector``, and then call " +"``.add_handler(some_handler_instance)`` repeatedly." msgstr "" +"برای ایجاد یک بازکننده (opener)، نمونه‌ای از ``OpenerDirector`` بسازید و " +"سپس ``.add_handler(some_handler_instance)`` را به‌طور مکرر فراخوانی کنید." -msgid "Alternatively, you can use ``build_opener``, which is a convenience function for creating opener objects with a single function call. ``build_opener`` adds several handlers by default, but provides a quick way to add more and/or override the default handlers." +msgid "" +"Alternatively, you can use ``build_opener``, which is a convenience function" +" for creating opener objects with a single function call. ``build_opener`` " +"adds several handlers by default, but provides a quick way to add more " +"and/or override the default handlers." msgstr "" +"به‌عنوان جایگزین، می‌توانید از ``build_opener`` استفاده کنید، که یک تابع " +"تسهیل‌کننده برای ایجاد اشیای بازکننده (opener) تنها با یک فراخوانی تابع است." +" ``build_opener`` چندین هندلر (handler) را به‌طور پیش‌فرض می‌افزاید، اما " +"راهی سریع برای افزودن هندلرهای بیشتر و/یا جایگزینی هندلرهای پیش‌فرض " +"فراهم می‌کند." -msgid "Other sorts of handlers you might want to can handle proxies, authentication, and other common but slightly specialised situations." +msgid "" +"Other sorts of handlers you might want to can handle proxies, " +"authentication, and other common but slightly specialised situations." msgstr "" +"انواع دیگر هندلرها (handlers) که ممکن است بخواهید، می‌توانند پراکسی‌ها،" +" احراز هویت و دیگر موقعیت‌های رایج اما کمی تخصصی را مدیریت کنند." -msgid "``install_opener`` can be used to make an ``opener`` object the (global) default opener. This means that calls to ``urlopen`` will use the opener you have installed." +msgid "" +"``install_opener`` can be used to make an ``opener`` object the (global) " +"default opener. This means that calls to ``urlopen`` will use the opener you" +" have installed." msgstr "" +"می‌توان از ``install_opener`` برای تبدیل یک شیء ``opener`` به بازکننده‌ی " +"پیش‌فرض (سراسری) استفاده کرد. این بدان معناست که فراخوانی‌های ``urlopen`` از" +" بازکننده‌ای که شما نصب کرده‌اید استفاده خواهند کرد." -msgid "Opener objects have an ``open`` method, which can be called directly to fetch urls in the same way as the ``urlopen`` function: there's no need to call ``install_opener``, except as a convenience." +msgid "" +"Opener objects have an ``open`` method, which can be called directly to " +"fetch urls in the same way as the ``urlopen`` function: there's no need to " +"call ``install_opener``, except as a convenience." msgstr "" +"اشیاء Opener یک متد ``open`` دارند که می‌توان آن را مستقیماً برای واکشی " +"نشانی‌های اینترنتی به همان شیوه‌ی تابع ``urlopen`` فراخوانی کرد: نیازی به " +"فراخوانی ``install_opener`` نیست، مگر برای سهولت." msgid "Basic Authentication" -msgstr "" +msgstr "احراز هویت پایه" -msgid "To illustrate creating and installing a handler we will use the ``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- including an explanation of how Basic Authentication works - see the `Basic Authentication Tutorial `__." -msgstr "" +msgid "" +"To illustrate creating and installing a handler we will use the " +"``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " +"including an explanation of how Basic Authentication works - see the `Basic " +"Authentication Tutorial " +"`__." +msgstr "" +"برای نشان دادن ایجاد و نصب یک هندلر (handler)، از " +"``HTTPBasicAuthHandler`` استفاده خواهیم کرد. برای بحث دقیق‌تر درباره این " +"موضوع — شامل توضیحی درباره چگونگی کارکرد احراز هویت پایه (Basic " +"Authentication) — `Basic Authentication Tutorial " +"`__" +" را ببینید." -msgid "When authentication is required, the server sends a header (as well as the 401 error code) requesting authentication. This specifies the authentication scheme and a 'realm'. The header looks like: ``WWW-Authenticate: SCHEME realm=\"REALM\"``." +msgid "" +"When authentication is required, the server sends a header (as well as the " +"401 error code) requesting authentication. This specifies the " +"authentication scheme and a 'realm'. The header looks like: ``WWW-" +"Authenticate: SCHEME realm=\"REALM\"``." msgstr "" +"هنگامی که احراز هویت لازم باشد، سرور یک سرآیند (به‌همراه کد خطای ۴۰۱) برای " +"درخواست احراز هویت ارسال می‌کند. این سرآیند، طرح‌واره احراز هویت و یک «قلمرو» " +"(realm) را مشخص می‌کند. سرآیند به این شکل است: ``WWW-Authenticate: SCHEME " +"realm=\"REALM\"``." msgid "e.g." -msgstr "" +msgstr "مثلاً" msgid "WWW-Authenticate: Basic realm=\"cPanel Users\"" -msgstr "" +msgstr "WWW-Authenticate: Basic realm=\"cPanel Users\"" -msgid "The client should then retry the request with the appropriate name and password for the realm included as a header in the request. This is 'basic authentication'. In order to simplify this process we can create an instance of ``HTTPBasicAuthHandler`` and an opener to use this handler." +msgid "" +"The client should then retry the request with the appropriate name and " +"password for the realm included as a header in the request. This is 'basic " +"authentication'. In order to simplify this process we can create an instance" +" of ``HTTPBasicAuthHandler`` and an opener to use this handler." msgstr "" +"سپس کلاینت باید درخواست را دوباره ارسال کند و نام و گذرواژه مناسب برای قلمرو" +" (realm) را به‌عنوان یک سرآیند در درخواست درج کند. این «احراز هویت پایه» است. " +"برای ساده‌سازی این فرایند، می‌توانیم یک نمونه از ``HTTPBasicAuthHandler`` و " +"یک بازکننده (opener) برای استفاده از این هندلر (handler) ایجاد کنیم." -msgid "The ``HTTPBasicAuthHandler`` uses an object called a password manager to handle the mapping of URLs and realms to passwords and usernames. If you know what the realm is (from the authentication header sent by the server), then you can use a ``HTTPPasswordMgr``. Frequently one doesn't care what the realm is. In that case, it is convenient to use ``HTTPPasswordMgrWithDefaultRealm``. This allows you to specify a default username and password for a URL. This will be supplied in the absence of you providing an alternative combination for a specific realm. We indicate this by providing ``None`` as the realm argument to the ``add_password`` method." -msgstr "" +msgid "" +"The ``HTTPBasicAuthHandler`` uses an object called a password manager to " +"handle the mapping of URLs and realms to passwords and usernames. If you " +"know what the realm is (from the authentication header sent by the server), " +"then you can use a ``HTTPPasswordMgr``. Frequently one doesn't care what the" +" realm is. In that case, it is convenient to use " +"``HTTPPasswordMgrWithDefaultRealm``. This allows you to specify a default " +"username and password for a URL. This will be supplied in the absence of you" +" providing an alternative combination for a specific realm. We indicate this" +" by providing ``None`` as the realm argument to the ``add_password`` method." +msgstr "" +"``HTTPBasicAuthHandler`` از یک شیء به نام مدیر گذرواژه برای مدیریت نگاشت " +"URLها و قلمروها (realm) به گذرواژه‌ها و نام‌های کاربری استفاده می‌کند. اگر " +"بدانید قلمرو چیست (از سرآیند احراز هویت ارسال‌شده توسط سرور)، می‌توانید از " +"``HTTPPasswordMgr`` استفاده کنید. اغلب مهم نیست که قلمرو چیست. در این حالت، " +"استفاده از ``HTTPPasswordMgrWithDefaultRealm`` مناسب است. این امکان را به " +"شما می‌دهد که یک نام کاربری و گذرواژه پیش‌فرض برای یک URL مشخص کنید. این " +"ترکیب در صورتی ارائه می‌شود که شما ترکیب جایگزینی برای یک قلمرو مشخص ارائه " +"ندهید. ما این موضوع را با ارائه ``None`` به‌عنوان آرگومان realm به متد " +"``add_password`` نشان می‌دهیم." -msgid "The top-level URL is the first URL that requires authentication. URLs \"deeper\" than the URL you pass to .add_password() will also match. ::" +msgid "" +"The top-level URL is the first URL that requires authentication. URLs " +"\"deeper\" than the URL you pass to .add_password() will also match. ::" msgstr "" +"URL سطح بالا، نخستین URL است که به احراز هویت نیاز دارد. URLهای «عمیق‌تر» " +"از URL داده‌شده به .add_password() نیز مطابقت خواهند داشت. ::" msgid "" "# create a password manager\n" @@ -408,39 +901,128 @@ msgid "" "# Now all calls to urllib.request.urlopen use our opener.\n" "urllib.request.install_opener(opener)" msgstr "" +"# یک مدیر گذرواژه ایجاد کنید\n" +"password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" +"\n" +"# نام کاربری و گذرواژه را اضافه کنید.\n" +"# اگر قلمرو (realm) را می‌دانستیم، می‌توانستیم به‌جای None از آن استفاده کنیم.\n" +"top_level_url = \"http://example.com/foo/\"\n" +"password_mgr.add_password(None, top_level_url, username, password)\n" +"\n" +"handler = urllib.request.HTTPBasicAuthHandler(password_mgr)\n" +"\n" +"# \"opener\" (نمونه OpenerDirector) ایجاد کنید\n" +"opener = urllib.request.build_opener(handler)\n" +"\n" +"# از opener برای واکشی یک URL استفاده کنید\n" +"opener.open(a_url)\n" +"\n" +"# opener را نصب کنید.\n" +"# اکنون همه فراخوانی‌های urllib.request.urlopen از opener ما استفاده می‌کنند.\n" +"urllib.request.install_opener(opener)" -msgid "In the above example we only supplied our ``HTTPBasicAuthHandler`` to ``build_opener``. By default openers have the handlers for normal situations -- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy` environment variable is set), ``UnknownHandler``, ``HTTPHandler``, ``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, ``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." -msgstr "" +msgid "" +"In the above example we only supplied our ``HTTPBasicAuthHandler`` to " +"``build_opener``. By default openers have the handlers for normal situations" +" -- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy` " +"environment variable is set), ``UnknownHandler``, ``HTTPHandler``, " +"``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " +"``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." +msgstr "" +"در مثال بالا، ما فقط ``HTTPBasicAuthHandler`` خودمان را به ``build_opener`` " +"ارائه دادیم. به‌طور پیش‌فرض، بازکننده‌ها (openers) دارای هندلرهایی " +"(handlers) برای شرایط عادی هستند -- ``ProxyHandler`` (اگر تنظیمی برای پراکسی" +" مانند متغیر محیطی :envvar:`!http_proxy` تنظیم شده باشد)، " +"``UnknownHandler``، ``HTTPHandler``، ``HTTPDefaultErrorHandler``، " +"``HTTPRedirectHandler``، ``FTPHandler``، ``FileHandler``، ``DataHandler``، " +"``HTTPErrorProcessor``." -msgid "``top_level_url`` is in fact *either* a full URL (including the 'http:' scheme component and the hostname and optionally the port number) e.g. ``\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, optionally including the port number) e.g. ``\"example.com\"`` or ``\"example.com:8080\"`` (the latter example includes a port number). The authority, if present, must NOT contain the \"userinfo\" component - for example ``\"joe:password@example.com\"`` is not correct." -msgstr "" +msgid "" +"``top_level_url`` is in fact *either* a full URL (including the 'http:' " +"scheme component and the hostname and optionally the port number) e.g. " +"``\"http://example.com/\"`` *or* an \"authority\" (i.e. the hostname, " +"optionally including the port number) e.g. ``\"example.com\"`` or " +"``\"example.com:8080\"`` (the latter example includes a port number). The " +"authority, if present, must NOT contain the \"userinfo\" component - for " +"example ``\"joe:password@example.com\"`` is not correct." +msgstr "" +"``top_level_url`` در واقع *یا* یک URL کامل است (شامل کامپوننت طرح‌واره " +"'http:'، نام میزبان و به‌اختیار شماره پورت) مثلاً " +"``\"http://example.com/\"`` *یا* یک مرجع (authority) (یعنی نام میزبان، " +"به‌اختیار شامل شماره پورت) مثلاً ``\"example.com\"`` یا " +"``\"example.com:8080\"`` (مثال دوم شامل شماره پورت است). مرجع، در صورت وجود،" +" نباید شامل کامپوننت «userinfo» باشد؛ برای مثال " +"``\"joe:password@example.com\"`` صحیح نیست." msgid "Proxies" -msgstr "" +msgstr "پراکسی‌ها" -msgid "**urllib** will auto-detect your proxy settings and use those. This is through the ``ProxyHandler``, which is part of the normal handler chain when a proxy setting is detected. Normally that's a good thing, but there are occasions when it may not be helpful [#]_. One way to do this is to setup our own ``ProxyHandler``, with no proxies defined. This is done using similar steps to setting up a `Basic Authentication`_ handler: ::" -msgstr "" +msgid "" +"**urllib** will auto-detect your proxy settings and use those. This is " +"through the ``ProxyHandler``, which is part of the normal handler chain when" +" a proxy setting is detected. Normally that's a good thing, but there are " +"occasions when it may not be helpful [#]_. One way to do this is to setup " +"our own ``ProxyHandler``, with no proxies defined. This is done using " +"similar steps to setting up a `Basic Authentication`_ handler: ::" +msgstr "" +"**urllib** تنظیمات پراکسی شما را به‌صورت خودکار تشخیص می‌دهد و از آن‌ها " +"استفاده می‌کند. این کار از طریق ``ProxyHandler`` انجام می‌شود، که هنگام " +"تشخیص یک تنظیم پراکسی، بخشی از زنجیره‌ی معمول هندلرها (handler chain) " +"است. به‌طور معمول، این موضوع خوبی است، اما مواردی وجود دارد که ممکن است مفید" +" نباشد [#]_. یکی از راه‌ها برای انجام این کار، راه‌اندازی ``ProxyHandler`` " +"خودمان، بدون تعریف هیچ پراکسی‌ای است. این کار با مراحلی مشابه راه‌اندازی یک " +"هندلر `Basic Authentication`_ انجام می‌شود: ::" msgid "" ">>> proxy_support = urllib.request.ProxyHandler({})\n" ">>> opener = urllib.request.build_opener(proxy_support)\n" ">>> urllib.request.install_opener(opener)" msgstr "" +">>> proxy_support = urllib.request.ProxyHandler({})\n" +">>> opener = urllib.request.build_opener(proxy_support)\n" +">>> urllib.request.install_opener(opener)" -msgid "Currently ``urllib.request`` *does not* support fetching of ``https`` locations through a proxy. However, this can be enabled by extending urllib.request as shown in the recipe [#]_." +msgid "" +"Currently ``urllib.request`` *does not* support fetching of ``https`` " +"locations through a proxy. However, this can be enabled by extending " +"urllib.request as shown in the recipe [#]_." msgstr "" +"در حال حاضر ``urllib.request`` از واکشی آدرس‌های ``https`` از طریق پراکسی " +"*پشتیبانی نمی‌کند*. با این حال، می‌توان این قابلیت را با گسترش " +"urllib.request، همان‌طور که در دستور [#]_ نشان داده شده است، فعال کرد." -msgid "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see the documentation on :func:`~urllib.request.getproxies`." +msgid "" +"``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " +"the documentation on :func:`~urllib.request.getproxies`." msgstr "" +"اگر متغیر ``REQUEST_METHOD`` تنظیم شده باشد، از ``HTTP_PROXY`` چشم‌پوشی " +"می‌شود؛ مستندات :func:`~urllib.request.getproxies` را ببینید." msgid "Sockets and Layers" -msgstr "" +msgstr "سوکت‌ها و لایه‌ها" -msgid "The Python support for fetching resources from the web is layered. urllib uses the :mod:`http.client` library, which in turn uses the socket library." +msgid "" +"The Python support for fetching resources from the web is layered. urllib " +"uses the :mod:`http.client` library, which in turn uses the socket library." msgstr "" +"پشتیبانی پایتون برای واکشی منابع از وب، لایه‌بندی‌شده است. urllib از " +"کتابخانه‌ی :mod:`http.client` استفاده می‌کند که خود به‌نوبه‌ی خود از کتابخانه‌ی" +" socket استفاده می‌کند." -msgid "As of Python 2.3 you can specify how long a socket should wait for a response before timing out. This can be useful in applications which have to fetch web pages. By default the socket module has *no timeout* and can hang. Currently, the socket timeout is not exposed at the http.client or urllib.request levels. However, you can set the default timeout globally for all sockets using ::" -msgstr "" +msgid "" +"As of Python 2.3 you can specify how long a socket should wait for a " +"response before timing out. This can be useful in applications which have to" +" fetch web pages. By default the socket module has *no timeout* and can " +"hang. Currently, the socket timeout is not exposed at the http.client or " +"urllib.request levels. However, you can set the default timeout globally for" +" all sockets using ::" +msgstr "" +"از پایتون 2.3 به بعد، می‌توانید مشخص کنید که یک سوکت پیش از آنکه مهلت زمانی " +"شود، چقدر باید برای دریافت پاسخ منتظر بماند. این می‌تواند در برنامه‌هایی که " +"باید صفحه‌های وب را واکشی کنند مفید باشد. به‌طور پیش‌فرض، ماژول socket *بدون" +" مهلت زمانی* است و ممکن است آویزان شود. در حال حاضر، مهلت زمانی سوکت در سطح " +"http.client یا urllib.request در دسترس نیست. با این حال، می‌توانید مهلت زمانی " +"پیش‌فرض را به‌صورت سراسری برای همه سوکت‌ها با استفاده از :: تنظیم کنید." msgid "" "import socket\n" @@ -455,27 +1037,68 @@ msgid "" "req = urllib.request.Request('http://www.voidspace.org.uk')\n" "response = urllib.request.urlopen(req)" msgstr "" +"import socket\n" +"import urllib.request\n" +"\n" +"# مهلت زمانی به ثانیه\n" +"timeout = 10\n" +"socket.setdefaulttimeout(timeout)\n" +"\n" +"# این فراخوانی urllib.request.urlopen اکنون از مهلت زمانی پیش‌فرضی استفاده می‌کند\n" +"# که در ماژول socket تنظیم کرده‌ایم\n" +"req = urllib.request.Request('http://www.voidspace.org.uk')\n" +"response = urllib.request.urlopen(req)" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" msgid "This document was reviewed and revised by John Lee." -msgstr "" +msgstr "این سند توسط جان لی بازبینی و اصلاح شد." msgid "Google for example." -msgstr "" +msgstr "برای مثال گوگل." -msgid "Browser sniffing is a very bad practice for website design - building sites using web standards is much more sensible. Unfortunately a lot of sites still send different versions to different browsers." +msgid "" +"Browser sniffing is a very bad practice for website design - building sites " +"using web standards is much more sensible. Unfortunately a lot of sites " +"still send different versions to different browsers." msgstr "" +"شناسایی مرورگر (browser sniffing) رویه‌ای بسیار بد در طراحی وب‌سایت است؛ " +"ساخت سایت‌ها با استفاده از استانداردهای وب بسیار منطقی‌تر است. متأسفانه " +"بسیاری از سایت‌ها همچنان نسخه‌های متفاوتی را به مرورگرهای مختلف ارسال " +"می‌کنند." -msgid "The user agent for MSIE 6 is *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)'*" +msgid "" +"The user agent for MSIE 6 is *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT" +" 5.1; SV1; .NET CLR 1.1.4322)'*" msgstr "" +"عامل کاربر برای MSIE 6 برابر است با *'Mozilla/4.0 (compatible; MSIE 6.0; " +"Windows NT 5.1; SV1; .NET CLR 1.1.4322)'*" -msgid "For details of more HTTP request headers, see `Quick Reference to HTTP Headers`_." +msgid "" +"For details of more HTTP request headers, see `Quick Reference to HTTP " +"Headers`_." msgstr "" +"برای جزئیات بیشتر درباره‌ی سرآیندهای درخواست HTTP، `Quick Reference to HTTP " +"Headers`_ را ببینید." -msgid "In my case I have to use a proxy to access the internet at work. If you attempt to fetch *localhost* URLs through this proxy it blocks them. IE is set to use the proxy, which urllib picks up on. In order to test scripts with a localhost server, I have to prevent urllib from using the proxy." +msgid "" +"In my case I have to use a proxy to access the internet at work. If you " +"attempt to fetch *localhost* URLs through this proxy it blocks them. IE is " +"set to use the proxy, which urllib picks up on. In order to test scripts " +"with a localhost server, I have to prevent urllib from using the proxy." msgstr "" +"در مورد من، باید برای دسترسی به اینترنت در محل کار از یک پراکسی استفاده کنم." +" اگر تلاش کنید URLهای *localhost* را از طریق این پراکسی واکشی کنید، آن‌ها " +"را مسدود می‌کند. IE برای استفاده از پراکسی تنظیم شده است و urllib این تنظیم " +"را تشخیص می‌دهد. برای آزمایش اسکریپت‌ها با یک سرور localhost، باید از " +"استفاده‌ی urllib از پراکسی جلوگیری کنم." -msgid "urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." +msgid "" +"urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe " +"`_." msgstr "" +"بازکننده‌ی urllib برای پراکسی SSL (متد CONNECT): `ASPN Cookbook Recipe " +"`_." diff --git a/improve-page-nojs.po b/improve-page-nojs.po index 5ac90b7b3..f37ec17d9 100644 --- a/improve-page-nojs.po +++ b/improve-page-nojs.po @@ -13,13 +13,14 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-07-25 12:59+0330\n" +"PO-Revision-Date: 2026-08-28 10:52+0330\n" "Last-Translator: invincible627 , 2026\n" "Language-Team: none\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" msgid "Improve a documentation page" msgstr "بهبود یک صفحه‌ی سند" @@ -31,7 +32,7 @@ msgid "If the bug or suggested improvement concerns the translation of this docu msgstr "اگر مشکل یا پیشنهاد بهبود مربوط به ترجمه‌ی این مستندات است، یک گزارش مشکل باز کنید یا صفحه را در `مخزن ترجمه `_ ویرایش کنید." msgid "You have a few ways to ask questions or suggest changes:" -msgstr "شما چند راه برای پرسیدن سؤال یا پیشنهاد تغییرات دارید." +msgstr "شما چند راه برای پرسیدن سؤال یا پیشنهاد تغییرات دارید:" msgid "You can start a discussion about the page on the Python discussion forum. This link will start a topic in the Documentation category: `New Documentation topic `_." msgstr "می‌توانید یک بحث درباره‌ی صفحه را در انجمن گفتگوی پایتون شروع کنید. این لینک یک موضوع از پیش‌تکمیل‌شده را شروع می‌کند: `سوال درباره‌ی صفحه \"PAGETITLE\" `_." diff --git a/improve-page.po b/improve-page.po index 371991af2..4e48db3c1 100644 --- a/improve-page.po +++ b/improve-page.po @@ -13,13 +13,14 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-07-25 12:59+0330\n" +"PO-Revision-Date: 2026-08-28 10:54+0330\n" "Last-Translator: invincible627 , 2026\n" "Language-Team: none\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" msgid "Improve a documentation page" msgstr "بهبود یک صفحه‌ی سند" @@ -34,7 +35,7 @@ msgid "If the bug or suggested improvement concerns the translation of this docu msgstr "اگر مشکل یا پیشنهاد بهبود مربوط به ترجمه‌ی این مستندات است، یک گزارش مشکل باز کنید یا صفحه را در `مخزن ترجمه `_ ویرایش کنید." msgid "You have a few ways to ask questions or suggest changes:" -msgstr "شما چند راه برای پرسیدن سؤال یا پیشنهاد تغییرات دارید." +msgstr "شما چند راه برای پرسیدن سؤال یا پیشنهاد تغییرات دارید:" msgid "You can start a discussion about the page on the Python discussion forum. This link will start a pre-populated topic: `Question about page \"PAGETITLE\" `_." msgstr "می‌توانید یک بحث درباره‌ی صفحه را در انجمن گفتگوی پایتون شروع کنید. این لینک یک موضوع از پیش‌تکمیل‌شده را شروع می‌کند: `سوال درباره‌ی صفحه \"PAGETITLE\" `_." diff --git a/installing/index.po b/installing/index.po index 963a4d521..78c4c09d9 100644 --- a/installing/index.po +++ b/installing/index.po @@ -25,166 +25,356 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Installing Python modules" -msgstr "" +msgstr "نصب ماژول‌های پایتون" -msgid "As a popular open source development project, Python has an active supporting community of contributors and users that also make their software available for other Python developers to use under open-source license terms." +msgid "" +"As a popular open source development project, Python has an active " +"supporting community of contributors and users that also make their software" +" available for other Python developers to use under open-source license " +"terms." msgstr "" +"پایتون به عنوان یک پروژه توسعه متن‌باز محبوب، دارای کامیونیتی پشتیبان فعالی " +"از مشارکت‌کنندگان و کاربران است که نرم‌افزار خود را نیز تحت شرایط مجوز " +"متن‌باز برای استفاده‌ی سایر توسعه‌دهندگان پایتون در دسترس قرار می‌دهند." -msgid "This allows Python users to share and collaborate effectively, benefiting from the solutions others have already created to common (and sometimes even rare!) problems, as well as potentially contributing their own solutions to the common pool." +msgid "" +"This allows Python users to share and collaborate effectively, benefiting " +"from the solutions others have already created to common (and sometimes even" +" rare!) problems, as well as potentially contributing their own solutions to" +" the common pool." msgstr "" +"این به کاربران پایتون امکان می‌دهد تا به‌طور مؤثر به اشتراک‌گذاری و همکاری " +"بپردازند؛ هم از راه‌حل‌هایی که دیگران پیش‌تر برای مشکلات رایج (و گاهی حتی " +"نادر!) ایجاد کرده‌اند بهره ببرند و هم به‌طور بالقوه راه‌حل‌های خود را به " +"مخزن مشترک بیفزایند." -msgid "This guide covers the installation part of the process. For a guide to creating and sharing your own Python projects, refer to the `Python packaging user guide`_." +msgid "" +"This guide covers the installation part of the process. For a guide to " +"creating and sharing your own Python projects, refer to the `Python " +"packaging user guide`_." msgstr "" +"این راهنما بخش نصب این فرایند را در بر می‌گیرد. برای راهنمایی درباره‌ی ایجاد" +" و اشتراک‌گذاری پروژه‌های پایتون خودتان، به `Python packaging user guide`_ " +"مراجعه کنید." -msgid "For corporate and other institutional users, be aware that many organisations have their own policies around using and contributing to open source software. Please take such policies into account when making use of the distribution and installation tools provided with Python." +msgid "" +"For corporate and other institutional users, be aware that many " +"organisations have their own policies around using and contributing to open " +"source software. Please take such policies into account when making use of " +"the distribution and installation tools provided with Python." msgstr "" +"برای کاربران شرکتی و سایر کاربران سازمانی، آگاه باشید که بسیاری از سازمان‌ها" +" سیاست‌های خاص خود را در زمینه استفاده از نرم‌افزارهای متن‌باز و مشارکت در " +"آن‌ها دارند. لطفاً هنگام استفاده از ابزارهای توزیع و نصب ارائه‌شده به همراه " +"پایتون، این سیاست‌ها را در نظر بگیرید." msgid "Key terms" -msgstr "" +msgstr "اصطلاحات کلیدی" -msgid ":program:`pip` is the preferred installer program. It is included by default with the Python binary installers." +msgid "" +":program:`pip` is the preferred installer program. It is included by default" +" with the Python binary installers." msgstr "" +":program:`pip` برنامه‌ی نصب‌کننده‌ی ترجیحی است. این برنامه به‌صورت پیش‌فرض " +"در نصب‌کننده‌های دودویی پایتون گنجانده شده است." -msgid "A *virtual environment* is a semi-isolated Python environment that allows packages to be installed for use by a particular application, rather than being installed system wide." +msgid "" +"A *virtual environment* is a semi-isolated Python environment that allows " +"packages to be installed for use by a particular application, rather than " +"being installed system wide." msgstr "" +"*محیط مجازی* یک محیط نیمه‌ایزوله‌ی پایتون است که اجازه می‌دهد بسته‌ها برای " +"استفاده‌ی یک برنامه‌ی خاص نصب شوند، نه به‌صورت سراسری در کل سیستم." -msgid "``venv`` is the standard tool for creating virtual environments. It defaults to installing :program:`pip` into all created virtual environments." +msgid "" +"``venv`` is the standard tool for creating virtual environments. It defaults" +" to installing :program:`pip` into all created virtual environments." msgstr "" +"``venv`` ابزار استاندارد برای ایجاد محیط‌های مجازی است. این ابزار به‌طور " +"پیش‌فرض :program:`pip` را در تمام محیط‌های مجازی ایجادشده نصب می‌کند." -msgid "``virtualenv`` is a third-party alternative (and predecessor) to ``venv``." -msgstr "" +msgid "" +"``virtualenv`` is a third-party alternative (and predecessor) to ``venv``." +msgstr "``virtualenv`` یک جایگزین شخص ثالث (و پیشینی) برای ``venv`` است." -msgid "The `Python Package Index (PyPI) `__ is a public repository of open source licensed packages made available for use by other Python users." +msgid "" +"The `Python Package Index (PyPI) `__ is a public " +"repository of open source licensed packages made available for use by other " +"Python users." msgstr "" +"`شاخص بسته‌های پایتون (PyPI) `__ یک مخزن عمومی از بسته‌های" +" دارای مجوز متن‌باز است که برای استفاده‌ی سایر کاربران پایتون در دسترس قرار " +"گرفته‌اند." -msgid "The `Python Packaging Authority `__ is the group of developers and documentation authors responsible for the maintenance and evolution of the standard packaging tools and the associated metadata and file format standards. They maintain a variety of tools, documentation, and issue trackers on `GitHub `__." -msgstr "" +msgid "" +"The `Python Packaging Authority `__ is the group of " +"developers and documentation authors responsible for the maintenance and " +"evolution of the standard packaging tools and the associated metadata and " +"file format standards. They maintain a variety of tools, documentation, and " +"issue trackers on `GitHub `__." +msgstr "" +"`Python Packaging Authority `__ گروهی از توسعه‌دهندگان" +" و نویسندگان مستندات است که مسئولیت نگهداری و تکامل ابزارهای استاندارد " +"بسته‌بندی و استانداردهای مرتبط با فراداده و قالب پرونده را بر عهده دارند. " +"آن‌ها ابزارها، مستندات و ردیاب‌های مشکل (issue tracker) گوناگونی را در " +"`GitHub `__ نگهداری می‌کنند." -msgid "The use of ``venv`` is now recommended for creating virtual environments." -msgstr "" +msgid "" +"The use of ``venv`` is now recommended for creating virtual environments." +msgstr "استفاده از ``venv`` اکنون برای ایجاد محیط‌های مجازی توصیه می‌شود." -msgid "`Python Packaging User Guide: Creating and using virtual environments `__" +msgid "" +"`Python Packaging User Guide: Creating and using virtual environments " +"`__" msgstr "" +"`راهنمای کاربری بسته‌بندی پایتون: ساخت و استفاده از محیط‌های مجازی " +"`__" msgid "Basic usage" -msgstr "" +msgstr "استفاده پایه" -msgid "The standard packaging tools are all designed to be used from the command line." +msgid "" +"The standard packaging tools are all designed to be used from the command " +"line." msgstr "" +"همه‌ی ابزارهای استاندارد بسته‌بندی برای استفاده از طریق خط فرمان طراحی " +"شده‌اند." -msgid "The following command will install the latest version of a module and its dependencies from PyPI::" +msgid "" +"The following command will install the latest version of a module and its " +"dependencies from PyPI::" msgstr "" +"دستور زیر آخرین نسخه‌ی یک ماژول و وابستگی‌های آن را از PyPI نصب می‌کند::" msgid "python -m pip install SomePackage" -msgstr "" +msgstr "python -m pip install SomePackage" -msgid "For POSIX users (including macOS and Linux users), the examples in this guide assume the use of a :term:`virtual environment`." +msgid "" +"For POSIX users (including macOS and Linux users), the examples in this " +"guide assume the use of a :term:`virtual environment`." msgstr "" +"برای کاربران POSIX (از جمله کاربران macOS و Linux)، مثال‌های این راهنما فرض " +"می‌کنند که از :term:`محیط مجازی ` استفاده می‌شود." -msgid "For Windows users, the examples in this guide assume that the option to adjust the system PATH environment variable was selected when installing Python." +msgid "" +"For Windows users, the examples in this guide assume that the option to " +"adjust the system PATH environment variable was selected when installing " +"Python." msgstr "" +"برای کاربران ویندوز، مثال‌های این راهنما فرض می‌کنند که هنگام نصب پایتون، " +"گزینه‌ی تنظیم متغیر محیطی PATH سیستم انتخاب شده باشد." -msgid "It's also possible to specify an exact or minimum version directly on the command line. When using comparator operators such as ``>``, ``<`` or some other special character which get interpreted by shell, the package name and the version should be enclosed within double quotes::" +msgid "" +"It's also possible to specify an exact or minimum version directly on the " +"command line. When using comparator operators such as ``>``, ``<`` or some " +"other special character which get interpreted by shell, the package name and" +" the version should be enclosed within double quotes::" msgstr "" +"همچنین می‌توانید نسخه‌ی دقیق یا حداقلی را مستقیماً در خط فرمان مشخص کنید. " +"هنگام استفاده از عملگرهای مقایسه‌ای مانند ``>`` و ``<`` یا هر نویسه‌ی خاص " +"دیگری که توسط پوسته تفسیر می‌شود، باید نام بسته و نسخه را داخل علامت نقل‌قول" +" دوتایی قرار دهید::" msgid "" "python -m pip install SomePackage==1.0.4 # specific version\n" "python -m pip install \"SomePackage>=1.0.4\" # minimum version" msgstr "" +"python -m pip install SomePackage==1.0.4 # نسخه‌ی مشخص\n" +"python -m pip install \"SomePackage>=1.0.4\" # نسخه‌ی حداقلی" -msgid "Normally, if a suitable module is already installed, attempting to install it again will have no effect. Upgrading existing modules must be requested explicitly::" +msgid "" +"Normally, if a suitable module is already installed, attempting to install " +"it again will have no effect. Upgrading existing modules must be requested " +"explicitly::" msgstr "" +"معمولاً، اگر ماژول مناسب از قبل نصب‌شده باشد، تلاش برای نصب مجدد آن هیچ اثری" +" نخواهد داشت. ارتقای ماژول‌های موجود باید صریحاً درخواست شود::" msgid "python -m pip install --upgrade SomePackage" -msgstr "" +msgstr "python -m pip install --upgrade SomePackage" -msgid "More information and resources regarding :program:`pip` and its capabilities can be found in the `Python Packaging User Guide `__." +msgid "" +"More information and resources regarding :program:`pip` and its capabilities" +" can be found in the `Python Packaging User Guide " +"`__." msgstr "" +"اطلاعات و منابع بیشتر درباره‌ی :program:`pip` و قابلیت‌های آن را می‌توانید " +"در `راهنمای کاربری بسته‌بندی پایتون `__ " +"بیابید." -msgid "Creation of virtual environments is done through the :mod:`venv` module. Installing packages into an active virtual environment uses the commands shown above." +msgid "" +"Creation of virtual environments is done through the :mod:`venv` module. " +"Installing packages into an active virtual environment uses the commands " +"shown above." msgstr "" +"ایجاد محیط‌های مجازی از طریق ماژول :mod:`venv` انجام می‌شود. نصب بسته‌ها در " +"یک محیط مجازی فعال از دستورهای نشان‌داده‌شده در بالا استفاده می‌کند." -msgid "`Python Packaging User Guide: Installing Python Distribution Packages `__" +msgid "" +"`Python Packaging User Guide: Installing Python Distribution Packages " +"`__" msgstr "" +"`راهنمای کاربر بسته‌بندی پایتون: نصب بسته‌های توزیع پایتون " +"`__" msgid "How do I ...?" -msgstr "" +msgstr "چگونه می‌توانم ...؟" msgid "These are quick answers or links for some common tasks." -msgstr "" +msgstr "این‌ها پاسخ‌های سریع یا پیوندهایی برای برخی از کارهای رایج هستند." msgid "... install packages just for the current user?" -msgstr "" +msgstr "... بسته‌ها را فقط برای کاربر فعلی نصب کنم؟" -msgid "Passing the ``--user`` option to ``python -m pip install`` will install a package just for the current user, rather than for all users of the system." +msgid "" +"Passing the ``--user`` option to ``python -m pip install`` will install a " +"package just for the current user, rather than for all users of the system." msgstr "" +"با دادن گزینه‌ی ``--user`` به ``python -m pip install``، بسته‌ای فقط برای " +"کاربر فعلی نصب می‌شود، نه برای همه‌ی کاربران سیستم." msgid "... install scientific Python packages?" -msgstr "" +msgstr "... بسته‌های علمی پایتون را نصب کنم؟" -msgid "A number of scientific Python packages have complex binary dependencies, and aren't currently easy to install using :program:`pip` directly. It will often be easier for users to install these packages by `other means `__ rather than attempting to install them with :program:`pip`." -msgstr "" +msgid "" +"A number of scientific Python packages have complex binary dependencies, and" +" aren't currently easy to install using :program:`pip` directly. It will " +"often be easier for users to install these packages by `other means " +"`__ rather than attempting to install" +" them with :program:`pip`." +msgstr "" +"تعدادی از بسته‌های علمی پایتون وابستگی‌های دودویی پیچیده‌ای دارند و در حال " +"حاضر نصب مستقیم آن‌ها با :program:`pip` آسان نیست. اغلب برای کاربران آسان‌تر" +" خواهد بود که این بسته‌ها را از طریق `روش‌های دیگر " +"`__ نصب کنند، به‌جای تلاش برای نصب " +"آن‌ها با :program:`pip`." -msgid "`Python Packaging User Guide: Installing Scientific Packages `__" +msgid "" +"`Python Packaging User Guide: Installing Scientific Packages " +"`__" msgstr "" +"`راهنمای کاربر بسته‌بندی پایتون: نصب بسته‌های علمی " +"`__" msgid "... work with multiple versions of Python installed in parallel?" -msgstr "" +msgstr "... با چندین نسخه از پایتون که به‌صورت موازی نصب شده‌اند کار کنم؟" -msgid "On Linux, macOS, and other POSIX systems, use the versioned Python commands in combination with the ``-m`` switch to run the appropriate copy of :program:`pip`::" +msgid "" +"On Linux, macOS, and other POSIX systems, use the versioned Python commands " +"in combination with the ``-m`` switch to run the appropriate copy of " +":program:`pip`::" msgstr "" +"در لینوکس، macOS و دیگر سیستم‌های POSIX، از دستورهای پایتون نسخه‌دار در " +"ترکیب با سوییچ ``-m`` برای اجرای کپی مناسب :program:`pip` استفاده کنید::" msgid "" "python3 -m pip install SomePackage # default Python 3\n" "python3.14 -m pip install SomePackage # specifically Python 3.14" msgstr "" +"python3 -m pip install SomePackage # پایتون 3 پیش‌فرض\n" +"python3.14 -m pip install SomePackage # به‌طور خاص پایتون 3.14" msgid "Appropriately versioned :program:`pip` commands may also be available." msgstr "" +"دستورهای :program:`pip` با نسخه‌بندی مناسب نیز ممکن است در دسترس باشند." -msgid "On Windows, use the :program:`py` Python launcher in combination with the ``-m`` switch::" +msgid "" +"On Windows, use the :program:`py` Python launcher in combination with the " +"``-m`` switch::" msgstr "" +"در ویندوز، از راه‌انداز پایتون :program:`py` در ترکیب با سوییچ ``-m`` " +"استفاده کنید::" msgid "" "py -3 -m pip install SomePackage # default Python 3\n" "py -3.14 -m pip install SomePackage # specifically Python 3.14" msgstr "" +"py -3 -m pip install SomePackage # پایتون 3 پیش‌فرض\n" +"py -3.14 -m pip install SomePackage # به‌طور خاص پایتون 3.14" msgid "Common installation issues" -msgstr "" +msgstr "مشکلات رایج نصب" msgid "Installing into the system Python on Linux" -msgstr "" +msgstr "نصب در پایتون سیستمی روی لینوکس" -msgid "On Linux systems, a Python installation will typically be included as part of the distribution. Installing into this Python installation requires root access to the system, and may interfere with the operation of the system package manager and other components of the system if a component is unexpectedly upgraded using :program:`pip`." +msgid "" +"On Linux systems, a Python installation will typically be included as part " +"of the distribution. Installing into this Python installation requires root " +"access to the system, and may interfere with the operation of the system " +"package manager and other components of the system if a component is " +"unexpectedly upgraded using :program:`pip`." msgstr "" +"در سامانه‌های لینوکسی، معمولاً یک نصب پایتون به عنوان بخشی از توزیع گنجانده " +"می‌شود. نصب در این نصب پایتون نیازمند دسترسی root به سامانه است و در صورت " +"ارتقای غیرمنتظره‌ی یک جزء با استفاده از :program:`pip`، ممکن است در عملکرد " +"مدیر بسته‌ی سامانه و سایر اجزای سامانه اختلال ایجاد کند." -msgid "On such systems, it is often better to use a virtual environment or a per-user installation when installing packages with :program:`pip`." +msgid "" +"On such systems, it is often better to use a virtual environment or a per-" +"user installation when installing packages with :program:`pip`." msgstr "" +"در چنین سیستم‌هایی، هنگام نصب بسته‌ها با :program:`pip`، اغلب بهتر است از یک" +" محیط مجازی یا نصب در سطح کاربر استفاده کنید." msgid "Pip not installed" -msgstr "" +msgstr "Pip نصب نشده است" -msgid "It is possible that :program:`pip` does not get installed by default. One potential fix is::" +msgid "" +"It is possible that :program:`pip` does not get installed by default. One " +"potential fix is::" msgstr "" +"ممکن است :program:`pip` به‌صورت پیش‌فرض نصب نشود. یک راه‌حل احتمالی این " +"است::" msgid "python -m ensurepip --default-pip" -msgstr "" +msgstr "python -m ensurepip --default-pip" -msgid "There are also additional resources for `installing pip `__." +msgid "" +"There are also additional resources for `installing pip " +"`__." msgstr "" +"همچنین منابع اضافی برای `نصب pip " +"`__ وجود دارد." msgid "Installing binary extensions" -msgstr "" +msgstr "نصب ماژول‌های توسعه‌ای دودویی" -msgid "Python once relied heavily on source-based distribution, with end users being expected to compile extension modules from source as part of the installation process." +msgid "" +"Python once relied heavily on source-based distribution, with end users " +"being expected to compile extension modules from source as part of the " +"installation process." msgstr "" +"پایتون زمانی تکیه‌ی سنگینی بر توزیع مبتنی بر کد منبع داشت و از کاربران نهایی" +" انتظار می‌رفت که ماژول‌های توسعه‌ای را به عنوان بخشی از فرایند نصب، از کد " +"منبع کامپایل کنند." -msgid "With the introduction of the binary wheel format, and the ability to publish wheels through PyPI, this problem is diminishing, as users are more regularly able to install pre-built extensions rather than needing to build them themselves." +msgid "" +"With the introduction of the binary wheel format, and the ability to publish" +" wheels through PyPI, this problem is diminishing, as users are more " +"regularly able to install pre-built extensions rather than needing to build " +"them themselves." msgstr "" +"با معرفی قالب چرخ (wheel) دودویی و امکان انتشار چرخ‌ها از طریق PyPI، این " +"مشکل در حال کاهش است، زیرا کاربران به‌طور منظم‌تری می‌توانند افزونه‌های " +"پیش‌ساخته را نصب کنند، به‌جای اینکه ناچار باشند خودشان آن‌ها را بسازند." -msgid "Some of the solutions for installing `scientific software `__ that are not yet available as pre-built wheel files may also help with obtaining other binary extensions without needing to build them locally." +msgid "" +"Some of the solutions for installing `scientific software " +"`__ that are not yet available as " +"pre-built wheel files may also help with obtaining other binary extensions " +"without needing to build them locally." msgstr "" +"برخی از راه‌حل‌های نصب `نرم‌افزار علمی " +"`__ که هنوز به‌صورت فایل‌های wheel " +"پیش‌ساخته در دسترس نیست، ممکن است در به‌دست آوردن سایر توسعه‌های دودویی بدون" +" نیاز به ساخت آن‌ها به‌طور محلی نیز کمک کنند." -msgid "`Python Packaging User Guide: Binary Extensions `__" +msgid "" +"`Python Packaging User Guide: Binary Extensions " +"`__" msgstr "" +"`راهنمای کاربر بسته‌بندی پایتون: ماژول‌های توسعه‌ای دودویی " +"`__" diff --git a/library/__future__.po b/library/__future__.po index a864a15aa..97bbbcd53 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"PO-Revision-Date: 2026-08-28 11:24+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,6 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!__future__` --- Future statement definitions" msgstr ":mod:`!__future__` --- تعاریف دستورات آینده" @@ -31,7 +32,7 @@ msgid "**Source code:** :source:`Lib/__future__.py`" msgstr "**کد منبع:** :source:`Lib/__future__.py`" msgid "Imports of the form ``from __future__ import feature`` are called :ref:`future statements `. These are special-cased by the Python compiler to allow the use of new Python features in modules containing the future statement before the release in which the feature becomes standard." -msgstr "ایمپورت‌هایی به شکل ``from __future__ import feature``، :ref:`future statements ` نامیده می‌شوند. این موارد توسط کامپایلر پایتون به‌صورت ویژه درنظر گرفته می‌شوند تا امکان استفاده از ویژگیهای جدید پایتون را در ماژول‌هایی که شامل دستور آینده هستند، قبل از نسخه‌ای که آن ویژگی به‌صورت استاندارد درمی‌آید، فراهم کنند." +msgstr "ایمپورت‌هایی به شکل ``from __future__ import feature``، :ref:`future statements ` نامیده می‌شوند. این موارد توسط کامپایلر پایتون به‌صورت ویژه درنظر گرفته می‌شوند تا امکان استفاده از ویژگی‌های جدید پایتون را در ماژول‌هایی که شامل دستور آینده هستند، قبل از نسخه‌ای که آن ویژگی به‌صورت استاندارد درمی‌آید، فراهم کنند." msgid "While these future statements are given additional special meaning by the Python compiler, they are still executed like any other import statement and the :mod:`!__future__` exists and is handled by the import system the same way any other Python module would be. This design serves three purposes:" msgstr "اگرچه این دستورات آینده‌نگر به‌واسطه کامپایلر پایتون معنای ویژه‌ای پیدا می‌کنند، اما همچنان مانند هر دستور ایمپورت دیگری اجرا می‌شوند. ماژول :mod:`!__future__` وجود دارد و توسط سازوکار ایمپورت، دقیقاً مانند هر ماژول پایتون دیگری مدیریت می‌شود. این طراحی سه هدف را دنبال می‌کند:" @@ -43,7 +44,7 @@ msgid "To document when incompatible changes were introduced, and when they will msgstr "برای مستندسازی زمان معرفی تغییرات ناسازگار و زمانی که این تغییرات اجباری خواهند شد --- یا شده‌اند، این نوعی مستندسازی قابل‌اجرا است، و می‌توان آن را به‌صورت برنامه‌نویسی با ایمپورت کردن :mod:`!__future__` و بررسی محتویات آن مشاهده کرد." msgid "To ensure that :ref:`future statements ` run under releases prior to Python 2.1 at least yield runtime exceptions (the import of :mod:`!__future__` will fail, because there was no module of that name prior to 2.1)." -msgstr "برای اطمینان از اینکه :ref:`future statements ` در نسخه‌های پیش از پایتون 2.1 حداقل استثناهای زمان اجرا ایجاد می‌کنند (ایمپورت کردن :mod:`!__future__` با شکست مواجه خواهد شد، زیرا هیچ ماژولی با آن نام پیش از نسخه‌ی ۲.۱ وجود نداشته است)." +msgstr "برای اطمینان از اینکه :ref:`future statements ` در نسخه‌های پیش از پایتون 2.1 حداقل استثناهای ران‌تایم پرتاب می‌کنند (ایمپورت کردن :mod:`!__future__` با شکست مواجه خواهد شد، زیرا هیچ ماژولی با آن نام پیش از نسخه‌ی ۲.۱ وجود نداشته است)." msgid "Module Contents" msgstr "محتویات ماژول" @@ -109,7 +110,7 @@ msgid ":pep:`3105`: *Make print a function*" msgstr ":pep:`3105`: *تبدیل print به یک تابع*" msgid ":pep:`3112`: *Bytes literals in Python 3000*" -msgstr ":pep:`3112`: *لیترال‌های بایت در پایتون ۳۰۰۰*" +msgstr ":pep:`3112`: *مقادیر لفظی بایت در پایتون ۳۰۰۰*" msgid "3.5.0b1" msgstr "3.5.0b1" @@ -127,7 +128,7 @@ msgid "Never [1]_" msgstr "هرگز [1]_" msgid ":pep:`563`: *Postponed evaluation of annotations*, :pep:`649`: *Deferred evaluation of annotations using descriptors*" -msgstr ":pep:`563`: *ارزیابی به‌تعویق‌افتادهٔ annotationها*، :pep:`649`: *ارزیابی به‌تعویق‌افتادهٔ annotationها با استفاده از توصیفگرها*" +msgstr ":pep:`563`: *ارزیابی به‌تعویق‌افتاده‌ی annotationها*، :pep:`649`: *ارزیابی به‌تعویق‌افتاده‌ی annotationها با استفاده از توصیف‌گرها*" msgid "Each statement in :file:`__future__.py` is of the form::" msgstr "هر دستور در :file:`__future__.py` به شکل زیر است::" @@ -179,7 +180,7 @@ msgid ":ref:`future`" msgstr ":ref:`future`" msgid "How the compiler treats future imports." -msgstr "نحوه‌ی برخورد کامپایلر با ایمپورت‌های future" +msgstr "نحوه‌ی برخورد کامپایلر با ایمپورت‌های future." msgid ":pep:`236` - Back to the __future__" msgstr ":pep:`236` - بازگشت به __future__" diff --git a/library/__main__.po b/library/__main__.po index 2fc17b9d0..a5ad2432e 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -41,7 +41,7 @@ msgid "``__name__ == '__main__'``" msgstr "``__name__ == '__main__'``" msgid "When a Python module or package is imported, ``__name__`` is set to the module's name. Usually, this is the name of the Python file itself without the ``.py`` extension::" -msgstr "هنگامی که یک ماژول یا بستهٔ پایتون ایمپورت می‌شود، ``__name__`` به نام ماژول تنظیم می‌شود. معمولاً این همان نام فایل پایتون است بدون پسوند ``.py``::" +msgstr "هنگامی که یک ماژول یا بسته‌ی پایتون ایمپورت می‌شود، ``__name__`` به نام ماژول تنظیم می‌شود. معمولاً این همان نام فایل پایتون است بدون پسوند ``.py``::" msgid "" ">>> import configparser\n" @@ -53,7 +53,7 @@ msgstr "" "'configparser'" msgid "If the file is part of a package, ``__name__`` will also include the parent package's path::" -msgstr "اگر فایل بخشی از یک بسته باشد، ``__name__`` همچنین مسیر بستهٔ والد را شامل خواهد شد::" +msgstr "اگر فایل بخشی از یک بسته باشد، ``__name__`` همچنین مسیر بسته‌ی والد را شامل خواهد شد::" msgid "" ">>> from concurrent.futures import process\n" diff --git a/library/_thread.po b/library/_thread.po index 0305e2905..bcbf0bfd9 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -13,7 +13,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"PO-Revision-Date: 2026-08-28 11:25+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -21,120 +21,279 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!_thread` --- Low-level threading API" -msgstr "" +msgstr ":mod:`!_thread` --- API نخ‌بندی سطح پایین" -msgid "This module provides low-level primitives for working with multiple threads (also called :dfn:`light-weight processes` or :dfn:`tasks`) --- multiple threads of control sharing their global data space. For synchronization, simple locks (also called :dfn:`mutexes` or :dfn:`binary semaphores`) are provided. The :mod:`threading` module provides an easier to use and higher-level threading API built on top of this module." -msgstr "" +msgid "" +"This module provides low-level primitives for working with multiple threads " +"(also called :dfn:`light-weight processes` or :dfn:`tasks`) --- multiple " +"threads of control sharing their global data space. For synchronization, " +"simple locks (also called :dfn:`mutexes` or :dfn:`binary semaphores`) are " +"provided. The :mod:`threading` module provides an easier to use and higher-" +"level threading API built on top of this module." +msgstr "" +"این ماژول، ساختارهای اولیه سطح‌پایینی برای کار با چندین نخ (که به " +"آن‌ها :dfn:`فرایندهای سبک‌وزن ` یا :dfn:`وظایف " +"` نیز گفته می‌شود) --- چندین نخ کنترل که فضای داده سراسری خود را به " +"اشتراک می‌گذارند. برای همگام‌سازی، قفل‌های ساده‌ای (که به آن‌ها :dfn:`موتکس‌ها " +"` یا :dfn:`سمافورهای دودویی ` نیز گفته می‌شود) " +"فراهم شده‌اند. ماژول :mod:`threading`، یک API نخ‌بندی سطح‌بالا و آسان‌تر برای " +"استفاده ارائه می‌دهد که بر پایه این ماژول ساخته شده است." msgid "This module used to be optional, it is now always available." -msgstr "" +msgstr "این ماژول پیش‌تر اختیاری بود، اما اکنون همیشه در دسترس است." msgid "This module defines the following constants and functions:" -msgstr "" +msgstr "این ماژول ثابت‌ها و توابع زیر را تعریف می‌کند:" msgid "Raised on thread-specific errors." -msgstr "" +msgstr "در صورت بروز خطاهای مختص نخ پرتاب می‌شود." msgid "This is now a synonym of the built-in :exc:`RuntimeError`." -msgstr "" +msgstr "این اکنون مترادفی با :exc:`RuntimeError` توکار است." -msgid "Start a new thread and return its identifier. The thread executes the function *function* with the argument list *args* (which must be a tuple). The optional *kwargs* argument specifies a dictionary of keyword arguments." +msgid "" +"Start a new thread and return its identifier. The thread executes the " +"function *function* with the argument list *args* (which must be a tuple). " +"The optional *kwargs* argument specifies a dictionary of keyword arguments." msgstr "" +"یک نخ جدید آغاز می‌کند و شناسه‌ی آن را برمی‌گرداند. این نخ تابع *function* را " +"با فهرست آرگومان *args* (که باید یک تاپل باشد) اجرا می‌کند. آرگومان اختیاری " +"*kwargs* یک دیکشنری از آرگومان‌های کلیدواژه‌ای را مشخص می‌کند." msgid "When the function returns, the thread silently exits." -msgstr "" +msgstr "هنگامی که تابع بازگشت می‌کند، نخ به‌صورت بی‌صدا خارج می‌شود." -msgid "When the function terminates with an unhandled exception, :func:`sys.unraisablehook` is called to handle the exception. The *object* attribute of the hook argument is *function*. By default, a stack trace is printed and then the thread exits (but other threads continue to run)." +msgid "" +"When the function terminates with an unhandled " +"exception, :func:`sys.unraisablehook` is called to handle the exception. " +"The *object* attribute of the hook argument is *function*. By default, a " +"stack trace is printed and then the thread exits (but other threads " +"continue to run)." msgstr "" +"هنگامی که تابع با یک استثنای مدیریت‌نشده پایان " +"می‌یابد، :func:`sys.unraisablehook` برای مدیریت استثنا فراخوانی می‌شود. ویژگی " +"*object* آرگومان هوک ، *function* است. به‌طور پیش‌فرض، یک ردگیری پشته " +"چاپ می‌شود و سپس نخ خارج می‌شود (اما سایر نخ‌ها به اجرا ادامه می‌دهند)." -msgid "When the function raises a :exc:`SystemExit` exception, it is silently ignored." +msgid "" +"When the function raises a :exc:`SystemExit` exception, it is silently " +"ignored." msgstr "" +"هنگامی که تابع استثنای :exc:`SystemExit` را پرتاب می‌کند، این استثنا به‌طور " +"بی‌صدا نادیده گرفته می‌شود." -msgid "Raises an :ref:`auditing event ` ``_thread.start_new_thread`` with arguments ``function``, ``args``, ``kwargs``." +msgid "" +"Raises an :ref:`auditing event ` ``_thread.start_new_thread`` " +"with arguments ``function``, ``args``, ``kwargs``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``_thread.start_new_thread`` را با " +"آرگومان‌های ``function``، ``args`` و ``kwargs`` پرتاب می‌کند." msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." msgstr "" +":func:`sys.unraisablehook` اکنون برای رسیدگی به استثناهای رسیدگی‌نشده " +"استفاده می‌شود." -msgid "Simulate the effect of a signal arriving in the main thread. A thread can use this function to interrupt the main thread, though there is no guarantee that the interruption will happen immediately." +msgid "" +"Simulate the effect of a signal arriving in the main thread. A thread can " +"use this function to interrupt the main thread, though there is no " +"guarantee that the interruption will happen immediately." msgstr "" +"اثر رسیدن یک سیگنال به نخ اصلی را شبیه‌سازی می‌کند. یک نخ می‌تواند از این تابع " +"برای ایجاد وقفه در نخ اصلی استفاده کند، هرچند هیچ تضمینی وجود ندارد که وقفه " +"بلافاصله رخ دهد." -msgid "If given, *signum* is the number of the signal to simulate. If *signum* is not given, :const:`signal.SIGINT` is simulated." +msgid "" +"If given, *signum* is the number of the signal to simulate. If *signum* is " +"not given, :const:`signal.SIGINT` is simulated." msgstr "" +"در صورت داده شدن، *signum* شماره سیگنالی است که شبیه‌سازی می‌شود. اگر " +"*signum* داده نشود، :const:`signal.SIGINT` شبیه‌سازی می‌شود." -msgid "If the given signal isn't handled by Python (it was set to :const:`signal.SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." +msgid "" +"If the given signal isn't handled by Python (it was set " +"to :const:`signal.SIG_DFL` or :const:`signal.SIG_IGN`), this function does " +"nothing." msgstr "" +"اگر سیگنال داده‌شده توسط پایتون مدیریت نشود (روی :const:`signal.SIG_DFL` " +"یا :const:`signal.SIG_IGN` تنظیم شده باشد)، این تابع هیچ کاری انجام نمی‌دهد." msgid "The *signum* argument is added to customize the signal number." -msgstr "" +msgstr "آرگومان *signum* برای سفارشی‌سازی شماره سیگنال افزوده شده است." -msgid "This does not emit the corresponding signal but schedules a call to the associated handler (if it exists). If you want to truly emit the signal, use :func:`signal.raise_signal`." +msgid "" +"This does not emit the corresponding signal but schedules a call to the " +"associated handler (if it exists). If you want to truly emit the signal, " +"use :func:`signal.raise_signal`." msgstr "" +"این کار سیگنال متناظر را صادر نمی‌کند، بلکه فراخوانی هندلر مرتبط را " +"زمان‌بندی می‌کند (در صورت وجود). اگر می‌خواهید واقعاً سیگنال را صادر کنید، " +"از :func:`signal.raise_signal` استفاده کنید." -msgid "Raise the :exc:`SystemExit` exception. When not caught, this will cause the thread to exit silently." +msgid "" +"Raise the :exc:`SystemExit` exception. When not caught, this will cause " +"the thread to exit silently." msgstr "" +"استثنای :exc:`SystemExit` را پرتاب می‌کند. هنگامی که گرفته نشود، باعث می‌شود " +"نخ به‌صورت خاموش خارج شود." -msgid "Return a new lock object. Methods of locks are described below. The lock is initially unlocked." +msgid "" +"Return a new lock object. Methods of locks are described below. The lock " +"is initially unlocked." msgstr "" +"یک شیء قفل جدید برمی‌گرداند. متدهای قفل‌ها در ادامه توضیح داده شده‌اند. قفل در " +"ابتدا باز است." -msgid "Return the 'thread identifier' of the current thread. This is a nonzero integer. Its value has no direct meaning; it is intended as a magic cookie to be used e.g. to index a dictionary of thread-specific data. Thread identifiers may be recycled when a thread exits and another thread is created." -msgstr "" +msgid "" +"Return the 'thread identifier' of the current thread. This is a nonzero " +"integer. Its value has no direct meaning; it is intended as a magic cookie " +"to be used e.g. to index a dictionary of thread-specific data. Thread " +"identifiers may be recycled when a thread exits and another thread is " +"created." +msgstr "" +"شناسه‌ی نخ جاری را برمی‌گرداند. این یک عدد صحیح غیرصفر است. مقدار آن معنای " +"مستقیمی ندارد؛ این مقدار به‌عنوان یک کوکی جادویی (magic cookie) در نظر گرفته " +"شده است تا برای مثال در اندیس‌گذاری یک دیکشنری از داده‌های مختص نخ استفاده " +"شود. ممکن است شناسه‌های نخ هنگامی که یک نخ خارج می‌شود و نخ دیگری ایجاد " +"می‌شود، دوباره استفاده شوند." -msgid "Return the native integral Thread ID of the current thread assigned by the kernel. This is a non-negative integer. Its value may be used to uniquely identify this particular thread system-wide (until the thread terminates, after which the value may be recycled by the OS)." +msgid "" +"Return the native integral Thread ID of the current thread assigned by the " +"kernel. This is a non-negative integer. Its value may be used to uniquely " +"identify this particular thread system-wide (until the thread terminates, " +"after which the value may be recycled by the OS)." msgstr "" +"شناسه‌ی نخ بومیِ نخ جاری را که یک عدد صحیح است و توسط هسته اختصاص داده شده " +"است، برمی‌گرداند. این یک عدد صحیح نامنفی است. می‌توان از مقدار آن برای " +"شناسایی یکتای این نخ خاص در سراسر سیستم استفاده کرد (تا زمانی که نخ خاتمه " +"یابد؛ پس از آن ممکن است مقدار توسط سیستم‌عامل بازیافت شود)." msgid "Availability" -msgstr "" +msgstr "دسترسی‌پذیری" msgid "Added support for GNU/kFreeBSD." -msgstr "" +msgstr "پشتیبانی از GNU/kFreeBSD افزوده شد." -msgid "Return the thread stack size used when creating new threads. The optional *size* argument specifies the stack size to be used for subsequently created threads, and must be 0 (use platform or configured default) or a positive integer value of at least 32,768 (32 KiB). If *size* is not specified, 0 is used. If changing the thread stack size is unsupported, a :exc:`RuntimeError` is raised. If the specified stack size is invalid, a :exc:`ValueError` is raised and the stack size is unmodified. 32 KiB is currently the minimum supported stack size value to guarantee sufficient stack space for the interpreter itself. Note that some platforms may have particular restrictions on values for the stack size, such as requiring a minimum stack size > 32 KiB or requiring allocation in multiples of the system memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information)." -msgstr "" +msgid "" +"Return the thread stack size used when creating new threads. The optional " +"*size* argument specifies the stack size to be used for subsequently " +"created threads, and must be 0 (use platform or configured default) or a " +"positive integer value of at least 32,768 (32 KiB). If *size* is not " +"specified, 0 is used. If changing the thread stack size is unsupported, " +"a :exc:`RuntimeError` is raised. If the specified stack size is invalid, " +"a :exc:`ValueError` is raised and the stack size is unmodified. 32 KiB is " +"currently the minimum supported stack size value to guarantee sufficient " +"stack space for the interpreter itself. Note that some platforms may have " +"particular restrictions on values for the stack size, such as requiring a " +"minimum stack size > 32 KiB or requiring allocation in multiples of the " +"system memory page size - platform documentation should be referred to for " +"more information (4 KiB pages are common; using multiples of 4096 for the " +"stack size is the suggested approach in the absence of more specific " +"information)." +msgstr "" +"اندازه‌ی پشته‌ی نخ را که هنگام ایجاد نخ‌های جدید استفاده می‌شود، برمی‌گرداند. " +"آرگومان اختیاری *size* اندازه‌ی پشته‌ای را مشخص می‌کند که برای نخ‌های ایجادشده " +"بعدی استفاده می‌شود، و باید ۰ (استفاده از پیش‌فرض پلتفرم یا پیش‌فرض " +"پیکربندی‌شده) یا یک مقدار عدد صحیح مثبت با حداقل ۳۲٬۷۶۸ (۳۲ KiB) باشد. اگر " +"*size* مشخص نشده باشد، ۰ استفاده می‌شود. اگر تغییر اندازه‌ی پشته‌ی نخ پشتیبانی " +"نشود، یک :exc:`RuntimeError` پرتاب می‌شود. اگر اندازه‌ی پشته‌ی مشخص‌شده نامعتبر " +"باشد، یک :exc:`ValueError` پرتاب می‌شود و اندازه‌ی پشته بدون تغییر باقی " +"می‌ماند. در حال حاضر ۳۲ KiB حداقل مقدار اندازه‌ی پشته‌ی پشتیبانی‌شده برای تضمین " +"فضای پشته‌ی کافی برای خود مفسر است. توجه داشته باشید که برخی پلتفرم‌ها ممکن " +"است محدودیت‌های خاصی برای مقادیر اندازه‌ی پشته داشته باشند، مانند نیاز به " +"حداقل اندازه‌ی پشته > ۳۲ KiB یا نیاز به تخصیص به‌صورت مضرب‌هایی از اندازه‌ی صفحه‌ی " +"حافظه‌ی سیستم — برای اطلاعات بیشتر باید به مستندات پلتفرم مراجعه شود (صفحه‌های " +"۴ KiB رایج هستند؛ استفاده از مضرب‌های ۴۰۹۶ برای اندازه‌ی پشته، روش پیشنهادی در " +"نبود اطلاعات خاص‌تر است)." msgid "Unix platforms with POSIX threads support." -msgstr "" +msgstr "سکوهای یونیکسی با پشتیبانی از نخ‌های POSIX." -msgid "The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire `. Specifying a timeout greater than this value will raise an :exc:`OverflowError`." +msgid "" +"The maximum value allowed for the *timeout* parameter " +"of :meth:`Lock.acquire `. Specifying a timeout " +"greater than this value will raise an :exc:`OverflowError`." msgstr "" +"حداکثر مقدار مجاز برای پارامتر *timeout* در :meth:`Lock.acquire " +"`. تعیین مهلت زمانی بزرگ‌تر از این مقدار باعث " +"پرتاب :exc:`OverflowError` می‌شود." msgid "This is the type of lock objects." -msgstr "" +msgstr "این نوع اشیای قفل است." msgid "Lock objects have the following methods:" -msgstr "" +msgstr "اشیای قفل دارای متدهای زیر هستند:" -msgid "Without any optional argument, this method acquires the lock unconditionally, if necessary waiting until it is released by another thread (only one thread at a time can acquire a lock --- that's their reason for existence)." +msgid "" +"Without any optional argument, this method acquires the lock " +"unconditionally, if necessary waiting until it is released by another " +"thread (only one thread at a time can acquire a lock --- that's their " +"reason for existence)." msgstr "" +"بدون هیچ آرگومان اختیاری، این متد قفل را بدون شرط کسب می‌کند و در صورت لزوم " +"منتظر می‌ماند تا توسط نخ دیگری آزاد شود (فقط یک نخ در هر زمان می‌تواند یک قفل " +"را کسب کند — دلیل وجودی آن‌ها همین است)." -msgid "If the *blocking* argument is present, the action depends on its value: if it is false, the lock is only acquired if it can be acquired immediately without waiting, while if it is true, the lock is acquired unconditionally as above." +msgid "" +"If the *blocking* argument is present, the action depends on its value: if " +"it is false, the lock is only acquired if it can be acquired immediately " +"without waiting, while if it is true, the lock is acquired unconditionally " +"as above." msgstr "" +"اگر آرگومان *blocking* موجود باشد، رفتار به مقدار آن بستگی دارد: اگر مقدار " +"آن نادرست باشد، قفل فقط در صورتی به دست می‌آید که بتوان آن را فوراً و بدون " +"انتظار به دست آورد، در حالی که اگر مقدار آن درست باشد، قفل بی‌قیدوشرط مانند " +"بالا به دست می‌آید." -msgid "If the floating-point *timeout* argument is present and positive, it specifies the maximum wait time in seconds before returning. A negative *timeout* argument specifies an unbounded wait. You cannot specify a *timeout* if *blocking* is false." +msgid "" +"If the floating-point *timeout* argument is present and positive, it " +"specifies the maximum wait time in seconds before returning. A negative " +"*timeout* argument specifies an unbounded wait. You cannot specify a " +"*timeout* if *blocking* is false." msgstr "" +"اگر آرگومان *timeout* ممیز شناور موجود و مثبت باشد، حداکثر مهلت زمانی بر " +"حسب ثانیه را پیش از بازگشت مشخص می‌کند. آرگومان *timeout* منفی، یک انتظار " +"نامحدود را مشخص می‌کند. اگر *blocking* نادرست باشد، نمی‌توانید *timeout* را " +"مشخص کنید." -msgid "The return value is ``True`` if the lock is acquired successfully, ``False`` if not." +msgid "" +"The return value is ``True`` if the lock is acquired successfully, " +"``False`` if not." msgstr "" +"در صورت کسب موفق قفل، مقدار بازگشتی ``True`` و در غیر این صورت ``False`` " +"است." msgid "The *timeout* parameter is new." -msgstr "" +msgstr "پارامتر *timeout* جدید است." msgid "Lock acquires can now be interrupted by signals on POSIX." -msgstr "" +msgstr "اکنون می‌توان کسب قفل را در POSIX با سیگنال‌ها قطع کرد." msgid "Lock acquires can now be interrupted by signals on Windows." -msgstr "" +msgstr "اکنون در ویندوز، به دست آوردن قفل می‌تواند با سیگنال‌ها قطع شود." -msgid "Releases the lock. The lock must have been acquired earlier, but not necessarily by the same thread." +msgid "" +"Releases the lock. The lock must have been acquired earlier, but not " +"necessarily by the same thread." msgstr "" +"قفل را آزاد می‌کند. قفل باید پیش‌تر کسب شده باشد، اما نه لزوماً توسط همان نخ." -msgid "Return the status of the lock: ``True`` if it has been acquired by some thread, ``False`` if not." +msgid "" +"Return the status of the lock: ``True`` if it has been acquired by some " +"thread, ``False`` if not." msgstr "" +"وضعیت قفل را برمی‌گرداند: اگر توسط نخی گرفته شده باشد ``True`` و در غیر این " +"صورت ``False``." -msgid "In addition to these methods, lock objects can also be used via the :keyword:`with` statement, e.g.::" +msgid "" +"In addition to these methods, lock objects can also be used via " +"the :keyword:`with` statement, e.g.::" msgstr "" +"علاوه بر این متدها، می‌توان از اشیای قفل از طریق دستور :keyword:`with` نیز " +"استفاده کرد، برای مثال::" msgid "" "import _thread\n" @@ -144,42 +303,64 @@ msgid "" "with a_lock:\n" " print(\"a_lock is locked while this executes\")" msgstr "" +"import _thread\n" +"\n" +"a_lock = _thread.allocate_lock()\n" +"\n" +"with a_lock:\n" +" print(\"a_lock is locked while this executes\")" msgid "**Caveats:**" -msgstr "" +msgstr "**ملاحظات:**" -msgid "Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` exception will be received by that thread.)" +msgid "" +"Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " +"exception will be received by that thread.)" msgstr "" +"وقفه‌ها همیشه به نخ اصلی تحویل داده می‌شوند (استثنای :exc:`KeyboardInterrupt` " +"توسط آن نخ دریافت خواهد شد.)" -msgid "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is equivalent to calling :func:`_thread.exit`." +msgid "" +"Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " +"equivalent to calling :func:`_thread.exit`." msgstr "" +"فراخوانی :func:`sys.exit` یا پرتاب استثنای :exc:`SystemExit` معادل " +"فراخوانی :func:`_thread.exit` است." -msgid "When the main thread exits, it is system defined whether the other threads survive. On most systems, they are killed without executing :keyword:`try` ... :keyword:`finally` clauses or executing object destructors." +msgid "" +"When the main thread exits, it is system defined whether the other threads " +"survive. On most systems, they are killed without " +"executing :keyword:`try` ... :keyword:`finally` clauses or executing object " +"destructors." msgstr "" +"هنگامی که نخ اصلی خارج می‌شود، این که سایر نخ‌ها زنده بمانند یا خیر، توسط " +"سیستم تعیین می‌شود. در بیشتر سیستم‌ها، آن‌ها بدون اجرای " +"بندهای :keyword:`try` ... :keyword:`finally` یا اجرای مخرب‌های شیء کشته " +"می‌شوند." msgid "light-weight processes" -msgstr "" +msgstr "فرایندهای سبک‌وزن" msgid "processes, light-weight" -msgstr "" +msgstr "فرایندها، سبک‌وزن" msgid "binary semaphores" -msgstr "" +msgstr "سمافورهای دودویی" msgid "semaphores, binary" -msgstr "" +msgstr "سمافورهای دودویی" msgid "pthreads" -msgstr "" +msgstr "pthreads" msgid "threads" -msgstr "" +msgstr "نخ‌ها" msgid "POSIX" -msgstr "" +msgstr "POSIX" msgid "module" -msgstr "" +msgstr "ماژول" msgid "signal" -msgstr "" +msgstr "سیگنال" diff --git a/library/abc.po b/library/abc.po index b61aa3d9f..422650b59 100644 --- a/library/abc.po +++ b/library/abc.po @@ -24,22 +24,53 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!abc` --- Abstract Base Classes" -msgstr "" +msgstr ":mod:`!abc` --- کلاس‌های پایه انتزاعی" msgid "**Source code:** :source:`Lib/abc.py`" -msgstr "" +msgstr ":source:`Lib/abc.py`" -msgid "This module provides the infrastructure for defining :term:`abstract base classes ` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this was added to Python. (See also :pep:`3141` and the :mod:`numbers` module regarding a type hierarchy for numbers based on ABCs.)" -msgstr "" +msgid "" +"This module provides the infrastructure for defining :term:`abstract base " +"classes ` (ABCs) in Python, as outlined in :pep:`3119`;" +" see the PEP for why this was added to Python. (See also :pep:`3141` and the" +" :mod:`numbers` module regarding a type hierarchy for numbers based on " +"ABCs.)" +msgstr "" +"این ماژول زیرساخت لازم برای تعریف :term:`کلاس‌های پایه انتزاعی ` (ABCها) در پایتون را فراهم می‌کند، همان‌طور که در :pep:`3119` " +"شرح داده شده است؛ برای آگاهی از دلیل افزودن این قابلیت به پایتون، این PEP را" +" ببینید. (همچنین :pep:`3141` و ماژول :mod:`numbers` را در مورد سلسله‌مراتب " +"نوع برای اعداد بر پایه ABCها ببینید.)" -msgid "The :mod:`collections` module has some concrete classes that derive from ABCs; these can, of course, be further derived. In addition, the :mod:`collections.abc` submodule has some ABCs that can be used to test whether a class or instance provides a particular interface, for example, if it is :term:`hashable` or if it is a :term:`mapping`." -msgstr "" +msgid "" +"The :mod:`collections` module has some concrete classes that derive from " +"ABCs; these can, of course, be further derived. In addition, the " +":mod:`collections.abc` submodule has some ABCs that can be used to test " +"whether a class or instance provides a particular interface, for example, if" +" it is :term:`hashable` or if it is a :term:`mapping`." +msgstr "" +"ماژول :mod:`collections` تعدادی کلاس ملموس دارد که از ABCها مشتق شده‌اند؛ " +"البته می‌توان این‌ها را نیز بیش‌تر مشتق کرد. علاوه بر این، زیرماژول " +":mod:`collections.abc` تعدادی ABC دارد که می‌توان از آن‌ها برای بررسی اینکه " +"آیا یک کلاس یا نمونه، رابط خاصی را فراهم می‌کند، استفاده کرد؛ برای مثال، اگر" +" :term:`hashable` باشد یا یک :term:`mapping` باشد." -msgid "This module provides the metaclass :class:`ABCMeta` for defining ABCs and a helper class :class:`ABC` to alternatively define ABCs through inheritance:" +msgid "" +"This module provides the metaclass :class:`ABCMeta` for defining ABCs and a " +"helper class :class:`ABC` to alternatively define ABCs through inheritance:" msgstr "" +"این ماژول، فراکلاس :class:`ABCMeta` را برای تعریف ABCها و کلاس کمکی " +":class:`ABC` را فراهم می‌کند تا به‌عنوان جایگزین، بتوانید ABCها را از طریق " +"ارث‌بری تعریف کنید:" -msgid "A helper class that has :class:`ABCMeta` as its metaclass. With this class, an abstract base class can be created by simply deriving from :class:`!ABC` avoiding sometimes confusing metaclass usage, for example::" +msgid "" +"A helper class that has :class:`ABCMeta` as its metaclass. With this class," +" an abstract base class can be created by simply deriving from :class:`!ABC`" +" avoiding sometimes confusing metaclass usage, for example::" msgstr "" +"یک کلاس کمکی که :class:`ABCMeta` را به‌عنوان فراکلاس خود دارد. با این کلاس، " +"می‌توان یک کلاس پایه انتزاعی را صرفاً با مشتق شدن از :class:`!ABC` ایجاد کرد" +" و از کاربرد گاه گیج‌کننده‌ی فراکلاس اجتناب نمود، برای مثال::" msgid "" "from abc import ABC\n" @@ -47,9 +78,23 @@ msgid "" "class MyABC(ABC):\n" " pass" msgstr "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass" -msgid "Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore inheriting from :class:`!ABC` requires the usual precautions regarding metaclass usage, as multiple inheritance may lead to metaclass conflicts. One may also define an abstract base class by passing the metaclass keyword and using :class:`!ABCMeta` directly, for example::" -msgstr "" +msgid "" +"Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " +"inheriting from :class:`!ABC` requires the usual precautions regarding " +"metaclass usage, as multiple inheritance may lead to metaclass conflicts. " +"One may also define an abstract base class by passing the metaclass keyword " +"and using :class:`!ABCMeta` directly, for example::" +msgstr "" +"توجه داشته باشید که نوع :class:`!ABC` همچنان :class:`ABCMeta` است؛ بنابراین " +"ارث‌بری از :class:`!ABC` نیازمند رعایت نکات احتیاطی معمول در مورد استفاده از" +" فراکلاس است، زیرا ارث‌بری چندگانه ممکن است به تعارض‌های فراکلاس منجر شود. " +"همچنین می‌توان یک کلاس پایه انتزاعی را با ارسال کلیدواژه metaclass و استفاده" +" مستقیم از :class:`!ABCMeta` تعریف کرد، برای مثال::" msgid "" "from abc import ABCMeta\n" @@ -57,18 +102,42 @@ msgid "" "class MyABC(metaclass=ABCMeta):\n" " pass" msgstr "" +"from abc import ABCMeta\n" +"\n" +"class MyABC(metaclass=ABCMeta):\n" +" pass" msgid "Metaclass for defining Abstract Base Classes (ABCs)." -msgstr "" +msgstr "فراکلاس برای تعریف کلاس‌های پایه انتزاعی (ABCها)." -msgid "Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as \"virtual subclasses\" -- these and their descendants will be considered subclasses of the registering ABC by the built-in :func:`issubclass` function, but the registering ABC won't show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via :func:`super`). [#]_" -msgstr "" +msgid "" +"Use this metaclass to create an ABC. An ABC can be subclassed directly, and" +" then acts as a mix-in class. You can also register unrelated concrete " +"classes (even built-in classes) and unrelated ABCs as \"virtual subclasses\"" +" -- these and their descendants will be considered subclasses of the " +"registering ABC by the built-in :func:`issubclass` function, but the " +"registering ABC won't show up in their MRO nor " +"will method implementations defined by the registering ABC be callable (not " +"even via :func:`super`). [#]_" +msgstr "" +"از این فراکلاس برای ایجاد یک ABC استفاده کنید. یک ABC به‌طور مستقیم قابل " +"زیرکلاس‌بندی است و سپس به‌عنوان یک کلاس افزودنیعمل می‌کند. همچنین " +"می‌توانید کلاس‌های عینی غیرمرتبط (حتی کلاس‌های توکار) و ABCهای غیرمرتبط را " +"به‌عنوان «زیرکلاس‌های مجازی» ثبت کنید — این کلاس‌ها و زیرکلاس‌های مشتق‌شده " +"از آن‌ها از دید تابع توکار :func:`issubclass` زیرکلاس‌های ABC ثبت‌کننده " +"محسوب خواهند شد، اما ABC ثبت‌کننده در MRO (ترتیب حل متد) آن‌ها ظاهر نخواهد " +"شد و پیاده‌سازی‌های متد تعریف‌شده توسط ABC ثبت‌کننده قابل فراخوانی نخواهند " +"بود (حتی از طریق :func:`super` نیز). [#]_" -msgid "Classes created with a metaclass of :class:`!ABCMeta` have the following method:" +msgid "" +"Classes created with a metaclass of :class:`!ABCMeta` have the following " +"method:" msgstr "" +"کلاس‌هایی که با فراکلاس :class:`!ABCMeta` ایجاد شده‌اند، متد زیر را دارند:" msgid "Register *subclass* as a \"virtual subclass\" of this ABC. For example::" msgstr "" +"*subclass* را به‌عنوان یک «زیرکلاس مجازی» از این ABC ثبت کنید. برای مثال::" msgid "" "from abc import ABC\n" @@ -76,32 +145,70 @@ msgid "" "class MyABC(ABC):\n" " pass\n" "\n" -"MyABC.register(tuple)\n" +"MyABC.register\n" "\n" "assert issubclass(tuple, MyABC)\n" "assert isinstance((), MyABC)" msgstr "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass\n" +"\n" +"MyABC.register\n" +"\n" +"assert issubclass(tuple, MyABC)\n" +"assert isinstance((), MyABC)" msgid "Returns the registered subclass, to allow usage as a class decorator." msgstr "" +"زیرکلاس ثبت‌شده را برمی‌گرداند تا امکان استفاده به‌عنوان دکوراتور کلاس فراهم" +" شود." -msgid "To detect calls to :meth:`!register`, you can use the :func:`get_cache_token` function." +msgid "" +"To detect calls to :meth:`!register`, you can use the " +":func:`get_cache_token` function." msgstr "" +"برای تشخیص فراخوانی‌های :meth:`!register`، می‌توانید از تابع " +":func:`get_cache_token` استفاده کنید." msgid "You can also override this method in an abstract base class:" -msgstr "" +msgstr "همچنین می‌توانید این متد را در یک کلاس پایه انتزاعی بازنویسی کنید:" msgid "(Must be defined as a class method.)" -msgstr "" +msgstr "(باید به‌عنوان متد کلاس تعریف شود.)" -msgid "Check whether *subclass* is considered a subclass of this ABC. This means that you can customize the behavior of :func:`issubclass` further without the need to call :meth:`register` on every class you want to consider a subclass of the ABC. (This class method is called from the :meth:`~type.__subclasscheck__` method of the ABC.)" -msgstr "" +msgid "" +"Check whether *subclass* is considered a subclass of this ABC. This means " +"that you can customize the behavior of :func:`issubclass` further without " +"the need to call :meth:`register` on every class you want to consider a " +"subclass of the ABC. (This class method is called from the " +":meth:`~type.__subclasscheck__` method of the ABC.)" +msgstr "" +"بررسی می‌کند که آیا *subclass* زیرکلاسی از این ABC در نظر گرفته می‌شود یا " +"خیر. این بدان معناست که شما می‌توانید رفتار :func:`issubclass` را بیشتر " +"سفارشی‌سازی کنید، بدون نیاز به فراخوانی :meth:`register` برای هر کلاسی که " +"می‌خواهید آن را زیرکلاسی از ABC در نظر بگیرید. (این متد کلاس از متد " +":meth:`~type.__subclasscheck__` در ABC فراخوانی می‌شود.)" -msgid "This method should return ``True``, ``False`` or :data:`NotImplemented`. If it returns ``True``, the *subclass* is considered a subclass of this ABC. If it returns ``False``, the *subclass* is not considered a subclass of this ABC, even if it would normally be one. If it returns :data:`!NotImplemented`, the subclass check is continued with the usual mechanism." -msgstr "" +msgid "" +"This method should return ``True``, ``False`` or :data:`NotImplemented`. If" +" it returns ``True``, the *subclass* is considered a subclass of this ABC. " +"If it returns ``False``, the *subclass* is not considered a subclass of this" +" ABC, even if it would normally be one. If it returns " +":data:`!NotImplemented`, the subclass check is continued with the usual " +"mechanism." +msgstr "" +"این متد باید ``True``، ``False`` یا :data:`NotImplemented` را برگرداند. اگر " +"``True`` را برگرداند، *زیرکلاس* به‌عنوان زیرکلاسی از این ABC در نظر گرفته " +"می‌شود. اگر ``False`` را برگرداند، *زیرکلاس* به‌عنوان زیرکلاسی از این ABC " +"در نظر گرفته نمی‌شود، حتی اگر در حالت عادی یک زیرکلاس باشد. اگر " +":data:`!NotImplemented` را برگرداند، بررسی زیرکلاس با سازوکار معمول ادامه " +"می‌یابد." -msgid "For a demonstration of these concepts, look at this example ABC definition::" -msgstr "" +msgid "" +"For a demonstration of these concepts, look at this example ABC definition::" +msgstr "برای نمایش این مفاهیم، این نمونه تعریف ABC را ببینید::" msgid "" "class Foo:\n" @@ -131,30 +238,118 @@ msgid "" "\n" "MyIterable.register(Foo)" msgstr "" +"class Foo:\n" +" def __getitem__(self, index):\n" +" ...\n" +" def __len__(self):\n" +" ...\n" +" def get_iterator(self):\n" +" return iter(self)\n" +"\n" +"class MyIterable(ABC):\n" +"\n" +" @abstractmethod\n" +" def __iter__(self):\n" +" while False:\n" +" yield None\n" +"\n" +" def get_iterator(self):\n" +" return self.__iter__()\n" +"\n" +" @classmethod\n" +" def __subclasshook__(cls, C):\n" +" if cls is MyIterable:\n" +" if any(\"__iter__\" in B.__dict__ for B in C.__mro__):\n" +" return True\n" +" return NotImplemented\n" +"\n" +"MyIterable.register(Foo)" -msgid "The ABC ``MyIterable`` defines the standard iterable method, :meth:`~object.__iter__`, as an abstract method. The implementation given here can still be called from subclasses. The :meth:`!get_iterator` method is also part of the ``MyIterable`` abstract base class, but it does not have to be overridden in non-abstract derived classes." -msgstr "" +msgid "" +"The ABC ``MyIterable`` defines the standard iterable method, " +":meth:`~object.__iter__`, as an abstract method. The implementation given " +"here can still be called from subclasses. The :meth:`!get_iterator` method " +"is also part of the ``MyIterable`` abstract base class, but it does not have" +" to be overridden in non-abstract derived classes." +msgstr "" +"کلاس پایه انتزاعی (ABC) ``MyIterable`` متد استاندارد پیمایش‌پذیر، " +":meth:`~object.__iter__`، را به‌عنوان یک متد انتزاعی تعریف می‌کند. " +"پیاده‌سازی ارائه‌شده در اینجا همچنان می‌تواند از زیرکلاس‌ها فراخوانی شود. " +"متد :meth:`!get_iterator` نیز بخشی از کلاس پایه انتزاعی ``MyIterable`` است، " +"اما نیازی به بازنویسی آن در کلاس‌های مشتق‌شده غیرانتزاعی نیست." -msgid "The :meth:`__subclasshook__` class method defined here says that any class that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` (or in that of one of its base classes, accessed via the :attr:`~type.__mro__` list) is considered a ``MyIterable`` too." +msgid "" +"The :meth:`__subclasshook__` class method defined here says that any class " +"that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` " +"(or in that of one of its base classes, accessed via the " +":attr:`~type.__mro__` list) is considered a ``MyIterable`` too." msgstr "" +"متد کلاسی :meth:`__subclasshook__` تعریف‌شده در اینجا بیان می‌کند که هر " +"کلاسی که یک متد :meth:`~object.__iter__` در :attr:`~object.__dict__` خود (یا" +" در دیکشنری یکی از کلاس‌های پایه‌ی خود، که از طریق فهرست " +":attr:`~type.__mro__` به آن‌ها دسترسی پیدا می‌شود) داشته باشد، به‌عنوان یک " +"``MyIterable`` نیز در نظر گرفته می‌شود." -msgid "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, even though it does not define an :meth:`~object.__iter__` method (it uses the old-style iterable protocol, defined in terms of :meth:`~object.__len__` and :meth:`~object.__getitem__`). Note that this will not make ``get_iterator`` available as a method of ``Foo``, so it is provided separately." -msgstr "" +msgid "" +"Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " +"even though it does not define an :meth:`~object.__iter__` method (it uses " +"the old-style iterable protocol, defined in terms of :meth:`~object.__len__`" +" and :meth:`~object.__getitem__`). Note that this will not make " +"``get_iterator`` available as a method of ``Foo``, so it is provided " +"separately." +msgstr "" +"سرانجام، آخرین خط ``Foo`` را به یک زیرکلاس مجازی از ``MyIterable`` تبدیل " +"می‌کند، اگرچه متد :meth:`~object.__iter__` را تعریف نمی‌کند (از پروتکل " +"پیمایش‌پذیر به‌سبک قدیمی استفاده می‌کند که بر حسب :meth:`~object.__len__` و " +":meth:`~object.__getitem__` تعریف شده است). توجه داشته باشید که این کار " +"``get_iterator`` را به‌عنوان متدی از ``Foo`` در دسترس قرار نمی‌دهد، بنابراین" +" به‌صورت جداگانه ارائه شده است." msgid "The :mod:`!abc` module also provides the following decorator:" -msgstr "" +msgstr "ماژول :mod:`!abc` همچنین دکوراتور زیر را نیز فراهم می‌کند:" msgid "A decorator indicating abstract methods." -msgstr "" +msgstr "دکوراتوری که متدهای انتزاعی را نشان می‌دهد." -msgid "Using this decorator requires that the class's metaclass is :class:`ABCMeta` or is derived from it. A class that has a metaclass derived from :class:`!ABCMeta` cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract methods can be called using any of the normal 'super' call mechanisms. :deco:`!abstractmethod` may be used to declare abstract methods for properties and descriptors." -msgstr "" +msgid "" +"Using this decorator requires that the class's metaclass is :class:`ABCMeta`" +" or is derived from it. A class that has a metaclass derived from " +":class:`!ABCMeta` cannot be instantiated unless all of its abstract methods " +"and properties are overridden. The abstract methods can be called using any" +" of the normal 'super' call mechanisms. :deco:`!abstractmethod` may be used" +" to declare abstract methods for properties and descriptors." +msgstr "" +"استفاده از این دکوراتور مستلزم آن است که فراکلاسِ کلاس :class:`ABCMeta` باشد" +" یا از آن مشتق شده باشد. کلاسی که فراکلاس آن از :class:`!ABCMeta` مشتق شده " +"باشد، نمی‌تواند نمونه‌سازی شود، مگر آنکه تمام متدها و ویژگی‌های انتزاعی آن " +"بازنویسی شده باشند. می‌توان متدهای انتزاعی را با استفاده از هر یک از " +"سازوکارهای معمول فراخوانی 'super' فراخوانی کرد. می‌توان از " +":deco:`!abstractmethod` برای اعلام متدهای انتزاعی برای ویژگی‌ها و توصیف‌گرها" +" استفاده کرد." -msgid "Dynamically adding abstract methods to a class, or attempting to modify the abstraction status of a method or class once it is created, are only supported using the :func:`update_abstractmethods` function. The :deco:`!abstractmethod` only affects subclasses derived using regular inheritance; \"virtual subclasses\" registered with the ABC's :meth:`~ABCMeta.register` method are not affected." -msgstr "" +msgid "" +"Dynamically adding abstract methods to a class, or attempting to modify the " +"abstraction status of a method or class once it is created, are only " +"supported using the :func:`update_abstractmethods` function. The " +":deco:`!abstractmethod` only affects subclasses derived using regular " +"inheritance; \"virtual subclasses\" registered with the ABC's " +":meth:`~ABCMeta.register` method are not affected." +msgstr "" +"افزودن متدهای انتزاعی به‌صورت پویا به یک کلاس، یا تلاش برای تغییر وضعیت " +"انتزاعی یک متد یا کلاس پس از ایجاد آن، تنها با استفاده از تابع " +":func:`update_abstractmethods` پشتیبانی می‌شود. :deco:`!abstractmethod` تنها" +" بر زیرکلاس‌های مشتق‌شده با وراثت معمولی تأثیر می‌گذارد؛ «زیرکلاس‌های مجازی»" +" ثبت‌شده با متد :meth:`~ABCMeta.register` مربوط به ABC تحت تأثیر قرار " +"نمی‌گیرند." -msgid "When :deco:`!abstractmethod` is applied in combination with other method descriptors, it should be applied as the innermost decorator, as shown in the following usage examples::" +msgid "" +"When :deco:`!abstractmethod` is applied in combination with other method " +"descriptors, it should be applied as the innermost decorator, as shown in " +"the following usage examples::" msgstr "" +"هنگامی که :deco:`!abstractmethod` در ترکیب با سایر توصیف‌گرهای متد اعمال " +"می‌شود، باید به‌عنوان درونی‌ترین دکوراتور اعمال شود، همان‌طور که در مثال‌های" +" استفاده زیر نشان داده شده است::" msgid "" "class C(ABC):\n" @@ -187,9 +382,48 @@ msgid "" " ...\n" " x = property(_get_x, _set_x)" msgstr "" +"class C(ABC):\n" +" @abstractmethod\n" +" def my_abstract_method(self, arg1):\n" +" ...\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg2):\n" +" ...\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg3):\n" +" ...\n" +"\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ...\n" +" @my_abstract_property.setter\n" +" @abstractmethod\n" +" def my_abstract_property(self, val):\n" +" ...\n" +"\n" +" @abstractmethod\n" +" def _get_x(self):\n" +" ...\n" +" @abstractmethod\n" +" def _set_x(self, val):\n" +" ...\n" +" x = property(_get_x, _set_x)" -msgid "In order to correctly interoperate with the abstract base class machinery, the descriptor must identify itself as abstract using :attr:`!__isabstractmethod__`. In general, this attribute should be ``True`` if any of the methods used to compose the descriptor are abstract. For example, Python's built-in :deco:`property` does the equivalent of::" -msgstr "" +msgid "" +"In order to correctly interoperate with the abstract base class machinery, " +"the descriptor must identify itself as abstract using " +":attr:`!__isabstractmethod__`. In general, this attribute should be ``True``" +" if any of the methods used to compose the descriptor are abstract. For " +"example, Python's built-in :deco:`property` does the equivalent of::" +msgstr "" +"برای تعامل صحیح با سازوکار کلاس پایه انتزاعی، توصیف‌گر (descriptor) باید خود" +" را با استفاده از :attr:`!__isabstractmethod__` به‌عنوان انتزاعی معرفی کند. " +"به‌طور کلی، اگر هر یک از متدهای استفاده‌شده برای تشکیل توصیف‌گر (descriptor)" +" انتزاعی باشند، این ویژگی باید ``True`` باشد. برای مثال، :deco:`property` " +"توکار پایتون معادل زیر را انجام می‌دهد::" msgid "" "class Descriptor:\n" @@ -199,21 +433,49 @@ msgid "" " return any(getattr(f, '__isabstractmethod__', False) for\n" " f in (self._fget, self._fset, self._fdel))" msgstr "" +"class Descriptor:\n" +" ...\n" +" @property\n" +" def __isabstractmethod__(self):\n" +" return any(getattr(f, '__isabstractmethod__', False) for\n" +" f in (self._fget, self._fset, self._fdel))" -msgid "Unlike Java abstract methods, these abstract methods may have an implementation. This implementation can be called via the :func:`super` mechanism from the class that overrides it. This could be useful as an end-point for a super-call in a framework that uses cooperative multiple-inheritance." -msgstr "" +msgid "" +"Unlike Java abstract methods, these abstract methods may have an " +"implementation. This implementation can be called via the :func:`super` " +"mechanism from the class that overrides it. This could be useful as an end-" +"point for a super-call in a framework that uses cooperative multiple-" +"inheritance." +msgstr "" +"برخلاف متدهای انتزاعی جاوا، این متدهای انتزاعی ممکن است پیاده‌سازی داشته " +"باشند. این پیاده‌سازی را می‌توان از طریق سازوکار :func:`super` از کلاسی که " +"آن را بازنویسی می‌کند فراخوانی کرد. این می‌تواند به‌عنوان پایانه‌ای برای " +"فراخوانی super در چارچوبی که از وراثت چندگانه‌ی مشارکتی استفاده می‌کند، مفید" +" باشد." msgid "The :mod:`!abc` module also supports the following legacy decorators:" -msgstr "" +msgstr "ماژول :mod:`!abc` همچنین از دکوراتورهای قدیمی زیر پشتیبانی می‌کند:" -msgid "It is now possible to use :deco:`classmethod` with :deco:`abstractmethod`, making this decorator redundant." +msgid "" +"It is now possible to use :deco:`classmethod` with :deco:`abstractmethod`, " +"making this decorator redundant." msgstr "" +"اکنون می‌توان از :deco:`classmethod` همراه با :deco:`abstractmethod` استفاده" +" کرد، که این دکوراتور را زائد می‌سازد." -msgid "A subclass of the built-in :class:`classmethod`, indicating an abstract classmethod. Otherwise it is similar to :deco:`abstractmethod`." +msgid "" +"A subclass of the built-in :class:`classmethod`, indicating an abstract " +"classmethod. Otherwise it is similar to :deco:`abstractmethod`." msgstr "" +"زیرکلاسی از :class:`classmethod` توکار، که نشان‌دهنده‌ی یک classmethod " +"انتزاعی است. در سایر موارد، مشابه :deco:`abstractmethod` است." -msgid "This special case is deprecated, as the :deco:`classmethod` decorator is now correctly identified as abstract when applied to an abstract method::" +msgid "" +"This special case is deprecated, as the :deco:`classmethod` decorator is now" +" correctly identified as abstract when applied to an abstract method::" msgstr "" +"این حالت خاص منسوخ شده است، زیرا دکوراتور :deco:`classmethod` اکنون هنگامی " +"که به یک متد انتزاعی اعمال شود، به‌درستی به‌عنوان انتزاعی شناسایی می‌شود::" msgid "" "class C(ABC):\n" @@ -222,15 +484,32 @@ msgid "" " def my_abstract_classmethod(cls, arg):\n" " ..." msgstr "" +"class C(ABC):\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg):\n" +" ..." -msgid "It is now possible to use :deco:`staticmethod` with :deco:`abstractmethod`, making this decorator redundant." +msgid "" +"It is now possible to use :deco:`staticmethod` with :deco:`abstractmethod`, " +"making this decorator redundant." msgstr "" +"اکنون می‌توانید از :deco:`staticmethod` همراه با :deco:`abstractmethod` " +"استفاده کنید، که این دکوراتور را زائد می‌کند." -msgid "A subclass of the built-in :class:`staticmethod`, indicating an abstract staticmethod. Otherwise it is similar to :deco:`abstractmethod`." +msgid "" +"A subclass of the built-in :class:`staticmethod`, indicating an abstract " +"staticmethod. Otherwise it is similar to :deco:`abstractmethod`." msgstr "" +"زیرکلاسی از :class:`staticmethod` توکار که نشان‌دهنده یک staticmethod " +"انتزاعی است. در غیر این صورت، مشابه :deco:`abstractmethod` است." -msgid "This special case is deprecated, as the :deco:`staticmethod` decorator is now correctly identified as abstract when applied to an abstract method::" +msgid "" +"This special case is deprecated, as the :deco:`staticmethod` decorator is " +"now correctly identified as abstract when applied to an abstract method::" msgstr "" +"این حالت خاص منسوخ شده است، زیرا دکوراتور :deco:`staticmethod` اکنون هنگامی " +"که به یک متد انتزاعی اعمال شود، به‌درستی به‌عنوان انتزاعی شناسایی می‌شود::" msgid "" "class C(ABC):\n" @@ -239,15 +518,33 @@ msgid "" " def my_abstract_staticmethod(arg):\n" " ..." msgstr "" +"class C(ABC):\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg):\n" +" ..." -msgid "It is now possible to use :deco:`property`, :deco:`property.getter`, :deco:`property.setter` and :deco:`property.deleter` with :deco:`abstractmethod`, making this decorator redundant." +msgid "" +"It is now possible to use :deco:`property`, :deco:`property.getter`, " +":deco:`property.setter` and :deco:`property.deleter` with " +":deco:`abstractmethod`, making this decorator redundant." msgstr "" +"اکنون می‌توان از :deco:`property`، :deco:`property.getter`، " +":deco:`property.setter` و :deco:`property.deleter` به‌همراه " +":deco:`abstractmethod` استفاده کرد، که این دکوراتور را زائد می‌کند." -msgid "A subclass of the built-in :class:`property`, indicating an abstract property." +msgid "" +"A subclass of the built-in :class:`property`, indicating an abstract " +"property." msgstr "" +"زیرکلاسی از :class:`property` توکار، که نشان‌دهنده‌ی یک ویژگی انتزاعی است." -msgid "This special case is deprecated, as the :deco:`property` decorator is now correctly identified as abstract when applied to an abstract method::" +msgid "" +"This special case is deprecated, as the :deco:`property` decorator is now " +"correctly identified as abstract when applied to an abstract method::" msgstr "" +"این حالت خاص منسوخ شده است، زیرا دکوراتور :deco:`property` اکنون هنگام اعمال" +" بر یک متد انتزاعی به‌درستی به‌عنوان انتزاعی شناسایی می‌شود::" msgid "" "class C(ABC):\n" @@ -256,9 +553,20 @@ msgid "" " def my_abstract_property(self):\n" " ..." msgstr "" +"class C(ABC):\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ..." -msgid "The above example defines a read-only property; you can also define a read-write abstract property by appropriately marking one or more of the underlying methods as abstract::" +msgid "" +"The above example defines a read-only property; you can also define a read-" +"write abstract property by appropriately marking one or more of the " +"underlying methods as abstract::" msgstr "" +"مثال بالا یک ویژگی فقط‌خواندنی تعریف می‌کند؛ شما همچنین می‌توانید با " +"علامت‌گذاری مناسب یک یا چند مورد از متدهای زیربنایی به‌عنوان انتزاعی، یک " +"ویژگی انتزاعی با قابلیت خواندن و نوشتن تعریف کنید::" msgid "" "class C(ABC):\n" @@ -271,9 +579,22 @@ msgid "" " def x(self, val):\n" " ..." msgstr "" +"class C(ABC):\n" +" @property\n" +" def x(self):\n" +" ...\n" +"\n" +" @x.setter\n" +" @abstractmethod\n" +" def x(self, val):\n" +" ..." -msgid "If only some components are abstract, only those components need to be updated to create a concrete property in a subclass::" +msgid "" +"If only some components are abstract, only those components need to be " +"updated to create a concrete property in a subclass::" msgstr "" +"اگر تنها برخی از کامپوننت‌ها انتزاعی باشند، تنها همان کامپوننت‌ها باید " +"به‌روزرسانی شوند تا یک پراپرتی عینی در یک زیرکلاس ایجاد شود::" msgid "" "class D(C):\n" @@ -281,30 +602,56 @@ msgid "" " def x(self, val):\n" " ..." msgstr "" +"class D(C):\n" +" @C.x.setter\n" +" def x(self, val):\n" +" ..." msgid "The :mod:`!abc` module also provides the following functions:" -msgstr "" +msgstr "ماژول :mod:`!abc` همچنین توابع زیر را فراهم می‌کند:" msgid "Returns the current abstract base class cache token." -msgstr "" +msgstr "توکن فعلی نهانگاه کلاس پایه انتزاعی را بازمی‌گرداند." -msgid "The token is an opaque object (that supports equality testing) identifying the current version of the abstract base class cache for virtual subclasses. The token changes with every call to :meth:`ABCMeta.register` on any ABC." +msgid "" +"The token is an opaque object (that supports equality testing) identifying " +"the current version of the abstract base class cache for virtual subclasses." +" The token changes with every call to :meth:`ABCMeta.register` on any ABC." msgstr "" +"توکن یک شیء غیرشفاف است (که از آزمون برابری پشتیبانی می‌کند) و نسخه کنونی " +"نهانگاه کلاس پایه انتزاعی برای زیرکلاس‌های مجازی را شناسایی می‌کند. توکن با " +"هر فراخوانی :meth:`ABCMeta.register` روی هر ABC تغییر می‌کند." -msgid "A function to recalculate an abstract class's abstraction status. This function should be called if a class's abstract methods have been implemented or changed after it was created. Usually, this function should be called from within a class decorator." +msgid "" +"A function to recalculate an abstract class's abstraction status. This " +"function should be called if a class's abstract methods have been " +"implemented or changed after it was created. Usually, this function should " +"be called from within a class decorator." msgstr "" +"تابعی برای محاسبه‌ی مجدد وضعیت انتزاعی بودن یک کلاس انتزاعی. اگر متدهای " +"انتزاعی یک کلاس پس از ایجاد آن پیاده‌سازی یا تغییر کرده باشند، باید این تابع" +" فراخوانی شود. معمولاً این تابع باید از درون یک دکوراتور کلاس فراخوانی شود." msgid "Returns *cls*, to allow usage as a class decorator." msgstr "" +"*cls* را برمی‌گرداند تا امکان استفاده به‌عنوان دکوراتور کلاس فراهم شود." msgid "If *cls* is not an instance of :class:`ABCMeta`, does nothing." -msgstr "" +msgstr "اگر *cls* نمونه‌ای از :class:`ABCMeta` نباشد، هیچ کاری انجام نمی‌دهد." -msgid "This function assumes that *cls*'s superclasses are already updated. It does not update any subclasses." +msgid "" +"This function assumes that *cls*'s superclasses are already updated. It does" +" not update any subclasses." msgstr "" +"این تابع فرض می‌کند که ابرکلاس‌های *cls* از قبل به‌روزرسانی شده‌اند. این " +"تابع هیچ زیرکلاسی را به‌روزرسانی نمی‌کند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "C++ programmers should note that Python's virtual base class concept is not the same as C++'s." +msgid "" +"C++ programmers should note that Python's virtual base class concept is not " +"the same as C++'s." msgstr "" +"برنامه‌نویسان C++ باید توجه داشته باشند که مفهوم کلاس پایه مجازی در پایتون، " +"با مفهوم آن در C++ یکسان نیست." diff --git a/library/aifc.po b/library/aifc.po index 97b92e0a5..ebe245424 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" -msgstr "" +msgstr ":mod:`!aifc` --- خواندن و نوشتن فایل‌های AIFF و AIFC" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. حذف " +"آن در :pep:`594` مقرر شد." -msgid "The last version of Python that provided the :mod:`!aifc` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!aifc` module was `Python" +" 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!aifc` را ارائه می‌داد، `پایتون 3.12 " +"`_ بود." diff --git a/library/allos.po b/library/allos.po index 028c01b05..007e3f4fb 100644 --- a/library/allos.po +++ b/library/allos.po @@ -22,7 +22,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Generic Operating System Services" -msgstr "" +msgstr "خدمات عام سیستم‌عامل" -msgid "The modules described in this chapter provide interfaces to operating system features that are available on (almost) all operating systems, such as files and a clock. The interfaces are generally modeled after the Unix or C interfaces, but they are available on most other systems as well. Here's an overview:" +msgid "" +"The modules described in this chapter provide interfaces to operating system" +" features that are available on (almost) all operating systems, such as " +"files and a clock. The interfaces are generally modeled after the Unix or C" +" interfaces, but they are available on most other systems as well. Here's " +"an overview:" msgstr "" +"ماژول‌های توصیف‌شده در این فصل، رابط‌هایی به امکانات سیستم‌عامل فراهم " +"می‌کنند که در (تقریباً) همه‌ی سیستم‌عامل‌ها در دسترس هستند، مانند فایل‌ها و " +"ساعت. این رابط‌ها عموماً بر اساس رابط‌های Unix یا C مدل‌سازی شده‌اند، اما در" +" بیشتر سیستم‌های دیگر نیز در دسترس هستند. در ادامه یک مرور کلی آمده است:" diff --git a/library/annotationlib.po b/library/annotationlib.po index a7da97544..5f3d0a30d 100644 --- a/library/annotationlib.po +++ b/library/annotationlib.po @@ -11,73 +11,175 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-07-25 12:59+0330\n" +"PO-Revision-Date: 2026-08-28 11:26+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: none\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!annotationlib` --- Functionality for introspecting annotations" msgstr "" +":mod:`!annotationlib` --- امکاناتی برای درون‌نگری حاشیه‌نویسی‌ها " msgid "**Source code:** :source:`Lib/annotationlib.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/annotationlib.py`" -msgid "The :mod:`!annotationlib` module provides tools for introspecting :term:`annotations ` on modules, classes, and functions." +msgid "" +"The :mod:`!annotationlib` module provides tools for " +"introspecting :term:`annotations ` on modules, classes, and " +"functions." msgstr "" +"ماژول :mod:`!annotationlib` ابزارهایی را برای بازبینی :term:`حاشیه‌نویسی‌ها " +"` بر روی ماژول‌ها، کلاس‌ها و توابع فراهم می‌کند." -msgid "Annotations are :ref:`lazily evaluated ` and often contain forward references to objects that are not yet defined when the annotation is created. This module provides a set of low-level tools that can be used to retrieve annotations in a reliable way, even in the presence of forward references and other edge cases." -msgstr "" +msgid "" +"Annotations are :ref:`lazily evaluated ` and often contain " +"forward references to objects that are not yet defined when the annotation " +"is created. This module provides a set of low-level tools that can be used " +"to retrieve annotations in a reliable way, even in the presence of forward " +"references and other edge cases." +msgstr "" +"انوتیشن‌ها :ref:`به‌صورت تنبل ارزیابی می‌شوند ` " +"و اغلب شامل ارجاع پیشرو به اشیایی هستند که هنوز در زمان ایجاد " +"انوتیشن تعریف نشده‌اند. این ماژول مجموعه‌ای از ابزارهای سطح پایین را فراهم " +"می‌کند که می‌توان از آن‌ها برای بازیابی انوتیشن‌ها به‌صورت قابل‌اعتماد استفاده " +"کرد، حتی در صورت وجود ارجاع‌های پیشرو و سایر موارد مرزی." -msgid "This module supports retrieving annotations in three main formats (see :class:`Format`), each of which works best for different use cases:" +msgid "" +"This module supports retrieving annotations in three main formats " +"(see :class:`Format`), each of which works best for different use cases:" msgstr "" +"این ماژول از بازیابی حاشیه‌نویسی‌ها در ۳ قالب اصلی پشتیبانی " +"می‌کند (به :class:`Format` مراجعه کنید)، که هر کدام برای موارد استفاده‌ی " +"متفاوتی مناسب‌تر است:" -msgid ":attr:`~Format.VALUE` evaluates the annotations and returns their value. This is most straightforward to work with, but it may raise errors, for example if the annotations contain references to undefined names." +msgid "" +":attr:`~Format.VALUE` evaluates the annotations and returns their value. " +"This is most straightforward to work with, but it may raise errors, for " +"example if the annotations contain references to undefined names." msgstr "" +":attr:`~Format.VALUE` حاشیه‌نویسی‌ها را ارزیابی می‌کند و مقدار آن‌ها را " +"برمی‌گرداند. کار با این گزینه از همه ساده‌تر است، اما ممکن است خطاها را پرتاب " +"کند، برای مثال اگر حاشیه‌نویسی‌ها شامل ارجاع به نام‌های تعریف‌نشده باشند." -msgid ":attr:`~Format.FORWARDREF` returns :class:`ForwardRef` objects for annotations that cannot be resolved, allowing you to inspect the annotations without evaluating them. This is useful when you need to work with annotations that may contain unresolved forward references." +msgid "" +":attr:`~Format.FORWARDREF` returns :class:`ForwardRef` objects for " +"annotations that cannot be resolved, allowing you to inspect the annotations " +"without evaluating them. This is useful when you need to work with " +"annotations that may contain unresolved forward references." msgstr "" +":attr:`~Format.FORWARDREF` برای حاشیه‌نویسی‌هاییکه قابل حل " +"نیستند، اشیای :class:`ForwardRef` را برمی‌گرداند و به شما امکان می‌دهد " +"حاشیه‌نویسی‌ها را بدون ارزیابی بررسی کنید. این حالت زمانی مفید است که نیاز " +"داشته باشید با حاشیه‌نویسی‌هایی کار کنید که ممکن است حاوی ارجاع‌های پیشروی " +"حل‌نشده باشند." -msgid ":attr:`~Format.STRING` returns the annotations as a string, similar to how it would appear in the source file. This is useful for documentation generators that want to display annotations in a readable way." +msgid "" +":attr:`~Format.STRING` returns the annotations as a string, similar to how " +"it would appear in the source file. This is useful for documentation " +"generators that want to display annotations in a readable way." msgstr "" +":attr:`~Format.STRING` حاشیه‌نویسی‌ها را به‌صورت یک رشته برمی‌گرداند، شبیه به " +"آنچه در فایل منبع ظاهر می‌شود. این برای مستندسازهایی که می‌خواهند حاشیه‌نویسی‌ها " +"را به‌شکلی خوانا نمایش دهند، مفید است." -msgid "The :func:`get_annotations` function is the main entry point for retrieving annotations. Given a function, class, or module, it returns an annotations dictionary in the requested format. This module also provides functionality for working directly with the :term:`annotate function` that is used to evaluate annotations, such as :func:`get_annotate_from_class_namespace` and :func:`call_annotate_function`, as well as the :func:`call_evaluate_function` function for working with :term:`evaluate functions `." -msgstr "" +msgid "" +"The :func:`get_annotations` function is the main entry point for retrieving " +"annotations. Given a function, class, or module, it returns an annotations " +"dictionary in the requested format. This module also provides functionality " +"for working directly with the :term:`annotate function` that is used to " +"evaluate annotations, such as :func:`get_annotate_from_class_namespace` " +"and :func:`call_annotate_function`, as well as " +"the :func:`call_evaluate_function` function for working with :term:`evaluate " +"functions `." +msgstr "" +"تابع :func:`get_annotations` نقطه ورود اصلی برای بازیابی انوتیشن‌ها " +" است. این تابع با دریافت یک تابع، کلاس یا ماژول، دیکشنری " +"انوتیشن‌ها را در قالب درخواستی بازمی‌گرداند. این ماژول همچنین برای کار مستقیم " +"با :term:`annotate function` که برای ارزیابی انوتیشن‌ها استفاده می‌شود، " +"قابلیت‌هایی فراهم می‌کند؛ مانند :func:`get_annotate_from_class_namespace` " +"و :func:`call_annotate_function`، و همچنین " +"تابع :func:`call_evaluate_function` برای کار با :term:`evaluate functions " +"`." -msgid "Most functionality in this module can execute arbitrary code; see :ref:`the security section ` for more information." +msgid "" +"Most functionality in this module can execute arbitrary code; see :ref:`the " +"security section ` for more information." msgstr "" +"بیشتر قابلیت‌های این ماژول می‌توانند کد دلخواه را اجرا کنند؛ برای اطلاعات " +"بیشتر :ref:`بخش امنیت ` را ببینید." -msgid ":pep:`649` proposed the current model for how annotations work in Python." +msgid "" +":pep:`649` proposed the current model for how annotations work in Python." msgstr "" +":pep:`649` مدل کنونی برای چگونگی کارکرد حاشیه‌نویسی‌هادر پایتون " +"را پیشنهاد داد." -msgid ":pep:`749` expanded on various aspects of :pep:`649` and introduced the :mod:`!annotationlib` module." +msgid "" +":pep:`749` expanded on various aspects of :pep:`649` and introduced " +"the :mod:`!annotationlib` module." msgstr "" +":pep:`749` به تشریح جنبه‌های مختلفی از :pep:`649` پرداخت و ماژول :mod:`!" +"annotationlib` را معرفی کرد." -msgid ":ref:`annotations-howto` provides best practices for working with annotations." +msgid "" +":ref:`annotations-howto` provides best practices for working with " +"annotations." msgstr "" +":ref:`annotations-howto` بهترین شیوه‌ها را برای کار با حاشیه‌نویسی‌ها " +" ارائه می‌دهد." -msgid ":pypi:`typing-extensions` provides a backport of :func:`get_annotations` that works on earlier versions of Python." +msgid "" +":pypi:`typing-extensions` provides a backport of :func:`get_annotations` " +"that works on earlier versions of Python." msgstr "" +":pypi:`typing-extensions` یک بک‌پورت (backport) از :func:`get_annotations` " +"فراهم می‌کند که در نسخه‌های پیشین پایتون کار می‌کند." msgid "Annotation semantics" -msgstr "" +msgstr "معناشناسی حاشیه‌نویسی " -msgid "The way annotations are evaluated has changed over the history of Python 3, and currently still depends on a :ref:`future import `. There have been execution models for annotations:" +msgid "" +"The way annotations are evaluated has changed over the history of Python 3, " +"and currently still depends on a :ref:`future import `. There have " +"been execution models for annotations:" msgstr "" +"روش ارزیابی حاشیه‌نویسی‌ها در طول تاریخ پایتون ۳ تغییر کرده است و در حال حاضر " +"همچنان به یک :ref:`future import ` وابسته است. مدل‌های اجرایی برای " +"حاشیه‌نویسی‌ها وجود داشته‌اند:" -msgid "*Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107` and :pep:`526`): Annotations are evaluated eagerly, as they are encountered in the source code." +msgid "" +"*Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107` " +"and :pep:`526`): Annotations are evaluated eagerly, as they are encountered " +"in the source code." msgstr "" +"*معناشناسی استاندارد* (پیش‌فرض در پایتون 3.0 تا 3.13؛ :pep:`3107` " +"و :pep:`526` را ببینید): حاشیه‌نویسی‌هابه‌صورت فوری، به‌محض " +"مواجهه در کد منبع ارزیابی می‌شوند." -msgid "*Stringified annotations* (used with ``from __future__ import annotations`` in Python 3.7 and newer; see :pep:`563`): Annotations are stored as strings only." +msgid "" +"*Stringified annotations* (used with ``from __future__ import annotations`` " +"in Python 3.7 and newer; see :pep:`563`): Annotations are stored as strings " +"only." msgstr "" +"*حاشیه‌نویسی‌های رشته‌ای* (با ``from __future__ import annotations`` در پایتون " +"3.7 و جدیدتر استفاده می‌شود؛ به :pep:`563` مراجعه کنید): حاشیه‌نویسی‌ها فقط " +"به‌صورت رشته ذخیره می‌شوند." -msgid "*Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :pep:`749`): Annotations are evaluated lazily, only when they are accessed." +msgid "" +"*Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` " +"and :pep:`749`): Annotations are evaluated lazily, only when they are " +"accessed." msgstr "" +"*ارزیابی به‌تعویق‌افتاده* (پیش‌فرض در پایتون 3.14 و نسخه‌های جدیدتر؛ :pep:`649` " +"و :pep:`749` را ببینید): انوتیشن‌ها به‌صورت تنبل ارزیابی می‌شوند، تنها زمانی که " +"به آن‌ها دسترسی پیدا شود." msgid "As an example, consider the following program::" -msgstr "" +msgstr "به‌عنوان مثال، برنامه زیر را در نظر بگیرید::" msgid "" "def func(a: Cls) -> None:\n" @@ -87,78 +189,270 @@ msgid "" "\n" "print(func.__annotations__)" msgstr "" +"def func(a: Cls) -> None:\n" +" print(a)\n" +"\n" +"class Cls: pass\n" +"\n" +"print(func.__annotations__)" msgid "This will behave as follows:" -msgstr "" +msgstr "این به‌صورت زیر رفتار خواهد کرد:" -msgid "Under stock semantics (Python 3.13 and earlier), it will throw a :exc:`NameError` at the line where ``func`` is defined, because ``Cls`` is an undefined name at that point." +msgid "" +"Under stock semantics (Python 3.13 and earlier), it will throw " +"a :exc:`NameError` at the line where ``func`` is defined, because ``Cls`` is " +"an undefined name at that point." msgstr "" +"طبق معناشناسی استاندارد (پایتون 3.13 و نسخه‌های پیشین)، یک :exc:`NameError` " +"در خطی که ``func`` تعریف شده است پرتاب می‌شود، زیرا ``Cls`` در آن نقطه یک نام " +"تعریف‌نشده است." -msgid "Under stringified annotations (if ``from __future__ import annotations`` is used), it will print ``{'a': 'Cls', 'return': 'None'}``." +msgid "" +"Under stringified annotations (if ``from __future__ import annotations`` is " +"used), it will print ``{'a': 'Cls', 'return': 'None'}``." msgstr "" +"در حالت حاشیه‌نویسی‌های رشته‌ای‌شده (اگر از ``from __future__ import " +"annotations`` استفاده شود)، ``{'a': 'Cls', 'return': 'None'}`` چاپ خواهد شد." -msgid "Under deferred evaluation (Python 3.14 and later), it will print ``{'a': , 'return': None}``." +msgid "" +"Under deferred evaluation (Python 3.14 and later), it will print ``{'a': " +", 'return': None}``." msgstr "" +"در ارزیابی معوق (پایتون 3.14 و نسخه‌های بعد)، ``{'a': , " +"'return': None}`` چاپ خواهد شد." -msgid "Stock semantics were used when function annotations were first introduced in Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious way to implement annotations. The same execution model was used when variable annotations were introduced in Python 3.6 (by :pep:`526`). However, stock semantics caused problems when using annotations as type hints, such as a need to refer to names that are not yet defined when the annotation is encountered. In addition, there were performance problems with executing annotations at module import time. Therefore, in Python 3.7, :pep:`563` introduced the ability to store annotations as strings using the ``from __future__ import annotations`` syntax. The plan at the time was to eventually make this behavior the default, but a problem appeared: stringified annotations are more difficult to process for those who introspect annotations at runtime. An alternative proposal, :pep:`649`, introduced the third execution model, deferred evaluation, and was implemented in Python 3.14. Stringified annotations are still used if ``from __future__ import annotations`` is present, but this behavior will eventually be removed." -msgstr "" +msgid "" +"Stock semantics were used when function annotations were first introduced in " +"Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious way " +"to implement annotations. The same execution model was used when variable " +"annotations were introduced in Python 3.6 (by :pep:`526`). However, stock " +"semantics caused problems when using annotations as type hints, such as a " +"need to refer to names that are not yet defined when the annotation is " +"encountered. In addition, there were performance problems with executing " +"annotations at module import time. Therefore, in Python 3.7, :pep:`563` " +"introduced the ability to store annotations as strings using the ``from " +"__future__ import annotations`` syntax. The plan at the time was to " +"eventually make this behavior the default, but a problem appeared: " +"stringified annotations are more difficult to process for those who " +"introspect annotations at runtime. An alternative proposal, :pep:`649`, " +"introduced the third execution model, deferred evaluation, and was " +"implemented in Python 3.14. Stringified annotations are still used if ``from " +"__future__ import annotations`` is present, but this behavior will " +"eventually be removed." +msgstr "" +"هنگامی که حاشیه‌نویسی‌های تابع برای نخستین بار در پایتون 3.0 " +"(توسط :pep:`3107`) معرفی شدند، از معناشناسی پیش‌فرض استفاده شد، زیرا این " +"ساده‌ترین و آشکارترین روش برای پیاده‌سازی حاشیه‌نویسی‌ها بود. هنگامی که " +"حاشیه‌نویسی‌های متغیر در پایتون 3.6 (توسط :pep:`526`) معرفی شدند، از همان مدل " +"اجرایی استفاده شد. با این حال، معناشناسی پیش‌فرض هنگام استفاده از " +"حاشیه‌نویسی‌ها به‌عنوان راهنمایی‌های نوع مشکلاتی ایجاد می‌کرد، مانند نیاز به " +"ارجاع به نام‌هایی که در زمان مواجهه با حاشیه‌نویسی هنوز تعریف‌نشده‌اند. علاوه بر " +"این، مشکلات عملکردی در اجرای حاشیه‌نویسی‌ها در زمان ایمپورت ماژول وجود داشت. " +"بنابراین، در پایتون 3.7، :pep:`563` توانایی ذخیره کردن حاشیه‌نویسی‌ها به‌صورت " +"رشته با استفاده از سینتکس ``from __future__ import annotations`` را معرفی " +"کرد. برنامه در آن زمان این بود که در نهایت این رفتار به پیش‌فرض تبدیل شود، " +"اما مشکلی پدیدار شد: پردازش حاشیه‌نویسی‌های رشته‌ای برای کسانی که حاشیه‌نویسی‌ها " +"را در ران‌تایم درون‌نگری می‌کنند، دشوارتر است. یک پیشنهاد جایگزین، :pep:`649`، " +"سومین مدل اجرایی، یعنی ارزیابی به‌تعویق‌افتاده را معرفی کرد و در پایتون 3.14 " +"پیاده‌سازی شد. در صورت وجود ``from __future__ import annotations``، همچنان از " +"حاشیه‌نویسی‌های رشته‌ای استفاده می‌شود، اما این رفتار در نهایت حذف خواهد شد." msgid "Classes" -msgstr "" +msgstr "کلاس‌ها" -msgid "An :class:`~enum.IntEnum` describing the formats in which annotations can be returned. Members of the enum, or their equivalent integer values, can be passed to :func:`get_annotations` and other functions in this module, as well as to :attr:`~object.__annotate__` functions." +msgid "" +"An :class:`~enum.IntEnum` describing the formats in which annotations can be " +"returned. Members of the enum, or their equivalent integer values, can be " +"passed to :func:`get_annotations` and other functions in this module, as " +"well as to :attr:`~object.__annotate__` functions." msgstr "" +"یک :class:`~enum.IntEnum` که قالب‌هایی را توصیف می‌کند که حاشیه‌نویسی‌ها " +"می‌توانند در آن‌ها برگردانده شوند. اعضای enum، یا مقادیر صحیح معادل آن‌ها، " +"می‌توانند به :func:`get_annotations` و سایر توابع این ماژول، و همچنین به " +"توابع :attr:`~object.__annotate__` ارسال شوند." msgid "Values are the result of evaluating the annotation expressions." -msgstr "" +msgstr "مقادیر، نتیجه‌ی ارزیابی عبارت‌های حاشیه‌نویسی هستند." -msgid "Special value used to signal that an annotate function is being evaluated in a special environment with fake globals. When passed this value, annotate functions should either return the same value as for the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError` to signal that they do not support execution in this environment. This format is only used internally and should not be passed to the functions in this module." -msgstr "" +msgid "" +"Special value used to signal that an annotate function is being evaluated in " +"a special environment with fake globals. When passed this value, annotate " +"functions should either return the same value as for " +"the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError` to " +"signal that they do not support execution in this environment. This format " +"is only used internally and should not be passed to the functions in this " +"module." +msgstr "" +"مقدار ویژه‌ای که برای اعلام اینکه یک تابع annotate در یک محیط ویژه با " +"متغیرهای سراسری جعلی ارزیابی می‌شود، به‌کار می‌رود. هنگامی که این مقدار به آن‌ها " +"داده شود، توابع annotate باید یا همان مقداری را که برای " +"قالب :attr:`Format.VALUE` برمی‌گردانند، برگردانند، " +"یا :exc:`NotImplementedError` را پرتاب کنند تا نشان دهند که از اجرا در این " +"محیط پشتیبانی نمی‌کنند. این قالب فقط به‌صورت داخلی استفاده می‌شود و نباید به " +"توابع این ماژول داده شود." -msgid "Values are real annotation values (as per :attr:`Format.VALUE` format) for defined values, and :class:`ForwardRef` proxies for undefined values. Real objects may contain references to :class:`ForwardRef` proxy objects." +msgid "" +"Values are real annotation values (as per :attr:`Format.VALUE` format) for " +"defined values, and :class:`ForwardRef` proxies for undefined values. Real " +"objects may contain references to :class:`ForwardRef` proxy objects." msgstr "" +"مقادیر، برای مقادیر تعریف‌شده، مقادیر واقعی حاشیه‌نویسی (بر اساس " +"قالب :attr:`Format.VALUE`) هستند و برای مقادیر تعریف‌نشده، " +"پراکسی‌های :class:`ForwardRef` هستند. اشیاء واقعی ممکن است شامل ارجاع‌هایی به " +"اشیاء پراکسی :class:`ForwardRef` باشند." -msgid "Values are the text string of the annotation as it appears in the source code, up to modifications including, but not restricted to, whitespace normalizations and constant values optimizations." +msgid "" +"Values are the text string of the annotation as it appears in the source " +"code, up to modifications including, but not restricted to, whitespace " +"normalizations and constant values optimizations." msgstr "" +"مقادیر، رشته‌ی متنی حاشیه‌نویسیهستند، به همان شکلی که در کد منبع " +"ظاهر می‌شود، با در نظر گرفتن تغییراتی شامل، اما نه محدود به، نرمال‌سازی‌های " +"فضای سفید و بهینه‌سازی‌های مقادیر ثابت." -msgid "The exact values of these strings may change in future versions of Python." -msgstr "" +msgid "" +"The exact values of these strings may change in future versions of Python." +msgstr "مقادیر دقیق این رشته‌ها ممکن است در نسخه‌های آینده پایتون تغییر کند." msgid "A proxy object for forward references in annotations." -msgstr "" +msgstr "یک شیء پراکسی برای ارجاع‌های پیش‌رو در حاشیه‌نویسی‌ها." -msgid "Instances of this class are returned when the :attr:`~Format.FORWARDREF` format is used and annotations contain a name that cannot be resolved. This can happen when a forward reference is used in an annotation, such as when a class is referenced before it is defined." +msgid "" +"Instances of this class are returned when the :attr:`~Format.FORWARDREF` " +"format is used and annotations contain a name that cannot be resolved. This " +"can happen when a forward reference is used in an annotation, such as when a " +"class is referenced before it is defined." msgstr "" +"نمونه‌هایی از این کلاس زمانی برگردانده می‌شوند که از " +"قالب :attr:`~Format.FORWARDREF` استفاده شود و حاشیه‌نویسی‌ها شامل نامی باشند " +"که نمی‌توان آن را حل کرد. این حالت ممکن است زمانی رخ دهد که از یک ارجاع به " +"جلو (forward reference) در یک حاشیه‌نویسی استفاده شود، مانند زمانی که یک کلاس " +"پیش از تعریف شدن، به آن ارجاع داده شود." -msgid "A string containing the code that was evaluated to produce the :class:`~ForwardRef`. The string may not be exactly equivalent to the original source." +msgid "" +"A string containing the code that was evaluated to produce " +"the :class:`~ForwardRef`. The string may not be exactly equivalent to the " +"original source." msgstr "" +"رشته‌ای حاوی کدی که برای تولید :class:`~ForwardRef` ارزیابی‌شده است. این رشته " +"ممکن است دقیقاً معادل کد منبع اصلی نباشد." msgid "Evaluate the forward reference, returning its value." -msgstr "" +msgstr "ارجاع پیشرو را ارزیابی می‌کند و مقدار آن را برمی‌گرداند." -msgid "If the *format* argument is :attr:`~Format.VALUE` (the default), this method may throw an exception, such as :exc:`NameError`, if the forward reference refers to a name that cannot be resolved. The arguments to this method can be used to provide bindings for names that would otherwise be undefined. If the *format* argument is :attr:`~Format.FORWARDREF`, the method will never throw an exception, but may return a :class:`~ForwardRef` instance. For example, if the forward reference object contains the code ``list[undefined]``, where ``undefined`` is a name that is not defined, evaluating it with the :attr:`~Format.FORWARDREF` format will return ``list[ForwardRef('undefined')]``. If the *format* argument is :attr:`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`." -msgstr "" +msgid "" +"If the *format* argument is :attr:`~Format.VALUE` (the default), this method " +"may throw an exception, such as :exc:`NameError`, if the forward reference " +"refers to a name that cannot be resolved. The arguments to this method can " +"be used to provide bindings for names that would otherwise be undefined. If " +"the *format* argument is :attr:`~Format.FORWARDREF`, the method will never " +"throw an exception, but may return a :class:`~ForwardRef` instance. For " +"example, if the forward reference object contains the code " +"``list[undefined]``, where ``undefined`` is a name that is not defined, " +"evaluating it with the :attr:`~Format.FORWARDREF` format will return " +"``list[ForwardRef('undefined')]``. If the *format* argument " +"is :attr:`~Format.STRING`, the method will " +"return :attr:`~ForwardRef.__forward_arg__`." +msgstr "" +"اگر آرگومان *format* برابر :attr:`~Format.VALUE` باشد (پیش‌فرض)، این متد ممکن " +"است در صورتی استثنایی مانند :exc:`NameError` پرتاب کند که ارجاع پیشرو به " +"نامی اشاره کند که نمی‌توان آن را حل کرد. می‌توان از آرگومان‌های این متد برای " +"فراهم کردن پیوندها برای نام‌هایی استفاده کرد که در غیر این صورت تعریف‌نشده " +"خواهند بود. اگر آرگومان *format* برابر :attr:`~Format.FORWARDREF` باشد، این " +"متد هرگز استثنا پرتاب نخواهد کرد، اما ممکن است نمونه‌ای " +"از :class:`~ForwardRef` بازگشت دهد. برای مثال، اگر شیء ارجاع پیشرو حاوی " +"کد ``list[undefined]`` باشد، که در آن ``undefined`` نامی است که تعریف‌نشده " +"است، ارزیابی آن با قالب :attr:`~Format.FORWARDREF` " +"``list[ForwardRef('undefined')]`` را بازگشت خواهد داد. اگر آرگومان *format* " +"برابر :attr:`~Format.STRING` باشد، این " +"متد :attr:`~ForwardRef.__forward_arg__` را بازگشت خواهد داد." -msgid "The *owner* parameter provides the preferred mechanism for passing scope information to this method. The owner of a :class:`~ForwardRef` is the object that contains the annotation from which the :class:`~ForwardRef` derives, such as a module object, type object, or function object." +msgid "" +"The *owner* parameter provides the preferred mechanism for passing scope " +"information to this method. The owner of a :class:`~ForwardRef` is the " +"object that contains the annotation from which the :class:`~ForwardRef` " +"derives, such as a module object, type object, or function object." msgstr "" +"پارامتر *owner* سازوکار ترجیحی برای انتقال اطلاعات محدوده به این متد را " +"فراهم می‌کند. مالک یک :class:`~ForwardRef` آن شیء است که حاوی حاشیه‌نویسی " +"ای است که :class:`~ForwardRef` از آن مشتق می‌شود، مانند شیء " +"ماژول، شیء نوع، یا شیء تابع." -msgid "The *globals*, *locals*, and *type_params* parameters provide a more precise mechanism for influencing the names that are available when the :class:`~ForwardRef` is evaluated. *globals* and *locals* are passed to :func:`eval`, representing the global and local namespaces in which the name is evaluated. The *type_params* parameter is relevant for objects created using the native syntax for :ref:`generic classes ` and :ref:`functions `. It is a tuple of :ref:`type parameters ` that are in scope while the forward reference is being evaluated. For example, if evaluating a :class:`~ForwardRef` retrieved from an annotation found in the class namespace of a generic class ``C``, *type_params* should be set to ``C.__type_params__``." -msgstr "" +msgid "" +"The *globals*, *locals*, and *type_params* parameters provide a more precise " +"mechanism for influencing the names that are available when " +"the :class:`~ForwardRef` is evaluated. *globals* and *locals* are passed " +"to :func:`eval`, representing the global and local namespaces in which the " +"name is evaluated. The *type_params* parameter is relevant for objects " +"created using the native syntax for :ref:`generic classes ` " +"and :ref:`functions `. It is a tuple of :ref:`type " +"parameters ` that are in scope while the forward reference is " +"being evaluated. For example, if evaluating a :class:`~ForwardRef` retrieved " +"from an annotation found in the class namespace of a generic class ``C``, " +"*type_params* should be set to ``C.__type_params__``." +msgstr "" +"پارامترهای *globals*، *locals* و *type_params* سازوکار دقیق‌تری را برای " +"تأثیرگذاری بر نام‌هایی که هنگام ارزیابی :class:`~ForwardRef` در دسترس هستند، " +"فراهم می‌کنند. *globals* و *locals* به :func:`eval` ارسال می‌شوند و نشان‌دهنده‌ی " +"فضای نام های سراسری و محلی هستند که نام در آن‌ها ارزیابی می‌شود. پارامتر " +"*type_params* برای اشیایی که با استفاده از سینتکس بومی برای :ref:`کلاس‌های " +"عام ` و :ref:`توابع عام ` ایجاد شده‌اند، " +"مرتبط است. این، تاپلی از :ref:`پارامترهای نوع ` است که در حین " +"ارزیابی ارجاع به جلو، در محدوده قرار دارند. برای مثال، اگر در حال ارزیابی " +"یک :class:`~ForwardRef` هستید که از یک حاشیه‌نویسی یافت‌شده در فضای نام کلاسِ " +"یک کلاس عام ``C`` بازیابی شده است، *type_params* باید روی " +"``C.__type_params__`` تنظیم شود." -msgid ":class:`~ForwardRef` instances returned by :func:`get_annotations` retain references to information about the scope they originated from, so calling this method with no further arguments may be sufficient to evaluate such objects. :class:`~ForwardRef` instances created by other means may not have any information about their scope, so passing arguments to this method may be necessary to evaluate them successfully." -msgstr "" +msgid "" +":class:`~ForwardRef` instances returned by :func:`get_annotations` retain " +"references to information about the scope they originated from, so calling " +"this method with no further arguments may be sufficient to evaluate such " +"objects. :class:`~ForwardRef` instances created by other means may not have " +"any information about their scope, so passing arguments to this method may " +"be necessary to evaluate them successfully." +msgstr "" +"نمونه‌های :class:`~ForwardRef` که توسط :func:`get_annotations` بازگردانده " +"می‌شوند، ارجاع‌هایی به اطلاعات مربوط به محدوده‌ای که از آن منشأ گرفته‌اند را حفظ " +"می‌کنند، بنابراین فراخوانی این متد بدون آرگومان‌های بیشتر ممکن است برای " +"ارزیابی چنین اشیایی کافی باشد. نمونه‌های :class:`~ForwardRef` که به روش‌های " +"دیگر ایجاد شده‌اند ممکن است هیچ اطلاعاتی درباره محدوده خود نداشته باشند، " +"بنابراین ارسال آرگومان‌ها به این متد ممکن است برای ارزیابی موفقیت‌آمیز آن‌ها " +"ضروری باشد." -msgid "If no *owner*, *globals*, *locals*, or *type_params* are provided and the :class:`~ForwardRef` does not contain information about its origin, empty globals and locals dictionaries are used." +msgid "" +"If no *owner*, *globals*, *locals*, or *type_params* are provided and " +"the :class:`~ForwardRef` does not contain information about its origin, " +"empty globals and locals dictionaries are used." msgstr "" +"اگر هیچ‌کدام از *owner*، *globals*، *locals* یا *type_params* ارائه نشده " +"باشند و :class:`~ForwardRef` حاوی اطلاعاتی درباره خاستگاه خود نباشد، از " +"دیکشنری‌های خالی *globals* و *locals* استفاده می‌شود." msgid "Functions" -msgstr "" +msgstr "توابع" -msgid "Convert an annotations dict containing runtime values to a dict containing only strings. If the values are not already strings, they are converted using :func:`type_repr`. This is meant as a helper for user-provided annotate functions that support the :attr:`~Format.STRING` format but do not have access to the code creating the annotations." -msgstr "" +msgid "" +"Convert an annotations dict containing runtime values to a dict containing " +"only strings. If the values are not already strings, they are converted " +"using :func:`type_repr`. This is meant as a helper for user-provided " +"annotate functions that support the :attr:`~Format.STRING` format but do not " +"have access to the code creating the annotations." +msgstr "" +"یک دیکشنری حاشیه‌نویسی‌ها را که حاوی مقادیر ران‌تایم است، به دیکشنری‌ای تبدیل " +"می‌کند که فقط شامل رشته‌ها است. اگر مقادیر از قبل رشته نباشند، با استفاده " +"از :func:`type_repr` تبدیل می‌شوند. این به‌عنوان یک کمک‌کننده برای توابع " +"حاشیه‌نویسی (annotate) ارائه‌شده توسط کاربر در نظر گرفته شده است که از " +"قالب :attr:`~Format.STRING` پشتیبانی می‌کنند اما به کدی که حاشیه‌نویسی‌ها را " +"ایجاد می‌کند دسترسی ندارند." -msgid "For example, this is used to implement the :attr:`~Format.STRING` for :class:`typing.TypedDict` classes created through the functional syntax:" +msgid "" +"For example, this is used to implement the :attr:`~Format.STRING` " +"for :class:`typing.TypedDict` classes created through the functional syntax:" msgstr "" +"برای مثال، این برای پیاده‌سازی :attr:`~Format.STRING` برای " +"کلاس‌های :class:`typing.TypedDict` که از طریق سینتکس تابعی ایجاد شده‌اند، " +"استفاده می‌شود:" msgid "" ">>> from typing import TypedDict\n" @@ -166,48 +460,114 @@ msgid "" ">>> get_annotations(Movie, format=Format.STRING)\n" "{'name': 'str', 'year': 'int'}" msgstr "" +">>> from typing import TypedDict\n" +">>> Movie = TypedDict(\"movie\", {\"name\": str, \"year\": int})\n" +">>> get_annotations(Movie, format=Format.STRING)\n" +"{'name': 'str', 'year': 'int'}" -msgid "Call the :term:`annotate function` *annotate* with the given *format*, a member of the :class:`Format` enum, and return the annotations dictionary produced by the function." +msgid "" +"Call the :term:`annotate function` *annotate* with the given *format*, a " +"member of the :class:`Format` enum, and return the annotations dictionary " +"produced by the function." msgstr "" +":term:`annotate function` *annotate* را با *format* داده‌شده، عضوی از شمارشی " +"(enum) :class:`Format`، فراخوانی کنید و دیکشنری حاشیه‌نویسی‌ها " +"تولیدشده توسط تابع را برگردانید." -msgid "This helper function is required because annotate functions generated by the compiler for functions, classes, and modules only support the :attr:`~Format.VALUE` format when called directly. To support other formats, this function calls the annotate function in a special environment that allows it to produce annotations in the other formats. This is a useful building block when implementing functionality that needs to partially evaluate annotations while a class is being constructed." -msgstr "" +msgid "" +"This helper function is required because annotate functions generated by the " +"compiler for functions, classes, and modules only support " +"the :attr:`~Format.VALUE` format when called directly. To support other " +"formats, this function calls the annotate function in a special environment " +"that allows it to produce annotations in the other formats. This is a useful " +"building block when implementing functionality that needs to partially " +"evaluate annotations while a class is being constructed." +msgstr "" +"این تابع کمکی مورد نیاز است، زیرا توابع annotate (annotate functions) " +"تولیدشده توسط کامپایلر برای توابع، کلاس‌ها و ماژول‌ها، هنگام فراخوانی مستقیم " +"تنها از قالب :attr:`~Format.VALUE` پشتیبانی می‌کنند. برای پشتیبانی از سایر " +"قالب‌ها، این تابع، تابع annotate (annotate function) را در محیط ویژه‌ای " +"فراخوانی می‌کند که به آن امکان می‌دهد حاشیه‌نویسی‌هارا در سایر " +"قالب‌ها تولید کند. این یک جزء سازنده‌ی مفید در پیاده‌سازی قابلیتی است که نیاز " +"دارد حاشیه‌نویسی‌ها را در حالی که یک کلاس در حال ساخته‌شدن است به‌طور جزئی " +"ارزیابی کند." -msgid "*owner* is the object that owns the annotation function, usually a function, class, or module. If provided, it is used in the :attr:`~Format.FORWARDREF` format to produce a :class:`ForwardRef` object that carries more information." +msgid "" +"*owner* is the object that owns the annotation function, usually a function, " +"class, or module. If provided, it is used in the :attr:`~Format.FORWARDREF` " +"format to produce a :class:`ForwardRef` object that carries more information." msgstr "" +"*owner* شیءای است که تابع حاشیه‌نویسی‌ها به آن تعلق دارد و معمولاً یک تابع، کلاس " +"یا ماژول است. در صورت ارائه، از آن در قالب :attr:`~Format.FORWARDREF` برای " +"ایجاد یک شیء :class:`ForwardRef` حاوی اطلاعات بیشتر استفاده می‌شود." -msgid ":PEP:`PEP 649 <649#the-stringizer-and-the-fake-globals-environment>` contains an explanation of the implementation technique used by this function." +msgid "" +":PEP:`PEP 649 <649#the-stringizer-and-the-fake-globals-environment>` " +"contains an explanation of the implementation technique used by this " +"function." msgstr "" +":PEP:`PEP 649 <649#the-stringizer-and-the-fake-globals-environment>` شامل " +"توضیحی درباره‌ی روش پیاده‌سازی به‌کاررفته در این تابع است." -msgid "Call the :term:`evaluate function` *evaluate* with the given *format*, a member of the :class:`Format` enum, and return the value produced by the function. This is similar to :func:`call_annotate_function`, but the latter always returns a dictionary mapping strings to annotations, while this function returns a single value." -msgstr "" +msgid "" +"Call the :term:`evaluate function` *evaluate* with the given *format*, a " +"member of the :class:`Format` enum, and return the value produced by the " +"function. This is similar to :func:`call_annotate_function`, but the latter " +"always returns a dictionary mapping strings to annotations, while this " +"function returns a single value." +msgstr "" +":term:`evaluate function` یعنی *evaluate* را با *format* داده‌شده، که عضوی از " +"enum :class:`Format` است، فراخوانی می‌کند و مقدار تولیدشده توسط تابع را " +"برمی‌گرداند. این تابع مشابه :func:`call_annotate_function` است، اما آن تابع " +"همیشه دیکشنری‌ای را برمی‌گرداند که رشته‌ها را به annotationها نگاشت می‌کند، در " +"حالی که این تابع یک مقدار واحد را برمی‌گرداند." -msgid "This is intended for use with the evaluate functions generated for lazily evaluated elements related to type aliases and type parameters:" +msgid "" +"This is intended for use with the evaluate functions generated for lazily " +"evaluated elements related to type aliases and type parameters:" msgstr "" +"این برای استفاده با توابع ارزیابی تولیدشده برای عناصری که با تأخیر ارزیابی " +"می‌شوند و به نام‌های مستعار نوع و پارامترهای نوع مربوط هستند، در نظر گرفته شده " +"است:" msgid ":meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases" -msgstr "" +msgstr ":meth:`typing.TypeAliasType.evaluate_value`، مقدار نام‌های مستعار نوع" msgid ":meth:`typing.TypeVar.evaluate_bound`, the bound of type variables" -msgstr "" +msgstr ":meth:`typing.TypeVar.evaluate_bound`، کران متغیرهای نوع" -msgid ":meth:`typing.TypeVar.evaluate_constraints`, the constraints of type variables" -msgstr "" +msgid "" +":meth:`typing.TypeVar.evaluate_constraints`, the constraints of type " +"variables" +msgstr ":meth:`typing.TypeVar.evaluate_constraints`، محدودیت‌های متغیرهای نوع" -msgid ":meth:`typing.TypeVar.evaluate_default`, the default value of type variables" -msgstr "" +msgid "" +":meth:`typing.TypeVar.evaluate_default`, the default value of type variables" +msgstr ":meth:`typing.TypeVar.evaluate_default`، مقدار پیش‌فرض متغیرهای نوع" -msgid ":meth:`typing.ParamSpec.evaluate_default`, the default value of parameter specifications" -msgstr "" +msgid "" +":meth:`typing.ParamSpec.evaluate_default`, the default value of parameter " +"specifications" +msgstr ":meth:`typing.ParamSpec.evaluate_default`، مقدار پیش‌فرض مشخصات پارامتر" -msgid ":meth:`typing.TypeVarTuple.evaluate_default`, the default value of type variable tuples" +msgid "" +":meth:`typing.TypeVarTuple.evaluate_default`, the default value of type " +"variable tuples" msgstr "" +":meth:`typing.TypeVarTuple.evaluate_default`، مقدار پیش‌فرض تاپل‌های متغیر نوع" -msgid "*owner* is the object that owns the evaluate function, such as the type alias or type variable object." +msgid "" +"*owner* is the object that owns the evaluate function, such as the type " +"alias or type variable object." msgstr "" +"*owner* شیءای است که تابع evaluate به آن تعلق دارد، مانند شیء نام مستعار نوع " +"یا شیء متغیر نوع." -msgid "*format* can be used to control the format in which the value is returned:" +msgid "" +"*format* can be used to control the format in which the value is returned:" msgstr "" +"*format* می‌تواند برای کنترل قالبی که مقدار در آن برگردانده می‌شود، استفاده " +"شود:" msgid "" ">>> type Alias = undefined\n" @@ -220,75 +580,234 @@ msgid "" ">>> call_evaluate_function(Alias.evaluate_value, Format.STRING)\n" "'undefined'" msgstr "" +">>> type Alias = undefined\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)\n" +"Traceback (most recent call last):\n" +"...\n" +"NameError: name 'undefined' is not defined\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)\n" +"ForwardRef('undefined')\n" +">>> call_evaluate_function(Alias.evaluate_value, Format.STRING)\n" +"'undefined'" -msgid "Retrieve the :term:`annotate function` from a class namespace dictionary *namespace*. Return :const:`!None` if the namespace does not contain an annotate function. This is primarily useful before the class has been fully created (e.g., in a metaclass); after the class exists, the annotate function can be retrieved with ``cls.__annotate__``. See :ref:`below ` for an example using this function in a metaclass." -msgstr "" +msgid "" +"Retrieve the :term:`annotate function` from a class namespace dictionary " +"*namespace*. Return :const:`!None` if the namespace does not contain an " +"annotate function. This is primarily useful before the class has been fully " +"created (e.g., in a metaclass); after the class exists, the annotate " +"function can be retrieved with ``cls.__annotate__``. See :ref:`below " +"` for an example using this function in a metaclass." +msgstr "" +":term:`annotate function` را از دیکشنری فضای نام کلاس *namespace* بازیابی " +"می‌کند. اگر فضای نام شامل تابع annotate نباشد، :const:`!None` را بازمی‌گرداند. " +"این موضوع عمدتاً پیش از آنکه کلاس به‌طور کامل ایجاد شده باشد (مثلاً در یک " +"فراکلاس) مفید است؛ پس از ایجاد کلاس، می‌توان تابع annotate را با " +"``cls.__annotate__`` بازیابی کرد. برای نمونه‌ای از استفاده از این تابع در " +"فراکلاس، :ref:`زیر ` را ببینید." msgid "Compute the annotations dict for an object." -msgstr "" +msgstr "دیکشنری حاشیه‌نویسی‌های یک شیء را محاسبه کنید." -msgid "*obj* may be a callable, class, module, or other object with :attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes. Passing any other object raises :exc:`TypeError`." +msgid "" +"*obj* may be a callable, class, module, or other object " +"with :attr:`~object.__annotate__` or :attr:`~object.__annotations__` " +"attributes. Passing any other object raises :exc:`TypeError`." msgstr "" +"*obj* می‌تواند یک شیء قابل فراخوانی، کلاس، ماژول، یا شیء دیگری دارای " +"ویژگی‌های :attr:`~object.__annotate__` یا :attr:`~object.__annotations__` " +"باشد. اگر هر شیء دیگری داده شود، :exc:`TypeError` پرتاب می‌شود." -msgid "The *format* parameter controls the format in which annotations are returned, and must be a member of the :class:`Format` enum or its integer equivalent. The different formats work as follows:" +msgid "" +"The *format* parameter controls the format in which annotations are " +"returned, and must be a member of the :class:`Format` enum or its integer " +"equivalent. The different formats work as follows:" msgstr "" +"پارامتر *format* قالبی را که حاشیه‌نویسی‌ها در آن بازگردانده می‌شوند کنترل " +"می‌کند، و باید عضوی از enum :class:`Format` یا معادل عدد صحیح آن باشد. " +"قالب‌های مختلف به‌صورت زیر عمل می‌کنند:" -msgid "VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist, the :attr:`!object.__annotate__` function is called if it exists." +msgid "" +"VALUE: :attr:`!object.__annotations__` is tried first; if that does not " +"exist, the :attr:`!object.__annotate__` function is called if it exists." msgstr "" +"ابتدا :attr:`!object.__annotations__` بررسی می‌شود؛ اگر آن وجود نداشته باشد، " +"تابع :attr:`!object.__annotate__` در صورت وجود فراخوانی می‌شود." -msgid "FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully, it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it does not exist either, :attr:`!object.__annotations__` is tried again and any error from accessing it is re-raised." -msgstr "" +msgid "" +"FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated " +"successfully, it is used; otherwise, the :attr:`!object.__annotate__` " +"function is called. If it does not exist either, :attr:`!" +"object.__annotations__` is tried again and any error from accessing it is re-" +"raised." +msgstr "" +"FORWARDREF: اگر :attr:`!object.__annotations__` وجود داشته باشد و بتوان آن " +"را با موفقیت ارزیابی کرد، از آن استفاده می‌شود؛ در غیر این صورت، تابع :attr:`!" +"object.__annotate__` فراخوانی می‌شود. اگر این نیز وجود نداشته باشد، بار دیگر " +"برای :attr:`!object.__annotations__` تلاش می‌شود و هر خطایی که از دسترسی به " +"آن حاصل شود، دوباره پرتاب می‌شود." -msgid "When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.FORWARDREF`. If this is not implemented, it will then check if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` is supported and use that in the fake globals environment. If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` fails, the error from this call will be raised." -msgstr "" +msgid "" +"When calling :attr:`!object.__annotate__` it is first called " +"with :attr:`~Format.FORWARDREF`. If this is not implemented, it will then " +"check if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` is supported and use that " +"in the fake globals environment. If neither of these formats are supported, " +"it will fall back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` " +"fails, the error from this call will be raised." +msgstr "" +"هنگام فراخوانی :attr:`!object.__annotate__`، ابتدا " +"با :attr:`~Format.FORWARDREF` فراخوانی می‌شود. اگر این قالب پیاده‌سازی نشده " +"باشد، سپس بررسی می‌شود که آیا :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` " +"پشتیبانی می‌شود یا خیر و در صورت پشتیبانی، از آن در محیط سراسری جعلی استفاده " +"می‌شود. اگر هیچ‌کدام از این قالب‌ها پشتیبانی نشود، به استفاده " +"از :attr:`~Format.VALUE` بازمی‌گردد. اگر :attr:`~Format.VALUE` با شکست مواجه " +"شود، خطای حاصل از این فراخوانی پرتاب می‌شود." -msgid "STRING: If :attr:`!object.__annotate__` exists, it is called first; otherwise, :attr:`!object.__annotations__` is used and stringified using :func:`annotations_to_string`." +msgid "" +"STRING: If :attr:`!object.__annotate__` exists, it is called first; " +"otherwise, :attr:`!object.__annotations__` is used and stringified " +"using :func:`annotations_to_string`." msgstr "" +"اگر :attr:`!object.__annotate__` وجود داشته باشد، ابتدا فراخوانی می‌شود؛ در " +"غیر این صورت، از :attr:`!object.__annotations__` استفاده می‌شود و با استفاده " +"از :func:`annotations_to_string` به رشته تبدیل می‌شود." -msgid "When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.STRING`. If this is not implemented, it will then check if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` is supported and use that in the fake globals environment. If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE` with the result converted using :func:`annotations_to_string`. If :attr:`~Format.VALUE` fails, the error from this call will be raised." -msgstr "" +msgid "" +"When calling :attr:`!object.__annotate__` it is first called " +"with :attr:`~Format.STRING`. If this is not implemented, it will then check " +"if :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` is supported and use that in the " +"fake globals environment. If neither of these formats are supported, it will " +"fall back to using :attr:`~Format.VALUE` with the result converted " +"using :func:`annotations_to_string`. If :attr:`~Format.VALUE` fails, the " +"error from this call will be raised." +msgstr "" +"هنگام فراخوانی :attr:`!object.__annotate__`، ابتدا با :attr:`~Format.STRING` " +"فراخوانی می‌شود. اگر این قالب پیاده‌سازی نشده باشد، سپس بررسی می‌شود که " +"آیا :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` پشتیبانی می‌شود یا خیر و در صورت " +"پشتیبانی، از آن در محیط سراسری جعلی استفاده می‌شود. اگر هیچ‌کدام از این قالب‌ها " +"پشتیبانی نشوند، به استفاده از :attr:`~Format.VALUE` بازمی‌گردد و نتیجه با " +"استفاده از :func:`annotations_to_string` تبدیل می‌شود. " +"اگر :attr:`~Format.VALUE` با شکست مواجه شود، خطای حاصل از این فراخوانی پرتاب " +"می‌شود." -msgid "Returns a dict. :func:`!get_annotations` returns a new dict every time it's called; calling it twice on the same object will return two different but equivalent dicts." +msgid "" +"Returns a dict. :func:`!get_annotations` returns a new dict every time it's " +"called; calling it twice on the same object will return two different but " +"equivalent dicts." msgstr "" +"یک دیکشنری بازمی‌گرداند. :func:`!get_annotations` هر بار که فراخوانی می‌شود یک " +"دیکشنری جدید بازمی‌گرداند؛ دو بار فراخوانی آن روی یک شیء، دو دیکشنری متفاوت " +"اما معادل بازمی‌گرداند." msgid "This function handles several details for you:" -msgstr "" +msgstr "این تابع چندین جزئیات را برای شما مدیریت می‌کند:" -msgid "If *eval_str* is true, values of type :class:`!str` will be un-stringized using :func:`eval`. This is intended for use with stringized annotations (``from __future__ import annotations``). It is an error to set *eval_str* to true with formats other than :attr:`Format.VALUE`." +msgid "" +"If *eval_str* is true, values of type :class:`!str` will be un-stringized " +"using :func:`eval`. This is intended for use with stringized annotations " +"(``from __future__ import annotations``). It is an error to set *eval_str* " +"to true with formats other than :attr:`Format.VALUE`." msgstr "" +"اگر *eval_str* برابر true باشد، مقادیر از نوع :class:`!str` با استفاده " +"از :func:`eval` از حالت رشته‌ای خارج می‌شوند. این قابلیت برای استفاده با " +"حاشیه‌نویسی‌های رشته‌ای‌شده (``from __future__ import annotations``) در نظر " +"گرفته شده است. تنظیم *eval_str* روی true در قالب‌هایی غیر " +"از :attr:`Format.VALUE` خطا است." -msgid "If *obj* doesn't have an annotations dict, returns an empty dict. (Functions and methods always have an annotations dict; classes, modules, and other types of callables may not.)" +msgid "" +"If *obj* doesn't have an annotations dict, returns an empty dict. (Functions " +"and methods always have an annotations dict; classes, modules, and other " +"types of callables may not.)" msgstr "" +"اگر *obj* دیکشنری annotations نداشته باشد، یک دیکشنری خالی برمی‌گرداند. " +"(توابع و متدها همیشه دیکشنری annotations دارند؛ کلاس‌ها، ماژول‌ها و سایر انواع " +"قابل فراخوانی ممکن است نداشته باشند.)" -msgid "Ignores inherited annotations on classes, as well as annotations on metaclasses. If a class doesn't have its own annotations dict, returns an empty dict." +msgid "" +"Ignores inherited annotations on classes, as well as annotations on " +"metaclasses. If a class doesn't have its own annotations dict, returns an " +"empty dict." msgstr "" +"حاشیه‌نویسی‌های موروثی کلاس‌هاو همچنین حاشیه‌نویسی‌های فراکلاس‌ها " +"را نادیده می‌گیرد. اگر کلاسی دیکشنری حاشیه‌نویسی‌های خود را نداشته باشد، یک " +"دیکشنری خالی برمی‌گرداند." -msgid "All accesses to object members and dict values are done using ``getattr()`` and ``dict.get()`` for safety." +msgid "" +"All accesses to object members and dict values are done using ``getattr()`` " +"and ``dict.get()`` for safety." msgstr "" +"تمام دسترسی‌ها به اعضای شیء و مقادیر دیکشنری برای ایمنی با استفاده از " +"``getattr()`` و ``dict.get()`` انجام می‌شوند." -msgid "*eval_str* controls whether or not values of type :class:`!str` are replaced with the result of calling :func:`eval` on those values:" +msgid "" +"*eval_str* controls whether or not values of type :class:`!str` are replaced " +"with the result of calling :func:`eval` on those values:" msgstr "" +"*eval_str* تعیین می‌کند که آیا مقادیر از نوع :class:`!str` با نتیجه‌ی " +"فراخوانی :func:`eval` روی آن مقادیر جایگزین می‌شوند یا خیر:" -msgid "If eval_str is true, :func:`eval` is called on values of type :class:`!str`. (Note that :func:`!get_annotations` doesn't catch exceptions; if :func:`eval` raises an exception, it will unwind the stack past the :func:`!get_annotations` call.)" +msgid "" +"If eval_str is true, :func:`eval` is called on values of type :class:`!str`. " +"(Note that :func:`!get_annotations` doesn't catch exceptions; " +"if :func:`eval` raises an exception, it will unwind the stack past " +"the :func:`!get_annotations` call.)" msgstr "" +"اگر eval_str درست باشد، :func:`eval` روی مقادیری از نوع :class:`!str` " +"فراخوانی می‌شود. (توجه داشته باشید که :func:`!get_annotations` استثناها را " +"مهار نمی‌کند؛ اگر :func:`eval` استثنایی پرتاب کند، باعث باز شدن پشته تا پس از " +"فراخوانی :func:`!get_annotations` خواهد شد.)" -msgid "If *eval_str* is false (the default), values of type :class:`!str` are unchanged." +msgid "" +"If *eval_str* is false (the default), values of type :class:`!str` are " +"unchanged." msgstr "" +"اگر *eval_str* نادرست باشد (پیش‌فرض)، مقادیر از نوع :class:`!str` بدون تغییر " +"می‌مانند." -msgid "*globals* and *locals* are passed in to :func:`eval`; see the documentation for :func:`eval` for more information. If *globals* or *locals* is :const:`!None`, this function may replace that value with a context-specific default, contingent on ``type(obj)``:" +msgid "" +"*globals* and *locals* are passed in to :func:`eval`; see the documentation " +"for :func:`eval` for more information. If *globals* or *locals* is :const:`!" +"None`, this function may replace that value with a context-specific default, " +"contingent on ``type(obj)``:" msgstr "" +"*globals* و *locals* به :func:`eval` ارسال می‌شوند؛ برای اطلاعات بیشتر، " +"مستندات :func:`eval` را ببینید. اگر *globals* یا *locals* برابر :const:`!" +"None` باشد، این تابع ممکن است، بسته به ``type(obj)``، آن مقدار را با یک " +"پیش‌فرض وابسته به زمینه جایگزین کند:" msgid "If *obj* is a module, *globals* defaults to ``obj.__dict__``." msgstr "" +"اگر *obj* یک ماژول باشد، *globals* به‌طور پیش‌فرض برابر با ``obj.__dict__`` " +"است." -msgid "If *obj* is a class, *globals* defaults to ``sys.modules[obj.__module__].__dict__`` and *locals* defaults to the *obj* class namespace." +msgid "" +"If *obj* is a class, *globals* defaults to " +"``sys.modules[obj.__module__].__dict__`` and *locals* defaults to the *obj* " +"class namespace." msgstr "" +"اگر *obj* یک کلاس باشد، *globals* به‌طور پیش‌فرض " +"``sys.modules[obj.__module__].__dict__`` است و *locals* به‌طور پیش‌فرض فضای " +"نام کلاس *obj* است." -msgid "If *obj* is a callable, *globals* defaults to :attr:`obj.__globals__ `, although if *obj* is a wrapped function (using :func:`functools.update_wrapper`) or a :class:`functools.partial` object, it is unwrapped until a non-wrapped function is found." +msgid "" +"If *obj* is a callable, *globals* defaults to :attr:`obj.__globals__ " +"`, although if *obj* is a wrapped function " +"(using :func:`functools.update_wrapper`) or a :class:`functools.partial` " +"object, it is unwrapped until a non-wrapped function is found." msgstr "" +"اگر *obj* فراخوان‌پذیر باشد، مقدار پیش‌فرض *globals* برابر " +"با :attr:`obj.__globals__ ` است، هرچند اگر *obj* یک " +"تابع پوشیده‌شده (با استفاده از :func:`functools.update_wrapper`) یا یک " +"شیء :class:`functools.partial` باشد، تا زمانی که یک تابع بدون پوشش پیدا شود، " +"پوشش آن برداشته می‌شود." -msgid "Calling :func:`!get_annotations` is best practice for accessing the annotations dict of any object. See :ref:`annotations-howto` for more information on annotations best practices." +msgid "" +"Calling :func:`!get_annotations` is best practice for accessing the " +"annotations dict of any object. See :ref:`annotations-howto` for more " +"information on annotations best practices." msgstr "" +"فراخوانی :func:`!get_annotations` بهترین روش برای دسترسی به دیکشنری " +"حاشیه‌نویسی‌های هر شیء است. برای اطلاعات بیشتر درباره بهترین روش‌های " +"حاشیه‌نویسی، :ref:`annotations-howto` را ببینید." msgid "" ">>> def f(a: int, b: str) -> float:\n" @@ -296,27 +815,81 @@ msgid "" ">>> get_annotations(f)\n" "{'a': , 'b': , 'return': }" msgstr "" +">>> def f(a: int, b: str) -> float:\n" +"... pass\n" +">>> get_annotations(f)\n" +"{'a': , 'b': , 'return': }" -msgid "Convert an arbitrary Python value to a format suitable for use by the :attr:`~Format.STRING` format. This calls :func:`repr` for most objects, but has special handling for some objects, such as type objects." +msgid "" +"Convert an arbitrary Python value to a format suitable for use by " +"the :attr:`~Format.STRING` format. This calls :func:`repr` for most objects, " +"but has special handling for some objects, such as type objects." msgstr "" +"یک مقدار دلخواه پایتون را به قالبی مناسب برای استفاده توسط " +"قالب :attr:`~Format.STRING` تبدیل می‌کند. این تابع برای بیشتر " +"اشیاء، :func:`repr` را فراخوانی می‌کند، اما برای برخی اشیاء، مانند اشیاء نوع، " +"مدیریت ویژه‌ای دارد." -msgid "This is meant as a helper for user-provided annotate functions that support the :attr:`~Format.STRING` format but do not have access to the code creating the annotations. It can also be used to provide a user-friendly string representation for other objects that contain values that are commonly encountered in annotations." -msgstr "" +msgid "" +"This is meant as a helper for user-provided annotate functions that support " +"the :attr:`~Format.STRING` format but do not have access to the code " +"creating the annotations. It can also be used to provide a user-friendly " +"string representation for other objects that contain values that are " +"commonly encountered in annotations." +msgstr "" +"این به‌عنوان یک ابزار کمکی برای توابع حاشیه‌نویسی (annotate) ارائه‌شده توسط " +"کاربر در نظر گرفته شده است که از قالب :attr:`~Format.STRING` پشتیبانی " +"می‌کنند، اما به کدی که حاشیه‌نویسی‌هارا ایجاد می‌کند دسترسی " +"ندارند. همچنین می‌توان از آن برای فراهم کردن یک نمایش رشته‌ای کاربرپسند برای " +"اشیاء دیگری استفاده کرد که حاوی مقادیری هستند که معمولاً در حاشیه‌نویسی‌ها " +" با آن‌ها مواجه می‌شوید." msgid "Recipes" -msgstr "" +msgstr "دستور پخت‌ها" msgid "Using annotations in a metaclass" -msgstr "" +msgstr "استفاده از حاشیه‌نویسی‌ها در یک فراکلاس" -msgid "A :ref:`metaclass ` may want to inspect or even modify the annotations in a class body during class creation. Doing so requires retrieving annotations from the class namespace dictionary. For classes created with ``from __future__ import annotations``, the annotations will be in the ``__annotations__`` key of the dictionary. For other classes with annotations, :func:`get_annotate_from_class_namespace` can be used to get the annotate function, and :func:`call_annotate_function` can be used to call it and retrieve the annotations. Using the :attr:`~Format.FORWARDREF` format will usually be best, because this allows the annotations to refer to names that cannot yet be resolved when the class is created." -msgstr "" +msgid "" +"A :ref:`metaclass ` may want to inspect or even modify the " +"annotations in a class body during class creation. Doing so requires " +"retrieving annotations from the class namespace dictionary. For classes " +"created with ``from __future__ import annotations``, the annotations will be " +"in the ``__annotations__`` key of the dictionary. For other classes with " +"annotations, :func:`get_annotate_from_class_namespace` can be used to get " +"the annotate function, and :func:`call_annotate_function` can be used to " +"call it and retrieve the annotations. Using the :attr:`~Format.FORWARDREF` " +"format will usually be best, because this allows the annotations to refer to " +"names that cannot yet be resolved when the class is created." +msgstr "" +"ممکن است یک :ref:`فراکلاس ` بخواهد در جریان ایجاد کلاس، " +"یادداشت‌هاموجود در بدنه کلاس را بررسی یا حتی اصلاح کند. این " +"کار مستلزم بازیابی یادداشت‌ها از دیکشنری فضای نام کلاس است. برای کلاس‌هایی که " +"با ``from __future__ import annotations`` ایجاد شده‌اند، یادداشت‌ها در کلید " +"``__annotations__`` دیکشنری قرار خواهند داشت. برای سایر کلاس‌های دارای " +"یادداشت، می‌توان از :func:`get_annotate_from_class_namespace` برای دریافت " +"تابع حاشیه‌نویسی (annotate) استفاده کرد و می‌توان " +"از :func:`call_annotate_function` برای فراخوانی آن و بازیابی یادداشت‌ها " +"استفاده کرد. استفاده از قالب :attr:`~Format.FORWARDREF` معمولاً بهترین حالت " +"است، زیرا این امر به یادداشت‌ها اجازه می‌دهد به نام‌هایی ارجاع دهند که هنوز در " +"زمان ایجاد کلاس قابل حل نیستند." -msgid "To modify the annotations, it is best to create a wrapper annotate function that calls the original annotate function, makes any necessary adjustments, and returns the result." +msgid "" +"To modify the annotations, it is best to create a wrapper annotate function " +"that calls the original annotate function, makes any necessary adjustments, " +"and returns the result." msgstr "" +"برای تغییر حاشیه‌نویسی‌ها، بهتر است یک تابع annotate پوششی ایجاد کنید که تابع " +"annotate اصلی را فراخوانی کند، تنظیمات لازم را اعمال کند و نتیجه را برگرداند." -msgid "Below is an example of a metaclass that filters out all :class:`typing.ClassVar` annotations from the class and puts them in a separate attribute:" +msgid "" +"Below is an example of a metaclass that filters out " +"all :class:`typing.ClassVar` annotations from the class and puts them in a " +"separate attribute:" msgstr "" +"در زیر مثالی از یک فراکلاس آمده است که تمام " +"حاشیه‌نویسی‌های :class:`typing.ClassVar` را از کلاس جدا می‌کند و آن‌ها را در یک " +"ویژگی جداگانه قرار می‌دهد:" msgid "" "import annotationlib\n" @@ -349,8 +922,10 @@ msgid "" " classvars = {key: annotations[key] for key in classvar_keys}\n" "\n" " def wrapped_annotate(format):\n" -" annos = annotationlib.call_annotate_function(annotate, format, owner=typ)\n" -" return {key: value for key, value in annos.items() if key not in classvar_keys}\n" +" annos = annotationlib.call_annotate_function(annotate, format, " +"owner=typ)\n" +" return {key: value for key, value in annos.items() if key not in " +"classvar_keys}\n" "\n" " else: # no annotations\n" " classvars = {}\n" @@ -358,41 +933,139 @@ msgid "" " typ = super().__new__(mcls, name, bases, ns)\n" "\n" " if wrapped_annotate is not None:\n" -" # Wrap the original __annotate__ with a wrapper that removes ClassVars\n" +" # Wrap the original __annotate__ with a wrapper that removes " +"ClassVars\n" " typ.__annotate__ = wrapped_annotate\n" -" typ.classvars = classvars # Store the ClassVars in a separate attribute\n" +" typ.classvars = classvars # Store the ClassVars in a separate " +"attribute\n" " return typ" msgstr "" +"import annotationlib\n" +"import typing\n" +"\n" +"class ClassVarSeparator(type):\n" +" def __new__(mcls, name, bases, ns):\n" +" if \"__annotations__\" in ns: # from __future__ import annotations\n" +" annotations = ns[\"__annotations__\"]\n" +" classvar_keys = {\n" +" key for key, value in annotations.items()\n" +" # Use string comparison for simplicity; a more robust solution\n" +" # could use annotationlib.ForwardRef.evaluate\n" +" if value.startswith(\"ClassVar\")\n" +" }\n" +" classvars = {key: annotations[key] for key in classvar_keys}\n" +" ns[\"__annotations__\"] = {\n" +" key: value for key, value in annotations.items()\n" +" if key not in classvar_keys\n" +" }\n" +" wrapped_annotate = None\n" +" elif annotate := annotationlib.get_annotate_from_class_namespace(ns):\n" +" annotations = annotationlib.call_annotate_function(\n" +" annotate, format=annotationlib.Format.FORWARDREF\n" +" )\n" +" classvar_keys = {\n" +" key for key, value in annotations.items()\n" +" if typing.get_origin(value) is typing.ClassVar\n" +" }\n" +" classvars = {key: annotations[key] for key in classvar_keys}\n" +"\n" +" def wrapped_annotate(format):\n" +" annos = annotationlib.call_annotate_function(annotate, format, " +"owner=typ)\n" +" return {key: value for key, value in annos.items() if key not in " +"classvar_keys}\n" +"\n" +" else: # no annotations\n" +" classvars = {}\n" +" wrapped_annotate = None\n" +" typ = super().__new__(mcls, name, bases, ns)\n" +"\n" +" if wrapped_annotate is not None:\n" +" # Wrap the original __annotate__ with a wrapper that removes " +"ClassVars\n" +" typ.__annotate__ = wrapped_annotate\n" +" typ.classvars = classvars # Store the ClassVars in a separate " +"attribute\n" +" return typ" msgid "Creating a custom callable annotate function" -msgstr "" +msgstr "ایجاد یک تابع حاشیه‌نویسی (annotate) سفارشی و فراخوانی‌پذیر" -msgid "Custom :term:`annotate functions ` may be literal functions like those automatically generated for functions, classes, and modules. Or, they may wish to utilise the encapsulation provided by classes, in which case any :term:`callable` can be used as an :term:`annotate function`." -msgstr "" +msgid "" +"Custom :term:`annotate functions ` may be literal " +"functions like those automatically generated for functions, classes, and " +"modules. Or, they may wish to utilise the encapsulation provided by classes, " +"in which case any :term:`callable` can be used as an :term:`annotate " +"function`." +msgstr "" +":term:`تابع‌های annotate ` سفارشی می‌توانند تابع‌های واقعی " +"(literal functions) باشند، مانند آن‌هایی که به‌طور خودکار برای تابع‌ها، کلاس‌ها " +"و ماژول‌ها تولید می‌شوند. یا ممکن است بخواهید از کپسوله‌سازی فراهم‌شده توسط " +"کلاس‌ها استفاده کنید، که در این صورت هر :term:`callable` می‌تواند به‌عنوان " +"یک :term:`annotate function` استفاده شود." -msgid "To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or :attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide the following attribute:" +msgid "" +"To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, " +"or :attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` " +"must provide the following attribute:" msgstr "" +"برای ارائه مستقیم قالب‌های :attr:`~Format.VALUE`، :attr:`~Format.STRING` " +"یا :attr:`~Format.FORWARDREF`، یک :term:`annotate function` باید ویژگی زیر " +"را فراهم کند:" -msgid "A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not raise a :exc:`NotImplementedError` when called with a supported format." +msgid "" +"A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that " +"does not raise a :exc:`NotImplementedError` when called with a supported " +"format." msgstr "" +"یک ``__call__`` قابل فراخوانی با امضای ``__call__(format, /) -> dict``، که " +"هنگام فراخوانی با یک قالب پشتیبانی‌شده، :exc:`NotImplementedError` پرتاب " +"نمی‌کند." -msgid "To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used to automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if they are not supported directly, :term:`annotate functions ` must provide the following attributes:" +msgid "" +"To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used " +"to automatically generate :attr:`~Format.STRING` " +"or :attr:`~Format.FORWARDREF` if they are not supported " +"directly, :term:`annotate functions ` must provide the " +"following attributes:" msgstr "" +"برای فراهم کردن قالب :attr:`~Format.VALUE_WITH_FAKE_GLOBALS`، که برای تولید " +"خودکار :attr:`~Format.STRING` یا :attr:`~Format.FORWARDREF` در صورتی که " +"به‌طور مستقیم پشتیبانی نشوند استفاده می‌شود، :term:`توابع annotate ` باید ویژگی‌های زیر را فراهم کنند:" -msgid "A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not raise a :exc:`NotImplementedError` when called with :attr:`~Format.VALUE_WITH_FAKE_GLOBALS`." +msgid "" +"A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that " +"does not raise a :exc:`NotImplementedError` when called " +"with :attr:`~Format.VALUE_WITH_FAKE_GLOBALS`." msgstr "" +"یک ``__call__`` قابل فراخوانی با امضای ``__call__(format, /) -> dict``، که " +"هنگام فراخوانی با :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` " +"استثنای :exc:`NotImplementedError` را پرتاب نمی‌کند." -msgid "A :ref:`code object ` ``__code__`` containing the compiled code for the annotate function." +msgid "" +"A :ref:`code object ` ``__code__`` containing the compiled " +"code for the annotate function." msgstr "" +"یک :ref:`شیء کد ` ``__code__`` که شامل کد کامپایل‌شده برای تابع " +"annotate است." -msgid "Optional: A tuple of the function's positional defaults ``__kwdefaults__``, if the function represented by ``__code__`` uses any positional defaults." +msgid "" +"Optional: A tuple of the function's positional defaults ``__kwdefaults__``, " +"if the function represented by ``__code__`` uses any positional defaults." msgstr "" +"اختیاری: یک تاپل از پیش‌فرض‌های جایگاهی تابع ``__kwdefaults__``، اگر تابع " +"نشان‌داده‌شده توسط ``__code__`` از هرگونه پیش‌فرض جایگاهی استفاده کند." -msgid "Optional: A dict of the function's keyword defaults ``__defaults__``, if the function represented by ``__code__`` uses any keyword defaults." +msgid "" +"Optional: A dict of the function's keyword defaults ``__defaults__``, if the " +"function represented by ``__code__`` uses any keyword defaults." msgstr "" +"اختیاری: یک دیکشنری از مقادیر پیش‌فرض کلیدواژه‌ای تابع ``__defaults__``، اگر " +"تابع نشان‌داده‌شده با ``__code__`` از مقادیر پیش‌فرض کلیدواژه‌ای استفاده کند." msgid "Optional: All other :ref:`function attributes `." -msgstr "" +msgstr "اختیاری: همه‌ی :ref:`ویژگی‌های دیگر تابع `." msgid "" "class Annotate:\n" @@ -417,18 +1090,42 @@ msgid "" " __builtins__ = {}\n" " __closure__ = None" msgstr "" +"class Annotate:\n" +" called_formats = []\n" +"\n" +" def __call__(self, format=None, /, *, _self=None):\n" +" # When called with fake globals, `_self` will be the\n" +" # actual self value, and `self` will be the format.\n" +" if _self is not None:\n" +" self, format = _self, self\n" +"\n" +" self.called_formats.append(format)\n" +" if format <= 2: # VALUE or VALUE_WITH_FAKE_GLOBALS\n" +" return {\"x\": MyType}\n" +" raise NotImplementedError\n" +"\n" +" __code__ = __call__.__code__\n" +" __defaults__ = (None,)\n" +" __kwdefaults__ = property(lambda self: dict(_self=self))\n" +"\n" +" __globals__ = {}\n" +" __builtins__ = {}\n" +" __closure__ = None" msgid "This can then be called with:" -msgstr "" +msgstr "سپس می‌توان آن را به این صورت فراخوانی کرد:" msgid "" ">>> from annotationlib import call_annotate_function, Format\n" ">>> call_annotate_function(Annotate(), format=Format.STRING)\n" "{'x': 'MyType'}" msgstr "" +">>> from annotationlib import call_annotate_function, Format\n" +">>> call_annotate_function(Annotate(), format=Format.STRING)\n" +"{'x': 'MyType'}" msgid "Or used as the annotate function for an object:" -msgstr "" +msgstr "یا به‌عنوان تابع حاشیه‌نویسی (annotate) برای یک شیء استفاده شود:" msgid "" ">>> from annotationlib import get_annotations, Format\n" @@ -438,149 +1135,239 @@ msgid "" ">>> get_annotations(Annotate(), format=Format.STRING)\n" "{'x': 'MyType'}" msgstr "" +">>> from annotationlib import get_annotations, Format\n" +">>> class C:\n" +"... pass\n" +">>> C.__annotate__ = Annotate()\n" +">>> get_annotations(Annotate(), format=Format.STRING)\n" +"{'x': 'MyType'}" msgid "Limitations of the ``STRING`` format" -msgstr "" +msgstr "محدودیت‌های قالب ``STRING``" -msgid "The :attr:`~Format.STRING` format is meant to approximate the source code of the annotation, but the implementation strategy used means that it is not always possible to recover the exact source code." +msgid "" +"The :attr:`~Format.STRING` format is meant to approximate the source code of " +"the annotation, but the implementation strategy used means that it is not " +"always possible to recover the exact source code." msgstr "" +"قالب :attr:`~Format.STRING` برای تقریب کد منبع حاشیه‌نویسیدر " +"نظر گرفته شده است، اما راهبرد پیاده‌سازی به‌کاررفته باعث می‌شود که همیشه نتوان " +"کد منبع دقیق را بازیابی کرد." -msgid "First, the stringifier of course cannot recover any information that is not present in the compiled code, including comments, whitespace, parenthesization, and operations that get simplified by the compiler." +msgid "" +"First, the stringifier of course cannot recover any information that is not " +"present in the compiled code, including comments, whitespace, " +"parenthesization, and operations that get simplified by the compiler." msgstr "" +"اول، رشته‌ساز (stringifier) البته نمی‌تواند هیچ‌گونه اطلاعاتی را که در کد " +"کامپایل‌شده وجود ندارد، از جمله کامنت‌ها، فضای سفید، پرانتزگذاری و عملیاتی که " +"توسط کامپایلر ساده‌سازی می‌شوند، بازیابی کند." -msgid "Second, the stringifier can intercept almost all operations that involve names looked up in some scope, but it cannot intercept operations that operate fully on constants. As a corollary, this also means it is not safe to request the ``STRING`` format on untrusted code: Python is powerful enough that it is possible to achieve arbitrary code execution even with no access to any globals or builtins. For example:" -msgstr "" +msgid "" +"Second, the stringifier can intercept almost all operations that involve " +"names looked up in some scope, but it cannot intercept operations that " +"operate fully on constants. As a corollary, this also means it is not safe " +"to request the ``STRING`` format on untrusted code: Python is powerful " +"enough that it is possible to achieve arbitrary code execution even with no " +"access to any globals or builtins. For example:" +msgstr "" +"دوم، رشته‌ساز (stringifier) می‌تواند تقریباً تمام عملیاتی را که شامل نام‌های " +"جستجوشده در محدوده‌ای هستند، رهگیری کند، اما نمی‌تواند عملیاتی را که به‌طور " +"کامل روی ثابت‌ها عمل می‌کنند، رهگیری کند. به‌عنوان یک نتیجه، این همچنین به این " +"معناست که درخواست قالب ``STRING`` برای کد غیرقابل‌اعتماد ایمن نیست: پایتون " +"آن‌قدر قدرتمند است که حتی بدون دسترسی به هیچ‌یک از سراسری‌ها یا توکارها نیز " +"می‌توان به اجرای کد دلخواه دست یافت. برای مثال:" msgid "" -">>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__.__builtins__[\"print\"](\"Hello world\")): pass\n" +">>> def f(x: (1).__class__.__base__.__subclasses__()" +"[-1].__init__.__builtins__[\"print\"](\"Hello world\")): pass\n" "...\n" ">>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING)\n" "Hello world\n" "{'x': 'None'}" msgstr "" +">>> def f(x: (1).__class__.__base__.__subclasses__()" +"[-1].__init__.__builtins__[\"print\"](\"Hello world\")): pass\n" +"...\n" +">>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING)\n" +"Hello world\n" +"{'x': 'None'}" -msgid "This particular example works as of the time of writing, but it relies on implementation details and is not guaranteed to work in the future." +msgid "" +"This particular example works as of the time of writing, but it relies on " +"implementation details and is not guaranteed to work in the future." msgstr "" +"این مثال خاص در زمان نگارش کار می‌کند، اما به جزئیات پیاده‌سازی متکی است و " +"تضمینی برای کار کردن آن در آینده وجود ندارد." -msgid "Among the different kinds of expressions that exist in Python, as represented by the :mod:`ast` module, some expressions are supported, meaning that the ``STRING`` format can generally recover the original source code; others are unsupported, meaning that they may result in incorrect output or an error." +msgid "" +"Among the different kinds of expressions that exist in Python, as " +"represented by the :mod:`ast` module, some expressions are supported, " +"meaning that the ``STRING`` format can generally recover the original source " +"code; others are unsupported, meaning that they may result in incorrect " +"output or an error." msgstr "" +"در میان انواع مختلف عبارت‌هایی که در پایتون وجود دارند و توسط " +"ماژول :mod:`ast` نمایش داده می‌شوند، برخی از عبارت‌ها پشتیبانی می‌شوند، به این " +"معنا که قالب ``STRING`` عموماً می‌تواند کد منبع اصلی را بازیابی کند؛ برخی دیگر " +"پشتیبانی نمی‌شوند، به این معنا که ممکن است به خروجی نادرست یا خطا منجر شوند." msgid "The following are supported (sometimes with caveats):" -msgstr "" +msgstr "موارد زیر پشتیبانی می‌شوند (گاهی با ملاحظات):" msgid ":class:`ast.BinOp`" -msgstr "" +msgstr ":class:`ast.BinOp`" msgid ":class:`ast.UnaryOp`" -msgstr "" +msgstr ":class:`ast.UnaryOp`" -msgid ":class:`ast.Invert` (``~``), :class:`ast.UAdd` (``+``), and :class:`ast.USub` (``-``) are supported" +msgid "" +":class:`ast.Invert` (``~``), :class:`ast.UAdd` (``+``), " +"and :class:`ast.USub` (``-``) are supported" msgstr "" +"از :class:`ast.Invert` (``~``)، :class:`ast.UAdd` (``+``) " +"و :class:`ast.USub` (``-``) پشتیبانی می‌شود" msgid ":class:`ast.Not` (``not``) is not supported" -msgstr "" +msgstr "از :class:`ast.Not` (``not``) پشتیبانی نمی‌شود" msgid ":class:`ast.Dict` (except when using ``**`` unpacking)" -msgstr "" +msgstr ":class:`ast.Dict` (به‌جز هنگام استفاده از واگشایی ``**``)" msgid ":class:`ast.Set`" -msgstr "" +msgstr ":class:`ast.Set`" msgid ":class:`ast.Compare`" -msgstr "" +msgstr ":class:`ast.Compare`" msgid ":class:`ast.Eq` and :class:`ast.NotEq` are supported" -msgstr "" +msgstr "از :class:`ast.Eq` و :class:`ast.NotEq` پشتیبانی می‌شود" -msgid ":class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are supported, but the operand may be flipped" +msgid "" +":class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are " +"supported, but the operand may be flipped" msgstr "" +"از :class:`ast.Lt`، :class:`ast.LtE`، :class:`ast.Gt` و :class:`ast.GtE` " +"پشتیبانی می‌شود، اما ممکن است عملوند جابه‌جا شود" -msgid ":class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` are not supported" +msgid "" +":class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` " +"are not supported" msgstr "" +":class:`ast.Is`، :class:`ast.IsNot`، :class:`ast.In` و :class:`ast.NotIn` " +"پشتیبانی نمی‌شوند" msgid ":class:`ast.Call` (except when using ``**`` unpacking)" -msgstr "" +msgstr ":class:`ast.Call` (مگر هنگام استفاده از واگشایی ``**``)" -msgid ":class:`ast.Constant` (though not the exact representation of the constant; for example, escape sequences in strings are lost; hexadecimal numbers are converted to decimal)" +msgid "" +":class:`ast.Constant` (though not the exact representation of the constant; " +"for example, escape sequences in strings are lost; hexadecimal numbers are " +"converted to decimal)" msgstr "" +":class:`ast.Constant` (البته نه نمایش دقیق ثابت؛ برای مثال، دنباله‌های گریز " +"در رشته‌ها از بین می‌روند؛ اعداد مبنای شانزده به مبنای ده تبدیل می‌شوند)" msgid ":class:`ast.Attribute` (assuming the value is not a constant)" -msgstr "" +msgstr ":class:`ast.Attribute` (با فرض اینکه مقدار ثابت نباشد)" msgid ":class:`ast.Subscript` (assuming the value is not a constant)" -msgstr "" +msgstr ":class:`ast.Subscript` (با فرض اینکه مقدار یک ثابت نباشد)" msgid ":class:`ast.Starred` (``*`` unpacking)" -msgstr "" +msgstr ":class:`ast.Starred` (واگشایی ``*``)" msgid ":class:`ast.Name`" -msgstr "" +msgstr ":class:`ast.Name`" msgid ":class:`ast.List`" -msgstr "" +msgstr ":class:`ast.List`" msgid ":class:`ast.Tuple`" -msgstr "" +msgstr ":class:`ast.Tuple`" msgid ":class:`ast.Slice`" -msgstr "" +msgstr ":class:`ast.Slice`" -msgid "The following are unsupported, but throw an informative error when encountered by the stringifier:" +msgid "" +"The following are unsupported, but throw an informative error when " +"encountered by the stringifier:" msgstr "" +"موارد زیر پشتیبانی نمی‌شوند، اما هنگامی که رشته‌ساز (stringifier) " +"با آن‌ها مواجه شود، خطای گویایی پرتاب می‌کنند:" -msgid ":class:`ast.FormattedValue` (f-strings; error is not detected if conversion specifiers like ``!r`` are used)" +msgid "" +":class:`ast.FormattedValue` (f-strings; error is not detected if conversion " +"specifiers like ``!r`` are used)" msgstr "" +":class:`ast.FormattedValue` (اف‌استرینگ‌ها؛ در صورت استفاده از مشخص‌کننده‌های " +"تبدیل مانند ``!r``، خطا تشخیص داده نمی‌شود)" msgid ":class:`ast.JoinedStr` (f-strings)" -msgstr "" +msgstr ":class:`ast.JoinedStr` (اف‌استرینگ‌ها)" msgid "The following are unsupported and result in incorrect output:" -msgstr "" +msgstr "موارد زیر پشتیبانی نمی‌شوند و منجر به خروجی نادرست می‌شوند:" msgid ":class:`ast.BoolOp` (``and`` and ``or``)" -msgstr "" +msgstr ":class:`ast.BoolOp` (``and`` و ``or``)" msgid ":class:`ast.IfExp`" -msgstr "" +msgstr ":class:`ast.IfExp`" msgid ":class:`ast.Lambda`" -msgstr "" +msgstr ":class:`ast.Lambda`" msgid ":class:`ast.ListComp`" -msgstr "" +msgstr ":class:`ast.ListComp`" msgid ":class:`ast.SetComp`" -msgstr "" +msgstr ":class:`ast.SetComp`" msgid ":class:`ast.DictComp`" -msgstr "" +msgstr ":class:`ast.DictComp`" msgid ":class:`ast.GeneratorExp`" -msgstr "" +msgstr ":class:`ast.GeneratorExp`" -msgid "The following are disallowed in annotation scopes and therefore not relevant:" +msgid "" +"The following are disallowed in annotation scopes and therefore not relevant:" msgstr "" +"موارد زیر در محدوده‌های حاشیه‌نویسی (annotation scopes) مجاز نیستند و بنابراین " +"مرتبط نیستند:" msgid ":class:`ast.NamedExpr` (``:=``)" -msgstr "" +msgstr ":class:`ast.NamedExpr` (``:=``)" msgid ":class:`ast.Await`" -msgstr "" +msgstr ":class:`ast.Await`" msgid ":class:`ast.Yield`" -msgstr "" +msgstr ":class:`ast.Yield`" msgid ":class:`ast.YieldFrom`" -msgstr "" +msgstr ":class:`ast.YieldFrom`" msgid "Limitations of the ``FORWARDREF`` format" -msgstr "" +msgstr "محدودیت‌های قالب ``FORWARDREF``" -msgid "The :attr:`~Format.FORWARDREF` format aims to produce real values as much as possible, with anything that cannot be resolved replaced with :class:`ForwardRef` objects. It is affected by broadly the same Limitations as the :attr:`~Format.STRING` format: annotations that perform operations on literals or that use unsupported expression types may raise exceptions when evaluated using the :attr:`~Format.FORWARDREF` format." -msgstr "" +msgid "" +"The :attr:`~Format.FORWARDREF` format aims to produce real values as much as " +"possible, with anything that cannot be resolved replaced " +"with :class:`ForwardRef` objects. It is affected by broadly the same " +"Limitations as the :attr:`~Format.STRING` format: annotations that perform " +"operations on literals or that use unsupported expression types may raise " +"exceptions when evaluated using the :attr:`~Format.FORWARDREF` format." +msgstr "" +"قالب :attr:`~Format.FORWARDREF` هدف دارد تا حد امکان مقادیر واقعی تولید کند، " +"به‌طوری که هر چیزی که قابل حل نباشد، با اشیای :class:`ForwardRef` جایگزین " +"می‌شود. این قالب تقریباً همان محدودیت‌های قالب :attr:`~Format.STRING` را دارد: " +"یادداشت‌هایی که عملیاتی را روی مقادیر لفظی انجام می‌دهند یا از انواع عبارت " +"پشتیبانی‌نشده استفاده می‌کنند، ممکن است هنگام ارزیابی با " +"قالب :attr:`~Format.FORWARDREF` استثنا پرتاب کنند." msgid "Below are a few examples of the behavior with unsupported expressions:" -msgstr "" +msgstr "در زیر چند مثال از رفتار در مواجهه با عبارت‌های پشتیبانی‌نشده آمده است:" msgid "" ">>> from annotationlib import get_annotations, Format\n" @@ -597,12 +1384,57 @@ msgid "" ">>> get_annotations(ifexp, format=Format.STRING)\n" "{'x': '1'}" msgstr "" +">>> from annotationlib import get_annotations, Format\n" +">>> def zerodiv(x: 1 / 0): ...\n" +">>> get_annotations(zerodiv, format=Format.STRING)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ZeroDivisionError: division by zero\n" +">>> get_annotations(zerodiv, format=Format.FORWARDREF)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ZeroDivisionError: division by zero\n" +">>> def ifexp(x: 1 if y else 0): ...\n" +">>> get_annotations(ifexp, format=Format.STRING)\n" +"{'x': '1'}" msgid "Security implications of introspecting annotations" -msgstr "" +msgstr "پیامدهای امنیتی درون‌نگری حاشیه‌نویسی‌ها " -msgid "Much of the functionality in this module involves executing code related to annotations, which can then do arbitrary things. For example, :func:`get_annotations` may call an arbitrary :term:`annotate function`, and :meth:`ForwardRef.evaluate` may call :func:`eval` on an arbitrary string. Code contained in an annotation might make arbitrary system calls, enter an infinite loop, or perform any other operation. This is also true for any access of the :attr:`~object.__annotations__` attribute, and for various functions in the :mod:`typing` module that work with annotations, such as :func:`typing.get_type_hints`." -msgstr "" +msgid "" +"Much of the functionality in this module involves executing code related to " +"annotations, which can then do arbitrary things. For " +"example, :func:`get_annotations` may call an arbitrary :term:`annotate " +"function`, and :meth:`ForwardRef.evaluate` may call :func:`eval` on an " +"arbitrary string. Code contained in an annotation might make arbitrary " +"system calls, enter an infinite loop, or perform any other operation. This " +"is also true for any access of the :attr:`~object.__annotations__` " +"attribute, and for various functions in the :mod:`typing` module that work " +"with annotations, such as :func:`typing.get_type_hints`." +msgstr "" +"بخش زیادی از قابلیت‌های این ماژول شامل اجرای کد مرتبط با حاشیه‌نویسی‌ها " +" می‌شود؛ کدی که سپس می‌تواند هر کار دلخواهی انجام دهد. برای " +"مثال، :func:`get_annotations` ممکن است یک :term:`annotate function` دلخواه " +"را فراخوانی کند و :meth:`ForwardRef.evaluate` ممکن است :func:`eval` را روی " +"یک رشته دلخواه فراخوانی کند. کد موجود در یک حاشیه‌نویسی ممکن است فراخوانی‌های " +"سیستمی دلخواهی انجام دهد، وارد یک حلقه بی‌پایان شود یا هر عملیات دیگری را " +"انجام دهد. این موضوع برای هرگونه دسترسی به " +"ویژگی :attr:`~object.__annotations__` و برای تابع‌های مختلفی در " +"ماژول :mod:`typing` که با حاشیه‌نویسی‌ها کار می‌کنند، " +"مانند :func:`typing.get_type_hints` نیز صادق است." -msgid "Any security issue arising from this also applies immediately after importing code that may contain untrusted annotations: importing code can always cause arbitrary operations to be performed. However, it is unsafe to accept strings or other input from an untrusted source and pass them to any of the APIs for introspecting annotations, for example by editing an ``__annotations__`` dictionary or directly creating a :class:`ForwardRef` object." -msgstr "" +msgid "" +"Any security issue arising from this also applies immediately after " +"importing code that may contain untrusted annotations: importing code can " +"always cause arbitrary operations to be performed. However, it is unsafe to " +"accept strings or other input from an untrusted source and pass them to any " +"of the APIs for introspecting annotations, for example by editing an " +"``__annotations__`` dictionary or directly creating a :class:`ForwardRef` " +"object." +msgstr "" +"هر مشکل امنیتی ناشی از این موضوع، بلافاصله پس از ایمپورت کدی که ممکن است " +"حاوی انوتیشن‌های غیرقابل‌اعتماد باشد نیز صدق می‌کند: ایمپورت کد همیشه می‌تواند " +"منجر به اجرای عملیات دلخواه شود. با این حال، پذیرفتن رشته‌ها یا سایر ورودی‌ها " +"از یک منبع غیرقابل‌اعتماد و ارسال آن‌ها به هر یک از APIهای مربوط به درون‌نگری " +"انوتیشن‌ها ناامن است، برای مثال با ویرایش یک دیکشنری ``__annotations__`` یا " +"ایجاد مستقیم یک شیء :class:`ForwardRef`." diff --git a/library/archiving.po b/library/archiving.po index ec057bbaf..8c285f9a2 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -22,7 +22,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Data Compression and Archiving" -msgstr "" +msgstr "فشرده‌سازی و بایگانی داده" -msgid "The modules described in this chapter support data compression with the zlib, gzip, bzip2, lzma, and zstd algorithms, and the creation of ZIP- and tar-format archives. See also :ref:`archiving-operations` provided by the :mod:`shutil` module." +msgid "" +"The modules described in this chapter support data compression with the " +"zlib, gzip, bzip2, lzma, and zstd algorithms, and the creation of ZIP- and " +"tar-format archives. See also :ref:`archiving-operations` provided by the " +":mod:`shutil` module." msgstr "" +"ماژول‌های توصیف‌شده در این فصل از فشرده‌سازی داده با الگوریتم‌های zlib، " +"gzip، bzip2، lzma و zstd و همچنین ایجاد بایگانی‌های با قالب ZIP و tar " +"پشتیبانی می‌کنند. همچنین :ref:`archiving-operations` ارائه‌شده توسط ماژول " +":mod:`shutil` را ببینید." diff --git a/library/argparse.po b/library/argparse.po index 269d7ed6f..6710c0912 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"PO-Revision-Date: 2026-08-28 10:14+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,27 +23,57 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!argparse` --- Parser for command-line options, arguments and subcommands" -msgstr "" +msgstr ":mod:`!argparse` --- پارسر برای گزینه‌ها، آرگومان‌ها و زیرفرمان‌های خط فرمان" msgid "**Source code:** :source:`Lib/argparse.py`" -msgstr "" +msgstr ":source:`Lib/argparse.py`" -msgid "While :mod:`!argparse` is the default recommended standard library module for implementing basic command line applications, authors with more exacting requirements for exactly how their command line applications behave may find it doesn't provide the necessary level of control. Refer to :ref:`choosing-an-argument-parser` for alternatives to consider when ``argparse`` doesn't support behaviors that the application requires (such as entirely disabling support for interspersed options and positional arguments, or accepting option parameter values that start with ``-`` even when they correspond to another defined option)." +msgid "" +"While :mod:`!argparse` is the default recommended standard library module for implementing basic command line " +"applications, authors with more exacting requirements for exactly how their command line applications behave may find " +"it doesn't provide the necessary level of control. Refer to :ref:`choosing-an-argument-parser` for alternatives to " +"consider when ``argparse`` doesn't support behaviors that the application requires (such as entirely disabling support " +"for interspersed options and positional arguments, or accepting option parameter values that start with ``-`` even " +"when they correspond to another defined option)." msgstr "" +"در حالی که :mod:`!argparse` به‌طور پیش‌فرض به‌عنوان ماژول کتابخانه استاندارد برای پیاده‌سازی برنامه‌های پایه خط فرمان توصیه " +"می‌شود، نویسندگانی که الزامات دقیق‌تری درباره نحوه دقیق رفتار برنامه‌های خط فرمان خود دارند، ممکن است دریابند که این " +"ماژول سطح کنترل لازم را فراهم نمی‌کند. برای جایگزین‌های قابل بررسی در مواردی که ``argparse`` از رفتارهای مورد نیاز " +"برنامه پشتیبانی نمی‌کند، به :ref:`choosing-an-argument-parser` مراجعه کنید (مانند غیرفعال کردن کامل پشتیبانی از " +"درهم‌آمیختن گزینه‌ها و آرگومان‌های جایگاهی، یا پذیرفتن مقادیر پارامتر گزینه‌ها که با ``-`` شروع می‌شوند، حتی زمانی که با " +"گزینه تعریف‌شده دیگری مطابقت دارند)." msgid "Tutorial" -msgstr "" +msgstr "آموزش" -msgid "This page contains the API reference information. For a more gentle introduction to Python command-line parsing, have a look at the :ref:`argparse tutorial `." +msgid "" +"This page contains the API reference information. For a more gentle introduction to Python command-line parsing, have " +"a look at the :ref:`argparse tutorial `." msgstr "" +"این صفحه حاوی اطلاعات مرجع API است. برای آشنایی ملایم‌تر با تجزیه‌ی خط فرمان در پایتون، به :ref:`آموزش argparse ` نگاهی بیندازید." -msgid "The :mod:`!argparse` module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and :mod:`!argparse` will figure out how to parse those out of :data:`sys.argv`. The :mod:`!argparse` module also automatically generates help and usage messages. The module will also issue errors when users give the program invalid arguments." +msgid "" +"The :mod:`!argparse` module makes it easy to write user-friendly command-line interfaces. The program defines what " +"arguments it requires, and :mod:`!argparse` will figure out how to parse those out of :data:`sys.argv`. The :mod:`!" +"argparse` module also automatically generates help and usage messages. The module will also issue errors when users " +"give the program invalid arguments." msgstr "" +"ماژول :mod:`!argparse` نوشتن رابط‌های خط فرمان کاربرپسند را آسان می‌کند. برنامه آرگومان‌هایی را که نیاز دارد تعریف می‌کند، " +"و :mod:`!argparse` نحوه‌ی تجزیه‌ی آن‌ها از :data:`sys.argv` را تشخیص می‌دهد. ماژول :mod:`!argparse` همچنین به‌طور خودکار " +"پیام‌های راهنما و کاربرد را تولید می‌کند. این ماژول همچنین زمانی که کاربران آرگومان‌های نامعتبر به برنامه بدهند، خطا صادر " +"می‌کند." -msgid "The :mod:`!argparse` module's support for command-line interfaces is built around an instance of :class:`argparse.ArgumentParser`. It is a container for argument specifications and has options that apply to the parser as whole::" +msgid "" +"The :mod:`!argparse` module's support for command-line interfaces is built around an instance " +"of :class:`argparse.ArgumentParser`. It is a container for argument specifications and has options that apply to the " +"parser as whole::" msgstr "" +"پشتیبانی ماژول :mod:`!argparse` از رابط‌های خط فرمان بر پایه‌ی نمونه‌ای از :class:`argparse.ArgumentParser` ساخته شده است. " +"این کلاس محفظه‌ای برای مشخصات آرگومان‌ها است و گزینه‌هایی دارد که به پارسر (parser) به‌عنوان یک کل اعمال می‌شوند::" msgid "" "parser = argparse.ArgumentParser(\n" @@ -51,9 +81,17 @@ msgid "" " description='What the program does',\n" " epilog='Text at the bottom of help')" msgstr "" +"parser = argparse.ArgumentParser(\n" +" prog='ProgramName',\n" +" description='What the program does',\n" +" epilog='Text at the bottom of help')" -msgid "The :meth:`ArgumentParser.add_argument` method attaches individual argument specifications to the parser. It supports positional arguments, options that accept values, and on/off flags::" +msgid "" +"The :meth:`ArgumentParser.add_argument` method attaches individual argument specifications to the parser. It supports " +"positional arguments, options that accept values, and on/off flags::" msgstr "" +"متد :meth:`ArgumentParser.add_argument` مشخصات آرگومان‌ها را به‌صورت جداگانه به پارسر اضافه می‌کند. این متد از آرگومان‌های " +"جایگاهی، گزینه‌هایی که مقدار می‌پذیرند و پرچم‌های روشن/خاموش پشتیبانی می‌کند::" msgid "" "parser.add_argument('filename') # positional argument\n" @@ -61,101 +99,142 @@ msgid "" "parser.add_argument('-v', '--verbose',\n" " action='store_true') # on/off flag" msgstr "" +"parser.add_argument('filename') # آرگومان جایگاهی\n" +"parser.add_argument('-c', '--count') # گزینه‌ای که یک مقدار می‌گیرد\n" +"parser.add_argument('-v', '--verbose',\n" +" action='store_true') # پرچم روشن/خاموش" -msgid "The :meth:`ArgumentParser.parse_args` method runs the parser and places the extracted data in a :class:`argparse.Namespace` object::" +msgid "" +"The :meth:`ArgumentParser.parse_args` method runs the parser and places the extracted data in " +"a :class:`argparse.Namespace` object::" msgstr "" +"متد :meth:`ArgumentParser.parse_args` پارسر (parser) را اجرا می‌کند و داده‌های استخراج‌شده را در یک " +"شیء :class:`argparse.Namespace` قرار می‌دهد::" msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" +"args = parser.parse_args()\n" +"print(args.filename, args.count, args.verbose)" -msgid "If you're looking for a guide about how to upgrade :mod:`optparse` code to :mod:`!argparse`, see :ref:`Upgrading Optparse Code `." +msgid "" +"If you're looking for a guide about how to upgrade :mod:`optparse` code to :mod:`!argparse`, see :ref:`Upgrading " +"Optparse Code `." msgstr "" +"اگر به دنبال راهنمایی درباره چگونگی ارتقای کد :mod:`optparse` به :mod:`!argparse` هستید، :ref:`ارتقای کد Optparse " +"` را ببینید." msgid "ArgumentParser objects" -msgstr "" +msgstr "اشیای ArgumentParser" -msgid "Create a new :class:`ArgumentParser` object. All parameters should be passed as keyword arguments. Each parameter has its own more detailed description below, but in short they are:" +msgid "" +"Create a new :class:`ArgumentParser` object. All parameters should be passed as keyword arguments. Each parameter has " +"its own more detailed description below, but in short they are:" msgstr "" +"یک شیء :class:`ArgumentParser` جدید ایجاد کنید. همه پارامترها باید به‌صورت آرگومان‌های کلیدواژه‌ای ارسال شوند. هر پارامتر " +"توضیح مفصل‌تری در زیر دارد، اما به‌طور خلاصه آن‌ها عبارتند از:" msgid "prog_ - The name of the program (default: generated from the ``__main__`` module attributes and ``sys.argv[0]``)" -msgstr "" +msgstr "prog_ - نام برنامه (پیش‌فرض: از ویژگی‌های ماژول ``__main__`` و ``sys.argv[0]`` تولید می‌شود)" msgid "usage_ - The string describing the program usage (default: generated from arguments added to parser)" -msgstr "" +msgstr "usage_ - رشته‌ای که کاربرد برنامه را توصیف می‌کند (پیش‌فرض: از آرگومان‌های اضافه‌شده به پارسر (parser) تولید می‌شود)" msgid "description_ - Text to display before the argument help (by default, no text)" -msgstr "" +msgstr "description_ - متن برای نمایش پیش از راهنمای آرگومان (به‌طور پیش‌فرض، بدون متن)" msgid "epilog_ - Text to display after the argument help (by default, no text)" -msgstr "" +msgstr "epilog_ - متنی که پس از راهنمای آرگومان نمایش داده می‌شود (به‌طور پیش‌فرض، بدون متن)" msgid "parents_ - A list of :class:`ArgumentParser` objects whose arguments should also be included" -msgstr "" +msgstr "parents_ - فهرستی از اشیای :class:`ArgumentParser` که آرگومان‌های آن‌ها نیز باید گنجانده شوند" msgid "formatter_class_ - A class for customizing the help output" -msgstr "" +msgstr "formatter_class_ - کلاسی برای سفارشی‌سازی خروجی راهنما" msgid "prefix_chars_ - The set of characters that prefix optional arguments (default: '-')" -msgstr "" +msgstr "prefix_chars_ - مجموعه‌ای از نویسه‌ها که پیشوند آرگومان‌های اختیاری را تشکیل می‌دهند (پیش‌فرض: '-')" -msgid "fromfile_prefix_chars_ - The set of characters that prefix files from which additional arguments should be read (default: ``None``)" +msgid "" +"fromfile_prefix_chars_ - The set of characters that prefix files from which additional arguments should be read " +"(default: ``None``)" msgstr "" +"fromfile_prefix_chars_ - مجموعه‌ای از نویسه‌ها که پیشوند فایل‌هایی هستند که آرگومان‌های اضافی باید از آن‌ها خوانده شوند " +"(پیش‌فرض: ``None``)" msgid "argument_default_ - The global default value for arguments (default: ``None``)" -msgstr "" +msgstr "argument_default_ - مقدار پیش‌فرض سراسری برای آرگومان‌ها (پیش‌فرض: ``None``)" msgid "conflict_handler_ - The strategy for resolving conflicting optionals (usually unnecessary)" -msgstr "" +msgstr "conflict_handler_ - راهبرد رفع تعارض گزینه‌های اختیاری (معمولاً غیرضروری)" msgid "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" -msgstr "" +msgstr "add_help_ - افزودن گزینه ``-h/--help`` به پارسر (پیش‌فرض: ``True``)" msgid "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is unambiguous (default: ``True``)" -msgstr "" +msgstr "allow_abbrev_ - اجازه می‌دهد گزینه‌های بلند مخفف شوند، مشروط بر اینکه مخفف بدون ابهام باشد (پیش‌فرض: ``True``)" -msgid "exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits with error info when an error occurs. (default: ``True``)" +msgid "" +"exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits with error info when an error occurs. " +"(default: ``True``)" msgstr "" +"exit_on_error_ - تعیین می‌کند که آیا :class:`!ArgumentParser` هنگام بروز خطا همراه با اطلاعات خطا خارج می‌شود یا خیر. " +"(پیش‌فرض: ``True``)" msgid "suggest_on_error_ - Enables suggestions for mistyped argument choices and subparser names (default: ``False``)" msgstr "" +"suggest_on_error_ - پیشنهادها را برای گزینه‌های آرگومان و نام‌های زیرپارسر (subparser) که اشتباه تایپ‌شده‌اند، فعال " +"می‌کند (پیش‌فرض: ``False``)" msgid "color_ - Allow color output (default: ``True``)" -msgstr "" +msgstr "color_ - اجازه دادن به خروجی رنگی (پیش‌فرض: ``True``)" msgid "*allow_abbrev* parameter was added." -msgstr "" +msgstr "پارامتر *allow_abbrev* افزوده شد." msgid "In previous versions, *allow_abbrev* also disabled grouping of short flags such as ``-vv`` to mean ``-v -v``." -msgstr "" +msgstr "در نسخه‌های پیشین، *allow_abbrev* گروه‌بندی پرچم‌های کوتاه مانند ``-vv`` به معنای ``-v -v`` را نیز غیرفعال می‌کرد." msgid "*exit_on_error* parameter was added." -msgstr "" +msgstr "پارامتر *exit_on_error* اضافه شد." msgid "*suggest_on_error* and *color* parameters were added." -msgstr "" +msgstr "پارامترهای *suggest_on_error* و *color* افزوده شدند." msgid "The following sections describe how each of these are used." -msgstr "" +msgstr "بخش‌های زیر چگونگی استفاده از هر یک از این موارد را شرح می‌دهند." msgid "prog" -msgstr "" +msgstr "prog" -msgid "By default, :class:`ArgumentParser` calculates the name of the program to display in help messages depending on the way the Python interpreter was run:" +msgid "" +"By default, :class:`ArgumentParser` calculates the name of the program to display in help messages depending on the " +"way the Python interpreter was run:" msgstr "" +"به‌طور پیش‌فرض، :class:`ArgumentParser` نام برنامه را برای نمایش در پیام‌های راهنما، بسته به شیوه‌ای که مفسر پایتون اجرا " +"شده است، محاسبه می‌کند:" msgid "The :func:`base name ` of ``sys.argv[0]`` if a file was passed as argument." -msgstr "" +msgstr ":func:`نام پایه ` برای ``sys.argv[0]``، اگر فایلی به‌عنوان آرگومان داده شده باشد." msgid "The Python interpreter name followed by ``sys.argv[0]`` if a directory or a zipfile was passed as argument." msgstr "" +"نام مفسر پایتون که پس از آن ``sys.argv[0]`` می‌آید، در صورتی که یک پوشه یا یک فایل زیپ به‌عنوان آرگومان داده شده باشد." -msgid "The Python interpreter name followed by ``-m`` followed by the module or package name if the :option:`-m` option was used." -msgstr "" +msgid "" +"The Python interpreter name followed by ``-m`` followed by the module or package name if the :option:`-m` option was " +"used." +msgstr "نام مفسر پایتون، به‌دنبالِ ``-m`` و سپس نام ماژول یا بسته، در صورتی که گزینه‌ی :option:`-m` استفاده شده باشد." -msgid "This default is almost always desirable because it will make the help messages match the string that was used to invoke the program on the command line. However, to change this default behavior, another value can be supplied using the ``prog=`` argument to :class:`ArgumentParser`::" +msgid "" +"This default is almost always desirable because it will make the help messages match the string that was used to " +"invoke the program on the command line. However, to change this default behavior, another value can be supplied using " +"the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" +"این پیش‌فرض تقریباً همیشه مطلوب است، زیرا باعث می‌شود پیام‌های راهنما با رشته‌ای که برنامه با آن در خط فرمان فراخوانی شده " +"است مطابقت داشته باشند. با این حال، برای تغییر این رفتار پیش‌فرض، می‌توان مقدار دیگری را با استفاده از آرگومان ``prog=`` " +"برای :class:`ArgumentParser`:: ارائه کرد:" msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" @@ -165,9 +244,19 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" -msgid "Note that the program name, whether determined from ``sys.argv[0]``, from the ``__main__`` module attributes or from the ``prog=`` argument, is available to help messages using the ``%(prog)s`` format specifier." +msgid "" +"Note that the program name, whether determined from ``sys.argv[0]``, from the ``__main__`` module attributes or from " +"the ``prog=`` argument, is available to help messages using the ``%(prog)s`` format specifier." msgstr "" +"توجه داشته باشید که نام برنامه، چه از ``sys.argv[0]``، چه از ویژگی‌های ماژول ``__main__`` و چه از آرگومان ``prog=`` " +"تعیین شده باشد، در پیام‌های راهنما از طریق مشخص‌کننده‌ی قالب ``%(prog)s`` در دسترس است." msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" @@ -179,15 +268,31 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" msgstr "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo of the myprogram program" -msgid "The default ``prog`` value now reflects how ``__main__`` was actually executed, rather than always being ``os.path.basename(sys.argv[0])``." +msgid "" +"The default ``prog`` value now reflects how ``__main__`` was actually executed, rather than always being " +"``os.path.basename(sys.argv[0])``." msgstr "" +"مقدار پیش‌فرض ``prog`` اکنون نشان می‌دهد که ``__main__`` واقعاً چگونه اجرا شده است، به‌جای آنکه همیشه " +"``os.path.basename(sys.argv[0])`` باشد." msgid "usage" -msgstr "" +msgstr "استفاده" -msgid "By default, :class:`ArgumentParser` calculates the usage message from the arguments it contains. The default message can be overridden with the ``usage=`` keyword argument::" +msgid "" +"By default, :class:`ArgumentParser` calculates the usage message from the arguments it contains. The default message " +"can be overridden with the ``usage=`` keyword argument::" msgstr "" +"به‌طور پیش‌فرض، :class:`ArgumentParser` پیام استفاده را بر اساس آرگومان‌های خود محاسبه می‌کند. پیام پیش‌فرض را می‌توان با " +"آرگومان کلیدواژه‌ای ``usage=`` بازنویسی کرد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s [options]')\n" @@ -203,27 +308,60 @@ msgid "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s [options]')\n" +">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [options]\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo [FOO] foo help" msgid "The ``%(prog)s`` format specifier is available to fill in the program name in your usage messages." -msgstr "" +msgstr "مشخص‌کننده قالب ``%(prog)s`` برای جایگذاری نام برنامه در پیام‌های کاربرد شما در دسترس است." -msgid "When a custom usage message is specified for the main parser, you may also want to consider passing the ``prog`` argument to :meth:`~ArgumentParser.add_subparsers` or the ``prog`` and the ``usage`` arguments to :meth:`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and usage information across subparsers." +msgid "" +"When a custom usage message is specified for the main parser, you may also want to consider passing the ``prog`` " +"argument to :meth:`~ArgumentParser.add_subparsers` or the ``prog`` and the ``usage`` arguments " +"to :meth:`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and usage information across " +"subparsers." msgstr "" +"هنگامی که پیام کاربرد سفارشی برای پارسر اصلی تعیین می‌شود، ممکن است بخواهید برای اطمینان از سازگاری پیشوندهای فرمان و " +"اطلاعات کاربرد در میان پارسرهای فرعی، ارسال آرگومان ``prog`` به :meth:`~ArgumentParser.add_subparsers` یا آرگومان‌های " +"``prog`` و ``usage`` به :meth:`~_SubParsersAction.add_parser` را نیز در نظر بگیرید." msgid "description" -msgstr "" +msgstr "توضیحات" -msgid "Most calls to the :class:`ArgumentParser` constructor will use the ``description=`` keyword argument. This argument gives a brief description of what the program does and how it works. In help messages, the description is displayed between the command-line usage string and the help messages for the various arguments." +msgid "" +"Most calls to the :class:`ArgumentParser` constructor will use the ``description=`` keyword argument. This argument " +"gives a brief description of what the program does and how it works. In help messages, the description is displayed " +"between the command-line usage string and the help messages for the various arguments." msgstr "" +"در بیشتر فراخوانی‌های سازنده‌ی :class:`ArgumentParser`، از آرگومان کلیدواژه‌ای ``description=`` استفاده می‌شود. این " +"آرگومان شرح مختصری از آنچه برنامه انجام می‌دهد و چگونگی کار آن ارائه می‌دهد. در پیام‌های راهنما، شرح بین رشته‌ی کاربرد خط " +"فرمان و پیام‌های راهنمای آرگومان‌های مختلف نمایش داده می‌شود." -msgid "By default, the description will be line-wrapped so that it fits within the given space. To change this behavior, see the formatter_class_ argument." +msgid "" +"By default, the description will be line-wrapped so that it fits within the given space. To change this behavior, see " +"the formatter_class_ argument." msgstr "" +"به‌طور پیش‌فرض، خطوط شرح شکسته می‌شوند تا در فضای داده‌شده بگنجند. برای تغییر این رفتار، آرگومان formatter_class_ را " +"ببینید." msgid "epilog" -msgstr "" +msgstr "epilog" -msgid "Some programs like to display additional description of the program after the description of the arguments. Such text can be specified using the ``epilog=`` argument to :class:`ArgumentParser`::" +msgid "" +"Some programs like to display additional description of the program after the description of the arguments. Such text " +"can be specified using the ``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" +"برخی برنامه‌ها تمایل دارند توضیحات تکمیلی برنامه را پس از توضیح آرگومان‌ها نمایش دهند. چنین متنی را می‌توان با استفاده از " +"آرگومان ``epilog=`` برای :class:`ArgumentParser` مشخص کرد::" msgid "" ">>> parser = argparse.ArgumentParser(\n" @@ -239,15 +377,39 @@ msgid "" "\n" "And that's how you'd foo a bar" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... description='A foo that bars',\n" +"... epilog=\"And that's how you'd foo a bar\")\n" +">>> parser.print_help()\n" +"usage: argparse.py [-h]\n" +"\n" +"A foo that bars\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"And that's how you'd foo a bar" -msgid "As with the description_ argument, the ``epilog=`` text is by default line-wrapped, but this behavior can be adjusted with the formatter_class_ argument to :class:`ArgumentParser`." +msgid "" +"As with the description_ argument, the ``epilog=`` text is by default line-wrapped, but this behavior can be adjusted " +"with the formatter_class_ argument to :class:`ArgumentParser`." msgstr "" +"همانند آرگومان description_، متن ``epilog=`` به‌طور پیش‌فرض در عرض خط شکسته می‌شود، اما این رفتار را می‌توان با آرگومان " +"formatter_class_ برای :class:`ArgumentParser` تنظیم کرد." msgid "parents" -msgstr "" +msgstr "والدین" -msgid "Sometimes, several parsers share a common set of arguments. Rather than repeating the definitions of these arguments, a single parser with all the shared arguments and passed to ``parents=`` argument to :class:`ArgumentParser` can be used. The ``parents=`` argument takes a list of :class:`ArgumentParser` objects, collects all the positional and optional actions from them, and adds these actions to the :class:`ArgumentParser` object being constructed::" +msgid "" +"Sometimes, several parsers share a common set of arguments. Rather than repeating the definitions of these arguments, " +"a single parser with all the shared arguments and passed to ``parents=`` argument to :class:`ArgumentParser` can be " +"used. The ``parents=`` argument takes a list of :class:`ArgumentParser` objects, collects all the positional and " +"optional actions from them, and adds these actions to the :class:`ArgumentParser` object being constructed::" msgstr "" +"گاهی چند پارسر (parser) مجموعه‌ای مشترک از آرگومان‌ها دارند. به‌جای تکرار تعاریف این آرگومان‌ها، می‌توان از یک پارسر واحد " +"استفاده کرد که همه‌ی آرگومان‌های مشترک را دارد و به‌عنوان مقدار آرگومان ``parents=`` به :class:`ArgumentParser` ارسال " +"می‌شود. آرگومان ``parents=`` فهرستی از اشیاء :class:`ArgumentParser` را می‌پذیرد، همه‌ی کنش‌های جایگاهی و اختیاری " +"(actions) را از آن‌ها جمع‌آوری می‌کند و این کنش‌ها را به شیء :class:`ArgumentParser` که در حال ساخت است اضافه می‌کند::" msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" @@ -263,21 +425,51 @@ msgid "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" msgstr "" +">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" +">>> parent_parser.add_argument('--parent', type=int)\n" +"\n" +">>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> foo_parser.add_argument('foo')\n" +">>> foo_parser.parse_args(['--parent', '2', 'XXX'])\n" +"Namespace(foo='XXX', parent=2)\n" +"\n" +">>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> bar_parser.add_argument('--bar')\n" +">>> bar_parser.parse_args(['--bar', 'YYY'])\n" +"Namespace(bar='YYY', parent=None)" -msgid "Note that most parent parsers will specify ``add_help=False``. Otherwise, the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent and one in the child) and raise an error." +msgid "" +"Note that most parent parsers will specify ``add_help=False``. Otherwise, the :class:`ArgumentParser` will see two ``-" +"h/--help`` options (one in the parent and one in the child) and raise an error." msgstr "" +"توجه داشته باشید که بیشتر پارسرهای والد ``add_help=False`` را تعیین می‌کنند. در غیر این صورت، :class:`ArgumentParser` " +"دو گزینه ``-h/--help`` (یکی در والد و دیگری در فرزند) را می‌بیند و خطایی پرتاب می‌کند." -msgid "You must fully initialize the parsers before passing them via ``parents=``. If you change the parent parsers after the child parser, those changes will not be reflected in the child." +msgid "" +"You must fully initialize the parsers before passing them via ``parents=``. If you change the parent parsers after the " +"child parser, those changes will not be reflected in the child." msgstr "" +"شما باید پارسرها را پیش از انتقال آن‌ها از طریق ``parents=`` به‌طور کامل مقداردهی اولیه کنید. اگر پارسرهای والد را " +"پس از پارسر فرزند تغییر دهید، آن تغییرات در فرزند بازتاب نخواهند یافت." msgid "formatter_class" -msgstr "" +msgstr "formatter_class" -msgid ":class:`ArgumentParser` objects allow the help formatting to be customized by specifying an alternate formatting class. Currently, there are four such classes:" +msgid "" +":class:`ArgumentParser` objects allow the help formatting to be customized by specifying an alternate formatting " +"class. Currently, there are four such classes:" msgstr "" +"اشیای :class:`ArgumentParser` امکان سفارشی‌سازی قالب‌بندی راهنما را با مشخص کردن یک کلاس قالب‌بندی جایگزین فراهم می‌کنند. " +"در حال حاضر، چهار کلاس از این دست وجود دارد:" -msgid ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give more control over how textual descriptions are displayed. By default, :class:`ArgumentParser` objects line-wrap the description_ and epilog_ texts in command-line help messages::" +msgid "" +":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give more control over how textual descriptions " +"are displayed. By default, :class:`ArgumentParser` objects line-wrap the description_ and epilog_ texts in command-" +"line help messages::" msgstr "" +":class:`RawDescriptionHelpFormatter` و :class:`RawTextHelpFormatter` کنترل بیشتری بر چگونگی نمایش توضیحات متنی فراهم " +"می‌کنند. به‌طور پیش‌فرض، اشیاء :class:`ArgumentParser` متن‌های description_ و epilog_ را در پیام‌های راهنمای خط فرمان با " +"شکستن خطوط قالب‌بندی می‌کنند::" msgid "" ">>> parser = argparse.ArgumentParser(\n" @@ -300,9 +492,32 @@ msgid "" "likewise for this epilog whose whitespace will be cleaned up and whose words\n" "will be wrapped across a couple lines" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... description='''this description\n" +"... was indented weird\n" +"... but that is okay''',\n" +"... epilog='''\n" +"... likewise for this epilog whose whitespace will\n" +"... be cleaned up and whose words will be wrapped\n" +"... across a couple lines''')\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"this description was indented weird but that is okay\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"likewise for this epilog whose whitespace will be cleaned up and whose words\n" +"will be wrapped across a couple lines" -msgid "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` indicates that description_ and epilog_ are already correctly formatted and should not be line-wrapped::" +msgid "" +"Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` indicates that description_ and epilog_ are " +"already correctly formatted and should not be line-wrapped::" msgstr "" +"ارسال :class:`RawDescriptionHelpFormatter` به‌عنوان ``formatter_class=`` نشان می‌دهد که description_ و epilog_ از قبل " +"به‌درستی قالب‌بندی شده‌اند و نباید خطوط آن‌ها شکسته شوند::" msgid "" ">>> parser = argparse.ArgumentParser(\n" @@ -327,12 +542,42 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description=textwrap.dedent('''\\\n" +"... Please do not mess up this text!\n" +"... --------------------------------\n" +"... I have indented it\n" +"... exactly the way\n" +"... I want it\n" +"... '''))\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"Please do not mess up this text!\n" +"--------------------------------\n" +" I have indented it\n" +" exactly the way\n" +" I want it\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" -msgid ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text, including argument descriptions. However, multiple newlines are replaced with one. If you wish to preserve multiple blank lines, add spaces between the newlines." +msgid "" +":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help text, including argument descriptions. " +"However, multiple newlines are replaced with one. If you wish to preserve multiple blank lines, add spaces between the " +"newlines." msgstr "" +":class:`RawTextHelpFormatter` فضای سفید را برای همه‌ی انواع متن‌های راهنما، از جمله توضیحات آرگومان‌ها حفظ می‌کند. با این " +"حال، چندین خط جدید با یک خط جدید جایگزین می‌شوند. اگر می‌خواهید چندین خط خالی حفظ شوند، بین خط‌های جدید فاصله اضافه کنید." -msgid ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about default values to each of the argument help messages::" +msgid "" +":class:`ArgumentDefaultsHelpFormatter` automatically adds information about default values to each of the argument " +"help messages::" msgstr "" +":class:`ArgumentDefaultsHelpFormatter` به‌طور خودکار اطلاعات مربوط به مقادیر پیش‌فرض را به هر یک از پیام‌های راهنمای " +"آرگومان اضافه می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser(\n" @@ -350,9 +595,27 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int, default=42, help='FOO!')\n" +">>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo FOO] [bar ...]\n" +"\n" +"positional arguments:\n" +" bar BAR! (default: [1, 2, 3])\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO FOO! (default: 42)" -msgid ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for each argument as the display name for its values (rather than using the dest_ as the regular formatter does)::" +msgid "" +":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for each argument as the display name for its " +"values (rather than using the dest_ as the regular formatter does)::" msgstr "" +":class:`MetavarTypeHelpFormatter` از نام آرگومان type_ برای هر آرگومان به‌عنوان نام نمایشی برای مقدارهای آن استفاده " +"می‌کند (به‌جای استفاده از dest_ آن‌گونه که قالب‌بند معمولی انجام می‌دهد)::" msgid "" ">>> parser = argparse.ArgumentParser(\n" @@ -370,12 +633,32 @@ msgid "" " -h, --help show this help message and exit\n" " --foo int" msgstr "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.MetavarTypeHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', type=float)\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo int] float\n" +"\n" +"positional arguments:\n" +" float\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo int" msgid "prefix_chars" -msgstr "" +msgstr "prefix_chars" -msgid "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. Parsers that need to support different or additional prefix characters, e.g. for options like ``+f`` or ``/foo``, may specify them using the ``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" +msgid "" +"Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. Parsers that need to support different or " +"additional prefix characters, e.g. for options like ``+f`` or ``/foo``, may specify them using the ``prefix_chars=`` " +"argument to the :class:`ArgumentParser` constructor::" msgstr "" +"بیشتر گزینه‌های خط فرمان از ``-`` به‌عنوان پیشوند استفاده می‌کنند، برای مثال ``-f/--foo``. پارسرهایی که نیاز به " +"پشتیبانی از نویسه‌های پیشوند متفاوت یا اضافی دارند، برای مثال برای گزینه‌هایی مانند ``+f`` یا ``/foo``، می‌توانند آن‌ها را " +"با استفاده از آرگومان ``prefix_chars=`` در سازنده‌ی :class:`ArgumentParser` مشخص کنند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" @@ -384,15 +667,32 @@ msgid "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" +">>> parser.add_argument('+f')\n" +">>> parser.add_argument('++bar')\n" +">>> parser.parse_args('+f X ++bar Y'.split())\n" +"Namespace(bar='Y', f='X')" -msgid "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of characters that does not include ``-`` will cause ``-f/--foo`` options to be disallowed." +msgid "" +"The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of characters that does not include ``-`` will " +"cause ``-f/--foo`` options to be disallowed." msgstr "" +"مقدار پیش‌فرض آرگومان ``prefix_chars=`` برابر ``'-'`` است. ارائه مجموعه‌ای از نویسه‌ها که شامل ``-`` نباشد، باعث غیرمجاز " +"شدن گزینه‌های ``-f/--foo`` می‌شود." msgid "fromfile_prefix_chars" -msgstr "" +msgstr "fromfile_prefix_chars" -msgid "Sometimes, when dealing with a particularly long argument list, it may make sense to keep the list of arguments in a file rather than typing it out at the command line. If the ``fromfile_prefix_chars=`` argument is given to the :class:`ArgumentParser` constructor, then arguments that start with any of the specified characters will be treated as files, and will be replaced by the arguments they contain. For example::" +msgid "" +"Sometimes, when dealing with a particularly long argument list, it may make sense to keep the list of arguments in a " +"file rather than typing it out at the command line. If the ``fromfile_prefix_chars=`` argument is given to " +"the :class:`ArgumentParser` constructor, then arguments that start with any of the specified characters will be " +"treated as files, and will be replaced by the arguments they contain. For example::" msgstr "" +"گاهی، هنگام کار با یک فهرست آرگومان بسیار طولانی، ممکن است منطقی باشد که فهرست آرگومان‌ها را در یک فایل نگه دارید، " +"به‌جای آن‌که آن را در خط فرمان تایپ کنید. اگر آرگومان ``fromfile_prefix_chars=`` به سازنده‌ی :class:`ArgumentParser` داده " +"شود، آرگومان‌هایی که با هر یک از نویسه‌های مشخص‌شده آغاز می‌شوند، به‌عنوان فایل در نظر گرفته می‌شوند و با آرگومان‌هایی که در " +"بر دارند جایگزین می‌شوند. برای مثال::" msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" @@ -403,27 +703,66 @@ msgid "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" msgstr "" +">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" +"... fp.write('-f\\nbar')\n" +"...\n" +">>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')\n" +">>> parser.add_argument('-f')\n" +">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" +"Namespace(f='bar')" -msgid "Arguments read from a file must be one per line by default (but see also :meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they were in the same place as the original file referencing argument on the command line. So in the example above, the expression ``['-f', 'foo', '@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``." +msgid "" +"Arguments read from a file must be one per line by default (but see " +"also :meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they were in the same place as the " +"original file referencing argument on the command line. So in the example above, the expression ``['-f', 'foo', " +"'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``." msgstr "" +"آرگومان‌های خوانده‌شده از یک فایل باید به‌طور پیش‌فرض یکی در هر خط باشند " +"(اما :meth:`~ArgumentParser.convert_arg_line_to_args` را نیز ببینید) و طوری با آن‌ها رفتار می‌شود که گویی در همان جایگاه " +"آرگومان اصلی ارجاع‌دهنده به فایل در خط فرمان قرار دارند. بنابراین در مثال بالا، عبارت ``['-f', 'foo', '@args.txt']`` " +"معادل عبارت ``['-f', 'foo', '-f', 'bar']`` در نظر گرفته می‌شود." msgid "Each line is treated as a single argument, so an empty line is read as an empty string (``''``)." msgstr "" +"هر خط به‌عنوان یک آرگومان واحد در نظر گرفته می‌شود، بنابراین یک خط خالی به‌عنوان یک رشته خالی (``''``) خوانده می‌شود." msgid ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` to read the file containing arguments." msgstr "" +":class:`ArgumentParser` از :term:`filesystem encoding and error handler` برای خواندن فایل حاوی آرگومان‌ها استفاده می‌کند." -msgid "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that arguments will never be treated as file references." +msgid "" +"The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that arguments will never be treated as file " +"references." msgstr "" +"مقدار پیش‌فرض آرگومان ``fromfile_prefix_chars=`` برابر ``None`` است، به این معنا که آرگومان‌ها هرگز به‌عنوان ارجاع به " +"فایل در نظر گرفته نمی‌شوند." -msgid ":class:`ArgumentParser` changed encoding and errors to read arguments files from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to the :term:`filesystem encoding and error handler`. Arguments file should be encoded in UTF-8 instead of ANSI Codepage on Windows." +msgid "" +":class:`ArgumentParser` changed encoding and errors to read arguments files from default " +"(e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to " +"the :term:`filesystem encoding and error handler`. Arguments file should be encoded in UTF-8 instead of ANSI Codepage " +"on Windows." msgstr "" +":class:`ArgumentParser` کدگذاری و خطاها را برای خواندن فایل‌های آرگومان از پیش‌فرض (برای " +"مثال :func:`locale.getpreferredencoding(False) ` و ``\"strict\"``) به :term:`کدگذاری و " +"هندلر خطای فایل‌سیستم ` تغییر داد. فایل آرگومان‌ها باید در ویندوز به‌جای ANSI " +"Codepage با UTF-8 کدگذاری شود." msgid "argument_default" -msgstr "" +msgstr "argument_default" -msgid "Generally, argument defaults are specified either by passing a default to :meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser.set_defaults` methods with a specific set of name-value pairs. Sometimes however, it may be useful to specify a single parser-wide default for arguments. This can be accomplished by passing the ``argument_default=`` keyword argument to :class:`ArgumentParser`. For example, to globally suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we supply ``argument_default=SUPPRESS``::" +msgid "" +"Generally, argument defaults are specified either by passing a default to :meth:`~ArgumentParser.add_argument` or by " +"calling the :meth:`~ArgumentParser.set_defaults` methods with a specific set of name-value pairs. Sometimes however, " +"it may be useful to specify a single parser-wide default for arguments. This can be accomplished by passing the " +"``argument_default=`` keyword argument to :class:`ArgumentParser`. For example, to globally suppress attribute " +"creation on :meth:`~ArgumentParser.parse_args` calls, we supply ``argument_default=SUPPRESS``::" msgstr "" +"به‌طور معمول، مقادیر پیش‌فرض آرگومان‌ها یا با ارسال یک مقدار پیش‌فرض به :meth:`~ArgumentParser.add_argument` یا با " +"فراخوانی متد :meth:`~ArgumentParser.set_defaults` با مجموعه‌ای مشخص از جفت‌های نام-مقدار مشخص می‌شوند. با این حال، گاهی " +"ممکن است مشخص کردن یک پیش‌فرض واحد در سطح پارسر برای آرگومان‌ها مفید باشد. این کار را می‌توان با ارسال آرگومان کلیدواژه‌ای " +"``argument_default=`` به :class:`ArgumentParser` انجام داد. برای مثال، برای جلوگیری به‌صورت سراسری از ایجاد ویژگی در " +"فراخوانی‌های :meth:`~ArgumentParser.parse_args`، ``argument_default=SUPPRESS`` را قرار می‌دهیم::" msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" @@ -434,15 +773,26 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace()" msgstr "" +">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar', nargs='?')\n" +">>> parser.parse_args(['--foo', '1', 'BAR'])\n" +"Namespace(bar='BAR', foo='1')\n" +">>> parser.parse_args([])\n" +"Namespace()" msgid "allow_abbrev" -msgstr "" +msgstr "allow_abbrev" -msgid "Normally, when you pass an argument list to the :meth:`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes abbreviations ` of long options." +msgid "" +"Normally, when you pass an argument list to the :meth:`~ArgumentParser.parse_args` method of " +"an :class:`ArgumentParser`, it :ref:`recognizes abbreviations ` of long options." msgstr "" +"به‌طور معمول، هنگامی که یک فهرست آرگومان را به متد :meth:`~ArgumentParser.parse_args` از یک :class:`ArgumentParser` " +"ارسال می‌کنید، این متد برای گزینه‌های بلند :ref:`مخفف‌ها را می‌شناسد `." msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" -msgstr "" +msgstr "این قابلیت را می‌توان با تنظیم ``allow_abbrev`` روی ``False`` غیرفعال کرد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" @@ -452,12 +802,24 @@ msgid "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" +">>> parser.add_argument('--foobar', action='store_true')\n" +">>> parser.add_argument('--foonley', action='store_false')\n" +">>> parser.parse_args(['--foon'])\n" +"usage: PROG [-h] [--foobar] [--foonley]\n" +"PROG: error: unrecognized arguments: --foon" msgid "conflict_handler" -msgstr "" +msgstr "conflict_handler" -msgid ":class:`ArgumentParser` objects do not allow two actions with the same option string. By default, :class:`ArgumentParser` objects raise an exception if an attempt is made to create an argument with an option string that is already in use::" +msgid "" +":class:`ArgumentParser` objects do not allow two actions with the same option string. By " +"default, :class:`ArgumentParser` objects raise an exception if an attempt is made to create an argument with an option " +"string that is already in use::" msgstr "" +"اشیاء :class:`ArgumentParser` اجازه نمی‌دهند دو عملیاتبا رشته‌ی گزینه یکسان وجود داشته باشند. به‌طور پیش‌فرض، " +"اشیاء :class:`ArgumentParser` در صورتی که تلاشی برای ایجاد آرگومانی با رشته‌ی گزینه‌ای که از قبل در حال استفاده است " +"انجام شود، استثنایی پرتاب می‌کنند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -467,9 +829,21 @@ msgid "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +"Traceback (most recent call last):\n" +" ..\n" +"ArgumentError: argument --foo: conflicting option string(s): --foo" -msgid "Sometimes (e.g. when using parents_) it may be useful to simply override any older arguments with the same option string. To get this behavior, the value ``'resolve'`` can be supplied to the ``conflict_handler=`` argument of :class:`ArgumentParser`::" +msgid "" +"Sometimes (e.g. when using parents_) it may be useful to simply override any older arguments with the same option " +"string. To get this behavior, the value ``'resolve'`` can be supplied to the ``conflict_handler=`` argument " +"of :class:`ArgumentParser`::" msgstr "" +"گاهی (مثلاً هنگام استفاده از parents_) ممکن است مفید باشد که هر آرگومان قدیمی‌تری با همان رشته‌ی گزینه به‌سادگی بازنویسی " +"شود. برای دستیابی به این رفتار، می‌توان مقدار ``'resolve'`` را به آرگومان ``conflict_handler=`` " +"در :class:`ArgumentParser` داد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', conflict_handler='resolve')\n" @@ -483,18 +857,42 @@ msgid "" " -f FOO old foo help\n" " --foo FOO new foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', conflict_handler='resolve')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-f FOO] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -f FOO old foo help\n" +" --foo FOO new foo help" -msgid "Note that :class:`ArgumentParser` objects only remove an action if all of its option strings are overridden. So, in the example above, the old ``-f/--foo`` action is retained as the ``-f`` action, because only the ``--foo`` option string was overridden." +msgid "" +"Note that :class:`ArgumentParser` objects only remove an action if all of its option strings are overridden. So, in " +"the example above, the old ``-f/--foo`` action is retained as the ``-f`` action, because only the ``--foo`` option " +"string was overridden." msgstr "" +"توجه داشته باشید که اشیاء :class:`ArgumentParser` یک اکشنرا فقط در صورتی حذف می‌کنند که همه رشته‌های گزینه " +"(option strings) آن بازنویسی‌شده باشند. بنابراین، در مثال بالا، اکشن قدیمی ``-f/--foo`` به‌عنوان اکشن ``-f`` حفظ می‌شود، " +"زیرا فقط رشته گزینه ``--foo`` بازنویسی‌شده است." msgid "add_help" -msgstr "" +msgstr "add_help" -msgid "By default, :class:`ArgumentParser` objects add an option which simply displays the parser's help message. If ``-h`` or ``--help`` is supplied at the command line, the :class:`!ArgumentParser` help will be printed." +msgid "" +"By default, :class:`ArgumentParser` objects add an option which simply displays the parser's help message. If ``-h`` " +"or ``--help`` is supplied at the command line, the :class:`!ArgumentParser` help will be printed." msgstr "" +"به‌طور پیش‌فرض، اشیای :class:`ArgumentParser` گزینه‌ای اضافه می‌کنند که صرفاً پیام راهنمای پارسر را نمایش می‌دهد. اگر ``-" +"h`` یا ``--help`` در خط فرمان ارائه شود، راهنمای :class:`!ArgumentParser` چاپ خواهد شد." -msgid "Occasionally, it may be useful to disable the addition of this help option. This can be achieved by passing ``False`` as the ``add_help=`` argument to :class:`ArgumentParser`::" +msgid "" +"Occasionally, it may be useful to disable the addition of this help option. This can be achieved by passing ``False`` " +"as the ``add_help=`` argument to :class:`ArgumentParser`::" msgstr "" +"گاهی اوقات، ممکن است غیرفعال کردن افزودن این گزینه راهنما مفید باشد. این کار را می‌توان با ارسال ``False`` به‌عنوان " +"آرگومان ``add_help=`` به :class:`ArgumentParser` انجام داد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" @@ -505,9 +903,22 @@ msgid "" "options:\n" " --foo FOO foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> parser.add_argument('--foo', help='foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO]\n" +"\n" +"options:\n" +" --foo FOO foo help" -msgid "The help option is typically ``-h/--help``. The exception to this is if the ``prefix_chars=`` is specified and does not include ``-``, in which case ``-h`` and ``--help`` are not valid options. In this case, the first character in ``prefix_chars`` is used to prefix the help options::" +msgid "" +"The help option is typically ``-h/--help``. The exception to this is if the ``prefix_chars=`` is specified and does " +"not include ``-``, in which case ``-h`` and ``--help`` are not valid options. In this case, the first character in " +"``prefix_chars`` is used to prefix the help options::" msgstr "" +"گزینه راهنما معمولاً ``-h/--help`` است. استثنای این حالت زمانی است که ``prefix_chars=`` مشخص شده باشد و شامل ``-`` " +"نباشد، که در این صورت ``-h`` و ``--help`` گزینه‌های معتبری نیستند. در این حالت، از اولین نویسه‌ی ``prefix_chars`` برای " +"پیشوندگذاری گزینه‌های راهنما استفاده می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" @@ -517,20 +928,33 @@ msgid "" "options:\n" " +h, ++help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" +">>> parser.print_help()\n" +"usage: PROG [+h]\n" +"\n" +"options:\n" +" +h, ++help show this help message and exit" + +msgid "exit_on_error" +msgstr "exit_on_error" -msgid "exit_on_error" -msgstr "" - -msgid "Normally, when you pass an invalid argument list to the :meth:`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will print a *message* to :data:`sys.stderr` and exit with a status code of 2." +msgid "" +"Normally, when you pass an invalid argument list to the :meth:`~ArgumentParser.parse_args` method of " +"an :class:`ArgumentParser`, it will print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" +"به‌طور معمول، هنگامی که یک فهرست آرگومان‌های نامعتبر را به متد :meth:`~ArgumentParser.parse_args` از " +"یک :class:`ArgumentParser` ارسال می‌کنید، *پیامی* را در :data:`sys.stderr` چاپ می‌کند و با کد وضعیت ۲ خارج می‌شود." -msgid "If the user would like to catch errors manually, the feature can be enabled by setting ``exit_on_error`` to ``False``::" +msgid "" +"If the user would like to catch errors manually, the feature can be enabled by setting ``exit_on_error`` to ``False``::" msgstr "" +"اگر کاربر بخواهد خطاها را به‌صورت دستی بگیرد، می‌توان این قابلیت را با تنظیم ``exit_on_error`` روی ``False`` فعال کرد::" msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" -"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, const=None, default=None, type=, choices=None, help=None, metavar=None)\n" +"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, const=None, default=None, type=, " +"choices=None, help=None, metavar=None)\n" ">>> try:\n" "... parser.parse_args('--integers a'.split())\n" "... except argparse.ArgumentError:\n" @@ -538,15 +962,36 @@ msgid "" "...\n" "Catching an argumentError" msgstr "" +">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" +">>> parser.add_argument('--integers', type=int)\n" +"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, const=None, default=None, type=, " +"choices=None, help=None, metavar=None)\n" +">>> try:\n" +"... parser.parse_args('--integers a'.split())\n" +"... except argparse.ArgumentError:\n" +"... print('Catching an argumentError')\n" +"...\n" +"Catching an argumentError" msgid "suggest_on_error" -msgstr "" +msgstr "suggest_on_error" -msgid "By default, when a user passes an invalid argument choice or subparser name, :class:`ArgumentParser` will exit with error info and list the permissible argument choices (if specified) or subparser names as part of the error message." +msgid "" +"By default, when a user passes an invalid argument choice or subparser name, :class:`ArgumentParser` will exit with " +"error info and list the permissible argument choices (if specified) or subparser names as part of the error message." msgstr "" +"به‌طور پیش‌فرض، هنگامی که کاربر یک انتخاب نامعتبر برای آرگومان یا یک نام زیرپارسر (subparser) ارائه " +"می‌دهد، :class:`ArgumentParser` با اطلاعات خطا خارج می‌شود و انتخاب‌های مجاز آرگومان (در صورت مشخص بودن) یا نام‌های " +"زیرپارسر را به‌عنوان بخشی از پیام خطا فهرست می‌کند." -msgid "If the user would like to enable suggestions for mistyped argument choices and subparser names, the feature can be enabled by setting ``suggest_on_error`` to ``True``. Note that this only applies for arguments when the choices specified are strings::" +msgid "" +"If the user would like to enable suggestions for mistyped argument choices and subparser names, the feature can be " +"enabled by setting ``suggest_on_error`` to ``True``. Note that this only applies for arguments when the choices " +"specified are strings::" msgstr "" +"اگر کاربر بخواهد پیشنهادها را برای انتخاب‌های آرگومان و نام‌های زیرپارسر (subparser) که اشتباه تایپ شده‌اند فعال کند، این " +"قابلیت را می‌توان با تنظیم ``suggest_on_error`` روی ``True`` فعال کرد. توجه داشته باشید که این فقط برای آرگومان‌هایی " +"اعمال می‌شود که انتخاب‌های تعیین‌شده برای آن‌ها رشته باشند::" msgid "" ">>> parser = argparse.ArgumentParser(suggest_on_error=True)\n" @@ -555,20 +1000,39 @@ msgid "" "usage: tester.py [-h] [--action {debug,dryrun}]\n" "tester.py: error: argument --action: invalid choice: 'debugg', maybe you meant 'debug'? (choose from debug, dryrun)" msgstr "" +">>> parser = argparse.ArgumentParser(suggest_on_error=True)\n" +">>> parser.add_argument('--action', choices=['debug', 'dryrun'])\n" +">>> parser.parse_args(['--action', 'debugg'])\n" +"usage: tester.py [-h] [--action {debug,dryrun}]\n" +"tester.py: error: argument --action: invalid choice: 'debugg', maybe you meant 'debug'? (choose from debug, dryrun)" -msgid "If you're writing code that needs to be compatible with older Python versions and want to opportunistically use ``suggest_on_error`` when it's available, you can set it as an attribute after initializing the parser instead of using the keyword argument::" +msgid "" +"If you're writing code that needs to be compatible with older Python versions and want to opportunistically use " +"``suggest_on_error`` when it's available, you can set it as an attribute after initializing the parser instead of " +"using the keyword argument::" msgstr "" +"اگر در حال نوشتن کدی هستید که باید با نسخه‌های قدیمی‌تر پایتون سازگار باشد و می‌خواهید در صورت در دسترس بودن، به‌صورت " +"فرصت‌طلبانه از ``suggest_on_error`` استفاده کنید، می‌توانید به‌جای استفاده از آرگومان کلیدواژه‌ای، آن را پس از مقداردهی " +"اولیه‌ی پارسر به‌عنوان یک ویژگی تنظیم کنید::" msgid "" ">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" ">>> parser.suggest_on_error = True" msgstr "" +">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" +">>> parser.suggest_on_error = True" msgid "color" -msgstr "" +msgstr "رنگ" -msgid "By default, the help message is printed in color using `ANSI escape sequences `__. If you want plain text help messages, you can disable this :ref:`in your local environment `, or in the argument parser itself by setting ``color`` to ``False``::" +msgid "" +"By default, the help message is printed in color using `ANSI escape sequences `__. If you want plain text help messages, you can disable this :ref:`in your local environment " +"`, or in the argument parser itself by setting ``color`` to ``False``::" msgstr "" +"به‌طور پیش‌فرض، پیام راهنما با استفاده از `ANSI escape sequences `__ " +"به‌صورت رنگی چاپ می‌شود. اگر پیام‌های راهنما را به‌صورت متن ساده می‌خواهید، می‌توانید آن را :ref:`در محیط محلی خود ` یا در خود پارسر آرگومان با تنظیم ``color`` روی ``False`` غیرفعال کنید::" msgid "" ">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" @@ -578,78 +1042,110 @@ msgid "" "... help='an integer for the accumulator')\n" ">>> parser.parse_args(['--help'])" msgstr "" +">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" +"... color=False)\n" +">>> parser.add_argument('--action', choices=['sum', 'max'])\n" +">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +"... help='an integer for the accumulator')\n" +">>> parser.parse_args(['--help'])" -msgid "Note that when ``color=True``, colored output depends on both environment variables and terminal capabilities. However, if ``color=False``, colored output is always disabled, even if environment variables like ``FORCE_COLOR`` are set." +msgid "" +"Note that when ``color=True``, colored output depends on both environment variables and terminal capabilities. " +"However, if ``color=False``, colored output is always disabled, even if environment variables like ``FORCE_COLOR`` are " +"set." msgstr "" +"توجه داشته باشید که هنگامی که ``color=True`` باشد، خروجی رنگی هم به متغیرهای محیطی و هم به قابلیت‌های پایانه بستگی " +"دارد. با این حال، اگر ``color=False`` باشد، خروجی رنگی همیشه غیرفعال است، حتی اگر متغیرهای محیطی مانند ``FORCE_COLOR`` " +"تنظیم شده باشند." -msgid "Error messages will include color codes when redirecting stderr to a file. To avoid this, set the |NO_COLOR|_ or :envvar:`PYTHON_COLORS` environment variable (for example, ``NO_COLOR=1 python script.py 2> errors.txt``)." +msgid "" +"Error messages will include color codes when redirecting stderr to a file. To avoid this, set the |NO_COLOR|_ " +"or :envvar:`PYTHON_COLORS` environment variable (for example, ``NO_COLOR=1 python script.py 2> errors.txt``)." msgstr "" +"در صورت هدایت stderr به یک فایل، پیام‌های خطا شامل کدهای رنگ خواهند بود. برای جلوگیری از این موضوع، متغیر محیطی |" +"NO_COLOR|_ یا :envvar:`PYTHON_COLORS` را تنظیم کنید (برای مثال، ``NO_COLOR=1 python script.py 2> errors.txt``)." msgid "The add_argument() method" -msgstr "" +msgstr "متد add_argument()" -msgid "Define how a single command-line argument should be parsed. Each parameter has its own more detailed description below, but in short they are:" +msgid "" +"Define how a single command-line argument should be parsed. Each parameter has its own more detailed description " +"below, but in short they are:" msgstr "" +"تعریف می‌کند که یک آرگومان خط فرمان باید چگونه تجزیه شود. هر پارامتر در زیر توضیح مفصل‌تری دارد، اما به‌طور خلاصه " +"عبارت‌اند از:" msgid "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` or ``'-f', '--foo'``." -msgstr "" +msgstr "`name or flags`_ - یا یک نام یا فهرستی از رشته‌های گزینه، برای مثال ``'foo'`` یا ``'-f', '--foo'``." msgid "action_ - The basic type of action to be taken when this argument is encountered at the command line." -msgstr "" +msgstr "action_ - نوع پایه‌ی اقدامی که هنگام مواجهه با این آرگومان در خط فرمان انجام می‌شود." msgid "nargs_ - The number of command-line arguments that should be consumed." -msgstr "" +msgstr "nargs_ - تعداد آرگومان‌های خط فرمان که باید مصرف شوند." msgid "const_ - A constant value required by some action_ and nargs_ selections." -msgstr "" +msgstr "const_ - مقدار ثابتی که برخی انتخاب‌های action_ و nargs_ به آن نیاز دارند." -msgid "default_ - The value produced if the argument is absent from the command line and if it is absent from the namespace object." -msgstr "" +msgid "" +"default_ - The value produced if the argument is absent from the command line and if it is absent from the namespace " +"object." +msgstr "default_ - مقداری که اگر آرگومان در خط فرمان وجود نداشته باشد و در شیء فضای نام نیز غایب باشد، تولید می‌شود." msgid "type_ - The type to which the command-line argument should be converted." -msgstr "" +msgstr "type_ - نوعی که آرگومان خط فرمان باید به آن تبدیل شود." msgid "choices_ - A sequence of the allowable values for the argument." -msgstr "" +msgstr "choices_ - دنباله‌ای از مقادیر مجاز برای آرگومان." msgid "required_ - Whether or not the command-line option may be omitted (optionals only)." -msgstr "" +msgstr "required_ - اینکه آیا می‌توان گزینه خط فرمان را حذف کرد یا خیر (فقط گزینه‌های اختیاری)." msgid "help_ - A brief description of what the argument does." -msgstr "" +msgstr "help_ - شرحی مختصر از کاری که آرگومان انجام می‌دهد." msgid "metavar_ - A name for the argument in usage messages." -msgstr "" +msgstr "metavar_ - نامی برای آرگومان در پیام‌های کاربرد." msgid "dest_ - The name of the attribute to be added to the object returned by :meth:`parse_args`." -msgstr "" +msgstr "dest_ - نام ویژگی‌ای که به شیء برگردانده‌شده توسط :meth:`parse_args` افزوده می‌شود." msgid "deprecated_ - Whether or not use of the argument is deprecated." -msgstr "" +msgstr "deprecated_ - اینکه استفاده از آرگومان منسوخ است یا خیر." msgid "The method returns an :class:`Action` object representing the argument." -msgstr "" +msgstr "این متد یک شیء :class:`Action` برمی‌گرداند که نمایانگر آرگومان است." msgid "name or flags" -msgstr "" +msgstr "نام یا پرچم‌ها" -msgid "The :meth:`~ArgumentParser.add_argument` method must know whether an optional argument, like ``-f`` or ``--foo``, or a positional argument, like a list of filenames, is expected. The first arguments passed to :meth:`~ArgumentParser.add_argument` must therefore be either a series of flags, or a simple argument name." +msgid "" +"The :meth:`~ArgumentParser.add_argument` method must know whether an optional argument, like ``-f`` or ``--foo``, or a " +"positional argument, like a list of filenames, is expected. The first arguments passed " +"to :meth:`~ArgumentParser.add_argument` must therefore be either a series of flags, or a simple argument name." msgstr "" +"متد :meth:`~ArgumentParser.add_argument` باید بداند که آیا یک آرگومان اختیاری، مانند ``-f`` یا ``--foo``، یا یک " +"آرگومان جایگاهی، مانند فهرستی از نام فایل‌ها، انتظار می‌رود. بنابراین اولین آرگومان‌های ارسال‌شده " +"به :meth:`~ArgumentParser.add_argument` باید یا مجموعه‌ای از پرچم‌ها باشند یا یک نام آرگومان ساده." msgid "For example, an optional argument could be created like::" -msgstr "" +msgstr "برای مثال، می‌توان یک آرگومان اختیاری به این صورت ایجاد کرد::" msgid ">>> parser.add_argument('-f', '--foo')" -msgstr "" +msgstr ">>> parser.add_argument('-f', '--foo')" msgid "while a positional argument could be created like::" -msgstr "" +msgstr "در حالی که یک آرگومان جایگاهی را می‌توان به این شکل ایجاد کرد::" msgid ">>> parser.add_argument('bar')" -msgstr "" +msgstr ">>> parser.add_argument('bar')" -msgid "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will be identified by the ``-`` prefix, and the remaining arguments will be assumed to be positional::" +msgid "" +"When :meth:`~ArgumentParser.parse_args` is called, optional arguments will be identified by the ``-`` prefix, and the " +"remaining arguments will be assumed to be positional::" msgstr "" +"هنگامی که :meth:`~ArgumentParser.parse_args` فراخوانی می‌شود، آرگومان‌های اختیاری با پیشوند ``-`` شناسایی می‌شوند، و " +"آرگومان‌های باقی‌مانده جایگاهی فرض می‌شوند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -663,9 +1159,27 @@ msgid "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['BAR'])\n" +"Namespace(bar='BAR', foo=None)\n" +">>> parser.parse_args(['BAR', '--foo', 'FOO'])\n" +"Namespace(bar='BAR', foo='FOO')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"usage: PROG [-h] [-f FOO] bar\n" +"PROG: error: the following arguments are required: bar" -msgid "By default, :mod:`!argparse` automatically handles the internal naming and display names of arguments, simplifying the process without requiring additional configuration. As such, you do not need to specify the dest_ and metavar_ parameters. For optional arguments, the dest_ parameter defaults to the argument name, with underscores ``_`` replacing hyphens ``-``. The metavar_ parameter defaults to the upper-cased name. For example::" +msgid "" +"By default, :mod:`!argparse` automatically handles the internal naming and display names of arguments, simplifying the " +"process without requiring additional configuration. As such, you do not need to specify the dest_ and metavar_ " +"parameters. For optional arguments, the dest_ parameter defaults to the argument name, with underscores ``_`` " +"replacing hyphens ``-``. The metavar_ parameter defaults to the upper-cased name. For example::" msgstr "" +"به‌طور پیش‌فرض، :mod:`!argparse` نام‌گذاری داخلی و نام‌های نمایشی آرگومان‌ها را به‌طور خودکار مدیریت می‌کند و فرآیند را بدون " +"نیاز به پیکربندی اضافی ساده می‌سازد. بنابراین، نیازی به مشخص کردن پارامترهای dest_ و metavar_ ندارید. برای آرگومان‌های " +"اختیاری، پارامتر dest_ به‌طور پیش‌فرض برابر با نام آرگومان است، با جایگزینی زیرخط ``_`` به‌جای خط‌تیره ``-``. پارامتر " +"metavar_ به‌طور پیش‌فرض برابر با نام با حروف بزرگ است. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -679,18 +1193,42 @@ msgid "" " -h, --help show this help message and exit\n" " --foo-bar FOO-BAR" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo-bar')\n" +">>> parser.parse_args(['--foo-bar', 'FOO-BAR'])\n" +"Namespace(foo_bar='FOO-BAR')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo-bar FOO-BAR]\n" +"\n" +"optional arguments:\n" +" -h, --help show this help message and exit\n" +" --foo-bar FOO-BAR" msgid "action" -msgstr "" +msgstr "اقدام" -msgid ":class:`ArgumentParser` objects associate command-line arguments with actions. These actions can do just about anything with the command-line arguments associated with them, though most actions simply add an attribute to the object returned by :meth:`~ArgumentParser.parse_args`. The ``action`` keyword argument specifies how the command-line arguments should be handled. The supplied actions are:" +msgid "" +":class:`ArgumentParser` objects associate command-line arguments with actions. These actions can do just about " +"anything with the command-line arguments associated with them, though most actions simply add an attribute to the " +"object returned by :meth:`~ArgumentParser.parse_args`. The ``action`` keyword argument specifies how the command-line " +"arguments should be handled. The supplied actions are:" msgstr "" +"اشیای :class:`ArgumentParser` آرگومان‌های خط فرمان را به اقدامات مرتبط می‌کنند. این اقدامات می‌توانند تقریباً هر کاری را " +"با آرگومان‌های خط فرمان مرتبط با خود انجام دهند، اگرچه بیشتر اقدامات صرفاً یک ویژگی به شیء برگردانده‌شده " +"از :meth:`~ArgumentParser.parse_args` اضافه می‌کنند. آرگومان کلیدواژه‌ای ``action`` مشخص می‌کند که آرگومان‌های خط فرمان " +"باید چگونه مدیریت شوند. اقدامات فراهم‌شده عبارت‌اند از:" msgid "``'store'`` - This just stores the argument's value. This is the default action." -msgstr "" +msgstr "``'store'`` - این فقط مقدار آرگومان را ذخیره می‌کند. این اقدام پیش‌فرض است." -msgid "``'store_const'`` - This stores the value specified by the const_ keyword argument; note that the const_ keyword argument defaults to ``None``. The ``'store_const'`` action is most commonly used with optional arguments that specify some sort of flag. For example::" +msgid "" +"``'store_const'`` - This stores the value specified by the const_ keyword argument; note that the const_ keyword " +"argument defaults to ``None``. The ``'store_const'`` action is most commonly used with optional arguments that " +"specify some sort of flag. For example::" msgstr "" +"``'store_const'`` - این مقدار مشخص‌شده با آرگومان کلیدواژه‌ای const_ را ذخیره می‌کند؛ توجه داشته باشید که مقدار پیش‌فرض " +"آرگومان کلیدواژه‌ای const_ برابر ``None`` است. اقدام ``'store_const'`` بیشتر با آرگومان‌های اختیاری استفاده می‌شود که " +"نوعی پرچم را مشخص می‌کنند. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -698,9 +1236,17 @@ msgid "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_const', const=42)\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(foo=42)" -msgid "``'store_true'`` and ``'store_false'`` - These are special cases of ``'store_const'`` that respectively store the values ``True`` and ``False`` with default values of ``False`` and ``True``::" +msgid "" +"``'store_true'`` and ``'store_false'`` - These are special cases of ``'store_const'`` that respectively store the " +"values ``True`` and ``False`` with default values of ``False`` and ``True``::" msgstr "" +"``'store_true'`` و ``'store_false'`` - این‌ها موارد خاصی از ``'store_const'`` هستند که به‌ترتیب مقادیر ``True`` و " +"``False`` را با مقادیر پیش‌فرض ``False`` و ``True`` ذخیره می‌کنند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -710,9 +1256,21 @@ msgid "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('--bar', action='store_false')\n" +">>> parser.add_argument('--baz', action='store_false')\n" +">>> parser.parse_args('--foo --bar'.split())\n" +"Namespace(foo=True, bar=False, baz=True)" -msgid "``'append'`` - This appends each argument value to a list. It is useful for allowing an option to be specified multiple times. If the default value is a non-empty list, the parsed value will start with the default list's elements and any values from the command line will be appended after those default values. Example usage::" +msgid "" +"``'append'`` - This appends each argument value to a list. It is useful for allowing an option to be specified " +"multiple times. If the default value is a non-empty list, the parsed value will start with the default list's elements " +"and any values from the command line will be appended after those default values. Example usage::" msgstr "" +"``'append'`` - این عمل هر مقدار آرگومان را به یک فهرست اضافه می‌کند. این برای اجازه دادن به اینکه یک گزینه چندین بار " +"مشخص شود، مفید است. اگر مقدار پیش‌فرض یک فهرست غیرخالی باشد، مقدار تجزیه‌شده با عناصر فهرست پیش‌فرض آغاز می‌شود و هر " +"مقداری از خط فرمان پس از آن مقادیر پیش‌فرض اضافه می‌شود. نمونه استفاده::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -720,9 +1278,19 @@ msgid "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['0', '1', '2'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='append', default=['0'])\n" +">>> parser.parse_args('--foo 1 --foo 2'.split())\n" +"Namespace(foo=['0', '1', '2'])" -msgid "``'append_const'`` - This appends the value specified by the const_ keyword argument to a list; note that the const_ keyword argument defaults to ``None``. The ``'append_const'`` action is typically useful when multiple arguments need to store constants to the same list. For example::" +msgid "" +"``'append_const'`` - This appends the value specified by the const_ keyword argument to a list; note that the const_ " +"keyword argument defaults to ``None``. The ``'append_const'`` action is typically useful when multiple arguments need " +"to store constants to the same list. For example::" msgstr "" +"``'append_const'`` - این کنش مقدار مشخص‌شده توسط آرگومان کلیدواژه‌ای const_ را به یک فهرست الحاق می‌کند؛ توجه داشته باشید " +"که مقدار پیش‌فرض آرگومان کلیدواژه‌ای const_ برابر ``None`` است. کنش ``'append_const'`` معمولاً زمانی مفید است که چند " +"آرگومان نیاز دارند ثابت‌ها را در یک فهرست مشترک ذخیره کنند. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -731,9 +1299,20 @@ msgid "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--str', dest='types', action='append_const', const=str)\n" +">>> parser.add_argument('--int', dest='types', action='append_const', const=int)\n" +">>> parser.parse_args('--str --int'.split())\n" +"Namespace(types=[, ])" -msgid "``'extend'`` - This appends each item from a multi-value argument to a list. The ``'extend'`` action is typically used with the nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is ``None`` (the default) or ``'?'``, each character of the argument string will be appended to the list. Example usage::" +msgid "" +"``'extend'`` - This appends each item from a multi-value argument to a list. The ``'extend'`` action is typically used " +"with the nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is ``None`` (the default) or ``'?'``, " +"each character of the argument string will be appended to the list. Example usage::" msgstr "" +"``'extend'`` - این هر یک از آیتم‌های یک آرگومان چندمقداری را به یک فهرست اضافه می‌کند. اکشن ``'extend'`` معمولاً " +"همراه با مقدار ``'+'`` یا ``'*'`` برای آرگومان کلیدواژه‌ای nargs_ استفاده می‌شود. توجه داشته باشید که وقتی nargs_ برابر " +"با ``None`` (پیش‌فرض) یا ``'?'`` باشد، هر نویسه‌ی رشته‌ی آرگومان به فهرست اضافه خواهد شد. نمونه کاربرد::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -741,9 +1320,16 @@ msgid "" ">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", \"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", \"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -msgid "``'count'`` - This counts the number of times an argument occurs. For example, this is useful for increasing verbosity levels::" +msgid "" +"``'count'`` - This counts the number of times an argument occurs. For example, this is useful for increasing verbosity " +"levels::" msgstr "" +"``'count'`` - این تعداد دفعاتی را که یک آرگومان رخ می‌دهد می‌شمارد. برای مثال، این برای افزایش سطوح پرگویی مفید است::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -751,15 +1337,28 @@ msgid "" ">>> parser.parse_args(['-vvv'])\n" "Namespace(verbose=3)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" +">>> parser.parse_args(['-vvv'])\n" +"Namespace(verbose=3)" msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." -msgstr "" +msgstr "توجه داشته باشید، *پیش‌فرض* ``None`` خواهد بود، مگر اینکه به‌صراحت روی *0* تنظیم شود." -msgid "``'help'`` - This prints a complete help message for all the options in the current parser and then exits. By default a help action is automatically added to the parser. See :class:`ArgumentParser` for details of how the output is created." +msgid "" +"``'help'`` - This prints a complete help message for all the options in the current parser and then exits. By default " +"a help action is automatically added to the parser. See :class:`ArgumentParser` for details of how the output is " +"created." msgstr "" +"``'help'`` - این یک پیام راهنمای کامل برای همه گزینه‌های پارسر فعلی را چاپ می‌کند و سپس خارج می‌شود. به‌طور پیش‌فرض، یک " +"اقدام راهنما به‌صورت خودکار به پارسر اضافه می‌شود. برای جزئیات چگونگی ایجاد خروجی، :class:`ArgumentParser` را ببینید." -msgid "``'version'`` - This expects a ``version=`` keyword argument in the :meth:`~ArgumentParser.add_argument` call, and prints version information and exits when invoked::" +msgid "" +"``'version'`` - This expects a ``version=`` keyword argument in the :meth:`~ArgumentParser.add_argument` call, and " +"prints version information and exits when invoked::" msgstr "" +"``'version'`` - این گزینه به یک آرگومان کلیدواژه‌ای ``version=`` در فراخوانی :meth:`~ArgumentParser.add_argument` نیاز " +"دارد و هنگام فراخوانی، اطلاعات نسخه را چاپ کرده و خارج می‌شود::" msgid "" ">>> import argparse\n" @@ -768,15 +1367,34 @@ msgid "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--version', action='version', version='%(prog)s 2.0')\n" +">>> parser.parse_args(['--version'])\n" +"PROG 2.0" -msgid "You may also specify an arbitrary action by passing an :class:`Action` subclass (e.g. :class:`BooleanOptionalAction`) or other object that implements the same interface. Only actions that consume command-line arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions with non-zero ``nargs``) can be used with positional arguments." +msgid "" +"You may also specify an arbitrary action by passing an :class:`Action` subclass (e.g. :class:`BooleanOptionalAction`) " +"or other object that implements the same interface. Only actions that consume command-line arguments (e.g. " +"``'store'``, ``'append'``, ``'extend'``, or custom actions with non-zero ``nargs``) can be used with positional " +"arguments." msgstr "" +"همچنین می‌توانید با ارسال یک زیرکلاس از :class:`Action` (برای مثال :class:`BooleanOptionalAction`) یا شیء دیگری که همان " +"رابط را پیاده‌سازی می‌کند، یک اکشندلخواه را مشخص کنید. فقط کنش‌هایی که آرگومان‌های خط فرمان را مصرف می‌کنند " +"(برای مثال ``'store'``، ``'append'``، ``'extend'`` یا کنش‌های سفارشی با ``nargs`` غیرصفر) می‌توانند با آرگومان‌های " +"جایگاهی استفاده شوند." -msgid "The recommended way to create a custom action is to extend :class:`Action`, overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` and :meth:`!format_usage` methods. You can also register custom actions using the :meth:`~ArgumentParser.register` method and reference them by their registered name." +msgid "" +"The recommended way to create a custom action is to extend :class:`Action`, overriding the :meth:`!__call__` method " +"and optionally the :meth:`!__init__` and :meth:`!format_usage` methods. You can also register custom actions using " +"the :meth:`~ArgumentParser.register` method and reference them by their registered name." msgstr "" +"روش توصیه‌شده برای ایجاد یک کنش سفارشی ، گسترش :class:`Action` با بازنویسی متد :meth:`!__call__` و به‌اختیار " +"متدهای :meth:`!__init__` و :meth:`!format_usage` است. همچنین می‌توانید کنش‌های سفارشی را با استفاده از " +"متد :meth:`~ArgumentParser.register` ثبت کنید و با نام ثبت‌شده‌ی آن‌ها به آن‌ها ارجاع دهید." msgid "An example of a custom action::" -msgstr "" +msgstr "مثالی از یک اکشن سفارشی::" msgid "" ">>> class FooAction(argparse.Action):\n" @@ -797,18 +1415,41 @@ msgid "" ">>> args\n" "Namespace(bar='1', foo='2')" msgstr "" +">>> class FooAction(argparse.Action):\n" +"... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" +"... if nargs is not None:\n" +"... raise ValueError(\"nargs not allowed\")\n" +"... super().__init__(option_strings, dest, **kwargs)\n" +"... def __call__(self, parser, namespace, values, option_string=None):\n" +"... print('%r %r %r' % (namespace, values, option_string))\n" +"... setattr(namespace, self.dest, values)\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=FooAction)\n" +">>> parser.add_argument('bar', action=FooAction)\n" +">>> args = parser.parse_args('1 --foo 2'.split())\n" +"Namespace(bar=None, foo=None) '1' None\n" +"Namespace(bar='1', foo=None) '2' '--foo'\n" +">>> args\n" +"Namespace(bar='1', foo='2')" msgid "For more details, see :class:`Action`." -msgstr "" +msgstr "برای جزئیات بیشتر، :class:`Action` را ببینید." msgid "nargs" -msgstr "" +msgstr "nargs" -msgid ":class:`ArgumentParser` objects usually associate a single command-line argument with a single action to be taken. The ``nargs`` keyword argument associates a different number of command-line arguments with a single action. See also :ref:`specifying-ambiguous-arguments`. The supported values are:" +msgid "" +":class:`ArgumentParser` objects usually associate a single command-line argument with a single action to be taken. " +"The ``nargs`` keyword argument associates a different number of command-line arguments with a single action. See " +"also :ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" +"اشیای :class:`ArgumentParser` معمولاً یک آرگومان خط فرمان را با یک اقدام مشخص مرتبط می‌کنند. آرگومان کلیدواژه‌ای " +"``nargs`` تعداد متفاوتی از آرگومان‌های خط فرمان را با یک اقدام مرتبط می‌کند. همچنین :ref:`specifying-ambiguous-" +"arguments` را ببینید. مقادیر پشتیبانی‌شده عبارت‌اند از:" msgid "``N`` (an integer). ``N`` arguments from the command line will be gathered together into a list. For example::" -msgstr "" +msgstr "``N`` (یک عدد صحیح). ``N`` آرگومان از خط فرمان در یک فهرست جمع می‌شوند. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -817,12 +1458,29 @@ msgid "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs=2)\n" +">>> parser.add_argument('bar', nargs=1)\n" +">>> parser.parse_args('c --foo a b'.split())\n" +"Namespace(bar=['c'], foo=['a', 'b'])" -msgid "Note that ``nargs=1`` produces a list of one item. This is different from the default, in which the item is produced by itself." +msgid "" +"Note that ``nargs=1`` produces a list of one item. This is different from the default, in which the item is produced " +"by itself." msgstr "" +"توجه کنید که ``nargs=1`` یک فهرست با یک آیتم تولید می‌کند. این با حالت پیش‌فرض متفاوت است، که در آن آیتم به‌تنهایی تولید " +"می‌شود." -msgid "``'?'``. One argument will be consumed from the command line if possible, and produced as a single item. If no command-line argument is present, the value from default_ will be produced. Note that for optional arguments, there is an additional case - the option string is present but not followed by a command-line argument. In this case the value from const_ will be produced. Some examples to illustrate this::" +msgid "" +"``'?'``. One argument will be consumed from the command line if possible, and produced as a single item. If no " +"command-line argument is present, the value from default_ will be produced. Note that for optional arguments, there " +"is an additional case - the option string is present but not followed by a command-line argument. In this case the " +"value from const_ will be produced. Some examples to illustrate this::" msgstr "" +"``'?'``. در صورت امکان، یک آرگومان از خط فرمان مصرف می‌شود و به‌عنوان یک آیتم واحد تولید می‌شود. اگر هیچ آرگومان خط " +"فرمانی وجود نداشته باشد، مقدار default_ تولید می‌شود. توجه داشته باشید که برای آرگومان‌های اختیاری، حالت دیگری نیز وجود " +"دارد: رشته‌ی گزینه موجود است اما آرگومان خط فرمانی پس از آن نمی‌آید. در این حالت، مقدار const_ تولید می‌شود. چند مثال برای " +"روشن‌سازی این موضوع::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -835,9 +1493,18 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" +">>> parser.add_argument('bar', nargs='?', default='d')\n" +">>> parser.parse_args(['XX', '--foo', 'YY'])\n" +"Namespace(bar='XX', foo='YY')\n" +">>> parser.parse_args(['XX', '--foo'])\n" +"Namespace(bar='XX', foo='c')\n" +">>> parser.parse_args([])\n" +"Namespace(bar='d', foo='d')" msgid "One of the more common uses of ``nargs='?'`` is to allow optional input and output files::" -msgstr "" +msgstr "یکی از کاربردهای رایج‌تر ``nargs='?'``، مجاز کردن فایل‌های ورودی و خروجی اختیاری است::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -850,9 +1517,23 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(infile=None, outfile=None)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', nargs='?')\n" +">>> parser.add_argument('outfile', nargs='?')\n" +">>> parser.parse_args(['input.txt', 'output.txt'])\n" +"Namespace(infile='input.txt', outfile='output.txt')\n" +">>> parser.parse_args(['input.txt'])\n" +"Namespace(infile='input.txt', outfile=None)\n" +">>> parser.parse_args([])\n" +"Namespace(infile=None, outfile=None)" -msgid "``'*'``. All command-line arguments present are gathered into a list. Note that it generally doesn't make much sense to have more than one positional argument with ``nargs='*'``, but multiple optional arguments with ``nargs='*'`` is possible. For example::" +msgid "" +"``'*'``. All command-line arguments present are gathered into a list. Note that it generally doesn't make much sense " +"to have more than one positional argument with ``nargs='*'``, but multiple optional arguments with ``nargs='*'`` is " +"possible. For example::" msgstr "" +"``'*'``. تمام آرگومان‌های خط فرمان موجود در یک فهرست جمع‌آوری می‌شوند. توجه داشته باشید که معمولاً داشتن بیش از یک آرگومان " +"جایگاهی با ``nargs='*'`` معنای چندانی ندارد، اما داشتن چند آرگومان اختیاری با ``nargs='*'`` امکان‌پذیر است. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -862,9 +1543,19 @@ msgid "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='*')\n" +">>> parser.add_argument('--bar', nargs='*')\n" +">>> parser.add_argument('baz', nargs='*')\n" +">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" +"Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -msgid "``'+'``. Just like ``'*'``, all command-line arguments present are gathered into a list. Additionally, an error message will be generated if there wasn't at least one command-line argument present. For example::" +msgid "" +"``'+'``. Just like ``'*'``, all command-line arguments present are gathered into a list. Additionally, an error " +"message will be generated if there wasn't at least one command-line argument present. For example::" msgstr "" +"``'+'``. درست مانند ``'*'``، تمام آرگومان‌های خط فرمانِ موجود در یک فهرست گردآوری می‌شوند. به‌علاوه، اگر حداقل یک آرگومان " +"خط فرمان وجود نداشته باشد، یک پیام خطا تولید می‌شود. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -875,30 +1566,72 @@ msgid "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('foo', nargs='+')\n" +">>> parser.parse_args(['a', 'b'])\n" +"Namespace(foo=['a', 'b'])\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] foo [foo ...]\n" +"PROG: error: the following arguments are required: foo" -msgid "If the ``nargs`` keyword argument is not provided, the number of arguments consumed is determined by the action_. Generally this means a single command-line argument will be consumed and a single item (not a list) will be produced. Actions that do not consume command-line arguments (e.g. ``'store_const'``) set ``nargs=0``." +msgid "" +"If the ``nargs`` keyword argument is not provided, the number of arguments consumed is determined by the action_. " +"Generally this means a single command-line argument will be consumed and a single item (not a list) will be produced. " +"Actions that do not consume command-line arguments (e.g. ``'store_const'``) set ``nargs=0``." msgstr "" +"اگر آرگومان کلیدواژه‌ای ``nargs`` ارائه نشده باشد، تعداد آرگومان‌های مصرف‌شده توسط action_ تعیین می‌شود. به‌طور معمول، این " +"بدان معناست که یک آرگومان خط فرمان مصرف می‌شود و یک آیتم (نه یک فهرست) تولید می‌شود. کنش‌هایی (actions) که آرگومان‌های خط " +"فرمان را مصرف نمی‌کنند (مانند ``'store_const'``)، ``nargs=0`` را تنظیم می‌کنند." msgid "const" -msgstr "" +msgstr "const" -msgid "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to hold constant values that are not read from the command line but are required for the various :class:`ArgumentParser` actions. The two most common uses of it are:" +msgid "" +"The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to hold constant values that are not read from " +"the command line but are required for the various :class:`ArgumentParser` actions. The two most common uses of it are:" msgstr "" +"آرگومان ``const`` در :meth:`~ArgumentParser.add_argument` برای نگهداری مقادیر ثابتی استفاده می‌شود که از خط فرمان " +"خوانده نمی‌شوند، اما برای کنش‌های (actions) مختلف :class:`ArgumentParser` مورد نیاز هستند. دو مورد از رایج‌ترین کاربردهای " +"آن عبارت‌اند از:" -msgid "When :meth:`~ArgumentParser.add_argument` is called with ``action='store_const'`` or ``action='append_const'``. These actions add the ``const`` value to one of the attributes of the object returned by :meth:`~ArgumentParser.parse_args`. See the action_ description for examples. If ``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will receive a default value of ``None``." +msgid "" +"When :meth:`~ArgumentParser.add_argument` is called with ``action='store_const'`` or ``action='append_const'``. These " +"actions add the ``const`` value to one of the attributes of the object returned by :meth:`~ArgumentParser.parse_args`. " +"See the action_ description for examples. If ``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it " +"will receive a default value of ``None``." msgstr "" +"هنگامی که :meth:`~ArgumentParser.add_argument` با ``action='store_const'`` یا ``action='append_const'`` فراخوانی " +"می‌شود. این عملکردهامقدار ``const`` را به یکی از ویژگی‌های شیء برگردانده‌شده " +"توسط :meth:`~ArgumentParser.parse_args` اضافه می‌کنند. برای مثال‌ها، شرح action_ را ببینید. اگر ``const`` " +"به :meth:`~ArgumentParser.add_argument` ارائه نشود، مقدار پیش‌فرض ``None`` را دریافت خواهد کرد." -msgid "When :meth:`~ArgumentParser.add_argument` is called with option strings (like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional argument that can be followed by zero or one command-line arguments. When parsing the command line, if the option string is encountered with no command-line argument following it, the value from ``const`` will be used. See the nargs_ description for examples." +msgid "" +"When :meth:`~ArgumentParser.add_argument` is called with option strings (like ``-f`` or ``--foo``) and ``nargs='?'``. " +"This creates an optional argument that can be followed by zero or one command-line arguments. When parsing the command " +"line, if the option string is encountered with no command-line argument following it, the value from ``const`` will be " +"used. See the nargs_ description for examples." msgstr "" +"هنگامی که :meth:`~ArgumentParser.add_argument` با رشته‌های گزینه (مانند ``-f`` یا ``--foo``) و ``nargs='?'`` فراخوانی " +"می‌شود، این کار یک آرگومان اختیاری ایجاد می‌کند که می‌تواند صفر یا یک آرگومان خط فرمان پس از خود داشته باشد. هنگام تجزیه " +"خط فرمان، اگر رشته گزینه بدون هیچ آرگومان خط فرمانی پس از آن مشاهده شود، مقدار ``const`` استفاده خواهد شد. برای " +"نمونه‌ها، توضیحات nargs_ را ببینید." msgid "``const=None`` by default, including when ``action='append_const'`` or ``action='store_const'``." -msgstr "" +msgstr "``const=None`` به‌طور پیش‌فرض، از جمله زمانی که ``action='append_const'`` یا ``action='store_const'`` باشد." msgid "default" -msgstr "" +msgstr "پیش‌فرض" -msgid "All optional arguments and some positional arguments may be omitted at the command line. The ``default`` keyword argument of :meth:`~ArgumentParser.add_argument`, whose value defaults to ``None``, specifies what value should be used if the command-line argument is not present. For optional arguments, the ``default`` value is used when the option string was not present at the command line::" +msgid "" +"All optional arguments and some positional arguments may be omitted at the command line. The ``default`` keyword " +"argument of :meth:`~ArgumentParser.add_argument`, whose value defaults to ``None``, specifies what value should be " +"used if the command-line argument is not present. For optional arguments, the ``default`` value is used when the " +"option string was not present at the command line::" msgstr "" +"می‌توان تمام آرگومان‌های اختیاری و برخی آرگومان‌های جایگاهی را در خط فرمان حذف کرد. آرگومان کلیدواژه‌ای ``default`` " +"در :meth:`~ArgumentParser.add_argument`، که مقدار پیش‌فرض آن ``None`` است، مشخص می‌کند که اگر آرگومان خط فرمان وجود " +"نداشته باشد، از چه مقداری باید استفاده شود. برای آرگومان‌های اختیاری، هرگاه رشته‌ی گزینه در خط فرمان وجود نداشته باشد، " +"از مقدار ``default`` استفاده می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -908,9 +1641,15 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args(['--foo', '2'])\n" +"Namespace(foo='2')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" msgid "If the target namespace already has an attribute set, the action *default* will not overwrite it::" -msgstr "" +msgstr "اگر فضای نام هدف از قبل ویژگی تنظیم‌شده‌ای داشته باشد، *پیش‌فرضِ* اکشن آن را بازنویسی نمی‌کند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -918,9 +1657,19 @@ msgid "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" +"Namespace(foo=101)" -msgid "If the ``default`` value is a string, the parser parses the value as if it were a command-line argument. In particular, the parser applies any type_ conversion argument, if provided, before setting the attribute on the :class:`Namespace` return value. Otherwise, the parser uses the value as is::" +msgid "" +"If the ``default`` value is a string, the parser parses the value as if it were a command-line argument. In " +"particular, the parser applies any type_ conversion argument, if provided, before setting the attribute on " +"the :class:`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" +"اگر مقدار ``default`` یک رشته باشد، پارسر مقدار را طوری تجزیه می‌کند که گویی یک آرگومان خط فرمان باشد. به‌طور خاص، پارسر " +"هر آرگومان تبدیل type_ را، در صورت ارائه، پیش از تنظیم ویژگی روی مقدار بازگشتی :class:`Namespace` اعمال می‌کند. در غیر " +"این صورت، پارسر از مقدار همان‌طور که هست استفاده می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -929,9 +1678,18 @@ msgid "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--length', default='10', type=int)\n" +">>> parser.add_argument('--width', default=10.5, type=int)\n" +">>> parser.parse_args()\n" +"Namespace(length=10, width=10.5)" -msgid "For positional arguments with nargs_ equal to ``?`` or ``*``, the ``default`` value is used when no command-line argument was present::" +msgid "" +"For positional arguments with nargs_ equal to ``?`` or ``*``, the ``default`` value is used when no command-line " +"argument was present::" msgstr "" +"برای آرگومان‌های جایگاهی که nargs_ آن‌ها برابر با ``?`` یا ``*`` است، هرگاه هیچ آرگومانی در خط فرمان وجود نداشته باشد، " +"از مقدار ``default`` استفاده می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -941,15 +1699,31 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', nargs='?', default=42)\n" +">>> parser.parse_args(['a'])\n" +"Namespace(foo='a')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" -msgid "Because ``nargs='*'`` gathers any supplied values into a list, an absent positional argument yields an empty list (``[]``). Only a non-``None`` *default* overrides this (so ``default=None`` still gives ``[]``)." +msgid "" +"Because ``nargs='*'`` gathers any supplied values into a list, an absent positional argument yields an empty list " +"(``[]``). Only a non-``None`` *default* overrides this (so ``default=None`` still gives ``[]``)." msgstr "" +"از آنجا که ``nargs='*'`` همه مقادیر ارائه‌شده را در یک فهرست جمع می‌کند، در نبود یک آرگومان جایگاهی، یک فهرست خالی " +"(``[]``) برگردانده می‌شود. تنها یک *پیش‌فرض* غیر ``None`` این رفتار را بازنویسی می‌کند (بنابراین ``default=None`` همچنان " +"``[]`` برمی‌گرداند)." -msgid "For required_ arguments, the ``default`` value is ignored. For example, this applies to positional arguments with nargs_ values other than ``?`` or ``*``, or optional arguments marked as ``required=True``." +msgid "" +"For required_ arguments, the ``default`` value is ignored. For example, this applies to positional arguments with " +"nargs_ values other than ``?`` or ``*``, or optional arguments marked as ``required=True``." msgstr "" +"برای آرگومان‌های required_، مقدار ``default`` نادیده گرفته می‌شود. برای مثال، این موضوع به آرگومان‌های جایگاهی با مقادیر " +"nargs_ غیر از ``?`` یا ``*``، یا آرگومان‌های اختیاری که با ``required=True`` علامت‌گذاری شده‌اند اعمال می‌شود." -msgid "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if the command-line argument was not present::" -msgstr "" +msgid "" +"Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if the command-line argument was not present::" +msgstr "با ارائه ``default=argparse.SUPPRESS``، اگر آرگومان خط فرمان وجود نداشته باشد، هیچ ویژگی‌ای اضافه نمی‌شود::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -959,21 +1733,44 @@ msgid "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" +">>> parser.parse_args([])\n" +"Namespace()\n" +">>> parser.parse_args(['--foo', '1'])\n" +"Namespace(foo='1')" msgid "type" -msgstr "" +msgstr "نوع" -msgid "By default, the parser reads command-line arguments in as simple strings. However, quite often the command-line string should instead be interpreted as another type, such as a :class:`float` or :class:`int`. The ``type`` keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-checking and type conversions to be performed." +msgid "" +"By default, the parser reads command-line arguments in as simple strings. However, quite often the command-line string " +"should instead be interpreted as another type, such as a :class:`float` or :class:`int`. The ``type`` keyword " +"for :meth:`~ArgumentParser.add_argument` allows any necessary type-checking and type conversions to be performed." msgstr "" +"به‌طور پیش‌فرض، پارسر آرگومان‌های خط فرمان را به‌صورت رشته‌های ساده می‌خواند. با این حال، اغلب رشته‌ی خط فرمان باید به‌جای آن " +"به‌عنوان نوع دیگری تفسیر شود، مانند :class:`float` یا :class:`int`. کلیدواژه‌ی ``type`` " +"برای :meth:`~ArgumentParser.add_argument` امکان انجام هرگونه بررسی نوع و تبدیل نوع ضروری را فراهم می‌کند." -msgid "If the type_ keyword is used with the default_ keyword, the type converter is only applied if the default is a string." +msgid "" +"If the type_ keyword is used with the default_ keyword, the type converter is only applied if the default is a string." msgstr "" +"اگر از کلیدواژه‌ی type_ همراه با کلیدواژه‌ی default_ استفاده شود، مبدل نوع فقط زمانی اعمال می‌شود که مقدار پیش‌فرض یک " +"رشته باشد." -msgid "The argument to ``type`` can be a callable that accepts a single string or the name of a registered type (see :meth:`~ArgumentParser.register`) If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:`ValueError`, the exception is caught and a nicely formatted error message is displayed. Other exception types are not handled." +msgid "" +"The argument to ``type`` can be a callable that accepts a single string or the name of a registered type " +"(see :meth:`~ArgumentParser.register`) If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, " +"or :exc:`ValueError`, the exception is caught and a nicely formatted error message is displayed. Other exception types " +"are not handled." msgstr "" +"آرگومان ``type`` می‌تواند یک شیء فراخوان‌پذیر (callable) باشد که یک رشته واحد را می‌پذیرد، یا نام یک نوع ثبت‌شده " +"(به :meth:`~ArgumentParser.register` مراجعه کنید). اگر تابع :exc:`ArgumentTypeError`، :exc:`TypeError` " +"یا :exc:`ValueError` را پرتاب کند، استثنا گرفته می‌شود و یک پیام خطای به‌خوبی قالب‌بندی‌شده نمایش داده می‌شود. سایر انواع " +"استثنا مدیریت نمی‌شوند." msgid "Common built-in types and functions can be used as type converters:" -msgstr "" +msgstr "می‌توان از انواع و توابع توکار رایج به‌عنوان مبدل‌های نوع استفاده کرد:" msgid "" "import argparse\n" @@ -986,9 +1783,18 @@ msgid "" "parser.add_argument('code_point', type=ord)\n" "parser.add_argument('datapath', type=pathlib.Path)" msgstr "" +"import argparse\n" +"import pathlib\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('count', type=int)\n" +"parser.add_argument('distance', type=float)\n" +"parser.add_argument('street', type=ascii)\n" +"parser.add_argument('code_point', type=ord)\n" +"parser.add_argument('datapath', type=pathlib.Path)" msgid "User defined functions can be used as well:" -msgstr "" +msgstr "می‌توان از توابع تعریف‌شده توسط کاربر نیز استفاده کرد:" msgid "" ">>> def hyphenated(string):\n" @@ -999,37 +1805,82 @@ msgid "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" msgstr "" - -msgid "The :func:`bool` function is not recommended as a type converter. All it does is convert empty strings to ``False`` and non-empty strings to ``True``. This is usually not what is desired::" -msgstr "" - -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> _ = parser.add_argument('--verbose', type=bool)\n" +">>> def hyphenated(string):\n" +"... return '-'.join([word[:4] for word in string.casefold().split()])\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('short_title', type=hyphenated)\n" +">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" +"Namespace(short_title='\"the-tale-of-two-citi')" + +msgid "" +"The :func:`bool` function is not recommended as a type converter. All it does is convert empty strings to ``False`` " +"and non-empty strings to ``True``. This is usually not what is desired::" +msgstr "" +"تابع :func:`bool` به‌عنوان مبدل نوع توصیه نمی‌شود. تنها کاری که انجام می‌دهد تبدیل رشته‌های خالی به ``False`` و رشته‌های " +"غیرخالی به ``True`` است. این معمولاً آنچه مطلوب است نیست::" + +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('--verbose', type=bool)\n" ">>> parser.parse_args(['--verbose', 'False'])\n" "Namespace(verbose=True)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('--verbose', type=bool)\n" +">>> parser.parse_args(['--verbose', 'False'])\n" +"Namespace(verbose=True)" msgid "See :class:`BooleanOptionalAction` or ``action='store_true'`` for common alternatives." -msgstr "" +msgstr "برای جایگزین‌های رایج، :class:`BooleanOptionalAction` یا ``action='store_true'`` را ببینید." -msgid "In general, the ``type`` keyword is a convenience that should only be used for simple conversions that can only raise one of the three supported exceptions. Anything with more interesting error-handling or resource management should be done downstream after the arguments are parsed." +msgid "" +"In general, the ``type`` keyword is a convenience that should only be used for simple conversions that can only raise " +"one of the three supported exceptions. Anything with more interesting error-handling or resource management should be " +"done downstream after the arguments are parsed." msgstr "" +"به‌طور کلی، آرگومان کلیدواژه‌ای ``type`` برای سهولت در نظر گرفته شده است و باید فقط برای تبدیل‌های ساده‌ای به کار رود که " +"تنها می‌توانند یکی از سه استثنای پشتیبانی‌شده را پرتاب کنند. هر موردی که مدیریت خطا یا مدیریت منابع پیچیده‌تری دارد، باید " +"پس از تجزیه‌ی آرگومان‌ها در مراحل بعدی انجام شود." -msgid "For example, JSON or YAML conversions have complex error cases that require better reporting than can be given by the ``type`` keyword. A :exc:`~json.JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` exception would not be handled at all." +msgid "" +"For example, JSON or YAML conversions have complex error cases that require better reporting than can be given by the " +"``type`` keyword. A :exc:`~json.JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` exception " +"would not be handled at all." msgstr "" +"برای مثال، تبدیل‌های JSON یا YAML دارای موارد خطای پیچیده‌ای هستند که به گزارش‌دهی بهتری نسبت به آنچه کلیدواژه ``type`` " +"می‌تواند ارائه کند نیاز دارند. یک :exc:`~json.JSONDecodeError` به‌درستی قالب‌بندی نمی‌شد و " +"استثنای :exc:`FileNotFoundError` به‌هیچ‌وجه مدیریت نمی‌شد." -msgid "Even :class:`~argparse.FileType` has its limitations for use with the ``type`` keyword. If one argument uses :class:`~argparse.FileType` and then a subsequent argument fails, an error is reported but the file is not automatically closed. In this case, it would be better to wait until after the parser has run and then use the :keyword:`with`-statement to manage the files." +msgid "" +"Even :class:`~argparse.FileType` has its limitations for use with the ``type`` keyword. If one argument " +"uses :class:`~argparse.FileType` and then a subsequent argument fails, an error is reported but the file is not " +"automatically closed. In this case, it would be better to wait until after the parser has run and then use " +"the :keyword:`with`-statement to manage the files." msgstr "" +"حتی :class:`~argparse.FileType` برای استفاده با کلیدواژه‌ی ``type`` محدودیت‌هایی دارد. اگر یک آرگومان " +"از :class:`~argparse.FileType` استفاده کند و سپس آرگومان بعدی با شکست مواجه شود، خطایی گزارش می‌شود اما پرونده به‌طور " +"خودکار بسته نمی‌شود. در این صورت، بهتر است تا پایان اجرای پارسر صبر کنید و سپس از دستور :keyword:`with` برای مدیریت " +"پرونده‌ها استفاده کنید." msgid "For type checkers that simply check against a fixed set of values, consider using the choices_ keyword instead." msgstr "" +"برای ابزارهای بررسی نوع که صرفاً در برابر مجموعه ثابتی از مقادیر بررسی می‌کنند، استفاده از کلیدواژه choices_ را به‌جای آن " +"در نظر بگیرید." msgid "choices" -msgstr "" +msgstr "گزینه‌ها" -msgid "Some command-line arguments should be selected from a restricted set of values. These can be handled by passing a sequence object as the *choices* keyword argument to :meth:`~ArgumentParser.add_argument`. When the command line is parsed, argument values will be checked, and an error message will be displayed if the argument was not one of the acceptable values::" +msgid "" +"Some command-line arguments should be selected from a restricted set of values. These can be handled by passing a " +"sequence object as the *choices* keyword argument to :meth:`~ArgumentParser.add_argument`. When the command line is " +"parsed, argument values will be checked, and an error message will be displayed if the argument was not one of the " +"acceptable values::" msgstr "" +"برخی آرگومان‌های خط فرمان باید از میان یک مجموعه محدود از مقدارها انتخاب شوند. این موارد را می‌توان با ارسال یک شیء " +"دنباله به‌عنوان آرگومان کلیدواژه‌ای *choices* به :meth:`~ArgumentParser.add_argument` مدیریت کرد. هنگامی که خط فرمان " +"تجزیه می‌شود، مقدارهای آرگومان بررسی خواهند شد و اگر آرگومان یکی از مقدارهای قابل‌قبول نباشد، یک پیام خطا نمایش داده " +"می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" @@ -1041,27 +1892,62 @@ msgid "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='game.py')\n" +">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" +">>> parser.parse_args(['rock'])\n" +"Namespace(move='rock')\n" +">>> parser.parse_args(['fire'])\n" +"usage: game.py [-h] {rock,paper,scissors}\n" +"game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" +"'paper', 'scissors')" -msgid "Any sequence can be passed as the *choices* value, so :class:`list` objects, :class:`tuple` objects, and custom sequences are all supported." +msgid "" +"Any sequence can be passed as the *choices* value, so :class:`list` objects, :class:`tuple` objects, and custom " +"sequences are all supported." msgstr "" +"هر دنباله‌ای را می‌توان به‌عنوان مقدار *choices* ارسال کرد، بنابراین اشیای :class:`list`، اشیای :class:`tuple` و " +"دنباله‌های سفارشی همگی پشتیبانی می‌شوند." -msgid "Use of :class:`enum.Enum` is not recommended because it is difficult to control its appearance in usage, help, and error messages." -msgstr "" +msgid "" +"Use of :class:`enum.Enum` is not recommended because it is difficult to control its appearance in usage, help, and " +"error messages." +msgstr "استفاده از :class:`enum.Enum` توصیه نمی‌شود، زیرا کنترل نحوه‌ی نمایش آن در کاربرد، راهنما و پیام‌های خطا دشوار است." -msgid "Note that *choices* are checked after any type_ conversions have been performed, so objects in *choices* should match the type_ specified. This can make *choices* appear unfamiliar in usage, help, or error messages." +msgid "" +"Note that *choices* are checked after any type_ conversions have been performed, so objects in *choices* should match " +"the type_ specified. This can make *choices* appear unfamiliar in usage, help, or error messages." msgstr "" +"توجه داشته باشید که *choices* پس از انجام هرگونه تبدیل type_ بررسی می‌شوند، بنابراین اشیاء موجود در *choices* باید با " +"type_ مشخص‌شده مطابقت داشته باشند. این موضوع می‌تواند باعث شود *choices* در نحوه استفاده، راهنما یا پیام‌های خطا ناآشنا " +"به نظر برسد." -msgid "To keep *choices* user-friendly, consider a custom type wrapper that converts and formats values, or omit type_ and handle conversion in your application code." +msgid "" +"To keep *choices* user-friendly, consider a custom type wrapper that converts and formats values, or omit type_ and " +"handle conversion in your application code." msgstr "" +"برای کاربرپسند نگه‌داشتن *choices*، پوششی سفارشی برای نوع در نظر بگیرید که مقادیر را تبدیل و قالب‌بندی می‌کند، یا type_ " +"را حذف کنید و تبدیل را در کد برنامه‌تان مدیریت کنید." -msgid "Formatted choices override the default *metavar* which is normally derived from *dest*. This is usually what you want because the user never sees the *dest* parameter. If this display isn't desirable (perhaps because there are many choices), just specify an explicit metavar_." +msgid "" +"Formatted choices override the default *metavar* which is normally derived from *dest*. This is usually what you want " +"because the user never sees the *dest* parameter. If this display isn't desirable (perhaps because there are many " +"choices), just specify an explicit metavar_." msgstr "" +"گزینه‌های قالب‌بندی‌شده به‌جای *metavar* پیش‌فرض، که معمولاً از *dest* مشتق می‌شود، استفاده می‌شوند. این معمولاً همان چیزی است " +"که شما می‌خواهید، زیرا کاربر هرگز پارامتر *dest* را نمی‌بیند. اگر این نمایش مطلوب نیست (شاید به این دلیل که گزینه‌های " +"زیادی وجود دارد)، کافی است یک metavar_ صریح مشخص کنید." msgid "required" -msgstr "" +msgstr "الزامی" -msgid "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and ``--bar`` indicate *optional* arguments, which can always be omitted at the command line. To make an option *required*, ``True`` can be specified for the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" +msgid "" +"In general, the :mod:`!argparse` module assumes that flags like ``-f`` and ``--bar`` indicate *optional* arguments, " +"which can always be omitted at the command line. To make an option *required*, ``True`` can be specified for the " +"``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" +"به‌طور کلی، ماژول :mod:`!argparse` فرض می‌کند که پرچم‌هایی مانند ``-f`` و ``--bar`` نشان‌دهنده‌ی آرگومان‌های *اختیاری* هستند " +"که همیشه می‌توان در خط فرمان از آن‌ها صرف‌نظر کرد. برای *الزامی* کردن یک گزینه، می‌توان ``True`` را برای آرگومان " +"کلیدواژه‌ای ``required=`` در :meth:`~ArgumentParser.add_argument` مشخص کرد::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1072,21 +1958,46 @@ msgid "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', required=True)\n" +">>> parser.parse_args(['--foo', 'BAR'])\n" +"Namespace(foo='BAR')\n" +">>> parser.parse_args([])\n" +"usage: [-h] --foo FOO\n" +": error: the following arguments are required: --foo" -msgid "As the example shows, if an option is marked as ``required``, :meth:`~ArgumentParser.parse_args` will report an error if that option is not present at the command line." +msgid "" +"As the example shows, if an option is marked as ``required``, :meth:`~ArgumentParser.parse_args` will report an error " +"if that option is not present at the command line." msgstr "" +"همان‌طور که مثال نشان می‌دهد، اگر یک گزینه به‌عنوان ``required`` علامت‌گذاری شده باشد، :meth:`~ArgumentParser.parse_args` " +"در صورتی که آن گزینه در خط فرمان وجود نداشته باشد، خطایی گزارش خواهد کرد." -msgid "Required options are generally considered bad form because users expect *options* to be *optional*, and thus they should be avoided when possible." +msgid "" +"Required options are generally considered bad form because users expect *options* to be *optional*, and thus they " +"should be avoided when possible." msgstr "" +"گزینه‌های الزامی عموماً نامناسب تلقی می‌شوند، زیرا کاربران انتظار دارند *گزینه‌ها* *اختیاری* باشند؛ بنابراین باید در صورت " +"امکان از آن‌ها اجتناب شود." msgid "help" -msgstr "" +msgstr "راهنما" -msgid "The ``help`` value is a string containing a brief description of the argument. When a user requests help (usually by using ``-h`` or ``--help`` at the command line), these ``help`` descriptions will be displayed with each argument." +msgid "" +"The ``help`` value is a string containing a brief description of the argument. When a user requests help (usually by " +"using ``-h`` or ``--help`` at the command line), these ``help`` descriptions will be displayed with each argument." msgstr "" +"مقدار ``help`` یک رشته است که شامل توضیحی مختصر در مورد آرگومان می‌شود. هنگامی که کاربر درخواست راهنما می‌کند (معمولاً با " +"استفاده از ``-h`` یا ``--help`` در خط فرمان)، این توضیحات ``help`` همراه با هر آرگومان نمایش داده خواهند شد." -msgid "The ``help`` strings can include various format specifiers to avoid repetition of things like the program name or the argument default_. The available specifiers include the program name, ``%(prog)s`` and most keyword arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, ``%(type)s``, etc.::" +msgid "" +"The ``help`` strings can include various format specifiers to avoid repetition of things like the program name or the " +"argument default_. The available specifiers include the program name, ``%(prog)s`` and most keyword arguments " +"to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, ``%(type)s``, etc.::" msgstr "" +"رشته‌های ``help`` می‌توانند شامل مشخص‌کننده‌های قالب مختلفی باشند تا از تکرار مواردی مانند نام برنامه یا default_ آرگومان " +"جلوگیری شود. مشخص‌کننده‌های موجود شامل نام برنامه، ``%(prog)s`` و بیشتر آرگومان‌های " +"کلیدواژه‌ای :meth:`~ArgumentParser.add_argument` هستند، برای مثال ``%(default)s``، ``%(type)s`` و غیره.::" msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" @@ -1101,12 +2012,31 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" +"... help='the bar to %(prog)s (default: %(default)s)')\n" +">>> parser.print_help()\n" +"usage: frobble [-h] [bar]\n" +"\n" +"positional arguments:\n" +" bar the bar to frobble (default: 42)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" -msgid "As the help string supports %-formatting, if you want a literal ``%`` to appear in the help string, you must escape it as ``%%``." +msgid "" +"As the help string supports %-formatting, if you want a literal ``%`` to appear in the help string, you must escape it " +"as ``%%``." msgstr "" +"از آن‌جا که رشته راهنما از قالب‌بندی % پشتیبانی می‌کند، اگر می‌خواهید یک ``%`` به‌صورت تحت‌اللفظی در رشته راهنما ظاهر شود، " +"باید آن را به‌صورت ``%%`` خنثی کنید." -msgid ":mod:`!argparse` supports silencing the help entry for certain options, by setting the ``help`` value to ``argparse.SUPPRESS``::" +msgid "" +":mod:`!argparse` supports silencing the help entry for certain options, by setting the ``help`` value to " +"``argparse.SUPPRESS``::" msgstr "" +":mod:`!argparse` از پنهان کردن ورودی راهنما برای برخی گزینه‌ها، با تنظیم مقدار ``help`` بر روی ``argparse.SUPPRESS`` " +"پشتیبانی می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" @@ -1117,12 +2047,30 @@ msgid "" "options:\n" " -h, --help show this help message and exit" msgstr "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" +">>> parser.print_help()\n" +"usage: frobble [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" msgid "metavar" -msgstr "" +msgstr "metavar" -msgid "When :class:`ArgumentParser` generates help messages, it needs some way to refer to each expected argument. By default, :class:`!ArgumentParser` objects use the dest_ value as the \"name\" of each object. By default, for positional argument actions, the dest_ value is used directly, and for optional argument actions, the dest_ value is uppercased. So, a single positional argument with ``dest='bar'`` will be referred to as ``bar``. A single optional argument ``--foo`` that should be followed by a single command-line argument will be referred to as ``FOO``. An example::" +msgid "" +"When :class:`ArgumentParser` generates help messages, it needs some way to refer to each expected argument. By " +"default, :class:`!ArgumentParser` objects use the dest_ value as the \"name\" of each object. By default, for " +"positional argument actions, the dest_ value is used directly, and for optional argument actions, the dest_ value is " +"uppercased. So, a single positional argument with ``dest='bar'`` will be referred to as ``bar``. A single optional " +"argument ``--foo`` that should be followed by a single command-line argument will be referred to as ``FOO``. An " +"example::" msgstr "" +"هنگامی که :class:`ArgumentParser` پیام‌های راهنما را تولید می‌کند، به روشی برای ارجاع به هر آرگومان مورد انتظار نیاز " +"دارد. به‌طور پیش‌فرض، اشیاء :class:`!ArgumentParser` از مقدار dest_ به‌عنوان «نام» هر شیء استفاده می‌کنند. به‌طور پیش‌فرض، " +"برای کنش‌های آرگومان‌های جایگاهی، مقدار dest_ مستقیماً استفاده می‌شود، و برای کنش‌های آرگومان‌های اختیاری، مقدار dest_ به " +"حروف بزرگ تبدیل می‌شود. بنابراین، یک آرگومان جایگاهی با ``dest='bar'``، ``bar`` نامیده می‌شود. یک آرگومان اختیاری ``--" +"foo`` که باید یک آرگومان خط فرمان به دنبال آن بیاید، ``FOO`` نامیده می‌شود. یک مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1140,9 +2088,23 @@ msgid "" " -h, --help show this help message and exit\n" " --foo FOO" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo FOO] bar\n" +"\n" +"positional arguments:\n" +" bar\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO" msgid "An alternative name can be specified with ``metavar``::" -msgstr "" +msgstr "می‌توان یک نام جایگزین را با ``metavar`` مشخص کرد::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1160,12 +2122,34 @@ msgid "" " -h, --help show this help message and exit\n" " --foo YYY" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', metavar='YYY')\n" +">>> parser.add_argument('bar', metavar='XXX')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo YYY] XXX\n" +"\n" +"positional arguments:\n" +" XXX\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo YYY" -msgid "Note that ``metavar`` only changes the *displayed* name - the name of the attribute on the :meth:`~ArgumentParser.parse_args` object is still determined by the dest_ value." +msgid "" +"Note that ``metavar`` only changes the *displayed* name - the name of the attribute on " +"the :meth:`~ArgumentParser.parse_args` object is still determined by the dest_ value." msgstr "" +"توجه داشته باشید که ``metavar`` فقط نام *نمایش‌داده‌شده* را تغییر می‌دهد — نام ویژگی در " +"شیء :meth:`~ArgumentParser.parse_args` همچنان توسط مقدار dest_ تعیین می‌شود." -msgid "Different values of ``nargs`` may cause the metavar to be used multiple times. Providing a tuple to ``metavar`` specifies a different display for each of the arguments::" +msgid "" +"Different values of ``nargs`` may cause the metavar to be used multiple times. Providing a tuple to ``metavar`` " +"specifies a different display for each of the arguments::" msgstr "" +"مقادیر مختلف ``nargs`` ممکن است باعث شود metavar چندین بار استفاده شود. ارائه یک تاپل به ``metavar`` نمایش متفاوتی را " +"برای هر یک از آرگومان‌ها مشخص می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1179,12 +2163,30 @@ msgid "" " -x X X\n" " --foo bar baz" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', nargs=2)\n" +">>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-x X X] [--foo bar baz]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -x X X\n" +" --foo bar baz" msgid "dest" -msgstr "" +msgstr "dest" -msgid "Most :class:`ArgumentParser` actions add some value as an attribute of the object returned by :meth:`~ArgumentParser.parse_args`. The name of this attribute is determined by the ``dest`` keyword argument of :meth:`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` is normally supplied as the first argument to :meth:`~ArgumentParser.add_argument`::" +msgid "" +"Most :class:`ArgumentParser` actions add some value as an attribute of the object returned " +"by :meth:`~ArgumentParser.parse_args`. The name of this attribute is determined by the ``dest`` keyword argument " +"of :meth:`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` is normally supplied as the first " +"argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" +"بیشتر کنش‌های :class:`ArgumentParser` مقداری را به‌عنوان ویژگی‌ای از شیء برگردانده‌شده " +"از :meth:`~ArgumentParser.parse_args` می‌افزایند. نام این ویژگی با آرگومان کلیدواژه‌ای ``dest`` " +"در :meth:`~ArgumentParser.add_argument` تعیین می‌شود. برای کنش‌های آرگومان‌های جایگاهی، ``dest`` معمولاً به‌عنوان اولین " +"آرگومان به :meth:`~ArgumentParser.add_argument` داده می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1192,9 +2194,22 @@ msgid "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['XXX'])\n" +"Namespace(bar='XXX')" -msgid "For optional argument actions, the value of ``dest`` is normally inferred from the option strings. :class:`ArgumentParser` generates the value of ``dest`` by taking the first long option string and stripping away the initial ``--`` string. If no long option strings were supplied, ``dest`` will be derived from the first short option string by stripping the initial ``-`` character. Any internal ``-`` characters will be converted to ``_`` characters to make sure the string is a valid attribute name. The examples below illustrate this behavior::" +msgid "" +"For optional argument actions, the value of ``dest`` is normally inferred from the option " +"strings. :class:`ArgumentParser` generates the value of ``dest`` by taking the first long option string and stripping " +"away the initial ``--`` string. If no long option strings were supplied, ``dest`` will be derived from the first " +"short option string by stripping the initial ``-`` character. Any internal ``-`` characters will be converted to " +"``_`` characters to make sure the string is a valid attribute name. The examples below illustrate this behavior::" msgstr "" +"برای کنش‌های آرگومان‌های اختیاری، مقدار ``dest`` معمولاً از رشته‌های گزینه استنباط می‌شود. :class:`ArgumentParser` مقدار " +"``dest`` را با گرفتن نخستین رشته‌ی گزینه‌ی بلند و حذف رشته‌ی ``--`` ابتدایی تولید می‌کند. اگر هیچ رشته‌ی گزینه‌ی بلندی ارائه نشده " +"باشد، ``dest`` با حذف نویسه‌ی ``-`` ابتدایی از نخستین رشته‌ی گزینه‌ی کوتاه به‌دست می‌آید. هر نویسه‌ی ``-`` داخلی به نویسه‌ی ``_`` " +"تبدیل می‌شود تا اطمینان حاصل شود که رشته یک نام ویژگی معتبر است. مثال‌های زیر این رفتار را نشان می‌دهند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1205,9 +2220,16 @@ msgid "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" +">>> parser.add_argument('-x', '-y')\n" +">>> parser.parse_args('-f 1 -x 2'.split())\n" +"Namespace(foo_bar='1', x='2')\n" +">>> parser.parse_args('--foo 1 -y 2'.split())\n" +"Namespace(foo_bar='1', x='2')" msgid "``dest`` allows a custom attribute name to be provided::" -msgstr "" +msgstr "``dest`` امکان ارائه‌ی یک نام ویژگی سفارشی را فراهم می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1215,15 +2237,35 @@ msgid "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', dest='bar')\n" +">>> parser.parse_args('--foo XXX'.split())\n" +"Namespace(bar='XXX')" -msgid "Multiple arguments may share the same ``dest``. By default, the value from the last such argument given on the command line wins. Use ``action='append'`` to collect values from all of them into a list instead. For conflicting *option strings* rather than ``dest`` names, see conflict_handler_." +msgid "" +"Multiple arguments may share the same ``dest``. By default, the value from the last such argument given on the " +"command line wins. Use ``action='append'`` to collect values from all of them into a list instead. For conflicting " +"*option strings* rather than ``dest`` names, see conflict_handler_." msgstr "" +"آرگومان‌های متعدد می‌توانند ``dest`` یکسانی داشته باشند. به‌صورت پیش‌فرض، مقدار آخرین آرگومان از این نوع که در خط فرمان " +"وارد شود، برنده می‌شود. در عوض، برای جمع‌آوری مقادیر همه‌ی آن‌ها در یک فهرست، از ``action='append'`` استفاده کنید. برای " +"*رشته‌های گزینه* دارای تعارض، نه نام‌های ``dest``، conflict_handler_ را ببینید." msgid "deprecated" -msgstr "" +msgstr "منسوخ" -msgid "During a project's lifetime, some arguments may need to be removed from the command line. Before removing them, you should inform your users that the arguments are deprecated and will be removed. The ``deprecated`` keyword argument of :meth:`~ArgumentParser.add_argument`, which defaults to ``False``, specifies if the argument is deprecated and will be removed in the future. For arguments, if ``deprecated`` is ``True``, then a warning will be printed to :data:`sys.stderr` when the argument is used::" +msgid "" +"During a project's lifetime, some arguments may need to be removed from the command line. Before removing them, you " +"should inform your users that the arguments are deprecated and will be removed. The ``deprecated`` keyword argument " +"of :meth:`~ArgumentParser.add_argument`, which defaults to ``False``, specifies if the argument is deprecated and will " +"be removed in the future. For arguments, if ``deprecated`` is ``True``, then a warning will be printed " +"to :data:`sys.stderr` when the argument is used::" msgstr "" +"در طول عمر یک پروژه، ممکن است نیاز باشد برخی آرگومان‌ها از خط فرمان حذف شوند. پیش از حذف آن‌ها، باید به کاربران خود " +"اطلاع دهید که آرگومان‌ها منسوخ شده‌اند و حذف خواهند شد. آرگومان کلیدواژه‌ای ``deprecated`` " +"در :meth:`~ArgumentParser.add_argument`، که مقدار پیش‌فرض آن ``False`` است، مشخص می‌کند که آیا آرگومان منسوخ است و در " +"آینده حذف خواهد شد یا خیر. برای آرگومان‌ها، اگر ``deprecated`` برابر ``True`` باشد، هنگام استفاده از آرگومان، هشداری " +"در :data:`sys.stderr` چاپ می‌شود::" msgid "" ">>> import argparse\n" @@ -1235,42 +2277,97 @@ msgid "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='snake.py')\n" +">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" +">>> parser.parse_args([])\n" +"Namespace(legs=0)\n" +">>> parser.parse_args(['--legs', '4'])\n" +"snake.py: warning: option '--legs' is deprecated\n" +"Namespace(legs=4)" msgid "Action classes" -msgstr "" +msgstr "کلاس‌های اکشن" -msgid ":class:`!Action` classes implement the Action API, a callable which returns a callable which processes arguments from the command-line. Any object which follows this API may be passed as the ``action`` parameter to :meth:`~ArgumentParser.add_argument`." +msgid "" +":class:`!Action` classes implement the Action API, a callable which returns a callable which processes arguments from " +"the command-line. Any object which follows this API may be passed as the ``action`` parameter " +"to :meth:`~ArgumentParser.add_argument`." msgstr "" +"کلاس‌های :class:`!Action`، Action API را پیاده‌سازی می‌کنند؛ یک فراخوان‌پذیر (callable) که یک فراخوان‌پذیر برای پردازش " +"آرگومان‌های خط فرمان بازمی‌گرداند. هر شیء‌ای که از این API پیروی کند، می‌تواند به‌عنوان پارامتر ``action`` " +"به :meth:`~ArgumentParser.add_argument` ارسال شود." -msgid ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent the information needed to parse a single argument from one or more strings from the command line. The :class:`!Action` class must accept the two positional arguments plus any keyword arguments passed to :meth:`ArgumentParser.add_argument` except for the ``action`` itself." +msgid "" +":class:`!Action` objects are used by an :class:`ArgumentParser` to represent the information needed to parse a single " +"argument from one or more strings from the command line. The :class:`!Action` class must accept the two positional " +"arguments plus any keyword arguments passed to :meth:`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" +"اشیای :class:`!Action` توسط یک :class:`ArgumentParser` برای نشان دادن اطلاعات مورد نیاز برای تجزیه‌ی یک آرگومان از یک یا " +"چند رشته از خط فرمان به کار می‌روند. کلاس :class:`!Action` باید دو آرگومان جایگاهی به‌همراه هر آرگومان کلیدواژه‌ای که " +"به :meth:`ArgumentParser.add_argument` ارسال می‌شود، به‌جز خود ``action``، بپذیرد." -msgid "Instances of :class:`!Action` (or return value of any callable to the ``action`` parameter) should have attributes :attr:`!dest`, :attr:`!option_strings`, :attr:`!default`, :attr:`!type`, :attr:`!required`, :attr:`!help`, etc. defined. The easiest way to ensure these attributes are defined is to call :meth:`!Action.__init__`." +msgid "" +"Instances of :class:`!Action` (or return value of any callable to the ``action`` parameter) should have " +"attributes :attr:`!dest`, :attr:`!option_strings`, :attr:`!default`, :attr:`!type`, :attr:`!required`, :attr:`!help`, " +"etc. defined. The easiest way to ensure these attributes are defined is to call :meth:`!Action.__init__`." msgstr "" +"در نمونه‌های :class:`!Action` (یا مقدار بازگشتی هر فراخوانی‌پذیر که به پارامتر ``action`` داده شود) باید " +"ویژگی‌های :attr:`!dest`، :attr:`!option_strings`، :attr:`!default`، :attr:`!type`، :attr:`!required`، :attr:`!help` و " +"غیره تعریف‌شده باشند. ساده‌ترین راه برای اطمینان از تعریف این ویژگی‌ها، فراخوانی :meth:`!Action.__init__` است." -msgid ":class:`!Action` instances should be callable, so subclasses must override the :meth:`!__call__` method, which should accept four parameters:" +msgid "" +":class:`!Action` instances should be callable, so subclasses must override the :meth:`!__call__` method, which should " +"accept four parameters:" msgstr "" +"نمونه‌های :class:`!Action` باید قابل فراخوانی باشند، بنابراین زیرکلاس‌ها باید متد :meth:`!__call__` را بازنویسی کنند، که " +"باید چهار پارامتر بپذیرد:" msgid "*parser* - The :class:`ArgumentParser` object which contains this action." -msgstr "" +msgstr "*parser* - شیء :class:`ArgumentParser` که شامل این اکشناست." -msgid "*namespace* - The :class:`Namespace` object that will be returned by :meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this object using :func:`setattr`." +msgid "" +"*namespace* - The :class:`Namespace` object that will be returned by :meth:`~ArgumentParser.parse_args`. Most actions " +"add an attribute to this object using :func:`setattr`." msgstr "" +"*فضای نام* - شیء :class:`Namespace` که توسط :meth:`~ArgumentParser.parse_args` بازگردانده می‌شود. بیشتر اقدام‌ها با " +"استفاده از :func:`setattr` یک ویژگی به این شیء اضافه می‌کنند." -msgid "*values* - The associated command-line arguments, with any type conversions applied. Type conversions are specified with the type_ keyword argument to :meth:`~ArgumentParser.add_argument`." +msgid "" +"*values* - The associated command-line arguments, with any type conversions applied. Type conversions are specified " +"with the type_ keyword argument to :meth:`~ArgumentParser.add_argument`." msgstr "" +"*values* - آرگومان‌های مرتبط با خط فرمان، با هرگونه تبدیل نوع اعمال‌شده. تبدیل‌های نوع با آرگومان کلیدواژه‌ای type_ " +"در :meth:`~ArgumentParser.add_argument` مشخص می‌شوند." -msgid "*option_string* - The option string that was used to invoke this action. The ``option_string`` argument is optional, and will be absent if the action is associated with a positional argument." +msgid "" +"*option_string* - The option string that was used to invoke this action. The ``option_string`` argument is optional, " +"and will be absent if the action is associated with a positional argument." msgstr "" +"*option_string* - رشته‌ی گزینه‌ای که برای فراخوانی این عمل استفاده شده است. آرگومان ``option_string`` اختیاری است و اگر " +"عمل با یک آرگومان جایگاهی مرتبط باشد، وجود نخواهد داشت." -msgid "The :meth:`!__call__` method may perform arbitrary actions, but will typically set attributes on the ``namespace`` based on ``dest`` and ``values``." +msgid "" +"The :meth:`!__call__` method may perform arbitrary actions, but will typically set attributes on the ``namespace`` " +"based on ``dest`` and ``values``." msgstr "" +"متد :meth:`!__call__` ممکن است عملیات دلخواهی انجام دهد، اما معمولاً ویژگی‌هایی را روی ``namespace`` بر اساس ``dest`` و " +"``values`` تنظیم می‌کند." -msgid ":class:`!Action` subclasses can define a :meth:`!format_usage` method that takes no argument and return a string which will be used when printing the usage of the program. If such method is not provided, a sensible default will be used." +msgid "" +":class:`!Action` subclasses can define a :meth:`!format_usage` method that takes no argument and return a string which " +"will be used when printing the usage of the program. If such method is not provided, a sensible default will be used." msgstr "" +"زیرکلاس‌های :class:`!Action` می‌توانند یک متد :meth:`!format_usage` تعریف کنند که هیچ آرگومانی نمی‌گیرد و رشته‌ای را " +"برمی‌گرداند که هنگام چاپ کاربرد برنامه استفاده خواهد شد. اگر چنین متدی ارائه نشود، از یک پیش‌فرض مناسب استفاده خواهد شد." -msgid "A subclass of :class:`Action` for handling boolean flags with positive and negative options. Adding a single argument such as ``--foo`` automatically creates both ``--foo`` and ``--no-foo`` options, storing ``True`` and ``False`` respectively::" +msgid "" +"A subclass of :class:`Action` for handling boolean flags with positive and negative options. Adding a single argument " +"such as ``--foo`` automatically creates both ``--foo`` and ``--no-foo`` options, storing ``True`` and ``False`` " +"respectively::" msgstr "" +"زیرکلاسی از :class:`Action` برای مدیریت پرچم‌های بولی با گزینه‌های مثبت و منفی. افزودن یک آرگومان مانند ``--foo`` به‌طور " +"خودکار هر دو گزینه‌ی ``--foo`` و ``--no-foo`` را ایجاد می‌کند که به‌ترتیب ``True`` و ``False`` را ذخیره می‌کنند::" msgid "" ">>> import argparse\n" @@ -1279,27 +2376,41 @@ msgid "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" msgid "The parse_args() method" -msgstr "" +msgstr "متد parse_args()" -msgid "Convert argument strings to objects and assign them as attributes of the namespace. Return the populated namespace." -msgstr "" +msgid "" +"Convert argument strings to objects and assign them as attributes of the namespace. Return the populated namespace." +msgstr "رشته‌های آرگومان را به شیء تبدیل کنید و آن‌ها را به‌عنوان ویژگی‌های فضای نام اختصاص دهید. فضای نام پرشده را برگردانید." -msgid "Previous calls to :meth:`add_argument` determine exactly what objects are created and how they are assigned. See the documentation for :meth:`!add_argument` for details." +msgid "" +"Previous calls to :meth:`add_argument` determine exactly what objects are created and how they are assigned. See the " +"documentation for :meth:`!add_argument` for details." msgstr "" +"فراخوانی‌های قبلی به :meth:`add_argument` دقیقاً تعیین می‌کنند که چه اشیایی ایجاد می‌شوند و چگونه اختصاص داده می‌شوند. برای " +"جزئیات، مستندات :meth:`!add_argument` را ببینید." msgid "args_ - List of strings to parse. The default is taken from :data:`sys.argv`." -msgstr "" +msgstr "args_ - فهرستی از رشته‌ها برای تجزیه. مقدار پیش‌فرض از :data:`sys.argv` گرفته می‌شود." msgid "namespace_ - An object to take the attributes. The default is a new empty :class:`Namespace` object." -msgstr "" +msgstr "namespace_ - شیءای که ویژگی‌ها را دریافت می‌کند. پیش‌فرض یک شیء :class:`Namespace` جدید و خالی است." msgid "Option value syntax" -msgstr "" +msgstr "نحو مقدار گزینه" -msgid "The :meth:`~ArgumentParser.parse_args` method supports several ways of specifying the value of an option (if it takes one). In the simplest case, the option and its value are passed as two separate arguments::" +msgid "" +"The :meth:`~ArgumentParser.parse_args` method supports several ways of specifying the value of an option (if it takes " +"one). In the simplest case, the option and its value are passed as two separate arguments::" msgstr "" +"متد :meth:`~ArgumentParser.parse_args` از چندین روش برای تعیین مقدار یک گزینه (در صورتی که مقداری بپذیرد) پشتیبانی " +"می‌کند. در ساده‌ترین حالت، گزینه و مقدار آن به‌عنوان دو آرگومان جداگانه ارسال می‌شوند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1310,25 +2421,44 @@ msgid "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(['-x', 'X'])\n" +"Namespace(foo=None, x='X')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"Namespace(foo='FOO', x=None)" -msgid "For long options (options with names longer than a single character), the option and value can also be passed as a single command-line argument, using ``=`` to separate them::" +msgid "" +"For long options (options with names longer than a single character), the option and value can also be passed as a " +"single command-line argument, using ``=`` to separate them::" msgstr "" +"برای گزینه‌های بلند (گزینه‌هایی با نام‌هایی طولانی‌تر از یک نویسه)، می‌توان گزینه و مقدار را به‌عنوان یک آرگومان خط فرمان " +"واحد نیز ارسال کرد و برای جداسازی آن‌ها از ``=`` استفاده کرد::" msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" msgstr "" +">>> parser.parse_args(['--foo=FOO'])\n" +"Namespace(foo='FOO', x=None)" msgid "For short options (options only one character long), the option and its value can be concatenated::" -msgstr "" +msgstr "برای گزینه‌های کوتاه (گزینه‌هایی که فقط یک نویسه طول دارند)، می‌توان گزینه و مقدار آن را به‌هم چسباند::" msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" msgstr "" +">>> parser.parse_args(['-xX'])\n" +"Namespace(foo=None, x='X')" -msgid "Several short options can be joined together, using only a single ``-`` prefix, as long as only the last option (or none of them) requires a value::" +msgid "" +"Several short options can be joined together, using only a single ``-`` prefix, as long as only the last option (or " +"none of them) requires a value::" msgstr "" +"می‌توان چند گزینه کوتاه را با استفاده از تنها یک پیشوند ``-`` با هم ترکیب کرد، مشروط بر اینکه فقط آخرین گزینه (یا " +"هیچ‌کدام از آن‌ها) نیازمند مقدار باشد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1338,12 +2468,24 @@ msgid "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', action='store_true')\n" +">>> parser.add_argument('-y', action='store_true')\n" +">>> parser.add_argument('-z')\n" +">>> parser.parse_args(['-xyzZ'])\n" +"Namespace(x=True, y=True, z='Z')" msgid "Invalid arguments" -msgstr "" +msgstr "آرگومان‌های نامعتبر" -msgid "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks for a variety of errors, including ambiguous options, invalid types, invalid options, wrong number of positional arguments, etc. When it encounters such an error, it exits and prints the error along with a usage message::" +msgid "" +"While parsing the command line, :meth:`~ArgumentParser.parse_args` checks for a variety of errors, including ambiguous " +"options, invalid types, invalid options, wrong number of positional arguments, etc. When it encounters such an error, " +"it exits and prints the error along with a usage message::" msgstr "" +"هنگام تجزیه خط فرمان، :meth:`~ArgumentParser.parse_args` خطاهای مختلفی را بررسی می‌کند، از جمله گزینه‌های مبهم، انواع " +"نامعتبر، گزینه‌های نامعتبر، تعداد نادرست آرگومان‌های جایگاهی و غیره. هنگامی که با چنین خطایی مواجه می‌شود، خارج می‌شود و " +"خطا را به همراه پیام کاربرد چاپ می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1365,12 +2507,39 @@ msgid "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', nargs='?')\n" +"\n" +">>> # invalid type\n" +">>> parser.parse_args(['--foo', 'spam'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: argument --foo: invalid int value: 'spam'\n" +"\n" +">>> # invalid option\n" +">>> parser.parse_args(['--bar'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: no such option: --bar\n" +"\n" +">>> # wrong number of arguments\n" +">>> parser.parse_args(['spam', 'badger'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: extra arguments found: badger" msgid "Arguments containing ``-``" -msgstr "" +msgstr "آرگومان‌های شامل ``-``" -msgid "The :meth:`~ArgumentParser.parse_args` method attempts to give errors whenever the user has clearly made a mistake, but some situations are inherently ambiguous. For example, the command-line argument ``-1`` could either be an attempt to specify an option or an attempt to provide a positional argument. The :meth:`~ArgumentParser.parse_args` method is cautious here: positional arguments may only begin with ``-`` if they look like negative numbers and there are no options in the parser that look like negative numbers::" +msgid "" +"The :meth:`~ArgumentParser.parse_args` method attempts to give errors whenever the user has clearly made a mistake, " +"but some situations are inherently ambiguous. For example, the command-line argument ``-1`` could either be an " +"attempt to specify an option or an attempt to provide a positional argument. The :meth:`~ArgumentParser.parse_args` " +"method is cautious here: positional arguments may only begin with ``-`` if they look like negative numbers and there " +"are no options in the parser that look like negative numbers::" msgstr "" +"متد :meth:`~ArgumentParser.parse_args` تلاش می‌کند هرگاه کاربر به‌وضوح اشتباهی مرتکب شده باشد، خطا گزارش کند، اما برخی " +"موقعیت‌ها ذاتاً مبهم هستند. برای مثال، آرگومان خط فرمان ``-1`` می‌تواند تلاشی برای مشخص کردن یک گزینه یا تلاشی برای ارائه " +"یک آرگومان جایگاهی باشد. متد :meth:`~ArgumentParser.parse_args` در اینجا محتاط است: آرگومان‌های جایگاهی تنها در صورتی " +"می‌توانند با ``-`` شروع شوند که شبیه اعداد منفی باشند و هیچ گزینه‌ای در پارسر وجود نداشته باشد که شبیه اعداد منفی باشد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1403,23 +2572,64 @@ msgid "" "usage: PROG [-h] [-1 ONE] [foo]\n" "PROG: error: argument -1: expected one argument" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # no negative number options, so -1 is a positional argument\n" +">>> parser.parse_args(['-x', '-1'])\n" +"Namespace(foo=None, x='-1')\n" +"\n" +">>> # no negative number options, so -1 and -5 are positional arguments\n" +">>> parser.parse_args(['-x', '-1', '-5'])\n" +"Namespace(foo='-5', x='-1')\n" +"\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-1', dest='one')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # negative number options present, so -1 is an option\n" +">>> parser.parse_args(['-1', 'X'])\n" +"Namespace(foo=None, one='X')\n" +"\n" +">>> # negative number options present, so -2 is an option\n" +">>> parser.parse_args(['-2'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: no such option: -2\n" +"\n" +">>> # negative number options present, so both -1s are options\n" +">>> parser.parse_args(['-1', '-1'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: argument -1: expected one argument" -msgid "If you have positional arguments that must begin with ``-`` and don't look like negative numbers, you can insert the pseudo-argument ``'--'`` which tells :meth:`~ArgumentParser.parse_args` that everything after that is a positional argument::" +msgid "" +"If you have positional arguments that must begin with ``-`` and don't look like negative numbers, you can insert the " +"pseudo-argument ``'--'`` which tells :meth:`~ArgumentParser.parse_args` that everything after that is a positional " +"argument::" msgstr "" +"اگر آرگومان‌های جایگاهی دارید که باید با ``-`` شروع شوند و شبیه اعداد منفی نیستند، می‌توانید شبه‌آرگومان ``'--'`` را درج " +"کنید که به :meth:`~ArgumentParser.parse_args` می‌گوید هرچه پس از آن می‌آید آرگومان جایگاهی است::" msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" msgstr "" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(foo='-f', one=None)" msgid "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" +"برای جزئیات بیشتر، :ref:`راهنمای argparse درباره آرگومان‌های مبهم ` را نیز ببینید." msgid "Argument abbreviations (prefix matching)" -msgstr "" +msgstr "مخفف‌های آرگومان (تطبیق پیشوند)" -msgid "The :meth:`~ArgumentParser.parse_args` method :ref:`by default ` allows long options to be abbreviated to a prefix, if the abbreviation is unambiguous (the prefix matches a unique option)::" +msgid "" +"The :meth:`~ArgumentParser.parse_args` method :ref:`by default ` allows long options to be abbreviated " +"to a prefix, if the abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" +"متد :meth:`~ArgumentParser.parse_args` :ref:`به‌طور پیش‌فرض ` اجازه می‌دهد گزینه‌های بلند به یک پیشوند " +"اختصار یابند، اگر اختصار مبهم نباشد (پیشوند با یک گزینه‌ی یکتا مطابقت داشته باشد)::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1433,15 +2643,34 @@ msgid "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-bacon')\n" +">>> parser.add_argument('-badger')\n" +">>> parser.parse_args('-bac MMM'.split())\n" +"Namespace(bacon='MMM', badger=None)\n" +">>> parser.parse_args('-bad WOOD'.split())\n" +"Namespace(bacon=None, badger='WOOD')\n" +">>> parser.parse_args('-ba BA'.split())\n" +"usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" +"PROG: error: ambiguous option: -ba could match -badger, -bacon" -msgid "An error is produced for arguments that could produce more than one options. This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." +msgid "" +"An error is produced for arguments that could produce more than one options. This feature can be disabled by " +"setting :ref:`allow_abbrev` to ``False``." msgstr "" +"برای آرگومان‌هایی که ممکن است بیش از یک گزینه تولید کنند، خطایی تولید می‌شود. این قابلیت را می‌توان با تنظیم :ref:`allow_abbrev ` روی ``False`` غیرفعال کرد." msgid "Beyond ``sys.argv``" -msgstr "" +msgstr "فراتر از ``sys.argv``" -msgid "Sometimes it may be useful to have an :class:`ArgumentParser` parse arguments other than those of :data:`sys.argv`. This can be accomplished by passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is useful for testing at the interactive prompt::" +msgid "" +"Sometimes it may be useful to have an :class:`ArgumentParser` parse arguments other than those of :data:`sys.argv`. " +"This can be accomplished by passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is useful for " +"testing at the interactive prompt::" msgstr "" +"گاهی ممکن است مفید باشد که یک :class:`ArgumentParser` آرگومان‌هایی غیر از آرگومان‌های :data:`sys.argv` را تجزیه کند. این " +"کار را می‌توان با گذراندن فهرستی از رشته‌ها به :meth:`~ArgumentParser.parse_args` انجام داد. این برای آزمون در خط فرمان " +"تعاملی مفید است::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1456,15 +2685,34 @@ msgid "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\n" +"... 'integers', metavar='int', type=int, choices=range(10),\n" +"... nargs='+', help='an integer in the range 0..9')\n" +">>> parser.add_argument(\n" +"... '--sum', dest='accumulate', action='store_const', const=sum,\n" +"... default=max, help='sum the integers (default: find the max)')\n" +">>> parser.parse_args(['1', '2', '3', '4'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])\n" +">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])" msgid "The Namespace object" -msgstr "" +msgstr "شیء فضای نام" -msgid "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create an object holding attributes and return it." +msgid "" +"Simple class used by default by :meth:`~ArgumentParser.parse_args` to create an object holding attributes and return " +"it." msgstr "" +"کلاس ساده‌ای که به‌طور پیش‌فرض توسط :meth:`~ArgumentParser.parse_args` برای ایجاد یک شیء حاوی ویژگی‌ها و بازگرداندن آن " +"استفاده می‌شود." -msgid "This class is deliberately simple, just an :class:`object` subclass with a readable string representation. If you prefer to have dict-like view of the attributes, you can use the standard Python idiom, :func:`vars`::" +msgid "" +"This class is deliberately simple, just an :class:`object` subclass with a readable string representation. If you " +"prefer to have dict-like view of the attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" +"این کلاس عمداً ساده است؛ فقط یک زیرکلاس از :class:`object` با بازنمایی رشته‌ای خوانا است. اگر ترجیح می‌دهید نمایی " +"دیکشنری‌مانند از ویژگی‌ها داشته باشید، می‌توانید از الگوی استاندارد پایتون استفاده کنید: :func:`vars`::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1473,9 +2721,18 @@ msgid "" ">>> vars(args)\n" "{'foo': 'BAR'}" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> args = parser.parse_args(['--foo', 'BAR'])\n" +">>> vars(args)\n" +"{'foo': 'BAR'}" -msgid "It may also be useful to have an :class:`ArgumentParser` assign attributes to an already existing object, rather than a new :class:`Namespace` object. This can be achieved by specifying the ``namespace=`` keyword argument::" +msgid "" +"It may also be useful to have an :class:`ArgumentParser` assign attributes to an already existing object, rather than " +"a new :class:`Namespace` object. This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" +"همچنین ممکن است مفید باشد که یک :class:`ArgumentParser` ویژگی‌هایی را به یک شیء از پیش موجود اختصاص دهد، نه به یک " +"شیء :class:`Namespace` جدید. این کار را می‌توان با تعیین آرگومان کلیدواژه‌ای ``namespace=`` انجام داد::" msgid "" ">>> class C:\n" @@ -1488,48 +2745,89 @@ msgid "" ">>> c.foo\n" "'BAR'" msgstr "" +">>> class C:\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)\n" +">>> c.foo\n" +"'BAR'" msgid "Other utilities" -msgstr "" +msgstr "سایر ابزارها" msgid "Subcommands" -msgstr "" - -msgid "Many programs split up their functionality into a number of subcommands, for example, the ``svn`` program can invoke subcommands like ``svn checkout``, ``svn update``, and ``svn commit``. Splitting up functionality this way can be a particularly good idea when a program performs several different functions which require different kinds of command-line arguments. :class:`ArgumentParser` supports the creation of such subcommands with the :meth:`!add_subparsers` method. The :meth:`!add_subparsers` method is normally called with no arguments and returns a special action object. This object has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a command name and any :class:`!ArgumentParser` constructor arguments, and returns an :class:`!ArgumentParser` object that can be modified as usual." -msgstr "" +msgstr "زیرفرمان‌ها" + +msgid "" +"Many programs split up their functionality into a number of subcommands, for example, the ``svn`` program can invoke " +"subcommands like ``svn checkout``, ``svn update``, and ``svn commit``. Splitting up functionality this way can be a " +"particularly good idea when a program performs several different functions which require different kinds of command-" +"line arguments. :class:`ArgumentParser` supports the creation of such subcommands with the :meth:`!add_subparsers` " +"method. The :meth:`!add_subparsers` method is normally called with no arguments and returns a special action object. " +"This object has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a command name and any :class:`!" +"ArgumentParser` constructor arguments, and returns an :class:`!ArgumentParser` object that can be modified as usual." +msgstr "" +"بسیاری از برنامه‌ها قابلیت‌های خود را به تعدادی زیردستور تقسیم می‌کنند؛ برای مثال، برنامه‌ی ``svn`` می‌تواند زیردستورهایی " +"مانند ``svn checkout``، ``svn update`` و ``svn commit`` را فراخوانی کند. تقسیم قابلیت‌ها به این روش می‌تواند ایده‌ای " +"بسیار خوب باشد، به‌ویژه زمانی که یک برنامه چندین کارکرد مختلف انجام می‌دهد که به انواع مختلفی از آرگومان‌های خط فرمان " +"نیاز دارند. :class:`ArgumentParser` از ایجاد چنین زیردستورهایی با متد :meth:`!add_subparsers` پشتیبانی می‌کند. " +"متد :meth:`!add_subparsers` معمولاً بدون هیچ آرگومانی فراخوانی می‌شود و یک شیء عملیات ویژهبرمی‌گرداند. این شیء " +"تنها یک متد دارد، :meth:`~_SubParsersAction.add_parser`، که یک نام دستور و هرگونه آرگومان سازنده‌ی :class:`!" +"ArgumentParser` را دریافت می‌کند و یک شیء :class:`!ArgumentParser` برمی‌گرداند که می‌توان آن را مانند حالت معمول اصلاح " +"کرد." msgid "Description of parameters:" -msgstr "" +msgstr "توضیح پارامترها:" -msgid "*title* - title for the sub-parser group in help output; by default \"subcommands\" if description is provided, otherwise uses title for positional arguments" +msgid "" +"*title* - title for the sub-parser group in help output; by default \"subcommands\" if description is provided, " +"otherwise uses title for positional arguments" msgstr "" +"*title* - عنوان برای گروه زیرمفسر (sub-parser) در خروجی راهنما؛ به‌طور پیش‌فرض اگر توضیحات ارائه شده باشد، " +"\"subcommands\" خواهد بود، در غیر این صورت، از عنوان آرگومان‌های جایگاهی استفاده می‌شود" msgid "*description* - description for the sub-parser group in help output, by default ``None``" -msgstr "" +msgstr "*description* - توضیح برای گروه زیرپارسرها در خروجی راهنما، به‌طور پیش‌فرض ``None``" -msgid "*prog* - usage information that will be displayed with subcommand help, by default the name of the program and any positional arguments before the subparser argument" +msgid "" +"*prog* - usage information that will be displayed with subcommand help, by default the name of the program and any " +"positional arguments before the subparser argument" msgstr "" +"*prog* - اطلاعات استفاده‌ای که همراه با راهنمای زیردستور نمایش داده می‌شود، به‌طور پیش‌فرض نام برنامه و هر آرگومان جایگاهی " +"پیش از آرگومان زیرپارسر (subparser)" -msgid "*parser_class* - class which will be used to create sub-parser instances, by default the class of the current parser (e.g. :class:`ArgumentParser`)" +msgid "" +"*parser_class* - class which will be used to create sub-parser instances, by default the class of the current parser " +"(e.g. :class:`ArgumentParser`)" msgstr "" +"*parser_class* - کلاسی که برای ایجاد نمونه‌های زیرپارسر استفاده خواهد شد، به‌طور پیش‌فرض کلاس پارسر فعلی " +"(مثلاً :class:`ArgumentParser`)" msgid "action_ - the basic type of action to be taken when this argument is encountered at the command line" -msgstr "" +msgstr "action_ - نوع پایه‌ای اقدامی که باید هنگام مواجهه با این آرگومان در خط فرمان انجام شود" -msgid "dest_ - name of the attribute under which subcommand name will be stored; by default ``None`` and no value is stored" -msgstr "" +msgid "" +"dest_ - name of the attribute under which subcommand name will be stored; by default ``None`` and no value is stored" +msgstr "dest_ - نام ویژگی‌ای که نام زیردستور در آن ذخیره می‌شود؛ به‌طور پیش‌فرض ``None`` است و هیچ مقداری ذخیره نمی‌شود" msgid "required_ - Whether or not a subcommand must be provided, by default ``False`` (added in 3.7)" -msgstr "" +msgstr "required_ - اینکه آیا یک زیردستور باید ارائه شود یا خیر، به‌طور پیش‌فرض ``False`` (در 3.7 افزوده شده است)" msgid "help_ - help for sub-parser group in help output, by default ``None``" -msgstr "" +msgstr "help_ - راهنمای گروه زیرپارسرها در خروجی راهنما، به‌طور پیش‌فرض ``None``" -msgid "metavar_ - string presenting available subcommands in help; by default it is ``None`` and presents subcommands in form {cmd1, cmd2, ..}" +msgid "" +"metavar_ - string presenting available subcommands in help; by default it is ``None`` and presents subcommands in form " +"{cmd1, cmd2, ..}" msgstr "" +"metavar_ - رشته‌ای که زیردستورهای در دسترس را در راهنما نمایش می‌دهد؛ به‌طور پیش‌فرض ``None`` است و زیردستورها را در قالب " +"{cmd1, cmd2, ..} نمایش می‌دهد" msgid "Some example usage::" -msgstr "" +msgstr "چند نمونه کاربرد::" msgid "" ">>> # create the top-level parser\n" @@ -1551,17 +2849,82 @@ msgid "" ">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" "Namespace(baz='Z', foo=True)" msgstr "" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" +">>> subparsers = parser.add_subparsers(help='subcommand help')\n" +">>>\n" +">>> # create the parser for the \"a\" command\n" +">>> parser_a = subparsers.add_parser('a', help='a help')\n" +">>> parser_a.add_argument('bar', type=int, help='bar help')\n" +">>>\n" +">>> # create the parser for the \"b\" command\n" +">>> parser_b = subparsers.add_parser('b', help='b help')\n" +">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz help')\n" +">>>\n" +">>> # parse some argument lists\n" +">>> parser.parse_args(['a', '12'])\n" +"Namespace(bar=12, foo=False)\n" +">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" +"Namespace(baz='Z', foo=True)" -msgid "Note that the object returned by :meth:`parse_args` will only contain attributes for the main parser and the subparser that was selected by the command line (and not any other subparsers). So in the example above, when the ``a`` command is specified, only the ``foo`` and ``bar`` attributes are present, and when the ``b`` command is specified, only the ``foo`` and ``baz`` attributes are present." +msgid "" +"Note that the object returned by :meth:`parse_args` will only contain attributes for the main parser and the subparser " +"that was selected by the command line (and not any other subparsers). So in the example above, when the ``a`` command " +"is specified, only the ``foo`` and ``bar`` attributes are present, and when the ``b`` command is specified, only the " +"``foo`` and ``baz`` attributes are present." msgstr "" +"توجه داشته باشید که شیء برگردانده‌شده از :meth:`parse_args` فقط شامل ویژگی‌هایی برای پارسر اصلی و زیرپارسری خواهد " +"بود که از طریق خط فرمان انتخاب شده است (و نه هیچ زیرپارسر دیگری). بنابراین در مثال بالا، هنگامی که دستور ``a`` مشخص " +"شده باشد، فقط ویژگی‌های ``foo`` و ``bar`` وجود دارند، و هنگامی که دستور ``b`` مشخص شده باشد، فقط ویژگی‌های ``foo`` و " +"``baz`` وجود دارند." -msgid "If a subparser defines an argument with the same ``dest`` as the parent parser, the two share a single namespace attribute, so the parent's value won't be retained. Users should give them distinct ``dest`` values to keep both." +msgid "" +"If a subparser defines an argument with the same ``dest`` as the parent parser, the two share a single namespace " +"attribute, so the parent's value won't be retained. Users should give them distinct ``dest`` values to keep both." msgstr "" +"اگر یک زیرپارسر آرگومانی با همان ``dest`` پارسر والد تعریف کند، این دو یک ویژگی فضای نام واحد را به اشتراک می‌گذارند، " +"بنابراین مقدار پارسر والد حفظ نخواهد شد. کاربران باید برای آن‌ها مقادیر ``dest`` متمایزی تعیین کنند تا هر دو حفظ شوند." -msgid "Similarly, when a help message is requested from a subparser, only the help for that particular parser will be printed. The help message will not include parent parser or sibling parser messages. (A help message for each subparser command, however, can be given by supplying the ``help=`` argument to :meth:`~_SubParsersAction.add_parser` as above.)" +msgid "" +"Similarly, when a help message is requested from a subparser, only the help for that particular parser will be " +"printed. The help message will not include parent parser or sibling parser messages. (A help message for each " +"subparser command, however, can be given by supplying the ``help=`` argument to :meth:`~_SubParsersAction.add_parser` " +"as above.)" +msgstr "" +"به‌طور مشابه، هنگامی که یک پیام راهنما از یک زیرپارسر درخواست شود، فقط راهنمای همان پارسر خاص چاپ خواهد شد. پیام راهنما " +"شامل پیام‌های پارسر والد یا پارسرهای هم‌سطح نخواهد شد. (با این حال، می‌توان با ارائه آرگومان ``help=`` " +"به :meth:`~_SubParsersAction.add_parser` مانند بالا، یک پیام راهنما برای هر دستور زیرپارسر ارائه داد.)" + +msgid "" +">>> parser.parse_args(['--help'])\n" +"usage: PROG [-h] [--foo] {a,b} ...\n" +"\n" +"positional arguments:\n" +" {a,b} subcommand help\n" +" a a help\n" +" b b help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo foo help\n" +"\n" +">>> parser.parse_args(['a', '--help'])\n" +"usage: PROG a [-h] bar\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +">>> parser.parse_args(['b', '--help'])\n" +"usage: PROG b [-h] [--baz {X,Y,Z}]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --baz {X,Y,Z} baz help" msgstr "" - -msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" "\n" @@ -1589,10 +2952,13 @@ msgid "" "options:\n" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -msgstr "" -msgid "The :meth:`add_subparsers` method also supports ``title`` and ``description`` keyword arguments. When either is present, the subparser's commands will appear in their own group in the help output. For example::" +msgid "" +"The :meth:`add_subparsers` method also supports ``title`` and ``description`` keyword arguments. When either is " +"present, the subparser's commands will appear in their own group in the help output. For example::" msgstr "" +"متد :meth:`add_subparsers` همچنین از آرگومان‌های کلیدواژه‌ای ``title`` و ``description`` پشتیبانی می‌کند. هنگامی که هر یک " +"وجود داشته باشد، دستورات زیرپارسر (subparser) در گروه خودشان در خروجی راهنما ظاهر می‌شوند. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1612,9 +2978,30 @@ msgid "" "\n" " {foo,bar} additional help" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(title='subcommands',\n" +"... description='valid subcommands',\n" +"... help='additional help')\n" +">>> subparsers.add_parser('foo')\n" +">>> subparsers.add_parser('bar')\n" +">>> parser.parse_args(['-h'])\n" +"usage: [-h] {foo,bar} ...\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"subcommands:\n" +" valid subcommands\n" +"\n" +" {foo,bar} additional help" -msgid "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional *aliases* argument, which allows multiple strings to refer to the same subparser. This example, like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" +msgid "" +"Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional *aliases* argument, which allows multiple " +"strings to refer to the same subparser. This example, like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" msgstr "" +"علاوه بر این، :meth:`~_SubParsersAction.add_parser` از یک آرگومان اضافی *aliases* پشتیبانی می‌کند، که امکان می‌دهد چندین " +"رشته به یک زیرپارسر یکسان ارجاع داده شوند. این مثال، مانند ``svn``، نام مستعار ``co`` را به‌عنوان شکل کوتاهی برای " +"``checkout`` تعریف می‌کند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1624,12 +3011,27 @@ msgid "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers()\n" +">>> checkout = subparsers.add_parser('checkout', aliases=['co'])\n" +">>> checkout.add_argument('foo')\n" +">>> parser.parse_args(['co', 'bar'])\n" +"Namespace(foo='bar')" -msgid ":meth:`~_SubParsersAction.add_parser` supports also an additional *deprecated* argument, which allows to deprecate the subparser." +msgid "" +":meth:`~_SubParsersAction.add_parser` supports also an additional *deprecated* argument, which allows to deprecate the " +"subparser." msgstr "" +":meth:`~_SubParsersAction.add_parser` همچنین از یک آرگومان اضافی *deprecated* پشتیبانی می‌کند، که به شما امکان می‌دهد " +"زیرپارسر (subparser) را منسوخ کنید." -msgid "One particularly effective way of handling subcommands is to combine the use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so that each subparser knows which Python function it should execute. For example::" +msgid "" +"One particularly effective way of handling subcommands is to combine the use of the :meth:`add_subparsers` method with " +"calls to :meth:`set_defaults` so that each subparser knows which Python function it should execute. For example::" msgstr "" +"یک روش به‌ویژه مؤثر برای مدیریت زیردستورها، ترکیب استفاده از متد :meth:`add_subparsers` با " +"فراخوانی‌های :meth:`set_defaults` است، به‌طوری‌که هر زیرپارسر (subparser) بداند کدام تابع پایتون را باید اجرا کند. برای " +"مثال::" msgid "" ">>> # subcommand functions\n" @@ -1664,9 +3066,48 @@ msgid "" ">>> args.func(args)\n" "((XYZYX))" msgstr "" +">>> # subcommand functions\n" +">>> def foo(args):\n" +"... print(args.x * args.y)\n" +"...\n" +">>> def bar(args):\n" +"... print('((%s))' % args.z)\n" +"...\n" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(required=True)\n" +">>>\n" +">>> # create the parser for the \"foo\" command\n" +">>> parser_foo = subparsers.add_parser('foo')\n" +">>> parser_foo.add_argument('-x', type=int, default=1)\n" +">>> parser_foo.add_argument('y', type=float)\n" +">>> parser_foo.set_defaults(func=foo)\n" +">>>\n" +">>> # create the parser for the \"bar\" command\n" +">>> parser_bar = subparsers.add_parser('bar')\n" +">>> parser_bar.add_argument('z')\n" +">>> parser_bar.set_defaults(func=bar)\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('foo 1 -x 2'.split())\n" +">>> args.func(args)\n" +"2.0\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('bar XYZYX'.split())\n" +">>> args.func(args)\n" +"((XYZYX))" -msgid "This way, you can let :meth:`parse_args` do the job of calling the appropriate function after argument parsing is complete. Associating functions with actions like this is typically the easiest way to handle the different actions for each of your subparsers. However, if it is necessary to check the name of the subparser that was invoked, the ``dest`` keyword argument to the :meth:`add_subparsers` call will work::" +msgid "" +"This way, you can let :meth:`parse_args` do the job of calling the appropriate function after argument parsing is " +"complete. Associating functions with actions like this is typically the easiest way to handle the different actions " +"for each of your subparsers. However, if it is necessary to check the name of the subparser that was invoked, the " +"``dest`` keyword argument to the :meth:`add_subparsers` call will work::" msgstr "" +"به این ترتیب، می‌توانید اجازه دهید :meth:`parse_args` پس از تکمیل تجزیه آرگومان‌ها، کار فراخوانی تابع مناسب را انجام " +"دهد. مرتبط کردن توابع با کنش‌هایی مانند این، معمولاً ساده‌ترین راه برای مدیریت کنش‌های متفاوت هر یک از زیرپارسرهای شما " +"است. با این حال، اگر لازم باشد نام زیرپارسر فراخوانی‌شده بررسی شود، آرگومان کلیدواژه‌ای ``dest`` در " +"فراخوانی :meth:`add_subparsers` کار خواهد کرد::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1678,18 +3119,34 @@ msgid "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" +">>> subparser1 = subparsers.add_parser('1')\n" +">>> subparser1.add_argument('-x')\n" +">>> subparser2 = subparsers.add_parser('2')\n" +">>> subparser2.add_argument('y')\n" +">>> parser.parse_args(['2', 'frobble'])\n" +"Namespace(subparser_name='2', y='frobble')" msgid "New *required* keyword-only parameter." -msgstr "" +msgstr "پارامتر جدید *الزامی* فقط کلیدواژه‌ای." msgid "Subparser's *prog* is no longer affected by a custom usage message in the main parser." -msgstr "" +msgstr "*prog* زیرپارسر دیگر تحت تأثیر پیام کاربرد سفارشی در پارسر اصلی قرار نمی‌گیرد." msgid "FileType objects" -msgstr "" +msgstr "اشیای FileType" -msgid "The :class:`FileType` factory creates objects that can be passed to the type argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:`FileType` objects as their type will open command-line arguments as files with the requested modes, buffer sizes, encodings and error handling (see the :func:`open` function for more details)::" +msgid "" +"The :class:`FileType` factory creates objects that can be passed to the type argument " +"of :meth:`ArgumentParser.add_argument`. Arguments that have :class:`FileType` objects as their type will open command-" +"line arguments as files with the requested modes, buffer sizes, encodings and error handling (see the :func:`open` " +"function for more details)::" msgstr "" +"کارخانه‌ی :class:`FileType` اشیایی را ایجاد می‌کند که می‌توان آن‌ها را به آرگومان type " +"در :meth:`ArgumentParser.add_argument` ارسال کرد. آرگومان‌هایی که اشیای :class:`FileType` را به‌عنوان نوع خود دارند، " +"آرگومان‌های خط فرمان را به‌صورت فایل‌هایی با حالت‌ها، اندازه‌های بافر، کدگذاری‌ها و مدیریت خطای درخواستی باز می‌کنند (برای " +"جزئیات بیشتر، تابع :func:`open` را ببینید)::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1698,9 +3155,18 @@ msgid "" ">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" +">>> parser.add_argument('out', type=argparse.FileType('w', encoding='UTF-8'))\n" +">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" +"Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)" -msgid "FileType objects understand the pseudo-argument ``'-'`` and automatically convert this into :data:`sys.stdin` for readable :class:`FileType` objects and :data:`sys.stdout` for writable :class:`FileType` objects::" +msgid "" +"FileType objects understand the pseudo-argument ``'-'`` and automatically convert this into :data:`sys.stdin` for " +"readable :class:`FileType` objects and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" +"اشیاء FileType شبه‌آرگومان ``'-'`` را می‌شناسند و به‌طور خودکار آن را برای اشیاء :class:`FileType` قابل خواندن " +"به :data:`sys.stdin` و برای اشیاء :class:`FileType` قابل نوشتن به :data:`sys.stdout` تبدیل می‌کنند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1708,18 +3174,34 @@ msgid "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" +">>> parser.parse_args(['-'])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -msgid "If one argument uses *FileType* and then a subsequent argument fails, an error is reported but the file is not automatically closed. This can also clobber the output files. In this case, it would be better to wait until after the parser has run and then use the :keyword:`with`-statement to manage the files." +msgid "" +"If one argument uses *FileType* and then a subsequent argument fails, an error is reported but the file is not " +"automatically closed. This can also clobber the output files. In this case, it would be better to wait until after the " +"parser has run and then use the :keyword:`with`-statement to manage the files." msgstr "" +"اگر یکی از آرگومان‌ها از *FileType* استفاده کند و سپس آرگومان بعدی با شکست مواجه شود، خطایی گزارش می‌شود اما فایل به‌طور " +"خودکار بسته نمی‌شود. این موضوع همچنین می‌تواند فایل‌های خروجی را بازنویسی کند. در این حالت، بهتر است تا پایان اجرای پارسر " +"صبر کنید و سپس از دستور :keyword:`with` برای مدیریت فایل‌ها استفاده کنید." msgid "Added the *encoding* and *errors* parameters." -msgstr "" +msgstr "پارامترهای *encoding* و *errors* افزوده شدند." msgid "Argument groups" -msgstr "" +msgstr "گروه‌های آرگومان" -msgid "By default, :class:`ArgumentParser` groups command-line arguments into \"positional arguments\" and \"options\" when displaying help messages. When there is a better conceptual grouping of arguments than this default one, appropriate groups can be created using the :meth:`!add_argument_group` method::" +msgid "" +"By default, :class:`ArgumentParser` groups command-line arguments into \"positional arguments\" and \"options\" when " +"displaying help messages. When there is a better conceptual grouping of arguments than this default one, appropriate " +"groups can be created using the :meth:`!add_argument_group` method::" msgstr "" +"به‌طور پیش‌فرض، :class:`ArgumentParser` آرگومان‌های خط فرمان را هنگام نمایش پیام‌های راهنمایی به «آرگومان‌های جایگاهی» و " +"«گزینه‌ها» گروه‌بندی می‌کند. هرگاه گروه‌بندی مفهومی بهتری نسبت به این حالت پیش‌فرض برای آرگومان‌ها وجود داشته باشد، می‌توان " +"گروه‌های مناسب را با استفاده از متد :meth:`!add_argument_group` ایجاد کرد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" @@ -1733,9 +3215,28 @@ msgid "" " bar bar help\n" " --foo FOO foo help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group = parser.add_argument_group('group')\n" +">>> group.add_argument('--foo', help='foo help')\n" +">>> group.add_argument('bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO] bar\n" +"\n" +"group:\n" +" bar bar help\n" +" --foo FOO foo help" -msgid "The :meth:`add_argument_group` method returns an argument group object which has an :meth:`~ArgumentParser.add_argument` method just like a regular :class:`ArgumentParser`. When an argument is added to the group, the parser treats it just like a normal argument, but displays the argument in a separate group for help messages. The :meth:`!add_argument_group` method accepts *title* and *description* arguments which can be used to customize this display::" +msgid "" +"The :meth:`add_argument_group` method returns an argument group object which has " +"an :meth:`~ArgumentParser.add_argument` method just like a regular :class:`ArgumentParser`. When an argument is added " +"to the group, the parser treats it just like a normal argument, but displays the argument in a separate group for help " +"messages. The :meth:`!add_argument_group` method accepts *title* and *description* arguments which can be used to " +"customize this display::" msgstr "" +"متد :meth:`add_argument_group` یک شیء گروه آرگومان برمی‌گرداند که همانند یک :class:`ArgumentParser` معمولی، " +"متد :meth:`~ArgumentParser.add_argument` را دارد. هنگامی که آرگومانی به گروه اضافه می‌شود، پارسر با آن همانند یک " +"آرگومان عادی رفتار می‌کند، اما آن را در پیام‌های راهنمایی در گروهی جداگانه نمایش می‌دهد. متد :meth:`!add_argument_group` " +"آرگومان‌های *title* و *description* را می‌پذیرد که می‌توان از آن‌ها برای سفارشی‌سازی این نمایش استفاده کرد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" @@ -1756,27 +3257,62 @@ msgid "" "\n" " --bar BAR bar help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" +">>> group1.add_argument('foo', help='foo help')\n" +">>> group2 = parser.add_argument_group('group2', 'group2 description')\n" +">>> group2.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--bar BAR] foo\n" +"\n" +"group1:\n" +" group1 description\n" +"\n" +" foo foo help\n" +"\n" +"group2:\n" +" group2 description\n" +"\n" +" --bar BAR bar help" -msgid "The optional, keyword-only parameters argument_default_ and conflict_handler_ allow for finer-grained control of the behavior of the argument group. These parameters have the same meaning as in the :class:`ArgumentParser` constructor, but apply specifically to the argument group rather than the entire parser." +msgid "" +"The optional, keyword-only parameters argument_default_ and conflict_handler_ allow for finer-grained control of the " +"behavior of the argument group. These parameters have the same meaning as in the :class:`ArgumentParser` constructor, " +"but apply specifically to the argument group rather than the entire parser." msgstr "" +"پارامترهای اختیاری و فقط کلیدواژه‌ای argument_default_ و conflict_handler_ امکان کنترل دقیق‌تر رفتار گروه آرگومان را " +"فراهم می‌کنند. این پارامترها همان معنایی را دارند که در سازنده‌ی :class:`ArgumentParser` دارند، اما به‌طور خاص بر گروه " +"آرگومان اعمال می‌شوند، نه بر کل پارسر." -msgid "Note that any arguments not in your user-defined groups will end up back in the usual \"positional arguments\" and \"optional arguments\" sections." +msgid "" +"Note that any arguments not in your user-defined groups will end up back in the usual \"positional arguments\" and " +"\"optional arguments\" sections." msgstr "" +"توجه داشته باشید که هر آرگومانی که در گروه‌های تعریف‌شده توسط شما نباشد، در نهایت به بخش‌های معمول «آرگومان‌های جایگاهی» و " +"«آرگومان‌های اختیاری» بازمی‌گردد." msgid "Within each argument group, arguments are displayed in help output in the order in which they are added." -msgstr "" +msgstr "در هر گروه آرگومان، آرگومان‌ها در خروجی راهنما به همان ترتیبی که افزوده شده‌اند نمایش داده می‌شوند." -msgid "Calling :meth:`add_argument_group` on an argument group now raises an exception. This nesting was never supported, often failed to work correctly, and was unintentionally exposed through inheritance." +msgid "" +"Calling :meth:`add_argument_group` on an argument group now raises an exception. This nesting was never supported, " +"often failed to work correctly, and was unintentionally exposed through inheritance." msgstr "" +"فراخوانی :meth:`add_argument_group` بر روی یک گروه آرگومان اکنون استثنا پرتاب می‌کند. این تودرتوسازی هرگز پشتیبانی " +"نمی‌شد، اغلب به‌درستی کار نمی‌کرد و به‌طور غیرعمد از طریق ارث‌بری در دسترس قرار گرفته بود." msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." -msgstr "" +msgstr "ارسال prefix_chars_ به :meth:`add_argument_group` اکنون منسوخ شده است." msgid "Mutual exclusion" -msgstr "" +msgstr "انحصار متقابل" -msgid "Create a mutually exclusive group. :mod:`!argparse` will make sure that only one of the arguments in the mutually exclusive group was present on the command line::" +msgid "" +"Create a mutually exclusive group. :mod:`!argparse` will make sure that only one of the arguments in the mutually " +"exclusive group was present on the command line::" msgstr "" +"یک گروه با انحصار متقابل ایجاد کنید. :mod:`!argparse` تضمین می‌کند که تنها یکی از آرگومان‌های گروه با انحصار متقابل در " +"خط فرمان وجود داشته باشد::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1791,9 +3327,24 @@ msgid "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group()\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(bar=True, foo=True)\n" +">>> parser.parse_args(['--bar'])\n" +"Namespace(bar=False, foo=False)\n" +">>> parser.parse_args(['--foo', '--bar'])\n" +"usage: PROG [-h] [--foo | --bar]\n" +"PROG: error: argument --bar: not allowed with argument --foo" -msgid "The :meth:`add_mutually_exclusive_group` method also accepts a *required* argument, to indicate that at least one of the mutually exclusive arguments is required::" +msgid "" +"The :meth:`add_mutually_exclusive_group` method also accepts a *required* argument, to indicate that at least one of " +"the mutually exclusive arguments is required::" msgstr "" +"متد :meth:`add_mutually_exclusive_group` همچنین یک آرگومان *required* را می‌پذیرد، تا نشان دهد که حداقل یکی از " +"آرگومان‌های مانع‌الجمع الزامی است::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1804,9 +3355,22 @@ msgid "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group(required=True)\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] (--foo | --bar)\n" +"PROG: error: one of the arguments --foo --bar is required" -msgid "Note that currently mutually exclusive argument groups do not support the *title* and *description* arguments of :meth:`~ArgumentParser.add_argument_group`. However, a mutually exclusive group can be added to an argument group that has a title and description. For example::" +msgid "" +"Note that currently mutually exclusive argument groups do not support the *title* and *description* arguments " +"of :meth:`~ArgumentParser.add_argument_group`. However, a mutually exclusive group can be added to an argument group " +"that has a title and description. For example::" msgstr "" +"توجه داشته باشید که در حال حاضر گروه‌های آرگومان متقابلاً انحصاری از آرگومان‌های *title* و " +"*description*\\ِ :meth:`~ArgumentParser.add_argument_group` پشتیبانی نمی‌کنند. با این حال، می‌توان یک گروه متقابلاً انحصاری " +"را به یک گروه آرگومان که دارای عنوان و توضیحات است اضافه کرد. برای مثال::" msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1826,15 +3390,43 @@ msgid "" " --foo FOO foo help\n" " --bar BAR bar help" msgstr "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_argument_group('Group title', 'Group description')\n" +">>> exclusive_group = group.add_mutually_exclusive_group(required=True)\n" +">>> exclusive_group.add_argument('--foo', help='foo help')\n" +">>> exclusive_group.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] (--foo FOO | --bar BAR)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"Group title:\n" +" Group description\n" +"\n" +" --foo FOO foo help\n" +" --bar BAR bar help" -msgid "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` on a mutually exclusive group now raises an exception. This nesting was never supported, often failed to work correctly, and was unintentionally exposed through inheritance." +msgid "" +"Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` on a mutually exclusive group now raises an " +"exception. This nesting was never supported, often failed to work correctly, and was unintentionally exposed through " +"inheritance." msgstr "" +"فراخوانی :meth:`add_argument_group` یا :meth:`add_mutually_exclusive_group` روی یک گروه متقابلاً انحصاری اکنون استثنایی " +"پرتاب می‌کند. این تودرتوسازی هرگز پشتیبانی نمی‌شد، اغلب به‌درستی کار نمی‌کرد و به‌طور غیرعمد از طریق ارث‌بری در دسترس قرار " +"گرفته بود." msgid "Parser defaults" -msgstr "" +msgstr "پیش‌فرض‌های پارسر" -msgid "Most of the time, the attributes of the object returned by :meth:`parse_args` will be fully determined by inspecting the command-line arguments and the argument actions. :meth:`set_defaults` allows some additional attributes that are determined without any inspection of the command line to be added::" +msgid "" +"Most of the time, the attributes of the object returned by :meth:`parse_args` will be fully determined by inspecting " +"the command-line arguments and the argument actions. :meth:`set_defaults` allows some additional attributes that are " +"determined without any inspection of the command line to be added::" msgstr "" +"بیشتر اوقات، ویژگی‌های شیء برگردانده‌شده توسط :meth:`parse_args` به‌طور کامل با بررسی آرگومان‌های خط فرمان و کنش‌های " +"آرگومان تعیین می‌شوند. :meth:`set_defaults` اجازه می‌دهد برخی ویژگی‌های اضافی که بدون هیچ‌گونه بررسی خط فرمان تعیین " +"می‌شوند، اضافه شوند::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1843,9 +3435,19 @@ msgid "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', type=int)\n" +">>> parser.set_defaults(bar=42, baz='badger')\n" +">>> parser.parse_args(['736'])\n" +"Namespace(bar=42, baz='badger', foo=736)" -msgid "Note that defaults can be set at both the parser level using :meth:`set_defaults` and at the argument level using :meth:`add_argument`. If both are called for the same argument, the last default set for an argument is used::" +msgid "" +"Note that defaults can be set at both the parser level using :meth:`set_defaults` and at the argument level " +"using :meth:`add_argument`. If both are called for the same argument, the last default set for an argument is used::" msgstr "" +"توجه داشته باشید که پیش‌فرض‌ها را می‌توان هم در سطح پارسر با استفاده از :meth:`set_defaults` و هم در سطح آرگومان با " +"استفاده از :meth:`add_argument` تنظیم کرد. اگر هر دو برای یک آرگومان فراخوانی شوند، آخرین پیش‌فرض تنظیم‌شده برای آن " +"آرگومان استفاده می‌شود::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1854,12 +3456,25 @@ msgid "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='bar')\n" +">>> parser.set_defaults(foo='spam')\n" +">>> parser.parse_args([])\n" +"Namespace(foo='spam')" -msgid "Parser-level defaults can be particularly useful when working with multiple parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an example of this type." +msgid "" +"Parser-level defaults can be particularly useful when working with multiple parsers. See " +"the :meth:`~ArgumentParser.add_subparsers` method for an example of this type." msgstr "" +"پیش‌فرض‌های سطح پارسر می‌توانند به‌ویژه هنگام کار با چندین پارسر مفید باشند. برای دیدن نمونه‌ای از این نوع، به " +"متد :meth:`~ArgumentParser.add_subparsers` مراجعه کنید." -msgid "Get the default value for a namespace attribute, as set by either :meth:`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" +msgid "" +"Get the default value for a namespace attribute, as set by either :meth:`~ArgumentParser.add_argument` or " +"by :meth:`~ArgumentParser.set_defaults`::" msgstr "" +"دریافت مقدار پیش‌فرض برای یک ویژگی فضای نام، که توسط :meth:`~ArgumentParser.add_argument` " +"یا :meth:`~ArgumentParser.set_defaults` تنظیم شده است::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1867,36 +3482,68 @@ msgid "" ">>> parser.get_default('foo')\n" "'badger'" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='badger')\n" +">>> parser.get_default('foo')\n" +"'badger'" msgid "Printing help" -msgstr "" +msgstr "چاپ راهنما" -msgid "In most typical applications, :meth:`~ArgumentParser.parse_args` will take care of formatting and printing any usage or error messages. However, several formatting methods are available:" +msgid "" +"In most typical applications, :meth:`~ArgumentParser.parse_args` will take care of formatting and printing any usage " +"or error messages. However, several formatting methods are available:" msgstr "" +"در بیشتر برنامه‌های معمول، :meth:`~ArgumentParser.parse_args` قالب‌بندی و چاپ هرگونه پیام کاربرد یا خطا را بر عهده " +"می‌گیرد. با این حال، چندین متد قالب‌بندی در دسترس است:" -msgid "Print a brief description of how the :class:`ArgumentParser` should be invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is assumed." +msgid "" +"Print a brief description of how the :class:`ArgumentParser` should be invoked on the command line. If *file* is " +"``None``, :data:`sys.stdout` is assumed." msgstr "" +"توضیح کوتاهی درباره نحوه فراخوانی :class:`ArgumentParser` در خط فرمان چاپ می‌کند. اگر *file* برابر ``None`` " +"باشد، :data:`sys.stdout` در نظر گرفته می‌شود." -msgid "Print a help message, including the program usage and information about the arguments registered with the :class:`ArgumentParser`. If *file* is ``None``, :data:`sys.stdout` is assumed." +msgid "" +"Print a help message, including the program usage and information about the arguments registered with " +"the :class:`ArgumentParser`. If *file* is ``None``, :data:`sys.stdout` is assumed." msgstr "" +"یک پیام راهنما چاپ می‌کند، شامل نحوه استفاده از برنامه و اطلاعات درباره آرگومان‌های ثبت‌شده در :class:`ArgumentParser`. " +"اگر *file* برابر ``None`` باشد، :data:`sys.stdout` در نظر گرفته می‌شود." msgid "There are also variants of these methods that simply return a string instead of printing it:" -msgstr "" +msgstr "همچنین انواعی از این متدها وجود دارند که به‌جای چاپ کردن، صرفاً یک رشته را برمی‌گردانند:" -msgid "Return a string containing a brief description of how the :class:`ArgumentParser` should be invoked on the command line." -msgstr "" +msgid "" +"Return a string containing a brief description of how the :class:`ArgumentParser` should be invoked on the command " +"line." +msgstr "رشته‌ای حاوی توضیح مختصری درباره نحوه فراخوانی :class:`ArgumentParser` در خط فرمان برمی‌گرداند." -msgid "Return a string containing a help message, including the program usage and information about the arguments registered with the :class:`ArgumentParser`." +msgid "" +"Return a string containing a help message, including the program usage and information about the arguments registered " +"with the :class:`ArgumentParser`." msgstr "" +"رشته‌ای حاوی پیام راهنما، شامل نحوه استفاده از برنامه و اطلاعاتی درباره آرگومان‌های ثبت‌شده در :class:`ArgumentParser` " +"برمی‌گرداند." msgid "Partial parsing" -msgstr "" +msgstr "تجزیه جزئی" -msgid "Sometimes a script only needs to handle a specific set of command-line arguments, leaving any unrecognized arguments for another script or program. In these cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful." +msgid "" +"Sometimes a script only needs to handle a specific set of command-line arguments, leaving any unrecognized arguments " +"for another script or program. In these cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful." msgstr "" +"گاهی اوقات یک اسکریپت تنها نیاز دارد مجموعه‌ای مشخص از آرگومان‌های خط فرمان را مدیریت کند و هر آرگومان ناشناخته‌ای را " +"برای اسکریپت یا برنامه دیگری باقی بگذارد. در این موارد، متد :meth:`~ArgumentParser.parse_known_args` می‌تواند مفید باشد." -msgid "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it does not raise an error for extra, unrecognized arguments. Instead, it parses the known arguments and returns a two item tuple that contains the populated namespace and the list of any unrecognized arguments." +msgid "" +"This method works similarly to :meth:`~ArgumentParser.parse_args`, but it does not raise an error for extra, " +"unrecognized arguments. Instead, it parses the known arguments and returns a two item tuple that contains the " +"populated namespace and the list of any unrecognized arguments." msgstr "" +"این متد مشابه :meth:`~ArgumentParser.parse_args` عمل می‌کند، اما برای آرگومان‌های اضافی و ناشناخته خطایی پرتاب نمی‌کند. " +"در عوض، آرگومان‌های شناخته‌شده را تجزیه می‌کند و یک تاپل دو آیتمی برمی‌گرداند که شامل فضای نام مقداردهی‌شده و فهرستی از " +"آرگومان‌های ناشناخته است." msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1905,36 +3552,71 @@ msgid "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" +"(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -msgid ":ref:`Prefix matching ` rules apply to :meth:`~ArgumentParser.parse_known_args`. The parser may consume an option even if it's just a prefix of one of its known options, instead of leaving it in the remaining arguments list." +msgid "" +":ref:`Prefix matching ` rules apply to :meth:`~ArgumentParser.parse_known_args`. The parser may " +"consume an option even if it's just a prefix of one of its known options, instead of leaving it in the remaining " +"arguments list." msgstr "" +"قواعد :ref:`تطبیق پیشوندی ` بر :meth:`~ArgumentParser.parse_known_args` اعمال می‌شوند. پارسر ممکن " +"است گزینه‌ای را، حتی اگر فقط پیشوندی از یکی از گزینه‌های شناخته‌شده‌اش باشد، به‌جای باقی گذاشتن آن در فهرست آرگومان‌های " +"باقی‌مانده، مصرف کند." msgid "Customizing file parsing" -msgstr "" +msgstr "سفارشی‌سازی تجزیه فایل" -msgid "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword argument to the :class:`ArgumentParser` constructor) are read one argument per line. :meth:`convert_arg_line_to_args` can be overridden for fancier reading." +msgid "" +"Arguments that are read from a file (see the *fromfile_prefix_chars* keyword argument to the :class:`ArgumentParser` " +"constructor) are read one argument per line. :meth:`convert_arg_line_to_args` can be overridden for fancier reading." msgstr "" +"آرگومان‌هایی که از یک فایل خوانده می‌شوند (آرگومان کلیدواژه‌ای *fromfile_prefix_chars* در سازنده‌ی :class:`ArgumentParser` " +"را ببینید)، به‌صورت یک آرگومان در هر خط خوانده می‌شوند. می‌توان :meth:`convert_arg_line_to_args` را برای خواندن پیشرفته‌تر " +"بازنویسی کرد." -msgid "This method takes a single argument *arg_line* which is a string read from the argument file. It returns a list of arguments parsed from this string. The method is called once per line read from the argument file, in order." +msgid "" +"This method takes a single argument *arg_line* which is a string read from the argument file. It returns a list of " +"arguments parsed from this string. The method is called once per line read from the argument file, in order." msgstr "" +"این متد یک آرگومان واحد *arg_line* می‌گیرد که رشته‌ای خوانده‌شده از فایل آرگومان است. این متد فهرستی از آرگومان‌های " +"تجزیه‌شده از این رشته را برمی‌گرداند. این متد به ترتیب، یک بار به ازای هر خط خوانده‌شده از فایل آرگومان فراخوانی می‌شود." -msgid "A useful override of this method is one that treats each space-separated word as an argument. The following example demonstrates how to do this::" +msgid "" +"A useful override of this method is one that treats each space-separated word as an argument. The following example " +"demonstrates how to do this::" msgstr "" +"یک بازنویسی مفید از این متد، بازنویسی‌ای است که هر کلمه‌ی جداشده با فاصله را به‌عنوان یک آرگومان در نظر می‌گیرد. مثال زیر " +"نحوه‌ی انجام این کار را نشان می‌دهد::" msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" msgstr "" +"class MyArgumentParser(argparse.ArgumentParser):\n" +" def convert_arg_line_to_args(self, arg_line):\n" +" return arg_line.split()" -msgid "Note that with this override an argument can no longer contain spaces, since each space-separated word becomes a separate argument." +msgid "" +"Note that with this override an argument can no longer contain spaces, since each space-separated word becomes a " +"separate argument." msgstr "" +"توجه داشته باشید که با این بازنویسی (override)، آرگومان دیگر نمی‌تواند شامل فاصله باشد، زیرا هر کلمه‌ای که با فاصله جدا " +"شده باشد، به یک آرگومان جداگانه تبدیل می‌شود." msgid "Exiting methods" -msgstr "" +msgstr "متدهای خروج" -msgid "This method terminates the program, exiting with the specified *status* and, if given, it prints a *message* to :data:`sys.stderr` before that. The user can override this method to handle these steps differently::" +msgid "" +"This method terminates the program, exiting with the specified *status* and, if given, it prints a *message* " +"to :data:`sys.stderr` before that. The user can override this method to handle these steps differently::" msgstr "" +"این متد برنامه را با *status* مشخص خاتمه می‌دهد و در صورت ارائه شدن، پیش از آن یک *message* را در :data:`sys.stderr` " +"چاپ می‌کند. کاربر می‌تواند این متد را بازنویسی کند تا این مراحل به شکل متفاوتی مدیریت شوند::" msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" @@ -1943,21 +3625,46 @@ msgid "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" msgstr "" +"class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" +" def exit(self, status=0, message=None):\n" +" if status:\n" +" raise Exception(f'Exiting because of an error: {message}')\n" +" exit(status)" -msgid "This method prints a usage message, including the *message*, to :data:`sys.stderr` and terminates the program with a status code of 2." -msgstr "" +msgid "" +"This method prints a usage message, including the *message*, to :data:`sys.stderr` and terminates the program with a " +"status code of 2." +msgstr "این متد یک پیام کاربرد شامل *message* را در :data:`sys.stderr` چاپ می‌کند و برنامه را با کد وضعیت ۲ پایان می‌دهد." msgid "Intermixed parsing" -msgstr "" +msgstr "تجزیه درهم‌آمخته" -msgid "A number of Unix commands allow the user to intermix optional arguments with positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this parsing style." +msgid "" +"A number of Unix commands allow the user to intermix optional arguments with positional arguments. " +"The :meth:`~ArgumentParser.parse_intermixed_args` and :meth:`~ArgumentParser.parse_known_intermixed_args` methods " +"support this parsing style." msgstr "" +"تعدادی از دستورهای یونیکس به کاربر اجازه می‌دهند آرگومان‌های اختیاری را با آرگومان‌های جایگاهی در هم بیامیزد. " +"متدهای :meth:`~ArgumentParser.parse_intermixed_args` و :meth:`~ArgumentParser.parse_known_intermixed_args` از این سبک " +"تجزیه پشتیبانی می‌کنند." -msgid "These parsers do not support all the :mod:`!argparse` features, and will raise exceptions if unsupported features are used. In particular, subparsers, and mutually exclusive groups that include both optionals and positionals are not supported." +msgid "" +"These parsers do not support all the :mod:`!argparse` features, and will raise exceptions if unsupported features are " +"used. In particular, subparsers, and mutually exclusive groups that include both optionals and positionals are not " +"supported." msgstr "" +"این پارسرها از همه‌ی قابلیت‌های :mod:`!argparse` پشتیبانی نمی‌کنند و در صورت استفاده از قابلیت‌های پشتیبانی‌نشده، استثنا " +"پرتاب می‌کنند. به‌طور خاص، زیرپارسرها و گروه‌های متقابلاً انحصاری که شامل هر دو آرگومان اختیاری و جایگاهی هستند، پشتیبانی " +"نمی‌شوند." -msgid "The following example shows the difference between :meth:`~ArgumentParser.parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the former returns ``['2', '3']`` as unparsed arguments, while the latter collects all the positionals into ``rest``. ::" +msgid "" +"The following example shows the difference between :meth:`~ArgumentParser.parse_known_args` " +"and :meth:`~ArgumentParser.parse_intermixed_args`: the former returns ``['2', '3']`` as unparsed arguments, while the " +"latter collects all the positionals into ``rest``. ::" msgstr "" +"مثال زیر تفاوت میان :meth:`~ArgumentParser.parse_known_args` و :meth:`~ArgumentParser.parse_intermixed_args` را نشان " +"می‌دهد: اولی ``['2', '3']`` را به‌عنوان آرگومان‌های تجزیه‌نشده برمی‌گرداند، در حالی که دومی همه‌ی آرگومان‌های جایگاهی را در " +"``rest`` جمع می‌کند. ::" msgid "" ">>> parser = argparse.ArgumentParser()\n" @@ -1969,58 +3676,95 @@ msgid "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('cmd')\n" +">>> parser.add_argument('rest', nargs='*', type=int)\n" +">>> parser.parse_known_args('doit 1 --foo bar 2 3'.split())\n" +"(Namespace(cmd='doit', foo='bar', rest=[1]), ['2', '3'])\n" +">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" +"Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -msgid ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple containing the populated namespace and the list of remaining argument strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if there are any remaining unparsed argument strings." +msgid "" +":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple containing the populated namespace and " +"the list of remaining argument strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if there are any " +"remaining unparsed argument strings." msgstr "" +":meth:`~ArgumentParser.parse_known_intermixed_args` یک تاپل دو آیتمی شامل فضای نام پرشده و فهرست رشته‌های آرگومان " +"باقی‌مانده را برمی‌گرداند. :meth:`~ArgumentParser.parse_intermixed_args` اگر رشته‌های آرگومان تجزیه‌نشده‌ی باقی‌مانده‌ای وجود " +"داشته باشد، خطایی پرتاب می‌کند." msgid "Registering custom types or actions" -msgstr "" +msgstr "ثبت انواع سفارشی یا کنش‌های سفارشی (actions)" -msgid "Sometimes it's desirable to use a custom string in error messages to provide more user-friendly output. In these cases, :meth:`!register` can be used to register custom actions or types with a parser and allow you to reference the type by their registered name instead of their callable name." +msgid "" +"Sometimes it's desirable to use a custom string in error messages to provide more user-friendly output. In these " +"cases, :meth:`!register` can be used to register custom actions or types with a parser and allow you to reference the " +"type by their registered name instead of their callable name." msgstr "" +"گاهی اوقات مطلوب است که در پیام‌های خطا از یک رشته سفارشی استفاده شود تا خروجی کاربرپسندتری ارائه شود. در این " +"موارد، :meth:`!register` می‌تواند برای ثبت اقدام‌ها یا انواع سفارشی در یک پارسر استفاده شود و به شما امکان می‌دهد به " +"جای نام شیء قابل فراخوانی، به نوع با استفاده از نام ثبت‌شده‌ی آن ارجاع دهید." -msgid "The :meth:`!register` method accepts three arguments - a *registry_name*, specifying the internal registry where the object will be stored (e.g., ``action``, ``type``), *value*, which is the key under which the object will be registered, and object, the callable to be registered." +msgid "" +"The :meth:`!register` method accepts three arguments - a *registry_name*, specifying the internal registry where the " +"object will be stored (e.g., ``action``, ``type``), *value*, which is the key under which the object will be " +"registered, and object, the callable to be registered." msgstr "" +"متد :meth:`!register` سه آرگومان می‌پذیرد — *registry_name*، مشخص‌کننده‌ی رجیستری داخلی که شیء در آن ذخیره می‌شود (برای " +"مثال ``action``، ``type``)، *value*، که کلیدی است که شیء با آن ثبت می‌شود، و object، شیء قابل فراخوانی که باید ثبت شود." msgid "The following example shows how to register a custom type with a parser::" -msgstr "" +msgstr "مثال زیر نشان می‌دهد که چگونه می‌توان یک نوع سفارشی را در یک پارسر (parser) ثبت کرد::" msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" ">>> parser.add_argument('--foo', type='hexadecimal integer')\n" -"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, default=None, type='hexadecimal integer', choices=None, required=False, help=None, metavar=None, deprecated=False)\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, default=None, type='hexadecimal integer', " +"choices=None, required=False, help=None, metavar=None, deprecated=False)\n" ">>> parser.parse_args(['--foo', '0xFA'])\n" "Namespace(foo=250)\n" ">>> parser.parse_args(['--foo', '1.2'])\n" "usage: PROG [-h] [--foo FOO]\n" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" +">>> parser.add_argument('--foo', type='hexadecimal integer')\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, default=None, type='hexadecimal integer', " +"choices=None, required=False, help=None, metavar=None, deprecated=False)\n" +">>> parser.parse_args(['--foo', '0xFA'])\n" +"Namespace(foo=250)\n" +">>> parser.parse_args(['--foo', '1.2'])\n" +"usage: PROG [-h] [--foo FOO]\n" +"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "An error from creating or using an argument (optional or positional)." -msgstr "" +msgstr "خطایی ناشی از ایجاد یا استفاده از آرگومان (اختیاری یا جایگاهی)." msgid "The string value of this exception is the message, augmented with information about the argument that caused it." -msgstr "" +msgstr "مقدار رشته‌ای این استثنا، پیامی است که با اطلاعاتی درباره آرگومانی که باعث ایجاد آن شده، تکمیل‌شده است." msgid "Raised when something goes wrong converting a command line string to a type." -msgstr "" +msgstr "هنگامی که در تبدیل یک رشته‌ی خط فرمان به یک نوع، مشکلی پیش بیاید، پرتاب می‌شود." msgid "Guides and Tutorials" -msgstr "" +msgstr "راهنماها و آموزش‌ها" msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" msgid "in argparse module" -msgstr "" +msgstr "در ماژول argparse" msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" msgid "+ (plus)" -msgstr "" +msgstr "+ (مثبت)" diff --git a/library/array.po b/library/array.po index e1136324d..54d6489ed 100644 --- a/library/array.po +++ b/library/array.po @@ -26,253 +26,442 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!array` --- Efficient arrays of numeric values" -msgstr "" +msgstr ":mod:`!array` --- آرایه‌های کارآمد از مقادیر عددی" -msgid "This module defines an object type which can compactly represent an array of basic values: characters, integers, floating-point numbers. Arrays are mutable :term:`sequence` types and behave very much like lists, except that the type of objects stored in them is constrained. The type is specified at object creation time by using a :dfn:`type code`, which is a single character. The following type codes are defined:" -msgstr "" +msgid "" +"This module defines an object type which can compactly represent an array of" +" basic values: characters, integers, floating-point numbers. Arrays are " +"mutable :term:`sequence` types and behave very much like lists, except that " +"the type of objects stored in them is constrained. The type is specified at" +" object creation time by using a :dfn:`type code`, which is a single " +"character. The following type codes are defined:" +msgstr "" +"این ماژول یک نوع شیء را تعریف می‌کند که می‌تواند آرایه‌ای از مقادیر پایه را " +"به‌صورت فشرده بازنمایی کند: نویسه‌ها، اعداد صحیح و اعداد ممیز شناور. " +"آرایه‌ها انواعی از :term:`دنباله ` تغییرپذیر هستند و بسیار شبیه " +"فهرست‌ها رفتار می‌کنند، با این تفاوت که نوع اشیاء ذخیره‌شده در آن‌ها محدود " +"است. این نوع در زمان ایجاد شیء با استفاده از یک :dfn:`کد نوع ` " +"مشخص می‌شود که یک نویسه واحد است. کدهای نوع زیر تعریف شده‌اند:" msgid "Type code" -msgstr "" +msgstr "کد نوع" msgid "C Type" -msgstr "" +msgstr "نوع C" msgid "Python Type" -msgstr "" +msgstr "نوع پایتون" msgid "Minimum size in bytes" -msgstr "" +msgstr "حداقل اندازه به بایت" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "``'b'``" -msgstr "" +msgstr "``'b'``" msgid "signed char" -msgstr "" +msgstr "نویسه‌ی علامت‌دار" msgid "int" -msgstr "" +msgstr "int" msgid "1" -msgstr "" +msgstr "1" msgid "``'B'``" -msgstr "" +msgstr "``'B'``" msgid "unsigned char" -msgstr "" +msgstr "unsigned char" msgid "``'u'``" -msgstr "" +msgstr "``'u'``" msgid "wchar_t" -msgstr "" +msgstr "wchar_t" msgid "Unicode character" -msgstr "" +msgstr "نویسه‌ی یونیکد" msgid "2" -msgstr "" +msgstr "2" msgid "\\(1)" -msgstr "" +msgstr "\\(1)" msgid "``'w'``" -msgstr "" +msgstr "``'w'``" msgid "Py_UCS4" -msgstr "" +msgstr "Py_UCS4" msgid "4" -msgstr "" +msgstr "4" msgid "\\(2)" -msgstr "" +msgstr "\\(2)" msgid "``'h'``" -msgstr "" +msgstr "``'h'``" msgid "signed short" -msgstr "" +msgstr "short علامت‌دار" msgid "``'H'``" -msgstr "" +msgstr "``'H'``" msgid "unsigned short" -msgstr "" +msgstr "short بدون علامت (unsigned short)" msgid "``'i'``" -msgstr "" +msgstr "``'i'``" msgid "signed int" -msgstr "" +msgstr "عدد صحیح علامت‌دار" msgid "``'I'``" -msgstr "" +msgstr "``'I'``" msgid "unsigned int" -msgstr "" +msgstr "عدد صحیح بدون علامت (unsigned int)" msgid "``'l'``" -msgstr "" +msgstr "``'l'``" msgid "signed long" -msgstr "" +msgstr "long علامت‌دار" msgid "``'L'``" -msgstr "" +msgstr "``'L'``" msgid "unsigned long" -msgstr "" +msgstr "long بدون علامت" msgid "``'q'``" -msgstr "" +msgstr "``'q'``" msgid "signed long long" -msgstr "" +msgstr "long long علامت‌دار (signed long long)" msgid "8" -msgstr "" +msgstr "۸" msgid "``'Q'``" -msgstr "" +msgstr "``'Q'``" msgid "unsigned long long" -msgstr "" +msgstr "unsigned long long" msgid "``'f'``" -msgstr "" +msgstr "``'f'``" msgid "float" -msgstr "" +msgstr "float" msgid "``'d'``" -msgstr "" +msgstr "``'d'``" msgid "double" -msgstr "" +msgstr "دوگانه" msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" msgid "It can be 16 bits or 32 bits depending on the platform." -msgstr "" +msgstr "بسته به پلتفرم، می‌تواند ۱۶ بیت یا ۳۲ بیت باشد." -msgid "``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated ``Py_UNICODE``. This change doesn't affect its behavior because ``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." +msgid "" +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " +"``Py_UNICODE``. This change doesn't affect its behavior because " +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" +"``array('u')`` اکنون از :c:type:`wchar_t` به‌عنوان نوع C به‌جای " +"``Py_UNICODE`` منسوخ‌شده استفاده می‌کند. این تغییر بر رفتار آن تأثیری " +"نمی‌گذارد، زیرا ``Py_UNICODE`` از پایتون 3.3 نام مستعاری از " +":c:type:`wchar_t` است." msgid "Please migrate to ``'w'`` typecode." -msgstr "" +msgstr "لطفاً به کد نوع (typecode) ``'w'`` مهاجرت کنید." -msgid "The :ref:`ctypes ` and :ref:`struct ` modules, as well as third-party modules like `numpy `__, use similar -- but slightly different -- type codes." +msgid "" +"The :ref:`ctypes ` and :ref:`struct ` modules, as well as third-party modules like `numpy " +"`__," +" use similar -- but slightly different -- type codes." msgstr "" +"ماژول‌های :ref:`ctypes ` و :ref:`struct " +"`، و همچنین ماژول‌های شخص ثالث مانند `numpy " +"`__،" +" از کدهای نوع مشابه -- اما کمی متفاوت -- استفاده می‌کنند." -msgid "The actual representation of values is determined by the machine architecture (strictly speaking, by the C implementation). The actual size can be accessed through the :attr:`array.itemsize` attribute." +msgid "" +"The actual representation of values is determined by the machine " +"architecture (strictly speaking, by the C implementation). The actual size " +"can be accessed through the :attr:`array.itemsize` attribute." msgstr "" +"نمایش واقعی مقادیر توسط معماری ماشین تعیین می‌شود (به‌طور دقیق‌تر، توسط " +"پیاده‌سازی C). اندازه واقعی از طریق ویژگی :attr:`array.itemsize` قابل دسترسی" +" است." msgid "The module defines the following item:" -msgstr "" +msgstr "این ماژول آیتم زیر را تعریف می‌کند:" msgid "A string with all available type codes." -msgstr "" +msgstr "رشته‌ای حاوی همه‌ی کدهای نوع موجود." msgid "The module defines the following type:" -msgstr "" +msgstr "این ماژول نوع زیر را تعریف می‌کند:" -msgid "A new array whose items are restricted by *typecode*, and initialized from the optional *initializer* value, which must be a :class:`bytes` or :class:`bytearray` object, a Unicode string, or iterable over elements of the appropriate type." +msgid "" +"A new array whose items are restricted by *typecode*, and initialized from " +"the optional *initializer* value, which must be a :class:`bytes` or " +":class:`bytearray` object, a Unicode string, or iterable over elements of " +"the appropriate type." msgstr "" +"آرایه‌ای جدید با آیتم‌های محدودشده با *typecode* که از مقدار اختیاری " +"*initializer* مقداردهی اولیه می‌شود؛ این مقدار باید یک شیء :class:`bytes` یا" +" :class:`bytearray`، یک رشته یونیکد، یا پیمایش‌پذیری روی عناصری از نوع مناسب " +"باشد." -msgid "If given a :class:`bytes` or :class:`bytearray` object, the initializer is passed to the new array's :meth:`frombytes` method; if given a Unicode string, the initializer is passed to the :meth:`fromunicode` method; otherwise, the initializer's iterator is passed to the :meth:`extend` method to add initial items to the array." -msgstr "" +msgid "" +"If given a :class:`bytes` or :class:`bytearray` object, the initializer is " +"passed to the new array's :meth:`frombytes` method; if given a Unicode " +"string, the initializer is passed to the :meth:`fromunicode` method; " +"otherwise, the initializer's iterator is passed to the :meth:`extend` method" +" to add initial items to the array." +msgstr "" +"اگر یک شیء :class:`bytes` یا :class:`bytearray` داده شود، مقدارده اولیه به " +"متد :meth:`frombytes` آرایه‌ی جدید ارسال می‌شود؛ اگر یک رشته یونیکد داده " +"شود، مقدارده اولیه به متد :meth:`fromunicode` ارسال می‌شود؛ در غیر این صورت،" +" پیمایش‌گر مقدارده اولیه به متد :meth:`extend` ارسال می‌شود تا آیتم‌های اولیه " +"به آرایه افزوده شوند." -msgid "Array objects support the ordinary :ref:`mutable ` :term:`sequence` operations of indexing, slicing, concatenation, and multiplication. When using slice assignment, the assigned value must be an array object with the same type code; in all other cases, :exc:`TypeError` is raised. Array objects also implement the buffer interface, and may be used wherever :term:`bytes-like objects ` are supported." -msgstr "" +msgid "" +"Array objects support the ordinary :ref:`mutable ` " +":term:`sequence` operations of indexing, slicing, concatenation, and " +"multiplication. When using slice assignment, the assigned value must be an " +"array object with the same type code; in all other cases, :exc:`TypeError` " +"is raised. Array objects also implement the buffer interface, and may be " +"used wherever :term:`bytes-like objects ` are supported." +msgstr "" +"اشیای آرایه از عملیات معمول :term:`دنباله ` های :ref:`تغییرپذیر " +"` شامل اندیس‌دهی، برش، الحاق و ضرب پشتیبانی می‌کنند. هنگام" +" استفاده از انتساب برش، مقدار اختصاص‌یافته باید یک شیء آرایه با همان کد نوع " +"باشد؛ در تمام موارد دیگر، :exc:`TypeError` پرتاب می‌شود. اشیای آرایه همچنین " +"رابط بافر را پیاده‌سازی می‌کنند و می‌توانند هر جا که :term:`اشیاء شبه‌بایت " +"` پشتیبانی می‌شوند، استفاده شوند." msgid "Arrays are :ref:`generic ` over the type of their contents." -msgstr "" +msgstr "آرایه‌ها نسبت به نوع محتوای خود :ref:`عام ` هستند." -msgid "Raises an :ref:`auditing event ` ``array.__new__`` with arguments ``typecode``, ``initializer``." +msgid "" +"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " +"``typecode``, ``initializer``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``array.__new__`` را با آرگومان‌های " +"``typecode`` و ``initializer`` پرتاب می‌کند." msgid "The typecode character used to create the array." -msgstr "" +msgstr "نویسه‌ی کد نوع (typecode) که برای ایجاد آرایه به کار رفته است." msgid "The length in bytes of one array item in the internal representation." -msgstr "" +msgstr "طول یک آیتم آرایه در نمایش داخلی، بر حسب بایت." msgid "Append a new item with the specified value to the end of the array." -msgstr "" +msgstr "یک آیتم جدید با مقدار مشخص‌شده را به انتهای آرایه اضافه می‌کند." -msgid "Return a tuple ``(address, length)`` giving the current memory address and the length in elements of the buffer used to hold array's contents. The size of the memory buffer in bytes can be computed as ``array.buffer_info()[1] * array.itemsize``. This is occasionally useful when working with low-level (and inherently unsafe) I/O interfaces that require memory addresses, such as certain :c:func:`!ioctl` operations. The returned numbers are valid as long as the array exists and no length-changing operations are applied to it." -msgstr "" +msgid "" +"Return a tuple ``(address, length)`` giving the current memory address and " +"the length in elements of the buffer used to hold array's contents. The " +"size of the memory buffer in bytes can be computed as " +"``array.buffer_info()[1] * array.itemsize``. This is occasionally useful " +"when working with low-level (and inherently unsafe) I/O interfaces that " +"require memory addresses, such as certain :c:func:`!ioctl` operations. The " +"returned numbers are valid as long as the array exists and no length-" +"changing operations are applied to it." +msgstr "" +"یک تاپل ``(address, length)`` برمی‌گرداند که نشانی حافظه فعلی و طول بر حسب " +"عناصر بافری را که برای نگهداری محتوای آرایه استفاده می‌شود، مشخص می‌کند. " +"اندازه‌ی بافر حافظه بر حسب بایت را می‌توان به‌صورت ``array.buffer_info()[1] " +"* array.itemsize`` محاسبه کرد. این موضوع گاهی هنگام کار با رابط‌های سطح " +"پایین I/O (و ذاتاً ناامن) که به نشانی‌های حافظه نیاز دارند، مفید است، مانند " +"برخی از عملیات‌های :c:func:`!ioctl`. اعداد برگردانده‌شده تا زمانی که آرایه " +"وجود دارد و هیچ عملیات تغییر طولی بر آن اعمال نشود، معتبر هستند." -msgid "When using array objects from code written in C or C++ (the only way to effectively make use of this information), it makes more sense to use the buffer interface supported by array objects. This method is maintained for backward compatibility and should be avoided in new code. The buffer interface is documented in :ref:`bufferobjects`." -msgstr "" +msgid "" +"When using array objects from code written in C or C++ (the only way to " +"effectively make use of this information), it makes more sense to use the " +"buffer interface supported by array objects. This method is maintained for " +"backward compatibility and should be avoided in new code. The buffer " +"interface is documented in :ref:`bufferobjects`." +msgstr "" +"هنگام استفاده از اشیای آرایه از کدی که به زبان C یا C++ نوشته‌شده است (تنها " +"راه برای استفاده مؤثر از این اطلاعات)، منطقی‌تر است از رابط بافر (buffer " +"interface) که توسط اشیای آرایه پشتیبانی می‌شود استفاده کنید. این متد برای " +"سازگاری با عقب‌گرد نگهداری می‌شود و باید در کد جدید از آن اجتناب شود. رابط " +"بافر در :ref:`bufferobjects` مستند شده است." -msgid "\"Byteswap\" all items of the array. This is only supported for values which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:`RuntimeError` is raised. It is useful when reading data from a file written on a machine with a different byte order." +msgid "" +"\"Byteswap\" all items of the array. This is only supported for values " +"which are 1, 2, 4, or 8 bytes in size; for other types of values, " +":exc:`RuntimeError` is raised. It is useful when reading data from a file " +"written on a machine with a different byte order." msgstr "" +"«جابه‌جایی بایت‌ها» (Byteswap) برای تمام آیتم‌های آرایه انجام می‌شود. این " +"عمل فقط برای مقادیری با اندازه‌ی ۱، ۲، ۴ یا ۸ بایت پشتیبانی می‌شود؛ برای " +"سایر انواع مقادیر، :exc:`RuntimeError` پرتاب می‌شود. این عمل هنگام خواندن " +"داده‌ها از فایلی که روی ماشینی با ترتیب بایت متفاوت نوشته شده است، مفید است." msgid "Return the number of occurrences of *value* in the array." -msgstr "" +msgstr "تعداد تکرارهای *value* را در آرایه برمی‌گرداند." -msgid "Append items from *iterable* to the end of the array. If *iterable* is another array, it must have *exactly* the same type code; if not, :exc:`TypeError` will be raised. If *iterable* is not an array, it must be iterable and its elements must be the right type to be appended to the array." +msgid "" +"Append items from *iterable* to the end of the array. If *iterable* is " +"another array, it must have *exactly* the same type code; if not, " +":exc:`TypeError` will be raised. If *iterable* is not an array, it must be " +"iterable and its elements must be the right type to be appended to the " +"array." msgstr "" +"آیتم‌هایی از *iterable* را به انتهای آرایه اضافه می‌کند. اگر *iterable* " +"آرایه دیگری باشد، باید کد نوع *دقیقاً* یکسانی داشته باشد؛ در غیر این صورت، " +":exc:`TypeError` پرتاب می‌شود. اگر *iterable* یک آرایه نباشد، باید پیمایش‌پذیر" +" باشد و عناصر آن باید نوع مناسب برای اضافه شدن به آرایه را داشته باشند." -msgid "Appends items from the :term:`bytes-like object`, interpreting its content as an array of machine values (as if it had been read from a file using the :meth:`fromfile` method)." +msgid "" +"Appends items from the :term:`bytes-like object`, interpreting its content " +"as an array of machine values (as if it had been read from a file using the " +":meth:`fromfile` method)." msgstr "" +"آیتم‌ها را از :term:`شیء شبه‌بایت ` می‌افزاید و محتوای " +"آن را به‌عنوان آرایه‌ای از مقادیر ماشینی تفسیر می‌کند (انگار که با استفاده " +"از متد :meth:`fromfile` از فایلی خوانده شده باشد)." msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "" +":meth:`!fromstring` برای وضوح بیشتر به :meth:`frombytes` تغییر نام پیدا کرده" +" است." -msgid "Read *n* items (as machine values) from the :term:`file object` *f* and append them to the end of the array. If less than *n* items are available, :exc:`EOFError` is raised, but the items that were available are still inserted into the array." +msgid "" +"Read *n* items (as machine values) from the :term:`file object` *f* and " +"append them to the end of the array. If less than *n* items are available, " +":exc:`EOFError` is raised, but the items that were available are still " +"inserted into the array." msgstr "" +"*n* آیتم را (به‌صورت مقادیر ماشینی) از :term:`file object` *f* بخوانید و " +"آن‌ها را به انتهای آرایه اضافه کنید. اگر کمتر از *n* آیتم در دسترس باشد، " +":exc:`EOFError` پرتاب می‌شود، اما آیتم‌هایی که در دسترس بودند همچنان در " +"آرایه درج می‌شوند." -msgid "Append items from the list. This is equivalent to ``for x in list: a.append(x)`` except that if there is a type error, the array is unchanged." +msgid "" +"Append items from the list. This is equivalent to ``for x in list: " +"a.append(x)`` except that if there is a type error, the array is unchanged." msgstr "" +"آیتم‌های فهرست را اضافه می‌کند. این معادل ``for x in list: a.append(x)`` " +"است، با این تفاوت که اگر خطای نوع رخ دهد، آرایه بدون تغییر باقی می‌ماند." -msgid "Extends this array with data from the given Unicode string. The array must have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an array of some other type." +msgid "" +"Extends this array with data from the given Unicode string. The array must " +"have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. " +"Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to" +" an array of some other type." msgstr "" +"این آرایه را با داده‌های رشته یونیکد داده‌شده گسترش می‌دهد. آرایه باید کد " +"نوع ``'u'`` یا ``'w'`` داشته باشد؛ در غیر این صورت یک :exc:`ValueError` " +"پرتاب می‌شود. برای افزودن داده‌های یونیکد به آرایه‌ای از نوعی دیگر، از " +"``array.frombytes(unicodestring.encode(enc))`` استفاده کنید." -msgid "Return the smallest *i* such that *i* is the index of the first occurrence of *value* in the array. The optional arguments *start* and *stop* can be specified to search for *value* within a subsection of the array. Raise :exc:`ValueError` if *value* is not found." +msgid "" +"Return the smallest *i* such that *i* is the index of the first occurrence " +"of *value* in the array. The optional arguments *start* and *stop* can be " +"specified to search for *value* within a subsection of the array. Raise " +":exc:`ValueError` if *value* is not found." msgstr "" +"کوچک‌ترین *i* را برمی‌گرداند، به‌طوری که *i* اندیس نخستین رخداد *value* در " +"آرایه باشد. می‌توان آرگومان‌های اختیاری *start* و *stop* را برای جست‌وجوی " +"*value* در زیربخشی از آرایه مشخص کرد. اگر *value* یافت نشد، " +":exc:`ValueError` را پرتاب می‌کند." msgid "Added optional *start* and *stop* parameters." -msgstr "" +msgstr "پارامترهای اختیاری *start* و *stop* افزوده شدند." -msgid "Insert a new item *value* in the array before position *index*. Negative values are treated as being relative to the end of the array." +msgid "" +"Insert a new item *value* in the array before position *index*. Negative " +"values are treated as being relative to the end of the array." msgstr "" +"یک آیتم جدید با مقدار *value* را پیش از موقعیت *index* در آرایه درج کنید. " +"مقادیر منفی نسبت به انتهای آرایه در نظر گرفته می‌شوند." -msgid "Removes the item with the index *i* from the array and returns it. The optional argument defaults to ``-1``, so that by default the last item is removed and returned." +msgid "" +"Removes the item with the index *i* from the array and returns it. The " +"optional argument defaults to ``-1``, so that by default the last item is " +"removed and returned." msgstr "" +"آیتم با اندیس *i* را از آرایه حذف می‌کند و آن را برمی‌گرداند. آرگومان " +"اختیاری به‌طور پیش‌فرض ``-1`` است، بنابراین به‌طور پیش‌فرض آخرین آیتم حذف و " +"برگردانده می‌شود." msgid "Remove the first occurrence of *value* from the array." -msgstr "" +msgstr "اولین رخداد *value* را از آرایه حذف می‌کند." msgid "Remove all elements from the array." -msgstr "" +msgstr "حذف تمام عناصر از آرایه." msgid "Reverse the order of the items in the array." -msgstr "" +msgstr "ترتیب آیتم‌های آرایه را معکوس می‌کند." -msgid "Convert the array to an array of machine values and return the bytes representation (the same sequence of bytes that would be written to a file by the :meth:`tofile` method.)" +msgid "" +"Convert the array to an array of machine values and return the bytes " +"representation (the same sequence of bytes that would be written to a file " +"by the :meth:`tofile` method.)" msgstr "" +"آرایه را به آرایه‌ای از مقادیر ماشین تبدیل می‌کند و بازنمایی بایتی را " +"برمی‌گرداند (همان دنباله‌ای از بایت‌ها که توسط متد :meth:`tofile` در یک فایل" +" نوشته می‌شود.)" msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." msgstr "" +":meth:`!tostring` برای وضوح به :meth:`tobytes` تغییر نام داده شده است." msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "" +"تمام آیتم‌ها (به‌صورت مقادیر ماشینی) را در :term:`شیء فایل ` " +"*f* می‌نویسد." msgid "Convert the array to an ordinary list with the same items." -msgstr "" +msgstr "آرایه را به یک فهرست معمولی با همان آیتم‌ها تبدیل می‌کند." -msgid "Convert the array to a Unicode string. The array must have a type ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes().decode(enc)`` to obtain a Unicode string from an array of some other type." +msgid "" +"Convert the array to a Unicode string. The array must have a type ``'u'`` " +"or ``'w'``; otherwise a :exc:`ValueError` is raised. Use " +"``array.tobytes().decode(enc)`` to obtain a Unicode string from an array of " +"some other type." msgstr "" +"آرایه را به یک رشته‌ی یونیکد تبدیل کنید. آرایه باید نوع ``'u'`` یا ``'w'`` " +"داشته باشد؛ در غیر این صورت :exc:`ValueError` پرتاب می‌شود. برای به دست " +"آوردن یک رشته‌ی یونیکد از آرایه‌ای با نوع دیگر، از " +"``array.tobytes().decode(enc)`` استفاده کنید." -msgid "The string representation of array objects has the form ``array(typecode, initializer)``. The *initializer* is omitted if the array is empty, otherwise it is a Unicode string if the *typecode* is ``'u'`` or ``'w'``, otherwise it is a list of numbers. The string representation is guaranteed to be able to be converted back to an array with the same type and value using :func:`eval`, so long as the :class:`~array.array` class has been imported using ``from array import array``. Variables ``inf`` and ``nan`` must also be defined if it contains corresponding floating-point values. Examples::" -msgstr "" +msgid "" +"The string representation of array objects has the form ``array(typecode, " +"initializer)``. The *initializer* is omitted if the array is empty, " +"otherwise it is a Unicode string if the *typecode* is ``'u'`` or ``'w'``, " +"otherwise it is a list of numbers. The string representation is guaranteed " +"to be able to be converted back to an array with the same type and value " +"using :func:`eval`, so long as the :class:`~array.array` class has been " +"imported using ``from array import array``. Variables ``inf`` and ``nan`` " +"must also be defined if it contains corresponding floating-point values. " +"Examples::" +msgstr "" +"نمایش رشته‌ای اشیای آرایه به شکل ``array(typecode, initializer)`` است. اگر " +"آرایه خالی باشد، *initializer* حذف می‌شود؛ در غیر این صورت، اگر *typecode* " +"برابر ``'u'`` یا ``'w'`` باشد، یک رشته یونیکد است و در غیر این صورت فهرستی " +"از اعداد است. تضمین می‌شود که نمایش رشته‌ای را بتوان با استفاده از " +":func:`eval` به آرایه‌ای با همان نوع و مقدار تبدیل کرد، مشروط بر اینکه کلاس " +":class:`~array.array` با استفاده از ``from array import array`` ایمپورت شده " +"باشد. اگر شامل مقادیر ممیز شناور متناظر باشد، متغیرهای ``inf`` و ``nan`` " +"نیز باید تعریف شده باشند. نمونه‌ها::" msgid "" "array('l')\n" @@ -280,18 +469,22 @@ msgid "" "array('l', [1, 2, 3, 4, 5])\n" "array('d', [1.0, 2.0, 3.14, -inf, nan])" msgstr "" +"array('l')\n" +"array('w', 'hello \\u2641')\n" +"array('l', [1, 2, 3, 4, 5])\n" +"array('d', [1.0, 2.0, 3.14, -inf, nan])" msgid "Module :mod:`struct`" -msgstr "" +msgstr "ماژول :mod:`struct`" msgid "Packing and unpacking of heterogeneous binary data." -msgstr "" +msgstr "بسته‌بندی و واگشایی داده‌های دودویی ناهمگن." msgid "`NumPy `_" -msgstr "" +msgstr "`NumPy `_" msgid "The NumPy package defines another array type." -msgstr "" +msgstr "بسته NumPy نوع آرایه دیگری را تعریف می‌کند." msgid "arrays" -msgstr "" +msgstr "آرایه‌ها" diff --git a/library/ast.po b/library/ast.po index cf4ff928b..24a2fb11b 100644 --- a/library/ast.po +++ b/library/ast.po @@ -13,8 +13,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-27 14:53+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"POT-Creation-Date: 2026-08-26 07:47+0330\n" +"PO-Revision-Date: 2026-08-28 11:32+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,112 +22,618 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!ast` --- Abstract syntax trees" -msgstr "" +msgstr ":mod:`!ast` --- درخت‌های سینتکس انتزاعی" msgid "**Source code:** :source:`Lib/ast.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/ast.py`" -msgid "The :mod:`!ast` module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like." +msgid "" +"The :mod:`!ast` module helps Python applications to process trees of the Python " +"abstract syntax grammar. The abstract syntax itself might change with each Python " +"release; this module helps to find out programmatically what the current grammar " +"looks like." msgstr "" +"ماژول :mod:`!ast` به برنامه‌های پایتون کمک می‌کند تا درخت‌های دستور زبان نحو انتزاعی " +"پایتون را پردازش کنند. خود نحو انتزاعی ممکن است با هر انتشار پایتون تغییر کند؛ این " +"ماژول به شما کمک می‌کند تا به‌صورت برنامه‌ای دریابید دستور زبان جاری چگونه است." -msgid "An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as a flag to the :func:`compile` built-in function, or using the :func:`parse` helper provided in this module. The result will be a tree of objects whose classes all inherit from :class:`ast.AST`. An abstract syntax tree can be compiled into a Python code object using the built-in :func:`compile` function." -msgstr "" +msgid "" +"An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as a " +"flag to the :func:`compile` built-in function, or using the :func:`parse` helper " +"provided in this module. The result will be a tree of objects whose classes all " +"inherit from :class:`ast.AST`. An abstract syntax tree can be compiled into a " +"Python code object using the built-in :func:`compile` function." +msgstr "" +"می‌توان یک درخت نحو انتزاعی را با ارسال :data:`ast.PyCF_ONLY_AST` به‌عنوان پرچم به " +"تابع توکار :func:`compile` یا با استفاده از تابع کمکی :func:`parse` ارائه‌شده در " +"این ماژول، تولید کرد. نتیجه درختی از اشیاء خواهد بود که کلاس‌های آن همگی " +"از :class:`ast.AST` ارث‌بری می‌کنند. می‌توان یک درخت نحو انتزاعی را با استفاده از " +"تابع توکار :func:`compile` به یک شیء کد پایتون کامپایل کرد." msgid "Abstract grammar" -msgstr "" +msgstr "دستور زبان انتزاعی" msgid "The abstract grammar is currently defined as follows:" -msgstr "" +msgstr "دستور زبان انتزاعی در حال حاضر به‌صورت زیر تعریف شده است:" + +msgid "" +"-- ASDL's 4 builtin types are:\n" +"-- identifier, int, string, constant\n" +"\n" +"module Python\n" +"{\n" +" mod = Module(stmt* body, type_ignore* type_ignores)\n" +" | Interactive(stmt* body)\n" +" | Expression(expr body)\n" +" | FunctionType(expr* argtypes, expr returns)\n" +"\n" +" stmt = FunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +" | AsyncFunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +"\n" +" | ClassDef(identifier name,\n" +" expr* bases,\n" +" keyword* keywords,\n" +" stmt* body,\n" +" expr* decorator_list,\n" +" type_param* type_params)\n" +" | Return(expr? value)\n" +"\n" +" | Delete(expr* targets)\n" +" | Assign(expr* targets, expr value, string? type_comment)\n" +" | TypeAlias(expr name, type_param* type_params, expr value)\n" +" | AugAssign(expr target, operator op, expr value)\n" +" -- 'simple' indicates that we annotate simple name without parens\n" +" | AnnAssign(expr target, expr annotation, expr? value, int simple)\n" +"\n" +" -- use 'orelse' because else is a keyword in target languages\n" +" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | While(expr test, stmt* body, stmt* orelse)\n" +" | If(expr test, stmt* body, stmt* orelse)\n" +" | With(withitem* items, stmt* body, string? type_comment)\n" +" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" +"\n" +" | Match(expr subject, match_case* cases)\n" +"\n" +" | Raise(expr? exc, expr? cause)\n" +" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | Assert(expr test, expr? msg)\n" +"\n" +" | Import(alias* names)\n" +" | ImportFrom(identifier? module, alias* names, int? level)\n" +"\n" +" | Global(identifier* names)\n" +" | Nonlocal(identifier* names)\n" +" | Expr(expr value)\n" +" | Pass | Break | Continue\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- BoolOp() can use left & right?\n" +" expr = BoolOp(boolop op, expr* values)\n" +" | NamedExpr(expr target, expr value)\n" +" | BinOp(expr left, operator op, expr right)\n" +" | UnaryOp(unaryop op, expr operand)\n" +" | Lambda(arguments args, expr body)\n" +" | IfExp(expr test, expr body, expr orelse)\n" +" | Dict(expr?* keys, expr* values)\n" +" | Set(expr* elts)\n" +" | ListComp(expr elt, comprehension* generators)\n" +" | SetComp(expr elt, comprehension* generators)\n" +" | DictComp(expr key, expr value, comprehension* generators)\n" +" | GeneratorExp(expr elt, comprehension* generators)\n" +" -- the grammar constrains where yield expressions can occur\n" +" | Await(expr value)\n" +" | Yield(expr? value)\n" +" | YieldFrom(expr value)\n" +" -- need sequences for compare to distinguish between\n" +" -- x < 4 < 3 and (x < 4) < 3\n" +" | Compare(expr left, cmpop* ops, expr* comparators)\n" +" | Call(expr func, expr* args, keyword* keywords)\n" +" | FormattedValue(expr value, int conversion, expr? format_spec)\n" +" | Interpolation(expr value, constant str, int conversion, expr? " +"format_spec)\n" +" | JoinedStr(expr* values)\n" +" | TemplateStr(expr* values)\n" +" | Constant(constant value, string? kind)\n" +"\n" +" -- the following expression can appear in assignment context\n" +" | Attribute(expr value, identifier attr, expr_context ctx)\n" +" | Subscript(expr value, expr slice, expr_context ctx)\n" +" | Starred(expr value, expr_context ctx)\n" +" | Name(identifier id, expr_context ctx)\n" +" | List(expr* elts, expr_context ctx)\n" +" | Tuple(expr* elts, expr_context ctx)\n" +"\n" +" -- can appear only in Subscript\n" +" | Slice(expr? lower, expr? upper, expr? step)\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" expr_context = Load | Store | Del\n" +"\n" +" boolop = And | Or\n" +"\n" +" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" +" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" +"\n" +" unaryop = Invert | Not | UAdd | USub\n" +"\n" +" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" +"\n" +" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" +"\n" +" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" +" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" +"\n" +" arg = (identifier arg, expr? annotation, string? type_comment)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" +" keyword = (identifier? arg, expr value)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- import name with optional 'as' alias.\n" +" alias = (identifier name, identifier? asname)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" withitem = (expr context_expr, expr? optional_vars)\n" +"\n" +" match_case = (pattern pattern, expr? guard, stmt* body)\n" +"\n" +" pattern = MatchValue(expr value)\n" +" | MatchSingleton(constant value)\n" +" | MatchSequence(pattern* patterns)\n" +" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" +" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " +"pattern* kwd_patterns)\n" +"\n" +" | MatchStar(identifier? name)\n" +" -- The optional \"rest\" MatchMapping parameter handles capturing " +"extra mapping keys\n" +"\n" +" | MatchAs(pattern? pattern, identifier? name)\n" +" | MatchOr(pattern* patterns)\n" +"\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"\n" +" type_ignore = TypeIgnore(int lineno, string tag)\n" +"\n" +" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" +" | ParamSpec(identifier name, expr? default_value)\n" +" | TypeVarTuple(identifier name, expr? default_value)\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"}\n" +msgstr "" +"-- ASDL's 4 builtin types are:\n" +"-- identifier, int, string, constant\n" +"\n" +"module Python\n" +"{\n" +" mod = Module(stmt* body, type_ignore* type_ignores)\n" +" | Interactive(stmt* body)\n" +" | Expression(expr body)\n" +" | FunctionType(expr* argtypes, expr returns)\n" +"\n" +" stmt = FunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +" | AsyncFunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +"\n" +" | ClassDef(identifier name,\n" +" expr* bases,\n" +" keyword* keywords,\n" +" stmt* body,\n" +" expr* decorator_list,\n" +" type_param* type_params)\n" +" | Return(expr? value)\n" +"\n" +" | Delete(expr* targets)\n" +" | Assign(expr* targets, expr value, string? type_comment)\n" +" | TypeAlias(expr name, type_param* type_params, expr value)\n" +" | AugAssign(expr target, operator op, expr value)\n" +" -- 'simple' indicates that we annotate simple name without parens\n" +" | AnnAssign(expr target, expr annotation, expr? value, int simple)\n" +"\n" +" -- use 'orelse' because else is a keyword in target languages\n" +" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | While(expr test, stmt* body, stmt* orelse)\n" +" | If(expr test, stmt* body, stmt* orelse)\n" +" | With(withitem* items, stmt* body, string? type_comment)\n" +" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" +"\n" +" | Match(expr subject, match_case* cases)\n" +"\n" +" | Raise(expr? exc, expr? cause)\n" +" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | Assert(expr test, expr? msg)\n" +"\n" +" | Import(alias* names)\n" +" | ImportFrom(identifier? module, alias* names, int? level)\n" +"\n" +" | Global(identifier* names)\n" +" | Nonlocal(identifier* names)\n" +" | Expr(expr value)\n" +" | Pass | Break | Continue\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- BoolOp() can use left & right?\n" +" expr = BoolOp(boolop op, expr* values)\n" +" | NamedExpr(expr target, expr value)\n" +" | BinOp(expr left, operator op, expr right)\n" +" | UnaryOp(unaryop op, expr operand)\n" +" | Lambda(arguments args, expr body)\n" +" | IfExp(expr test, expr body, expr orelse)\n" +" | Dict(expr?* keys, expr* values)\n" +" | Set(expr* elts)\n" +" | ListComp(expr elt, comprehension* generators)\n" +" | SetComp(expr elt, comprehension* generators)\n" +" | DictComp(expr key, expr value, comprehension* generators)\n" +" | GeneratorExp(expr elt, comprehension* generators)\n" +" -- the grammar constrains where yield expressions can occur\n" +" | Await(expr value)\n" +" | Yield(expr? value)\n" +" | YieldFrom(expr value)\n" +" -- need sequences for compare to distinguish between\n" +" -- x < 4 < 3 and (x < 4) < 3\n" +" | Compare(expr left, cmpop* ops, expr* comparators)\n" +" | Call(expr func, expr* args, keyword* keywords)\n" +" | FormattedValue(expr value, int conversion, expr? format_spec)\n" +" | Interpolation(expr value, constant str, int conversion, expr? " +"format_spec)\n" +" | JoinedStr(expr* values)\n" +" | TemplateStr(expr* values)\n" +" | Constant(constant value, string? kind)\n" +"\n" +" -- the following expression can appear in assignment context\n" +" | Attribute(expr value, identifier attr, expr_context ctx)\n" +" | Subscript(expr value, expr slice, expr_context ctx)\n" +" | Starred(expr value, expr_context ctx)\n" +" | Name(identifier id, expr_context ctx)\n" +" | List(expr* elts, expr_context ctx)\n" +" | Tuple(expr* elts, expr_context ctx)\n" +"\n" +" -- can appear only in Subscript\n" +" | Slice(expr? lower, expr? upper, expr? step)\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" expr_context = Load | Store | Del\n" +"\n" +" boolop = And | Or\n" +"\n" +" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" +" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" +"\n" +" unaryop = Invert | Not | UAdd | USub\n" +"\n" +" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" +"\n" +" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" +"\n" +" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" +" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" +"\n" +" arg = (identifier arg, expr? annotation, string? type_comment)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" +" keyword = (identifier? arg, expr value)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- import name with optional 'as' alias.\n" +" alias = (identifier name, identifier? asname)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" withitem = (expr context_expr, expr? optional_vars)\n" +"\n" +" match_case = (pattern pattern, expr? guard, stmt* body)\n" +"\n" +" pattern = MatchValue(expr value)\n" +" | MatchSingleton(constant value)\n" +" | MatchSequence(pattern* patterns)\n" +" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" +" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " +"pattern* kwd_patterns)\n" +"\n" +" | MatchStar(identifier? name)\n" +" -- The optional \"rest\" MatchMapping parameter handles capturing " +"extra mapping keys\n" +"\n" +" | MatchAs(pattern? pattern, identifier? name)\n" +" | MatchOr(pattern* patterns)\n" +"\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"\n" +" type_ignore = TypeIgnore(int lineno, string tag)\n" +"\n" +" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" +" | ParamSpec(identifier name, expr? default_value)\n" +" | TypeVarTuple(identifier name, expr? default_value)\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"}\n" msgid "Node classes" -msgstr "" +msgstr "کلاس‌های گره" -msgid "This is the base of all AST node classes. The actual node classes are derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:`above `. They are defined in the :mod:`!_ast` C module and re-exported in :mod:`!ast`." +msgid "" +"This is the base of all AST node classes. The actual node classes are derived " +"from the :file:`Parser/Python.asdl` file, which is reproduced :ref:`above " +"`. They are defined in the :mod:`!_ast` C module and re-" +"exported in :mod:`!ast`." msgstr "" +"این پایه‌ی تمام کلاس‌های گره AST است. کلاس‌های گره واقعی از پرونده‌ی :file:`Parser/" +"Python.asdl` مشتق شده‌اند، که در :ref:`بالا ` بازتولید شده است. " +"آن‌ها در ماژول C :mod:`!_ast` تعریف شده‌اند و در :mod:`!ast` دوباره برون‌ریزی شده‌اند." -msgid "There is one class defined for each left-hand side symbol in the abstract grammar (for example, :class:`ast.stmt` or :class:`ast.expr`). In addition, there is one class defined for each constructor on the right-hand side; these classes inherit from the classes for the left-hand side trees. For example, :class:`ast.BinOp` inherits from :class:`ast.expr`. For production rules with alternatives (aka \"sums\"), the left-hand side class is abstract: only instances of specific constructor nodes are ever created." -msgstr "" +msgid "" +"There is one class defined for each left-hand side symbol in the abstract grammar " +"(for example, :class:`ast.stmt` or :class:`ast.expr`). In addition, there is one " +"class defined for each constructor on the right-hand side; these classes inherit " +"from the classes for the left-hand side trees. For example, :class:`ast.BinOp` " +"inherits from :class:`ast.expr`. For production rules with alternatives (aka " +"\"sums\"), the left-hand side class is abstract: only instances of specific " +"constructor nodes are ever created." +msgstr "" +"برای هر نماد سمت چپ در دستور زبان انتزاعی، یک کلاس تعریف شده است (برای " +"مثال، :class:`ast.stmt` یا :class:`ast.expr`). علاوه بر این، برای هر سازنده در سمت " +"راست، یک کلاس تعریف شده است؛ این کلاس‌ها از کلاس‌های مربوط به درخت‌های سمت چپ ارث " +"می‌برند. برای مثال، :class:`ast.BinOp` از :class:`ast.expr` ارث می‌برد. برای قواعد " +"تولید دارای جایگزین‌ها (معروف به «مجموع‌ها»)، کلاس سمت چپ انتزاعی است: تنها " +"نمونه‌هایی از گره‌های سازنده‌ی خاص ایجاد می‌شوند." -msgid "Each concrete class has an attribute :attr:`!_fields` which gives the names of all child nodes." +msgid "" +"Each concrete class has an attribute :attr:`!_fields` which gives the names of all " +"child nodes." msgstr "" +"هر کلاس عینی یک ویژگی :attr:`!_fields` دارد که نام همه‌ی گره‌های فرزند را می‌دهد." -msgid "Each instance of a concrete class has one attribute for each child node, of the type as defined in the grammar. For example, :class:`ast.BinOp` instances have an attribute :attr:`left` of type :class:`ast.expr`." +msgid "" +"Each instance of a concrete class has one attribute for each child node, of the " +"type as defined in the grammar. For example, :class:`ast.BinOp` instances have an " +"attribute :attr:`left` of type :class:`ast.expr`." msgstr "" +"هر نمونه از یک کلاس مشخص، به ازای هر گره فرزند یک ویژگی دارد که نوع آن در گرامر " +"تعریف شده است. برای مثال، نمونه‌های :class:`ast.BinOp` یک ویژگی :attr:`left` از " +"نوع :class:`ast.expr` دارند." -msgid "If these attributes are marked as optional in the grammar (using a question mark), the value might be ``None``. If the attributes can have zero-or-more values (marked with an asterisk), the values are represented as Python lists. All possible attributes must be present and have valid values when compiling an AST with :func:`compile`." -msgstr "" +msgid "" +"If these attributes are marked as optional in the grammar (using a question mark), " +"the value might be ``None``. If the attributes can have zero-or-more values " +"(marked with an asterisk), the values are represented as Python lists. All " +"possible attributes must be present and have valid values when compiling an AST " +"with :func:`compile`." +msgstr "" +"اگر این ویژگی‌ها در گرامر به‌عنوان اختیاری علامت‌گذاری شده باشند (با استفاده از علامت " +"سؤال)، مقدار ممکن است ``None`` باشد. اگر ویژگی‌ها بتوانند صفر یا بیشتر مقدار داشته " +"باشند (با ستاره علامت‌گذاری شده باشند)، مقادیر به‌صورت فهرست‌های پایتون نمایش داده " +"می‌شوند. هنگام کامپایل یک AST با :func:`compile`، تمام ویژگی‌های ممکن باید موجود " +"باشند و مقادیر معتبر داشته باشند." -msgid "The :attr:`!_field_types` attribute on each concrete class is a dictionary mapping field names (as also listed in :attr:`_fields`) to their types." +msgid "" +"The :attr:`!_field_types` attribute on each concrete class is a dictionary mapping " +"field names (as also listed in :attr:`_fields`) to their types." msgstr "" +"ویژگی :attr:`!_field_types` در هر کلاس عینی، یک دیکشنری است که نام فیلدها (که " +"در :attr:`_fields` نیز فهرست شده‌اند) را به نوع آن‌ها نگاشت می‌کند." msgid "" ">>> ast.TypeVar._field_types\n" "{'name': , 'bound': ast.expr | None, 'default_value': ast.expr | None}" msgstr "" +">>> ast.TypeVar._field_types\n" +"{'name': , 'bound': ast.expr | None, 'default_value': ast.expr | None}" -msgid "Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` attributes. The :attr:`lineno` and :attr:`end_lineno` are the first and last line numbers of source text span (1-indexed so the first line is line 1) and the :attr:`col_offset` and :attr:`end_col_offset` are the corresponding UTF-8 byte offsets of the first and last tokens that generated the node. The UTF-8 offset is recorded because the parser uses UTF-8 internally." -msgstr "" +msgid "" +"Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses " +"have :attr:`lineno`, :attr:`col_offset`, :attr:`end_lineno`, " +"and :attr:`end_col_offset` attributes. The :attr:`lineno` and :attr:`end_lineno` " +"are the first and last line numbers of source text span (1-indexed so the first " +"line is line 1) and the :attr:`col_offset` and :attr:`end_col_offset` are the " +"corresponding UTF-8 byte offsets of the first and last tokens that generated the " +"node. The UTF-8 offset is recorded because the parser uses UTF-8 internally." +msgstr "" +"نمونه‌های زیرکلاس‌های :class:`ast.expr` و :class:`ast.stmt` دارای " +"ویژگی‌های :attr:`lineno`، :attr:`col_offset`، :attr:`end_lineno` " +"و :attr:`end_col_offset` هستند. :attr:`lineno` و :attr:`end_lineno` شماره‌های خط " +"اول و آخر بازه‌ی متن منبع هستند (با اندیس ۱، بنابراین اولین خط، خط ۱ است) " +"و :attr:`col_offset` و :attr:`end_col_offset` آفست‌های بایتی UTF-8 متناظر با اولین " +"و آخرین توکن‌هایی هستند که گره را تولید کرده‌اند. آفست UTF-8 ثبت می‌شود زیرا " +"پارسر به‌صورت داخلی از UTF-8 استفاده می‌کند." -msgid "Note that the end positions are not required by the compiler and are therefore optional. The end offset is *after* the last symbol, for example one can get the source segment of a one-line expression node using ``source_line[node.col_offset : node.end_col_offset]``." +msgid "" +"Note that the end positions are not required by the compiler and are therefore " +"optional. The end offset is *after* the last symbol, for example one can get the " +"source segment of a one-line expression node using ``source_line[node.col_offset : " +"node.end_col_offset]``." msgstr "" +"توجه داشته باشید که موقعیت‌های پایانی مورد نیاز کامپایلر نیستند و بنابراین " +"اختیاری‌اند. آفست پایانی *پس از* آخرین نماد است؛ برای مثال می‌توان بخش منبع یک گره " +"عبارت یک‌خطی را با استفاده از ``source_line[node.col_offset : " +"node.end_col_offset]`` به دست آورد." msgid "The constructor of a class :class:`ast.T` parses its arguments as follows:" -msgstr "" +msgstr "سازنده‌ی کلاس :class:`ast.T` آرگومان‌های خود را به‌صورت زیر تجزیه می‌کند:" -msgid "If there are positional arguments, there must be as many as there are items in :attr:`T._fields`; they will be assigned as attributes of these names." +msgid "" +"If there are positional arguments, there must be as many as there are items " +"in :attr:`T._fields`; they will be assigned as attributes of these names." msgstr "" +"اگر آرگومان‌های جایگاهی وجود داشته باشند، باید به تعداد آیتم‌های :attr:`T._fields` " +"باشند؛ آن‌ها به‌عنوان ویژگی‌هایی با این نام‌ها انتساب داده می‌شوند." -msgid "If there are keyword arguments, they will set the attributes of the same names to the given values." +msgid "" +"If there are keyword arguments, they will set the attributes of the same names to " +"the given values." msgstr "" +"اگر آرگومان‌های کلیدواژه‌ای وجود داشته باشند، ویژگی‌های هم‌نام را روی مقدارهای داده‌شده " +"تنظیم می‌کنند." -msgid "For example, to create and populate an :class:`ast.UnaryOp` node, you could use ::" +msgid "" +"For example, to create and populate an :class:`ast.UnaryOp` node, you could use ::" msgstr "" +"برای مثال، برای ایجاد و پر کردن یک گره :class:`ast.UnaryOp`، می‌توانید از کد زیر " +"استفاده کنید ::" msgid "" "node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" " lineno=0, col_offset=0)" msgstr "" +"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" +" lineno=0, col_offset=0)" -msgid "If a field that is optional in the grammar is omitted from the constructor, it defaults to ``None``. If a list field is omitted, it defaults to the empty list. If a field of type :class:`!ast.expr_context` is omitted, it defaults to :class:`Load() `. If any other field is omitted, a :exc:`DeprecationWarning` is raised and the AST node will not have this field. In Python 3.15, this condition will raise an error." -msgstr "" +msgid "" +"If a field that is optional in the grammar is omitted from the constructor, it " +"defaults to ``None``. If a list field is omitted, it defaults to the empty list. " +"If a field of type :class:`!ast.expr_context` is omitted, it defaults " +"to :class:`Load() `. If any other field is omitted, " +"a :exc:`DeprecationWarning` is raised and the AST node will not have this field. " +"In Python 3.15, this condition will raise an error." +msgstr "" +"اگر فیلدی که در گرامر اختیاری است، در سازنده آورده نشود، مقدار پیش‌فرض آن ``None`` " +"خواهد بود. اگر یک فیلد فهرستی آورده نشود، مقدار پیش‌فرض آن فهرست خالی است. اگر " +"فیلدی از نوع :class:`!ast.expr_context` آورده نشود، مقدار پیش‌فرض آن :class:`Load() " +"` خواهد بود. اگر هر فیلد دیگری آورده نشود، یک :exc:`DeprecationWarning` " +"پرتاب می‌شود و گره AST این فیلد را نخواهد داشت. در پایتون 3.15، این وضعیت یک خطا " +"پرتاب خواهد کرد." msgid "Class :class:`ast.Constant` is now used for all constants." -msgstr "" +msgstr "اکنون از کلاس :class:`ast.Constant` برای همه‌ی ثابت‌ها استفاده می‌شود." -msgid "Simple indices are represented by their value, extended slices are represented as tuples." +msgid "" +"Simple indices are represented by their value, extended slices are represented as " +"tuples." msgstr "" +"اندیس‌های ساده با مقدارشان نمایش داده می‌شوند، برش‌های گسترده (extended slices) " +"به‌صورت تاپل‌ها (tuples) نمایش داده می‌شوند." -msgid "AST node constructors were changed to provide sensible defaults for omitted fields: optional fields now default to ``None``, list fields default to an empty list, and fields of type :class:`!ast.expr_context` default to :class:`Load() `. Previously, omitted attributes would not exist on constructed nodes (accessing them raised :exc:`AttributeError`)." -msgstr "" +msgid "" +"AST node constructors were changed to provide sensible defaults for omitted " +"fields: optional fields now default to ``None``, list fields default to an empty " +"list, and fields of type :class:`!ast.expr_context` default to :class:`Load() " +"`. Previously, omitted attributes would not exist on constructed nodes " +"(accessing them raised :exc:`AttributeError`)." +msgstr "" +"سازنده‌های گره AST تغییر کردند تا پیش‌فرض‌های معقولی برای فیلدهای از قلم افتاده فراهم " +"کنند: اکنون مقدار پیش‌فرض فیلدهای اختیاری ``None`` است، مقدار پیش‌فرض فیلدهای فهرستی " +"یک فهرست خالی است، و مقدار پیش‌فرض فیلدهایی از نوع :class:`!ast.expr_context` " +"برابر :class:`Load() ` است. پیش از این، ویژگی‌های از قلم افتاده در گره‌های " +"ساخته‌شده وجود نداشتند (دسترسی به آن‌ها باعث پرتاب :exc:`AttributeError` می‌شد)." -msgid "The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes the values of the node fields." +msgid "" +"The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes the values " +"of the node fields." msgstr "" +"خروجی :meth:`~object.__repr__` گره‌های :class:`~ast.AST` شامل مقادیر فیلدهای گره " +"است." -msgid "Previous versions of Python provided the AST classes :class:`!ast.Num`, :class:`!ast.Str`, :class:`!ast.Bytes`, :class:`!ast.NameConstant` and :class:`!ast.Ellipsis`, which were deprecated in Python 3.8. These classes were removed in Python 3.14, and their functionality has been replaced with :class:`ast.Constant`." +msgid "" +"Previous versions of Python provided the AST classes :class:`!ast.Num`, :class:`!" +"ast.Str`, :class:`!ast.Bytes`, :class:`!ast.NameConstant` and :class:`!" +"ast.Ellipsis`, which were deprecated in Python 3.8. These classes were removed in " +"Python 3.14, and their functionality has been replaced with :class:`ast.Constant`." msgstr "" +"نسخه‌های پیشین پایتون، کلاس‌های AST یعنی :class:`!ast.Num`، :class:`!" +"ast.Str`، :class:`!ast.Bytes`، :class:`!ast.NameConstant` و :class:`!ast.Ellipsis` " +"را فراهم می‌کردند که در پایتون 3.8 منسوخ شده بودند. این کلاس‌ها در پایتون 3.14 حذف " +"شدند و کارکرد آن‌ها با :class:`ast.Constant` جایگزین شده است." -msgid "Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still available, but they will be removed in future Python releases. In the meantime, instantiating them will return an instance of a different class." +msgid "" +"Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still available, " +"but they will be removed in future Python releases. In the meantime, instantiating " +"them will return an instance of a different class." msgstr "" +"کلاس‌های قدیمی :class:`!ast.Index` و :class:`!ast.ExtSlice` هنوز در دسترس هستند، " +"اما در نسخه‌های آینده پایتون حذف خواهند شد. تا آن زمان، نمونه‌سازی از آن‌ها یک نمونه " +"از کلاسی دیگر را برمی‌گرداند." -msgid "Previous versions of Python allowed the creation of AST nodes that were missing required fields. Similarly, AST node constructors allowed arbitrary keyword arguments that were set as attributes of the AST node, even if they did not match any of the fields of the AST node. This behavior is deprecated and will be removed in Python 3.15." +msgid "" +"Previous versions of Python allowed the creation of AST nodes that were missing " +"required fields. Similarly, AST node constructors allowed arbitrary keyword " +"arguments that were set as attributes of the AST node, even if they did not match " +"any of the fields of the AST node. This behavior is deprecated and will be removed " +"in Python 3.15." msgstr "" +"نسخه‌های پیشین پایتون امکان ایجاد گره‌های AST را که فاقد فیلدهای الزامی بودند، " +"می‌دادند. به‌طور مشابه، سازنده‌های گره AST اجازه می‌دادند آرگومان‌های کلیدواژه‌ای دلخواه " +"به‌عنوان ویژگی‌های گره AST تنظیم شوند، حتی اگر با هیچ‌یک از فیلدهای گره AST مطابقت " +"نداشتند. این رفتار منسوخ‌شده است و در پایتون 3.15 حذف خواهد شد." -msgid "The descriptions of the specific node classes displayed here were initially adapted from the fantastic `Green Tree Snakes `__ project and all its contributors." +msgid "" +"The descriptions of the specific node classes displayed here were initially " +"adapted from the fantastic `Green Tree Snakes `__ project and all its contributors." msgstr "" +"توضیحات کلاس‌های گره خاصی که در اینجا نمایش داده شده‌اند، در ابتدا از پروژه‌ی " +"فوق‌العاده‌ی `Green Tree Snakes `__ و همه‌ی مشارکت‌کنندگان آن اقتباس شده‌اند." msgid "Root nodes" -msgstr "" +msgstr "گره‌های ریشه" -msgid "A Python module, as with :ref:`file input `. Node type generated by :func:`ast.parse` in the default ``\"exec\"`` *mode*." +msgid "" +"A Python module, as with :ref:`file input `. Node type generated " +"by :func:`ast.parse` in the default ``\"exec\"`` *mode*." msgstr "" +"یک ماژول پایتون، مانند :ref:`ورودی فایل `. نوع گره‌ای که " +"توسط :func:`ast.parse` در *حالت* پیش‌فرض ``\"exec\"`` تولید می‌شود." msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." -msgstr "" +msgstr "``body`` یک :class:`list` از :ref:`ast-statements` ماژول است." -msgid "``type_ignores`` is a :class:`list` of the module's type ignore comments; see :func:`ast.parse` for more details." +msgid "" +"``type_ignores`` is a :class:`list` of the module's type ignore comments; " +"see :func:`ast.parse` for more details." msgstr "" +"``type_ignores`` یک :class:`list` از توضیحات نادیده‌گرفتن نوع ماژول است؛ برای " +"جزئیات بیشتر :func:`ast.parse` را ببینید." msgid "" ">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" @@ -138,24 +644,43 @@ msgid "" " Name(id='x', ctx=Store())],\n" " value=Constant(value=1))])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))])" -msgid "A single Python :ref:`expression input `. Node type generated by :func:`ast.parse` when *mode* is ``\"eval\"``." +msgid "" +"A single Python :ref:`expression input `. Node type generated " +"by :func:`ast.parse` when *mode* is ``\"eval\"``." msgstr "" +"یک :ref:`ورودی عبارت ` پایتون. نوع گره‌ای که " +"توسط :func:`ast.parse` هنگامی که *mode* برابر ``\"eval\"`` باشد، تولید می‌شود." -msgid "``body`` is a single node, one of the :ref:`expression types `." -msgstr "" +msgid "" +"``body`` is a single node, one of the :ref:`expression types `." +msgstr "``body`` یک گره واحد است، یکی از :ref:`انواع عبارت `." msgid "" ">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" "Expression(\n" " body=Constant(value=123))" msgstr "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))" -msgid "A single :ref:`interactive input `, like in :ref:`tut-interac`. Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." +msgid "" +"A single :ref:`interactive input `, like in :ref:`tut-interac`. Node " +"type generated by :func:`ast.parse` when *mode* is ``\"single\"``." msgstr "" +"یک :ref:`ورودی تعاملی ` واحد، مانند :ref:`tut-interac`. نوع گره " +"تولیدشده توسط :func:`ast.parse` هنگامی که *mode* برابر ``\"single\"`` است." msgid "``body`` is a :class:`list` of :ref:`statement nodes `." -msgstr "" +msgstr "``body`` یک :class:`list` از :ref:`گره‌های دستور ` است." msgid "" ">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" @@ -170,27 +695,48 @@ msgid "" " Name(id='y', ctx=Store())],\n" " value=Constant(value=2))])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" +"Interactive(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1)),\n" +" Assign(\n" +" targets=[\n" +" Name(id='y', ctx=Store())],\n" +" value=Constant(value=2))])" -msgid "A representation of an old-style type comments for functions, as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." +msgid "" +"A representation of an old-style type comments for functions, as Python versions " +"prior to 3.5 didn't support :pep:`484` annotations. Node type generated " +"by :func:`ast.parse` when *mode* is ``\"func_type\"``." msgstr "" +"بازنمایی‌ای از کامنت‌های نوع به سبک قدیمی برای توابع، زیرا نسخه‌های پایتون پیش از 3.5 " +"از حاشیه‌نویسی‌های :pep:`484` پشتیبانی نمی‌کردند. نوع گره تولیدشده " +"توسط :func:`ast.parse` هنگامی که *mode* برابر ``\"func_type\"`` باشد." msgid "Such type comments would look like this::" -msgstr "" +msgstr "چنین کامنت‌های نوعی به این شکل خواهند بود::" msgid "" "def sum_two_number(a, b):\n" " # type: (int, int) -> int\n" " return a + b" msgstr "" +"def sum_two_number(a, b):\n" +" # type: (int, int) -> int\n" +" return a + b" msgid "``argtypes`` is a :class:`list` of :ref:`expression nodes `." -msgstr "" +msgstr "``argtypes`` یک :class:`list` از :ref:`گره‌های عبارت ` است." msgid "``returns`` is a single :ref:`expression node `." -msgstr "" +msgstr "``returns`` یک :ref:`گره عبارت ` است." msgid "" -">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), indent=4))\n" +">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " +"indent=4))\n" "FunctionType(\n" " argtypes=[\n" " Name(id='int', ctx=Load()),\n" @@ -200,15 +746,38 @@ msgid "" " slice=Name(id='int', ctx=Load()),\n" " ctx=Load()))" msgstr "" +">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " +"indent=4))\n" +"FunctionType(\n" +" argtypes=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" returns=Subscript(\n" +" value=Name(id='List', ctx=Load()),\n" +" slice=Name(id='int', ctx=Load()),\n" +" ctx=Load()))" msgid "Literals" -msgstr "" +msgstr "مقادیر لفظی" -msgid "A constant value. The ``value`` attribute of the ``Constant`` literal contains the Python object it represents. The values represented can be instances of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:`Ellipsis`." +msgid "" +"A constant value. The ``value`` attribute of the ``Constant`` literal contains the " +"Python object it represents. The values represented can be instances " +"of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, " +"and :class:`bool`, and the constants :data:`None` and :data:`Ellipsis`." msgstr "" +"یک مقدار ثابت. ویژگی ``value`` در لفظی ``Constant`` شامل شیء پایتونی بازنمایی‌شده " +"توسط آن است. مقادیر بازنمایی‌شده می‌توانند نمونه‌هایی " +"از :class:`str`، :class:`bytes`، :class:`int`، :class:`float`، :class:`complex` " +"و :class:`bool`، و ثابت‌های :data:`None` و :data:`Ellipsis` باشند." -msgid "The ``kind`` attribute is an optional string. For string literals with a ``u`` prefix, ``kind`` is set to ``'u'``. For all other constants, ``kind`` is ``None``." +msgid "" +"The ``kind`` attribute is an optional string. For string literals with a ``u`` " +"prefix, ``kind`` is set to ``'u'``. For all other constants, ``kind`` is ``None``." msgstr "" +"ویژگی ``kind`` یک رشته اختیاری است. برای مقادیر لفظی رشته‌ای با پیشوند ``u``، " +"``kind`` روی ``'u'`` تنظیم می‌شود. برای همه‌ی ثابت‌های دیگر، ``kind`` برابر ``None`` " +"است." msgid "" ">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" @@ -218,36 +787,62 @@ msgid "" "Expression(\n" " body=Constant(value='hello', kind='u'))" msgstr "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))\n" +">>> print(ast.dump(ast.parse(\"u'hello'\", mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value='hello', kind='u'))" -msgid "Node representing a single formatting field in an f-string. If the string contains a single formatting field and nothing else the node can be isolated otherwise it appears in :class:`JoinedStr`." +msgid "" +"Node representing a single formatting field in an f-string. If the string contains " +"a single formatting field and nothing else the node can be isolated otherwise it " +"appears in :class:`JoinedStr`." msgstr "" +"گره‌ای که نشان‌دهنده‌ی یک فیلد قالب‌بندی منفرد در یک اف‌استرینگ است. اگر رشته شامل یک " +"فیلد قالب‌بندی منفرد و هیچ چیز دیگری باشد، گره می‌تواند جداگانه باشد؛ در غیر این " +"صورت در :class:`JoinedStr` ظاهر می‌شود." -msgid "``value`` is any expression node (such as a literal, a variable, or a function call)." +msgid "" +"``value`` is any expression node (such as a literal, a variable, or a function " +"call)." msgstr "" +"``value`` هر گره عبارتی است (مانند یک لفظی (literal)، یک متغیر، یا یک فراخوانی " +"تابع)." msgid "``conversion`` is an integer:" -msgstr "" +msgstr "``conversion`` یک عدد صحیح است:" msgid "-1: no formatting" -msgstr "" +msgstr "-1: بدون قالب‌بندی" msgid "97 (``ord('a')``): ``!a`` :func:`ASCII ` formatting" -msgstr "" +msgstr "۹۷ (``ord('a')``): ``!a`` قالب‌بندی :func:`ASCII `" msgid "114 (``ord('r')``): ``!r`` :func:`repr` formatting" -msgstr "" +msgstr "۱۱۴ (``ord('r')``): قالب‌بندی ``!r`` با :func:`repr`" msgid "115 (``ord('s')``): ``!s`` :func:`string ` formatting" -msgstr "" +msgstr "۱۱۵ (``ord('s')``): ``!s`` قالب‌بندی :func:`string `" -msgid "``format_spec`` is a :class:`JoinedStr` node representing the formatting of the value, or ``None`` if no format was specified. Both ``conversion`` and ``format_spec`` can be set at the same time." +msgid "" +"``format_spec`` is a :class:`JoinedStr` node representing the formatting of the " +"value, or ``None`` if no format was specified. Both ``conversion`` and " +"``format_spec`` can be set at the same time." msgstr "" +"``format_spec`` یک گره :class:`JoinedStr` است که قالب‌بندی مقدار را نشان می‌دهد، یا " +"اگر قالبی مشخص نشده باشد، ``None`` است. هر دو ``conversion`` و ``format_spec`` را " +"می‌توان همزمان تنظیم کرد." -msgid "An f-string, comprising a series of :class:`FormattedValue` and :class:`Constant` nodes." +msgid "" +"An f-string, comprising a series of :class:`FormattedValue` and :class:`Constant` " +"nodes." msgstr "" +"یک اف‌استرینگ، شامل مجموعه‌ای از گره‌های :class:`FormattedValue` و :class:`Constant`." msgid "" -">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), indent=4))\n" +">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " +"indent=4))\n" "Expression(\n" " body=JoinedStr(\n" " values=[\n" @@ -266,9 +861,34 @@ msgid "" " values=[\n" " Constant(value='.3')]))]))" msgstr "" +">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=JoinedStr(\n" +" values=[\n" +" Constant(value='sin('),\n" +" FormattedValue(\n" +" value=Name(id='a', ctx=Load()),\n" +" conversion=-1),\n" +" Constant(value=') is '),\n" +" FormattedValue(\n" +" value=Call(\n" +" func=Name(id='sin', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load())]),\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='.3')]))]))" -msgid "Node representing a template string literal, comprising a series of :class:`Interpolation` and :class:`Constant` nodes. These nodes may be any order, and do not need to be interleaved." +msgid "" +"Node representing a template string literal, comprising a series " +"of :class:`Interpolation` and :class:`Constant` nodes. These nodes may be any " +"order, and do not need to be interleaved." msgstr "" +"گره‌ای که یک لفظی رشته‌ی الگویی (template string literal) را نشان می‌دهد و شامل " +"دنباله‌ای از گره‌های :class:`Interpolation` و :class:`Constant` است. این گره‌ها " +"می‌توانند به هر ترتیبی باشند و نیازی نیست به‌صورت یک‌درمیان باشند." msgid "" ">>> expr = ast.parse('t\"{name} finished {place:ordinal}\"', mode='eval')\n" @@ -289,39 +909,82 @@ msgid "" " values=[\n" " Constant(value='ordinal')]))]))" msgstr "" +">>> expr = ast.parse('t\"{name} finished {place:ordinal}\"', mode='eval')\n" +">>> print(ast.dump(expr, indent=4))\n" +"Expression(\n" +" body=TemplateStr(\n" +" values=[\n" +" Interpolation(\n" +" value=Name(id='name', ctx=Load()),\n" +" str='name',\n" +" conversion=-1),\n" +" Constant(value=' finished '),\n" +" Interpolation(\n" +" value=Name(id='place', ctx=Load()),\n" +" str='place',\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='ordinal')]))]))" msgid "Node representing a single interpolation field in a template string literal." msgstr "" +"گره‌ای که نشان‌دهنده‌ی یک فیلد درون‌یابی (interpolation field) در یک لفظی رشته‌ی الگو " +"(template string literal) است." -msgid "``value`` is any expression node (such as a literal, a variable, or a function call). This has the same meaning as ``FormattedValue.value``." +msgid "" +"``value`` is any expression node (such as a literal, a variable, or a function " +"call). This has the same meaning as ``FormattedValue.value``." msgstr "" +"``value`` می‌تواند هر گره‌ی عبارت باشد (مانند یک لفظی، یک متغیر، یا یک فراخوانی " +"تابع). این همان معنای ``FormattedValue.value`` را دارد." msgid "``str`` is a constant containing the text of the interpolation expression." -msgstr "" +msgstr "``str`` یک ثابت است که حاوی متن عبارت درون‌یابی است." -msgid "If ``str`` is set to ``None``, then ``value`` is used to generate code when calling :func:`ast.unparse`. This no longer guarantees that the generated code is identical to the original and is intended for code generation." +msgid "" +"If ``str`` is set to ``None``, then ``value`` is used to generate code when " +"calling :func:`ast.unparse`. This no longer guarantees that the generated code is " +"identical to the original and is intended for code generation." msgstr "" +"اگر ``str`` روی ``None`` تنظیم شود، هنگام فراخوانی :func:`ast.unparse` از " +"``value`` برای تولید کد استفاده می‌شود. در این حالت دیگر تضمین نمی‌شود که کد " +"تولیدشده با کد اصلی یکسان باشد و این برای تولید کد در نظر گرفته شده است." msgid "-1: no conversion" -msgstr "" +msgstr "-1: بدون تبدیل" msgid "97 (``ord('a')``): ``!a`` :func:`ASCII ` conversion" -msgstr "" +msgstr "۹۷ (``ord('a')``): تبدیل ``!a`` به :func:`ASCII `" msgid "114 (``ord('r')``): ``!r`` :func:`repr` conversion" -msgstr "" +msgstr "۱۱۴ (``ord('r')``): تبدیل ``!r`` به :func:`repr`" msgid "115 (``ord('s')``): ``!s`` :func:`string ` conversion" -msgstr "" +msgstr "۱۱۵ (``ord('s')``): تبدیل :func:`string ` با ``!s``" msgid "This has the same meaning as ``FormattedValue.conversion``." -msgstr "" +msgstr "این همان معنای ``FormattedValue.conversion`` را دارد." -msgid "``format_spec`` is a :class:`JoinedStr` node representing the formatting of the value, or ``None`` if no format was specified. Both ``conversion`` and ``format_spec`` can be set at the same time. This has the same meaning as ``FormattedValue.format_spec``." +msgid "" +"``format_spec`` is a :class:`JoinedStr` node representing the formatting of the " +"value, or ``None`` if no format was specified. Both ``conversion`` and " +"``format_spec`` can be set at the same time. This has the same meaning as " +"``FormattedValue.format_spec``." msgstr "" +"``format_spec`` یک گره :class:`JoinedStr` است که قالب‌بندی مقدار را نشان می‌دهد، یا " +"اگر هیچ قالبی مشخص نشده باشد، ``None`` است. می‌توان هر دو ``conversion`` و " +"``format_spec`` را همزمان تنظیم کرد. این همان معنای ``FormattedValue.format_spec`` " +"را دارد." -msgid "A list or tuple. ``elts`` holds a list of nodes representing the elements. ``ctx`` is :class:`Store` if the container is an assignment target (i.e. ``(x,y)=something``), and :class:`Load` otherwise." +msgid "" +"A list or tuple. ``elts`` holds a list of nodes representing the elements. ``ctx`` " +"is :class:`Store` if the container is an assignment target (i.e. " +"``(x,y)=something``), and :class:`Load` otherwise." msgstr "" +"یک فهرست یا تاپل. ``elts`` شامل فهرستی از گره‌های نشان‌دهنده عناصر است. اگر ظرف هدف " +"انتساب باشد (یعنی ``(x,y)=something``)، ``ctx`` :class:`Store` است و در غیر این " +"صورت :class:`Load` است." msgid "" ">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" @@ -341,9 +1004,26 @@ msgid "" " Constant(value=3)],\n" " ctx=Load()))" msgstr "" +">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=List(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))\n" +">>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Tuple(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))" msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" +"یک مجموعه. ``elts`` شامل فهرستی از گره‌هایی است که عناصر مجموعه را نشان می‌دهند." msgid "" ">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" @@ -354,12 +1034,31 @@ msgid "" " Constant(value=2),\n" " Constant(value=3)]))" msgstr "" +">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Set(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))" -msgid "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." +msgid "" +"A dictionary. ``keys`` and ``values`` hold lists of nodes representing the keys " +"and the values respectively, in matching order (what would be returned when " +"calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." msgstr "" +"یک دیکشنری. ``keys`` و ``values`` فهرست‌هایی از گره‌ها را نگه می‌دارند که به‌ترتیب " +"نشان‌دهنده‌ی کلیدها و مقدارها هستند و ترتیب آن‌ها با یکدیگر مطابقت دارد (آنچه هنگام " +"فراخوانی :code:`dictionary.keys()` و :code:`dictionary.values()` بازگردانده می‌شود)." -msgid "When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the ``values`` list, with a ``None`` at the corresponding position in ``keys``." +msgid "" +"When doing dictionary unpacking using dictionary literals the expression to be " +"expanded goes in the ``values`` list, with a ``None`` at the corresponding " +"position in ``keys``." msgstr "" +"هنگام انجام واگشایی دیکشنری با استفاده از مقادیر لفظی دیکشنری، عبارت مورد واگشایی در " +"فهرست ``values`` قرار می‌گیرد و یک ``None`` در موقعیت متناظر در ``keys`` قرار " +"می‌گیرد." msgid "" ">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" @@ -372,15 +1071,34 @@ msgid "" " Constant(value=1),\n" " Name(id='d', ctx=Load())]))" msgstr "" +">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Dict(\n" +" keys=[\n" +" Constant(value='a'),\n" +" None],\n" +" values=[\n" +" Constant(value=1),\n" +" Name(id='d', ctx=Load())]))" msgid "Variables" -msgstr "" +msgstr "متغیرها" -msgid "A variable name. ``id`` holds the name as a string, and ``ctx`` is one of the following types." +msgid "" +"A variable name. ``id`` holds the name as a string, and ``ctx`` is one of the " +"following types." msgstr "" +"نام یک متغیر. ``id`` نام را به‌عنوان یک رشته نگه می‌دارد، و ``ctx`` یکی از انواع زیر " +"است." -msgid "Variable references can be used to load the value of a variable, to assign a new value to it, or to delete it. Variable references are given a context to distinguish these cases." +msgid "" +"Variable references can be used to load the value of a variable, to assign a new " +"value to it, or to delete it. Variable references are given a context to " +"distinguish these cases." msgstr "" +"از ارجاع‌های متغیر می‌توان برای بارگذاری مقدار یک متغیر، انتساب مقدار جدید به آن، یا " +"حذف آن استفاده کرد. به ارجاع‌های متغیر یک زمینه داده می‌شود تا این حالت‌ها از یکدیگر " +"تشخیص داده شوند." msgid "" ">>> print(ast.dump(ast.parse('a'), indent=4))\n" @@ -404,12 +1122,38 @@ msgid "" " targets=[\n" " Name(id='a', ctx=Del())])])" msgstr "" - -msgid "A ``*var`` variable reference. ``value`` holds the variable, typically a :class:`Name` node. This type must be used when building a :class:`Call` node with ``*args``." -msgstr "" - -msgid "" -">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" +">>> print(ast.dump(ast.parse('a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Name(id='a', ctx=Load()))])\n" +"\n" +">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('del a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='a', ctx=Del())])])" + +msgid "" +"A ``*var`` variable reference. ``value`` holds the variable, typically " +"a :class:`Name` node. This type must be used when building a :class:`Call` node " +"with ``*args``." +msgstr "" +"یک ارجاع به متغیر ``*var``. ``value`` متغیر را نگه می‌دارد، که معمولاً یک " +"گره :class:`Name` است. هنگام ساخت یک گره :class:`Call` با ``*args`` باید از این " +"نوع استفاده شود." + +msgid "" +">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" "Module(\n" " body=[\n" " Assign(\n" @@ -423,12 +1167,34 @@ msgid "" " ctx=Store())],\n" " value=Name(id='it', ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Starred(\n" +" value=Name(id='b', ctx=Store()),\n" +" ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='it', ctx=Load()))])" msgid "Expressions" -msgstr "" +msgstr "عبارات" -msgid "When an expression, such as a function call, appears as a statement by itself with its return value not used or stored, it is wrapped in this container. ``value`` holds one of the other nodes in this section, a :class:`Constant`, a :class:`Name`, a :class:`Lambda`, a :class:`Yield` or :class:`YieldFrom` node." +msgid "" +"When an expression, such as a function call, appears as a statement by itself with " +"its return value not used or stored, it is wrapped in this container. ``value`` " +"holds one of the other nodes in this section, a :class:`Constant`, " +"a :class:`Name`, a :class:`Lambda`, a :class:`Yield` or :class:`YieldFrom` node." msgstr "" +"هنگامی که یک عبارت، مانند فراخوانی تابع، به‌تنهایی به‌عنوان یک دستور ظاهر می‌شود و " +"مقدار بازگشتی آن استفاده یا ذخیره نمی‌شود، در این ظرف قرار می‌گیرد. ``value`` یکی از " +"گره‌های دیگر در این بخش را نگه می‌دارد: یک گره :class:`Constant`، یک " +"گره :class:`Name`، یک گره :class:`Lambda`، یک گره :class:`Yield` یا یک " +"گره :class:`YieldFrom`." msgid "" ">>> print(ast.dump(ast.parse('-a'), indent=4))\n" @@ -439,12 +1205,24 @@ msgid "" " op=USub(),\n" " operand=Name(id='a', ctx=Load())))])" msgstr "" +">>> print(ast.dump(ast.parse('-a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=UnaryOp(\n" +" op=USub(),\n" +" operand=Name(id='a', ctx=Load())))])" -msgid "A unary operation. ``op`` is the operator, and ``operand`` any expression node." -msgstr "" +msgid "" +"A unary operation. ``op`` is the operator, and ``operand`` any expression node." +msgstr "یک عملیات یک‌عملوندی. ``op`` عملگر است و ``operand`` هر گره‌ی عبارت است." -msgid "Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` is the ``~`` operator." +msgid "" +"Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` is the " +"``~`` operator." msgstr "" +"توکن‌های عملگر یک‌عملوندی. :class:`Not` همان کلیدواژه ``not`` است، :class:`Invert` همان " +"عملگر ``~`` است." msgid "" ">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" @@ -453,9 +1231,18 @@ msgid "" " op=Not(),\n" " operand=Name(id='x', ctx=Load())))" msgstr "" +">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" +"Expression(\n" +" body=UnaryOp(\n" +" op=Not(),\n" +" operand=Name(id='x', ctx=Load())))" -msgid "A binary operation (like addition or division). ``op`` is the operator, and ``left`` and ``right`` are any expression nodes." +msgid "" +"A binary operation (like addition or division). ``op`` is the operator, and " +"``left`` and ``right`` are any expression nodes." msgstr "" +"یک عملیات دودویی (مانند جمع یا تقسیم). ``op`` عملگر است و ``left`` و ``right`` " +"گره‌های عبارت دلخواه هستند." msgid "" ">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" @@ -465,15 +1252,27 @@ msgid "" " op=Add(),\n" " right=Name(id='y', ctx=Load())))" msgstr "" +">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Add(),\n" +" right=Name(id='y', ctx=Load())))" msgid "Binary operator tokens." -msgstr "" +msgstr "توکن‌های عملگر دودویی." -msgid "A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. ``values`` are the values involved. Consecutive operations with the same operator, such as ``a or b or c``, are collapsed into one node with several values." +msgid "" +"A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " +"``values`` are the values involved. Consecutive operations with the same operator, " +"such as ``a or b or c``, are collapsed into one node with several values." msgstr "" +"یک عملیات بولی، 'or' یا 'and'. ``op`` :class:`Or` یا :class:`And` است. ``values`` " +"مقادیر درگیر هستند. عملیات‌های متوالی با همان عملگر، مانند ``a or b or c``، در یک " +"گره با چند مقدار ادغام می‌شوند." msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." -msgstr "" +msgstr "این شامل ``not`` نمی‌شود، که یک :class:`UnaryOp` است." msgid "" ">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" @@ -484,12 +1283,24 @@ msgid "" " Name(id='x', ctx=Load()),\n" " Name(id='y', ctx=Load())]))" msgstr "" +">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BoolOp(\n" +" op=Or(),\n" +" values=[\n" +" Name(id='x', ctx=Load()),\n" +" Name(id='y', ctx=Load())]))" msgid "Boolean operator tokens." -msgstr "" +msgstr "توکن‌های عملگر بولی." -msgid "A comparison of two or more values. ``left`` is the first value in the comparison, ``ops`` the list of operators, and ``comparators`` the list of values after the first element in the comparison." +msgid "" +"A comparison of two or more values. ``left`` is the first value in the comparison, " +"``ops`` the list of operators, and ``comparators`` the list of values after the " +"first element in the comparison." msgstr "" +"مقایسه‌ی دو یا چند مقدار. ``left`` نخستین مقدار در مقایسه است، ``ops`` فهرست " +"عملگرها است، و ``comparators`` فهرست مقادیر پس از نخستین عنصر در مقایسه است." msgid "" ">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" @@ -503,21 +1314,41 @@ msgid "" " Name(id='a', ctx=Load()),\n" " Constant(value=10)]))" msgstr "" +">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Compare(\n" +" left=Constant(value=1),\n" +" ops=[\n" +" LtE(),\n" +" Lt()],\n" +" comparators=[\n" +" Name(id='a', ctx=Load()),\n" +" Constant(value=10)]))" msgid "Comparison operator tokens." -msgstr "" +msgstr "توکن‌های عملگر مقایسه‌ای." -msgid "A function call. ``func`` is the function, which will often be a :class:`Name` or :class:`Attribute` object. Of the arguments:" +msgid "" +"A function call. ``func`` is the function, which will often be a :class:`Name` " +"or :class:`Attribute` object. Of the arguments:" msgstr "" +"یک فراخوانی تابع. ``func`` تابع است، که اغلب یک شیء :class:`Name` " +"یا :class:`Attribute` خواهد بود. از میان آرگومان‌ها:" msgid "``args`` holds a list of the arguments passed by position." -msgstr "" +msgstr "``args`` فهرستی از آرگومان‌های ارسال‌شده به‌صورت جایگاهی را در خود نگه می‌دارد." -msgid "``keywords`` holds a list of :class:`.keyword` objects representing arguments passed by keyword." +msgid "" +"``keywords`` holds a list of :class:`.keyword` objects representing arguments " +"passed by keyword." msgstr "" +"``keywords`` شامل فهرستی از اشیاء :class:`.keyword` است که آرگومان‌های ارسال‌شده با " +"کلیدواژه را نشان می‌دهند." -msgid "The ``args`` and ``keywords`` arguments are optional and default to empty lists." +msgid "" +"The ``args`` and ``keywords`` arguments are optional and default to empty lists." msgstr "" +"آرگومان‌های ``args`` و ``keywords`` اختیاری هستند و پیش‌فرض آن‌ها فهرست‌های خالی است." msgid "" ">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), indent=4))\n" @@ -536,12 +1367,35 @@ msgid "" " keyword(\n" " value=Name(id='e', ctx=Load()))]))" msgstr "" +">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='func', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load()),\n" +" Starred(\n" +" value=Name(id='d', ctx=Load()),\n" +" ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='b',\n" +" value=Name(id='c', ctx=Load())),\n" +" keyword(\n" +" value=Name(id='e', ctx=Load()))]))" -msgid "A keyword argument to a function call or class definition. ``arg`` is a raw string of the parameter name, ``value`` is a node to pass in." +msgid "" +"A keyword argument to a function call or class definition. ``arg`` is a raw string " +"of the parameter name, ``value`` is a node to pass in." msgstr "" +"یک آرگومان کلیدواژه‌ای برای فراخوانی تابع یا تعریف کلاس. ``arg`` یک رشته خام از نام " +"پارامتر است، ``value`` یک گره برای ارسال است." -msgid "An expression such as ``a if b else c``. Each field holds a single node, so in the following example, all three are :class:`Name` nodes." +msgid "" +"An expression such as ``a if b else c``. Each field holds a single node, so in the " +"following example, all three are :class:`Name` nodes." msgstr "" +"یک عبارت مانند ``a if b else c``. هر فیلد یک گره را نگه می‌دارد، بنابراین در مثال " +"زیر، هر سه، گره‌های :class:`Name` هستند." msgid "" ">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" @@ -551,9 +1405,22 @@ msgid "" " body=Name(id='a', ctx=Load()),\n" " orelse=Name(id='c', ctx=Load())))" msgstr "" +">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" +"Expression(\n" +" body=IfExp(\n" +" test=Name(id='b', ctx=Load()),\n" +" body=Name(id='a', ctx=Load()),\n" +" orelse=Name(id='c', ctx=Load())))" -msgid "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:`Name`. ``attr`` is a bare string giving the name of the attribute, and ``ctx`` is :class:`Load`, :class:`Store` or :class:`Del` according to how the attribute is acted on." +msgid "" +"Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:`Name`. " +"``attr`` is a bare string giving the name of the attribute, and ``ctx`` " +"is :class:`Load`, :class:`Store` or :class:`Del` according to how the attribute is " +"acted on." msgstr "" +"دسترسی به ویژگی، مثلاً ``d.keys``. ``value`` یک گره است، معمولاً یک :class:`Name`. " +"``attr`` یک رشته‌ی ساده است که نام ویژگی را مشخص می‌کند، و ``ctx`` بسته به نوع عمل " +"انجام‌شده روی ویژگی، :class:`Load`، :class:`Store` یا :class:`Del` است." msgid "" ">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" @@ -563,9 +1430,23 @@ msgid "" " attr='colour',\n" " ctx=Load()))" msgstr "" +">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Attribute(\n" +" value=Name(id='snake', ctx=Load()),\n" +" attr='colour',\n" +" ctx=Load()))" -msgid "A named expression. This AST node is produced by the assignment expressions operator (also known as the walrus operator). As opposed to the :class:`Assign` node in which the first argument can be multiple nodes, in this case both ``target`` and ``value`` must be single nodes." +msgid "" +"A named expression. This AST node is produced by the assignment expressions " +"operator (also known as the walrus operator). As opposed to the :class:`Assign` " +"node in which the first argument can be multiple nodes, in this case both " +"``target`` and ``value`` must be single nodes." msgstr "" +"یک عبارت نام‌دار. این گره AST توسط عملگر عبارت انتساب (که به عملگر walrus نیز " +"شناخته می‌شود) تولید می‌شود. برخلاف گره :class:`Assign` که در آن اولین آرگومان " +"می‌تواند چندین گره باشد، در این حالت هر دو ``target`` و ``value`` باید گره‌های تکی " +"باشند." msgid "" ">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" @@ -574,12 +1455,26 @@ msgid "" " target=Name(id='x', ctx=Store()),\n" " value=Constant(value=4)))" msgstr "" +">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=NamedExpr(\n" +" target=Name(id='x', ctx=Store()),\n" +" value=Constant(value=4)))" msgid "Subscripting" -msgstr "" +msgstr "اندیس‌گذاری" -msgid "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually sequence or mapping). ``slice`` is an index, slice or key. It can be a :class:`Tuple` and contain a :class:`Slice`. ``ctx`` is :class:`Load`, :class:`Store` or :class:`Del` according to the action performed with the subscript." +msgid "" +"A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " +"sequence or mapping). ``slice`` is an index, slice or key. It can be " +"a :class:`Tuple` and contain a :class:`Slice`. ``ctx`` " +"is :class:`Load`, :class:`Store` or :class:`Del` according to the action performed " +"with the subscript." msgstr "" +"یک زیرنویس (subscript)، مانند ``l[1]``. ``value`` شیء زیرنویس‌شده است (معمولاً یک " +"دنباله یا نگاشت). ``slice`` یک اندیس، برش (slice) یا کلید است. این می‌تواند " +"یک :class:`Tuple` باشد و شامل یک :class:`Slice` شود. ``ctx`` بسته به عملیات " +"انجام‌شده با زیرنویس، :class:`Load`، :class:`Store` یا :class:`Del` است." msgid "" ">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" @@ -595,9 +1490,27 @@ msgid "" " ctx=Load()),\n" " ctx=Load()))" msgstr "" +">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" Constant(value=3)],\n" +" ctx=Load()),\n" +" ctx=Load()))" -msgid "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can occur only inside the *slice* field of :class:`Subscript`, either directly or as an element of :class:`Tuple`." +msgid "" +"Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can occur " +"only inside the *slice* field of :class:`Subscript`, either directly or as an " +"element of :class:`Tuple`." msgstr "" +"برش معمولی (به‌شکل ``lower:upper`` یا ``lower:upper:step``). فقط می‌تواند درون فیلد " +"*slice* در :class:`Subscript` رخ دهد، چه به‌صورت مستقیم و چه به‌عنوان عنصری " +"از :class:`Tuple`." msgid "" ">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" @@ -609,15 +1522,28 @@ msgid "" " upper=Constant(value=2)),\n" " ctx=Load()))" msgstr "" +">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" ctx=Load()))" msgid "Comprehensions" -msgstr "" +msgstr "درک‌ها" -msgid "List and set comprehensions, generator expressions, and dictionary comprehensions. ``elt`` (or ``key`` and ``value``) is a single node representing the part that will be evaluated for each item." +msgid "" +"List and set comprehensions, generator expressions, and dictionary comprehensions. " +"``elt`` (or ``key`` and ``value``) is a single node representing the part that " +"will be evaluated for each item." msgstr "" +"درک‌های فهرستی و مجموعه‌ای، عبارات تولیدگر، و درک‌های دیکشنری. ``elt`` (یا ``key`` و " +"``value``) یک گره واحد است که نشان‌دهنده‌ی بخشی است که برای هر آیتم ارزیابی می‌شود." msgid "``generators`` is a list of :class:`comprehension` nodes." -msgstr "" +msgstr "``generators`` فهرستی از گره‌های :class:`comprehension` است." msgid "" ">>> print(ast.dump(\n" @@ -661,15 +1587,68 @@ msgid "" " iter=Name(id='numbers', ctx=Load()),\n" " is_async=0)]))" msgstr "" +">>> print(ast.dump(\n" +"... ast.parse('[x for x in numbers]', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x: x**2 for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=DictComp(\n" +" key=Name(id='x', ctx=Load()),\n" +" value=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" +"Expression(\n" +" body=SetComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" is_async=0)]))" -msgid "One ``for`` clause in a comprehension. ``target`` is the reference to use for each element - typically a :class:`Name` or :class:`Tuple` node. ``iter`` is the object to iterate over. ``ifs`` is a list of test expressions: each ``for`` clause can have multiple ``ifs``." +msgid "" +"One ``for`` clause in a comprehension. ``target`` is the reference to use for each " +"element - typically a :class:`Name` or :class:`Tuple` node. ``iter`` is the object " +"to iterate over. ``ifs`` is a list of test expressions: each ``for`` clause can " +"have multiple ``ifs``." msgstr "" +"یک بند ``for`` در یک درک. ``target`` مرجعی است که برای هر عنصر استفاده می‌شود، " +"معمولاً یک گره :class:`Name` یا :class:`Tuple`. ``iter`` شیء‌ای است که بر آن تکرار " +"می‌شود. ``ifs`` فهرستی از عبارات آزمون است: هر بند ``for`` می‌تواند چندین ``ifs`` " +"داشته باشد." -msgid "``is_async`` indicates a comprehension is asynchronous (using an ``async for`` instead of ``for``). The value is an integer (0 or 1)." +msgid "" +"``is_async`` indicates a comprehension is asynchronous (using an ``async for`` " +"instead of ``for``). The value is an integer (0 or 1)." msgstr "" +"``is_async`` نشان می‌دهد که یک درک ناهمگام است (به جای ``for`` از ``async for`` " +"استفاده می‌کند). مقدار آن یک عدد صحیح (۰ یا ۱) است." msgid "" -">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', mode='eval'),\n" +">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " +"mode='eval'),\n" "... indent=4)) # Multiple comprehensions in one.\n" "Expression(\n" " body=ListComp(\n" @@ -725,18 +1704,81 @@ msgid "" " iter=Name(id='soc', ctx=Load()),\n" " is_async=1)]))" msgstr "" +">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " +"mode='eval'),\n" +"... indent=4)) # Multiple comprehensions in one.\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Call(\n" +" func=Name(id='ord', ctx=Load()),\n" +" args=[\n" +" Name(id='c', ctx=Load())]),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='line', ctx=Store()),\n" +" iter=Name(id='file', ctx=Load()),\n" +" is_async=0),\n" +" comprehension(\n" +" target=Name(id='c', ctx=Store()),\n" +" iter=Name(id='line', ctx=Load()),\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', mode='eval'),\n" +"... indent=4)) # generator comprehension\n" +"Expression(\n" +" body=GeneratorExp(\n" +" elt=BinOp(\n" +" left=Name(id='n', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='n', ctx=Store()),\n" +" iter=Name(id='it', ctx=Load()),\n" +" ifs=[\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Lt()],\n" +" comparators=[\n" +" Constant(value=10)])],\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('[i async for i in soc]', mode='eval'),\n" +"... indent=4)) # Async comprehension\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='i', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='i', ctx=Store()),\n" +" iter=Name(id='soc', ctx=Load()),\n" +" is_async=1)]))" msgid "Statements" -msgstr "" +msgstr "دستورها" -msgid "An assignment. ``targets`` is a list of nodes, and ``value`` is a single node." -msgstr "" +msgid "" +"An assignment. ``targets`` is a list of nodes, and ``value`` is a single node." +msgstr "یک انتساب. ``targets`` فهرستی از گره‌ها است، و ``value`` یک گره واحد است." -msgid "Multiple nodes in ``targets`` represents assigning the same value to each. Unpacking is represented by putting a :class:`Tuple` or :class:`List` within ``targets``." +msgid "" +"Multiple nodes in ``targets`` represents assigning the same value to each. " +"Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " +"``targets``." msgstr "" +"گره‌های متعدد در ``targets`` نشان‌دهنده‌ی انتساب یک مقدار یکسان به هر یک هستند. " +"واگشایی با قرار دادن یک :class:`Tuple` یا :class:`List` درون ``targets`` نمایش " +"داده می‌شود." msgid "``type_comment`` is an optional string with the type annotation as a comment." -msgstr "" +msgstr "``type_comment`` یک رشته اختیاری حاوی حاشیه‌نویسی نوع به‌صورت کامنت است." msgid "" ">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" @@ -760,12 +1802,49 @@ msgid "" " ctx=Store())],\n" " value=Name(id='c', ctx=Load()))])" msgstr "" - -msgid "An assignment with a type annotation. ``target`` is a single node and can be a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. ``annotation`` is the annotation, such as a :class:`Constant` or :class:`Name` node. ``value`` is a single optional node." -msgstr "" - -msgid "``simple`` is always either 0 (indicating a \"complex\" target) or 1 (indicating a \"simple\" target). A \"simple\" target consists solely of a :class:`Name` node that does not appear between parentheses; all other targets are considered complex. Only simple targets appear in the :attr:`~object.__annotations__` dictionary of modules and classes." +">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" value=Constant(value=1))])\n" +"\n" +">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='c', ctx=Load()))])" + +msgid "" +"An assignment with a type annotation. ``target`` is a single node and can be " +"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. ``annotation`` is " +"the annotation, such as a :class:`Constant` or :class:`Name` node. ``value`` is a " +"single optional node." +msgstr "" +"یک انتساب با حاشیه‌نویسی نوع. ``target`` یک گره واحد است و می‌تواند " +"یک :class:`Name`، یک :class:`Attribute` یا یک :class:`Subscript` باشد. " +"``annotation`` حاشیه‌نویسی است، مانند یک گره :class:`Constant` یا :class:`Name`. " +"``value`` یک گره واحد اختیاری است." + +msgid "" +"``simple`` is always either 0 (indicating a \"complex\" target) or 1 (indicating a " +"\"simple\" target). A \"simple\" target consists solely of a :class:`Name` node " +"that does not appear between parentheses; all other targets are considered " +"complex. Only simple targets appear in the :attr:`~object.__annotations__` " +"dictionary of modules and classes." msgstr "" +"``simple`` همیشه یا ۰ است (نشان‌دهنده‌ی یک هدف «پیچیده») یا ۱ (نشان‌دهنده‌ی یک هدف " +"«ساده»). یک هدف «ساده» فقط شامل یک گره :class:`Name` است که بین پرانتز قرار ندارد؛ " +"تمام اهداف دیگر پیچیده محسوب می‌شوند. تنها اهداف ساده در " +"دیکشنری :attr:`~object.__annotations__` ماژول‌ها و کلاس‌ها ظاهر می‌شوند." msgid "" ">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" @@ -776,7 +1855,8 @@ msgid "" " annotation=Name(id='int', ctx=Load()),\n" " simple=1)])\n" "\n" -">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with parenthesis\n" +">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " +"parenthesis\n" "Module(\n" " body=[\n" " AnnAssign(\n" @@ -807,12 +1887,61 @@ msgid "" " annotation=Name(id='int', ctx=Load()),\n" " simple=0)])" msgstr "" +">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='c', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=1)])\n" +"\n" +">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " +"parenthesis\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='a', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" value=Constant(value=1),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Attribute(\n" +" value=Name(id='a', ctx=Load()),\n" +" attr='b',\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)])\n" +"\n" +">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Subscript(\n" +" value=Name(id='a', ctx=Load()),\n" +" slice=Constant(value=1),\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)])" -msgid "Augmented assignment, such as ``a += 1``. In the following example, ``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with value for 1." +msgid "" +"Augmented assignment, such as ``a += 1``. In the following example, ``target`` is " +"a :class:`Name` node for ``x`` (with the :class:`Store` context), ``op`` " +"is :class:`Add`, and ``value`` is a :class:`Constant` with value for 1." msgstr "" +"انتساب تقویتی، مانند ``a += 1``. در مثال زیر، ``target`` یک گره :class:`Name` برای " +"``x`` (با زمینه‌ی :class:`Store`) است، ``op`` :class:`Add` است، و ``value`` " +"یک :class:`Constant` با مقدار ۱ است." -msgid "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, unlike the targets of :class:`Assign`." +msgid "" +"The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " +"unlike the targets of :class:`Assign`." msgstr "" +"ویژگی ``target`` نمی‌تواند از کلاس :class:`Tuple` یا :class:`List` باشد، برخلاف " +"هدف‌های :class:`Assign`." msgid "" ">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" @@ -823,9 +1952,22 @@ msgid "" " op=Add(),\n" " value=Constant(value=2))])" msgstr "" +">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" +"Module(\n" +" body=[\n" +" AugAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" op=Add(),\n" +" value=Constant(value=2))])" -msgid "A ``raise`` statement. ``exc`` is the exception object to be raised, normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone ``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." +msgid "" +"A ``raise`` statement. ``exc`` is the exception object to be raised, normally " +"a :class:`Call` or :class:`Name`, or ``None`` for a standalone ``raise``. " +"``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" +"یک دستور ``raise``. ``exc`` شیء استثنا است که پرتاب می‌شود، معمولاً یک :class:`Call` " +"یا :class:`Name`، یا ``None`` برای یک ``raise`` مستقل. ``cause`` بخش اختیاری برای " +"``y`` در ``raise x from y`` است." msgid "" ">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" @@ -835,9 +1977,19 @@ msgid "" " exc=Name(id='x', ctx=Load()),\n" " cause=Name(id='y', ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Raise(\n" +" exc=Name(id='x', ctx=Load()),\n" +" cause=Name(id='y', ctx=Load()))])" -msgid "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. ``msg`` holds the failure message." +msgid "" +"An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " +"``msg`` holds the failure message." msgstr "" +"یک ادعا. ``test`` حاوی شرط است، مانند یک گره :class:`Compare`. ``msg`` حاوی پیام " +"شکست است." msgid "" ">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" @@ -847,9 +1999,19 @@ msgid "" " test=Name(id='x', ctx=Load()),\n" " msg=Name(id='y', ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assert(\n" +" test=Name(id='x', ctx=Load()),\n" +" msg=Name(id='y', ctx=Load()))])" -msgid "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." +msgid "" +"Represents a ``del`` statement. ``targets`` is a list of nodes, such " +"as :class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" +"نشان‌دهنده‌ی یک دستور ``del`` است. ``targets`` فهرستی از گره‌ها است، مانند " +"گره‌های :class:`Name`، :class:`Attribute` یا :class:`Subscript`." msgid "" ">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" @@ -861,9 +2023,17 @@ msgid "" " Name(id='y', ctx=Del()),\n" " Name(id='z', ctx=Del())])])" msgstr "" +">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='x', ctx=Del()),\n" +" Name(id='y', ctx=Del()),\n" +" Name(id='z', ctx=Del())])])" msgid "A ``pass`` statement." -msgstr "" +msgstr "یک دستور ``pass``." msgid "" ">>> print(ast.dump(ast.parse('pass'), indent=4))\n" @@ -871,9 +2041,19 @@ msgid "" " body=[\n" " Pass()])" msgstr "" +">>> print(ast.dump(ast.parse('pass'), indent=4))\n" +"Module(\n" +" body=[\n" +" Pass()])" -msgid "A :ref:`type alias ` created through the :keyword:`type` statement. ``name`` is the name of the alias, ``type_params`` is a list of :ref:`type parameters `, and ``value`` is the value of the type alias." +msgid "" +"A :ref:`type alias ` created through the :keyword:`type` statement. " +"``name`` is the name of the alias, ``type_params`` is a list of :ref:`type " +"parameters `, and ``value`` is the value of the type alias." msgstr "" +"یک :ref:`نام مستعار نوع ` که از طریق دستور :keyword:`type` ایجاد شده " +"است. ``name`` نام این نام مستعار است، ``type_params`` فهرستی از :ref:`پارامترهای " +"نوع ` است، و ``value`` مقدار این نام مستعار نوع است." msgid "" ">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" @@ -883,15 +2063,25 @@ msgid "" " name=Name(id='Alias', ctx=Store()),\n" " value=Name(id='int', ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" value=Name(id='int', ctx=Load()))])" -msgid "Other statements which are only applicable inside functions or loops are described in other sections." +msgid "" +"Other statements which are only applicable inside functions or loops are described " +"in other sections." msgstr "" +"دستورهای دیگر که فقط داخل توابع یا حلقه‌ها قابل استفاده هستند، در بخش‌های دیگر شرح " +"داده شده‌اند." msgid "Imports" -msgstr "" +msgstr "ایمپورت‌ها" msgid "An import statement. ``names`` is a list of :class:`alias` nodes." -msgstr "" +msgstr "یک دستور ایمپورت. ``names`` فهرستی از گره‌های :class:`alias` است." msgid "" ">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" @@ -903,9 +2093,25 @@ msgid "" " alias(name='y'),\n" " alias(name='z')])])" msgstr "" +">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Import(\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')])])" -msgid "Represents ``from x import y``. ``module`` is a raw string of the 'from' name, without any leading dots, or ``None`` for statements such as ``from . import foo``. ``level`` is an integer holding the level of the relative import (0 means absolute import)." +msgid "" +"Represents ``from x import y``. ``module`` is a raw string of the 'from' name, " +"without any leading dots, or ``None`` for statements such as ``from . import " +"foo``. ``level`` is an integer holding the level of the relative import (0 means " +"absolute import)." msgstr "" +"نشان‌دهنده‌ی ``from x import y`` است. ``module`` یک رشته خام از نام 'from'، بدون هیچ " +"نقطه‌ی ابتدایی، یا ``None`` برای دستورهایی مانند ``from . import foo`` است. " +"``level`` یک عدد صحیح است که سطح ایمپورت نسبی را نگه می‌دارد (۰ به معنای ایمپورت " +"مطلق است)." msgid "" ">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" @@ -919,9 +2125,23 @@ msgid "" " alias(name='z')],\n" " level=0)])" msgstr "" +">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='y',\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')],\n" +" level=0)])" -msgid "Both parameters are raw strings of the names. ``asname`` can be ``None`` if the regular name is to be used." +msgid "" +"Both parameters are raw strings of the names. ``asname`` can be ``None`` if the " +"regular name is to be used." msgstr "" +"هر دو پارامتر، رشته‌های خام نام‌ها هستند. اگر قرار باشد از نام معمولی استفاده شود، " +"``asname`` می‌تواند ``None`` باشد." msgid "" ">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" @@ -934,18 +2154,39 @@ msgid "" " alias(name='c')],\n" " level=2)])" msgstr "" +">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='foo.bar',\n" +" names=[\n" +" alias(name='a', asname='b'),\n" +" alias(name='c')],\n" +" level=2)])" msgid "Control flow" -msgstr "" +msgstr "کنترل جریان" -msgid "Optional clauses such as ``else`` are stored as an empty list if they're not present." +msgid "" +"Optional clauses such as ``else`` are stored as an empty list if they're not " +"present." msgstr "" +"بندهای اختیاری مانند ``else``، اگر وجود نداشته باشند، به‌صورت یک فهرست خالی ذخیره " +"می‌شوند." -msgid "An ``if`` statement. ``test`` holds a single node, such as a :class:`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." +msgid "" +"An ``if`` statement. ``test`` holds a single node, such as a :class:`Compare` " +"node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" +"یک دستور ``if``. ``test`` یک گره واحد را نگه می‌دارد، مانند یک " +"گره :class:`Compare`. ``body`` و ``orelse`` هر کدام فهرستی از گره‌ها را نگه می‌دارند." -msgid "``elif`` clauses don't have a special representation in the AST, but rather appear as extra :class:`If` nodes within the ``orelse`` section of the previous one." +msgid "" +"``elif`` clauses don't have a special representation in the AST, but rather appear " +"as extra :class:`If` nodes within the ``orelse`` section of the previous one." msgstr "" +"بندهای ``elif`` بازنمایی خاصی در AST ندارند، بلکه به‌صورت گره‌های اضافی :class:`If` " +"در بخش ``orelse`` گره پیشین ظاهر می‌شوند." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -973,9 +2214,45 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... if x:\n" +"... ...\n" +"... elif y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" If(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" If(\n" +" test=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :class:`Subscript` node. ``iter`` holds the item to be looped over, again as a single node. ``body`` and ``orelse`` contain lists of nodes to execute. Those in ``orelse`` are executed if the loop finishes normally, rather than via a ``break`` statement." -msgstr "" +msgid "" +"A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " +"single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` " +"or :class:`Subscript` node. ``iter`` holds the item to be looped over, again as a " +"single node. ``body`` and ``orelse`` contain lists of nodes to execute. Those in " +"``orelse`` are executed if the loop finishes normally, rather than via a ``break`` " +"statement." +msgstr "" +"یک حلقه ``for``. ``target`` متغیر(ها)یی را که حلقه به آن‌ها انتساب می‌دهد، به‌صورت یک " +"گره از نوع :class:`Name`، :class:`Tuple`، :class:`List`، :class:`Attribute` " +"یا :class:`Subscript` نگه می‌دارد. ``iter`` آیتم مورد پیمایش حلقه را، باز هم به‌صورت " +"یک گره نگه می‌دارد. ``body`` و ``orelse`` شامل فهرست‌هایی از گره‌ها برای اجرا هستند. " +"گره‌های موجود در ``orelse`` در صورتی اجرا می‌شوند که حلقه به‌طور عادی پایان یابد، نه " +"از طریق یک دستور ``break``." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -996,9 +2273,28 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... for x in y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" -msgid "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` node." +msgid "" +"A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` node." msgstr "" +"یک حلقه‌ی ``while``. ``test`` شرط را نگه می‌دارد، مانند یک گره‌ی :class:`Compare`." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1018,9 +2314,25 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... while x:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" While(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" msgid "The ``break`` and ``continue`` statements." -msgstr "" +msgstr "دستورهای ``break`` و ``continue``." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1049,9 +2361,38 @@ msgid "" " orelse=[\n" " Continue()])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... for a in b:\n" +"... if a > 5:\n" +"... break\n" +"... else:\n" +"... continue\n" +"...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='a', ctx=Store()),\n" +" iter=Name(id='b', ctx=Load()),\n" +" body=[\n" +" If(\n" +" test=Compare(\n" +" left=Name(id='a', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" body=[\n" +" Break()],\n" +" orelse=[\n" +" Continue()])])])" -msgid "``try`` blocks. All attributes are list of nodes to execute, except for ``handlers``, which is a list of :class:`ExceptHandler` nodes." +msgid "" +"``try`` blocks. All attributes are list of nodes to execute, except for " +"``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" +"بلوک‌های ``try``. همه ویژگی‌ها فهرستی از گره‌ها برای اجرا هستند، به جز ``handlers`` " +"که فهرستی از گره‌های :class:`ExceptHandler` است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1091,9 +2432,51 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except Exception:\n" +"... ...\n" +"... except OtherException as e:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... finally:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" ExceptHandler(\n" +" type=Name(id='OtherException', ctx=Load()),\n" +" name='e',\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" finalbody=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])" -msgid "``try`` blocks which are followed by ``except*`` clauses. The attributes are the same as for :class:`Try` but the :class:`ExceptHandler` nodes in ``handlers`` are interpreted as ``except*`` blocks rather than ``except``." +msgid "" +"``try`` blocks which are followed by ``except*`` clauses. The attributes are the " +"same as for :class:`Try` but the :class:`ExceptHandler` nodes in ``handlers`` are " +"interpreted as ``except*`` blocks rather than ``except``." msgstr "" +"بلوک‌های ``try`` که پس از آن‌ها بندهای ``except*`` می‌آیند. ویژگی‌ها همان " +"ویژگی‌های :class:`Try` هستند، اما گره‌های :class:`ExceptHandler` در ``handlers`` " +"به‌عنوان بلوک‌های ``except*`` تفسیر می‌شوند، نه ``except``." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1115,9 +2498,35 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except* Exception:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TryStar(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A single ``except`` clause. ``type`` is the exception type it will match, typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause). ``name`` is a raw string for the name to hold the exception, or ``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." +msgid "" +"A single ``except`` clause. ``type`` is the exception type it will match, " +"typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause). " +"``name`` is a raw string for the name to hold the exception, or ``None`` if the " +"clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" +"یک بند ``except`` واحد. ``type`` نوع استثنایی است که با آن مطابقت دارد و معمولاً یک " +"گره :class:`Name` است (یا ``None`` برای یک بند ``except:`` فراگیر). ``name`` یک " +"رشته خام برای نامی است که استثنا را نگه می‌دارد، یا ``None`` اگر بند ``as foo`` " +"نداشته باشد. ``body`` فهرستی از گره‌ها است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1141,12 +2550,44 @@ msgid "" " body=[\n" " Pass()])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... try:\n" +"... a + 1\n" +"... except TypeError:\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=BinOp(\n" +" left=Name(id='a', ctx=Load()),\n" +" op=Add(),\n" +" right=Constant(value=1)))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='TypeError', ctx=Load()),\n" +" body=[\n" +" Pass()])])])" -msgid "A ``with`` block. ``items`` is a list of :class:`withitem` nodes representing the context managers, and ``body`` is the indented block inside the context." +msgid "" +"A ``with`` block. ``items`` is a list of :class:`withitem` nodes representing the " +"context managers, and ``body`` is the indented block inside the context." msgstr "" +"یک بلوک ``with``. ``items`` فهرستی از گره‌های :class:`withitem` است که مدیران زمینه " +"را نشان می‌دهند، و ``body`` بلوک تورفته‌ی درون زمینه است." -msgid "A single context manager in a ``with`` block. ``context_expr`` is the context manager, often a :class:`Call` node. ``optional_vars`` is a :class:`Name`, :class:`Tuple` or :class:`List` for the ``as foo`` part, or ``None`` if that isn't used." +msgid "" +"A single context manager in a ``with`` block. ``context_expr`` is the context " +"manager, often a :class:`Call` node. ``optional_vars`` is " +"a :class:`Name`, :class:`Tuple` or :class:`List` for the ``as foo`` part, or " +"``None`` if that isn't used." msgstr "" +"یک مدیر زمینه‌ی واحد در یک بلوک ``with``. ``context_expr`` مدیر زمینه است و معمولاً " +"یک گره :class:`Call` است. ``optional_vars`` یک :class:`Name`، :class:`Tuple` " +"یا :class:`List` برای بخش ``as foo`` است، یا اگر از آن استفاده‌نشده باشد، ``None`` " +"است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1171,21 +2612,64 @@ msgid "" " Name(id='b', ctx=Load()),\n" " Name(id='d', ctx=Load())]))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... with a as b, c as d:\n" +"... something(b, d)\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" With(\n" +" items=[\n" +" withitem(\n" +" context_expr=Name(id='a', ctx=Load()),\n" +" optional_vars=Name(id='b', ctx=Store())),\n" +" withitem(\n" +" context_expr=Name(id='c', ctx=Load()),\n" +" optional_vars=Name(id='d', ctx=Store()))],\n" +" body=[\n" +" Expr(\n" +" value=Call(\n" +" func=Name(id='something', ctx=Load()),\n" +" args=[\n" +" Name(id='b', ctx=Load()),\n" +" Name(id='d', ctx=Load())]))])])" msgid "Pattern matching" -msgstr "" +msgstr "تطبیق الگو" -msgid "A ``match`` statement. ``subject`` holds the subject of the match (the object that is being matched against the cases) and ``cases`` contains an iterable of :class:`match_case` nodes with the different cases." +msgid "" +"A ``match`` statement. ``subject`` holds the subject of the match (the object that " +"is being matched against the cases) and ``cases`` contains an iterable " +"of :class:`match_case` nodes with the different cases." msgstr "" +"یک دستور ``match``. ``subject`` شامل موضوع تطبیق (شیءای که با حالت‌های مختلف تطبیق " +"داده می‌شود) است و ``cases`` شامل یک پیمایش‌پذیر از گره‌های :class:`match_case` برای " +"حالت‌های مختلف است." -msgid "A single case pattern in a ``match`` statement. ``pattern`` contains the match pattern that the subject will be matched against. Note that the :class:`AST` nodes produced for patterns differ from those produced for expressions, even when they share the same syntax." +msgid "" +"A single case pattern in a ``match`` statement. ``pattern`` contains the match " +"pattern that the subject will be matched against. Note that the :class:`AST` nodes " +"produced for patterns differ from those produced for expressions, even when they " +"share the same syntax." msgstr "" +"یک الگوی case منفرد در یک دستور ``match``. ``pattern`` شامل الگوی تطبیقی است که " +"موضوع با آن تطبیق داده خواهد شد. توجه داشته باشید که گره‌های :class:`AST` تولیدشده " +"برای الگوها با گره‌های تولیدشده برای عبارات متفاوت هستند، حتی زمانی که نحو یکسانی " +"دارند." -msgid "The ``guard`` attribute contains an expression that will be evaluated if the pattern matches the subject." +msgid "" +"The ``guard`` attribute contains an expression that will be evaluated if the " +"pattern matches the subject." msgstr "" +"ویژگی ``guard`` شامل عبارتی است که اگر الگو با موضوع مطابقت داشته باشد، ارزیابی " +"می‌شود." -msgid "``body`` contains a list of nodes to execute if the pattern matches and the result of evaluating the guard expression is true." +msgid "" +"``body`` contains a list of nodes to execute if the pattern matches and the result " +"of evaluating the guard expression is true." msgstr "" +"``body`` شامل فهرستی از گره‌هاست که در صورتی اجرا می‌شوند که الگو مطابقت داشته باشد " +"و نتیجه ارزیابی عبارت محافظ درست باشد." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1220,9 +2704,48 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] if x>0:\n" +"... ...\n" +"... case tuple():\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" guard=Compare(\n" +" left=Name(id='x', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=0)]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='tuple', ctx=Load())),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A match literal or value pattern that compares by equality. ``value`` is an expression node. Permitted value nodes are restricted as described in the match statement documentation. This pattern succeeds if the match subject is equal to the evaluated value." +msgid "" +"A match literal or value pattern that compares by equality. ``value`` is an " +"expression node. Permitted value nodes are restricted as described in the match " +"statement documentation. This pattern succeeds if the match subject is equal to " +"the evaluated value." msgstr "" +"یک لفظی تطبیق یا الگوی مقدار که بر اساس برابری مقایسه می‌کند. ``value`` یک گره " +"عبارت است. گره‌های مقدار مجاز، همان‌طور که در مستندات دستور تطبیق توضیح داده‌شده است، " +"محدود شده‌اند. این الگو در صورتی موفق می‌شود که موضوع تطبیق با مقدار ارزیابی‌شده " +"برابر باشد." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1242,14 +2765,101 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case \"Relevant\":\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchValue(\n" +" value=Constant(value='Relevant')),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" + +msgid "" +"A match literal pattern that compares by identity. ``value`` is the singleton to " +"be compared against: ``None``, ``True``, or ``False``. This pattern succeeds if " +"the match subject is the given constant." +msgstr "" +"یک الگوی تطبیق تحت‌اللفظی (literal) که بر اساس هویت مقایسه می‌کند. ``value`` " +"تک‌نمونه‌ای (singleton) است که با آن مقایسه می‌شود: ``None``، ``True`` یا ``False``. " +"این الگو در صورتی موفق می‌شود که موضوع تطبیق همان ثابت داده‌شده باشد." + +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case None:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSingleton(value=None),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" +msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case None:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSingleton(value=None),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" + +msgid "" +"A match sequence pattern. ``patterns`` contains the patterns to be matched against " +"the subject elements if the subject is a sequence. Matches a variable length " +"sequence if one of the subpatterns is a ``MatchStar`` node, otherwise matches a " +"fixed length sequence." +msgstr "" +"یک الگوی تطبیق دنباله. ``patterns`` شامل الگوهایی است که در صورت دنباله بودن " +"موضوع، با عناصر موضوع تطبیق داده می‌شوند. اگر یکی از زیرالگوها یک گره ``MatchStar`` " +"باشد، با یک دنباله با طول متغیر تطبیق می‌یابد، در غیر این صورت با یک دنباله با طول " +"ثابت تطبیق می‌یابد." -msgid "A match literal pattern that compares by identity. ``value`` is the singleton to be compared against: ``None``, ``True``, or ``False``. This pattern succeeds if the match subject is the given constant." +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" msgstr "" - -msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" -"... case None:\n" +"... case [1, 2]:\n" "... ...\n" "... \"\"\"), indent=4))\n" "Module(\n" @@ -1258,19 +2868,31 @@ msgid "" " subject=Name(id='x', ctx=Load()),\n" " cases=[\n" " match_case(\n" -" pattern=MatchSingleton(value=None),\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2))]),\n" " body=[\n" " Expr(\n" " value=Constant(value=Ellipsis))])])])" -msgstr "" -msgid "A match sequence pattern. ``patterns`` contains the patterns to be matched against the subject elements if the subject is a sequence. Matches a variable length sequence if one of the subpatterns is a ``MatchStar`` node, otherwise matches a fixed length sequence." +msgid "" +"Matches the rest of the sequence in a variable length match sequence pattern. If " +"``name`` is not ``None``, a list containing the remaining sequence elements is " +"bound to that name if the overall sequence pattern is successful." msgstr "" +"بقیه‌ی دنباله را در یک الگوی دنباله‌ی تطبیق با طول متغیر تطبیق می‌دهد. اگر ``name`` " +"برابر ``None`` نباشد، در صورت موفق بودن الگوی دنباله‌ی کلی، فهرستی حاوی عناصر " +"باقی‌مانده‌ی دنباله به آن نام مقید می‌شود." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" -"... case [1, 2]:\n" +"... case [1, 2, *rest]:\n" +"... ...\n" +"... case [*_]:\n" "... ...\n" "... \"\"\"), indent=4))\n" "Module(\n" @@ -1284,16 +2906,19 @@ msgid "" " MatchValue(\n" " value=Constant(value=1)),\n" " MatchValue(\n" -" value=Constant(value=2))]),\n" +" value=Constant(value=2)),\n" +" MatchStar(name='rest')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchStar()]),\n" " body=[\n" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" - -msgid "Matches the rest of the sequence in a variable length match sequence pattern. If ``name`` is not ``None``, a list containing the remaining sequence elements is bound to that name if the overall sequence pattern is successful." -msgstr "" - -msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" "... case [1, 2, *rest]:\n" @@ -1324,13 +2949,29 @@ msgid "" " body=[\n" " Expr(\n" " value=Constant(value=Ellipsis))])])])" -msgstr "" -msgid "A match mapping pattern. ``keys`` is a sequence of expression nodes. ``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as described in the match statement documentation." +msgid "" +"A match mapping pattern. ``keys`` is a sequence of expression nodes. ``patterns`` " +"is a corresponding sequence of pattern nodes. ``rest`` is an optional name that " +"can be specified to capture the remaining mapping elements. Permitted key " +"expressions are restricted as described in the match statement documentation." msgstr "" +"یک الگوی نگاشت تطبیق. ``keys`` دنباله‌ای از گره‌های عبارت است. ``patterns`` دنباله‌ای " +"متناظر از گره‌های الگو است. ``rest`` نامی اختیاری است که می‌توان آن را برای گرفتن " +"عناصر باقی‌مانده‌ی نگاشت مشخص کرد. عبارات مجاز برای کلیدها، همان‌طور که در مستندات " +"دستور match توضیح داده شده است، محدود شده‌اند." -msgid "This pattern succeeds if the subject is a mapping, all evaluated key expressions are present in the mapping, and the value corresponding to each key matches the corresponding subpattern. If ``rest`` is not ``None``, a dict containing the remaining mapping elements is bound to that name if the overall mapping pattern is successful." +msgid "" +"This pattern succeeds if the subject is a mapping, all evaluated key expressions " +"are present in the mapping, and the value corresponding to each key matches the " +"corresponding subpattern. If ``rest`` is not ``None``, a dict containing the " +"remaining mapping elements is bound to that name if the overall mapping pattern is " +"successful." msgstr "" +"این الگو زمانی موفق می‌شود که سوژه یک نگاشت باشد، همه عبارت‌های کلید ارزیابی‌شده در " +"نگاشت وجود داشته باشند، و مقدار متناظر با هر کلید با زیرالگوی متناظر مطابقت داشته " +"باشد. اگر ``rest`` برابر ``None`` نباشد، یک دیکشنری شامل عناصر باقی‌مانده نگاشت، در " +"صورت موفقیت کل الگوی نگاشت، به آن نام مقید می‌شود." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1362,15 +3003,67 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case {1: _, 2: _}:\n" +"... ...\n" +"... case {**rest}:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchMapping(\n" +" keys=[\n" +" Constant(value=1),\n" +" Constant(value=2)],\n" +" patterns=[\n" +" MatchAs(),\n" +" MatchAs()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchMapping(rest='rest'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A match class pattern. ``cls`` is an expression giving the nominal class to be matched. ``patterns`` is a sequence of pattern nodes to be matched against the class defined sequence of pattern matching attributes. ``kwd_attrs`` is a sequence of additional attributes to be matched (specified as keyword arguments in the class pattern), ``kwd_patterns`` are the corresponding patterns (specified as keyword values in the class pattern)." -msgstr "" +msgid "" +"A match class pattern. ``cls`` is an expression giving the nominal class to be " +"matched. ``patterns`` is a sequence of pattern nodes to be matched against the " +"class defined sequence of pattern matching attributes. ``kwd_attrs`` is a sequence " +"of additional attributes to be matched (specified as keyword arguments in the " +"class pattern), ``kwd_patterns`` are the corresponding patterns (specified as " +"keyword values in the class pattern)." +msgstr "" +"یک الگوی تطبیق کلاس. ``cls`` عبارتی است که کلاس اسمی مورد تطبیق را مشخص می‌کند. " +"``patterns`` دنباله‌ای از گره‌های الگو است که باید با دنباله‌ای از ویژگی‌های تطبیق " +"الگو که کلاس آن را تعریف کرده است تطبیق داده شوند. ``kwd_attrs`` دنباله‌ای از " +"ویژگی‌های اضافی برای تطبیق است (که به‌صورت آرگومان‌های کلیدواژه‌ای در الگوی کلاس مشخص " +"می‌شوند)، ``kwd_patterns`` الگوهای متناظر هستند (که به‌صورت مقادیر کلیدواژه‌ای در " +"الگوی کلاس مشخص می‌شوند)." -msgid "This pattern succeeds if the subject is an instance of the nominated class, all positional patterns match the corresponding class-defined attributes, and any specified keyword attributes match their corresponding pattern." +msgid "" +"This pattern succeeds if the subject is an instance of the nominated class, all " +"positional patterns match the corresponding class-defined attributes, and any " +"specified keyword attributes match their corresponding pattern." msgstr "" +"این الگو در صورتی موفق می‌شود که موضوع یک نمونه از کلاس نام‌برده‌شده باشد، همه‌ی " +"الگوهای جایگاهی با ویژگی‌های متناظر تعریف‌شده در کلاس مطابقت داشته باشند، و هر یک از " +"ویژگی‌های کلیدواژه‌ای مشخص‌شده با الگوی متناظر خود مطابقت داشته باشند." -msgid "Note: classes may define a property that returns self in order to match a pattern node against the instance being matched. Several builtin types are also matched that way, as described in the match statement documentation." +msgid "" +"Note: classes may define a property that returns self in order to match a pattern " +"node against the instance being matched. Several builtin types are also matched " +"that way, as described in the match statement documentation." msgstr "" +"نکته: کلاس‌ها ممکن است یک پراپرتی تعریف کنند که self را برمی‌گرداند تا یک گره الگو " +"را با نمونه‌ای که در حال تطبیق است، تطبیق دهند. چندین نوع توکار نیز به همین روش " +"تطبیق داده می‌شوند، همان‌طور که در مستندات دستور match توضیح داده شده است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1414,12 +3107,66 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case Point2D(0, 0):\n" +"... ...\n" +"... case Point3D(x=0, y=0, z=0):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point2D', ctx=Load()),\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point3D', ctx=Load()),\n" +" kwd_attrs=[\n" +" 'x',\n" +" 'y',\n" +" 'z'],\n" +" kwd_patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` contains the match pattern that the subject will be matched against. If the pattern is ``None``, the node represents a capture pattern (i.e a bare name) and will always succeed." +msgid "" +"A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` contains " +"the match pattern that the subject will be matched against. If the pattern is " +"``None``, the node represents a capture pattern (i.e a bare name) and will always " +"succeed." msgstr "" +"یک «الگوی as» (as-pattern) در تطبیق، یک الگوی ثبت‌کننده (capture pattern) یا یک الگوی " +"wildcard (wildcard pattern). ``pattern`` شامل الگوی تطبیقی است که موضوع با آن " +"تطبیق داده خواهد شد. اگر الگو ``None`` باشد، این گره بیانگر یک الگوی گرفتن (یعنی " +"یک نام ساده) است و همیشه با موفقیت تطبیق داده خواهد شد." -msgid "The ``name`` attribute contains the name that will be bound if the pattern is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` and the node represents the wildcard pattern." +msgid "" +"The ``name`` attribute contains the name that will be bound if the pattern is " +"successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` and the " +"node represents the wildcard pattern." msgstr "" +"ویژگی ``name`` شامل نامی است که در صورت موفقیت الگو مقید خواهد شد. اگر ``name`` " +"برابر ``None`` باشد، ``pattern`` نیز باید ``None`` باشد و گره نشان‌دهنده‌ی الگوی عام " +"(wildcard) است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1449,9 +3196,43 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] as y:\n" +"... ...\n" +"... case _:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchAs(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" name='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchAs(),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" -msgid "A match \"or-pattern\". An or-pattern matches each of its subpatterns in turn to the subject, until one succeeds. The or-pattern is then deemed to succeed. If none of the subpatterns succeed the or-pattern fails. The ``patterns`` attribute contains a list of match pattern nodes that will be matched against the subject." +msgid "" +"A match \"or-pattern\". An or-pattern matches each of its subpatterns in turn to " +"the subject, until one succeeds. The or-pattern is then deemed to succeed. If none " +"of the subpatterns succeed the or-pattern fails. The ``patterns`` attribute " +"contains a list of match pattern nodes that will be matched against the subject." msgstr "" +"یک «الگوی یا» (or-pattern) در تطبیق. یک الگوی یا هر یک از الگوهای فرعی خود را " +"به‌نوبت با موضوع تطبیق می‌دهد، تا یکی موفق شود. سپس الگوی یا موفق تلقی می‌شود. اگر " +"هیچ‌کدام از الگوهای فرعی موفق نشوند، الگوی یا شکست می‌خورد. ویژگی ``patterns`` شامل " +"فهرستی از گره‌های الگوی تطبیق است که با موضوع تطبیق داده می‌شوند." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" @@ -1475,15 +3256,40 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))])])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] | (y):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchOr(\n" +" patterns=[\n" +" MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" MatchAs(name='y')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])])" msgid "Type annotations" -msgstr "" +msgstr "حاشیه‌نویسی‌های نوع" -msgid "A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag specified by the form ``# type: ignore ``." +msgid "" +"A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag " +"specified by the form ``# type: ignore ``." msgstr "" +"یک کامنت ``# type: ignore`` در *lineno* قرار دارد. *tag* برچسب اختیاری است که با " +"قالب ``# type: ignore `` مشخص می‌شود." msgid "" -">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), indent=4))\n" +">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " +"indent=4))\n" "Module(\n" " body=[\n" " Assign(\n" @@ -1492,7 +3298,8 @@ msgid "" " value=Constant(value=1))],\n" " type_ignores=[\n" " TypeIgnore(lineno=1, tag='')])\n" -">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', type_comments=True), indent=4))\n" +">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', " +"type_comments=True), indent=4))\n" "Module(\n" " body=[\n" " AnnAssign(\n" @@ -1503,18 +3310,58 @@ msgid "" " type_ignores=[\n" " TypeIgnore(lineno=1, tag='[assignment]')])" msgstr "" +">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='')])\n" +">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', " +"type_comments=True), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" annotation=Name(id='bool', ctx=Load()),\n" +" value=Constant(value=1),\n" +" simple=1)],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='[assignment]')])" -msgid ":class:`!TypeIgnore` nodes are not generated when the *type_comments* parameter is set to ``False`` (default). See :func:`ast.parse` for more details." +msgid "" +":class:`!TypeIgnore` nodes are not generated when the *type_comments* parameter is " +"set to ``False`` (default). See :func:`ast.parse` for more details." msgstr "" +"گره‌های :class:`!TypeIgnore` زمانی که پارامتر *type_comments* روی ``False`` " +"(پیش‌فرض) تنظیم شده باشد، ایجاد نمی‌شوند. برای جزئیات بیشتر :func:`ast.parse` را " +"ببینید." msgid "Type parameters" -msgstr "" +msgstr "پارامترهای نوع" -msgid ":ref:`Type parameters ` can exist on classes, functions, and type aliases." +msgid "" +":ref:`Type parameters ` can exist on classes, functions, and type " +"aliases." msgstr "" +":ref:`پارامترهای نوع ` می‌توانند در کلاس‌ها، توابع و نام‌های مستعار نوع " +"وجود داشته باشند." -msgid "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. ``bound`` is the bound or constraints, if any. If ``bound`` is a :class:`Tuple`, it represents constraints; otherwise it represents the bound. ``default_value`` is the default value; if the :class:`!TypeVar` has no default, this attribute will be set to ``None``." -msgstr "" +msgid "" +"A :class:`typing.TypeVar`. ``name`` is the name of the type variable. ``bound`` is " +"the bound or constraints, if any. If ``bound`` is a :class:`Tuple`, it represents " +"constraints; otherwise it represents the bound. ``default_value`` is the default " +"value; if the :class:`!TypeVar` has no default, this attribute will be set to " +"``None``." +msgstr "" +"یک :class:`typing.TypeVar`. ``name`` نام متغیر نوع است. ``bound`` کران یا " +"محدودیت‌ها است، در صورت وجود. اگر ``bound`` یک :class:`Tuple` باشد، بیانگر " +"محدودیت‌ها است؛ در غیر این صورت بیانگر کران است. ``default_value`` مقدار پیش‌فرض " +"است؛ اگر :class:`!TypeVar` مقدار پیش‌فرض نداشته باشد، این ویژگی روی ``None`` تنظیم " +"خواهد شد." msgid "" ">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), indent=4))\n" @@ -1532,15 +3379,36 @@ msgid "" " slice=Name(id='T', ctx=Load()),\n" " ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVar(\n" +" name='T',\n" +" bound=Name(id='int', ctx=Load()),\n" +" default_value=Name(id='bool', ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='list', ctx=Load()),\n" +" slice=Name(id='T', ctx=Load()),\n" +" ctx=Load()))])" msgid "Added the *default_value* parameter." -msgstr "" +msgstr "پارامتر *default_value* افزوده شد." -msgid "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification. ``default_value`` is the default value; if the :class:`!ParamSpec` has no default, this attribute will be set to ``None``." +msgid "" +"A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification. " +"``default_value`` is the default value; if the :class:`!ParamSpec` has no default, " +"this attribute will be set to ``None``." msgstr "" +"یک :class:`typing.ParamSpec`. ``name`` نام مشخصه پارامتر است. ``default_value`` " +"مقدار پیش‌فرض است؛ اگر :class:`!ParamSpec` پیش‌فرضی نداشته باشد، این ویژگی به " +"``None`` تنظیم می‌شود." msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, int]\"), indent=4))\n" +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, int]\"), " +"indent=4))\n" "Module(\n" " body=[\n" " TypeAlias(\n" @@ -1562,9 +3430,37 @@ msgid "" " ctx=Load()),\n" " ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, int]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" ParamSpec(\n" +" name='P',\n" +" default_value=List(\n" +" elts=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='Callable', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Name(id='P', ctx=Load()),\n" +" Name(id='int', ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))])" -msgid "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` has no default, this attribute will be set to ``None``." +msgid "" +"A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple. " +"``default_value`` is the default value; if the :class:`!TypeVarTuple` has no " +"default, this attribute will be set to ``None``." msgstr "" +"یک :class:`typing.TypeVarTuple` است. ``name`` نام تاپل متغیر نوع است. " +"``default_value`` مقدار پیش‌فرض است؛ اگر :class:`!TypeVarTuple` پیش‌فرضی نداشته " +"باشد، این ویژگی روی ``None`` تنظیم می‌شود." msgid "" ">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), indent=4))\n" @@ -1586,38 +3482,75 @@ msgid "" " ctx=Load()),\n" " ctx=Load()))])" msgstr "" +">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVarTuple(\n" +" name='Ts',\n" +" default_value=Tuple(ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='tuple', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Starred(\n" +" value=Name(id='Ts', ctx=Load()),\n" +" ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))])" msgid "Function and class definitions" -msgstr "" +msgstr "تعاریف تابع و کلاس" msgid "A function definition." -msgstr "" +msgstr "تعریف یک تابع." msgid "``name`` is a raw string of the function name." -msgstr "" +msgstr "``name`` یک رشته خام از نام تابع است." msgid "``args`` is an :class:`arguments` node." -msgstr "" +msgstr "``args`` یک گره :class:`arguments` است." msgid "``body`` is the list of nodes inside the function." -msgstr "" +msgstr "``body`` فهرست گره‌های درون تابع است." -msgid "``decorator_list`` is the list of decorators to be applied, stored outermost first (i.e. the first in the list will be applied last)." +msgid "" +"``decorator_list`` is the list of decorators to be applied, stored outermost first " +"(i.e. the first in the list will be applied last)." msgstr "" +"``decorator_list`` فهرستی از دکوراتورهایی است که باید اعمال شوند و بیرونی‌ترین آن‌ها " +"در ابتدا ذخیره شده است (یعنی اولین دکوراتور فهرست، در آخر اعمال می‌شود)." msgid "``returns`` is the return annotation." -msgstr "" +msgstr "``returns`` حاشیه‌نویسی بازگشت (return annotation) است." msgid "``type_params`` is a list of :ref:`type parameters `." -msgstr "" +msgstr "``type_params`` فهرستی از :ref:`پارامترهای نوع ` است." msgid "Added ``type_params``." +msgstr "``type_params`` اضافه شد." + +msgid "" +"``lambda`` is a minimal function definition that can be used inside an expression. " +"Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" +"``lambda`` یک تعریف حداقلی تابع است که می‌تواند درون یک عبارت استفاده شود. " +"برخلاف :class:`FunctionDef`، ``body`` تنها شامل یک گره است." -msgid "``lambda`` is a minimal function definition that can be used inside an expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." +msgid "" +">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Lambda(\n" +" args=arguments(\n" +" args=[\n" +" arg(arg='x'),\n" +" arg(arg='y')]),\n" +" body=Constant(value=Ellipsis)))])" msgstr "" - -msgid "" ">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" "Module(\n" " body=[\n" @@ -1628,28 +3561,46 @@ msgid "" " arg(arg='x'),\n" " arg(arg='y')]),\n" " body=Constant(value=Ellipsis)))])" -msgstr "" msgid "The arguments for a function." -msgstr "" +msgstr "آرگومان‌های یک تابع." msgid "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" +"``posonlyargs``، ``args`` و ``kwonlyargs`` فهرست‌هایی از گره‌های :class:`arg` هستند." -msgid "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the ``*args, **kwargs`` parameters." +msgid "" +"``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the ``*args, " +"**kwargs`` parameters." msgstr "" +"``vararg`` و ``kwarg`` گره‌های :class:`arg` تکی هستند که به پارامترهای ``*args, " +"**kwargs`` اشاره می‌کنند." -msgid "``kw_defaults`` is a list of default values for keyword-only arguments. If one is ``None``, the corresponding argument is required." +msgid "" +"``kw_defaults`` is a list of default values for keyword-only arguments. If one is " +"``None``, the corresponding argument is required." msgstr "" +"``kw_defaults`` فهرستی از مقادیر پیش‌فرض برای آرگومان‌های فقط کلیدواژه‌ای است. اگر " +"یکی ``None`` باشد، آرگومان متناظر الزامی است." -msgid "``defaults`` is a list of default values for arguments that can be passed positionally. If there are fewer defaults, they correspond to the last n arguments." +msgid "" +"``defaults`` is a list of default values for arguments that can be passed " +"positionally. If there are fewer defaults, they correspond to the last n arguments." msgstr "" +"``defaults`` فهرستی از مقادیر پیش‌فرض برای آرگومان‌هایی است که می‌توانند به‌صورت " +"جایگاهی ارسال شوند. اگر تعداد مقادیر پیش‌فرض کمتر باشد، آن‌ها با آخرین n آرگومان " +"متناظر هستند." -msgid "A single argument in a list. ``arg`` is a raw string of the argument name; ``annotation`` is its annotation, such as a :class:`Name` node." +msgid "" +"A single argument in a list. ``arg`` is a raw string of the argument name; " +"``annotation`` is its annotation, such as a :class:`Name` node." msgstr "" +"یک آرگومان منفرد در یک فهرست. ``arg`` یک رشته خام از نام آرگومان است؛ " +"``annotation`` حاشیه‌نویسی آن است، مانند یک گره :class:`Name`." msgid "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" +"``type_comment`` یک رشته اختیاری است که حاشیه‌نویسی نوع را به‌صورت یک کامنت دارد" msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1687,9 +3638,43 @@ msgid "" " Name(id='decorator2', ctx=Load())],\n" " returns=Constant(value='return annotation'))])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return annotation':\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" FunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" args=[\n" +" arg(\n" +" arg='a',\n" +" annotation=Constant(value='annotation')),\n" +" arg(arg='b'),\n" +" arg(arg='c')],\n" +" vararg=arg(arg='d'),\n" +" kwonlyargs=[\n" +" arg(arg='e'),\n" +" arg(arg='f')],\n" +" kw_defaults=[\n" +" None,\n" +" Constant(value=3)],\n" +" kwarg=arg(arg='g'),\n" +" defaults=[\n" +" Constant(value=1),\n" +" Constant(value=2)]),\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())],\n" +" returns=Constant(value='return annotation'))])" msgid "A ``return`` statement." -msgstr "" +msgstr "یک دستور ``return``." msgid "" ">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" @@ -1698,9 +3683,18 @@ msgid "" " Return(\n" " value=Constant(value=4))])" msgstr "" +">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" +"Module(\n" +" body=[\n" +" Return(\n" +" value=Constant(value=4))])" -msgid "A ``yield`` or ``yield from`` expression. Because these are expressions, they must be wrapped in an :class:`Expr` node if the value sent back is not used." +msgid "" +"A ``yield`` or ``yield from`` expression. Because these are expressions, they must " +"be wrapped in an :class:`Expr` node if the value sent back is not used." msgstr "" +"یک عبارت ``yield`` یا ``yield from``. از آنجا که این‌ها عبارت هستند، در صورتی که " +"مقدار بازگشتی آن‌ها استفاده نشود، باید در یک گره :class:`Expr` قرار گیرند." msgid "" ">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" @@ -1717,9 +3711,22 @@ msgid "" " value=YieldFrom(\n" " value=Name(id='x', ctx=Load())))])" msgstr "" +">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Yield(\n" +" value=Name(id='x', ctx=Load())))])\n" +"\n" +">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=YieldFrom(\n" +" value=Name(id='x', ctx=Load())))])" msgid "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." -msgstr "" +msgstr "دستورهای ``global`` و ``nonlocal``. ``names`` فهرستی از رشته‌های خام است." msgid "" ">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" @@ -1740,24 +3747,48 @@ msgid "" " 'y',\n" " 'z'])])" msgstr "" +">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Global(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])\n" +"\n" +">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Nonlocal(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])])" msgid "A class definition." -msgstr "" +msgstr "تعریف یک کلاس." msgid "``name`` is a raw string for the class name" -msgstr "" +msgstr "``name`` یک رشته خام برای نام کلاس است" msgid "``bases`` is a list of nodes for explicitly specified base classes." -msgstr "" +msgstr "``bases`` فهرستی از گره‌ها برای کلاس‌های پایه‌ای است که به‌صراحت مشخص‌شده‌اند." -msgid "``keywords`` is a list of :class:`.keyword` nodes, principally for 'metaclass'. Other keywords will be passed to the metaclass, as per :pep:`3115`." +msgid "" +"``keywords`` is a list of :class:`.keyword` nodes, principally for 'metaclass'. " +"Other keywords will be passed to the metaclass, as per :pep:`3115`." msgstr "" +"``keywords`` فهرستی از گره‌های :class:`.keyword` است، عمدتاً برای 'metaclass'. سایر " +"کلیدواژه‌ها مطابق :pep:`3115` به فراکلاس ارسال می‌شوند." -msgid "``body`` is a list of nodes representing the code within the class definition." -msgstr "" +msgid "" +"``body`` is a list of nodes representing the code within the class definition." +msgstr "``body`` فهرستی از گره‌هایی است که کد درون تعریف کلاس را نشان می‌دهند." msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" +"``decorator_list`` فهرستی از گره‌ها است، همان‌طور که در :class:`FunctionDef` وجود " +"دارد." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1783,15 +3814,42 @@ msgid "" " Name(id='decorator1', ctx=Load()),\n" " Name(id='decorator2', ctx=Load())])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... class Foo(base1, base2, metaclass=meta):\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" ClassDef(\n" +" name='Foo',\n" +" bases=[\n" +" Name(id='base1', ctx=Load()),\n" +" Name(id='base2', ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='metaclass',\n" +" value=Name(id='meta', ctx=Load()))],\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())])])" msgid "Async and await" -msgstr "" +msgstr "ناهمگام و await" -msgid "An ``async def`` function definition. Has the same fields as :class:`FunctionDef`." -msgstr "" +msgid "" +"An ``async def`` function definition. Has the same fields as :class:`FunctionDef`." +msgstr "یک تعریف تابع ``async def``. دارای همان فیلدهای :class:`FunctionDef` است." -msgid "An ``await`` expression. ``value`` is what it waits for. Only valid in the body of an :class:`AsyncFunctionDef`." +msgid "" +"An ``await`` expression. ``value`` is what it waits for. Only valid in the body of " +"an :class:`AsyncFunctionDef`." msgstr "" +"یک عبارت ``await``. ``value`` مقداری است که برای آن انتظار می‌رود. فقط در بدنه‌ی " +"یک :class:`AsyncFunctionDef` معتبر است." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -1809,144 +3867,408 @@ msgid "" " value=Call(\n" " func=Name(id='other_func', ctx=Load()))))])])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()))))])])" -msgid "``async for`` loops and ``async with`` context managers. They have the same fields as :class:`For` and :class:`With`, respectively. Only valid in the body of an :class:`AsyncFunctionDef`." +msgid "" +"``async for`` loops and ``async with`` context managers. They have the same fields " +"as :class:`For` and :class:`With`, respectively. Only valid in the body of " +"an :class:`AsyncFunctionDef`." msgstr "" +"حلقه‌های ``async for`` و مدیران زمینه‌ی ``async with``. آن‌ها به‌ترتیب همان " +"فیلدهای :class:`For` و :class:`With` را دارند. فقط در بدنه‌ی " +"یک :class:`AsyncFunctionDef` معتبر هستند." -msgid "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast.boolop` and :class:`ast.expr_context`) on the returned tree will be singletons. Changes to one will be reflected in all other occurrences of the same value (for example, :class:`ast.Add`)." -msgstr "" +msgid "" +"When a string is parsed by :func:`ast.parse`, operator nodes (subclasses " +"of :class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast.boolop` " +"and :class:`ast.expr_context`) on the returned tree will be singletons. Changes to " +"one will be reflected in all other occurrences of the same value (for " +"example, :class:`ast.Add`)." +msgstr "" +"هنگامی که یک رشته توسط :func:`ast.parse` تجزیه می‌شود، گره‌های عملگر " +"(زیرکلاس‌های :class:`ast.operator`، :class:`ast.unaryop`، :class:`ast.cmpop`، :class:`ast.boolop` " +"و :class:`ast.expr_context`) در درخت برگردانده‌شده تک‌نمونه خواهند بود. تغییر در یکی " +"از آن‌ها در تمام موارد دیگر با همان مقدار بازتاب خواهد یافت (برای " +"مثال، :class:`ast.Add`)." msgid ":mod:`!ast` helpers" -msgstr "" +msgstr "کمک‌کننده‌های :mod:`!ast`" -msgid "Apart from the node classes, the :mod:`!ast` module defines these utility functions and classes for traversing abstract syntax trees:" +msgid "" +"Apart from the node classes, the :mod:`!ast` module defines these utility " +"functions and classes for traversing abstract syntax trees:" msgstr "" +"جدا از کلاس‌های گره، ماژول :mod:`!ast` این توابع و کلاس‌های سودمند را برای پیمایش " +"درختان سینتکس انتزاعی تعریف می‌کند:" -msgid "Parse the source into an AST node. Equivalent to ``compile(source, filename, mode, flags=FLAGS_VALUE, optimize=optimize)``, where ``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and ``ast.PyCF_OPTIMIZED_AST`` otherwise." +msgid "" +"Parse the source into an AST node. Equivalent to ``compile(source, filename, " +"mode, flags=FLAGS_VALUE, optimize=optimize)``, where ``FLAGS_VALUE`` is " +"``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and ``ast.PyCF_OPTIMIZED_AST`` " +"otherwise." msgstr "" +"منبع را به یک گره AST تجزیه می‌کند. معادل ``compile(source, filename, mode, " +"flags=FLAGS_VALUE, optimize=optimize)`` است، که در آن ``FLAGS_VALUE`` اگر " +"``optimize <= 0`` باشد ``ast.PyCF_ONLY_AST`` و در غیر این صورت " +"``ast.PyCF_OPTIMIZED_AST`` است." -msgid "If ``type_comments=True`` is given, the parser is modified to check and return type comments as specified by :pep:`484` and :pep:`526`. This is equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :func:`compile`. This will report syntax errors for misplaced type comments. Without this flag, type comments will be ignored, and the ``type_comment`` field on selected AST nodes will always be ``None``. In addition, the locations of ``# type: ignore`` comments will be returned as the ``type_ignores`` attribute of :class:`Module` (otherwise it is always an empty list)." -msgstr "" +msgid "" +"If ``type_comments=True`` is given, the parser is modified to check and return " +"type comments as specified by :pep:`484` and :pep:`526`. This is equivalent to " +"adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :func:`compile`. " +"This will report syntax errors for misplaced type comments. Without this flag, " +"type comments will be ignored, and the ``type_comment`` field on selected AST " +"nodes will always be ``None``. In addition, the locations of ``# type: ignore`` " +"comments will be returned as the ``type_ignores`` attribute of :class:`Module` " +"(otherwise it is always an empty list)." +msgstr "" +"اگر ``type_comments=True`` داده شود، پارسر به‌گونه‌ای تغییر می‌یابد که کامنت‌های نوع " +"را مطابق :pep:`484` و :pep:`526` بررسی کند و برگرداند. این معادل " +"افزودن :data:`ast.PyCF_TYPE_COMMENTS` به پرچم‌های ارسال‌شده به :func:`compile` است. " +"این حالت خطاهای سینتکسی مربوط به کامنت‌های نوع نابجا را گزارش می‌دهد. بدون این پرچم، " +"کامنت‌های نوع نادیده گرفته می‌شوند و فیلد ``type_comment`` در گره‌های AST انتخاب‌شده " +"همیشه ``None`` خواهد بود. علاوه بر این، موقعیت‌های کامنت‌های ``# type: ignore`` " +"به‌عنوان ویژگی ``type_ignores`` در :class:`Module` برگردانده می‌شوند (در غیر این " +"صورت همیشه یک فهرست خالی است)." -msgid "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> List[str]``." +msgid "" +"In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " +"correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " +"List[str]``." msgstr "" +"علاوه بر این، اگر ``mode`` برابر ``'func_type'`` باشد، سینتکس ورودی به‌صورتی تغییر " +"می‌کند که متناظر با «کامنت‌های نوع امضا» در :pep:`484` باشد، مثلاً ``(str, int) -> " +"List[str]``." -msgid "Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a \"best-effort\" attempt to parse using that Python version's grammar. For example, setting ``feature_version=(3, 9)`` will attempt to disallow parsing of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The lowest supported version is ``(3, 7)`` (and this may increase in future Python versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" attempt means there is no guarantee that the parse (or success of the parse) is the same as when run on the Python version corresponding to ``feature_version``." -msgstr "" +msgid "" +"Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a \"best-" +"effort\" attempt to parse using that Python version's grammar. For example, " +"setting ``feature_version=(3, 9)`` will attempt to disallow parsing " +"of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The " +"lowest supported version is ``(3, 7)`` (and this may increase in future Python " +"versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" attempt means " +"there is no guarantee that the parse (or success of the parse) is the same as when " +"run on the Python version corresponding to ``feature_version``." +msgstr "" +"تنظیم ``feature_version`` به یک تاپل ``(major, minor)`` منجر به تلاش «بهترین تلاش» " +"برای تجزیه با استفاده از دستور زبان آن نسخه از پایتون می‌شود. برای مثال، تنظیم " +"``feature_version=(3, 9)`` تلاش می‌کند تجزیه‌ی دستورهای :keyword:`match` را غیرمجاز " +"کند. در حال حاضر ``major`` باید برابر با ``3`` باشد. کمترین نسخه‌ی پشتیبانی‌شده " +"``(3, 7)`` است (و ممکن است در نسخه‌های آینده‌ی پایتون افزایش یابد)؛ بیشترین نسخه " +"``sys.version_info[0:2]`` است. تلاش «بهترین تلاش» به این معناست که تضمینی وجود " +"ندارد که تجزیه (یا موفقیت تجزیه) همانند حالتی باشد که در نسخه‌ی پایتون متناظر با " +"``feature_version`` اجرا می‌شود." msgid "If source contains a null character (``\\0``), :exc:`ValueError` is raised." -msgstr "" +msgstr "اگر source حاوی یک نویسه‌ی نال (``\\0``) باشد، :exc:`ValueError` پرتاب می‌شود." -msgid "Note that successfully parsing source code into an AST object doesn't guarantee that the source code provided is valid Python code that can be executed as the compilation step can raise further :exc:`SyntaxError` exceptions. For instance, the source ``return 42`` generates a valid AST node for a return statement, but it cannot be compiled alone (it needs to be inside a function node)." -msgstr "" +msgid "" +"Note that successfully parsing source code into an AST object doesn't guarantee " +"that the source code provided is valid Python code that can be executed as the " +"compilation step can raise further :exc:`SyntaxError` exceptions. For instance, " +"the source ``return 42`` generates a valid AST node for a return statement, but it " +"cannot be compiled alone (it needs to be inside a function node)." +msgstr "" +"توجه داشته باشید که تجزیه‌ی موفقیت‌آمیز کد منبع به یک شیء AST تضمین نمی‌کند که کد منبع " +"ارائه‌شده، کد پایتون معتبری باشد که بتواند اجرا شود، زیرا مرحله‌ی کامپایل می‌تواند " +"استثناهای بیشتری از نوع :exc:`SyntaxError` پرتاب کند. برای مثال، کد منبع ``return " +"42`` یک گره AST معتبر برای یک دستور return تولید می‌کند، اما نمی‌تواند به‌تنهایی " +"کامپایل شود (باید داخل یک گره تابع باشد)." -msgid "In particular, :func:`ast.parse` won't do any scoping checks, which the compilation step does." +msgid "" +"In particular, :func:`ast.parse` won't do any scoping checks, which the " +"compilation step does." msgstr "" +"به‌طور خاص، :func:`ast.parse` هیچ‌گونه بررسی محدوده‌ای انجام نمی‌دهد، در حالی که مرحله‌ی " +"کامپایل این کار را انجام می‌دهد." -msgid "It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python's AST compiler." +msgid "" +"It is possible to crash the Python interpreter with a sufficiently large/complex " +"string due to stack depth limitations in Python's AST compiler." msgstr "" +"ممکن است مفسر پایتون به دلیل محدودیت‌های عمق پشته در کامپایلر AST پایتون، با رشته‌ای " +"به‌اندازه کافی بزرگ/پیچیده از کار بیفتد." msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." -msgstr "" +msgstr "``type_comments``، ``mode='func_type'`` و ``feature_version`` افزوده شد." -msgid "The minimum supported version for ``feature_version`` is now ``(3, 7)``. The ``optimize`` argument was added." +msgid "" +"The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " +"``optimize`` argument was added." msgstr "" +"حداقل نسخه پشتیبانی‌شده برای ``feature_version`` اکنون ``(3, 7)`` است. آرگومان " +"``optimize`` افزوده شد." -msgid "Unparse an :class:`ast.AST` object and generate a string with code that would produce an equivalent :class:`ast.AST` object if parsed back with :func:`ast.parse`." +msgid "" +"Unparse an :class:`ast.AST` object and generate a string with code that would " +"produce an equivalent :class:`ast.AST` object if parsed back " +"with :func:`ast.parse`." msgstr "" +"یک شیء :class:`ast.AST` را به کد بازگردانید و رشته‌ای حاوی کدی تولید کنید که اگر " +"دوباره با :func:`ast.parse` تجزیه شود، یک شیء :class:`ast.AST` معادل تولید می‌کند." -msgid "The produced code string will not necessarily be equal to the original code that generated the :class:`ast.AST` object (without any compiler optimizations, such as constant tuples/frozensets)." +msgid "" +"The produced code string will not necessarily be equal to the original code that " +"generated the :class:`ast.AST` object (without any compiler optimizations, such as " +"constant tuples/frozensets)." msgstr "" +"رشته‌ی کد تولیدشده لزوماً با کد اصلی که شیء :class:`ast.AST` را تولید کرده است برابر " +"نخواهد بود (بدون هیچ‌گونه بهینه‌سازی کامپایلر، مانند تاپل‌ها/فروزن‌ست‌های ثابت)." -msgid "Trying to unparse a highly complex expression would result with :exc:`RecursionError`." +msgid "" +"Trying to unparse a highly complex expression would result " +"with :exc:`RecursionError`." msgstr "" +"تلاش برای بازگردانی (unparse) یک عبارت بسیار پیچیده منجر به :exc:`RecursionError` " +"می‌شود." -msgid "Evaluate an expression node or a string containing only a Python literal or container display. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, ``None`` and ``Ellipsis``." +msgid "" +"Evaluate an expression node or a string containing only a Python literal or " +"container display. The string or node provided may only consist of the following " +"Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, " +"booleans, ``None`` and ``Ellipsis``." msgstr "" +"یک گره عبارت یا رشته‌ای را که فقط شامل یک لفظی پایتون یا نمایش ظرف (container " +"display) باشد، ارزیابی می‌کند. رشته یا گره ارائه‌شده فقط می‌تواند شامل ساختارهای " +"لفظی پایتون زیر باشد: رشته‌ها، بایت‌ها، اعداد، تاپل‌ها، فهرست‌ها، دیکشنری‌ها، " +"مجموعه‌ها، بولی‌ها، ``None`` و ``Ellipsis``." -msgid "This can be used for evaluating strings containing Python values without the need to parse the values oneself. It is not capable of evaluating arbitrarily complex expressions, for example involving operators or indexing." +msgid "" +"This can be used for evaluating strings containing Python values without the need " +"to parse the values oneself. It is not capable of evaluating arbitrarily complex " +"expressions, for example involving operators or indexing." msgstr "" +"می‌توان از این برای ارزیابی رشته‌های حاوی مقادیر پایتون استفاده کرد، بدون نیاز به " +"اینکه خودتان مقادیر را تجزیه کنید. این مورد قادر به ارزیابی عبارت‌های با پیچیدگی " +"دلخواه نیست، برای مثال عبارت‌هایی که شامل عملگرها یا اندیس‌دهی باشند." -msgid "This function had been documented as \"safe\" in the past without defining what that meant. That was misleading. This is specifically designed not to execute Python code, unlike the more general :func:`eval`. There is no namespace, no name lookups, or ability to call out. But it is not free from attack: A relatively small input can lead to memory exhaustion or to C stack exhaustion, crashing the process. There is also the possibility for excessive CPU consumption denial of service on some inputs. Calling it on untrusted data is thus not recommended." -msgstr "" +msgid "" +"This function had been documented as \"safe\" in the past without defining what " +"that meant. That was misleading. This is specifically designed not to execute " +"Python code, unlike the more general :func:`eval`. There is no namespace, no name " +"lookups, or ability to call out. But it is not free from attack: A relatively " +"small input can lead to memory exhaustion or to C stack exhaustion, crashing the " +"process. There is also the possibility for excessive CPU consumption denial of " +"service on some inputs. Calling it on untrusted data is thus not recommended." +msgstr "" +"این تابع در گذشته بدون این‌که تعریف شود منظور از «امن» چیست، به‌عنوان «امن» مستند " +"شده بود. این موضوع گمراه‌کننده بود. این تابع به‌طور خاص به‌گونه‌ای طراحی شده است که " +"برخلاف :func:`eval` که عمومی‌تر است، کد پایتون را اجرا نکند. هیچ فضای نامی وجود " +"ندارد، هیچ جست‌وجوی نامی انجام نمی‌شود، و هیچ امکانی برای فراخوانی بیرونی وجود " +"ندارد. اما این تابع از حملات مصون نیست: یک ورودی نسبتاً کوچک می‌تواند به اتمام حافظه " +"یا اتمام پشته C منجر شود و فرایند را از کار بیندازد. همچنین امکان ایجاد منع سرویس " +"ناشی از مصرف بیش‌ازحد CPU در برخی ورودی‌ها وجود دارد. بنابراین فراخوانی آن با " +"داده‌های غیرقابل‌اعتماد توصیه نمی‌شود." -msgid "It is possible to crash the Python interpreter due to stack depth limitations in Python's AST compiler." +msgid "" +"It is possible to crash the Python interpreter due to stack depth limitations in " +"Python's AST compiler." msgstr "" +"ممکن است مفسر پایتون به دلیل محدودیت‌های عمق پشته در کامپایلر AST پایتون از کار " +"بیفتد." -msgid "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:`MemoryError` and :exc:`RecursionError` depending on the malformed input." +msgid "" +"It can " +"raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:`MemoryError` " +"and :exc:`RecursionError` depending on the malformed input." msgstr "" +"ممکن است بسته به ورودی " +"نامعتبر، :exc:`ValueError`، :exc:`TypeError`، :exc:`SyntaxError`، :exc:`MemoryError` " +"و :exc:`RecursionError` پرتاب شوند." msgid "Now allows bytes and set literals." -msgstr "" +msgstr "اکنون مقادیر لفظی bytes و set را می‌پذیرد." msgid "Now supports creating empty sets with ``'set()'``." -msgstr "" +msgstr "اکنون از ایجاد مجموعه‌های خالی با ``'set()'`` پشتیبانی می‌شود." msgid "For string inputs, leading spaces and tabs are now stripped." -msgstr "" +msgstr "برای ورودی‌های رشته‌ای، فاصله‌ها و تب‌های ابتدایی اکنون حذف می‌شوند." -msgid "Return the docstring of the given *node* (which must be a :class:`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:`Module` node), or ``None`` if it has no docstring. If *clean* is true, clean up the docstring's indentation with :func:`inspect.cleandoc`." +msgid "" +"Return the docstring of the given *node* (which must be " +"a :class:`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, " +"or :class:`Module` node), or ``None`` if it has no docstring. If *clean* is true, " +"clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" +"رشته مستندات مربوط به *node* داده‌شده را برمی‌گرداند (که باید یک گره " +"از نوع :class:`FunctionDef`، :class:`AsyncFunctionDef`، :class:`ClassDef` " +"یا :class:`Module` باشد)، یا اگر رشته مستندات نداشته باشد، ``None`` را " +"برمی‌گرداند. اگر *clean* درست باشد، تورفتگی رشته مستندات را " +"با :func:`inspect.cleandoc` مرتب می‌کند." msgid ":class:`AsyncFunctionDef` is now supported." -msgstr "" +msgstr "اکنون از :class:`AsyncFunctionDef` پشتیبانی می‌شود." -msgid "Get source code segment of the *source* that generated *node*. If some location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, return ``None``." +msgid "" +"Get source code segment of the *source* that generated *node*. If some location " +"information " +"(:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :attr:`~ast.AST.col_offset`, " +"or :attr:`~ast.AST.end_col_offset`) is missing, return ``None``." msgstr "" +"قطعه‌ای از کد منبع *source* را که *node* را تولید کرده است، دریافت کنید. اگر برخی " +"از اطلاعات موقعیت " +"(:attr:`~ast.AST.lineno`، :attr:`~ast.AST.end_lineno`، :attr:`~ast.AST.col_offset`، " +"یا :attr:`~ast.AST.end_col_offset`) موجود نباشد، ``None`` را برگردانید." -msgid "If *padded* is ``True``, the first line of a multi-line statement will be padded with spaces to match its original position." +msgid "" +"If *padded* is ``True``, the first line of a multi-line statement will be padded " +"with spaces to match its original position." msgstr "" +"اگر *padded* برابر ``True`` باشد، نخستین خط از یک دستور چندخطی با فاصله‌ها پر می‌شود " +"تا با موقعیت اصلی خود مطابقت کند." -msgid "When you compile a node tree with :func:`compile`, the compiler expects :attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every node that supports them. This is rather tedious to fill in for generated nodes, so this helper adds these attributes recursively where not already set, by setting them to the values of the parent node. It works recursively starting at *node*." -msgstr "" +msgid "" +"When you compile a node tree with :func:`compile`, the compiler " +"expects :attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for " +"every node that supports them. This is rather tedious to fill in for generated " +"nodes, so this helper adds these attributes recursively where not already set, by " +"setting them to the values of the parent node. It works recursively starting at " +"*node*." +msgstr "" +"هنگامی که یک درخت گره را با :func:`compile` کامپایل می‌کنید، کامپایلر انتظار دارد " +"که ویژگی‌های :attr:`~ast.AST.lineno` و :attr:`~ast.AST.col_offset` برای هر گره‌ای که " +"از آن‌ها پشتیبانی می‌کند، وجود داشته باشند. تنظیم این ویژگی‌ها برای گره‌های تولیدشده " +"نسبتاً خسته‌کننده است، بنابراین این کمک‌کننده این ویژگی‌ها را به‌صورت بازگشتی در مواردی " +"که از قبل تنظیم نشده باشند، با تنظیم آن‌ها به مقادیر گره والد اضافه می‌کند. این " +"کمک‌کننده به‌صورت بازگشتی از *node* شروع به کار می‌کند." -msgid "Increment the line number and end line number of each node in the tree starting at *node* by *n*. This is useful to \"move code\" to a different location in a file." +msgid "" +"Increment the line number and end line number of each node in the tree starting at " +"*node* by *n*. This is useful to \"move code\" to a different location in a file." msgstr "" +"شماره خط و شماره خط پایانی هر گره در درختی که از *node* شروع می‌شود را به مقدار *n* " +"افزایش دهید. این کار برای «انتقال کد» به مکانی دیگر در یک فایل مفید است." -msgid "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from *old_node* to *new_node* if possible, and return *new_node*." +msgid "" +"Copy source location " +"(:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :attr:`~ast.AST.end_lineno`, " +"and :attr:`~ast.AST.end_col_offset`) from *old_node* to *new_node* if possible, " +"and return *new_node*." msgstr "" +"در صورت امکان، موقعیت منبع " +"(:attr:`~ast.AST.lineno`، :attr:`~ast.AST.col_offset`، :attr:`~ast.AST.end_lineno` " +"و :attr:`~ast.AST.end_col_offset`) را از *old_node* به *new_node* کپی کنید و " +"*new_node* را برگردانید." -msgid "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is present on *node*." +msgid "" +"Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is " +"present on *node*." msgstr "" +"برای هر فیلد در ``node._fields`` که در *node* موجود است، یک تاپل از ``(fieldname, " +"value)`` تولید می‌کند." -msgid "Yield all direct child nodes of *node*, that is, all fields that are nodes and all items of fields that are lists of nodes." +msgid "" +"Yield all direct child nodes of *node*, that is, all fields that are nodes and all " +"items of fields that are lists of nodes." msgstr "" +"تمام گره‌های فرزند مستقیم *node* را تولید (yield) می‌کند، یعنی تمام فیلدهایی که گره " +"هستند و تمام آیتم‌های فیلدهایی که فهرست‌هایی از گره‌ها هستند." -msgid "Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context." +msgid "" +"Recursively yield all descendant nodes in the tree starting at *node* (including " +"*node* itself), in no specified order. This is useful if you only want to modify " +"nodes in place and don't care about the context." msgstr "" +"به‌صورت بازگشتی تمام گره‌های نواده در درختی که از *node* شروع می‌شود (از جمله خود " +"*node*) را، بدون هیچ ترتیب مشخصی، تولید می‌کند. این در صورتی مفید است که فقط " +"بخواهید گره‌ها را درجا تغییر دهید و به زمینه اهمیتی ندهید." -msgid "A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value which is forwarded by the :meth:`visit` method." +msgid "" +"A node visitor base class that walks the abstract syntax tree and calls a visitor " +"function for every node found. This function may return a value which is " +"forwarded by the :meth:`visit` method." msgstr "" +"یک کلاس پایه‌ی بازدیدکننده‌ی گره که درخت نحو انتزاعی را پیمایش می‌کند و برای هر گره‌ی " +"یافت‌شده، یک تابع بازدیدکننده را فراخوانی می‌کند. این تابع ممکن است مقداری برگرداند " +"که توسط متد :meth:`visit` ارسال می‌شود." -msgid "This class is meant to be subclassed, with the subclass adding visitor methods." +msgid "" +"This class is meant to be subclassed, with the subclass adding visitor methods." msgstr "" +"این کلاس برای زیرکلاس‌سازی در نظر گرفته شده است، به‌طوری که زیرکلاس، متدهای " +"بازدیدکننده (visitor) را اضافه می‌کند." -msgid "Visit a node. The default implementation calls the method called :samp:`self.visit_{classname}` where *classname* is the name of the node class, or :meth:`generic_visit` if that method doesn't exist." +msgid "" +"Visit a node. The default implementation calls the method " +"called :samp:`self.visit_{classname}` where *classname* is the name of the node " +"class, or :meth:`generic_visit` if that method doesn't exist." msgstr "" +"از یک گره بازدید می‌کند. پیاده‌سازی پیش‌فرض، متدی به نام :samp:`self.visit_{classname}" +"` را فراخوانی می‌کند که در آن *classname* نام کلاس گره است، یا اگر آن متد وجود " +"نداشته باشد، :meth:`generic_visit` را فراخوانی می‌کند." msgid "This visitor calls :meth:`visit` on all children of the node." -msgstr "" +msgstr "این بازدیدکننده، :meth:`visit` را روی تمام فرزندان گره فراخوانی می‌کند." -msgid "Note that child nodes of nodes that have a custom visitor method won't be visited unless the visitor calls :meth:`generic_visit` or visits them itself." +msgid "" +"Note that child nodes of nodes that have a custom visitor method won't be visited " +"unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" +"توجه داشته باشید که گره‌های فرزندِ گره‌هایی که یک متد بازدیدکننده سفارشی دارند، " +"بازدید نخواهند شد، مگر اینکه بازدیدکننده :meth:`generic_visit` را فراخوانی کند یا " +"خودش آن‌ها را بازدید کند." msgid "Handles all constant nodes." -msgstr "" +msgstr "تمام گره‌های ثابت را مدیریت می‌کند." -msgid "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes during traversal. For this a special visitor exists (:class:`NodeTransformer`) that allows modifications." +msgid "" +"Don't use the :class:`NodeVisitor` if you want to apply changes to nodes during " +"traversal. For this a special visitor exists (:class:`NodeTransformer`) that " +"allows modifications." msgstr "" +"اگر می‌خواهید در حین پیمایش تغییراتی را به گره‌ها اعمال کنید، " +"از :class:`NodeVisitor` استفاده نکنید. برای این منظور یک بازدیدکننده ویژه وجود " +"دارد (:class:`NodeTransformer`) که امکان اصلاح را فراهم می‌کند." -msgid "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:`!visit_NameConstant` and :meth:`!visit_Ellipsis` will not be called in Python 3.14+. Add the :meth:`visit_Constant` method instead to handle all constant nodes." +msgid "" +"Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:`!" +"visit_NameConstant` and :meth:`!visit_Ellipsis` will not be called in Python " +"3.14+. Add the :meth:`visit_Constant` method instead to handle all constant nodes." msgstr "" +"متدهای :meth:`!visit_Num`، :meth:`!visit_Str`، :meth:`!visit_Bytes`، :meth:`!" +"visit_NameConstant` و :meth:`!visit_Ellipsis` در Python 3.14+ فراخوانی نخواهند شد. " +"برای مدیریت همه گره‌های ثابت، در عوض متد :meth:`visit_Constant` را اضافه کنید." -msgid "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes." +msgid "" +"A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows " +"modification of nodes." msgstr "" +"یک زیرکلاس از :class:`NodeVisitor` که درخت نحو انتزاعی را پیمایش می‌کند و امکان " +"تغییر گره‌ها را فراهم می‌کند." -msgid "The :class:`NodeTransformer` will walk the AST and use the return value of the visitor methods to replace or remove the old node. If the return value of the visitor method is ``None``, the node will be removed from its location, otherwise it is replaced with the return value. The return value may be the original node in which case no replacement takes place." -msgstr "" +msgid "" +"The :class:`NodeTransformer` will walk the AST and use the return value of the " +"visitor methods to replace or remove the old node. If the return value of the " +"visitor method is ``None``, the node will be removed from its location, otherwise " +"it is replaced with the return value. The return value may be the original node " +"in which case no replacement takes place." +msgstr "" +":class:`NodeTransformer` درخت نحو انتزاعی (AST) را پیمایش می‌کند و از مقدار بازگشتی " +"متدهای بازدیدکننده برای جایگزینی یا حذف گره قدیمی استفاده می‌کند. اگر مقدار بازگشتی " +"متد بازدیدکننده ``None`` باشد، گره از موقعیت خود حذف می‌شود، در غیر این صورت با " +"مقدار بازگشتی جایگزین می‌شود. ممکن است مقدار بازگشتی همان گره اصلی باشد که در این " +"صورت هیچ جایگزینی انجام نمی‌شود." -msgid "Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``::" +msgid "" +"Here is an example transformer that rewrites all occurrences of name lookups " +"(``foo``) to ``data['foo']``::" msgstr "" +"در اینجا یک تبدیل‌کننده (transformer) مثال آمده است که همه‌ی موارد جست‌وجوی نام (``foo``) را " +"به ``data['foo']`` بازنویسی می‌کند::" msgid "" "class RewriteName(NodeTransformer):\n" @@ -1958,41 +4280,98 @@ msgid "" " ctx=node.ctx\n" " )" msgstr "" +"class RewriteName(NodeTransformer):\n" +"\n" +" def visit_Name(self, node):\n" +" return Subscript(\n" +" value=Name(id='data', ctx=Load()),\n" +" slice=Constant(value=node.id),\n" +" ctx=node.ctx\n" +" )" -msgid "Keep in mind that if the node you're operating on has child nodes you must either transform the child nodes yourself or call the :meth:`~ast.NodeVisitor.generic_visit` method for the node first." +msgid "" +"Keep in mind that if the node you're operating on has child nodes you must either " +"transform the child nodes yourself or call " +"the :meth:`~ast.NodeVisitor.generic_visit` method for the node first." msgstr "" +"به خاطر داشته باشید که اگر گره‌ای که روی آن کار می‌کنید گره‌های فرزند داشته باشد، " +"باید یا گره‌های فرزند را خودتان تبدیل کنید یا ابتدا " +"متد :meth:`~ast.NodeVisitor.generic_visit` را برای آن گره فراخوانی کنید." -msgid "For nodes that were part of a collection of statements (that applies to all statement nodes), the visitor may also return a list of nodes rather than just a single node." +msgid "" +"For nodes that were part of a collection of statements (that applies to all " +"statement nodes), the visitor may also return a list of nodes rather than just a " +"single node." msgstr "" +"برای گره‌هایی که بخشی از مجموعه‌ای از دستورها بودند (این موضوع درباره همه گره‌های " +"دستور صدق می‌کند)، بازدیدکننده همچنین می‌تواند به‌جای فقط یک گره واحد، فهرستی از " +"گره‌ها را برگرداند." -msgid "If :class:`NodeTransformer` introduces new nodes (that weren't part of original tree) without giving them location information (such as :attr:`~ast.AST.lineno`), :func:`fix_missing_locations` should be called with the new sub-tree to recalculate the location information::" +msgid "" +"If :class:`NodeTransformer` introduces new nodes (that weren't part of original " +"tree) without giving them location information (such " +"as :attr:`~ast.AST.lineno`), :func:`fix_missing_locations` should be called with " +"the new sub-tree to recalculate the location information::" msgstr "" +"اگر :class:`NodeTransformer` گره‌های جدیدی را (که بخشی از درخت اصلی نبودند) بدون " +"دادن اطلاعات مکان به آن‌ها (مانند :attr:`~ast.AST.lineno`) وارد کند، " +"باید :func:`fix_missing_locations` با زیردرخت جدید فراخوانی شود تا اطلاعات مکان " +"دوباره محاسبه شود::" msgid "" "tree = ast.parse('foo', mode='eval')\n" "new_tree = fix_missing_locations(RewriteName().visit(tree))" msgstr "" +"tree = ast.parse('foo', mode='eval')\n" +"new_tree = fix_missing_locations(RewriteName().visit(tree))" msgid "Usually you use the transformer like this::" -msgstr "" +msgstr "معمولاً از تبدیل‌کننده (transformer) به این صورت استفاده می‌کنید::" msgid "node = YourTransformer().visit(node)" -msgstr "" +msgstr "node = YourTransformer().visit(node)" -msgid "Return a formatted dump of the tree in *node*. This is mainly useful for debugging purposes. If *annotate_fields* is true (by default), the returned string will show the names and the values for fields. If *annotate_fields* is false, the result string will be more compact by omitting unambiguous field names. Attributes such as line numbers and column offsets are not dumped by default. If this is wanted, *include_attributes* can be set to true." -msgstr "" +msgid "" +"Return a formatted dump of the tree in *node*. This is mainly useful for " +"debugging purposes. If *annotate_fields* is true (by default), the returned " +"string will show the names and the values for fields. If *annotate_fields* is " +"false, the result string will be more compact by omitting unambiguous field " +"names. Attributes such as line numbers and column offsets are not dumped by " +"default. If this is wanted, *include_attributes* can be set to true." +msgstr "" +"یک برون‌ریزی قالب‌بندی‌شده (dump) از درخت درون *node* برمی‌گرداند. این عمدتاً برای اهداف " +"اشکال‌زدایی مفید است. اگر *annotate_fields* برابر true باشد (به‌طور پیش‌فرض)، رشته‌ی " +"برگردانده‌شده نام‌ها و مقدارهای فیلدها را نشان می‌دهد. اگر *annotate_fields* برابر " +"false باشد، رشته‌ی حاصل با حذف نام فیلدهای غیرمبهم فشرده‌تر خواهد بود. ویژگی‌هایی " +"مانند شماره‌های خط و آفست‌های ستون به‌طور پیش‌فرض در خروجی آورده نمی‌شوند. اگر این مورد " +"نظر باشد، می‌توان *include_attributes* را روی true تنظیم کرد." -msgid "If *indent* is a non-negative integer or string, then the tree will be pretty-printed with that indent level. An indent level of 0, negative, or ``\"\"`` will only insert newlines. ``None`` (the default) selects the single line representation. Using a positive integer indent indents that many spaces per level. If *indent* is a string (such as ``\"\\t\"``), that string is used to indent each level." -msgstr "" +msgid "" +"If *indent* is a non-negative integer or string, then the tree will be pretty-" +"printed with that indent level. An indent level of 0, negative, or ``\"\"`` will " +"only insert newlines. ``None`` (the default) selects the single line " +"representation. Using a positive integer indent indents that many spaces per " +"level. If *indent* is a string (such as ``\"\\t\"``), that string is used to " +"indent each level." +msgstr "" +"اگر *indent* یک عدد صحیح نامنفی یا رشته باشد، درخت با آن سطح تورفتگی به‌صورت خوانا " +"چاپ می‌شود. سطح تورفتگی ۰، منفی، یا ``\"\"`` فقط خط‌های جدید درج می‌کند. ``None`` " +"(پیش‌فرض) نمایش تک‌خطی را انتخاب می‌کند. استفاده از تورفتگی عدد صحیح مثبت، در هر سطح " +"به همان تعداد فاصله تورفتگی ایجاد می‌کند. اگر *indent* یک رشته باشد (مانند " +"``\"\\t\"``)، از آن رشته برای تورفتگی هر سطح استفاده می‌شود." -msgid "If *show_empty* is false (the default), optional empty lists will be omitted from the output. Optional ``None`` values are always omitted." +msgid "" +"If *show_empty* is false (the default), optional empty lists will be omitted from " +"the output. Optional ``None`` values are always omitted." msgstr "" +"اگر *show_empty* نادرست باشد (حالت پیش‌فرض)، فهرست‌های خالی اختیاری از خروجی حذف " +"می‌شوند. مقادیر ``None`` اختیاری همیشه حذف می‌شوند." msgid "Added the *indent* option." -msgstr "" +msgstr "گزینه‌ی *indent* افزوده شد." msgid "Added the *show_empty* option." -msgstr "" +msgstr "گزینه‌ی *show_empty* اضافه شد." msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -2020,90 +4399,191 @@ msgid "" " type_params=[])],\n" " type_ignores=[])" msgstr "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4, show_empty=True))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[],\n" +" kwonlyargs=[],\n" +" kw_defaults=[],\n" +" defaults=[]),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()),\n" +" args=[],\n" +" keywords=[])))],\n" +" decorator_list=[],\n" +" type_params=[])],\n" +" type_ignores=[])" msgid "Recursively compares two ASTs." -msgstr "" +msgstr "دو AST را به‌صورت بازگشتی مقایسه می‌کند." -msgid "*compare_attributes* affects whether AST attributes are considered in the comparison. If *compare_attributes* is ``False`` (default), then attributes are ignored. Otherwise they must all be equal. This option is useful to check whether the ASTs are structurally equal but differ in whitespace or similar details. Attributes include line numbers and column offsets." -msgstr "" +msgid "" +"*compare_attributes* affects whether AST attributes are considered in the " +"comparison. If *compare_attributes* is ``False`` (default), then attributes are " +"ignored. Otherwise they must all be equal. This option is useful to check whether " +"the ASTs are structurally equal but differ in whitespace or similar details. " +"Attributes include line numbers and column offsets." +msgstr "" +"*compare_attributes* بر اینکه آیا ویژگی‌های AST در مقایسه در نظر گرفته شوند یا خیر، " +"تأثیر می‌گذارد. اگر *compare_attributes* برابر ``False`` (پیش‌فرض) باشد، ویژگی‌ها " +"نادیده گرفته می‌شوند. در غیر این صورت، همه‌ی آن‌ها باید برابر باشند. این گزینه برای " +"بررسی اینکه آیا ASTها از نظر ساختاری برابرند اما در فضای سفید یا جزئیات مشابه " +"تفاوت دارند، مفید است. ویژگی‌ها شامل شماره‌ی خطوط و آفست‌های ستونی هستند." msgid "Compiler flags" -msgstr "" +msgstr "پرچم‌های کامپایلر" -msgid "The following flags may be passed to :func:`compile` in order to change effects on the compilation of a program:" +msgid "" +"The following flags may be passed to :func:`compile` in order to change effects on " +"the compilation of a program:" msgstr "" +"پرچم‌های زیر را می‌توان برای تغییر اثرات بر کامپایل یک برنامه به :func:`compile` " +"ارسال کرد:" -msgid "Enables support for top-level ``await``, ``async for``, ``async with`` and async comprehensions." +msgid "" +"Enables support for top-level ``await``, ``async for``, ``async with`` and async " +"comprehensions." msgstr "" +"پشتیبانی از ``await``، ``async for`` و ``async with`` در سطح بالا و درک‌های ناهمگام " +"را فعال می‌کند." -msgid "Generates and returns an abstract syntax tree instead of returning a compiled code object." +msgid "" +"Generates and returns an abstract syntax tree instead of returning a compiled code " +"object." msgstr "" +"به‌جای برگرداندن یک شیء کد کامپایل‌شده، یک درخت نحو انتزاعی را تولید می‌کند و " +"برمی‌گرداند." -msgid "The returned AST is optimized according to the *optimize* argument in :func:`compile` or :func:`ast.parse`." +msgid "" +"The returned AST is optimized according to the *optimize* argument " +"in :func:`compile` or :func:`ast.parse`." msgstr "" +"درخت نحو انتزاعی (AST) برگردانده‌شده بر اساس آرگومان *optimize* در :func:`compile` " +"یا :func:`ast.parse` بهینه‌سازی شده است." -msgid "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: ``, ``# type: ignore ``)." +msgid "" +"Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " +"``, ``# type: ignore ``)." msgstr "" +"پشتیبانی از کامنت‌های نوع به سبک :pep:`484` و :pep:`526` را فعال می‌کند (``# type: " +"``، ``# type: ignore ``)." msgid "Command-line usage" -msgstr "" +msgstr "استفاده از خط فرمان" -msgid "The :mod:`!ast` module can be executed as a script from the command line. It is as simple as:" +msgid "" +"The :mod:`!ast` module can be executed as a script from the command line. It is as " +"simple as:" msgstr "" +"ماژول :mod:`!ast` می‌تواند به‌عنوان یک اسکریپت از خط فرمان اجرا شود. این کار به " +"سادگی زیر است:" msgid "python -m ast [-m ] [-a] [infile]" -msgstr "" +msgstr "python -m ast [-m ] [-a] [infile]" msgid "The following options are accepted:" -msgstr "" +msgstr "گزینه‌های زیر پذیرفته می‌شوند:" msgid "Show the help message and exit." -msgstr "" +msgstr "نمایش پیام راهنما و خروج." -msgid "Specify what kind of code must be compiled, like the *mode* argument in :func:`parse`." +msgid "" +"Specify what kind of code must be compiled, like the *mode* argument " +"in :func:`parse`." msgstr "" +"مشخص کنید که چه نوع کدی باید کامپایل شود، مانند آرگومان *mode* در :func:`parse`." msgid "Don't parse type comments." -msgstr "" +msgstr "کامنت‌های نوع را تجزیه نکنید." msgid "Include attributes such as line numbers and column offsets." -msgstr "" +msgstr "شامل ویژگی‌هایی مانند شماره خطوط و آفست‌های ستون (column offsets) باشد." msgid "Indentation of nodes in AST (number of spaces)." -msgstr "" +msgstr "تورفتگی گره‌ها در AST (تعداد فاصله‌ها)." -msgid "Python version in the format 3.x (for example, 3.10). Defaults to the current version of the interpreter." -msgstr "" +msgid "" +"Python version in the format 3.x (for example, 3.10). Defaults to the current " +"version of the interpreter." +msgstr "نسخه پایتون در قالب 3.x (برای مثال، 3.10). پیش‌فرض آن، نسخه فعلی مفسر است." msgid "Optimization level for parser. Defaults to no optimization." -msgstr "" +msgstr "سطح بهینه‌سازی برای پارسر (parser). به‌طور پیش‌فرض بدون بهینه‌سازی است." -msgid "Show empty lists and fields that are ``None``. Defaults to not showing empty objects." +msgid "" +"Show empty lists and fields that are ``None``. Defaults to not showing empty " +"objects." msgstr "" +"نمایش فهرست‌های خالی و فیلدهایی که ``None`` هستند. به‌طور پیش‌فرض، اشیاء خالی نمایش " +"داده نمی‌شوند." -msgid "If :file:`infile` is specified its contents are parsed to AST and dumped to stdout. Otherwise, the content is read from stdin." +msgid "" +"If :file:`infile` is specified its contents are parsed to AST and dumped to " +"stdout. Otherwise, the content is read from stdin." msgstr "" +"اگر :file:`infile` مشخص شده باشد، محتوای آن به AST تجزیه می‌شود و در stdout نوشته " +"می‌شود. در غیر این صورت، محتوا از stdin خوانده می‌شود." -msgid "`Green Tree Snakes `_, an external documentation resource, has good details on working with Python ASTs." +msgid "" +"`Green Tree Snakes `_, an external " +"documentation resource, has good details on working with Python ASTs." msgstr "" +"`Green Tree Snakes `_، یک منبع خارجی " +"مستندات، جزئیات خوبی درباره‌ی کار با ASTهای پایتون دارد." -msgid "`ASTTokens `_ annotates Python ASTs with the positions of tokens and text in the source code that generated them. This is helpful for tools that make source code transformations." +msgid "" +"`ASTTokens `_ " +"annotates Python ASTs with the positions of tokens and text in the source code " +"that generated them. This is helpful for tools that make source code " +"transformations." msgstr "" +"`ASTTokens `_ ASTهای " +"پایتون را با موقعیت‌های توکن‌ها و متن در کد منبعی که آن‌ها را تولید کرده است، " +"نمادگذاری می‌کند. این موضوع برای ابزارهایی که تبدیل‌هایی روی کد منبع انجام می‌دهند، " +"مفید است." -msgid "`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs by inserting two-way links between tokens and ast nodes." +msgid "" +"`leoAst.py `_ " +"unifies the token-based and parse-tree-based views of python programs by inserting " +"two-way links between tokens and ast nodes." msgstr "" +"`leoAst.py `_ " +"نمایش‌های مبتنی بر توکن و مبتنی بر درخت تجزیه از برنامه‌های پایتون را با درج " +"پیوندهای دوطرفه میان توکن‌ها و گره‌های AST یکپارچه می‌کند." -msgid "`LibCST `_ parses code as a Concrete Syntax Tree that looks like an ast tree and keeps all formatting details. It's useful for building automated refactoring (codemod) applications and linters." +msgid "" +"`LibCST `_ parses code as a Concrete Syntax Tree " +"that looks like an ast tree and keeps all formatting details. It's useful for " +"building automated refactoring (codemod) applications and linters." msgstr "" +"`LibCST `_ کد را به‌صورت یک درخت نحو عینی (Concrete " +"Syntax Tree) تجزیه می‌کند که شبیه به یک درخت ast است و تمام جزئیات قالب‌بندی را حفظ " +"می‌کند. این برای ساخت برنامه‌های بازسازی خودکار (codemod) و لینترها مفید است." -msgid "`Parso `_ is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python versions). Parso is also able to list multiple syntax errors in your Python file." +msgid "" +"`Parso `_ is a Python parser that supports error " +"recovery and round-trip parsing for different Python versions (in multiple Python " +"versions). Parso is also able to list multiple syntax errors in your Python file." msgstr "" +"`Parso `_ یک پارسر پایتون است که از بازیابی خطا و " +"تجزیه‌ی رفت‌وبرگشتی برای نسخه‌های مختلف پایتون (در چندین نسخه‌ی پایتون) پشتیبانی " +"می‌کند. Parso همچنین می‌تواند چندین خطای سینتکسی را در فایل پایتون شما فهرست کند." msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" msgid "in AST grammar" -msgstr "" +msgstr "در دستور زبان AST" msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" diff --git a/library/asynchat.po b/library/asynchat.po index 2529f8de6..1904450cb 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -22,13 +22,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" -msgstr "" +msgstr ":mod:`!asynchat` --- مدیر ناهمگام فرمان/پاسخ سوکت" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.12 ` after being deprecated in Python 3.6. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.12 ` after being deprecated " +"in Python 3.6. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.6، :ref:`در پایتون 3.12 حذف شد `. " +"تصمیم به حذف آن در :pep:`594` گرفته شد." msgid "Applications should use the :mod:`asyncio` module instead." -msgstr "" +msgstr "برنامه‌ها باید در عوض از ماژول :mod:`asyncio` استفاده کنند." -msgid "The last version of Python that provided the :mod:`!asynchat` module was `Python 3.11 `_." +msgid "" +"The last version of Python that provided the :mod:`!asynchat` module was " +"`Python 3.11 `_." msgstr "" +"آخرین نسخه از پایتون که ماژول :mod:`!asynchat` را ارائه می‌کرد، `Python 3.11" +" `_ بود." diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index 9b2228e24..8eda1cff4 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -25,301 +25,350 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "High-level API Index" -msgstr "" +msgstr "اندیس API سطح بالا" msgid "This page lists all high-level async/await enabled asyncio APIs." msgstr "" +"این صفحه همه‌ی APIهای سطح بالای asyncio را که از ناهمگام/await پشتیبانی " +"می‌کنند، فهرست می‌کند." msgid "Tasks" -msgstr "" +msgstr "وظایف" -msgid "Utilities to run asyncio programs, create Tasks, and await on multiple things with timeouts." +msgid "" +"Utilities to run asyncio programs, create Tasks, and await on multiple " +"things with timeouts." msgstr "" +"ابزارهایی برای اجرای برنامه‌های asyncio، ایجاد Taskها، و await روی چندین " +"چیز با مهلت‌های زمانی (timeouts)." msgid ":func:`run`" -msgstr "" +msgstr ":func:`run`" msgid "Create event loop, run a coroutine, close the loop." -msgstr "" +msgstr "ایجاد حلقه رویداد، اجرای یک هم‌روال، بستن حلقه." msgid ":class:`Runner`" -msgstr "" +msgstr ":class:`Runner`" msgid "A context manager that simplifies multiple async function calls." -msgstr "" +msgstr "مدیر زمینه‌ای که فراخوانی‌های متعدد تابع ناهمگام را ساده می‌کند." msgid ":class:`Task`" -msgstr "" +msgstr ":class:`Task`" msgid "Task object." -msgstr "" +msgstr "شیء Task." msgid ":class:`TaskGroup`" -msgstr "" +msgstr ":class:`TaskGroup`" -msgid "A context manager that holds a group of tasks. Provides a convenient and reliable way to wait for all tasks in the group to finish." +msgid "" +"A context manager that holds a group of tasks. Provides a convenient and " +"reliable way to wait for all tasks in the group to finish." msgstr "" +"یک مدیریت‌کننده‌ی زمینه که گروهی از وظایف را نگه می‌دارد. راهی آسان و مطمئن " +"برای منتظر ماندن تا پایان همه‌ی وظایف گروه فراهم می‌کند." msgid ":func:`create_task`" -msgstr "" +msgstr ":func:`create_task`" msgid "Start an asyncio Task, then returns it." -msgstr "" +msgstr "یک Task از asyncio را آغاز می‌کند و سپس آن را برمی‌گرداند." msgid ":func:`current_task`" -msgstr "" +msgstr ":func:`current_task`" msgid "Return the current Task." -msgstr "" +msgstr "Task جاری را برمی‌گرداند." msgid ":func:`all_tasks`" -msgstr "" +msgstr ":func:`all_tasks`" msgid "Return all tasks that are not yet finished for an event loop." msgstr "" +"تمام تسک‌هایی را که هنوز برای یک حلقه رویداد تمام نشده‌اند، برمی‌گرداند." msgid "``await`` :func:`sleep`" -msgstr "" +msgstr "``await`` :func:`sleep`" msgid "Sleep for a number of seconds." -msgstr "" +msgstr "برای تعدادی ثانیه متوقف می‌شود." msgid "``await`` :func:`gather`" -msgstr "" +msgstr "``await`` :func:`gather`" msgid "Schedule and wait for things concurrently." -msgstr "" +msgstr "چیزها را زمان‌بندی کنید و به‌صورت همزمان منتظر آن‌ها بمانید." msgid "``await`` :func:`wait_for`" -msgstr "" +msgstr "``await`` :func:`wait_for`" msgid "Run with a timeout." -msgstr "" +msgstr "با یک محدودیت زمانی (timeout) اجرا کنید." msgid "``await`` :func:`shield`" -msgstr "" +msgstr "``await`` :func:`shield`" msgid "Shield from cancellation." -msgstr "" +msgstr "محافظت در برابر لغو." msgid "``await`` :func:`wait`" -msgstr "" +msgstr "``await`` :func:`wait`" msgid "Monitor for completion." -msgstr "" +msgstr "برای تکمیل، پایش کنید." msgid ":func:`timeout`" -msgstr "" +msgstr ":func:`timeout`" msgid "Run with a timeout. Useful in cases when ``wait_for`` is not suitable." msgstr "" +"با یک مهلت زمانی اجرا می‌شود. در مواردی که ``wait_for`` مناسب نیست، مفید " +"است." msgid ":func:`to_thread`" -msgstr "" +msgstr ":func:`to_thread`" msgid "Asynchronously run a function in a separate OS thread." -msgstr "" +msgstr "یک تابع را به‌صورت ناهمگام در یک نخ سیستم‌عاملی جداگانه اجرا کنید." msgid ":func:`run_coroutine_threadsafe`" -msgstr "" +msgstr ":func:`run_coroutine_threadsafe`" msgid "Schedule a coroutine from another OS thread." -msgstr "" +msgstr "یک هم‌روال را از یک نخ دیگر سیستم‌عامل زمان‌بندی کنید." msgid "``for in`` :func:`as_completed`" -msgstr "" +msgstr "``for in`` :func:`as_completed`" msgid "Monitor for completion with a ``for`` loop." -msgstr "" +msgstr "تکمیل را با یک حلقه ``for`` پایش کنید." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid ":ref:`Using asyncio.gather() to run things in parallel `." +msgid "" +":ref:`Using asyncio.gather() to run things in parallel " +"`." msgstr "" +":ref:`استفاده از asyncio.gather() برای اجرای موارد به‌صورت موازی " +"`." -msgid ":ref:`Using asyncio.wait_for() to enforce a timeout `." +msgid "" +":ref:`Using asyncio.wait_for() to enforce a timeout " +"`." msgstr "" +":ref:`استفاده از asyncio.wait_for() برای اعمال مهلت " +"`." msgid ":ref:`Cancellation `." -msgstr "" +msgstr ":ref:`لغو `." msgid ":ref:`Using asyncio.sleep() `." -msgstr "" +msgstr ":ref:`استفاده از asyncio.sleep() `." msgid "See also the main :ref:`Tasks documentation page `." msgstr "" +"همچنین صفحه‌ی مستندات اصلی :ref:`هم‌روال ` را ببینید." msgid "Queues" -msgstr "" +msgstr "صف‌ها" -msgid "Queues should be used to distribute work amongst multiple asyncio Tasks, implement connection pools, and pub/sub patterns." +msgid "" +"Queues should be used to distribute work amongst multiple asyncio Tasks, " +"implement connection pools, and pub/sub patterns." msgstr "" +"باید از صف‌ها برای توزیع کار بین چندین Task در asyncio، پیاده‌سازی استخرهای " +"اتصال و الگوهای pub/sub استفاده شود." msgid ":class:`Queue`" -msgstr "" +msgstr ":class:`Queue`" msgid "A FIFO queue." -msgstr "" +msgstr "یک صف FIFO." msgid ":class:`PriorityQueue`" -msgstr "" +msgstr ":class:`PriorityQueue`" msgid "A priority queue." -msgstr "" +msgstr "یک صف اولویت‌دار." msgid ":class:`LifoQueue`" -msgstr "" +msgstr ":class:`LifoQueue`" msgid "A LIFO queue." -msgstr "" +msgstr "یک صف LIFO." -msgid ":ref:`Using asyncio.Queue to distribute workload between several Tasks `." +msgid "" +":ref:`Using asyncio.Queue to distribute workload between several Tasks " +"`." msgstr "" +":ref:`استفاده از asyncio.Queue برای توزیع بار کاری بین چند Task " +"`." msgid "See also the :ref:`Queues documentation page `." -msgstr "" +msgstr "همچنین :ref:`صفحه‌ی مستندات صف‌ها ` را ببینید." msgid "Subprocesses" -msgstr "" +msgstr "زیرفرایندها" msgid "Utilities to spawn subprocesses and run shell commands." -msgstr "" +msgstr "ابزارهایی برای ایجاد زیرفرایندها و اجرای دستورات پوسته." msgid "``await`` :func:`create_subprocess_exec`" -msgstr "" +msgstr "``await`` :func:`create_subprocess_exec`" msgid "Create a subprocess." -msgstr "" +msgstr "ایجاد یک زیرفرایند." msgid "``await`` :func:`create_subprocess_shell`" -msgstr "" +msgstr "``await`` :func:`create_subprocess_shell`" msgid "Run a shell command." -msgstr "" +msgstr "یک فرمان پوسته را اجرا کنید." msgid ":ref:`Executing a shell command `." -msgstr "" +msgstr ":ref:`اجرای یک دستور پوسته `." -msgid "See also the :ref:`subprocess APIs ` documentation." +msgid "" +"See also the :ref:`subprocess APIs ` documentation." msgstr "" +"همچنین مستندات :ref:`APIهای subprocess ` را ببینید." msgid "Streams" -msgstr "" +msgstr "جریان‌ها" msgid "High-level APIs to work with network IO." -msgstr "" +msgstr "APIهای سطح بالا برای کار با ورودی/خروجی شبکه." msgid "``await`` :func:`open_connection`" -msgstr "" +msgstr "``await`` :func:`open_connection`" msgid "Establish a TCP connection." -msgstr "" +msgstr "برقراری یک اتصال TCP." msgid "``await`` :func:`open_unix_connection`" -msgstr "" +msgstr "``await`` :func:`open_unix_connection`" msgid "Establish a Unix socket connection." -msgstr "" +msgstr "برقراری اتصال سوکت یونیکس." msgid "``await`` :func:`start_server`" -msgstr "" +msgstr "``await`` :func:`start_server`" msgid "Start a TCP server." -msgstr "" +msgstr "یک سرور TCP را راه‌اندازی کنید." msgid "``await`` :func:`start_unix_server`" -msgstr "" +msgstr "``await`` :func:`start_unix_server`" msgid "Start a Unix socket server." -msgstr "" +msgstr "راه‌اندازی یک سرور سوکت یونیکس." msgid ":class:`StreamReader`" -msgstr "" +msgstr ":class:`StreamReader`" msgid "High-level async/await object to receive network data." -msgstr "" +msgstr "شیء سطح‌بالای async/await برای دریافت داده‌های شبکه." msgid ":class:`StreamWriter`" -msgstr "" +msgstr ":class:`StreamWriter`" msgid "High-level async/await object to send network data." -msgstr "" +msgstr "شیء سطح بالای ناهمگام/await برای ارسال داده‌های شبکه." msgid ":ref:`Example TCP client `." -msgstr "" +msgstr ":ref:`نمونه کلاینت TCP `." msgid "See also the :ref:`streams APIs ` documentation." -msgstr "" +msgstr "همچنین مستندات :ref:`APIهای streams ` را ببینید." msgid "Synchronization" -msgstr "" +msgstr "همگام‌سازی" msgid "Threading-like synchronization primitives that can be used in Tasks." msgstr "" +"اولیه‌های همگام‌سازی مشابه threading که می‌توان از آن‌ها در Taskها استفاده " +"کرد." msgid ":class:`Lock`" -msgstr "" +msgstr ":class:`Lock`" msgid "A mutex lock." -msgstr "" +msgstr "یک قفل انحصار متقابل (mutex)." msgid ":class:`Event`" -msgstr "" +msgstr ":class:`Event`" msgid "An event object." -msgstr "" +msgstr "یک شیء رویداد." msgid ":class:`Condition`" -msgstr "" +msgstr ":class:`Condition`" msgid "A condition object." -msgstr "" +msgstr "یک شیء شرطی." msgid ":class:`Semaphore`" -msgstr "" +msgstr ":class:`Semaphore`" msgid "A semaphore." -msgstr "" +msgstr "یک سمافور." msgid ":class:`BoundedSemaphore`" -msgstr "" +msgstr ":class:`BoundedSemaphore`" msgid "A bounded semaphore." -msgstr "" +msgstr "یک سمافور محدود." msgid ":class:`Barrier`" -msgstr "" +msgstr ":class:`Barrier`" msgid "A barrier object." -msgstr "" +msgstr "یک شیء سد." msgid ":ref:`Using asyncio.Event `." -msgstr "" +msgstr ":ref:`استفاده از asyncio.Event `." msgid ":ref:`Using asyncio.Barrier `." -msgstr "" +msgstr ":ref:`استفاده از asyncio.Barrier `." -msgid "See also the documentation of asyncio :ref:`synchronization primitives `." +msgid "" +"See also the documentation of asyncio :ref:`synchronization primitives " +"`." msgstr "" +"همچنین مستندات asyncio برای :ref:`سازوکارهای همگام‌سازی ` را " +"ببینید." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid ":exc:`asyncio.CancelledError`" -msgstr "" +msgstr ":exc:`asyncio.CancelledError`" msgid "Raised when a Task is cancelled. See also :meth:`Task.cancel`." msgstr "" +"هنگامی که یک Task لغو شود، پرتاب می‌شود. همچنین ببینید :meth:`Task.cancel`." msgid ":exc:`asyncio.BrokenBarrierError`" -msgstr "" +msgstr ":exc:`asyncio.BrokenBarrierError`" msgid "Raised when a Barrier is broken. See also :meth:`Barrier.wait`." msgstr "" +"هنگامی که یک Barrier شکسته شود، پرتاب می‌شود. همچنین :meth:`Barrier.wait` را" +" ببینید." -msgid ":ref:`Handling CancelledError to run code on cancellation request `." +msgid "" +":ref:`Handling CancelledError to run code on cancellation request " +"`." msgstr "" +":ref:`مدیریت CancelledError برای اجرای کد در زمان درخواست لغو " +"`." -msgid "See also the full list of :ref:`asyncio-specific exceptions `." +msgid "" +"See also the full list of :ref:`asyncio-specific exceptions `." msgstr "" +"همچنین فهرست کامل :ref:`استثناهای مخصوص asyncio ` را " +"ببینید." diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index a39633e7b..bd49e0f07 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -24,79 +24,146 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Developing with asyncio" -msgstr "" +msgstr "توسعه با asyncio" -msgid "Asynchronous programming is different from classic \"sequential\" programming." -msgstr "" +msgid "" +"Asynchronous programming is different from classic \"sequential\" " +"programming." +msgstr "برنامه‌نویسی ناهمگام با برنامه‌نویسی «ترتیبی» کلاسیک متفاوت است." -msgid "This page lists common mistakes and traps and explains how to avoid them." +msgid "" +"This page lists common mistakes and traps and explains how to avoid them." msgstr "" +"این صفحه، اشتباهات و تله‌های رایج را فهرست می‌کند و نحوه‌ی اجتناب از آن‌ها را" +" توضیح می‌دهد." msgid "Debug Mode" -msgstr "" +msgstr "حالت اشکال‌زدایی" -msgid "By default asyncio runs in production mode. In order to ease the development asyncio has a *debug mode*." +msgid "" +"By default asyncio runs in production mode. In order to ease the " +"development asyncio has a *debug mode*." msgstr "" +"به‌طور پیش‌فرض، asyncio در حالت تولید اجرا می‌شود. برای سهولت در توسعه، " +"asyncio یک *حالت اشکال‌زدایی* دارد." msgid "There are several ways to enable asyncio debug mode:" -msgstr "" +msgstr "راه‌های متعددی برای فعال کردن حالت اشکال‌زدایی asyncio وجود دارد:" -msgid "Setting the :envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``." -msgstr "" +msgid "" +"Setting the :envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``." +msgstr "تنظیم متغیر محیطی :envvar:`PYTHONASYNCIODEBUG` روی ``1``." msgid "Using the :ref:`Python Development Mode `." -msgstr "" +msgstr "استفاده از :ref:`حالت توسعه پایتون `." msgid "Passing ``debug=True`` to :func:`asyncio.run`." -msgstr "" +msgstr "ارسال ``debug=True`` به :func:`asyncio.run`." msgid "Calling :meth:`loop.set_debug`." -msgstr "" +msgstr "فراخوانی :meth:`loop.set_debug`." msgid "In addition to enabling the debug mode, consider also:" msgstr "" +"علاوه بر فعال کردن حالت اشکال‌زدایی، این موارد را نیز در نظر داشته باشید:" -msgid "setting the log level of the :ref:`asyncio logger ` to :py:const:`logging.DEBUG`, for example the following snippet of code can be run at startup of the application::" +msgid "" +"setting the log level of the :ref:`asyncio logger ` to " +":py:const:`logging.DEBUG`, for example the following snippet of code can be " +"run at startup of the application::" msgstr "" +"برای تنظیم سطح گزارشِ :ref:`asyncio logger ` روی " +":py:const:`logging.DEBUG`، می‌توان برای مثال قطعه‌کد زیر را در زمان " +"راه‌اندازی برنامه اجرا کرد::" msgid "logging.basicConfig(level=logging.DEBUG)" -msgstr "" +msgstr "logging.basicConfig(level=logging.DEBUG)" -msgid "configuring the :mod:`warnings` module to display :exc:`ResourceWarning` warnings. One way of doing that is by using the :option:`-W` ``default`` command line option." +msgid "" +"configuring the :mod:`warnings` module to display :exc:`ResourceWarning` " +"warnings. One way of doing that is by using the :option:`-W` ``default`` " +"command line option." msgstr "" +"پیکربندی ماژول :mod:`warnings` برای نمایش هشدارهای :exc:`ResourceWarning`. " +"یکی از راه‌های انجام این کار، استفاده از گزینه‌ی خط فرمان :option:`-W` " +"``default`` است." msgid "When the debug mode is enabled:" -msgstr "" +msgstr "هنگامی که حالت اشکال‌زدایی فعال است:" -msgid "Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:`loop.call_at` methods) raise an exception if they are called from a wrong thread." +msgid "" +"Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and " +":meth:`loop.call_at` methods) raise an exception if they are called from a " +"wrong thread." msgstr "" +"بسیاری از APIهای asyncio که غیرایمن از نظر نخ هستند (مانند متدهای " +":meth:`loop.call_soon` و :meth:`loop.call_at`)، در صورت فراخوانی از یک نخ " +"نادرست، استثنایی را پرتاب می‌کنند." -msgid "The execution time of the I/O selector is logged if it takes too long to perform an I/O operation." +msgid "" +"The execution time of the I/O selector is logged if it takes too long to " +"perform an I/O operation." msgstr "" +"زمان اجرای انتخابگر I/O، در صورتی که انجام یک عملیات I/O بیش از حد طول بکشد،" +" ثبت می‌شود." -msgid "Callbacks taking longer than 100 milliseconds are logged. The :attr:`loop.slow_callback_duration` attribute can be used to set the minimum execution duration in seconds that is considered \"slow\"." +msgid "" +"Callbacks taking longer than 100 milliseconds are logged. The " +":attr:`loop.slow_callback_duration` attribute can be used to set the minimum" +" execution duration in seconds that is considered \"slow\"." msgstr "" +"کال‌بک‌هایی که بیش از ۱۰۰ میلی‌ثانیه طول می‌کشند، ثبت می‌شوند. ویژگی " +":attr:`loop.slow_callback_duration` را می‌توان برای تنظیم حداقل مدت زمان " +"اجرا بر حسب ثانیه که «کند» محسوب می‌شود، استفاده کرد." msgid "Concurrency and Multithreading" -msgstr "" +msgstr "هم‌روندی و چندنخی" -msgid "An event loop runs in a thread (typically the main thread) and executes all callbacks and Tasks in its thread. While a Task is running in the event loop, no other Tasks can run in the same thread. When a Task executes an ``await`` expression, the running Task gets suspended, and the event loop executes the next Task." -msgstr "" +msgid "" +"An event loop runs in a thread (typically the main thread) and executes all " +"callbacks and Tasks in its thread. While a Task is running in the event " +"loop, no other Tasks can run in the same thread. When a Task executes an " +"``await`` expression, the running Task gets suspended, and the event loop " +"executes the next Task." +msgstr "" +"یک حلقه رویداد در یک نخ (معمولاً نخ اصلی) اجرا می‌شود و تمام کال‌بک‌ها و " +"Taskها را در نخ خود اجرا می‌کند. در حالی که یک Task در حلقه رویداد در حال " +"اجرا است، هیچ Task دیگری نمی‌تواند در همان نخ اجرا شود. هنگامی که یک Task یک" +" عبارت ``await`` را اجرا می‌کند، Task در حال اجرا معلق می‌شود و حلقه رویداد " +"Task بعدی را اجرا می‌کند." -msgid "To schedule a :term:`callback` from another OS thread, the :meth:`loop.call_soon_threadsafe` method should be used. Example::" +msgid "" +"To schedule a :term:`callback` from another OS thread, the " +":meth:`loop.call_soon_threadsafe` method should be used. Example::" msgstr "" +"برای زمان‌بندی یک :term:`کال‌بک ` از یک نخ دیگر سیستم‌عامل، باید " +"از متد :meth:`loop.call_soon_threadsafe` استفاده شود. مثال::" msgid "loop.call_soon_threadsafe(callback, *args)" -msgstr "" +msgstr "loop.call_soon_threadsafe(callback, *args)" -msgid "Almost all asyncio objects are not thread safe, which is typically not a problem unless there is code that works with them from outside of a Task or a callback. If there's a need for such code to call a low-level asyncio API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::" +msgid "" +"Almost all asyncio objects are not thread safe, which is typically not a " +"problem unless there is code that works with them from outside of a Task or " +"a callback. If there's a need for such code to call a low-level asyncio " +"API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::" msgstr "" +"تقریباً همه‌ی اشیای asyncio ایمن از نظر نخ نیستند، که این موضوع معمولاً " +"مشکلی ایجاد نمی‌کند، مگر اینکه کدی از خارج از یک Task یا کال‌بک با آن‌ها کار" +" کند. اگر لازم باشد چنین کدی یک API سطح پایین asyncio را فراخوانی کند، باید " +"از متد :meth:`loop.call_soon_threadsafe` استفاده شود، برای مثال::" msgid "loop.call_soon_threadsafe(fut.cancel)" -msgstr "" +msgstr "loop.call_soon_threadsafe(fut.cancel)" -msgid "To schedule a coroutine object from a different OS thread, the :func:`run_coroutine_threadsafe` function should be used. It returns a :class:`concurrent.futures.Future` to access the result::" +msgid "" +"To schedule a coroutine object from a different OS thread, the " +":func:`run_coroutine_threadsafe` function should be used. It returns a " +":class:`concurrent.futures.Future` to access the result::" msgstr "" +"برای زمان‌بندی یک شیء هم‌روال از یک نخ سیستم‌عاملی دیگر، باید از تابع " +":func:`run_coroutine_threadsafe` استفاده شود. این تابع یک " +":class:`concurrent.futures.Future` برای دسترسی به نتیجه برمی‌گرداند::" msgid "" "async def coro_func():\n" @@ -108,45 +175,116 @@ msgid "" "# Wait for the result:\n" "result = future.result()" msgstr "" +"async def coro_func():\n" +" return await asyncio.sleep(1, 42)\n" +"\n" +"# بعداً در یک نخ دیگر از سیستم‌عامل:\n" +"\n" +"future = asyncio.run_coroutine_threadsafe(coro_func(), loop)\n" +"# منتظر نتیجه بمانید:\n" +"result = future.result()" msgid "To handle signals the event loop must be run in the main thread." -msgstr "" +msgstr "برای مدیریت سیگنال‌ها، حلقه رویداد باید در نخ اصلی اجرا شود." -msgid "The :meth:`loop.run_in_executor` method can be used with a :class:`concurrent.futures.ThreadPoolExecutor` or :class:`~concurrent.futures.InterpreterPoolExecutor` to execute blocking code in a different OS thread without blocking the OS thread that the event loop runs in." -msgstr "" +msgid "" +"The :meth:`loop.run_in_executor` method can be used with a " +":class:`concurrent.futures.ThreadPoolExecutor` or " +":class:`~concurrent.futures.InterpreterPoolExecutor` to execute blocking " +"code in a different OS thread without blocking the OS thread that the event " +"loop runs in." +msgstr "" +"می‌توان از متد :meth:`loop.run_in_executor` به‌همراه یک " +":class:`concurrent.futures.ThreadPoolExecutor` یا " +":class:`~concurrent.futures.InterpreterPoolExecutor` برای اجرای کد " +"مسدودکننده در یک نخ سیستم‌عامل دیگر، بدون مسدود کردن نخ سیستم‌عاملی که حلقه " +"رویداد در آن اجرا می‌شود، استفاده کرد." -msgid "There is currently no way to schedule coroutines or callbacks directly from a different process (such as one started with :mod:`multiprocessing`). The :ref:`asyncio-event-loop-methods` section lists APIs that can read from pipes and watch file descriptors without blocking the event loop. In addition, asyncio's :ref:`Subprocess ` APIs provide a way to start a process and communicate with it from the event loop. Lastly, the aforementioned :meth:`loop.run_in_executor` method can also be used with a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a different process." -msgstr "" +msgid "" +"There is currently no way to schedule coroutines or callbacks directly from " +"a different process (such as one started with :mod:`multiprocessing`). The " +":ref:`asyncio-event-loop-methods` section lists APIs that can read from " +"pipes and watch file descriptors without blocking the event loop. In " +"addition, asyncio's :ref:`Subprocess ` APIs provide a " +"way to start a process and communicate with it from the event loop. Lastly, " +"the aforementioned :meth:`loop.run_in_executor` method can also be used with" +" a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " +"different process." +msgstr "" +"در حال حاضر هیچ راهی برای زمان‌بندی هم‌روال‌ها یا کال‌بک‌ها مستقیماً از یک " +"فرایند دیگر وجود ندارد (مانند فرایندی که با :mod:`multiprocessing` شروع شده " +"است). بخش :ref:`asyncio-event-loop-methods` APIهایی را فهرست می‌کند که " +"می‌توانند بدون مسدود کردن حلقه رویداد، از پایپ‌ها بخوانند و توصیف‌گرهای فایل" +" را پایش کنند. علاوه بر این، APIهای :ref:`زیرفرایند ` " +"در asyncio راهی برای شروع یک فرایند و برقراری ارتباط با آن از حلقه رویداد " +"فراهم می‌کنند. در نهایت، متد یادشده :meth:`loop.run_in_executor` را می‌توان " +"نیز با یک :class:`concurrent.futures.ProcessPoolExecutor` برای اجرای کد در " +"یک فرایند دیگر به‌کار برد." msgid "Running Blocking Code" -msgstr "" +msgstr "اجرای کد مسدودکننده" -msgid "Blocking (CPU-bound) code should not be called directly. For example, if a function performs a CPU-intensive calculation for 1 second, all concurrent asyncio Tasks and IO operations would be delayed by 1 second." +msgid "" +"Blocking (CPU-bound) code should not be called directly. For example, if a " +"function performs a CPU-intensive calculation for 1 second, all concurrent " +"asyncio Tasks and IO operations would be delayed by 1 second." msgstr "" +"کد مسدودکننده (CPU-bound) نباید به‌صورت مستقیم فراخوانی شود. برای مثال، اگر " +"تابعی یک محاسبه‌ی سنگین از نظر CPU را به مدت ۱ ثانیه انجام دهد، تمام Taskهای " +"همزمان asyncio و عملیات‌های IO به اندازه‌ی ۱ ثانیه به تأخیر می‌افتند." -msgid "An executor can be used to run a task in a different thread, including in a different interpreter, or even in a different process to avoid blocking the OS thread with the event loop. See the :meth:`loop.run_in_executor` method for more details." +msgid "" +"An executor can be used to run a task in a different thread, including in a " +"different interpreter, or even in a different process to avoid blocking the " +"OS thread with the event loop. See the :meth:`loop.run_in_executor` method " +"for more details." msgstr "" +"می‌توان از یک اجراکننده (executor) برای اجرای یک تکلیف در نخی دیگر، از جمله " +"در مفسری دیگر، یا حتی در فرایندی دیگر استفاده کرد تا از مسدود شدن نخ " +"سیستم‌عاملِ حلقه رویداد جلوگیری شود. برای جزئیات بیشتر، متد " +":meth:`loop.run_in_executor` را ببینید." msgid "Logging" -msgstr "" +msgstr "گزارش‌گیری (Logging)" -msgid "asyncio uses the :mod:`logging` module and all logging is performed via the ``\"asyncio\"`` logger." +msgid "" +"asyncio uses the :mod:`logging` module and all logging is performed via the " +"``\"asyncio\"`` logger." msgstr "" +"asyncio از ماژول :mod:`logging` استفاده می‌کند و تمام گزارش‌گیری از طریق گزارش‌گیر " +"``\"asyncio\"`` انجام می‌شود." -msgid "The default log level is :py:const:`logging.INFO`, which can be easily adjusted::" +msgid "" +"The default log level is :py:const:`logging.INFO`, which can be easily " +"adjusted::" msgstr "" +"سطح گزارش پیش‌فرض :py:const:`logging.INFO` است که به‌سادگی می‌توان آن را " +"تنظیم کرد::" msgid "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" -msgstr "" +msgstr "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" -msgid "Network logging can block the event loop. It is recommended to use a separate thread for handling logs or use non-blocking IO. For example, see :ref:`blocking-handlers`." +msgid "" +"Network logging can block the event loop. It is recommended to use a " +"separate thread for handling logs or use non-blocking IO. For example, see " +":ref:`blocking-handlers`." msgstr "" +"گزارش‌گیری شبکه می‌تواند حلقه رویداد را مسدود کند. توصیه می‌شود برای پردازش " +"گزارش‌ها از یک نخ جداگانه استفاده کنید یا از ورودی/خروجی غیرمسدودکننده (non-" +"blocking IO) استفاده کنید. برای مثال، :ref:`blocking-handlers` را ببینید." msgid "Detect never-awaited coroutines" -msgstr "" +msgstr "تشخیص هم‌روال‌هایی که هرگز await نشده‌اند" -msgid "When a coroutine function is called, but not awaited (e.g. ``coro()`` instead of ``await coro()``) or the coroutine is not scheduled with :meth:`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" +msgid "" +"When a coroutine function is called, but not awaited (e.g. ``coro()`` " +"instead of ``await coro()``) or the coroutine is not scheduled with " +":meth:`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" msgstr "" +"هنگامی که یک تابع هم‌روال فراخوانی می‌شود، اما await نمی‌شود (برای مثال " +"``coro()`` به جای ``await coro()``) یا هم‌روال با " +":meth:`asyncio.create_task` زمان‌بندی نمی‌شود، asyncio یک " +":exc:`RuntimeWarning` صادر می‌کند::" msgid "" "import asyncio\n" @@ -159,17 +297,28 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def test():\n" +" print(\"never scheduled\")\n" +"\n" +"async def main():\n" +" test()\n" +"\n" +"asyncio.run(main())" msgid "Output::" -msgstr "" +msgstr "خروجی::" msgid "" "test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" " test()" msgstr "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +" test()" msgid "Output in debug mode::" -msgstr "" +msgstr "خروجی در حالت اشکال‌زدایی::" msgid "" "test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" @@ -183,23 +332,46 @@ msgid "" " test()\n" " test()" msgstr "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +"Coroutine created at (most recent call last)\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +" < .. >\n" +"\n" +" File \"../t.py\", line 7, in main\n" +" test()\n" +" test()" -msgid "The usual fix is to either await the coroutine or call the :meth:`asyncio.create_task` function::" +msgid "" +"The usual fix is to either await the coroutine or call the " +":meth:`asyncio.create_task` function::" msgstr "" +"راه‌حل معمول این است که یا هم‌روال را await کنید یا تابع " +":meth:`asyncio.create_task` را فراخوانی کنید::" msgid "" "async def main():\n" " await test()" msgstr "" +"async def main():\n" +" await test()" msgid "Detect never-retrieved exceptions" -msgstr "" +msgstr "تشخیص استثناهای هرگز بازیابی‌نشده" -msgid "If a :meth:`Future.set_exception` is called but the Future object is never awaited on, the exception would never be propagated to the user code. In this case, asyncio would emit a log message when the Future object is garbage collected." +msgid "" +"If a :meth:`Future.set_exception` is called but the Future object is never " +"awaited on, the exception would never be propagated to the user code. In " +"this case, asyncio would emit a log message when the Future object is " +"garbage collected." msgstr "" +"اگر :meth:`Future.set_exception` فراخوانی شود اما شیء Future هرگز await " +"نشود، استثنا هرگز به کد کاربر منتقل نمی‌شود. در این حالت، asyncio هنگامی که " +"شیء Future زباله‌روبی می‌شود، یک پیام گزارش صادر می‌کند." msgid "Example of an unhandled exception::" -msgstr "" +msgstr "مثالی از یک استثنای مدیریت‌نشده::" msgid "" "import asyncio\n" @@ -212,6 +384,15 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def bug():\n" +" raise Exception(\"not consumed\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(bug())\n" +"\n" +"asyncio.run(main())" msgid "" "Task exception was never retrieved\n" @@ -223,12 +404,24 @@ msgid "" " raise Exception(\"not consumed\")\n" "Exception: not consumed" msgstr "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed')>\n" +"\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" -msgid ":ref:`Enable the debug mode ` to get the traceback where the task was created::" +msgid "" +":ref:`Enable the debug mode ` to get the traceback where" +" the task was created::" msgstr "" +":ref:`حالت اشکال‌زدایی را فعال کنید ` تا ردگیری پشته‌ی " +"محل ایجاد وظیفه را دریافت کنید::" msgid "asyncio.run(main(), debug=True)" -msgstr "" +msgstr "asyncio.run(main(), debug=True)" msgid "" "Task exception was never retrieved\n" @@ -246,21 +439,59 @@ msgid "" " raise Exception(\"not consumed\")\n" "Exception: not consumed" msgstr "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed') created at asyncio/tasks.py:321>\n" +"\n" +"source_traceback: Object created at (most recent call last):\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +"< .. >\n" +"\n" +"Traceback (most recent call last):\n" +" File \"../t.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" msgid "Asynchronous generators best practices" -msgstr "" +msgstr "بهترین شیوه‌های تولیدگرهای ناهمگام" -msgid "Writing correct and efficient asyncio code requires awareness of certain pitfalls. This section outlines essential best practices that can save you hours of debugging." +msgid "" +"Writing correct and efficient asyncio code requires awareness of certain " +"pitfalls. This section outlines essential best practices that can save you " +"hours of debugging." msgstr "" +"نوشتن کد asyncio صحیح و کارآمد، نیازمند آگاهی از برخی دام‌ها است. این بخش " +"بهترین شیوه‌های ضروری را شرح می‌دهد که می‌تواند شما را از ساعت‌ها " +"اشکال‌زدایی نجات دهد." msgid "Close asynchronous generators explicitly" -msgstr "" +msgstr "تولیدگرهای ناهمگام را به‌صورت صریح ببندید" -msgid "It is recommended to manually close the :term:`asynchronous generator `. If a generator exits early - for example, due to an exception raised in the body of an ``async for`` loop - its asynchronous cleanup code may run in an unexpected context. This can occur after the tasks it depends on have completed, or during the event loop shutdown when the async-generator's garbage collection hook is called." -msgstr "" +msgid "" +"It is recommended to manually close the :term:`asynchronous generator " +"`. If a generator exits early - for " +"example, due to an exception raised in the body of an ``async for`` loop - " +"its asynchronous cleanup code may run in an unexpected context. This can " +"occur after the tasks it depends on have completed, or during the event loop" +" shutdown when the async-generator's garbage collection hook is called." +msgstr "" +"توصیه می‌شود :term:`تولیدگر ناهمگام ` را " +"به‌صورت دستی ببندید. اگر یک تولیدگر زودتر خارج شود، برای مثال، به دلیل پرتاب" +" شدن یک استثنا در بدنه‌ی یک حلقه ``async for``، ممکن است کد پاک‌سازی ناهمگام" +" آن در زمینه‌ای غیرمنتظره اجرا شود. این ممکن است پس از کامل شدن تسک‌هایی که به" +" آن‌ها وابسته است، یا در حین خاموش شدن حلقه‌ی رویداد، هنگامی که قلاب " +"زباله‌روبی تولیدگر ناهمگام فراخوانی می‌شود، رخ دهد." -msgid "To avoid this, explicitly close the generator by calling its :meth:`~agen.aclose` method, or use the :func:`contextlib.aclosing` context manager::" +msgid "" +"To avoid this, explicitly close the generator by calling its " +":meth:`~agen.aclose` method, or use the :func:`contextlib.aclosing` context " +"manager::" msgstr "" +"برای جلوگیری از این موضوع، تولیدگر را با فراخوانی متد :meth:`~agen.aclose` " +"آن به‌صراحت ببندید، یا از مدیر زمینه :func:`contextlib.aclosing` استفاده " +"کنید::" msgid "" "import asyncio\n" @@ -277,9 +508,28 @@ msgid "" "\n" "asyncio.run(func())" msgstr "" +"import asyncio\n" +"import contextlib\n" +"\n" +"async def gen():\n" +" yield 1\n" +" yield 2\n" +"\n" +"async def func():\n" +" async with contextlib.aclosing(gen()) as g:\n" +" async for x in g:\n" +" break # Don't iterate until the end\n" +"\n" +"asyncio.run(func())" -msgid "As noted above, the cleanup code for these asynchronous generators is deferred. The following example demonstrates that the finalization of an asynchronous generator can occur in an unexpected order::" +msgid "" +"As noted above, the cleanup code for these asynchronous generators is " +"deferred. The following example demonstrates that the finalization of an " +"asynchronous generator can occur in an unexpected order::" msgstr "" +"همان‌طور که در بالا ذکر شد، کد پاک‌سازی برای این تولیدگرهای ناهمگام به تعویق" +" می‌افتد. مثال زیر نشان می‌دهد که نهایی‌سازی یک تولیدگر ناهمگام می‌تواند با " +"ترتیبی غیرمنتظره رخ دهد::" msgid "" "import asyncio\n" @@ -308,9 +558,34 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"work_done = False\n" +"\n" +"async def cursor():\n" +" try:\n" +" yield 1\n" +" finally:\n" +" assert work_done\n" +"\n" +"async def rows():\n" +" global work_done\n" +" try:\n" +" yield 2\n" +" finally:\n" +" await asyncio.sleep(0.1) # immitate some async work\n" +" work_done = True\n" +"\n" +"\n" +"async def main():\n" +" async for c in cursor():\n" +" async for r in rows():\n" +" break\n" +" break\n" +"\n" +"asyncio.run(main())" msgid "For this example, we get the following output::" -msgstr "" +msgstr "برای این مثال، خروجی زیر را دریافت می‌کنیم::" msgid "" "unhandled exception during asyncio.run() shutdown\n" @@ -328,12 +603,34 @@ msgid "" " ^^^^^^^^^\n" "AssertionError" msgstr "" +"unhandled exception during asyncio.run() shutdown\n" +"task: ()> exception=AssertionError()>\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 6, in cursor\n" +" yield 1\n" +"asyncio.exceptions.CancelledError\n" +"\n" +"During handling of the above exception, another exception occurred:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 8, in cursor\n" +" assert work_done\n" +" ^^^^^^^^^\n" +"AssertionError" -msgid "The ``cursor()`` asynchronous generator was finalized before the ``rows`` generator - an unexpected behavior." +msgid "" +"The ``cursor()`` asynchronous generator was finalized before the ``rows`` " +"generator - an unexpected behavior." msgstr "" +"تولیدگر ناهمگام ``cursor()`` پیش از تولیدگر ``rows`` نهایی شد - رفتاری " +"غیرمنتظره." -msgid "The example can be fixed by explicitly closing the ``cursor`` and ``rows`` async-generators::" +msgid "" +"The example can be fixed by explicitly closing the ``cursor`` and ``rows`` " +"async-generators::" msgstr "" +"این مثال را می‌توان با بستن صریح تولیدگرهای ناهمگام ``cursor`` و ``rows`` " +"اصلاح کرد::" msgid "" "async def main():\n" @@ -344,27 +641,68 @@ msgid "" " break\n" " break" msgstr "" +"async def main():\n" +" async with contextlib.aclosing(cursor()) as cursor_gen:\n" +" async for c in cursor_gen:\n" +" async with contextlib.aclosing(rows()) as rows_gen:\n" +" async for r in rows_gen:\n" +" break\n" +" break" msgid "Create asynchronous generators only when the event loop is running" msgstr "" +"تولیدگرهای ناهمگام را فقط زمانی ایجاد کنید که حلقه رویداد در حال اجرا است" -msgid "It is recommended to create :term:`asynchronous generators ` only after the event loop has been created." +msgid "" +"It is recommended to create :term:`asynchronous generators ` only after the event loop has been created." msgstr "" +"توصیه می‌شود :term:`تولیدگرهای ناهمگام ` " +"تنها پس از ایجاد حلقه رویداد ایجاد شوند." -msgid "To ensure that asynchronous generators close reliably, the event loop uses the :func:`sys.set_asyncgen_hooks` function to register callback functions. These callbacks update the list of running asynchronous generators to keep it in a consistent state." +msgid "" +"To ensure that asynchronous generators close reliably, the event loop uses " +"the :func:`sys.set_asyncgen_hooks` function to register callback functions. " +"These callbacks update the list of running asynchronous generators to keep " +"it in a consistent state." msgstr "" +"برای اطمینان از اینکه تولیدگرهای ناهمگام به‌طور قابل‌اطمینان بسته شوند، " +"حلقه رویداد از تابع :func:`sys.set_asyncgen_hooks` برای ثبت توابع کال‌بک " +"استفاده می‌کند. این کال‌بک‌ها فهرست تولیدگرهای ناهمگام در حال اجرا را " +"به‌روزرسانی می‌کنند تا آن را در وضعیت سازگار نگه دارند." -msgid "When the :meth:`loop.shutdown_asyncgens() ` function is called, the running generators are stopped gracefully and the list is cleared." +msgid "" +"When the :meth:`loop.shutdown_asyncgens() `" +" function is called, the running generators are stopped gracefully and the " +"list is cleared." msgstr "" +"هنگامی که تابع :meth:`loop.shutdown_asyncgens() " +"` فراخوانی می‌شود، تولیدگرهای در حال اجرا " +"به‌صورت مناسب متوقف می‌شوند و فهرست پاک می‌شود." -msgid "The asynchronous generator invokes the corresponding system hook during its first iteration. At the same time, the generator records that the hook has been called and does not call it again." +msgid "" +"The asynchronous generator invokes the corresponding system hook during its " +"first iteration. At the same time, the generator records that the hook has " +"been called and does not call it again." msgstr "" +"تولیدگر ناهمگام، قلاب سیستم مربوطه را در نخستین تکرار خود فراخوانی می‌کند. " +"در همان زمان، تولیدگر ثبت می‌کند که قلاب فراخوانی شده است و دیگر آن را " +"فراخوانی نمی‌کند." -msgid "Therefore, if iteration begins before the event loop is created, the event loop will not be able to add the generator to its list of active generators because the hooks are set after the generator attempts to call them. Consequently, the event loop will not be able to terminate the generator if necessary." +msgid "" +"Therefore, if iteration begins before the event loop is created, the event " +"loop will not be able to add the generator to its list of active generators " +"because the hooks are set after the generator attempts to call them. " +"Consequently, the event loop will not be able to terminate the generator if " +"necessary." msgstr "" +"بنابراین، اگر تکرار پیش از ایجاد حلقه رویداد آغاز شود، حلقه رویداد نمی‌تواند" +" تولیدگر را به فهرست تولیدگرهای فعال خود اضافه کند، زیرا قلاب‌ها پس از تلاش " +"تولیدگر برای فراخوانی آن‌ها تنظیم می‌شوند. در نتیجه، حلقه رویداد در صورت " +"لزوم نمی‌تواند تولیدگر را خاتمه دهد." msgid "Consider the following example::" -msgstr "" +msgstr "مثال زیر را در نظر بگیرید::" msgid "" "import asyncio\n" @@ -381,6 +719,19 @@ msgid "" " print(runner.run(anext(agen)))\n" " del agen" msgstr "" +"import asyncio\n" +"\n" +"async def agenfn():\n" +" try:\n" +" yield 10\n" +" finally:\n" +" await asyncio.sleep(0)\n" +"\n" +"\n" +"with asyncio.Runner() as runner:\n" +" agen = agenfn()\n" +" print(runner.run(anext(agen)))\n" +" del agen" msgid "" "10\n" @@ -391,9 +742,16 @@ msgid "" " ^^^^\n" "RuntimeError: async generator ignored GeneratorExit" msgstr "" +"10\n" +"Exception ignored while closing generator :\n" +"Traceback (most recent call last):\n" +" File \"example.py\", line 13, in \n" +" del agen\n" +" ^^^^\n" +"RuntimeError: async generator ignored GeneratorExit" msgid "This example can be fixed as follows::" -msgstr "" +msgstr "این مثال را می‌توان به‌صورت زیر اصلاح کرد::" msgid "" "import asyncio\n" @@ -411,15 +769,36 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def agenfn():\n" +" try:\n" +" yield 10\n" +" finally:\n" +" await asyncio.sleep(0)\n" +"\n" +"async def main():\n" +" agen = agenfn()\n" +" print(await anext(agen))\n" +" del agen\n" +"\n" +"asyncio.run(main())" msgid "Avoid concurrent iteration and closure of the same generator" -msgstr "" +msgstr "از پیمایش و بستن همزمان یک تولیدگر یکسان خودداری کنید" -msgid "Async generators may be reentered while another :meth:`~agen.__anext__` / :meth:`~agen.athrow` / :meth:`~agen.aclose` call is in progress. This may lead to an inconsistent state of the async generator and can cause errors." +msgid "" +"Async generators may be reentered while another :meth:`~agen.__anext__` / " +":meth:`~agen.athrow` / :meth:`~agen.aclose` call is in progress. This may " +"lead to an inconsistent state of the async generator and can cause errors." msgstr "" +"ممکن است به تولیدگرهای ناهمگام در حالی که فراخوانی دیگری از " +":meth:`~agen.__anext__` / :meth:`~agen.athrow` / :meth:`~agen.aclose` در حال" +" انجام است، دوباره وارد شد. این موضوع ممکن است منجر به وضعیت ناسازگار در " +"تولیدگر ناهمگام شود و می‌تواند موجب خطاها شود." msgid "Let's consider the following example::" -msgstr "" +msgstr "مثال زیر را در نظر بگیرید::" msgid "" "import asyncio\n" @@ -441,6 +820,24 @@ msgid "" "\n" "asyncio.run(amain())" msgstr "" +"import asyncio\n" +"\n" +"async def consumer():\n" +" for idx in range(100):\n" +" await asyncio.sleep(0)\n" +" message = yield idx\n" +" print('received', message)\n" +"\n" +"async def amain():\n" +" agenerator = consumer()\n" +" await agenerator.asend(None)\n" +"\n" +" fa = asyncio.create_task(agenerator.asend('A'))\n" +" fb = asyncio.create_task(agenerator.asend('B'))\n" +" await fa\n" +" await fb\n" +"\n" +"asyncio.run(amain())" msgid "" "received A\n" @@ -461,6 +858,27 @@ msgid "" " await fb\n" "RuntimeError: anext(): asynchronous generator is already running" msgstr "" +"received A\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 38, in \n" +" asyncio.run(amain())\n" +" ~~~~~~~~~~~^^^^^^^^^\n" +" File \"Lib/asyncio/runners.py\", line 204, in run\n" +" return runner.run(main)\n" +" ~~~~~~~~~~^^^^^^\n" +" File \"Lib/asyncio/runners.py\", line 127, in run\n" +" return self._loop.run_until_complete(task)\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n" +" File \"Lib/asyncio/base_events.py\", line 719, in run_until_complete\n" +" return future.result()\n" +" ~~~~~~~~~~~~~~~\n" +" File \"test.py\", line 36, in amain\n" +" await fb\n" +"RuntimeError: anext(): asynchronous generator is already running" -msgid "Therefore, it is recommended to avoid using asynchronous generators in parallel tasks or across multiple event loops." +msgid "" +"Therefore, it is recommended to avoid using asynchronous generators in " +"parallel tasks or across multiple event loops." msgstr "" +"بنابراین، توصیه می‌شود از استفاده از تولیدگرهای ناهمگام در وظایف موازی یا " +"بین چندین حلقه رویداد خودداری کنید." diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 2f497b728..b76cb0f9c 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -25,142 +25,268 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Event loop" -msgstr "" +msgstr "حلقه رویداد" -msgid "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/base_events.py`" +msgid "" +"**Source code:** :source:`Lib/asyncio/events.py`, " +":source:`Lib/asyncio/base_events.py`" msgstr "" +":source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/base_events.py`" msgid "Preface" -msgstr "" +msgstr "پیشگفتار" -msgid "The event loop is the core of every asyncio application. Event loops run asynchronous tasks and callbacks, perform network IO operations, and run subprocesses." +msgid "" +"The event loop is the core of every asyncio application. Event loops run " +"asynchronous tasks and callbacks, perform network IO operations, and run " +"subprocesses." msgstr "" +"حلقه‌ی رویداد، هسته‌ی هر برنامه‌ی asyncio است. حلقه‌های رویداد، وظایف ناهمگام" +" و کال‌بک‌ها را اجرا می‌کنند، عملیات ورودی/خروجی شبکه را انجام می‌دهند و " +"زیرفرایندها را اجرا می‌کنند." -msgid "Application developers should typically use the high-level asyncio functions, such as :func:`asyncio.run`, and should rarely need to reference the loop object or call its methods. This section is intended mostly for authors of lower-level code, libraries, and frameworks, who need finer control over the event loop behavior." -msgstr "" +msgid "" +"Application developers should typically use the high-level asyncio " +"functions, such as :func:`asyncio.run`, and should rarely need to reference " +"the loop object or call its methods. This section is intended mostly for " +"authors of lower-level code, libraries, and frameworks, who need finer " +"control over the event loop behavior." +msgstr "" +"توسعه‌دهندگان برنامه باید معمولاً از توابع سطح بالای asyncio، مانند " +":func:`asyncio.run`، استفاده کنند و به‌ندرت نیاز است که به شیء حلقه ارجاع " +"دهند یا متدهای آن را فراخوانی کنند. این بخش عمدتاً برای نویسندگان کد، " +"کتابخانه‌ها و فریم‌ورک‌های سطح پایین‌تر در نظر گرفته شده است که به کنترل " +"دقیق‌تری بر رفتار حلقه رویداد نیاز دارند." msgid "Obtaining the Event Loop" -msgstr "" +msgstr "به دست آوردن حلقه رویداد" -msgid "The following low-level functions can be used to get, set, or create an event loop:" +msgid "" +"The following low-level functions can be used to get, set, or create an " +"event loop:" msgstr "" +"می‌توان از توابع سطح پایین زیر برای دریافت، تنظیم یا ایجاد یک حلقه رویداد " +"استفاده کرد:" msgid "Return the running event loop in the current OS thread." -msgstr "" +msgstr "حلقه رویداد در حال اجرا را در نخ سیستم‌عامل فعلی برمی‌گرداند." msgid "Raise a :exc:`RuntimeError` if there is no running event loop." msgstr "" +"اگر هیچ حلقه رویدادی در حال اجرا نباشد، یک :exc:`RuntimeError` پرتاب می‌شود." msgid "This function can only be called from a coroutine or a callback." -msgstr "" +msgstr "این تابع را فقط می‌توان از یک هم‌روال یا کال‌بک فراخوانی کرد." msgid "Get the current event loop." -msgstr "" +msgstr "حلقه‌ی رویداد جاری را دریافت کنید." -msgid "When called from a coroutine or a callback (e.g. scheduled with call_soon or similar API), this function will always return the running event loop." +msgid "" +"When called from a coroutine or a callback (e.g. scheduled with call_soon or" +" similar API), this function will always return the running event loop." msgstr "" +"هنگامی که از یک هم‌روال یا کال‌بک (مثلاً زمان‌بندی‌شده با call_soon یا API " +"مشابه) فراخوانی شود، این تابع همیشه حلقه رویداد در حال اجرا را برمی‌گرداند." -msgid "If there is no running event loop set, the function will return the result of the ``get_event_loop_policy().get_event_loop()`` call." +msgid "" +"If there is no running event loop set, the function will return the result " +"of the ``get_event_loop_policy().get_event_loop()`` call." msgstr "" +"اگر هیچ حلقه‌ی رویداد در حال اجرا تنظیم‌نشده باشد، تابع نتیجه‌ی فراخوانی " +"``get_event_loop_policy().get_event_loop()`` را برمی‌گرداند." -msgid "Because this function has rather complex behavior (especially when custom event loop policies are in use), using the :func:`get_running_loop` function is preferred to :func:`get_event_loop` in coroutines and callbacks." +msgid "" +"Because this function has rather complex behavior (especially when custom " +"event loop policies are in use), using the :func:`get_running_loop` function" +" is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" +"از آنجا که این تابع رفتار نسبتاً پیچیده‌ای دارد (به‌ویژه زمانی که از " +"سیاست‌های سفارشی حلقه رویداد استفاده می‌شود)، در هم‌روال‌ها و کال‌بک‌ها " +"استفاده از تابع :func:`get_running_loop` به :func:`get_event_loop` ترجیح " +"داده می‌شود." -msgid "As noted above, consider using the higher-level :func:`asyncio.run` function, instead of using these lower level functions to manually create and close an event loop." +msgid "" +"As noted above, consider using the higher-level :func:`asyncio.run` " +"function, instead of using these lower level functions to manually create " +"and close an event loop." msgstr "" +"همان‌طور که در بالا اشاره شد، به‌جای استفاده از این توابع سطح پایین برای " +"ایجاد و بستن دستی حلقه رویداد، استفاده از تابع سطح بالاتر " +":func:`asyncio.run` را در نظر بگیرید." msgid "Raises a :exc:`RuntimeError` if there is no current event loop." msgstr "" +"اگر حلقه رویداد جاری وجود نداشته باشد، یک :exc:`RuntimeError` پرتاب می‌شود." -msgid "The :mod:`!asyncio` policy system is deprecated and will be removed in Python 3.16; from there on, this function will return the current running event loop if present else it will return the loop set by :func:`set_event_loop`." +msgid "" +"The :mod:`!asyncio` policy system is deprecated and will be removed in " +"Python 3.16; from there on, this function will return the current running " +"event loop if present else it will return the loop set by " +":func:`set_event_loop`." msgstr "" +"سیستم سیاست‌گذاری :mod:`!asyncio` منسوخ شده است و در Python 3.16 حذف خواهد " +"شد؛ از آن پس، این تابع در صورت وجود، حلقه رویداد در حال اجرای فعلی را " +"برمی‌گرداند، در غیر این صورت حلقه تنظیم‌شده توسط :func:`set_event_loop` را " +"برمی‌گرداند." msgid "Set *loop* as the current event loop for the current OS thread." msgstr "" +"*loop* را به‌عنوان حلقه رویداد جاری برای نخ جاری سیستم‌عامل تنظیم می‌کند." msgid "Create and return a new event loop object." -msgstr "" +msgstr "یک شیء حلقه رویداد جدید ایجاد و برمی‌گرداند." -msgid "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop` functions can be altered by :ref:`setting a custom event loop policy `." +msgid "" +"Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " +"and :func:`new_event_loop` functions can be altered by :ref:`setting a " +"custom event loop policy `." msgstr "" +"توجه داشته باشید که رفتار توابع :func:`get_event_loop`، " +":func:`set_event_loop` و :func:`new_event_loop` می‌تواند با :ref:`تنظیم یک " +"سیاست حلقه رویداد سفارشی ` تغییر کند." msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "This documentation page contains the following sections:" -msgstr "" +msgstr "این صفحه‌ی مستندات شامل بخش‌های زیر است:" -msgid "The `Event Loop Methods`_ section is the reference documentation of the event loop APIs;" -msgstr "" +msgid "" +"The `Event Loop Methods`_ section is the reference documentation of the " +"event loop APIs;" +msgstr "بخش `Event Loop Methods`_ مستندات مرجع APIهای حلقه رویداد است؛" -msgid "The `Callback Handles`_ section documents the :class:`Handle` and :class:`TimerHandle` instances which are returned from scheduling methods such as :meth:`loop.call_soon` and :meth:`loop.call_later`;" +msgid "" +"The `Callback Handles`_ section documents the :class:`Handle` and " +":class:`TimerHandle` instances which are returned from scheduling methods " +"such as :meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" +"بخش `Callback Handles`_ نمونه‌های :class:`Handle` و :class:`TimerHandle` را " +"که از متدهای زمان‌بندی مانند :meth:`loop.call_soon` و " +":meth:`loop.call_later` بازگردانده می‌شوند، توضیح می‌دهد؛" -msgid "The `Server Objects`_ section documents types returned from event loop methods like :meth:`loop.create_server`;" +msgid "" +"The `Server Objects`_ section documents types returned from event loop " +"methods like :meth:`loop.create_server`;" msgstr "" +"بخش `Server Objects`_ انواعی را که از متدهای حلقه رویداد مانند " +":meth:`loop.create_server` بازگشت داده می‌شوند، توضیح می‌دهد؛" -msgid "The `Event Loop Implementations`_ section documents the :class:`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" +msgid "" +"The `Event Loop Implementations`_ section documents the " +":class:`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" +"بخش `Event Loop Implementations`_، کلاس‌های :class:`SelectorEventLoop` و " +":class:`ProactorEventLoop` را مستند می‌کند؛" -msgid "The `Examples`_ section showcases how to work with some event loop APIs." +msgid "" +"The `Examples`_ section showcases how to work with some event loop APIs." msgstr "" +"بخش `Examples`_ چگونگی کار با برخی از APIهای حلقه رویداد را نشان می‌دهد." msgid "Event loop methods" -msgstr "" +msgstr "متدهای حلقه رویداد" msgid "Event loops have **low-level** APIs for the following:" -msgstr "" +msgstr "حلقه‌های رویداد APIهای **سطح پایین** برای موارد زیر دارند:" msgid "Running and stopping the loop" -msgstr "" +msgstr "اجرا و توقف حلقه" msgid "Run until the *future* (an instance of :class:`Future`) has completed." -msgstr "" +msgstr "تا کامل شدن *future* (نمونه‌ای از :class:`Future`) اجرا کنید." -msgid "If the argument is a :ref:`coroutine object ` it is implicitly scheduled to run as a :class:`asyncio.Task`." +msgid "" +"If the argument is a :ref:`coroutine object ` it is implicitly " +"scheduled to run as a :class:`asyncio.Task`." msgstr "" +"اگر آرگومان یک :ref:`شیء هم‌روال ` باشد، به‌طور ضمنی برای اجرا " +"به‌عنوان یک :class:`asyncio.Task` زمان‌بندی می‌شود." msgid "Return the Future's result or raise its exception." -msgstr "" +msgstr "نتیجه‌ی Future را برمی‌گرداند یا استثنای آن را پرتاب می‌کند." msgid "Run the event loop until :meth:`stop` is called." -msgstr "" +msgstr "حلقه رویداد را تا زمانی که :meth:`stop` فراخوانی شود، اجرا کنید." -msgid "If :meth:`stop` is called before :meth:`run_forever` is called, the loop will poll the I/O selector once with a timeout of zero, run all callbacks scheduled in response to I/O events (and those that were already scheduled), and then exit." +msgid "" +"If :meth:`stop` is called before :meth:`run_forever` is called, the loop " +"will poll the I/O selector once with a timeout of zero, run all callbacks " +"scheduled in response to I/O events (and those that were already scheduled)," +" and then exit." msgstr "" +"اگر :meth:`stop` پیش از فراخوانی :meth:`run_forever` فراخوانی شود، حلقه " +"انتخابگر I/O را یک بار با مهلت صفر پایش می‌کند، تمام کال‌بک‌های " +"برنامه‌ریزی‌شده در پاسخ به رویدادهای I/O (و آن‌هایی که از قبل " +"برنامه‌ریزی‌شده بودند) را اجرا می‌کند و سپس خارج می‌شود." -msgid "If :meth:`stop` is called while :meth:`run_forever` is running, the loop will run the current batch of callbacks and then exit. Note that new callbacks scheduled by callbacks will not run in this case; instead, they will run the next time :meth:`run_forever` or :meth:`run_until_complete` is called." -msgstr "" +msgid "" +"If :meth:`stop` is called while :meth:`run_forever` is running, the loop " +"will run the current batch of callbacks and then exit. Note that new " +"callbacks scheduled by callbacks will not run in this case; instead, they " +"will run the next time :meth:`run_forever` or :meth:`run_until_complete` is " +"called." +msgstr "" +"اگر :meth:`stop` در حالی که :meth:`run_forever` در حال اجرا است فراخوانی " +"شود، حلقه دسته فعلی کال‌بک‌ها را اجرا می‌کند و سپس خارج می‌شود. توجه داشته " +"باشید که کال‌بک‌های جدیدی که توسط کال‌بک‌ها زمان‌بندی شده‌اند، در این حالت " +"اجرا نخواهند شد؛ در عوض، آن‌ها بار بعدی که :meth:`run_forever` یا " +":meth:`run_until_complete` فراخوانی شود، اجرا خواهند شد." msgid "Stop the event loop." -msgstr "" +msgstr "حلقه رویداد را متوقف کنید." msgid "Return ``True`` if the event loop is currently running." -msgstr "" +msgstr "اگر حلقه رویداد هم‌اکنون در حال اجرا باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the event loop was closed." -msgstr "" +msgstr "اگر حلقه رویداد بسته شده باشد، ``True`` را برمی‌گرداند." msgid "Close the event loop." -msgstr "" +msgstr "حلقه رویداد را ببندید." -msgid "The loop must not be running when this function is called. Any pending callbacks will be discarded." +msgid "" +"The loop must not be running when this function is called. Any pending " +"callbacks will be discarded." msgstr "" +"هنگامی که این تابع فراخوانی می‌شود، حلقه نباید در حال اجرا باشد. تمام " +"کال‌بک‌های در انتظار دور ریخته می‌شوند." -msgid "This method clears all queues and shuts down the executor, but does not wait for the executor to finish." +msgid "" +"This method clears all queues and shuts down the executor, but does not wait" +" for the executor to finish." msgstr "" +"این متد همه صف‌ها را پاک می‌کند و اجراکننده (executor) را خاموش می‌کند، اما " +"منتظر پایان اجراکننده نمی‌ماند." -msgid "This method is idempotent and irreversible. No other methods should be called after the event loop is closed." +msgid "" +"This method is idempotent and irreversible. No other methods should be " +"called after the event loop is closed." msgstr "" +"این متد هم‌توان (idempotent) و بازگشت‌ناپذیر است. پس از بسته شدن حلقه " +"رویداد، نباید متدهای دیگری فراخوانی شوند." -msgid "Schedule all currently open :term:`asynchronous generator` objects to close with an :meth:`~agen.aclose` call. After calling this method, the event loop will issue a warning if a new asynchronous generator is iterated. This should be used to reliably finalize all scheduled asynchronous generators." +msgid "" +"Schedule all currently open :term:`asynchronous generator` objects to close " +"with an :meth:`~agen.aclose` call. After calling this method, the event " +"loop will issue a warning if a new asynchronous generator is iterated. This " +"should be used to reliably finalize all scheduled asynchronous generators." msgstr "" +"تمام اشیای :term:`asynchronous generator` را که در حال حاضر باز هستند، " +"برای بسته‌شدن با فراخوانی :meth:`~agen.aclose` زمان‌بندی می‌کند. پس از " +"فراخوانی این متد، در صورت پیمایش یک تولیدگر ناهمگام جدید، حلقه رویداد هشداری" +" صادر خواهد کرد. باید از این برای نهایی‌سازی قابل‌اطمینان تمام تولیدگرهای " +"ناهمگام زمان‌بندی‌شده استفاده شود." -msgid "Note that there is no need to call this function when :func:`asyncio.run` is used." +msgid "" +"Note that there is no need to call this function when :func:`asyncio.run` is" +" used." msgstr "" +"توجه داشته باشید که هنگامی که از :func:`asyncio.run` استفاده می‌شود، نیازی " +"به فراخوانی این تابع نیست." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "try:\n" @@ -169,726 +295,1681 @@ msgid "" " loop.run_until_complete(loop.shutdown_asyncgens())\n" " loop.close()" msgstr "" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.run_until_complete(loop.shutdown_asyncgens())\n" +" loop.close()" -msgid "Schedule the closure of the default executor and wait for it to join all of the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once this method has been called, using the default executor with :meth:`loop.run_in_executor` will raise a :exc:`RuntimeError`." +msgid "" +"Schedule the closure of the default executor and wait for it to join all of " +"the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " +"this method has been called, using the default executor with " +":meth:`loop.run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" +"بستن اجراکننده‌ی پیش‌فرض را زمان‌بندی می‌کند و منتظر می‌ماند تا همه‌ی نخ‌های" +" موجود در :class:`~concurrent.futures.ThreadPoolExecutor` join شوند. پس از " +"فراخوانی این متد، استفاده از اجراکننده‌ی پیش‌فرض با " +":meth:`loop.run_in_executor` باعث پرتاب یک :exc:`RuntimeError` خواهد شد." -msgid "The *timeout* parameter specifies the amount of time (in :class:`float` seconds) the executor will be given to finish joining. With the default, ``None``, the executor is allowed an unlimited amount of time." +msgid "" +"The *timeout* parameter specifies the amount of time (in :class:`float` " +"seconds) the executor will be given to finish joining. With the default, " +"``None``, the executor is allowed an unlimited amount of time." msgstr "" +"پارامتر *timeout* مدت زمانی را مشخص می‌کند (بر حسب ثانیه از نوع " +":class:`float`) که به اجراکننده (executor) برای اتمام پیوستن (joining) داده " +"می‌شود. با مقدار پیش‌فرض ``None``، به اجراکننده زمان نامحدودی داده می‌شود." -msgid "If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the default executor is terminated without waiting for its threads to finish joining." +msgid "" +"If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " +"default executor is terminated without waiting for its threads to finish " +"joining." msgstr "" +"در صورت رسیدن به *timeout*، یک :exc:`RuntimeWarning` صادر می‌شود و اجراکننده" +" پیش‌فرض بدون انتظار برای اتمام پیوستن (joining) نخ‌های آن خاتمه داده " +"می‌شود." -msgid "Do not call this method when using :func:`asyncio.run`, as the latter handles default executor shutdown automatically." +msgid "" +"Do not call this method when using :func:`asyncio.run`, as the latter " +"handles default executor shutdown automatically." msgstr "" +"هنگام استفاده از :func:`asyncio.run`، این متد را فراخوانی نکنید، زیرا این " +"تابع خاموش کردن اجراکننده (executor) پیش‌فرض را به‌صورت خودکار مدیریت " +"می‌کند." msgid "Added the *timeout* parameter." -msgstr "" +msgstr "پارامتر *timeout* افزوده شد." msgid "Scheduling callbacks" -msgstr "" +msgstr "زمان‌بندی کال‌بک‌ها" -msgid "Schedule the *callback* :term:`callback` to be called with *args* arguments at the next iteration of the event loop." +msgid "" +"Schedule the *callback* :term:`callback` to be called with *args* arguments " +"at the next iteration of the event loop." msgstr "" +"*callback* :term:`کال‌بک ` را زمان‌بندی کنید تا در تکرار بعدی حلقه" +" رویداد با آرگومان‌های *args* فراخوانی شود." -msgid "Return an instance of :class:`asyncio.Handle`, which can be used later to cancel the callback." +msgid "" +"Return an instance of :class:`asyncio.Handle`, which can be used later to " +"cancel the callback." msgstr "" +"یک نمونه از :class:`asyncio.Handle` برمی‌گرداند، که بعداً می‌توان از آن برای" +" لغو کال‌بک استفاده کرد." -msgid "Callbacks are called in the order in which they are registered. Each callback will be called exactly once." +msgid "" +"Callbacks are called in the order in which they are registered. Each " +"callback will be called exactly once." msgstr "" +"کال‌بک‌ها به همان ترتیبی که ثبت شده‌اند فراخوانی می‌شوند. هر کال‌بک دقیقاً " +"یک بار فراخوانی خواهد شد." -msgid "The optional keyword-only *context* argument specifies a custom :class:`contextvars.Context` for the *callback* to run in. Callbacks use the current context when no *context* is provided." +msgid "" +"The optional keyword-only *context* argument specifies a custom " +":class:`contextvars.Context` for the *callback* to run in. Callbacks use the" +" current context when no *context* is provided." msgstr "" +"آرگومان *context* که اختیاری و فقط کلیدواژه‌ای است، یک " +":class:`contextvars.Context` سفارشی را مشخص می‌کند تا *callback* در آن اجرا " +"شود. در صورتی که *context* ارائه نشود، کال‌بک‌ها از زمینه‌ی جاری استفاده " +"می‌کنند." msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." -msgstr "" +msgstr "برخلاف :meth:`call_soon_threadsafe`، این متد ایمن از نظر نخ نیست." -msgid "A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from another thread, this function *must* be used, since :meth:`call_soon` is not thread-safe." +msgid "" +"A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " +"another thread, this function *must* be used, since :meth:`call_soon` is not" +" thread-safe." msgstr "" +"یک گونه‌ی ایمن در برابر نخ از :meth:`call_soon`. هنگام زمان‌بندی کال‌بک‌ها از" +" یک نخ دیگر، این تابع *باید* استفاده شود، زیرا :meth:`call_soon` ایمن در " +"برابر نخ نیست." -msgid "This function is safe to be called from a reentrant context or signal handler, however, it is not safe or fruitful to use the returned handle in such contexts." +msgid "" +"This function is safe to be called from a reentrant context or signal " +"handler, however, it is not safe or fruitful to use the returned handle in " +"such contexts." msgstr "" +"فراخوانی این تابع از یک زمینه‌ی بازورودپذیر (reentrant context) یا مدیر سیگنال " +"ایمن است؛ با این حال، استفاده از دسته‌ی برگردانده‌شده (handle) در چنین " +"زمینه‌هایی ایمن یا مفید نیست." -msgid "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can happen on a secondary thread when the main application is shutting down." +msgid "" +"Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " +"happen on a secondary thread when the main application is shutting down." msgstr "" +"اگر روی حلقه‌ای که بسته شده است فراخوانی شود، :exc:`RuntimeError` پرتاب " +"می‌شود. این اتفاق ممکن است در یک نخ ثانویه هنگامی که برنامه اصلی در حال " +"خاموش شدن است رخ دهد." -msgid "See the :ref:`concurrency and multithreading ` section of the documentation." +msgid "" +"See the :ref:`concurrency and multithreading ` " +"section of the documentation." msgstr "" +"بخش :ref:`همروندی و چندنخی ` مستندات را ببینید." -msgid "The *context* keyword-only parameter was added. See :pep:`567` for more details." +msgid "" +"The *context* keyword-only parameter was added. See :pep:`567` for more " +"details." msgstr "" +"پارامتر فقط کلیدواژه‌ای *context* اضافه شد. برای جزئیات بیشتر :pep:`567` را " +"ببینید." -msgid "Most :mod:`asyncio` scheduling functions don't allow passing keyword arguments. To do that, use :func:`functools.partial`::" +msgid "" +"Most :mod:`asyncio` scheduling functions don't allow passing keyword " +"arguments. To do that, use :func:`functools.partial`::" msgstr "" +"بیشتر توابع زمان‌بندی :mod:`asyncio` اجازه‌ی ارسال آرگومان‌های کلیدواژه‌ای را" +" نمی‌دهند. برای این کار، از :func:`functools.partial` استفاده کنید::" msgid "" "# will schedule \"print(\"Hello\", flush=True)\"\n" "loop.call_soon(\n" " functools.partial(print, \"Hello\", flush=True))" msgstr "" +"# will schedule \"print(\"Hello\", flush=True)\"\n" +"loop.call_soon(\n" +" functools.partial(print, \"Hello\", flush=True))" -msgid "Using partial objects is usually more convenient than using lambdas, as asyncio can render partial objects better in debug and error messages." +msgid "" +"Using partial objects is usually more convenient than using lambdas, as " +"asyncio can render partial objects better in debug and error messages." msgstr "" +"استفاده از اشیاء partial معمولاً راحت‌تر از استفاده از لامبداها است، زیرا " +"asyncio می‌تواند اشیاء partial را بهتر در پیام‌های اشکال‌زدایی و خطا نمایش " +"دهد." msgid "Scheduling delayed callbacks" -msgstr "" +msgstr "زمان‌بندی کال‌بک‌های تأخیری" -msgid "Event loop provides mechanisms to schedule callback functions to be called at some point in the future. Event loop uses monotonic clocks to track time." +msgid "" +"Event loop provides mechanisms to schedule callback functions to be called " +"at some point in the future. Event loop uses monotonic clocks to track " +"time." msgstr "" +"حلقه رویداد سازوکارهایی را برای زمان‌بندی توابع کال‌بک فراهم می‌کند تا در " +"زمانی در آینده فراخوانی شوند. حلقه رویداد از ساعت‌های یکنواخت برای پیگیری " +"زمان استفاده می‌کند." -msgid "Schedule *callback* to be called after the given *delay* number of seconds (can be either an int or a float)." +msgid "" +"Schedule *callback* to be called after the given *delay* number of seconds " +"(can be either an int or a float)." msgstr "" +"فراخوانی *callback* را پس از *delay* ثانیه زمان‌بندی می‌کند (این مقدار " +"می‌تواند عدد صحیح یا شناور باشد)." -msgid "An instance of :class:`asyncio.TimerHandle` is returned which can be used to cancel the callback." +msgid "" +"An instance of :class:`asyncio.TimerHandle` is returned which can be used to" +" cancel the callback." msgstr "" +"یک نمونه از :class:`asyncio.TimerHandle` بازگردانده می‌شود که می‌توان از آن " +"برای لغو کال‌بک استفاده کرد." -msgid "*callback* will be called exactly once. If two callbacks are scheduled for exactly the same time, the order in which they are called is undefined." +msgid "" +"*callback* will be called exactly once. If two callbacks are scheduled for " +"exactly the same time, the order in which they are called is undefined." msgstr "" +"*کال‌بک* دقیقاً یک بار فراخوانی می‌شود. اگر دو کال‌بک برای زمان دقیقاً " +"یکسانی زمان‌بندی شده باشند، ترتیب فراخوانی آن‌ها تعریف‌نشده است." -msgid "The optional positional *args* will be passed to the callback when it is called. Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." +msgid "" +"The optional positional *args* will be passed to the callback when it is " +"called. Use :func:`functools.partial` :ref:`to pass keyword arguments " +"` to *callback*." msgstr "" +"آرگومان‌های جایگاهی اختیاری *args* هنگام فراخوانی کال‌بک به آن فرستاده " +"می‌شوند. برای فرستادن آرگومان‌های کلیدواژه‌ای به *callback* از " +":func:`functools.partial` :ref:`برای فرستادن آرگومان‌های کلیدواژه‌ای " +"` استفاده کنید." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. The current context is used when no *context* is provided." +msgid "" +"An optional keyword-only *context* argument allows specifying a custom " +":class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." msgstr "" +"آرگومان اختیاری فقط کلیدواژه‌ای *context*، امکان تعیین یک " +":class:`contextvars.Context` سفارشی را فراهم می‌کند تا *callback* در آن اجرا" +" شود. در صورتی که *context* ارائه نشود، از زمینه فعلی استفاده می‌شود." -msgid "For performance, callbacks scheduled with :meth:`loop.call_later` may run up to one clock-resolution early (see ``time.get_clock_info('monotonic').resolution``)." +msgid "" +"For performance, callbacks scheduled with :meth:`loop.call_later` may run up" +" to one clock-resolution early (see " +"``time.get_clock_info('monotonic').resolution``)." msgstr "" +"برای کارایی، کال‌بک‌های زمان‌بندی‌شده با :meth:`loop.call_later` ممکن است تا" +" یک دقت ساعت زودتر اجرا شوند (به " +"``time.get_clock_info('monotonic').resolution`` مراجعه کنید)." -msgid "In Python 3.7 and earlier with the default event loop implementation, the *delay* could not exceed one day. This has been fixed in Python 3.8." +msgid "" +"In Python 3.7 and earlier with the default event loop implementation, the " +"*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" +"در پایتون 3.7 و نسخه‌های پیش‌تر، با پیاده‌سازی پیش‌فرض حلقه رویداد، *delay* " +"نمی‌توانست بیشتر از یک روز باشد. این مشکل در پایتون 3.8 برطرف شده است." -msgid "Schedule *callback* to be called at the given absolute timestamp *when* (an int or a float), using the same time reference as :meth:`loop.time`." +msgid "" +"Schedule *callback* to be called at the given absolute timestamp *when* (an " +"int or a float), using the same time reference as :meth:`loop.time`." msgstr "" +"*callback* را زمان‌بندی کنید تا در برچسب زمانی مطلق داده‌شده *when* (یک int " +"یا float) فراخوانی شود، با استفاده از همان مرجع زمانی :meth:`loop.time`." msgid "This method's behavior is the same as :meth:`call_later`." -msgstr "" +msgstr "رفتار این متد همانند :meth:`call_later` است." -msgid "For performance, callbacks scheduled with :meth:`loop.call_at` may run up to one clock-resolution early (see ``time.get_clock_info('monotonic').resolution``)." +msgid "" +"For performance, callbacks scheduled with :meth:`loop.call_at` may run up to" +" one clock-resolution early (see " +"``time.get_clock_info('monotonic').resolution``)." msgstr "" +"برای کارایی، ممکن است کال‌بک‌های زمان‌بندی‌شده با :meth:`loop.call_at` تا یک" +" تفکیک‌پذیری ساعت زودتر اجرا شوند (به " +"``time.get_clock_info('monotonic').resolution`` مراجعه کنید)." -msgid "In Python 3.7 and earlier with the default event loop implementation, the difference between *when* and the current time could not exceed one day. This has been fixed in Python 3.8." +msgid "" +"In Python 3.7 and earlier with the default event loop implementation, the " +"difference between *when* and the current time could not exceed one day. " +"This has been fixed in Python 3.8." msgstr "" +"در پایتون 3.7 و نسخه‌های پیشین، در پیاده‌سازی پیش‌فرض حلقه رویداد، تفاوت " +"میان *when* و زمان جاری نمی‌توانست بیش از یک روز باشد. این مورد در پایتون " +"3.8 اصلاح شده است." -msgid "Return the current time, as a :class:`float` value, according to the event loop's internal monotonic clock." +msgid "" +"Return the current time, as a :class:`float` value, according to the event " +"loop's internal monotonic clock." msgstr "" +"زمان جاری را به‌عنوان یک مقدار :class:`float`، بر اساس ساعت یکنواخت داخلی " +"حلقه رویداد برمی‌گرداند." -msgid "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) should not exceed one day. This has been fixed in Python 3.8." +msgid "" +"In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " +"should not exceed one day. This has been fixed in Python 3.8." msgstr "" +"در پایتون 3.7 و نسخه‌های پیش از آن، مهلت‌های زمانی (*delay* نسبی یا *when* " +"مطلق) نباید از یک روز بیشتر باشند. این مورد در پایتون 3.8 اصلاح شده است." msgid "The :func:`asyncio.sleep` function." -msgstr "" +msgstr "تابع :func:`asyncio.sleep`." msgid "Creating futures and tasks" -msgstr "" +msgstr "ایجاد آینده‌نماها و وظایف" msgid "Create an :class:`asyncio.Future` object attached to the event loop." -msgstr "" +msgstr "یک شیء :class:`asyncio.Future` متصل به حلقه رویداد ایجاد کنید." -msgid "This is the preferred way to create Futures in asyncio. This lets third-party event loops provide alternative implementations of the Future object (with better performance or instrumentation)." +msgid "" +"This is the preferred way to create Futures in asyncio. This lets third-" +"party event loops provide alternative implementations of the Future object " +"(with better performance or instrumentation)." msgstr "" +"این، روش ارجح برای ایجاد Futures در asyncio است. این روش به حلقه‌های رویداد " +"شخص ثالث امکان می‌دهد پیاده‌سازی‌های جایگزینی از شیء Future را ارائه کنند " +"(با کارایی بهتر یا ابزاربندی (instrumentation))." -msgid "Schedule the execution of :ref:`coroutine ` *coro*. Return a :class:`Task` object." +msgid "" +"Schedule the execution of :ref:`coroutine ` *coro*. Return a " +":class:`Task` object." msgstr "" +"اجرای :ref:`هم‌روال ` *coro* را زمان‌بندی می‌کند. یک شیء " +":class:`Task` را برمی‌گرداند." -msgid "Third-party event loops can use their own subclass of :class:`Task` for interoperability. In this case, the result type is a subclass of :class:`Task`." +msgid "" +"Third-party event loops can use their own subclass of :class:`Task` for " +"interoperability. In this case, the result type is a subclass of " +":class:`Task`." msgstr "" +"حلقه‌های رویداد شخص ثالث می‌توانند برای تعامل‌پذیری از زیرکلاس اختصاصی خود " +"از :class:`Task` استفاده کنند. در این حالت، نوع نتیجه یک زیرکلاس از " +":class:`Task` است." -msgid "The full function signature is largely the same as that of the :class:`Task` constructor (or factory) - all of the keyword arguments to this function are passed through to that interface." +msgid "" +"The full function signature is largely the same as that of the :class:`Task`" +" constructor (or factory) - all of the keyword arguments to this function " +"are passed through to that interface." msgstr "" +"امضای کامل تابع تا حد زیادی مشابه امضای سازنده‌ی :class:`Task` (یا کارخانه) " +"است؛ تمام آرگومان‌های کلیدواژه‌ای این تابع به آن رابط منتقل می‌شوند." -msgid "If the *name* argument is provided and not ``None``, it is set as the name of the task using :meth:`Task.set_name`." +msgid "" +"If the *name* argument is provided and not ``None``, it is set as the name " +"of the task using :meth:`Task.set_name`." msgstr "" +"اگر آرگومان *name* ارائه شده باشد و ``None`` نباشد، به‌عنوان نام وظیفه " +" با استفاده از :meth:`Task.set_name` تنظیم می‌شود." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *coro* to run in. The current context copy is created when no *context* is provided." +msgid "" +"An optional keyword-only *context* argument allows specifying a custom " +":class:`contextvars.Context` for the *coro* to run in. The current context " +"copy is created when no *context* is provided." msgstr "" +"یک آرگومان *context* اختیاری و فقط کلیدواژه‌ای امکان تعیین یک " +":class:`contextvars.Context` سفارشی را فراهم می‌کند تا *coro* در آن اجرا " +"شود. در صورتی که *context* ارائه نشود، یک کپی از زمینه جاری ایجاد می‌شود." -msgid "An optional keyword-only *eager_start* argument allows specifying if the task should execute eagerly during the call to create_task, or be scheduled later. If *eager_start* is not passed the mode set by :meth:`loop.set_task_factory` will be used." +msgid "" +"An optional keyword-only *eager_start* argument allows specifying if the " +"task should execute eagerly during the call to create_task, or be scheduled " +"later. If *eager_start* is not passed the mode set by " +":meth:`loop.set_task_factory` will be used." msgstr "" +"یک آرگومان اختیاری فقط کلیدواژه‌ای *eager_start* به شما امکان می‌دهد مشخص " +"کنید که وظیفه باید در حین فراخوانی create_task بلافاصله اجرا شود یا بعداً " +"زمان‌بندی شود. اگر *eager_start* ارسال نشود، حالت تنظیم‌شده توسط " +":meth:`loop.set_task_factory` استفاده خواهد شد." msgid "Added the *name* parameter." -msgstr "" +msgstr "پارامتر *name* افزوده شد." msgid "Added the *context* parameter." -msgstr "" +msgstr "پارامتر *context* افزوده شد." -msgid "Added ``kwargs`` which passes on arbitrary extra parameters, including ``name`` and ``context``." +msgid "" +"Added ``kwargs`` which passes on arbitrary extra parameters, including " +"``name`` and ``context``." msgstr "" +"``kwargs`` افزوده شد که پارامترهای اضافی دلخواه، از جمله ``name`` و " +"``context`` را منتقل می‌کند." -msgid "Rolled back the change that passes on *name* and *context* (if it is None), while still passing on other arbitrary keyword arguments (to avoid breaking backwards compatibility with 3.13.3)." +msgid "" +"Rolled back the change that passes on *name* and *context* (if it is None), " +"while still passing on other arbitrary keyword arguments (to avoid breaking " +"backwards compatibility with 3.13.3)." msgstr "" +"تغییری که *name* و *context* را (اگر None باشد) منتقل می‌کرد، بازگردانده شد،" +" در حالی که همچنان سایر آرگومان‌های کلیدواژه‌ای دلخواه منتقل می‌شوند (برای " +"جلوگیری از از بین رفتن سازگاری با نسخه‌ی پیشین 3.13.3)." -msgid "All *kwargs* are now passed on. The *eager_start* parameter works with eager task factories." +msgid "" +"All *kwargs* are now passed on. The *eager_start* parameter works with eager" +" task factories." msgstr "" +"اکنون همه‌ی *kwargs* منتقل می‌شوند. پارامتر *eager_start* با کارخانه‌های " +"وظیفه‌ی مشتاق (eager task factories) کار می‌کند." msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" +"یک کارخانه‌ی وظیفه (task factory) تنظیم کنید که :meth:`loop.create_task` از " +"آن استفاده خواهد کرد." -msgid "If *factory* is ``None`` the default task factory will be set. Otherwise, *factory* must be a *callable* with the signature matching ``(loop, coro, **kwargs)``, where *loop* is a reference to the active event loop, and *coro* is a coroutine object. The callable must pass on all *kwargs*, and return a :class:`asyncio.Task`-compatible object." -msgstr "" +msgid "" +"If *factory* is ``None`` the default task factory will be set. Otherwise, " +"*factory* must be a *callable* with the signature matching ``(loop, coro, " +"**kwargs)``, where *loop* is a reference to the active event loop, and " +"*coro* is a coroutine object. The callable must pass on all *kwargs*, and " +"return a :class:`asyncio.Task`-compatible object." +msgstr "" +"اگر *factory* برابر ``None`` باشد، کارخانه وظیفه پیش‌فرض تنظیم خواهد شد. در " +"غیر این صورت، *factory* باید یک شیء *قابل فراخوانی* (callable) با امضایی " +"مطابق با ``(loop, coro, **kwargs)`` باشد، که در آن *loop* مرجعی به حلقه " +"رویداد فعال و *coro* یک شیء هم‌روال است. این شیء قابل فراخوانی باید تمام " +"*kwargs* را منتقل کند و شیءای سازگار با :class:`asyncio.Task` برگرداند." msgid "Required that all *kwargs* are passed on to :class:`asyncio.Task`." -msgstr "" +msgstr "لازم است که تمام *kwargs* به :class:`asyncio.Task` منتقل شوند." -msgid "*name* is no longer passed to task factories. *context* is no longer passed to task factories if it is ``None``." +msgid "" +"*name* is no longer passed to task factories. *context* is no longer passed " +"to task factories if it is ``None``." msgstr "" +"دیگر *name* به کارخانه‌های وظیفه (task factories) ارسال نمی‌شود. اگر *context*" +" برابر ``None`` باشد، دیگر به کارخانه‌های وظیفه (task factories) ارسال " +"نمی‌شود." -msgid "*name* and *context* are now unconditionally passed on to task factories again." +msgid "" +"*name* and *context* are now unconditionally passed on to task factories " +"again." msgstr "" +"*name* و *context* اکنون دوباره به‌صورت غیرشرطی به کارخانه‌های task پاس داده" +" می‌شوند." msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" +"یک کارخانه وظیفه (task factory) برمی‌گرداند، یا اگر از کارخانه پیش‌فرض " +"استفاده شود، ``None`` برمی‌گرداند." msgid "Opening network connections" -msgstr "" +msgstr "باز کردن اتصالات شبکه" -msgid "Open a streaming transport connection to a given address specified by *host* and *port*." -msgstr "" +msgid "" +"Open a streaming transport connection to a given address specified by *host*" +" and *port*." +msgstr "باز کردن یک اتصال انتقال جریانی به نشانی مشخص‌شده با *host* و *port*." -msgid "The socket family can be either :py:const:`~socket.AF_INET` or :py:const:`~socket.AF_INET6` depending on *host* (or the *family* argument, if provided)." +msgid "" +"The socket family can be either :py:const:`~socket.AF_INET` or " +":py:const:`~socket.AF_INET6` depending on *host* (or the *family* argument, " +"if provided)." msgstr "" +"خانواده سوکت می‌تواند، بسته به *host* (یا آرگومان *family*، در صورت ارائه)، " +"یا :py:const:`~socket.AF_INET` یا :py:const:`~socket.AF_INET6` باشد." msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." -msgstr "" +msgstr "نوع سوکت :py:const:`~socket.SOCK_STREAM` خواهد بود." -msgid "*protocol_factory* must be a callable returning an :ref:`asyncio protocol ` implementation." +msgid "" +"*protocol_factory* must be a callable returning an :ref:`asyncio protocol " +"` implementation." msgstr "" +"*protocol_factory* باید یک شیء قابل فراخوانی باشد که یک پیاده‌سازی از " +":ref:`پروتکل asyncio ` را برمی‌گرداند." -msgid "This method will try to establish the connection in the background. When successful, it returns a ``(transport, protocol)`` pair." +msgid "" +"This method will try to establish the connection in the background. When " +"successful, it returns a ``(transport, protocol)`` pair." msgstr "" +"این متد تلاش خواهد کرد اتصال را در پس‌زمینه برقرار کند. در صورت موفقیت، یک " +"جفت ``(transport, protocol)`` برمی‌گرداند." msgid "The chronological synopsis of the underlying operation is as follows:" -msgstr "" +msgstr "خلاصه‌ای از ترتیب زمانی عملیات زیربنایی به شرح زیر است:" -msgid "The connection is established and a :ref:`transport ` is created for it." +msgid "" +"The connection is established and a :ref:`transport ` is " +"created for it." msgstr "" +"اتصال برقرار می‌شود و یک :ref:`transport ` برای آن ایجاد " +"می‌شود." -msgid "*protocol_factory* is called without arguments and is expected to return a :ref:`protocol ` instance." +msgid "" +"*protocol_factory* is called without arguments and is expected to return a " +":ref:`protocol ` instance." msgstr "" +"*protocol_factory* بدون آرگومان فراخوانی می‌شود و انتظار می‌رود نمونه‌ای از " +":ref:`protocol ` را برگرداند." -msgid "The protocol instance is coupled with the transport by calling its :meth:`~BaseProtocol.connection_made` method." +msgid "" +"The protocol instance is coupled with the transport by calling its " +":meth:`~BaseProtocol.connection_made` method." msgstr "" +"نمونه‌ی پروتکل با فراخوانی متد :meth:`~BaseProtocol.connection_made` خود، به" +" انتقالمتصل می‌شود." msgid "A ``(transport, protocol)`` tuple is returned on success." -msgstr "" +msgstr "در صورت موفقیت، یک تاپل ``(transport, protocol)`` برگردانده می‌شود." -msgid "The created transport is an implementation-dependent bidirectional stream." +msgid "" +"The created transport is an implementation-dependent bidirectional stream." msgstr "" +"انتقالایجادشده، یک جریان دوطرفه وابسته به پیاده‌سازی است." msgid "Other arguments:" -msgstr "" +msgstr "آرگومان‌های دیگر:" -msgid "*ssl*: if given and not false, a SSL/TLS transport is created (by default a plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` object, this context is used to create the transport; if *ssl* is :const:`True`, a default context returned from :func:`ssl.create_default_context` is used." -msgstr "" +msgid "" +"*ssl*: if given and not false, a SSL/TLS transport is created (by default a " +"plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " +"object, this context is used to create the transport; if *ssl* is " +":const:`True`, a default context returned from " +":func:`ssl.create_default_context` is used." +msgstr "" +"*ssl*: اگر داده شده باشد و false نباشد، یک انتقال SSL/TLS ایجاد " +"می‌شود (به‌طور پیش‌فرض یک انتقال TCP ساده ایجاد می‌شود). اگر *ssl* یک شیء " +":class:`ssl.SSLContext` باشد، از این زمینه برای ایجاد انتقال استفاده می‌شود؛" +" اگر *ssl* :const:`True` باشد، از یک زمینه پیش‌فرض که از " +":func:`ssl.create_default_context` بازگشت داده می‌شود، استفاده می‌شود." msgid ":ref:`SSL/TLS security considerations `" -msgstr "" +msgstr ":ref:`ملاحظات امنیتی SSL/TLS `" -msgid "*server_hostname* sets or overrides the hostname that the target server's certificate will be matched against. Should only be passed if *ssl* is not ``None``. By default the value of the *host* argument is used. If *host* is empty, there is no default and you must pass a value for *server_hostname*. If *server_hostname* is an empty string, hostname matching is disabled (which is a serious security risk, allowing for potential man-in-the-middle attacks)." -msgstr "" +msgid "" +"*server_hostname* sets or overrides the hostname that the target server's " +"certificate will be matched against. Should only be passed if *ssl* is not " +"``None``. By default the value of the *host* argument is used. If *host* " +"is empty, there is no default and you must pass a value for " +"*server_hostname*. If *server_hostname* is an empty string, hostname " +"matching is disabled (which is a serious security risk, allowing for " +"potential man-in-the-middle attacks)." +msgstr "" +"*server_hostname* نام میزبانی را که گواهی سرور هدف با آن تطبیق داده " +"خواهد شد، تنظیم یا جایگزین می‌کند. این مقدار باید فقط در صورتی ارسال شود که " +"*ssl* برابر ``None`` نباشد. به‌طور پیش‌فرض، از مقدار آرگومان *host* استفاده " +"می‌شود. اگر *host* خالی باشد، مقدار پیش‌فرضی وجود ندارد و شما باید مقداری " +"برای *server_hostname* ارسال کنید. اگر *server_hostname* یک رشته خالی باشد، " +"تطبیق نام میزبان غیرفعال می‌شود (که یک خطر امنیتی جدی است و امکان حملات مرد " +"میانی بالقوه را فراهم می‌کند)." -msgid "*family*, *proto*, *flags* are the optional address family, protocol and flags to be passed through to getaddrinfo() for *host* resolution. If given, these should all be integers from the corresponding :mod:`socket` module constants." +msgid "" +"*family*, *proto*, *flags* are the optional address family, protocol and " +"flags to be passed through to getaddrinfo() for *host* resolution. If given," +" these should all be integers from the corresponding :mod:`socket` module " +"constants." msgstr "" +"*family*، *proto* و *flags* خانواده‌ی آدرس، پروتکل و پرچم‌های اختیاری هستند " +"که برای تفکیک *host* به getaddrinfo() ارسال می‌شوند. اگر داده شوند، همه‌ی " +"این‌ها باید اعداد صحیحی از ثابت‌های متناظر ماژول :mod:`socket` باشند." -msgid "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this connection. It should be a floating-point number representing the amount of time in seconds to wait for a connection attempt to complete, before starting the next attempt in parallel. This is the \"Connection Attempt Delay\" as defined in :rfc:`8305`. A sensible default value recommended by the RFC is ``0.25`` (250 milliseconds)." -msgstr "" +msgid "" +"*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " +"connection. It should be a floating-point number representing the amount of " +"time in seconds to wait for a connection attempt to complete, before " +"starting the next attempt in parallel. This is the \"Connection Attempt " +"Delay\" as defined in :rfc:`8305`. A sensible default value recommended by " +"the RFC is ``0.25`` (250 milliseconds)." +msgstr "" +"*happy_eyeballs_delay*، در صورت ارائه، Happy Eyeballs را برای این اتصال فعال" +" می‌کند. این باید یک عدد ممیز شناور باشد که مدت‌زمان به ثانیه برای انتظار " +"جهت کامل شدن یک تلاش برای اتصال، پیش از آغاز تلاش بعدی به‌صورت موازی را نشان" +" می‌دهد. این همان «Connection Attempt Delay» است که در :rfc:`8305` تعریف شده" +" است. مقدار پیش‌فرض معقولی که RFC توصیه کرده است، ``0.25`` (۲۵۰ میلی‌ثانیه) " +"است." -msgid "*interleave* controls address reordering when a host name resolves to multiple IP addresses. If ``0`` or unspecified, no reordering is done, and addresses are tried in the order returned by :meth:`getaddrinfo`. If a positive integer is specified, the addresses are interleaved by address family, and the given integer is interpreted as \"First Address Family Count\" as defined in :rfc:`8305`. The default is ``0`` if *happy_eyeballs_delay* is not specified, and ``1`` if it is." -msgstr "" +msgid "" +"*interleave* controls address reordering when a host name resolves to " +"multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " +"addresses are tried in the order returned by :meth:`getaddrinfo`. If a " +"positive integer is specified, the addresses are interleaved by address " +"family, and the given integer is interpreted as \"First Address Family " +"Count\" as defined in :rfc:`8305`. The default is ``0`` if " +"*happy_eyeballs_delay* is not specified, and ``1`` if it is." +msgstr "" +"*interleave* بازچینش نشانی‌ها را هنگامی که یک نام میزبان به چند نشانی IP حل " +"می‌شود، کنترل می‌کند. اگر ``0`` باشد یا مشخص‌نشده باشد، هیچ بازچینشی انجام " +"نمی‌شود و نشانی‌ها به همان ترتیبی که :meth:`getaddrinfo` آن‌ها را " +"برمی‌گرداند امتحان می‌شوند. اگر یک عدد صحیح مثبت مشخص شود، نشانی‌ها بر اساس " +"خانواده‌ی نشانی به‌صورت میان‌بافت (interleaved) چیده می‌شوند و عدد صحیح " +"داده‌شده به‌عنوان «تعداد اولین خانواده‌ی نشانی (First Address Family Count)»" +" تعریف‌شده در :rfc:`8305` تفسیر می‌شود. مقدار پیش‌فرض در صورتی که " +"*happy_eyeballs_delay* مشخص‌نشده باشد ``0`` و در صورتی که مشخص‌شده باشد " +"``1`` است." -msgid "*sock*, if given, should be an existing, already connected :class:`socket.socket` object to be used by the transport. If *sock* is given, none of *host*, *port*, *family*, *proto*, *flags*, *happy_eyeballs_delay*, *interleave* and *local_addr* should be specified." +msgid "" +"*sock*, if given, should be an existing, already connected " +":class:`socket.socket` object to be used by the transport. If *sock* is " +"given, none of *host*, *port*, *family*, *proto*, *flags*, " +"*happy_eyeballs_delay*, *interleave* and *local_addr* should be specified." msgstr "" +"*sock*، در صورت ارائه، باید یک شیء :class:`socket.socket` موجود و از پیش " +"متصل باشد تا توسط انتقالاستفاده شود. اگر *sock* ارائه شده باشد،" +" نباید هیچ‌کدام از *host*، *port*، *family*، *proto*، *flags*، " +"*happy_eyeballs_delay*، *interleave* و *local_addr* مشخص شوند." -msgid "The *sock* argument transfers ownership of the socket to the transport created. To close the socket, call the transport's :meth:`~asyncio.BaseTransport.close` method." +msgid "" +"The *sock* argument transfers ownership of the socket to the transport " +"created. To close the socket, call the transport's " +":meth:`~asyncio.BaseTransport.close` method." msgstr "" +"آرگومان *sock* مالکیت سوکت را به ترابریایجادشده منتقل می‌کند. " +"برای بستن سوکت، متد :meth:`~asyncio.BaseTransport.close` همان ترابری را " +"فراخوانی کنید." -msgid "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind the socket locally. The *local_host* and *local_port* are looked up using ``getaddrinfo()``, similarly to *host* and *port*." +msgid "" +"*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind" +" the socket locally. The *local_host* and *local_port* are looked up using " +"``getaddrinfo()``, similarly to *host* and *port*." msgstr "" +"*local_addr*، در صورت ارائه، یک تاپل ``(local_host, local_port)`` است که " +"برای مقید کردن سوکت به‌صورت محلی استفاده می‌شود. *local_host* و *local_port*" +" نیز مانند *host* و *port* با استفاده از ``getaddrinfo()`` جستجو می‌شوند." -msgid "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to wait for the TLS handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " +"wait for the TLS handshake to complete before aborting the connection. " +"``60.0`` seconds if ``None`` (default)." msgstr "" +"*ssl_handshake_timeout* (برای یک اتصال TLS) مدت‌زمانی به ثانیه است که باید " +"پیش از لغو اتصال، برای تکمیل دست‌دهی TLS (TLS handshake) منتظر ماند. در " +"صورت ``None`` بودن، ``60.0`` ثانیه است (پیش‌فرض)." -msgid "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown to complete before aborting the connection. ``30.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " +"to complete before aborting the connection. ``30.0`` seconds if ``None`` " +"(default)." msgstr "" +"*ssl_shutdown_timeout* زمان انتظار بر حسب ثانیه برای کامل شدن خاموشی SSL " +"(SSL shutdown) پیش از قطع اتصال است. اگر ``None`` (پیش‌فرض) باشد، ``30.0`` " +"ثانیه است." -msgid "*all_errors* determines what exceptions are raised when a connection cannot be created. By default, only a single ``Exception`` is raised: the first exception if there is only one or all errors have same message, or a single ``OSError`` with the error messages combined. When ``all_errors`` is ``True``, an ``ExceptionGroup`` will be raised containing all exceptions (even if there is only one)." -msgstr "" +msgid "" +"*all_errors* determines what exceptions are raised when a connection cannot " +"be created. By default, only a single ``Exception`` is raised: the first " +"exception if there is only one or all errors have same message, or a single " +"``OSError`` with the error messages combined. When ``all_errors`` is " +"``True``, an ``ExceptionGroup`` will be raised containing all exceptions " +"(even if there is only one)." +msgstr "" +"*all_errors* تعیین می‌کند که وقتی نمی‌توان یک اتصال ایجاد کرد، چه " +"استثناهایی پرتاب می‌شوند. به‌طور پیش‌فرض، فقط یک ``Exception`` واحد پرتاب " +"می‌شود: اولین استثنا اگر فقط یکی وجود داشته باشد یا همه‌ی خطاها پیام یکسانی " +"داشته باشند، یا یک ``OSError`` واحد با پیام‌های خطای ترکیب‌شده. وقتی " +"``all_errors`` برابر ``True`` باشد، یک ``ExceptionGroup`` پرتاب خواهد شد که " +"شامل همه‌ی استثناها می‌شود (حتی اگر فقط یکی وجود داشته باشد)." msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." -msgstr "" +msgstr "پشتیبانی از SSL/TLS در :class:`ProactorEventLoop` افزوده شد." -msgid "The socket option :ref:`socket.TCP_NODELAY ` is set by default for all TCP connections." +msgid "" +"The socket option :ref:`socket.TCP_NODELAY ` is set " +"by default for all TCP connections." msgstr "" +"گزینه‌ی سوکت :ref:`socket.TCP_NODELAY ` به‌طور پیش‌فرض" +" برای تمام اتصالات TCP تنظیم شده است." msgid "Added the *ssl_handshake_timeout* parameter." -msgstr "" +msgstr "پارامتر *ssl_handshake_timeout* اضافه شد." msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." -msgstr "" +msgstr "پارامترهای *happy_eyeballs_delay* و *interleave* افزوده شدند." -msgid "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's IPv4 path and protocol are working, but the server's IPv6 path and protocol are not working, a dual-stack client application experiences significant connection delay compared to an IPv4-only client. This is undesirable because it causes the dual-stack client to have a worse user experience. This document specifies requirements for algorithms that reduce this user-visible delay and provides an algorithm." -msgstr "" +msgid "" +"Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " +"IPv4 path and protocol are working, but the server's IPv6 path and protocol " +"are not working, a dual-stack client application experiences significant " +"connection delay compared to an IPv4-only client. This is undesirable " +"because it causes the dual-stack client to have a worse user experience. " +"This document specifies requirements for algorithms that reduce this user-" +"visible delay and provides an algorithm." +msgstr "" +"الگوریتم Happy Eyeballs: موفقیت با میزبان‌های دو پشته‌ای. هنگامی که مسیر و " +"پروتکل IPv4 یک سرور کار می‌کنند، اما مسیر و پروتکل IPv6 آن سرور کار " +"نمی‌کنند، یک برنامه کارخواه دو پشته‌ای در مقایسه با یک کارخواه فقط IPv4 با " +"تأخیر قابل‌توجهی در اتصال مواجه می‌شود. این وضعیت نامطلوب است، زیرا باعث " +"می‌شود کارخواه دو پشته‌ای تجربه کاربری بدتری داشته باشد. این سند الزامات " +"الگوریتم‌هایی را که این تأخیر قابل‌مشاهده برای کاربر را کاهش می‌دهند، مشخص " +"می‌کند و یک الگوریتم ارائه می‌دهد." msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" -msgstr "" +msgstr "برای اطلاعات بیشتر: https://datatracker.ietf.org/doc/html/rfc6555" msgid "Added the *ssl_shutdown_timeout* parameter." -msgstr "" +msgstr "پارامتر *ssl_shutdown_timeout* اضافه شد." msgid "*all_errors* was added." -msgstr "" +msgstr "*all_errors* افزوده شد." -msgid "The :func:`open_connection` function is a high-level alternative API. It returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be used directly in async/await code." +msgid "" +"The :func:`open_connection` function is a high-level alternative API. It " +"returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be" +" used directly in async/await code." msgstr "" +"تابع :func:`open_connection` یک API جایگزین سطح‌بالا است. این تابع یک جفت " +"(:class:`StreamReader`، :class:`StreamWriter`) را برمی‌گرداند که می‌توان " +"مستقیماً در کد async/await از آن‌ها استفاده کرد." msgid "Create a datagram connection." -msgstr "" +msgstr "یک اتصال دیتاگرام ایجاد کنید." -msgid "The socket family can be either :py:const:`~socket.AF_INET`, :py:const:`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or the *family* argument, if provided)." +msgid "" +"The socket family can be either :py:const:`~socket.AF_INET`, " +":py:const:`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on " +"*host* (or the *family* argument, if provided)." msgstr "" +"خانواده سوکت می‌تواند یکی از :py:const:`~socket.AF_INET`، " +":py:const:`~socket.AF_INET6` یا :py:const:`~socket.AF_UNIX` باشد، بسته به " +"*host* (یا آرگومان *family*، در صورت ارائه)." msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." -msgstr "" +msgstr "نوع سوکت برابر با :py:const:`~socket.SOCK_DGRAM` خواهد بود." -msgid "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." +msgid "" +"*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" +"*protocol_factory* باید یک شیء قابل فراخوانی باشد که یک پیاده‌سازی " +":ref:`پروتکل ` را برمی‌گرداند." msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" +"در صورت موفقیت، یک تاپل از ``(transport, protocol)`` برگردانده می‌شود." -msgid "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind the socket locally. The *local_host* and *local_port* are looked up using :meth:`getaddrinfo`." +msgid "" +"*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind" +" the socket locally. The *local_host* and *local_port* are looked up using " +":meth:`getaddrinfo`." msgstr "" +"*local_addr*، در صورت ارائه، یک تاپل ``(local_host, local_port)`` است که " +"برای پیوند دادن سوکت به‌صورت محلی استفاده می‌شود. *local_host* و " +"*local_port* با استفاده از :meth:`getaddrinfo` جستجو می‌شوند." -msgid "On Windows, when using the proactor event loop with ``local_addr=None``, an :exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it." +msgid "" +"On Windows, when using the proactor event loop with ``local_addr=None``, an " +":exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it." msgstr "" +"در ویندوز، هنگام استفاده از حلقه رویداد proactor با ``local_addr=None``، در " +"زمان اجرا یک :exc:`OSError` با :attr:`!errno.WSAEINVAL` پرتاب می‌شود." -msgid "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to connect the socket to a remote address. The *remote_host* and *remote_port* are looked up using :meth:`getaddrinfo`." +msgid "" +"*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " +"connect the socket to a remote address. The *remote_host* and *remote_port*" +" are looked up using :meth:`getaddrinfo`." msgstr "" +"*remote_addr*، در صورت ارائه، یک تاپلبه شکل ``(remote_host, " +"remote_port)`` است که برای اتصال سوکت به یک نشانی دوردست استفاده می‌شود. " +"*remote_host* و *remote_port* با استفاده از :meth:`getaddrinfo` جستجو " +"می‌شوند." -msgid "*family*, *proto*, *flags* are the optional address family, protocol and flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If given, these should all be integers from the corresponding :mod:`socket` module constants." +msgid "" +"*family*, *proto*, *flags* are the optional address family, protocol and " +"flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " +"given, these should all be integers from the corresponding :mod:`socket` " +"module constants." msgstr "" +"*family*، *proto* و *flags* خانواده‌ی نشانی، پروتکل و پرچم‌های اختیاری هستند " +"که باید برای وضوح *host* به :meth:`getaddrinfo` ارسال شوند. در صورت ارائه، " +"همه‌ی این موارد باید اعداد صحیحی از ثابت‌های متناظر ماژول :mod:`socket` " +"باشند." -msgid "*reuse_port* tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows and some Unixes. If the :ref:`socket.SO_REUSEPORT ` constant is not defined then this capability is unsupported." -msgstr "" +msgid "" +"*reuse_port* tells the kernel to allow this endpoint to be bound to the same" +" port as other existing endpoints are bound to, so long as they all set this" +" flag when being created. This option is not supported on Windows and some " +"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " +"is not defined then this capability is unsupported." +msgstr "" +"*reuse_port* به هسته می‌گوید که اجازه دهد این پایانه به همان پورتی متصل شود " +"که سایر پایانه‌های موجود به آن متصل هستند، مشروط بر اینکه همه‌ی آن‌ها این " +"پرچم را هنگام ایجاد تنظیم کنند. این گزینه در ویندوز و برخی یونیکس‌ها " +"پشتیبانی نمی‌شود. اگر ثابت :ref:`socket.SO_REUSEPORT ` تعریف نشده باشد، این قابلیت پشتیبانی نمی‌شود." -msgid "*allow_broadcast* tells the kernel to allow this endpoint to send messages to the broadcast address." +msgid "" +"*allow_broadcast* tells the kernel to allow this endpoint to send messages " +"to the broadcast address." msgstr "" +"*allow_broadcast* به هسته می‌گوید که به این پایانه اجازه دهد پیام‌ها را به " +"نشانی پخش (broadcast address) ارسال کند." -msgid "*sock* can optionally be specified in order to use a preexisting, already connected, :class:`socket.socket` object to be used by the transport. If specified, *local_addr* and *remote_addr* should be omitted (must be :const:`None`)." +msgid "" +"*sock* can optionally be specified in order to use a preexisting, already " +"connected, :class:`socket.socket` object to be used by the transport. If " +"specified, *local_addr* and *remote_addr* should be omitted (must be " +":const:`None`)." msgstr "" +"*sock* می‌تواند به‌صورت اختیاری مشخص شود تا از یک شیء :class:`socket.socket`" +" از پیش موجود و متصل‌شده توسط انتقالاستفاده شود. در صورت مشخص " +"شدن، *local_addr* و *remote_addr* باید حذف شوند (باید :const:`None` باشند)." -msgid "See :ref:`UDP echo client protocol ` and :ref:`UDP echo server protocol ` examples." +msgid "" +"See :ref:`UDP echo client protocol ` and " +":ref:`UDP echo server protocol ` examples." msgstr "" +"مثال‌های :ref:`پروتکل کلاینت اکو UDP ` و " +":ref:`پروتکل سرور اکو UDP ` را ببینید." -msgid "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, *allow_broadcast*, and *sock* parameters were added." +msgid "" +"The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " +"*allow_broadcast*, and *sock* parameters were added." msgstr "" +"پارامترهای *family*، *proto*، *flags*، *reuse_address*، *reuse_port*، " +"*allow_broadcast* و *sock* افزوده شده‌اند." msgid "Added support for Windows." -msgstr "" +msgstr "پشتیبانی از ویندوز اضافه شد." -msgid "The *reuse_address* parameter is no longer supported, as using :ref:`socket.SO_REUSEADDR ` poses a significant security concern for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." +msgid "" +"The *reuse_address* parameter is no longer supported, as using " +":ref:`socket.SO_REUSEADDR ` poses a significant " +"security concern for UDP. Explicitly passing ``reuse_address=True`` will " +"raise an exception." msgstr "" +"پارامتر *reuse_address* دیگر پشتیبانی نمی‌شود، زیرا استفاده از " +":ref:`socket.SO_REUSEADDR ` یک نگرانی امنیتی جدی برای" +" UDP به همراه دارد. ارسال صریح ``reuse_address=True`` منجر به پرتاب استثنا " +"خواهد شد." -msgid "When multiple processes with differing UIDs assign sockets to an identical UDP socket address with ``SO_REUSEADDR``, incoming packets can become randomly distributed among the sockets." +msgid "" +"When multiple processes with differing UIDs assign sockets to an identical " +"UDP socket address with ``SO_REUSEADDR``, incoming packets can become " +"randomly distributed among the sockets." msgstr "" +"وقتی چندین فرایند با UIDهای متفاوت، با ``SO_REUSEADDR`` سوکت‌ها را به یک " +"آدرس سوکت UDP یکسان اختصاص می‌دهند، بسته‌های ورودی ممکن است به‌صورت تصادفی " +"بین سوکت‌ها توزیع شوند." -msgid "For supported platforms, *reuse_port* can be used as a replacement for similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with differing UIDs from assigning sockets to the same socket address." +msgid "" +"For supported platforms, *reuse_port* can be used as a replacement for " +"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with" +" differing UIDs from assigning sockets to the same socket address." msgstr "" +"در پلتفرم‌های پشتیبانی‌شده، می‌توان از *reuse_port* به‌عنوان جایگزینی برای " +"عملکرد مشابه استفاده کرد. با *reuse_port*، به‌جای آن از " +":ref:`socket.SO_REUSEPORT ` استفاده می‌شود، که به‌طور" +" مشخص از اختصاص دادن سوکت‌ها به یک آدرس سوکت یکسان توسط فرآیندهایی با " +"UIDهای متفاوت جلوگیری می‌کند." -msgid "The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and 3.6.10, has been entirely removed." +msgid "" +"The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " +"3.6.10, has been entirely removed." msgstr "" +"پارامتر *reuse_address* که از پایتون 3.8.1، 3.7.6 و 3.6.10 غیرفعال شده بود، " +"به‌طور کامل حذف شده است." msgid "Create a Unix connection." -msgstr "" +msgstr "ایجاد یک اتصال Unix." -msgid "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :py:const:`~socket.SOCK_STREAM`." +msgid "" +"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be " +":py:const:`~socket.SOCK_STREAM`." msgstr "" +"خانواده سوکت :py:const:`~socket.AF_UNIX` خواهد بود؛ نوع سوکت " +":py:const:`~socket.SOCK_STREAM` خواهد بود." -msgid "*path* is the name of a Unix domain socket and is required, unless a *sock* parameter is specified. Abstract Unix sockets, :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths are supported." +msgid "" +"*path* is the name of a Unix domain socket and is required, unless a *sock* " +"parameter is specified. Abstract Unix sockets, :class:`str`, " +":class:`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" +"*path* نام یک سوکت دامنه‌ی یونیکس است و الزامی است، مگر اینکه پارامتر *sock*" +" مشخص شده باشد. از سوکت‌های انتزاعی یونیکس و مسیرهای :class:`str`، " +":class:`bytes` و :class:`~pathlib.Path` پشتیبانی می‌شود." -msgid "See the documentation of the :meth:`loop.create_connection` method for information about arguments to this method." +msgid "" +"See the documentation of the :meth:`loop.create_connection` method for " +"information about arguments to this method." msgstr "" +"برای اطلاعات درباره آرگومان‌های این متد، مستندات متد " +":meth:`loop.create_connection` را ببینید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be a :term:`path-like object`." +msgid "" +"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be" +" a :term:`path-like object`." msgstr "" +"پارامتر *ssl_handshake_timeout* اضافه شد. پارامتر *path* اکنون می‌تواند یک " +":term:`path-like object` باشد." msgid "Creating network servers" -msgstr "" +msgstr "ایجاد کارسازهای شبکه" -msgid "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on *port* of the *host* address." +msgid "" +"Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " +"*port* of the *host* address." msgstr "" +"یک سرور TCP (نوع سوکت :const:`~socket.SOCK_STREAM`) ایجاد کنید که روی *port*" +" از آدرس *host* گوش می‌دهد." msgid "Returns a :class:`Server` object." -msgstr "" +msgstr "یک شیء :class:`Server` برمی‌گرداند." msgid "Arguments:" -msgstr "" +msgstr "آرگومان‌ها:" -msgid "The *host* parameter can be set to several types which determine where the server would be listening:" +msgid "" +"The *host* parameter can be set to several types which determine where the " +"server would be listening:" msgstr "" +"پارامتر *host* را می‌توان روی چندین نوع تنظیم کرد که تعیین می‌کنند سرور در " +"کجا گوش می‌دهد:" -msgid "If *host* is a string, the TCP server is bound to a single network interface specified by *host*." +msgid "" +"If *host* is a string, the TCP server is bound to a single network interface" +" specified by *host*." msgstr "" +"اگر *host* یک رشته باشد، سرور TCP به یک رابط شبکه واحد که توسط *host* مشخص " +"شده است، مقید می‌شود." -msgid "If *host* is a sequence of strings, the TCP server is bound to all network interfaces specified by the sequence." +msgid "" +"If *host* is a sequence of strings, the TCP server is bound to all network " +"interfaces specified by the sequence." msgstr "" +"اگر *host* دنباله‌ای از رشته‌ها باشد، سرور TCP به همه رابط‌های شبکه مشخص‌شده" +" توسط آن دنباله مقید می‌شود." -msgid "If *host* is an empty string or ``None``, all interfaces are assumed and a list of multiple sockets will be returned (most likely one for IPv4 and another one for IPv6)." +msgid "" +"If *host* is an empty string or ``None``, all interfaces are assumed and a " +"list of multiple sockets will be returned (most likely one for IPv4 and " +"another one for IPv6)." msgstr "" +"اگر *host* یک رشته خالی یا ``None`` باشد، همه رابط‌ها در نظر گرفته می‌شوند و" +" فهرستی از چندین سوکت برگردانده می‌شود (به احتمال زیاد یکی برای IPv4 و دیگری" +" برای IPv6)." -msgid "The *port* parameter can be set to specify which port the server should listen on. If ``0`` or ``None`` (the default), a random unused port will be selected (note that if *host* resolves to multiple network interfaces, a different random port will be selected for each interface)." +msgid "" +"The *port* parameter can be set to specify which port the server should " +"listen on. If ``0`` or ``None`` (the default), a random unused port will be " +"selected (note that if *host* resolves to multiple network interfaces, a " +"different random port will be selected for each interface)." msgstr "" +"می‌توان پارامتر *port* را برای مشخص کردن پورتی که سرور باید روی آن گوش دهد " +"تنظیم کرد. اگر ``0`` یا ``None`` (پیش‌فرض) باشد، یک پورت تصادفی استفاده‌نشده" +" انتخاب خواهد شد (توجه داشته باشید که اگر *host* به چند رابط شبکه تفکیک شود،" +" برای هر رابط یک پورت تصادفی متفاوت انتخاب خواهد شد)." -msgid "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." +msgid "" +"*family* can be set to either :const:`socket.AF_INET` or " +":const:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not " +"set, the *family* will be determined from host name (defaults to " +":const:`~socket.AF_UNSPEC`)." msgstr "" +"*family* می‌تواند روی :const:`socket.AF_INET` یا :const:`~socket.AF_INET6` " +"تنظیم شود تا سوکت را وادار به استفاده از IPv4 یا IPv6 کند. اگر تنظیم نشود، " +"*family* بر اساس نام میزبان تعیین می‌شود (پیش‌فرض :const:`~socket.AF_UNSPEC`" +" است)." msgid "*flags* is a bitmask for :meth:`getaddrinfo`." -msgstr "" +msgstr "*flags* یک نقاب بیتی (bitmask) برای :meth:`getaddrinfo` است." -msgid "*sock* can optionally be specified in order to use a preexisting socket object. If specified, *host* and *port* must not be specified." +msgid "" +"*sock* can optionally be specified in order to use a preexisting socket " +"object. If specified, *host* and *port* must not be specified." msgstr "" +"*sock* را می‌توان به‌صورت اختیاری برای استفاده از یک شیء سوکت از پیش موجود " +"تعیین کرد. اگر تعیین شود، *host* و *port* نباید تعیین شوند." -msgid "The *sock* argument transfers ownership of the socket to the server created. To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgid "" +"The *sock* argument transfers ownership of the socket to the server created." +" To close the socket, call the server's :meth:`~asyncio.Server.close` " +"method." msgstr "" +"آرگومان *sock* مالکیت سوکت را به سرور ایجادشده منتقل می‌کند. برای بستن " +"سوکت، متد :meth:`~asyncio.Server.close` سرور را فراخوانی کنید." -msgid "*backlog* is the maximum number of queued connections passed to :meth:`~socket.socket.listen` (defaults to 100)." +msgid "" +"*backlog* is the maximum number of queued connections passed to " +":meth:`~socket.socket.listen` (defaults to 100)." msgstr "" +"*backlog* حداکثر تعداد اتصال‌های در صف است که به " +":meth:`~socket.socket.listen` داده می‌شود (پیش‌فرض ۱۰۰ است)." -msgid "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over the accepted connections." +msgid "" +"*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " +"the accepted connections." msgstr "" +"*ssl* را می‌توان به یک نمونه از :class:`~ssl.SSLContext` تنظیم کرد تا TLS " +"روی اتصال‌های پذیرفته‌شده فعال شود." -msgid "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` state, without waiting for its natural timeout to expire. If not specified will automatically be set to ``True`` on Unix." +msgid "" +"*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " +"state, without waiting for its natural timeout to expire. If not specified " +"will automatically be set to ``True`` on Unix." msgstr "" +"*reuse_address* به هسته می‌گوید که از یک سوکت محلی در وضعیت ``TIME_WAIT`` " +"دوباره استفاده کند، بدون این‌که منتظر پایان مهلت زمانی طبیعی آن بماند. اگر " +"تعیین‌نشده باشد، در Unix به‌طور خودکار روی ``True`` تنظیم خواهد شد." -msgid "*reuse_port* tells the kernel to allow this endpoint to be bound to the same port as other existing endpoints are bound to, so long as they all set this flag when being created. This option is not supported on Windows." +msgid "" +"*reuse_port* tells the kernel to allow this endpoint to be bound to the same" +" port as other existing endpoints are bound to, so long as they all set this" +" flag when being created. This option is not supported on Windows." msgstr "" +"*reuse_port* به هسته می‌گوید که اجازه دهد این پایانه به همان پورتی که سایر " +"پایانه‌های موجود به آن مقید شده‌اند، مقید شود، مشروط بر اینکه همه‌ی آن‌ها نیز" +" این پرچم را هنگام ایجاد تنظیم کرده باشند. این گزینه در ویندوز پشتیبانی " +"نمی‌شود." -msgid "*keep_alive* set to ``True`` keeps connections active by enabling the periodic transmission of messages." +msgid "" +"*keep_alive* set to ``True`` keeps connections active by enabling the " +"periodic transmission of messages." msgstr "" +"با تنظیم *keep_alive* روی ``True``، اتصال‌ها با فعال‌سازی ارسال دوره‌ای " +"پیام‌ها فعال نگه داشته می‌شوند." msgid "Added the *keep_alive* parameter." -msgstr "" +msgstr "پارامتر *keep_alive* اضافه شد." -msgid "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait for the TLS handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " +"for the TLS handshake to complete before aborting the connection. ``60.0`` " +"seconds if ``None`` (default)." msgstr "" +"*ssl_handshake_timeout* (برای یک سرور TLS) مدت‌زمان انتظار به ثانیه برای " +"کامل‌شدن دست‌دهی TLS پیش از قطع اتصال است. اگر ``None`` (پیش‌فرض) باشد، " +"``60.0`` ثانیه است." -msgid "*start_serving* set to ``True`` (the default) causes the created server to start accepting connections immediately. When set to ``False``, the user should await on :meth:`Server.start_serving` or :meth:`Server.serve_forever` to make the server to start accepting connections." +msgid "" +"*start_serving* set to ``True`` (the default) causes the created server to " +"start accepting connections immediately. When set to ``False``, the user " +"should await on :meth:`Server.start_serving` or :meth:`Server.serve_forever`" +" to make the server to start accepting connections." msgstr "" +"تنظیم *start_serving* روی ``True`` (پیش‌فرض) باعث می‌شود سرور ایجادشده " +"بلافاصله پذیرش اتصال‌ها را آغاز کند. هنگامی که روی ``False`` تنظیم شود، " +"کاربر باید :meth:`Server.start_serving` یا :meth:`Server.serve_forever` را " +"await کند تا سرور پذیرش اتصال‌ها را آغاز کند." msgid "The *host* parameter can be a sequence of strings." -msgstr "" +msgstr "پارامتر *host* می‌تواند دنباله‌ای از رشته‌ها باشد." -msgid "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket option :ref:`socket.TCP_NODELAY ` is set by default for all TCP connections." +msgid "" +"Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " +"option :ref:`socket.TCP_NODELAY ` is set by default " +"for all TCP connections." msgstr "" +"پارامترهای *ssl_handshake_timeout* و *start_serving* افزوده شدند. گزینه‌ی " +"سوکت :ref:`socket.TCP_NODELAY ` به‌طور پیش‌فرض برای " +"تمام اتصالات TCP تنظیم می‌شود." -msgid "The :func:`start_server` function is a higher-level alternative API that returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can be used in an async/await code." +msgid "" +"The :func:`start_server` function is a higher-level alternative API that " +"returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " +"be used in an async/await code." msgstr "" +"تابع :func:`start_server` یک API جایگزین سطح بالاتر است که یک جفت " +":class:`StreamReader` و :class:`StreamWriter` را برمی‌گرداند و می‌توان از " +"آن‌ها در کد ناهمگام/await استفاده کرد." -msgid "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket.AF_UNIX` socket family." +msgid "" +"Similar to :meth:`loop.create_server` but works with the " +":py:const:`~socket.AF_UNIX` socket family." msgstr "" +"مشابه :meth:`loop.create_server` است اما با خانواده‌ی سوکت " +":py:const:`~socket.AF_UNIX` کار می‌کند." -msgid "*path* is the name of a Unix domain socket, and is required, unless a *sock* argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths are supported." +msgid "" +"*path* is the name of a Unix domain socket, and is required, unless a *sock*" +" argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`," +" and :class:`~pathlib.Path` paths are supported." msgstr "" +"*path* نام یک سوکت دامنه Unix است و لازم است، مگر اینکه آرگومان *sock* ارائه" +" شده باشد. سوکت‌های انتزاعی Unix، مسیرهای :class:`str`، :class:`bytes` و " +":class:`~pathlib.Path` پشتیبانی می‌شوند." -msgid "If *cleanup_socket* is true then the Unix socket will automatically be removed from the filesystem when the server is closed, unless the socket has been replaced after the server has been created." +msgid "" +"If *cleanup_socket* is true then the Unix socket will automatically be " +"removed from the filesystem when the server is closed, unless the socket has" +" been replaced after the server has been created." msgstr "" +"اگر *cleanup_socket* درست باشد، سوکت یونیکس به‌صورت خودکار هنگام بسته شدن " +"سرور از فایل‌سیستم حذف می‌شود، مگر اینکه سوکت پس از ایجاد سرور جایگزین شده " +"باشد." -msgid "See the documentation of the :meth:`loop.create_server` method for information about arguments to this method." +msgid "" +"See the documentation of the :meth:`loop.create_server` method for " +"information about arguments to this method." msgstr "" +"برای اطلاعات درباره آرگومان‌های این متد، مستندات متد " +":meth:`loop.create_server` را ببینید." -msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* parameter can now be a :class:`~pathlib.Path` object." +msgid "" +"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path*" +" parameter can now be a :class:`~pathlib.Path` object." msgstr "" +"پارامترهای *ssl_handshake_timeout* و *start_serving* افزوده شدند. پارامتر " +"*path* اکنون می‌تواند یک شیء :class:`~pathlib.Path` باشد." msgid "Added the *cleanup_socket* parameter." -msgstr "" +msgstr "پارامتر *cleanup_socket* افزوده شد." msgid "Wrap an already accepted connection into a transport/protocol pair." -msgstr "" +msgstr "یک اتصال از پیش پذیرفته‌شده را در یک جفت انتقال/پروتکل قرار دهید." -msgid "This method can be used by servers that accept connections outside of asyncio but that use asyncio to handle them." +msgid "" +"This method can be used by servers that accept connections outside of " +"asyncio but that use asyncio to handle them." msgstr "" +"این متد برای سرورهایی قابل استفاده است که اتصال‌ها را خارج از asyncio " +"می‌پذیرند، اما برای مدیریت آن‌ها از asyncio استفاده می‌کنند." msgid "Parameters:" -msgstr "" +msgstr "پارامترها:" -msgid "*sock* is a preexisting socket object returned from :meth:`socket.accept `." +msgid "" +"*sock* is a preexisting socket object returned from :meth:`socket.accept " +"`." msgstr "" +"*sock* یک شیء سوکت از پیش موجود است که از :meth:`socket.accept " +"` برگردانده‌شده است." -msgid "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the accepted connections." +msgid "" +"*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " +"accepted connections." msgstr "" +"*ssl* را می‌توان به یک :class:`~ssl.SSLContext` تنظیم کرد تا SSL روی اتصالات" +" پذیرفته‌شده فعال شود." -msgid "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to wait for the SSL handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " +"wait for the SSL handshake to complete before aborting the connection. " +"``60.0`` seconds if ``None`` (default)." msgstr "" +"*ssl_handshake_timeout* (برای یک اتصال SSL) زمان انتظار به ثانیه برای تکمیل " +"دست‌دهی SSL (SSL handshake) پیش از قطع اتصال است. اگر ``None`` باشد " +"(پیش‌فرض)، ``60.0`` ثانیه است." msgid "Returns a ``(transport, protocol)`` pair." -msgstr "" +msgstr "یک جفت ``(transport, protocol)`` برمی‌گرداند." msgid "Transferring files" -msgstr "" +msgstr "انتقال فایل‌ها" -msgid "Send a *file* over a *transport*. Return the total number of bytes sent." +msgid "" +"Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" +"یک *فایل* را بر بستر یک *انتقال* ارسال می‌کند. تعداد کل بایت‌های" +" ارسال‌شده را برمی‌گرداند." msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" +"این متد در صورت موجود بودن، از :meth:`os.sendfile` با کارایی بالا استفاده " +"می‌کند." msgid "*file* must be a regular file object opened in binary mode." -msgstr "" +msgstr "*file* باید یک شیء فایل معمولی باشد که در حالت دودویی باز شده باشد." -msgid "*offset* tells from where to start reading the file. If specified, *count* is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is always updated, even when this method raises an error, and :meth:`file.tell() ` can be used to obtain the actual number of bytes sent." -msgstr "" +msgid "" +"*offset* tells from where to start reading the file. If specified, *count* " +"is the total number of bytes to transmit as opposed to sending the file " +"until EOF is reached. File position is always updated, even when this method" +" raises an error, and :meth:`file.tell() ` can be used to " +"obtain the actual number of bytes sent." +msgstr "" +"*offset* مشخص می‌کند که خواندن فایل از کجا آغاز شود. اگر مشخص شود، *count* " +"تعداد کل بایت‌هایی است که باید ارسال شوند، به‌جای ارسال فایل تا رسیدن به " +"EOF. موقعیت فایل همواره به‌روزرسانی می‌شود، حتی هنگامی که این متد خطایی را " +"پرتاب می‌کند، و می‌توان از :meth:`file.tell() ` برای به دست " +"آوردن تعداد واقعی بایت‌های ارسال‌شده استفاده کرد." -msgid "*fallback* set to ``True`` makes asyncio to manually read and send the file when the platform does not support the sendfile system call (e.g. Windows or SSL socket on Unix)." +msgid "" +"*fallback* set to ``True`` makes asyncio to manually read and send the file " +"when the platform does not support the sendfile system call (e.g. Windows or" +" SSL socket on Unix)." msgstr "" +"تنظیم *fallback* روی ``True`` باعث می‌شود asyncio زمانی که پلتفرم از " +"فراخوانی سیستمی sendfile پشتیبانی نمی‌کند (مثلاً Windows یا سوکت SSL در " +"Unix)، فایل را به‌صورت دستی بخواند و ارسال کند." -msgid "Raise :exc:`SendfileNotAvailableError` if the system does not support the *sendfile* syscall and *fallback* is ``False``." +msgid "" +"Raise :exc:`SendfileNotAvailableError` if the system does not support the " +"*sendfile* syscall and *fallback* is ``False``." msgstr "" +"اگر سیستم از فراخوانی سیستمی *sendfile* پشتیبانی نکند و *fallback* برابر " +"``False`` باشد، :exc:`SendfileNotAvailableError` پرتاب می‌شود." msgid "TLS upgrade" -msgstr "" +msgstr "ارتقاء TLS" msgid "Upgrade an existing transport-based connection to TLS." -msgstr "" +msgstr "یک اتصال مبتنی بر ترابری موجود را به TLS ارتقا دهید." -msgid "Create a TLS coder/decoder instance and insert it between the *transport* and the *protocol*. The coder/decoder implements both *transport*-facing protocol and *protocol*-facing transport." +msgid "" +"Create a TLS coder/decoder instance and insert it between the *transport* " +"and the *protocol*. The coder/decoder implements both *transport*-facing " +"protocol and *protocol*-facing transport." msgstr "" +"یک نمونه از کدگذار/کدگشای TLS ایجاد کنید و آن را میان *انتقال* و *پروتکل* " +"قرار دهید. کدگذار/کدگشا هم پروتکل مواجه با *انتقال* و هم انتقال مواجه با " +"*پروتکل* را پیاده‌سازی می‌کند." -msgid "Return the created two-interface instance. After *await*, the *protocol* must stop using the original *transport* and communicate with the returned object only because the coder caches *protocol*-side data and sporadically exchanges extra TLS session packets with *transport*." +msgid "" +"Return the created two-interface instance. After *await*, the *protocol* " +"must stop using the original *transport* and communicate with the returned " +"object only because the coder caches *protocol*-side data and sporadically " +"exchanges extra TLS session packets with *transport*." msgstr "" +"نمونه‌ی دو-رابطی ایجادشده را برمی‌گرداند. پس از *await*، *protocol* باید " +"استفاده از *transport* اصلی را متوقف کند و فقط با شیء برگردانده‌شده ارتباط " +"برقرار کند، زیرا کدکننده داده‌های سمت *protocol* را در نهانگاه ذخیره می‌کند " +"و به‌صورت پراکنده بسته‌های اضافی نشست TLS را با *transport* مبادله می‌کند." -msgid "In some situations (e.g. when the passed transport is already closing) this may return ``None``." +msgid "" +"In some situations (e.g. when the passed transport is already closing) this " +"may return ``None``." msgstr "" +"در برخی شرایط (مثلاً وقتی انتقالارسال‌شده از قبل در حال " +"بسته‌شدن است) ممکن است این ``None`` را برگرداند." -msgid "*transport* and *protocol* instances that methods like :meth:`~loop.create_server` and :meth:`~loop.create_connection` return." +msgid "" +"*transport* and *protocol* instances that methods like " +":meth:`~loop.create_server` and :meth:`~loop.create_connection` return." msgstr "" +"نمونه‌های *transport* و *protocol* که متدهایی مانند " +":meth:`~loop.create_server` و :meth:`~loop.create_connection` برمی‌گردانند." msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." -msgstr "" +msgstr "*sslcontext*: یک نمونه پیکربندی‌شده از :class:`~ssl.SSLContext`." -msgid "*server_side* pass ``True`` when a server-side connection is being upgraded (like the one created by :meth:`~loop.create_server`)." +msgid "" +"*server_side* pass ``True`` when a server-side connection is being upgraded " +"(like the one created by :meth:`~loop.create_server`)." msgstr "" +"*server_side* هنگامی که یک اتصال سمت سرور در حال ارتقا است، ``True`` را " +"ارسال کنید (مانند اتصالی که توسط :meth:`~loop.create_server` ایجاد می‌شود)." -msgid "*server_hostname*: sets or overrides the host name that the target server's certificate will be matched against." +msgid "" +"*server_hostname*: sets or overrides the host name that the target server's " +"certificate will be matched against." msgstr "" +"*server_hostname*: نام میزبانی را که گواهی سرور هدف با آن تطبیق داده خواهد " +"شد، تنظیم یا بازنویسی می‌کند." msgid "Watching file descriptors" -msgstr "" +msgstr "پایش توصیف‌گرهای فایل" -msgid "Start monitoring the *fd* file descriptor for read availability and invoke *callback* with the specified arguments once *fd* is available for reading." +msgid "" +"Start monitoring the *fd* file descriptor for read availability and invoke " +"*callback* with the specified arguments once *fd* is available for reading." msgstr "" +"پایش توصیف‌گر فایل *fd* را برای دسترس‌پذیری جهت خواندن آغاز کنید و هنگامی " +"که *fd* برای خواندن در دسترس شد، *callback* را با آرگومان‌های مشخص‌شده " +"فراخوانی کنید." -msgid "Any preexisting callback registered for *fd* is cancelled and replaced by *callback*." +msgid "" +"Any preexisting callback registered for *fd* is cancelled and replaced by " +"*callback*." msgstr "" +"هر کال‌بک از پیش ثبت‌شده برای *fd* لغو می‌شود و با *callback* جایگزین " +"می‌شود." -msgid "Stop monitoring the *fd* file descriptor for read availability. Returns ``True`` if *fd* was previously being monitored for reads." +msgid "" +"Stop monitoring the *fd* file descriptor for read availability. Returns " +"``True`` if *fd* was previously being monitored for reads." msgstr "" +"پایش توصیف‌گر فایل *fd* را برای دسترس‌پذیری جهت خواندن متوقف می‌کند. اگر " +"*fd* پیش‌تر برای خواندن پایش می‌شد، ``True`` برمی‌گرداند." -msgid "Start monitoring the *fd* file descriptor for write availability and invoke *callback* with the specified arguments *args* once *fd* is available for writing." +msgid "" +"Start monitoring the *fd* file descriptor for write availability and invoke " +"*callback* with the specified arguments *args* once *fd* is available for " +"writing." msgstr "" +"پایش توصیف‌گر فایل *fd* را برای دسترس‌پذیری جهت نوشتن آغاز کنید و هرگاه " +"*fd* برای نوشتن در دسترس بود، *callback* را با آرگومان‌های مشخص‌شده *args* " +"فراخوانی کنید." -msgid "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." +msgid "" +"Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" +"برای :ref:`ارسال آرگومان‌های کلیدواژه‌ای ` به " +"*کال‌بک* از :func:`functools.partial` استفاده کنید." -msgid "Stop monitoring the *fd* file descriptor for write availability. Returns ``True`` if *fd* was previously being monitored for writes." +msgid "" +"Stop monitoring the *fd* file descriptor for write availability. Returns " +"``True`` if *fd* was previously being monitored for writes." msgstr "" +"پایش توصیف‌گر فایل *fd* را از نظر دسترس‌پذیری برای نوشتن متوقف می‌کند. اگر" +" *fd* پیش‌تر برای نوشتن پایش می‌شد، ``True`` را برمی‌گرداند." -msgid "See also :ref:`Platform Support ` section for some limitations of these methods." +msgid "" +"See also :ref:`Platform Support ` section for some" +" limitations of these methods." msgstr "" +"همچنین برای برخی محدودیت‌های این متدها، بخش :ref:`Platform Support ` را ببینید." msgid "Working with socket objects directly" -msgstr "" +msgstr "کار مستقیم با اشیای سوکت" -msgid "In general, protocol implementations that use transport-based APIs such as :meth:`loop.create_connection` and :meth:`loop.create_server` are faster than implementations that work with sockets directly. However, there are some use cases when performance is not critical, and working with :class:`~socket.socket` objects directly is more convenient." -msgstr "" +msgid "" +"In general, protocol implementations that use transport-based APIs such as " +":meth:`loop.create_connection` and :meth:`loop.create_server` are faster " +"than implementations that work with sockets directly. However, there are " +"some use cases when performance is not critical, and working with " +":class:`~socket.socket` objects directly is more convenient." +msgstr "" +"به‌طور کلی، پیاده‌سازی‌های پروتکلی که از APIهای مبتنی بر انتقال مانند " +":meth:`loop.create_connection` و :meth:`loop.create_server` استفاده می‌کنند،" +" سریع‌تر از پیاده‌سازی‌هایی هستند که به‌طور مستقیم با سوکت‌ها کار می‌کنند. " +"با این حال، برخی موارد استفاده وجود دارند که در آن‌ها عملکرد اهمیت حیاتی " +"ندارد و کار مستقیم با اشیای :class:`~socket.socket` راحت‌تر است." -msgid "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket.recv() `." +msgid "" +"Receive up to *nbytes* from *sock*. Asynchronous version of " +":meth:`socket.recv() `." msgstr "" +"حداکثر *nbytes* را از *sock* دریافت می‌کند. نسخه ناهمگام " +":meth:`socket.recv() ` است." msgid "Return the received data as a bytes object." -msgstr "" +msgstr "داده‌های دریافت‌شده را به‌عنوان یک شیء bytes برگردانید." msgid "*sock* must be a non-blocking socket." -msgstr "" +msgstr "*sock* باید سوکتی غیرمسدود باشد." -msgid "Even though this method was always documented as a coroutine method, releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this is an ``async def`` method." +msgid "" +"Even though this method was always documented as a coroutine method, " +"releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this" +" is an ``async def`` method." msgstr "" +"اگرچه این متد همیشه به‌عنوان یک متد هم‌روال مستند شده بود، نسخه‌های پیش از " +"پایتون 3.7 یک :class:`Future` برمی‌گرداندند. از پایتون 3.7، این یک متد " +"``async def`` است." -msgid "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :meth:`socket.recv_into() ` method." +msgid "" +"Receive data from *sock* into the *buf* buffer. Modeled after the blocking " +":meth:`socket.recv_into() ` method." msgstr "" +"داده‌ها را از *sock* به بافر *buf* دریافت می‌کند. بر اساس متد مسدودکننده‌ی " +":meth:`socket.recv_into() ` طراحی شده است." msgid "Return the number of bytes written to the buffer." -msgstr "" +msgstr "تعداد بایت‌های نوشته‌شده در بافر را برمی‌گرداند." -msgid "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :meth:`socket.recvfrom() `." +msgid "" +"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of " +":meth:`socket.recvfrom() `." msgstr "" +"یک دیتاگرام با حداکثر اندازه‌ی *bufsize* را از *sock* دریافت کنید. نسخه‌ی " +"ناهمگام از :meth:`socket.recvfrom() `." msgid "Return a tuple of (received data, remote address)." -msgstr "" +msgstr "تاپلی از (داده دریافتی، نشانی دوردست) برمی‌گرداند." -msgid "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous version of :meth:`socket.recvfrom_into() `." +msgid "" +"Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " +"version of :meth:`socket.recvfrom_into() `." msgstr "" +"یک دیتاگرام تا حداکثر *nbytes* را از *sock* در *buf* دریافت کنید. نسخه‌ی " +"ناهمگام :meth:`socket.recvfrom_into() ` است." msgid "Return a tuple of (number of bytes received, remote address)." -msgstr "" +msgstr "یک تاپل شامل (تعداد بایت‌های دریافت‌شده، نشانی دوردست) برمی‌گرداند." -msgid "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket.sendall() `." +msgid "" +"Send *data* to the *sock* socket. Asynchronous version of " +":meth:`socket.sendall() `." msgstr "" +"*data* را به سوکت *sock* ارسال می‌کند. نسخه‌ی ناهمگام :meth:`socket.sendall()" +" `." -msgid "This method continues to send to the socket until either all data in *data* has been sent or an error occurs. ``None`` is returned on success. On error, an exception is raised. Additionally, there is no way to determine how much data, if any, was successfully processed by the receiving end of the connection." -msgstr "" +msgid "" +"This method continues to send to the socket until either all data in *data* " +"has been sent or an error occurs. ``None`` is returned on success. On " +"error, an exception is raised. Additionally, there is no way to determine " +"how much data, if any, was successfully processed by the receiving end of " +"the connection." +msgstr "" +"این متد ارسال به سوکت را تا زمانی ادامه می‌دهد که یا تمام داده‌های موجود در " +"*data* ارسال شده باشد یا خطایی رخ دهد. در صورت موفقیت، ``None`` برگردانده " +"می‌شود. در صورت بروز خطا، یک استثنا پرتاب می‌شود. علاوه بر این، راهی برای " +"تعیین اینکه چه مقدار داده، در صورت وجود، در سمت دریابندهی اتصال با " +"موفقیت پردازش شده است، وجود ندارد." -msgid "Even though the method was always documented as a coroutine method, before Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an ``async def`` method." +msgid "" +"Even though the method was always documented as a coroutine method, before " +"Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " +"``async def`` method." msgstr "" +"با وجود اینکه این متد همیشه به‌عنوان یک متد هم‌روال مستند شده بود، پیش از " +"پایتون 3.7 یک :class:`Future` را برمی‌گرداند. از پایتون 3.7، این یک متد " +"``async def`` است." -msgid "Send a datagram from *sock* to *address*. Asynchronous version of :meth:`socket.sendto() `." +msgid "" +"Send a datagram from *sock* to *address*. Asynchronous version of " +":meth:`socket.sendto() `." msgstr "" +"یک دیتاگرام را از *sock* به *address* ارسال می‌کند. نسخه‌ی ناهمگام " +":meth:`socket.sendto() `." msgid "Return the number of bytes sent." -msgstr "" +msgstr "تعداد بایت‌های ارسال‌شده را برمی‌گرداند." msgid "Connect *sock* to a remote socket at *address*." -msgstr "" +msgstr "*sock* را به یک سوکت راه دور در *address* متصل می‌کند." -msgid "Asynchronous version of :meth:`socket.connect() `." -msgstr "" +msgid "" +"Asynchronous version of :meth:`socket.connect() `." +msgstr "نسخه‌ی ناهمگام :meth:`socket.connect() `." -msgid "With :class:`SelectorEventLoop`, *address* does not need to be resolved: for :const:`~socket.AF_INET` and :const:`~socket.AF_INET6` sockets, ``sock_connect`` first checks whether *address* is already resolved by calling :func:`socket.inet_pton`, and uses :meth:`loop.getaddrinfo` to resolve it if it is not." -msgstr "" +msgid "" +"With :class:`SelectorEventLoop`, *address* does not need to be resolved: for" +" :const:`~socket.AF_INET` and :const:`~socket.AF_INET6` sockets, " +"``sock_connect`` first checks whether *address* is already resolved by " +"calling :func:`socket.inet_pton`, and uses :meth:`loop.getaddrinfo` to " +"resolve it if it is not." +msgstr "" +"در :class:`SelectorEventLoop`، نیازی نیست *address* ترجمه (resolve) شود: " +"برای سوکت‌های :const:`~socket.AF_INET` و :const:`~socket.AF_INET6`، " +"``sock_connect`` ابتدا با فراخوانی :func:`socket.inet_pton` بررسی می‌کند که " +"آیا *address* از پیش ترجمه‌شده است یا خیر، و اگر ترجمه‌شده نباشد، برای " +"ترجمه‌ی آن از :meth:`loop.getaddrinfo` استفاده می‌کند." -msgid ":class:`ProactorEventLoop`, the default event loop on Windows, does not resolve *address*. The host must already be a numeric IP address; passing a host name raises :exc:`OSError`. Resolve the address with :meth:`loop.getaddrinfo` first, or use :meth:`loop.create_connection`, which resolves the address on every platform." -msgstr "" +msgid "" +":class:`ProactorEventLoop`, the default event loop on Windows, does not " +"resolve *address*. The host must already be a numeric IP address; passing a" +" host name raises :exc:`OSError`. Resolve the address with " +":meth:`loop.getaddrinfo` first, or use :meth:`loop.create_connection`, which" +" resolves the address on every platform." +msgstr "" +":class:`ProactorEventLoop`، حلقه رویداد پیش‌فرض در ویندوز، *نشانی* را حل " +"نمی‌کند. میزبان باید از پیش یک نشانی IP عددی باشد؛ ارسال نام میزبان باعث " +"پرتاب :exc:`OSError` می‌شود. ابتدا نشانی را با :meth:`loop.getaddrinfo` حل " +"کنید، یا از :meth:`loop.create_connection` استفاده کنید، که نشانی را در همه " +"پلتفرم‌ها حل می‌کند." -msgid "With :class:`SelectorEventLoop`, ``address`` no longer needs to be resolved." +msgid "" +"With :class:`SelectorEventLoop`, ``address`` no longer needs to be resolved." msgstr "" +"با :class:`SelectorEventLoop`، دیگر نیازی به تعیین (resolve) ``address`` " +"نیست." -msgid ":meth:`loop.create_connection` and :func:`asyncio.open_connection() `." +msgid "" +":meth:`loop.create_connection` and :func:`asyncio.open_connection() " +"`." msgstr "" +":meth:`loop.create_connection` و :func:`asyncio.open_connection() " +"`." -msgid "Accept a connection. Modeled after the blocking :meth:`socket.accept() ` method." +msgid "" +"Accept a connection. Modeled after the blocking :meth:`socket.accept() " +"` method." msgstr "" +"یک اتصال را می‌پذیرد. بر اساس متد مسدودکننده‌ی :meth:`socket.accept() " +"` مدل‌سازی شده است." -msgid "The socket must be bound to an address and listening for connections. The return value is a pair ``(conn, address)`` where *conn* is a *new* socket object usable to send and receive data on the connection, and *address* is the address bound to the socket on the other end of the connection." +msgid "" +"The socket must be bound to an address and listening for connections. The " +"return value is a pair ``(conn, address)`` where *conn* is a *new* socket " +"object usable to send and receive data on the connection, and *address* is " +"the address bound to the socket on the other end of the connection." msgstr "" +"سوکت باید به یک نشانی مقید شده باشد و در حال گوش دادن به اتصال‌ها باشد. " +"مقدار بازگشتی یک جفت ``(conn, address)`` است که در آن *conn* یک شیء سوکت " +"*جدید* قابل استفاده برای ارسال و دریافت داده روی اتصال است، و *address* " +"نشانی است که به سوکت در طرف دیگر اتصال مقید شده است." msgid ":meth:`loop.create_server` and :func:`start_server`." -msgstr "" +msgstr ":meth:`loop.create_server` و :func:`start_server`." -msgid "Send a file using high-performance :mod:`os.sendfile` if possible. Return the total number of bytes sent." +msgid "" +"Send a file using high-performance :mod:`os.sendfile` if possible. Return " +"the total number of bytes sent." msgstr "" +"در صورت امکان، یک فایل را با استفاده از :mod:`os.sendfile` با کارایی بالا " +"ارسال می‌کند. تعداد کل بایت‌های ارسال‌شده را برمی‌گرداند." -msgid "Asynchronous version of :meth:`socket.sendfile() `." -msgstr "" +msgid "" +"Asynchronous version of :meth:`socket.sendfile() `." +msgstr "نسخه‌ی ناهمگام از :meth:`socket.sendfile() `." -msgid "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket.socket`." +msgid "" +"*sock* must be a non-blocking :const:`socket.SOCK_STREAM` " +":class:`~socket.socket`." msgstr "" +"*sock* باید یک :class:`~socket.socket` غیرمسدود از نوع " +":const:`socket.SOCK_STREAM` باشد." msgid "*file* must be a regular file object open in binary mode." -msgstr "" +msgstr "*file* باید یک شیء فایل معمولی باشد که در حالت دودویی باز شده است." -msgid "*fallback*, when set to ``True``, makes asyncio manually read and send the file when the platform does not support the sendfile syscall (e.g. Windows or SSL socket on Unix)." +msgid "" +"*fallback*, when set to ``True``, makes asyncio manually read and send the " +"file when the platform does not support the sendfile syscall (e.g. Windows " +"or SSL socket on Unix)." msgstr "" +"*fallback*، وقتی روی ``True`` تنظیم شود، باعث می‌شود asyncio زمانی که سکو از" +" فراخوانی سیستمی sendfile پشتیبانی نمی‌کند (مثلاً Windows یا سوکت SSL در " +"Unix)، فایل را به‌صورت دستی بخواند و ارسال کند." -msgid "Raise :exc:`SendfileNotAvailableError` if the system does not support *sendfile* syscall and *fallback* is ``False``." +msgid "" +"Raise :exc:`SendfileNotAvailableError` if the system does not support " +"*sendfile* syscall and *fallback* is ``False``." msgstr "" +"اگر سیستم از فراخوانی سیستمی *sendfile* پشتیبانی نکند و *fallback* برابر " +"``False`` باشد، :exc:`SendfileNotAvailableError` پرتاب می‌شود." msgid "DNS" -msgstr "" +msgstr "DNS" msgid "Asynchronous version of :meth:`socket.getaddrinfo`." -msgstr "" +msgstr "نسخه‌ی ناهمگام :meth:`socket.getaddrinfo`." msgid "Asynchronous version of :meth:`socket.getnameinfo`." -msgstr "" +msgstr "نسخه‌ی ناهمگام :meth:`socket.getnameinfo`." -msgid "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous versions through the loop's default thread pool executor. When this executor is saturated, these methods may experience delays, which higher-level networking libraries may report as increased timeouts. To mitigate this, consider using a custom executor for other user tasks, or setting a default executor with a larger number of workers." -msgstr "" +msgid "" +"Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " +"versions through the loop's default thread pool executor. When this executor" +" is saturated, these methods may experience delays, which higher-level " +"networking libraries may report as increased timeouts. To mitigate this, " +"consider using a custom executor for other user tasks, or setting a default " +"executor with a larger number of workers." +msgstr "" +"هر دو *getaddrinfo* و *getnameinfo* به‌صورت داخلی از نسخه‌های همگام خود از " +"طریق اجراکننده‌ی استخر نخ پیش‌فرض حلقه (thread pool executor) استفاده " +"می‌کنند. هنگامی که این اجراکننده اشباع شود، این متدها ممکن است با تأخیر " +"مواجه شوند؛ کتابخانه‌های شبکه‌ای سطح بالاتر ممکن است این تأخیرها را به‌صورت " +"افزایش مهلت زمانی گزارش کنند. برای کاهش این مشکل، استفاده از یک اجراکننده‌ی " +"سفارشی برای سایر وظایف کاربر، یا تنظیم یک اجراکننده‌ی پیش‌فرض با تعداد " +"بیشتری کارگر را در نظر بگیرید." -msgid "Both *getaddrinfo* and *getnameinfo* methods were always documented to return a coroutine, but prior to Python 3.7 they were, in fact, returning :class:`asyncio.Future` objects. Starting with Python 3.7 both methods are coroutines." +msgid "" +"Both *getaddrinfo* and *getnameinfo* methods were always documented to " +"return a coroutine, but prior to Python 3.7 they were, in fact, returning " +":class:`asyncio.Future` objects. Starting with Python 3.7 both methods are " +"coroutines." msgstr "" +"در مستندات همواره آمده بود که هر دو متد *getaddrinfo* و *getnameinfo* یک " +"هم‌روال برمی‌گردانند، اما پیش از Python 3.7، آن‌ها در واقع اشیای " +":class:`asyncio.Future` را برمی‌گرداندند. از Python 3.7 به بعد، هر دو متد " +"هم‌روال هستند." msgid "Working with pipes" -msgstr "" +msgstr "کار با پایپ‌ها" msgid "Register the read end of *pipe* in the event loop." -msgstr "" +msgstr "انتهای خواندن *pipe* را در حلقه رویداد ثبت کنید." -msgid "*pipe* is a :term:`file-like object `. See :ref:`Supported pipe objects ` for the objects supported as *pipe*." +msgid "" +"*pipe* is a :term:`file-like object `. See :ref:`Supported " +"pipe objects ` for the objects supported as *pipe*." msgstr "" +"*pipe* یک :term:`شیء فایل‌مانند ` است. برای مشاهده‌ی اشیاء " +"پشتیبانی‌شده به‌عنوان *pipe*، :ref:`اشیای pipe پشتیبانی‌شده ` را ببینید." -msgid "Return pair ``(transport, protocol)``, where *transport* supports the :class:`ReadTransport` interface and *protocol* is an object instantiated by the *protocol_factory*." +msgid "" +"Return pair ``(transport, protocol)``, where *transport* supports the " +":class:`ReadTransport` interface and *protocol* is an object instantiated by" +" the *protocol_factory*." msgstr "" +"یک جفت ``(transport, protocol)`` را برمی‌گرداند، که در آن *transport* از " +"رابط :class:`ReadTransport` پشتیبانی می‌کند و *protocol* شیءای است که " +"*protocol_factory* آن را نمونه‌سازی کرده است." -msgid "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-blocking mode." +msgid "" +"With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" +"blocking mode." msgstr "" +"در حلقه رویداد :class:`SelectorEventLoop`، *پایپ* به حالت " +"غیرمسدودکننده تنظیم می‌شود." msgid "Register the write end of *pipe* in the event loop." -msgstr "" +msgstr "انتهای نوشتن *pipe* را در حلقه رویداد ثبت کنید." -msgid "Return pair ``(transport, protocol)``, where *transport* supports :class:`WriteTransport` interface and *protocol* is an object instantiated by the *protocol_factory*." +msgid "" +"Return pair ``(transport, protocol)``, where *transport* supports " +":class:`WriteTransport` interface and *protocol* is an object instantiated " +"by the *protocol_factory*." msgstr "" +"یک جفت ``(transport, protocol)`` را برمی‌گرداند، که در آن *transport* از " +"رابط :class:`WriteTransport` پشتیبانی می‌کند و *protocol* یک شیء " +"نمونه‌سازی‌شده توسط *protocol_factory* است." msgid "Supported pipe objects" -msgstr "" +msgstr "اشیای pipe پشتیبانی‌شده" -msgid "These methods only work with objects the operating system can poll for readiness or perform overlapped I/O on. Regular files on disk are **not** supported on any platform. There is no asynchronous file I/O in asyncio; use :meth:`loop.run_in_executor` to read and write regular files without blocking the event loop." -msgstr "" +msgid "" +"These methods only work with objects the operating system can poll for " +"readiness or perform overlapped I/O on. Regular files on disk are **not** " +"supported on any platform. There is no asynchronous file I/O in asyncio; " +"use :meth:`loop.run_in_executor` to read and write regular files without " +"blocking the event loop." +msgstr "" +"این متدها فقط با اشیایی کار می‌کنند که سیستم‌عامل بتواند آمادگی آن‌ها را " +"پایش کند یا روی آن‌ها ورودی/خروجی همپوشانی‌شده (overlapped I/O) انجام " +"دهد. از فایل‌های معمولی روی دیسک در هیچ پلتفرمی پشتیبانی **نمی‌شود**. هیچ " +"ورودی/خروجی ناهمگام فایلی در asyncio وجود ندارد؛ برای خواندن و نوشتن " +"فایل‌های معمولی بدون مسدود کردن حلقه رویداد، از :meth:`loop.run_in_executor`" +" استفاده کنید." -msgid "On Unix, with :class:`SelectorEventLoop`, *pipe* must wrap one of the following:" +msgid "" +"On Unix, with :class:`SelectorEventLoop`, *pipe* must wrap one of the " +"following:" msgstr "" +"در یونیکس، با :class:`SelectorEventLoop`، *pipe* باید پوششی برای یکی از " +"موارد زیر باشد:" -msgid "a pipe, such as an end of an :func:`os.pipe` pair or a FIFO created with :func:`os.mkfifo`;" +msgid "" +"a pipe, such as an end of an :func:`os.pipe` pair or a FIFO created with " +":func:`os.mkfifo`;" msgstr "" +"یک پایپ ، مانند یکی از سرهای یک جفت :func:`os.pipe` یا یک FIFO " +"ایجادشده با :func:`os.mkfifo`؛" msgid "a socket;" -msgstr "" +msgstr "یک سوکت؛" msgid "a character device, such as a terminal." -msgstr "" +msgstr "یک دستگاه نویسه‌ای، مانند یک پایانه." -msgid "On Windows, where only :class:`ProactorEventLoop` implements these methods, *pipe* must wrap a handle opened for overlapped I/O (that is, created with the ``FILE_FLAG_OVERLAPPED`` flag), since the handle has to be associated with an I/O completion port. Handles that were not opened for overlapped I/O are rejected. In particular, the standard streams (:data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`), console handles, and the pipes created by :func:`os.pipe` are **not** opened for overlapped I/O and therefore cannot be used with these methods." -msgstr "" +msgid "" +"On Windows, where only :class:`ProactorEventLoop` implements these methods, " +"*pipe* must wrap a handle opened for overlapped I/O (that is, created with " +"the ``FILE_FLAG_OVERLAPPED`` flag), since the handle has to be associated " +"with an I/O completion port. Handles that were not opened for overlapped " +"I/O are rejected. In particular, the standard streams (:data:`sys.stdin`, " +":data:`sys.stdout` and :data:`sys.stderr`), console handles, and the pipes " +"created by :func:`os.pipe` are **not** opened for overlapped I/O and " +"therefore cannot be used with these methods." +msgstr "" +"در ویندوز، که تنها :class:`ProactorEventLoop` این متدها را پیاده‌سازی " +"می‌کند، *pipe* باید یک دسته (handle) را که برای I/O همپوشانی‌شده (overlapped" +" I/O) باز شده است (یعنی با پرچم ``FILE_FLAG_OVERLAPPED`` ایجاد شده است)، " +"دربرگیرد، زیرا دسته باید به یک پورت تکمیل I/O (I/O completion port) مرتبط " +"باشد. دسته‌هایی که برای I/O همپوشانی‌شده باز نشده‌اند، رد می‌شوند. به‌ویژه، " +"جریان‌های استاندارد (:data:`sys.stdin`، :data:`sys.stdout` و " +":data:`sys.stderr`)، دسته‌های کنسول و پایپ‌های ایجادشده توسط :func:`os.pipe`" +" برای I/O همپوشانی‌شده باز **نشده‌اند** و بنابراین نمی‌توان از آن‌ها با این " +"متدها استفاده کرد." -msgid ":class:`SelectorEventLoop` does not support the above methods on Windows. Use :class:`ProactorEventLoop` instead for Windows." +msgid "" +":class:`SelectorEventLoop` does not support the above methods on Windows. " +"Use :class:`ProactorEventLoop` instead for Windows." msgstr "" +":class:`SelectorEventLoop` از متدهای بالا در ویندوز پشتیبانی نمی‌کند. در " +"ویندوز، به‌جای آن از :class:`ProactorEventLoop` استفاده کنید." -msgid "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." -msgstr "" +msgid "" +"The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." +msgstr "متدهای :meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell`." msgid "Unix signals" -msgstr "" +msgstr "سیگنال‌های یونیکس" -msgid "Set *callback* as the handler for the *signum* signal, passing *args* as positional arguments." +msgid "" +"Set *callback* as the handler for the *signum* signal, passing *args* as " +"positional arguments." msgstr "" +"*callback* را به‌عنوان مدیر سیگنال *signum* تنظیم کنید و *args* را به‌عنوان " +"آرگومان‌های جایگاهی ارسال کنید." -msgid "The callback will be invoked by *loop*, along with other queued callbacks and runnable coroutines of that event loop. Unlike signal handlers registered using :func:`signal.signal`, a callback registered with this function is allowed to interact with the event loop." +msgid "" +"The callback will be invoked by *loop*, along with other queued callbacks " +"and runnable coroutines of that event loop. Unlike signal handlers " +"registered using :func:`signal.signal`, a callback registered with this " +"function is allowed to interact with the event loop." msgstr "" +"کال‌بک توسط *loop*، همراه با سایر کال‌بک‌های در صف و هم‌روال‌های قابل اجرا " +"در آن حلقه رویداد، فراخوانی می‌شود. برخلاف هندلرهای سیگنال ثبت‌شده با" +" استفاده از :func:`signal.signal`، کال‌بک ثبت‌شده با این تابع مجاز است با " +"حلقه رویداد تعامل داشته باشد." -msgid "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. Raise :exc:`RuntimeError` if there is a problem setting up the handler." +msgid "" +"Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " +"Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" +"اگر شماره سیگنال نامعتبر یا غیرقابل‌دریافت باشد، :exc:`ValueError` پرتاب " +"می‌شود. اگر در راه‌اندازی مدیر (handler) مشکلی وجود داشته باشد، " +":exc:`RuntimeError` پرتاب می‌شود." -msgid "Like :func:`signal.signal`, this function must be invoked in the main thread." -msgstr "" +msgid "" +"Like :func:`signal.signal`, this function must be invoked in the main " +"thread." +msgstr "مانند :func:`signal.signal`، این تابع باید در نخ اصلی فراخوانی شود." msgid "Remove the handler for the *sig* signal." -msgstr "" +msgstr "مدیر سیگنال *sig* را حذف کنید." -msgid "Return ``True`` if the signal handler was removed, or ``False`` if no handler was set for the given signal." +msgid "" +"Return ``True`` if the signal handler was removed, or ``False`` if no " +"handler was set for the given signal." msgstr "" +"اگر هندلر سیگنال حذف شده باشد، ``True`` را برمی‌گرداند، یا اگر برای " +"سیگنال داده‌شده هیچ هندلرای تنظیم نشده باشد، ``False`` را " +"برمی‌گرداند." msgid "The :mod:`signal` module." -msgstr "" +msgstr "ماژول :mod:`signal`." msgid "Executing code in thread or process pools" -msgstr "" +msgstr "اجرای کد در استخرهای نخ یا فرایند" -msgid "Arrange for *func* to be called in the specified executor passing *args* as positional arguments." +msgid "" +"Arrange for *func* to be called in the specified executor passing *args* as " +"positional arguments." msgstr "" +"ترتیبی دهید که *func* در اجراکننده‌ی مشخص‌شده (executor) با ارسال *args* " +"به‌عنوان آرگومان‌های جایگاهی فراخوانی شود." -msgid "The *executor* argument should be an :class:`concurrent.futures.Executor` instance. The default executor is used if *executor* is ``None``. The default executor can be set by :meth:`loop.set_default_executor`, otherwise, a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized and used by :func:`run_in_executor` if needed." -msgstr "" +msgid "" +"The *executor* argument should be an :class:`concurrent.futures.Executor` " +"instance. The default executor is used if *executor* is ``None``. The " +"default executor can be set by :meth:`loop.set_default_executor`, otherwise," +" a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized " +"and used by :func:`run_in_executor` if needed." +msgstr "" +"آرگومان *executor* باید نمونه‌ای از :class:`concurrent.futures.Executor` " +"باشد. اگر *executor* برابر ``None`` باشد، از اجراکننده پیش‌فرض استفاده " +"می‌شود. اجراکننده پیش‌فرض را می‌توان با :meth:`loop.set_default_executor` " +"تنظیم کرد؛ در غیر این صورت، یک " +":class:`concurrent.futures.ThreadPoolExecutor` به‌صورت تنبل مقداردهی اولیه " +"می‌شود و :func:`run_in_executor` در صورت نیاز از آن استفاده می‌کند." msgid "" "import asyncio\n" @@ -937,258 +2018,558 @@ msgid "" "if __name__ == '__main__':\n" " asyncio.run(main())" msgstr "" +"import asyncio\n" +"import concurrent.futures\n" +"\n" +"def blocking_io():\n" +" # File operations (such as logging) can block the\n" +" # event loop: run them in a thread pool.\n" +" with open('/dev/urandom', 'rb') as f:\n" +" return f.read(100)\n" +"\n" +"def cpu_bound():\n" +" # CPU-bound operations will block the event loop:\n" +" # in general it is preferable to run them in a\n" +" # process pool.\n" +" return sum(i * i for i in range(10 ** 7))\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" ## Options:\n" +"\n" +" # 1. Run in the default loop's executor:\n" +" result = await loop.run_in_executor(\n" +" None, blocking_io)\n" +" print('default thread pool', result)\n" +"\n" +" # 2. Run in a custom thread pool:\n" +" with concurrent.futures.ThreadPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, blocking_io)\n" +" print('custom thread pool', result)\n" +"\n" +" # 3. Run in a custom process pool:\n" +" with concurrent.futures.ProcessPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom process pool', result)\n" +"\n" +" # 4. Run in a custom interpreter pool:\n" +" with concurrent.futures.InterpreterPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom interpreter pool', result)\n" +"\n" +"if __name__ == '__main__':\n" +" asyncio.run(main())" -msgid "Note that the entry point guard (``if __name__ == '__main__'``) is required for option 3 due to the peculiarities of :mod:`multiprocessing`, which is used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe importing of main module `." +msgid "" +"Note that the entry point guard (``if __name__ == '__main__'``) is required " +"for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " +"used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " +"importing of main module `." msgstr "" +"توجه داشته باشید که نگهبان نقطه ورود (``if __name__ == '__main__'``) به دلیل " +"ویژگی‌های خاص :mod:`multiprocessing`، که توسط " +":class:`~concurrent.futures.ProcessPoolExecutor` استفاده می‌شود، برای گزینه‌ی" +" ۳ لازم است. :ref:`ایمپورت امن ماژول اصلی ` را ببینید." msgid "This method returns a :class:`asyncio.Future` object." -msgstr "" +msgstr "این متد یک شیء :class:`asyncio.Future` را برمی‌گرداند." -msgid "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." +msgid "" +"Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" +"برای :ref:`فرستادن آرگومان‌های کلیدواژه‌ای ` به " +"*func* از :func:`functools.partial` استفاده کنید." -msgid ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the thread pool executor it creates, instead leaving it up to the thread pool executor (:class:`~concurrent.futures.ThreadPoolExecutor`) to set the default." +msgid "" +":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the" +" thread pool executor it creates, instead leaving it up to the thread pool " +"executor (:class:`~concurrent.futures.ThreadPoolExecutor`) to set the " +"default." msgstr "" +":meth:`loop.run_in_executor` دیگر ``max_workers`` اجراکننده‌ی استخر نخی را " +"که ایجاد می‌کند، پیکربندی نمی‌کند، بلکه تعیین مقدار پیش‌فرض را به خود " +"اجراکننده‌ی استخر نخ (:class:`~concurrent.futures.ThreadPoolExecutor`) " +"واگذار می‌کند." -msgid "Set *executor* as the default executor used by :meth:`run_in_executor`. *executor* must be an instance of :class:`~concurrent.futures.ThreadPoolExecutor`, which includes :class:`~concurrent.futures.InterpreterPoolExecutor`." +msgid "" +"Set *executor* as the default executor used by :meth:`run_in_executor`. " +"*executor* must be an instance of " +":class:`~concurrent.futures.ThreadPoolExecutor`, which includes " +":class:`~concurrent.futures.InterpreterPoolExecutor`." msgstr "" +"*executor* را به‌عنوان اجراکننده پیش‌فرضی که توسط :meth:`run_in_executor` " +"استفاده می‌شود، تنظیم کنید. *executor* باید نمونه‌ای از " +":class:`~concurrent.futures.ThreadPoolExecutor` باشد، که " +":class:`~concurrent.futures.InterpreterPoolExecutor` را نیز شامل می‌شود." -msgid "*executor* must be an instance of :class:`~concurrent.futures.ThreadPoolExecutor`." +msgid "" +"*executor* must be an instance of " +":class:`~concurrent.futures.ThreadPoolExecutor`." msgstr "" +"*executor* باید نمونه‌ای از :class:`~concurrent.futures.ThreadPoolExecutor` " +"باشد." msgid "Error handling API" -msgstr "" +msgstr "API مدیریت خطا" msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" +"امکان سفارشی‌سازی چگونگی مدیریت استثناها در حلقه‌ی رویداد را فراهم می‌کند." msgid "Set *handler* as the new event loop exception handler." -msgstr "" +msgstr "*handler* را به‌عنوان مدیر استثنای جدید حلقه‌ی رویداد تنظیم کنید." -msgid "If *handler* is ``None``, the default exception handler will be set. Otherwise, *handler* must be a callable with the signature matching ``(loop, context)``, where ``loop`` is a reference to the active event loop, and ``context`` is a ``dict`` object containing the details of the exception (see :meth:`call_exception_handler` documentation for details about context)." -msgstr "" +msgid "" +"If *handler* is ``None``, the default exception handler will be set. " +"Otherwise, *handler* must be a callable with the signature matching ``(loop," +" context)``, where ``loop`` is a reference to the active event loop, and " +"``context`` is a ``dict`` object containing the details of the exception " +"(see :meth:`call_exception_handler` documentation for details about " +"context)." +msgstr "" +"اگر *handler* برابر ``None`` باشد، هندلر پیش‌فرض استثنا تنظیم خواهد " +"شد. در غیر این صورت، *handler* باید یک شیء قابل فراخوانی با امضایی مطابق با " +"``(loop, context)`` باشد، که ``loop`` ارجاعی به حلقه‌ی رویداد فعال است و " +"``context`` یک شیء ``dict`` حاوی جزئیات استثنا است (برای جزئیات درباره‌ی " +"context، مستندات :meth:`call_exception_handler` را ببینید)." -msgid "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that task or callback handle." +msgid "" +"If the handler is called on behalf of a :class:`~asyncio.Task` or " +":class:`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of " +"that task or callback handle." msgstr "" +"اگر هندلر (handler) از طرف یک :class:`~asyncio.Task` یا " +":class:`~asyncio.Handle` فراخوانی شود، در :class:`contextvars.Context` آن " +"Task یا دسته کال‌بک (callback handle) اجرا می‌شود." -msgid "The handler may be called in the :class:`~contextvars.Context` of the task or handle where the exception originated." +msgid "" +"The handler may be called in the :class:`~contextvars.Context` of the task " +"or handle where the exception originated." msgstr "" +"ممکن است مدیر در :class:`~contextvars.Context` مربوط به تکلیف یا دسته‌ای " +"که استثنا از آن منشأ گرفته است، فراخوانی شود." -msgid "Return the current exception handler, or ``None`` if no custom exception handler was set." +msgid "" +"Return the current exception handler, or ``None`` if no custom exception " +"handler was set." msgstr "" +"مدیر استثنای فعلی را برمی‌گرداند، یا اگر هیچ مدیر استثنای سفارشی تنظیم نشده " +"باشد ``None`` را برمی‌گرداند." msgid "Default exception handler." -msgstr "" +msgstr "مدیر استثنای پیش‌فرض." -msgid "This is called when an exception occurs and no exception handler is set. This can be called by a custom exception handler that wants to defer to the default handler behavior." +msgid "" +"This is called when an exception occurs and no exception handler is set. " +"This can be called by a custom exception handler that wants to defer to the " +"default handler behavior." msgstr "" +"این هنگامی فراخوانی می‌شود که استثنایی رخ دهد و هیچ مدیر استثنایی تنظیم نشده" +" باشد. این می‌تواند توسط یک مدیر استثنای سفارشی که می‌خواهد رفتار را به مدیر" +" پیش‌فرض واگذار کند، فراخوانی شود." -msgid "*context* parameter has the same meaning as in :meth:`call_exception_handler`." +msgid "" +"*context* parameter has the same meaning as in " +":meth:`call_exception_handler`." msgstr "" +"پارامتر *context* همان معنایی را دارد که در :meth:`call_exception_handler` " +"آمده است." msgid "Call the current event loop exception handler." -msgstr "" +msgstr "هندلر استثنای حلقه رویداد جاری را فراخوانی کنید." -msgid "*context* is a ``dict`` object containing the following keys (new keys may be introduced in future Python versions):" +msgid "" +"*context* is a ``dict`` object containing the following keys (new keys may " +"be introduced in future Python versions):" msgstr "" +"*context* یک شیء ``dict`` حاوی کلیدهای زیر است (ممکن است کلیدهای جدیدی در " +"نسخه‌های آینده پایتون افزوده شوند):" msgid "'message': Error message;" -msgstr "" +msgstr "'message': پیام خطا؛" msgid "'exception' (optional): Exception object;" -msgstr "" +msgstr "'exception' (اختیاری): شیء استثنا؛" msgid "'future' (optional): :class:`asyncio.Future` instance;" -msgstr "" +msgstr "'future' (اختیاری): نمونه‌ی :class:`asyncio.Future`؛" msgid "'task' (optional): :class:`asyncio.Task` instance;" -msgstr "" +msgstr "'task' (اختیاری): نمونه‌ی :class:`asyncio.Task`؛" msgid "'handle' (optional): :class:`asyncio.Handle` instance;" -msgstr "" +msgstr "'handle' (اختیاری): نمونه‌ی :class:`asyncio.Handle`؛" msgid "'protocol' (optional): :ref:`Protocol ` instance;" -msgstr "" +msgstr "'protocol' (اختیاری): نمونه‌ی :ref:`Protocol `؛" msgid "'transport' (optional): :ref:`Transport ` instance;" -msgstr "" +msgstr "'transport' (اختیاری): نمونه‌ی :ref:`Transport `؛" msgid "'socket' (optional): :class:`socket.socket` instance;" -msgstr "" +msgstr "'socket' (اختیاری): نمونه‌ی :class:`socket.socket`؛" msgid "'source_traceback' (optional): Traceback of the source;" -msgstr "" +msgstr "'source_traceback' (اختیاری): ردگیری پشته‌ی منبع؛" msgid "'handle_traceback' (optional): Traceback of the handle;" -msgstr "" +msgstr "'handle_traceback' (اختیاری): ردگیری پشته‌ی دسته (handle)؛" msgid "'asyncgen' (optional): Asynchronous generator that caused" -msgstr "" +msgstr "'asyncgen' (اختیاری): تولیدگر ناهمگامی که باعث شد" msgid "the exception." -msgstr "" +msgstr "استثنا." -msgid "This method should not be overloaded in subclassed event loops. For custom exception handling, use the :meth:`set_exception_handler` method." +msgid "" +"This method should not be overloaded in subclassed event loops. For custom " +"exception handling, use the :meth:`set_exception_handler` method." msgstr "" +"این متد نباید در حلقه‌های رویداد زیرکلاس‌شده سربارگذاری (overload) شود. " +"برای مدیریت سفارشی استثنا، از متد :meth:`set_exception_handler` استفاده " +"کنید." msgid "Enabling debug mode" -msgstr "" +msgstr "فعال‌سازی حالت اشکال‌زدایی" msgid "Get the debug mode (:class:`bool`) of the event loop." -msgstr "" +msgstr "حالت اشکال‌زدایی (:class:`bool`) حلقه رویداد را دریافت می‌کند." -msgid "The default value is ``True`` if the environment variable :envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." +msgid "" +"The default value is ``True`` if the environment variable " +":envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` " +"otherwise." msgstr "" +"اگر متغیر محیطی :envvar:`PYTHONASYNCIODEBUG` به رشته‌ای غیرخالی تنظیم شده " +"باشد، مقدار پیش‌فرض ``True`` است؛ در غیر این صورت ``False`` است." msgid "Set the debug mode of the event loop." -msgstr "" +msgstr "حالت اشکال‌زدایی حلقه رویداد را تنظیم کنید." -msgid "The new :ref:`Python Development Mode ` can now also be used to enable the debug mode." +msgid "" +"The new :ref:`Python Development Mode ` can now also be used to " +"enable the debug mode." msgstr "" +"اکنون می‌توان از :ref:`حالت توسعه پایتون ` جدید نیز برای فعال‌سازی " +"حالت اشکال‌زدایی استفاده کرد." -msgid "This attribute can be used to set the minimum execution duration in seconds that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks are logged." +msgid "" +"This attribute can be used to set the minimum execution duration in seconds " +"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " +"are logged." msgstr "" +"از این ویژگی می‌توان برای تنظیم حداقل مدت زمان اجرا بر حسب ثانیه که «کند» در" +" نظر گرفته می‌شود، استفاده کرد. هنگامی که حالت اشکال‌زدایی فعال باشد، " +"کال‌بک‌های «کند» ثبت می‌شوند." msgid "Default value is 100 milliseconds." -msgstr "" +msgstr "مقدار پیش‌فرض ۱۰۰ میلی‌ثانیه است." msgid "The :ref:`debug mode of asyncio `." -msgstr "" +msgstr ":ref:`حالت اشکال‌زدایی asyncio `." msgid "Running subprocesses" -msgstr "" +msgstr "اجرای زیرفرایندها" -msgid "Methods described in this subsections are low-level. In regular async/await code consider using the high-level :func:`asyncio.create_subprocess_shell` and :func:`asyncio.create_subprocess_exec` convenience functions instead." +msgid "" +"Methods described in this subsections are low-level. In regular async/await" +" code consider using the high-level :func:`asyncio.create_subprocess_shell` " +"and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" +"متدهای توصیف‌شده در این زیربخش سطح پایین هستند. در کد معمول ناهمگام/await، " +"بهتر است به‌جای آن‌ها از توابع کمکی سطح بالای " +":func:`asyncio.create_subprocess_shell` و " +":func:`asyncio.create_subprocess_exec` استفاده کنید." -msgid "On Windows, the default event loop :class:`ProactorEventLoop` supports subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:`Subprocess Support on Windows ` for details." +msgid "" +"On Windows, the default event loop :class:`ProactorEventLoop` supports " +"subprocesses, whereas :class:`SelectorEventLoop` does not. See " +":ref:`Subprocess Support on Windows ` for " +"details." msgstr "" +"در ویندوز، حلقه رویداد پیش‌فرض :class:`ProactorEventLoop` از زیرفرایندها " +"پشتیبانی می‌کند، در حالی که :class:`SelectorEventLoop` پشتیبانی نمی‌کند. " +"برای جزئیات، :ref:`پشتیبانی از زیرفرایند در ویندوز ` را ببینید." -msgid "Create a subprocess from one or more string arguments specified by *args*." +msgid "" +"Create a subprocess from one or more string arguments specified by *args*." msgstr "" +"یک زیرفرایند از یک یا چند آرگومان رشته‌ای مشخص‌شده توسط *args* ایجاد می‌کند." msgid "*args* must be a list of strings represented by:" -msgstr "" +msgstr "*args* باید فهرستی از رشته‌ها باشد که به‌صورت زیر نمایش داده می‌شود:" msgid ":class:`str`;" -msgstr "" +msgstr ":class:`str`;" -msgid "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." +msgid "" +"or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" +"یا :class:`bytes`، که با :ref:`کدگذاری سیستم‌فایل ` " +"کدگذاری شده است." -msgid "The first string specifies the program executable, and the remaining strings specify the arguments. Together, string arguments form the ``argv`` of the program." +msgid "" +"The first string specifies the program executable, and the remaining strings" +" specify the arguments. Together, string arguments form the ``argv`` of the" +" program." msgstr "" +"اولین رشته، فایل اجرایی برنامه را مشخص می‌کند و رشته‌های باقی‌مانده " +"آرگومان‌ها را مشخص می‌کنند. آرگومان‌های رشته‌ای با هم، ``argv`` برنامه را " +"تشکیل می‌دهند." -msgid "This is similar to the standard library :class:`subprocess.Popen` class called with ``shell=False`` and the list of strings passed as the first argument; however, where :class:`~subprocess.Popen` takes a single argument which is list of strings, *subprocess_exec* takes multiple string arguments." +msgid "" +"This is similar to the standard library :class:`subprocess.Popen` class " +"called with ``shell=False`` and the list of strings passed as the first " +"argument; however, where :class:`~subprocess.Popen` takes a single argument " +"which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" +"این مشابه کلاس :class:`subprocess.Popen` در کتابخانه‌ی استاندارد است که با " +"``shell=False`` و فهرستی از رشته‌ها به‌عنوان اولین آرگومان فراخوانی می‌شود؛ " +"با این حال، در حالی که :class:`~subprocess.Popen` یک آرگومان واحد می‌گیرد که" +" فهرستی از رشته‌ها است، *subprocess_exec* چندین آرگومان رشته‌ای می‌گیرد." -msgid "The *protocol_factory* must be a callable returning a subclass of the :class:`asyncio.SubprocessProtocol` class." +msgid "" +"The *protocol_factory* must be a callable returning a subclass of the " +":class:`asyncio.SubprocessProtocol` class." msgstr "" +"*protocol_factory* باید یک شیء فراخوانی‌پذیر باشد که زیرکلاسی از کلاس " +":class:`asyncio.SubprocessProtocol` را برمی‌گرداند." msgid "Other parameters:" -msgstr "" +msgstr "پارامترهای دیگر:" msgid "*stdin* can be any of these:" -msgstr "" +msgstr "*stdin* می‌تواند هر یک از این موارد باشد:" msgid "a file-like object" -msgstr "" +msgstr "یک شیء فایل‌مانند" -msgid "an existing file descriptor (a positive integer), for example those created with :meth:`os.pipe`" +msgid "" +"an existing file descriptor (a positive integer), for example those created " +"with :meth:`os.pipe`" msgstr "" +"یک توصیف‌گر فایل موجود (یک عدد صحیح مثبت)، برای مثال مواردی که با " +":meth:`os.pipe` ایجاد شده‌اند." -msgid "the :const:`subprocess.PIPE` constant (default) which will create a new pipe and connect it," +msgid "" +"the :const:`subprocess.PIPE` constant (default) which will create a new pipe" +" and connect it," msgstr "" +"ثابت :const:`subprocess.PIPE` (پیش‌فرض) که یک پایپجدید ایجاد کرده و " +"آن را متصل می‌کند،" -msgid "the value ``None`` which will make the subprocess inherit the file descriptor from this process" +msgid "" +"the value ``None`` which will make the subprocess inherit the file " +"descriptor from this process" msgstr "" +"مقدار ``None`` که باعث می‌شود زیرفرایند توصیف‌گر فایل را از این فرایند به " +"ارث ببرد" -msgid "the :const:`subprocess.DEVNULL` constant which indicates that the special :data:`os.devnull` file will be used" +msgid "" +"the :const:`subprocess.DEVNULL` constant which indicates that the special " +":data:`os.devnull` file will be used" msgstr "" +"ثابت :const:`subprocess.DEVNULL` که نشان می‌دهد پرونده ویژه‌ی " +":data:`os.devnull` استفاده خواهد شد" msgid "*stdout* can be any of these:" -msgstr "" +msgstr "*stdout* می‌تواند هر یک از موارد زیر باشد:" msgid "*stderr* can be any of these:" -msgstr "" +msgstr "*stderr* می‌تواند هر یک از این موارد باشد:" -msgid "the :const:`subprocess.STDOUT` constant which will connect the standard error stream to the process' standard output stream" +msgid "" +"the :const:`subprocess.STDOUT` constant which will connect the standard " +"error stream to the process' standard output stream" msgstr "" +"ثابت :const:`subprocess.STDOUT` که جریان خطای استاندارد را به جریان خروجی " +"استاندارد فرایند متصل می‌کند" -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." +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 "" +"تمام آرگومان‌های کلیدواژه‌ای دیگر بدون تفسیر به :class:`subprocess.Popen` " +"منتقل می‌شوند، به جز *bufsize*، *universal_newlines*، *shell*، *text*، " +"*encoding* و *errors*، که نباید به هیچ وجه تعیین شوند." -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." +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 "" +"API زیرفرایند ``asyncio`` از کدگشایی جریان‌ها به‌صورت متن پشتیبانی نمی‌کند." +" می‌توان از :func:`bytes.decode` برای تبدیل بایت‌های برگردانده‌شده از جریان " +"به متن استفاده کرد." -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:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with the event loop." +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:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use " +"with the event loop." msgstr "" +"اگر یک شیء فایل‌مانند که به‌عنوان *stdin*، *stdout* یا *stderr* ارسال شده " +"است، نمایانگر یک پایپباشد، طرف دیگر این پایپ باید با " +":meth:`~loop.connect_write_pipe` یا :meth:`~loop.connect_read_pipe` برای " +"استفاده با حلقه رویداد ثبت شود." -msgid "See the constructor of the :class:`subprocess.Popen` class for documentation on other arguments." +msgid "" +"See the constructor of the :class:`subprocess.Popen` class for documentation" +" on other arguments." msgstr "" +"برای مستندات مربوط به سایر آرگومان‌ها، سازنده‌ی کلاس " +":class:`subprocess.Popen` را ببینید." -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*." +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 "" +"یک جفت ``(transport, protocol)`` برمی‌گرداند، که در آن *transport* با کلاس " +"پایه :class:`asyncio.SubprocessTransport` مطابقت دارد و *protocol* شیء‌ای " +"است که توسط *protocol_factory* نمونه‌سازی شده است." -msgid "If the transport is closed or is garbage collected, the child process is killed if it is still running." +msgid "" +"If the transport is closed or is garbage collected, the child process is " +"killed if it is still running." msgstr "" +"اگر انتقالبسته شود یا زباله‌روبی شود، فرایند فرزند در صورتی که " +"هنوز در حال اجرا باشد، کشته می‌شود." -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." +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 "" +"با استفاده از نحو پوسته‌ی سکو، یک زیرفرایند از *cmd*، که می‌تواند یک رشته‌ی " +":class:`str` یا یک رشته‌ی :class:`bytes` کدگذاری‌شده با :ref:`کدگذاری " +"سیستم‌فایل ` باشد، ایجاد کنید." -msgid "This is similar to the standard library :class:`subprocess.Popen` class called with ``shell=True``." +msgid "" +"This is similar to the standard library :class:`subprocess.Popen` class " +"called with ``shell=True``." msgstr "" +"این مشابه کلاس :class:`subprocess.Popen` در کتابخانه استاندارد است که با " +"``shell=True`` فراخوانی می‌شود." -msgid "The *protocol_factory* must be a callable returning a subclass of the :class:`SubprocessProtocol` class." +msgid "" +"The *protocol_factory* must be a callable returning a subclass of the " +":class:`SubprocessProtocol` class." msgstr "" +"*protocol_factory* باید یک شیء فراخوان‌پذیر باشد که زیرکلاسی از کلاس " +":class:`SubprocessProtocol` را برمی‌گرداند." -msgid "See :meth:`~loop.subprocess_exec` for more details about the remaining arguments." +msgid "" +"See :meth:`~loop.subprocess_exec` for more details about the remaining " +"arguments." msgstr "" +"برای جزئیات بیشتر درباره آرگومان‌های باقی‌مانده، " +":meth:`~loop.subprocess_exec` را ببینید." -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*." +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 "" +"یک جفت ``(transport, protocol)`` برمی‌گرداند، که در آن *transport* با کلاس " +"پایه :class:`SubprocessTransport` مطابقت دارد و *protocol* شیء‌ای است که " +"توسط *protocol_factory* نمونه‌سازی شده است." -msgid "It is the application's responsibility to ensure that all whitespace and special characters are quoted appropriately to avoid `shell injection `_ vulnerabilities. The :func:`shlex.quote` function can be used to properly escape whitespace and special characters in strings that are going to be used to construct shell commands." -msgstr "" +msgid "" +"It is the application's responsibility to ensure that all whitespace and " +"special characters are quoted appropriately to avoid `shell injection " +"`_ " +"vulnerabilities. The :func:`shlex.quote` function can be used to properly " +"escape whitespace and special characters in strings that are going to be " +"used to construct shell commands." +msgstr "" +"بر عهده‌ی برنامه است که اطمینان حاصل کند همه‌ی نویسه‌های فضای خالی و نویسه‌های" +" خاص به‌درستی داخل علامت نقل‌قول قرار گرفته باشند تا از آسیب‌پذیری‌های تزریق" +" پوسته (`shell injection " +"`_) جلوگیری " +"شود. می‌توان از تابع :func:`shlex.quote` برای خنثی کردن صحیح نویسه‌های فضای " +"خالی و نویسه‌های خاص در رشته‌هایی که قرار است برای ساخت دستورات پوسته " +"استفاده شوند، استفاده کرد." msgid "Callback handles" -msgstr "" +msgstr "دسته‌های کال‌بک" -msgid "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop.call_soon_threadsafe`." +msgid "" +"A callback wrapper object returned by :meth:`loop.call_soon`, " +":meth:`loop.call_soon_threadsafe`." msgstr "" +"یک شیء پوششی کال‌بک که توسط :meth:`loop.call_soon` و " +":meth:`loop.call_soon_threadsafe` برگردانده می‌شود." -msgid "Return the :class:`contextvars.Context` object associated with the handle." +msgid "" +"Return the :class:`contextvars.Context` object associated with the handle." msgstr "" +"شیء :class:`contextvars.Context` مرتبط با دسته (handle) را برمی‌گرداند." -msgid "Cancel the callback. If the callback has already been canceled or executed, this method has no effect." +msgid "" +"Cancel the callback. If the callback has already been canceled or executed," +" this method has no effect." msgstr "" +"کال‌بک را لغو می‌کند. اگر کال‌بک پیش‌تر لغو یا اجرا شده باشد، این متد هیچ " +"اثری ندارد." msgid "Return ``True`` if the callback was cancelled." -msgstr "" +msgstr "اگر کال‌بک لغو شده باشد، ``True`` برمی‌گرداند." -msgid "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:`loop.call_at`." +msgid "" +"A callback wrapper object returned by :meth:`loop.call_later`, and " +":meth:`loop.call_at`." msgstr "" +"یک شیء پوششی کال‌بک که توسط :meth:`loop.call_later` و :meth:`loop.call_at` " +"بازگردانده می‌شود." msgid "This class is a subclass of :class:`Handle`." -msgstr "" +msgstr "این کلاس زیرکلاسی از :class:`Handle` است." msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" +"زمان یک کال‌بک زمان‌بندی‌شده را به‌صورت :class:`float` بر حسب ثانیه " +"برمی‌گرداند." -msgid "The time is an absolute timestamp, using the same time reference as :meth:`loop.time`." +msgid "" +"The time is an absolute timestamp, using the same time reference as " +":meth:`loop.time`." msgstr "" +"زمان یک برچسب زمانی مطلق است که از همان مرجع زمان :meth:`loop.time` استفاده " +"می‌کند." msgid "Server objects" -msgstr "" +msgstr "اشیای سرور" -msgid "Server objects are created by :meth:`loop.create_server`, :meth:`loop.create_unix_server`, :func:`start_server`, and :func:`start_unix_server` functions." +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 "" +"اشیای سرور توسط توابع :meth:`loop.create_server`، " +":meth:`loop.create_unix_server`، :func:`start_server` و " +":func:`start_unix_server` ایجاد می‌شوند." msgid "Do not instantiate the :class:`Server` class directly." -msgstr "" +msgstr "کلاس :class:`Server` را مستقیماً نمونه‌سازی نکنید." -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::" +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 "" +"اشیای *Server* مدیرهای زمینه ناهمگام هستند. هنگامی که در یک دستور ``async " +"with`` استفاده شوند، تضمین می‌شود که شیء Server در زمان کامل شدن دستور " +"``async with`` بسته است و اتصال‌های جدید را نمی‌پذیرد::" msgid "" "srv = await loop.create_server(...)\n" @@ -1198,57 +2579,119 @@ msgid "" "\n" "# At this point, srv is closed and no longer accepts new connections." msgstr "" +"srv = await loop.create_server(...)\n" +"\n" +"async with srv:\n" +" # چند خط کد\n" +"\n" +"# در این نقطه، srv بسته شده است و دیگر اتصالات جدید را نمی‌پذیرد." msgid "Server object is an asynchronous context manager since Python 3.7." -msgstr "" +msgstr "شیء Server از پایتون 3.7، یک مدیر زمینه ناهمگام است." -msgid "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, 3.10.3 and 3.11." +msgid "" +"This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " +"3.10.3 and 3.11." msgstr "" +"این کلاس در پایتون 3.9.11، 3.10.3 و 3.11 به‌صورت عمومی با عنوان " +"``asyncio.Server`` در دسترس قرار گرفت." -msgid "Stop serving: close listening sockets and set the :attr:`sockets` attribute to ``None``." +msgid "" +"Stop serving: close listening sockets and set the :attr:`sockets` attribute " +"to ``None``." msgstr "" +"توقف سرویس‌دهی: سوکت‌های شنونده را ببندید و ویژگی :attr:`sockets` را روی " +"``None`` قرار دهید." -msgid "The sockets that represent existing incoming client connections are left open." +msgid "" +"The sockets that represent existing incoming client connections are left " +"open." msgstr "" +"سوکت‌هایی که نشان‌دهنده‌ی اتصالات ورودی موجودِ کلاینت‌ها هستند، باز می‌مانند." -msgid "The server is closed asynchronously; use the :meth:`wait_closed` coroutine to wait until the server is closed (and no more connections are active)." +msgid "" +"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " +"to wait until the server is closed (and no more connections are active)." msgstr "" +"سرور به‌صورت ناهمگام بسته می‌شود؛ از هم‌روال :meth:`wait_closed` برای صبر " +"کردن تا زمانی که سرور بسته شود (و دیگر هیچ اتصالی فعال نباشد) استفاده کنید." msgid "Close all existing incoming client connections." -msgstr "" +msgstr "تمام اتصالات ورودی موجود کلاینت را ببندید." -msgid "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." +msgid "" +"Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." msgstr "" +":meth:`~asyncio.BaseTransport.close` را برای تمام انتقال‌های مرتبط " +"فراخوانی می‌کند." -msgid ":meth:`close` should be called before :meth:`close_clients` when closing the server to avoid races with new clients connecting." +msgid "" +":meth:`close` should be called before :meth:`close_clients` when closing the" +" server to avoid races with new clients connecting." msgstr "" +"هنگام بستن سرور، برای جلوگیری از رقابت با اتصال کلاینت‌های جدید، باید " +":meth:`close` را پیش از :meth:`close_clients` فراخوانی کرد." -msgid "Close all existing incoming client connections immediately, without waiting for pending operations to complete." +msgid "" +"Close all existing incoming client connections immediately, without waiting " +"for pending operations to complete." msgstr "" +"تمام اتصال‌های ورودی کلاینت موجود را بلافاصله ببندید، بدون انتظار برای تکمیل" +" عملیات‌های در انتظار." -msgid "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." +msgid "" +"Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." msgstr "" +":meth:`~asyncio.WriteTransport.abort` را روی تمام انتقال‌های مرتبط " +" فراخوانی می‌کند." -msgid ":meth:`close` should be called before :meth:`abort_clients` when closing the server to avoid races with new clients connecting." +msgid "" +":meth:`close` should be called before :meth:`abort_clients` when closing the" +" server to avoid races with new clients connecting." msgstr "" +"هنگام بستن سرور، باید :meth:`close` پیش از :meth:`abort_clients` فراخوانی " +"شود تا از رقابت با کلاینت‌های جدیدی که در حال اتصال هستند اجتناب شود." msgid "Return the event loop associated with the server object." -msgstr "" +msgstr "حلقه رویداد مرتبط با شیء سرور را برمی‌گرداند." msgid "Start accepting connections." -msgstr "" +msgstr "پذیرش اتصال‌ها را آغاز کنید." -msgid "This method is idempotent, so it can be called when the server is already serving." +msgid "" +"This method is idempotent, so it can be called when the server is already " +"serving." msgstr "" +"این متد هم‌توان (idempotent) است، بنابراین می‌توان آن را هنگامی که سرور از" +" قبل در حال سرویس‌دهی است فراخوانی کرد." -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 accepting connections initially. In this case ``Server.start_serving()``, or :meth:`Server.serve_forever` can be used to make the Server start accepting connections." -msgstr "" +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 " +"accepting connections initially. In this case ``Server.start_serving()``, " +"or :meth:`Server.serve_forever` can be used to make the Server start " +"accepting connections." +msgstr "" +"پارامتر فقط کلیدواژه‌ای *start_serving* در :meth:`loop.create_server` و " +":meth:`asyncio.start_server` امکان ایجاد یک شیء Server را فراهم می‌کند که در" +" ابتدا اتصال‌ها را نمی‌پذیرد. در این حالت، می‌توان از " +"``Server.start_serving()`` یا :meth:`Server.serve_forever` برای شروع پذیرش " +"اتصال‌ها توسط Server استفاده کرد." -msgid "Start accepting connections until the coroutine is cancelled. Cancellation of ``serve_forever`` task causes the server to be closed." +msgid "" +"Start accepting connections until the coroutine is cancelled. Cancellation " +"of ``serve_forever`` task causes the server to be closed." msgstr "" +"پذیرش اتصال‌ها را تا زمانی که هم‌روال لغو شود، آغاز می‌کند. لغو وظیفه " +"``serve_forever`` باعث بسته شدن سرور می‌شود." -msgid "This method can be called if the server is already accepting connections. Only one ``serve_forever`` task can exist per one *Server* object." +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 "" +"این متد را می‌توان در صورتی فراخوانی کرد که سرور از قبل در حال پذیرش " +"اتصال‌ها باشد. به ازای هر شیء *Server*، تنها یک وظیفه " +"``serve_forever`` می‌تواند وجود داشته باشد." msgid "" "async def client_connected(reader, writer):\n" @@ -1263,36 +2706,78 @@ msgid "" "\n" "asyncio.run(main('127.0.0.1', 0))" msgstr "" +"async def client_connected(reader, writer):\n" +" # Communicate with the client with\n" +" # reader/writer streams. For example:\n" +" await reader.readline()\n" +"\n" +"async def main(host, port):\n" +" srv = await asyncio.start_server(\n" +" client_connected, host, port)\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main('127.0.0.1', 0))" msgid "Return ``True`` if the server is accepting new connections." -msgstr "" +msgstr "اگر سرور در حال پذیرش اتصال‌های جدید باشد، ``True`` را برمی‌گرداند." -msgid "Wait until the :meth:`close` method completes and all active connections have finished." +msgid "" +"Wait until the :meth:`close` method completes and all active connections " +"have finished." msgstr "" +"صبر کنید تا متد :meth:`close` کامل شود و تمام اتصال‌های فعال به پایان رسیده " +"باشند." -msgid "``wait_closed()`` now waits until the server is closed and all active connections have finished. Previously, it returned immediately if the server was already closed, even if connections were still active." +msgid "" +"``wait_closed()`` now waits until the server is closed and all active " +"connections have finished. Previously, it returned immediately if the " +"server was already closed, even if connections were still active." msgstr "" +"``wait_closed()`` اکنون صبر می‌کند تا سرور بسته شود و تمام اتصال‌های فعال به" +" پایان برسند. پیش از این، اگر سرور از قبل بسته شده بود، حتی اگر اتصال‌ها " +"هنوز فعال بودند، بلافاصله بازمی‌گشت." -msgid "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the server is listening on." +msgid "" +"List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " +"server is listening on." msgstr "" +"فهرستی از اشیاء شبه‌سوکت، ``asyncio.trsock.TransportSocket``، که سرور به " +"آن‌ها گوش می‌دهد." -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." +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 "" +"پیش از پایتون 3.7، ``Server.sockets`` مستقیماً یک فهرست داخلی از سوکت‌های " +"سرور را برمی‌گرداند. در 3.7، یک کپی از آن فهرست برگردانده می‌شود." msgid "Event loop implementations" -msgstr "" +msgstr "پیاده‌سازی‌های حلقه رویداد" -msgid "asyncio ships with two different event loop implementations: :class:`SelectorEventLoop` and :class:`ProactorEventLoop`." +msgid "" +"asyncio ships with two different event loop implementations: " +":class:`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" +"asyncio با دو پیاده‌سازی مختلف حلقه رویداد ارائه می‌شود: " +":class:`SelectorEventLoop` و :class:`ProactorEventLoop`." msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "" +"به‌طور پیش‌فرض، asyncio برای استفاده از :class:`EventLoop` پیکربندی شده است." -msgid "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` module." +msgid "" +"A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " +"module." msgstr "" +"زیرکلاسی از :class:`AbstractEventLoop` مبتنی بر ماژول :mod:`selectors`." -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::" +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 "" +"از کارآمدترین *انتخابگر* موجود برای سکوی داده‌شده استفاده می‌کند. همچنین " +"می‌توان پیاده‌سازی دقیق انتخابگر مورد استفاده را به‌صورت دستی پیکربندی کرد::" msgid "" "import asyncio\n" @@ -1304,36 +2789,79 @@ msgid "" "loop_factory = lambda: asyncio.SelectorEventLoop(selectors.SelectSelector())\n" "asyncio.run(main(), loop_factory=loop_factory)" msgstr "" +"import asyncio\n" +"import selectors\n" +"\n" +"async def main():\n" +" ...\n" +"\n" +"loop_factory = lambda: asyncio.SelectorEventLoop(selectors.SelectSelector())\n" +"asyncio.run(main(), loop_factory=loop_factory)" -msgid "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O Completion Ports\" (IOCP)." +msgid "" +"A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " +"Completion Ports\" (IOCP)." msgstr "" +"یک زیرکلاس از :class:`AbstractEventLoop` برای ویندوز که از «I/O Completion " +"Ports» (IOCP) استفاده می‌کند." -msgid "`MSDN documentation on I/O Completion Ports `_." +msgid "" +"`MSDN documentation on I/O Completion Ports " +"`_." msgstr "" +"`مستندات MSDN درباره پورت‌های تکمیل ورودی/خروجی (I/O Completion Ports) " +"`_." -msgid "An alias to the most efficient available subclass of :class:`AbstractEventLoop` for the given platform." +msgid "" +"An alias to the most efficient available subclass of " +":class:`AbstractEventLoop` for the given platform." msgstr "" +"نام مستعاری به کارآمدترین زیرکلاسِ در دسترسِ :class:`AbstractEventLoop` " +"برای سکوی داده‌شده." -msgid "It is an alias to :class:`SelectorEventLoop` on Unix and :class:`ProactorEventLoop` on Windows." +msgid "" +"It is an alias to :class:`SelectorEventLoop` on Unix and " +":class:`ProactorEventLoop` on Windows." msgstr "" +"این یک نام مستعار برای :class:`SelectorEventLoop` در یونیکس و " +":class:`ProactorEventLoop` در ویندوز است." msgid "Abstract base class for asyncio-compliant event loops." -msgstr "" +msgstr "کلاس پایه انتزاعی برای حلقه‌های رویداد سازگار با asyncio." -msgid "The :ref:`asyncio-event-loop-methods` section lists all methods that an alternative implementation of ``AbstractEventLoop`` should have defined." +msgid "" +"The :ref:`asyncio-event-loop-methods` section lists all methods that an " +"alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" +"بخش :ref:`asyncio-event-loop-methods` همه‌ی متدهایی را که یک پیاده‌سازی " +"جایگزین از ``AbstractEventLoop`` باید تعریف کرده باشد، فهرست می‌کند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -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.call_soon`. Modern asyncio applications rarely need to be written this way; consider using the high-level functions like :func:`asyncio.run`." -msgstr "" +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.call_soon`. Modern asyncio applications rarely need to be " +"written this way; consider using the high-level functions like " +":func:`asyncio.run`." +msgstr "" +"توجه داشته باشید که همه نمونه‌های این بخش **عمداً** نشان می‌دهند که چگونه از" +" APIهای سطح پایین حلقه رویداد، مانند :meth:`loop.run_forever` و " +":meth:`loop.call_soon`، استفاده کنید. برنامه‌های کاربردی مدرن asyncio " +"به‌ندرت لازم است به این شکل نوشته شوند؛ استفاده از توابع سطح بالا مانند " +":func:`asyncio.run` را در نظر بگیرید." msgid "Hello World with call_soon()" -msgstr "" +msgstr "سلام دنیا با call_soon()" -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::" +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 "" +"مثالی که از متد :meth:`loop.call_soon` برای زمان‌بندی یک کال‌بک استفاده " +"می‌کند. این کال‌بک ``\"Hello World\"`` را نمایش می‌دهد و سپس حلقه رویداد را " +"متوقف می‌کند::" msgid "" "import asyncio\n" @@ -1354,15 +2882,42 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"\n" +"def hello_world(loop):\n" +" \"\"\"A callback to print 'Hello World' and stop the event loop\"\"\"\n" +" print('Hello World')\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule a call to hello_world()\n" +"loop.call_soon(hello_world, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" -msgid "A similar :ref:`Hello World ` example created with a coroutine and the :func:`run` function." +msgid "" +"A similar :ref:`Hello World ` example created with a coroutine " +"and the :func:`run` function." msgstr "" +"مثالی مشابه :ref:`سلام دنیا ` که با یک هم‌روال و تابع :func:`run`" +" ایجاد شده است." msgid "Display the current date with call_later()" -msgstr "" +msgstr "نمایش تاریخ فعلی با call_later()" -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::" +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 "" +"نمونه‌ای از یک کال‌بک که تاریخ جاری را هر ثانیه نمایش می‌دهد. این کال‌بک از " +"متد :meth:`loop.call_later` برای زمان‌بندی مجدد خود پس از ۵ ثانیه استفاده " +"می‌کند و سپس حلقه رویداد را متوقف می‌کند::" msgid "" "import asyncio\n" @@ -1387,15 +2942,44 @@ msgid "" "finally:\n" " loop.close()" msgstr "" +"import asyncio\n" +"import datetime as dt\n" +"\n" +"def display_date(end_time, loop):\n" +" print(dt.datetime.now())\n" +" if (loop.time() + 1.0) < end_time:\n" +" loop.call_later(1, display_date, end_time, loop)\n" +" else:\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule the first call to display_date()\n" +"end_time = loop.time() + 5.0\n" +"loop.call_soon(display_date, end_time, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" -msgid "A similar :ref:`current date ` example created with a coroutine and the :func:`run` function." +msgid "" +"A similar :ref:`current date ` example created with a" +" coroutine and the :func:`run` function." msgstr "" +"مثالی مشابه از :ref:`تاریخ جاری ` که با یک هم‌روال و " +"تابع :func:`run` ایجاد شده است." msgid "Watch a file descriptor for read events" -msgstr "" +msgstr "پایش یک توصیف‌گر فایل برای رویدادهای خواندن" -msgid "Wait until a file descriptor received some data using the :meth:`loop.add_reader` method and then close the event loop::" +msgid "" +"Wait until a file descriptor received some data using the " +":meth:`loop.add_reader` method and then close the event loop::" msgstr "" +"منتظر بمانید تا یک توصیف‌گر فایل با استفاده از متد :meth:`loop.add_reader` " +"داده‌ای دریافت کند و سپس حلقه رویداد را ببندید::" msgid "" "import asyncio\n" @@ -1431,21 +3015,66 @@ msgid "" " wsock.close()\n" " loop.close()" msgstr "" +"import asyncio\n" +"from socket import socketpair\n" +"\n" +"# Create a pair of connected file descriptors\n" +"rsock, wsock = socketpair()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"def reader():\n" +" data = rsock.recv(100)\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: unregister the file descriptor\n" +" loop.remove_reader(rsock)\n" +"\n" +" # Stop the event loop\n" +" loop.stop()\n" +"\n" +"# Register the file descriptor for read event\n" +"loop.add_reader(rsock, reader)\n" +"\n" +"# Simulate the reception of data from the network\n" +"loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +"try:\n" +" # Run the event loop\n" +" loop.run_forever()\n" +"finally:\n" +" # We are done. Close sockets and the event loop.\n" +" rsock.close()\n" +" wsock.close()\n" +" loop.close()" -msgid "A similar :ref:`example ` using transports, protocols, and the :meth:`loop.create_connection` method." +msgid "" +"A similar :ref:`example ` using " +"transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" +"یک :ref:`مثال ` مشابه با استفاده از " +"انتقال‌ها ، پروتکل‌ها و متد :meth:`loop.create_connection`." -msgid "Another similar :ref:`example ` using the high-level :func:`asyncio.open_connection` function and streams." +msgid "" +"Another similar :ref:`example ` " +"using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" +"یک :ref:`مثال ` مشابه دیگر که از " +"تابع سطح بالای :func:`asyncio.open_connection` و جریان‌ها (streams) استفاده " +"می‌کند." msgid "Set signal handlers for SIGINT and SIGTERM" -msgstr "" +msgstr "تنظیم هندلرهای سیگنال (signal handlers) برای SIGINT و SIGTERM" msgid "(This ``signal`` example only works on Unix.)" -msgstr "" +msgstr "(این مثال ``signal`` فقط در یونیکس کار می‌کند.)" -msgid "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal.SIGTERM` using the :meth:`loop.add_signal_handler` method::" +msgid "" +"Register handlers for signals :const:`~signal.SIGINT` and " +":const:`~signal.SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" +"با استفاده از متد :meth:`loop.add_signal_handler`، هندلرهایی برای سیگنال‌های " +":const:`~signal.SIGINT` و :const:`~signal.SIGTERM` ثبت کنید::" msgid "" "import asyncio\n" @@ -1472,3 +3101,26 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import functools\n" +"import os\n" +"import signal\n" +"\n" +"def ask_exit(signame, loop):\n" +" print(\"got signal %s: exit\" % signame)\n" +" loop.stop()\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" for signame in {'SIGINT', 'SIGTERM'}:\n" +" loop.add_signal_handler(\n" +" getattr(signal, signame),\n" +" functools.partial(ask_exit, signame, loop))\n" +"\n" +" await asyncio.sleep(3600)\n" +"\n" +"print(\"Event loop running for 1 hour, press Ctrl+C to interrupt.\")\n" +"print(f\"pid {os.getpid()}: send SIGINT or SIGTERM to exit.\")\n" +"\n" +"asyncio.run(main())" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index 2d8393f28..471fdb346 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -24,58 +24,75 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "**Source code:** :source:`Lib/asyncio/exceptions.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/exceptions.py`" -msgid "A deprecated alias of :exc:`TimeoutError`, raised when the operation has exceeded the given deadline." +msgid "" +"A deprecated alias of :exc:`TimeoutError`, raised when the operation has " +"exceeded the given deadline." msgstr "" +"یک نام مستعار منسوخ از :exc:`TimeoutError`، که هنگامی پرتاب می‌شود که عملیات" +" از مهلت تعیین‌شده فراتر رفته باشد." msgid "This class was made an alias of :exc:`TimeoutError`." -msgstr "" +msgstr "این کلاس نام مستعار :exc:`TimeoutError` شد." msgid "The operation has been cancelled." -msgstr "" +msgstr "این عملیات لغو شده است." -msgid "This exception can be caught to perform custom operations when asyncio Tasks are cancelled. In almost all situations the exception must be re-raised." +msgid "" +"This exception can be caught to perform custom operations when asyncio Tasks" +" are cancelled. In almost all situations the exception must be re-raised." msgstr "" +"این استثنا می‌تواند گرفته شود تا هنگامی که Taskهای asyncio لغو می‌شوند، " +"عملیات سفارشی انجام شود. تقریباً در همه‌ی شرایط، این استثنا باید دوباره پرتاب" +" شود." -msgid ":exc:`CancelledError` is now a subclass of :class:`BaseException` rather than :class:`Exception`." +msgid "" +":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " +"than :class:`Exception`." msgstr "" +":exc:`CancelledError` اکنون به جای :class:`Exception `، " +"زیرکلاسی از :class:`BaseException ` است." msgid "Invalid internal state of :class:`Task` or :class:`Future`." -msgstr "" +msgstr "وضعیت داخلی نامعتبر :class:`Task` یا :class:`Future`." -msgid "Can be raised in situations like setting a result value for a *Future* object that already has a result value set." +msgid "" +"Can be raised in situations like setting a result value for a *Future* " +"object that already has a result value set." msgstr "" +"ممکن است در موقعیت‌هایی مانند تنظیم یک مقدار نتیجه برای یک شیء *Future* که " +"از قبل یک مقدار نتیجه برای آن تنظیم شده است، پرتاب شود." -msgid "The \"sendfile\" syscall is not available for the given socket or file type." +msgid "" +"The \"sendfile\" syscall is not available for the given socket or file type." msgstr "" +"فراخوانی سیستمی \"sendfile\" برای سوکت یا نوع فایل داده‌شده در دسترس نیست." msgid "A subclass of :exc:`RuntimeError`." -msgstr "" +msgstr "زیرکلاسی از :exc:`RuntimeError`." msgid "The requested read operation did not complete fully." -msgstr "" - -msgid "Raised by the :ref:`asyncio stream APIs`." -msgstr "" +msgstr "عملیات خواندن درخواست‌شده به‌طور کامل انجام نشد." msgid "This exception is a subclass of :exc:`EOFError`." -msgstr "" +msgstr "این استثنا یک زیرکلاس از :exc:`EOFError` است." msgid "The total number (:class:`int`) of expected bytes." -msgstr "" +msgstr "تعداد کل بایت‌های مورد انتظار (:class:`int`)." msgid "A string of :class:`bytes` read before the end of stream was reached." msgstr "" +"رشته‌ای از :class:`bytes` که پیش از رسیدن به پایان جریان خوانده شده است." msgid "Reached the buffer size limit while looking for a separator." -msgstr "" +msgstr "در حین جست‌وجوی جداکننده، به محدودیت اندازه‌ی بافر رسیده است." msgid "Raised by the :ref:`asyncio stream APIs `." -msgstr "" +msgstr "توسط :ref:`APIهای جریان asyncio ` پرتاب می‌شود." msgid "The total number of to be consumed bytes." -msgstr "" +msgstr "تعداد کل بایت‌هایی که باید مصرف شوند." diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index e4ae3a66f..2fc0f1630 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -22,82 +22,145 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Extending" -msgstr "" +msgstr "گسترش" -msgid "The main direction for :mod:`asyncio` extending is writing custom *event loop* classes. Asyncio has helpers that could be used to simplify this task." +msgid "" +"The main direction for :mod:`asyncio` extending is writing custom *event " +"loop* classes. Asyncio has helpers that could be used to simplify this task." msgstr "" +"جهت اصلی گسترش :mod:`asyncio`، نوشتن کلاس‌های سفارشی *حلقه رویداد* است. " +"Asyncio ابزارهای کمکی دارد که می‌توان از آن‌ها برای ساده‌سازی این کار " +"استفاده کرد." -msgid "Third-parties should reuse existing asyncio code with caution, a new Python version is free to break backward compatibility in *internal* part of API." +msgid "" +"Third-parties should reuse existing asyncio code with caution, a new Python " +"version is free to break backward compatibility in *internal* part of API." msgstr "" +"اشخاص ثالث باید با احتیاط از کد asyncio موجود دوباره استفاده کنند؛ یک نسخه " +"جدید پایتون مجاز است سازگاری عقب‌گرد را در بخش *داخلی* API نقض کند." msgid "Writing a Custom Event Loop" -msgstr "" +msgstr "نوشتن یک حلقه رویداد سفارشی" -msgid ":class:`asyncio.AbstractEventLoop` declares very many methods. Implementing all them from scratch is a tedious job." +msgid "" +":class:`asyncio.AbstractEventLoop` declares very many methods. Implementing" +" all them from scratch is a tedious job." msgstr "" +":class:`asyncio.AbstractEventLoop` تعداد بسیار زیادی متد را اعلام می‌کند. " +"پیاده‌سازی همه‌ی آن‌ها از ابتدا کار خسته‌کننده‌ای است." -msgid "A loop can get many common methods implementation for free by inheriting from :class:`asyncio.BaseEventLoop`." +msgid "" +"A loop can get many common methods implementation for free by inheriting " +"from :class:`asyncio.BaseEventLoop`." msgstr "" +"یک حلقه می‌تواند با ارث‌بری از :class:`asyncio.BaseEventLoop`، پیاده‌سازی " +"بسیاری از متدهای رایج را به‌رایگان به دست آورد." -msgid "In turn, the successor should implement a bunch of *private* methods declared but not implemented in :class:`asyncio.BaseEventLoop`." +msgid "" +"In turn, the successor should implement a bunch of *private* methods " +"declared but not implemented in :class:`asyncio.BaseEventLoop`." msgstr "" +"به‌نوبه خود، جانشین باید تعدادی متد *خصوصی* را که در " +":class:`asyncio.BaseEventLoop` اعلام‌شده‌اند اما پیاده‌سازی‌نشده‌اند، " +"پیاده‌سازی کند." -msgid "For example, ``loop.create_connection()`` checks arguments, resolves DNS addresses, and calls ``loop._make_socket_transport()`` that should be implemented by inherited class. The ``_make_socket_transport()`` method is not documented and is considered as an *internal* API." +msgid "" +"For example, ``loop.create_connection()`` checks arguments, resolves DNS " +"addresses, and calls ``loop._make_socket_transport()`` that should be " +"implemented by inherited class. The ``_make_socket_transport()`` method is " +"not documented and is considered as an *internal* API." msgstr "" +"برای مثال، ``loop.create_connection()`` آرگومان‌ها را بررسی می‌کند، آدرس‌های" +" DNS را حل می‌کند و ``loop._make_socket_transport()`` را فراخوانی می‌کند که " +"باید توسط کلاس مشتق‌شده پیاده‌سازی شود. متد ``_make_socket_transport()`` " +"مستند نشده است و به‌عنوان یک API *داخلی* در نظر گرفته می‌شود." msgid "Future and Task private constructors" -msgstr "" +msgstr "سازنده‌های خصوصی Future و Task" -msgid ":class:`asyncio.Future` and :class:`asyncio.Task` should be never created directly, please use corresponding :meth:`loop.create_future` and :meth:`loop.create_task`, or :func:`asyncio.create_task` factories instead." +msgid "" +":class:`asyncio.Future` and :class:`asyncio.Task` should be never created " +"directly, please use corresponding :meth:`loop.create_future` and " +":meth:`loop.create_task`, or :func:`asyncio.create_task` factories instead." msgstr "" +":class:`asyncio.Future` و :class:`asyncio.Task` را هرگز نباید به‌صورت مستقیم" +" ایجاد کرد؛ لطفاً به‌جای آن‌ها از کارخانه‌های متناظر " +":meth:`loop.create_future` و :meth:`loop.create_task` یا " +":func:`asyncio.create_task` استفاده کنید." -msgid "However, third-party *event loops* may *reuse* built-in future and task implementations for the sake of getting a complex and highly optimized code for free." +msgid "" +"However, third-party *event loops* may *reuse* built-in future and task " +"implementations for the sake of getting a complex and highly optimized code " +"for free." msgstr "" +"با این حال، *حلقه‌های رویداد* شخص ثالث ممکن است برای به‌دست آوردن کدی پیچیده" +" و بسیار بهینه‌شده به‌صورت رایگان، از پیاده‌سازی‌های توکار future و task " +"*دوباره استفاده کنند*." msgid "For this purpose the following, *private* constructors are listed:" -msgstr "" +msgstr "برای این منظور، سازنده‌های *خصوصی* زیر فهرست شده‌اند:" msgid "Create a built-in future instance." -msgstr "" +msgstr "یک نمونه‌ی فیوچر (future) توکار ایجاد کنید." msgid "*loop* is an optional event loop instance." -msgstr "" +msgstr "*loop* نمونه‌ای اختیاری از حلقه رویداد است." msgid "Create a built-in task instance." -msgstr "" +msgstr "یک نمونه از وظیفهتوکار ایجاد کنید." -msgid "*loop* is an optional event loop instance. The rest of arguments are described in :meth:`loop.create_task` description." +msgid "" +"*loop* is an optional event loop instance. The rest of arguments are " +"described in :meth:`loop.create_task` description." msgstr "" +"*loop* یک نمونه اختیاری از حلقه رویداد است. سایر آرگومان‌ها در توضیحات " +":meth:`loop.create_task` شرح داده شده‌اند." msgid "*context* argument is added." -msgstr "" +msgstr "آرگومان *context* اضافه شد." msgid "Task lifetime support" -msgstr "" +msgstr "پشتیبانی از طول عمر Task" -msgid "A third party task implementation should call the following functions to keep a task visible by :func:`asyncio.all_tasks` and :func:`asyncio.current_task`:" +msgid "" +"A third party task implementation should call the following functions to " +"keep a task visible by :func:`asyncio.all_tasks` and " +":func:`asyncio.current_task`:" msgstr "" +"یک پیاده‌سازی وظیفهشخص ثالث باید توابع زیر را فراخوانی کند تا یک وظیفه " +"برای :func:`asyncio.all_tasks` و :func:`asyncio.current_task` قابل مشاهده " +"باقی بماند:" msgid "Register a new *task* as managed by *asyncio*." msgstr "" +"یک *وظیفه * جدید را به‌عنوان مدیریت‌شده توسط *asyncio* ثبت کنید." msgid "Call the function from a task constructor." -msgstr "" +msgstr "تابع را از یک سازنده‌ی وظیفهفراخوانی کنید." msgid "Unregister a *task* from *asyncio* internal structures." -msgstr "" +msgstr "ثبت یک *task* را از ساختارهای داخلی *asyncio* حذف کنید." msgid "The function should be called when a task is about to finish." msgstr "" +"این تابع باید هنگامی فراخوانی شود که یک وظیفه در آستانه‌ی پایان قرار دارد." msgid "Switch the current task to the *task* argument." -msgstr "" +msgstr "وظیفه جاری را به آرگومان *task* تغییر دهید." -msgid "Call the function just before executing a portion of embedded *coroutine* (:meth:`coroutine.send` or :meth:`coroutine.throw`)." +msgid "" +"Call the function just before executing a portion of embedded *coroutine* " +"(:meth:`coroutine.send` or :meth:`coroutine.throw`)." msgstr "" +"تابع را درست پیش از اجرای بخشی از *هم‌روال* جاسازی‌شده فراخوانی کنید " +"(:meth:`coroutine.send` یا :meth:`coroutine.throw`)." msgid "Switch the current task back from *task* to ``None``." -msgstr "" +msgstr "وظیفه‌ی جاری را از *task* به ``None`` بازمی‌گرداند." -msgid "Call the function just after :meth:`coroutine.send` or :meth:`coroutine.throw` execution." +msgid "" +"Call the function just after :meth:`coroutine.send` or " +":meth:`coroutine.throw` execution." msgstr "" +"تابع را درست پس از اجرای :meth:`coroutine.send` یا :meth:`coroutine.throw` " +"فراخوانی کنید." diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 6f8ced632..333fd9d74 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -24,183 +24,342 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Futures" -msgstr "" +msgstr "آینده‌نماها (Futures)" -msgid "**Source code:** :source:`Lib/asyncio/futures.py`, :source:`Lib/asyncio/base_futures.py`" +msgid "" +"**Source code:** :source:`Lib/asyncio/futures.py`, " +":source:`Lib/asyncio/base_futures.py`" msgstr "" +"کد منبع: :source:`Lib/asyncio/futures.py`، " +":source:`Lib/asyncio/base_futures.py`" -msgid "*Future* objects are used to bridge **low-level callback-based code** with high-level async/await code." +msgid "" +"*Future* objects are used to bridge **low-level callback-based code** with " +"high-level async/await code." msgstr "" +"اشیای *Future* برای پیوند دادن **کد سطح‌پایین مبتنی بر کال‌بک** با کد " +"سطح‌بالای ناهمگام/await استفاده می‌شوند." msgid "Future Functions" -msgstr "" +msgstr "توابع آینده" msgid "Return ``True`` if *obj* is either of:" -msgstr "" +msgstr "اگر *obj* یکی از موارد زیر باشد، ``True`` را برمی‌گرداند:" msgid "an instance of :class:`asyncio.Future`," -msgstr "" +msgstr "نمونه‌ای از :class:`asyncio.Future`،" msgid "an instance of :class:`asyncio.Task`," -msgstr "" +msgstr "نمونه‌ای از :class:`asyncio.Task`،" msgid "a Future-like object with a ``_asyncio_future_blocking`` attribute." -msgstr "" +msgstr "یک شیء شبیه به Future با ویژگی ``_asyncio_future_blocking``." msgid "Return:" -msgstr "" +msgstr "بازگشت:" -msgid "*obj* argument as is, if *obj* is a :class:`Future`, a :class:`Task`, or a Future-like object (:func:`isfuture` is used for the test.)" +msgid "" +"*obj* argument as is, if *obj* is a :class:`Future`, a :class:`Task`, or a " +"Future-like object (:func:`isfuture` is used for the test.)" msgstr "" +"آرگومان *obj* را همان‌گونه که هست، اگر *obj* یک :class:`Future`، یک " +":class:`Task`، یا یک شیء شبیه Future باشد (برای آزمون از :func:`isfuture` " +"استفاده می‌شود.)" -msgid "a :class:`Task` object wrapping *obj*, if *obj* is a coroutine (:func:`iscoroutine` is used for the test); in this case the coroutine will be scheduled by ``ensure_future()``." +msgid "" +"a :class:`Task` object wrapping *obj*, if *obj* is a coroutine " +"(:func:`iscoroutine` is used for the test); in this case the coroutine will " +"be scheduled by ``ensure_future()``." msgstr "" +"یک شیء :class:`Task` که *obj* را در بر می‌گیرد، اگر *obj* یک هم‌روال باشد " +"(برای آزمون از :func:`iscoroutine` استفاده می‌شود)؛ در این حالت، هم‌روال " +"توسط ``ensure_future()`` زمان‌بندی خواهد شد." -msgid "a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:func:`inspect.isawaitable` is used for the test.)" +msgid "" +"a :class:`Task` object that would await on *obj*, if *obj* is an awaitable " +"(:func:`inspect.isawaitable` is used for the test.)" msgstr "" +"یک شیء :class:`Task` که اگر *obj* قابل await (awaitable) باشد، روی *obj* " +"await می‌کند (برای بررسی از :func:`inspect.isawaitable` استفاده می‌شود.)" msgid "If *obj* is neither of the above a :exc:`TypeError` is raised." msgstr "" +"اگر *obj* هیچ‌کدام از موارد بالا نباشد، یک :exc:`TypeError` پرتاب می‌شود." -msgid "Save a reference to the result of this function, to avoid a task disappearing mid-execution." +msgid "" +"Save a reference to the result of this function, to avoid a task " +"disappearing mid-execution." msgstr "" +"برای جلوگیری از ناپدید شدن یک وظیفه در میانه‌ی اجرا، ارجاعی به " +"نتیجه‌ی این تابع ذخیره کنید." -msgid "See also the :func:`create_task` function which is the preferred way for creating new tasks or use :class:`asyncio.TaskGroup` which keeps reference to the task internally." +msgid "" +"See also the :func:`create_task` function which is the preferred way for " +"creating new tasks or use :class:`asyncio.TaskGroup` which keeps reference " +"to the task internally." msgstr "" +"همچنین تابع :func:`create_task` را ببینید که روش ترجیحی برای ایجاد وظایف " +"جدید است، یا از :class:`asyncio.TaskGroup` استفاده کنید که ارجاعی به وظیفه را " +"به‌صورت داخلی نگه می‌دارد." msgid "The function accepts any :term:`awaitable` object." -msgstr "" +msgstr "این تابع هر شیء :term:`awaitable` را می‌پذیرد." -msgid "Deprecation warning is emitted if *obj* is not a Future-like object and *loop* is not specified and there is no running event loop." +msgid "" +"Deprecation warning is emitted if *obj* is not a Future-like object and " +"*loop* is not specified and there is no running event loop." msgstr "" +"اگر *obj* یک شیء Future-مانند نباشد و *loop* مشخص نشده باشد و هیچ حلقه " +"رویدادی در حال اجرا وجود نداشته باشد، هشدار از رده خارج شدن صادر می‌شود." -msgid "Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio.Future` object." +msgid "" +"Wrap a :class:`concurrent.futures.Future` object in a " +":class:`asyncio.Future` object." msgstr "" +"یک شیء :class:`concurrent.futures.Future` را در یک شیء " +":class:`asyncio.Future` قرار دهید." -msgid "Deprecation warning is emitted if *future* is not a Future-like object and *loop* is not specified and there is no running event loop." +msgid "" +"Deprecation warning is emitted if *future* is not a Future-like object and " +"*loop* is not specified and there is no running event loop." msgstr "" +"اگر *future* یک شیء Future-مانند نباشد و *loop* تعیین نشده باشد و هیچ حلقه " +"رویداد در حال اجرا وجود نداشته باشد، هشدار از رده خارج شدن صادر می‌شود." msgid "Future Object" -msgstr "" +msgstr "شیء Future" -msgid "A Future represents an eventual result of an asynchronous operation. Not thread-safe." +msgid "" +"A Future represents an eventual result of an asynchronous operation. Not " +"thread-safe." msgstr "" +"یک Future نتیجه نهایی یک عملیات ناهمگام را نشان می‌دهد. ایمن نسبت به نخ " +"نیست." -msgid "Future is an :term:`awaitable` object. Coroutines can await on Future objects until they either have a result or an exception set, or until they are cancelled. A Future can be awaited multiple times and the result is same." +msgid "" +"Future is an :term:`awaitable` object. Coroutines can await on Future " +"objects until they either have a result or an exception set, or until they " +"are cancelled. A Future can be awaited multiple times and the result is " +"same." msgstr "" +"Future یک شیء :term:`awaitable` است. هم‌روال‌ها می‌توانند اشیاء Future را تا" +" زمانی که یا نتیجه یا استثنا برای آن‌ها تنظیم شده باشد، یا تا زمانی که لغو " +"شوند، await کنند. یک Future را می‌توان چندین بار await کرد و نتیجه یکسان " +"است." -msgid "Typically Futures are used to enable low-level callback-based code (e.g. in protocols implemented using asyncio :ref:`transports `) to interoperate with high-level async/await code." +msgid "" +"Typically Futures are used to enable low-level callback-based code (e.g. in " +"protocols implemented using asyncio :ref:`transports `) to interoperate with high-level async/await code." msgstr "" +"به‌طور معمول از Futures استفاده می‌شود تا امکان تعامل کد سطح پایین مبتنی بر " +"کال‌بک (برای مثال، در پروتکل‌هایی که با استفاده از :ref:`transports " +"` asyncio پیاده‌سازی شده‌اند) با کد سطح بالای " +"async/await فراهم شود." -msgid "The rule of thumb is to never expose Future objects in user-facing APIs, and the recommended way to create a Future object is to call :meth:`loop.create_future`. This way alternative event loop implementations can inject their own optimized implementations of a Future object." +msgid "" +"The rule of thumb is to never expose Future objects in user-facing APIs, and" +" the recommended way to create a Future object is to call " +":meth:`loop.create_future`. This way alternative event loop implementations" +" can inject their own optimized implementations of a Future object." msgstr "" +"قاعده سرانگشتی این است که هرگز اشیای Future را در APIهای رو به کاربر در " +"معرض قرار ندهید، و روش توصیه‌شده برای ایجاد یک شیء Future، فراخوانی " +":meth:`loop.create_future` است. به این ترتیب، پیاده‌سازی‌های جایگزین حلقه " +"رویداد می‌توانند پیاده‌سازی‌های بهینه‌شده خود از شیء Future را تزریق کنند." msgid "Futures are :ref:`generic ` over the type of their results." -msgstr "" +msgstr "Futures نسبت به نوع نتایج خود :ref:`عام ` هستند." msgid "Added support for the :mod:`contextvars` module." -msgstr "" +msgstr "پشتیبانی از ماژول :mod:`contextvars` افزوده شد." -msgid "Deprecation warning is emitted if *loop* is not specified and there is no running event loop." +msgid "" +"Deprecation warning is emitted if *loop* is not specified and there is no " +"running event loop." msgstr "" +"اگر *loop* مشخص‌نشده باشد و هیچ حلقه رویدادی در حال اجرا وجود نداشته باشد، " +"هشدار از رده خارج شدن صادر می‌شود." msgid "Return the result of the Future." -msgstr "" +msgstr "نتیجه‌ی Future را برمی‌گرداند." -msgid "If the Future is *done* and has a result set by the :meth:`set_result` method, the result value is returned." +msgid "" +"If the Future is *done* and has a result set by the :meth:`set_result` " +"method, the result value is returned." msgstr "" +"اگر Future *انجام‌شده* باشد و نتیجه‌ای از طریق متد :meth:`set_result` برای " +"آن تنظیم شده باشد، مقدار نتیجه برگردانده می‌شود." -msgid "If the Future is *done* and has an exception set by the :meth:`set_exception` method, this method raises the exception." +msgid "" +"If the Future is *done* and has an exception set by the " +":meth:`set_exception` method, this method raises the exception." msgstr "" +"اگر Future *انجام‌شده* باشد و استثنایی توسط متد :meth:`set_exception` برای " +"آن تنظیم شده باشد، این متد آن استثنا را پرتاب می‌کند." -msgid "If the Future has been *cancelled*, this method raises a :exc:`CancelledError` exception." +msgid "" +"If the Future has been *cancelled*, this method raises a " +":exc:`CancelledError` exception." msgstr "" +"اگر Future *لغوشده* باشد، این متد یک استثنای :exc:`CancelledError` پرتاب " +"می‌کند." -msgid "If the Future's result isn't yet available, this method raises an :exc:`InvalidStateError` exception." +msgid "" +"If the Future's result isn't yet available, this method raises an " +":exc:`InvalidStateError` exception." msgstr "" +"اگر نتیجه‌ی Future هنوز در دسترس نباشد، این متد استثانای " +":exc:`InvalidStateError` را پرتاب می‌کند." msgid "Mark the Future as *done* and set its result." msgstr "" +"Future را به‌عنوان *انجام‌شده* علامت‌گذاری می‌کند و نتیجه‌ی آن را تنظیم " +"می‌کند." -msgid "Raises an :exc:`InvalidStateError` error if the Future is already *done*." +msgid "" +"Raises an :exc:`InvalidStateError` error if the Future is already *done*." msgstr "" +"اگر Future از قبل *انجام‌شده* باشد، خطای :exc:`InvalidStateError` را پرتاب " +"می‌کند." msgid "Mark the Future as *done* and set an exception." msgstr "" +"Future را به‌عنوان *done* علامت‌گذاری می‌کند و یک استثنا تنظیم می‌کند." msgid "Return ``True`` if the Future is *done*." -msgstr "" +msgstr "اگر Future *انجام‌شده* باشد، ``True`` برمی‌گرداند." -msgid "A Future is *done* if it was *cancelled* or if it has a result or an exception set with :meth:`set_result` or :meth:`set_exception` calls." +msgid "" +"A Future is *done* if it was *cancelled* or if it has a result or an " +"exception set with :meth:`set_result` or :meth:`set_exception` calls." msgstr "" +"یک Future در صورتی *انجام‌شده* است که *لغوشده* باشد یا نتیجه یا استثنایی با" +" فراخوانی‌های :meth:`set_result` یا :meth:`set_exception` روی آن تنظیم‌شده " +"باشد." msgid "Return ``True`` if the Future was *cancelled*." -msgstr "" +msgstr "اگر Future *لغوشده* باشد، ``True`` را برمی‌گرداند." -msgid "The method is usually used to check if a Future is not *cancelled* before setting a result or an exception for it::" +msgid "" +"The method is usually used to check if a Future is not *cancelled* before " +"setting a result or an exception for it::" msgstr "" +"این متد معمولاً برای بررسی این استفاده می‌شود که یک Future پیش از تنظیم " +"نتیجه یا استثنا برای آن *لغونشده* باشد::" msgid "" "if not fut.cancelled():\n" " fut.set_result(42)" msgstr "" +"if not fut.cancelled():\n" +" fut.set_result(42)" msgid "Add a callback to be run when the Future is *done*." -msgstr "" +msgstr "یک کال‌بک اضافه کنید تا هنگامی که Future *انجام‌شده* است اجرا شود." msgid "The *callback* is called with the Future object as its only argument." -msgstr "" +msgstr "*کال‌بک* با شیء Future به‌عنوان تنها آرگومان آن فراخوانی می‌شود." -msgid "If the Future is already *done* when this method is called, the callback is scheduled with :meth:`loop.call_soon`." +msgid "" +"If the Future is already *done* when this method is called, the callback is " +"scheduled with :meth:`loop.call_soon`." msgstr "" +"اگر Future در زمان فراخوانی این متد از قبل *انجام‌شده* باشد، کال‌بک با " +":meth:`loop.call_soon` زمان‌بندی می‌شود." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *callback* to run in. The current context is used when no *context* is provided." +msgid "" +"An optional keyword-only *context* argument allows specifying a custom " +":class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." msgstr "" +"یک آرگومان *context* اختیاری و فقط کلیدواژه‌ای به شما امکان می‌دهد یک " +":class:`contextvars.Context` سفارشی را مشخص کنید تا *callback* در آن اجرا " +"شود. هنگامی که *context* ارائه نشود، از زمینه‌ی کنونی استفاده می‌شود." -msgid ":func:`functools.partial` can be used to pass parameters to the callback, e.g.::" +msgid "" +":func:`functools.partial` can be used to pass parameters to the callback, " +"e.g.::" msgstr "" +"می‌توان از :func:`functools.partial` برای ارسال پارامترها به کال‌بک استفاده" +" کرد، برای مثال::" msgid "" "# Call 'print(\"Future:\", fut)' when \"fut\" is done.\n" "fut.add_done_callback(\n" " functools.partial(print, \"Future:\"))" msgstr "" +"# هنگامی که \"fut\" انجام شد، 'print(\"Future:\", fut)' را فراخوانی کنید.\n" +"fut.add_done_callback(\n" +" functools.partial(print, \"Future:\"))" -msgid "The *context* keyword-only parameter was added. See :pep:`567` for more details." +msgid "" +"The *context* keyword-only parameter was added. See :pep:`567` for more " +"details." msgstr "" +"پارامتر *context* که فقط کلیدواژه‌ای است، اضافه شد. برای جزئیات بیشتر، " +":pep:`567` را ببینید." msgid "Remove *callback* from the callbacks list." -msgstr "" +msgstr "*callback* را از فهرست کال‌بک‌ها حذف کنید." -msgid "Returns the number of callbacks removed, which is typically 1, unless a callback was added more than once." +msgid "" +"Returns the number of callbacks removed, which is typically 1, unless a " +"callback was added more than once." msgstr "" +"تعداد کال‌بک‌های حذف‌شده را برمی‌گرداند، که معمولاً ۱ است، مگر اینکه یک " +"کال‌بک بیش از یک بار افزوده شده باشد." msgid "Cancel the Future and schedule callbacks." -msgstr "" +msgstr "Future را لغو می‌کند و کال‌بک‌ها را زمان‌بندی می‌کند." -msgid "If the Future is already *done* or *cancelled*, return ``False``. Otherwise, change the Future's state to *cancelled*, schedule the callbacks, and return ``True``." +msgid "" +"If the Future is already *done* or *cancelled*, return ``False``. Otherwise," +" change the Future's state to *cancelled*, schedule the callbacks, and " +"return ``True``." msgstr "" +"اگر Future از قبل *done* یا *cancelled* باشد، ``False`` را برمی‌گرداند. در " +"غیر این صورت، وضعیت Future را به *cancelled* تغییر می‌دهد، کال‌بک‌ها را " +"زمان‌بندی می‌کند و ``True`` را برمی‌گرداند." -msgid "The optional string argument *msg* is passed as the argument to the :exc:`CancelledError` exception raised when a cancelled Future is awaited." +msgid "" +"The optional string argument *msg* is passed as the argument to the " +":exc:`CancelledError` exception raised when a cancelled Future is awaited." msgstr "" +"آرگومان اختیاری رشته‌ای *msg* به‌عنوان آرگومان به استثنای " +":exc:`CancelledError` ارسال می‌شود؛ این استثنا هنگامی پرتاب می‌شود که یک " +"Future لغوشده await شود." msgid "Added the *msg* parameter." -msgstr "" +msgstr "پارامتر *msg* افزوده شد." msgid "Return the exception that was set on this Future." -msgstr "" +msgstr "استثنایی را که روی این Future تنظیم شده است، برمی‌گرداند." -msgid "The exception (or ``None`` if no exception was set) is returned only if the Future is *done*." +msgid "" +"The exception (or ``None`` if no exception was set) is returned only if the " +"Future is *done*." msgstr "" +"استثنا (یا ``None`` اگر استثنایی تنظیم نشده باشد) تنها در صورتی برگردانده " +"می‌شود که Future *انجام‌شده* باشد." -msgid "If the Future isn't *done* yet, this method raises an :exc:`InvalidStateError` exception." +msgid "" +"If the Future isn't *done* yet, this method raises an " +":exc:`InvalidStateError` exception." msgstr "" +"اگر Future هنوز *انجام‌شده* نیست، این متد استثنای :exc:`InvalidStateError` " +"را پرتاب می‌کند." msgid "Return the event loop the Future object is bound to." -msgstr "" +msgstr "حلقه رویدادی را که شیء Future به آن متصل است، برمی‌گرداند." -msgid "This example creates a Future object, creates and schedules an asynchronous Task to set result for the Future, and waits until the Future has a result::" +msgid "" +"This example creates a Future object, creates and schedules an asynchronous " +"Task to set result for the Future, and waits until the Future has a result::" msgstr "" +"این مثال یک شیء Future ایجاد می‌کند، یک Task ناهمگام را ایجاد و زمان‌بندی " +"می‌کند تا نتیجه را برای Future تنظیم کند، و منتظر می‌ماند تا Future نتیجه " +"داشته باشد::" msgid "" "async def set_after(fut, delay, value):\n" @@ -231,24 +390,79 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def set_after(fut, delay, value):\n" +" # به مدت *delay* ثانیه مکث کنید.\n" +" await asyncio.sleep(delay)\n" +"\n" +" # *value* را به‌عنوان نتیجه‌ای از Future یعنی *fut* تنظیم کنید.\n" +" fut.set_result(value)\n" +"\n" +"async def main():\n" +" # حلقه رویداد جاری را دریافت کنید.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # یک شیء Future جدید ایجاد کنید.\n" +" fut = loop.create_future()\n" +"\n" +" # هم‌روال \"set_after()\" را در یک Task موازی اجرا کنید.\n" +" # ما اینجا از API سطح پایین \"loop.create_task()\" استفاده می‌کنیم زیرا\n" +" # از قبل ارجاعی به حلقه رویداد در دسترس داریم.\n" +" # در غیر این صورت می‌توانستیم فقط از \"asyncio.create_task()\" استفاده کنیم.\n" +" loop.create_task(\n" +" set_after(fut, 1, '... world'))\n" +"\n" +" print('hello ...')\n" +"\n" +" # صبر کنید تا *fut* نتیجه داشته باشد (۱ ثانیه) و آن را چاپ کنید.\n" +" print(await fut)\n" +"\n" +"asyncio.run(main())" -msgid "The Future object was designed to mimic :class:`concurrent.futures.Future`. Key differences include:" +msgid "" +"The Future object was designed to mimic :class:`concurrent.futures.Future`." +" Key differences include:" msgstr "" +"شیء Future به‌گونه‌ای طراحی شده است که از :class:`concurrent.futures.Future`" +" تقلید کند. تفاوت‌های اصلی عبارتند از:" -msgid "unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot be awaited." +msgid "" +"unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot " +"be awaited." msgstr "" +"برخلاف Futureهای asyncio، نمونه‌های :class:`concurrent.futures.Future` را " +"نمی‌توان await کرد." -msgid ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not accept the *timeout* argument." +msgid "" +":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not " +"accept the *timeout* argument." msgstr "" +":meth:`asyncio.Future.result` و :meth:`asyncio.Future.exception` آرگومان " +"*timeout* را نمی‌پذیرند." -msgid ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :exc:`InvalidStateError` exception when the Future is not *done*." +msgid "" +":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an " +":exc:`InvalidStateError` exception when the Future is not *done*." msgstr "" +":meth:`asyncio.Future.result` و :meth:`asyncio.Future.exception` زمانی که " +"Future *انجام‌شده* نباشد، استثنای :exc:`InvalidStateError` را پرتاب می‌کنند." -msgid "Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not called immediately. They are scheduled with :meth:`loop.call_soon` instead." +msgid "" +"Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not " +"called immediately. They are scheduled with :meth:`loop.call_soon` instead." msgstr "" +"کال‌بک‌های ثبت‌شده با :meth:`asyncio.Future.add_done_callback` بلافاصله " +"فراخوانی نمی‌شوند. در عوض، با :meth:`loop.call_soon` زمان‌بندی می‌شوند." -msgid "asyncio Future is not compatible with the :func:`concurrent.futures.wait` and :func:`concurrent.futures.as_completed` functions." +msgid "" +"asyncio Future is not compatible with the :func:`concurrent.futures.wait` " +"and :func:`concurrent.futures.as_completed` functions." msgstr "" +"Future در asyncio با توابع :func:`concurrent.futures.wait` و " +":func:`concurrent.futures.as_completed` سازگار نیست." -msgid ":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :meth:`concurrent.futures.Future.cancel` does not." +msgid "" +":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but " +":meth:`concurrent.futures.Future.cancel` does not." msgstr "" +":meth:`asyncio.Future.cancel` یک آرگومان اختیاری ``msg`` را می‌پذیرد، اما " +":meth:`concurrent.futures.Future.cancel` نمی‌پذیرد." diff --git a/library/asyncio-graph.po b/library/asyncio-graph.po index 34c054ae4..f1b6834d6 100644 --- a/library/asyncio-graph.po +++ b/library/asyncio-graph.po @@ -20,43 +20,91 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Call graph introspection" -msgstr "" +msgstr "درون‌نگری گراف فراخوانی" msgid "**Source code:** :source:`Lib/asyncio/graph.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/graph.py`" -msgid "asyncio has powerful runtime call graph introspection utilities to trace the entire call graph of a running *coroutine* or *task*, or a suspended *future*. These utilities and the underlying machinery can be used from within a Python program or by external profilers and debuggers." +msgid "" +"asyncio has powerful runtime call graph introspection utilities to trace the" +" entire call graph of a running *coroutine* or *task*, or a suspended " +"*future*. These utilities and the underlying machinery can be used from " +"within a Python program or by external profilers and debuggers." msgstr "" +"asyncio ابزارهای قدرتمند درون‌نگری نمودار فراخوانی در ران‌تایم دارد که برای" +" ردگیری کل نمودار فراخوانی یک *هم‌روال* یا *وظیفه* در حال اجرا، یا یک" +" *آینده* (future) معلق به کار می‌روند. می‌توان از این ابزارها و سازوکار " +"زیربنایی، از درون یک برنامه پایتون یا به‌وسیله پروفایل‌گیرها (profiler) و " +"اشکال‌زداهای خارجی استفاده کرد." msgid ":ref:`asyncio-introspection-tools`" -msgstr "" +msgstr ":ref:`asyncio-introspection-tools`" -msgid "Command-line tools for inspecting tasks in another running Python process." +msgid "" +"Command-line tools for inspecting tasks in another running Python process." msgstr "" +"ابزارهای خط فرمان برای بازرسی وظایف در فرایند پایتون دیگری که در حال اجرا " +"است." -msgid "Print the async call graph for the current task or the provided :class:`Task` or :class:`Future`." +msgid "" +"Print the async call graph for the current task or the provided " +":class:`Task` or :class:`Future`." msgstr "" +"گراف فراخوانی ناهمگام برای وظیفه فعلی یا :class:`Task` یا :class:`Future` " +"ارائه‌شده را چاپ می‌کند." -msgid "This function prints entries starting from the top frame and going down towards the invocation point." +msgid "" +"This function prints entries starting from the top frame and going down " +"towards the invocation point." msgstr "" +"این تابع مدخل‌ها را از فریم بالایی تا نقطه فراخوانی به ترتیب رو به پایین چاپ" +" می‌کند." -msgid "The function receives an optional *future* argument. If not passed, the current running task will be used." +msgid "" +"The function receives an optional *future* argument. If not passed, the " +"current running task will be used." msgstr "" +"این تابع یک آرگومان اختیاری *future* دریافت می‌کند. اگر ارسال نشود، از وظیفه " +" در حال اجرای فعلی استفاده خواهد شد." -msgid "If the function is called on *the current task*, the optional keyword-only *depth* argument can be used to skip the specified number of frames from top of the stack." +msgid "" +"If the function is called on *the current task*, the optional keyword-only " +"*depth* argument can be used to skip the specified number of frames from top" +" of the stack." msgstr "" +"اگر تابع روی *وظیفه جاری* فراخوانی شود، می‌توانید از آرگومان اختیاری و فقط " +"کلیدواژه‌ای *depth* برای رد کردن تعداد مشخصی از فریم‌ها از بالای پشته " +"استفاده کنید." -msgid "If the optional keyword-only *limit* argument is provided, each call stack in the resulting graph is truncated to include at most ``abs(limit)`` entries. If *limit* is positive, the entries left are the closest to the invocation point. If *limit* is negative, the topmost entries are left. If *limit* is omitted or ``None``, all entries are present. If *limit* is ``0``, the call stack is not printed at all, only \"awaited by\" information is printed." -msgstr "" +msgid "" +"If the optional keyword-only *limit* argument is provided, each call stack " +"in the resulting graph is truncated to include at most ``abs(limit)`` " +"entries. If *limit* is positive, the entries left are the closest to the " +"invocation point. If *limit* is negative, the topmost entries are left. If " +"*limit* is omitted or ``None``, all entries are present. If *limit* is " +"``0``, the call stack is not printed at all, only \"awaited by\" information" +" is printed." +msgstr "" +"اگر آرگومان اختیاری فقط کلیدواژه‌ای *limit* ارائه شود، هر پشته فراخوانی در " +"گراف حاصل به‌گونه‌ای کوتاه می‌شود که حداکثر شامل ``abs(limit)`` ورودی باشد. " +"اگر *limit* مثبت باشد، ورودی‌های باقی‌مانده نزدیک‌ترین ورودی‌ها به نقطه " +"فراخوانی هستند. اگر *limit* منفی باشد، بالاترین ورودی‌ها باقی می‌مانند. اگر " +"*limit* ذکر نشود یا ``None`` باشد، همه ورودی‌ها موجود خواهند بود. اگر " +"*limit* برابر ``0`` باشد، پشته فراخوانی اصلاً چاپ نمی‌شود و فقط اطلاعات " +"«awaited by» چاپ می‌شود." -msgid "If *file* is omitted or ``None``, the function will print to :data:`sys.stdout`." +msgid "" +"If *file* is omitted or ``None``, the function will print to " +":data:`sys.stdout`." msgstr "" +"اگر *file* حذف شود یا ``None`` باشد، تابع در :data:`sys.stdout` چاپ خواهد " +"کرد." msgid "**Example:**" -msgstr "" +msgstr "**مثال:**" msgid "The following Python code:" -msgstr "" +msgstr "کد پایتون زیر:" msgid "" "import asyncio\n" @@ -70,9 +118,19 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def test():\n" +" asyncio.print_call_graph()\n" +"\n" +"async def main():\n" +" async with asyncio.TaskGroup() as g:\n" +" g.create_task(test(), name='test')\n" +"\n" +"asyncio.run(main())" msgid "will print::" -msgstr "" +msgstr "چاپ خواهد شد::" msgid "" "* Task(name='test', id=0x1039f0fe0)\n" @@ -84,51 +142,106 @@ msgid "" " | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n" " | File 't2.py', line 7, in async main()" msgstr "" +"* Task(name='test', id=0x1039f0fe0)\n" +"+ Call stack:\n" +"| File 't2.py', line 4, in async test()\n" +"+ Awaited by:\n" +" * Task(name='Task-1', id=0x103a5e060)\n" +" + Call stack:\n" +" | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n" +" | File 't2.py', line 7, in async main()" -msgid "Like :func:`print_call_graph`, but returns a string. If *future* is ``None`` and there's no current task, the function returns an empty string." +msgid "" +"Like :func:`print_call_graph`, but returns a string. If *future* is ``None``" +" and there's no current task, the function returns an empty string." msgstr "" +"مانند :func:`print_call_graph`، اما یک رشته برمی‌گرداند. اگر *future* برابر " +"``None`` باشد و هیچ وظیفه جاری‌ای وجود نداشته باشد، تابع یک رشته خالی " +"برمی‌گرداند." -msgid "Capture the async call graph for the current task or the provided :class:`Task` or :class:`Future`." +msgid "" +"Capture the async call graph for the current task or the provided " +":class:`Task` or :class:`Future`." msgstr "" +"گراف فراخوانی ناهمگام برای وظیفه جاری یا :class:`Task` یا :class:`Future` " +"ارائه‌شده را ضبط کنید." -msgid "The function receives an optional *future* argument. If not passed, the current running task will be used. If there's no current task, the function returns ``None``." +msgid "" +"The function receives an optional *future* argument. If not passed, the " +"current running task will be used. If there's no current task, the function " +"returns ``None``." msgstr "" +"این تابع یک آرگومان اختیاری *future* دریافت می‌کند. اگر ارسال نشود، از وظیفه " +"در حال اجرای فعلی استفاده می‌شود. اگر وظیفه فعلی وجود نداشته باشد، تابع " +"``None`` را برمی‌گرداند." msgid "Returns a ``FutureCallGraph`` data class object:" -msgstr "" +msgstr "یک شیء از دیتاکلاس ``FutureCallGraph`` برمی‌گرداند:" msgid "``FutureCallGraph(future, call_stack, awaited_by)``" -msgstr "" +msgstr "``FutureCallGraph(future, call_stack, awaited_by)``" -msgid "Where *future* is a reference to a :class:`Future` or a :class:`Task` (or their subclasses.)" +msgid "" +"Where *future* is a reference to a :class:`Future` or a :class:`Task` (or " +"their subclasses.)" msgstr "" +"که در آن *future* ارجاعی به یک :class:`Future` یا :class:`Task` (یا " +"زیرکلاس‌های آن‌ها) است." msgid "``call_stack`` is a tuple of ``FrameCallGraphEntry`` objects." -msgstr "" +msgstr "``call_stack`` یک تاپل از اشیای ``FrameCallGraphEntry`` است." msgid "``awaited_by`` is a tuple of ``FutureCallGraph`` objects." -msgstr "" +msgstr "``awaited_by`` تاپلی از اشیای ``FutureCallGraph`` است." msgid "``FrameCallGraphEntry(frame)``" -msgstr "" +msgstr "``FrameCallGraphEntry(frame)``" -msgid "Where *frame* is a frame object of a regular Python function in the call stack." +msgid "" +"Where *frame* is a frame object of a regular Python function in the call " +"stack." msgstr "" +"که در آن *frame* یک شیء فریم (frame object) از یک تابع معمولی پایتون در پشته" +" فراخوانی است." msgid "Low level utility functions" -msgstr "" +msgstr "توابع سودمند سطح پایین" -msgid "To introspect an async call graph asyncio requires cooperation from control flow structures, such as :func:`shield` or :class:`TaskGroup`. Any time an intermediate :class:`Future` object with low-level APIs like :meth:`Future.add_done_callback() ` is involved, the following two functions should be used to inform asyncio about how exactly such intermediate future objects are connected with the tasks they wrap or control." -msgstr "" +msgid "" +"To introspect an async call graph asyncio requires cooperation from control " +"flow structures, such as :func:`shield` or :class:`TaskGroup`. Any time an " +"intermediate :class:`Future` object with low-level APIs like " +":meth:`Future.add_done_callback() ` is " +"involved, the following two functions should be used to inform asyncio about" +" how exactly such intermediate future objects are connected with the tasks " +"they wrap or control." +msgstr "" +"برای درون‌نگری گراف فراخوانی ناهمگام، asyncio به همکاری ساختارهای کنترل " +"جریان، مانند :func:`shield` یا :class:`TaskGroup` نیاز دارد. هر زمان که یک " +"شیء میانی :class:`Future` با APIهای سطح پایین مانند " +":meth:`Future.add_done_callback() ` دخیل " +"باشد، باید از دو تابع زیر استفاده کنید تا asyncio را از چگونگی دقیق اتصال " +"چنین اشیای میانی Future به تسک‌هایی که آن‌ها را پوشش می‌دهند یا کنترل " +"می‌کنند مطلع کنید." msgid "Record that *future* is awaited on by *waiter*." -msgstr "" +msgstr "ثبت می‌کند که *future* توسط *waiter* await می‌شود." -msgid "Both *future* and *waiter* must be instances of :class:`Future` or :class:`Task` or their subclasses, otherwise the call would have no effect." +msgid "" +"Both *future* and *waiter* must be instances of :class:`Future` or " +":class:`Task` or their subclasses, otherwise the call would have no effect." msgstr "" +"هر دو *future* و *waiter* باید نمونه‌هایی از :class:`Future` یا " +":class:`Task` یا زیرکلاس‌های آن‌ها باشند، در غیر این صورت این فراخوانی هیچ " +"اثری نخواهد داشت." -msgid "A call to ``future_add_to_awaited_by()`` must be followed by an eventual call to the :func:`future_discard_from_awaited_by` function with the same arguments." +msgid "" +"A call to ``future_add_to_awaited_by()`` must be followed by an eventual " +"call to the :func:`future_discard_from_awaited_by` function with the same " +"arguments." msgstr "" +"فراخوانی ``future_add_to_awaited_by()`` باید در نهایت با فراخوانی تابع " +":func:`future_discard_from_awaited_by` با همان آرگومان‌ها دنبال شود." msgid "Record that *future* is no longer awaited on by *waiter*." -msgstr "" +msgstr "ثبت کنید که *future* دیگر توسط *waiter* await نمی‌شود." diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index adf3042f9..fdc2b662b 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -25,715 +25,843 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Low-level API Index" -msgstr "" +msgstr "اندیس API سطح پایین" msgid "This page lists all low-level asyncio APIs." -msgstr "" +msgstr "این صفحه همه‌ی APIهای سطح پایین asyncio را فهرست می‌کند." msgid "Obtaining the Event Loop" -msgstr "" +msgstr "به دست آوردن حلقه رویداد" msgid ":func:`asyncio.get_running_loop`" -msgstr "" +msgstr ":func:`asyncio.get_running_loop`" msgid "The **preferred** function to get the running event loop." -msgstr "" +msgstr "تابع **ارجح** برای دریافت حلقه رویداد در حال اجرا." msgid ":func:`asyncio.get_event_loop`" -msgstr "" +msgstr ":func:`asyncio.get_event_loop`" -msgid "Get an event loop instance (running or current via the current policy)." +msgid "" +"Get an event loop instance (running or current via the current policy)." msgstr "" +"نمونه‌ای از حلقه رویداد را دریافت کنید (در حال اجرا یا جاری از طریق سیاست " +"جاری)." msgid ":func:`asyncio.set_event_loop`" -msgstr "" +msgstr ":func:`asyncio.set_event_loop`" msgid "Set the event loop as current via the current policy." -msgstr "" +msgstr "حلقه رویداد را از طریق سیاست جاری به‌عنوان حلقه جاری تنظیم کنید." msgid ":func:`asyncio.new_event_loop`" -msgstr "" +msgstr ":func:`asyncio.new_event_loop`" msgid "Create a new event loop." -msgstr "" +msgstr "یک حلقه رویداد جدید ایجاد کنید." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid ":ref:`Using asyncio.get_running_loop() `." msgstr "" +":ref:`استفاده از asyncio.get_running_loop() `." msgid "Event Loop Methods" -msgstr "" +msgstr "متدهای حلقه رویداد" -msgid "See also the main documentation section about the :ref:`asyncio-event-loop-methods`." +msgid "" +"See also the main documentation section about the :ref:`asyncio-event-loop-" +"methods`." msgstr "" +"همچنین بخش اصلی مستندات درباره :ref:`asyncio-event-loop-methods` را ببینید." msgid "Lifecycle" -msgstr "" +msgstr "چرخه حیات" msgid ":meth:`loop.run_until_complete`" -msgstr "" +msgstr ":meth:`loop.run_until_complete`" msgid "Run a Future/Task/awaitable until complete." -msgstr "" +msgstr "یک Future/Task/awaitable را تا کامل شدن اجرا کنید." msgid ":meth:`loop.run_forever`" -msgstr "" +msgstr ":meth:`loop.run_forever`" msgid "Run the event loop forever." -msgstr "" +msgstr "حلقه رویداد را برای همیشه اجرا می‌کند." msgid ":meth:`loop.stop`" -msgstr "" +msgstr ":meth:`loop.stop`" msgid "Stop the event loop." -msgstr "" +msgstr "حلقه رویداد را متوقف می‌کند." msgid ":meth:`loop.close`" -msgstr "" +msgstr ":meth:`loop.close`" msgid "Close the event loop." -msgstr "" +msgstr "حلقه رویداد را ببندید." msgid ":meth:`loop.is_running`" -msgstr "" +msgstr ":meth:`loop.is_running`" msgid "Return ``True`` if the event loop is running." -msgstr "" +msgstr "اگر حلقه رویداد در حال اجرا باشد، ``True`` را برمی‌گرداند." msgid ":meth:`loop.is_closed`" -msgstr "" +msgstr ":meth:`loop.is_closed`" msgid "Return ``True`` if the event loop is closed." -msgstr "" +msgstr "اگر حلقه رویداد بسته باشد، ``True`` را برمی‌گرداند." msgid "``await`` :meth:`loop.shutdown_asyncgens`" -msgstr "" +msgstr "``await`` :meth:`loop.shutdown_asyncgens`" msgid "Close asynchronous generators." -msgstr "" +msgstr "تولیدگرهای ناهمگام را ببندید." msgid "Debugging" -msgstr "" +msgstr "اشکال‌زدایی" msgid ":meth:`loop.set_debug`" -msgstr "" +msgstr ":meth:`loop.set_debug`" msgid "Enable or disable the debug mode." -msgstr "" +msgstr "فعال یا غیرفعال کردن حالت اشکال‌زدایی." msgid ":meth:`loop.get_debug`" -msgstr "" +msgstr ":meth:`loop.get_debug`" msgid "Get the current debug mode." -msgstr "" +msgstr "دریافت حالت اشکال‌زدایی فعلی." msgid "Scheduling Callbacks" -msgstr "" +msgstr "زمان‌بندی کال‌بک‌ها" msgid ":meth:`loop.call_soon`" -msgstr "" +msgstr ":meth:`loop.call_soon`" msgid "Invoke a callback soon." -msgstr "" +msgstr "یک کال‌بک را به‌زودی فراخوانی کنید." msgid ":meth:`loop.call_soon_threadsafe`" -msgstr "" +msgstr ":meth:`loop.call_soon_threadsafe`" msgid "A thread-safe variant of :meth:`loop.call_soon`." -msgstr "" +msgstr "گونه‌ای ایمن از نظر نخ‌ها (thread-safe) از :meth:`loop.call_soon`." msgid ":meth:`loop.call_later`" -msgstr "" +msgstr ":meth:`loop.call_later`" msgid "Invoke a callback *after* the given time." -msgstr "" +msgstr "یک کال‌بک را *پس از* زمان داده‌شده فراخوانی کنید." msgid ":meth:`loop.call_at`" -msgstr "" +msgstr ":meth:`loop.call_at`" msgid "Invoke a callback *at* the given time." -msgstr "" +msgstr "یک کال‌بک را *در* زمان داده‌شده فراخوانی کنید." msgid "Thread/Interpreter/Process Pool" -msgstr "" +msgstr "استخر نخ/مفسر/فرایند" msgid "``await`` :meth:`loop.run_in_executor`" -msgstr "" +msgstr "``await`` :meth:`loop.run_in_executor`" -msgid "Run a CPU-bound or other blocking function in a :mod:`concurrent.futures` executor." +msgid "" +"Run a CPU-bound or other blocking function in a :mod:`concurrent.futures` " +"executor." msgstr "" +"یک تابع محدود به CPU یا یک تابع مسدودکننده دیگر را در یک اجراکننده " +"(executor) از :mod:`concurrent.futures` اجرا کنید." msgid ":meth:`loop.set_default_executor`" -msgstr "" +msgstr ":meth:`loop.set_default_executor`" msgid "Set the default executor for :meth:`loop.run_in_executor`." -msgstr "" +msgstr "اجراکننده‌ی پیش‌فرض را برای :meth:`loop.run_in_executor` تنظیم کنید." msgid "Tasks and Futures" -msgstr "" +msgstr "وظایف و آینده‌نماها (Tasks and Futures)" msgid ":meth:`loop.create_future`" -msgstr "" +msgstr ":meth:`loop.create_future`" msgid "Create a :class:`Future` object." -msgstr "" +msgstr "یک شیء :class:`Future` ایجاد کنید." msgid ":meth:`loop.create_task`" -msgstr "" +msgstr ":meth:`loop.create_task`" msgid "Schedule coroutine as a :class:`Task`." -msgstr "" +msgstr "هم‌روال را به‌عنوان یک :class:`Task` زمان‌بندی کنید." msgid ":meth:`loop.set_task_factory`" -msgstr "" +msgstr ":meth:`loop.set_task_factory`" -msgid "Set a factory used by :meth:`loop.create_task` to create :class:`Tasks `." +msgid "" +"Set a factory used by :meth:`loop.create_task` to create :class:`Tasks " +"`." msgstr "" +"کارخانه‌ای را تنظیم کنید که :meth:`loop.create_task` برای ایجاد " +":class:`Tasks ` از آن استفاده می‌کند." msgid ":meth:`loop.get_task_factory`" -msgstr "" +msgstr ":meth:`loop.get_task_factory`" -msgid "Get the factory :meth:`loop.create_task` uses to create :class:`Tasks `." +msgid "" +"Get the factory :meth:`loop.create_task` uses to create :class:`Tasks " +"`." msgstr "" +"کارخانه‌ای را که :meth:`loop.create_task` برای ایجاد :class:`Tasks ` " +"استفاده می‌کند، دریافت کنید." msgid "DNS" -msgstr "" +msgstr "DNS" msgid "``await`` :meth:`loop.getaddrinfo`" -msgstr "" +msgstr "``await`` :meth:`loop.getaddrinfo`" msgid "Asynchronous version of :meth:`socket.getaddrinfo`." -msgstr "" +msgstr "نسخه‌ی ناهمگام از :meth:`socket.getaddrinfo`." msgid "``await`` :meth:`loop.getnameinfo`" -msgstr "" +msgstr "``await`` :meth:`loop.getnameinfo`" msgid "Asynchronous version of :meth:`socket.getnameinfo`." -msgstr "" +msgstr "نسخه‌ی ناهمگام :meth:`socket.getnameinfo`." msgid "Networking and IPC" -msgstr "" +msgstr "شبکه‌سازی و ارتباط بین‌فرایندی (IPC)" msgid "``await`` :meth:`loop.create_connection`" -msgstr "" +msgstr "``await`` :meth:`loop.create_connection`" msgid "Open a TCP connection." -msgstr "" +msgstr "یک اتصال TCP باز کنید." msgid "``await`` :meth:`loop.create_server`" -msgstr "" +msgstr "``await`` :meth:`loop.create_server`" msgid "Create a TCP server." -msgstr "" +msgstr "یک سرور TCP ایجاد کنید." msgid "``await`` :meth:`loop.create_unix_connection`" -msgstr "" +msgstr "``await`` :meth:`loop.create_unix_connection`" msgid "Open a Unix socket connection." -msgstr "" +msgstr "باز کردن یک اتصال سوکت یونیکس." msgid "``await`` :meth:`loop.create_unix_server`" -msgstr "" +msgstr "``await`` :meth:`loop.create_unix_server`" msgid "Create a Unix socket server." -msgstr "" +msgstr "یک سرور سوکت یونیکس ایجاد کنید." msgid "``await`` :meth:`loop.connect_accepted_socket`" -msgstr "" +msgstr "``await`` :meth:`loop.connect_accepted_socket`" msgid "Wrap a :class:`~socket.socket` into a ``(transport, protocol)`` pair." msgstr "" +"یک :class:`~socket.socket` را در یک جفت ``(transport, protocol)`` قرار دهید." msgid "``await`` :meth:`loop.create_datagram_endpoint`" -msgstr "" +msgstr "``await`` :meth:`loop.create_datagram_endpoint`" msgid "Open a datagram (UDP) connection." -msgstr "" +msgstr "باز کردن یک اتصال دیتاگرام (UDP)." msgid "``await`` :meth:`loop.sendfile`" -msgstr "" +msgstr "``await`` :meth:`loop.sendfile`" msgid "Send a file over a transport." -msgstr "" +msgstr "ارسال یک فایل از طریق یک انتقال ." msgid "``await`` :meth:`loop.start_tls`" -msgstr "" +msgstr "``await`` :meth:`loop.start_tls`" msgid "Upgrade an existing connection to TLS." -msgstr "" +msgstr "ارتقای یک اتصال موجود به TLS." msgid "``await`` :meth:`loop.connect_read_pipe`" -msgstr "" +msgstr "``await`` :meth:`loop.connect_read_pipe`" msgid "Wrap a read end of a pipe into a ``(transport, protocol)`` pair." msgstr "" +"انتهای خواندنی یک پایپ را در قالب یک جفت ``(transport, protocol)`` بپیچید." msgid "``await`` :meth:`loop.connect_write_pipe`" -msgstr "" +msgstr "``await`` :meth:`loop.connect_write_pipe`" msgid "Wrap a write end of a pipe into a ``(transport, protocol)`` pair." msgstr "" +"انتهای نوشتنی یک پایپ را به‌صورت یک جفت ``(transport, protocol)`` درآورید." msgid "Sockets" -msgstr "" +msgstr "سوکت‌ها" msgid "``await`` :meth:`loop.sock_recv`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recv`" msgid "Receive data from the :class:`~socket.socket`." -msgstr "" +msgstr "داده را از :class:`~socket.socket` دریافت کنید." msgid "``await`` :meth:`loop.sock_recv_into`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recv_into`" msgid "Receive data from the :class:`~socket.socket` into a buffer." -msgstr "" +msgstr "داده را از :class:`~socket.socket` در یک بافر دریافت کنید." msgid "``await`` :meth:`loop.sock_recvfrom`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recvfrom`" msgid "Receive a datagram from the :class:`~socket.socket`." -msgstr "" +msgstr "یک دیتاگرام را از :class:`~socket.socket` دریافت کنید." msgid "``await`` :meth:`loop.sock_recvfrom_into`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_recvfrom_into`" msgid "Receive a datagram from the :class:`~socket.socket` into a buffer." -msgstr "" +msgstr "یک دیتاگرام را از :class:`~socket.socket` در یک بافر دریافت کنید." msgid "``await`` :meth:`loop.sock_sendall`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_sendall`" msgid "Send data to the :class:`~socket.socket`." -msgstr "" +msgstr "داده را به :class:`~socket.socket` ارسال کنید." msgid "``await`` :meth:`loop.sock_sendto`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_sendto`" msgid "Send a datagram via the :class:`~socket.socket` to the given address." msgstr "" +"یک دیتاگرام را از طریق :class:`~socket.socket` به نشانی داده‌شده ارسال کنید." msgid "``await`` :meth:`loop.sock_connect`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_connect`" msgid "Connect the :class:`~socket.socket`." -msgstr "" +msgstr "اتصال :class:`~socket.socket`." msgid "``await`` :meth:`loop.sock_accept`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_accept`" msgid "Accept a :class:`~socket.socket` connection." -msgstr "" +msgstr "یک اتصال :class:`~socket.socket` را می‌پذیرد." msgid "``await`` :meth:`loop.sock_sendfile`" -msgstr "" +msgstr "``await`` :meth:`loop.sock_sendfile`" msgid "Send a file over the :class:`~socket.socket`." -msgstr "" +msgstr "یک فایل را از طریق :class:`~socket.socket` ارسال کنید." msgid ":meth:`loop.add_reader`" -msgstr "" +msgstr ":meth:`loop.add_reader`" msgid "Start watching a file descriptor for read availability." -msgstr "" +msgstr "آغاز پایش یک توصیف‌گر فایل برای دسترس‌پذیری جهت خواندن." msgid ":meth:`loop.remove_reader`" -msgstr "" +msgstr ":meth:`loop.remove_reader`" msgid "Stop watching a file descriptor for read availability." msgstr "" +"پایش یک توصیف‌گر فایل (file descriptor) را برای دسترس‌پذیری جهت خواندن " +"متوقف کنید." msgid ":meth:`loop.add_writer`" -msgstr "" +msgstr ":meth:`loop.add_writer`" msgid "Start watching a file descriptor for write availability." -msgstr "" +msgstr "شروع به پایش یک توصیف‌گر فایل برای آمادگی نوشتن کنید." msgid ":meth:`loop.remove_writer`" -msgstr "" +msgstr ":meth:`loop.remove_writer`" msgid "Stop watching a file descriptor for write availability." -msgstr "" +msgstr "پایش یک توصیف‌گر فایل از نظر دسترس‌پذیری برای نوشتن را متوقف کنید." msgid "Unix Signals" -msgstr "" +msgstr "سیگنال‌های یونیکس" msgid ":meth:`loop.add_signal_handler`" -msgstr "" +msgstr ":meth:`loop.add_signal_handler`" msgid "Add a handler for a :mod:`signal`." -msgstr "" +msgstr "افزودن یک هندلر برای :mod:`signal`." msgid ":meth:`loop.remove_signal_handler`" -msgstr "" +msgstr ":meth:`loop.remove_signal_handler`" msgid "Remove a handler for a :mod:`signal`." -msgstr "" +msgstr "حذف یک هندلر برای :mod:`signal`." msgid "Subprocesses" -msgstr "" +msgstr "زیرفرایندها" msgid ":meth:`loop.subprocess_exec`" -msgstr "" +msgstr ":meth:`loop.subprocess_exec`" msgid "Spawn a subprocess." -msgstr "" +msgstr "راه‌اندازی یک زیرفرایند." msgid ":meth:`loop.subprocess_shell`" -msgstr "" +msgstr ":meth:`loop.subprocess_shell`" msgid "Spawn a subprocess from a shell command." -msgstr "" +msgstr "راه‌اندازی یک زیرفرایند از طریق یک دستور پوسته." msgid "Error Handling" -msgstr "" +msgstr "مدیریت خطا" msgid ":meth:`loop.call_exception_handler`" -msgstr "" +msgstr ":meth:`loop.call_exception_handler`" msgid "Call the exception handler." -msgstr "" +msgstr "مدیر استثنا را فراخوانی کنید." msgid ":meth:`loop.set_exception_handler`" -msgstr "" +msgstr ":meth:`loop.set_exception_handler`" msgid "Set a new exception handler." -msgstr "" +msgstr "یک هندلری جدید استثنا تنظیم کنید." msgid ":meth:`loop.get_exception_handler`" -msgstr "" +msgstr ":meth:`loop.get_exception_handler`" msgid "Get the current exception handler." -msgstr "" +msgstr "دریافت هندلر استثنای فعلی." msgid ":meth:`loop.default_exception_handler`" -msgstr "" +msgstr ":meth:`loop.default_exception_handler`" msgid "The default exception handler implementation." -msgstr "" +msgstr "پیاده‌سازی هندلر استثنای پیش‌فرض." -msgid ":ref:`Using asyncio.new_event_loop() and loop.run_forever() `." +msgid "" +":ref:`Using asyncio.new_event_loop() and loop.run_forever() " +"`." msgstr "" +":ref:`استفاده از asyncio.new_event_loop() و loop.run_forever() " +"`." msgid ":ref:`Using loop.call_later() `." -msgstr "" +msgstr ":ref:`استفاده از loop.call_later() `." -msgid "Using ``loop.create_connection()`` to implement :ref:`an echo-client `." +msgid "" +"Using ``loop.create_connection()`` to implement :ref:`an echo-client " +"`." msgstr "" +"استفاده از ``loop.create_connection()`` برای پیاده‌سازی :ref:`یک کلاینت اکو " +"`." -msgid "Using ``loop.create_connection()`` to :ref:`connect a socket `." +msgid "" +"Using ``loop.create_connection()`` to :ref:`connect a socket " +"`." msgstr "" +"استفاده از ``loop.create_connection()`` برای :ref:`اتصال یک سوکت " +"`." -msgid ":ref:`Using add_reader() to watch an FD for read events `." +msgid "" +":ref:`Using add_reader() to watch an FD for read events " +"`." msgstr "" +":ref:`استفاده از add_reader() برای پایش یک FD برای رویدادهای خواندن " +"`." msgid ":ref:`Using loop.add_signal_handler() `." msgstr "" +":ref:`استفاده از loop.add_signal_handler() `." -msgid ":ref:`Using loop.subprocess_exec() `." +msgid "" +":ref:`Using loop.subprocess_exec() `." msgstr "" +":ref:`استفاده از loop.subprocess_exec() `." msgid "Transports" -msgstr "" +msgstr "انتقال‌ها" msgid "All transports implement the following methods:" -msgstr "" +msgstr "تمام ترابری‌هامتدهای زیر را پیاده‌سازی می‌کنند:" msgid ":meth:`transport.close() `" -msgstr "" +msgstr ":meth:`transport.close() `" msgid "Close the transport." -msgstr "" +msgstr "انتقالرا ببندید." msgid ":meth:`transport.is_closing() `" -msgstr "" +msgstr ":meth:`transport.is_closing() `" msgid "Return ``True`` if the transport is closing or is closed." msgstr "" +"اگر انتقالدر حال بسته شدن یا بسته باشد، ``True`` برمی‌گرداند." msgid ":meth:`transport.get_extra_info() `" -msgstr "" +msgstr ":meth:`transport.get_extra_info() `" msgid "Request for information about the transport." -msgstr "" +msgstr "درخواست اطلاعات درباره‌ی انتقال ." msgid ":meth:`transport.set_protocol() `" -msgstr "" +msgstr ":meth:`transport.set_protocol() `" msgid "Set a new protocol." -msgstr "" +msgstr "یک پروتکل جدید را تنظیم کنید." msgid ":meth:`transport.get_protocol() `" -msgstr "" +msgstr ":meth:`transport.get_protocol() `" msgid "Return the current protocol." -msgstr "" +msgstr "پروتکل جاری را برمی‌گرداند." -msgid "Transports that can receive data (TCP and Unix connections, pipes, etc). Returned from methods like :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" +msgid "" +"Transports that can receive data (TCP and Unix connections, pipes, etc). " +"Returned from methods like :meth:`loop.create_connection`, " +":meth:`loop.create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" msgstr "" +"انتقال‌دهنده‌هاییکه می‌توانند داده دریافت کنند (اتصال‌های TCP " +"و Unix، پایپ‌ها و غیره). از متدهایی مانند :meth:`loop.create_connection`، " +":meth:`loop.create_unix_connection`، :meth:`loop.connect_read_pipe` و غیره " +"بازگشت داده می‌شوند:" msgid "Read Transports" -msgstr "" +msgstr "ترابردهای خواندنی" msgid ":meth:`transport.is_reading() `" -msgstr "" +msgstr ":meth:`transport.is_reading() `" msgid "Return ``True`` if the transport is receiving." -msgstr "" +msgstr "اگر انتقالدر حال دریافت باشد، ``True`` برمی‌گرداند." msgid ":meth:`transport.pause_reading() `" -msgstr "" +msgstr ":meth:`transport.pause_reading() `" msgid "Pause receiving." -msgstr "" +msgstr "دریافت را موقتاً متوقف کنید." msgid ":meth:`transport.resume_reading() `" -msgstr "" +msgstr ":meth:`transport.resume_reading() `" msgid "Resume receiving." -msgstr "" +msgstr "دریافت را از سر بگیرید." -msgid "Transports that can Send data (TCP and Unix connections, pipes, etc). Returned from methods like :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" +msgid "" +"Transports that can Send data (TCP and Unix connections, pipes, etc). " +"Returned from methods like :meth:`loop.create_connection`, " +":meth:`loop.create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" msgstr "" +"انتقال‌هایی که می‌توانند داده ارسال کنند (اتصالات TCP و Unix، پایپ‌ها و " +"غیره). از متدهایی مانند :meth:`loop.create_connection`، " +":meth:`loop.create_unix_connection`، :meth:`loop.connect_write_pipe` و غیره " +"برگردانده می‌شوند:" msgid "Write Transports" -msgstr "" +msgstr "انتقال‌های نوشتن (Write Transports)" msgid ":meth:`transport.write() `" -msgstr "" +msgstr ":meth:`transport.write() `" msgid "Write data to the transport." -msgstr "" +msgstr "داده‌ها را در انتقالبنویسید." msgid ":meth:`transport.writelines() `" -msgstr "" +msgstr ":meth:`transport.writelines() `" msgid "Write buffers to the transport." -msgstr "" +msgstr "بافرها را به انتقال بنویسید." msgid ":meth:`transport.can_write_eof() `" -msgstr "" +msgstr ":meth:`transport.can_write_eof() `" msgid "Return :const:`True` if the transport supports sending EOF." msgstr "" +"اگر انتقالاز ارسال EOF پشتیبانی کند، :const:`True` را " +"برمی‌گرداند." msgid ":meth:`transport.write_eof() `" -msgstr "" +msgstr ":meth:`transport.write_eof() `" msgid "Close and send EOF after flushing buffered data." -msgstr "" +msgstr "بستن و ارسال EOF پس از تخلیه‌ی داده‌های بافرشده." msgid ":meth:`transport.abort() `" -msgstr "" +msgstr ":meth:`transport.abort() `" msgid "Close the transport immediately." -msgstr "" +msgstr "انتقالرا بلافاصله ببندید." -msgid ":meth:`transport.get_write_buffer_size() `" +msgid "" +":meth:`transport.get_write_buffer_size() " +"`" msgstr "" +":meth:`transport.get_write_buffer_size() " +"`" msgid "Return the current size of the output buffer." -msgstr "" +msgstr "اندازه‌ی فعلی بافر خروجی را برمی‌گرداند." -msgid ":meth:`transport.get_write_buffer_limits() `" +msgid "" +":meth:`transport.get_write_buffer_limits() " +"`" msgstr "" +":meth:`transport.get_write_buffer_limits() " +"`" msgid "Return high and low water marks for write flow control." msgstr "" +"حد آستانه‌های بالا و پایین (high and low water marks) برای کنترل جریان نوشتن" +" را برمی‌گرداند." -msgid ":meth:`transport.set_write_buffer_limits() `" +msgid "" +":meth:`transport.set_write_buffer_limits() " +"`" msgstr "" +":meth:`transport.set_write_buffer_limits() " +"`" msgid "Set new high and low water marks for write flow control." -msgstr "" +msgstr "آستانه‌های بالا و پایین جدید را برای کنترل جریان نوشتن تنظیم کنید." msgid "Transports returned by :meth:`loop.create_datagram_endpoint`:" msgstr "" +"انتقال‌هایبرگردانده‌شده توسط " +":meth:`loop.create_datagram_endpoint`:" msgid "Datagram Transports" -msgstr "" +msgstr "انتقال‌های دیتاگرام (Datagram Transports)" msgid ":meth:`transport.sendto() `" -msgstr "" +msgstr ":meth:`transport.sendto() `" msgid "Send data to the remote peer." -msgstr "" +msgstr "داده‌ها را به همتای راه‌دور ارسال کنید." msgid ":meth:`transport.abort() `" -msgstr "" +msgstr ":meth:`transport.abort() `" -msgid "Low-level transport abstraction over subprocesses. Returned by :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell`:" +msgid "" +"Low-level transport abstraction over subprocesses. Returned by " +":meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell`:" msgstr "" +"انتزاع انتقالسطح پایین بر روی زیرفرایندها. توسط " +":meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell` برگردانده " +"می‌شود:" msgid "Subprocess Transports" -msgstr "" +msgstr "ترابری‌های زیرفرآیند" msgid ":meth:`transport.get_pid() `" -msgstr "" +msgstr ":meth:`transport.get_pid() `" msgid "Return the subprocess process id." -msgstr "" +msgstr "شناسه‌ی فرایند زیرفرایند را بازمی‌گرداند." -msgid ":meth:`transport.get_pipe_transport() `" +msgid "" +":meth:`transport.get_pipe_transport() " +"`" msgstr "" +":meth:`transport.get_pipe_transport() " +"`" -msgid "Return the transport for the requested communication pipe (*stdin*, *stdout*, or *stderr*)." +msgid "" +"Return the transport for the requested communication pipe (*stdin*, " +"*stdout*, or *stderr*)." msgstr "" +"انتقال برای پایپ ارتباطی درخواست‌شده (*stdin*، *stdout* یا " +"*stderr*) را برمی‌گرداند." -msgid ":meth:`transport.get_returncode() `" +msgid "" +":meth:`transport.get_returncode() `" msgstr "" +":meth:`transport.get_returncode() `" msgid "Return the subprocess return code." -msgstr "" +msgstr "کد بازگشتی زیرفرایند را برمی‌گرداند." msgid ":meth:`transport.kill() `" -msgstr "" +msgstr ":meth:`transport.kill() `" msgid "Kill the subprocess." -msgstr "" +msgstr "زیرفرایند را بکشید." msgid ":meth:`transport.send_signal() `" -msgstr "" +msgstr ":meth:`transport.send_signal() `" msgid "Send a signal to the subprocess." -msgstr "" +msgstr "سیگنالی به زیرفرایند ارسال کنید." msgid ":meth:`transport.terminate() `" -msgstr "" +msgstr ":meth:`transport.terminate() `" msgid "Stop the subprocess." -msgstr "" +msgstr "زیرفرایند را متوقف کنید." msgid ":meth:`transport.close() `" -msgstr "" +msgstr ":meth:`transport.close() `" msgid "Kill the subprocess and close all pipes." -msgstr "" +msgstr "زیرفرایند را خاتمه دهید و تمام پایپ‌ها را ببندید." msgid "Protocols" -msgstr "" +msgstr "پروتکل‌ها" msgid "Protocol classes can implement the following **callback methods**:" -msgstr "" +msgstr "کلاس‌های پروتکل می‌توانند **متدهای کال‌بک** زیر را پیاده‌سازی کنند:" msgid "``callback`` :meth:`connection_made() `" -msgstr "" +msgstr "``callback`` :meth:`connection_made() `" msgid "Called when a connection is made." -msgstr "" +msgstr "هنگامی که یک اتصال برقرار می‌شود، فراخوانی می‌شود." msgid "``callback`` :meth:`connection_lost() `" -msgstr "" +msgstr "``callback`` :meth:`connection_lost() `" msgid "Called when the connection is lost or closed." -msgstr "" +msgstr "هنگامی که اتصال قطع یا بسته می‌شود، فراخوانی می‌شود." msgid "``callback`` :meth:`pause_writing() `" -msgstr "" +msgstr "``callback`` :meth:`pause_writing() `" msgid "Called when the transport's buffer goes over the high water mark." msgstr "" +"هنگامی که بافرانتقالاز آستانه بالا (high water mark) " +"عبور کند، فراخوانی می‌شود." msgid "``callback`` :meth:`resume_writing() `" -msgstr "" +msgstr "``callback`` :meth:`resume_writing() `" msgid "Called when the transport's buffer drains below the low water mark." msgstr "" +"هنگامی که بافرانتقالبه زیر آستانه پایین (low water " +"mark) تخلیه شود، فراخوانی می‌شود." msgid "Streaming Protocols (TCP, Unix Sockets, Pipes)" -msgstr "" +msgstr "پروتکل‌های جریانی (TCP، Unix Sockets، Pipes)" msgid "``callback`` :meth:`data_received() `" -msgstr "" +msgstr "``callback`` :meth:`data_received() `" msgid "Called when some data is received." -msgstr "" +msgstr "هنگامی که داده‌ای دریافت می‌شود، فراخوانی می‌شود." msgid "``callback`` :meth:`eof_received() `" -msgstr "" +msgstr "``callback`` :meth:`eof_received() `" msgid "Called when an EOF is received." -msgstr "" +msgstr "هنگام دریافت EOF فراخوانی می‌شود." msgid "Buffered Streaming Protocols" -msgstr "" +msgstr "پروتکل‌های جریانی بافرشده" msgid "``callback`` :meth:`get_buffer() `" -msgstr "" +msgstr "``callback`` :meth:`get_buffer() `" msgid "Called to allocate a new receive buffer." -msgstr "" +msgstr "برای تخصیص یک بافر دریافت جدید فراخوانی می‌شود." -msgid "``callback`` :meth:`buffer_updated() `" +msgid "" +"``callback`` :meth:`buffer_updated() `" msgstr "" +"``callback`` :meth:`buffer_updated() `" msgid "Called when the buffer was updated with the received data." -msgstr "" +msgstr "هنگامی که بافر با داده‌های دریافتی به‌روزرسانی شد، فراخوانی می‌شود." msgid "``callback`` :meth:`eof_received() `" -msgstr "" +msgstr "``callback`` :meth:`eof_received() `" msgid "Datagram Protocols" -msgstr "" +msgstr "پروتکل‌های دیتاگرام" -msgid "``callback`` :meth:`datagram_received() `" +msgid "" +"``callback`` :meth:`datagram_received() " +"`" msgstr "" +"``callback`` :meth:`datagram_received() " +"`" msgid "Called when a datagram is received." -msgstr "" +msgstr "هنگام دریافت یک دیتاگرام، فراخوانی می‌شود." -msgid "``callback`` :meth:`error_received() `" +msgid "" +"``callback`` :meth:`error_received() `" msgstr "" +"``callback`` :meth:`error_received() `" -msgid "Called when a previous send or receive operation raises an :class:`OSError`." +msgid "" +"Called when a previous send or receive operation raises an :class:`OSError`." msgstr "" +"هرگاه یک عملیات ارسال یا دریافت پیشین، یک :class:`OSError` را پرتاب کند، " +"فراخوانی می‌شود." msgid "Subprocess Protocols" -msgstr "" +msgstr "پروتکل‌های زیرفرایند" msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -msgstr "" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -msgid "Called when the child process writes data into its *stdout* or *stderr* pipe." +msgid "" +"Called when the child process writes data into its *stdout* or *stderr* " +"pipe." msgstr "" +"هنگامی فراخوانی می‌شود که فرایند فرزند داده‌ای را در پایپ *stdout* یا" +" *stderr* خود می‌نویسد." msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -msgstr "" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -msgid "Called when one of the pipes communicating with the child process is closed." +msgid "" +"Called when one of the pipes communicating with the child process is closed." msgstr "" +"هنگامی که یکی از پایپ‌هایارتباطی با فرایند فرزند بسته می‌شود، " +"فراخوانی می‌شود." -msgid "``callback`` :meth:`process_exited() `" +msgid "" +"``callback`` :meth:`process_exited() `" msgstr "" +"``callback`` :meth:`process_exited() `" -msgid "Called when the child process has exited. It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgid "" +"Called when the child process has exited. It can be called before " +":meth:`~SubprocessProtocol.pipe_data_received` and " +":meth:`~SubprocessProtocol.pipe_connection_lost` methods." msgstr "" +"هنگامی که فرایند فرزند خارج شده باشد، فراخوانی می‌شود. ممکن است پیش از " +"متدهای :meth:`~SubprocessProtocol.pipe_data_received` و " +":meth:`~SubprocessProtocol.pipe_connection_lost` فراخوانی شود." msgid "Event Loop Policies" -msgstr "" +msgstr "سیاست‌های حلقه رویداد" -msgid "Policies is a low-level mechanism to alter the behavior of functions like :func:`asyncio.get_event_loop`. See also the main :ref:`policies section ` for more details." +msgid "" +"Policies is a low-level mechanism to alter the behavior of functions like " +":func:`asyncio.get_event_loop`. See also the main :ref:`policies section " +"` for more details." msgstr "" +"سیاست‌ها یک سازوکار سطح پایین برای تغییر رفتار توابعی مانند " +":func:`asyncio.get_event_loop` هستند. همچنین برای جزئیات بیشتر، :ref:`بخش " +"اصلی سیاست‌ها ` را ببینید." msgid "Accessing Policies" -msgstr "" +msgstr "دسترسی به سیاست‌ها" msgid ":meth:`asyncio.get_event_loop_policy`" -msgstr "" +msgstr ":meth:`asyncio.get_event_loop_policy`" msgid "Return the current process-wide policy." -msgstr "" +msgstr "سیاست جاری در سطح فرآیند را برمی‌گرداند." msgid ":meth:`asyncio.set_event_loop_policy`" -msgstr "" +msgstr ":meth:`asyncio.set_event_loop_policy`" msgid "Set a new process-wide policy." -msgstr "" +msgstr "یک خط‌مشی جدید برای کل فرایند تنظیم کنید." msgid ":class:`AbstractEventLoopPolicy`" -msgstr "" +msgstr ":class:`AbstractEventLoopPolicy`" msgid "Base class for policy objects." -msgstr "" +msgstr "کلاس پایه برای اشیای سیاست." diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 0bae4bf54..68d0301e9 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -24,82 +24,169 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Platform Support" -msgstr "" +msgstr "پشتیبانی از پلتفرم" -msgid "The :mod:`asyncio` module is designed to be portable, but some platforms have subtle differences and limitations due to the platforms' underlying architecture and capabilities." +msgid "" +"The :mod:`asyncio` module is designed to be portable, but some platforms " +"have subtle differences and limitations due to the platforms' underlying " +"architecture and capabilities." msgstr "" +"ماژول :mod:`asyncio` به‌گونه‌ای طراحی شده است که قابل حمل باشد، اما برخی " +"پلتفرم‌ها به دلیل معماری و قابلیت‌های زیربنایی خود، تفاوت‌ها و محدودیت‌های " +"ظریفی دارند." msgid "All Platforms" -msgstr "" +msgstr "همه‌ی سکوها" -msgid ":meth:`loop.add_reader` and :meth:`loop.add_writer` cannot be used to monitor file I/O." +msgid "" +":meth:`loop.add_reader` and :meth:`loop.add_writer` cannot be used to " +"monitor file I/O." msgstr "" +":meth:`loop.add_reader` و :meth:`loop.add_writer` را نمی‌توان برای پایش " +"ورودی/خروجی فایل به کار برد." -msgid ":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` cannot be used with regular files. See :ref:`Supported pipe objects ` for the objects that are accepted on each platform." +msgid "" +":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` cannot be" +" used with regular files. See :ref:`Supported pipe objects ` for the objects that are accepted on each platform." msgstr "" +"نمی‌توان از :meth:`loop.connect_read_pipe` و :meth:`loop.connect_write_pipe`" +" با فایل‌های معمولی استفاده کرد. برای دیدن اشیایی که در هر سکو پذیرفته " +"می‌شوند، :ref:`اشیای پایپپشتیبانی‌شده ` را " +"ببینید." msgid "Windows" -msgstr "" +msgstr "ویندوز" -msgid "**Source code:** :source:`Lib/asyncio/proactor_events.py`, :source:`Lib/asyncio/windows_events.py`, :source:`Lib/asyncio/windows_utils.py`" +msgid "" +"**Source code:** :source:`Lib/asyncio/proactor_events.py`, " +":source:`Lib/asyncio/windows_events.py`, " +":source:`Lib/asyncio/windows_utils.py`" msgstr "" +":source:`Lib/asyncio/proactor_events.py`, " +":source:`Lib/asyncio/windows_events.py`, " +":source:`Lib/asyncio/windows_utils.py`" msgid "On Windows, :class:`ProactorEventLoop` is now the default event loop." -msgstr "" +msgstr "در ویندوز، :class:`ProactorEventLoop` اکنون حلقه رویداد پیش‌فرض است." msgid "All event loops on Windows do not support the following methods:" -msgstr "" +msgstr "تمام حلقه‌های رویداد در ویندوز از متدهای زیر پشتیبانی نمی‌کنند:" -msgid ":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are not supported. The :const:`socket.AF_UNIX` socket family is specific to Unix." +msgid "" +":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are " +"not supported. The :const:`socket.AF_UNIX` socket family is specific to " +"Unix." msgstr "" +"از :meth:`loop.create_unix_connection` و :meth:`loop.create_unix_server` " +"پشتیبانی نمی‌شود. خانواده‌ی سوکت :const:`socket.AF_UNIX` مخصوص یونیکس است." -msgid ":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are not supported." +msgid "" +":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are " +"not supported." msgstr "" +":meth:`loop.add_signal_handler` و :meth:`loop.remove_signal_handler` " +"پشتیبانی نمی‌شوند." msgid ":class:`SelectorEventLoop` has the following limitations:" -msgstr "" +msgstr ":class:`SelectorEventLoop` محدودیت‌های زیر را دارد:" -msgid ":class:`~selectors.SelectSelector` is used to wait on socket events: it supports sockets and is limited to 512 sockets." +msgid "" +":class:`~selectors.SelectSelector` is used to wait on socket events: it " +"supports sockets and is limited to 512 sockets." msgstr "" +":class:`~selectors.SelectSelector` برای انتظار برای رویدادهای سوکت به کار " +"می‌رود: از سوکت‌ها پشتیبانی می‌کند و به ۵۱۲ سوکت محدود است." -msgid ":meth:`loop.add_reader` and :meth:`loop.add_writer` only accept socket handles (e.g. pipe file descriptors are not supported)." +msgid "" +":meth:`loop.add_reader` and :meth:`loop.add_writer` only accept socket " +"handles (e.g. pipe file descriptors are not supported)." msgstr "" +":meth:`loop.add_reader` و :meth:`loop.add_writer` فقط دسته‌های سوکت را " +"می‌پذیرند (برای مثال، توصیف‌گرهای فایل پایپ پشتیبانی نمی‌شوند)." -msgid "Pipes are not supported, so the :meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` methods are not implemented." +msgid "" +"Pipes are not supported, so the :meth:`loop.connect_read_pipe` and " +":meth:`loop.connect_write_pipe` methods are not implemented." msgstr "" +"از پایپ‌ها (pipes) پشتیبانی نمی‌شود، بنابراین متدهای " +":meth:`loop.connect_read_pipe` و :meth:`loop.connect_write_pipe` پیاده‌سازی " +"نشده‌اند." -msgid ":ref:`Subprocesses ` are not supported, i.e. :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods are not implemented." +msgid "" +":ref:`Subprocesses ` are not supported, i.e. " +":meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods are " +"not implemented." msgstr "" +":ref:`زیرفرایندها ` پشتیبانی نمی‌شوند، یعنی متدهای " +":meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell` پیاده‌سازی " +"نشده‌اند." msgid ":class:`ProactorEventLoop` has the following limitations:" -msgstr "" +msgstr ":class:`ProactorEventLoop` محدودیت‌های زیر را دارد:" -msgid "The :meth:`loop.add_reader` and :meth:`loop.add_writer` methods are not supported." +msgid "" +"The :meth:`loop.add_reader` and :meth:`loop.add_writer` methods are not " +"supported." msgstr "" +"متدهای :meth:`loop.add_reader` و :meth:`loop.add_writer` پشتیبانی نمی‌شوند." -msgid ":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` only accept a handle opened for overlapped I/O. See :ref:`Supported pipe objects ` for which objects are supported." +msgid "" +":meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` only " +"accept a handle opened for overlapped I/O. See :ref:`Supported pipe objects " +"` for which objects are supported." msgstr "" +":meth:`loop.connect_read_pipe` و :meth:`loop.connect_write_pipe` فقط " +"دسته‌ای (handle) را می‌پذیرند که برای ورودی/خروجی همپوشانی‌شده " +"(overlapped I/O) بازشده باشد. برای اینکه بدانید کدام اشیاء پشتیبانی " +"می‌شوند، :ref:`اشیاء پایپپشتیبانی‌شده ` را " +"ببینید." -msgid "The resolution of the monotonic clock on Windows is usually around 15.6 milliseconds. The best resolution is 0.5 milliseconds. The resolution depends on the hardware (availability of `HPET `_) and on the Windows configuration." +msgid "" +"The resolution of the monotonic clock on Windows is usually around 15.6 " +"milliseconds. The best resolution is 0.5 milliseconds. The resolution " +"depends on the hardware (availability of `HPET " +"`_) and on the " +"Windows configuration." msgstr "" +"دقت ساعت یکنواخت (monotonic clock) در ویندوز معمولاً حدود ۱۵٫۶ میلی‌ثانیه " +"است. بهترین دقت ۰٫۵ میلی‌ثانیه است. دقت به سخت‌افزار (دسترس‌پذیری `HPET " +"`_) و پیکربندی " +"ویندوز بستگی دارد." msgid "Subprocess Support on Windows" -msgstr "" +msgstr "پشتیبانی از زیرفرایند در ویندوز" -msgid "On Windows, the default event loop :class:`ProactorEventLoop` supports subprocesses, whereas :class:`SelectorEventLoop` does not." +msgid "" +"On Windows, the default event loop :class:`ProactorEventLoop` supports " +"subprocesses, whereas :class:`SelectorEventLoop` does not." msgstr "" +"در ویندوز، حلقه رویداد پیش‌فرض :class:`ProactorEventLoop` از زیرفرآیندها " +"پشتیبانی می‌کند، در حالی که :class:`SelectorEventLoop` پشتیبانی نمی‌کند." msgid "macOS" -msgstr "" +msgstr "macOS" msgid "Modern macOS versions are fully supported." -msgstr "" +msgstr "نسخه‌های جدید macOS به‌طور کامل پشتیبانی می‌شوند." msgid "macOS <= 10.8" -msgstr "" +msgstr "macOS <= 10.8" -msgid "On macOS 10.6, 10.7 and 10.8, the default event loop uses :class:`selectors.KqueueSelector`, which does not support character devices on these versions. The :class:`SelectorEventLoop` can be manually configured to use :class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to support character devices on these older versions of macOS. Example::" -msgstr "" +msgid "" +"On macOS 10.6, 10.7 and 10.8, the default event loop uses " +":class:`selectors.KqueueSelector`, which does not support character devices " +"on these versions. The :class:`SelectorEventLoop` can be manually " +"configured to use :class:`~selectors.SelectSelector` or " +":class:`~selectors.PollSelector` to support character devices on these older" +" versions of macOS. Example::" +msgstr "" +"در macOS 10.6، 10.7 و 10.8، حلقه رویداد پیش‌فرض از " +":class:`selectors.KqueueSelector` استفاده می‌کند، که از دستگاه‌های نویسه‌ای " +"در این نسخه‌ها پشتیبانی نمی‌کند. می‌توان :class:`SelectorEventLoop` را " +"به‌صورت دستی پیکربندی کرد تا از :class:`~selectors.SelectSelector` یا " +":class:`~selectors.PollSelector` استفاده کند و از دستگاه‌های نویسه‌ای در این" +" نسخه‌های قدیمی‌تر macOS پشتیبانی کند. مثال::" msgid "" "import asyncio\n" @@ -109,3 +196,9 @@ msgid "" "loop = asyncio.SelectorEventLoop(selector)\n" "asyncio.set_event_loop(loop)" msgstr "" +"import asyncio\n" +"import selectors\n" +"\n" +"selector = selectors.SelectSelector()\n" +"loop = asyncio.SelectorEventLoop(selector)\n" +"asyncio.set_event_loop(loop)" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index cf72e2124..679ac29b3 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -24,109 +24,201 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Policies" -msgstr "" +msgstr "سیاست‌ها" -msgid "Policies are deprecated and will be removed in Python 3.16. Users are encouraged to use the :func:`asyncio.run` function or the :class:`asyncio.Runner` with *loop_factory* to use the desired loop implementation." +msgid "" +"Policies are deprecated and will be removed in Python 3.16. Users are " +"encouraged to use the :func:`asyncio.run` function or the " +":class:`asyncio.Runner` with *loop_factory* to use the desired loop " +"implementation." msgstr "" +"سیاست‌ها منسوخ شده‌اند و در Python 3.16 حذف خواهند شد. به کاربران توصیه " +"می‌شود برای استفاده از پیاده‌سازی حلقه مورد نظر، از تابع :func:`asyncio.run`" +" یا :class:`asyncio.Runner` همراه با *loop_factory* استفاده کنند." -msgid "An event loop policy is a global object used to get and set the current :ref:`event loop `, as well as create new event loops. The default policy can be :ref:`replaced ` with :ref:`built-in alternatives ` to use different event loop implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." -msgstr "" +msgid "" +"An event loop policy is a global object used to get and set the current " +":ref:`event loop `, as well as create new event loops. " +"The default policy can be :ref:`replaced ` with " +":ref:`built-in alternatives ` to use different event" +" loop implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." +msgstr "" +"سیاست حلقه رویداد یک شیء سراسری است که برای دریافت و تنظیم " +":ref:`حلقه رویداد جاری `، و همچنین ایجاد حلقه‌های رویداد " +"جدید استفاده می‌شود. سیاست پیش‌فرض را می‌توان با " +":ref:`جایگزین‌های توکار ` " +":ref:`جایگزین کرد ` تا از پیاده‌سازی‌های مختلف حلقه " +"رویداد استفاده شود، یا با یک :ref:`سیاست سفارشی ` " +"که می‌تواند این رفتارها را بازنویسی کند، جایگزین نمود." -msgid "The :ref:`policy object ` gets and sets a separate event loop per *context*. This is per-thread by default, though custom policies could define *context* differently." +msgid "" +"The :ref:`policy object ` gets and sets a separate " +"event loop per *context*. This is per-thread by default, though custom " +"policies could define *context* differently." msgstr "" +":ref:`شیء سیاست ` یک حلقه رویداد جداگانه را به ازای " +"هر *زمینه* دریافت و تنظیم می‌کند. این حالت به‌طور پیش‌فرض به ازای هر نخ است،" +" هرچند سیاست‌های سفارشی می‌توانند *زمینه* را به شکل متفاوتی تعریف کنند." -msgid "Custom event loop policies can control the behavior of :func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." +msgid "" +"Custom event loop policies can control the behavior of " +":func:`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." msgstr "" +"سیاست‌های سفارشی حلقه رویداد می‌توانند رفتار :func:`get_event_loop`، " +":func:`set_event_loop` و :func:`new_event_loop` را کنترل کنند." -msgid "Policy objects should implement the APIs defined in the :class:`AbstractEventLoopPolicy` abstract base class." +msgid "" +"Policy objects should implement the APIs defined in the " +":class:`AbstractEventLoopPolicy` abstract base class." msgstr "" +"اشیای سیاست (Policy) باید APIهای تعریف‌شده در کلاس پایه انتزاعی " +":class:`AbstractEventLoopPolicy` را پیاده‌سازی کنند." msgid "Getting and Setting the Policy" -msgstr "" +msgstr "دریافت و تنظیم سیاست" -msgid "The following functions can be used to get and set the policy for the current process:" +msgid "" +"The following functions can be used to get and set the policy for the " +"current process:" msgstr "" +"می‌توان از توابع زیر برای دریافت و تنظیم سیاست فرایند جاری استفاده کرد:" msgid "Return the current process-wide policy." -msgstr "" +msgstr "سیاست فعلی در سطح فرایند را برمی‌گرداند." -msgid "The :func:`get_event_loop_policy` function is deprecated and will be removed in Python 3.16." +msgid "" +"The :func:`get_event_loop_policy` function is deprecated and will be removed" +" in Python 3.16." msgstr "" +"تابع :func:`get_event_loop_policy` منسوخ شده است و در Python 3.16 حذف خواهد " +"شد." msgid "Set the current process-wide policy to *policy*." -msgstr "" +msgstr "سیاست سراسری فعلی فرایند را روی *policy* تنظیم کنید." msgid "If *policy* is set to ``None``, the default policy is restored." -msgstr "" +msgstr "اگر *policy* روی ``None`` تنظیم شود، سیاست پیش‌فرض بازیابی می‌شود." -msgid "The :func:`set_event_loop_policy` function is deprecated and will be removed in Python 3.16." +msgid "" +"The :func:`set_event_loop_policy` function is deprecated and will be removed" +" in Python 3.16." msgstr "" +"تابع :func:`set_event_loop_policy` منسوخ شده است و در پایتون 3.16 حذف خواهد " +"شد." msgid "Policy Objects" -msgstr "" +msgstr "اشیاء سیاست" msgid "The abstract event loop policy base class is defined as follows:" -msgstr "" +msgstr "کلاس پایه‌ی انتزاعی سیاست حلقه رویداد به‌صورت زیر تعریف شده است:" msgid "An abstract base class for asyncio policies." -msgstr "" +msgstr "یک کلاس پایه انتزاعی برای سیاست‌های asyncio." msgid "Get the event loop for the current context." -msgstr "" +msgstr "حلقه رویداد را برای زمینه جاری دریافت کنید." -msgid "Return an event loop object implementing the :class:`AbstractEventLoop` interface." +msgid "" +"Return an event loop object implementing the :class:`AbstractEventLoop` " +"interface." msgstr "" +"یک شیء حلقه رویداد را که رابط :class:`AbstractEventLoop` را پیاده‌سازی " +"می‌کند، برمی‌گرداند." msgid "This method should never return ``None``." -msgstr "" +msgstr "این متد هرگز نباید ``None`` را برگرداند." msgid "Set the event loop for the current context to *loop*." -msgstr "" +msgstr "حلقه رویداد را برای زمینه فعلی روی *loop* تنظیم کنید." msgid "Create and return a new event loop object." -msgstr "" +msgstr "یک شیء حلقه رویداد جدید را ایجاد و برمی‌گرداند." -msgid "The :class:`AbstractEventLoopPolicy` class is deprecated and will be removed in Python 3.16." +msgid "" +"The :class:`AbstractEventLoopPolicy` class is deprecated and will be removed" +" in Python 3.16." msgstr "" +"کلاس :class:`AbstractEventLoopPolicy` منسوخ شده است و در Python 3.16 حذف " +"خواهد شد." msgid "asyncio ships with the following built-in policies:" -msgstr "" +msgstr "asyncio با سیاست‌های توکار زیر ارائه می‌شود:" -msgid "The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :class:`ProactorEventLoop` on Windows." +msgid "" +"The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and " +":class:`ProactorEventLoop` on Windows." msgstr "" +"سیاست پیش‌فرض asyncio. از :class:`SelectorEventLoop` در یونیکس و " +":class:`ProactorEventLoop` در ویندوز استفاده می‌کند." -msgid "There is no need to install the default policy manually. asyncio is configured to use the default policy automatically." +msgid "" +"There is no need to install the default policy manually. asyncio is " +"configured to use the default policy automatically." msgstr "" +"نیازی نیست سیاست پیش‌فرض را به‌صورت دستی نصب کنید. asyncio به‌گونه‌ای " +"پیکربندی شده است که به‌طور خودکار از سیاست پیش‌فرض استفاده کند." msgid "On Windows, :class:`ProactorEventLoop` is now used by default." msgstr "" +"در ویندوز، :class:`ProactorEventLoop` اکنون به‌طور پیش‌فرض استفاده می‌شود." -msgid "The :meth:`get_event_loop` method of the default asyncio policy now raises a :exc:`RuntimeError` if there is no set event loop." +msgid "" +"The :meth:`get_event_loop` method of the default asyncio policy now raises a" +" :exc:`RuntimeError` if there is no set event loop." msgstr "" +"متد :meth:`get_event_loop` سیاست پیش‌فرض asyncio اکنون در صورتی که حلقه " +"رویدادی تنظیم نشده باشد، استثنای :exc:`RuntimeError` را پرتاب می‌کند." -msgid "The :class:`DefaultEventLoopPolicy` class is deprecated and will be removed in Python 3.16." +msgid "" +"The :class:`DefaultEventLoopPolicy` class is deprecated and will be removed " +"in Python 3.16." msgstr "" +"کلاس :class:`DefaultEventLoopPolicy` منسوخ شده است و در پایتون 3.16 حذف " +"خواهد شد." -msgid "An alternative event loop policy that uses the :class:`SelectorEventLoop` event loop implementation." +msgid "" +"An alternative event loop policy that uses the :class:`SelectorEventLoop` " +"event loop implementation." msgstr "" +"یک سیاست جایگزین حلقه رویداد که از پیاده‌سازی حلقه رویداد " +":class:`SelectorEventLoop` استفاده می‌کند." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "The :class:`WindowsSelectorEventLoopPolicy` class is deprecated and will be removed in Python 3.16." +msgid "" +"The :class:`WindowsSelectorEventLoopPolicy` class is deprecated and will be " +"removed in Python 3.16." msgstr "" +"کلاس :class:`WindowsSelectorEventLoopPolicy` منسوخ‌شده است و در پایتون 3.16 " +"حذف خواهد شد." -msgid "An alternative event loop policy that uses the :class:`ProactorEventLoop` event loop implementation." +msgid "" +"An alternative event loop policy that uses the :class:`ProactorEventLoop` " +"event loop implementation." msgstr "" +"یک سیاست جایگزین حلقه رویداد که از پیاده‌سازی حلقه رویداد " +":class:`ProactorEventLoop` استفاده می‌کند." -msgid "The :class:`WindowsProactorEventLoopPolicy` class is deprecated and will be removed in Python 3.16." +msgid "" +"The :class:`WindowsProactorEventLoopPolicy` class is deprecated and will be " +"removed in Python 3.16." msgstr "" +"کلاس :class:`WindowsProactorEventLoopPolicy` منسوخ شده است و در پایتون 3.16 " +"حذف خواهد شد." msgid "Custom Policies" -msgstr "" +msgstr "سیاست‌های سفارشی" -msgid "To implement a new event loop policy, it is recommended to subclass :class:`DefaultEventLoopPolicy` and override the methods for which custom behavior is wanted, e.g.::" +msgid "" +"To implement a new event loop policy, it is recommended to subclass " +":class:`DefaultEventLoopPolicy` and override the methods for which custom " +"behavior is wanted, e.g.::" msgstr "" +"برای پیاده‌سازی یک سیاست جدید حلقه رویداد، توصیه می‌شود زیرکلاسی از " +":class:`DefaultEventLoopPolicy` ایجاد کنید و متدهایی را که رفتار سفارشی " +"برای آن‌ها مطلوب است بازنویسی کنید، برای مثال::" msgid "" "class MyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):\n" @@ -142,3 +234,15 @@ msgid "" "\n" "asyncio.set_event_loop_policy(MyEventLoopPolicy())" msgstr "" +"class MyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):\n" +"\n" +" def get_event_loop(self):\n" +" \"\"\"Get the event loop.\n" +"\n" +" This may be None or an instance of EventLoop.\n" +" \"\"\"\n" +" loop = super().get_event_loop()\n" +" # Do something with loop ...\n" +" return loop\n" +"\n" +"asyncio.set_event_loop_policy(MyEventLoopPolicy())" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 4d7b9fb64..4ad1bfc64 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -25,427 +25,896 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Transports and Protocols" -msgstr "" +msgstr "انتقال‌ها و پروتکل‌ها" msgid "Preface" -msgstr "" +msgstr "پیش‌گفتار" -msgid "Transports and Protocols are used by the **low-level** event loop APIs such as :meth:`loop.create_connection`. They use callback-based programming style and enable high-performance implementations of network or IPC protocols (e.g. HTTP)." +msgid "" +"Transports and Protocols are used by the **low-level** event loop APIs such " +"as :meth:`loop.create_connection`. They use callback-based programming " +"style and enable high-performance implementations of network or IPC " +"protocols (e.g. HTTP)." msgstr "" +"انتقال‌ها و پروتکل‌ها (Transports and Protocols) توسط APIهای **سطح پایین** " +"حلقه رویداد مانند :meth:`loop.create_connection` استفاده می‌شوند. آن‌ها از " +"سبک برنامه‌نویسی مبتنی بر کال‌بک استفاده می‌کنند و پیاده‌سازی‌های با کارایی " +"بالای پروتکل‌های شبکه یا IPC (مانند HTTP) را ممکن می‌سازند." -msgid "Essentially, transports and protocols should only be used in libraries and frameworks and never in high-level asyncio applications." +msgid "" +"Essentially, transports and protocols should only be used in libraries and " +"frameworks and never in high-level asyncio applications." msgstr "" +"در اصل، انتقال‌هاو پروتکل‌ها تنها باید در کتابخانه‌ها و " +"چارچوب‌ها استفاده شوند و هرگز در برنامه‌های asyncio سطح‌بالا استفاده نشوند." msgid "This documentation page covers both `Transports`_ and `Protocols`_." -msgstr "" +msgstr "این صفحه‌ی مستندات، هر دو `Transports`_ و `Protocols`_ را پوشش می‌دهد." msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "At the highest level, the transport is concerned with *how* bytes are transmitted, while the protocol determines *which* bytes to transmit (and to some extent when)." +msgid "" +"At the highest level, the transport is concerned with *how* bytes are " +"transmitted, while the protocol determines *which* bytes to transmit (and to" +" some extent when)." msgstr "" +"در بالاترین سطح، انتقال به *چگونگی* ارسال بایت‌ها مربوط است، در حالی که " +"پروتکل تعیین می‌کند که *کدام* بایت‌ها ارسال شوند (و تا حدی چه زمانی)." -msgid "A different way of saying the same thing: a transport is an abstraction for a socket (or similar I/O endpoint) while a protocol is an abstraction for an application, from the transport's point of view." +msgid "" +"A different way of saying the same thing: a transport is an abstraction for " +"a socket (or similar I/O endpoint) while a protocol is an abstraction for an" +" application, from the transport's point of view." msgstr "" +"راه دیگری برای بیان همان مطلب: یک انتقالانتزاعی از یک سوکت (یا " +"پایانه ورودی/خروجی مشابه) است، در حالی که یک پروتکل، از دیدگاه انتقال، " +"انتزاعی از یک برنامه است." -msgid "Yet another view is the transport and protocol interfaces together define an abstract interface for using network I/O and interprocess I/O." +msgid "" +"Yet another view is the transport and protocol interfaces together define an" +" abstract interface for using network I/O and interprocess I/O." msgstr "" +"دیدگاه دیگر این است که رابط‌های انتقالو پروتکل (protocol) با هم" +" یک رابط انتزاعی برای استفاده از I/O شبکه و I/O بین‌فرایندی تعریف می‌کنند." -msgid "There is always a 1:1 relationship between transport and protocol objects: the protocol calls transport methods to send data, while the transport calls protocol methods to pass it data that has been received." +msgid "" +"There is always a 1:1 relationship between transport and protocol objects: " +"the protocol calls transport methods to send data, while the transport calls" +" protocol methods to pass it data that has been received." msgstr "" +"همیشه یک رابطه‌ی ۱:۱ بین اشیای انتقالو پروتکل وجود دارد: پروتکل" +" متدهای انتقال را برای ارسال داده فراخوانی می‌کند، در حالی که انتقال متدهای " +"پروتکل را فراخوانی می‌کند تا داده‌های دریافت‌شده را به آن منتقل کند." -msgid "Most of connection oriented event loop methods (such as :meth:`loop.create_connection`) usually accept a *protocol_factory* argument used to create a *Protocol* object for an accepted connection, represented by a *Transport* object. Such methods usually return a tuple of ``(transport, protocol)``." -msgstr "" +msgid "" +"Most of connection oriented event loop methods (such as " +":meth:`loop.create_connection`) usually accept a *protocol_factory* argument" +" used to create a *Protocol* object for an accepted connection, represented " +"by a *Transport* object. Such methods usually return a tuple of " +"``(transport, protocol)``." +msgstr "" +"بیشتر متدهای اتصال‌محور حلقه رویداد (مانند :meth:`loop.create_connection`) " +"معمولاً آرگومان *protocol_factory* را می‌پذیرند که برای ایجاد یک شیء " +"*Protocol* برای یک اتصال پذیرفته‌شده که با یک شیء *Transport* نمایش داده " +"می‌شود، استفاده می‌شود. چنین متدهایی معمولاً یک تاپل ``(transport, " +"protocol)`` را برمی‌گردانند." msgid "Contents" -msgstr "" +msgstr "فهرست" msgid "This documentation page contains the following sections:" -msgstr "" +msgstr "این صفحه‌ی مستندات شامل بخش‌های زیر است:" -msgid "The `Transports`_ section documents asyncio :class:`BaseTransport`, :class:`ReadTransport`, :class:`WriteTransport`, :class:`Transport`, :class:`DatagramTransport`, and :class:`SubprocessTransport` classes." +msgid "" +"The `Transports`_ section documents asyncio :class:`BaseTransport`, " +":class:`ReadTransport`, :class:`WriteTransport`, :class:`Transport`, " +":class:`DatagramTransport`, and :class:`SubprocessTransport` classes." msgstr "" +"بخش `Transports`_ کلاس‌های asyncio شامل :class:`BaseTransport`، " +":class:`ReadTransport`، :class:`WriteTransport`، :class:`Transport`، " +":class:`DatagramTransport` و :class:`SubprocessTransport` را مستند می‌کند." -msgid "The `Protocols`_ section documents asyncio :class:`BaseProtocol`, :class:`Protocol`, :class:`BufferedProtocol`, :class:`DatagramProtocol`, and :class:`SubprocessProtocol` classes." +msgid "" +"The `Protocols`_ section documents asyncio :class:`BaseProtocol`, " +":class:`Protocol`, :class:`BufferedProtocol`, :class:`DatagramProtocol`, and" +" :class:`SubprocessProtocol` classes." msgstr "" +"بخش `Protocols`_ کلاس‌های asyncio :class:`BaseProtocol`، :class:`Protocol`، " +":class:`BufferedProtocol`، :class:`DatagramProtocol` و " +":class:`SubprocessProtocol` را مستند می‌کند." -msgid "The `Examples`_ section showcases how to work with transports, protocols, and low-level event loop APIs." +msgid "" +"The `Examples`_ section showcases how to work with transports, protocols, " +"and low-level event loop APIs." msgstr "" +"بخش `Examples`_ چگونگی کار با ترابری‌ها ، پروتکل‌ها (protocols) " +"و APIهای سطح پایین حلقه رویداد را نمایش می‌دهد." msgid "Transports" -msgstr "" +msgstr "انتقال‌ها " msgid "**Source code:** :source:`Lib/asyncio/transports.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/transports.py`" -msgid "Transports are classes provided by :mod:`asyncio` in order to abstract various kinds of communication channels." +msgid "" +"Transports are classes provided by :mod:`asyncio` in order to abstract " +"various kinds of communication channels." msgstr "" +"ترابرهاکلاس‌هایی هستند که توسط :mod:`asyncio` فراهم شده‌اند " +"تا انواع مختلفی از کانال‌های ارتباطی را انتزاع کنند." -msgid "Transport objects are always instantiated by an :ref:`asyncio event loop `." +msgid "" +"Transport objects are always instantiated by an :ref:`asyncio event loop " +"`." msgstr "" +"اشیای Transport همیشه توسط یک :ref:`حلقه رویداد asyncio ` نمونه‌سازی می‌شوند." -msgid "asyncio implements transports for TCP, UDP, SSL, and subprocess pipes. The methods available on a transport depend on the transport's kind." +msgid "" +"asyncio implements transports for TCP, UDP, SSL, and subprocess pipes. The " +"methods available on a transport depend on the transport's kind." msgstr "" +"asyncio انتقال‌هارا برای TCP، UDP، SSL و پایپ‌های subprocess " +"پیاده‌سازی می‌کند. متدهای در دسترس برای یک انتقال، به نوع آن انتقال بستگی " +"دارند." -msgid "The transport classes are :ref:`not thread safe `." +msgid "" +"The transport classes are :ref:`not thread safe `." msgstr "" +"کلاس‌های انتقال :ref:`ایمن در برابر نخ نیستند `." msgid "Transports Hierarchy" -msgstr "" +msgstr "سلسله‌مراتب ترابری‌ها" -msgid "Base class for all transports. Contains methods that all asyncio transports share." +msgid "" +"Base class for all transports. Contains methods that all asyncio transports" +" share." msgstr "" +"کلاس پایه برای همه‌ی انتقال‌ها . شامل متدهایی است که همه‌ی " +"انتقال‌ها در asyncio آن‌ها را به اشتراک می‌گذارند." msgid "A base transport for write-only connections." -msgstr "" +msgstr "یک ترابری پایه برای اتصال‌های فقط‌نوشتنی." -msgid "Instances of the *WriteTransport* class are returned from the :meth:`loop.connect_write_pipe` event loop method and are also used by subprocess-related methods like :meth:`loop.subprocess_exec`." +msgid "" +"Instances of the *WriteTransport* class are returned from the " +":meth:`loop.connect_write_pipe` event loop method and are also used by " +"subprocess-related methods like :meth:`loop.subprocess_exec`." msgstr "" +"نمونه‌های کلاس *WriteTransport* از متد حلقه رویداد " +":meth:`loop.connect_write_pipe` برگردانده می‌شوند و همچنین توسط متدهای مرتبط" +" با زیرفرایند (subprocess) مانند :meth:`loop.subprocess_exec` استفاده " +"می‌شوند." msgid "A base transport for read-only connections." -msgstr "" +msgstr "یک انتقالپایه برای اتصال‌های فقط‌خواندنی." -msgid "Instances of the *ReadTransport* class are returned from the :meth:`loop.connect_read_pipe` event loop method and are also used by subprocess-related methods like :meth:`loop.subprocess_exec`." +msgid "" +"Instances of the *ReadTransport* class are returned from the " +":meth:`loop.connect_read_pipe` event loop method and are also used by " +"subprocess-related methods like :meth:`loop.subprocess_exec`." msgstr "" +"نمونه‌های کلاس *ReadTransport* از متد حلقه رویداد " +":meth:`loop.connect_read_pipe` بازگردانده می‌شوند و متدهای مرتبط با " +"زیرفرایند (subprocess) مانند :meth:`loop.subprocess_exec` نیز از آن‌ها " +"استفاده می‌کنند." -msgid "Interface representing a bidirectional transport, such as a TCP connection." +msgid "" +"Interface representing a bidirectional transport, such as a TCP connection." msgstr "" +"رابطی که یک انتقال دوطرفه ، مانند اتصال TCP، را نشان می‌دهد." -msgid "The user does not instantiate a transport directly; they call a utility function, passing it a protocol factory and other information necessary to create the transport and protocol." +msgid "" +"The user does not instantiate a transport directly; they call a utility " +"function, passing it a protocol factory and other information necessary to " +"create the transport and protocol." msgstr "" +"کاربر یک انتقالرا مستقیماً نمونه‌سازی نمی‌کند؛ بلکه یک تابع " +"کمکی را فراخوانی می‌کند و یک کارخانه‌ی پروتکل و سایر اطلاعات لازم برای ایجاد" +" انتقالو پروتکل را به آن می‌دهد." -msgid "Instances of the *Transport* class are returned from or used by event loop methods like :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.create_server`, :meth:`loop.sendfile`, etc." +msgid "" +"Instances of the *Transport* class are returned from or used by event loop " +"methods like :meth:`loop.create_connection`, " +":meth:`loop.create_unix_connection`, :meth:`loop.create_server`, " +":meth:`loop.sendfile`, etc." msgstr "" +"نمونه‌های کلاس *Transport* توسط متدهای حلقه رویداد مانند " +":meth:`loop.create_connection`، :meth:`loop.create_unix_connection`، " +":meth:`loop.create_server`، :meth:`loop.sendfile` و غیره برگردانده یا " +"استفاده می‌شوند." msgid "A transport for datagram (UDP) connections." -msgstr "" +msgstr "یک انتقالبرای اتصال‌های دیتاگرام (UDP)." -msgid "Instances of the *DatagramTransport* class are returned from the :meth:`loop.create_datagram_endpoint` event loop method." +msgid "" +"Instances of the *DatagramTransport* class are returned from the " +":meth:`loop.create_datagram_endpoint` event loop method." msgstr "" +"نمونه‌های کلاس *DatagramTransport* از متد حلقه رویداد " +":meth:`loop.create_datagram_endpoint` برگردانده می‌شوند." -msgid "An abstraction to represent a connection between a parent and its child OS process." +msgid "" +"An abstraction to represent a connection between a parent and its child OS " +"process." msgstr "" +"انتزاعی برای نمایش اتصال میان یک فرایند والد و فرایند فرزند سیستم‌عامل آن." -msgid "Instances of the *SubprocessTransport* class are returned from event loop methods :meth:`loop.subprocess_shell` and :meth:`loop.subprocess_exec`." +msgid "" +"Instances of the *SubprocessTransport* class are returned from event loop " +"methods :meth:`loop.subprocess_shell` and :meth:`loop.subprocess_exec`." msgstr "" +"نمونه‌های کلاس *SubprocessTransport* از متدهای حلقه رویداد " +":meth:`loop.subprocess_shell` و :meth:`loop.subprocess_exec` برگردانده " +"می‌شوند." msgid "Base Transport" -msgstr "" +msgstr "انتقال پایه" msgid "Close the transport." -msgstr "" +msgstr "انتقالرا ببندید." -msgid "If the transport has a buffer for outgoing data, buffered data will be flushed asynchronously. No more data will be received. After all buffered data is flushed, the protocol's :meth:`protocol.connection_lost() ` method will be called with :const:`None` as its argument. The transport should not be used once it is closed." -msgstr "" +msgid "" +"If the transport has a buffer for outgoing data, buffered data will be " +"flushed asynchronously. No more data will be received. After all buffered " +"data is flushed, the protocol's :meth:`protocol.connection_lost() " +"` method will be called with :const:`None` as " +"its argument. The transport should not be used once it is closed." +msgstr "" +"اگر انتقالبرای داده‌های خروجی دارای بافرباشد، " +"داده‌های بافرشده به‌صورت ناهمگام تخلیه خواهند شد. دیگر داده‌ای دریافت " +"نخواهد شد. پس از تخلیه‌ی همه‌ی داده‌های بافرشده، متد " +":meth:`protocol.connection_lost() ` پروتکل با " +":const:`None` به‌عنوان آرگومان آن فراخوانی خواهد شد. پس از بسته شدن، نباید " +"از انتقال استفاده شود." msgid "Return ``True`` if the transport is closing or is closed." msgstr "" +"اگر انتقالدر حال بسته شدن یا بسته باشد، ``True`` را " +"برمی‌گرداند." -msgid "Return information about the transport or underlying resources it uses." +msgid "" +"Return information about the transport or underlying resources it uses." msgstr "" +"اطلاعات درباره‌ی انتقالیا منابع زیربنایی مورد استفاده‌ی آن را " +"برمی‌گرداند." -msgid "*name* is a string representing the piece of transport-specific information to get." +msgid "" +"*name* is a string representing the piece of transport-specific information " +"to get." msgstr "" +"*name* رشته‌ای است که نشان‌دهنده‌ی بخشی از اطلاعات ویژه‌ی انتقال (transport-" +"specific) است که باید دریافت شود." -msgid "*default* is the value to return if the information is not available, or if the transport does not support querying it with the given third-party event loop implementation or on the current platform." +msgid "" +"*default* is the value to return if the information is not available, or if " +"the transport does not support querying it with the given third-party event " +"loop implementation or on the current platform." msgstr "" +"*default* مقداری است که باید در صورت در دسترس نبودن اطلاعات، یا اگر انتقال " +" از پرس‌وجوی آن با پیاده‌سازی حلقه رویداد شخص ثالثِ داده‌شده یا " +"در پلتفرم فعلی پشتیبانی نکند، برگردانده شود." -msgid "For example, the following code attempts to get the underlying socket object of the transport::" +msgid "" +"For example, the following code attempts to get the underlying socket object" +" of the transport::" msgstr "" +"برای مثال، کد زیر تلاش می‌کند شیء سوکت زیربناییِ انتقالرا " +"دریافت کند::" msgid "" "sock = transport.get_extra_info('socket')\n" "if sock is not None:\n" " print(sock.getsockopt(...))" msgstr "" +"sock = transport.get_extra_info('socket')\n" +"if sock is not None:\n" +" print(sock.getsockopt(...))" msgid "Categories of information that can be queried on some transports:" msgstr "" +"دسته‌های اطلاعاتی که می‌توان آن‌ها را در برخی از انتقال‌ها " +"پرس‌وجو کرد:" msgid "socket:" -msgstr "" +msgstr "سوکت:" -msgid "``'peername'``: the remote address to which the socket is connected, result of :meth:`socket.socket.getpeername` (``None`` on error)" +msgid "" +"``'peername'``: the remote address to which the socket is connected, result " +"of :meth:`socket.socket.getpeername` (``None`` on error)" msgstr "" +"``'peername'``: نشانی دوردستی که سوکت به آن متصل است، نتیجه " +":meth:`socket.socket.getpeername` (``None`` در صورت خطا)" msgid "``'socket'``: :class:`socket.socket` instance" -msgstr "" +msgstr "``'socket'``: نمونه‌ی :class:`socket.socket`" -msgid "``'sockname'``: the socket's own address, result of :meth:`socket.socket.getsockname`" +msgid "" +"``'sockname'``: the socket's own address, result of " +":meth:`socket.socket.getsockname`" msgstr "" +"``'sockname'``: نشانی خود سوکت، نتیجه‌ی :meth:`socket.socket.getsockname`" msgid "SSL socket:" -msgstr "" +msgstr "سوکت SSL:" -msgid "``'compression'``: the compression algorithm being used as a string, or ``None`` if the connection isn't compressed; result of :meth:`ssl.SSLSocket.compression`" +msgid "" +"``'compression'``: the compression algorithm being used as a string, or " +"``None`` if the connection isn't compressed; result of " +":meth:`ssl.SSLSocket.compression`" msgstr "" +"``'compression'``: الگوریتم فشرده‌سازی استفاده‌شده به‌صورت یک رشته، یا " +"``None`` اگر اتصال فشرده‌نشده باشد؛ نتیجه‌ی :meth:`ssl.SSLSocket.compression`" -msgid "``'cipher'``: a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used; result of :meth:`ssl.SSLSocket.cipher`" +msgid "" +"``'cipher'``: a three-value tuple containing the name of the cipher being " +"used, the version of the SSL protocol that defines its use, and the number " +"of secret bits being used; result of :meth:`ssl.SSLSocket.cipher`" msgstr "" +"``'cipher'``: یک تاپل سه‌مقداری شامل نام رمزنگار استفاده‌شده، نسخه‌ی پروتکل " +"SSL که استفاده‌ی آن را تعریف می‌کند، و تعداد بیت‌های محرمانه‌ی استفاده‌شده؛ " +"نتیجه‌ی :meth:`ssl.SSLSocket.cipher`" -msgid "``'peercert'``: peer certificate; result of :meth:`ssl.SSLSocket.getpeercert`" -msgstr "" +msgid "" +"``'peercert'``: peer certificate; result of " +":meth:`ssl.SSLSocket.getpeercert`" +msgstr "``'peercert'``: گواهی همتا؛ نتیجه‌ی :meth:`ssl.SSLSocket.getpeercert`" msgid "``'sslcontext'``: :class:`ssl.SSLContext` instance" -msgstr "" +msgstr "``'sslcontext'``: نمونه‌ی :class:`ssl.SSLContext`" -msgid "``'ssl_object'``: :class:`ssl.SSLObject` or :class:`ssl.SSLSocket` instance" +msgid "" +"``'ssl_object'``: :class:`ssl.SSLObject` or :class:`ssl.SSLSocket` instance" msgstr "" +"``'ssl_object'``: نمونه‌ای از :class:`ssl.SSLObject` یا " +":class:`ssl.SSLSocket`" msgid "pipe:" -msgstr "" +msgstr "پایپ :" msgid "``'pipe'``: pipe object" -msgstr "" +msgstr "``'pipe'``: شیء پایپ" msgid "subprocess:" -msgstr "" +msgstr "subprocess:" msgid "``'subprocess'``: :class:`subprocess.Popen` instance" -msgstr "" +msgstr "``'subprocess'``: نمونه‌ای از :class:`subprocess.Popen`" msgid "Set a new protocol." -msgstr "" +msgstr "تنظیم یک پروتکل جدید." -msgid "Switching protocol should only be done when both protocols are documented to support the switch." +msgid "" +"Switching protocol should only be done when both protocols are documented to" +" support the switch." msgstr "" +"تعویض پروتکل تنها باید زمانی انجام شود که در مستندات آمده باشد که هر دو " +"پروتکل از این تعویض پشتیبانی می‌کنند." msgid "Return the current protocol." -msgstr "" +msgstr "پروتکل جاری را برمی‌گرداند." msgid "Read-only Transports" -msgstr "" +msgstr "انتقال‌های فقط‌خواندنی" msgid "Return ``True`` if the transport is receiving new data." msgstr "" +"اگر انتقالدر حال دریافت داده‌های جدید باشد، ``True`` را " +"برمی‌گرداند." -msgid "Pause the receiving end of the transport. No data will be passed to the protocol's :meth:`protocol.data_received() ` method until :meth:`resume_reading` is called." +msgid "" +"Pause the receiving end of the transport. No data will be passed to the " +"protocol's :meth:`protocol.data_received() ` method " +"until :meth:`resume_reading` is called." msgstr "" +"سمت دریافتی انتقالرا متوقف کنید. تا زمانی که " +":meth:`resume_reading` فراخوانی نشود، هیچ داده‌ای به متد " +":meth:`protocol.data_received() ` پروتکل منتقل " +"نخواهد شد." -msgid "The method is idempotent, i.e. it can be called when the transport is already paused or closed." +msgid "" +"The method is idempotent, i.e. it can be called when the transport is " +"already paused or closed." msgstr "" +"این متد بی‌اثر در فراخوانی هم‌توان است، یعنی می‌توان آن را زمانی " +"فراخوانی کرد که انتقالاز قبل مکث‌شده یا بسته شده باشد." -msgid "Resume the receiving end. The protocol's :meth:`protocol.data_received() ` method will be called once again if some data is available for reading." +msgid "" +"Resume the receiving end. The protocol's :meth:`protocol.data_received() " +"` method will be called once again if some data is " +"available for reading." msgstr "" +"سمت دریافت را از سر می‌گیرد. اگر داده‌ای برای خواندن در دسترس باشد، متد " +":meth:`protocol.data_received() ` پروتکل بار دیگر " +"فراخوانی خواهد شد." -msgid "The method is idempotent, i.e. it can be called when the transport is already reading." +msgid "" +"The method is idempotent, i.e. it can be called when the transport is " +"already reading." msgstr "" +"این متد هم‌توان (idempotent) است، یعنی می‌توان آن را زمانی که انتقال " +" از قبل در حال خواندن است فراخوانی کرد." msgid "Write-only Transports" -msgstr "" +msgstr "انتقال‌های فقط نوشتنی " -msgid "Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol's :meth:`protocol.connection_lost() ` method will eventually be called with :const:`None` as its argument." +msgid "" +"Close the transport immediately, without waiting for pending operations to " +"complete. Buffered data will be lost. No more data will be received. The " +"protocol's :meth:`protocol.connection_lost() `" +" method will eventually be called with :const:`None` as its argument." msgstr "" +"انتقالرا بلافاصله، بدون انتظار برای تکمیل عملیات‌های در " +"انتظار، ببندید. داده‌های بافرشده از بین خواهند رفت. دیگر داده‌ای دریافت " +"نخواهد شد. متد :meth:`protocol.connection_lost() " +"` پروتکل در نهایت با :const:`None` به‌عنوان " +"آرگومان آن فراخوانی خواهد شد." -msgid "Return :const:`True` if the transport supports :meth:`~WriteTransport.write_eof`, :const:`False` if not." +msgid "" +"Return :const:`True` if the transport supports " +":meth:`~WriteTransport.write_eof`, :const:`False` if not." msgstr "" +"اگر انتقالاز :meth:`~WriteTransport.write_eof` پشتیبانی کند، " +":const:`True` و در غیر این صورت :const:`False` برمی‌گرداند." msgid "Return the current size of the output buffer used by the transport." msgstr "" +"اندازه‌ی فعلی بافر خروجی استفاده‌شده توسط انتقال‌دهندهرا " +"برمی‌گرداند." -msgid "Get the *high* and *low* watermarks for write flow control. Return a tuple ``(low, high)`` where *low* and *high* are positive number of bytes." +msgid "" +"Get the *high* and *low* watermarks for write flow control. Return a tuple " +"``(low, high)`` where *low* and *high* are positive number of bytes." msgstr "" +"واترمارک‌های *high* و *low* را برای کنترل جریان نوشتن دریافت می‌کند. یک تاپل" +" ``(low, high)`` برمی‌گرداند که در آن *low* و *high* اعداد مثبتی از بایت‌ها " +"هستند." msgid "Use :meth:`set_write_buffer_limits` to set the limits." msgstr "" +"برای تنظیم محدودیت‌ها از :meth:`set_write_buffer_limits` استفاده کنید." msgid "Set the *high* and *low* watermarks for write flow control." msgstr "" +"آستانه‌های *بالا* و *پایین* (watermarks) برای کنترل جریان نوشتن را تنظیم " +"کنید." -msgid "These two values (measured in number of bytes) control when the protocol's :meth:`protocol.pause_writing() ` and :meth:`protocol.resume_writing() ` methods are called. If specified, the low watermark must be less than or equal to the high watermark. Neither *high* nor *low* can be negative." -msgstr "" +msgid "" +"These two values (measured in number of bytes) control when the protocol's " +":meth:`protocol.pause_writing() ` and " +":meth:`protocol.resume_writing() ` methods are " +"called. If specified, the low watermark must be less than or equal to the " +"high watermark. Neither *high* nor *low* can be negative." +msgstr "" +"این دو مقدار (که بر حسب تعداد بایت‌ها اندازه‌گیری می‌شوند) کنترل می‌کنند که " +"متدهای پروتکل، یعنی :meth:`protocol.pause_writing() " +"` و :meth:`protocol.resume_writing() " +"`، چه زمانی فراخوانی می‌شوند. در صورت مشخص شدن،" +" آستانه پایین (low watermark) باید کوچک‌تر یا مساوی آستانه بالا (high " +"watermark) باشد. هیچ‌کدام از *high* و *low* نمی‌توانند منفی باشند." -msgid ":meth:`~BaseProtocol.pause_writing` is called when the buffer size becomes greater than or equal to the *high* value. If writing has been paused, :meth:`~BaseProtocol.resume_writing` is called when the buffer size becomes less than or equal to the *low* value." +msgid "" +":meth:`~BaseProtocol.pause_writing` is called when the buffer size becomes " +"greater than or equal to the *high* value. If writing has been paused, " +":meth:`~BaseProtocol.resume_writing` is called when the buffer size becomes " +"less than or equal to the *low* value." msgstr "" +":meth:`~BaseProtocol.pause_writing` زمانی فراخوانی می‌شود که اندازه‌ی بافر " +"بزرگ‌تر یا مساوی مقدار *بالا* شود. اگر نوشتن متوقف شده باشد، " +":meth:`~BaseProtocol.resume_writing` زمانی فراخوانی می‌شود که اندازه‌ی بافر " +"کوچک‌تر یا مساوی مقدار *پایین* شود." -msgid "The defaults are implementation-specific. If only the high watermark is given, the low watermark defaults to an implementation-specific value less than or equal to the high watermark. Setting *high* to zero forces *low* to zero as well, and causes :meth:`~BaseProtocol.pause_writing` to be called whenever the buffer becomes non-empty. Setting *low* to zero causes :meth:`~BaseProtocol.resume_writing` to be called only once the buffer is empty. Use of zero for either limit is generally sub-optimal as it reduces opportunities for doing I/O and computation concurrently." -msgstr "" +msgid "" +"The defaults are implementation-specific. If only the high watermark is " +"given, the low watermark defaults to an implementation-specific value less " +"than or equal to the high watermark. Setting *high* to zero forces *low* to" +" zero as well, and causes :meth:`~BaseProtocol.pause_writing` to be called " +"whenever the buffer becomes non-empty. Setting *low* to zero causes " +":meth:`~BaseProtocol.resume_writing` to be called only once the buffer is " +"empty. Use of zero for either limit is generally sub-optimal as it reduces " +"opportunities for doing I/O and computation concurrently." +msgstr "" +"مقادیر پیش‌فرض وابسته به پیاده‌سازی هستند. اگر فقط آستانه‌ی بالا (high " +"watermark) داده شود، مقدار پیش‌فرض آستانه‌ی پایین (low watermark) مقداری " +"وابسته به پیاده‌سازی و کوچک‌تر یا مساوی آستانه‌ی بالا خواهد بود. تنظیم " +"*high* روی صفر، *low* را نیز روی صفر قرار می‌دهد و باعث می‌شود " +":meth:`~BaseProtocol.pause_writing` هر زمان که بافر غیرخالی شود، فراخوانی " +"شود. تنظیم *low* روی صفر باعث می‌شود :meth:`~BaseProtocol.resume_writing` " +"فقط زمانی فراخوانی شود که بافر خالی شود. استفاده از صفر برای هر یک از این دو" +" محدودیت معمولاً بهینه نیست، زیرا فرصت‌های انجام I/O و محاسبات به‌صورت " +"همزمان را کاهش می‌دهد." msgid "Use :meth:`~WriteTransport.get_write_buffer_limits` to get the limits." msgstr "" +"برای دریافت محدودیت‌ها از :meth:`~WriteTransport.get_write_buffer_limits` " +"استفاده کنید." msgid "Write some *data* bytes to the transport." -msgstr "" +msgstr "تعدادی بایت *data* را به انتقالبنویسید." -msgid "This method does not block; it buffers the data and arranges for it to be sent out asynchronously." +msgid "" +"This method does not block; it buffers the data and arranges for it to be " +"sent out asynchronously." msgstr "" +"این متد باعث مسدودشدن نمی‌شود؛ داده‌ها را بافر می‌کند و ترتیبی می‌دهد که " +"به‌صورت ناهمگام ارسال شوند." -msgid "Write a list (or any iterable) of data bytes to the transport. This is functionally equivalent to calling :meth:`write` on each element yielded by the iterable, but may be implemented more efficiently." +msgid "" +"Write a list (or any iterable) of data bytes to the transport. This is " +"functionally equivalent to calling :meth:`write` on each element yielded by " +"the iterable, but may be implemented more efficiently." msgstr "" +"یک فهرست (یا هر پیمایش‌پذیری) از بایت‌های داده را به انتقال‌دهنده " +"بنویسید. این کار از نظر عملکردی معادل فراخوانی :meth:`write` روی هر عنصری " +"است که پیمایش‌پذیر تولید می‌کند، اما ممکن است به‌شکل کارآمدتری پیاده‌سازی شده " +"باشد." -msgid "Close the write end of the transport after flushing all buffered data. Data may still be received." +msgid "" +"Close the write end of the transport after flushing all buffered data. Data " +"may still be received." msgstr "" +"پس از تخلیه‌ی تمام داده‌های بافرشده، سمت نوشتاری انتقالرا " +"ببندید. ممکن است هنوز داده‌هایی دریافت شوند." -msgid "This method can raise :exc:`NotImplementedError` if the transport (e.g. SSL) doesn't support half-closed connections." +msgid "" +"This method can raise :exc:`NotImplementedError` if the transport (e.g. SSL)" +" doesn't support half-closed connections." msgstr "" +"این متد ممکن است در صورتی که انتقال (transport، برای مثال SSL) از اتصالات " +"نیمه‌بسته پشتیبانی نکند، :exc:`NotImplementedError` را پرتاب کند." msgid "Datagram Transports" -msgstr "" +msgstr "انتقال‌های دیتاگرام (Datagram Transports)" -msgid "Send the *data* bytes to the remote peer given by *addr* (a transport-dependent target address). If *addr* is :const:`None`, the data is sent to the target address given on transport creation." +msgid "" +"Send the *data* bytes to the remote peer given by *addr* (a transport-" +"dependent target address). If *addr* is :const:`None`, the data is sent to " +"the target address given on transport creation." msgstr "" +"بایت‌های *data* را به همتای راه دور مشخص‌شده توسط *addr* (یک آدرس مقصد " +"وابسته به انتقال) ارسال کنید. اگر *addr* برابر :const:`None` باشد، داده‌ها " +"به آدرس مقصد مشخص‌شده در هنگام ایجاد انتقال ارسال می‌شوند." -msgid "This method can be called with an empty bytes object to send a zero-length datagram. The buffer size calculation used for flow control is also updated to account for the datagram header." +msgid "" +"This method can be called with an empty bytes object to send a zero-length " +"datagram. The buffer size calculation used for flow control is also updated " +"to account for the datagram header." msgstr "" +"این متد را می‌توان با یک شیء bytes خالی فراخوانی کرد تا یک دیتاگرام " +"(datagram) با طول صفر ارسال شود. محاسبه‌ی اندازه‌ی بافرکه برای " +"کنترل جریان استفاده می‌شود نیز به‌روزرسانی می‌شود تا سرآیند دیتاگرام را در " +"نظر بگیرد." -msgid "Close the transport immediately, without waiting for pending operations to complete. Buffered data will be lost. No more data will be received. The protocol's :meth:`protocol.connection_lost() ` method will eventually be called with :const:`None` as its argument." +msgid "" +"Close the transport immediately, without waiting for pending operations to " +"complete. Buffered data will be lost. No more data will be received. The " +"protocol's :meth:`protocol.connection_lost() `" +" method will eventually be called with :const:`None` as its argument." msgstr "" +"انتقالرا بلافاصله ببندید، بدون انتظار برای تکمیل عملیات‌های " +"در انتظار. داده‌های میان‌گیرشده از دست خواهند رفت. دیگر داده‌ای دریافت " +"نخواهد شد. متد :meth:`protocol.connection_lost() " +"` پروتکل در نهایت با :const:`None` به‌عنوان " +"آرگومان آن فراخوانی خواهد شد." msgid "Subprocess Transports" -msgstr "" +msgstr "انتقال‌های زیرفرایند" msgid "Return the subprocess process id as an integer." -msgstr "" +msgstr "شناسه فرایند زیرفرایند را به‌صورت یک عدد صحیح برمی‌گرداند." -msgid "Return the transport for the communication pipe corresponding to the integer file descriptor *fd*:" +msgid "" +"Return the transport for the communication pipe corresponding to the integer" +" file descriptor *fd*:" msgstr "" +"انتقال برای پایپ ارتباطی متناظر با توصیف‌گر فایل عدد صحیح *fd*" +" را برمی‌گرداند:" -msgid "``0``: writable streaming transport of the standard input (*stdin*), or :const:`None` if the subprocess was not created with ``stdin=PIPE``" +msgid "" +"``0``: writable streaming transport of the standard input (*stdin*), or " +":const:`None` if the subprocess was not created with ``stdin=PIPE``" msgstr "" +"``0``: انتقال جریانی قابل نوشتنبرای ورودی استاندارد (*stdin*)، " +"یا :const:`None` اگر زیرفرایند با ``stdin=PIPE`` ایجاد نشده باشد" -msgid "``1``: readable streaming transport of the standard output (*stdout*), or :const:`None` if the subprocess was not created with ``stdout=PIPE``" +msgid "" +"``1``: readable streaming transport of the standard output (*stdout*), or " +":const:`None` if the subprocess was not created with ``stdout=PIPE``" msgstr "" +"``1``: ترابری جریانی قابل‌خواندن برای خروجی استاندارد (*stdout*)، یا " +":const:`None` اگر زیرفرآیند با ``stdout=PIPE`` ایجاد نشده باشد" -msgid "``2``: readable streaming transport of the standard error (*stderr*), or :const:`None` if the subprocess was not created with ``stderr=PIPE``" +msgid "" +"``2``: readable streaming transport of the standard error (*stderr*), or " +":const:`None` if the subprocess was not created with ``stderr=PIPE``" msgstr "" +"``2``: انتقال جریانی قابل خواندن برای خطای استاندارد (*stderr*)، یا " +":const:`None` اگر زیرفرآیند با ``stderr=PIPE`` ایجاد نشده باشد" msgid "other *fd*: :const:`None`" -msgstr "" +msgstr "*fd* دیگر: :const:`None`" -msgid "Return the subprocess return code as an integer or :const:`None` if it hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode` attribute." +msgid "" +"Return the subprocess return code as an integer or :const:`None` if it " +"hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode`" +" attribute." msgstr "" +"کد بازگشت زیرفرایند را به‌صورت یک عدد صحیح، یا در صورتی که هنوز به پایان " +"نرسیده باشد به‌صورت :const:`None` برمی‌گرداند، که مشابه ویژگی " +":attr:`subprocess.Popen.returncode` است." msgid "Kill the subprocess." -msgstr "" +msgstr "زیرفرایند را خاتمه دهید." -msgid "On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, this method is an alias for :meth:`terminate`." +msgid "" +"On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, " +"this method is an alias for :meth:`terminate`." msgstr "" +"در سیستم‌های POSIX، این تابع SIGKILL را به زیرفرایند ارسال می‌کند. در " +"ویندوز، این متد نام مستعاری برای :meth:`terminate` است." msgid "See also :meth:`subprocess.Popen.kill`." -msgstr "" +msgstr "همچنین :meth:`subprocess.Popen.kill` را ببینید." -msgid "Send the *signal* number to the subprocess, as in :meth:`subprocess.Popen.send_signal`." +msgid "" +"Send the *signal* number to the subprocess, as in " +":meth:`subprocess.Popen.send_signal`." msgstr "" +"شماره‌ی *signal* را به زیرفرایند ارسال کنید، همان‌طور که در " +":meth:`subprocess.Popen.send_signal` انجام می‌شود." msgid "Stop the subprocess." -msgstr "" +msgstr "زیرفرایند را متوقف کنید." -msgid "On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` is called to stop the subprocess." +msgid "" +"On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the " +"subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess`" +" is called to stop the subprocess." msgstr "" +"در سیستم‌های POSIX، این متد :py:const:`~signal.SIGTERM` را به زیرفرایند " +"ارسال می‌کند. در ویندوز، تابع API ویندوز :c:func:`!TerminateProcess` برای " +"متوقف کردن زیرفرایند فراخوانی می‌شود." msgid "See also :meth:`subprocess.Popen.terminate`." -msgstr "" +msgstr "همچنین :meth:`subprocess.Popen.terminate` را ببینید." msgid "Kill the subprocess by calling the :meth:`kill` method." -msgstr "" +msgstr "زیرفرایند را با فراخوانی متد :meth:`kill` خاتمه دهید." -msgid "If the subprocess hasn't returned yet, and close transports of *stdin*, *stdout*, and *stderr* pipes." +msgid "" +"If the subprocess hasn't returned yet, and close transports of *stdin*, " +"*stdout*, and *stderr* pipes." msgstr "" +"اگر زیرفرایند هنوز بازگشت نکرده است، و انتقال‌های پایپ‌های " +"*stdin*، *stdout* و *stderr* را ببندید." msgid "Protocols" -msgstr "" +msgstr "پروتکل‌ها" msgid "**Source code:** :source:`Lib/asyncio/protocols.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/asyncio/protocols.py`" -msgid "asyncio provides a set of abstract base classes that should be used to implement network protocols. Those classes are meant to be used together with :ref:`transports `." +msgid "" +"asyncio provides a set of abstract base classes that should be used to " +"implement network protocols. Those classes are meant to be used together " +"with :ref:`transports `." msgstr "" +"asyncio مجموعه‌ای از کلاس‌های پایه انتزاعی را فراهم می‌کند که باید برای " +"پیاده‌سازی پروتکل‌های شبکه از آن‌ها استفاده شود. این کلاس‌ها برای استفاده " +"همراه با :ref:`transports ` در نظر گرفته شده‌اند." -msgid "Subclasses of abstract base protocol classes may implement some or all methods. All these methods are callbacks: they are called by transports on certain events, for example when some data is received. A base protocol method should be called by the corresponding transport." +msgid "" +"Subclasses of abstract base protocol classes may implement some or all " +"methods. All these methods are callbacks: they are called by transports on " +"certain events, for example when some data is received. A base protocol " +"method should be called by the corresponding transport." msgstr "" +"زیرکلاس‌های کلاس‌های پایه‌ی انتزاعی پروتکل ممکن است برخی یا همه‌ی متدها را " +"پیاده‌سازی کنند. همه‌ی این متدها کال‌بک هستند: آن‌ها توسط انتقال‌دهنده‌ها " +" در رویدادهای خاصی فراخوانی می‌شوند، برای مثال هنگامی که " +"داده‌هایی دریافت می‌شود. یک متد از پروتکل پایه باید توسط انتقال‌دهنده‌ی " +"متناظر فراخوانی شود." msgid "Base Protocols" -msgstr "" +msgstr "پروتکل‌های پایه" msgid "Base protocol with methods that all protocols share." -msgstr "" +msgstr "پروتکل پایه با متدهایی که تمام پروتکل‌ها به اشتراک می‌گذارند." -msgid "The base class for implementing streaming protocols (TCP, Unix sockets, etc)." +msgid "" +"The base class for implementing streaming protocols (TCP, Unix sockets, " +"etc)." msgstr "" +"کلاس پایه برای پیاده‌سازی پروتکل‌های جریانی (TCP، سوکت‌های Unix و غیره)." -msgid "A base class for implementing streaming protocols with manual control of the receive buffer." +msgid "" +"A base class for implementing streaming protocols with manual control of the" +" receive buffer." msgstr "" +"یک کلاس پایه برای پیاده‌سازی پروتکل‌های جریانی (streaming protocols) با " +"کنترل دستی بر بافر دریافت." msgid "The base class for implementing datagram (UDP) protocols." -msgstr "" +msgstr "کلاس پایه برای پیاده‌سازی پروتکل‌های دیتاگرام (UDP)." -msgid "The base class for implementing protocols communicating with child processes (unidirectional pipes)." +msgid "" +"The base class for implementing protocols communicating with child processes" +" (unidirectional pipes)." msgstr "" +"کلاس پایه برای پیاده‌سازی پروتکل‌های ارتباط با فرایندهای فرزند (پایپ‌های " +"یک‌طرفه)." msgid "Base Protocol" -msgstr "" +msgstr "پروتکل پایه" msgid "All asyncio protocols can implement Base Protocol callbacks." msgstr "" +"تمام پروتکل‌های asyncio می‌توانند کال‌بک‌های پروتکل پایه را پیاده‌سازی کنند." msgid "Connection Callbacks" -msgstr "" +msgstr "کال‌بک‌های اتصال" -msgid "Connection callbacks are called on all protocols, exactly once per a successful connection. All other protocol callbacks can only be called between those two methods." +msgid "" +"Connection callbacks are called on all protocols, exactly once per a " +"successful connection. All other protocol callbacks can only be called " +"between those two methods." msgstr "" +"کال‌بک‌های اتصال در تمام پروتکل‌ها، دقیقاً یک بار به‌ازای هر اتصال موفق " +"فراخوانی می‌شوند. سایر کال‌بک‌های پروتکل فقط می‌توانند بین آن دو متد " +"فراخوانی شوند." msgid "Called when a connection is made." -msgstr "" +msgstr "هنگامی که یک اتصال برقرار می‌شود، فراخوانی می‌شود." -msgid "The *transport* argument is the transport representing the connection. The protocol is responsible for storing the reference to its transport." +msgid "" +"The *transport* argument is the transport representing the connection. The " +"protocol is responsible for storing the reference to its transport." msgstr "" +"آرگومان *transport*، انتقالی است که نشان‌دهنده‌ی اتصال است. پروتکل مسئول " +"ذخیره‌سازی ارجاع به انتقال خود است." msgid "Called when the connection is lost or closed." -msgstr "" +msgstr "در صورت قطع یا بسته شدن اتصال، فراخوانی می‌شود." -msgid "The argument is either an exception object or :const:`None`. The latter means a regular EOF is received, or the connection was aborted or closed by this side of the connection." +msgid "" +"The argument is either an exception object or :const:`None`. The latter " +"means a regular EOF is received, or the connection was aborted or closed by " +"this side of the connection." msgstr "" +"این آرگومان یا یک شیء استثنا است یا :const:`None`. مورد دوم به این معناست که" +" یک EOF معمولی دریافت شده است، یا اتصال از این سمت اتصال قطع یا بسته شده " +"است." msgid "Flow Control Callbacks" -msgstr "" +msgstr "کال‌بک‌های کنترل جریان" -msgid "Flow control callbacks can be called by transports to pause or resume writing performed by the protocol." +msgid "" +"Flow control callbacks can be called by transports to pause or resume " +"writing performed by the protocol." msgstr "" +"کال‌بک‌های کنترل جریان می‌توانند توسط انتقال‌هابرای مکث یا " +"از سرگیری نوشتن انجام‌شده توسط پروتکل فراخوانی شوند." -msgid "See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits` method for more details." +msgid "" +"See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits`" +" method for more details." msgstr "" +"برای جزئیات بیشتر، مستندات متد " +":meth:`~WriteTransport.set_write_buffer_limits` را ببینید." msgid "Called when the transport's buffer goes over the high watermark." msgstr "" +"هنگامی که بافرانتقالاز آستانه‌ی بالا (high watermark) " +"عبور کند، فراخوانی می‌شود." msgid "Called when the transport's buffer drains below the low watermark." msgstr "" +"هنگامی که بافر انتقالبه کمتر از آستانه پایین (low watermark) " +"تخلیه می‌شود، فراخوانی می‌شود." -msgid "If the buffer size equals the high watermark, :meth:`~BaseProtocol.pause_writing` is not called: the buffer size must go strictly over." +msgid "" +"If the buffer size equals the high watermark, " +":meth:`~BaseProtocol.pause_writing` is not called: the buffer size must go " +"strictly over." msgstr "" +"اگر اندازه‌ی بافر برابر با آستانه‌ی بالا (high watermark) باشد، " +":meth:`~BaseProtocol.pause_writing` فراخوانی نمی‌شود: اندازه‌ی بافر باید " +"به‌طور اکید از آن عبور کند." -msgid "Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer size is equal or lower than the low watermark. These end conditions are important to ensure that things go as expected when either mark is zero." +msgid "" +"Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer " +"size is equal or lower than the low watermark. These end conditions are " +"important to ensure that things go as expected when either mark is zero." msgstr "" +"در مقابل، :meth:`~BaseProtocol.resume_writing` زمانی فراخوانی می‌شود که " +"اندازه‌ی بافر برابر یا کمتر از آستانه‌ی پایین باشد. این شرایط پایان برای " +"اطمینان از اینکه در صفر بودن هر یک از این آستانه‌ها روند کار مطابق انتظار " +"باشد، مهم هستند." msgid "Streaming Protocols" -msgstr "" +msgstr "پروتکل‌های جریانی" -msgid "Event methods, such as :meth:`loop.create_server`, :meth:`loop.create_unix_server`, :meth:`loop.create_connection`, :meth:`loop.create_unix_connection`, :meth:`loop.connect_accepted_socket`, :meth:`loop.connect_read_pipe`, and :meth:`loop.connect_write_pipe` accept factories that return streaming protocols." -msgstr "" +msgid "" +"Event methods, such as :meth:`loop.create_server`, " +":meth:`loop.create_unix_server`, :meth:`loop.create_connection`, " +":meth:`loop.create_unix_connection`, :meth:`loop.connect_accepted_socket`, " +":meth:`loop.connect_read_pipe`, and :meth:`loop.connect_write_pipe` accept " +"factories that return streaming protocols." +msgstr "" +"متدهای رویداد، مانند :meth:`loop.create_server`، " +":meth:`loop.create_unix_server`، :meth:`loop.create_connection`، " +":meth:`loop.create_unix_connection`، :meth:`loop.connect_accepted_socket`، " +":meth:`loop.connect_read_pipe` و :meth:`loop.connect_write_pipe`، " +"کارخانه‌هایی را می‌پذیرند که پروتکل‌های جریانی را برمی‌گردانند." -msgid "Called when some data is received. *data* is a non-empty bytes object containing the incoming data." +msgid "" +"Called when some data is received. *data* is a non-empty bytes object " +"containing the incoming data." msgstr "" +"هنگامی که داده‌ای دریافت می‌شود، فراخوانی می‌شود. *data* یک شیء bytes " +"غیرخالی است که حاوی داده‌های ورودی است." -msgid "Whether the data is buffered, chunked or reassembled depends on the transport. In general, you shouldn't rely on specific semantics and instead make your parsing generic and flexible. However, data is always received in the correct order." +msgid "" +"Whether the data is buffered, chunked or reassembled depends on the " +"transport. In general, you shouldn't rely on specific semantics and instead" +" make your parsing generic and flexible. However, data is always received in" +" the correct order." msgstr "" +"اینکه داده‌ها بافر شوند (buffered)، بخش‌بندی شوند (chunked) یا بازهم‌سازی " +"شوند (reassembled)، به انتقالبستگی دارد. به‌طور کلی، نباید به " +"معناشناسی خاصی تکیه کنید و در عوض تجزیه خود را عام و انعطاف‌پذیر کنید. با " +"این حال، داده‌ها همیشه به ترتیب صحیح دریافت می‌شوند." -msgid "The method can be called an arbitrary number of times while a connection is open." +msgid "" +"The method can be called an arbitrary number of times while a connection is " +"open." msgstr "" +"این متد را می‌توان به تعداد دفعات دلخواه، تا زمانی که یک اتصال باز است، " +"فراخوانی کرد." -msgid "However, :meth:`protocol.eof_received() ` is called at most once. Once ``eof_received()`` is called, ``data_received()`` is not called anymore." +msgid "" +"However, :meth:`protocol.eof_received() ` is called " +"at most once. Once ``eof_received()`` is called, ``data_received()`` is not" +" called anymore." msgstr "" +"با این حال، :meth:`protocol.eof_received() ` حداکثر " +"یک‌بار فراخوانی می‌شود. پس از فراخوانی ``eof_received()``، دیگر " +"``data_received()`` فراخوانی نمی‌شود." -msgid "Called when the other end signals it won't send any more data (for example by calling :meth:`transport.write_eof() `, if the other end also uses asyncio)." +msgid "" +"Called when the other end signals it won't send any more data (for example " +"by calling :meth:`transport.write_eof() `, if the " +"other end also uses asyncio)." msgstr "" +"هنگامی فراخوانی می‌شود که طرف مقابل اعلام کند دیگر داده‌ای ارسال نخواهد کرد " +"(برای مثال با فراخوانی :meth:`transport.write_eof() " +"`، اگر طرف مقابل نیز از asyncio استفاده کند)." -msgid "This method may return a false value (including ``None``), in which case the transport will close itself. Conversely, if this method returns a true value, the protocol used determines whether to close the transport. Since the default implementation returns ``None``, it implicitly closes the connection." -msgstr "" +msgid "" +"This method may return a false value (including ``None``), in which case the" +" transport will close itself. Conversely, if this method returns a true " +"value, the protocol used determines whether to close the transport. Since " +"the default implementation returns ``None``, it implicitly closes the " +"connection." +msgstr "" +"این متد ممکن است یک مقدار نادرست (از جمله ``None``) برگرداند، که در این صورت" +" انتقالخود بسته خواهد شد. در مقابل، اگر این متد یک مقدار درست" +" برگرداند، پروتکل استفاده‌شده تعیین می‌کند که آیا انتقالبسته " +"شود یا خیر. از آن‌جا که پیاده‌سازی پیش‌فرض ``None`` را برمی‌گرداند، به‌طور " +"ضمنی اتصال را می‌بندد." -msgid "Some transports, including SSL, don't support half-closed connections, in which case returning true from this method will result in the connection being closed." +msgid "" +"Some transports, including SSL, don't support half-closed connections, in " +"which case returning true from this method will result in the connection " +"being closed." msgstr "" +"برخی انتقال‌ها ، از جمله SSL، از اتصال‌های نیمه‌بسته پشتیبانی " +"نمی‌کنند؛ در این صورت، برگرداندن true از این متد منجر به بسته شدن اتصال " +"خواهد شد." msgid "State machine:" -msgstr "" +msgstr "ماشین حالت:" msgid "" "start -> connection_made\n" @@ -453,39 +922,87 @@ msgid "" " [-> eof_received]?\n" "-> connection_lost -> end" msgstr "" +"start -> connection_made\n" +" [-> data_received]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" msgid "Buffered Streaming Protocols" -msgstr "" +msgstr "پروتکل‌های جریان بافرشده" -msgid "Buffered Protocols can be used with any event loop method that supports `Streaming Protocols`_." +msgid "" +"Buffered Protocols can be used with any event loop method that supports " +"`Streaming Protocols`_." msgstr "" +"می‌توان از پروتکل‌های بافری با هر متدی از حلقه رویداد که از `Streaming " +"Protocols`_ پشتیبانی می‌کند، استفاده کرد." -msgid "``BufferedProtocol`` implementations allow explicit manual allocation and control of the receive buffer. Event loops can then use the buffer provided by the protocol to avoid unnecessary data copies. This can result in noticeable performance improvement for protocols that receive big amounts of data. Sophisticated protocol implementations can significantly reduce the number of buffer allocations." -msgstr "" +msgid "" +"``BufferedProtocol`` implementations allow explicit manual allocation and " +"control of the receive buffer. Event loops can then use the buffer provided" +" by the protocol to avoid unnecessary data copies. This can result in " +"noticeable performance improvement for protocols that receive big amounts of" +" data. Sophisticated protocol implementations can significantly reduce the " +"number of buffer allocations." +msgstr "" +"پیاده‌سازی‌های ``BufferedProtocol`` امکان تخصیص و کنترل دستی صریح بافر " +"دریافت را فراهم می‌کنند. حلقه‌های رویداد می‌توانند سپس از بافر فراهم‌شده " +"توسط پروتکل برای اجتناب از کپی‌های غیرضروری داده استفاده کنند. این موضوع " +"می‌تواند منجر به بهبود محسوس کارایی برای پروتکل‌هایی شود که حجم زیادی از " +"داده را دریافت می‌کنند. پیاده‌سازی‌های پیشرفته‌ی پروتکل می‌توانند تعداد " +"تخصیص‌های بافر را به‌طور قابل‌توجهی کاهش دهند." -msgid "The following callbacks are called on :class:`BufferedProtocol` instances:" +msgid "" +"The following callbacks are called on :class:`BufferedProtocol` instances:" msgstr "" +"کال‌بک‌های زیر بر روی نمونه‌های :class:`BufferedProtocol` فراخوانی می‌شوند:" msgid "Called to allocate a new receive buffer." -msgstr "" +msgstr "برای تخصیص یک بافر دریافت جدید فراخوانی می‌شود." -msgid "*sizehint* is the recommended minimum size for the returned buffer. It is acceptable to return smaller or larger buffers than what *sizehint* suggests. When set to -1, the buffer size can be arbitrary. It is an error to return a buffer with a zero size." +msgid "" +"*sizehint* is the recommended minimum size for the returned buffer. It is " +"acceptable to return smaller or larger buffers than what *sizehint* " +"suggests. When set to -1, the buffer size can be arbitrary. It is an error " +"to return a buffer with a zero size." msgstr "" +"*sizehint* حداقل اندازه‌ی پیشنهادی برای بافر برگردانده‌شده است. بازگرداندن " +"بافرهای کوچک‌تر یا بزرگ‌تر از آنچه *sizehint* پیشنهاد می‌دهد، مجاز است. " +"هنگامی که روی -1 تنظیم شود، اندازه‌ی بافر می‌تواند دلخواه باشد. بازگرداندن " +"بافری با اندازه‌ی صفر خطا است." -msgid "``get_buffer()`` must return an object implementing the :ref:`buffer protocol `." +msgid "" +"``get_buffer()`` must return an object implementing the :ref:`buffer " +"protocol `." msgstr "" +"``get_buffer()`` باید شیءای را برگرداند که :ref:`پروتکل بافر `" +" را پیاده‌سازی کند." msgid "Called when the buffer was updated with the received data." -msgstr "" +msgstr "هنگامی که بافر با داده‌های دریافتی به‌روزرسانی شد، فراخوانی می‌شود." msgid "*nbytes* is the total number of bytes that were written to the buffer." -msgstr "" +msgstr "*nbytes* تعداد کل بایت‌هایی است که در بافر نوشته شده‌اند." -msgid "See the documentation of the :meth:`protocol.eof_received() ` method." +msgid "" +"See the documentation of the :meth:`protocol.eof_received() " +"` method." msgstr "" +"مستندات متد :meth:`protocol.eof_received() ` را " +"ببینید." -msgid ":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of times during a connection. However, :meth:`protocol.eof_received() ` is called at most once and, if called, :meth:`~BufferedProtocol.get_buffer` and :meth:`~BufferedProtocol.buffer_updated` won't be called after it." -msgstr "" +msgid "" +":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of " +"times during a connection. However, :meth:`protocol.eof_received() " +"` is called at most once and, if called, " +":meth:`~BufferedProtocol.get_buffer` and " +":meth:`~BufferedProtocol.buffer_updated` won't be called after it." +msgstr "" +":meth:`~BufferedProtocol.get_buffer` می‌تواند تعداد دلخواهی بار در طول یک " +"اتصال فراخوانی شود. با این حال، :meth:`protocol.eof_received() " +"` حداکثر یک بار فراخوانی می‌شود و در صورت فراخوانی، " +"پس از آن :meth:`~BufferedProtocol.get_buffer` و " +":meth:`~BufferedProtocol.buffer_updated` فراخوانی نخواهند شد." msgid "" "start -> connection_made\n" @@ -495,63 +1012,123 @@ msgid "" " [-> eof_received]?\n" "-> connection_lost -> end" msgstr "" +"start -> connection_made\n" +" [-> get_buffer\n" +" [-> buffer_updated]?\n" +" ]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" msgid "Datagram Protocols" -msgstr "" +msgstr "پروتکل‌های دیتاگرام" -msgid "Datagram Protocol instances should be constructed by protocol factories passed to the :meth:`loop.create_datagram_endpoint` method." +msgid "" +"Datagram Protocol instances should be constructed by protocol factories " +"passed to the :meth:`loop.create_datagram_endpoint` method." msgstr "" +"نمونه‌های پروتکل دیتاگرام (Datagram Protocol) باید توسط کارخانه‌های پروتکل " +"(protocol factories) که به متد :meth:`loop.create_datagram_endpoint` داده " +"می‌شوند، ساخته شوند." -msgid "Called when a datagram is received. *data* is a bytes object containing the incoming data. *addr* is the address of the peer sending the data; the exact format depends on the transport." +msgid "" +"Called when a datagram is received. *data* is a bytes object containing the" +" incoming data. *addr* is the address of the peer sending the data; the " +"exact format depends on the transport." msgstr "" +"هنگام دریافت یک دیتاگرام فراخوانی می‌شود. *data* یک شیء bytes حاوی داده‌های " +"دریافتی است. *addr* نشانی همتای ارسال‌کننده‌ی داده‌ها است؛ قالب دقیق آن به " +"انتقالبستگی دارد." -msgid "Called when a previous send or receive operation raises an :class:`OSError`. *exc* is the :class:`OSError` instance." +msgid "" +"Called when a previous send or receive operation raises an :class:`OSError`." +" *exc* is the :class:`OSError` instance." msgstr "" +"هنگامی که یک عملیات ارسال یا دریافت پیشین یک :class:`OSError` را پرتاب کند، " +"فراخوانی می‌شود. *exc* یک نمونه از :class:`OSError` است." -msgid "This method is called in rare conditions, when the transport (e.g. UDP) detects that a datagram could not be delivered to its recipient. In many conditions though, undeliverable datagrams will be silently dropped." +msgid "" +"This method is called in rare conditions, when the transport (e.g. UDP) " +"detects that a datagram could not be delivered to its recipient. In many " +"conditions though, undeliverable datagrams will be silently dropped." msgstr "" +"این متد در شرایط نادر فراخوانی می‌شود، زمانی که انتقال (مثلاً UDP) تشخیص دهد" +" که یک دیتاگرام نتوانسته است به گیرنده خود تحویل داده شود. هرچند در بسیاری " +"از شرایط، دیتاگرام‌های غیرقابل‌تحویل به‌صورت خاموش دور انداخته می‌شوند." -msgid "On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for datagram protocols, because there is no reliable way to detect send failures caused by writing too many packets." +msgid "" +"On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for " +"datagram protocols, because there is no reliable way to detect send failures" +" caused by writing too many packets." msgstr "" +"در سیستم‌های BSD (macOS، FreeBSD و غیره) کنترل جریان برای پروتکل‌های " +"دیتاگرام پشتیبانی نمی‌شود، زیرا روش قابل‌اطمینانی برای تشخیص شکست‌های ارسال " +"ناشی از نوشتن تعداد بیش‌ازحد بسته وجود ندارد." -msgid "The socket always appears 'ready' and excess packets are dropped. An :class:`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not be raised; if it is raised, it will be reported to :meth:`DatagramProtocol.error_received` but otherwise ignored." +msgid "" +"The socket always appears 'ready' and excess packets are dropped. An " +":class:`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not" +" be raised; if it is raised, it will be reported to " +":meth:`DatagramProtocol.error_received` but otherwise ignored." msgstr "" +"سوکت همیشه «آماده» به نظر می‌رسد و بسته‌های مازاد دور انداخته می‌شوند. ممکن " +"است یک :class:`OSError` با ``errno`` تنظیم‌شده روی :const:`errno.ENOBUFS` " +"پرتاب شود یا نشود؛ اگر پرتاب شود، به :meth:`DatagramProtocol.error_received`" +" گزارش می‌شود اما در غیر این صورت نادیده گرفته می‌شود." msgid "Subprocess Protocols" -msgstr "" +msgstr "پروتکل‌های زیرفرایند" -msgid "Subprocess Protocol instances should be constructed by protocol factories passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." +msgid "" +"Subprocess Protocol instances should be constructed by protocol factories " +"passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell`" +" methods." msgstr "" +"نمونه‌های پروتکل زیرفرایند باید به‌وسیله‌ی کارخانه‌های پروتکل داده‌شده به " +"متدهای :meth:`loop.subprocess_exec` و :meth:`loop.subprocess_shell` ساخته " +"شوند." -msgid "Called when the child process writes data into its stdout or stderr pipe." +msgid "" +"Called when the child process writes data into its stdout or stderr pipe." msgstr "" +"هنگامی فراخوانی می‌شود که فرایند فرزند داده‌ای را در پایپ stdout یا stderr " +"خود بنویسد." msgid "*fd* is the integer file descriptor of the pipe." -msgstr "" +msgstr "*fd* توصیف‌گر فایل (file descriptor) عدد صحیحِ پایپاست." msgid "*data* is a non-empty bytes object containing the received data." -msgstr "" +msgstr "*data* یک شیء bytes غیرخالی حاوی داده‌های دریافتی است." -msgid "Called when one of the pipes communicating with the child process is closed." +msgid "" +"Called when one of the pipes communicating with the child process is closed." msgstr "" +"هنگامی فراخوانی می‌شود که یکی از پایپ‌های ارتباطی با فرایند فرزند بسته شود." msgid "*fd* is the integer file descriptor that was closed." -msgstr "" +msgstr "*fd* توصیف‌گر فایل از نوع عدد صحیح است که بسته شده است." msgid "Called when the child process has exited." -msgstr "" +msgstr "هنگامی فراخوانی می‌شود که فرایند فرزند خارج شده باشد." -msgid "It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgid "" +"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and " +":meth:`~SubprocessProtocol.pipe_connection_lost` methods." msgstr "" +"می‌توان آن را پیش از متدهای :meth:`~SubprocessProtocol.pipe_data_received` و" +" :meth:`~SubprocessProtocol.pipe_connection_lost` فراخوانی کرد." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "TCP Echo Server" -msgstr "" +msgstr "سرور اکو TCP" -msgid "Create a TCP echo server using the :meth:`loop.create_server` method, send back received data, and close the connection::" +msgid "" +"Create a TCP echo server using the :meth:`loop.create_server` method, send " +"back received data, and close the connection::" msgstr "" +"با استفاده از متد :meth:`loop.create_server` یک سرور اکوی TCP ایجاد کنید، " +"داده‌های دریافتی را بازگردانید و اتصال را ببندید::" msgid "" "import asyncio\n" @@ -589,15 +1166,57 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol(asyncio.Protocol):\n" +" def connection_made(self, transport):\n" +" peername = transport.get_extra_info('peername')\n" +" print('Connection from {}'.format(peername))\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" message = data.decode()\n" +" print('Data received: {!r}'.format(message))\n" +"\n" +" print('Send: {!r}'.format(message))\n" +" self.transport.write(data)\n" +"\n" +" print('Close the client socket')\n" +" self.transport.close()\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" server = await loop.create_server(\n" +" EchoServerProtocol,\n" +" '127.0.0.1', 8888)\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"\n" +"asyncio.run(main())" -msgid "The :ref:`TCP echo server using streams ` example uses the high-level :func:`asyncio.start_server` function." +msgid "" +"The :ref:`TCP echo server using streams ` " +"example uses the high-level :func:`asyncio.start_server` function." msgstr "" +"مثال :ref:`سرور اکوی TCP با استفاده از جریان‌ها ` از تابع سطح بالای :func:`asyncio.start_server` استفاده می‌کند." msgid "TCP Echo Client" -msgstr "" +msgstr "سرویس‌گیرنده‌ی پژواک TCP" -msgid "A TCP echo client using the :meth:`loop.create_connection` method, sends data, and waits until the connection is closed::" +msgid "" +"A TCP echo client using the :meth:`loop.create_connection` method, sends " +"data, and waits until the connection is closed::" msgstr "" +"یک کلاینت اکوی TCP با استفاده از متد :meth:`loop.create_connection`، داده " +"ارسال می‌کند و منتظر می‌ماند تا اتصال بسته شود::" msgid "" "import asyncio\n" @@ -642,15 +1261,64 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol(asyncio.Protocol):\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" transport.write(self.message.encode())\n" +" print('Data sent: {!r}'.format(self.message))\n" +"\n" +" def data_received(self, data):\n" +" print('Data received: {!r}'.format(data.decode()))\n" +"\n" +" def connection_lost(self, exc):\n" +" print('The server closed the connection')\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # ارجاعی به حلقه رویداد دریافت می‌کنیم، زیرا قصد داریم\n" +" # از APIهای سطح پایین استفاده کنیم.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = 'Hello World!'\n" +"\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" '127.0.0.1', 8888)\n" +"\n" +" # منتظر بمانید تا پروتکل اعلام کند که اتصال\n" +" # از دست رفته است و سپس transport را ببندید.\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" -msgid "The :ref:`TCP echo client using streams ` example uses the high-level :func:`asyncio.open_connection` function." +msgid "" +"The :ref:`TCP echo client using streams ` " +"example uses the high-level :func:`asyncio.open_connection` function." msgstr "" +"مثال :ref:`TCP echo client using streams ` " +"از تابع سطح بالای :func:`asyncio.open_connection` استفاده می‌کند." msgid "UDP Echo Server" -msgstr "" +msgstr "سرور پژواک UDP" -msgid "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, sends back received data::" +msgid "" +"A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " +"sends back received data::" msgstr "" +"یک سرور اکو UDP، با استفاده از متد :meth:`loop.create_datagram_endpoint`، " +"داده‌های دریافتی را بازمی‌گرداند::" msgid "" "import asyncio\n" @@ -688,12 +1356,51 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol:\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def datagram_received(self, data, addr):\n" +" message = data.decode()\n" +" print('Received %r from %s' % (message, addr))\n" +" print('Send %r to %s' % (message, addr))\n" +" self.transport.sendto(data, addr)\n" +"\n" +"\n" +"async def main():\n" +" print(\"Starting UDP server\")\n" +"\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # One protocol instance will be created to serve all\n" +" # client requests.\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" EchoServerProtocol,\n" +" local_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await asyncio.sleep(3600) # Serve for 1 hour.\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" msgid "UDP Echo Client" -msgstr "" +msgstr "کارخواه پژواک UDP" -msgid "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, sends data and closes the transport when it receives the answer::" +msgid "" +"A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " +"sends data and closes the transport when it receives the answer::" msgstr "" +"یک کلاینت پژواک UDP، با استفاده از متد " +":meth:`loop.create_datagram_endpoint`، داده‌ها را ارسال می‌کند و هنگامی که " +"پاسخ را دریافت می‌کند، انتقال را می‌بندد::" msgid "" "import asyncio\n" @@ -744,12 +1451,63 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol:\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +" self.transport = None\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +" print('Send:', self.message)\n" +" self.transport.sendto(self.message.encode())\n" +"\n" +" def datagram_received(self, data, addr):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" print(\"Close the socket\")\n" +" self.transport.close()\n" +"\n" +" def error_received(self, exc):\n" +" print('Error received:', exc)\n" +"\n" +" def connection_lost(self, exc):\n" +" print(\"Connection closed\")\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = \"Hello World!\"\n" +"\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" remote_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" msgid "Connecting Existing Sockets" -msgstr "" +msgstr "اتصال سوکت‌های موجود" -msgid "Wait until a socket receives data using the :meth:`loop.create_connection` method with a protocol::" +msgid "" +"Wait until a socket receives data using the :meth:`loop.create_connection` " +"method with a protocol::" msgstr "" +"با استفاده از متد :meth:`loop.create_connection` به‌همراه یک پروتکل، منتظر " +"بمانید تا یک سوکت داده‌ای دریافت کند::" msgid "" "import asyncio\n" @@ -801,21 +1559,85 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import socket\n" +"\n" +"\n" +"class MyProtocol(asyncio.Protocol):\n" +"\n" +" def __init__(self, on_con_lost):\n" +" self.transport = None\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: close the transport;\n" +" # connection_lost() will be called automatically.\n" +" self.transport.close()\n" +"\n" +" def connection_lost(self, exc):\n" +" # The socket has been closed\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +" on_con_lost = loop.create_future()\n" +"\n" +" # Create a pair of connected sockets\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the socket to wait for data.\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: MyProtocol(on_con_lost), sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network.\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" try:\n" +" await protocol.on_con_lost\n" +" finally:\n" +" transport.close()\n" +" wsock.close()\n" +"\n" +"asyncio.run(main())" -msgid "The :ref:`watch a file descriptor for read events ` example uses the low-level :meth:`loop.add_reader` method to register an FD." +msgid "" +"The :ref:`watch a file descriptor for read events " +"` example uses the low-level " +":meth:`loop.add_reader` method to register an FD." msgstr "" +"مثال :ref:`پایش یک توصیف‌گر فایل برای رویدادهای خواندن " +"` از متد سطح پایین :meth:`loop.add_reader` برای " +"ثبت یک FD استفاده می‌کند." -msgid "The :ref:`register an open socket to wait for data using streams ` example uses high-level streams created by the :func:`open_connection` function in a coroutine." +msgid "" +"The :ref:`register an open socket to wait for data using streams " +"` example uses high-level streams" +" created by the :func:`open_connection` function in a coroutine." msgstr "" +"مثال :ref:`ثبت یک سوکت باز برای انتظار داده‌ها با استفاده از جریان‌ها " +"` از جریان‌های سطح بالایی استفاده" +" می‌کند که توسط تابع :func:`open_connection` در یک هم‌روال ایجاد شده‌اند." msgid "loop.subprocess_exec() and SubprocessProtocol" -msgstr "" +msgstr "loop.subprocess_exec() و SubprocessProtocol" -msgid "An example of a subprocess protocol used to get the output of a subprocess and to wait for the subprocess exit." +msgid "" +"An example of a subprocess protocol used to get the output of a subprocess " +"and to wait for the subprocess exit." msgstr "" +"مثالی از یک پروتکل زیرفرایند (subprocess) که برای دریافت خروجی یک " +"زیرفرایند و انتظار برای خروج زیرفرایند استفاده می‌شود." msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" -msgstr "" +msgstr "زیرفرایند توسط متد :meth:`loop.subprocess_exec` ایجاد می‌شود::" msgid "" "import asyncio\n" @@ -876,6 +1698,67 @@ msgid "" "date = asyncio.run(get_date())\n" "print(f\"Current date: {date}\")" msgstr "" +"import asyncio\n" +"import sys\n" +"\n" +"class DateProtocol(asyncio.SubprocessProtocol):\n" +" def __init__(self, exit_future):\n" +" self.exit_future = exit_future\n" +" self.output = bytearray()\n" +" self.pipe_closed = False\n" +" self.exited = False\n" +"\n" +" def pipe_connection_lost(self, fd, exc):\n" +" self.pipe_closed = True\n" +" self.check_for_exit()\n" +"\n" +" def pipe_data_received(self, fd, data):\n" +" self.output.extend(data)\n" +"\n" +" def process_exited(self):\n" +" self.exited = True\n" +" # ممکن است متد process_exited() پیش از\n" +" # متد pipe_connection_lost() فراخوانی شود: صبر کنید تا هر دو متد\n" +" # فراخوانی شوند.\n" +" self.check_for_exit()\n" +"\n" +" def check_for_exit(self):\n" +" if self.pipe_closed and self.exited:\n" +" self.exit_future.set_result(True)\n" +"\n" +"async def get_date():\n" +" # مرجعی به حلقه رویداد دریافت کنید، زیرا قصد استفاده از\n" +" # APIهای سطح پایین وجود دارد.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" code = 'import datetime as dt; print(dt.datetime.now())'\n" +" exit_future = asyncio.Future(loop=loop)\n" +"\n" +" # زیرفرایندی را که توسط DateProtocol کنترل می‌شود ایجاد کنید؛\n" +" # خروجی استاندارد را به یک پایپهدایت کنید.\n" +" transport, protocol = await loop.subprocess_exec(\n" +" lambda: DateProtocol(exit_future),\n" +" sys.executable, '-c', code,\n" +" stdin=None, stderr=None)\n" +"\n" +" # با استفاده از متد process_exited() پروتکل، منتظر خروج\n" +" # زیرفرایند بمانید.\n" +" await exit_future\n" +"\n" +" # پایپ خروجی استاندارد را ببندید.\n" +" transport.close()\n" +"\n" +" # خروجی‌ای را که توسط متد pipe_data_received() پروتکل\n" +" # جمع‌آوری شده است بخوانید.\n" +" data = bytes(protocol.output)\n" +" return data.decode('ascii').rstrip()\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" -msgid "See also the :ref:`same example ` written using high-level APIs." +msgid "" +"See also the :ref:`same example ` " +"written using high-level APIs." msgstr "" +"همچنین :ref:`همین مثال ` را ببینید " +"که با استفاده از APIهای سطح بالا نوشته شده است." diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index c8d4fbea8..36b79fb23 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -25,148 +25,284 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Queues" -msgstr "" +msgstr "صف‌ها" msgid "**Source code:** :source:`Lib/asyncio/queues.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/asyncio/queues.py`" -msgid "asyncio queues are designed to be similar to classes of the :mod:`queue` module. Although asyncio queues are not thread-safe, they are designed to be used specifically in async/await code." +msgid "" +"asyncio queues are designed to be similar to classes of the :mod:`queue` " +"module. Although asyncio queues are not thread-safe, they are designed to " +"be used specifically in async/await code." msgstr "" +"صف‌های asyncio به‌گونه‌ای طراحی شده‌اند که شبیه کلاس‌های ماژول :mod:`queue` " +"باشند. اگرچه صف‌های asyncio در برابر نخ ایمن نیستند، اما برای استفاده به‌طور" +" خاص در کد ناهمگام/await طراحی شده‌اند." -msgid "Note that methods of asyncio queues don't have a *timeout* parameter; use :func:`asyncio.wait_for` function to do queue operations with a timeout." +msgid "" +"Note that methods of asyncio queues don't have a *timeout* parameter; use " +":func:`asyncio.wait_for` function to do queue operations with a timeout." msgstr "" +"توجه داشته باشید که متدهای صف‌های asyncio پارامتر *timeout* ندارند؛ برای " +"انجام عملیات صف با مهلت زمانی، از تابع :func:`asyncio.wait_for` استفاده کنید." msgid "See also the `Examples`_ section below." -msgstr "" +msgstr "همچنین بخش `Examples`_ در زیر را ببینید." msgid "Queue" -msgstr "" +msgstr "صف" msgid "A first in, first out (FIFO) queue." -msgstr "" +msgstr "یک صف اولین ورودی، اولین خروجی (FIFO)." -msgid "If *maxsize* is less than or equal to zero, the queue size is infinite. If it is an integer greater than ``0``, then ``await put()`` blocks when the queue reaches *maxsize* until an item is removed by :meth:`get`." +msgid "" +"If *maxsize* is less than or equal to zero, the queue size is infinite. If " +"it is an integer greater than ``0``, then ``await put()`` blocks when the " +"queue reaches *maxsize* until an item is removed by :meth:`get`." msgstr "" +"اگر *maxsize* کوچک‌تر یا مساوی صفر باشد، اندازه صف بی‌نهایت است. اگر این " +"مقدار یک عدد صحیح بزرگ‌تر از ``0`` باشد، ``await put()`` هنگامی که صف به " +"*maxsize* برسد مسدود می‌شود تا زمانی که یک آیتم توسط :meth:`get` حذف شود." -msgid "Unlike the standard library threading :mod:`queue`, the size of the queue is always known and can be returned by calling the :meth:`qsize` method." +msgid "" +"Unlike the standard library threading :mod:`queue`, the size of the queue is" +" always known and can be returned by calling the :meth:`qsize` method." msgstr "" +"برخلاف ماژول :mod:`queue` مربوط به threading در کتابخانه استاندارد، اندازه " +"صف همیشه مشخص است و می‌توان آن را با فراخوانی متد :meth:`qsize` برگرداند." msgid "Removed the *loop* parameter." -msgstr "" +msgstr "پارامتر *loop* حذف شد." msgid "This class is :ref:`not thread safe `." -msgstr "" +msgstr "این کلاس :ref:`ایمن در برابر نخ نیست `." msgid "Number of items allowed in the queue." -msgstr "" +msgstr "تعداد آیتم‌های مجاز در صف." msgid "Return ``True`` if the queue is empty, ``False`` otherwise." -msgstr "" +msgstr "اگر صف خالی باشد، ``True`` را برمی‌گرداند، در غیر این صورت ``False``." msgid "Return ``True`` if there are :attr:`maxsize` items in the queue." -msgstr "" +msgstr "اگر :attr:`maxsize` آیتم در صف وجود داشته باشد، ``True`` برمی‌گرداند." -msgid "If the queue was initialized with ``maxsize=0`` (the default), then :meth:`full` never returns ``True``." +msgid "" +"If the queue was initialized with ``maxsize=0`` (the default), then " +":meth:`full` never returns ``True``." msgstr "" +"اگر صف با ``maxsize=0`` (پیش‌فرض) مقداردهی اولیه شده باشد، آنگاه " +":meth:`full` هرگز ``True`` را برنمی‌گرداند." -msgid "Remove and return an item from the queue. If queue is empty, wait until an item is available." +msgid "" +"Remove and return an item from the queue. If queue is empty, wait until an " +"item is available." msgstr "" +"یک آیتم را از صف حذف کرده و برمی‌گرداند. اگر صف خالی باشد، تا زمانی که یک " +"آیتم در دسترس باشد صبر می‌کند." -msgid "Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or if the queue has been shut down immediately." +msgid "" +"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or" +" if the queue has been shut down immediately." msgstr "" +"اگر صف خاموش شده باشد و خالی باشد، یا اگر صف بلافاصله خاموش شده باشد، " +"استثنای :exc:`QueueShutDown` را پرتاب می‌کند." -msgid "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." +msgid "" +"Return an item if one is immediately available, else raise " +":exc:`QueueEmpty`." msgstr "" +"اگر یک آیتم بلافاصله در دسترس باشد، آن را برمی‌گرداند؛ در غیر این صورت " +":exc:`QueueEmpty` را پرتاب می‌کند." -msgid "Raises :exc:`QueueShutDown` if the queue has been shut down and is empty." +msgid "" +"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty." msgstr "" +"اگر صف خاموش شده باشد و خالی باشد، استثنای :exc:`QueueShutDown` را پرتاب " +"می‌کند." msgid "Block until all items in the queue have been received and processed." -msgstr "" +msgstr "مسدود می‌شود تا تمام آیتم‌های موجود در صف دریافت و پردازش شده باشند." -msgid "The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer coroutine calls :meth:`task_done` to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, :meth:`join` unblocks." -msgstr "" +msgid "" +"The count of unfinished tasks goes up whenever an item is added to the " +"queue. The count goes down whenever a consumer coroutine calls " +":meth:`task_done` to indicate that the item was retrieved and all work on it" +" is complete. When the count of unfinished tasks drops to zero, " +":meth:`join` unblocks." +msgstr "" +"تعداد وظایف ناتمام هر بار که یک آیتم به صف اضافه شود، افزایش می‌یابد. این " +"تعداد هر بار که یک هم‌روال مصرف‌کننده :meth:`task_done` را فراخوانی کند تا " +"نشان دهد آن آیتم دریافت شده و تمام کارهای مربوط به آن کامل شده است، کاهش " +"می‌یابد. هنگامی که تعداد وظایف ناتمام به صفر برسد، :meth:`join` از حالت " +"مسدود خارج می‌شود." -msgid "Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item." +msgid "" +"Put an item into the queue. If the queue is full, wait until a free slot is " +"available before adding the item." msgstr "" +"یک آیتم را در صف قرار دهید. اگر صف پر باشد، پیش از افزودن آیتم، تا زمانی که " +"یک جای خالی در دسترس قرار بگیرد صبر کنید." msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." -msgstr "" +msgstr "اگر صف خاموش شده باشد، :exc:`QueueShutDown` را پرتاب می‌کند." msgid "Put an item into the queue without blocking." -msgstr "" +msgstr "یک آیتم را بدون مسدودسازی در صف قرار دهید." msgid "If no free slot is immediately available, raise :exc:`QueueFull`." msgstr "" +"اگر هیچ جای خالی‌ای بلافاصله در دسترس نباشد، :exc:`QueueFull` پرتاب می‌شود." msgid "Return the number of items in the queue." -msgstr "" +msgstr "تعداد آیتم‌های موجود در صف را برمی‌گرداند." msgid "Put a :class:`Queue` instance into a shutdown mode." -msgstr "" +msgstr "نمونه‌ای از :class:`Queue` را در حالت خاموشی قرار دهید." -msgid "The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting task." +msgid "" +"The queue can no longer grow. Future calls to :meth:`~Queue.put` raise " +":exc:`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will " +"be unblocked and will raise :exc:`QueueShutDown` in the formerly awaiting " +"task." msgstr "" +"صف دیگر نمی‌تواند بزرگ‌تر شود. فراخوانی‌های بعدی :meth:`~Queue.put` باعث " +"پرتاب :exc:`QueueShutDown` می‌شوند. فراخوانندگانی که در حال حاضر برای " +":meth:`~Queue.put` مسدود شده‌اند، از حالت مسدود خارج خواهند شد و " +":exc:`QueueShutDown` در وظیفه‌ای که پیش‌تر در انتظار بود پرتاب خواهد شد." -msgid "If *immediate* is false (the default), the queue can be wound down normally with :meth:`~Queue.get` calls to extract tasks that have already been loaded." +msgid "" +"If *immediate* is false (the default), the queue can be wound down normally " +"with :meth:`~Queue.get` calls to extract tasks that have already been " +"loaded." msgstr "" +"اگر *immediate* نادرست باشد (پیش‌فرض)، صف می‌تواند به‌صورت عادی با " +"فراخوانی‌های :meth:`~Queue.get` برای استخراج تسک‌هایی که از قبل " +"بارگذاری‌شده‌اند، تخلیه شود." -msgid "And if :meth:`~Queue.task_done` is called for each remaining task, a pending :meth:`~Queue.join` will be unblocked normally." +msgid "" +"And if :meth:`~Queue.task_done` is called for each remaining task, a pending" +" :meth:`~Queue.join` will be unblocked normally." msgstr "" +"و اگر :meth:`~Queue.task_done` برای هر وظیفه‌ی باقی‌مانده فراخوانی شود، یک " +":meth:`~Queue.join` در انتظار به‌طور عادی رفع انسداد خواهد شد." -msgid "Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:`QueueShutDown`." +msgid "" +"Once the queue is empty, future calls to :meth:`~Queue.get` will raise " +":exc:`QueueShutDown`." msgstr "" +"پس از خالی شدن صف، فراخوانی‌های بعدی به :meth:`~Queue.get`، " +":exc:`QueueShutDown` را پرتاب خواهند کرد." -msgid "If *immediate* is true, the queue is terminated immediately. The queue is drained to be completely empty and the count of unfinished tasks is reduced by the number of tasks drained. If unfinished tasks is zero, callers of :meth:`~Queue.join` are unblocked. Also, blocked callers of :meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because the queue is empty." -msgstr "" +msgid "" +"If *immediate* is true, the queue is terminated immediately. The queue is " +"drained to be completely empty and the count of unfinished tasks is reduced " +"by the number of tasks drained. If unfinished tasks is zero, callers of " +":meth:`~Queue.join` are unblocked. Also, blocked callers of " +":meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because" +" the queue is empty." +msgstr "" +"اگر *immediate* برابر true باشد، صف بلافاصله خاتمه می‌یابد. صف تخلیه می‌شود " +"تا کاملاً خالی شود و تعداد وظایف ناتمام به تعداد وظایف تخلیه‌شده کاهش " +"می‌یابد. اگر تعداد وظایف ناتمام صفر باشد، فراخواننده‌های :meth:`~Queue.join`" +" از حالت مسدود خارج می‌شوند. همچنین، فراخواننده‌های مسدودشده‌ی " +":meth:`~Queue.get` از حالت مسدود خارج می‌شوند و :exc:`QueueShutDown` را به " +"دلیل خالی بودن صف پرتاب می‌کنند." -msgid "Use caution when using :meth:`~Queue.join` with *immediate* set to true. This unblocks the join even when no work has been done on the tasks, violating the usual invariant for joining a queue." +msgid "" +"Use caution when using :meth:`~Queue.join` with *immediate* set to true. " +"This unblocks the join even when no work has been done on the tasks, " +"violating the usual invariant for joining a queue." msgstr "" +"هنگام استفاده از :meth:`~Queue.join` با *immediate* تنظیم‌شده روی true " +"احتیاط کنید. این کار حتی زمانی که هیچ کاری روی وظایف انجام نشده باشد، " +"انتظار join را رفع می‌کند و ناوردای معمولِ پیوستن به یک صف را نقض می‌کند." msgid "Indicate that a formerly enqueued work item is complete." msgstr "" +"نشان می‌دهد که یک آیتم کاری که پیش‌تر در صف قرار گرفته است، کامل شده است." -msgid "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work item, a subsequent call to :meth:`task_done` tells the queue that the processing on the work item is complete." +msgid "" +"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " +"item, a subsequent call to :meth:`task_done` tells the queue that the " +"processing on the work item is complete." msgstr "" +"توسط مصرف‌کنندگان صف استفاده می‌شود. به ازای هر :meth:`~Queue.get` که برای " +"واکشی یک آیتم کاری استفاده شود، فراخوانی متعاقب :meth:`task_done` به صف " +"اطلاع می‌دهد که پردازش آن آیتم کاری کامل شده است." -msgid "If a :meth:`join` is currently blocking, it will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue)." +msgid "" +"If a :meth:`join` is currently blocking, it will resume when all items have " +"been processed (meaning that a :meth:`task_done` call was received for every" +" item that had been :meth:`~Queue.put` into the queue)." msgstr "" +"اگر :meth:`join` در حال حاضر مسدودکننده باشد، هنگامی که همه‌ی آیتم‌ها پردازش " +"شده باشند، از سر گرفته می‌شود (به این معنا که برای هر آیتمی که با " +":meth:`~Queue.put ` در صف قرار داده شده باشد، یک فراخوانی " +":meth:`task_done <~Queue.put>` دریافت شده باشد)." -msgid "Raises :exc:`ValueError` if called more times than there were items placed in the queue." +msgid "" +"Raises :exc:`ValueError` if called more times than there were items placed " +"in the queue." msgstr "" +"اگر بیشتر از تعداد آیتم‌های قرار داده‌شده در صف فراخوانی شود، " +":exc:`ValueError` پرتاب می‌کند." msgid "Priority Queue" -msgstr "" +msgstr "صف اولویت" -msgid "A variant of :class:`Queue`; retrieves entries in priority order (lowest first)." +msgid "" +"A variant of :class:`Queue`; retrieves entries in priority order (lowest " +"first)." msgstr "" +"گونه‌ای از :class:`Queue`؛ آیتم‌ها را به ترتیب اولویت (ابتدا کمترین) بازیابی" +" می‌کند." msgid "Entries are typically tuples of the form ``(priority_number, data)``." -msgstr "" +msgstr "ورودی‌ها معمولاً تاپل‌هایی به شکل ``(priority_number, data)`` هستند." msgid "LIFO Queue" -msgstr "" +msgstr "صف LIFO" -msgid "A variant of :class:`Queue` that retrieves most recently added entries first (last in, first out)." +msgid "" +"A variant of :class:`Queue` that retrieves most recently added entries first" +" (last in, first out)." msgstr "" +"گونه‌ای از :class:`Queue` که ابتدا جدیدترین ورودی‌های افزوده‌شده را بازیابی " +"می‌کند (آخرین ورودی، اولین خروجی)." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "This exception is raised when the :meth:`~Queue.get_nowait` method is called on an empty queue." +msgid "" +"This exception is raised when the :meth:`~Queue.get_nowait` method is called" +" on an empty queue." msgstr "" +"این استثنا زمانی پرتاب می‌شود که متد :meth:`~Queue.get_nowait` روی یک صف " +"خالی فراخوانی شود." -msgid "Exception raised when the :meth:`~Queue.put_nowait` method is called on a queue that has reached its *maxsize*." +msgid "" +"Exception raised when the :meth:`~Queue.put_nowait` method is called on a " +"queue that has reached its *maxsize*." msgstr "" +"استثنایی که با فراخوانی متد :meth:`~Queue.put_nowait` روی صفی که به " +"*maxsize* خود رسیده باشد، پرتاب می‌شود." -msgid "Exception raised when :meth:`~Queue.put`, :meth:`~Queue.put_nowait`, :meth:`~Queue.get` or :meth:`~Queue.get_nowait` is called on a queue which has been shut down." +msgid "" +"Exception raised when :meth:`~Queue.put`, :meth:`~Queue.put_nowait`, " +":meth:`~Queue.get` or :meth:`~Queue.get_nowait` is called on a queue which " +"has been shut down." msgstr "" +"استثنایی که هنگام فراخوانی :meth:`~Queue.put`، :meth:`~Queue.put_nowait`، " +":meth:`~Queue.get` یا :meth:`~Queue.get_nowait` روی صفی که خاموش شده است، " +"پرتاب می‌شود." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "Queues can be used to distribute workload between several concurrent tasks::" +msgid "" +"Queues can be used to distribute workload between several concurrent tasks::" msgstr "" +"می‌توان از صف‌ها برای توزیع بار کاری بین چندین وظیفه هم‌رو استفاده کرد::" msgid "" "import asyncio\n" @@ -223,3 +359,56 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import random\n" +"import time\n" +"\n" +"\n" +"async def worker(name, queue):\n" +" while True:\n" +" # Get a \"work item\" out of the queue.\n" +" sleep_for = await queue.get()\n" +"\n" +" # Sleep for the \"sleep_for\" seconds.\n" +" await asyncio.sleep(sleep_for)\n" +"\n" +" # Notify the queue that the \"work item\" has been processed.\n" +" queue.task_done()\n" +"\n" +" print(f'{name} has slept for {sleep_for:.2f} seconds')\n" +"\n" +"\n" +"async def main():\n" +" # Create a queue that we will use to store our \"workload\".\n" +" queue = asyncio.Queue()\n" +"\n" +" # Generate random timings and put them into the queue.\n" +" total_sleep_time = 0\n" +" for _ in range(20):\n" +" sleep_for = random.uniform(0.05, 1.0)\n" +" total_sleep_time += sleep_for\n" +" queue.put_nowait(sleep_for)\n" +"\n" +" # Create three worker tasks to process the queue concurrently.\n" +" tasks = []\n" +" for i in range(3):\n" +" task = asyncio.create_task(worker(f'worker-{i}', queue))\n" +" tasks.append(task)\n" +"\n" +" # Wait until the queue is fully processed.\n" +" started_at = time.monotonic()\n" +" await queue.join()\n" +" total_slept_for = time.monotonic() - started_at\n" +"\n" +" # Cancel our worker tasks.\n" +" for task in tasks:\n" +" task.cancel()\n" +" # Wait until all worker tasks are cancelled.\n" +" await asyncio.gather(*tasks, return_exceptions=True)\n" +"\n" +" print('====')\n" +" print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')\n" +" print(f'total expected sleep time: {total_sleep_time:.2f} seconds')\n" +"\n" +"\n" +"asyncio.run(main())" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 3df32645c..6d81b5587 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -24,43 +24,84 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Runners" -msgstr "" +msgstr "اجراکننده‌ها" msgid "**Source code:** :source:`Lib/asyncio/runners.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/asyncio/runners.py`" -msgid "This section outlines high-level asyncio primitives to run asyncio code." +msgid "" +"This section outlines high-level asyncio primitives to run asyncio code." msgstr "" +"این بخش، سازوکارهای اولیه (primitives) سطح بالای asyncio برای اجرای کد " +"asyncio را به‌طور خلاصه شرح می‌دهد." -msgid "They are built on top of an :ref:`event loop ` with the aim to simplify async code usage for common wide-spread scenarios." +msgid "" +"They are built on top of an :ref:`event loop ` with the " +"aim to simplify async code usage for common wide-spread scenarios." msgstr "" +"آن‌ها بر پایه یک :ref:`حلقه رویداد ` ساخته شده‌اند تا " +"استفاده از کد ناهمگام را برای سناریوهای رایج و گسترده ساده‌تر کنند." msgid "Running an asyncio Program" -msgstr "" +msgstr "اجرای یک برنامه asyncio" msgid "Execute *coro* in an asyncio event loop and return the result." msgstr "" +"*coro* را در یک حلقه رویداد asyncio اجرا می‌کند و نتیجه را برمی‌گرداند." msgid "The argument can be any awaitable object." -msgstr "" +msgstr "آرگومان می‌تواند هر شیء awaitable باشد." -msgid "This function runs the awaitable, taking care of managing the asyncio event loop, *finalizing asynchronous generators*, and closing the executor." +msgid "" +"This function runs the awaitable, taking care of managing the asyncio event " +"loop, *finalizing asynchronous generators*, and closing the executor." msgstr "" +"این تابع، awaitable را اجرا می‌کند و مدیریت حلقه رویداد asyncio، *نهایی‌سازی" +" تولیدگرهای ناهمگام* و بستن اجراکننده (executor) را بر عهده می‌گیرد." -msgid "This function cannot be called when another asyncio event loop is running in the same thread." +msgid "" +"This function cannot be called when another asyncio event loop is running in" +" the same thread." msgstr "" +"هنگامی که یک حلقه رویداد asyncio دیگر در همان نخ در حال اجرا است، نمی‌توانید" +" این تابع را فراخوانی کنید." -msgid "If *debug* is ``True``, the event loop will be run in debug mode. ``False`` disables debug mode explicitly. ``None`` is used to respect the global :ref:`asyncio-debug-mode` settings." +msgid "" +"If *debug* is ``True``, the event loop will be run in debug mode. ``False`` " +"disables debug mode explicitly. ``None`` is used to respect the global " +":ref:`asyncio-debug-mode` settings." msgstr "" +"اگر *debug* برابر ``True`` باشد، حلقه رویداد در حالت اشکال‌زدایی اجرا " +"می‌شود. ``False`` حالت اشکال‌زدایی را به‌صراحت غیرفعال می‌کند. ``None`` برای" +" رعایت تنظیمات سراسری :ref:`asyncio-debug-mode` استفاده می‌شود." -msgid "If *loop_factory* is not ``None``, it is used to create a new event loop; otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the end. This function should be used as a main entry point for asyncio programs, and should ideally only be called once. It is recommended to use *loop_factory* to configure the event loop instead of policies. Passing :class:`asyncio.EventLoop` allows running asyncio without the policy system." -msgstr "" +msgid "" +"If *loop_factory* is not ``None``, it is used to create a new event loop; " +"otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " +"end. This function should be used as a main entry point for asyncio " +"programs, and should ideally only be called once. It is recommended to use " +"*loop_factory* to configure the event loop instead of policies. Passing " +":class:`asyncio.EventLoop` allows running asyncio without the policy system." +msgstr "" +"اگر *loop_factory* ``None`` نباشد، از آن برای ایجاد یک حلقه رویداد جدید " +"استفاده می‌شود؛ در غیر این صورت از :func:`asyncio.new_event_loop` استفاده " +"می‌شود. حلقه در پایان بسته می‌شود. این تابع باید به عنوان نقطه ورود اصلی " +"برنامه‌های asyncio استفاده شود و بهتر است فقط یک بار فراخوانی شود. توصیه " +"می‌شود به جای سیاست‌ها (policies)، برای پیکربندی حلقه رویداد از " +"*loop_factory* استفاده کنید. ارسال :class:`asyncio.EventLoop` امکان اجرای " +"asyncio بدون سیستم سیاست (policy system) را فراهم می‌کند." -msgid "The executor is given a timeout duration of 5 minutes to shutdown. If the executor hasn't finished within that duration, a warning is emitted and the executor is closed." +msgid "" +"The executor is given a timeout duration of 5 minutes to shutdown. If the " +"executor hasn't finished within that duration, a warning is emitted and the " +"executor is closed." msgstr "" +"به اجراکننده (executor) مهلتی به مدت ۵ دقیقه برای خاموش شدن داده می‌شود. اگر" +" اجراکننده در آن مدت کار خود را به پایان نرسانده باشد، هشداری صادر می‌شود و " +"اجراکننده بسته می‌شود." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "async def main():\n" @@ -69,36 +110,72 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"asyncio.run(main())" msgid "Updated to use :meth:`loop.shutdown_default_executor`." msgstr "" +"برای استفاده از :meth:`loop.shutdown_default_executor` به‌روزرسانی شد." -msgid "*debug* is ``None`` by default to respect the global debug mode settings." +msgid "" +"*debug* is ``None`` by default to respect the global debug mode settings." msgstr "" +"*debug* به‌طور پیش‌فرض ``None`` است تا تنظیمات سراسری حالت اشکال‌زدایی را " +"رعایت کند." msgid "Added *loop_factory* parameter." -msgstr "" +msgstr "پارامتر *loop_factory* افزوده شد." msgid "*coro* can be any awaitable object." -msgstr "" +msgstr "*coro* می‌تواند هر شیء قابل await (awaitable) باشد." -msgid "The :mod:`!asyncio` policy system is deprecated and will be removed in Python 3.16; from there on, an explicit *loop_factory* is needed to configure the event loop." +msgid "" +"The :mod:`!asyncio` policy system is deprecated and will be removed in " +"Python 3.16; from there on, an explicit *loop_factory* is needed to " +"configure the event loop." msgstr "" +"سیستم سیاست :mod:`!asyncio` منسوخ شده است و در Python 3.16 حذف خواهد شد؛ از " +"آن پس، برای پیکربندی حلقه رویداد به یک *loop_factory* صریح نیاز است." msgid "Runner context manager" -msgstr "" +msgstr "مدیر زمینه‌ی Runner" -msgid "A context manager that simplifies *multiple* async function calls in the same context." +msgid "" +"A context manager that simplifies *multiple* async function calls in the " +"same context." msgstr "" +"مدیر زمینه‌ای که فراخوانی‌های *چندگانه* تابع ناهمگام را در همان زمینه " +"ساده‌تر می‌کند." -msgid "Sometimes several top-level async functions should be called in the same :ref:`event loop ` and :class:`contextvars.Context`." +msgid "" +"Sometimes several top-level async functions should be called in the same " +":ref:`event loop ` and :class:`contextvars.Context`." msgstr "" +"گاهی اوقات چندین تابع ناهمگام سطح بالا باید در یک :ref:`حلقه رویداد " +"` و :class:`contextvars.Context` مشترک فراخوانی شوند." -msgid "*loop_factory* could be used for overriding the loop creation. It is the responsibility of the *loop_factory* to set the created loop as the current one. By default :func:`asyncio.new_event_loop` is used and set as current event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." -msgstr "" +msgid "" +"*loop_factory* could be used for overriding the loop creation. It is the " +"responsibility of the *loop_factory* to set the created loop as the current " +"one. By default :func:`asyncio.new_event_loop` is used and set as current " +"event loop with :func:`asyncio.set_event_loop` if *loop_factory* is " +"``None``." +msgstr "" +"*loop_factory* می‌تواند برای بازنویسی ایجاد حلقه استفاده شود. مسئولیت تنظیم " +"حلقه‌ی ایجادشده به‌عنوان حلقه‌ی جاری بر عهده‌ی *loop_factory* است. به‌طور " +"پیش‌فرض، اگر *loop_factory* برابر ``None`` باشد، از " +":func:`asyncio.new_event_loop` استفاده می‌شود و با " +":func:`asyncio.set_event_loop` به‌عنوان حلقه‌ی رویداد جاری تنظیم می‌شود." -msgid "Basically, :func:`asyncio.run` example can be rewritten with the runner usage::" +msgid "" +"Basically, :func:`asyncio.run` example can be rewritten with the runner " +"usage::" msgstr "" +"اساساً، می‌توان مثال :func:`asyncio.run` را با استفاده از اجراکننده (runner)" +" بازنویسی کرد::" msgid "" "async def main():\n" @@ -108,51 +185,116 @@ msgid "" "with asyncio.Runner() as runner:\n" " runner.run(main())" msgstr "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"with asyncio.Runner() as runner:\n" +" runner.run(main())" msgid "Execute *coro* in the embedded event loop." -msgstr "" +msgstr "*coro* را در حلقه رویداد نهفته اجرا کنید." msgid "If the argument is a coroutine, it is wrapped in a Task." -msgstr "" +msgstr "اگر آرگومان یک هم‌روال باشد، در یک Task پیچیده می‌شود." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the code to run in. The runner's default context is used if context is ``None``." +msgid "" +"An optional keyword-only *context* argument allows specifying a custom " +":class:`contextvars.Context` for the code to run in. The runner's default " +"context is used if context is ``None``." msgstr "" +"یک آرگومان اختیاری فقط کلیدواژه‌ای *context* به شما امکان می‌دهد یک " +":class:`contextvars.Context` سفارشی برای کدی که در آن اجرا می‌شود مشخص کنید." +" اگر context برابر ``None`` باشد، از زمینه پیش‌فرض اجراکننده استفاده می‌شود." msgid "Returns the awaitable's result or raises an exception." -msgstr "" +msgstr "نتیجه‌ی awaitable را برمی‌گرداند یا یک استثنا را پرتاب می‌کند." msgid "Close the runner." -msgstr "" +msgstr "اجراکننده را ببندید." -msgid "Finalize asynchronous generators, shutdown default executor, close the event loop and release embedded :class:`contextvars.Context`." +msgid "" +"Finalize asynchronous generators, shutdown default executor, close the event" +" loop and release embedded :class:`contextvars.Context`." msgstr "" +"نهایی‌سازی تولیدگرهای ناهمگام، خاموش کردن اجراکننده‌ی پیش‌فرض، بستن حلقه‌ی " +"رویداد و آزادسازی :class:`contextvars.Context` تعبیه‌شده." msgid "Return the event loop associated with the runner instance." -msgstr "" +msgstr "حلقه‌ی رویداد مرتبط با نمونه‌ی اجراکننده (runner) را بازمی‌گرداند." -msgid ":class:`Runner` uses the lazy initialization strategy, its constructor doesn't initialize underlying low-level structures." +msgid "" +":class:`Runner` uses the lazy initialization strategy, its constructor " +"doesn't initialize underlying low-level structures." msgstr "" +":class:`Runner` از راهبرد مقداردهی اولیه تنبل استفاده می‌کند، سازنده‌ی آن " +"ساختارهای زیربنایی سطح پایین را مقداردهی اولیه نمی‌کند." -msgid "Embedded *loop* and *context* are created at the :keyword:`with` body entering or the first call of :meth:`run` or :meth:`get_loop`." +msgid "" +"Embedded *loop* and *context* are created at the :keyword:`with` body " +"entering or the first call of :meth:`run` or :meth:`get_loop`." msgstr "" +"*حلقه* و *زمینه* نهفته در هنگام ورود به بدنه‌ی :keyword:`with` یا نخستین " +"فراخوانی :meth:`run` یا :meth:`get_loop` ایجاد می‌شوند." msgid "Handling Keyboard Interruption" -msgstr "" +msgstr "مدیریت وقفه صفحه‌کلید" -msgid "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:`KeyboardInterrupt` exception is raised in the main thread by default. However this doesn't work with :mod:`asyncio` because it can interrupt asyncio internals and can hang the program from exiting." +msgid "" +"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, " +":exc:`KeyboardInterrupt` exception is raised in the main thread by default. " +"However this doesn't work with :mod:`asyncio` because it can interrupt " +"asyncio internals and can hang the program from exiting." msgstr "" +"هنگامی که :const:`signal.SIGINT` با :kbd:`Ctrl-C` پرتاب می‌شود، به‌طور " +"پیش‌فرض استثنای :exc:`KeyboardInterrupt` در نخ اصلی پرتاب می‌شود. اما این " +"مورد با :mod:`asyncio` کار نمی‌کند، زیرا می‌تواند اجزای داخلی asyncio را " +"مختل کند و باعث شود برنامه هنگام خروج معلق بماند." -msgid "To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as follows:" +msgid "" +"To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " +"follows:" msgstr "" +"برای کاهش این مشکل، :mod:`asyncio`، :const:`signal.SIGINT` را به‌صورت زیر " +"مدیریت می‌کند:" -msgid ":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler before any user code is executed and removes it when exiting from the function." +msgid "" +":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " +"before any user code is executed and removes it when exiting from the " +"function." msgstr "" +":meth:`asyncio.Runner.run` پیش از اجرای هر کد کاربر، یک هندلر سفارشی " +"برای :const:`signal.SIGINT` نصب می‌کند و هنگام خروج از تابع، آن را حذف " +"می‌کند." -msgid "The :class:`~asyncio.Runner` creates the main task for the passed coroutine for its execution." +msgid "" +"The :class:`~asyncio.Runner` creates the main task for the passed coroutine " +"for its execution." msgstr "" +":class:`~asyncio.Runner` برای اجرای هم‌روالِ داده‌شده، وظیفه‌ی اصلیرا" +" ایجاد می‌کند." -msgid "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal handler cancels the main task by calling :meth:`asyncio.Task.cancel` which raises :exc:`asyncio.CancelledError` inside the main task. This causes the Python stack to unwind, ``try/except`` and ``try/finally`` blocks can be used for resource cleanup. After the main task is cancelled, :meth:`asyncio.Runner.run` raises :exc:`KeyboardInterrupt`." -msgstr "" +msgid "" +"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " +"handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " +"raises :exc:`asyncio.CancelledError` inside the main task. This causes the " +"Python stack to unwind, ``try/except`` and ``try/finally`` blocks can be " +"used for resource cleanup. After the main task is cancelled, " +":meth:`asyncio.Runner.run` raises :exc:`KeyboardInterrupt`." +msgstr "" +"هنگامی که :const:`signal.SIGINT` با :kbd:`Ctrl-C` پرتاب می‌شود، مدیر سیگنال " +"سفارشی وظیفه اصلیرا با فراخوانی :meth:`asyncio.Task.cancel` که " +":exc:`asyncio.CancelledError` را درون وظیفه اصلی پرتاب می‌کند، لغو می‌کند. این" +" امر باعث می‌شود پشته پایتون باز شود؛ می‌توان از بلوک‌های ``try/except`` و " +"``try/finally`` برای پاک‌سازی منابع استفاده کرد. پس از لغو شدن وظیفه اصلی، " +":meth:`asyncio.Runner.run` :exc:`KeyboardInterrupt` را پرتاب می‌کند." -msgid "A user could write a tight loop which cannot be interrupted by :meth:`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` immediately raises the :exc:`KeyboardInterrupt` without cancelling the main task." -msgstr "" +msgid "" +"A user could write a tight loop which cannot be interrupted by " +":meth:`asyncio.Task.cancel`, in which case the second following " +":kbd:`Ctrl-C` immediately raises the :exc:`KeyboardInterrupt` without " +"cancelling the main task." +msgstr "" +"ممکن است کاربر یک حلقه فشرده بنویسد که توسط :meth:`asyncio.Task.cancel` قابل" +" وقفه نباشد؛ در این صورت، دومین :kbd:`Ctrl-C` پس از آن، بلافاصله " +":exc:`KeyboardInterrupt` را بدون لغو وظیفه اصلیپرتاب می‌کند." diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 7940931e0..f3dab307d 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"PO-Revision-Date: 2026-08-28 11:31+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,18 +23,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Streams" -msgstr "" +msgstr "جریان‌ها" msgid "**Source code:** :source:`Lib/asyncio/streams.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/asyncio/streams.py`" -msgid "Streams are high-level async/await-ready primitives to work with network connections. Streams allow sending and receiving data without using callbacks or low-level protocols and transports." +msgid "" +"Streams are high-level async/await-ready primitives to work with network " +"connections. Streams allow sending and receiving data without using callbacks " +"or low-level protocols and transports." msgstr "" +"جریان‌ها (Streams) اولیه‌های سطح بالای آماده برای ناهمگام و await هستند که برای " +"کار با اتصال‌های شبکه‌ای به کار می‌روند. جریان‌ها امکان ارسال و دریافت داده را " +"بدون استفاده از کال‌بک‌ها یا پروتکل‌ها و انتقال‌های سطح پایین فراهم می‌کنند." msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "" +"در اینجا مثالی از یک کلاینت اکوی TCP نوشته‌شده با استفاده از جریان‌های asyncio " +"آمده است::" msgid "" "import asyncio\n" @@ -56,272 +65,500 @@ msgid "" "\n" "asyncio.run(tcp_echo_client('Hello World!'))" msgstr "" +"import asyncio\n" +"\n" +"async def tcp_echo_client(message):\n" +" reader, writer = await asyncio.open_connection(\n" +" '127.0.0.1', 8888)\n" +"\n" +" print(f'Send: {message!r}')\n" +" writer.write(message.encode())\n" +" await writer.drain()\n" +"\n" +" data = await reader.read(100)\n" +" print(f'Received: {data.decode()!r}')\n" +"\n" +" print('Close the connection')\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"asyncio.run(tcp_echo_client('Hello World!'))" msgid "See also the `Examples`_ section below." -msgstr "" +msgstr "همچنین بخش `Examples`_ را در زیر ببینید." msgid "Stream Functions" -msgstr "" +msgstr "توابع جریان" -msgid "The following top-level asyncio functions can be used to create and work with streams:" +msgid "" +"The following top-level asyncio functions can be used to create and work with " +"streams:" msgstr "" +"می‌توان از توابع سطح‌بالای asyncio زیر برای ایجاد و کار با جریان‌ها استفاده کرد:" -msgid "Establish a network connection and return a pair of ``(reader, writer)`` objects." +msgid "" +"Establish a network connection and return a pair of ``(reader, writer)`` " +"objects." msgstr "" +"اتصال شبکه‌ای برقرار می‌کند و یک جفت شیء ``(reader, writer)`` را برمی‌گرداند." -msgid "The returned *reader* and *writer* objects are instances of :class:`StreamReader` and :class:`StreamWriter` classes." +msgid "" +"The returned *reader* and *writer* objects are instances " +"of :class:`StreamReader` and :class:`StreamWriter` classes." msgstr "" +"اشیای *reader* و *writer* برگردانده‌شده، نمونه‌هایی از " +"کلاس‌های :class:`StreamReader` و :class:`StreamWriter` هستند." -msgid "*limit* determines the buffer size limit used by the returned :class:`StreamReader` instance. By default the *limit* is set to 64 KiB." +msgid "" +"*limit* determines the buffer size limit used by the " +"returned :class:`StreamReader` instance. By default the *limit* is set to 64 " +"KiB." msgstr "" +"*limit* محدودیت اندازه‌ی بافر مورد استفاده‌ی نمونه‌ی :class:`StreamReader` " +"برگردانده‌شده را تعیین می‌کند. به‌طور پیش‌فرض، *limit* روی ۶۴ KiB تنظیم شده است." -msgid "The rest of the arguments are passed directly to :meth:`loop.create_connection`." -msgstr "" +msgid "" +"The rest of the arguments are passed directly " +"to :meth:`loop.create_connection`." +msgstr "بقیه‌ی آرگومان‌ها مستقیماً به :meth:`loop.create_connection` ارسال می‌شوند." -msgid "The *sock* argument transfers ownership of the socket to the :class:`StreamWriter` created. To close the socket, call its :meth:`~asyncio.StreamWriter.close` method." +msgid "" +"The *sock* argument transfers ownership of the socket to " +"the :class:`StreamWriter` created. To close the socket, call " +"its :meth:`~asyncio.StreamWriter.close` method." msgstr "" +"آرگومان *sock* مالکیت سوکت را به :class:`StreamWriter` ایجادشده منتقل می‌کند. " +"برای بستن سوکت، متد :meth:`~asyncio.StreamWriter.close` آن را فراخوانی کنید." msgid "Added the *ssl_handshake_timeout* parameter." -msgstr "" +msgstr "پارامتر *ssl_handshake_timeout* افزوده شد." msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." -msgstr "" +msgstr "پارامترهای *happy_eyeballs_delay* و *interleave* افزوده شدند." msgid "Removed the *loop* parameter." -msgstr "" +msgstr "پارامتر *loop* حذف شد." msgid "Added the *ssl_shutdown_timeout* parameter." -msgstr "" +msgstr "پارامتر *ssl_shutdown_timeout* افزوده شد." msgid "Start a socket server." -msgstr "" +msgstr "یک سرور سوکت راه‌اندازی کنید." -msgid "The *client_connected_cb* callback is called whenever a new client connection is established. It receives a ``(reader, writer)`` pair as two arguments, instances of the :class:`StreamReader` and :class:`StreamWriter` classes." +msgid "" +"The *client_connected_cb* callback is called whenever a new client connection " +"is established. It receives a ``(reader, writer)`` pair as two arguments, " +"instances of the :class:`StreamReader` and :class:`StreamWriter` classes." msgstr "" +"کال‌بک *client_connected_cb* هر زمان که یک اتصال کلاینت جدید برقرار شود، " +"فراخوانی می‌شود. این کال‌بک یک جفت ``(reader, writer)`` را به‌عنوان دو آرگومان " +"دریافت می‌کند که نمونه‌هایی از کلاس‌های :class:`StreamReader` " +"و :class:`StreamWriter` هستند." -msgid "*client_connected_cb* can be a plain callable or a :ref:`coroutine function `; if it is a coroutine function, it will be automatically scheduled as a :class:`Task`." +msgid "" +"*client_connected_cb* can be a plain callable or a :ref:`coroutine function " +"`; if it is a coroutine function, it will be automatically " +"scheduled as a :class:`Task`." msgstr "" +"*client_connected_cb* می‌تواند یک فراخوان‌پذیر (callable) ساده یا یک :ref:`تابع " +"هم‌روال ` باشد؛ اگر تابع هم‌روال باشد، به‌طور خودکار به‌عنوان " +"یک :class:`Task` زمان‌بندی می‌شود." -msgid "The rest of the arguments are passed directly to :meth:`loop.create_server`." -msgstr "" +msgid "" +"The rest of the arguments are passed directly to :meth:`loop.create_server`." +msgstr "بقیه‌ی آرگومان‌ها مستقیماً به :meth:`loop.create_server` ارسال می‌شوند." -msgid "The *sock* argument transfers ownership of the socket to the server created. To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgid "" +"The *sock* argument transfers ownership of the socket to the server created. " +"To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" +"آرگومان *sock* مالکیت سوکت را به سرور ایجادشده منتقل می‌کند. برای بستن سوکت، " +"متد :meth:`~asyncio.Server.close` سرور را فراخوانی کنید." msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." -msgstr "" +msgstr "پارامترهای *ssl_handshake_timeout* و *start_serving* اضافه شدند." msgid "Added the *keep_alive* parameter." -msgstr "" +msgstr "پارامتر *keep_alive* اضافه شد." msgid "Unix Sockets" -msgstr "" +msgstr "سوکت‌های یونیکس" -msgid "Establish a Unix socket connection and return a pair of ``(reader, writer)``." +msgid "" +"Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "" +"اتصال سوکت یونیکس را برقرار می‌کند و یک جفت ``(reader, writer)`` را برمی‌گرداند." msgid "Similar to :func:`open_connection` but operates on Unix sockets." -msgstr "" +msgstr "مشابه :func:`open_connection` است، اما روی سوکت‌های یونیکس عمل می‌کند." msgid "See also the documentation of :meth:`loop.create_unix_connection`." -msgstr "" +msgstr "همچنین مستندات :meth:`loop.create_unix_connection` را ببینید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be a :term:`path-like object`" +msgid "" +"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " +"a :term:`path-like object`" msgstr "" +"پارامتر *ssl_handshake_timeout* افزوده شد. پارامتر *path* اکنون می‌تواند " +"یک :term:`path-like object` باشد" msgid "Start a Unix socket server." -msgstr "" +msgstr "یک سرور سوکت یونیکس را راه‌اندازی کنید." msgid "Similar to :func:`start_server` but works with Unix sockets." -msgstr "" +msgstr "مشابه :func:`start_server` است، اما با سوکت‌های یونیکس کار می‌کند." -msgid "If *cleanup_socket* is true then the Unix socket will automatically be removed from the filesystem when the server is closed, unless the socket has been replaced after the server has been created." +msgid "" +"If *cleanup_socket* is true then the Unix socket will automatically be removed " +"from the filesystem when the server is closed, unless the socket has been " +"replaced after the server has been created." msgstr "" +"اگر *cleanup_socket* درست باشد، سوکت یونیکس به‌طور خودکار هنگام بسته شدن سرور " +"از فایل‌سیستم حذف می‌شود، مگر اینکه سوکت پس از ایجاد سرور جایگزین شده باشد." msgid "See also the documentation of :meth:`loop.create_unix_server`." -msgstr "" +msgstr "همچنین مستندات :meth:`loop.create_unix_server` را ببینید." -msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* parameter can now be a :term:`path-like object`." +msgid "" +"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " +"parameter can now be a :term:`path-like object`." msgstr "" +"پارامترهای *ssl_handshake_timeout* و *start_serving* افزوده شدند. پارامتر " +"*path* اکنون می‌تواند یک :term:`path-like object` باشد." msgid "Added the *cleanup_socket* parameter." -msgstr "" +msgstr "پارامتر *cleanup_socket* اضافه شد." msgid "StreamReader" -msgstr "" +msgstr "StreamReader" -msgid "Represents a reader object that provides APIs to read data from the IO stream. As an :term:`asynchronous iterable`, the object supports the :keyword:`async for` statement." +msgid "" +"Represents a reader object that provides APIs to read data from the IO stream. " +"As an :term:`asynchronous iterable`, the object supports the :keyword:`async " +"for` statement." msgstr "" +"نشان‌دهنده‌ی یک شیء خواننده است که APIهایی برای خواندن داده از جریان ورودی/خروجی " +"فراهم می‌کند. به‌عنوان یک :term:`پیمایش‌پذیر ناهمگام `، این " +"شیء از دستور :keyword:`async for` پشتیبانی می‌کند." -msgid "It is not recommended to instantiate *StreamReader* objects directly; use :func:`open_connection` and :func:`start_server` instead." +msgid "" +"It is not recommended to instantiate *StreamReader* objects directly; " +"use :func:`open_connection` and :func:`start_server` instead." msgstr "" +"توصیه نمی‌شود اشیای *StreamReader* را مستقیماً نمونه‌سازی کنید؛ به‌جای آن " +"از :func:`open_connection` و :func:`start_server` استفاده کنید." msgid "Acknowledge the EOF." -msgstr "" +msgstr "پایان پرونده (EOF) را تأیید کنید." msgid "Read up to *n* bytes from the stream." -msgstr "" +msgstr "تا *n* بایت از جریان را بخوانید." -msgid "If *n* is not provided or set to ``-1``, read until EOF, then return all read :class:`bytes`. If EOF was received and the internal buffer is empty, return an empty ``bytes`` object." +msgid "" +"If *n* is not provided or set to ``-1``, read until EOF, then return all " +"read :class:`bytes`. If EOF was received and the internal buffer is empty, " +"return an empty ``bytes`` object." msgstr "" +"اگر *n* ارائه‌نشده باشد یا روی ``-1`` تنظیم شده باشد، تا EOF می‌خواند، سپس " +"تمام :class:`bytes` خوانده‌شده را برمی‌گرداند. اگر EOF دریافت شده باشد و بافر " +"داخلی خالی باشد، یک شیء ``bytes`` خالی برمی‌گرداند." msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." -msgstr "" +msgstr "اگر *n* برابر ``0`` باشد، بلافاصله یک شیء ``bytes`` خالی برمی‌گرداند." -msgid "If *n* is positive, return at most *n* available ``bytes`` as soon as at least 1 byte is available in the internal buffer. If EOF is received before any byte is read, return an empty ``bytes`` object." +msgid "" +"If *n* is positive, return at most *n* available ``bytes`` as soon as at least " +"1 byte is available in the internal buffer. If EOF is received before any byte " +"is read, return an empty ``bytes`` object." msgstr "" +"اگر *n* مثبت باشد، به محض اینکه حداقل ۱ بایت در بافر داخلی در دسترس باشد، " +"حداکثر *n* بایت در دسترس را به‌صورت ``bytes`` برمی‌گرداند. اگر EOF پیش از " +"خوانده‌شدن هیچ بایتی دریافت شود، یک شیء ``bytes`` خالی برمی‌گرداند." msgid "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "" +"یک خط را بخوانید، که در آن «خط» دنباله‌ای از بایت‌ها است که با ``\\n`` پایان " +"می‌یابد." -msgid "If EOF is received and ``\\n`` was not found, the method returns partially read data." +msgid "" +"If EOF is received and ``\\n`` was not found, the method returns partially " +"read data." msgstr "" +"اگر EOF دریافت شود و ``\\n`` یافت نشود، متد داده‌های خوانده‌شده‌ی ناقص را " +"برمی‌گرداند." -msgid "If EOF is received and the internal buffer is empty, return an empty ``bytes`` object." +msgid "" +"If EOF is received and the internal buffer is empty, return an empty ``bytes`` " +"object." msgstr "" +"در صورتی که EOF دریافت شود و بافر داخلی خالی باشد، یک شیء ``bytes`` خالی " +"برمی‌گرداند." msgid "Read exactly *n* bytes." -msgstr "" +msgstr "دقیقاً *n* بایت را بخوانید." -msgid "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be read. Use the :attr:`IncompleteReadError.partial` attribute to get the partially read data." +msgid "" +"Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be read. " +"Use the :attr:`IncompleteReadError.partial` attribute to get the partially " +"read data." msgstr "" +"اگر پیش از خواندن *n* به EOF برسید، یک :exc:`IncompleteReadError` پرتاب می‌شود. " +"برای دریافت داده‌هایی که به‌طور ناقص خوانده شده‌اند، از " +"ویژگی :attr:`IncompleteReadError.partial` استفاده کنید." msgid "Read data from the stream until *separator* is found." -msgstr "" +msgstr "داده‌ها را از جریان می‌خواند تا *separator* یافت شود." -msgid "On success, the data and separator will be removed from the internal buffer (consumed). Returned data will include the separator at the end." +msgid "" +"On success, the data and separator will be removed from the internal buffer " +"(consumed). Returned data will include the separator at the end." msgstr "" +"در صورت موفقیت، داده و جداکننده از بافر داخلی حذف می‌شوند (مصرف می‌شوند). داده‌ی " +"برگردانده‌شده شامل جداکننده در انتها خواهد بود." -msgid "If the amount of data read exceeds the configured stream limit, a :exc:`LimitOverrunError` exception is raised, and the data is left in the internal buffer and can be read again." +msgid "" +"If the amount of data read exceeds the configured stream limit, " +"a :exc:`LimitOverrunError` exception is raised, and the data is left in the " +"internal buffer and can be read again." msgstr "" +"اگر مقدار داده‌ی خوانده‌شده از محدودیت پیکربندی‌شده‌ی جریان بیشتر شود، " +"استثنای :exc:`LimitOverrunError` پرتاب می‌شود و داده در بافر درونی باقی می‌ماند " +"و می‌تواند دوباره خوانده شود." -msgid "If EOF is reached before the complete separator is found, an :exc:`IncompleteReadError` exception is raised, and the internal buffer is reset. The :attr:`IncompleteReadError.partial` attribute may contain a portion of the separator." +msgid "" +"If EOF is reached before the complete separator is found, " +"an :exc:`IncompleteReadError` exception is raised, and the internal buffer is " +"reset. The :attr:`IncompleteReadError.partial` attribute may contain a " +"portion of the separator." msgstr "" +"اگر پیش از پیدا شدن جداکننده‌ی کامل، به EOF رسیده شود، " +"استثنای :exc:`IncompleteReadError` پرتاب می‌شود و بافر داخلی بازنشانی می‌شود. " +"ویژگی :attr:`IncompleteReadError.partial` ممکن است شامل بخشی از جداکننده باشد." -msgid "The *separator* may also be a tuple of separators. In this case the return value will be the shortest possible that has any separator as the suffix. For the purposes of :exc:`LimitOverrunError`, the shortest possible separator is considered to be the one that matched." +msgid "" +"The *separator* may also be a tuple of separators. In this case the return " +"value will be the shortest possible that has any separator as the suffix. For " +"the purposes of :exc:`LimitOverrunError`, the shortest possible separator is " +"considered to be the one that matched." msgstr "" +"*separator* همچنین می‌تواند یک تاپل از جداسازها باشد. در این حالت، مقدار " +"بازگشتی کوتاه‌ترین مقدار ممکن خواهد بود که یکی از جداسازها را به‌عنوان پسوند " +"داشته باشد. از نظر :exc:`LimitOverrunError`، کوتاه‌ترین جداساز ممکن به‌عنوان " +"جداسازی در نظر گرفته می‌شود که مطابقت داشته است." msgid "The *separator* parameter may now be a :class:`tuple` of separators." -msgstr "" +msgstr "اکنون پارامتر *separator* می‌تواند یک :class:`tuple` از جداکننده‌ها باشد." msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "" +"اگر بافر خالی باشد و :meth:`feed_eof` فراخوانی شده باشد، ``True`` را " +"برمی‌گرداند." msgid "StreamWriter" -msgstr "" +msgstr "StreamWriter" -msgid "Represents a writer object that provides APIs to write data to the IO stream." +msgid "" +"Represents a writer object that provides APIs to write data to the IO stream." msgstr "" +"نشان‌دهنده‌ی یک شیء نویسنده است که APIهایی را برای نوشتن داده‌ها در جریان IO " +"فراهم می‌کند." -msgid "It is not recommended to instantiate *StreamWriter* objects directly; use :func:`open_connection` and :func:`start_server` instead." +msgid "" +"It is not recommended to instantiate *StreamWriter* objects directly; " +"use :func:`open_connection` and :func:`start_server` instead." msgstr "" +"نمونه‌سازی مستقیم اشیای *StreamWriter* توصیه نمی‌شود؛ در عوض " +"از :func:`open_connection` و :func:`start_server` استفاده کنید." -msgid "The method attempts to write the *data* to the underlying socket immediately. If that fails, the data is queued in an internal write buffer until it can be sent." +msgid "" +"The method attempts to write the *data* to the underlying socket immediately. " +"If that fails, the data is queued in an internal write buffer until it can be " +"sent." msgstr "" +"این متد تلاش می‌کند *data* را بلافاصله در سوکت زیرین بنویسد. اگر این کار با " +"شکست مواجه شود، داده در یک بافر نوشتن داخلی در صف قرار می‌گیرد تا زمانی که " +"بتوان آن را ارسال کرد." -msgid "The *data* buffer should be a bytes, bytearray, or C-contiguous one-dimensional memoryview object." +msgid "" +"The *data* buffer should be a bytes, bytearray, or C-contiguous one-" +"dimensional memoryview object." msgstr "" +"بافر *data* باید یک شیء bytes، bytearray یا memoryview یک‌بعدی با چیدمان پیوسته " +"در C (C-contiguous) باشد." msgid "The method should be used along with the ``drain()`` method::" -msgstr "" +msgstr "این متد باید همراه با متد ``drain()`` استفاده شود::" msgid "" "stream.write(data)\n" "await stream.drain()" msgstr "" +"stream.write(data)\n" +"await stream.drain()" -msgid "The method writes a list (or any iterable) of bytes to the underlying socket immediately. If that fails, the data is queued in an internal write buffer until it can be sent." +msgid "" +"The method writes a list (or any iterable) of bytes to the underlying socket " +"immediately. If that fails, the data is queued in an internal write buffer " +"until it can be sent." msgstr "" +"این متد بلافاصله یک فهرست (یا هر پیمایش‌پذیری) از بایت‌ها را در سوکت زیرین " +"می‌نویسد. اگر این کار با شکست مواجه شود، داده در یک بافر نوشتن داخلی در صف قرار " +"می‌گیرد تا بتواند ارسال شود." msgid "" "stream.writelines(lines)\n" "await stream.drain()" msgstr "" +"stream.writelines(lines)\n" +"await stream.drain()" msgid "The method closes the stream and the underlying socket." -msgstr "" +msgstr "این متد جریان و سوکت زیربنایی را می‌بندد." -msgid "The method should be used, though not mandatory, along with the ``wait_closed()`` method::" +msgid "" +"The method should be used, though not mandatory, along with the " +"``wait_closed()`` method::" msgstr "" +"این متد بهتر است، هرچند اجباری نیست، همراه با متد ``wait_closed()`` استفاده " +"شود::" msgid "" "stream.close()\n" "await stream.wait_closed()" msgstr "" +"stream.close()\n" +"await stream.wait_closed()" -msgid "Return ``True`` if the underlying transport supports the :meth:`write_eof` method, ``False`` otherwise." +msgid "" +"Return ``True`` if the underlying transport supports the :meth:`write_eof` " +"method, ``False`` otherwise." msgstr "" +"اگر انتقال زیربناییاز متد :meth:`write_eof` پشتیبانی کند، " +"``True`` را برمی‌گرداند، در غیر این صورت ``False`` را برمی‌گرداند." -msgid "Close the write end of the stream after the buffered write data is flushed." -msgstr "" +msgid "" +"Close the write end of the stream after the buffered write data is flushed." +msgstr "پس از تخلیه‌شدن داده‌های نوشتاری بافرشده، پایانه نوشتاری جریان را ببندید." msgid "Return the underlying asyncio transport." -msgstr "" +msgstr "انتقالزیربنایی asyncio را برمی‌گرداند." -msgid "Access optional transport information; see :meth:`BaseTransport.get_extra_info` for details." +msgid "" +"Access optional transport information; " +"see :meth:`BaseTransport.get_extra_info` for details." msgstr "" +"به اطلاعات اختیاری انتقالدسترسی پیدا کنید؛ برای " +"جزئیات، :meth:`BaseTransport.get_extra_info` را ببینید." msgid "Wait until it is appropriate to resume writing to the stream. Example::" -msgstr "" +msgstr "صبر کنید تا زمان مناسب برای ازسرگیری نوشتن در جریان برسد. مثال::" msgid "" "writer.write(data)\n" "await writer.drain()" msgstr "" +"writer.write(data)\n" +"await writer.drain()" -msgid "This is a flow control method that interacts with the underlying IO write buffer. When the size of the buffer reaches the high watermark, *drain()* blocks until the size of the buffer is drained down to the low watermark and writing can be resumed. When there is nothing to wait for, the :meth:`drain` returns immediately." -msgstr "" +msgid "" +"This is a flow control method that interacts with the underlying IO write " +"buffer. When the size of the buffer reaches the high watermark, *drain()* " +"blocks until the size of the buffer is drained down to the low watermark and " +"writing can be resumed. When there is nothing to wait for, the :meth:`drain` " +"returns immediately." +msgstr "" +"این یک متد کنترل جریان است که با بافر نوشتاری زیربنایی IO تعامل دارد. هنگامی " +"که اندازه‌ی بافر به آستانه‌ی بالا (high watermark) برسد، *drain()* مسدود می‌شود " +"تا زمانی که بافر تخلیه شود و اندازه‌ی آن به آستانه‌ی پایین (low watermark) برسد " +"و بتوان نوشتن را از سر گرفت. هنگامی که چیزی برای انتظار وجود نداشته " +"باشد، :meth:`drain` بلافاصله بازمی‌گردد." -msgid "When the write buffer is below the high watermark, :meth:`drain` returns immediately without yielding to the event loop. As a result, code which repeatedly calls ``write()`` followed by ``await drain()`` may prevent other tasks from running. To prevent blocking behavior, yield to the event loop explicitly with ``await asyncio.sleep(0)`` (see :func:`asyncio.sleep`)." -msgstr "" +msgid "" +"When the write buffer is below the high watermark, :meth:`drain` returns " +"immediately without yielding to the event loop. As a result, code which " +"repeatedly calls ``write()`` followed by ``await drain()`` may prevent other " +"tasks from running. To prevent blocking behavior, yield to the event loop " +"explicitly with ``await asyncio.sleep(0)`` (see :func:`asyncio.sleep`)." +msgstr "" +"هنگامی که بافر نوشتن کمتر از آستانه بالا (high watermark) باشد، :meth:`drain` " +"بلافاصله و بدون واگذاری کنترل به حلقه رویداد بازمی‌گردد. در نتیجه، کدی که به‌طور " +"مکرر ``write()`` و سپس ``await drain()`` را فراخوانی می‌کند، ممکن است مانع " +"اجرای سایر taskها شود. برای جلوگیری از رفتار مسدودکننده، به‌صراحت با ``await " +"asyncio.sleep(0)`` کنترل را به حلقه رویداد واگذار کنید " +"(به :func:`asyncio.sleep` مراجعه کنید)." msgid "Upgrade an existing stream-based connection to TLS." -msgstr "" +msgstr "ارتقای یک اتصال مبتنی بر جریان موجود به TLS." msgid "Parameters:" -msgstr "" +msgstr "پارامترها:" msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." -msgstr "" +msgstr "*sslcontext*: یک نمونه‌ی پیکربندی‌شده از :class:`~ssl.SSLContext`." -msgid "*server_hostname*: sets or overrides the host name that the target server's certificate will be matched against." +msgid "" +"*server_hostname*: sets or overrides the host name that the target server's " +"certificate will be matched against." msgstr "" +"*server_hostname*: نام میزبانی را که گواهی‌ی سرور هدف با آن مطابقت داده " +"خواهد شد، تنظیم یا بازنویسی می‌کند." -msgid "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake to complete before aborting the connection. ``60.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " +"to complete before aborting the connection. ``60.0`` seconds if ``None`` " +"(default)." msgstr "" +"*ssl_handshake_timeout* مدت زمان انتظار به ثانیه برای تکمیل دست‌دهی TLS پیش از " +"قطع اتصال است. اگر ``None`` باشد، ``60.0`` ثانیه (پیش‌فرض)." -msgid "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown to complete before aborting the connection. ``30.0`` seconds if ``None`` (default)." +msgid "" +"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown to " +"complete before aborting the connection. ``30.0`` seconds if ``None`` " +"(default)." msgstr "" +"*ssl_shutdown_timeout* زمان بر حسب ثانیه است که باید برای تکمیل خاموش‌سازی SSL " +"پیش از قطع اتصال منتظر بمانید. اگر ``None`` باشد، ``30.0`` ثانیه است (پیش‌فرض)." -msgid "Return ``True`` if the stream is closed or in the process of being closed." -msgstr "" +msgid "" +"Return ``True`` if the stream is closed or in the process of being closed." +msgstr "اگر جریان بسته باشد یا در حال بسته شدن باشد، ``True`` را برمی‌گرداند." msgid "Wait until the stream is closed." -msgstr "" +msgstr "صبر کنید تا جریان بسته شود." -msgid "Should be called after :meth:`close` to wait until the underlying connection is closed, ensuring that all data has been flushed before e.g. exiting the program." +msgid "" +"Should be called after :meth:`close` to wait until the underlying connection " +"is closed, ensuring that all data has been flushed before e.g. exiting the " +"program." msgstr "" +"باید پس از :meth:`close` فراخوانی شود تا منتظر بماند تا اتصال زیربنایی بسته " +"شود، و اطمینان حاصل شود که تمام داده‌ها پیش از اقداماتی مانند خروج از برنامه " +"تخلیه (flush) شده‌اند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "TCP echo client using streams" -msgstr "" +msgstr "کلاینت اکوی TCP با استفاده از استریم‌ها" msgid "TCP echo client using the :func:`asyncio.open_connection` function::" -msgstr "" +msgstr "کلاینت اکوی TCP با استفاده از تابع :func:`asyncio.open_connection`::" -msgid "The :ref:`TCP echo client protocol ` example uses the low-level :meth:`loop.create_connection` method." +msgid "" +"The :ref:`TCP echo client protocol ` " +"example uses the low-level :meth:`loop.create_connection` method." msgstr "" +"مثال :ref:`پروتکل کلاینت اکو TCP ` " +"از متد سطح پایین :meth:`loop.create_connection` استفاده می‌کند." msgid "TCP echo server using streams" -msgstr "" +msgstr "سرور اکوی TCP با استفاده از جریان‌ها (streams)" msgid "TCP echo server using the :func:`asyncio.start_server` function::" -msgstr "" +msgstr "سرور اکو TCP با استفاده از تابع :func:`asyncio.start_server`::" msgid "" "import asyncio\n" @@ -353,15 +590,49 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def handle_echo(reader, writer):\n" +" data = await reader.read(100)\n" +" message = data.decode()\n" +" addr = writer.get_extra_info('peername')\n" +"\n" +" print(f\"Received {message!r} from {addr!r}\")\n" +"\n" +" print(f\"Send: {message!r}\")\n" +" writer.write(data)\n" +" await writer.drain()\n" +"\n" +" print(\"Close the connection\")\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"async def main():\n" +" server = await asyncio.start_server(\n" +" handle_echo, '127.0.0.1', 8888)\n" +"\n" +" addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)\n" +" print(f'Serving on {addrs}')\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"asyncio.run(main())" -msgid "The :ref:`TCP echo server protocol ` example uses the :meth:`loop.create_server` method." +msgid "" +"The :ref:`TCP echo server protocol ` " +"example uses the :meth:`loop.create_server` method." msgstr "" +"مثال :ref:`پروتکل سرور اکوی TCP ` از " +"متد :meth:`loop.create_server` استفاده می‌کند." msgid "Get HTTP headers" -msgstr "" +msgstr "دریافت سرآیندهای HTTP" -msgid "Simple example querying HTTP headers of the URL passed on the command line::" +msgid "" +"Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" +"مثال ساده‌ای برای پرس‌وجوی سرآیندهای HTTP مربوط به URL داده‌شده در خط فرمان::" msgid "" "import asyncio\n" @@ -400,24 +671,63 @@ msgid "" "url = sys.argv[1]\n" "asyncio.run(print_http_headers(url))" msgstr "" +"import asyncio\n" +"import urllib.parse\n" +"import sys\n" +"\n" +"async def print_http_headers(url):\n" +" url = urllib.parse.urlsplit(url)\n" +" if url.scheme == 'https':\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 443, ssl=True)\n" +" else:\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 80)\n" +"\n" +" query = (\n" +" f\"HEAD {url.path or '/'} HTTP/1.0\\r\\n\"\n" +" f\"Host: {url.hostname}\\r\\n\"\n" +" f\"\\r\\n\"\n" +" )\n" +"\n" +" writer.write(query.encode('latin-1'))\n" +" while True:\n" +" line = await reader.readline()\n" +" if not line:\n" +" break\n" +"\n" +" line = line.decode('latin1').rstrip()\n" +" if line:\n" +" print(f'HTTP header> {line}')\n" +"\n" +" # Ignore the body, close the socket\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"url = sys.argv[1]\n" +"asyncio.run(print_http_headers(url))" msgid "Usage::" -msgstr "" +msgstr "استفاده::" msgid "python example.py http://example.com/path/page.html" -msgstr "" +msgstr "python example.py http://example.com/path/page.html" msgid "or with HTTPS::" -msgstr "" +msgstr "یا با HTTPS::" msgid "python example.py https://example.com/path/page.html" -msgstr "" +msgstr "python example.py https://example.com/path/page.html" msgid "Register an open socket to wait for data using streams" -msgstr "" +msgstr "ثبت یک سوکت باز برای انتظار داده با استفاده از جریان‌ها" -msgid "Coroutine waiting until a socket receives data using the :func:`open_connection` function::" +msgid "" +"Coroutine waiting until a socket receives data using " +"the :func:`open_connection` function::" msgstr "" +"هم‌روالی که با استفاده از تابع :func:`open_connection` منتظر می‌ماند تا یک سوکت " +"داده دریافت کند::" msgid "" "import asyncio\n" @@ -450,9 +760,50 @@ msgid "" "\n" "asyncio.run(wait_for_data())" msgstr "" +"import asyncio\n" +"import socket\n" +"\n" +"async def wait_for_data():\n" +" # Get a reference to the current event loop because\n" +" # we want to access low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Create a pair of connected sockets.\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the open socket to wait for data.\n" +" reader, writer = await asyncio.open_connection(sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" # Wait for data\n" +" data = await reader.read(100)\n" +"\n" +" # Got data, we are done: close the socket\n" +" print(\"Received:\", data.decode())\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +" # Close the second socket\n" +" wsock.close()\n" +"\n" +"asyncio.run(wait_for_data())" -msgid "The :ref:`register an open socket to wait for data using a protocol ` example uses a low-level protocol and the :meth:`loop.create_connection` method." +msgid "" +"The :ref:`register an open socket to wait for data using a protocol " +"` example uses a low-level protocol and " +"the :meth:`loop.create_connection` method." msgstr "" +"مثال :ref:`ثبت یک سوکت باز برای انتظار داده با استفاده از یک پروتکل " +"` از یک پروتکل سطح پایین و " +"متد :meth:`loop.create_connection` استفاده می‌کند." -msgid "The :ref:`watch a file descriptor for read events ` example uses the low-level :meth:`loop.add_reader` method to watch a file descriptor." +msgid "" +"The :ref:`watch a file descriptor for read events ` " +"example uses the low-level :meth:`loop.add_reader` method to watch a file " +"descriptor." msgstr "" +"مثال :ref:`پایش یک توصیف‌گر فایل برای رویدادهای خواندن " +"` از متد سطح پایین :meth:`loop.add_reader` برای پایش " +"یک توصیف‌گر فایل استفاده می‌کند." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 9bac6e1d2..db08ae320 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -26,16 +26,28 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Subprocesses" -msgstr "" +msgstr "زیرفرایندها" -msgid "**Source code:** :source:`Lib/asyncio/subprocess.py`, :source:`Lib/asyncio/base_subprocess.py`" +msgid "" +"**Source code:** :source:`Lib/asyncio/subprocess.py`, " +":source:`Lib/asyncio/base_subprocess.py`" msgstr "" +":source:`Lib/asyncio/subprocess.py`, " +":source:`Lib/asyncio/base_subprocess.py`" -msgid "This section describes high-level async/await asyncio APIs to create and manage subprocesses." +msgid "" +"This section describes high-level async/await asyncio APIs to create and " +"manage subprocesses." msgstr "" +"این بخش APIهای سطح‌بالای async/await asyncio را برای ایجاد و مدیریت " +"زیرفرایندها توضیح می‌دهد." -msgid "Here's an example of how asyncio can run a shell command and obtain its result::" +msgid "" +"Here's an example of how asyncio can run a shell command and obtain its " +"result::" msgstr "" +"در اینجا مثالی از این آمده است که asyncio چگونه می‌تواند یک دستور پوسته را " +"اجرا کند و نتیجه‌ی آن را به دست آورد::" msgid "" "import asyncio\n" @@ -56,18 +68,46 @@ msgid "" "\n" "asyncio.run(run('ls /zzz'))" msgstr "" +"import asyncio\n" +"\n" +"async def run(cmd):\n" +" proc = await asyncio.create_subprocess_shell(\n" +" cmd,\n" +" stdout=asyncio.subprocess.PIPE,\n" +" stderr=asyncio.subprocess.PIPE)\n" +"\n" +" stdout, stderr = await proc.communicate()\n" +"\n" +" print(f'[{cmd!r} exited with {proc.returncode}]')\n" +" if stdout:\n" +" print(f'[stdout]\\n{stdout.decode()}')\n" +" if stderr:\n" +" print(f'[stderr]\\n{stderr.decode()}')\n" +"\n" +"asyncio.run(run('ls /zzz'))" msgid "will print::" -msgstr "" +msgstr "چاپ خواهد شد::" msgid "" "['ls /zzz' exited with 1]\n" "[stderr]\n" "ls: /zzz: No such file or directory" msgstr "" +"['ls /zzz' exited with 1]\n" +"[stderr]\n" +"ls: /zzz: No such file or directory" -msgid "Because all asyncio subprocess functions are asynchronous and asyncio provides many tools to work with such functions, it is easy to execute and monitor multiple subprocesses in parallel. It is indeed trivial to modify the above example to run several commands simultaneously::" +msgid "" +"Because all asyncio subprocess functions are asynchronous and asyncio " +"provides many tools to work with such functions, it is easy to execute and " +"monitor multiple subprocesses in parallel. It is indeed trivial to modify " +"the above example to run several commands simultaneously::" msgstr "" +"از آن‌جا که تمام توابع زیرفرایند (subprocess) در asyncio ناهمگام هستند و " +"asyncio ابزارهای بسیاری برای کار با چنین توابعی فراهم می‌کند، اجرا و پایش " +"چندین زیرفرایند به‌صورت موازی آسان است. در واقع، اصلاح مثال بالا برای اجرای" +" همزمان چندین فرمان بسیار ساده است::" msgid "" "async def main():\n" @@ -77,213 +117,437 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def main():\n" +" await asyncio.gather(\n" +" run('ls /zzz'),\n" +" run('sleep 1; echo \"hello\"'))\n" +"\n" +"asyncio.run(main())" msgid "See also the `Examples`_ subsection." -msgstr "" +msgstr "همچنین زیربخش `Examples`_ را ببینید." msgid "Creating Subprocesses" -msgstr "" +msgstr "ایجاد زیرفرآیندها" msgid "Create a subprocess." -msgstr "" +msgstr "ایجاد یک زیرفرایند." -msgid "The *limit* argument sets the buffer limit for :class:`StreamReader` wrappers for :attr:`~asyncio.subprocess.Process.stdout` and :attr:`~asyncio.subprocess.Process.stderr` (if :const:`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." +msgid "" +"The *limit* argument sets the buffer limit for :class:`StreamReader` " +"wrappers for :attr:`~asyncio.subprocess.Process.stdout` and " +":attr:`~asyncio.subprocess.Process.stderr` (if :const:`subprocess.PIPE` is " +"passed to *stdout* and *stderr* arguments)." msgstr "" +"آرگومان *limit* محدودیت بافر را برای دربرگیرنده‌های :class:`StreamReader` " +"مربوط به :attr:`~asyncio.subprocess.Process.stdout` و " +":attr:`~asyncio.subprocess.Process.stderr` تنظیم می‌کند (اگر " +":const:`subprocess.PIPE` به آرگومان‌های *stdout* و *stderr* ارسال شود)." msgid "Return a :class:`~asyncio.subprocess.Process` instance." -msgstr "" +msgstr "یک نمونه از :class:`~asyncio.subprocess.Process` برمی‌گرداند." -msgid "See the documentation of :meth:`loop.subprocess_exec` for other parameters." -msgstr "" +msgid "" +"See the documentation of :meth:`loop.subprocess_exec` for other parameters." +msgstr "برای سایر پارامترها، مستندات :meth:`loop.subprocess_exec` را ببینید." -msgid "If the process object is garbage collected while the process is still running, the child process will be killed." +msgid "" +"If the process object is garbage collected while the process is still " +"running, the child process will be killed." msgstr "" +"اگر شیء فرایند در حالی که فرایند هنوز در حال اجرا است زباله‌روبی شود، فرایند" +" فرزند خاتمه داده خواهد شد." msgid "Removed the *loop* parameter." -msgstr "" +msgstr "پارامتر *loop* حذف شد." msgid "Run the *cmd* shell command." -msgstr "" +msgstr "دستور پوسته‌ی *cmd* را اجرا کنید." -msgid "See the documentation of :meth:`loop.subprocess_shell` for other parameters." -msgstr "" +msgid "" +"See the documentation of :meth:`loop.subprocess_shell` for other parameters." +msgstr "برای سایر پارامترها، مستندات :meth:`loop.subprocess_shell` را ببینید." -msgid "It is the application's responsibility to ensure that all whitespace and special characters are quoted appropriately to avoid `shell injection `_ vulnerabilities. The :func:`shlex.quote` function can be used to properly escape whitespace and special shell characters in strings that are going to be used to construct shell commands." -msgstr "" +msgid "" +"It is the application's responsibility to ensure that all whitespace and " +"special characters are quoted appropriately to avoid `shell injection " +"`_ " +"vulnerabilities. The :func:`shlex.quote` function can be used to properly " +"escape whitespace and special shell characters in strings that are going to " +"be used to construct shell commands." +msgstr "" +"این مسئولیت برنامه است که اطمینان حاصل کند همه‌ی نویسه‌های فضای خالی و " +"نویسه‌های خاص به‌درستی درون علامت نقل‌قول قرار گیرند تا از آسیب‌پذیری‌های " +"`تزریق پوسته " +"`_ جلوگیری " +"شود. برای خنثی کردن صحیح نویسه‌های فضای خالی و نویسه‌های خاص پوسته در " +"رشته‌هایی که قرار است برای ساخت دستورات پوسته استفاده شوند، می‌توان از تابع " +":func:`shlex.quote` استفاده کرد." -msgid "Subprocesses are available for Windows if a :class:`ProactorEventLoop` is used. See :ref:`Subprocess Support on Windows ` for details." +msgid "" +"Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " +"used. See :ref:`Subprocess Support on Windows ` " +"for details." msgstr "" +"زیرفرایندها برای ویندوز در دسترس هستند، اگر از :class:`ProactorEventLoop` " +"استفاده شود. برای جزئیات، :ref:`پشتیبانی از زیرفرایند در ویندوز ` را ببینید." -msgid "asyncio also has the following *low-level* APIs to work with subprocesses: :meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop.connect_read_pipe`, :meth:`loop.connect_write_pipe`, as well as the :ref:`Subprocess Transports ` and :ref:`Subprocess Protocols `." -msgstr "" +msgid "" +"asyncio also has the following *low-level* APIs to work with subprocesses: " +":meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, " +":meth:`loop.connect_read_pipe`, :meth:`loop.connect_write_pipe`, as well as " +"the :ref:`Subprocess Transports ` and " +":ref:`Subprocess Protocols `." +msgstr "" +"asyncio همچنین APIهای *سطح پایین* زیر را برای کار با زیرفرایندها دارد: " +":meth:`loop.subprocess_exec`، :meth:`loop.subprocess_shell`، " +":meth:`loop.connect_read_pipe`، :meth:`loop.connect_write_pipe`، و نیز " +":ref:`ترابری‌های زیرفرایند ` و " +":ref:`پروتکل‌های زیرفرایند `." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." -msgstr "" +msgstr "می‌تواند به پارامترهای *stdin*، *stdout* یا *stderr* ارسال شود." -msgid "If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`~asyncio.StreamWriter` instance." +msgid "" +"If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin " +"` attribute will point to a " +":class:`~asyncio.StreamWriter` instance." msgstr "" +"اگر *PIPE* به آرگومان *stdin* داده شود، ویژگی :attr:`Process.stdin " +"` به نمونه‌ای از " +":class:`~asyncio.StreamWriter` اشاره خواهد کرد." -msgid "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process.stdout ` and :attr:`Process.stderr ` attributes will point to :class:`~asyncio.StreamReader` instances." +msgid "" +"If *PIPE* is passed to *stdout* or *stderr* arguments, the " +":attr:`Process.stdout ` and " +":attr:`Process.stderr ` attributes will " +"point to :class:`~asyncio.StreamReader` instances." msgstr "" +"اگر *PIPE* به آرگومان‌های *stdout* یا *stderr* داده شود، ویژگی‌های " +":attr:`Process.stdout ` و " +":attr:`Process.stderr ` به نمونه‌هایی از " +":class:`~asyncio.StreamReader` اشاره خواهند کرد." -msgid "Special value that can be used as the *stderr* argument and indicates that standard error should be redirected into standard output." +msgid "" +"Special value that can be used as the *stderr* argument and indicates that " +"standard error should be redirected into standard output." msgstr "" +"مقدار ویژه‌ای که می‌تواند به‌عنوان آرگومان *stderr* استفاده شود و نشان " +"می‌دهد که خطای استاندارد باید به خروجی استاندارد هدایت شود." -msgid "Special value that can be used as the *stdin*, *stdout* or *stderr* argument to process creation functions. It indicates that the special file :data:`os.devnull` will be used for the corresponding subprocess stream." +msgid "" +"Special value that can be used as the *stdin*, *stdout* or *stderr* argument" +" to process creation functions. It indicates that the special file " +":data:`os.devnull` will be used for the corresponding subprocess stream." msgstr "" +"مقدار ویژه‌ای که می‌تواند به‌عنوان آرگومان *stdin*، *stdout* یا *stderr* در " +"توابع ایجاد فرایند استفاده شود. این مقدار نشان می‌دهد که فایل ویژه‌ی " +":data:`os.devnull` برای جریان متناظر زیرفرایند استفاده خواهد شد." msgid "Interacting with Subprocesses" -msgstr "" +msgstr "تعامل با زیرفرایندها" -msgid "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` functions return instances of the *Process* class. *Process* is a high-level wrapper that allows communicating with subprocesses and watching for their completion." +msgid "" +"Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " +"functions return instances of the *Process* class. *Process* is a high-" +"level wrapper that allows communicating with subprocesses and watching for " +"their completion." msgstr "" +"هر دو تابع :func:`create_subprocess_exec` و :func:`create_subprocess_shell` " +"نمونه‌هایی از کلاس *Process* را برمی‌گردانند. *Process* دربرگیرنده‌ای سطح " +"بالا است که امکان ارتباط با زیرفرایندها و پایش تکمیل آن‌ها را فراهم می‌کند." -msgid "An object that wraps OS processes created by the :func:`~asyncio.create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` functions." +msgid "" +"An object that wraps OS processes created by the " +":func:`~asyncio.create_subprocess_exec` and " +":func:`~asyncio.create_subprocess_shell` functions." msgstr "" +"شیءای که فرآیندهای سیستم‌عاملِ ایجادشده توسط توابع " +":func:`~asyncio.create_subprocess_exec` و " +":func:`~asyncio.create_subprocess_shell` را در بر می‌گیرد." -msgid "This class is designed to have a similar API to the :class:`subprocess.Popen` class, but there are some notable differences:" +msgid "" +"This class is designed to have a similar API to the " +":class:`subprocess.Popen` class, but there are some notable differences:" msgstr "" +"این کلاس طراحی شده است تا API مشابهی با کلاس :class:`subprocess.Popen` داشته" +" باشد، اما برخی تفاوت‌های قابل‌توجه وجود دارد:" -msgid "unlike Popen, Process instances do not have an equivalent to the :meth:`~subprocess.Popen.poll` method;" +msgid "" +"unlike Popen, Process instances do not have an equivalent to the " +":meth:`~subprocess.Popen.poll` method;" msgstr "" +"برخلاف Popen، نمونه‌های Process معادلی برای متد " +":meth:`~subprocess.Popen.poll` ندارند؛" -msgid "the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* parameter: use the :func:`~asyncio.wait_for` function;" +msgid "" +"the :meth:`~asyncio.subprocess.Process.communicate` and " +":meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* " +"parameter: use the :func:`~asyncio.wait_for` function;" msgstr "" +"متدهای :meth:`~asyncio.subprocess.Process.communicate` و " +":meth:`~asyncio.subprocess.Process.wait` پارامتر *timeout* ندارند: از تابع " +":func:`~asyncio.wait_for` استفاده کنید؛" -msgid "the :meth:`Process.wait() ` method is asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as a blocking busy loop;" +msgid "" +"the :meth:`Process.wait() ` method is " +"asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as" +" a blocking busy loop;" msgstr "" +"متد :meth:`Process.wait() ` ناهمگام است، در" +" حالی که متد :meth:`subprocess.Popen.wait` به‌صورت یک حلقه مشغول مسدودکننده " +"(blocking busy loop) پیاده‌سازی شده است؛" msgid "the *universal_newlines* parameter is not supported." -msgstr "" +msgstr "پارامتر *universal_newlines* پشتیبانی نمی‌شود." msgid "This class is :ref:`not thread safe `." -msgstr "" +msgstr "این کلاس :ref:`ایمن در برابر نخ نیست `." -msgid "See also the :ref:`Subprocess and Threads ` section." +msgid "" +"See also the :ref:`Subprocess and Threads ` " +"section." msgstr "" +"همچنین بخش :ref:`زیرفرایند و نخ‌ها ` را ببینید." msgid "Wait for the child process to terminate." -msgstr "" +msgstr "منتظر بمانید تا فرایند فرزند خاتمه یابد." msgid "Set and return the :attr:`returncode` attribute." -msgstr "" +msgstr "ویژگی :attr:`returncode` را تنظیم می‌کند و برمی‌گرداند." -msgid "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the child process generates so much output that it blocks waiting for the OS pipe buffer to accept more data. Use the :meth:`communicate` method when using pipes to avoid this condition." +msgid "" +"This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " +"the child process generates so much output that it blocks waiting for the OS" +" pipe buffer to accept more data. Use the :meth:`communicate` method when " +"using pipes to avoid this condition." msgstr "" +"این متد ممکن است هنگام استفاده از ``stdout=PIPE`` یا ``stderr=PIPE`` و در " +"صورتی که فرایند فرزند آن‌قدر خروجی تولید کند که در انتظار پذیرش داده‌های " +"بیشتر توسط بافر پایپ سیستم‌عامل مسدود شود، دچار بن‌بست شود. برای جلوگیری از " +"این وضعیت، هنگام استفاده از پایپ‌ها از متد :meth:`communicate` استفاده کنید." msgid "Interact with process:" -msgstr "" +msgstr "تعامل با فرایند:" msgid "send data to *stdin* (if *input* is not ``None``);" -msgstr "" +msgstr "ارسال داده به *stdin* (اگر *input* ``None`` نباشد)؛" msgid "closes *stdin*;" -msgstr "" +msgstr "*stdin* را می‌بندد؛" msgid "read data from *stdout* and *stderr*, until EOF is reached;" -msgstr "" +msgstr "داده‌ها را از *stdout* و *stderr*، تا رسیدن به EOF بخوانید؛" msgid "wait for process to terminate." -msgstr "" +msgstr "صبر کنید تا فرایند خاتمه یابد." -msgid "The optional *input* argument is the data (:class:`bytes` object) that will be sent to the child process." +msgid "" +"The optional *input* argument is the data (:class:`bytes` object) that will " +"be sent to the child process." msgstr "" +"آرگومان اختیاری *input*، داده‌ای است (شیء :class:`bytes`) که به فرایند فرزند" +" ارسال خواهد شد." msgid "Return a tuple ``(stdout_data, stderr_data)``." -msgstr "" +msgstr "یک تاپل ``(stdout_data, stderr_data)`` برمی‌گرداند." -msgid "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is raised when writing *input* into *stdin*, the exception is ignored. This condition occurs when the process exits before all data are written into *stdin*." +msgid "" +"If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is" +" raised when writing *input* into *stdin*, the exception is ignored. This " +"condition occurs when the process exits before all data are written into " +"*stdin*." msgstr "" +"اگر هنگام نوشتن *input* به *stdin*، استثنای :exc:`BrokenPipeError` یا " +":exc:`ConnectionResetError` پرتاب شود، آن استثنا نادیده گرفته می‌شود. این " +"حالت زمانی رخ می‌دهد که فرآیند پیش از آنکه همه داده‌ها به *stdin* نوشته " +"شوند، خارج شود." -msgid "If it is desired to send data to the process' *stdin*, the process needs to be created with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, the process has to be created with ``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." +msgid "" +"If it is desired to send data to the process' *stdin*, the process needs to " +"be created with ``stdin=PIPE``. Similarly, to get anything other than " +"``None`` in the result tuple, the process has to be created with " +"``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" +"اگر بخواهید داده‌ای را به *stdin* فرایند بفرستید، فرایند باید با " +"``stdin=PIPE`` ایجاد شود. به‌طور مشابه، برای دریافت هر چیزی غیر از ``None`` " +"در تاپل نتیجه، فرایند باید با آرگومان‌های ``stdout=PIPE`` و/یا " +"``stderr=PIPE`` ایجاد شود." -msgid "Note, that the data read is buffered in memory, so do not use this method if the data size is large or unlimited." +msgid "" +"Note, that the data read is buffered in memory, so do not use this method if" +" the data size is large or unlimited." msgstr "" +"توجه داشته باشید که داده‌های خوانده‌شده در حافظه بافر می‌شوند، بنابراین اگر " +"اندازه‌ی داده‌ها بزرگ یا نامحدود است، از این متد استفاده نکنید." msgid "*stdin* gets closed when ``input=None`` too." -msgstr "" +msgstr "*stdin* همچنین وقتی ``input=None`` باشد بسته می‌شود." msgid "Sends the signal *signal* to the child process." -msgstr "" +msgstr "سیگنال *signal* را به فرایند فرزند ارسال می‌کند." -msgid "On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. ``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." +msgid "" +"On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " +"``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " +"with a *creationflags* parameter which includes " +"``CREATE_NEW_PROCESS_GROUP``." msgstr "" +"در ویندوز، :py:const:`~signal.SIGTERM` نام مستعاری برای :meth:`terminate` " +"است. می‌توان ``CTRL_C_EVENT`` و ``CTRL_BREAK_EVENT`` را به فرآیندهایی که با " +"پارامتر *creationflags* حاوی ``CREATE_NEW_PROCESS_GROUP`` آغاز شده‌اند، " +"ارسال کرد." msgid "Stop the child process." -msgstr "" +msgstr "فرایند فرزند را متوقف کنید." -msgid "On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child process." +msgid "" +"On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " +"process." msgstr "" +"در سیستم‌های POSIX، این متد :py:const:`~signal.SIGTERM` را به فرایند فرزند " +"ارسال می‌کند." -msgid "On Windows the Win32 API function :c:func:`!TerminateProcess` is called to stop the child process." +msgid "" +"On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " +"stop the child process." msgstr "" +"در ویندوز، تابع Win32 API با نام :c:func:`!TerminateProcess` برای توقف " +"فرایند فرزند فراخوانی می‌شود." msgid "Kill the child process." -msgstr "" +msgstr "فرایند فرزند را خاتمه دهید." -msgid "On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child process." +msgid "" +"On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child " +"process." msgstr "" +"در سیستم‌های POSIX، این متد :py:data:`~signal.SIGKILL` را به فرایند فرزند " +"ارسال می‌کند." msgid "On Windows this method is an alias for :meth:`terminate`." -msgstr "" +msgstr "در ویندوز، این متد نام مستعاری برای :meth:`terminate` است." -msgid "Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the process was created with ``stdin=None``." +msgid "" +"Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the " +"process was created with ``stdin=None``." msgstr "" +"جریان ورودی استاندارد (:class:`~asyncio.StreamWriter`) یا ``None`` اگر " +"فرایند با ``stdin=None`` ایجاد شده باشد." -msgid "Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the process was created with ``stdout=None``." +msgid "" +"Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the " +"process was created with ``stdout=None``." msgstr "" +"جریان خروجی استاندارد (:class:`~asyncio.StreamReader`) یا ``None`` اگر " +"فرآیند با ``stdout=None`` ایجاد شده باشد." -msgid "Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the process was created with ``stderr=None``." +msgid "" +"Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the " +"process was created with ``stderr=None``." msgstr "" +"جریان خطای استاندارد (:class:`~asyncio.StreamReader`) یا ``None`` اگر فرآیند" +" با ``stderr=None`` ایجاد شده باشد." -msgid "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() `, :attr:`await process.stdout.read() ` or :attr:`await process.stderr.read() `. This avoids deadlocks due to streams pausing reading or writing and blocking the child process." +msgid "" +"Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " +"`, :attr:`await process.stdout.read() ` or :attr:`await " +"process.stderr.read() `. This avoids deadlocks due to streams " +"pausing reading or writing and blocking the child process." msgstr "" +"به‌جای :attr:`process.stdin.write() `، :attr:`await " +"process.stdout.read() ` یا :attr:`await process.stderr.read() " +"` از متد :meth:`communicate` استفاده کنید. این کار از بن‌بست‌های " +"ناشی از توقف خواندن یا نوشتن جریان‌ها و مسدود شدن فرایند فرزند جلوگیری " +"می‌کند." msgid "Process identification number (PID)." -msgstr "" +msgstr "شماره‌ی شناسایی فرایند (PID)." -msgid "Note that for processes created by the :func:`~asyncio.create_subprocess_shell` function, this attribute is the PID of the spawned shell." +msgid "" +"Note that for processes created by the " +":func:`~asyncio.create_subprocess_shell` function, this attribute is the PID" +" of the spawned shell." msgstr "" +"توجه داشته باشید که برای فرایندهای ایجادشده توسط تابع " +":func:`~asyncio.create_subprocess_shell`، این ویژگی، PID پوسته " +"راه‌اندازی‌شده است." msgid "Return code of the process when it exits." -msgstr "" +msgstr "کد بازگشتی فرایند هنگام خروج." msgid "A ``None`` value indicates that the process has not terminated yet." -msgstr "" +msgstr "مقدار ``None`` نشان می‌دهد که فرآیند هنوز به پایان نرسیده است." -msgid "For processes created with :func:`~asyncio.create_subprocess_exec`, a negative value ``-N`` indicates that the child was terminated by signal ``N`` (POSIX only)." +msgid "" +"For processes created with :func:`~asyncio.create_subprocess_exec`, a " +"negative value ``-N`` indicates that the child was terminated by signal " +"``N`` (POSIX only)." msgstr "" +"برای فرایندهایی که با :func:`~asyncio.create_subprocess_exec` ایجاد " +"می‌شوند، مقدار منفی ``-N`` نشان می‌دهد که فرایند فرزند با سیگنال ``N`` خاتمه" +" یافته است (فقط POSIX)." -msgid "For processes created with :func:`~asyncio.create_subprocess_shell`, the return code reflects the exit status of the shell itself (e.g. ``/bin/sh``), which may map signals to codes such as ``128+N``. See the documentation of the shell (for example, the Bash manual's Exit Status) for details." +msgid "" +"For processes created with :func:`~asyncio.create_subprocess_shell`, the " +"return code reflects the exit status of the shell itself (e.g. ``/bin/sh``)," +" which may map signals to codes such as ``128+N``. See the documentation of " +"the shell (for example, the Bash manual's Exit Status) for details." msgstr "" +"برای فرایندهایی که با :func:`~asyncio.create_subprocess_shell` ایجاد " +"می‌شوند، کد بازگشتی وضعیت خروج خود پوسته (برای مثال ``/bin/sh``) را منعکس " +"می‌کند، که ممکن است سیگنال‌ها را به کدهایی مانند ``128+N`` نگاشت کند. برای " +"جزئیات، مستندات پوسته (برای مثال، بخش Exit Status دفترچه راهنمای Bash) را " +"ببینید." msgid "Subprocess and Threads" -msgstr "" +msgstr "زیرفرایند و نخ‌ها" -msgid "Standard asyncio event loop supports running subprocesses from different threads by default." +msgid "" +"Standard asyncio event loop supports running subprocesses from different " +"threads by default." msgstr "" +"حلقه رویداد استاندارد asyncio به‌صورت پیش‌فرض از اجرای زیرفرایندها از نخ‌های" +" مختلف پشتیبانی می‌کند." -msgid "On Windows subprocesses are provided by :class:`ProactorEventLoop` only (default), :class:`SelectorEventLoop` has no subprocess support." +msgid "" +"On Windows subprocesses are provided by :class:`ProactorEventLoop` only " +"(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" +"در ویندوز، زیرفرایندها فقط توسط :class:`ProactorEventLoop` (پیش‌فرض) ارائه" +" می‌شوند؛ :class:`SelectorEventLoop` از زیرفرایندها پشتیبانی نمی‌کند." -msgid "Note that alternative event loop implementations might have own limitations; please refer to their documentation." +msgid "" +"Note that alternative event loop implementations might have own limitations;" +" please refer to their documentation." msgstr "" +"توجه داشته باشید که پیاده‌سازی‌های جایگزین حلقه رویداد ممکن است محدودیت‌های " +"خاص خود را داشته باشند؛ لطفاً به مستندات آن‌ها مراجعه کنید." -msgid "The :ref:`Concurrency and multithreading in asyncio ` section." -msgstr "" +msgid "" +"The :ref:`Concurrency and multithreading in asyncio ` section." +msgstr "بخش :ref:`هم‌روندی و چندنخی در asyncio `." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "An example using the :class:`~asyncio.subprocess.Process` class to control a subprocess and the :class:`StreamReader` class to read from its standard output." +msgid "" +"An example using the :class:`~asyncio.subprocess.Process` class to control a" +" subprocess and the :class:`StreamReader` class to read from its standard " +"output." msgstr "" +"مثالی که از کلاس :class:`~asyncio.subprocess.Process` برای کنترل یک " +"زیرفرایند و از کلاس :class:`StreamReader` برای خواندن از خروجی استاندارد آن " +"استفاده می‌کند." -msgid "The subprocess is created by the :func:`create_subprocess_exec` function::" -msgstr "" +msgid "" +"The subprocess is created by the :func:`create_subprocess_exec` function::" +msgstr "زیرفرایند توسط تابع :func:`create_subprocess_exec` ایجاد می‌شود::" msgid "" "import asyncio\n" @@ -309,6 +573,32 @@ msgid "" "date = asyncio.run(get_date())\n" "print(f\"Current date: {date}\")" msgstr "" +"import asyncio\n" +"import sys\n" +"\n" +"async def get_date():\n" +" code = 'import datetime as dt; print(dt.datetime.now())'\n" +"\n" +" # Create the subprocess; redirect the standard output\n" +" # into a pipe.\n" +" proc = await asyncio.create_subprocess_exec(\n" +" sys.executable, '-c', code,\n" +" stdout=asyncio.subprocess.PIPE)\n" +"\n" +" # Read one line of output.\n" +" data = await proc.stdout.readline()\n" +" line = data.decode('ascii').rstrip()\n" +"\n" +" # Wait for the subprocess exit.\n" +" await proc.wait()\n" +" return line\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" -msgid "See also the :ref:`same example ` written using low-level APIs." +msgid "" +"See also the :ref:`same example ` written " +"using low-level APIs." msgstr "" +"همچنین :ref:`همین مثال ` را که با استفاده " +"از APIهای سطح پایین نوشته‌شده است، ببینید." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index c67300a5a..bec1444e3 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -24,52 +24,74 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Synchronization Primitives" -msgstr "" +msgstr "اولیه‌های همگام‌سازی" msgid "**Source code:** :source:`Lib/asyncio/locks.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/asyncio/locks.py`" -msgid "asyncio synchronization primitives are designed to be similar to those of the :mod:`threading` module with two important caveats:" +msgid "" +"asyncio synchronization primitives are designed to be similar to those of " +"the :mod:`threading` module with two important caveats:" msgstr "" +"اصول همگام‌سازی asyncio به‌گونه‌ای طراحی شده‌اند که شبیه به همتاهای خود در " +"ماژول :mod:`threading` باشند، با دو نکته‌ی مهم:" -msgid "asyncio primitives are not thread-safe, therefore they should not be used for OS thread synchronization (use :mod:`threading` for that);" +msgid "" +"asyncio primitives are not thread-safe, therefore they should not be used " +"for OS thread synchronization (use :mod:`threading` for that);" msgstr "" +"اولیه‌های asyncio ایمن از نظر نخ (thread-safe) نیستند، بنابراین نباید برای " +"همگام‌سازی نخ‌های سیستم‌عامل از آن‌ها استفاده شود (برای این کار از " +":mod:`threading` استفاده کنید)؛" -msgid "methods of these synchronization primitives do not accept the *timeout* argument; use the :func:`asyncio.wait_for` function to perform operations with timeouts." +msgid "" +"methods of these synchronization primitives do not accept the *timeout* " +"argument; use the :func:`asyncio.wait_for` function to perform operations " +"with timeouts." msgstr "" +"متدهای این اولیه‌های همگام‌سازی (synchronization primitives) آرگومان " +"*timeout* را نمی‌پذیرند؛ برای انجام عملیات با مهلت‌های زمانی (timeouts) از " +"تابع :func:`asyncio.wait_for` استفاده کنید." msgid "asyncio has the following basic synchronization primitives:" -msgstr "" +msgstr "asyncio دارای اولیه‌های پایه‌ی همگام‌سازی زیر است:" msgid ":class:`Lock`" -msgstr "" +msgstr ":class:`Lock`" msgid ":class:`Event`" -msgstr "" +msgstr ":class:`Event`" msgid ":class:`Condition`" -msgstr "" +msgstr ":class:`Condition`" msgid ":class:`Semaphore`" -msgstr "" +msgstr ":class:`Semaphore`" msgid ":class:`BoundedSemaphore`" -msgstr "" +msgstr ":class:`BoundedSemaphore`" msgid ":class:`Barrier`" -msgstr "" +msgstr ":class:`Barrier`" msgid "Lock" -msgstr "" +msgstr "قفل" msgid "Implements a mutex lock for asyncio tasks. Not thread-safe." msgstr "" +"یک قفل متقابل (mutex lock) برای وظایف asyncio پیاده‌سازی می‌کند. ایمن از " +"نظر نخ (thread-safe) نیست." -msgid "An asyncio lock can be used to guarantee exclusive access to a shared resource." +msgid "" +"An asyncio lock can be used to guarantee exclusive access to a shared " +"resource." msgstr "" +"می‌توان از یک قفل asyncio برای تضمین دسترسی انحصاری به یک منبع مشترک استفاده" +" کرد." -msgid "The preferred way to use a Lock is an :keyword:`async with` statement::" -msgstr "" +msgid "" +"The preferred way to use a Lock is an :keyword:`async with` statement::" +msgstr "روش ترجیحی برای استفاده از Lock، دستور :keyword:`async with` است::" msgid "" "lock = asyncio.Lock()\n" @@ -78,9 +100,14 @@ msgid "" "async with lock:\n" " # access shared state" msgstr "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"async with lock:\n" +" # access shared state" msgid "which is equivalent to::" -msgstr "" +msgstr "که معادل زیر است::" msgid "" "lock = asyncio.Lock()\n" @@ -92,48 +119,80 @@ msgid "" "finally:\n" " lock.release()" msgstr "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"await lock.acquire()\n" +"try:\n" +" # access shared state\n" +"finally:\n" +" lock.release()" msgid "Removed the *loop* parameter." -msgstr "" +msgstr "پارامتر *loop* حذف شد." msgid "Acquire the lock." -msgstr "" +msgstr "قفل را کسب کنید." -msgid "This method waits until the lock is *unlocked*, sets it to *locked* and returns ``True``." +msgid "" +"This method waits until the lock is *unlocked*, sets it to *locked* and " +"returns ``True``." msgstr "" +"این متد منتظر می‌ماند تا قفل *باز* شود، آن را *قفل* می‌کند و ``True`` را " +"برمی‌گرداند." -msgid "When more than one coroutine is blocked in :meth:`acquire` waiting for the lock to be unlocked, only one coroutine eventually proceeds." +msgid "" +"When more than one coroutine is blocked in :meth:`acquire` waiting for the " +"lock to be unlocked, only one coroutine eventually proceeds." msgstr "" +"هنگامی که بیش از یک هم‌روال در :meth:`acquire` مسدود شده باشد و منتظر باز " +"شدن قفل باشد، در نهایت تنها یک هم‌روال ادامه پیدا می‌کند." -msgid "Acquiring a lock is *fair*: the coroutine that proceeds will be the first coroutine that started waiting on the lock." +msgid "" +"Acquiring a lock is *fair*: the coroutine that proceeds will be the first " +"coroutine that started waiting on the lock." msgstr "" +"کسب قفل *منصفانه* است: هم‌روالی که ادامه می‌دهد، نخستین هم‌روالی خواهد بود " +"که منتظر قفل شده است." msgid "Release the lock." -msgstr "" +msgstr "قفل را آزاد کنید." msgid "When the lock is *locked*, reset it to *unlocked* and return." -msgstr "" +msgstr "هنگامی که قفل *قفل‌شده* است، آن را به *باز* بازنشانی کنید و بازگردید." msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised." -msgstr "" +msgstr "اگر قفل *باز* باشد، یک :exc:`RuntimeError` پرتاب می‌شود." msgid "Return ``True`` if the lock is *locked*." -msgstr "" +msgstr "اگر قفل *قفل‌شده* باشد، ``True`` را برمی‌گرداند." msgid "Event" -msgstr "" +msgstr "رویداد" msgid "An event object. Not thread-safe." -msgstr "" +msgstr "یک شیء رویداد. ایمن در برابر نخ نیست." -msgid "An asyncio event can be used to notify multiple asyncio tasks that some event has happened." +msgid "" +"An asyncio event can be used to notify multiple asyncio tasks that some " +"event has happened." msgstr "" +"می‌توان از یک رویداد asyncio برای آگاه‌سازی چندین وظیفه در asyncio از" +" وقوع رویدادی استفاده کرد." -msgid "An Event object manages an internal flag that can be set to *true* with the :meth:`~Event.set` method and reset to *false* with the :meth:`clear` method. The :meth:`~Event.wait` method blocks until the flag is set to *true*. The flag is set to *false* initially." +msgid "" +"An Event object manages an internal flag that can be set to *true* with the " +":meth:`~Event.set` method and reset to *false* with the :meth:`clear` " +"method. The :meth:`~Event.wait` method blocks until the flag is set to " +"*true*. The flag is set to *false* initially." msgstr "" +"یک شیء Event یک پرچم داخلی را مدیریت می‌کند که می‌توان آن را با متد " +":meth:`~Event.set` روی *true* تنظیم کرد و با متد :meth:`clear` به *false* " +"بازنشانی کرد. متد :meth:`~Event.wait` تا زمانی که پرچم روی *true* تنظیم شود،" +" مسدود می‌شود. پرچم در ابتدا روی *false* تنظیم شده است." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "async def waiter(event):\n" @@ -157,45 +216,96 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"async def waiter(event):\n" +" print('waiting for it ...')\n" +" await event.wait()\n" +" print('... got it!')\n" +"\n" +"async def main():\n" +" # Create an Event object.\n" +" event = asyncio.Event()\n" +"\n" +" # Spawn a Task to wait until 'event' is set.\n" +" waiter_task = asyncio.create_task(waiter(event))\n" +"\n" +" # Sleep for 1 second and set the event.\n" +" await asyncio.sleep(1)\n" +" event.set()\n" +"\n" +" # Wait until the waiter task is finished.\n" +" await waiter_task\n" +"\n" +"asyncio.run(main())" msgid "Wait until the event is set." -msgstr "" +msgstr "صبر کنید تا رویداد تنظیم شود." -msgid "If the event is set, return ``True`` immediately. Otherwise block until another task calls :meth:`~Event.set`." +msgid "" +"If the event is set, return ``True`` immediately. Otherwise block until " +"another task calls :meth:`~Event.set`." msgstr "" +"اگر رویداد تنظیم‌شده باشد، بلافاصله ``True`` را برمی‌گرداند. در غیر این " +"صورت، تا زمانی که وظیفه دیگری :meth:`~Event.set` را فراخوانی کند، مسدود " +"می‌شود." msgid "Set the event." -msgstr "" +msgstr "رویداد را تنظیم کنید." msgid "All tasks waiting for event to be set will be immediately awakened." msgstr "" +"همه‌ی تسک‌هایی که در انتظار تنظیم شدن رویداد هستند، بی‌درنگ بیدار خواهند شد." msgid "Clear (unset) the event." -msgstr "" +msgstr "رویداد را پاک (لغو تنظیم) می‌کند." -msgid "Subsequent tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event.set` method is called again." +msgid "" +"Subsequent tasks awaiting on :meth:`~Event.wait` will now block until the " +":meth:`~Event.set` method is called again." msgstr "" +"وظایف بعدی که :meth:`~Event.wait` را await می‌کنند، اکنون تا زمانی که متد " +":meth:`~Event.set` دوباره فراخوانی شود، مسدود خواهند شد." msgid "Return ``True`` if the event is set." -msgstr "" +msgstr "اگر رویداد تنظیم‌شده باشد، ``True`` را برمی‌گرداند." msgid "Condition" -msgstr "" +msgstr "شرایط" msgid "A Condition object. Not thread-safe." -msgstr "" +msgstr "یک شیء Condition. ایمن از نظر نخ نیست." -msgid "An asyncio condition primitive can be used by a task to wait for some event to happen and then get exclusive access to a shared resource." +msgid "" +"An asyncio condition primitive can be used by a task to wait for some event " +"to happen and then get exclusive access to a shared resource." msgstr "" +"یک وظیفه می‌تواند از یک سازوکار شرطی اولیه در asyncio استفاده کند تا برای رخ" +" دادن رویدادی منتظر بماند و سپس دسترسی انحصاری به یک منبع مشترک را به‌دست " +"آورد." -msgid "In essence, a Condition object combines the functionality of an :class:`Event` and a :class:`Lock`. It is possible to have multiple Condition objects share one Lock, which allows coordinating exclusive access to a shared resource between different tasks interested in particular states of that shared resource." +msgid "" +"In essence, a Condition object combines the functionality of an " +":class:`Event` and a :class:`Lock`. It is possible to have multiple " +"Condition objects share one Lock, which allows coordinating exclusive access" +" to a shared resource between different tasks interested in particular " +"states of that shared resource." msgstr "" +"در اصل، یک شیء Condition، کارکرد :class:`Event` و :class:`Lock` را ترکیب " +"می‌کند. می‌توان چندین شیء Condition داشت که یک Lock را به اشتراک می‌گذارند؛ " +"این امکان، هماهنگ‌سازی دسترسی انحصاری به یک منبع مشترک را بین وظایف مختلفی" +" که به وضعیت‌های خاصی از آن منبع مشترک علاقه‌مند هستند، ممکن می‌سازد." -msgid "The optional *lock* argument must be a :class:`Lock` object or ``None``. In the latter case a new Lock object is created automatically." +msgid "" +"The optional *lock* argument must be a :class:`Lock` object or ``None``. In" +" the latter case a new Lock object is created automatically." msgstr "" +"آرگومان اختیاری *lock* باید یک شیء :class:`Lock` یا ``None`` باشد. در حالت " +"دوم، یک شیء Lock جدید به‌صورت خودکار ایجاد می‌شود." -msgid "The preferred way to use a Condition is an :keyword:`async with` statement::" +msgid "" +"The preferred way to use a Condition is an :keyword:`async with` statement::" msgstr "" +"روش ترجیح‌داده‌شده برای استفاده از Condition، دستور :keyword:`async with` " +"است::" msgid "" "cond = asyncio.Condition()\n" @@ -204,6 +314,11 @@ msgid "" "async with cond:\n" " await cond.wait()" msgstr "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"async with cond:\n" +" await cond.wait()" msgid "" "cond = asyncio.Condition()\n" @@ -215,66 +330,133 @@ msgid "" "finally:\n" " cond.release()" msgstr "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"await cond.acquire()\n" +"try:\n" +" await cond.wait()\n" +"finally:\n" +" cond.release()" msgid "Acquire the underlying lock." -msgstr "" +msgstr "قفل زیربنایی را تصاحب کنید." -msgid "This method waits until the underlying lock is *unlocked*, sets it to *locked* and returns ``True``." +msgid "" +"This method waits until the underlying lock is *unlocked*, sets it to " +"*locked* and returns ``True``." msgstr "" +"این متد تا زمانی که قفل زیربنایی *آزاد* شود صبر می‌کند، آن را در حالت " +"*قفل‌شده* قرار می‌دهد و ``True`` را برمی‌گرداند." -msgid "Wake up *n* tasks (1 by default) waiting on this condition. If fewer than *n* tasks are waiting they are all awakened." +msgid "" +"Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " +"*n* tasks are waiting they are all awakened." msgstr "" +"بیدار کردن *n* وظیفه در انتظار این شرط (به‌طور پیش‌فرض ۱). اگر کمتر " +"از *n* وظیفه در انتظار باشند، همه‌ی آن‌ها بیدار می‌شوند." -msgid "The lock must be acquired before this method is called and released shortly after. If called with an *unlocked* lock a :exc:`RuntimeError` error is raised." +msgid "" +"The lock must be acquired before this method is called and released shortly " +"after. If called with an *unlocked* lock a :exc:`RuntimeError` error is " +"raised." msgstr "" +"قفل باید پیش از فراخوانی این متد کسب شود و اندکی پس از آن آزاد شود. اگر با " +"یک قفل *باز* فراخوانی شود، خطای :exc:`RuntimeError` پرتاب می‌شود." msgid "Return ``True`` if the underlying lock is acquired." -msgstr "" +msgstr "اگر قفل زیربنایی کسب شده باشد، ``True`` برمی‌گرداند." msgid "Wake up all tasks waiting on this condition." -msgstr "" +msgstr "تمام وظایف (tasks) در انتظار این شرط را بیدار کنید." msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks." msgstr "" +"این متد مانند :meth:`notify` عمل می‌کند، اما تمام وظایف در انتظار را بیدار " +"می‌کند." msgid "Release the underlying lock." -msgstr "" +msgstr "قفل زیربنایی را آزاد کنید." msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" +"هنگامی که روی یک قفل باز فراخوانی شود، یک :exc:`RuntimeError` پرتاب می‌شود." msgid "Wait until notified." -msgstr "" +msgstr "تا زمانی که به شما اطلاع داده شود، صبر کنید." -msgid "If the calling task has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised." +msgid "" +"If the calling task has not acquired the lock when this method is called, a " +":exc:`RuntimeError` is raised." msgstr "" +"اگر در زمان فراخوانی این متد، وظیفهفراخوانی‌کننده قفل را به دست " +"نیاورده باشد، یک :exc:`RuntimeError` پرتاب می‌شود." -msgid "This method releases the underlying lock, and then blocks until it is awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the Condition re-acquires its lock and this method returns ``True``." +msgid "" +"This method releases the underlying lock, and then blocks until it is " +"awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the " +"Condition re-acquires its lock and this method returns ``True``." msgstr "" +"این متد قفل زیربنایی را آزاد می‌کند و سپس تا زمانی که با فراخوانی " +":meth:`notify` یا :meth:`notify_all` بیدار شود، مسدود می‌شود. پس از بیدار " +"شدن، Condition قفل خود را دوباره به دست می‌آورد و این متد ``True`` را " +"برمی‌گرداند." -msgid "Note that a task *may* return from this call spuriously, which is why the caller should always re-check the state and be prepared to :meth:`~Condition.wait` again. For this reason, you may prefer to use :meth:`~Condition.wait_for` instead." +msgid "" +"Note that a task *may* return from this call spuriously, which is why the " +"caller should always re-check the state and be prepared to " +":meth:`~Condition.wait` again. For this reason, you may prefer to use " +":meth:`~Condition.wait_for` instead." msgstr "" +"توجه داشته باشید که یک وظیفه *ممکن است* به‌صورت کاذب از این فراخوانی " +"بازگردد، به همین دلیل فراخواننده باید همیشه وضعیت را دوباره بررسی کند و برای" +" فراخوانی دوباره‌ی :meth:`~Condition.wait` آماده باشد. به همین دلیل، ممکن " +"است ترجیح دهید به‌جای آن از :meth:`~Condition.wait_for` استفاده کنید." msgid "Wait until a predicate becomes *true*." -msgstr "" +msgstr "صبر کنید تا یک محمول (predicate) به مقدار *درست* برسد." -msgid "The predicate must be a callable which result will be interpreted as a boolean value. The method will repeatedly :meth:`~Condition.wait` until the predicate evaluates to *true*. The final value is the return value." +msgid "" +"The predicate must be a callable which result will be interpreted as a " +"boolean value. The method will repeatedly :meth:`~Condition.wait` until the" +" predicate evaluates to *true*. The final value is the return value." msgstr "" +"محمول باید یک شیء قابل فراخوانی باشد که نتیجه‌ی آن به‌عنوان یک مقدار بولی " +"تفسیر می‌شود. این متد به‌طور مکرر :meth:`~Condition.wait` را فراخوانی " +"می‌کند، تا زمانی که محمول به‌مقدار *true* ارزیابی شود. مقدار نهایی همان مقدار " +"بازگشتی است." msgid "Semaphore" -msgstr "" +msgstr "سمافور" msgid "A Semaphore object. Not thread-safe." -msgstr "" +msgstr "یک شیء Semaphore. ایمن در برابر نخ‌ها نیست." -msgid "A semaphore manages an internal counter which is decremented by each :meth:`acquire` call and incremented by each :meth:`release` call. The counter can never go below zero; when :meth:`acquire` finds that it is zero, it blocks, waiting until some task calls :meth:`release`." +msgid "" +"A semaphore manages an internal counter which is decremented by each " +":meth:`acquire` call and incremented by each :meth:`release` call. The " +"counter can never go below zero; when :meth:`acquire` finds that it is zero," +" it blocks, waiting until some task calls :meth:`release`." msgstr "" +"سمافور یک شمارنده‌ی داخلی را مدیریت می‌کند که با هر فراخوانی :meth:`acquire`" +" کاهش می‌یابد و با هر فراخوانی :meth:`release` افزایش می‌یابد. شمارنده هرگز " +"نمی‌تواند زیر صفر برود؛ هنگامی که :meth:`acquire` ببیند که شمارنده صفر است، " +"مسدود می‌شود و منتظر می‌ماند تا وظیفهی :meth:`release` را فراخوانی کند." -msgid "The optional *value* argument gives the initial value for the internal counter (``1`` by default). If the given value is less than ``0`` a :exc:`ValueError` is raised." +msgid "" +"The optional *value* argument gives the initial value for the internal " +"counter (``1`` by default). If the given value is less than ``0`` a " +":exc:`ValueError` is raised." msgstr "" +"آرگومان اختیاری *value* مقدار اولیه شمارنده داخلی را مشخص می‌کند (به‌طور " +"پیش‌فرض ``1``). اگر مقدار داده‌شده کمتر از ``0`` باشد، یک :exc:`ValueError` " +"پرتاب می‌شود." -msgid "The preferred way to use a Semaphore is an :keyword:`async with` statement::" +msgid "" +"The preferred way to use a Semaphore is an :keyword:`async with` statement::" msgstr "" +"روش ترجیحی برای استفاده از Semaphore، استفاده از یک دستور :keyword:`async " +"with` است::" msgid "" "sem = asyncio.Semaphore(10)\n" @@ -283,6 +465,11 @@ msgid "" "async with sem:\n" " # work with shared resource" msgstr "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... later\n" +"async with sem:\n" +" # work with shared resource" msgid "" "sem = asyncio.Semaphore(10)\n" @@ -294,45 +481,88 @@ msgid "" "finally:\n" " sem.release()" msgstr "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... بعداً\n" +"await sem.acquire()\n" +"try:\n" +" # کار با منبع مشترک\n" +"finally:\n" +" sem.release()" msgid "Acquire a semaphore." -msgstr "" +msgstr "یک سمافور (semaphore) را تصاحب کنید." -msgid "If the internal counter is greater than zero, decrement it by one and return ``True`` immediately. If it is zero, wait until a :meth:`release` is called and return ``True``." +msgid "" +"If the internal counter is greater than zero, decrement it by one and return" +" ``True`` immediately. If it is zero, wait until a :meth:`release` is " +"called and return ``True``." msgstr "" +"اگر شمارنده‌ی داخلی بزرگ‌تر از صفر باشد، آن را یک واحد کاهش دهید و بلافاصله " +"``True`` را برگردانید. اگر صفر باشد، منتظر بمانید تا :meth:`release` " +"فراخوانی شود و ``True`` را برگردانید." msgid "Returns ``True`` if semaphore can not be acquired immediately." -msgstr "" +msgstr "اگر سمافور نتواند بلافاصله کسب شود، ``True`` را برمی‌گرداند." -msgid "Release a semaphore, incrementing the internal counter by one. Can wake up a task waiting to acquire the semaphore." +msgid "" +"Release a semaphore, incrementing the internal counter by one. Can wake up a" +" task waiting to acquire the semaphore." msgstr "" +"یک سمافور (semaphore) را آزاد می‌کند و شمارنده‌ی داخلی را ۱ واحد افزایش " +"می‌دهد. می‌تواند وظیفه‌ای را که در انتظار به‌دست آوردن سمافور است بیدار کند." -msgid "Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more ``release()`` calls than ``acquire()`` calls." +msgid "" +"Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more " +"``release()`` calls than ``acquire()`` calls." msgstr "" +"برخلاف :class:`BoundedSemaphore`، :class:`Semaphore` اجازه می‌دهد " +"فراخوانی‌های ``release()`` بیشتری نسبت به فراخوانی‌های ``acquire()`` انجام " +"شود." msgid "BoundedSemaphore" -msgstr "" +msgstr "BoundedSemaphore" msgid "A bounded semaphore object. Not thread-safe." -msgstr "" +msgstr "یک شیء سمافور کران‌دار. ایمن در برابر نخ نیست." -msgid "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:`ValueError` in :meth:`~Semaphore.release` if it increases the internal counter above the initial *value*." +msgid "" +"Bounded Semaphore is a version of :class:`Semaphore` that raises a " +":exc:`ValueError` in :meth:`~Semaphore.release` if it increases the internal" +" counter above the initial *value*." msgstr "" +"سمافور محدود (Bounded Semaphore) نسخه‌ای از :class:`Semaphore` است که در " +":meth:`~Semaphore.release`، اگر شمارنده داخلی را به بالاتر از *value* اولیه " +"افزایش دهد، :exc:`ValueError` پرتاب می‌کند." msgid "Barrier" -msgstr "" +msgstr "سد" msgid "A barrier object. Not thread-safe." -msgstr "" +msgstr "یک شیء سد (barrier). ایمن در برابر نخ نیست." -msgid "A barrier is a simple synchronization primitive that allows to block until *parties* number of tasks are waiting on it. Tasks can wait on the :meth:`~Barrier.wait` method and would be blocked until the specified number of tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the waiting tasks would unblock simultaneously." -msgstr "" +msgid "" +"A barrier is a simple synchronization primitive that allows to block until " +"*parties* number of tasks are waiting on it. Tasks can wait on the " +":meth:`~Barrier.wait` method and would be blocked until the specified number" +" of tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the " +"waiting tasks would unblock simultaneously." +msgstr "" +"یک سد، یک ساختار اولیه همگام‌سازی ساده است که امکان مسدود شدن تا زمانی که " +"تعداد *parties* وظیفه منتظر آن باشند را فراهم می‌کند. وظایف می‌توانند با متد " +":meth:`~Barrier.wait` منتظر بمانند و تا زمانی که تعداد مشخص‌شده‌ای از وظایف" +" در نهایت با متد :meth:`~Barrier.wait` منتظر شوند، مسدود می‌مانند. در آن " +"نقطه، همه وظایف منتظر به‌طور همزمان از حالت مسدود خارج می‌شوند." -msgid ":keyword:`async with` can be used as an alternative to awaiting on :meth:`~Barrier.wait`." +msgid "" +":keyword:`async with` can be used as an alternative to awaiting on " +":meth:`~Barrier.wait`." msgstr "" +":keyword:`async with` می‌تواند به‌عنوان جایگزینی برای await روی " +":meth:`~Barrier.wait` استفاده شود." msgid "The barrier can be reused any number of times." -msgstr "" +msgstr "این سد را می‌توان هر تعداد باری دوباره استفاده کرد." msgid "" "async def example_barrier():\n" @@ -356,9 +586,29 @@ msgid "" "\n" "asyncio.run(example_barrier())" msgstr "" +"async def example_barrier():\n" +" # barrier with 3 parties\n" +" b = asyncio.Barrier(3)\n" +"\n" +" # create 2 new waiting tasks\n" +" asyncio.create_task(b.wait())\n" +" asyncio.create_task(b.wait())\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +" # The third .wait() call passes the barrier\n" +" await b.wait()\n" +" print(b)\n" +" print(\"barrier passed\")\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +"asyncio.run(example_barrier())" msgid "Result of this example is::" -msgstr "" +msgstr "نتیجه‌ی این مثال::" msgid "" "\n" @@ -366,15 +616,35 @@ msgid "" "barrier passed\n" "" msgstr "" +"\n" +"\n" +"از سد (barrier) عبور شد\n" +"" -msgid "Pass the barrier. When all the tasks party to the barrier have called this function, they are all unblocked simultaneously." +msgid "" +"Pass the barrier. When all the tasks party to the barrier have called this " +"function, they are all unblocked simultaneously." msgstr "" +"از سد عبور کنید. هنگامی که همه وظایف شرکت‌کننده در سد این تابع را " +"فراخوانی کرده باشند، همه آن‌ها به‌طور همزمان رفع انسداد می‌شوند." -msgid "When a waiting or blocked task in the barrier is cancelled, this task exits the barrier which stays in the same state. If the state of the barrier is \"filling\", the number of waiting task decreases by 1." +msgid "" +"When a waiting or blocked task in the barrier is cancelled, this task exits " +"the barrier which stays in the same state. If the state of the barrier is " +"\"filling\", the number of waiting task decreases by 1." msgstr "" +"هنگامی که یک وظیفه‌ی در انتظار یا مسدودشده در سد لغو شود، این وظیفه از " +"سد خارج می‌شود و سد در همان وضعیت باقی می‌ماند. اگر وضعیت سد «در حال " +"پر شدن» باشد، تعداد وظایف در انتظار به میزان ۱ کاهش می‌یابد." -msgid "The return value is an integer in the range of 0 to ``parties-1``, different for each task. This can be used to select a task to do some special housekeeping, e.g.::" +msgid "" +"The return value is an integer in the range of 0 to ``parties-1``, different" +" for each task. This can be used to select a task to do some special " +"housekeeping, e.g.::" msgstr "" +"مقدار بازگشتی یک عدد صحیح در بازه‌ی ۰ تا ``parties-1`` است و برای هر وظیفه " +"متفاوت است. می‌توان از این مقدار برای انتخاب یک وظیفه جهت انجام برخی عملیات " +"نگهداری خاص استفاده کرد، برای مثال::" msgid "" "...\n" @@ -383,30 +653,67 @@ msgid "" " # Only one task prints this\n" " print('End of *draining phase*')" msgstr "" +"...\n" +"async with barrier as position:\n" +" if position == 0:\n" +" # Only one task prints this\n" +" print('End of *draining phase*')" -msgid "This method may raise a :class:`BrokenBarrierError` exception if the barrier is broken or reset while a task is waiting. It could raise a :exc:`CancelledError` if a task is cancelled." +msgid "" +"This method may raise a :class:`BrokenBarrierError` exception if the barrier" +" is broken or reset while a task is waiting. It could raise a " +":exc:`CancelledError` if a task is cancelled." msgstr "" +"این متد ممکن است در صورتی که سد در حین انتظار یک وظیفهشکسته شود یا" +" بازنشانی شود، استثنای :class:`BrokenBarrierError` را پرتاب کند. ممکن است " +"در صورت لغو شدن یک وظیفه، استثنای :exc:`CancelledError` را پرتاب کند." -msgid "Return the barrier to the default, empty state. Any tasks waiting on it will receive the :class:`BrokenBarrierError` exception." +msgid "" +"Return the barrier to the default, empty state. Any tasks waiting on it " +"will receive the :class:`BrokenBarrierError` exception." msgstr "" +"سد را به حالت پیش‌فرض و خالی بازمی‌گرداند. هر وظیفهی که در انتظار آن باشد، " +"استثنای :class:`BrokenBarrierError` را دریافت خواهد کرد." -msgid "If a barrier is broken it may be better to just leave it and create a new one." +msgid "" +"If a barrier is broken it may be better to just leave it and create a new " +"one." msgstr "" +"اگر یک سد (barrier) شکسته شود، ممکن است بهتر باشد آن را به حال خود رها کنید " +"و یک سد جدید ایجاد کنید." -msgid "Put the barrier into a broken state. This causes any active or future calls to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use this for example if one of the tasks needs to abort, to avoid infinite waiting tasks." +msgid "" +"Put the barrier into a broken state. This causes any active or future calls" +" to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " +"this for example if one of the tasks needs to abort, to avoid infinite " +"waiting tasks." msgstr "" +"سد (Barrier) را در وضعیت شکسته قرار دهید. این کار باعث می‌شود هر فراخوانی " +"فعال یا آینده به :meth:`~Barrier.wait` با :class:`BrokenBarrierError` ناموفق" +" شود. برای مثال، اگر یکی از وظایف نیاز به لغو شدن داشته باشد، از این استفاده" +" کنید تا از تسک‌هایی که به‌طور بی‌پایان در انتظار می‌مانند جلوگیری شود." msgid "The number of tasks required to pass the barrier." -msgstr "" +msgstr "تعداد وظایف لازم برای عبور از سد." msgid "The number of tasks currently waiting in the barrier while filling." -msgstr "" +msgstr "تعداد تسک‌هایی که در حال حاضر در حین پر شدن سد (barrier) منتظر هستند." msgid "A boolean that is ``True`` if the barrier is in the broken state." -msgstr "" +msgstr "یک بولی که اگر سد در وضعیت شکسته باشد، ``True`` است." -msgid "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:`Barrier` object is reset or broken." +msgid "" +"This exception, a subclass of :exc:`RuntimeError`, is raised when the " +":class:`Barrier` object is reset or broken." msgstr "" +"این استثنا، که زیرکلاسی از :exc:`RuntimeError` است، زمانی پرتاب می‌شود که " +"شیء :class:`Barrier` بازنشانی یا شکسته شود." -msgid "Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:`with` statement (``with await lock``, ``with (yield from lock)``) was removed. Use ``async with lock`` instead." +msgid "" +"Acquiring a lock using ``await lock`` or ``yield from lock`` and/or " +":keyword:`with` statement (``with await lock``, ``with (yield from lock)``) " +"was removed. Use ``async with lock`` instead." msgstr "" +"کسب قفل با استفاده از ``await lock`` یا ``yield from lock`` و/یا دستور " +":keyword:`with` (``with await lock``، ``with (yield from lock)``) حذف شده " +"است. به جای آن از ``async with lock`` استفاده کنید." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index a495ee557..30d695b6c 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"PO-Revision-Date: 2026-08-28 10:11+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,21 +22,31 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Coroutines and tasks" -msgstr "" +msgstr "هم‌روال‌ها و وظایف (tasks)" -msgid "This section outlines high-level asyncio APIs to work with coroutines and Tasks." +msgid "" +"This section outlines high-level asyncio APIs to work with coroutines and Tasks." msgstr "" +"این بخش، مروری بر APIهای سطح بالای asyncio برای کار با هم‌روال‌ها و وظیفه‌ها " +"(Tasks) ارائه می‌دهد." msgid "Coroutines" -msgstr "" +msgstr "هم‌روال‌ها" msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/coroutines.py`" -msgid ":term:`Coroutines ` declared with the async/await syntax is the preferred way of writing asyncio applications. For example, the following snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" +msgid "" +":term:`Coroutines ` declared with the async/await syntax is the " +"preferred way of writing asyncio applications. For example, the following " +"snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" msgstr "" +"تعریف :term:`هم‌روال‌ها ` با سینتکس async/await، روش ترجیحی برای نوشتن " +"برنامه‌های asyncio است. برای مثال، قطعه‌کد زیر \"hello\" را چاپ می‌کند، ۱ ثانیه " +"منتظر می‌ماند، و سپس \"world\" را چاپ می‌کند::" msgid "" ">>> import asyncio\n" @@ -50,23 +60,45 @@ msgid "" "hello\n" "world" msgstr "" +">>> import asyncio\n" +"\n" +">>> async def main():\n" +"... print('hello')\n" +"... await asyncio.sleep(1)\n" +"... print('world')\n" +"\n" +">>> asyncio.run(main())\n" +"hello\n" +"world" msgid "Note that simply calling a coroutine will not schedule it to be executed::" msgstr "" +"توجه داشته باشید که صرفاً فراخوانی یک هم‌روال، آن را برای اجرا زمان‌بندی نمی‌کند::" msgid "" ">>> main()\n" "" msgstr "" +">>> main()\n" +"" msgid "To actually run a coroutine, asyncio provides the following mechanisms:" -msgstr "" +msgstr "برای اجرای واقعی یک هم‌روال، asyncio سازوکارهای زیر را فراهم می‌کند:" -msgid "The :func:`asyncio.run` function to run the top-level entry point \"main()\" function (see the above example.)" +msgid "" +"The :func:`asyncio.run` function to run the top-level entry point \"main()\" " +"function (see the above example.)" msgstr "" +"تابع :func:`asyncio.run` برای اجرای تابع نقطه ورود سطح بالا \"main()\" (مثال " +"بالا را ببینید.)" -msgid "Awaiting on a coroutine. The following snippet of code will print \"hello\" after waiting for 1 second, and then print \"world\" after waiting for *another* 2 seconds::" +msgid "" +"Awaiting on a coroutine. The following snippet of code will print \"hello\" " +"after waiting for 1 second, and then print \"world\" after waiting for *another* " +"2 seconds::" msgstr "" +"در انتظار یک هم‌روال. قطعه‌کد زیر پس از انتظار برای ۱ ثانیه، «hello» را چاپ می‌کند " +"و سپس «world» را پس از انتظار برای ۲ ثانیه‌ی *دیگر* چاپ خواهد کرد::" msgid "" "import asyncio\n" @@ -86,9 +118,25 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import time\n" +"\n" +"async def say_after(delay, what):\n" +" await asyncio.sleep(delay)\n" +" print(what)\n" +"\n" +"async def main():\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" await say_after(1, 'hello')\n" +" await say_after(2, 'world')\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")\n" +"\n" +"asyncio.run(main())" msgid "Expected output::" -msgstr "" +msgstr "خروجی مورد انتظار::" msgid "" "started at 17:13:52\n" @@ -96,12 +144,23 @@ msgid "" "world\n" "finished at 17:13:55" msgstr "" +"شروع در ۱۷:۱۳:۵۲\n" +"سلام\n" +"دنیا\n" +"پایان در ۱۷:۱۳:۵۵" -msgid "The :func:`asyncio.create_task` function to run coroutines concurrently as asyncio :class:`Tasks `." +msgid "" +"The :func:`asyncio.create_task` function to run coroutines concurrently as " +"asyncio :class:`Tasks `." msgstr "" +"تابع :func:`asyncio.create_task` برای اجرای همزمان هم‌روال‌ها " +"به‌عنوان :class:`Tasks ` در asyncio." -msgid "Let's modify the above example and run two ``say_after`` coroutines *concurrently*::" +msgid "" +"Let's modify the above example and run two ``say_after`` coroutines " +"*concurrently*::" msgstr "" +"بیایید مثال بالا را تغییر دهیم و دو هم‌روال ``say_after`` را *همزمان* اجرا کنیم::" msgid "" "async def main():\n" @@ -120,9 +179,28 @@ msgid "" "\n" " print(f\"finished at {time.strftime('%X')}\")" msgstr "" +"async def main():\n" +" task1 = asyncio.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = asyncio.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # صبر کنید تا هر دو وظیفهکامل شوند (باید حدود\n" +" # ۲ ثانیه طول بکشد.)\n" +" await task1\n" +" await task2\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" -msgid "Note that expected output now shows that the snippet runs 1 second faster than before::" +msgid "" +"Note that expected output now shows that the snippet runs 1 second faster than " +"before::" msgstr "" +"توجه داشته باشید که خروجی مورد انتظار اکنون نشان می‌دهد که قطعه‌کد ۱ ثانیه سریع‌تر " +"از قبل اجرا می‌شود::" msgid "" "started at 17:14:32\n" @@ -130,9 +208,17 @@ msgid "" "world\n" "finished at 17:14:34" msgstr "" +"آغاز در ۱۷:۱۴:۳۲\n" +"سلام\n" +"دنیا\n" +"پایان در ۱۷:۱۴:۳۴" -msgid "The :class:`asyncio.TaskGroup` class provides a more modern alternative to :func:`create_task`. Using this API, the last example becomes::" +msgid "" +"The :class:`asyncio.TaskGroup` class provides a more modern alternative " +"to :func:`create_task`. Using this API, the last example becomes::" msgstr "" +"کلاس :class:`asyncio.TaskGroup` جایگزین مدرن‌تری برای :func:`create_task` فراهم " +"می‌کند. با استفاده از این API، آخرین مثال به‌شکل زیر درمی‌آید::" msgid "" "async def main():\n" @@ -149,24 +235,51 @@ msgid "" "\n" " print(f\"finished at {time.strftime('%X')}\")" msgstr "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = tg.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # await هنگام خروج از مدیر زمینه به‌صورت ضمنی انجام می‌شود.\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" msgid "The timing and output should be the same as for the previous version." -msgstr "" +msgstr "زمان‌بندی و خروجی باید مانند نسخه‌ی پیشین یکسان باشند." msgid ":class:`asyncio.TaskGroup`." -msgstr "" +msgstr ":class:`asyncio.TaskGroup`." msgid "Awaitables" -msgstr "" +msgstr "Awaitableها" -msgid "We say that an object is an **awaitable** object if it can be used in an :keyword:`await` expression. Many asyncio APIs are designed to accept awaitables." +msgid "" +"We say that an object is an **awaitable** object if it can be used in " +"an :keyword:`await` expression. Many asyncio APIs are designed to accept " +"awaitables." msgstr "" +"می‌گوییم که یک شیء در صورتی یک شیء **awaitable** است که بتوان از آن در یک " +"عبارت :keyword:`await` استفاده کرد. بسیاری از APIهای asyncio برای پذیرش " +"awaitableها طراحی شده‌اند." -msgid "There are three main types of *awaitable* objects: **coroutines**, **Tasks**, and **Futures**." +msgid "" +"There are three main types of *awaitable* objects: **coroutines**, **Tasks**, " +"and **Futures**." msgstr "" +"سه نوع اصلی از اشیای *awaitable* وجود دارد: **هم‌روال‌ها**، **Taskها** و " +"**Futureها**." -msgid "Python coroutines are *awaitables* and therefore can be awaited from other coroutines::" +msgid "" +"Python coroutines are *awaitables* and therefore can be awaited from other " +"coroutines::" msgstr "" +"هم‌روال‌های پایتون *awaitables* هستند و بنابراین می‌توان آن‌ها را از هم‌روال‌های دیگر " +"await کرد::" msgid "" "import asyncio\n" @@ -185,24 +298,47 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # اگر فقط \"nested()\" را فراخوانی کنیم، هیچ اتفاقی رخ نمی‌دهد.\n" +" # یک شیء هم‌روال ایجاد می‌شود، اما await نمی‌شود،\n" +" # بنابراین *اصلاً اجرا نخواهد شد*.\n" +" nested() # یک \"RuntimeWarning\" پرتاب خواهد شد.\n" +"\n" +" # حال بیایید این کار را به‌شکلی دیگر انجام دهیم و آن را await کنیم:\n" +" print(await nested()) # \"42\" را چاپ خواهد کرد.\n" +"\n" +"asyncio.run(main())" -msgid "In this documentation the term \"coroutine\" can be used for two closely related concepts:" +msgid "" +"In this documentation the term \"coroutine\" can be used for two closely related " +"concepts:" msgstr "" +"در این مستندات، اصطلاح «هم‌روال» می‌تواند برای دو مفهوم بسیار مرتبط به‌کار رود:" msgid "a *coroutine function*: an :keyword:`async def` function;" -msgstr "" +msgstr "یک *تابع هم‌روال*: یک تابع :keyword:`async def`؛" msgid "a *coroutine object*: an object returned by calling a *coroutine function*." -msgstr "" +msgstr "یک *شیء هم‌روال*: شیءای که با فراخوانی یک *تابع هم‌روال* برگردانده می‌شود." msgid "Tasks" -msgstr "" +msgstr "وظایف" msgid "*Tasks* are used to schedule coroutines *concurrently*." -msgstr "" +msgstr "*وظایف* برای زمان‌بندی هم‌روال‌ها به‌صورت همزمان استفاده می‌شوند." -msgid "When a coroutine is wrapped into a *Task* with functions like :func:`asyncio.create_task` the coroutine is automatically scheduled to run soon::" +msgid "" +"When a coroutine is wrapped into a *Task* with functions " +"like :func:`asyncio.create_task` the coroutine is automatically scheduled to run " +"soon::" msgstr "" +"هنگامی که یک هم‌روال با توابعی مانند :func:`asyncio.create_task` در یک *Task* " +"قرار می‌گیرد، آن هم‌روال به‌طور خودکار زمان‌بندی می‌شود تا به‌زودی اجرا شود::" msgid "" "import asyncio\n" @@ -221,24 +357,57 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # Schedule nested() to run soon concurrently\n" +" # with \"main()\".\n" +" task = asyncio.create_task(nested())\n" +"\n" +" # \"task\" can now be used to cancel \"nested()\", or\n" +" # can simply be awaited to wait until it is complete:\n" +" await task\n" +"\n" +"asyncio.run(main())" msgid "Futures" -msgstr "" +msgstr "آینده‌نماها (Futures)" -msgid "A :class:`Future` is a special **low-level** awaitable object that represents an **eventual result** of an asynchronous operation." +msgid "" +"A :class:`Future` is a special **low-level** awaitable object that represents an " +"**eventual result** of an asynchronous operation." msgstr "" +":class:`Future` یک شیء خاص **سطح پایین** قابل await (awaitable) است که نشان‌دهنده‌ی " +"**نتیجه نهایی** یک عملیات ناهمگام است." -msgid "When a Future object is *awaited* it means that the coroutine will wait until the Future is resolved in some other place." +msgid "" +"When a Future object is *awaited* it means that the coroutine will wait until " +"the Future is resolved in some other place." msgstr "" +"هنگامی که یک شیء Future *await* می‌شود، به این معنا است که هم‌روال منتظر می‌ماند تا " +"Future در جای دیگری حل شود." -msgid "Future objects in asyncio are needed to allow callback-based code to be used with async/await." +msgid "" +"Future objects in asyncio are needed to allow callback-based code to be used " +"with async/await." msgstr "" +"اشیای Future در asyncio لازم هستند تا بتوان از کد مبتنی بر کال‌بک با async/await " +"استفاده کرد." -msgid "Normally **there is no need** to create Future objects at the application level code." -msgstr "" +msgid "" +"Normally **there is no need** to create Future objects at the application level " +"code." +msgstr "معمولاً **نیازی نیست** که اشیای Future را در کد سطح برنامه ایجاد کنید." -msgid "Future objects, sometimes exposed by libraries and some asyncio APIs, can be awaited::" +msgid "" +"Future objects, sometimes exposed by libraries and some asyncio APIs, can be " +"awaited::" msgstr "" +"اشیای Future را، که گاهی از طریق کتابخانه‌ها و برخی APIهای asyncio در دسترس قرار " +"می‌گیرند، می‌توان await کرد::" msgid "" "async def main():\n" @@ -250,36 +419,92 @@ msgid "" " some_python_coroutine()\n" " )" msgstr "" +"async def main():\n" +" await function_that_returns_a_future_object()\n" +"\n" +" # this is also valid:\n" +" await asyncio.gather(\n" +" function_that_returns_a_future_object(),\n" +" some_python_coroutine()\n" +" )" -msgid "A good example of a low-level function that returns a Future object is :meth:`loop.run_in_executor`." +msgid "" +"A good example of a low-level function that returns a Future object " +"is :meth:`loop.run_in_executor`." msgstr "" +"یک نمونه خوب از یک تابع سطح پایین که یک شیء Future را " +"بازمی‌گرداند، :meth:`loop.run_in_executor` است." msgid "Creating tasks" -msgstr "" +msgstr "ایجاد وظایف" msgid "**Source code:** :source:`Lib/asyncio/tasks.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/tasks.py`" -msgid "Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and schedule its execution. Return the Task object." +msgid "" +"Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and schedule " +"its execution. Return the Task object." msgstr "" +":ref:`هم‌روال ` *coro* را در یک :class:`Task` قرار می‌دهد و اجرای آن را " +"زمان‌بندی می‌کند. شیء Task را برمی‌گرداند." -msgid "The full function signature is largely the same as that of the :class:`Task` constructor (or factory) - all of the keyword arguments to this function are passed through to that interface." +msgid "" +"The full function signature is largely the same as that of the :class:`Task` " +"constructor (or factory) - all of the keyword arguments to this function are " +"passed through to that interface." msgstr "" +"امضای کامل تابع تا حد زیادی مشابه سازنده‌ی :class:`Task` (یا کارخانه) است؛ تمام " +"آرگومان‌های کلیدواژه‌ای این تابع به آن رابط منتقل می‌شوند." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *coro* to run in. The current context copy is created when no *context* is provided." +msgid "" +"An optional keyword-only *context* argument allows specifying a " +"custom :class:`contextvars.Context` for the *coro* to run in. The current " +"context copy is created when no *context* is provided." msgstr "" +"یک آرگومان اختیاری فقط کلیدواژه‌ای *context* به شما امکان می‌دهد " +"یک :class:`contextvars.Context` سفارشی برای اجرای *coro* مشخص کنید. اگر " +"*context* ارائه نشود، یک کپی از زمینه فعلی ایجاد می‌شود." -msgid "An optional keyword-only *eager_start* argument allows specifying if the task should execute eagerly during the call to create_task, or be scheduled later. If *eager_start* is not passed the mode set by :meth:`loop.set_task_factory` will be used." +msgid "" +"An optional keyword-only *eager_start* argument allows specifying if the task " +"should execute eagerly during the call to create_task, or be scheduled later. If " +"*eager_start* is not passed the mode set by :meth:`loop.set_task_factory` will " +"be used." msgstr "" +"یک آرگومان اختیاری فقط کلیدواژه‌ای *eager_start* به شما امکان می‌دهد مشخص کنید که " +"آیا وظیفهباید در حین فراخوانی create_task به‌صورت فوری اجرا شود یا بعداً " +"زمان‌بندی شود. اگر *eager_start* ارسال نشود، حالت تنظیم‌شده " +"توسط :meth:`loop.set_task_factory` استفاده خواهد شد." -msgid "The task is executed in the loop returned by :func:`get_running_loop`, :exc:`RuntimeError` is raised if there is no running loop in current thread." +msgid "" +"The task is executed in the loop returned " +"by :func:`get_running_loop`, :exc:`RuntimeError` is raised if there is no " +"running loop in current thread." msgstr "" +"این وظیفه در حلقه‌ای که :func:`get_running_loop` برمی‌گرداند اجرا می‌شود؛ اگر حلقه‌ی " +"در حال اجرا در نخ جاری وجود نداشته باشد، :exc:`RuntimeError` پرتاب می‌شود." -msgid ":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging structural concurrency; it allows for waiting for a group of related tasks with strong safety guarantees." +msgid "" +":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging structural " +"concurrency; it allows for waiting for a group of related tasks with strong " +"safety guarantees." msgstr "" +":meth:`asyncio.TaskGroup.create_task` جایگزینی جدید است که از همروندی ساختاری " +"بهره می‌گیرد؛ این امکان را فراهم می‌کند که با تضمین‌های نیرومند ایمنی، منتظر گروهی " +"از وظایف مرتبط بمانید." -msgid "Save a reference to the result of this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn't referenced elsewhere may get garbage collected at any time, even before it's done. For reliable \"fire-and-forget\" background tasks, gather them in a collection::" -msgstr "" +msgid "" +"Save a reference to the result of this function, to avoid a task disappearing " +"mid-execution. The event loop only keeps weak references to tasks. A task that " +"isn't referenced elsewhere may get garbage collected at any time, even before " +"it's done. For reliable \"fire-and-forget\" background tasks, gather them in a " +"collection::" +msgstr "" +"برای جلوگیری از ناپدید شدن یک وظیفه در میانه‌ی اجرا، یک ارجاع به نتیجه‌ی این " +"تابع ذخیره کنید. حلقه‌ی رویداد تنها ارجاع‌های ضعیف به وظایف را نگه می‌دارد. وظیفه‌ای " +"که در جای دیگری به آن ارجاع داده نشده است، ممکن است در هر زمانی زباله‌روبی شود، " +"حتی پیش از آنکه به پایان برسد. برای وظایف پس‌زمینه‌ی قابل‌اطمینان از نوع «fire-and-" +"forget»، آن‌ها را در یک مجموعه گردآوری کنید::" msgid "" "background_tasks = set()\n" @@ -295,48 +520,108 @@ msgid "" " # completion:\n" " task.add_done_callback(background_tasks.discard)" msgstr "" +"background_tasks = set()\n" +"\n" +"for i in range(10):\n" +" task = asyncio.create_task(some_coro(param=i))\n" +"\n" +" # افزودن وظیفهبه مجموعه. این کار یک ارجاع قوی ایجاد می‌کند.\n" +" background_tasks.add(task)\n" +"\n" +" # برای جلوگیری از نگه‌داشتن ارجاع‌ها به وظایف تمام‌شده برای همیشه،\n" +" # کاری کنید که هر وظیفه پس از تکمیل، ارجاع خود را از مجموعه\n" +" # حذف کند:\n" +" task.add_done_callback(background_tasks.discard)" msgid "Added the *name* parameter." -msgstr "" +msgstr "پارامتر *name* افزوده شد." msgid "Added the *context* parameter." -msgstr "" +msgstr "پارامتر *context* افزوده شد." msgid "Added the *eager_start* parameter by passing on all *kwargs*." -msgstr "" +msgstr "پارامتر *eager_start* با ارسال تمام *kwargs* افزوده شد." msgid "Task cancellation" -msgstr "" +msgstr "لغو وظیفه" -msgid "Tasks can easily and safely be cancelled. When a task is cancelled, :exc:`asyncio.CancelledError` will be raised in the task at the next opportunity." +msgid "" +"Tasks can easily and safely be cancelled. When a task is " +"cancelled, :exc:`asyncio.CancelledError` will be raised in the task at the next " +"opportunity." msgstr "" +"وظایف را می‌توان به‌آسانی و به‌صورت امن لغو کرد. هنگامی که یک وظیفه لغو " +"می‌شود، :exc:`asyncio.CancelledError` در اولین فرصت در آن وظیفه پرتاب خواهد شد." -msgid "It is recommended that coroutines use ``try/finally`` blocks to robustly perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly caught, it should generally be propagated when clean-up is complete. :exc:`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most code will not need to be aware of it." -msgstr "" +msgid "" +"It is recommended that coroutines use ``try/finally`` blocks to robustly perform " +"clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly caught, it " +"should generally be propagated when clean-up is " +"complete. :exc:`asyncio.CancelledError` directly subclasses :exc:`BaseException` " +"so most code will not need to be aware of it." +msgstr "" +"توصیه می‌شود هم‌روال‌ها از بلوک‌های ``try/finally`` برای انجام منطق پاک‌سازی به‌صورت " +"مقاوم استفاده کنند. در صورتی که :exc:`asyncio.CancelledError` به‌طور صریح گرفته " +"شود، معمولاً باید پس از تکمیل پاک‌سازی انتشار یابد. :exc:`asyncio.CancelledError` " +"مستقیماً زیرکلاس :exc:`BaseException` است، بنابراین بیشتر کدها نیازی به آگاهی از " +"آن نخواهند داشت." -msgid "The asyncio components that enable structured concurrency, like :class:`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using cancellation internally and might misbehave if a coroutine swallows :exc:`asyncio.CancelledError`. Similarly, user code should not generally call :meth:`uncancel `. However, in cases when suppressing :exc:`asyncio.CancelledError` is truly desired, it is necessary to also call ``uncancel()`` to completely remove the cancellation state." -msgstr "" +msgid "" +"The asyncio components that enable structured concurrency, " +"like :class:`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented " +"using cancellation internally and might misbehave if a coroutine " +"swallows :exc:`asyncio.CancelledError`. Similarly, user code should not " +"generally call :meth:`uncancel `. However, in cases when " +"suppressing :exc:`asyncio.CancelledError` is truly desired, it is necessary to " +"also call ``uncancel()`` to completely remove the cancellation state." +msgstr "" +"کامپوننت‌های asyncio که هم‌روندی ساختاریافته را فراهم می‌کنند، " +"مانند :class:`asyncio.TaskGroup` و :func:`asyncio.timeout`، به‌صورت داخلی با " +"استفاده از لغو پیاده‌سازی شده‌اند و ممکن است در صورتی که یک " +"هم‌روال :exc:`asyncio.CancelledError` را نادیده بگیرد، رفتار نادرستی داشته باشند. " +"به‌طور مشابه، کد کاربر عموماً نباید :meth:`uncancel ` را " +"فراخوانی کند. با این حال، در مواردی که سرکوب :exc:`asyncio.CancelledError` واقعاً " +"مطلوب باشد، لازم است ``uncancel()`` نیز فراخوانی شود تا وضعیت لغو به‌طور کامل حذف " +"شود." msgid "Task groups" -msgstr "" +msgstr "گروه‌های وظیفه (Task groups)" -msgid "Task groups combine a task creation API with a convenient and reliable way to wait for all tasks in the group to finish." +msgid "" +"Task groups combine a task creation API with a convenient and reliable way to " +"wait for all tasks in the group to finish." msgstr "" +"گروه‌های وظیفه، یک API برای ایجاد وظیفه را با روشی راحت و مطمئن برای منتظر ماندن تا " +"پایان‌یافتن تمام وظایف گروه ترکیب می‌کنند." -msgid "An :ref:`asynchronous context manager ` holding a group of tasks. Tasks can be added to the group using :meth:`create_task`. All tasks are awaited when the context manager exits." +msgid "" +"An :ref:`asynchronous context manager ` holding a group " +"of tasks. Tasks can be added to the group using :meth:`create_task`. All tasks " +"are awaited when the context manager exits." msgstr "" +"یک :ref:`مدیر زمینه ناهمگام ` که گروهی از وظایف را نگه " +"می‌دارد. می‌توان وظایف را با استفاده از :meth:`create_task` به گروه اضافه کرد. " +"هنگام خروج مدیر زمینه، همه وظایف await می‌شوند." -msgid "Create a task in this task group. The signature matches that of :func:`asyncio.create_task`. If the task group is inactive (e.g. not yet entered, already finished, or in the process of shutting down), we will close the given ``coro``." +msgid "" +"Create a task in this task group. The signature matches that " +"of :func:`asyncio.create_task`. If the task group is inactive (e.g. not yet " +"entered, already finished, or in the process of shutting down), we will close " +"the given ``coro``." msgstr "" +"یک وظیفه در این گروه وظیفه (task group) ایجاد کنید. امضای آن " +"با :func:`asyncio.create_task` مطابقت دارد. اگر گروه وظیفه غیرفعال باشد (مثلاً " +"هنوز وارد نشده باشد، از پیش به پایان رسیده باشد، یا در حال خاموش شدن باشد)، " +"``coro`` داده‌شده را خواهیم بست." msgid "Close the given coroutine if the task group is not active." -msgstr "" +msgstr "اگر گروه وظیفه (task group) فعال نیست، هم‌روال داده‌شده را ببندید." msgid "Passes on all *kwargs* to :meth:`loop.create_task`" -msgstr "" +msgstr "تمام *kwargs* را به :meth:`loop.create_task` منتقل می‌کند" msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "async def main():\n" @@ -345,39 +630,139 @@ msgid "" " task2 = tg.create_task(another_coro(...))\n" " print(f\"Both tasks have completed now: {task1.result()}, {task2.result()}\")" msgstr "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(some_coro(...))\n" +" task2 = tg.create_task(another_coro(...))\n" +" print(f\"Both tasks have completed now: {task1.result()}, {task2.result()}\")" -msgid "The ``async with`` statement will wait for all tasks in the group to finish. While waiting, new tasks may still be added to the group (for example, by passing ``tg`` into one of the coroutines and calling ``tg.create_task()`` in that coroutine). Once the last task has finished and the ``async with`` block is exited, no new tasks may be added to the group." -msgstr "" +msgid "" +"The ``async with`` statement will wait for all tasks in the group to finish. " +"While waiting, new tasks may still be added to the group (for example, by " +"passing ``tg`` into one of the coroutines and calling ``tg.create_task()`` in " +"that coroutine). Once the last task has finished and the ``async with`` block is " +"exited, no new tasks may be added to the group." +msgstr "" +"دستور ``async with`` منتظر می‌ماند تا تمام وظایف گروه به پایان برسند. در حین " +"انتظار، همچنان ممکن است وظایف جدیدی به گروه اضافه شوند (برای مثال، با پاس دادن " +"``tg`` به یکی از هم‌روال‌ها و فراخوانی ``tg.create_task()`` در آن هم‌روال). پس از " +"پایان آخرین وظیفه و خروج از بلوک ``async with``، دیگر نمی‌توان وظیفه جدیدی به " +"گروه اضافه کرد." -msgid "The first time any of the tasks belonging to the group fails with an exception other than :exc:`asyncio.CancelledError`, the remaining tasks in the group are cancelled. No further tasks can then be added to the group. At this point, if the body of the ``async with`` statement is still active (i.e., :meth:`~object.__aexit__` hasn't been called yet), the task directly containing the ``async with`` statement is also cancelled. The resulting :exc:`asyncio.CancelledError` will interrupt an ``await``, but it will not bubble out of the containing ``async with`` statement." -msgstr "" +msgid "" +"The first time any of the tasks belonging to the group fails with an exception " +"other than :exc:`asyncio.CancelledError`, the remaining tasks in the group are " +"cancelled. No further tasks can then be added to the group. At this point, if " +"the body of the ``async with`` statement is still active " +"(i.e., :meth:`~object.__aexit__` hasn't been called yet), the task directly " +"containing the ``async with`` statement is also cancelled. The " +"resulting :exc:`asyncio.CancelledError` will interrupt an ``await``, but it will " +"not bubble out of the containing ``async with`` statement." +msgstr "" +"اولین باری که هر وظیفهیمتعلق به گروه با استثنایی غیر " +"از :exc:`asyncio.CancelledError` شکست بخورد، وظایف باقی‌مانده در گروه لغو " +"می‌شوند. پس از آن، دیگر نمی‌توان وظیفه دیگری به گروه افزود. در این نقطه، اگر بدنه " +"دستور ``async with`` هنوز فعال باشد (یعنی :meth:`~object.__aexit__` هنوز " +"فراخوانی نشده باشد)، وظیفهی که مستقیماً دربرگیرنده دستور ``async with`` است نیز لغو " +"می‌شود. :exc:`asyncio.CancelledError` حاصل، یک ``await`` را قطع می‌کند، اما از " +"دستور ``async with`` دربرگیرنده بیرون نخواهد زد." -msgid "Once all tasks have finished, if any tasks have failed with an exception other than :exc:`asyncio.CancelledError`, those exceptions are combined in an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see their documentation) which is then raised." +msgid "" +"Once all tasks have finished, if any tasks have failed with an exception other " +"than :exc:`asyncio.CancelledError`, those exceptions are combined in " +"an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see their " +"documentation) which is then raised." msgstr "" +"پس از پایان یافتن همه وظایف (tasks)، اگر هر یک از وظایف با استثنایی غیر " +"از :exc:`asyncio.CancelledError` شکست خورده باشند، آن استثناها در " +"یک :exc:`ExceptionGroup` یا :exc:`BaseExceptionGroup` (بسته به مورد؛ مستندات " +"آن‌ها را ببینید) ترکیب می‌شوند که سپس پرتاب می‌شود." -msgid "Two base exceptions are treated specially: If any task fails with :exc:`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the remaining tasks and waits for them, but then the initial :exc:`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead of :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup`." -msgstr "" +msgid "" +"Two base exceptions are treated specially: If any task fails " +"with :exc:`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels " +"the remaining tasks and waits for them, but then the " +"initial :exc:`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead " +"of :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup`." +msgstr "" +"دو استثنای پایه به‌صورت ویژه مدیریت می‌شوند: اگر هر وظیفه‌ای " +"با :exc:`KeyboardInterrupt` یا :exc:`SystemExit` شکست بخورد، گروه وظیفه (task " +"group) همچنان وظایف باقی‌مانده را لغو می‌کند و منتظر آن‌ها می‌ماند، اما " +"سپس :exc:`KeyboardInterrupt` یا :exc:`SystemExit` اولیه " +"به‌جای :exc:`ExceptionGroup` یا :exc:`BaseExceptionGroup` دوباره پرتاب می‌شود." -msgid "If the body of the ``async with`` statement exits with an exception (so :meth:`~object.__aexit__` is called with an exception set), this is treated the same as if one of the tasks failed: the remaining tasks are cancelled and then waited for, and non-cancellation exceptions are grouped into an exception group and raised. The exception passed into :meth:`~object.__aexit__`, unless it is :exc:`asyncio.CancelledError`, is also included in the exception group. The same special case is made for :exc:`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." -msgstr "" +msgid "" +"If the body of the ``async with`` statement exits with an exception " +"(so :meth:`~object.__aexit__` is called with an exception set), this is treated " +"the same as if one of the tasks failed: the remaining tasks are cancelled and " +"then waited for, and non-cancellation exceptions are grouped into an exception " +"group and raised. The exception passed into :meth:`~object.__aexit__`, unless it " +"is :exc:`asyncio.CancelledError`, is also included in the exception group. The " +"same special case is made for :exc:`KeyboardInterrupt` and :exc:`SystemExit` as " +"in the previous paragraph." +msgstr "" +"اگر بدنه‌ی دستور ``async with`` با یک استثنا خارج شود " +"(بنابراین :meth:`~object.__aexit__` در حالی فراخوانی می‌شود که یک استثنا تنظیم " +"شده است)، با این مورد مانند حالتی رفتار می‌شود که یکی از وظایف شکست خورده باشد: " +"وظایف باقی‌مانده لغو می‌شوند و سپس برای آن‌ها انتظار می‌رود، و استثناهای غیر از لغو " +"در یک گروه استثنا دسته‌بندی و پرتاب می‌شوند. استثنایی که " +"به :meth:`~object.__aexit__` داده می‌شود، مگر آنکه :exc:`asyncio.CancelledError` " +"باشد، نیز در گروه استثنا گنجانده می‌شود. همان حالت خاص پاراگراف قبلی " +"برای :exc:`KeyboardInterrupt` و :exc:`SystemExit` نیز اعمال می‌شود." -msgid "Task groups are careful not to mix up the internal cancellation used to \"wake up\" their :meth:`~object.__aexit__` with cancellation requests for the task in which they are running made by other parties. In particular, when one task group is syntactically nested in another, and both experience an exception in one of their child tasks simultaneously, the inner task group will process its exceptions, and then the outer task group will receive another cancellation and process its own exceptions." -msgstr "" +msgid "" +"Task groups are careful not to mix up the internal cancellation used to \"wake " +"up\" their :meth:`~object.__aexit__` with cancellation requests for the task in " +"which they are running made by other parties. In particular, when one task group " +"is syntactically nested in another, and both experience an exception in one of " +"their child tasks simultaneously, the inner task group will process its " +"exceptions, and then the outer task group will receive another cancellation and " +"process its own exceptions." +msgstr "" +"گروه‌های وظیفه مراقب هستند که لغو داخلیِ استفاده‌شده برای «بیدار " +"کردن» :meth:`~object.__aexit__` خود را با درخواست‌های لغو برای وظیفهی که در آن در " +"حال اجرا هستند و از سوی طرف‌های دیگر مطرح شده‌اند، اشتباه نگیرند. به‌ویژه، هنگامی " +"که یک گروه وظیفه از نظر نحوی در گروه دیگری تودرتو شده باشد و هر دو همزمان در یکی " +"از وظایف فرزند خود با استثنا مواجه شوند، گروه وظیفه داخلی استثناهای خود را پردازش " +"می‌کند و سپس گروه وظیفه خارجی لغو دیگری را دریافت می‌کند و استثناهای خود را پردازش " +"می‌کند." -msgid "In the case where a task group is cancelled externally and also must raise an :exc:`ExceptionGroup`, it will call the parent task's :meth:`~asyncio.Task.cancel` method. This ensures that a :exc:`asyncio.CancelledError` will be raised at the next :keyword:`await`, so the cancellation is not lost." -msgstr "" +msgid "" +"In the case where a task group is cancelled externally and also must raise " +"an :exc:`ExceptionGroup`, it will call the parent " +"task's :meth:`~asyncio.Task.cancel` method. This ensures that " +"a :exc:`asyncio.CancelledError` will be raised at the next :keyword:`await`, so " +"the cancellation is not lost." +msgstr "" +"در حالتی که یک گروه وظیفه (task group) از بیرون لغو می‌شود و همچنین باید " +"یک :exc:`ExceptionGroup` را پرتاب کند، متد :meth:`~asyncio.Task.cancel` مربوط به " +"وظیفه‌ی والد (parent task) را فراخوانی می‌کند. این کار تضمین می‌کند که " +"یک :exc:`asyncio.CancelledError` در :keyword:`await` بعدی پرتاب می‌شود، بنابراین " +"لغو از دست نمی‌رود." -msgid "Task groups preserve the cancellation count reported by :meth:`asyncio.Task.cancelling`." +msgid "" +"Task groups preserve the cancellation count reported " +"by :meth:`asyncio.Task.cancelling`." msgstr "" +"گروه‌های Task تعداد لغو گزارش‌شده توسط :meth:`asyncio.Task.cancelling` را حفظ " +"می‌کنند." -msgid "Improved handling of simultaneous internal and external cancellations and correct preservation of cancellation counts." -msgstr "" +msgid "" +"Improved handling of simultaneous internal and external cancellations and " +"correct preservation of cancellation counts." +msgstr "مدیریت بهتر لغوهای همزمان داخلی و خارجی و حفظ صحیح تعداد لغوها." msgid "Terminating a task group" -msgstr "" +msgstr "پایان دادن به گروه وظیفه (task group)" -msgid "While terminating a task group is not natively supported by the standard library, termination can be achieved by adding an exception-raising task to the task group and ignoring the raised exception:" +msgid "" +"While terminating a task group is not natively supported by the standard " +"library, termination can be achieved by adding an exception-raising task to the " +"task group and ignoring the raised exception:" msgstr "" +"اگرچه پایان دادن به یک گروه وظیفه (task group) به‌صورت بومی توسط کتابخانه " +"استاندارد پشتیبانی نمی‌شود، می‌توان با افزودن وظیفه‌ای که استثنا پرتاب می‌کند به " +"گروه وظیفه و نادیده گرفتن استثنای پرتاب‌شده، آن را پایان داد:" msgid "" "import asyncio\n" @@ -410,33 +795,76 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"from asyncio import TaskGroup\n" +"\n" +"class TerminateTaskGroup(Exception):\n" +" \"\"\"Exception raised to terminate a task group.\"\"\"\n" +"\n" +"async def force_terminate_task_group():\n" +" \"\"\"Used to force termination of a task group.\"\"\"\n" +" raise TerminateTaskGroup()\n" +"\n" +"async def job(task_id, sleep_time):\n" +" print(f'Task {task_id}: start')\n" +" await asyncio.sleep(sleep_time)\n" +" print(f'Task {task_id}: done')\n" +"\n" +"async def main():\n" +" try:\n" +" async with TaskGroup() as group:\n" +" # spawn some tasks\n" +" group.create_task(job(1, 0.5))\n" +" group.create_task(job(2, 1.5))\n" +" # sleep for 1 second\n" +" await asyncio.sleep(1)\n" +" # add an exception-raising task to force the group to terminate\n" +" group.create_task(force_terminate_task_group())\n" +" except* TerminateTaskGroup:\n" +" pass\n" +"\n" +"asyncio.run(main())" msgid "Expected output:" -msgstr "" +msgstr "خروجی مورد انتظار:" msgid "" "Task 1: start\n" "Task 2: start\n" "Task 1: done" msgstr "" +"Task 1: start\n" +"Task 2: start\n" +"Task 1: done" msgid "Sleeping" -msgstr "" +msgstr "توقف" msgid "Block for *delay* seconds." -msgstr "" +msgstr "به مدت *delay* ثانیه مسدود می‌شود." -msgid "If *result* is provided, it is returned to the caller when the coroutine completes." +msgid "" +"If *result* is provided, it is returned to the caller when the coroutine " +"completes." msgstr "" +"اگر *result* ارائه شده باشد، پس از تکمیل هم‌روال، به فراخواننده بازگردانده می‌شود." msgid "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" +"``sleep()`` همیشه وظیفهجاری را معلق می‌کند و به سایر وظایف اجازه اجرا می‌دهد." -msgid "Setting the delay to 0 provides an optimized path to allow other tasks to run. This can be used by long-running functions to avoid blocking the event loop for the full duration of the function call." +msgid "" +"Setting the delay to 0 provides an optimized path to allow other tasks to run. " +"This can be used by long-running functions to avoid blocking the event loop for " +"the full duration of the function call." msgstr "" +"تنظیم تأخیر روی ۰ مسیر بهینه‌ای را فراهم می‌کند که به سایر وظایف اجازه اجرا می‌دهد. " +"توابع طولانی‌مدت می‌توانند از این امکان برای جلوگیری از مسدود کردن حلقه رویداد در " +"تمام مدت فراخوانی تابع استفاده کنند." -msgid "Example of coroutine displaying the current date every second for 5 seconds::" -msgstr "" +msgid "" +"Example of coroutine displaying the current date every second for 5 seconds::" +msgstr "مثالی از یک هم‌روال که تاریخ جاری را هر ثانیه به مدت ۵ ثانیه نمایش می‌دهد::" msgid "" "import asyncio\n" @@ -453,39 +881,100 @@ msgid "" "\n" "asyncio.run(display_date())" msgstr "" +"import asyncio\n" +"import datetime as dt\n" +"\n" +"async def display_date():\n" +" loop = asyncio.get_running_loop()\n" +" end_time = loop.time() + 5.0\n" +" while True:\n" +" print(dt.datetime.now())\n" +" if (loop.time() + 1.0) >= end_time:\n" +" break\n" +" await asyncio.sleep(1)\n" +"\n" +"asyncio.run(display_date())" msgid "Removed the *loop* parameter." -msgstr "" +msgstr "پارامتر *loop* حذف شد." msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." msgstr "" +"اگر *delay* برابر با :data:`~math.nan` باشد، :exc:`ValueError` پرتاب می‌شود." msgid "Running tasks concurrently" -msgstr "" +msgstr "اجرای همزمان وظایف" -msgid "Run :ref:`awaitable objects ` in the *aws* sequence *concurrently*." +msgid "" +"Run :ref:`awaitable objects ` in the *aws* sequence " +"*concurrently*." msgstr "" +":ref:`اشیاء awaitable ` را در دنباله‌ی *aws* به‌صورت *همزمان* " +"اجرا کنید." -msgid "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a Task." +msgid "" +"If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " +"Task." msgstr "" +"اگر هر awaitable در *aws* یک هم‌روال باشد، به‌طور خودکار به‌عنوان یک Task زمان‌بندی " +"می‌شود." -msgid "If all awaitables are completed successfully, the result is an aggregate list of returned values. The order of result values corresponds to the order of awaitables in *aws*." +msgid "" +"If all awaitables are completed successfully, the result is an aggregate list of " +"returned values. The order of result values corresponds to the order of " +"awaitables in *aws*." msgstr "" +"اگر همه‌ی awaitableها با موفقیت کامل شوند، نتیجه یک فهرست تجمیعی از مقادیر بازگشتی " +"است. ترتیب مقادیر نتیجه با ترتیب awaitableها در *aws* مطابقت دارد." -msgid "If *return_exceptions* is ``False`` (default), the first raised exception is immediately propagated to the task that awaits on ``gather()``. Other awaitables in the *aws* sequence **won't be cancelled** and will continue to run." +msgid "" +"If *return_exceptions* is ``False`` (default), the first raised exception is " +"immediately propagated to the task that awaits on ``gather()``. Other " +"awaitables in the *aws* sequence **won't be cancelled** and will continue to run." msgstr "" +"اگر *return_exceptions* ``False`` (پیش‌فرض) باشد، نخستین استثنای پرتاب‌شده " +"بلافاصله به وظیفه‌ای که ``gather()`` را await می‌کند، منتشر می‌شود. سایر اشیاء قابل " +"انتظار (awaitable) در دنباله‌ی *aws* **لغو نخواهند شد** و به اجرا ادامه خواهند " +"داد." -msgid "If *return_exceptions* is ``True``, exceptions are treated the same as successful results, and aggregated in the result list." +msgid "" +"If *return_exceptions* is ``True``, exceptions are treated the same as " +"successful results, and aggregated in the result list." msgstr "" +"اگر *return_exceptions* برابر ``True`` باشد، استثناها همانند نتایج موفق در نظر " +"گرفته می‌شوند و در فهرست نتایج جمع‌آوری می‌شوند." -msgid "If ``gather()`` is *cancelled*, all submitted awaitables (that have not completed yet) are also *cancelled*." +msgid "" +"If ``gather()`` is *cancelled*, all submitted awaitables (that have not " +"completed yet) are also *cancelled*." msgstr "" +"اگر ``gather()`` *لغو شود*، تمام awaitableهای ارسال‌شده (که هنوز کامل نشده‌اند) " +"نیز *لغو می‌شوند*." -msgid "If any Task or Future from the *aws* sequence is *cancelled*, it is treated as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** cancelled in this case. This is to prevent the cancellation of one submitted Task/Future to cause other Tasks/Futures to be cancelled." +msgid "" +"If any Task or Future from the *aws* sequence is *cancelled*, it is treated as " +"if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** cancelled " +"in this case. This is to prevent the cancellation of one submitted Task/Future " +"to cause other Tasks/Futures to be cancelled." msgstr "" +"اگر هر Task یا Future از دنباله‌ی *aws* *لغوشده* باشد، با آن به‌گونه‌ای رفتار می‌شود " +"که گویی :exc:`CancelledError` را پرتاب کرده است — در این حالت، فراخوانی " +"``gather()`` لغو **نمی‌شود**. این برای جلوگیری از این است که لغو یک Task/Future " +"ارسال‌شده، باعث لغو سایر Taskها/Futureها شود." -msgid "A new alternative to create and run tasks concurrently and wait for their completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger safety guarantees than *gather* for scheduling a nesting of subtasks: if a task (or a subtask, a task scheduled by a task) raises an exception, *TaskGroup* will, while *gather* will not, cancel the remaining scheduled tasks." -msgstr "" +msgid "" +"A new alternative to create and run tasks concurrently and wait for their " +"completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger safety " +"guarantees than *gather* for scheduling a nesting of subtasks: if a task (or a " +"subtask, a task scheduled by a task) raises an exception, *TaskGroup* will, " +"while *gather* will not, cancel the remaining scheduled tasks." +msgstr "" +"یک جایگزین جدید برای ایجاد و اجرای همزمان وظیفه‌ها و انتظار برای تکمیل " +"آن‌ها، :class:`asyncio.TaskGroup` است. *TaskGroup* برای زمان‌بندی زیروظیفه‌های " +"تودرتو، نسبت به *gather* تضمین‌های ایمنی قوی‌تری فراهم می‌کند: اگر یک وظیفه (یا یک " +"زیروظیفه، یعنی وظیفه‌ای که توسط یک وظیفه زمان‌بندی شده است) استثنایی را پرتاب کند، " +"*TaskGroup* وظیفه‌های زمان‌بندی‌شده‌ی باقی‌مانده را لغو می‌کند، در حالی که *gather* این " +"کار را نمی‌کند." msgid "" "import asyncio\n" @@ -493,7 +982,8 @@ msgid "" "async def factorial(name, number):\n" " f = 1\n" " for i in range(2, number + 1):\n" -" print(f\"Task {name}: Compute factorial({number}), currently i={i}...\")\n" +" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." +"\")\n" " await asyncio.sleep(1)\n" " f *= i\n" " print(f\"Task {name}: factorial({number}) = {f}\")\n" @@ -523,71 +1013,191 @@ msgid "" "# Task C: factorial(4) = 24\n" "# [2, 6, 24]" msgstr "" +"import asyncio\n" +"\n" +"async def factorial(name, number):\n" +" f = 1\n" +" for i in range(2, number + 1):\n" +" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." +"\")\n" +" await asyncio.sleep(1)\n" +" f *= i\n" +" print(f\"Task {name}: factorial({number}) = {f}\")\n" +" return f\n" +"\n" +"async def main():\n" +" # Schedule three calls *concurrently*:\n" +" L = await asyncio.gather(\n" +" factorial(\"A\", 2),\n" +" factorial(\"B\", 3),\n" +" factorial(\"C\", 4),\n" +" )\n" +" print(L)\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# Task A: Compute factorial(2), currently i=2...\n" +"# Task B: Compute factorial(3), currently i=2...\n" +"# Task C: Compute factorial(4), currently i=2...\n" +"# Task A: factorial(2) = 2\n" +"# Task B: Compute factorial(3), currently i=3...\n" +"# Task C: Compute factorial(4), currently i=3...\n" +"# Task B: factorial(3) = 6\n" +"# Task C: Compute factorial(4), currently i=4...\n" +"# Task C: factorial(4) = 24\n" +"# [2, 6, 24]" -msgid "If *return_exceptions* is false, cancelling gather() after it has been marked done won't cancel any submitted awaitables. For instance, gather can be marked done after propagating an exception to the caller, therefore, calling ``gather.cancel()`` after catching an exception (raised by one of the awaitables) from gather won't cancel any other awaitables." -msgstr "" - -msgid "If the *gather* itself is cancelled, the cancellation is propagated regardless of *return_exceptions*." -msgstr "" - -msgid "Deprecation warning is emitted if no positional arguments are provided or not all positional arguments are Future-like objects and there is no running event loop." -msgstr "" - -msgid "Eager task factory" -msgstr "" - -msgid "A task factory for eager task execution." -msgstr "" - -msgid "When using this factory (via :meth:`loop.set_task_factory(asyncio.eager_task_factory) `), coroutines begin execution synchronously during :class:`Task` construction. Tasks are only scheduled on the event loop if they block. This can be a performance improvement as the overhead of loop scheduling is avoided for coroutines that complete synchronously." -msgstr "" - -msgid "A common example where this is beneficial is coroutines which employ caching or memoization to avoid actual I/O when possible." -msgstr "" - -msgid "Immediate execution of the coroutine is a semantic change. If the coroutine returns or raises, the task is never scheduled to the event loop. If the coroutine execution blocks, the task is scheduled to the event loop. This change may introduce behavior changes to existing applications. For example, the application's task execution order is likely to change." -msgstr "" - -msgid "Create an eager task factory, similar to :func:`eager_task_factory`, using the provided *custom_task_constructor* when creating a new task instead of the default :class:`Task`." +msgid "" +"If *return_exceptions* is false, cancelling gather() after it has been marked " +"done won't cancel any submitted awaitables. For instance, gather can be marked " +"done after propagating an exception to the caller, therefore, calling " +"``gather.cancel()`` after catching an exception (raised by one of the " +"awaitables) from gather won't cancel any other awaitables." +msgstr "" +"اگر *return_exceptions* نادرست باشد، لغو gather() پس از آن‌که به‌عنوان انجام‌شده " +"علامت‌گذاری شده باشد، هیچ‌کدام از موارد قابل await (awaitable) ارسال‌شده را لغو " +"نمی‌کند. برای مثال، gather می‌تواند پس از انتشار یک استثنا به فراخواننده، به‌عنوان " +"انجام‌شده علامت‌گذاری شود؛ بنابراین، فراخوانی ``gather.cancel()`` پس از گرفتن " +"استثنایی از gather (که توسط یکی از موارد قابل await پرتاب‌شده است)، هیچ مورد قابل " +"await دیگری را لغو نمی‌کند." + +msgid "" +"If the *gather* itself is cancelled, the cancellation is propagated regardless " +"of *return_exceptions*." +msgstr "اگر خود *gather* لغو شود، لغو صرف‌نظر از *return_exceptions* انتشار می‌یابد." + +msgid "" +"Deprecation warning is emitted if no positional arguments are provided or not " +"all positional arguments are Future-like objects and there is no running event " +"loop." msgstr "" +"در صورتی که هیچ آرگومان جایگاهی ارائه نشده باشد یا همه‌ی آرگومان‌های جایگاهی اشیای " +"Future-مانند نباشند و هیچ حلقه‌ی رویدادی در حال اجرا وجود نداشته باشد، هشدار از " +"رده خارج شدن صادر می‌شود." -msgid "*custom_task_constructor* must be a *callable* with the signature matching the signature of :class:`Task.__init__ `. The callable must return a :class:`asyncio.Task`-compatible object." +msgid "Eager task factory" +msgstr "کارخانه‌ی وظیفه حریصانه (Eager task factory)" + +msgid "A task factory for eager task execution." +msgstr "یک کارخانه‌ی وظیفهبرای اجرای فوری وظیفه." + +msgid "" +"When using this factory " +"(via :meth:`loop.set_task_factory(asyncio.eager_task_factory) " +"`), coroutines begin execution synchronously " +"during :class:`Task` construction. Tasks are only scheduled on the event loop if " +"they block. This can be a performance improvement as the overhead of loop " +"scheduling is avoided for coroutines that complete synchronously." +msgstr "" +"هنگام استفاده از این کارخانه (از " +"طریق :meth:`loop.set_task_factory(asyncio.eager_task_factory) " +"`)، هم‌روال‌ها اجرای خود را به‌صورت همگام در حین " +"ساخت :class:`Task` آغاز می‌کنند. وظایفتنها در صورتی که مسدود شوند، در " +"حلقه رویداد زمان‌بندی می‌شوند. این می‌تواند بهبودی در عملکرد باشد، زیرا از سربار " +"زمان‌بندی حلقه برای هم‌روال‌هایی که به‌صورت همگام کامل می‌شوند جلوگیری می‌شود." + +msgid "" +"A common example where this is beneficial is coroutines which employ caching or " +"memoization to avoid actual I/O when possible." msgstr "" +"یک مثال رایج که در آن این موضوع مفید است، هم‌روال‌هایی هستند که از نهانگاه‌سازی یا " +"به‌خاطرسپاری (memoization) برای پرهیز از ورودی/خروجی واقعی در صورت امکان استفاده " +"می‌کنند." -msgid "This function returns a *callable* intended to be used as a task factory of an event loop via :meth:`loop.set_task_factory(factory) `)." +msgid "" +"Immediate execution of the coroutine is a semantic change. If the coroutine " +"returns or raises, the task is never scheduled to the event loop. If the " +"coroutine execution blocks, the task is scheduled to the event loop. This change " +"may introduce behavior changes to existing applications. For example, the " +"application's task execution order is likely to change." +msgstr "" +"اجرای فوری هم‌روال یک تغییر معنایی است. اگر هم‌روال مقداری برگرداند یا استثنایی " +"پرتاب کند، وظیفه هرگز در حلقه رویداد زمان‌بندی نمی‌شود. اگر اجرای هم‌روال مسدود " +"شود، وظیفه در حلقه رویداد زمان‌بندی می‌شود. این تغییر ممکن است تغییراتی در رفتار " +"برنامه‌های موجود ایجاد کند. برای مثال، ترتیب اجرای وظایف برنامه احتمالاً تغییر " +"خواهد کرد." + +msgid "" +"Create an eager task factory, similar to :func:`eager_task_factory`, using the " +"provided *custom_task_constructor* when creating a new task instead of the " +"default :class:`Task`." msgstr "" +"یک کارخانه وظیفه فوری ایجاد کنید، مشابه :func:`eager_task_factory`، که هنگام ایجاد " +"یک وظیفه جدید، به‌جای :class:`Task` پیش‌فرض، از *custom_task_constructor* ارائه‌شده " +"استفاده می‌کند." -msgid "Shielding from cancellation" +msgid "" +"*custom_task_constructor* must be a *callable* with the signature matching the " +"signature of :class:`Task.__init__ `. The callable must return " +"a :class:`asyncio.Task`-compatible object." +msgstr "" +"*custom_task_constructor* باید یک *فراخوان‌پذیر (callable)* با امضایی مطابق با " +"امضای :class:`Task.__init__ ` باشد. این فراخوان‌پذیر باید یک شیء سازگار " +"با :class:`asyncio.Task` بازگشت دهد." + +msgid "" +"This function returns a *callable* intended to be used as a task factory of an " +"event loop via :meth:`loop.set_task_factory(factory) `)." msgstr "" +"این تابع یک شیء *قابل فراخوانی* را برمی‌گرداند که برای استفاده به‌عنوان کارخانه‌ی " +"وظیفه یک حلقه‌ی رویداد از طریق :meth:`loop.set_task_factory(factory) " +"` در نظر گرفته شده است." + +msgid "Shielding from cancellation" +msgstr "محافظت در برابر لغو" -msgid "Protect an :ref:`awaitable object ` from being :meth:`cancelled `." +msgid "" +"Protect an :ref:`awaitable object ` from " +"being :meth:`cancelled `." msgstr "" +"از یک :ref:`شیء awaitable ` در برابر :meth:`لغو شدن " +"` محافظت کنید." msgid "If *aw* is a coroutine it is automatically scheduled as a Task." -msgstr "" +msgstr "اگر *aw* یک هم‌روال باشد، به‌طور خودکار به‌عنوان یک Task زمان‌بندی می‌شود." msgid "The statement::" -msgstr "" +msgstr "دستور::" msgid "" "task = asyncio.create_task(something())\n" "res = await shield(task)" msgstr "" +"task = asyncio.create_task(something())\n" +"res = await shield(task)" msgid "is equivalent to::" -msgstr "" +msgstr "معادل است با::" msgid "res = await something()" -msgstr "" +msgstr "res = await something()" -msgid "*except* that if the coroutine containing it is cancelled, the Task running in ``something()`` is not cancelled. From the point of view of ``something()``, the cancellation did not happen. Although its caller is still cancelled, so the \"await\" expression still raises a :exc:`CancelledError`." +msgid "" +"*except* that if the coroutine containing it is cancelled, the Task running in " +"``something()`` is not cancelled. From the point of view of ``something()``, " +"the cancellation did not happen. Although its caller is still cancelled, so the " +"\"await\" expression still raises a :exc:`CancelledError`." msgstr "" +"*به جز* اینکه اگر هم‌روال حاوی آن لغو شود، Task در حال اجرا در ``something()`` " +"لغو نمی‌شود. از دید ``something()``، لغو رخ نداده است. اگرچه فراخواننده‌ی آن " +"همچنان لغو می‌شود، بنابراین عبارت \"await\" همچنان یک :exc:`CancelledError` را " +"پرتاب می‌کند." -msgid "If ``something()`` is cancelled by other means (i.e. from within itself) that would also cancel ``shield()``." +msgid "" +"If ``something()`` is cancelled by other means (i.e. from within itself) that " +"would also cancel ``shield()``." msgstr "" +"اگر ``something()`` به روش‌های دیگر لغو شود (یعنی از درون خودش)، این موضوع " +"``shield()`` را نیز لغو می‌کند." -msgid "If it is desired to completely ignore cancellation (not recommended) the ``shield()`` function should be combined with a try/except clause, as follows::" +msgid "" +"If it is desired to completely ignore cancellation (not recommended) the " +"``shield()`` function should be combined with a try/except clause, as follows::" msgstr "" +"اگر مطلوب باشد که لغو (cancellation) به‌طور کامل نادیده گرفته شود (توصیه نمی‌شود)، " +"باید تابع ``shield()`` را با یک بند try/except ترکیب کرد، به‌صورت زیر::" msgid "" "task = asyncio.create_task(something())\n" @@ -596,39 +1206,86 @@ msgid "" "except CancelledError:\n" " res = None" msgstr "" +"task = asyncio.create_task(something())\n" +"try:\n" +" res = await shield(task)\n" +"except CancelledError:\n" +" res = None" -msgid "Save a reference to tasks passed to this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn't referenced elsewhere may get garbage collected at any time, even before it's done." +msgid "" +"Save a reference to tasks passed to this function, to avoid a task disappearing " +"mid-execution. The event loop only keeps weak references to tasks. A task that " +"isn't referenced elsewhere may get garbage collected at any time, even before " +"it's done." msgstr "" +"برای جلوگیری از ناپدید شدن یک وظیفه در میانه‌ی اجرا، ارجاعی به وظایف داده‌شده " +"به این تابع ذخیره کنید. حلقه‌ی رویداد فقط ارجاع‌های ضعیف به وظایف را نگه می‌دارد. " +"وظیفهی که در جای دیگری به آن ارجاع داده نشده است، ممکن است در هر زمانی، حتی پیش از " +"آنکه به پایان برسد، زباله‌روبی شود." -msgid "Deprecation warning is emitted if *aw* is not Future-like object and there is no running event loop." +msgid "" +"Deprecation warning is emitted if *aw* is not Future-like object and there is no " +"running event loop." msgstr "" +"اگر *aw* یک شیء شبیه Future نباشد و حلقه رویدادی در حال اجرا وجود نداشته باشد، " +"هشدار از رده خارج شدن صادر می‌شود." msgid "Timeouts" -msgstr "" +msgstr "مهلت‌های زمانی" -msgid "Return an :ref:`asynchronous context manager ` that can be used to limit the amount of time spent waiting on something." +msgid "" +"Return an :ref:`asynchronous context manager ` that can " +"be used to limit the amount of time spent waiting on something." msgstr "" +"یک :ref:`مدیر زمینه ناهمگام ` برمی‌گرداند که می‌توان از آن " +"برای محدود کردن مدت زمانی که صرف انتظار برای چیزی می‌شود استفاده کرد." -msgid "*delay* can either be ``None``, or a float/int number of seconds to wait. If *delay* is ``None``, no time limit will be applied; this can be useful if the delay is unknown when the context manager is created." +msgid "" +"*delay* can either be ``None``, or a float/int number of seconds to wait. If " +"*delay* is ``None``, no time limit will be applied; this can be useful if the " +"delay is unknown when the context manager is created." msgstr "" +"*delay* می‌تواند ``None`` یا عددی از نوع float/int برای تعداد ثانیه‌های انتظار " +"باشد. اگر *delay* برابر ``None`` باشد، هیچ محدودیت زمانی اعمال نخواهد شد؛ این " +"موضوع می‌تواند زمانی مفید باشد که تأخیر در هنگام ایجاد مدیر زمینه نامشخص باشد." -msgid "In either case, the context manager can be rescheduled after creation using :meth:`Timeout.reschedule`." +msgid "" +"In either case, the context manager can be rescheduled after creation " +"using :meth:`Timeout.reschedule`." msgstr "" +"در هر صورت، می‌توان مدیر زمینه را پس از ایجاد، با استفاده " +"از :meth:`Timeout.reschedule` دوباره زمان‌بندی کرد." msgid "" "async def main():\n" " async with asyncio.timeout(10):\n" " await long_running_task()" msgstr "" +"async def main():\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()" -msgid "If ``long_running_task`` takes more than 10 seconds to complete, the context manager will cancel the current task and handle the resulting :exc:`asyncio.CancelledError` internally, transforming it into a :exc:`TimeoutError` which can be caught and handled." +msgid "" +"If ``long_running_task`` takes more than 10 seconds to complete, the context " +"manager will cancel the current task and handle the " +"resulting :exc:`asyncio.CancelledError` internally, transforming it into " +"a :exc:`TimeoutError` which can be caught and handled." msgstr "" +"اگر تکمیل ``long_running_task`` بیش از ۱۰ ثانیه طول بکشد، مدیر زمینه، وظیفه جاری " +"را لغو می‌کند و :exc:`asyncio.CancelledError` حاصل را به‌صورت داخلی مدیریت می‌کند و " +"آن را به :exc:`TimeoutError` تبدیل می‌کند که می‌توان آن را گرفت و مدیریت کرد." -msgid "The :func:`asyncio.timeout` context manager is what transforms the :exc:`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:`TimeoutError` can only be caught *outside* of the context manager." +msgid "" +"The :func:`asyncio.timeout` context manager is what transforms " +"the :exc:`asyncio.CancelledError` into a :exc:`TimeoutError`, which means " +"the :exc:`TimeoutError` can only be caught *outside* of the context manager." msgstr "" +"مدیر زمینه‌ی :func:`asyncio.timeout` همان چیزی است " +"که :exc:`asyncio.CancelledError` را به :exc:`TimeoutError` تبدیل می‌کند، به این " +"معنا که :exc:`TimeoutError` فقط در *خارج* از مدیر زمینه قابل گرفتن است." msgid "Example of catching :exc:`TimeoutError`::" -msgstr "" +msgstr "نمونه‌ای از گرفتن :exc:`TimeoutError`::" msgid "" "async def main():\n" @@ -640,33 +1297,63 @@ msgid "" "\n" " print(\"This statement will run regardless.\")" msgstr "" +"async def main():\n" +" try:\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" -msgid "The context manager produced by :func:`asyncio.timeout` can be rescheduled to a different deadline and inspected." +msgid "" +"The context manager produced by :func:`asyncio.timeout` can be rescheduled to a " +"different deadline and inspected." msgstr "" +"مدیر زمینه تولیدشده توسط :func:`asyncio.timeout` می‌تواند برای مهلتی دیگر دوباره " +"زمان‌بندی و بازرسی شود." -msgid "An :ref:`asynchronous context manager ` for cancelling overdue coroutines." +msgid "" +"An :ref:`asynchronous context manager ` for cancelling " +"overdue coroutines." msgstr "" +"یک :ref:`مدیر زمینه ناهمگام ` برای لغو هم‌روال‌های " +"منقضی‌شده." -msgid "Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at` rather than instantiating :class:`!Timeout` directly." +msgid "" +"Prefer using :func:`asyncio.timeout` or :func:`asyncio.timeout_at` rather than " +"instantiating :class:`!Timeout` directly." msgstr "" +"ترجیحاً به‌جای نمونه‌سازی مستقیم :class:`!Timeout`، از :func:`asyncio.timeout` " +"یا :func:`asyncio.timeout_at` استفاده کنید." -msgid "``when`` should be an absolute time at which the context should time out, as measured by the event loop's clock:" +msgid "" +"``when`` should be an absolute time at which the context should time out, as " +"measured by the event loop's clock:" msgstr "" +"``when`` باید یک زمان مطلق باشد که در آن زمینه باید منقضی شود، همان‌طور که با " +"ساعت حلقه رویداد اندازه‌گیری می‌شود:" msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" +"اگر ``when`` برابر ``None`` باشد، مهلت زمانی (timeout) هرگز فعال نخواهد شد." -msgid "If ``when < loop.time()``, the timeout will trigger on the next iteration of the event loop." +msgid "" +"If ``when < loop.time()``, the timeout will trigger on the next iteration of the " +"event loop." msgstr "" +"اگر ``when < loop.time()`` باشد، مهلت زمانی در تکرار بعدی حلقه رویداد فعال خواهد شد." -msgid "Return the current deadline, or ``None`` if the current deadline is not set." +msgid "" +"Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" +"مهلت فعلی را برمی‌گرداند، یا اگر مهلت فعلی تنظیم‌نشده باشد ``None`` را برمی‌گرداند." msgid "Reschedule the timeout." -msgstr "" +msgstr "مهلت را دوباره زمان‌بندی کنید." msgid "Return whether the context manager has exceeded its deadline (expired)." -msgstr "" +msgstr "برمی‌گرداند که آیا مدیر زمینه از مهلت خود گذشته است (منقضی‌شده است)." msgid "" "async def main():\n" @@ -684,12 +1371,30 @@ msgid "" " if cm.expired():\n" " print(\"Looks like we haven't finished on time.\")" msgstr "" +"async def main():\n" +" try:\n" +" # We do not know the timeout when starting, so we pass ``None``.\n" +" async with asyncio.timeout(None) as cm:\n" +" # We know the timeout now, so we reschedule it.\n" +" new_deadline = get_running_loop().time() + 10\n" +" cm.reschedule(new_deadline)\n" +"\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" pass\n" +"\n" +" if cm.expired():\n" +" print(\"Looks like we haven't finished on time.\")" msgid "Timeout context managers can be safely nested." -msgstr "" +msgstr "می‌توان مدیران زمینه‌ی مهلت زمانی (timeout) را با اطمینان تودرتو کرد." -msgid "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to stop waiting, or ``None``." +msgid "" +"Similar to :func:`asyncio.timeout`, except *when* is the absolute time to stop " +"waiting, or ``None``." msgstr "" +"مشابه :func:`asyncio.timeout`، با این تفاوت که *when* زمان مطلق برای توقف انتظار " +"است، یا ``None``." msgid "" "async def main():\n" @@ -703,24 +1408,53 @@ msgid "" "\n" " print(\"This statement will run regardless.\")" msgstr "" +"async def main():\n" +" loop = get_running_loop()\n" +" deadline = loop.time() + 20\n" +" try:\n" +" async with asyncio.timeout_at(deadline):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" -msgid "Wait for the *aw* :ref:`awaitable ` to complete with a timeout." +msgid "" +"Wait for the *aw* :ref:`awaitable ` to complete with a " +"timeout." msgstr "" +"منتظر بمانید تا *aw* :ref:`awaitable ` با یک مهلت زمانی " +"کامل شود." -msgid "*timeout* can either be ``None`` or a float or int number of seconds to wait for. If *timeout* is ``None``, block until the future completes." +msgid "" +"*timeout* can either be ``None`` or a float or int number of seconds to wait " +"for. If *timeout* is ``None``, block until the future completes." msgstr "" +"*timeout* می‌تواند ``None`` یا یک عدد float یا int به‌عنوان تعداد ثانیه‌های انتظار " +"باشد. اگر *timeout* برابر ``None`` باشد، تا زمانی که future تکمیل شود، مسدود " +"می‌شود." msgid "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" +"در صورت رخ دادن مهلت زمانی (timeout)، وظیفهلغو می‌شود و :exc:`TimeoutError` " +"پرتاب می‌شود." -msgid "To avoid the task :meth:`cancellation `, wrap it in :func:`shield`." +msgid "" +"To avoid the task :meth:`cancellation `, wrap it in :func:`shield`." msgstr "" +"برای جلوگیری از :meth:`لغو ` وظیفه، آن را در :func:`shield` بپیچید." -msgid "The function will wait until the future is actually cancelled, so the total wait time may exceed the *timeout*. If an exception happens during cancellation, it is propagated." +msgid "" +"The function will wait until the future is actually cancelled, so the total wait " +"time may exceed the *timeout*. If an exception happens during cancellation, it " +"is propagated." msgstr "" +"این تابع تا زمانی که فیوچر (future) به‌طور واقعی لغو شود، صبر می‌کند، بنابراین کل " +"زمان انتظار ممکن است از *timeout* فراتر رود. اگر در حین لغو استثنایی رخ دهد، آن " +"استثنا انتشار می‌یابد." msgid "If the wait is cancelled, the future *aw* is also cancelled." -msgstr "" +msgstr "اگر انتظار لغو شود، آینده (future) *aw* نیز لغو می‌شود." msgid "" "async def eternity():\n" @@ -741,72 +1475,140 @@ msgid "" "#\n" "# timeout!" msgstr "" +"async def eternity():\n" +" # Sleep for one hour\n" +" await asyncio.sleep(3600)\n" +" print('yay!')\n" +"\n" +"async def main():\n" +" # Wait for at most 1 second\n" +" try:\n" +" await asyncio.wait_for(eternity(), timeout=1.0)\n" +" except TimeoutError:\n" +" print('timeout!')\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# timeout!" -msgid "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be cancelled. Previously, it raised :exc:`TimeoutError` immediately." +msgid "" +"When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " +"cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" +"هنگامی که *aw* به دلیل مهلت زمانی (timeout) لغو می‌شود، ``wait_for`` منتظر می‌ماند تا " +"*aw* لغو شود. پیش از این، بلافاصله :exc:`TimeoutError` را پرتاب می‌کرد." msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." -msgstr "" +msgstr ":exc:`TimeoutError` را به‌جای :exc:`asyncio.TimeoutError` پرتاب می‌کند." msgid "Waiting primitives" -msgstr "" +msgstr "اولیه‌های انتظار" -msgid "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the *aws* iterable concurrently and block until the condition specified by *return_when*." +msgid "" +"Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the *aws* " +"iterable concurrently and block until the condition specified by *return_when*." msgstr "" +"نمونه‌های :class:`~asyncio.Future` و :class:`~asyncio.Task` موجود در پیمایش‌پذیر " +"*aws* را به‌طور همزمان اجرا می‌کند و تا برقراری شرط مشخص‌شده توسط *return_when* " +"مسدود می‌شود." msgid "The *aws* iterable must not be empty." -msgstr "" +msgstr "پیمایش‌پذیر *aws* نباید خالی باشد." msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." -msgstr "" +msgstr "دو مجموعه از Tasks/Futures را برمی‌گرداند: ``(done, pending)``." msgid "Usage::" -msgstr "" +msgstr "استفاده::" msgid "done, pending = await asyncio.wait(aws)" -msgstr "" +msgstr "done, pending = await asyncio.wait(aws)" -msgid "*timeout* (a float or int), if specified, can be used to control the maximum number of seconds to wait before returning." +msgid "" +"*timeout* (a float or int), if specified, can be used to control the maximum " +"number of seconds to wait before returning." msgstr "" +"*timeout* (یک float یا int)، در صورت مشخص بودن، می‌تواند برای کنترل حداکثر تعداد " +"ثانیه‌های انتظار پیش از بازگشت استفاده شود." -msgid "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks that aren't done when the timeout occurs are simply returned in the second set." +msgid "" +"Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " +"that aren't done when the timeout occurs are simply returned in the second set." msgstr "" +"توجه داشته باشید که این تابع :exc:`TimeoutError` را پرتاب نمی‌کند. Futureها یا " +"Taskهایی که هنگام فرا رسیدن مهلت زمانی انجام نشده‌اند، به‌سادگی در مجموعه دوم " +"برگردانده می‌شوند." -msgid "*return_when* indicates when this function should return. It must be one of the following constants:" +msgid "" +"*return_when* indicates when this function should return. It must be one of the " +"following constants:" msgstr "" +"*return_when* نشان می‌دهد که این تابع چه زمانی باید بازگشت کند. این مقدار باید " +"یکی از ثابت‌های زیر باشد:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Description" -msgstr "" +msgstr "توضیح" msgid "The function will return when any future finishes or is cancelled." msgstr "" +"تابع هنگامی بازگشت خواهد کرد که هر فیوچر (future) به پایان برسد یا لغو شود." -msgid "The function will return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to :const:`ALL_COMPLETED`." +msgid "" +"The function will return when any future finishes by raising an exception. If no " +"future raises an exception then it is equivalent to :const:`ALL_COMPLETED`." msgstr "" +"این تابع هنگامی بازگشت می‌کند که هر فیوچر (future) با پرتاب یک استثنا به پایان " +"برسد. اگر هیچ فیوچری استثنا پرتاب نکند، معادل :const:`ALL_COMPLETED` خواهد بود." msgid "The function will return when all futures finish or are cancelled." -msgstr "" +msgstr "تابع زمانی بازگشت می‌کند که همه‌ی آینده‌نماها (futures) پایان یابند یا لغو شوند." -msgid "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures when a timeout occurs." +msgid "" +"Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures when a " +"timeout occurs." msgstr "" +"برخلاف :func:`~asyncio.wait_for`، ``wait()`` در صورت وقوع مهلت زمانی، آینده‌نماها " +"(futures) را لغو نمی‌کند." -msgid "If ``wait()`` is cancelled, the futures in *aws* are not cancelled and continue to run." +msgid "" +"If ``wait()`` is cancelled, the futures in *aws* are not cancelled and continue " +"to run." msgstr "" +"اگر ``wait()`` لغو شود، آینده‌نماها (futures) موجود در *aws* لغو نمی‌شوند و به اجرای " +"خود ادامه می‌دهند." msgid "Passing coroutine objects to ``wait()`` directly is forbidden." -msgstr "" +msgstr "ارسال اشیای هم‌روال به ``wait()`` به‌صورت مستقیم ممنوع است." msgid "Added support for generators yielding tasks." -msgstr "" +msgstr "پشتیبانی از تولیدگرهایی که وظایف (tasks) را yield می‌کنند، افزوده شد." -msgid "Run :ref:`awaitable objects ` in the *aws* iterable concurrently. The returned object can be iterated to obtain the results of the awaitables as they finish." +msgid "" +"Run :ref:`awaitable objects ` in the *aws* iterable " +"concurrently. The returned object can be iterated to obtain the results of the " +"awaitables as they finish." msgstr "" +":ref:`اشیاء awaitable ` موجود در پیمایش‌پذیر *aws* را به‌صورت " +"همزمان اجرا کنید. می‌توانید شیء برگردانده‌شده را پیمایش کنید تا نتایج اشیاء " +"awaitable را به‌محض اتمام هرکدام از آن‌ها به دست آورید." -msgid "The object returned by ``as_completed()`` can be iterated as an :term:`asynchronous iterator` or a plain :term:`iterator`. When asynchronous iteration is used, the originally-supplied awaitables are yielded if they are tasks or futures. This makes it easy to correlate previously-scheduled tasks with their results. Example::" -msgstr "" +msgid "" +"The object returned by ``as_completed()`` can be iterated as " +"an :term:`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " +"iteration is used, the originally-supplied awaitables are yielded if they are " +"tasks or futures. This makes it easy to correlate previously-scheduled tasks " +"with their results. Example::" +msgstr "" +"می‌توان شیء برگردانده‌شده از ``as_completed()`` را به‌عنوان یک :term:`پیمایش‌گر " +"ناهمگام ` یا یک :term:`پیمایش‌گر ` ساده پیمایش " +"کرد. هنگامی که از پیمایش ناهمگام استفاده می‌شود، awaitableهایی که در ابتدا ارائه " +"شده‌اند، در صورتی که task یا future باشند، بازگشت داده می‌شوند. این کار مرتبط کردن " +"taskهای از پیش زمان‌بندی‌شده با نتایج آن‌ها را آسان می‌کند. مثال::" msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" @@ -823,12 +1625,35 @@ msgid "" " else:\n" " print(\"IPv4 connection established.\")" msgstr "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"async for earliest_connect in as_completed(tasks):\n" +" # earliest_connect is done. The result can be obtained by\n" +" # awaiting it or calling earliest_connect.result()\n" +" reader, writer = await earliest_connect\n" +"\n" +" if earliest_connect is ipv6_connect:\n" +" print(\"IPv6 connection established.\")\n" +" else:\n" +" print(\"IPv4 connection established.\")" -msgid "During asynchronous iteration, implicitly-created tasks will be yielded for supplied awaitables that aren't tasks or futures." +msgid "" +"During asynchronous iteration, implicitly-created tasks will be yielded for " +"supplied awaitables that aren't tasks or futures." msgstr "" +"در حین تکرار ناهمگام، برای awaitableهای فراهم‌شده که task یا future نیستند، " +"taskهایی که به‌صورت ضمنی ایجاد شده‌اند yield داده خواهند شد." -msgid "When used as a plain iterator, each iteration yields a new coroutine that returns the result or raises the exception of the next completed awaitable. This pattern is compatible with Python versions older than 3.13::" +msgid "" +"When used as a plain iterator, each iteration yields a new coroutine that " +"returns the result or raises the exception of the next completed awaitable. This " +"pattern is compatible with Python versions older than 3.13::" msgstr "" +"هنگامی که به‌عنوان یک پیمایش‌گر ساده استفاده شود، هر تکرار یک هم‌روال جدید به دست " +"می‌دهد که نتیجه‌ی awaitable تکمیل‌شده‌ی بعدی را بازمی‌گرداند یا استثنای آن را پرتاب " +"می‌کند. این الگو با نسخه‌های قدیمی‌تر از 3.13 پایتون سازگار است::" msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" @@ -841,33 +1666,77 @@ msgid "" " # awaitable that finishes next.\n" " reader, writer = await next_connect" msgstr "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"for next_connect in as_completed(tasks):\n" +" # next_connect یکی از اشیای وظیفه اصلی نیست. برای دریافت مقدار نتیجه یا " +"پرتاب\n" +" # استثنای awaitableای که بعدی تمام می‌شود، باید آن را await کرد.\n" +" reader, writer = await next_connect" -msgid "A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables are done. This is raised by the ``async for`` loop during asynchronous iteration or by the coroutines yielded during plain iteration." +msgid "" +"A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables are " +"done. This is raised by the ``async for`` loop during asynchronous iteration or " +"by the coroutines yielded during plain iteration." msgstr "" +"اگر مهلت زمانی پیش از آنکه همه‌ی awaitableها انجام شوند منقضی شود، " +"یک :exc:`TimeoutError` پرتاب می‌شود. این استثنا توسط حلقه‌ی ``async for`` در حین " +"تکرار ناهمگام یا توسط هم‌روال‌هایی که در حین تکرار ساده تولید می‌شوند، پرتاب می‌شود." -msgid "``as_completed()`` does not cancel the tasks running the supplied awaitables: if a timeout occurs or the iteration is cancelled, the remaining tasks continue to run." +msgid "" +"``as_completed()`` does not cancel the tasks running the supplied awaitables: if " +"a timeout occurs or the iteration is cancelled, the remaining tasks continue to " +"run." msgstr "" +"``as_completed()`` وظایف در حال اجرای awaitableهای ارائه‌شده را لغو نمی‌کند: اگر " +"مهلت به پایان برسد یا پیمایش لغو شود، وظایف باقی‌مانده به اجرا ادامه می‌دهند." -msgid "Deprecation warning is emitted if not all awaitable objects in the *aws* iterable are Future-like objects and there is no running event loop." +msgid "" +"Deprecation warning is emitted if not all awaitable objects in the *aws* " +"iterable are Future-like objects and there is no running event loop." msgstr "" +"اگر تمام اشیای awaitable در پیمایش‌پذیر *aws* اشیای شبه-Future نباشند و حلقه " +"رویدادی در حال اجرا وجود نداشته باشد، هشدار از رده خارج شدن صادر می‌شود." -msgid "The result can now be used as either an :term:`asynchronous iterator` or as a plain :term:`iterator` (previously it was only a plain iterator)." +msgid "" +"The result can now be used as either an :term:`asynchronous iterator` or as a " +"plain :term:`iterator` (previously it was only a plain iterator)." msgstr "" +"نتیجه اکنون می‌تواند هم به‌عنوان یک :term:`پیمایش‌گر ناهمگام ` و هم به‌عنوان یک :term:`پیمایش‌گر ` ساده استفاده شود (پیش‌تر " +"فقط یک پیمایش‌گر ساده بود)." msgid "Running in threads" -msgstr "" +msgstr "اجرا در نخ‌ها" msgid "Asynchronously run function *func* in a separate thread." -msgstr "" +msgstr "تابع *func* را به‌صورت ناهمگام در یک نخ جداگانه اجرا می‌کند." -msgid "Any \\*args and \\*\\*kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propagated, allowing context variables from the event loop thread to be accessed in the separate thread." +msgid "" +"Any \\*args and \\*\\*kwargs supplied for this function are directly passed to " +"*func*. Also, the current :class:`contextvars.Context` is propagated, allowing " +"context variables from the event loop thread to be accessed in the separate " +"thread." msgstr "" +"هرگونه \\*args و \\*\\*kwargs که برای این تابع ارائه شود، مستقیماً به *func* " +"ارسال می‌شود. همچنین :class:`contextvars.Context` جاری منتشر می‌شود تا متغیرهای " +"زمینه از نخ حلقه رویداد در نخ جداگانه قابل دسترسی باشند." -msgid "Return a coroutine that can be awaited to get the eventual result of *func*." +msgid "" +"Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" +"یک هم‌روال برمی‌گرداند که می‌توان آن را await کرد تا نتیجه نهایی *func* به دست آید." -msgid "This coroutine function is primarily intended to be used for executing IO-bound functions/methods that would otherwise block the event loop if they were run in the main thread. For example::" +msgid "" +"This coroutine function is primarily intended to be used for executing IO-bound " +"functions/methods that would otherwise block the event loop if they were run in " +"the main thread. For example::" msgstr "" +"این تابع هم‌روال عمدتاً برای اجرای تابع‌ها/متدهای وابسته به ورودی/خروجی (IO-bound) " +"در نظر گرفته شده است، تابع‌هایی که در غیر این صورت، اگر در نخ اصلی اجرا شوند، " +"حلقه رویداد را مسدود می‌کنند. برای مثال::" msgid "" "def blocking_io():\n" @@ -896,29 +1765,80 @@ msgid "" "# blocking_io complete at 19:50:54\n" "# finished main at 19:50:54" msgstr "" +"def blocking_io():\n" +" print(f\"start blocking_io at {time.strftime('%X')}\")\n" +" # توجه داشته باشید که time.sleep() می‌تواند با هر عملیات مسدودکننده‌ی\n" +" # محدود به ورودی/خروجی (IO-bound)، مانند عملیات فایل جایگزین شود.\n" +" time.sleep(1)\n" +" print(f\"blocking_io complete at {time.strftime('%X')}\")\n" +"\n" +"async def main():\n" +" print(f\"started main at {time.strftime('%X')}\")\n" +"\n" +" await asyncio.gather(\n" +" asyncio.to_thread(blocking_io),\n" +" asyncio.sleep(1))\n" +"\n" +" print(f\"finished main at {time.strftime('%X')}\")\n" +"\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# خروجی مورد انتظار:\n" +"#\n" +"# started main at 19:50:53\n" +"# start blocking_io at 19:50:53\n" +"# blocking_io complete at 19:50:54\n" +"# finished main at 19:50:54" -msgid "Directly calling ``blocking_io()`` in any coroutine would block the event loop for its duration, resulting in an additional 1 second of run time. Instead, by using ``asyncio.to_thread()``, we can run it in a separate thread without blocking the event loop." +msgid "" +"Directly calling ``blocking_io()`` in any coroutine would block the event loop " +"for its duration, resulting in an additional 1 second of run time. Instead, by " +"using ``asyncio.to_thread()``, we can run it in a separate thread without " +"blocking the event loop." msgstr "" +"فراخوانی مستقیم ``blocking_io()`` در هر هم‌روالی، حلقه رویداد را برای مدت آن " +"مسدود می‌کند و باعث افزایش ۱ ثانیه‌ای زمان اجرا می‌شود. در عوض، با استفاده از " +"``asyncio.to_thread()`` می‌توانیم آن را در یک نخ جداگانه بدون مسدود کردن حلقه " +"رویداد اجرا کنیم." -msgid "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used to make IO-bound functions non-blocking. However, for extension modules that release the GIL or alternative Python implementations that don't have one, ``asyncio.to_thread()`` can also be used for CPU-bound functions." +msgid "" +"Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used to " +"make IO-bound functions non-blocking. However, for extension modules that " +"release the GIL or alternative Python implementations that don't have one, " +"``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" +"به دلیل :term:`GIL`، معمولاً فقط می‌توان از ``asyncio.to_thread()`` برای غیرمسدود " +"کردن توابع محدود به ورودی/خروجی (IO-bound) استفاده کرد. با این حال، برای " +"ماژول‌های توسعه‌ای که GIL را آزاد می‌کنند یا پیاده‌سازی‌های جایگزین پایتون که GIL " +"ندارند، می‌توان از ``asyncio.to_thread()`` برای توابع محدود به پردازنده (CPU-" +"bound) نیز استفاده کرد." msgid "Scheduling from other threads" -msgstr "" +msgstr "زمان‌بندی از نخ‌های دیگر" msgid "Submit a coroutine to the given event loop. Thread-safe." -msgstr "" +msgstr "یک هم‌روال را به حلقه رویداد داده‌شده ارسال کنید. ایمن در برابر نخ." -msgid "Return a :class:`concurrent.futures.Future` to wait for the result from another OS thread." +msgid "" +"Return a :class:`concurrent.futures.Future` to wait for the result from another " +"OS thread." msgstr "" +"یک :class:`concurrent.futures.Future` برمی‌گرداند تا بتوان از یک نخ سیستم‌عامل " +"دیگر منتظر نتیجه ماند." -msgid "This function is meant to be called from a different OS thread than the one where the event loop is running. Example::" +msgid "" +"This function is meant to be called from a different OS thread than the one " +"where the event loop is running. Example::" msgstr "" +"این تابع برای فراخوانی از یک نخ سیستم‌عامل متفاوت از نخی که حلقه رویداد در آن " +"اجرا می‌شود، در نظر گرفته شده است. مثال::" msgid "" "def in_thread(loop: asyncio.AbstractEventLoop) -> None:\n" " # Run some blocking IO\n" -" pathlib.Path(\"example.txt\").write_text(\"hello world\", encoding=\"utf8\")\n" +" pathlib.Path(\"example.txt\").write_text(\"hello world\", " +"encoding=\"utf8\")\n" "\n" " # Create a coroutine\n" " coro = asyncio.sleep(1, result=3)\n" @@ -936,9 +1856,29 @@ msgid "" " # Run something in a thread\n" " await asyncio.to_thread(in_thread, loop)" msgstr "" +"def in_thread(loop: asyncio.AbstractEventLoop) -> None:\n" +" # Run some blocking IO\n" +" pathlib.Path(\"example.txt\").write_text(\"hello world\", " +"encoding=\"utf8\")\n" +"\n" +" # Create a coroutine\n" +" coro = asyncio.sleep(1, result=3)\n" +"\n" +" # Submit the coroutine to a given loop\n" +" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +" # Wait for the result with an optional timeout argument\n" +" assert future.result(timeout=2) == 3\n" +"\n" +"async def amain() -> None:\n" +" # Get the running loop\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Run something in a thread\n" +" await asyncio.to_thread(in_thread, loop)" msgid "It's also possible to run the other way around. Example::" -msgstr "" +msgstr "همچنین می‌توان آن را به‌صورت معکوس اجرا کرد. مثال::" msgid "" "@contextlib.contextmanager\n" @@ -973,9 +1913,44 @@ msgid "" " # Wait for the result with an optional timeout argument\n" " assert future.result(timeout=2) == 3" msgstr "" +"@contextlib.contextmanager\n" +"def loop_in_thread() -> Generator[asyncio.AbstractEventLoop]:\n" +" loop_fut = concurrent.futures.Future[asyncio.AbstractEventLoop]()\n" +" stop_event = asyncio.Event()\n" +"\n" +" async def main() -> None:\n" +" loop_fut.set_result(asyncio.get_running_loop())\n" +" await stop_event.wait()\n" +"\n" +" with concurrent.futures.ThreadPoolExecutor(1) as tpe:\n" +" complete_fut = tpe.submit(asyncio.run, main())\n" +" for fut in concurrent.futures.as_completed((loop_fut, complete_fut)):\n" +" if fut is loop_fut:\n" +" loop = loop_fut.result()\n" +" try:\n" +" yield loop\n" +" finally:\n" +" loop.call_soon_threadsafe(stop_event.set)\n" +" else:\n" +" fut.result()\n" +"\n" +"# Create a loop in another thread\n" +"with loop_in_thread() as loop:\n" +" # Create a coroutine\n" +" coro = asyncio.sleep(1, result=3)\n" +"\n" +" # Submit the coroutine to a given loop\n" +" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +" # Wait for the result with an optional timeout argument\n" +" assert future.result(timeout=2) == 3" -msgid "If an exception is raised in the coroutine, the returned Future will be notified. It can also be used to cancel the task in the event loop::" +msgid "" +"If an exception is raised in the coroutine, the returned Future will be " +"notified. It can also be used to cancel the task in the event loop::" msgstr "" +"اگر در هم‌روال استثنایی پرتاب شود، به Future برگردانده‌شده اطلاع داده خواهد شد. " +"همچنین می‌توان از آن برای لغو وظیفه در حلقه رویداد استفاده کرد::" msgid "" "try:\n" @@ -988,189 +1963,378 @@ msgid "" "else:\n" " print(f'The coroutine returned: {result!r}')" msgstr "" +"try:\n" +" result = future.result(timeout)\n" +"except TimeoutError:\n" +" print('The coroutine took too long, cancelling the task...')\n" +" future.cancel()\n" +"except Exception as exc:\n" +" print(f'The coroutine raised an exception: {exc!r}')\n" +"else:\n" +" print(f'The coroutine returned: {result!r}')" -msgid "See the :ref:`concurrency and multithreading ` section of the documentation." +msgid "" +"See the :ref:`concurrency and multithreading ` section " +"of the documentation." msgstr "" +"بخش :ref:`همروندی و چندریسمانی ` مستندات را ببینید." -msgid "Unlike other asyncio functions this function requires the *loop* argument to be passed explicitly." +msgid "" +"Unlike other asyncio functions this function requires the *loop* argument to be " +"passed explicitly." msgstr "" +"برخلاف سایر توابع asyncio، این تابع نیاز دارد که آرگومان *loop* به‌صورت صریح " +"ارسال شود." msgid "Introspection" -msgstr "" +msgstr "درون‌نگری" -msgid "Return the currently running :class:`Task` instance, or ``None`` if no task is running." +msgid "" +"Return the currently running :class:`Task` instance, or ``None`` if no task is " +"running." msgstr "" +"نمونه‌ی در حال اجرای :class:`Task` را برمی‌گرداند، یا اگر هیچ وظیفه‌ایدر " +"حال اجرا نباشد، ``None`` را برمی‌گرداند." -msgid "If *loop* is ``None`` :func:`get_running_loop` is used to get the current loop." +msgid "" +"If *loop* is ``None`` :func:`get_running_loop` is used to get the current loop." msgstr "" +"اگر *loop* برابر ``None`` باشد، از :func:`get_running_loop` برای گرفتن حلقه جاری " +"استفاده می‌شود." msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" +"مجموعه‌ای از اشیاء :class:`Task` که هنوز تمام‌نشده‌اند و توسط حلقه اجرا می‌شوند را " +"برمی‌گرداند." -msgid "If *loop* is ``None``, :func:`get_running_loop` is used for getting current loop." +msgid "" +"If *loop* is ``None``, :func:`get_running_loop` is used for getting current loop." msgstr "" +"اگر *loop* برابر ``None`` باشد، برای گرفتن حلقه‌ی جاری از :func:`get_running_loop` " +"استفاده می‌شود." msgid "Return ``True`` if *obj* is a coroutine object." -msgstr "" +msgstr "اگر *obj* یک شیء هم‌روال باشد، ``True`` برمی‌گرداند." msgid "Task object" -msgstr "" +msgstr "شیء Task" -msgid "A :class:`Future-like ` object that runs a Python :ref:`coroutine `. Not thread-safe." +msgid "" +"A :class:`Future-like ` object that runs a Python :ref:`coroutine " +"`. Not thread-safe." msgstr "" +"یک شیء :class:`Future-مانند ` که یک :ref:`هم‌روال ` پایتون را " +"اجرا می‌کند. ایمن در برابر نخ نیست." -msgid "Tasks are used to run coroutines in event loops. If a coroutine awaits on a Future, the Task suspends the execution of the coroutine and waits for the completion of the Future. When the Future is *done*, the execution of the wrapped coroutine resumes." +msgid "" +"Tasks are used to run coroutines in event loops. If a coroutine awaits on a " +"Future, the Task suspends the execution of the coroutine and waits for the " +"completion of the Future. When the Future is *done*, the execution of the " +"wrapped coroutine resumes." msgstr "" +"از Taskها برای اجرای هم‌روال‌ها در حلقه‌های رویداد استفاده می‌شود. اگر یک هم‌روال روی " +"یک Future await کند، Task اجرای هم‌روال را معلق می‌کند و منتظر کامل شدن Future " +"می‌ماند. هنگامی که Future *انجام‌شده* باشد، اجرای هم‌روال دربرگرفته‌شده از سر گرفته " +"می‌شود." -msgid "Event loops use cooperative scheduling: an event loop runs one Task at a time. While a Task awaits for the completion of a Future, the event loop runs other Tasks, callbacks, or performs IO operations." +msgid "" +"Event loops use cooperative scheduling: an event loop runs one Task at a time. " +"While a Task awaits for the completion of a Future, the event loop runs other " +"Tasks, callbacks, or performs IO operations." msgstr "" +"حلقه‌های رویداد از زمان‌بندی مشارکتی استفاده می‌کنند: یک حلقه رویداد در هر زمان یک " +"Task را اجرا می‌کند. هنگامی که یک Task برای تکمیل شدن یک Future await می‌کند، حلقه " +"رویداد Taskهای دیگر و کال‌بک‌ها را اجرا می‌کند یا عملیات ورودی/خروجی انجام می‌دهد." -msgid "Use the high-level :func:`asyncio.create_task` function to create Tasks, or the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. Manual instantiation of Tasks is discouraged." +msgid "" +"Use the high-level :func:`asyncio.create_task` function to create Tasks, or the " +"low-level :meth:`loop.create_task` or :func:`ensure_future` functions. Manual " +"instantiation of Tasks is discouraged." msgstr "" +"برای ایجاد Taskها، از تابع سطح بالای :func:`asyncio.create_task` یا توابع سطح " +"پایین :meth:`loop.create_task` یا :func:`ensure_future` استفاده کنید. نمونه‌سازی " +"دستی Taskها توصیه نمی‌شود." -msgid "To cancel a running Task use the :meth:`cancel` method. Calling it will cause the Task to throw a :exc:`CancelledError` exception into the wrapped coroutine. If a coroutine is awaiting on a Future object during cancellation, the Future object will be cancelled." +msgid "" +"To cancel a running Task use the :meth:`cancel` method. Calling it will cause " +"the Task to throw a :exc:`CancelledError` exception into the wrapped coroutine. " +"If a coroutine is awaiting on a Future object during cancellation, the Future " +"object will be cancelled." msgstr "" +"برای لغو یک Task در حال اجرا، از متد :meth:`cancel` استفاده کنید. فراخوانی آن " +"موجب می‌شود که Task استثنای :exc:`CancelledError` را به درون هم‌روال پوشیده‌شده " +"پرتاب کند. اگر یک هم‌روال در حین لغو، روی یک شیء Future در حال await باشد، شیء " +"Future لغو خواهد شد." -msgid ":meth:`cancelled` can be used to check if the Task was cancelled. The method returns ``True`` if the wrapped coroutine did not suppress the :exc:`CancelledError` exception and was actually cancelled." +msgid "" +":meth:`cancelled` can be used to check if the Task was cancelled. The method " +"returns ``True`` if the wrapped coroutine did not suppress " +"the :exc:`CancelledError` exception and was actually cancelled." msgstr "" +"می‌توانید از :meth:`cancelled` برای بررسی این‌که Task لغو شده است یا خیر استفاده " +"کنید. اگر هم‌روال پوشیده‌شده استثنای :exc:`CancelledError` را سرکوب نکرده باشد و " +"واقعاً لغو شده باشد، این متد ``True`` برمی‌گرداند." -msgid ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :meth:`Future.set_result` and :meth:`Future.set_exception`." +msgid "" +":class:`asyncio.Task` inherits from :class:`Future` all of its APIs " +"except :meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" +":class:`asyncio.Task` از :class:`Future` همه‌ی APIهای آن را به ارث می‌برد، " +"به‌جز :meth:`Future.set_result` و :meth:`Future.set_exception`." -msgid "An optional keyword-only *context* argument allows specifying a custom :class:`contextvars.Context` for the *coro* to run in. If no *context* is provided, the Task copies the current context and later runs its coroutine in the copied context." +msgid "" +"An optional keyword-only *context* argument allows specifying a " +"custom :class:`contextvars.Context` for the *coro* to run in. If no *context* is " +"provided, the Task copies the current context and later runs its coroutine in " +"the copied context." msgstr "" +"یک آرگومان *context* اختیاری فقط کلیدواژه‌ای به شما امکان می‌دهد " +"یک :class:`contextvars.Context` سفارشی را برای اجرای *coro* در آن تعیین کنید. " +"اگر *context* ارائه نشود، Task زمینه جاری را کپی می‌کند و بعداً هم‌روال خود را در " +"زمینه کپی‌شده اجرا می‌کند." -msgid "An optional keyword-only *eager_start* argument allows eagerly starting the execution of the :class:`asyncio.Task` at task creation time. If set to ``True`` and the event loop is running, the task will start executing the coroutine immediately, until the first time the coroutine blocks. If the coroutine returns or raises without blocking, the task will be finished eagerly and will skip scheduling to the event loop." -msgstr "" +msgid "" +"An optional keyword-only *eager_start* argument allows eagerly starting the " +"execution of the :class:`asyncio.Task` at task creation time. If set to ``True`` " +"and the event loop is running, the task will start executing the coroutine " +"immediately, until the first time the coroutine blocks. If the coroutine returns " +"or raises without blocking, the task will be finished eagerly and will skip " +"scheduling to the event loop." +msgstr "" +"یک آرگومان اختیاری و فقط کلیدواژه‌ای به نام *eager_start* امکان شروع فوری " +"اجرای :class:`asyncio.Task` را در زمان ایجاد وظیفه فراهم می‌کند. اگر روی ``True`` " +"تنظیم شده باشد و حلقه رویداد در حال اجرا باشد، وظیفه اجرای هم‌روال را بلافاصله " +"آغاز می‌کند، تا نخستین باری که هم‌روال مسدود شود. اگر هم‌روال بدون مسدود شدن بازگشت " +"کند یا استثنایی پرتاب کند، وظیفه به‌صورت فوری به پایان می‌رسد و در حلقه رویداد " +"زمان‌بندی نمی‌شود." -msgid "Tasks are :ref:`generic ` over the return type of their wrapped coroutines." +msgid "" +"Tasks are :ref:`generic ` over the return type of their wrapped " +"coroutines." msgstr "" +"وظایف (Tasks) نسبت به نوع برگشتی هم‌روال‌های دربرگرفته‌شده‌ی خود :ref:`عام " +"` هستند." msgid "Added support for the :mod:`contextvars` module." -msgstr "" +msgstr "پشتیبانی از ماژول :mod:`contextvars` افزوده شد." -msgid "Deprecation warning is emitted if *loop* is not specified and there is no running event loop." +msgid "" +"Deprecation warning is emitted if *loop* is not specified and there is no " +"running event loop." msgstr "" +"اگر *loop* مشخص نشده باشد و هیچ حلقه رویدادی در حال اجرا وجود نداشته باشد، هشدار " +"منسوخ‌شدن صادر می‌شود." msgid "Added the *eager_start* parameter." -msgstr "" +msgstr "پارامتر *eager_start* اضافه شد." msgid "Return ``True`` if the Task is *done*." -msgstr "" +msgstr "اگر Task *انجام‌شده* باشد، ``True`` را برمی‌گرداند." -msgid "A Task is *done* when the wrapped coroutine either returned a value, raised an exception, or the Task was cancelled." +msgid "" +"A Task is *done* when the wrapped coroutine either returned a value, raised an " +"exception, or the Task was cancelled." msgstr "" +"یک وظیفهزمانی *انجام‌شده* است که هم‌روال دربرگرفته‌شده‌ی آن، یا مقداری را " +"برگردانده باشد، یا استثنایی را پرتاب کرده باشد، یا آن وظیفه لغو شده باشد." msgid "Return the result of the Task." -msgstr "" +msgstr "نتیجه‌ی Task را برمی‌گرداند." -msgid "If the Task is *done*, the result of the wrapped coroutine is returned (or if the coroutine raised an exception, that exception is re-raised.)" +msgid "" +"If the Task is *done*, the result of the wrapped coroutine is returned (or if " +"the coroutine raised an exception, that exception is re-raised.)" msgstr "" +"اگر Task *انجام‌شده* باشد، نتیجه هم‌روال پوشیده‌شده برگردانده می‌شود (یا اگر هم‌روال " +"استثنایی را پرتاب کرده باشد، آن استثنا دوباره پرتاب می‌شود.)" -msgid "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` exception." +msgid "" +"If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " +"exception." msgstr "" +"اگر Task *لغوشده* باشد، این متد استثنای :exc:`CancelledError` را پرتاب می‌کند." -msgid "If the Task's result isn't yet available, this method raises an :exc:`InvalidStateError` exception." +msgid "" +"If the Task's result isn't yet available, this method raises " +"an :exc:`InvalidStateError` exception." msgstr "" +"اگر نتیجه‌ی Task هنوز در دسترس نباشد، این متد یک استثنای :exc:`InvalidStateError` " +"پرتاب می‌کند." msgid "Return the exception of the Task." -msgstr "" +msgstr "استثنای Task را برمی‌گرداند." -msgid "If the wrapped coroutine raised an exception that exception is returned. If the wrapped coroutine returned normally this method returns ``None``." +msgid "" +"If the wrapped coroutine raised an exception that exception is returned. If the " +"wrapped coroutine returned normally this method returns ``None``." msgstr "" +"اگر هم‌روال پوشیده‌شده استثنایی پرتاب کرد، آن استثنا برگردانده می‌شود. اگر هم‌روال " +"پوشیده‌شده به‌طور عادی بازگشت کرد، این متد ``None`` را برمی‌گرداند." -msgid "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` exception." +msgid "" +"If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " +"exception." msgstr "" +"اگر Task هنوز *انجام‌شده* نباشد، این متد استثنای :exc:`InvalidStateError` را " +"پرتاب می‌کند." msgid "Add a callback to be run when the Task is *done*." -msgstr "" +msgstr "یک کال‌بک اضافه کنید تا هنگامی که Task *انجام‌شده* باشد اجرا شود." msgid "This method should only be used in low-level callback-based code." -msgstr "" +msgstr "این متد تنها باید در کد سطح پایین مبتنی بر کال‌بک استفاده شود." msgid "See the documentation of :meth:`Future.add_done_callback` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر، مستندات :meth:`Future.add_done_callback` را ببینید." msgid "Remove *callback* from the callbacks list." -msgstr "" +msgstr "*callback* را از فهرست کال‌بک‌ها حذف کنید." -msgid "See the documentation of :meth:`Future.remove_done_callback` for more details." +msgid "" +"See the documentation of :meth:`Future.remove_done_callback` for more details." msgstr "" +"برای جزئیات بیشتر، به مستندات :meth:`Future.remove_done_callback` مراجعه کنید." msgid "Return the list of stack frames for this Task." -msgstr "" +msgstr "فهرست فریم‌های پشته (stack frames) برای این Task را برمی‌گرداند." -msgid "If the wrapped coroutine is not done, this returns the stack where it is suspended. If the coroutine has completed successfully or was cancelled, this returns an empty list. If the coroutine was terminated by an exception, this returns the list of traceback frames." +msgid "" +"If the wrapped coroutine is not done, this returns the stack where it is " +"suspended. If the coroutine has completed successfully or was cancelled, this " +"returns an empty list. If the coroutine was terminated by an exception, this " +"returns the list of traceback frames." msgstr "" +"اگر هم‌روال دربرگرفته‌شده انجام‌نشده باشد، پشته‌ای که در آن معلق است برگردانده " +"می‌شود. اگر هم‌روال با موفقیت به پایان رسیده باشد یا لغو شده باشد، یک فهرست خالی " +"برگردانده می‌شود. اگر هم‌روال با یک استثنا خاتمه یافته باشد، فهرست فریم‌های ردگیری " +"پشته برگردانده می‌شود." msgid "The frames are always ordered from oldest to newest." -msgstr "" +msgstr "فریم‌ها همیشه از قدیمی‌ترین به جدیدترین مرتب شده‌اند." msgid "Only one stack frame is returned for a suspended coroutine." -msgstr "" +msgstr "تنها یک فریم پشته برای یک هم‌روال تعلیق‌شده برگردانده می‌شود." -msgid "The optional *limit* argument sets the maximum number of frames to return; by default all available frames are returned. The ordering of the returned list differs depending on whether a stack or a traceback is returned: the newest frames of a stack are returned, but the oldest frames of a traceback are returned. (This matches the behavior of the traceback module.)" -msgstr "" +msgid "" +"The optional *limit* argument sets the maximum number of frames to return; by " +"default all available frames are returned. The ordering of the returned list " +"differs depending on whether a stack or a traceback is returned: the newest " +"frames of a stack are returned, but the oldest frames of a traceback are " +"returned. (This matches the behavior of the traceback module.)" +msgstr "" +"آرگومان اختیاری *limit* حداکثر تعداد فریم‌های بازگشتی را تنظیم می‌کند؛ به‌طور " +"پیش‌فرض همه‌ی فریم‌های موجود بازگردانده می‌شوند. ترتیب فهرست بازگشتی بسته به این‌که یک " +"پشته یا یک ردگیری بازگردانده شود، متفاوت است: جدیدترین فریم‌های یک پشته " +"بازگردانده می‌شوند، اما قدیمی‌ترین فریم‌های یک ردگیری بازگردانده می‌شوند. (این با " +"رفتار ماژول traceback مطابقت دارد.)" msgid "Print the stack or traceback for this Task." -msgstr "" +msgstr "پشته یا ردگیری پشته‌ی این Task را چاپ می‌کند." -msgid "This produces output similar to that of the traceback module for the frames retrieved by :meth:`get_stack`." +msgid "" +"This produces output similar to that of the traceback module for the frames " +"retrieved by :meth:`get_stack`." msgstr "" +"این، خروجی مشابهی با خروجی ماژول traceback برای فریم‌های بازیابی‌شده " +"توسط :meth:`get_stack` تولید می‌کند." msgid "The *limit* argument is passed to :meth:`get_stack` directly." -msgstr "" +msgstr "آرگومان *limit* مستقیماً به :meth:`get_stack` ارسال می‌شود." -msgid "The *file* argument is an I/O stream to which the output is written; by default output is written to :data:`sys.stdout`." +msgid "" +"The *file* argument is an I/O stream to which the output is written; by default " +"output is written to :data:`sys.stdout`." msgstr "" +"آرگومان *file* یک جریان ورودی/خروجی است که خروجی به آن نوشته می‌شود؛ به‌طور پیش‌فرض " +"خروجی به :data:`sys.stdout` نوشته می‌شود." msgid "Return the coroutine object wrapped by the :class:`Task`." -msgstr "" +msgstr "شیء هم‌روالِ دربرگرفته‌شده توسط :class:`Task` را برمی‌گرداند." -msgid "This will return ``None`` for Tasks which have already completed eagerly. See the :ref:`Eager Task Factory `." +msgid "" +"This will return ``None`` for Tasks which have already completed eagerly. See " +"the :ref:`Eager Task Factory `." msgstr "" +"این ``None`` را برای Taskهایی که از قبل به‌صورت حریصانه کامل شده‌اند، " +"بازمی‌گرداند. :ref:`Eager Task Factory ` را ببینید." msgid "Newly added eager task execution means result may be ``None``." msgstr "" +"اجرای مشتاقانه‌ی وظیفه (eager task execution) که به‌تازگی اضافه‌شده است، به این معناست " +"که نتیجه ممکن است ``None`` باشد." msgid "Return the :class:`contextvars.Context` object associated with the task." -msgstr "" +msgstr "شیء :class:`contextvars.Context` مرتبط با وظیفهرا برمی‌گرداند." msgid "Return the name of the Task." -msgstr "" +msgstr "نام Task را برمی‌گرداند." -msgid "If no name has been explicitly assigned to the Task, the default asyncio Task implementation generates a default name during instantiation." +msgid "" +"If no name has been explicitly assigned to the Task, the default asyncio Task " +"implementation generates a default name during instantiation." msgstr "" +"اگر نامی به‌طور صریح به Task اختصاص داده نشده باشد، پیاده‌سازی پیش‌فرض Task در " +"asyncio، در هنگام نمونه‌سازی یک نام پیش‌فرض تولید می‌کند." msgid "Set the name of the Task." -msgstr "" +msgstr "نام Task را تنظیم کنید." -msgid "The *value* argument can be any object, which is then converted to a string." -msgstr "" +msgid "" +"The *value* argument can be any object, which is then converted to a string." +msgstr "آرگومان *value* می‌تواند هر شیء‌ای باشد که سپس به رشته تبدیل می‌شود." -msgid "In the default Task implementation, the name will be visible in the :func:`repr` output of a task object." +msgid "" +"In the default Task implementation, the name will be visible in the :func:`repr` " +"output of a task object." msgstr "" +"در پیاده‌سازی پیش‌فرض Task، نام در خروجی :func:`repr` یک شیء task قابل مشاهده " +"خواهد بود." msgid "Request the Task to be cancelled." -msgstr "" +msgstr "درخواست لغو Task را بدهید." -msgid "If the Task is already *done* or *cancelled*, return ``False``, otherwise, return ``True``." +msgid "" +"If the Task is already *done* or *cancelled*, return ``False``, otherwise, " +"return ``True``." msgstr "" +"اگر Task از پیش *انجام‌شده* یا *لغوشده* باشد، ``False`` را برمی‌گرداند، در غیر این " +"صورت ``True`` را برمی‌گرداند." -msgid "The method arranges for a :exc:`CancelledError` exception to be thrown into the wrapped coroutine on the next cycle of the event loop." +msgid "" +"The method arranges for a :exc:`CancelledError` exception to be thrown into the " +"wrapped coroutine on the next cycle of the event loop." msgstr "" +"این متد ترتیبی می‌دهد که استثنای :exc:`CancelledError` در چرخه‌ی بعدی حلقه‌ی رویداد " +"به هم‌روال پوشیده‌شده پرتاب شود." -msgid "The coroutine then has a chance to clean up or even deny the request by suppressing the exception with a :keyword:`try` ... ... ``except CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will be cancelled, although suppressing cancellation completely is not common and is actively discouraged. Should the coroutine nevertheless decide to suppress the cancellation, it needs to call :meth:`Task.uncancel` in addition to catching the exception." -msgstr "" +msgid "" +"The coroutine then has a chance to clean up or even deny the request by " +"suppressing the exception with a :keyword:`try` ... ... ``except " +"CancelledError`` ... :keyword:`finally` block. Therefore, " +"unlike :meth:`Future.cancel`, :meth:`Task.cancel` does not guarantee that the " +"Task will be cancelled, although suppressing cancellation completely is not " +"common and is actively discouraged. Should the coroutine nevertheless decide to " +"suppress the cancellation, it needs to call :meth:`Task.uncancel` in addition to " +"catching the exception." +msgstr "" +"سپس هم‌روال این فرصت را دارد که پاک‌سازی کند یا حتی با مهار استثنا از طریق یک " +"بلوک :keyword:`try` ... ... ``except CancelledError`` ... :keyword:`finally`، " +"درخواست را رد کند. بنابراین، برخلاف :meth:`Future.cancel`، :meth:`Task.cancel` " +"تضمین نمی‌کند که Task لغو شود، اگرچه مهار کامل لغو رایج نیست و به‌طور فعال نهی شده " +"است. اگر هم‌روال با این حال تصمیم بگیرد لغو را مهار کند، باید علاوه بر گرفتن " +"استثنا، :meth:`Task.uncancel` را نیز فراخوانی کند." msgid "Added the *msg* parameter." -msgstr "" +msgstr "پارامتر *msg* اضافه شد." msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." -msgstr "" +msgstr "پارامتر ``msg`` از وظیفه لغوشده به awaitکننده‌ی آن منتقل می‌شود." -msgid "The following example illustrates how coroutines can intercept the cancellation request::" +msgid "" +"The following example illustrates how coroutines can intercept the cancellation " +"request::" msgstr "" +"مثال زیر نشان می‌دهد که هم‌روال‌ها چگونه می‌توانند درخواست لغو را رهگیری کنند::" msgid "" "async def cancel_me():\n" @@ -1207,24 +2371,77 @@ msgid "" "# cancel_me(): after sleep\n" "# main(): cancel_me is cancelled now" msgstr "" +"async def cancel_me():\n" +" print('cancel_me(): before sleep')\n" +"\n" +" try:\n" +" # Wait for 1 hour\n" +" await asyncio.sleep(3600)\n" +" except asyncio.CancelledError:\n" +" print('cancel_me(): cancel sleep')\n" +" raise\n" +" finally:\n" +" print('cancel_me(): after sleep')\n" +"\n" +"async def main():\n" +" # Create a \"cancel_me\" Task\n" +" task = asyncio.create_task(cancel_me())\n" +"\n" +" # Wait for 1 second\n" +" await asyncio.sleep(1)\n" +"\n" +" task.cancel()\n" +" try:\n" +" await task\n" +" except asyncio.CancelledError:\n" +" print(\"main(): cancel_me is cancelled now\")\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# cancel_me(): before sleep\n" +"# cancel_me(): cancel sleep\n" +"# cancel_me(): after sleep\n" +"# main(): cancel_me is cancelled now" msgid "Return ``True`` if the Task is *cancelled*." -msgstr "" +msgstr "اگر Task *لغوشده* باشد، ``True`` را برمی‌گرداند." -msgid "The Task is *cancelled* when the cancellation was requested with :meth:`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` exception thrown into it." +msgid "" +"The Task is *cancelled* when the cancellation was requested with :meth:`cancel` " +"and the wrapped coroutine propagated the :exc:`CancelledError` exception thrown " +"into it." msgstr "" +"Task زمانی *لغو می‌شود* که لغو با :meth:`cancel` درخواست شده باشد و هم‌روال " +"دربرگرفته‌شده، استثنای :exc:`CancelledError` پرتاب‌شده به درون آن را منتشر کرده " +"باشد." msgid "Decrement the count of cancellation requests to this Task." -msgstr "" +msgstr "شمار درخواست‌های لغو برای این Task را کاهش می‌دهد." msgid "Returns the remaining number of cancellation requests." -msgstr "" +msgstr "تعداد باقی‌مانده‌ی درخواست‌های لغو را برمی‌گرداند." -msgid "Note that once execution of a cancelled task completed, further calls to :meth:`uncancel` are ineffective." +msgid "" +"Note that once execution of a cancelled task completed, further calls " +"to :meth:`uncancel` are ineffective." msgstr "" +"توجه داشته باشید که پس از کامل شدن اجرای یک وظیفه‌ی لغوشده، فراخوانی‌های " +"بعدی :meth:`uncancel` بی‌اثر خواهند بود." -msgid "This method is used by asyncio's internals and isn't expected to be used by end-user code. In particular, if a Task gets successfully uncancelled, this allows for elements of structured concurrency like :ref:`taskgroups` and :func:`asyncio.timeout` to continue running, isolating cancellation to the respective structured block. For example::" -msgstr "" +msgid "" +"This method is used by asyncio's internals and isn't expected to be used by end-" +"user code. In particular, if a Task gets successfully uncancelled, this allows " +"for elements of structured concurrency like :ref:`taskgroups` " +"and :func:`asyncio.timeout` to continue running, isolating cancellation to the " +"respective structured block. For example::" +msgstr "" +"این متد توسط بخش‌های داخلی asyncio استفاده می‌شود و انتظار نمی‌رود توسط کد کاربر " +"نهایی استفاده شود. به‌ویژه، اگر یک Task با موفقیت از حالت لغو خارج شود، این امر " +"به عناصر همروندی ساختاریافته (structured concurrency) مانند :ref:`taskgroups` " +"و :func:`asyncio.timeout` اجازه می‌دهد به اجرای خود ادامه دهند و لغو را به بلوک " +"ساختاریافته مربوطه محدود کنند. برای مثال::" msgid "" "async def make_request_with_timeout():\n" @@ -1238,24 +2455,73 @@ msgid "" " # Outer code not affected by the timeout:\n" " await unrelated_code()" msgstr "" +"async def make_request_with_timeout():\n" +" try:\n" +" async with asyncio.timeout(1):\n" +" # Structured block affected by the timeout:\n" +" await make_request()\n" +" await make_another_request()\n" +" except TimeoutError:\n" +" log(\"There was a timeout\")\n" +" # Outer code not affected by the timeout:\n" +" await unrelated_code()" -msgid "While the block with ``make_request()`` and ``make_another_request()`` might get cancelled due to the timeout, ``unrelated_code()`` should continue running even in case of the timeout. This is implemented with :meth:`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` in a similar fashion." -msgstr "" +msgid "" +"While the block with ``make_request()`` and ``make_another_request()`` might get " +"cancelled due to the timeout, ``unrelated_code()`` should continue running even " +"in case of the timeout. This is implemented " +"with :meth:`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` " +"in a similar fashion." +msgstr "" +"در حالی که ممکن است بلوک حاوی ``make_request()`` و ``make_another_request()`` به " +"دلیل مهلت زمانی (timeout) لغو شود، ``unrelated_code()`` باید حتی در صورت وقوع " +"مهلت زمانی (timeout) به اجرای خود ادامه دهد. این کار با :meth:`uncancel` پیاده‌سازی " +"شده است. مدیران زمینه :class:`TaskGroup` از :func:`uncancel` به شیوه‌ای مشابه " +"استفاده می‌کنند." -msgid "If end-user code is, for some reason, suppressing cancellation by catching :exc:`CancelledError`, it needs to call this method to remove the cancellation state." +msgid "" +"If end-user code is, for some reason, suppressing cancellation by " +"catching :exc:`CancelledError`, it needs to call this method to remove the " +"cancellation state." msgstr "" +"اگر کد کاربر نهایی به هر دلیلی با گرفتن :exc:`CancelledError` لغو را مهار می‌کند، " +"باید این متد را فراخوانی کند تا وضعیت لغو را حذف کند." -msgid "When this method decrements the cancellation count to zero, the method checks if a previous :meth:`cancel` call had arranged for :exc:`CancelledError` to be thrown into the task. If it hasn't been thrown yet, that arrangement will be rescinded (by resetting the internal ``_must_cancel`` flag)." +msgid "" +"When this method decrements the cancellation count to zero, the method checks if " +"a previous :meth:`cancel` call had arranged for :exc:`CancelledError` to be " +"thrown into the task. If it hasn't been thrown yet, that arrangement will be " +"rescinded (by resetting the internal ``_must_cancel`` flag)." msgstr "" +"هنگامی که این متد شمار لغو را به صفر کاهش می‌دهد، متد بررسی می‌کند که آیا یک " +"فراخوانی پیشین :meth:`cancel` ترتیبی برای پرتاب :exc:`CancelledError` به درون " +"وظیفهداده بود یا خیر. اگر هنوز پرتاب نشده باشد، آن ترتیب لغو خواهد شد (با " +"بازنشانی پرچم داخلی ``_must_cancel``)." msgid "Changed to rescind pending cancellation requests upon reaching zero." -msgstr "" +msgstr "تغییر کرد تا درخواست‌های لغو در انتظار، پس از رسیدن به صفر پس گرفته شوند." -msgid "Return the number of pending cancellation requests to this Task, i.e., the number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." +msgid "" +"Return the number of pending cancellation requests to this Task, i.e., the " +"number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" +"تعداد درخواست‌های لغو در انتظار برای این Task را برمی‌گرداند، یعنی تعداد " +"فراخوانی‌های :meth:`cancel` منهای تعداد فراخوانی‌های :meth:`uncancel`." -msgid "Note that if this number is greater than zero but the Task is still executing, :meth:`cancelled` will still return ``False``. This is because this number can be lowered by calling :meth:`uncancel`, which can lead to the task not being cancelled after all if the cancellation requests go down to zero." +msgid "" +"Note that if this number is greater than zero but the Task is still " +"executing, :meth:`cancelled` will still return ``False``. This is because this " +"number can be lowered by calling :meth:`uncancel`, which can lead to the task " +"not being cancelled after all if the cancellation requests go down to zero." msgstr "" +"توجه داشته باشید که اگر این عدد بزرگ‌تر از صفر باشد اما Task هنوز در حال اجرا " +"باشد، :meth:`cancelled` همچنان ``False`` را برمی‌گرداند. این به این دلیل است که " +"این عدد می‌تواند با فراخوانی :meth:`uncancel` کاهش یابد، که اگر درخواست‌های لغو به " +"صفر برسند، ممکن است در نهایت منجر به لغو نشدن Task شود." -msgid "This method is used by asyncio's internals and isn't expected to be used by end-user code. See :meth:`uncancel` for more details." +msgid "" +"This method is used by asyncio's internals and isn't expected to be used by end-" +"user code. See :meth:`uncancel` for more details." msgstr "" +"این متد توسط اجزای داخلی asyncio استفاده می‌شود و انتظار نمی‌رود که توسط کد کاربر " +"نهایی استفاده شود. برای جزئیات بیشتر :meth:`uncancel` را ببینید." diff --git a/library/asyncio-threading.po b/library/asyncio-threading.po index 989c77de1..9d9715bc7 100644 --- a/library/asyncio-threading.po +++ b/library/asyncio-threading.po @@ -20,49 +20,145 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "asyncio and free-threaded Python" -msgstr "" +msgstr "asyncio و پایتون نخ‌آزاد " -msgid "asyncio uses an event loop as a scheduler to enable highly efficient concurrency by switching between tasks to allow non-blocking I/O operations. This results in better performance for I/O-bound use cases. It also allows off-loading CPU-bound work to a thread or process pool, but that is still limited by the :term:`global interpreter lock` in CPython." +msgid "" +"asyncio uses an event loop as a scheduler to enable highly efficient " +"concurrency by switching between tasks to allow non-blocking I/O operations." +" This results in better performance for I/O-bound use cases. It also allows " +"off-loading CPU-bound work to a thread or process pool, but that is still " +"limited by the :term:`global interpreter lock` in CPython." msgstr "" +"asyncio از یک حلقه رویداد به‌عنوان زمان‌بند استفاده می‌کند تا با جابه‌جایی " +"بین وظایف و امکان‌پذیر ساختن عملیات ورودی/خروجی غیرمسدودکننده، هم‌روندی " +"بسیار کارآمدی را فراهم کند. این امر باعث عملکرد بهتر در موارد استفاده محدود " +"به ورودی/خروجی می‌شود. همچنین امکان واگذاری کارهای محدود به CPU به یک استخر " +"نخ یا فرایند را فراهم می‌کند، اما این کار در CPython همچنان محدود به " +":term:`قفل سراسری مفسر ` است." -msgid "However, in :ref:`free-threaded Python `, the GIL is disabled and Python can run true multi-threaded code. This means that asyncio can now take advantage of multiple CPU cores without the limitations imposed by the GIL." +msgid "" +"However, in :ref:`free-threaded Python `, the " +"GIL is disabled and Python can run true multi-threaded code. This means that" +" asyncio can now take advantage of multiple CPU cores without the " +"limitations imposed by the GIL." msgstr "" +"با این حال، در :ref:`free-threaded Python `، GIL" +" غیرفعال است و پایتون می‌تواند کد چندنخی واقعی را اجرا کند. این بدان معناست" +" که asyncio اکنون می‌تواند از چندین هسته CPU بدون محدودیت‌های اعمال‌شده توسط" +" GIL بهره ببرد." -msgid "Since Python 3.14, asyncio has first-class support for free-threaded Python, and the implementation of asyncio is safe to use in a multi-threaded environment." +msgid "" +"Since Python 3.14, asyncio has first-class support for free-threaded Python," +" and the implementation of asyncio is safe to use in a multi-threaded " +"environment." msgstr "" +"از پایتون 3.14 به بعد، asyncio از پایتون آزادنخیپشتیبانی " +"درجه‌یک دارد و پیاده‌سازی asyncio برای استفاده در محیط چندنخی ایمن است." -msgid "A single event loop on one core can handle many connections concurrently, but the Python code that runs to handle each one still executes serially. Once requests involve a non-trivial amount of per-request computation, that handling becomes the bottleneck, and a single core can no longer keep up. Combining asyncio with threads is most useful here: by running an event loop per thread, the handling of different requests can run in parallel across multiple CPU cores. It is also useful when you need to run blocking or CPU-bound code from an asyncio application." +msgid "" +"A single event loop on one core can handle many connections concurrently, " +"but the Python code that runs to handle each one still executes serially. " +"Once requests involve a non-trivial amount of per-request computation, that " +"handling becomes the bottleneck, and a single core can no longer keep up. " +"Combining asyncio with threads is most useful here: by running an event loop" +" per thread, the handling of different requests can run in parallel across " +"multiple CPU cores. It is also useful when you need to run blocking or CPU-" +"bound code from an asyncio application." msgstr "" +"یک حلقه رویداد واحد روی یک هسته می‌تواند اتصال‌های زیادی را به‌طور همروند " +"مدیریت کند، اما کد پایتونی که برای مدیریت هر یک اجرا می‌شود همچنان به‌صورت " +"متوالی اجرا می‌شود. هنگامی که درخواست‌ها شامل مقدار قابل‌توجهی محاسبه " +"به‌ازای هر درخواست شوند، مدیریت آن‌ها به گلوگاه تبدیل می‌شود و یک هسته دیگر " +"نمی‌تواند پاسخگو باشد. ترکیب asyncio با نخ‌ها در اینجا بیشترین کاربرد را " +"دارد: با اجرای یک حلقه رویداد به‌ازای هر نخ، مدیریت درخواست‌های مختلف " +"می‌تواند به‌صورت موازی روی چندین هسته CPU اجرا شود. همچنین زمانی که نیاز " +"دارید کد مسدودکننده یا محدود به CPU را از یک برنامه asyncio اجرا کنید، مفید " +"است." -msgid "`Scaling asyncio on Free-Threaded Python `__, a blog post by Kumar Aditya which explains the internal changes that make asyncio safe and efficient under free-threaded Python, together with benchmarks of the resulting improvements." +msgid "" +"`Scaling asyncio on Free-Threaded Python " +"`__, a blog post by Kumar Aditya which explains the internal changes " +"that make asyncio safe and efficient under free-threaded Python, together " +"with benchmarks of the resulting improvements." msgstr "" +"`Scaling asyncio on Free-Threaded Python " +"`__، یک پست وبگزارشی از Kumar Aditya که تغییرات داخلی‌ای را توضیح " +"می‌دهد که باعث ایمن و کارآمد شدن asyncio در پایتون نخ‌آزادی (Free-Threaded " +"Python) می‌شوند، به‌همراه بنچمارک‌هایی از بهبودهای حاصل." msgid "Thread safety considerations" -msgstr "" +msgstr "ملاحظات ایمنی نخ‌ها" -msgid "While asyncio is designed to be thread-safe in a free-threaded Python environment, there are still some considerations to keep in mind when using asyncio with threads:" +msgid "" +"While asyncio is designed to be thread-safe in a free-threaded Python " +"environment, there are still some considerations to keep in mind when using " +"asyncio with threads:" msgstr "" +"هرچند asyncio به‌گونه‌ای طراحی شده است که در یک محیط پایتون آزادنخ (free-" +"threaded) امن از نظر نخ‌ها (thread-safe) باشد، اما همچنان هنگام استفاده از " +"asyncio با نخ‌ها ملاحظاتی وجود دارد که باید آن‌ها را در نظر داشته باشید:" -msgid "**Event loop**: Each thread should have its own event loop which should not be shared across threads. This ensures that the event loop can manage its own tasks and callbacks without interference from other threads." +msgid "" +"**Event loop**: Each thread should have its own event loop which should not " +"be shared across threads. This ensures that the event loop can manage its " +"own tasks and callbacks without interference from other threads." msgstr "" +"**حلقه رویداد**: هر نخ باید حلقه رویداد مخصوص به خود را داشته باشد که نباید " +"بین نخ‌ها به اشتراک گذاشته شود. این امر تضمین می‌کند که حلقه رویداد می‌تواند" +" وظایف و کال‌بک‌های خود را بدون تداخل از سوی نخ‌های دیگر مدیریت کند." -msgid "**Task management**: Tasks and futures created in one thread should not be awaited or manipulated from another thread." +msgid "" +"**Task management**: Tasks and futures created in one thread should not be " +"awaited or manipulated from another thread." msgstr "" +"**مدیریت وظیفه**: وظایف (Tasks) و آینده‌نماها (futures) ایجادشده در یک نخ" +" نباید از نخی دیگر await شوند یا دستکاری شوند." -msgid "**Thread-safe APIs**: When interacting with asyncio from multiple threads, it's important to use thread-safe APIs provided by asyncio, such as :func:`asyncio.run_coroutine_threadsafe` for submitting coroutines to an event loop from another thread. If you need to call a callback from a different thread, you can use :meth:`loop.call_soon_threadsafe` to schedule it safely." +msgid "" +"**Thread-safe APIs**: When interacting with asyncio from multiple threads, " +"it's important to use thread-safe APIs provided by asyncio, such as " +":func:`asyncio.run_coroutine_threadsafe` for submitting coroutines to an " +"event loop from another thread. If you need to call a callback from a " +"different thread, you can use :meth:`loop.call_soon_threadsafe` to schedule " +"it safely." msgstr "" +"**APIهای ایمن برای نخ**: هنگام تعامل با asyncio از چندین نخ، مهم است که از " +"APIهای ایمن برای نخ ارائه‌شده توسط asyncio استفاده کنید، مانند " +":func:`asyncio.run_coroutine_threadsafe` برای ارسال هم‌روال‌ها به یک حلقه " +"رویداد از یک نخ دیگر. اگر نیاز دارید یک کال‌بک را از یک نخ متفاوت فراخوانی " +"کنید، می‌توانید از :meth:`loop.call_soon_threadsafe` برای زمان‌بندی ایمن آن " +"استفاده کنید." -msgid "**Synchronization**: The synchronization primitives provided by asyncio (like :class:`asyncio.Lock` and :class:`asyncio.Event`) are not designed to be used across threads. If you need to synchronize between threads, you should use the synchronization primitives from the :mod:`threading` module instead." +msgid "" +"**Synchronization**: The synchronization primitives provided by asyncio " +"(like :class:`asyncio.Lock` and :class:`asyncio.Event`) are not designed to " +"be used across threads. If you need to synchronize between threads, you " +"should use the synchronization primitives from the :mod:`threading` module " +"instead." msgstr "" +"**همگام‌سازی**: ابزارهای همگام‌سازی ارائه‌شده توسط asyncio (مانند " +":class:`asyncio.Lock` و :class:`asyncio.Event`) برای استفاده در میان نخ‌ها " +"طراحی نشده‌اند. اگر نیاز به همگام‌سازی بین نخ‌ها دارید، باید به‌جای آن از " +"ابزارهای همگام‌سازی ماژول :mod:`threading` استفاده کنید." msgid "Using asyncio with threads" -msgstr "" +msgstr "استفاده از asyncio با نخ‌ها" -msgid "asyncio supports running one event loop per thread, which allows you to take advantage of multiple CPU cores in a free-threaded Python environment. Each thread can run its own event loop, and tasks can be scheduled on those loops independently." +msgid "" +"asyncio supports running one event loop per thread, which allows you to take" +" advantage of multiple CPU cores in a free-threaded Python environment. Each" +" thread can run its own event loop, and tasks can be scheduled on those " +"loops independently." msgstr "" +"asyncio از اجرای یک حلقه رویداد به ازای هر نخ پشتیبانی می‌کند، که به شما " +"امکان می‌دهد در یک محیط پایتون نخ‌آزادی از چندین هسته CPU " +"بهره ببرید. هر نخ می‌تواند حلقه رویداد خود را اجرا کند، و وظایف می‌توانند " +"به‌طور مستقل روی آن حلقه‌ها زمان‌بندی شوند." msgid "Here's an example of how to use asyncio with threads::" -msgstr "" +msgstr "در اینجا مثالی از نحوه‌ی استفاده از asyncio با نخ‌ها آمده است::" msgid "" "import asyncio\n" @@ -85,15 +181,50 @@ msgid "" "for t in threads:\n" " t.join()" msgstr "" +"import asyncio\n" +"import threading\n" +"\n" +"async def worker(name: str) -> None:\n" +" print(f\"Worker {name} starting\")\n" +" await asyncio.sleep(1)\n" +" print(f\"Worker {name} done\")\n" +"\n" +"def run_loop(name: str) -> None:\n" +" asyncio.run(worker(name))\n" +"\n" +"threads = [\n" +" threading.Thread(target=run_loop, args=(f\"T{i}\",))\n" +" for i in range(4)\n" +"]\n" +"for t in threads:\n" +" t.start()\n" +"for t in threads:\n" +" t.join()" -msgid "In this example, each thread creates its own event loop with :func:`asyncio.run` and runs a coroutine on it. The threads execute concurrently, and in a free-threaded build they can run on separate CPU cores in parallel." +msgid "" +"In this example, each thread creates its own event loop with " +":func:`asyncio.run` and runs a coroutine on it. The threads execute " +"concurrently, and in a free-threaded build they can run on separate CPU " +"cores in parallel." msgstr "" +"در این مثال، هر نخ حلقه رویداد خود را با :func:`asyncio.run` ایجاد می‌کند و " +"یک هم‌روال را روی آن اجرا می‌کند. نخ‌ها به‌طور همزمان اجرا می‌شوند و در یک " +"ساخت آزادنخ (free-threaded build) می‌توانند روی هسته‌های جداگانه‌ی CPU " +"به‌صورت موازی اجرا شوند." msgid "Producer/consumer across threads" -msgstr "" +msgstr "تولیدکننده/مصرف‌کننده بین نخ‌ها" -msgid "When a regular (non-asyncio) thread needs to hand work to an asyncio event loop running in another thread, use a thread-safe primitive such as :class:`queue.Queue` rather than :class:`asyncio.Queue`, which is only safe within a single event loop.::" +msgid "" +"When a regular (non-asyncio) thread needs to hand work to an asyncio event " +"loop running in another thread, use a thread-safe primitive such as " +":class:`queue.Queue` rather than :class:`asyncio.Queue`, which is only safe " +"within a single event loop.::" msgstr "" +"هنگامی که یک نخ معمولی (غیر asyncio) نیاز دارد کاری را به یک حلقه‌ی رویداد " +"asyncio که در نخ دیگری اجرا می‌شود بسپارد، از یک سازوکار اولیه‌ی ایمن برای نخ" +" مانند :class:`queue.Queue` استفاده کنید، نه از :class:`asyncio.Queue`، که " +"فقط درون یک حلقه‌ی رویداد واحد ایمن است.::" msgid "" "import asyncio\n" @@ -126,6 +257,50 @@ msgid "" "producer(q)\n" "consumer_thread.join()" msgstr "" +"import asyncio\n" +"import queue\n" +"import threading\n" +"\n" +"def producer(q: queue.Queue[int]) -> None:\n" +" for i in range(5):\n" +" print(f\"Producing {i}\")\n" +" q.put(i)\n" +" q.shutdown()\n" +"\n" +"async def consumer(q: queue.Queue[int]) -> None:\n" +" while True:\n" +" try:\n" +" item = q.get_nowait()\n" +" except queue.Empty:\n" +" await asyncio.sleep(0.1)\n" +" continue\n" +" except queue.ShutDown:\n" +" break\n" +" print(f\"Consumed {item}\")\n" +" await asyncio.sleep(item)\n" +"\n" +"q: queue.Queue[int] = queue.Queue()\n" +"consumer_thread = threading.Thread(\n" +" target=lambda: asyncio.run(consumer(q))\n" +")\n" +"consumer_thread.start()\n" +"producer(q)\n" +"consumer_thread.join()" -msgid "The producer runs on the main thread while the consumer runs inside an event loop on its own thread, yet they communicate safely through ``queue.Queue``. When the queue is empty the consumer sleeps briefly and tries again. When the producer is done it calls :meth:`~queue.Queue.shutdown`, which causes subsequent :meth:`~queue.Queue.get_nowait` calls to raise :exc:`queue.ShutDown` so the consumer can exit cleanly." +msgid "" +"The producer runs on the main thread while the consumer runs inside an event" +" loop on its own thread, yet they communicate safely through " +"``queue.Queue``. When the queue is empty the consumer sleeps briefly and " +"tries again. When the producer is done it calls " +":meth:`~queue.Queue.shutdown`, which causes subsequent " +":meth:`~queue.Queue.get_nowait` calls to raise :exc:`queue.ShutDown` so the " +"consumer can exit cleanly." msgstr "" +"تولیدکننده روی نخ اصلی اجرا می‌شود، در حالی که مصرف‌کننده درون یک حلقه " +"رویداد روی نخ اختصاصی خود اجرا می‌شود، با این حال آن‌ها به‌صورت امن از طریق " +"``queue.Queue`` با یکدیگر ارتباط برقرار می‌کنند. وقتی صف خالی است، " +"مصرف‌کننده برای مدت کوتاهی متوقف میشود و دوباره تلاش می‌کند. هنگامی که " +"تولیدکننده کارش را تمام کرد، :meth:`~queue.Queue.shutdown` را فراخوانی " +"می‌کند، که باعث می‌شود فراخوانی‌های بعدی :meth:`~queue.Queue.get_nowait` " +"استثنا :exc:`queue.ShutDown` را پرتاب کنند تا مصرف‌کننده بتواند به‌صورت تمیز" +" خارج شود." diff --git a/library/asyncio-tools.po b/library/asyncio-tools.po index 8ab367204..b0549d9f8 100644 --- a/library/asyncio-tools.po +++ b/library/asyncio-tools.po @@ -20,36 +20,62 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Command-line introspection tools" -msgstr "" +msgstr "ابزارهای درون‌نگری خط فرمان" msgid "**Source code:** :source:`Lib/asyncio/tools.py`" -msgstr "" +msgstr ":source:`Lib/asyncio/tools.py`" -msgid "The :mod:`!asyncio` module can be invoked as a script via ``python -m asyncio`` to inspect the task graph of another running Python process without modifying it or restarting it. The :mod:`!asyncio.tools` submodule implements this interface." +msgid "" +"The :mod:`!asyncio` module can be invoked as a script via ``python -m " +"asyncio`` to inspect the task graph of another running Python process " +"without modifying it or restarting it. The :mod:`!asyncio.tools` submodule " +"implements this interface." msgstr "" +"می‌توان ماژول :mod:`!asyncio` را به‌عنوان یک اسکریپت از طریق ``python -m " +"asyncio`` فراخوانی کرد تا گراف وظایف (task graph) فرایند پایتون دیگری که در" +" حال اجرا است، بدون تغییر آن یا راه‌اندازی مجدد آن بررسی شود. زیرماژول " +":mod:`!asyncio.tools` این رابط را پیاده‌سازی می‌کند." msgid "The following commands inspect the process identified by ``PID``:" -msgstr "" +msgstr "دستورات زیر فرایند شناسایی‌شده با ``PID`` را بررسی می‌کنند:" msgid "" "$ python -m asyncio pstree PID\n" "$ python -m asyncio ps PID" msgstr "" +"$ python -m asyncio pstree PID\n" +"$ python -m asyncio ps PID" -msgid "The commands read the target process state without executing any code in it. They are only available on supported platforms and may require permission to inspect another process. See the :ref:`permission requirements ` for details." +msgid "" +"The commands read the target process state without executing any code in it." +" They are only available on supported platforms and may require permission " +"to inspect another process. See the :ref:`permission requirements " +"` for details." msgstr "" +"این دستورات وضعیت فرایند هدف را بدون اجرای هیچ کدی در آن می‌خوانند. آن‌ها " +"فقط روی پلتفرم‌های پشتیبانی‌شده در دسترس هستند و ممکن است برای بازرسی یک " +"فرایند دیگر به مجوز نیاز داشته باشند. برای جزئیات، :ref:`الزامات مجوز " +"` را ببینید." msgid ":ref:`asyncio-graph`" -msgstr "" +msgstr ":ref:`asyncio-graph`" -msgid "Programmatic APIs for inspecting the async call graph of a task or future in the current process." +msgid "" +"Programmatic APIs for inspecting the async call graph of a task or future in" +" the current process." msgstr "" +"APIهای برنامه‌ای برای بازرسی گراف فراخوانی ناهمگام یک وظیفهیا آینده" +" (future) در فرایند جاری." -msgid "The command examples below use this program, which creates a task hierarchy suitable for inspection and prints its process ID:" +msgid "" +"The command examples below use this program, which creates a task hierarchy " +"suitable for inspection and prints its process ID:" msgstr "" +"مثال‌های دستوری زیر از این برنامه استفاده می‌کنند، که یک سلسله‌مراتب وظیفه " +"مناسب برای بازرسی ایجاد می‌کند و شناسه فرآیند خود را چاپ می‌کند:" msgid "example.py" -msgstr "" +msgstr "example.py" msgid "" "import asyncio\n" @@ -78,23 +104,66 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"import os\n" +"\n" +"async def play(track):\n" +" await asyncio.sleep(3600)\n" +" print(f\"🎵 Finished: {track}\")\n" +"\n" +"async def album(name, tracks):\n" +" async with asyncio.TaskGroup() as tg:\n" +" for track in tracks:\n" +" tg.create_task(play(track), name=track)\n" +"\n" +"async def main():\n" +" print(f\"PID: {os.getpid()}\")\n" +" async with asyncio.TaskGroup() as tg:\n" +" tg.create_task(\n" +" album(\"Sundowning\", [\"TNDNBTG\", \"Levitate\"]),\n" +" name=\"Sundowning\",\n" +" )\n" +" tg.create_task(\n" +" album(\"TMBTE\", [\"DYWTYLM\", \"Aqua Regia\"]),\n" +" name=\"TMBTE\",\n" +" )\n" +"\n" +"asyncio.run(main())" msgid "Run the program in one terminal and leave it running:" -msgstr "" +msgstr "برنامه را در یک پایانه اجرا کنید و بگذارید در حال اجرا بماند:" msgid "" "$ python example.py\n" "PID: 12345" msgstr "" +"$ python example.py\n" +"PID: 12345" -msgid "Then pass the printed process ID to the commands from another terminal. Thread IDs, task IDs, file paths, and line numbers vary between runs and source layouts." +msgid "" +"Then pass the printed process ID to the commands from another terminal. " +"Thread IDs, task IDs, file paths, and line numbers vary between runs and " +"source layouts." msgstr "" +"سپس از پایانه‌ای دیگر، شناسه‌ی فرایند چاپ‌شده را به دستورات بدهید. شناسه‌های" +" نخ، شناسه‌های وظیفه، مسیرهای فایل و شماره‌های خط در اجراها و چیدمان‌های " +"مختلف منبع متفاوت هستند." msgid "Command-line options" -msgstr "" +msgstr "گزینه‌های خط فرمان" -msgid "Display task and coroutine relationships as a tree. Each task is shown with its full coroutine stack, nested under the task (if any) that is awaiting it. This subcommand is useful for quickly identifying which branch of a task hierarchy is blocked and where in its coroutine stack execution has paused:" +msgid "" +"Display task and coroutine relationships as a tree. Each task is shown with" +" its full coroutine stack, nested under the task (if any) that is awaiting " +"it. This subcommand is useful for quickly identifying which branch of a " +"task hierarchy is blocked and where in its coroutine stack execution has " +"paused:" msgstr "" +"نمایش روابط وظیفهو هم‌روال به‌صورت یک درخت. هر وظیفه همراه با پشته‌ی" +" کامل هم‌روال خود نمایش داده می‌شود و به‌صورت تودرتو زیر وظیفه‌ای (در صورت " +"وجود) که آن را await می‌کند، قرار می‌گیرد. این زیردستور برای شناسایی سریع " +"این‌که کدام شاخه از سلسله‌مراتب وظایف مسدود شده است و اجرا در کجای پشته‌ی " +"هم‌روال آن مکث کرده است، مفید است:" msgid "" "$ python -m asyncio pstree 12345\n" @@ -123,9 +192,40 @@ msgid "" " └── play example.py:4\n" " └── sleep Lib/asyncio/tasks.py:702" msgstr "" +"$ python -m asyncio pstree 12345\n" +"└── (T) Task-1\n" +" └── main example.py:12\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:75\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124\n" +" ├── (T) Sundowning\n" +" │ └── album example.py:7\n" +" │ └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:75\n" +" │ └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124\n" +" │ ├── (T) TNDNBTG\n" +" │ │ └── play example.py:4\n" +" │ │ └── sleep Lib/asyncio/tasks.py:702\n" +" │ └── (T) Levitate\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) TMBTE\n" +" └── album example.py:7\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:75\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124\n" +" ├── (T) DYWTYLM\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) Aqua Regia\n" +" └── play example.py:4\n" +" └── sleep Lib/asyncio/tasks.py:702" -msgid "If the await graph contains a cycle, ``pstree`` reports an error instead of printing a tree. A cycle in the await graph is unusual and typically indicates a programming error:" +msgid "" +"If the await graph contains a cycle, ``pstree`` reports an error instead of " +"printing a tree. A cycle in the await graph is unusual and typically " +"indicates a programming error:" msgstr "" +"اگر گراف await شامل یک دور باشد، ``pstree`` به‌جای چاپ یک درخت، خطایی را " +"گزارش می‌کند. وجود دور در گراف await غیرمعمول است و معمولاً نشان‌دهنده‌ی یک " +"خطای برنامه‌نویسی است:" msgid "" "$ python -m asyncio pstree 12345\n" @@ -133,12 +233,26 @@ msgid "" "\n" "cycle: Task-2 → Task-3 → Task-2" msgstr "" +"$ python -m asyncio pstree 12345\n" +"ERROR: await-graph contains cycles - cannot print a tree!\n" +"\n" +"cycle: Task-2 → Task-3 → Task-2" -msgid "Display a flat table of all pending tasks in the process *PID*. Each row shows the event-loop thread ID, task ID and name, coroutine stack, and the awaiting task's stack, name, and ID, if any." +msgid "" +"Display a flat table of all pending tasks in the process *PID*. Each row " +"shows the event-loop thread ID, task ID and name, coroutine stack, and the " +"awaiting task's stack, name, and ID, if any." msgstr "" +"نمایش یک جدول تخت از تمام وظایف در انتظار در فرایند *PID*. هر ردیف شناسه‌ی" +" نخ حلقه‌ی رویداد، شناسه و نام وظیفه، پشته‌ی هم‌روال، و در صورت وجود، پشته، " +"نام و شناسه‌ی وظیفه منتظر را نشان می‌دهد." -msgid "This subcommand prints all tasks regardless of whether the await graph contains cycles:" +msgid "" +"This subcommand prints all tasks regardless of whether the await graph " +"contains cycles:" msgstr "" +"این زیردستور همه وظایف را صرف‌نظر از اینکه گراف await حاوی چرخه باشد، چاپ " +"می‌کند:" msgid "" "$ python -m asyncio ps 12345\n" @@ -152,3 +266,13 @@ msgid "" "18445801 0x10a2d7150 DYWTYLM sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album TMBTE 0x10a439d70\n" "18445801 0x10a6bdaa0 Aqua Regia sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album TMBTE 0x10a439d70" msgstr "" +"$ python -m asyncio ps 12345\n" +"tid task id task name coroutine stack awaiter chain awaiter name awaiter id\n" +"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" +"18445801 0x10a456060 Task-1 TaskGroup._aexit -> TaskGroup.__aexit__ -> main 0x0\n" +"18445801 0x10a439f60 Sundowning TaskGroup._aexit -> TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> main Task-1 0x10a456060\n" +"18445801 0x10a439d70 TMBTE TaskGroup._aexit -> TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> main Task-1 0x10a456060\n" +"18445801 0x10a2a3a80 TNDNBTG sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album Sundowning 0x10a439f60\n" +"18445801 0x10a2a38a0 Levitate sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album Sundowning 0x10a439f60\n" +"18445801 0x10a2d7150 DYWTYLM sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album TMBTE 0x10a439d70\n" +"18445801 0x10a6bdaa0 Aqua Regia sleep -> play TaskGroup._aexit -> TaskGroup.__aexit__ -> album TMBTE 0x10a439d70" diff --git a/library/asyncio.po b/library/asyncio.po index f94e45de6..ad01a0186 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"PO-Revision-Date: 2026-08-28 10:39+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,24 +22,25 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "High-level APIs" -msgstr "" +msgstr "APIهای سطح بالا" msgid "Introspection APIs" -msgstr "" +msgstr "APIهای درون‌نگری" msgid "Low-level APIs" -msgstr "" +msgstr "APIهای سطح پایین" msgid "Guides and Tutorials" -msgstr "" +msgstr "راهنماها و خودآموزها" msgid ":mod:`!asyncio` --- Asynchronous I/O" -msgstr "" +msgstr ":mod:`!asyncio` --- ورودی/خروجی ناهمگام" msgid "Hello World!" -msgstr "" +msgstr "سلام دنیا!" msgid "" "import asyncio\n" @@ -51,97 +52,181 @@ msgid "" "\n" "asyncio.run(main())" msgstr "" +"import asyncio\n" +"\n" +"async def main():\n" +" print('Hello ...')\n" +" await asyncio.sleep(1)\n" +" print('... World!')\n" +"\n" +"asyncio.run(main())" -msgid "asyncio is a library to write **concurrent** code using the **async/await** syntax." +msgid "" +"asyncio is a library to write **concurrent** code using the **async/await** " +"syntax." msgstr "" +"asyncio کتابخانه‌ای است برای نوشتن کد **همروند** با استفاده از سینتکس " +"**async/await**." -msgid "asyncio is used as a foundation for multiple Python asynchronous frameworks that provide high-performance network and web-servers, database connection libraries, distributed task queues, etc." +msgid "" +"asyncio is used as a foundation for multiple Python asynchronous frameworks " +"that provide high-performance network and web-servers, database connection " +"libraries, distributed task queues, etc." msgstr "" +"asyncio به‌عنوان پایه‌ای برای چندین چارچوب ناهمگام پایتون استفاده می‌شود که " +"سرورهای شبکه و وب با کارایی بالا، کتابخانه‌های اتصال به پایگاه داده، صف‌های " +"وظیفه توزیع‌شده و غیره را فراهم می‌کنند." -msgid "asyncio is often a perfect fit for IO-bound and high-level **structured** network code." +msgid "" +"asyncio is often a perfect fit for IO-bound and high-level **structured** " +"network code." msgstr "" +"asyncio اغلب برای کد شبکه‌ای سطح‌بالا و **ساختاریافته** و محدود به ورودی/" +"خروجی (IO-bound) کاملاً مناسب است." msgid ":ref:`a-conceptual-overview-of-asyncio`" -msgstr "" +msgstr ":ref:`a-conceptual-overview-of-asyncio`" msgid "Explanation of the fundamentals of asyncio." -msgstr "" +msgstr "توضیح مبانی asyncio." msgid "asyncio provides a set of **high-level** APIs to:" msgstr "" +"asyncio مجموعه‌ای از APIهای **سطح بالا** را برای موارد زیر فراهم می‌کند:" -msgid ":ref:`run Python coroutines ` concurrently and have full control over their execution;" +msgid "" +":ref:`run Python coroutines ` concurrently and have full control " +"over their execution;" msgstr "" +":ref:`اجرای هم‌روال‌های پایتون ` به‌صورت همزمان و داشتن کنترل کامل " +"بر اجرای آن‌ها؛" msgid "perform :ref:`network IO and IPC `;" msgstr "" +"انجام :ref:`ورودی/خروجی شبکه و ارتباط بین‌فرایندی (IPC) `؛" msgid "control :ref:`subprocesses `;" -msgstr "" +msgstr "کنترل :ref:`زیرفرایندها `؛" msgid "distribute tasks via :ref:`queues `;" -msgstr "" +msgstr "توزیع وظایف از طریق :ref:`صف‌ها `؛" msgid ":ref:`synchronize ` concurrent code;" -msgstr "" +msgstr ":ref:`همگام‌سازی ` کد هم‌روند؛" msgid "For **introspection**, asyncio provides APIs and tools for:" -msgstr "" +msgstr "برای **درون‌نگری** (introspection)، asyncio APIها و ابزارهایی برای:" -msgid "inspecting the :ref:`async call graph ` of tasks and futures;" -msgstr "" +msgid "" +"inspecting the :ref:`async call graph ` of tasks and futures;" +msgstr "بازرسی :ref:`گراف فراخوانی ناهمگام ` وظایف و آینده‌نماها؛" -msgid "inspecting tasks in another running Python process with :ref:`command-line tools `;" +msgid "" +"inspecting tasks in another running Python process with :ref:`command-line " +"tools `;" msgstr "" +"بازرسی وظایف در فرایند پایتون دیگری که در حال اجرا است با :ref:`ابزارهای خط " +"فرمان `؛" -msgid "Additionally, there are **low-level** APIs for *library and framework developers* to:" +msgid "" +"Additionally, there are **low-level** APIs for *library and framework " +"developers* to:" msgstr "" +"علاوه بر این، APIهای **سطح پایین** برای *توسعه‌دهندگان کتابخانه و فریم‌ورک* " +"وجود دارد تا:" -msgid "create and manage :ref:`event loops `, which provide asynchronous APIs for :ref:`networking `, running :ref:`subprocesses `, handling :ref:`OS signals `, etc;" +msgid "" +"create and manage :ref:`event loops `, which provide " +"asynchronous APIs for :ref:`networking `, " +"running :ref:`subprocesses `, handling :ref:`OS " +"signals `, etc;" msgstr "" +"ایجاد و مدیریت :ref:`حلقه‌های رویداد `، که APIهای " +"ناهمگامی برای :ref:`شبکه‌سازی `، اجرای :ref:`زیرفرایندها " +"`، مدیریت :ref:`سیگنال‌های سیستم‌عامل " +"` و غیره فراهم می‌کنند؛" -msgid "implement efficient protocols using :ref:`transports `;" +msgid "" +"implement efficient protocols using :ref:`transports `;" msgstr "" +"پیاده‌سازی پروتکل‌های کارآمد با استفاده از :ref:`transports `؛" -msgid ":ref:`bridge ` callback-based libraries and code with async/await syntax." +msgid "" +":ref:`bridge ` callback-based libraries and code with " +"async/await syntax." msgstr "" +":ref:`پل ` بین کتابخانه‌های مبتنی بر کال‌بک و کد با نحو " +"async/await." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. " +"See :ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات " +"بیشتر :ref:`wasm-availability` را ببینید." msgid "asyncio REPL" -msgstr "" +msgstr "asyncio REPL" -msgid "You can experiment with an ``asyncio`` concurrent context in the :term:`REPL`:" -msgstr "" +msgid "" +"You can experiment with an ``asyncio`` concurrent context in " +"the :term:`REPL`:" +msgstr "می‌توانید یک زمینه همروند ``asyncio`` را در :term:`REPL` آزمایش کنید:" msgid "" "$ python -m asyncio\n" "asyncio REPL ...\n" "Use \"await\" directly instead of \"asyncio.run()\".\n" -"Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" ">>> import asyncio\n" ">>> await asyncio.sleep(10, result='hello')\n" "'hello'" msgstr "" +"$ python -m asyncio\n" +"asyncio REPL ...\n" +"Use \"await\" directly instead of \"asyncio.run()\".\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>> import asyncio\n" +">>> await asyncio.sleep(10, result='hello')\n" +"'hello'" -msgid "This REPL provides limited compatibility with :envvar:`PYTHON_BASIC_REPL`. It is recommended that the default REPL is used for full functionality and the latest features." +msgid "" +"This REPL provides limited compatibility with :envvar:`PYTHON_BASIC_REPL`. " +"It is recommended that the default REPL is used for full functionality and " +"the latest features." msgstr "" +"این پوسته تعاملی (REPL) سازگاری محدودی با :envvar:`PYTHON_BASIC_REPL` دارد. " +"توصیه می‌شود که برای عملکرد کامل و جدیدترین قابلیت‌ها از پوسته تعاملی پیش‌فرض " +"(REPL) استفاده شود." -msgid "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``cpython.run_stdin`` را بدون آرگومان " +"پرتاب می‌کند." msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." msgstr "" +"(همچنین 3.11.10، 3.10.15، 3.9.20 و 3.8.20) رویدادهای حسابرسی را منتشر می‌کند." -msgid "Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also executed. Emits audit events." +msgid "" +"Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " +"executed. Emits audit events." msgstr "" +"در صورت امکان از PyREPL استفاده می‌کند، که در این " +"صورت :envvar:`PYTHONSTARTUP` نیز اجرا می‌شود. رویدادهای حسابرسی (audit events) " +"را منتشر می‌کند." msgid "Reference" -msgstr "" +msgstr "مرجع" msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." -msgstr "" +msgstr "کد منبع asyncio را می‌توانید در :source:`Lib/asyncio/` پیدا کنید." diff --git a/library/asyncore.po b/library/asyncore.po index e873e9cbc..d0cdbfdb2 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -22,13 +22,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!asyncore` --- Asynchronous socket handler" -msgstr "" +msgstr ":mod:`!asyncore` --- هندلر سوکت ناهمگام" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.12 ` after being deprecated in Python 3.6. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.12 ` after being deprecated " +"in Python 3.6. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.6، :ref:`در پایتون 3.12 حذف شد `. " +"تصمیم برای حذف آن در :pep:`594` گرفته شد." msgid "Applications should use the :mod:`asyncio` module instead." -msgstr "" +msgstr "برنامه‌ها باید در عوض از ماژول :mod:`asyncio` استفاده کنند." -msgid "The last version of Python that provided the :mod:`!asyncore` module was `Python 3.11 `_." +msgid "" +"The last version of Python that provided the :mod:`!asyncore` module was " +"`Python 3.11 `_." msgstr "" +"آخرین نسخه از پایتون که ماژول :mod:`!asyncore` را ارائه می‌داد، `Python 3.11" +" `_ بود." diff --git a/library/atexit.po b/library/atexit.po index 8eb1a6a10..375f35bf0 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -22,52 +22,144 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!atexit` --- Exit handlers" -msgstr "" +msgstr ":mod:`!atexit` --- هندلرهای خروج" -msgid "The :mod:`!atexit` module defines functions to register and unregister cleanup functions. Functions thus registered are automatically executed upon normal interpreter termination. :mod:`!atexit` runs these functions in the *reverse* order in which they were registered; if you register ``A``, ``B``, and ``C``, at interpreter termination time they will be run in the order ``C``, ``B``, ``A``." -msgstr "" +msgid "" +"The :mod:`!atexit` module defines functions to register and unregister " +"cleanup functions. Functions thus registered are automatically executed " +"upon normal interpreter termination. :mod:`!atexit` runs these functions in" +" the *reverse* order in which they were registered; if you register ``A``, " +"``B``, and ``C``, at interpreter termination time they will be run in the " +"order ``C``, ``B``, ``A``." +msgstr "" +"ماژول :mod:`!atexit` توابعی را برای ثبت و لغو ثبت توابع پاک‌سازی تعریف " +"می‌کند. توابعی که بدین ترتیب ثبت شوند، به‌طور خودکار در زمان خاتمه عادی مفسر" +" اجرا می‌شوند. :mod:`!atexit` این توابع را به ترتیب *معکوس* ثبت اجرا می‌کند؛" +" اگر ``A``، ``B`` و ``C`` را ثبت کنید، در زمان خاتمه مفسر به ترتیب ``C``، " +"``B``، ``A`` اجرا خواهند شد." -msgid "**Note:** The functions registered via this module are not called when the program is killed by a signal not handled by Python, when a Python fatal internal error is detected, or when :func:`os._exit` is called." +msgid "" +"**Note:** The functions registered via this module are not called when the " +"program is killed by a signal not handled by Python, when a Python fatal " +"internal error is detected, or when :func:`os._exit` is called." msgstr "" +"**توجه:** توابع ثبت‌شده از طریق این ماژول، هنگامی که برنامه با سیگنالی که " +"پایتون آن را مدیریت نمی‌کند کشته شود، هنگامی که یک خطای داخلی مهلک پایتون " +"تشخیص داده شود، یا هنگامی که :func:`os._exit` فراخوانی شود، فراخوانی " +"نمی‌شوند." -msgid "**Note:** The effect of registering or unregistering functions from within a cleanup function is undefined." +msgid "" +"**Note:** The effect of registering or unregistering functions from within a" +" cleanup function is undefined." msgstr "" +"**توجه:** اثر ثبت یا لغو ثبت توابع از درون یک تابع پاک‌سازی تعریف‌نشده است." -msgid "When used with C-API subinterpreters, registered functions are local to the interpreter they were registered in." +msgid "" +"When used with C-API subinterpreters, registered functions are local to the " +"interpreter they were registered in." msgstr "" +"هنگام استفاده از زیرمفسرهای C-API، توابع ثبت‌شده محلی به مفسری هستند که در " +"آن ثبت شده‌اند." -msgid "Register *func* as a function to be executed at termination. Any optional arguments that are to be passed to *func* must be passed as arguments to :func:`register`. It is possible to register the same function and arguments more than once." +msgid "" +"Register *func* as a function to be executed at termination. Any optional " +"arguments that are to be passed to *func* must be passed as arguments to " +":func:`register`. It is possible to register the same function and " +"arguments more than once." msgstr "" +"*func* را به‌عنوان تابعی برای اجرا در زمان خاتمه ثبت کنید. هر آرگومان " +"اختیاری که قرار است به *func* داده شود، باید به‌عنوان آرگومان به " +":func:`register` داده شود. ثبت یک تابع و آرگومان‌های یکسان بیش از یک‌بار " +"امکان‌پذیر است." -msgid "At normal program termination (for instance, if :func:`sys.exit` is called or the main module's execution completes), all functions registered are called in last in, first out order. The assumption is that lower level modules will normally be imported before higher level modules and thus must be cleaned up later." -msgstr "" +msgid "" +"At normal program termination (for instance, if :func:`sys.exit` is called " +"or the main module's execution completes), all functions registered are " +"called in last in, first out order. The assumption is that lower level " +"modules will normally be imported before higher level modules and thus must " +"be cleaned up later." +msgstr "" +"در پایان عادی برنامه (برای مثال، اگر :func:`sys.exit` فراخوانی شود یا اجرای " +"ماژول اصلی به پایان برسد)، همه توابع ثبت‌شده به ترتیب آخرین ورودی، اولین " +"خروجی فراخوانی می‌شوند. فرض بر این است که ماژول‌های سطح پایین‌تر معمولاً قبل" +" از ماژول‌های سطح بالاتر ایمپورت می‌شوند و بنابراین باید بعداً پاک‌سازی " +"شوند." -msgid "If an exception is raised during execution of the exit handlers, a traceback is printed (unless :exc:`SystemExit` is raised) and the exception information is saved. After all exit handlers have had a chance to run, the last exception to be raised is re-raised." +msgid "" +"If an exception is raised during execution of the exit handlers, a traceback" +" is printed (unless :exc:`SystemExit` is raised) and the exception " +"information is saved. After all exit handlers have had a chance to run, the" +" last exception to be raised is re-raised." msgstr "" +"اگر در حین اجرای هندلرهای خروج، استثنایی پرتاب شود، یک ردگیری پشته " +"چاپ می‌شود (مگر اینکه :exc:`SystemExit` پرتاب شود) و اطلاعات استثنا ذخیره " +"می‌شود. پس از آنکه همه هندلرهای خروج فرصت اجرا داشته باشند، آخرین " +"استثنای پرتاب‌شده دوباره پرتاب می‌شود." -msgid "This function returns *func*, which makes it possible to use it as a decorator." +msgid "" +"This function returns *func*, which makes it possible to use it as a " +"decorator." msgstr "" +"این تابع، *func* را برمی‌گرداند که امکان استفاده از آن به‌عنوان دکوراتور را " +"فراهم می‌کند." -msgid "Starting new threads or calling :func:`os.fork` from a registered function can lead to race condition between the main Python runtime thread freeing thread states while internal :mod:`threading` routines or the new process try to use that state. This can lead to crashes rather than clean shutdown." +msgid "" +"Starting new threads or calling :func:`os.fork` from a registered function " +"can lead to race condition between the main Python runtime thread freeing " +"thread states while internal :mod:`threading` routines or the new process " +"try to use that state. This can lead to crashes rather than clean shutdown." msgstr "" +"شروع نخ‌های جدید یا فراخوانی :func:`os.fork` از یک تابع ثبت‌شده می‌تواند " +"منجر به شرایط رقابتی میان نخ اصلی ران‌تایم پایتون، که در حال آزادسازی " +"وضعیت‌های نخ است، و روال‌های داخلی :mod:`threading` یا فرایند جدیدی شود که " +"سعی می‌کنند از آن وضعیت استفاده کنند. این می‌تواند به‌جای خاموش شدن تمیز، " +"منجر به فروپاشی شود." -msgid "Attempts to start a new thread or :func:`os.fork` a new process in a registered function now leads to :exc:`RuntimeError`." +msgid "" +"Attempts to start a new thread or :func:`os.fork` a new process in a " +"registered function now leads to :exc:`RuntimeError`." msgstr "" +"تلاش برای آغاز یک نخ جدید یا ایجاد یک فرآیند جدید با :func:`os.fork` در یک " +"تابع ثبت‌شده اکنون منجر به :exc:`RuntimeError` می‌شود." -msgid "Remove *func* from the list of functions to be run at interpreter shutdown. :func:`unregister` silently does nothing if *func* was not previously registered. If *func* has been registered more than once, every occurrence of that function in the :mod:`!atexit` call stack will be removed. Equality comparisons (``==``) are used internally during unregistration, so function references do not need to have matching identities." -msgstr "" +msgid "" +"Remove *func* from the list of functions to be run at interpreter shutdown. " +":func:`unregister` silently does nothing if *func* was not previously " +"registered. If *func* has been registered more than once, every occurrence " +"of that function in the :mod:`!atexit` call stack will be removed. Equality" +" comparisons (``==``) are used internally during unregistration, so function" +" references do not need to have matching identities." +msgstr "" +"*func* را از فهرست توابعی که در زمان خاموش شدن مفسر اجرا می‌شوند، حذف کنید. " +"اگر *func* پیش‌تر ثبت نشده باشد، :func:`unregister` به‌صورت خاموش کاری انجام" +" نمی‌دهد. اگر *func* بیش از یک بار ثبت شده باشد، هر مورد از آن تابع در پشته " +"فراخوانی :mod:`!atexit` حذف خواهد شد. در حین لغو ثبت، از مقایسه‌های برابری " +"(``==``) به‌صورت داخلی استفاده می‌شود، بنابراین لازم نیست ارجاع‌های تابع " +"هویت‌های یکسانی داشته باشند." msgid "Module :mod:`readline`" -msgstr "" +msgstr "ماژول :mod:`readline`" -msgid "Useful example of :mod:`!atexit` to read and write :mod:`readline` history files." +msgid "" +"Useful example of :mod:`!atexit` to read and write :mod:`readline` history " +"files." msgstr "" +"مثالی مفید از :mod:`!atexit` برای خواندن و نوشتن فایل‌های تاریخچه‌ی " +":mod:`readline`." msgid ":mod:`!atexit` Example" -msgstr "" +msgstr ":mod:`!atexit` مثال" -msgid "The following simple example demonstrates how a module can initialize a counter from a file when it is imported and save the counter's updated value automatically when the program terminates without relying on the application making an explicit call into this module at termination. ::" +msgid "" +"The following simple example demonstrates how a module can initialize a " +"counter from a file when it is imported and save the counter's updated value" +" automatically when the program terminates without relying on the " +"application making an explicit call into this module at termination. ::" msgstr "" +"مثال ساده‌ی زیر نشان می‌دهد که چگونه یک ماژول می‌تواند هنگامی که ایمپورت " +"می‌شود، یک شمارنده را از یک فایل مقداردهی اولیه کند و مقدار به‌روزشده‌ی " +"شمارنده را به‌صورت خودکار هنگام پایان برنامه ذخیره کند، بدون این‌که به " +"فراخوانی صریح این ماژول توسط برنامه کاربردی در زمان پایان نیاز باشد. ::" msgid "" "try:\n" @@ -88,9 +180,30 @@ msgid "" "\n" "atexit.register(savecounter)" msgstr "" +"try:\n" +" with open('counterfile') as infile:\n" +" _count = int(infile.read())\n" +"except FileNotFoundError:\n" +" _count = 0\n" +"\n" +"def incrcounter(n):\n" +" global _count\n" +" _count = _count + n\n" +"\n" +"def savecounter():\n" +" with open('counterfile', 'w') as outfile:\n" +" outfile.write('%d' % _count)\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(savecounter)" -msgid "Positional and keyword arguments may also be passed to :func:`register` to be passed along to the registered function when it is called::" +msgid "" +"Positional and keyword arguments may also be passed to :func:`register` to " +"be passed along to the registered function when it is called::" msgstr "" +"همچنین می‌توان آرگومان‌های جایگاهی و کلیدواژه‌ای را به :func:`register` " +"ارسال کرد تا در زمان فراخوانی تابع ثبت‌شده، به آن تابع ارسال شوند::" msgid "" "def goodbye(name, adjective):\n" @@ -102,9 +215,17 @@ msgid "" "# or:\n" "atexit.register(goodbye, adjective='nice', name='Donny')" msgstr "" +"def goodbye(name, adjective):\n" +" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(goodbye, 'Donny', 'nice')\n" +"# or:\n" +"atexit.register(goodbye, adjective='nice', name='Donny')" msgid "Usage as a :term:`decorator`::" -msgstr "" +msgstr "استفاده به‌عنوان یک :term:`دکوراتور `::" msgid "" "import atexit\n" @@ -113,6 +234,12 @@ msgid "" "def goodbye():\n" " print('You are now leaving the Python sector.')" msgstr "" +"import atexit\n" +"\n" +"@atexit.register\n" +"def goodbye():\n" +" print('You are now leaving the Python sector.')" msgid "This only works with functions that can be called without arguments." msgstr "" +"این تنها با توابعی کار می‌کند که بتوان آن‌ها را بدون آرگومان فراخوانی کرد." diff --git a/library/audioop.po b/library/audioop.po index 67ad1a347..7d85da106 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!audioop` --- Manipulate raw audio data" -msgstr "" +msgstr ":mod:`!audioop` --- دستکاری داده‌های صوتی خام" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. " +"تصمیم به حذف آن در :pep:`594` گرفته شد." -msgid "The last version of Python that provided the :mod:`!audioop` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!audioop` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!audioop` را ارائه می‌کرد، `Python 3.12 " +"`_ بود." diff --git a/library/audit_events.po b/library/audit_events.po index 7bd05d393..95b0efcbb 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -24,79 +24,104 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Audit events table" -msgstr "" +msgstr "جدول رویدادهای حسابرسی" -msgid "This table contains all events raised by :func:`sys.audit` or :c:func:`PySys_Audit` calls throughout the CPython runtime and the standard library. These calls were added in 3.8 or later (see :pep:`578`)." +msgid "" +"This table contains all events raised by :func:`sys.audit` or " +":c:func:`PySys_Audit` calls throughout the CPython runtime and the standard " +"library. These calls were added in 3.8 or later (see :pep:`578`)." msgstr "" +"این جدول شامل همه رویدادهایی است که توسط فراخوانی‌های :func:`sys.audit` یا " +":c:func:`PySys_Audit` در سراسر ران‌تایم CPython و کتابخانه استاندارد پرتاب " +"می‌شوند. این فراخوانی‌ها در 3.8 یا نسخه‌های بعد از آن افزوده شده‌اند (به " +":pep:`578` مراجعه کنید)." -msgid "See :func:`sys.addaudithook` and :c:func:`PySys_AddAuditHook` for information on handling these events." +msgid "" +"See :func:`sys.addaudithook` and :c:func:`PySys_AddAuditHook` for " +"information on handling these events." msgstr "" +"برای اطلاعات بیشتر درباره‌ی نحوه‌ی مدیریت این رویدادها، " +":func:`sys.addaudithook` و :c:func:`PySys_AddAuditHook` را ببینید." -msgid "This table is generated from the CPython documentation, and may not represent events raised by other implementations. See your runtime specific documentation for actual events raised." +msgid "" +"This table is generated from the CPython documentation, and may not " +"represent events raised by other implementations. See your runtime specific " +"documentation for actual events raised." msgstr "" +"این جدول از مستندات CPython تولید شده است، و ممکن است رویدادهای پرتاب‌شده " +"توسط پیاده‌سازی‌های دیگر را نشان ندهد. برای رویدادهای واقعی پرتاب‌شده، " +"مستندات خاص ران‌تایم خود را ببینید." -msgid "The following events are raised internally and do not correspond to any public API of CPython:" +msgid "" +"The following events are raised internally and do not correspond to any " +"public API of CPython:" msgstr "" +"رویدادهای زیر به‌صورت داخلی پرتاب می‌شوند و به هیچ API عمومی‌ای از CPython " +"مربوط نمی‌شوند:" msgid "Audit event" -msgstr "" +msgstr "رویداد حسابرسی" msgid "Arguments" -msgstr "" +msgstr "آرگومان‌ها" msgid "_winapi.CreateFile" -msgstr "" +msgstr "_winapi.CreateFile" -msgid "``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``, ``flags_and_attributes``" +msgid "" +"``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``," +" ``flags_and_attributes``" msgstr "" +"``file_name``, ``desired_access``, ``share_mode``, ``creation_disposition``," +" ``flags_and_attributes``" msgid "_winapi.CreateJunction" -msgstr "" +msgstr "_winapi.CreateJunction" msgid "``src_path``, ``dst_path``" -msgstr "" +msgstr "``src_path``, ``dst_path``" msgid "_winapi.CreateNamedPipe" -msgstr "" +msgstr "_winapi.CreateNamedPipe" msgid "``name``, ``open_mode``, ``pipe_mode``" -msgstr "" +msgstr "``name``، ``open_mode``، ``pipe_mode``" msgid "_winapi.CreatePipe" -msgstr "" +msgstr "_winapi.CreatePipe" msgid "_winapi.CreateProcess" -msgstr "" +msgstr "_winapi.CreateProcess" msgid "``application_name``, ``command_line``, ``current_directory``" -msgstr "" +msgstr "``application_name``, ``command_line``, ``current_directory``" msgid "_winapi.OpenProcess" -msgstr "" +msgstr "_winapi.OpenProcess" msgid "``process_id``, ``desired_access``" -msgstr "" +msgstr "``process_id``, ``desired_access``" msgid "_winapi.TerminateProcess" -msgstr "" +msgstr "_winapi.TerminateProcess" msgid "``handle``, ``exit_code``" -msgstr "" +msgstr "``handle``, ``exit_code``" msgid "_posixsubprocess.fork_exec" -msgstr "" +msgstr "_posixsubprocess.fork_exec" msgid "``exec_list``, ``args``, ``env``" -msgstr "" +msgstr "``exec_list``, ``args``, ``env``" msgid "ctypes.PyObj_FromPtr" -msgstr "" +msgstr "ctypes.PyObj_FromPtr" msgid "``obj``" -msgstr "" +msgstr "``obj``" msgid "The ``_posixsubprocess.fork_exec`` internal audit event." -msgstr "" +msgstr "رویداد حسابرسی داخلی ``_posixsubprocess.fork_exec``." msgid "audit events" -msgstr "" +msgstr "رویدادهای حسابرسی" diff --git a/library/base64.po b/library/base64.po index 9742a6c4d..7c012aa4b 100644 --- a/library/base64.po +++ b/library/base64.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"PO-Revision-Date: 2026-08-28 11:34+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,237 +22,578 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!base64` --- Base16, Base32, Base64, Base85 Data Encodings" -msgstr "" +msgstr ":mod:`!base64` --- کدگذاری‌های Base16، Base32، Base64 و Base85 برای داده" msgid "**Source code:** :source:`Lib/base64.py`" -msgstr "" +msgstr ":source:`Lib/base64.py`" -msgid "This module provides functions for encoding binary data to printable ASCII characters and decoding such encodings back to binary data. This includes the :ref:`encodings specified in ` :rfc:`4648` (Base64, Base32 and Base16), the :ref:`Base85 encoding ` specified in `PDF 2.0 `_, and non-standard variants of Base85 used elsewhere." -msgstr "" +msgid "" +"This module provides functions for encoding binary data to printable ASCII " +"characters and decoding such encodings back to binary data. This includes " +"the :ref:`encodings specified in ` :rfc:`4648` (Base64, " +"Base32 and Base16), the :ref:`Base85 encoding ` specified in " +"`PDF 2.0 `_, and non-standard " +"variants of Base85 used elsewhere." +msgstr "" +"این ماژول توابعی برای کدگذاری داده‌های دودویی به نویسه‌های قابل‌چاپ ASCII و " +"کدگشایی چنین کدگذاری‌هایی به داده‌های دودویی فراهم می‌کند. این ماژول " +"شامل :ref:`کدگذاری‌های مشخص‌شده در ` :rfc:`4648` (Base64، " +"Base32 و Base16)، :ref:`کدگذاری Base85 ` مشخص‌شده در `PDF 2.0 " +"`_، و گونه‌های غیراستاندارد Base85 است " +"که در جاهای دیگر استفاده می‌شوند." -msgid "There are two interfaces provided by this module. The modern interface supports encoding :term:`bytes-like objects ` to ASCII :class:`bytes`, and decoding :term:`bytes-like objects ` or strings containing ASCII to :class:`bytes`. Both base-64 alphabets defined in :rfc:`4648` (normal, and URL- and filesystem-safe) are supported." -msgstr "" +msgid "" +"There are two interfaces provided by this module. The modern interface " +"supports encoding :term:`bytes-like objects ` to " +"ASCII :class:`bytes`, and decoding :term:`bytes-like objects ` or strings containing ASCII to :class:`bytes`. Both base-64 " +"alphabets defined in :rfc:`4648` (normal, and URL- and filesystem-safe) are " +"supported." +msgstr "" +"این ماژول دو رابط ارائه می‌دهد. رابط مدرن از کدگذاری :term:`اشیاء شبه‌بایت " +"` به :class:`bytes` ASCII، و کدگشایی :term:`اشیاء " +"شبه‌بایت ` یا رشته‌های حاوی ASCII به :class:`bytes` " +"پشتیبانی می‌کند. هر دو الفبای base-64 تعریف‌شده در :rfc:`4648` (معمولی، و امن " +"برای URL و سیستم فایل) پشتیبانی می‌شوند." -msgid "The :ref:`legacy interface ` does not support decoding from strings, but it does provide functions for encoding and decoding to and from :term:`file objects `. It only supports the Base64 standard alphabet, and it adds newlines every 76 characters as per :rfc:`2045`. Note that if you are looking for :rfc:`2045` support you probably want to be looking at the :mod:`email` package instead." -msgstr "" +msgid "" +"The :ref:`legacy interface ` does not support decoding from " +"strings, but it does provide functions for encoding and decoding to and " +"from :term:`file objects `. It only supports the Base64 " +"standard alphabet, and it adds newlines every 76 characters as " +"per :rfc:`2045`. Note that if you are looking for :rfc:`2045` support you " +"probably want to be looking at the :mod:`email` package instead." +msgstr "" +":ref:`رابط قدیمی ` از کدگشایی از رشته‌ها پشتیبانی نمی‌کند، اما " +"توابعی برای کدگذاری و کدگشایی به و از :term:`اشیای فایل ` ارائه " +"می‌دهد. این رابط فقط از الفبای استاندارد Base64 پشتیبانی می‌کند و " +"مطابق :rfc:`2045` هر ۷۶ نویسه یک خط جدید اضافه می‌کند. توجه داشته باشید که اگر " +"به دنبال پشتیبانی از :rfc:`2045` هستید، احتمالاً بهتر است در عوض به " +"بسته :mod:`email` نگاه کنید." -msgid "ASCII-only Unicode strings are now accepted by the decoding functions of the modern interface." -msgstr "" +msgid "" +"ASCII-only Unicode strings are now accepted by the decoding functions of the " +"modern interface." +msgstr "توابع کدگشایی رابط مدرن اکنون رشته‌های یونیکود فقط ASCII را می‌پذیرند." -msgid "Any :term:`bytes-like objects ` are now accepted by all encoding and decoding functions in this module. Ascii85/Base85 support added." +msgid "" +"Any :term:`bytes-like objects ` are now accepted by all " +"encoding and decoding functions in this module. Ascii85/Base85 support added." msgstr "" +"اکنون تمامی توابع کدگذاری و کدگشایی این ماژول، هر :term:`شیء شبه‌بایت ` را می‌پذیرند. پشتیبانی از Ascii85/Base85 افزوده شد." msgid "RFC 4648 Encodings" -msgstr "" +msgstr "کدگذاری‌های RFC 4648" -msgid "The :rfc:`4648` encodings are suitable for encoding binary data so that it can be safely sent by email, used as parts of URLs, or included as part of an HTTP POST request." +msgid "" +"The :rfc:`4648` encodings are suitable for encoding binary data so that it " +"can be safely sent by email, used as parts of URLs, or included as part of an " +"HTTP POST request." msgstr "" +"کدگذاری‌های :rfc:`4648` برای کدگذاری داده‌های دودویی مناسب هستند، به‌طوری که " +"بتوان آن‌ها را به‌صورت امن از طریق ایمیل ارسال کرد، به‌عنوان بخش‌هایی از URLها " +"استفاده کرد، یا به‌عنوان بخشی از یک درخواست HTTP POST قرار داد." -msgid "Encode the :term:`bytes-like object` *s* using Base64 and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *s* using Base64 and return the " +"encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* را با استفاده از Base64 کدگذاری می‌کند " +"و :class:`bytes` کدگذاری‌شده را برمی‌گرداند." -msgid "Optional *altchars* must be a :term:`bytes-like object` of length 2 which specifies an alternative alphabet for the ``+`` and ``/`` characters. This allows an application to e.g. generate URL or filesystem safe Base64 strings. The default is ``None``, for which the standard Base64 alphabet is used." -msgstr "" +msgid "" +"Optional *altchars* must be a :term:`bytes-like object` of length 2 which " +"specifies an alternative alphabet for the ``+`` and ``/`` characters. This " +"allows an application to e.g. generate URL or filesystem safe Base64 " +"strings. The default is ``None``, for which the standard Base64 alphabet is " +"used." +msgstr "" +"*altchars* اختیاری باید یک :term:`شیء شبه‌بایت ` به طول ۲ " +"باشد که الفبای جایگزین را برای نویسه‌های ``+`` و ``/`` مشخص می‌کند. این به یک " +"برنامه اجازه می‌دهد که برای مثال، رشته‌های Base64 امن برای URL یا سیستم فایل " +"تولید کند. پیش‌فرض ``None`` است، که در این صورت از الفبای استاندارد Base64 " +"استفاده می‌شود." -msgid "May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like object`." +msgid "" +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not " +"2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " +"object`." msgstr "" +"ممکن است در صورتی که طول *altchars* ۲ نباشد، assert کند یا " +"یک :exc:`ValueError` را پرتاب کند. اگر *altchars* یک :term:`bytes-like " +"object` نباشد، یک :exc:`TypeError` را پرتاب می‌کند." -msgid "Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and return the decoded :class:`bytes`." +msgid "" +"Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته‌ی ASCII کدگذاری‌شده با Base64 *s* را کدگشایی " +"می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "Optional *altchars* must be a :term:`bytes-like object` or ASCII string of length 2 which specifies the alternative alphabet used instead of the ``+`` and ``/`` characters." +msgid "" +"Optional *altchars* must be a :term:`bytes-like object` or ASCII string of " +"length 2 which specifies the alternative alphabet used instead of the ``+`` " +"and ``/`` characters." msgstr "" +"*altchars* اختیاری باید یک :term:`bytes-like object` یا رشته‌ی ASCII به طول ۲ " +"باشد که الفبای جایگزینی را که به‌جای نویسه‌های ``+`` و ``/`` استفاده می‌شود، " +"مشخص می‌کند." -msgid "A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." +msgid "" +"A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." msgstr "" +"اگر *s* به‌درستی پدینگ (padding) نشده باشد، استثنای :exc:`binascii.Error` " +"پرتاب می‌شود." -msgid "If *validate* is ``False`` (the default), characters that are neither in the normal base-64 alphabet nor the alternative alphabet are discarded prior to the padding check. If *validate* is ``True``, these non-alphabet characters in the input result in a :exc:`binascii.Error`." +msgid "" +"If *validate* is ``False`` (the default), characters that are neither in the " +"normal base-64 alphabet nor the alternative alphabet are discarded prior to " +"the padding check. If *validate* is ``True``, these non-alphabet characters " +"in the input result in a :exc:`binascii.Error`." msgstr "" +"اگر *validate* برابر ``False`` باشد (پیش‌فرض)، نویسه‌هایی که نه در الفبای عادی " +"base-64 و نه در الفبای جایگزین وجود دارند، پیش از بررسی پرکننده (padding) دور " +"انداخته می‌شوند. اگر *validate* برابر ``True`` باشد، این نویسه‌های غیرالفبایی " +"در ورودی منجر به پرتاب یک :exc:`binascii.Error` می‌شوند." -msgid "For more information about the strict base64 check, see :func:`binascii.a2b_base64`" +msgid "" +"For more information about the strict base64 check, " +"see :func:`binascii.a2b_base64`" msgstr "" +"برای اطلاعات بیشتر درباره بررسی سخت‌گیرانه base64، :func:`binascii.a2b_base64` " +"را ببینید" -msgid "May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2." +msgid "" +"May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2." msgstr "" +"ممکن است در صورتی که طول *altchars* برابر ۲ نباشد، assert کند یا " +"یک :exc:`ValueError` را پرتاب کند." -msgid "Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and return the encoded :class:`bytes`." +msgid "" +"Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and " +"return the encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* را با استفاده از الفبای استاندارد Base64 " +"کدگذاری می‌کند و :class:`bytes` کدگذاری‌شده را برمی‌گرداند." -msgid "Decode :term:`bytes-like object` or ASCII string *s* using the standard Base64 alphabet and return the decoded :class:`bytes`." +msgid "" +"Decode :term:`bytes-like object` or ASCII string *s* using the standard " +"Base64 alphabet and return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته ASCII *s* را با استفاده از الفبای استاندارد " +"Base64 کدگشایی می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet, and return the encoded :class:`bytes`. The result can still contain ``=``." +msgid "" +"Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe " +"alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/`` " +"in the standard Base64 alphabet, and return the encoded :class:`bytes`. The " +"result can still contain ``=``." msgstr "" +":term:`bytes-like object` *s* را با استفاده از الفبای امن برای URL و " +"فایل‌سیستم کدگذاری می‌کند، که در الفبای استاندارد Base64، ``-`` را به جای ``+`` " +"و ``_`` را به جای ``/`` جایگزین می‌کند، و :class:`bytes` کدگذاری‌شده را " +"برمی‌گرداند. نتیجه همچنان می‌تواند شامل ``=`` باشد." -msgid "Decode :term:`bytes-like object` or ASCII string *s* using the URL- and filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet, and return the decoded :class:`bytes`." +msgid "" +"Decode :term:`bytes-like object` or ASCII string *s* using the URL- and " +"filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` " +"instead of ``/`` in the standard Base64 alphabet, and return the " +"decoded :class:`bytes`." msgstr "" +"با استفاده از الفبای امن برای URL و فایل‌سیستم، که در الفبای استاندارد Base64 " +"به‌جای ``+`` از ``-`` و به‌جای ``/`` از ``_`` استفاده می‌کند، :term:`bytes-like " +"object` یا رشته‌ی ASCII *s* را کدگشایی کنید و :class:`bytes` کدگشایی‌شده را " +"برگردانید." -msgid "Encode the :term:`bytes-like object` *s* using Base32 and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *s* using Base32 and return the " +"encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* را با استفاده از Base32 کدگذاری می‌کند " +"و :class:`bytes` کدگذاری‌شده را برمی‌گرداند." -msgid "Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and return the decoded :class:`bytes`." +msgid "" +"Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته ASCII *s* را که با Base32 کدگذاری‌شده است، " +"کدگشایی می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "Optional *casefold* is a flag specifying whether a lowercase alphabet is acceptable as input. For security purposes, the default is ``False``." +msgid "" +"Optional *casefold* is a flag specifying whether a lowercase alphabet is " +"acceptable as input. For security purposes, the default is ``False``." msgstr "" +"*casefold* اختیاری پرچمی است که مشخص می‌کند آیا الفبای کوچک به‌عنوان ورودی " +"قابل‌قبول است یا خیر. به دلایل امنیتی، مقدار پیش‌فرض ``False`` است." -msgid ":rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter O (oh), and for optional mapping of the digit 1 (one) to either the letter I (eye) or letter L (el). The optional argument *map01* when not ``None``, specifies which letter the digit 1 should be mapped to (when *map01* is not ``None``, the digit 0 is always mapped to the letter O). For security purposes the default is ``None``, so that 0 and 1 are not allowed in the input." -msgstr "" +msgid "" +":rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter O " +"(oh), and for optional mapping of the digit 1 (one) to either the letter I " +"(eye) or letter L (el). The optional argument *map01* when not ``None``, " +"specifies which letter the digit 1 should be mapped to (when *map01* is not " +"``None``, the digit 0 is always mapped to the letter O). For security " +"purposes the default is ``None``, so that 0 and 1 are not allowed in the " +"input." +msgstr "" +":rfc:`4648` امکان نگاشت اختیاری رقم ۰ (صفر) به حرف O (اوه) و نگاشت اختیاری " +"رقم ۱ (یک) به حرف I (آی) یا حرف L (اِل) را فراهم می‌کند. آرگومان اختیاری " +"*map01*، هنگامی که ``None`` نباشد، مشخص می‌کند که رقم ۱ باید به کدام حرف نگاشت " +"شود (هنگامی که *map01* ``None`` نباشد، رقم ۰ همیشه به حرف O نگاشت می‌شود). " +"به‌دلایل امنیتی، مقدار پیش‌فرض ``None`` است، تا ۰ و ۱ در ورودی مجاز نباشند." -msgid "A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there are non-alphabet characters present in the input." +msgid "" +"A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there " +"are non-alphabet characters present in the input." msgstr "" +"اگر *s* به‌درستی پد (padding) نشده باشد یا نویسه‌های خارج از الفبا در ورودی " +"وجود داشته باشند، یک :exc:`binascii.Error` پرتاب می‌شود." -msgid "Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined in :rfc:`4648`." +msgid "" +"Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined " +"in :rfc:`4648`." msgstr "" +"مشابه :func:`b32encode` است، اما از الفبای مبنای شانزده توسعه‌یافته (Extended Hex " +"Alphabet) استفاده می‌کند، همان‌طور که در :rfc:`4648` تعریف شده است." -msgid "Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined in :rfc:`4648`." +msgid "" +"Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " +"in :rfc:`4648`." msgstr "" +"مشابه :func:`b32decode` است، اما از الفبای مبنای شانزده توسعه‌یافته (Extended Hex " +"Alphabet) تعریف‌شده در :rfc:`4648` استفاده می‌کند." -msgid "This version does not allow the digit 0 (zero) to the letter O (oh) and digit 1 (one) to either the letter I (eye) or letter L (el) mappings, all these characters are included in the Extended Hex Alphabet and are not interchangeable." +msgid "" +"This version does not allow the digit 0 (zero) to the letter O (oh) and digit " +"1 (one) to either the letter I (eye) or letter L (el) mappings, all these " +"characters are included in the Extended Hex Alphabet and are not " +"interchangeable." msgstr "" +"این نسخه اجازه‌ی نگاشت رقم ۰ (صفر) به حرف O (اوه) و نگاشت رقم ۱ (یک) به حرف I " +"(آی) یا حرف L (اِل) را نمی‌دهد؛ همه‌ی این نویسه‌ها در الفبای مبنای شانزده توسعه‌یافته (Extended " +"Hex Alphabet) گنجانده شده‌اند و قابل تعویض با یکدیگر نیستند." -msgid "Encode the :term:`bytes-like object` *s* using Base16 and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *s* using Base16 and return the " +"encoded :class:`bytes`." msgstr "" +"شیء :term:`bytes-like object` *s* را با استفاده از Base16 کدگذاری کنید " +"و :class:`bytes` کدگذاری‌شده را برگردانید." -msgid "Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and return the decoded :class:`bytes`." +msgid "" +"Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." msgstr "" +"کدگشایی :term:`bytes-like object` یا رشته‌ی ASCII *s* کدگذاری‌شده با Base16 و " +"برگرداندن :class:`bytes` کدگشایی‌شده." msgid "Base85 Encodings" -msgstr "" +msgstr "کدگذاری‌های Base85" -msgid "Base85 encoding is a family of algorithms which represent four bytes using five ASCII characters. Originally implemented in the Unix ``btoa(1)`` utility, a version of it was later adopted by Adobe in the PostScript language and is standardized in PDF 2.0 (ISO 32000-2). This version, in both its ``btoa`` and PDF variants, is implemented by :func:`a85encode`." -msgstr "" +msgid "" +"Base85 encoding is a family of algorithms which represent four bytes using " +"five ASCII characters. Originally implemented in the Unix ``btoa(1)`` " +"utility, a version of it was later adopted by Adobe in the PostScript " +"language and is standardized in PDF 2.0 (ISO 32000-2). This version, in both " +"its ``btoa`` and PDF variants, is implemented by :func:`a85encode`." +msgstr "" +"کدگذاری Base85 خانواده‌ای از الگوریتم‌ها است که ۴ بایت را با ۵ نویسه‌ی ASCII " +"بازنمایی می‌کنند. این کدگذاری در ابتدا در ابزار ``btoa(1)`` یونیکس پیاده‌سازی " +"شد؛ نسخه‌ای از آن بعداً توسط Adobe در زبان PostScript پذیرفته شد و در PDF 2.0 " +"(ISO 32000-2) استاندارد شده است. این نسخه، در هر دو گونه‌ی ``btoa`` و PDF خود، " +"توسط :func:`a85encode` پیاده‌سازی شده است." -msgid "A separate version, using a different output character set, was defined as an April Fool's joke in :rfc:`1924` but is now used by Git and other software. This version is implemented by :func:`b85encode`." +msgid "" +"A separate version, using a different output character set, was defined as an " +"April Fool's joke in :rfc:`1924` but is now used by Git and other software. " +"This version is implemented by :func:`b85encode`." msgstr "" +"نسخه‌ای جداگانه، با استفاده از مجموعه نویسه خروجی متفاوت، به‌عنوان شوخی روز اول " +"آوریل در :rfc:`1924` تعریف شد، اما اکنون توسط Git و سایر نرم‌افزارها استفاده " +"می‌شود. این نسخه توسط :func:`b85encode` پیاده‌سازی شده است." -msgid "Finally, a third version, using yet another output character set designed for safe inclusion in programming language strings, is defined by ZeroMQ and implemented here by :func:`z85encode`." +msgid "" +"Finally, a third version, using yet another output character set designed for " +"safe inclusion in programming language strings, is defined by ZeroMQ and " +"implemented here by :func:`z85encode`." msgstr "" +"در نهایت، نسخه سومی، با استفاده از مجموعه‌ی نویسه‌ی خروجی دیگری که برای درج امن " +"در رشته‌های زبان برنامه‌نویسی طراحی شده است، توسط ZeroMQ تعریف شده و در اینجا " +"توسط :func:`z85encode` پیاده‌سازی شده است." -msgid "The functions present in this module differ in how they handle the following:" -msgstr "" +msgid "" +"The functions present in this module differ in how they handle the following:" +msgstr "تابع‌های موجود در این ماژول در نحوه‌ی مدیریت موارد زیر تفاوت دارند:" msgid "Whether to include and expect enclosing ``<~`` and ``~>`` markers." msgstr "" +"اینکه آیا باید نشانگرهای دربرگیرنده‌ی ``<~`` و ``~>`` را گنجاند و انتظار داشت." msgid "Whether to fold the input into multiple lines." -msgstr "" +msgstr "اینکه آیا ورودی به چند خط شکسته شود یا خیر." msgid "The set of ASCII characters used for encoding." -msgstr "" +msgstr "مجموعه‌ای از نویسه‌های ASCII که برای کدگذاری استفاده می‌شوند." msgid "Compact encodings of sequences of spaces and null bytes." -msgstr "" +msgstr "کدگذاری‌های فشرده برای دنباله‌هایی از فاصله‌ها و بایت‌های null." msgid "The encoding of zero-padding bytes applied to the input." -msgstr "" +msgstr "کدگذاری بایت‌های پدینگ صفر (zero-padding) اعمال‌شده بر ورودی." -msgid "Refer to the documentation of the individual functions for more information." -msgstr "" +msgid "" +"Refer to the documentation of the individual functions for more information." +msgstr "برای اطلاعات بیشتر، به مستندات هر یک از تابع‌ها مراجعه کنید." -msgid "Encode the :term:`bytes-like object` *b* using Ascii85 and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *b* using Ascii85 and return the " +"encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *b* را با استفاده از Ascii85 کدگذاری می‌کند " +"و :class:`bytes` کدگذاری‌شده را برمی‌گرداند." -msgid "*foldspaces* is an optional flag that uses the special short sequence 'y' instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This feature is not supported by the standard encoding used in PDF." +msgid "" +"*foldspaces* is an optional flag that uses the special short sequence 'y' " +"instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " +"feature is not supported by the standard encoding used in PDF." msgstr "" +"*foldspaces* یک پرچم اختیاری است که به‌جای ۴ فاصله‌ی متوالی (ASCII 0x20)، از " +"دنباله‌ی کوتاه ویژه‌ی 'y' استفاده می‌کند؛ همان‌طور که توسط 'btoa' پشتیبانی می‌شود. " +"این قابلیت توسط کدگذاری استاندارد استفاده‌شده در PDF پشتیبانی نمی‌شود." -msgid "*wrapcol* controls whether the output should have newline (``b'\\n'``) characters added to it. If this is non-zero, each output line will be at most this many characters long, excluding the trailing newline." +msgid "" +"*wrapcol* controls whether the output should have newline (``b'\\n'``) " +"characters added to it. If this is non-zero, each output line will be at most " +"this many characters long, excluding the trailing newline." msgstr "" +"*wrapcol* تعیین می‌کند که آیا باید نویسه‌های خط جدید (``b'\\n'``) به خروجی " +"افزوده شوند یا خیر. اگر این مقدار غیرصفر باشد، طول هر خط خروجی حداکثر این " +"تعداد نویسه خواهد بود، بدون احتساب نویسه خط جدید پایانی." -msgid "*pad* controls whether zero-padding applied to the end of the input is fully retained in the output encoding, as done by ``btoa``, producing an exact multiple of 5 bytes of output. This is not part of the standard encoding used in PDF, as it does not preserve the length of the data." +msgid "" +"*pad* controls whether zero-padding applied to the end of the input is fully " +"retained in the output encoding, as done by ``btoa``, producing an exact " +"multiple of 5 bytes of output. This is not part of the standard encoding used " +"in PDF, as it does not preserve the length of the data." msgstr "" +"*pad* مشخص می‌کند که آیا پدینگ صفر (zero-padding) اعمال‌شده به انتهای " +"ورودی به‌طور کامل در کدگذاری خروجی حفظ می‌شوند، همان‌طور که ``btoa`` این کار را " +"انجام می‌دهد و خروجی‌ای تولید می‌کند که دقیقاً مضربی از ۵ بایت است. این بخشی از " +"کدگذاری استاندارد استفاده‌شده در PDF نیست، زیرا طول داده را حفظ نمی‌کند." -msgid "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and ``~>``, as in a PostScript base-85 string literal. Note that while ASCII85Decode streams in PDF documents *must* be terminated with ``~>``, they *must not* use a leading ``<~``." +msgid "" +"*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " +"``~>``, as in a PostScript base-85 string literal. Note that while " +"ASCII85Decode streams in PDF documents *must* be terminated with ``~>``, they " +"*must not* use a leading ``<~``." msgstr "" +"*adobe* تعیین می‌کند که آیا دنباله‌ی بایتی کدگذاری‌شده با ``<~`` و ``~>`` محصور " +"شود یا خیر، همان‌گونه که در یک لفظی رشته‌ای PostScript base-85 وجود دارد. " +"توجه داشته باشید که جریان‌های ASCII85Decode در اسناد PDF *باید* با ``~>`` " +"پایان یابند، اما *نباید* با ``<~`` آغاز شوند." -msgid "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and return the decoded :class:`bytes`." +msgid "" +"Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " +"return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته‌ی ASCII *b* را که با Ascii85 کدگذاری‌شده است، " +"کدگشایی می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "*foldspaces* is a flag that specifies whether the 'y' short sequence should be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is not supported by the standard Ascii85 encoding used in PDF and PostScript." +msgid "" +"*foldspaces* is a flag that specifies whether the 'y' short sequence should " +"be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " +"is not supported by the standard Ascii85 encoding used in PDF and PostScript." msgstr "" +"*foldspaces* پرچمی است که مشخص می‌کند آیا دنباله‌ی کوتاه 'y' باید به‌عنوان مخففی " +"برای ۴ فاصله‌ی متوالی (ASCII 0x20) پذیرفته شود یا خیر. این قابلیت در کدگذاری " +"استاندارد Ascii85 که در PDF و PostScript استفاده می‌شود، پشتیبانی نمی‌شود." -msgid "*adobe* controls whether the ``<~`` and ``~>`` markers are present. While the leading ``<~`` is not required, the input must end with ``~>``, or a :exc:`ValueError` is raised." +msgid "" +"*adobe* controls whether the ``<~`` and ``~>`` markers are present. While the " +"leading ``<~`` is not required, the input must end with ``~>``, or " +"a :exc:`ValueError` is raised." msgstr "" +"*adobe* تعیین می‌کند که نشانگرهای ``<~`` و ``~>`` وجود داشته باشند. اگرچه " +"نشانگر ابتدایی ``<~`` الزامی نیست، اما ورودی باید با ``~>`` پایان یابد، در " +"غیر این صورت یک :exc:`ValueError` پرتاب می‌شود." -msgid "*ignorechars* should be a byte string containing characters to ignore from the input. This should only contain whitespace characters, and by default contains all whitespace characters in ASCII." +msgid "" +"*ignorechars* should be a byte string containing characters to ignore from " +"the input. This should only contain whitespace characters, and by default " +"contains all whitespace characters in ASCII." msgstr "" +"*ignorechars* باید یک رشته‌ی بایتی شامل نویسه‌هایی باشد که باید از ورودی نادیده " +"گرفته شوند. این رشته باید فقط شامل نویسه‌های فضای سفید باشد، و به‌طور پیش‌فرض " +"شامل تمام نویسه‌های فضای سفید در ASCII است." -msgid "Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-style binary diffs) and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" +"style binary diffs) and return the encoded :class:`bytes`." msgstr "" +"شیء شبه‌بایت (:term:`bytes-like object`) *b* را با استفاده از base85 (که " +"برای مثال در diffهای دودویی به‌سبک git استفاده می‌شود) کدگذاری می‌کند " +"و :class:`bytes` کدگذاری‌شده را برمی‌گرداند." -msgid "The input is padded with ``b'\\0'`` so its length is a multiple of 4 bytes before encoding. If *pad* is true, all the resulting characters are retained in the output, which will always be a multiple of 5 bytes, and thus the length of the data may not be preserved on decoding." +msgid "" +"The input is padded with ``b'\\0'`` so its length is a multiple of 4 bytes " +"before encoding. If *pad* is true, all the resulting characters are retained " +"in the output, which will always be a multiple of 5 bytes, and thus the " +"length of the data may not be preserved on decoding." msgstr "" +"ورودی با ``b'\\0'`` پر می‌شود تا طول آن پیش از کدگذاری مضربی از ۴ بایت باشد. " +"اگر *pad* درست باشد، تمام نویسه‌های حاصل در خروجی نگه داشته می‌شوند؛ خروجی " +"همیشه مضربی از ۵ بایت خواهد بود، و بنابراین ممکن است طول داده هنگام کدگشایی " +"حفظ نشود." -msgid "Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and return the decoded :class:`bytes`." +msgid "" +"Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " +"return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته‌ی ASCII *b* را که با base85 کدگذاری‌شده است، " +"کدگشایی می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and return the encoded :class:`bytes`." +msgid "" +"Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " +"return the encoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* را با استفاده از Z85 (همان‌طور که در ZeroMQ " +"استفاده می‌شود) کدگذاری کنید و :class:`bytes` کدگذاری‌شده را برگردانید." -msgid "The `ZeroMQ specification `_ requires the length of Z85-encoded data to be a multiple of 5 bytes. To produce compliant data frames, you must pad the input data to this function to a multiple of 4 bytes." +msgid "" +"The `ZeroMQ specification `_ requires the " +"length of Z85-encoded data to be a multiple of 5 bytes. To produce compliant " +"data frames, you must pad the input data to this function to a multiple of 4 " +"bytes." msgstr "" +"`مشخصات ZeroMQ `_ الزام می‌کند که طول داده‌های " +"کدگذاری‌شده با Z85 مضربی از ۵ بایت باشد. برای تولید فریم‌های داده‌ی سازگار، باید " +"داده‌های ورودی به این تابع را تا مضربی از ۴ بایت پد (pad) کنید." -msgid "Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and return the decoded :class:`bytes`." +msgid "" +"Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` یا رشته ASCII *s* کدگذاری‌شده با Z85 را کدگشایی " +"می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." msgid "Legacy Interface" -msgstr "" +msgstr "رابط قدیمی" -msgid "Decode the contents of the binary *input* file and write the resulting binary data to the *output* file. *input* and *output* must be :term:`file objects `. *input* will be read until ``input.readline()`` returns an empty bytes object." +msgid "" +"Decode the contents of the binary *input* file and write the resulting binary " +"data to the *output* file. *input* and *output* must be :term:`file objects " +"`. *input* will be read until ``input.readline()`` returns an " +"empty bytes object." msgstr "" +"محتوای فایل دودویی *input* را کدگشایی کنید و داده‌های دودویی حاصل را در فایل " +"*output* بنویسید. *input* و *output* باید :term:`اشیای فایل ` " +"باشند. *input* تا زمانی خوانده می‌شود که ``input.readline()`` یک شیء bytes " +"خالی برگرداند." -msgid "Decode the :term:`bytes-like object` *s*, which must contain one or more lines of base64 encoded data, and return the decoded :class:`bytes`." +msgid "" +"Decode the :term:`bytes-like object` *s*, which must contain one or more " +"lines of base64 encoded data, and return the decoded :class:`bytes`." msgstr "" +":term:`bytes-like object` *s* را، که باید شامل یک یا چند خط داده‌ی کدگذاری‌شده " +"به base64 باشد، کدگشایی می‌کند و :class:`bytes` کدگشایی‌شده را برمی‌گرداند." -msgid "Encode the contents of the binary *input* file and write the resulting base64 encoded data to the *output* file. *input* and *output* must be :term:`file objects `. *input* will be read until ``input.read()`` returns an empty bytes object. :func:`encode` inserts a newline character (``b'\\n'``) after every 76 bytes of the output, as well as ensuring that the output always ends with a newline, as per :rfc:`2045` (MIME)." -msgstr "" +msgid "" +"Encode the contents of the binary *input* file and write the resulting base64 " +"encoded data to the *output* file. *input* and *output* must be :term:`file " +"objects `. *input* will be read until ``input.read()`` returns " +"an empty bytes object. :func:`encode` inserts a newline character " +"(``b'\\n'``) after every 76 bytes of the output, as well as ensuring that the " +"output always ends with a newline, as per :rfc:`2045` (MIME)." +msgstr "" +"محتویات فایل دودویی *input* را کدگذاری کنید و داده‌های حاصل کدگذاری‌شده با " +"base64 را در فایل *output* بنویسید. *input* و *output* باید :term:`اشیای " +"فایل ` باشند. *input* تا زمانی خوانده می‌شود که ``input.read()`` " +"یک شیء بایت خالی برگرداند. :func:`encode` یک نویسه خط جدید (``b'\\n'``) را پس " +"از هر ۷۶ بایت از خروجی درج می‌کند و همچنین اطمینان حاصل می‌کند که خروجی همیشه " +"با یک خط جدید پایان می‌یابد، مطابق :rfc:`2045` (MIME)." -msgid "Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary data, and return :class:`bytes` containing the base64-encoded data, with newlines (``b'\\n'``) inserted after every 76 bytes of output, and ensuring that there is a trailing newline, as per :rfc:`2045` (MIME)." +msgid "" +"Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " +"data, and return :class:`bytes` containing the base64-encoded data, with " +"newlines (``b'\\n'``) inserted after every 76 bytes of output, and ensuring " +"that there is a trailing newline, as per :rfc:`2045` (MIME)." msgstr "" +":term:`شیء شبه‌بایت ` *s* را، که می‌تواند حاوی داده‌های " +"دودویی دلخواه باشد، کدگذاری می‌کند و :class:`bytes` حاوی داده‌های کدگذاری‌شده با " +"base64 را برمی‌گرداند؛ به‌گونه‌ای که خط‌های جدید (``b'\\n'``) پس از هر ۷۶ بایت از " +"خروجی درج شوند و اطمینان حاصل شود که یک خط جدید پایانی وجود دارد، " +"مطابق :rfc:`2045` (MIME)." msgid "An example usage of the module:" -msgstr "" +msgstr "نمونه‌ای از استفاده از ماژول:" msgid "Security Considerations" -msgstr "" +msgstr "ملاحظات امنیتی" -msgid "A new security considerations section was added to :rfc:`4648` (section 12); it's recommended to review the security section for any code deployed to production." +msgid "" +"A new security considerations section was added to :rfc:`4648` (section 12); " +"it's recommended to review the security section for any code deployed to " +"production." msgstr "" +"بخش ملاحظات امنیتی جدیدی به :rfc:`4648` (بخش ۱۲) افزوده شده است؛ توصیه می‌شود " +"بخش امنیتی را برای هر کدی که در محیط عملیاتی مستقر شده است، بازبینی کنید." msgid "Module :mod:`binascii`" -msgstr "" +msgstr "ماژول :mod:`binascii`" -msgid "Support module containing ASCII-to-binary and binary-to-ASCII conversions." -msgstr "" +msgid "" +"Support module containing ASCII-to-binary and binary-to-ASCII conversions." +msgstr "ماژول پشتیبانی شامل تبدیل‌های ASCII به دودویی و دودویی به ASCII." -msgid ":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies" +msgid "" +":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " +"Mechanisms for Specifying and Describing the Format of Internet Message Bodies" msgstr "" +":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) بخش یکم: " +"سازوکارهایی برای تعیین و توصیف قالب بدنه‌های پیام اینترنتی" -msgid "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition of the base64 encoding." +msgid "" +"Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition of " +"the base64 encoding." msgstr "" +"بخش ۵.۲، «Base64 Content-Transfer-Encoding»، تعریف کدگذاری base64 را ارائه " +"می‌دهد." -msgid "`ISO 32000-2 Portable document format - Part 2: PDF 2.0 `_" +msgid "" +"`ISO 32000-2 Portable document format - Part 2: PDF 2.0 `_" msgstr "" +"`ISO 32000-2 قالب سند قابل‌حمل - بخش ۲: PDF 2.0 `_" -msgid "Section 7.4.3, \"ASCII85Decode Filter,\" provides the definition of the Ascii85 encoding used in PDF and PostScript, including the output character set and the details of data length preservation using zero-padding and partial output groups." +msgid "" +"Section 7.4.3, \"ASCII85Decode Filter,\" provides the definition of the " +"Ascii85 encoding used in PDF and PostScript, including the output character " +"set and the details of data length preservation using zero-padding and " +"partial output groups." msgstr "" +"بخش 7.4.3، «ASCII85Decode Filter»، تعریف کدگذاری Ascii85 استفاده‌شده در PDF و " +"PostScript را ارائه می‌دهد، از جمله مجموعه نویسه‌های خروجی و جزئیات حفظ طول " +"داده با استفاده از پدینگ صفر (zero-padding) و گروه‌های خروجی جزئی." msgid "`ZeroMQ RFC 32/Z85 `_" -msgstr "" +msgstr "`ZeroMQ RFC 32/Z85 `_" -msgid "The \"Formal Specification\" section provides the character set used in Z85." -msgstr "" +msgid "" +"The \"Formal Specification\" section provides the character set used in Z85." +msgstr "بخش «مشخصات رسمی» مجموعه نویسه‌های مورد استفاده در Z85 را ارائه می‌دهد." msgid "base64" -msgstr "" +msgstr "base64" msgid "encoding" -msgstr "" +msgstr "کدگذاری" msgid "MIME" -msgstr "" +msgstr "MIME" msgid "base64 encoding" -msgstr "" +msgstr "کدگذاری base64" diff --git a/library/bdb.po b/library/bdb.po index 45f173c48..7ce5edaaf 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"PO-Revision-Date: 2026-08-28 11:30+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,360 +22,730 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!bdb` --- Debugger framework" -msgstr "" +msgstr ":mod:`!bdb` --- چارچوب اشکال‌زدا" msgid "**Source code:** :source:`Lib/bdb.py`" -msgstr "" +msgstr ":source:`Lib/bdb.py`" -msgid "The :mod:`!bdb` module handles basic debugger functions, like setting breakpoints or managing execution via the debugger." +msgid "" +"The :mod:`!bdb` module handles basic debugger functions, like setting " +"breakpoints or managing execution via the debugger." msgstr "" +"ماژول :mod:`!bdb` عملکردهای پایه‌ی اشکال‌زدا را بر عهده دارد، مانند تنظیم " +"نقاط توقف یا مدیریت اجرا از طریق اشکال‌زدا." msgid "The following exception is defined:" -msgstr "" +msgstr "استثنای زیر تعریف شده است:" msgid "Exception raised by the :class:`Bdb` class for quitting the debugger." -msgstr "" +msgstr "استثنایی که توسط کلاس :class:`Bdb` برای خروج از اشکال‌زدا پرتاب می‌شود." msgid "The :mod:`!bdb` module also defines two classes:" -msgstr "" +msgstr "ماژول :mod:`!bdb` همچنین دو کلاس تعریف می‌کند:" -msgid "This class implements temporary breakpoints, ignore counts, disabling and (re-)enabling, and conditionals." +msgid "" +"This class implements temporary breakpoints, ignore counts, disabling and " +"(re-)enabling, and conditionals." msgstr "" +"این کلاس نقاط توقف موقت، تعداد نادیده‌گرفتن، غیرفعال‌سازی و فعال‌سازی مجدد، و " +"شرطی‌ها را پیاده‌سازی می‌کند." -msgid "Breakpoints are indexed by number through a list called :attr:`bpbynumber` and by ``(file, line)`` pairs through :attr:`bplist`. The former points to a single instance of class :class:`Breakpoint`. The latter points to a list of such instances since there may be more than one breakpoint per line." +msgid "" +"Breakpoints are indexed by number through a list called :attr:`bpbynumber` " +"and by ``(file, line)`` pairs through :attr:`bplist`. The former points to " +"a single instance of class :class:`Breakpoint`. The latter points to a " +"list of such instances since there may be more than one breakpoint per line." msgstr "" +"نقاط شکست بر اساس شماره از طریق فهرستی به نام :attr:`bpbynumber` و بر اساس " +"جفت‌های ``(file, line)`` از طریق :attr:`bplist` اندیس‌دهی شده‌اند. مورد اول به " +"یک نمونه از کلاس :class:`Breakpoint` اشاره می‌کند. مورد دوم به فهرستی از " +"چنین نمونه‌هایی اشاره می‌کند، زیرا ممکن است بیش از یک نقطه شکست در هر خط وجود " +"داشته باشد." -msgid "When creating a breakpoint, its associated :attr:`file name ` should be in canonical form. If a :attr:`funcname` is defined, a breakpoint :attr:`hit ` will be counted when the first line of that function is executed. A :attr:`conditional ` breakpoint always counts a :attr:`hit `." +msgid "" +"When creating a breakpoint, its associated :attr:`file name ` should " +"be in canonical form. If a :attr:`funcname` is defined, a " +"breakpoint :attr:`hit ` will be counted when the first line of that " +"function is executed. A :attr:`conditional ` breakpoint always " +"counts a :attr:`hit `." msgstr "" +"هنگام ایجاد یک نقطه توقف، :attr:`file name ` مرتبط با آن باید به‌صورت " +"کانونیکال باشد. اگر :attr:`funcname` تعریف شده باشد، با اجرای اولین خط آن " +"تابع، یک :attr:`hit ` برای نقطه توقف شمارش می‌شود. نقطه " +"توقف :attr:`conditional ` همیشه یک :attr:`hit ` را می‌شمارد." msgid ":class:`Breakpoint` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`Breakpoint` متدهای زیر را دارند:" -msgid "Delete the breakpoint from the list associated to a file/line. If it is the last breakpoint in that position, it also deletes the entry for the file/line." +msgid "" +"Delete the breakpoint from the list associated to a file/line. If it is " +"the last breakpoint in that position, it also deletes the entry for the " +"file/line." msgstr "" +"نقطه توقف را از فهرست مرتبط با فایل/خط حذف می‌کند. اگر آخرین نقطه توقف در آن " +"موقعیت باشد، آیتم مربوط به فایل/خط را نیز حذف می‌کند." msgid "Mark the breakpoint as enabled." -msgstr "" +msgstr "نقطه توقف را به‌عنوان فعال علامت‌گذاری کنید." msgid "Mark the breakpoint as disabled." -msgstr "" +msgstr "نقطه توقف را به‌عنوان غیرفعال علامت‌گذاری می‌کند." -msgid "Return a string with all the information about the breakpoint, nicely formatted:" +msgid "" +"Return a string with all the information about the breakpoint, nicely " +"formatted:" msgstr "" +"رشته‌ای حاوی همه اطلاعات درباره نقطه توقف (breakpoint) با قالب‌بندی مناسب " +"برمی‌گرداند:" msgid "Breakpoint number." -msgstr "" +msgstr "شماره‌ی نقطه‌ی توقف." msgid "Temporary status (del or keep)." -msgstr "" +msgstr "وضعیت موقت (حذف یا نگهداری)." msgid "File/line position." -msgstr "" +msgstr "موقعیت فایل/خط." msgid "Break condition." -msgstr "" +msgstr "شرط توقف." msgid "Number of times to ignore." -msgstr "" +msgstr "تعداد دفعاتی که باید نادیده گرفته شود." msgid "Number of times hit." -msgstr "" +msgstr "تعداد دفعات برخورد." -msgid "Print the output of :meth:`bpformat` to the file *out*, or if it is ``None``, to standard output." +msgid "" +"Print the output of :meth:`bpformat` to the file *out*, or if it is " +"``None``, to standard output." msgstr "" +"خروجی :meth:`bpformat` را در فایل *out* چاپ می‌کند، یا اگر *out* ``None`` " +"باشد، در خروجی استاندارد." msgid ":class:`Breakpoint` instances have the following attributes:" -msgstr "" +msgstr "نمونه‌های :class:`Breakpoint` دارای ویژگی‌های زیر هستند:" msgid "File name of the :class:`Breakpoint`." -msgstr "" +msgstr "نام فایلِ :class:`Breakpoint`." msgid "Line number of the :class:`Breakpoint` within :attr:`file`." -msgstr "" +msgstr "شماره‌ی خط :class:`Breakpoint` در :attr:`file`." msgid "``True`` if a :class:`Breakpoint` at (file, line) is temporary." -msgstr "" +msgstr "``True`` اگر یک :class:`Breakpoint` در (file, line) موقت باشد." msgid "Condition for evaluating a :class:`Breakpoint` at (file, line)." -msgstr "" +msgstr "شرط برای ارزیابی یک :class:`Breakpoint` در (file, line)." -msgid "Function name that defines whether a :class:`Breakpoint` is hit upon entering the function." +msgid "" +"Function name that defines whether a :class:`Breakpoint` is hit upon " +"entering the function." msgstr "" +"نام تابعی که تعیین می‌کند آیا یک :class:`Breakpoint` هنگام ورود به تابع فعال " +"می‌شود یا خیر." msgid "``True`` if :class:`Breakpoint` is enabled." -msgstr "" +msgstr "اگر :class:`Breakpoint` فعال باشد، ``True`` است." msgid "Numeric index for a single instance of a :class:`Breakpoint`." -msgstr "" +msgstr "اندیس عددی برای یک نمونه از :class:`Breakpoint`." -msgid "Dictionary of :class:`Breakpoint` instances indexed by (:attr:`file`, :attr:`line`) tuples." +msgid "" +"Dictionary of :class:`Breakpoint` instances indexed by " +"(:attr:`file`, :attr:`line`) tuples." msgstr "" +"دیکشنری از نمونه‌های :class:`Breakpoint` که با تاپل‌های " +"(:attr:`file`، :attr:`line`) اندیس‌گذاری شده است." msgid "Number of times to ignore a :class:`Breakpoint`." -msgstr "" +msgstr "تعداد دفعاتی که باید یک :class:`Breakpoint` نادیده گرفته شود." msgid "Count of the number of times a :class:`Breakpoint` has been hit." -msgstr "" +msgstr "تعداد دفعاتی که به یک :class:`Breakpoint` رسیده است." msgid "The :class:`Bdb` class acts as a generic Python debugger base class." msgstr "" +"کلاس :class:`Bdb` به‌عنوان یک کلاس پایه عام برای اشکال‌زدای پایتون عمل " +"می‌کند." -msgid "This class takes care of the details of the trace facility; a derived class should implement user interaction. The standard debugger class (:class:`pdb.Pdb`) is an example." +msgid "" +"This class takes care of the details of the trace facility; a derived class " +"should implement user interaction. The standard debugger class " +"(:class:`pdb.Pdb`) is an example." msgstr "" +"این کلاس جزئیات سازوکار ردگیری (trace) را بر عهده می‌گیرد؛ یک کلاس مشتق باید " +"تعامل با کاربر را پیاده‌سازی کند. کلاس اشکال‌زدای استاندارد " +"(:class:`pdb.Pdb`) نمونه‌ای است." -msgid "The *skip* argument, if given, must be an iterable of glob-style module name patterns. The debugger will not step into frames that originate in a module that matches one of these patterns. Whether a frame is considered to originate in a certain module is determined by the ``__name__`` in the frame globals." +msgid "" +"The *skip* argument, if given, must be an iterable of glob-style module " +"name patterns. The debugger will not step into frames that originate in a " +"module that matches one of these patterns. Whether a frame is considered to " +"originate in a certain module is determined by the ``__name__`` in the " +"frame globals." msgstr "" +"آرگومان *skip*، در صورت ارائه‌شدن، باید پیمایش‌پذیری از الگوهای نام ماژول " +"به‌سبک glob باشد. اشکال‌زدا وارد فریم‌هایی که از ماژولی منطبق با یکی از این " +"الگوها سرچشمه می‌گیرند، نمی‌شود. اینکه یک فریم سرچشمه‌گرفته از یک ماژول معین " +"در نظر گرفته شود، با ``__name__`` در فضای نام سراسری فریم تعیین می‌شود." -msgid "The *backend* argument specifies the backend to use for :class:`Bdb`. It can be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` uses :func:`sys.settrace` which has the best backward compatibility. The ``'monitoring'`` backend uses the new :mod:`sys.monitoring` that was introduced in Python 3.12, which can be much more efficient because it can disable unused events. We are trying to keep the exact interfaces for both backends, but there are some differences. The debugger developers are encouraged to use the ``'monitoring'`` backend to achieve better performance." -msgstr "" +msgid "" +"The *backend* argument specifies the backend to use for :class:`Bdb`. It " +"can be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` " +"uses :func:`sys.settrace` which has the best backward compatibility. The " +"``'monitoring'`` backend uses the new :mod:`sys.monitoring` that was " +"introduced in Python 3.12, which can be much more efficient because it can " +"disable unused events. We are trying to keep the exact interfaces for both " +"backends, but there are some differences. The debugger developers are " +"encouraged to use the ``'monitoring'`` backend to achieve better " +"performance." +msgstr "" +"آرگومان *بک‌اند* (backend) مشخص می‌کند که کدام بک‌اند برای :class:`Bdb` " +"استفاده شود. این آرگومان می‌تواند ``'settrace'`` یا ``'monitoring'`` باشد. " +"``'settrace'`` از :func:`sys.settrace` استفاده می‌کند که بهترین سازگاری رو " +"به عقب را دارد. بک‌اند ``'monitoring'`` از :mod:`sys.monitoring` جدیدی " +"استفاده می‌کند که در پایتون 3.12 معرفی شده است و می‌تواند بسیار کارآمدتر " +"باشد، زیرا می‌تواند رویدادهای استفاده‌نشده را غیرفعال کند. ما در تلاشیم " +"رابط‌های دقیقاً یکسانی را برای هر دو بک‌اند حفظ کنیم، اما تفاوت‌هایی وجود دارد. " +"توسعه‌دهندگان اشکال‌زدا تشویق می‌شوند برای دستیابی به عملکرد بهتر از بک‌اند " +"``'monitoring'`` استفاده کنند." msgid "Added the *skip* parameter." -msgstr "" +msgstr "پارامتر *skip* افزوده شد." msgid "Added the *backend* parameter." -msgstr "" +msgstr "پارامتر *backend* افزوده شد." -msgid "The following methods of :class:`Bdb` normally don't need to be overridden." -msgstr "" +msgid "" +"The following methods of :class:`Bdb` normally don't need to be overridden." +msgstr "متدهای زیرِ :class:`Bdb` معمولاً نیازی به بازنویسی ندارند." msgid "Return canonical form of *filename*." -msgstr "" +msgstr "صورت کانونیکال *filename* را برمی‌گرداند." -msgid "For real file names, the canonical form is an operating-system-dependent, :func:`case-normalized ` :func:`absolute path `. A *filename* with angle brackets, such as ``\"\"`` generated in interactive mode, is returned unchanged." +msgid "" +"For real file names, the canonical form is an operating-system-" +"dependent, :func:`case-normalized ` :func:`absolute path " +"`. A *filename* with angle brackets, such as " +"``\"\"`` generated in interactive mode, is returned unchanged." msgstr "" +"برای نام فایل‌های واقعی، صورت کانونیکال یک :func:`مسیر مطلق ` " +"است که به سیستم‌عامل وابسته است و :func:`نرمال‌شده از نظر بزرگی و کوچکی حروف " +"` است. یک *نام فایل* دارای علامت‌های زاویه‌ای، مانند " +"``\"\"`` که در حالت تعاملی تولید می‌شود، بدون تغییر برگردانده می‌شود." -msgid "Start tracing. For ``'settrace'`` backend, this method is equivalent to ``sys.settrace(self.trace_dispatch)``" +msgid "" +"Start tracing. For ``'settrace'`` backend, this method is equivalent to " +"``sys.settrace(self.trace_dispatch)``" msgstr "" +"ردگیری را شروع می‌کند. برای بک‌اند (backend) ``'settrace'``، این متد معادل " +"``sys.settrace(self.trace_dispatch)`` است" -msgid "Stop tracing. For ``'settrace'`` backend, this method is equivalent to ``sys.settrace(None)``" +msgid "" +"Stop tracing. For ``'settrace'`` backend, this method is equivalent to " +"``sys.settrace(None)``" msgstr "" +"ردگیری را متوقف می‌کند. برای بک‌اند (backend) ``'settrace'``، این متد معادل " +"``sys.settrace(None)`` است" -msgid "Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :attr:`quitting ` attributes with values ready to start debugging." +msgid "" +"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` " +"and :attr:`quitting ` attributes with values ready to start " +"debugging." msgstr "" +"ویژگی‌های :attr:`!botframe`، :attr:`!stopframe`، :attr:`!returnframe` " +"و :attr:`quitting ` را با مقادیر آماده برای شروع اشکال‌زدایی " +"تنظیم کنید." -msgid "This function is installed as the trace function of debugged frames. Its return value is the new trace function (in most cases, that is, itself)." +msgid "" +"This function is installed as the trace function of debugged frames. Its " +"return value is the new trace function (in most cases, that is, itself)." msgstr "" +"این تابع به‌عنوان تابع ردگیری فریم‌های در حال اشکال‌زدایی نصب می‌شود. مقدار " +"بازگشتی آن، تابع ردگیری جدید است (در بیشتر موارد، خود تابع)." -msgid "The default implementation decides how to dispatch a frame, depending on the type of event (passed as a string) that is about to be executed. *event* can be one of the following:" +msgid "" +"The default implementation decides how to dispatch a frame, depending on " +"the type of event (passed as a string) that is about to be executed. " +"*event* can be one of the following:" msgstr "" +"پیاده‌سازی پیش‌فرض بسته به نوع رویدادی که به‌صورت یک رشته ارسال می‌شود و قرار " +"است اجرا شود، تصمیم می‌گیرد که چگونه یک فریمرا اعزام (dispatch) " +"کند. *event* می‌تواند یکی از موارد زیر باشد:" msgid "``\"line\"``: A new line of code is going to be executed." -msgstr "" +msgstr "``\"line\"``: خط جدیدی از کد در شرف اجرا است." -msgid "``\"call\"``: A function is about to be called, or another code block entered." +msgid "" +"``\"call\"``: A function is about to be called, or another code block " +"entered." msgstr "" +"``\"call\"``: یک تابع در آستانه‌ی فراخوانی است، یا به بلوک کد دیگری وارد شده " +"است." msgid "``\"return\"``: A function or other code block is about to return." -msgstr "" +msgstr "``\"return\"``: یک تابع یا بلوک کد دیگر در آستانه بازگشت است." msgid "``\"exception\"``: An exception has occurred." -msgstr "" +msgstr "``\"exception\"``: یک استثنا رخ داده است." msgid "``\"c_call\"``: A C function is about to be called." -msgstr "" +msgstr "``\"c_call\"``: یک تابع C در آستانه فراخوانی است." msgid "``\"c_return\"``: A C function has returned." -msgstr "" +msgstr "``\"c_return\"``: یک تابع C بازگشته است." msgid "``\"c_exception\"``: A C function has raised an exception." -msgstr "" +msgstr "``\"c_exception\"``: یک تابع C استثنایی را پرتاب کرده است." -msgid "For the Python events, specialized functions (see below) are called. For the C events, no action is taken." +msgid "" +"For the Python events, specialized functions (see below) are called. For " +"the C events, no action is taken." msgstr "" +"برای رویدادهای پایتون، توابع تخصصی (در زیر ببینید) فراخوانی می‌شوند. برای " +"رویدادهای C، هیچ اقدامی انجام نمی‌شود." msgid "The *arg* parameter depends on the previous event." -msgstr "" +msgstr "پارامتر *arg* به رویداد قبلی بستگی دارد." -msgid "See the documentation for :func:`sys.settrace` for more information on the trace function. For more information on code and frame objects, refer to :ref:`types`." +msgid "" +"See the documentation for :func:`sys.settrace` for more information on the " +"trace function. For more information on code and frame objects, refer " +"to :ref:`types`." msgstr "" +"برای اطلاعات بیشتر درباره تابع ردگیری (trace)، مستندات :func:`sys.settrace` " +"را ببینید. برای اطلاعات بیشتر درباره اشیای کد (code) و فریم ، " +"به :ref:`types` مراجعه کنید." -msgid "If the debugger should stop on the current line, invoke the :meth:`user_line` method (which should be overridden in subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` flag is set (which can be set from :meth:`user_line`). Return a reference to the :meth:`trace_dispatch` method for further tracing in that scope." -msgstr "" +msgid "" +"If the debugger should stop on the current line, invoke " +"the :meth:`user_line` method (which should be overridden in subclasses). " +"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " +"flag is set (which can be set from :meth:`user_line`). Return a reference " +"to the :meth:`trace_dispatch` method for further tracing in that scope." +msgstr "" +"اگر اشکال‌زدا باید در خط فعلی متوقف شود، متد :meth:`user_line` را فراخوانی " +"کنید (که باید در زیرکلاس‌ها بازنویسی شود). اگر پرچم :attr:`quitting " +"` تنظیم شده باشد (که می‌توان آن را از :meth:`user_line` تنظیم " +"کرد)، استثنای :exc:`BdbQuit` را پرتاب کنید. ارجاعی به " +"متد :meth:`trace_dispatch` برای ردگیری بیشتر در آن محدوده بازگشت دهید." -msgid "If the debugger should stop on this function call, invoke the :meth:`user_call` method (which should be overridden in subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` flag is set (which can be set from :meth:`user_call`). Return a reference to the :meth:`trace_dispatch` method for further tracing in that scope." -msgstr "" +msgid "" +"If the debugger should stop on this function call, invoke " +"the :meth:`user_call` method (which should be overridden in subclasses). " +"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " +"flag is set (which can be set from :meth:`user_call`). Return a reference " +"to the :meth:`trace_dispatch` method for further tracing in that scope." +msgstr "" +"اگر اشکال‌زدا باید در این فراخوانی تابع متوقف شود، متد :meth:`user_call` را " +"فراخوانی کنید (که باید در زیرکلاس‌ها بازنویسی شود). اگر " +"پرچم :attr:`quitting ` تنظیم شده باشد (که می‌توان آن را " +"از :meth:`user_call` تنظیم کرد)، استثنای :exc:`BdbQuit` را پرتاب کنید. " +"مرجعی به متد :meth:`trace_dispatch` برای ردگیری بیشتر در آن محدوده " +"برگردانید." -msgid "If the debugger should stop on this function return, invoke the :meth:`user_return` method (which should be overridden in subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` flag is set (which can be set from :meth:`user_return`). Return a reference to the :meth:`trace_dispatch` method for further tracing in that scope." -msgstr "" +msgid "" +"If the debugger should stop on this function return, invoke " +"the :meth:`user_return` method (which should be overridden in subclasses). " +"Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` " +"flag is set (which can be set from :meth:`user_return`). Return a " +"reference to the :meth:`trace_dispatch` method for further tracing in that " +"scope." +msgstr "" +"اگر اشکال‌زدا باید هنگام بازگشت این تابع متوقف شود، متد :meth:`user_return` " +"را فراخوانی کنید (که باید در زیرکلاس‌ها بازنویسی شود). اگر " +"پرچم :attr:`quitting ` تنظیم شده باشد (که می‌توان آن را " +"از :meth:`user_return` تنظیم کرد)، استثنای :exc:`BdbQuit` را پرتاب کنید. " +"ارجاعی به متد :meth:`trace_dispatch` برای ردگیری بیشتر در آن محدوده " +"برگردانید." -msgid "If the debugger should stop at this exception, invokes the :meth:`user_exception` method (which should be overridden in subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting ` flag is set (which can be set from :meth:`user_exception`). Return a reference to the :meth:`trace_dispatch` method for further tracing in that scope." -msgstr "" +msgid "" +"If the debugger should stop at this exception, invokes " +"the :meth:`user_exception` method (which should be overridden in " +"subclasses). Raise a :exc:`BdbQuit` exception if the :attr:`quitting " +"` flag is set (which can be set " +"from :meth:`user_exception`). Return a reference to " +"the :meth:`trace_dispatch` method for further tracing in that scope." +msgstr "" +"اگر اشکال‌زدا باید در این استثنا متوقف شود، متد :meth:`user_exception` را " +"فراخوانی می‌کند (که باید در زیرکلاس‌ها بازنویسی شود). اگر " +"پرچم :attr:`quitting ` تنظیم‌شده باشد (که می‌توان آن را " +"از :meth:`user_exception` تنظیم کرد)، استثنای :exc:`BdbQuit` را پرتاب " +"می‌کند. برای ردگیری بیشتر در آن محدوده، ارجاعی به متد :meth:`trace_dispatch` " +"بازمی‌گرداند." -msgid "Normally derived classes don't override the following methods, but they may if they want to redefine the definition of stopping and breakpoints." +msgid "" +"Normally derived classes don't override the following methods, but they may " +"if they want to redefine the definition of stopping and breakpoints." msgstr "" +"معمولاً کلاس‌های مشتق‌شده متدهای زیر را بازنویسی نمی‌کنند، اما اگر بخواهند " +"تعریف توقف و نقاط شکست را بازتعریف کنند، می‌توانند این کار را انجام دهند." msgid "Return ``True`` if *module_name* matches any skip pattern." msgstr "" +"اگر *module_name* با هر الگوی رد کردن (skip pattern) مطابقت داشته باشد، " +"``True`` را برمی‌گرداند." msgid "Return ``True`` if *frame* is below the starting frame in the stack." msgstr "" +"اگر *frame* در پشته پایین‌تر از فریم آغازین باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if there is an effective breakpoint for this line." msgstr "" +"اگر برای این خط یک نقطه توقف مؤثر وجود داشته باشد، ``True`` را برمی‌گرداند." -msgid "Check whether a line or function breakpoint exists and is in effect. Delete temporary breakpoints based on information from :func:`effective`." +msgid "" +"Check whether a line or function breakpoint exists and is in effect. " +"Delete temporary breakpoints based on information from :func:`effective`." msgstr "" +"بررسی کنید که آیا نقطه‌توقفی برای خط یا تابع وجود دارد و فعال است یا خیر. " +"نقطه‌توقف‌های موقت را بر اساس اطلاعات :func:`effective` حذف کنید." msgid "Return ``True`` if any breakpoint exists for *frame*'s filename." msgstr "" +"اگر نقطه توقفی برای نام فایل *frame* وجود داشته باشد، ``True`` را " +"برمی‌گرداند." -msgid "Derived classes should override these methods to gain control over debugger operation." +msgid "" +"Derived classes should override these methods to gain control over debugger " +"operation." msgstr "" +"کلاس‌های مشتق‌شده باید این متدها را بازنویسی کنند تا کنترل عملکرد اشکال‌زدا را " +"به دست آورند." -msgid "Called from :meth:`dispatch_call` if a break might stop inside the called function." +msgid "" +"Called from :meth:`dispatch_call` if a break might stop inside the called " +"function." msgstr "" +"اگر ممکن باشد یک نقطه توقف درون تابع فراخوانی‌شده باعث توقف شود، " +"از :meth:`dispatch_call` فراخوانی می‌شود." -msgid "*argument_list* is not used anymore and will always be ``None``. The argument is kept for backwards compatibility." +msgid "" +"*argument_list* is not used anymore and will always be ``None``. The " +"argument is kept for backwards compatibility." msgstr "" +"*argument_list* دیگر استفاده نمی‌شود و همیشه ``None`` خواهد بود. این آرگومان " +"برای سازگاری با نسخه‌های پیشین نگه داشته شده است." -msgid "Called from :meth:`dispatch_line` when either :meth:`stop_here` or :meth:`break_here` returns ``True``." +msgid "" +"Called from :meth:`dispatch_line` when either :meth:`stop_here` " +"or :meth:`break_here` returns ``True``." msgstr "" +"از :meth:`dispatch_line` فراخوانی می‌شود، هرگاه :meth:`stop_here` " +"یا :meth:`break_here` مقدار ``True`` را برگرداند." -msgid "Called from :meth:`dispatch_return` when :meth:`stop_here` returns ``True``." +msgid "" +"Called from :meth:`dispatch_return` when :meth:`stop_here` returns ``True``." msgstr "" +"هنگامی که :meth:`stop_here ` مقدار ``True`` را برمی‌گرداند، " +"از :meth:`dispatch_return ` فراخوانی می‌شود." -msgid "Called from :meth:`dispatch_exception` when :meth:`stop_here` returns ``True``." +msgid "" +"Called from :meth:`dispatch_exception` when :meth:`stop_here` returns " +"``True``." msgstr "" +"هنگامی که :meth:`stop_here ` مقدار ``True`` را " +"برمی‌گرداند، از :meth:`dispatch_exception ` فراخوانی می‌شود." msgid "Handle how a breakpoint must be removed when it is a temporary one." -msgstr "" +msgstr "مدیریت کنید که یک نقطه‌توقف در صورت موقتی بودن چگونه باید حذف شود." msgid "This method must be implemented by derived classes." -msgstr "" +msgstr "این متد باید توسط کلاس‌های مشتق‌شده پیاده‌سازی شود." -msgid "Derived classes and clients can call the following methods to affect the stepping state." +msgid "" +"Derived classes and clients can call the following methods to affect the " +"stepping state." msgstr "" +"کلاس‌های مشتق‌شده و کلاینت‌ها می‌توانند متدهای زیر را برای تأثیرگذاری بر وضعیت " +"گام‌برداری فراخوانی کنند." msgid "Stop after one line of code." -msgstr "" +msgstr "پس از یک خط کد متوقف شوید." msgid "Stop on the next line in or below the given frame." -msgstr "" +msgstr "در خط بعدی در فریم داده‌شده یا پایین‌تر از آن متوقف می‌شود." msgid "Stop when returning from the given frame." -msgstr "" +msgstr "در هنگام بازگشت از فریم داده‌شده، متوقف شود." -msgid "Stop when the line with the *lineno* greater than the current one is reached or when returning from current frame." +msgid "" +"Stop when the line with the *lineno* greater than the current one is " +"reached or when returning from current frame." msgstr "" +"هنگام رسیدن به خطی با *lineno* بزرگ‌تر از خط جاری یا هنگام بازگشت از فریم " +"جاری، متوقف شوید." -msgid "Start debugging from *frame*. If *frame* is not specified, debugging starts from caller's frame." +msgid "" +"Start debugging from *frame*. If *frame* is not specified, debugging " +"starts from caller's frame." msgstr "" +"اشکال‌زدایی را از *frame* شروع کنید. اگر *frame* مشخص نشده باشد، اشکال‌زدایی " +"از فریم فراخواننده شروع می‌شود." -msgid ":func:`set_trace` will enter the debugger immediately, rather than on the next line of code to be executed." +msgid "" +":func:`set_trace` will enter the debugger immediately, rather than on the " +"next line of code to be executed." msgstr "" +":func:`set_trace` بلافاصله وارد اشکال‌زدا می‌شود، نه در خط بعدی کدی که قرار " +"است اجرا شود." -msgid "Stop only at breakpoints or when finished. If there are no breakpoints, set the system trace function to ``None``." +msgid "" +"Stop only at breakpoints or when finished. If there are no breakpoints, " +"set the system trace function to ``None``." msgstr "" +"فقط در نقطه‌های شکست یا هنگام پایان متوقف شوید. اگر هیچ نقطه‌ی شکستی وجود " +"ندارد، تابع ردگیری سیستم را روی ``None`` تنظیم کنید." -msgid "Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` in the next call to one of the :meth:`!dispatch_\\*` methods." +msgid "" +"Set the :attr:`!quitting` attribute to ``True``. This " +"raises :exc:`BdbQuit` in the next call to one of the :meth:`!dispatch_\\*` " +"methods." msgstr "" +"ویژگی :attr:`!quitting` را روی ``True`` تنظیم کنید. این کار باعث " +"پرتاب :exc:`BdbQuit` در فراخوانی بعدی یکی از متدهای :meth:`!dispatch_\\*` " +"می‌شود." -msgid "Derived classes and clients can call the following methods to manipulate breakpoints. These methods return a string containing an error message if something went wrong, or ``None`` if all is well." +msgid "" +"Derived classes and clients can call the following methods to manipulate " +"breakpoints. These methods return a string containing an error message if " +"something went wrong, or ``None`` if all is well." msgstr "" +"کلاس‌های مشتق‌شده و کلاینت‌ها می‌توانند متدهای زیر را برای دستکاری نقاط شکست " +"فراخوانی کنند. این متدها در صورت بروز مشکل، رشته‌ای حاوی پیام خطا " +"برمی‌گردانند، یا اگر همه‌چیز درست باشد ``None`` برمی‌گردانند." -msgid "Set a new breakpoint. If the *lineno* line doesn't exist for the *filename* passed as argument, return an error message. The *filename* should be in canonical form, as described in the :meth:`canonic` method." +msgid "" +"Set a new breakpoint. If the *lineno* line doesn't exist for the " +"*filename* passed as argument, return an error message. The *filename* " +"should be in canonical form, as described in the :meth:`canonic` method." msgstr "" +"یک نقطه توقف جدید تنظیم می‌کند. اگر خط *lineno* برای *filename* که به‌عنوان " +"آرگومان ارسال شده است وجود نداشته باشد، پیام خطایی برمی‌گرداند. *filename* " +"باید به شکل کانونیکال (canonical form) باشد، همان‌طور که در متد :meth:`canonic` " +"توضیح داده شده است." -msgid "Delete the breakpoints in *filename* and *lineno*. If none were set, return an error message." +msgid "" +"Delete the breakpoints in *filename* and *lineno*. If none were set, " +"return an error message." msgstr "" +"نقاط شکست را در *filename* و *lineno* حذف کنید. اگر هیچ نقطه شکستی تنظیم " +"نشده باشد، یک پیام خطا برگردانید." -msgid "Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint.bpbynumber`. If *arg* is not numeric or out of range, return an error message." +msgid "" +"Delete the breakpoint which has the index *arg* in " +"the :attr:`Breakpoint.bpbynumber`. If *arg* is not numeric or out of " +"range, return an error message." msgstr "" +"نقطه توقفی را که در :attr:`Breakpoint.bpbynumber` اندیس *arg* دارد، حذف " +"کنید. اگر *arg* عددی نباشد یا خارج از محدوده باشد، پیام خطایی برگردانده " +"می‌شود." -msgid "Delete all breakpoints in *filename*. If none were set, return an error message." +msgid "" +"Delete all breakpoints in *filename*. If none were set, return an error " +"message." msgstr "" +"تمام نقاط شکست در *filename* را حذف کنید. اگر هیچ نقطه شکستی تنظیم نشده " +"باشد، پیام خطایی برمی‌گرداند." -msgid "Delete all existing breakpoints. If none were set, return an error message." +msgid "" +"Delete all existing breakpoints. If none were set, return an error message." msgstr "" +"تمام نقاط شکست موجود را حذف می‌کند. اگر هیچ نقطه شکستی تنظیم نشده باشد، پیام " +"خطایی برمی‌گرداند." -msgid "Return a breakpoint specified by the given number. If *arg* is a string, it will be converted to a number. If *arg* is a non-numeric string, if the given breakpoint never existed or has been deleted, a :exc:`ValueError` is raised." +msgid "" +"Return a breakpoint specified by the given number. If *arg* is a string, " +"it will be converted to a number. If *arg* is a non-numeric string, if the " +"given breakpoint never existed or has been deleted, a :exc:`ValueError` is " +"raised." msgstr "" +"نقطه توقف مشخص‌شده با شماره‌ی داده‌شده را برمی‌گرداند. اگر *arg* یک رشته باشد، " +"به یک عدد تبدیل خواهد شد. اگر *arg* یک رشته غیرعددی باشد، اگر نقطه توقف " +"داده‌شده هرگز وجود نداشته یا حذف شده باشد، استثنای :exc:`ValueError` پرتاب " +"می‌شود." msgid "Return ``True`` if there is a breakpoint for *lineno* in *filename*." msgstr "" +"اگر برای *lineno* در *filename* نقطه توقفی وجود داشته باشد، ``True`` " +"برمی‌گرداند." -msgid "Return all breakpoints for *lineno* in *filename*, or an empty list if none are set." +msgid "" +"Return all breakpoints for *lineno* in *filename*, or an empty list if none " +"are set." msgstr "" +"تمام نقاط توقف برای *lineno* در *filename* را برمی‌گرداند، یا اگر هیچ‌کدام " +"تنظیم‌نشده باشند، یک فهرست خالی برمی‌گرداند." -msgid "Return all breakpoints in *filename*, or an empty list if none are set." +msgid "" +"Return all breakpoints in *filename*, or an empty list if none are set." msgstr "" +"تمام نقطه‌شکست‌های *filename* را برمی‌گرداند، یا در صورتی که هیچ نقطه‌شکستی " +"تنظیم نشده باشد، یک فهرست خالی برمی‌گرداند." msgid "Return all breakpoints that are set." -msgstr "" +msgstr "تمام نقطه‌توقف‌های تنظیم‌شده را برمی‌گرداند." -msgid "Derived classes and clients can call the following methods to disable and restart events to achieve better performance. These methods only work when using the ``'monitoring'`` backend." +msgid "" +"Derived classes and clients can call the following methods to disable and " +"restart events to achieve better performance. These methods only work when " +"using the ``'monitoring'`` backend." msgstr "" +"کلاس‌های مشتق‌شده و کلاینت‌ها می‌توانند متدهای زیر را برای غیرفعال کردن و " +"راه‌اندازی مجدد رویدادها فراخوانی کنند تا به عملکرد بهتری دست یابند. این " +"متدها تنها زمانی کار می‌کنند که از بک‌اند (backend) ``'monitoring'`` " +"استفاده شود." -msgid "Disable the current event until the next time :func:`restart_events` is called. This is helpful when the debugger is not interested in the current line." +msgid "" +"Disable the current event until the next time :func:`restart_events` is " +"called. This is helpful when the debugger is not interested in the current " +"line." msgstr "" +"رویداد فعلی را تا دفعه بعدی که :func:`restart_events` فراخوانی شود، غیرفعال " +"می‌کند. این کار زمانی مفید است که خط فعلی برای اشکال‌زدا مهم نباشد." -msgid "Restart all the disabled events. This function is automatically called in ``dispatch_*`` methods after ``user_*`` methods are called. If the ``dispatch_*`` methods are not overridden, the disabled events will be restarted after each user interaction." +msgid "" +"Restart all the disabled events. This function is automatically called in " +"``dispatch_*`` methods after ``user_*`` methods are called. If the " +"``dispatch_*`` methods are not overridden, the disabled events will be " +"restarted after each user interaction." msgstr "" +"همه رویدادهای غیرفعال را دوباره راه‌اندازی می‌کند. این تابع به‌طور خودکار در " +"متدهای ``dispatch_*`` پس از فراخوانی متدهای ``user_*`` فراخوانی می‌شود. اگر " +"متدهای ``dispatch_*`` بازنویسی‌نشده باشند، رویدادهای غیرفعال پس از هر تعامل " +"کاربر دوباره راه‌اندازی می‌شوند." -msgid "Derived classes and clients can call the following methods to get a data structure representing a stack trace." +msgid "" +"Derived classes and clients can call the following methods to get a data " +"structure representing a stack trace." msgstr "" +"کلاس‌های مشتق‌شده و کلاینت‌ها می‌توانند متدهای زیر را برای دریافت ساختار داده‌ای " +"که نشان‌دهنده‌ی ردگیری پشته است، فراخوانی کنند." msgid "Return a list of (frame, lineno) tuples in a stack trace, and a size." msgstr "" +"فهرستی از تاپل‌های (frame, lineno) در یک ردگیری پشته، و یک اندازه را " +"برمی‌گرداند." -msgid "The most recently called frame is last in the list. The size is the number of frames below the frame where the debugger was invoked." +msgid "" +"The most recently called frame is last in the list. The size is the number " +"of frames below the frame where the debugger was invoked." msgstr "" +"آخرین فریمفراخوانی‌شده، در انتهای فهرست قرار دارد. اندازه، تعداد " +"فریم‌های زیر فریمی است که اشکال‌زدا (debugger) در آن فراخوانی شده است." -msgid "Return a string with information about a stack entry, which is a ``(frame, lineno)`` tuple. The return string contains:" +msgid "" +"Return a string with information about a stack entry, which is a ``(frame, " +"lineno)`` tuple. The return string contains:" msgstr "" +"یک رشته حاوی اطلاعات درباره یک ورودی پشته برمی‌گرداند، که یک تاپل ``(frame, " +"lineno)`` است. رشته بازگشتی شامل:" msgid "The canonical filename which contains the frame." -msgstr "" +msgstr "نام فایل کانونیکالی که فریم در آن قرار دارد." msgid "The function name or ``\"\"``." -msgstr "" +msgstr "نام تابع یا ``\"\"``." msgid "The input arguments." -msgstr "" +msgstr "آرگومان‌های ورودی." msgid "The return value." -msgstr "" +msgstr "مقدار بازگشتی." msgid "The line of code (if it exists)." -msgstr "" +msgstr "خط کد (در صورت وجود)." -msgid "The following two methods can be called by clients to use a debugger to debug a :term:`statement`, given as a string." +msgid "" +"The following two methods can be called by clients to use a debugger to " +"debug a :term:`statement`, given as a string." msgstr "" +"کلاینت‌ها می‌توانند دو متد زیر را فراخوانی کنند تا از یک اشکال‌زدا برای " +"اشکال‌زدایی یک :term:`دستور `، که به‌صورت یک رشته داده شده است، " +"استفاده کنند." -msgid "Debug a statement executed via the :func:`exec` function. *globals* defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." +msgid "" +"Debug a statement executed via the :func:`exec` function. *globals* " +"defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." msgstr "" +"اشکال‌زدایی دستوری که از طریق تابع :func:`exec` اجرا می‌شود. *globals* به‌طور " +"پیش‌فرض :attr:`!__main__.__dict__` است، *locals* به‌طور پیش‌فرض *globals* است." -msgid "Debug an expression executed via the :func:`eval` function. *globals* and *locals* have the same meaning as in :meth:`run`." +msgid "" +"Debug an expression executed via the :func:`eval` function. *globals* and " +"*locals* have the same meaning as in :meth:`run`." msgstr "" +"اشکال‌زدایی یک عبارت اجراشده از طریق تابع :func:`eval`. *globals* و *locals* " +"همان معنای خود در :meth:`run` را دارند." msgid "For backwards compatibility. Calls the :meth:`run` method." -msgstr "" +msgstr "برای سازگاری با نسخه‌های قدیمی. متد :meth:`run` را فراخوانی می‌کند." msgid "Debug a single function call, and return its result." -msgstr "" +msgstr "یک فراخوانی تابع واحد را اشکال‌زدایی کنید و نتیجه‌ی آن را برگردانید." msgid "Finally, the module defines the following functions:" -msgstr "" +msgstr "در نهایت، این ماژول توابع زیر را تعریف می‌کند:" -msgid "Return ``True`` if we should break here, depending on the way the :class:`Breakpoint` *b* was set." +msgid "" +"Return ``True`` if we should break here, depending on the way " +"the :class:`Breakpoint` *b* was set." msgstr "" +"بسته به روشی که :class:`Breakpoint` *b* تنظیم شده است، اگر باید در اینجا " +"توقف کنیم، ``True`` را برمی‌گرداند." -msgid "If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :attr:`function name `, we have to check we are in the right *frame* (the right function) and if we are on its first executable line." -msgstr "" +msgid "" +"If it was set via line number, it checks if :attr:`b.line " +"` is the same as the one in *frame*. If the breakpoint " +"was set via :attr:`function name `, we have to " +"check we are in the right *frame* (the right function) and if we are on its " +"first executable line." +msgstr "" +"اگر از طریق شماره خط تنظیم شده باشد، بررسی می‌کند که آیا :attr:`b.line " +"` با شماره خط موجود در *frame* یکسان است یا خیر. اگر " +"نقطه توقف از طریق :attr:`نام تابع ` تنظیم شده " +"باشد، باید بررسی کنیم که در *frame* صحیح (تابع صحیح) و روی اولین خط " +"قابل‌اجرای آن قرار داریم." -msgid "Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as the breakpoint to act upon." +msgid "" +"Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` " +"as the breakpoint to act upon." msgstr "" +"``(active breakpoint, delete temporary flag)`` یا ``(None, None)`` را " +"به‌عنوان نقطه توقفی که باید بر اساس آن اقدام شود برمی‌گرداند." -msgid "The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line `) (which must exist) that is :attr:`enabled `, for which :func:`checkfuncname` is true, and that has neither a false :attr:`condition ` nor positive :attr:`ignore ` count. The *flag*, meaning that a temporary breakpoint should be deleted, is ``False`` only when the :attr:`cond ` cannot be evaluated (in which case, :attr:`ignore ` count is ignored)." -msgstr "" +msgid "" +"The *active breakpoint* is the first entry in :attr:`bplist " +"` for the (:attr:`file " +"`, :attr:`line `) (which must " +"exist) that is :attr:`enabled `, for " +"which :func:`checkfuncname` is true, and that has neither a " +"false :attr:`condition ` nor positive :attr:`ignore " +"` count. The *flag*, meaning that a temporary " +"breakpoint should be deleted, is ``False`` only when the :attr:`cond " +"` cannot be evaluated (in which case, :attr:`ignore " +"` count is ignored)." +msgstr "" +"*نقطه توقف فعال* اولین ورودی در :attr:`bplist ` برای " +"(:attr:`file `، :attr:`line `) " +"(که باید وجود داشته باشد) است که :attr:`enabled ` " +"باشد، :func:`checkfuncname` برای آن درست باشد، و نه :attr:`condition " +"` نادرست باشد و نه شمار :attr:`ignore " +"` مثبت باشد. *پرچم*، به این معنا که یک نقطه توقف " +"موقت باید حذف شود، تنها زمانی ``False`` است که نتوان :attr:`cond " +"` را ارزیابی کرد (در این حالت، شمار :attr:`ignore " +"` نادیده گرفته می‌شود)." msgid "If no such entry exists, then ``(None, None)`` is returned." -msgstr "" +msgstr "اگر چنین ورودی‌ای وجود نداشته باشد، ``(None, None)`` برگردانده می‌شود." msgid "Start debugging with a :class:`Bdb` instance from caller's frame." msgstr "" +"شروع اشکال‌زدایی با نمونه‌ای از :class:`Bdb` از فریمفراخواننده." msgid "quitting (bdb.Bdb attribute)" -msgstr "" +msgstr "quitting (ویژگی bdb.Bdb)" diff --git a/library/binary.po b/library/binary.po index f69f2b613..f3ab0145e 100644 --- a/library/binary.po +++ b/library/binary.po @@ -13,22 +13,41 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"PO-Revision-Date: 2026-08-27 14:45+0330\n" +"Last-Translator: \n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Binary Data Services" -msgstr "" +msgstr "خدمات داده‌های دودویی" -msgid "The modules described in this chapter provide some basic services operations for manipulation of binary data. Other operations on binary data, specifically in relation to file formats and network protocols, are described in the relevant sections." +msgid "" +"The modules described in this chapter provide some basic services " +"operations for manipulation of binary data. Other operations on binary " +"data, specifically in relation to file formats and network protocols, are " +"described in the relevant sections." msgstr "" +"ماژول‌های توصیف‌شده در این فصل، برخی عملیات خدماتی پایه را برای دستکاری " +"داده‌های دودویی فراهم می‌کنند. سایر عملیات روی داده‌های دودویی، به‌ویژه در " +"ارتباط با قالب‌های فایل و پروتکل‌های شبکه، در بخش‌های مرتبط توصیف شده‌اند." -msgid "Some libraries described under :ref:`textservices` also work with either ASCII-compatible binary formats (for example, :mod:`re`) or all binary data (for example, :mod:`difflib`)." +msgid "" +"Some libraries described under :ref:`textservices` also work with either " +"ASCII-compatible binary formats (for example, :mod:`re`) or all binary data " +"(for example, :mod:`difflib`)." msgstr "" +"برخی از کتابخانه‌های توصیف‌شده در :ref:`textservices` همچنین یا با قالب‌های " +"دودویی سازگار با ASCII (برای مثال، :mod:`re`) یا با تمام داده‌های دودویی " +"(برای مثال، :mod:`difflib`) کار می‌کنند." -msgid "In addition, see the documentation for Python's built-in binary data types in :ref:`binaryseq`." +msgid "" +"In addition, see the documentation for Python's built-in binary data types " +"in :ref:`binaryseq`." msgstr "" +"علاوه بر این، مستندات انواع داده دودویی توکار پایتون را در :ref:`binaryseq` " +"ببینید." diff --git a/library/binascii.po b/library/binascii.po index 1e9a2d1c0..e6d16d711 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"PO-Revision-Date: 2026-08-28 11:24+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,72 +22,170 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!binascii` --- Convert between binary and ASCII" -msgstr "" +msgstr ":mod:`!binascii` --- تبدیل بین داده‌های دودویی و ASCII" -msgid "The :mod:`!binascii` module contains a number of methods to convert between binary and various ASCII-encoded binary representations. Normally, you will not use these functions directly but use wrapper modules like :mod:`base64` instead. The :mod:`!binascii` module contains low-level functions written in C for greater speed that are used by the higher-level modules." -msgstr "" +msgid "" +"The :mod:`!binascii` module contains a number of methods to convert between " +"binary and various ASCII-encoded binary representations. Normally, you will " +"not use these functions directly but use wrapper modules like :mod:`base64` " +"instead. The :mod:`!binascii` module contains low-level functions written " +"in C for greater speed that are used by the higher-level modules." +msgstr "" +"ماژول :mod:`!binascii` شامل تعدادی متد برای تبدیل میان داده‌های دودویی و " +"بازنمایی‌های دودویی مختلف کدگذاری‌شده با ASCII است. به‌طور معمول، شما این " +"توابع را مستقیماً استفاده نمی‌کنید، بلکه در عوض از ماژول‌های پوششی " +"مانند :mod:`base64` استفاده می‌کنید. ماژول :mod:`!binascii` شامل توابع سطح " +"پایینی است که برای سرعت بیشتر به زبان C نوشته شده‌اند و توسط ماژول‌های سطح " +"بالاتر استفاده می‌شوند." -msgid "``a2b_*`` functions accept Unicode strings containing only ASCII characters. Other functions only accept :term:`bytes-like objects ` (such as :class:`bytes`, :class:`bytearray` and other objects that support the buffer protocol)." +msgid "" +"``a2b_*`` functions accept Unicode strings containing only ASCII " +"characters. Other functions only accept :term:`bytes-like objects ` (such as :class:`bytes`, :class:`bytearray` and other objects " +"that support the buffer protocol)." msgstr "" +"توابع ``a2b_*`` رشته‌های یونیکدی را می‌پذیرند که فقط شامل نویسه‌های ASCII " +"باشند. سایر توابع فقط :term:`اشیاء شبه‌بایت ` " +"(مانند :class:`bytes`، :class:`bytearray` و اشیاء دیگری که از پروتکل بافر " +"پشتیبانی می‌کنند) را می‌پذیرند." -msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." +msgid "" +"ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." msgstr "" +"رشته‌های یونیکدی که فقط شامل نویسه‌های ASCII هستند، اکنون توسط توابع " +"``a2b_*`` پذیرفته می‌شوند." msgid "The :mod:`!binascii` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!binascii` تابع‌های زیر را تعریف می‌کند:" -msgid "Convert a single line of uuencoded data back to binary and return the binary data. Lines normally contain 45 (binary) bytes, except for the last line. Line data may be followed by whitespace." +msgid "" +"Convert a single line of uuencoded data back to binary and return the " +"binary data. Lines normally contain 45 (binary) bytes, except for the last " +"line. Line data may be followed by whitespace." msgstr "" +"یک خط منفرد از داده‌های uuencoded را به داده‌های دودویی تبدیل می‌کند و داده‌های " +"دودویی را برمی‌گرداند. خطوط معمولاً حاوی ۴۵ بایت (دودویی) هستند، به‌جز خط آخر. " +"ممکن است پس از داده‌های خط، فضای سفید وجود داشته باشد." -msgid "Convert binary data to a line of ASCII characters, the return value is the converted line, including a newline char. The length of *data* should be at most 45. If *backtick* is true, zeros are represented by ``'`'`` instead of spaces." +msgid "" +"Convert binary data to a line of ASCII characters, the return value is the " +"converted line, including a newline char. The length of *data* should be at " +"most 45. If *backtick* is true, zeros are represented by ``'`'`` instead of " +"spaces." msgstr "" +"داده‌های دودویی را به خطی از نویسه‌های ASCII تبدیل می‌کند؛ مقدار بازگشتی، خط " +"تبدیل‌شده به‌همراه یک نویسه خط جدید است. طول *data* باید حداکثر ۴۵ باشد. اگر " +"*backtick* درست باشد، صفرها به‌جای فاصله‌ها با ``'`'`` نمایش داده می‌شوند." msgid "Added the *backtick* parameter." -msgstr "" +msgstr "پارامتر *backtick* افزوده شد." -msgid "Convert a block of base64 data back to binary and return the binary data. More than one line may be passed at a time." +msgid "" +"Convert a block of base64 data back to binary and return the binary data. " +"More than one line may be passed at a time." msgstr "" +"یک بلوک از داده‌های base64 را دوباره به دودویی تبدیل می‌کند و داده‌های دودویی " +"را برمی‌گرداند. شما می‌توانید بیش از یک خط را در هر بار ارسال کنید." -msgid "If *strict_mode* is true, only valid base64 data will be converted. Invalid base64 data will raise :exc:`binascii.Error`." +msgid "" +"If *strict_mode* is true, only valid base64 data will be converted. Invalid " +"base64 data will raise :exc:`binascii.Error`." msgstr "" +"اگر *strict_mode* درست باشد، فقط داده‌های معتبر base64 تبدیل می‌شوند. داده‌های " +"نامعتبر base64 باعث پرتاب :exc:`binascii.Error` می‌شوند." msgid "Valid base64:" -msgstr "" +msgstr "base64 معتبر:" msgid "Conforms to :rfc:`3548`." -msgstr "" +msgstr "با :rfc:`3548` مطابقت دارد." msgid "Contains only characters from the base64 alphabet." -msgstr "" +msgstr "فقط شامل نویسه‌های الفبای base64 است." -msgid "Contains no excess data after padding (including excess padding, newlines, etc.)." +msgid "" +"Contains no excess data after padding (including excess padding, newlines, " +"etc.)." msgstr "" +"فاقد داده اضافی پس از پدینگ (padding) است (از جمله پدینگ اضافی، خطوط جدید و " +"غیره)." msgid "Does not start with a padding." -msgstr "" +msgstr "با یک پرکننده (padding) شروع نمی‌شود." msgid "Added the *strict_mode* parameter." -msgstr "" +msgstr "پارامتر *strict_mode* اضافه شد." -msgid "Convert binary data to a line of ASCII characters in base64 coding. The return value is the converted line, including a newline char if *newline* is true. The output of this function conforms to :rfc:`3548`." +msgid "" +"Convert binary data to a line of ASCII characters in base64 coding. The " +"return value is the converted line, including a newline char if *newline* " +"is true. The output of this function conforms to :rfc:`3548`." msgstr "" +"داده‌های دودویی را به خطی از نویسه‌های ASCII با کدگذاری base64 تبدیل می‌کند. " +"مقدار بازگشتی، خط تبدیل‌شده است و در صورتی که *newline* درست باشد، شامل یک " +"نویسه خط جدید نیز می‌شود. خروجی این تابع با :rfc:`3548` مطابقت دارد." msgid "Added the *newline* parameter." -msgstr "" +msgstr "پارامتر *newline* افزوده شد." -msgid "Convert a block of quoted-printable data back to binary and return the binary data. More than one line may be passed at a time. If the optional argument *header* is present and true, underscores will be decoded as spaces." +msgid "" +"Convert a block of quoted-printable data back to binary and return the " +"binary data. More than one line may be passed at a time. If the optional " +"argument *header* is present and true, underscores will be decoded as " +"spaces." msgstr "" +"یک بلوک از داده‌های quoted-printable را دوباره به دودویی تبدیل می‌کند و " +"داده‌های دودویی را برمی‌گرداند. می‌توان بیش از یک خط را در هر نوبت ارسال کرد. " +"اگر آرگومان اختیاری *header* وجود داشته باشد و مقدار آن درست باشد، زیرخط‌ها " +"به‌عنوان فاصله کدگشایی می‌شوند." -msgid "Convert binary data to a line(s) of ASCII characters in quoted-printable encoding. The return value is the converted line(s). If the optional argument *quotetabs* is present and true, all tabs and spaces will be encoded. If the optional argument *istext* is present and true, newlines are not encoded but trailing whitespace will be encoded. If the optional argument *header* is present and true, spaces will be encoded as underscores per :rfc:`1522`. If the optional argument *header* is present and false, newline characters will be encoded as well; otherwise linefeed conversion might corrupt the binary data stream." -msgstr "" +msgid "" +"Convert binary data to a line(s) of ASCII characters in quoted-printable " +"encoding. The return value is the converted line(s). If the optional " +"argument *quotetabs* is present and true, all tabs and spaces will be " +"encoded. If the optional argument *istext* is present and true, newlines " +"are not encoded but trailing whitespace will be encoded. If the optional " +"argument *header* is present and true, spaces will be encoded as " +"underscores per :rfc:`1522`. If the optional argument *header* is present " +"and false, newline characters will be encoded as well; otherwise linefeed " +"conversion might corrupt the binary data stream." +msgstr "" +"داده‌های دودویی را به یک یا چند خط از نویسه‌های ASCII با کدگذاری quoted-" +"printable تبدیل می‌کند. مقدار بازگشتی، خط یا خطوط تبدیل‌شده است. اگر آرگومان " +"اختیاری *quotetabs* موجود و درست باشد، همه‌ی تب‌ها و فاصله‌ها کدگذاری خواهند " +"شد. اگر آرگومان اختیاری *istext* موجود و درست باشد، نویسه‌های خط جدید " +"کدگذاری نمی‌شوند، اما فاصله‌های انتهایی کدگذاری خواهند شد. اگر آرگومان " +"اختیاری *header* موجود و درست باشد، فاصله‌ها مطابق :rfc:`1522` به‌صورت زیرخط " +"کدگذاری می‌شوند. اگر آرگومان اختیاری *header* موجود و نادرست باشد، نویسه‌های " +"خط جدید نیز کدگذاری خواهند شد؛ در غیر این صورت، تبدیل linefeed ممکن است " +"جریان داده‌های دودویی را خراب کند." -msgid "Compute a 16-bit CRC value of *data*, starting with *value* as the initial CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as 0x1021. This CRC is used in the binhex4 format." +msgid "" +"Compute a 16-bit CRC value of *data*, starting with *value* as the initial " +"CRC, and return the result. This uses the CRC-CCITT polynomial " +"*x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as " +"0x1021. This CRC is used in the binhex4 format." msgstr "" +"مقدار CRC ۱۶‌بیتی *data* را، با شروع از *value* به‌عنوان CRC اولیه، محاسبه " +"می‌کند و نتیجه را برمی‌گرداند. این از چندجمله‌ای CRC-CCITT *x*:sup:`16` + " +"*x*:sup:`12` + *x*:sup:`5` + 1 استفاده می‌کند، که اغلب به‌صورت 0x1021 نمایش " +"داده می‌شود. این CRC در قالب binhex4 استفاده می‌شود." -msgid "Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an initial CRC of *value*. The default initial CRC is zero. The algorithm is consistent with the ZIP file checksum. Since the algorithm is designed for use as a checksum algorithm, it is not suitable for use as a general hash algorithm. Use as follows::" -msgstr "" +msgid "" +"Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " +"initial CRC of *value*. The default initial CRC is zero. The algorithm is " +"consistent with the ZIP file checksum. Since the algorithm is designed for " +"use as a checksum algorithm, it is not suitable for use as a general hash " +"algorithm. Use as follows::" +msgstr "" +"CRC-32، جمع‌آزمای ۳۲ بیتی بدون علامت برای *data* را با شروع از مقدار اولیه‌ی " +"CRC برابر با *value* محاسبه کنید. مقدار اولیه‌ی پیش‌فرض CRC صفر است. این " +"الگوریتم با جمع‌آزمای فایل ZIP سازگار است. از آن‌جا که این الگوریتم برای " +"استفاده به‌عنوان الگوریتم جمع‌آزما طراحی شده است، برای استفاده به‌عنوان یک " +"الگوریتم هش عمومی مناسب نیست. به‌صورت زیر استفاده کنید::" msgid "" "print(binascii.crc32(b\"hello world\"))\n" @@ -96,48 +194,94 @@ msgid "" "crc = binascii.crc32(b\" world\", crc)\n" "print('crc32 = {:#010x}'.format(crc))" msgstr "" +"print(binascii.crc32(b\"hello world\"))\n" +"# یا در دو بخش:\n" +"crc = binascii.crc32(b\"hello\")\n" +"crc = binascii.crc32(b\" world\", crc)\n" +"print('crc32 = {:#010x}'.format(crc))" msgid "The result is always unsigned." -msgstr "" +msgstr "نتیجه همواره بدون علامت است." -msgid "Return the hexadecimal representation of the binary *data*. Every byte of *data* is converted into the corresponding 2-digit hex representation. The returned bytes object is therefore twice as long as the length of *data*." +msgid "" +"Return the hexadecimal representation of the binary *data*. Every byte of " +"*data* is converted into the corresponding 2-digit hex representation. The " +"returned bytes object is therefore twice as long as the length of *data*." msgstr "" +"بازنمایی مبنای شانزده‌ی داده‌ی دودویی *data* را برمی‌گرداند. هر بایت از *data* " +"به بازنمایی مبنای شانزده‌ی ۲‌رقمی متناظر تبدیل می‌شود. بنابراین، شیء bytes " +"برگردانده‌شده دو برابر طول *data* طول دارد." -msgid "Similar functionality (but returning a text string) is also conveniently accessible using the :meth:`bytes.hex` method." +msgid "" +"Similar functionality (but returning a text string) is also conveniently " +"accessible using the :meth:`bytes.hex` method." msgstr "" +"قابلیت مشابهی (اما با برگرداندن یک رشته متنی) همچنین به‌راحتی با استفاده از " +"متد :meth:`bytes.hex` قابل دسترسی است." -msgid "If *sep* is specified, it must be a single character str or bytes object. It will be inserted in the output after every *bytes_per_sep* input bytes. Separator placement is counted from the right end of the output by default, if you wish to count from the left, supply a negative *bytes_per_sep* value." +msgid "" +"If *sep* is specified, it must be a single character str or bytes object. " +"It will be inserted in the output after every *bytes_per_sep* input bytes. " +"Separator placement is counted from the right end of the output by default, " +"if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" +"اگر *sep* مشخص شده باشد، باید یک شیء str یا bytes تک‌نویسه‌ای باشد. این " +"جداکننده در خروجی پس از هر *bytes_per_sep* بایت ورودی درج می‌شود. به‌طور " +"پیش‌فرض، شمارش محل قرارگیری جداکننده از انتهای راست خروجی انجام می‌شود؛ اگر " +"می‌خواهید از سمت چپ شمارش کنید، یک مقدار منفی برای *bytes_per_sep* ارائه " +"دهید." msgid "The *sep* and *bytes_per_sep* parameters were added." -msgstr "" +msgstr "پارامترهای *sep* و *bytes_per_sep* افزوده شدند." -msgid "Return the binary data represented by the hexadecimal string *hexstr*. This function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even number of hexadecimal digits (which can be upper or lower case), otherwise an :exc:`Error` exception is raised." +msgid "" +"Return the binary data represented by the hexadecimal string *hexstr*. " +"This function is the inverse of :func:`b2a_hex`. *hexstr* must contain an " +"even number of hexadecimal digits (which can be upper or lower case), " +"otherwise an :exc:`Error` exception is raised." msgstr "" +"داده‌ی دودویی نمایش‌داده‌شده توسط رشته‌ی مبنای شانزده *hexstr* را برمی‌گرداند. " +"این تابع معکوس :func:`b2a_hex` است. *hexstr* باید حاوی تعداد زوجی از ارقام " +"مبنای شانزده باشد (که می‌توانند به‌صورت حروف بزرگ یا کوچک باشند)، در غیر این " +"صورت استثنای :exc:`Error` پرتاب می‌شود." -msgid "Similar functionality (but more liberal towards whitespace) is also accessible using the :meth:`bytes.fromhex` class method." +msgid "" +"Similar functionality (but more liberal towards whitespace) is also " +"accessible using the :meth:`bytes.fromhex` class method." msgstr "" +"قابلیت مشابهی (اما با سخت‌گیری کمتر نسبت به فضای خالی) نیز از طریق متد " +"کلاسی :meth:`bytes.fromhex` در دسترس است." msgid "Exception raised on errors. These are usually programming errors." msgstr "" +"استثنایی که در صورت بروز خطا پرتاب می‌شود. این موارد معمولاً خطاهای " +"برنامه‌نویسی هستند." -msgid "Exception raised on incomplete data. These are usually not programming errors, but may be handled by reading a little more data and trying again." +msgid "" +"Exception raised on incomplete data. These are usually not programming " +"errors, but may be handled by reading a little more data and trying again." msgstr "" +"استثنایی که هنگام ناقص بودن داده‌ها پرتاب می‌شود. این استثناها معمولاً خطاهای " +"برنامه‌نویسی نیستند، اما ممکن است با خواندن اندکی داده بیشتر و تلاش دوباره " +"مدیریت شوند." msgid "Module :mod:`base64`" -msgstr "" +msgstr "ماژول :mod:`base64`" -msgid "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." +msgid "" +"Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "" +"پشتیبانی از کدگذاری به‌سبک base64 مطابق با RFC در مبنای ۱۶، ۳۲، ۶۴ و ۸۵." msgid "Module :mod:`quopri`" -msgstr "" +msgstr "ماژول :mod:`quopri`" msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" +"پشتیبانی از کدگذاری quoted-printable مورد استفاده در پیام‌های ایمیل MIME." msgid "module" -msgstr "" +msgstr "ماژول" msgid "base64" -msgstr "" +msgstr "base64" diff --git a/library/bisect.po b/library/bisect.po index 7c3b2eba0..d26311950 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -25,88 +25,237 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!bisect` --- Array bisection algorithm" -msgstr "" +msgstr ":mod:`!bisect` --- الگوریتم دو نیمه‌سازی آرایه" msgid "**Source code:** :source:`Lib/bisect.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/bisect.py`" -msgid "This module provides support for maintaining a list in sorted order without having to sort the list after each insertion. For long lists of items with expensive comparison operations, this can be an improvement over linear searches or frequent resorting." +msgid "" +"This module provides support for maintaining a list in sorted order without " +"having to sort the list after each insertion. For long lists of items with " +"expensive comparison operations, this can be an improvement over linear " +"searches or frequent resorting." msgstr "" +"این ماژول پشتیبانی از نگهداری یک فهرست به ترتیب مرتب‌شده بدون نیاز به " +"مرتب‌سازی فهرست پس از هر درج را فراهم می‌کند. برای فهرست‌های طولانی از " +"آیتم‌هایی با عملیات مقایسه پرهزینه، این می‌تواند بهبودی نسبت به جست‌وجوهای " +"خطی یا مرتب‌سازی مجدد مکرر باشد." -msgid "The module is called :mod:`!bisect` because it uses a basic bisection algorithm to do its work. Unlike other bisection tools that search for a specific value, the functions in this module are designed to locate an insertion point. Accordingly, the functions never call an :meth:`~object.__eq__` method to determine whether a value has been found. Instead, the functions only call the :meth:`~object.__lt__` method and will return an insertion point between values in an array." -msgstr "" +msgid "" +"The module is called :mod:`!bisect` because it uses a basic bisection " +"algorithm to do its work. Unlike other bisection tools that search for a " +"specific value, the functions in this module are designed to locate an " +"insertion point. Accordingly, the functions never call an " +":meth:`~object.__eq__` method to determine whether a value has been found. " +"Instead, the functions only call the :meth:`~object.__lt__` method and will " +"return an insertion point between values in an array." +msgstr "" +"این ماژول :mod:`!bisect` نامیده می‌شود، زیرا برای انجام کار خود از یک " +"الگوریتم ساده‌ی دو نیم‌سازی (bisection) استفاده می‌کند. برخلاف سایر " +"ابزارهای دو نیم‌سازی که به دنبال یک مقدار مشخص می‌گردند، توابع این ماژول " +"برای یافتن یک نقطه‌ی درج طراحی شده‌اند. بر همین اساس، این توابع هرگز متد " +":meth:`~object.__eq__` را برای تعیین اینکه آیا مقداری پیدا شده است فراخوانی " +"نمی‌کنند. در عوض، توابع فقط متد :meth:`~object.__lt__` را فراخوانی می‌کنند و" +" یک نقطه‌ی درج بین مقادیر یک آرایه برمی‌گردانند." -msgid "The functions in this module are not thread-safe. If multiple threads concurrently use :mod:`!bisect` functions on the same sequence, this may result in undefined behaviour. Likewise, if the provided sequence is mutated by a different thread while a :mod:`!bisect` function is operating on it, the result is undefined. For example, using :py:func:`~bisect.insort_left` on the same list from multiple threads may result in the list becoming unsorted." -msgstr "" +msgid "" +"The functions in this module are not thread-safe. If multiple threads " +"concurrently use :mod:`!bisect` functions on the same sequence, this may " +"result in undefined behaviour. Likewise, if the provided sequence is mutated" +" by a different thread while a :mod:`!bisect` function is operating on it, " +"the result is undefined. For example, using :py:func:`~bisect.insort_left` " +"on the same list from multiple threads may result in the list becoming " +"unsorted." +msgstr "" +"توابع این ماژول ایمن در برابر نخ‌ها نیستند. اگر چندین نخ به‌طور همزمان از " +"توابع :mod:`!bisect` روی یک دنباله استفاده کنند، ممکن است منجر به رفتار " +"تعریف‌نشده شود. به همین ترتیب، اگر در حین کار یک تابع :mod:`!bisect` روی " +"دنباله ارائه‌شده، آن دنباله توسط نخ دیگری تغییر کند، نتیجه تعریف‌نشده است. " +"برای مثال، استفاده از :py:func:`~bisect.insort_left` روی یک فهرست مشترک از " +"چندین نخ ممکن است باعث شود فهرست نامرتب شود." msgid "The following functions are provided:" -msgstr "" +msgstr "تابع‌های زیر ارائه شده‌اند:" -msgid "Locate the insertion point for *x* in *a* to maintain sorted order. The parameters *lo* and *hi* may be used to specify a subset of the list which should be considered; by default the entire list is used. If *x* is already present in *a*, the insertion point will be before (to the left of) any existing entries. The return value is suitable for use as the first parameter to ``list.insert()`` assuming that *a* is already sorted." -msgstr "" +msgid "" +"Locate the insertion point for *x* in *a* to maintain sorted order. The " +"parameters *lo* and *hi* may be used to specify a subset of the list which " +"should be considered; by default the entire list is used. If *x* is already" +" present in *a*, the insertion point will be before (to the left of) any " +"existing entries. The return value is suitable for use as the first " +"parameter to ``list.insert()`` assuming that *a* is already sorted." +msgstr "" +"نقطه درج برای *x* در *a* را برای حفظ ترتیب مرتب‌شده پیدا کنید. می‌توانید از " +"پارامترهای *lo* و *hi* برای مشخص کردن زیرمجموعه‌ای از فهرست که باید در نظر " +"گرفته شود استفاده کنید؛ به‌طور پیش‌فرض، از کل فهرست استفاده می‌شود. اگر *x* " +"از قبل در *a* موجود باشد، نقطه درج پیش از (در سمت چپ) هر ورودی موجود خواهد " +"بود. مقدار برگشتی برای استفاده به‌عنوان اولین پارامتر ``list.insert()`` " +"مناسب است، با فرض اینکه *a* از قبل مرتب‌شده باشد." -msgid "The returned insertion point *ip* partitions the array *a* into two slices such that ``all(elem < x for elem in a[lo : ip])`` is true for the left slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right slice." +msgid "" +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " +"slice." msgstr "" +"نقطه درج بازگشتی *ip* آرایه *a* را به دو برش تقسیم می‌کند، به‌گونه‌ای که " +"``all(elem < x for elem in a[lo : ip])`` برای برش چپ درست است و ``all(elem " +">= x for elem in a[ip : hi])`` برای برش راست درست است." -msgid "*key* specifies a :term:`key function` of one argument that is used to extract a comparison key from each element in the array. To support searching complex records, the key function is not applied to the *x* value." +msgid "" +"*key* specifies a :term:`key function` of one argument that is used to " +"extract a comparison key from each element in the array. To support " +"searching complex records, the key function is not applied to the *x* value." msgstr "" +"*key* یک :term:`تابع کلید ` با یک آرگومان را تعیین می‌کند که " +"برای استخراج یک کلید مقایسه از هر عنصر آرایه استفاده می‌شود. برای پشتیبانی " +"از جستجوی رکوردهای پیچیده، تابع کلید بر مقدار *x* اعمال نمی‌شود." -msgid "If *key* is ``None``, the elements are compared directly and no key function is called." +msgid "" +"If *key* is ``None``, the elements are compared directly and no key function" +" is called." msgstr "" +"اگر *key* برابر ``None`` باشد، عناصر به‌طور مستقیم مقایسه می‌شوند و هیچ تابع" +" کلیدی فراخوانی نمی‌شود." msgid "Added the *key* parameter." -msgstr "" +msgstr "پارامتر *key* اضافه شد." -msgid "Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point which comes after (to the right of) any existing entries of *x* in *a*." +msgid "" +"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point " +"which comes after (to the right of) any existing entries of *x* in *a*." msgstr "" +"مشابه :py:func:`~bisect.bisect_left`، اما نقطه درجی را برمی‌گرداند که پس از " +"(در سمت راست) هر آیتم موجود از *x* در *a* قرار دارد." -msgid "The returned insertion point *ip* partitions the array *a* into two slices such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right slice." +msgid "" +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " +"slice." msgstr "" +"نقطه‌ی درج برگردانده‌شده *ip* آرایه *a* را به دو برش تقسیم می‌کند، به‌طوری که" +" ``all(elem <= x for elem in a[lo : ip])`` برای برش چپ درست است و ``all(elem" +" > x for elem in a[ip : hi])`` برای برش راست درست است." msgid "Insert *x* in *a* in sorted order." -msgstr "" +msgstr "*x* را در *a* با ترتیب مرتب‌شده درج کنید." -msgid "This function first runs :py:func:`~bisect.bisect_left` to locate an insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to insert *x* at the appropriate position to maintain sort order." +msgid "" +"This function first runs :py:func:`~bisect.bisect_left` to locate an " +"insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to" +" insert *x* at the appropriate position to maintain sort order." msgstr "" +"این تابع ابتدا :py:func:`~bisect.bisect_left` را برای یافتن محل درج اجرا " +"می‌کند. سپس، متد :meth:`~sequence.insert` را روی *a* اجرا می‌کند تا *x* را " +"در جایگاه مناسب برای حفظ ترتیب مرتب‌سازی درج کند." -msgid "To support inserting records in a table, the *key* function (if any) is applied to *x* for the search step but not for the insertion step." +msgid "" +"To support inserting records in a table, the *key* function (if any) is " +"applied to *x* for the search step but not for the insertion step." msgstr "" +"برای پشتیبانی از درج رکوردها در یک جدول، تابع *key* (در صورت وجود) برای " +"مرحله جست‌وجو به *x* اعمال می‌شود، اما برای مرحله درج اعمال نمی‌شود." -msgid "Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ (*n*) insertion step." +msgid "" +"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ " +"(*n*) insertion step." msgstr "" +"در نظر داشته باشید که جستجوی *O*\\ (log *n*) تحت‌الشعاع گام کند درج *O*\\ " +"(*n*) قرار می‌گیرد." -msgid "Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after any existing entries of *x*." +msgid "" +"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after " +"any existing entries of *x*." msgstr "" +"مشابه :py:func:`~bisect.insort_left`، اما *x* را پس از هر آیتم موجود از *x* " +"در *a* درج می‌کند." -msgid "This function first runs :py:func:`~bisect.bisect_right` to locate an insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to insert *x* at the appropriate position to maintain sort order." +msgid "" +"This function first runs :py:func:`~bisect.bisect_right` to locate an " +"insertion point. Next, it runs the :meth:`~sequence.insert` method on *a* to" +" insert *x* at the appropriate position to maintain sort order." msgstr "" +"این تابع ابتدا :py:func:`~bisect.bisect_right` را برای یافتن نقطه درج اجرا " +"می‌کند. سپس، متد :meth:`~sequence.insert` را روی *a* اجرا می‌کند تا *x* را " +"در جایگاه مناسب برای حفظ ترتیب مرتب‌سازی درج کند." msgid "Performance Notes" -msgstr "" +msgstr "یادداشت‌های عملکرد" -msgid "When writing time sensitive code using *bisect()* and *insort()*, keep these thoughts in mind:" +msgid "" +"When writing time sensitive code using *bisect()* and *insort()*, keep these" +" thoughts in mind:" msgstr "" +"هنگام نوشتن کد حساس به زمان با استفاده از *bisect()* و *insort()*، این نکات " +"را در نظر داشته باشید:" -msgid "Bisection is effective for searching ranges of values. For locating specific values, dictionaries are more performant." +msgid "" +"Bisection is effective for searching ranges of values. For locating specific" +" values, dictionaries are more performant." msgstr "" +"جستجوی دودویی برای جستجوی بازه‌هایی از مقادیر مؤثر است. برای یافتن مقادیر " +"مشخص، دیکشنری‌ها کارآمدتر هستند." -msgid "The *insort()* functions are *O*\\ (*n*) because the logarithmic search step is dominated by the linear time insertion step." +msgid "" +"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step" +" is dominated by the linear time insertion step." msgstr "" +"توابع *insort()* از مرتبه‌ی *O*\\ (*n*) هستند، زیرا مرحله‌ی جستجوی لگاریتمی " +"تحت سلطه‌ی مرحله‌ی درج با زمان خطی است." -msgid "The search functions are stateless and discard key function results after they are used. Consequently, if the search functions are used in a loop, the key function may be called again and again on the same array elements. If the key function isn't fast, consider wrapping it with :py:deco:`functools.cache` to avoid duplicate computations. Alternatively, consider searching an array of precomputed keys to locate the insertion point (as shown in the examples section below)." -msgstr "" +msgid "" +"The search functions are stateless and discard key function results after " +"they are used. Consequently, if the search functions are used in a loop, " +"the key function may be called again and again on the same array elements. " +"If the key function isn't fast, consider wrapping it with " +":py:deco:`functools.cache` to avoid duplicate computations. Alternatively, " +"consider searching an array of precomputed keys to locate the insertion " +"point (as shown in the examples section below)." +msgstr "" +"توابع جستجو فاقد وضعیت هستند و نتایج تابع کلید را پس از استفاده دور " +"می‌اندازند. در نتیجه، اگر از توابع جستجو در یک حلقه استفاده شود، ممکن است " +"تابع کلید بارها و بارها برای همان عناصر آرایه فراخوانی شود. اگر تابع کلید " +"سریع نیست، استفاده از :py:deco:`functools.cache` به‌عنوان پوشش برای آن را در" +" نظر بگیرید تا از محاسبات تکراری اجتناب شود. به‌عنوان جایگزین، در نظر بگیرید" +" که در یک آرایه از کلیدهای از پیش محاسبه‌شده جستجو کنید تا نقطه درج را " +"بیابید (همان‌طور که در بخش مثال‌های زیر نشان داده شده است)." -msgid "`Sorted Collections `_ is a high performance module that uses *bisect* to managed sorted collections of data." +msgid "" +"`Sorted Collections `_ is a " +"high performance module that uses *bisect* to managed sorted collections of " +"data." msgstr "" +"`Sorted Collections `_ یک " +"ماژول با کارایی بالا است که از *bisect* برای مدیریت مجموعه‌های مرتب‌شده از " +"داده استفاده می‌کند." -msgid "The `SortedCollection recipe `_ uses bisect to build a full-featured collection class with straight-forward search methods and support for a key-function. The keys are precomputed to save unnecessary calls to the key function during searches." -msgstr "" +msgid "" +"The `SortedCollection recipe " +"`_ uses " +"bisect to build a full-featured collection class with straight-forward " +"search methods and support for a key-function. The keys are precomputed to " +"save unnecessary calls to the key function during searches." +msgstr "" +"`SortedCollection recipe " +"`_ از bisect " +"برای ساختن یک کلاس مجموعه با امکانات کامل، همراه با متدهای جستجوی ساده و " +"مستقیم و پشتیبانی از تابع کلید استفاده می‌کند. کلیدها از پیش محاسبه می‌شوند " +"تا از فراخوانی‌های غیرضروری تابع کلید در حین جستجوها جلوگیری شود." msgid "Searching Sorted Lists" -msgstr "" +msgstr "جستجو در فهرست‌های مرتب‌شده" -msgid "The above `bisect functions`_ are useful for finding insertion points but can be tricky or awkward to use for common searching tasks. The following five functions show how to transform them into the standard lookups for sorted lists::" +msgid "" +"The above `bisect functions`_ are useful for finding insertion points but " +"can be tricky or awkward to use for common searching tasks. The following " +"five functions show how to transform them into the standard lookups for " +"sorted lists::" msgstr "" +"توابع `bisect functions`_ فوق برای یافتن نقاط درج مفید هستند، اما ممکن است " +"استفاده از آن‌ها برای کارهای جستجوی رایج دشوار یا نامناسب باشد. پنج تابع زیر" +" نشان می‌دهند که چگونه می‌توان آن‌ها را به جستجوهای استاندارد برای فهرست‌های" +" مرتب تبدیل کرد::" msgid "" "def index(a, x):\n" @@ -144,12 +293,54 @@ msgid "" " return a[i]\n" " raise ValueError" msgstr "" +"def index(a, x):\n" +" 'Locate the leftmost value exactly equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a) and a[i] == x:\n" +" return i\n" +" raise ValueError\n" +"\n" +"def find_lt(a, x):\n" +" 'Find rightmost value less than x'\n" +" i = bisect_left(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_le(a, x):\n" +" 'Find rightmost value less than or equal to x'\n" +" i = bisect_right(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_gt(a, x):\n" +" 'Find leftmost value greater than x'\n" +" i = bisect_right(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError\n" +"\n" +"def find_ge(a, x):\n" +" 'Find leftmost item greater than or equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError" msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "The :py:func:`~bisect.bisect` function can be useful for numeric table lookups. This example uses :py:func:`~bisect.bisect` to look up a letter grade for an exam score (say) based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is a 'B', and so on::" +msgid "" +"The :py:func:`~bisect.bisect` function can be useful for numeric table " +"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter " +"grade for an exam score (say) based on a set of ordered numeric breakpoints:" +" 90 and up is an 'A', 80 to 89 is a 'B', and so on::" msgstr "" +"تابع :py:func:`~bisect.bisect` می‌تواند برای جستجو در جدول‌های عددی مفید " +"باشد. این مثال از :py:func:`~bisect.bisect` برای جستجوی نمره‌ی الفبایی یک " +"نمره‌ی امتحان (مثلاً) بر اساس مجموعه‌ای از نقاط شکست عددی مرتب‌شده استفاده " +"می‌کند: ۹۰ به بالا 'A' است، ۸۰ تا ۸۹ 'B' است، و به همین ترتیب::" msgid "" ">>> def grade(score):\n" @@ -159,9 +350,21 @@ msgid "" ">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" "['F', 'A', 'C', 'C', 'B', 'A', 'A']" msgstr "" +">>> def grade(score):\n" +"... i = bisect([60, 70, 80, 90], score)\n" +"... return \"FDCBA\"[i]\n" +"...\n" +">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" +"['F', 'A', 'C', 'C', 'B', 'A', 'A']" -msgid "The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also work with lists of tuples. The *key* argument can serve to extract the field used for ordering records in a table::" +msgid "" +"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also " +"work with lists of tuples. The *key* argument can serve to extract the " +"field used for ordering records in a table::" msgstr "" +"توابع :py:func:`~bisect.bisect` و :py:func:`~bisect.insort` همچنین با " +"فهرست‌هایی از تاپل‌ها کار می‌کنند. آرگومان *key* می‌تواند برای استخراج فیلدی" +" که برای مرتب‌سازی رکوردها در یک جدول استفاده می‌شود، به‌کار رود::" msgid "" ">>> from collections import namedtuple\n" @@ -194,9 +397,43 @@ msgid "" " Movie(name='Aliens', released=1986, director='Cameron'),\n" " Movie(name='Titanic', released=1997, director='Cameron')]" msgstr "" +">>> from collections import namedtuple\n" +">>> from operator import attrgetter\n" +">>> from bisect import bisect, insort\n" +">>> from pprint import pprint\n" +"\n" +">>> Movie = namedtuple('Movie', ('name', 'released', 'director'))\n" +"\n" +">>> movies = [\n" +"... Movie('Jaws', 1975, 'Spielberg'),\n" +"... Movie('Titanic', 1997, 'Cameron'),\n" +"... Movie('The Birds', 1963, 'Hitchcock'),\n" +"... Movie('Aliens', 1986, 'Cameron')\n" +"... ]\n" +"\n" +">>> # Find the first movie released after 1960\n" +">>> by_year = attrgetter('released')\n" +">>> movies.sort(key=by_year)\n" +">>> movies[bisect(movies, 1960, key=by_year)]\n" +"Movie(name='The Birds', released=1963, director='Hitchcock')\n" +"\n" +">>> # Insert a movie while maintaining sort order\n" +">>> romance = Movie('Love Story', 1970, 'Hiller')\n" +">>> insort(movies, romance, key=by_year)\n" +">>> pprint(movies)\n" +"[Movie(name='The Birds', released=1963, director='Hitchcock'),\n" +" Movie(name='Love Story', released=1970, director='Hiller'),\n" +" Movie(name='Jaws', released=1975, director='Spielberg'),\n" +" Movie(name='Aliens', released=1986, director='Cameron'),\n" +" Movie(name='Titanic', released=1997, director='Cameron')]" -msgid "If the key function is expensive, it is possible to avoid repeated function calls by searching a list of precomputed keys to find the index of a record::" +msgid "" +"If the key function is expensive, it is possible to avoid repeated function " +"calls by searching a list of precomputed keys to find the index of a " +"record::" msgstr "" +"اگر تابع کلید پرهزینه باشد، می‌توان با جستجو در فهرستی از کلیدهای از پیش " +"محاسبه‌شده برای یافتن اندیس یک رکورد، از فراخوانی‌های مکرر تابع اجتناب کرد::" msgid "" ">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" @@ -211,3 +448,14 @@ msgid "" ">>> data[bisect_left(keys, 8)]\n" "('yellow', 8)" msgstr "" +">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" +">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n" +">>> keys = [r[1] for r in data] # Precompute a list of keys.\n" +">>> data[bisect_left(keys, 0)]\n" +"('black', 0)\n" +">>> data[bisect_left(keys, 1)]\n" +"('blue', 1)\n" +">>> data[bisect_left(keys, 5)]\n" +"('red', 5)\n" +">>> data[bisect_left(keys, 8)]\n" +"('yellow', 8)" diff --git a/library/builtins.po b/library/builtins.po index ee922318d..aba7009d3 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -22,13 +22,29 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!builtins` --- Built-in objects" -msgstr "" +msgstr ":mod:`!builtins` --- اشیای توکار" -msgid "This module provides direct access to all 'built-in' identifiers of Python; for example, ``builtins.open`` is the full name for the built-in function :func:`open`." +msgid "" +"This module provides direct access to all 'built-in' identifiers of Python; " +"for example, ``builtins.open`` is the full name for the built-in function " +":func:`open`." msgstr "" +"این ماژول دسترسی مستقیم به تمام شناسه‌های «توکار» پایتون را فراهم می‌کند؛ " +"برای مثال، ``builtins.open`` نام کامل تابع توکار :func:`open` است." -msgid "This module is not normally accessed explicitly by most applications, but can be useful in modules that provide objects with the same name as a built-in value, but in which the built-in of that name is also needed. For example, in a module that wants to implement an :func:`open` function that wraps the built-in :func:`open`, this module can be used directly::" +msgid "" +"This module is not normally accessed explicitly by most applications, but " +"can be useful in modules that provide objects with the same name as a built-" +"in value, but in which the built-in of that name is also needed. For " +"example, in a module that wants to implement an :func:`open` function that " +"wraps the built-in :func:`open`, this module can be used directly::" msgstr "" +"این ماژول معمولاً به‌صورت صریح توسط بیشتر برنامه‌های کاربردی مورد دسترسی " +"قرار نمی‌گیرد، اما می‌تواند در ماژول‌هایی مفید باشد که اشیایی با نامی مشابه " +"یک مقدار توکار ارائه می‌کنند، اما در آن‌ها به مقدار توکار با همان نام نیز " +"نیاز است. برای مثال، در ماژولی که می‌خواهد یک تابع :func:`open` را " +"پیاده‌سازی کند که تابع توکار :func:`open` را پوشش می‌دهد، می‌توان از این " +"ماژول به‌صورت مستقیم استفاده کرد::" msgid "" "import builtins\n" @@ -48,18 +64,44 @@ msgid "" "\n" " # ..." msgstr "" +"import builtins\n" +"\n" +"def open(path):\n" +" f = builtins.open(path, 'r')\n" +" return UpperCaser(f)\n" +"\n" +"class UpperCaser:\n" +" '''Wrapper around a file that converts output to uppercase.'''\n" +"\n" +" def __init__(self, f):\n" +" self._f = f\n" +"\n" +" def read(self, count=-1):\n" +" return self._f.read(count).upper()\n" +"\n" +" # ..." -msgid "As an implementation detail, most modules have the name ``__builtins__`` made available as part of their globals. The value of ``__builtins__`` is normally either this module or the value of this module's :attr:`~object.__dict__` attribute. Since this is an implementation detail, it may not be used by alternate implementations of Python." +msgid "" +"As an implementation detail, most modules have the name ``__builtins__`` " +"made available as part of their globals. The value of ``__builtins__`` is " +"normally either this module or the value of this module's " +":attr:`~object.__dict__` attribute. Since this is an implementation detail, " +"it may not be used by alternate implementations of Python." msgstr "" +"به‌عنوان جزئیاتی از پیاده‌سازی، بیشتر ماژول‌ها نام ``__builtins__`` را " +"به‌عنوان بخشی از سراسری‌های خود در دسترس دارند. مقدار ``__builtins__`` " +"معمولاً یا خود این ماژول است یا مقدار ویژگی :attr:`~object.__dict__` این " +"ماژول. از آن‌جا که این موضوع جزئیاتی از پیاده‌سازی است، ممکن است در " +"پیاده‌سازی‌های جایگزین پایتون مورد استفاده قرار نگیرد." msgid ":ref:`built-in-consts`" -msgstr "" +msgstr ":ref:`built-in-consts`" msgid ":ref:`bltin-exceptions`" -msgstr "" +msgstr ":ref:`bltin-exceptions`" msgid ":ref:`built-in-funcs`" -msgstr "" +msgstr ":ref:`built-in-funcs`" msgid ":ref:`bltin-types`" -msgstr "" +msgstr ":ref:`bltin-types`" diff --git a/library/bz2.po b/library/bz2.po index 8126ee6eb..8aeeb386b 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -24,226 +24,466 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!bz2` --- Support for :program:`bzip2` compression" -msgstr "" +msgstr ":mod:`!bz2` --- پشتیبانی از فشرده‌سازی :program:`bzip2`" msgid "**Source code:** :source:`Lib/bz2.py`" -msgstr "" +msgstr ":source:`Lib/bz2.py`" -msgid "This module provides a comprehensive interface for compressing and decompressing data using the bzip2 compression algorithm." +msgid "" +"This module provides a comprehensive interface for compressing and " +"decompressing data using the bzip2 compression algorithm." msgstr "" +"این ماژول یک رابط جامع برای فشرده‌سازی و بازگشایی داده‌ها با استفاده از " +"الگوریتم فشرده‌سازی bzip2 فراهم می‌کند." msgid "The :mod:`!bz2` module contains:" -msgstr "" +msgstr "ماژول :mod:`!bz2` شامل موارد زیر است:" -msgid "The :func:`.open` function and :class:`BZ2File` class for reading and writing compressed files." +msgid "" +"The :func:`.open` function and :class:`BZ2File` class for reading and " +"writing compressed files." msgstr "" +"تابع :func:`.open` و کلاس :class:`BZ2File` برای خواندن و نوشتن فایل‌های " +"فشرده." -msgid "The :class:`BZ2Compressor` and :class:`BZ2Decompressor` classes for incremental (de)compression." +msgid "" +"The :class:`BZ2Compressor` and :class:`BZ2Decompressor` classes for " +"incremental (de)compression." msgstr "" +"کلاس‌های :class:`BZ2Compressor` و :class:`BZ2Decompressor` برای " +"فشرده‌سازی/فشرده‌گشایی تدریجی." -msgid "The :func:`compress` and :func:`decompress` functions for one-shot (de)compression." +msgid "" +"The :func:`compress` and :func:`decompress` functions for one-shot " +"(de)compression." msgstr "" +"تابع‌های :func:`compress` و :func:`decompress` برای فشرده‌سازی/فشرده‌گشایی " +"یک‌باره." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" +"این یک :term:`optional module` است. اگر در نسخه CPython شما وجود ندارد، برای" +" مستندات به توزیع‌کننده خود (یعنی هر کسی که پایتون را در اختیار شما قرار " +"داده است) مراجعه کنید. اگر شما توزیع‌کننده هستید، :ref:`optional-module-" +"requirements` را ببینید." msgid "(De)compression of files" -msgstr "" +msgstr "فشرده‌سازی و بازگشایی فایل‌ها" -msgid "Open a bzip2-compressed file in binary or text mode, returning a :term:`file object`." +msgid "" +"Open a bzip2-compressed file in binary or text mode, returning a :term:`file" +" object`." msgstr "" +"یک فایل فشرده‌شده با bzip2 را در حالت دودویی یا متنی باز می‌کند و یک " +":term:`file object` بازمی‌گرداند." -msgid "As with the constructor for :class:`BZ2File`, the *filename* argument can be an actual filename (a :class:`str` or :class:`bytes` object), or an existing file object to read from or write to." +msgid "" +"As with the constructor for :class:`BZ2File`, the *filename* argument can be" +" an actual filename (a :class:`str` or :class:`bytes` object), or an " +"existing file object to read from or write to." msgstr "" +"مانند سازنده‌ی :class:`BZ2File`، آرگومان *filename* می‌تواند یک نام فایل " +"واقعی (یک شیء :class:`str` یا :class:`bytes`)، یا یک شیء فایل موجود برای " +"خواندن از آن یا نوشتن در آن باشد." -msgid "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, ``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``, ``'wt'``, ``'xt'``, or ``'at'`` for text mode. The default is ``'rb'``." +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, " +"``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``, " +"``'wt'``, ``'xt'``, or ``'at'`` for text mode. The default is ``'rb'``." msgstr "" +"آرگومان *mode* می‌تواند برای حالت دودویی هر یک از ``'r'``، ``'rb'``، " +"``'w'``، ``'wb'``، ``'x'``، ``'xb'``، ``'a'`` یا ``'ab'``، یا برای حالت متنی" +" هر یک از ``'rt'``، ``'wt'``، ``'xt'`` یا ``'at'`` باشد. مقدار پیش‌فرض " +"``'rb'`` است." -msgid "The *compresslevel* argument is an integer from 1 to 9, as for the :class:`BZ2File` constructor." +msgid "" +"The *compresslevel* argument is an integer from 1 to 9, as for the " +":class:`BZ2File` constructor." msgstr "" +"آرگومان *compresslevel* یک عدد صحیح از ۱ تا ۹ است، همان‌طور که برای سازنده‌ی" +" :class:`BZ2File` نیز وجود دارد." -msgid "For binary mode, this function is equivalent to the :class:`BZ2File` constructor: ``BZ2File(filename, mode, compresslevel=compresslevel)``. In this case, the *encoding*, *errors* and *newline* arguments must not be provided." +msgid "" +"For binary mode, this function is equivalent to the :class:`BZ2File` " +"constructor: ``BZ2File(filename, mode, compresslevel=compresslevel)``. In " +"this case, the *encoding*, *errors* and *newline* arguments must not be " +"provided." msgstr "" +"برای حالت دودویی، این تابع معادل سازنده‌ی :class:`BZ2File` است: " +"``BZ2File(filename, mode, compresslevel=compresslevel)``. در این حالت، نباید" +" آرگومان‌های *encoding*، *errors* و *newline* ارائه شوند." -msgid "For text mode, a :class:`BZ2File` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line ending(s)." +msgid "" +"For text mode, a :class:`BZ2File` object is created, and wrapped in an " +":class:`io.TextIOWrapper` instance with the specified encoding, error " +"handling behavior, and line ending(s)." msgstr "" +"برای حالت متنی، یک شیء :class:`BZ2File` ایجاد می‌شود و در نمونه‌ای از " +":class:`io.TextIOWrapper` با کدگذاری، رفتار مدیریت خطا و پایان(های) خط " +"مشخص‌شده، دربرگرفته می‌شود." msgid "The ``'x'`` (exclusive creation) mode was added." -msgstr "" +msgstr "حالت ``'x'`` (ایجاد انحصاری) افزوده شد." msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "یک :term:`path-like object` را می‌پذیرد." msgid "Open a bzip2-compressed file in binary mode." -msgstr "" +msgstr "باز کردن یک فایل فشرده‌شده با bzip2 در حالت دودویی." -msgid "If *filename* is a :class:`str` or :class:`bytes` object, open the named file directly. Otherwise, *filename* should be a :term:`file object`, which will be used to read or write the compressed data." +msgid "" +"If *filename* is a :class:`str` or :class:`bytes` object, open the named " +"file directly. Otherwise, *filename* should be a :term:`file object`, which " +"will be used to read or write the compressed data." msgstr "" +"اگر *filename* یک شیء :class:`str` یا :class:`bytes` باشد، فایل " +"نام‌گذاری‌شده مستقیماً باز می‌شود. در غیر این صورت، *filename* باید یک " +":term:`file object` باشد که برای خواندن یا نوشتن داده‌های فشرده استفاده " +"می‌شود." -msgid "The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. These can equivalently be given as ``'rb'``, ``'wb'``, ``'xb'`` and ``'ab'`` respectively." +msgid "" +"The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for" +" overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. " +"These can equivalently be given as ``'rb'``, ``'wb'``, ``'xb'`` and ``'ab'``" +" respectively." msgstr "" +"آرگومان *mode* می‌تواند ``'r'`` برای خواندن (پیش‌فرض)، ``'w'`` برای " +"بازنویسی، ``'x'`` برای ایجاد انحصاری، یا ``'a'`` برای الحاق باشد. این موارد " +"می‌توانند به‌طور معادل به‌ترتیب به‌صورت ``'rb'``، ``'wb'``، ``'xb'`` و " +"``'ab'`` داده شوند." -msgid "If *filename* is a file object (rather than an actual file name), a mode of ``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." +msgid "" +"If *filename* is a file object (rather than an actual file name), a mode of " +"``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" +"اگر *filename* یک شیء فایل باشد (نه یک نام فایل واقعی)، حالت ``'w'`` فایل را" +" کوتاه نمی‌کند و در عوض معادل ``'a'`` است." -msgid "If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between ``1`` and ``9`` specifying the level of compression: ``1`` produces the least compression, and ``9`` (default) produces the most compression." +msgid "" +"If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between " +"``1`` and ``9`` specifying the level of compression: ``1`` produces the " +"least compression, and ``9`` (default) produces the most compression." msgstr "" +"اگر *mode* برابر ``'w'`` یا ``'a'`` باشد، *compresslevel* می‌تواند عدد صحیحی" +" بین ``1`` و ``9`` باشد که سطح فشرده‌سازی را مشخص می‌کند: ``1`` کمترین میزان" +" فشرده‌سازی را ایجاد می‌کند و ``9`` (پیش‌فرض) بیشترین میزان فشرده‌سازی را " +"ایجاد می‌کند." -msgid "If *mode* is ``'r'``, the input file may be the concatenation of multiple compressed streams." +msgid "" +"If *mode* is ``'r'``, the input file may be the concatenation of multiple " +"compressed streams." msgstr "" +"اگر *mode* برابر ``'r'`` باشد، فایل ورودی ممکن است حاصل الحاق چند جریان " +"فشرده باشد." -msgid ":class:`BZ2File` provides all of the members specified by the :class:`io.BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io.IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." +msgid "" +":class:`BZ2File` provides all of the members specified by the " +":class:`io.BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and" +" :meth:`~io.IOBase.truncate`. Iteration and the :keyword:`with` statement " +"are supported." msgstr "" +"کلاس :class:`BZ2File` تمام اعضای مشخص‌شده توسط :class:`io.BufferedIOBase` را" +" فراهم می‌کند، به‌جز :meth:`~io.BufferedIOBase.detach` و " +":meth:`~io.IOBase.truncate`. تکرار و دستور :keyword:`with` پشتیبانی می‌شوند." msgid ":class:`BZ2File` also provides the following methods and attributes:" -msgstr "" +msgstr ":class:`BZ2File` همچنین متدها و ویژگی‌های زیر را ارائه می‌دهد:" -msgid "Return buffered data without advancing the file position. At least one byte of data will be returned (unless at EOF). The exact number of bytes returned is unspecified." +msgid "" +"Return buffered data without advancing the file position. At least one byte " +"of data will be returned (unless at EOF). The exact number of bytes returned" +" is unspecified." msgstr "" +"داده‌های بافرشده را بدون جلو بردن موقعیت فایل برمی‌گرداند. حداقل یک بایت " +"داده برگردانده خواهد شد (مگر در EOF). تعداد دقیق بایت‌های برگردانده‌شده " +"نامشخص است." -msgid "While calling :meth:`peek` does not change the file position of the :class:`BZ2File`, it may change the position of the underlying file object (e.g. if the :class:`BZ2File` was constructed by passing a file object for *filename*)." +msgid "" +"While calling :meth:`peek` does not change the file position of the " +":class:`BZ2File`, it may change the position of the underlying file object " +"(e.g. if the :class:`BZ2File` was constructed by passing a file object for " +"*filename*)." msgstr "" +"اگرچه فراخوانی :meth:`peek` موقعیت فایلِ :class:`BZ2File` را تغییر نمی‌دهد، " +"اما ممکن است موقعیت شیء فایل زیربنایی را تغییر دهد (برای مثال، اگر " +":class:`BZ2File` با ارسال یک شیء فایل برای *filename* ساخته شده باشد)." msgid "Return the file descriptor for the underlying file." msgstr "" +"توصیف‌گر فایل (file descriptor) مربوط به فایل زیربنایی را برمی‌گرداند." msgid "Return whether the file was opened for reading." -msgstr "" +msgstr "برمی‌گرداند که آیا فایل برای خواندن باز شده است." msgid "Return whether the file supports seeking." -msgstr "" +msgstr "برمی‌گرداند که آیا فایل از مکان‌یابی (seeking) پشتیبانی می‌کند." msgid "Return whether the file was opened for writing." -msgstr "" +msgstr "برمی‌گرداند که آیا فایل برای نوشتن باز شده است یا خیر." -msgid "Read up to *size* uncompressed bytes, while trying to avoid making multiple reads from the underlying stream. Reads up to a buffer's worth of data if size is negative." +msgid "" +"Read up to *size* uncompressed bytes, while trying to avoid making multiple " +"reads from the underlying stream. Reads up to a buffer's worth of data if " +"size is negative." msgstr "" +"تا *size* بایت فشرده‌نشده را می‌خواند، در حالی که تلاش می‌کند از انجام چندین" +" عملیات خواندن از جریان زیرین اجتناب کند. اگر size منفی باشد، تا اندازه‌ی یک" +" بافر داده می‌خواند." msgid "Returns ``b''`` if the file is at EOF." -msgstr "" +msgstr "اگر فایل در EOF باشد، ``b''`` را برمی‌گرداند." msgid "Read bytes into *b*." -msgstr "" +msgstr "بایت‌ها را در *b* بخوانید." msgid "Returns the number of bytes read (0 for EOF)." -msgstr "" +msgstr "تعداد بایت‌های خوانده‌شده را برمی‌گرداند (۰ برای EOF)." msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "" +msgstr "``'rb'`` برای خواندن و ``'wb'`` برای نوشتن." -msgid "The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of the underlying :term:`file object`." +msgid "" +"The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of" +" the underlying :term:`file object`." msgstr "" +"نام فایل bzip2. معادل ویژگی :attr:`~io.FileIO.name` در :term:`file object` " +"زیربنایی است." msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "پشتیبانی از دستور :keyword:`with` افزوده شد." -msgid "Support was added for *filename* being a :term:`file object` instead of an actual filename." +msgid "" +"Support was added for *filename* being a :term:`file object` instead of an " +"actual filename." msgstr "" +"پشتیبانی برای اینکه *filename* به‌جای یک نام فایل واقعی، یک :term:`file " +"object` باشد، اضافه شد." -msgid "The ``'a'`` (append) mode was added, along with support for reading multi-stream files." +msgid "" +"The ``'a'`` (append) mode was added, along with support for reading multi-" +"stream files." msgstr "" +"حالت ``'a'`` (الحاق) افزوده شد، به همراه پشتیبانی از خواندن فایل‌های " +"چندجریانی (multi-stream)." -msgid "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of ``None``." +msgid "" +"The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " +"``None``." msgstr "" +"متد :meth:`~io.BufferedIOBase.read` اکنون آرگومانی با مقدار ``None`` را " +"می‌پذیرد." -msgid "The *buffering* parameter has been removed. It was ignored and deprecated since Python 3.0. Pass an open file object to control how the file is opened." +msgid "" +"The *buffering* parameter has been removed. It was ignored and deprecated " +"since Python 3.0. Pass an open file object to control how the file is " +"opened." msgstr "" +"پارامتر *buffering* حذف شده است. این پارامتر از Python 3.0 نادیده گرفته " +"می‌شد و منسوخ بود. برای کنترل چگونگی باز شدن فایل، یک شیء فایل باز را پاس " +"دهید." msgid "The *compresslevel* parameter became keyword-only." -msgstr "" +msgstr "پارامتر *compresslevel* فقط کلیدواژه‌ای شد." -msgid "This class is thread unsafe in the face of multiple simultaneous readers or writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` have always been." +msgid "" +"This class is thread unsafe in the face of multiple simultaneous readers or " +"writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " +"have always been." msgstr "" +"این کلاس در مواجهه با چندین خواننده یا نویسنده همزمان، از نظر نخی ایمن " +"نیست، همان‌طور که کلاس‌های معادل آن در :mod:`gzip` و :mod:`lzma` همیشه " +"بوده‌اند." msgid "Incremental (de)compression" -msgstr "" +msgstr "فشرده‌سازی و بازگشایی تدریجی" -msgid "Create a new compressor object. This object may be used to compress data incrementally. For one-shot compression, use the :func:`compress` function instead." +msgid "" +"Create a new compressor object. This object may be used to compress data " +"incrementally. For one-shot compression, use the :func:`compress` function " +"instead." msgstr "" +"یک شیء فشرده‌ساز جدید ایجاد کنید. این شیء می‌تواند برای فشرده‌سازی تدریجی " +"داده‌ها استفاده شود. برای فشرده‌سازی یکجا، به‌جای آن از تابع " +":func:`compress` استفاده کنید." -msgid "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The default is ``9``." +msgid "" +"*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " +"default is ``9``." msgstr "" +"*compresslevel*، در صورت داده شدن، باید یک عدد صحیح بین ``1`` و ``9`` باشد. " +"مقدار پیش‌فرض ``9`` است." -msgid "Provide data to the compressor object. Returns a chunk of compressed data if possible, or an empty byte string otherwise." +msgid "" +"Provide data to the compressor object. Returns a chunk of compressed data if" +" possible, or an empty byte string otherwise." msgstr "" +"داده را به شیء فشرده‌ساز ارائه دهید. در صورت امکان تکه‌ای از داده فشرده " +"برمی‌گرداند، در غیر این صورت یک رشته بایتی خالی برمی‌گرداند." -msgid "When you have finished providing data to the compressor, call the :meth:`flush` method to finish the compression process." +msgid "" +"When you have finished providing data to the compressor, call the " +":meth:`flush` method to finish the compression process." msgstr "" +"هنگامی که ارائه داده به فشرده‌ساز را به پایان رساندید، متد :meth:`flush` را " +"فراخوانی کنید تا فرآیند فشرده‌سازی به پایان برسد." -msgid "Finish the compression process. Returns the compressed data left in internal buffers." +msgid "" +"Finish the compression process. Returns the compressed data left in internal" +" buffers." msgstr "" +"فرایند فشرده‌سازی را به پایان می‌رساند. داده‌های فشرده‌ی باقی‌مانده در " +"میان‌گیرهای داخلی را برمی‌گرداند." -msgid "The compressor object may not be used after this method has been called." +msgid "" +"The compressor object may not be used after this method has been called." msgstr "" +"پس از فراخوانی این متد، نمی‌توان از شیء فشرده‌ساز (compressor) استفاده کرد." -msgid "Create a new decompressor object. This object may be used to decompress data incrementally. For one-shot compression, use the :func:`decompress` function instead." +msgid "" +"Create a new decompressor object. This object may be used to decompress data" +" incrementally. For one-shot compression, use the :func:`decompress` " +"function instead." msgstr "" +"یک شیء فشرده‌گشا (decompressor) جدید ایجاد کنید. این شیء می‌تواند برای " +"فشرده‌گشایی داده‌ها به‌صورت تدریجی استفاده شود. برای فشرده‌سازی یک‌باره، " +"به‌جای آن از تابع :func:`decompress` استفاده کنید." -msgid "This class does not transparently handle inputs containing multiple compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you need to decompress a multi-stream input with :class:`BZ2Decompressor`, you must use a new decompressor for each stream." +msgid "" +"This class does not transparently handle inputs containing multiple " +"compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " +"need to decompress a multi-stream input with :class:`BZ2Decompressor`, you " +"must use a new decompressor for each stream." msgstr "" +"این کلاس، برخلاف :func:`decompress` و :class:`BZ2File`، ورودی‌های حاوی چندین" +" جریان فشرده را به‌صورت شفاف مدیریت نمی‌کند. اگر نیاز دارید یک ورودی حاوی " +"چند جریان را با :class:`BZ2Decompressor` فشرده‌گشایی کنید، باید برای هر " +"جریان از یک فشرده‌گشای جدید استفاده کنید." -msgid "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data as bytes. Some of *data* may be buffered internally, for use in later calls to :meth:`decompress`. The returned data should be concatenated with the output of any previous calls to :meth:`decompress`." +msgid "" +"Decompress *data* (a :term:`bytes-like object`), returning uncompressed data" +" as bytes. Some of *data* may be buffered internally, for use in later calls" +" to :meth:`decompress`. The returned data should be concatenated with the " +"output of any previous calls to :meth:`decompress`." msgstr "" +"*data* (یک :term:`bytes-like object`) را فشرده‌گشایی می‌کند و داده‌ی " +"فشرده‌نشده را به‌صورت بایت برمی‌گرداند. ممکن است بخشی از *data* در بافر " +"داخلی نگه‌داری شود، تا در فراخوانی‌های بعدی :meth:`decompress` استفاده شود. " +"داده‌ی برگردانده‌شده باید با خروجی هر فراخوانی قبلی :meth:`decompress` الحاق" +" شود." -msgid "If *max_length* is nonnegative, returns at most *max_length* bytes of decompressed data. If this limit is reached and further output can be produced, the :attr:`~.needs_input` attribute will be set to ``False``. In this case, the next call to :meth:`~.decompress` may provide *data* as ``b''`` to obtain more of the output." -msgstr "" +msgid "" +"If *max_length* is nonnegative, returns at most *max_length* bytes of " +"decompressed data. If this limit is reached and further output can be " +"produced, the :attr:`~.needs_input` attribute will be set to ``False``. In " +"this case, the next call to :meth:`~.decompress` may provide *data* as " +"``b''`` to obtain more of the output." +msgstr "" +"اگر *max_length* منفی نباشد، حداکثر *max_length* بایت از داده‌ی خارج‌شده از " +"حالت فشرده را برمی‌گرداند. اگر به این حد برسد و امکان تولید خروجی بیشتری " +"وجود داشته باشد، ویژگی :attr:`~.needs_input` روی ``False`` تنظیم می‌شود. در " +"این حالت، می‌توانید در فراخوانی بعدی :meth:`~.decompress` برای دریافت خروجی " +"بیشتر، *data* را به‌صورت ``b''`` ارائه دهید." -msgid "If all of the input data was decompressed and returned (either because this was less than *max_length* bytes, or because *max_length* was negative), the :attr:`~.needs_input` attribute will be set to ``True``." +msgid "" +"If all of the input data was decompressed and returned (either because this " +"was less than *max_length* bytes, or because *max_length* was negative), the" +" :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" +"اگر تمام داده‌های ورودی از حالت فشرده خارج شده و بازگردانده شده باشند (چه به" +" این دلیل که داده‌ها کمتر از *max_length* بایت بودند و چه به این دلیل که " +"*max_length* منفی بود)، ویژگی :attr:`~.needs_input` روی ``True`` تنظیم خواهد" +" شد." -msgid "Attempting to decompress data after the end of stream is reached raises an :exc:`EOFError`. Any data found after the end of the stream is ignored and saved in the :attr:`~.unused_data` attribute." +msgid "" +"Attempting to decompress data after the end of stream is reached raises an " +":exc:`EOFError`. Any data found after the end of the stream is ignored and " +"saved in the :attr:`~.unused_data` attribute." msgstr "" +"تلاش برای فشرده‌گشایی داده‌ها پس از رسیدن به پایان جریان، باعث پرتاب یک " +":exc:`EOFError` می‌شود. هر داده‌ای که پس از پایان جریان یافت شود، نادیده " +"گرفته می‌شود و در ویژگی :attr:`~.unused_data` ذخیره می‌شود." msgid "Added the *max_length* parameter." -msgstr "" +msgstr "پارامتر *max_length* افزوده شد." msgid "``True`` if the end-of-stream marker has been reached." -msgstr "" +msgstr "اگر به نشانگر پایان جریان رسیده باشد، ``True`` است." msgid "Data found after the end of the compressed stream." -msgstr "" +msgstr "داده‌ای پس از پایان جریان فشرده یافت شد." -msgid "If this attribute is accessed before the end of the stream has been reached, its value will be ``b''``." +msgid "" +"If this attribute is accessed before the end of the stream has been reached," +" its value will be ``b''``." msgstr "" +"اگر پیش از رسیدن به پایان جریان به این ویژگی دسترسی پیدا کنید، مقدار آن " +"``b''`` خواهد بود." -msgid "``False`` if the :meth:`.decompress` method can provide more decompressed data before requiring new uncompressed input." +msgid "" +"``False`` if the :meth:`.decompress` method can provide more decompressed " +"data before requiring new uncompressed input." msgstr "" +"``False`` اگر متد :meth:`.decompress` بتواند پیش از نیاز به ورودی " +"فشرده‌نشده‌ی جدید، داده‌ی فشرده‌گشایی‌شده‌ی بیشتری فراهم کند." msgid "One-shot (de)compression" -msgstr "" +msgstr "فشرده‌سازی/بازگشایی یک‌باره" msgid "Compress *data*, a :term:`bytes-like object `." -msgstr "" +msgstr "فشرده‌سازی *data*، یک :term:`شیء شبه‌بایت `." msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" +"برای فشرده‌سازی افزایشی، در عوض از :class:`BZ2Compressor` استفاده کنید." msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" +"فشرده‌گشایی *data*، یک :term:`شیء شبه‌بایت (bytes-like object) `." -msgid "If *data* is the concatenation of multiple compressed streams, decompress all of the streams." +msgid "" +"If *data* is the concatenation of multiple compressed streams, decompress " +"all of the streams." msgstr "" +"اگر *data* حاصل الحاق چندین جریان فشرده باشد، تمام جریان‌ها را از حالت فشرده" +" خارج می‌کند." msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" +"برای فشرده‌گشایی افزایشی، به‌جای آن از :class:`BZ2Decompressor` استفاده " +"کنید." msgid "Support for multi-stream inputs was added." -msgstr "" +msgstr "پشتیبانی از ورودی‌های چندجریانی (multi-stream) اضافه شد." msgid "Examples of usage" -msgstr "" +msgstr "نمونه‌های استفاده" msgid "Below are some examples of typical usage of the :mod:`!bz2` module." -msgstr "" +msgstr "در زیر چند نمونه از کاربرد معمول ماژول :mod:`!bz2` آمده است." -msgid "Using :func:`compress` and :func:`decompress` to demonstrate round-trip compression:" +msgid "" +"Using :func:`compress` and :func:`decompress` to demonstrate round-trip " +"compression:" msgstr "" +"استفاده از :func:`compress` و :func:`decompress` برای نمایش فشرده‌سازی " +"رفت‌وبرگشتی:" msgid "Using :class:`BZ2Compressor` for incremental compression:" -msgstr "" +msgstr "استفاده از :class:`BZ2Compressor` برای فشرده‌سازی تدریجی:" -msgid "The example above uses a very \"nonrandom\" stream of data (a stream of ``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, repetitive data usually yields a high compression ratio." +msgid "" +"The example above uses a very \"nonrandom\" stream of data (a stream of " +"``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " +"repetitive data usually yields a high compression ratio." msgstr "" +"مثال بالا از یک جریان داده بسیار «غیرتصادفی» استفاده می‌کند (جریانی از " +"تکه‌های ``b\"z\"``). داده‌های تصادفی معمولاً به‌خوبی فشرده نمی‌شوند، در حالی" +" که داده‌های منظم و تکراری معمولاً نسبت فشرده‌سازی بالایی دارند." msgid "Writing and reading a bzip2-compressed file in binary mode:" -msgstr "" +msgstr "نوشتن و خواندن یک فایل فشرده‌شده با bzip2 در حالت دودویی:" diff --git a/library/calendar.po b/library/calendar.po index 92b02504a..8633c89f3 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -24,175 +24,419 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!calendar` --- General calendar-related functions" -msgstr "" +msgstr ":mod:`!calendar` --- توابع عمومی مرتبط با گاه‌شماری" msgid "**Source code:** :source:`Lib/calendar.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/calendar.py`" -msgid "This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use :func:`setfirstweekday` to set the first day of the week to Sunday (6) or to any other weekday. Parameters that specify dates are given as integers. For related functionality, see also the :mod:`datetime` and :mod:`time` modules." -msgstr "" +msgid "" +"This module allows you to output calendars like the Unix :program:`cal` " +"program, and provides additional useful functions related to the calendar. " +"By default, these calendars have Monday as the first day of the week, and " +"Sunday as the last (the European convention). Use :func:`setfirstweekday` to" +" set the first day of the week to Sunday (6) or to any other weekday. " +"Parameters that specify dates are given as integers. For related " +"functionality, see also the :mod:`datetime` and :mod:`time` modules." +msgstr "" +"این ماژول به شما امکان می‌دهد گاه‌شماری‌هایی مانند برنامه‌ی :program:`cal` " +"یونیکس را خروجی دهید و توابع مفید دیگری مرتبط با گاه‌شماری ارائه می‌کند. به‌طور " +"پیش‌فرض، در این گاه‌شماری‌ها دوشنبه اولین روز هفته و یکشنبه آخرین روز هفته است " +"(بر اساس قرارداد اروپایی). برای تنظیم اولین روز هفته روی یکشنبه (۶) یا هر " +"روز دیگری از هفته، از :func:`setfirstweekday` استفاده کنید. پارامترهایی که " +"تاریخ‌ها را مشخص می‌کنند، به‌صورت عدد صحیح داده می‌شوند. برای قابلیت‌های " +"مرتبط، ماژول‌های :mod:`datetime` و :mod:`time` را نیز ببینید." -msgid "The functions and classes defined in this module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. This matches the definition of the \"proleptic Gregorian\" calendar in Dershowitz and Reingold's book \"Calendrical Calculations\", where it's the base calendar for all computations. Zero and negative years are interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is 2 BC, and so on." -msgstr "" +msgid "" +"The functions and classes defined in this module use an idealized calendar, " +"the current Gregorian calendar extended indefinitely in both directions. " +"This matches the definition of the \"proleptic Gregorian\" calendar in " +"Dershowitz and Reingold's book \"Calendrical Calculations\", where it's the " +"base calendar for all computations. Zero and negative years are interpreted" +" as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is 2 BC, " +"and so on." +msgstr "" +"تابع‌ها و کلاس‌های تعریف‌شده در این ماژول از یک گاه‌شماری آرمانی استفاده " +"می‌کنند، یعنی گاه‌شماری میلادی کنونی که به‌طور نامحدود در هر دو جهت گسترش‌یافته " +"است. این با تعریف گاه‌شماری «میلادی تعمیم‌یافته» (proleptic Gregorian) در کتاب " +"«Calendrical Calculations» نوشته‌ی Dershowitz و Reingold مطابقت دارد، که در " +"آن این گاه‌شماری، گاه‌شماری پایه برای همه‌ی محاسبات است. سال‌های صفر و منفی مطابق " +"تجویز استاندارد ISO 8601 تفسیر می‌شوند. سال ۰ برابر با ۱ قبل از میلاد است، " +"سال منفی ۱ برابر با ۲ قبل از میلاد است، و به همین ترتیب." -msgid "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:`SUNDAY` is ``6``." +msgid "" +"Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " +"the first day of the week. :const:`MONDAY` is ``0`` (the default), " +":const:`SUNDAY` is ``6``." msgstr "" +"یک شیء :class:`Calendar` ایجاد می‌کند. *firstweekday* یک عدد صحیح است که " +"اولین روز هفته را مشخص می‌کند. :const:`MONDAY` برابر ``0`` است (پیش‌فرض)، " +":const:`SUNDAY` برابر ``6`` است." -msgid "A :class:`Calendar` object provides several methods that can be used for preparing the calendar data for formatting. This class doesn't do any formatting itself. This is the job of subclasses." +msgid "" +"A :class:`Calendar` object provides several methods that can be used for " +"preparing the calendar data for formatting. This class doesn't do any " +"formatting itself. This is the job of subclasses." msgstr "" +"یک شیء :class:`Calendar` چندین متد ارائه می‌دهد که می‌توان از آن‌ها برای " +"آماده‌سازی داده‌های گاه‌شماری برای قالب‌بندی استفاده کرد. این کلاس به‌خودی‌خود " +"هیچ قالب‌بندی‌ای انجام نمی‌دهد. این وظیفه‌ی زیرکلاس‌ها است." msgid ":class:`Calendar` instances have the following methods and attributes:" -msgstr "" +msgstr "نمونه‌های :class:`Calendar` دارای متدها و ویژگی‌های زیر هستند:" msgid "The first weekday as an integer (0--6)." -msgstr "" +msgstr "نخستین روز هفته به‌صورت عدد صحیح (۰--۶)." -msgid "This property can also be set and read using :meth:`~Calendar.setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." +msgid "" +"This property can also be set and read using " +":meth:`~Calendar.setfirstweekday` and :meth:`~Calendar.getfirstweekday` " +"respectively." msgstr "" +"این ویژگی را همچنین می‌توان به‌ترتیب با :meth:`~Calendar.setfirstweekday` و " +":meth:`~Calendar.getfirstweekday` تنظیم و خواند." msgid "Return an :class:`int` for the current first weekday (0--6)." -msgstr "" +msgstr "یک :class:`int` برای اولین روز هفته‌ی کنونی (0--6) برمی‌گرداند." msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." -msgstr "" +msgstr "معادل خواندن ویژگی :attr:`~Calendar.firstweekday` است." -msgid "Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)." +msgid "" +"Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)." msgstr "" +"اولین روز هفته را روی *firstweekday*، که به‌صورت یک :class:`int` (۰--۶) " +"ارسال می‌شود، تنظیم می‌کند." msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." -msgstr "" +msgstr "دقیقاً معادل تنظیم ویژگی :attr:`~Calendar.firstweekday` است." -msgid "Return an iterator for the weekday numbers that will be used for one week. The first value from the iterator will be the same as the value of the :attr:`~Calendar.firstweekday` property." +msgid "" +"Return an iterator for the weekday numbers that will be used for one week. " +"The first value from the iterator will be the same as the value of the " +":attr:`~Calendar.firstweekday` property." msgstr "" +"یک پیمایش‌گر برای شماره‌های روز هفته که برای یک هفته استفاده خواهد شد، " +"برمی‌گرداند. اولین مقدار این پیمایش‌گر با مقدار ویژگی " +":attr:`~Calendar.firstweekday` یکسان خواهد بود." -msgid "Return an iterator for the month *month* (1--12) in the year *year*. This iterator will return all days (as :class:`datetime.date` objects) for the month and all days before the start of the month or after the end of the month that are required to get a complete week." +msgid "" +"Return an iterator for the month *month* (1--12) in the year *year*. This " +"iterator will return all days (as :class:`datetime.date` objects) for the " +"month and all days before the start of the month or after the end of the " +"month that are required to get a complete week." msgstr "" +"یک پیمایش‌گر برای ماه *month* (۱ تا ۱۲) در سال *year* برمی‌گرداند. این پیمایش‌گر" +" تمام روزهای ماه (به‌صورت اشیای :class:`datetime.date`) و تمام روزهای پیش از" +" شروع ماه یا پس از پایان ماه را که برای داشتن یک هفته کامل لازم هستند " +"برمی‌گرداند." -msgid "Return an iterator for the month *month* in the year *year* similar to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` range. Days returned will simply be day of the month numbers. For the days outside of the specified month, the day number is ``0``." +msgid "" +"Return an iterator for the month *month* in the year *year* similar to " +":meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will simply be day of the month numbers. For the days " +"outside of the specified month, the day number is ``0``." msgstr "" +"یک پیمایش‌گر برای ماه *month* در سال *year* برمی‌گرداند، مشابه " +":meth:`itermonthdates`، اما به بازه‌ی :class:`datetime.date` محدود نیست. " +"روزهای برگردانده‌شده صرفاً شماره‌های روز ماه خواهند بود. برای روزهای خارج از" +" ماه مشخص‌شده، شماره‌ی روز ``0`` است." -msgid "Return an iterator for the month *month* in the year *year* similar to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` range. Days returned will be tuples consisting of a day of the month number and a weekday number." +msgid "" +"Return an iterator for the month *month* in the year *year* similar to " +":meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a day of the month number " +"and a weekday number." msgstr "" +"یک پیمایش‌گر مشابه :meth:`itermonthdates` برای ماه *month* در سال *year* " +"برمی‌گرداند، اما محدود به محدوده‌ی :class:`datetime.date` نیست. روزهای " +"برگردانده‌شده تاپل‌هایی شامل شماره‌ی روز ماه و شماره‌ی روز هفته خواهند بود." -msgid "Return an iterator for the month *month* in the year *year* similar to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` range. Days returned will be tuples consisting of a year, a month and a day of the month numbers." +msgid "" +"Return an iterator for the month *month* in the year *year* similar to " +":meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a year, a month and a day " +"of the month numbers." msgstr "" +"یک پیمایشگر برای ماه *month* در سال *year* برمی‌گرداند، مشابه " +":meth:`itermonthdates`، اما به بازه‌ی :class:`datetime.date` محدود نیست. " +"روزهای برگردانده‌شده تاپل‌هایی شامل شماره‌ی سال، شماره‌ی ماه و شماره‌ی روز " +"ماه خواهند بود." -msgid "Return an iterator for the month *month* in the year *year* similar to :meth:`itermonthdates`, but not restricted by the :class:`datetime.date` range. Days returned will be tuples consisting of a year, a month, a day of the month, and a day of the week numbers." +msgid "" +"Return an iterator for the month *month* in the year *year* similar to " +":meth:`itermonthdates`, but not restricted by the :class:`datetime.date` " +"range. Days returned will be tuples consisting of a year, a month, a day of " +"the month, and a day of the week numbers." msgstr "" +"یک پیمایشگر برای ماه *month* در سال *year* مشابه :meth:`itermonthdates` " +"برمی‌گرداند، اما به محدوده‌ی :class:`datetime.date` محدود نیست. روزهای " +"برگردانده‌شده تاپل‌هایی شامل شماره‌های سال، ماه، روز ماه و روز هفته خواهند " +"بود." -msgid "Return a list of the weeks in the month *month* of the *year* as full weeks. Weeks are lists of seven :class:`datetime.date` objects." +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full weeks." +" Weeks are lists of seven :class:`datetime.date` objects." msgstr "" +"فهرستی از هفته‌های ماه *month* از سال *year* را به‌صورت هفته‌های کامل " +"برمی‌گرداند. هفته‌ها فهرست‌هایی از هفت شیء :class:`datetime.date` هستند." -msgid "Return a list of the weeks in the month *month* of the *year* as full weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full weeks." +" Weeks are lists of seven tuples of day numbers and weekday numbers." msgstr "" +"فهرستی از هفته‌های ماه *month* از سال *year* را به‌صورت هفته‌های کامل " +"برمی‌گرداند. هفته‌ها فهرست‌هایی از هفت چندتاییاز شماره‌های روز و " +"شماره‌های روز هفته هستند." -msgid "Return a list of the weeks in the month *month* of the *year* as full weeks. Weeks are lists of seven day numbers." +msgid "" +"Return a list of the weeks in the month *month* of the *year* as full weeks." +" Weeks are lists of seven day numbers." msgstr "" +"فهرستی از هفته‌های ماه *month* از سال *year* را به‌صورت هفته‌های کامل " +"برمی‌گرداند. هفته‌ها فهرست‌هایی از هفت شماره‌ی روز هستند." -msgid "Return the data for the specified year ready for formatting. The return value is a list of month rows. Each month row contains up to *width* months (defaulting to 3). Each month contains between 4 and 6 weeks and each week contains 1--7 days. Days are :class:`datetime.date` objects." +msgid "" +"Return the data for the specified year ready for formatting. The return " +"value is a list of month rows. Each month row contains up to *width* months " +"(defaulting to 3). Each month contains between 4 and 6 weeks and each week " +"contains 1--7 days. Days are :class:`datetime.date` objects." msgstr "" +"داده‌های سال مشخص‌شده را به‌صورت آماده برای قالب‌بندی برمی‌گرداند. مقدار " +"بازگشتی، فهرستی از ردیف‌های ماه است. هر ردیف ماه شامل حداکثر *width* ماه است" +" (پیش‌فرض ۳). هر ماه شامل بین ۴ تا ۶ هفته است و هر هفته شامل ۱ تا ۷ روز است." +" روزها اشیای :class:`datetime.date` هستند." -msgid "Return the data for the specified year ready for formatting (similar to :meth:`yeardatescalendar`). Entries in the week lists are tuples of day numbers and weekday numbers. Day numbers outside this month are zero." +msgid "" +"Return the data for the specified year ready for formatting (similar to " +":meth:`yeardatescalendar`). Entries in the week lists are tuples of day " +"numbers and weekday numbers. Day numbers outside this month are zero." msgstr "" +"داده‌های سال مشخص‌شده را که برای قالب‌بندی آماده است برمی‌گرداند (مشابه " +":meth:`yeardatescalendar`). ورودی‌های فهرست‌های هفته، تاپل‌هایی از شماره‌های" +" روز و شماره‌های روز هفته هستند. شماره‌های روز خارج از این ماه صفر هستند." -msgid "Return the data for the specified year ready for formatting (similar to :meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day numbers outside this month are zero." +msgid "" +"Return the data for the specified year ready for formatting (similar to " +":meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " +"numbers outside this month are zero." msgstr "" +"داده‌های سال مشخص‌شده را به‌صورت آماده برای قالب‌بندی برمی‌گرداند (مشابه " +":meth:`yeardatescalendar`). ورودی‌های فهرست‌های هفته، شماره‌های روز هستند. " +"شماره‌های روز خارج از این ماه صفر هستند." msgid "This class can be used to generate plain text calendars." -msgstr "" +msgstr "این کلاس می‌تواند برای تولید گاه‌شماری‌های متنی ساده استفاده شود." msgid ":class:`TextCalendar` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`TextCalendar` متدهای زیر را دارند:" -msgid "Return a string representing a single day formatted with the given *width*. If *theday* is ``0``, return a string of spaces of the specified width, representing an empty day. The *weekday* parameter is unused." +msgid "" +"Return a string representing a single day formatted with the given *width*. " +"If *theday* is ``0``, return a string of spaces of the specified width, " +"representing an empty day. The *weekday* parameter is unused." msgstr "" +"رشته‌ای را برمی‌گرداند که نمایانگر یک روز واحد است و با *width* داده‌شده " +"قالب‌بندی شده است. اگر *theday* برابر ``0`` باشد، رشته‌ای از فاصله‌ها با عرض" +" مشخص‌شده برمی‌گرداند که نمایانگر یک روز خالی است. پارامتر *weekday* استفاده" +" نمی‌شود." -msgid "Return a single week in a string with no newline. If *w* is provided, it specifies the width of the date columns, which are centered. Depends on the first weekday as specified in the constructor or set by the :meth:`setfirstweekday` method." +msgid "" +"Return a single week in a string with no newline. If *w* is provided, it " +"specifies the width of the date columns, which are centered. Depends on the " +"first weekday as specified in the constructor or set by the " +":meth:`setfirstweekday` method." msgstr "" +"یک هفته واحد را به‌صورت یک رشته بدون خط جدید برمی‌گرداند. اگر *w* داده شود، " +"عرض ستون‌های تاریخ را مشخص می‌کند؛ این ستون‌ها وسط‌چین هستند. به اولین روز " +"هفته بستگی دارد، همان‌گونه که در سازنده تعیین‌شده است یا با متد " +":meth:`setfirstweekday` تنظیم‌شده است." -msgid "Return a string representing the name of a single weekday formatted to the specified *width*. The *weekday* parameter is an integer representing the day of the week, where ``0`` is Monday and ``6`` is Sunday." +msgid "" +"Return a string representing the name of a single weekday formatted to the " +"specified *width*. The *weekday* parameter is an integer representing the " +"day of the week, where ``0`` is Monday and ``6`` is Sunday." msgstr "" +"رشته‌ای را برمی‌گرداند که نشان‌دهنده نام یک روز هفته است و با عرض مشخص‌شده " +"*width* قالب‌بندی‌شده است. پارامتر *weekday* یک عدد صحیح است که روز هفته را " +"نشان می‌دهد، به‌طوری‌که ``0`` دوشنبه و ``6`` یکشنبه است." -msgid "Return a string containing the header row of weekday names, formatted with the given *width* for each column. The names depend on the locale settings and are padded to the specified width." +msgid "" +"Return a string containing the header row of weekday names, formatted with " +"the given *width* for each column. The names depend on the locale settings " +"and are padded to the specified width." msgstr "" +"رشته‌ای حاوی ردیف سرآیند نام روزهای هفته را برمی‌گرداند که با *width* داده‌شده" +" برای هر ستون قالب‌بندی شده است. این نام‌ها به تنظیمات locale بستگی دارند و تا" +" عرض مشخص‌شده پر می‌شوند." -msgid "Return a month's calendar in a multi-line string. If *w* is provided, it specifies the width of the date columns, which are centered. If *l* is given, it specifies the number of lines that each week will use. Depends on the first weekday as specified in the constructor or set by the :meth:`setfirstweekday` method." -msgstr "" +msgid "" +"Return a month's calendar in a multi-line string. If *w* is provided, it " +"specifies the width of the date columns, which are centered. If *l* is " +"given, it specifies the number of lines that each week will use. Depends on " +"the first weekday as specified in the constructor or set by the " +":meth:`setfirstweekday` method." +msgstr "" +"گاه‌شماری یک ماه را در یک رشته چندخطی برمی‌گرداند. اگر *w* ارائه شود، عرض " +"ستون‌های تاریخ را مشخص می‌کند؛ این ستون‌ها وسط‌چین هستند. اگر *l* داده شود، " +"تعداد خطوطی را که هر هفته استفاده خواهد کرد مشخص می‌کند. به اولین روز هفته " +"بستگی دارد، همان‌طور که در سازنده مشخص شده یا توسط متد " +":meth:`setfirstweekday` تنظیم می‌شود." -msgid "Return a string representing the month's name centered within the specified *width*. If *withyear* is ``True``, include the year in the output. The *theyear* and *themonth* parameters specify the year and month for the name to be formatted respectively." +msgid "" +"Return a string representing the month's name centered within the specified " +"*width*. If *withyear* is ``True``, include the year in the output. The " +"*theyear* and *themonth* parameters specify the year and month for the name " +"to be formatted respectively." msgstr "" +"رشته‌ای برمی‌گرداند که نام ماه را به‌صورت وسط‌چین در عرض مشخص‌شده با *width*" +" نشان می‌دهد. اگر *withyear* برابر ``True`` باشد، سال در خروجی گنجانده " +"می‌شود. پارامترهای *theyear* و *themonth* به‌ترتیب سال و ماهِ نامی را که " +"باید قالب‌بندی شود مشخص می‌کنند." msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "" +"گاه‌شماری یک ماه را همان‌طور که توسط :meth:`formatmonth` برگردانده می‌شود، چاپ " +"کنید." -msgid "Return a *m*-column calendar for an entire year as a multi-line string. Optional parameters *w*, *l*, and *c* are for date column width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as specified in the constructor or set by the :meth:`setfirstweekday` method. The earliest year for which a calendar can be generated is platform-dependent." -msgstr "" +msgid "" +"Return a *m*-column calendar for an entire year as a multi-line string. " +"Optional parameters *w*, *l*, and *c* are for date column width, lines per " +"week, and number of spaces between month columns, respectively. Depends on " +"the first weekday as specified in the constructor or set by the " +":meth:`setfirstweekday` method. The earliest year for which a calendar can " +"be generated is platform-dependent." +msgstr "" +"گاه‌شماریی با *m* ستون برای یک سال کامل را به‌عنوان یک رشته‌ی چندخطی برمی‌گرداند." +" پارامترهای اختیاری *w*، *l* و *c* به‌ترتیب برای عرض ستون تاریخ، تعداد خطوط" +" هر هفته و تعداد فاصله‌های بین ستون‌های ماه هستند. به اولین روز هفته بستگی " +"دارد، همان‌طور که در سازنده مشخص شده یا با متد :meth:`setfirstweekday` تنظیم" +" شده است. اولین سالی که می‌توان برای آن گاه‌شماری تولید کرد، وابسته به پلتفرم " +"است." -msgid "Print the calendar for an entire year as returned by :meth:`formatyear`." +msgid "" +"Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "" +"گاه‌شماری یک سال کامل را همان‌طور که توسط :meth:`formatyear` برگردانده می‌شود، " +"چاپ کنید." msgid "This class can be used to generate HTML calendars." -msgstr "" +msgstr "این کلاس می‌تواند برای تولید گاه‌شماری‌های HTML استفاده شود." msgid ":class:`!HTMLCalendar` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`!HTMLCalendar` متدهای زیر را دارند:" -msgid "Return a month's calendar as an HTML table. If *withyear* is true the year will be included in the header, otherwise just the month name will be used." +msgid "" +"Return a month's calendar as an HTML table. If *withyear* is true the year " +"will be included in the header, otherwise just the month name will be used." msgstr "" +"گاه‌شماری یک ماه را به‌صورت یک جدول HTML برمی‌گرداند. اگر *withyear* درست باشد، " +"سال در سرآیند گنجانده می‌شود؛ در غیر این صورت، فقط از نام ماه استفاده می‌شود." -msgid "Return a year's calendar as an HTML table. *width* (defaulting to 3) specifies the number of months per row." +msgid "" +"Return a year's calendar as an HTML table. *width* (defaulting to 3) " +"specifies the number of months per row." msgstr "" +"گاه‌شماری یک سال را به‌صورت یک جدول HTML برمی‌گرداند. *width* (با پیش‌فرض ۳) " +"تعداد ماه‌ها در هر ردیف را مشخص می‌کند." -msgid "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) specifies the number of months per row. *css* is the name for the cascading style sheet to be used. :const:`None` can be passed if no style sheet should be used. *encoding* specifies the encoding to be used for the output (defaulting to the system default encoding)." -msgstr "" +msgid "" +"Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " +"specifies the number of months per row. *css* is the name for the cascading " +"style sheet to be used. :const:`None` can be passed if no style sheet should" +" be used. *encoding* specifies the encoding to be used for the output " +"(defaulting to the system default encoding)." +msgstr "" +"گاه‌شماری یک سال را به‌عنوان یک صفحه HTML کامل بازمی‌گرداند. *width* (که پیش‌فرض" +" آن ۳ است) تعداد ماه‌ها در هر ردیف را مشخص می‌کند. *css* نام شیوه‌نامه آبشاری" +" مورد استفاده است. اگر نباید از شیوه‌نامه استفاده شود، می‌توان :const:`None`" +" را ارسال کرد. *encoding* کدگذاری مورد استفاده برای خروجی را مشخص می‌کند (که" +" پیش‌فرض آن کدگذاری پیش‌فرض سیستم است)." -msgid "Return a month name as an HTML table row. If *withyear* is true the year will be included in the row, otherwise just the month name will be used." +msgid "" +"Return a month name as an HTML table row. If *withyear* is true the year " +"will be included in the row, otherwise just the month name will be used." msgstr "" +"نام یک ماه را به‌عنوان یک ردیف جدول HTML برمی‌گرداند. اگر *withyear* درست " +"باشد، سال در ردیف گنجانده خواهد شد، در غیر این صورت فقط از نام ماه استفاده " +"خواهد شد." -msgid ":class:`!HTMLCalendar` has the following attributes you can override to customize the CSS classes used by the calendar:" +msgid "" +":class:`!HTMLCalendar` has the following attributes you can override to " +"customize the CSS classes used by the calendar:" msgstr "" +":class:`!HTMLCalendar` دارای ویژگی‌های زیر است که می‌توانید آن‌ها را " +"بازنویسی کنید تا کلاس‌های CSS استفاده‌شده توسط گاه‌شماری را سفارشی‌سازی کنید:" -msgid "A list of CSS classes used for each weekday. The default class list is::" +msgid "" +"A list of CSS classes used for each weekday. The default class list is::" msgstr "" +"فهرستی از کلاس‌های CSS که برای هر روز هفته استفاده می‌شوند. فهرست پیش‌فرض " +"کلاس‌ها به صورت زیر است::" msgid "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" -msgstr "" +msgstr "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" msgid "more styles can be added for each day::" -msgstr "" +msgstr "می‌توان سبک‌های بیشتری را برای هر روز اضافه کرد::" msgid "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun red\"]" -msgstr "" +msgstr "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun red\"]" msgid "Note that the length of this list must be seven items." -msgstr "" +msgstr "توجه داشته باشید که طول این فهرست باید ۷ آیتم باشد." msgid "The CSS class for a weekday occurring in the previous or coming month." -msgstr "" +msgstr "کلاس CSS برای روز هفته‌ای که در ماه گذشته یا آینده قرار دارد." -msgid "A list of CSS classes used for weekday names in the header row. The default is the same as :attr:`cssclasses`." +msgid "" +"A list of CSS classes used for weekday names in the header row. The default " +"is the same as :attr:`cssclasses`." msgstr "" +"فهرستی از کلاس‌های CSS که برای نام روزهای هفته در ردیف سرآیند استفاده " +"می‌شوند. مقدار پیش‌فرض همان :attr:`cssclasses` است." -msgid "The month's head CSS class (used by :meth:`formatmonthname`). The default value is ``\"month\"``." +msgid "" +"The month's head CSS class (used by :meth:`formatmonthname`). The default " +"value is ``\"month\"``." msgstr "" +"کلاس CSS سرصفحه‌ی ماه (که توسط :meth:`formatmonthname` استفاده می‌شود). " +"مقدار پیش‌فرض ``\"month\"`` است." -msgid "The CSS class for the whole month's table (used by :meth:`formatmonth`). The default value is ``\"month\"``." +msgid "" +"The CSS class for the whole month's table (used by :meth:`formatmonth`). The" +" default value is ``\"month\"``." msgstr "" +"کلاس CSS برای جدول کل ماه (که توسط :meth:`formatmonth` استفاده می‌شود). " +"مقدار پیش‌فرض ``\"month\"`` است." -msgid "The CSS class for the whole year's table of tables (used by :meth:`formatyear`). The default value is ``\"year\"``." +msgid "" +"The CSS class for the whole year's table of tables (used by " +":meth:`formatyear`). The default value is ``\"year\"``." msgstr "" +"کلاس CSS برای جدولِ جدول‌های کل سال (که توسط :meth:`formatyear` استفاده " +"می‌شود). مقدار پیش‌فرض ``\"year\"`` است." -msgid "The CSS class for the table head for the whole year (used by :meth:`formatyear`). The default value is ``\"year\"``." +msgid "" +"The CSS class for the table head for the whole year (used by " +":meth:`formatyear`). The default value is ``\"year\"``." msgstr "" +"کلاس CSS برای سرآیند جدولِ کل سال (که توسط :meth:`formatyear` استفاده " +"می‌شود). مقدار پیش‌فرض ``\"year\"`` است." -msgid "Note that although the naming for the above described class attributes is singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the single CSS class with a space separated list of CSS classes, for example::" +msgid "" +"Note that although the naming for the above described class attributes is " +"singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " +"single CSS class with a space separated list of CSS classes, for example::" msgstr "" +"توجه داشته باشید که اگرچه نام‌گذاری ویژگی‌های کلاس توصیف‌شده در بالا به‌صورت" +" مفرد است (مثلاً ``cssclass_month`` ``cssclass_noday``)، می‌توانید کلاس CSS " +"تکی را با فهرستی از کلاس‌های CSS جداشده با فاصله جایگزین کنید، برای مثال::" msgid "\"text-bold text-red\"" -msgstr "" +msgstr "text-bold text-red" msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" -msgstr "" +msgstr "در اینجا مثالی از نحوه‌ی سفارشی‌سازی :class:`!HTMLCalendar` آمده است::" msgid "" "class CustomHTMLCal(calendar.HTMLCalendar):\n" @@ -202,137 +446,282 @@ msgid "" " cssclass_month = \"text-center month\"\n" " cssclass_year = \"text-italic lead\"" msgstr "" +"class CustomHTMLCal(calendar.HTMLCalendar):\n" +" cssclasses = [style + \" text-nowrap\" for style in\n" +" calendar.HTMLCalendar.cssclasses]\n" +" cssclass_month_head = \"text-center month-head\"\n" +" cssclass_month = \"text-center month\"\n" +" cssclass_year = \"text-italic lead\"" -msgid "This subclass of :class:`TextCalendar` can be passed a locale name in the constructor and will return month and weekday names in the specified locale." +msgid "" +"This subclass of :class:`TextCalendar` can be passed a locale name in the " +"constructor and will return month and weekday names in the specified locale." msgstr "" +"این زیرکلاس از :class:`TextCalendar` می‌تواند یک نام منطقه (locale) را در " +"سازنده دریافت کند و نام ماه‌ها و روزهای هفته را در منطقه مشخص‌شده " +"برمی‌گرداند." -msgid "This subclass of :class:`HTMLCalendar` can be passed a locale name in the constructor and will return month and weekday names in the specified locale." +msgid "" +"This subclass of :class:`HTMLCalendar` can be passed a locale name in the " +"constructor and will return month and weekday names in the specified locale." msgstr "" +"این زیرکلاسِ :class:`HTMLCalendar` می‌تواند در سازنده یک نام منطقه (locale)" +" را بپذیرد و نام ماه‌ها و روزهای هفته را در منطقه‌ی مشخص‌شده برگرداند." -msgid "The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods of these two classes temporarily change the ``LC_TIME`` locale to the given *locale*. Because the current locale is a process-wide setting, they are not thread-safe." +msgid "" +"The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods" +" of these two classes temporarily change the ``LC_TIME`` locale to the given" +" *locale*. Because the current locale is a process-wide setting, they are " +"not thread-safe." msgstr "" +"سازنده و متدهای :meth:`!formatweekday` و :meth:`!formatmonthname` این دو " +"کلاس، تنظیم locale (locale) مربوط به ``LC_TIME`` را به‌طور موقت به *locale* " +"داده‌شده تغییر می‌دهند. از آن‌جا که تنظیم locale فعلی یک تنظیم در سطح کل " +"فرایند است، آن‌ها ایمن در برابر نخ نیستند." -msgid "For simple text calendars this module provides the following functions." -msgstr "" +msgid "" +"For simple text calendars this module provides the following functions." +msgstr "برای گاه‌شماری‌های متنی ساده، این ماژول توابع زیر را فراهم می‌کند." -msgid "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are provided for convenience. For example, to set the first weekday to Sunday::" +msgid "" +"Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " +"values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, " +":const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` " +"are provided for convenience. For example, to set the first weekday to " +"Sunday::" msgstr "" +"روز هفته را برای آغاز هر هفته تنظیم می‌کند (``0`` دوشنبه است، ``6`` یکشنبه " +"است). مقادیر :const:`MONDAY`، :const:`TUESDAY`، :const:`WEDNESDAY`، " +":const:`THURSDAY`، :const:`FRIDAY`، :const:`SATURDAY` و :const:`SUNDAY` برای" +" سهولت ارائه شده‌اند. برای مثال، برای تنظیم اولین روز هفته به یکشنبه::" msgid "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" msgstr "" +"import calendar\n" +"calendar.setfirstweekday(calendar.SUNDAY)" msgid "Returns the current setting for the weekday to start each week." msgstr "" +"تنظیم فعلی برای روز هفته‌ای که هر هفته با آن آغاز می‌شود را برمی‌گرداند." -msgid "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." +msgid "" +"Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "" +"اگر *year* یک سال کبیسه باشد، :const:`True` را برمی‌گرداند، در غیر این صورت " +":const:`False` را برمی‌گرداند." -msgid "Returns the number of leap years in the range from *y1* to *y2* (exclusive), where *y1* and *y2* are years." +msgid "" +"Returns the number of leap years in the range from *y1* to *y2* (exclusive)," +" where *y1* and *y2* are years." msgstr "" +"تعداد سال‌های کبیسه در بازه‌ای از *y1* تا *y2* (انحصاری) را برمی‌گرداند، که " +"در آن *y1* و *y2* سال هستند." msgid "This function works for ranges spanning a century change." -msgstr "" +msgstr "این تابع برای بازه‌هایی که تغییر قرن را دربرمی‌گیرند، کار می‌کند." -msgid "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), *month* (``1``--``12``), *day* (``1``--``31``)." +msgid "" +"Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " +"*month* (``1``--``12``), *day* (``1``--``31``)." msgstr "" +"روز هفته (``0`` دوشنبه است) را برای *year* (``1970``--...)، *month* " +"(``1``--``12``)، *day* (``1``--``31``) برمی‌گرداند." -msgid "Return a header containing abbreviated weekday names. *width* specifies the width in characters for one weekday." +msgid "" +"Return a header containing abbreviated weekday names. *width* specifies the " +"width in characters for one weekday." msgstr "" +"یک سرآیند شامل نام‌های کوتاه‌شده روزهای هفته برمی‌گرداند. *width* عرض یک روز " +"هفته را بر حسب تعداد نویسه‌ها مشخص می‌کند." -msgid "Returns weekday of first day of the month and number of days in month, for the specified *year* and *month*." +msgid "" +"Returns weekday of first day of the month and number of days in month, for " +"the specified *year* and *month*." msgstr "" +"روز هفته‌ی اولین روز ماه و تعداد روزهای ماه را برای *سال* و *ماه* مشخص‌شده " +"برمی‌گرداند." -msgid "Returns a matrix representing a month's calendar. Each row represents a week; days outside of the month are represented by zeros. Each week begins with Monday unless set by :func:`setfirstweekday`." +msgid "" +"Returns a matrix representing a month's calendar. Each row represents a " +"week; days outside of the month are represented by zeros. Each week begins " +"with Monday unless set by :func:`setfirstweekday`." msgstr "" +"ماتریسی را برمی‌گرداند که گاه‌شماری یک ماه را نشان می‌دهد. هر ردیف نشان‌دهنده یک " +"هفته است؛ روزهای خارج از ماه با صفر نشان داده می‌شوند. هر هفته با دوشنبه " +"آغاز می‌شود، مگر آنکه توسط :func:`setfirstweekday` تنظیم شده باشد." msgid "Prints a month's calendar as returned by :func:`month`." msgstr "" +"گاه‌شماری یک ماه را همان‌طور که توسط :func:`month` برگردانده می‌شود، چاپ می‌کند." -msgid "Returns a month's calendar in a multi-line string using the :meth:`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." +msgid "" +"Returns a month's calendar in a multi-line string using the " +":meth:`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." msgstr "" +"گاه‌شماری یک ماه را به‌صورت یک رشته‌ی چندخطی با استفاده از " +":meth:`~TextCalendar.formatmonth` از کلاس :class:`TextCalendar` برمی‌گرداند." -msgid "Prints the calendar for an entire year as returned by :func:`calendar`." +msgid "" +"Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "" +"گاه‌شماری یک سال کامل را به‌همان‌صورتی که :func:`calendar` برمی‌گرداند، چاپ " +"می‌کند." -msgid "Returns a 3-column calendar for an entire year as a multi-line string using the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." +msgid "" +"Returns a 3-column calendar for an entire year as a multi-line string using " +"the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." msgstr "" +"یک گاه‌شماری سه‌ستونه برای کل سال را به‌عنوان یک رشته چندخطی با استفاده از " +":meth:`~TextCalendar.formatyear` از کلاس :class:`TextCalendar` برمی‌گرداند." -msgid "An unrelated but handy function that takes a time tuple such as returned by the :func:`~time.gmtime` function in the :mod:`time` module, and returns the corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each other's inverse." -msgstr "" +msgid "" +"An unrelated but handy function that takes a time tuple such as returned by " +"the :func:`~time.gmtime` function in the :mod:`time` module, and returns the" +" corresponding Unix timestamp value, assuming an epoch of 1970, and the " +"POSIX encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each " +"other's inverse." +msgstr "" +"تابعی نامرتبط اما کاربردی که یک تاپل زمانی مانند آنچه توسط تابع " +":func:`~time.gmtime` در ماژول :mod:`time` برگردانده می‌شود را دریافت می‌کند " +"و مقدار برچسب زمانی یونیکس متناظر را، با فرض مبدأ زمانی سال ۱۹۷۰ و کدگذاری " +"POSIX، برمی‌گرداند. در واقع، :func:`time.gmtime` و :func:`timegm` معکوس " +"یکدیگرند." msgid "The :mod:`!calendar` module exports the following data attributes:" -msgstr "" +msgstr "ماژول :mod:`!calendar` ویژگی‌های داده زیر را صادر می‌کند:" -msgid "A sequence that represents the days of the week in the current locale, where Monday is day number 0." +msgid "" +"A sequence that represents the days of the week in the current locale, where" +" Monday is day number 0." msgstr "" +"دنباله‌ای که روزهای هفته را در locale (locale) نشان می‌دهد، به‌طوری که " +"دوشنبه روز شماره ۰ است." -msgid "A sequence that represents the abbreviated days of the week in the current locale, where Mon is day number 0." +msgid "" +"A sequence that represents the abbreviated days of the week in the current " +"locale, where Mon is day number 0." msgstr "" +"دنباله‌ای که روزهای هفته را به‌صورت مخفف در محل (locale) فعلی نشان می‌دهد، " +"که در آن Mon روز شماره ۰ است." -msgid "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." +msgid "" +"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " +"is ``6``." msgstr "" +"نام‌های مستعار روزهای هفته، که در آن‌ها ``MONDAY`` برابر با ``0`` و " +"``SUNDAY`` برابر با ``6`` است." -msgid "Enumeration defining days of the week as integer constants. The members of this enumeration are exported to the module scope as :data:`MONDAY` through :data:`SUNDAY`." +msgid "" +"Enumeration defining days of the week as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`MONDAY` through " +":data:`SUNDAY`." msgstr "" +"شمارشی که روزهای هفته را به‌عنوان ثابت‌های عدد صحیح تعریف می‌کند. اعضای این" +" شمارش به محدوده ماژول صادر می‌شوند، به‌صورت :data:`MONDAY` تا " +":data:`SUNDAY`." -msgid "A sequence that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_name[0]`` is the empty string." +msgid "" +"A sequence that represents the months of the year in the current locale. " +"This follows normal convention of January being month number 1, so it has a " +"length of 13 and ``month_name[0]`` is the empty string." msgstr "" +"یک دنباله که ماه‌های سال را در locale فعلی (locale) نشان می‌دهد. این " +"دنباله از قرارداد معمول پیروی می‌کند که بر اساس آن ژانویه ماه شماره‌ی ۱ است،" +" بنابراین طول آن ۱۳ است و ``month_name[0]`` رشته‌ی خالی است." -msgid "A sequence that represents the abbreviated months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ``month_abbr[0]`` is the empty string." +msgid "" +"A sequence that represents the abbreviated months of the year in the current" +" locale. This follows normal convention of January being month number 1, so" +" it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" +"دنباله‌ای که نام‌های مخفف ماه‌های سال را در محل (locale) جاری نشان می‌دهد. " +"این از قرارداد معمول پیروی می‌کند که ژانویه ماه شماره‌ی ۱ است، بنابراین طول " +"آن ۱۳ است و ``month_abbr[0]`` رشته‌ی خالی است." -msgid "Aliases for the months of the year, where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``." +msgid "" +"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " +"``DECEMBER`` is ``12``." msgstr "" +"نام‌های مستعار برای ماه‌های سال، که در آن‌ها ``JANUARY`` برابر ``1`` و " +"``DECEMBER`` برابر ``12`` است." -msgid "Enumeration defining months of the year as integer constants. The members of this enumeration are exported to the module scope as :data:`JANUARY` through :data:`DECEMBER`." +msgid "" +"Enumeration defining months of the year as integer constants. The members of" +" this enumeration are exported to the module scope as :data:`JANUARY` " +"through :data:`DECEMBER`." msgstr "" +"شمارشی که ماه‌های سال را به‌عنوان ثابت‌های عدد صحیح تعریف می‌کند. اعضای این " +"شمارش با نام‌های :data:`JANUARY` تا :data:`DECEMBER` به محدوده ماژول صادر " +"شده‌اند." msgid "The :mod:`!calendar` module defines the following exceptions:" -msgstr "" +msgstr "ماژول :mod:`!calendar` استثناهای زیر را تعریف می‌کند:" -msgid "A subclass of :exc:`ValueError` and :exc:`IndexError`, raised when the given month number is outside of the range 1-12 (inclusive)." +msgid "" +"A subclass of :exc:`ValueError` and :exc:`IndexError`, raised when the given" +" month number is outside of the range 1-12 (inclusive)." msgstr "" +"زیرکلاسی از :exc:`ValueError` و :exc:`IndexError`، زمانی پرتاب می‌شود که " +"شماره ماه داده‌شده خارج از بازه‌ی ۱ تا ۱۲ (شامل هر دو) باشد." -msgid ":exc:`IllegalMonthError` is now also a subclass of :exc:`ValueError`. New code should avoid catching :exc:`IndexError`." +msgid "" +":exc:`IllegalMonthError` is now also a subclass of :exc:`ValueError`. New " +"code should avoid catching :exc:`IndexError`." msgstr "" +":exc:`IllegalMonthError` اکنون نیز یک زیرکلاس از :exc:`ValueError` است. کد " +"جدید باید از گرفتن :exc:`IndexError` خودداری کند." msgid "The invalid month number." -msgstr "" +msgstr "شماره‌ی ماه نامعتبر." -msgid "A subclass of :exc:`ValueError`, raised when the given weekday number is outside of the range 0-6 (inclusive)." +msgid "" +"A subclass of :exc:`ValueError`, raised when the given weekday number is " +"outside of the range 0-6 (inclusive)." msgstr "" +"زیرکلاسی از :exc:`ValueError` که زمانی پرتاب می‌شود که شماره‌ی روز هفته‌ی " +"داده‌شده خارج از بازه‌ی ۰ تا ۶ (شامل هر دو) باشد." msgid "The invalid weekday number." -msgstr "" +msgstr "شماره‌ی نامعتبر روز هفته." msgid "Module :mod:`datetime`" -msgstr "" +msgstr "ماژول :mod:`datetime`" -msgid "Object-oriented interface to dates and times with similar functionality to the :mod:`time` module." +msgid "" +"Object-oriented interface to dates and times with similar functionality to " +"the :mod:`time` module." msgstr "" +"رابط شیءگرا برای تاریخ‌ها و زمان‌ها با عملکردی مشابه ماژول :mod:`time`." msgid "Module :mod:`time`" -msgstr "" +msgstr "ماژول :mod:`time`" msgid "Low-level time related functions." -msgstr "" +msgstr "تابع‌های سطح پایین مرتبط با زمان." msgid "Command-line usage" -msgstr "" +msgstr "استفاده از خط فرمان" -msgid "The :mod:`!calendar` module can be executed as a script from the command line to interactively print a calendar." +msgid "" +"The :mod:`!calendar` module can be executed as a script from the command " +"line to interactively print a calendar." msgstr "" +"ماژول :mod:`!calendar` را می‌توان به‌عنوان یک اسکریپت از خط فرمان اجرا کرد " +"تا یک گاه‌شماری به‌صورت تعاملی چاپ شود." msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" " [-f FIRST_WEEKDAY] [year] [month]" msgstr "" +"python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" +" [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" +" [-f FIRST_WEEKDAY] [year] [month]" msgid "For example, to print a calendar for the year 2000:" -msgstr "" +msgstr "برای مثال، برای چاپ گاه‌شماری سال ۲۰۰۰:" msgid "" "$ python -m calendar 2000\n" @@ -373,51 +762,124 @@ msgid "" "23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" "30 31" msgstr "" +"$ python -m calendar 2000\n" +" 2000\n" +"\n" +" January February March\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3 4 5\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26\n" +"24 25 26 27 28 29 30 28 29 27 28 29 30 31\n" +"31\n" +"\n" +" April May June\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 7 1 2 3 4\n" +" 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\n" +"10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\n" +"17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\n" +"24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\n" +"\n" +" July August September\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\n" +"24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\n" +"31\n" +"\n" +" October November December\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 1 2 3 4 5 1 2 3\n" +" 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\n" +" 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\n" +"16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\n" +"23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" +"30 31" msgid "The following options are accepted:" -msgstr "" +msgstr "گزینه‌های زیر پذیرفته می‌شوند:" msgid "Show the help message and exit." -msgstr "" +msgstr "پیام راهنما را نمایش می‌دهد و خارج می‌شود." msgid "The locale to use for month and weekday names. Defaults to English." msgstr "" +"locale (locale) مورد استفاده برای نام ماه‌ها و روزهای هفته. پیش‌فرض آن " +"انگلیسی است." -msgid "The encoding to use for output. :option:`--encoding` is required if :option:`--locale` is set." +msgid "" +"The encoding to use for output. :option:`--encoding` is required if " +":option:`--locale` is set." msgstr "" +"کدگذاری مورد استفاده برای خروجی. اگر :option:`--locale` تنظیم شده باشد، " +":option:`--encoding` الزامی است." msgid "Print the calendar to the terminal as text, or as an HTML document." -msgstr "" +msgstr "گاه‌شماری را به‌صورت متن یا به‌عنوان یک سند HTML در پایانه چاپ کنید." -msgid "The weekday to start each week. Must be a number between 0 (Monday) and 6 (Sunday). Defaults to 0." +msgid "" +"The weekday to start each week. Must be a number between 0 (Monday) and 6 " +"(Sunday). Defaults to 0." msgstr "" +"روز هفته برای شروع هر هفته. باید عددی بین ۰ (دوشنبه) و ۶ (یکشنبه) باشد. " +"پیش‌فرض ۰ است." msgid "The year to print the calendar for. Defaults to the current year." -msgstr "" +msgstr "سالی که گاه‌شماری برای آن چاپ می‌شود. پیش‌فرض آن سال جاری است." -msgid "The month of the specified :option:`year` to print the calendar for. Must be a number between 1 and 12, and may only be used in text mode. Defaults to printing a calendar for the full year." +msgid "" +"The month of the specified :option:`year` to print the calendar for. Must be" +" a number between 1 and 12, and may only be used in text mode. Defaults to " +"printing a calendar for the full year." msgstr "" +"ماه از :option:`year` مشخص‌شده برای چاپ گاه‌شماری. باید عددی بین ۱ تا ۱۲ باشد و " +"فقط می‌تواند در حالت متنی استفاده شود. به‌طور پیش‌فرض، گاه‌شماریی برای تمام سال " +"چاپ می‌شود." msgid "*Text-mode options:*" -msgstr "" +msgstr "*گزینه‌های حالت متنی:*" -msgid "The width of the date column in terminal columns. The date is printed centred in the column. Any value lower than 2 is ignored. Defaults to 2." +msgid "" +"The width of the date column in terminal columns. The date is printed " +"centred in the column. Any value lower than 2 is ignored. Defaults to 2." msgstr "" +"عرض ستون تاریخ بر حسب ستون‌های پایانه. تاریخ به‌صورت وسط‌چین در ستون چاپ " +"می‌شود. هر مقدار کمتر از ۲ نادیده گرفته می‌شود. مقدار پیش‌فرض ۲ است." -msgid "The number of lines for each week in terminal rows. The date is printed top-aligned. Any value lower than 1 is ignored. Defaults to 1." +msgid "" +"The number of lines for each week in terminal rows. The date is printed top-" +"aligned. Any value lower than 1 is ignored. Defaults to 1." msgstr "" +"تعداد خط‌های هر هفته در ردیف‌های پایانه. تاریخ با تراز از بالا چاپ می‌شود. " +"هر مقداری کمتر از ۱ باشد نادیده گرفته می‌شود. مقدار پیش‌فرض ۱ است." -msgid "The space between months in columns. Any value lower than 2 is ignored. Defaults to 6." +msgid "" +"The space between months in columns. Any value lower than 2 is ignored. " +"Defaults to 6." msgstr "" +"فاصله‌ی میان ماه‌ها در ستون‌ها. هر مقداری کمتر از ۲ باشد، در نظر گرفته " +"نمی‌شود. مقدار پیش‌فرض آن ۶ است." msgid "The number of months printed per row. Defaults to 3." -msgstr "" +msgstr "تعداد ماه‌های چاپ‌شده در هر ردیف. مقدار پیش‌فرض ۳ است." -msgid "By default, today's date is highlighted in color and can be :ref:`controlled using environment variables `." +msgid "" +"By default, today's date is highlighted in color and can be :ref:`controlled" +" using environment variables `." msgstr "" +"به‌طور پیش‌فرض، تاریخ امروز با رنگ برجسته می‌شود و می‌توان آن را :ref:`با " +"استفاده از متغیرهای محیطی کنترل کرد `." msgid "*HTML-mode options:*" -msgstr "" +msgstr "*گزینه‌های حالت HTML:*" -msgid "The path of a CSS stylesheet to use for the calendar. This must either be relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." +msgid "" +"The path of a CSS stylesheet to use for the calendar. This must either be " +"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." msgstr "" +"مسیر شیوه‌نامه CSS برای استفاده در گاه‌شماری. این مسیر باید یا نسبت به HTML " +"تولیدشده نسبی باشد، یا یک URL مطلق HTTP یا ``file:///``." diff --git a/library/cgi.po b/library/cgi.po index a19826a1c..abbc5e9e0 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -22,13 +22,29 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!cgi` --- Common Gateway Interface support" -msgstr "" +msgstr ":mod:`!cgi` --- پشتیبانی از Common Gateway Interface" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. حذف " +"آن در :pep:`594` مقرر شد." -msgid "A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This is a copy of the cgi module, no longer maintained or supported by the core Python team." +msgid "" +"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " +"is a copy of the cgi module, no longer maintained or supported by the core " +"Python team." msgstr "" +"در عوض می‌توان به‌جای آن از یک فورک (fork) این ماژول در PyPI استفاده کرد: " +":pypi:`legacy-cgi`. این یک کپی از ماژول cgi است که دیگر توسط تیم اصلی پایتون" +" نگهداری یا پشتیبانی نمی‌شود." -msgid "The last version of Python that provided the :mod:`!cgi` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!cgi` module was `Python " +"3.12 `_." msgstr "" +"آخرین نسخه پایتون که ماژول :mod:`!cgi` را ارائه می‌کرد، `Python 3.12 " +"`_ بود." diff --git a/library/cgitb.po b/library/cgitb.po index 8577e7762..ec635c8f6 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -22,13 +22,29 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" -msgstr "" +msgstr ":mod:`!cgitb` --- مدیر ردگیری پشته برای اسکریپت‌های CGI" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. پس از منسوخ شدن در " +"پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. تصمیم برای " +"حذف در :pep:`594` گرفته شد." -msgid "A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. This is a copy of the cgi module, no longer maintained or supported by the core Python team." +msgid "" +"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " +"This is a copy of the cgi module, no longer maintained or supported by the " +"core Python team." msgstr "" +"اکنون می‌توان به‌جای آن از نسخه منشعب‌شده‌ای (fork) از این ماژول در PyPI " +"استفاده کرد: :pypi:`legacy-cgi`. این یک کپی از ماژول cgi است که دیگر توسط " +"تیم اصلی پایتون نگهداری یا پشتیبانی نمی‌شود." -msgid "The last version of Python that provided the :mod:`!cgitb` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!cgitb` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!cgitb` را ارائه می‌داد، `Python 3.12 " +"`_ بود." diff --git a/library/chunk.po b/library/chunk.po index 960972530..712d7d93d 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!chunk` --- Read IFF chunked data" -msgstr "" +msgstr ":mod:`!chunk` --- خواندن داده‌های بخش‌بندی‌شده (chunked) IFF" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. " +"تصمیم به حذف آن در :pep:`594` گرفته شد." -msgid "The last version of Python that provided the :mod:`!chunk` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!chunk` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!chunk` را ارائه می‌کرد `Python 3.12 " +"`_ بود." diff --git a/library/cmath.po b/library/cmath.po index 791e98057..acb96b2ec 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"PO-Revision-Date: 2026-08-28 11:34+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,244 +23,318 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!cmath` --- Mathematical functions for complex numbers" -msgstr "" +msgstr ":mod:`!cmath` --- توابع ریاضی برای اعداد مختلط" -msgid "This module provides access to mathematical functions for complex numbers. The functions in this module accept integers, floating-point numbers or complex numbers as arguments. They will also accept any Python object that has either a :meth:`~object.__complex__` or a :meth:`~object.__float__` method: these methods are used to convert the object to a complex or floating-point number, respectively, and the function is then applied to the result of the conversion." -msgstr "" +msgid "" +"This module provides access to mathematical functions for complex numbers. " +"The functions in this module accept integers, floating-point numbers or " +"complex numbers as arguments. They will also accept any Python object that " +"has either a :meth:`~object.__complex__` or a :meth:`~object.__float__` " +"method: these methods are used to convert the object to a complex or " +"floating-point number, respectively, and the function is then applied to " +"the result of the conversion." +msgstr "" +"این ماژول دسترسی به توابع ریاضی مربوط به اعداد مختلط را فراهم می‌کند. توابع " +"این ماژول اعداد صحیح، اعداد ممیز شناور یا اعداد مختلط را به‌عنوان آرگومان " +"می‌پذیرند. این توابع همچنین هر شیء پایتونی را که دارای " +"متد :meth:`~object.__complex__` یا :meth:`~object.__float__` باشد نیز " +"می‌پذیرند: این متدها به‌ترتیب برای تبدیل شیء به عدد مختلط یا ممیز شناور " +"استفاده می‌شوند و سپس تابع بر نتیجه‌ی تبدیل اعمال می‌شود." -msgid "For functions involving branch cuts, we have the problem of deciding how to define those functions on the cut itself. Following Kahan's \"Branch cuts for complex elementary functions\" paper, as well as Annex G of C99 and later C standards, we use the sign of zero to distinguish one side of the branch cut from the other: for a branch cut along (a portion of) the real axis we look at the sign of the imaginary part, while for a branch cut along the imaginary axis we look at the sign of the real part." -msgstr "" +msgid "" +"For functions involving branch cuts, we have the problem of deciding how to " +"define those functions on the cut itself. Following Kahan's \"Branch cuts " +"for complex elementary functions\" paper, as well as Annex G of C99 and " +"later C standards, we use the sign of zero to distinguish one side of the " +"branch cut from the other: for a branch cut along (a portion of) the real " +"axis we look at the sign of the imaginary part, while for a branch cut " +"along the imaginary axis we look at the sign of the real part." +msgstr "" +"برای توابع دارای برش‌های شاخه، مسئله‌ی تصمیم‌گیری درباره‌ی نحوه‌ی تعریف آن توابع " +"روی خود برش وجود دارد. با پیروی از مقاله‌ی Kahan با عنوان «Branch cuts for " +"complex elementary functions»، و همچنین پیوست G از C99 و استانداردهای بعدی " +"C، از علامت صفر برای تمایز یک سمت برش شاخه از سمت دیگر استفاده می‌کنیم: برای " +"برش شاخه در امتداد (بخشی از) محور حقیقی، علامت بخش موهومی را در نظر " +"می‌گیریم، در حالی که برای برش شاخه در امتداد محور موهومی، علامت بخش حقیقی را " +"در نظر می‌گیریم." -msgid "For example, the :func:`cmath.sqrt` function has a branch cut along the negative real axis. An argument of ``-2-0j`` is treated as though it lies *below* the branch cut, and so gives a result on the negative imaginary axis::" +msgid "" +"For example, the :func:`cmath.sqrt` function has a branch cut along the " +"negative real axis. An argument of ``-2-0j`` is treated as though it lies " +"*below* the branch cut, and so gives a result on the negative imaginary " +"axis::" msgstr "" +"برای مثال، تابع :func:`cmath.sqrt` دارای یک برش شاخه‌ای در امتداد محور حقیقی " +"منفی است. با آرگومانی به مقدار ``-2-0j`` به‌گونه‌ای رفتار می‌شود که گویی در " +"*زیر* برش شاخه‌ای قرار دارد، و بنابراین نتیجه‌ای روی محور موهومی منفی می‌دهد::" msgid "" ">>> cmath.sqrt(-2-0j)\n" "-1.4142135623730951j" msgstr "" +">>> cmath.sqrt(-2-0j)\n" +"-1.4142135623730951j" -msgid "But an argument of ``-2+0j`` is treated as though it lies above the branch cut::" +msgid "" +"But an argument of ``-2+0j`` is treated as though it lies above the branch " +"cut::" msgstr "" +"اما آرگومانِ ``-2+0j`` به‌گونه‌ای رفتار می‌شود که گویی در بالای برش شاخه " +"(branch cut) قرار دارد::" msgid "" ">>> cmath.sqrt(-2+0j)\n" "1.4142135623730951j" msgstr "" +">>> cmath.sqrt(-2+0j)\n" +"1.4142135623730951j" msgid "**Conversions to and from polar coordinates**" -msgstr "" +msgstr "تبدیل‌ها به مختصات قطبی و از مختصات قطبی" msgid ":func:`phase(z) `" -msgstr "" +msgstr ":func:`phase(z) `" msgid "Return the phase of *z*" -msgstr "" +msgstr "فاز *z* را برمی‌گرداند" msgid ":func:`polar(z) `" -msgstr "" +msgstr ":func:`polar(z) `" msgid "Return the representation of *z* in polar coordinates" -msgstr "" +msgstr "بازگرداندن نمایش *z* در مختصات قطبی" msgid ":func:`rect(r, phi) `" -msgstr "" +msgstr ":func:`rect(r, phi) `" msgid "Return the complex number *z* with polar coordinates *r* and *phi*" -msgstr "" +msgstr "عدد مختلط *z* را با مختصات قطبی *r* و *phi* برمی‌گرداند" msgid "**Power and logarithmic functions**" -msgstr "" +msgstr "توابع توانی و لگاریتمی" msgid ":func:`exp(z) `" -msgstr "" +msgstr ":func:`exp(z) `" msgid "Return *e* raised to the power *z*" -msgstr "" +msgstr "*e* به توان *z* را برمی‌گرداند" msgid ":func:`log(z[, base]) `" -msgstr "" +msgstr ":func:`log(z[, base]) `" msgid "Return the logarithm of *z* to the given *base* (*e* by default)" -msgstr "" +msgstr "لگاریتم *z* را در مبنای *base* داده‌شده برمی‌گرداند (به‌طور پیش‌فرض *e*)" msgid ":func:`log10(z) `" -msgstr "" +msgstr ":func:`log10(z) `" msgid "Return the base-10 logarithm of *z*" -msgstr "" +msgstr "لگاریتم *z* در مبنای ۱۰ را برمی‌گرداند" msgid ":func:`sqrt(z) `" -msgstr "" +msgstr ":func:`sqrt(z) `" msgid "Return the square root of *z*" -msgstr "" +msgstr "ریشه دوم *z* را برمی‌گرداند" msgid "**Trigonometric functions**" -msgstr "" +msgstr "توابع مثلثاتی" msgid ":func:`acos(z) `" -msgstr "" +msgstr ":func:`acos(z) `" msgid "Return the arc cosine of *z*" -msgstr "" +msgstr "آرک‌کسینوس *z* را برمی‌گرداند" msgid ":func:`asin(z) `" -msgstr "" +msgstr ":func:`asin(z) `" msgid "Return the arc sine of *z*" -msgstr "" +msgstr "برگرداندن سینوس معکوس *z*" msgid ":func:`atan(z) `" -msgstr "" +msgstr ":func:`atan(z) `" msgid "Return the arc tangent of *z*" -msgstr "" +msgstr "تانژانت معکوس *z* را برمی‌گرداند" msgid ":func:`cos(z) `" -msgstr "" +msgstr ":func:`cos(z) `" msgid "Return the cosine of *z*" -msgstr "" +msgstr "کسینوس *z* را برمی‌گرداند" msgid ":func:`sin(z) `" -msgstr "" +msgstr ":func:`sin(z) `" msgid "Return the sine of *z*" -msgstr "" +msgstr "سینوس *z* را برمی‌گرداند" msgid ":func:`tan(z) `" -msgstr "" +msgstr ":func:`tan(z) `" msgid "Return the tangent of *z*" -msgstr "" +msgstr "تانژانت *z* را برمی‌گرداند" msgid "**Hyperbolic functions**" -msgstr "" +msgstr "توابع هذلولی" msgid ":func:`acosh(z) `" -msgstr "" +msgstr ":func:`acosh(z) `" msgid "Return the inverse hyperbolic cosine of *z*" -msgstr "" +msgstr "بازگرداندن کسینوس هیپربولیک معکوس *z*" msgid ":func:`asinh(z) `" -msgstr "" +msgstr ":func:`asinh(z) `" msgid "Return the inverse hyperbolic sine of *z*" -msgstr "" +msgstr "سینوس هذلولی معکوس *z* را برمی‌گرداند" msgid ":func:`atanh(z) `" -msgstr "" +msgstr ":func:`atanh(z) `" msgid "Return the inverse hyperbolic tangent of *z*" -msgstr "" +msgstr "تانژانت هیپربولیک معکوس *z* را برمی‌گرداند" msgid ":func:`cosh(z) `" -msgstr "" +msgstr ":func:`cosh(z) `" msgid "Return the hyperbolic cosine of *z*" -msgstr "" +msgstr "کسینوس هذلولی *z* را برمی‌گرداند" msgid ":func:`sinh(z) `" -msgstr "" +msgstr ":func:`sinh(z) `" msgid "Return the hyperbolic sine of *z*" -msgstr "" +msgstr "سینوس هذلولی *z* را برمی‌گرداند." msgid ":func:`tanh(z) `" -msgstr "" +msgstr ":func:`tanh(z) `" msgid "Return the hyperbolic tangent of *z*" -msgstr "" +msgstr "تانژانت هیپربولیک *z* را برمی‌گرداند" msgid "**Classification functions**" -msgstr "" +msgstr "توابع طبقه‌بندی" msgid ":func:`isfinite(z) `" -msgstr "" +msgstr ":func:`isfinite(z) `" msgid "Check if all components of *z* are finite" -msgstr "" +msgstr "بررسی متناهی بودن همه‌ی کامپوننت‌های *z*" msgid ":func:`isinf(z) `" -msgstr "" +msgstr ":func:`isinf(z) `" msgid "Check if any component of *z* is infinite" -msgstr "" +msgstr "بررسی کنید که آیا هیچ‌یک از کامپوننت‌های *z* بی‌نهایت است یا خیر" msgid ":func:`isnan(z) `" -msgstr "" +msgstr ":func:`isnan(z) `" msgid "Check if any component of *z* is a NaN" -msgstr "" +msgstr "بررسی کنید که آیا یکی از کامپوننت‌های *z* یک NaN است یا خیر" msgid ":func:`isclose(a, b, *, rel_tol, abs_tol) `" -msgstr "" +msgstr ":func:`isclose(a, b, *, rel_tol, abs_tol) `" msgid "Check if the values *a* and *b* are close to each other" -msgstr "" +msgstr "بررسی کنید که آیا مقادیر *a* و *b* به یکدیگر نزدیک هستند" msgid "**Constants**" -msgstr "" +msgstr "ثابت‌ها" msgid ":data:`pi`" -msgstr "" +msgstr ":data:`pi`" msgid "*π* = 3.141592..." -msgstr "" +msgstr "*π* = 3.141592..." msgid ":data:`e`" -msgstr "" +msgstr ":data:`e`" msgid "*e* = 2.718281..." -msgstr "" +msgstr "*e* = 2.718281..." msgid ":data:`tau`" -msgstr "" +msgstr ":data:`tau`" msgid "*τ* = 2\\ *π* = 6.283185..." -msgstr "" +msgstr "*τ* = 2\\ *π* = 6.283185..." msgid ":data:`inf`" -msgstr "" +msgstr ":data:`inf`" msgid "Positive infinity" -msgstr "" +msgstr "بی‌نهایت مثبت" msgid ":data:`infj`" -msgstr "" +msgstr ":data:`infj`" msgid "Pure imaginary infinity" -msgstr "" +msgstr "بی‌نهایت موهومی خالص" msgid ":data:`nan`" -msgstr "" +msgstr ":data:`nan`" msgid "\"Not a number\" (NaN)" -msgstr "" +msgstr "«عدد نامعتبر» (NaN)" msgid ":data:`nanj`" -msgstr "" +msgstr ":data:`nanj`" msgid "Pure imaginary NaN" -msgstr "" +msgstr "NaN موهومی خالص" msgid "Conversions to and from polar coordinates" -msgstr "" +msgstr "تبدیل‌ها به مختصات قطبی و بالعکس" -msgid "A Python complex number ``z`` is stored internally using *rectangular* or *Cartesian* coordinates. It is completely determined by its *real part* ``z.real`` and its *imaginary part* ``z.imag``." +msgid "" +"A Python complex number ``z`` is stored internally using *rectangular* or " +"*Cartesian* coordinates. It is completely determined by its *real part* " +"``z.real`` and its *imaginary part* ``z.imag``." msgstr "" +"یک عدد مختلط در پایتون ``z`` به‌صورت داخلی با استفاده از مختصات *مستطیلی* یا " +"*دکارتی* ذخیره می‌شود. این عدد به‌طور کامل توسط *بخش حقیقی* ``z.real`` و *بخش " +"موهومی* ``z.imag`` آن تعیین می‌شود." -msgid "*Polar coordinates* give an alternative way to represent a complex number. In polar coordinates, a complex number *z* is defined by the modulus *r* and the phase angle *phi*. The modulus *r* is the distance from *z* to the origin, while the phase *phi* is the counterclockwise angle, measured in radians, from the positive x-axis to the line segment that joins the origin to *z*." -msgstr "" +msgid "" +"*Polar coordinates* give an alternative way to represent a complex number. " +"In polar coordinates, a complex number *z* is defined by the modulus *r* " +"and the phase angle *phi*. The modulus *r* is the distance from *z* to the " +"origin, while the phase *phi* is the counterclockwise angle, measured in " +"radians, from the positive x-axis to the line segment that joins the origin " +"to *z*." +msgstr "" +"*مختصات قطبی* روشی جایگزین برای نمایش یک عدد مختلط ارائه می‌دهد. در مختصات " +"قطبی، یک عدد مختلط *z* با اندازه‌ی *r* و زاویه‌ی فاز *phi* تعریف می‌شود. " +"اندازه‌ی *r* فاصله‌ی *z* تا مبدأ است، در حالی که فاز *phi* زاویه‌ای در خلاف " +"جهت عقربه‌های ساعت است که بر حسب رادیان، از محور x مثبت تا پاره‌خطی که مبدأ " +"را به *z* متصل می‌کند، اندازه‌گیری می‌شود." -msgid "The following functions can be used to convert from the native rectangular coordinates to polar coordinates and back." +msgid "" +"The following functions can be used to convert from the native rectangular " +"coordinates to polar coordinates and back." msgstr "" +"می‌توان از توابع زیر برای تبدیل از مختصات مستطیلی ذاتی به مختصات قطبی و " +"بالعکس استفاده کرد." -msgid "Return the phase of *z* (also known as the *argument* of *z*), as a float. ``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result lies in the range [-\\ *π*, *π*], and the branch cut for this operation lies along the negative real axis. The sign of the result is the same as the sign of ``z.imag``, even when ``z.imag`` is zero::" -msgstr "" +msgid "" +"Return the phase of *z* (also known as the *argument* of *z*), as a float. " +"``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result " +"lies in the range [-\\ *π*, *π*], and the branch cut for this operation " +"lies along the negative real axis. The sign of the result is the same as " +"the sign of ``z.imag``, even when ``z.imag`` is zero::" +msgstr "" +"فاز *z* (که همچنین به‌عنوان *آرگومان* *z* نیز شناخته می‌شود) را به‌صورت یک " +"شناور (float) برمی‌گرداند. ``phase(z)`` معادل ``math.atan2(z.imag, z.real)`` " +"است. نتیجه در بازه‌ی [-\\ *π*, *π*] قرار دارد و برش شاخه‌ی این عملیات در امتداد " +"محور حقیقی منفی قرار دارد. علامت نتیجه همان علامت ``z.imag`` است، حتی زمانی " +"که ``z.imag`` صفر باشد::" msgid "" ">>> phase(-1+0j)\n" @@ -268,138 +342,299 @@ msgid "" ">>> phase(-1-0j)\n" "-3.141592653589793" msgstr "" +">>> phase(-1+0j)\n" +"3.141592653589793\n" +">>> phase(-1-0j)\n" +"-3.141592653589793" -msgid "The modulus (absolute value) of a complex number *z* can be computed using the built-in :func:`abs` function. There is no separate :mod:`!cmath` module function for this operation." +msgid "" +"The modulus (absolute value) of a complex number *z* can be computed using " +"the built-in :func:`abs` function. There is no separate :mod:`!cmath` " +"module function for this operation." msgstr "" +"مدول (قدر مطلق) یک عدد مختلط *z* را می‌توان با استفاده از تابع " +"توکار :func:`abs` محاسبه کرد. برای این عملیات، تابع جداگانه‌ای در " +"ماژول :mod:`!cmath` وجود ندارد." -msgid "Return the representation of *z* in polar coordinates. Returns a pair ``(r, phi)`` where *r* is the modulus of *z* and *phi* is the phase of *z*. ``polar(z)`` is equivalent to ``(abs(z), phase(z))``." +msgid "" +"Return the representation of *z* in polar coordinates. Returns a pair " +"``(r, phi)`` where *r* is the modulus of *z* and *phi* is the phase of " +"*z*. ``polar(z)`` is equivalent to ``(abs(z), phase(z))``." msgstr "" +"بازگرداندن نمایش *z* در مختصات قطبی. یک جفت ``(r, phi)`` برمی‌گرداند که در " +"آن *r* اندازه‌ی *z* و *phi* فاز *z* است. ``polar(z)`` معادل ``(abs(z), " +"phase(z))`` است." -msgid "Return the complex number *z* with polar coordinates *r* and *phi*. Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." +msgid "" +"Return the complex number *z* with polar coordinates *r* and *phi*. " +"Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." msgstr "" +"عدد مختلط *z* با مختصات قطبی *r* و *phi* را برمی‌گرداند. معادل ``complex(r * " +"math.cos(phi), r * math.sin(phi))`` است." msgid "Power and logarithmic functions" -msgstr "" +msgstr "توابع توانی و لگاریتمی" -msgid "Return *e* raised to the power *z*, where *e* is the base of natural logarithms." -msgstr "" +msgid "" +"Return *e* raised to the power *z*, where *e* is the base of natural " +"logarithms." +msgstr "مقدار *e* به توان *z* را برمی‌گرداند، که *e* پایه‌ی لگاریتم طبیعی است." -msgid "Return the logarithm of *z* to the given *base*. If the *base* is not specified, returns the natural logarithm of *z*. There is one branch cut, from 0 along the negative real axis to -∞." +msgid "" +"Return the logarithm of *z* to the given *base*. If the *base* is not " +"specified, returns the natural logarithm of *z*. There is one branch cut, " +"from 0 along the negative real axis to -∞." msgstr "" +"لگاریتم *z* را در *base* داده‌شده برمی‌گرداند. اگر *base* مشخص نشده باشد، " +"لگاریتم طبیعی *z* را برمی‌گرداند. یک برش شاخه (branch cut) از ۰ در امتداد " +"محور حقیقی منفی تا -∞ وجود دارد." -msgid "Return the base-10 logarithm of *z*. This has the same branch cut as :func:`log`." +msgid "" +"Return the base-10 logarithm of *z*. This has the same branch cut " +"as :func:`log`." msgstr "" +"لگاریتم *z* در مبنای ۱۰ را برمی‌گرداند. این تابع همان برش شاخه‌ی :func:`log` " +"را دارد." -msgid "Return the square root of *z*. This has the same branch cut as :func:`log`." +msgid "" +"Return the square root of *z*. This has the same branch cut as :func:`log`." msgstr "" +"ریشه دوم *z* را برمی‌گرداند. این تابع همان برش شاخه‌ی :func:`log` را دارد." msgid "Trigonometric functions" -msgstr "" +msgstr "توابع مثلثاتی" -msgid "Return the arc cosine of *z*. There are two branch cuts: One extends right from 1 along the real axis to ∞. The other extends left from -1 along the real axis to -∞." +msgid "" +"Return the arc cosine of *z*. There are two branch cuts: One extends right " +"from 1 along the real axis to ∞. The other extends left from -1 along the " +"real axis to -∞." msgstr "" +"آرک‌کسینوس *z* را برمی‌گرداند. دو برش شاخه وجود دارد: یکی از ۱ به سمت راست در " +"امتداد محور حقیقی تا ∞ ادامه دارد. دیگری از -۱ به سمت چپ در امتداد محور " +"حقیقی تا -∞ ادامه دارد." -msgid "Return the arc sine of *z*. This has the same branch cuts as :func:`acos`." +msgid "" +"Return the arc sine of *z*. This has the same branch cuts as :func:`acos`." msgstr "" +"آرک‌سینوس *z* را برمی‌گرداند. این همان برش‌های شاخه‌ای :func:`acos` را دارد." -msgid "Return the arc tangent of *z*. There are two branch cuts: One extends from ``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` along the imaginary axis to ``-∞j``." +msgid "" +"Return the arc tangent of *z*. There are two branch cuts: One extends from " +"``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " +"along the imaginary axis to ``-∞j``." msgstr "" +"آرک‌تانژانت *z* را برمی‌گرداند. دو برش شاخه وجود دارد: یکی از ``1j`` در " +"امتداد محور موهومی تا ``∞j`` ادامه دارد. دیگری از ``-1j`` در امتداد محور " +"موهومی تا ``-∞j`` ادامه دارد." msgid "Return the cosine of *z*." -msgstr "" +msgstr "کسینوس *z* را برمی‌گرداند." msgid "Return the sine of *z*." -msgstr "" +msgstr "سینوس *z* را برمی‌گرداند." msgid "Return the tangent of *z*." -msgstr "" +msgstr "تانژانت *z* را برمی‌گرداند." msgid "Hyperbolic functions" -msgstr "" +msgstr "توابع هذلولی" -msgid "Return the inverse hyperbolic cosine of *z*. There is one branch cut, extending left from 1 along the real axis to -∞." +msgid "" +"Return the inverse hyperbolic cosine of *z*. There is one branch cut, " +"extending left from 1 along the real axis to -∞." msgstr "" +"کسینوس هیپربولیک معکوس *z* را برمی‌گرداند. یک برش شاخه وجود دارد که از ۱ به " +"سمت چپ در امتداد محور حقیقی تا -∞ ادامه دارد." -msgid "Return the inverse hyperbolic sine of *z*. There are two branch cuts: One extends from ``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` along the imaginary axis to ``-∞j``." +msgid "" +"Return the inverse hyperbolic sine of *z*. There are two branch cuts: One " +"extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " +"from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" +"سینوس هذلولی معکوس *z* را برمی‌گرداند. دو برش شاخه وجود دارد: یکی از ``1j`` " +"در امتداد محور موهومی تا ``∞j`` کشیده شده است. دیگری از ``-1j`` در امتداد " +"محور موهومی تا ``-∞j`` کشیده شده است." -msgid "Return the inverse hyperbolic tangent of *z*. There are two branch cuts: One extends from ``1`` along the real axis to ``∞``. The other extends from ``-1`` along the real axis to ``-∞``." +msgid "" +"Return the inverse hyperbolic tangent of *z*. There are two branch cuts: " +"One extends from ``1`` along the real axis to ``∞``. The other extends from " +"``-1`` along the real axis to ``-∞``." msgstr "" +"تانژانت هیپربولیک معکوس *z* را بازمی‌گرداند. دو برش شاخه وجود دارد: یکی از " +"``1`` در امتداد محور حقیقی تا ``∞`` ادامه دارد. دیگری از ``-1`` در امتداد " +"محور حقیقی تا ``-∞`` ادامه دارد." msgid "Return the hyperbolic cosine of *z*." -msgstr "" +msgstr "کسینوس هذلولی *z* را برمی‌گرداند." msgid "Return the hyperbolic sine of *z*." -msgstr "" +msgstr "سینوس هذلولی *z* را برمی‌گرداند." msgid "Return the hyperbolic tangent of *z*." -msgstr "" +msgstr "تانژانت هذلولی *z* را برمی‌گرداند." msgid "Classification functions" -msgstr "" +msgstr "توابع طبقه‌بندی" -msgid "Return ``True`` if both the real and imaginary parts of *z* are finite, and ``False`` otherwise." +msgid "" +"Return ``True`` if both the real and imaginary parts of *z* are finite, and " +"``False`` otherwise." msgstr "" +"اگر هر دو بخش حقیقی و موهومی *z* متناهی باشند، ``True`` و در غیر این صورت " +"``False`` را برمی‌گرداند." -msgid "Return ``True`` if either the real or the imaginary part of *z* is an infinity, and ``False`` otherwise." +msgid "" +"Return ``True`` if either the real or the imaginary part of *z* is an " +"infinity, and ``False`` otherwise." msgstr "" +"اگر بخش حقیقی یا موهومی *z* بی‌نهایت باشد، ``True`` را برمی‌گرداند و در غیر " +"این صورت ``False`` را برمی‌گرداند." -msgid "Return ``True`` if either the real or the imaginary part of *z* is a NaN, and ``False`` otherwise." +msgid "" +"Return ``True`` if either the real or the imaginary part of *z* is a NaN, " +"and ``False`` otherwise." msgstr "" +"اگر بخش حقیقی یا موهومی *z* برابر با NaN باشد، ``True`` و در غیر این صورت " +"``False`` برمی‌گرداند." -msgid "Return ``True`` if the values *a* and *b* are close to each other and ``False`` otherwise." +msgid "" +"Return ``True`` if the values *a* and *b* are close to each other and " +"``False`` otherwise." msgstr "" +"اگر مقادیر *a* و *b* به یکدیگر نزدیک باشند، ``True`` و در غیر این صورت " +"``False`` برمی‌گرداند." -msgid "Whether or not two values are considered close is determined according to given absolute and relative tolerances. If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." +msgid "" +"Whether or not two values are considered close is determined according to " +"given absolute and relative tolerances. If no errors occur, the result " +"will be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "" +"نزدیک بودن یا نبودن دو مقدار بر اساس تحمل‌های مطلق و نسبی داده‌شده تعیین " +"می‌شود. اگر هیچ خطایی رخ ندهد، نتیجه به‌صورت زیر خواهد بود: ``abs(a-b) <= " +"max(rel_tol * max(abs(a), abs(b)), abs_tol)``." -msgid "*rel_tol* is the relative tolerance -- it is the maximum allowed difference between *a* and *b*, relative to the larger absolute value of *a* or *b*. For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default tolerance is ``1e-09``, which assures that the two values are the same within about 9 decimal digits. *rel_tol* must be nonnegative and less than ``1.0``." -msgstr "" +msgid "" +"*rel_tol* is the relative tolerance -- it is the maximum allowed difference " +"between *a* and *b*, relative to the larger absolute value of *a* or *b*. " +"For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default " +"tolerance is ``1e-09``, which assures that the two values are the same " +"within about 9 decimal digits. *rel_tol* must be nonnegative and less than " +"``1.0``." +msgstr "" +"*rel_tol* مدارای نسبی است — این مقدار حداکثر اختلاف مجاز بین *a* و *b*، " +"نسبت به قدر مطلق بزرگ‌تر بین *a* و *b* است. برای مثال، برای تنظیم مدارای ۵٪، " +"مقدار ``rel_tol=0.05`` را ارسال کنید. مدارای پیش‌فرض ``1e-09`` است، که تضمین " +"می‌کند دو مقدار تا حدود ۹ رقم اعشاری یکسان باشند. *rel_tol* باید غیرمنفی و " +"کمتر از ``1.0`` باشد." -msgid "*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument to the call." -msgstr "" +msgid "" +"*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " +"nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is " +"computed as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any " +"``x`` and rel_tol less than ``1.0``. So add an appropriate positive " +"abs_tol argument to the call." +msgstr "" +"*abs_tol* تحمل مطلق است؛ پیش‌فرض آن ``0.0`` است و باید غیرمنفی باشد. هنگامی " +"که ``x`` را با ``0.0`` مقایسه می‌کنید، ``isclose(x, 0)`` به‌صورت ``abs(x) <= " +"rel_tol * abs(x)`` محاسبه می‌شود، که برای هر ``x`` و rel_tol کمتر از " +"``1.0``، ``False`` است. بنابراین آرگومان abs_tol مثبت مناسبی به فراخوانی " +"اضافه کنید." -msgid "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be handled according to IEEE rules. Specifically, ``NaN`` is not considered close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only considered close to themselves." +msgid "" +"The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " +"handled according to IEEE rules. Specifically, ``NaN`` is not considered " +"close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only " +"considered close to themselves." msgstr "" +"مقادیر ویژه‌ی IEEE 754 یعنی ``NaN``، ``inf`` و ``-inf`` طبق قوانین IEEE " +"مدیریت می‌شوند. به‌طور مشخص، ``NaN`` نزدیک به هیچ مقدار دیگری، از جمله " +"``NaN``، در نظر گرفته نمی‌شود. ``inf`` و ``-inf`` تنها به خودشان نزدیک در " +"نظر گرفته می‌شوند." msgid ":pep:`485` -- A function for testing approximate equality" -msgstr "" +msgstr ":pep:`485` -- تابعی برای آزمون برابری تقریبی" msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" msgid "The mathematical constant *π*, as a float." -msgstr "" +msgstr "ثابت ریاضی *π*، به‌عنوان یک عدد اعشاری (float)." msgid "The mathematical constant *e*, as a float." -msgstr "" +msgstr "ثابت ریاضی *e*، به‌عنوان یک float." msgid "The mathematical constant *τ*, as a float." -msgstr "" +msgstr "ثابت ریاضی *τ*، به‌صورت یک عدد اعشاری." msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." -msgstr "" +msgstr "بی‌نهایت مثبت از نوع ممیز شناور. معادل ``float('inf')``." -msgid "Complex number with zero real part and positive infinity imaginary part. Equivalent to ``complex(0.0, float('inf'))``." +msgid "" +"Complex number with zero real part and positive infinity imaginary part. " +"Equivalent to ``complex(0.0, float('inf'))``." msgstr "" +"عدد مختلط با بخش حقیقی صفر و بخش موهومی بی‌نهایت مثبت. معادل ``complex(0.0, " +"float('inf'))``." -msgid "A floating-point \"not a number\" (NaN) value. Equivalent to ``float('nan')``. See also :data:`math.nan`." +msgid "" +"A floating-point \"not a number\" (NaN) value. Equivalent to " +"``float('nan')``. See also :data:`math.nan`." msgstr "" +"یک مقدار ممیز شناور «نه یک عدد» (NaN). معادل ``float('nan')``. " +"همچنین :data:`math.nan` را ببینید." -msgid "Complex number with zero real part and NaN imaginary part. Equivalent to ``complex(0.0, float('nan'))``." +msgid "" +"Complex number with zero real part and NaN imaginary part. Equivalent to " +"``complex(0.0, float('nan'))``." msgstr "" +"عدد مختلط با بخش حقیقی صفر و بخش موهومی NaN. معادل با ``complex(0.0, " +"float('nan'))``." -msgid "Note that the selection of functions is similar, but not identical, to that in module :mod:`math`. The reason for having two modules is that some users aren't interested in complex numbers, and perhaps don't even know what they are. They would rather have ``math.sqrt(-1)`` raise an exception than return a complex number. Also note that the functions defined in :mod:`!cmath` always return a complex number, even if the answer can be expressed as a real number (in which case the complex number has an imaginary part of zero)." -msgstr "" +msgid "" +"Note that the selection of functions is similar, but not identical, to that " +"in module :mod:`math`. The reason for having two modules is that some " +"users aren't interested in complex numbers, and perhaps don't even know " +"what they are. They would rather have ``math.sqrt(-1)`` raise an exception " +"than return a complex number. Also note that the functions defined " +"in :mod:`!cmath` always return a complex number, even if the answer can be " +"expressed as a real number (in which case the complex number has an " +"imaginary part of zero)." +msgstr "" +"توجه داشته باشید که انتخاب توابع مشابه، اما نه یکسان، با انتخاب توابع در " +"ماژول :mod:`math` است. دلیل وجود دو ماژول این است که برخی کاربران علاقه‌ای " +"به اعداد مختلط ندارند، و شاید حتی ندانند این اعداد چه هستند. آن‌ها ترجیح " +"می‌دهند ``math.sqrt(-1)`` به‌جای برگرداندن یک عدد مختلط، یک استثنا پرتاب کند. " +"همچنین توجه داشته باشید که توابع تعریف‌شده در :mod:`!cmath` همیشه یک عدد " +"مختلط برمی‌گردانند، حتی اگر پاسخ بتواند به‌صورت یک عدد حقیقی بیان شود (در این " +"حالت عدد مختلط دارای بخش موهومی صفر است)." -msgid "A note on branch cuts: They are curves along which the given function fails to be continuous. They are a necessary feature of many complex functions. It is assumed that if you need to compute with complex functions, you will understand about branch cuts. Consult almost any (not too elementary) book on complex variables for enlightenment. For information of the proper choice of branch cuts for numerical purposes, a good reference should be the following:" -msgstr "" +msgid "" +"A note on branch cuts: They are curves along which the given function fails " +"to be continuous. They are a necessary feature of many complex functions. " +"It is assumed that if you need to compute with complex functions, you will " +"understand about branch cuts. Consult almost any (not too elementary) book " +"on complex variables for enlightenment. For information of the proper " +"choice of branch cuts for numerical purposes, a good reference should be " +"the following:" +msgstr "" +"نکته‌ای درباره‌ی برش‌های شاخه (branch cuts): این‌ها منحنی‌هایی هستند که تابع " +"داده‌شده در امتداد آن‌ها پیوسته نیست. آن‌ها ویژگی ضروری بسیاری از توابع مختلط " +"هستند. فرض بر این است که اگر نیاز به محاسبه با توابع مختلط دارید، درباره‌ی " +"برش‌های شاخه آگاه خواهید بود. برای روشن شدن موضوع، تقریباً به هر کتابی (نه " +"خیلی مقدماتی) درباره‌ی متغیرهای مختلط مراجعه کنید. برای اطلاع از انتخاب " +"مناسب برش‌های شاخه برای اهداف عددی، یک مرجع خوب باید مورد زیر باشد:" -msgid "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the art in numerical analysis. Clarendon Press (1987) pp165--211." +msgid "" +"Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " +"nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of " +"the art in numerical analysis. Clarendon Press (1987) pp165--211." msgstr "" +"Kahan، W: برش‌های شاخه برای توابع مقدماتی مختلط؛ یا هیاهوی بسیار درباره‌ی بیت " +"علامت هیچ. در Iserles، A.، و Powell، M. (ویراستاران)، وضعیت هنر در تحلیل " +"عددی. Clarendon Press (۱۹۸۷) صص ۱۶۵--۲۱۱." msgid "module" -msgstr "" +msgstr "ماژول" msgid "math" -msgstr "" +msgstr "math" diff --git a/library/cmd.po b/library/cmd.po index 3b29002fe..151c27bc6 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -22,136 +22,392 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!cmd` --- Support for line-oriented command interpreters" -msgstr "" +msgstr ":mod:`!cmd` --- پشتیبانی از مفسرهای فرمان خط‌محور" msgid "**Source code:** :source:`Lib/cmd.py`" -msgstr "" +msgstr ":source:`Lib/cmd.py`" -msgid "The :class:`Cmd` class provides a simple framework for writing line-oriented command interpreters. These are often useful for test harnesses, administrative tools, and prototypes that will later be wrapped in a more sophisticated interface." +msgid "" +"The :class:`Cmd` class provides a simple framework for writing line-oriented" +" command interpreters. These are often useful for test harnesses, " +"administrative tools, and prototypes that will later be wrapped in a more " +"sophisticated interface." msgstr "" +"کلاس :class:`Cmd` یک چارچوب ساده برای نوشتن مفسرهای فرمان خط‌محور فراهم " +"می‌کند. این مفسرها اغلب برای مهارهای آزمون، ابزارهای مدیریتی و پیش‌نمونه‌هایی " +"مفید هستند که بعداً در یک رابط پیشرفته‌تر قرار خواهند گرفت." -msgid "A :class:`Cmd` instance or subclass instance is a line-oriented interpreter framework. There is no good reason to instantiate :class:`Cmd` itself; rather, it's useful as a superclass of an interpreter class you define yourself in order to inherit :class:`Cmd`'s methods and encapsulate action methods." +msgid "" +"A :class:`Cmd` instance or subclass instance is a line-oriented interpreter " +"framework. There is no good reason to instantiate :class:`Cmd` itself; " +"rather, it's useful as a superclass of an interpreter class you define " +"yourself in order to inherit :class:`Cmd`'s methods and encapsulate action " +"methods." msgstr "" +"یک نمونه از :class:`Cmd` یا نمونه‌ای از یک زیرکلاس، یک چارچوب مفسر خط‌محور " +"است. دلیل موجهی برای نمونه‌سازی خود :class:`Cmd` وجود ندارد؛ در عوض، این " +"کلاس به‌عنوان ابرکلاسِ کلاس مفسری که خودتان تعریف می‌کنید مفید است، تا " +"متدهای :class:`Cmd` را به ارث ببرید و متدهای عملیاتی را کپسوله کنید." -msgid "The optional argument *completekey* is the :mod:`readline` name of a completion key; it defaults to :kbd:`Tab`. If *completekey* is not :const:`None` and :mod:`readline` is available, command completion is done automatically." +msgid "" +"The optional argument *completekey* is the :mod:`readline` name of a " +"completion key; it defaults to :kbd:`Tab`. If *completekey* is not " +":const:`None` and :mod:`readline` is available, command completion is done " +"automatically." msgstr "" +"آرگومان اختیاری *completekey* نام کلید تکمیل در :mod:`readline` است؛ پیش‌فرض" +" آن :kbd:`Tab` است. اگر *completekey* برابر :const:`None` نباشد و " +":mod:`readline` در دسترس باشد، تکمیل فرمان به‌طور خودکار انجام می‌شود." -msgid "The default, ``'tab'``, is treated specially, so that it refers to the :kbd:`Tab` key on every :data:`readline.backend`. Specifically, if :data:`readline.backend` is ``editline``, ``Cmd`` will use ``'^I'`` instead of ``'tab'``. Note that other values are not treated this way, and might only work with a specific backend." -msgstr "" +msgid "" +"The default, ``'tab'``, is treated specially, so that it refers to the " +":kbd:`Tab` key on every :data:`readline.backend`. Specifically, if " +":data:`readline.backend` is ``editline``, ``Cmd`` will use ``'^I'`` instead " +"of ``'tab'``. Note that other values are not treated this way, and might " +"only work with a specific backend." +msgstr "" +"مقدار پیش‌فرض، ``'tab'``، به‌طور ویژه‌ای رفتار می‌شود، به‌طوری‌که به کلید " +":kbd:`Tab` در هر :data:`readline.backend` اشاره می‌کند. به‌طور مشخص، اگر " +":data:`readline.backend` برابر ``editline`` باشد، ``Cmd`` به‌جای ``'tab'`` " +"از ``'^I'`` استفاده می‌کند. توجه داشته باشید که سایر مقادیر این‌گونه رفتار " +"نمی‌شوند و ممکن است فقط با یک پشتیبان خاص کار کنند." -msgid "The optional arguments *stdin* and *stdout* specify the input and output file objects that the Cmd instance or subclass instance will use for input and output. If not specified, they will default to :data:`sys.stdin` and :data:`sys.stdout`." +msgid "" +"The optional arguments *stdin* and *stdout* specify the input and output " +"file objects that the Cmd instance or subclass instance will use for input " +"and output. If not specified, they will default to :data:`sys.stdin` and " +":data:`sys.stdout`." msgstr "" +"آرگومان‌های اختیاری *stdin* و *stdout* اشیای فایل ورودی و خروجی را مشخص " +"می‌کنند که نمونه Cmd یا نمونه زیرکلاس برای ورودی و خروجی از آن‌ها استفاده " +"خواهد کرد. اگر مشخص نشده باشند، مقادیر پیش‌فرض آن‌ها :data:`sys.stdin` و " +":data:`sys.stdout` خواهند بود." -msgid "If you want a given *stdin* to be used, make sure to set the instance's :attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be ignored." +msgid "" +"If you want a given *stdin* to be used, make sure to set the instance's " +":attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be " +"ignored." msgstr "" +"اگر می‌خواهید از یک *stdin* داده‌شده استفاده شود، حتماً ویژگی " +":attr:`use_rawinput` نمونه را روی ``False`` تنظیم کنید، در غیر این صورت از " +"*stdin* صرف‌نظر می‌شود." msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." -msgstr "" +msgstr "``completekey='tab'`` برای ``editline`` با ``'^I'`` جایگزین می‌شود." msgid "Cmd Objects" -msgstr "" +msgstr "اشیای Cmd" msgid "A :class:`Cmd` instance has the following methods:" -msgstr "" +msgstr "نمونه‌ای از :class:`Cmd` دارای متدهای زیر است:" -msgid "Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument." +msgid "" +"Repeatedly issue a prompt, accept input, parse an initial prefix off the " +"received input, and dispatch to action methods, passing them the remainder " +"of the line as argument." msgstr "" +"به‌طور مکرر یک اعلان صادر می‌کند، ورودی را می‌پذیرد، یک پیشوند آغازین را از " +"ورودی دریافت‌شده تجزیه می‌کند و متدهای عملیاتی را فراخوانی می‌کند و " +"باقی‌مانده‌ی خط را به‌عنوان آرگومان به آن‌ها می‌فرستد." -msgid "The optional argument is a banner or intro string to be issued before the first prompt (this overrides the :attr:`intro` class attribute)." +msgid "" +"The optional argument is a banner or intro string to be issued before the " +"first prompt (this overrides the :attr:`intro` class attribute)." msgstr "" +"آرگومان اختیاری یک رشته بنر یا مقدمه است که پیش از اولین اعلان نمایش داده " +"می‌شود (این مورد، ویژگی کلاس :attr:`intro` را نادیده می‌گیرد)." -msgid "If the :mod:`readline` module is loaded, input will automatically inherit :program:`bash`\\ -like history-list editing (e.g. :kbd:`Control-P` scrolls back to the last command, :kbd:`Control-N` forward to the next one, :kbd:`Control-F` moves the cursor to the right non-destructively, :kbd:`Control-B` moves the cursor to the left non-destructively, etc.)." -msgstr "" +msgid "" +"If the :mod:`readline` module is loaded, input will automatically inherit " +":program:`bash`\\ -like history-list editing (e.g. :kbd:`Control-P` scrolls " +"back to the last command, :kbd:`Control-N` forward to the next one, " +":kbd:`Control-F` moves the cursor to the right non-destructively, " +":kbd:`Control-B` moves the cursor to the left non-destructively, etc.)." +msgstr "" +"اگر ماژول :mod:`readline` بارگذاری شده باشد، ورودی به‌طور خودکار ویرایش " +"فهرست تاریخچه‌ی مشابه :program:`bash` را به ارث می‌برد (برای مثال " +":kbd:`Control-P` به آخرین فرمان بازمی‌گردد، :kbd:`Control-N` به فرمان بعدی " +"می‌رود، :kbd:`Control-F` مکان‌نما را به سمت راست به‌صورت غیرمخرب حرکت " +"می‌دهد، :kbd:`Control-B` مکان‌نما را به سمت چپ به‌صورت غیرمخرب حرکت می‌دهد، " +"و غیره)." msgid "An end-of-file on input is passed back as the string ``'EOF'``." -msgstr "" +msgstr "پایان پرونده در ورودی به‌عنوان رشته ``'EOF'`` برگردانده می‌شود." -msgid "An interpreter instance will recognize a command name ``foo`` if and only if it has a method :meth:`!do_foo`. As a special case, a line beginning with the character ``'?'`` is dispatched to the method :meth:`do_help`. As another special case, a line beginning with the character ``'!'`` is dispatched to the method :meth:`!do_shell` (if such a method is defined)." -msgstr "" +msgid "" +"An interpreter instance will recognize a command name ``foo`` if and only if" +" it has a method :meth:`!do_foo`. As a special case, a line beginning with " +"the character ``'?'`` is dispatched to the method :meth:`do_help`. As " +"another special case, a line beginning with the character ``'!'`` is " +"dispatched to the method :meth:`!do_shell` (if such a method is defined)." +msgstr "" +"نمونه‌ای از مفسر، نام فرمان ``foo`` را اگر و تنها اگر متد :meth:`!do_foo` را" +" داشته باشد، می‌شناسد. در حالتی خاص، خطی که با نویسه ``'?'`` آغاز می‌شود، به" +" متد :meth:`do_help` ارجاع داده می‌شود. در حالت خاص دیگر، خطی که با نویسه " +"``'!'`` آغاز می‌شود، به متد :meth:`!do_shell` ارجاع داده می‌شود (اگر چنین " +"متدی تعریف شده باشد)." -msgid "This method will return when the :meth:`postcmd` method returns a true value. The *stop* argument to :meth:`postcmd` is the return value from the command's corresponding :meth:`!do_\\*` method." +msgid "" +"This method will return when the :meth:`postcmd` method returns a true " +"value. The *stop* argument to :meth:`postcmd` is the return value from the " +"command's corresponding :meth:`!do_\\*` method." msgstr "" +"این متد زمانی برمی‌گردد که متد :meth:`postcmd` مقدار درستی را برگرداند. " +"آرگومان *stop* برای :meth:`postcmd`، مقدار بازگشتی از متد :meth:`!do_\\*` " +"متناظر با فرمان است." -msgid "If completion is enabled, completing commands will be done automatically, and completing of commands args is done by calling :meth:`!complete_foo` with arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string prefix we are attempting to match: all returned matches must begin with it. *line* is the current input line with leading whitespace removed, *begidx* and *endidx* are the beginning and ending indexes of the prefix text, which could be used to provide different completion depending upon which position the argument is in." -msgstr "" +msgid "" +"If completion is enabled, completing commands will be done automatically, " +"and completing of commands args is done by calling :meth:`!complete_foo` " +"with arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string" +" prefix we are attempting to match: all returned matches must begin with it." +" *line* is the current input line with leading whitespace removed, *begidx* " +"and *endidx* are the beginning and ending indexes of the prefix text, which " +"could be used to provide different completion depending upon which position " +"the argument is in." +msgstr "" +"اگر تکمیل فعال باشد، تکمیل دستورها به‌صورت خودکار انجام می‌شود و تکمیل " +"آرگومان‌های دستورها با فراخوانی :meth:`!complete_foo` با آرگومان‌های *text*،" +" *line*، *begidx* و *endidx* انجام می‌شود. *text* پیشوند رشته‌ای است که سعی " +"در تطبیق آن داریم: همه موارد منطبق برگردانده‌شده باید با آن آغاز شوند. " +"*line* خط ورودی جاری با حذف فضای سفید ابتدایی است، *begidx* و *endidx* " +"اندیس‌های آغاز و پایان متن پیشوند هستند که می‌توان از آن‌ها برای ارائه تکمیل" +" متفاوت بسته به موقعیت آرگومان استفاده کرد." -msgid "All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This method, called with an argument ``'bar'``, invokes the corresponding method :meth:`!help_bar`, and if that is not present, prints the docstring of :meth:`!do_bar`, if available. With no argument, :meth:`!do_help` lists all available help topics (that is, all commands with corresponding :meth:`!help_\\*` methods or commands that have docstrings), and also lists any undocumented commands." -msgstr "" +msgid "" +"All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " +"method, called with an argument ``'bar'``, invokes the corresponding method " +":meth:`!help_bar`, and if that is not present, prints the docstring of " +":meth:`!do_bar`, if available. With no argument, :meth:`!do_help` lists all" +" available help topics (that is, all commands with corresponding " +":meth:`!help_\\*` methods or commands that have docstrings), and also lists " +"any undocumented commands." +msgstr "" +"همه‌ی زیرکلاس‌های :class:`Cmd` یک متد :meth:`!do_help` از پیش تعریف‌شده را " +"به ارث می‌برند. وقتی این متد با آرگومان ``'bar'`` فراخوانی شود، متد متناظر " +":meth:`!help_bar` را فراخوانی می‌کند، و اگر آن متد موجود نباشد، رشته مستند" +" مربوط به :meth:`!do_bar` را در صورت موجود بودن چاپ می‌کند. بدون" +" آرگومان، :meth:`!do_help` همه‌ی موضوعات راهنمای در دسترس را فهرست می‌کند " +"(یعنی همه‌ی فرمان‌هایی که متدهای متناظر :meth:`!help_\\*` دارند یا " +"فرمان‌هایی که رشته مستندات دارند)، و همچنین فرمان‌های بدون مستند را نیز " +"فهرست می‌کند." -msgid "Interpret the argument as though it had been typed in response to the prompt. This may be overridden, but should not normally need to be; see the :meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The return value is a flag indicating whether interpretation of commands by the interpreter should stop. If there is a :meth:`!do_\\*` method for the command *str*, the return value of that method is returned, otherwise the return value from the :meth:`default` method is returned." -msgstr "" +msgid "" +"Interpret the argument as though it had been typed in response to the " +"prompt. This may be overridden, but should not normally need to be; see the " +":meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The " +"return value is a flag indicating whether interpretation of commands by the " +"interpreter should stop. If there is a :meth:`!do_\\*` method for the " +"command *str*, the return value of that method is returned, otherwise the " +"return value from the :meth:`default` method is returned." +msgstr "" +"آرگومان را چنان تفسیر می‌کند که گویی در پاسخ به اعلان تایپ شده است. این را " +"می‌توان بازنویسی کرد، اما معمولاً نیازی به این کار نیست؛ برای قلاب‌های اجرای" +" مفید، متدهای :meth:`precmd` و :meth:`postcmd` را ببینید. مقدار بازگشتی، " +"پرچمی است که نشان می‌دهد آیا تفسیر دستورات توسط مفسر باید متوقف شود یا خیر. " +"اگر برای دستور *str* یک متد :meth:`!do_\\*` وجود داشته باشد، مقدار بازگشتی " +"آن متد برگردانده می‌شود، در غیر این صورت مقدار بازگشتی از متد " +":meth:`default` برگردانده می‌شود." -msgid "Method called when an empty line is entered in response to the prompt. If this method is not overridden, it repeats the last nonempty command entered." +msgid "" +"Method called when an empty line is entered in response to the prompt. If " +"this method is not overridden, it repeats the last nonempty command entered." msgstr "" +"متدی که هنگام وارد شدن یک خط خالی در پاسخ به اعلان فراخوانی می‌شود. اگر این " +"متد بازنویسی نشده باشد، آخرین فرمان غیرخالی واردشده را تکرار می‌کند." -msgid "Method called on an input line when the command prefix is not recognized. If this method is not overridden, it prints an error message and returns." +msgid "" +"Method called on an input line when the command prefix is not recognized. If" +" this method is not overridden, it prints an error message and returns." msgstr "" +"متدی که وقتی پیشوند فرمان شناسایی نشود، بر روی یک خط ورودی فراخوانی می‌شود. " +"اگر این متد بازنویسی نشود، یک پیام خطا چاپ می‌کند و بازمی‌گردد." -msgid "Method called to complete an input line when no command-specific :meth:`!complete_\\*` method is available. By default, it returns an empty list." +msgid "" +"Method called to complete an input line when no command-specific " +":meth:`!complete_\\*` method is available. By default, it returns an empty " +"list." msgstr "" +"متدی که برای تکمیل یک خط ورودی فراخوانی می‌شود، هنگامی که هیچ متد مخصوص " +"دستور :meth:`!complete_\\*` در دسترس نباشد. به‌طور پیش‌فرض، یک فهرست خالی " +"برمی‌گرداند." -msgid "Method called to display a list of strings as a compact set of columns. Each column is only as wide as necessary. Columns are separated by two spaces for readability." +msgid "" +"Method called to display a list of strings as a compact set of columns. Each" +" column is only as wide as necessary. Columns are separated by two spaces " +"for readability." msgstr "" +"متدی که فراخوانی می‌شود تا فهرستی از رشته‌ها را به‌صورت مجموعه‌ای فشرده از " +"ستون‌ها نمایش دهد. هر ستون تنها به اندازه‌ی ضرورت عرض دارد. ستون‌ها برای " +"خوانایی با دو فاصله از هم جدا می‌شوند." -msgid "Hook method executed just before the command line *line* is interpreted, but after the input prompt is generated and issued. This method is a stub in :class:`Cmd`; it exists to be overridden by subclasses. The return value is used as the command which will be executed by the :meth:`onecmd` method; the :meth:`precmd` implementation may re-write the command or simply return *line* unchanged." -msgstr "" +msgid "" +"Hook method executed just before the command line *line* is interpreted, but" +" after the input prompt is generated and issued. This method is a stub in " +":class:`Cmd`; it exists to be overridden by subclasses. The return value is" +" used as the command which will be executed by the :meth:`onecmd` method; " +"the :meth:`precmd` implementation may re-write the command or simply return " +"*line* unchanged." +msgstr "" +"متد قلابکه درست پیش از تفسیر خط فرمان *line*، اما پس از تولید و صدور" +" اعلان ورودی اجرا می‌شود. این متد در :class:`Cmd` یک stub (stub) است؛ " +"وجود دارد تا در زیرکلاس‌ها بازنویسی شود. مقدار بازگشتی به‌عنوان فرمانی " +"استفاده می‌شود که متد :meth:`onecmd` آن را اجرا خواهد کرد؛ پیاده‌سازی " +":meth:`precmd` ممکن است فرمان را بازنویسی کند یا صرفاً *line* را بدون تغییر " +"بازگرداند." -msgid "Hook method executed just after a command dispatch is finished. This method is a stub in :class:`Cmd`; it exists to be overridden by subclasses. *line* is the command line which was executed, and *stop* is a flag which indicates whether execution will be terminated after the call to :meth:`postcmd`; this will be the return value of the :meth:`onecmd` method. The return value of this method will be used as the new value for the internal flag which corresponds to *stop*; returning false will cause interpretation to continue." -msgstr "" +msgid "" +"Hook method executed just after a command dispatch is finished. This method" +" is a stub in :class:`Cmd`; it exists to be overridden by subclasses. " +"*line* is the command line which was executed, and *stop* is a flag which " +"indicates whether execution will be terminated after the call to " +":meth:`postcmd`; this will be the return value of the :meth:`onecmd` method." +" The return value of this method will be used as the new value for the " +"internal flag which corresponds to *stop*; returning false will cause " +"interpretation to continue." +msgstr "" +"متد قلابی که درست پس از پایان توزیع یک فرمان اجرا می‌شود. این متد یک stub " +"در :class:`Cmd` است و برای بازنویسی توسط زیرکلاس‌ها وجود دارد. *line* خط " +"فرمانی است که اجرا شده است و *stop* پرچمی است که نشان می‌دهد آیا اجرا پس از " +"فراخوانی :meth:`postcmd` خاتمه خواهد یافت یا خیر؛ این، مقدار بازگشتی متد " +":meth:`onecmd` خواهد بود. مقدار بازگشتی این متد به‌عنوان مقدار جدید برای " +"پرچم داخلی متناظر با *stop* استفاده خواهد شد؛ بازگرداندن false باعث ادامه‌ی " +"تفسیر خواهد شد." -msgid "Hook method executed once when :meth:`cmdloop` is called. This method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." +msgid "" +"Hook method executed once when :meth:`cmdloop` is called. This method is a " +"stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" +"متد قلابکه یک بار هنگام فراخوانی :meth:`cmdloop` اجرا می‌شود. این " +"متد در :class:`Cmd` یک متد stub (stub) است؛ وجود دارد تا توسط زیرکلاس‌ها " +"بازنویسی شود." -msgid "Hook method executed once when :meth:`cmdloop` is about to return. This method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." +msgid "" +"Hook method executed once when :meth:`cmdloop` is about to return. This " +"method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" +"متد قلابکه یک بار اجرا می‌شود، هنگامی که :meth:`cmdloop` در آستانه‌ی " +"بازگشت است. این متد در :class:`Cmd` یک stub (stub) است؛ این متد وجود دارد" +" تا توسط زیرکلاس‌ها بازنویسی شود." -msgid "Instances of :class:`Cmd` subclasses have some public instance variables:" -msgstr "" +msgid "" +"Instances of :class:`Cmd` subclasses have some public instance variables:" +msgstr "نمونه‌های زیرکلاس‌های :class:`Cmd` دارای چند متغیر نمونه عمومی هستند:" msgid "The prompt issued to solicit input." -msgstr "" +msgstr "اعلان صادرشده برای درخواست ورودی." msgid "The string of characters accepted for the command prefix." -msgstr "" +msgstr "رشته‌ای از نویسه‌ها که برای پیشوند فرمان پذیرفته می‌شود." msgid "The last nonempty command prefix seen." -msgstr "" +msgstr "آخرین پیشوند غیرخالی دستور مشاهده‌شده." -msgid "A list of queued input lines. The cmdqueue list is checked in :meth:`cmdloop` when new input is needed; if it is nonempty, its elements will be processed in order, as if entered at the prompt." +msgid "" +"A list of queued input lines. The cmdqueue list is checked in " +":meth:`cmdloop` when new input is needed; if it is nonempty, its elements " +"will be processed in order, as if entered at the prompt." msgstr "" +"فهرستی از خطوط ورودی صف‌شده. فهرست cmdqueue در :meth:`cmdloop` هنگامی که به " +"ورودی جدیدی نیاز باشد بررسی می‌شود؛ اگر خالی نباشد، عناصر آن به ترتیب پردازش" +" می‌شوند، گویی در اعلان وارد شده‌اند." -msgid "A string to issue as an intro or banner. May be overridden by giving the :meth:`cmdloop` method an argument." +msgid "" +"A string to issue as an intro or banner. May be overridden by giving the " +":meth:`cmdloop` method an argument." msgstr "" +"رشته‌ای که به‌عنوان مقدمه یا بنر صادر می‌شود. ممکن است با دادن یک آرگومان به" +" متد :meth:`cmdloop` بازنویسی شود." -msgid "The header to issue if the help output has a section for documented commands." +msgid "" +"The header to issue if the help output has a section for documented " +"commands." msgstr "" +"سرآیندی که اگر خروجی راهنما دارای بخشی برای دستورهای مستندشده باشد، نمایش " +"داده می‌شود." -msgid "The header to issue if the help output has a section for miscellaneous help topics (that is, there are :meth:`!help_\\*` methods without corresponding :meth:`!do_\\*` methods)." +msgid "" +"The header to issue if the help output has a section for miscellaneous help" +" topics (that is, there are :meth:`!help_\\*` methods without corresponding " +":meth:`!do_\\*` methods)." msgstr "" +"سرآیندی که اگر خروجی راهنما دارای بخشی برای موضوعات متفرقه‌ی راهنما باشد، صادر" +" می‌شود (یعنی متدهای :meth:`!help_\\*` بدون متدهای متناظر :meth:`!do_\\*` " +"وجود داشته باشند)." -msgid "The header to issue if the help output has a section for undocumented commands (that is, there are :meth:`!do_\\*` methods without corresponding :meth:`!help_\\*` methods)." +msgid "" +"The header to issue if the help output has a section for undocumented " +"commands (that is, there are :meth:`!do_\\*` methods without corresponding " +":meth:`!help_\\*` methods)." msgstr "" +"سرصفحه‌ای که در صورت وجود داشتن بخشی برای فرمان‌های مستندنشده در خروجی " +"help، نمایش داده می‌شود (یعنی متدهای :meth:`!do_\\*` بدون متدهای " +":meth:`!help_\\*` متناظر وجود دارند)." -msgid "The character used to draw separator lines under the help-message headers. If empty, no ruler line is drawn. It defaults to ``'='``." +msgid "" +"The character used to draw separator lines under the help-message headers. " +"If empty, no ruler line is drawn. It defaults to ``'='``." msgstr "" +"نویسه‌ای که برای رسم خطوط جداکننده زیر سرآیندهای پیام راهنما استفاده می‌شود." +" اگر خالی باشد، هیچ خط جداکننده‌ای رسم نمی‌شود. مقدار پیش‌فرض آن ``'='`` " +"است." -msgid "A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to display a prompt and read the next command; if false, :data:`sys.stdout.write() ` and :data:`sys.stdin.readline() ` are used. (This means that by importing :mod:`readline`, on systems that support it, the interpreter will automatically support :program:`Emacs`\\ -like line editing and command-history keystrokes.)" -msgstr "" +msgid "" +"A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to " +"display a prompt and read the next command; if false, " +":data:`sys.stdout.write() ` and :data:`sys.stdin.readline() " +"` are used. (This means that by importing :mod:`readline`, on " +"systems that support it, the interpreter will automatically support " +":program:`Emacs`\\ -like line editing and command-history keystrokes.)" +msgstr "" +"پرچمی که مقدار پیش‌فرض آن true است. اگر true باشد، :meth:`cmdloop` از " +":func:`input` برای نمایش یک اعلان و خواندن فرمان بعدی استفاده می‌کند؛ اگر " +"false باشد، از :data:`sys.stdout.write() ` و " +":data:`sys.stdin.readline() ` استفاده می‌شود. (این بدان معناست که" +" با ایمپورت کردن :mod:`readline`، در سامانه‌هایی که از آن پشتیبانی می‌کنند، " +"مفسر به‌طور خودکار از ویرایش خط مشابه :program:`Emacs` و کلیدهای تاریخچه‌ی " +"فرمان پشتیبانی می‌کند.)" msgid "Cmd Example" -msgstr "" +msgstr "مثال Cmd" -msgid "The :mod:`!cmd` module is mainly useful for building custom shells that let a user work with a program interactively." +msgid "" +"The :mod:`!cmd` module is mainly useful for building custom shells that let " +"a user work with a program interactively." msgstr "" +"ماژول :mod:`!cmd` عمدتاً برای ساخت پوسته‌های سفارشی مفید است که به کاربر " +"امکان می‌دهند با یک برنامه به‌صورت تعاملی کار کند." -msgid "This section presents a simple example of how to build a shell around a few of the commands in the :mod:`turtle` module." +msgid "" +"This section presents a simple example of how to build a shell around a few " +"of the commands in the :mod:`turtle` module." msgstr "" +"این بخش یک مثال ساده از چگونگی ساختن پوسته‌ای حول چند مورد از دستورات ماژول " +":mod:`turtle` ارائه می‌دهد." -msgid "Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:`Cmd` subclass with method named :meth:`!do_forward`. The argument is converted to a number and dispatched to the turtle module. The docstring is used in the help utility provided by the shell." +msgid "" +"Basic turtle commands such as :meth:`~turtle.forward` are added to a " +":class:`Cmd` subclass with method named :meth:`!do_forward`. The argument " +"is converted to a number and dispatched to the turtle module. The docstring" +" is used in the help utility provided by the shell." msgstr "" +"دستورات پایه turtle مانند :meth:`~turtle.forward` به یک زیرکلاس از " +":class:`Cmd` با متدی به نام :meth:`!do_forward` اضافه می‌شوند. آرگومان به یک" +" عدد تبدیل می‌شود و به ماژول turtle فرستاده می‌شود. رشته مستند " +"در ابزار راهنمای ارائه‌شده توسط پوسته استفاده می‌شود." -msgid "The example also includes a basic record and playback facility implemented with the :meth:`~Cmd.precmd` method which is responsible for converting the input to lowercase and writing the commands to a file. The :meth:`!do_playback` method reads the file and adds the recorded commands to the :attr:`~Cmd.cmdqueue` for immediate playback::" -msgstr "" +msgid "" +"The example also includes a basic record and playback facility implemented " +"with the :meth:`~Cmd.precmd` method which is responsible for converting the " +"input to lowercase and writing the commands to a file. The " +":meth:`!do_playback` method reads the file and adds the recorded commands to" +" the :attr:`~Cmd.cmdqueue` for immediate playback::" +msgstr "" +"این مثال همچنین شامل یک امکان ضبط و بازپخش ساده است که با متد " +":meth:`~Cmd.precmd` پیاده‌سازی شده است؛ این متد مسئول تبدیل ورودی به حروف " +"کوچک و نوشتن دستورات در یک فایل است. متد :meth:`!do_playback` فایل را " +"می‌خواند و دستورات ضبط‌شده را برای بازپخش فوری به :attr:`~Cmd.cmdqueue` " +"اضافه می‌کند::" msgid "" "import cmd, sys\n" @@ -228,9 +484,87 @@ msgid "" "if __name__ == '__main__':\n" " TurtleShell().cmdloop()" msgstr "" +"import cmd, sys\n" +"from turtle import *\n" +"\n" +"class TurtleShell(cmd.Cmd):\n" +" intro = 'Welcome to the turtle shell. Type help or ? to list commands.\\n'\n" +" prompt = '(turtle) '\n" +" file = None\n" +"\n" +" # ----- basic turtle commands -----\n" +" def do_forward(self, arg):\n" +" 'Move the turtle forward by the specified distance: FORWARD 10'\n" +" forward(*parse(arg))\n" +" def do_right(self, arg):\n" +" 'Turn turtle right by given number of degrees: RIGHT 20'\n" +" right(*parse(arg))\n" +" def do_left(self, arg):\n" +" 'Turn turtle left by given number of degrees: LEFT 90'\n" +" left(*parse(arg))\n" +" def do_goto(self, arg):\n" +" 'Move turtle to an absolute position with changing orientation. GOTO 100 200'\n" +" goto(*parse(arg))\n" +" def do_home(self, arg):\n" +" 'Return turtle to the home position: HOME'\n" +" home()\n" +" def do_circle(self, arg):\n" +" 'Draw circle with given radius an options extent and steps: CIRCLE 50'\n" +" circle(*parse(arg))\n" +" def do_position(self, arg):\n" +" 'Print the current turtle position: POSITION'\n" +" print('Current position is %d %d\\n' % position())\n" +" def do_heading(self, arg):\n" +" 'Print the current turtle heading in degrees: HEADING'\n" +" print('Current heading is %d\\n' % (heading(),))\n" +" def do_color(self, arg):\n" +" 'Set the color: COLOR BLUE'\n" +" color(arg.lower())\n" +" def do_undo(self, arg):\n" +" 'Undo (repeatedly) the last turtle action(s): UNDO'\n" +" def do_reset(self, arg):\n" +" 'Clear the screen and return turtle to center: RESET'\n" +" reset()\n" +" def do_bye(self, arg):\n" +" 'Stop recording, close the turtle window, and exit: BYE'\n" +" print('Thank you for using Turtle')\n" +" self.close()\n" +" bye()\n" +" return True\n" +"\n" +" # ----- record and playback -----\n" +" def do_record(self, arg):\n" +" 'Save future commands to filename: RECORD rose.cmd'\n" +" self.file = open(arg, 'w')\n" +" def do_playback(self, arg):\n" +" 'Playback commands from a file: PLAYBACK rose.cmd'\n" +" self.close()\n" +" with open(arg) as f:\n" +" self.cmdqueue.extend(f.read().splitlines())\n" +" def precmd(self, line):\n" +" line = line.lower()\n" +" if self.file and 'playback' not in line:\n" +" print(line, file=self.file)\n" +" return line\n" +" def close(self):\n" +" if self.file:\n" +" self.file.close()\n" +" self.file = None\n" +"\n" +"def parse(arg):\n" +" 'Convert a series of zero or more numbers to an argument tuple'\n" +" return tuple(map(int, arg.split()))\n" +"\n" +"if __name__ == '__main__':\n" +" TurtleShell().cmdloop()" -msgid "Here is a sample session with the turtle shell showing the help functions, using blank lines to repeat commands, and the simple record and playback facility:" +msgid "" +"Here is a sample session with the turtle shell showing the help functions, " +"using blank lines to repeat commands, and the simple record and playback " +"facility:" msgstr "" +"در اینجا یک نشست نمونه با پوسته turtle آمده است که توابع راهنما، استفاده از " +"خطوط خالی برای تکرار دستورها و قابلیت ساده ضبط و پخش را نشان می‌دهد:" msgid "" "Welcome to the turtle shell. Type help or ? to list commands.\n" @@ -291,12 +625,69 @@ msgid "" "(turtle) bye\n" "Thank you for using Turtle" msgstr "" +"به پوسته turtle خوش آمدید. برای فهرست کردن دستورها، help یا ? را وارد کنید.\n" +"\n" +"(turtle) ?\n" +"\n" +"دستورهای مستندشده (help را وارد کنید):\n" +"========================================\n" +"bye color goto home playback record right\n" +"circle forward heading left position reset undo\n" +"\n" +"(turtle) help forward\n" +"لاک‌پشت را به اندازه فاصله مشخص‌شده به جلو حرکت دهید: FORWARD 10\n" +"(turtle) record spiral.cmd\n" +"(turtle) position\n" +"موقعیت فعلی ۰ ۰ است\n" +"\n" +"(turtle) heading\n" +"جهت فعلی ۰ است\n" +"\n" +"(turtle) reset\n" +"(turtle) circle 20\n" +"(turtle) right 30\n" +"(turtle) circle 40\n" +"(turtle) right 30\n" +"(turtle) circle 60\n" +"(turtle) right 30\n" +"(turtle) circle 80\n" +"(turtle) right 30\n" +"(turtle) circle 100\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) heading\n" +"جهت فعلی ۱۸۰ است\n" +"\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 500\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 300\n" +"(turtle) playback spiral.cmd\n" +"موقعیت فعلی ۰ ۰ است\n" +"\n" +"جهت فعلی ۰ است\n" +"\n" +"جهت فعلی ۱۸۰ است\n" +"\n" +"(turtle) bye\n" +"از شما برای استفاده از Turtle سپاسگزاریم" msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" msgid "in a command interpreter" -msgstr "" +msgstr "در یک مفسر فرمان" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" diff --git a/library/cmdline.po b/library/cmdline.po index 7ec7b3c38..0724fddb0 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -22,160 +22,160 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Modules command-line interface (CLI)" -msgstr "" +msgstr "رابط خط فرمان ماژول‌ها (CLI)" msgid "The following modules have a command-line interface." -msgstr "" +msgstr "ماژول‌های زیر دارای رابط خط فرمان هستند." msgid ":ref:`ast `" -msgstr "" +msgstr ":ref:`ast `" msgid ":ref:`asyncio `" -msgstr "" +msgstr ":ref:`asyncio `" msgid ":mod:`base64`" -msgstr "" +msgstr ":mod:`base64`" msgid ":ref:`calendar `" -msgstr "" +msgstr ":ref:`calendar `" msgid ":mod:`code`" -msgstr "" +msgstr ":mod:`code`" msgid ":ref:`compileall `" -msgstr "" +msgstr ":ref:`compileall `" msgid ":mod:`cProfile`: see :ref:`profile `" -msgstr "" +msgstr ":mod:`cProfile`: :ref:`profile ` را ببینید" msgid ":ref:`dis `" -msgstr "" +msgstr ":ref:`dis `" msgid ":ref:`doctest `" -msgstr "" +msgstr ":ref:`doctest `" msgid ":mod:`!encodings.rot_13`" -msgstr "" +msgstr ":mod:`!encodings.rot_13`" msgid ":ref:`ensurepip `" -msgstr "" +msgstr ":ref:`ensurepip `" msgid ":mod:`filecmp`" -msgstr "" +msgstr ":mod:`filecmp`" msgid ":mod:`fileinput`" -msgstr "" +msgstr ":mod:`fileinput`" msgid ":mod:`ftplib`" -msgstr "" +msgstr ":mod:`ftplib`" msgid ":ref:`gzip `" -msgstr "" +msgstr ":ref:`gzip `" msgid ":ref:`http.server `" -msgstr "" +msgstr ":ref:`http.server `" msgid ":ref:`idlelib `" -msgstr "" +msgstr ":ref:`idlelib `" msgid ":ref:`inspect `" -msgstr "" +msgstr ":ref:`inspect `" msgid ":ref:`json `" -msgstr "" +msgstr ":ref:`json `" msgid ":ref:`mimetypes `" -msgstr "" +msgstr ":ref:`mimetypes `" msgid ":ref:`pdb `" -msgstr "" +msgstr ":ref:`pdb `" msgid ":ref:`pickle `" -msgstr "" +msgstr ":ref:`pickle `" msgid ":ref:`pickletools `" -msgstr "" +msgstr ":ref:`pickletools `" msgid ":ref:`platform `" -msgstr "" +msgstr ":ref:`platform `" msgid ":mod:`poplib`" -msgstr "" +msgstr ":mod:`poplib`" msgid ":ref:`profile `" -msgstr "" +msgstr ":ref:`profile `" msgid ":mod:`pstats`" -msgstr "" +msgstr ":mod:`pstats`" msgid ":ref:`py_compile `" -msgstr "" +msgstr ":ref:`py_compile `" msgid ":mod:`pyclbr`" -msgstr "" +msgstr ":mod:`pyclbr`" msgid ":mod:`pydoc`" -msgstr "" +msgstr ":mod:`pydoc`" msgid ":mod:`quopri`" -msgstr "" +msgstr ":mod:`quopri`" msgid ":ref:`random `" -msgstr "" +msgstr ":ref:`random `" msgid ":mod:`runpy`" -msgstr "" +msgstr ":mod:`runpy`" msgid ":ref:`site `" -msgstr "" +msgstr ":ref:`site `" msgid ":ref:`sqlite3 `" -msgstr "" +msgstr ":ref:`sqlite3 `" msgid ":ref:`symtable `" -msgstr "" +msgstr ":ref:`symtable `" msgid ":ref:`sysconfig `" -msgstr "" +msgstr ":ref:`sysconfig `" msgid ":mod:`tabnanny`" -msgstr "" +msgstr ":mod:`tabnanny`" msgid ":ref:`tarfile `" -msgstr "" +msgstr ":ref:`tarfile `" msgid ":mod:`!this`" -msgstr "" +msgstr ":mod:`!this`" msgid ":ref:`timeit `" -msgstr "" +msgstr ":ref:`timeit `" msgid ":ref:`tokenize `" -msgstr "" +msgstr ":ref:`tokenize `" msgid ":ref:`trace `" -msgstr "" +msgstr ":ref:`trace `" msgid ":mod:`turtledemo`" -msgstr "" +msgstr ":mod:`turtledemo`" msgid ":ref:`unittest `" -msgstr "" +msgstr ":ref:`unittest `" msgid ":ref:`uuid `" -msgstr "" +msgstr ":ref:`uuid `" msgid ":ref:`venv `" -msgstr "" +msgstr ":ref:`venv `" msgid ":ref:`webbrowser `" -msgstr "" +msgstr ":ref:`webbrowser `" msgid ":ref:`zipapp `" -msgstr "" +msgstr ":ref:`zipapp `" msgid ":ref:`zipfile `" -msgstr "" +msgstr ":ref:`zipfile `" msgid "See also the :ref:`Python command-line interface `." -msgstr "" +msgstr "همچنین :ref:`رابط خط فرمان پایتون ` را ببینید." diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po index 43d54d0ed..7fb45bacf 100644 --- a/library/cmdlinelibs.po +++ b/library/cmdlinelibs.po @@ -22,10 +22,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Command-line interface libraries" -msgstr "" +msgstr "کتابخانه‌های رابط خط فرمان" -msgid "The modules described in this chapter assist with implementing command line and terminal interfaces for applications." +msgid "" +"The modules described in this chapter assist with implementing command line " +"and terminal interfaces for applications." msgstr "" +"ماژول‌های توصیف‌شده در این فصل به پیاده‌سازی رابط‌های خط فرمان و پایانه برای" +" برنامه‌های کاربردی کمک می‌کنند." msgid "Here's an overview:" -msgstr "" +msgstr "در اینجا یک نمای کلی آمده است:" diff --git a/library/code.po b/library/code.po index 26301b101..16db4c72f 100644 --- a/library/code.po +++ b/library/code.po @@ -22,100 +22,300 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!code` --- Interpreter base classes" -msgstr "" +msgstr ":mod:`!code` --- کلاس‌های پایه مفسر" msgid "**Source code:** :source:`Lib/code.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/code.py`" -msgid "The ``code`` module provides facilities to implement read-eval-print loops in Python. Two classes and convenience functions are included which can be used to build applications which provide an interactive interpreter prompt." +msgid "" +"The ``code`` module provides facilities to implement read-eval-print loops " +"in Python. Two classes and convenience functions are included which can be " +"used to build applications which provide an interactive interpreter prompt." msgstr "" +"ماژول ``code`` امکاناتی برای پیاده‌سازی حلقه‌های خواندن-ارزیابی-چاپ (REPL) " +"در پایتون فراهم می‌کند. دو کلاس و توابع کمکی گنجانده شده‌اند که می‌توان از " +"آن‌ها برای ساخت برنامه‌هایی استفاده کرد که اعلان مفسر تعاملی را ارائه " +"می‌دهند." -msgid "This class deals with parsing and interpreter state (the user's namespace); it does not deal with input buffering or prompting or input file naming (the filename is always passed in explicitly). The optional *locals* argument specifies a mapping to use as the namespace in which code will be executed; it defaults to a newly created dictionary with key ``'__name__'`` set to ``'__console__'`` and key ``'__doc__'`` set to ``None``." -msgstr "" +msgid "" +"This class deals with parsing and interpreter state (the user's namespace); " +"it does not deal with input buffering or prompting or input file naming (the" +" filename is always passed in explicitly). The optional *locals* argument " +"specifies a mapping to use as the namespace in which code will be executed; " +"it defaults to a newly created dictionary with key ``'__name__'`` set to " +"``'__console__'`` and key ``'__doc__'`` set to ``None``." +msgstr "" +"این کلاس به تجزیه و وضعیت مفسر (فضای نام کاربر) می‌پردازد؛ به بافر کردن " +"ورودی، نمایش اعلان یا نام‌گذاری فایل ورودی نمی‌پردازد (نام فایل همیشه " +"به‌صورت صریح ارسال می‌شود). آرگومان اختیاری *locals* نگاشتی را برای استفاده " +"به‌عنوان فضای نامی که کد در آن اجرا خواهد شد مشخص می‌کند؛ مقدار پیش‌فرض آن " +"یک دیکشنری تازه‌ساخته است که در آن کلید ``'__name__'`` روی ``'__console__'``" +" و کلید ``'__doc__'`` روی ``None`` تنظیم شده است." -msgid "Note that functions and classes objects created under an :class:`!InteractiveInterpreter` instance will belong to the namespace specified by *locals*. They are only pickleable if *locals* is the namespace of an existing module." +msgid "" +"Note that functions and classes objects created under an " +":class:`!InteractiveInterpreter` instance will belong to the namespace " +"specified by *locals*. They are only pickleable if *locals* is the namespace" +" of an existing module." msgstr "" +"توجه داشته باشید که اشیای توابع و کلاس‌های ایجادشده تحت یک نمونه " +":class:`!InteractiveInterpreter` به فضای نام مشخص‌شده توسط *locals* تعلق " +"خواهند داشت. آن‌ها تنها در صورتی قابل پیکل (pickleable) هستند که *locals* " +"فضای نام یک ماژول موجود باشد." -msgid "Closely emulate the behavior of the interactive Python interpreter. This class builds on :class:`InteractiveInterpreter` and adds prompting using the familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* is true, ``exit()`` and ``quit()`` in the console will not raise :exc:`SystemExit`, but instead return to the calling code." -msgstr "" +msgid "" +"Closely emulate the behavior of the interactive Python interpreter. This " +"class builds on :class:`InteractiveInterpreter` and adds prompting using the" +" familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* " +"is true, ``exit()`` and ``quit()`` in the console will not raise " +":exc:`SystemExit`, but instead return to the calling code." +msgstr "" +"به‌دقت رفتار مفسر تعاملی پایتون را شبیه‌سازی می‌کند. این کلاس بر پایه " +":class:`InteractiveInterpreter` ساخته شده و اعلان‌دهی با استفاده از " +"``sys.ps1`` و ``sys.ps2`` آشنا و همچنین بافرینگ ورودی را اضافه می‌کند. اگر " +"*local_exit* درست باشد، ``exit()`` و ``quit()`` در کنسول :exc:`SystemExit` " +"را پرتاب نمی‌کنند، بلکه به کد فراخوان بازمی‌گردند." msgid "Added *local_exit* parameter." -msgstr "" +msgstr "پارامتر *local_exit* افزوده شد." -msgid "Convenience function to run a read-eval-print loop. This creates a new instance of :class:`InteractiveConsole` and sets *readfunc* to be used as the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is provided, it is passed to the :class:`InteractiveConsole` constructor for use as the default namespace for the interpreter loop. If *local_exit* is provided, it is passed to the :class:`InteractiveConsole` constructor. The :meth:`~InteractiveConsole.interact` method of the instance is then run with *banner* and *exitmsg* passed as the banner and exit message to use, if provided. The console object is discarded after use." -msgstr "" +msgid "" +"Convenience function to run a read-eval-print loop. This creates a new " +"instance of :class:`InteractiveConsole` and sets *readfunc* to be used as " +"the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is" +" provided, it is passed to the :class:`InteractiveConsole` constructor for " +"use as the default namespace for the interpreter loop. If *local_exit* is " +"provided, it is passed to the :class:`InteractiveConsole` constructor. The " +":meth:`~InteractiveConsole.interact` method of the instance is then run with" +" *banner* and *exitmsg* passed as the banner and exit message to use, if " +"provided. The console object is discarded after use." +msgstr "" +"تابعی برای سهولت اجرای حلقه‌ی خواندن-ارزیابی-چاپ. این تابع یک نمونه‌ی جدید " +"از :class:`InteractiveConsole` ایجاد می‌کند و، در صورت ارائه‌شدن *readfunc*،" +" آن را تنظیم می‌کند تا به‌عنوان متد :meth:`InteractiveConsole.raw_input` " +"استفاده شود. اگر *local* ارائه‌شده باشد، به سازنده‌ی " +":class:`InteractiveConsole` ارسال می‌شود تا به‌عنوان فضای نام پیش‌فرض برای " +"حلقه‌ی مفسر استفاده شود. اگر *local_exit* ارائه‌شده باشد، به سازنده‌ی " +":class:`InteractiveConsole` ارسال می‌شود. سپس متد " +":meth:`~InteractiveConsole.interact` این نمونه اجرا می‌شود، درحالی‌که " +"*banner* و *exitmsg*، در صورت ارائه‌شدن، به‌عنوان بنر و پیام خروج برای " +"استفاده ارسال می‌شوند. شیء کنسول پس از استفاده دور انداخته می‌شود." msgid "Added *exitmsg* parameter." -msgstr "" +msgstr "پارامتر *exitmsg* اضافه شد." -msgid "This function is useful for programs that want to emulate Python's interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is to determine when the user has entered an incomplete command that can be completed by entering more text (as opposed to a complete command or a syntax error). This function *almost* always makes the same decision as the real interpreter main loop." -msgstr "" +msgid "" +"This function is useful for programs that want to emulate Python's " +"interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is" +" to determine when the user has entered an incomplete command that can be " +"completed by entering more text (as opposed to a complete command or a " +"syntax error). This function *almost* always makes the same decision as the" +" real interpreter main loop." +msgstr "" +"این تابع برای برنامه‌هایی مفید است که می‌خواهند حلقه‌ی اصلی مفسر پایتون " +"(معروف به حلقه‌ی خواندن-ارزیابی-چاپ) را شبیه‌سازی کنند. بخش دشوار، تشخیص این" +" موضوع است که کاربر چه زمانی یک دستور ناقص وارد کرده است که می‌توان آن را با" +" وارد کردن متن بیشتر کامل کرد (در مقابل یک دستور کامل یا یک خطای سینتکسی). " +"این تابع *تقریباً* همیشه همان تصمیمی را می‌گیرد که حلقه‌ی اصلی واقعی مفسر " +"می‌گیرد." -msgid "*source* is the source string; *filename* is the optional filename from which source was read, defaulting to ``''``; and *symbol* is the optional grammar start symbol, which should be ``'single'`` (the default), ``'eval'`` or ``'exec'``." +msgid "" +"*source* is the source string; *filename* is the optional filename from " +"which source was read, defaulting to ``''``; and *symbol* is the " +"optional grammar start symbol, which should be ``'single'`` (the default), " +"``'eval'`` or ``'exec'``." msgstr "" +"*source* رشته منبع است؛ *filename* نام فایل اختیاری است که منبع از آن خوانده" +" شده است، با پیش‌فرض ``''``؛ و *symbol* نماد شروع اختیاری دستور زبان " +"است که باید ``'single'`` (پیش‌فرض)، ``'eval'`` یا ``'exec'`` باشد." -msgid "Returns a code object (the same as ``compile(source, filename, symbol)``) if the command is complete and valid; ``None`` if the command is incomplete; raises :exc:`SyntaxError` if the command is complete and contains a syntax error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command contains an invalid literal." -msgstr "" +msgid "" +"Returns a code object (the same as ``compile(source, filename, symbol)``) if" +" the command is complete and valid; ``None`` if the command is incomplete; " +"raises :exc:`SyntaxError` if the command is complete and contains a syntax " +"error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command " +"contains an invalid literal." +msgstr "" +"اگر دستور کامل و معتبر باشد، یک شیء کد (همانند ``compile(source, filename, " +"symbol)``) را بازمی‌گرداند؛ اگر دستور ناتمام باشد، ``None`` را بازمی‌گرداند؛" +" اگر دستور کامل باشد و حاوی خطای سینتکسی باشد، :exc:`SyntaxError` را پرتاب " +"می‌کند، یا اگر دستور حاوی یک لفظی (literal) نامعتبر باشد، " +":exc:`OverflowError` یا :exc:`ValueError` را پرتاب می‌کند." msgid "Interactive Interpreter Objects" -msgstr "" +msgstr "اشیای مفسر تعاملی" -msgid "Compile and run some source in the interpreter. Arguments are the same as for :func:`compile_command`; the default for *filename* is ``''``, and for *symbol* is ``'single'``. One of several things can happen:" +msgid "" +"Compile and run some source in the interpreter. Arguments are the same as " +"for :func:`compile_command`; the default for *filename* is ``''``, " +"and for *symbol* is ``'single'``. One of several things can happen:" msgstr "" +"مقداری کد منبع را در مفسر کامپایل و اجرا می‌کند. آرگومان‌ها همان آرگومان‌های" +" :func:`compile_command` هستند؛ پیش‌فرض برای *filename* برابر ``''`` " +"و برای *symbol* برابر ``'single'`` است. یکی از چند حالت ممکن است رخ دهد:" -msgid "The input is incorrect; :func:`compile_command` raised an exception (:exc:`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be printed by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns ``False``." +msgid "" +"The input is incorrect; :func:`compile_command` raised an exception " +"(:exc:`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be " +"printed by calling the :meth:`showsyntaxerror` method. :meth:`runsource` " +"returns ``False``." msgstr "" +"ورودی نادرست است؛ :func:`compile_command` استثنایی پرتاب کرد " +"(:exc:`SyntaxError` یا :exc:`OverflowError`). با فراخوانی متد " +":meth:`showsyntaxerror`، یک ردگیری سینتکسی چاپ خواهد شد. :meth:`runsource` " +"مقدار ``False`` را بازمی‌گرداند." -msgid "The input is incomplete, and more input is required; :func:`compile_command` returned ``None``. :meth:`runsource` returns ``True``." +msgid "" +"The input is incomplete, and more input is required; :func:`compile_command`" +" returned ``None``. :meth:`runsource` returns ``True``." msgstr "" +"ورودی ناقص است و به ورودی بیشتری نیاز است؛ :func:`compile_command` ``None`` " +"را برگرداند. :meth:`runsource` ``True`` را برمی‌گرداند." -msgid "The input is complete; :func:`compile_command` returned a code object. The code is executed by calling the :meth:`runcode` (which also handles run-time exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns ``False``." +msgid "" +"The input is complete; :func:`compile_command` returned a code object. The " +"code is executed by calling the :meth:`runcode` (which also handles run-time" +" exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns " +"``False``." msgstr "" +"ورودی کامل است؛ :func:`compile_command` یک شیء کد برگرداند. کد با فراخوانی " +":meth:`runcode` اجرا می‌شود (که استثناهای ران‌تایم را نیز مدیریت می‌کند، " +"به‌جز :exc:`SystemExit`). :meth:`runsource` ``False`` را برمی‌گرداند." -msgid "The return value can be used to decide whether to use ``sys.ps1`` or ``sys.ps2`` to prompt the next line." +msgid "" +"The return value can be used to decide whether to use ``sys.ps1`` or " +"``sys.ps2`` to prompt the next line." msgstr "" +"می‌توان از مقدار بازگشتی برای تصمیم‌گیری درباره‌ی استفاده از ``sys.ps1`` یا " +"``sys.ps2`` به‌عنوان اعلان خط بعدی استفاده کرد." -msgid "Execute a code object. When an exception occurs, :meth:`showtraceback` is called to display a traceback. All exceptions are caught except :exc:`SystemExit`, which is allowed to propagate." +msgid "" +"Execute a code object. When an exception occurs, :meth:`showtraceback` is " +"called to display a traceback. All exceptions are caught except " +":exc:`SystemExit`, which is allowed to propagate." msgstr "" +"یک شیء کد را اجرا می‌کند. هنگامی که یک استثنا رخ می‌دهد، " +":meth:`showtraceback` برای نمایش یک ردگیری پشته فراخوانی می‌شود. همه‌ی " +"استثناها گرفته می‌شوند، به‌جز :exc:`SystemExit`، که اجازه دارد منتشر شود." -msgid "A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in this code, and may not always be caught. The caller should be prepared to deal with it." +msgid "" +"A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in" +" this code, and may not always be caught. The caller should be prepared to " +"deal with it." msgstr "" +"نکته‌ای در مورد :exc:`KeyboardInterrupt`: این استثنا ممکن است در جاهای دیگری" +" از این کد رخ دهد و ممکن است همیشه گرفته نشود. فراخواننده باید برای رسیدگی " +"به آن آماده باشد." -msgid "Display the syntax error that just occurred. This does not display a stack trace because there isn't one for syntax errors. If *filename* is given, it is stuffed into the exception instead of the default filename provided by Python's parser, because it always uses ``''`` when reading from a string. The output is written by the :meth:`write` method." -msgstr "" +msgid "" +"Display the syntax error that just occurred. This does not display a stack " +"trace because there isn't one for syntax errors. If *filename* is given, it " +"is stuffed into the exception instead of the default filename provided by " +"Python's parser, because it always uses ``''`` when reading from a " +"string. The output is written by the :meth:`write` method." +msgstr "" +"خطای سینتکسی‌ای را که به‌تازگی رخ داده است نمایش می‌دهد. این کار ردگیری پشته" +" را نمایش نمی‌دهد، زیرا برای خطاهای سینتکسی هیچ ردگیری پشته‌ای وجود ندارد. " +"اگر *filename* داده شود، این نام به‌جای نام فایل پیش‌فرض ارائه‌شده توسط " +"پارسر پایتون در استثنا گنجانده می‌شود، زیرا آن پارسر همیشه هنگام" +" خواندن از یک رشته از ``''`` استفاده می‌کند. خروجی توسط متد " +":meth:`write` نوشته می‌شود." -msgid "Display the exception that just occurred. We remove the first stack item because it is within the interpreter object implementation. The output is written by the :meth:`write` method." +msgid "" +"Display the exception that just occurred. We remove the first stack item " +"because it is within the interpreter object implementation. The output is " +"written by the :meth:`write` method." msgstr "" +"استثنایی را که به‌تازگی رخ داده است نمایش می‌دهیم. نخستین آیتم پشته را حذف " +"می‌کنیم، زیرا درون پیاده‌سازی شیء مفسر قرار دارد. خروجی توسط متد " +":meth:`write` نوشته می‌شود." -msgid "The full chained traceback is displayed instead of just the primary traceback." +msgid "" +"The full chained traceback is displayed instead of just the primary " +"traceback." msgstr "" +"ردگیری پشته زنجیره‌ای کامل به‌جای تنها ردگیری پشته اصلی نمایش داده می‌شود." -msgid "Write a string to the standard error stream (``sys.stderr``). Derived classes should override this to provide the appropriate output handling as needed." +msgid "" +"Write a string to the standard error stream (``sys.stderr``). Derived " +"classes should override this to provide the appropriate output handling as " +"needed." msgstr "" +"یک رشته را در جریان خطای استاندارد (``sys.stderr``) می‌نویسد. کلاس‌های " +"مشتق‌شده باید این متد را بازنویسی کنند تا در صورت نیاز، پردازش خروجی مناسب " +"را فراهم کنند." msgid "Interactive Console Objects" -msgstr "" +msgstr "اشیای کنسول تعاملی" -msgid "The :class:`InteractiveConsole` class is a subclass of :class:`InteractiveInterpreter`, and so offers all the methods of the interpreter objects as well as the following additions." +msgid "" +"The :class:`InteractiveConsole` class is a subclass of " +":class:`InteractiveInterpreter`, and so offers all the methods of the " +"interpreter objects as well as the following additions." msgstr "" +"کلاس :class:`InteractiveConsole` زیرکلاسی از :class:`InteractiveInterpreter`" +" است، بنابراین همه‌ی متدهای اشیای مفسر و همچنین موارد افزودنی زیر را ارائه " +"می‌دهد." -msgid "Closely emulate the interactive Python console. The optional *banner* argument specify the banner to print before the first interaction; by default it prints a banner similar to the one printed by the standard Python interpreter, followed by the class name of the console object in parentheses (so as not to confuse this with the real interpreter -- since it's so close!)." -msgstr "" +msgid "" +"Closely emulate the interactive Python console. The optional *banner* " +"argument specify the banner to print before the first interaction; by " +"default it prints a banner similar to the one printed by the standard Python" +" interpreter, followed by the class name of the console object in " +"parentheses (so as not to confuse this with the real interpreter -- since " +"it's so close!)." +msgstr "" +"تا حد زیادی کنسول تعاملی پایتون را شبیه‌سازی می‌کند. آرگومان اختیاری " +"*banner* بنری را مشخص می‌کند که پیش از نخستین تعامل چاپ می‌شود؛ به‌طور " +"پیش‌فرض، بنری مشابه بنر چاپ‌شده توسط مفسر استاندارد پایتون را چاپ می‌کند و " +"پس از آن، نام کلاس شیء کنسول در پرانتز می‌آید (تا با مفسر واقعی اشتباه گرفته" +" نشود — چون بسیار نزدیک است!)." -msgid "The optional *exitmsg* argument specifies an exit message printed when exiting. Pass the empty string to suppress the exit message. If *exitmsg* is not given or ``None``, a default message is printed." +msgid "" +"The optional *exitmsg* argument specifies an exit message printed when " +"exiting. Pass the empty string to suppress the exit message. If *exitmsg* is" +" not given or ``None``, a default message is printed." msgstr "" +"آرگومان اختیاری *exitmsg* یک پیام خروج را مشخص می‌کند که هنگام خروج چاپ " +"می‌شود. برای جلوگیری از چاپ پیام خروج، رشته خالی را بدهید. اگر *exitmsg* " +"داده نشود یا ``None`` باشد، یک پیام پیش‌فرض چاپ می‌شود." msgid "To suppress printing any banner, pass an empty string." -msgstr "" +msgstr "برای جلوگیری از چاپ هرگونه بنر، یک رشته خالی ارسال کنید." msgid "Print an exit message when exiting." -msgstr "" +msgstr "هنگام خروج، یک پیام خروج چاپ می‌شود." -msgid "Push a line of source text to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` method is called with the concatenated contents of the buffer as source. If this indicates that the command was executed or invalid, the buffer is reset; otherwise, the command is incomplete, and the buffer is left as it was after the line was appended. The return value is ``True`` if more input is required, ``False`` if the line was dealt with in some way (this is the same as :meth:`!runsource`)." -msgstr "" +msgid "" +"Push a line of source text to the interpreter. The line should not have a " +"trailing newline; it may have internal newlines. The line is appended to a " +"buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` " +"method is called with the concatenated contents of the buffer as source. If" +" this indicates that the command was executed or invalid, the buffer is " +"reset; otherwise, the command is incomplete, and the buffer is left as it " +"was after the line was appended. The return value is ``True`` if more input" +" is required, ``False`` if the line was dealt with in some way (this is the " +"same as :meth:`!runsource`)." +msgstr "" +"یک خط از متن منبع را به مفسر ارسال کنید. خط نباید به نویسه‌ی خط جدید ختم شود؛" +" ممکن است شامل نویسه‌های خط جدید داخلی باشد. خط به یک بافر افزوده می‌شود و " +"متد :meth:`~InteractiveInterpreter.runsource` مفسر با محتوای به‌هم‌پیوسته‌ی " +"بافر به‌عنوان منبع فراخوانی می‌شود. اگر این نشان دهد که دستور اجراشده یا " +"نامعتبر است، بافر بازنشانی می‌شود؛ در غیر این صورت، دستور ناقص است و بافر به" +" همان حالت پس از افزودن خط باقی می‌ماند. مقدار بازگشتی در صورتی ``True`` است" +" که به ورودی بیشتری نیاز باشد، و در صورتی ``False`` است که خط به شکلی " +"پردازش‌شده باشد (این همانند :meth:`!runsource` است)." msgid "Remove any unhandled source text from the input buffer." -msgstr "" +msgstr "هرگونه متن منبع پردازش‌نشده را از بافر ورودی حذف کنید." -msgid "Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, :exc:`EOFError` is raised. The base implementation reads from ``sys.stdin``; a subclass may replace this with a different implementation." -msgstr "" +msgid "" +"Write a prompt and read a line. The returned line does not include the " +"trailing newline. When the user enters the EOF key sequence, " +":exc:`EOFError` is raised. The base implementation reads from ``sys.stdin``;" +" a subclass may replace this with a different implementation." +msgstr "" +"یک اعلان را می‌نویسد و یک خط را می‌خواند. خط برگردانده‌شده شامل نویسه‌ی خط " +"جدید پایانی نیست. هنگامی که کاربر دنباله‌ی کلیدهای EOF را وارد کند، " +":exc:`EOFError` پرتاب می‌شود. پیاده‌سازی پایه از ``sys.stdin`` می‌خواند؛ یک " +"زیرکلاس می‌تواند این را با پیاده‌سازی متفاوتی جایگزین کند." diff --git a/library/codecs.po b/library/codecs.po index 8a2183b22..bd0e5278c 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"PO-Revision-Date: 2026-08-28 10:43+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,1700 +22,2972 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!codecs` --- Codec registry and base classes" -msgstr "" +msgstr ":mod:`!codecs` --- رجیستری کدک و کلاس‌های پایه" msgid "**Source code:** :source:`Lib/codecs.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/codecs.py`" -msgid "This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry, which manages the codec and error handling lookup process. Most standard codecs are :term:`text encodings `, which encode text to bytes (and decode bytes to text), but there are also codecs provided that encode text to text, and bytes to bytes. Custom codecs may encode and decode between arbitrary types, but some module features are restricted to be used specifically with :term:`text encodings ` or with codecs that encode to :class:`bytes`." -msgstr "" +msgid "" +"This module defines base classes for standard Python codecs (encoders and " +"decoders) and provides access to the internal Python codec registry, which " +"manages the codec and error handling lookup process. Most standard codecs " +"are :term:`text encodings `, which encode text to bytes (and " +"decode bytes to text), but there are also codecs provided that encode text " +"to text, and bytes to bytes. Custom codecs may encode and decode between " +"arbitrary types, but some module features are restricted to be used " +"specifically with :term:`text encodings ` or with codecs " +"that encode to :class:`bytes`." +msgstr "" +"این ماژول کلاس‌های پایه‌ای برای کدک‌های استاندارد پایتون (کدگذارها و کدگشاها) " +"تعریف می‌کند و دسترسی به رجیستری داخلی کدک پایتون را فراهم می‌کند، که فرایند " +"جست‌وجوی کدک و مدیریت خطا را مدیریت می‌کند. بیشتر کدک‌های " +"استاندارد :term:`کدگذاری‌های متنی ` هستند، که متن را به بایت " +"کدگذاری می‌کنند (و بایت را به متن کدگشایی می‌کنند)، اما کدک‌هایی نیز فراهم " +"شده‌اند که متن را به متن و بایت را به بایت کدگذاری می‌کنند. کدک‌های سفارشی " +"می‌توانند میان انواع دلخواه کدگذاری و کدگشایی کنند، اما برخی امکانات ماژول " +"محدود شده‌اند که فقط با :term:`کدگذاری‌های متنی ` یا با " +"کدک‌هایی که به :class:`bytes` کدگذاری می‌کنند، استفاده شوند." -msgid "The module defines the following functions for encoding and decoding with any codec:" +msgid "" +"The module defines the following functions for encoding and decoding with " +"any codec:" msgstr "" +"این ماژول تابع‌های زیر را برای کدگذاری و کدگشایی با هر کدک (codec) تعریف " +"می‌کند:" msgid "Encodes *obj* using the codec registered for *encoding*." msgstr "" +"*obj* را با استفاده از کدک (codec) ثبت‌شده برای *encoding* کدگذاری می‌کند." -msgid "*Errors* may be given to set the desired error handling scheme. The default error handler is ``'strict'`` meaning that encoding errors raise :exc:`ValueError` (or a more codec specific subclass, such as :exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more information on codec error handling." -msgstr "" +msgid "" +"*Errors* may be given to set the desired error handling scheme. The default " +"error handler is ``'strict'`` meaning that encoding errors " +"raise :exc:`ValueError` (or a more codec specific subclass, such " +"as :exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more " +"information on codec error handling." +msgstr "" +"می‌توان *Errors* را برای تنظیم طرح‌واره مدیریت خطای مورد نظر مشخص کرد. " +"هندلر پیش‌فرض خطا ``'strict'`` است، به این معنا که خطاهای کدگذاری باعث " +"پرتاب :exc:`ValueError` (یا زیرکلاسی اختصاصی‌تر برای کدک، " +"مانند :exc:`UnicodeEncodeError`) می‌شوند. برای اطلاعات بیشتر درباره مدیریت " +"خطای کدک، به :ref:`codec-base-classes` مراجعه کنید." msgid "Decodes *obj* using the codec registered for *encoding*." msgstr "" +"*obj* را با استفاده از کدک (codec) ثبت‌شده برای *encoding* کدگشایی می‌کند." -msgid "*Errors* may be given to set the desired error handling scheme. The default error handler is ``'strict'`` meaning that decoding errors raise :exc:`ValueError` (or a more codec specific subclass, such as :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more information on codec error handling." -msgstr "" +msgid "" +"*Errors* may be given to set the desired error handling scheme. The default " +"error handler is ``'strict'`` meaning that decoding errors " +"raise :exc:`ValueError` (or a more codec specific subclass, such " +"as :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more " +"information on codec error handling." +msgstr "" +"می‌توان *خطاها* را برای تنظیم طرح‌واره مدیریت خطای دلخواه ارائه کرد. مدیر خطای " +"پیش‌فرض ``'strict'`` است، به این معنا که خطاهای کدگشایی باعث " +"پرتاب :exc:`ValueError` (یا یک زیرکلاس خاص‌ترِ مربوط به کدک، " +"مانند :exc:`UnicodeDecodeError`) می‌شوند. برای اطلاعات بیشتر در مورد مدیریت " +"خطای کدک، به :ref:`codec-base-classes` مراجعه کنید." -msgid "Return a mapping suitable for encoding with a custom single-byte encoding. Given a :class:`str` *string* of up to 256 characters representing a decoding table, returns either a compact internal mapping object ``EncodingMap`` or a :class:`dictionary ` mapping character ordinals to byte values. Raises a :exc:`TypeError` on invalid input." -msgstr "" +msgid "" +"Return a mapping suitable for encoding with a custom single-byte encoding. " +"Given a :class:`str` *string* of up to 256 characters representing a " +"decoding table, returns either a compact internal mapping object " +"``EncodingMap`` or a :class:`dictionary ` mapping character ordinals " +"to byte values. Raises a :exc:`TypeError` on invalid input." +msgstr "" +"یک نگاشت مناسب برای کدگذاری با یک کدگذاری تک‌بایتی سفارشی بازمی‌گرداند. به " +"ازای دریافت یک :class:`str` *string* با حداکثر ۲۵۶ نویسه که نشان‌دهنده یک " +"جدول کدگشایی است، یا یک شیء نگاشت داخلی فشرده ``EncodingMap`` یا " +"یک :class:`دیکشنری ` برای نگاشت شماره ترتیب هر نویسه به مقادیر بایت " +"بازمی‌گرداند. در صورت ورودی نامعتبر، استثنای :exc:`TypeError` را پرتاب می‌کند." msgid "The full details for each codec can also be looked up directly:" -msgstr "" +msgstr "همچنین می‌توانید جزئیات کامل هر کدک را مستقیماً جستجو کنید:" -msgid "Looks up the codec info in the Python codec registry and returns a :class:`CodecInfo` object as defined below." +msgid "" +"Looks up the codec info in the Python codec registry and returns " +"a :class:`CodecInfo` object as defined below." msgstr "" +"اطلاعات کدک را در رجیستری کدک‌های پایتون جستجو می‌کند و یک " +"شیء :class:`CodecInfo` را که در زیر تعریف شده است برمی‌گرداند." -msgid "Encodings are first looked up in the registry's cache. If not found, the list of registered search functions is scanned. If no :class:`CodecInfo` object is found, a :exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object is stored in the cache and returned to the caller." -msgstr "" +msgid "" +"Encodings are first looked up in the registry's cache. If not found, the " +"list of registered search functions is scanned. If no :class:`CodecInfo` " +"object is found, a :exc:`LookupError` is raised. Otherwise, " +"the :class:`CodecInfo` object is stored in the cache and returned to the " +"caller." +msgstr "" +"کدگذاری‌ها ابتدا در نهانگاه رجیستری جستجو می‌شوند. اگر یافت نشوند، فهرست " +"توابع جستجوی ثبت‌شده پویش می‌شود. اگر شیء :class:`CodecInfo` یافت " +"نشود، :exc:`LookupError` پرتاب می‌شود. در غیر این صورت، " +"شیء :class:`CodecInfo` در نهانگاه ذخیره می‌شود و به فراخواننده برگردانده " +"می‌شود." -msgid "Codec details when looking up the codec registry. The constructor arguments are stored in attributes of the same name:" +msgid "" +"Codec details when looking up the codec registry. The constructor arguments " +"are stored in attributes of the same name:" msgstr "" +"جزئیات کدک (codec) هنگام جستجو در رجیستری کدک (codec registry). آرگومان‌های " +"سازنده در ویژگی‌های هم‌نام ذخیره می‌شوند:" msgid "The name of the encoding." -msgstr "" +msgstr "نام کدگذاری." -msgid "The stateless encoding and decoding functions. These must be functions or methods which have the same interface as the :meth:`~Codec.encode` and :meth:`~Codec.decode` methods of Codec instances (see :ref:`Codec Interface `). The functions or methods are expected to work in a stateless mode." +msgid "" +"The stateless encoding and decoding functions. These must be functions or " +"methods which have the same interface as the :meth:`~Codec.encode` " +"and :meth:`~Codec.decode` methods of Codec instances (see :ref:`Codec " +"Interface `). The functions or methods are expected to work " +"in a stateless mode." msgstr "" +"توابع کدگذاری و کدگشایی بی‌وضعیت. این‌ها باید توابع یا متدهایی باشند که رابطی " +"یکسان با متدهای :meth:`~Codec.encode` و :meth:`~Codec.decode` نمونه‌های " +"Codec دارند (به :ref:`رابط Codec ` مراجعه کنید). انتظار " +"می‌رود این توابع یا متدها در حالت بی‌وضعیت کار کنند." -msgid "Incremental encoder and decoder classes or factory functions. These have to provide the interface defined by the base classes :class:`IncrementalEncoder` and :class:`IncrementalDecoder`, respectively. Incremental codecs can maintain state." +msgid "" +"Incremental encoder and decoder classes or factory functions. These have to " +"provide the interface defined by the base " +"classes :class:`IncrementalEncoder` and :class:`IncrementalDecoder`, " +"respectively. Incremental codecs can maintain state." msgstr "" +"کلاس‌های کدگذار و کدگشای تدریجی یا توابع کارخانه. این موارد باید به‌ترتیب " +"رابط تعریف‌شده توسط کلاس‌های پایه :class:`IncrementalEncoder` " +"و :class:`IncrementalDecoder` را ارائه دهند. کدک‌های تدریجی می‌توانند وضعیت " +"را حفظ کنند." -msgid "Stream writer and reader classes or factory functions. These have to provide the interface defined by the base classes :class:`StreamWriter` and :class:`StreamReader`, respectively. Stream codecs can maintain state." +msgid "" +"Stream writer and reader classes or factory functions. These have to " +"provide the interface defined by the base classes :class:`StreamWriter` " +"and :class:`StreamReader`, respectively. Stream codecs can maintain state." msgstr "" +"کلاس‌ها یا توابع کارخانه‌ای نویسنده و خواننده جریان. این‌ها باید به‌ترتیب رابط " +"تعریف‌شده توسط کلاس‌های پایه :class:`StreamWriter` و :class:`StreamReader` را " +"فراهم کنند. کدک‌های جریان می‌توانند وضعیت را حفظ کنند." -msgid "To simplify access to the various codec components, the module provides these additional functions which use :func:`lookup` for the codec lookup:" +msgid "" +"To simplify access to the various codec components, the module provides " +"these additional functions which use :func:`lookup` for the codec lookup:" msgstr "" +"برای ساده‌سازی دسترسی به کامپوننت‌های مختلف کدک، این ماژول این توابع اضافی را " +"فراهم می‌کند که از :func:`lookup` برای جست‌وجوی کدک استفاده می‌کنند:" -msgid "Look up the codec for the given encoding and return its encoder function." +msgid "" +"Look up the codec for the given encoding and return its encoder function." msgstr "" +"کدک (codec) مربوط به کدگذاری داده‌شده را جست‌وجو کنید و تابع کدگذار (encoder) " +"آن را برگردانید." msgid "Raises a :exc:`LookupError` in case the encoding cannot be found." -msgstr "" +msgstr "در صورتی که کدگذاری یافت نشود، یک :exc:`LookupError` پرتاب می‌کند." -msgid "Look up the codec for the given encoding and return its decoder function." +msgid "" +"Look up the codec for the given encoding and return its decoder function." msgstr "" +"کدک (codec) مربوط به کدگذاری داده‌شده را جست‌وجو می‌کند و تابع کدگشای آن را " +"برمی‌گرداند." -msgid "Look up the codec for the given encoding and return its incremental encoder class or factory function." +msgid "" +"Look up the codec for the given encoding and return its incremental encoder " +"class or factory function." msgstr "" +"کدک (codec) مربوط به کدگذاری داده‌شده را جستجو می‌کند و کلاس یا تابع کارخانه‌ی " +"کدگذار افزایشی (incremental encoder) آن را بازمی‌گرداند." -msgid "Raises a :exc:`LookupError` in case the encoding cannot be found or the codec doesn't support an incremental encoder." +msgid "" +"Raises a :exc:`LookupError` in case the encoding cannot be found or the " +"codec doesn't support an incremental encoder." msgstr "" +"در صورتی که کدگذاری یافت نشود یا کدک از کدگذار افزایشی پشتیبانی نکند، " +"استثنای :exc:`LookupError` را پرتاب می‌کند." -msgid "Look up the codec for the given encoding and return its incremental decoder class or factory function." +msgid "" +"Look up the codec for the given encoding and return its incremental decoder " +"class or factory function." msgstr "" +"کدک مربوط به کدگذاری داده‌شده را جست‌وجو می‌کند و کلاس یا تابع کارخانه‌ایٔ کدگشای " +"تدریجی آن را برمی‌گرداند." -msgid "Raises a :exc:`LookupError` in case the encoding cannot be found or the codec doesn't support an incremental decoder." +msgid "" +"Raises a :exc:`LookupError` in case the encoding cannot be found or the " +"codec doesn't support an incremental decoder." msgstr "" +"در صورتی که کدگذاری یافت نشود یا کدک از کدگشای افزایشی پشتیبانی نکند، " +"یک :exc:`LookupError` پرتاب می‌شود." -msgid "Look up the codec for the given encoding and return its :class:`StreamReader` class or factory function." +msgid "" +"Look up the codec for the given encoding and return " +"its :class:`StreamReader` class or factory function." msgstr "" +"کدک مربوط به کدگذاری داده‌شده را جست‌وجو کنید و کلاس :class:`StreamReader` یا " +"تابع کارخانه‌ای آن را برگردانید." -msgid "Look up the codec for the given encoding and return its :class:`StreamWriter` class or factory function." +msgid "" +"Look up the codec for the given encoding and return " +"its :class:`StreamWriter` class or factory function." msgstr "" +"کدک مربوط به کدگذاری داده‌شده را جستجو کنید و کلاس :class:`StreamWriter` یا " +"تابع کارخانه (factory function) آن را برگردانید." -msgid "Custom codecs are made available by registering a suitable codec search function:" -msgstr "" +msgid "" +"Custom codecs are made available by registering a suitable codec search " +"function:" +msgstr "کدک‌های سفارشی با ثبت یک تابع جستجوی کدک مناسب در دسترس قرار می‌گیرند:" -msgid "Register a codec search function. Search functions are expected to take one argument, being the encoding name in all lower case letters with hyphens and spaces converted to underscores, and return a :class:`CodecInfo` object. In case a search function cannot find a given encoding, it should return ``None``." -msgstr "" +msgid "" +"Register a codec search function. Search functions are expected to take one " +"argument, being the encoding name in all lower case letters with hyphens " +"and spaces converted to underscores, and return a :class:`CodecInfo` " +"object. In case a search function cannot find a given encoding, it should " +"return ``None``." +msgstr "" +"یک تابع جست‌وجوی کدک ثبت کنید. انتظار می‌رود توابع جست‌وجو یک آرگومان دریافت " +"کنند و یک شیء :class:`CodecInfo` برگردانند؛ این آرگومان نام کدگذاری است که " +"تماماً با حروف کوچک بوده و خط‌های تیره و فاصله‌های آن به زیرخط تبدیل شده‌اند. " +"در صورتی که یک تابع جست‌وجو نتواند کدگذاری داده‌شده را پیدا کند، باید " +"``None`` برگرداند." msgid "Hyphens and spaces are converted to underscore." -msgstr "" +msgstr "خط‌تیره‌ها و فاصله‌ها به زیرخط تبدیل می‌شوند." -msgid "Unregister a codec search function and clear the registry's cache. If the search function is not registered, do nothing." +msgid "" +"Unregister a codec search function and clear the registry's cache. If the " +"search function is not registered, do nothing." msgstr "" +"یک تابع جست‌وجوی کدک را از ثبت خارج می‌کند و نهانگاه رجیستری را پاک می‌کند. " +"اگر تابع جست‌وجو ثبت‌نشده باشد، کاری انجام نمی‌دهد." -msgid "While the builtin :func:`open` and the associated :mod:`io` module are the recommended approach for working with encoded text files, this module provides additional utility functions and classes that allow the use of a wider range of codecs when working with binary files:" +msgid "" +"While the builtin :func:`open` and the associated :mod:`io` module are the " +"recommended approach for working with encoded text files, this module " +"provides additional utility functions and classes that allow the use of a " +"wider range of codecs when working with binary files:" msgstr "" +"اگرچه تابع توکار :func:`open` و ماژول مرتبط :mod:`io` رویکرد توصیه‌شده برای " +"کار با فایل‌های متنی کدگذاری‌شده هستند، این ماژول توابع و کلاس‌های کاربردی " +"اضافی را فراهم می‌کند که امکان استفاده از طیف وسیع‌تری از کدک‌ها (codecs) را " +"هنگام کار با فایل‌های دودویی می‌دهند:" -msgid "Open an encoded file using the given *mode* and return an instance of :class:`StreamReaderWriter`, providing transparent encoding/decoding. The default file mode is ``'r'``, meaning to open the file in read mode." +msgid "" +"Open an encoded file using the given *mode* and return an instance " +"of :class:`StreamReaderWriter`, providing transparent encoding/decoding. " +"The default file mode is ``'r'``, meaning to open the file in read mode." msgstr "" +"یک فایل کدگذاری‌شده را با استفاده از *mode* داده‌شده باز می‌کند، نمونه‌ای " +"از :class:`StreamReaderWriter` برمی‌گرداند و کدگذاری/کدگشایی شفاف را فراهم " +"می‌کند. حالت پیش‌فرض فایل ``'r'`` است، به این معنا که فایل در حالت خواندن باز " +"می‌شود." -msgid "If *encoding* is not ``None``, then the underlying encoded files are always opened in binary mode. No automatic conversion of ``'\\n'`` is done on reading and writing. The *mode* argument may be any binary mode acceptable to the built-in :func:`open` function; the ``'b'`` is automatically added." +msgid "" +"If *encoding* is not ``None``, then the underlying encoded files are always " +"opened in binary mode. No automatic conversion of ``'\\n'`` is done on " +"reading and writing. The *mode* argument may be any binary mode acceptable " +"to the built-in :func:`open` function; the ``'b'`` is automatically added." msgstr "" +"اگر *encoding* برابر ``None`` نباشد، فایل‌های کدگذاری‌شده‌ی زیربنایی همیشه در " +"حالت دودویی باز می‌شوند. هیچ تبدیل خودکاری برای ``'\\n'`` هنگام خواندن و " +"نوشتن انجام نمی‌شود. آرگومان *mode* می‌تواند هر حالت دودویی قابل‌قبول برای " +"تابع توکار :func:`open` باشد؛ ``'b'`` به‌طور خودکار افزوده می‌شود." -msgid "*encoding* specifies the encoding which is to be used for the file. Any encoding that encodes to and decodes from bytes is allowed, and the data types supported by the file methods depend on the codec used." +msgid "" +"*encoding* specifies the encoding which is to be used for the file. Any " +"encoding that encodes to and decodes from bytes is allowed, and the data " +"types supported by the file methods depend on the codec used." msgstr "" +"*encoding* کدگذاری مورد استفاده برای فایل را مشخص می‌کند. هر کدگذاری که به " +"بایت کدگذاری کند و از بایت کدگشایی کند مجاز است، و نوع‌های داده‌ای که متدهای " +"فایل از آن‌ها پشتیبانی می‌کنند به کدک (codec) استفاده‌شده بستگی دارند." -msgid "*errors* may be given to define the error handling. It defaults to ``'strict'`` which causes a :exc:`ValueError` to be raised in case an encoding error occurs." +msgid "" +"*errors* may be given to define the error handling. It defaults to " +"``'strict'`` which causes a :exc:`ValueError` to be raised in case an " +"encoding error occurs." msgstr "" +"می‌توان *errors* را برای تعریف مدیریت خطا مشخص کرد. مقدار پیش‌فرض آن " +"``'strict'`` است که باعث می‌شود در صورت وقوع خطای کدگذاری، " +"یک :exc:`ValueError` پرتاب شود." -msgid "*buffering* has the same meaning as for the built-in :func:`open` function. It defaults to -1 which means that the default buffer size will be used." +msgid "" +"*buffering* has the same meaning as for the built-in :func:`open` function. " +"It defaults to -1 which means that the default buffer size will be used." msgstr "" +"*buffering* همان معنایی را دارد که در تابع توکار :func:`open` دارد. مقدار " +"پیش‌فرض آن -1 است، به این معنا که از اندازه پیش‌فرض بافر استفاده می‌شود." msgid "The ``'U'`` mode has been removed." -msgstr "" +msgstr "حالت ``'U'`` حذف شده است." msgid ":func:`codecs.open` has been superseded by :func:`open`." -msgstr "" +msgstr ":func:`codecs.open` با :func:`open` جایگزین شده است." -msgid "Return a :class:`StreamRecoder` instance, a wrapped version of *file* which provides transparent transcoding. The original file is closed when the wrapped version is closed." +msgid "" +"Return a :class:`StreamRecoder` instance, a wrapped version of *file* which " +"provides transparent transcoding. The original file is closed when the " +"wrapped version is closed." msgstr "" +"یک نمونه از :class:`StreamRecoder` برمی‌گرداند، نسخه‌ای پوششی از *file* که " +" بازکدگذاری شفاف (transcoding) را فراهم می‌کند. فایل اصلی هنگامی که نسخه " +"پوششی بسته شود، بسته می‌شود." -msgid "Data written to the wrapped file is decoded according to the given *data_encoding* and then written to the original file as bytes using *file_encoding*. Bytes read from the original file are decoded according to *file_encoding*, and the result is encoded using *data_encoding*." +msgid "" +"Data written to the wrapped file is decoded according to the given " +"*data_encoding* and then written to the original file as bytes using " +"*file_encoding*. Bytes read from the original file are decoded according to " +"*file_encoding*, and the result is encoded using *data_encoding*." msgstr "" +"داده‌های نوشته‌شده در فایل دربرگرفته‌شده، بر اساس *data_encoding* داده‌شده " +"کدگشایی می‌شوند و سپس به‌صورت بایت با استفاده از *file_encoding* در فایل اصلی " +"نوشته می‌شوند. بایت‌های خوانده‌شده از فایل اصلی، بر اساس *file_encoding* " +"کدگشایی می‌شوند و نتیجه با استفاده از *data_encoding* کدگذاری می‌شود." msgid "If *file_encoding* is not given, it defaults to *data_encoding*." msgstr "" +"اگر *file_encoding* داده نشود، مقدار پیش‌فرض آن *data_encoding* خواهد بود." -msgid "*errors* may be given to define the error handling. It defaults to ``'strict'``, which causes :exc:`ValueError` to be raised in case an encoding error occurs." +msgid "" +"*errors* may be given to define the error handling. It defaults to " +"``'strict'``, which causes :exc:`ValueError` to be raised in case an " +"encoding error occurs." msgstr "" +"می‌توان *errors* را برای تعریف مدیریت خطا مشخص کرد. مقدار پیش‌فرض آن " +"``'strict'`` است، که باعث می‌شود در صورت بروز خطای " +"کدگذاری، :exc:`ValueError` پرتاب شود." -msgid "Uses an incremental encoder to iteratively encode the input provided by *iterator*. *iterator* must yield :class:`str` objects. This function is a :term:`generator`. The *errors* argument (as well as any other keyword argument) is passed through to the incremental encoder." +msgid "" +"Uses an incremental encoder to iteratively encode the input provided by " +"*iterator*. *iterator* must yield :class:`str` objects. This function is " +"a :term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental encoder." msgstr "" +"از یک کدگذار افزایشی استفاده می‌کند تا ورودی ارائه‌شده توسط *iterator* را به‌صورت تکراری کدگذاری کند. *iterator* باید اشیای :class:`str` را yield کند. این تابع یک :term:`تولیدگر ` است. آرگومان *errors* (و همچنین هر آرگومان کلیدواژه‌ای دیگر) به کدگذار افزایشی منتقل می‌شود." -msgid "This function requires that the codec accept text :class:`str` objects to encode. Therefore it does not support bytes-to-bytes encoders such as ``base64_codec``." +msgid "" +"This function requires that the codec accept text :class:`str` objects to " +"encode. Therefore it does not support bytes-to-bytes encoders such as " +"``base64_codec``." msgstr "" +"این تابع نیاز دارد که کدک، اشیاء متنی :class:`str` را برای کدگذاری بپذیرد. " +"بنابراین از کدگذارهای بایت‌به‌بایت مانند ``base64_codec`` پشتیبانی نمی‌کند." -msgid "Uses an incremental decoder to iteratively decode the input provided by *iterator*. *iterator* must yield :class:`bytes` objects. This function is a :term:`generator`. The *errors* argument (as well as any other keyword argument) is passed through to the incremental decoder." +msgid "" +"Uses an incremental decoder to iteratively decode the input provided by " +"*iterator*. *iterator* must yield :class:`bytes` objects. This function is " +"a :term:`generator`. The *errors* argument (as well as any other keyword " +"argument) is passed through to the incremental decoder." msgstr "" +"از یک کدگشای افزایشی استفاده می‌کند تا ورودی ارائه‌شده توسط *iterator* را " +"به‌صورت تکراری کدگشایی کند. *iterator* باید اشیای :class:`bytes` را تولید " +"کند. این تابع یک :term:`تولیدگر ` است. آرگومان *errors* (و " +"همچنین هر آرگومان کلیدواژه‌ای دیگر) به کدگشای افزایشی منتقل می‌شود." -msgid "This function requires that the codec accept :class:`bytes` objects to decode. Therefore it does not support text-to-text encoders such as ``rot_13``, although ``rot_13`` may be used equivalently with :func:`iterencode`." +msgid "" +"This function requires that the codec accept :class:`bytes` objects to " +"decode. Therefore it does not support text-to-text encoders such as " +"``rot_13``, although ``rot_13`` may be used equivalently " +"with :func:`iterencode`." msgstr "" +"این تابع نیاز دارد که کدک اشیای :class:`bytes` را برای کدگشایی بپذیرد. " +"بنابراین از کدگذارهای متن‌به‌متن مانند ``rot_13`` پشتیبانی نمی‌کند، هرچند " +"می‌توان از ``rot_13`` به‌طور معادل همراه با :func:`iterencode` استفاده کرد." -msgid "Return a :class:`tuple` containing the raw bytes of *buffer*, a :ref:`buffer-compatible object ` or :class:`str` (encoded to UTF-8 before processing), and their length in bytes." +msgid "" +"Return a :class:`tuple` containing the raw bytes of *buffer*, " +"a :ref:`buffer-compatible object ` or :class:`str` (encoded " +"to UTF-8 before processing), and their length in bytes." msgstr "" +"یک :class:`tuple` شامل بایت‌های خام *buffer*، یک :ref:`شیء سازگار با بافر " +"` یا :class:`str` (که پیش از پردازش به UTF-8 کدگذاری‌شده " +"است)، و طول آن‌ها بر حسب بایت را برمی‌گرداند." msgid "The *errors* argument is ignored." -msgstr "" +msgstr "آرگومان *errors* نادیده گرفته می‌شود." msgid "" ">>> codecs.readbuffer_encode(b\"Zito\")\n" "(b'Zito', 4)" msgstr "" +">>> codecs.readbuffer_encode(b\"Zito\")\n" +"(b'Zito', 4)" -msgid "The module also provides the following constants which are useful for reading and writing to platform dependent files:" +msgid "" +"The module also provides the following constants which are useful for " +"reading and writing to platform dependent files:" msgstr "" +"این ماژول همچنین ثابت‌های زیر را فراهم می‌کند که برای خواندن و نوشتن در " +"فایل‌های وابسته به پلتفرم مفید هستند:" -msgid "These constants define various byte sequences, being Unicode byte order marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data streams to indicate the byte order used, and in UTF-8 as a Unicode signature. :const:`BOM_UTF16` is either :const:`BOM_UTF16_BE` or :const:`BOM_UTF16_LE` depending on the platform's native byte order, :const:`BOM` is an alias for :const:`BOM_UTF16`, :const:`BOM_LE` for :const:`BOM_UTF16_LE` and :const:`BOM_BE` for :const:`BOM_UTF16_BE`. The others represent the BOM in UTF-8 and UTF-32 encodings." -msgstr "" +msgid "" +"These constants define various byte sequences, being Unicode byte order " +"marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " +"streams to indicate the byte order used, and in UTF-8 as a Unicode " +"signature. :const:`BOM_UTF16` is either :const:`BOM_UTF16_BE` " +"or :const:`BOM_UTF16_LE` depending on the platform's native byte " +"order, :const:`BOM` is an alias for :const:`BOM_UTF16`, :const:`BOM_LE` " +"for :const:`BOM_UTF16_LE` and :const:`BOM_BE` for :const:`BOM_UTF16_BE`. " +"The others represent the BOM in UTF-8 and UTF-32 encodings." +msgstr "" +"این ثابت‌ها دنباله‌های بایت مختلفی را تعریف می‌کنند که نشانگرهای ترتیب بایت " +"یونیکد (BOM) برای چندین کدگذاری هستند. آن‌ها در جریان‌های داده UTF-16 و " +"UTF-32 برای نشان دادن ترتیب بایت استفاده‌شده و در UTF-8 به‌عنوان امضای یونیکد " +"به کار می‌روند. :const:`BOM_UTF16` بسته به ترتیب بایت بومی " +"سکو، :const:`BOM_UTF16_BE` یا :const:`BOM_UTF16_LE` است، :const:`BOM` نام " +"مستعاری برای :const:`BOM_UTF16`، :const:`BOM_LE` برای :const:`BOM_UTF16_LE` " +"و :const:`BOM_BE` برای :const:`BOM_UTF16_BE` است. سایر ثابت‌ها نشان‌دهنده‌ی BOM " +"در کدگذاری‌های UTF-8 و UTF-32 هستند." msgid "Codec Base Classes" -msgstr "" +msgstr "کلاس‌های پایه کدک" -msgid "The :mod:`!codecs` module defines a set of base classes which define the interfaces for working with codec objects, and can also be used as the basis for custom codec implementations." +msgid "" +"The :mod:`!codecs` module defines a set of base classes which define the " +"interfaces for working with codec objects, and can also be used as the " +"basis for custom codec implementations." msgstr "" +"ماژول :mod:`!codecs` مجموعه‌ای از کلاس‌های پایه را تعریف می‌کند که رابط‌هایی " +"برای کار با اشیای کدک تعریف می‌کنند و همچنین می‌توانند به‌عنوان مبنایی برای " +"پیاده‌سازی‌های سفارشی کدک استفاده شوند." -msgid "Each codec has to define four interfaces to make it usable as codec in Python: stateless encoder, stateless decoder, stream reader and stream writer. The stream reader and writers typically reuse the stateless encoder/decoder to implement the file protocols. Codec authors also need to define how the codec will handle encoding and decoding errors." -msgstr "" +msgid "" +"Each codec has to define four interfaces to make it usable as codec in " +"Python: stateless encoder, stateless decoder, stream reader and stream " +"writer. The stream reader and writers typically reuse the stateless encoder/" +"decoder to implement the file protocols. Codec authors also need to define " +"how the codec will handle encoding and decoding errors." +msgstr "" +"هر کدک (codec) باید چهار رابط را تعریف کند تا به‌عنوان یک کدک در پایتون قابل " +"استفاده باشد: کدگذار بدون وضعیت، کدگشای بدون وضعیت، خواننده جریان و نویسنده " +"جریان. خواننده و نویسندگان جریان معمولاً برای پیاده‌سازی پروتکل‌های فایل، " +"مجدداً از کدگذار/کدگشای بدون وضعیت استفاده می‌کنند. نویسندگان کدک همچنین باید " +"تعریف کنند که کدک چگونه خطاهای کدگذاری و کدگشایی را مدیریت خواهد کرد." msgid "Error Handlers" -msgstr "" +msgstr "هندلرهای خطا" -msgid "To simplify and standardize error handling, codecs may implement different error handling schemes by accepting the *errors* string argument:" +msgid "" +"To simplify and standardize error handling, codecs may implement different " +"error handling schemes by accepting the *errors* string argument:" msgstr "" +"برای ساده‌سازی و استانداردسازی مدیریت خطا، ممکن است کدک‌ها روش‌های مختلف " +"مدیریت خطا را با پذیرفتن آرگومان رشته‌ای *errors* پیاده‌سازی کنند:" -msgid "The following error handlers can be used with all Python :ref:`standard-encodings` codecs:" +msgid "" +"The following error handlers can be used with all Python :ref:`standard-" +"encodings` codecs:" msgstr "" +"می‌توان از هندلرهای خطای زیر با تمام کدک‌های :ref:`standard-encodings` " +"پایتون استفاده کرد:" msgid "Value" -msgstr "" +msgstr "مقدار" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``'strict'``" -msgstr "" +msgstr "``'strict'``" -msgid "Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented in :func:`strict_errors`." +msgid "" +"Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " +"in :func:`strict_errors`." msgstr "" +":exc:`UnicodeError` (یا یک زیرکلاس) را پرتاب می‌کند؛ این پیش‌فرض است. " +"در :func:`strict_errors` پیاده‌سازی شده است." msgid "``'ignore'``" -msgstr "" +msgstr "``'ignore'``" -msgid "Ignore the malformed data and continue without further notice. Implemented in :func:`ignore_errors`." +msgid "" +"Ignore the malformed data and continue without further notice. Implemented " +"in :func:`ignore_errors`." msgstr "" +"داده‌های ناهنجار را نادیده می‌گیرد و بدون اعلان بیشتر ادامه می‌یابد. " +"در :func:`ignore_errors` پیاده‌سازی شده است." msgid "``'replace'``" -msgstr "" +msgstr "``'replace'``" -msgid "Replace with a replacement marker. On encoding, use ``?`` (ASCII character). On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). Implemented in :func:`replace_errors`." +msgid "" +"Replace with a replacement marker. On encoding, use ``?`` (ASCII " +"character). On decoding, use ``�`` (U+FFFD, the official REPLACEMENT " +"CHARACTER). Implemented in :func:`replace_errors`." msgstr "" +"با یک نشانگر جایگزینی جایگزین می‌شود. هنگام کدگذاری، از ``?`` (نویسه‌ی ASCII) " +"استفاده می‌شود. هنگام کدگشایی، از ``�`` (U+FFFD، نویسه جایگزین رسمی) استفاده " +"می‌شود. در :func:`replace_errors` پیاده‌سازی شده است." msgid "``'backslashreplace'``" -msgstr "" +msgstr "``'backslashreplace'``" -msgid "Replace with backslashed escape sequences. On encoding, use hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." -msgstr "" +msgid "" +"Replace with backslashed escape sequences. On encoding, use hexadecimal " +"form of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}" +"` :samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value " +"with format :samp:`\\\\x{hh}`. Implemented " +"in :func:`backslashreplace_errors`." +msgstr "" +"با دنباله‌های خنثی‌سازی دارای بک‌اسلش جایگزین می‌کند. هنگام کدگذاری، از صورت " +"مبنای شانزده نقطه‌کد یونیکد با قالب‌های :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}" +"` :samp:`\\\\U{xxxxxxxx}` استفاده می‌کند. هنگام کدگشایی، از صورت مبنای " +"شانزده مقدار بایت با قالب :samp:`\\\\x{hh}` استفاده می‌کند. " +"در :func:`backslashreplace_errors` پیاده‌سازی شده است." msgid "``'surrogateescape'``" -msgstr "" +msgstr "``'surrogateescape'``" -msgid "On decoding, replace byte with individual surrogate code ranging from ``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same byte when the ``'surrogateescape'`` error handler is used when encoding the data. (See :pep:`383` for more.)" +msgid "" +"On decoding, replace byte with individual surrogate code ranging from " +"``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " +"byte when the ``'surrogateescape'`` error handler is used when encoding the " +"data. (See :pep:`383` for more.)" msgstr "" +"در کدگشایی، بایت با یک کد جانشین منفرد در بازه‌ی ``U+DC80`` تا ``U+DCFF`` " +"جایگزین می‌شود. سپس هرگاه برای کدگذاری داده از مدیر خطای " +"``'surrogateescape'`` استفاده شود، این کد دوباره به همان بایت تبدیل می‌شود. " +"(برای اطلاعات بیشتر :pep:`383` را ببینید.)" -msgid "The following error handlers are only applicable to encoding (within :term:`text encodings `):" +msgid "" +"The following error handlers are only applicable to encoding " +"(within :term:`text encodings `):" msgstr "" +"هندلرهای خطای زیر فقط برای کدگذاری کاربرد دارند (در :term:`کدگذاری‌های متن " +"`):" msgid "``'xmlcharrefreplace'``" -msgstr "" +msgstr "``'xmlcharrefreplace'``" -msgid "Replace with XML/HTML numeric character reference, which is a decimal form of Unicode code point with format :samp:`&#{num};`. Implemented in :func:`xmlcharrefreplace_errors`." +msgid "" +"Replace with XML/HTML numeric character reference, which is a decimal form " +"of Unicode code point with format :samp:`&#{num};`. Implemented " +"in :func:`xmlcharrefreplace_errors`." msgstr "" +"با ارجاع عددی نویسه XML/HTML جایگزین می‌شود، که نمایش مبنای ده نقطه کد " +"یونیکد با قالب :samp:`&#{num};` است. در :func:`xmlcharrefreplace_errors` " +"پیاده‌سازی شده است." msgid "``'namereplace'``" -msgstr "" +msgstr "``'namereplace'``" -msgid "Replace with ``\\N{...}`` escape sequences, what appears in the braces is the Name property from Unicode Character Database. Implemented in :func:`namereplace_errors`." +msgid "" +"Replace with ``\\N{...}`` escape sequences, what appears in the braces is " +"the Name property from Unicode Character Database. Implemented " +"in :func:`namereplace_errors`." msgstr "" +"با دنباله‌های خنثی‌سازی ``\\N{...}`` جایگزین می‌شود؛ آنچه داخل آکولادها قرار " +"دارد، ویژگی Name از پایگاه داده‌ی نویسه‌های یونیکد است. " +"در :func:`namereplace_errors` پیاده‌سازی شده است." -msgid "In addition, the following error handler is specific to the given codecs:" -msgstr "" +msgid "" +"In addition, the following error handler is specific to the given codecs:" +msgstr "علاوه بر این، هندلر خطای زیر مختص کدک‌های داده‌شده است:" msgid "Codecs" -msgstr "" +msgstr "کدک‌ها" msgid "``'surrogatepass'``" -msgstr "" +msgstr "``'surrogatepass'``" msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -msgstr "" +msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -msgid "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) as normal code point. Otherwise these codecs treat the presence of surrogate code point in :class:`str` as an error." +msgid "" +"Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " +"as normal code point. Otherwise these codecs treat the presence of " +"surrogate code point in :class:`str` as an error." msgstr "" +"اجازه‌ی کدگذاری و کدگشایی نقطه‌کد جانشین (surrogate code point) (``U+D800`` - " +"``U+DFFF``) به‌عنوان نقطه‌کد عادی را می‌دهد. در غیر این صورت، این کدک‌ها وجود " +"نقطه‌کد جانشین (surrogate code point) در :class:`str` را به‌عنوان خطا در نظر " +"می‌گیرند." msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." -msgstr "" +msgstr "هندلرهای خطای ``'surrogateescape'`` و ``'surrogatepass'``." -msgid "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* codecs." +msgid "" +"The ``'surrogatepass'`` error handler now works with utf-16\\* and " +"utf-32\\* codecs." msgstr "" +"مدیر خطای ``'surrogatepass'`` اکنون با کدک‌های utf-16\\* و utf-32\\* کار " +"می‌کند." msgid "The ``'namereplace'`` error handler." -msgstr "" +msgstr "مدیر خطای ``'namereplace'``." -msgid "The ``'backslashreplace'`` error handler now works with decoding and translating." -msgstr "" +msgid "" +"The ``'backslashreplace'`` error handler now works with decoding and " +"translating." +msgstr "مدیر خطای ``'backslashreplace'`` اکنون با کدگشایی و ترجمه کار می‌کند." -msgid "The set of allowed values can be extended by registering a new named error handler:" +msgid "" +"The set of allowed values can be extended by registering a new named error " +"handler:" msgstr "" +"مجموعه‌ی مقادیر مجاز را می‌توان با ثبت یک هندلر خطای نام‌گذاری‌شده جدید " +"گسترش داد:" -msgid "Register the error handling function *error_handler* under the name *name*. The *error_handler* argument will be called during encoding and decoding in case of an error, when *name* is specified as the errors parameter." +msgid "" +"Register the error handling function *error_handler* under the name *name*. " +"The *error_handler* argument will be called during encoding and decoding in " +"case of an error, when *name* is specified as the errors parameter." msgstr "" +"تابع مدیریت خطای *error_handler* را با نام *name* ثبت کنید. آرگومان " +"*error_handler* در هنگام کدگذاری و کدگشایی در صورت بروز خطا، زمانی که " +"*name* به‌عنوان پارامتر errors مشخص شده باشد، فراخوانی می‌شود." -msgid "For encoding, *error_handler* will be called with a :exc:`UnicodeEncodeError` instance, which contains information about the location of the error. The error handler must either raise this or a different exception, or return a tuple with a replacement for the unencodable part of the input and a position where encoding should continue. The replacement may be either :class:`str` or :class:`bytes`. If the replacement is bytes, the encoder will simply copy them into the output buffer. If the replacement is a string, the encoder will encode the replacement. Encoding continues on original input at the specified position. Negative position values will be treated as being relative to the end of the input string. If the resulting position is out of bound an :exc:`IndexError` will be raised." -msgstr "" +msgid "" +"For encoding, *error_handler* will be called with " +"a :exc:`UnicodeEncodeError` instance, which contains information about the " +"location of the error. The error handler must either raise this or a " +"different exception, or return a tuple with a replacement for the " +"unencodable part of the input and a position where encoding should " +"continue. The replacement may be either :class:`str` or :class:`bytes`. If " +"the replacement is bytes, the encoder will simply copy them into the output " +"buffer. If the replacement is a string, the encoder will encode the " +"replacement. Encoding continues on original input at the specified " +"position. Negative position values will be treated as being relative to the " +"end of the input string. If the resulting position is out of bound " +"an :exc:`IndexError` will be raised." +msgstr "" +"در کدگذاری، *error_handler* با نمونه‌ای از :exc:`UnicodeEncodeError` " +"فراخوانی می‌شود که شامل اطلاعاتی درباره‌ی محل خطا است. مدیر خطا باید یا این " +"استثنا یا استثنای دیگری را پرتاب کند، یا تاپلی برگرداند که شامل جایگزینی " +"برای بخش غیرقابل کدگذاری ورودی و موقعیتی است که کدگذاری باید از آن ادامه " +"یابد. جایگزین می‌تواند :class:`str` یا :class:`bytes` باشد. اگر جایگزین " +"bytes باشد، کدگذار به‌سادگی آن‌ها را در بافر خروجی کپی می‌کند. اگر جایگزین یک " +"رشته باشد، کدگذار جایگزین را کدگذاری می‌کند. کدگذاری روی ورودی اصلی در " +"موقعیت مشخص‌شده ادامه می‌یابد. مقادیر منفی موقعیت نسبت به پایان رشته ورودی در " +"نظر گرفته می‌شوند. اگر موقعیت حاصل خارج از محدوده باشد، یک :exc:`IndexError` " +"پرتاب خواهد شد." -msgid "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` or :exc:`UnicodeTranslateError` will be passed to the handler and that the replacement from the error handler will be put into the output directly." +msgid "" +"Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " +"or :exc:`UnicodeTranslateError` will be passed to the handler and that the " +"replacement from the error handler will be put into the output directly." msgstr "" +"کدگشایی و ترجمه به‌صورت مشابه عمل می‌کنند، با این تفاوت " +"که :exc:`UnicodeDecodeError` یا :exc:`UnicodeTranslateError` به هندلر " +"(handler) ارسال می‌شود و مقدار جایگزین حاصل از هندلر خطا مستقیماً در " +"خروجی قرار می‌گیرد." -msgid "Previously registered error handlers (including the standard error handlers) can be looked up by name:" +msgid "" +"Previously registered error handlers (including the standard error " +"handlers) can be looked up by name:" msgstr "" +"هندلرهای خطای پیش‌تر ثبت‌شده (از جمله هندلرهای خطای استاندارد) را " +"می‌توان با نام جست‌وجو کرد:" msgid "Return the error handler previously registered under the name *name*." -msgstr "" +msgstr "مدیر خطایی را که پیش‌تر با نام *name* ثبت شده است، برمی‌گرداند." msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" +"در صورتی که مدیر (handler) یافت نشود، استثنای :exc:`LookupError` پرتاب " +"می‌شود." -msgid "The following standard error handlers are also made available as module level functions:" +msgid "" +"The following standard error handlers are also made available as module " +"level functions:" msgstr "" +"هندلرهای خطای استاندارد زیر نیز به‌عنوان توابع سطح ماژول در دسترس قرار " +"گرفته‌اند:" msgid "Implements the ``'strict'`` error handling." -msgstr "" +msgstr "مدیریت خطای ``'strict'`` را پیاده‌سازی می‌کند." msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." -msgstr "" +msgstr "هر خطای کدگذاری یا کدگشایی یک :exc:`UnicodeError` پرتاب می‌کند." msgid "Implements the ``'ignore'`` error handling." -msgstr "" +msgstr "مدیریت خطای ``'ignore'`` را پیاده‌سازی می‌کند." -msgid "Malformed data is ignored; encoding or decoding is continued without further notice." +msgid "" +"Malformed data is ignored; encoding or decoding is continued without " +"further notice." msgstr "" +"داده‌های نامعتبر نادیده گرفته می‌شوند؛ کدگذاری یا کدگشایی بدون اطلاع بیشتر " +"ادامه می‌یابد." msgid "Implements the ``'replace'`` error handling." -msgstr "" +msgstr "مدیریت خطای ``'replace'`` را پیاده‌سازی می‌کند." -msgid "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, the official REPLACEMENT CHARACTER) for decoding errors." +msgid "" +"Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " +"the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" +"در خطاهای کدگذاری، ``?`` (نویسه ASCII) یا در خطاهای کدگشایی، ``�`` (U+FFFD، " +"نویسه جایگزین رسمی) را جایگزین می‌کند." msgid "Implements the ``'backslashreplace'`` error handling." -msgstr "" +msgstr "مدیریت خطای ``'backslashreplace'`` را پیاده‌سازی می‌کند." -msgid "Malformed data is replaced by a backslashed escape sequence. On encoding, use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the hexadecimal form of byte value with format :samp:`\\\\x{hh}`." +msgid "" +"Malformed data is replaced by a backslashed escape sequence. On encoding, " +"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " +"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" +"داده‌های نامعتبر با یک دنباله خنثی‌سازی با بک‌اسلش جایگزین می‌شوند. هنگام " +"کدگذاری، از صورت مبنای شانزدهِ نقطه کد Unicode با قالب‌های :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}` استفاده می‌شود. هنگام کدگشایی، " +"از صورت مبنای شانزدهِ مقدار بایت با قالب :samp:`\\\\x{hh}` استفاده می‌شود." msgid "Works with decoding and translating." -msgstr "" +msgstr "با کدگشایی و ترجمه کار می‌کند." -msgid "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :term:`text encoding` only)." +msgid "" +"Implements the ``'xmlcharrefreplace'`` error handling (for encoding " +"within :term:`text encoding` only)." msgstr "" +"مدیریت خطای ``'xmlcharrefreplace'`` را پیاده‌سازی می‌کند (فقط برای کدگذاری " +"در :term:`text encoding`)." -msgid "The unencodable character is replaced by an appropriate XML/HTML numeric character reference, which is a decimal form of Unicode code point with format :samp:`&#{num};` ." +msgid "" +"The unencodable character is replaced by an appropriate XML/HTML numeric " +"character reference, which is a decimal form of Unicode code point with " +"format :samp:`&#{num};` ." msgstr "" +"نویسه‌ی غیرقابل کدگذاری با یک ارجاع عددی نویسه مناسب XML/HTML جایگزین می‌شود، " +"که نمایش مبنای ده نقطه کد یونیکد در قالب :samp:`&#{num};` است." -msgid "Implements the ``'namereplace'`` error handling (for encoding within :term:`text encoding` only)." +msgid "" +"Implements the ``'namereplace'`` error handling (for encoding " +"within :term:`text encoding` only)." msgstr "" +"مدیریت خطای ``'namereplace'`` را پیاده‌سازی می‌کند (فقط برای کدگذاری " +"درون :term:`text encoding`)." -msgid "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The set of characters that appear in the braces is the Name property from Unicode Character Database. For example, the German lowercase letter ``'ß'`` will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." -msgstr "" +msgid "" +"The unencodable character is replaced by a ``\\N{...}`` escape sequence. " +"The set of characters that appear in the braces is the Name property from " +"Unicode Character Database. For example, the German lowercase letter " +"``'ß'`` will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}" +"`` ." +msgstr "" +"نویسه غیرقابل کدگذاری با یک دنباله‌ی خنثی‌سازی ``\\N{...}`` جایگزین می‌شود. " +"مجموعه‌ی نویسه‌هایی که بین آکولادها قرار دارند، ویژگی Name از پایگاه داده‌ی " +"نویسه‌های یونیکد (Unicode Character Database) است. برای مثال، حرف کوچک " +"آلمانی ``'ß'`` به دنباله‌ی بایت ``\\N{LATIN SMALL LETTER SHARP S}`` تبدیل " +"می‌شود." msgid "Stateless Encoding and Decoding" -msgstr "" +msgstr "کدگذاری و کدگشایی بی‌وضعیت" -msgid "The base :class:`Codec` class defines these methods which also define the function interfaces of the stateless encoder and decoder:" +msgid "" +"The base :class:`Codec` class defines these methods which also define the " +"function interfaces of the stateless encoder and decoder:" msgstr "" +"کلاس پایه‌ی :class:`Codec` این متدها را تعریف می‌کند که رابط‌های تابعی کدگذار و " +"کدگشای بی‌وضعیت را نیز تعریف می‌کنند:" -msgid "Encodes the object *input* and returns a tuple (output object, length consumed). For instance, :term:`text encoding` converts a string object to a bytes object using a particular character set encoding (e.g., ``cp1252`` or ``iso-8859-1``)." +msgid "" +"Encodes the object *input* and returns a tuple (output object, length " +"consumed). For instance, :term:`text encoding` converts a string object to " +"a bytes object using a particular character set encoding (e.g., ``cp1252`` " +"or ``iso-8859-1``)." msgstr "" +"شیء *input* را کدگذاری می‌کند و یک تاپل (شیء خروجی، طول مصرف‌شده) برمی‌گرداند. " +"برای مثال، :term:`کدگذاری متن ` یک شیء رشته را با استفاده از " +"یک کدگذاری مجموعه نویسه خاص به یک شیء bytes تبدیل می‌کند (مثلاً ``cp1252`` یا " +"``iso-8859-1``)." -msgid "The *errors* argument defines the error handling to apply. It defaults to ``'strict'`` handling." +msgid "" +"The *errors* argument defines the error handling to apply. It defaults to " +"``'strict'`` handling." msgstr "" +"آرگومان *errors* مدیریت خطای قابل اعمال را تعریف می‌کند. مقدار پیش‌فرض آن " +"مدیریت ``'strict'`` است." -msgid "The method may not store state in the :class:`Codec` instance. Use :class:`StreamWriter` for codecs which have to keep state in order to make encoding efficient." +msgid "" +"The method may not store state in the :class:`Codec` instance. " +"Use :class:`StreamWriter` for codecs which have to keep state in order to " +"make encoding efficient." msgstr "" +"این متد نباید وضعیت را در نمونه‌ی :class:`Codec` ذخیره کند. برای کدک‌هایی که " +"باید وضعیت را به‌منظور کارآمد کردن کدگذاری حفظ کنند، " +"از :class:`StreamWriter` استفاده کنید." -msgid "The encoder must be able to handle zero length input and return an empty object of the output object type in this situation." +msgid "" +"The encoder must be able to handle zero length input and return an empty " +"object of the output object type in this situation." msgstr "" +"کدگذار باید بتواند ورودی با طول صفر را مدیریت کند و در این شرایط، یک شیء " +"خالی از نوع شیء خروجی را برگرداند." -msgid "Decodes the object *input* and returns a tuple (output object, length consumed). For instance, for a :term:`text encoding`, decoding converts a bytes object encoded using a particular character set encoding to a string object." +msgid "" +"Decodes the object *input* and returns a tuple (output object, length " +"consumed). For instance, for a :term:`text encoding`, decoding converts a " +"bytes object encoded using a particular character set encoding to a string " +"object." msgstr "" +"شیء *input* را کدگشایی می‌کند و یک تاپل (شیء خروجی، طول مصرف‌شده) را " +"برمی‌گرداند. برای مثال، برای یک :term:`کدگذاری متن `، کدگشایی " +"یک شیء bytes را که با استفاده از یک کدگذاری مجموعه نویسه خاص کدگذاری شده " +"است، به یک شیء رشته تبدیل می‌کند." -msgid "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object or one which provides the read-only buffer interface -- for example, buffer objects and memory mapped files." +msgid "" +"For text encodings and bytes-to-bytes codecs, *input* must be a bytes " +"object or one which provides the read-only buffer interface -- for example, " +"buffer objects and memory mapped files." msgstr "" +"برای کدگذاری‌های متنی و کدک‌های بایت‌به‌بایت (bytes-to-bytes)، *input* باید یک " +"شیء bytes یا شیء‌ای باشد که رابط بافر فقط‌خواندنی را فراهم می‌کند -- برای " +"مثال، اشیای بافر و فایل‌های نگاشت‌شده به حافظه." -msgid "The method may not store state in the :class:`Codec` instance. Use :class:`StreamReader` for codecs which have to keep state in order to make decoding efficient." +msgid "" +"The method may not store state in the :class:`Codec` instance. " +"Use :class:`StreamReader` for codecs which have to keep state in order to " +"make decoding efficient." msgstr "" +"این متد نباید وضعیت را در نمونه‌ی :class:`Codec` ذخیره کند. برای کدک‌هایی که " +"باید برای کارآمد کردن کدگشایی وضعیت را نگه دارند، از :class:`StreamReader` " +"استفاده کنید." -msgid "The decoder must be able to handle zero length input and return an empty object of the output object type in this situation." +msgid "" +"The decoder must be able to handle zero length input and return an empty " +"object of the output object type in this situation." msgstr "" +"کدگشا باید بتواند ورودی با طول صفر را مدیریت کند و در این شرایط، یک شیء " +"خالی از نوع شیء خروجی را برگرداند." msgid "Incremental Encoding and Decoding" -msgstr "" +msgstr "کدگذاری و کدگشایی تدریجی" -msgid "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes provide the basic interface for incremental encoding and decoding. Encoding/decoding the input isn't done with one call to the stateless encoder/decoder function, but with multiple calls to the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` method of the incremental encoder/decoder. The incremental encoder/decoder keeps track of the encoding/decoding process during method calls." -msgstr "" +msgid "" +"The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " +"provide the basic interface for incremental encoding and decoding. Encoding/" +"decoding the input isn't done with one call to the stateless encoder/" +"decoder function, but with multiple calls to " +"the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " +"method of the incremental encoder/decoder. The incremental encoder/decoder " +"keeps track of the encoding/decoding process during method calls." +msgstr "" +"کلاس‌های :class:`IncrementalEncoder` و :class:`IncrementalDecoder` رابط پایه " +"را برای کدگذاری و کدگشایی افزایشی فراهم می‌کنند. کدگذاری/کدگشایی ورودی با یک " +"فراخوانی تابع کدگذار/کدگشای بدون وضعیت انجام نمی‌شود، بلکه با چندین فراخوانی " +"متد :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " +"از کدگذار/کدگشای افزایشی انجام می‌شود. کدگذار/کدگشای افزایشی فرایند کدگذاری/" +"کدگشایی را در طول فراخوانی‌های متد پیگیری می‌کند." -msgid "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` method is the same as if all the single inputs were joined into one, and this input was encoded/decoded with the stateless encoder/decoder." +msgid "" +"The joined output of calls to " +"the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " +"method is the same as if all the single inputs were joined into one, and " +"this input was encoded/decoded with the stateless encoder/decoder." msgstr "" +"خروجی به‌هم‌پیوسته‌ی فراخوانی‌های " +"متد :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " +"همان است که گویی همه‌ی ورودی‌های منفرد به یک ورودی پیوسته شده باشند و این " +"ورودی با کدگذار/کدگشای بی‌وضعیت کدگذاری/کدگشایی شده باشد." msgid "IncrementalEncoder Objects" -msgstr "" +msgstr "اشیاء IncrementalEncoder" -msgid "The :class:`IncrementalEncoder` class is used for encoding an input in multiple steps. It defines the following methods which every incremental encoder must define in order to be compatible with the Python codec registry." +msgid "" +"The :class:`IncrementalEncoder` class is used for encoding an input in " +"multiple steps. It defines the following methods which every incremental " +"encoder must define in order to be compatible with the Python codec " +"registry." msgstr "" +"کلاس :class:`IncrementalEncoder` برای کدگذاری یک ورودی در چندین مرحله " +"استفاده می‌شود. این کلاس متدهای زیر را تعریف می‌کند که هر کدگذار افزایشی باید " +"برای سازگاری با ثبت کدک پایتون (Python codec registry) آن‌ها را تعریف کند." msgid "Constructor for an :class:`IncrementalEncoder` instance." -msgstr "" +msgstr "سازنده برای یک نمونه از :class:`IncrementalEncoder`." -msgid "All incremental encoders must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry." +msgid "" +"All incremental encoders must provide this constructor interface. They are " +"free to add additional keyword arguments, but only the ones defined here " +"are used by the Python codec registry." msgstr "" +"تمام کدگذارهای افزایشی باید این رابط سازنده را فراهم کنند. آن‌ها می‌توانند " +"آرگومان‌های کلیدواژه‌ای بیشتری را اضافه کنند، اما تنها آن‌هایی که در اینجا " +"تعریف‌شده‌اند توسط رجیستری کدک پایتون به کار می‌روند." -msgid "The :class:`IncrementalEncoder` may implement different error handling schemes by providing the *errors* keyword argument. See :ref:`error-handlers` for possible values." +msgid "" +"The :class:`IncrementalEncoder` may implement different error handling " +"schemes by providing the *errors* keyword argument. See :ref:`error-" +"handlers` for possible values." msgstr "" +":class:`IncrementalEncoder` می‌تواند با ارائه‌ی آرگومان کلیدواژه‌ای *errors*، " +"روش‌های مختلف مدیریت خطا را پیاده‌سازی کند. برای مقادیر ممکن، :ref:`error-" +"handlers` را ببینید." -msgid "The *errors* argument will be assigned to an attribute of the same name. Assigning to this attribute makes it possible to switch between different error handling strategies during the lifetime of the :class:`IncrementalEncoder` object." +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of " +"the :class:`IncrementalEncoder` object." msgstr "" +"آرگومان *errors* به یک ویژگی هم‌نام اختصاص داده می‌شود. اختصاص دادن به این " +"ویژگی، امکان جابه‌جایی بین راهبردهای مختلف مدیریت خطا را در طول عمر " +"شیء :class:`IncrementalEncoder` فراهم می‌کند." -msgid "Encodes *object* (taking the current state of the encoder into account) and returns the resulting encoded object. If this is the last call to :meth:`encode` *final* must be true (the default is false)." +msgid "" +"Encodes *object* (taking the current state of the encoder into account) and " +"returns the resulting encoded object. If this is the last call " +"to :meth:`encode` *final* must be true (the default is false)." msgstr "" +"*object* را کدگذاری می‌کند (با در نظر گرفتن وضعیت فعلی کدگذار) و شیء " +"کدگذاری‌شده‌ی حاصل را بازمی‌گرداند. اگر این آخرین فراخوانی :meth:`encode` باشد، " +"*final* باید true باشد (پیش‌فرض false است)." -msgid "Reset the encoder to the initial state. The output is discarded: call ``.encode(object, final=True)``, passing an empty byte or text string if necessary, to reset the encoder and to get the output." +msgid "" +"Reset the encoder to the initial state. The output is discarded: call " +"``.encode(object, final=True)``, passing an empty byte or text string if " +"necessary, to reset the encoder and to get the output." msgstr "" +"کدگذار را به وضعیت اولیه بازنشانی کنید. خروجی دور ریخته می‌شود: " +"``.encode(object, final=True)`` را فراخوانی کنید و در صورت نیاز، یک رشته " +"بایتی یا متنی خالی را ارسال کنید تا کدگذار بازنشانی شود و خروجی دریافت شود." -msgid "Return the current state of the encoder which must be an integer. The implementation should make sure that ``0`` is the most common state. (States that are more complicated than integers can be converted into an integer by marshaling/pickling the state and encoding the bytes of the resulting string into an integer.)" +msgid "" +"Return the current state of the encoder which must be an integer. The " +"implementation should make sure that ``0`` is the most common state. " +"(States that are more complicated than integers can be converted into an " +"integer by marshaling/pickling the state and encoding the bytes of the " +"resulting string into an integer.)" msgstr "" +"وضعیت فعلی رمزگذار را برمی‌گرداند که باید یک عدد صحیح باشد. پیاده‌سازی باید " +"اطمینان حاصل کند که ``0`` رایج‌ترین وضعیت است. (وضعیت‌هایی که از اعداد صحیح " +"پیچیده‌تر هستند، می‌توانند با مارشال/پیکل کردن (marshaling/pickling) وضعیت و " +"کدگذاری بایت‌های رشته حاصل به یک عدد صحیح تبدیل شوند.)" -msgid "Set the state of the encoder to *state*. *state* must be an encoder state returned by :meth:`getstate`." +msgid "" +"Set the state of the encoder to *state*. *state* must be an encoder state " +"returned by :meth:`getstate`." msgstr "" +"وضعیت کدگذار را روی *state* تنظیم کنید. *state* باید یک وضعیت کدگذار باشد " +"که توسط :meth:`getstate` برگردانده شده است." msgid "IncrementalDecoder Objects" -msgstr "" +msgstr "اشیاء IncrementalDecoder" -msgid "The :class:`IncrementalDecoder` class is used for decoding an input in multiple steps. It defines the following methods which every incremental decoder must define in order to be compatible with the Python codec registry." +msgid "" +"The :class:`IncrementalDecoder` class is used for decoding an input in " +"multiple steps. It defines the following methods which every incremental " +"decoder must define in order to be compatible with the Python codec " +"registry." msgstr "" +"کلاس :class:`IncrementalDecoder` برای کدگشایی یک ورودی در چند مرحله استفاده " +"می‌شود. این کلاس متدهای زیر را تعریف می‌کند که هر کدگشای افزایشی باید برای " +"سازگاری با رجیستری کدک پایتون (Python codec registry) آن‌ها را تعریف کند." msgid "Constructor for an :class:`IncrementalDecoder` instance." -msgstr "" +msgstr "سازنده‌ی یک نمونه از :class:`IncrementalDecoder`." -msgid "All incremental decoders must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry." +msgid "" +"All incremental decoders must provide this constructor interface. They are " +"free to add additional keyword arguments, but only the ones defined here " +"are used by the Python codec registry." msgstr "" +"همه کدگشاهای تدریجی باید این رابط سازنده را فراهم کنند. آن‌ها می‌توانند " +"آرگومان‌های کلیدواژه‌ای بیشتری اضافه کنند، اما رجیستری کدک پایتون تنها از " +"آن‌هایی که در اینجا تعریف‌شده‌اند استفاده می‌کند." -msgid "The :class:`IncrementalDecoder` may implement different error handling schemes by providing the *errors* keyword argument. See :ref:`error-handlers` for possible values." +msgid "" +"The :class:`IncrementalDecoder` may implement different error handling " +"schemes by providing the *errors* keyword argument. See :ref:`error-" +"handlers` for possible values." msgstr "" +":class:`IncrementalDecoder` می‌تواند با ارائه آرگومان کلیدواژه‌ای *errors*، " +"روش‌های مختلف مدیریت خطا را پیاده‌سازی کند. برای مقادیر ممکن، :ref:`error-" +"handlers` را ببینید." -msgid "The *errors* argument will be assigned to an attribute of the same name. Assigning to this attribute makes it possible to switch between different error handling strategies during the lifetime of the :class:`IncrementalDecoder` object." +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of " +"the :class:`IncrementalDecoder` object." msgstr "" +"آرگومان *errors* به ویژگی‌ای با همین نام اختصاص داده می‌شود. اختصاص دادن به " +"این ویژگی امکان جابه‌جایی بین راهبردهای مختلف مدیریت خطا را در طول عمر " +"شیء :class:`IncrementalDecoder` فراهم می‌کند." -msgid "Decodes *object* (taking the current state of the decoder into account) and returns the resulting decoded object. If this is the last call to :meth:`decode` *final* must be true (the default is false). If *final* is true the decoder must decode the input completely and must flush all buffers. If this isn't possible (e.g. because of incomplete byte sequences at the end of the input) it must initiate error handling just like in the stateless case (which might raise an exception)." -msgstr "" +msgid "" +"Decodes *object* (taking the current state of the decoder into account) and " +"returns the resulting decoded object. If this is the last call " +"to :meth:`decode` *final* must be true (the default is false). If *final* " +"is true the decoder must decode the input completely and must flush all " +"buffers. If this isn't possible (e.g. because of incomplete byte sequences " +"at the end of the input) it must initiate error handling just like in the " +"stateless case (which might raise an exception)." +msgstr "" +"*object* را کدگشایی می‌کند (وضعیت فعلی کدگشا را در نظر می‌گیرد) و شیء " +"کدگشایی‌شده‌ی حاصل را برمی‌گرداند. اگر این آخرین فراخوانی :meth:`decode` باشد، " +"*final* باید true باشد (پیش‌فرض false است). اگر *final* برابر true باشد، " +"کدگشا باید ورودی را به‌طور کامل کدگشایی کند و تمام بافرها را تخلیه کند. اگر " +"این کار ممکن نباشد (مثلاً به دلیل دنباله‌های ناقص بایت در پایان ورودی)، باید " +"مدیریت خطا را دقیقاً مانند حالت بی‌وضعیت (stateless) آغاز کند (که ممکن است " +"استثنایی را پرتاب کند)." msgid "Reset the decoder to the initial state." -msgstr "" +msgstr "کدگشا را به وضعیت اولیه بازنشانی کنید." -msgid "Return the current state of the decoder. This must be a tuple with two items, the first must be the buffer containing the still undecoded input. The second must be an integer and can be additional state info. (The implementation should make sure that ``0`` is the most common additional state info.) If this additional state info is ``0`` it must be possible to set the decoder to the state which has no input buffered and ``0`` as the additional state info, so that feeding the previously buffered input to the decoder returns it to the previous state without producing any output. (Additional state info that is more complicated than integers can be converted into an integer by marshaling/pickling the info and encoding the bytes of the resulting string into an integer.)" -msgstr "" +msgid "" +"Return the current state of the decoder. This must be a tuple with two " +"items, the first must be the buffer containing the still undecoded input. " +"The second must be an integer and can be additional state info. (The " +"implementation should make sure that ``0`` is the most common additional " +"state info.) If this additional state info is ``0`` it must be possible to " +"set the decoder to the state which has no input buffered and ``0`` as the " +"additional state info, so that feeding the previously buffered input to the " +"decoder returns it to the previous state without producing any output. " +"(Additional state info that is more complicated than integers can be " +"converted into an integer by marshaling/pickling the info and encoding the " +"bytes of the resulting string into an integer.)" +msgstr "" +"وضعیت کنونی کدگشا را برمی‌گرداند. این باید یک تاپل با دو آیتم باشد؛ نخستین " +"آیتم باید بافر حاوی ورودی هنوز کدگشایی‌نشده باشد. دومین آیتم باید یک عدد " +"صحیح باشد و می‌تواند اطلاعات وضعیت اضافی باشد. (پیاده‌سازی باید اطمینان حاصل " +"کند که ``0`` رایج‌ترین اطلاعات وضعیت اضافی است.) اگر این اطلاعات وضعیت اضافی " +"``0`` باشد، باید بتوان کدگشا را در وضعیتی قرار داد که هیچ ورودی‌ای در بافر " +"نداشته باشد و اطلاعات وضعیت اضافی آن ``0`` باشد، تا دادن ورودی از پیش در " +"بافر قرار گرفته به کدگشا آن را بدون تولید هیچ خروجی به وضعیت پیشین " +"بازگرداند. (اطلاعات وضعیت اضافی که پیچیده‌تر از اعداد صحیح باشد را می‌توان با " +"مارشال‌کردن (marshaling) یا پیکل‌کردن (pickling) اطلاعات و کدگذاری بایت‌های " +"رشته حاصل به یک عدد صحیح، به یک عدد صحیح تبدیل کرد.)" -msgid "Set the state of the decoder to *state*. *state* must be a decoder state returned by :meth:`getstate`." +msgid "" +"Set the state of the decoder to *state*. *state* must be a decoder state " +"returned by :meth:`getstate`." msgstr "" +"وضعیت کدگشا را روی *state* تنظیم کنید. *state* باید یک وضعیت کدگشا باشد " +"که :meth:`getstate` آن را برمی‌گرداند." msgid "Stream Encoding and Decoding" -msgstr "" +msgstr "کدگذاری و کدگشایی جریان" -msgid "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic working interfaces which can be used to implement new encoding submodules very easily. See :mod:`!encodings.utf_8` for an example of how this is done." +msgid "" +"The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " +"working interfaces which can be used to implement new encoding submodules " +"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" +"کلاس‌های :class:`StreamWriter` و :class:`StreamReader` رابط‌های کاری عامی " +"فراهم می‌کنند که می‌توان از آن‌ها برای پیاده‌سازی زیرماژول‌های جدید کدگذاری " +"به‌صورت بسیار آسان استفاده کرد. برای مشاهده نمونه‌ای از چگونگی انجام این " +"کار، :mod:`!encodings.utf_8` را ببینید." msgid "StreamWriter Objects" -msgstr "" +msgstr "اشیای StreamWriter" -msgid "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines the following methods which every stream writer must define in order to be compatible with the Python codec registry." +msgid "" +"The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " +"the following methods which every stream writer must define in order to be " +"compatible with the Python codec registry." msgstr "" +"کلاس :class:`StreamWriter` یک زیرکلاس از :class:`Codec` است و متدهای زیر را " +"تعریف می‌کند که هر نویسنده‌ی جریان (stream writer) باید آن‌ها را تعریف کند تا " +"با رجیستری کدک پایتون (Python codec registry) سازگار باشد." msgid "Constructor for a :class:`StreamWriter` instance." -msgstr "" +msgstr "سازنده برای یک نمونه از :class:`StreamWriter`." -msgid "All stream writers must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry." +msgid "" +"All stream writers must provide this constructor interface. They are free " +"to add additional keyword arguments, but only the ones defined here are " +"used by the Python codec registry." msgstr "" +"همه‌ی نویسنده‌های جریان باید این رابط سازنده را فراهم کنند. آن‌ها آزادند " +"آرگومان‌های کلیدواژه‌ای بیشتری اضافه کنند، اما رجیستری کدک پایتون تنها از " +"آن‌هایی استفاده می‌کند که در اینجا تعریف شده‌اند." -msgid "The *stream* argument must be a file-like object open for writing text or binary data, as appropriate for the specific codec." +msgid "" +"The *stream* argument must be a file-like object open for writing text or " +"binary data, as appropriate for the specific codec." msgstr "" +"آرگومان *stream* باید یک شیء فایل‌مانند باشد که برای نوشتن متن یا داده‌های " +"دودویی، متناسب با کدک مشخص، باز شده باشد." -msgid "The :class:`StreamWriter` may implement different error handling schemes by providing the *errors* keyword argument. See :ref:`error-handlers` for the standard error handlers the underlying stream codec may support." +msgid "" +"The :class:`StreamWriter` may implement different error handling schemes by " +"providing the *errors* keyword argument. See :ref:`error-handlers` for the " +"standard error handlers the underlying stream codec may support." msgstr "" +":class:`StreamWriter` می‌تواند با ارائه آرگومان کلیدواژه‌ای *errors*، روش‌های " +"مختلفی برای مدیریت خطا را پیاده‌سازی کند. برای هندلرهای خطای استانداردی که " +"کدک جریان زیرین ممکن است از آن‌ها پشتیبانی کند، :ref:`error-handlers` را " +"ببینید." -msgid "The *errors* argument will be assigned to an attribute of the same name. Assigning to this attribute makes it possible to switch between different error handling strategies during the lifetime of the :class:`StreamWriter` object." +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:`StreamWriter` " +"object." msgstr "" +"آرگومان *errors* به ویژگی‌ای به همین نام منتسب می‌شود. انتساب به این ویژگی " +"امکان جابه‌جایی بین شیوه‌های مختلف مدیریت خطا را در طول عمر " +"شیء :class:`StreamWriter` فراهم می‌کند." msgid "Writes the object's contents encoded to the stream." -msgstr "" +msgstr "محتوای شیء را به‌صورت کدگذاری‌شده در جریان می‌نویسد." -msgid "Writes the concatenated iterable of strings to the stream (possibly by reusing the :meth:`write` method). Infinite or very large iterables are not supported. The standard bytes-to-bytes codecs do not support this method." +msgid "" +"Writes the concatenated iterable of strings to the stream (possibly by " +"reusing the :meth:`write` method). Infinite or very large iterables are not " +"supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" +"رشته‌های به‌هم‌پیوسته‌ی یک پیمایش‌پذیر را در جریان می‌نویسد (احتمالاً با استفاده‌ی " +"مجدد از متد :meth:`write`). پیمایش‌پذیرهای بی‌نهایت یا بسیار بزرگ پشتیبانی " +"نمی‌شوند. کدک‌های استاندارد بایت-به-بایت از این متد پشتیبانی نمی‌کنند." msgid "Resets the codec buffers used for keeping internal state." msgstr "" +"بافرهای کدک (codec) را که برای نگه‌داری وضعیت داخلی به کار می‌روند، بازنشانی " +"می‌کند." -msgid "Calling this method should ensure that the data on the output is put into a clean state that allows appending of new fresh data without having to rescan the whole stream to recover state." +msgid "" +"Calling this method should ensure that the data on the output is put into a " +"clean state that allows appending of new fresh data without having to " +"rescan the whole stream to recover state." msgstr "" +"فراخوانی این متد باید تضمین کند که داده‌های خروجی در وضعیت پاکی قرار " +"می‌گیرند، به‌گونه‌ای که افزودن داده‌های تازه بدون نیاز به بازبینی مجدد کل جریان " +"برای بازیابی وضعیت ممکن باشد." -msgid "In addition to the above methods, the :class:`StreamWriter` must also inherit all other methods and attributes from the underlying stream." +msgid "" +"In addition to the above methods, the :class:`StreamWriter` must also " +"inherit all other methods and attributes from the underlying stream." msgstr "" +"علاوه بر متدهای فوق، :class:`StreamWriter` همچنین باید تمام متدها و " +"ویژگی‌های دیگر را از جریان زیرین به ارث ببرد." msgid "StreamReader Objects" -msgstr "" +msgstr "اشیاء StreamReader" -msgid "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines the following methods which every stream reader must define in order to be compatible with the Python codec registry." +msgid "" +"The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " +"the following methods which every stream reader must define in order to be " +"compatible with the Python codec registry." msgstr "" +"کلاس :class:`StreamReader` زیرکلاسی از :class:`Codec` است و متدهای زیر را " +"تعریف می‌کند که هر خواننده جریانی (stream reader) باید آن‌ها را تعریف کند تا " +"با رجیستری کدک پایتون (Python codec registry) سازگار باشد." msgid "Constructor for a :class:`StreamReader` instance." -msgstr "" +msgstr "سازنده‌ای برای یک نمونه از :class:`StreamReader`." -msgid "All stream readers must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry." +msgid "" +"All stream readers must provide this constructor interface. They are free " +"to add additional keyword arguments, but only the ones defined here are " +"used by the Python codec registry." msgstr "" +"تمام خواننده‌های جریان باید این رابط سازنده را ارائه کنند. آن‌ها آزادند " +"آرگومان‌های کلیدواژه‌ای بیشتری اضافه کنند، اما رجیستری کدک پایتون فقط از " +"آن‌هایی استفاده می‌کند که در اینجا تعریف شده‌اند." -msgid "The *stream* argument must be a file-like object open for reading text or binary data, as appropriate for the specific codec." +msgid "" +"The *stream* argument must be a file-like object open for reading text or " +"binary data, as appropriate for the specific codec." msgstr "" +"آرگومان *stream* باید یک شیء فایل‌مانند باشد که برای خواندن متن یا داده‌ی " +"دودویی، متناسب با کدک (codec) مشخص، باز باشد." -msgid "The :class:`StreamReader` may implement different error handling schemes by providing the *errors* keyword argument. See :ref:`error-handlers` for the standard error handlers the underlying stream codec may support." +msgid "" +"The :class:`StreamReader` may implement different error handling schemes by " +"providing the *errors* keyword argument. See :ref:`error-handlers` for the " +"standard error handlers the underlying stream codec may support." msgstr "" +":class:`StreamReader` ممکن است با ارائه آرگومان کلیدواژه‌ای *errors*، روش‌های " +"مختلف مدیریت خطا را پیاده‌سازی کند. برای آشنایی با هندلرهای خطای " +"استانداردی که کدک جریان زیرین ممکن است پشتیبانی کند، :ref:`error-handlers` " +"را ببینید." -msgid "The *errors* argument will be assigned to an attribute of the same name. Assigning to this attribute makes it possible to switch between different error handling strategies during the lifetime of the :class:`StreamReader` object." +msgid "" +"The *errors* argument will be assigned to an attribute of the same name. " +"Assigning to this attribute makes it possible to switch between different " +"error handling strategies during the lifetime of the :class:`StreamReader` " +"object." msgstr "" +"آرگومان *errors* به ویژگی‌ای با همین نام اختصاص داده می‌شود. انتساب به این " +"ویژگی امکان جابه‌جایی بین راهبردهای مختلف مدیریت خطا را در طول عمر " +"شیء :class:`StreamReader` فراهم می‌کند." -msgid "The set of allowed values for the *errors* argument can be extended with :func:`register_error`." +msgid "" +"The set of allowed values for the *errors* argument can be extended " +"with :func:`register_error`." msgstr "" +"مجموعه مقادیر مجاز برای آرگومان *errors* را می‌توان " +"با :func:`register_error` گسترش داد." msgid "Decodes data from the stream and returns the resulting object." -msgstr "" +msgstr "داده را از جریان کدگشایی می‌کند و شیء حاصل را برمی‌گرداند." -msgid "The *chars* argument indicates the number of decoded code points or bytes to return. The :func:`read` method will never return more data than requested, but it might return less, if there is not enough available." +msgid "" +"The *chars* argument indicates the number of decoded code points or bytes " +"to return. The :func:`read` method will never return more data than " +"requested, but it might return less, if there is not enough available." msgstr "" +"آرگومان *chars* تعداد نقاط کد کدگشایی‌شده یا بایت‌هایی را که باید " +"بازگردانده شوند، نشان می‌دهد. متد :func:`read` هرگز داده‌ای بیشتر از مقدار " +"درخواست‌شده برنمی‌گرداند، اما ممکن است در صورتی که به اندازه کافی داده در " +"دسترس نباشد، کمتر برگرداند." -msgid "The *size* argument indicates the approximate maximum number of encoded bytes or code points to read for decoding. The decoder can modify this setting as appropriate. The default value -1 indicates to read and decode as much as possible. This parameter is intended to prevent having to decode huge files in one step." -msgstr "" +msgid "" +"The *size* argument indicates the approximate maximum number of encoded " +"bytes or code points to read for decoding. The decoder can modify this " +"setting as appropriate. The default value -1 indicates to read and decode " +"as much as possible. This parameter is intended to prevent having to decode " +"huge files in one step." +msgstr "" +"آرگومان *size* نشان‌دهنده‌ی حداکثر تعداد تقریبی بایت‌های کدگذاری‌شده یا " +"نقاط کدی است که برای کدگشایی خوانده می‌شوند. کدگشا می‌تواند این تنظیم را " +"به‌صورت مناسب تغییر دهد. مقدار پیش‌فرض -1 نشان می‌دهد که تا حد امکان خوانده و " +"کدگشایی شود. این پارامتر برای جلوگیری از نیاز به کدگشایی فایل‌های بسیار بزرگ " +"در یک مرحله در نظر گرفته شده است." -msgid "The *firstline* flag indicates that it would be sufficient to only return the first line, if there are decoding errors on later lines." +msgid "" +"The *firstline* flag indicates that it would be sufficient to only return " +"the first line, if there are decoding errors on later lines." msgstr "" +"پرچم *firstline* نشان می‌دهد که اگر در خطوط بعدی خطاهای کدگشایی وجود داشته " +"باشد، برگرداندن تنها خط اول کافی است." -msgid "The method should use a greedy read strategy meaning that it should read as much data as is allowed within the definition of the encoding and the given size, e.g. if optional encoding endings or state markers are available on the stream, these should be read too." +msgid "" +"The method should use a greedy read strategy meaning that it should read as " +"much data as is allowed within the definition of the encoding and the given " +"size, e.g. if optional encoding endings or state markers are available on " +"the stream, these should be read too." msgstr "" +"این متد باید از یک راهبرد خواندن حریصانه استفاده کند، به این معنا که باید " +"هر مقدار داده‌ای را که در چارچوب تعریف کدگذاری و اندازه‌ی داده‌شده مجاز است " +"بخواند؛ برای مثال، اگر پایان‌های اختیاری کدگذاری یا نشانگرهای وضعیت در جریان " +"در دسترس باشند، آن‌ها نیز باید خوانده شوند." msgid "Read one line from the input stream and return the decoded data." -msgstr "" +msgstr "یک خط از جریان ورودی می‌خواند و داده کدگشایی‌شده را برمی‌گرداند." -msgid "*size*, if given, is passed as size argument to the stream's :meth:`read` method." +msgid "" +"*size*, if given, is passed as size argument to the stream's :meth:`read` " +"method." msgstr "" +"*size*، در صورت ارائه، به‌عنوان آرگومان size به متد :meth:`read` جریان ارسال " +"می‌شود." -msgid "If *keepends* is false line-endings will be stripped from the lines returned." +msgid "" +"If *keepends* is false line-endings will be stripped from the lines " +"returned." msgstr "" +"اگر *keepends* نادرست باشد، پایان‌خط‌ها از خطوط برگردانده‌شده حذف می‌شوند." -msgid "Read all lines available on the input stream and return them as a list of lines." +msgid "" +"Read all lines available on the input stream and return them as a list of " +"lines." msgstr "" +"تمام خط‌های موجود در جریان ورودی را می‌خواند و آن‌ها را به‌صورت فهرستی از خط‌ها " +"برمی‌گرداند." -msgid "Line-endings are implemented using the codec's :meth:`decode` method and are included in the list entries if *keepends* is true." +msgid "" +"Line-endings are implemented using the codec's :meth:`decode` method and " +"are included in the list entries if *keepends* is true." msgstr "" +"پایان خطوط با استفاده از متد :meth:`decode` کدک پیاده‌سازی می‌شوند و در صورتی " +"که *keepends* درست باشد، در آیتم‌های فهرست گنجانده می‌شوند." -msgid "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:`read` method." +msgid "" +"*sizehint*, if given, is passed as the *size* argument to the " +"stream's :meth:`read` method." msgstr "" +"*sizehint*، در صورت داده شدن، به‌عنوان آرگومان *size* به متد :meth:`read` " +"جریان ارسال می‌شود." -msgid "Note that no stream repositioning should take place. This method is primarily intended to be able to recover from decoding errors." +msgid "" +"Note that no stream repositioning should take place. This method is " +"primarily intended to be able to recover from decoding errors." msgstr "" +"توجه داشته باشید که هیچ‌گونه جابه‌جایی جریان نباید انجام شود. این متد عمدتاً " +"برای امکان بازیابی از خطاهای کدگشایی در نظر گرفته شده است." -msgid "In addition to the above methods, the :class:`StreamReader` must also inherit all other methods and attributes from the underlying stream." +msgid "" +"In addition to the above methods, the :class:`StreamReader` must also " +"inherit all other methods and attributes from the underlying stream." msgstr "" +"علاوه بر متدهای فوق، :class:`StreamReader` باید تمام متدها و ویژگی‌های دیگر " +"را نیز از جریان زیرین به ارث ببرد." msgid "StreamReaderWriter Objects" -msgstr "" +msgstr "اشیای StreamReaderWriter" -msgid "The :class:`StreamReaderWriter` is a convenience class that allows wrapping streams which work in both read and write modes." +msgid "" +"The :class:`StreamReaderWriter` is a convenience class that allows wrapping " +"streams which work in both read and write modes." msgstr "" +":class:`StreamReaderWriter` کلاسی سهولت‌بخش است که به شما امکان می‌دهد " +"جریان‌هایی را که در هر دو حالت خواندن و نوشتن کار می‌کنند، پوشش دهید." -msgid "The design is such that one can use the factory functions returned by the :func:`lookup` function to construct the instance." +msgid "" +"The design is such that one can use the factory functions returned by " +"the :func:`lookup` function to construct the instance." msgstr "" +"طراحی به گونه‌ای است که می‌توان از توابع کارخانه‌ای که توسط " +"تابع :func:`lookup` برگردانده می‌شوند، برای ساخت نمونه استفاده کرد." -msgid "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like object. *Reader* and *Writer* must be factory functions or classes providing the :class:`StreamReader` and :class:`StreamWriter` interface resp. Error handling is done in the same way as defined for the stream readers and writers." -msgstr "" +msgid "" +"Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-" +"like object. *Reader* and *Writer* must be factory functions or classes " +"providing the :class:`StreamReader` and :class:`StreamWriter` interface " +"resp. Error handling is done in the same way as defined for the stream " +"readers and writers." +msgstr "" +"یک نمونه از :class:`StreamReaderWriter` ایجاد می‌کند. *stream* باید یک شیء " +"فایل‌مانند باشد. *Reader* و *Writer* باید توابع کارخانه‌ای یا کلاس‌هایی باشند " +"که به‌ترتیب رابط‌های :class:`StreamReader` و :class:`StreamWriter` را ارائه " +"می‌دهند. مدیریت خطا به همان روشی انجام می‌شود که برای خواننده‌ها و نویسنده‌های " +"جریان تعریف شده است." -msgid ":class:`StreamReaderWriter` instances define the combined interfaces of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit all other methods and attributes from the underlying stream." +msgid "" +":class:`StreamReaderWriter` instances define the combined interfaces " +"of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit " +"all other methods and attributes from the underlying stream." msgstr "" +"نمونه‌های :class:`StreamReaderWriter` رابط‌های ترکیب‌شده‌ی " +"کلاس‌های :class:`StreamReader` و :class:`StreamWriter` را تعریف می‌کنند. آن‌ها " +"تمام متدها و ویژگی‌های دیگر را از جریان زیربنایی به ارث می‌برند." msgid "StreamRecoder Objects" -msgstr "" +msgstr "اشیاء StreamRecoder" -msgid "The :class:`StreamRecoder` translates data from one encoding to another, which is sometimes useful when dealing with different encoding environments." +msgid "" +"The :class:`StreamRecoder` translates data from one encoding to another, " +"which is sometimes useful when dealing with different encoding environments." msgstr "" +":class:`StreamRecoder` داده‌ها را از یک کدگذاری به کدگذاری دیگر تبدیل می‌کند، " +"که گاهی هنگام کار با محیط‌های کدگذاری مختلف مفید است." -msgid "Creates a :class:`StreamRecoder` instance which implements a two-way conversion: *encode* and *decode* work on the frontend — the data visible to code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, while *Reader* and *Writer* work on the backend — the data in *stream*." +msgid "" +"Creates a :class:`StreamRecoder` instance which implements a two-way " +"conversion: *encode* and *decode* work on the frontend — the data visible " +"to code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " +"while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" +"نمونه‌ای از :class:`StreamRecoder` می‌سازد که یک تبدیل دوطرفه را پیاده‌سازی " +"می‌کند: *encode* و *decode* در بخش جلویی (frontend) کار می‌کنند — داده‌هایی که " +"برای کدی که :meth:`~StreamReader.read` و :meth:`~StreamWriter.write` را " +"فراخوانی می‌کند قابل مشاهده است، در حالی که *Reader* و *Writer* در بخش بک‌اند " +"(backend) کار می‌کنند — داده‌های موجود در *stream*." -msgid "You can use these objects to do transparent transcodings, e.g., from Latin-1 to UTF-8 and back." +msgid "" +"You can use these objects to do transparent transcodings, e.g., from " +"Latin-1 to UTF-8 and back." msgstr "" +"می‌توانید از این شیء‌ها برای انجام بازکدگذاری‌های شفاف (transcoding) " +"استفاده کنید، برای مثال از Latin-1 به UTF-8 و برعکس." msgid "The *stream* argument must be a file-like object." -msgstr "" +msgstr "آرگومان *stream* باید یک شیء فایل‌مانند باشد." -msgid "The *encode* and *decode* arguments must adhere to the :class:`Codec` interface. *Reader* and *Writer* must be factory functions or classes providing objects of the :class:`StreamReader` and :class:`StreamWriter` interface respectively." +msgid "" +"The *encode* and *decode* arguments must adhere to the :class:`Codec` " +"interface. *Reader* and *Writer* must be factory functions or classes " +"providing objects of the :class:`StreamReader` and :class:`StreamWriter` " +"interface respectively." msgstr "" +"آرگومان‌های *encode* و *decode* باید از رابط :class:`Codec` پیروی کنند. " +"*Reader* و *Writer* باید توابع یا کلاس‌های کارخانه‌ای باشند که به‌ترتیب " +"شیءهایی از رابط‌های :class:`StreamReader` و :class:`StreamWriter` فراهم " +"می‌کنند." -msgid "Error handling is done in the same way as defined for the stream readers and writers." +msgid "" +"Error handling is done in the same way as defined for the stream readers " +"and writers." msgstr "" +"مدیریت خطا به همان شیوه‌ای انجام می‌شود که برای خواننده‌ها و نویسنده‌های استریم " +"تعریف شده است." -msgid ":class:`StreamRecoder` instances define the combined interfaces of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit all other methods and attributes from the underlying stream." +msgid "" +":class:`StreamRecoder` instances define the combined interfaces " +"of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit " +"all other methods and attributes from the underlying stream." msgstr "" +"نمونه‌های :class:`StreamRecoder` رابط‌های ترکیبی " +"کلاس‌های :class:`StreamReader` و :class:`StreamWriter` را تعریف می‌کنند. آن‌ها " +"تمام متدها و ویژگی‌های دیگر را از جریان زیربنایی به ارث می‌برند." msgid "Encodings and Unicode" -msgstr "" +msgstr "کدگذاری‌ها و یونیکد" -msgid "Strings are stored internally as sequences of code points in range ``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the implementation.) Once a string object is used outside of CPU and memory, endianness and how these arrays are stored as bytes become an issue. As with other codecs, serialising a string into a sequence of bytes is known as *encoding*, and recreating the string from the sequence of bytes is known as *decoding*. There are a variety of different text serialisation codecs, which are collectivity referred to as :term:`text encodings `." -msgstr "" +msgid "" +"Strings are stored internally as sequences of code points in range " +"``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " +"implementation.) Once a string object is used outside of CPU and memory, " +"endianness and how these arrays are stored as bytes become an issue. As " +"with other codecs, serialising a string into a sequence of bytes is known " +"as *encoding*, and recreating the string from the sequence of bytes is " +"known as *decoding*. There are a variety of different text serialisation " +"codecs, which are collectivity referred to as :term:`text encodings `." +msgstr "" +"رشته‌ها به‌صورت داخلی به‌عنوان دنباله‌هایی از نقاط کد (code points) در بازه‌ی " +"``U+0000``--``U+10FFFF`` ذخیره می‌شوند. (برای جزئیات بیشتر درباره‌ی " +"پیاده‌سازی، :pep:`393` را ببینید.) هنگامی که از یک شیء رشته خارج از پردازنده " +"و حافظه استفاده شود، ترتیب بایت‌ها (endianness) و چگونگی ذخیره‌ی این آرایه‌ها " +"به‌صورت بایت به یک مسئله تبدیل می‌شوند. مانند سایر کدک‌ها، سریال‌سازی " +"(serialising) یک رشته به دنباله‌ای از بایت‌ها به‌عنوان *کدگذاری* شناخته می‌شود، " +"و بازسازی رشته از دنباله‌ای از بایت‌ها به‌عنوان *کدگشایی* شناخته می‌شود. کدک‌های " +"سریال‌سازی متن گوناگونی وجود دارند که جمعاً به‌عنوان :term:`کدگذاری‌های متنی " +"` شناخته می‌شوند." -msgid "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a string object that contains code points above ``U+00FF`` can't be encoded with this codec. Doing so will raise a :exc:`UnicodeEncodeError` that looks like the following (although the details of the error message may differ): ``UnicodeEncodeError: 'latin-1' codec can't encode character '\\u1234' in position 3: ordinal not in range(256)``." -msgstr "" +msgid "" +"The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " +"the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " +"string object that contains code points above ``U+00FF`` can't be encoded " +"with this codec. Doing so will raise a :exc:`UnicodeEncodeError` that looks " +"like the following (although the details of the error message may differ): " +"``UnicodeEncodeError: 'latin-1' codec can't encode character '\\u1234' in " +"position 3: ordinal not in range(256)``." +msgstr "" +"ساده‌ترین کدگذاری متن (که ``'latin-1'`` یا ``'iso-8859-1'`` نامیده می‌شود) " +"نقاط کد ۰ تا ۲۵۵ را به بایت‌های ``0x0`` تا ``0xff`` نگاشت می‌کند؛ این بدان " +"معناست که شیء رشته‌ای که شامل نقاط کد بالاتر از ``U+00FF`` باشد، با این کدک " +"قابل کدگذاری نیست. این کار باعث پرتاب یک :exc:`UnicodeEncodeError` می‌شود که " +"به شکل زیر است (اگرچه ممکن است جزئیات پیام خطا متفاوت باشد): " +"``UnicodeEncodeError: 'latin-1' codec can't encode character '\\u1234' in " +"position 3: ordinal not in range(256)``." -msgid "There's another group of encodings (the so called charmap encodings) that choose a different subset of all Unicode code points and how these code points are mapped to the bytes ``0x0``--``0xff``. To see how this is done simply open e.g. :file:`encodings/cp1252.py` (which is an encoding that is used primarily on Windows). There's a string constant with 256 characters that shows you which character is mapped to which byte value." -msgstr "" +msgid "" +"There's another group of encodings (the so called charmap encodings) that " +"choose a different subset of all Unicode code points and how these code " +"points are mapped to the bytes ``0x0``--``0xff``. To see how this is done " +"simply open e.g. :file:`encodings/cp1252.py` (which is an encoding that is " +"used primarily on Windows). There's a string constant with 256 characters " +"that shows you which character is mapped to which byte value." +msgstr "" +"گروه دیگری از کدگذاری‌ها (کدگذاری‌های به‌اصطلاح charmap) وجود دارند که " +"زیرمجموعه‌ای متفاوت از همه نقاط کد یونیکد و چگونگی نگاشت این نقاط کد به " +"بایت‌های ``0x0``--``0xff`` را انتخاب می‌کنند. برای دیدن اینکه این کار چگونه " +"انجام می‌شود، کافی است برای مثال :file:`encodings/cp1252.py` را باز کنید (که " +"کدگذاری‌ای است که عمدتاً در ویندوز به کار می‌رود). یک ثابت رشته‌ای شامل ۲۵۶ " +"نویسه وجود دارد که به شما نشان می‌دهد کدام نویسه به کدام مقدار بایت نگاشته " +"شده است." -msgid "All of these encodings can only encode 256 of the 1114112 code points defined in Unicode. A simple and straightforward way that can store each Unicode code point, is to store each code point as four consecutive bytes. There are two possibilities: store the bytes in big endian or in little endian order. These two encodings are called ``UTF-32-BE`` and ``UTF-32-LE`` respectively. Their disadvantage is that if, for example, you use ``UTF-32-BE`` on a little endian machine you will always have to swap bytes on encoding and decoding. Python's ``UTF-16`` and ``UTF-32`` codecs avoid this problem by using the platform's native byte order when no BOM is present. Python follows prevailing platform practice, so native-endian data round-trips without redundant byte swapping, even though the Unicode Standard defaults to big-endian when the byte order is unspecified. When these bytes are read by a CPU with a different endianness, the bytes have to be swapped. To be able to detect the endianness of a ``UTF-16`` or ``UTF-32`` byte sequence, a BOM (\"Byte Order Mark\") is used. This is the Unicode character ``U+FEFF``. This character can be prepended to every ``UTF-16`` or ``UTF-32`` byte sequence. The byte swapped version of this character (``0xFFFE``) is an illegal character that may not appear in a Unicode text. When the first character of a ``UTF-16`` or ``UTF-32`` byte sequence is ``U+FFFE``, the bytes have to be swapped on decoding." -msgstr "" +msgid "" +"All of these encodings can only encode 256 of the 1114112 code points " +"defined in Unicode. A simple and straightforward way that can store each " +"Unicode code point, is to store each code point as four consecutive bytes. " +"There are two possibilities: store the bytes in big endian or in little " +"endian order. These two encodings are called ``UTF-32-BE`` and ``UTF-32-" +"LE`` respectively. Their disadvantage is that if, for example, you use " +"``UTF-32-BE`` on a little endian machine you will always have to swap bytes " +"on encoding and decoding. Python's ``UTF-16`` and ``UTF-32`` codecs avoid " +"this problem by using the platform's native byte order when no BOM is " +"present. Python follows prevailing platform practice, so native-endian data " +"round-trips without redundant byte swapping, even though the Unicode " +"Standard defaults to big-endian when the byte order is unspecified. When " +"these bytes are read by a CPU with a different endianness, the bytes have " +"to be swapped. To be able to detect the endianness of a ``UTF-16`` or " +"``UTF-32`` byte sequence, a BOM (\"Byte Order Mark\") is used. This is the " +"Unicode character ``U+FEFF``. This character can be prepended to every " +"``UTF-16`` or ``UTF-32`` byte sequence. The byte swapped version of this " +"character (``0xFFFE``) is an illegal character that may not appear in a " +"Unicode text. When the first character of a ``UTF-16`` or ``UTF-32`` byte " +"sequence is ``U+FFFE``, the bytes have to be swapped on decoding." +msgstr "" +"تمام این کدگذاری‌ها تنها می‌توانند ۲۵۶ نقطه‌کد (code point) از میان ۱۱۱۴۱۱۲ " +"نقطه‌کد تعریف‌شده در یونیکد را کدگذاری کنند. یک راه ساده و مستقیم که می‌تواند " +"هر نقطه‌کد یونیکد را ذخیره کند، این است که هر نقطه‌کد به‌صورت چهار بایت متوالی " +"ذخیره شود. دو حالت وجود دارد: بایت‌ها به ترتیب بزرگ‌اندیان (big endian) یا " +"کوچک‌اندیان (little endian) ذخیره شوند. به این دو کدگذاری به‌ترتیب ``UTF-32-" +"BE`` و ``UTF-32-LE`` گفته می‌شود. عیب آن‌ها این است که اگر، برای مثال، از " +"``UTF-32-BE`` روی یک ماشین کوچک‌اندیان استفاده کنید، همیشه باید بایت‌ها را در " +"کدگذاری و کدگشایی جابه‌جا کنید. کدک‌های ``UTF-16`` و ``UTF-32`` پایتون با " +"استفاده از ترتیب بایت بومی سکو در صورت نبود BOM، از این مشکل اجتناب می‌کنند. " +"پایتون از رویه‌ی رایج سکو پیروی می‌کند، بنابراین رفت‌وبرگشت داده‌های با ترتیب " +"بایت بومی بدون جابه‌جایی اضافی بایت‌ها انجام می‌شود، هرچند استاندارد یونیکد در " +"صورت مشخص نبودن ترتیب بایت‌ها، به‌طور پیش‌فرض از بزرگ‌اندیان استفاده می‌کند. " +"هنگامی که این بایت‌ها توسط یک CPU با ترتیب بایت متفاوت خوانده شوند، باید " +"بایت‌ها جابه‌جا شوند. برای تشخیص ترتیب بایت یک دنباله‌ی بایتی ``UTF-16`` یا " +"``UTF-32``، از BOM («نشانگر ترتیب بایت») استفاده می‌شود. این نویسه‌ی یونیکد " +"``U+FEFF`` است. این نویسه می‌تواند به ابتدای هر دنباله‌ی بایتی ``UTF-16`` یا " +"``UTF-32`` افزوده شود. نسخه‌ی جابه‌جاشده‌ی بایت‌های این نویسه (``0xFFFE``) یک " +"نویسه‌ی غیرمجاز است که نباید در متن یونیکد ظاهر شود. هنگامی که اولین نویسه‌ی یک " +"دنباله‌ی بایتی ``UTF-16`` یا ``UTF-32`` برابر ``U+FFFE`` باشد، باید بایت‌ها در " +"کدگشایی جابه‌جا شوند." -msgid "Unfortunately the character ``U+FEFF`` had a second purpose as a ``ZERO WIDTH NO-BREAK SPACE``: a character that has no width and doesn't allow a word to be split. It can e.g. be used to give hints to a ligature algorithm. With Unicode 4.0 using ``U+FEFF`` as a ``ZERO WIDTH NO-BREAK SPACE`` has been deprecated (with ``U+2060`` (``WORD JOINER``) assuming this role). Nevertheless Unicode software still must be able to handle ``U+FEFF`` in both roles: as a BOM it's a device to determine the storage layout of the encoded bytes, and vanishes once the byte sequence has been decoded into a string; as a ``ZERO WIDTH NO-BREAK SPACE`` it's a normal character that will be decoded like any other." -msgstr "" +msgid "" +"Unfortunately the character ``U+FEFF`` had a second purpose as a ``ZERO " +"WIDTH NO-BREAK SPACE``: a character that has no width and doesn't allow a " +"word to be split. It can e.g. be used to give hints to a ligature " +"algorithm. With Unicode 4.0 using ``U+FEFF`` as a ``ZERO WIDTH NO-BREAK " +"SPACE`` has been deprecated (with ``U+2060`` (``WORD JOINER``) assuming " +"this role). Nevertheless Unicode software still must be able to handle " +"``U+FEFF`` in both roles: as a BOM it's a device to determine the storage " +"layout of the encoded bytes, and vanishes once the byte sequence has been " +"decoded into a string; as a ``ZERO WIDTH NO-BREAK SPACE`` it's a normal " +"character that will be decoded like any other." +msgstr "" +"متأسفانه نویسه‌ی ``U+FEFF`` کاربرد دومی به‌عنوان ``ZERO WIDTH NO-BREAK " +"SPACE`` داشت: نویسه‌ای که عرضی ندارد و اجازه نمی‌دهد یک واژه شکسته شود. برای " +"مثال، می‌توان از آن برای دادن سرنخ‌هایی به یک الگوریتم لیگاتور (ligature) " +"استفاده کرد. از یونیکد 4.0، استفاده از ``U+FEFF`` به‌عنوان ``ZERO WIDTH NO-" +"BREAK SPACE`` منسوخ شده است (و ``U+2060`` (``WORD JOINER``) این نقش را بر " +"عهده گرفته است). با این حال، نرم‌افزارهای یونیکد همچنان باید بتوانند " +"``U+FEFF`` را در هر دو نقش پردازش کنند: در نقش BOM، ابزاری است برای تعیین " +"چیدمان ذخیره‌سازی بایت‌های کدگذاری‌شده، و پس از اینکه دنباله‌ی بایت‌ها به یک " +"رشته کدگشایی شد، ناپدید می‌شود؛ در نقش ``ZERO WIDTH NO-BREAK SPACE``، " +"نویسه‌ای عادی است که مانند هر نویسه‌ی دیگری کدگشایی خواهد شد." -msgid "There's another encoding that is able to encode the full range of Unicode characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no issues with byte order in UTF-8. Each byte in a UTF-8 byte sequence consists of two parts: marker bits (the most significant bits) and payload bits. The marker bits are a sequence of zero to four ``1`` bits followed by a ``0`` bit. Unicode characters are encoded like this (with x being payload bits, which when concatenated give the Unicode character):" -msgstr "" +msgid "" +"There's another encoding that is able to encode the full range of Unicode " +"characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " +"issues with byte order in UTF-8. Each byte in a UTF-8 byte sequence " +"consists of two parts: marker bits (the most significant bits) and payload " +"bits. The marker bits are a sequence of zero to four ``1`` bits followed by " +"a ``0`` bit. Unicode characters are encoded like this (with x being payload " +"bits, which when concatenated give the Unicode character):" +msgstr "" +"کدگذاری دیگری نیز وجود دارد که می‌تواند تمام بازه‌ی نویسه‌های یونیکد را کدگذاری " +"کند: UTF-8. UTF-8 یک کدگذاری ۸ بیتی است، به این معنا که در UTF-8 هیچ مشکلی " +"از بابت ترتیب بایت‌ها وجود ندارد. هر بایت در یک دنباله‌ی بایتی UTF-8 از دو بخش " +"تشکیل شده است: بیت‌های نشانگر (بیت‌های پرارزش) و بیت‌های بار. بیت‌های نشانگر " +"دنباله‌ای از صفر تا چهار بیت ``1`` هستند که پس از آن‌ها یک بیت ``0`` می‌آید. " +"نویسه‌های یونیکد به این صورت کدگذاری می‌شوند (که در آن x نشان‌دهنده‌ی بیت‌های بار " +"است و با الحاق آن‌ها، نویسه‌ی یونیکد به دست می‌آید):" msgid "Range" -msgstr "" +msgstr "بازه" msgid "Encoding" -msgstr "" +msgstr "کدگذاری" msgid "``U-00000000`` ... ``U-0000007F``" -msgstr "" +msgstr "``U-00000000`` ... ``U-0000007F``" msgid "0xxxxxxx" -msgstr "" +msgstr "0xxxxxxx" msgid "``U-00000080`` ... ``U-000007FF``" -msgstr "" +msgstr "``U-00000080`` ... ``U-000007FF``" msgid "110xxxxx 10xxxxxx" -msgstr "" +msgstr "110xxxxx 10xxxxxx" msgid "``U-00000800`` ... ``U-0000FFFF``" -msgstr "" +msgstr "``U-00000800`` ... ``U-0000FFFF``" msgid "1110xxxx 10xxxxxx 10xxxxxx" -msgstr "" +msgstr "1110xxxx 10xxxxxx 10xxxxxx" msgid "``U-00010000`` ... ``U-0010FFFF``" -msgstr "" +msgstr "``U-00010000`` ... ``U-0010FFFF``" msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -msgstr "" +msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -msgid "The least significant bit of the Unicode character is the rightmost x bit." -msgstr "" +msgid "" +"The least significant bit of the Unicode character is the rightmost x bit." +msgstr "کم‌ارزش‌ترین بیت نویسه‌ی یونیکد، راست‌ترین بیت x است." -msgid "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` character in the decoded string (even if it's the first character) is treated as a ``ZERO WIDTH NO-BREAK SPACE``." +msgid "" +"As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " +"character in the decoded string (even if it's the first character) is " +"treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" +"از آن‌جا که UTF-8 یک کدگذاری ۸-بیتی است، نیازی به نشانگر ترتیب بایت‌ها (BOM) " +"نیست و هر نویسه‌ی ``U+FEFF`` در رشته‌ی کدگشایی‌شده (حتی اگر اولین نویسه باشد) " +"به‌عنوان یک ``ZERO WIDTH NO-BREAK SPACE`` در نظر گرفته می‌شود." -msgid "Without external information it's impossible to reliably determine which encoding was used for encoding a string. Each charmap encoding can decode any random byte sequence. However that's not possible with UTF-8, as UTF-8 byte sequences have a structure that doesn't allow arbitrary byte sequences. To increase the reliability with which a UTF-8 encoding can be detected, Microsoft invented a variant of UTF-8 (that Python calls ``\"utf-8-sig\"``) for its Notepad program: Before any of the Unicode characters is written to the file, a UTF-8 encoded BOM (which looks like this as a byte sequence: ``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather improbable that any charmap encoded file starts with these byte values (which would e.g. map to" -msgstr "" +msgid "" +"Without external information it's impossible to reliably determine which " +"encoding was used for encoding a string. Each charmap encoding can decode " +"any random byte sequence. However that's not possible with UTF-8, as UTF-8 " +"byte sequences have a structure that doesn't allow arbitrary byte " +"sequences. To increase the reliability with which a UTF-8 encoding can be " +"detected, Microsoft invented a variant of UTF-8 (that Python calls " +"``\"utf-8-sig\"``) for its Notepad program: Before any of the Unicode " +"characters is written to the file, a UTF-8 encoded BOM (which looks like " +"this as a byte sequence: ``0xef``, ``0xbb``, ``0xbf``) is written. As it's " +"rather improbable that any charmap encoded file starts with these byte " +"values (which would e.g. map to" +msgstr "" +"بدون اطلاعات خارجی، نمی‌توان به‌طور قابل‌اطمینان تعیین کرد کدام کدگذاری برای " +"کدگذاری یک رشته استفاده شده است. هر کدگذاری charmap می‌تواند هر دنباله بایت " +"تصادفی را کدگشایی کند. اما این موضوع در مورد UTF-8 ممکن نیست، زیرا " +"دنباله‌های بایت UTF-8 دارای ساختاری هستند که دنباله‌های بایت دلخواه را مجاز " +"نمی‌داند. برای افزایش قابلیت اطمینانی که می‌توان با آن کدگذاری UTF-8 را تشخیص " +"داد، مایکروسافت برای برنامه Notepad خود گونه‌ای از UTF-8 را ابداع کرد (که " +"پایتون آن را ``\"utf-8-sig\"`` می‌نامد): پیش از آنکه هر یک از نویسه‌های " +"Unicode به فایل نوشته شود، یک BOM کدگذاری‌شده با UTF-8 (که به‌صورت یک دنباله " +"بایت به این شکل به نظر می‌رسد: ``0xef``، ``0xbb``، ``0xbf``) نوشته می‌شود. از " +"آنجا که نسبتاً بعید است هیچ فایل کدگذاری‌شده با charmap با این مقادیر بایت " +"شروع شود (که برای مثال نگاشت می‌شوند به" msgid "LATIN SMALL LETTER I WITH DIAERESIS" -msgstr "" +msgstr "نویسه‌ی کوچک لاتین I با دونقطه (DIAERESIS)" msgid "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" -msgstr "" +msgstr "علامت نقل‌قول زاویه‌ای دوتایی رو به راست" msgid "INVERTED QUESTION MARK" -msgstr "" +msgstr "علامت سؤال وارونه" -msgid "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding can be correctly guessed from the byte sequence. So here the BOM is not used to be able to determine the byte order used for generating the byte sequence, but as a signature that helps in guessing the encoding. On encoding the utf-8-sig codec will write ``0xef``, ``0xbb``, ``0xbf`` as the first three bytes to the file. On decoding ``utf-8-sig`` will skip those three bytes if they appear as the first three bytes in the file. In UTF-8, the use of the BOM is discouraged and should generally be avoided." -msgstr "" +msgid "" +"in iso-8859-1), this increases the probability that a ``utf-8-sig`` " +"encoding can be correctly guessed from the byte sequence. So here the BOM " +"is not used to be able to determine the byte order used for generating the " +"byte sequence, but as a signature that helps in guessing the encoding. On " +"encoding the utf-8-sig codec will write ``0xef``, ``0xbb``, ``0xbf`` as the " +"first three bytes to the file. On decoding ``utf-8-sig`` will skip those " +"three bytes if they appear as the first three bytes in the file. In UTF-8, " +"the use of the BOM is discouraged and should generally be avoided." +msgstr "" +"در iso-8859-1)، این موضوع احتمال اینکه کدگذاری ``utf-8-sig`` بتواند به‌درستی " +"از روی دنباله‌ی بایت‌ها حدس زده شود را افزایش می‌دهد. بنابراین در اینجا نشانه‌ی " +"ترتیب بایت‌ها (BOM) برای تعیین ترتیب بایت‌های استفاده‌شده برای تولید دنباله‌ی " +"بایت‌ها استفاده نمی‌شود، بلکه به‌عنوان امضایی است که به حدس زدن کدگذاری کمک " +"می‌کند. هنگام کدگذاری، کدک utf-8-sig ``0xef``، ``0xbb`` و ``0xbf`` را " +"به‌عنوان سه بایت نخست در فایل می‌نویسد. هنگام کدگشایی، ``utf-8-sig`` آن سه " +"بایت را در صورتی که به‌عنوان سه بایت نخست در فایل ظاهر شوند، نادیده می‌گیرد. " +"در UTF-8، استفاده از BOM توصیه نمی‌شود و عموماً باید از آن اجتناب شود." msgid "Standard Encodings" -msgstr "" +msgstr "کدگذاری‌های استاندارد" -msgid "Python comes with a number of codecs built-in, either implemented as C functions or with dictionaries as mapping tables. The following table lists the codecs by name, together with a few common aliases, and the languages for which the encoding is likely used. Neither the list of aliases nor the list of languages is meant to be exhaustive. Notice that spelling alternatives that only differ in case or use a hyphen instead of an underscore are also valid aliases because they are equivalent when normalized by :func:`~encodings.normalize_encoding`. For example, ``'utf-8'`` is a valid alias for the ``'utf_8'`` codec." -msgstr "" +msgid "" +"Python comes with a number of codecs built-in, either implemented as C " +"functions or with dictionaries as mapping tables. The following table lists " +"the codecs by name, together with a few common aliases, and the languages " +"for which the encoding is likely used. Neither the list of aliases nor the " +"list of languages is meant to be exhaustive. Notice that spelling " +"alternatives that only differ in case or use a hyphen instead of an " +"underscore are also valid aliases because they are equivalent when " +"normalized by :func:`~encodings.normalize_encoding`. For example, " +"``'utf-8'`` is a valid alias for the ``'utf_8'`` codec." +msgstr "" +"پایتون همراه با تعدادی کدک توکار است که یا به‌صورت توابع C یا با استفاده از " +"دیکشنری‌ها به‌عنوان جداول نگاشت پیاده‌سازی شده‌اند. جدول زیر کدک‌ها را بر اساس " +"نام، به‌همراه چند نام مستعار رایج و زبان‌هایی که احتمالاً کدگذاری برای آن‌ها " +"استفاده می‌شود، فهرست می‌کند. هیچ‌یک از فهرست نام‌های مستعار و فهرست زبان‌ها " +"برای جامع بودن در نظر گرفته نشده است. توجه داشته باشید که نوشتارهای " +"جایگزینی که فقط از نظر بزرگی یا کوچکی حروف تفاوت دارند یا به‌جای زیرخط از خط " +"تیره استفاده می‌کنند نیز نام‌های مستعار معتبر هستند، زیرا وقتی " +"با :func:`~encodings.normalize_encoding` نرمال‌سازی شوند، معادل یکدیگر " +"هستند. برای مثال، ``'utf-8'`` یک نام مستعار معتبر برای کدک ``'utf_8'`` است." -msgid "The below table lists the most common aliases, for a complete list refer to the source :source:`aliases.py ` file." +msgid "" +"The below table lists the most common aliases, for a complete list refer to " +"the source :source:`aliases.py ` file." msgstr "" +"جدول زیر رایج‌ترین نام‌های مستعار را فهرست می‌کند، برای فهرست کامل به فایل " +"منبع :source:`aliases.py ` مراجعه کنید." -msgid "On Windows, ``cpXXX`` codecs are available for all code pages. But only codecs listed in the following table are guarantead to exist on other platforms." +msgid "" +"On Windows, ``cpXXX`` codecs are available for all code pages. But only " +"codecs listed in the following table are guarantead to exist on other " +"platforms." msgstr "" +"در ویندوز، کدک‌های ``cpXXX`` برای تمام صفحه‌های کد در دسترس هستند. اما تضمین " +"می‌شود که تنها کدک‌های فهرست‌شده در جدول زیر در سایر پلتفرم‌ها وجود داشته باشند." -msgid "Some common encodings can bypass the codecs lookup machinery to improve performance. These optimization opportunities are only recognized by CPython for a limited set of (case insensitive) aliases: utf-8, utf8, latin-1, latin1, iso-8859-1, iso8859-1, mbcs (Windows only), ascii, us-ascii, utf-16, utf16, utf-32, utf32, and the same using underscores instead of dashes. Using alternative aliases for these encodings may result in slower execution." -msgstr "" +msgid "" +"Some common encodings can bypass the codecs lookup machinery to improve " +"performance. These optimization opportunities are only recognized by " +"CPython for a limited set of (case insensitive) aliases: utf-8, utf8, " +"latin-1, latin1, iso-8859-1, iso8859-1, mbcs (Windows only), ascii, us-" +"ascii, utf-16, utf16, utf-32, utf32, and the same using underscores instead " +"of dashes. Using alternative aliases for these encodings may result in " +"slower execution." +msgstr "" +"برخی کدگذاری‌های رایج می‌توانند برای بهبود کارایی، سازوکار جست‌وجوی کدک‌ها " +"(codecs) را دور بزنند. این فرصت‌های بهینه‌سازی تنها برای مجموعه‌ای محدود از " +"نام‌های مستعار (غیرحساس به بزرگی و کوچکی حروف) توسط CPython شناسایی می‌شوند: " +"utf-8، utf8، latin-1، latin1، iso-8859-1، iso8859-1، mbcs (فقط ویندوز)، " +"ascii، us-ascii، utf-16، utf16، utf-32، utf32، و همان موارد با استفاده از " +"زیرخط‌ها به‌جای خط‌های تیره. استفاده از نام‌های مستعار جایگزین برای این " +"کدگذاری‌ها ممکن است باعث اجرای کندتر شود." msgid "Optimization opportunity recognized for us-ascii." -msgstr "" +msgstr "فرصت بهینه‌سازی برای us-ascii شناسایی شد." -msgid "Many of the character sets support the same languages. They vary in individual characters (e.g. whether the EURO SIGN is supported or not), and in the assignment of characters to code positions. For the European languages in particular, the following variants typically exist:" +msgid "" +"Many of the character sets support the same languages. They vary in " +"individual characters (e.g. whether the EURO SIGN is supported or not), and " +"in the assignment of characters to code positions. For the European " +"languages in particular, the following variants typically exist:" msgstr "" +"بسیاری از مجموعه‌نویسه‌ها از زبان‌های یکسانی پشتیبانی می‌کنند. آن‌ها از نظر " +"نویسه‌های منفرد (مثلاً اینکه آیا EURO SIGN پشتیبانی می‌شود یا نه) و از نظر " +"تخصیص نویسه‌ها به موقعیت‌های کد تفاوت دارند. به‌ویژه برای زبان‌های اروپایی، " +"معمولاً گونه‌های زیر وجود دارند:" msgid "an ISO 8859 codeset" -msgstr "" +msgstr "یک مجموعه‌کد ISO 8859" -msgid "a Microsoft Windows code page, which is typically derived from an 8859 codeset, but replaces control characters with additional graphic characters" +msgid "" +"a Microsoft Windows code page, which is typically derived from an 8859 " +"codeset, but replaces control characters with additional graphic characters" msgstr "" +"یک صفحه کد (code page) مایکروسافت ویندوز، که به‌طور معمول از یک مجموعه کد " +"(codeset) 8859 مشتق شده است، اما نویسه‌های کنترلی را با نویسه‌های گرافیکی " +"اضافی جایگزین می‌کند" msgid "an IBM EBCDIC code page" -msgstr "" +msgstr "یک صفحه‌کد IBM EBCDIC" msgid "an IBM PC code page, which is ASCII compatible" -msgstr "" +msgstr "یک صفحه‌کد IBM PC که با ASCII سازگار است" msgid "Codec" -msgstr "" +msgstr "کدک" msgid "Aliases" -msgstr "" +msgstr "نام‌های مستعار" msgid "Languages" -msgstr "" +msgstr "زبان‌ها" msgid "ascii" -msgstr "" +msgstr "ascii" msgid "646, us-ascii" -msgstr "" +msgstr "646, us-ascii" msgid "English" -msgstr "" +msgstr "انگلیسی" msgid "big5" -msgstr "" +msgstr "big5" msgid "big5-tw, csbig5" -msgstr "" +msgstr "big5-tw, csbig5" msgid "Traditional Chinese" -msgstr "" +msgstr "چینی سنتی" msgid "big5hkscs" -msgstr "" +msgstr "big5hkscs" msgid "big5-hkscs, hkscs" -msgstr "" +msgstr "big5-hkscs, hkscs" msgid "cp037" -msgstr "" +msgstr "cp037" msgid "IBM037, IBM039" -msgstr "" +msgstr "IBM037, IBM039" msgid "cp273" -msgstr "" +msgstr "cp273" msgid "273, IBM273, csIBM273" -msgstr "" +msgstr "273, IBM273, csIBM273" msgid "German" -msgstr "" +msgstr "آلمانی" msgid "cp424" -msgstr "" +msgstr "cp424" msgid "EBCDIC-CP-HE, IBM424" -msgstr "" +msgstr "EBCDIC-CP-HE, IBM424" msgid "Hebrew" -msgstr "" +msgstr "عبری" msgid "cp437" -msgstr "" +msgstr "cp437" msgid "437, IBM437" -msgstr "" +msgstr "437, IBM437" msgid "cp500" -msgstr "" +msgstr "cp500" msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -msgstr "" +msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgid "Western Europe" -msgstr "" +msgstr "اروپای غربی" msgid "cp720" -msgstr "" +msgstr "cp720" msgid "Arabic" -msgstr "" +msgstr "عربی" msgid "cp737" -msgstr "" +msgstr "cp737" msgid "Greek" -msgstr "" +msgstr "یونانی" msgid "cp775" -msgstr "" +msgstr "cp775" msgid "IBM775" -msgstr "" +msgstr "IBM775" msgid "Baltic languages" -msgstr "" +msgstr "زبان‌های بالتیک" msgid "cp850" -msgstr "" +msgstr "cp850" msgid "850, IBM850" -msgstr "" +msgstr "850, IBM850" msgid "cp852" -msgstr "" +msgstr "cp852" msgid "852, IBM852" -msgstr "" +msgstr "852, IBM852" msgid "Central and Eastern Europe" -msgstr "" +msgstr "اروپای مرکزی و شرقی" msgid "cp855" -msgstr "" +msgstr "cp855" msgid "855, IBM855" -msgstr "" +msgstr "855, IBM855" msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" -msgstr "" +msgstr "بلاروسی، بلغاری، مقدونی، روسی، صربی" msgid "cp856" -msgstr "" +msgstr "cp856" msgid "cp857" -msgstr "" +msgstr "cp857" msgid "857, IBM857" -msgstr "" +msgstr "857, IBM857" msgid "Turkish" -msgstr "" +msgstr "ترکی" msgid "cp858" -msgstr "" +msgstr "cp858" msgid "858, IBM00858" -msgstr "" +msgstr "858, IBM00858" msgid "cp860" -msgstr "" +msgstr "cp860" msgid "860, IBM860" -msgstr "" +msgstr "860, IBM860" msgid "Portuguese" -msgstr "" +msgstr "پرتغالی" msgid "cp861" -msgstr "" +msgstr "cp861" msgid "861, CP-IS, IBM861" -msgstr "" +msgstr "861, CP-IS, IBM861" msgid "Icelandic" -msgstr "" +msgstr "ایسلندی" msgid "cp862" -msgstr "" +msgstr "cp862" msgid "862, IBM862" -msgstr "" +msgstr "862, IBM862" msgid "cp863" -msgstr "" +msgstr "cp863" msgid "863, IBM863" -msgstr "" +msgstr "863, IBM863" msgid "Canadian" -msgstr "" +msgstr "کانادایی" msgid "cp864" -msgstr "" +msgstr "cp864" msgid "IBM864" -msgstr "" +msgstr "IBM864" msgid "cp865" -msgstr "" +msgstr "cp865" msgid "865, IBM865" -msgstr "" +msgstr "865, IBM865" msgid "Danish, Norwegian" -msgstr "" +msgstr "دانمارکی، نروژی" msgid "cp866" -msgstr "" +msgstr "cp866" msgid "866, IBM866" -msgstr "" +msgstr "866, IBM866" msgid "Russian" -msgstr "" +msgstr "روسی" msgid "cp869" -msgstr "" +msgstr "cp869" msgid "869, CP-GR, IBM869" -msgstr "" +msgstr "869, CP-GR, IBM869" msgid "cp874" -msgstr "" +msgstr "cp874" msgid "Thai" -msgstr "" +msgstr "تایلندی" msgid "cp875" -msgstr "" +msgstr "cp875" msgid "cp932" -msgstr "" +msgstr "cp932" msgid "932, ms932, mskanji, ms-kanji, windows-31j" -msgstr "" +msgstr "932, ms932, mskanji, ms-kanji, windows-31j" msgid "Japanese" -msgstr "" +msgstr "ژاپنی" msgid "cp949" -msgstr "" +msgstr "cp949" msgid "949, ms949, uhc" -msgstr "" +msgstr "949, ms949, uhc" msgid "Korean" -msgstr "" +msgstr "کره‌ای" msgid "cp950" -msgstr "" +msgstr "cp950" msgid "950, ms950" -msgstr "" +msgstr "950, ms950" msgid "cp1006" -msgstr "" +msgstr "cp1006" msgid "Urdu" -msgstr "" +msgstr "اردو" msgid "cp1026" -msgstr "" +msgstr "cp1026" msgid "ibm1026" -msgstr "" +msgstr "ibm1026" msgid "cp1125" -msgstr "" +msgstr "cp1125" msgid "1125, ibm1125, cp866u, ruscii" -msgstr "" +msgstr "1125, ibm1125, cp866u, ruscii" msgid "Ukrainian" -msgstr "" +msgstr "اوکراینی" msgid "cp1140" -msgstr "" +msgstr "cp1140" msgid "IBM01140" -msgstr "" +msgstr "IBM01140" msgid "cp1250" -msgstr "" +msgstr "cp1250" msgid "windows-1250" -msgstr "" +msgstr "windows-1250" msgid "cp1251" -msgstr "" +msgstr "cp1251" msgid "windows-1251" -msgstr "" +msgstr "windows-1251" msgid "cp1252" -msgstr "" +msgstr "cp1252" msgid "windows-1252" -msgstr "" +msgstr "windows-1252" msgid "cp1253" -msgstr "" +msgstr "cp1253" msgid "windows-1253" -msgstr "" +msgstr "windows-1253" msgid "cp1254" -msgstr "" +msgstr "cp1254" msgid "windows-1254" -msgstr "" +msgstr "windows-1254" msgid "cp1255" -msgstr "" +msgstr "cp1255" msgid "windows-1255" -msgstr "" +msgstr "windows-1255" msgid "cp1256" -msgstr "" +msgstr "cp1256" msgid "windows-1256" -msgstr "" +msgstr "windows-1256" msgid "cp1257" -msgstr "" +msgstr "cp1257" msgid "windows-1257" -msgstr "" +msgstr "windows-1257" msgid "cp1258" -msgstr "" +msgstr "cp1258" msgid "windows-1258" -msgstr "" +msgstr "windows-1258" msgid "Vietnamese" -msgstr "" +msgstr "ویتنامی" msgid "euc_jp" -msgstr "" +msgstr "euc_jp" msgid "eucjp, ujis, u-jis" -msgstr "" +msgstr "eucjp, ujis, u-jis" msgid "euc_jis_2004" -msgstr "" +msgstr "euc_jis_2004" msgid "jisx0213, eucjis2004" -msgstr "" +msgstr "jisx0213, eucjis2004" msgid "euc_jisx0213" -msgstr "" +msgstr "euc_jisx0213" msgid "eucjisx0213" -msgstr "" +msgstr "eucjisx0213" msgid "euc_kr" -msgstr "" +msgstr "euc_kr" msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -msgstr "" +msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgid "gb2312" -msgstr "" +msgstr "gb2312" -msgid "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, gb2312-80, iso-ir-58" +msgid "" +"chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " +"gb2312-80, iso-ir-58" msgstr "" +"chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " +"gb2312-80, iso-ir-58" msgid "Simplified Chinese" -msgstr "" +msgstr "چینی ساده‌شده" msgid "gbk" -msgstr "" +msgstr "gbk" msgid "936, cp936, ms936" -msgstr "" +msgstr "936, cp936, ms936" msgid "Unified Chinese" -msgstr "" +msgstr "چینی یک‌پارچه" msgid "gb18030" -msgstr "" +msgstr "gb18030" msgid "gb18030-2000" -msgstr "" +msgstr "gb18030-2000" msgid "hz" -msgstr "" +msgstr "hz" msgid "hzgb, hz-gb, hz-gb-2312" -msgstr "" +msgstr "hzgb, hz-gb, hz-gb-2312" msgid "iso2022_jp" -msgstr "" +msgstr "iso2022_jp" msgid "csiso2022jp, iso2022jp, iso-2022-jp" -msgstr "" +msgstr "csiso2022jp, iso2022jp, iso-2022-jp" msgid "iso2022_jp_1" -msgstr "" +msgstr "iso2022_jp_1" msgid "iso2022jp-1, iso-2022-jp-1" -msgstr "" +msgstr "iso2022jp-1, iso-2022-jp-1" msgid "iso2022_jp_2" -msgstr "" +msgstr "iso2022_jp_2" msgid "iso2022jp-2, iso-2022-jp-2" -msgstr "" +msgstr "iso2022jp-2, iso-2022-jp-2" msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" -msgstr "" +msgstr "ژاپنی، کره‌ای، چینی ساده‌شده، اروپای غربی، یونانی" msgid "iso2022_jp_2004" -msgstr "" +msgstr "iso2022_jp_2004" msgid "iso2022jp-2004, iso-2022-jp-2004" -msgstr "" +msgstr "iso2022jp-2004, iso-2022-jp-2004" msgid "iso2022_jp_3" -msgstr "" +msgstr "iso2022_jp_3" msgid "iso2022jp-3, iso-2022-jp-3" -msgstr "" +msgstr "iso2022jp-3, iso-2022-jp-3" msgid "iso2022_jp_ext" -msgstr "" +msgstr "iso2022_jp_ext" msgid "iso2022jp-ext, iso-2022-jp-ext" -msgstr "" +msgstr "iso2022jp-ext, iso-2022-jp-ext" msgid "iso2022_kr" -msgstr "" +msgstr "iso2022_kr" msgid "csiso2022kr, iso2022kr, iso-2022-kr" -msgstr "" +msgstr "csiso2022kr, iso2022kr, iso-2022-kr" msgid "latin_1" -msgstr "" +msgstr "latin_1" msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -msgstr "" +msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgid "iso8859_2" -msgstr "" +msgstr "iso8859_2" msgid "iso-8859-2, latin2, L2" -msgstr "" +msgstr "iso-8859-2, latin2, L2" msgid "iso8859_3" -msgstr "" +msgstr "iso8859_3" msgid "iso-8859-3, latin3, L3" -msgstr "" +msgstr "iso-8859-3, latin3, L3" msgid "Esperanto, Maltese" -msgstr "" +msgstr "اسپرانتو، مالتی" msgid "iso8859_4" -msgstr "" +msgstr "iso8859_4" msgid "iso-8859-4, latin4, L4" -msgstr "" +msgstr "iso-8859-4, latin4, L4" msgid "Northern Europe" -msgstr "" +msgstr "اروپای شمالی" msgid "iso8859_5" -msgstr "" +msgstr "iso8859_5" msgid "iso-8859-5, cyrillic" -msgstr "" +msgstr "iso-8859-5، سیریلیک" msgid "iso8859_6" -msgstr "" +msgstr "iso8859_6" msgid "iso-8859-6, arabic" -msgstr "" +msgstr "iso-8859-6، عربی" msgid "iso8859_7" -msgstr "" +msgstr "iso8859_7" msgid "iso-8859-7, greek, greek8" -msgstr "" +msgstr "iso-8859-7, greek, greek8" msgid "iso8859_8" -msgstr "" +msgstr "iso8859_8" msgid "iso-8859-8, hebrew" -msgstr "" +msgstr "iso-8859-8، عبری" msgid "iso8859_9" -msgstr "" +msgstr "iso8859_9" msgid "iso-8859-9, latin5, L5" -msgstr "" +msgstr "iso-8859-9, latin5, L5" msgid "iso8859_10" -msgstr "" +msgstr "iso8859_10" msgid "iso-8859-10, latin6, L6" -msgstr "" +msgstr "iso-8859-10, latin6, L6" msgid "Nordic languages" -msgstr "" +msgstr "زبان‌های نوردیک" msgid "iso8859_11" -msgstr "" +msgstr "iso8859_11" msgid "iso-8859-11, thai" -msgstr "" +msgstr "iso-8859-11، تایلندی" msgid "Thai languages" -msgstr "" +msgstr "زبان‌های تایلندی" msgid "iso8859_13" -msgstr "" +msgstr "iso8859_13" msgid "iso-8859-13, latin7, L7" -msgstr "" +msgstr "iso-8859-13, latin7, L7" msgid "iso8859_14" -msgstr "" +msgstr "iso8859_14" msgid "iso-8859-14, latin8, L8" -msgstr "" +msgstr "iso-8859-14, latin8, L8" msgid "Celtic languages" -msgstr "" +msgstr "زبان‌های سلتی" msgid "iso8859_15" -msgstr "" +msgstr "iso8859_15" msgid "iso-8859-15, latin9, L9" -msgstr "" +msgstr "iso-8859-15, latin9, L9" msgid "iso8859_16" -msgstr "" +msgstr "iso8859_16" msgid "iso-8859-16, latin10, L10" -msgstr "" +msgstr "iso-8859-16, latin10, L10" msgid "South-Eastern Europe" -msgstr "" +msgstr "جنوب شرقی اروپا" msgid "johab" -msgstr "" +msgstr "johab" msgid "cp1361, ms1361" -msgstr "" +msgstr "cp1361, ms1361" msgid "koi8_r" -msgstr "" +msgstr "koi8_r" msgid "koi8_t" -msgstr "" +msgstr "koi8_t" msgid "Tajik" -msgstr "" +msgstr "تاجیکی" msgid "koi8_u" -msgstr "" +msgstr "koi8_u" msgid "kz1048" -msgstr "" +msgstr "kz1048" msgid "kz_1048, strk1048_2002, rk1048" -msgstr "" +msgstr "kz_1048, strk1048_2002, rk1048" msgid "Kazakh" -msgstr "" +msgstr "قزاقی" msgid "mac_cyrillic" -msgstr "" +msgstr "mac_cyrillic" msgid "maccyrillic" -msgstr "" +msgstr "maccyrillic" msgid "mac_greek" -msgstr "" +msgstr "mac_greek" msgid "macgreek" -msgstr "" +msgstr "macgreek" msgid "mac_iceland" -msgstr "" +msgstr "mac_iceland" msgid "maciceland" -msgstr "" +msgstr "maciceland" msgid "mac_latin2" -msgstr "" +msgstr "mac_latin2" msgid "maclatin2, maccentraleurope, mac_centeuro" -msgstr "" +msgstr "maclatin2, maccentraleurope, mac_centeuro" msgid "mac_roman" -msgstr "" +msgstr "mac_roman" msgid "macroman, macintosh" -msgstr "" +msgstr "macroman, macintosh" msgid "mac_turkish" -msgstr "" +msgstr "mac_turkish" msgid "macturkish" -msgstr "" +msgstr "macturkish" msgid "ptcp154" -msgstr "" +msgstr "ptcp154" msgid "csptcp154, pt154, cp154, cyrillic-asian" -msgstr "" +msgstr "csptcp154, pt154, cp154, cyrillic-asian" msgid "shift_jis" -msgstr "" +msgstr "shift_jis" msgid "csshiftjis, shiftjis, sjis, s_jis" -msgstr "" +msgstr "csshiftjis, shiftjis, sjis, s_jis" msgid "shift_jis_2004" -msgstr "" +msgstr "shift_jis_2004" msgid "shiftjis2004, sjis_2004, sjis2004" -msgstr "" +msgstr "shiftjis2004, sjis_2004, sjis2004" msgid "shift_jisx0213" -msgstr "" +msgstr "shift_jisx0213" msgid "shiftjisx0213, sjisx0213, s_jisx0213" -msgstr "" +msgstr "shiftjisx0213, sjisx0213, s_jisx0213" msgid "utf_32" -msgstr "" +msgstr "utf_32" msgid "U32, utf32" -msgstr "" +msgstr "U32, utf32" msgid "all languages" -msgstr "" +msgstr "تمام زبان‌ها" msgid "utf_32_be" -msgstr "" +msgstr "utf_32_be" msgid "UTF-32BE" -msgstr "" +msgstr "UTF-32BE" msgid "utf_32_le" -msgstr "" +msgstr "utf_32_le" msgid "UTF-32LE" -msgstr "" +msgstr "UTF-32LE" msgid "utf_16" -msgstr "" +msgstr "utf_16" msgid "U16, utf16" -msgstr "" +msgstr "U16, utf16" msgid "utf_16_be" -msgstr "" +msgstr "utf_16_be" msgid "UTF-16BE" -msgstr "" +msgstr "UTF-16BE" msgid "utf_16_le" -msgstr "" +msgstr "utf_16_le" msgid "UTF-16LE" -msgstr "" +msgstr "UTF-16LE" msgid "utf_7" -msgstr "" +msgstr "utf_7" msgid "U7, unicode-1-1-utf-7" -msgstr "" +msgstr "U7, unicode-1-1-utf-7" msgid "utf_8" -msgstr "" +msgstr "utf_8" msgid "U8, UTF, utf8, cp65001" -msgstr "" +msgstr "U8, UTF, utf8, cp65001" msgid "utf_8_sig" -msgstr "" +msgstr "utf_8_sig" -msgid "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points (``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer decode byte sequences that correspond to surrogate code points." +msgid "" +"The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " +"(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " +"decode byte sequences that correspond to surrogate code points." msgstr "" +"کدگذارهای utf-16\\* و utf-32\\* دیگر اجازه نمی‌دهند نقاط کد جانشین " +"(``U+D800``--``U+DFFF``) کدگذاری شوند. کدگشاهای " +"utf-32\\* دیگر دنباله‌های بایتی متناظر با نقاط کد جانشین (surrogate code " +"points) را کدگشایی نمی‌کنند." msgid "``cp65001`` is now an alias to ``utf_8``." -msgstr "" +msgstr "``cp65001`` اکنون نام مستعاری برای ``utf_8`` است." msgid "On Windows, ``cpXXX`` codecs are now available for all code pages." -msgstr "" +msgstr "در ویندوز، کدک‌های ``cpXXX`` اکنون برای همه‌ی صفحات کد در دسترس هستند." msgid "Python Specific Encodings" -msgstr "" +msgstr "کدگذاری‌های خاص پایتون" -msgid "A number of predefined codecs are specific to Python, so their codec names have no meaning outside Python. These are listed in the tables below based on the expected input and output types (note that while text encodings are the most common use case for codecs, the underlying codec infrastructure supports arbitrary data transforms rather than just text encodings). For asymmetric codecs, the stated meaning describes the encoding direction." -msgstr "" +msgid "" +"A number of predefined codecs are specific to Python, so their codec names " +"have no meaning outside Python. These are listed in the tables below based " +"on the expected input and output types (note that while text encodings are " +"the most common use case for codecs, the underlying codec infrastructure " +"supports arbitrary data transforms rather than just text encodings). For " +"asymmetric codecs, the stated meaning describes the encoding direction." +msgstr "" +"تعدادی از کدک‌های از پیش تعریف‌شده مختص پایتون هستند، بنابراین نام‌های کدک " +"آن‌ها در خارج از پایتون معنایی ندارند. این موارد در جدول‌های زیر بر اساس " +"انواع ورودی و خروجی مورد انتظار فهرست شده‌اند (توجه داشته باشید که اگرچه " +"کدگذاری‌های متن رایج‌ترین مورد استفاده برای کدک‌ها هستند، زیرساخت زیربنایی کدک " +"از تبدیل‌های دلخواه داده پشتیبانی می‌کند، نه فقط از کدگذاری‌های متن). در " +"کدک‌های نامتقارن، معنای ذکرشده جهت کدگذاری را توصیف می‌کند." msgid "Text Encodings" -msgstr "" +msgstr "کدگذاری‌های متن" -msgid "The following codecs provide :class:`str` to :class:`bytes` encoding and :term:`bytes-like object` to :class:`str` decoding, similar to the Unicode text encodings." +msgid "" +"The following codecs provide :class:`str` to :class:`bytes` encoding " +"and :term:`bytes-like object` to :class:`str` decoding, similar to the " +"Unicode text encodings." msgstr "" +"کدک‌های زیر، مشابه کدگذاری‌های متنی یونیکد، کدگذاری از :class:`str` " +"به :class:`bytes` و کدگشایی از :term:`bytes-like object` به :class:`str` را " +"فراهم می‌کنند." msgid "idna" -msgstr "" +msgstr "idna" -msgid "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only ``errors='strict'`` is supported." +msgid "" +"Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " +"``errors='strict'`` is supported." msgstr "" +"پیاده‌سازی :rfc:`3490`، همچنین :mod:`encodings.idna` را ببینید. فقط " +"``errors='strict'`` پشتیبانی می‌شود." msgid "mbcs" -msgstr "" +msgstr "mbcs" msgid "ansi, dbcs" -msgstr "" +msgstr "ansi, dbcs" -msgid "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." -msgstr "" +msgid "" +"Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." +msgstr "فقط ویندوز: عملوند را بر اساس صفحه‌کد ANSI (CP_ACP) کدگذاری می‌کند." msgid "oem" -msgstr "" +msgstr "oem" -msgid "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." -msgstr "" +msgid "" +"Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." +msgstr "فقط ویندوز: عملوند بر اساس صفحه‌کد OEM کدگذاری می‌شود (CP_OEMCP)." msgid "palmos" -msgstr "" +msgstr "palmos" msgid "Encoding of PalmOS 3.5." -msgstr "" +msgstr "کدگذاری PalmOS 3.5." msgid "punycode" -msgstr "" +msgstr "punycode" msgid "Implement :rfc:`3492`. Stateful codecs are not supported." -msgstr "" +msgstr "پیاده‌سازی :rfc:`3492`. کدک‌های حالت‌دار پشتیبانی نمی‌شوند." -msgid "The decoding and encoding algorithms scale poorly, so limit the length of untrusted input." +msgid "" +"The decoding and encoding algorithms scale poorly, so limit the length of " +"untrusted input." msgstr "" +"الگوریتم‌های کدگشایی و کدگذاری مقیاس‌پذیری ضعیفی دارند، بنابراین طول ورودی " +"غیرقابل‌اعتماد را محدود کنید." msgid "raw_unicode_escape" -msgstr "" +msgstr "raw_unicode_escape" -msgid "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for other code points. Existing backslashes are not escaped in any way. It is used in the Python pickle protocol." +msgid "" +"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " +"other code points. Existing backslashes are not escaped in any way. It is " +"used in the Python pickle protocol." msgstr "" +"کدگذاری Latin-1 با :samp:`\\\\u{XXXX}` و :samp:`\\\\U{XXXXXXXX}` برای سایر " +"نقاط کد. بک‌اسلش‌های موجود به هیچ وجه خنثی نمی‌شوند. این کدگذاری در پروتکل " +"pickle پایتون استفاده می‌شود." msgid "undefined" -msgstr "" +msgstr "تعریف‌نشده" msgid "This Codec should only be used for testing purposes." -msgstr "" +msgstr "این کدک (Codec) باید تنها برای اهداف آزمایشی استفاده شود." -msgid "Raise an exception for all conversions, even empty strings. The error handler is ignored." +msgid "" +"Raise an exception for all conversions, even empty strings. The error " +"handler is ignored." msgstr "" +"برای همه تبدیل‌ها، حتی رشته‌های خالی، استثنا پرتاب می‌کند. هندلر خطا " +"نادیده گرفته می‌شود." msgid "unicode_escape" -msgstr "" +msgstr "unicode_escape" -msgid "Encoding suitable as the contents of a Unicode literal in ASCII-encoded Python source code, except that quotes are not escaped. Decode from Latin-1 source code. Beware that Python source code actually uses UTF-8 by default." +msgid "" +"Encoding suitable as the contents of a Unicode literal in ASCII-encoded " +"Python source code, except that quotes are not escaped. Decode from Latin-1 " +"source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" +"کدگذاری مناسب برای محتوای یک لفظی یونیکد در کد منبع پایتون با کدگذاری " +"ASCII، به جز اینکه علامت‌های نقل‌قول خنثی نمی‌شوند. کدگشایی از کد منبع " +"Latin-1. توجه داشته باشید که کد منبع پایتون در واقع به‌طور پیش‌فرض از UTF-8 " +"استفاده می‌کند." msgid "\"unicode_internal\" codec is removed." -msgstr "" +msgstr "کدک \"unicode_internal\" حذف شده است." msgid "Binary Transforms" -msgstr "" +msgstr "تبدیل‌های دودویی" -msgid "The following codecs provide binary transforms: :term:`bytes-like object` to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` (which only produces :class:`str` output)." +msgid "" +"The following codecs provide binary transforms: :term:`bytes-like object` " +"to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " +"(which only produces :class:`str` output)." msgstr "" +"کدک‌های زیر تبدیل‌های دودویی را ارائه می‌دهند: نگاشت‌هایی از :term:`شیء " +"شبه‌بایت ` به :class:`bytes`. :meth:`bytes.decode` از " +"آن‌ها پشتیبانی نمی‌کند (که تنها خروجی :class:`str` را تولید می‌کند)." msgid "Encoder / decoder" -msgstr "" +msgstr "کدگذار / کدگشا" msgid "base64_codec [#b64]_" -msgstr "" +msgstr "base64_codec [#b64]_" msgid "base64, base_64" -msgstr "" +msgstr "base64, base_64" -msgid "Convert the operand to multiline MIME base64 (the result always includes a trailing ``'\\n'``)." +msgid "" +"Convert the operand to multiline MIME base64 (the result always includes a " +"trailing ``'\\n'``)." msgstr "" +"عملوند را به base64 MIME چندخطی تبدیل می‌کند (نتیجه همیشه شامل یک ``'\\n'`` " +"در انتها است)." -msgid "accepts any :term:`bytes-like object` as input for encoding and decoding" +msgid "" +"accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" +"هر :term:`bytes-like object` را به‌عنوان ورودی برای کدگذاری و کدگشایی می‌پذیرد" msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -msgstr "" +msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgid "bz2_codec" -msgstr "" +msgstr "bz2_codec" msgid "bz2" -msgstr "" +msgstr "bz2" msgid "Compress the operand using bz2." -msgstr "" +msgstr "عملوند را با استفاده از bz2 فشرده کنید." msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" -msgstr "" +msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgid "hex_codec" -msgstr "" +msgstr "hex_codec" msgid "hex" -msgstr "" +msgstr "مبنای شانزده" -msgid "Convert the operand to hexadecimal representation, with two digits per byte." -msgstr "" +msgid "" +"Convert the operand to hexadecimal representation, with two digits per byte." +msgstr "عملوند را به نمایش مبنای شانزده تبدیل کنید، با ۲ رقم به‌ازای هر بایت." msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -msgstr "" +msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgid "quopri_codec" -msgstr "" +msgstr "quopri_codec" msgid "quopri, quotedprintable, quoted_printable" -msgstr "" +msgstr "quopri, quotedprintable, quoted_printable" msgid "Convert the operand to MIME quoted printable." -msgstr "" +msgstr "عملوند را به MIME quoted printable تبدیل کنید." msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -msgstr "" +msgstr ":meth:`quopri.encode` با ``quotetabs=True`` / :meth:`quopri.decode`" msgid "uu_codec" -msgstr "" +msgstr "uu_codec" msgid "uu" -msgstr "" +msgstr "uu" msgid "Convert the operand using uuencode." -msgstr "" +msgstr "عملوند را با استفاده از uuencode تبدیل کنید." msgid "zlib_codec" -msgstr "" +msgstr "zlib_codec" msgid "zip, zlib" -msgstr "" +msgstr "zip, zlib" msgid "Compress the operand using gzip." -msgstr "" +msgstr "عملوند را با gzip فشرده کنید." msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" -msgstr "" +msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -msgid "In addition to :term:`bytes-like objects `, ``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for decoding" +msgid "" +"In addition to :term:`bytes-like objects `, " +"``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " +"decoding" msgstr "" +"علاوه بر :term:`اشیاء شبه‌بایت `، ``'base64_codec'`` " +"همچنین نمونه‌های :class:`str` را که فقط شامل نویسه‌های ASCII هستند، برای " +"کدگشایی می‌پذیرد" msgid "Restoration of the binary transforms." -msgstr "" +msgstr "بازیابی تبدیل‌های دودویی." msgid "Restoration of the aliases for the binary transforms." -msgstr "" +msgstr "بازگرداندن نام‌های مستعار برای تبدیل‌های دودویی." msgid "Standalone Codec Functions" -msgstr "" +msgstr "توابع مستقل کدک (Codec)" -msgid "The following functions provide encoding and decoding functionality similar to codecs, but are not available as named codecs through :func:`codecs.encode` or :func:`codecs.decode`. They are used internally (for example, by :mod:`pickle`) and behave similarly to the ``string_escape`` codec that was removed in Python 3." -msgstr "" +msgid "" +"The following functions provide encoding and decoding functionality similar " +"to codecs, but are not available as named codecs " +"through :func:`codecs.encode` or :func:`codecs.decode`. They are used " +"internally (for example, by :mod:`pickle`) and behave similarly to the " +"``string_escape`` codec that was removed in Python 3." +msgstr "" +"توابع زیر عملکرد کدگذاری و کدگشایی مشابه کدک‌ها (codecs) را فراهم می‌کنند، " +"اما به‌عنوان کدک‌های نام‌دار از طریق :func:`codecs.encode` " +"یا :func:`codecs.decode` در دسترس نیستند. این توابع به‌صورت داخلی (برای " +"مثال، توسط :mod:`pickle`) استفاده می‌شوند و رفتاری مشابه کدک " +"``string_escape`` دارند که در Python 3 حذف شده است." -msgid "Encode *input* using escape sequences. Similar to how :func:`repr` on bytes produces escaped byte values." +msgid "" +"Encode *input* using escape sequences. Similar to how :func:`repr` on bytes " +"produces escaped byte values." msgstr "" +"کدگذاری *input* با استفاده از دنباله‌های خنثی‌سازی. مشابه روشی " +"که :func:`repr` بر روی بایت‌ها مقادیر بایتی خنثی‌شده تولید می‌کند." msgid "*input* must be a :class:`bytes` object." -msgstr "" +msgstr "*input* باید یک شیء :class:`bytes` باشد." -msgid "Returns a tuple ``(output, length)`` where *output* is a :class:`bytes` object and *length* is the number of bytes consumed." +msgid "" +"Returns a tuple ``(output, length)`` where *output* is a :class:`bytes` " +"object and *length* is the number of bytes consumed." msgstr "" +"یک تاپل ``(output, length)`` برمی‌گرداند که در آن *output* یک " +"شیء :class:`bytes` و *length* تعداد بایت‌های مصرف‌شده است." msgid "Decode *input* from escape sequences back to the original bytes." -msgstr "" +msgstr "*input* را از دنباله‌های خنثی‌سازی به بایت‌های اصلی کدگشایی می‌کند." msgid "*input* must be a :term:`bytes-like object`." -msgstr "" +msgstr "*input* باید یک :term:`bytes-like object` باشد." msgid "Text Transforms" -msgstr "" +msgstr "تبدیل‌های متن" -msgid "The following codec provides a text transform: a :class:`str` to :class:`str` mapping. It is not supported by :meth:`str.encode` (which only produces :class:`bytes` output)." +msgid "" +"The following codec provides a text transform: a :class:`str` " +"to :class:`str` mapping. It is not supported by :meth:`str.encode` (which " +"only produces :class:`bytes` output)." msgstr "" +"کدک زیر یک تبدیل متنی فراهم می‌کند: نگاشتی از :class:`str` " +"به :class:`str`. :meth:`str.encode` از آن پشتیبانی نمی‌کند (که فقط " +"خروجی :class:`bytes` تولید می‌کند)." msgid "rot_13" -msgstr "" +msgstr "rot_13" msgid "rot13" -msgstr "" +msgstr "rot13" msgid "Return the Caesar-cypher encryption of the operand." -msgstr "" +msgstr "رمزنگاری سزاری عملوند را برمی‌گرداند." msgid "Restoration of the ``rot_13`` text transform." -msgstr "" +msgstr "بازگردانی تبدیل متنی ``rot_13``." msgid "Restoration of the ``rot13`` alias." -msgstr "" +msgstr "بازگردانی نام مستعار ``rot13``." msgid ":mod:`!encodings` --- Encodings package" -msgstr "" +msgstr ":mod:`!encodings` --- بسته‌ی encodings" msgid "This module implements the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را پیاده‌سازی می‌کند:" msgid "Normalize encoding name *encoding*." -msgstr "" +msgstr "نام کدگذاری *encoding* را عادی‌سازی کنید." -msgid "Normalization works as follows: all non-alphanumeric characters except the dot used for Python package names are collapsed and replaced with a single underscore, leading and trailing underscores are removed. For example, ``' -;#'`` becomes ``'_'``." +msgid "" +"Normalization works as follows: all non-alphanumeric characters except the " +"dot used for Python package names are collapsed and replaced with a single " +"underscore, leading and trailing underscores are removed. For example, ``' " +"-;#'`` becomes ``'_'``." msgstr "" +"نرمال‌سازی به این صورت انجام می‌شود: همه‌ی نویسه‌های غیرحرفی‌عددی، به‌جز نقطه‌ای که " +"در نام بسته‌های پایتون به کار می‌رود، فشرده می‌شوند و با یک زیرخط جایگزین " +"می‌شوند؛ زیرخط‌های آغازین و پایانی حذف می‌شوند. برای مثال، ``' -;#'`` به " +"``'_'`` تبدیل می‌شود." msgid "Note that *encoding* should be ASCII only." -msgstr "" +msgstr "توجه داشته باشید که *کدگذاری* باید فقط ASCII باشد." -msgid "The following functions should not be used directly, except for testing purposes; :func:`codecs.lookup` should be used instead." +msgid "" +"The following functions should not be used directly, except for testing " +"purposes; :func:`codecs.lookup` should be used instead." msgstr "" +"توابع زیر نباید به‌صورت مستقیم استفاده شوند، مگر برای اهداف آزمون؛ باید " +"به‌جای آن‌ها از :func:`codecs.lookup` استفاده شود." -msgid "Search for the codec module corresponding to the given encoding name *encoding*." +msgid "" +"Search for the codec module corresponding to the given encoding name " +"*encoding*." msgstr "" +"ماژول کدک (codec) متناظر با نام کدگذاری داده‌شده *encoding* را جستجو کنید." -msgid "This function first normalizes the *encoding* using :func:`normalize_encoding`, then looks for a corresponding alias. It attempts to import a codec module from the encodings package using either the alias or the normalized name. If the module is found and defines a valid ``getregentry()`` function that returns a :class:`codecs.CodecInfo` object, the codec is cached and returned." -msgstr "" +msgid "" +"This function first normalizes the *encoding* " +"using :func:`normalize_encoding`, then looks for a corresponding alias. It " +"attempts to import a codec module from the encodings package using either " +"the alias or the normalized name. If the module is found and defines a " +"valid ``getregentry()`` function that returns a :class:`codecs.CodecInfo` " +"object, the codec is cached and returned." +msgstr "" +"این تابع ابتدا *کدگذاری* را با استفاده از :func:`normalize_encoding` " +"به‌هنجار می‌کند، سپس به دنبال یک نام مستعار متناظر می‌گردد. این تابع تلاش " +"می‌کند یک ماژول کدک را از بسته‌ی encodings با استفاده از نام مستعار یا نام " +"به‌هنجارشده ایمپورت کند. اگر ماژول پیدا شود و تابع ``getregentry()`` معتبری " +"را تعریف کند که یک شیء :class:`codecs.CodecInfo` را برمی‌گرداند، کدک در " +"نهانگاه ذخیره و برگردانده می‌شود." -msgid "If the codec module defines a ``getaliases()`` function any returned aliases are registered for future use." +msgid "" +"If the codec module defines a ``getaliases()`` function any returned " +"aliases are registered for future use." msgstr "" +"اگر ماژول کدک (codec) تابع ``getaliases()`` را تعریف کند، هر نام مستعار " +"برگردانده‌شده برای استفاده در آینده ثبت می‌شود." -msgid "Search for a Windows code page encoding *encoding* of the form ``cpXXXX``." -msgstr "" +msgid "" +"Search for a Windows code page encoding *encoding* of the form ``cpXXXX``." +msgstr "یک کدگذاری صفحه‌کد ویندوز *encoding* به شکل ``cpXXXX`` را جستجو کنید." -msgid "If the code page is valid and supported, return a :class:`codecs.CodecInfo` object for it." +msgid "" +"If the code page is valid and supported, return a :class:`codecs.CodecInfo` " +"object for it." msgstr "" +"اگر صفحه کد معتبر و پشتیبانی‌شده باشد، یک شیء :class:`codecs.CodecInfo` برای " +"آن برمی‌گرداند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" msgid "This module implements the following exception:" -msgstr "" +msgstr "این ماژول استثنای زیر را پیاده‌سازی می‌کند:" msgid "Raised when a codec is invalid or incompatible." -msgstr "" +msgstr "هنگامی که یک کدک نامعتبر یا ناسازگار باشد، پرتاب می‌شود." -msgid ":mod:`!encodings.idna` --- Internationalized Domain Names in Applications" -msgstr "" +msgid "" +":mod:`!encodings.idna` --- Internationalized Domain Names in Applications" +msgstr ":mod:`!encodings.idna` --- نام‌های دامنه بین‌المللی‌شده در کاربردها" -msgid "This module implements :rfc:`3490` (Internationalized Domain Names in Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)). It builds upon the ``punycode`` encoding and :mod:`stringprep`." +msgid "" +"This module implements :rfc:`3490` (Internationalized Domain Names in " +"Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " +"Internationalized Domain Names (IDN)). It builds upon the ``punycode`` " +"encoding and :mod:`stringprep`." msgstr "" +"این ماژول :rfc:`3490` (نام‌های دامنه بین‌المللی‌سازی‌شده در کاربردها) " +"و :rfc:`3492` (Nameprep: یک پروفایل Stringprep برای نام‌های دامنه " +"بین‌المللی‌سازی‌شده (IDN)) را پیاده‌سازی می‌کند. این ماژول بر پایه‌ی کدگذاری " +"``punycode`` و :mod:`stringprep` ساخته شده است." -msgid "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the third-party :pypi:`idna` module." +msgid "" +"If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use " +"the third-party :pypi:`idna` module." msgstr "" +"اگر به استاندارد IDNA 2008 از :rfc:`5891` و :rfc:`5895` نیاز دارید، از " +"ماژول شخص ثالث :pypi:`idna` استفاده کنید." -msgid "These RFCs together define a protocol to support non-ASCII characters in domain names. A domain name containing non-ASCII characters (such as ``www.Alliancefrançaise.nu``) is converted into an ASCII-compatible encoding (ACE, such as ``www.xn--alliancefranaise-npb.nu``). The ACE form of the domain name is then used in all places where arbitrary characters are not allowed by the protocol, such as DNS queries, HTTP :mailheader:`Host` fields, and so on. This conversion is carried out in the application; if possible invisible to the user: The application should transparently convert Unicode domain labels to IDNA on the wire, and convert back ACE labels to Unicode before presenting them to the user." -msgstr "" +msgid "" +"These RFCs together define a protocol to support non-ASCII characters in " +"domain names. A domain name containing non-ASCII characters (such as " +"``www.Alliancefrançaise.nu``) is converted into an ASCII-compatible " +"encoding (ACE, such as ``www.xn--alliancefranaise-npb.nu``). The ACE form " +"of the domain name is then used in all places where arbitrary characters " +"are not allowed by the protocol, such as DNS queries, " +"HTTP :mailheader:`Host` fields, and so on. This conversion is carried out " +"in the application; if possible invisible to the user: The application " +"should transparently convert Unicode domain labels to IDNA on the wire, and " +"convert back ACE labels to Unicode before presenting them to the user." +msgstr "" +"این RFCها با هم یک پروتکل را برای پشتیبانی از نویسه‌های غیر ASCII در نام‌های " +"دامنه تعریف می‌کنند. یک نام دامنه حاوی نویسه‌های غیر ASCII (مانند " +"``www.Alliancefrançaise.nu``) به یک کدگذاری سازگار با ASCII (ACE، مانند " +"``www.xn--alliancefranaise-npb.nu``) تبدیل می‌شود. سپس از شکل ACE نام دامنه " +"در تمام جاهایی که پروتکل نویسه‌های دلخواه را مجاز نمی‌داند، مانند پرسمان‌های " +"DNS، فیلدهای :mailheader:`Host` HTTP و غیره استفاده می‌شود. این تبدیل در " +"برنامه انجام می‌شود؛ در صورت امکان، باید برای کاربر نامرئی باشد: برنامه باید " +"برچسب‌های دامنه‌ی یونیکد را به‌صورت شفاف در شبکه به IDNA تبدیل کند و پیش از " +"نمایش آن‌ها به کاربر، برچسب‌های ACE را به یونیکد بازگرداند." -msgid "Python supports this conversion in several ways: the ``idna`` codec performs conversion between Unicode and ACE, separating an input string into labels based on the separator characters defined in :rfc:`section 3.1 of RFC 3490 <3490#section-3.1>` and converting each label to ACE as required, and conversely separating an input byte string into labels based on the ``.`` separator and converting any ACE labels found into unicode. Furthermore, the :mod:`socket` module transparently converts Unicode host names to ACE, so that applications need not be concerned about converting host names themselves when they pass them to the socket module. On top of that, modules that have host names as function parameters, such as :mod:`http.client` and :mod:`ftplib`, accept Unicode host names (:mod:`http.client` then also transparently sends an IDNA hostname in the :mailheader:`Host` field if it sends that field at all)." -msgstr "" +msgid "" +"Python supports this conversion in several ways: the ``idna`` codec " +"performs conversion between Unicode and ACE, separating an input string " +"into labels based on the separator characters defined in :rfc:`section 3.1 " +"of RFC 3490 <3490#section-3.1>` and converting each label to ACE as " +"required, and conversely separating an input byte string into labels based " +"on the ``.`` separator and converting any ACE labels found into unicode. " +"Furthermore, the :mod:`socket` module transparently converts Unicode host " +"names to ACE, so that applications need not be concerned about converting " +"host names themselves when they pass them to the socket module. On top of " +"that, modules that have host names as function parameters, such " +"as :mod:`http.client` and :mod:`ftplib`, accept Unicode host names " +"(:mod:`http.client` then also transparently sends an IDNA hostname in " +"the :mailheader:`Host` field if it sends that field at all)." +msgstr "" +"پایتون از این تبدیل به چند روش پشتیبانی می‌کند: کدک ``idna`` تبدیل بین " +"یونیکد و ACE را انجام می‌دهد، یک رشته ورودی را بر اساس نویسه‌های جداکننده " +"تعریف‌شده در :rfc:`بخش 3.1 از RFC 3490 <3490#section-3.1>` به برچسب‌ها تفکیک " +"می‌کند و هر برچسب را در صورت نیاز به ACE تبدیل می‌کند، و برعکس، یک رشته بایتی " +"ورودی را بر اساس جداکننده ``.`` به برچسب‌ها تفکیک می‌کند و هر برچسب ACE " +"یافت‌شده را به یونیکد تبدیل می‌کند. علاوه بر این، ماژول :mod:`socket` نام‌های " +"میزبان یونیکد را به‌صورت شفاف به ACE تبدیل می‌کند، تا برنامه‌ها هنگامی که " +"نام‌های میزبان را به ماژول socket می‌دهند، نیازی نباشد خودشان آن‌ها را تبدیل " +"کنند. افزون بر آن، ماژول‌هایی که نام‌های میزبان را به‌عنوان پارامترهای تابع " +"دارند، مانند :mod:`http.client` و :mod:`ftplib`، نام‌های میزبان یونیکد را " +"می‌پذیرند (در این صورت :mod:`http.client` همچنین به‌صورت شفاف یک نام میزبان " +"IDNA را در فیلد :mailheader:`Host` ارسال می‌کند، اگر اصلاً آن فیلد را ارسال " +"کند)." -msgid "When receiving host names from the wire (such as in reverse name lookup), no automatic conversion to Unicode is performed: applications wishing to present such host names to the user should decode them to Unicode." +msgid "" +"When receiving host names from the wire (such as in reverse name lookup), " +"no automatic conversion to Unicode is performed: applications wishing to " +"present such host names to the user should decode them to Unicode." msgstr "" +"هنگام دریافت نام‌های میزبان از شبکه (مانند جستجوی معکوس نام)، هیچ تبدیل " +"خودکاری به یونیکد انجام نمی‌شود: برنامه‌هایی که می‌خواهند چنین نام‌های میزبانی " +"را به کاربر ارائه دهند، باید آن‌ها را به یونیکد کدگشایی کنند." -msgid "The module :mod:`!encodings.idna` also implements the nameprep procedure, which performs certain normalizations on host names, to achieve case-insensitivity of international domain names, and to unify similar characters. The nameprep functions can be used directly if desired." +msgid "" +"The module :mod:`!encodings.idna` also implements the nameprep procedure, " +"which performs certain normalizations on host names, to achieve case-" +"insensitivity of international domain names, and to unify similar " +"characters. The nameprep functions can be used directly if desired." msgstr "" +"ماژول :mod:`!encodings.idna` همچنین رویه‌ی nameprep را پیاده‌سازی می‌کند، که " +"نرمال‌سازی‌های مشخصی را روی نام‌های میزبان انجام می‌دهد تا عدم حساسیت به بزرگی " +"و کوچکی حروف در نام‌های دامنه بین‌المللی حاصل شود و نویسه‌های مشابه یکسان‌سازی " +"شوند. در صورت تمایل می‌توان توابع nameprep را مستقیماً استفاده کرد." -msgid "Return the nameprepped version of *label*. The implementation currently assumes query strings, so ``AllowUnassigned`` is true." +msgid "" +"Return the nameprepped version of *label*. The implementation currently " +"assumes query strings, so ``AllowUnassigned`` is true." msgstr "" +"نسخه‌ی nameprepشده‌ی *label* را برمی‌گرداند. پیاده‌سازی در حال حاضر رشته‌های " +"پرس‌وجو را فرض می‌کند، بنابراین ``AllowUnassigned`` برابر true است." -msgid "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` is assumed to be false." +msgid "" +"Convert a label to ASCII, as specified in :rfc:`3490`. " +"``UseSTD3ASCIIRules`` is assumed to be false." msgstr "" +"یک برچسب را به ASCII تبدیل می‌کند، همان‌طور که در :rfc:`3490` مشخص شده است. " +"فرض می‌شود ``UseSTD3ASCIIRules`` false باشد." msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" +"یک برچسب را به یونیکد تبدیل کنید، همان‌طور که در :rfc:`3490` مشخص شده است." msgid ":mod:`!encodings.mbcs` --- Windows ANSI codepage" -msgstr "" +msgstr ":mod:`!encodings.mbcs` --- صفحه‌کد ANSI ویندوز" msgid "This module implements the ANSI codepage (CP_ACP)." -msgstr "" +msgstr "این ماژول صفحه کد ANSI (CP_ACP) را پیاده‌سازی می‌کند." -msgid "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used to encode, and ``'ignore'`` to decode." +msgid "" +"Before 3.2, the *errors* argument was ignored; ``'replace'`` was always " +"used to encode, and ``'ignore'`` to decode." msgstr "" +"پیش از 3.2، آرگومان *errors* نادیده گرفته می‌شد؛ برای کدگذاری همیشه از " +"``'replace'`` و برای کدگشایی از ``'ignore'`` استفاده می‌شد." msgid "Support any error handler." -msgstr "" +msgstr "از هر هندلر خطایی پشتیبانی می‌کند." msgid ":mod:`!encodings.utf_8_sig` --- UTF-8 codec with BOM signature" -msgstr "" +msgstr ":mod:`!encodings.utf_8_sig` --- کدک UTF-8 با امضای BOM" -msgid "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful encoder this is only done once (on the first write to the byte stream). On decoding, an optional UTF-8 encoded BOM at the start of the data will be skipped." -msgstr "" +msgid "" +"This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " +"encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " +"encoder this is only done once (on the first write to the byte stream). On " +"decoding, an optional UTF-8 encoded BOM at the start of the data will be " +"skipped." +msgstr "" +"این ماژول گونه‌ای از کدک UTF-8 را پیاده‌سازی می‌کند. هنگام کدگذاری، یک BOM " +"کدگذاری‌شده با UTF-8 به ابتدای بایت‌های کدگذاری‌شده با UTF-8 اضافه می‌شود. برای " +"کدگذار حالت‌مند، این کار تنها یک بار انجام می‌شود (در نخستین نوشتن روی جریان " +"بایت). هنگام کدگشایی، یک BOM اختیاری کدگذاری‌شده با UTF-8 در ابتدای داده " +"نادیده گرفته می‌شود." msgid "Unicode" -msgstr "" +msgstr "یونیکد" msgid "encode" -msgstr "" +msgstr "کدگذاری" msgid "decode" -msgstr "" +msgstr "کدگشایی" msgid "streams" -msgstr "" +msgstr "جریان‌ها" msgid "stackable" -msgstr "" +msgstr "قابل پشته‌شدن" msgid "strict" -msgstr "" +msgstr "سخت‌گیرانه" msgid "error handler's name" -msgstr "" +msgstr "نام هندلر خطا" msgid "ignore" -msgstr "" +msgstr "نادیده گرفتن" msgid "replace" -msgstr "" +msgstr "جایگزینی" msgid "backslashreplace" -msgstr "" +msgstr "backslashreplace" msgid "surrogateescape" -msgstr "" +msgstr "surrogateescape" msgid "? (question mark)" -msgstr "" +msgstr "؟ (علامت پرسش)" msgid "replacement character" -msgstr "" +msgstr "نویسه جایگزین" msgid "\\ (backslash)" -msgstr "" +msgstr "\\ (بک‌اسلش)" msgid "escape sequence" -msgstr "" +msgstr "دنباله خنثی‌سازی" msgid "\\x" -msgstr "" +msgstr "\\x" msgid "\\u" -msgstr "" +msgstr "\\u" msgid "\\U" -msgstr "" +msgstr "\\U" msgid "xmlcharrefreplace" -msgstr "" +msgstr "xmlcharrefreplace" msgid "namereplace" -msgstr "" +msgstr "namereplace" msgid "\\N" -msgstr "" +msgstr "\\N" msgid "surrogatepass" -msgstr "" +msgstr "surrogatepass" diff --git a/library/codeop.po b/library/codeop.po index 1fe85747f..3f77f64f8 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -22,43 +22,119 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!codeop` --- Compile Python code" -msgstr "" +msgstr ":mod:`!codeop` --- کامپایل کد پایتون" msgid "**Source code:** :source:`Lib/codeop.py`" -msgstr "" +msgstr ":source:`Lib/codeop.py`" -msgid "The :mod:`!codeop` module provides utilities upon which the Python read-eval-print loop can be emulated, as is done in the :mod:`code` module. As a result, you probably don't want to use the module directly; if you want to include such a loop in your program you probably want to use the :mod:`code` module instead." +msgid "" +"The :mod:`!codeop` module provides utilities upon which the Python read-" +"eval-print loop can be emulated, as is done in the :mod:`code` module. As a" +" result, you probably don't want to use the module directly; if you want to " +"include such a loop in your program you probably want to use the :mod:`code`" +" module instead." msgstr "" +"ماژول :mod:`!codeop` ابزارهایی را فراهم می‌کند که می‌توان بر پایه‌ی آن‌ها " +"حلقه‌ی خواندن-ارزیابی-چاپ پایتون را شبیه‌سازی کرد، همان‌طور که در ماژول " +":mod:`code` انجام می‌شود. در نتیجه، احتمالاً نمی‌خواهید به‌طور مستقیم از این" +" ماژول استفاده کنید؛ اگر می‌خواهید چنین حلقه‌ای را در برنامه‌ی خود بگنجانید، " +"احتمالاً می‌خواهید به‌جای آن از ماژول :mod:`code` استفاده کنید." msgid "There are two parts to this job:" -msgstr "" +msgstr "این کار دو بخش دارد:" -msgid "Being able to tell if a line of input completes a Python statement: in short, telling whether to print '``>>>``' or '``...``' next." +msgid "" +"Being able to tell if a line of input completes a Python statement: in " +"short, telling whether to print '``>>>``' or '``...``' next." msgstr "" +"توانایی تشخیص اینکه آیا یک خط ورودی یک دستور پایتون را کامل می‌کند: به‌طور " +"خلاصه، تشخیص اینکه در ادامه '``>>>``' چاپ شود یا '``...``'." -msgid "Remembering which future statements the user has entered, so subsequent input can be compiled with these in effect." +msgid "" +"Remembering which future statements the user has entered, so subsequent " +"input can be compiled with these in effect." msgstr "" +"به‌خاطر سپردن اینکه کاربر کدام دستورهای آینده (future statements) را وارد " +"کرده است، تا ورودی بعدی بتواند با اعمال آن‌ها کامپایل شود." -msgid "The :mod:`!codeop` module provides a way of doing each of these things, and a way of doing them both." +msgid "" +"The :mod:`!codeop` module provides a way of doing each of these things, and " +"a way of doing them both." msgstr "" +"ماژول :mod:`!codeop` راهی برای انجام هر یک از این کارها و راهی برای انجام هر" +" دوی آن‌ها فراهم می‌کند." msgid "To do just the former:" -msgstr "" +msgstr "برای انجام تنها مورد اول:" -msgid "Tries to compile *source*, which should be a string of Python code and return a code object if *source* is valid Python code. In that case, the filename attribute of the code object will be *filename*, which defaults to ``''``. Returns ``None`` if *source* is *not* valid Python code, but is a prefix of valid Python code." +msgid "" +"Tries to compile *source*, which should be a string of Python code and " +"return a code object if *source* is valid Python code. In that case, the " +"filename attribute of the code object will be *filename*, which defaults to " +"``''``. Returns ``None`` if *source* is *not* valid Python code, but" +" is a prefix of valid Python code." msgstr "" +"تلاش می‌کند *source* را کامپایل کند، که باید رشته‌ای از کد پایتون باشد، و در" +" صورتی که *source* کد معتبر پایتون باشد، یک شیء کد برمی‌گرداند. در این حالت،" +" ویژگی filename شیء کد برابر *filename* خواهد بود، که به‌طور پیش‌فرض " +"``''`` است. اگر *source* کد معتبر پایتون *نباشد*، اما پیشوندی از کد " +"معتبر پایتون باشد، ``None`` برمی‌گرداند." -msgid "If there is a problem with *source*, an exception will be raised. :exc:`SyntaxError` is raised if there is invalid Python syntax, and :exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal." +msgid "" +"If there is a problem with *source*, an exception will be raised. " +":exc:`SyntaxError` is raised if there is invalid Python syntax, and " +":exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal." msgstr "" +"اگر مشکلی در *source* وجود داشته باشد، استثنایی پرتاب خواهد شد. اگر سینتکس " +"پایتون نامعتبر باشد، :exc:`SyntaxError` پرتاب می‌شود، و در صورت وجود یک " +"لفظی نامعتبر، :exc:`OverflowError` یا :exc:`ValueError` پرتاب می‌شود." -msgid "The *symbol* argument determines whether *source* is compiled as a statement (``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) or as an :term:`expression` (``'eval'``). Any other value will cause :exc:`ValueError` to be raised." +msgid "" +"The *symbol* argument determines whether *source* is compiled as a statement" +" (``'single'``, the default), as a sequence of :term:`statement` " +"(``'exec'``) or as an :term:`expression` (``'eval'``). Any other value will" +" cause :exc:`ValueError` to be raised." msgstr "" +"آرگومان *symbol* تعیین می‌کند که *source* به‌عنوان یک دستور (``'single'``، " +"پیش‌فرض)، به‌عنوان دنباله‌ای از :term:`دستورها ` (``'exec'``) یا" +" به‌عنوان یک :term:`عبارت ` (``'eval'``) کامپایل شود. هر مقدار " +"دیگری باعث پرتاب :exc:`ValueError` خواهد شد." -msgid "It is possible (but not likely) that the parser stops parsing with a successful outcome before reaching the end of the source; in this case, trailing symbols may be ignored instead of causing an error. For example, a backslash followed by two newlines may be followed by arbitrary garbage. This will be fixed once the API for the parser is better." +msgid "" +"It is possible (but not likely) that the parser stops parsing with a " +"successful outcome before reaching the end of the source; in this case, " +"trailing symbols may be ignored instead of causing an error. For example, a" +" backslash followed by two newlines may be followed by arbitrary garbage. " +"This will be fixed once the API for the parser is better." msgstr "" +"ممکن است (هرچند بعید است) که پارسر (parser) پیش از رسیدن به انتهای کد " +"منبع، تجزیه را با نتیجه‌ای موفق متوقف کند؛ در این صورت، نمادهای انتهایی ممکن" +" است به‌جای ایجاد خطا نادیده گرفته شوند. برای مثال، ممکن است پس از یک " +"بک‌اسلش که با دو خط جدید دنبال شده است، محتوای نامعتبر دلخواهی قرار گیرد. " +"این مورد پس از بهبود API پارسر اصلاح خواهد شد." -msgid "Instances of this class have :meth:`~object.__call__` methods identical in signature to the built-in function :func:`compile`, but with the difference that if the instance compiles program text containing a :mod:`__future__` statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force." +msgid "" +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to the built-in function :func:`compile`, but with the difference " +"that if the instance compiles program text containing a :mod:`__future__` " +"statement, the instance 'remembers' and compiles all subsequent program " +"texts with the statement in force." msgstr "" +"نمونه‌های این کلاس دارای متدهای :meth:`~object.__call__` هستند که از نظر " +"امضا با تابع توکار :func:`compile` یکسان هستند، اما با این تفاوت که اگر " +"نمونه متن برنامه‌ای حاوی دستور :mod:`__future__` را کامپایل کند، نمونه آن را" +" «به خاطر می‌سپارد» و همه‌ی متن‌های برنامه‌ی بعدی را با فعال بودن آن دستور " +"کامپایل می‌کند." -msgid "Instances of this class have :meth:`~object.__call__` methods identical in signature to :func:`compile_command`; the difference is that if the instance compiles program text containing a :mod:`__future__` statement, the instance 'remembers' and compiles all subsequent program texts with the statement in force." +msgid "" +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to :func:`compile_command`; the difference is that if the instance" +" compiles program text containing a :mod:`__future__` statement, the " +"instance 'remembers' and compiles all subsequent program texts with the " +"statement in force." msgstr "" +"نمونه‌های این کلاس دارای متدهای :meth:`~object.__call__` هستند که از نظر " +"امضا با :func:`compile_command` یکسان هستند؛ تفاوت این است که اگر نمونه متن " +"برنامه‌ای را کامپایل کند که شامل یک دستور :mod:`__future__` باشد، آن نمونه " +"آن را «به خاطر می‌سپارد» و تمام متن‌های برنامه بعدی را با برقرار بودن این " +"دستور کامپایل می‌کند." diff --git a/library/collections.abc.po b/library/collections.abc.po index b6d4b1aa1..815e35092 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -24,22 +24,42 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!collections.abc` --- Abstract Base Classes for Containers" -msgstr "" +msgstr ":mod:`!collections.abc` --- کلاس‌های پایه انتزاعی برای ظروف" msgid "Formerly, this module was part of the :mod:`collections` module." -msgstr "" +msgstr "پیش‌تر، این ماژول بخشی از ماژول :mod:`collections` بود." msgid "**Source code:** :source:`Lib/_collections_abc.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/_collections_abc.py`" -msgid "This module provides :term:`abstract base classes ` that can be used to test whether a class provides a particular interface; for example, whether it is :term:`hashable` or whether it is a :term:`mapping`." +msgid "" +"This module provides :term:`abstract base classes ` " +"that can be used to test whether a class provides a particular interface; " +"for example, whether it is :term:`hashable` or whether it is a " +":term:`mapping`." msgstr "" +"این ماژول :term:`کلاس‌های پایه انتزاعی ` را فراهم " +"می‌کند که می‌توان از آن‌ها برای بررسی این‌که آیا یک کلاس رابط خاصی را ارائه " +"می‌دهد استفاده کرد؛ برای مثال، این‌که آیا :term:`هش‌پذیر ` است یا " +"یک :term:`نگاشت ` است." -msgid "An :func:`issubclass` or :func:`isinstance` test for an interface works in one of three ways." +msgid "" +"An :func:`issubclass` or :func:`isinstance` test for an interface works in " +"one of three ways." msgstr "" +"یک آزمون :func:`issubclass` یا :func:`isinstance` برای یک رابط به یکی از سه " +"روش عمل می‌کند." -msgid "A newly written class can inherit directly from one of the abstract base classes. The class must supply the required abstract methods. The remaining mixin methods come from inheritance and can be overridden if desired. Other methods may be added as needed:" +msgid "" +"A newly written class can inherit directly from one of the abstract base " +"classes. The class must supply the required abstract methods. The " +"remaining mixin methods come from inheritance and can be overridden if " +"desired. Other methods may be added as needed:" msgstr "" +"یک کلاس تازه‌نوشته‌شده می‌تواند مستقیماً از یکی از کلاس‌های پایه انتزاعی ارث" +" ببرد. این کلاس باید متدهای انتزاعی مورد نیاز را فراهم کند. متدهای میکسین " +" باقی‌مانده از طریق ارث‌بری به دست می‌آیند و در صورت تمایل می‌توان " +"آن‌ها را بازنویسی کرد. در صورت نیاز، می‌توان متدهای دیگری اضافه کرد:" msgid "" "class C(Sequence): # Direct inheritance\n" @@ -48,6 +68,11 @@ msgid "" " def __len__(self): ... # Required abstract method\n" " def count(self, value): ... # Optionally override a mixin method" msgstr "" +"class C(Sequence): # Direct inheritance\n" +" def __init__(self): ... # Extra method not required by the ABC\n" +" def __getitem__(self, index): ... # Required abstract method\n" +" def __len__(self): ... # Required abstract method\n" +" def count(self, value): ... # Optionally override a mixin method" msgid "" ">>> issubclass(C, Sequence)\n" @@ -55,9 +80,26 @@ msgid "" ">>> isinstance(C(), Sequence)\n" "True" msgstr "" +">>> issubclass(C, Sequence)\n" +"True\n" +">>> isinstance(C(), Sequence)\n" +"True" -msgid "Existing classes and built-in classes can be registered as \"virtual subclasses\" of the ABCs. Those classes should define the full API including all of the abstract methods and all of the mixin methods. This lets users rely on :func:`issubclass` or :func:`isinstance` tests to determine whether the full interface is supported. The exception to this rule is for methods that are automatically inferred from the rest of the API:" -msgstr "" +msgid "" +"Existing classes and built-in classes can be registered as \"virtual " +"subclasses\" of the ABCs. Those classes should define the full API " +"including all of the abstract methods and all of the mixin methods. This " +"lets users rely on :func:`issubclass` or :func:`isinstance` tests to " +"determine whether the full interface is supported. The exception to this " +"rule is for methods that are automatically inferred from the rest of the " +"API:" +msgstr "" +"کلاس‌های موجود و کلاس‌های توکار می‌توانند به‌عنوان «زیرکلاس‌های مجازی» " +"ABCها ثبت شوند. آن کلاس‌ها باید API کامل را، شامل تمام متدهای انتزاعی و " +"تمام متدهای ترکیبی ، تعریف کنند. این امر به کاربران اجازه می‌دهد برای" +" تعیین اینکه آیا رابط کامل پشتیبانی می‌شود، به آزمون‌های :func:`issubclass` " +"یا :func:`isinstance` اتکا کنند. استثنای این قاعده برای متدهایی است که " +"به‌طور خودکار از باقی API استنتاج می‌شوند:" msgid "" "class D: # No inheritance\n" @@ -69,6 +111,14 @@ msgid "" "\n" "Sequence.register(D) # Register instead of inherit" msgstr "" +"class D: # No inheritance\n" +" def __init__(self): ... # Extra method not required by the ABC\n" +" def __getitem__(self, index): ... # Abstract method\n" +" def __len__(self): ... # Abstract method\n" +" def count(self, value): ... # Mixin method\n" +" def index(self, value): ... # Mixin method\n" +"\n" +"Sequence.register(D) # Register instead of inherit" msgid "" ">>> issubclass(D, Sequence)\n" @@ -76,18 +126,38 @@ msgid "" ">>> isinstance(D(), Sequence)\n" "True" msgstr "" +">>> issubclass(D, Sequence)\n" +"True\n" +">>> isinstance(D(), Sequence)\n" +"True" -msgid "In this example, class :class:`!D` does not need to define ``__contains__``, ``__iter__``, and ``__reversed__`` because the :ref:`in-operator `, the :term:`iteration ` logic, and the :func:`reversed` function automatically fall back to using ``__getitem__`` and ``__len__``." +msgid "" +"In this example, class :class:`!D` does not need to define ``__contains__``," +" ``__iter__``, and ``__reversed__`` because the :ref:`in-operator " +"`, the :term:`iteration ` logic, and the " +":func:`reversed` function automatically fall back to using ``__getitem__`` " +"and ``__len__``." msgstr "" +"در این مثال، کلاس :class:`!D` نیازی به تعریف ``__contains__``، ``__iter__`` " +"و ``__reversed__`` ندارد، زیرا :ref:`عملگر in `، منطق " +":term:`تکرار ` و تابع :func:`reversed` به‌طور خودکار به استفاده از" +" ``__getitem__`` و ``__len__`` بازمی‌گردند." -msgid "Some simple interfaces are directly recognizable by the presence of the required methods (unless those methods have been set to :const:`None`):" +msgid "" +"Some simple interfaces are directly recognizable by the presence of the " +"required methods (unless those methods have been set to :const:`None`):" msgstr "" +"برخی رابط‌های ساده مستقیماً از روی وجود متدهای مورد نیاز قابل تشخیص هستند " +"(مگر آنکه آن متدها روی :const:`None` تنظیم شده باشند):" msgid "" "class E:\n" " def __iter__(self): ...\n" " def __next__(self): ..." msgstr "" +"class E:\n" +" def __iter__(self): ...\n" +" def __next__(self): ..." msgid "" ">>> issubclass(E, Iterable)\n" @@ -95,369 +165,626 @@ msgid "" ">>> isinstance(E(), Iterable)\n" "True" msgstr "" +">>> issubclass(E, Iterable)\n" +"True\n" +">>> isinstance(E(), Iterable)\n" +"True" -msgid "Complex interfaces do not support this last technique because an interface is more than just the presence of method names. Interfaces specify semantics and relationships between methods that cannot be inferred solely from the presence of specific method names. For example, knowing that a class supplies ``__getitem__``, ``__len__``, and ``__iter__`` is insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`." -msgstr "" +msgid "" +"Complex interfaces do not support this last technique because an interface " +"is more than just the presence of method names. Interfaces specify " +"semantics and relationships between methods that cannot be inferred solely " +"from the presence of specific method names. For example, knowing that a " +"class supplies ``__getitem__``, ``__len__``, and ``__iter__`` is " +"insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`." +msgstr "" +"رابط‌های پیچیده از این روش آخر پشتیبانی نمی‌کنند، زیرا یک رابط چیزی فراتر از" +" صرف وجود نام متدها است. رابط‌ها معناشناسی و روابط میان متدها را مشخص " +"می‌کنند، که نمی‌توان آن‌ها را صرفاً از وجود نام متدهای خاص استنتاج کرد. برای" +" مثال، دانستن اینکه یک کلاس ``__getitem__``، ``__len__`` و ``__iter__`` را " +"فراهم می‌کند، برای تمایز :class:`Sequence` از :class:`Mapping` کافی نیست." -msgid "These abstract classes now support ``[]``. See :ref:`types-genericalias` and :pep:`585`." +msgid "" +"These abstract classes now support ``[]``. See :ref:`types-genericalias` and" +" :pep:`585`." msgstr "" +"این کلاس‌های انتزاعی اکنون از ``[]`` پشتیبانی می‌کنند. :ref:`types-" +"genericalias` و :pep:`585` را ببینید." msgid "Collections Abstract Base Classes" -msgstr "" +msgstr "کلاس‌های پایه انتزاعی مجموعه‌ها" -msgid "The collections module offers the following :term:`ABCs `:" +msgid "" +"The collections module offers the following :term:`ABCs `:" msgstr "" +"ماژول collections :term:`کلاس‌های پایه انتزاعی ` زیر را" +" ارائه می‌دهد:" msgid "ABC" -msgstr "" +msgstr "ABC" msgid "Inherits from" -msgstr "" +msgstr "به ارث می‌برد از" msgid "Abstract Methods" -msgstr "" +msgstr "متدهای انتزاعی" msgid "Mixin Methods" -msgstr "" +msgstr "متدهای میکسین " msgid ":class:`Container` [1]_" -msgstr "" +msgstr ":class:`Container` [1]_" msgid "``__contains__``" -msgstr "" +msgstr "``__contains__``" msgid ":class:`Hashable` [1]_" -msgstr "" +msgstr ":class:`Hashable` [1]_" msgid "``__hash__``" -msgstr "" +msgstr "``__hash__``" msgid ":class:`Iterable` [1]_ [2]_" -msgstr "" +msgstr ":class:`Iterable` [1]_ [2]_" msgid "``__iter__``" -msgstr "" +msgstr "``__iter__``" msgid ":class:`Iterator` [1]_" -msgstr "" +msgstr ":class:`Iterator` [1]_" msgid ":class:`Iterable`" -msgstr "" +msgstr ":class:`Iterable`" msgid "``__next__``" -msgstr "" +msgstr "``__next__``" msgid ":class:`Reversible` [1]_" -msgstr "" +msgstr ":class:`Reversible` [1]_" msgid "``__reversed__``" -msgstr "" +msgstr "``__reversed__``" msgid ":class:`Generator` [1]_" -msgstr "" +msgstr ":class:`Generator` [1]_" msgid ":class:`Iterator`" -msgstr "" +msgstr ":class:`Iterator`" msgid "``send``, ``throw``" -msgstr "" +msgstr "``send``, ``throw``" msgid "``close``, ``__iter__``, ``__next__``" -msgstr "" +msgstr "``close``, ``__iter__``, ``__next__``" msgid ":class:`Sized` [1]_" -msgstr "" +msgstr ":class:`Sized` [1]_" msgid "``__len__``" -msgstr "" +msgstr "``__len__``" msgid ":class:`Callable` [1]_" -msgstr "" +msgstr ":class:`Callable` [1]_" msgid "``__call__``" -msgstr "" +msgstr "``__call__``" msgid ":class:`Collection` [1]_" -msgstr "" +msgstr ":class:`Collection` [1]_" msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" -msgstr "" +msgstr ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgid "``__contains__``, ``__iter__``, ``__len__``" -msgstr "" +msgstr "``__contains__``, ``__iter__``, ``__len__``" msgid ":class:`Sequence`" -msgstr "" +msgstr ":class:`Sequence`" msgid ":class:`Reversible`, :class:`Collection`" -msgstr "" +msgstr ":class:`Reversible`, :class:`Collection`" msgid "``__getitem__``, ``__len__``" -msgstr "" +msgstr "``__getitem__``, ``__len__``" -msgid "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" +msgid "" +"``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" msgstr "" +"``__contains__``، ``__iter__``، ``__reversed__``، ``index`` و ``count``" msgid ":class:`MutableSequence`" -msgstr "" +msgstr ":class:`MutableSequence`" -msgid "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" +msgid "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" msgstr "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" -msgid "Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, ``extend``, ``pop``, ``remove``, and ``__iadd__``" +msgid "" +"Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, " +"``extend``, ``pop``, ``remove``, and ``__iadd__``" msgstr "" +"متدهای به ارث رسیده از :class:`Sequence` و ``append``، ``clear``، " +"``reverse``، ``extend``، ``pop``، ``remove`` و ``__iadd__``" msgid ":class:`ByteString`" -msgstr "" +msgstr ":class:`ByteString`" msgid "Inherited :class:`Sequence` methods" -msgstr "" +msgstr "متدهای موروثی :class:`Sequence`" msgid ":class:`Set`" -msgstr "" +msgstr ":class:`Set`" msgid ":class:`Collection`" -msgstr "" +msgstr ":class:`Collection`" -msgid "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, ``__rxor__`` and ``isdisjoint``" +msgid "" +"``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " +"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " +"``__rxor__`` and ``isdisjoint``" msgstr "" +"``__le__``، ``__lt__``، ``__eq__``، ``__ne__``، ``__gt__``، ``__ge__``، " +"``__and__``، ``__or__``، ``__sub__``، ``__rsub__``، ``__xor__``، " +"``__rxor__`` و ``isdisjoint``" msgid ":class:`MutableSet`" -msgstr "" +msgstr ":class:`MutableSet`" msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" -msgstr "" +msgstr "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" -msgid "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, ``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" +msgid "" +"Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " +"``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" +"متدهای به‌ارث‌رسیده از :class:`Set` و ``clear``، ``pop``، ``remove``، " +"``__ior__``، ``__iand__``، ``__ixor__`` و ``__isub__``" msgid ":class:`Mapping`" -msgstr "" +msgstr ":class:`Mapping`" msgid "``__getitem__``, ``__iter__``, ``__len__``" -msgstr "" +msgstr "``__getitem__``, ``__iter__``, ``__len__``" -msgid "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and ``__ne__``" +msgid "" +"``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " +"``__ne__``" msgstr "" +"``__contains__``، ``keys``، ``items``، ``values``، ``get``، ``__eq__`` و " +"``__ne__``" msgid ":class:`MutableMapping`" -msgstr "" +msgstr ":class:`MutableMapping`" -msgid "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" +msgid "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" +"``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" -msgid "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, ``update``, and ``setdefault``" +msgid "" +"Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " +"``update``, and ``setdefault``" msgstr "" +"متدهای به‌ارث‌رسیده از :class:`Mapping` و ``pop``، ``popitem``، ``clear``، " +"``update`` و ``setdefault``" msgid ":class:`MappingView`" -msgstr "" +msgstr ":class:`MappingView`" msgid ":class:`Sized`" -msgstr "" +msgstr ":class:`Sized`" msgid "``__init__``, ``__len__`` and ``__repr__``" -msgstr "" +msgstr "``__init__``، ``__len__`` و ``__repr__``" msgid ":class:`ItemsView`" -msgstr "" +msgstr ":class:`ItemsView`" msgid ":class:`MappingView`, :class:`Set`" -msgstr "" +msgstr ":class:`MappingView`, :class:`Set`" msgid "``__contains__``, ``__iter__``" -msgstr "" +msgstr "``__contains__``, ``__iter__``" msgid ":class:`KeysView`" -msgstr "" +msgstr ":class:`KeysView`" msgid ":class:`ValuesView`" -msgstr "" +msgstr ":class:`ValuesView`" msgid ":class:`MappingView`, :class:`Collection`" -msgstr "" +msgstr ":class:`MappingView`, :class:`Collection`" msgid ":class:`Awaitable` [1]_" -msgstr "" +msgstr ":class:`Awaitable` [1]_" msgid "``__await__``" -msgstr "" +msgstr "``__await__``" msgid ":class:`Coroutine` [1]_" -msgstr "" +msgstr ":class:`Coroutine` [1]_" msgid ":class:`Awaitable`" -msgstr "" +msgstr ":class:`Awaitable`" msgid "``close``" -msgstr "" +msgstr "``close``" msgid ":class:`AsyncIterable` [1]_" -msgstr "" +msgstr ":class:`AsyncIterable` [1]_" msgid "``__aiter__``" -msgstr "" +msgstr "``__aiter__``" msgid ":class:`AsyncIterator` [1]_" -msgstr "" +msgstr ":class:`AsyncIterator` [1]_" msgid ":class:`AsyncIterable`" -msgstr "" +msgstr ":class:`AsyncIterable`" msgid "``__anext__``" -msgstr "" +msgstr "``__anext__``" msgid ":class:`AsyncGenerator` [1]_" -msgstr "" +msgstr ":class:`AsyncGenerator` [1]_" msgid ":class:`AsyncIterator`" -msgstr "" +msgstr ":class:`AsyncIterator`" msgid "``asend``, ``athrow``" -msgstr "" +msgstr "``asend``, ``athrow``" msgid "``aclose``, ``__aiter__``, ``__anext__``" -msgstr "" +msgstr "``aclose``, ``__aiter__``, ``__anext__``" msgid ":class:`Buffer` [1]_" -msgstr "" +msgstr ":class:`Buffer` [1]_" msgid "``__buffer__``" -msgstr "" +msgstr "``__buffer__``" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing an interface by verifying the required methods are present and have not been set to :const:`None`. This only works for simple interfaces. More complex interfaces require registration or direct subclassing." +msgid "" +"These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing" +" an interface by verifying the required methods are present and have not " +"been set to :const:`None`. This only works for simple interfaces. More " +"complex interfaces require registration or direct subclassing." msgstr "" +"این ABCها :meth:`~abc.ABCMeta.__subclasshook__` را بازنویسی می‌کنند تا با " +"تأیید وجود متدهای مورد نیاز و تنظیم نشدن آن‌ها به :const:`None`، امکان " +"آزمودن یک رابط را فراهم کنند. این تنها برای رابط‌های ساده کار می‌کند. " +"رابط‌های پیچیده‌تر به ثبت یا زیرکلاس‌سازی مستقیم نیاز دارند." -msgid "Checking ``isinstance(obj, Iterable)`` detects classes that are registered as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but it does not detect classes that iterate with the :meth:`~object.__getitem__` method. The only reliable way to determine whether an object is :term:`iterable` is to call ``iter(obj)``." -msgstr "" +msgid "" +"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " +"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but" +" it does not detect classes that iterate with the " +":meth:`~object.__getitem__` method. The only reliable way to determine " +"whether an object is :term:`iterable` is to call ``iter(obj)``." +msgstr "" +"بررسی ``isinstance(obj, Iterable)`` کلاس‌هایی را که به‌عنوان " +":class:`Iterable` ثبت شده‌اند یا دارای متد :meth:`~container.__iter__` هستند" +" تشخیص می‌دهد، اما کلاس‌هایی را که برای تکرار از متد " +":meth:`~object.__getitem__` استفاده می‌کنند تشخیص نمی‌دهد. تنها راه مطمئن " +"برای تعیین اینکه آیا یک شیء :term:`پیمایش‌پذیر ` است، فراخوانی " +"``iter(obj)`` است." msgid "Collections Abstract Base Classes -- Detailed Descriptions" -msgstr "" +msgstr "کلاس‌های پایه انتزاعی مجموعه‌ها -- توضیحات تفصیلی" msgid "ABC for classes that provide the :meth:`~object.__contains__` method." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متد :meth:`~object.__contains__` " +"را فراهم می‌کنند." msgid "ABC for classes that provide the :meth:`~object.__hash__` method." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متد :meth:`~object.__hash__` را " +"ارائه می‌دهند." msgid "ABC for classes that provide the :meth:`~object.__len__` method." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متد :meth:`~object.__len__` را " +"فراهم می‌کنند." msgid "ABC for classes that provide the :meth:`~object.__call__` method." -msgstr "" +msgstr "ABC برای کلاس‌هایی که متد :meth:`~object.__call__` را فراهم می‌کنند." -msgid "See :ref:`annotating-callables` for details on how to use :class:`!Callable` in type annotations." +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:`!Callable`" +" in type annotations." msgstr "" +"برای جزئیات درباره‌ی نحوه‌ی استفاده از :class:`!Callable` در حاشیه‌نویسی‌های " +"نوع، :ref:`annotating-callables` را ببینید." msgid "ABC for classes that provide the :meth:`~container.__iter__` method." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متد :meth:`~container.__iter__` را" +" فراهم می‌کنند." -msgid "Checking ``isinstance(obj, Iterable)`` detects classes that are registered as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but it does not detect classes that iterate with the :meth:`~object.__getitem__` method. The only reliable way to determine whether an object is :term:`iterable` is to call ``iter(obj)``." +msgid "" +"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " +"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but" +" it does not detect classes that iterate with the " +":meth:`~object.__getitem__` method. The only reliable way to determine " +"whether an object is :term:`iterable` is to call ``iter(obj)``." msgstr "" +"بررسی ``isinstance(obj, Iterable)`` کلاس‌هایی را که به‌عنوان :class:`Iterable` ثبت شده‌اند یا دارای متد :meth:`~container.__iter__` هستند تشخیص می‌دهد، اما کلاس‌هایی را که تکرار آن‌ها از طریق متد :meth:`~object.__getitem__` انجام می‌شود تشخیص نمی‌دهد. تنها راه قابل‌اطمینان برای تشخیص اینکه آیا یک شیء :term:`پیمایش‌پذیر ` است، فراخوانی ``iter(obj)`` است." msgid "ABC for sized iterable container classes." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌های ظرف (container) اندازه‌دار و " +"پیمایش‌پذیر." -msgid "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:`~iterator.__next__` methods. See also the definition of :term:`iterator`." +msgid "" +"ABC for classes that provide the :meth:`~iterator.__iter__` and " +":meth:`~iterator.__next__` methods. See also the definition of " +":term:`iterator`." msgstr "" +"ABC برای کلاس‌هایی که متدهای :meth:`~iterator.__iter__` و " +":meth:`~iterator.__next__` را فراهم می‌کنند. همچنین تعریف :term:`iterator` " +"را ببینید." -msgid "ABC for iterable classes that also provide the :meth:`~object.__reversed__` method." +msgid "" +"ABC for iterable classes that also provide the :meth:`~object.__reversed__` " +"method." msgstr "" +"ABC برای کلاس‌های پیمایش‌پذیری که متد :meth:`~object.__reversed__` را نیز " +"ارائه می‌دهند." -msgid "ABC for :term:`generator` classes that implement the protocol defined in :pep:`342` that extends :term:`iterators ` with the :meth:`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` methods." +msgid "" +"ABC for :term:`generator` classes that implement the protocol defined in " +":pep:`342` that extends :term:`iterators ` with the " +":meth:`~generator.send`, :meth:`~generator.throw` and " +":meth:`~generator.close` methods." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌های :term:`تولیدگر ` که پروتکل " +"تعریف‌شده در :pep:`342` را پیاده‌سازی می‌کنند؛ پروتکلی که " +":term:`پیمایش‌گرها ` را با متدهای :meth:`~generator.send`، " +":meth:`~generator.throw` و :meth:`~generator.close` گسترش می‌دهد." -msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!Generator` in type annotations." +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using " +":class:`!Generator` in type annotations." msgstr "" +"برای جزئیات درباره استفاده از :class:`!Generator` در حاشیه‌نویسی‌های نوع، " +":ref:`annotating-generators-and-coroutines` را ببینید." msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" +"کلاس‌های پایه انتزاعی (ABC) برای :term:`دنباله‌های ` فقط‌خواندنی و" +" تغییرپذیر." -msgid "Implementation note: Some of the mixin methods, such as :meth:`~container.__iter__`, :meth:`~object.__reversed__`, and :meth:`~sequence.index` make repeated calls to the underlying :meth:`~object.__getitem__` method. Consequently, if :meth:`~object.__getitem__` is implemented with constant access speed, the mixin methods will have linear performance; however, if the underlying method is linear (as it would be with a linked list), the mixins will have quadratic performance and will likely need to be overridden." -msgstr "" +msgid "" +"Implementation note: Some of the mixin methods, such as " +":meth:`~container.__iter__`, :meth:`~object.__reversed__`, and " +":meth:`~sequence.index` make repeated calls to the underlying " +":meth:`~object.__getitem__` method. Consequently, if " +":meth:`~object.__getitem__` is implemented with constant access speed, the " +"mixin methods will have linear performance; however, if the underlying " +"method is linear (as it would be with a linked list), the mixins will have " +"quadratic performance and will likely need to be overridden." +msgstr "" +"یادداشت پیاده‌سازی: برخی از متدهای میکسین ، مانند " +":meth:`~container.__iter__`، :meth:`~object.__reversed__` و " +":meth:`~sequence.index`، فراخوانی‌های مکرری به متد زیربنایی " +":meth:`~object.__getitem__` انجام می‌دهند. در نتیجه، اگر " +":meth:`~object.__getitem__` با سرعت دسترسی ثابت پیاده‌سازی شده باشد، متدهای " +"میکسین عملکرد خطی خواهند داشت؛ اما اگر متد زیربنایی خطی باشد (همان‌طور که در" +" یک فهرست پیوندی این‌گونه خواهد بود)، میکسین‌ها عملکرد درجه دو خواهند داشت و" +" احتمالاً لازم است بازنویسی شوند." msgid "Return first index of *value*." -msgstr "" +msgstr "نخستین اندیس *value* را برمی‌گرداند." msgid "Raises :exc:`ValueError` if the value is not present." -msgstr "" +msgstr "اگر مقدار موجود نباشد، :exc:`ValueError` پرتاب می‌شود." -msgid "Supporting the *start* and *stop* arguments is optional, but recommended." +msgid "" +"Supporting the *start* and *stop* arguments is optional, but recommended." msgstr "" +"پشتیبانی از آرگومان‌های *start* و *stop* اختیاری است، اما توصیه می‌شود." -msgid "The :meth:`~sequence.index` method gained support for the *stop* and *start* arguments." +msgid "" +"The :meth:`~sequence.index` method gained support for the *stop* and *start*" +" arguments." msgstr "" +"پشتیبانی از آرگومان‌های *stop* و *start* به متد :meth:`~sequence.index` " +"اضافه شد." msgid "The :class:`ByteString` ABC has been deprecated." -msgstr "" +msgstr "کلاس پایه انتزاعی (ABC) :class:`ByteString` منسوخ شده است." -msgid "Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` implements the :ref:`buffer protocol ` at runtime. For use in type annotations, either use :class:`Buffer` or a union that explicitly specifies the types your code supports (e.g., ``bytes | bytearray | memoryview``)." -msgstr "" +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in" +" type annotations, either use :class:`Buffer` or a union that explicitly " +"specifies the types your code supports (e.g., ``bytes | bytearray | " +"memoryview``)." +msgstr "" +"برای بررسی اینکه ``obj`` :ref:`پروتکل بافر (buffer protocol) " +"` را در زمان ران‌تایم پیاده‌سازی می‌کند، از ``isinstance(obj," +" collections.abc.Buffer)`` استفاده کنید. برای استفاده در حاشیه‌نویسی‌های " +"نوع، یا از :class:`Buffer` استفاده کنید یا از یک اجتماع (union) که به‌صراحت " +"انواع مورد پشتیبانی کد شما را مشخص می‌کند (مثلاً ``bytes | bytearray | " +"memoryview``)." -msgid ":class:`!ByteString` was originally intended to be an abstract class that would serve as a supertype of both :class:`bytes` and :class:`bytearray`. However, since the ABC never had any methods, knowing that an object was an instance of :class:`!ByteString` never actually told you anything useful about the object. Other common buffer types such as :class:`memoryview` were also never understood as subtypes of :class:`!ByteString` (either at runtime or by static type checkers)." -msgstr "" +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were" +" also never understood as subtypes of :class:`!ByteString` (either at " +"runtime or by static type checkers)." +msgstr "" +":class:`!ByteString` در ابتدا قرار بود یک کلاس انتزاعی باشد که به‌عنوان نوع " +"والد هر دو کلاس :class:`bytes` و :class:`bytearray` عمل کند. با این حال، از " +"آنجا که این کلاس پایه انتزاعی هرگز هیچ متدی نداشت، دانستن این‌که یک شیء " +"نمونه‌ای از :class:`!ByteString` است، در عمل هرگز اطلاعات مفیدی درباره‌ی آن " +"شیء به شما نمی‌داد. سایر انواع رایج بافر مانند :class:`memoryview` نیز هرگز " +"به‌عنوان زیرنوع‌هایی از :class:`!ByteString` در نظر گرفته نمی‌شدند (نه در " +"ران‌تایم و نه توسط بررسی‌کننده‌های نوع ایستا)." msgid "See :pep:`PEP 688 <688#current-options>` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر :pep:`PEP 688 <688#current-options>` را ببینید." msgid "ABCs for read-only and mutable :ref:`sets `." msgstr "" +"ABCهایی برای مجموعه‌های فقط‌خواندنی و تغییرپذیر :ref:`sets `." msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" +"کلاس‌های پایه انتزاعی برای :term:`نگاشت‌های ` فقط‌خواندنی و " +"تغییرپذیر." -msgid "ABCs for mapping, items, keys, and values :term:`views `." +msgid "" +"ABCs for mapping, items, keys, and values :term:`views `." msgstr "" +"کلاس‌های پایه انتزاعی (ABCs) برای :term:`نماهای ` نگاشت، " +"آیتم‌ها، کلیدها و مقدارها." -msgid "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` expressions. Custom implementations must provide the :meth:`~object.__await__` method." +msgid "" +"ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " +"expressions. Custom implementations must provide the " +":meth:`~object.__await__` method." msgstr "" +"کلاس پایه انتزاعی (ABC) برای اشیاء :term:`awaitable`، که می‌توان از آن‌ها در" +" عبارت‌های :keyword:`await` استفاده کرد. پیاده‌سازی‌های سفارشی باید متد " +":meth:`~object.__await__` را فراهم کنند." -msgid ":term:`Coroutine ` objects and instances of the :class:`~collections.abc.Coroutine` ABC are all instances of this ABC." +msgid "" +":term:`Coroutine ` objects and instances of the " +":class:`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" +"اشیاء :term:`هم‌روال ` و نمونه‌های کلاس پایه انتزاعی (ABC) " +":class:`~collections.abc.Coroutine`، همگی نمونه‌هایی از این ABC هستند." -msgid "In CPython, generator-based coroutines (:term:`generators ` decorated with :deco:`types.coroutine`) are *awaitables*, even though they do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:`inspect.isawaitable` to detect them." -msgstr "" +msgid "" +"In CPython, generator-based coroutines (:term:`generators ` " +"decorated with :deco:`types.coroutine`) are *awaitables*, even though they " +"do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro," +" Awaitable)`` for them will return ``False``. Use " +":func:`inspect.isawaitable` to detect them." +msgstr "" +"در CPython، هم‌روال‌های مبتنی بر تولیدگر (:term:`تولیدگرها ` که " +"با :deco:`types.coroutine` دکور شده‌اند) *awaitable* هستند، اگرچه متد " +":meth:`~object.__await__` ندارند. استفاده از ``isinstance(gencoro, " +"Awaitable)`` برای آن‌ها ``False`` را برمی‌گرداند. برای شناسایی آن‌ها از " +":func:`inspect.isawaitable` استفاده کنید." -msgid "ABC for :term:`coroutine` compatible classes. These implement the following methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations must also implement :meth:`~object.__await__`. All :class:`Coroutine` instances are also instances of :class:`Awaitable`." -msgstr "" +msgid "" +"ABC for :term:`coroutine` compatible classes. These implement the following" +" methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, " +":meth:`~coroutine.throw`, and :meth:`~coroutine.close`. Custom " +"implementations must also implement :meth:`~object.__await__`. All " +":class:`Coroutine` instances are also instances of :class:`Awaitable`." +msgstr "" +"ABC برای کلاس‌های سازگار با :term:`هم‌روال `. این کلاس‌ها متدهای " +"زیر را، که در :ref:`coroutine-objects` تعریف شده‌اند، پیاده‌سازی می‌کنند: " +":meth:`~coroutine.send`، :meth:`~coroutine.throw` و " +":meth:`~coroutine.close`. پیاده‌سازی‌های سفارشی باید " +":meth:`~object.__await__` را نیز پیاده‌سازی کنند. تمام نمونه‌های " +":class:`Coroutine` نیز نمونه‌هایی از :class:`Awaitable` هستند." -msgid "In CPython, generator-based coroutines (:term:`generators ` decorated with :deco:`types.coroutine`) are *awaitables*, even though they do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:`inspect.isawaitable` to detect them." -msgstr "" +msgid "" +"In CPython, generator-based coroutines (:term:`generators ` " +"decorated with :deco:`types.coroutine`) are *awaitables*, even though they " +"do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro," +" Coroutine)`` for them will return ``False``. Use " +":func:`inspect.isawaitable` to detect them." +msgstr "" +"در CPython، هم‌روال‌های مبتنی بر تولیدگر (:term:`تولیدگرها ` که " +"با :deco:`types.coroutine` آراییده شده‌اند) *awaitable* هستند، اگرچه آن‌ها " +"متد :meth:`~object.__await__` ندارند. استفاده از ``isinstance(gencoro, " +"Coroutine)`` برای آن‌ها ``False`` را برمی‌گرداند. برای تشخیص آن‌ها از " +":func:`inspect.isawaitable` استفاده کنید." -msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!Coroutine` in type annotations. The variance and order of type parameters correspond to those of :class:`Generator`." +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using " +":class:`!Coroutine` in type annotations. The variance and order of type " +"parameters correspond to those of :class:`Generator`." msgstr "" +"برای جزئیات درباره‌ی استفاده از :class:`!Coroutine` در حاشیه‌نویسی‌های نوع، " +":ref:`annotating-generators-and-coroutines` را ببینید. واریانس و ترتیب " +"پارامترهای نوع، متناظر با موارد مربوط به :class:`Generator` است." -msgid "ABC for classes that provide an ``__aiter__`` method. See also the definition of :term:`asynchronous iterable`." +msgid "" +"ABC for classes that provide an ``__aiter__`` method. See also the " +"definition of :term:`asynchronous iterable`." msgstr "" +"ABC برای کلاس‌هایی که متد ``__aiter__`` را ارائه می‌دهند. همچنین تعریف " +":term:`پیمایش‌پذیر ناهمگام ` را ببینید." -msgid "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See also the definition of :term:`asynchronous iterator`." +msgid "" +"ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " +"also the definition of :term:`asynchronous iterator`." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متدهای ``__aiter__`` و " +"``__anext__`` را فراهم می‌کنند. همچنین تعریف :term:`asynchronous iterator` " +"را ببینید." -msgid "ABC for :term:`asynchronous generator` classes that implement the protocol defined in :pep:`525` and :pep:`492`." +msgid "" +"ABC for :term:`asynchronous generator` classes that implement the protocol " +"defined in :pep:`525` and :pep:`492`." msgstr "" +"ABC برای کلاس‌های :term:`asynchronous generator` که پروتکل تعریف‌شده در " +":pep:`525` و :pep:`492` را پیاده‌سازی می‌کنند." -msgid "See :ref:`annotating-generators-and-coroutines` for details on using :class:`!AsyncGenerator` in type annotations." +msgid "" +"See :ref:`annotating-generators-and-coroutines` for details on using " +":class:`!AsyncGenerator` in type annotations." msgstr "" +"برای جزئیات درباره‌ی استفاده از :class:`!AsyncGenerator` در حاشیه‌نویسی‌های " +"نوع، :ref:`annotating-generators-and-coroutines` را ببینید." -msgid "ABC for classes that provide the :meth:`~object.__buffer__` method, implementing the :ref:`buffer protocol `. See :pep:`688`." +msgid "" +"ABC for classes that provide the :meth:`~object.__buffer__` method, " +"implementing the :ref:`buffer protocol `. See :pep:`688`." msgstr "" +"کلاس پایه انتزاعی (ABC) برای کلاس‌هایی که متد :meth:`~object.__buffer__` را " +"ارائه می‌دهند و :ref:`پروتکل بافر ` را پیاده‌سازی می‌کنند. " +":pep:`688` را ببینید." msgid "Examples and Recipes" -msgstr "" +msgstr "مثال‌ها و راهکارها" -msgid "ABCs allow us to ask classes or instances if they provide particular functionality, for example::" +msgid "" +"ABCs allow us to ask classes or instances if they provide particular " +"functionality, for example::" msgstr "" +"کلاس‌های پایه انتزاعی (ABCs) به ما امکان می‌دهند از کلاس‌ها یا نمونه‌ها " +"بپرسیم که آیا قابلیت خاصی را فراهم می‌کنند یا خیر، برای مثال::" msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" msgstr "" +"size = None\n" +"if isinstance(myvar, collections.abc.Sized):\n" +" size = len(myvar)" -msgid "Several of the ABCs are also useful as mixins that make it easier to develop classes supporting container APIs. For example, to write a class supporting the full :class:`Set` API, it is only necessary to supply the three underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container.__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" -msgstr "" +msgid "" +"Several of the ABCs are also useful as mixins that make it easier to develop" +" classes supporting container APIs. For example, to write a class " +"supporting the full :class:`Set` API, it is only necessary to supply the " +"three underlying abstract methods: :meth:`~object.__contains__`, " +":meth:`~container.__iter__`, and :meth:`~object.__len__`. The ABC supplies " +"the remaining methods such as :meth:`!__and__` and " +":meth:`~frozenset.isdisjoint`::" +msgstr "" +"برخی از کلاس‌های پایه انتزاعی (ABC) نیز به‌عنوان میکسینمفید هستند و" +" توسعه کلاس‌هایی را که از APIهای ظرف (container) پشتیبانی می‌کنند، آسان‌تر " +"می‌کنند. برای مثال، برای نوشتن کلاسی که از API کامل :class:`Set` پشتیبانی " +"می‌کند، تنها لازم است سه متد انتزاعی زیربنایی را فراهم کنید: " +":meth:`~object.__contains__`، :meth:`~container.__iter__` و " +":meth:`~object.__len__`. ABC متدهای باقی‌مانده مانند :meth:`!__and__` و " +":meth:`~frozenset.isdisjoint` را فراهم می‌کند::" msgid "" "class ListBasedSet(collections.abc.Set):\n" @@ -482,21 +809,75 @@ msgid "" "s2 = ListBasedSet('defghi')\n" "overlap = s1 & s2 # The __and__() method is supported automatically" msgstr "" +"class ListBasedSet(collections.abc.Set):\n" +" ''' Alternate set implementation favoring space over speed\n" +" and not requiring the set elements to be hashable. '''\n" +" def __init__(self, iterable):\n" +" self.elements = lst = []\n" +" for value in iterable:\n" +" if value not in lst:\n" +" lst.append(value)\n" +"\n" +" def __iter__(self):\n" +" return iter(self.elements)\n" +"\n" +" def __contains__(self, value):\n" +" return value in self.elements\n" +"\n" +" def __len__(self):\n" +" return len(self.elements)\n" +"\n" +"s1 = ListBasedSet('abcdef')\n" +"s2 = ListBasedSet('defghi')\n" +"overlap = s1 & s2 # The __and__() method is supported automatically" msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" +"نکاتی درباره‌ی استفاده از :class:`Set` و :class:`MutableSet` به‌عنوان میکسین " +":" -msgid "Since some set operations create new sets, the default mixin methods need a way to create new instances from an :term:`iterable`. The class constructor is assumed to have a signature in the form ``ClassName(iterable)``. That assumption is factored-out to an internal :class:`classmethod` called :meth:`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If the :class:`Set` mixin is being used in a class with a different constructor signature, you will need to override :meth:`!_from_iterable` with a classmethod or regular method that can construct new instances from an iterable argument." -msgstr "" +msgid "" +"Since some set operations create new sets, the default mixin methods need a " +"way to create new instances from an :term:`iterable`. The class constructor " +"is assumed to have a signature in the form ``ClassName(iterable)``. That " +"assumption is factored-out to an internal :class:`classmethod` called " +":meth:`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. " +"If the :class:`Set` mixin is being used in a class with a different " +"constructor signature, you will need to override :meth:`!_from_iterable` " +"with a classmethod or regular method that can construct new instances from " +"an iterable argument." +msgstr "" +"از آنجا که برخی از عملیات مجموعه‌ای، مجموعه‌های جدیدی ایجاد می‌کنند، متدهای پیش‌فرض میکسین به راهی برای ایجاد نمونه‌های جدید از یک :term:`پیمایش‌پذیر ` نیاز دارند. فرض می‌شود که سازنده‌ی کلاس، امضایی به شکل ``ClassName(iterable)`` داشته باشد. این فرض در قالب یک :class:`classmethod` داخلی به نام :meth:`!_from_iterable` استخراج شده است که ``cls(iterable)`` را فراخوانی می‌کند تا یک مجموعه جدید تولید کند. اگر از میکسین :class:`Set` در کلاسی با امضای سازنده متفاوت استفاده شود، لازم است :meth:`!_from_iterable` را با یک classmethod یا متد معمولی که بتواند نمونه‌های جدید را از یک آرگومان پیمایش‌پذیر بسازد، بازنویسی کنید." -msgid "To override the comparisons (presumably for speed, as the semantics are fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the other operations will automatically follow suit." +msgid "" +"To override the comparisons (presumably for speed, as the semantics are " +"fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the" +" other operations will automatically follow suit." msgstr "" +"برای بازنویسی مقایسه‌ها (احتمالاً برای سرعت، زیرا معنای آن‌ها ثابت است)، " +":meth:`~object.__le__` و :meth:`~object.__ge__` را بازتعریف کنید؛ سپس سایر " +"عملیات به‌طور خودکار از آن‌ها پیروی خواهند کرد." -msgid "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash value for the set; however, :meth:`~object.__hash__` is not defined because not all sets are :term:`hashable` or immutable. To add set hashability using mixins, inherit from both :class:`Set` and :class:`Hashable`, then define ``__hash__ = Set._hash``." -msgstr "" +msgid "" +"The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " +"value for the set; however, :meth:`~object.__hash__` is not defined because " +"not all sets are :term:`hashable` or immutable. To add set hashability " +"using mixins, inherit from both :class:`Set` and :class:`Hashable`, then " +"define ``__hash__ = Set._hash``." +msgstr "" +"میکسین :class:`Set` یک متد :meth:`!_hash` برای محاسبه‌ی مقدار هش مجموعه " +"ارائه می‌کند؛ با این حال، :meth:`~object.__hash__` تعریف نشده است، زیرا " +"همه‌ی مجموعه‌ها :term:`هش‌پذیر ` یا تغییرناپذیر نیستند. برای " +"افزودن هش‌پذیری مجموعه با استفاده از میکسین‌ها، از هر دو :class:`Set` و " +":class:`Hashable` ارث‌بری کنید، سپس ``__hash__ = Set._hash`` را تعریف کنید." -msgid "`OrderedSet recipe `_ for an example built on :class:`MutableSet`." +msgid "" +"`OrderedSet recipe `_ for an " +"example built on :class:`MutableSet`." msgstr "" +"`دستور پخت OrderedSet `_ برای " +"نمونه‌ای که بر پایه‌ی :class:`MutableSet` ساخته شده است." msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "" +"برای اطلاعات بیشتر درباره ABCها، ماژول :mod:`abc` و :pep:`3119` را ببینید." diff --git a/library/collections.po b/library/collections.po index 7013800b4..6286e5ee6 100644 --- a/library/collections.po +++ b/library/collections.po @@ -24,109 +24,199 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!collections` --- Container datatypes" -msgstr "" +msgstr ":mod:`!collections` --- انواع داده‌ی ظرف" msgid "**Source code:** :source:`Lib/collections/__init__.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/collections/__init__.py`" -msgid "This module implements specialized container datatypes providing alternatives to Python's general purpose built-in containers, :class:`dict`, :class:`list`, :class:`set`, and :class:`tuple`." +msgid "" +"This module implements specialized container datatypes providing " +"alternatives to Python's general purpose built-in containers, :class:`dict`," +" :class:`list`, :class:`set`, and :class:`tuple`." msgstr "" +"این ماژول انواع داده‌ی ظرف تخصصی را پیاده‌سازی می‌کند و جایگزین‌هایی برای " +"ظرف‌های توکار عمومی پایتون، :class:`dict`، :class:`list`، :class:`set` و " +":class:`tuple` فراهم می‌کند." msgid ":func:`namedtuple`" -msgstr "" +msgstr ":func:`namedtuple`" msgid "factory function for creating tuple subclasses with named fields" msgstr "" +"تابع کارخانه‌ای (factory function) برای ایجاد زیرکلاس‌های تاپل با فیلدهای " +"نام‌دار" msgid ":class:`deque`" -msgstr "" +msgstr ":class:`deque`" msgid "list-like container with fast appends and pops on either end" -msgstr "" +msgstr "ظرفی فهرست‌مانند با امکان افزودن و برداشتن سریع در هر دو انتها" msgid ":class:`ChainMap`" -msgstr "" +msgstr ":class:`ChainMap`" msgid "dict-like class for creating a single view of multiple mappings" -msgstr "" +msgstr "کلاس دیکشنری‌مانند برای ایجاد یک نمای واحد از چندین نگاشت" msgid ":class:`Counter`" -msgstr "" +msgstr ":class:`Counter`" msgid "dict subclass for counting :term:`hashable` objects" -msgstr "" +msgstr "زیرکلاس دیکشنری برای شمارش اشیاء :term:`hashable`" msgid ":class:`OrderedDict`" -msgstr "" +msgstr ":class:`OrderedDict`" msgid "dict subclass that remembers the order entries were added" -msgstr "" +msgstr "زیرکلاسی از dict که ترتیب افزوده شدن آیتم‌ها را به خاطر می‌سپارد" msgid ":class:`defaultdict`" -msgstr "" +msgstr ":class:`defaultdict`" msgid "dict subclass that calls a factory function to supply missing values" msgstr "" +"زیرکلاس dict که برای تأمین مقادیر گم‌شده، یک تابع کارخانه را فراخوانی " +"می‌کند" msgid ":class:`UserDict`" -msgstr "" +msgstr ":class:`UserDict`" msgid "wrapper around dictionary objects for easier dict subclassing" -msgstr "" +msgstr "پوششی دور اشیای دیکشنری برای زیرکلاس‌سازی آسان‌تر از dict" msgid ":class:`UserList`" -msgstr "" +msgstr ":class:`UserList`" msgid "wrapper around list objects for easier list subclassing" -msgstr "" +msgstr "پوششی بر روی اشیای فهرست برای زیرکلاس‌سازی آسان‌تر فهرست" msgid ":class:`UserString`" -msgstr "" +msgstr ":class:`UserString`" msgid "wrapper around string objects for easier string subclassing" -msgstr "" +msgstr "پوششی بر روی اشیاء رشته‌ای برای زیرکلاس‌سازی آسان‌تر از رشته" msgid ":class:`ChainMap` objects" -msgstr "" +msgstr "اشیاء :class:`ChainMap`" -msgid "A :class:`ChainMap` class is provided for quickly linking a number of mappings so they can be treated as a single unit. It is often much faster than creating a new dictionary and running multiple :meth:`~dict.update` calls." +msgid "" +"A :class:`ChainMap` class is provided for quickly linking a number of " +"mappings so they can be treated as a single unit. It is often much faster " +"than creating a new dictionary and running multiple :meth:`~dict.update` " +"calls." msgstr "" +"کلاس :class:`ChainMap` برای پیوند سریع تعدادی نگاشت فراهم شده است تا بتوان " +"با آن‌ها به‌عنوان یک واحد رفتار کرد. این کار اغلب بسیار سریع‌تر از ایجاد یک " +"دیکشنری جدید و اجرای چندین فراخوانی :meth:`~dict.update` است." -msgid "The class can be used to simulate nested scopes and is useful in templating." +msgid "" +"The class can be used to simulate nested scopes and is useful in templating." msgstr "" +"این کلاس می‌تواند برای شبیه‌سازی محدوده‌های تودرتو استفاده شود و در " +"قالب‌بندی مفید است." -msgid "A :class:`ChainMap` groups multiple dicts or other mappings together to create a single, updateable view. If no *maps* are specified, a single empty dictionary is provided so that a new chain always has at least one mapping." +msgid "" +"A :class:`ChainMap` groups multiple dicts or other mappings together to " +"create a single, updateable view. If no *maps* are specified, a single " +"empty dictionary is provided so that a new chain always has at least one " +"mapping." msgstr "" +"یک :class:`ChainMap` چندین دیکشنری یا نگاشت‌های دیگر را در کنار هم قرار " +"می‌دهد تا یک نمای واحد و به‌روزرسانی‌پذیر ایجاد کند. اگر هیچ *maps* مشخص " +"نشده باشد، یک دیکشنری خالی ارائه می‌شود تا یک زنجیره جدید همیشه حداقل یک " +"نگاشت داشته باشد." -msgid "The underlying mappings are stored in a list. That list is public and can be accessed or updated using the *maps* attribute. There is no other state." +msgid "" +"The underlying mappings are stored in a list. That list is public and can " +"be accessed or updated using the *maps* attribute. There is no other state." msgstr "" +"نگاشت‌های زیربنایی در یک فهرست ذخیره می‌شوند. آن فهرست عمومی است و می‌توان " +"با استفاده از ویژگی *maps* به آن دسترسی پیدا کرد یا آن را به‌روزرسانی کرد. " +"هیچ وضعیت دیگری وجود ندارد." -msgid "Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping." +msgid "" +"Lookups search the underlying mappings successively until a key is found. " +"In contrast, writes, updates, and deletions only operate on the first " +"mapping." msgstr "" +"جست‌وجوها نگاشت‌های زیرین را به‌ترتیب جست‌وجو می‌کنند تا کلیدی پیدا شود. در " +"مقابل، نوشتن‌ها، به‌روزرسانی‌ها و حذف‌ها تنها روی اولین نگاشت عمل می‌کنند." -msgid "A :class:`ChainMap` incorporates the underlying mappings by reference. So, if one of the underlying mappings gets updated, those changes will be reflected in :class:`ChainMap`." +msgid "" +"A :class:`ChainMap` incorporates the underlying mappings by reference. So, " +"if one of the underlying mappings gets updated, those changes will be " +"reflected in :class:`ChainMap`." msgstr "" +"یک :class:`ChainMap` نگاشت‌های زیربنایی را به‌صورت ارجاعی در بر می‌گیرد. " +"بنابراین، اگر یکی از نگاشت‌های زیربنایی به‌روزرسانی شود، آن تغییرات در " +":class:`ChainMap` منعکس خواهند شد." -msgid "All of the usual dictionary methods are supported. In addition, there is a *maps* attribute, a method for creating new subcontexts, and a property for accessing all but the first mapping:" +msgid "" +"All of the usual dictionary methods are supported. In addition, there is a " +"*maps* attribute, a method for creating new subcontexts, and a property for " +"accessing all but the first mapping:" msgstr "" +"تمام متدهای معمول دیکشنری پشتیبانی می‌شوند. علاوه بر این، یک ویژگی *maps*، " +"یک متد برای ایجاد زیرزمینه‌های جدید، و یک پراپرتی برای دسترسی به همه " +"نگاشت‌ها به‌جز اولین نگاشت وجود دارد:" -msgid "A user updateable list of mappings. The list is ordered from first-searched to last-searched. It is the only stored state and can be modified to change which mappings are searched. The list should always contain at least one mapping." +msgid "" +"A user updateable list of mappings. The list is ordered from first-searched" +" to last-searched. It is the only stored state and can be modified to " +"change which mappings are searched. The list should always contain at least" +" one mapping." msgstr "" +"فهرستی از نگاشت‌ها که کاربر می‌تواند آن را به‌روزرسانی کند. این فهرست به " +"ترتیب از نخستین مورد جستجوشده تا آخرین مورد جستجوشده مرتب شده است. این " +"تنها وضعیت ذخیره‌شده است و می‌توان آن را برای تغییر نگاشت‌هایی که جستجو " +"می‌شوند، تغییر داد. این فهرست باید همواره شامل دست‌کم یک نگاشت باشد." -msgid "Returns a new :class:`ChainMap` containing a new map followed by all of the maps in the current instance. If ``m`` is specified, it becomes the new map at the front of the list of mappings; if not specified, an empty dict is used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, *d.maps)``. If any keyword arguments are specified, they update passed map or new empty dict. This method is used for creating subcontexts that can be updated without altering values in any of the parent mappings." -msgstr "" +msgid "" +"Returns a new :class:`ChainMap` containing a new map followed by all of the " +"maps in the current instance. If ``m`` is specified, it becomes the new map" +" at the front of the list of mappings; if not specified, an empty dict is " +"used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, " +"*d.maps)``. If any keyword arguments are specified, they update passed map " +"or new empty dict. This method is used for creating subcontexts that can be " +"updated without altering values in any of the parent mappings." +msgstr "" +"یک :class:`ChainMap` جدید برمی‌گرداند که شامل یک نگاشت جدید و به دنبال آن " +"همه‌ی نگاشت‌های موجود در نمونه فعلی است. اگر ``m`` مشخص شده باشد، نگاشت جدید" +" در ابتدای فهرست نگاشت‌ها قرار می‌گیرد؛ اگر مشخص نشده باشد، از یک دیکشنری " +"خالی استفاده می‌شود، به‌طوری که فراخوانی ``d.new_child()`` معادل " +"``ChainMap({}, *d.maps)`` است. اگر آرگومان‌های کلیدواژه‌ای مشخص شده باشند، " +"آن‌ها نگاشت داده‌شده یا دیکشنری خالی جدید را به‌روزرسانی می‌کنند. این متد " +"برای ایجاد زیرزمینه‌هایی استفاده می‌شود که می‌توانند بدون تغییر مقادیر " +"هیچ‌یک از نگاشت‌های والد به‌روزرسانی شوند." msgid "The optional ``m`` parameter was added." -msgstr "" +msgstr "پارامتر اختیاری ``m`` اضافه شد." msgid "Keyword arguments support was added." -msgstr "" +msgstr "پشتیبانی از آرگومان‌های کلیدواژه‌ای افزوده شد." -msgid "Property returning a new :class:`ChainMap` containing all of the maps in the current instance except the first one. This is useful for skipping the first map in the search. Use cases are similar to those for the :keyword:`nonlocal` keyword used in :term:`nested scopes `. The use cases also parallel those for the built-in :func:`super` function. A reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``." -msgstr "" +msgid "" +"Property returning a new :class:`ChainMap` containing all of the maps in the" +" current instance except the first one. This is useful for skipping the " +"first map in the search. Use cases are similar to those for the " +":keyword:`nonlocal` keyword used in :term:`nested scopes `. " +"The use cases also parallel those for the built-in :func:`super` function. " +"A reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``." +msgstr "" +"ویژگی‌ای که یک :class:`ChainMap` جدید حاوی همه‌ی نگاشت‌های موجود در نمونه‌ی " +"جاری، به‌جز اولین آن‌ها را برمی‌گرداند. این ویژگی برای پرش از اولین نگاشت در" +" جستجو مفید است. موارد استفاده مشابه موارد استفاده‌ی کلیدواژه‌ی " +":keyword:`nonlocal` است که در :term:`محدوده‌های تودرتو ` " +"استفاده می‌شود. این موارد استفاده همچنین مشابه موارد استفاده‌ی تابع توکار " +":func:`super` است. ارجاع به ``d.parents`` معادل است با: " +"``ChainMap(*d.maps[1:])``." -msgid "Note, the iteration order of a :class:`ChainMap` is determined by scanning the mappings last to first::" +msgid "" +"Note, the iteration order of a :class:`ChainMap` is determined by scanning " +"the mappings last to first::" msgstr "" +"توجه داشته باشید که ترتیب تکرار یک :class:`ChainMap` با پیمایش نگاشت‌ها از " +"آخر به اول تعیین می‌شود::" msgid "" ">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n" @@ -134,9 +224,17 @@ msgid "" ">>> list(ChainMap(adjustments, baseline))\n" "['music', 'art', 'opera']" msgstr "" +">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n" +">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n" +">>> list(ChainMap(adjustments, baseline))\n" +"['music', 'art', 'opera']" -msgid "This gives the same ordering as a series of :meth:`dict.update` calls starting with the last mapping::" +msgid "" +"This gives the same ordering as a series of :meth:`dict.update` calls " +"starting with the last mapping::" msgstr "" +"این همان ترتیبی را می‌دهد که یک دنباله از فراخوانی‌های :meth:`dict.update` " +"با شروع از آخرین نگاشت دارد::" msgid "" ">>> combined = baseline.copy()\n" @@ -144,38 +242,85 @@ msgid "" ">>> list(combined)\n" "['music', 'art', 'opera']" msgstr "" +">>> combined = baseline.copy()\n" +">>> combined.update(adjustments)\n" +">>> list(combined)\n" +"['music', 'art', 'opera']" msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." msgstr "" +"پشتیبانی از عملگرهای ``|`` و ``|=`` که در :pep:`584` مشخص شده‌اند، افزوده " +"شد." -msgid "The `MultiContext class `_ in the Enthought `CodeTools package `_ has options to support writing to any mapping in the chain." +msgid "" +"The `MultiContext class " +"`_" +" in the Enthought `CodeTools package " +"`_ has options to support writing to" +" any mapping in the chain." msgstr "" +"`کلاس MultiContext " +"`_" +" در `بسته CodeTools `_ از Enthought،" +" گزینه‌هایی برای پشتیبانی از نوشتن در هر نگاشتی در زنجیره دارد." -msgid "Django's `Context class `_ for templating is a read-only chain of mappings. It also features pushing and popping of contexts similar to the :meth:`~collections.ChainMap.new_child` method and the :attr:`~collections.ChainMap.parents` property." -msgstr "" +msgid "" +"Django's `Context class " +"`_ " +"for templating is a read-only chain of mappings. It also features pushing " +"and popping of contexts similar to the " +":meth:`~collections.ChainMap.new_child` method and the " +":attr:`~collections.ChainMap.parents` property." +msgstr "" +"`کلاس Context " +"`_ " +"جنگو برای قالب‌بندی، زنجیره‌ای فقط‌خواندنی از نگاشت‌ها است. این کلاس همچنین " +"امکان افزودن و برداشتن زمینه‌ها را، مشابه متد " +":meth:`~collections.ChainMap.new_child` و ویژگی " +":attr:`~collections.ChainMap.parents`، فراهم می‌کند." -msgid "The `Nested Contexts recipe `_ has options to control whether writes and other mutations apply only to the first mapping or to any mapping in the chain." +msgid "" +"The `Nested Contexts recipe " +"`_ has options to control whether writes and other " +"mutations apply only to the first mapping or to any mapping in the chain." msgstr "" +"`Nested Contexts recipe `_ گزینه‌هایی برای کنترل این‌که نوشت‌ها" +" و سایر تغییرات فقط بر اولین نگاشت اعمال شوند یا بر هر نگاشتی در زنجیره " +"دارد." -msgid "A `greatly simplified read-only version of Chainmap `_." +msgid "" +"A `greatly simplified read-only version of Chainmap " +"`_." msgstr "" +"یک `نسخه فقط‌خواندنی و بسیار ساده‌شده از Chainmap " +"`_." msgid ":class:`ChainMap` Examples and Recipes" -msgstr "" +msgstr "نمونه‌ها و دستورپخت‌های :class:`ChainMap`" msgid "This section shows various approaches to working with chained maps." msgstr "" +"این بخش روش‌های مختلفی را برای کار با نگاشت‌های زنجیره‌ای نشان می‌دهد." msgid "Example of simulating Python's internal lookup chain::" -msgstr "" +msgstr "مثالی از شبیه‌سازی زنجیره‌ی جست‌وجوی داخلی پایتون::" msgid "" "import builtins\n" "pylookup = ChainMap(locals(), globals(), vars(builtins))" msgstr "" +"import builtins\n" +"pylookup = ChainMap(locals(), globals(), vars(builtins))" -msgid "Example of letting user specified command-line arguments take precedence over environment variables which in turn take precedence over default values::" +msgid "" +"Example of letting user specified command-line arguments take precedence " +"over environment variables which in turn take precedence over default " +"values::" msgstr "" +"مثالی از اینکه آرگومان‌های خط فرمان تعیین‌شده توسط کاربر بر متغیرهای محیطی " +"اولویت داشته باشند و این متغیرها نیز بر مقادیر پیش‌فرض اولویت داشته باشند::" msgid "" "import os, argparse\n" @@ -192,9 +337,26 @@ msgid "" "print(combined['color'])\n" "print(combined['user'])" msgstr "" +"import os, argparse\n" +"\n" +"defaults = {'color': 'red', 'user': 'guest'}\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('-u', '--user')\n" +"parser.add_argument('-c', '--color')\n" +"namespace = parser.parse_args()\n" +"command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}\n" +"\n" +"combined = ChainMap(command_line_args, os.environ, defaults)\n" +"print(combined['color'])\n" +"print(combined['user'])" -msgid "Example patterns for using the :class:`ChainMap` class to simulate nested contexts::" +msgid "" +"Example patterns for using the :class:`ChainMap` class to simulate nested " +"contexts::" msgstr "" +"الگوهای نمونه برای استفاده از کلاس :class:`ChainMap` جهت شبیه‌سازی زمینه‌های" +" تودرتو::" msgid "" "c = ChainMap() # Create root context\n" @@ -213,9 +375,33 @@ msgid "" "d.items() # All nested items\n" "dict(d) # Flatten into a regular dictionary" msgstr "" +"c = ChainMap() # Create root context\n" +"d = c.new_child() # Create nested child context\n" +"e = c.new_child() # Child of c, independent from d\n" +"e.maps[0] # Current context dictionary -- like Python's locals()\n" +"e.maps[-1] # Root context -- like Python's globals()\n" +"e.parents # Enclosing context chain -- like Python's nonlocals\n" +"\n" +"d['x'] = 1 # Set value in current context\n" +"d['x'] # Get first key in the chain of contexts\n" +"del d['x'] # Delete from current context\n" +"list(d) # All nested values\n" +"k in d # Check all nested values\n" +"len(d) # Number of nested values\n" +"d.items() # All nested items\n" +"dict(d) # Flatten into a regular dictionary" -msgid "The :class:`ChainMap` class only makes updates (writes and deletions) to the first mapping in the chain while lookups will search the full chain. However, if deep writes and deletions are desired, it is easy to make a subclass that updates keys found deeper in the chain::" +msgid "" +"The :class:`ChainMap` class only makes updates (writes and deletions) to the" +" first mapping in the chain while lookups will search the full chain. " +"However, if deep writes and deletions are desired, it is easy to make a " +"subclass that updates keys found deeper in the chain::" msgstr "" +"کلاس :class:`ChainMap` فقط به‌روزرسانی‌ها (نوشتن‌ها و حذف‌ها) را روی اولین " +"نگاشت در زنجیره اعمال می‌کند، در حالی که جست‌وجوها کل زنجیره را جستجو " +"می‌کنند. با این حال، اگر نوشتن‌ها و حذف‌ها در عمق بیشتری از زنجیره مورد نظر " +"باشند، ساخت زیرکلاسی که کلیدهای یافت‌شده در عمق بیشتری از زنجیره را " +"به‌روزرسانی کند، آسان است::" msgid "" "class DeepChainMap(ChainMap):\n" @@ -242,12 +428,39 @@ msgid "" ">>> d # display result\n" "DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" msgstr "" +"class DeepChainMap(ChainMap):\n" +" 'Variant of ChainMap that allows direct updates to inner scopes'\n" +"\n" +" def __setitem__(self, key, value):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" mapping[key] = value\n" +" return\n" +" self.maps[0][key] = value\n" +"\n" +" def __delitem__(self, key):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" del mapping[key]\n" +" return\n" +" raise KeyError(key)\n" +"\n" +">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': 'yellow'})\n" +">>> d['lion'] = 'orange' # update an existing key two levels down\n" +">>> d['snake'] = 'red' # new keys get added to the topmost dict\n" +">>> del d['elephant'] # remove an existing key one level down\n" +">>> d # display result\n" +"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" msgid ":class:`Counter` objects" -msgstr "" +msgstr "اشیای :class:`Counter`" -msgid "A counter tool is provided to support convenient and rapid tallies. For example::" +msgid "" +"A counter tool is provided to support convenient and rapid tallies. For " +"example::" msgstr "" +"یک ابزار شمارنده برای پشتیبانی از شمارش‌های آسان و سریع فراهم شده است. برای " +"مثال::" msgid "" ">>> # Tally occurrences of words in a list\n" @@ -265,57 +478,153 @@ msgid "" "[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" " ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" msgstr "" +">>> # Tally occurrences of words in a list\n" +">>> cnt = Counter()\n" +">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n" +"... cnt[word] += 1\n" +"...\n" +">>> cnt\n" +"Counter({'blue': 3, 'red': 2, 'green': 1})\n" +"\n" +">>> # Find the ten most common words in Hamlet\n" +">>> import re\n" +">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n" +">>> Counter(words).most_common(10)\n" +"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" +" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" -msgid "A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` objects. It is a collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The :class:`Counter` class is similar to bags or multisets in other languages." -msgstr "" +msgid "" +"A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable`" +" objects. It is a collection where elements are stored as dictionary keys " +"and their counts are stored as dictionary values. Counts are allowed to be " +"any integer value including zero or negative counts. The :class:`Counter` " +"class is similar to bags or multisets in other languages." +msgstr "" +"یک :class:`Counter` زیرکلاسی از :class:`dict` برای شمارش اشیای " +":term:`hashable` است. این مجموعه‌ای است که در آن عناصر به‌عنوان کلیدهای " +"دیکشنری ذخیره می‌شوند و تعداد آن‌ها به‌عنوان مقادیر دیکشنری ذخیره می‌شود. " +"تعدادها می‌توانند هر مقدار عدد صحیحی باشند، از جمله صفر یا تعدادهای منفی. " +"کلاس :class:`Counter` مشابه کیسه‌ها (bags) یا چندمجموعه‌ها (multisets) در " +"زبان‌های دیگر است." -msgid "Elements are counted from an *iterable* or initialized from another *mapping* (or counter):" +msgid "" +"Elements are counted from an *iterable* or initialized from another " +"*mapping* (or counter):" msgstr "" +"عناصر از یک *پیمایش‌پذیر* شمارش می‌شوند یا از یک *نگاشت* (یا شمارنده) دیگر " +"مقداردهی اولیه می‌شوند:" -msgid "Counter objects have a dictionary interface except that they return a zero count for missing items instead of raising a :exc:`KeyError`:" +msgid "" +"Counter objects have a dictionary interface except that they return a zero " +"count for missing items instead of raising a :exc:`KeyError`:" msgstr "" +"اشیای Counter یک رابط دیکشنری دارند، با این تفاوت که برای آیتم‌های ناموجود، " +"به‌جای پرتاب :exc:`KeyError`، شمارش صفر برمی‌گردانند:" -msgid "Setting a count to zero does not remove an element from a counter. Use ``del`` to remove it entirely:" +msgid "" +"Setting a count to zero does not remove an element from a counter. Use " +"``del`` to remove it entirely:" msgstr "" +"تنظیم یک شمارش روی صفر، یک عنصر را از شمارنده حذف نمی‌کند. برای حذف کامل آن " +"از ``del`` استفاده کنید:" -msgid "As a :class:`dict` subclass, :class:`Counter` inherited the capability to remember insertion order. Math operations on *Counter* objects also preserve order. Results are ordered according to when an element is first encountered in the left operand and then by the order encountered in the right operand." +msgid "" +"As a :class:`dict` subclass, :class:`Counter` inherited the capability to " +"remember insertion order. Math operations on *Counter* objects also " +"preserve order. Results are ordered according to when an element is first " +"encountered in the left operand and then by the order encountered in the " +"right operand." msgstr "" +"به‌عنوان یک زیرکلاس از :class:`dict`، :class:`Counter` قابلیت به‌خاطر سپردن " +"ترتیب درج را به ارث برده است. عملیات‌های ریاضی روی اشیای *Counter* نیز ترتیب" +" را حفظ می‌کنند. نتایج بر اساس نخستین زمان مواجهه با هر عنصر در عملوند چپ و " +"سپس بر اساس ترتیب مواجهه در عملوند راست مرتب می‌شوند." -msgid "Counter objects support additional methods beyond those available for all dictionaries:" +msgid "" +"Counter objects support additional methods beyond those available for all " +"dictionaries:" msgstr "" +"اشیای Counter علاوه بر متدهای در دسترس برای همه دیکشنری‌ها، از متدهای اضافی " +"نیز پشتیبانی می‌کنند:" -msgid "Return an iterator over elements repeating each as many times as its count. Elements are returned in the order first encountered. If an element's count is less than one, :meth:`elements` will ignore it." +msgid "" +"Return an iterator over elements repeating each as many times as its count." +" Elements are returned in the order first encountered. If an element's " +"count is less than one, :meth:`elements` will ignore it." msgstr "" +"یک پیمایش‌گر بر روی عناصر برمی‌گرداند که هر عنصر را به تعداد آن تکرار می‌کند. " +"عناصر به ترتیبی که برای اولین بار مشاهده شده‌اند برگردانده می‌شوند. اگر " +"تعداد یک عنصر کمتر از ۱ باشد، :meth:`elements` آن را نادیده می‌گیرد." -msgid "Return a list of the *n* most common elements and their counts from the most common to the least. If *n* is omitted or ``None``, :meth:`most_common` returns *all* elements in the counter. Elements with equal counts are ordered in the order first encountered:" +msgid "" +"Return a list of the *n* most common elements and their counts from the most" +" common to the least. If *n* is omitted or ``None``, :meth:`most_common` " +"returns *all* elements in the counter. Elements with equal counts are " +"ordered in the order first encountered:" msgstr "" +"فهرستی از رایج‌ترین *n* عنصر و تعداد آن‌ها را از رایج‌ترین به کم‌ترین " +"برمی‌گرداند. اگر *n* حذف شود یا ``None`` باشد، :meth:`most_common` *تمام* " +"عناصر موجود در شمارنده را برمی‌گرداند. عناصری که تعداد برابر دارند، به " +"ترتیبی که برای اولین بار مشاهده شده‌اند مرتب می‌شوند:" -msgid "Elements are subtracted from an *iterable* or from another *mapping* (or counter). Like :meth:`dict.update` but subtracts counts instead of replacing them. Both inputs and outputs may be zero or negative." +msgid "" +"Elements are subtracted from an *iterable* or from another *mapping* (or " +"counter). Like :meth:`dict.update` but subtracts counts instead of " +"replacing them. Both inputs and outputs may be zero or negative." msgstr "" +"عناصر از یک *پیمایش‌پذیر* یا از یک *نگاشت* دیگر (یا شمارنده) کم می‌شوند. مانند" +" :meth:`dict.update` است، اما به‌جای جایگزینی شمارش‌ها، آن‌ها را کم می‌کند. " +"هم ورودی‌ها و هم خروجی‌ها می‌توانند صفر یا منفی باشند." msgid "Compute the sum of the counts." -msgstr "" +msgstr "مجموع شمارش‌ها را محاسبه کنید." -msgid "The usual dictionary methods are available for :class:`Counter` objects except for two which work differently for counters." +msgid "" +"The usual dictionary methods are available for :class:`Counter` objects " +"except for two which work differently for counters." msgstr "" +"متدهای معمول دیکشنری برای اشیای :class:`Counter` در دسترس هستند، به‌جز دو " +"مورد که برای شمارنده‌ها متفاوت عمل می‌کنند." msgid "This class method is not implemented for :class:`Counter` objects." -msgstr "" +msgstr "این متد کلاس برای اشیای :class:`Counter` پیاده‌سازی نشده است." -msgid "Elements are counted from an *iterable* or added-in from another *mapping* (or counter). Like :meth:`dict.update` but adds counts instead of replacing them. Also, the *iterable* is expected to be a sequence of elements, not a sequence of ``(key, value)`` pairs." +msgid "" +"Elements are counted from an *iterable* or added-in from another *mapping* " +"(or counter). Like :meth:`dict.update` but adds counts instead of replacing" +" them. Also, the *iterable* is expected to be a sequence of elements, not a" +" sequence of ``(key, value)`` pairs." msgstr "" +"المان‌ها از یک *پیمایش‌پذیر* شمرده می‌شوند یا از یک *نگاشت* (یا شمارنده) دیگر " +"افزوده می‌شوند. مانند :meth:`dict.update` است، اما به‌جای جایگزین کردن " +"شمارش‌ها، آن‌ها را می‌افزاید. همچنین، انتظار می‌رود *پیمایش‌پذیر* دنباله‌ای از" +" المان‌ها باشد، نه دنباله‌ای از جفت‌های ``(key, value)``." -msgid "Counters support rich comparison operators for equality, subset, and superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of those tests treat missing elements as having zero counts so that ``Counter(a=1) == Counter(a=1, b=0)`` returns true." +msgid "" +"Counters support rich comparison operators for equality, subset, and " +"superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of" +" those tests treat missing elements as having zero counts so that " +"``Counter(a=1) == Counter(a=1, b=0)`` returns true." msgstr "" +"شمارنده‌ها از عملگرهای مقایسه‌ای غنی برای روابط برابری، زیرمجموعه و " +"ابرمجموعه پشتیبانی می‌کنند: ``==``، ``!=``، ``<``، ``<=``، ``>``، ``>=``. " +"همه‌ی این مقایسه‌ها عناصر ناموجود را دارای تعداد صفر در نظر می‌گیرند، به‌طوری" +" که ``Counter(a=1) == Counter(a=1, b=0)`` مقدار درست برمی‌گرداند." msgid "Rich comparison operations were added." -msgstr "" +msgstr "عملیات‌های مقایسه غنی افزوده شدند." -msgid "In equality tests, missing elements are treated as having zero counts. Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered distinct." +msgid "" +"In equality tests, missing elements are treated as having zero counts. " +"Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered " +"distinct." msgstr "" +"در آزمون‌های برابری، عناصر غایب به‌عنوان دارای تعداد صفر در نظر گرفته " +"می‌شوند. پیش از این، ``Counter(a=3)`` و ``Counter(a=3, b=0)`` متمایز در نظر " +"گرفته می‌شدند." msgid "Common patterns for working with :class:`Counter` objects::" -msgstr "" +msgstr "الگوهای رایج برای کار با اشیای :class:`Counter`::" msgid "" "c.total() # total of all counts\n" @@ -328,9 +637,32 @@ msgid "" "c.most_common()[:-n-1:-1] # n least common elements\n" "+c # remove zero and negative counts" msgstr "" +"c.total() # مجموع همه شمارش‌ها\n" +"c.clear() # بازنشانی همه شمارش‌ها\n" +"list(c) # فهرست المان‌های یکتا\n" +"set(c) # تبدیل به یک مجموعه\n" +"dict(c) # تبدیل به یک دیکشنری معمولی\n" +"c.items() # دسترسی به جفت‌های (elem, cnt)\n" +"Counter(dict(list_of_pairs)) # تبدیل از فهرستی از جفت‌های (elem, cnt)\n" +"c.most_common()[:-n-1:-1] # n المان کم‌رایج\n" +"+c # حذف شمارش‌های صفر و منفی" -msgid "Several mathematical operations are provided for combining :class:`Counter` objects to produce multisets (counters that have counts greater than zero). Addition and subtraction combine counters by adding or subtracting the counts of corresponding elements. Intersection and union return the minimum and maximum of corresponding counts. Equality and inclusion compare corresponding counts. Each operation can accept inputs with signed counts, but the output will exclude results with counts of zero or less." -msgstr "" +msgid "" +"Several mathematical operations are provided for combining :class:`Counter` " +"objects to produce multisets (counters that have counts greater than zero). " +"Addition and subtraction combine counters by adding or subtracting the " +"counts of corresponding elements. Intersection and union return the minimum" +" and maximum of corresponding counts. Equality and inclusion compare " +"corresponding counts. Each operation can accept inputs with signed counts, " +"but the output will exclude results with counts of zero or less." +msgstr "" +"چند عملیات ریاضی برای ترکیب اشیای :class:`Counter` و تولید چندمجموعه‌ها " +"(شمارنده‌هایی که شمارش‌های بزرگ‌تر از صفر دارند) ارائه شده است. جمع و تفریق،" +" شمارنده‌ها را با افزودن یا کم کردن شمارش‌های عناصر متناظر ترکیب می‌کنند. " +"اشتراک و اجتماع، کمینه و بیشینه‌ی شمارش‌های متناظر را برمی‌گردانند. برابری و" +" شمول، شمارش‌های متناظر را مقایسه می‌کنند. هر عملیات می‌تواند ورودی‌هایی با " +"شمارش‌های علامت‌دار بپذیرد، اما خروجی، نتایجی را که شمارش آن‌ها صفر یا کمتر " +"است شامل نمی‌شود." msgid "" ">>> c = Counter(a=3, b=1)\n" @@ -348,132 +680,311 @@ msgid "" ">>> c <= d # inclusion: c[x] <= d[x]\n" "False" msgstr "" +">>> c = Counter(a=3, b=1)\n" +">>> d = Counter(a=1, b=2)\n" +">>> c + d # add two counters together: c[x] + d[x]\n" +"Counter({'a': 4, 'b': 3})\n" +">>> c - d # subtract (keeping only positive counts)\n" +"Counter({'a': 2})\n" +">>> c & d # intersection: min(c[x], d[x])\n" +"Counter({'a': 1, 'b': 1})\n" +">>> c | d # union: max(c[x], d[x])\n" +"Counter({'a': 3, 'b': 2})\n" +">>> c == d # equality: c[x] == d[x]\n" +"False\n" +">>> c <= d # inclusion: c[x] <= d[x]\n" +"False" -msgid "Unary addition and subtraction are shortcuts for adding an empty counter or subtracting from an empty counter." +msgid "" +"Unary addition and subtraction are shortcuts for adding an empty counter or " +"subtracting from an empty counter." msgstr "" +"جمع و تفریق یک‌عملوندی، میان‌برهایی برای افزودن یک شمارنده خالی یا کم کردن " +"از یک شمارنده خالی هستند." -msgid "Added support for unary plus, unary minus, and in-place multiset operations." +msgid "" +"Added support for unary plus, unary minus, and in-place multiset operations." msgstr "" +"پشتیبانی از عملگرهای یک‌عملوندی مثبت و منفی و عملیات‌های چندمجموعه‌ای درجا " +"افزوده شد." -msgid "Counters were primarily designed to work with positive integers to represent running counts; however, care was taken to not unnecessarily preclude use cases needing other types or negative values. To help with those use cases, this section documents the minimum range and type restrictions." +msgid "" +"Counters were primarily designed to work with positive integers to represent" +" running counts; however, care was taken to not unnecessarily preclude use " +"cases needing other types or negative values. To help with those use cases," +" this section documents the minimum range and type restrictions." msgstr "" +"شمارنده‌ها عمدتاً برای کار با اعداد صحیح مثبت به منظور نمایش شمارش‌های جاری " +"طراحی شده‌اند؛ با این حال، دقت شده است که به‌طور غیرضروری از موارد " +"استفاده‌ای که نیازمند انواع دیگر یا مقادیر منفی هستند جلوگیری نشود. برای کمک" +" به این موارد استفاده، این بخش حداقل دامنه و محدودیت‌های نوع را مستند " +"می‌کند." -msgid "The :class:`Counter` class itself is a dictionary subclass with no restrictions on its keys and values. The values are intended to be numbers representing counts, but you *could* store anything in the value field." +msgid "" +"The :class:`Counter` class itself is a dictionary subclass with no " +"restrictions on its keys and values. The values are intended to be numbers " +"representing counts, but you *could* store anything in the value field." msgstr "" +"خود کلاس :class:`Counter` زیرکلاسی از دیکشنری است و هیچ محدودیتی روی " +"کلیدها و مقادیر آن ندارد. مقادیر در نظر گرفته شده‌اند که اعدادی برای نمایش " +"شمارش‌ها باشند، اما شما *می‌توانید* هر چیزی را در فیلد مقدار ذخیره کنید." -msgid "The :meth:`~Counter.most_common` method requires only that the values be orderable." +msgid "" +"The :meth:`~Counter.most_common` method requires only that the values be " +"orderable." msgstr "" +"متد :meth:`~Counter.most_common` تنها نیاز دارد که مقادیر قابل مرتب‌سازی " +"باشند." -msgid "For in-place operations such as ``c[key] += 1``, the value type need only support addition and subtraction. So fractions, floats, and decimals would work and negative values are supported. The same is also true for :meth:`~Counter.update` and :meth:`~Counter.subtract` which allow negative and zero values for both inputs and outputs." -msgstr "" +msgid "" +"For in-place operations such as ``c[key] += 1``, the value type need only " +"support addition and subtraction. So fractions, floats, and decimals would " +"work and negative values are supported. The same is also true for " +":meth:`~Counter.update` and :meth:`~Counter.subtract` which allow negative " +"and zero values for both inputs and outputs." +msgstr "" +"برای عملیات‌های درجا مانند ``c[key] += 1``، نوع مقدار فقط باید از جمع و " +"تفریق پشتیبانی کند. بنابراین کسرها، اعداد اعشاری و اعداد اعشاری قابل استفاده " +"هستند و مقادیر منفی نیز پشتیبانی می‌شوند. همین موضوع برای " +":meth:`~Counter.update` و :meth:`~Counter.subtract` نیز صادق است، که مقادیر " +"منفی و صفر را برای هر دو ورودی و خروجی می‌پذیرند." -msgid "The multiset methods are designed only for use cases with positive values. The inputs may be negative or zero, but only outputs with positive values are created. There are no type restrictions, but the value type needs to support addition, subtraction, and comparison." +msgid "" +"The multiset methods are designed only for use cases with positive values. " +"The inputs may be negative or zero, but only outputs with positive values " +"are created. There are no type restrictions, but the value type needs to " +"support addition, subtraction, and comparison." msgstr "" +"متدهای چندمجموعه فقط برای موارد استفاده با مقادیر مثبت طراحی شده‌اند. " +"ورودی‌ها ممکن است منفی یا صفر باشند، اما فقط خروجی‌هایی با مقادیر مثبت ایجاد" +" می‌شوند. هیچ محدودیت نوعی وجود ندارد، اما نوع مقدار باید از جمع، تفریق و " +"مقایسه پشتیبانی کند." -msgid "The :meth:`~Counter.elements` method requires integer counts. It ignores zero and negative counts." +msgid "" +"The :meth:`~Counter.elements` method requires integer counts. It ignores " +"zero and negative counts." msgstr "" +"متد :meth:`~Counter.elements` به شمارش‌های عدد صحیح نیاز دارد. این متد " +"شمارش‌های صفر و منفی را نادیده می‌گیرد." -msgid "`Bag class `_ in Smalltalk." +msgid "" +"`Bag class `_ in Smalltalk." msgstr "" +"`کلاس Bag `_ در Smalltalk." -msgid "Wikipedia entry for `Multisets `_." +msgid "" +"Wikipedia entry for `Multisets `_." msgstr "" +"مدخل ویکی‌پدیا برای `چندمجموعه‌ها " +"`_." -msgid "`C++ multisets `_ tutorial with examples." +msgid "" +"`C++ multisets `_ tutorial with examples." msgstr "" +"`آموزش چندمجموعه‌های C++ `_ همراه با مثال‌ها." -msgid "For mathematical operations on multisets and their use cases, see *Knuth, Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise 19*." +msgid "" +"For mathematical operations on multisets and their use cases, see *Knuth, " +"Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " +"19*." msgstr "" +"برای عملیات ریاضی بر روی چندمجموعه‌ها و موارد استفاده‌ی آن‌ها، *Knuth, " +"Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " +"19* را ببینید." -msgid "To enumerate all distinct multisets of a given size over a given set of elements, see :func:`itertools.combinations_with_replacement`::" +msgid "" +"To enumerate all distinct multisets of a given size over a given set of " +"elements, see :func:`itertools.combinations_with_replacement`::" msgstr "" +"برای برشمردن تمام چندمجموعه‌های متمایز با اندازه‌ی مشخص بر روی یک مجموعه‌ی " +"مشخص از عناصر، :func:`itertools.combinations_with_replacement` را ببینید::" -msgid "map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" +msgid "" +"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC " +"CC" msgstr "" +"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC " +"CC" msgid ":class:`deque` objects" -msgstr "" +msgstr "اشیای :class:`deque`" -msgid "Returns a new deque object initialized left-to-right (using :meth:`append`) with data from *iterable*. If *iterable* is not specified, the new deque is empty." +msgid "" +"Returns a new deque object initialized left-to-right (using :meth:`append`) " +"with data from *iterable*. If *iterable* is not specified, the new deque is" +" empty." msgstr "" +"یک شیء deque جدید بازمی‌گرداند که از چپ به راست (با استفاده از " +":meth:`append`) با داده‌های *iterable* مقداردهی اولیه شده است. اگر " +"*iterable* مشخص نشده باشد، deque جدید خالی است." -msgid "Deques are a generalization of stacks and queues (the name is pronounced \"deck\" and is short for \"double-ended queue\"). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same *O*\\ (1) performance in either direction." +msgid "" +"Deques are a generalization of stacks and queues (the name is pronounced " +"\"deck\" and is short for \"double-ended queue\"). Deques support thread-" +"safe, memory efficient appends and pops from either side of the deque with " +"approximately the same *O*\\ (1) performance in either direction." msgstr "" +"صف‌های دوطرفه (deque) تعمیمی از پشته‌ها و صف‌ها هستند (این نام به‌صورت " +"«deck» تلفظ می‌شود و کوتاه‌شده‌ی «double-ended queue» است). صف‌های دوطرفه از " +"افزودن و برداشتن ایمن برای نخ‌ها و کارآمد از نظر حافظه از هر طرف صف دوطرفه، " +"با کارایی تقریباً یکسان *O*\\ (1) در هر جهت پشتیبانی می‌کنند." -msgid "Though :class:`list` objects support similar operations, they are optimized for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs for ``pop(0)`` and ``insert(0, v)`` operations which change both the size and position of the underlying data representation." +msgid "" +"Though :class:`list` objects support similar operations, they are optimized " +"for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs" +" for ``pop(0)`` and ``insert(0, v)`` operations which change both the size " +"and position of the underlying data representation." msgstr "" +"اگرچه اشیای :class:`list` از عملیات مشابهی پشتیبانی می‌کنند، اما برای عملیات" +" سریع با طول ثابت بهینه‌سازی شده‌اند و برای عملیات ``pop(0)`` و ``insert(0, " +"v)`` که هم اندازه و هم موقعیت نمایش داده‌های زیرین را تغییر می‌دهند، مستلزم " +"هزینه‌های جابه‌جایی حافظه با مرتبه‌ی *O*\\ (*n*) هستند." -msgid "If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary length. Otherwise, the deque is bounded to the specified maximum length. Once a bounded length deque is full, when new items are added, a corresponding number of items are discarded from the opposite end. Bounded length deques provide functionality similar to the ``tail`` filter in Unix. They are also useful for tracking transactions and other pools of data where only the most recent activity is of interest." -msgstr "" +msgid "" +"If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary" +" length. Otherwise, the deque is bounded to the specified maximum length. " +"Once a bounded length deque is full, when new items are added, a " +"corresponding number of items are discarded from the opposite end. Bounded " +"length deques provide functionality similar to the ``tail`` filter in Unix. " +"They are also useful for tracking transactions and other pools of data where" +" only the most recent activity is of interest." +msgstr "" +"اگر *maxlen* مشخص نشده باشد یا ``None`` باشد، صف‌های دوطرفه (deque) " +"می‌توانند تا طول دلخواهی رشد کنند. در غیر این صورت، صف دوطرفه به حداکثر طول " +"مشخص‌شده محدود می‌شود. هنگامی که یک صف دوطرفه با طول محدود پر شد، با افزودن " +"آیتم‌های جدید، تعداد متناظری از آیتم‌ها از سمت مخالف دور ریخته می‌شوند. " +"صف‌های دوطرفه با طول محدود، عملکردی مشابه فیلتر ``tail`` در Unix ارائه " +"می‌دهند. آن‌ها همچنین برای پیگیری تراکنش‌ها و سایر مخازن داده‌ای که تنها " +"جدیدترین فعالیت مورد توجه است، مفید هستند." msgid "Deques are :ref:`generic ` over the type of their contents." -msgstr "" +msgstr "صف‌های دوطرفه (deque) نسبت به نوع محتوای خود :ref:`عام ` هستند." msgid "Deque objects support the following methods:" -msgstr "" +msgstr "اشیای Deque از متدهای زیر پشتیبانی می‌کنند:" msgid "Add *item* to the right side of the deque." -msgstr "" +msgstr "*item* را به سمت راست deque می‌افزاید." msgid "Add *item* to the left side of the deque." -msgstr "" +msgstr "*item* را به سمت چپ deque اضافه کنید." msgid "Remove all elements from the deque leaving it with length 0." msgstr "" +"همه‌ی عناصر را از صف دوطرفه (deque) حذف می‌کند و طول آن را به ۰ می‌رساند." msgid "Create a shallow copy of the deque." -msgstr "" +msgstr "یک کپی سطحی از deque ایجاد می‌کند." msgid "Count the number of deque elements equal to *value*." -msgstr "" +msgstr "تعداد عناصر deque برابر با *value* را می‌شمارد." -msgid "Extend the right side of the deque by appending elements from the iterable argument." -msgstr "" +msgid "" +"Extend the right side of the deque by appending elements from the iterable " +"argument." +msgstr "سمت راست deque را با افزودن المان‌ها از آرگومان پیمایش‌پذیر گسترش دهید." -msgid "Extend the left side of the deque by appending elements from *iterable*. Note, the series of left appends results in reversing the order of elements in the iterable argument." +msgid "" +"Extend the left side of the deque by appending elements from *iterable*. " +"Note, the series of left appends results in reversing the order of elements " +"in the iterable argument." msgstr "" +"سمت چپ صف دوطرفه (deque) را با الحاق عناصری از *iterable* گسترش دهید. توجه " +"داشته باشید که دنباله‌ی الحاق‌های سمت چپ، باعث معکوس شدن ترتیب عناصر در " +"آرگومان پیمایش‌پذیر می‌شود." -msgid "Return the position of *value* in the deque (at or after index *start* and before index *stop*). Returns the first match or raises :exc:`ValueError` if not found." +msgid "" +"Return the position of *value* in the deque (at or after index *start* and " +"before index *stop*). Returns the first match or raises :exc:`ValueError` " +"if not found." msgstr "" +"موقعیت *value* را در صف دوطرفه (deque) برمی‌گرداند (در اندیس *start* یا پس " +"از آن و پیش از اندیس *stop*). نخستین تطابق را برمی‌گرداند یا در صورت پیدا " +"نشدن، :exc:`ValueError` را پرتاب می‌کند." msgid "Insert *value* into the deque at position *index*." -msgstr "" +msgstr "*value* را در موقعیت *index* در صف دوطرفه (deque) درج کنید." -msgid "If the insertion would cause a bounded deque to grow beyond *maxlen*, an :exc:`IndexError` is raised." +msgid "" +"If the insertion would cause a bounded deque to grow beyond *maxlen*, an " +":exc:`IndexError` is raised." msgstr "" +"اگر درج موجب شود که یک deque کران‌دار بزرگ‌تر از *maxlen* شود، یک " +":exc:`IndexError` پرتاب می‌شود." -msgid "Remove and return an element from the right side of the deque. If no elements are present, raises an :exc:`IndexError`." +msgid "" +"Remove and return an element from the right side of the deque. If no " +"elements are present, raises an :exc:`IndexError`." msgstr "" +"یک المان را از سمت راست deque حذف کرده و برمی‌گرداند. اگر هیچ المانی وجود " +"نداشته باشد، یک :exc:`IndexError` پرتاب می‌شود." -msgid "Remove and return an element from the left side of the deque. If no elements are present, raises an :exc:`IndexError`." +msgid "" +"Remove and return an element from the left side of the deque. If no elements" +" are present, raises an :exc:`IndexError`." msgstr "" +"یک عنصر را از سمت چپ deque حذف می‌کند و آن را برمی‌گرداند. اگر هیچ عنصری " +"وجود نداشته باشد، یک :exc:`IndexError` پرتاب می‌شود." -msgid "Remove the first occurrence of *value*. If not found, raises a :exc:`ValueError`." +msgid "" +"Remove the first occurrence of *value*. If not found, raises a " +":exc:`ValueError`." msgstr "" +"اولین رخداد *value* را حذف می‌کند. اگر پیدا نشد، یک :exc:`ValueError` پرتاب " +"می‌کند." msgid "Reverse the elements of the deque in-place and then return ``None``." msgstr "" +"عناصر deque را به‌صورت درجا معکوس می‌کند و سپس ``None`` را برمی‌گرداند." -msgid "Rotate the deque *n* steps to the right. If *n* is negative, rotate to the left." -msgstr "" +msgid "" +"Rotate the deque *n* steps to the right. If *n* is negative, rotate to the " +"left." +msgstr "deque را *n* گام به راست بچرخانید. اگر *n* منفی باشد، به چپ بچرخانید." -msgid "When the deque is not empty, rotating one step to the right is equivalent to ``d.appendleft(d.pop())``, and rotating one step to the left is equivalent to ``d.append(d.popleft())``." +msgid "" +"When the deque is not empty, rotating one step to the right is equivalent to" +" ``d.appendleft(d.pop())``, and rotating one step to the left is equivalent " +"to ``d.append(d.popleft())``." msgstr "" +"هنگامی که deque خالی نیست، چرخاندن یک گام به راست معادل " +"``d.appendleft(d.pop())`` است، و چرخاندن یک گام به چپ معادل " +"``d.append(d.popleft())`` است." msgid "Deque objects also provide one read-only attribute:" -msgstr "" +msgstr "اشیای Deque همچنین یک ویژگی فقط‌خواندنی ارائه می‌دهند:" msgid "Maximum size of a deque or ``None`` if unbounded." -msgstr "" +msgstr "حداکثر اندازه‌ی یک deque یا ``None`` در صورت نامحدود بودن." -msgid "In addition to the above, deques support iteration, pickling, ``len(d)``, ``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with the :keyword:`in` operator, and subscript references such as ``d[0]`` to access the first element. Indexed access is *O*\\ (1) at both ends but slows to *O*\\ (*n*) in the middle. For fast random access, use lists instead." -msgstr "" +msgid "" +"In addition to the above, deques support iteration, pickling, ``len(d)``, " +"``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " +"with the :keyword:`in` operator, and subscript references such as ``d[0]`` " +"to access the first element. Indexed access is *O*\\ (1) at both ends but " +"slows to *O*\\ (*n*) in the middle. For fast random access, use lists " +"instead." +msgstr "" +"علاوه بر موارد بالا، صف‌های دوطرفه (deques) از تکرار، پیکل‌کردن (pickling)، " +"``len(d)``، ``reversed(d)``، ``copy.copy(d)``، ``copy.deepcopy(d)``، بررسی " +"عضویت با عملگر :keyword:`in`، و ارجاع‌های اندیسی مانند ``d[0]`` برای دسترسی " +"به اولین عنصر پشتیبانی می‌کنند. دسترسی اندیسی در هر دو انتها *O*\\ (1) است،" +" اما در میانه به *O*\\ (*n*) کند می‌شود. برای دسترسی تصادفی سریع، به‌جای آن" +" از فهرست‌ها استفاده کنید." -msgid "Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and ``__imul__()``." +msgid "" +"Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and " +"``__imul__()``." msgstr "" +"از نسخه 3.5 به بعد، صف‌های دوطرفه (deque) از ``__add__()``، ``__mul__()`` و " +"``__imul__()`` پشتیبانی می‌کنند." msgid "Example:" -msgstr "" +msgstr "مثال:" msgid "" ">>> from collections import deque\n" @@ -527,15 +1038,70 @@ msgid "" ">>> d\n" "deque(['c', 'b', 'a'])" msgstr "" +">>> from collections import deque\n" +">>> d = deque('ghi') # make a new deque with three items\n" +">>> for elem in d: # iterate over the deque's elements\n" +"... print(elem.upper())\n" +"G\n" +"H\n" +"I\n" +"\n" +">>> d.append('j') # add a new entry to the right side\n" +">>> d.appendleft('f') # add a new entry to the left side\n" +">>> d # show the representation of the deque\n" +"deque(['f', 'g', 'h', 'i', 'j'])\n" +"\n" +">>> d.pop() # return and remove the rightmost item\n" +"'j'\n" +">>> d.popleft() # return and remove the leftmost item\n" +"'f'\n" +">>> list(d) # list the contents of the deque\n" +"['g', 'h', 'i']\n" +">>> d[0] # peek at leftmost item\n" +"'g'\n" +">>> d[-1] # peek at rightmost item\n" +"'i'\n" +"\n" +">>> list(reversed(d)) # list the contents of a deque in reverse\n" +"['i', 'h', 'g']\n" +">>> 'h' in d # search the deque\n" +"True\n" +">>> d.extend('jkl') # add multiple elements at once\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +">>> d.rotate(1) # right rotation\n" +">>> d\n" +"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n" +">>> d.rotate(-1) # left rotation\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +"\n" +">>> deque(reversed(d)) # make a new deque in reverse order\n" +"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n" +">>> d.clear() # empty the deque\n" +">>> d.pop() # cannot pop from an empty deque\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" d.pop()\n" +"IndexError: pop from an empty deque\n" +"\n" +">>> d.extendleft('abc') # extendleft() reverses the input order\n" +">>> d\n" +"deque(['c', 'b', 'a'])" msgid ":class:`deque` Recipes" -msgstr "" +msgstr "دستور پخت‌های :class:`deque`" msgid "This section shows various approaches to working with deques." msgstr "" +"این بخش روش‌های مختلفی را برای کار با صف‌های دوطرفه (deque) نشان می‌دهد." -msgid "Bounded length deques provide functionality similar to the ``tail`` filter in Unix::" +msgid "" +"Bounded length deques provide functionality similar to the ``tail`` filter " +"in Unix::" msgstr "" +"صف‌های دوطرفه (deque) با طول محدود، عملکردی مشابه فیلتر ``tail`` در یونیکس " +"فراهم می‌کنند::" msgid "" "def tail(filename, n=10):\n" @@ -543,9 +1109,17 @@ msgid "" " with open(filename) as f:\n" " return deque(f, n)" msgstr "" - -msgid "Another approach to using deques is to maintain a sequence of recently added elements by appending to the right and popping to the left::" -msgstr "" +"def tail(filename, n=10):\n" +" 'Return the last n lines of a file'\n" +" with open(filename) as f:\n" +" return deque(f, n)" + +msgid "" +"Another approach to using deques is to maintain a sequence of recently added" +" elements by appending to the right and popping to the left::" +msgstr "" +"رویکرد دیگر برای استفاده از صف‌های دوطرفه (deque)، نگهداری دنباله‌ای از " +"المان‌های به‌تازگی اضافه‌شده با افزودن به راست و برداشتن از چپ است::" msgid "" "def moving_average(iterable, n=3):\n" @@ -560,9 +1134,32 @@ msgid "" " d.append(elem)\n" " yield s / n" msgstr "" +"def moving_average(iterable, n=3):\n" +" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" +" # https://fa.wikipedia.org/wiki/میانگین_متحرک\n" +" it = iter(iterable)\n" +" d = deque(itertools.islice(it, n-1))\n" +" d.appendleft(0)\n" +" s = sum(d)\n" +" for elem in it:\n" +" s += elem - d.popleft()\n" +" d.append(elem)\n" +" yield s / n" -msgid "A `round-robin scheduler `_ can be implemented with input iterators stored in a :class:`deque`. Values are yielded from the active iterator in position zero. If that iterator is exhausted, it can be removed with :meth:`~deque.popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque.rotate` method::" -msgstr "" +msgid "" +"A `round-robin scheduler `_ can be implemented with input iterators stored in a " +":class:`deque`. Values are yielded from the active iterator in position " +"zero. If that iterator is exhausted, it can be removed with " +":meth:`~deque.popleft`; otherwise, it can be cycled back to the end with the" +" :meth:`~deque.rotate` method::" +msgstr "" +"می‌توان یک `زمان‌بند نوبتی (round-robin scheduler) " +"`_ را با پیمایش‌گرهای " +"ورودی ذخیره‌شده در یک :class:`deque` پیاده‌سازی کرد. مقادیر از پیمایش‌گر فعال " +"در اندیس ۰ تولید می‌شوند. اگر آن پیمایش‌گر به پایان برسد، می‌توان آن را با " +":meth:`~deque.popleft` حذف کرد؛ در غیر این صورت، می‌توان آن را با متد " +":meth:`~deque.rotate` به انتها چرخاند::" msgid "" "def roundrobin(*iterables):\n" @@ -577,9 +1174,26 @@ msgid "" " # Remove an exhausted iterator.\n" " iterators.popleft()" msgstr "" +"def roundrobin(*iterables):\n" +" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" +" iterators = deque(map(iter, iterables))\n" +" while iterators:\n" +" try:\n" +" while True:\n" +" yield next(iterators[0])\n" +" iterators.rotate(-1)\n" +" except StopIteration:\n" +" # Remove an exhausted iterator.\n" +" iterators.popleft()" -msgid "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` slicing and deletion. For example, a pure Python implementation of ``del d[n]`` relies on the ``rotate()`` method to position elements to be popped::" +msgid "" +"The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " +"slicing and deletion. For example, a pure Python implementation of ``del " +"d[n]`` relies on the ``rotate()`` method to position elements to be popped::" msgstr "" +"متد :meth:`~deque.rotate` راهی برای پیاده‌سازی برش و حذف :class:`deque` " +"فراهم می‌کند. برای مثال، یک پیاده‌سازی پایتون خالص از ``del d[n]`` برای قرار" +" دادن عناصر در موقعیت مناسب جهت خارج کردن، به متد ``rotate()`` متکی است::" msgid "" "def delete_nth(d, n):\n" @@ -587,114 +1201,312 @@ msgid "" " d.popleft()\n" " d.rotate(n)" msgstr "" +"def delete_nth(d, n):\n" +" d.rotate(-n)\n" +" d.popleft()\n" +" d.rotate(n)" -msgid "To implement :class:`deque` slicing, use a similar approach applying :meth:`~deque.rotate` to bring a target element to the left side of the deque. Remove old entries with :meth:`~deque.popleft`, add new entries with :meth:`~deque.extend`, and then reverse the rotation. With minor variations on that approach, it is easy to implement Forth style stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``." -msgstr "" +msgid "" +"To implement :class:`deque` slicing, use a similar approach applying " +":meth:`~deque.rotate` to bring a target element to the left side of the " +"deque. Remove old entries with :meth:`~deque.popleft`, add new entries with " +":meth:`~deque.extend`, and then reverse the rotation. With minor variations " +"on that approach, it is easy to implement Forth style stack manipulations " +"such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and " +"``roll``." +msgstr "" +"برای پیاده‌سازی برش :class:`deque`، از رویکرد مشابهی با اعمال " +":meth:`~deque.rotate` استفاده کنید تا یک عنصر هدف به سمت چپ deque برسد. " +"آیتم‌های قدیمی را با :meth:`~deque.popleft` حذف کنید، آیتم‌های جدید را با " +":meth:`~deque.extend` اضافه کنید و سپس چرخش را معکوس کنید. با تغییرات جزئی " +"در این رویکرد، پیاده‌سازی دستکاری‌های پشته به سبک Forth مانند ``dup``، " +"``drop``، ``swap``، ``over``، ``pick``، ``rot`` و ``roll`` آسان است." msgid ":class:`defaultdict` objects" -msgstr "" +msgstr "اشیای :class:`defaultdict`" -msgid "Return a new dictionary-like object. :class:`defaultdict` is a subclass of the built-in :class:`dict` class. It overrides one method and adds one writable instance variable. The remaining functionality is the same as for the :class:`dict` class and is not documented here." +msgid "" +"Return a new dictionary-like object. :class:`defaultdict` is a subclass of " +"the built-in :class:`dict` class. It overrides one method and adds one " +"writable instance variable. The remaining functionality is the same as for " +"the :class:`dict` class and is not documented here." msgstr "" +"یک شیء دیکشنری‌مانند جدید برمی‌گرداند. :class:`defaultdict` زیرکلاسی از " +"کلاس توکار :class:`dict` است. این کلاس یک متد را بازتعریف می‌کند و یک متغیر " +"نمونه قابل‌نوشتن اضافه می‌کند. سایر قابلیت‌ها مانند کلاس :class:`dict` هستند" +" و در اینجا مستند نشده‌اند." -msgid "The first argument provides the initial value for the :attr:`default_factory` attribute; it defaults to ``None``. All remaining arguments are treated the same as if they were passed to the :class:`dict` constructor, including keyword arguments." +msgid "" +"The first argument provides the initial value for the " +":attr:`default_factory` attribute; it defaults to ``None``. All remaining " +"arguments are treated the same as if they were passed to the :class:`dict` " +"constructor, including keyword arguments." msgstr "" +"نخستین آرگومان مقدار اولیه‌ی ویژگی :attr:`default_factory` را فراهم می‌کند؛ " +"مقدار پیش‌فرض آن ``None`` است. با تمام آرگومان‌های باقی‌مانده همان‌گونه " +"رفتار می‌شود که گویی به سازنده‌ی :class:`dict` ارسال شده باشند، از جمله " +"آرگومان‌های کلیدواژه‌ای." -msgid ":class:`!defaultdict`\\s are :ref:`generic ` over two types, signifying (respectively) the types of the dictionary's keys and values." +msgid "" +":class:`!defaultdict`\\s are :ref:`generic ` over two types, " +"signifying (respectively) the types of the dictionary's keys and values." msgstr "" +":class:`!defaultdict`\\ها نسبت به دو نوع :ref:`عام ` هستند که " +"(به‌ترتیب) بیانگر انواع کلیدها و مقادیر دیکشنری هستند." -msgid ":class:`defaultdict` objects support the following method in addition to the standard :class:`dict` operations:" +msgid "" +":class:`defaultdict` objects support the following method in addition to the" +" standard :class:`dict` operations:" msgstr "" +"اشیای :class:`defaultdict` علاوه بر عملیات استاندارد :class:`dict`، از متد " +"زیر نیز پشتیبانی می‌کنند:" -msgid "If the :attr:`default_factory` attribute is ``None``, this raises a :exc:`KeyError` exception with the *key* as argument." +msgid "" +"If the :attr:`default_factory` attribute is ``None``, this raises a " +":exc:`KeyError` exception with the *key* as argument." msgstr "" +"اگر ویژگی :attr:`default_factory` برابر ``None`` باشد، این عمل یک استثنای " +":exc:`KeyError` را با *key* به‌عنوان آرگومان پرتاب می‌کند." -msgid "If :attr:`default_factory` is not ``None``, it is called without arguments to provide a default value for the given *key*, this value is inserted in the dictionary for the *key*, and returned." +msgid "" +"If :attr:`default_factory` is not ``None``, it is called without arguments " +"to provide a default value for the given *key*, this value is inserted in " +"the dictionary for the *key*, and returned." msgstr "" +"اگر :attr:`default_factory` برابر ``None`` نباشد، بدون آرگومان فراخوانی " +"می‌شود تا مقدار پیش‌فرضی برای *کلید* داده‌شده فراهم کند؛ این مقدار در " +"دیکشنری برای *کلید* درج می‌شود و برگردانده می‌شود." -msgid "If calling :attr:`default_factory` raises an exception this exception is propagated unchanged." +msgid "" +"If calling :attr:`default_factory` raises an exception this exception is " +"propagated unchanged." msgstr "" +"اگر فراخوانی :attr:`default_factory` باعث پرتاب استثنایی شود، این استثنا " +"بدون تغییر انتشار می‌یابد." -msgid "This method is called by the :meth:`~object.__getitem__` method of the :class:`dict` class when the requested key is not found; whatever it returns or raises is then returned or raised by :meth:`~object.__getitem__`." +msgid "" +"This method is called by the :meth:`~object.__getitem__` method of the " +":class:`dict` class when the requested key is not found; whatever it returns" +" or raises is then returned or raised by :meth:`~object.__getitem__`." msgstr "" +"این متد توسط متد :meth:`~object.__getitem__` از کلاس :class:`dict` زمانی " +"فراخوانی می‌شود که کلید درخواست‌شده یافت نشود؛ هر آنچه برگرداند یا پرتاب " +"کند، سپس توسط :meth:`~object.__getitem__` برگردانده یا پرتاب می‌شود." -msgid "Note that :meth:`__missing__` is *not* called for any operations besides :meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like normal dictionaries, return ``None`` as a default rather than using :attr:`default_factory`." +msgid "" +"Note that :meth:`__missing__` is *not* called for any operations besides " +":meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like " +"normal dictionaries, return ``None`` as a default rather than using " +":attr:`default_factory`." msgstr "" +"توجه داشته باشید که :meth:`__missing__` برای هیچ عملیاتی به جز " +":meth:`~object.__getitem__` فراخوانی *نمی‌شود*. این بدان معناست که " +":meth:`~dict.get` مانند دیکشنری‌های معمولی، به جای استفاده از " +":attr:`default_factory`، ``None`` را به‌عنوان مقدار پیش‌فرض برمی‌گرداند." msgid ":class:`defaultdict` objects support the following instance variable:" -msgstr "" +msgstr "اشیای :class:`defaultdict` از متغیر نمونه‌ی زیر پشتیبانی می‌کنند:" -msgid "This attribute is used by the :meth:`~defaultdict.__missing__` method; it is initialized from the first argument to the constructor, if present, or to ``None``, if absent." +msgid "" +"This attribute is used by the :meth:`~defaultdict.__missing__` method; it is" +" initialized from the first argument to the constructor, if present, or to " +"``None``, if absent." msgstr "" +"این ویژگی توسط متد :meth:`~defaultdict.__missing__` استفاده می‌شود؛ در صورت " +"وجود اولین آرگومان سازنده، از آن مقداردهی اولیه می‌شود و در غیر این صورت به " +"``None`` مقداردهی اولیه می‌شود." -msgid "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." +msgid "" +"Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" +"عملگرهای ادغام (``|``) و به‌روزرسانی (``|=``)، مشخص‌شده در :pep:`584`، " +"افزوده شدند." msgid ":class:`defaultdict` Examples" -msgstr "" +msgstr "مثال‌های :class:`defaultdict`" -msgid "Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy to group a sequence of key-value pairs into a dictionary of lists:" +msgid "" +"Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy " +"to group a sequence of key-value pairs into a dictionary of lists:" msgstr "" +"با استفاده از :class:`list` به‌عنوان :attr:`~defaultdict.default_factory`، " +"به‌آسانی می‌توان دنباله‌ای از جفت‌های کلید-مقدار را در یک دیکشنری از " +"فهرست‌ها گروه‌بندی کرد:" -msgid "When each key is encountered for the first time, it is not already in the mapping; so an entry is automatically created using the :attr:`~defaultdict.default_factory` function which returns an empty :class:`list`. The :meth:`list.append` operation then attaches the value to the new list. When keys are encountered again, the look-up proceeds normally (returning the list for that key) and the :meth:`list.append` operation adds another value to the list. This technique is simpler and faster than an equivalent technique using :meth:`dict.setdefault`:" -msgstr "" +msgid "" +"When each key is encountered for the first time, it is not already in the " +"mapping; so an entry is automatically created using the " +":attr:`~defaultdict.default_factory` function which returns an empty " +":class:`list`. The :meth:`list.append` operation then attaches the value to" +" the new list. When keys are encountered again, the look-up proceeds " +"normally (returning the list for that key) and the :meth:`list.append` " +"operation adds another value to the list. This technique is simpler and " +"faster than an equivalent technique using :meth:`dict.setdefault`:" +msgstr "" +"هنگامی که هر کلید برای نخستین بار مشاهده می‌شود، از قبل در نگاشت وجود ندارد؛" +" بنابراین یک آیتم به‌طور خودکار با استفاده از تابع " +":attr:`~defaultdict.default_factory` ایجاد می‌شود که یک :class:`list` خالی " +"برمی‌گرداند. سپس عملیات :meth:`list.append` مقدار را به فهرست جدید اضافه " +"می‌کند. هنگامی که کلیدها دوباره مشاهده می‌شوند، جست‌وجو به‌طور عادی انجام " +"می‌شود (فهرست مربوط به آن کلید را برمی‌گرداند) و عملیات :meth:`list.append` " +"مقدار دیگری را به فهرست اضافه می‌کند. این روش ساده‌تر و سریع‌تر از روش " +"معادلی است که از :meth:`dict.setdefault` استفاده می‌کند:" -msgid "Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :class:`defaultdict` useful for counting (like a bag or multiset in other languages):" +msgid "" +"Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the " +":class:`defaultdict` useful for counting (like a bag or multiset in other " +"languages):" msgstr "" +"با تنظیم :attr:`~defaultdict.default_factory` روی :class:`int`، " +":class:`defaultdict` برای شمارش مفید می‌شود (مانند bag یا multiset در " +"زبان‌های دیگر):" -msgid "When a letter is first encountered, it is missing from the mapping, so the :attr:`~defaultdict.default_factory` function calls :func:`int` to supply a default count of zero. The increment operation then builds up the count for each letter." +msgid "" +"When a letter is first encountered, it is missing from the mapping, so the " +":attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " +"default count of zero. The increment operation then builds up the count for" +" each letter." msgstr "" +"هنگامی که برای نخستین بار با حرفی مواجه می‌شوید، آن حرف در نگاشت وجود ندارد،" +" بنابراین تابع :attr:`~defaultdict.default_factory`، تابع :func:`int` را " +"فراخوانی می‌کند تا یک شمارش پیش‌فرض برابر با صفر فراهم کند. سپس عملیات " +"افزایش، شمارش هر حرف را به‌تدریج افزایش می‌دهد." -msgid "The function :func:`int` which always returns zero is just a special case of constant functions. A faster and more flexible way to create constant functions is to use a lambda function which can supply any constant value (not just zero):" +msgid "" +"The function :func:`int` which always returns zero is just a special case of" +" constant functions. A faster and more flexible way to create constant " +"functions is to use a lambda function which can supply any constant value " +"(not just zero):" msgstr "" +"تابع :func:`int` که همیشه صفر را برمی‌گرداند، تنها حالت خاصی از توابع ثابت " +"است. راهی سریع‌تر و انعطاف‌پذیرتر برای ایجاد توابع ثابت، استفاده از یک تابع " +"لامبدا است که می‌تواند هر مقدار ثابتی را ارائه کند (نه فقط صفر):" -msgid "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :class:`defaultdict` useful for building a dictionary of sets:" +msgid "" +"Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the " +":class:`defaultdict` useful for building a dictionary of sets:" msgstr "" +"با تنظیم :attr:`~defaultdict.default_factory` روی :class:`set`، " +":class:`defaultdict` برای ساختن یک دیکشنری از مجموعه‌ها مفید می‌شود:" msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" -msgstr "" +msgstr ":func:`namedtuple` تابع کارخانه برای تاپل‌های دارای فیلدهای نام‌دار" -msgid "Named tuples assign meaning to each position in a tuple and allow for more readable, self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index." +msgid "" +"Named tuples assign meaning to each position in a tuple and allow for more " +"readable, self-documenting code. They can be used wherever regular tuples " +"are used, and they add the ability to access fields by name instead of " +"position index." msgstr "" +"تاپل‌های نام‌دار به هر جایگاه در یک تاپل معنا می‌بخشند و امکان کدی خواناتر و" +" خودمستند را فراهم می‌کنند. این تاپل‌ها می‌توانند هر جا که تاپل‌های معمولی " +"استفاده می‌شوند، به کار روند و توانایی دسترسی به فیلدها از طریق نام به‌جای " +"اندیس جایگاه را اضافه کنند." -msgid "Returns a new tuple subclass named *typename*. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. Instances of the subclass also have a helpful docstring (with *typename* and *field_names*) and a helpful :meth:`~object.__repr__` method which lists the tuple contents in a ``name=value`` format." -msgstr "" +msgid "" +"Returns a new tuple subclass named *typename*. The new subclass is used to " +"create tuple-like objects that have fields accessible by attribute lookup as" +" well as being indexable and iterable. Instances of the subclass also have " +"a helpful docstring (with *typename* and *field_names*) and a helpful " +":meth:`~object.__repr__` method which lists the tuple contents in a " +"``name=value`` format." +msgstr "" +"یک زیرکلاس جدید از تاپل به نام *typename* برمی‌گرداند. زیرکلاس جدید برای " +"ایجاد اشیایی شبیه به تاپل به کار می‌رود که فیلدهایی قابل دسترسی از طریق " +"جست‌وجوی ویژگی دارند و همچنین قابل اندیس‌گذاری و پیمایش‌پذیر هستند. نمونه‌های " +"این زیرکلاس همچنین یک رشته مستند مفید (شامل *typename* و *field_names*) و " +"یک متد مفید :meth:`~object.__repr__` دارند که محتویات تاپل را در قالب " +"``name=value`` فهرست می‌کند." -msgid "The *field_names* are a sequence of strings such as ``['x', 'y']``. Alternatively, *field_names* can be a single string with each fieldname separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``." +msgid "" +"The *field_names* are a sequence of strings such as ``['x', 'y']``. " +"Alternatively, *field_names* can be a single string with each fieldname " +"separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``." msgstr "" +"*field_names* دنباله‌ای از رشته‌ها مانند ``['x', 'y']`` است. به‌عنوان " +"جایگزین، *field_names* می‌تواند یک رشته واحد باشد که در آن هر نام فیلد با " +"فضای خالی و/یا کاما جدا شده باشد، برای مثال ``'x y'`` یا ``'x, y'``." -msgid "Any valid Python identifier may be used for a fieldname except for names starting with an underscore. Valid identifiers consist of letters, digits, and underscores but do not start with a digit or underscore and cannot be a :mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*." +msgid "" +"Any valid Python identifier may be used for a fieldname except for names " +"starting with an underscore. Valid identifiers consist of letters, digits, " +"and underscores but do not start with a digit or underscore and cannot be a " +":mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or " +"*raise*." msgstr "" +"هر شناسه معتبر پایتون را می‌توان برای نام فیلد به کار برد، به‌جز نام‌هایی که" +" با زیرخط شروع می‌شوند. شناسه‌های معتبر از حروف، ارقام و زیرخط تشکیل " +"می‌شوند، اما با رقم یا زیرخط شروع نمی‌شوند و نمی‌توانند یک :mod:`keyword` " +"مانند *class*، *for*، *return*، *global*، *pass* یا *raise* باشند." -msgid "If *rename* is true, invalid fieldnames are automatically replaced with positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def`` and the duplicate fieldname ``abc``." +msgid "" +"If *rename* is true, invalid fieldnames are automatically replaced with " +"positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " +"converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def``" +" and the duplicate fieldname ``abc``." msgstr "" +"اگر *rename* مقدار true داشته باشد، نام‌های فیلد نامعتبر به‌طور خودکار با " +"نام‌های جایگاهی جایگزین می‌شوند. برای مثال، ``['abc', 'def', 'ghi', 'abc']``" +" به ``['abc', '_1', 'ghi', '_3']`` تبدیل می‌شود و کلیدواژه ``def`` و نام " +"فیلد تکراری ``abc`` حذف می‌شوند." -msgid "*defaults* can be ``None`` or an :term:`iterable` of default values. Since fields with a default value must come after any fields without a default, the *defaults* are applied to the rightmost parameters. For example, if the fieldnames are ``['x', 'y', 'z']`` and the defaults are ``(1, 2)``, then ``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` will default to ``2``." -msgstr "" +msgid "" +"*defaults* can be ``None`` or an :term:`iterable` of default values. Since " +"fields with a default value must come after any fields without a default, " +"the *defaults* are applied to the rightmost parameters. For example, if the" +" fieldnames are ``['x', 'y', 'z']`` and the defaults are ``(1, 2)``, then " +"``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` " +"will default to ``2``." +msgstr "" +"*defaults* می‌تواند ``None`` یا یک :term:`پیمایش‌پذیر ` از مقادیر " +"پیش‌فرض باشد. از آن‌جا که فیلدهای دارای مقدار پیش‌فرض باید بعد از فیلدهای " +"بدون مقدار پیش‌فرض بیایند، *defaults* به راست‌ترین پارامترها اعمال می‌شود. " +"برای مثال، اگر نام فیلدها ``['x', 'y', 'z']`` و مقادیر پیش‌فرض ``(1, 2)`` " +"باشند، ``x`` یک آرگومان ضروری خواهد بود، مقدار پیش‌فرض ``y`` برابر ``1`` " +"خواهد بود، و مقدار پیش‌فرض ``z`` برابر ``2`` خواهد بود." -msgid "If *module* is defined, the :attr:`~type.__module__` attribute of the named tuple is set to that value." +msgid "" +"If *module* is defined, the :attr:`~type.__module__` attribute of the named " +"tuple is set to that value." msgstr "" +"اگر *module* تعریف شده باشد، ویژگی :attr:`~type.__module__` تاپل نام‌دار " +"(named tuple) برابر آن مقدار قرار می‌گیرد." -msgid "Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples." +msgid "" +"Named tuple instances do not have per-instance dictionaries, so they are " +"lightweight and require no more memory than regular tuples." msgstr "" +"نمونه‌های تاپل نام‌دار، دیکشنری‌های به‌ازای هر نمونه ندارند، بنابراین سبک " +"هستند و به حافظه بیشتری نسبت به تاپل‌های معمولی نیاز ندارند." -msgid "To support pickling, the named tuple class should be assigned to a variable that matches *typename*." +msgid "" +"To support pickling, the named tuple class should be assigned to a variable " +"that matches *typename*." msgstr "" +"برای پشتیبانی از پیکل‌کردن (pickling)، کلاس تاپل نام‌دار (named tuple) باید " +"به متغیری اختصاص داده شود که با *typename* مطابقت داشته باشد." msgid "Added support for *rename*." -msgstr "" +msgstr "پشتیبانی از *تغییر نام* افزوده شد." -msgid "The *verbose* and *rename* parameters became :ref:`keyword-only arguments `." +msgid "" +"The *verbose* and *rename* parameters became :ref:`keyword-only arguments " +"`." msgstr "" +"پارامترهای *verbose* و *rename* به :ref:`آرگومان‌های فقط کلیدواژه‌ای " +"` تبدیل شدند." msgid "Added the *module* parameter." -msgstr "" +msgstr "پارامتر *module* اضافه شد." msgid "Removed the *verbose* parameter and the :attr:`!_source` attribute." -msgstr "" +msgstr "پارامتر *verbose* و ویژگی :attr:`!_source` حذف شدند." -msgid "Added the *defaults* parameter and the :attr:`~somenamedtuple._field_defaults` attribute." +msgid "" +"Added the *defaults* parameter and the " +":attr:`~somenamedtuple._field_defaults` attribute." msgstr "" +"پارامتر *defaults* و ویژگی :attr:`~somenamedtuple._field_defaults` اضافه شد." msgid "" ">>> # Basic example\n" @@ -710,9 +1522,25 @@ msgid "" ">>> p # readable __repr__ with a name=value style\n" "Point(x=11, y=22)" msgstr "" +">>> # Basic example\n" +">>> Point = namedtuple('Point', ['x', 'y'])\n" +">>> p = Point(11, y=22) # instantiate with positional or keyword arguments\n" +">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n" +"33\n" +">>> x, y = p # unpack like a regular tuple\n" +">>> x, y\n" +"(11, 22)\n" +">>> p.x + p.y # fields also accessible by name\n" +"33\n" +">>> p # readable __repr__ with a name=value style\n" +"Point(x=11, y=22)" -msgid "Named tuples are especially useful for assigning field names to result tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" +msgid "" +"Named tuples are especially useful for assigning field names to result " +"tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" msgstr "" +"تاپل‌های نام‌دار به‌ویژه برای اختصاص نام‌های فیلد به تاپل‌های نتیجه‌ای که از" +" ماژول‌های :mod:`csv` یا :mod:`sqlite3` بازگردانده می‌شوند، مفید هستند::" msgid "" "EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade')\n" @@ -728,36 +1556,79 @@ msgid "" "for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" " print(emp.name, emp.title)" msgstr "" +"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade')\n" +"\n" +"import csv\n" +"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", \"rb\"))):\n" +" print(emp.name, emp.title)\n" +"\n" +"import sqlite3\n" +"conn = sqlite3.connect('/companydata')\n" +"cursor = conn.cursor()\n" +"cursor.execute('SELECT name, age, title, department, paygrade FROM employees')\n" +"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" +" print(emp.name, emp.title)" -msgid "In addition to the methods inherited from tuples, named tuples support three additional methods and two attributes. To prevent conflicts with field names, the method and attribute names start with an underscore." +msgid "" +"In addition to the methods inherited from tuples, named tuples support three" +" additional methods and two attributes. To prevent conflicts with field " +"names, the method and attribute names start with an underscore." msgstr "" +"علاوه بر متدهای به ارث برده‌شده از تاپل‌ها، تاپل‌های نام‌دار از سه متد و دو" +" ویژگی اضافی پشتیبانی می‌کنند. برای جلوگیری از تداخل با نام فیلدها، نام " +"متدها و ویژگی‌ها با یک زیرخط شروع می‌شوند." -msgid "Class method that makes a new instance from an existing sequence or iterable." +msgid "" +"Class method that makes a new instance from an existing sequence or " +"iterable." msgstr "" +"متد کلاسی که یک نمونه جدید را از یک دنباله یا پیمایش‌پذیر موجود می‌سازد." msgid "" ">>> t = [11, 22]\n" ">>> Point._make(t)\n" "Point(x=11, y=22)" msgstr "" +">>> t = [11, 22]\n" +">>> Point._make(t)\n" +"Point(x=11, y=22)" -msgid "Return a new :class:`dict` which maps field names to their corresponding values:" +msgid "" +"Return a new :class:`dict` which maps field names to their corresponding " +"values:" msgstr "" +"یک :class:`dict` جدید برمی‌گرداند که نام فیلدها را به مقادیر متناظر آن‌ها " +"نگاشت می‌کند:" msgid "" ">>> p = Point(x=11, y=22)\n" ">>> p._asdict()\n" "{'x': 11, 'y': 22}" msgstr "" +">>> p = Point(x=11, y=22)\n" +">>> p._asdict()\n" +"{'x': 11, 'y': 22}" msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." -msgstr "" +msgstr "یک :class:`OrderedDict` به‌جای یک :class:`dict` معمولی برمی‌گرداند." -msgid "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of Python 3.7, regular dicts are guaranteed to be ordered. If the extra features of :class:`OrderedDict` are required, the suggested remediation is to cast the result to the desired type: ``OrderedDict(nt._asdict())``." +msgid "" +"Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " +"Python 3.7, regular dicts are guaranteed to be ordered. If the extra " +"features of :class:`OrderedDict` are required, the suggested remediation is " +"to cast the result to the desired type: ``OrderedDict(nt._asdict())``." msgstr "" +"یک :class:`dict` معمولی را به‌جای یک :class:`OrderedDict` بازمی‌گرداند. از " +"پایتون 3.7 به بعد، ترتیب دیکشنری‌های معمولی تضمین شده است. اگر امکانات اضافی" +" :class:`OrderedDict` مورد نیاز باشد، راه‌حل پیشنهادی، تبدیل نتیجه به نوع " +"دلخواه است: ``OrderedDict(nt._asdict())``." -msgid "Return a new instance of the named tuple replacing specified fields with new values::" +msgid "" +"Return a new instance of the named tuple replacing specified fields with new" +" values::" msgstr "" +"یک نمونه جدید از تاپل نام‌دار (named tuple) برمی‌گرداند که در آن فیلدهای " +"مشخص‌شده با مقدارهای جدید جایگزین شده‌اند::" msgid "" ">>> p = Point(x=11, y=22)\n" @@ -767,15 +1638,32 @@ msgid "" ">>> for partnum, record in inventory.items():\n" "... inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())" msgstr "" +">>> p = Point(x=11, y=22)\n" +">>> p._replace(x=33)\n" +"Point(x=33, y=22)\n" +"\n" +">>> for partnum, record in inventory.items():\n" +"... inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())" -msgid "Named tuples are also supported by generic function :func:`copy.replace`." +msgid "" +"Named tuples are also supported by generic function :func:`copy.replace`." msgstr "" +"تابع عام :func:`copy.replace` نیز از تاپل‌های نام‌دار (named tuples) " +"پشتیبانی می‌کند." -msgid "Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword arguments." +msgid "" +"Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword " +"arguments." msgstr "" +"برای آرگومان‌های کلیدواژه‌ای نامعتبر، به‌جای :exc:`ValueError `، " +":exc:`TypeError ` پرتاب می‌شود." -msgid "Tuple of strings listing the field names. Useful for introspection and for creating new named tuple types from existing named tuples." +msgid "" +"Tuple of strings listing the field names. Useful for introspection and for " +"creating new named tuple types from existing named tuples." msgstr "" +"تاپلی از رشته‌ها که نام فیلدها را فهرست می‌کند. برای درون‌نگری و ایجاد انواع" +" جدیدی از تاپل‌های نام‌دار از تاپل‌های نام‌دار موجود مفید است." msgid "" ">>> p._fields # view the field names\n" @@ -786,9 +1674,16 @@ msgid "" ">>> Pixel(11, 22, 128, 255, 0)\n" "Pixel(x=11, y=22, red=128, green=255, blue=0)" msgstr "" +">>> p._fields # view the field names\n" +"('x', 'y')\n" +"\n" +">>> Color = namedtuple('Color', 'red green blue')\n" +">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n" +">>> Pixel(11, 22, 128, 255, 0)\n" +"Pixel(x=11, y=22, red=128, green=255, blue=0)" msgid "Dictionary mapping field names to default values." -msgstr "" +msgstr "دیکشنری‌ای که نام فیلدها را به مقادیر پیش‌فرض نگاشت می‌کند." msgid "" ">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" @@ -797,15 +1692,35 @@ msgid "" ">>> Account('premium')\n" "Account(type='premium', balance=0)" msgstr "" +">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" +">>> Account._field_defaults\n" +"{'balance': 0}\n" +">>> Account('premium')\n" +"Account(type='premium', balance=0)" -msgid "To retrieve a field whose name is stored in a string, use the :func:`getattr` function:" +msgid "" +"To retrieve a field whose name is stored in a string, use the " +":func:`getattr` function:" msgstr "" +"برای بازیابی فیلدی که نام آن در یک رشته ذخیره‌شده است، از تابع " +":func:`getattr` استفاده کنید:" -msgid "To convert a dictionary to a named tuple, use the double-star-operator (as described in :ref:`tut-unpacking-arguments`):" +msgid "" +"To convert a dictionary to a named tuple, use the double-star-operator (as " +"described in :ref:`tut-unpacking-arguments`):" msgstr "" +"برای تبدیل یک دیکشنری به یک تاپل نام‌دار (named tuple)، از عملگر دو ستاره‌ای" +" (double-star-operator) استفاده کنید (همان‌طور که در :ref:`tut-unpacking-" +"arguments` توضیح داده شده است):" -msgid "Since a named tuple is a regular Python class, it is easy to add or change functionality with a subclass. Here is how to add a calculated field and a fixed-width print format:" +msgid "" +"Since a named tuple is a regular Python class, it is easy to add or change " +"functionality with a subclass. Here is how to add a calculated field and a " +"fixed-width print format:" msgstr "" +"از آن‌جا که تاپل نام‌دار (named tuple) یک کلاس معمولی پایتون است، افزودن یا " +"تغییر قابلیت با یک زیرکلاس آسان است. در این‌جا نحوه افزودن یک فیلد " +"محاسبه‌شده و یک قالب چاپ با عرض ثابت آمده است:" msgid "" ">>> class Point(namedtuple('Point', ['x', 'y'])):\n" @@ -821,21 +1736,54 @@ msgid "" "Point: x= 3.000 y= 4.000 hypot= 5.000\n" "Point: x=14.000 y= 0.714 hypot=14.018" msgstr "" +">>> class Point(namedtuple('Point', ['x', 'y'])):\n" +"... __slots__ = ()\n" +"... @property\n" +"... def hypot(self):\n" +"... return (self.x ** 2 + self.y ** 2) ** 0.5\n" +"... def __str__(self):\n" +"... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot)\n" +"\n" +">>> for p in Point(3, 4), Point(14, 5/7):\n" +"... print(p)\n" +"Point: x= 3.000 y= 4.000 hypot= 5.000\n" +"Point: x=14.000 y= 0.714 hypot=14.018" -msgid "The subclass shown above sets ``__slots__`` to an empty tuple. This helps keep memory requirements low by preventing the creation of instance dictionaries." +msgid "" +"The subclass shown above sets ``__slots__`` to an empty tuple. This helps " +"keep memory requirements low by preventing the creation of instance " +"dictionaries." msgstr "" +"زیرکلاسی که در بالا نشان داده شد، ``__slots__`` را برابر با یک تاپل خالی " +"قرار می‌دهد. این کار با جلوگیری از ایجاد دیکشنری‌های نمونه‌ها، به پایین نگه " +"داشتن میزان حافظه مورد نیاز کمک می‌کند." -msgid "Subclassing is not useful for adding new, stored fields. Instead, simply create a new named tuple type from the :attr:`~somenamedtuple._fields` attribute:" +msgid "" +"Subclassing is not useful for adding new, stored fields. Instead, simply " +"create a new named tuple type from the :attr:`~somenamedtuple._fields` " +"attribute:" msgstr "" +"زیرکلاس‌سازی برای افزودن فیلدهای ذخیره‌شده‌ی جدید مفید نیست. در عوض، " +"به‌سادگی یک نوع جدید named tuple از ویژگی :attr:`~somenamedtuple._fields` " +"ایجاد کنید:" -msgid "Docstrings can be customized by making direct assignments to the ``__doc__`` fields:" +msgid "" +"Docstrings can be customized by making direct assignments to the ``__doc__``" +" fields:" msgstr "" +"می‌توانید رشته مستندات را با انتساب مستقیم به فیلدهای ``__doc__`` سفارشی " +"کنید:" msgid "Property docstrings became writeable." -msgstr "" +msgstr "رشته‌مستندهای پراپرتی قابل‌نوشتن شدند." -msgid "See :class:`typing.NamedTuple` for a way to add type hints for named tuples. It also provides an elegant notation using the :keyword:`class` keyword::" +msgid "" +"See :class:`typing.NamedTuple` for a way to add type hints for named tuples." +" It also provides an elegant notation using the :keyword:`class` keyword::" msgstr "" +"برای روشی جهت افزودن راهنمای نوع به تاپل‌های نام‌دار، " +":class:`typing.NamedTuple` را ببینید. این کلاس همچنین یک نمادگذاری آراسته " +"با استفاده از کلیدواژه‌ی :keyword:`class` ارائه می‌کند::" msgid "" "class Component(NamedTuple):\n" @@ -843,66 +1791,164 @@ msgid "" " weight: float\n" " description: Optional[str] = None" msgstr "" +"class Component(NamedTuple):\n" +" part_number: int\n" +" weight: float\n" +" description: Optional[str] = None" -msgid "See :meth:`types.SimpleNamespace` for a mutable namespace based on an underlying dictionary instead of a tuple." +msgid "" +"See :meth:`types.SimpleNamespace` for a mutable namespace based on an " +"underlying dictionary instead of a tuple." msgstr "" +"برای یک فضای نام تغییرپذیر که به‌جای یک تاپل، مبتنی بر یک دیکشنری زیربنایی " +"است، :meth:`types.SimpleNamespace` را ببینید." -msgid "The :mod:`dataclasses` module provides a decorator and functions for automatically adding generated special methods to user-defined classes." +msgid "" +"The :mod:`dataclasses` module provides a decorator and functions for " +"automatically adding generated special methods to user-defined classes." msgstr "" +"ماژول :mod:`dataclasses` یک دکوراتور و توابعی را برای افزودن خودکار متدهای " +"ویژه‌ی تولیدشده به کلاس‌های تعریف‌شده توسط کاربر فراهم می‌کند." msgid ":class:`OrderedDict` objects" -msgstr "" +msgstr "اشیای :class:`OrderedDict`" -msgid "Ordered dictionaries are just like regular dictionaries but have some extra capabilities relating to ordering operations. They have become less important now that the built-in :class:`dict` class gained the ability to remember insertion order (this new behavior became guaranteed in Python 3.7)." +msgid "" +"Ordered dictionaries are just like regular dictionaries but have some extra " +"capabilities relating to ordering operations. They have become less " +"important now that the built-in :class:`dict` class gained the ability to " +"remember insertion order (this new behavior became guaranteed in Python " +"3.7)." msgstr "" +"دیکشنری‌های ترتیب‌دار دقیقاً مانند دیکشنری‌های معمولی هستند، اما قابلیت‌های " +"اضافی مربوط به عملیات ترتیب‌دهی دارند. اکنون که کلاس توکار :class:`dict` " +"توانایی به‌خاطر سپردن ترتیب درج را به دست آورده است، اهمیت کمتری یافته‌اند " +"(این رفتار جدید در Python 3.7 تضمین شد)." msgid "Some differences from :class:`dict` still remain:" -msgstr "" +msgstr "هنوز برخی تفاوت‌ها با :class:`dict` باقی مانده‌اند:" -msgid "The regular :class:`dict` was designed to be very good at mapping operations. Tracking insertion order was secondary." +msgid "" +"The regular :class:`dict` was designed to be very good at mapping " +"operations. Tracking insertion order was secondary." msgstr "" +":class:`dict` معمولی طراحی شده است تا در عملیات نگاشت بسیار کارآمد باشد. " +"پیگیری ترتیب درج، اولویت دوم بود." -msgid "The :class:`OrderedDict` was designed to be good at reordering operations. Space efficiency, iteration speed, and the performance of update operations were secondary." +msgid "" +"The :class:`OrderedDict` was designed to be good at reordering operations. " +"Space efficiency, iteration speed, and the performance of update operations " +"were secondary." msgstr "" +":class:`OrderedDict` به‌گونه‌ای طراحی شده بود که در عملیات تغییر ترتیب " +"عملکرد خوبی داشته باشد. کارایی فضایی، سرعت پیمایش و عملکرد عملیات " +"به‌روزرسانی در درجه دوم اهمیت قرار داشتند." -msgid "The :class:`OrderedDict` algorithm can handle frequent reordering operations better than :class:`dict`. As shown in the recipes below, this makes it suitable for implementing various kinds of LRU caches." +msgid "" +"The :class:`OrderedDict` algorithm can handle frequent reordering operations" +" better than :class:`dict`. As shown in the recipes below, this makes it " +"suitable for implementing various kinds of LRU caches." msgstr "" +"الگوریتم :class:`OrderedDict` می‌تواند عملیات مکرر بازچینش را بهتر از " +":class:`dict` مدیریت کند. همان‌طور که در دستورات زیر نشان داده شده است، این " +"امر آن را برای پیاده‌سازی انواع مختلفی از نهانگاه‌های LRU مناسب می‌سازد." -msgid "The equality operation for :class:`OrderedDict` checks for matching order." +msgid "" +"The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" +"عملیات برابری برای :class:`OrderedDict` یکسان بودن ترتیب را بررسی می‌کند." -msgid "A regular :class:`dict` can emulate the order sensitive equality test with ``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." +msgid "" +"A regular :class:`dict` can emulate the order sensitive equality test with " +"``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." msgstr "" +"یک :class:`dict` معمولی می‌تواند آزمون برابری حساس به ترتیب را با ``p == q " +"and all(k1 == k2 for k1, k2 in zip(p, q))`` شبیه‌سازی کند." -msgid "The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a different signature. It accepts an optional argument to specify which item is popped." +msgid "" +"The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a " +"different signature. It accepts an optional argument to specify which item " +"is popped." msgstr "" +"متد :meth:`~OrderedDict.popitem` در :class:`OrderedDict` امضای متفاوتی دارد." +" این متد یک آرگومان اختیاری می‌پذیرد تا مشخص کند کدام آیتم خارج می‌شود." -msgid "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " +"with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." msgstr "" +"یک :class:`dict` معمولی می‌تواند ``od.popitem(last=True)`` مربوط به " +"OrderedDict را با ``d.popitem()`` شبیه‌سازی کند، که تضمین می‌شود آیتم سمت " +"راست (آخرین آیتم) را خارج کند." -msgid "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the leftmost (first) item if it exists." +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)``" +" with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " +"leftmost (first) item if it exists." msgstr "" +"یک :class:`dict` معمولی می‌تواند ``od.popitem(last=False)`` مربوط به " +"OrderedDict را با ``(k := next(iter(d)), d.pop(k))`` شبیه‌سازی کند، که " +"چپ‌ترین (نخستین) آیتم را در صورت وجود برمی‌گرداند و حذف می‌کند." -msgid ":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to efficiently reposition an element to an endpoint." +msgid "" +":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " +"efficiently reposition an element to an endpoint." msgstr "" +":class:`OrderedDict` یک متد :meth:`~OrderedDict.move_to_end` برای جابه‌جایی " +"کارآمد یک عنصر به یک پایانه دارد." -msgid "A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its associated value to the rightmost (last) position." +msgid "" +"A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " +"last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " +"associated value to the rightmost (last) position." msgstr "" +"یک :class:`dict` معمولی می‌تواند ``od.move_to_end(k, last=True)`` در " +"OrderedDict را با ``d[k] = d.pop(k)`` شبیه‌سازی کند، که کلید و مقدار مرتبط " +"با آن را به جایگاه انتهایی (آخرین) منتقل می‌کند." -msgid "A regular :class:`dict` does not have an efficient equivalent for OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its associated value to the leftmost (first) position." +msgid "" +"A regular :class:`dict` does not have an efficient equivalent for " +"OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " +"associated value to the leftmost (first) position." msgstr "" +"یک :class:`dict` معمولی معادل کارآمدی برای ``od.move_to_end(k, last=False)``" +" در OrderedDict ندارد که کلید و مقدار مرتبط با آن را به چپ‌ترین (اولین) " +"جایگاه منتقل می‌کند." -msgid "Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." +msgid "" +"Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` " +"method." msgstr "" +"تا پیش از پایتون 3.8، :class:`dict` فاقد متد :meth:`~object.__reversed__` " +"بود." -msgid "Return an instance of a :class:`dict` subclass that has methods specialized for rearranging dictionary order." +msgid "" +"Return an instance of a :class:`dict` subclass that has methods specialized " +"for rearranging dictionary order." msgstr "" +"نمونه‌ای از یک زیرکلاس :class:`dict` برمی‌گرداند که دارای متدهایی اختصاصی " +"برای بازآرایی ترتیب دیکشنری است." -msgid "The :meth:`popitem` method for ordered dictionaries returns and removes a (key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-out)` order if *last* is true or :abbr:`FIFO (first-in, first-out)` order if false." +msgid "" +"The :meth:`popitem` method for ordered dictionaries returns and removes a " +"(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" +"out)` order if *last* is true or :abbr:`FIFO (first-in, first-out)` order if" +" false." msgstr "" +"متد :meth:`popitem` برای دیکشنری‌های ترتیب‌دار یک جفت (کلید، مقدار) را " +"برمی‌گرداند و حذف می‌کند. اگر *last* درست باشد، جفت‌ها به ترتیب :abbr:`LIFO " +"(last-in, first-out)` و اگر نادرست باشد، به ترتیب :abbr:`FIFO (first-in, " +"first-out)` برگردانده می‌شوند." -msgid "Move an existing *key* to either end of an ordered dictionary. The item is moved to the right end if *last* is true (the default) or to the beginning if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" +msgid "" +"Move an existing *key* to either end of an ordered dictionary. The item is " +"moved to the right end if *last* is true (the default) or to the beginning " +"if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" msgstr "" +"یک *key* موجود را به یکی از دو انتهای یک دیکشنری ترتیب‌دار منتقل می‌کند. اگر" +" *last* برابر true باشد (پیش‌فرض)، آیتم به انتهای سمت راست منتقل می‌شود و " +"اگر *last* برابر false باشد، به ابتدا منتقل می‌شود. در صورتی که *key* وجود " +"نداشته باشد، :exc:`KeyError` پرتاب می‌شود:" msgid "" ">>> d = OrderedDict.fromkeys('abcde')\n" @@ -913,27 +1959,67 @@ msgid "" ">>> ''.join(d)\n" "'bacde'" msgstr "" +">>> d = OrderedDict.fromkeys('abcde')\n" +">>> d.move_to_end('b')\n" +">>> ''.join(d)\n" +"'acdeb'\n" +">>> d.move_to_end('b', last=False)\n" +">>> ''.join(d)\n" +"'bacde'" -msgid "In addition to the usual mapping methods, ordered dictionaries also support reverse iteration using :func:`reversed`." +msgid "" +"In addition to the usual mapping methods, ordered dictionaries also support " +"reverse iteration using :func:`reversed`." msgstr "" +"علاوه بر متدهای معمول نگاشت، دیکشنری‌های ترتیبی نیز از تکرار معکوس با " +"استفاده از :func:`reversed` پشتیبانی می‌کنند." -msgid "Equality tests between :class:`OrderedDict` objects are order-sensitive and are roughly equivalent to ``list(od1.items())==list(od2.items())``." +msgid "" +"Equality tests between :class:`OrderedDict` objects are order-sensitive and " +"are roughly equivalent to ``list(od1.items())==list(od2.items())``." msgstr "" +"آزمون‌های برابری میان اشیای :class:`OrderedDict` به ترتیب حساس هستند و " +"تقریباً معادل ``list(od1.items())==list(od2.items())`` هستند." -msgid "Equality tests between :class:`OrderedDict` objects and other :class:`~collections.abc.Mapping` objects are order-insensitive like regular dictionaries. This allows :class:`OrderedDict` objects to be substituted anywhere a regular dictionary is used." +msgid "" +"Equality tests between :class:`OrderedDict` objects and other " +":class:`~collections.abc.Mapping` objects are order-insensitive like regular" +" dictionaries. This allows :class:`OrderedDict` objects to be substituted " +"anywhere a regular dictionary is used." msgstr "" +"آزمون‌های برابری بین اشیای :class:`OrderedDict` و سایر اشیای " +":class:`~collections.abc.Mapping` مانند دیکشنری‌های معمولی، نسبت به ترتیب " +"حساس نیستند. این امر امکان می‌دهد که اشیای :class:`OrderedDict` در هر جایی" +" که از یک دیکشنری معمولی استفاده می‌شود، جایگزین شوند." -msgid "The items, keys, and values :term:`views ` of :class:`OrderedDict` now support reverse iteration using :func:`reversed`." +msgid "" +"The items, keys, and values :term:`views ` of " +":class:`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" +":term:`نماهای ` آیتم‌ها، کلیدها و مقادیر " +":class:`OrderedDict` اکنون از پیمایش معکوس با استفاده از :func:`reversed` " +"پشتیبانی می‌کنند." -msgid "With the acceptance of :pep:`468`, order is retained for keyword arguments passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` method." +msgid "" +"With the acceptance of :pep:`468`, order is retained for keyword arguments " +"passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` " +"method." msgstr "" +"با پذیرش :pep:`468`، ترتیب برای آرگومان‌های کلیدواژه‌ای ارسال‌شده به " +"سازنده‌ی :class:`OrderedDict` و متد :meth:`~dict.update` آن حفظ می‌شود." msgid ":class:`OrderedDict` Examples and Recipes" -msgstr "" +msgstr ":class:`OrderedDict` مثال‌ها و دستورهای پخت" -msgid "It is straightforward to create an ordered dictionary variant that remembers the order the keys were *last* inserted. If a new entry overwrites an existing entry, the original insertion position is changed and moved to the end::" +msgid "" +"It is straightforward to create an ordered dictionary variant that remembers" +" the order the keys were *last* inserted. If a new entry overwrites an " +"existing entry, the original insertion position is changed and moved to the " +"end::" msgstr "" +"ایجاد گونه‌ای از دیکشنری مرتب که ترتیب *آخرین بار* درج کلیدها را به خاطر " +"می‌آورد، ساده است. اگر یک آیتم جدید، یک آیتم موجود را بازنویسی کند، موقعیت " +"درج اصلی تغییر می‌کند و به انتها منتقل می‌شود::" msgid "" "class LastUpdatedOrderedDict(OrderedDict):\n" @@ -943,9 +2029,19 @@ msgid "" " super().__setitem__(key, value)\n" " self.move_to_end(key)" msgstr "" +"class LastUpdatedOrderedDict(OrderedDict):\n" +" 'Store items in the order the keys were last added'\n" +"\n" +" def __setitem__(self, key, value):\n" +" super().__setitem__(key, value)\n" +" self.move_to_end(key)" -msgid "An :class:`OrderedDict` would also be useful for implementing variants of :deco:`functools.lru_cache`:" +msgid "" +"An :class:`OrderedDict` would also be useful for implementing variants of " +":deco:`functools.lru_cache`:" msgstr "" +"یک :class:`OrderedDict` همچنین می‌تواند برای پیاده‌سازی انواعی از " +":deco:`functools.lru_cache` مفید باشد:" msgid "" "from collections import OrderedDict\n" @@ -972,6 +2068,29 @@ msgid "" " self.cache.popitem(last=False)\n" " return result" msgstr "" +"from collections import OrderedDict\n" +"from time import monotonic\n" +"\n" +"class TimeBoundedLRU:\n" +" \"LRU Cache that invalidates and refreshes old entries.\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxage=30):\n" +" self.cache = OrderedDict() # { args : (timestamp, result)}\n" +" self.func = func\n" +" self.maxsize = maxsize\n" +" self.maxage = maxage\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" timestamp, result = self.cache[args]\n" +" if monotonic() - timestamp <= self.maxage:\n" +" return result\n" +" result = self.func(*args)\n" +" self.cache[args] = monotonic(), result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" msgid "" "class MultiHitLRUCache:\n" @@ -1008,60 +2127,197 @@ msgid "" " self.cache.popitem(last=False)\n" " return result" msgstr "" +"class MultiHitLRUCache:\n" +" \"\"\" LRU cache that defers caching a result until\n" +" it has been requested multiple times.\n" +"\n" +" To avoid flushing the LRU cache with one-time requests,\n" +" we don't cache until a request has been made more than once.\n" +"\n" +" \"\"\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxrequests=4096, cache_after=1):\n" +" self.requests = OrderedDict() # { uncached_key : request_count }\n" +" self.cache = OrderedDict() # { cached_key : function_result }\n" +" self.func = func\n" +" self.maxrequests = maxrequests # max number of uncached requests\n" +" self.maxsize = maxsize # max number of stored return values\n" +" self.cache_after = cache_after\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" return self.cache[args]\n" +" result = self.func(*args)\n" +" self.requests[args] = self.requests.get(args, 0) + 1\n" +" if self.requests[args] <= self.cache_after:\n" +" self.requests.move_to_end(args)\n" +" if len(self.requests) > self.maxrequests:\n" +" self.requests.popitem(last=False)\n" +" else:\n" +" self.requests.pop(args, None)\n" +" self.cache[args] = result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(last=False)\n" +" return result" msgid ":class:`UserDict` objects" -msgstr "" +msgstr "اشیای :class:`UserDict`" -msgid "The class, :class:`UserDict` acts as a wrapper around dictionary objects. The need for this class has been partially supplanted by the ability to subclass directly from :class:`dict`; however, this class can be easier to work with because the underlying dictionary is accessible as an attribute." +msgid "" +"The class, :class:`UserDict` acts as a wrapper around dictionary objects. " +"The need for this class has been partially supplanted by the ability to " +"subclass directly from :class:`dict`; however, this class can be easier to " +"work with because the underlying dictionary is accessible as an attribute." msgstr "" +"کلاس :class:`UserDict` به‌عنوان پوششی برای اشیای دیکشنری عمل می‌کند. نیاز به" +" این کلاس تا حدی با امکان ایجاد زیرکلاس مستقیماً از :class:`dict` جایگزین " +"شده است؛ با این حال، کار با این کلاس می‌تواند آسان‌تر باشد، زیرا دیکشنری " +"زیرین به‌عنوان یک ویژگی قابل دسترسی است." -msgid "Class that simulates a dictionary. The instance's contents are kept in a regular dictionary, which is accessible via the :attr:`data` attribute of :class:`!UserDict` instances. If arguments are provided, they are used to initialize :attr:`data`, like a regular dictionary." +msgid "" +"Class that simulates a dictionary. The instance's contents are kept in a " +"regular dictionary, which is accessible via the :attr:`data` attribute of " +":class:`!UserDict` instances. If arguments are provided, they are used to " +"initialize :attr:`data`, like a regular dictionary." msgstr "" +"کلاسی که یک دیکشنری را شبیه‌سازی می‌کند. محتویات نمونه در یک دیکشنری معمولی " +"نگهداری می‌شود، که از طریق ویژگی :attr:`data` نمونه‌های :class:`!UserDict` " +"قابل دسترسی است. اگر آرگومان‌هایی ارائه شوند، از آن‌ها برای مقداردهی اولیه‌ی" +" :attr:`data` استفاده می‌شود، مانند یک دیکشنری معمولی." -msgid "In addition to supporting the methods and operations of mappings, :class:`!UserDict` instances provide the following attribute:" +msgid "" +"In addition to supporting the methods and operations of mappings, " +":class:`!UserDict` instances provide the following attribute:" msgstr "" +"علاوه بر پشتیبانی از متدها و عملیات نگاشت‌ها، نمونه‌های :class:`!UserDict` " +"ویژگی زیر را فراهم می‌کنند:" -msgid "A real dictionary used to store the contents of the :class:`UserDict` class." +msgid "" +"A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "" +"یک دیکشنری واقعی که برای ذخیره‌ی محتویات کلاس :class:`UserDict` استفاده " +"می‌شود." msgid ":class:`UserList` objects" -msgstr "" +msgstr "اشیاء :class:`UserList`" -msgid "This class acts as a wrapper around list objects. It is a useful base class for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists." +msgid "" +"This class acts as a wrapper around list objects. It is a useful base class" +" for your own list-like classes which can inherit from them and override " +"existing methods or add new ones. In this way, one can add new behaviors to" +" lists." msgstr "" +"این کلاس به‌عنوان پوششی برای اشیای فهرست عمل می‌کند. این کلاس، کلاس پایه " +"مفیدی برای کلاس‌های فهرست‌مانند خودتان است که می‌توانند از آن‌ها ارث‌بری " +"کنند، متدهای موجود را بازنویسی کنند یا متدهای جدیدی اضافه کنند. به این " +"ترتیب، می‌توان رفتارهای جدیدی به فهرست‌ها اضافه کرد." -msgid "The need for this class has been partially supplanted by the ability to subclass directly from :class:`list`; however, this class can be easier to work with because the underlying list is accessible as an attribute." +msgid "" +"The need for this class has been partially supplanted by the ability to " +"subclass directly from :class:`list`; however, this class can be easier to " +"work with because the underlying list is accessible as an attribute." msgstr "" +"نیاز به این کلاس تا حدی با امکان زیرکلاس‌گیری مستقیم از :class:`list` " +"جایگزین شده است؛ با این حال، کار با این کلاس می‌تواند آسان‌تر باشد، زیرا " +"فهرست زیربنایی به‌عنوان یک ویژگی قابل دسترسی است." -msgid "Class that simulates a list. The instance's contents are kept in a regular list, which is accessible via the :attr:`data` attribute of :class:`UserList` instances. The instance's contents are initially set to a copy of *list*, defaulting to the empty list ``[]``. *list* can be any iterable, for example a real Python list or a :class:`UserList` object." -msgstr "" +msgid "" +"Class that simulates a list. The instance's contents are kept in a regular " +"list, which is accessible via the :attr:`data` attribute of " +":class:`UserList` instances. The instance's contents are initially set to a" +" copy of *list*, defaulting to the empty list ``[]``. *list* can be any " +"iterable, for example a real Python list or a :class:`UserList` object." +msgstr "" +"کلاسی که یک فهرست را شبیه‌سازی می‌کند. محتوای نمونه در یک فهرست معمولی " +"نگهداری می‌شود، که از طریق ویژگی :attr:`data` در نمونه‌های :class:`UserList`" +" قابل دسترسی است. محتوای نمونه در ابتدا به یک کپی از *list* تنظیم می‌شود، که" +" به‌طور پیش‌فرض فهرست خالی ``[]`` است. *list* می‌تواند هر پیمایش‌پذیری باشد، " +"برای مثال یک فهرست واقعی پایتون یا یک شیء :class:`UserList`." -msgid "In addition to supporting the methods and operations of mutable sequences, :class:`UserList` instances provide the following attribute:" +msgid "" +"In addition to supporting the methods and operations of mutable sequences, " +":class:`UserList` instances provide the following attribute:" msgstr "" +"علاوه بر پشتیبانی از متدها و عملیات دنباله‌های تغییرپذیر، نمونه‌های " +":class:`UserList` ویژگی زیر را ارائه می‌دهند:" -msgid "A real :class:`list` object used to store the contents of the :class:`UserList` class." +msgid "" +"A real :class:`list` object used to store the contents of the " +":class:`UserList` class." msgstr "" +"یک شیء واقعی :class:`list` که برای ذخیره‌ی محتوای کلاس :class:`UserList` " +"استفاده می‌شود." -msgid "**Subclassing requirements:** Subclasses of :class:`UserList` are expected to offer a constructor which can be called with either no arguments or one argument. List operations which return a new sequence attempt to create an instance of the actual implementation class. To do so, it assumes that the constructor can be called with a single parameter, which is a sequence object used as a data source." -msgstr "" +msgid "" +"**Subclassing requirements:** Subclasses of :class:`UserList` are expected " +"to offer a constructor which can be called with either no arguments or one " +"argument. List operations which return a new sequence attempt to create an " +"instance of the actual implementation class. To do so, it assumes that the " +"constructor can be called with a single parameter, which is a sequence " +"object used as a data source." +msgstr "" +"**الزامات زیرکلاس‌سازی:** انتظار می‌رود زیرکلاس‌های :class:`UserList` " +"سازنده‌ای ارائه دهند که بتوان آن را بدون آرگومان یا با یک آرگومان فراخوانی " +"کرد. عملیات فهرستی که دنباله‌ی جدیدی بازمی‌گردانند، تلاش می‌کنند نمونه‌ای از " +"کلاس پیاده‌سازی واقعی ایجاد کنند. برای این کار، فرض می‌شود که سازنده " +"می‌تواند با یک پارامتر فراخوانی شود، که یک شیء دنباله است و به‌عنوان منبع " +"داده استفاده می‌شود." -msgid "If a derived class does not wish to comply with this requirement, all of the special methods supported by this class will need to be overridden; please consult the sources for information about the methods which need to be provided in that case." +msgid "" +"If a derived class does not wish to comply with this requirement, all of the" +" special methods supported by this class will need to be overridden; please " +"consult the sources for information about the methods which need to be " +"provided in that case." msgstr "" +"اگر یک کلاس مشتق مایل به رعایت این الزام نباشد، لازم است تمام متدهای ویژه‌ای" +" که این کلاس از آن‌ها پشتیبانی می‌کند، بازنویسی شوند؛ لطفاً برای اطلاع از " +"متدهایی که در آن حالت باید فراهم شوند، به منابع مراجعه کنید." msgid ":class:`UserString` objects" -msgstr "" +msgstr "اشیاء :class:`UserString`" -msgid "The class, :class:`UserString` acts as a wrapper around string objects. The need for this class has been partially supplanted by the ability to subclass directly from :class:`str`; however, this class can be easier to work with because the underlying string is accessible as an attribute." +msgid "" +"The class, :class:`UserString` acts as a wrapper around string objects. The " +"need for this class has been partially supplanted by the ability to subclass" +" directly from :class:`str`; however, this class can be easier to work with " +"because the underlying string is accessible as an attribute." msgstr "" +"کلاس :class:`UserString` به‌عنوان پوششی برای اشیای رشته عمل می‌کند. نیاز " +"به این کلاس تا حدی با امکان ایجاد زیرکلاس به‌طور مستقیم از :class:`str` " +"جایگزین شده است؛ با این حال، کار با این کلاس می‌تواند آسان‌تر باشد، زیرا " +"رشته زیرین به‌عنوان یک ویژگی قابل دسترسی است." -msgid "Class that simulates a string object. The instance's content is kept in a regular string object, which is accessible via the :attr:`data` attribute of :class:`UserString` instances. The instance's contents are initially set to a copy of *seq*. The *seq* argument can be any object which can be converted into a string using the built-in :func:`str` function." -msgstr "" +msgid "" +"Class that simulates a string object. The instance's content is kept in a " +"regular string object, which is accessible via the :attr:`data` attribute of" +" :class:`UserString` instances. The instance's contents are initially set " +"to a copy of *seq*. The *seq* argument can be any object which can be " +"converted into a string using the built-in :func:`str` function." +msgstr "" +"کلاسی که یک شیء رشته را شبیه‌سازی می‌کند. محتوای نمونه در یک شیء رشته معمولی" +" نگه داشته می‌شود، که از طریق ویژگی :attr:`data` نمونه‌های " +":class:`UserString` قابل دسترسی است. محتوای نمونه در ابتدا روی یک کپی از " +"*seq* تنظیم می‌شود. آرگومان *seq* می‌تواند هر شیءای باشد که بتوان آن را با " +"استفاده از تابع توکار :func:`str` به رشته تبدیل کرد." -msgid "In addition to supporting the methods and operations of strings, :class:`UserString` instances provide the following attribute:" +msgid "" +"In addition to supporting the methods and operations of strings, " +":class:`UserString` instances provide the following attribute:" msgstr "" +"علاوه بر پشتیبانی از متدها و عملیات رشته‌ها، نمونه‌های :class:`UserString` " +"ویژگی زیر را فراهم می‌کنند:" -msgid "A real :class:`str` object used to store the contents of the :class:`UserString` class." +msgid "" +"A real :class:`str` object used to store the contents of the " +":class:`UserString` class." msgstr "" +"یک شیء واقعی از نوع :class:`str` که برای ذخیره‌ی محتوای کلاس " +":class:`UserString` استفاده می‌شود." -msgid "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, ``isprintable``, and ``maketrans``." +msgid "" +"New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " +"``isprintable``, and ``maketrans``." msgstr "" +"متدهای جدید ``__getnewargs__``، ``__rmod__``، ``casefold``، ``format_map``، " +"``isprintable`` و ``maketrans``." diff --git a/library/colorsys.po b/library/colorsys.po index e57637586..02674b91b 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -24,40 +24,59 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!colorsys` --- Conversions between color systems" -msgstr "" +msgstr ":mod:`!colorsys` --- تبدیل‌ها بین سیستم‌های رنگ" msgid "**Source code:** :source:`Lib/colorsys.py`" -msgstr "" +msgstr ":source:`Lib/colorsys.py`" -msgid "The :mod:`!colorsys` module defines bidirectional conversions of color values between colors expressed in the RGB (Red Green Blue) color space used in computer monitors and three other coordinate systems: YIQ, HLS (Hue Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of these color spaces are floating-point values. In the YIQ space, the Y coordinate is between 0 and 1, but the I and Q coordinates can be positive or negative. In all other spaces, the coordinates are all between 0 and 1." +msgid "" +"The :mod:`!colorsys` module defines bidirectional conversions of color " +"values between colors expressed in the RGB (Red Green Blue) color space used" +" in computer monitors and three other coordinate systems: YIQ, HLS (Hue " +"Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of" +" these color spaces are floating-point values. In the YIQ space, the Y " +"coordinate is between 0 and 1, but the I and Q coordinates can be positive " +"or negative. In all other spaces, the coordinates are all between 0 and 1." msgstr "" +"ماژول :mod:`!colorsys` تبدیل‌های دوطرفه‌ی مقادیر رنگ را بین رنگ‌های بیان‌شده " +"در فضای رنگ RGB (قرمز، سبز، آبی)، که در نمایشگرهای رایانه‌ای استفاده می‌شود،" +" و سه دستگاه مختصات دیگر تعریف می‌کند: YIQ، HLS (رنگ‌مایه، روشنایی، اشباع) و" +" HSV (رنگ‌مایه، اشباع، مقدار). مختصات در تمام این فضاهای رنگ، مقادیر ممیز " +"شناور هستند. در فضای YIQ، مختصات Y بین ۰ و ۱ است، اما مختصات I و Q می‌توانند" +" مثبت یا منفی باشند. در تمام فضاهای دیگر، مختصات همگی بین ۰ و ۱ هستند." -msgid "More information about color spaces can be found at https://poynton.ca/ColorFAQ.html and https://www.cambridgeincolour.com/tutorials/color-spaces.htm." +msgid "" +"More information about color spaces can be found at " +"https://poynton.ca/ColorFAQ.html and " +"https://www.cambridgeincolour.com/tutorials/color-spaces.htm." msgstr "" +"اطلاعات بیشتر درباره فضاهای رنگ را می‌توانید در " +"https://poynton.ca/ColorFAQ.html و " +"https://www.cambridgeincolour.com/tutorials/color-spaces.htm بیابید." msgid "The :mod:`!colorsys` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!colorsys` توابع زیر را تعریف می‌کند:" msgid "Convert the color from RGB coordinates to YIQ coordinates." -msgstr "" +msgstr "رنگ را از مختصات RGB به مختصات YIQ تبدیل می‌کند." msgid "Convert the color from YIQ coordinates to RGB coordinates." -msgstr "" +msgstr "رنگ را از مختصات YIQ به مختصات RGB تبدیل می‌کند." msgid "Convert the color from RGB coordinates to HLS coordinates." -msgstr "" +msgstr "رنگ را از مختصات RGB به مختصات HLS تبدیل می‌کند." msgid "Convert the color from HLS coordinates to RGB coordinates." -msgstr "" +msgstr "رنگ را از مختصات HLS به مختصات RGB تبدیل می‌کند." msgid "Convert the color from RGB coordinates to HSV coordinates." -msgstr "" +msgstr "تبدیل رنگ از مختصات RGB به مختصات HSV." msgid "Convert the color from HSV coordinates to RGB coordinates." -msgstr "" +msgstr "رنگ را از مختصات HSV به مختصات RGB تبدیل می‌کند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import colorsys\n" @@ -66,3 +85,8 @@ msgid "" ">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" "(0.2, 0.4, 0.4)" msgstr "" +">>> import colorsys\n" +">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" +"(0.5, 0.5, 0.4)\n" +">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" +"(0.2, 0.4, 0.4)" diff --git a/library/compileall.po b/library/compileall.po index 9e3e37220..512bda88e 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"PO-Revision-Date: 2026-08-28 10:07+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,186 +22,469 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!compileall` --- Byte-compile Python libraries" -msgstr "" +msgstr ":mod:`!compileall` --- کامپایل بایتی کتابخانه‌های پایتون" msgid "**Source code:** :source:`Lib/compileall.py`" -msgstr "" +msgstr ":source:`Lib/compileall.py`" -msgid "This module provides some utility functions to support installing Python libraries. These functions compile Python source files in a directory tree. This module can be used to create the cached byte-code files at library installation time, which makes them available for use even by users who don't have write permission to the library directories." -msgstr "" +msgid "" +"This module provides some utility functions to support installing Python " +"libraries. These functions compile Python source files in a directory " +"tree. This module can be used to create the cached byte-code files at " +"library installation time, which makes them available for use even by users " +"who don't have write permission to the library directories." +msgstr "" +"این ماژول چند تابع کاربردی برای پشتیبانی از نصب کتابخانه‌های پایتون ارائه " +"می‌کند. این توابع فایل‌های منبع پایتون را در یک ساختار درختی از پوشه‌ها " +"کامپایل می‌کنند. می‌توان از این ماژول برای ایجاد فایل‌های بایت‌کد نهان‌شده در " +"زمان نصب کتابخانه استفاده کرد، که این امر آن‌ها را حتی برای کاربرانی که " +"اجازه‌ی نوشتن در پوشه‌های کتابخانه را ندارند نیز قابل استفاده می‌سازد." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. " +"See :ref:`wasm-availability` for more information." msgstr "" +"این ماژول در WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات " +"بیشتر :ref:`wasm-availability` را ببینید." msgid "Command-line use" -msgstr "" +msgstr "استفاده از خط فرمان" -msgid "This module can work as a script (using :program:`python -m compileall`) to compile Python sources." +msgid "" +"This module can work as a script (using :program:`python -m compileall`) to " +"compile Python sources." msgstr "" +"این ماژول می‌تواند به‌عنوان یک اسکریپت (با استفاده از :program:`python -m " +"compileall`) برای کامپایل فایل‌های منبع پایتون کار کند." -msgid "Positional arguments are files to compile or directories that contain source files, traversed recursively. If no argument is given, behave as if the command line was :samp:`-l {}`." +msgid "" +"Positional arguments are files to compile or directories that contain " +"source files, traversed recursively. If no argument is given, behave as if " +"the command line was :samp:`-l {}`." msgstr "" +"آرگومان‌های جایگاهی، فایل‌هایی برای کامپایل یا پوشه‌هایی هستند که حاوی فایل‌های " +"منبع بوده و به‌صورت بازگشتی پیمایش می‌شوند. اگر آرگومانی داده نشود، به‌گونه‌ای " +"رفتار می‌کند که گویی خط فرمان :samp:`-l {}` بوده " +"است." -msgid "Do not recurse into subdirectories, only compile source code files directly contained in the named or implied directories." +msgid "" +"Do not recurse into subdirectories, only compile source code files directly " +"contained in the named or implied directories." msgstr "" +"به‌صورت بازگشتی وارد زیرپوشه‌ها نشوید، فقط فایل‌های کد منبعی را که مستقیماً در " +"پوشه‌های نام‌برده‌شده یا ضمنی قرار دارند، کامپایل کنید." msgid "Force rebuild even if timestamps are up-to-date." -msgstr "" +msgstr "بازسازی اجباری، حتی اگر برچسب‌های زمانی به‌روز باشند." -msgid "Do not print the list of files compiled. If passed once, error messages will still be printed. If passed twice (``-qq``), all output is suppressed." +msgid "" +"Do not print the list of files compiled. If passed once, error messages " +"will still be printed. If passed twice (``-qq``), all output is suppressed." msgstr "" +"فهرست فایل‌های کامپایل‌شده را چاپ نکنید. اگر یک بار داده شود، پیام‌های خطا " +"همچنان چاپ می‌شوند. اگر دو بار داده شود (``-qq``)، تمام خروجی سرکوب می‌شود." -msgid "Directory prepended to the path to each file being compiled. This will appear in compilation time tracebacks, and is also compiled in to the byte-code file, where it will be used in tracebacks and other messages in cases where the source file does not exist at the time the byte-code file is executed." -msgstr "" +msgid "" +"Directory prepended to the path to each file being compiled. This will " +"appear in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." +msgstr "" +"پوشه‌ای که به ابتدای مسیر هر فایل در حال کامپایل افزوده می‌شود. این پوشه در " +"ردگیری‌های پشته در زمان کامپایل ظاهر می‌شود و همچنین به‌صورت کامپایل‌شده در " +"فایل بایت‌کد نیز گنجانده می‌شود؛ جایی که از آن در ردگیری‌های پشته و سایر " +"پیام‌ها در مواردی استفاده خواهد شد که فایل منبع در زمان اجرای فایل بایت‌کد " +"وجود ندارد." -msgid "Remove the given prefix from paths recorded in the ``.pyc`` files. Paths are made relative to the prefix." +msgid "" +"Remove the given prefix from paths recorded in the ``.pyc`` files. Paths " +"are made relative to the prefix." msgstr "" +"پیشوند داده‌شده را از مسیرهای ثبت‌شده در فایل‌های ``.pyc`` حذف کنید. مسیرها " +"نسبت به پیشوند نسبی می‌شوند." msgid "This option can be used with ``-p`` but not with ``-d``." msgstr "" +"این گزینه با ``-p`` قابل استفاده است، اما با ``-d`` قابل استفاده نیست." -msgid "Prepend the given prefix to paths recorded in the ``.pyc`` files. Use ``-p /`` to make the paths absolute." +msgid "" +"Prepend the given prefix to paths recorded in the ``.pyc`` files. Use ``-p /" +"`` to make the paths absolute." msgstr "" +"پیشوند داده‌شده را به ابتدای مسیرهای ثبت‌شده در فایل‌های ``.pyc`` اضافه کنید. " +"برای مطلق کردن مسیرها، از ``-p /`` استفاده کنید." msgid "This option can be used with ``-s`` but not with ``-d``." -msgstr "" +msgstr "این گزینه را می‌توان با ``-s`` استفاده کرد، اما با ``-d`` نمی‌توان." -msgid "regex is used to search the full path to each file considered for compilation, and if the regex produces a match, the file is skipped." +msgid "" +"regex is used to search the full path to each file considered for " +"compilation, and if the regex produces a match, the file is skipped." msgstr "" +"از عبارت باقاعده (regex) برای جست‌وجوی مسیر کامل هر فایل در نظر گرفته‌شده " +"برای کامپایل استفاده می‌شود، و اگر عبارت باقاعده تطابقی ایجاد کند، از آن " +"فایل صرف‌نظر می‌شود." -msgid "Read the file ``list`` and add each line that it contains to the list of files and directories to compile. If ``list`` is ``-``, read lines from ``stdin``." +msgid "" +"Read the file ``list`` and add each line that it contains to the list of " +"files and directories to compile. If ``list`` is ``-``, read lines from " +"``stdin``." msgstr "" +"فایل ``list`` را بخوانید و هر خط موجود در آن را به فهرست فایل‌ها و پوشه‌ها " +"برای کامپایل اضافه کنید. اگر ``list`` برابر ``-`` باشد، خطوط را از " +"``stdin`` بخوانید." -msgid "Write the byte-code files to their legacy locations and names, which may overwrite byte-code files created by another version of Python. The default is to write files to their :pep:`3147` locations and names, which allows byte-code files from multiple versions of Python to coexist." +msgid "" +"Write the byte-code files to their legacy locations and names, which may " +"overwrite byte-code files created by another version of Python. The " +"default is to write files to their :pep:`3147` locations and names, which " +"allows byte-code files from multiple versions of Python to coexist." msgstr "" +"فایل‌های بایت‌کد را در محل‌ها و نام‌های قدیمی خود بنویسید؛ این کار ممکن است " +"فایل‌های بایت‌کد ایجادشده توسط نسخه دیگری از پایتون را بازنویسی کند. به‌طور " +"پیش‌فرض، فایل‌ها در محل‌ها و نام‌های :pep:`3147` خود نوشته می‌شوند، که امکان " +"هم‌زیستی فایل‌های بایت‌کد از چندین نسخه پایتون را فراهم می‌کند." -msgid "Control the maximum recursion level for subdirectories. If this is given, then ``-l`` option will not be taken into account. :program:`python -m compileall -r 0` is equivalent to :program:`python -m compileall -l`." +msgid "" +"Control the maximum recursion level for subdirectories. If this is given, " +"then ``-l`` option will not be taken into account. :program:`python -m " +"compileall -r 0` is equivalent to :program:`python -m " +"compileall -l`." msgstr "" +"حداکثر سطح بازگشت برای زیرپوشه‌ها را کنترل می‌کند. اگر این گزینه داده شود، " +"گزینه ``-l`` در نظر گرفته نخواهد شد. :program:`python -m compileall " +" -r 0` معادل :program:`python -m compileall -l` است." -msgid "Use *N* workers to compile the files within the given directory. If ``0`` is used, then the result of :func:`os.process_cpu_count` will be used." +msgid "" +"Use *N* workers to compile the files within the given directory. If ``0`` " +"is used, then the result of :func:`os.process_cpu_count` will be used." msgstr "" +"برای کامپایل فایل‌های درون پوشه داده‌شده از *N* کارگر استفاده کنید. اگر از " +"``0`` استفاده شود، از نتیجه‌ی :func:`os.process_cpu_count` استفاده خواهد شد." -msgid "Control how the generated byte-code files are invalidated at runtime. The ``timestamp`` value, means that ``.pyc`` files with the source timestamp and size embedded will be generated. The ``checked-hash`` and ``unchecked-hash`` values cause hash-based pycs to be generated. Hash-based pycs embed a hash of the source file contents rather than a timestamp. See :ref:`pyc-invalidation` for more information on how Python validates bytecode cache files at runtime. The default is ``timestamp`` if the :envvar:`SOURCE_DATE_EPOCH` environment variable is not set, and ``checked-hash`` if the ``SOURCE_DATE_EPOCH`` environment variable is set." -msgstr "" +msgid "" +"Control how the generated byte-code files are invalidated at runtime. The " +"``timestamp`` value, means that ``.pyc`` files with the source timestamp " +"and size embedded will be generated. The ``checked-hash`` and ``unchecked-" +"hash`` values cause hash-based pycs to be generated. Hash-based pycs embed " +"a hash of the source file contents rather than a timestamp. See :ref:`pyc-" +"invalidation` for more information on how Python validates bytecode cache " +"files at runtime. The default is ``timestamp`` if " +"the :envvar:`SOURCE_DATE_EPOCH` environment variable is not set, and " +"``checked-hash`` if the ``SOURCE_DATE_EPOCH`` environment variable is set." +msgstr "" +"نحوه‌ی ابطال فایل‌های بایت‌کد تولیدشده در ران‌تایم را کنترل می‌کند. مقدار " +"``timestamp`` به این معناست که فایل‌های ``.pyc`` با برچسب زمانی و اندازه‌ی " +"فایل منبع به‌صورت جاسازی‌شده تولید می‌شوند. مقادیر ``checked-hash`` و " +"``unchecked-hash`` موجب تولید فایل‌های pyc مبتنی بر هش می‌شوند. فایل‌های pyc " +"مبتنی بر هش، به‌جای برچسب زمانی، یک هش از محتوای فایل منبع را جاسازی می‌کنند. " +"برای اطلاعات بیشتر درباره‌ی نحوه‌ی اعتبارسنجی فایل‌های نهانگاه بایت‌کد توسط " +"پایتون در ران‌تایم، :ref:`pyc-invalidation` را ببینید. مقدار پیش‌فرض در صورتی " +"که متغیر محیطی :envvar:`SOURCE_DATE_EPOCH` تنظیم‌نشده باشد، ``timestamp`` " +"است، و در صورتی که متغیر محیطی ``SOURCE_DATE_EPOCH`` تنظیم‌شده باشد، " +"``checked-hash`` است." -msgid "Compile with the given optimization level. May be used multiple times to compile for multiple levels at a time (for example, ``compileall -o 1 -o 2``)." +msgid "" +"Compile with the given optimization level. May be used multiple times to " +"compile for multiple levels at a time (for example, ``compileall -o 1 -o " +"2``)." msgstr "" +"با سطح بهینه‌سازی داده‌شده کامپایل کنید. می‌توانید چند بار از آن استفاده کنید " +"تا همزمان برای چند سطح کامپایل شود (برای مثال، ``compileall -o 1 -o 2``)." msgid "Ignore symlinks pointing outside the given directory." msgstr "" +"پیوندهای نمادین اشاره‌کننده به بیرون از پوشه‌ی داده‌شده را نادیده " +"بگیرید." -msgid "If two ``.pyc`` files with different optimization level have the same content, use hard links to consolidate duplicate files." +msgid "" +"If two ``.pyc`` files with different optimization level have the same " +"content, use hard links to consolidate duplicate files." msgstr "" +"اگر دو فایل ``.pyc`` با سطوح بهینه‌سازی متفاوت محتوای یکسانی داشته باشند، " +"برای یکپارچه‌سازی فایل‌های تکراری از پیوندهای سخت استفاده کنید." msgid "Added the ``-i``, ``-b`` and ``-h`` options." -msgstr "" +msgstr "گزینه‌های ``-i``، ``-b`` و ``-h`` اضافه شدند." -msgid "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed to a multilevel value. ``-b`` will always produce a byte-code file ending in ``.pyc``, never ``.pyo``." +msgid "" +"Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " +"to a multilevel value. ``-b`` will always produce a byte-code file ending " +"in ``.pyc``, never ``.pyo``." msgstr "" +"گزینه‌های ``-j``، ``-r`` و ``-qq`` افزوده شدند. گزینه‌ی ``-q`` به یک مقدار " +"چندسطحی تغییر یافت. ``-b`` همیشه یک فایل بایت‌کد تولید خواهد کرد که به " +"``.pyc`` ختم می‌شود، هرگز به ``.pyo`` ختم نخواهد شد." msgid "Added the ``--invalidation-mode`` option." -msgstr "" +msgstr "گزینه ``--invalidation-mode`` افزوده شد." -msgid "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. Added the possibility to specify the ``-o`` option multiple times." +msgid "" +"Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " +"the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " +"Added the possibility to specify the ``-o`` option multiple times." msgstr "" +"گزینه‌های ``-s``، ``-p``، ``-e`` و ``--hardlink-dupes`` افزوده شدند. محدودیت " +"بازگشت پیش‌فرض از ۱۰ به :py:func:`sys.getrecursionlimit()` افزایش یافت. " +"امکان تعیین گزینه‌ی ``-o`` چندین بار افزوده شد." -msgid "There is no command-line option to control the optimization level used by the :func:`compile` function, because the Python interpreter itself already provides the option: :program:`python -O -m compileall`." +msgid "" +"There is no command-line option to control the optimization level used by " +"the :func:`compile` function, because the Python interpreter itself already " +"provides the option: :program:`python -O -m compileall`." msgstr "" +"هیچ گزینه‌ای در خط فرمان برای کنترل سطح بهینه‌سازی که تابع :func:`compile` از " +"آن استفاده می‌کند، وجود ندارد، زیرا خود مفسر پایتون از قبل این گزینه را " +"فراهم می‌کند: :program:`python -O -m compileall`." -msgid "Similarly, the :func:`compile` function respects the :data:`sys.pycache_prefix` setting. The generated bytecode cache will only be useful if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) that will be used at runtime." +msgid "" +"Similarly, the :func:`compile` function respects " +"the :data:`sys.pycache_prefix` setting. The generated bytecode cache will " +"only be useful if :func:`compile` is run with the " +"same :data:`sys.pycache_prefix` (if any) that will be used at runtime." msgstr "" +"به‌طور مشابه، تابع :func:`compile` تنظیم :data:`sys.pycache_prefix` را رعایت " +"می‌کند. نهانگاه بایت‌کد تولیدشده تنها در صورتی مفید خواهد بود " +"که :func:`compile` با همان :data:`sys.pycache_prefix` (در صورت وجود) که در " +"ران‌تایم استفاده خواهد شد، اجرا شود." msgid "Public functions" -msgstr "" +msgstr "توابع عمومی" -msgid "Recursively descend the directory tree named by *dir*, compiling all :file:`.py` files along the way. Return a true value if all the files compiled successfully, and a false value otherwise." +msgid "" +"Recursively descend the directory tree named by *dir*, compiling " +"all :file:`.py` files along the way. Return a true value if all the files " +"compiled successfully, and a false value otherwise." msgstr "" +"به‌صورت بازگشتی درخت پوشه‌ای را که با *dir* نام‌گذاری شده است می‌پیماید و در " +"طول مسیر، همه‌ی فایل‌های :file:`.py` را کامپایل می‌کند. اگر همه‌ی فایل‌ها با " +"موفقیت کامپایل شده باشند، یک مقدار درست و در غیر این صورت یک مقدار نادرست " +"برمی‌گرداند." -msgid "The *maxlevels* parameter is used to limit the depth of the recursion; it defaults to ``sys.getrecursionlimit()``." +msgid "" +"The *maxlevels* parameter is used to limit the depth of the recursion; it " +"defaults to ``sys.getrecursionlimit()``." msgstr "" +"پارامتر *maxlevels* برای محدود کردن عمق بازگشت استفاده می‌شود؛ مقدار پیش‌فرض " +"آن ``sys.getrecursionlimit()`` است." -msgid "If *ddir* is given, it is prepended to the path to each file being compiled for use in compilation time tracebacks, and is also compiled in to the byte-code file, where it will be used in tracebacks and other messages in cases where the source file does not exist at the time the byte-code file is executed." -msgstr "" +msgid "" +"If *ddir* is given, it is prepended to the path to each file being compiled " +"for use in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." +msgstr "" +"اگر *ddir* داده شود، این مقدار به ابتدای مسیر هر فایلی که کامپایل می‌شود " +"افزوده می‌شود تا در ردگیری‌های پشته در زمان کامپایل استفاده شود، و همچنین " +"به‌صورت کامپایل‌شده در فایل بایت‌کد نیز قرار می‌گیرد؛ در آنجا این مقدار در " +"ردگیری‌های پشته و سایر پیام‌ها در مواردی به کار خواهد رفت که فایل منبع در " +"زمان اجرای فایل بایت‌کد وجود ندارد." -msgid "If *force* is true, modules are re-compiled even if the timestamps are up to date." +msgid "" +"If *force* is true, modules are re-compiled even if the timestamps are up " +"to date." msgstr "" +"اگر *force* مقدار true داشته باشد، ماژول‌ها دوباره کامپایل می‌شوند، حتی اگر " +"برچسب‌های زمانی به‌روز باشند." -msgid "If *rx* is given, its ``search`` method is called on the complete path to each file considered for compilation, and if it returns a true value, the file is skipped. This can be used to exclude files matching a regular expression, given as a :ref:`re.Pattern ` object." +msgid "" +"If *rx* is given, its ``search`` method is called on the complete path to " +"each file considered for compilation, and if it returns a true value, the " +"file is skipped. This can be used to exclude files matching a regular " +"expression, given as a :ref:`re.Pattern ` object." msgstr "" +"اگر *rx* داده شود، متد ``search`` آن روی مسیر کامل هر فایل در نظر گرفته‌شده " +"برای کامپایل فراخوانی می‌شود، و اگر مقدار درستی برگرداند، آن فایل نادیده " +"گرفته می‌شود. این می‌تواند برای مستثنی کردن فایل‌هایی که با یک عبارت باقاعده " +"مطابقت دارند، به کار رود؛ عبارت باقاعده‌ای که به‌صورت یک شیء :ref:`re.Pattern " +"` داده شده است." -msgid "If *quiet* is ``False`` or ``0`` (the default), the filenames and other information are printed to standard out. Set to ``1``, only errors are printed. Set to ``2``, all output is suppressed." +msgid "" +"If *quiet* is ``False`` or ``0`` (the default), the filenames and other " +"information are printed to standard out. Set to ``1``, only errors are " +"printed. Set to ``2``, all output is suppressed." msgstr "" +"اگر *quiet* برابر ``False`` یا ``0`` (پیش‌فرض) باشد، نام فایل‌ها و سایر " +"اطلاعات به خروجی استاندارد چاپ می‌شوند. اگر روی ``1`` تنظیم شود، فقط خطاها " +"چاپ می‌شوند. اگر روی ``2`` تنظیم شود، تمام خروجی‌ها سرکوب می‌شوند." -msgid "If *legacy* is true, byte-code files are written to their legacy locations and names, which may overwrite byte-code files created by another version of Python. The default is to write files to their :pep:`3147` locations and names, which allows byte-code files from multiple versions of Python to coexist." -msgstr "" +msgid "" +"If *legacy* is true, byte-code files are written to their legacy locations " +"and names, which may overwrite byte-code files created by another version " +"of Python. The default is to write files to their :pep:`3147` locations " +"and names, which allows byte-code files from multiple versions of Python to " +"coexist." +msgstr "" +"اگر *legacy* درست باشد، فایل‌های بایت‌کد در مکان‌ها و با نام‌های قدیمی خود " +"نوشته می‌شوند، که ممکن است باعث رونویسی فایل‌های بایت‌کد ایجادشده توسط نسخه‌ای " +"دیگر از پایتون شود. پیش‌فرض این است که فایل‌ها در مکان‌ها و با " +"نام‌های :pep:`3147` نوشته شوند، که امکان وجود همزمان فایل‌های بایت‌کد چندین " +"نسخه از پایتون را فراهم می‌کند." -msgid "*optimize* specifies the optimization level for the compiler. It is passed to the built-in :func:`compile` function. Accepts also a sequence of optimization levels which lead to multiple compilations of one :file:`.py` file in one call." +msgid "" +"*optimize* specifies the optimization level for the compiler. It is passed " +"to the built-in :func:`compile` function. Accepts also a sequence of " +"optimization levels which lead to multiple compilations of one :file:`.py` " +"file in one call." msgstr "" +"*optimize* سطح بهینه‌سازی برای کامپایلر را مشخص می‌کند. این پارامتر به تابع " +"توکار :func:`compile` ارسال می‌شود. همچنین دنباله‌ای از سطح‌های بهینه‌سازی را " +"می‌پذیرد که به کامپایل‌های متعدد یک فایل :file:`.py` در یک فراخوانی منجر " +"می‌شود." -msgid "The argument *workers* specifies how many workers are used to compile files in parallel. The default is to not use multiple workers. If the platform can't use multiple workers and *workers* argument is given, then sequential compilation will be used as a fallback. If *workers* is 0, the number of cores in the system is used. If *workers* is lower than ``0``, a :exc:`ValueError` will be raised." -msgstr "" +msgid "" +"The argument *workers* specifies how many workers are used to compile files " +"in parallel. The default is to not use multiple workers. If the platform " +"can't use multiple workers and *workers* argument is given, then sequential " +"compilation will be used as a fallback. If *workers* is 0, the number of " +"cores in the system is used. If *workers* is lower than ``0``, " +"a :exc:`ValueError` will be raised." +msgstr "" +"آرگومان *workers* مشخص می‌کند که چند کارگر برای کامپایل موازی فایل‌ها استفاده " +"می‌شوند. پیش‌فرض این است که از چند کارگر استفاده نشود. اگر سکو نتواند از چند " +"کارگر استفاده کند و آرگومان *workers* داده شده باشد، کامپایل متوالی به‌عنوان " +"حالت جایگزین استفاده خواهد شد. اگر *workers* برابر ۰ باشد، تعداد هسته‌های " +"سیستم استفاده می‌شود. اگر *workers* کوچک‌تر از ``0`` باشد، " +"یک :exc:`ValueError` پرتاب خواهد شد." -msgid "*invalidation_mode* should be a member of the :class:`py_compile.PycInvalidationMode` enum and controls how the generated pycs are invalidated at runtime." +msgid "" +"*invalidation_mode* should be a member of " +"the :class:`py_compile.PycInvalidationMode` enum and controls how the " +"generated pycs are invalidated at runtime." msgstr "" +"*invalidation_mode*، که باید یکی از اعضای " +"enum :class:`py_compile.PycInvalidationMode` باشد، نحوه‌ی بی‌اعتبارشدن فایل‌های " +"pyc تولیدشده در ران‌تایم را کنترل می‌کند." -msgid "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the ``-s``, ``-p`` and ``-e`` options described above. They may be specified as ``str`` or :py:class:`os.PathLike`." +msgid "" +"The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to " +"the ``-s``, ``-p`` and ``-e`` options described above. They may be " +"specified as ``str`` or :py:class:`os.PathLike`." msgstr "" +"آرگومان‌های *stripdir*، *prependdir* و *limit_sl_dest* متناظر با گزینه‌های ``-" +"s``، ``-p`` و ``-e`` هستند که در بالا توضیح داده شده‌اند. می‌توان آن‌ها را " +"به‌صورت ``str`` یا :py:class:`os.PathLike` مشخص کرد." -msgid "If *hardlink_dupes* is true and two ``.pyc`` files with different optimization level have the same content, use hard links to consolidate duplicate files." +msgid "" +"If *hardlink_dupes* is true and two ``.pyc`` files with different " +"optimization level have the same content, use hard links to consolidate " +"duplicate files." msgstr "" +"اگر *hardlink_dupes* برابر true باشد و دو فایل ``.pyc`` با سطح بهینه‌سازی " +"متفاوت محتوای یکسانی داشته باشند، برای ادغام فایل‌های تکراری از پیوندهای سخت " +"(hard links) استفاده می‌شود." msgid "Added the *legacy* and *optimize* parameter." -msgstr "" +msgstr "پارامترهای *legacy* و *optimize* افزوده شدند." msgid "Added the *workers* parameter." -msgstr "" +msgstr "پارامتر *workers* افزوده شد." msgid "*quiet* parameter was changed to a multilevel value." -msgstr "" +msgstr "پارامتر *quiet* به یک مقدار چندسطحی تغییر کرده است." -msgid "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no matter what the value of *optimize* is." +msgid "" +"The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files " +"no matter what the value of *optimize* is." msgstr "" +"پارامتر *legacy* فقط فایل‌های ``.pyc`` را می‌نویسد، نه فایل‌های ``.pyo`` را، " +"صرف‌نظر از اینکه مقدار *optimize* چه باشد." msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "یک :term:`path-like object` را می‌پذیرد." msgid "The *invalidation_mode* parameter was added." -msgstr "" +msgstr "پارامتر *invalidation_mode* افزوده شد." -msgid "The *invalidation_mode* parameter's default value is updated to ``None``." +msgid "" +"The *invalidation_mode* parameter's default value is updated to ``None``." msgstr "" +"مقدار پیش‌فرض پارامتر *invalidation_mode* به ``None`` به‌روزرسانی شده است." msgid "Setting *workers* to 0 now chooses the optimal number of cores." -msgstr "" +msgstr "تنظیم *workers* روی ۰ اکنون تعداد بهینه هسته‌ها را انتخاب می‌کند." -msgid "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* arguments. Default value of *maxlevels* was changed from ``10`` to ``sys.getrecursionlimit()``" +msgid "" +"Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " +"arguments. Default value of *maxlevels* was changed from ``10`` to " +"``sys.getrecursionlimit()``" msgstr "" +"آرگومان‌های *stripdir*، *prependdir*، *limit_sl_dest* و *hardlink_dupes* " +"افزوده شدند. مقدار پیش‌فرض *maxlevels* از ``10`` به " +"``sys.getrecursionlimit()`` تغییر کرد." -msgid "Compile the file with path *fullname*. Return a true value if the file compiled successfully, and a false value otherwise." +msgid "" +"Compile the file with path *fullname*. Return a true value if the file " +"compiled successfully, and a false value otherwise." msgstr "" +"فایل را با مسیر *fullname* کامپایل می‌کند. اگر فایل با موفقیت کامپایل شد، " +"مقدار درست و در غیر این صورت مقدار نادرست برمی‌گرداند." -msgid "If *ddir* is given, it is prepended to the path to the file being compiled for use in compilation time tracebacks, and is also compiled in to the byte-code file, where it will be used in tracebacks and other messages in cases where the source file does not exist at the time the byte-code file is executed." +msgid "" +"If *ddir* is given, it is prepended to the path to the file being compiled " +"for use in compilation time tracebacks, and is also compiled in to the byte-" +"code file, where it will be used in tracebacks and other messages in cases " +"where the source file does not exist at the time the byte-code file is " +"executed." msgstr "" +"اگر *ddir* داده شود، به ابتدای مسیر فایلی که در حال کامپایل است افزوده " +"می‌شود تا در ردگیری‌های پشته در زمان کامپایل استفاده شود، و همچنین هنگام " +"کامپایل در فایل بایت‌کد نیز گنجانده می‌شود تا در مواردی که فایل منبع در زمان " +"اجرای فایل بایت‌کد وجود ندارد، در ردگیری‌های پشته و سایر پیام‌ها استفاده شود." -msgid "If *rx* is given, its ``search`` method is passed the full path name to the file being compiled, and if it returns a true value, the file is not compiled and ``True`` is returned. This can be used to exclude files matching a regular expression, given as a :ref:`re.Pattern ` object." -msgstr "" +msgid "" +"If *rx* is given, its ``search`` method is passed the full path name to the " +"file being compiled, and if it returns a true value, the file is not " +"compiled and ``True`` is returned. This can be used to exclude files " +"matching a regular expression, given as a :ref:`re.Pattern ` " +"object." +msgstr "" +"اگر *rx* داده شود، متد ``search`` آن نام کامل مسیر فایلی را که در حال " +"کامپایل شدن است دریافت می‌کند، و اگر یک مقدار درست برگرداند، آن فایل کامپایل " +"نمی‌شود و ``True`` برگردانده می‌شود. می‌توان از این برای مستثنی کردن فایل‌هایی " +"که با یک عبارت باقاعده مطابقت دارند استفاده کرد؛ عبارت باقاعدهی که به‌صورت یک " +"شیء :ref:`re.Pattern ` داده شده است." -msgid "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* arguments." +msgid "" +"Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " +"arguments." msgstr "" +"آرگومان‌های *stripdir*، *prependdir*، *limit_sl_dest* و *hardlink_dupes* " +"افزوده شدند." -msgid "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a true value if all the files compiled successfully, and a false value otherwise." +msgid "" +"Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " +"true value if all the files compiled successfully, and a false value " +"otherwise." msgstr "" +"تمام فایل‌های :file:`.py` یافت‌شده در ``sys.path`` را بایت‌کامپایل می‌کند. اگر " +"همه‌ی فایل‌ها با موفقیت بایت‌کامپایل شده باشند، مقدار درست برمی‌گرداند و در غیر " +"این صورت مقدار نادرست." -msgid "If *skip_curdir* is true (the default), the current directory is not included in the search. All other parameters are passed to the :func:`compile_dir` function. Note that unlike the other compile functions, ``maxlevels`` defaults to ``0``." +msgid "" +"If *skip_curdir* is true (the default), the current directory is not " +"included in the search. All other parameters are passed to " +"the :func:`compile_dir` function. Note that unlike the other compile " +"functions, ``maxlevels`` defaults to ``0``." msgstr "" +"اگر *skip_curdir* درست باشد (پیش‌فرض)، پوشه‌ی جاری در جستجو لحاظ نمی‌شود. همه‌ی " +"پارامترهای دیگر به تابع :func:`compile_dir` ارسال می‌شوند. توجه داشته باشید " +"که برخلاف سایر توابع کامپایل، مقدار پیش‌فرض ``maxlevels`` برابر ``0`` است." -msgid "To force a recompile of all the :file:`.py` files in the :file:`Lib/` subdirectory and all its subdirectories::" +msgid "" +"To force a recompile of all the :file:`.py` files in the :file:`Lib/` " +"subdirectory and all its subdirectories::" msgstr "" +"برای وادار کردن به کامپایل مجدد تمام فایل‌های :file:`.py` در " +"زیرپوشه‌ی :file:`Lib/` و تمام زیرپوشه‌های آن::" msgid "" "import compileall\n" @@ -210,15 +493,28 @@ msgid "" "\n" "# Perform same compilation, excluding files in .svn directories.\n" "import re\n" -"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), " +"force=True)\n" "\n" "# pathlib.Path objects can also be used.\n" "import pathlib\n" "compileall.compile_dir(pathlib.Path('Lib/'), force=True)" msgstr "" +"import compileall\n" +"\n" +"compileall.compile_dir('Lib/', force=True)\n" +"\n" +"# همان کامپایل را انجام می‌دهد، به‌استثنای فایل‌های موجود در پوشه‌های .svn.\n" +"import re\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), " +"force=True)\n" +"\n" +"# همچنین می‌توان از اشیاء pathlib.Path استفاده کرد.\n" +"import pathlib\n" +"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" msgid "Module :mod:`py_compile`" -msgstr "" +msgstr "ماژول :mod:`py_compile`" msgid "Byte-compile a single source file." -msgstr "" +msgstr "یک فایل منبع را به بایت‌کد کامپایل کنید." diff --git a/library/compression.po b/library/compression.po index a164bf4ab..6f3b946d8 100644 --- a/library/compression.po +++ b/library/compression.po @@ -20,22 +20,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "The :mod:`!compression` package" -msgstr "" +msgstr "بسته‌ی :mod:`!compression`" -msgid "The :mod:`!compression` package contains the canonical compression modules containing interfaces to several different compression algorithms. Some of these modules have historically been available as separate modules; those will continue to be available under their original names for compatibility reasons, and will not be removed without a deprecation cycle. The use of modules in :mod:`!compression` is encouraged where practical." -msgstr "" +msgid "" +"The :mod:`!compression` package contains the canonical compression modules " +"containing interfaces to several different compression algorithms. Some of " +"these modules have historically been available as separate modules; those " +"will continue to be available under their original names for compatibility " +"reasons, and will not be removed without a deprecation cycle. The use of " +"modules in :mod:`!compression` is encouraged where practical." +msgstr "" +"بسته‌ی :mod:`!compression` شامل ماژول‌های فشرده‌سازی کانونیکال است که رابط‌هایی " +"برای چندین الگوریتم فشرده‌سازی مختلف دارند. برخی از این ماژول‌ها از نظر " +"تاریخی به‌صورت ماژول‌های جداگانه در دسترس بوده‌اند؛ آن‌ها به دلایل سازگاری " +"همچنان با نام‌های اصلی خود در دسترس خواهند بود و بدون یک چرخه‌ی از رده خارج " +"شدن حذف نخواهند شد. استفاده از ماژول‌های موجود در :mod:`!compression` در " +"صورت امکان توصیه می‌شود." msgid ":mod:`!compression.bz2` -- Re-exports :mod:`bz2`" -msgstr "" +msgstr ":mod:`!compression.bz2` -- بازصادرات :mod:`bz2`" msgid ":mod:`!compression.gzip` -- Re-exports :mod:`gzip`" -msgstr "" +msgstr ":mod:`!compression.gzip` -- :mod:`gzip` را بازصادرات می‌کند" msgid ":mod:`!compression.lzma` -- Re-exports :mod:`lzma`" -msgstr "" +msgstr ":mod:`!compression.lzma` -- :mod:`lzma` را بازصادرات می‌کند" msgid ":mod:`!compression.zlib` -- Re-exports :mod:`zlib`" -msgstr "" +msgstr ":mod:`!compression.zlib` -- :mod:`zlib` را بازصادرات می‌کند" -msgid ":mod:`compression.zstd` -- Wrapper for the Zstandard compression library" -msgstr "" +msgid "" +":mod:`compression.zstd` -- Wrapper for the Zstandard compression library" +msgstr ":mod:`compression.zstd` -- پوششی برای کتابخانه‌ی فشرده‌سازی Zstandard" diff --git a/library/compression.zstd.po b/library/compression.zstd.po index b02cc36df..e6fc85e5f 100644 --- a/library/compression.zstd.po +++ b/library/compression.zstd.po @@ -11,460 +11,1201 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-07-25 12:59+0330\n" +"PO-Revision-Date: 2026-08-28 11:21+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: none\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" -msgid ":mod:`!compression.zstd` --- Compression compatible with the Zstandard format" -msgstr "" +msgid "" +":mod:`!compression.zstd` --- Compression compatible with the Zstandard " +"format" +msgstr ":mod:`!compression.zstd` --- فشرده‌سازی سازگار با قالب Zstandard" msgid "**Source code:** :source:`Lib/compression/zstd/__init__.py`" -msgstr "" +msgstr ":source:`Lib/compression/zstd/__init__.py`" -msgid "This module provides classes and functions for compressing and decompressing data using the Zstandard (or *zstd*) compression algorithm. The `zstd manual `__ describes Zstandard as \"a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios.\" Also included is a file interface that supports reading and writing the contents of ``.zst`` files created by the :program:`zstd` utility, as well as raw zstd compressed streams." -msgstr "" +msgid "" +"This module provides classes and functions for compressing and " +"decompressing data using the Zstandard (or *zstd*) compression algorithm. " +"The `zstd manual `__ describes Zstandard as \"a fast lossless " +"compression algorithm, targeting real-time compression scenarios at zlib-" +"level and better compression ratios.\" Also included is a file interface " +"that supports reading and writing the contents of ``.zst`` files created by " +"the :program:`zstd` utility, as well as raw zstd compressed streams." +msgstr "" +"این ماژول کلاس‌ها و توابعی را برای فشرده‌سازی و از حالت فشرده خارج کردن " +"داده‌ها با استفاده از الگوریتم فشرده‌سازی Zstandard (یا *zstd*) ارائه می‌دهد. " +"`راهنمای zstd `__، Zstandard را این‌گونه توصیف می‌کند: «الگوریتم " +"فشرده‌سازی سریع و بدون اتلاف که سناریوهای فشرده‌سازی بلادرنگ را با نسبت‌های " +"فشرده‌سازی در سطح zlib و بهتر هدف قرار می‌دهد.» همچنین یک رابط پرونده نیز " +"گنجانده شده است که از خواندن و نوشتن محتوای پرونده‌های ``.zst`` ایجادشده " +"توسط ابزار :program:`zstd` و نیز جریان‌های فشرده خام zstd پشتیبانی می‌کند." msgid "The :mod:`!compression.zstd` module contains:" -msgstr "" +msgstr "ماژول :mod:`!compression.zstd` شامل موارد زیر است:" -msgid "The :func:`.open` function and :class:`ZstdFile` class for reading and writing compressed files." +msgid "" +"The :func:`.open` function and :class:`ZstdFile` class for reading and " +"writing compressed files." msgstr "" +"تابع :func:`.open` و کلاس :class:`ZstdFile` برای خواندن و نوشتن فایل‌های " +"فشرده." -msgid "The :class:`ZstdCompressor` and :class:`ZstdDecompressor` classes for incremental (de)compression." +msgid "" +"The :class:`ZstdCompressor` and :class:`ZstdDecompressor` classes for " +"incremental (de)compression." msgstr "" +"کلاس‌های :class:`ZstdCompressor` و :class:`ZstdDecompressor` برای فشرده‌سازی/" +"فشرده‌گشایی تدریجی." -msgid "The :func:`compress` and :func:`decompress` functions for one-shot (de)compression." +msgid "" +"The :func:`compress` and :func:`decompress` functions for one-shot " +"(de)compression." msgstr "" +"تابع‌های :func:`compress` و :func:`decompress` برای فشرده‌سازی/فشرده‌گشایی " +"یک‌باره." -msgid "The :func:`train_dict` and :func:`finalize_dict` functions and the :class:`ZstdDict` class to train and manage Zstandard dictionaries." +msgid "" +"The :func:`train_dict` and :func:`finalize_dict` functions and " +"the :class:`ZstdDict` class to train and manage Zstandard dictionaries." msgstr "" +"توابع :func:`train_dict` و :func:`finalize_dict` و کلاس :class:`ZstdDict` " +"برای آموزش و مدیریت دیکشنری‌های Zstandard." -msgid "The :class:`CompressionParameter`, :class:`DecompressionParameter`, and :class:`Strategy` classes for setting advanced (de)compression parameters." +msgid "" +"The :class:`CompressionParameter`, :class:`DecompressionParameter`, " +"and :class:`Strategy` classes for setting advanced (de)compression " +"parameters." msgstr "" +"کلاس‌های :class:`CompressionParameter`، :class:`DecompressionParameter` " +"و :class:`Strategy` برای تنظیم پارامترهای پیشرفته‌ی فشرده‌سازی و فشرده‌گشایی." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر در نسخه‌ی CPython " +"شما وجود ندارد، به مستندات توزیع‌کننده‌ی خود مراجعه کنید (یعنی هر کسی که " +"پایتون را در اختیار شما قرار داده است). اگر شما توزیع‌کننده " +"هستید، :ref:`optional-module-requirements` را ببینید." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "This exception is raised when an error occurs during compression or decompression, or while initializing the (de)compressor state." +msgid "" +"This exception is raised when an error occurs during compression or " +"decompression, or while initializing the (de)compressor state." msgstr "" +"این استثنا زمانی پرتاب می‌شود که خطایی در حین فشرده‌سازی یا رفع فشردگی، یا " +"هنگام مقداردهی اولیه‌ی وضعیت فشرده‌ساز/بازکننده رخ دهد." msgid "Reading and writing compressed files" -msgstr "" +msgstr "خواندن و نوشتن فایل‌های فشرده" -msgid "Open a Zstandard-compressed file in binary or text mode, returning a :term:`file object`." +msgid "" +"Open a Zstandard-compressed file in binary or text mode, returning " +"a :term:`file object`." msgstr "" +"یک فایل فشرده‌شده با Zstandard را در حالت دودویی یا متنی باز می‌کند و " +"یک :term:`شیء فایل ` بازمی‌گرداند." -msgid "The *file* argument can be either a file name (given as a :class:`str`, :class:`bytes` or :term:`path-like ` object), in which case the named file is opened, or it can be an existing file object to read from or write to." +msgid "" +"The *file* argument can be either a file name (given as " +"a :class:`str`, :class:`bytes` or :term:`path-like ` " +"object), in which case the named file is opened, or it can be an existing " +"file object to read from or write to." msgstr "" +"آرگومان *file* می‌تواند یک نام فایل (داده‌شده به‌صورت یک " +"شیء :class:`str`، :class:`bytes` یا :term:`path-like `) " +"باشد، که در این صورت فایل نام‌برده باز می‌شود، یا می‌تواند یک شیء فایل موجود " +"برای خواندن از آن یا نوشتن در آن باشد." -msgid "The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` for overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive creation. These can equivalently be given as ``'r'``, ``'w'``, ``'a'``, and ``'x'`` respectively. You may also open in text mode with ``'rt'``, ``'wt'``, ``'at'``, and ``'xt'`` respectively." -msgstr "" +msgid "" +"The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` " +"for overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive " +"creation. These can equivalently be given as ``'r'``, ``'w'``, ``'a'``, and " +"``'x'`` respectively. You may also open in text mode with ``'rt'``, " +"``'wt'``, ``'at'``, and ``'xt'`` respectively." +msgstr "" +"آرگومان حالت می‌تواند ``'rb'`` برای خواندن (پیش‌فرض)، ``'wb'`` برای بازنویسی، " +"``'ab'`` برای الحاق، یا ``'xb'`` برای ایجاد انحصاری باشد. این موارد را " +"می‌توان به‌ترتیب و به‌طور معادل به‌صورت ``'r'``، ``'w'``، ``'a'`` و ``'x'`` نیز " +"مشخص کرد. همچنین می‌توانید برای باز کردن در حالت متنی، به‌ترتیب از ``'rt'``، " +"``'wt'``، ``'at'`` و ``'xt'`` استفاده کنید." -msgid "When reading, the *options* argument can be a dictionary providing advanced decompression parameters; see :class:`DecompressionParameter` for detailed information about supported parameters. The *zstd_dict* argument is a :class:`ZstdDict` instance to be used during decompression. When reading, if the *level* argument is not None, a :exc:`!TypeError` will be raised." -msgstr "" +msgid "" +"When reading, the *options* argument can be a dictionary providing advanced " +"decompression parameters; see :class:`DecompressionParameter` for detailed " +"information about supported parameters. The *zstd_dict* argument is " +"a :class:`ZstdDict` instance to be used during decompression. When reading, " +"if the *level* argument is not None, a :exc:`!TypeError` will be raised." +msgstr "" +"هنگام خواندن، آرگومان *options* می‌تواند یک دیکشنری باشد که پارامترهای " +"پیشرفته‌ی فشرده‌گشایی را فراهم می‌کند؛ برای اطلاعات دقیق درباره‌ی پارامترهای " +"پشتیبانی‌شده، :class:`DecompressionParameter` را ببینید. آرگومان *zstd_dict* " +"یک نمونه از :class:`ZstdDict` است که در حین فشرده‌گشایی استفاده می‌شود. هنگام " +"خواندن، اگر آرگومان *level* برابر None نباشد، یک :exc:`!TypeError` پرتاب " +"خواهد شد." -msgid "When writing, the *options* argument can be a dictionary providing advanced compression parameters; see :class:`CompressionParameter` for detailed information about supported parameters. The *level* argument is the compression level to use when writing compressed data. Only one of *level* or *options* may be non-None. The *zstd_dict* argument is a :class:`ZstdDict` instance to be used during compression." -msgstr "" +msgid "" +"When writing, the *options* argument can be a dictionary providing advanced " +"compression parameters; see :class:`CompressionParameter` for detailed " +"information about supported parameters. The *level* argument is the " +"compression level to use when writing compressed data. Only one of *level* " +"or *options* may be non-None. The *zstd_dict* argument is " +"a :class:`ZstdDict` instance to be used during compression." +msgstr "" +"هنگام نوشتن، آرگومان *options* می‌تواند دیکشنری باشد که پارامترهای فشرده‌سازی " +"پیشرفته را ارائه می‌کند؛ برای اطلاعات دقیق درباره پارامترهای " +"پشتیبانی‌شده، :class:`CompressionParameter` را ببینید. آرگومان *level* سطح " +"فشرده‌سازی برای استفاده هنگام نوشتن داده‌های فشرده است. فقط یکی از *level* یا " +"*options* می‌تواند غیر None باشد. آرگومان *zstd_dict* یک " +"نمونه :class:`ZstdDict` است که در طول فشرده‌سازی استفاده می‌شود." -msgid "In binary mode, this function is equivalent to the :class:`ZstdFile` constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, *errors*, and *newline* parameters must not be provided." +msgid "" +"In binary mode, this function is equivalent to the :class:`ZstdFile` " +"constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, " +"*errors*, and *newline* parameters must not be provided." msgstr "" +"در حالت دودویی، این تابع معادل سازنده‌ی :class:`ZstdFile` است: " +"``ZstdFile(file, mode, ...)``. در این حالت، نباید پارامترهای *encoding*، " +"*errors* و *newline* ارائه شوند." -msgid "In text mode, a :class:`ZstdFile` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line endings." +msgid "" +"In text mode, a :class:`ZstdFile` object is created, and wrapped in " +"an :class:`io.TextIOWrapper` instance with the specified encoding, error " +"handling behavior, and line endings." msgstr "" +"در حالت متنی، یک شیء :class:`ZstdFile` ایجاد می‌شود و یک " +"نمونه :class:`io.TextIOWrapper` با کدگذاری، رفتار مدیریت خطا و پایان‌های خط " +"مشخص‌شده، آن را در بر می‌گیرد." msgid "Open a Zstandard-compressed file in binary mode." -msgstr "" +msgstr "باز کردن یک فایل فشرده‌شده با Zstandard در حالت دودویی." -msgid "A :class:`ZstdFile` can wrap an already-open :term:`file object`, or operate directly on a named file. The *file* argument specifies either the file object to wrap, or the name of the file to open (as a :class:`str`, :class:`bytes` or :term:`path-like ` object). If wrapping an existing file object, the wrapped file will not be closed when the :class:`ZstdFile` is closed." -msgstr "" +msgid "" +"A :class:`ZstdFile` can wrap an already-open :term:`file object`, or " +"operate directly on a named file. The *file* argument specifies either the " +"file object to wrap, or the name of the file to open (as " +"a :class:`str`, :class:`bytes` or :term:`path-like ` " +"object). If wrapping an existing file object, the wrapped file will not be " +"closed when the :class:`ZstdFile` is closed." +msgstr "" +"یک :class:`ZstdFile` می‌تواند یک :term:`file object` از پیش باز را دربرگیرد، " +"یا به‌طور مستقیم روی یک فایل نام‌دار عمل کند. آرگومان *file* یا شیء فایل برای " +"دربرگرفتن، یا نام فایل برای باز کردن را مشخص می‌کند (به‌صورت " +"یک :class:`str`، :class:`bytes` یا شیء :term:`path-like `). در صورت دربرگرفتن یک شیء فایل موجود، فایل دربرگرفته‌شده هنگام " +"بستن :class:`ZstdFile` بسته نمی‌شود." -msgid "The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for appending. These can equivalently be given as ``'r'``, ``'w'``, ``'x'`` and ``'a'`` respectively." +msgid "" +"The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` " +"for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for " +"appending. These can equivalently be given as ``'r'``, ``'w'``, ``'x'`` and " +"``'a'`` respectively." msgstr "" +"آرگومان *mode* می‌تواند یکی از ``'rb'`` برای خواندن (پیش‌فرض)، ``'wb'`` برای " +"بازنویسی، ``'xb'`` برای ایجاد انحصاری، یا ``'ab'`` برای الحاق باشد. این " +"موارد می‌توانند به‌طور معادل به‌ترتیب به‌صورت ``'r'``، ``'w'``، ``'x'`` و " +"``'a'`` نیز داده شوند." -msgid "If *file* is a file object (rather than an actual file name), a mode of ``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." +msgid "" +"If *file* is a file object (rather than an actual file name), a mode of " +"``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." msgstr "" +"اگر *file* یک شیء فایل باشد (نه یک نام فایل واقعی)، حالت ``'w'`` فایل را " +"کوتاه نمی‌کند، بلکه معادل ``'a'`` است." -msgid "When writing, the *options* argument can be a dictionary providing advanced compression parameters; see :class:`CompressionParameter` for detailed information about supported parameters. The *level* argument is the compression level to use when writing compressed data. Only one of *level* or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` instance to be used during compression." -msgstr "" +msgid "" +"When writing, the *options* argument can be a dictionary providing advanced " +"compression parameters; see :class:`CompressionParameter` for detailed " +"information about supported parameters. The *level* argument is the " +"compression level to use when writing compressed data. Only one of *level* " +"or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` " +"instance to be used during compression." +msgstr "" +"هنگام نوشتن، آرگومان *options* می‌تواند یک دیکشنری باشد که پارامترهای " +"پیشرفته فشرده‌سازی را ارائه می‌دهد؛ برای اطلاعات دقیق درباره پارامترهای " +"پشتیبانی‌شده، :class:`CompressionParameter` را ببینید. آرگومان *level* سطح " +"فشرده‌سازی مورد استفاده هنگام نوشتن داده‌های فشرده است. فقط یکی از *level* یا " +"*options* را می‌توان ارسال کرد. آرگومان *zstd_dict* یک نمونه " +"از :class:`ZstdDict` است که در حین فشرده‌سازی استفاده می‌شود." -msgid ":class:`!ZstdFile` supports all the members specified by :class:`io.BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io.IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." +msgid "" +":class:`!ZstdFile` supports all the members specified " +"by :class:`io.BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` " +"and :meth:`~io.IOBase.truncate`. Iteration and the :keyword:`with` " +"statement are supported." msgstr "" +":class:`!ZstdFile` از همه‌ی اعضای مشخص‌شده توسط :class:`io.BufferedIOBase` " +"پشتیبانی می‌کند، به‌جز :meth:`~io.BufferedIOBase.detach` " +"و :meth:`~io.IOBase.truncate`. از تکرار و دستور :keyword:`with` پشتیبانی " +"می‌شود." msgid "The following method and attributes are also provided:" -msgstr "" +msgstr "متد و ویژگی‌های زیر نیز ارائه شده‌اند:" -msgid "Return buffered data without advancing the file position. At least one byte of data will be returned, unless EOF has been reached. The exact number of bytes returned is unspecified (the *size* argument is ignored)." +msgid "" +"Return buffered data without advancing the file position. At least one byte " +"of data will be returned, unless EOF has been reached. The exact number of " +"bytes returned is unspecified (the *size* argument is ignored)." msgstr "" +"داده‌ی بافرشده را بدون پیش‌بردن موقعیت فایل برمی‌گرداند. حداقل ۱ بایت داده " +"برگردانده خواهد شد، مگر اینکه به EOF رسیده باشیم. تعداد دقیق بایت‌های " +"برگردانده‌شده نامشخص است (آرگومان *size* نادیده گرفته می‌شود)." -msgid "While calling :meth:`peek` does not change the file position of the :class:`ZstdFile`, it may change the position of the underlying file object (for example, if the :class:`ZstdFile` was constructed by passing a file object for *file*)." +msgid "" +"While calling :meth:`peek` does not change the file position of " +"the :class:`ZstdFile`, it may change the position of the underlying file " +"object (for example, if the :class:`ZstdFile` was constructed by passing a " +"file object for *file*)." msgstr "" +"اگرچه فراخوانی :meth:`peek` موقعیت فایل در :class:`ZstdFile` را تغییر " +"نمی‌دهد، اما ممکن است موقعیت شیء فایل زیربنایی را تغییر دهد (برای مثال، " +"اگر :class:`ZstdFile` با ارسال یک شیء فایل برای *file* ساخته شده باشد)." msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "" +msgstr "``'rb'`` برای خواندن و ``'wb'`` برای نوشتن." -msgid "The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` attribute of the underlying :term:`file object`." +msgid "" +"The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` " +"attribute of the underlying :term:`file object`." msgstr "" +"نام فایل Zstandard. معادل ویژگی :attr:`~io.FileIO.name` در :term:`file " +"object` زیرین است." msgid "Compressing and decompressing data in memory" -msgstr "" +msgstr "فشرده‌سازی و از حالت فشرده خارج کردن داده‌ها در حافظه" -msgid "Compress *data* (a :term:`bytes-like object`), returning the compressed data as a :class:`bytes` object." +msgid "" +"Compress *data* (a :term:`bytes-like object`), returning the compressed " +"data as a :class:`bytes` object." msgstr "" +"*data* (یک :term:`bytes-like object`) را فشرده می‌کند و داده فشرده‌شده را " +"به‌صورت یک شیء :class:`bytes` برمی‌گرداند." -msgid "The *level* argument is an integer controlling the level of compression. *level* is an alternative to setting :attr:`CompressionParameter.compression_level` in *options*. Use :meth:`~CompressionParameter.bounds` on :attr:`~CompressionParameter.compression_level` to get the values that can be passed for *level*. If advanced compression options are needed, the *level* argument must be omitted and in the *options* dictionary the :attr:`!CompressionParameter.compression_level` parameter should be set." -msgstr "" +msgid "" +"The *level* argument is an integer controlling the level of compression. " +"*level* is an alternative to " +"setting :attr:`CompressionParameter.compression_level` in *options*. " +"Use :meth:`~CompressionParameter.bounds` " +"on :attr:`~CompressionParameter.compression_level` to get the values that " +"can be passed for *level*. If advanced compression options are needed, the " +"*level* argument must be omitted and in the *options* dictionary " +"the :attr:`!CompressionParameter.compression_level` parameter should be set." +msgstr "" +"آرگومان *level* یک عدد صحیح است که سطح فشرده‌سازی را کنترل می‌کند. *level* " +"جایگزینی برای تنظیم :attr:`CompressionParameter.compression_level` در " +"*options* است. برای دریافت مقادیری که می‌توان برای *level* ارسال کرد، " +"از :meth:`~CompressionParameter.bounds` " +"روی :attr:`~CompressionParameter.compression_level` استفاده کنید. اگر به " +"گزینه‌های پیشرفته‌ی فشرده‌سازی نیاز باشد، آرگومان *level* باید حذف شود و در " +"دیکشنری *options* پارامتر :attr:`!CompressionParameter.compression_level` " +"باید تنظیم شود." -msgid "The *options* argument is a Python dictionary containing advanced compression parameters. The valid keys and values for compression parameters are documented as part of the :class:`CompressionParameter` documentation." +msgid "" +"The *options* argument is a Python dictionary containing advanced " +"compression parameters. The valid keys and values for compression " +"parameters are documented as part of the :class:`CompressionParameter` " +"documentation." msgstr "" +"آرگومان *options* یک دیکشنری پایتون است که حاوی پارامترهای پیشرفته " +"فشرده‌سازی است. کلیدها و مقدارهای معتبر برای پارامترهای فشرده‌سازی، به‌عنوان " +"بخشی از مستندات :class:`CompressionParameter` مستند شده‌اند." -msgid "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing trained data to improve compression efficiency. The function :func:`train_dict` can be used to generate a Zstandard dictionary." +msgid "" +"The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " +"trained data to improve compression efficiency. The " +"function :func:`train_dict` can be used to generate a Zstandard dictionary." msgstr "" +"آرگومان *zstd_dict* یک نمونه از :class:`ZstdDict` است که حاوی داده‌های " +"آموزش‌دیده برای بهبود کارایی فشرده‌سازی است. می‌توان از " +"تابع :func:`train_dict` برای تولید یک دیکشنری Zstandard استفاده کرد." -msgid "Decompress *data* (a :term:`bytes-like object`), returning the uncompressed data as a :class:`bytes` object." +msgid "" +"Decompress *data* (a :term:`bytes-like object`), returning the uncompressed " +"data as a :class:`bytes` object." msgstr "" +"*data* (یک :term:`bytes-like object`) را از حالت فشرده خارج می‌کند و داده‌ی " +"فشرده‌نشده را به‌صورت یک شیء :class:`bytes` برمی‌گرداند." -msgid "The *options* argument is a Python dictionary containing advanced decompression parameters. The valid keys and values for compression parameters are documented as part of the :class:`DecompressionParameter` documentation." +msgid "" +"The *options* argument is a Python dictionary containing advanced " +"decompression parameters. The valid keys and values for compression " +"parameters are documented as part of the :class:`DecompressionParameter` " +"documentation." msgstr "" +"آرگومان *options* یک دیکشنری پایتون شامل پارامترهای پیشرفته‌ی ازفشرده‌سازی " +"است. کلیدها و مقدارهای معتبر برای پارامترهای فشرده‌سازی به‌عنوان بخشی از " +"مستندات :class:`DecompressionParameter` مستند شده‌اند." -msgid "The *zstd_dict* argument is an instance of :class:`ZstdDict` containing trained data used during compression. This must be the same Zstandard dictionary used during compression." +msgid "" +"The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " +"trained data used during compression. This must be the same Zstandard " +"dictionary used during compression." msgstr "" +"آرگومان *zstd_dict* نمونه‌ای از :class:`ZstdDict` است که حاوی داده‌های " +"آموزش‌دیده‌ی مورد استفاده در حین فشرده‌سازی است. این باید همان دیکشنری " +"Zstandard مورد استفاده در حین فشرده‌سازی باشد." -msgid "If *data* is the concatenation of multiple distinct compressed frames, decompress all of these frames, and return the concatenation of the results." +msgid "" +"If *data* is the concatenation of multiple distinct compressed frames, " +"decompress all of these frames, and return the concatenation of the results." msgstr "" +"اگر *data* حاصل الحاق چندین فریم فشرده‌ی متمایز باشد، همه‌ی این فریم‌ها را از " +"حالت فشرده خارج کنید و حاصل الحاق نتایج را برگردانید." -msgid "Create a compressor object, which can be used to compress data incrementally." +msgid "" +"Create a compressor object, which can be used to compress data " +"incrementally." msgstr "" +"یک شیء فشرده‌ساز ایجاد کنید که می‌توان از آن برای فشرده‌سازی تدریجی داده‌ها " +"استفاده کرد." -msgid "For a more convenient way of compressing a single chunk of data, see the module-level function :func:`compress`." +msgid "" +"For a more convenient way of compressing a single chunk of data, see the " +"module-level function :func:`compress`." msgstr "" +"برای فشرده‌سازی یک تکه‌ی داده (chunk) به‌شکلی آسان‌تر، تابع سطح " +"ماژول :func:`compress` را ببینید." -msgid "The *zstd_dict* argument is an optional instance of :class:`ZstdDict` containing trained data to improve compression efficiency. The function :func:`train_dict` can be used to generate a Zstandard dictionary." +msgid "" +"The *zstd_dict* argument is an optional instance of :class:`ZstdDict` " +"containing trained data to improve compression efficiency. The " +"function :func:`train_dict` can be used to generate a Zstandard dictionary." msgstr "" +"آرگومان *zstd_dict* یک نمونه اختیاری از :class:`ZstdDict` است که حاوی " +"داده‌های آموزش‌دیده برای بهبود بهره‌وری فشرده‌سازی است. برای تولید یک دیکشنری " +"Zstandard می‌توانید از تابع :func:`train_dict` استفاده کنید." -msgid "Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` object with compressed data if possible, or otherwise an empty :class:`!bytes` object. Some of *data* may be buffered internally, for use in later calls to :meth:`!compress` and :meth:`~.flush`. The returned data should be concatenated with the output of any previous calls to :meth:`~.compress`." -msgstr "" +msgid "" +"Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` " +"object with compressed data if possible, or otherwise an empty :class:`!" +"bytes` object. Some of *data* may be buffered internally, for use in later " +"calls to :meth:`!compress` and :meth:`~.flush`. The returned data should be " +"concatenated with the output of any previous calls to :meth:`~.compress`." +msgstr "" +"*data* (یک :term:`bytes-like object`) را فشرده می‌کند و در صورت امکان، یک " +"شیء :class:`bytes` حاوی داده‌های فشرده، یا در غیر این صورت یک شیء " +"خالی :class:`!bytes` را برمی‌گرداند. ممکن است بخشی از *data* به‌صورت داخلی در " +"بافر نگهداری شود، تا در فراخوانی‌های بعدی :meth:`!compress` " +"و :meth:`~.flush` مورد استفاده قرار گیرد. داده‌های برگردانده‌شده باید با " +"خروجی تمام فراخوانی‌های پیشین :meth:`~.compress` الحاق شوند." -msgid "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." +msgid "" +"The *mode* argument is a :class:`ZstdCompressor` attribute, " +"either :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" +"آرگومان *mode* یک ویژگی از :class:`ZstdCompressor` است که می‌تواند یکی " +"از :attr:`~.CONTINUE`، :attr:`~.FLUSH_BLOCK` یا :attr:`~.FLUSH_FRAME` باشد." -msgid "When all data has been provided to the compressor, call the :meth:`~.flush` method to finish the compression process. If :meth:`~.compress` is called with *mode* set to :attr:`~.FLUSH_FRAME`, :meth:`~.flush` should not be called, as it would write out a new empty frame." +msgid "" +"When all data has been provided to the compressor, call the :meth:`~.flush` " +"method to finish the compression process. If :meth:`~.compress` is called " +"with *mode* set to :attr:`~.FLUSH_FRAME`, :meth:`~.flush` should not be " +"called, as it would write out a new empty frame." msgstr "" +"هنگامی که همه‌ی داده‌ها به فشرده‌ساز ارائه شد، برای پایان دادن به فرآیند " +"فشرده‌سازی، متد :meth:`~.flush` را فراخوانی کنید. اگر :meth:`~.compress` در " +"حالی فراخوانی شود که *mode* روی :attr:`~.FLUSH_FRAME` تنظیم شده باشد، " +"نباید :meth:`~.flush` فراخوانی شود، زیرا یک فریمخالی جدید می‌نویسد." -msgid "Finish the compression process, returning a :class:`bytes` object containing any data stored in the compressor's internal buffers." +msgid "" +"Finish the compression process, returning a :class:`bytes` object " +"containing any data stored in the compressor's internal buffers." msgstr "" +"فرآیند فشرده‌سازی را به پایان می‌رساند و یک شیء :class:`bytes` را برمی‌گرداند " +"که حاوی هرگونه داده‌ای است که در بافرهای داخلی فشرده‌ساز ذخیره‌شده است." -msgid "The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." +msgid "" +"The *mode* argument is a :class:`ZstdCompressor` attribute, " +"either :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." msgstr "" +"آرگومان *mode* یک ویژگی از :class:`ZstdCompressor` است و " +"می‌تواند :attr:`~.FLUSH_BLOCK` یا :attr:`~.FLUSH_FRAME` باشد." -msgid "Specify the amount of uncompressed data *size* that will be provided for the next frame. *size* will be written into the frame header of the next frame unless :attr:`CompressionParameter.content_size_flag` is ``False`` or ``0``. A size of ``0`` means that the frame is empty. If *size* is ``None``, the frame header will omit the frame size. Frames that include the uncompressed data size require less memory to decompress, especially at higher compression levels." -msgstr "" +msgid "" +"Specify the amount of uncompressed data *size* that will be provided for " +"the next frame. *size* will be written into the frame header of the next " +"frame unless :attr:`CompressionParameter.content_size_flag` is ``False`` or " +"``0``. A size of ``0`` means that the frame is empty. If *size* is " +"``None``, the frame header will omit the frame size. Frames that include " +"the uncompressed data size require less memory to decompress, especially at " +"higher compression levels." +msgstr "" +"اندازه‌ی داده‌ی فشرده‌نشده *size* را که برای فریم بعدی ارائه خواهد شد، مشخص " +"کنید. *size* در سرآیند فریم بعدی نوشته خواهد شد، مگر " +"اینکه :attr:`CompressionParameter.content_size_flag` برابر ``False`` یا " +"``0`` باشد. اندازه‌ی ``0`` به این معناست که فریم خالی است. اگر *size* برابر " +"``None`` باشد، سرآیند فریم شامل اندازه‌ی فریم نخواهد بود. فریم‌هایی که شامل " +"اندازه‌ی داده‌ی فشرده‌نشده هستند، برای خارج کردن از حالت فشرده به حافظه‌ی کمتری " +"نیاز دارند، به‌ویژه در سطوح فشرده‌سازی بالاتر." -msgid "If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is raised as the compressor is not at the start of a frame. If the pledged size does not match the actual size of data provided to :meth:`.compress`, future calls to :meth:`!compress` or :meth:`flush` may raise :exc:`ZstdError` and the last chunk of data may be lost." -msgstr "" +msgid "" +"If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is " +"raised as the compressor is not at the start of a frame. If the pledged " +"size does not match the actual size of data provided to :meth:`.compress`, " +"future calls to :meth:`!compress` or :meth:`flush` may " +"raise :exc:`ZstdError` and the last chunk of data may be lost." +msgstr "" +"اگر :attr:`last_mode` برابر با :attr:`FLUSH_FRAME` نباشد، " +"استثنای :exc:`ValueError` پرتاب می‌شود، زیرا فشرده‌ساز در ابتدای یک فریم " +"نیست. اگر اندازه متعهدشده با اندازه واقعی داده ارائه‌شده " +"به :meth:`.compress` مطابقت نداشته باشد، فراخوانی‌های بعدی :meth:`!compress` " +"یا :meth:`flush` ممکن است استثنای :exc:`ZstdError` را پرتاب کنند و ممکن است " +"آخرین تکه داده از دست برود." -msgid "After :meth:`flush` or :meth:`.compress` are called with mode :attr:`FLUSH_FRAME`, the next frame will not include the frame size into the header unless :meth:`!set_pledged_input_size` is called again." +msgid "" +"After :meth:`flush` or :meth:`.compress` are called with " +"mode :attr:`FLUSH_FRAME`, the next frame will not include the frame size " +"into the header unless :meth:`!set_pledged_input_size` is called again." msgstr "" +"پس از فراخوانی :meth:`flush` یا :meth:`.compress` با " +"حالت :attr:`FLUSH_FRAME`، فریم بعدی شامل اندازه فریم در سرآیند نخواهد بود، " +"مگر اینکه :meth:`!set_pledged_input_size` دوباره فراخوانی شود." -msgid "Collect more data for compression, which may or may not generate output immediately. This mode optimizes the compression ratio by maximizing the amount of data per block and frame." +msgid "" +"Collect more data for compression, which may or may not generate output " +"immediately. This mode optimizes the compression ratio by maximizing the " +"amount of data per block and frame." msgstr "" +"داده‌های بیشتری برای فشرده‌سازی جمع‌آوری می‌کند، که ممکن است خروجی را بلافاصله " +"تولید کند یا نکند. این حالت با بیشینه‌سازی مقدار داده به ازای هر بلوک و " +"فریم، نسبت فشرده‌سازی را بهینه می‌کند." -msgid "Complete and write a block to the data stream. The data returned so far can be immediately decompressed. Past data can still be referenced in future blocks generated by calls to :meth:`~.compress`, improving compression." +msgid "" +"Complete and write a block to the data stream. The data returned so far can " +"be immediately decompressed. Past data can still be referenced in future " +"blocks generated by calls to :meth:`~.compress`, improving compression." msgstr "" +"یک بلوک را کامل کنید و آن را در جریان داده بنویسید. داده‌های برگردانده‌شده " +"تاکنون را می‌توان بلافاصله از حالت فشرده خارج کرد. هنوز می‌توان به داده‌های " +"پیشین در بلوک‌های آینده‌ای که با فراخوانی‌های :meth:`~.compress` تولید می‌شوند، " +"ارجاع داد و فشرده‌سازی را بهبود بخشید." -msgid "Complete and write out a frame. Future data provided to :meth:`~.compress` will be written into a new frame and *cannot* reference past data." +msgid "" +"Complete and write out a frame. Future data provided to :meth:`~.compress` " +"will be written into a new frame and *cannot* reference past data." msgstr "" +"یک فریم را کامل کرده و بنویسید. داده‌های بعدی ارائه‌شده " +"به :meth:`~.compress`، در یک فریم جدید نوشته خواهند شد و *نمی‌توانند* به " +"داده‌های گذشته ارجاع دهند." -msgid "The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, signifying that the compressor is at the start of a new frame." +msgid "" +"The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The " +"value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, " +"or :attr:`~.FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, " +"signifying that the compressor is at the start of a new frame." msgstr "" +"آخرین حالت ارسال‌شده به :meth:`~.compress` یا :meth:`~.flush`. این مقدار " +"می‌تواند یکی از :attr:`~.CONTINUE`، :attr:`~.FLUSH_BLOCK` " +"یا :attr:`~.FLUSH_FRAME` باشد. مقدار اولیه :attr:`~.FLUSH_FRAME` است که " +"نشان می‌دهد فشرده‌ساز در آغاز یک فریم جدید قرار دارد." -msgid "Create a decompressor object, which can be used to decompress data incrementally." +msgid "" +"Create a decompressor object, which can be used to decompress data " +"incrementally." msgstr "" +"یک شیء فشرده‌گشا (decompressor) ایجاد کنید، که می‌توان از آن برای فشرده‌گشایی " +"داده‌ها به‌صورت تدریجی استفاده کرد." -msgid "For a more convenient way of decompressing an entire compressed stream at once, see the module-level function :func:`decompress`." +msgid "" +"For a more convenient way of decompressing an entire compressed stream at " +"once, see the module-level function :func:`decompress`." msgstr "" +"برای روشی راحت‌تر جهت فشرده‌گشایی از کل یک جریان فشرده به‌صورت یکجا، تابع سطح " +"ماژول :func:`decompress` را ببینید." -msgid "This class does not transparently handle inputs containing multiple compressed frames, unlike the :func:`decompress` function and :class:`ZstdFile` class. To decompress a multi-frame input, you should use :func:`decompress`, :class:`ZstdFile` if working with a :term:`file object`, or multiple :class:`!ZstdDecompressor` instances." -msgstr "" +msgid "" +"This class does not transparently handle inputs containing multiple " +"compressed frames, unlike the :func:`decompress` function " +"and :class:`ZstdFile` class. To decompress a multi-frame input, you should " +"use :func:`decompress`, :class:`ZstdFile` if working with a :term:`file " +"object`, or multiple :class:`!ZstdDecompressor` instances." +msgstr "" +"این کلاس، برخلاف تابع :func:`decompress` و کلاس :class:`ZstdFile`، ورودی‌های " +"حاوی چند فریم فشرده را به‌صورت شفاف مدیریت نمی‌کند. برای خارج کردن یک ورودی " +"حاوی چند فریم از حالت فشرده، باید از :func:`decompress`، یا اگر با " +"یک :term:`file object` کار می‌کنید از :class:`ZstdFile`، یا از چند " +"نمونه :class:`!ZstdDecompressor` استفاده کنید." -msgid "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data as bytes. Some of *data* may be buffered internally, for use in later calls to :meth:`!decompress`. The returned data should be concatenated with the output of any previous calls to :meth:`!decompress`." +msgid "" +"Decompress *data* (a :term:`bytes-like object`), returning uncompressed " +"data as bytes. Some of *data* may be buffered internally, for use in later " +"calls to :meth:`!decompress`. The returned data should be concatenated with " +"the output of any previous calls to :meth:`!decompress`." msgstr "" +"*data* (یک :term:`شیء شبه‌بایت `) را فشرده‌گشایی می‌کند و " +"داده‌ی فشرده‌نشده را به‌صورت بایت برمی‌گرداند. ممکن است بخشی از *data* به‌صورت " +"داخلی در حافظه‌ی موقت ذخیره شود تا در فراخوانی‌های بعدی :meth:`!decompress` " +"استفاده شود. داده‌ی برگردانده‌شده باید با خروجی هر یک از فراخوانی‌های " +"قبلی :meth:`!decompress` الحاق شود." -msgid "If *max_length* is non-negative, the method returns at most *max_length* bytes of decompressed data. If this limit is reached and further output can be produced, the :attr:`~.needs_input` attribute will be set to ``False``. In this case, the next call to :meth:`~.decompress` may provide *data* as ``b''`` to obtain more of the output." -msgstr "" +msgid "" +"If *max_length* is non-negative, the method returns at most *max_length* " +"bytes of decompressed data. If this limit is reached and further output can " +"be produced, the :attr:`~.needs_input` attribute will be set to ``False``. " +"In this case, the next call to :meth:`~.decompress` may provide *data* as " +"``b''`` to obtain more of the output." +msgstr "" +"اگر *max_length* نامنفی باشد، این متد حداکثر *max_length* بایت از داده‌ی " +"خارج‌شده از حالت فشرده را برمی‌گرداند. اگر این حد حاصل شود و امکان تولید " +"خروجی بیشتر وجود داشته باشد، ویژگی :attr:`~.needs_input` روی ``False`` " +"تنظیم می‌شود. در این حالت، در فراخوانی بعدی :meth:`~.decompress` می‌توان " +"*data* را به‌صورت ``b''`` ارائه کرد تا بخش بیشتری از خروجی به دست آید." -msgid "If all of the input data was decompressed and returned (either because this was less than *max_length* bytes, or because *max_length* was negative), the :attr:`~.needs_input` attribute will be set to ``True``." +msgid "" +"If all of the input data was decompressed and returned (either because this " +"was less than *max_length* bytes, or because *max_length* was negative), " +"the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" +"اگر تمام داده‌های ورودی فشرده‌گشایی و برگردانده شده باشند (خواه به این دلیل " +"که کمتر از *max_length* بایت بودند، خواه به این دلیل که *max_length* منفی " +"بود)، ویژگی :attr:`~.needs_input` روی ``True`` تنظیم خواهد شد." -msgid "Attempting to decompress data after the end of a frame will raise a :exc:`ZstdError`. Any data found after the end of the frame is ignored and saved in the :attr:`~.unused_data` attribute." +msgid "" +"Attempting to decompress data after the end of a frame will raise " +"a :exc:`ZstdError`. Any data found after the end of the frame is ignored " +"and saved in the :attr:`~.unused_data` attribute." msgstr "" +"تلاش برای خارج کردن داده‌ها از حالت فشرده پس از پایان یک فریم، باعث پرتاب " +"یک :exc:`ZstdError` می‌شود. هر داده‌ای که پس از پایان فریم یافت شود، نادیده " +"گرفته می‌شود و در ویژگی :attr:`~.unused_data` ذخیره می‌شود." msgid "``True`` if the end-of-stream marker has been reached." -msgstr "" +msgstr "``True`` اگر به نشانگر پایان جریان رسیده باشد." msgid "Data found after the end of the compressed stream." -msgstr "" +msgstr "داده‌ای پس از پایان جریان فشرده یافت شد." msgid "Before the end of the stream is reached, this will be ``b''``." -msgstr "" +msgstr "پیش از رسیدن به پایان جریان، این ``b''`` خواهد بود." -msgid "``False`` if the :meth:`.decompress` method can provide more decompressed data before requiring new compressed input." +msgid "" +"``False`` if the :meth:`.decompress` method can provide more decompressed " +"data before requiring new compressed input." msgstr "" +"``False`` اگر متد :meth:`.decompress` بتواند پیش از آنکه به ورودی فشرده‌ی " +"جدید نیاز داشته باشد، داده‌ی فشرده‌گشایی‌شده‌ی بیشتری را ارائه دهد." msgid "Zstandard dictionaries" -msgstr "" +msgstr "دیکشنری‌های Zstandard" -msgid "Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. Zstandard dictionaries enable more efficient compression of smaller sizes of data, which is traditionally difficult to compress due to less repetition. If you are compressing multiple similar groups of data (such as similar files), Zstandard dictionaries can improve compression ratios and speed significantly." -msgstr "" +msgid "" +"Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. " +"Zstandard dictionaries enable more efficient compression of smaller sizes " +"of data, which is traditionally difficult to compress due to less " +"repetition. If you are compressing multiple similar groups of data (such as " +"similar files), Zstandard dictionaries can improve compression ratios and " +"speed significantly." +msgstr "" +"یک دیکشنری Zstandard را آموزش می‌دهد و یک نمونه :class:`ZstdDict` را " +"برمی‌گرداند. دیکشنری‌های Zstandard امکان فشرده‌سازی کارآمدتر داده‌هایی با " +"اندازه‌های کوچک‌تر را فراهم می‌کنند، که به‌طور سنتی به دلیل تکرار کمتر، " +"فشرده‌سازی آن‌ها دشوار است. اگر در حال فشرده‌سازی چندین گروه مشابه از داده‌ها " +"هستید (مانند فایل‌های مشابه)، دیکشنری‌های Zstandard می‌توانند نسبت‌های " +"فشرده‌سازی و سرعت را به‌طور قابل‌توجهی بهبود بخشند." -msgid "The *samples* argument (an iterable of :class:`bytes` objects), is the population of samples used to train the Zstandard dictionary." +msgid "" +"The *samples* argument (an iterable of :class:`bytes` objects), is the " +"population of samples used to train the Zstandard dictionary." msgstr "" +"آرگومان *samples* (یک تکرارپذیر از اشیای :class:`bytes`)، مجموعه‌ای از " +"نمونه‌های استفاده‌شده برای آموزش دیکشنری Zstandard است." -msgid "The *dict_size* argument, an integer, is the maximum size (in bytes) the Zstandard dictionary should be. The Zstandard documentation suggests an absolute maximum of no more than 100 KB, but the maximum can often be smaller depending on the data. Larger dictionaries generally slow down compression, but improve compression ratios. Smaller dictionaries lead to faster compression, but reduce the compression ratio." -msgstr "" +msgid "" +"The *dict_size* argument, an integer, is the maximum size (in bytes) the " +"Zstandard dictionary should be. The Zstandard documentation suggests an " +"absolute maximum of no more than 100 KB, but the maximum can often be " +"smaller depending on the data. Larger dictionaries generally slow down " +"compression, but improve compression ratios. Smaller dictionaries lead to " +"faster compression, but reduce the compression ratio." +msgstr "" +"آرگومان *dict_size*، یک عدد صحیح، حداکثر اندازه‌ای (بر حسب بایت) است که " +"دیکشنری Zstandard باید داشته باشد. مستندات Zstandard پیشنهاد می‌دهد که " +"حداکثر مطلق بیشتر از ۱۰۰ KB نباشد، اما این حداکثر اغلب می‌تواند بسته به " +"داده‌ها کوچک‌تر باشد. دیکشنری‌های بزرگ‌تر معمولاً فشرده‌سازی را کند می‌کنند، اما " +"نسبت‌های فشرده‌سازی را بهبود می‌بخشند. دیکشنری‌های کوچک‌تر به فشرده‌سازی سریع‌تر " +"منجر می‌شوند، اما نسبت فشرده‌سازی را کاهش می‌دهند." -msgid "An advanced function for converting a \"raw content\" Zstandard dictionary into a regular Zstandard dictionary. \"Raw content\" dictionaries are a sequence of bytes that do not need to follow the structure of a normal Zstandard dictionary." +msgid "" +"An advanced function for converting a \"raw content\" Zstandard dictionary " +"into a regular Zstandard dictionary. \"Raw content\" dictionaries are a " +"sequence of bytes that do not need to follow the structure of a normal " +"Zstandard dictionary." msgstr "" +"یک تابع پیشرفته برای تبدیل یک دیکشنری Zstandard با «محتوای خام» به یک " +"دیکشنری Zstandard معمولی. دیکشنری‌های «محتوای خام» دنباله‌ای از بایت‌ها هستند " +"که نیازی نیست از ساختار یک دیکشنری Zstandard عادی پیروی کنند." -msgid "The *zstd_dict* argument is a :class:`ZstdDict` instance with the :attr:`~ZstdDict.dict_content` containing the raw dictionary contents." +msgid "" +"The *zstd_dict* argument is a :class:`ZstdDict` instance with " +"the :attr:`~ZstdDict.dict_content` containing the raw dictionary contents." msgstr "" +"آرگومان *zstd_dict* یک نمونه از :class:`ZstdDict` است " +"که :attr:`~ZstdDict.dict_content` آن حاوی محتویات خام دیکشنری است." -msgid "The *samples* argument (an iterable of :class:`bytes` objects), contains sample data for generating the Zstandard dictionary." +msgid "" +"The *samples* argument (an iterable of :class:`bytes` objects), contains " +"sample data for generating the Zstandard dictionary." msgstr "" +"آرگومان *samples* (یک پیمایش‌پذیر از اشیای :class:`bytes`)، شامل داده‌های " +"نمونه برای تولید دیکشنری Zstandard است." -msgid "The *dict_size* argument, an integer, is the maximum size (in bytes) the Zstandard dictionary should be. See :func:`train_dict` for suggestions on the maximum dictionary size." +msgid "" +"The *dict_size* argument, an integer, is the maximum size (in bytes) the " +"Zstandard dictionary should be. See :func:`train_dict` for suggestions on " +"the maximum dictionary size." msgstr "" +"آرگومان *dict_size*، یک عدد صحیح، حداکثر اندازه‌ای (بر حسب بایت) است که " +"دیکشنری Zstandard باید داشته باشد. برای پیشنهادها درباره حداکثر اندازه " +"دیکشنری، به :func:`train_dict` مراجعه کنید." -msgid "The *level* argument (an integer) is the compression level expected to be passed to the compressors using this dictionary. The dictionary information varies for each compression level, so tuning for the proper compression level can make compression more efficient." +msgid "" +"The *level* argument (an integer) is the compression level expected to be " +"passed to the compressors using this dictionary. The dictionary information " +"varies for each compression level, so tuning for the proper compression " +"level can make compression more efficient." msgstr "" +"آرگومان *level* (یک عدد صحیح) سطح فشرده‌سازی است که انتظار می‌رود به " +"فشرده‌سازهایی که از این دیکشنری استفاده می‌کنند، ارسال شود. اطلاعات دیکشنری " +"برای هر سطح فشرده‌سازی متفاوت است، بنابراین تنظیم برای سطح فشرده‌سازی مناسب " +"می‌تواند فشرده‌سازی را کارآمدتر کند." -msgid "A wrapper around Zstandard dictionaries. Dictionaries can be used to improve the compression of many small chunks of data. Use :func:`train_dict` if you need to train a new dictionary from sample data." +msgid "" +"A wrapper around Zstandard dictionaries. Dictionaries can be used to " +"improve the compression of many small chunks of data. " +"Use :func:`train_dict` if you need to train a new dictionary from sample " +"data." msgstr "" +"پوششی برای دیکشنری‌های Zstandard. می‌توان از دیکشنری‌ها برای بهبود فشرده‌سازی " +"بسیاری از تکه‌های کوچک داده استفاده کرد. اگر نیاز دارید یک دیکشنری جدید را " +"از داده‌های نمونه آموزش دهید، از :func:`train_dict` استفاده کنید." -msgid "The *dict_content* argument (a :term:`bytes-like object`), is the already trained dictionary information." +msgid "" +"The *dict_content* argument (a :term:`bytes-like object`), is the already " +"trained dictionary information." msgstr "" +"آرگومان *dict_content* (یک :term:`شیء شبه‌بایت `)، " +"اطلاعات دیکشنری از پیش آموزش‌دیده‌شده است." -msgid "The *is_raw* argument, a boolean, is an advanced parameter controlling the meaning of *dict_content*. ``True`` means *dict_content* is a \"raw content\" dictionary, without any format restrictions. ``False`` means *dict_content* is an ordinary Zstandard dictionary, created from Zstandard functions, for example, :func:`train_dict` or the external :program:`zstd` CLI." -msgstr "" +msgid "" +"The *is_raw* argument, a boolean, is an advanced parameter controlling the " +"meaning of *dict_content*. ``True`` means *dict_content* is a \"raw " +"content\" dictionary, without any format restrictions. ``False`` means " +"*dict_content* is an ordinary Zstandard dictionary, created from Zstandard " +"functions, for example, :func:`train_dict` or the external :program:`zstd` " +"CLI." +msgstr "" +"آرگومان *is_raw*، یک بولی، پارامتر پیشرفته‌ای است که معنای *dict_content* را " +"کنترل می‌کند. ``True`` یعنی *dict_content* یک دیکشنری «محتوای خام» است، بدون " +"هیچ محدودیت قالبی. ``False`` یعنی *dict_content* یک دیکشنری معمولی " +"Zstandard است که از توابع Zstandard ایجاد شده است، برای " +"مثال، :func:`train_dict` یا CLI خارجی :program:`zstd`." -msgid "When passing a :class:`!ZstdDict` to a function, the :attr:`!as_digested_dict` and :attr:`!as_undigested_dict` attributes can control how the dictionary is loaded by passing them as the ``zstd_dict`` argument, for example, ``compress(data, zstd_dict=zd.as_digested_dict)``. Digesting a dictionary is a costly operation that occurs when loading a Zstandard dictionary. When making multiple calls to compression or decompression, passing a digested dictionary will reduce the overhead of loading the dictionary." -msgstr "" +msgid "" +"When passing a :class:`!ZstdDict` to a function, the :attr:`!" +"as_digested_dict` and :attr:`!as_undigested_dict` attributes can control " +"how the dictionary is loaded by passing them as the ``zstd_dict`` argument, " +"for example, ``compress(data, zstd_dict=zd.as_digested_dict)``. Digesting a " +"dictionary is a costly operation that occurs when loading a Zstandard " +"dictionary. When making multiple calls to compression or decompression, " +"passing a digested dictionary will reduce the overhead of loading the " +"dictionary." +msgstr "" +"هنگام ارسال یک :class:`!ZstdDict` به یک تابع، می‌توانید با ارسال " +"ویژگی‌های :attr:`!as_digested_dict` و :attr:`!as_undigested_dict` به‌عنوان " +"آرگومان ``zstd_dict``، نحوه بارگذاری دیکشنری را کنترل کنید؛ برای مثال، " +"``compress(data, zstd_dict=zd.as_digested_dict)``. هضم یک دیکشنری " +"(digesting) عملیات پرهزینه‌ای است که هنگام بارگذاری یک دیکشنری Zstandard رخ " +"می‌دهد. هنگام انجام چندین فراخوانی فشرده‌سازی یا رفع فشردگی، ارسال یک دیکشنری " +"هضم‌شده، سربار بارگذاری دیکشنری را کاهش می‌دهد." msgid "Difference for compression" -msgstr "" +msgstr "تفاوت برای فشرده‌سازی" msgid "Digested dictionary" -msgstr "" +msgstr "دیکشنری خلاصه‌شده" msgid "Undigested dictionary" -msgstr "" +msgstr "دیکشنری پردازش‌نشده" -msgid "Advanced parameters of the compressor which may be overridden by the dictionary's parameters" +msgid "" +"Advanced parameters of the compressor which may be overridden by the " +"dictionary's parameters" msgstr "" +"پارامترهای پیشرفته‌ی فشرده‌ساز که ممکن است توسط پارامترهای دیکشنری بازنویسی " +"شوند" -msgid "``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, ``target_length``, ``strategy``, ``enable_long_distance_matching``, ``ldm_hash_log``, ``ldm_min_match``, ``ldm_bucket_size_log``, ``ldm_hash_rate_log``, and some non-public parameters." +msgid "" +"``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, " +"``target_length``, ``strategy``, ``enable_long_distance_matching``, " +"``ldm_hash_log``, ``ldm_min_match``, ``ldm_bucket_size_log``, " +"``ldm_hash_rate_log``, and some non-public parameters." msgstr "" +"``window_log``، ``hash_log``، ``chain_log``، ``search_log``، ``min_match``، " +"``target_length``، ``strategy``، ``enable_long_distance_matching``، " +"``ldm_hash_log``، ``ldm_min_match``، ``ldm_bucket_size_log``، " +"``ldm_hash_rate_log`` و برخی پارامترهای غیرعمومی." msgid "None" -msgstr "" +msgstr "None" msgid ":class:`!ZstdDict` internally caches the dictionary" -msgstr "" +msgstr ":class:`!ZstdDict` دیکشنری را به‌صورت داخلی در نهانگاه ذخیره می‌کند" -msgid "Yes. It's faster when loading a digested dictionary again with the same compression level." +msgid "" +"Yes. It's faster when loading a digested dictionary again with the same " +"compression level." msgstr "" +"بله. بارگذاری مجدد یک دیکشنری پردازش‌شده با همان سطح فشرده‌سازی، سریع‌تر است." -msgid "No. If you wish to load an undigested dictionary multiple times, consider reusing a compressor object." +msgid "" +"No. If you wish to load an undigested dictionary multiple times, consider " +"reusing a compressor object." msgstr "" +"خیر. اگر می‌خواهید یک دیکشنری هضم‌نشده را چندین بار بارگذاری کنید، استفاده‌ی " +"مجدد از یک شیء فشرده‌ساز را در نظر بگیرید." -msgid "If passing a :class:`!ZstdDict` without any attribute, an undigested dictionary is passed by default when compressing and a digested dictionary is generated if necessary and passed by default when decompressing." +msgid "" +"If passing a :class:`!ZstdDict` without any attribute, an undigested " +"dictionary is passed by default when compressing and a digested dictionary " +"is generated if necessary and passed by default when decompressing." msgstr "" +"اگر یک :class:`!ZstdDict` بدون هیچ ویژگی‌ای ارسال شود، هنگام فشرده‌سازی به‌طور " +"پیش‌فرض یک دیکشنری هضم‌نشده (undigested) ارسال می‌شود و هنگام کدگشایی، در صورت " +"نیاز یک دیکشنری هضم‌شده (digested) تولید و به‌طور پیش‌فرض ارسال می‌شود." -msgid "The content of the Zstandard dictionary, a ``bytes`` object. It's the same as the *dict_content* argument in the ``__init__`` method. It can be used with other programs, such as the ``zstd`` CLI program." +msgid "" +"The content of the Zstandard dictionary, a ``bytes`` object. It's the same " +"as the *dict_content* argument in the ``__init__`` method. It can be used " +"with other programs, such as the ``zstd`` CLI program." msgstr "" +"محتوای دیکشنری Zstandard، یک شیء ``bytes``. این همان آرگومان *dict_content* " +"در متد ``__init__`` است. می‌توان از آن با برنامه‌های دیگر، مانند برنامه‌ی خط " +"فرمان ``zstd`` استفاده کرد." msgid "Identifier of the Zstandard dictionary, a non-negative int value." -msgstr "" +msgstr "شناسه‌ی دیکشنری Zstandard، یک مقدار عدد صحیح غیرمنفی." -msgid "Non-zero means the dictionary is ordinary, created by Zstandard functions and following the Zstandard format." +msgid "" +"Non-zero means the dictionary is ordinary, created by Zstandard functions " +"and following the Zstandard format." msgstr "" +"غیرصفر به این معناست که دیکشنری معمولی است، توسط توابع Zstandard ایجاد شده " +"و از قالب Zstandard پیروی می‌کند." -msgid "``0`` means a \"raw content\" dictionary, free of any format restriction, used for advanced users." +msgid "" +"``0`` means a \"raw content\" dictionary, free of any format restriction, " +"used for advanced users." msgstr "" +"``0`` به معنای یک دیکشنری «محتوای خام» است، بدون هیچ محدودیت قالبی، و برای " +"کاربران پیشرفته در نظر گرفته شده است." -msgid "The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the ``dictionary_id`` attribute to the :func:`get_frame_info` function." +msgid "" +"The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the " +"``dictionary_id`` attribute to the :func:`get_frame_info` function." msgstr "" +"معنای ``0`` برای :attr:`!ZstdDict.dict_id` با ویژگی ``dictionary_id`` در " +"تابع :func:`get_frame_info` متفاوت است." msgid "Load as a digested dictionary." -msgstr "" +msgstr "به‌صورت یک دیکشنری پردازش‌شده بارگذاری کنید." msgid "Load as an undigested dictionary." -msgstr "" +msgstr "به‌صورت یک دیکشنری پردازش‌نشده بارگذاری شود." msgid "Advanced parameter control" -msgstr "" +msgstr "کنترل پیشرفته پارامتر" -msgid "An :class:`~enum.IntEnum` containing the advanced compression parameter keys that can be used when compressing data." +msgid "" +"An :class:`~enum.IntEnum` containing the advanced compression parameter " +"keys that can be used when compressing data." msgstr "" +"یک :class:`~enum.IntEnum` شامل کلیدهای پارامترهای فشرده‌سازی پیشرفته است که " +"می‌توان هنگام فشرده‌سازی داده‌ها از آن‌ها استفاده کرد." -msgid "The :meth:`~.bounds` method can be used on any attribute to get the valid values for that parameter." +msgid "" +"The :meth:`~.bounds` method can be used on any attribute to get the valid " +"values for that parameter." msgstr "" +"می‌توان از متد :meth:`~.bounds` برای هر ویژگی استفاده کرد تا مقادیر معتبر آن " +"پارامتر به دست آید." -msgid "Parameters are optional; any omitted parameter will have its value selected automatically." +msgid "" +"Parameters are optional; any omitted parameter will have its value selected " +"automatically." msgstr "" +"پارامترها اختیاری هستند؛ مقدار هر پارامتری که حذف شود، به‌طور خودکار انتخاب " +"می‌شود." -msgid "Example getting the lower and upper bound of :attr:`~.compression_level`::" -msgstr "" +msgid "" +"Example getting the lower and upper bound of :attr:`~.compression_level`::" +msgstr "مثال دریافت کران پایین و بالای :attr:`~.compression_level`::" msgid "lower, upper = CompressionParameter.compression_level.bounds()" -msgstr "" +msgstr "lower, upper = CompressionParameter.compression_level.bounds()" msgid "Example setting the :attr:`~.window_log` to the maximum size::" -msgstr "" +msgstr "مثال تنظیم :attr:`~.window_log` بر روی بیشترین اندازه::" msgid "" "_lower, upper = CompressionParameter.window_log.bounds()\n" "options = {CompressionParameter.window_log: upper}\n" "compress(b'venezuelan beaver cheese', options=options)" msgstr "" +"_lower, upper = CompressionParameter.window_log.bounds()\n" +"options = {CompressionParameter.window_log: upper}\n" +"compress(b'venezuelan beaver cheese', options=options)" -msgid "Return the tuple of int bounds, ``(lower, upper)``, of a compression parameter. This method should be called on the attribute you wish to retrieve the bounds of. For example, to get the valid values for :attr:`~.compression_level`, one may check the result of ``CompressionParameter.compression_level.bounds()``." -msgstr "" +msgid "" +"Return the tuple of int bounds, ``(lower, upper)``, of a compression " +"parameter. This method should be called on the attribute you wish to " +"retrieve the bounds of. For example, to get the valid values " +"for :attr:`~.compression_level`, one may check the result of " +"``CompressionParameter.compression_level.bounds()``." +msgstr "" +"تاپل کرانه‌های عدد صحیح یک پارامتر فشرده‌سازی، ``(lower, upper)``، را " +"برمی‌گرداند. این متد باید روی ویژگی‌ای فراخوانی شود که می‌خواهید کرانه‌های آن " +"را بازیابی کنید. برای مثال، برای به‌دست آوردن مقادیر " +"معتبر :attr:`~.compression_level`، می‌توانید نتیجه‌ی " +"``CompressionParameter.compression_level.bounds()`` را بررسی کنید." msgid "Both the lower and upper bounds are inclusive." -msgstr "" +msgstr "هر دو کران پایین و بالا شامل می‌شوند." -msgid "A high-level means of setting other compression parameters that affect the speed and ratio of compressing data." +msgid "" +"A high-level means of setting other compression parameters that affect the " +"speed and ratio of compressing data." msgstr "" +"یک راهکار سطح بالا برای تنظیم سایر پارامترهای فشرده‌سازی که بر سرعت و نسبت " +"فشرده‌سازی داده‌ها اثر می‌گذارند." -msgid "Regular compression levels are greater than ``0``. Values greater than ``20`` are considered \"ultra\" compression and require more memory than other levels. Negative values can be used to trade off faster compression for worse compression ratios." +msgid "" +"Regular compression levels are greater than ``0``. Values greater than " +"``20`` are considered \"ultra\" compression and require more memory than " +"other levels. Negative values can be used to trade off faster compression " +"for worse compression ratios." msgstr "" +"سطح‌های فشرده‌سازی معمولی بزرگ‌تر از ``0`` هستند. مقادیر بزرگ‌تر از ``20`` " +"به‌عنوان فشرده‌سازی «فوق‌العاده» (ultra) در نظر گرفته می‌شوند و به حافظه بیشتری " +"نسبت به سایر سطح‌ها نیاز دارند. می‌توان از مقادیر منفی برای به دست آوردن " +"فشرده‌سازی سریع‌تر به قیمت نسبت‌های فشرده‌سازی بدتر استفاده کرد." msgid "Setting the level to zero uses :attr:`COMPRESSION_LEVEL_DEFAULT`." msgstr "" +"با تنظیم سطح روی ۰، از :attr:`COMPRESSION_LEVEL_DEFAULT` استفاده می‌شود." -msgid "Maximum allowed back-reference distance the compressor can use when compressing data, expressed as power of two, ``1 << window_log`` bytes. This parameter greatly influences the memory usage of compression. Higher values require more memory but gain better compression values." +msgid "" +"Maximum allowed back-reference distance the compressor can use when " +"compressing data, expressed as power of two, ``1 << window_log`` bytes. " +"This parameter greatly influences the memory usage of compression. Higher " +"values require more memory but gain better compression values." msgstr "" +"حداکثر فاصله‌ی مجاز ارجاع به عقب (back-reference) که فشرده‌ساز می‌تواند هنگام " +"فشرده‌سازی داده‌ها از آن استفاده کند، به صورت توانی از دو، ``1 << " +"window_log`` بایت. این پارامتر تا حد زیادی بر مصرف حافظه‌ی فشرده‌سازی تأثیر " +"می‌گذارد. مقادیر بالاتر به حافظه‌ی بیشتری نیاز دارند، اما مقادیر فشرده‌سازی " +"بهتری به دست می‌دهند." msgid "A value of zero causes the value to be selected automatically." -msgstr "" +msgstr "مقدار صفر باعث می‌شود مقدار به‌صورت خودکار انتخاب شود." -msgid "Size of the initial probe table, as a power of two. The resulting memory usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression ratio of strategies <= :attr:`~Strategy.dfast`, and improve compression speed of strategies > :attr:`~Strategy.dfast`." +msgid "" +"Size of the initial probe table, as a power of two. The resulting memory " +"usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression " +"ratio of strategies <= :attr:`~Strategy.dfast`, and improve compression " +"speed of strategies > :attr:`~Strategy.dfast`." msgstr "" +"اندازه‌ی جدول پروب اولیه (probe table)، به‌صورت توانی از ۲. میزان مصرف حافظه‌ی " +"حاصل، ``1 << (hash_log+2)`` بایت است. جدول‌های بزرگ‌تر، نسبت فشرده‌سازی برای " +"راهبردهای <= :attr:`~Strategy.dfast` و سرعت فشرده‌سازی برای راهبردهای " +"> :attr:`~Strategy.dfast` را بهبود می‌دهند." -msgid "Size of the multi-probe search table, as a power of two. The resulting memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in better and slower compression. This parameter has no effect for the :attr:`~Strategy.fast` strategy. It's still useful when using :attr:`~Strategy.dfast` strategy, in which case it defines a secondary probe table." -msgstr "" +msgid "" +"Size of the multi-probe search table, as a power of two. The resulting " +"memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in " +"better and slower compression. This parameter has no effect for " +"the :attr:`~Strategy.fast` strategy. It's still useful when " +"using :attr:`~Strategy.dfast` strategy, in which case it defines a " +"secondary probe table." +msgstr "" +"اندازه‌ی جدول جست‌وجوی multi-probe، به‌صورت توانی از ۲. میزان حافظه‌ی مصرفی حاصل " +"``1 << (chain_log+2)`` بایت است. جدول‌های بزرگ‌تر منجر به فشرده‌سازی بهتر و " +"کندتر می‌شوند. این پارامتر برای راهبرد :attr:`~Strategy.fast` تأثیری ندارد. " +"این پارامتر همچنان هنگام استفاده از راهبرد :attr:`~Strategy.dfast` مفید " +"است، که در این حالت یک جدول probe ثانویه را تعریف می‌کند." -msgid "Number of search attempts, as a power of two. More attempts result in better and slower compression. This parameter is useless for :attr:`~Strategy.fast` and :attr:`~Strategy.dfast` strategies." +msgid "" +"Number of search attempts, as a power of two. More attempts result in " +"better and slower compression. This parameter is useless " +"for :attr:`~Strategy.fast` and :attr:`~Strategy.dfast` strategies." msgstr "" +"تعداد تلاش‌های جست‌وجو، به‌صورت توانی از ۲. تلاش‌های بیشتر منجر به فشرده‌سازی " +"بهتر و کندتر می‌شود. این پارامتر برای راهبردهای :attr:`~Strategy.fast` " +"و :attr:`~Strategy.dfast` بی‌فایده است." -msgid "Minimum size of searched matches. Larger values increase compression and decompression speed, but decrease ratio. Note that Zstandard can still find matches of smaller size, it just tweaks its search algorithm to look for this size and larger. For all strategies < :attr:`~Strategy.btopt`, the effective minimum is ``4``; for all strategies > :attr:`~Strategy.fast`, the effective maximum is ``6``." -msgstr "" +msgid "" +"Minimum size of searched matches. Larger values increase compression and " +"decompression speed, but decrease ratio. Note that Zstandard can still find " +"matches of smaller size, it just tweaks its search algorithm to look for " +"this size and larger. For all strategies < :attr:`~Strategy.btopt`, the " +"effective minimum is ``4``; for all strategies > :attr:`~Strategy.fast`, " +"the effective maximum is ``6``." +msgstr "" +"حداقل اندازه‌ی تطابق‌های مورد جستجو. مقادیر بزرگ‌تر سرعت فشرده‌سازی و فشرده‌گشایی " +"را افزایش می‌دهند، اما نسبت فشرده‌سازی را کاهش می‌دهند. توجه داشته باشید که " +"Zstandard همچنان می‌تواند تطابق‌هایی با اندازه‌ی کوچک‌تر پیدا کند، فقط الگوریتم " +"جستجوی خود را تنظیم می‌کند تا به دنبال این اندازه و اندازه‌های بزرگ‌تر بگردد. " +"برای همه‌ی راهبردهای کوچک‌تر از :attr:`~Strategy.btopt`، حداقل مؤثر ``4`` است؛ " +"برای همه‌ی راهبردهای بزرگ‌تر از :attr:`~Strategy.fast`، حداکثر مؤثر ``6`` است." msgid "The impact of this field depends on the selected :class:`Strategy`." -msgstr "" +msgstr "تأثیر این فیلد به :class:`Strategy` انتخاب‌شده بستگی دارد." -msgid "For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` and :attr:`~Strategy.btultra2`, the value is the length of a match considered \"good enough\" to stop searching. Larger values make compression ratios better, but compresses slower." +msgid "" +"For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` " +"and :attr:`~Strategy.btultra2`, the value is the length of a match " +"considered \"good enough\" to stop searching. Larger values make " +"compression ratios better, but compresses slower." msgstr "" +"برای راهبردهای :attr:`~Strategy.btopt`، :attr:`~Strategy.btultra` " +"و :attr:`~Strategy.btultra2`، مقدار، طول تطابقی است که «به‌اندازه کافی خوب» " +"برای توقف جستجو در نظر گرفته می‌شود. مقادیر بزرگ‌تر نسبت‌های فشرده‌سازی را بهتر " +"می‌کنند، اما فشرده‌سازی کندتر می‌شود." -msgid "For strategy :attr:`~Strategy.fast`, it is the distance between match sampling. Larger values make compression faster, but with a worse compression ratio." +msgid "" +"For strategy :attr:`~Strategy.fast`, it is the distance between match " +"sampling. Larger values make compression faster, but with a worse " +"compression ratio." msgstr "" +"برای راهبرد :attr:`~Strategy.fast`، این فاصله بین نمونه‌برداری تطابق است. " +"مقادیر بزرگ‌تر فشرده‌سازی را سریع‌تر می‌کنند، اما با نسبت فشرده‌سازی بدتر." -msgid "The higher the value of selected strategy, the more complex the compression technique used by zstd, resulting in higher compression ratios but slower compression." +msgid "" +"The higher the value of selected strategy, the more complex the compression " +"technique used by zstd, resulting in higher compression ratios but slower " +"compression." msgstr "" +"هرچه مقدار راهبرد انتخاب‌شده بالاتر باشد، روش فشرده‌سازی استفاده‌شده توسط zstd " +"پیچیده‌تر می‌شود و به نسبت‌های فشرده‌سازی بالاتر اما فشرده‌سازی کندتر منجر می‌شود." msgid ":class:`Strategy`" -msgstr "" +msgstr ":class:`Strategy`" -msgid "Long distance matching can be used to improve compression for large inputs by finding large matches at greater distances. It increases memory usage and window size." +msgid "" +"Long distance matching can be used to improve compression for large inputs " +"by finding large matches at greater distances. It increases memory usage " +"and window size." msgstr "" +"تطبیق با فاصله‌ی طولانی (long distance matching) می‌تواند با یافتن تطبیق‌های " +"بزرگ در فاصله‌های دورتر، فشرده‌سازی ورودی‌های بزرگ را بهبود بخشد. این قابلیت " +"مصرف حافظه و اندازه‌ی پنجره را افزایش می‌دهد." -msgid "``True`` or ``1`` enable long distance matching while ``False`` or ``0`` disable it." +msgid "" +"``True`` or ``1`` enable long distance matching while ``False`` or ``0`` " +"disable it." msgstr "" +"``True`` یا ``1`` تطبیق با فاصله‌ی طولانی (long distance matching) را فعال " +"می‌کند، در حالی که ``False`` یا ``0`` آن را غیرفعال می‌کند." -msgid "Enabling this parameter increases default :attr:`~CompressionParameter.window_log` to 128 MiB except when expressly set to a different value. This setting is enabled by default if :attr:`!window_log` >= 128 MiB and the compression strategy >= :attr:`~Strategy.btopt` (compression level 16+)." -msgstr "" +msgid "" +"Enabling this parameter increases " +"default :attr:`~CompressionParameter.window_log` to 128 MiB except when " +"expressly set to a different value. This setting is enabled by default " +"if :attr:`!window_log` >= 128 MiB and the compression strategy " +">= :attr:`~Strategy.btopt` (compression level 16+)." +msgstr "" +"فعال‌سازی این پارامتر، مقدار پیش‌فرض :attr:`~CompressionParameter.window_log` " +"را به ۱۲۸ MiB افزایش می‌دهد، مگر آنکه صریحاً مقدار دیگری برای آن تنظیم شده " +"باشد. این تنظیم در صورتی به‌صورت پیش‌فرض فعال می‌شود که :attr:`!window_log` >= " +"۱۲۸ MiB و راهبرد فشرده‌سازی >= :attr:`~Strategy.btopt` باشد (سطح فشرده‌سازی " +"۱۶+)." -msgid "Size of the table for long distance matching, as a power of two. Larger values increase memory usage and compression ratio, but decrease compression speed." +msgid "" +"Size of the table for long distance matching, as a power of two. Larger " +"values increase memory usage and compression ratio, but decrease " +"compression speed." msgstr "" +"اندازه‌ی جدول برای تطبیق فاصله‌ی طولانی، به‌صورت توانی از ۲. مقادیر بزرگ‌تر " +"مصرف حافظه و نسبت فشرده‌سازی را افزایش می‌دهند، اما سرعت فشرده‌سازی را کاهش " +"می‌دهند." -msgid "Minimum match size for long distance matcher. Larger or too small values can often decrease the compression ratio." +msgid "" +"Minimum match size for long distance matcher. Larger or too small values " +"can often decrease the compression ratio." msgstr "" +"حداقل اندازه‌ی تطبیق برای تطبیق‌دهنده‌ی فاصله‌ی بلند (long distance matcher). " +"مقادیر بزرگ‌تر یا بیش از حد کوچک اغلب می‌توانند نسبت فشرده‌سازی را کاهش دهند." -msgid "Log size of each bucket in the long distance matcher hash table for collision resolution. Larger values improve collision resolution but decrease compression speed." +msgid "" +"Log size of each bucket in the long distance matcher hash table for " +"collision resolution. Larger values improve collision resolution but " +"decrease compression speed." msgstr "" +"لگاریتم اندازه‌ی هر سطل از جدول هش تطبیق‌گر فاصله‌ی بلند (long distance " +"matcher) برای حل برخورد. مقادیر بزرگ‌تر، حل برخورد را بهبود می‌بخشند اما سرعت " +"فشرده‌سازی را کاهش می‌دهند." -msgid "Frequency of inserting/looking up entries into the long distance matcher hash table. Larger values improve compression speed. Deviating far from the default value will likely result in a compression ratio decrease." +msgid "" +"Frequency of inserting/looking up entries into the long distance matcher " +"hash table. Larger values improve compression speed. Deviating far from the " +"default value will likely result in a compression ratio decrease." msgstr "" +"بسامد درج/جست‌وجوی آیتم‌ها در جدول هش تطبیق‌گر فاصله بلند (long distance " +"matcher). مقادیر بزرگ‌تر سرعت فشرده‌سازی را بهبود می‌بخشند. انحراف زیاد از " +"مقدار پیش‌فرض احتمالاً باعث کاهش نسبت فشرده‌سازی می‌شود." -msgid "Write the size of the data to be compressed into the Zstandard frame header when known prior to compressing." +msgid "" +"Write the size of the data to be compressed into the Zstandard frame header " +"when known prior to compressing." msgstr "" +"در صورتی که اندازه‌ی داده‌هایی که باید فشرده شوند پیش از فشرده‌سازی مشخص باشد، " +"آن را در سرآیند قاب Zstandard بنویسید." msgid "This flag only takes effect under the following scenarios:" -msgstr "" +msgstr "این پرچم تنها در سناریوهای زیر اعمال می‌شود:" msgid "Calling :func:`compress` for one-shot compression" -msgstr "" +msgstr "فراخوانی :func:`compress` برای فشرده‌سازی یک‌باره" -msgid "Providing all of the data to be compressed in the frame in a single :meth:`ZstdCompressor.compress` call, with the :attr:`ZstdCompressor.FLUSH_FRAME` mode." +msgid "" +"Providing all of the data to be compressed in the frame in a " +"single :meth:`ZstdCompressor.compress` call, with " +"the :attr:`ZstdCompressor.FLUSH_FRAME` mode." msgstr "" +"ارائه‌ی تمام داده‌هایی که باید در فریمفشرده شوند، در یک " +"فراخوانی :meth:`ZstdCompressor.compress`، با " +"حالت :attr:`ZstdCompressor.FLUSH_FRAME`." -msgid "Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount of data that will be provided to the compressor prior to any calls to :meth:`ZstdCompressor.compress` for the current frame. :meth:`!ZstdCompressor.set_pledged_input_size` must be called for each new frame." +msgid "" +"Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount " +"of data that will be provided to the compressor prior to any calls " +"to :meth:`ZstdCompressor.compress` for the current frame. :meth:`!" +"ZstdCompressor.set_pledged_input_size` must be called for each new frame." msgstr "" +"فراخوانی :meth:`ZstdCompressor.set_pledged_input_size` با مقدار دقیق داده‌ای " +"که برای قاب جاری به فشرده‌ساز ارائه خواهد شد، پیش از هر " +"فراخوانی :meth:`ZstdCompressor.compress`. :meth:`!" +"ZstdCompressor.set_pledged_input_size` باید برای هر قاب جدید فراخوانی شود." -msgid "All other compression calls may not write the size information into the frame header." +msgid "" +"All other compression calls may not write the size information into the " +"frame header." msgstr "" +"تمام سایر فراخوانی‌های فشرده‌سازی ممکن است اطلاعات اندازه را در سرآیند قاب " +"(frame header) ننویسند." -msgid "``True`` or ``1`` enable the content size flag while ``False`` or ``0`` disable it." +msgid "" +"``True`` or ``1`` enable the content size flag while ``False`` or ``0`` " +"disable it." msgstr "" +"``True`` یا ``1`` پرچم اندازه‌ی محتوا را فعال می‌کند، در حالی که ``False`` یا " +"``0`` آن را غیرفعال می‌کند." -msgid "A four-byte checksum using XXHash64 of the uncompressed content is written at the end of each frame. Zstandard's decompression code verifies the checksum. If there is a mismatch a :class:`ZstdError` exception is raised." +msgid "" +"A four-byte checksum using XXHash64 of the uncompressed content is written " +"at the end of each frame. Zstandard's decompression code verifies the " +"checksum. If there is a mismatch a :class:`ZstdError` exception is raised." msgstr "" +"یک جمع‌آزما ۴ بایتی از محتوای فشرده‌نشده با استفاده از XXHash64 در پایان هر " +"فریم نوشته می‌شود. کد فشرده‌گشایی Zstandard این جمع‌آزما را تأیید می‌کند. در صورت " +"عدم تطابق، استثنای :class:`ZstdError` پرتاب می‌شود." -msgid "``True`` or ``1`` enable checksum generation while ``False`` or ``0`` disable it." +msgid "" +"``True`` or ``1`` enable checksum generation while ``False`` or ``0`` " +"disable it." msgstr "" +"``True`` یا ``1`` تولید جمع‌آزما (checksum) را فعال می‌کند، در حالی که " +"``False`` یا ``0`` آن را غیرفعال می‌کند." -msgid "When compressing with a :class:`ZstdDict`, the dictionary's ID is written into the frame header." +msgid "" +"When compressing with a :class:`ZstdDict`, the dictionary's ID is written " +"into the frame header." msgstr "" +"هنگام فشرده‌سازی با یک :class:`ZstdDict`، شناسه‌ی دیکشنری در سرآیند فریم (frame " +"header) نوشته می‌شود." -msgid "``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` disable it." +msgid "" +"``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` " +"disable it." msgstr "" +"``True`` یا ``1`` ذخیره‌سازی شناسه دیکشنری را فعال می‌کند، در حالی که " +"``False`` یا ``0`` آن را غیرفعال می‌کند." -msgid "Select how many threads will be spawned to compress in parallel. When :attr:`!nb_workers` > 0, enables multi-threaded compression, a value of ``1`` means \"one-thread multi-threaded mode\". More workers improve speed, but also increase memory usage and slightly reduce compression ratio." +msgid "" +"Select how many threads will be spawned to compress in parallel. " +"When :attr:`!nb_workers` > 0, enables multi-threaded compression, a value " +"of ``1`` means \"one-thread multi-threaded mode\". More workers improve " +"speed, but also increase memory usage and slightly reduce compression ratio." msgstr "" +"تعداد نخ‌هایی را که برای فشرده‌سازی به‌صورت موازی ایجاد خواهند شد، انتخاب " +"کنید. هنگامی که :attr:`!nb_workers` > ۰ باشد، فشرده‌سازی چند نخی فعال می‌شود؛ " +"مقدار ``1`` به معنای «حالت چند نخی با یک نخ» است. کارگرهای بیشتر سرعت را " +"بهبود می‌بخشند، اما مصرف حافظه را نیز افزایش می‌دهند و نسبت فشرده‌سازی را کمی " +"کاهش می‌دهند." msgid "A value of zero disables multi-threading." -msgstr "" +msgstr "مقدار صفر، چندنخی را غیرفعال می‌کند." -msgid "Size of a compression job, in bytes. This value is enforced only when :attr:`~CompressionParameter.nb_workers` >= 1. Each compression job is completed in parallel, so this value can indirectly impact the number of active threads." +msgid "" +"Size of a compression job, in bytes. This value is enforced only " +"when :attr:`~CompressionParameter.nb_workers` >= 1. Each compression job is " +"completed in parallel, so this value can indirectly impact the number of " +"active threads." msgstr "" +"اندازه‌ی یک کار فشرده‌سازی، بر حسب بایت. این مقدار تنها زمانی اعمال می‌شود " +"که :attr:`~CompressionParameter.nb_workers` بزرگ‌تر یا مساوی ۱ باشد. هر کار " +"فشرده‌سازی به‌صورت موازی تکمیل می‌شود، بنابراین این مقدار می‌تواند به‌طور " +"غیرمستقیم بر تعداد نخ‌های فعال تأثیر بگذارد." -msgid "Sets how much data is reloaded from previous jobs (threads) for new jobs to be used by the look behind window during compression. This value is only used when :attr:`~CompressionParameter.nb_workers` >= 1. Acceptable values vary from 0 to 9." +msgid "" +"Sets how much data is reloaded from previous jobs (threads) for new jobs to " +"be used by the look behind window during compression. This value is only " +"used when :attr:`~CompressionParameter.nb_workers` >= 1. Acceptable values " +"vary from 0 to 9." msgstr "" +"تعیین می‌کند که چه مقدار داده از کارهای پیشین (نخ‌ها) برای کارهای جدید " +"بارگذاری مجدد می‌شود تا در حین فشرده‌سازی توسط پنجره‌ی نگاه به عقب مورد استفاده " +"قرار گیرد. این مقدار فقط زمانی استفاده می‌شود " +"که :attr:`~CompressionParameter.nb_workers` بزرگ‌تر یا مساوی ۱ باشد. مقادیر " +"قابل‌قبول از ۰ تا ۹ متغیر است." msgid "0 means dynamically set the overlap amount" -msgstr "" +msgstr "۰ به این معناست که میزان هم‌پوشانی به‌صورت پویا تنظیم می‌شود" msgid "1 means no overlap" -msgstr "" +msgstr "۱ به معنای عدم هم‌پوشانی است" msgid "9 means use a full window size from the previous job" -msgstr "" +msgstr "۹ یعنی استفاده از اندازه‌ی کامل پنجره (window size) از کار پیشین" -msgid "Each increment halves/doubles the overlap size. \"8\" means an overlap of ``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." +msgid "" +"Each increment halves/doubles the overlap size. \"8\" means an overlap of " +"``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." msgstr "" +"هر افزایش، اندازه همپوشانی را نصف/دو برابر می‌کند. «۸» به معنای همپوشانی " +"``window_size/2`` است، «۷» به معنای همپوشانی ``window_size/4`` است، و غیره." -msgid "An :class:`~enum.IntEnum` containing the advanced decompression parameter keys that can be used when decompressing data. Parameters are optional; any omitted parameter will have its value selected automatically." +msgid "" +"An :class:`~enum.IntEnum` containing the advanced decompression parameter " +"keys that can be used when decompressing data. Parameters are optional; any " +"omitted parameter will have its value selected automatically." msgstr "" +"یک :class:`~enum.IntEnum` شامل کلیدهای پارامترهای پیشرفته‌ی فشرده‌گشایی که " +"می‌توان هنگام فشرده‌گشایی داده‌ها از آن‌ها استفاده کرد. پارامترها اختیاری " +"هستند؛ مقدار هر پارامتری که ارائه نشود، به‌طور خودکار انتخاب می‌شود." msgid "Example setting the :attr:`~.window_log_max` to the maximum size::" -msgstr "" +msgstr "مثالی برای تنظیم :attr:`~.window_log_max` روی بیشینه اندازه::" msgid "" "data = compress(b'Some very long buffer of bytes...')\n" @@ -474,48 +1215,94 @@ msgid "" "options = {DecompressionParameter.window_log_max: upper}\n" "decompress(data, options=options)" msgstr "" +"data = compress(b'Some very long buffer of bytes...')\n" +"\n" +"_lower, upper = DecompressionParameter.window_log_max.bounds()\n" +"\n" +"options = {DecompressionParameter.window_log_max: upper}\n" +"decompress(data, options=options)" -msgid "Return the tuple of int bounds, ``(lower, upper)``, of a decompression parameter. This method should be called on the attribute you wish to retrieve the bounds of." +msgid "" +"Return the tuple of int bounds, ``(lower, upper)``, of a decompression " +"parameter. This method should be called on the attribute you wish to " +"retrieve the bounds of." msgstr "" +"تاپل کران‌های عدد صحیح، ``(lower, upper)``، برای یک پارامتر از حالت فشرده " +"خارج کردن (decompression) را برمی‌گرداند. این متد باید بر روی ویژگی‌ای " +"فراخوانی شود که می‌خواهید کران‌های آن را بازیابی کنید." -msgid "The base-two logarithm of the maximum size of the window used during decompression. This can be useful to limit the amount of memory used when decompressing data. A larger maximum window size leads to faster decompression." +msgid "" +"The base-two logarithm of the maximum size of the window used during " +"decompression. This can be useful to limit the amount of memory used when " +"decompressing data. A larger maximum window size leads to faster " +"decompression." msgstr "" +"لگاریتم مبنای ۲ حداکثر اندازه‌ی پنجره‌ی استفاده‌شده در حین فشرده‌گشایی. این " +"می‌تواند برای محدود کردن مقدار حافظه‌ی استفاده‌شده هنگام فشرده‌گشایی داده‌ها مفید " +"باشد. بزرگ‌تر بودن حداکثر اندازه‌ی پنجره باعث فشرده‌گشایی سریع‌تر می‌شود." -msgid "An :class:`~enum.IntEnum` containing strategies for compression. Higher-numbered strategies correspond to more complex and slower compression." +msgid "" +"An :class:`~enum.IntEnum` containing strategies for compression. Higher-" +"numbered strategies correspond to more complex and slower compression." msgstr "" +"یک :class:`~enum.IntEnum` که شامل راهبردهایی برای فشرده‌سازی است. راهبردهای " +"با شماره بالاتر، فشرده‌سازی پیچیده‌تر و کندتری دارند." -msgid "The values of attributes of :class:`!Strategy` are not necessarily stable across zstd versions. Only the ordering of the attributes may be relied upon. The attributes are listed below in order." +msgid "" +"The values of attributes of :class:`!Strategy` are not necessarily stable " +"across zstd versions. Only the ordering of the attributes may be relied " +"upon. The attributes are listed below in order." msgstr "" +"مقادیر ویژگی‌های :class:`!Strategy` لزوماً در نسخه‌های مختلف zstd پایدار " +"نیستند. تنها می‌توان به ترتیب ویژگی‌ها اتکا کرد. ویژگی‌ها در زیر به ترتیب " +"فهرست شده‌اند." msgid "The following strategies are available:" -msgstr "" +msgstr "راهبردهای زیر در دسترس هستند:" msgid "Miscellaneous" -msgstr "" +msgstr "متفرقه" -msgid "Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard frame. Frames contain metadata related to the compressed data they hold." +msgid "" +"Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard " +"frame. Frames contain metadata related to the compressed data they hold." msgstr "" +"یک شیء :class:`FrameInfo` حاوی فراداده در مورد یک فریم Zstandard را بازیابی " +"کنید. فریم‌ها حاوی فراداده مربوط به داده‌های فشرده‌ای هستند که در خود نگه " +"می‌دارند." msgid "Metadata related to a Zstandard frame." -msgstr "" +msgstr "فراداده‌ی مربوط به یک قاب Zstandard." msgid "The size of the decompressed contents of the frame." -msgstr "" +msgstr "اندازه‌ی محتوای غیرفشرده‌ی فریم." -msgid "An integer representing the Zstandard dictionary ID needed for decompressing the frame. ``0`` means the dictionary ID was not recorded in the frame header. This may mean that a Zstandard dictionary is not needed, or that the ID of a required dictionary was not recorded." +msgid "" +"An integer representing the Zstandard dictionary ID needed for " +"decompressing the frame. ``0`` means the dictionary ID was not recorded in " +"the frame header. This may mean that a Zstandard dictionary is not needed, " +"or that the ID of a required dictionary was not recorded." msgstr "" +"یک عدد صحیح که شناسه‌ی دیکشنری Zstandard موردنیاز برای فشرده‌گشایی فریم را " +"نشان می‌دهد. ``0`` یعنی شناسه‌ی دیکشنری در سرآیند فریم ثبت نشده است. این ممکن " +"است به این معنا باشد که به دیکشنری Zstandard نیازی نیست، یا شناسه‌ی یک " +"دیکشنری موردنیاز ثبت نشده است." msgid "The default compression level for Zstandard: ``3``." -msgstr "" +msgstr "سطح فشرده‌سازی پیش‌فرض برای Zstandard: ``3``." -msgid "Version number of the runtime zstd library as a tuple of integers (major, minor, release)." +msgid "" +"Version number of the runtime zstd library as a tuple of integers (major, " +"minor, release)." msgstr "" +"شماره نسخه کتابخانه zstd در ران‌تایم به‌صورت یک تاپل از اعداد صحیح (major, " +"minor, release)." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Reading in a compressed file:" -msgstr "" +msgstr "خواندن از یک فایل فشرده:" msgid "" "from compression import zstd\n" @@ -523,9 +1310,13 @@ msgid "" "with zstd.open(\"file.zst\") as f:\n" " file_content = f.read()" msgstr "" +"from compression import zstd\n" +"\n" +"with zstd.open(\"file.zst\") as f:\n" +" file_content = f.read()" msgid "Creating a compressed file:" -msgstr "" +msgstr "ایجاد یک فایل فشرده:" msgid "" "from compression import zstd\n" @@ -534,9 +1325,14 @@ msgid "" "with zstd.open(\"file.zst\", \"w\") as f:\n" " f.write(data)" msgstr "" +"from compression import zstd\n" +"\n" +"data = b\"Insert Data Here\"\n" +"with zstd.open(\"file.zst\", \"w\") as f:\n" +" f.write(data)" msgid "Compressing data in memory:" -msgstr "" +msgstr "فشرده‌سازی داده‌ها در حافظه:" msgid "" "from compression import zstd\n" @@ -544,9 +1340,13 @@ msgid "" "data_in = b\"Insert Data Here\"\n" "data_out = zstd.compress(data_in)" msgstr "" +"from compression import zstd\n" +"\n" +"data_in = b\"Insert Data Here\"\n" +"data_out = zstd.compress(data_in)" msgid "Incremental compression:" -msgstr "" +msgstr "فشرده‌سازی تدریجی:" msgid "" "from compression import zstd\n" @@ -559,9 +1359,18 @@ msgid "" "# Concatenate all the partial results:\n" "result = b\"\".join([out1, out2, out3, out4])" msgstr "" +"from compression import zstd\n" +"\n" +"comp = zstd.ZstdCompressor()\n" +"out1 = comp.compress(b\"Some data\\n\")\n" +"out2 = comp.compress(b\"Another piece of data\\n\")\n" +"out3 = comp.compress(b\"Even more data\\n\")\n" +"out4 = comp.flush()\n" +"# همه‌ی نتایج جزئی را الحاق کنید:\n" +"result = b\"\".join([out1, out2, out3, out4])" msgid "Writing compressed data to an already-open file:" -msgstr "" +msgstr "نوشتن داده‌های فشرده در فایلی که از قبل باز است:" msgid "" "from compression import zstd\n" @@ -572,9 +1381,16 @@ msgid "" " zstf.write(b\"This *will* be compressed\\n\")\n" " f.write(b\"Not compressed\\n\")" msgstr "" +"from compression import zstd\n" +"\n" +"with open(\"myfile\", \"wb\") as f:\n" +" f.write(b\"This data will not be compressed\\n\")\n" +" with zstd.open(f, \"w\") as zstf:\n" +" zstf.write(b\"This *will* be compressed\\n\")\n" +" f.write(b\"Not compressed\\n\")" msgid "Creating a compressed file using compression parameters:" -msgstr "" +msgstr "ایجاد یک فایل فشرده با استفاده از پارامترهای فشرده‌سازی:" msgid "" "from compression import zstd\n" @@ -585,3 +1401,10 @@ msgid "" "with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" " f.write(b\"Mind if I squeeze in?\")" msgstr "" +"from compression import zstd\n" +"\n" +"options = {\n" +" zstd.CompressionParameter.checksum_flag: 1\n" +"}\n" +"with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" +" f.write(b\"Mind if I squeeze in?\")" diff --git a/library/concurrency.po b/library/concurrency.po index fdbe3d584..f2ed88265 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -22,10 +22,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Concurrent Execution" -msgstr "" +msgstr "اجرای هم‌روند" -msgid "The modules described in this chapter provide support for concurrent execution of code. The appropriate choice of tool will depend on the task to be executed (CPU bound vs IO bound) and preferred style of development (event driven cooperative multitasking vs preemptive multitasking). Here's an overview:" +msgid "" +"The modules described in this chapter provide support for concurrent " +"execution of code. The appropriate choice of tool will depend on the task to" +" be executed (CPU bound vs IO bound) and preferred style of development " +"(event driven cooperative multitasking vs preemptive multitasking). Here's " +"an overview:" msgstr "" +"ماژول‌های توصیف‌شده در این فصل، پشتیبانی از اجرای هم‌روند کد را فراهم " +"می‌کنند. انتخاب ابزار مناسب به وظیفه‌ی مورد اجرا (محدود به CPU در برابر محدود" +" به IO) و سبک توسعه‌ی ترجیحی (چندوظیفگی مشارکتی رویدادمحور در برابر " +"چندوظیفگی پیش‌دستانه) بستگی دارد. در ادامه یک مرور کلی آمده است:" msgid "The following are support modules for some of the above services:" -msgstr "" +msgstr "موارد زیر ماژول‌های پشتیبانی برای برخی از سرویس‌های بالا هستند:" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index b5120e87b..2ad956b3e 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -24,79 +24,206 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!concurrent.futures` --- Launching parallel tasks" -msgstr "" +msgstr ":mod:`!concurrent.futures` --- راه‌اندازی وظایف موازی" -msgid "**Source code:** :source:`Lib/concurrent/futures/thread.py`, :source:`Lib/concurrent/futures/process.py`, and :source:`Lib/concurrent/futures/interpreter.py`" +msgid "" +"**Source code:** :source:`Lib/concurrent/futures/thread.py`, " +":source:`Lib/concurrent/futures/process.py`, and " +":source:`Lib/concurrent/futures/interpreter.py`" msgstr "" +":source:`Lib/concurrent/futures/thread.py`، " +":source:`Lib/concurrent/futures/process.py` و " +":source:`Lib/concurrent/futures/interpreter.py`" -msgid "The :mod:`!concurrent.futures` module provides a high-level interface for asynchronously executing callables." +msgid "" +"The :mod:`!concurrent.futures` module provides a high-level interface for " +"asynchronously executing callables." msgstr "" +"ماژول :mod:`!concurrent.futures` یک رابط سطح بالا برای اجرای ناهمگام " +"فراخوان‌پذیرها فراهم می‌کند." -msgid "The asynchronous execution can be performed with threads, using :class:`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or separate processes, using :class:`ProcessPoolExecutor`. Each implements the same interface, which is defined by the abstract :class:`Executor` class." +msgid "" +"The asynchronous execution can be performed with threads, using " +":class:`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or separate" +" processes, using :class:`ProcessPoolExecutor`. Each implements the same " +"interface, which is defined by the abstract :class:`Executor` class." msgstr "" +"اجرای ناهمگام را می‌توان با نخ‌ها، با استفاده از :class:`ThreadPoolExecutor`" +" یا :class:`InterpreterPoolExecutor`، یا با فرآیندهای جداگانه، با استفاده " +"از :class:`ProcessPoolExecutor` انجام داد. هر یک از آن‌ها رابط یکسانی را " +"پیاده‌سازی می‌کند که توسط کلاس انتزاعی :class:`Executor` تعریف شده است." -msgid ":class:`concurrent.futures.Future` must not be confused with :class:`asyncio.Future`, which is designed for use with :mod:`asyncio` tasks and coroutines. See the :doc:`asyncio's Future ` documentation for a detailed comparison of the two." +msgid "" +":class:`concurrent.futures.Future` must not be confused with " +":class:`asyncio.Future`, which is designed for use with :mod:`asyncio` tasks" +" and coroutines. See the :doc:`asyncio's Future ` " +"documentation for a detailed comparison of the two." msgstr "" +":class:`concurrent.futures.Future` نباید با :class:`asyncio.Future` اشتباه " +"گرفته شود، که برای استفاده با وظایف (tasks) و هم‌روال‌های :mod:`asyncio` " +"طراحی شده است. برای مقایسه‌ی دقیق این دو، مستندات :doc:`Future در asyncio " +"` را ببینید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "Executor Objects" -msgstr "" +msgstr "اشیای Executor" -msgid "An abstract class that provides methods to execute calls asynchronously. It should not be used directly, but through its concrete subclasses." +msgid "" +"An abstract class that provides methods to execute calls asynchronously. It" +" should not be used directly, but through its concrete subclasses." msgstr "" +"یک کلاس انتزاعی که متدهایی برای اجرای فراخوانی‌ها به‌صورت ناهمگام فراهم " +"می‌کند. این کلاس نباید مستقیماً استفاده شود، بلکه باید از طریق زیرکلاس‌های " +"عینی آن استفاده شود." -msgid "Schedules the callable, *fn*, to be executed as ``fn(*args, **kwargs)`` and returns a :class:`Future` object representing the execution of the callable. ::" +msgid "" +"Schedules the callable, *fn*, to be executed as ``fn(*args, **kwargs)`` and " +"returns a :class:`Future` object representing the execution of the callable." +" ::" msgstr "" +"شیء قابل فراخوانی *fn* را زمان‌بندی می‌کند تا به‌صورت ``fn(*args, " +"**kwargs)`` اجرا شود و یک شیء :class:`Future` را برمی‌گرداند که نشان‌دهنده‌ی " +"اجرای آن شیء قابل فراخوانی است. ::" msgid "" "with ThreadPoolExecutor(max_workers=1) as executor:\n" " future = executor.submit(pow, 323, 1235)\n" " print(future.result())" msgstr "" +"with ThreadPoolExecutor(max_workers=1) as executor:\n" +" future = executor.submit(pow, 323, 1235)\n" +" print(future.result())" msgid "Similar to :func:`map(fn, *iterables) ` except:" -msgstr "" +msgstr "مشابه :func:`map(fn, *iterables) ` با این تفاوت که:" -msgid "The *iterables* are collected immediately rather than lazily, unless a *buffersize* is specified to limit the number of submitted tasks whose results have not yet been yielded. If the buffer is full, iteration over the *iterables* pauses until a result is yielded from the buffer." +msgid "" +"The *iterables* are collected immediately rather than lazily, unless a " +"*buffersize* is specified to limit the number of submitted tasks whose " +"results have not yet been yielded. If the buffer is full, iteration over the" +" *iterables* pauses until a result is yielded from the buffer." msgstr "" +"*iterables* به‌جای جمع‌آوری به‌صورت تنبل، بلافاصله جمع‌آوری می‌شوند، مگر " +"اینکه *buffersize* برای محدود کردن تعداد وظایف ارسال‌شده‌ای که نتایجشان هنوز" +" تولید نشده‌اند تعیین شده باشد. اگر بافر پر باشد، پیمایش بر *iterables* تا " +"زمانی که نتیجه‌ای از بافر تولید شود متوقف می‌شود." -msgid "*fn* is executed asynchronously and several calls to *fn* may be made concurrently." +msgid "" +"*fn* is executed asynchronously and several calls to *fn* may be made " +"concurrently." msgstr "" +"*fn* به‌صورت ناهمگام اجرا می‌شود و ممکن است چندین فراخوانی *fn* به‌صورت " +"همزمان انجام شود." -msgid "The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is called and the result isn't available after *timeout* seconds from the original call to :meth:`Executor.map`. *timeout* can be an int or a float. If *timeout* is not specified or ``None``, there is no limit to the wait time." -msgstr "" +msgid "" +"The returned iterator raises a :exc:`TimeoutError` if " +":meth:`~iterator.__next__` is called and the result isn't available after " +"*timeout* seconds from the original call to :meth:`Executor.map`. *timeout* " +"can be an int or a float. If *timeout* is not specified or ``None``, there " +"is no limit to the wait time." +msgstr "" +"اگر :meth:`~iterator.__next__` فراخوانی شود و نتیجه پس از گذشت *timeout* " +"ثانیه از فراخوانی اصلی :meth:`Executor.map` در دسترس نباشد، پیمایش‌گر " +"برگردانده‌شده استثنای :exc:`TimeoutError` را پرتاب می‌کند. *timeout* " +"می‌تواند یک عدد صحیح یا عدد اعشاری باشد. اگر *timeout* مشخص نشده باشد یا " +"``None`` باشد، محدودیتی برای زمان انتظار وجود ندارد." -msgid "If a *fn* call raises an exception, then that exception will be raised when its value is retrieved from the iterator." +msgid "" +"If a *fn* call raises an exception, then that exception will be raised when " +"its value is retrieved from the iterator." msgstr "" +"اگر یک فراخوانی *fn* استثنایی را پرتاب کند، آن استثنا زمانی پرتاب خواهد شد " +"که مقدارش از پیمایش‌گر بازیابی شود." -msgid "When using :class:`ProcessPoolExecutor`, this method chops *iterables* into a number of chunks which it submits to the pool as separate tasks. The (approximate) size of these chunks can be specified by setting *chunksize* to a positive integer. For very long iterables, using a large value for *chunksize* can significantly improve performance compared to the default size of 1. With :class:`ThreadPoolExecutor` and :class:`InterpreterPoolExecutor`, *chunksize* has no effect." -msgstr "" +msgid "" +"When using :class:`ProcessPoolExecutor`, this method chops *iterables* into " +"a number of chunks which it submits to the pool as separate tasks. The " +"(approximate) size of these chunks can be specified by setting *chunksize* " +"to a positive integer. For very long iterables, using a large value for " +"*chunksize* can significantly improve performance compared to the default " +"size of 1. With :class:`ThreadPoolExecutor` and " +":class:`InterpreterPoolExecutor`, *chunksize* has no effect." +msgstr "" +"هنگام استفاده از :class:`ProcessPoolExecutor`، این متد *پیمایش‌پذیرها* را به " +"تعدادی تکه تقسیم می‌کند و آن‌ها را به‌عنوان وظایف جداگانه به استخر ارسال " +"می‌کند. اندازه‌ی (تقریبی) این تکه‌ها را می‌توان با تنظیم *chunksize* روی یک " +"عدد صحیح مثبت مشخص کرد. برای پیمایش‌پذیرهای بسیار طولانی، استفاده از یک مقدار" +" بزرگ برای *chunksize* می‌تواند در مقایسه با اندازه‌ی پیش‌فرض ۱، عملکرد را " +"به‌طور قابل‌توجهی بهبود بخشد. در :class:`ThreadPoolExecutor` و " +":class:`InterpreterPoolExecutor`، *chunksize* هیچ تأثیری ندارد." msgid "Added the *chunksize* parameter." -msgstr "" +msgstr "پارامتر *chunksize* افزوده شد." msgid "Added the *buffersize* parameter." -msgstr "" +msgstr "پارامتر *buffersize* افزوده شد." -msgid "Signal the executor that it should free any resources that it is using when the currently pending futures are done executing. Calls to :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will raise :exc:`RuntimeError`." +msgid "" +"Signal the executor that it should free any resources that it is using when " +"the currently pending futures are done executing. Calls to " +":meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will " +"raise :exc:`RuntimeError`." msgstr "" +"به اجراکننده (executor) اطلاع می‌دهد که باید هر منبعی را که در حال استفاده " +"از آن است، هنگامی که اجرای آینده‌نماهای در انتظار فعلی (futures) به پایان رسید،" +" آزاد کند. فراخوانی‌های :meth:`Executor.submit` و :meth:`Executor.map` که پس" +" از shutdown انجام شوند، :exc:`RuntimeError` را پرتاب خواهند کرد." -msgid "If *wait* is ``True`` then this method will not return until all the pending futures are done executing and the resources associated with the executor have been freed. If *wait* is ``False`` then this method will return immediately and the resources associated with the executor will be freed when all pending futures are done executing. Regardless of the value of *wait*, the entire Python program will not exit until all pending futures are done executing." -msgstr "" +msgid "" +"If *wait* is ``True`` then this method will not return until all the pending" +" futures are done executing and the resources associated with the executor " +"have been freed. If *wait* is ``False`` then this method will return " +"immediately and the resources associated with the executor will be freed " +"when all pending futures are done executing. Regardless of the value of " +"*wait*, the entire Python program will not exit until all pending futures " +"are done executing." +msgstr "" +"اگر *wait* برابر ``True`` باشد، این متد تا زمانی که اجرای تمام آینده‌نماهای در " +"انتظار (futures) به پایان نرسیده باشد و منابع مرتبط با اجراکننده (executor) " +"آزاد نشده باشند، بازگشت نخواهد کرد. اگر *wait* برابر ``False`` باشد، این متد" +" بلافاصله بازمی‌گردد و منابع مرتبط با اجراکننده زمانی آزاد می‌شوند که اجرای " +"تمام آینده‌نماهای در انتظار به پایان برسد. صرف‌نظر از مقدار *wait*، کل برنامه " +"پایتون تا زمانی که اجرای تمام آینده‌نماهای در انتظار به پایان نرسیده باشد، خارج" +" نخواهد شد." -msgid "If *cancel_futures* is ``True``, this method will cancel all pending futures that the executor has not started running. Any futures that are completed or running won't be cancelled, regardless of the value of *cancel_futures*." +msgid "" +"If *cancel_futures* is ``True``, this method will cancel all pending futures" +" that the executor has not started running. Any futures that are completed " +"or running won't be cancelled, regardless of the value of *cancel_futures*." msgstr "" +"اگر *cancel_futures* برابر ``True`` باشد، این متد تمام آینده‌نماهای در انتظار " +"را که اجراکننده اجرای آن‌ها را آغاز نکرده است، لغو می‌کند. آینده‌نماهایی که " +"تکمیل شده‌اند یا در حال اجرا هستند، بدون توجه به مقدار *cancel_futures* لغو " +"نخواهند شد." -msgid "If both *cancel_futures* and *wait* are ``True``, all futures that the executor has started running will be completed prior to this method returning. The remaining futures are cancelled." +msgid "" +"If both *cancel_futures* and *wait* are ``True``, all futures that the " +"executor has started running will be completed prior to this method " +"returning. The remaining futures are cancelled." msgstr "" +"اگر هر دو *cancel_futures* و *wait* برابر ``True`` باشند، تمام آینده‌نماهایی که" +" اجراکننده اجرای آن‌ها را آغاز کرده است، پیش از بازگشت این متد تکمیل خواهند " +"شد. آینده‌نماهای باقی‌مانده لغو می‌شوند." -msgid "You can avoid having to call this method explicitly if you use the executor as a :term:`context manager` via the :keyword:`with` statement, which will shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were called with *wait* set to ``True``)::" +msgid "" +"You can avoid having to call this method explicitly if you use the executor " +"as a :term:`context manager` via the :keyword:`with` statement, which will " +"shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were" +" called with *wait* set to ``True``)::" msgstr "" +"اگر از اجراکننده به‌عنوان یک :term:`context manager` از طریق دستور " +":keyword:`with` استفاده کنید، نیازی به فراخوانی صریح این متد نخواهید داشت؛ " +"در این حالت :class:`Executor` خاموش می‌شود (منتظر می‌ماند، گویی " +":meth:`Executor.shutdown` با *wait* روی ``True`` فراخوانی شده است)::" msgid "" "import shutil\n" @@ -106,18 +233,32 @@ msgid "" " e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" " e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" msgstr "" +"import shutil\n" +"with ThreadPoolExecutor(max_workers=4) as e:\n" +" e.submit(shutil.copy, 'src1.txt', 'dest1.txt')\n" +" e.submit(shutil.copy, 'src2.txt', 'dest2.txt')\n" +" e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" +" e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" msgid "Added *cancel_futures*." -msgstr "" +msgstr "*cancel_futures* اضافه شد." msgid "ThreadPoolExecutor" -msgstr "" +msgstr "ThreadPoolExecutor" -msgid ":class:`ThreadPoolExecutor` is an :class:`Executor` subclass that uses a pool of threads to execute calls asynchronously." +msgid "" +":class:`ThreadPoolExecutor` is an :class:`Executor` subclass that uses a " +"pool of threads to execute calls asynchronously." msgstr "" +":class:`ThreadPoolExecutor` یک زیرکلاس از :class:`Executor` است که از استخری" +" از نخ‌ها برای اجرای فراخوانی‌ها به‌صورت ناهمگام استفاده می‌کند." -msgid "Deadlocks can occur when the callable associated with a :class:`Future` waits on the results of another :class:`Future`. For example::" +msgid "" +"Deadlocks can occur when the callable associated with a :class:`Future` " +"waits on the results of another :class:`Future`. For example::" msgstr "" +"بن‌بست‌ها ممکن است زمانی رخ دهند که فراخوانی‌پذیر (callable) مرتبط با یک " +":class:`Future` منتظر نتایج یک :class:`Future` دیگر بماند. برای مثال::" msgid "" "import time\n" @@ -136,9 +277,24 @@ msgid "" "a = executor.submit(wait_on_b)\n" "b = executor.submit(wait_on_a)" msgstr "" +"import time\n" +"def wait_on_b():\n" +" time.sleep(5)\n" +" print(b.result()) # b هرگز کامل نمی‌شود زیرا در انتظار a است.\n" +" return 5\n" +"\n" +"def wait_on_a():\n" +" time.sleep(5)\n" +" print(a.result()) # a هرگز کامل نمی‌شود زیرا در انتظار b است.\n" +" return 6\n" +"\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=2)\n" +"a = executor.submit(wait_on_b)\n" +"b = executor.submit(wait_on_a)" msgid "And::" -msgstr "" +msgstr "و::" msgid "" "def wait_on_future():\n" @@ -152,36 +308,105 @@ msgid "" "# Note: calling future.result() would also cause a deadlock because\n" "# the single worker thread is already waiting for wait_on_future()." msgstr "" +"def wait_on_future():\n" +" f = executor.submit(pow, 5, 2)\n" +" # این هرگز کامل نمی‌شود زیرا تنها یک نخ کارگر وجود دارد و\n" +" # در حال اجرای این تابع است.\n" +" print(f.result())\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=1)\n" +"future = executor.submit(wait_on_future)\n" +"# توجه: فراخوانی future.result() نیز باعث بن‌بست می‌شود، زیرا\n" +"# تنها نخ کارگر از قبل در انتظار wait_on_future() است." -msgid "An :class:`Executor` subclass that uses a pool of at most *max_workers* threads to execute calls asynchronously." +msgid "" +"An :class:`Executor` subclass that uses a pool of at most *max_workers* " +"threads to execute calls asynchronously." msgstr "" +"یک زیرکلاس :class:`Executor` که از استخری با حداکثر *max_workers* نخ برای " +"اجرای فراخوانی‌ها به‌صورت ناهمگام استفاده می‌کند." -msgid "All threads enqueued to ``ThreadPoolExecutor`` will be joined before the interpreter can exit. Note that the exit handler which does this is executed *before* any exit handlers added using ``atexit``. This means exceptions in the main thread must be caught and handled in order to signal threads to exit gracefully. For this reason, it is recommended that ``ThreadPoolExecutor`` not be used for long-running tasks." -msgstr "" +msgid "" +"All threads enqueued to ``ThreadPoolExecutor`` will be joined before the " +"interpreter can exit. Note that the exit handler which does this is executed" +" *before* any exit handlers added using ``atexit``. This means exceptions in" +" the main thread must be caught and handled in order to signal threads to " +"exit gracefully. For this reason, it is recommended that " +"``ThreadPoolExecutor`` not be used for long-running tasks." +msgstr "" +"پیش از آنکه مفسر بتواند خارج شود، همه نخ‌هایی که در ``ThreadPoolExecutor`` " +"در صف قرار گرفته‌اند، join خواهند شد. توجه داشته باشید که مدیر خروجی که این " +"کار را انجام می‌دهد، *پیش از* هر مدیر خروجی که با استفاده از ``atexit`` " +"اضافه شده باشد، اجرا می‌شود. این بدان معناست که برای علامت‌دهی به نخ‌ها جهت " +"خروج به‌صورت ایمن، باید استثناهای نخ اصلی گرفته و مدیریت شوند. به همین دلیل،" +" توصیه می‌شود که ``ThreadPoolExecutor`` برای وظایف طولانی‌مدت استفاده نشود." -msgid "*initializer* is an optional callable that is called at the start of each worker thread; *initargs* is a tuple of arguments passed to the initializer. Should *initializer* raise an exception, all currently pending jobs will raise a :exc:`~concurrent.futures.thread.BrokenThreadPool`, as well as any attempt to submit more jobs to the pool." -msgstr "" +msgid "" +"*initializer* is an optional callable that is called at the start of each " +"worker thread; *initargs* is a tuple of arguments passed to the initializer." +" Should *initializer* raise an exception, all currently pending jobs will " +"raise a :exc:`~concurrent.futures.thread.BrokenThreadPool`, as well as any " +"attempt to submit more jobs to the pool." +msgstr "" +"*initializer* یک شیء فراخوانی‌پذیر اختیاری است که در آغاز هر نخ‌کارگر " +"فراخوانی می‌شود؛ *initargs* تاپلی از آرگومان‌ها است که به initializer ارسال " +"می‌شوند. در صورتی که *initializer* استثنایی پرتاب کند، همه کارهایی که در حال" +" حاضر در انتظار هستند، و همچنین هر تلاشی برای ارسال کارهای بیشتر به استخر، " +"یک :exc:`~concurrent.futures.thread.BrokenThreadPool` پرتاب خواهند کرد." -msgid "If *max_workers* is ``None`` or not given, it will default to the number of processors on the machine, multiplied by ``5``, assuming that :class:`ThreadPoolExecutor` is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for :class:`ProcessPoolExecutor`." -msgstr "" +msgid "" +"If *max_workers* is ``None`` or not given, it will default to the number of " +"processors on the machine, multiplied by ``5``, assuming that " +":class:`ThreadPoolExecutor` is often used to overlap I/O instead of CPU work" +" and the number of workers should be higher than the number of workers for " +":class:`ProcessPoolExecutor`." +msgstr "" +"اگر *max_workers* ``None`` باشد یا ارائه نشود، به‌طور پیش‌فرض برابر با تعداد" +" پردازنده‌های ماشین ضرب در ``5`` خواهد بود، با این فرض که " +":class:`ThreadPoolExecutor` اغلب برای هم‌پوشانی ورودی/خروجی به‌جای کار " +"پردازنده استفاده می‌شود و تعداد کارگرها باید بیشتر از تعداد کارگرهای " +":class:`ProcessPoolExecutor` باشد." -msgid "Added the *thread_name_prefix* parameter to allow users to control the :class:`threading.Thread` names for worker threads created by the pool for easier debugging." +msgid "" +"Added the *thread_name_prefix* parameter to allow users to control the " +":class:`threading.Thread` names for worker threads created by the pool for " +"easier debugging." msgstr "" +"پارامتر *thread_name_prefix* افزوده شد تا کاربران بتوانند نام‌های " +":class:`threading.Thread` را برای نخ‌های کارگر ایجادشده توسط استخر، برای " +"اشکال‌زدایی آسان‌تر کنترل کنند." msgid "Added the *initializer* and *initargs* arguments." -msgstr "" +msgstr "آرگومان‌های *initializer* و *initargs* اضافه شدند." -msgid "Default value of *max_workers* is changed to ``min(32, os.cpu_count() + 4)``. This default value preserves at least 5 workers for I/O bound tasks. It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL. And it avoids using very large resources implicitly on many-core machines." +msgid "" +"Default value of *max_workers* is changed to ``min(32, os.cpu_count() + " +"4)``. This default value preserves at least 5 workers for I/O bound tasks. " +"It utilizes at most 32 CPU cores for CPU bound tasks which release the GIL. " +"And it avoids using very large resources implicitly on many-core machines." msgstr "" +"مقدار پیش‌فرض *max_workers* به ``min(32, os.cpu_count() + 4)`` تغییر کرده " +"است. این مقدار پیش‌فرض حداقل ۵ کارگر را برای وظایف محدود به I/O حفظ می‌کند. " +"این مقدار حداکثر از ۳۲ هسته‌ی CPU برای وظایف محدود به CPU که GIL را آزاد " +"می‌کنند، استفاده می‌کند. و از استفاده‌ی ضمنی از منابع بسیار زیاد در " +"ماشین‌های با تعداد هسته بسیار زیاد جلوگیری می‌کند." -msgid "ThreadPoolExecutor now reuses idle worker threads before starting *max_workers* worker threads too." +msgid "" +"ThreadPoolExecutor now reuses idle worker threads before starting " +"*max_workers* worker threads too." msgstr "" +"ThreadPoolExecutor اکنون پیش از راه‌اندازی *max_workers* نخ کاری، از نخ‌های " +"کاری بیکار نیز دوباره استفاده می‌کند." -msgid "Default value of *max_workers* is changed to ``min(32, (os.process_cpu_count() or 1) + 4)``." +msgid "" +"Default value of *max_workers* is changed to ``min(32, " +"(os.process_cpu_count() or 1) + 4)``." msgstr "" +"مقدار پیش‌فرض *max_workers* به ``min(32, (os.process_cpu_count() or 1) + " +"4)`` تغییر کرده است." msgid "ThreadPoolExecutor Example" -msgstr "" +msgstr "مثال ThreadPoolExecutor" msgid "" "import concurrent.futures\n" @@ -211,102 +436,407 @@ msgid "" " else:\n" " print('%r page is %d bytes' % (url, len(data)))" msgstr "" +"import concurrent.futures\n" +"import urllib.request\n" +"\n" +"URLS = ['http://www.foxnews.com/',\n" +" 'http://www.cnn.com/',\n" +" 'http://europe.wsj.com/',\n" +" 'http://www.bbc.co.uk/',\n" +" 'http://nonexistent-subdomain.python.org/']\n" +"\n" +"# Retrieve a single page and report the URL and contents\n" +"def load_url(url, timeout):\n" +" with urllib.request.urlopen(url, timeout=timeout) as conn:\n" +" return conn.read()\n" +"\n" +"# We can use a with statement to ensure threads are cleaned up promptly\n" +"with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:\n" +" # Start the load operations and mark each future with its URL\n" +" future_to_url = {executor.submit(load_url, url, 60): url for url in URLS}\n" +" for future in concurrent.futures.as_completed(future_to_url):\n" +" url = future_to_url[future]\n" +" try:\n" +" data = future.result()\n" +" except Exception as exc:\n" +" print('%r generated an exception: %s' % (url, exc))\n" +" else:\n" +" print('%r page is %d bytes' % (url, len(data)))" msgid "InterpreterPoolExecutor" -msgstr "" +msgstr "InterpreterPoolExecutor" -msgid "The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass, which means each worker is running in its own thread. The difference here is that each worker has its own interpreter, and runs each task using that interpreter." -msgstr "" +msgid "" +"The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to " +"execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass," +" which means each worker is running in its own thread. The difference here " +"is that each worker has its own interpreter, and runs each task using that " +"interpreter." +msgstr "" +"کلاس :class:`InterpreterPoolExecutor` از استخری از مفسرها استفاده می‌کند تا" +" فراخوانی‌ها را به‌صورت ناهمگام اجرا کند. این کلاس یک زیرکلاس از " +":class:`ThreadPoolExecutor` است، که به این معناست که هر کارگر در نخ خود اجرا" +" می‌شود. تفاوت در اینجا این است که هر کارگر مفسر خود را دارد و هر وظیفه را " +"با استفاده از آن مفسر اجرا می‌کند." -msgid "The biggest benefit to using interpreters instead of only threads is true multi-core parallelism. Each interpreter has its own :term:`Global Interpreter Lock `, so code running in one interpreter can run on one CPU core, while code in another interpreter runs unblocked on a different core." -msgstr "" +msgid "" +"The biggest benefit to using interpreters instead of only threads is true " +"multi-core parallelism. Each interpreter has its own :term:`Global " +"Interpreter Lock `, so code running in one " +"interpreter can run on one CPU core, while code in another interpreter runs " +"unblocked on a different core." +msgstr "" +"بزرگ‌ترین مزیت استفاده از مفسرها به‌جای استفاده صرف از نخ‌ها، موازی‌سازی " +"چندهسته‌ای واقعی است. هر مفسر دارای :term:`قفل سراسری مفسر ` مختص خود است، بنابراین کد در حال اجرا در یک مفسر می‌تواند" +" بر یک هسته‌ی CPU اجرا شود، در حالی که کد در مفسری دیگر بدون مسدود شدن بر " +"هسته‌ی دیگری اجرا می‌شود." -msgid "The tradeoff is that writing concurrent code for use with multiple interpreters can take extra effort. However, this is because it forces you to be deliberate about how and when interpreters interact, and to be explicit about what data is shared between interpreters. This results in several benefits that help balance the extra effort, including true multi-core parallelism, For example, code written this way can make it easier to reason about concurrency. Another major benefit is that you don't have to deal with several of the big pain points of using threads, like race conditions." -msgstr "" +msgid "" +"The tradeoff is that writing concurrent code for use with multiple " +"interpreters can take extra effort. However, this is because it forces you " +"to be deliberate about how and when interpreters interact, and to be " +"explicit about what data is shared between interpreters. This results in " +"several benefits that help balance the extra effort, including true multi-" +"core parallelism, For example, code written this way can make it easier to " +"reason about concurrency. Another major benefit is that you don't have to " +"deal with several of the big pain points of using threads, like race " +"conditions." +msgstr "" +"بهای این کار آن است که نوشتن کد هم‌روند برای استفاده با چندین مفسر ممکن است " +"تلاش بیشتری بطلبد. با این حال، دلیل این موضوع آن است که این کار شما را ملزم " +"می‌کند درباره‌ی چگونگی و زمان تعامل مفسرها با یکدیگر سنجیده عمل کنید و " +"به‌صراحت مشخص کنید چه داده‌هایی بین مفسرها مشترک است. این امر چندین مزیت به " +"همراه دارد که به جبران این تلاش اضافی کمک می‌کنند، از جمله موازی‌سازی واقعی " +"چند هسته‌ای. برای مثال، کدی که به این شیوه نوشته شده باشد می‌تواند استدلال " +"درباره‌ی هم‌روندی را آسان‌تر کند. مزیت مهم دیگر این است که شما مجبور نیستید " +"با چندین نقطه‌ی دردساز بزرگ استفاده از نخ‌ها، مانند شرایط رقابتی، سروکار " +"داشته باشید." -msgid "Each worker's interpreter is isolated from all the other interpreters. \"Isolated\" means each interpreter has its own runtime state and operates completely independently. For example, if you redirect :data:`sys.stdout` in one interpreter, it will not be automatically redirected to any other interpreter. If you import a module in one interpreter, it is not automatically imported in any other. You would need to import the module separately in interpreter where you need it. In fact, each module imported in an interpreter is a completely separate object from the same module in a different interpreter, including :mod:`sys`, :mod:`builtins`, and even ``__main__``." -msgstr "" +msgid "" +"Each worker's interpreter is isolated from all the other interpreters. " +"\"Isolated\" means each interpreter has its own runtime state and operates " +"completely independently. For example, if you redirect :data:`sys.stdout` " +"in one interpreter, it will not be automatically redirected to any other " +"interpreter. If you import a module in one interpreter, it is not " +"automatically imported in any other. You would need to import the module " +"separately in interpreter where you need it. In fact, each module imported " +"in an interpreter is a completely separate object from the same module in a " +"different interpreter, including :mod:`sys`, :mod:`builtins`, and even " +"``__main__``." +msgstr "" +"مفسر هر کارگر از همه مفسرهای دیگر ایزوله است. «ایزوله» یعنی هر مفسر وضعیت " +"ران‌تایم خودش را دارد و به‌طور کاملاً مستقل عمل می‌کند. برای مثال، اگر " +":data:`sys.stdout` را در یک مفسر تغییر مسیر دهید، این تغییر مسیر به‌طور " +"خودکار در هیچ مفسر دیگری اعمال نمی‌شود. اگر ماژولی را در یک مفسر ایمپورت " +"کنید، به‌طور خودکار در هیچ مفسر دیگری ایمپورت نمی‌شود. لازم است آن ماژول را " +"به‌طور جداگانه در مفسری که به آن نیاز دارید ایمپورت کنید. در واقع، هر ماژول " +"ایمپورت‌شده در یک مفسر، یک شیء کاملاً جدا از همان ماژول در مفسری دیگر است، " +"از جمله :mod:`sys`، :mod:`builtins` و حتی ``__main__``." -msgid "Isolation means a mutable object, or other data, cannot be used by more than one interpreter at the same time. That effectively means interpreters cannot actually share such objects or data. Instead, each interpreter must have its own copy, and you will have to synchronize any changes between the copies manually. Immutable objects and data, like the builtin singletons, strings, and tuples of immutable objects, don't have these limitations." -msgstr "" +msgid "" +"Isolation means a mutable object, or other data, cannot be used by more than" +" one interpreter at the same time. That effectively means interpreters " +"cannot actually share such objects or data. Instead, each interpreter must " +"have its own copy, and you will have to synchronize any changes between the " +"copies manually. Immutable objects and data, like the builtin singletons, " +"strings, and tuples of immutable objects, don't have these limitations." +msgstr "" +"جداسازی به این معناست که نمی‌توان همزمان از یک شیء تغییرپذیر، یا داده‌های " +"دیگر، در بیش از یک مفسر استفاده کرد. این عملاً به این معناست که مفسرها در " +"واقع نمی‌توانند چنین اشیاء یا داده‌هایی را به اشتراک بگذارند. در عوض، هر " +"مفسر باید نسخه‌ی خود را داشته باشد و شما باید هرگونه تغییر بین نسخه‌ها را " +"به‌صورت دستی همگام‌سازی کنید. اشیاء و داده‌های تغییرناپذیر، مانند " +"تک‌نمونه‌های توکار (singletons)، رشته‌ها و تاپل‌هایی از اشیاء تغییرناپذیر، " +"این محدودیت‌ها را ندارند." -msgid "Communicating and synchronizing between interpreters is most effectively done using dedicated tools, like those proposed in :pep:`734`. One less efficient alternative is to serialize with :mod:`pickle` and then send the bytes over a shared :mod:`socket ` or :func:`pipe `." +msgid "" +"Communicating and synchronizing between interpreters is most effectively " +"done using dedicated tools, like those proposed in :pep:`734`. One less " +"efficient alternative is to serialize with :mod:`pickle` and then send the " +"bytes over a shared :mod:`socket ` or :func:`pipe `." msgstr "" +"ارتباط و همگام‌سازی بین مفسرها به مؤثرترین نحو با استفاده از ابزارهای " +"اختصاصی انجام می‌شود، مانند آن‌هایی که در :pep:`734` پیشنهاد شده‌اند. یک " +"جایگزین کم‌بازده‌تر، سریال‌سازی با :mod:`pickle` و سپس ارسال بایت‌ها از طریق" +" یک :mod:`socket ` یا :func:`pipe ` مشترک است." -msgid "A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously using a pool of at most *max_workers* threads. Each thread runs tasks in its own interpreter. The worker interpreters are isolated from each other, which means each has its own runtime state and that they can't share any mutable objects or other data. Each interpreter has its own :term:`Global Interpreter Lock `, which means code run with this executor has true multi-core parallelism." -msgstr "" +msgid "" +"A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously " +"using a pool of at most *max_workers* threads. Each thread runs tasks in " +"its own interpreter. The worker interpreters are isolated from each other, " +"which means each has its own runtime state and that they can't share any " +"mutable objects or other data. Each interpreter has its own :term:`Global " +"Interpreter Lock `, which means code run with this " +"executor has true multi-core parallelism." +msgstr "" +"زیرکلاسی از :class:`ThreadPoolExecutor` که فراخوانی‌ها را به‌صورت ناهمگام با" +" استفاده از استخری از حداکثر *max_workers* نخ اجرا می‌کند. هر نخ وظایف را در" +" مفسر خود اجرا می‌کند. مفسرهای کارگر از یکدیگر جدا هستند، که یعنی هر مفسر " +"وضعیت ران‌تایم خود را دارد و نمی‌تواند هیچ شیء تغییرپذیر یا داده دیگری را به" +" اشتراک بگذارد. هر مفسر دارای :term:`قفل سراسری مفسر ` خود است، که یعنی کدی که با این اجراکننده اجرا می‌شود، از موازی‌سازی " +"چندهسته‌ای واقعی برخوردار است." -msgid "The optional *initializer* and *initargs* arguments have the same meaning as for :class:`!ThreadPoolExecutor`: the initializer is run when each worker is created, though in this case it is run in the worker's interpreter. The executor serializes the *initializer* and *initargs* using :mod:`pickle` when sending them to the worker's interpreter." -msgstr "" +msgid "" +"The optional *initializer* and *initargs* arguments have the same meaning as" +" for :class:`!ThreadPoolExecutor`: the initializer is run when each worker " +"is created, though in this case it is run in the worker's interpreter. The " +"executor serializes the *initializer* and *initargs* using :mod:`pickle` " +"when sending them to the worker's interpreter." +msgstr "" +"آرگومان‌های اختیاری *initializer* و *initargs* همان معنایی را دارند که برای " +":class:`!ThreadPoolExecutor` دارند: initializer هنگام ایجاد هر کارگر اجرا " +"می‌شود، هرچند در این حالت در مفسر کارگر اجرا می‌شود. اجراکننده، " +"*initializer* و *initargs* را هنگام ارسال آن‌ها به مفسر کارگر با استفاده از " +":mod:`pickle` سریال‌سازی می‌کند." -msgid "The executor may replace uncaught exceptions from *initializer* with :class:`~concurrent.interpreters.ExecutionFailed`." +msgid "" +"The executor may replace uncaught exceptions from *initializer* with " +":class:`~concurrent.interpreters.ExecutionFailed`." msgstr "" +"اجراکننده ممکن است استثناهای گرفته‌نشده از *initializer* را با " +":class:`~concurrent.interpreters.ExecutionFailed` جایگزین کند." msgid "Other caveats from parent :class:`ThreadPoolExecutor` apply here." msgstr "" +"سایر نکات احتیاطی مربوط به کلاس والد :class:`ThreadPoolExecutor` در اینجا " +"نیز اعمال می‌شوند." -msgid ":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except the worker serializes the callable and arguments using :mod:`pickle` when sending them to its interpreter. The worker likewise serializes the return value when sending it back." +msgid "" +":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except " +"the worker serializes the callable and arguments using :mod:`pickle` when " +"sending them to its interpreter. The worker likewise serializes the return " +"value when sending it back." msgstr "" +":meth:`~Executor.submit` و :meth:`~Executor.map` مانند حالت عادی کار " +"می‌کنند، با این تفاوت که کارگر، شیء قابل فراخوانی و آرگومان‌ها را هنگام " +"ارسال آن‌ها به مفسر خود، با استفاده از :mod:`pickle` سریال‌سازی می‌کند. " +"کارگر نیز به همین ترتیب مقدار بازگشتی را هنگام بازگرداندن آن سریال‌سازی " +"می‌کند." -msgid "When a worker's current task raises an uncaught exception, the worker always tries to preserve the exception as-is. If that is successful then it also sets the ``__cause__`` to a corresponding :class:`~concurrent.interpreters.ExecutionFailed` instance, which contains a summary of the original exception. In the uncommon case that the worker is not able to preserve the original as-is then it directly preserves the corresponding :class:`~concurrent.interpreters.ExecutionFailed` instance instead." -msgstr "" +msgid "" +"When a worker's current task raises an uncaught exception, the worker always" +" tries to preserve the exception as-is. If that is successful then it also " +"sets the ``__cause__`` to a corresponding " +":class:`~concurrent.interpreters.ExecutionFailed` instance, which contains a" +" summary of the original exception. In the uncommon case that the worker is " +"not able to preserve the original as-is then it directly preserves the " +"corresponding :class:`~concurrent.interpreters.ExecutionFailed` instance " +"instead." +msgstr "" +"هنگامی که وظیفه فعلی یک کارگر یک استثنای گرفته‌نشده پرتاب می‌کند، کارگر " +"همیشه تلاش می‌کند استثنا را به‌همان‌صورت حفظ کند. اگر این کار موفقیت‌آمیز " +"باشد، ``__cause__`` را نیز به یک نمونه متناظر از " +":class:`~concurrent.interpreters.ExecutionFailed` تنظیم می‌کند که شامل " +"خلاصه‌ای از استثنای اصلی است. در حالت غیرمعمولی که کارگر نتواند استثنای اصلی" +" را به‌همان‌صورت حفظ کند، در عوض نمونه متناظر از " +":class:`~concurrent.interpreters.ExecutionFailed` را مستقیماً حفظ می‌کند." msgid "ProcessPoolExecutor" -msgstr "" +msgstr "ProcessPoolExecutor" -msgid "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that uses a pool of processes to execute calls asynchronously. :class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which allows it to side-step the :term:`Global Interpreter Lock ` but also means that only picklable objects can be executed and returned." -msgstr "" +msgid "" +"The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that" +" uses a pool of processes to execute calls asynchronously. " +":class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which " +"allows it to side-step the :term:`Global Interpreter Lock ` but also means that only picklable objects can be " +"executed and returned." +msgstr "" +"کلاس :class:`ProcessPoolExecutor` زیرکلاسی از :class:`Executor` است که از " +"استخری از فرایندها برای اجرای فراخوانی‌ها به‌صورت ناهمگام استفاده می‌کند. " +":class:`ProcessPoolExecutor` از ماژول :mod:`multiprocessing` استفاده می‌کند،" +" که به آن امکان می‌دهد از :term:`قفل سراسری مفسر ` " +"پیکل‌پذیر دور بزند، اما همچنین به این معناست که فقط اشیای (picklable) " +"می‌توانند اجرا و برگردانده شوند." -msgid "The ``__main__`` module must be importable by worker subprocesses. This means that :class:`ProcessPoolExecutor` will not work in the interactive interpreter." +msgid "" +"The ``__main__`` module must be importable by worker subprocesses. This " +"means that :class:`ProcessPoolExecutor` will not work in the interactive " +"interpreter." msgstr "" +"ماژول ``__main__`` باید توسط زیرفرایندهای کارگر قابل ایمپورت باشد. این " +"بدان معناست که :class:`ProcessPoolExecutor` در مفسر تعاملی کار نخواهد کرد." -msgid "Calling :class:`Executor` or :class:`Future` methods from a callable submitted to a :class:`ProcessPoolExecutor` will result in deadlock." +msgid "" +"Calling :class:`Executor` or :class:`Future` methods from a callable " +"submitted to a :class:`ProcessPoolExecutor` will result in deadlock." msgstr "" +"فراخوانی متدهای :class:`Executor` یا :class:`Future` از یک شیء قابل فراخوانی" +" (callable) که به :class:`ProcessPoolExecutor` ارسال‌شده است، منجر به بن‌بست" +" می‌شود." -msgid "Note that the restrictions on functions and arguments needing to picklable as per :class:`multiprocessing.Process` apply when using :meth:`~Executor.submit` and :meth:`~Executor.map` on a :class:`ProcessPoolExecutor`. A function defined in a REPL or a lambda should not be expected to work." -msgstr "" +msgid "" +"Note that the restrictions on functions and arguments needing to picklable " +"as per :class:`multiprocessing.Process` apply when using " +":meth:`~Executor.submit` and :meth:`~Executor.map` on a " +":class:`ProcessPoolExecutor`. A function defined in a REPL or a lambda " +"should not be expected to work." +msgstr "" +"توجه داشته باشید که محدودیت‌های مربوط به پیکل‌پذیری (picklable) بودن توابع و " +"آرگومان‌ها، مطابق :class:`multiprocessing.Process`، هنگام استفاده از " +":meth:`~Executor.submit` و :meth:`~Executor.map` بر روی " +":class:`ProcessPoolExecutor` اعمال می‌شوند. نباید انتظار داشته باشید که " +"تابعی که در یک REPL یا به‌صورت یک lambda تعریف شده است، کار کند." -msgid "An :class:`Executor` subclass that executes calls asynchronously using a pool of at most *max_workers* processes. If *max_workers* is ``None`` or not given, it will default to :func:`os.process_cpu_count`. If *max_workers* is less than or equal to ``0``, then a :exc:`ValueError` will be raised. On Windows, *max_workers* must be less than or equal to ``61``. If it is not then :exc:`ValueError` will be raised. If *max_workers* is ``None``, then the default chosen will be at most ``61``, even if more processors are available. *mp_context* can be a :mod:`multiprocessing` context or ``None``. It will be used to launch the workers. If *mp_context* is ``None`` or not given, the default :mod:`multiprocessing` context is used. See :ref:`multiprocessing-start-methods`." -msgstr "" +msgid "" +"An :class:`Executor` subclass that executes calls asynchronously using a " +"pool of at most *max_workers* processes. If *max_workers* is ``None`` or " +"not given, it will default to :func:`os.process_cpu_count`. If *max_workers*" +" is less than or equal to ``0``, then a :exc:`ValueError` will be raised. On" +" Windows, *max_workers* must be less than or equal to ``61``. If it is not " +"then :exc:`ValueError` will be raised. If *max_workers* is ``None``, then " +"the default chosen will be at most ``61``, even if more processors are " +"available. *mp_context* can be a :mod:`multiprocessing` context or ``None``." +" It will be used to launch the workers. If *mp_context* is ``None`` or not " +"given, the default :mod:`multiprocessing` context is used. See " +":ref:`multiprocessing-start-methods`." +msgstr "" +"یک کلاس فرعی از :class:`Executor` که فراخوانی‌ها را به‌صورت ناهمگام با " +"استفاده از استخری از حداکثر *max_workers* فرآیند اجرا می‌کند. اگر " +"*max_workers* برابر ``None`` باشد یا داده نشود، مقدار پیش‌فرض آن " +":func:`os.process_cpu_count` خواهد بود. اگر *max_workers* کمتر یا مساوی با " +"``0`` باشد، یک :exc:`ValueError` پرتاب خواهد شد. در ویندوز، *max_workers* " +"باید کمتر یا مساوی با ``61`` باشد. در غیر این صورت، :exc:`ValueError` پرتاب " +"خواهد شد. اگر *max_workers* برابر ``None`` باشد، مقدار پیش‌فرض انتخاب‌شده " +"حداکثر ``61`` خواهد بود، حتی اگر پردازنده‌های بیشتری در دسترس باشند. " +"*mp_context* می‌تواند یک زمینه :mod:`multiprocessing` یا ``None`` باشد. از " +"آن برای راه‌اندازی کارگرها استفاده خواهد شد. اگر *mp_context* برابر " +"``None`` باشد یا داده نشود، از زمینه پیش‌فرض :mod:`multiprocessing` استفاده " +"می‌شود. :ref:`multiprocessing-start-methods` را ببینید." -msgid "*initializer* is an optional callable that is called at the start of each worker process; *initargs* is a tuple of arguments passed to the initializer. Should *initializer* raise an exception, all currently pending jobs will raise a :exc:`~concurrent.futures.process.BrokenProcessPool`, as well as any attempt to submit more jobs to the pool." -msgstr "" +msgid "" +"*initializer* is an optional callable that is called at the start of each " +"worker process; *initargs* is a tuple of arguments passed to the " +"initializer. Should *initializer* raise an exception, all currently pending" +" jobs will raise a :exc:`~concurrent.futures.process.BrokenProcessPool`, as " +"well as any attempt to submit more jobs to the pool." +msgstr "" +"*initializer* یک فراخوان‌پذیر اختیاری است که در آغاز هر فرایند کارگر " +"فراخوانی می‌شود؛ *initargs* تاپلی از آرگومان‌های ارسال‌شده به initializer " +"است. اگر *initializer* استثنایی پرتاب کند، تمام کارهای در انتظار فعلی و " +"همچنین هر تلاشی برای ارسال کارهای بیشتر به استخر، " +":exc:`~concurrent.futures.process.BrokenProcessPool` را پرتاب خواهند کرد." -msgid "*max_tasks_per_child* is an optional argument that specifies the maximum number of tasks a single process can execute before it will exit and be replaced with a fresh worker process. By default *max_tasks_per_child* is ``None`` which means worker processes will live as long as the pool. When a max is specified, the \"spawn\" multiprocessing start method will be used by default in absence of a *mp_context* parameter. This feature is incompatible with the \"fork\" start method." -msgstr "" +msgid "" +"*max_tasks_per_child* is an optional argument that specifies the maximum " +"number of tasks a single process can execute before it will exit and be " +"replaced with a fresh worker process. By default *max_tasks_per_child* is " +"``None`` which means worker processes will live as long as the pool. When a " +"max is specified, the \"spawn\" multiprocessing start method will be used by" +" default in absence of a *mp_context* parameter. This feature is " +"incompatible with the \"fork\" start method." +msgstr "" +"*max_tasks_per_child* یک آرگومان اختیاری است که حداکثر تعداد تسک‌هایی را مشخص " +"می‌کند که یک فرایند واحد می‌تواند پیش از خروج و جایگزینی با یک فرایند کارگر " +"تازه اجرا کند. به‌طور پیش‌فرض *max_tasks_per_child* برابر ``None`` است، به " +"این معنا که فرایندهای کارگر تا زمانی که استخر وجود دارد زنده می‌مانند. " +"هرگاه یک مقدار حداکثری مشخص شود، در نبود پارامتر *mp_context*، روش شروع " +"چندپردازشی \"spawn\" به‌طور پیش‌فرض استفاده می‌شود. این قابلیت با روش شروع " +"\"fork\" ناسازگار است." -msgid "When one of the worker processes terminates abruptly, a :exc:`~concurrent.futures.process.BrokenProcessPool` error is now raised. Previously, behaviour was undefined but operations on the executor or its futures would often freeze or deadlock." +msgid "" +"When one of the worker processes terminates abruptly, a " +":exc:`~concurrent.futures.process.BrokenProcessPool` error is now raised. " +"Previously, behaviour was undefined but operations on the executor or its " +"futures would often freeze or deadlock." msgstr "" +"هنگامی که یکی از فرایندهای کارگر به‌طور ناگهانی خاتمه یابد، اکنون یک خطای " +":exc:`~concurrent.futures.process.BrokenProcessPool` پرتاب می‌شود. پیش‌تر، " +"رفتار تعریف‌نشده بود، اما عملیات‌ها روی اجراکننده (executor) یا آینده‌نماهای " +"(futures) آن اغلب قفل می‌شدند یا به بن‌بست می‌رسیدند." -msgid "The *mp_context* argument was added to allow users to control the start_method for worker processes created by the pool." +msgid "" +"The *mp_context* argument was added to allow users to control the " +"start_method for worker processes created by the pool." msgstr "" +"آرگومان *mp_context* افزوده شد تا کاربران بتوانند start_method را برای " +"فرایندهای کارگر ایجادشده توسط استخر کنترل کنند." -msgid "The *max_tasks_per_child* argument was added to allow users to control the lifetime of workers in the pool." +msgid "" +"The *max_tasks_per_child* argument was added to allow users to control the " +"lifetime of workers in the pool." msgstr "" +"آرگومان *max_tasks_per_child* افزوده شد تا کاربران بتوانند طول عمر کارگران " +"استخر را کنترل کنند." -msgid "On POSIX systems, if your application has multiple threads and the :mod:`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os.fork` function called internally to spawn workers may raise a :exc:`DeprecationWarning`. Pass a *mp_context* configured to use a different start method. See the :func:`os.fork` documentation for further explanation." -msgstr "" +msgid "" +"On POSIX systems, if your application has multiple threads and the " +":mod:`multiprocessing` context uses the ``\"fork\"`` start method: The " +":func:`os.fork` function called internally to spawn workers may raise a " +":exc:`DeprecationWarning`. Pass a *mp_context* configured to use a different" +" start method. See the :func:`os.fork` documentation for further " +"explanation." +msgstr "" +"در سیستم‌های POSIX، اگر برنامه شما چندین نخ دارد و زمینه‌ی " +":mod:`multiprocessing` از روش شروع ``\"fork\"`` استفاده می‌کند: تابع " +":func:`os.fork` که به‌صورت داخلی برای ایجاد کارگرها فراخوانی می‌شود، ممکن " +"است یک :exc:`DeprecationWarning` پرتاب کند. یک *mp_context* را که برای " +"استفاده از یک روش شروع متفاوت پیکربندی شده است، ارسال کنید. برای توضیح " +"بیشتر، مستندات :func:`os.fork` را ببینید." -msgid "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:`os.cpu_count`." +msgid "" +"*max_workers* uses :func:`os.process_cpu_count` by default, instead of " +":func:`os.cpu_count`." msgstr "" +"*max_workers* به‌طور پیش‌فرض به‌جای :func:`os.cpu_count " +"` از :func:`os.process_cpu_count ` " +"استفاده می‌کند." -msgid "The default process start method (see :ref:`multiprocessing-start-methods`) changed away from *fork*. If you require the *fork* start method for :class:`ProcessPoolExecutor` you must explicitly pass ``mp_context=multiprocessing.get_context(\"fork\")``." +msgid "" +"The default process start method (see :ref:`multiprocessing-start-methods`) " +"changed away from *fork*. If you require the *fork* start method for " +":class:`ProcessPoolExecutor` you must explicitly pass " +"``mp_context=multiprocessing.get_context(\"fork\")``." msgstr "" +"متد پیش‌فرض شروع فرایند (به :ref:`multiprocessing-start-methods` مراجعه " +"کنید) از *fork* تغییر کرده است. اگر به متد شروع *fork* برای " +":class:`ProcessPoolExecutor` نیاز دارید، باید به‌صراحت " +"``mp_context=multiprocessing.get_context(\"fork\")`` را ارسال کنید." -msgid "Fixed a deadlock (:gh:`115634`) where the executor could hang after a worker process exited upon reaching its *max_tasks_per_child* limit while tasks remained queued." +msgid "" +"Fixed a deadlock (:gh:`115634`) where the executor could hang after a worker" +" process exited upon reaching its *max_tasks_per_child* limit while tasks " +"remained queued." msgstr "" +"بن‌بستی (:gh:`115634`) برطرف شد که در آن اجراکننده ممکن بود پس از خروج یک " +"فرایند کارگر در اثر رسیدن به حد *max_tasks_per_child*، در حالی که تسک‌هایی در " +"صف باقی مانده بودند، معلق بماند." -msgid "Attempt to terminate all living worker processes immediately by calling :meth:`Process.terminate ` on each of them. Internally, it will also call :meth:`Executor.shutdown` to ensure that all other resources associated with the executor are freed." +msgid "" +"Attempt to terminate all living worker processes immediately by calling " +":meth:`Process.terminate ` on each of " +"them. Internally, it will also call :meth:`Executor.shutdown` to ensure that" +" all other resources associated with the executor are freed." msgstr "" +"تلاش می‌کند تا با فراخوانی :meth:`Process.terminate " +"` روی هر یک از آن‌ها، بلافاصله تمام " +"فرایندهای کارگر زنده را خاتمه دهد. در داخل، :meth:`Executor.shutdown` را " +"نیز فراخوانی می‌کند تا اطمینان حاصل شود که تمام منابع دیگر مرتبط با " +"اجراکننده آزاد شده‌اند." -msgid "After calling this method the caller should no longer submit tasks to the executor." +msgid "" +"After calling this method the caller should no longer submit tasks to the " +"executor." msgstr "" +"پس از فراخوانی این متد، فراخواننده دیگر نباید تسک‌هایی را به اجراکننده " +"(executor) ارسال کند." -msgid "Attempt to kill all living worker processes immediately by calling :meth:`Process.kill ` on each of them. Internally, it will also call :meth:`Executor.shutdown` to ensure that all other resources associated with the executor are freed." +msgid "" +"Attempt to kill all living worker processes immediately by calling " +":meth:`Process.kill ` on each of them. " +"Internally, it will also call :meth:`Executor.shutdown` to ensure that all " +"other resources associated with the executor are freed." msgstr "" +"تلاش می‌کند تمام فرآیندهای کارگر زنده را بلافاصله با فراخوانی " +":meth:`Process.kill ` برای هر یک از آن‌ها از " +"بین ببرد. به‌صورت داخلی، همچنین :meth:`Executor.shutdown` را نیز فراخوانی " +"می‌کند تا اطمینان حاصل شود که همه منابع دیگر مرتبط با اجراکننده آزاد " +"می‌شوند." msgid "ProcessPoolExecutor Example" -msgstr "" +msgstr "مثال ProcessPoolExecutor" msgid "" "import concurrent.futures\n" @@ -342,138 +872,372 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import concurrent.futures\n" +"import math\n" +"\n" +"PRIMES = [\n" +" 112272535095293,\n" +" 112582705942171,\n" +" 112272535095293,\n" +" 115280095190773,\n" +" 115797848077099,\n" +" 1099726899285419]\n" +"\n" +"def is_prime(n):\n" +" if n < 2:\n" +" return False\n" +" if n == 2:\n" +" return True\n" +" if n % 2 == 0:\n" +" return False\n" +"\n" +" sqrt_n = int(math.floor(math.sqrt(n)))\n" +" for i in range(3, sqrt_n + 1, 2):\n" +" if n % i == 0:\n" +" return False\n" +" return True\n" +"\n" +"def main():\n" +" with concurrent.futures.ProcessPoolExecutor() as executor:\n" +" for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):\n" +" print('%d is prime: %s' % (number, prime))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" msgid "Future Objects" -msgstr "" +msgstr "اشیای Future" -msgid "The :class:`Future` class encapsulates the asynchronous execution of a callable. :class:`Future` instances are created by :meth:`Executor.submit`." +msgid "" +"The :class:`Future` class encapsulates the asynchronous execution of a " +"callable. :class:`Future` instances are created by :meth:`Executor.submit`." msgstr "" +"کلاس :class:`Future` اجرای ناهمگام یک شیء فراخوان‌پذیر را در بر می‌گیرد. " +"نمونه‌های :class:`Future` توسط :meth:`Executor.submit` ایجاد می‌شوند." -msgid "Encapsulates the asynchronous execution of a callable. :class:`Future` instances are created by :meth:`Executor.submit` and should not be created directly except for testing." +msgid "" +"Encapsulates the asynchronous execution of a callable. :class:`Future` " +"instances are created by :meth:`Executor.submit` and should not be created " +"directly except for testing." msgstr "" +"اجرای ناهمگام یک فراخواندنی را کپسوله می‌کند. نمونه‌های :class:`Future` توسط" +" :meth:`Executor.submit` ایجاد می‌شوند و نباید به‌صورت مستقیم ایجاد شوند، " +"مگر برای آزمون." -msgid "Attempt to cancel the call. If the call is currently being executed or finished running and cannot be cancelled then the method will return ``False``, otherwise the call will be cancelled and the method will return ``True``." +msgid "" +"Attempt to cancel the call. If the call is currently being executed or " +"finished running and cannot be cancelled then the method will return " +"``False``, otherwise the call will be cancelled and the method will return " +"``True``." msgstr "" +"برای لغو فراخوانی تلاش می‌کند. اگر فراخوانی در حال اجرا باشد یا اجرای آن به " +"پایان رسیده باشد و نتوان آن را لغو کرد، متد ``False`` را برمی‌گرداند، در غیر" +" این صورت فراخوانی لغو می‌شود و متد ``True`` را برمی‌گرداند." msgid "Return ``True`` if the call was successfully cancelled." -msgstr "" +msgstr "اگر فراخوانی با موفقیت لغو شده باشد، ``True`` برگردانده می‌شود." -msgid "Return ``True`` if the call is currently being executed and cannot be cancelled." +msgid "" +"Return ``True`` if the call is currently being executed and cannot be " +"cancelled." msgstr "" +"اگر فراخوانی در حال حاضر در حال اجرا باشد و قابل لغو نباشد، ``True`` را " +"برمی‌گرداند." -msgid "Return ``True`` if the call was successfully cancelled or finished running." +msgid "" +"Return ``True`` if the call was successfully cancelled or finished running." msgstr "" +"اگر فراخوانی با موفقیت لغو شد یا اجرای آن به پایان رسید، ``True`` را " +"برمی‌گرداند." -msgid "Return the value returned by the call. If the call hasn't yet completed then this method will wait up to *timeout* seconds. If the call hasn't completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time." -msgstr "" +msgid "" +"Return the value returned by the call. If the call hasn't yet completed then" +" this method will wait up to *timeout* seconds. If the call hasn't " +"completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. " +"*timeout* can be an int or float. If *timeout* is not specified or " +"``None``, there is no limit to the wait time." +msgstr "" +"مقدار برگردانده‌شده از فراخوانی را برمی‌گرداند. اگر فراخوانی هنوز به پایان " +"نرسیده باشد، این متد حداکثر به مدت *timeout* ثانیه منتظر می‌ماند. اگر " +"فراخوانی ظرف *timeout* ثانیه به پایان نرسد، استثنای :exc:`TimeoutError` " +"پرتاب می‌شود. *timeout* می‌تواند int یا float باشد. اگر *timeout* مشخص نشده " +"باشد یا ``None`` باشد، محدودیتی برای زمان انتظار وجود ندارد." -msgid "If the future is cancelled before completing then :exc:`.CancelledError` will be raised." +msgid "" +"If the future is cancelled before completing then :exc:`.CancelledError` " +"will be raised." msgstr "" +"اگر فیوچر (future) پیش از تکمیل لغو شود، :exc:`.CancelledError` پرتاب " +"می‌شود." -msgid "If the call raised an exception, this method will raise the same exception." +msgid "" +"If the call raised an exception, this method will raise the same exception." msgstr "" +"اگر فراخوانی استثنایی را پرتاب کرد، این متد همان استثنا را پرتاب خواهد کرد." -msgid "Return the exception raised by the call. If the call hasn't yet completed then this method will wait up to *timeout* seconds. If the call hasn't completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time." -msgstr "" +msgid "" +"Return the exception raised by the call. If the call hasn't yet completed " +"then this method will wait up to *timeout* seconds. If the call hasn't " +"completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. " +"*timeout* can be an int or float. If *timeout* is not specified or " +"``None``, there is no limit to the wait time." +msgstr "" +"استثنای پرتاب‌شده توسط فراخوانی را بازمی‌گرداند. اگر فراخوانی هنوز کامل نشده" +" باشد، این متد حداکثر تا *timeout* ثانیه صبر می‌کند. اگر فراخوانی ظرف " +"*timeout* ثانیه کامل نشود، یک :exc:`TimeoutError` پرتاب خواهد شد. *timeout* " +"می‌تواند int یا float باشد. اگر *timeout* مشخص نشده باشد یا ``None`` باشد، " +"محدودیتی برای زمان انتظار وجود ندارد." msgid "If the call completed without raising, ``None`` is returned." msgstr "" +"اگر فراخوانی بدون پرتاب استثنا به پایان برسد، ``None`` برگردانده می‌شود." -msgid "Attaches the callable *fn* to the future. *fn* will be called, with the future as its only argument, when the future is cancelled or finishes running." +msgid "" +"Attaches the callable *fn* to the future. *fn* will be called, with the " +"future as its only argument, when the future is cancelled or finishes " +"running." msgstr "" +"*fn* قابل فراخوانی را به آینده (future) متصل می‌کند. هنگامی که future لغو " +"شود یا اجرای آن به پایان برسد، *fn* با future به‌عنوان تنها آرگومان خود " +"فراخوانی می‌شود." -msgid "Added callables are called in the order that they were added and are always called in a thread belonging to the process that added them. If the callable raises an :exc:`Exception` subclass, it will be logged and ignored. If the callable raises a :exc:`BaseException` subclass, the behavior is undefined." -msgstr "" +msgid "" +"Added callables are called in the order that they were added and are always " +"called in a thread belonging to the process that added them. If the " +"callable raises an :exc:`Exception` subclass, it will be logged and ignored." +" If the callable raises a :exc:`BaseException` subclass, the behavior is " +"undefined." +msgstr "" +"فراخوان‌پذیرهای افزوده‌شده به ترتیبی که افزوده شده‌اند فراخوانی می‌شوند و " +"همیشه در نخی متعلق به فرایندی که آن‌ها را افزوده است فراخوانی می‌شوند. اگر " +"فراخوان‌پذیر زیرکلاسی از :exc:`Exception` را پرتاب کند، ثبت و نادیده گرفته " +"می‌شود. اگر فراخوان‌پذیر زیرکلاسی از :exc:`BaseException` را پرتاب کند، " +"رفتار تعریف‌نشده است." -msgid "If the future has already completed or been cancelled, *fn* will be called immediately." +msgid "" +"If the future has already completed or been cancelled, *fn* will be called " +"immediately." msgstr "" +"اگر فیوچر (future) از قبل تکمیل شده یا لغو شده باشد، *fn* بلافاصله فراخوانی " +"خواهد شد." -msgid "The following :class:`Future` methods are meant for use in unit tests and :class:`Executor` implementations." +msgid "" +"The following :class:`Future` methods are meant for use in unit tests and " +":class:`Executor` implementations." msgstr "" +"متدهای زیر از :class:`Future` برای استفاده در آزمون واحد‌ها و پیاده‌سازی‌های " +":class:`Executor` در نظر گرفته شده‌اند." -msgid "This method should only be called by :class:`Executor` implementations before executing the work associated with the :class:`Future` and by unit tests." +msgid "" +"This method should only be called by :class:`Executor` implementations " +"before executing the work associated with the :class:`Future` and by unit " +"tests." msgstr "" +"این متد باید فقط توسط پیاده‌سازی‌های :class:`Executor` پیش از اجرای کار " +"مرتبط با :class:`Future` و توسط آزمون واحد‌ها فراخوانی شود." -msgid "If the method returns ``False`` then the :class:`Future` was cancelled, i.e. :meth:`Future.cancel` was called and returned ``True``. Any threads waiting on the :class:`Future` completing (i.e. through :func:`as_completed` or :func:`wait`) will be woken up." +msgid "" +"If the method returns ``False`` then the :class:`Future` was cancelled, i.e." +" :meth:`Future.cancel` was called and returned ``True``. Any threads " +"waiting on the :class:`Future` completing (i.e. through :func:`as_completed`" +" or :func:`wait`) will be woken up." msgstr "" +"اگر متد ``False`` را برگرداند، آنگاه :class:`Future` لغو شده است، یعنی " +":meth:`Future.cancel` فراخوانی شده و ``True`` را برگردانده است. تمام نخ‌هایی" +" که در انتظار تکمیل :class:`Future` هستند (یعنی از طریق :func:`as_completed`" +" یا :func:`wait`) بیدار خواهند شد." -msgid "If the method returns ``True`` then the :class:`Future` was not cancelled and has been put in the running state, i.e. calls to :meth:`Future.running` will return ``True``." +msgid "" +"If the method returns ``True`` then the :class:`Future` was not cancelled " +"and has been put in the running state, i.e. calls to :meth:`Future.running` " +"will return ``True``." msgstr "" +"اگر متد ``True`` را برگرداند، :class:`Future` لغو نشده و در وضعیت در حال " +"اجرا قرار گرفته است، یعنی فراخوانی‌های :meth:`Future.running` مقدار ``True``" +" را برمی‌گردانند." -msgid "This method can only be called once and cannot be called after :meth:`Future.set_result` or :meth:`Future.set_exception` have been called." +msgid "" +"This method can only be called once and cannot be called after " +":meth:`Future.set_result` or :meth:`Future.set_exception` have been called." msgstr "" +"این متد فقط یک بار قابل فراخوانی است و پس از فراخوانی " +":meth:`Future.set_result` یا :meth:`Future.set_exception` نمی‌تواند فراخوانی" +" شود." -msgid "Sets the result of the work associated with the :class:`Future` to *result*." -msgstr "" +msgid "" +"Sets the result of the work associated with the :class:`Future` to *result*." +msgstr "نتیجه‌ی کار مرتبط با :class:`Future` را برابر *result* قرار می‌دهد." -msgid "This method should only be used by :class:`Executor` implementations and unit tests." +msgid "" +"This method should only be used by :class:`Executor` implementations and " +"unit tests." msgstr "" +"این متد باید فقط توسط پیاده‌سازی‌های :class:`Executor` و آزمون واحد‌ها مورد " +"استفاده قرار گیرد." -msgid "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:`Future` is already done." +msgid "" +"This method raises :exc:`concurrent.futures.InvalidStateError` if the " +":class:`Future` is already done." msgstr "" +"این متد در صورتی که :class:`Future` از قبل انجام شده باشد، " +":exc:`concurrent.futures.InvalidStateError` را پرتاب می‌کند." -msgid "Sets the result of the work associated with the :class:`Future` to the :class:`Exception` *exception*." +msgid "" +"Sets the result of the work associated with the :class:`Future` to the " +":class:`Exception` *exception*." msgstr "" +"نتیجه‌ی کار مرتبط با :class:`Future` را برابر با :class:`Exception` " +"*exception* قرار می‌دهد." msgid "Module Functions" -msgstr "" +msgstr "توابع ماژول" -msgid "Wait for the :class:`Future` instances (possibly created by different :class:`Executor` instances) given by *fs* to complete. Duplicate futures given to *fs* are removed and will be returned only once. Returns a named 2-tuple of sets. The first set, named ``done``, contains the futures that completed (finished or cancelled futures) before the wait completed. The second set, named ``not_done``, contains the futures that did not complete (pending or running futures)." -msgstr "" +msgid "" +"Wait for the :class:`Future` instances (possibly created by different " +":class:`Executor` instances) given by *fs* to complete. Duplicate futures " +"given to *fs* are removed and will be returned only once. Returns a named " +"2-tuple of sets. The first set, named ``done``, contains the futures that " +"completed (finished or cancelled futures) before the wait completed. The " +"second set, named ``not_done``, contains the futures that did not complete " +"(pending or running futures)." +msgstr "" +"منتظر بمانید تا نمونه‌های :class:`Future` داده‌شده توسط *fs* (که ممکن است " +"توسط نمونه‌های مختلف :class:`Executor` ایجاد شده باشند) کامل شوند. آینده‌نماهای" +" تکراری داده‌شده به *fs* حذف می‌شوند و تنها یک بار برگردانده خواهند شد. یک " +"تاپل دوتایی نام‌دار از مجموعه‌ها برمی‌گرداند. مجموعه اول، که ``done`` نام " +"دارد، شامل آینده‌نماهایی است که پیش از کامل شدن انتظار، کامل شده‌اند (آینده‌نماهای" +" تمام‌شده یا لغوشده). مجموعه دوم، که ``not_done`` نام دارد، شامل آینده‌نماهایی " +"است که کامل نشده‌اند (آینده‌نماهای در انتظار یا در حال اجرا)." -msgid "*timeout* can be used to control the maximum number of seconds to wait before returning. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time." +msgid "" +"*timeout* can be used to control the maximum number of seconds to wait " +"before returning. *timeout* can be an int or float. If *timeout* is not " +"specified or ``None``, there is no limit to the wait time." msgstr "" +"می‌توان از *timeout* برای کنترل حداکثر تعداد ثانیه‌های انتظار پیش از بازگشت " +"استفاده کرد. *timeout* می‌تواند یک int یا float باشد. اگر *timeout* مشخص " +"نشده باشد یا ``None`` باشد، محدودیتی برای زمان انتظار وجود ندارد." -msgid "*return_when* indicates when this function should return. It must be one of the following constants:" +msgid "" +"*return_when* indicates when this function should return. It must be one of" +" the following constants:" msgstr "" +"*return_when* مشخص می‌کند که این تابع چه زمانی باید بازگشت کند. این مقدار " +"باید یکی از ثابت‌های زیر باشد:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Description" -msgstr "" +msgstr "توضیحات" msgid "The function will return when any future finishes or is cancelled." -msgstr "" +msgstr "تابع زمانی برمی‌گردد که هر آینده (future) به پایان برسد یا لغو شود." -msgid "The function will return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to :const:`ALL_COMPLETED`." +msgid "" +"The function will return when any future finishes by raising an exception. " +"If no future raises an exception then it is equivalent to " +":const:`ALL_COMPLETED`." msgstr "" +"این تابع هنگامی بازگشت خواهد کرد که هر فیوچری (future) با پرتاب استثنا به " +"پایان برسد. اگر هیچ فیوچری استثنایی پرتاب نکند، معادل :const:`ALL_COMPLETED`" +" است." msgid "The function will return when all futures finish or are cancelled." msgstr "" +"تابع زمانی بازمی‌گردد که همه‌ی آینده‌نماها (futures) به پایان برسند یا لغو شوند." -msgid "Returns an iterator over the :class:`Future` instances (possibly created by different :class:`Executor` instances) given by *fs* that yields futures as they complete (finished or cancelled futures). Any futures given by *fs* that are duplicated will be returned once. Any futures that completed before :func:`as_completed` is called will be yielded first. The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is called and the result isn't available after *timeout* seconds from the original call to :func:`as_completed`. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time." -msgstr "" +msgid "" +"Returns an iterator over the :class:`Future` instances (possibly created by " +"different :class:`Executor` instances) given by *fs* that yields futures as " +"they complete (finished or cancelled futures). Any futures given by *fs* " +"that are duplicated will be returned once. Any futures that completed before" +" :func:`as_completed` is called will be yielded first. The returned " +"iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is " +"called and the result isn't available after *timeout* seconds from the " +"original call to :func:`as_completed`. *timeout* can be an int or float. If" +" *timeout* is not specified or ``None``, there is no limit to the wait time." +msgstr "" +"پیمایش‌گری بر روی نمونه‌های :class:`Future` داده‌شده توسط *fs* (که ممکن است " +"توسط نمونه‌های مختلف :class:`Executor` ایجادشده باشند) برمی‌گرداند که " +"Futureها را به‌محض کامل‌شدن (Futureهای تمام‌شده یا لغوشده) تولید می‌کند. " +"هر Future داده‌شده توسط *fs* که تکراری باشد، تنها یک بار برگردانده می‌شود. " +"هر Future که پیش از فراخوانی :func:`as_completed` کامل‌شده باشد، ابتدا تولید" +" می‌شود. پیمایش‌گر برگردانده‌شده در صورتی یک :exc:`TimeoutError` پرتاب می‌کند " +"که :meth:`~iterator.__next__` فراخوانی شود و نتیجه پس از *timeout* ثانیه از " +"فراخوانی اصلی :func:`as_completed` در دسترس نباشد. *timeout* می‌تواند یک int" +" یا float باشد. اگر *timeout* تعیین‌نشده باشد یا ``None`` باشد، محدودیتی " +"برای زمان انتظار وجود ندارد." msgid ":pep:`3148` -- futures - execute computations asynchronously" -msgstr "" +msgstr ":pep:`3148` -- آینده‌نماها (futures) - اجرای محاسبات به‌صورت ناهمگام" -msgid "The proposal which described this feature for inclusion in the Python standard library." +msgid "" +"The proposal which described this feature for inclusion in the Python " +"standard library." msgstr "" +"پیشنهادی که این قابلیت را برای گنجاندن در کتابخانه استاندارد پایتون توصیف " +"می‌کرد." msgid "Exception classes" -msgstr "" +msgstr "کلاس‌های استثنا" msgid "Raised when a future is cancelled." -msgstr "" +msgstr "هنگامی که یک آینده (future) لغو می‌شود، پرتاب می‌شود." -msgid "A deprecated alias of :exc:`TimeoutError`, raised when a future operation exceeds the given timeout." +msgid "" +"A deprecated alias of :exc:`TimeoutError`, raised when a future operation " +"exceeds the given timeout." msgstr "" +"یک نام مستعار منسوخ‌شده از :exc:`TimeoutError` است که هنگامی که یک عملیات " +"آتی از مهلت زمانی داده‌شده فراتر برود، پرتاب می‌شود." msgid "This class was made an alias of :exc:`TimeoutError`." -msgstr "" +msgstr "این کلاس به نام مستعاری برای :exc:`TimeoutError` تبدیل شد." -msgid "Derived from :exc:`RuntimeError`, this exception class is raised when an executor is broken for some reason, and cannot be used to submit or execute new tasks." +msgid "" +"Derived from :exc:`RuntimeError`, this exception class is raised when an " +"executor is broken for some reason, and cannot be used to submit or execute " +"new tasks." msgstr "" +"این کلاس استثنا که از :exc:`RuntimeError` مشتق شده است، زمانی پرتاب می‌شود " +"که یک اجراکننده (executor) به دلیلی خراب شده باشد و نتوان از آن برای ارسال " +"یا اجرای وظایف جدید استفاده کرد." -msgid "Raised when an operation is performed on a future that is not allowed in the current state." +msgid "" +"Raised when an operation is performed on a future that is not allowed in the" +" current state." msgstr "" +"زمانی پرتاب می‌شود که یک عملیات غیرمجاز در وضعیت فعلی روی یک future انجام " +"شود." -msgid "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class is raised when one of the workers of a :class:`~concurrent.futures.ThreadPoolExecutor` has failed initializing." +msgid "" +"Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class" +" is raised when one of the workers of a " +":class:`~concurrent.futures.ThreadPoolExecutor` has failed initializing." msgstr "" +"این کلاس استثنا که از :exc:`~concurrent.futures.BrokenExecutor` مشتق شده " +"است، زمانی پرتاب می‌شود که یکی از کارگرهای " +":class:`~concurrent.futures.ThreadPoolExecutor` در راه‌اندازی ناموفق باشد." -msgid "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this exception class is raised when one of the workers of a :class:`~concurrent.futures.InterpreterPoolExecutor` has failed initializing." +msgid "" +"Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " +"exception class is raised when one of the workers of a " +":class:`~concurrent.futures.InterpreterPoolExecutor` has failed " +"initializing." msgstr "" +"این کلاس استثنا، مشتق از :exc:`~concurrent.futures.thread.BrokenThreadPool`،" +" زمانی پرتاب می‌شود که یکی از کارگرهای " +":class:`~concurrent.futures.InterpreterPoolExecutor` در راه‌اندازی ناموفق " +"بوده باشد." -msgid "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:`RuntimeError`), this exception class is raised when one of the workers of a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-clean fashion (for example, if it was killed from the outside)." -msgstr "" +msgid "" +"Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly " +":exc:`RuntimeError`), this exception class is raised when one of the workers" +" of a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a " +"non-clean fashion (for example, if it was killed from the outside)." +msgstr "" +"این کلاس استثنا از :exc:`~concurrent.futures.BrokenExecutor` (پیش‌تر " +":exc:`RuntimeError`) مشتق شده است و زمانی پرتاب می‌شود که یکی از کارگرهای " +":class:`~concurrent.futures.ProcessPoolExecutor` به‌صورت غیرپاکیزه خاتمه " +"یافته باشد (برای مثال، اگر از بیرون کشته شده باشد)." diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po index 0708e6b92..e1c58cd6a 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -19,263 +19,504 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -msgid ":mod:`!concurrent.interpreters` --- Multiple interpreters in the same process" -msgstr "" +msgid "" +":mod:`!concurrent.interpreters` --- Multiple interpreters in the same " +"process" +msgstr ":mod:`!concurrent.interpreters` --- چندین مفسر در یک فرایند واحد" msgid "**Source code:** :source:`Lib/concurrent/interpreters`" -msgstr "" +msgstr ":source:`Lib/concurrent/interpreters`" -msgid "The :mod:`!concurrent.interpreters` module constructs higher-level interfaces on top of the lower level :mod:`!_interpreters` module." +msgid "" +"The :mod:`!concurrent.interpreters` module constructs higher-level " +"interfaces on top of the lower level :mod:`!_interpreters` module." msgstr "" +"ماژول :mod:`!concurrent.interpreters` رابط‌های سطح بالاتر را بر فراز ماژول " +"سطح پایین‌تر :mod:`!_interpreters` ایجاد می‌کند." -msgid "The module is primarily meant to provide a basic API for managing interpreters (AKA \"subinterpreters\") and running things in them. Running mostly involves switching to an interpreter (in the current thread) and calling a function in that execution context." +msgid "" +"The module is primarily meant to provide a basic API for managing " +"interpreters (AKA \"subinterpreters\") and running things in them. Running " +"mostly involves switching to an interpreter (in the current thread) and " +"calling a function in that execution context." msgstr "" +"این ماژول عمدتاً برای ارائه یک API پایه برای مدیریت مفسرها (معروف به " +"«subinterpreters») و اجرای موارد در آن‌ها در نظر گرفته شده است. اجرا عمدتاً " +"شامل انتقال به یک مفسر (در نخ جاری) و فراخوانی یک تابع در آن زمینه اجرا است." -msgid "For concurrency, interpreters themselves (and this module) don't provide much more than isolation, which on its own isn't useful. Actual concurrency is available separately through :mod:`threads ` -- see `below `_." +msgid "" +"For concurrency, interpreters themselves (and this module) don't provide " +"much more than isolation, which on its own isn't useful. Actual concurrency " +"is available separately through :mod:`threads ` -- see `below " +"`_." msgstr "" +"برای همروندی، خود مفسرها (و این ماژول) چیز چندانی بیشتر از جداسازی فراهم " +"نمی‌کنند، که به‌تنهایی مفید نیست. همروندی واقعی به‌صورت جداگانه از طریق " +":mod:`نخ‌ها ` در دسترس است -- `پایین `_ را " +"ببینید." msgid ":class:`~concurrent.futures.InterpreterPoolExecutor`" -msgstr "" +msgstr ":class:`~concurrent.futures.InterpreterPoolExecutor`" msgid "Combines threads with interpreters in a familiar interface." -msgstr "" +msgstr "نخ‌ها را با مفسرها در یک رابط آشنا ترکیب می‌کند." msgid ":ref:`isolating-extensions-howto`" -msgstr "" +msgstr ":ref:`isolating-extensions-howto`" msgid "How to update an extension module to support multiple interpreters." -msgstr "" +msgstr "چگونگی به‌روزرسانی یک ماژول توسعه برای پشتیبانی از چندین مفسر." msgid ":pep:`554`" -msgstr "" +msgstr ":pep:`554`" msgid ":pep:`734`" -msgstr "" +msgstr ":pep:`734`" msgid ":pep:`684`" -msgstr "" +msgstr ":pep:`684`" msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "Key details" -msgstr "" +msgstr "جزئیات کلیدی" -msgid "Before we dive in further, there are a small number of details to keep in mind about using multiple interpreters:" +msgid "" +"Before we dive in further, there are a small number of details to keep in " +"mind about using multiple interpreters:" msgstr "" +"پیش از آنکه بیشتر وارد بحث شویم، تعداد اندکی جزئیات وجود دارد که باید " +"درباره‌ی استفاده از چندین مفسر در نظر داشته باشید:" msgid "`isolated `_, by default" -msgstr "" +msgstr "`ایزوله `_، به‌طور پیش‌فرض" msgid "no implicit threads" -msgstr "" +msgstr "بدون نخ‌های ضمنی" msgid "not all PyPI packages support use in multiple interpreters yet" -msgstr "" +msgstr "هنوز همه‌ی بسته‌های PyPI از استفاده در چندین مفسر پشتیبانی نمی‌کنند" msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "An \"interpreter\" is effectively the execution context of the Python runtime. It contains all of the state the runtime needs to execute a program. This includes things like the import state and builtins. (Each thread, even if there's only the main thread, has some extra runtime state, in addition to the current interpreter, related to the current exception and the bytecode eval loop.)" -msgstr "" +msgid "" +"An \"interpreter\" is effectively the execution context of the Python " +"runtime. It contains all of the state the runtime needs to execute a " +"program. This includes things like the import state and builtins. (Each " +"thread, even if there's only the main thread, has some extra runtime state, " +"in addition to the current interpreter, related to the current exception and" +" the bytecode eval loop.)" +msgstr "" +"یک «مفسر» عملاً زمینه اجرای ران‌تایم پایتون است. این شامل تمام وضعیت مورد " +"نیاز ران‌تایم برای اجرای یک برنامه است. این شامل مواردی مانند وضعیت ایمپورت " +"و توکارها می‌شود. (هر نخ، حتی اگر فقط نخ اصلی وجود داشته باشد، علاوه بر مفسر" +" فعلی، دارای وضعیت اضافی ران‌تایم مربوط به استثنای فعلی و حلقه ارزیابی " +"بایت‌کد است.)" -msgid "The concept and functionality of the interpreter have been a part of Python since version 2.2, but the feature was only available through the C-API and not well known, and the `isolation `_ was relatively incomplete until version 3.12." +msgid "" +"The concept and functionality of the interpreter have been a part of Python " +"since version 2.2, but the feature was only available through the C-API and " +"not well known, and the `isolation `_ was relatively " +"incomplete until version 3.12." msgstr "" +"مفهوم و کارکرد مفسر از نسخه‌ی 2.2 بخشی از پایتون بوده است، اما این قابلیت " +"تنها از طریق C-API در دسترس بود و چندان شناخته‌شده نبود، و `جداسازی `_ تا نسخه‌ی 3.12 نسبتاً ناقص بود." msgid "Multiple Interpreters and Isolation" -msgstr "" +msgstr "مفسرهای متعدد و جداسازی" -msgid "A Python implementation may support using multiple interpreters in the same process. CPython has this support. Each interpreter is effectively isolated from the others (with a limited number of carefully managed process-global exceptions to the rule)." +msgid "" +"A Python implementation may support using multiple interpreters in the same " +"process. CPython has this support. Each interpreter is effectively " +"isolated from the others (with a limited number of carefully managed " +"process-global exceptions to the rule)." msgstr "" +"یک پیاده‌سازی پایتون ممکن است از استفاده از چندین مفسر در یک فرایند پشتیبانی" +" کند. CPython این پشتیبانی را دارد. هر مفسر عملاً از سایر مفسرها ایزوله است " +"(با تعداد محدودی استثنا بر این قاعده، که سراسری در سطح فرایند هستند و به‌دقت" +" مدیریت می‌شوند)." -msgid "That isolation is primarily useful as a strong separation between distinct logical components of a program, where you want to have careful control of how those components interact." +msgid "" +"That isolation is primarily useful as a strong separation between distinct " +"logical components of a program, where you want to have careful control of " +"how those components interact." msgstr "" +"آن جداسازی عمدتاً به‌عنوان یک تفکیک قوی میان کامپوننت‌های منطقی مجزای یک " +"برنامه مفید است، جایی که می‌خواهید کنترل دقیقی بر نحوه تعامل آن کامپوننت‌ها " +"داشته باشید." -msgid "Interpreters in the same process can technically never be strictly isolated from one another since there are few restrictions on memory access within the same process. The Python runtime makes a best effort at isolation but extension modules may easily violate that. Therefore, do not use multiple interpreters in security-sensitive situations, where they shouldn't have access to each other's data." -msgstr "" +msgid "" +"Interpreters in the same process can technically never be strictly isolated " +"from one another since there are few restrictions on memory access within " +"the same process. The Python runtime makes a best effort at isolation but " +"extension modules may easily violate that. Therefore, do not use multiple " +"interpreters in security-sensitive situations, where they shouldn't have " +"access to each other's data." +msgstr "" +"مفسرهای موجود در یک فرایند یکسان، از نظر فنی هرگز نمی‌توانند به‌طور کامل از " +"یکدیگر جدا شوند، زیرا محدودیت‌های اندکی برای دسترسی به حافظه در همان فرایند " +"وجود دارد. ران‌تایم پایتون نهایت تلاش خود را برای جداسازی به کار می‌گیرد، " +"اما ماژول‌های توسعه ممکن است به‌راحتی آن را نقض کنند. بنابراین، در " +"موقعیت‌های حساس امنیتی، جایی که نباید به داده‌های یکدیگر دسترسی داشته باشند،" +" از چندین مفسر استفاده نکنید." msgid "Running in an Interpreter" -msgstr "" +msgstr "اجرا در مفسر" -msgid "Running in a different interpreter involves switching to it in the current thread and then calling some function. The runtime will execute the function using the current interpreter's state. The :mod:`!concurrent.interpreters` module provides a basic API for creating and managing interpreters, as well as the switch-and-call operation." +msgid "" +"Running in a different interpreter involves switching to it in the current " +"thread and then calling some function. The runtime will execute the " +"function using the current interpreter's state. The " +":mod:`!concurrent.interpreters` module provides a basic API for creating and" +" managing interpreters, as well as the switch-and-call operation." msgstr "" +"اجرا در یک مفسر دیگر، مستلزم تعویض به آن در نخ جاری و سپس فراخوانی یک تابع " +"است. ران‌تایم تابع را با استفاده از وضعیت مفسر جاری اجرا می‌کند. ماژول " +":mod:`!concurrent.interpreters` یک API پایه برای ایجاد و مدیریت مفسرها و " +"همچنین عملیات تعویض و فراخوانی (switch-and-call) ارائه می‌کند." -msgid "No other threads are automatically started for the operation. There is `a helper `_ for that though. There is another dedicated helper for calling the builtin :func:`exec` in an interpreter." +msgid "" +"No other threads are automatically started for the operation. There is `a " +"helper `_ for that though. There is another " +"dedicated helper for calling the builtin :func:`exec` in an interpreter." msgstr "" +"هیچ نخ دیگری به‌طور خودکار برای این عملیات آغاز نمی‌شود. با این حال، برای " +"این کار `یک تابع کمکی `_ وجود دارد. یک تابع کمکی " +"اختصاصی دیگر برای فراخوانی :func:`exec` توکار در یک مفسر وجود دارد." -msgid "When :func:`exec` (or :func:`eval`) are called in an interpreter, they run using the interpreter's :mod:`!__main__` module as the \"globals\" namespace. The same is true for functions that aren't associated with any module. This is the same as how scripts invoked from the command-line run in the :mod:`!__main__` module." -msgstr "" +msgid "" +"When :func:`exec` (or :func:`eval`) are called in an interpreter, they run " +"using the interpreter's :mod:`!__main__` module as the \"globals\" " +"namespace. The same is true for functions that aren't associated with any " +"module. This is the same as how scripts invoked from the command-line run " +"in the :mod:`!__main__` module." +msgstr "" +"هنگامی که :func:`exec` (یا :func:`eval`) در یک مفسر فراخوانی می‌شوند، با " +"استفاده از ماژول :mod:`!__main__` مفسر به‌عنوان فضای نام «globals» اجرا " +"می‌شوند. همین موضوع برای توابعی که با هیچ ماژولی مرتبط نیستند نیز صادق است. " +"این مشابه روشی است که اسکریپت‌های فراخوانی‌شده از خط فرمان در ماژول " +":mod:`!__main__` اجرا می‌شوند." msgid "Concurrency and Parallelism" -msgstr "" +msgstr "همروندی و موازی‌سازی" -msgid "As noted earlier, interpreters do not provide any concurrency on their own. They strictly represent the isolated execution context the runtime will use *in the current thread*. That isolation makes them similar to processes, but they still enjoy in-process efficiency, like threads." +msgid "" +"As noted earlier, interpreters do not provide any concurrency on their own." +" They strictly represent the isolated execution context the runtime will " +"use *in the current thread*. That isolation makes them similar to " +"processes, but they still enjoy in-process efficiency, like threads." msgstr "" +"همان‌طور که پیش‌تر گفته شد، مفسرها به‌خودی خود هیچ‌گونه همروندی‌ای فراهم " +"نمی‌کنند. آن‌ها صرفاً نمایانگر زمینه اجرای جداشده‌ای هستند که ران‌تایم *در " +"نخ جاری* از آن استفاده خواهد کرد. این جداسازی آن‌ها را شبیه به فرآیندها " +"می‌کند، اما همچنان مانند نخ‌ها از کارایی درون‌فرآیندی برخوردارند." -msgid "All that said, interpreters do naturally support certain flavors of concurrency. There's a powerful side effect of that isolation. It enables a different approach to concurrency than you can take with async or threads. It's a similar concurrency model to CSP or the actor model, a model which is relatively easy to reason about." -msgstr "" +msgid "" +"All that said, interpreters do naturally support certain flavors of " +"concurrency. There's a powerful side effect of that isolation. It enables a" +" different approach to concurrency than you can take with async or threads." +" It's a similar concurrency model to CSP or the actor model, a model which " +"is relatively easy to reason about." +msgstr "" +"با همه این اوصاف، مفسرها به‌طور طبیعی از برخی سبک‌های هم‌روندی پشتیبانی " +"می‌کنند. آن جداسازی اثر جانبی قدرتمندی دارد. این امر رویکرد متفاوتی به " +"هم‌روندی را ممکن می‌سازد، نسبت به آنچه می‌توانید با ناهمگام یا نخ‌ها در پیش " +"بگیرید. این مدل هم‌روندی مشابه CSP یا مدل کنشگر (actor model) است؛ مدلی که " +"استدلال درباره آن نسبتاً آسان است." -msgid "You can take advantage of that concurrency model in a single thread, switching back and forth between interpreters, Stackless-style. However, this model is more useful when you combine interpreters with multiple threads. This mostly involves starting a new thread, where you switch to another interpreter and run what you want there." -msgstr "" +msgid "" +"You can take advantage of that concurrency model in a single thread, " +"switching back and forth between interpreters, Stackless-style. However, " +"this model is more useful when you combine interpreters with multiple " +"threads. This mostly involves starting a new thread, where you switch to " +"another interpreter and run what you want there." +msgstr "" +"شما می‌توانید از آن مدل همروندی در یک نخ واحد بهره ببرید و به سبک Stackless،" +" به‌صورت رفت‌وبرگشتی بین مفسرها جابه‌جا شوید. با این حال، این مدل زمانی " +"مفیدتر است که مفسرها را با چندین نخ ترکیب کنید. این کار عمدتاً شامل شروع یک " +"نخ جدید است، که در آن به مفسر دیگری جابه‌جا می‌شوید و آنچه را می‌خواهید در " +"آنجا اجرا می‌کنید." -msgid "Each actual thread in Python, even if you're only running in the main thread, has its own *current* execution context. Multiple threads can use the same interpreter or different ones." +msgid "" +"Each actual thread in Python, even if you're only running in the main " +"thread, has its own *current* execution context. Multiple threads can use " +"the same interpreter or different ones." msgstr "" +"هر نخ واقعی در پایتون، حتی اگر فقط در نخ اصلی در حال اجرا باشید، زمینه‌ی " +"اجرای *فعلی* خود را دارد. چندین نخ می‌توانند از یک مفسر مشترک یا مفسرهای " +"متفاوت استفاده کنند." -msgid "At a high level, you can think of the combination of threads and interpreters as threads with opt-in sharing." +msgid "" +"At a high level, you can think of the combination of threads and " +"interpreters as threads with opt-in sharing." msgstr "" +"در سطح بالا، می‌توانید ترکیب نخ‌ها و مفسرها را به‌عنوان نخ‌هایی با " +"اشتراک‌گذاری انتخابی در نظر بگیرید." -msgid "As a significant bonus, interpreters are sufficiently isolated that they do not share the :term:`GIL`, which means combining threads with multiple interpreters enables full multi-core parallelism. (This has been the case since Python 3.12.)" +msgid "" +"As a significant bonus, interpreters are sufficiently isolated that they do " +"not share the :term:`GIL`, which means combining threads with multiple " +"interpreters enables full multi-core parallelism. (This has been the case " +"since Python 3.12.)" msgstr "" +"به‌عنوان یک مزیت قابل‌توجه، مفسرها به‌اندازه‌ای از یکدیگر ایزوله هستند که " +":term:`GIL` را به اشتراک نمی‌گذارند؛ این بدان معناست که ترکیب نخ‌ها با چندین" +" مفسر، موازی‌سازی کامل چندهسته‌ای را ممکن می‌سازد. (این حالت از پایتون 3.12 " +"برقرار بوده است.)" msgid "Communication Between Interpreters" -msgstr "" +msgstr "ارتباط میان مفسرها" -msgid "In practice, multiple interpreters are useful only if we have a way to communicate between them. This usually involves some form of message passing, but can even mean sharing data in some carefully managed way." +msgid "" +"In practice, multiple interpreters are useful only if we have a way to " +"communicate between them. This usually involves some form of message " +"passing, but can even mean sharing data in some carefully managed way." msgstr "" +"در عمل، چندین مفسر تنها زمانی مفید هستند که راهی برای برقراری ارتباط بین " +"آن‌ها داشته باشیم. این موضوع معمولاً شامل نوعی پیام‌رسانی می‌شود، اما حتی " +"می‌تواند به معنای اشتراک‌گذاری داده‌ها به شیوه‌ای با مدیریت دقیق باشد." -msgid "With this in mind, the :mod:`!concurrent.interpreters` module provides a :class:`queue.Queue` implementation, available through :func:`create_queue`." +msgid "" +"With this in mind, the :mod:`!concurrent.interpreters` module provides a " +":class:`queue.Queue` implementation, available through :func:`create_queue`." msgstr "" +"با در نظر گرفتن این موضوع، ماژول :mod:`!concurrent.interpreters` یک " +"پیاده‌سازی از :class:`queue.Queue` را ارائه می‌دهد که از طریق " +":func:`create_queue` در دسترس است." msgid "\"Sharing\" Objects" -msgstr "" +msgstr "«اشتراک‌گذاری» اشیاء" -msgid "Any data actually shared between interpreters loses the thread-safety provided by the :term:`GIL`. There are various options for dealing with this in extension modules. However, from Python code the lack of thread-safety means objects can't actually be shared, with a few exceptions. Instead, a copy must be created, which means mutable objects won't stay in sync." -msgstr "" +msgid "" +"Any data actually shared between interpreters loses the thread-safety " +"provided by the :term:`GIL`. There are various options for dealing with " +"this in extension modules. However, from Python code the lack of thread-" +"safety means objects can't actually be shared, with a few exceptions. " +"Instead, a copy must be created, which means mutable objects won't stay in " +"sync." +msgstr "" +"هر داده‌ای که واقعاً بین مفسرها به اشتراک گذاشته می‌شود، ایمنی نخی فراهم‌شده" +" از سوی :term:`GIL` را از دست می‌دهد. گزینه‌های مختلفی برای مدیریت این موضوع" +" در ماژول‌های توسعه وجود دارد. با این حال، از دید کد پایتون، فقدان ایمنی نخی" +" به این معناست که اشیاء، به‌جز چند استثنا، عملاً نمی‌توانند به اشتراک گذاشته" +" شوند. در عوض، باید یک رونوشت ایجاد شود، که به این معناست که اشیاء تغییرپذیر" +" همگام باقی نخواهند ماند." -msgid "By default, most objects are copied with :mod:`pickle` when they are passed to another interpreter. Nearly all of the immutable builtin objects are either directly shared or copied efficiently. For example:" +msgid "" +"By default, most objects are copied with :mod:`pickle` when they are passed " +"to another interpreter. Nearly all of the immutable builtin objects are " +"either directly shared or copied efficiently. For example:" msgstr "" +"به‌طور پیش‌فرض، بیشتر اشیاء هنگامی که به مفسر دیگری منتقل می‌شوند، با " +":mod:`pickle` کپی می‌شوند. تقریباً همه‌ی اشیاء تغییرناپذیر توکار یا مستقیماً " +"به اشتراک گذاشته می‌شوند یا به‌صورت کارآمد کپی می‌شوند. برای مثال:" msgid ":const:`None`" -msgstr "" +msgstr ":const:`None`" msgid ":class:`bool` (:const:`True` and :const:`False`)" -msgstr "" +msgstr ":class:`bool` (:const:`True` و :const:`False`)" msgid ":class:`bytes`" -msgstr "" +msgstr ":class:`bytes`" msgid ":class:`str`" -msgstr "" +msgstr ":class:`str`" msgid ":class:`int`" -msgstr "" +msgstr ":class:`int`" msgid ":class:`float`" -msgstr "" +msgstr ":class:`float`" msgid ":class:`tuple` (of similarly supported objects)" -msgstr "" +msgstr ":class:`tuple` (از اشیاء پشتیبانی‌شده‌ی مشابه)" -msgid "There is a small number of Python types that actually share mutable data between interpreters:" +msgid "" +"There is a small number of Python types that actually share mutable data " +"between interpreters:" msgstr "" +"تعداد اندکی از انواع پایتون وجود دارند که در واقع داده‌های تغییرپذیر را بین " +"مفسرها به اشتراک می‌گذارند:" msgid ":class:`memoryview`" -msgstr "" +msgstr ":class:`memoryview`" msgid ":class:`Queue`" -msgstr "" +msgstr ":class:`Queue`" msgid "Reference" -msgstr "" +msgstr "مرجع" msgid "This module defines the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را تعریف می‌کند:" -msgid "Return a :class:`list` of :class:`Interpreter` objects, one for each existing interpreter." +msgid "" +"Return a :class:`list` of :class:`Interpreter` objects, one for each " +"existing interpreter." msgstr "" +"یک :class:`list` از اشیاء :class:`Interpreter` برمی‌گرداند، یکی برای هر مفسر" +" موجود." -msgid "Return an :class:`Interpreter` object for the currently running interpreter." -msgstr "" +msgid "" +"Return an :class:`Interpreter` object for the currently running interpreter." +msgstr "یک شیء :class:`Interpreter` برای مفسر در حال اجرا برمی‌گرداند." -msgid "Return an :class:`Interpreter` object for the main interpreter. This is the interpreter the runtime created to run the :term:`REPL` or the script given at the command-line. It is usually the only one." +msgid "" +"Return an :class:`Interpreter` object for the main interpreter. This is the " +"interpreter the runtime created to run the :term:`REPL` or the script given " +"at the command-line. It is usually the only one." msgstr "" +"یک شیء :class:`Interpreter` برای مفسر اصلی بازمی‌گرداند. این همان مفسری است " +"که ران‌تایم برای اجرای :term:`REPL` یا اسکریپت داده‌شده در خط فرمان ایجاد " +"کرده است. معمولاً تنها مفسر همین است." -msgid "Initialize a new (idle) Python interpreter and return a :class:`Interpreter` object for it." +msgid "" +"Initialize a new (idle) Python interpreter and return a :class:`Interpreter`" +" object for it." msgstr "" +"یک مفسر پایتون جدید (بی‌کار) را راه‌اندازی می‌کند و یک شیء " +":class:`Interpreter` برای آن برمی‌گرداند." -msgid "Initialize a new cross-interpreter queue and return a :class:`Queue` object for it." +msgid "" +"Initialize a new cross-interpreter queue and return a :class:`Queue` object " +"for it." msgstr "" +"یک صف بین‌مفسری جدید را مقداردهی اولیه می‌کند و یک شیء :class:`Queue` برای " +"آن برمی‌گرداند." msgid "Interpreter objects" -msgstr "" +msgstr "اشیای مفسر" msgid "A single interpreter in the current process." -msgstr "" +msgstr "یک مفسر واحد در فرایند جاری." -msgid "Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :func:`create` or one of the other module functions." +msgid "" +"Generally, :class:`Interpreter` shouldn't be called directly. Instead, use " +":func:`create` or one of the other module functions." msgstr "" +"به‌طور کلی، :class:`Interpreter` نباید مستقیماً فراخوانی شود. در عوض، از " +":func:`create` یا یکی دیگر از توابع ماژول استفاده کنید." msgid "(read-only)" -msgstr "" +msgstr "(فقط‌خواندنی)" msgid "The underlying interpreter's ID." -msgstr "" +msgstr "شناسه‌ی مفسر زیربنایی." msgid "A string describing where the interpreter came from." -msgstr "" +msgstr "رشته‌ای که منشأ مفسر را توصیف می‌کند." -msgid "Return ``True`` if the interpreter is currently executing code in its :mod:`!__main__` module and ``False`` otherwise." +msgid "" +"Return ``True`` if the interpreter is currently executing code in its " +":mod:`!__main__` module and ``False`` otherwise." msgstr "" +"اگر مفسر هم‌اکنون در حال اجرای کد در ماژول :mod:`!__main__` خود باشد، " +"``True`` و در غیر این صورت ``False`` برمی‌گرداند." msgid "Finalize and destroy the interpreter." -msgstr "" +msgstr "نهایی‌سازی و نابود کردن مفسر." msgid "Bind objects in the interpreter's :mod:`!__main__` module." -msgstr "" +msgstr "اشیاء را در ماژول :mod:`!__main__` مفسر مقید کنید." -msgid "Some objects are actually shared and some are copied efficiently, but most are copied via :mod:`pickle`. See :ref:`interp-object-sharing`." +msgid "" +"Some objects are actually shared and some are copied efficiently, but most " +"are copied via :mod:`pickle`. See :ref:`interp-object-sharing`." msgstr "" +"برخی از شیء‌ها در واقع به اشتراک گذاشته می‌شوند و برخی به‌صورت کارآمد کپی " +"می‌شوند، اما بیشتر آن‌ها از طریق :mod:`pickle` کپی می‌شوند. :ref:`interp-" +"object-sharing` را ببینید." msgid "Run the given source code in the interpreter (in the current thread)." -msgstr "" +msgstr "کد منبع داده‌شده را در مفسر (در نخ فعلی) اجرا کنید." -msgid "Return the result of calling running the given function in the interpreter (in the current thread)." +msgid "" +"Return the result of calling running the given function in the interpreter " +"(in the current thread)." msgstr "" +"نتیجه‌ی فراخوانی و اجرای تابع داده‌شده در مفسر (در نخ فعلی) را برمی‌گرداند." msgid "Run the given function in the interpreter (in a new thread)." -msgstr "" +msgstr "تابع داده‌شده را در مفسر اجرا کنید (در یک نخ جدید)." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "This exception, a subclass of :exc:`Exception`, is raised when an interpreter-related error happens." +msgid "" +"This exception, a subclass of :exc:`Exception`, is raised when an " +"interpreter-related error happens." msgstr "" +"این استثنا، زیرکلاسی از :exc:`Exception`، زمانی پرتاب می‌شود که خطای مرتبط " +"با مفسر رخ دهد." -msgid "This exception, a subclass of :exc:`InterpreterError`, is raised when the targeted interpreter no longer exists." +msgid "" +"This exception, a subclass of :exc:`InterpreterError`, is raised when the " +"targeted interpreter no longer exists." msgstr "" +"این استثنا، زیرکلاسی از :exc:`InterpreterError`، زمانی پرتاب می‌شود که مفسر " +"هدف دیگر وجود ندارد." -msgid "This exception, a subclass of :exc:`InterpreterError`, is raised when the running code raised an uncaught exception." +msgid "" +"This exception, a subclass of :exc:`InterpreterError`, is raised when the " +"running code raised an uncaught exception." msgstr "" +"این استثنا، که زیرکلاسی از :exc:`InterpreterError` است، زمانی پرتاب می‌شود " +"که کد در حال اجرا، استثنای گرفته‌نشده‌ای را پرتاب کرده باشد." msgid "A basic snapshot of the exception raised in the other interpreter." -msgstr "" +msgstr "یک تصویر لحظه‌ای ساده از استثنای پرتاب‌شده در مفسر دیگر." -msgid "This exception, a subclass of :exc:`TypeError`, is raised when an object cannot be sent to another interpreter." +msgid "" +"This exception, a subclass of :exc:`TypeError`, is raised when an object " +"cannot be sent to another interpreter." msgstr "" +"این استثنا، که زیرکلاسی از :exc:`TypeError` است، زمانی پرتاب می‌شود که نتوان" +" یک شیء را به مفسر دیگری ارسال کرد." msgid "Communicating Between Interpreters" -msgstr "" +msgstr "ارتباط بین مفسرها" -msgid "A wrapper around a low-level, cross-interpreter queue, which implements the :class:`queue.Queue` interface. The underlying queue can only be created through :func:`create_queue`." +msgid "" +"A wrapper around a low-level, cross-interpreter queue, which implements the " +":class:`queue.Queue` interface. The underlying queue can only be created " +"through :func:`create_queue`." msgstr "" +"پوششی برای یک صف بین‌مفسری سطح پایین، که رابط :class:`queue.Queue` را " +"پیاده‌سازی می‌کند. صف زیرین فقط از طریق :func:`create_queue` قابل ایجاد است." msgid "The queue's ID." -msgstr "" +msgstr "شناسه‌ی صف." -msgid "This exception, a subclass of :exc:`queue.Empty`, is raised from :meth:`!Queue.get` and :meth:`!Queue.get_nowait` when the queue is empty." +msgid "" +"This exception, a subclass of :exc:`queue.Empty`, is raised from " +":meth:`!Queue.get` and :meth:`!Queue.get_nowait` when the queue is empty." msgstr "" +"این استثنا، زیرکلاسی از :exc:`queue.Empty`، زمانی از :meth:`!Queue.get` و " +":meth:`!Queue.get_nowait` پرتاب می‌شود که صف خالی باشد." -msgid "This exception, a subclass of :exc:`queue.Full`, is raised from :meth:`!Queue.put` and :meth:`!Queue.put_nowait` when the queue is full." +msgid "" +"This exception, a subclass of :exc:`queue.Full`, is raised from " +":meth:`!Queue.put` and :meth:`!Queue.put_nowait` when the queue is full." msgstr "" +"این استثنا، زیرکلاسی از :exc:`queue.Full`، هنگامی از :meth:`!Queue.put` و " +":meth:`!Queue.put_nowait` پرتاب می‌شود که صف پر باشد." msgid "Basic usage" -msgstr "" +msgstr "استفاده‌ی پایه" msgid "Creating an interpreter and running code in it::" -msgstr "" +msgstr "ایجاد یک مفسر و اجرای کد در آن::" msgid "" "from concurrent import interpreters\n" @@ -311,3 +552,35 @@ msgid "" "t = interp.call_in_thread(run)\n" "t.join()" msgstr "" +"from concurrent import interpreters\n" +"\n" +"interp = interpreters.create()\n" +"\n" +"# در نخ جاری سیستم‌عامل اجرا می‌شود.\n" +"\n" +"interp.exec('print(\"spam!\")')\n" +"\n" +"interp.exec(\"\"\"if True:\n" +" print('spam!')\n" +" \"\"\")\n" +"\n" +"from textwrap import dedent\n" +"interp.exec(dedent(\"\"\"\n" +" print('spam!')\n" +" \"\"\"))\n" +"\n" +"def run(arg):\n" +" return arg\n" +"\n" +"res = interp.call(run, 'spam!')\n" +"print(res)\n" +"\n" +"def run():\n" +" print('spam!')\n" +"\n" +"interp.call(run)\n" +"\n" +"# در نخ جدید سیستم‌عامل اجرا می‌شود.\n" +"\n" +"t = interp.call_in_thread(run)\n" +"t.join()" diff --git a/library/concurrent.po b/library/concurrent.po index 201fcca22..d1c40be07 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -22,13 +22,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "The :mod:`!concurrent` package" -msgstr "" +msgstr "بسته‌ی :mod:`!concurrent`" msgid "This package contains the following modules:" -msgstr "" +msgstr "این بسته شامل ماژول‌های زیر است:" msgid ":mod:`concurrent.futures` -- Launching parallel tasks" -msgstr "" +msgstr ":mod:`concurrent.futures` -- راه‌اندازی وظایف موازی" -msgid ":mod:`concurrent.interpreters` -- Multiple interpreters in the same process" -msgstr "" +msgid "" +":mod:`concurrent.interpreters` -- Multiple interpreters in the same process" +msgstr ":mod:`concurrent.interpreters` -- چندین مفسر در یک فرایند" diff --git a/library/configparser.po b/library/configparser.po index 3d18e8bf8..d16e9d619 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -24,40 +24,66 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!configparser` --- Configuration file parser" -msgstr "" +msgstr ":mod:`!configparser` --- پارسر فایل پیکربندی" msgid "**Source code:** :source:`Lib/configparser.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/configparser.py`" -msgid "This module provides the :class:`ConfigParser` class which implements a basic configuration language which provides a structure similar to what's found in Microsoft Windows INI files. You can use this to write Python programs which can be customized by end users easily." +msgid "" +"This module provides the :class:`ConfigParser` class which implements a " +"basic configuration language which provides a structure similar to what's " +"found in Microsoft Windows INI files. You can use this to write Python " +"programs which can be customized by end users easily." msgstr "" +"این ماژول، کلاس :class:`ConfigParser` را ارائه می‌دهد که یک زبان پیکربندی " +"پایه را پیاده‌سازی می‌کند و ساختاری مشابه آنچه در فایل‌های INI ویندوز " +"مایکروسافت یافت می‌شود، دارد. شما می‌توانید از آن برای نوشتن برنامه‌های " +"پایتون استفاده کنید که کاربران نهایی بتوانند به‌راحتی آن‌ها را سفارشی‌سازی " +"کنند." -msgid "This library does *not* interpret or write the value-type prefixes used in the Windows Registry extended version of INI syntax." +msgid "" +"This library does *not* interpret or write the value-type prefixes used in " +"the Windows Registry extended version of INI syntax." msgstr "" +"این کتابخانه پیشوندهای نوع مقدار استفاده‌شده در نسخه گسترش‌یافته سینتکس INI" +" در Windows Registry را تفسیر یا نوشتن *نمی‌کند*." msgid "Module :mod:`tomllib`" -msgstr "" +msgstr "ماژول :mod:`tomllib`" -msgid "TOML is a well-specified format for application configuration files. It is specifically designed to be an improved version of INI." +msgid "" +"TOML is a well-specified format for application configuration files. It is " +"specifically designed to be an improved version of INI." msgstr "" +"TOML قالبی با مشخصات دقیق برای فایل‌های پیکربندی برنامه‌ها است. این قالب " +"به‌طور خاص به‌عنوان نسخه‌ای بهبودیافته از INI طراحی شده است." msgid "Module :mod:`shlex`" -msgstr "" +msgstr "ماژول :mod:`shlex`" -msgid "Support for creating Unix shell-like mini-languages which can also be used for application configuration files." +msgid "" +"Support for creating Unix shell-like mini-languages which can also be used " +"for application configuration files." msgstr "" +"پشتیبانی از ایجاد زبان‌های کوچک شبیه به پوسته‌ی یونیکس که می‌توان از آن‌ها " +"برای فایل‌های پیکربندی برنامه نیز استفاده کرد." msgid "Module :mod:`json`" -msgstr "" +msgstr "ماژول :mod:`json`" -msgid "The ``json`` module implements a subset of JavaScript syntax which is sometimes used for configuration, but does not support comments." +msgid "" +"The ``json`` module implements a subset of JavaScript syntax which is " +"sometimes used for configuration, but does not support comments." msgstr "" +"ماژول ``json`` زیرمجموعه‌ای از سینتکس JavaScript را پیاده‌سازی می‌کند که " +"گاهی برای پیکربندی به کار می‌رود، اما از کامنت پشتیبانی نمی‌کند." msgid "Quick Start" -msgstr "" +msgstr "شروع سریع" msgid "Let's take a very basic configuration file that looks like this:" msgstr "" +"بیایید یک پرونده‌ی پیکربندی بسیار ساده را در نظر بگیریم که به این شکل است:" msgid "" "[DEFAULT]\n" @@ -73,9 +99,31 @@ msgid "" "Port = 50022\n" "ForwardX11 = no" msgstr "" +"[DEFAULT]\n" +"ServerAliveInterval = 45\n" +"Compression = yes\n" +"CompressionLevel = 9\n" +"ForwardX11 = yes\n" +"\n" +"[forge.example]\n" +"User = hg\n" +"\n" +"[topsecret.server.example]\n" +"Port = 50022\n" +"ForwardX11 = no" -msgid "The structure of INI files is described `in the following section <#supported-ini-file-structure>`_. Essentially, the file consists of sections, each of which contains keys with values. :mod:`!configparser` classes can read and write such files. Let's start by creating the above configuration file programmatically." -msgstr "" +msgid "" +"The structure of INI files is described `in the following section " +"<#supported-ini-file-structure>`_. Essentially, the file consists of " +"sections, each of which contains keys with values. :mod:`!configparser` " +"classes can read and write such files. Let's start by creating the above " +"configuration file programmatically." +msgstr "" +"ساختار فایل‌های INI `در بخش زیر <#supported-ini-file-structure>`_ توضیح داده" +" شده است. در اصل، فایل از بخش‌هایی تشکیل شده است که هر یک شامل کلیدهایی " +"دارای مقدار است. کلاس‌های :mod:`!configparser` می‌توانند چنین فایل‌هایی را " +"بخوانند و بنویسند. برای شروع، فایل پیکربندی فوق را به‌صورت برنامه‌ای ایجاد " +"می‌کنیم." msgid "" ">>> import configparser\n" @@ -94,12 +142,38 @@ msgid "" "... config.write(configfile)\n" "..." msgstr "" +">>> import configparser\n" +">>> config = configparser.ConfigParser()\n" +">>> config['DEFAULT'] = {'ServerAliveInterval': '45',\n" +"... 'Compression': 'yes',\n" +"... 'CompressionLevel': '9'}\n" +">>> config['forge.example'] = {}\n" +">>> config['forge.example']['User'] = 'hg'\n" +">>> config['topsecret.server.example'] = {}\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['Port'] = '50022' # mutates the parser\n" +">>> topsecret['ForwardX11'] = 'no' # same here\n" +">>> config['DEFAULT']['ForwardX11'] = 'yes'\n" +">>> with open('example.ini', 'w') as configfile:\n" +"... config.write(configfile)\n" +"..." -msgid "As you can see, we can treat a config parser much like a dictionary. There are differences, `outlined later <#mapping-protocol-access>`_, but the behavior is very close to what you would expect from a dictionary." +msgid "" +"As you can see, we can treat a config parser much like a dictionary. There " +"are differences, `outlined later <#mapping-protocol-access>`_, but the " +"behavior is very close to what you would expect from a dictionary." msgstr "" +"همان‌طور که می‌بینید، می‌توانیم با یک پارسر پیکربندی بسیار شبیه به یک " +"دیکشنری رفتار کنیم. تفاوت‌هایی وجود دارد، `که در ادامه توضیح داده شده‌اند " +"<#mapping-protocol-access>`_، اما رفتار آن بسیار به آنچه از یک دیکشنری " +"انتظار دارید نزدیک است." -msgid "Now that we have created and saved a configuration file, let's read it back and explore the data it holds." +msgid "" +"Now that we have created and saved a configuration file, let's read it back " +"and explore the data it holds." msgstr "" +"اکنون که یک فایل پیکربندی ایجاد و ذخیره کرده‌ایم، آن را دوباره می‌خوانیم و " +"داده‌هایی را که در خود نگه می‌دارد بررسی می‌کنیم." msgid "" ">>> config = configparser.ConfigParser()\n" @@ -132,17 +206,67 @@ msgid "" ">>> config['forge.example']['ForwardX11']\n" "'yes'" msgstr "" +">>> config = configparser.ConfigParser()\n" +">>> config.sections()\n" +"[]\n" +">>> config.read('example.ini')\n" +"['example.ini']\n" +">>> config.sections()\n" +"['forge.example', 'topsecret.server.example']\n" +">>> 'forge.example' in config\n" +"True\n" +">>> 'python.org' in config\n" +"False\n" +">>> config['forge.example']['User']\n" +"'hg'\n" +">>> config['DEFAULT']['Compression']\n" +"'yes'\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['ForwardX11']\n" +"'no'\n" +">>> topsecret['Port']\n" +"'50022'\n" +">>> for key in config['forge.example']:\n" +"... print(key)\n" +"user\n" +"compressionlevel\n" +"serveraliveinterval\n" +"compression\n" +"forwardx11\n" +">>> config['forge.example']['ForwardX11']\n" +"'yes'" -msgid "As we can see above, the API is pretty straightforward. The only bit of magic involves the ``DEFAULT`` section which provides default values for all other sections [1]_. Note also that keys in sections are case-insensitive and stored in lowercase [1]_." +msgid "" +"As we can see above, the API is pretty straightforward. The only bit of " +"magic involves the ``DEFAULT`` section which provides default values for all" +" other sections [1]_. Note also that keys in sections are case-insensitive " +"and stored in lowercase [1]_." msgstr "" +"همان‌طور که در بالا می‌بینیم، API کاملاً سرراست است. تنها نکته‌ی جادویی مربوط" +" به بخش ``DEFAULT`` است که مقادیر پیش‌فرض را برای تمام بخش‌های دیگر فراهم " +"می‌کند [1]_. همچنین توجه داشته باشید که کلیدهای موجود در بخش‌ها به بزرگی و " +"کوچکی حروف حساس نیستند و به‌صورت حروف کوچک ذخیره می‌شوند [1]_." -msgid "It is possible to read several configurations into a single :class:`ConfigParser`, where the most recently added configuration has the highest priority. Any conflicting keys are taken from the more recent configuration while the previously existing keys are retained. The example below reads in an ``override.ini`` file, which will override any conflicting keys from the ``example.ini`` file." -msgstr "" +msgid "" +"It is possible to read several configurations into a single " +":class:`ConfigParser`, where the most recently added configuration has the " +"highest priority. Any conflicting keys are taken from the more recent " +"configuration while the previously existing keys are retained. The example " +"below reads in an ``override.ini`` file, which will override any conflicting" +" keys from the ``example.ini`` file." +msgstr "" +"می‌توان چند پیکربندی را در یک :class:`ConfigParser` خواند، که در آن آخرین " +"پیکربندی اضافه‌شده بیشترین اولویت را دارد. کلیدهای متعارض از پیکربندی " +"جدیدتر گرفته می‌شوند، در حالی که کلیدهای از پیش موجود حفظ می‌شوند. مثال زیر" +" فایل ``override.ini`` را می‌خواند که کلیدهای متعارض موجود در فایل " +"``example.ini`` را بازنویسی می‌کند." msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" msgstr "" +"[DEFAULT]\n" +"ServerAliveInterval = -1" msgid "" ">>> config_override = configparser.ConfigParser()\n" @@ -156,15 +280,36 @@ msgid "" ">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" "-1" msgstr "" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" +">>> with open('override.ini', 'w') as configfile:\n" +"... config_override.write(configfile)\n" +"...\n" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override.read(['example.ini', 'override.ini'])\n" +"['example.ini', 'override.ini']\n" +">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" +"-1" -msgid "This behaviour is equivalent to a :meth:`ConfigParser.read` call with several files passed to the *filenames* parameter." +msgid "" +"This behaviour is equivalent to a :meth:`ConfigParser.read` call with " +"several files passed to the *filenames* parameter." msgstr "" +"این رفتار معادل فراخوانی :meth:`ConfigParser.read` با چند فایل است که به " +"پارامتر *filenames* داده شده‌اند." msgid "Supported Datatypes" -msgstr "" +msgstr "انواع داده پشتیبانی‌شده" -msgid "Config parsers do not guess datatypes of values in configuration files, always storing them internally as strings. This means that if you need other datatypes, you should convert on your own:" +msgid "" +"Config parsers do not guess datatypes of values in configuration files, " +"always storing them internally as strings. This means that if you need " +"other datatypes, you should convert on your own:" msgstr "" +"پارسرهای پیکربندی انواع داده‌ی مقادیر موجود در فایل‌های پیکربندی را حدس " +"نمی‌زنند و همیشه آن‌ها را به‌صورت داخلی به‌عنوان رشته ذخیره می‌کنند. این " +"بدان معناست که اگر به انواع داده دیگری نیاز دارید، باید خودتان آن‌ها را " +"تبدیل کنید:" msgid "" ">>> int(topsecret['Port'])\n" @@ -172,9 +317,28 @@ msgid "" ">>> float(topsecret['CompressionLevel'])\n" "9.0" msgstr "" +">>> int(topsecret['Port'])\n" +"50022\n" +">>> float(topsecret['CompressionLevel'])\n" +"9.0" -msgid "Since this task is so common, config parsers provide a range of handy getter methods to handle integers, floats and booleans. The last one is the most interesting because simply passing the value to ``bool()`` would do no good since ``bool('False')`` is still ``True``. This is why config parsers also provide :meth:`~ConfigParser.getboolean`. This method is case-insensitive and recognizes Boolean values from ``'yes'``/``'no'``, ``'on'``/``'off'``, ``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" -msgstr "" +msgid "" +"Since this task is so common, config parsers provide a range of handy getter" +" methods to handle integers, floats and booleans. The last one is the most " +"interesting because simply passing the value to ``bool()`` would do no good " +"since ``bool('False')`` is still ``True``. This is why config parsers also " +"provide :meth:`~ConfigParser.getboolean`. This method is case-insensitive " +"and recognizes Boolean values from ``'yes'``/``'no'``, ``'on'``/``'off'``, " +"``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" +msgstr "" +"از آن‌جا که این کار بسیار رایج است، پارسرهای پیکربندی (config parsers) " +"مجموعه‌ای از متدهای getter کاربردی را برای مدیریت اعداد صحیح، اعداد اعشاری و" +" بولی‌ها ارائه می‌کنند. آخرین مورد جالب‌ترین است، زیرا صرفاً فرستادن مقدار " +"به ``bool()`` فایده‌ای ندارد، چرا که ``bool('False')`` همچنان ``True`` است. " +"به همین دلیل پارسرهای پیکربندی :meth:`~ConfigParser.getboolean` را نیز ارائه" +" می‌کنند. این متد به بزرگی و کوچکی حروف حساس نیست و مقادیر بولی را از " +"``'yes'``/``'no'``، ``'on'``/``'off'``، ``'true'``/``'false'`` و " +"``'1'``/``'0'`` [1]_ تشخیص می‌دهد. برای مثال:" msgid "" ">>> topsecret.getboolean('ForwardX11')\n" @@ -184,15 +348,33 @@ msgid "" ">>> config.getboolean('forge.example', 'Compression')\n" "True" msgstr "" +">>> topsecret.getboolean('ForwardX11')\n" +"False\n" +">>> config['forge.example'].getboolean('ForwardX11')\n" +"True\n" +">>> config.getboolean('forge.example', 'Compression')\n" +"True" -msgid "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` methods. You can register your own converters and customize the provided ones. [1]_" +msgid "" +"Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " +"equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " +"methods. You can register your own converters and customize the provided " +"ones. [1]_" msgstr "" +"علاوه بر :meth:`~ConfigParser.getboolean`، پارسرهای پیکربندی همچنین متدهای " +"معادل :meth:`~ConfigParser.getint` و :meth:`~ConfigParser.getfloat` را نیز " +"ارائه می‌دهند. شما می‌توانید مبدل‌های خودتان را ثبت کنید و مبدل‌های " +"ارائه‌شده را سفارشی‌سازی کنید. [1]_" msgid "Fallback Values" -msgstr "" +msgstr "مقادیر جایگزین" -msgid "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` method to provide fallback values:" +msgid "" +"As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " +"method to provide fallback values:" msgstr "" +"مانند دیکشنری، می‌توانید از متد :meth:`~ConfigParser.get` یک بخش برای ارائه " +"مقادیر جایگزین استفاده کنید:" msgid "" ">>> topsecret.get('Port')\n" @@ -203,26 +385,63 @@ msgid "" ">>> topsecret.get('Cipher', '3des-cbc')\n" "'3des-cbc'" msgstr "" +">>> topsecret.get('Port')\n" +"'50022'\n" +">>> topsecret.get('CompressionLevel')\n" +"'9'\n" +">>> topsecret.get('Cipher')\n" +">>> topsecret.get('Cipher', '3des-cbc')\n" +"'3des-cbc'" -msgid "Please note that default values have precedence over fallback values. For instance, in our example the ``'CompressionLevel'`` key was specified only in the ``'DEFAULT'`` section. If we try to get it from the section ``'topsecret.server.example'``, we will always get the default, even if we specify a fallback:" -msgstr "" +msgid "" +"Please note that default values have precedence over fallback values. For " +"instance, in our example the ``'CompressionLevel'`` key was specified only " +"in the ``'DEFAULT'`` section. If we try to get it from the section " +"``'topsecret.server.example'``, we will always get the default, even if we " +"specify a fallback:" +msgstr "" +"لطفاً توجه داشته باشید که مقادیر پیش‌فرض بر مقادیر جایگزین (fallback) اولویت" +" دارند. برای مثال، در مثال ما کلید ``'CompressionLevel'`` فقط در بخش " +"``'DEFAULT'`` تعیین شده است. اگر سعی کنیم آن را از بخش " +"``'topsecret.server.example'`` دریافت کنیم، همیشه مقدار پیش‌فرض را دریافت " +"خواهیم کرد، حتی اگر یک مقدار جایگزین (fallback) تعیین کنیم:" msgid "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" msgstr "" +">>> topsecret.get('CompressionLevel', '3')\n" +"'9'" -msgid "One more thing to be aware of is that the parser-level :meth:`~ConfigParser.get` method provides a custom, more complex interface, maintained for backwards compatibility. When using this method, a fallback value can be provided via the ``fallback`` keyword-only argument:" +msgid "" +"One more thing to be aware of is that the parser-level " +":meth:`~ConfigParser.get` method provides a custom, more complex interface, " +"maintained for backwards compatibility. When using this method, a fallback " +"value can be provided via the ``fallback`` keyword-only argument:" msgstr "" +"نکته دیگری که باید از آن آگاه باشید این است که متد :meth:`~ConfigParser.get`" +" در سطح پارسر، رابطی سفارشی و پیچیده‌تر را فراهم می‌کند که برای سازگاری با " +"نسخه‌های پیشین حفظ شده است. هنگام استفاده از این متد، می‌توانید یک مقدار " +"جایگزین (fallback) را از طریق آرگومان فقط کلیدواژه‌ای ``fallback`` ارائه " +"دهید:" msgid "" ">>> config.get('forge.example', 'monster',\n" "... fallback='No such things as monsters')\n" "'No such things as monsters'" msgstr "" +">>> config.get('forge.example', 'monster',\n" +"... fallback='No such things as monsters')\n" +"'No such things as monsters'" -msgid "The same ``fallback`` argument can be used with the :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` methods, for example:" +msgid "" +"The same ``fallback`` argument can be used with the " +":meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` and " +":meth:`~ConfigParser.getboolean` methods, for example:" msgstr "" +"می‌توان از همان آرگومان ``fallback`` در متدهای :meth:`~ConfigParser.getint`،" +" :meth:`~ConfigParser.getfloat` و :meth:`~ConfigParser.getboolean` استفاده " +"کرد، برای مثال:" msgid "" ">>> 'BatchMode' in topsecret\n" @@ -233,24 +452,69 @@ msgid "" ">>> topsecret.getboolean('BatchMode', fallback=True)\n" "False" msgstr "" +">>> 'BatchMode' in topsecret\n" +"False\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"True\n" +">>> config['DEFAULT']['BatchMode'] = 'no'\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"False" msgid "Supported INI File Structure" -msgstr "" +msgstr "ساختار فایل INI پشتیبانی‌شده" -msgid "A configuration file consists of sections, each led by a ``[section]`` header, followed by key/value entries separated by a specific string (``=`` or ``:`` by default [1]_). By default, section names are case sensitive but keys are not [1]_. Leading and trailing whitespace is removed from keys and values. Values can be omitted if the parser is configured to allow it [1]_, in which case the key/value delimiter may also be left out. Values can also span multiple lines, as long as they are indented deeper than the first line of the value. Depending on the parser's mode, blank lines may be treated as parts of multiline values or ignored." -msgstr "" +msgid "" +"A configuration file consists of sections, each led by a ``[section]`` " +"header, followed by key/value entries separated by a specific string (``=`` " +"or ``:`` by default [1]_). By default, section names are case sensitive but" +" keys are not [1]_. Leading and trailing whitespace is removed from keys " +"and values. Values can be omitted if the parser is configured to allow it " +"[1]_, in which case the key/value delimiter may also be left out. Values " +"can also span multiple lines, as long as they are indented deeper than the " +"first line of the value. Depending on the parser's mode, blank lines may be" +" treated as parts of multiline values or ignored." +msgstr "" +"یک فایل پیکربندی از بخش‌ها تشکیل شده است؛ هر بخش با یک سرآیند ``[section]`` " +"آغاز می‌شود و پس از آن، ورودی‌های کلید/مقدار قرار دارند که با یک رشته مشخص " +"(به‌صورت پیش‌فرض ``=`` یا ``:`` [1]_) از هم جدا شده‌اند. به‌صورت پیش‌فرض، " +"نام بخش‌ها به بزرگی و کوچکی حروف حساس هستند، اما کلیدها حساس نیستند [1]_. " +"فضای سفید ابتدایی و انتهایی از کلیدها و مقدارها حذف می‌شود. در صورتی که " +"پارسر به‌گونه‌ای پیکربندی شده باشد که حذف مقدارها مجاز باشد [1]_، " +"می‌توان آن‌ها را حذف کرد؛ در این صورت، جداکننده کلید/مقدار نیز می‌تواند حذف " +"شود. مقدارها همچنین می‌توانند چند خط را در بر بگیرند، مشروط بر اینکه نسبت " +"به خط اول مقدار تورفتگی بیشتری داشته باشند. بسته به حالت پارسر، خطوط " +"خالی ممکن است به‌عنوان بخشی از مقدارهای چندخطی در نظر گرفته شوند یا نادیده " +"گرفته شوند." -msgid "By default, a valid section name can be any string that does not contain '\\\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." +msgid "" +"By default, a valid section name can be any string that does not contain " +"'\\\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." msgstr "" +"به‌طور پیش‌فرض، یک نام بخش معتبر می‌تواند هر رشته‌ای باشد که حاوی '\\\\n' " +"نیست. برای تغییر این، :attr:`ConfigParser.SECTCRE` را ببینید." -msgid "The first section name may be omitted if the parser is configured to allow an unnamed top level section with ``allow_unnamed_section=True``. In this case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in ``config[UNNAMED_SECTION]``." +msgid "" +"The first section name may be omitted if the parser is configured to allow " +"an unnamed top level section with ``allow_unnamed_section=True``. In this " +"case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in " +"``config[UNNAMED_SECTION]``." msgstr "" +"اگر پارسر به‌گونه‌ای پیکربندی شده باشد که با ``allow_unnamed_section=True`` " +"اجازه‌ی وجود یک بخش سطح‌بالای بی‌نام داده شود، می‌توان نام اولین بخش را حذف " +"کرد. در این حالت، می‌توان کلیدها/مقدارها را با استفاده از " +":const:`UNNAMED_SECTION`، مانند ``config[UNNAMED_SECTION]``، بازیابی کرد." -msgid "Configuration files may include comments, prefixed by specific characters (``#`` and ``;`` by default [1]_). Comments may appear on their own on an otherwise empty line, possibly indented. [1]_" +msgid "" +"Configuration files may include comments, prefixed by specific characters " +"(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " +"otherwise empty line, possibly indented. [1]_" msgstr "" +"فایل‌های پیکربندی ممکن است شامل کامنت‌هایی باشند که با نویسه‌های مشخصی آغاز " +"می‌شوند (به‌طور پیش‌فرض ``#`` و ``;`` [1]_). کامنت‌ها ممکن است به‌تنهایی در" +" خطی که در غیر این صورت خالی است قرار بگیرند، احتمالاً با تورفتگی. [1]_" msgid "For example:" -msgstr "" +msgstr "برای مثال:" msgid "" "[Simple Values]\n" @@ -295,12 +559,57 @@ msgid "" " of a value\n" " # Did I mention we can indent comments, too?" msgstr "" +"[Simple Values]\n" +"key=value\n" +"spaces in keys=allowed\n" +"spaces in values=allowed as well\n" +"spaces around the delimiter = obviously\n" +"you can also use : to delimit keys from values\n" +"\n" +"[All Values Are Strings]\n" +"values like this: 1000000\n" +"or this: 3.14159265359\n" +"are they treated as numbers? : no\n" +"integers, floats and booleans are held as: strings\n" +"can use the API to get converted values directly: true\n" +"\n" +"[Multiline Values]\n" +"chorus: I'm a lumberjack, and I'm okay\n" +" I sleep all night and I work all day\n" +"\n" +"[No Values]\n" +"key_without_value\n" +"empty string value here =\n" +"\n" +"[You can use comments]\n" +"# like this\n" +"; or this\n" +"\n" +"# By default only in an empty line.\n" +"# Inline comments can be harmful because they prevent users\n" +"# from using the delimiting characters as parts of values.\n" +"# That being said, this can be customized.\n" +"\n" +" [Sections Can Be Indented]\n" +" can_values_be_as_well = True\n" +" does_that_mean_anything_special = False\n" +" purpose = formatting for readability\n" +" multiline_values = are\n" +" handled just fine as\n" +" long as they are indented\n" +" deeper than the first line\n" +" of a value\n" +" # Did I mention we can indent comments, too?" msgid "Unnamed Sections" -msgstr "" +msgstr "بخش‌های بی‌نام" -msgid "The name of the first section (or unique) may be omitted and values retrieved by the :const:`UNNAMED_SECTION` attribute." +msgid "" +"The name of the first section (or unique) may be omitted and values " +"retrieved by the :const:`UNNAMED_SECTION` attribute." msgstr "" +"نام اولین بخش (یا یکتا) می‌تواند حذف شود و مقادیر از طریق ویژگی " +":const:`UNNAMED_SECTION` بازیابی شوند." msgid "" ">>> config = \"\"\"\n" @@ -314,15 +623,39 @@ msgid "" ">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" "'value'" msgstr "" +">>> config = \"\"\"\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> unnamed = configparser.ConfigParser(allow_unnamed_section=True)\n" +">>> unnamed.read_string(config)\n" +">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" +"'value'" msgid "Interpolation of values" -msgstr "" +msgstr "درون‌یابی مقادیر" -msgid "On top of the core functionality, :class:`ConfigParser` supports interpolation. This means values can be preprocessed before returning them from ``get()`` calls." +msgid "" +"On top of the core functionality, :class:`ConfigParser` supports " +"interpolation. This means values can be preprocessed before returning them " +"from ``get()`` calls." msgstr "" +"علاوه بر قابلیت‌های اصلی، :class:`ConfigParser` از درون‌یابی (interpolation)" +" پشتیبانی می‌کند. این بدان معناست که می‌توان مقادیر را پیش از بازگرداندن " +"آن‌ها از فراخوانی‌های ``get()`` پیش‌پردازش کرد." -msgid "The default implementation used by :class:`ConfigParser`. It enables values to contain format strings which refer to other values in the same section, or values in the special default section [1]_. Additional default values can be provided on initialization." +msgid "" +"The default implementation used by :class:`ConfigParser`. It enables values" +" to contain format strings which refer to other values in the same section, " +"or values in the special default section [1]_. Additional default values " +"can be provided on initialization." msgstr "" +"پیاده‌سازی پیش‌فرضی که توسط :class:`ConfigParser` استفاده می‌شود. این امکان " +"را فراهم می‌کند که مقادیر شامل رشته‌های قالب‌بندی باشند که به مقادیر دیگر در" +" همان بخش، یا مقادیر بخش پیش‌فرض خاص [1]_ ارجاع می‌دهند. می‌توان مقادیر " +"پیش‌فرض اضافی را در هنگام مقداردهی اولیه ارائه کرد." msgid "" "[Paths]\n" @@ -334,18 +667,60 @@ msgid "" "# use a %% to escape the % sign (% is the only character that needs to be escaped):\n" "gain: 80%%" msgstr "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: %(home_dir)s/lumberjack\n" +"my_pictures: %(my_dir)s/Pictures\n" +"\n" +"[Escape]\n" +"# use a %% to escape the % sign (% is the only character that needs to be escaped):\n" +"gain: 80%%" -msgid "In the example above, :class:`ConfigParser` with *interpolation* set to ``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of ``home_dir`` (``/Users`` in this case). ``%(my_dir)s`` in effect would resolve to ``/Users/lumberjack``. All interpolations are done on demand so keys used in the chain of references do not have to be specified in any specific order in the configuration file." -msgstr "" +msgid "" +"In the example above, :class:`ConfigParser` with *interpolation* set to " +"``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " +"``home_dir`` (``/Users`` in this case). ``%(my_dir)s`` in effect would " +"resolve to ``/Users/lumberjack``. All interpolations are done on demand so " +"keys used in the chain of references do not have to be specified in any " +"specific order in the configuration file." +msgstr "" +"در مثال بالا، :class:`ConfigParser` که *درون‌یابی (interpolation)* آن روی " +"``BasicInterpolation()`` تنظیم شده است، ``%(home_dir)s`` را به مقدار " +"``home_dir`` حل می‌کند (در این مورد ``/Users``). در عمل، ``%(my_dir)s`` به " +"``/Users/lumberjack`` حل می‌شود. همه درون‌یابی‌ها در زمان نیاز انجام " +"می‌شوند، بنابراین کلیدهای استفاده‌شده در زنجیره‌ای از ارجاع‌ها لازم نیست با" +" ترتیب خاصی در فایل پیکربندی مشخص شوند." -msgid "With ``interpolation`` set to ``None``, the parser would simply return ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/lumberjack`` as the value of ``my_dir``." +msgid "" +"With ``interpolation`` set to ``None``, the parser would simply return " +"``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and " +"``%(home_dir)s/lumberjack`` as the value of ``my_dir``." msgstr "" +"وقتی ``interpolation`` روی ``None`` تنظیم شده باشد، پارسر به‌سادگی " +"``%(my_dir)s/Pictures`` را به‌عنوان مقدار ``my_pictures`` و " +"``%(home_dir)s/lumberjack`` را به‌عنوان مقدار ``my_dir`` برمی‌گرداند." -msgid "An alternative handler for interpolation which implements a more advanced syntax, used for instance in ``zc.buildout``. Extended interpolation is using ``${section:option}`` to denote a value from a foreign section. Interpolation can span multiple levels. For convenience, if the ``section:`` part is omitted, interpolation defaults to the current section (and possibly the default values from the special section)." -msgstr "" +msgid "" +"An alternative handler for interpolation which implements a more advanced " +"syntax, used for instance in ``zc.buildout``. Extended interpolation is " +"using ``${section:option}`` to denote a value from a foreign section. " +"Interpolation can span multiple levels. For convenience, if the " +"``section:`` part is omitted, interpolation defaults to the current section " +"(and possibly the default values from the special section)." +msgstr "" +"یک هندلر جایگزین برای درون‌یابی (interpolation) که نحو پیشرفته‌تری را " +"پیاده‌سازی می‌کند و برای نمونه در ``zc.buildout`` استفاده می‌شود. درون‌یابی " +"گسترده از ``${section:option}`` برای مشخص کردن مقداری از یک بخش دیگر استفاده" +" می‌کند. درون‌یابی می‌تواند چندین سطح را در بر بگیرد. برای سهولت، اگر قسمت " +"``section:`` حذف شود، درون‌یابی به‌طور پیش‌فرض از بخش جاری (و احتمالاً از " +"مقادیر پیش‌فرض بخش ویژه) استفاده می‌کند." -msgid "For example, the configuration specified above with basic interpolation, would look like this with extended interpolation:" +msgid "" +"For example, the configuration specified above with basic interpolation, " +"would look like this with extended interpolation:" msgstr "" +"برای مثال، پیکربندی مشخص‌شده در بالا با درون‌یابی پایه، با درون‌یابی گسترده " +"به این شکل خواهد بود:" msgid "" "[Paths]\n" @@ -357,9 +732,17 @@ msgid "" "# use a $$ to escape the $ sign ($ is the only character that needs to be escaped):\n" "cost: $$80" msgstr "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: ${home_dir}/lumberjack\n" +"my_pictures: ${my_dir}/Pictures\n" +"\n" +"[Escape]\n" +"# برای خنثی کردن علامت $ از $$ استفاده کنید ($ تنها نویسه‌ای است که نیاز به خنثی شدن دارد):\n" +"cost: $$80" msgid "Values from other sections can be fetched as well:" -msgstr "" +msgstr "مقادیر بخش‌های دیگر را نیز می‌توان واکشی کرد:" msgid "" "[Common]\n" @@ -379,80 +762,213 @@ msgid "" "my_pictures: ${my_dir}/Pictures\n" "python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" msgstr "" +"[Common]\n" +"home_dir: /Users\n" +"library_dir: /Library\n" +"system_dir: /System\n" +"macports_dir: /opt/local\n" +"\n" +"[Frameworks]\n" +"Python: 3.2\n" +"path: ${Common:system_dir}/Library/Frameworks/\n" +"\n" +"[Arthur]\n" +"nickname: Two Sheds\n" +"last_name: Jackson\n" +"my_dir: ${Common:home_dir}/twosheds\n" +"my_pictures: ${my_dir}/Pictures\n" +"python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" msgid "Mapping Protocol Access" -msgstr "" +msgstr "دسترسی به پروتکل نگاشت" -msgid "Mapping protocol access is a generic name for functionality that enables using custom objects as if they were dictionaries. In case of :mod:`!configparser`, the mapping interface implementation is using the ``parser['section']['option']`` notation." +msgid "" +"Mapping protocol access is a generic name for functionality that enables " +"using custom objects as if they were dictionaries. In case of " +":mod:`!configparser`, the mapping interface implementation is using the " +"``parser['section']['option']`` notation." msgstr "" +"دسترسی به پروتکل نگاشت (mapping protocol) نامی کلی برای قابلیتی است که امکان" +" استفاده از اشیاء سفارشی را گویی آن‌ها دیکشنری هستند، فراهم می‌کند. در مورد " +":mod:`!configparser`، پیاده‌سازی رابط نگاشت از نمادگذاری " +"``parser['section']['option']`` استفاده می‌کند." -msgid "``parser['section']`` in particular returns a proxy for the section's data in the parser. This means that the values are not copied but they are taken from the original parser on demand. What's even more important is that when values are changed on a section proxy, they are actually mutated in the original parser." -msgstr "" +msgid "" +"``parser['section']`` in particular returns a proxy for the section's data " +"in the parser. This means that the values are not copied but they are taken" +" from the original parser on demand. What's even more important is that " +"when values are changed on a section proxy, they are actually mutated in the" +" original parser." +msgstr "" +"``parser['section']`` به‌طور خاص یک پراکسی برای داده‌های بخش در " +"پارسر برمی‌گرداند. این بدان معناست که مقادیر کپی نمی‌شوند، بلکه در صورت " +"درخواست از پارسر اصلی گرفته می‌شوند. آنچه حتی مهم‌تر است این است که وقتی " +"مقادیر روی یک پراکسی بخش تغییر می‌کنند، در واقع در پارسر اصلی تغییر " +"می‌یابند." -msgid ":mod:`!configparser` objects behave as close to actual dictionaries as possible. The mapping interface is complete and adheres to the :class:`~collections.abc.MutableMapping` ABC. However, there are a few differences that should be taken into account:" +msgid "" +":mod:`!configparser` objects behave as close to actual dictionaries as " +"possible. The mapping interface is complete and adheres to the " +":class:`~collections.abc.MutableMapping` ABC. However, there are a few " +"differences that should be taken into account:" msgstr "" +"اشیای :mod:`!configparser` تا حد ممکن مانند دیکشنری‌های واقعی رفتار می‌کنند." +" رابط نگاشت کامل است و از ABC :class:`~collections.abc.MutableMapping` پیروی" +" می‌کند. با این حال، چند تفاوت وجود دارد که باید در نظر گرفته شوند:" -msgid "By default, all keys in sections are accessible in a case-insensitive manner [1]_. E.g. ``for option in parser[\"section\"]`` yields only ``optionxform``'ed option key names. This means lowercased keys by default. At the same time, for a section that holds the key ``'a'``, both expressions return ``True``::" -msgstr "" +msgid "" +"By default, all keys in sections are accessible in a case-insensitive manner" +" [1]_. E.g. ``for option in parser[\"section\"]`` yields only " +"``optionxform``'ed option key names. This means lowercased keys by default." +" At the same time, for a section that holds the key ``'a'``, both " +"expressions return ``True``::" +msgstr "" +"به‌طور پیش‌فرض، همه کلیدهای درون بخش‌ها به‌صورت غیرحساس به حروف کوچک و بزرگ " +"قابل دسترسی هستند [1]_. برای مثال، ``for option in parser[\"section\"]`` " +"فقط نام کلیدهای گزینه‌ای را که با ``optionxform`` تبدیل‌شده‌اند برمی‌گرداند." +" این یعنی کلیدها به‌طور پیش‌فرض با حروف کوچک هستند. در عین حال، برای بخشی " +"که کلید ``'a'`` را دارد، هر دو عبارت ``True`` را برمی‌گردانند::" msgid "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" msgstr "" +"\"a\" in parser[\"section\"]\n" +"\"A\" in parser[\"section\"]" -msgid "All sections include ``DEFAULTSECT`` values as well which means that ``.clear()`` on a section may not leave the section visibly empty. This is because default values cannot be deleted from the section (because technically they are not there). If they are overridden in the section, deleting causes the default value to be visible again. Trying to delete a default value causes a :exc:`KeyError`." -msgstr "" +msgid "" +"All sections include ``DEFAULTSECT`` values as well which means that " +"``.clear()`` on a section may not leave the section visibly empty. This is " +"because default values cannot be deleted from the section (because " +"technically they are not there). If they are overridden in the section, " +"deleting causes the default value to be visible again. Trying to delete a " +"default value causes a :exc:`KeyError`." +msgstr "" +"همه‌ی بخش‌ها شامل مقادیر ``DEFAULTSECT`` نیز می‌شوند، به این معنا که " +"``.clear()`` روی یک بخش ممکن است بخش را به‌صورت قابل‌مشاهده‌ای خالی نگذارد. " +"دلیلش این است که نمی‌توان مقادیر پیش‌فرض را از بخش حذف کرد (زیرا از نظر فنی " +"در آنجا وجود ندارند). اگر این مقادیر در بخش بازنویسی شده باشند، حذف از بخش " +"باعث می‌شود مقدار پیش‌فرض دوباره نمایان شود. تلاش برای حذف یک مقدار پیش‌فرض " +"منجر به :exc:`KeyError` می‌شود." msgid "``DEFAULTSECT`` cannot be removed from the parser:" -msgstr "" +msgstr "``DEFAULTSECT`` را نمی‌توان از پارسر حذف کرد:" msgid "trying to delete it raises :exc:`ValueError`," -msgstr "" +msgstr "تلاش برای حذف آن موجب پرتاب :exc:`ValueError` می‌شود،" msgid "``parser.clear()`` leaves it intact," -msgstr "" +msgstr "``parser.clear()`` آن را دست‌نخورده باقی می‌گذارد،" msgid "``parser.popitem()`` never returns it." -msgstr "" +msgstr "``parser.popitem()`` هرگز آن را برنمی‌گرداند." -msgid "``parser.get(section, option, **kwargs)`` - the second argument is **not** a fallback value. Note however that the section-level ``get()`` methods are compatible both with the mapping protocol and the classic configparser API." +msgid "" +"``parser.get(section, option, **kwargs)`` - the second argument is **not** a" +" fallback value. Note however that the section-level ``get()`` methods are " +"compatible both with the mapping protocol and the classic configparser API." msgstr "" +"``parser.get(section, option, **kwargs)`` - آرگومان دوم یک مقدار جایگزین " +"**نیست**. با این حال توجه داشته باشید که متدهای ``get()`` در سطح بخش، هم با" +" پروتکل نگاشت و هم با API کلاسیک configparser سازگار هستند." -msgid "``parser.items()`` is compatible with the mapping protocol (returns a list of *section_name*, *section_proxy* pairs including the DEFAULTSECT). However, this method can also be invoked with arguments: ``parser.items(section, raw, vars)``. The latter call returns a list of *option*, *value* pairs for a specified ``section``, with all interpolations expanded (unless ``raw=True`` is provided)." -msgstr "" +msgid "" +"``parser.items()`` is compatible with the mapping protocol (returns a list " +"of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " +"However, this method can also be invoked with arguments: " +"``parser.items(section, raw, vars)``. The latter call returns a list of " +"*option*, *value* pairs for a specified ``section``, with all interpolations" +" expanded (unless ``raw=True`` is provided)." +msgstr "" +"``parser.items()`` با پروتکل نگاشت (mapping protocol) سازگار است (فهرستی از " +"جفت‌های *section_name* و *section_proxy* را برمی‌گرداند که DEFAULTSECT را " +"نیز شامل می‌شود). با این حال، می‌توان این متد را با آرگومان‌ها نیز فراخوانی " +"کرد: ``parser.items(section, raw, vars)``. فراخوانی دوم، فهرستی از جفت‌های " +"*option* و *value* را برای یک ``section`` مشخص برمی‌گرداند، به‌طوری که همه " +"درون‌یابی‌ها (interpolations) بسط یافته‌اند (مگر آنکه ``raw=True`` ارائه شده" +" باشد)." -msgid "The mapping protocol is implemented on top of the existing legacy API so that subclasses overriding the original interface still should have mappings working as expected." +msgid "" +"The mapping protocol is implemented on top of the existing legacy API so " +"that subclasses overriding the original interface still should have mappings" +" working as expected." msgstr "" +"پروتکل نگاشت (mapping protocol) بر روی API قدیمی موجود پیاده‌سازی شده است، " +"به‌طوری که زیرکلاس‌هایی که رابط اصلی را بازنویسی می‌کنند نیز همچنان باید " +"نگاشت‌هایی داشته باشند که طبق انتظار کار می‌کنند." msgid "Customizing Parser Behaviour" -msgstr "" +msgstr "سفارشی‌سازی رفتار پارسر" -msgid "There are nearly as many INI format variants as there are applications using it. :mod:`!configparser` goes a long way to provide support for the largest sensible set of INI styles available. The default functionality is mainly dictated by historical background and it's very likely that you will want to customize some of the features." -msgstr "" +msgid "" +"There are nearly as many INI format variants as there are applications using" +" it. :mod:`!configparser` goes a long way to provide support for the largest" +" sensible set of INI styles available. The default functionality is mainly " +"dictated by historical background and it's very likely that you will want to" +" customize some of the features." +msgstr "" +"تقریباً به تعداد برنامه‌هایی که از قالب INI استفاده می‌کنند، گونه‌های مختلفی" +" از این قالب وجود دارد. :mod:`!configparser` تا حد زیادی پشتیبانی از " +"بزرگ‌ترین مجموعه‌ی معقول از سبک‌های موجود INI را فراهم می‌کند. عملکرد " +"پیش‌فرض عمدتاً تحت تأثیر پیشینه‌ی تاریخی است و بسیار محتمل است که بخواهید " +"برخی از قابلیت‌ها را سفارشی‌سازی کنید." -msgid "The most common way to change the way a specific config parser works is to use the :meth:`!__init__` options:" +msgid "" +"The most common way to change the way a specific config parser works is to " +"use the :meth:`!__init__` options:" msgstr "" +"رایج‌ترین روش برای تغییر شیوه‌ی کار یک پارسر پیکربندی (config parser) مشخص، " +"استفاده از گزینه‌های :meth:`!__init__` است:" msgid "*defaults*, default value: ``None``" -msgstr "" +msgstr "*defaults*، مقدار پیش‌فرض: ``None``" -msgid "This option accepts a dictionary of key-value pairs which will be initially put in the ``DEFAULT`` section. This makes for an elegant way to support concise configuration files that don't specify values which are the same as the documented default." +msgid "" +"This option accepts a dictionary of key-value pairs which will be initially " +"put in the ``DEFAULT`` section. This makes for an elegant way to support " +"concise configuration files that don't specify values which are the same as " +"the documented default." msgstr "" +"این گزینه یک دیکشنری از جفت‌های کلید-مقدار را می‌پذیرد که در ابتدا در بخش " +"``DEFAULT`` قرار می‌گیرند. این امر راهی ظریف برای پشتیبانی از فایل‌های " +"پیکربندی مختصر فراهم می‌کند که مقادیر همسان با پیش‌فرض مستندشده را مشخص " +"نمی‌کنند." -msgid "Hint: if you want to specify default values for a specific section, use :meth:`~ConfigParser.read_dict` before you read the actual file." +msgid "" +"Hint: if you want to specify default values for a specific section, use " +":meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" +"نکته: اگر می‌خواهید مقادیر پیش‌فرض برای یک بخش مشخص تعیین کنید، قبل از " +"خواندن فایل واقعی از :meth:`~ConfigParser.read_dict` استفاده کنید." msgid "*dict_type*, default value: :class:`dict`" -msgstr "" +msgstr "*dict_type*، مقدار پیش‌فرض: :class:`dict`" -msgid "This option has a major impact on how the mapping protocol will behave and how the written configuration files look. With the standard dictionary, every section is stored in the order they were added to the parser. Same goes for options within sections." +msgid "" +"This option has a major impact on how the mapping protocol will behave and " +"how the written configuration files look. With the standard dictionary, " +"every section is stored in the order they were added to the parser. Same " +"goes for options within sections." msgstr "" +"این گزینه تأثیر عمده‌ای بر رفتار پروتکل نگاشت و ظاهر فایل‌های پیکربندی " +"نوشته‌شده دارد. با دیکشنری استاندارد، هر بخش به ترتیبی که به پارسر افزوده " +"شده است، ذخیره می‌شود. همین موضوع برای گزینه‌های درون بخش‌ها نیز صدق می‌کند." -msgid "An alternative dictionary type can be used for example to sort sections and options on write-back." +msgid "" +"An alternative dictionary type can be used for example to sort sections and " +"options on write-back." msgstr "" +"برای مثال، می‌توان از یک نوع دیکشنری جایگزین برای مرتب‌سازی بخش‌ها و " +"گزینه‌ها در زمان بازنویسی (write-back) استفاده کرد." -msgid "Please note: there are ways to add a set of key-value pairs in a single operation. When you use a regular dictionary in those operations, the order of the keys will be ordered. For example:" +msgid "" +"Please note: there are ways to add a set of key-value pairs in a single " +"operation. When you use a regular dictionary in those operations, the order" +" of the keys will be ordered. For example:" msgstr "" +"توجه داشته باشید: راه‌هایی برای افزودن مجموعه‌ای از جفت‌های کلید-مقدار در یک" +" عملیات وجود دارد. هنگامی که از یک دیکشنری معمولی در آن عملیات‌ها استفاده " +"می‌کنید، ترتیب کلیدها حفظ خواهد شد. برای مثال:" msgid "" ">>> parser = configparser.ConfigParser()\n" @@ -471,12 +987,35 @@ msgid "" ">>> [option for option in parser['section3']]\n" "['foo', 'bar', 'baz']" msgstr "" +">>> parser = configparser.ConfigParser()\n" +">>> parser.read_dict({'section1': {'key1': 'value1',\n" +"... 'key2': 'value2',\n" +"... 'key3': 'value3'},\n" +"... 'section2': {'keyA': 'valueA',\n" +"... 'keyB': 'valueB',\n" +"... 'keyC': 'valueC'},\n" +"... 'section3': {'foo': 'x',\n" +"... 'bar': 'y',\n" +"... 'baz': 'z'}\n" +"... })\n" +">>> parser.sections()\n" +"['section1', 'section2', 'section3']\n" +">>> [option for option in parser['section3']]\n" +"['foo', 'bar', 'baz']" msgid "*allow_no_value*, default value: ``False``" -msgstr "" +msgstr "*allow_no_value*، مقدار پیش‌فرض: ``False``" -msgid "Some configuration files are known to include settings without values, but which otherwise conform to the syntax supported by :mod:`!configparser`. The *allow_no_value* parameter to the constructor can be used to indicate that such values should be accepted:" +msgid "" +"Some configuration files are known to include settings without values, but " +"which otherwise conform to the syntax supported by :mod:`!configparser`. " +"The *allow_no_value* parameter to the constructor can be used to indicate " +"that such values should be accepted:" msgstr "" +"شناخته شده است که برخی از فایل‌های پیکربندی شامل تنظیمات بدون مقدار هستند، " +"اما در غیر این صورت با سینتکس پشتیبانی‌شده توسط :mod:`!configparser` مطابقت " +"دارند. می‌توان از پارامتر *allow_no_value* در سازنده برای نشان دادن اینکه " +"چنین مقادیری باید پذیرفته شوند استفاده کرد:" msgid "" ">>> import configparser\n" @@ -507,30 +1046,97 @@ msgid "" " ...\n" "KeyError: 'does-not-exist'" msgstr "" +">>> import configparser\n" +"\n" +">>> sample_config = \"\"\"\n" +"... [mysqld]\n" +"... user = mysql\n" +"... pid-file = /var/run/mysqld/mysqld.pid\n" +"... skip-external-locking\n" +"... old_passwords = 1\n" +"... skip-bdb\n" +"... # we don't need ACID today\n" +"... skip-innodb\n" +"... \"\"\"\n" +">>> config = configparser.ConfigParser(allow_no_value=True)\n" +">>> config.read_string(sample_config)\n" +"\n" +">>> # Settings with values are treated as before:\n" +">>> config[\"mysqld\"][\"user\"]\n" +"'mysql'\n" +"\n" +">>> # Settings without values provide None:\n" +">>> config[\"mysqld\"][\"skip-bdb\"]\n" +"\n" +">>> # Settings which aren't specified still raise an error:\n" +">>> config[\"mysqld\"][\"does-not-exist\"]\n" +"Traceback (most recent call last):\n" +" ...\n" +"KeyError: 'does-not-exist'" msgid "*delimiters*, default value: ``('=', ':')``" -msgstr "" +msgstr "*جداکننده‌ها*، مقدار پیش‌فرض: ``('=', ':')``" -msgid "Delimiters are substrings that delimit keys from values within a section. The first occurrence of a delimiting substring on a line is considered a delimiter. This means values (but not keys) can contain the delimiters." +msgid "" +"Delimiters are substrings that delimit keys from values within a section. " +"The first occurrence of a delimiting substring on a line is considered a " +"delimiter. This means values (but not keys) can contain the delimiters." msgstr "" +"جداکننده‌ها زیررشته‌هایی هستند که کلیدها را از مقادیر درون یک بخش جدا " +"می‌کنند. نخستین رخداد یک زیررشته جداکننده در یک خط به‌عنوان جداکننده در نظر " +"گرفته می‌شود. این بدان معناست که مقادیر (نه کلیدها) می‌توانند شامل " +"جداکننده‌ها باشند." -msgid "See also the *space_around_delimiters* argument to :meth:`ConfigParser.write`." +msgid "" +"See also the *space_around_delimiters* argument to " +":meth:`ConfigParser.write`." msgstr "" +"همچنین آرگومان *space_around_delimiters* برای :meth:`ConfigParser.write` را " +"ببینید." msgid "*comment_prefixes*, default value: ``('#', ';')``" -msgstr "" +msgstr "*comment_prefixes*، مقدار پیش‌فرض: ``('#', ';')``" msgid "*inline_comment_prefixes*, default value: ``None``" -msgstr "" +msgstr "*inline_comment_prefixes*، مقدار پیش‌فرض: ``None``" -msgid "Comment prefixes are strings that indicate the start of a valid comment within a config file. *comment_prefixes* are used only on otherwise empty lines (optionally indented) whereas *inline_comment_prefixes* can be used after every valid value (e.g. section names, options and empty lines as well). By default inline comments are disabled and ``'#'`` and ``';'`` are used as prefixes for whole line comments." -msgstr "" +msgid "" +"Comment prefixes are strings that indicate the start of a valid comment " +"within a config file. *comment_prefixes* are used only on otherwise empty " +"lines (optionally indented) whereas *inline_comment_prefixes* can be used " +"after every valid value (e.g. section names, options and empty lines as " +"well). By default inline comments are disabled and ``'#'`` and ``';'`` are " +"used as prefixes for whole line comments." +msgstr "" +"پیشوندهای کامنت رشته‌هایی هستند که آغاز یک کامنت معتبر در فایل پیکربندی را " +"نشان می‌دهند. *comment_prefixes* فقط در خطوطی که در غیر این صورت خالی هستند " +"(با تورفتگی اختیاری) استفاده می‌شوند، در حالی که *inline_comment_prefixes* " +"می‌توانند پس از هر مقدار معتبر (برای مثال نام بخش‌ها، گزینه‌ها و همچنین خطوط" +" خالی) استفاده شوند. به‌طور پیش‌فرض، کامنت‌های درون‌خطی غیرفعال هستند و از " +"``'#'`` و ``';'`` به‌عنوان پیشوند برای کامنت‌های کل خط استفاده می‌شود." -msgid "In previous versions of :mod:`!configparser` behaviour matched ``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." +msgid "" +"In previous versions of :mod:`!configparser` behaviour matched " +"``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" +"در نسخه‌های پیشین :mod:`!configparser`، رفتار مطابق " +"``comment_prefixes=('#',';')`` و ``inline_comment_prefixes=(';',)`` بود." -msgid "Please note that config parsers don't support escaping of comment prefixes so using *inline_comment_prefixes* may prevent users from specifying option values with characters used as comment prefixes. When in doubt, avoid setting *inline_comment_prefixes*. In any circumstances, the only way of storing comment prefix characters at the beginning of a line in multiline values is to interpolate the prefix, for example::" -msgstr "" +msgid "" +"Please note that config parsers don't support escaping of comment prefixes " +"so using *inline_comment_prefixes* may prevent users from specifying option " +"values with characters used as comment prefixes. When in doubt, avoid " +"setting *inline_comment_prefixes*. In any circumstances, the only way of " +"storing comment prefix characters at the beginning of a line in multiline " +"values is to interpolate the prefix, for example::" +msgstr "" +"لطفاً توجه داشته باشید که پارسرهای پیکربندی از خنثی‌سازی پیشوندهای کامنت " +"پشتیبانی نمی‌کنند، بنابراین استفاده از *inline_comment_prefixes* ممکن است " +"کاربران را از تعیین مقادیر گزینه حاوی نویسه‌هایی که به‌عنوان پیشوندهای " +"کامنت استفاده می‌شوند، باز دارد. در صورت تردید، از تنظیم " +"*inline_comment_prefixes* خودداری کنید. در هر شرایطی، تنها راه ذخیره‌سازی " +"نویسه‌های پیشوند کامنت در ابتدای یک خط در مقادیر چندخطی، درون‌یابی پیشوند " +"است، برای مثال::" msgid "" ">>> from configparser import ConfigParser, ExtendedInterpolation\n" @@ -571,22 +1177,86 @@ msgid "" "line #1\n" "line #2\n" "line #3" -msgstr "" +msgstr "" +">>> from configparser import ConfigParser, ExtendedInterpolation\n" +">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" +">>> # the default BasicInterpolation could be used as well\n" +">>> parser.read_string(\"\"\"\n" +"... [DEFAULT]\n" +"... hash = #\n" +"...\n" +"... [hashes]\n" +"... shebang =\n" +"... ${hash}!/usr/bin/env python\n" +"... ${hash} -*- coding: utf-8 -*-\n" +"...\n" +"... extensions =\n" +"... enabled_extension\n" +"... another_extension\n" +"... #disabled_by_comment\n" +"... yet_another_extension\n" +"...\n" +"... interpolation not necessary = if # is not at line start\n" +"... even in multiline values = line #1\n" +"... line #2\n" +"... line #3\n" +"... \"\"\")\n" +">>> print(parser['hashes']['shebang'])\n" +"\n" +"#!/usr/bin/env python\n" +"# -*- coding: utf-8 -*-\n" +">>> print(parser['hashes']['extensions'])\n" +"\n" +"enabled_extension\n" +"another_extension\n" +"yet_another_extension\n" +">>> print(parser['hashes']['interpolation not necessary'])\n" +"if # is not at line start\n" +">>> print(parser['hashes']['even in multiline values'])\n" +"line #1\n" +"line #2\n" +"line #3" msgid "*strict*, default value: ``True``" -msgstr "" +msgstr "*strict*، مقدار پیش‌فرض: ``True``" -msgid "When set to ``True``, the parser will not allow for any section or option duplicates while reading from a single source (using :meth:`~ConfigParser.read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser.read_dict`). It is recommended to use strict parsers in new applications." -msgstr "" +msgid "" +"When set to ``True``, the parser will not allow for any section or option " +"duplicates while reading from a single source (using " +":meth:`~ConfigParser.read_file`, :meth:`~ConfigParser.read_string` or " +":meth:`~ConfigParser.read_dict`). It is recommended to use strict parsers " +"in new applications." +msgstr "" +"هنگامی که روی ``True`` تنظیم شود، پارسر هنگام خواندن از یک منبع واحد (با " +"استفاده از :meth:`~ConfigParser.read_file`، " +":meth:`~ConfigParser.read_string` یا :meth:`~ConfigParser.read_dict`) اجازه " +"نمی‌دهد هیچ بخش یا گزینه‌ای تکرار شود. توصیه می‌شود در برنامه‌های کاربردی " +"جدید از پارسرهای سخت‌گیر استفاده شود." -msgid "In previous versions of :mod:`!configparser` behaviour matched ``strict=False``." +msgid "" +"In previous versions of :mod:`!configparser` behaviour matched " +"``strict=False``." msgstr "" +"در نسخه‌های پیشین :mod:`!configparser`، رفتار با ``strict=False`` مطابقت " +"داشت." msgid "*empty_lines_in_values*, default value: ``True``" -msgstr "" +msgstr "*empty_lines_in_values*، مقدار پیش‌فرض: ``True``" -msgid "In config parsers, values can span multiple lines as long as they are indented more than the key that holds them. By default parsers also let empty lines to be parts of values. At the same time, keys can be arbitrarily indented themselves to improve readability. In consequence, when configuration files get big and complex, it is easy for the user to lose track of the file structure. Take for instance:" -msgstr "" +msgid "" +"In config parsers, values can span multiple lines as long as they are " +"indented more than the key that holds them. By default parsers also let " +"empty lines to be parts of values. At the same time, keys can be " +"arbitrarily indented themselves to improve readability. In consequence, " +"when configuration files get big and complex, it is easy for the user to " +"lose track of the file structure. Take for instance:" +msgstr "" +"در پارسرهای پیکربندی، مقدارها می‌توانند چندین خط را در بر بگیرند، به‌شرطی " +"که تورفتگی آن‌ها بیشتر از کلیدی باشد که آن‌ها را نگه می‌دارد. به‌طور " +"پیش‌فرض، پارسرها همچنین اجازه می‌دهند خطوط خالی بخشی از مقدارها باشند. در " +"عین حال، خود کلیدها نیز می‌توانند به‌دلخواه تورفتگی داشته باشند تا خوانایی " +"بهبود یابد. در نتیجه، هنگامی که فایل‌های پیکربندی بزرگ و پیچیده می‌شوند، " +"ممکن است کاربر به‌راحتی رد ساختار فایل را گم کند. برای نمونه:" msgid "" "[Section]\n" @@ -595,36 +1265,132 @@ msgid "" "\n" " this = is still a part of the multiline value of 'key'" msgstr "" +"[Section]\n" +"key = multiline\n" +" value with a gotcha\n" +"\n" +" this = is still a part of the multiline value of 'key'" -msgid "This can be especially problematic for the user to see if she's using a proportional font to edit the file. That is why when your application does not need values with empty lines, you should consider disallowing them. This will make empty lines split keys every time. In the example above, it would produce two keys, ``key`` and ``this``." -msgstr "" +msgid "" +"This can be especially problematic for the user to see if she's using a " +"proportional font to edit the file. That is why when your application does " +"not need values with empty lines, you should consider disallowing them. " +"This will make empty lines split keys every time. In the example above, it " +"would produce two keys, ``key`` and ``this``." +msgstr "" +"دیدن این موضوع می‌تواند برای کاربر به‌ویژه مشکل‌ساز باشد، اگر برای ویرایش " +"فایل از قلم متناسب استفاده کند. به همین دلیل، هنگامی که برنامه شما به مقادیر" +" دارای خطوط خالی نیازی ندارد، باید در نظر بگیرید که آن‌ها را غیرمجاز کنید. " +"این کار باعث می‌شود خطوط خالی هر بار کلیدها را جدا کنند. در مثال بالا، این " +"کار دو کلید، ``key`` و ``this``، تولید می‌کند." -msgid "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: ``\"DEFAULT\"``)" +msgid "" +"*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " +"``\"DEFAULT\"``)" msgstr "" +"*default_section*، مقدار پیش‌فرض: ``configparser.DEFAULTSECT`` (یعنی " +"``\"DEFAULT\"``)" -msgid "The convention of allowing a special section of default values for other sections or interpolation purposes is a powerful concept of this library, letting users create complex declarative configurations. This section is normally called ``\"DEFAULT\"`` but this can be customized to point to any other valid section name. Some typical values include: ``\"general\"`` or ``\"common\"``. The name provided is used for recognizing default sections when reading from any source and is used when writing configuration back to a file. Its current value can be retrieved using the ``parser_instance.default_section`` attribute and may be modified at runtime (i.e. to convert files from one format to another)." -msgstr "" +msgid "" +"The convention of allowing a special section of default values for other " +"sections or interpolation purposes is a powerful concept of this library, " +"letting users create complex declarative configurations. This section is " +"normally called ``\"DEFAULT\"`` but this can be customized to point to any " +"other valid section name. Some typical values include: ``\"general\"`` or " +"``\"common\"``. The name provided is used for recognizing default sections " +"when reading from any source and is used when writing configuration back to " +"a file. Its current value can be retrieved using the " +"``parser_instance.default_section`` attribute and may be modified at runtime" +" (i.e. to convert files from one format to another)." +msgstr "" +"قراردادِ وجود یک بخش ویژه از مقادیر پیش‌فرض برای سایر بخش‌ها یا اهداف " +"درون‌یابی (interpolation)، مفهوم قدرتمندی در این کتابخانه است که به کاربران " +"امکان می‌دهد پیکربندی‌های اعلامی پیچیده‌ای ایجاد کنند. این بخش معمولاً " +"``\"DEFAULT\"`` نامیده می‌شود، اما می‌توان آن را سفارشی‌سازی کرد تا به هر " +"نام بخش معتبر دیگری اشاره کند. برخی مقادیر معمول عبارت‌اند از: " +"``\"general\"`` یا ``\"common\"``. نام ارائه‌شده برای شناسایی بخش‌های " +"پیش‌فرض هنگام خواندن از هر منبعی استفاده می‌شود و همچنین هنگام نوشتن " +"پیکربندی به یک فایل نیز به کار می‌رود. مقدار فعلی آن را می‌توان با استفاده " +"از ویژگی ``parser_instance.default_section`` دریافت کرد و می‌توان آن را در " +"ران‌تایم تغییر داد (یعنی برای تبدیل فایل‌ها از یک قالب به قالب دیگر)." msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" -msgstr "" +msgstr "*interpolation*، مقدار پیش‌فرض: ``configparser.BasicInterpolation``" -msgid "Interpolation behaviour may be customized by providing a custom handler through the *interpolation* argument. ``None`` can be used to turn off interpolation completely, ``ExtendedInterpolation()`` provides a more advanced variant inspired by ``zc.buildout``. More on the subject in the `dedicated documentation section <#interpolation-of-values>`_. :class:`RawConfigParser` has a default value of ``None``." -msgstr "" +msgid "" +"Interpolation behaviour may be customized by providing a custom handler " +"through the *interpolation* argument. ``None`` can be used to turn off " +"interpolation completely, ``ExtendedInterpolation()`` provides a more " +"advanced variant inspired by ``zc.buildout``. More on the subject in the " +"`dedicated documentation section <#interpolation-of-values>`_. " +":class:`RawConfigParser` has a default value of ``None``." +msgstr "" +"می‌توان رفتار درون‌یابی (interpolation) را با ارائه یک هندلر سفارشی از" +" طریق آرگومان *interpolation* سفارشی‌سازی کرد. می‌توان از ``None`` برای " +"غیرفعال کردن کامل درون‌یابی استفاده کرد؛ ``ExtendedInterpolation()`` گونه‌ای" +" پیشرفته‌تر را فراهم می‌کند که از ``zc.buildout`` الهام‌گرفته است. اطلاعات " +"بیشتر درباره این موضوع در `بخش اختصاصی مستندات <#interpolation-of-values>`_ " +"آمده است. :class:`RawConfigParser` دارای مقدار پیش‌فرض ``None`` است." msgid "*converters*, default value: not set" -msgstr "" +msgstr "*converters*، مقدار پیش‌فرض: تنظیم‌نشده" -msgid "Config parsers provide option value getters that perform type conversion. By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, and :meth:`~ConfigParser.getboolean` are implemented. Should other getters be desirable, users may define them in a subclass or pass a dictionary where each key is a name of the converter and each value is a callable implementing said conversion. For instance, passing ``{'decimal': decimal.Decimal}`` would add :meth:`!getdecimal` on both the parser object and all section proxies. In other words, it will be possible to write both ``parser_instance.getdecimal('section', 'key', fallback=0)`` and ``parser_instance['section'].getdecimal('key', 0)``." -msgstr "" +msgid "" +"Config parsers provide option value getters that perform type conversion. " +"By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, and" +" :meth:`~ConfigParser.getboolean` are implemented. Should other getters be " +"desirable, users may define them in a subclass or pass a dictionary where " +"each key is a name of the converter and each value is a callable " +"implementing said conversion. For instance, passing ``{'decimal': " +"decimal.Decimal}`` would add :meth:`!getdecimal` on both the parser object " +"and all section proxies. In other words, it will be possible to write both " +"``parser_instance.getdecimal('section', 'key', fallback=0)`` and " +"``parser_instance['section'].getdecimal('key', 0)``." +msgstr "" +"پارسرهای پیکربندی، دریابندههای مقدار گزینه را فراهم می‌کنند که تبدیل " +"نوع را انجام می‌دهند. به‌طور پیش‌فرض :meth:`~ConfigParser.getint`، " +":meth:`~ConfigParser.getfloat` و :meth:`~ConfigParser.getboolean` پیاده‌سازی" +" شده‌اند. در صورت نیاز به دریابندههای دیگر، کاربران می‌توانند آن‌ها را " +"در یک زیرکلاس تعریف کنند یا یک دیکشنری ارسال کنند که هر کلید آن نام مبدل و " +"هر مقدار آن یک شیء قابل فراخوانی است که تبدیل مذکور را پیاده‌سازی می‌کند. " +"برای مثال، ارسال ``{'decimal': decimal.Decimal}`` باعث می‌شود " +":meth:`!getdecimal` هم به شیء پارسر و هم به تمام پراکسی‌های بخش اضافه شود. " +"به بیان دیگر، امکان نوشتن هر دو ``parser_instance.getdecimal('section', " +"'key', fallback=0)`` و ``parser_instance['section'].getdecimal('key', 0)`` " +"وجود خواهد داشت." -msgid "If the converter needs to access the state of the parser, it can be implemented as a method on a config parser subclass. If the name of this method starts with ``get``, it will be available on all section proxies, in the dict-compatible form (see the ``getdecimal()`` example above)." +msgid "" +"If the converter needs to access the state of the parser, it can be " +"implemented as a method on a config parser subclass. If the name of this " +"method starts with ``get``, it will be available on all section proxies, in " +"the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" +"اگر مبدل نیاز به دسترسی به وضعیت پارسر داشته باشد، می‌توان آن را به‌صورت " +"متدی در یک زیرکلاس پارسر پیکربندی پیاده‌سازی کرد. اگر نام این متد با ``get``" +" آغاز شود، در همه پراکسی‌های بخش، در قالب سازگار با دیکشنری در دسترس خواهد " +"بود (مثال ``getdecimal()`` بالا را ببینید)." -msgid "More advanced customization may be achieved by overriding default values of these parser attributes. The defaults are defined on the classes, so they may be overridden by subclasses or by attribute assignment." +msgid "" +"More advanced customization may be achieved by overriding default values of " +"these parser attributes. The defaults are defined on the classes, so they " +"may be overridden by subclasses or by attribute assignment." msgstr "" +"با تغییر مقادیر پیش‌فرض این ویژگی‌های پارسر می‌توان به سفارشی‌سازی " +"پیشرفته‌تری دست یافت. مقادیر پیش‌فرض روی کلاس‌ها تعریف شده‌اند، بنابراین " +"می‌توان آن‌ها را در زیرکلاس‌ها یا از طریق انتساب ویژگی تغییر داد." -msgid "By default when using :meth:`~ConfigParser.getboolean`, config parsers consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, ``'on'`` and the following values ``False``: ``'0'``, ``'no'``, ``'false'``, ``'off'``. You can override this by specifying a custom dictionary of strings and their Boolean outcomes. For example:" -msgstr "" +msgid "" +"By default when using :meth:`~ConfigParser.getboolean`, config parsers " +"consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " +"``'on'`` and the following values ``False``: ``'0'``, ``'no'``, ``'false'``," +" ``'off'``. You can override this by specifying a custom dictionary of " +"strings and their Boolean outcomes. For example:" +msgstr "" +"به‌طور پیش‌فرض هنگام استفاده از :meth:`~ConfigParser.getboolean`، پارسرهای " +"پیکربندی مقادیر زیر را ``True`` در نظر می‌گیرند: ``'1'``، ``'yes'``، " +"``'true'``، ``'on'`` و مقادیر زیر را ``False`` در نظر می‌گیرند: ``'0'``، " +"``'no'``، ``'false'``، ``'off'``. می‌توانید این پیش‌فرض را با مشخص کردن یک " +"دیکشنری سفارشی از رشته‌ها و نتایج بولی آن‌ها تغییر دهید. برای مثال:" msgid "" ">>> custom = configparser.ConfigParser()\n" @@ -637,12 +1403,33 @@ msgid "" ">>> custom['section1'].getboolean('funky')\n" "False" msgstr "" +">>> custom = configparser.ConfigParser()\n" +">>> custom['section1'] = {'funky': 'nope'}\n" +">>> custom['section1'].getboolean('funky')\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Not a boolean: nope\n" +">>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}\n" +">>> custom['section1'].getboolean('funky')\n" +"False" -msgid "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/``disabled``." +msgid "" +"Other typical Boolean pairs include ``accept``/``reject`` or " +"``enabled``/``disabled``." msgstr "" +"سایر جفت‌های بولی رایج شامل ``accept``/``reject`` یا " +"``enabled``/``disabled`` هستند." -msgid "This method transforms option names on every read, get, or set operation. The default converts the name to lowercase. This also means that when a configuration file gets written, all keys will be lowercase. Override this method if that's unsuitable. For example:" +msgid "" +"This method transforms option names on every read, get, or set operation. " +"The default converts the name to lowercase. This also means that when a " +"configuration file gets written, all keys will be lowercase. Override this " +"method if that's unsuitable. For example:" msgstr "" +"این متد نام گزینه‌ها را در هر عملیات خواندن، دریافت یا تنظیم تبدیل می‌کند. " +"حالت پیش‌فرض نام را به حروف کوچک تبدیل می‌کند. این همچنین به این معناست که " +"هنگامی که یک فایل پیکربندی نوشته می‌شود، همه کلیدها با حروف کوچک خواهند بود." +" اگر این مناسب نیست، این متد را بازنویسی کنید. برای مثال:" msgid "" ">>> config = \"\"\"\n" @@ -666,12 +1453,48 @@ msgid "" ">>> list(custom['Section2'].keys())\n" "['AnotherKey']" msgstr "" +">>> config = \"\"\"\n" +"... [Section1]\n" +"... Key = Value\n" +"...\n" +"... [Section2]\n" +"... AnotherKey = Value\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> list(typical['Section1'].keys())\n" +"['key']\n" +">>> list(typical['Section2'].keys())\n" +"['anotherkey']\n" +">>> custom = configparser.RawConfigParser()\n" +">>> custom.optionxform = lambda option: option\n" +">>> custom.read_string(config)\n" +">>> list(custom['Section1'].keys())\n" +"['Key']\n" +">>> list(custom['Section2'].keys())\n" +"['AnotherKey']" -msgid "The optionxform function transforms option names to a canonical form. This should be an idempotent function: if the name is already in canonical form, it should be returned unchanged." +msgid "" +"The optionxform function transforms option names to a canonical form. This " +"should be an idempotent function: if the name is already in canonical form, " +"it should be returned unchanged." msgstr "" +"تابع optionxform نام گزینه‌ها را به یک صورت کانونیکال تبدیل می‌کند. این باید" +" یک تابع هم‌توان (idempotent) باشد: اگر نام از قبل در صورت کانونیکال باشد، " +"باید بدون تغییر بازگردانده شود." -msgid "A compiled regular expression used to parse section headers. The default matches ``[section]`` to the name ``\"section\"``. Whitespace is considered part of the section name, thus ``[ larch ]`` will be read as a section of name ``\" larch \"``. Override this attribute if that's unsuitable. For example:" -msgstr "" +msgid "" +"A compiled regular expression used to parse section headers. The default " +"matches ``[section]`` to the name ``\"section\"``. Whitespace is considered" +" part of the section name, thus ``[ larch ]`` will be read as a section of" +" name ``\" larch \"``. Override this attribute if that's unsuitable. For" +" example:" +msgstr "" +"یک عبارت باقاعده کامپایل‌شده که برای تجزیه سرصفحه‌های بخش استفاده می‌شود. مقدار" +" پیش‌فرض ``[section]`` را با نام ``\"section\"`` تطبیق می‌دهد. فضای سفید " +"به‌عنوان بخشی از نام بخش در نظر گرفته می‌شود، بنابراین ``[ larch ]`` " +"به‌عنوان بخشی با نام ``\" larch \"`` خوانده می‌شود. اگر این مناسب نیست، " +"این ویژگی را بازنویسی کنید. برای مثال:" msgid "" ">>> import re\n" @@ -692,18 +1515,51 @@ msgid "" ">>> custom.sections()\n" "['Section 1', 'Section 2']" msgstr "" +">>> import re\n" +">>> config = \"\"\"\n" +"... [Section 1]\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> typical.sections()\n" +"['Section 1', ' Section 2 ']\n" +">>> custom = configparser.ConfigParser()\n" +">>> custom.SECTCRE = re.compile(r\"\\[ *(?P
[^]]+?) *\\]\")\n" +">>> custom.read_string(config)\n" +">>> custom.sections()\n" +"['Section 1', 'Section 2']" -msgid "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing option lines, it's not recommended to override it because that would interfere with constructor options *allow_no_value* and *delimiters*." +msgid "" +"While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " +"option lines, it's not recommended to override it because that would " +"interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" +"اگرچه اشیای ConfigParser همچنین از یک ویژگی ``OPTCRE`` برای تشخیص خطوط " +"گزینه استفاده می‌کنند، توصیه نمی‌شود آن را بازنویسی کنید، زیرا این کار با " +"گزینه‌های سازنده یعنی *allow_no_value* و *delimiters* تداخل ایجاد می‌کند." msgid "Legacy API Examples" -msgstr "" +msgstr "نمونه‌های API قدیمی" -msgid "Mainly because of backwards compatibility concerns, :mod:`!configparser` provides also a legacy API with explicit ``get``/``set`` methods. While there are valid use cases for the methods outlined below, mapping protocol access is preferred for new projects. The legacy API is at times more advanced, low-level and downright counterintuitive." -msgstr "" +msgid "" +"Mainly because of backwards compatibility concerns, :mod:`!configparser` " +"provides also a legacy API with explicit ``get``/``set`` methods. While " +"there are valid use cases for the methods outlined below, mapping protocol " +"access is preferred for new projects. The legacy API is at times more " +"advanced, low-level and downright counterintuitive." +msgstr "" +"عمدتاً به دلیل ملاحظات سازگاری با نسخه‌های قبلی، :mod:`!configparser` همچنین" +" یک API قدیمی با متدهای صریح ``get``/``set`` ارائه می‌دهد. اگرچه برای " +"متدهایی که در زیر توضیح داده شده‌اند موارد استفاده معتبری وجود دارد، دسترسی " +"از طریق پروتکل نگاشت (mapping protocol) برای پروژه‌های جدید ترجیح داده " +"می‌شود. API قدیمی گاهی اوقات پیشرفته‌تر، سطح پایین‌تر و کاملاً غیرشهودی است." msgid "An example of writing to a configuration file::" -msgstr "" +msgstr "مثالی از نوشتن در یک فایل پیکربندی::" msgid "" "import configparser\n" @@ -727,9 +1583,29 @@ msgid "" "with open('example.cfg', 'w') as configfile:\n" " config.write(configfile)" msgstr "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"\n" +"# لطفاً توجه داشته باشید که با استفاده از توابع set مربوط به RawConfigParser،\n" +"# می‌توانید مقادیر غیررشته‌ای را به‌صورت داخلی به کلیدها انتساب دهید، اما هنگام\n" +"# تلاش برای نوشتن در یک فایل یا هنگام دریافت آن در حالت غیرخام، با خطایی مواجه خواهید شد.\n" +"# تنظیم مقادیر با استفاده از پروتکل نگاشت (mapping protocol) یا متد set() در ConfigParser\n" +"# اجازه نمی‌دهد چنین انتساب‌هایی انجام شوند.\n" +"config.add_section('Section1')\n" +"config.set('Section1', 'an_int', '15')\n" +"config.set('Section1', 'a_bool', 'true')\n" +"config.set('Section1', 'a_float', '3.1415')\n" +"config.set('Section1', 'baz', 'fun')\n" +"config.set('Section1', 'bar', 'Python')\n" +"config.set('Section1', 'foo', '%(bar)s is %(baz)s!')\n" +"\n" +"# نوشتن فایل پیکربندی‌مان در 'example.cfg'\n" +"with open('example.cfg', 'w') as configfile:\n" +" config.write(configfile)" msgid "An example of reading the configuration file again::" -msgstr "" +msgstr "مثالی از خواندن دوباره‌ی فایل پیکربندی::" msgid "" "import configparser\n" @@ -748,9 +1624,25 @@ msgid "" "if config.getboolean('Section1', 'a_bool'):\n" " print(config.get('Section1', 'foo'))" msgstr "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"config.read('example.cfg')\n" +"\n" +"# getfloat() در صورتی که مقدار یک float نباشد، یک استثنا پرتاب می‌کند\n" +"# getint() و getboolean() نیز برای نوع‌های مربوط به خود همین کار را انجام می‌دهند\n" +"a_float = config.getfloat('Section1', 'a_float')\n" +"an_int = config.getint('Section1', 'an_int')\n" +"print(a_float + an_int)\n" +"\n" +"# توجه داشته باشید که خروجی بعدی '%(bar)s' یا '%(baz)s' را درون‌یابی نمی‌کند.\n" +"# این به این دلیل است که از RawConfigParser() استفاده می‌کنیم.\n" +"if config.getboolean('Section1', 'a_bool'):\n" +" print(config.get('Section1', 'foo'))" msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" +"برای درون‌یابی (interpolation)، از :class:`ConfigParser` استفاده کنید::" msgid "" "import configparser\n" @@ -784,9 +1676,44 @@ msgid "" "print(cfg.get('Section1', 'monster', fallback=None))\n" " # -> None" msgstr "" +"import configparser\n" +"\n" +"cfg = configparser.ConfigParser()\n" +"cfg.read('example.cfg')\n" +"\n" +"# اگر می‌خواهید درون‌یابی را در یک عملیات get غیرفعال کنید، آرگومان اختیاری *raw* در get() را\n" +"# روی True تنظیم کنید.\n" +"print(cfg.get('Section1', 'foo', raw=False)) # -> \"Python is fun!\"\n" +"print(cfg.get('Section1', 'foo', raw=True)) # -> \"%(bar)s is %(baz)s!\"\n" +"\n" +"# آرگومان اختیاری *vars* یک دیکشنری است که اعضای آن در درون‌یابی\n" +"# اولویت خواهند داشت.\n" +"print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',\n" +" 'baz': 'evil'}))\n" +"\n" +"# می‌توان از آرگومان اختیاری *fallback* برای فراهم کردن یک مقدار جایگزین استفاده کرد.\n" +"print(cfg.get('Section1', 'foo'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'foo', fallback='Monty is not.'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback='No such things as monsters.'))\n" +" # -> \"No such things as monsters.\"\n" +"\n" +"# یک فراخوانی ساده‌ی print(cfg.get('Section1', 'monster')) موجب پرتاب NoOptionError می‌شود\n" +"# اما همچنین می‌توانید از این استفاده کنید:\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback=None))\n" +" # -> None" -msgid "Default values are available in both types of ConfigParsers. They are used in interpolation if an option used is not defined elsewhere. ::" +msgid "" +"Default values are available in both types of ConfigParsers. They are used " +"in interpolation if an option used is not defined elsewhere. ::" msgstr "" +"مقادیر پیش‌فرض در هر دو نوع ConfigParser در دسترس هستند. اگر گزینه‌ی " +"استفاده‌شده در جای دیگری تعریف‌نشده باشد، این مقادیر در درون‌یابی " +"(interpolation) استفاده می‌شوند. ::" msgid "" "import configparser\n" @@ -800,84 +1727,250 @@ msgid "" "config.remove_option('Section1', 'baz')\n" "print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgstr "" +"import configparser\n" +"\n" +"# New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each\n" +"config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})\n" +"config.read('example.cfg')\n" +"\n" +"print(config.get('Section1', 'foo')) # -> \"Python is fun!\"\n" +"config.remove_option('Section1', 'bar')\n" +"config.remove_option('Section1', 'baz')\n" +"print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgid "ConfigParser Objects" -msgstr "" +msgstr "اشیای ConfigParser" -msgid "The main configuration parser. When *defaults* is given, it is initialized into the dictionary of intrinsic defaults. When *dict_type* is given, it will be used to create the dictionary objects for the list of sections, for the options within a section, and for the default values." +msgid "" +"The main configuration parser. When *defaults* is given, it is initialized " +"into the dictionary of intrinsic defaults. When *dict_type* is given, it " +"will be used to create the dictionary objects for the list of sections, for " +"the options within a section, and for the default values." msgstr "" +"پارسر اصلی پیکربندی. هنگامی که *defaults* داده شود، در دیکشنری پیش‌فرض‌های " +"ذاتی مقداردهی اولیه می‌شود. هنگامی که *dict_type* داده شود، برای ایجاد اشیای" +" دیکشنری برای فهرست بخش‌ها، برای گزینه‌های درون یک بخش، و برای مقادیر " +"پیش‌فرض استفاده خواهد شد." -msgid "When *delimiters* is given, it is used as the set of substrings that divide keys from values. When *comment_prefixes* is given, it will be used as the set of substrings that prefix comments in otherwise empty lines. Comments can be indented. When *inline_comment_prefixes* is given, it will be used as the set of substrings that prefix comments in non-empty lines." -msgstr "" +msgid "" +"When *delimiters* is given, it is used as the set of substrings that divide " +"keys from values. When *comment_prefixes* is given, it will be used as the " +"set of substrings that prefix comments in otherwise empty lines. Comments " +"can be indented. When *inline_comment_prefixes* is given, it will be used " +"as the set of substrings that prefix comments in non-empty lines." +msgstr "" +"هنگامی که *delimiters* داده شده باشد، از آن به‌عنوان مجموعه‌ای از زیررشته‌ها" +" استفاده می‌شود که کلیدها را از مقادیر جدا می‌کنند. هنگامی که " +"*comment_prefixes* داده شده باشد، از آن به‌عنوان مجموعه‌ای از زیررشته‌ها " +"استفاده خواهد شد که به‌عنوان پیشوند کامنت‌ها در خط‌هایی که در غیر این صورت " +"خالی هستند، عمل می‌کنند. کامنت‌ها می‌توانند تورفتگی داشته باشند. هنگامی که " +"*inline_comment_prefixes* داده شده باشد، از آن به‌عنوان مجموعه‌ای از " +"زیررشته‌ها استفاده خواهد شد که به‌عنوان پیشوند کامنت‌ها در خط‌های غیرخالی عمل" +" می‌کنند." -msgid "When *strict* is ``True`` (the default), the parser won't allow for any section or option duplicates while reading from a single source (file, string or dictionary), raising :exc:`DuplicateSectionError` or :exc:`DuplicateOptionError`. When *empty_lines_in_values* is ``False`` (default: ``True``), each empty line marks the end of an option. Otherwise, internal empty lines of a multiline option are kept as part of the value. When *allow_no_value* is ``True`` (default: ``False``), options without values are accepted; the value held for these is ``None`` and they are serialized without the trailing delimiter." -msgstr "" +msgid "" +"When *strict* is ``True`` (the default), the parser won't allow for any " +"section or option duplicates while reading from a single source (file, " +"string or dictionary), raising :exc:`DuplicateSectionError` or " +":exc:`DuplicateOptionError`. When *empty_lines_in_values* is ``False`` " +"(default: ``True``), each empty line marks the end of an option. Otherwise," +" internal empty lines of a multiline option are kept as part of the value. " +"When *allow_no_value* is ``True`` (default: ``False``), options without " +"values are accepted; the value held for these is ``None`` and they are " +"serialized without the trailing delimiter." +msgstr "" +"هنگامی که *strict* برابر ``True`` باشد (پیش‌فرض)، پارسر هنگام خواندن " +"از یک منبع واحد (فایل، رشته یا دیکشنری) از وجود هرگونه بخش یا گزینه تکراری " +"جلوگیری می‌کند و :exc:`DuplicateSectionError` یا :exc:`DuplicateOptionError`" +" را پرتاب می‌کند. هنگامی که *empty_lines_in_values* برابر ``False`` باشد " +"(پیش‌فرض: ``True``)، هر خط خالی پایان یک گزینه را مشخص می‌کند. در غیر این " +"صورت، خطوط خالی داخلی یک گزینه چندخطی به‌عنوان بخشی از مقدار حفظ می‌شوند. " +"هنگامی که *allow_no_value* برابر ``True`` باشد (پیش‌فرض: ``False``)، " +"گزینه‌های بدون مقدار پذیرفته می‌شوند؛ مقدار ذخیره‌شده برای این گزینه‌ها " +"``None`` است و آن‌ها بدون جداکننده پایانی سریال‌سازی می‌شوند." -msgid "When *default_section* is given, it specifies the name for the special section holding default values for other sections and interpolation purposes (normally named ``\"DEFAULT\"``). This value can be retrieved and changed at runtime using the ``default_section`` instance attribute. This won't re-evaluate an already parsed config file, but will be used when writing parsed settings to a new config file." -msgstr "" +msgid "" +"When *default_section* is given, it specifies the name for the special " +"section holding default values for other sections and interpolation purposes" +" (normally named ``\"DEFAULT\"``). This value can be retrieved and changed " +"at runtime using the ``default_section`` instance attribute. This won't re-" +"evaluate an already parsed config file, but will be used when writing parsed" +" settings to a new config file." +msgstr "" +"هنگامی که *default_section* داده شود، نام بخش ویژه‌ای را مشخص می‌کند که " +"مقادیر پیش‌فرض برای سایر بخش‌ها و برای اهداف درون‌یابی را نگه می‌دارد (این " +"بخش معمولاً ``\"DEFAULT\"`` نام دارد). این مقدار را می‌توان در ران‌تایم با " +"استفاده از ویژگی نمونه‌ی ``default_section`` بازیابی و تغییر داد. این کار یک" +" پرونده‌ی پیکربندی از پیش تجزیه‌شده را دوباره ارزیابی نمی‌کند، اما هنگام " +"نوشتن تنظیمات تجزیه‌شده در یک پرونده‌ی پیکربندی جدید استفاده خواهد شد." -msgid "Interpolation behaviour may be customized by providing a custom handler through the *interpolation* argument. ``None`` can be used to turn off interpolation completely, ``ExtendedInterpolation()`` provides a more advanced variant inspired by ``zc.buildout``. More on the subject in the `dedicated documentation section <#interpolation-of-values>`_." -msgstr "" +msgid "" +"Interpolation behaviour may be customized by providing a custom handler " +"through the *interpolation* argument. ``None`` can be used to turn off " +"interpolation completely, ``ExtendedInterpolation()`` provides a more " +"advanced variant inspired by ``zc.buildout``. More on the subject in the " +"`dedicated documentation section <#interpolation-of-values>`_." +msgstr "" +"رفتار درون‌یابی (interpolation) را می‌توان با ارائه یک هندلر سفارشی " +"(handler) از طریق آرگومان *interpolation* سفارشی‌سازی کرد. می‌توان از " +"``None`` برای غیرفعال کردن کامل درون‌یابی استفاده کرد، و " +"``ExtendedInterpolation()`` یک گونه پیشرفته‌تر ارائه می‌دهد که از " +"``zc.buildout`` الهام گرفته است. اطلاعات بیشتر درباره این موضوع در `بخش " +"اختصاصی مستندات <#interpolation-of-values>`_." -msgid "All option names used in interpolation will be passed through the :meth:`optionxform` method just like any other option name reference. For example, using the default implementation of :meth:`optionxform` (which converts option names to lower case), the values ``foo %(bar)s`` and ``foo %(BAR)s`` are equivalent." -msgstr "" +msgid "" +"All option names used in interpolation will be passed through the " +":meth:`optionxform` method just like any other option name reference. For " +"example, using the default implementation of :meth:`optionxform` (which " +"converts option names to lower case), the values ``foo %(bar)s`` and ``foo " +"%(BAR)s`` are equivalent." +msgstr "" +"تمام نام‌های گزینه‌ای که در درون‌یابی (interpolation) استفاده می‌شوند، " +"دقیقاً مانند هر ارجاع دیگری به نام گزینه، از متد :meth:`optionxform` عبور " +"می‌کنند. برای مثال، با استفاده از پیاده‌سازی پیش‌فرض :meth:`optionxform` (که" +" نام گزینه‌ها را به حروف کوچک تبدیل می‌کند)، مقادیر ``foo %(bar)s`` و ``foo " +"%(BAR)s`` معادل هستند." -msgid "When *converters* is given, it should be a dictionary where each key represents the name of a type converter and each value is a callable implementing the conversion from string to the desired datatype. Every converter gets its own corresponding :meth:`!get*` method on the parser object and section proxies." +msgid "" +"When *converters* is given, it should be a dictionary where each key " +"represents the name of a type converter and each value is a callable " +"implementing the conversion from string to the desired datatype. Every " +"converter gets its own corresponding :meth:`!get*` method on the parser " +"object and section proxies." msgstr "" +"هنگامی که *converters* داده شود، باید یک دیکشنری باشد که در آن هر کلید " +"نشان‌دهنده‌ی نام یک مبدل نوع است و هر مقدار یک شیء قابل فراخوانی (callable) " +"است که تبدیل از رشته به نوع داده مورد نظر را پیاده‌سازی می‌کند. هر مبدل متد " +":meth:`!get*` متناظر با خود را روی شیء پارسر و پراکسی‌های بخش دریافت می‌کند." -msgid "When *allow_unnamed_section* is ``True`` (default: ``False``), the first section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-sections>`_." +msgid "" +"When *allow_unnamed_section* is ``True`` (default: ``False``), the first " +"section name can be omitted. See the `\"Unnamed Sections\" section " +"<#unnamed-sections>`_." msgstr "" +"هنگامی که *allow_unnamed_section* ``True`` باشد (پیش‌فرض: ``False``)، " +"می‌توان نام بخش نخست را حذف کرد. بخش «بخش‌های بی‌نام» <#unnamed-sections>`_ " +"را ببینید." msgid "The default *dict_type* is :class:`collections.OrderedDict`." -msgstr "" +msgstr "*dict_type* پیش‌فرض :class:`collections.OrderedDict` است." -msgid "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, *empty_lines_in_values*, *default_section* and *interpolation* were added." +msgid "" +"*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " +"*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" +"*allow_no_value*، *delimiters*، *comment_prefixes*، *strict*، " +"*empty_lines_in_values*، *default_section* و *interpolation* افزوده شدند." msgid "The *converters* argument was added." -msgstr "" +msgstr "آرگومان *converters* افزوده شد." -msgid "The *defaults* argument is read with :meth:`read_dict`, providing consistent behavior across the parser: non-string keys and values are implicitly converted to strings." +msgid "" +"The *defaults* argument is read with :meth:`read_dict`, providing consistent" +" behavior across the parser: non-string keys and values are implicitly " +"converted to strings." msgstr "" +"آرگومان *defaults* با :meth:`read_dict` خوانده می‌شود و رفتار سازگاری را در " +"سراسر پارسر فراهم می‌کند: کلیدها و مقدارهای غیررشته‌ای به‌صورت ضمنی به " +"رشته تبدیل می‌شوند." -msgid "The default *dict_type* is :class:`dict`, since it now preserves insertion order." +msgid "" +"The default *dict_type* is :class:`dict`, since it now preserves insertion " +"order." msgstr "" +"مقدار پیش‌فرض *dict_type*، :class:`dict` است، زیرا اکنون ترتیب درج را حفظ " +"می‌کند." -msgid "Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, and a key without a value is continued with an indented line." +msgid "" +"Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``," +" and a key without a value is continued with an indented line." msgstr "" +"هنگامی که *allow_no_value* برابر ``True`` باشد و یک کلید بدون مقدار با یک خط" +" دارای تورفتگی ادامه یابد، یک :exc:`MultilineContinuationError` پرتاب " +"می‌شود." msgid "The *allow_unnamed_section* argument was added." -msgstr "" +msgstr "آرگومان *allow_unnamed_section* افزوده شد." msgid "Return a dictionary containing the instance-wide defaults." -msgstr "" +msgstr "یک دیکشنری شامل پیش‌فرض‌های سراسری نمونه برمی‌گرداند." -msgid "Return a list of the sections available; the *default section* is not included in the list." +msgid "" +"Return a list of the sections available; the *default section* is not " +"included in the list." msgstr "" +"فهرستی از بخش‌های موجود را برمی‌گرداند؛ *بخش پیش‌فرض* در این فهرست گنجانده " +"نشده است." -msgid "Add a section named *section* to the instance. If a section by the given name already exists, :exc:`DuplicateSectionError` is raised. If the *default section* name is passed, :exc:`ValueError` is raised. The name of the section must be a string; if not, :exc:`TypeError` is raised." +msgid "" +"Add a section named *section* to the instance. If a section by the given " +"name already exists, :exc:`DuplicateSectionError` is raised. If the " +"*default section* name is passed, :exc:`ValueError` is raised. The name of " +"the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" +"یک بخش با نام *section* به نمونه اضافه می‌کند. اگر بخشی با نام داده‌شده از " +"قبل وجود داشته باشد، استثنای :exc:`DuplicateSectionError` پرتاب می‌شود. اگر " +"نام *بخش پیش‌فرض* داده شود، استثنای :exc:`ValueError` پرتاب می‌شود. نام بخش " +"باید یک رشته باشد؛ در غیر این صورت، استثنای :exc:`TypeError` پرتاب می‌شود." msgid "Non-string section names raise :exc:`TypeError`." -msgstr "" +msgstr "نام‌بخش‌های غیررشته‌ای باعث پرتاب :exc:`TypeError` می‌شوند." -msgid "Indicates whether the named *section* is present in the configuration. The *default section* is not acknowledged." +msgid "" +"Indicates whether the named *section* is present in the configuration. The " +"*default section* is not acknowledged." msgstr "" +"نشان می‌دهد که آیا *بخش* نام‌برده در پیکربندی وجود دارد یا خیر. *بخش " +"پیش‌فرض* شناسایی نمی‌شود." msgid "Return a list of options available in the specified *section*." -msgstr "" +msgstr "فهرستی از گزینه‌های موجود در *section* مشخص‌شده را برمی‌گرداند." -msgid "If the given *section* exists, and contains the given *option*, return :const:`True`; otherwise return :const:`False`. If the specified *section* is :const:`None` or an empty string, DEFAULT is assumed." +msgid "" +"If the given *section* exists, and contains the given *option*, return " +":const:`True`; otherwise return :const:`False`. If the specified *section* " +"is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" +"اگر *section* داده‌شده وجود داشته باشد و شامل *option* داده‌شده باشد، " +":const:`True` را برمی‌گرداند؛ در غیر این صورت :const:`False` را برمی‌گرداند." +" اگر *section* مشخص‌شده :const:`None` یا یک رشته خالی باشد، DEFAULT در نظر " +"گرفته می‌شود." -msgid "Attempt to read and parse an iterable of filenames, returning a list of filenames which were successfully parsed." +msgid "" +"Attempt to read and parse an iterable of filenames, returning a list of " +"filenames which were successfully parsed." msgstr "" +"تلاش می‌کند یک پیمایش‌پذیر از نام فایل‌ها را بخواند و تجزیه کند، و فهرستی از " +"نام فایل‌هایی را که با موفقیت تجزیه شده‌اند برمی‌گرداند." -msgid "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like object`, it is treated as a single filename. If a file named in *filenames* cannot be opened, that file will be ignored. This is designed so that you can specify an iterable of potential configuration file locations (for example, the current directory, the user's home directory, and some system-wide directory), and all existing configuration files in the iterable will be read." -msgstr "" +msgid "" +"If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " +"object`, it is treated as a single filename. If a file named in *filenames*" +" cannot be opened, that file will be ignored. This is designed so that you " +"can specify an iterable of potential configuration file locations (for " +"example, the current directory, the user's home directory, and some system-" +"wide directory), and all existing configuration files in the iterable will " +"be read." +msgstr "" +"اگر *filenames* یک رشته، یک شیء :class:`bytes` یا یک شیء مسیرمانند " +"(:term:`path-like object`) باشد، به‌عنوان یک نام فایل واحد در نظر گرفته " +"می‌شود. اگر نتوان فایلی را که در *filenames* ذکر شده است باز کرد، از آن فایل" +" چشم‌پوشی خواهد شد. این به گونه‌ای طراحی شده است که شما بتوانید یک پیمایش‌پذیر" +" از محل‌های احتمالی برای فایل‌های پیکربندی مشخص کنید (برای مثال، پوشه جاری، " +"پوشه خانه کاربر، و یک پوشه سراسری سیستم)، و همه فایل‌های پیکربندی موجود در " +"آن پیمایش‌پذیر خوانده خواهند شد." -msgid "If none of the named files exist, the :class:`ConfigParser` instance will contain an empty dataset. An application which requires initial values to be loaded from a file should load the required file or files using :meth:`read_file` before calling :meth:`read` for any optional files::" +msgid "" +"If none of the named files exist, the :class:`ConfigParser` instance will " +"contain an empty dataset. An application which requires initial values to " +"be loaded from a file should load the required file or files using " +":meth:`read_file` before calling :meth:`read` for any optional files::" msgstr "" +"اگر هیچ‌کدام از فایل‌های نام‌برده‌شده وجود نداشته باشند، نمونه‌ی " +":class:`ConfigParser` حاوی یک مجموعه‌داده خالی خواهد بود. برنامه‌ای که " +"نیازمند بارگذاری مقادیر اولیه از یک فایل است، باید فایل یا فایل‌های موردنیاز" +" را با استفاده از :meth:`read_file` بارگذاری کند، پیش از فراخوانی " +":meth:`read` برای هر فایل اختیاری::" msgid "" "import configparser, os\n" @@ -887,212 +1980,514 @@ msgid "" "config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" " encoding='cp1250')" msgstr "" +"import configparser, os\n" +"\n" +"config = configparser.ConfigParser()\n" +"config.read_file(open('defaults.cfg'))\n" +"config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" +" encoding='cp1250')" -msgid "Added the *encoding* parameter. Previously, all files were read using the default encoding for :func:`open`." +msgid "" +"Added the *encoding* parameter. Previously, all files were read using the " +"default encoding for :func:`open`." msgstr "" +"پارامتر *encoding* افزوده شد. پیش از این، تمام فایل‌ها با کدگذاری پیش‌فرض " +":func:`open` خوانده می‌شدند." msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" +"پارامتر *filenames* یک شیء شبه‌مسیر (:term:`path-like object`) را می‌پذیرد." msgid "The *filenames* parameter accepts a :class:`bytes` object." -msgstr "" +msgstr "پارامتر *filenames* یک شیء :class:`bytes` را می‌پذیرد." -msgid "Read and parse configuration data from *f* which must be an iterable yielding Unicode strings (for example files opened in text mode)." +msgid "" +"Read and parse configuration data from *f* which must be an iterable " +"yielding Unicode strings (for example files opened in text mode)." msgstr "" +"داده‌های پیکربندی را از *f* بخوانید و تجزیه کنید؛ *f* باید پیمایش‌پذیری باشد " +"که رشته‌های یونیکد تولید می‌کند (برای مثال فایل‌هایی که در حالت متنی باز " +"شده‌اند)." -msgid "Optional argument *source* specifies the name of the file being read. If not given and *f* has a :attr:`!name` attribute, that is used for *source*; the default is ``''``." +msgid "" +"Optional argument *source* specifies the name of the file being read. If " +"not given and *f* has a :attr:`!name` attribute, that is used for *source*; " +"the default is ``''``." msgstr "" +"آرگومان اختیاری *source* نام فایلی که خوانده می‌شود را مشخص می‌کند. اگر داده" +" نشود و *f* ویژگی :attr:`!name` داشته باشد، از آن برای *source* استفاده " +"می‌شود؛ مقدار پیش‌فرض ``''`` است." msgid "Replaces :meth:`!readfp`." -msgstr "" +msgstr "جایگزین :meth:`!readfp` می‌شود." msgid "Parse configuration data from a string." -msgstr "" +msgstr "تجزیه داده‌های پیکربندی از یک رشته." -msgid "Optional argument *source* specifies a context-specific name of the string passed. If not given, ``''`` is used. This should commonly be a filesystem path or a URL." +msgid "" +"Optional argument *source* specifies a context-specific name of the string " +"passed. If not given, ``''`` is used. This should commonly be a " +"filesystem path or a URL." msgstr "" +"آرگومان اختیاری *source* نامی وابسته به زمینه برای رشته‌ی داده‌شده مشخص " +"می‌کند. اگر داده نشود، از ``''`` استفاده می‌شود. این معمولاً باید یک" +" مسیر سیستم‌فایل یا یک URL باشد." -msgid "Load configuration from any object that provides a dict-like ``items()`` method. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. Values are automatically converted to strings." -msgstr "" +msgid "" +"Load configuration from any object that provides a dict-like ``items()`` " +"method. Keys are section names, values are dictionaries with keys and " +"values that should be present in the section. If the used dictionary type " +"preserves order, sections and their keys will be added in order. Values are " +"automatically converted to strings." +msgstr "" +"پیکربندی از هر شیءای که متد ``items()`` دیکشنری‌مانند را فراهم می‌کند، " +"بارگذاری می‌شود. کلیدها نام بخش‌ها هستند؛ مقدارها دیکشنری‌هایی هستند که " +"کلیدها و مقدارهای آن‌ها باید در آن بخش وجود داشته باشند. اگر نوع دیکشنری " +"استفاده‌شده ترتیب را حفظ کند، بخش‌ها و کلیدهای آن‌ها به‌ترتیب اضافه خواهند " +"شد. مقدارها به‌طور خودکار به رشته تبدیل می‌شوند." -msgid "Optional argument *source* specifies a context-specific name of the dictionary passed. If not given, ```` is used." +msgid "" +"Optional argument *source* specifies a context-specific name of the " +"dictionary passed. If not given, ```` is used." msgstr "" +"آرگومان اختیاری *source* نامی مختص به زمینه برای دیکشنری ارسال‌شده مشخص " +"می‌کند. اگر داده نشود، از ```` استفاده می‌شود." msgid "This method can be used to copy state between parsers." -msgstr "" +msgstr "می‌توان از این متد برای کپی وضعیت بین پارسرها استفاده کرد." -msgid "Get an *option* value for the named *section*. If *vars* is provided, it must be a dictionary. The *option* is looked up in *vars* (if provided), *section*, and in *DEFAULTSECT* in that order. If the key is not found and *fallback* is provided, it is used as a fallback value. ``None`` can be provided as a *fallback* value." -msgstr "" +msgid "" +"Get an *option* value for the named *section*. If *vars* is provided, it " +"must be a dictionary. The *option* is looked up in *vars* (if provided), " +"*section*, and in *DEFAULTSECT* in that order. If the key is not found and " +"*fallback* is provided, it is used as a fallback value. ``None`` can be " +"provided as a *fallback* value." +msgstr "" +"مقدار یک *option* را برای *section* مشخص‌شده دریافت کنید. اگر *vars* ارائه " +"شده باشد، باید یک دیکشنری باشد. *option* به‌ترتیب در *vars* (در صورت ارائه)،" +" *section* و در *DEFAULTSECT* جستجو می‌شود. اگر کلید پیدا نشود و *fallback* " +"ارائه شده باشد، به‌عنوان مقدار جایگزین استفاده می‌شود. می‌توان ``None`` را " +"به‌عنوان مقدار *fallback* ارائه کرد." -msgid "All the ``'%'`` interpolations are expanded in the return values, unless the *raw* argument is true. Values for interpolation keys are looked up in the same manner as the option." +msgid "" +"All the ``'%'`` interpolations are expanded in the return values, unless the" +" *raw* argument is true. Values for interpolation keys are looked up in the" +" same manner as the option." msgstr "" +"تمام درون‌یابی‌های ``'%'`` در مقادیر بازگشتی بسط داده می‌شوند، مگر اینکه " +"آرگومان *raw* صحیح باشد. مقادیر کلیدهای درون‌یابی به همان شیوه‌ای که گزینه " +"جست‌وجو می‌شود، جست‌وجو می‌شوند." -msgid "Arguments *raw*, *vars* and *fallback* are keyword only to protect users from trying to use the third argument as the *fallback* fallback (especially when using the mapping protocol)." +msgid "" +"Arguments *raw*, *vars* and *fallback* are keyword only to protect users " +"from trying to use the third argument as the *fallback* fallback (especially" +" when using the mapping protocol)." msgstr "" +"آرگومان‌های *raw*، *vars* و *fallback* فقط کلیدواژه‌ای هستند تا از تلاش " +"کاربران برای استفاده از سومین آرگومان به‌عنوان مقدار جایگزین (fallback) برای" +" *fallback* جلوگیری شود (به‌ویژه هنگام استفاده از پروتکل نگاشت)." -msgid "A convenience method which coerces the *option* in the specified *section* to an integer. See :meth:`get` for explanation of *raw*, *vars* and *fallback*." +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to an integer. See :meth:`get` for explanation of *raw*, *vars* and " +"*fallback*." msgstr "" +"متدی آسان‌کننده که *option* را در *section* مشخص‌شده به عدد صحیح تبدیل " +"می‌کند. برای توضیح *raw*، *vars* و *fallback* به :meth:`get` مراجعه کنید." -msgid "A convenience method which coerces the *option* in the specified *section* to a floating-point number. See :meth:`get` for explanation of *raw*, *vars* and *fallback*." +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to a floating-point number. See :meth:`get` for explanation of *raw*, " +"*vars* and *fallback*." msgstr "" +"متد آسان‌کننده‌ای که *option* را در *section* مشخص‌شده به یک عدد ممیز شناور " +"تبدیل می‌کند. برای توضیحات مربوط به *raw*، *vars* و *fallback* به " +":meth:`get` مراجعه کنید." -msgid "A convenience method which coerces the *option* in the specified *section* to a Boolean value. Note that the accepted values for the option are ``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which cause it to return ``False``. These string values are checked in a case-insensitive manner. Any other value will cause it to raise :exc:`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and *fallback*." -msgstr "" +msgid "" +"A convenience method which coerces the *option* in the specified *section* " +"to a Boolean value. Note that the accepted values for the option are " +"``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to " +"return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which " +"cause it to return ``False``. These string values are checked in a case-" +"insensitive manner. Any other value will cause it to raise " +":exc:`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and " +"*fallback*." +msgstr "" +"یک متد سهولت‌بخش که *option* را در *section* مشخص‌شده به یک مقدار بولی تبدیل" +" می‌کند. توجه داشته باشید که مقادیر پذیرفته‌شده برای گزینه عبارت‌اند از " +"``'1'``، ``'yes'``، ``'true'`` و ``'on'`` که باعث می‌شوند این متد ``True`` " +"را برگرداند، و ``'0'``، ``'no'``، ``'false'`` و ``'off'`` که باعث می‌شوند " +"این متد ``False`` را برگرداند. این مقادیر رشته‌ای به‌صورت غیرحساس به بزرگی و" +" کوچکی حروف بررسی می‌شوند. هر مقدار دیگری باعث می‌شود این متد " +":exc:`ValueError` را پرتاب کند. برای توضیح *raw*، *vars* و *fallback* به " +":meth:`get` مراجعه کنید." -msgid "When *section* is not given, return a list of *section_name*, *section_proxy* pairs, including DEFAULTSECT." +msgid "" +"When *section* is not given, return a list of *section_name*, " +"*section_proxy* pairs, including DEFAULTSECT." msgstr "" +"هنگامی که *section* داده نشده باشد، فهرستی از جفت‌های *section_name* و " +"*section_proxy* شامل DEFAULTSECT را برمی‌گرداند." -msgid "Otherwise, return a list of *name*, *value* pairs for the options in the given *section*. Optional arguments have the same meaning as for the :meth:`get` method." +msgid "" +"Otherwise, return a list of *name*, *value* pairs for the options in the " +"given *section*. Optional arguments have the same meaning as for the " +":meth:`get` method." msgstr "" +"در غیر این صورت، فهرستی از جفت‌های *name*، *value* برای گزینه‌های موجود در " +"*section* داده‌شده برمی‌گرداند. آرگومان‌های اختیاری همان معنایی را دارند که " +"برای متد :meth:`get` دارند." -msgid "Items present in *vars* no longer appear in the result. The previous behaviour mixed actual parser options with variables provided for interpolation." +msgid "" +"Items present in *vars* no longer appear in the result. The previous " +"behaviour mixed actual parser options with variables provided for " +"interpolation." msgstr "" +"آیتم‌های موجود در *vars* دیگر در نتیجه ظاهر نمی‌شوند. رفتار پیشین، گزینه‌های" +" واقعی پارسر (parser) را با متغیرهای ارائه‌شده برای درون‌یابی " +"(interpolation) مخلوط می‌کرد." -msgid "If the given section exists, set the given option to the specified value; otherwise raise :exc:`NoSectionError`. *option* and *value* must be strings; if not, :exc:`TypeError` is raised." +msgid "" +"If the given section exists, set the given option to the specified value; " +"otherwise raise :exc:`NoSectionError`. *option* and *value* must be " +"strings; if not, :exc:`TypeError` is raised." msgstr "" +"اگر بخش داده‌شده وجود داشته باشد، گزینه‌ی داده‌شده را به مقدار مشخص‌شده تنظیم" +" می‌کند؛ در غیر این صورت :exc:`NoSectionError` پرتاب می‌شود. *option* و " +"*value* باید رشته باشند؛ در غیر این صورت :exc:`TypeError` پرتاب می‌شود." -msgid "Write a representation of the configuration to the specified :term:`file object`, which must be opened in text mode (accepting strings). This representation can be parsed by a future :meth:`read` call. If *space_around_delimiters* is true, delimiters between keys and values are surrounded by spaces." +msgid "" +"Write a representation of the configuration to the specified :term:`file " +"object`, which must be opened in text mode (accepting strings). This " +"representation can be parsed by a future :meth:`read` call. If " +"*space_around_delimiters* is true, delimiters between keys and values are " +"surrounded by spaces." msgstr "" +"بازنمایی‌ای از پیکربندی را در :term:`file object` مشخص بنویسید، که باید در " +"حالت متنی باز شده باشد (و رشته‌ها را بپذیرد). این بازنمایی را می‌توان با یک " +"فراخوانی بعدی :meth:`read` تجزیه کرد. اگر *space_around_delimiters* برابر " +"true باشد، جداکننده‌های بین کلیدها و مقدارها با فاصله احاطه می‌شوند." -msgid "Raises InvalidWriteError if this would write a representation which cannot be accurately parsed by a future :meth:`read` call from this parser." +msgid "" +"Raises InvalidWriteError if this would write a representation which cannot " +"be accurately parsed by a future :meth:`read` call from this parser." msgstr "" +"در صورتی که این عمل منجر به نوشتن بازنمایی‌ای شود که یک فراخوانی آینده " +":meth:`read` از این پارسر نتواند آن را به‌دقت تجزیه کند، " +"InvalidWriteError را پرتاب می‌کند." -msgid "Comments in the original configuration file are not preserved when writing the configuration back. What is considered a comment, depends on the given values for *comment_prefix* and *inline_comment_prefix*." +msgid "" +"Comments in the original configuration file are not preserved when writing " +"the configuration back. What is considered a comment, depends on the given " +"values for *comment_prefix* and *inline_comment_prefix*." msgstr "" +"کامنت‌های موجود در فایل پیکربندی اصلی، هنگام نوشتن مجدد پیکربندی حفظ " +"نمی‌شوند. اینکه چه چیزی کامنت در نظر گرفته می‌شود، به مقادیر داده‌شده برای " +"*comment_prefix* و *inline_comment_prefix* بستگی دارد." -msgid "Remove the specified *option* from the specified *section*. If the section does not exist, raise :exc:`NoSectionError`. If the option existed to be removed, return :const:`True`; otherwise return :const:`False`." +msgid "" +"Remove the specified *option* from the specified *section*. If the section " +"does not exist, raise :exc:`NoSectionError`. If the option existed to be " +"removed, return :const:`True`; otherwise return :const:`False`." msgstr "" +"*گزینه* مشخص‌شده را از *بخش* مشخص‌شده حذف می‌کند. اگر بخش وجود نداشته باشد، " +":exc:`NoSectionError` را پرتاب می‌کند. اگر گزینه برای حذف وجود داشته باشد، " +":const:`True` را برمی‌گرداند؛ در غیر این صورت :const:`False` را برمی‌گرداند." -msgid "Remove the specified *section* from the configuration. If the section in fact existed, return ``True``. Otherwise return ``False``." +msgid "" +"Remove the specified *section* from the configuration. If the section in " +"fact existed, return ``True``. Otherwise return ``False``." msgstr "" +"*بخش* مشخص‌شده را از پیکربندی حذف می‌کند. اگر بخش در واقع وجود داشته باشد، " +"``True`` برمی‌گرداند. در غیر این صورت ``False`` برمی‌گرداند." -msgid "Transforms the option name *option* as found in an input file or as passed in by client code to the form that should be used in the internal structures. The default implementation returns a lower-case version of *option*; subclasses may override this or client code can set an attribute of this name on instances to affect this behavior." -msgstr "" +msgid "" +"Transforms the option name *option* as found in an input file or as passed " +"in by client code to the form that should be used in the internal " +"structures. The default implementation returns a lower-case version of " +"*option*; subclasses may override this or client code can set an attribute " +"of this name on instances to affect this behavior." +msgstr "" +"نام گزینه *option* را، همان‌گونه که در یک فایل ورودی یافت می‌شود یا توسط کد " +"کلاینت ارسال می‌شود، به شکلی تبدیل می‌کند که باید در ساختارهای داخلی استفاده" +" شود. پیاده‌سازی پیش‌فرض، نسخه‌ای با حروف کوچک از *option* را برمی‌گرداند؛ " +"زیرکلاس‌ها می‌توانند این را بازنویسی کنند یا کد کلاینت می‌تواند ویژگی‌ای به " +"این نام را روی نمونه‌ها تنظیم کند تا بر این رفتار اثر بگذارد." -msgid "You don't need to subclass the parser to use this method, you can also set it on an instance, to a function that takes a string argument and returns a string. Setting it to ``str``, for example, would make option names case sensitive::" +msgid "" +"You don't need to subclass the parser to use this method, you can also set " +"it on an instance, to a function that takes a string argument and returns a " +"string. Setting it to ``str``, for example, would make option names case " +"sensitive::" msgstr "" +"برای استفاده از این متد نیازی نیست پارسر (parser) را زیرکلاس کنید؛ " +"می‌توانید آن را بر روی یک نمونه نیز به تابعی تنظیم کنید که یک آرگومان " +"رشته‌ای دریافت می‌کند و یک رشته برمی‌گرداند. برای مثال، تنظیم آن به ``str`` " +"باعث می‌شود نام گزینه‌ها به بزرگی و کوچکی حروف حساس شوند::" msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" msgstr "" +"cfgparser = ConfigParser()\n" +"cfgparser.optionxform = str" -msgid "Note that when reading configuration files, whitespace around the option names is stripped before :meth:`optionxform` is called." +msgid "" +"Note that when reading configuration files, whitespace around the option " +"names is stripped before :meth:`optionxform` is called." msgstr "" +"توجه داشته باشید که هنگام خواندن فایل‌های پیکربندی، فاصله‌های سفید اطراف نام" +" گزینه‌ها پیش از فراخوانی :meth:`optionxform` حذف می‌شود." -msgid "A special object representing a section name used to reference the unnamed section (see :ref:`unnamed-sections`)." +msgid "" +"A special object representing a section name used to reference the unnamed " +"section (see :ref:`unnamed-sections`)." msgstr "" +"یک شیء خاص که نشان‌دهنده‌ی نام بخش است و برای ارجاع به بخش بی‌نام استفاده " +"می‌شود (به :ref:`unnamed-sections` مراجعه کنید)." -msgid "The maximum depth for recursive interpolation for :meth:`~configparser.ConfigParser.get` when the *raw* parameter is false. This is relevant only when the default *interpolation* is used." +msgid "" +"The maximum depth for recursive interpolation for " +":meth:`~configparser.ConfigParser.get` when the *raw* parameter is false. " +"This is relevant only when the default *interpolation* is used." msgstr "" +"حداکثر عمق درون‌یابی بازگشتی برای :meth:`~configparser.ConfigParser.get` " +"زمانی که پارامتر *raw* نادرست باشد. این مورد تنها زمانی مرتبط است که از " +"*interpolation* پیش‌فرض استفاده شود." msgid "RawConfigParser Objects" -msgstr "" +msgstr "اشیای RawConfigParser" -msgid "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled by default and allows for non-string section names, option names, and values via its unsafe ``add_section`` and ``set`` methods, as well as the legacy ``defaults=`` keyword argument handling." +msgid "" +"Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " +"by default and allows for non-string section names, option names, and values" +" via its unsafe ``add_section`` and ``set`` methods, as well as the legacy " +"``defaults=`` keyword argument handling." msgstr "" +"گونه‌ای قدیمی از :class:`ConfigParser`. درون‌یابی در آن به‌طور پیش‌فرض " +"غیرفعال است و از طریق متدهای ناامن ``add_section`` و ``set`` و نیز مدیریت " +"قدیمی آرگومان کلیدواژه‌ای ``defaults=``، امکان استفاده از نام‌های بخش، " +"نام‌های گزینه و مقادیر غیررشته‌ای را فراهم می‌کند." -msgid "Consider using :class:`ConfigParser` instead which checks types of the values to be stored internally. If you don't want interpolation, you can use ``ConfigParser(interpolation=None)``." +msgid "" +"Consider using :class:`ConfigParser` instead which checks types of the " +"values to be stored internally. If you don't want interpolation, you can " +"use ``ConfigParser(interpolation=None)``." msgstr "" +"در عوض، استفاده از :class:`ConfigParser` را در نظر بگیرید که نوع مقادیری را " +"که باید به‌صورت داخلی ذخیره شوند بررسی می‌کند. اگر درون‌یابی نمی‌خواهید، " +"می‌توانید از ``ConfigParser(interpolation=None)`` استفاده کنید." -msgid "Add a section named *section* or :const:`UNNAMED_SECTION` to the instance." +msgid "" +"Add a section named *section* or :const:`UNNAMED_SECTION` to the instance." msgstr "" +"یک بخش با نام *section* یا :const:`UNNAMED_SECTION` به نمونه اضافه می‌کند." -msgid "If the given section already exists, :exc:`DuplicateSectionError` is raised. If the *default section* name is passed, :exc:`ValueError` is raised. If :const:`UNNAMED_SECTION` is passed and support is disabled, :exc:`UnnamedSectionDisabledError` is raised." +msgid "" +"If the given section already exists, :exc:`DuplicateSectionError` is raised." +" If the *default section* name is passed, :exc:`ValueError` is raised. If " +":const:`UNNAMED_SECTION` is passed and support is disabled, " +":exc:`UnnamedSectionDisabledError` is raised." msgstr "" +"اگر بخش داده‌شده از قبل وجود داشته باشد، :exc:`DuplicateSectionError` پرتاب " +"می‌شود. اگر نام *بخش پیش‌فرض* داده شود، :exc:`ValueError` پرتاب می‌شود. اگر " +":const:`UNNAMED_SECTION` داده شود و پشتیبانی غیرفعال باشد، " +":exc:`UnnamedSectionDisabledError` پرتاب می‌شود." -msgid "Type of *section* is not checked which lets users create non-string named sections. This behaviour is unsupported and may cause internal errors." +msgid "" +"Type of *section* is not checked which lets users create non-string named " +"sections. This behaviour is unsupported and may cause internal errors." msgstr "" +"نوع *section* بررسی نمی‌شود و این به کاربران امکان می‌دهد بخش‌هایی با " +"نام‌های غیررشته‌ای ایجاد کنند. این رفتار پشتیبانی نمی‌شود و ممکن است باعث " +"خطاهای داخلی شود." msgid "Added support for :const:`UNNAMED_SECTION`." -msgstr "" +msgstr "پشتیبانی از :const:`UNNAMED_SECTION` افزوده شد." -msgid "If the given section exists, set the given option to the specified value; otherwise raise :exc:`NoSectionError`. While it is possible to use :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to true) for *internal* storage of non-string values, full functionality (including interpolation and output to files) can only be achieved using string values." -msgstr "" +msgid "" +"If the given section exists, set the given option to the specified value; " +"otherwise raise :exc:`NoSectionError`. While it is possible to use " +":class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set" +" to true) for *internal* storage of non-string values, full functionality " +"(including interpolation and output to files) can only be achieved using " +"string values." +msgstr "" +"اگر بخش داده‌شده وجود داشته باشد، گزینه‌ی داده‌شده به مقدار مشخص‌شده تنظیم " +"می‌شود؛ در غیر این صورت :exc:`NoSectionError` پرتاب می‌شود. اگرچه می‌توان از" +" :class:`RawConfigParser` (یا :class:`ConfigParser` با پارامترهای *raw* که " +"به true تنظیم شده‌اند) برای ذخیره‌سازی *داخلی* مقادیر غیررشته‌ای استفاده " +"کرد، اما قابلیت کامل (شامل درون‌یابی و خروجی به فایل‌ها) تنها با استفاده از " +"مقادیر رشته‌ای امکان‌پذیر است." -msgid "This method lets users assign non-string values to keys internally. This behaviour is unsupported and will cause errors when attempting to write to a file or get it in non-raw mode. **Use the mapping protocol API** which does not allow such assignments to take place." +msgid "" +"This method lets users assign non-string values to keys internally. This " +"behaviour is unsupported and will cause errors when attempting to write to a" +" file or get it in non-raw mode. **Use the mapping protocol API** which " +"does not allow such assignments to take place." msgstr "" +"این متد به کاربران اجازه می‌دهد که مقادیر غیررشته‌ای را به‌صورت داخلی به " +"کلیدها منتسب کنند. این رفتار پشتیبانی نمی‌شود و هنگام تلاش برای نوشتن در یک " +"فایل یا دریافت آن در حالت غیرخام، باعث بروز خطاها خواهد شد. **از API " +"پروتکل نگاشت استفاده کنید** که چنین انتساب‌هایی را مجاز نمی‌داند." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "Base class for all other :mod:`!configparser` exceptions." -msgstr "" +msgstr "کلاس پایه برای تمام استثناهای دیگر :mod:`!configparser`." msgid "Exception raised when a specified section is not found." -msgstr "" +msgstr "استثنایی که هنگام پیدا نشدن بخش مشخص‌شده پرتاب می‌شود." -msgid "Exception raised if :meth:`~ConfigParser.add_section` is called with the name of a section that is already present or in strict parsers when a section if found more than once in a single input file, string or dictionary." +msgid "" +"Exception raised if :meth:`~ConfigParser.add_section` is called with the " +"name of a section that is already present or in strict parsers when a " +"section if found more than once in a single input file, string or " +"dictionary." msgstr "" +"استثنایی پرتاب می‌شود اگر :meth:`~ConfigParser.add_section` با نام بخشی که " +"از قبل موجود است فراخوانی شود، یا در پارسرهای سخت‌گیر وقتی بخشی بیش " +"از یک بار در یک فایل ورودی، رشته یا دیکشنری واحد یافت شود." -msgid "Added the optional *source* and *lineno* attributes and parameters to :meth:`!__init__`." +msgid "" +"Added the optional *source* and *lineno* attributes and parameters to " +":meth:`!__init__`." msgstr "" +"ویژگی‌ها و پارامترهای اختیاری *source* و *lineno* به :meth:`!__init__` اضافه" +" شدند." -msgid "Exception raised by strict parsers if a single option appears twice during reading from a single file, string or dictionary. This catches misspellings and case sensitivity-related errors, e.g. a dictionary may have two keys representing the same case-insensitive configuration key." +msgid "" +"Exception raised by strict parsers if a single option appears twice during " +"reading from a single file, string or dictionary. This catches misspellings " +"and case sensitivity-related errors, e.g. a dictionary may have two keys " +"representing the same case-insensitive configuration key." msgstr "" +"استثنایی که توسط پارسرهای سخت‌گیر در صورتی پرتاب می‌شود که یک گزینه " +"هنگام خواندن از یک فایل، رشته یا دیکشنری واحد دو بار ظاهر شود. این امر " +"غلط‌های املایی و خطاهای مربوط به حساسیت به حروف کوچک و بزرگ را شناسایی " +"می‌کند، برای مثال ممکن است یک دیکشنری دو کلید داشته باشد که نشان‌دهنده‌ی یک " +"کلید پیکربندی بدون حساسیت به حروف کوچک و بزرگ باشند." -msgid "Exception raised when a specified option is not found in the specified section." +msgid "" +"Exception raised when a specified option is not found in the specified " +"section." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که گزینه‌ی مشخص‌شده در بخش مشخص‌شده یافت " +"نشود." -msgid "Base class for exceptions raised when problems occur performing string interpolation." +msgid "" +"Base class for exceptions raised when problems occur performing string " +"interpolation." msgstr "" +"کلاس پایه برای استثناهایی که هنگام بروز مشکلات در انجام درون‌یابی رشته پرتاب" +" می‌شوند." -msgid "Exception raised when string interpolation cannot be completed because the number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :exc:`InterpolationError`." +msgid "" +"Exception raised when string interpolation cannot be completed because the " +"number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of " +":exc:`InterpolationError`." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که درون‌یابی رشته نمی‌تواند تکمیل شود، زیرا " +"تعداد تکرارها از :const:`MAX_INTERPOLATION_DEPTH` فراتر می‌رود. زیرکلاسی از" +" :exc:`InterpolationError`." -msgid "Exception raised when an option referenced from a value does not exist. Subclass of :exc:`InterpolationError`." +msgid "" +"Exception raised when an option referenced from a value does not exist. " +"Subclass of :exc:`InterpolationError`." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که گزینه‌ای که از یک مقدار به آن ارجاع داده " +"شده است وجود نداشته باشد. زیرکلاسی از :exc:`InterpolationError`." -msgid "Exception raised when the source text into which substitutions are made does not conform to the required syntax. Subclass of :exc:`InterpolationError`." +msgid "" +"Exception raised when the source text into which substitutions are made does" +" not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" +"استثنایی که در صورتی پرتاب می‌شود که متن منبعی که جایگذاری‌ها در آن انجام " +"می‌شوند، با سینتکس مورد نیاز مطابقت نداشته باشد. زیرکلاسی از " +":exc:`InterpolationError` است." -msgid "Exception raised when attempting to parse a file which has no section headers." +msgid "" +"Exception raised when attempting to parse a file which has no section " +"headers." msgstr "" +"استثنایی که هنگام تلاش برای تجزیه‌ی فایلی که هیچ سرآیند بخشی ندارد پرتاب " +"می‌شود." msgid "Exception raised when errors occur attempting to parse a file." -msgstr "" +msgstr "استثنایی که هنگام بروز خطا در تلاش برای تجزیه‌ی یک فایل پرتاب می‌شود." -msgid "The ``filename`` attribute and :meth:`!__init__` constructor argument were removed. They have been available using the name ``source`` since 3.2." +msgid "" +"The ``filename`` attribute and :meth:`!__init__` constructor argument were " +"removed. They have been available using the name ``source`` since 3.2." msgstr "" +"ویژگی ``filename`` و آرگومان سازنده‌ی :meth:`!__init__` حذف شده‌اند. این " +"موارد از 3.2 با استفاده از نام ``source`` در دسترس بوده‌اند." -msgid "Exception raised when a key without a corresponding value is continued with an indented line." +msgid "" +"Exception raised when a key without a corresponding value is continued with " +"an indented line." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که یک کلید بدون مقدار متناظر، با یک خط " +"تورفته ادامه یابد." -msgid "Exception raised when attempting to use the :const:`UNNAMED_SECTION` without enabling it." +msgid "" +"Exception raised when attempting to use the :const:`UNNAMED_SECTION` without" +" enabling it." msgstr "" +"استثنایی که هنگام تلاش برای استفاده از :const:`UNNAMED_SECTION` بدون " +"فعال‌سازی آن پرتاب می‌شود." -msgid "Exception raised when an attempted :meth:`ConfigParser.write` would not be parsed accurately with a future :meth:`ConfigParser.read` call." +msgid "" +"Exception raised when an attempted :meth:`ConfigParser.write` would not be " +"parsed accurately with a future :meth:`ConfigParser.read` call." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که تلاش برای فراخوانی " +":meth:`ConfigParser.write` نتواند با یک فراخوانی :meth:`ConfigParser.read` " +"در آینده به‌طور دقیق تجزیه شود." -msgid "Ex: Writing a key beginning with the :attr:`ConfigParser.SECTCRE` pattern would parse as a section header when read. Attempting to write this will raise this exception." +msgid "" +"Ex: Writing a key beginning with the :attr:`ConfigParser.SECTCRE` pattern " +"would parse as a section header when read. Attempting to write this will " +"raise this exception." msgstr "" +"مثال: نوشتن کلیدی که با الگوی :attr:`ConfigParser.SECTCRE` آغاز می‌شود، " +"هنگام خواندن به‌عنوان سرآیند بخش تجزیه می‌شود. تلاش برای نوشتن این مورد باعث " +"پرتاب این استثنا می‌شود." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Config parsers allow for heavy customization. If you are interested in changing the behaviour outlined by the footnote reference, consult the `Customizing Parser Behaviour`_ section." +msgid "" +"Config parsers allow for heavy customization. If you are interested in " +"changing the behaviour outlined by the footnote reference, consult the " +"`Customizing Parser Behaviour`_ section." msgstr "" +"پارسرهای پیکربندی امکان سفارشی‌سازی گسترده‌ای را فراهم می‌کنند. اگر به " +"تغییر رفتار شرح‌داده‌شده در ارجاع پانویس علاقه‌مند هستید، به بخش " +"`Customizing Parser Behaviour`_ مراجعه کنید." msgid ".ini" -msgstr "" +msgstr ".ini" msgid "file" -msgstr "" +msgstr "فایل" msgid "configuration" -msgstr "" +msgstr "پیکربندی" msgid "ini file" -msgstr "" +msgstr "فایل ini" msgid "Windows ini file" -msgstr "" +msgstr "فایل ini ویندوز" msgid "% (percent)" -msgstr "" +msgstr "% (درصد)" msgid "interpolation in configuration files" -msgstr "" +msgstr "درون‌یابی در فایل‌های پیکربندی" msgid "$ (dollar)" -msgstr "" +msgstr "$ (دلار)" diff --git a/library/constants.po b/library/constants.po index 96d117c47..29c26216d 100644 --- a/library/constants.po +++ b/library/constants.po @@ -23,67 +23,180 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Built-in Constants" -msgstr "" +msgstr "ثابت‌های توکار" msgid "A small number of constants live in the built-in namespace. They are:" -msgstr "" +msgstr "تعداد کمی از ثابت‌ها در فضای نام توکار قرار دارند. آن‌ها عبارتند از:" -msgid "The false value of the :class:`bool` type. Assignments to ``False`` are illegal and raise a :exc:`SyntaxError`." +msgid "" +"The false value of the :class:`bool` type. Assignments to ``False`` are " +"illegal and raise a :exc:`SyntaxError`." msgstr "" +"مقدار نادرست نوع :class:`bool`. انتساب به ``False`` غیرمجاز است و باعث پرتاب" +" :exc:`SyntaxError` می‌شود." -msgid "The true value of the :class:`bool` type. Assignments to ``True`` are illegal and raise a :exc:`SyntaxError`." +msgid "" +"The true value of the :class:`bool` type. Assignments to ``True`` are " +"illegal and raise a :exc:`SyntaxError`." msgstr "" +"مقدار درست نوع :class:`bool`. انتساب به ``True`` غیرمجاز است و " +":exc:`SyntaxError` پرتاب می‌کند." -msgid "An object frequently used to represent the absence of a value, as when default arguments are not passed to a function. Assignments to ``None`` are illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of the :class:`~types.NoneType` type." +msgid "" +"An object frequently used to represent the absence of a value, as when " +"default arguments are not passed to a function. Assignments to ``None`` are " +"illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of the" +" :class:`~types.NoneType` type." msgstr "" +"شیء‌ای که اغلب برای نشان دادن نبود یک مقدار استفاده می‌شود، مانند زمانی که " +"آرگومان‌های پیش‌فرض به یک تابع ارسال نمی‌شوند. انتساب به ``None`` غیرمجاز " +"است و یک :exc:`SyntaxError` پرتاب می‌کند. ``None`` تنها نمونه از نوع " +":class:`~types.NoneType` است." -msgid "A special value which should be returned by the binary special methods (e.g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :meth:`~object.__rsub__`, etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) for the same purpose. It should not be evaluated in a boolean context. :data:`!NotImplemented` is the sole instance of the :class:`types.NotImplementedType` type." -msgstr "" +msgid "" +"A special value which should be returned by the binary special methods (e.g." +" :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, " +":meth:`~object.__rsub__`, etc.) to indicate that the operation is not " +"implemented with respect to the other type; may be returned by the in-place " +"binary special methods (e.g. :meth:`~object.__imul__`, " +":meth:`~object.__iand__`, etc.) for the same purpose. It should not be " +"evaluated in a boolean context. :data:`!NotImplemented` is the sole instance" +" of the :class:`types.NotImplementedType` type." +msgstr "" +"مقدار ویژه‌ای که باید توسط متدهای ویژه دودویی (برای نمونه " +":meth:`~object.__eq__`، :meth:`~object.__lt__`، :meth:`~object.__add__`، " +":meth:`~object.__rsub__` و غیره) برگردانده شود تا نشان دهد عملیات نسبت به " +"نوع دیگر پیاده‌سازی نشده است؛ ممکن است توسط متدهای ویژه دودویی درجا (برای " +"نمونه :meth:`~object.__imul__`، :meth:`~object.__iand__` و غیره) برای همین " +"هدف برگردانده شود. این مقدار نباید در یک زمینه بولی ارزیابی شود. " +":data:`!NotImplemented` تنها نمونه از نوع :class:`types.NotImplementedType` " +"است." -msgid "When a binary (or in-place) method returns :data:`!NotImplemented` the interpreter will try the reflected operation on the other type (or some other fallback, depending on the operator). If all attempts return :data:`!NotImplemented`, the interpreter will raise an appropriate exception. Incorrectly returning :data:`!NotImplemented` will result in a misleading error message or the :data:`!NotImplemented` value being returned to Python code." -msgstr "" +msgid "" +"When a binary (or in-place) method returns :data:`!NotImplemented` the " +"interpreter will try the reflected operation on the other type (or some " +"other fallback, depending on the operator). If all attempts return " +":data:`!NotImplemented`, the interpreter will raise an appropriate " +"exception. Incorrectly returning :data:`!NotImplemented` will result in a " +"misleading error message or the :data:`!NotImplemented` value being returned" +" to Python code." +msgstr "" +"هنگامی که یک متد دودویی (یا درجا) :data:`!NotImplemented` را برمی‌گرداند، " +"مفسر عملیات بازتابی را روی نوع دیگر امتحان می‌کند (یا راه‌حل جایگزین دیگری، " +"بسته به عملگر). اگر تمام تلاش‌ها :data:`!NotImplemented` را برگردانند، مفسر " +"استثنای مناسبی پرتاب می‌کند. برگرداندن به‌اشتباه :data:`!NotImplemented` " +"منجر به یک پیام خطای گمراه‌کننده یا برگردانده شدن مقدار " +":data:`!NotImplemented` به کد پایتون می‌شود." msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "" +"برای نمونه‌ها، :ref:`implementing-the-arithmetic-operations` را ببینید." -msgid ":data:`!NotImplemented` and :exc:`!NotImplementedError` are not interchangeable. This constant should only be used as described above; see :exc:`NotImplementedError` for details on correct usage of the exception." +msgid "" +":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " +"interchangeable. This constant should only be used as described above; see " +":exc:`NotImplementedError` for details on correct usage of the exception." msgstr "" +":data:`!NotImplemented` و :exc:`!NotImplementedError` قابل جایگزینی با " +"یکدیگر نیستند. این ثابت باید فقط همان‌طور که در بالا توضیح داده شد استفاده " +"شود؛ برای جزئیات درباره استفاده صحیح از استثنا، :exc:`NotImplementedError` " +"را ببینید." -msgid "Evaluating :data:`!NotImplemented` in a boolean context was deprecated." -msgstr "" +msgid "" +"Evaluating :data:`!NotImplemented` in a boolean context was deprecated." +msgstr "ارزیابی :data:`!NotImplemented` در زمینه بولی منسوخ شد." -msgid "Evaluating :data:`!NotImplemented` in a boolean context now raises a :exc:`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:`DeprecationWarning` since Python 3.9." +msgid "" +"Evaluating :data:`!NotImplemented` in a boolean context now raises a " +":exc:`TypeError`. It previously evaluated to :const:`True` and emitted a " +":exc:`DeprecationWarning` since Python 3.9." msgstr "" +"ارزیابی :data:`!NotImplemented` در یک زمینه بولی، اکنون یک :exc:`TypeError` " +"پرتاب می‌کند. پیش از این به :const:`True` ارزیابی می‌شد و از پایتون 3.9، یک " +":exc:`DeprecationWarning` صادر می‌کرد." -msgid "The same as the ellipsis literal \"``...``\", an object frequently used to indicate that something is omitted. Assignment to ``Ellipsis`` is possible, but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the sole instance of the :class:`types.EllipsisType` type." +msgid "" +"The same as the ellipsis literal \"``...``\", an object frequently used to " +"indicate that something is omitted. Assignment to ``Ellipsis`` is possible, " +"but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the " +"sole instance of the :class:`types.EllipsisType` type." msgstr "" +"همان لفظی سه‌نقطه (ellipsis) ``...``، شیءای که اغلب برای نشان دادن اینکه " +"چیزی حذف‌شده است استفاده می‌شود. انتساب به ``Ellipsis`` امکان‌پذیر است، اما " +"انتساب به ``...`` یک :exc:`SyntaxError` پرتاب می‌کند. ``Ellipsis`` تنها " +"نمونه از نوع :class:`types.EllipsisType` است." -msgid "This constant is true if Python was not started with an :option:`-O` option. See also the :keyword:`assert` statement." +msgid "" +"This constant is true if Python was not started with an :option:`-O` option." +" See also the :keyword:`assert` statement." msgstr "" +"این ثابت زمانی درست است که پایتون با گزینه‌ی :option:`-O` اجرا نشده باشد. " +"همچنین دستور :keyword:`assert` را ببینید." -msgid "The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` cannot be reassigned (assignments to them, even as an attribute name, raise :exc:`SyntaxError`), so they can be considered \"true\" constants." +msgid "" +"The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` " +"cannot be reassigned (assignments to them, even as an attribute name, raise " +":exc:`SyntaxError`), so they can be considered \"true\" constants." msgstr "" +"نام‌های :data:`None`، :data:`False`، :data:`True` و :data:`__debug__` قابل " +"انتساب مجدد نیستند (انتساب به آن‌ها، حتی به‌عنوان نام یک ویژگی، " +":exc:`SyntaxError` را پرتاب می‌کند)، بنابراین می‌توان آن‌ها را ثابت‌های " +"«واقعی» در نظر گرفت." msgid "Constants added by the :mod:`site` module" -msgstr "" +msgstr "ثابت‌های اضافه‌شده توسط ماژول :mod:`site`" -msgid "The :mod:`site` module (which is imported automatically during startup, except if the :option:`-S` command-line option is given) adds several constants to the built-in namespace. They are useful for the interactive interpreter shell and should not be used in programs." +msgid "" +"The :mod:`site` module (which is imported automatically during startup, " +"except if the :option:`-S` command-line option is given) adds several " +"constants to the built-in namespace. They are useful for the interactive " +"interpreter shell and should not be used in programs." msgstr "" +"ماژول :mod:`site` (که به‌صورت خودکار هنگام راه‌اندازی ایمپورت می‌شود، مگر " +"اینکه گزینه خط فرمان :option:`-S` داده شده باشد) چند ثابت را به فضای نام " +"توکار اضافه می‌کند. این ثابت‌ها برای پوسته تعاملی مفسر مفید هستند و نباید در" +" برنامه‌ها استفاده شوند." -msgid "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. EOF) to exit\", and when accessed directly in the interactive interpreter or called as functions, raise :exc:`SystemExit` with the specified exit code." +msgid "" +"Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e." +" EOF) to exit\", and when accessed directly in the interactive interpreter " +"or called as functions, raise :exc:`SystemExit` with the specified exit " +"code." msgstr "" +"اشیایی که وقتی چاپ می‌شوند، پیامی مانند «برای خروج از quit() یا Ctrl-D " +"(یعنی EOF) استفاده کنید» را چاپ می‌کنند، و وقتی مستقیماً در مفسر تعاملی به " +"آن‌ها دسترسی پیدا شود یا به‌عنوان تابع فراخوانی شوند، :exc:`SystemExit` را " +"با کد خروج مشخص‌شده پرتاب می‌کنند." -msgid "Object that when printed, prints the message \"Type help() for interactive help, or help(object) for help about object.\", and when accessed directly in the interactive interpreter, invokes the built-in help system (see :func:`help`)." +msgid "" +"Object that when printed, prints the message \"Type help() for interactive " +"help, or help(object) for help about object.\", and when accessed directly " +"in the interactive interpreter, invokes the built-in help system (see " +":func:`help`)." msgstr "" +"شیءای که هنگام چاپ، پیام «برای راهنمای تعاملی، help() را وارد کنید، یا برای " +"راهنمایی درباره‌ی شیء، help(object) را وارد کنید.» را چاپ می‌کند، و هنگامی که" +" مستقیماً در مفسر تعاملی به آن دسترسی پیدا شود، سامانه‌ی راهنمای توکار را " +"فراخوانی می‌کند (به :func:`help` مراجعه کنید)." -msgid "Objects that when printed or called, print the text of copyright or credits, respectively." +msgid "" +"Objects that when printed or called, print the text of copyright or credits," +" respectively." msgstr "" +"اشیایی که هنگام چاپ یا فراخوانی، به‌ترتیب متن copyright یا credits را چاپ " +"می‌کنند." -msgid "Object that when printed, prints the message \"Type license() to see the full license text\", and when called, displays the full license text in a pager-like fashion (one screen at a time)." +msgid "" +"Object that when printed, prints the message \"Type license() to see the " +"full license text\", and when called, displays the full license text in a " +"pager-like fashion (one screen at a time)." msgstr "" +"شیءای که هنگام چاپ، پیام «برای دیدن متن کامل پروانه، license() را تایپ کنید» " +"را چاپ می‌کند و هنگام فراخوانی، متن کامل پروانه را به‌شیوه‌ای مشابه صفحه‌بند" +" (pager)، یعنی هر بار یک صفحه، نمایش می‌دهد." msgid "..." -msgstr "" +msgstr "..." msgid "ellipsis literal" -msgstr "" +msgstr "لفظی سه‌نقطه" diff --git a/library/contextlib.po b/library/contextlib.po index 190031451..0da928d87 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"PO-Revision-Date: 2026-08-28 10:06+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,36 +23,86 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" -msgid ":mod:`!contextlib` --- Utilities for :keyword:`!with`\\ -statement contexts" -msgstr "" +msgid "" +":mod:`!contextlib` --- Utilities for :keyword:`!with`\\ -statement contexts" +msgstr ":mod:`!contextlib` --- ابزارهایی برای زمینه‌های دستور :keyword:`!with`" msgid "**Source code:** :source:`Lib/contextlib.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/contextlib.py`" -msgid "This module provides utilities for common tasks involving the :keyword:`with` statement. For more information see also :ref:`typecontextmanager` and :ref:`context-managers`." +msgid "" +"This module provides utilities for common tasks involving " +"the :keyword:`with` statement. For more information see " +"also :ref:`typecontextmanager` and :ref:`context-managers`." msgstr "" +"این ماژول ابزارهایی برای انجام کارهای رایج مربوط به دستور :keyword:`with` " +"ارائه می‌دهد. برای اطلاعات بیشتر، :ref:`typecontextmanager` و :ref:`context-" +"managers` را نیز ببینید." msgid "Utilities" -msgstr "" +msgstr "ابزارهای کاربردی" msgid "Functions and classes provided:" -msgstr "" +msgstr "توابع و کلاس‌های ارائه‌شده:" -msgid "An :term:`abstract base class` for classes that implement :meth:`~object.__enter__` and :meth:`~object.__exit__`. A default implementation for :meth:`~object.__enter__` is provided which returns ``self`` while :meth:`~object.__exit__` is an abstract method which by default returns ``None``. See also the definition of :ref:`typecontextmanager`." -msgstr "" +msgid "" +"An :term:`abstract base class` for classes that " +"implement :meth:`~object.__enter__` and :meth:`~object.__exit__`. A default " +"implementation for :meth:`~object.__enter__` is provided which returns " +"``self`` while :meth:`~object.__exit__` is an abstract method which by " +"default returns ``None``. See also the definition " +"of :ref:`typecontextmanager`." +msgstr "" +"یک :term:`کلاس پایه انتزاعی ` برای کلاس‌هایی " +"که :meth:`~object.__enter__` و :meth:`~object.__exit__` را پیاده‌سازی می‌کنند. " +"یک پیاده‌سازی پیش‌فرض برای :meth:`~object.__enter__` ارائه شده است که ``self`` " +"را برمی‌گرداند، در حالی که :meth:`~object.__exit__` یک متد انتزاعی است که " +"به‌طور پیش‌فرض ``None`` را برمی‌گرداند. همچنین تعریف :ref:`typecontextmanager` " +"را نیز ببینید." -msgid "An :term:`abstract base class` for classes that implement :meth:`~object.__aenter__` and :meth:`~object.__aexit__`. A default implementation for :meth:`~object.__aenter__` is provided which returns ``self`` while :meth:`~object.__aexit__` is an abstract method which by default returns ``None``. See also the definition of :ref:`async-context-managers`." -msgstr "" +msgid "" +"An :term:`abstract base class` for classes that " +"implement :meth:`~object.__aenter__` and :meth:`~object.__aexit__`. A " +"default implementation for :meth:`~object.__aenter__` is provided which " +"returns ``self`` while :meth:`~object.__aexit__` is an abstract method which " +"by default returns ``None``. See also the definition of :ref:`async-context-" +"managers`." +msgstr "" +"یک :term:`کلاس پایه انتزاعی ` برای کلاس‌هایی " +"که :meth:`~object.__aenter__` و :meth:`~object.__aexit__` را پیاده‌سازی " +"می‌کنند. پیاده‌سازی پیش‌فرضی برای :meth:`~object.__aenter__` فراهم شده است که " +"``self`` را برمی‌گرداند، در حالی که :meth:`~object.__aexit__` یک متد انتزاعی " +"است که به‌طور پیش‌فرض ``None`` را برمی‌گرداند. همچنین تعریف :ref:`async-context-" +"managers` را ببینید." -msgid "This function is a :term:`decorator` that can be used to define a factory function for :keyword:`with` statement context managers, without needing to create a class or separate :meth:`~object.__enter__` and :meth:`~object.__exit__` methods." +msgid "" +"This function is a :term:`decorator` that can be used to define a factory " +"function for :keyword:`with` statement context managers, without needing to " +"create a class or separate :meth:`~object.__enter__` " +"and :meth:`~object.__exit__` methods." msgstr "" +"این تابع یک :term:`دکوراتور ` است که می‌توان از آن برای تعریف یک " +"تابع کارخانه‌ای برای مدیران زمینه‌ی دستور :keyword:`with` استفاده کرد، بدون نیاز " +"به ایجاد یک کلاس یا متدهای جداگانه‌ی :meth:`~object.__enter__` " +"و :meth:`~object.__exit__`." -msgid "While many objects natively support use in with statements, sometimes a resource needs to be managed that isn't a context manager in its own right, and doesn't implement a ``close()`` method for use with ``contextlib.closing``." +msgid "" +"While many objects natively support use in with statements, sometimes a " +"resource needs to be managed that isn't a context manager in its own right, " +"and doesn't implement a ``close()`` method for use with " +"``contextlib.closing``." msgstr "" +"در حالی که بسیاری از شیء‌ها به‌صورت ذاتی از استفاده در دستورهای with پشتیبانی " +"می‌کنند، گاهی نیاز است منبعی مدیریت شود که به‌خودی‌خود مدیر زمینه نیست و متد " +"``close()`` را برای استفاده با ``contextlib.closing`` پیاده‌سازی نمی‌کند." -msgid "An abstract example would be the following to ensure correct resource management::" +msgid "" +"An abstract example would be the following to ensure correct resource " +"management::" msgstr "" +"برای اطمینان از مدیریت صحیح منابع، یک مثال انتزاعی به‌صورت زیر خواهد بود::" msgid "" "from contextlib import contextmanager\n" @@ -67,36 +117,105 @@ msgid "" " # Code to release resource, e.g.:\n" " release_resource(resource)" msgstr "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def managed_resource(*args, **kwds):\n" +" # Code to acquire resource, e.g.:\n" +" resource = acquire_resource(*args, **kwds)\n" +" try:\n" +" yield resource\n" +" finally:\n" +" # Code to release resource, e.g.:\n" +" release_resource(resource)" msgid "The function can then be used like this::" -msgstr "" +msgstr "سپس می‌توان از تابع به این صورت استفاده کرد::" msgid "" ">>> with managed_resource(timeout=3600) as resource:\n" "... # Resource is released at the end of this block,\n" "... # even if code in the block raises an exception" msgstr "" +">>> with managed_resource(timeout=3600) as resource:\n" +"... # Resource is released at the end of this block,\n" +"... # even if code in the block raises an exception" -msgid "The function being decorated must return a :term:`generator`-iterator when called. This iterator must yield exactly one value, which will be bound to the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any." +msgid "" +"The function being decorated must return a :term:`generator`-iterator when " +"called. This iterator must yield exactly one value, which will be bound to " +"the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any." msgstr "" +"تابع آرایه‌شده باید هنگامی که فراخوانی می‌شود، یک پیمایه‌ی :term:`تولیدگر ` را برگرداند. این پیمایه باید دقیقاً یک مقدار را تولید کند، که این مقدار در صورت وجود بند :keyword:`!as ` در دستور :keyword:`with`، به اهداف موجود در آن بند متصل خواهد شد." -msgid "At the point where the generator yields, the block nested in the :keyword:`with` statement is executed. The generator is then resumed after the block is exited. If an unhandled exception occurs in the block, it is reraised inside the generator at the point where the yield occurred. Thus, you can use a :keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` statement to trap the error (if any), or ensure that some cleanup takes place. If an exception is trapped merely in order to log it or to perform some action (rather than to suppress it entirely), the generator must reraise that exception. Otherwise the generator context manager will indicate to the :keyword:`!with` statement that the exception has been handled, and execution will resume with the statement immediately following the :keyword:`!with` statement." -msgstr "" +msgid "" +"At the point where the generator yields, the block nested in " +"the :keyword:`with` statement is executed. The generator is then resumed " +"after the block is exited. If an unhandled exception occurs in the block, it " +"is reraised inside the generator at the point where the yield occurred. " +"Thus, you can use a :keyword:`try`...\\ :keyword:`except`..." +"\\ :keyword:`finally` statement to trap the error (if any), or ensure that " +"some cleanup takes place. If an exception is trapped merely in order to log " +"it or to perform some action (rather than to suppress it entirely), the " +"generator must reraise that exception. Otherwise the generator context " +"manager will indicate to the :keyword:`!with` statement that the exception " +"has been handled, and execution will resume with the statement immediately " +"following the :keyword:`!with` statement." +msgstr "" +"در نقطه‌ای که تولیدگر yield می‌کند، بلوک نهفته در دستور " +":keyword:`with` اجرا می‌شود. سپس پس از خروج از بلوک، تولیدگر از سر گرفته " +"می‌شود. اگر یک استثنای مدیریت‌نشده در بلوک رخ دهد، در نقطه‌ای که yield رخ " +"داده است، درون تولیدگر دوباره پرتاب می‌شود. بنابراین، می‌توانید از یک دستور " +":keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` برای " +"رهگیری خطا (در صورت وجود) یا اطمینان از انجام برخی پاک‌سازی‌ها استفاده کنید. " +"اگر یک استثنا صرفاً برای ثبت آن یا انجام عملی (نه برای سرکوب کامل آن) گرفته " +"شود، تولیدگر باید آن استثنا را دوباره پرتاب کند. در غیر این صورت، مدیر زمینه‌ی " +"تولیدگر به دستور :keyword:`!with` اطلاع می‌دهد که استثنا مدیریت شده است، و " +"اجرا با دستور بلافاصله پس از دستور :keyword:`!with` از سر گرفته می‌شود." -msgid ":deco:`contextmanager` uses :class:`ContextDecorator` so the context managers it creates can be used as decorators as well as in :keyword:`with` statements. When used as a decorator, a new generator instance is implicitly created on each function call (this allows the otherwise \"one-shot\" context managers created by :deco:`contextmanager` to meet the requirement that context managers support multiple invocations in order to be used as decorators)." -msgstr "" +msgid "" +":deco:`contextmanager` uses :class:`ContextDecorator` so the context " +"managers it creates can be used as decorators as well as in :keyword:`with` " +"statements. When used as a decorator, a new generator instance is implicitly " +"created on each function call (this allows the otherwise \"one-shot\" " +"context managers created by :deco:`contextmanager` to meet the requirement " +"that context managers support multiple invocations in order to be used as " +"decorators)." +msgstr "" +":deco:`contextmanager` از :class:`ContextDecorator` استفاده می‌کند، بنابراین " +"مدیرهای زمینه‌ای که ایجاد می‌کند می‌توانند هم به‌عنوان دکوراتور و هم در " +"دستورهای :keyword:`with` استفاده شوند. هنگام استفاده به‌عنوان دکوراتور، در هر " +"فراخوانی تابع، یک نمونه‌ی جدید از تولیدگر به‌طور ضمنی ایجاد می‌شود (این امر به " +"مدیرهای زمینه‌ای که توسط :deco:`contextmanager` ایجاد می‌شوند و در غیر این " +"صورت «یک‌بارمصرف» هستند، اجازه می‌دهد الزام پشتیبانی از چندین فراخوانی برای " +"استفاده به‌عنوان دکوراتور را برآورده کنند)." msgid "Use of :class:`ContextDecorator`." -msgstr "" +msgstr "استفاده از :class:`ContextDecorator`." -msgid "Similar to :deco:`~contextlib.contextmanager`, but creates an :ref:`asynchronous context manager `." +msgid "" +"Similar to :deco:`~contextlib.contextmanager`, but creates " +"an :ref:`asynchronous context manager `." msgstr "" +"مشابه :deco:`~contextlib.contextmanager`، اما یک :ref:`مدیر زمینه ناهمگام " +"` ایجاد می‌کند." -msgid "This function is a :term:`decorator` that can be used to define a factory function for :keyword:`async with` statement asynchronous context managers, without needing to create a class or separate :meth:`~object.__aenter__` and :meth:`~object.__aexit__` methods. It must be applied to an :term:`asynchronous generator` function." -msgstr "" +msgid "" +"This function is a :term:`decorator` that can be used to define a factory " +"function for :keyword:`async with` statement asynchronous context managers, " +"without needing to create a class or separate :meth:`~object.__aenter__` " +"and :meth:`~object.__aexit__` methods. It must be applied to " +"an :term:`asynchronous generator` function." +msgstr "" +"این تابع یک :term:`دکوراتور ` است که می‌توان از آن برای تعریف یک " +"تابع کارخانه‌ای برای مدیران زمینه ناهمگام دستور :keyword:`async with` استفاده " +"کرد، بدون نیاز به ایجاد یک کلاس یا متدهای " +"جداگانه‌ی :meth:`~object.__aenter__` و :meth:`~object.__aexit__`. این " +"دکوراتور باید به یک تابع :term:`تولیدگر ناهمگام ` " +"اعمال شود." msgid "A simple example::" -msgstr "" +msgstr "یک مثال ساده::" msgid "" "from contextlib import asynccontextmanager\n" @@ -113,9 +232,26 @@ msgid "" " async with get_connection() as conn:\n" " return conn.query('SELECT ...')" msgstr "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def get_connection():\n" +" conn = await acquire_db_connection()\n" +" try:\n" +" yield conn\n" +" finally:\n" +" await release_db_connection(conn)\n" +"\n" +"async def get_all_users():\n" +" async with get_connection() as conn:\n" +" return conn.query('SELECT ...')" -msgid "Context managers defined with :deco:`asynccontextmanager` can be used either as decorators or with :keyword:`async with` statements::" +msgid "" +"Context managers defined with :deco:`asynccontextmanager` can be used either " +"as decorators or with :keyword:`async with` statements::" msgstr "" +"مدیران زمینه تعریف‌شده با :deco:`asynccontextmanager` را می‌توان هم به‌عنوان " +"دکوراتور و هم با دستورهای :keyword:`async with` استفاده کرد::" msgid "" "import time\n" @@ -133,15 +269,46 @@ msgid "" "async def main():\n" " # ... async code ..." msgstr "" +"import time\n" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def timeit():\n" +" now = time.monotonic()\n" +" try:\n" +" yield\n" +" finally:\n" +" print(f'it took {time.monotonic() - now}s to run')\n" +"\n" +"@timeit()\n" +"async def main():\n" +" # ... async code ..." -msgid "When used as a decorator, a new generator instance is implicitly created on each function call. This allows the otherwise \"one-shot\" context managers created by :deco:`asynccontextmanager` to meet the requirement that context managers support multiple invocations in order to be used as decorators." +msgid "" +"When used as a decorator, a new generator instance is implicitly created on " +"each function call. This allows the otherwise \"one-shot\" context managers " +"created by :deco:`asynccontextmanager` to meet the requirement that context " +"managers support multiple invocations in order to be used as decorators." msgstr "" +"هنگام استفاده به‌عنوان دکوراتور، در هر فراخوانی تابع، یک نمونه تولیدگر جدید " +"به‌طور ضمنی ایجاد می‌شود. این امر به مدیرهای زمینه ایجادشده " +"توسط :deco:`asynccontextmanager`، که در غیر این صورت «یک‌بارمصرف» هستند، " +"اجازه می‌دهد الزامی را برآورده کنند که طبق آن مدیرهای زمینه باید برای استفاده " +"به‌عنوان دکوراتور از فراخوانی‌های متعدد پشتیبانی کنند." -msgid "Async context managers created with :deco:`asynccontextmanager` can be used as decorators." +msgid "" +"Async context managers created with :deco:`asynccontextmanager` can be used " +"as decorators." msgstr "" +"مدیرهای زمینه ناهمگام ایجادشده با :deco:`asynccontextmanager` را می‌توان " +"به‌عنوان دکوراتور استفاده کرد." -msgid "Return a context manager that closes *thing* upon completion of the block. This is basically equivalent to::" +msgid "" +"Return a context manager that closes *thing* upon completion of the block. " +"This is basically equivalent to::" msgstr "" +"یک مدیر زمینه برمی‌گرداند که *thing* را پس از تکمیل بلوک می‌بندد. این اساساً " +"معادل است با::" msgid "" "from contextlib import contextmanager\n" @@ -153,9 +320,17 @@ msgid "" " finally:\n" " thing.close()" msgstr "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def closing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" thing.close()" msgid "And lets you write code like this::" -msgstr "" +msgstr "و به شما امکان می‌دهد کدی مانند این بنویسید::" msgid "" "from contextlib import closing\n" @@ -165,15 +340,41 @@ msgid "" " for line in page:\n" " print(line)" msgstr "" +"from contextlib import closing\n" +"from urllib.request import urlopen\n" +"\n" +"with closing(urlopen('https://www.python.org')) as page:\n" +" for line in page:\n" +" print(line)" -msgid "without needing to explicitly close ``page``. Even if an error occurs, ``page.close()`` will be called when the :keyword:`with` block is exited." +msgid "" +"without needing to explicitly close ``page``. Even if an error occurs, " +"``page.close()`` will be called when the :keyword:`with` block is exited." msgstr "" +"بدون نیاز به بستن ``page`` به‌صراحت. حتی اگر خطایی رخ دهد، هنگام خروج از " +"بلوک :keyword:`with`، ``page.close()`` فراخوانی خواهد شد." -msgid "Most types managing resources support the :term:`context manager` protocol, which closes *thing* on leaving the :keyword:`with` statement. As such, :func:`!closing` is most useful for third party types that don't support context managers. This example is purely for illustration purposes, as :func:`~urllib.request.urlopen` would normally be used in a context manager." -msgstr "" +msgid "" +"Most types managing resources support the :term:`context manager` protocol, " +"which closes *thing* on leaving the :keyword:`with` statement. As " +"such, :func:`!closing` is most useful for third party types that don't " +"support context managers. This example is purely for illustration purposes, " +"as :func:`~urllib.request.urlopen` would normally be used in a context " +"manager." +msgstr "" +"بیشتر انواعی که منابع را مدیریت می‌کنند، از پروتکل :term:`مدیر زمینه ` پشتیبانی می‌کنند، که *شیء* را در هنگام خروج از " +"دستور :keyword:`with` می‌بندد. از این رو، :func:`!closing` برای انواع شخص " +"ثالثی که از مدیران زمینه پشتیبانی نمی‌کنند، بیشترین کاربرد را دارد. این مثال " +"صرفاً برای اهداف نمایشی است، زیرا :func:`~urllib.request.urlopen` به‌طور معمول " +"در یک مدیر زمینه استفاده می‌شود." -msgid "Return an async context manager that calls the ``aclose()`` method of *thing* upon completion of the block. This is basically equivalent to::" +msgid "" +"Return an async context manager that calls the ``aclose()`` method of " +"*thing* upon completion of the block. This is basically equivalent to::" msgstr "" +"یک مدیر زمینه ناهمگام برمی‌گرداند که پس از تکمیل بلوک، متد ``aclose()`` متعلق " +"به *thing* را فراخوانی می‌کند. این اساساً معادل است با::" msgid "" "from contextlib import asynccontextmanager\n" @@ -185,9 +386,23 @@ msgid "" " finally:\n" " await thing.aclose()" msgstr "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def aclosing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" await thing.aclose()" -msgid "Significantly, ``aclosing()`` supports deterministic cleanup of async generators when they happen to exit early by :keyword:`break` or an exception. For example::" +msgid "" +"Significantly, ``aclosing()`` supports deterministic cleanup of async " +"generators when they happen to exit early by :keyword:`break` or an " +"exception. For example::" msgstr "" +"به‌طور قابل‌توجهی، ``aclosing()`` از پاک‌سازی قطعی تولیدگرهای ناهمگام در صورتی " +"که به‌واسطه‌ی :keyword:`break` یا یک استثنا زودتر خارج شوند، پشتیبانی می‌کند. " +"برای مثال::" msgid "" "from contextlib import aclosing\n" @@ -197,12 +412,31 @@ msgid "" " if value == 42:\n" " break" msgstr "" +"from contextlib import aclosing\n" +"\n" +"async with aclosing(my_generator()) as values:\n" +" async for value in values:\n" +" if value == 42:\n" +" break" -msgid "This pattern ensures that the generator's async exit code is executed in the same context as its iterations (so that exceptions and context variables work as expected, and the exit code isn't run after the lifetime of some task it depends on)." +msgid "" +"This pattern ensures that the generator's async exit code is executed in the " +"same context as its iterations (so that exceptions and context variables " +"work as expected, and the exit code isn't run after the lifetime of some " +"task it depends on)." msgstr "" +"این الگو تضمین می‌کند که کد خروج ناهمگام تولیدگر در همان زمینه‌ای اجرا شود که " +"تکرارهای آن اجرا می‌شوند (تا استثناها و متغیرهای زمینه همان‌طور که انتظار " +"می‌رود کار کنند و کد خروج پس از طول عمر وظیفهی که به آن وابسته است اجرا نشود)." -msgid "Return a context manager that returns *enter_result* from :meth:`~object.__enter__`, but otherwise does nothing. It is intended to be used as a stand-in for an optional context manager, for example::" +msgid "" +"Return a context manager that returns *enter_result* " +"from :meth:`~object.__enter__`, but otherwise does nothing. It is intended " +"to be used as a stand-in for an optional context manager, for example::" msgstr "" +"یک مدیر زمینه برمی‌گرداند که *enter_result* را از :meth:`~object.__enter__` " +"برمی‌گرداند، اما در غیر این صورت هیچ کاری انجام نمی‌دهد. این برای استفاده " +"به‌عنوان جایگزینی برای یک مدیر زمینه اختیاری در نظر گرفته شده است، برای مثال::" msgid "" "def myfunction(arg, ignore_exceptions=False):\n" @@ -215,9 +449,18 @@ msgid "" " with cm:\n" " # Do something" msgstr "" +"def myfunction(arg, ignore_exceptions=False):\n" +" if ignore_exceptions:\n" +" # Use suppress to ignore all exceptions.\n" +" cm = contextlib.suppress(Exception)\n" +" else:\n" +" # Do not ignore any exceptions, cm has no effect.\n" +" cm = contextlib.nullcontext()\n" +" with cm:\n" +" # Do something" msgid "An example using *enter_result*::" -msgstr "" +msgstr "مثالی با استفاده از *enter_result*::" msgid "" "def process_file(file_or_path):\n" @@ -231,9 +474,23 @@ msgid "" " with cm as file:\n" " # Perform processing on the file" msgstr "" +"def process_file(file_or_path):\n" +" if isinstance(file_or_path, str):\n" +" # If string, open file\n" +" cm = open(file_or_path)\n" +" else:\n" +" # Caller is responsible for closing file\n" +" cm = nullcontext(file_or_path)\n" +"\n" +" with cm as file:\n" +" # Perform processing on the file" -msgid "It can also be used as a stand-in for :ref:`asynchronous context managers `::" +msgid "" +"It can also be used as a stand-in for :ref:`asynchronous context managers " +"`::" msgstr "" +"همچنین می‌تواند به‌عنوان جایگزینی برای :ref:`مدیران زمینه ناهمگام ` استفاده شود::" msgid "" "async def send_http(session=None):\n" @@ -247,18 +504,42 @@ msgid "" " async with cm as session:\n" " # Send http requests with session" msgstr "" +"async def send_http(session=None):\n" +" if not session:\n" +" # If no http session, create it with aiohttp\n" +" cm = aiohttp.ClientSession()\n" +" else:\n" +" # Caller is responsible for closing the session\n" +" cm = nullcontext(session)\n" +"\n" +" async with cm as session:\n" +" # Send http requests with session" msgid ":term:`asynchronous context manager` support was added." -msgstr "" +msgstr "پشتیبانی از :term:`asynchronous context manager` افزوده شد." -msgid "Return a context manager that suppresses any of the specified exceptions if they occur in the body of a :keyword:`!with` statement and then resumes execution with the first statement following the end of the :keyword:`!with` statement." +msgid "" +"Return a context manager that suppresses any of the specified exceptions if " +"they occur in the body of a :keyword:`!with` statement and then resumes " +"execution with the first statement following the end of the :keyword:`!with` " +"statement." msgstr "" +"یک مدیر زمینه برمی‌گرداند که در صورت وقوع هر یک از استثناهای مشخص‌شده در بدنه‌ی " +"دستور :keyword:`!with`، آن‌ها را سرکوب می‌کند و سپس اجرا را با نخستین دستور پس " +"از پایان دستور :keyword:`!with` از سر می‌گیرد." -msgid "As with any other mechanism that completely suppresses exceptions, this context manager should be used only to cover very specific errors where silently continuing with program execution is known to be the right thing to do." +msgid "" +"As with any other mechanism that completely suppresses exceptions, this " +"context manager should be used only to cover very specific errors where " +"silently continuing with program execution is known to be the right thing to " +"do." msgstr "" +"همان‌طور که در مورد هر سازوکار دیگری که استثناها را به‌طور کامل سرکوب می‌کند، " +"این مدیریت‌کننده‌ی زمینه باید فقط برای پوشش خطاهای بسیار خاصی استفاده شود که در " +"آن‌ها ادامه‌ی بی‌صدای اجرای برنامه کار درست شناخته می‌شود." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "from contextlib import suppress\n" @@ -269,9 +550,16 @@ msgid "" "with suppress(FileNotFoundError):\n" " os.remove('someotherfile.tmp')" msgstr "" +"from contextlib import suppress\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('somefile.tmp')\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('someotherfile.tmp')" msgid "This code is equivalent to::" -msgstr "" +msgstr "این کد معادل است با::" msgid "" "try:\n" @@ -284,71 +572,165 @@ msgid "" "except FileNotFoundError:\n" " pass" msgstr "" +"try:\n" +" os.remove('somefile.tmp')\n" +"except FileNotFoundError:\n" +" pass\n" +"\n" +"try:\n" +" os.remove('someotherfile.tmp')\n" +"except FileNotFoundError:\n" +" pass" msgid "This context manager is :ref:`reentrant `." -msgstr "" +msgstr "این مدیر زمینه :ref:`بازورودپذیر ` است." -msgid "If the code within the :keyword:`!with` block raises a :exc:`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any exceptions of the group which are not suppressed are re-raised in a new group which is created using the original group's :meth:`~BaseExceptionGroup.derive` method." +msgid "" +"If the code within the :keyword:`!with` block raises " +"a :exc:`BaseExceptionGroup`, suppressed exceptions are removed from the " +"group. Any exceptions of the group which are not suppressed are re-raised " +"in a new group which is created using the original " +"group's :meth:`~BaseExceptionGroup.derive` method." msgstr "" +"اگر کد درون بلوک :keyword:`!with` یک :exc:`BaseExceptionGroup` را پرتاب کند، " +"استثناهای مهارشده از گروه حذف می‌شوند. هر یک از استثناهای گروه که مهارنشده " +"باشند، در گروه جدیدی که با استفاده از متد :meth:`~BaseExceptionGroup.derive` " +"گروه اصلی ایجاد شده است، دوباره پرتاب می‌شوند." -msgid "``suppress`` now supports suppressing exceptions raised as part of a :exc:`BaseExceptionGroup`." +msgid "" +"``suppress`` now supports suppressing exceptions raised as part of " +"a :exc:`BaseExceptionGroup`." msgstr "" +"``suppress`` اکنون از مهار استثناهایی که به‌عنوان بخشی از " +"یک :exc:`BaseExceptionGroup` پرتاب می‌شوند، پشتیبانی می‌کند." -msgid "Context manager for temporarily redirecting :data:`sys.stdout` to another file or file-like object." +msgid "" +"Context manager for temporarily redirecting :data:`sys.stdout` to another " +"file or file-like object." msgstr "" +"مدیر زمینه برای تغییر مسیر موقت :data:`sys.stdout` به یک فایل یا شیء " +"فایل‌مانند دیگر." -msgid "This tool adds flexibility to existing functions or classes whose output is hardwired to stdout." +msgid "" +"This tool adds flexibility to existing functions or classes whose output is " +"hardwired to stdout." msgstr "" +"این ابزار، انعطاف‌پذیری را به توابع یا کلاس‌های موجودی می‌افزاید که خروجی آن‌ها " +"به stdout متصل است." -msgid "For example, the output of :func:`help` normally is sent to *sys.stdout*. You can capture that output in a string by redirecting the output to an :class:`io.StringIO` object. The replacement stream is returned from the :meth:`~object.__enter__` method and so is available as the target of the :keyword:`with` statement::" +msgid "" +"For example, the output of :func:`help` normally is sent to *sys.stdout*. " +"You can capture that output in a string by redirecting the output to " +"an :class:`io.StringIO` object. The replacement stream is returned from " +"the :meth:`~object.__enter__` method and so is available as the target of " +"the :keyword:`with` statement::" msgstr "" +"برای مثال، خروجی :func:`help` به‌طور معمول به *sys.stdout* فرستاده می‌شود. شما " +"می‌توانید با هدایت خروجی به یک شیء :class:`io.StringIO`، آن خروجی را در یک " +"رشته ذخیره کنید. جریان جایگزین از متد :meth:`~object.__enter__` بازگردانده " +"می‌شود و بنابراین به‌عنوان هدف دستور :keyword:`with` در دسترس است::" msgid "" "with redirect_stdout(io.StringIO()) as f:\n" " help(pow)\n" "s = f.getvalue()" msgstr "" +"with redirect_stdout(io.StringIO()) as f:\n" +" help(pow)\n" +"s = f.getvalue()" -msgid "To send the output of :func:`help` to a file on disk, redirect the output to a regular file::" +msgid "" +"To send the output of :func:`help` to a file on disk, redirect the output to " +"a regular file::" msgstr "" +"برای ارسال خروجی :func:`help` به یک فایل روی دیسک، خروجی را به یک فایل " +"معمولی تغییر مسیر دهید::" msgid "" "with open('help.txt', 'w') as f:\n" " with redirect_stdout(f):\n" " help(pow)" msgstr "" +"with open('help.txt', 'w') as f:\n" +" with redirect_stdout(f):\n" +" help(pow)" msgid "To send the output of :func:`help` to *sys.stderr*::" -msgstr "" +msgstr "برای ارسال خروجی :func:`help` به *sys.stderr*::" msgid "" "with redirect_stdout(sys.stderr):\n" " help(pow)" msgstr "" +"with redirect_stdout(sys.stderr):\n" +" help(pow)" -msgid "Note that the global side effect on :data:`sys.stdout` means that this context manager is not suitable for use in library code and most threaded applications. It also has no effect on the output of subprocesses. However, it is still a useful approach for many utility scripts." +msgid "" +"Note that the global side effect on :data:`sys.stdout` means that this " +"context manager is not suitable for use in library code and most threaded " +"applications. It also has no effect on the output of subprocesses. However, " +"it is still a useful approach for many utility scripts." msgstr "" +"توجه داشته باشید که اثر جانبی سراسری بر :data:`sys.stdout` به این معناست که " +"این مدیر زمینه برای استفاده در کد کتابخانه‌ای و بیشتر برنامه‌های نخی مناسب " +"نیست. همچنین بر خروجی زیرفرایندها اثری ندارد. با این حال، هنوز هم رویکردی " +"مفید برای بسیاری از اسکریپت‌های کاربردی است." -msgid "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys.stderr` to another file or file-like object." +msgid "" +"Similar to :func:`~contextlib.redirect_stdout` but " +"redirecting :data:`sys.stderr` to another file or file-like object." msgstr "" +"مشابه :func:`~contextlib.redirect_stdout` است، اما :data:`sys.stderr` را به " +"فایل یا شیء شبه‌فایل دیگری تغییر مسیر می‌دهد." -msgid "Non parallel-safe context manager to change the current working directory. As this changes a global state, the working directory, it is not suitable for use in most threaded or async contexts. It is also not suitable for most non-linear code execution, like generators, where the program execution is temporarily relinquished -- unless explicitly desired, you should not yield when this context manager is active." -msgstr "" +msgid "" +"Non parallel-safe context manager to change the current working directory. " +"As this changes a global state, the working directory, it is not suitable " +"for use in most threaded or async contexts. It is also not suitable for most " +"non-linear code execution, like generators, where the program execution is " +"temporarily relinquished -- unless explicitly desired, you should not yield " +"when this context manager is active." +msgstr "" +"مدیر زمینه‌ای که از نظر موازی‌سازی ایمن نیست، برای تغییر پوشه کاری جاری است. " +"از آن‌جا که این کار یک وضعیت سراسری، یعنی پوشه کاری، را تغییر می‌دهد، برای " +"استفاده در بیشتر زمینه‌های نخی یا ناهمگام مناسب نیست. همچنین برای بیشتر " +"اجراهای غیرخطی کد، مانند تولیدگرها، مناسب نیست؛ جاهایی که اجرای برنامه به‌طور " +"موقت واگذار می‌شود -- مگر این‌که صریحاً مورد نظر باشد، نباید هنگامی که این مدیر " +"زمینه فعال است، yield کنید." -msgid "This is a simple wrapper around :func:`~os.chdir`, it changes the current working directory upon entering and restores the old one on exit." +msgid "" +"This is a simple wrapper around :func:`~os.chdir`, it changes the current " +"working directory upon entering and restores the old one on exit." msgstr "" +"این پوششی ساده بر روی :func:`~os.chdir` است که هنگام ورود، پوشه کاری جاری را " +"تغییر می‌دهد و هنگام خروج، پوشه پیشین را بازمی‌گرداند." -msgid "A base class that enables a context manager to also be used as a decorator." +msgid "" +"A base class that enables a context manager to also be used as a decorator." msgstr "" +"کلاس پایه‌ای که به یک مدیریت‌کننده زمینه امکان می‌دهد تا به‌عنوان یک دکوراتور " +"نیز استفاده شود." -msgid "Context managers inheriting from ``ContextDecorator`` have to implement :meth:`~object.__enter__` and :meth:`~object.__exit__` as normal. ``__exit__`` retains its optional exception handling even when used as a decorator." +msgid "" +"Context managers inheriting from ``ContextDecorator`` have to " +"implement :meth:`~object.__enter__` and :meth:`~object.__exit__` as normal. " +"``__exit__`` retains its optional exception handling even when used as a " +"decorator." msgstr "" +"مدیران زمینه‌ای که از ``ContextDecorator`` ارث‌بری می‌کنند " +"باید :meth:`~object.__enter__` و :meth:`~object.__exit__` را به‌صورت عادی " +"پیاده‌سازی کنند. ``__exit__`` مدیریت اختیاری استثنا را حتی هنگام استفاده " +"به‌عنوان دکوراتور حفظ می‌کند." -msgid "``ContextDecorator`` is used by :deco:`contextmanager`, so you get this functionality automatically." +msgid "" +"``ContextDecorator`` is used by :deco:`contextmanager`, so you get this " +"functionality automatically." msgstr "" +":deco:`contextmanager` از ``ContextDecorator`` استفاده می‌کند، بنابراین این " +"قابلیت به‌صورت خودکار در دسترس شما قرار می‌گیرد." msgid "Example of ``ContextDecorator``::" -msgstr "" +msgstr "مثالی از ``ContextDecorator``::" msgid "" "from contextlib import ContextDecorator\n" @@ -362,9 +744,19 @@ msgid "" " print('Finishing')\n" " return False" msgstr "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextDecorator):\n" +" def __enter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" print('Finishing')\n" +" return False" msgid "The class can then be used like this::" -msgstr "" +msgstr "سپس می‌توان از کلاس به این صورت استفاده کرد::" msgid "" ">>> @mycontext()\n" @@ -383,30 +775,60 @@ msgid "" "The bit in the middle\n" "Finishing" msgstr "" +">>> @mycontext()\n" +"... def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> function()\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" -msgid "This change is just syntactic sugar for any construct of the following form::" -msgstr "" +msgid "" +"This change is just syntactic sugar for any construct of the following form::" +msgstr "این تغییر صرفاً قند نحوی برای هر ساختاری با شکل زیر است::" msgid "" "def f():\n" " with cm():\n" " # Do stuff" msgstr "" +"def f():\n" +" with cm():\n" +" # Do stuff" msgid "``ContextDecorator`` lets you instead write::" -msgstr "" +msgstr "``ContextDecorator`` به شما اجازه می‌دهد در عوض بنویسید::" msgid "" "@cm()\n" "def f():\n" " # Do stuff" msgstr "" +"@cm()\n" +"def f():\n" +" # Do stuff" -msgid "It makes it clear that the ``cm`` applies to the whole function, rather than just a piece of it (and saving an indentation level is nice, too)." +msgid "" +"It makes it clear that the ``cm`` applies to the whole function, rather than " +"just a piece of it (and saving an indentation level is nice, too)." msgstr "" +"این امر روشن می‌کند که ``cm`` به کل تابع اعمال می‌شود، نه فقط به بخشی از آن (و " +"یک سطح تورفتگی کمتر نیز خوب است)." -msgid "Existing context managers that already have a base class can be extended by using ``ContextDecorator`` as a mixin class::" +msgid "" +"Existing context managers that already have a base class can be extended by " +"using ``ContextDecorator`` as a mixin class::" msgstr "" +"مدیران زمینه موجودی که از قبل یک کلاس پایه دارند، می‌توانند با استفاده از " +"``ContextDecorator`` به‌عنوان کلاس میکس‌این گسترش یابند::" msgid "" "from contextlib import ContextDecorator\n" @@ -418,15 +840,32 @@ msgid "" " def __exit__(self, *exc):\n" " return False" msgstr "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextBaseClass, ContextDecorator):\n" +" def __enter__(self):\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" return False" -msgid "As the decorated function must be able to be called multiple times, the underlying context manager must support use in multiple :keyword:`with` statements. If this is not the case, then the original construct with the explicit :keyword:`!with` statement inside the function should be used." +msgid "" +"As the decorated function must be able to be called multiple times, the " +"underlying context manager must support use in multiple :keyword:`with` " +"statements. If this is not the case, then the original construct with the " +"explicit :keyword:`!with` statement inside the function should be used." msgstr "" +"از آنجا که تابع دکورات‌شده باید بتواند چندین بار فراخوانی شود، مدیر زمینه " +"زیربنایی باید از استفاده در چندین دستور :keyword:`with` پشتیبانی کند. در غیر " +"این صورت، باید از ساختار اصلی با دستور صریح :keyword:`!with` درون تابع " +"استفاده شود." -msgid "Similar to :class:`ContextDecorator` but only for asynchronous functions." -msgstr "" +msgid "" +"Similar to :class:`ContextDecorator` but only for asynchronous functions." +msgstr "مشابه :class:`ContextDecorator` اما فقط برای توابع ناهمگام." msgid "Example of ``AsyncContextDecorator``::" -msgstr "" +msgstr "مثالی از ``AsyncContextDecorator``::" msgid "" "from asyncio import run\n" @@ -441,6 +880,17 @@ msgid "" " print('Finishing')\n" " return False" msgstr "" +"from asyncio import run\n" +"from contextlib import AsyncContextDecorator\n" +"\n" +"class mycontext(AsyncContextDecorator):\n" +" async def __aenter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" async def __aexit__(self, *exc):\n" +" print('Finishing')\n" +" return False" msgid "" ">>> @mycontext()\n" @@ -461,12 +911,39 @@ msgid "" "The bit in the middle\n" "Finishing" msgstr "" +">>> @mycontext()\n" +"... async def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> async def function():\n" +"... async with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" -msgid "A context manager that is designed to make it easy to programmatically combine other context managers and cleanup functions, especially those that are optional or otherwise driven by input data." +msgid "" +"A context manager that is designed to make it easy to programmatically " +"combine other context managers and cleanup functions, especially those that " +"are optional or otherwise driven by input data." msgstr "" +"یک مدیر زمینه که طراحی شده است تا ترکیب سایر مدیرهای زمینه و توابع پاک‌سازی " +"را به‌صورت برنامه‌ای آسان کند، به‌ویژه آن‌هایی که اختیاری هستند یا به‌نحوی دیگر " +"توسط داده‌های ورودی هدایت می‌شوند." -msgid "For example, a set of files may easily be handled in a single with statement as follows::" +msgid "" +"For example, a set of files may easily be handled in a single with statement " +"as follows::" msgstr "" +"برای مثال، مجموعه‌ای از فایل‌ها را می‌توان به‌راحتی در یک دستور with واحد به‌صورت " +"زیر مدیریت کرد::" msgid "" "with ExitStack() as stack:\n" @@ -474,61 +951,163 @@ msgid "" " # All opened files will automatically be closed at the end of\n" " # the with statement, even if attempts to open files later\n" " # in the list raise an exception" -msgstr "" +msgstr "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # All opened files will automatically be closed at the end of\n" +" # the with statement, even if attempts to open files later\n" +" # in the list raise an exception" -msgid "The :meth:`~object.__enter__` method returns the :class:`ExitStack` instance, and performs no additional operations." +msgid "" +"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " +"instance, and performs no additional operations." msgstr "" +"متد :meth:`~object.__enter__` نمونه :class:`ExitStack` را برمی‌گرداند و هیچ " +"عملیات اضافی انجام نمی‌دهد." -msgid "Each instance maintains a stack of registered callbacks that are called in reverse order when the instance is closed (either explicitly or implicitly at the end of a :keyword:`with` statement). Note that callbacks are *not* invoked implicitly when the context stack instance is garbage collected." +msgid "" +"Each instance maintains a stack of registered callbacks that are called in " +"reverse order when the instance is closed (either explicitly or implicitly " +"at the end of a :keyword:`with` statement). Note that callbacks are *not* " +"invoked implicitly when the context stack instance is garbage collected." msgstr "" +"هر نمونه پشته‌ای از کال‌بک‌های ثبت‌شده را نگه‌داری می‌کند که هنگام بسته شدن نمونه، " +"با ترتیب معکوس فراخوانی می‌شوند (چه به‌صورت صریح و چه به‌صورت ضمنی در پایان یک " +"دستور :keyword:`with`). توجه داشته باشید که هنگام زباله‌روبی نمونه‌ی پشته‌ی " +"زمینه، کال‌بک‌ها به‌صورت ضمنی *فراخوانی نمی‌شوند*." -msgid "This stack model is used so that context managers that acquire their resources in their ``__init__`` method (such as file objects) can be handled correctly." +msgid "" +"This stack model is used so that context managers that acquire their " +"resources in their ``__init__`` method (such as file objects) can be handled " +"correctly." msgstr "" +"از این مدل پشته استفاده می‌شود تا مدیران زمینه‌ای که منابع خود را در متد " +"``__init__`` خود کسب می‌کنند (مانند اشیای فایل) بتوانند به‌درستی مدیریت شوند." -msgid "Since registered callbacks are invoked in the reverse order of registration, this ends up behaving as if multiple nested :keyword:`with` statements had been used with the registered set of callbacks. This even extends to exception handling - if an inner callback suppresses or replaces an exception, then outer callbacks will be passed arguments based on that updated state." -msgstr "" +msgid "" +"Since registered callbacks are invoked in the reverse order of registration, " +"this ends up behaving as if multiple nested :keyword:`with` statements had " +"been used with the registered set of callbacks. This even extends to " +"exception handling - if an inner callback suppresses or replaces an " +"exception, then outer callbacks will be passed arguments based on that " +"updated state." +msgstr "" +"از آنجا که کال‌بک‌های ثبت‌شده به ترتیب معکوس ثبت فراخوانی می‌شوند، این موضوع در " +"نهایت رفتاری مانند آن دارد که گویی چندین دستور تودرتوی :keyword:`with` با " +"مجموعه‌ی کال‌بک‌های ثبت‌شده استفاده شده باشد. این موضوع حتی به مدیریت استثنا نیز " +"گسترش می‌یابد؛ اگر یک کال‌بک داخلی استثنایی را سرکوب یا جایگزین کند، کال‌بک‌های " +"بیرونی آرگومان‌هایی بر اساس آن وضعیت به‌روزشده دریافت خواهند کرد." -msgid "This is a relatively low level API that takes care of the details of correctly unwinding the stack of exit callbacks. It provides a suitable foundation for higher level context managers that manipulate the exit stack in application specific ways." +msgid "" +"This is a relatively low level API that takes care of the details of " +"correctly unwinding the stack of exit callbacks. It provides a suitable " +"foundation for higher level context managers that manipulate the exit stack " +"in application specific ways." msgstr "" +"این یک API نسبتاً سطح پایین است که جزئیات باز کردن صحیح پشته‌ی کال‌بک‌های خروج " +"را مدیریت می‌کند. این API پایه‌ای مناسب برای مدیرهای زمینه سطح بالاتر فراهم " +"می‌کند که پشته‌ی خروج را به روش‌های مختص برنامه دستکاری می‌کنند." -msgid "Enters a new context manager and adds its :meth:`~object.__exit__` method to the callback stack. The return value is the result of the context manager's own :meth:`~object.__enter__` method." +msgid "" +"Enters a new context manager and adds its :meth:`~object.__exit__` method to " +"the callback stack. The return value is the result of the context manager's " +"own :meth:`~object.__enter__` method." msgstr "" +"وارد یک مدیر زمینه جدید می‌شود و متد :meth:`~object.__exit__` آن را به پشته‌ی " +"کال‌بک اضافه می‌کند. مقدار بازگشتی، نتیجه‌ی متد :meth:`~object.__enter__` خود " +"مدیر زمینه است." -msgid "These context managers may suppress exceptions just as they normally would if used directly as part of a :keyword:`with` statement." +msgid "" +"These context managers may suppress exceptions just as they normally would " +"if used directly as part of a :keyword:`with` statement." msgstr "" +"این مدیران زمینه ممکن است استثناها را مهار کنند، دقیقاً همان‌طور که معمولاً در " +"صورت استفاده‌ی مستقیم به‌عنوان بخشی از دستور :keyword:`with` این کار را می‌کنند." -msgid "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a context manager." +msgid "" +"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " +"context manager." msgstr "" +"اگر *cm* یک مدیر زمینه نباشد، به‌جای :exc:`AttributeError " +"`، :exc:`TypeError ` پرتاب می‌شود." -msgid "Adds a context manager's :meth:`~object.__exit__` method to the callback stack." +msgid "" +"Adds a context manager's :meth:`~object.__exit__` method to the callback " +"stack." msgstr "" +"متد :meth:`~object.__exit__`\\ مدیر زمینه را به پشته‌ی کال‌بک اضافه می‌کند." -msgid "As ``__enter__`` is *not* invoked, this method can be used to cover part of an :meth:`~object.__enter__` implementation with a context manager's own :meth:`~object.__exit__` method." +msgid "" +"As ``__enter__`` is *not* invoked, this method can be used to cover part of " +"an :meth:`~object.__enter__` implementation with a context manager's " +"own :meth:`~object.__exit__` method." msgstr "" +"از آنجا که ``__enter__`` فراخوانی *نمی‌شود*، می‌توان از این متد برای پوشش دادن " +"بخشی از پیاده‌سازی :meth:`~object.__enter__` با متد :meth:`~object.__exit__` " +"خودِ مدیر زمینه استفاده کرد." -msgid "If passed an object that is not a context manager, this method assumes it is a callback with the same signature as a context manager's :meth:`~object.__exit__` method and adds it directly to the callback stack." +msgid "" +"If passed an object that is not a context manager, this method assumes it is " +"a callback with the same signature as a context " +"manager's :meth:`~object.__exit__` method and adds it directly to the " +"callback stack." msgstr "" +"اگر شیءای که مدیریتگر زمینه نیست به این متد داده شود، این متد فرض می‌کند که آن " +"شیء یک کال‌بک با همان امضای متد :meth:`~object.__exit__` مدیریتگر زمینه است و " +"آن را مستقیماً به پشته کال‌بک اضافه می‌کند." -msgid "By returning true values, these callbacks can suppress exceptions the same way context manager :meth:`~object.__exit__` methods can." +msgid "" +"By returning true values, these callbacks can suppress exceptions the same " +"way context manager :meth:`~object.__exit__` methods can." msgstr "" +"این کال‌بک‌ها می‌توانند با برگرداندن مقادیر درست، استثناها را دقیقاً مانند " +"متدهای :meth:`~object.__exit__` مدیر زمینه مهار کنند." -msgid "The passed in object is returned from the function, allowing this method to be used as a function decorator." +msgid "" +"The passed in object is returned from the function, allowing this method to " +"be used as a function decorator." msgstr "" +"شیء داده‌شده از تابع بازگردانده می‌شود و امکان استفاده از این متد به‌عنوان " +"دکوراتور تابع را فراهم می‌کند." -msgid "Accepts an arbitrary callback function and arguments and adds it to the callback stack." +msgid "" +"Accepts an arbitrary callback function and arguments and adds it to the " +"callback stack." msgstr "" +"یک تابع کال‌بک دلخواه و آرگومان‌ها را می‌پذیرد و آن را به پشته کال‌بک اضافه " +"می‌کند." -msgid "Unlike the other methods, callbacks added this way cannot suppress exceptions (as they are never passed the exception details)." +msgid "" +"Unlike the other methods, callbacks added this way cannot suppress " +"exceptions (as they are never passed the exception details)." msgstr "" +"برخلاف متدهای دیگر، کال‌بک‌هایی که به این روش افزوده می‌شوند نمی‌توانند استثناها " +"را مهار کنند (زیرا جزئیات استثنا هرگز به آن‌ها ارسال نمی‌شود)." -msgid "The passed in callback is returned from the function, allowing this method to be used as a function decorator." +msgid "" +"The passed in callback is returned from the function, allowing this method " +"to be used as a function decorator." msgstr "" +"کال‌بک ورودی از تابع بازگردانده می‌شود و به این متد اجازه می‌دهد به‌عنوان " +"دکوراتور تابع استفاده شود." -msgid "Transfers the callback stack to a fresh :class:`ExitStack` instance and returns it. No callbacks are invoked by this operation - instead, they will now be invoked when the new stack is closed (either explicitly or implicitly at the end of a :keyword:`with` statement)." +msgid "" +"Transfers the callback stack to a fresh :class:`ExitStack` instance and " +"returns it. No callbacks are invoked by this operation - instead, they will " +"now be invoked when the new stack is closed (either explicitly or implicitly " +"at the end of a :keyword:`with` statement)." msgstr "" +"پشته‌ی کال‌بک‌ها را به یک نمونه‌ی تازه‌ی :class:`ExitStack` منتقل می‌کند و آن را " +"برمی‌گرداند. هیچ کال‌بکی با این عملیات فراخوانی نمی‌شود — در عوض، از این پس " +"آن‌ها زمانی فراخوانی خواهند شد که پشته‌ی جدید بسته شود (چه به‌صورت صریح و چه " +"به‌صورت ضمنی در پایان یک دستور :keyword:`with`)." -msgid "For example, a group of files can be opened as an \"all or nothing\" operation as follows::" +msgid "" +"For example, a group of files can be opened as an \"all or nothing\" " +"operation as follows::" msgstr "" +"برای مثال، می‌توان گروهی از فایل‌ها را به‌عنوان یک عملیات «همه یا هیچ» به‌صورت " +"زیر باز کرد::" msgid "" "with ExitStack() as stack:\n" @@ -540,33 +1119,72 @@ msgid "" " # they will remain open even after the with statement ends.\n" " # close_files() can then be invoked explicitly to close them all." msgstr "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # متد close را نگه دارید، اما هنوز آن را فراخوانی نکنید.\n" +" close_files = stack.pop_all().close\n" +" # اگر باز کردن حتی یک فایل ناموفق باشد، تمام فایل‌هایی که پیش‌تر باز " +"شده‌اند\n" +" # به‌طور خودکار بسته خواهند شد. اگر همه فایل‌ها با موفقیت باز شوند،\n" +" # حتی پس از پایان دستور with نیز باز خواهند ماند.\n" +" # سپس می‌توان close_files() را به‌صراحت برای بستن همه آن‌ها فراخوانی کرد." -msgid "Immediately unwinds the callback stack, invoking callbacks in the reverse order of registration. For any context managers and exit callbacks registered, the arguments passed in will indicate that no exception occurred." +msgid "" +"Immediately unwinds the callback stack, invoking callbacks in the reverse " +"order of registration. For any context managers and exit callbacks " +"registered, the arguments passed in will indicate that no exception occurred." msgstr "" +"بلافاصله پشته‌ی کال‌بک را باز می‌کند و کال‌بک‌ها را به ترتیب معکوس ثبت فراخوانی " +"می‌کند. به ازای هر مدیر زمینه و کال‌بک خروج ثبت‌شده، آرگومان‌های ارسال‌شده نشان " +"می‌دهند که هیچ استثنایی رخ نداده است." -msgid "An :ref:`asynchronous context manager `, similar to :class:`ExitStack`, that supports combining both synchronous and asynchronous context managers, as well as having coroutines for cleanup logic." +msgid "" +"An :ref:`asynchronous context manager `, similar " +"to :class:`ExitStack`, that supports combining both synchronous and " +"asynchronous context managers, as well as having coroutines for cleanup " +"logic." msgstr "" +"یک :ref:`مدیر زمینه ناهمگام `، " +"مشابه :class:`ExitStack`، که از ترکیب مدیرهای زمینه همگام و ناهمگام، و " +"همچنین از داشتن هم‌روال‌هایی برای منطق پاک‌سازی پشتیبانی می‌کند." -msgid "The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must be used instead." +msgid "" +"The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " +"be used instead." msgstr "" +"متد :meth:`~ExitStack.close` پیاده‌سازی نشده است؛ باید به‌جای آن " +"از :meth:`aclose` استفاده شود." -msgid "Similar to :meth:`ExitStack.enter_context` but expects an asynchronous context manager." +msgid "" +"Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " +"context manager." msgstr "" +"مشابه :meth:`ExitStack.enter_context` است، اما انتظار یک مدیر زمینه ناهمگام " +"را دارد." -msgid "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an asynchronous context manager." +msgid "" +"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " +"asynchronous context manager." msgstr "" +"اگر *cm* یک مدیر زمینه‌ی ناهمگام نباشد، به‌جای :exc:`AttributeError " +"`، :exc:`TypeError ` را پرتاب می‌کند." -msgid "Similar to :meth:`ExitStack.push` but expects either an asynchronous context manager or a coroutine function." +msgid "" +"Similar to :meth:`ExitStack.push` but expects either an asynchronous context " +"manager or a coroutine function." msgstr "" +"مشابه :meth:`ExitStack.push` است، اما انتظار دارد که یا یک مدیر زمینه " +"ناهمگام باشد یا یک تابع هم‌روال." msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." -msgstr "" +msgstr "مشابه :meth:`ExitStack.callback` است، اما یک تابع هم‌روال انتظار می‌رود." msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" +"مشابه :meth:`ExitStack.close` است، اما awaitableها را به‌درستی مدیریت می‌کند." msgid "Continuing the example for :deco:`asynccontextmanager`::" -msgstr "" +msgstr "در ادامه‌ی مثال برای :deco:`asynccontextmanager`::" msgid "" "async with AsyncExitStack() as stack:\n" @@ -576,18 +1194,40 @@ msgid "" " # the async with statement, even if attempts to open a connection\n" " # later in the list raise an exception." msgstr "" +"async with AsyncExitStack() as stack:\n" +" connections = [await stack.enter_async_context(get_connection())\n" +" for i in range(5)]\n" +" # All opened connections will automatically be released at the end of\n" +" # the async with statement, even if attempts to open a connection\n" +" # later in the list raise an exception." msgid "Examples and Recipes" -msgstr "" +msgstr "مثال‌ها و دستور پخت‌ها" -msgid "This section describes some examples and recipes for making effective use of the tools provided by :mod:`!contextlib`." +msgid "" +"This section describes some examples and recipes for making effective use of " +"the tools provided by :mod:`!contextlib`." msgstr "" +"این بخش چند مثال و راهکار را برای استفاده‌ی مؤثر از ابزارهای فراهم‌شده " +"توسط :mod:`!contextlib` شرح می‌دهد." msgid "Supporting a variable number of context managers" -msgstr "" +msgstr "پشتیبانی از تعداد متغیری از مدیران زمینه" -msgid "The primary use case for :class:`ExitStack` is the one given in the class documentation: supporting a variable number of context managers and other cleanup operations in a single :keyword:`with` statement. The variability may come from the number of context managers needed being driven by user input (such as opening a user specified collection of files), or from some of the context managers being optional::" -msgstr "" +msgid "" +"The primary use case for :class:`ExitStack` is the one given in the class " +"documentation: supporting a variable number of context managers and other " +"cleanup operations in a single :keyword:`with` statement. The variability " +"may come from the number of context managers needed being driven by user " +"input (such as opening a user specified collection of files), or from some " +"of the context managers being optional::" +msgstr "" +"کاربرد اصلی :class:`ExitStack` همان موردی است که در مستندات کلاس آمده است: " +"پشتیبانی از تعداد متغیری از مدیرهای زمینه و سایر عملیات پاک‌سازی در یک " +"دستور :keyword:`with`. این تغییرپذیری ممکن است ناشی از تعداد مدیرهای زمینه " +"مورد نیاز باشد که توسط ورودی کاربر تعیین می‌شود (مانند باز کردن مجموعه‌ای از " +"فایل‌های مشخص‌شده توسط کاربر)، یا ناشی از اختیاری بودن برخی از مدیرهای زمینه " +"باشد::" msgid "" "with ExitStack() as stack:\n" @@ -598,15 +1238,39 @@ msgid "" " stack.callback(release_special_resource, special)\n" " # Perform operations that use the acquired resources" msgstr "" +"with ExitStack() as stack:\n" +" for resource in resources:\n" +" stack.enter_context(resource)\n" +" if need_special_resource():\n" +" special = acquire_special_resource()\n" +" stack.callback(release_special_resource, special)\n" +" # عملیاتی را انجام دهید که از منابع کسب‌شده استفاده می‌کنند" -msgid "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` statements to manage arbitrary resources that don't natively support the context management protocol." +msgid "" +"As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " +"statements to manage arbitrary resources that don't natively support the " +"context management protocol." msgstr "" +"همان‌طور که نشان داده شد، :class:`ExitStack` همچنین استفاده از " +"دستورهای :keyword:`with` را برای مدیریت منابع دلخواهی که به‌صورت ذاتی از " +"پروتکل مدیریت زمینه پشتیبانی نمی‌کنند، بسیار آسان می‌سازد." msgid "Catching exceptions from ``__enter__`` methods" -msgstr "" +msgstr "گرفتن استثناها از متدهای ``__enter__``" -msgid "It is occasionally desirable to catch exceptions from an :meth:`~object.__enter__` method implementation, *without* inadvertently catching exceptions from the :keyword:`with` statement body or the context manager's :meth:`~object.__exit__` method. By using :class:`ExitStack` the steps in the context management protocol can be separated slightly in order to allow this::" -msgstr "" +msgid "" +"It is occasionally desirable to catch exceptions from " +"an :meth:`~object.__enter__` method implementation, *without* inadvertently " +"catching exceptions from the :keyword:`with` statement body or the context " +"manager's :meth:`~object.__exit__` method. By using :class:`ExitStack` the " +"steps in the context management protocol can be separated slightly in order " +"to allow this::" +msgstr "" +"گاهی اوقات مطلوب است استثناهای پیاده‌سازی متد :meth:`~object.__enter__` گرفته " +"شوند، *بدون* آنکه به‌طور ناخواسته استثناهای بدنه‌ی دستور :keyword:`with` یا " +"متد :meth:`~object.__exit__` مدیر زمینه گرفته شوند. با استفاده " +"از :class:`ExitStack` می‌توان مراحل پروتکل مدیریت زمینه را کمی از هم جدا کرد " +"تا این امکان فراهم شود::" msgid "" "stack = ExitStack()\n" @@ -618,25 +1282,60 @@ msgid "" " with stack:\n" " # Handle normal case" msgstr "" +"stack = ExitStack()\n" +"try:\n" +" x = stack.enter_context(cm)\n" +"except Exception:\n" +" # handle __enter__ exception\n" +"else:\n" +" with stack:\n" +" # Handle normal case" -msgid "Actually needing to do this is likely to indicate that the underlying API should be providing a direct resource management interface for use with :keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not all APIs are well designed in that regard. When a context manager is the only resource management API provided, then :class:`ExitStack` can make it easier to handle various situations that can't be handled directly in a :keyword:`with` statement." -msgstr "" +msgid "" +"Actually needing to do this is likely to indicate that the underlying API " +"should be providing a direct resource management interface for use " +"with :keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not " +"all APIs are well designed in that regard. When a context manager is the " +"only resource management API provided, then :class:`ExitStack` can make it " +"easier to handle various situations that can't be handled directly in " +"a :keyword:`with` statement." +msgstr "" +"نیاز واقعی به انجام این کار احتمالاً نشان می‌دهد که API زیربنایی باید یک رابط " +"مستقیم مدیریت منابع برای استفاده در " +"دستورهای :keyword:`try`/:keyword:`except`/:keyword:`finally` فراهم کند، اما " +"همه‌ی APIها از این نظر به‌خوبی طراحی نشده‌اند. هنگامی که یک مدیر زمینه تنها API " +"ارائه‌شده برای مدیریت منابع باشد، :class:`ExitStack` می‌تواند مدیریت موقعیت‌های " +"مختلفی را که نمی‌توان آن‌ها را مستقیماً در یک دستور :keyword:`with` مدیریت کرد، " +"آسان‌تر کند." msgid "Cleaning up in an ``__enter__`` implementation" -msgstr "" +msgstr "پاک‌سازی در پیاده‌سازی ``__enter__``" -msgid "As noted in the documentation of :meth:`ExitStack.push`, this method can be useful in cleaning up an already allocated resource if later steps in the :meth:`~object.__enter__` implementation fail." +msgid "" +"As noted in the documentation of :meth:`ExitStack.push`, this method can be " +"useful in cleaning up an already allocated resource if later steps in " +"the :meth:`~object.__enter__` implementation fail." msgstr "" +"همان‌طور که در مستندات :meth:`ExitStack.push` ذکر شده است، این متد می‌تواند در " +"پاک‌سازی منبعی که از پیش تخصیص داده‌شده است مفید باشد، اگر مراحل بعدی در " +"پیاده‌سازی :meth:`~object.__enter__` با شکست مواجه شوند." -msgid "Here's an example of doing this for a context manager that accepts resource acquisition and release functions, along with an optional validation function, and maps them to the context management protocol::" +msgid "" +"Here's an example of doing this for a context manager that accepts resource " +"acquisition and release functions, along with an optional validation " +"function, and maps them to the context management protocol::" msgstr "" +"در اینجا مثالی از انجام این کار برای یک مدیر زمینه آورده شده است که توابع " +"تهیه و آزادسازی منبع را به‌همراه یک تابع اعتبارسنجی اختیاری می‌پذیرد و آن‌ها را " +"به پروتکل مدیریت زمینه نگاشت می‌کند::" msgid "" "from contextlib import contextmanager, AbstractContextManager, ExitStack\n" "\n" "class ResourceManager(AbstractContextManager):\n" "\n" -" def __init__(self, acquire_resource, release_resource, check_resource_ok=None):\n" +" def __init__(self, acquire_resource, release_resource, " +"check_resource_ok=None):\n" " self.acquire_resource = acquire_resource\n" " self.release_resource = release_resource\n" " if check_resource_ok is None:\n" @@ -666,12 +1365,54 @@ msgid "" " # We don't need to duplicate any of our resource release logic\n" " self.release_resource()" msgstr "" +"from contextlib import contextmanager, AbstractContextManager, ExitStack\n" +"\n" +"class ResourceManager(AbstractContextManager):\n" +"\n" +" def __init__(self, acquire_resource, release_resource, " +"check_resource_ok=None):\n" +" self.acquire_resource = acquire_resource\n" +" self.release_resource = release_resource\n" +" if check_resource_ok is None:\n" +" def check_resource_ok(resource):\n" +" return True\n" +" self.check_resource_ok = check_resource_ok\n" +"\n" +" @contextmanager\n" +" def _cleanup_on_error(self):\n" +" with ExitStack() as stack:\n" +" stack.push(self)\n" +" yield\n" +" # بررسی اعتبارسنجی موفق بود و استثنایی پرتاب نکرد\n" +" # بنابراین می‌خواهیم منبع را نگه داریم و آن را\n" +" # به فراخواننده خود بازگردانیم\n" +" stack.pop_all()\n" +"\n" +" def __enter__(self):\n" +" resource = self.acquire_resource()\n" +" with self._cleanup_on_error():\n" +" if not self.check_resource_ok(resource):\n" +" msg = \"Failed validation for {!r}\"\n" +" raise RuntimeError(msg.format(resource))\n" +" return resource\n" +"\n" +" def __exit__(self, *exc_details):\n" +" # نیازی به تکرار هیچ‌بخشی از منطق آزادسازی منبع خود نیست\n" +" self.release_resource()" msgid "Replacing any use of ``try-finally`` and flag variables" -msgstr "" +msgstr "جایگزینی هرگونه استفاده از ``try-finally`` و متغیرهای پرچمی" -msgid "A pattern you will sometimes see is a ``try-finally`` statement with a flag variable to indicate whether or not the body of the ``finally`` clause should be executed. In its simplest form (that can't already be handled just by using an ``except`` clause instead), it looks something like this::" +msgid "" +"A pattern you will sometimes see is a ``try-finally`` statement with a flag " +"variable to indicate whether or not the body of the ``finally`` clause " +"should be executed. In its simplest form (that can't already be handled just " +"by using an ``except`` clause instead), it looks something like this::" msgstr "" +"الگویی که گاهی خواهید دید، یک دستور ``try-finally`` همراه با یک متغیر پرچم " +"است که نشان می‌دهد آیا بدنه‌ی بند ``finally`` باید اجرا شود یا خیر. در ساده‌ترین " +"شکل خود (که از قبل نتوان آن را صرفاً با استفاده از یک بند ``except`` مدیریت " +"کرد)، چیزی شبیه به این است::" msgid "" "cleanup_needed = True\n" @@ -683,12 +1424,32 @@ msgid "" " if cleanup_needed:\n" " cleanup_resources()" msgstr "" +"cleanup_needed = True\n" +"try:\n" +" result = perform_operation()\n" +" if result:\n" +" cleanup_needed = False\n" +"finally:\n" +" if cleanup_needed:\n" +" cleanup_resources()" -msgid "As with any ``try`` statement based code, this can cause problems for development and review, because the setup code and the cleanup code can end up being separated by arbitrarily long sections of code." +msgid "" +"As with any ``try`` statement based code, this can cause problems for " +"development and review, because the setup code and the cleanup code can end " +"up being separated by arbitrarily long sections of code." msgstr "" +"مانند هر کد مبتنی بر دستور ``try``، این موضوع می‌تواند برای توسعه و بازبینی " +"مشکل‌ساز شود، زیرا ممکن است در نهایت کد راه‌اندازی و کد پاک‌سازی توسط بخش‌هایی " +"از کد با طول دلخواه از هم جدا شوند." -msgid ":class:`ExitStack` makes it possible to instead register a callback for execution at the end of a ``with`` statement, and then later decide to skip executing that callback::" +msgid "" +":class:`ExitStack` makes it possible to instead register a callback for " +"execution at the end of a ``with`` statement, and then later decide to skip " +"executing that callback::" msgstr "" +":class:`ExitStack` این امکان را فراهم می‌کند که در عوض، یک کال‌بک را برای اجرا " +"در پایان یک دستور ``with`` ثبت کنید و سپس بعداً تصمیم بگیرید که از اجرای آن " +"کال‌بک صرف‌نظر کنید::" msgid "" "from contextlib import ExitStack\n" @@ -699,12 +1460,27 @@ msgid "" " if result:\n" " stack.pop_all()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" stack.callback(cleanup_resources)\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" -msgid "This allows the intended cleanup behaviour to be made explicit up front, rather than requiring a separate flag variable." +msgid "" +"This allows the intended cleanup behaviour to be made explicit up front, " +"rather than requiring a separate flag variable." msgstr "" +"این امکان را فراهم می‌کند که رفتار پاک‌سازی موردنظر از همان ابتدا به‌صورت صریح " +"مشخص شود، به جای اینکه به یک متغیر پرچم جداگانه نیاز باشد." -msgid "If a particular application uses this pattern a lot, it can be simplified even further by means of a small helper class::" +msgid "" +"If a particular application uses this pattern a lot, it can be simplified " +"even further by means of a small helper class::" msgstr "" +"اگر یک برنامه خاص زیاد از این الگو استفاده کند، می‌توان آن را با استفاده از " +"یک کلاس کمکی کوچک حتی بیشتر ساده‌تر کرد::" msgid "" "from contextlib import ExitStack\n" @@ -722,9 +1498,29 @@ msgid "" " if result:\n" " cb.cancel()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"class Callback(ExitStack):\n" +" def __init__(self, callback, /, *args, **kwds):\n" +" super().__init__()\n" +" self.callback(callback, *args, **kwds)\n" +"\n" +" def cancel(self):\n" +" self.pop_all()\n" +"\n" +"with Callback(cleanup_resources) as cb:\n" +" result = perform_operation()\n" +" if result:\n" +" cb.cancel()" -msgid "If the resource cleanup isn't already neatly bundled into a standalone function, then it is still possible to use the decorator form of :meth:`ExitStack.callback` to declare the resource cleanup in advance::" +msgid "" +"If the resource cleanup isn't already neatly bundled into a standalone " +"function, then it is still possible to use the decorator form " +"of :meth:`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" +"اگر پاک‌سازی منابع از قبل به‌خوبی در یک تابع مستقل گنجانده نشده باشد، همچنان " +"می‌توان از قالب دکوراتوری :meth:`ExitStack.callback` برای اعلام پاک‌سازی منابع " +"از پیش استفاده کرد::" msgid "" "from contextlib import ExitStack\n" @@ -737,18 +1533,46 @@ msgid "" " if result:\n" " stack.pop_all()" msgstr "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" @stack.callback\n" +" def cleanup_resources():\n" +" ...\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" -msgid "Due to the way the decorator protocol works, a callback function declared this way cannot take any parameters. Instead, any resources to be released must be accessed as closure variables." +msgid "" +"Due to the way the decorator protocol works, a callback function declared " +"this way cannot take any parameters. Instead, any resources to be released " +"must be accessed as closure variables." msgstr "" +"به دلیل نحوه‌ی کار پروتکل دکوراتور، یک تابع کال‌بک که به این روش تعریف شود، " +"نمی‌تواند هیچ پارامتری بگیرد. در عوض، هر منبعی که باید آزاد شود، باید به‌صورت " +"متغیرهای بستار (closure variables) در دسترس باشد." msgid "Using a context manager as a function decorator" -msgstr "" +msgstr "استفاده از مدیر زمینه به‌عنوان دکوراتور تابع" -msgid ":class:`ContextDecorator` makes it possible to use a context manager in both an ordinary ``with`` statement and also as a function decorator." +msgid "" +":class:`ContextDecorator` makes it possible to use a context manager in both " +"an ordinary ``with`` statement and also as a function decorator." msgstr "" +":class:`ContextDecorator` امکان استفاده از یک مدیر زمینه را هم در یک دستور " +"``with`` معمولی و هم به‌عنوان دکوراتور تابع فراهم می‌کند." -msgid "For example, it is sometimes useful to wrap functions or groups of statements with a logger that can track the time of entry and time of exit. Rather than writing both a function decorator and a context manager for the task, inheriting from :class:`ContextDecorator` provides both capabilities in a single definition::" +msgid "" +"For example, it is sometimes useful to wrap functions or groups of " +"statements with a logger that can track the time of entry and time of exit. " +"Rather than writing both a function decorator and a context manager for the " +"task, inheriting from :class:`ContextDecorator` provides both capabilities " +"in a single definition::" msgstr "" +"برای مثال، گاهی اوقات مفید است که توابع یا گروه‌هایی از دستورها را با یک گزارش‌گیر " +"(logger) پوشش دهید تا بتواند زمان ورود و زمان خروج را پیگیری کند. به جای " +"نوشتن هر دو دکوراتور تابع و مدیر زمینه برای این کار، ارث‌بری " +"از :class:`ContextDecorator` هر دو قابلیت را در یک تعریف واحد فراهم می‌کند::" msgid "" "from contextlib import ContextDecorator\n" @@ -766,18 +1590,35 @@ msgid "" " def __exit__(self, exc_type, exc, exc_tb):\n" " logging.info('Exiting: %s', self.name)" msgstr "" +"from contextlib import ContextDecorator\n" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class track_entry_and_exit(ContextDecorator):\n" +" def __init__(self, name):\n" +" self.name = name\n" +"\n" +" def __enter__(self):\n" +" logging.info('Entering: %s', self.name)\n" +"\n" +" def __exit__(self, exc_type, exc, exc_tb):\n" +" logging.info('Exiting: %s', self.name)" msgid "Instances of this class can be used as both a context manager::" -msgstr "" +msgstr "نمونه‌های این کلاس را می‌توان هم به‌عنوان یک مدیر زمینه استفاده کرد::" msgid "" "with track_entry_and_exit('widget loader'):\n" " print('Some time consuming activity goes here')\n" " load_widget()" msgstr "" +"with track_entry_and_exit('widget loader'):\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" msgid "And also as a function decorator::" -msgstr "" +msgstr "و همچنین به‌عنوان دکوراتور تابع::" msgid "" "@track_entry_and_exit('widget loader')\n" @@ -785,30 +1626,71 @@ msgid "" " print('Some time consuming activity goes here')\n" " load_widget()" msgstr "" +"@track_entry_and_exit('widget loader')\n" +"def activity():\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" -msgid "Note that there is one additional limitation when using context managers as function decorators: there's no way to access the return value of :meth:`~object.__enter__`. If that value is needed, then it is still necessary to use an explicit ``with`` statement." +msgid "" +"Note that there is one additional limitation when using context managers as " +"function decorators: there's no way to access the return value " +"of :meth:`~object.__enter__`. If that value is needed, then it is still " +"necessary to use an explicit ``with`` statement." msgstr "" +"توجه داشته باشید که هنگام استفاده از مدیرهای زمینه به‌عنوان دکوراتورهای تابع، " +"یک محدودیت اضافی وجود دارد: هیچ راهی برای دسترسی به مقدار " +"بازگشتی :meth:`~object.__enter__` وجود ندارد. اگر به آن مقدار نیاز دارید، " +"همچنان لازم است از یک دستور ``with`` صریح استفاده کنید." msgid ":pep:`343` - The \"with\" statement" -msgstr "" +msgstr ":pep:`343` - دستور «with»" -msgid "The specification, background, and examples for the Python :keyword:`with` statement." -msgstr "" +msgid "" +"The specification, background, and examples for the Python :keyword:`with` " +"statement." +msgstr "مشخصات، پیشینه و مثال‌های دستور :keyword:`with` در پایتون." msgid "Single use, reusable and reentrant context managers" -msgstr "" +msgstr "مدیران زمینه‌ی یک‌بارمصرف، بازاستفاده‌پذیر و بازورودپذیر" -msgid "Most context managers are written in a way that means they can only be used effectively in a :keyword:`with` statement once. These single use context managers must be created afresh each time they're used - attempting to use them a second time will trigger an exception or otherwise not work correctly." +msgid "" +"Most context managers are written in a way that means they can only be used " +"effectively in a :keyword:`with` statement once. These single use context " +"managers must be created afresh each time they're used - attempting to use " +"them a second time will trigger an exception or otherwise not work correctly." msgstr "" +"بیشتر مدیرهای زمینه به‌گونه‌ای نوشته شده‌اند که فقط یک بار می‌توان به‌طور مؤثر در " +"یک دستور :keyword:`with` از آن‌ها استفاده کرد. این مدیرهای زمینه‌ی یک‌بارمصرف " +"باید هر بار که استفاده می‌شوند، از نو ایجاد شوند؛ تلاش برای استفاده از آن‌ها " +"برای بار دوم باعث پرتاب یک استثنا می‌شود یا در غیر این صورت به‌درستی کار " +"نخواهد کرد." -msgid "This common limitation means that it is generally advisable to create context managers directly in the header of the :keyword:`with` statement where they are used (as shown in all of the usage examples above)." +msgid "" +"This common limitation means that it is generally advisable to create " +"context managers directly in the header of the :keyword:`with` statement " +"where they are used (as shown in all of the usage examples above)." msgstr "" +"این محدودیت رایج به این معناست که معمولاً توصیه می‌شود مدیرهای زمینه را " +"مستقیماً در سرآیند دستور :keyword:`with` در محل استفاده ایجاد کنید (همان‌طور " +"که در تمام مثال‌های استفاده بالا نشان داده شده است)." -msgid "Files are an example of effectively single use context managers, since the first :keyword:`with` statement will close the file, preventing any further IO operations using that file object." +msgid "" +"Files are an example of effectively single use context managers, since the " +"first :keyword:`with` statement will close the file, preventing any further " +"IO operations using that file object." msgstr "" +"فایل‌ها نمونه‌ای از مدیران زمینه‌ای هستند که عملاً یک‌بارمصرف‌اند، زیرا اولین " +"دستور :keyword:`with` فایل را خواهد بست و از هرگونه عملیات ورودی/خروجی بیشتر " +"با استفاده از آن شیء فایل جلوگیری می‌کند." -msgid "Context managers created using :deco:`contextmanager` are also single use context managers, and will complain about the underlying generator failing to yield if an attempt is made to use them a second time::" +msgid "" +"Context managers created using :deco:`contextmanager` are also single use " +"context managers, and will complain about the underlying generator failing " +"to yield if an attempt is made to use them a second time::" msgstr "" +"مدیرهای زمینه‌ای که با استفاده از :deco:`contextmanager` ایجاد می‌شوند نیز " +"مدیرهای زمینه یک‌بارمصرف هستند و اگر تلاش شود برای بار دوم از آن‌ها استفاده " +"شود، از yield نکردن تولیدگر زیربنایی شکایت خواهند کرد::" msgid "" ">>> from contextlib import contextmanager\n" @@ -831,15 +1713,49 @@ msgid "" " ...\n" "RuntimeError: generator didn't yield" msgstr "" +">>> from contextlib import contextmanager\n" +">>> @contextmanager\n" +"... def singleuse():\n" +"... print(\"Before\")\n" +"... yield\n" +"... print(\"After\")\n" +"...\n" +">>> cm = singleuse()\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Before\n" +"After\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"RuntimeError: generator didn't yield" msgid "Reentrant context managers" -msgstr "" +msgstr "مدیرهای زمینه‌ی بازورودپذیر" -msgid "More sophisticated context managers may be \"reentrant\". These context managers can not only be used in multiple :keyword:`with` statements, but may also be used *inside* a :keyword:`!with` statement that is already using the same context manager." +msgid "" +"More sophisticated context managers may be \"reentrant\". These context " +"managers can not only be used in multiple :keyword:`with` statements, but " +"may also be used *inside* a :keyword:`!with` statement that is already using " +"the same context manager." msgstr "" +"مدیرهای زمینه پیشرفته‌تر ممکن است «بازورودپذیر» (reentrant) باشند. این " +"مدیرهای زمینه نه‌تنها می‌توانند در چندین دستور :keyword:`with` استفاده شوند، " +"بلکه ممکن است *داخل* یک دستور :keyword:`!with` که از قبل از همان مدیر زمینه " +"استفاده می‌کند نیز استفاده شوند." -msgid ":class:`threading.RLock` is an example of a reentrant context manager, as are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a very simple example of reentrant use::" +msgid "" +":class:`threading.RLock` is an example of a reentrant context manager, as " +"are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " +"very simple example of reentrant use::" msgstr "" +":class:`threading.RLock` نمونه‌ای از یک مدیر زمینه‌ی بازورودپذیر " +"(reentrant) است، همان‌طور که :func:`suppress`، :func:`redirect_stdout` " +"و :func:`chdir` نیز چنین هستند. در اینجا یک نمونه‌ی بسیار ساده از استفاده‌ی " +"بازورودپذیر آمده است::" msgid "" ">>> from contextlib import redirect_stdout\n" @@ -857,24 +1773,78 @@ msgid "" "This is written to the stream rather than stdout\n" "This is also written to the stream" msgstr "" +">>> from contextlib import redirect_stdout\n" +">>> from io import StringIO\n" +">>> stream = StringIO()\n" +">>> write_to_stream = redirect_stdout(stream)\n" +">>> with write_to_stream:\n" +"... print(\"This is written to the stream rather than stdout\")\n" +"... with write_to_stream:\n" +"... print(\"This is also written to the stream\")\n" +"...\n" +">>> print(\"This is written directly to stdout\")\n" +"This is written directly to stdout\n" +">>> print(stream.getvalue())\n" +"This is written to the stream rather than stdout\n" +"This is also written to the stream" -msgid "Real world examples of reentrancy are more likely to involve multiple functions calling each other and hence be far more complicated than this example." +msgid "" +"Real world examples of reentrancy are more likely to involve multiple " +"functions calling each other and hence be far more complicated than this " +"example." msgstr "" +"نمونه‌های دنیای واقعی از بازورودپذیری (reentrancy) بیشتر احتمال دارد شامل چندین " +"تابع باشند که یکدیگر را فراخوانی می‌کنند و بنابراین بسیار پیچیده‌تر از این " +"مثال باشند." -msgid "Note also that being reentrant is *not* the same thing as being thread safe. :func:`redirect_stdout`, for example, is definitely not thread safe, as it makes a global modification to the system state by binding :data:`sys.stdout` to a different stream." +msgid "" +"Note also that being reentrant is *not* the same thing as being thread " +"safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " +"as it makes a global modification to the system state by " +"binding :data:`sys.stdout` to a different stream." msgstr "" +"همچنین توجه داشته باشید که بازورودپذیر (reentrant) بودن، همان ایمنی در برابر " +"نخ‌ها *نیست*. برای مثال، :func:`redirect_stdout` به‌طور قطع ایمن در برابر نخ‌ها " +"نیست، زیرا با اتصال :data:`sys.stdout` به یک جریان دیگر، تغییری سراسری در " +"وضعیت سیستم ایجاد می‌کند." msgid "Reusable context managers" -msgstr "" +msgstr "مدیران زمینه قابل‌استفاده مجدد" -msgid "Distinct from both single use and reentrant context managers are \"reusable\" context managers (or, to be completely explicit, \"reusable, but not reentrant\" context managers, since reentrant context managers are also reusable). These context managers support being used multiple times, but will fail (or otherwise not work correctly) if the specific context manager instance has already been used in a containing with statement." -msgstr "" +msgid "" +"Distinct from both single use and reentrant context managers are " +"\"reusable\" context managers (or, to be completely explicit, \"reusable, " +"but not reentrant\" context managers, since reentrant context managers are " +"also reusable). These context managers support being used multiple times, " +"but will fail (or otherwise not work correctly) if the specific context " +"manager instance has already been used in a containing with statement." +msgstr "" +"مدیران زمینه «قابل‌استفاده مجدد» از هر دو نوع مدیر زمینه یک‌بارمصرف و " +"بازورودپذیر متمایز هستند (یا برای صراحت کامل، مدیران زمینه «قابل‌استفاده " +"مجدد، اما نه بازورودپذیر»، زیرا مدیران زمینه بازورودپذیر نیز قابل‌استفاده " +"مجدد هستند). این مدیران زمینه از استفاده شدن چندین بار پشتیبانی می‌کنند، اما " +"اگر نمونه خاص مدیر زمینه از قبل در یک دستور with دربرگیرنده استفاده شده " +"باشد، شکست می‌خورند (یا در غیر این صورت به‌درستی کار نمی‌کنند)." -msgid ":class:`threading.Lock` is an example of a reusable, but not reentrant, context manager (for a reentrant lock, it is necessary to use :class:`threading.RLock` instead)." +msgid "" +":class:`threading.Lock` is an example of a reusable, but not reentrant, " +"context manager (for a reentrant lock, it is necessary to " +"use :class:`threading.RLock` instead)." msgstr "" +":class:`threading.Lock` نمونه‌ای از یک مدیر زمینه قابل استفاده مجدد، اما " +"غیربازورود است (برای یک قفل بازورود، لازم است به‌جای آن " +"از :class:`threading.RLock` استفاده شود)." -msgid "Another example of a reusable, but not reentrant, context manager is :class:`ExitStack`, as it invokes *all* currently registered callbacks when leaving any with statement, regardless of where those callbacks were added::" +msgid "" +"Another example of a reusable, but not reentrant, context manager " +"is :class:`ExitStack`, as it invokes *all* currently registered callbacks " +"when leaving any with statement, regardless of where those callbacks were " +"added::" msgstr "" +"مثال دیگری از یک مدیر زمینه قابل‌استفاده مجدد، اما نه بازورودپذیر " +"(reentrant)، :class:`ExitStack` است، زیرا هنگام خروج از هر دستور with، *همه‌ی* " +"کال‌بک‌های ثبت‌شده‌ی کنونی را، صرف‌نظر از اینکه آن کال‌بک‌ها کجا افزوده شده باشند، " +"فراخوانی می‌کند::" msgid "" ">>> from contextlib import ExitStack\n" @@ -903,12 +1873,48 @@ msgid "" "Callback: from outer context\n" "Leaving outer context" msgstr "" +">>> from contextlib import ExitStack\n" +">>> stack = ExitStack()\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from first context\")\n" +"... print(\"Leaving first context\")\n" +"...\n" +"Leaving first context\n" +"Callback: from first context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from second context\")\n" +"... print(\"Leaving second context\")\n" +"...\n" +"Leaving second context\n" +"Callback: from second context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from outer context\")\n" +"... with stack:\n" +"... stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Callback: from outer context\n" +"Leaving outer context" -msgid "As the output from the example shows, reusing a single stack object across multiple with statements works correctly, but attempting to nest them will cause the stack to be cleared at the end of the innermost with statement, which is unlikely to be desirable behaviour." +msgid "" +"As the output from the example shows, reusing a single stack object across " +"multiple with statements works correctly, but attempting to nest them will " +"cause the stack to be cleared at the end of the innermost with statement, " +"which is unlikely to be desirable behaviour." msgstr "" +"همان‌طور که خروجی مثال نشان می‌دهد، استفاده مجدد از یک شیء پشته در چندین دستور " +"with به‌درستی کار می‌کند، اما تلاش برای تودرتو کردن آن‌ها باعث می‌شود پشته در " +"پایان داخلی‌ترین دستور with پاک شود، که بعید است رفتار مطلوبی باشد." -msgid "Using separate :class:`ExitStack` instances instead of reusing a single instance avoids that problem::" +msgid "" +"Using separate :class:`ExitStack` instances instead of reusing a single " +"instance avoids that problem::" msgstr "" +"استفاده از نمونه‌های جداگانه :class:`ExitStack` به جای استفاده مجدد از یک " +"نمونه واحد، از آن مشکل اجتناب می‌کند::" msgid "" ">>> from contextlib import ExitStack\n" @@ -924,3 +1930,15 @@ msgid "" "Leaving outer context\n" "Callback: from outer context" msgstr "" +">>> from contextlib import ExitStack\n" +">>> with ExitStack() as outer_stack:\n" +"... outer_stack.callback(print, \"Callback: from outer context\")\n" +"... with ExitStack() as inner_stack:\n" +"... inner_stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Leaving outer context\n" +"Callback: from outer context" diff --git a/library/contextvars.po b/library/contextvars.po index c7452ab9e..af41a3683 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -24,67 +24,122 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!contextvars` --- Context Variables" -msgstr "" +msgstr ":mod:`!contextvars` --- متغیرهای زمینه" -msgid "This module provides APIs to manage, store, and access context-local state. The :class:`~contextvars.ContextVar` class is used to declare and work with *Context Variables*. The :func:`~contextvars.copy_context` function and the :class:`~contextvars.Context` class should be used to manage the current context in asynchronous frameworks." -msgstr "" +msgid "" +"This module provides APIs to manage, store, and access context-local state." +" The :class:`~contextvars.ContextVar` class is used to declare and work " +"with *Context Variables*. The :func:`~contextvars.copy_context` function " +"and the :class:`~contextvars.Context` class should be used to manage the " +"current context in asynchronous frameworks." +msgstr "" +"این ماژول APIهایی را برای مدیریت، ذخیره و دسترسی به وضعیت محلی زمینه فراهم " +"می‌کند. از کلاس :class:`~contextvars.ContextVar` برای اعلام و کار با " +"*متغیرهای زمینه* استفاده می‌شود. برای مدیریت زمینه جاری در چارچوب‌های " +"ناهمگام باید از تابع :func:`~contextvars.copy_context` و کلاس " +":class:`~contextvars.Context` استفاده شود." -msgid "Context managers that have state should use Context Variables instead of :func:`threading.local` to prevent their state from bleeding to other code unexpectedly, when used in concurrent code." +msgid "" +"Context managers that have state should use Context Variables instead of " +":func:`threading.local` to prevent their state from bleeding to other code " +"unexpectedly, when used in concurrent code." msgstr "" +"مدیران زمینه‌ای که وضعیت دارند، باید به‌جای :func:`threading.local` از " +"متغیرهای زمینه استفاده کنند تا هنگام استفاده در کد هم‌روند، از نشت وضعیتشان " +"به سایر کدها به‌طور غیرمنتظره جلوگیری شود." msgid "See also :pep:`567` for additional details." -msgstr "" +msgstr "همچنین برای جزئیات بیشتر، :pep:`567` را ببینید." msgid "Context Variables" -msgstr "" +msgstr "متغیرهای زمینه" msgid "This class is used to declare a new Context Variable, e.g.::" msgstr "" +"این کلاس برای اعلام یک متغیر زمینه (Context Variable) جدید به کار می‌رود، " +"برای مثال::" msgid "var: ContextVar[int] = ContextVar('var', default=42)" -msgstr "" +msgstr "var: ContextVar[int] = ContextVar('var', default=42)" -msgid "The required *name* parameter is used for introspection and debug purposes." +msgid "" +"The required *name* parameter is used for introspection and debug purposes." msgstr "" +"پارامتر الزامی *name* برای درون‌نگری و اهداف اشکال‌زدایی استفاده می‌شود." -msgid "The optional keyword-only *default* parameter is returned by :meth:`ContextVar.get` when no value for the variable is found in the current context." +msgid "" +"The optional keyword-only *default* parameter is returned by " +":meth:`ContextVar.get` when no value for the variable is found in the " +"current context." msgstr "" +"پارامتر اختیاری فقط کلیدواژه‌ای *default* توسط :meth:`ContextVar.get` " +"برگردانده می‌شود، هنگامی که هیچ مقداری برای متغیر در زمینه جاری یافت نشود." -msgid "**Important:** Context Variables should be created at the top module level and never in closures. :class:`Context` objects hold strong references to context variables which prevents context variables from being properly garbage collected." +msgid "" +"**Important:** Context Variables should be created at the top module level " +"and never in closures. :class:`Context` objects hold strong references to " +"context variables which prevents context variables from being properly " +"garbage collected." msgstr "" +"**مهم:** متغیرهای زمینه باید در سطح بالای ماژول ایجاد شوند و هرگز در بسته‌ها" +" (closures) ایجاد نشوند. اشیای :class:`Context` ارجاع‌های قوی به متغیرهای " +"زمینه نگه می‌دارند که مانع از زباله‌روبی صحیح متغیرهای زمینه می‌شود." -msgid ":class:`!ContextVar`\\s are :ref:`generic ` over the type of their contained value." +msgid "" +":class:`!ContextVar`\\s are :ref:`generic ` over the type of their" +" contained value." msgstr "" +":class:`!ContextVar` ها نسبت به نوع مقدار درون خود :ref:`عام ` " +"هستند." msgid "The name of the variable. This is a read-only property." -msgstr "" +msgstr "نام متغیر. این یک ویژگی فقط‌خواندنی است." msgid "Return a value for the context variable for the current context." -msgstr "" +msgstr "مقداری برای متغیر زمینه در زمینه جاری برمی‌گرداند." -msgid "If there is no value for the variable in the current context, the method will:" -msgstr "" +msgid "" +"If there is no value for the variable in the current context, the method " +"will:" +msgstr "اگر در زمینه فعلی مقداری برای متغیر وجود نداشته باشد، متد:" -msgid "return the value of the *default* argument of the method, if provided; or" +msgid "" +"return the value of the *default* argument of the method, if provided; or" msgstr "" +"مقدار آرگومان *default* متد را، در صورتی که ارائه شده باشد، برمی‌گرداند؛ یا" -msgid "return the default value for the context variable, if it was created with one; or" +msgid "" +"return the default value for the context variable, if it was created with " +"one; or" msgstr "" +"مقدار پیش‌فرض متغیر زمینه را برمی‌گرداند، اگر با یک مقدار پیش‌فرض ایجاد شده " +"باشد؛ یا" msgid "raise a :exc:`LookupError`." -msgstr "" +msgstr "یک :exc:`LookupError` پرتاب می‌کند." -msgid "Call to set a new value for the context variable in the current context." -msgstr "" +msgid "" +"Call to set a new value for the context variable in the current context." +msgstr "فراخوانی برای تنظیم مقدار جدید برای متغیر زمینه در زمینه فعلی." -msgid "The required *value* argument is the new value for the context variable." -msgstr "" +msgid "" +"The required *value* argument is the new value for the context variable." +msgstr "آرگومان *value* الزامی، مقدار جدید برای متغیر زمینه است." -msgid "Returns a :class:`~contextvars.Token` object that can be used to restore the variable to its previous value via the :meth:`ContextVar.reset` method." +msgid "" +"Returns a :class:`~contextvars.Token` object that can be used to restore the" +" variable to its previous value via the :meth:`ContextVar.reset` method." msgstr "" +"یک شیء :class:`~contextvars.Token` بازمی‌گرداند که می‌توان از آن برای " +"بازگرداندن متغیر به مقدار پیشین آن از طریق متد :meth:`ContextVar.reset` " +"استفاده کرد." -msgid "For convenience, the token object can be used as a context manager to avoid calling :meth:`ContextVar.reset` manually::" +msgid "" +"For convenience, the token object can be used as a context manager to avoid " +"calling :meth:`ContextVar.reset` manually::" msgstr "" +"برای سهولت، می‌توان از شیء توکن به‌عنوان مدیر زمینه استفاده کرد تا از " +"فراخوانی دستی :meth:`ContextVar.reset` اجتناب شود::" msgid "" "var = ContextVar('var', default='default value')\n" @@ -94,9 +149,15 @@ msgid "" "\n" "assert var.get() == 'default value'" msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"with var.set('new value'):\n" +" assert var.get() == 'new value'\n" +"\n" +"assert var.get() == 'default value'" msgid "It is a shorthand for::" -msgstr "" +msgstr "این معادل کوتاه‌شده‌ی زیر است::" msgid "" "var = ContextVar('var', default='default value')\n" @@ -109,15 +170,28 @@ msgid "" "\n" "assert var.get() == 'default value'" msgstr "" +"var = ContextVar('var', default='default value')\n" +"\n" +"token = var.set('new value')\n" +"try:\n" +" assert var.get() == 'new value'\n" +"finally:\n" +" var.reset(token)\n" +"\n" +"assert var.get() == 'default value'" msgid "Added support for using tokens as context managers." -msgstr "" +msgstr "پشتیبانی از استفاده از توکن‌ها به‌عنوان مدیران زمینه افزوده شد." -msgid "Reset the context variable to the value it had before the :meth:`ContextVar.set` that created the *token* was used." +msgid "" +"Reset the context variable to the value it had before the " +":meth:`ContextVar.set` that created the *token* was used." msgstr "" +"متغیر زمینه را به مقداری که پیش از استفاده از :meth:`ContextVar.set` برای " +"ایجاد *token* داشت، بازنشانی می‌کند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "var = ContextVar('var')\n" @@ -129,83 +203,183 @@ msgid "" "# After the reset call the var has no value again, so\n" "# var.get() would raise a LookupError." msgstr "" +"var = ContextVar('var')\n" +"\n" +"token = var.set('new value')\n" +"# کدی که از 'var' استفاده می‌کند؛ var.get() مقدار 'new value' را برمی‌گرداند.\n" +"var.reset(token)\n" +"\n" +"# پس از فراخوانی reset، var دوباره هیچ مقداری ندارد، بنابراین\n" +"# var.get() یک LookupError پرتاب می‌کند." msgid "The same *token* cannot be used twice." -msgstr "" +msgstr "نمی‌توان از همان *توکن* دو بار استفاده کرد." -msgid "*Token* objects are returned by the :meth:`ContextVar.set` method. They can be passed to the :meth:`ContextVar.reset` method to revert the value of the variable to what it was before the corresponding *set*. A single token cannot reset a context variable more than once." +msgid "" +"*Token* objects are returned by the :meth:`ContextVar.set` method. They can " +"be passed to the :meth:`ContextVar.reset` method to revert the value of the " +"variable to what it was before the corresponding *set*. A single token " +"cannot reset a context variable more than once." msgstr "" +"اشیای *Token* توسط متد :meth:`ContextVar.set` برگردانده می‌شوند. می‌توان " +"آن‌ها را به متد :meth:`ContextVar.reset` ارسال کرد تا مقدار متغیر به مقداری " +"که پیش از *set* مربوطه داشت برگردانده شود. یک توکن واحد نمی‌تواند یک متغیر " +"زمینه را بیش از یک بار بازنشانی کند." -msgid "Tokens support the :ref:`context manager protocol ` to automatically reset context variables. See :meth:`ContextVar.set`." +msgid "" +"Tokens support the :ref:`context manager protocol ` to " +"automatically reset context variables. See :meth:`ContextVar.set`." msgstr "" +"توکن‌ها از :ref:`پروتکل مدیریت زمینه ` برای بازنشانی " +"خودکار متغیرهای زمینه پشتیبانی می‌کنند. :meth:`ContextVar.set` را ببینید." -msgid "Tokens are :ref:`generic ` over the same type as the :class:`ContextVar` which created them." +msgid "" +"Tokens are :ref:`generic ` over the same type as the " +":class:`ContextVar` which created them." msgstr "" +"توکن‌ها نسبت به همان نوعی که :class:`ContextVar` آن‌ها را ایجاد کرده است، " +":ref:`عام ` هستند." msgid "Added support for usage as a context manager." -msgstr "" +msgstr "پشتیبانی از استفاده به‌عنوان مدیر زمینه افزوده شد." -msgid "A read-only property. Points to the :class:`ContextVar` object that created the token." +msgid "" +"A read-only property. Points to the :class:`ContextVar` object that created" +" the token." msgstr "" +"یک ویژگی فقط‌خواندنی. به شیء :class:`ContextVar` که توکن را ایجاد کرده است " +"اشاره می‌کند." -msgid "A read-only property. Set to the value the variable had before the :meth:`ContextVar.set` method call that created the token. It points to :attr:`Token.MISSING` if the variable was not set before the call." +msgid "" +"A read-only property. Set to the value the variable had before the " +":meth:`ContextVar.set` method call that created the token. It points to " +":attr:`Token.MISSING` if the variable was not set before the call." msgstr "" +"یک ویژگی فقط‌خواندنی. به مقداری تنظیم می‌شود که متغیر پیش از فراخوانی متد " +":meth:`ContextVar.set` که توکن را ایجاد کرد، داشت. اگر متغیر پیش از فراخوانی" +" تنظیم نشده باشد، به :attr:`Token.MISSING` اشاره می‌کند." msgid "A marker object used by :attr:`Token.old_value`." -msgstr "" +msgstr "یک شیء نشانگر که توسط :attr:`Token.old_value` استفاده می‌شود." msgid "Manual Context Management" -msgstr "" +msgstr "مدیریت دستی زمینه" msgid "Returns a copy of the current :class:`~contextvars.Context` object." -msgstr "" +msgstr "نسخه‌ای از شیء :class:`~contextvars.Context` فعلی را برمی‌گرداند." -msgid "The following snippet gets a copy of the current context and prints all variables and their values that are set in it::" +msgid "" +"The following snippet gets a copy of the current context and prints all " +"variables and their values that are set in it::" msgstr "" +"قطعه‌کد زیر یک کپی از زمینه فعلی را می‌گیرد و همه متغیرهایی را که در آن " +"تنظیم شده‌اند، به همراه مقادیرشان چاپ می‌کند::" msgid "" "ctx: Context = copy_context()\n" "print(list(ctx.items()))" msgstr "" +"ctx: Context = copy_context()\n" +"print(list(ctx.items()))" -msgid "The function has an *O*\\ (1) complexity, i.e. works equally fast for contexts with a few context variables and for contexts that have a lot of them." +msgid "" +"The function has an *O*\\ (1) complexity, i.e. works equally fast for " +"contexts with a few context variables and for contexts that have a lot of " +"them." msgstr "" +"این تابع دارای پیچیدگی *O*\\ (1) است، یعنی هم برای زمینه‌هایی با چند متغیر " +"زمینه و هم برای زمینه‌هایی که تعداد زیادی از آن‌ها دارند، با سرعت یکسانی کار" +" می‌کند." msgid "A mapping of :class:`ContextVars ` to their values." -msgstr "" +msgstr "یک نگاشت از :class:`ContextVars ` به مقدارهای آن‌ها." -msgid "``Context()`` creates an empty context with no values in it. To get a copy of the current context use the :func:`~contextvars.copy_context` function." +msgid "" +"``Context()`` creates an empty context with no values in it. To get a copy " +"of the current context use the :func:`~contextvars.copy_context` function." msgstr "" +"``Context()`` یک زمینه خالی بدون هیچ مقداری در آن ایجاد می‌کند. برای گرفتن " +"نسخه‌ای از زمینه جاری، از تابع :func:`~contextvars.copy_context` استفاده " +"کنید." -msgid "Each thread has its own effective stack of :class:`!Context` objects. The :term:`current context` is the :class:`!Context` object at the top of the current thread's stack. All :class:`!Context` objects in the stacks are considered to be *entered*." +msgid "" +"Each thread has its own effective stack of :class:`!Context` objects. The " +":term:`current context` is the :class:`!Context` object at the top of the " +"current thread's stack. All :class:`!Context` objects in the stacks are " +"considered to be *entered*." msgstr "" +"هر نخ، پشته‌ی مؤثر خود از اشیای :class:`!Context` را دارد. " +":term:`زمینه جاری `، شیء :class:`!Context` در بالای پشته‌ی " +"نخ جاری است. تمام اشیای :class:`!Context` در پشته‌ها، *واردشده* در نظر " +"گرفته می‌شوند." -msgid "*Entering* a context, which can be done by calling its :meth:`~Context.run` method, makes the context the current context by pushing it onto the top of the current thread's context stack." +msgid "" +"*Entering* a context, which can be done by calling its :meth:`~Context.run` " +"method, makes the context the current context by pushing it onto the top of " +"the current thread's context stack." msgstr "" +"*ورود* به یک زمینه، که می‌تواند با فراخوانی متد :meth:`~Context.run` آن " +"انجام شود، زمینه را با قرار دادن آن در بالای پشته‌ی زمینه‌ی نخ جاری به زمینه‌ی " +"جاری تبدیل می‌کند." -msgid "*Exiting* from the current context, which can be done by returning from the callback passed to the :meth:`~Context.run` method, restores the current context to what it was before the context was entered by popping the context off the top of the context stack." +msgid "" +"*Exiting* from the current context, which can be done by returning from the " +"callback passed to the :meth:`~Context.run` method, restores the current " +"context to what it was before the context was entered by popping the context" +" off the top of the context stack." msgstr "" +"*خروج* از زمینه فعلی، که می‌توان آن را با بازگشت از کال‌بک داده‌شده به متد " +":meth:`~Context.run` انجام داد، با برداشتن زمینه از بالای پشته‌ی زمینه، " +"زمینه فعلی را به وضعیتی که پیش از ورود به زمینه داشت بازمی‌گرداند." -msgid "Since each thread has its own context stack, :class:`ContextVar` objects behave in a similar fashion to :func:`threading.local` when values are assigned in different threads." +msgid "" +"Since each thread has its own context stack, :class:`ContextVar` objects " +"behave in a similar fashion to :func:`threading.local` when values are " +"assigned in different threads." msgstr "" +"از آن‌جایی که هر نخ پشته‌ی زمینه‌ی مختص به خود را دارد، اشیای " +":class:`ContextVar` هنگامی که مقدارها در نخ‌های مختلف اختصاص داده می‌شوند، " +"رفتاری مشابه :func:`threading.local` دارند." -msgid "Attempting to enter an already entered context, including contexts entered in other threads, raises a :exc:`RuntimeError`." +msgid "" +"Attempting to enter an already entered context, including contexts entered " +"in other threads, raises a :exc:`RuntimeError`." msgstr "" +"تلاش برای ورود به زمینه‌ای که از قبل وارد شده است، از جمله زمینه‌هایی که در " +"نخ‌های دیگر وارد شده‌اند، باعث پرتاب یک :exc:`RuntimeError` می‌شود." msgid "After exiting a context, it can later be re-entered (from any thread)." -msgstr "" +msgstr "پس از خروج از یک زمینه، می‌توان بعداً دوباره وارد آن شد (از هر نخی)." -msgid "Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` method are recorded in the current context. The :meth:`ContextVar.get` method returns the value associated with the current context. Exiting a context effectively reverts any changes made to context variables while the context was entered (if needed, the values can be restored by re-entering the context)." -msgstr "" +msgid "" +"Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " +"method are recorded in the current context. The :meth:`ContextVar.get` " +"method returns the value associated with the current context. Exiting a " +"context effectively reverts any changes made to context variables while the " +"context was entered (if needed, the values can be restored by re-entering " +"the context)." +msgstr "" +"هرگونه تغییر در مقادیر :class:`ContextVar` از طریق متد " +":meth:`ContextVar.set` در زمینه فعلی ثبت می‌شود. متد :meth:`ContextVar.get` " +"مقدار مرتبط با زمینه فعلی را برمی‌گرداند. خروج از یک زمینه، عملاً هر تغییری " +"را که در متغیرهای زمینه در مدتی که وارد زمینه شده بودید ایجاد شده باشد، " +"برمی‌گرداند (در صورت نیاز، می‌توان با ورود مجدد به زمینه، مقادیر را بازیابی " +"کرد)." msgid "Context implements the :class:`collections.abc.Mapping` interface." -msgstr "" +msgstr "Context رابط :class:`collections.abc.Mapping` را پیاده‌سازی می‌کند." -msgid "Enters the Context, executes ``callable(*args, **kwargs)``, then exits the Context. Returns *callable*'s return value, or propagates an exception if one occurred." +msgid "" +"Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " +"Context. Returns *callable*'s return value, or propagates an exception if " +"one occurred." msgstr "" +"وارد Context می‌شود، ``callable(*args, **kwargs)`` را اجرا می‌کند، سپس از " +"Context خارج می‌شود. مقدار بازگشتی *callable* را بازمی‌گرداند، یا اگر " +"استثنایی رخ داده باشد، آن را منتشر می‌کند." msgid "Example:" -msgstr "" +msgstr "مثال:" msgid "" "import contextvars\n" @@ -239,39 +413,95 @@ msgid "" "# However, outside of 'ctx', 'var' is still set to 'spam':\n" "print(var.get()) # 'spam'" msgstr "" +"import contextvars\n" +"\n" +"var = contextvars.ContextVar('var')\n" +"var.set('spam')\n" +"print(var.get()) # 'spam'\n" +"\n" +"ctx = contextvars.copy_context()\n" +"\n" +"def main():\n" +" # 'var' was set to 'spam' before\n" +" # calling 'copy_context()' and 'ctx.run(main)', so:\n" +" print(var.get()) # 'spam'\n" +" print(ctx[var]) # 'spam'\n" +"\n" +" var.set('ham')\n" +"\n" +" # Now, after setting 'var' to 'ham':\n" +" print(var.get()) # 'ham'\n" +" print(ctx[var]) # 'ham'\n" +"\n" +"# Any changes that the 'main' function makes to 'var'\n" +"# will be contained in 'ctx'.\n" +"ctx.run(main)\n" +"\n" +"# The 'main()' function was run in the 'ctx' context,\n" +"# so changes to 'var' are contained in it:\n" +"print(ctx[var]) # 'ham'\n" +"\n" +"# However, outside of 'ctx', 'var' is still set to 'spam':\n" +"print(var.get()) # 'spam'" msgid "Return a shallow copy of the context object." -msgstr "" +msgstr "یک کپی سطحی از شیء زمینه برمی‌گرداند." -msgid "Return ``True`` if the *context* has a value for *var* set; return ``False`` otherwise." +msgid "" +"Return ``True`` if the *context* has a value for *var* set; return ``False``" +" otherwise." msgstr "" +"اگر *context* دارای مقداری برای *var* تنظیم‌شده باشد، ``True`` را " +"برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند." -msgid "Return the value of the *var* :class:`ContextVar` variable. If the variable is not set in the context object, a :exc:`KeyError` is raised." +msgid "" +"Return the value of the *var* :class:`ContextVar` variable. If the variable " +"is not set in the context object, a :exc:`KeyError` is raised." msgstr "" +"مقدار متغیر *var* از کلاس :class:`ContextVar` را برمی‌گرداند. اگر متغیر در " +"شیء زمینه تنظیم‌نشده باشد، استثنای :exc:`KeyError` پرتاب می‌شود." -msgid "Return the value for *var* if *var* has the value in the context object. Return *default* otherwise. If *default* is not given, return ``None``." +msgid "" +"Return the value for *var* if *var* has the value in the context object. " +"Return *default* otherwise. If *default* is not given, return ``None``." msgstr "" +"اگر *var* در شیء زمینه مقدار داشته باشد، مقدار *var* را برمی‌گرداند. در غیر " +"این صورت، *default* را برمی‌گرداند. اگر *default* داده نشده باشد، ``None`` " +"را برمی‌گرداند." msgid "Return an iterator over the variables stored in the context object." msgstr "" +"یک پیمایش‌گر (iterator) بر روی متغیرهای ذخیره‌شده در شیء زمینه برمی‌گرداند." msgid "Return the number of variables set in the context object." -msgstr "" +msgstr "تعداد متغیرهای تنظیم‌شده در شیء زمینه را برمی‌گرداند." msgid "Return a list of all variables in the context object." -msgstr "" +msgstr "فهرستی از همه متغیرهای شیء زمینه را برمی‌گرداند." msgid "Return a list of all variables' values in the context object." -msgstr "" +msgstr "فهرستی از مقادیر تمام متغیرها در شیء زمینه برمی‌گرداند." -msgid "Return a list of 2-tuples containing all variables and their values in the context object." +msgid "" +"Return a list of 2-tuples containing all variables and their values in the " +"context object." msgstr "" +"فهرستی از تاپل‌های دوتایی را برمی‌گرداند که شامل تمام متغیرها و مقادیر آن‌ها" +" در شیء زمینه است." msgid "asyncio support" -msgstr "" +msgstr "پشتیبانی از asyncio" -msgid "Context variables are natively supported in :mod:`asyncio` and are ready to be used without any extra configuration. For example, here is a simple echo server, that uses a context variable to make the address of a remote client available in the Task that handles that client::" +msgid "" +"Context variables are natively supported in :mod:`asyncio` and are ready to " +"be used without any extra configuration. For example, here is a simple echo" +" server, that uses a context variable to make the address of a remote client" +" available in the Task that handles that client::" msgstr "" +"متغیرهای زمینه به‌صورت بومی در :mod:`asyncio` پشتیبانی می‌شوند و بدون " +"هیچ‌گونه پیکربندی اضافی آماده استفاده هستند. برای مثال، در اینجا یک سرور اکو" +" ساده آمده است که از یک متغیر زمینه استفاده می‌کند تا نشانی یک کلاینت دوردست" +" را در Taskای که آن کلاینت را مدیریت می‌کند در دسترس قرار دهد::" msgid "" "import asyncio\n" @@ -317,3 +547,43 @@ msgid "" "# telnet 127.0.0.1 8081\n" "# curl 127.0.0.1:8081" msgstr "" +"import asyncio\n" +"import contextvars\n" +"\n" +"client_addr_var = contextvars.ContextVar('client_addr')\n" +"\n" +"def render_goodbye():\n" +" # می‌توان بدون گذراندن صریح آن به این تابع، به نشانی کلاینتی که در حال حاضر رسیدگی می‌شود دسترسی پیدا کرد.\n" +"\n" +" client_addr = client_addr_var.get()\n" +" return f'Good bye, client @ {client_addr}\\r\\n'.encode()\n" +"\n" +"async def handle_request(reader, writer):\n" +" addr = writer.transport.get_extra_info('socket').getpeername()\n" +" client_addr_var.set(addr)\n" +"\n" +" # در هر کدی که فراخوانی می‌کنیم، اکنون امکان دریافت نشانی کلاینت با فراخوانی 'client_addr_var.get()' وجود دارد.\n" +"\n" +" while True:\n" +" line = await reader.readline()\n" +" print(line)\n" +" if not line.strip():\n" +" break\n" +"\n" +" writer.write(b'HTTP/1.1 200 OK\\r\\n') # خط وضعیت\n" +" writer.write(b'\\r\\n') # سرآیندها\n" +" writer.write(render_goodbye()) # بدنه\n" +" writer.close()\n" +"\n" +"async def main():\n" +" srv = await asyncio.start_server(\n" +" handle_request, '127.0.0.1', 8081)\n" +"\n" +" async with srv:\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# برای آزمایش آن می‌توانید از telnet یا curl استفاده کنید:\n" +"# telnet 127.0.0.1 8081\n" +"# curl 127.0.0.1:8081" diff --git a/library/copy.po b/library/copy.po index 738ac71f3..53abd830f 100644 --- a/library/copy.po +++ b/library/copy.po @@ -24,97 +24,207 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!copy` --- Shallow and deep copy operations" -msgstr "" +msgstr ":mod:`!copy` --- عملیات کپی کم‌عمق و عمیق" msgid "**Source code:** :source:`Lib/copy.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/copy.py`" -msgid "Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy is sometimes needed so one can change one copy without changing the other. This module provides generic shallow and deep copy operations (explained below)." -msgstr "" +msgid "" +"Assignment statements in Python do not copy objects, they create bindings " +"between a target and an object. For collections that are mutable or contain " +"mutable items, a copy is sometimes needed so one can change one copy without" +" changing the other. This module provides generic shallow and deep copy " +"operations (explained below)." +msgstr "" +"دستورهای انتساب در پایتون اشیاء را کپی نمی‌کنند، بلکه پیوندی بین یک هدف و یک" +" شیء ایجاد می‌کنند. برای مجموعه‌های تغییرپذیر یا حاوی آیتم‌های تغییرپذیر، " +"گاهی به یک کپی نیاز است تا بتوان یک کپی را بدون تغییر دیگری تغییر داد. این " +"ماژول عملیات عام کپی کم‌عمق و عمیق را فراهم می‌کند (که در ادامه توضیح داده" +" شده‌اند)." msgid "Interface summary:" -msgstr "" +msgstr "خلاصه‌ی رابط:" msgid "Return a shallow copy of *obj*." -msgstr "" +msgstr "یک کپی سطحی از *obj* برمی‌گرداند." msgid "Return a deep copy of *obj*." -msgstr "" +msgstr "یک کپی عمیق از *obj* برمی‌گرداند." -msgid "Creates a new object of the same type as *obj*, replacing fields with values from *changes*." +msgid "" +"Creates a new object of the same type as *obj*, replacing fields with values" +" from *changes*." msgstr "" +"شیء جدیدی از همان نوع *obj* ایجاد می‌کند و فیلدها را با مقادیر *changes* " +"جایگزین می‌کند." msgid "Raised for module specific errors." -msgstr "" +msgstr "برای خطاهای خاص ماژول پرتاب می‌شود." -msgid "The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances):" +msgid "" +"The difference between shallow and deep copying is only relevant for " +"compound objects (objects that contain other objects, like lists or class " +"instances):" msgstr "" +"تفاوت میان کپی کم‌عمق و کپی عمیق تنها برای اشیاء مرکب (اشیایی که شامل اشیاء " +"دیگر هستند، مانند فهرست‌ها یا نمونه‌های کلاس) اهمیت دارد:" -msgid "A *shallow copy* constructs a new compound object and then (to the extent possible) inserts *references* into it to the objects found in the original." +msgid "" +"A *shallow copy* constructs a new compound object and then (to the extent " +"possible) inserts *references* into it to the objects found in the original." msgstr "" +"یک *کپی سطحی* یک شیء مرکب جدید می‌سازد و سپس (تا حد امکان) *ارجاع‌ها* به " +"اشیاء موجود در شیء اصلی را در آن درج می‌کند." -msgid "A *deep copy* constructs a new compound object and then, recursively, inserts *copies* into it of the objects found in the original." +msgid "" +"A *deep copy* constructs a new compound object and then, recursively, " +"inserts *copies* into it of the objects found in the original." msgstr "" +"یک *کپی عمیق* یک شیء مرکب جدید می‌سازد و سپس، به‌صورت بازگشتی، *کپی‌هایی* از" +" اشیای یافت‌شده در شیء اصلی را در آن درج می‌کند." -msgid "Two problems often exist with deep copy operations that don't exist with shallow copy operations:" +msgid "" +"Two problems often exist with deep copy operations that don't exist with " +"shallow copy operations:" msgstr "" +"دو مشکل اغلب در عملیات کپی عمیق وجود دارد که در عملیات کپی سطحی وجود ندارد:" -msgid "Recursive objects (compound objects that, directly or indirectly, contain a reference to themselves) may cause a recursive loop." +msgid "" +"Recursive objects (compound objects that, directly or indirectly, contain a " +"reference to themselves) may cause a recursive loop." msgstr "" +"اشیای بازگشتی (اشیای مرکبی که به‌طور مستقیم یا غیرمستقیم شامل ارجاعی به خود " +"هستند) ممکن است باعث ایجاد یک حلقه بازگشتی شوند." -msgid "Because deep copy copies everything it may copy too much, such as data which is intended to be shared between copies." +msgid "" +"Because deep copy copies everything it may copy too much, such as data which" +" is intended to be shared between copies." msgstr "" +"از آنجا که کپی عمیق همه‌چیز را کپی می‌کند، ممکن است بیش از حد کپی کند، مانند" +" داده‌هایی که قرار است بین کپی‌ها به اشتراک گذاشته شوند." msgid "The :func:`deepcopy` function avoids these problems by:" -msgstr "" +msgstr "تابع :func:`deepcopy` با انجام موارد زیر از این مشکلات اجتناب می‌کند:" -msgid "keeping a ``memo`` dictionary of objects already copied during the current copying pass; and" +msgid "" +"keeping a ``memo`` dictionary of objects already copied during the current " +"copying pass; and" msgstr "" +"نگه‌داری یک دیکشنری ``memo`` از اشیایی که در طول گذر کپی جاری پیش‌تر کپی " +"شده‌اند؛ و" -msgid "letting user-defined classes override the copying operation or the set of components copied." +msgid "" +"letting user-defined classes override the copying operation or the set of " +"components copied." msgstr "" +"به کلاس‌های تعریف‌شده توسط کاربر اجازه می‌دهد تا عملیات کپی یا مجموعه‌ی " +"کامپوننت‌های کپی‌شده را بازنویسی کنند." -msgid "This module does not copy types like module, method, stack trace, stack frame, file, socket, window, or any similar types. It does \"copy\" functions and classes (shallow and deeply), by returning the original object unchanged; this is compatible with the way these are treated by the :mod:`pickle` module." +msgid "" +"This module does not copy types like module, method, stack trace, stack " +"frame, file, socket, window, or any similar types. It does \"copy\" " +"functions and classes (shallow and deeply), by returning the original object" +" unchanged; this is compatible with the way these are treated by the " +":mod:`pickle` module." msgstr "" +"این ماژول انواعی مانند ماژول، متد، ردگیری پشته، فریم پشته، فایل، سوکت، پنجره " +"یا هر نوع مشابه را کپی نمی‌کند. این ماژول توابع و کلاس‌ها را (به‌صورت سطحی و" +" عمیق) با بازگرداندن شیء اصلی بدون تغییر «کپی» می‌کند؛ این رفتار با نحوه‌ی " +"برخورد ماژول :mod:`pickle` با این موارد سازگار است." -msgid "Shallow copies of many collections can be made using the corresponding :meth:`!copy` method (such as :meth:`list.copy`, :meth:`dict.copy` or :meth:`set.copy`), and of sequences (such as lists or bytearrays) by making a slice of the entire sequence (``sequence[:]``). However, these methods and slicing can create an instance of the base type when copying an instance of a subclass, whereas :func:`copy.copy` normally returns an instance of the same type." -msgstr "" +msgid "" +"Shallow copies of many collections can be made using the corresponding " +":meth:`!copy` method (such as :meth:`list.copy`, :meth:`dict.copy` or " +":meth:`set.copy`), and of sequences (such as lists or bytearrays) by making " +"a slice of the entire sequence (``sequence[:]``). However, these methods and" +" slicing can create an instance of the base type when copying an instance of" +" a subclass, whereas :func:`copy.copy` normally returns an instance of the " +"same type." +msgstr "" +"می‌توان کپی‌های سطحی بسیاری از مجموعه‌ها را با استفاده از متد :meth:`!copy` " +"متناظر (مانند :meth:`list.copy`، :meth:`dict.copy` یا :meth:`set.copy`)، و " +"کپی‌های سطحی دنباله‌ها (مانند فهرست‌ها یا bytearrayها) را با ایجاد برشی از " +"کل دنباله (``sequence[:]``) ساخت. با این حال، این متدها و برش‌زدن ممکن است " +"هنگام کپی کردن نمونه‌ای از یک زیرکلاس، نمونه‌ای از نوع پایه را ایجاد کنند، " +"در حالی که :func:`copy.copy` معمولاً نمونه‌ای از همان نوع را برمی‌گرداند." -msgid "Classes can use the same interfaces to control copying that they use to control pickling. See the description of module :mod:`pickle` for information on these methods. In fact, the :mod:`!copy` module uses the registered pickle functions from the :mod:`copyreg` module." +msgid "" +"Classes can use the same interfaces to control copying that they use to " +"control pickling. See the description of module :mod:`pickle` for " +"information on these methods. In fact, the :mod:`!copy` module uses the " +"registered pickle functions from the :mod:`copyreg` module." msgstr "" +"کلاس‌ها می‌توانند برای کنترل کپی‌سازی از همان رابط‌هایی استفاده کنند که برای" +" کنترل پیکل‌کردن (pickling) استفاده می‌کنند. برای آگاهی از این متدها، " +"توضیحات ماژول :mod:`pickle` را ببینید. در واقع، ماژول :mod:`!copy` از توابع " +"پیکل (pickle) ثبت‌شده در ماژول :mod:`copyreg` استفاده می‌کند." -msgid "In order for a class to define its own copy implementation, it can define special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." +msgid "" +"In order for a class to define its own copy implementation, it can define " +"special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." msgstr "" +"برای اینکه یک کلاس بتواند پیاده‌سازی کپی خود را تعریف کند، می‌تواند متدهای " +"ویژه‌ی :meth:`~object.__copy__` و :meth:`~object.__deepcopy__` را تعریف کند." -msgid "Called to implement the shallow copy operation; no additional arguments are passed." +msgid "" +"Called to implement the shallow copy operation; no additional arguments are " +"passed." msgstr "" +"برای پیاده‌سازی عملیات کپی کم‌عمق فراخوانی می‌شود؛ آرگومان اضافه‌ای ارسال " +"نمی‌شود." -msgid "Called to implement the deep copy operation; it is passed one argument, the *memo* dictionary. If the ``__deepcopy__`` implementation needs to make a deep copy of a component, it should call the :func:`~copy.deepcopy` function with the component as first argument and the *memo* dictionary as second argument. The *memo* dictionary should be treated as an opaque object." -msgstr "" +msgid "" +"Called to implement the deep copy operation; it is passed one argument, the " +"*memo* dictionary. If the ``__deepcopy__`` implementation needs to make a " +"deep copy of a component, it should call the :func:`~copy.deepcopy` function" +" with the component as first argument and the *memo* dictionary as second " +"argument. The *memo* dictionary should be treated as an opaque object." +msgstr "" +"برای پیاده‌سازی عملیات کپی عمیق فراخوانی می‌شود؛ یک آرگومان به آن داده " +"می‌شود، دیکشنری *memo*. اگر پیاده‌سازی ``__deepcopy__`` نیاز داشته باشد یک " +"کپی عمیق از یک کامپوننت ایجاد کند، باید تابع :func:`~copy.deepcopy` را با آن" +" کامپوننت به‌عنوان آرگومان اول و دیکشنری *memo* به‌عنوان آرگومان دوم " +"فراخوانی کند. با دیکشنری *memo* باید به‌عنوان یک شیء غیرشفاف رفتار شود." -msgid "Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and :func:`~copy.deepcopy`, and only supports named tuples created by :func:`~collections.namedtuple`, :mod:`dataclasses`, and other classes which define method :meth:`~object.__replace__`." +msgid "" +"Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and " +":func:`~copy.deepcopy`, and only supports named tuples created by " +":func:`~collections.namedtuple`, :mod:`dataclasses`, and other classes which" +" define method :meth:`~object.__replace__`." msgstr "" +"تابع :func:`!copy.replace` محدودتر از :func:`~copy.copy` و " +":func:`~copy.deepcopy` است و فقط از تاپل‌های نام‌دار ایجادشده توسط " +":func:`~collections.namedtuple`، :mod:`dataclasses` و سایر کلاس‌هایی که متد " +":meth:`~object.__replace__` را تعریف می‌کنند، پشتیبانی می‌کند." -msgid "This method should create a new object of the same type, replacing fields with values from *changes*." +msgid "" +"This method should create a new object of the same type, replacing fields " +"with values from *changes*." msgstr "" +"این متد باید یک شیء جدید از همان نوع ایجاد کند و فیلدها را با مقادیر " +"*changes* جایگزین کند." msgid "Module :mod:`pickle`" -msgstr "" +msgstr "ماژول :mod:`pickle`" -msgid "Discussion of the special methods used to support object state retrieval and restoration." +msgid "" +"Discussion of the special methods used to support object state retrieval and" +" restoration." msgstr "" +"بحثی درباره‌ی متدهای ویژه‌ای که برای پشتیبانی از بازیابی و بازگردانی وضعیت " +"شیء به کار می‌روند." msgid "module" -msgstr "" +msgstr "ماژول" msgid "pickle" -msgstr "" +msgstr "pickle" msgid "__copy__() (copy protocol)" -msgstr "" +msgstr "__copy__() (پروتکل کپی)" msgid "__deepcopy__() (copy protocol)" -msgstr "" +msgstr "__deepcopy__() (پروتکل کپی)" msgid "__replace__() (replace protocol)" -msgstr "" +msgstr "__replace__() (پروتکل جایگزینی)" diff --git a/library/copyreg.po b/library/copyreg.po index 9945c9dc8..411bd2b97 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -25,37 +25,75 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!copyreg` --- Register :mod:`!pickle` support functions" -msgstr "" +msgstr ":mod:`!copyreg` --- ثبت توابع پشتیبانی :mod:`!pickle`" msgid "**Source code:** :source:`Lib/copyreg.py`" -msgstr "" +msgstr ":source:`Lib/copyreg.py`" -msgid "The :mod:`!copyreg` module offers a way to define functions used while pickling specific objects. The :mod:`pickle` and :mod:`copy` modules use those functions when pickling/copying those objects. The module provides configuration information about object constructors which are not classes. Such constructors may be factory functions or class instances." +msgid "" +"The :mod:`!copyreg` module offers a way to define functions used while " +"pickling specific objects. The :mod:`pickle` and :mod:`copy` modules use " +"those functions when pickling/copying those objects. The module provides " +"configuration information about object constructors which are not classes. " +"Such constructors may be factory functions or class instances." msgstr "" +"ماژول :mod:`!copyreg` روشی برای تعریف توابعی ارائه می‌کند که هنگام پیکل کردن" +" اشیاء خاص استفاده می‌شوند. ماژول‌های :mod:`pickle` و :mod:`copy` هنگام پیکل" +" کردن/کپی کردن آن اشیاء از این توابع استفاده می‌کنند. این ماژول اطلاعات " +"پیکربندی درباره‌ی سازنده‌های شیء که کلاس نیستند را فراهم می‌کند. چنین " +"سازنده‌هایی ممکن است توابع کارخانه‌ای یا نمونه‌های کلاس باشند." -msgid "Declares *object* to be a valid constructor. If *object* is not callable (and hence not valid as a constructor), raises :exc:`TypeError`." +msgid "" +"Declares *object* to be a valid constructor. If *object* is not callable " +"(and hence not valid as a constructor), raises :exc:`TypeError`." msgstr "" +"*object* را به‌عنوان یک سازنده معتبر اعلام می‌کند. اگر *object* قابل " +"فراخوانی نباشد (و در نتیجه به‌عنوان یک سازنده معتبر نباشد)، :exc:`TypeError`" +" را پرتاب می‌کند." -msgid "Declares that *function* should be used as a \"reduction\" function for objects of type *type*. *function* must return either a string or a tuple containing between two and six elements. See the :attr:`~pickle.Pickler.dispatch_table` for more details on the interface of *function*." +msgid "" +"Declares that *function* should be used as a \"reduction\" function for " +"objects of type *type*. *function* must return either a string or a tuple " +"containing between two and six elements. See the " +":attr:`~pickle.Pickler.dispatch_table` for more details on the interface of " +"*function*." msgstr "" +"اعلام می‌کند که *function* باید به‌عنوان تابع «کاهش» (reduction) برای اشیایی" +" از نوع *type* استفاده شود. *function* باید یا یک رشته برگرداند یا یک تاپل " +"شامل دو تا شش المان. برای جزئیات بیشتر در مورد رابط *function*، " +":attr:`~pickle.Pickler.dispatch_table` را ببینید." -msgid "The *constructor_ob* parameter is a legacy feature and is now ignored, but if passed it must be a callable." +msgid "" +"The *constructor_ob* parameter is a legacy feature and is now ignored, but " +"if passed it must be a callable." msgstr "" +"پارامتر *constructor_ob* یک قابلیت قدیمی است و اکنون نادیده گرفته می‌شود، " +"اما اگر ارسال شود باید قابل فراخوانی باشد." -msgid "Note that the :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler object or subclass of :class:`pickle.Pickler` can also be used for declaring reduction functions." +msgid "" +"Note that the :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler " +"object or subclass of :class:`pickle.Pickler` can also be used for declaring" +" reduction functions." msgstr "" +"توجه داشته باشید که می‌توان از ویژگی :attr:`~pickle.Pickler.dispatch_table` " +"یک شیء پیکل‌ساز (pickler) یا زیرکلاسی از :class:`pickle.Pickler` نیز برای" +" اعلام توابع کاهش (reduction) استفاده کرد." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "The example below would like to show how to register a pickle function and how it will be used:" +msgid "" +"The example below would like to show how to register a pickle function and " +"how it will be used:" msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان یک تابع pickle را ثبت کرد و چگونه از " +"آن استفاده خواهد شد:" msgid "module" -msgstr "" +msgstr "ماژول" msgid "pickle" -msgstr "" +msgstr "پیکل (pickle)" msgid "copy" -msgstr "" +msgstr "کپی" diff --git a/library/crypt.po b/library/crypt.po index a37fdd4cf..dff28613a 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -22,13 +22,31 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!crypt` --- Function to check Unix passwords" -msgstr "" +msgstr ":mod:`!crypt` --- تابعی برای بررسی گذرواژه‌های یونیکس" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. " +"تصمیم به حذف آن در :pep:`594` گرفته شد." -msgid "Applications can use the :mod:`hashlib` module from the standard library. Other possible replacements are third-party libraries from PyPI: :pypi:`legacycrypt`, :pypi:`bcrypt`, or :pypi:`argon2-cffi`. These are not supported or maintained by the Python core team." +msgid "" +"Applications can use the :mod:`hashlib` module from the standard library. " +"Other possible replacements are third-party libraries from PyPI: " +":pypi:`legacycrypt`, :pypi:`bcrypt`, or :pypi:`argon2-cffi`. These are not " +"supported or maintained by the Python core team." msgstr "" +"برنامه‌ها می‌توانند از ماژول :mod:`hashlib` در کتابخانه استاندارد استفاده " +"کنند. جایگزین‌های ممکن دیگر، کتابخانه‌های شخص ثالث از PyPI هستند: " +":pypi:`legacycrypt`، :pypi:`bcrypt`، یا :pypi:`argon2-cffi`. این کتابخانه‌ها" +" توسط تیم اصلی پایتون پشتیبانی یا نگهداری نمی‌شوند." -msgid "The last version of Python that provided the :mod:`!crypt` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!crypt` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!crypt` را ارائه می‌کرد، `پایتون 3.12 " +"`_ بود." diff --git a/library/crypto.po b/library/crypto.po index de381ace3..5f09747d8 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -22,10 +22,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Cryptographic Services" -msgstr "" +msgstr "خدمات رمزنگاری" -msgid "The modules described in this chapter implement various algorithms of a cryptographic nature. They are available at the discretion of the installation. Here's an overview:" +msgid "" +"The modules described in this chapter implement various algorithms of a " +"cryptographic nature. They are available at the discretion of the " +"installation. Here's an overview:" msgstr "" +"ماژول‌های توصیف‌شده در این فصل، الگوریتم‌های مختلفی با ماهیت رمزنگاری را " +"پیاده‌سازی می‌کنند. این ماژول‌ها بسته به نصب در دسترس هستند. در ادامه یک " +"نمای کلی آمده است:" msgid "cryptography" -msgstr "" +msgstr "رمزنگاری" diff --git a/library/csv.po b/library/csv.po index 42eb05dc2..e5b815424 100644 --- a/library/csv.po +++ b/library/csv.po @@ -25,40 +25,113 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!csv` --- CSV File Reading and Writing" -msgstr "" +msgstr ":mod:`!csv` --- خواندن و نوشتن فایل CSV" msgid "**Source code:** :source:`Lib/csv.py`" -msgstr "" +msgstr ":source:`Lib/csv.py`" -msgid "The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in :rfc:`4180`. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer." -msgstr "" +msgid "" +"The so-called CSV (Comma Separated Values) format is the most common import " +"and export format for spreadsheets and databases. CSV format was used for " +"many years prior to attempts to describe the format in a standardized way in" +" :rfc:`4180`. The lack of a well-defined standard means that subtle " +"differences often exist in the data produced and consumed by different " +"applications. These differences can make it annoying to process CSV files " +"from multiple sources. Still, while the delimiters and quoting characters " +"vary, the overall format is similar enough that it is possible to write a " +"single module which can efficiently manipulate such data, hiding the details" +" of reading and writing the data from the programmer." +msgstr "" +"قالب به‌اصطلاح CSV (مقادیر جداشده با ویرگول) رایج‌ترین قالب ایمپورت و " +"برون‌برد برای صفحات گسترده و پایگاه‌های داده است. قالب CSV سال‌ها پیش از " +"تلاش‌ها برای توصیف این قالب به‌صورت استانداردشده در :rfc:`4180` استفاده " +"می‌شد. فقدان یک استاندارد خوش‌تعریف به این معناست که اغلب تفاوت‌های ظریفی در" +" داده‌های تولیدشده و مصرف‌شده توسط برنامه‌های کاربردی مختلف وجود دارد. این " +"تفاوت‌ها می‌توانند پردازش فایل‌های CSV از منابع متعدد را آزاردهنده سازند. با" +" این حال، با وجود اینکه جداکننده‌ها و نویسه‌های نقل‌قول متفاوت‌اند، قالب کلی" +" به‌اندازه‌ای مشابه است که می‌توان یک ماژول واحد نوشت که چنین داده‌هایی را " +"به‌طور کارآمد دست‌کاری کند و جزئیات خواندن و نوشتن داده‌ها را از برنامه‌نویس" +" پنهان کند." -msgid "The :mod:`!csv` module implements classes to read and write tabular data in CSV format. It allows programmers to say, \"write this data in the format preferred by Excel,\" or \"read data from this file which was generated by Excel,\" without knowing the precise details of the CSV format used by Excel. Programmers can also describe the CSV formats understood by other applications or define their own special-purpose CSV formats." -msgstr "" +msgid "" +"The :mod:`!csv` module implements classes to read and write tabular data in " +"CSV format. It allows programmers to say, \"write this data in the format " +"preferred by Excel,\" or \"read data from this file which was generated by " +"Excel,\" without knowing the precise details of the CSV format used by " +"Excel. Programmers can also describe the CSV formats understood by other " +"applications or define their own special-purpose CSV formats." +msgstr "" +"ماژول :mod:`!csv` کلاس‌هایی را برای خواندن و نوشتن داده‌های جدولی در قالب " +"CSV پیاده‌سازی می‌کند. این ماژول به برنامه‌نویسان اجازه می‌دهد بگویند: «این " +"داده‌ها را در قالب مورد نظر Excel بنویس» یا «داده‌ها را از این فایل که توسط " +"Excel تولید شده است بخوان»، بدون آنکه جزئیات دقیق قالب CSV مورد استفاده " +"Excel را بدانند. برنامه‌نویسان همچنین می‌توانند قالب‌های CSV قابل‌فهم برای " +"سایر برنامه‌ها را توصیف کنند یا قالب‌های CSV خاص‌منظور خود را تعریف کنند." -msgid "The :mod:`!csv` module's :class:`reader` and :class:`writer` objects read and write sequences. Programmers can also read and write data in dictionary form using the :class:`DictReader` and :class:`DictWriter` classes." +msgid "" +"The :mod:`!csv` module's :class:`reader` and :class:`writer` objects read " +"and write sequences. Programmers can also read and write data in dictionary" +" form using the :class:`DictReader` and :class:`DictWriter` classes." msgstr "" +"اشیای :class:`reader` و :class:`writer` ماژول :mod:`!csv` دنباله‌ها را " +"می‌خوانند و می‌نویسند. برنامه‌نویسان همچنین می‌توانند داده‌ها را در قالب " +"دیکشنری با استفاده از کلاس‌های :class:`DictReader` و :class:`DictWriter` " +"بخوانند و بنویسند." msgid ":pep:`305` - CSV File API" -msgstr "" +msgstr ":pep:`305` - API پرونده‌ی CSV" -msgid "The Python Enhancement Proposal which proposed this addition to Python." +msgid "" +"The Python Enhancement Proposal which proposed this addition to Python." msgstr "" +"پیشنهاد بهبود پایتون (Python Enhancement Proposal) که این افزوده را برای " +"پایتون پیشنهاد داد." msgid "Module Contents" -msgstr "" +msgstr "محتویات ماژول" msgid "The :mod:`!csv` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!csv` توابع زیر را تعریف می‌کند:" -msgid "Return a :ref:`reader object ` that will process lines from the given *csvfile*. A csvfile must be an iterable of strings, each in the reader's defined csv format. A csvfile is most commonly a file-like object or list. If *csvfile* is a file object, it should be opened with ``newline=''``. [1]_ An optional *dialect* parameter can be given which is used to define a set of parameters specific to a particular CSV dialect. It may be an instance of a subclass of the :class:`Dialect` class or one of the strings returned by the :func:`list_dialects` function. The other optional *fmtparams* keyword arguments can be given to override individual formatting parameters in the current dialect. For full details about the dialect and formatting parameters, see section :ref:`csv-fmt-params`." -msgstr "" +msgid "" +"Return a :ref:`reader object ` that will process lines from " +"the given *csvfile*. A csvfile must be an iterable of strings, each in the " +"reader's defined csv format. A csvfile is most commonly a file-like object " +"or list. If *csvfile* is a file object, it should be opened with " +"``newline=''``. [1]_ An optional *dialect* parameter can be given which is " +"used to define a set of parameters specific to a particular CSV dialect. It" +" may be an instance of a subclass of the :class:`Dialect` class or one of " +"the strings returned by the :func:`list_dialects` function. The other " +"optional *fmtparams* keyword arguments can be given to override individual " +"formatting parameters in the current dialect. For full details about the " +"dialect and formatting parameters, see section :ref:`csv-fmt-params`." +msgstr "" +"یک :ref:`شیء خواننده ` برمی‌گرداند که خطوط *csvfile* " +"داده‌شده را پردازش می‌کند. یک csvfile باید یک پیمایش‌پذیر از رشته‌ها باشد، که " +"هرکدام در قالب csv تعریف‌شده‌ی خواننده قرار دارند. csvfile معمولاً یک شیء " +"شبه‌فایل یا فهرست است. اگر *csvfile* یک شیء فایل باشد، باید با " +"``newline=''`` باز شود. [1]_ می‌توان یک پارامتر اختیاری *dialect* را ارائه " +"کرد که برای تعریف مجموعه‌ای از پارامترهای مختص یک گویش CSV خاص استفاده " +"می‌شود. این پارامتر ممکن است نمونه‌ای از یک زیرکلاس از کلاس " +":class:`Dialect` یا یکی از رشته‌های برگردانده‌شده توسط تابع " +":func:`list_dialects` باشد. می‌توان سایر آرگومان‌های کلیدواژه‌ای اختیاری " +"*fmtparams* را برای بازنویسی پارامترهای قالب‌بندی جداگانه در گویش فعلی " +"ارائه کرد. برای جزئیات کامل درباره گویش و پارامترهای قالب‌بندی، بخش " +":ref:`csv-fmt-params` را ببینید." -msgid "Each row read from the csv file is returned as a list of strings. No automatic data type conversion is performed unless the :data:`QUOTE_NONNUMERIC` format option is specified (in which case unquoted fields are transformed into floats)." +msgid "" +"Each row read from the csv file is returned as a list of strings. No " +"automatic data type conversion is performed unless the " +":data:`QUOTE_NONNUMERIC` format option is specified (in which case unquoted " +"fields are transformed into floats)." msgstr "" +"هر ردیف خوانده‌شده از فایل csv به‌صورت فهرستی از رشته‌ها برگردانده می‌شود. " +"هیچ تبدیل خودکار نوع داده‌ای انجام نمی‌شود، مگر اینکه گزینه قالب " +":data:`QUOTE_NONNUMERIC` مشخص شده باشد (در این صورت فیلدهای بدون علامت " +"نقل‌قول به float تبدیل می‌شوند)." msgid "A short usage example::" -msgstr "" +msgstr "یک مثال کوتاه از کاربرد::" msgid "" ">>> import csv\n" @@ -69,17 +142,58 @@ msgid "" "Spam, Spam, Spam, Spam, Spam, Baked Beans\n" "Spam, Lovely Spam, Wonderful Spam" msgstr "" +">>> import csv\n" +">>> with open('eggs.csv', newline='') as csvfile:\n" +"... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n" +"... for row in spamreader:\n" +"... print(', '.join(row))\n" +"Spam, Spam, Spam, Spam, Spam, Baked Beans\n" +"Spam, Lovely Spam, Wonderful Spam" msgid "where :file:`eggs.csv` contains:" -msgstr "" +msgstr "که :file:`eggs.csv` شامل:" msgid "" "Spam Spam Spam Spam Spam |Baked Beans|\n" "Spam |Lovely Spam| |Wonderful Spam|" msgstr "" +"Spam Spam Spam Spam Spam |Baked Beans|\n" +"Spam |Lovely Spam| |Wonderful Spam|" -msgid "Return a writer object responsible for converting the user's data into delimited strings on the given file-like object. *csvfile* can be any object with a :meth:`~io.TextIOBase.write` method. If *csvfile* is a file object, it should be opened with ``newline=''`` [1]_. An optional *dialect* parameter can be given which is used to define a set of parameters specific to a particular CSV dialect. It may be an instance of a subclass of the :class:`Dialect` class or one of the strings returned by the :func:`list_dialects` function. The other optional *fmtparams* keyword arguments can be given to override individual formatting parameters in the current dialect. For full details about dialects and formatting parameters, see the :ref:`csv-fmt-params` section. To make it as easy as possible to interface with modules which implement the DB API, the value :const:`None` is written as the empty string. While this isn't a reversible transformation, it makes it easier to dump SQL NULL data values to CSV files without preprocessing the data returned from a ``cursor.fetch*`` call. All other non-string data are stringified with :func:`str` before being written." -msgstr "" +msgid "" +"Return a writer object responsible for converting the user's data into " +"delimited strings on the given file-like object. *csvfile* can be any " +"object with a :meth:`~io.TextIOBase.write` method. If *csvfile* is a file " +"object, it should be opened with ``newline=''`` [1]_. An optional *dialect*" +" parameter can be given which is used to define a set of parameters specific" +" to a particular CSV dialect. It may be an instance of a subclass of the " +":class:`Dialect` class or one of the strings returned by the " +":func:`list_dialects` function. The other optional *fmtparams* keyword " +"arguments can be given to override individual formatting parameters in the " +"current dialect. For full details about dialects and formatting parameters," +" see the :ref:`csv-fmt-params` section. To make it as easy as possible to " +"interface with modules which implement the DB API, the value :const:`None` " +"is written as the empty string. While this isn't a reversible " +"transformation, it makes it easier to dump SQL NULL data values to CSV files" +" without preprocessing the data returned from a ``cursor.fetch*`` call. All " +"other non-string data are stringified with :func:`str` before being written." +msgstr "" +"یک شیء نویسنده (writer) را برمی‌گرداند که مسئول تبدیل داده‌های کاربر به " +"رشته‌های جداشده روی شیء شبه‌فایل داده‌شده است. *csvfile* می‌تواند هر شیءای با" +" متد :meth:`~io.TextIOBase.write` باشد. اگر *csvfile* یک شیء فایل است، باید " +"با ``newline=''`` باز شود [1]_. می‌توان یک پارامتر اختیاری *dialect* را داد " +"که برای تعریف مجموعه‌ای از پارامترهای مختص یک گویش CSV معین استفاده می‌شود. " +"این ممکن است نمونه‌ای از زیرکلاسی از کلاس :class:`Dialect` یا یکی از " +"رشته‌های برگردانده‌شده توسط تابع :func:`list_dialects` باشد. می‌توان سایر " +"آرگومان‌های کلیدواژه‌ای اختیاری *fmtparams* را برای لغو پارامترهای قالب‌بندی" +" منفرد در گویش فعلی داد. برای جزئیات کامل درباره گویش‌ها و پارامترهای " +"قالب‌بندی، بخش :ref:`csv-fmt-params` را ببینید. برای اینکه تا حد امکان " +"برقراری رابط با ماژول‌هایی که DB API را پیاده‌سازی می‌کنند آسان شود، مقدار " +":const:`None` به‌صورت رشته خالی نوشته می‌شود. هرچند این تبدیل بازگشت‌پذیر " +"نیست، اما نوشتن مقادیر داده‌ی SQL NULL در فایل‌های CSV بدون پیش‌پردازش " +"داده‌های برگردانده‌شده از فراخوانی ``cursor.fetch*`` را آسان‌تر می‌کند. تمام" +" داده‌های غیررشته‌ای دیگر پیش از نوشته شدن با :func:`str` به رشته تبدیل " +"می‌شوند." msgid "" "import csv\n" @@ -89,48 +203,113 @@ msgid "" " spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" " spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" msgstr "" +"import csv\n" +"with open('eggs.csv', 'w', newline='') as csvfile:\n" +" spamwriter = csv.writer(csvfile, delimiter=' ',\n" +" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n" +" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" +" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" msgid "which writes :file:`eggs.csv` containing:" -msgstr "" +msgstr "که :file:`eggs.csv` را می‌نویسد، شامل:" -msgid "Associate *dialect* with *name*. *name* must be a string. The dialect can be specified either by passing a sub-class of :class:`Dialect`, or by *fmtparams* keyword arguments, or both, with keyword arguments overriding parameters of the dialect. For full details about dialects and formatting parameters, see section :ref:`csv-fmt-params`." -msgstr "" +msgid "" +"Associate *dialect* with *name*. *name* must be a string. The dialect can " +"be specified either by passing a sub-class of :class:`Dialect`, or by " +"*fmtparams* keyword arguments, or both, with keyword arguments overriding " +"parameters of the dialect. For full details about dialects and formatting " +"parameters, see section :ref:`csv-fmt-params`." +msgstr "" +"*dialect* را با *name* مرتبط می‌کند. *name* باید یک رشته باشد. می‌توان " +"گویش را با ارسال یک زیرکلاس از :class:`Dialect`، یا با آرگومان‌های " +"کلیدواژه‌ای *fmtparams*، یا هر دو مشخص کرد؛ در این حالت آرگومان‌های " +"کلیدواژه‌ای پارامترهای گویش را بازنویسی می‌کنند. برای جزئیات کامل درباره " +"گویش‌ها و پارامترهای قالب‌بندی، بخش :ref:`csv-fmt-params` را ببینید." -msgid "Delete the dialect associated with *name* from the dialect registry. An :exc:`Error` is raised if *name* is not a registered dialect name." +msgid "" +"Delete the dialect associated with *name* from the dialect registry. An " +":exc:`Error` is raised if *name* is not a registered dialect name." msgstr "" +"گویش مرتبط با *name* را از رجیستری گویش‌ها حذف کنید. اگر *name* یک نام گویش " +"ثبت‌شده نباشد، یک :exc:`Error` پرتاب می‌شود." -msgid "Return the dialect associated with *name*. An :exc:`Error` is raised if *name* is not a registered dialect name. This function returns an immutable :class:`Dialect`." +msgid "" +"Return the dialect associated with *name*. An :exc:`Error` is raised if " +"*name* is not a registered dialect name. This function returns an immutable" +" :class:`Dialect`." msgstr "" +"گویش مرتبط با *name* را برمی‌گرداند. اگر *name* یک نام گویش ثبت‌شده " +"نباشد، یک :exc:`Error` پرتاب می‌شود. این تابع یک :class:`Dialect` " +"تغییرناپذیر برمی‌گرداند." msgid "Return the names of all registered dialects." -msgstr "" +msgstr "نام تمام گویش‌های ثبت‌شده را برمی‌گرداند." -msgid "Returns the current maximum field size allowed by the parser. If *new_limit* is given, this becomes the new limit." +msgid "" +"Returns the current maximum field size allowed by the parser. If *new_limit*" +" is given, this becomes the new limit." msgstr "" +"حداکثر اندازه فیلدی که پارسر در حال حاضر مجاز می‌داند را برمی‌گرداند. اگر" +" *new_limit* داده شود، به حد جدید تبدیل می‌شود." msgid "The :mod:`!csv` module defines the following classes:" -msgstr "" +msgstr "ماژول :mod:`!csv` کلاس‌های زیر را تعریف می‌کند:" -msgid "Create an object that operates like a regular reader but maps the information in each row to a :class:`dict` whose keys are given by the optional *fieldnames* parameter." +msgid "" +"Create an object that operates like a regular reader but maps the " +"information in each row to a :class:`dict` whose keys are given by the " +"optional *fieldnames* parameter." msgstr "" +"یک شیء ایجاد کنید که مانند یک خواننده معمولی عمل می‌کند، اما اطلاعات هر ردیف " +"را به یک :class:`dict` نگاشت می‌کند که کلیدهای آن توسط پارامتر اختیاری " +"*fieldnames* مشخص می‌شوند." -msgid "The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is omitted, the values in the first row of file *f* will be used as the fieldnames and will be omitted from the results. If *fieldnames* is provided, they will be used and the first row will be included in the results. Regardless of how the fieldnames are determined, the dictionary preserves their original ordering." -msgstr "" +msgid "" +"The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is " +"omitted, the values in the first row of file *f* will be used as the " +"fieldnames and will be omitted from the results. If *fieldnames* is " +"provided, they will be used and the first row will be included in the " +"results. Regardless of how the fieldnames are determined, the dictionary " +"preserves their original ordering." +msgstr "" +"پارامتر *fieldnames* یک :term:`sequence` است. اگر *fieldnames* ارائه نشود، " +"مقدارهای ردیف اول فایل *f* به‌عنوان fieldnames استفاده می‌شوند و از نتایج حذف" +" خواهند شد. اگر *fieldnames* ارائه شود، از آن‌ها استفاده می‌شود و ردیف اول در" +" نتایج گنجانده خواهد شد. صرف‌نظر از این‌که fieldnames چگونه تعیین می‌شوند، " +"دیکشنری ترتیب اصلی آن‌ها را حفظ می‌کند." -msgid "If a row has more fields than fieldnames, the remaining data is put in a list and stored with the fieldname specified by *restkey* (which defaults to ``None``). If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with the value of *restval* (which defaults to ``None``)." -msgstr "" +msgid "" +"If a row has more fields than fieldnames, the remaining data is put in a " +"list and stored with the fieldname specified by *restkey* (which defaults to" +" ``None``). If a non-blank row has fewer fields than fieldnames, the " +"missing values are filled-in with the value of *restval* (which defaults to " +"``None``)." +msgstr "" +"اگر یک ردیف فیلدهای بیشتری نسبت به fieldnames داشته باشد، داده‌های " +"باقی‌مانده در یک فهرست قرار می‌گیرند و با نام فیلد مشخص‌شده توسط *restkey* " +"(که مقدار پیش‌فرض آن ``None`` است) ذخیره می‌شوند. اگر یک ردیف غیرخالی " +"فیلدهای کمتری نسبت به fieldnames داشته باشد، مقادیر گم‌شده با مقدار " +"*restval* (که مقدار پیش‌فرض آن ``None`` است) پر می‌شوند." -msgid "All other optional or keyword arguments are passed to the underlying :class:`reader` instance." +msgid "" +"All other optional or keyword arguments are passed to the underlying " +":class:`reader` instance." msgstr "" +"تمام سایر آرگومان‌های اختیاری یا کلیدواژه‌ای به نمونه‌ی زیربنایی " +":class:`reader` ارسال می‌شوند." -msgid "If the argument passed to *fieldnames* is an iterator, it will be coerced to a :class:`list`." +msgid "" +"If the argument passed to *fieldnames* is an iterator, it will be coerced to" +" a :class:`list`." msgstr "" +"اگر آرگومان داده‌شده به *fieldnames* یک پیمایش‌گر باشد، به یک :class:`list` " +"تبدیل می‌شود." msgid "Returned rows are now of type :class:`OrderedDict`." -msgstr "" +msgstr "ردیف‌های برگردانده‌شده اکنون از نوع :class:`OrderedDict` هستند." msgid "Returned rows are now of type :class:`dict`." -msgstr "" +msgstr "ردیف‌های برگردانده‌شده اکنون از نوع :class:`dict` هستند." msgid "" ">>> import csv\n" @@ -145,21 +324,63 @@ msgid "" ">>> print(row)\n" "{'first_name': 'John', 'last_name': 'Cleese'}" msgstr "" +">>> import csv\n" +">>> with open('names.csv', newline='') as csvfile:\n" +"... reader = csv.DictReader(csvfile)\n" +"... for row in reader:\n" +"... print(row['first_name'], row['last_name'])\n" +"...\n" +"Eric Idle\n" +"John Cleese\n" +"\n" +">>> print(row)\n" +"{'first_name': 'John', 'last_name': 'Cleese'}" msgid "where :file:`names.csv` contains:" -msgstr "" +msgstr "که :file:`names.csv` شامل موارد زیر است:" msgid "" "first_name,last_name\n" "Eric,Idle\n" "John,Cleese" msgstr "" +"first_name,last_name\n" +"Eric,Idle\n" +"John,Cleese" -msgid "Create an object which operates like a regular writer but maps dictionaries onto output rows. The *fieldnames* parameter is a :mod:`sequence ` of keys that identify the order in which values in the dictionary passed to the :meth:`~csvwriter.writerow` method are written to file *f*. The optional *restval* parameter specifies the value to be written if the dictionary is missing a key in *fieldnames*. If the dictionary passed to the :meth:`~csvwriter.writerow` method contains a key not found in *fieldnames*, the optional *extrasaction* parameter indicates what action to take. If it is set to ``'raise'``, the default value, a :exc:`ValueError` is raised. If it is set to ``'ignore'``, extra values in the dictionary are ignored. Any other optional or keyword arguments are passed to the underlying :class:`writer` instance." -msgstr "" +msgid "" +"Create an object which operates like a regular writer but maps dictionaries " +"onto output rows. The *fieldnames* parameter is a :mod:`sequence " +"` of keys that identify the order in which values in the " +"dictionary passed to the :meth:`~csvwriter.writerow` method are written to " +"file *f*. The optional *restval* parameter specifies the value to be " +"written if the dictionary is missing a key in *fieldnames*. If the " +"dictionary passed to the :meth:`~csvwriter.writerow` method contains a key " +"not found in *fieldnames*, the optional *extrasaction* parameter indicates " +"what action to take. If it is set to ``'raise'``, the default value, a " +":exc:`ValueError` is raised. If it is set to ``'ignore'``, extra values in " +"the dictionary are ignored. Any other optional or keyword arguments are " +"passed to the underlying :class:`writer` instance." +msgstr "" +"یک شیء ایجاد کنید که مانند یک نویسنده معمولی عمل می‌کند، اما دیکشنری‌ها را " +"به ردیف‌های خروجی نگاشت می‌کند. پارامتر *fieldnames* یک :mod:`دنباله " +"` از کلیدها است که ترتیب نوشتن مقادیر موجود در دیکشنری " +"ارسال‌شده به متد :meth:`~csvwriter.writerow` در فایل *f* را مشخص می‌کند. " +"پارامتر اختیاری *restval* مقداری را مشخص می‌کند که در صورت نبودن کلیدی از " +"*fieldnames* در دیکشنری، نوشته می‌شود. اگر دیکشنری ارسال‌شده به متد " +":meth:`~csvwriter.writerow` شامل کلیدی باشد که در *fieldnames* یافت نمی‌شود،" +" پارامتر اختیاری *extrasaction* مشخص می‌کند که چه عملی باید انجام شود. اگر " +"روی ``'raise'``، که مقدار پیش‌فرض است، تنظیم شود، یک :exc:`ValueError` پرتاب" +" می‌شود. اگر روی ``'ignore'`` تنظیم شود، مقادیر اضافی در دیکشنری نادیده " +"گرفته می‌شوند. سایر آرگومان‌های اختیاری یا کلیدواژه‌ای به نمونه‌ی زیرین " +":class:`writer` ارسال می‌شوند." -msgid "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter of the :class:`DictWriter` class is not optional." +msgid "" +"Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " +"of the :class:`DictWriter` class is not optional." msgstr "" +"توجه داشته باشید که برخلاف کلاس :class:`DictReader`، پارامتر *fieldnames* در" +" کلاس :class:`DictWriter` اختیاری نیست." msgid "" "import csv\n" @@ -173,9 +394,19 @@ msgid "" " writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" " writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" msgstr "" +"import csv\n" +"\n" +"with open('names.csv', 'w', newline='') as csvfile:\n" +" fieldnames = ['first_name', 'last_name']\n" +" writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n" +"\n" +" writer.writeheader()\n" +" writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})\n" +" writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" +" writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" msgid "which writes :file:`names.csv` containing:" -msgstr "" +msgstr "که :file:`names.csv` را با محتوای زیر می‌نویسد:" msgid "" "first_name,last_name\n" @@ -183,12 +414,33 @@ msgid "" "Lovely,Spam\n" "Wonderful,Spam" msgstr "" +"first_name,last_name\n" +"Baked,Beans\n" +"Lovely,Spam\n" +"Wonderful,Spam" -msgid "The :class:`Dialect` class is a container class whose attributes contain information for how to handle doublequotes, whitespace, delimiters, etc. Due to the lack of a strict CSV specification, different applications produce subtly different CSV data. :class:`Dialect` instances define how :class:`reader` and :class:`writer` instances behave." -msgstr "" +msgid "" +"The :class:`Dialect` class is a container class whose attributes contain " +"information for how to handle doublequotes, whitespace, delimiters, etc. Due" +" to the lack of a strict CSV specification, different applications produce " +"subtly different CSV data. :class:`Dialect` instances define how " +":class:`reader` and :class:`writer` instances behave." +msgstr "" +"کلاس :class:`Dialect` یک کلاس دربرگیرنده است که ویژگی‌های آن حاوی اطلاعاتی " +"درباره نحوه مدیریت علامت‌های نقل‌قول دوتایی، فضای خالی، جداکننده‌ها و غیره " +"است. به دلیل نبود یک مشخصه دقیق برای CSV، برنامه‌های مختلف داده‌های CSV با " +"تفاوت‌های ظریف تولید می‌کنند. نمونه‌های :class:`Dialect` نحوه رفتار " +"نمونه‌های :class:`reader` و :class:`writer` را تعریف می‌کنند." -msgid "All available :class:`Dialect` names are returned by :func:`list_dialects`, and they can be registered with specific :class:`reader` and :class:`writer` classes through their initializer (``__init__``) functions like this::" +msgid "" +"All available :class:`Dialect` names are returned by :func:`list_dialects`, " +"and they can be registered with specific :class:`reader` and :class:`writer`" +" classes through their initializer (``__init__``) functions like this::" msgstr "" +"تمام نام‌های موجود :class:`Dialect` توسط :func:`list_dialects` برگردانده " +"می‌شوند، و می‌توان آن‌ها را با کلاس‌های مشخص :class:`reader` و " +":class:`writer` از طریق توابع مقداردهی اولیه (``__init__``) آن‌ها به این " +"صورت ثبت کرد::" msgid "" "import csv\n" @@ -196,45 +448,100 @@ msgid "" "with open('students.csv', 'w', newline='') as csvfile:\n" " writer = csv.writer(csvfile, dialect='unix')" msgstr "" +"import csv\n" +"\n" +"with open('students.csv', 'w', newline='') as csvfile:\n" +" writer = csv.writer(csvfile, dialect='unix')" -msgid "The :class:`excel` class defines the usual properties of an Excel-generated CSV file. It is registered with the dialect name ``'excel'``." +msgid "" +"The :class:`excel` class defines the usual properties of an Excel-generated " +"CSV file. It is registered with the dialect name ``'excel'``." msgstr "" +"کلاس :class:`excel` ویژگی‌های معمول یک فایل CSV تولیدشده توسط Excel را تعریف" +" می‌کند. این کلاس با نام گویش (dialect) ``'excel'`` ثبت شده است." -msgid "The :class:`excel_tab` class defines the usual properties of an Excel-generated TAB-delimited file. It is registered with the dialect name ``'excel-tab'``." +msgid "" +"The :class:`excel_tab` class defines the usual properties of an Excel-" +"generated TAB-delimited file. It is registered with the dialect name " +"``'excel-tab'``." msgstr "" +"کلاس :class:`excel_tab` ویژگی‌های معمول یک فایل جداشده با TAB تولیدشده توسط " +"اکسل را تعریف می‌کند. این کلاس با نام گویش ``'excel-tab'`` ثبت شده است." -msgid "The :class:`unix_dialect` class defines the usual properties of a CSV file generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and quoting all fields. It is registered with the dialect name ``'unix'``." +msgid "" +"The :class:`unix_dialect` class defines the usual properties of a CSV file " +"generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " +"quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" +"کلاس :class:`unix_dialect` ویژگی‌های معمول یک فایل CSV تولیدشده در " +"سیستم‌های UNIX را تعریف می‌کند؛ یعنی استفاده از ``'\\n'`` به‌عنوان " +"پایان‌دهنده‌ی خط و در علامت نقل‌قول قرار دادن همه‌ی فیلدها. این کلاس با نام " +"گویش ``'unix'`` ثبت شده است." msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." -msgstr "" +msgstr "کلاس :class:`Sniffer` برای استنتاج قالب یک فایل CSV استفاده می‌شود." msgid "The :class:`Sniffer` class provides two methods:" -msgstr "" +msgstr "کلاس :class:`Sniffer` دو متد ارائه می‌دهد:" -msgid "Analyze the given *sample* and return a :class:`Dialect` subclass reflecting the parameters found. If the optional *delimiters* parameter is given, it is interpreted as a string containing possible valid delimiter characters." +msgid "" +"Analyze the given *sample* and return a :class:`Dialect` subclass reflecting" +" the parameters found. If the optional *delimiters* parameter is given, it " +"is interpreted as a string containing possible valid delimiter characters." msgstr "" +"*sample* داده‌شده را تحلیل کنید و زیرکلاسی از :class:`Dialect` برگردانید که " +"پارامترهای یافت‌شده را بازتاب می‌دهد. اگر پارامتر اختیاری *delimiters* داده " +"شده باشد، به‌عنوان رشته‌ای حاوی نویسه‌هایی تفسیر می‌شود که ممکن است " +"جداکننده‌های معتبری باشند." -msgid "If several delimiters fit the sample equally well --- for example if both ``','`` and ``';'`` split every row consistently --- the delimiters ``','``, ``'\\t'``, ``';'``, ``' '`` and ``':'`` are preferred, in this order, no matter how many times each of them occurs." +msgid "" +"If several delimiters fit the sample equally well --- for example if both " +"``','`` and ``';'`` split every row consistently --- the delimiters ``','``," +" ``'\\t'``, ``';'``, ``' '`` and ``':'`` are preferred, in this order, no " +"matter how many times each of them occurs." msgstr "" +"اگر چند جداکننده به یک اندازه با نمونه تناسب داشته باشند — برای مثال اگر هر " +"دو ``','`` و ``';'`` هر ردیف را به‌طور سازگار تقسیم کنند — جداکننده‌های " +"``','``، ``'\\t'``، ``';'``، ``' '`` و ``':'`` به همین ترتیب ترجیح داده " +"می‌شوند، صرف‌نظر از تعداد دفعات وقوع هرکدام." -msgid "Analyze the sample text (presumed to be in CSV format) and return :const:`True` if the first row appears to be a series of column headers. Inspecting each column, one of two key criteria will be considered to estimate if the sample contains a header:" +msgid "" +"Analyze the sample text (presumed to be in CSV format) and return " +":const:`True` if the first row appears to be a series of column headers. " +"Inspecting each column, one of two key criteria will be considered to " +"estimate if the sample contains a header:" msgstr "" +"متن نمونه را تحلیل می‌کند (فرض می‌شود در قالب CSV باشد) و اگر به نظر برسد که" +" ردیف اول مجموعه‌ای از سرستون‌ها است، :const:`True` را برمی‌گرداند. در بررسی " +"هر ستون، یکی از دو معیار کلیدی برای تخمین اینکه آیا نمونه حاوی سرستون است در" +" نظر گرفته می‌شود:" msgid "the second through n-th rows contain numeric values" -msgstr "" +msgstr "ردیف‌های دوم تا n-ام شامل مقادیر عددی هستند" -msgid "the second through n-th rows contain strings where at least one value's length differs from that of the putative header of that column." +msgid "" +"the second through n-th rows contain strings where at least one value's " +"length differs from that of the putative header of that column." msgstr "" +"ردیف‌های دوم تا n-ام شامل رشته‌هایی هستند که در آن‌ها طول دست‌کم یک مقدار با " +"طول سرآیند فرضی آن ستون متفاوت است." -msgid "Twenty-one rows after the header are sampled; if more than half of the columns + rows meet the criteria, :const:`True` is returned." +msgid "" +"Twenty-one rows after the header are sampled; if more than half of the " +"columns + rows meet the criteria, :const:`True` is returned." msgstr "" +"۲۱ ردیف پس از سرآیند نمونه‌برداری می‌شوند؛ اگر بیش از نیمی از ستون‌ها + " +"ردیف‌ها معیارها را برآورده کنند، :const:`True` برگردانده می‌شود." -msgid "This method is a rough heuristic and may produce both false positives and negatives." +msgid "" +"This method is a rough heuristic and may produce both false positives and " +"negatives." msgstr "" +"این متد یک هیوریستیک سرانگشتی است و ممکن است هم مثبت‌های کاذب و هم منفی‌های " +"کاذب تولید کند." msgid "An example for :class:`Sniffer` use::" -msgstr "" +msgstr "مثالی برای استفاده از :class:`Sniffer`::" msgid "" "with open('example.csv', newline='') as csvfile:\n" @@ -243,165 +550,381 @@ msgid "" " reader = csv.reader(csvfile, dialect)\n" " # ... process CSV file contents here ..." msgstr "" +"with open('example.csv', newline='') as csvfile:\n" +" dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" +" csvfile.seek(0)\n" +" reader = csv.reader(csvfile, dialect)\n" +" # ... process CSV file contents here ..." msgid "The :mod:`!csv` module defines the following constants:" -msgstr "" +msgstr "ماژول :mod:`!csv` ثابت‌های زیر را تعریف می‌کند:" msgid "Instructs :class:`writer` objects to quote all fields." msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که همه فیلدها را داخل علامت نقل‌قول " +"قرار دهند." -msgid "Instructs :class:`writer` objects to only quote those fields which contain special characters such as *delimiter*, *quotechar*, ``'\\r'``, ``'\\n'`` or any of the characters in *lineterminator*." +msgid "" +"Instructs :class:`writer` objects to only quote those fields which contain " +"special characters such as *delimiter*, *quotechar*, ``'\\r'``, ``'\\n'`` or" +" any of the characters in *lineterminator*." msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که فقط فیلدهایی را که حاوی نویسه‌های " +"خاصی مانند *delimiter*، *quotechar*، ``'\\r'``، ``'\\n'`` یا هر یک از " +"نویسه‌های موجود در *lineterminator* هستند، داخل علامت نقل‌قول قرار دهند." msgid "Instructs :class:`writer` objects to quote all non-numeric fields." msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که تمام فیلدهای غیرعددی را در علامت " +"نقل‌قول قرار دهند." -msgid "Instructs :class:`reader` objects to convert all non-quoted fields to type :class:`float`." +msgid "" +"Instructs :class:`reader` objects to convert all non-quoted fields to type " +":class:`float`." msgstr "" +"به اشیای :class:`reader` دستور می‌دهد که همه فیلدهای بدون علامت نقل‌قول را " +"به نوع :class:`float` تبدیل کنند." -msgid "Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, or :class:`~enum.IntEnum`, have a string representation that cannot be converted to :class:`float`. They cannot be read in the :data:`QUOTE_NONNUMERIC` and :data:`QUOTE_STRINGS` modes." +msgid "" +"Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, or " +":class:`~enum.IntEnum`, have a string representation that cannot be " +"converted to :class:`float`. They cannot be read in the " +":data:`QUOTE_NONNUMERIC` and :data:`QUOTE_STRINGS` modes." msgstr "" +"برخی از انواع عددی، مانند :class:`bool`، :class:`~fractions.Fraction` یا " +":class:`~enum.IntEnum`، نمایش رشته‌ای دارند که نمی‌توان آن را به " +":class:`float` تبدیل کرد. این موارد را نمی‌توان در حالت‌های " +":data:`QUOTE_NONNUMERIC` و :data:`QUOTE_STRINGS` خواند." -msgid "Instructs :class:`writer` objects to never quote fields. When the current *delimiter*, *quotechar*, *escapechar*, ``'\\r'``, ``'\\n'`` or any of the characters in *lineterminator* occurs in output data it is preceded by the current *escapechar* character. If *escapechar* is not set, the writer will raise :exc:`Error` if any characters that require escaping are encountered. Set *quotechar* to ``None`` to prevent its escaping." -msgstr "" +msgid "" +"Instructs :class:`writer` objects to never quote fields. When the current " +"*delimiter*, *quotechar*, *escapechar*, ``'\\r'``, ``'\\n'`` or any of the " +"characters in *lineterminator* occurs in output data it is preceded by the " +"current *escapechar* character. If *escapechar* is not set, the writer will " +"raise :exc:`Error` if any characters that require escaping are encountered. " +"Set *quotechar* to ``None`` to prevent its escaping." +msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که هرگز فیلدها را با علامت نقل‌قول " +"محصور نکنند. هنگامی که در حالت فعلی، *delimiter*، *quotechar*، *escapechar*،" +" ``'\\r'``، ``'\\n'`` یا هر یک از نویسه‌های موجود در *lineterminator* در " +"داده خروجی ظاهر شود، نویسه‌ی *escapechar* فعلی پیش از آن قرار می‌گیرد. اگر " +"*escapechar* تنظیم نشده باشد، شیء writer در صورت مواجهه با هر نویسه‌ای که " +"نیاز به خنثی کردن دارد، استثنای :exc:`Error` را پرتاب می‌کند. برای جلوگیری " +"از خنثی شدن *quotechar*، آن را روی ``None`` تنظیم کنید." -msgid "Instructs :class:`reader` objects to perform no special processing of quote characters." +msgid "" +"Instructs :class:`reader` objects to perform no special processing of quote " +"characters." msgstr "" +"به اشیای :class:`reader` دستور می‌دهد که هیچ پردازش خاصی روی نویسه‌های " +"نقل‌قول انجام ندهند." -msgid "Instructs :class:`writer` objects to quote all fields which are not ``None``. This is similar to :data:`QUOTE_ALL`, except that if a field value is ``None`` an empty (unquoted) string is written." +msgid "" +"Instructs :class:`writer` objects to quote all fields which are not " +"``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " +"value is ``None`` an empty (unquoted) string is written." msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که تمام فیلدهایی را که ``None`` " +"نیستند، در علامت نقل‌قول قرار دهند. این مشابه :data:`QUOTE_ALL` است، با این " +"تفاوت که اگر مقدار یک فیلد ``None`` باشد، یک رشته خالی (بدون علامت نقل‌قول) " +"نوشته می‌شود." -msgid "Instructs :class:`reader` objects to interpret an empty (unquoted) field as ``None`` and to otherwise behave as :data:`QUOTE_ALL`." +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) field as " +"``None`` and to otherwise behave as :data:`QUOTE_ALL`." msgstr "" +"به اشیای :class:`reader` دستور می‌دهد که یک فیلد خالی (بدون علامت نقل‌قول) " +"را به‌عنوان ``None`` تفسیر کنند و در غیر این صورت مانند :data:`QUOTE_ALL` " +"رفتار کنند." -msgid "Instructs :class:`writer` objects to always place quotes around fields which are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a field value is ``None`` an empty (unquoted) string is written." +msgid "" +"Instructs :class:`writer` objects to always place quotes around fields which" +" are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a" +" field value is ``None`` an empty (unquoted) string is written." msgstr "" +"به اشیای :class:`writer` دستور می‌دهد که همیشه فیلدهایی را که رشته هستند در " +"علامت نقل‌قول قرار دهند. این مشابه :data:`QUOTE_NONNUMERIC` است، با این " +"تفاوت که اگر مقدار یک فیلد ``None`` باشد، یک رشته‌ی خالی (بدون علامت " +"نقل‌قول) نوشته می‌شود." -msgid "Instructs :class:`reader` objects to interpret an empty (unquoted) string as ``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) string as" +" ``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" +"به اشیای :class:`reader` دستور می‌دهد که یک رشته خالی (بدون علامت نقل‌قول) " +"را به‌عنوان ``None`` تفسیر کنند و در غیر این صورت مانند " +":data:`QUOTE_NONNUMERIC` رفتار کنند." msgid "The :mod:`!csv` module defines the following exception:" -msgstr "" +msgstr "ماژول :mod:`!csv` استثنای زیر را تعریف می‌کند:" msgid "Raised by any of the functions when an error is detected." -msgstr "" +msgstr "در صورت تشخیص خطا، توسط هر یک از توابع پرتاب می‌شود." msgid "Dialects and Formatting Parameters" -msgstr "" +msgstr "گویش‌ها و پارامترهای قالب‌بندی" -msgid "To make it easier to specify the format of input and output records, specific formatting parameters are grouped together into dialects. A dialect is a subclass of the :class:`Dialect` class containing various attributes describing the format of the CSV file. When creating :class:`reader` or :class:`writer` objects, the programmer can specify a string or a subclass of the :class:`Dialect` class as the dialect parameter. In addition to, or instead of, the *dialect* parameter, the programmer can also specify individual formatting parameters, which have the same names as the attributes defined below for the :class:`Dialect` class." -msgstr "" +msgid "" +"To make it easier to specify the format of input and output records, " +"specific formatting parameters are grouped together into dialects. A " +"dialect is a subclass of the :class:`Dialect` class containing various " +"attributes describing the format of the CSV file. When creating " +":class:`reader` or :class:`writer` objects, the programmer can specify a " +"string or a subclass of the :class:`Dialect` class as the dialect parameter." +" In addition to, or instead of, the *dialect* parameter, the programmer can" +" also specify individual formatting parameters, which have the same names as" +" the attributes defined below for the :class:`Dialect` class." +msgstr "" +"برای آسان‌تر کردن تعیین قالب رکوردهای ورودی و خروجی، پارامترهای قالب‌بندی " +"خاصی در گویش‌ها (dialects) گروه‌بندی شده‌اند. یک گویش، زیرکلاسی از کلاس" +" :class:`Dialect` است که شامل ویژگی‌های مختلفی است که قالب فایل CSV را توصیف" +" می‌کنند. هنگام ایجاد اشیای :class:`reader` یا :class:`writer`، برنامه‌نویس " +"می‌تواند یک رشته یا زیرکلاسی از کلاس :class:`Dialect` را به‌عنوان پارامتر " +"dialect مشخص کند. علاوه بر، یا به‌جای، پارامتر *dialect*، برنامه‌نویس همچنین" +" می‌تواند پارامترهای قالب‌بندی جداگانه‌ای را مشخص کند که نام‌هایی مشابه " +"ویژگی‌های تعریف‌شده در زیر برای کلاس :class:`Dialect` دارند." msgid "Dialects support the following attributes:" -msgstr "" +msgstr "گویش‌ها از ویژگی‌های زیر پشتیبانی می‌کنند:" -msgid "A one-character string used to separate fields. It defaults to ``','``." +msgid "" +"A one-character string used to separate fields. It defaults to ``','``." msgstr "" +"یک رشته تک‌نویسه‌ای که برای جدا کردن فیلدها استفاده می‌شود. پیش‌فرض آن " +"``','`` است." -msgid "Controls how instances of *quotechar* appearing inside a field should themselves be quoted. When :const:`True`, the character is doubled. When :const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It defaults to :const:`True`." +msgid "" +"Controls how instances of *quotechar* appearing inside a field should " +"themselves be quoted. When :const:`True`, the character is doubled. When " +":const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It" +" defaults to :const:`True`." msgstr "" +"کنترل می‌کند که نمونه‌های *quotechar* که درون یک فیلد ظاهر می‌شوند، خود " +"چگونه باید نقل‌قول شوند. هنگامی که :const:`True` باشد، نویسه دو برابر " +"می‌شود. هنگامی که :const:`False` باشد، از *escapechar* به‌عنوان پیشوندی برای" +" *quotechar* استفاده می‌شود. مقدار پیش‌فرض آن :const:`True` است." -msgid "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :exc:`Error` is raised if a *quotechar* is found in a field." +msgid "" +"On output, if *doublequote* is :const:`False` and no *escapechar* is set, " +":exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" +"در خروجی، اگر *doublequote* :const:`False` باشد و هیچ *escapechar* تنظیم " +"نشده باشد، در صورتی که یک *quotechar* در یک فیلد یافت شود، :exc:`Error` " +"پرتاب می‌شود." -msgid "A one-character string used by the writer to escape characters that require escaping:" +msgid "" +"A one-character string used by the writer to escape characters that require " +"escaping:" msgstr "" +"یک رشته‌ی تک‌نویسه‌ای که نویسنده برای خنثی کردن نویسه‌هایی که نیاز به " +"خنثی‌سازی دارند از آن استفاده می‌کند:" -msgid "the *delimiter*, the *quotechar*, ``'\\r'``, ``'\\n'`` and any of the characters in *lineterminator* are escaped if *quoting* is set to :const:`QUOTE_NONE`;" +msgid "" +"the *delimiter*, the *quotechar*, ``'\\r'``, ``'\\n'`` and any of the " +"characters in *lineterminator* are escaped if *quoting* is set to " +":const:`QUOTE_NONE`;" msgstr "" +"اگر *quoting* روی :const:`QUOTE_NONE` تنظیم شده باشد، *delimiter*، " +"*quotechar*، ``'\\r'``، ``'\\n'`` و هر یک از نویسه‌های موجود در " +"*lineterminator* خنثی می‌شوند؛" msgid "the *quotechar* is escaped if *doublequote* is :const:`False`;" -msgstr "" +msgstr "اگر *doublequote* برابر :const:`False` باشد، *quotechar* خنثی می‌شود؛" msgid "the *escapechar* itself." -msgstr "" +msgstr "خود *escapechar*." -msgid "On reading, the *escapechar* removes any special meaning from the following character. It defaults to :const:`None`, which disables escaping." +msgid "" +"On reading, the *escapechar* removes any special meaning from the following " +"character. It defaults to :const:`None`, which disables escaping." msgstr "" +"هنگام خواندن، *escapechar* هرگونه معنای خاصی را از نویسه‌ی بعدی می‌گیرد. " +"مقدار پیش‌فرض آن :const:`None` است که خنثی‌سازی را غیرفعال می‌کند." msgid "An empty *escapechar* is not allowed." -msgstr "" +msgstr "*escapechar* خالی مجاز نیست." -msgid "The string used to terminate lines produced by the :class:`writer`. It defaults to ``'\\r\\n'``." +msgid "" +"The string used to terminate lines produced by the :class:`writer`. It " +"defaults to ``'\\r\\n'``." msgstr "" +"رشته‌ای که برای پایان‌دادن به خطوط تولیدشده توسط :class:`writer` استفاده " +"می‌شود. مقدار پیش‌فرض آن ``'\\r\\n'`` است." -msgid "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` as end-of-line, and ignores *lineterminator*. This behavior may change in the future." +msgid "" +"The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'``" +" as end-of-line, and ignores *lineterminator*. This behavior may change in " +"the future." msgstr "" +":class:`reader` به‌صورت سخت‌کد (hard-coded) برای تشخیص ``'\\r'`` یا " +"``'\\n'`` به‌عنوان پایان خط تنظیم شده است و *lineterminator* را نادیده " +"می‌گیرد. این رفتار ممکن است در آینده تغییر کند." -msgid "A one-character string used to quote fields containing special characters, such as the *delimiter* or the *quotechar*, or which contain new-line characters (``'\\r'``, ``'\\n'`` or any of the characters in *lineterminator*). It defaults to ``'\"'``. Can be set to ``None`` to prevent escaping ``'\"'`` if *quoting* is set to :const:`QUOTE_NONE`." -msgstr "" +msgid "" +"A one-character string used to quote fields containing special characters, " +"such as the *delimiter* or the *quotechar*, or which contain new-line " +"characters (``'\\r'``, ``'\\n'`` or any of the characters in " +"*lineterminator*). It defaults to ``'\"'``. Can be set to ``None`` to " +"prevent escaping ``'\"'`` if *quoting* is set to :const:`QUOTE_NONE`." +msgstr "" +"یک رشته‌ی تک‌نویسه‌ای که برای نقل‌قول کردن فیلدهای حاوی نویسه‌های خاص، مانند" +" *delimiter* یا *quotechar*، یا فیلدهای حاوی نویسه‌های خط جدید (``'\\r'``، " +"``'\\n'`` یا هر یک از نویسه‌های موجود در *lineterminator*) استفاده می‌شود. " +"مقدار پیش‌فرض آن ``'\"'`` است. در صورتی که *quoting* روی :const:`QUOTE_NONE`" +" تنظیم شده باشد، می‌توان آن را روی ``None`` تنظیم کرد تا از خنثی کردن " +"``'\"'`` جلوگیری شود." msgid "An empty *quotechar* is not allowed." -msgstr "" +msgstr "*quotechar* خالی مجاز نیست." -msgid "Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL` if *quotechar* is not ``None``, and :const:`QUOTE_NONE` otherwise." +msgid "" +"Controls when quotes should be generated by the writer and recognised by the" +" reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL` if *quotechar* is not " +"``None``, and :const:`QUOTE_NONE` otherwise." msgstr "" +"کنترل می‌کند که چه زمانی علامت‌های نقل‌قول باید توسط نویسنده تولید و توسط " +"خواننده شناسایی شوند. این مقدار می‌تواند هر یک از :ref:`ثابت‌های QUOTE_\\* " +"` را بپذیرد و اگر *quotechar* برابر ``None`` نباشد، پیش‌فرض " +"آن :const:`QUOTE_MINIMAL` است و در غیر این صورت :const:`QUOTE_NONE` است." -msgid "When :const:`True`, spaces immediately following the *delimiter* are ignored. The default is :const:`False`. When combining ``delimiter=' '`` with ``skipinitialspace=True``, unquoted empty fields are not allowed." +msgid "" +"When :const:`True`, spaces immediately following the *delimiter* are " +"ignored. The default is :const:`False`. When combining ``delimiter=' '`` " +"with ``skipinitialspace=True``, unquoted empty fields are not allowed." msgstr "" +"هنگامی که :const:`True` باشد، فاصله‌های بلافاصله پس از *جداکننده* نادیده " +"گرفته می‌شوند. مقدار پیش‌فرض :const:`False` است. هنگام ترکیب ``delimiter=' " +"'`` با ``skipinitialspace=True``، فیلدهای خالی بدون علامت نقل‌قول مجاز " +"نیستند." -msgid "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is ``False``." +msgid "" +"When ``True``, raise exception :exc:`Error` on bad CSV input. The default is" +" ``False``." msgstr "" +"هنگامی که ``True`` باشد، در صورت ورودی CSV نامعتبر، استثنای :exc:`Error` " +"پرتاب می‌شود. مقدار پیش‌فرض ``False`` است." msgid "Reader Objects" -msgstr "" +msgstr "اشیاء خواننده (Reader)" -msgid "Reader objects (:class:`DictReader` instances and objects returned by the :func:`reader` function) have the following public methods:" +msgid "" +"Reader objects (:class:`DictReader` instances and objects returned by the " +":func:`reader` function) have the following public methods:" msgstr "" +"اشیای Reader (نمونه‌های :class:`DictReader` و اشیای برگردانده‌شده از تابع " +":func:`reader`) دارای متدهای عمومی زیر هستند:" -msgid "Return the next row of the reader's iterable object as a list (if the object was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` instance), parsed according to the current :class:`Dialect`. Usually you should call this as ``next(reader)``." +msgid "" +"Return the next row of the reader's iterable object as a list (if the object" +" was returned from :func:`reader`) or a dict (if it is a :class:`DictReader`" +" instance), parsed according to the current :class:`Dialect`. Usually you " +"should call this as ``next(reader)``." msgstr "" +"ردیف بعدی شیء پیمایش‌پذیر reader را به‌عنوان یک فهرست (اگر شیء از " +":func:`reader` بازگردانده شده باشد) یا یک دیکشنری (اگر یک نمونه " +":class:`DictReader` باشد)، تجزیه‌شده بر اساس :class:`Dialect` جاری، " +"برمی‌گرداند. معمولاً باید آن را به‌صورت ``next(reader)`` فراخوانی کنید." msgid "Reader objects have the following public attributes:" -msgstr "" +msgstr "اشیای Reader دارای ویژگی‌های عمومی زیر هستند:" msgid "A read-only description of the dialect in use by the parser." msgstr "" +"توضیحی فقط‌خواندنی درباره‌ی گویش (dialect) مورد استفاده‌ی پارسر " +"(parser)." -msgid "The number of lines read from the source iterator. This is not the same as the number of records returned, as records can span multiple lines." +msgid "" +"The number of lines read from the source iterator. This is not the same as " +"the number of records returned, as records can span multiple lines." msgstr "" +"تعداد خطوط خوانده‌شده از پیمایش‌گر منبع. این تعداد با تعداد رکوردهای " +"برگردانده‌شده یکسان نیست، زیرا رکوردها می‌توانند شامل چندین خط باشند." msgid "DictReader objects have the following public attribute:" -msgstr "" +msgstr "اشیای DictReader ویژگی عمومی زیر را دارند:" -msgid "If not passed as a parameter when creating the object, this attribute is initialized upon first access or when the first record is read from the file." +msgid "" +"If not passed as a parameter when creating the object, this attribute is " +"initialized upon first access or when the first record is read from the " +"file." msgstr "" +"اگر هنگام ایجاد شیء به‌عنوان پارامتر ارسال نشده باشد، این ویژگی در اولین " +"دسترسی یا هنگام خواندن اولین رکورد از فایل مقداردهی اولیه می‌شود." msgid "Writer Objects" -msgstr "" +msgstr "اشیای نویسنده" -msgid ":class:`writer` objects (:class:`DictWriter` instances and objects returned by the :func:`writer` function) have the following public methods. A *row* must be an iterable of strings or numbers for :class:`writer` objects and a dictionary mapping fieldnames to strings or numbers (by passing them through :func:`str` first) for :class:`DictWriter` objects. Note that complex numbers are written out surrounded by parens. This may cause some problems for other programs which read CSV files (assuming they support complex numbers at all)." -msgstr "" +msgid "" +":class:`writer` objects (:class:`DictWriter` instances and objects returned " +"by the :func:`writer` function) have the following public methods. A *row* " +"must be an iterable of strings or numbers for :class:`writer` objects and a " +"dictionary mapping fieldnames to strings or numbers (by passing them through" +" :func:`str` first) for :class:`DictWriter` objects. Note that complex " +"numbers are written out surrounded by parens. This may cause some problems " +"for other programs which read CSV files (assuming they support complex " +"numbers at all)." +msgstr "" +"اشیای :class:`writer` (نمونه‌های :class:`DictWriter` و اشیایی که تابع " +":func:`writer` برمی‌گرداند) دارای متدهای عمومی زیر هستند. برای اشیای " +":class:`writer`، یک *ردیف* باید یک پیمایش‌پذیر از رشته‌ها یا اعداد باشد و برای" +" اشیای :class:`DictWriter` باید یک دیکشنری باشد که نام فیلدها را به رشته‌ها" +" یا اعداد نگاشت می‌کند (با اعمال :func:`str` روی آن‌ها در ابتدا). توجه داشته" +" باشید که اعداد مختلط با پرانتز در اطرافشان نوشته می‌شوند. این موضوع ممکن " +"است برای برنامه‌های دیگری که فایل‌های CSV را می‌خوانند (اگر اصلاً از اعداد " +"مختلط پشتیبانی کنند) مشکلاتی ایجاد کند." -msgid "Write the *row* parameter to the writer's file object, formatted according to the current :class:`Dialect`. Return the return value of the call to the *write* method of the underlying file object." +msgid "" +"Write the *row* parameter to the writer's file object, formatted according " +"to the current :class:`Dialect`. Return the return value of the call to the " +"*write* method of the underlying file object." msgstr "" +"پارامتر *row* را در شیء فایلِ نویسنده، با قالب‌بندی مطابق :class:`Dialect` " +"جاری بنویسید. مقدار بازگشتیِ فراخوانی متد *write* شیء فایل زیربنایی را " +"برگردانید." msgid "Added support of arbitrary iterables." -msgstr "" +msgstr "پشتیبانی از پیمایش‌پذیرهای دلخواه افزوده شد." -msgid "Write all elements in *rows* (an iterable of *row* objects as described above) to the writer's file object, formatted according to the current dialect." +msgid "" +"Write all elements in *rows* (an iterable of *row* objects as described " +"above) to the writer's file object, formatted according to the current " +"dialect." msgstr "" +"تمام عناصر موجود در *rows* (یک پیمایش‌پذیر از اشیای *row* همان‌گونه که در " +"بالا توضیح داده شد) را در شیء فایل نویسنده می‌نویسد، به‌صورت قالب‌بندی‌شده " +"بر اساس گویش (dialect) جاری." msgid "Writer objects have the following public attribute:" -msgstr "" +msgstr "اشیای Writer دارای ویژگی عمومی زیر هستند:" msgid "A read-only description of the dialect in use by the writer." -msgstr "" +msgstr "توضیحی فقط‌خواندنی از گویش (dialect) که نویسنده از آن استفاده می‌کند." msgid "DictWriter objects have the following public method:" -msgstr "" +msgstr "اشیای DictWriter دارای متد عمومی زیر هستند:" -msgid "Write a row with the field names (as specified in the constructor) to the writer's file object, formatted according to the current dialect. Return the return value of the :meth:`csvwriter.writerow` call used internally." +msgid "" +"Write a row with the field names (as specified in the constructor) to the " +"writer's file object, formatted according to the current dialect. Return the" +" return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" +"ردیفی شامل نام فیلدها (همان‌طور که در سازنده مشخص شده است) را در شیء فایلِ " +"نویسنده بنویسید؛ این ردیف مطابق گویش (dialect) جاری قالب‌بندی می‌شود. مقدار" +" بازگشتیِ فراخوانی داخلی :meth:`csvwriter.writerow` را برگردانید." -msgid ":meth:`writeheader` now also returns the value returned by the :meth:`csvwriter.writerow` method it uses internally." +msgid "" +":meth:`writeheader` now also returns the value returned by the " +":meth:`csvwriter.writerow` method it uses internally." msgstr "" +":meth:`writeheader` اکنون نیز مقداری را که متد :meth:`csvwriter.writerow`، " +"که به‌صورت داخلی استفاده می‌شود، برمی‌گرداند، برمی‌گرداند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "The simplest example of reading a CSV file::" -msgstr "" +msgstr "ساده‌ترین مثال برای خواندن یک فایل CSV::" msgid "" "import csv\n" @@ -410,9 +933,14 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('some.csv', newline='') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" msgid "Reading a file with an alternate format::" -msgstr "" +msgstr "خواندن یک فایل با قالب جایگزین::" msgid "" "import csv\n" @@ -421,9 +949,14 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)\n" +" for row in reader:\n" +" print(row)" msgid "The corresponding simplest possible writing example is::" -msgstr "" +msgstr "ساده‌ترین مثال ممکن برای نوشتن، متناظر با آن، به این صورت است::" msgid "" "import csv\n" @@ -431,9 +964,21 @@ msgid "" " writer = csv.writer(f)\n" " writer.writerows(someiterable)" msgstr "" +"import csv\n" +"with open('some.csv', 'w', newline='') as f:\n" +" writer = csv.writer(f)\n" +" writer.writerows(someiterable)" -msgid "Since :func:`open` is used to open a CSV file for reading, the file will by default be decoded into unicode using the system default encoding (see :func:`locale.getencoding`). To decode a file using a different encoding, use the ``encoding`` argument of open::" +msgid "" +"Since :func:`open` is used to open a CSV file for reading, the file will by " +"default be decoded into unicode using the system default encoding (see " +":func:`locale.getencoding`). To decode a file using a different encoding, " +"use the ``encoding`` argument of open::" msgstr "" +"از آنجا که :func:`open` برای باز کردن یک فایل CSV جهت خواندن استفاده می‌شود،" +" فایل به‌طور پیش‌فرض با استفاده از کدگذاری پیش‌فرض سیستم به یونیکد کدگشایی " +"می‌شود (به :func:`locale.getencoding` مراجعه کنید). برای کدگشایی یک فایل با " +"کدگذاری متفاوت، از آرگومان ``encoding`` در open استفاده کنید::" msgid "" "import csv\n" @@ -442,12 +987,21 @@ msgid "" " for row in reader:\n" " print(row)" msgstr "" +"import csv\n" +"with open('some.csv', newline='', encoding='utf-8') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" -msgid "The same applies to writing in something other than the system default encoding: specify the encoding argument when opening the output file." +msgid "" +"The same applies to writing in something other than the system default " +"encoding: specify the encoding argument when opening the output file." msgstr "" +"همین امر در مورد نوشتن با کدگذاری غیر از کدگذاری پیش‌فرض سیستم نیز صدق " +"می‌کند: هنگام باز کردن فایل خروجی، آرگومان encoding را مشخص کنید." msgid "Registering a new dialect::" -msgstr "" +msgstr "ثبت یک گویش جدید::" msgid "" "import csv\n" @@ -455,9 +1009,15 @@ msgid "" "with open('passwd', newline='') as f:\n" " reader = csv.reader(f, 'unixpwd')" msgstr "" +"import csv\n" +"csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, 'unixpwd')" -msgid "A slightly more advanced use of the reader --- catching and reporting errors::" -msgstr "" +msgid "" +"A slightly more advanced use of the reader --- catching and reporting " +"errors::" +msgstr "یک کاربرد کمی پیشرفته‌تر از reader --- گرفتن و گزارش خطاها::" msgid "" "import csv, sys\n" @@ -470,33 +1030,56 @@ msgid "" " except csv.Error as e:\n" " sys.exit(f'file {filename}, line {reader.line_num}: {e}')" msgstr "" +"import csv, sys\n" +"filename = 'some.csv'\n" +"with open(filename, newline='') as f:\n" +" reader = csv.reader(f)\n" +" try:\n" +" for row in reader:\n" +" print(row)\n" +" except csv.Error as e:\n" +" sys.exit(f'file {filename}, line {reader.line_num}: {e}')" -msgid "And while the module doesn't directly support parsing strings, it can easily be done::" +msgid "" +"And while the module doesn't directly support parsing strings, it can easily" +" be done::" msgstr "" +"و با وجود اینکه ماژول مستقیماً از تجزیه‌ی رشته‌ها پشتیبانی نمی‌کند، این کار " +"به‌راحتی قابل انجام است::" msgid "" "import csv\n" "for row in csv.reader(['one,two,three']):\n" " print(row)" msgstr "" +"import csv\n" +"for row in csv.reader(['one,two,three']):\n" +" print(row)" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "If ``newline=''`` is not specified, newlines embedded inside quoted fields will not be interpreted correctly, and on platforms that use ``\\r\\n`` line endings on write an extra ``\\r`` will be added. It should always be safe to specify ``newline=''``, since the csv module does its own (:term:`universal `) newline handling." +msgid "" +"If ``newline=''`` is not specified, newlines embedded inside quoted fields " +"will not be interpreted correctly, and on platforms that use ``\\r\\n`` line" +" endings on write an extra ``\\r`` will be added. It should always be safe " +"to specify ``newline=''``, since the csv module does its own " +"(:term:`universal `) newline handling." msgstr "" +"اگر ``newline=''`` مشخص نشود، خط‌های جدید نهفته در فیلدهای نقل‌قول‌شده به‌درستی تفسیر نمی‌شوند، و در سکوهایی که هنگام نوشتن از پایان‌خط‌های ``\\r\\n`` " +"استفاده می‌کنند، یک ``\\r`` اضافی افزوده می‌شود. مشخص کردن ``newline=''`` باید همیشه ایمن باشد، زیرا ماژول csv مدیریت خط جدید (:term:`سطرهای جدید همگانی (universal newlines) `) خود را انجام می‌دهد." msgid "csv" -msgstr "" +msgstr "csv" msgid "data" -msgstr "" +msgstr "داده" msgid "tabular" -msgstr "" +msgstr "جدولی" msgid "universal newlines" -msgstr "" +msgstr "سطرهای جدید همگانی (universal newlines)" msgid "csv.reader function" -msgstr "" +msgstr "تابع csv.reader" diff --git a/library/ctypes.po b/library/ctypes.po index f1a3ffbf5..883a8c7ae 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"PO-Revision-Date: 2026-08-28 10:15+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,42 +23,94 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!ctypes` --- A foreign function library for Python" -msgstr "" +msgstr ":mod:`!ctypes` --- کتابخانه‌ای از توابع خارجی برای پایتون" msgid "**Source code:** :source:`Lib/ctypes`" -msgstr "" +msgstr ":source:`Lib/ctypes`" -msgid ":mod:`!ctypes` is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python." +msgid "" +":mod:`!ctypes` is a foreign function library for Python. It provides C compatible data types, and " +"allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in " +"pure Python." msgstr "" +":mod:`!ctypes` یک کتابخانه برای توابع خارجی در پایتون است. این کتابخانه انواع داده‌ی سازگار با C را " +"فراهم می‌کند و فراخوانی توابع در DLLها یا کتابخانه‌های مشترک را ممکن می‌سازد. می‌توان از آن برای " +"دربرگرفتن این کتابخانه‌ها در پایتون خالص استفاده کرد." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of CPython, look for " +"documentation from your distributor (that is, whoever provided Python to you). If you are the " +"distributor, see :ref:`optional-module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر این ماژول در نسخه CPython شما موجود نیست، " +"به مستندات توزیع‌کننده خود (یعنی هرکسی که پایتون را در اختیار شما قرار داده است) مراجعه کنید. اگر " +"شما توزیع‌کننده هستید، :ref:`optional-module-requirements` را ببینید." -msgid ":mod:`!ctypes` provides low-level access to native libraries and the process's memory, bypassing Python's safety mechanisms and allowing execution of arbitrary native code. Incorrect use can corrupt data and objects, reveal sensitive information, cause crashes, or otherwise compromise the running process." +msgid "" +":mod:`!ctypes` provides low-level access to native libraries and the process's memory, bypassing " +"Python's safety mechanisms and allowing execution of arbitrary native code. Incorrect use can " +"corrupt data and objects, reveal sensitive information, cause crashes, or otherwise compromise the " +"running process." msgstr "" +":mod:`!ctypes` دسترسی سطح پایین به کتابخانه‌های بومی و حافظه‌ی فرایند را فراهم می‌کند، سازوکارهای " +"ایمنی پایتون را دور می‌زند و امکان اجرای کد بومی دلخواه را می‌دهد. استفاده‌ی نادرست می‌تواند داده‌ها و " +"اشیاء را تخریب کند، اطلاعات حساس را افشا کند، باعث فروپاشی شود یا به‌گونه‌ای دیگر فرایند در حال اجرا " +"را به خطر بیندازد." msgid "ctypes tutorial" -msgstr "" +msgstr "آموزش ctypes" -msgid "Note: Some code samples reference the ctypes :class:`c_int` type. On platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:`c_long`. So, you should not be confused if :class:`c_long` is printed if you would expect :class:`c_int` --- they are actually the same type." +msgid "" +"Note: Some code samples reference the ctypes :class:`c_int` type. On platforms where " +"``sizeof(long) == sizeof(int)`` it is an alias to :class:`c_long`. So, you should not be confused " +"if :class:`c_long` is printed if you would expect :class:`c_int` --- they are actually the same " +"type." msgstr "" +"نکته: برخی نمونه‌کدها به نوع :class:`c_int` در ctypes ارجاع می‌دهند. در سکوهایی که ``sizeof(long) == " +"sizeof(int)`` است، این یک نام مستعار برای :class:`c_long` است. بنابراین، اگر در شرایطی که " +"انتظار :class:`c_int` را دارید، :class:`c_long` چاپ شود، نباید دچار تردید شوید --- این دو در واقع " +"یک نوع هستند." msgid "Loading dynamic link libraries" -msgstr "" +msgstr "بارگذاری کتابخانه‌های پیوند پویا" -msgid ":mod:`!ctypes` exports the :py:data:`~ctypes.cdll`, and on Windows :py:data:`~ctypes.windll` and :py:data:`~ctypes.oledll` objects, for loading dynamic link libraries." +msgid "" +":mod:`!ctypes` exports the :py:data:`~ctypes.cdll`, and on Windows :py:data:`~ctypes.windll` " +"and :py:data:`~ctypes.oledll` objects, for loading dynamic link libraries." msgstr "" +":mod:`!ctypes` شیء :py:data:`~ctypes.cdll` و در ویندوز اشیای :py:data:`~ctypes.windll` " +"و :py:data:`~ctypes.oledll` را برای بارگذاری کتابخانه‌های پیوند پویا صادر می‌کند." -msgid "You load libraries by accessing them as attributes of these objects. :py:data:`!cdll` loads libraries which export functions using the standard ``cdecl`` calling convention, while :py:data:`!windll` libraries call functions using the ``stdcall`` calling convention. :py:data:`~oledll` also uses the ``stdcall`` calling convention, and assumes the functions return a Windows :c:type:`!HRESULT` error code. The error code is used to automatically raise an :class:`OSError` exception when the function call fails." -msgstr "" +msgid "" +"You load libraries by accessing them as attributes of these objects. :py:data:`!cdll` loads " +"libraries which export functions using the standard ``cdecl`` calling convention, while :py:data:`!" +"windll` libraries call functions using the ``stdcall`` calling convention. :py:data:`~oledll` also " +"uses the ``stdcall`` calling convention, and assumes the functions return a Windows :c:type:`!" +"HRESULT` error code. The error code is used to automatically raise an :class:`OSError` exception " +"when the function call fails." +msgstr "" +"شما کتابخانه‌ها را با دسترسی به آن‌ها به‌عنوان ویژگی‌های این اشیاء بارگذاری می‌کنید. :py:data:`!cdll` " +"کتابخانه‌هایی را بارگذاری می‌کند که توابع را با استفاده از قرارداد فراخوانی استاندارد ``cdecl`` صادر " +"می‌کنند، در حالی که کتابخانه‌های :py:data:`!windll` توابع را با قرارداد فراخوانی ``stdcall`` " +"فراخوانی می‌کنند. :py:data:`~oledll` نیز از قرارداد فراخوانی ``stdcall`` استفاده می‌کند و فرض می‌کند " +"که توابع یک کد خطای ویندوزی :c:type:`!HRESULT` برمی‌گردانند. این کد خطا برای پرتاب خودکار یک " +"استثنای :class:`OSError` در صورت شکست فراخوانی تابع استفاده می‌شود." msgid "Windows errors used to raise :exc:`WindowsError`, which is now an alias of :exc:`OSError`." msgstr "" +"خطاهای ویندوز پیش‌تر موجب پرتاب :exc:`WindowsError` می‌شدند، که اکنون نام مستعاری از :exc:`OSError` " +"است." -msgid "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard C library containing most standard C functions, and uses the ``cdecl`` calling convention::" +msgid "" +"Here are some examples for Windows. Note that ``msvcrt`` is the MS standard C library containing " +"most standard C functions, and uses the ``cdecl`` calling convention::" msgstr "" +"در اینجا چند مثال برای ویندوز آمده است. توجه داشته باشید که ``msvcrt`` کتابخانه استاندارد C " +"مایکروسافت است که شامل بیشتر توابع استاندارد C می‌شود و از قرارداد فراخوانی ``cdecl`` استفاده " +"می‌کند::" msgid "" ">>> from ctypes import *\n" @@ -69,18 +121,39 @@ msgid "" ">>> libc = cdll.msvcrt\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> print(windll.kernel32)\n" +"\n" +">>> print(cdll.msvcrt)\n" +"\n" +">>> libc = cdll.msvcrt\n" +">>>" msgid "Windows appends the usual ``.dll`` file suffix automatically." -msgstr "" +msgstr "ویندوز به‌طور خودکار پسوند معمول فایل ``.dll`` را اضافه می‌کند." -msgid "Accessing the standard C library through ``cdll.msvcrt`` will use an outdated version of the library that may be incompatible with the one being used by Python. Where possible, use native Python functionality, or else import and use the ``msvcrt`` module." +msgid "" +"Accessing the standard C library through ``cdll.msvcrt`` will use an outdated version of the " +"library that may be incompatible with the one being used by Python. Where possible, use native " +"Python functionality, or else import and use the ``msvcrt`` module." msgstr "" +"دسترسی به کتابخانه استاندارد C از طریق ``cdll.msvcrt`` باعث استفاده از نسخه‌ای قدیمی از این " +"کتابخانه می‌شود که ممکن است با نسخه‌ای که پایتون از آن استفاده می‌کند ناسازگار باشد. در صورت امکان، " +"از قابلیت‌های خود پایتون استفاده کنید؛ در غیر این صورت، ماژول ``msvcrt`` را ایمپورت و استفاده کنید." -msgid "Other systems require the filename *including* the extension to load a library, so attribute access can not be used to load libraries. Either the :meth:`~LibraryLoader.LoadLibrary` method of the dll loaders should be used, or you should load the library by creating an instance of :py:class:`CDLL` by calling the constructor." +msgid "" +"Other systems require the filename *including* the extension to load a library, so attribute " +"access can not be used to load libraries. Either the :meth:`~LibraryLoader.LoadLibrary` method of " +"the dll loaders should be used, or you should load the library by creating an instance " +"of :py:class:`CDLL` by calling the constructor." msgstr "" +"سیستم‌های دیگر برای بارگذاری یک کتابخانه به نام فایل *شامل* پسوند نیاز دارند، بنابراین نمی‌توان از " +"دسترسی به ویژگی برای بارگذاری کتابخانه‌ها استفاده کرد. یا باید از " +"متد :meth:`~LibraryLoader.LoadLibrary` بارگذارهای dll استفاده شود، یا باید کتابخانه را با ایجاد یک " +"نمونه از :py:class:`CDLL` از طریق فراخوانی سازنده بارگذاری کنید." msgid "For example, on Linux::" -msgstr "" +msgstr "برای مثال، در لینوکس::" msgid "" ">>> cdll.LoadLibrary(\"libc.so.6\")\n" @@ -90,9 +163,15 @@ msgid "" "\n" ">>>" msgstr "" +">>> cdll.LoadLibrary(\"libc.so.6\")\n" +"\n" +">>> libc = CDLL(\"libc.so.6\")\n" +">>> libc\n" +"\n" +">>>" msgid "On macOS::" -msgstr "" +msgstr "در macOS::" msgid "" ">>> cdll.LoadLibrary(\"libc.dylib\")\n" @@ -101,12 +180,17 @@ msgid "" ">>> libc\n" "" msgstr "" +">>> cdll.LoadLibrary(\"libc.dylib\")\n" +"\n" +">>> libc = CDLL(\"libc.dylib\")\n" +">>> libc\n" +"" msgid "Accessing functions from loaded dlls" -msgstr "" +msgstr "دسترسی به توابع از DLLهای بارگذاری‌شده" msgid "Functions are accessed as attributes of dll objects::" -msgstr "" +msgstr "توابع به‌عنوان ویژگی‌های اشیای dll قابل دسترسی هستند::" msgid "" ">>> libc.printf\n" @@ -121,9 +205,32 @@ msgid "" "AttributeError: function 'MyOwnFunction' not found\n" ">>>" msgstr "" +">>> libc.printf\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.GetModuleHandleA)\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.MyOwnFunction)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 239, in __getattr__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function 'MyOwnFunction' not found\n" +">>>" -msgid "Note that win32 system dlls like ``kernel32`` and ``user32`` often export ANSI as well as UNICODE versions of a function. The UNICODE version is exported with a ``W`` appended to the name, while the ANSI version is exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` function, which returns a *module handle* for a given module name, has the following C prototype, and a macro is used to expose one of them as ``GetModuleHandle`` depending on whether UNICODE is defined or not::" -msgstr "" +msgid "" +"Note that win32 system dlls like ``kernel32`` and ``user32`` often export ANSI as well as UNICODE " +"versions of a function. The UNICODE version is exported with a ``W`` appended to the name, while " +"the ANSI version is exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` " +"function, which returns a *module handle* for a given module name, has the following C prototype, " +"and a macro is used to expose one of them as ``GetModuleHandle`` depending on whether UNICODE is " +"defined or not::" +msgstr "" +"توجه داشته باشید که DLLهای سیستمی win32 مانند ``kernel32`` و ``user32`` اغلب نسخه‌های ANSI و همچنین " +"UNICODE یک تابع را صادر می‌کنند. نسخه UNICODE با افزودن ``W`` به نام صادر می‌شود، در حالی که نسخه " +"ANSI با افزودن ``A`` به نام صادر می‌شود. تابع ``GetModuleHandle`` در win32، که یک *دسته ماژول* " +"(module handle) را برای نام ماژول داده‌شده برمی‌گرداند، پیش‌نمونه C زیر را دارد، و از یک ماکرو " +"استفاده می‌شود تا یکی از آن‌ها را بسته به اینکه UNICODE تعریف شده باشد یا نه، به‌عنوان " +"``GetModuleHandle`` در دسترس قرار دهد::" msgid "" "/* ANSI version */\n" @@ -131,21 +238,42 @@ msgid "" "/* UNICODE version */\n" "HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" msgstr "" +"/* ANSI version */\n" +"HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" +"/* UNICODE version */\n" +"HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" -msgid "*windll* does not try to select one of them by magic, you must access the version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` explicitly, and then call it with bytes or string objects respectively." +msgid "" +"*windll* does not try to select one of them by magic, you must access the version you need by " +"specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` explicitly, and then call it with bytes or " +"string objects respectively." msgstr "" +"*windll* تلاش نمی‌کند یکی از آن‌ها را به‌صورت جادویی انتخاب کند، شما باید با مشخص کردن صریح " +"``GetModuleHandleA`` یا ``GetModuleHandleW`` به نسخه‌ای که نیاز دارید دسترسی پیدا کنید و سپس آن را " +"به‌ترتیب با اشیای بایتی یا رشته‌ای فراخوانی کنید." -msgid "Sometimes, dlls export functions with names which aren't valid Python identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:`getattr` to retrieve the function::" +msgid "" +"Sometimes, dlls export functions with names which aren't valid Python identifiers, like ``\"??" +"2@YAPAXI@Z\"``. In this case you have to use :func:`getattr` to retrieve the function::" msgstr "" +"گاهی اوقات، DLLها توابعی را با نام‌هایی صادر می‌کنند که شناسه‌های معتبر پایتون نیستند، مانند ``\"??" +"2@YAPAXI@Z\"``. در این صورت باید برای بازیابی تابع از :func:`getattr` استفاده کنید::" msgid "" ">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" "<_FuncPtr object at 0x...>\n" ">>>" msgstr "" +">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" +"<_FuncPtr object at 0x...>\n" +">>>" -msgid "On Windows, some dlls export functions not by name but by ordinal. These functions can be accessed by indexing the dll object with the ordinal number::" +msgid "" +"On Windows, some dlls export functions not by name but by ordinal. These functions can be accessed " +"by indexing the dll object with the ordinal number::" msgstr "" +"در ویندوز، برخی dllها توابع را نه با نام، بلکه با شماره ترتیبی (ordinal) صادر می‌کنند. می‌توان با " +"اندیس‌دهی به شیء dll با شماره ترتیبی، به این توابع دسترسی پیدا کرد::" msgid "" ">>> cdll.kernel32[1]\n" @@ -158,29 +286,56 @@ msgid "" "AttributeError: function ordinal 0 not found\n" ">>>" msgstr "" +">>> cdll.kernel32[1]\n" +"<_FuncPtr object at 0x...>\n" +">>> cdll.kernel32[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 310, in __getitem__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function ordinal 0 not found\n" +">>>" msgid "Calling functions" -msgstr "" +msgstr "فراخوانی توابع" -msgid "You can call these functions like any other Python callable. This example uses the ``rand()`` function, which takes no arguments and returns a pseudo-random integer::" +msgid "" +"You can call these functions like any other Python callable. This example uses the ``rand()`` " +"function, which takes no arguments and returns a pseudo-random integer::" msgstr "" +"می‌توانید این توابع را مانند هر شیء فراخوان‌پذیر دیگری در پایتون فراخوانی کنید. این مثال از تابع " +"``rand()`` استفاده می‌کند که هیچ آرگومانی نمی‌گیرد و یک عدد صحیح شبه‌تصادفی برمی‌گرداند::" msgid "" ">>> print(libc.rand())\n" "1804289383" msgstr "" +">>> print(libc.rand())\n" +"1804289383" -msgid "On Windows, you can call the ``GetModuleHandleA()`` function, which returns a win32 module handle (passing ``None`` as single argument to call it with a ``NULL`` pointer)::" +msgid "" +"On Windows, you can call the ``GetModuleHandleA()`` function, which returns a win32 module handle " +"(passing ``None`` as single argument to call it with a ``NULL`` pointer)::" msgstr "" +"در ویندوز، می‌توانید تابع ``GetModuleHandleA()`` را فراخوانی کنید، که یک دسته (handle) برای ماژول " +"win32 برمی‌گرداند (برای فراخوانی آن با اشاره‌گر ``NULL``، ``None`` را به‌عنوان تنها آرگومان ارسال " +"کنید)::" msgid "" ">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" "0x1d000000\n" ">>>" msgstr "" +">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" +"0x1d000000\n" +">>>" -msgid ":exc:`ValueError` is raised when you call an ``stdcall`` function with the ``cdecl`` calling convention, or vice versa::" +msgid "" +":exc:`ValueError` is raised when you call an ``stdcall`` function with the ``cdecl`` calling " +"convention, or vice versa::" msgstr "" +":exc:`ValueError` هنگامی پرتاب می‌شود که یک تابع ``stdcall`` را با قرارداد فراخوانی ``cdecl`` " +"فراخوانی کنید، یا برعکس::" msgid "" ">>> cdll.kernel32.GetModuleHandleA(None)\n" @@ -195,12 +350,31 @@ msgid "" "ValueError: Procedure probably called with too many arguments (4 bytes in excess)\n" ">>>" msgstr "" +">>> cdll.kernel32.GetModuleHandleA(None)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with not enough arguments (4 bytes missing)\n" +">>>\n" +"\n" +">>> windll.msvcrt.printf(b\"spam\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with too many arguments (4 bytes in excess)\n" +">>>" -msgid "To find out the correct calling convention you have to look into the C header file or the documentation for the function you want to call." +msgid "" +"To find out the correct calling convention you have to look into the C header file or the " +"documentation for the function you want to call." msgstr "" +"برای اطلاع از قرارداد فراخوانی صحیح، باید فایل سرآیند C یا مستندات تابعی را که می‌خواهید فراخوانی " +"کنید، بررسی کنید." -msgid "On Windows, :mod:`!ctypes` uses win32 structured exception handling to prevent crashes from general protection faults when functions are called with invalid argument values::" +msgid "" +"On Windows, :mod:`!ctypes` uses win32 structured exception handling to prevent crashes from " +"general protection faults when functions are called with invalid argument values::" msgstr "" +"در ویندوز، :mod:`!ctypes` از مدیریت استثنای ساختاریافته win32 برای جلوگیری از فروپاشی ناشی از " +"خطاهای حفاظت عمومی هنگام فراخوانی توابع با مقادیر نامعتبر آرگومان استفاده می‌کند::" msgid "" ">>> windll.kernel32.GetModuleHandleA(32)\n" @@ -209,351 +383,382 @@ msgid "" "OSError: exception: access violation reading 0x00000020\n" ">>>" msgstr "" +">>> windll.kernel32.GetModuleHandleA(32)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"OSError: exception: access violation reading 0x00000020\n" +">>>" -msgid "The :mod:`faulthandler` module can help debug crashes, such as segmentation faults produced by erroneous C library calls." +msgid "" +"The :mod:`faulthandler` module can help debug crashes, such as segmentation faults produced by " +"erroneous C library calls." msgstr "" +"ماژول :mod:`faulthandler` می‌تواند به اشکال‌زدایی خرابی‌ها، مانند خطاهای قطعه‌بندی (segmentation " +"faults) ناشی از فراخوانی‌های نادرست کتابخانه C کمک کند." -msgid "``None``, integers, bytes objects and (unicode) strings are the only native Python objects that can directly be used as parameters in these function calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings are passed as pointer to the memory block that contains their data (:c:expr:`char *` or :c:expr:`wchar_t *`). Python integers are passed as the platform's default C :c:expr:`int` type, their value is masked to fit into the C type." -msgstr "" +msgid "" +"``None``, integers, bytes objects and (unicode) strings are the only native Python objects that " +"can directly be used as parameters in these function calls. ``None`` is passed as a C ``NULL`` " +"pointer, bytes objects and strings are passed as pointer to the memory block that contains their " +"data (:c:expr:`char *` or :c:expr:`wchar_t *`). Python integers are passed as the platform's " +"default C :c:expr:`int` type, their value is masked to fit into the C type." +msgstr "" +"``None``، اعداد صحیح، اشیای بایتی و رشته‌های (یونیکدی) تنها اشیای بومی پایتون هستند که می‌توانند " +"مستقیماً به‌عنوان پارامتر در این فراخوانی‌های تابع استفاده شوند. ``None`` به‌عنوان اشاره‌گر ``NULL`` در " +"C ارسال می‌شود، اشیای بایتی و رشته‌ها به‌عنوان اشاره‌گری به بلوک حافظه‌ای که شامل داده‌های آن‌هاست " +"(:c:expr:`char *` یا :c:expr:`wchar_t *`) ارسال می‌شوند. اعداد صحیح پایتون به‌عنوان نوع " +"C :c:expr:`int` پیش‌فرض پلتفرم ارسال می‌شوند، مقدار آن‌ها ماسک می‌شود تا در نوع C جای گیرد." -msgid "Before we move on calling functions with other parameter types, we have to learn more about :mod:`!ctypes` data types." +msgid "" +"Before we move on calling functions with other parameter types, we have to learn more about :mod:`!" +"ctypes` data types." msgstr "" +"پیش از آنکه به فراخوانی توابع با سایر انواع پارامتر بپردازیم، باید درباره‌ی انواع داده‌ی :mod:`!" +"ctypes` بیشتر بیاموزیم." msgid "Fundamental data types" -msgstr "" +msgstr "انواع داده بنیادی" msgid ":mod:`!ctypes` defines a number of primitive C compatible data types:" -msgstr "" +msgstr ":mod:`!ctypes` تعدادی از انواع داده‌ی اولیه‌ی سازگار با C را تعریف می‌کند:" msgid "ctypes type" -msgstr "" +msgstr "نوع ctypes" msgid "C type" -msgstr "" +msgstr "نوع C" msgid "Python type" -msgstr "" +msgstr "نوع پایتون" msgid ":py:attr:`~_SimpleCData._type_`" -msgstr "" +msgstr ":py:attr:`~_SimpleCData._type_`" msgid ":class:`c_bool`" -msgstr "" +msgstr ":class:`c_bool`" msgid ":c:expr:`_Bool`" -msgstr "" +msgstr ":c:expr:`_Bool`" msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" msgid "``'?'``" -msgstr "" +msgstr "``'?'``" msgid ":class:`c_char`" -msgstr "" +msgstr ":class:`c_char`" msgid ":c:expr:`char`" -msgstr "" +msgstr ":c:expr:`char`" msgid "1-character :py:class:`bytes`" -msgstr "" +msgstr ":py:class:`bytes` تک‌نویسه‌ای" msgid "``'c'``" -msgstr "" +msgstr "``'c'``" msgid ":class:`c_wchar`" -msgstr "" +msgstr ":class:`c_wchar`" msgid ":c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`wchar_t`" msgid "1-character :py:class:`str`" -msgstr "" +msgstr ":py:class:`str` یک‌نویسه‌ای" msgid "``'u'``" -msgstr "" +msgstr "``'u'``" msgid ":class:`c_byte`" -msgstr "" +msgstr ":class:`c_byte`" msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" msgid "``'b'``" -msgstr "" +msgstr "``'b'``" msgid ":class:`c_ubyte`" -msgstr "" +msgstr ":class:`c_ubyte`" msgid ":c:expr:`unsigned char`" -msgstr "" +msgstr ":c:expr:`unsigned char`" msgid "``'B'``" -msgstr "" +msgstr "``'B'``" msgid ":class:`c_short`" -msgstr "" +msgstr ":class:`c_short`" msgid ":c:expr:`short`" -msgstr "" +msgstr ":c:expr:`short`" msgid "``'h'``" -msgstr "" +msgstr "``'h'``" msgid ":class:`c_ushort`" -msgstr "" +msgstr ":class:`c_ushort`" msgid ":c:expr:`unsigned short`" -msgstr "" +msgstr ":c:expr:`unsigned short`" msgid "``'H'``" -msgstr "" +msgstr "``'H'``" msgid ":class:`c_int`" -msgstr "" +msgstr ":class:`c_int`" msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" msgid "``'i'`` \\*" -msgstr "" +msgstr "``'i'`` \\*" msgid ":class:`c_int8`" -msgstr "" +msgstr ":class:`c_int8`" msgid ":c:type:`int8_t`" -msgstr "" +msgstr ":c:type:`int8_t`" msgid "\\*" -msgstr "" +msgstr "\\*" msgid ":class:`c_int16`" -msgstr "" +msgstr ":class:`c_int16`" msgid ":c:type:`int16_t`" -msgstr "" +msgstr ":c:type:`int16_t`" msgid ":class:`c_int32`" -msgstr "" +msgstr ":class:`c_int32`" msgid ":c:type:`int32_t`" -msgstr "" +msgstr ":c:type:`int32_t`" msgid ":class:`c_int64`" -msgstr "" +msgstr ":class:`c_int64`" msgid ":c:type:`int64_t`" -msgstr "" +msgstr ":c:type:`int64_t`" msgid ":class:`c_uint`" -msgstr "" +msgstr ":class:`c_uint`" msgid ":c:expr:`unsigned int`" -msgstr "" +msgstr ":c:expr:`unsigned int`" msgid "``'I'`` \\*" -msgstr "" +msgstr "``'I'`` \\*" msgid ":class:`c_uint8`" -msgstr "" +msgstr ":class:`c_uint8`" msgid ":c:type:`uint8_t`" -msgstr "" +msgstr ":c:type:`uint8_t`" msgid ":class:`c_uint16`" -msgstr "" +msgstr ":class:`c_uint16`" msgid ":c:type:`uint16_t`" -msgstr "" +msgstr ":c:type:`uint16_t`" msgid ":class:`c_uint32`" -msgstr "" +msgstr ":class:`c_uint32`" msgid ":c:type:`uint32_t`" -msgstr "" +msgstr ":c:type:`uint32_t`" msgid ":class:`c_uint64`" -msgstr "" +msgstr ":class:`c_uint64`" msgid ":c:type:`uint64_t`" -msgstr "" +msgstr ":c:type:`uint64_t`" msgid ":class:`c_long`" -msgstr "" +msgstr ":class:`c_long`" msgid ":c:expr:`long`" -msgstr "" +msgstr ":c:expr:`long`" msgid "``'l'``" -msgstr "" +msgstr "``'l'``" msgid ":class:`c_ulong`" -msgstr "" +msgstr ":class:`c_ulong`" msgid ":c:expr:`unsigned long`" -msgstr "" +msgstr ":c:expr:`unsigned long`" msgid "``'L'``" -msgstr "" +msgstr "``'L'``" msgid ":class:`c_longlong`" -msgstr "" +msgstr ":class:`c_longlong`" msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" msgid "``'q'`` \\*" -msgstr "" +msgstr "``'q'`` \\*" msgid ":class:`c_ulonglong`" -msgstr "" +msgstr ":class:`c_ulonglong`" msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" msgid "``'Q'`` \\*" -msgstr "" +msgstr "``'Q'`` \\*" msgid ":class:`c_size_t`" -msgstr "" +msgstr ":class:`c_size_t`" msgid ":c:type:`size_t`" -msgstr "" +msgstr ":c:type:`size_t`" msgid ":class:`c_ssize_t`" -msgstr "" +msgstr ":class:`c_ssize_t`" msgid ":c:type:`Py_ssize_t`" -msgstr "" +msgstr ":c:type:`Py_ssize_t`" msgid ":class:`c_time_t`" -msgstr "" +msgstr ":class:`c_time_t`" msgid ":c:type:`time_t`" -msgstr "" +msgstr ":c:type:`time_t`" msgid ":class:`c_float`" -msgstr "" +msgstr ":class:`c_float`" msgid ":c:expr:`float`" -msgstr "" +msgstr ":c:expr:`float`" msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" msgid "``'f'``" -msgstr "" +msgstr "``'f'``" msgid ":class:`c_double`" -msgstr "" +msgstr ":class:`c_double`" msgid ":c:expr:`double`" -msgstr "" +msgstr ":c:expr:`double`" msgid "``'d'``" -msgstr "" +msgstr "``'d'``" msgid ":class:`c_longdouble`" -msgstr "" +msgstr ":class:`c_longdouble`" msgid ":c:expr:`long double`" -msgstr "" +msgstr ":c:expr:`long double`" msgid "``'g'`` \\*" -msgstr "" +msgstr "``'g'`` \\*" msgid ":class:`c_char_p`" -msgstr "" +msgstr ":class:`c_char_p`" msgid ":c:expr:`char *` (NUL terminated)" -msgstr "" +msgstr ":c:expr:`char *` (پایان‌یافته با NUL)" msgid ":py:class:`bytes` or ``None``" -msgstr "" +msgstr ":py:class:`bytes` یا ``None``" msgid "``'z'``" -msgstr "" +msgstr "``'z'``" msgid ":class:`c_wchar_p`" -msgstr "" +msgstr ":class:`c_wchar_p`" msgid ":c:expr:`wchar_t *` (NUL terminated)" -msgstr "" +msgstr ":c:expr:`wchar_t *` (پایان‌یافته با NUL)" msgid ":py:class:`str` or ``None``" -msgstr "" +msgstr ":py:class:`str` یا ``None``" msgid "``'Z'``" -msgstr "" +msgstr "``'Z'``" msgid ":class:`c_void_p`" -msgstr "" +msgstr ":class:`c_void_p`" msgid ":c:expr:`void *`" -msgstr "" +msgstr ":c:expr:`void *`" msgid ":py:class:`int` or ``None``" -msgstr "" +msgstr ":py:class:`int` یا ``None``" msgid "``'P'``" -msgstr "" +msgstr "``'P'``" msgid ":class:`py_object`" -msgstr "" +msgstr ":class:`py_object`" msgid ":c:expr:`PyObject *`" -msgstr "" +msgstr ":c:expr:`PyObject *`" msgid ":py:class:`object`" -msgstr "" +msgstr ":py:class:`object`" msgid "``'O'``" -msgstr "" +msgstr "``'O'``" msgid ":ref:`VARIANT_BOOL `" -msgstr "" +msgstr ":ref:`VARIANT_BOOL `" msgid ":c:expr:`short int`" -msgstr "" +msgstr ":c:expr:`short int`" msgid "``'v'``" -msgstr "" +msgstr "``'v'``" -msgid "Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is supported in both C and ``libffi``, the following complex types are available:" +msgid "" +"Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is supported in both C and " +"``libffi``, the following complex types are available:" msgstr "" +"علاوه بر این، اگر محاسبات مختلط سازگار با IEC 60559 (پیوست G) در هر دو C و ``libffi`` پشتیبانی " +"شود، انواع مختلط زیر در دسترس هستند:" msgid ":class:`c_float_complex`" -msgstr "" +msgstr ":class:`c_float_complex`" msgid ":c:expr:`float complex`" -msgstr "" +msgstr ":c:expr:`float complex`" msgid ":py:class:`complex`" -msgstr "" +msgstr ":py:class:`complex`" msgid "``'F'``" -msgstr "" +msgstr "``'F'``" msgid ":class:`c_double_complex`" -msgstr "" +msgstr ":class:`c_double_complex`" msgid ":c:expr:`double complex`" -msgstr "" +msgstr ":c:expr:`double complex`" msgid "``'D'``" -msgstr "" +msgstr "``'D'``" msgid ":class:`c_longdouble_complex`" -msgstr "" +msgstr ":class:`c_longdouble_complex`" msgid ":c:expr:`long double complex`" -msgstr "" +msgstr ":c:expr:`long double complex`" msgid "``'G'``" -msgstr "" +msgstr "``'G'``" -msgid "All these types can be created by calling them with an optional initializer of the correct type and value::" +msgid "" +"All these types can be created by calling them with an optional initializer of the correct type " +"and value::" msgstr "" +"همه‌ی این نوع‌ها را می‌توان با فراخوانی آن‌ها به‌همراه یک مقدارده اولیه‌ی اختیاری از نوع و مقدار صحیح " +"ایجاد کرد::" msgid "" ">>> c_int()\n" @@ -564,18 +769,36 @@ msgid "" "c_ushort(65533)\n" ">>>" msgstr "" +">>> c_int()\n" +"c_long(0)\n" +">>> c_wchar_p(\"Hello, World\")\n" +"c_wchar_p(140018365411392)\n" +">>> c_ushort(-3)\n" +"c_ushort(65533)\n" +">>>" -msgid "The constructors for numeric types will convert input using :py:meth:`~object.__bool__`, :py:meth:`~object.__index__` (for ``int``), :py:meth:`~object.__float__` or :py:meth:`~object.__complex__`. This means :py:class:`~ctypes.c_bool` accepts any object with a truth value::" +msgid "" +"The constructors for numeric types will convert input " +"using :py:meth:`~object.__bool__`, :py:meth:`~object.__index__` (for " +"``int``), :py:meth:`~object.__float__` or :py:meth:`~object.__complex__`. This " +"means :py:class:`~ctypes.c_bool` accepts any object with a truth value::" msgstr "" +"سازنده‌های انواع عددی، ورودی را با استفاده " +"از :py:meth:`~object.__bool__`، :py:meth:`~object.__index__` (برای " +"``int``)، :py:meth:`~object.__float__` یا :py:meth:`~object.__complex__` تبدیل می‌کنند. این بدان " +"معناست که :py:class:`~ctypes.c_bool` هر شیء دارای مقدار درستی را می‌پذیرد::" msgid "" ">>> empty_list = []\n" ">>> c_bool(empty_list)\n" "c_bool(False)" msgstr "" +">>> empty_list = []\n" +">>> c_bool(empty_list)\n" +"c_bool(False)" msgid "Since these types are mutable, their value can also be changed afterwards::" -msgstr "" +msgstr "از آنجا که این نوع‌ها تغییرپذیرند، می‌توان مقدار آن‌ها را نیز بعداً تغییر داد::" msgid "" ">>> i = c_int(42)\n" @@ -588,9 +811,24 @@ msgid "" "-99\n" ">>>" msgstr "" +">>> i = c_int(42)\n" +">>> print(i)\n" +"c_long(42)\n" +">>> print(i.value)\n" +"42\n" +">>> i.value = -99\n" +">>> print(i.value)\n" +"-99\n" +">>>" -msgid "Assigning a new value to instances of the pointer types :class:`c_char_p`, :class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they point to, *not the contents* of the memory block (of course not, because Python string objects are immutable)::" +msgid "" +"Assigning a new value to instances of the pointer types :class:`c_char_p`, :class:`c_wchar_p`, " +"and :class:`c_void_p` changes the *memory location* they point to, *not the contents* of the " +"memory block (of course not, because Python string objects are immutable)::" msgstr "" +"انتساب یک مقدار جدید به نمونه‌هایی از انواع اشاره‌گر :class:`c_char_p`، :class:`c_wchar_p` " +"و :class:`c_void_p`، *موقعیت حافظه‌ای* را که به آن اشاره می‌کنند تغییر می‌دهد، *نه محتوای* بلوک حافظه " +"را (البته که نه، زیرا اشیاء رشته‌ای پایتون تغییرناپذیر هستند)::" msgid "" ">>> s = \"Hello, World\"\n" @@ -608,9 +846,33 @@ msgid "" "Hello, World\n" ">>>" msgstr "" +">>> s = \"Hello, World\"\n" +">>> c_s = c_wchar_p(s)\n" +">>> print(c_s)\n" +"c_wchar_p(139966785747344)\n" +">>> print(c_s.value)\n" +"Hello World\n" +">>> c_s.value = \"Hi, there\"\n" +">>> print(c_s) # the memory location has changed\n" +"c_wchar_p(139966783348904)\n" +">>> print(c_s.value)\n" +"Hi, there\n" +">>> print(s) # first object is unchanged\n" +"Hello, World\n" +">>>" -msgid "You should be careful, however, not to pass them to functions expecting pointers to mutable memory. If you need mutable memory blocks, ctypes has a :func:`create_string_buffer` function which creates these in various ways. The current memory block contents can be accessed (or changed) with the ``raw`` property; if you want to access it as NUL terminated string, use the ``value`` property::" -msgstr "" +msgid "" +"You should be careful, however, not to pass them to functions expecting pointers to mutable " +"memory. If you need mutable memory blocks, ctypes has a :func:`create_string_buffer` function " +"which creates these in various ways. The current memory block contents can be accessed (or " +"changed) with the ``raw`` property; if you want to access it as NUL terminated string, use the " +"``value`` property::" +msgstr "" +"با این حال، باید مراقب باشید که آن‌ها را به توابعی که انتظار اشاره‌گرهایی به حافظه تغییرپذیر دارند، " +"ارسال نکنید. اگر به بلوک‌های حافظه تغییرپذیر نیاز دارید، ctypes دارای " +"تابع :func:`create_string_buffer` است که این بلوک‌ها را به روش‌های مختلفی ایجاد می‌کند. می‌توان به " +"محتوای فعلی بلوک حافظه از طریق ویژگی ``raw`` دسترسی پیدا کرد (یا آن را تغییر داد)؛ اگر می‌خواهید " +"به‌صورت رشته‌ای ختم‌شده با NUL به آن دسترسی داشته باشید، از ویژگی ``value`` استفاده کنید::" msgid "" ">>> from ctypes import *\n" @@ -630,15 +892,41 @@ msgid "" "10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" ">>>" msgstr "" - -msgid "The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` function (which is still available as an alias). To create a mutable memory block containing unicode characters of the C type :c:type:`wchar_t`, use the :func:`create_unicode_buffer` function." -msgstr "" - -msgid "Calling functions, continued" -msgstr "" - -msgid "Note that printf prints to the real standard output channel, *not* to :data:`sys.stdout`, so these examples will only work at the console prompt, not from within *IDLE* or *PythonWin*::" +">>> from ctypes import *\n" +">>> p = create_string_buffer(3) # create a 3 byte buffer, initialized to NUL bytes\n" +">>> print(sizeof(p), repr(p.raw))\n" +"3 b'\\x00\\x00\\x00'\n" +">>> p = create_string_buffer(b\"Hello\") # create a buffer containing a NUL terminated string\n" +">>> print(sizeof(p), repr(p.raw))\n" +"6 b'Hello\\x00'\n" +">>> print(repr(p.value))\n" +"b'Hello'\n" +">>> p = create_string_buffer(b\"Hello\", 10) # create a 10 byte buffer\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hello\\x00\\x00\\x00\\x00\\x00'\n" +">>> p.value = b\"Hi\"\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" +">>>" + +msgid "" +"The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` function (which is " +"still available as an alias). To create a mutable memory block containing unicode characters of " +"the C type :c:type:`wchar_t`, use the :func:`create_unicode_buffer` function." +msgstr "" +"تابع :func:`create_string_buffer` جایگزین تابع قدیمی :func:`!c_buffer` شده است (که همچنان به‌عنوان " +"یک نام مستعار در دسترس است). برای ایجاد یک بلوک حافظه تغییرپذیر حاوی نویسه‌های یونیکد از نوع " +"C :c:type:`wchar_t`، از تابع :func:`create_unicode_buffer` استفاده کنید." + +msgid "Calling functions, continued" +msgstr "فراخوانی توابع، ادامه" + +msgid "" +"Note that printf prints to the real standard output channel, *not* to :data:`sys.stdout`, so these " +"examples will only work at the console prompt, not from within *IDLE* or *PythonWin*::" msgstr "" +"توجه داشته باشید که printf در کانال خروجی استاندارد واقعی چاپ می‌کند، *نه* در :data:`sys.stdout`، " +"بنابراین این مثال‌ها فقط در اعلان خط فرمان کار می‌کنند، نه از داخل *IDLE* یا *PythonWin*::" msgid "" ">>> printf = libc.printf\n" @@ -657,9 +945,29 @@ msgid "" "ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2\n" ">>>" msgstr "" +">>> printf = libc.printf\n" +">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"Hello, %S\\n\", \"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"%d bottles of beer\\n\", 42)\n" +"42 bottles of beer\n" +"19\n" +">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2\n" +">>>" -msgid "As has been mentioned before, all Python types except integers, strings, and bytes objects have to be wrapped in their corresponding :mod:`!ctypes` type, so that they can be converted to the required C data type::" +msgid "" +"As has been mentioned before, all Python types except integers, strings, and bytes objects have to " +"be wrapped in their corresponding :mod:`!ctypes` type, so that they can be converted to the " +"required C data type::" msgstr "" +"همان‌طور که پیش‌تر ذکر شد، همه انواع پایتون به‌جز اعداد صحیح، رشته‌ها و اشیای bytes باید در نوع " +"متناظر :mod:`!ctypes` خود قرار داده شوند تا بتوان آن‌ها را به نوع داده C موردنیاز تبدیل کرد::" msgid "" ">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" @@ -667,27 +975,54 @@ msgid "" "31\n" ">>>" msgstr "" +">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" +"An int 1234, a double 3.140000\n" +"31\n" +">>>" msgid "Calling variadic functions" -msgstr "" +msgstr "فراخوانی توابع با تعداد متغیری از آرگومان‌ها (variadic functions)" -msgid "On a lot of platforms calling variadic functions through ctypes is exactly the same as calling functions with a fixed number of parameters. On some platforms, and in particular ARM64 for Apple Platforms, the calling convention for variadic functions is different than that for regular functions." +msgid "" +"On a lot of platforms calling variadic functions through ctypes is exactly the same as calling " +"functions with a fixed number of parameters. On some platforms, and in particular ARM64 for Apple " +"Platforms, the calling convention for variadic functions is different than that for regular " +"functions." msgstr "" +"در بسیاری از سکوها، فراخوانی توابع با تعداد متغیر آرگومان از طریق ctypes دقیقاً مانند فراخوانی " +"توابع با تعداد ثابت پارامتر است. در برخی سکوها، به‌ویژه ARM64 برای سکوهای اپل، قرارداد فراخوانی " +"برای توابع با تعداد متغیر آرگومان با قرارداد فراخوانی توابع معمولی متفاوت است." -msgid "On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` attribute for the regular, non-variadic, function arguments:" +msgid "" +"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` attribute for the " +"regular, non-variadic, function arguments:" msgstr "" +"در آن سکوها، لازم است ویژگی :attr:`~_CFuncPtr.argtypes` را برای آرگومان‌های عادی و غیرمتغیر (non-" +"variadic) تابع تعیین کنید:" msgid "libc.printf.argtypes = [ctypes.c_char_p]" -msgstr "" +msgstr "libc.printf.argtypes = [ctypes.c_char_p]" -msgid "Because specifying the attribute does not inhibit portability it is advised to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." +msgid "" +"Because specifying the attribute does not inhibit portability it is advised to always " +"specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." msgstr "" +"از آن‌جا که تعیین این ویژگی مانع قابلیت حمل نمی‌شود، توصیه می‌شود همیشه :attr:`~_CFuncPtr.argtypes` " +"را برای تمام توابع با تعداد متغیر آرگومان (variadic) مشخص کنید." msgid "Calling functions with your own custom data types" -msgstr "" +msgstr "فراخوانی توابع با انواع داده سفارشی خودتان" -msgid "You can also customize :mod:`!ctypes` argument conversion to allow instances of your own classes be used as function arguments. :mod:`!ctypes` looks for an :attr:`!_as_parameter_` attribute and uses this as the function argument. The attribute must be an integer, string, bytes, a :mod:`!ctypes` instance, or an object with an :attr:`!_as_parameter_` attribute::" +msgid "" +"You can also customize :mod:`!ctypes` argument conversion to allow instances of your own classes " +"be used as function arguments. :mod:`!ctypes` looks for an :attr:`!_as_parameter_` attribute and " +"uses this as the function argument. The attribute must be an integer, string, bytes, a :mod:`!" +"ctypes` instance, or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" +"همچنین می‌توانید تبدیل آرگومان :mod:`!ctypes` را سفارشی‌سازی کنید تا بتوان از نمونه‌های کلاس‌های " +"خودتان به‌عنوان آرگومان‌های تابع استفاده کرد. :mod:`!ctypes` به دنبال ویژگی :attr:`!_as_parameter_` " +"می‌گردد و از آن به‌عنوان آرگومان تابع استفاده می‌کند. این ویژگی باید عدد صحیح، رشته، بایت‌ها، نمونه‌ای " +"از :mod:`!ctypes`، یا شیءای دارای ویژگی :attr:`!_as_parameter_` باشد::" msgid "" ">>> class Bottles:\n" @@ -700,18 +1035,42 @@ msgid "" "19\n" ">>>" msgstr "" +">>> class Bottles:\n" +"... def __init__(self, number):\n" +"... self._as_parameter_ = number\n" +"...\n" +">>> bottles = Bottles(42)\n" +">>> printf(b\"%d bottles of beer\\n\", bottles)\n" +"42 bottles of beer\n" +"19\n" +">>>" -msgid "If you don't want to store the instance's data in the :attr:`!_as_parameter_` instance variable, you could define a :deco:`property` which makes the attribute available on request." +msgid "" +"If you don't want to store the instance's data in the :attr:`!_as_parameter_` instance variable, " +"you could define a :deco:`property` which makes the attribute available on request." msgstr "" +"اگر نمی‌خواهید داده‌های نمونه را در متغیر نمونه‌ی :attr:`!_as_parameter_` ذخیره کنید، می‌توانید " +"یک :deco:`property` تعریف کنید که ویژگی را در صورت درخواست در دسترس قرار می‌دهد." msgid "Specifying the required argument types (function prototypes)" -msgstr "" +msgstr "مشخص کردن انواع آرگومان‌های مورد نیاز (function prototypes)" -msgid "It is possible to specify the required argument types of functions exported from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." +msgid "" +"It is possible to specify the required argument types of functions exported from DLLs by setting " +"the :attr:`~_CFuncPtr.argtypes` attribute." msgstr "" +"می‌توان انواع مورد نیاز برای آرگومان‌های توابع صادرشده از DLLها را با تنظیم " +"ویژگی :attr:`~_CFuncPtr.argtypes` مشخص کرد." -msgid ":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!printf` function is probably not a good example here, because it takes a variable number and different types of parameters depending on the format string, on the other hand this is quite handy to experiment with this feature)::" +msgid "" +":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!printf` function is " +"probably not a good example here, because it takes a variable number and different types of " +"parameters depending on the format string, on the other hand this is quite handy to experiment " +"with this feature)::" msgstr "" +":attr:`~_CFuncPtr.argtypes` باید دنباله‌ای از انواع داده C باشد (تابع :func:`!printf` احتمالاً مثال " +"خوبی در اینجا نیست، زیرا بسته به رشته قالب، تعداد متغیر و انواع مختلفی از پارامترها را می‌گیرد؛ از " +"طرف دیگر، این موضوع برای آزمایش این قابلیت بسیار مفید است)::" msgid "" ">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" @@ -720,52 +1079,102 @@ msgid "" "37\n" ">>>" msgstr "" +">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" +">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" +"String 'Hi', Int 10, Double 2.200000\n" +"37\n" +">>>" -msgid "Specifying a format protects against incompatible argument types (just as a prototype for a C function), and tries to convert the arguments to valid types::" +msgid "" +"Specifying a format protects against incompatible argument types (just as a prototype for a C " +"function), and tries to convert the arguments to valid types::" msgstr "" +"مشخص کردن یک قالب، در برابر انواع آرگومان ناسازگار محافظت می‌کند (درست مانند پیش‌نمونه یک تابع C) و " +"تلاش می‌کند آرگومان‌ها را به انواع معتبر تبدیل کند::" msgid "" ">>> printf(b\"%d %d %d\", 1, 2, 3)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" -"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be interpreted as ctypes.c_char_p\n" +"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be interpreted as " +"ctypes.c_char_p\n" ">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" "X 2 3.000000\n" "13\n" ">>>" msgstr "" +">>> printf(b\"%d %d %d\", 1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be interpreted as " +"ctypes.c_char_p\n" +">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" +"X 2 3.000000\n" +"13\n" +">>>" -msgid "If you have defined your own classes which you pass to function calls, you have to implement a :meth:`~_CData.from_param` class method for them to be able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:`~_CData.from_param` class method receives the Python object passed to the function call, it should do a typecheck or whatever is needed to make sure this object is acceptable, and then return the object itself, its :attr:`!_as_parameter_` attribute, or whatever you want to pass as the C function argument in this case. Again, the result should be an integer, string, bytes, a :mod:`!ctypes` instance, or an object with an :attr:`!_as_parameter_` attribute." -msgstr "" +msgid "" +"If you have defined your own classes which you pass to function calls, you have to implement " +"a :meth:`~_CData.from_param` class method for them to be able to use them in " +"the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:`~_CData.from_param` class method receives the " +"Python object passed to the function call, it should do a typecheck or whatever is needed to make " +"sure this object is acceptable, and then return the object itself, its :attr:`!_as_parameter_` " +"attribute, or whatever you want to pass as the C function argument in this case. Again, the result " +"should be an integer, string, bytes, a :mod:`!ctypes` instance, or an object with an :attr:`!" +"_as_parameter_` attribute." +msgstr "" +"اگر کلاس‌های خودتان را تعریف کرده‌اید و آن‌ها را به فراخوانی‌های تابع ارسال می‌کنید، باید برای آن‌ها یک " +"متد کلاس :meth:`~_CData.from_param` پیاده‌سازی کنید تا بتوانید از آن‌ها در " +"دنباله :attr:`~_CFuncPtr.argtypes` استفاده کنید. متد کلاس :meth:`~_CData.from_param` شیء پایتونی " +"ارسال‌شده به فراخوانی تابع را دریافت می‌کند؛ این متد باید بررسی نوع یا هر کاری را که برای اطمینان از " +"قابل‌قبول بودن این شیء لازم است انجام دهد و سپس خود شیء، ویژگی :attr:`!_as_parameter_` آن، یا هر " +"چیزی را که می‌خواهید در این حالت به‌عنوان آرگومان تابع C ارسال کنید، برگرداند. باز هم، نتیجه باید یک " +"عدد صحیح، رشته، بایت‌ها، یک نمونه از :mod:`!ctypes`، یا شیءای با ویژگی :attr:`!_as_parameter_` باشد." msgid "Return types" -msgstr "" +msgstr "انواع بازگشتی" -msgid "By default functions are assumed to return the C :c:expr:`int` type. Other return types can be specified by setting the :attr:`~_CFuncPtr.restype` attribute of the function object." +msgid "" +"By default functions are assumed to return the C :c:expr:`int` type. Other return types can be " +"specified by setting the :attr:`~_CFuncPtr.restype` attribute of the function object." msgstr "" +"به‌طور پیش‌فرض فرض می‌شود که توابع نوع :c:expr:`int` در C را برمی‌گردانند. سایر انواع بازگشتی را " +"می‌توان با تنظیم ویژگی :attr:`~_CFuncPtr.restype` شیء تابع مشخص کرد." -msgid "The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:type:`time_t` might be of a different type than the default return type :c:expr:`int`, you should specify the :attr:`!restype` attribute::" +msgid "" +"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:type:`time_t` might be " +"of a different type than the default return type :c:expr:`int`, you should specify the :attr:`!" +"restype` attribute::" msgstr "" +"پیش‌نمونه‌ی C برای :c:func:`time` به‌صورت ``time_t time(time_t *)`` است. از آن‌جا که :c:type:`time_t` " +"ممکن است نوعی متفاوت از نوع بازگشتی پیش‌فرض :c:expr:`int` داشته باشد، باید ویژگی :attr:`!restype` " +"را مشخص کنید::" msgid ">>> libc.time.restype = c_time_t" -msgstr "" +msgstr ">>> libc.time.restype = c_time_t" msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" -msgstr "" +msgstr "انواع آرگومان‌ها را می‌توان با استفاده از :attr:`~_CFuncPtr.argtypes`:: مشخص کرد:" msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" -msgstr "" +msgstr ">>> libc.time.argtypes = (POINTER(c_time_t),)" msgid "To call the function with a ``NULL`` pointer as first argument, use ``None``::" -msgstr "" +msgstr "برای فراخوانی تابع با یک اشاره‌گر ``NULL`` به‌عنوان اولین آرگومان، از ``None`` استفاده کنید::" msgid "" ">>> print(libc.time(None))\n" "1150640792" msgstr "" +">>> print(libc.time(None))\n" +"1150640792" -msgid "Here is a more advanced example, it uses the :func:`!strchr` function, which expects a string pointer and a char, and returns a pointer to a string::" +msgid "" +"Here is a more advanced example, it uses the :func:`!strchr` function, which expects a string " +"pointer and a char, and returns a pointer to a string::" msgstr "" +"در اینجا یک مثال پیشرفته‌تر آمده است که از تابع :func:`!strchr` استفاده می‌کند؛ این تابع یک اشاره‌گر " +"به رشته و یک نویسه دریافت می‌کند و اشاره‌گری به یک رشته برمی‌گرداند::" msgid "" ">>> strchr = libc.strchr\n" @@ -778,9 +1187,24 @@ msgid "" "None\n" ">>>" msgstr "" +">>> strchr = libc.strchr\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"8059983\n" +">>> strchr.restype = c_char_p # c_char_p is a pointer to a string\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"b'def'\n" +">>> print(strchr(b\"abcdef\", ord(\"x\")))\n" +"None\n" +">>>" -msgid "If you want to avoid the :func:`ord(\"x\") ` calls above, you can set the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be converted from a single character Python bytes object into a C char:" +msgid "" +"If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " +"the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be converted from a single " +"character Python bytes object into a C char:" msgstr "" +"اگر می‌خواهید از فراخوانی‌های :func:`ord(\"x\") ` بالا اجتناب کنید، می‌توانید " +"ویژگی :attr:`~_CFuncPtr.argtypes` را تنظیم کنید، و آرگومان دوم از یک شیء بایت پایتون تک‌نویسه‌ای به " +"یک C char تبدیل می‌شود:" msgid "" ">>> strchr.restype = c_char_p\n" @@ -796,9 +1220,30 @@ msgid "" "b'def'\n" ">>>" msgstr "" +">>> strchr.restype = c_char_p\n" +">>> strchr.argtypes = [c_char_p, c_char]\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>> strchr(b\"abcdef\", b\"def\")\n" +"Traceback (most recent call last):\n" +"ctypes.ArgumentError: argument 2: TypeError: one character bytes, bytearray or integer expected\n" +">>> print(strchr(b\"abcdef\", b\"x\"))\n" +"None\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>>" -msgid "You can also use a callable Python object (a function or a class for example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign function returns an integer. The callable will be called with the *integer* the C function returns, and the result of this call will be used as the result of your function call. This is useful to check for error return values and automatically raise an exception::" +msgid "" +"You can also use a callable Python object (a function or a class for example) as " +"the :attr:`~_CFuncPtr.restype` attribute, if the foreign function returns an integer. The " +"callable will be called with the *integer* the C function returns, and the result of this call " +"will be used as the result of your function call. This is useful to check for error return values " +"and automatically raise an exception::" msgstr "" +"اگر تابع خارجی یک عدد صحیح برگرداند، همچنین می‌توانید از یک شیء فراخوان‌پذیر پایتون (برای مثال یک " +"تابع یا یک کلاس) به‌عنوان ویژگی :attr:`~_CFuncPtr.restype` استفاده کنید. آن شیء فراخوان‌پذیر با *عدد " +"صحیحی* که تابع C برمی‌گرداند، فراخوانی می‌شود و نتیجه‌ی این فراخوانی به‌عنوان نتیجه‌ی فراخوانی تابع شما " +"استفاده می‌شود. این کار برای بررسی مقادیر بازگشتی خطا و پرتاب خودکار استثنا مفید است::" msgid "" ">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" @@ -818,21 +1263,61 @@ msgid "" "OSError: [Errno 126] The specified module could not be found.\n" ">>>" msgstr "" +">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" +">>> def ValidHandle(value):\n" +"... if value == 0:\n" +"... raise WinError()\n" +"... return value\n" +"...\n" +">>>\n" +">>> GetModuleHandle.restype = ValidHandle\n" +">>> GetModuleHandle(None)\n" +"486539264\n" +">>> GetModuleHandle(\"something silly\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 3, in ValidHandle\n" +"OSError: [Errno 126] The specified module could not be found.\n" +">>>" -msgid "``WinError`` is a function which will call Windows ``FormatMessage()`` api to get the string representation of an error code, and *returns* an exception. ``WinError`` takes an optional error code parameter, if no one is used, it calls :func:`GetLastError` to retrieve it." +msgid "" +"``WinError`` is a function which will call Windows ``FormatMessage()`` api to get the string " +"representation of an error code, and *returns* an exception. ``WinError`` takes an optional error " +"code parameter, if no one is used, it calls :func:`GetLastError` to retrieve it." msgstr "" +"``WinError`` تابعی است که API ``FormatMessage()`` ویندوز را برای دریافت نمایش رشته‌ای یک کد خطا " +"فراخوانی می‌کند و یک استثنا *بازمی‌گرداند*. ``WinError`` یک پارامتر اختیاری کد خطا می‌گیرد؛ اگر از آن " +"استفاده نشود، برای دریافت آن :func:`GetLastError` را فراخوانی می‌کند." -msgid "Please note that a much more powerful error checking mechanism is available through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual for details." +msgid "" +"Please note that a much more powerful error checking mechanism is available through " +"the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual for details." msgstr "" +"لطفاً توجه داشته باشید که سازوکار بررسی خطای بسیار قدرتمندتری از طریق " +"ویژگی :attr:`~_CFuncPtr.errcheck` در دسترس است؛ برای جزئیات، راهنمای مرجع را ببینید." msgid "Passing pointers (or: passing parameters by reference)" -msgstr "" +msgstr "انتقال اشاره‌گرها (یا: انتقال پارامترها با ارجاع)" -msgid "Sometimes a C api function expects a *pointer* to a data type as parameter, probably to write into the corresponding location, or if the data is too large to be passed by value. This is also known as *passing parameters by reference*." +msgid "" +"Sometimes a C api function expects a *pointer* to a data type as parameter, probably to write into " +"the corresponding location, or if the data is too large to be passed by value. This is also known " +"as *passing parameters by reference*." msgstr "" +"گاهی یک تابع API در C انتظار دارد یک *اشاره‌گر* به یک نوع داده به‌عنوان پارامتر دریافت کند، احتمالاً " +"برای نوشتن در مکان متناظر، یا اگر داده برای ارسال با مقدار بیش از حد بزرگ باشد. این به‌عنوان *ارسال " +"پارامترها با ارجاع* نیز شناخته می‌شود." -msgid ":mod:`!ctypes` exports the :func:`byref` function which is used to pass parameters by reference. The same effect can be achieved with the :func:`pointer` function, although :func:`pointer` does a lot more work since it constructs a real pointer object, so it is faster to use :func:`byref` if you don't need the pointer object in Python itself::" +msgid "" +":mod:`!ctypes` exports the :func:`byref` function which is used to pass parameters by reference. " +"The same effect can be achieved with the :func:`pointer` function, although :func:`pointer` does a " +"lot more work since it constructs a real pointer object, so it is faster to use :func:`byref` if " +"you don't need the pointer object in Python itself::" msgstr "" +":mod:`!ctypes` تابع :func:`byref` را صادر می‌کند که برای ارسال پارامترها به‌صورت ارجاعی استفاده " +"می‌شود. می‌توان همان اثر را با تابع :func:`pointer` به دست آورد، اگرچه :func:`pointer` کار بسیار " +"بیشتری انجام می‌دهد، زیرا یک شیء اشاره‌گر واقعی می‌سازد؛ بنابراین اگر به خود شیء اشاره‌گر در پایتون " +"نیاز ندارید، استفاده از :func:`byref` سریع‌تر است::" msgid "" ">>> i = c_int()\n" @@ -847,18 +1332,45 @@ msgid "" "1 3.1400001049 b'Hello'\n" ">>>" msgstr "" +">>> i = c_int()\n" +">>> f = c_float()\n" +">>> s = create_string_buffer(b'\\000' * 32)\n" +">>> print(i.value, f.value, repr(s.value))\n" +"0 0.0 b''\n" +">>> libc.sscanf(b\"1 3.14 Hello\", b\"%d %f %s\",\n" +"... byref(i), byref(f), s)\n" +"3\n" +">>> print(i.value, f.value, repr(s.value))\n" +"1 3.1400001049 b'Hello'\n" +">>>" msgid "Structures and unions" -msgstr "" +msgstr "ساختارها و اجتماع‌ها (unions)" -msgid "Structures and unions must derive from the :class:`Structure` and :class:`Union` base classes which are defined in the :mod:`!ctypes` module. Each subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!_fields_` must be a list of *2-tuples*, containing a *field name* and a *field type*." +msgid "" +"Structures and unions must derive from the :class:`Structure` and :class:`Union` base classes " +"which are defined in the :mod:`!ctypes` module. Each subclass must define " +"a :attr:`~Structure._fields_` attribute. :attr:`!_fields_` must be a list of *2-tuples*, " +"containing a *field name* and a *field type*." msgstr "" +"ساختارها و اجتماع‌ها باید از کلاس‌های پایه :class:`Structure` و :class:`Union` که در ماژول :mod:`!" +"ctypes` تعریف شده‌اند، ارث‌بری کنند. هر زیرکلاس باید ویژگی :attr:`~Structure._fields_` را تعریف " +"کند. :attr:`!_fields_` باید فهرستی از *تاپل‌های ۲تایی* باشد که شامل یک *نام فیلد* و یک *نوع فیلد* " +"هستند." -msgid "The field type must be a :mod:`!ctypes` type like :class:`c_int`, or any other derived :mod:`!ctypes` type: structure, union, array, pointer." +msgid "" +"The field type must be a :mod:`!ctypes` type like :class:`c_int`, or any other derived :mod:`!" +"ctypes` type: structure, union, array, pointer." msgstr "" +"نوع فیلد باید یک نوع از :mod:`!ctypes` مانند :class:`c_int` یا هر نوع مشتق‌شده دیگری از :mod:`!" +"ctypes` باشد: ساختار، اتحادیه، آرایه، اشاره‌گر." -msgid "Here is a simple example of a POINT structure, which contains two integers named *x* and *y*, and also shows how to initialize a structure in the constructor::" +msgid "" +"Here is a simple example of a POINT structure, which contains two integers named *x* and *y*, and " +"also shows how to initialize a structure in the constructor::" msgstr "" +"در اینجا نمونه‌ای ساده از ساختار POINT آمده است که شامل ۲ عدد صحیح به نام‌های *x* و *y* است و همچنین " +"نحوه مقداردهی اولیه یک ساختار در سازنده را نشان می‌دهد::" msgid "" ">>> from ctypes import *\n" @@ -878,12 +1390,32 @@ msgid "" "TypeError: too many initializers\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = [(\"x\", c_int),\n" +"... (\"y\", c_int)]\n" +"...\n" +">>> point = POINT(10, 20)\n" +">>> print(point.x, point.y)\n" +"10 20\n" +">>> point = POINT(y=5)\n" +">>> print(point.x, point.y)\n" +"0 5\n" +">>> POINT(1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: too many initializers\n" +">>>" -msgid "You can, however, build much more complicated structures. A structure can itself contain other structures by using a structure as a field type." +msgid "" +"You can, however, build much more complicated structures. A structure can itself contain other " +"structures by using a structure as a field type." msgstr "" +"با این حال، می‌توانید ساختارهای بسیار پیچیده‌تری بسازید. یک ساختار می‌تواند خود با استفاده از یک " +"ساختار به‌عنوان نوع فیلد، شامل ساختارهای دیگری باشد." msgid "Here is a RECT structure which contains two POINTs named *upperleft* and *lowerright*::" -msgstr "" +msgstr "در اینجا یک ساختار RECT آمده است که شامل دو POINT به نام‌های *upperleft* و *lowerright* است::" msgid "" ">>> class RECT(Structure):\n" @@ -897,17 +1429,33 @@ msgid "" "0 0\n" ">>>" msgstr "" +">>> class RECT(Structure):\n" +"... _fields_ = [(\"upperleft\", POINT),\n" +"... (\"lowerright\", POINT)]\n" +"...\n" +">>> rc = RECT(point)\n" +">>> print(rc.upperleft.x, rc.upperleft.y)\n" +"0 5\n" +">>> print(rc.lowerright.x, rc.lowerright.y)\n" +"0 0\n" +">>>" msgid "Nested structures can also be initialized in the constructor in several ways::" -msgstr "" +msgstr "همچنین می‌توان ساختارهای تودرتو را در سازنده به چند روش مقداردهی اولیه کرد::" msgid "" ">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" ">>> r = RECT((1, 2), (3, 4))" msgstr "" +">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" +">>> r = RECT((1, 2), (3, 4))" -msgid "Field :term:`descriptor`\\s can be retrieved from the *class*, they are useful for debugging because they can provide useful information. See :class:`CField`::" +msgid "" +"Field :term:`descriptor`\\s can be retrieved from the *class*, they are useful for debugging " +"because they can provide useful information. See :class:`CField`::" msgstr "" +"می‌توان توصیف‌گرهای فیلد (:term:`descriptor`) را از *کلاس* بازیابی کرد؛ این توصیف‌گرها برای " +"اشکال‌زدایی مفید هستند، زیرا می‌توانند اطلاعات مفیدی ارائه دهند. :class:`CField` را ببینید::" msgid "" ">>> POINT.x\n" @@ -916,27 +1464,66 @@ msgid "" "\n" ">>>" msgstr "" +">>> POINT.x\n" +"\n" +">>> POINT.y\n" +"\n" +">>>" -msgid ":mod:`!ctypes` does not support passing unions or structures with bit-fields to functions by value. While this may work on 32-bit x86, it's not guaranteed by the library to work in the general case. Unions and structures with bit-fields should always be passed to functions by pointer." +msgid "" +":mod:`!ctypes` does not support passing unions or structures with bit-fields to functions by " +"value. While this may work on 32-bit x86, it's not guaranteed by the library to work in the " +"general case. Unions and structures with bit-fields should always be passed to functions by " +"pointer." msgstr "" +":mod:`!ctypes` از ارسال اجتماع‌ها (unions) یا ساختارهایی که فیلدهای بیتی (bit-fields) دارند به " +"توابع به‌صورت مقداری پشتیبانی نمی‌کند. هرچند ممکن است این روش روی x86 ۳۲ بیتی کار کند، اما کارکرد آن " +"در حالت کلی توسط کتابخانه تضمین نمی‌شود. اجتماع‌ها و ساختارهای دارای فیلدهای بیتی باید همیشه به‌صورت " +"اشاره‌گر به توابع ارسال شوند." msgid "Structure/union layout, alignment and byte order" -msgstr "" +msgstr "چیدمان ساختار/اجتماع (union)، هم‌ترازی و ترتیب بایت" -msgid "By default, Structure and Union fields are laid out in the same way the C compiler does it. It is possible to override this behavior entirely by specifying a :attr:`~Structure._layout_` class attribute in the subclass definition; see the attribute documentation for details." +msgid "" +"By default, Structure and Union fields are laid out in the same way the C compiler does it. It is " +"possible to override this behavior entirely by specifying a :attr:`~Structure._layout_` class " +"attribute in the subclass definition; see the attribute documentation for details." msgstr "" +"به‌طور پیش‌فرض، فیلدهای Structure و Union به همان شیوه‌ای چیدمان می‌شوند که کامپایل‌کننده C آن‌ها را " +"چیدمان می‌کند. با تعیین ویژگی کلاس :attr:`~Structure._layout_` در تعریف زیرکلاس، می‌توان این رفتار " +"را به‌طور کامل لغو کرد؛ برای جزئیات، مستندات این ویژگی را ببینید." -msgid "It is possible to specify the maximum alignment for the fields and/or for the structure itself by setting the class attributes :attr:`~Structure._pack_` and/or :attr:`~Structure._align_`, respectively. See the attribute documentation for details." +msgid "" +"It is possible to specify the maximum alignment for the fields and/or for the structure itself by " +"setting the class attributes :attr:`~Structure._pack_` and/or :attr:`~Structure._align_`, " +"respectively. See the attribute documentation for details." msgstr "" +"می‌توانید حداکثر ترازبندی را برای فیلدها و/یا برای خود ساختار، به‌ترتیب با تنظیم ویژگی‌های " +"کلاس :attr:`~Structure._pack_` و/یا :attr:`~Structure._align_` مشخص کنید. برای جزئیات، مستندات " +"ویژگی‌ها را ببینید." -msgid ":mod:`!ctypes` uses the native byte order for Structures and Unions. To build structures with non-native byte order, you can use one of the :class:`BigEndianStructure`, :class:`LittleEndianStructure`, :class:`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These classes cannot contain pointer fields." +msgid "" +":mod:`!ctypes` uses the native byte order for Structures and Unions. To build structures with non-" +"native byte order, you can use one of " +"the :class:`BigEndianStructure`, :class:`LittleEndianStructure`, :class:`BigEndianUnion`, " +"and :class:`LittleEndianUnion` base classes. These classes cannot contain pointer fields." msgstr "" +":mod:`!ctypes` برای ساختارها و اجتماع‌ها از ترتیب بایت بومی استفاده می‌کند. برای ساختن ساختارها با " +"ترتیب بایت غیربومی، می‌توانید از یکی از کلاس‌های " +"پایه :class:`BigEndianStructure`، :class:`LittleEndianStructure`، :class:`BigEndianUnion` " +"و :class:`LittleEndianUnion` استفاده کنید. این کلاس‌ها نمی‌توانند شامل فیلدهای اشاره‌گر باشند." msgid "Bit fields in structures and unions" -msgstr "" +msgstr "فیلدهای بیتی در ساختارها و اتحادها" -msgid "It is possible to create structures and unions containing bit fields. Bit fields are only possible for integer fields, the bit width is specified as the third item in the :attr:`~Structure._fields_` tuples::" +msgid "" +"It is possible to create structures and unions containing bit fields. Bit fields are only possible " +"for integer fields, the bit width is specified as the third item in " +"the :attr:`~Structure._fields_` tuples::" msgstr "" +"ایجاد ساختارها و اجتماع‌های حاوی فیلدهای بیتی امکان‌پذیر است. فیلدهای بیتی تنها برای فیلدهای عدد " +"صحیح امکان‌پذیر هستند و پهنای بیتی به‌عنوان سومین آیتم در تاپل‌های :attr:`~Structure._fields_` مشخص " +"می‌شود::" msgid "" ">>> class Int(Structure):\n" @@ -948,24 +1535,45 @@ msgid "" ">>> print(Int.second_16)\n" "" msgstr "" +">>> class Int(Structure):\n" +"... _fields_ = [(\"first_16\", c_int, 16),\n" +"... (\"second_16\", c_int, 16)]\n" +"...\n" +">>> print(Int.first_16)\n" +"\n" +">>> print(Int.second_16)\n" +"" -msgid "It is important to note that bit field allocation and layout in memory are not defined as a C standard; their implementation is compiler-specific. By default, Python will attempt to match the behavior of a \"native\" compiler for the current platform. See the :attr:`~Structure._layout_` attribute for details on the default behavior and how to change it." +msgid "" +"It is important to note that bit field allocation and layout in memory are not defined as a C " +"standard; their implementation is compiler-specific. By default, Python will attempt to match the " +"behavior of a \"native\" compiler for the current platform. See the :attr:`~Structure._layout_` " +"attribute for details on the default behavior and how to change it." msgstr "" +"توجه داشته باشید که تخصیص و چیدمان میدان‌های بیتی در حافظه در استاندارد C تعریف نشده‌اند؛ پیاده‌سازی " +"آن‌ها وابسته به کامپایلر است. به‌طور پیش‌فرض، پایتون تلاش خواهد کرد با رفتار یک کامپایلر «بومی» برای " +"پلتفرم فعلی مطابقت کند. برای جزئیات درباره رفتار پیش‌فرض و نحوه تغییر آن، " +"ویژگی :attr:`~Structure._layout_` را ببینید." msgid "Arrays" -msgstr "" +msgstr "آرایه‌ها" msgid "Arrays are sequences, containing a fixed number of instances of the same type." -msgstr "" +msgstr "آرایه‌ها دنباله‌هایی هستند که شامل تعداد ثابتی نمونه از یک نوع می‌شوند." -msgid "The recommended way to create array types is by multiplying a data type with a positive integer::" -msgstr "" +msgid "" +"The recommended way to create array types is by multiplying a data type with a positive integer::" +msgstr "روش توصیه‌شده برای ایجاد انواع آرایه، ضرب یک نوع داده در یک عدد صحیح مثبت است::" msgid "TenPointsArrayType = POINT * 10" -msgstr "" +msgstr "TenPointsArrayType = POINT * 10" -msgid "Here is an example of a somewhat artificial data type, a structure containing 4 POINTs among other stuff::" +msgid "" +"Here is an example of a somewhat artificial data type, a structure containing 4 POINTs among other " +"stuff::" msgstr "" +"در اینجا مثالی از یک نوع داده تا حدی مصنوعی آمده است، ساختاری که در میان سایر موارد شامل ۴ POINT " +"است::" msgid "" ">>> from ctypes import *\n" @@ -981,21 +1589,38 @@ msgid "" "4\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class MyStruct(Structure):\n" +"... _fields_ = [(\"a\", c_int),\n" +"... (\"b\", c_float),\n" +"... (\"point_array\", POINT * 4)]\n" +">>>\n" +">>> print(len(MyStruct().point_array))\n" +"4\n" +">>>" msgid "Instances are created in the usual way, by calling the class::" -msgstr "" +msgstr "نمونه‌ها به روش معمول، با فراخوانی کلاس ایجاد می‌شوند::" msgid "" "arr = TenPointsArrayType()\n" "for pt in arr:\n" " print(pt.x, pt.y)" msgstr "" +"arr = TenPointsArrayType()\n" +"for pt in arr:\n" +" print(pt.x, pt.y)" -msgid "The above code print a series of ``0 0`` lines, because the array contents is initialized to zeros." +msgid "" +"The above code print a series of ``0 0`` lines, because the array contents is initialized to zeros." msgstr "" +"کد بالا دنباله‌ای از خطوط ``0 0`` را چاپ می‌کند، زیرا محتوای آرایه با صفرها مقداردهی اولیه شده است." msgid "Initializers of the correct type can also be specified::" -msgstr "" +msgstr "همچنین می‌توان مقدارده‌های اولیه از نوع درست را نیز تعیین کرد::" msgid "" ">>> from ctypes import *\n" @@ -1008,12 +1633,23 @@ msgid "" "1 2 3 4 5 6 7 8 9 10\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> TenIntegers = c_int * 10\n" +">>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" +">>> print(ii)\n" +"\n" +">>> for i in ii: print(i, end=\" \")\n" +"...\n" +"1 2 3 4 5 6 7 8 9 10\n" +">>>" msgid "Pointers" -msgstr "" +msgstr "اشاره‌گرها" -msgid "Pointer instances are created by calling the :func:`pointer` function on a :mod:`!ctypes` type::" +msgid "" +"Pointer instances are created by calling the :func:`pointer` function on a :mod:`!ctypes` type::" msgstr "" +"نمونه‌های اشاره‌گر با فراخوانی تابع :func:`pointer` بر روی یک نوع :mod:`!ctypes` ایجاد می‌شوند::" msgid "" ">>> from ctypes import *\n" @@ -1021,18 +1657,33 @@ msgid "" ">>> pi = pointer(i)\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> i = c_int(42)\n" +">>> pi = pointer(i)\n" +">>>" -msgid "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns the object to which the pointer points, the ``i`` object above::" +msgid "" +"Pointer instances have a :attr:`~_Pointer.contents` attribute which returns the object to which " +"the pointer points, the ``i`` object above::" msgstr "" +"نمونه‌های اشاره‌گر دارای یک ویژگی :attr:`~_Pointer.contents` هستند که شیء مورد اشاره‌ی اشاره‌گر را " +"بازمی‌گرداند، همان شیء ``i`` در بالا::" msgid "" ">>> pi.contents\n" "c_long(42)\n" ">>>" msgstr "" +">>> pi.contents\n" +"c_long(42)\n" +">>>" -msgid "Note that :mod:`!ctypes` does not have OOR (original object return), it constructs a new, equivalent object each time you retrieve an attribute::" +msgid "" +"Note that :mod:`!ctypes` does not have OOR (original object return), it constructs a new, " +"equivalent object each time you retrieve an attribute::" msgstr "" +"توجه داشته باشید که :mod:`!ctypes` دارای بازگشت شیء اصلی (OOR) نیست، و هر بار که یک ویژگی را " +"بازیابی می‌کنید، یک شیء جدید و معادل می‌سازد::" msgid "" ">>> pi.contents is i\n" @@ -1041,9 +1692,18 @@ msgid "" "False\n" ">>>" msgstr "" +">>> pi.contents is i\n" +"False\n" +">>> pi.contents is pi.contents\n" +"False\n" +">>>" -msgid "Assigning another :class:`c_int` instance to the pointer's contents attribute would cause the pointer to point to the memory location where this is stored::" +msgid "" +"Assigning another :class:`c_int` instance to the pointer's contents attribute would cause the " +"pointer to point to the memory location where this is stored::" msgstr "" +"انتساب یک نمونه دیگر از :class:`c_int` به ویژگی contents اشاره‌گر باعث می‌شود اشاره‌گر به مکان " +"حافظه‌ای اشاره کند که این در آن ذخیره‌شده است::" msgid "" ">>> i = c_int(99)\n" @@ -1052,18 +1712,26 @@ msgid "" "c_long(99)\n" ">>>" msgstr "" +">>> i = c_int(99)\n" +">>> pi.contents = i\n" +">>> pi.contents\n" +"c_long(99)\n" +">>>" msgid "Pointer instances can also be indexed with integers::" -msgstr "" +msgstr "نمونه‌های اشاره‌گر همچنین می‌توانند با اعداد صحیح اندیس‌دهی شوند::" msgid "" ">>> pi[0]\n" "99\n" ">>>" msgstr "" +">>> pi[0]\n" +"99\n" +">>>" msgid "Assigning to an integer index changes the pointed to value::" -msgstr "" +msgstr "انتساب به یک اندیس عدد صحیح، مقدار اشاره‌شده را تغییر می‌دهد::" msgid "" ">>> print(i)\n" @@ -1073,12 +1741,32 @@ msgid "" "c_long(22)\n" ">>>" msgstr "" +">>> print(i)\n" +"c_long(99)\n" +">>> pi[0] = 22\n" +">>> print(i)\n" +"c_long(22)\n" +">>>" -msgid "It is also possible to use indexes different from 0, but you must know what you're doing, just as in C: You can access or change arbitrary memory locations. Generally you only use this feature if you receive a pointer from a C function, and you *know* that the pointer actually points to an array instead of a single item." +msgid "" +"It is also possible to use indexes different from 0, but you must know what you're doing, just as " +"in C: You can access or change arbitrary memory locations. Generally you only use this feature if " +"you receive a pointer from a C function, and you *know* that the pointer actually points to an " +"array instead of a single item." msgstr "" +"همچنین می‌توانید از اندیس‌هایی غیر از ۰ استفاده کنید، اما باید بدانید چه کاری انجام می‌دهید، درست " +"مانند C: می‌توانید به مکان‌های دلخواه حافظه دسترسی داشته باشید یا آن‌ها را تغییر دهید. به‌طور کلی، فقط " +"زمانی از این قابلیت استفاده می‌کنید که یک اشاره‌گر از یک تابع C دریافت کرده‌اید و *می‌دانید* که آن " +"اشاره‌گر در واقع به‌جای یک آیتم واحد، به یک آرایه اشاره می‌کند." -msgid "Behind the scenes, the :func:`pointer` function does more than simply create pointer instances, it has to create pointer *types* first. This is done with the :func:`POINTER` function, which accepts any :mod:`!ctypes` type, and returns a new type::" +msgid "" +"Behind the scenes, the :func:`pointer` function does more than simply create pointer instances, it " +"has to create pointer *types* first. This is done with the :func:`POINTER` function, which accepts " +"any :mod:`!ctypes` type, and returns a new type::" msgstr "" +"در پشت صحنه، تابع :func:`pointer` فراتر از صرف ایجاد نمونه‌های اشاره‌گر عمل می‌کند؛ ابتدا باید " +"*انواع* اشاره‌گر را ایجاد کند. این کار با تابع :func:`POINTER` انجام می‌شود که هر نوعی از :mod:`!" +"ctypes` را می‌پذیرد و نوع جدیدی را برمی‌گرداند::" msgid "" ">>> PI = POINTER(c_int)\n" @@ -1092,9 +1780,23 @@ msgid "" "\n" ">>>" msgstr "" +">>> PI = POINTER(c_int)\n" +">>> PI\n" +"\n" +">>> PI(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: expected c_long instead of int\n" +">>> PI(c_int(42))\n" +"\n" +">>>" -msgid "Calling the pointer type without an argument creates a ``NULL`` pointer. ``NULL`` pointers have a ``False`` boolean value::" +msgid "" +"Calling the pointer type without an argument creates a ``NULL`` pointer. ``NULL`` pointers have a " +"``False`` boolean value::" msgstr "" +"فراخوانی نوع اشاره‌گر بدون آرگومان، یک اشاره‌گر ``NULL`` ایجاد می‌کند. اشاره‌گرهای ``NULL`` مقدار بولی " +"``False`` دارند::" msgid "" ">>> null_ptr = POINTER(c_int)()\n" @@ -1102,9 +1804,17 @@ msgid "" "False\n" ">>>" msgstr "" +">>> null_ptr = POINTER(c_int)()\n" +">>> print(bool(null_ptr))\n" +"False\n" +">>>" -msgid ":mod:`!ctypes` checks for ``NULL`` when dereferencing pointers (but dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" +msgid "" +":mod:`!ctypes` checks for ``NULL`` when dereferencing pointers (but dereferencing invalid non-\\ " +"``NULL`` pointers would crash Python)::" msgstr "" +":mod:`!ctypes` هنگام دسترسی به مقدار اشاره‌گرها، ``NULL`` را بررسی می‌کند (اما دسترسی به مقدار " +"اشاره‌گرهای نامعتبر غیر\\ ``NULL`` باعث از کار افتادن پایتون می‌شود)::" msgid "" ">>> null_ptr[0]\n" @@ -1119,21 +1829,48 @@ msgid "" "ValueError: NULL pointer access\n" ">>>" msgstr "" +">>> null_ptr[0]\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>\n" +"\n" +">>> null_ptr[0] = 1234\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>" msgid "Thread safety without the GIL" -msgstr "" +msgstr "ایمنی نخ بدون GIL" -msgid "From Python 3.13 onward, the :term:`GIL` can be disabled on the :term:`free-threaded build`. In ctypes, reads and writes to a single object concurrently is safe, but not across multiple objects:" +msgid "" +"From Python 3.13 onward, the :term:`GIL` can be disabled on the :term:`free-threaded build`. In " +"ctypes, reads and writes to a single object concurrently is safe, but not across multiple objects:" msgstr "" +"از پایتون 3.13 به بعد، می‌توان :term:`GIL` را در ساخت آزادنخ (:term:`free-threaded build`) غیرفعال " +"کرد. در ctypes، خواندن و نوشتن همزمان به یک شیء واحد امن است، اما بین چندین شیء امن نیست:" msgid "" ">>> number = c_int(42)\n" ">>> pointer_a = pointer(number)\n" ">>> pointer_b = pointer(number)" msgstr "" +">>> number = c_int(42)\n" +">>> pointer_a = pointer(number)\n" +">>> pointer_b = pointer(number)" -msgid "In the above, it's only safe for one object to read and write to the address at once if the GIL is disabled. So, ``pointer_a`` can be shared and written to across multiple threads, but only if ``pointer_b`` is not also attempting to do the same. If this is an issue, consider using a :class:`threading.Lock` to synchronize access to memory:" +msgid "" +"In the above, it's only safe for one object to read and write to the address at once if the GIL is " +"disabled. So, ``pointer_a`` can be shared and written to across multiple threads, but only if " +"``pointer_b`` is not also attempting to do the same. If this is an issue, consider using " +"a :class:`threading.Lock` to synchronize access to memory:" msgstr "" +"در مثال بالا، اگر قفل سراسری مفسر (GIL) غیرفعال باشد، تنها در صورتی ایمن است که فقط یک شیء در یک " +"زمان عملیات خواندن و نوشتن در آن نشانی را انجام دهد. بنابراین، ``pointer_a`` می‌تواند بین چندین نخ " +"به اشتراک گذاشته شود و توسط چندین نخ در آن نوشته شود، اما تنها در صورتی که ``pointer_b`` نیز سعی " +"در انجام همین کار نداشته باشد. اگر این موضوع مسئله‌ساز است، استفاده از :class:`threading.Lock` را " +"برای همگام‌سازی دسترسی به حافظه در نظر بگیرید:" msgid "" ">>> import threading\n" @@ -1145,12 +1882,30 @@ msgid "" ">>> with lock:\n" "... pointer_b.contents = 42" msgstr "" +">>> import threading\n" +">>> lock = threading.Lock()\n" +">>> # Thread 1\n" +">>> with lock:\n" +"... pointer_a.contents = 24\n" +">>> # Thread 2\n" +">>> with lock:\n" +"... pointer_b.contents = 42" msgid "Type conversions" -msgstr "" +msgstr "تبدیل نوع‌ها" -msgid "Usually, ctypes does strict type checking. This means, if you have ``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or as the type of a member field in a structure definition, only instances of exactly the same type are accepted. There are some exceptions to this rule, where ctypes accepts other objects. For example, you can pass compatible array instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes accepts an array of c_int::" -msgstr "" +msgid "" +"Usually, ctypes does strict type checking. This means, if you have ``POINTER(c_int)`` in " +"the :attr:`~_CFuncPtr.argtypes` list of a function or as the type of a member field in a structure " +"definition, only instances of exactly the same type are accepted. There are some exceptions to " +"this rule, where ctypes accepts other objects. For example, you can pass compatible array " +"instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes accepts an array of c_int::" +msgstr "" +"معمولاً ctypes بررسی سخت‌گیرانه‌ی نوع را انجام می‌دهد. این بدان معناست که اگر ``POINTER(c_int)`` را در " +"فهرست :attr:`~_CFuncPtr.argtypes` یک تابع یا به‌عنوان نوع یک فیلد عضو در تعریف ساختار داشته باشید، " +"تنها نمونه‌هایی که دقیقاً از همان نوع هستند پذیرفته می‌شوند. استثناهایی بر این قاعده وجود دارد که در " +"آن‌ها ctypes اشیای دیگر را می‌پذیرد. برای مثال، می‌توانید نمونه‌های آرایه‌ی سازگار را به‌جای انواع " +"اشاره‌گر ارسال کنید. بنابراین، برای ``POINTER(c_int)``، ctypes آرایه‌ای از c_int را می‌پذیرد::" msgid "" ">>> class Bar(Structure):\n" @@ -1167,20 +1922,51 @@ msgid "" "3\n" ">>>" msgstr "" +">>> class Bar(Structure):\n" +"... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" +"...\n" +">>> bar = Bar()\n" +">>> bar.values = (c_int * 3)(1, 2, 3)\n" +">>> bar.count = 3\n" +">>> for i in range(bar.count):\n" +"... print(bar.values[i])\n" +"...\n" +"1\n" +"2\n" +"3\n" +">>>" -msgid "In addition, if a function argument is explicitly declared to be a pointer type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object of the pointed type (``c_int`` in this case) can be passed to the function. ctypes will apply the required :func:`byref` conversion in this case automatically." +msgid "" +"In addition, if a function argument is explicitly declared to be a pointer type (such as " +"``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object of the pointed type (``c_int`` in " +"this case) can be passed to the function. ctypes will apply the required :func:`byref` conversion " +"in this case automatically." msgstr "" +"علاوه بر این، اگر یک آرگومان تابع به‌صراحت به‌عنوان یک نوع اشاره‌گر (مانند ``POINTER(c_int)``) " +"در :attr:`~_CFuncPtr.argtypes` اعلان شده باشد، می‌توان یک شیء از نوع اشاره‌شده (در این مورد " +"``c_int``) را به تابع ارسال کرد. در این حالت، ctypes تبدیل :func:`byref` لازم را به‌طور خودکار " +"اعمال می‌کند." msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" -msgstr "" +msgstr "برای تنظیم یک فیلد از نوع POINTER به ``NULL``، می‌توانید ``None`` را انتساب دهید::" msgid "" ">>> bar.values = None\n" ">>>" msgstr "" +">>> bar.values = None\n" +">>>" -msgid "Sometimes you have instances of incompatible types. In C, you can cast one type into another type. :mod:`!ctypes` provides a :func:`cast` function which can be used in the same way. The ``Bar`` structure defined above accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for its ``values`` field, but not instances of other types::" +msgid "" +"Sometimes you have instances of incompatible types. In C, you can cast one type into another " +"type. :mod:`!ctypes` provides a :func:`cast` function which can be used in the same way. The " +"``Bar`` structure defined above accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for " +"its ``values`` field, but not instances of other types::" msgstr "" +"گاهی اوقات نمونه‌هایی از انواع ناسازگار دارید. در C، می‌توانید یک نوع را به نوع دیگری تبدیل " +"کنید. :mod:`!ctypes` تابع :func:`cast` را ارائه می‌دهد که می‌توان از آن به همان روش استفاده کرد. " +"ساختار ``Bar`` تعریف‌شده در بالا، اشاره‌گرهای ``POINTER(c_int)`` یا آرایه‌های :class:`c_int` را برای " +"فیلد ``values`` خود می‌پذیرد، اما نمونه‌هایی از انواع دیگر را نمی‌پذیرد::" msgid "" ">>> bar.values = (c_byte * 4)()\n" @@ -1189,12 +1975,25 @@ msgid "" "TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long instance\n" ">>>" msgstr "" +">>> bar.values = (c_byte * 4)()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long instance\n" +">>>" msgid "For these cases, the :func:`cast` function is handy." -msgstr "" +msgstr "برای این موارد، تابع :func:`cast` مفید است." -msgid "The :func:`cast` function can be used to cast a ctypes instance into a pointer to a different ctypes data type. :func:`cast` takes two parameters, a ctypes object that is or can be converted to a pointer of some kind, and a ctypes pointer type. It returns an instance of the second argument, which references the same memory block as the first argument::" +msgid "" +"The :func:`cast` function can be used to cast a ctypes instance into a pointer to a different " +"ctypes data type. :func:`cast` takes two parameters, a ctypes object that is or can be converted " +"to a pointer of some kind, and a ctypes pointer type. It returns an instance of the second " +"argument, which references the same memory block as the first argument::" msgstr "" +"از تابع :func:`cast` می‌توان برای تبدیل یک نمونه ctypes به اشاره‌گری به یک نوع داده ctypes متفاوت " +"استفاده کرد. :func:`cast` دو پارامتر می‌گیرد: یک شیء ctypes که اشاره‌گر است یا می‌تواند به اشاره‌گری " +"از یک نوع تبدیل شود، و یک نوع اشاره‌گر ctypes. این تابع یک نمونه از آرگومان دوم را برمی‌گرداند که به " +"همان بلوک حافظه‌ی آرگومان اول ارجاع می‌دهد::" msgid "" ">>> a = (c_byte * 4)()\n" @@ -1202,9 +2001,14 @@ msgid "" "\n" ">>>" msgstr "" +">>> a = (c_byte * 4)()\n" +">>> cast(a, POINTER(c_int))\n" +"\n" +">>>" msgid "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` the structure::" msgstr "" +"بنابراین، می‌توان از :func:`cast` برای انتساب ساختار به فیلد ``values`` در ``Bar`` استفاده کرد::" msgid "" ">>> bar = Bar()\n" @@ -1213,12 +2017,21 @@ msgid "" "0\n" ">>>" msgstr "" +">>> bar = Bar()\n" +">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" +">>> print(bar.values[0])\n" +"0\n" +">>>" msgid "Incomplete Types" -msgstr "" +msgstr "انواع ناقص" -msgid "*Incomplete Types* are structures, unions or arrays whose members are not yet specified. In C, they are specified by forward declarations, which are defined later::" +msgid "" +"*Incomplete Types* are structures, unions or arrays whose members are not yet specified. In C, " +"they are specified by forward declarations, which are defined later::" msgstr "" +"*انواع ناقص* ساختارها، اتحادها یا آرایه‌هایی هستند که اعضای آن‌ها هنوز مشخص نشده‌اند. در C، آن‌ها با " +"اعلان‌های پیش‌رو (forward declarations) مشخص می‌شوند، که بعداً تعریف می‌شوند::" msgid "" "struct cell; /* forward declaration */\n" @@ -1228,9 +2041,15 @@ msgid "" " struct cell *next;\n" "};" msgstr "" +"struct cell; /* forward declaration */\n" +"\n" +"struct cell {\n" +" char *name;\n" +" struct cell *next;\n" +"};" msgid "The straightforward translation into ctypes code would be this, but it does not work::" -msgstr "" +msgstr "ترجمه مستقیم به کد ctypes به این صورت خواهد بود، اما کار نمی‌کند::" msgid "" ">>> class cell(Structure):\n" @@ -1243,9 +2062,23 @@ msgid "" "NameError: name 'cell' is not defined\n" ">>>" msgstr "" +">>> class cell(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 2, in cell\n" +"NameError: name 'cell' is not defined\n" +">>>" -msgid "because the new ``class cell`` is not available in the class statement itself. In :mod:`!ctypes`, we can define the ``cell`` class and set the :attr:`~Structure._fields_` attribute later, after the class statement::" +msgid "" +"because the new ``class cell`` is not available in the class statement itself. In :mod:`!ctypes`, " +"we can define the ``cell`` class and set the :attr:`~Structure._fields_` attribute later, after " +"the class statement::" msgstr "" +"زیرا ``class cell`` جدید در خود دستور کلاس در دسترس نیست. در :mod:`!ctypes`، می‌توانیم کلاس " +"``cell`` را تعریف کنیم و ویژگی :attr:`~Structure._fields_` را بعداً، پس از دستور کلاس، تنظیم کنیم::" msgid "" ">>> from ctypes import *\n" @@ -1256,9 +2089,20 @@ msgid "" "... (\"next\", POINTER(cell))]\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>> class cell(Structure):\n" +"... pass\n" +"...\n" +">>> cell._fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +">>>" -msgid "Let's try it. We create two instances of ``cell``, and let them point to each other, and finally follow the pointer chain a few times::" +msgid "" +"Let's try it. We create two instances of ``cell``, and let them point to each other, and finally " +"follow the pointer chain a few times::" msgstr "" +"بیایید آن را امتحان کنیم. دو نمونه از ``cell`` می‌سازیم و کاری می‌کنیم که آن‌ها به یکدیگر اشاره کنند، " +"و در نهایت زنجیره‌ی اشاره‌گرها را چند بار دنبال می‌کنیم::" msgid "" ">>> c1 = cell()\n" @@ -1275,24 +2119,61 @@ msgid "" "foo bar foo bar foo bar foo bar\n" ">>>" msgstr "" +">>> c1 = cell()\n" +">>> c1.name = b\"foo\"\n" +">>> c2 = cell()\n" +">>> c2.name = b\"bar\"\n" +">>> c1.next = pointer(c2)\n" +">>> c2.next = pointer(c1)\n" +">>> p = c1\n" +">>> for i in range(8):\n" +"... print(p.name, end=\" \")\n" +"... p = p.next[0]\n" +"...\n" +"foo bar foo bar foo bar foo bar\n" +">>>" msgid "Callback functions" -msgstr "" +msgstr "توابع کال‌بک" -msgid ":mod:`!ctypes` allows creating C callable function pointers from Python callables. These are sometimes called *callback functions*." +msgid "" +":mod:`!ctypes` allows creating C callable function pointers from Python callables. These are " +"sometimes called *callback functions*." msgstr "" +":mod:`!ctypes` امکان ایجاد اشاره‌گرهای تابع قابل فراخوانی از C را از روی اشیاء قابل فراخوانی پایتون " +"فراهم می‌کند. به این موارد گاهی *توابع کال‌بک* گفته می‌شود." -msgid "First, you must create a class for the callback function. The class knows the calling convention, the return type, and the number and types of arguments this function will receive." +msgid "" +"First, you must create a class for the callback function. The class knows the calling convention, " +"the return type, and the number and types of arguments this function will receive." msgstr "" +"ابتدا باید یک کلاس برای تابع کال‌بک ایجاد کنید. این کلاس قرارداد فراخوانی، نوع بازگشتی، و تعداد و " +"انواع آرگومان‌هایی را که این تابع دریافت خواهد کرد، می‌داند." -msgid "The :func:`CFUNCTYPE` factory function creates types for callback functions using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` factory function creates types for callback functions using the ``stdcall`` calling convention." +msgid "" +"The :func:`CFUNCTYPE` factory function creates types for callback functions using the ``cdecl`` " +"calling convention. On Windows, the :func:`WINFUNCTYPE` factory function creates types for " +"callback functions using the ``stdcall`` calling convention." msgstr "" +"تابع کارخانه‌ای :func:`CFUNCTYPE`، انواعی برای توابع کال‌بک با استفاده از قرارداد فراخوانی ``cdecl`` " +"ایجاد می‌کند. در ویندوز، تابع کارخانه‌ای :func:`WINFUNCTYPE` انواعی برای توابع کال‌بک با استفاده از " +"قرارداد فراخوانی ``stdcall`` ایجاد می‌کند." -msgid "Both of these factory functions are called with the result type as first argument, and the callback functions expected argument types as the remaining arguments." +msgid "" +"Both of these factory functions are called with the result type as first argument, and the " +"callback functions expected argument types as the remaining arguments." msgstr "" +"هر دوی این تابع‌های کارخانه‌ای با نوع نتیجه به‌عنوان اولین آرگومان و انواع آرگومان‌های مورد انتظار " +"برای تابع‌های کال‌بک به‌عنوان آرگومان‌های باقی‌مانده فراخوانی می‌شوند." -msgid "I will present an example here which uses the standard C library's :c:func:`!qsort` function, that is used to sort items with the help of a callback function. :c:func:`!qsort` will be used to sort an array of integers::" +msgid "" +"I will present an example here which uses the standard C library's :c:func:`!qsort` function, that " +"is used to sort items with the help of a callback function. :c:func:`!qsort` will be used to sort " +"an array of integers::" msgstr "" +"در اینجا مثالی را ارائه می‌دهم که از تابع :c:func:`!qsort` از کتابخانه استاندارد C استفاده می‌کند؛ " +"این تابع برای مرتب‌سازی آیتم‌ها با کمک یک تابع کال‌بک به کار می‌رود. از :c:func:`!qsort` برای مرتب‌سازی " +"آرایه‌ای از اعداد صحیح استفاده خواهد شد::" msgid "" ">>> IntArray5 = c_int * 5\n" @@ -1301,20 +2182,39 @@ msgid "" ">>> qsort.restype = None\n" ">>>" msgstr "" +">>> IntArray5 = c_int * 5\n" +">>> ia = IntArray5(5, 1, 7, 33, 99)\n" +">>> qsort = libc.qsort\n" +">>> qsort.restype = None\n" +">>>" -msgid ":func:`!qsort` must be called with a pointer to the data to sort, the number of items in the data array, the size of one item, and a pointer to the comparison function, the callback. The callback will then be called with two pointers to items, and it must return a negative integer if the first item is smaller than the second, a zero if they are equal, and a positive integer otherwise." +msgid "" +":func:`!qsort` must be called with a pointer to the data to sort, the number of items in the data " +"array, the size of one item, and a pointer to the comparison function, the callback. The callback " +"will then be called with two pointers to items, and it must return a negative integer if the first " +"item is smaller than the second, a zero if they are equal, and a positive integer otherwise." msgstr "" +":func:`!qsort` باید با یک اشاره‌گر به داده‌ها برای مرتب‌سازی، تعداد آیتم‌های آرایه داده، اندازه یک " +"آیتم، و یک اشاره‌گر به تابع مقایسه، یعنی کال‌بک، فراخوانی شود. سپس کال‌بک با دو اشاره‌گر به آیتم‌ها " +"فراخوانی می‌شود و باید اگر آیتم اول کوچک‌تر از آیتم دوم باشد، یک عدد صحیح منفی، اگر برابر باشند، " +"صفر، و در غیر این صورت یک عدد صحیح مثبت برگرداند." -msgid "So our callback function receives pointers to integers, and must return an integer. First we create the ``type`` for the callback function::" +msgid "" +"So our callback function receives pointers to integers, and must return an integer. First we " +"create the ``type`` for the callback function::" msgstr "" +"بنابراین تابع کال‌بک ما اشاره‌گرهایی به اعداد صحیح دریافت می‌کند و باید یک عدد صحیح برگرداند. ابتدا " +"``type`` را برای تابع کال‌بک ایجاد می‌کنیم::" msgid "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" msgstr "" +">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +">>>" msgid "To get started, here is a simple callback that shows the values it gets passed::" -msgstr "" +msgstr "برای شروع، در اینجا یک کال‌بک ساده آمده است که مقادیری را که به آن داده می‌شود نمایش می‌دهد::" msgid "" ">>> def py_cmp_func(a, b):\n" @@ -1324,9 +2224,15 @@ msgid "" ">>> cmp_func = CMPFUNC(py_cmp_func)\n" ">>>" msgstr "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return 0\n" +"...\n" +">>> cmp_func = CMPFUNC(py_cmp_func)\n" +">>>" msgid "The result::" -msgstr "" +msgstr "نتیجه::" msgid "" ">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" @@ -1337,9 +2243,16 @@ msgid "" "py_cmp_func 1 7\n" ">>>" msgstr "" +">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 5 7\n" +"py_cmp_func 1 7\n" +">>>" msgid "Now we can actually compare the two items and return a useful result::" -msgstr "" +msgstr "اکنون می‌توانیم عملاً دو آیتم را مقایسه کنیم و نتیجه‌ای مفید برگردانیم::" msgid "" ">>> def py_cmp_func(a, b):\n" @@ -1355,9 +2268,21 @@ msgid "" "py_cmp_func 5 7\n" ">>>" msgstr "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>>\n" +">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func))\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" msgid "As we can easily check, our array is sorted now::" -msgstr "" +msgstr "همان‌طور که به‌راحتی می‌توانیم بررسی کنیم، آرایه ما اکنون مرتب است::" msgid "" ">>> for i in ia: print(i, end=\" \")\n" @@ -1365,9 +2290,15 @@ msgid "" "1 5 7 33 99\n" ">>>" msgstr "" +">>> for i in ia: print(i, end=\" \")\n" +"...\n" +"1 5 7 33 99\n" +">>>" msgid "The function factories can be used as decorator factories, so we may as well write::" msgstr "" +"می‌توان از کارخانه‌های تابع به‌عنوان کارخانه‌های دکوراتور استفاده کرد، بنابراین می‌توانیم به این صورت " +"بنویسیم::" msgid "" ">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" @@ -1383,39 +2314,95 @@ msgid "" "py_cmp_func 5 7\n" ">>>" msgstr "" +">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +"... def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>> qsort(ia, len(ia), sizeof(c_int), py_cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" -msgid "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they are used from C code. :mod:`!ctypes` doesn't, and if you don't, they may be garbage collected, crashing your program when a callback is made." +msgid "" +"Make sure you keep references to :func:`CFUNCTYPE` objects as long as they are used from C " +"code. :mod:`!ctypes` doesn't, and if you don't, they may be garbage collected, crashing your " +"program when a callback is made." msgstr "" +"اطمینان حاصل کنید که تا زمانی که اشیای :func:`CFUNCTYPE` از کد C استفاده می‌شوند، ارجاع‌ها به آن‌ها " +"را نگه می‌دارید. :mod:`!ctypes` این کار را نمی‌کند، و اگر شما این کار را نکنید، ممکن است آن‌ها " +"زباله‌روبی شوند و هنگام انجام یک کال‌بک، باعث از کار افتادن برنامه‌ی شما شوند." -msgid "Also, note that if the callback function is called in a thread created outside of Python's control (e.g. by the foreign code that calls the callback), ctypes creates a new dummy Python thread on every invocation. This behavior is correct for most purposes, but it means that values stored with :class:`threading.local` will *not* survive across different callbacks, even when those calls are made from the same C thread." -msgstr "" +msgid "" +"Also, note that if the callback function is called in a thread created outside of Python's control " +"(e.g. by the foreign code that calls the callback), ctypes creates a new dummy Python thread on " +"every invocation. This behavior is correct for most purposes, but it means that values stored " +"with :class:`threading.local` will *not* survive across different callbacks, even when those calls " +"are made from the same C thread." +msgstr "" +"همچنین توجه داشته باشید که اگر تابع کال‌بک در نخی فراخوانی شود که خارج از کنترل پایتون ایجاد شده " +"است (مثلاً توسط کد خارجی که کال‌بک را فراخوانی می‌کند)، ctypes در هر فراخوانی یک نخ پایتون ساختگی " +"جدید ایجاد می‌کند. این رفتار برای بیشتر اهداف صحیح است، اما به این معناست که مقادیر ذخیره‌شده " +"با :class:`threading.local` در میان کال‌بک‌های مختلف باقی *نمی‌مانند*، حتی اگر آن فراخوانی‌ها از همان " +"نخ C انجام شوند." msgid "Accessing values exported from dlls" -msgstr "" +msgstr "دسترسی به مقادیر صادرشده از DLLها" -msgid "Some shared libraries not only export functions, they also export variables. An example in the Python library itself is the :c:data:`Py_Version`, Python runtime version number encoded in a single constant integer." +msgid "" +"Some shared libraries not only export functions, they also export variables. An example in the " +"Python library itself is the :c:data:`Py_Version`, Python runtime version number encoded in a " +"single constant integer." msgstr "" +"برخی کتابخانه‌های اشتراکی نه‌تنها توابع، بلکه متغیرها را نیز صادر می‌کنند. نمونه‌ای در خود کتابخانه " +"پایتون :c:data:`Py_Version` است، شماره نسخه ران‌تایم پایتون که در یک عدد صحیح ثابت کدگذاری‌شده است." -msgid ":mod:`!ctypes` can access values like this with the :meth:`~_CData.in_dll` class methods of the type. *pythonapi* is a predefined symbol giving access to the Python C api::" +msgid "" +":mod:`!ctypes` can access values like this with the :meth:`~_CData.in_dll` class methods of the " +"type. *pythonapi* is a predefined symbol giving access to the Python C api::" msgstr "" +":mod:`!ctypes` می‌تواند با متدهای کلاس :meth:`~_CData.in_dll` مربوط به نوع، به مقادیری مانند این " +"دسترسی پیدا کند. *pythonapi* نمادی از پیش تعریف‌شده است که دسترسی به API C پایتون را فراهم می‌کند::" msgid "" ">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" ">>> print(hex(version.value))\n" "0x30c00a0" msgstr "" +">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" +">>> print(hex(version.value))\n" +"0x30c00a0" -msgid "An extended example which also demonstrates the use of pointers accesses the :c:data:`PyImport_FrozenModules` pointer exported by Python." +msgid "" +"An extended example which also demonstrates the use of pointers accesses " +"the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" +"یک مثال گسترده که همچنین کاربرد اشاره‌گرها را نشان می‌دهد، به " +"اشاره‌گر :c:data:`PyImport_FrozenModules` صادرشده توسط پایتون دسترسی پیدا می‌کند." msgid "Quoting the docs for that value:" -msgstr "" +msgstr "با نقل‌قول از مستندات برای آن مقدار:" -msgid "This pointer is initialized to point to an array of :c:struct:`_frozen` records, terminated by one whose members are all ``NULL`` or zero. When a frozen module is imported, it is searched in this table. Third-party code could play tricks with this to provide a dynamically created collection of frozen modules." +msgid "" +"This pointer is initialized to point to an array of :c:struct:`_frozen` records, terminated by one " +"whose members are all ``NULL`` or zero. When a frozen module is imported, it is searched in this " +"table. Third-party code could play tricks with this to provide a dynamically created collection " +"of frozen modules." msgstr "" +"این اشاره‌گر به‌گونه‌ای مقداردهی اولیه شده است که به آرایه‌ای از رکوردهای :c:struct:`_frozen` اشاره " +"کند؛ این آرایه با رکوردی که تمام اعضای آن ``NULL`` یا صفر هستند، پایان می‌یابد. هنگامی که یک ماژول " +"فریز (frozen module) ایمپورت می‌شود، در این جدول جستجو می‌شود. کد شخص ثالث می‌تواند با دستکاری این " +"اشاره‌گر، مجموعه‌ای از ماژول‌های فریز را که به‌صورت پویا ایجاد شده است فراهم کند." -msgid "So manipulating this pointer could even prove useful. To restrict the example size, we show only how this table can be read with :mod:`!ctypes`::" +msgid "" +"So manipulating this pointer could even prove useful. To restrict the example size, we show only " +"how this table can be read with :mod:`!ctypes`::" msgstr "" +"بنابراین دستکاری این اشاره‌گر حتی می‌تواند مفید باشد. برای محدود کردن اندازه‌ی مثال، فقط نشان می‌دهیم " +"که چگونه می‌توان این جدول را با :mod:`!ctypes` خواند::" msgid "" ">>> from ctypes import *\n" @@ -1429,18 +2416,41 @@ msgid "" "...\n" ">>>" msgstr "" +">>> from ctypes import *\n" +">>>\n" +">>> class struct_frozen(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"code\", POINTER(c_ubyte)),\n" +"... (\"size\", c_int),\n" +"... (\"get_code\", POINTER(c_ubyte)), # Function pointer\n" +"... ]\n" +"...\n" +">>>" msgid "We have defined the :c:struct:`_frozen` data type, so we can get the pointer to the table::" msgstr "" +"ما نوع داده :c:struct:`_frozen` را تعریف کرده‌ایم، بنابراین می‌توانیم اشاره‌گر به جدول را دریافت " +"کنیم::" msgid "" ">>> FrozenTable = POINTER(struct_frozen)\n" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" ">>>" msgstr "" +">>> FrozenTable = POINTER(struct_frozen)\n" +">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" +">>>" -msgid "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, we can iterate over it, but we just have to make sure that our loop terminates, because pointers have no size. Sooner or later it would probably crash with an access violation or whatever, so it's better to break out of the loop when we hit the ``NULL`` entry::" +msgid "" +"Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, we can iterate over " +"it, but we just have to make sure that our loop terminates, because pointers have no size. Sooner " +"or later it would probably crash with an access violation or whatever, so it's better to break out " +"of the loop when we hit the ``NULL`` entry::" msgstr "" +"از آن‌جا که ``table`` یک اشاره‌گر (``pointer``) به آرایه‌ای از رکوردهای ``struct_frozen`` است، " +"می‌توانیم آن را پیمایش کنیم، اما فقط باید مطمئن شویم که حلقه ما خاتمه می‌یابد، زیرا اشاره‌گرها اندازه " +"ندارند. دیر یا زود احتمالاً با نقض دسترسی یا چیزی مشابه از کار می‌افتد، بنابراین بهتر است هنگامی که " +"به ورودی ``NULL`` می‌رسیم، از حلقه خارج شویم::" msgid "" ">>> for item in table:\n" @@ -1453,20 +2463,57 @@ msgid "" "zipimport 12345\n" ">>>" msgstr "" - -msgid "The fact that standard Python has a frozen module and a frozen package (indicated by the negative ``size`` member) is not well known, it is only used for testing. Try it out with ``import __hello__`` for example." -msgstr "" - -msgid "Surprises" -msgstr "" - -msgid "There are some edges in :mod:`!ctypes` where you might expect something other than what actually happens." -msgstr "" - -msgid "Consider the following example::" -msgstr "" - -msgid "" +">>> for item in table:\n" +"... if item.name is None:\n" +"... break\n" +"... print(item.name.decode(\"ascii\"), item.size)\n" +"...\n" +"_frozen_importlib 31764\n" +"_frozen_importlib_external 41499\n" +"zipimport 12345\n" +">>>" + +msgid "" +"The fact that standard Python has a frozen module and a frozen package (indicated by the negative " +"``size`` member) is not well known, it is only used for testing. Try it out with ``import " +"__hello__`` for example." +msgstr "" +"این واقعیت که پایتون استاندارد یک ماژول فریز (frozen module) و یک بسته فریز (frozen package) " +"دارد (که با منفی بودن عضو ``size`` مشخص می‌شود) چندان شناخته‌شده نیست؛ این موارد فقط برای آزمایش " +"استفاده می‌شوند. برای مثال، آن را با ``import __hello__`` امتحان کنید." + +msgid "Surprises" +msgstr "شگفتی‌ها" + +msgid "" +"There are some edges in :mod:`!ctypes` where you might expect something other than what actually " +"happens." +msgstr "" +"در :mod:`!ctypes` چند حالت مرزی وجود دارد که ممکن است انتظار چیزی غیر از آنچه واقعاً رخ می‌دهد داشته " +"باشید." + +msgid "Consider the following example::" +msgstr "مثال زیر را در نظر بگیرید::" + +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class RECT(Structure):\n" +"... _fields_ = (\"a\", POINT), (\"b\", POINT)\n" +"...\n" +">>> p1 = POINT(1, 2)\n" +">>> p2 = POINT(3, 4)\n" +">>> rc = RECT(p1, p2)\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"1 2 3 4\n" +">>> # now swap the two points\n" +">>> rc.a, rc.b = rc.b, rc.a\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"3 4 3 4\n" +">>>" +msgstr "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" "... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" @@ -1484,10 +2531,13 @@ msgid "" ">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" "3 4 3 4\n" ">>>" -msgstr "" -msgid "Hm. We certainly expected the last statement to print ``3 4 1 2``. What happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" +msgid "" +"Hm. We certainly expected the last statement to print ``3 4 1 2``. What happened? Here are the " +"steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" +"هم. قطعاً انتظار داشتیم آخرین دستور ``3 4 1 2`` را چاپ کند. چه اتفاقی افتاد؟ مراحل خط ``rc.a, rc.b " +"= rc.b, rc.a`` در بالا به شرح زیر است::" msgid "" ">>> temp0, temp1 = rc.b, rc.a\n" @@ -1495,15 +2545,31 @@ msgid "" ">>> rc.b = temp1\n" ">>>" msgstr "" +">>> temp0, temp1 = rc.b, rc.a\n" +">>> rc.a = temp0\n" +">>> rc.b = temp1\n" +">>>" -msgid "Note that ``temp0`` and ``temp1`` are objects still using the internal buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the buffer contents of ``temp0`` into ``rc`` 's buffer. This, in turn, changes the contents of ``temp1``. So, the last assignment ``rc.b = temp1``, doesn't have the expected effect." +msgid "" +"Note that ``temp0`` and ``temp1`` are objects still using the internal buffer of the ``rc`` object " +"above. So executing ``rc.a = temp0`` copies the buffer contents of ``temp0`` into ``rc`` 's " +"buffer. This, in turn, changes the contents of ``temp1``. So, the last assignment ``rc.b = " +"temp1``, doesn't have the expected effect." msgstr "" +"توجه داشته باشید که ``temp0`` و ``temp1`` اشیایی هستند که هنوز از بافر درونی شیء ``rc`` در بالا " +"استفاده می‌کنند. بنابراین اجرای ``rc.a = temp0`` محتوای بافر ``temp0`` را به بافر ``rc`` رونوشت " +"می‌کند. این کار به نوبه خود، محتوای ``temp1`` را تغییر می‌کند. بنابراین، آخرین انتساب ``rc.b = " +"temp1``، اثر مورد انتظار را ندارد." -msgid "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays doesn't *copy* the sub-object, instead it retrieves a wrapper object accessing the root-object's underlying buffer." +msgid "" +"Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays doesn't *copy* the sub-" +"object, instead it retrieves a wrapper object accessing the root-object's underlying buffer." msgstr "" +"به خاطر داشته باشید که بازیابی زیرشیء‌ها از Structure، Unions و Arrays، زیرشیء را *کپی* نمی‌کند، " +"بلکه شیء پوششی‌ای را بازیابی می‌کند که به بافر زیرین شیء ریشه دسترسی دارد." msgid "Another example that may behave differently from what one would expect is this::" -msgstr "" +msgstr "مثال دیگری که ممکن است رفتاری متفاوت از آنچه انتظار می‌رود داشته باشد، این است::" msgid "" ">>> s = c_char_p()\n" @@ -1514,21 +2580,46 @@ msgid "" "False\n" ">>>" msgstr "" +">>> s = c_char_p()\n" +">>> s.value = b\"abc def ghi\"\n" +">>> s.value\n" +"b'abc def ghi'\n" +">>> s.value is s.value\n" +"False\n" +">>>" -msgid "Objects instantiated from :class:`c_char_p` can only have their value set to bytes or integers." +msgid "" +"Objects instantiated from :class:`c_char_p` can only have their value set to bytes or integers." msgstr "" +"مقدار اشیاء نمونه‌سازی‌شده از :class:`c_char_p` فقط می‌تواند روی بایت‌ها یا اعداد صحیح تنظیم شود." -msgid "Why is it printing ``False``? ctypes instances are objects containing a memory block plus some :term:`descriptor`\\s accessing the contents of the memory. Storing a Python object in the memory block does not store the object itself, instead the ``contents`` of the object is stored. Accessing the contents again constructs a new Python object each time!" +msgid "" +"Why is it printing ``False``? ctypes instances are objects containing a memory block plus " +"some :term:`descriptor`\\s accessing the contents of the memory. Storing a Python object in the " +"memory block does not store the object itself, instead the ``contents`` of the object is stored. " +"Accessing the contents again constructs a new Python object each time!" msgstr "" +"چرا ``False`` چاپ می‌شود؟ نمونه‌های ctypes اشیایی هستند که شامل یک بلوک حافظه به‌همراه " +"چند :term:`descriptor` برای دسترسی به محتوای حافظه هستند. ذخیره کردن یک شیء پایتون در بلوک حافظه، " +"خود شیء را ذخیره نمی‌کند، بلکه ``contents`` آن شیء ذخیره می‌شود. دسترسی دوباره به محتوا، هر بار یک " +"شیء پایتون جدید می‌سازد!" msgid "Variable-sized data types" -msgstr "" +msgstr "انواع داده با اندازه متغیر" msgid ":mod:`!ctypes` provides some support for variable-sized arrays and structures." -msgstr "" +msgstr ":mod:`!ctypes` پشتیبانی تا حدی برای آرایه‌ها و ساختارهای با اندازه‌ی متغیر فراهم می‌کند." -msgid "The :func:`resize` function can be used to resize the memory buffer of an existing ctypes object. The function takes the object as first argument, and the requested size in bytes as the second argument. The memory block cannot be made smaller than the natural memory block specified by the objects type, a :exc:`ValueError` is raised if this is tried::" +msgid "" +"The :func:`resize` function can be used to resize the memory buffer of an existing ctypes object. " +"The function takes the object as first argument, and the requested size in bytes as the second " +"argument. The memory block cannot be made smaller than the natural memory block specified by the " +"objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" +"می‌توان از تابع :func:`resize` برای تغییر اندازه بافر حافظه یک شیء ctypes موجود استفاده کرد. این " +"تابع شیء را به‌عنوان آرگومان اول و اندازه درخواستی بر حسب بایت را به‌عنوان آرگومان دوم می‌گیرد. " +"نمی‌توان بلوک حافظه را کوچک‌تر از بلوک حافظه طبیعی تعیین‌شده توسط نوع شیء کرد؛ در صورت تلاش برای این " +"کار، استثنای :exc:`ValueError` پرتاب می‌شود::" msgid "" ">>> short_array = (c_short * 4)()\n" @@ -1545,9 +2636,26 @@ msgid "" "8\n" ">>>" msgstr "" +">>> short_array = (c_short * 4)()\n" +">>> print(sizeof(short_array))\n" +"8\n" +">>> resize(short_array, 4)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: minimum size is 8\n" +">>> resize(short_array, 32)\n" +">>> sizeof(short_array)\n" +"32\n" +">>> sizeof(type(short_array))\n" +"8\n" +">>>" -msgid "This is nice and fine, but how would one access the additional elements contained in this array? Since the type still only knows about 4 elements, we get errors accessing other elements::" +msgid "" +"This is nice and fine, but how would one access the additional elements contained in this array? " +"Since the type still only knows about 4 elements, we get errors accessing other elements::" msgstr "" +"این خوب و مناسب است، اما چگونه می‌توان به المان‌های اضافی موجود در این آرایه دسترسی داشت؟ از آنجا که " +"نوع هنوز تنها از ۴ المان آگاه است، هنگام دسترسی به سایر المان‌ها با خطا مواجه می‌شویم::" msgid "" ">>> short_array[:]\n" @@ -1558,42 +2666,91 @@ msgid "" "IndexError: invalid index\n" ">>>" msgstr "" +">>> short_array[:]\n" +"[0, 0, 0, 0]\n" +">>> short_array[7]\n" +"Traceback (most recent call last):\n" +" ...\n" +"IndexError: invalid index\n" +">>>" -msgid "Another way to use variable-sized data types with :mod:`!ctypes` is to use the dynamic nature of Python, and (re-)define the data type after the required size is already known, on a case by case basis." +msgid "" +"Another way to use variable-sized data types with :mod:`!ctypes` is to use the dynamic nature of " +"Python, and (re-)define the data type after the required size is already known, on a case by case " +"basis." msgstr "" +"راه دیگر برای استفاده از انواع داده با اندازه‌ی متغیر با :mod:`!ctypes` این است که از ماهیت پویا " +"پایتون استفاده کنید و نوع داده را پس از این‌که اندازه‌ی موردنیاز از قبل مشخص شد، به‌صورت مورد به مورد " +"(باز)تعریف کنید." msgid "ctypes reference" -msgstr "" +msgstr "مرجع ctypes" msgid "Finding shared libraries" -msgstr "" +msgstr "یافتن کتابخانه‌های مشترک" -msgid "When programming in a compiled language, shared libraries are accessed when compiling/linking a program, and when the program is run." +msgid "" +"When programming in a compiled language, shared libraries are accessed when compiling/linking a " +"program, and when the program is run." msgstr "" +"هنگام برنامه‌نویسی در یک زبان کامپایل‌شده، در زمان کامپایل/لینک کردن یک برنامه و نیز هنگامی که " +"برنامه اجرا می‌شود، به کتابخانه‌های اشتراکی دسترسی پیدا می‌شود." -msgid "The purpose of the :func:`~ctypes.util.find_library` function is to locate a library in a way similar to what the compiler or runtime loader does (on platforms with several versions of a shared library the most recent should be loaded), while the ctypes library loaders act like when a program is run, and call the runtime loader directly." +msgid "" +"The purpose of the :func:`~ctypes.util.find_library` function is to locate a library in a way " +"similar to what the compiler or runtime loader does (on platforms with several versions of a " +"shared library the most recent should be loaded), while the ctypes library loaders act like when a " +"program is run, and call the runtime loader directly." msgstr "" +"هدف از تابع :func:`~ctypes.util.find_library` این است که یک کتابخانه را به شیوه‌ای مشابه آنچه " +"کامپایلر یا بارگذار ران‌تایم انجام می‌دهد بیابد (در سکوهایی که چند نسخه از یک کتابخانه اشتراکی " +"دارند، باید جدیدترین نسخه بارگذاری شود)، در حالی که بارگذارهای کتابخانه ctypes مانند زمانی که یک " +"برنامه اجرا می‌شود عمل می‌کنند و بارگذار ران‌تایم را مستقیماً فراخوانی می‌کنند." -msgid "The :mod:`!ctypes.util` module provides a function which can help to determine the library to load." +msgid "" +"The :mod:`!ctypes.util` module provides a function which can help to determine the library to load." msgstr "" +"ماژول :mod:`!ctypes.util` تابعی فراهم می‌کند که می‌تواند به تعیین کتابخانه‌ای که باید بارگذاری شود " +"کمک کند." -msgid "Try to find a library and return a pathname. *name* is the library name without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`!-l`). If no library can be found, returns ``None``." +msgid "" +"Try to find a library and return a pathname. *name* is the library name without any prefix like " +"*lib*, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix " +"linker option :option:`!-l`). If no library can be found, returns ``None``." msgstr "" +"تلاش می‌کند یک کتابخانه را پیدا کند و یک مسیر را برگرداند. *name* نام کتابخانه بدون هیچ پیشوندی " +"مانند *lib*، پسوندی مانند ``.so``، ``.dylib`` یا شماره‌ی نسخه است (این همان قالبی است که برای گزینه‌ی " +"پیونددهنده‌ی posix یعنی :option:`!-l` استفاده می‌شود). اگر هیچ کتابخانه‌ای پیدا نشود، ``None`` را " +"برمی‌گرداند." msgid "The exact functionality is system dependent." -msgstr "" +msgstr "عملکرد دقیق، وابسته به سیستم است." -msgid "On Linux, :func:`~ctypes.util.find_library` tries to run external programs (``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It returns the filename of the library file." +msgid "" +"On Linux, :func:`~ctypes.util.find_library` tries to run external programs (``/sbin/ldconfig``, " +"``gcc``, ``objdump`` and ``ld``) to find the library file. It returns the filename of the library " +"file." msgstr "" +"در لینوکس، :func:`~ctypes.util.find_library` تلاش می‌کند برنامه‌های خارجی (``/sbin/ldconfig``، " +"``gcc``، ``objdump`` و ``ld``) را اجرا کند تا فایل کتابخانه را پیدا کند. نام فایل کتابخانه را " +"برمی‌گرداند." -msgid "Note that if the output of these programs does not correspond to the dynamic linker used by Python, the result of this function may be misleading." +msgid "" +"Note that if the output of these programs does not correspond to the dynamic linker used by " +"Python, the result of this function may be misleading." msgstr "" +"توجه داشته باشید که اگر خروجی این برنامه‌ها با پیونددهنده‌ی پویایی که پایتون از آن استفاده می‌کند " +"مطابقت نداشته باشد، نتیجه این تابع ممکن است گمراه‌کننده باشد." -msgid "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used when searching for libraries, if a library cannot be found by any other means." +msgid "" +"On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used when searching for " +"libraries, if a library cannot be found by any other means." msgstr "" +"در لینوکس، هنگام جست‌وجوی کتابخانه‌ها، اگر کتابخانه‌ای به هیچ روش دیگری یافت نشود، مقدار متغیر محیطی " +"``LD_LIBRARY_PATH`` استفاده می‌شود." msgid "Here are some examples::" -msgstr "" +msgstr "در اینجا چند مثال آمده است::" msgid "" ">>> from ctypes.util import find_library\n" @@ -1605,9 +2762,21 @@ msgid "" "'libbz2.so.1.0'\n" ">>>" msgstr "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"m\")\n" +"'libm.so.6'\n" +">>> find_library(\"c\")\n" +"'libc.so.6'\n" +">>> find_library(\"bz2\")\n" +"'libbz2.so.1.0'\n" +">>>" -msgid "On macOS and Android, :func:`~ctypes.util.find_library` uses the system's standard naming schemes and paths to locate the library, and returns a full pathname if successful::" +msgid "" +"On macOS and Android, :func:`~ctypes.util.find_library` uses the system's standard naming schemes " +"and paths to locate the library, and returns a full pathname if successful::" msgstr "" +"در macOS و Android، :func:`~ctypes.util.find_library` از طرح‌های نام‌گذاری و مسیرهای استاندارد سیستم " +"برای پیدا کردن کتابخانه استفاده می‌کند و در صورت موفقیت، یک نام مسیر کامل را برمی‌گرداند::" msgid "" ">>> from ctypes.util import find_library\n" @@ -1621,60 +2790,140 @@ msgid "" "'/System/Library/Frameworks/AGL.framework/AGL'\n" ">>>" msgstr "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"c\")\n" +"'/usr/lib/libc.dylib'\n" +">>> find_library(\"m\")\n" +"'/usr/lib/libm.dylib'\n" +">>> find_library(\"bz2\")\n" +"'/usr/lib/libbz2.dylib'\n" +">>> find_library(\"AGL\")\n" +"'/System/Library/Frameworks/AGL.framework/AGL'\n" +">>>" -msgid "On Windows, :func:`~ctypes.util.find_library` searches along the system search path, and returns the full pathname, but since there is no predefined naming scheme a call like ``find_library(\"c\")`` will fail and return ``None``." +msgid "" +"On Windows, :func:`~ctypes.util.find_library` searches along the system search path, and returns " +"the full pathname, but since there is no predefined naming scheme a call like " +"``find_library(\"c\")`` will fail and return ``None``." msgstr "" +"در ویندوز، :func:`~ctypes.util.find_library` در امتداد مسیر جستجوی سیستم جستجو می‌کند و مسیر کامل " +"را برمی‌گرداند، اما از آنجا که هیچ الگوی نام‌گذاری از پیش تعریف‌شده‌ای وجود ندارد، فراخوانی مانند " +"``find_library(\"c\")`` با شکست مواجه می‌شود و ``None`` را برمی‌گرداند." -msgid "If wrapping a shared library with :mod:`!ctypes`, it *may* be better to determine the shared library name at development time, and hardcode that into the wrapper module instead of using :func:`~ctypes.util.find_library` to locate the library at runtime." +msgid "" +"If wrapping a shared library with :mod:`!ctypes`, it *may* be better to determine the shared " +"library name at development time, and hardcode that into the wrapper module instead of " +"using :func:`~ctypes.util.find_library` to locate the library at runtime." msgstr "" +"اگر در حال پوشش دادن یک کتابخانه اشتراکی با :mod:`!ctypes` هستید، *ممکن است* بهتر باشد نام " +"کتابخانه اشتراکی را در زمان توسعه تعیین کنید و آن را به‌صورت مقدار ثابت (hardcode) در ماژول پوششی " +"قرار دهید، به‌جای استفاده از :func:`~ctypes.util.find_library` برای یافتن کتابخانه در ران‌تایم." msgid "Listing loaded shared libraries" -msgstr "" +msgstr "فهرست کتابخانه‌های اشتراکی بارگذاری‌شده" -msgid "When writing code that relies on code loaded from shared libraries, it can be useful to know which shared libraries have already been loaded into the current process." +msgid "" +"When writing code that relies on code loaded from shared libraries, it can be useful to know which " +"shared libraries have already been loaded into the current process." msgstr "" +"هنگام نوشتن کدی که به کد بارگذاری‌شده از کتابخانه‌های اشتراکی متکی است، دانستن اینکه کدام " +"کتابخانه‌های اشتراکی از قبل در فرایند جاری بارگذاری شده‌اند، می‌تواند مفید باشد." -msgid "The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` function, which calls the different APIs provided by the various platforms to help determine which shared libraries have already been loaded into the current process." +msgid "" +"The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` function, which calls the " +"different APIs provided by the various platforms to help determine which shared libraries have " +"already been loaded into the current process." msgstr "" +"ماژول :mod:`!ctypes.util` تابع :func:`~ctypes.util.dllist` را فراهم می‌کند، که APIهای متفاوتی را که " +"پلتفرم‌های گوناگون ارائه می‌دهند فراخوانی می‌کند تا به تعیین اینکه کدام کتابخانه‌های اشتراکی از قبل در " +"فرایند جاری بارگذاری شده‌اند کمک کند." -msgid "The exact output of this function will be system dependent. On most platforms, the first entry of this list represents the current process itself, which may be an empty string. For example, on glibc-based Linux, the return may look like::" +msgid "" +"The exact output of this function will be system dependent. On most platforms, the first entry of " +"this list represents the current process itself, which may be an empty string. For example, on " +"glibc-based Linux, the return may look like::" msgstr "" +"خروجی دقیق این تابع به سیستم وابسته است. در بیشتر پلتفرم‌ها، نخستین آیتم این فهرست خود فرایند جاری " +"را نشان می‌دهد، که ممکن است یک رشته خالی باشد. برای مثال، در لینوکس مبتنی بر glibc، ممکن است مقدار " +"بازگشتی به شکل زیر باشد::" msgid "" ">>> from ctypes.util import dllist\n" ">>> dllist()\n" "['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-linux-gnu/libc.so.6', ... ]" msgstr "" +">>> from ctypes.util import dllist\n" +">>> dllist()\n" +"['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-linux-gnu/libc.so.6', ... ]" msgid "Loading shared libraries" -msgstr "" +msgstr "بارگذاری کتابخانه‌های مشترک" -msgid "There are several ways to load shared libraries into the Python process. One way is to instantiate :py:class:`CDLL` or one of its subclasses:" +msgid "" +"There are several ways to load shared libraries into the Python process. One way is to " +"instantiate :py:class:`CDLL` or one of its subclasses:" msgstr "" +"چندین روش برای بارگذاری کتابخانه‌های مشترک در فرایند پایتون وجود دارد. یکی از روش‌ها، ایجاد نمونه‌ای " +"از :py:class:`CDLL` یا یکی از زیرکلاس‌های آن است:" msgid "Represents a loaded shared library." -msgstr "" +msgstr "نمایانگر یک کتابخانه اشتراکی بارگذاری‌شده است." -msgid "Functions in this library use the standard C calling convention, and are assumed to return :c:expr:`int`. The Python :term:`global interpreter lock` is released before calling any function exported by these libraries, and reacquired afterwards. For different function behavior, use a subclass: :py:class:`~ctypes.OleDLL`, :py:class:`~ctypes.WinDLL`, or :py:class:`~ctypes.PyDLL`." +msgid "" +"Functions in this library use the standard C calling convention, and are assumed to " +"return :c:expr:`int`. The Python :term:`global interpreter lock` is released before calling any " +"function exported by these libraries, and reacquired afterwards. For different function behavior, " +"use a subclass: :py:class:`~ctypes.OleDLL`, :py:class:`~ctypes.WinDLL`, " +"or :py:class:`~ctypes.PyDLL`." msgstr "" +"توابع این کتابخانه از قرارداد فراخوانی استاندارد C استفاده می‌کنند و فرض می‌شود که :c:expr:`int` را " +"برمی‌گردانند. :term:`global interpreter lock` پایتون پیش از فراخوانی هر تابع صادرشده توسط این " +"کتابخانه‌ها آزاد می‌شود و پس از آن دوباره گرفته می‌شود. برای رفتار متفاوت توابع، از یک زیرکلاس " +"استفاده کنید: :py:class:`~ctypes.OleDLL`، :py:class:`~ctypes.WinDLL` یا :py:class:`~ctypes.PyDLL`." -msgid "If you have an existing :py:attr:`handle ` to an already loaded shared library, it can be passed as the *handle* argument to wrap the opened library in a new :py:class:`!CDLL` object. In this case, *name* is only used to set the :py:attr:`~ctypes.CDLL._name` attribute, but it may be adjusted and/or validated." +msgid "" +"If you have an existing :py:attr:`handle ` to an already loaded shared " +"library, it can be passed as the *handle* argument to wrap the opened library in a new :py:class:`!" +"CDLL` object. In this case, *name* is only used to set the :py:attr:`~ctypes.CDLL._name` " +"attribute, but it may be adjusted and/or validated." msgstr "" +"اگر یک :py:attr:`handle ` موجود برای یک کتابخانه اشتراکی از پیش بارگذاری‌شده " +"دارید، می‌توان آن را به‌عنوان آرگومان *handle* برای دربرگرفتن کتابخانه بازشده در قالب یک شیء " +"جدید :py:class:`!CDLL` ارسال کرد. در این حالت، *name* فقط برای تنظیم " +"ویژگی :py:attr:`~ctypes.CDLL._name` استفاده می‌شود، اما ممکن است تنظیم و/یا اعتبارسنجی شود." -msgid "If *handle* is ``None``, the underlying platform's :manpage:`dlopen(3)` or :c:func:`!LoadLibrary` function is used to load the library into the process, and to get a handle to it." +msgid "" +"If *handle* is ``None``, the underlying platform's :manpage:`dlopen(3)` or :c:func:`!LoadLibrary` " +"function is used to load the library into the process, and to get a handle to it." msgstr "" +"اگر *handle* برابر ``None`` باشد، از تابع :manpage:`dlopen(3)` یا :c:func:`!LoadLibrary` پلتفرم " +"زیرین برای بارگذاری کتابخانه در فرایند و دریافت یک دسته (handle) برای آن استفاده می‌شود." -msgid "*name* is the pathname of the shared library to open. If *name* does not contain a path separator, the library is found in a platform-specific way." +msgid "" +"*name* is the pathname of the shared library to open. If *name* does not contain a path separator, " +"the library is found in a platform-specific way." msgstr "" +"*name* مسیر کتابخانه اشتراکی برای باز کردن است. اگر *name* شامل جداکننده مسیر نباشد، کتابخانه به " +"شیوه‌ای وابسته به پلتفرم یافت می‌شود." -msgid "On non-Windows systems, *name* can be ``None``. In this case, :c:func:`!dlopen` is called with ``NULL``, which opens the main program as a \"library\". (Some systems do the same is *name* is empty; ``None``/``NULL`` is more portable.)" +msgid "" +"On non-Windows systems, *name* can be ``None``. In this case, :c:func:`!dlopen` is called with " +"``NULL``, which opens the main program as a \"library\". (Some systems do the same is *name* is " +"empty; ``None``/``NULL`` is more portable.)" msgstr "" +"در سیستم‌های غیرویندوزی، *name* می‌تواند ``None`` باشد. در این حالت، :c:func:`!dlopen` با ``NULL`` " +"فراخوانی می‌شود، که برنامه‌ی اصلی را به‌عنوان یک «کتابخانه» باز می‌کند. (برخی سیستم‌ها اگر *name* خالی " +"باشد نیز همین کار را انجام می‌دهند؛ ``None``/``NULL`` قابل‌حمل‌تر است.)" msgid "CPython implementation detail" -msgstr "" +msgstr "جزئیات پیاده‌سازی CPython" -msgid "Since CPython is linked to ``libc``, a ``None`` *name* is often used to access the C standard library::" +msgid "" +"Since CPython is linked to ``libc``, a ``None`` *name* is often used to access the C standard " +"library::" msgstr "" +"از آنجا که CPython به ``libc`` پیوند داده شده است، اغلب از یک *name* با مقدار ``None`` برای دسترسی " +"به کتابخانه استاندارد C استفاده می‌شود::" msgid "" ">>> printf = ctypes.CDLL(None).printf\n" @@ -1683,39 +2932,111 @@ msgid "" "hello\n" "6" msgstr "" +">>> printf = ctypes.CDLL(None).printf\n" +">>> printf.argtypes = [ctypes.c_char_p]\n" +">>> printf(b\"hello\\n\")\n" +"hello\n" +"6" msgid "To access the Python C API, prefer :py:data:`ctypes.pythonapi` which works across platforms." msgstr "" +"برای دسترسی به Python C API، ترجیحاً از :py:data:`ctypes.pythonapi` استفاده کنید که در همه پلتفرم‌ها " +"کار می‌کند." -msgid "The *mode* parameter can be used to specify how the library is loaded. For details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is ignored. On posix systems, RTLD_NOW is always added, and is not configurable." +msgid "" +"The *mode* parameter can be used to specify how the library is loaded. For details, consult " +"the :manpage:`dlopen(3)` manpage. On Windows, *mode* is ignored. On posix systems, RTLD_NOW is " +"always added, and is not configurable." msgstr "" +"از پارامتر *mode* می‌توان برای مشخص کردن نحوه بارگذاری کتابخانه استفاده کرد. برای جزئیات، به صفحه " +"راهنمای :manpage:`dlopen(3)` مراجعه کنید. در ویندوز، *mode* نادیده گرفته می‌شود. در سیستم‌های POSIX، " +"RTLD_NOW همیشه اضافه می‌شود و قابل پیکربندی نیست." -msgid "The *use_errno* parameter, when set to true, enables a ctypes mechanism that allows accessing the system :data:`errno` error number in a safe way. :mod:`!ctypes` maintains a thread-local copy of the system's :data:`errno` variable; if you call foreign functions created with ``use_errno=True`` then the :data:`errno` value before the function call is swapped with the ctypes private copy, the same happens immediately after the function call." -msgstr "" +msgid "" +"The *use_errno* parameter, when set to true, enables a ctypes mechanism that allows accessing the " +"system :data:`errno` error number in a safe way. :mod:`!ctypes` maintains a thread-local copy of " +"the system's :data:`errno` variable; if you call foreign functions created with ``use_errno=True`` " +"then the :data:`errno` value before the function call is swapped with the ctypes private copy, the " +"same happens immediately after the function call." +msgstr "" +"پارامتر *use_errno*، هنگامی که روی true تنظیم شود، سازوکاری در ctypes را فعال می‌کند که امکان " +"دسترسی به شماره‌ی خطای سیستم :data:`errno` را به‌شکلی امن فراهم می‌کند. :mod:`!ctypes` یک نسخه‌ی محلی " +"نخی (thread-local) از متغیر :data:`errno` سیستم را نگه می‌دارد؛ اگر توابع خارجی ساخته‌شده با " +"``use_errno=True`` را فراخوانی کنید، آنگاه مقدار :data:`errno` پیش از فراخوانی تابع با نسخه‌ی خصوصی " +"ctypes مبادله می‌شود؛ همین مبادله بلافاصله پس از فراخوانی تابع نیز رخ می‌دهد." -msgid "The function :func:`ctypes.get_errno` returns the value of the ctypes private copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy to a new value and returns the former value." +msgid "" +"The function :func:`ctypes.get_errno` returns the value of the ctypes private copy, and the " +"function :func:`ctypes.set_errno` changes the ctypes private copy to a new value and returns the " +"former value." msgstr "" +"تابع :func:`ctypes.get_errno` مقدار نسخه خصوصی ctypes را برمی‌گرداند، و " +"تابع :func:`ctypes.set_errno` نسخه خصوصی ctypes را به یک مقدار جدید تغییر می‌دهد و مقدار پیشین را " +"برمی‌گرداند." -msgid "The *use_last_error* parameter, when set to true, enables the same mechanism for the Windows error code which is managed by the :func:`GetLastError` and :func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` and :func:`ctypes.set_last_error` are used to request and change the ctypes private copy of the windows error code." +msgid "" +"The *use_last_error* parameter, when set to true, enables the same mechanism for the Windows error " +"code which is managed by the :func:`GetLastError` and :func:`!SetLastError` Windows API " +"functions; :func:`ctypes.get_last_error` and :func:`ctypes.set_last_error` are used to request and " +"change the ctypes private copy of the windows error code." msgstr "" +"پارامتر *use_last_error*، هنگامی که روی true تنظیم شود، همان سازوکار را برای کد خطای ویندوز، که " +"توسط توابع API ویندوز :func:`GetLastError` و :func:`!SetLastError` مدیریت می‌شود، فعال می‌کند؛ " +"از :func:`ctypes.get_last_error` و :func:`ctypes.set_last_error` برای درخواست و تغییر نسخه‌ی خصوصی " +"ctypes از کد خطای ویندوز استفاده می‌شود." -msgid "The *winmode* parameter is used on Windows to specify how the library is loaded (since *mode* is ignored). It takes any value that is valid for the Win32 API ``LoadLibraryEx`` flags parameter. When omitted, the default is to use the flags that result in the most secure DLL load, which avoids issues such as DLL hijacking. Passing the full path to the DLL is the safest way to ensure the correct library and dependencies are loaded." -msgstr "" +msgid "" +"The *winmode* parameter is used on Windows to specify how the library is loaded (since *mode* is " +"ignored). It takes any value that is valid for the Win32 API ``LoadLibraryEx`` flags parameter. " +"When omitted, the default is to use the flags that result in the most secure DLL load, which " +"avoids issues such as DLL hijacking. Passing the full path to the DLL is the safest way to ensure " +"the correct library and dependencies are loaded." +msgstr "" +"پارامتر *winmode* در ویندوز برای مشخص کردن چگونگی بارگذاری کتابخانه استفاده می‌شود (زیرا *mode* در " +"نظر گرفته نمی‌شود). این پارامتر هر مقداری را می‌پذیرد که برای پارامتر پرچم‌های ``LoadLibraryEx`` در " +"Win32 API معتبر باشد. در صورت حذف، پیش‌فرض استفاده از پرچم‌هایی است که به امن‌ترین بارگذاری DLL منجر " +"می‌شوند و از مسائلی مانند ربایش DLL (DLL hijacking) جلوگیری می‌کنند. ارسال مسیر کامل DLL، امن‌ترین " +"راه برای اطمینان از بارگذاری کتابخانه و وابستگی‌های صحیح است." -msgid "On Windows creating a :class:`CDLL` instance may fail even if the DLL name exists. When a dependent DLL of the loaded DLL is not found, a :exc:`OSError` error is raised with the message *\"[WinError 126] The specified module could not be found\".* This error message does not contain the name of the missing DLL because the Windows API does not return this information making this error hard to diagnose. To resolve this error and determine which DLL is not found, you need to find the list of dependent DLLs and determine which one is not found using Windows debugging and tracing tools." -msgstr "" +msgid "" +"On Windows creating a :class:`CDLL` instance may fail even if the DLL name exists. When a " +"dependent DLL of the loaded DLL is not found, a :exc:`OSError` error is raised with the message " +"*\"[WinError 126] The specified module could not be found\".* This error message does not contain " +"the name of the missing DLL because the Windows API does not return this information making this " +"error hard to diagnose. To resolve this error and determine which DLL is not found, you need to " +"find the list of dependent DLLs and determine which one is not found using Windows debugging and " +"tracing tools." +msgstr "" +"در ویندوز، ایجاد یک نمونه از :class:`CDLL` ممکن است حتی اگر نام DLL وجود داشته باشد شکست بخورد. " +"هنگامی که یک DLL وابسته به DLL بارگذاری‌شده پیدا نشود، یک خطای :exc:`OSError` با پیام *\"[WinError " +"126] The specified module could not be found\".* پرتاب می‌شود. این پیام خطا حاوی نام DLL مفقود " +"نیست، زیرا API ویندوز این اطلاعات را برنمی‌گرداند و این موضوع، تشخیص این خطا را دشوار می‌کند. برای " +"رفع این خطا و تعیین این‌که کدام DLL پیدا نشده است، باید فهرست DLLهای وابسته را پیدا کنید و با " +"استفاده از ابزارهای اشکال‌زدایی و ردگیری ویندوز مشخص کنید کدام‌یک پیدا نشده است." -msgid "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." +msgid "" +"`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" +"`ابزار DUMPBIN مایکروسافت `_ -- ابزاری برای یافتن وابسته‌های DLL." msgid "Added *winmode* parameter." -msgstr "" +msgstr "پارامتر *winmode* اضافه شد." msgid "The *name* parameter can now be a :term:`path-like object`." -msgstr "" +msgstr "پارامتر *name* اکنون می‌تواند یک :term:`path-like object` باشد." -msgid "Instances of this class have no public methods. Functions exported by the shared library can be accessed as attributes or by index. Please note that accessing the function through an attribute caches the result and therefore accessing it repeatedly returns the same object each time. On the other hand, accessing it through an index returns a new object each time::" +msgid "" +"Instances of this class have no public methods. Functions exported by the shared library can be " +"accessed as attributes or by index. Please note that accessing the function through an attribute " +"caches the result and therefore accessing it repeatedly returns the same object each time. On the " +"other hand, accessing it through an index returns a new object each time::" msgstr "" +"نمونه‌های این کلاس هیچ متد عمومی ندارند. می‌توان به توابع صادرشده توسط کتابخانه مشترک به‌صورت صفت یا " +"از طریق اندیس دسترسی داشت. لطفاً توجه داشته باشید که دسترسی به تابع از طریق یک صفت، نتیجه را در " +"نهانگاه ذخیره می‌کند و بنابراین دسترسی مکرر به آن هر بار همان شیء را برمی‌گرداند. از سوی دیگر، " +"دسترسی به آن از طریق یک اندیس هر بار یک شیء جدید برمی‌گرداند::" msgid "" ">>> from ctypes import CDLL\n" @@ -1725,96 +3046,189 @@ msgid "" ">>> libc['time'] == libc['time']\n" "False" msgstr "" +">>> from ctypes import CDLL\n" +">>> libc = CDLL(\"libc.so.6\") # On Linux\n" +">>> libc.time == libc.time\n" +"True\n" +">>> libc['time'] == libc['time']\n" +"False" -msgid "The following public attributes are available. Their name starts with an underscore to not clash with exported function names:" +msgid "" +"The following public attributes are available. Their name starts with an underscore to not clash " +"with exported function names:" msgstr "" +"ویژگی‌های عمومی زیر در دسترس هستند. نام آن‌ها با یک زیرخط آغاز می‌شود تا با نام توابع صادرشده تداخل " +"نداشته باشد:" msgid "The system handle used to access the library." -msgstr "" +msgstr "دسته‌ی سیستمی که برای دسترسی به کتابخانه استفاده می‌شود." msgid "The name of the library passed in the constructor." -msgstr "" +msgstr "نام کتابخانه‌ای که در سازنده ارسال می‌شود." msgid "See :py:class:`~ctypes.CDLL`, the superclass, for common information." -msgstr "" +msgstr "برای اطلاعات مشترک، :py:class:`~ctypes.CDLL`، ابرکلاس را ببینید." -msgid "Functions in this library use the ``stdcall`` calling convention, and are assumed to return the windows specific :class:`HRESULT` code. :class:`HRESULT` values contain information specifying whether the function call failed or succeeded, together with additional error code. If the return value signals a failure, an :class:`OSError` is automatically raised." +msgid "" +"Functions in this library use the ``stdcall`` calling convention, and are assumed to return the " +"windows specific :class:`HRESULT` code. :class:`HRESULT` values contain information specifying " +"whether the function call failed or succeeded, together with additional error code. If the return " +"value signals a failure, an :class:`OSError` is automatically raised." msgstr "" +"توابع این کتابخانه از قرارداد فراخوانی ``stdcall`` استفاده می‌کنند، و فرض می‌شود کد :class:`HRESULT` " +"مخصوص ویندوز را برمی‌گردانند. مقادیر :class:`HRESULT` حاوی اطلاعاتی هستند که مشخص می‌کنند آیا " +"فراخوانی تابع ناموفق بوده است یا موفق، به همراه کد خطای اضافی. اگر مقدار بازگشتی نشان‌دهنده‌ی شکست " +"باشد، یک :class:`OSError` به‌طور خودکار پرتاب می‌شود." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" msgid ":exc:`WindowsError` used to be raised, which is now an alias of :exc:`OSError`." -msgstr "" +msgstr "پیش‌تر :exc:`WindowsError` پرتاب می‌شد، که اکنون نام مستعاری از :exc:`OSError` است." -msgid "Functions in these libraries use the ``stdcall`` calling convention, and are assumed to return :c:expr:`int` by default." +msgid "" +"Functions in these libraries use the ``stdcall`` calling convention, and are assumed to " +"return :c:expr:`int` by default." msgstr "" +"توابع در این کتابخانه‌ها از قرارداد فراخوانی ``stdcall`` استفاده می‌کنند، و فرض می‌شود که به‌طور " +"پیش‌فرض :c:expr:`int` برمی‌گردانند." -msgid "When functions in this library are called, the Python GIL is *not* released during the function call, and after the function execution the Python error flag is checked. If the error flag is set, a Python exception is raised." +msgid "" +"When functions in this library are called, the Python GIL is *not* released during the function " +"call, and after the function execution the Python error flag is checked. If the error flag is set, " +"a Python exception is raised." msgstr "" +"هنگامی که توابع این کتابخانه فراخوانی می‌شوند، GIL پایتون در حین فراخوانی تابع آزاد *نمی‌شود*، و پس " +"از اجرای تابع، پرچم خطای پایتون بررسی می‌شود. اگر پرچم خطا تنظیم شده باشد، یک استثنای پایتون پرتاب " +"می‌شود." msgid "Thus, this is only useful to call Python C API functions directly." -msgstr "" +msgstr "بنابراین، این تنها برای فراخوانی مستقیم توابع Python C API مفید است." -msgid "Flag to use as *mode* parameter. On platforms where this flag is not available, it is defined as the integer zero." +msgid "" +"Flag to use as *mode* parameter. On platforms where this flag is not available, it is defined as " +"the integer zero." msgstr "" +"پرچمی که به‌عنوان پارامتر *mode* استفاده می‌شود. در سکوهای فاقد این پرچم، به‌صورت عدد صحیح صفر تعریف " +"شده است." -msgid "Flag to use as *mode* parameter. On platforms where this is not available, it is the same as *RTLD_GLOBAL*." +msgid "" +"Flag to use as *mode* parameter. On platforms where this is not available, it is the same as " +"*RTLD_GLOBAL*." msgstr "" +"پرچمی برای استفاده به‌عنوان پارامتر *mode*. در سکوهایی که این در دسترس نیست، همانند *RTLD_GLOBAL* " +"است." -msgid "The default mode which is used to load shared libraries. On OSX 10.3, this is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." +msgid "" +"The default mode which is used to load shared libraries. On OSX 10.3, this is *RTLD_GLOBAL*, " +"otherwise it is the same as *RTLD_LOCAL*." msgstr "" +"حالت پیش‌فرضی که برای بارگذاری کتابخانه‌های اشتراکی به کار می‌رود. در OSX 10.3، این *RTLD_GLOBAL* " +"است، در غیر این صورت همانند *RTLD_LOCAL* است." -msgid "Shared libraries can also be loaded by using one of the prefabricated objects, which are instances of the :class:`LibraryLoader` class, either by calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the library as attribute of the loader instance." +msgid "" +"Shared libraries can also be loaded by using one of the prefabricated objects, which are instances " +"of the :class:`LibraryLoader` class, either by calling the :meth:`~LibraryLoader.LoadLibrary` " +"method, or by retrieving the library as attribute of the loader instance." msgstr "" +"همچنین می‌توان کتابخانه‌های اشتراکی را با استفاده از یکی از اشیاء از پیش ساخته‌شده، که نمونه‌هایی از " +"کلاس :class:`LibraryLoader` هستند، بارگذاری کرد؛ خواه با فراخوانی " +"متد :meth:`~LibraryLoader.LoadLibrary`، خواه با بازیابی کتابخانه به‌عنوان ویژگیِ نمونه‌ی بارگذار." -msgid "Class which loads shared libraries. *dlltype* should be one of the :class:`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." +msgid "" +"Class which loads shared libraries. *dlltype* should be one of " +"the :class:`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" +"کلاسی که کتابخانه‌های اشتراکی را بارگذاری می‌کند. *dlltype* باید یکی از " +"انواع :class:`CDLL`، :class:`PyDLL`، :class:`WinDLL` یا :class:`OleDLL` باشد." -msgid ":meth:`!__getattr__` has special behavior: It allows loading a shared library by accessing it as attribute of a library loader instance. The result is cached, so repeated attribute accesses return the same library each time." +msgid "" +":meth:`!__getattr__` has special behavior: It allows loading a shared library by accessing it as " +"attribute of a library loader instance. The result is cached, so repeated attribute accesses " +"return the same library each time." msgstr "" +":meth:`!__getattr__` رفتار ویژه‌ای دارد: این متد امکان بارگذاری یک کتابخانه مشترک را با دسترسی به " +"آن به‌عنوان یک ویژگی از یک نمونه بارگذار کتابخانه فراهم می‌کند. نتیجه در نهانگاه ذخیره می‌شود، " +"بنابراین دسترسی‌های مکرر به ویژگی، هر بار همان کتابخانه را برمی‌گردانند." -msgid "Load a shared library into the process and return it. This method always returns a new instance of the library." +msgid "" +"Load a shared library into the process and return it. This method always returns a new instance " +"of the library." msgstr "" +"یک کتابخانه اشتراکی را در فرایند بارگذاری می‌کند و آن را برمی‌گرداند. این متد همیشه یک نمونه جدید از " +"کتابخانه را برمی‌گرداند." msgid "These prefabricated library loaders are available:" -msgstr "" +msgstr "این بارگذارهای کتابخانه‌ای از پیش ساخته‌شده در دسترس هستند:" msgid "Creates :class:`CDLL` instances." -msgstr "" +msgstr "نمونه‌های :class:`CDLL` را ایجاد می‌کند." msgid "Creates :class:`WinDLL` instances." -msgstr "" +msgstr "نمونه‌های :class:`WinDLL` را ایجاد می‌کند." msgid "Creates :class:`OleDLL` instances." -msgstr "" +msgstr "نمونه‌های :class:`OleDLL` را ایجاد می‌کند." msgid "Creates :class:`PyDLL` instances." -msgstr "" +msgstr "نمونه‌های :class:`PyDLL` را ایجاد می‌کند." -msgid "For accessing the C Python api directly, a ready-to-use Python shared library object is available:" -msgstr "" +msgid "" +"For accessing the C Python api directly, a ready-to-use Python shared library object is available:" +msgstr "برای دسترسی مستقیم به API پایتون C، یک شیء کتابخانه مشترک پایتون آماده استفاده در دسترس است:" -msgid "An instance of :class:`PyDLL` that exposes Python C API functions as attributes. Note that all these functions are assumed to return C :c:expr:`int`, which is of course not always the truth, so you have to assign the correct :attr:`!restype` attribute to use these functions." +msgid "" +"An instance of :class:`PyDLL` that exposes Python C API functions as attributes. Note that all " +"these functions are assumed to return C :c:expr:`int`, which is of course not always the truth, so " +"you have to assign the correct :attr:`!restype` attribute to use these functions." msgstr "" +"نمونه‌ای از :class:`PyDLL` که توابع Python C API را به‌عنوان ویژگی‌ها در دسترس قرار می‌دهد. توجه داشته " +"باشید که فرض می‌شود همه‌ی این توابع مقداری از نوع C :c:expr:`int` را برمی‌گردانند، که البته همیشه درست " +"نیست، بنابراین برای استفاده از این توابع باید ویژگی :attr:`!restype` صحیح را اختصاص دهید." -msgid "Loading a library through any of these objects raises an :ref:`auditing event ` ``ctypes.dlopen`` with string argument ``name``, the name used to load the library." +msgid "" +"Loading a library through any of these objects raises an :ref:`auditing event ` " +"``ctypes.dlopen`` with string argument ``name``, the name used to load the library." msgstr "" +"بارگذاری یک کتابخانه از طریق هر یک از این اشیاء، یک :ref:`رویداد حسابرسی (auditing) ` " +"``ctypes.dlopen`` را با آرگومان رشته‌ای ``name``، نام استفاده‌شده برای بارگذاری کتابخانه، پرتاب " +"می‌کند." -msgid "Accessing a function on a loaded library raises an auditing event ``ctypes.dlsym`` with arguments ``library`` (the library object) and ``name`` (the symbol's name as a string or integer)." +msgid "" +"Accessing a function on a loaded library raises an auditing event ``ctypes.dlsym`` with arguments " +"``library`` (the library object) and ``name`` (the symbol's name as a string or integer)." msgstr "" +"دسترسی به یک تابع در یک کتابخانه بارگذاری‌شده، باعث پرتاب یک رویداد حسابرسی ``ctypes.dlsym`` با " +"آرگومان‌های ``library`` (شیء کتابخانه) و ``name`` (نام نماد به‌صورت یک رشته یا عدد صحیح) می‌شود." -msgid "In cases when only the library handle is available rather than the object, accessing a function raises an auditing event ``ctypes.dlsym/handle`` with arguments ``handle`` (the raw library handle) and ``name``." +msgid "" +"In cases when only the library handle is available rather than the object, accessing a function " +"raises an auditing event ``ctypes.dlsym/handle`` with arguments ``handle`` (the raw library " +"handle) and ``name``." msgstr "" +"در مواردی که به جای شیء، تنها دسته‌ی کتابخانه در دسترس باشد، دسترسی به یک تابع، رویداد حسابرسی " +"``ctypes.dlsym/handle`` را با آرگومان‌های ``handle`` (دسته‌ی خام کتابخانه) و ``name`` پرتاب می‌کند." msgid "Foreign functions" -msgstr "" +msgstr "توابع خارجی" -msgid "As explained in the previous section, foreign functions can be accessed as attributes of loaded shared libraries. The function objects created in this way by default accept any number of arguments, accept any ctypes data instances as arguments, and return the default result type specified by the library loader." +msgid "" +"As explained in the previous section, foreign functions can be accessed as attributes of loaded " +"shared libraries. The function objects created in this way by default accept any number of " +"arguments, accept any ctypes data instances as arguments, and return the default result type " +"specified by the library loader." msgstr "" +"همان‌طور که در بخش پیشین توضیح داده شد، توابع خارجی به‌عنوان ویژگی‌های کتابخانه‌های اشتراکی " +"بارگذاری‌شده قابل دسترسی هستند. اشیای تابعی که به این روش ایجاد می‌شوند، به‌طور پیش‌فرض هر تعداد " +"آرگومان را می‌پذیرند، هر نمونه داده‌ای از ctypes را به‌عنوان آرگومان می‌پذیرند و نوع نتیجه پیش‌فرضی که " +"توسط بارگذار کتابخانه مشخص شده است را برمی‌گردانند." -msgid "They are instances of a private local class :class:`!_FuncPtr` (not exposed in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" +msgid "" +"They are instances of a private local class :class:`!_FuncPtr` (not exposed in :mod:`!ctypes`) " +"which inherits from the private :class:`_CFuncPtr` class:" msgstr "" +"آن‌ها نمونه‌هایی از یک کلاس محلی خصوصی :class:`!_FuncPtr` هستند (در :mod:`!ctypes` در معرض نیست) که " +"از کلاس خصوصی :class:`_CFuncPtr` ارث می‌برد:" msgid "" ">>> import ctypes\n" @@ -1824,126 +3238,280 @@ msgid "" ">>> lib._FuncPtr is ctypes._CFuncPtr\n" "False" msgstr "" +">>> import ctypes\n" +">>> lib = ctypes.CDLL(None)\n" +">>> issubclass(lib._FuncPtr, ctypes._CFuncPtr)\n" +"True\n" +">>> lib._FuncPtr is ctypes._CFuncPtr\n" +"False" msgid "Base class for C callable foreign functions." -msgstr "" +msgstr "کلاس پایه برای توابع خارجی قابل فراخوانی در C." -msgid "Instances of foreign functions are also C compatible data types; they represent C function pointers." +msgid "" +"Instances of foreign functions are also C compatible data types; they represent C function " +"pointers." msgstr "" +"نمونه‌های توابع خارجی نیز انواع داده سازگار با C هستند؛ این نمونه‌ها اشاره‌گرهای توابع C را نشان " +"می‌دهند." -msgid "This behavior can be customized by assigning to special attributes of the foreign function object." -msgstr "" +msgid "" +"This behavior can be customized by assigning to special attributes of the foreign function object." +msgstr "این رفتار را می‌توان با انتساب به ویژگی‌های خاص شیء تابع خارجی سفارشی کرد." -msgid "Assign a ctypes type to specify the result type of the foreign function. Use ``None`` for :c:expr:`void`, a function not returning anything." +msgid "" +"Assign a ctypes type to specify the result type of the foreign function. Use ``None`` " +"for :c:expr:`void`, a function not returning anything." msgstr "" +"برای مشخص کردن نوع نتیجه تابع خارجی، یک نوع ctypes را انتساب کنید. برای :c:expr:`void`، تابعی که " +"چیزی را برنمی‌گرداند، از ``None`` استفاده کنید." -msgid "It is possible to assign a callable Python object that is not a ctypes type, in this case the function is assumed to return a C :c:expr:`int`, and the callable will be called with this integer, allowing further processing or error checking. Using this is deprecated, for more flexible post processing or error checking use a ctypes data type as :attr:`!restype` and assign a callable to the :attr:`errcheck` attribute." -msgstr "" +msgid "" +"It is possible to assign a callable Python object that is not a ctypes type, in this case the " +"function is assumed to return a C :c:expr:`int`, and the callable will be called with this " +"integer, allowing further processing or error checking. Using this is deprecated, for more " +"flexible post processing or error checking use a ctypes data type as :attr:`!restype` and assign a " +"callable to the :attr:`errcheck` attribute." +msgstr "" +"می‌توان یک شیء پایتونی فراخوان‌پذیر را که یک نوع ctypes نیست، انتساب داد؛ در این صورت فرض می‌شود که " +"تابع یک :c:expr:`int` در C را برمی‌گرداند و شیء فراخوان‌پذیر با این عدد صحیح فراخوانی می‌شود تا امکان " +"پردازش بیشتر یا بررسی خطا فراهم شود. استفاده از این روش منسوخ است؛ برای پس‌پردازش یا بررسی خطای " +"انعطاف‌پذیرتر، از یک نوع داده ctypes به‌عنوان :attr:`!restype` استفاده کنید و یک شیء فراخوان‌پذیر را " +"به ویژگی :attr:`errcheck` انتساب دهید." -msgid "Assign a tuple of ctypes types to specify the argument types that the function accepts. Functions using the ``stdcall`` calling convention can only be called with the same number of arguments as the length of this tuple; functions using the C calling convention accept additional, unspecified arguments as well." +msgid "" +"Assign a tuple of ctypes types to specify the argument types that the function accepts. Functions " +"using the ``stdcall`` calling convention can only be called with the same number of arguments as " +"the length of this tuple; functions using the C calling convention accept additional, unspecified " +"arguments as well." msgstr "" +"برای مشخص کردن انواع آرگومان‌هایی که تابع می‌پذیرد، یک چندتاییاز انواع ctypes را اختصاص " +"دهید. توابعی که از قرارداد فراخوانی ``stdcall`` استفاده می‌کنند، فقط می‌توانند با همان تعداد " +"آرگومانی که برابر با طول این چندتایی است، فراخوانی شوند؛ توابعی که از قرارداد فراخوانی C استفاده " +"می‌کنند، آرگومان‌های اضافی و مشخص‌نشده را نیز می‌پذیرند." -msgid "When a foreign function is called, each actual argument is passed to the :meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` tuple, this method allows adapting the actual argument to an object that the foreign function accepts. For example, a :class:`c_char_p` item in the :attr:`argtypes` tuple will convert a string passed as argument into a bytes object using ctypes conversion rules." -msgstr "" +msgid "" +"When a foreign function is called, each actual argument is passed to " +"the :meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` tuple, this " +"method allows adapting the actual argument to an object that the foreign function accepts. For " +"example, a :class:`c_char_p` item in the :attr:`argtypes` tuple will convert a string passed as " +"argument into a bytes object using ctypes conversion rules." +msgstr "" +"هنگامی که یک تابع خارجی فراخوانی می‌شود، هر آرگومان واقعی به متد کلاس :meth:`~_CData.from_param` " +"آیتم‌های موجود در تاپل :attr:`argtypes` ارسال می‌شود؛ این متد امکان سازگار کردن آرگومان واقعی با " +"شیءای را فراهم می‌کند که تابع خارجی می‌پذیرد. برای مثال، یک آیتم :class:`c_char_p` در " +"تاپل :attr:`argtypes`، رشته‌ای را که به‌عنوان آرگومان ارسال‌شده است، با استفاده از قوانین تبدیل " +"ctypes به یک شیء bytes تبدیل می‌کند." -msgid "New: It is now possible to put items in argtypes which are not ctypes types, but each item must have a :meth:`~_CData.from_param` method which returns a value usable as argument (integer, string, ctypes instance). This allows defining adapters that can adapt custom objects as function parameters." +msgid "" +"New: It is now possible to put items in argtypes which are not ctypes types, but each item must " +"have a :meth:`~_CData.from_param` method which returns a value usable as argument (integer, " +"string, ctypes instance). This allows defining adapters that can adapt custom objects as function " +"parameters." msgstr "" +"جدید: اکنون می‌توان آیتم‌هایی را در argtypes قرار داد که از انواع ctypes نیستند، اما هر آیتم باید یک " +"متد :meth:`~_CData.from_param` داشته باشد که مقداری قابل‌استفاده به‌عنوان آرگومان (عدد صحیح، رشته، " +"نمونه ctypes) برمی‌گرداند. این امکان تعریف آداپتورهایی را می‌دهد که می‌توانند اشیاء سفارشی را به‌عنوان " +"پارامترهای تابع سازگار کنند." -msgid "Assign a Python function or another callable to this attribute. The callable will be called with three or more arguments:" +msgid "" +"Assign a Python function or another callable to this attribute. The callable will be called with " +"three or more arguments:" msgstr "" +"یک تابع پایتون یا یک شیء قابل فراخوانی (callable) دیگر را به این ویژگی اختصاص دهید. این شیء قابل " +"فراخوانی با سه آرگومان یا بیشتر فراخوانی می‌شود:" -msgid "*result* is what the foreign function returns, as specified by the :attr:`!restype` attribute." +msgid "" +"*result* is what the foreign function returns, as specified by the :attr:`!restype` attribute." msgstr "" +"*result* چیزی است که تابع خارجی برمی‌گرداند، همان‌طور که توسط ویژگی :attr:`!restype` مشخص شده است." -msgid "*func* is the foreign function object itself, this allows reusing the same callable object to check or post process the results of several functions." +msgid "" +"*func* is the foreign function object itself, this allows reusing the same callable object to " +"check or post process the results of several functions." msgstr "" +"*func* خودِ شیء تابع خارجی است، این امکان را می‌دهد که از همان شیء فراخوانی‌پذیر برای بررسی یا " +"پس‌پردازش نتایج چندین تابع مجدداً استفاده شود." -msgid "*arguments* is a tuple containing the parameters originally passed to the function call, this allows specializing the behavior on the arguments used." +msgid "" +"*arguments* is a tuple containing the parameters originally passed to the function call, this " +"allows specializing the behavior on the arguments used." msgstr "" +"*arguments* یک تاپل حاوی پارامترهایی است که در ابتدا به فراخوانی تابع ارسال‌شده‌اند؛ این امر امکان " +"ویژه‌سازی رفتار بر اساس آرگومان‌های استفاده‌شده را فراهم می‌کند." -msgid "The object that this function returns will be returned from the foreign function call, but it can also check the result value and raise an exception if the foreign function call failed." +msgid "" +"The object that this function returns will be returned from the foreign function call, but it can " +"also check the result value and raise an exception if the foreign function call failed." msgstr "" +"شیءای که این تابع برمی‌گرداند، از فراخوانی تابع خارجی برگردانده خواهد شد، اما همچنین می‌تواند مقدار " +"نتیجه را بررسی کند و در صورت ناموفق بودن فراخوانی تابع خارجی، یک استثنا پرتاب کند." -msgid "On Windows, when a foreign function call raises a system exception (for example, due to an access violation), it will be captured and replaced with a suitable Python exception. Further, an auditing event ``ctypes.set_exception`` with argument ``code`` will be raised, allowing an audit hook to replace the exception with its own." +msgid "" +"On Windows, when a foreign function call raises a system exception (for example, due to an access " +"violation), it will be captured and replaced with a suitable Python exception. Further, an " +"auditing event ``ctypes.set_exception`` with argument ``code`` will be raised, allowing an audit " +"hook to replace the exception with its own." msgstr "" +"در ویندوز، هنگامی که یک فراخوانی تابع خارجی یک استثنای سیستمی را پرتاب می‌کند (برای مثال، به‌دلیل " +"نقض دسترسی)، آن استثنا گرفته می‌شود و با یک استثنای پایتون مناسب جایگزین می‌گردد. علاوه بر این، یک " +"رویداد حسابرسی ``ctypes.set_exception`` با آرگومان ``code`` پرتاب می‌شود که به یک قلاب حسابرسی " +"اجازه می‌دهد استثنا را با استثنای خود جایگزین کند." -msgid "Some ways to invoke foreign function calls as well as some of the functions in this module may raise an auditing event ``ctypes.call_function`` with arguments ``function pointer`` and ``arguments``." +msgid "" +"Some ways to invoke foreign function calls as well as some of the functions in this module may " +"raise an auditing event ``ctypes.call_function`` with arguments ``function pointer`` and " +"``arguments``." msgstr "" +"برخی روش‌های فراخوانی توابع خارجی و همچنین برخی از توابع این ماژول ممکن است رویداد حسابرسی " +"``ctypes.call_function`` را با آرگومان‌های ``function pointer`` و ``arguments`` پرتاب کنند." msgid "Function prototypes" -msgstr "" +msgstr "پیش‌نمونه‌های تابع" -msgid "Foreign functions can also be created by instantiating function prototypes. Function prototypes are similar to function prototypes in C; they describe a function (return type, argument types, calling convention) without defining an implementation. The factory functions must be called with the desired result type and the argument types of the function, and can be used as decorator factories, and as such, be applied to functions through the ``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." -msgstr "" +msgid "" +"Foreign functions can also be created by instantiating function prototypes. Function prototypes " +"are similar to function prototypes in C; they describe a function (return type, argument types, " +"calling convention) without defining an implementation. The factory functions must be called with " +"the desired result type and the argument types of the function, and can be used as decorator " +"factories, and as such, be applied to functions through the ``@wrapper`` syntax. See :ref:`ctypes-" +"callback-functions` for examples." +msgstr "" +"همچنین می‌توان توابع خارجی را با نمونه‌سازی از پیش‌نمونه‌های تابع (function prototypes) ایجاد کرد. " +"پیش‌نمونه‌های تابع مشابه پیش‌نمونه‌های تابع در C هستند؛ آن‌ها یک تابع را (نوع بازگشتی، انواع " +"آرگومان‌ها، قرارداد فراخوانی) بدون تعریف پیاده‌سازی توصیف می‌کنند. توابع کارخانه باید با نوع نتیجه " +"دلخواه و انواع آرگومان‌های تابع فراخوانی شوند و می‌توانند به‌عنوان کارخانه‌های دکوراتور استفاده شوند و " +"به همین عنوان، از طریق سینتکس ``@wrapper`` به توابع اعمال شوند. برای نمونه‌ها، :ref:`ctypes-" +"callback-functions` را ببینید." -msgid "The returned function prototype creates functions that use the standard C calling convention. The function will release the GIL during the call. If *use_errno* is set to true, the ctypes private copy of the system :data:`errno` variable is exchanged with the real :data:`errno` value before and after the call; *use_last_error* does the same for the Windows error code." +msgid "" +"The returned function prototype creates functions that use the standard C calling convention. The " +"function will release the GIL during the call. If *use_errno* is set to true, the ctypes private " +"copy of the system :data:`errno` variable is exchanged with the real :data:`errno` value before " +"and after the call; *use_last_error* does the same for the Windows error code." msgstr "" +"پیش‌نمونه تابع برگردانده‌شده، توابعی را ایجاد می‌کند که از قرارداد فراخوانی استاندارد C استفاده " +"می‌کنند. تابع در حین فراخوانی، GIL را آزاد می‌کند. اگر *use_errno* روی true تنظیم شود، نسخه‌ی خصوصی " +"ctypes از متغیر سیستمی :data:`errno` پیش و پس از فراخوانی با مقدار واقعی :data:`errno` مبادله " +"می‌شود؛ *use_last_error* نیز همین کار را برای کد خطای ویندوز انجام می‌دهد." -msgid "The returned function prototype creates functions that use the ``stdcall`` calling convention. The function will release the GIL during the call. *use_errno* and *use_last_error* have the same meaning as above." +msgid "" +"The returned function prototype creates functions that use the ``stdcall`` calling convention. " +"The function will release the GIL during the call. *use_errno* and *use_last_error* have the same " +"meaning as above." msgstr "" +"پیش‌نمونه تابع برگشتی، توابعی را ایجاد می‌کند که از قرارداد فراخوانی ``stdcall`` استفاده می‌کنند. " +"تابع در حین فراخوانی، GIL را آزاد خواهد کرد. *use_errno* و *use_last_error* همان معنای بالا را " +"دارند." -msgid "The returned function prototype creates functions that use the Python calling convention. The function will *not* release the GIL during the call." +msgid "" +"The returned function prototype creates functions that use the Python calling convention. The " +"function will *not* release the GIL during the call." msgstr "" +"پیش‌نمونه تابع برگردانده‌شده، توابعی ایجاد می‌کند که از قرارداد فراخوانی پایتون استفاده می‌کنند. تابع " +"در حین فراخوانی، GIL را آزاد *نخواهد کرد*." -msgid "Function prototypes created by these factory functions can be instantiated in different ways, depending on the type and number of the parameters in the call:" +msgid "" +"Function prototypes created by these factory functions can be instantiated in different ways, " +"depending on the type and number of the parameters in the call:" msgstr "" +"می‌توان پیش‌نمونه‌های تابع ایجادشده توسط این توابع سازنده را به روش‌های مختلف نمونه‌سازی کرد، بسته به " +"نوع و تعداد پارامترها در فراخوانی:" msgid "Returns a foreign function at the specified address which must be an integer." -msgstr "" +msgstr "یک تابع خارجی را در آدرس مشخص‌شده برمی‌گرداند؛ این آدرس باید یک عدد صحیح باشد." msgid "Create a C callable function (a callback function) from a Python *callable*." -msgstr "" +msgstr "یک تابع قابل فراخوانی در C (یک تابع کال‌بک) از یک *callable* در پایتون ایجاد کنید." -msgid "Returns a foreign function exported by a shared library. *func_spec* must be a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the exported function as string, or the ordinal of the exported function as small integer. The second item is the shared library instance." +msgid "" +"Returns a foreign function exported by a shared library. *func_spec* must be a 2-tuple " +"``(name_or_ordinal, library)``. The first item is the name of the exported function as string, or " +"the ordinal of the exported function as small integer. The second item is the shared library " +"instance." msgstr "" +"یک تابع خارجی صادرشده از یک کتابخانه اشتراکی را بازمی‌گرداند. *func_spec* باید یک تاپل دوتایی به " +"صورت ``(name_or_ordinal, library)`` باشد. آیتم اول، نام تابع صادرشده به صورت رشته، یا شماره ترتیبی " +"تابع صادرشده به صورت عدد صحیح کوچک است. آیتم دوم، نمونه‌ای از کتابخانه اشتراکی است." -msgid "Returns a foreign function that will call a COM method. *vtbl_index* is the index into the virtual function table, a small non-negative integer. *name* is name of the COM method. *iid* is an optional pointer to the interface identifier which is used in extended error reporting." +msgid "" +"Returns a foreign function that will call a COM method. *vtbl_index* is the index into the virtual " +"function table, a small non-negative integer. *name* is name of the COM method. *iid* is an " +"optional pointer to the interface identifier which is used in extended error reporting." msgstr "" +"یک تابع خارجی را برمی‌گرداند که یک متد COM را فراخوانی خواهد کرد. *vtbl_index* اندیس در جدول توابع " +"مجازی است، یک عدد صحیح نامنفی کوچک. *name* نام متد COM است. *iid* یک اشاره‌گر اختیاری به شناسه رابط " +"است که در گزارش خطای گسترش‌یافته استفاده می‌شود." -msgid "If *iid* is not specified, an :exc:`OSError` is raised if the COM method call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised instead." +msgid "" +"If *iid* is not specified, an :exc:`OSError` is raised if the COM method call fails. If *iid* is " +"specified, a :exc:`~ctypes.COMError` is raised instead." msgstr "" +"اگر *iid* تعیین‌نشده باشد، در صورت شکست فراخوانی متد COM، استثنای :exc:`OSError` پرتاب می‌شود. اگر " +"*iid* تعیین‌شده باشد، در عوض استثنای :exc:`~ctypes.COMError` پرتاب می‌شود." -msgid "COM methods use a special calling convention: They require a pointer to the COM interface as first argument, in addition to those parameters that are specified in the :attr:`!argtypes` tuple." +msgid "" +"COM methods use a special calling convention: They require a pointer to the COM interface as first " +"argument, in addition to those parameters that are specified in the :attr:`!argtypes` tuple." msgstr "" +"متدهای COM از یک قرارداد فراخوانی خاص استفاده می‌کنند: آن‌ها علاوه بر پارامترهایی که در تاپل :attr:`!" +"argtypes` مشخص شده‌اند، به یک اشاره‌گر به رابط COM به‌عنوان اولین آرگومان نیاز دارند." -msgid "The optional *paramflags* parameter creates foreign function wrappers with much more functionality than the features described above." +msgid "" +"The optional *paramflags* parameter creates foreign function wrappers with much more functionality " +"than the features described above." msgstr "" +"پارامتر اختیاری *paramflags* پوششی‌های تابع خارجی را با امکانات بسیار بیشتری نسبت به قابلیت‌های " +"توصیف‌شده در بالا ایجاد می‌کند." msgid "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr.argtypes`." -msgstr "" +msgstr "*paramflags* باید یک تاپلهم‌طول با :attr:`~_CFuncPtr.argtypes` باشد." -msgid "Each item in this tuple contains further information about a parameter, it must be a tuple containing one, two, or three items." +msgid "" +"Each item in this tuple contains further information about a parameter, it must be a tuple " +"containing one, two, or three items." msgstr "" +"هر آیتم در این تاپل شامل اطلاعات بیشتری درباره یک پارامتر است و باید یک تاپل شامل یک، دو یا سه " +"آیتم باشد." msgid "The first item is an integer containing a combination of direction flags for the parameter:" -msgstr "" +msgstr "اولین آیتم یک عدد صحیح است که شامل ترکیبی از پرچم‌های جهت برای پارامتر است:" msgid "1" -msgstr "" +msgstr "1" msgid "Specifies an input parameter to the function." -msgstr "" +msgstr "یک پارامتر ورودی برای تابع مشخص می‌کند." msgid "2" -msgstr "" +msgstr "2" msgid "Output parameter. The foreign function fills in a value." -msgstr "" +msgstr "پارامتر خروجی. تابع خارجی مقداری را پر می‌کند." msgid "4" -msgstr "" +msgstr "4" msgid "Input parameter which defaults to the integer zero." -msgstr "" +msgstr "پارامتر ورودی که مقدار پیش‌فرض آن عدد صحیح صفر است." -msgid "The optional second item is the parameter name as string. If this is specified, the foreign function can be called with named parameters." +msgid "" +"The optional second item is the parameter name as string. If this is specified, the foreign " +"function can be called with named parameters." msgstr "" +"آیتم دوم که اختیاری است، نام پارامتر به‌صورت رشته است. اگر این مورد تعیین شود، می‌توان تابع خارجی را " +"با پارامترهای نام‌دار فراخوانی کرد." msgid "The optional third item is the default value for this parameter." -msgstr "" +msgstr "آیتم سوم اختیاری، مقدار پیش‌فرض این پارامتر است." -msgid "The following example demonstrates how to wrap the Windows ``MessageBoxW`` function so that it supports default parameters and named arguments. The C declaration from the windows header file is this::" +msgid "" +"The following example demonstrates how to wrap the Windows ``MessageBoxW`` function so that it " +"supports default parameters and named arguments. The C declaration from the windows header file is " +"this::" msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان تابع ``MessageBoxW`` ویندوز را پوشش داد تا از پارامترهای " +"پیش‌فرض و آرگومان‌های نام‌دار پشتیبانی کند. اعلان C از فایل سرآیند ویندوز به این صورت است::" msgid "" "WINUSERAPI int WINAPI\n" @@ -1953,29 +3521,51 @@ msgid "" " LPCWSTR lpCaption,\n" " UINT uType);" msgstr "" +"WINUSERAPI int WINAPI\n" +"MessageBoxW(\n" +" HWND hWnd,\n" +" LPCWSTR lpText,\n" +" LPCWSTR lpCaption,\n" +" UINT uType);" msgid "Here is the wrapping with :mod:`!ctypes`::" -msgstr "" +msgstr "در اینجا پوششی با :mod:`!ctypes` آمده است::" msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" ">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" -">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", \"Hello from ctypes\"), (1, \"flags\", 0)\n" +">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", \"Hello from ctypes\"), " +"(1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" msgstr "" +">>> from ctypes import c_int, WINFUNCTYPE, windll\n" +">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" +">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" +">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", \"Hello from ctypes\"), " +"(1, \"flags\", 0)\n" +">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" msgid "The ``MessageBox`` foreign function can now be called in these ways::" -msgstr "" +msgstr "اکنون می‌توان تابع خارجی ``MessageBox`` را به این روش‌ها فراخوانی کرد::" msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" msgstr "" +">>> MessageBox()\n" +">>> MessageBox(text=\"Spam, spam, spam\")\n" +">>> MessageBox(flags=2, text=\"foo bar\")" -msgid "A second example demonstrates output parameters. The win32 ``GetWindowRect`` function retrieves the dimensions of a specified window by copying them into ``RECT`` structure that the caller has to supply. Here is the C declaration::" +msgid "" +"A second example demonstrates output parameters. The win32 ``GetWindowRect`` function retrieves " +"the dimensions of a specified window by copying them into ``RECT`` structure that the caller has " +"to supply. Here is the C declaration::" msgstr "" +"مثال دوم پارامترهای خروجی را نشان می‌دهد. تابع ``GetWindowRect`` در win32، ابعاد یک پنجره مشخص را " +"با کپی کردن آن‌ها در ساختار ``RECT`` که فراخواننده باید آن را فراهم کند، به دست می‌آورد. اعلان C به " +"صورت زیر است::" msgid "" "WINUSERAPI BOOL WINAPI\n" @@ -1983,6 +3573,10 @@ msgid "" " HWND hWnd,\n" " LPRECT lpRect);" msgstr "" +"WINUSERAPI BOOL WINAPI\n" +"GetWindowRect(\n" +" HWND hWnd,\n" +" LPRECT lpRect);" msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" @@ -1992,12 +3586,32 @@ msgid "" ">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), paramflags)\n" ">>>" msgstr "" +">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" +">>> from ctypes.wintypes import BOOL, HWND, RECT\n" +">>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))\n" +">>> paramflags = (1, \"hwnd\"), (2, \"lprect\")\n" +">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), paramflags)\n" +">>>" -msgid "Functions with output parameters will automatically return the output parameter value if there is a single one, or a tuple containing the output parameter values when there are more than one, so the GetWindowRect function now returns a RECT instance, when called." +msgid "" +"Functions with output parameters will automatically return the output parameter value if there is " +"a single one, or a tuple containing the output parameter values when there are more than one, so " +"the GetWindowRect function now returns a RECT instance, when called." msgstr "" +"توابعی که پارامترهای خروجی دارند، به‌طور خودکار اگر فقط یک پارامتر خروجی وجود داشته باشد مقدار آن " +"را برمی‌گردانند و اگر بیش از یکی وجود داشته باشد، تاپلی شامل مقادیر پارامترهای خروجی را " +"برمی‌گردانند؛ بنابراین تابع GetWindowRect اکنون هنگام فراخوانی یک نمونه از RECT برمی‌گرداند." -msgid "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` protocol to do further output processing and error checking. The win32 ``GetWindowRect`` api function returns a ``BOOL`` to signal success or failure, so this function could do the error checking, and raises an exception when the api call failed::" +msgid "" +"Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` protocol to do further " +"output processing and error checking. The win32 ``GetWindowRect`` api function returns a ``BOOL`` " +"to signal success or failure, so this function could do the error checking, and raises an " +"exception when the api call failed::" msgstr "" +"می‌توان پارامترهای خروجی را با پروتکل :attr:`~_CFuncPtr.errcheck` ترکیب کرد تا پردازش بیشتر خروجی و " +"بررسی خطا انجام شود. تابع API مربوط به win32 به نام ``GetWindowRect`` یک ``BOOL`` برمی‌گرداند تا " +"موفقیت یا شکست را نشان دهد، بنابراین این تابع می‌تواند بررسی خطا را انجام دهد و در صورت ناموفق بودن " +"فراخوانی API، یک استثنا پرتاب کند::" msgid "" ">>> def errcheck(result, func, args):\n" @@ -2008,11 +3622,36 @@ msgid "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" msgstr "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... return args\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" + +msgid "" +"If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it receives " +"unchanged, :mod:`!ctypes` continues the normal processing it does on the output parameters. If " +"you want to return a tuple of window coordinates instead of a ``RECT`` instance, you can retrieve " +"the fields in the function and return them instead, the normal processing will no longer take " +"place::" +msgstr "" +"اگر تابع :attr:`~_CFuncPtr.errcheck` تاپل آرگومان‌هایی را که دریافت می‌کند بدون تغییر " +"برگرداند، :mod:`!ctypes` به پردازش عادی خود روی پارامترهای خروجی ادامه می‌دهد. اگر بخواهید به‌جای یک " +"نمونه ``RECT``، یک تاپل از مختصات پنجره برگردانید، می‌توانید فیلدها را در تابع بازیابی کنید و آن‌ها " +"را به‌جای آن برگردانید؛ پردازش عادی دیگر انجام نخواهد شد::" -msgid "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it receives unchanged, :mod:`!ctypes` continues the normal processing it does on the output parameters. If you want to return a tuple of window coordinates instead of a ``RECT`` instance, you can retrieve the fields in the function and return them instead, the normal processing will no longer take place::" +msgid "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... rc = args[1]\n" +"... return rc.left, rc.top, rc.bottom, rc.right\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" msgstr "" - -msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" "... raise WinError()\n" @@ -2021,64 +3660,109 @@ msgid "" "...\n" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -msgstr "" msgid "Utility functions" -msgstr "" +msgstr "توابع کاربردی" -msgid "Returns the address of the memory buffer as integer. *obj* must be an instance of a ctypes type." -msgstr "" +msgid "" +"Returns the address of the memory buffer as integer. *obj* must be an instance of a ctypes type." +msgstr "نشانی بافر حافظه را به‌صورت عدد صحیح برمی‌گرداند. *obj* باید نمونه‌ای از یک نوع ctypes باشد." msgid "Raises an :ref:`auditing event ` ``ctypes.addressof`` with argument ``obj``." -msgstr "" +msgstr "یک :ref:`رویداد حسابرسی ` ``ctypes.addressof`` را با آرگومان ``obj`` پرتاب می‌کند." -msgid "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a ctypes type or instance." +msgid "" +"Returns the alignment requirements of a ctypes type. *obj_or_type* must be a ctypes type or " +"instance." msgstr "" +"الزامات هم‌ترازی یک نوع ctypes را برمی‌گرداند. *obj_or_type* باید یک نوع یا نمونه از ctypes باشد." -msgid "Returns a light-weight pointer to *obj*, which must be an instance of a ctypes type. *offset* defaults to zero, and must be an integer that will be added to the internal pointer value." +msgid "" +"Returns a light-weight pointer to *obj*, which must be an instance of a ctypes type. *offset* " +"defaults to zero, and must be an integer that will be added to the internal pointer value." msgstr "" +"یک اشاره‌گر سبک‌وزن به *obj* برمی‌گرداند، که باید نمونه‌ای از یک نوع ctypes باشد. *offset* به‌طور " +"پیش‌فرض صفر است و باید یک عدد صحیح باشد که به مقدار اشاره‌گر داخلی افزوده می‌شود." msgid "``byref(obj, offset)`` corresponds to this C code::" -msgstr "" +msgstr "``byref(obj, offset)`` معادل این کد C است::" msgid "(((char *)&obj) + offset)" -msgstr "" +msgstr "(((char *)&obj) + offset)" -msgid "The returned object can only be used as a foreign function call parameter. It behaves similar to ``pointer(obj)``, but the construction is a lot faster." +msgid "" +"The returned object can only be used as a foreign function call parameter. It behaves similar to " +"``pointer(obj)``, but the construction is a lot faster." msgstr "" +"شیء برگردانده‌شده تنها می‌تواند به‌عنوان پارامتر فراخوانی تابع خارجی استفاده شود. رفتار آن مشابه " +"``pointer(obj)`` است، اما ساخت آن بسیار سریع‌تر است." -msgid "Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:type:`!HRESULT` value." +msgid "" +"Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:type:`!HRESULT` value." msgstr "" +"یک اشاره‌گر COM را از *src* به *dst* کپی می‌کند و مقدار :c:type:`!HRESULT` مختص ویندوز را برمی‌گرداند." msgid "If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the reference count." msgstr "" +"اگر *src* برابر ``NULL`` نباشد، متد ``AddRef`` آن فراخوانی می‌شود و شمار ارجاع را افزایش می‌دهد." -msgid "In contrast, the reference count of *dst* will not be decremented before assigning the new value. Unless *dst* is ``NULL``, the caller is responsible for decrementing the reference count by calling its ``Release`` method when necessary." +msgid "" +"In contrast, the reference count of *dst* will not be decremented before assigning the new value. " +"Unless *dst* is ``NULL``, the caller is responsible for decrementing the reference count by " +"calling its ``Release`` method when necessary." msgstr "" +"در مقابل، شمار ارجاع *dst* پیش از انتساب مقدار جدید کاهش نمی‌یابد. مگر اینکه *dst* برابر ``NULL`` " +"باشد، فراخواننده مسئول کاهش شمار ارجاع با فراخوانی متد ``Release`` آن در صورت لزوم است." -msgid "This function is similar to the cast operator in C. It returns a new instance of *type* which points to the same memory block as *obj*. *type* must be a pointer type, and *obj* must be an object that can be interpreted as a pointer." +msgid "" +"This function is similar to the cast operator in C. It returns a new instance of *type* which " +"points to the same memory block as *obj*. *type* must be a pointer type, and *obj* must be an " +"object that can be interpreted as a pointer." msgstr "" +"این تابع مشابه عملگر تبدیل نوع (cast) در C است. این تابع نمونه‌ی جدیدی از *type* را بازمی‌گرداند که " +"به همان بلوک حافظه‌ای اشاره می‌کند که *obj* به آن اشاره دارد. *type* باید یک نوع اشاره‌گر باشد و " +"*obj* باید شیء‌ای باشد که بتوان آن را به‌عنوان یک اشاره‌گر تفسیر کرد." -msgid "This function creates a mutable character buffer. The returned object is a ctypes array of :class:`c_char`." +msgid "" +"This function creates a mutable character buffer. The returned object is a ctypes array " +"of :class:`c_char`." msgstr "" +"این تابع یک بافر نویسه‌ای تغییرپذیر ایجاد می‌کند. شیء برگردانده‌شده یک آرایه ctypes " +"از :class:`c_char` است." -msgid "If *size* is given (and not ``None``), it must be an :class:`int`. It specifies the size of the returned array." +msgid "" +"If *size* is given (and not ``None``), it must be an :class:`int`. It specifies the size of the " +"returned array." msgstr "" +"اگر *size* داده شود (و ``None`` نباشد)، باید یک :class:`int` باشد. این مقدار، اندازه‌ی آرایه‌ی بازگشتی " +"را مشخص می‌کند." -msgid "If the *init* argument is given, it must be :class:`bytes`. It is used to initialize the array items. Bytes not initialized this way are set to zero (NUL)." +msgid "" +"If the *init* argument is given, it must be :class:`bytes`. It is used to initialize the array " +"items. Bytes not initialized this way are set to zero (NUL)." msgstr "" +"اگر آرگومان *init* داده شود، باید از نوع :class:`bytes` باشد. از آن برای مقداردهی اولیه آیتم‌های " +"آرایه استفاده می‌شود. بایت‌هایی که به این روش مقداردهی اولیه نشده‌اند، روی صفر (NUL) تنظیم می‌شوند." -msgid "If *size* is not given (or if it is ``None``), the buffer is made one element larger than *init*, effectively adding a NUL terminator." +msgid "" +"If *size* is not given (or if it is ``None``), the buffer is made one element larger than *init*, " +"effectively adding a NUL terminator." msgstr "" +"اگر *size* داده نشود (یا اگر ``None`` باشد)، بافر به اندازه یک عنصر بزرگ‌تر از *init* ساخته می‌شود و " +"عملاً یک پایان‌گر NUL به آن اضافه می‌شود." msgid "If both arguments are given, *size* must not be less than ``len(init)``." -msgstr "" +msgstr "اگر هر دو آرگومان داده شده باشند، *size* نباید کمتر از ``len(init)`` باشد." -msgid "If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not treat such a buffer as a C string." +msgid "" +"If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not treat such a buffer as " +"a C string." msgstr "" +"اگر *size* برابر با ``len(init)`` باشد، یک پایان‌دهنده‌ی NUL افزوده نمی‌شود. با چنین بافری " +"به‌عنوان یک رشته‌ی C رفتار نکنید." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> bytes(create_string_buffer(2))\n" @@ -2094,363 +3778,836 @@ msgid "" " ...\n" "ValueError: byte string too long" msgstr "" +">>> bytes(create_string_buffer(2))\n" +"b'\\x00\\x00'\n" +">>> bytes(create_string_buffer(b'ab'))\n" +"b'ab\\x00'\n" +">>> bytes(create_string_buffer(b'ab', 2))\n" +"b'ab'\n" +">>> bytes(create_string_buffer(b'ab', 4))\n" +"b'ab\\x00\\x00'\n" +">>> bytes(create_string_buffer(b'abcdef', 2))\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: byte string too long" -msgid "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` with arguments ``init``, ``size``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` with arguments " +"``init``, ``size``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ctypes.create_string_buffer`` را با آرگومان‌های ``init`` و " +"``size`` پرتاب می‌کند." -msgid "This function creates a mutable unicode character buffer. The returned object is a ctypes array of :class:`c_wchar`." +msgid "" +"This function creates a mutable unicode character buffer. The returned object is a ctypes array " +"of :class:`c_wchar`." msgstr "" +"این تابع یک بافر تغییرپذیر از نویسه‌های یونیکد ایجاد می‌کند. شیء برگردانده‌شده یک آرایه ctypes " +"از :class:`c_wchar` است." -msgid "The function takes the same arguments as :func:`~create_string_buffer` except *init* must be a string and *size* counts :class:`c_wchar`." +msgid "" +"The function takes the same arguments as :func:`~create_string_buffer` except *init* must be a " +"string and *size* counts :class:`c_wchar`." msgstr "" +"این تابع همان آرگومان‌هایی را می‌پذیرد که :func:`~create_string_buffer` می‌پذیرد، به‌جز اینکه *init* " +"باید یک رشته باشد و *size* تعداد :class:`c_wchar` را می‌شمارد." -msgid "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` with arguments ``init``, ``size``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` with arguments " +"``init``, ``size``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ctypes.create_unicode_buffer`` را با آرگومان‌های ``init`` و " +"``size`` پرتاب می‌کند." -msgid "This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllCanUnloadNow function that the _ctypes extension dll exports." +msgid "" +"This function is a hook which allows implementing in-process COM servers with ctypes. It is " +"called from the DllCanUnloadNow function that the _ctypes extension dll exports." msgstr "" +"این تابع یک قلاباست که امکان پیاده‌سازی سرورهای COM درون‌فرایندی با ctypes را فراهم می‌کند. " +"این تابع از تابع DllCanUnloadNow فراخوانی می‌شود که dll افزونه‌ای _ctypes آن را صادر می‌کند." -msgid "This function is a hook which allows implementing in-process COM servers with ctypes. It is called from the DllGetClassObject function that the ``_ctypes`` extension dll exports." +msgid "" +"This function is a hook which allows implementing in-process COM servers with ctypes. It is " +"called from the DllGetClassObject function that the ``_ctypes`` extension dll exports." msgstr "" +"این تابع یک قلاباست که امکان پیاده‌سازی سرورهای COM درون‌فرایندی را با ctypes فراهم می‌کند. " +"این تابع از تابع DllGetClassObject فراخوانی می‌شود که dll افزونه ``_ctypes`` آن را صادر می‌کند." -msgid "Try to find a library and return a pathname. *name* is the library name without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix linker option :option:`!-l`). If no library can be found, returns ``None``." +msgid "" +"Try to find a library and return a pathname. *name* is the library name without any prefix like " +"``lib``, suffix like ``.so``, ``.dylib`` or version number (this is the form used for the posix " +"linker option :option:`!-l`). If no library can be found, returns ``None``." msgstr "" +"تلاش می‌کند کتابخانه‌ای را بیابد و یک مسیر نام (pathname) برگرداند. *name* نام کتابخانه بدون هیچ " +"پیشوندی مانند ``lib``، پسوندی مانند ``.so`` یا ``.dylib``، یا شماره‌ی نسخه است (این قالب برای " +"گزینه‌ی پیونددهنده‌ی POSIX یعنی :option:`!-l` به کار می‌رود). اگر هیچ کتابخانه‌ای یافت نشود، ``None`` " +"برگردانده می‌شود." msgid "See :ref:`ctypes-finding-shared-libraries` for complete documentation." -msgstr "" +msgstr "برای مستندات کامل، :ref:`ctypes-finding-shared-libraries` را ببینید." -msgid "Returns the filename of the VC runtime library used by Python, and by the extension modules. If the name of the library cannot be determined, ``None`` is returned." +msgid "" +"Returns the filename of the VC runtime library used by Python, and by the extension modules. If " +"the name of the library cannot be determined, ``None`` is returned." msgstr "" +"نام فایل کتابخانه ران‌تایم VC مورد استفاده پایتون و ماژول‌های توسعه را برمی‌گرداند. اگر نام کتابخانه " +"قابل تعیین نباشد، ``None`` برگردانده می‌شود." -msgid "If you need to free memory, for example, allocated by an extension module with a call to the ``free(void *)``, it is important that you use the function in the same library that allocated the memory." +msgid "" +"If you need to free memory, for example, allocated by an extension module with a call to the " +"``free(void *)``, it is important that you use the function in the same library that allocated the " +"memory." msgstr "" +"اگر نیاز دارید حافظه‌ای را آزاد کنید، برای مثال حافظه‌ای که توسط یک ماژول توسعه تخصیص داده شده است، " +"با فراخوانی ``free(void *)``، مهم است که از تابع در همان کتابخانه‌ای استفاده کنید که آن حافظه را " +"تخصیص داده است." -msgid "Try to provide a list of paths of the shared libraries loaded into the current process. These paths are not normalized or processed in any way. The function can raise :exc:`OSError` if the underlying platform APIs fail. The exact functionality is system dependent." +msgid "" +"Try to provide a list of paths of the shared libraries loaded into the current process. These " +"paths are not normalized or processed in any way. The function can raise :exc:`OSError` if the " +"underlying platform APIs fail. The exact functionality is system dependent." msgstr "" +"تلاش می‌کند فهرستی از مسیرهای کتابخانه‌های اشتراکی بارگذاری‌شده در فرایند جاری را ارائه کند. این " +"مسیرها به هیچ وجه به‌هنجار یا پردازش نمی‌شوند. اگر APIهای پلتفرم زیرین شکست بخورند، این تابع ممکن " +"است :exc:`OSError` را پرتاب کند. عملکرد دقیق آن وابسته به سیستم است." -msgid "On most platforms, the first element of the list represents the current executable file. It may be an empty string." +msgid "" +"On most platforms, the first element of the list represents the current executable file. It may be " +"an empty string." msgstr "" +"در بیشتر پلتفرم‌ها، اولین عنصر فهرست نمایانگر فایل اجرایی جاری است. ممکن است یک رشته خالی باشد." -msgid "Returns a textual description of the error code *code*. If no error code is specified, the last error code is used by calling the Windows API function :func:`GetLastError`." +msgid "" +"Returns a textual description of the error code *code*. If no error code is specified, the last " +"error code is used by calling the Windows API function :func:`GetLastError`." msgstr "" +"یک شرح متنی از کد خطای *code* را برمی‌گرداند. اگر کد خطایی مشخص ن‌شده باشد، با فراخوانی تابع API " +"ویندوز :func:`GetLastError` از آخرین کد خطا استفاده می‌شود." -msgid "Returns the last error code set by Windows in the calling thread. This function calls the Windows ``GetLastError()`` function directly, it does not return the ctypes-private copy of the error code." +msgid "" +"Returns the last error code set by Windows in the calling thread. This function calls the Windows " +"``GetLastError()`` function directly, it does not return the ctypes-private copy of the error code." msgstr "" +"آخرین کد خطایی که ویندوز در نخ فراخواننده تنظیم کرده است را بازمی‌گرداند. این تابع مستقیماً تابع " +"``GetLastError()`` ویندوز را فراخوانی می‌کند و نسخه‌ی خصوصی ctypes از کد خطا را بازنمی‌گرداند." -msgid "Returns the current value of the ctypes-private copy of the system :data:`errno` variable in the calling thread." -msgstr "" +msgid "" +"Returns the current value of the ctypes-private copy of the system :data:`errno` variable in the " +"calling thread." +msgstr "مقدار فعلی نسخه‌ی خصوصی ctypes از متغیر سیستمی :data:`errno` را در نخ فراخوان برمی‌گرداند." msgid "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no arguments." -msgstr "" +msgstr "یک :ref:`رویداد حسابرسی ` ``ctypes.get_errno`` را بدون آرگومان پرتاب می‌کند." -msgid "Returns the current value of the ctypes-private copy of the system :data:`!LastError` variable in the calling thread." +msgid "" +"Returns the current value of the ctypes-private copy of the system :data:`!LastError` variable in " +"the calling thread." msgstr "" +"مقدار فعلی نسخه‌ی خصوصی ctypes از متغیر سیستمی :data:`!LastError` را در نخ فراخوان برمی‌گرداند." msgid "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no arguments." -msgstr "" +msgstr "یک :ref:`رویداد حسابرسی ` ``ctypes.get_last_error`` را بدون آرگومان پرتاب می‌کند." -msgid "Same as the standard C memmove library function: copies *count* bytes from *src* to *dst*. *dst* and *src* must be integers or ctypes instances that can be converted to pointers." +msgid "" +"Same as the standard C memmove library function: copies *count* bytes from *src* to *dst*. *dst* " +"and *src* must be integers or ctypes instances that can be converted to pointers." msgstr "" +"مشابه تابع memmove در کتابخانه استاندارد C: *count* بایت را از *src* به *dst* کپی می‌کند. *dst* و " +"*src* باید اعداد صحیح یا نمونه‌های ctypes باشند که بتوان آن‌ها را به اشاره‌گرها تبدیل کرد." -msgid "Same as the standard C memset library function: fills the memory block at address *dst* with *count* bytes of value *c*. *dst* must be an integer specifying an address, or a ctypes instance." +msgid "" +"Same as the standard C memset library function: fills the memory block at address *dst* with " +"*count* bytes of value *c*. *dst* must be an integer specifying an address, or a ctypes instance." msgstr "" +"مشابه تابع کتابخانه‌ای استاندارد memset در C: بلوک حافظه در نشانی *dst* را با *count* بایت به مقدار " +"*c* پر می‌کند. *dst* باید یک عدد صحیح مشخص‌کننده یک نشانی، یا نمونه‌ای از ctypes باشد." -msgid "Create or return a ctypes pointer type. Pointer types are cached and reused internally, so calling this function repeatedly is cheap. *type* must be a ctypes type." +msgid "" +"Create or return a ctypes pointer type. Pointer types are cached and reused internally, so calling " +"this function repeatedly is cheap. *type* must be a ctypes type." msgstr "" +"یک نوع اشاره‌گر ctypes را ایجاد می‌کند یا بازمی‌گرداند. انواع اشاره‌گر به‌صورت داخلی در نهانگاه ذخیره و " +"دوباره استفاده می‌شوند، بنابراین فراخوانی مکرر این تابع کم‌هزینه است. *type* باید یک نوع ctypes باشد." -msgid "The resulting pointer type is cached in the ``__pointer_type__`` attribute of *type*. It is possible to set this attribute before the first call to ``POINTER`` in order to set a custom pointer type. However, doing this is discouraged: manually creating a suitable pointer type is difficult without relying on implementation details that may change in future Python versions." +msgid "" +"The resulting pointer type is cached in the ``__pointer_type__`` attribute of *type*. It is " +"possible to set this attribute before the first call to ``POINTER`` in order to set a custom " +"pointer type. However, doing this is discouraged: manually creating a suitable pointer type is " +"difficult without relying on implementation details that may change in future Python versions." msgstr "" +"نوع اشاره‌گر حاصل در ویژگی ``__pointer_type__`` از *type* به‌عنوان نهانگاه ذخیره می‌شود. می‌توان این " +"ویژگی را پیش از نخستین فراخوانی ``POINTER`` تنظیم کرد تا یک نوع اشاره‌گر سفارشی تنظیم شود. با این " +"حال، انجام این کار توصیه نمی‌شود: ایجاد دستی یک نوع اشاره‌گر مناسب بدون تکیه بر جزئیات پیاده‌سازی که " +"ممکن است در نسخه‌های آینده پایتون تغییر کنند، دشوار است." -msgid "Create a new pointer instance, pointing to *obj*. The returned object is of the type ``POINTER(type(obj))``." +msgid "" +"Create a new pointer instance, pointing to *obj*. The returned object is of the type " +"``POINTER(type(obj))``." msgstr "" +"یک نمونه اشاره‌گر جدید، که به *obj* اشاره دارد، ایجاد کنید. شیء برگردانده‌شده از نوع " +"``POINTER(type(obj))`` است." -msgid "Note: If you just want to pass a pointer to an object to a foreign function call, you should use ``byref(obj)`` which is much faster." +msgid "" +"Note: If you just want to pass a pointer to an object to a foreign function call, you should use " +"``byref(obj)`` which is much faster." msgstr "" +"نکته: اگر فقط می‌خواهید یک اشاره‌گر به یک شیء را به یک فراخوانی تابع خارجی ارسال کنید، باید از " +"``byref(obj)`` استفاده کنید که بسیار سریع‌تر است." -msgid "This function resizes the internal memory buffer of *obj*, which must be an instance of a ctypes type. It is not possible to make the buffer smaller than the native size of the objects type, as given by ``sizeof(type(obj))``, but it is possible to enlarge the buffer." +msgid "" +"This function resizes the internal memory buffer of *obj*, which must be an instance of a ctypes " +"type. It is not possible to make the buffer smaller than the native size of the objects type, as " +"given by ``sizeof(type(obj))``, but it is possible to enlarge the buffer." msgstr "" +"این تابع بافر حافظه‌ی داخلی *obj* را تغییر اندازه می‌دهد؛ *obj* باید نمونه‌ای از یک نوع ctypes باشد. " +"کوچک کردن بافر به کمتر از اندازه‌ی بومی نوع شیء، همان‌طور که با ``sizeof(type(obj))`` مشخص می‌شود، " +"امکان‌پذیر نیست، اما بزرگ کردن بافر امکان‌پذیر است." -msgid "Set the current value of the ctypes-private copy of the system :data:`errno` variable in the calling thread to *value* and return the previous value." +msgid "" +"Set the current value of the ctypes-private copy of the system :data:`errno` variable in the " +"calling thread to *value* and return the previous value." msgstr "" +"مقدار فعلی نسخه‌ی خصوصی ctypes از متغیر سیستمی :data:`errno` در نخ فراخواننده را برابر *value* قرار " +"می‌دهد و مقدار قبلی را برمی‌گرداند." msgid "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with argument ``errno``." -msgstr "" +msgstr "یک :ref:`رویداد حسابرسی ` ``ctypes.set_errno`` را با آرگومان ``errno`` پرتاب می‌کند." -msgid "Sets the current value of the ctypes-private copy of the system :data:`!LastError` variable in the calling thread to *value* and return the previous value." +msgid "" +"Sets the current value of the ctypes-private copy of the system :data:`!LastError` variable in the " +"calling thread to *value* and return the previous value." msgstr "" +"مقدار فعلی نسخه‌ی خصوصی ctypes از متغیر سیستمی :data:`!LastError` را در نخ فراخوان به *value* تنظیم " +"می‌کند و مقدار قبلی را برمی‌گرداند." msgid "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with argument ``error``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ctypes.set_last_error`` را با آرگومان ``error`` پرتاب می‌کند." -msgid "Returns the size in bytes of a ctypes type or instance memory buffer. Does the same as the C ``sizeof`` operator." +msgid "" +"Returns the size in bytes of a ctypes type or instance memory buffer. Does the same as the C " +"``sizeof`` operator." msgstr "" +"اندازه‌ی یک نوع ctypes یا بافر حافظه‌ی یک نمونه را بر حسب بایت برمی‌گرداند. همانند عملگر ``sizeof`` در " +"C عمل می‌کند." -msgid "Return the byte string at *void \\*ptr*. If *size* is specified, it is used as size, otherwise the string is assumed to be zero-terminated." +msgid "" +"Return the byte string at *void \\*ptr*. If *size* is specified, it is used as size, otherwise the " +"string is assumed to be zero-terminated." msgstr "" +"رشته بایتی در *void \\*ptr* را برمی‌گرداند. اگر *size* مشخص شده باشد، به‌عنوان اندازه استفاده می‌شود، " +"در غیر این صورت فرض می‌شود که رشته با صفر خاتمه یافته است." -msgid "Raises an :ref:`auditing event ` ``ctypes.string_at`` with arguments ``ptr``, ``size``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.string_at`` with arguments ``ptr``, ``size``." msgstr "" +"یک :ref:`رویداد حسابرسی (auditing event) ` ``ctypes.string_at`` را با آرگومان‌های ``ptr`` " +"و ``size`` پرتاب می‌کند." -msgid "Creates an instance of :exc:`OSError`. If *code* is not specified, :func:`GetLastError` is called to determine the error code. If *descr* is not specified, :func:`FormatError` is called to get a textual description of the error." +msgid "" +"Creates an instance of :exc:`OSError`. If *code* is not specified, :func:`GetLastError` is called " +"to determine the error code. If *descr* is not specified, :func:`FormatError` is called to get a " +"textual description of the error." msgstr "" +"یک نمونه از :exc:`OSError` ایجاد می‌کند. اگر *code* مشخص نشده باشد، برای تعیین کد " +"خطا :func:`GetLastError` فراخوانی می‌شود. اگر *descr* مشخص نشده باشد، برای دریافت شرح متنی " +"خطا :func:`FormatError` فراخوانی می‌شود." -msgid "An instance of :exc:`WindowsError` used to be created, which is now an alias of :exc:`OSError`." +msgid "" +"An instance of :exc:`WindowsError` used to be created, which is now an alias of :exc:`OSError`." msgstr "" +"پیش‌تر نمونه‌ای از :exc:`WindowsError` ایجاد می‌شد، که اکنون نام مستعاری برای :exc:`OSError` است." -msgid "Return the wide-character string at *void \\*ptr*. If *size* is specified, it is used as the number of characters of the string, otherwise the string is assumed to be zero-terminated." +msgid "" +"Return the wide-character string at *void \\*ptr*. If *size* is specified, it is used as the " +"number of characters of the string, otherwise the string is assumed to be zero-terminated." msgstr "" +"رشته نویسه‌های پهن در *void \\*ptr* را برمی‌گرداند. اگر *size* تعیین شده باشد، از آن به عنوان تعداد " +"نویسه‌های رشته استفاده می‌شود، در غیر این صورت فرض می‌شود که رشته با صفر پایان می‌یابد." -msgid "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with arguments ``ptr``, ``size``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with arguments ``ptr``, ``size``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ctypes.wstring_at`` را با آرگومان‌های ``ptr`` و ``size`` " +"پرتاب می‌کند." -msgid "Return a :class:`memoryview` object of length *size* that references memory starting at *void \\*ptr*." +msgid "" +"Return a :class:`memoryview` object of length *size* that references memory starting at *void " +"\\*ptr*." msgstr "" +"یک شیء :class:`memoryview` به طول *size* برمی‌گرداند که به حافظه‌ای که از *void \\*ptr* شروع می‌شود " +"ارجاع دارد." -msgid "If *readonly* is true, the returned :class:`!memoryview` object can not be used to modify the underlying memory. (Changes made by other means will still be reflected in the returned object.)" +msgid "" +"If *readonly* is true, the returned :class:`!memoryview` object can not be used to modify the " +"underlying memory. (Changes made by other means will still be reflected in the returned object.)" msgstr "" +"اگر *readonly* مقدار true باشد، نمی‌توان از شیء :class:`!memoryview` برگردانده‌شده برای تغییر حافظه‌ی " +"زیرین استفاده کرد. (تغییراتی که به روش‌های دیگر ایجاد شوند، همچنان در شیء برگردانده‌شده بازتاب " +"خواهند داشت.)" -msgid "This function is similar to :func:`string_at` with the key difference of not making a copy of the specified memory. It is a semantically equivalent (but more efficient) alternative to ``memoryview((c_byte * size).from_address(ptr))``. (While :meth:`~_CData.from_address` only takes integers, *ptr* can also be given as a :class:`ctypes.POINTER` or a :func:`~ctypes.byref` object.)" +msgid "" +"This function is similar to :func:`string_at` with the key difference of not making a copy of the " +"specified memory. It is a semantically equivalent (but more efficient) alternative to " +"``memoryview((c_byte * size).from_address(ptr))``. (While :meth:`~_CData.from_address` only takes " +"integers, *ptr* can also be given as a :class:`ctypes.POINTER` or a :func:`~ctypes.byref` object.)" msgstr "" +"این تابع مشابه :func:`string_at` است، با این تفاوت کلیدی که کپی‌ای از حافظه‌ی مشخص‌شده نمی‌سازد. این " +"تابع جایگزینی هم‌ارز از نظر معنایی (اما کارآمدتر) برای ``memoryview((c_byte * " +"size).from_address(ptr))`` است. (در حالی که :meth:`~_CData.from_address` فقط اعداد صحیح را " +"می‌پذیرد، *ptr* همچنین می‌تواند به‌عنوان یک شیء :class:`ctypes.POINTER` یا :func:`~ctypes.byref` نیز " +"داده شود.)" -msgid "Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with arguments ``address``, ``size``, ``readonly``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with arguments ``address``, " +"``size``, ``readonly``." msgstr "" +":ref:`رویداد حسابرسی ` ``ctypes.memoryview_at`` را با آرگومان‌های ``address``، ``size`` و " +"``readonly`` پرتاب می‌کند." msgid "Data types" -msgstr "" +msgstr "انواع داده" -msgid "This non-public class is the common base class of all ctypes data types. Among other things, all ctypes type instances contain a memory block that hold C compatible data; the address of the memory block is returned by the :func:`addressof` helper function. Another instance variable is exposed as :attr:`_objects`; this contains other Python objects that need to be kept alive in case the memory block contains pointers." -msgstr "" +msgid "" +"This non-public class is the common base class of all ctypes data types. Among other things, all " +"ctypes type instances contain a memory block that hold C compatible data; the address of the " +"memory block is returned by the :func:`addressof` helper function. Another instance variable is " +"exposed as :attr:`_objects`; this contains other Python objects that need to be kept alive in case " +"the memory block contains pointers." +msgstr "" +"این کلاس غیرعمومی، کلاس پایه مشترک تمام انواع داده ctypes است. در میان سایر موارد، تمام نمونه‌های " +"نوع ctypes شامل یک بلوک حافظه هستند که داده‌های سازگار با C را نگه می‌دارد؛ آدرس بلوک حافظه توسط " +"تابع کمکی :func:`addressof` برگردانده می‌شود. متغیر نمونه دیگری نیز به‌عنوان :attr:`_objects` در " +"معرض قرار گرفته است؛ این متغیر شامل اشیاء پایتون دیگری است که در صورتی که بلوک حافظه حاوی " +"اشاره‌گرها باشد، باید زنده نگه داشته شوند." -msgid "Common methods of ctypes data types, these are all class methods (to be exact, they are methods of the :term:`metaclass`):" +msgid "" +"Common methods of ctypes data types, these are all class methods (to be exact, they are methods of " +"the :term:`metaclass`):" msgstr "" +"متدهای مشترک انواع داده ctypes، همگی متدهای کلاس هستند (به‌طور دقیق، آن‌ها متدهای :term:`فراکلاس ` هستند):" -msgid "This method returns a ctypes instance that shares the buffer of the *source* object. The *source* object must support the writeable buffer interface. The optional *offset* parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enough a :exc:`ValueError` is raised." +msgid "" +"This method returns a ctypes instance that shares the buffer of the *source* object. The *source* " +"object must support the writeable buffer interface. The optional *offset* parameter specifies an " +"offset into the source buffer in bytes; the default is zero. If the source buffer is not large " +"enough a :exc:`ValueError` is raised." msgstr "" +"این متد یک نمونه ctypes برمی‌گرداند که بافر شیء *source* را به اشتراک می‌گذارد. شیء *source* باید از " +"رابط بافر قابل‌نوشتن پشتیبانی کند. پارامتر اختیاری *offset* یک آفست درون بافر source را بر حسب بایت " +"مشخص می‌کند؛ مقدار پیش‌فرض ۰ است. اگر بافر source به‌قدر کافی بزرگ نباشد، یک :exc:`ValueError` پرتاب " +"می‌شود." -msgid "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with arguments ``pointer``, ``size``, ``offset``." +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with arguments ``pointer``, " +"``size``, ``offset``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ctypes.cdata/buffer`` را با آرگومان‌های ``pointer``، " +"``size``، ``offset`` پرتاب می‌کند." -msgid "This method creates a ctypes instance, copying the buffer from the *source* object buffer which must be readable. The optional *offset* parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enough a :exc:`ValueError` is raised." +msgid "" +"This method creates a ctypes instance, copying the buffer from the *source* object buffer which " +"must be readable. The optional *offset* parameter specifies an offset into the source buffer in " +"bytes; the default is zero. If the source buffer is not large enough a :exc:`ValueError` is " +"raised." msgstr "" +"این متد یک نمونه ctypes ایجاد می‌کند و بافر را از بافر شیء *source* کپی می‌کند؛ بافر شیء *source* " +"باید خواندنی باشد. پارامتر اختیاری *offset*، یک آفست در بافر منبع را بر حسب بایت مشخص می‌کند؛ مقدار " +"پیش‌فرض ۰ است. اگر بافر منبع به‌اندازه کافی بزرگ نباشد، یک :exc:`ValueError` پرتاب می‌شود." -msgid "This method returns a ctypes type instance using the memory specified by *address* which must be an integer." +msgid "" +"This method returns a ctypes type instance using the memory specified by *address* which must be " +"an integer." msgstr "" +"این متد یک نمونه‌ی نوع ctypes را با استفاده از حافظه‌ی مشخص‌شده توسط *address* برمی‌گرداند؛ *address* " +"باید یک عدد صحیح باشد." -msgid "This method, and others that indirectly call this method, raises an :ref:`auditing event ` ``ctypes.cdata`` with argument ``address``." +msgid "" +"This method, and others that indirectly call this method, raises an :ref:`auditing event " +"` ``ctypes.cdata`` with argument ``address``." msgstr "" +"این متد، و سایر متدهایی که به‌طور غیرمستقیم این متد را فراخوانی می‌کنند، یک :ref:`رویداد حسابرسی " +"` ``ctypes.cdata`` را با آرگومان ``address`` پرتاب می‌کنند." -msgid "This method adapts *obj* to a ctypes type. It is called with the actual object used in a foreign function call when the type is present in the foreign function's :attr:`~_CFuncPtr.argtypes` tuple; it must return an object that can be used as a function call parameter." +msgid "" +"This method adapts *obj* to a ctypes type. It is called with the actual object used in a foreign " +"function call when the type is present in the foreign function's :attr:`~_CFuncPtr.argtypes` " +"tuple; it must return an object that can be used as a function call parameter." msgstr "" +"این متد *obj* را با یک نوع ctypes تطبیق می‌دهد. هنگامی که نوع در تاپل :attr:`~_CFuncPtr.argtypes` " +"تابع خارجی وجود داشته باشد، این متد با شیء واقعی استفاده‌شده در یک فراخوانی تابع خارجی فراخوانی " +"می‌شود؛ این متد باید یک شیء برگرداند که بتوان از آن به‌عنوان پارامتر فراخوانی تابع استفاده کرد." -msgid "All ctypes data types have a default implementation of this classmethod that normally returns *obj* if that is an instance of the type. Some types accept other objects as well." +msgid "" +"All ctypes data types have a default implementation of this classmethod that normally returns " +"*obj* if that is an instance of the type. Some types accept other objects as well." msgstr "" +"تمام انواع داده ctypes یک پیاده‌سازی پیش‌فرض از این classmethod دارند که به‌طور معمول *obj* را، در صورتی " +"که نمونه‌ای از آن نوع باشد، برمی‌گرداند. برخی از انواع، اشیاء دیگر را نیز می‌پذیرند." -msgid "This method returns a ctypes type instance exported by a shared library. *name* is the name of the symbol that exports the data, *library* is the loaded shared library." +msgid "" +"This method returns a ctypes type instance exported by a shared library. *name* is the name of the " +"symbol that exports the data, *library* is the loaded shared library." msgstr "" +"این متد یک نمونه از نوع ctypes را بازمی‌گرداند که توسط یک کتابخانه مشترک صادر شده است. *name* نام " +"نمادی است که داده‌ها را صادر می‌کند، و *library* کتابخانه مشترک بارگذاری‌شده است." msgid "Common class variables of ctypes data types:" -msgstr "" +msgstr "متغیرهای کلاس مشترک انواع داده ctypes:" -msgid "The pointer type that was created by calling :func:`POINTER` for corresponding ctypes data type. If a pointer type was not yet created, the attribute is missing." +msgid "" +"The pointer type that was created by calling :func:`POINTER` for corresponding ctypes data type. " +"If a pointer type was not yet created, the attribute is missing." msgstr "" +"نوع اشاره‌گری که با فراخوانی :func:`POINTER` برای نوع داده‌ی متناظر در ctypes ایجاد شده است. اگر نوع " +"اشاره‌گر هنوز ایجاد نشده باشد، این ویژگی وجود ندارد." msgid "Common instance variables of ctypes data types:" -msgstr "" +msgstr "متغیرهای نمونه مشترک انواع داده ctypes:" -msgid "Sometimes ctypes data instances do not own the memory block they contain, instead they share part of the memory block of a base object. The :attr:`_b_base_` read-only member is the root ctypes object that owns the memory block." +msgid "" +"Sometimes ctypes data instances do not own the memory block they contain, instead they share part " +"of the memory block of a base object. The :attr:`_b_base_` read-only member is the root ctypes " +"object that owns the memory block." msgstr "" +"گاهی نمونه‌های داده ctypes مالک بلوک حافظه‌ای که در بر دارند، نیستند؛ بلکه بخشی از بلوک حافظه یک شیء " +"پایه را به اشتراک می‌گذارند. عضو فقط‌خواندنی :attr:`_b_base_` شیء ریشه ctypes است که مالک بلوک حافظه " +"می‌باشد." -msgid "This read-only variable is true when the ctypes data instance has allocated the memory block itself, false otherwise." +msgid "" +"This read-only variable is true when the ctypes data instance has allocated the memory block " +"itself, false otherwise." msgstr "" +"این متغیر فقط‌خواندنی زمانی درست است که نمونه داده ctypes خودش بلوک حافظه را تخصیص داده باشد، در " +"غیر این صورت نادرست است." -msgid "This member is either ``None`` or a dictionary containing Python objects that need to be kept alive so that the memory block contents is kept valid. This object is only exposed for debugging; never modify the contents of this dictionary." +msgid "" +"This member is either ``None`` or a dictionary containing Python objects that need to be kept " +"alive so that the memory block contents is kept valid. This object is only exposed for debugging; " +"never modify the contents of this dictionary." msgstr "" +"این عضو یا ``None`` است یا یک دیکشنری حاوی اشیای پایتون که باید زنده نگه داشته شوند تا محتویات " +"بلوک حافظه معتبر باقی بماند. این شیء فقط برای اشکال‌زدایی در دسترس است؛ هرگز محتویات این دیکشنری را " +"تغییر ندهید." -msgid "This non-public class is the base class of all fundamental ctypes data types. It is mentioned here because it contains the common attributes of the fundamental ctypes data types. :class:`_SimpleCData` is a subclass of :class:`_CData`, so it inherits their methods and attributes. ctypes data types that are not and do not contain pointers can now be pickled." +msgid "" +"This non-public class is the base class of all fundamental ctypes data types. It is mentioned here " +"because it contains the common attributes of the fundamental ctypes data " +"types. :class:`_SimpleCData` is a subclass of :class:`_CData`, so it inherits their methods and " +"attributes. ctypes data types that are not and do not contain pointers can now be pickled." msgstr "" +"این کلاس غیرعمومی، کلاس پایه‌ی همه‌ی انواع داده‌ی بنیادی ctypes است. این کلاس در اینجا ذکر شده است زیرا " +"شامل ویژگی‌های مشترک انواع داده‌ی بنیادی ctypes است. :class:`_SimpleCData` یک زیرکلاس " +"از :class:`_CData` است، بنابراین متدها و ویژگی‌های آن‌ها را به ارث می‌برد. اکنون می‌توان انواع داده‌ی " +"ctypes را که اشاره‌گر نیستند و شامل اشاره‌گرها نمی‌شوند، پیکل (pickle) کرد." msgid "Instances have a single attribute:" -msgstr "" +msgstr "نمونه‌ها یک ویژگی دارند:" -msgid "This attribute contains the actual value of the instance. For integer and pointer types, it is an integer, for character types, it is a single character bytes object or string, for character pointer types it is a Python bytes object or string." +msgid "" +"This attribute contains the actual value of the instance. For integer and pointer types, it is an " +"integer, for character types, it is a single character bytes object or string, for character " +"pointer types it is a Python bytes object or string." msgstr "" +"این ویژگی حاوی مقدار واقعی نمونه است. برای انواع عدد صحیح و اشاره‌گر، این مقدار یک عدد صحیح است، " +"برای انواع نویسه، یک شیء bytes یا رشته‌ی تک‌نویسه‌ای است، و برای انواع اشاره‌گر به نویسه، یک شیء bytes " +"یا رشته‌ی پایتون است." -msgid "When the ``value`` attribute is retrieved from a ctypes instance, usually a new object is returned each time. :mod:`!ctypes` does *not* implement original object return, always a new object is constructed. The same is true for all other ctypes object instances." +msgid "" +"When the ``value`` attribute is retrieved from a ctypes instance, usually a new object is returned " +"each time. :mod:`!ctypes` does *not* implement original object return, always a new object is " +"constructed. The same is true for all other ctypes object instances." msgstr "" +"هنگامی که ویژگی ``value`` از یک نمونه ctypes بازیابی می‌شود، معمولاً هر بار یک شیء جدید برگردانده " +"می‌شود. :mod:`!ctypes` بازگشت شیء اصلی را پیاده‌سازی *نمی‌کند*، بلکه همیشه یک شیء جدید ساخته می‌شود. " +"همین موضوع برای تمام نمونه‌های دیگر اشیاء ctypes نیز صادق است." msgid "Each subclass has a class attribute:" -msgstr "" +msgstr "هر زیرکلاس دارای یک ویژگی کلاس است:" -msgid "Class attribute that contains an internal type code, as a single-character string. See :ref:`ctypes-fundamental-data-types` for a summary." +msgid "" +"Class attribute that contains an internal type code, as a single-character string. " +"See :ref:`ctypes-fundamental-data-types` for a summary." msgstr "" +"ویژگی کلاس که حاوی یک کد نوع داخلی به‌صورت یک رشته تک‌نویسه‌ای است. برای یک خلاصه، به :ref:`ctypes-" +"fundamental-data-types` مراجعه کنید." -msgid "Types marked \\* in the summary may be (or always are) aliases of a different :class:`_SimpleCData` subclass, and will not necessarily use the listed type code. For example, if the platform's :c:expr:`long`, :c:expr:`long long` and :c:expr:`time_t` C types are the same, then :class:`c_long`, :class:`c_longlong` and :class:`c_time_t` all refer to a single class, :class:`c_long`, whose :attr:`_type_` code is ``'l'``. The ``'L'`` code will be unused." -msgstr "" +msgid "" +"Types marked \\* in the summary may be (or always are) aliases of a " +"different :class:`_SimpleCData` subclass, and will not necessarily use the listed type code. For " +"example, if the platform's :c:expr:`long`, :c:expr:`long long` and :c:expr:`time_t` C types are " +"the same, then :class:`c_long`, :class:`c_longlong` and :class:`c_time_t` all refer to a single " +"class, :class:`c_long`, whose :attr:`_type_` code is ``'l'``. The ``'L'`` code will be unused." +msgstr "" +"انواعی که در خلاصه با \\* علامت‌گذاری شده‌اند ممکن است (یا همواره) نام‌های مستعار یک زیرکلاس دیگر " +"از :class:`_SimpleCData` باشند و لزوماً از کد نوع فهرست‌شده استفاده نخواهند کرد. برای مثال، اگر " +"انواع Cِ :c:expr:`long`، :c:expr:`long long` و :c:expr:`time_t` در سکو یکسان باشند، " +"آنگاه :class:`c_long`، :class:`c_longlong` و :class:`c_time_t` همگی به یک کلاس واحد، " +"یعنی :class:`c_long`، ارجاع می‌دهند که کد :attr:`_type_` آن ``'l'`` است. کد ``'L'`` استفاده نخواهد " +"شد." -msgid "The :mod:`array` and :ref:`struct ` modules, as well as third-party modules like `numpy `__, use similar -- but slightly different -- type codes." +msgid "" +"The :mod:`array` and :ref:`struct ` modules, as well as third-party modules " +"like `numpy `__, use similar -- but slightly different -- " +"type codes." msgstr "" +"ماژول‌های :mod:`array` و :ref:`struct `، و همچنین ماژول‌های شخص ثالثی مانند " +"`numpy `__، از کدهای نوع مشابه — اما اندکی متفاوت — " +"استفاده می‌کنند." -msgid "Fundamental data types, when returned as foreign function call results, or, for example, by retrieving structure field members or array items, are transparently converted to native Python types. In other words, if a foreign function has a :attr:`~_CFuncPtr.restype` of :class:`c_char_p`, you will always receive a Python bytes object, *not* a :class:`c_char_p` instance." +msgid "" +"Fundamental data types, when returned as foreign function call results, or, for example, by " +"retrieving structure field members or array items, are transparently converted to native Python " +"types. In other words, if a foreign function has a :attr:`~_CFuncPtr.restype` " +"of :class:`c_char_p`, you will always receive a Python bytes object, *not* a :class:`c_char_p` " +"instance." msgstr "" +"انواع داده بنیادی، هنگامی که به‌عنوان نتایج فراخوانی تابع خارجی برگردانده می‌شوند، یا مثلاً هنگام " +"بازیابی اعضای فیلدهای ساختار یا آیتم‌های آرایه، به‌طور شفاف به انواع بومی پایتون تبدیل می‌شوند. به " +"عبارت دیگر، اگر یک تابع خارجی دارای :attr:`~_CFuncPtr.restype` برابر با :class:`c_char_p` باشد، " +"همیشه یک شیء bytes پایتون دریافت خواهید کرد، *نه* یک نمونه :class:`c_char_p`." -msgid "Subclasses of fundamental data types do *not* inherit this behavior. So, if a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you will receive an instance of this subclass from the function call. Of course, you can get the value of the pointer by accessing the ``value`` attribute." +msgid "" +"Subclasses of fundamental data types do *not* inherit this behavior. So, if a foreign " +"functions :attr:`!restype` is a subclass of :class:`c_void_p`, you will receive an instance of " +"this subclass from the function call. Of course, you can get the value of the pointer by accessing " +"the ``value`` attribute." msgstr "" +"زیرکلاس‌های انواع داده بنیادی این رفتار را به ارث *نمی‌برند*. بنابراین، اگر :attr:`!restype` یک تابع " +"خارجی زیرکلاسی از :class:`c_void_p` باشد، از فراخوانی تابع یک نمونه از این زیرکلاس دریافت خواهید " +"کرد. البته می‌توانید با دسترسی به ویژگی ``value`` مقدار اشاره‌گر را به دست آورید." msgid "These are the fundamental ctypes data types:" -msgstr "" +msgstr "این‌ها انواع داده‌ی بنیادی ctypes هستند:" -msgid "Represents the C :c:expr:`signed char` datatype, and interprets the value as small integer. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`signed char` datatype, and interprets the value as small integer. The " +"constructor accepts an optional integer initializer; no overflow checking is done." msgstr "" +"نوع داده‌ی :c:expr:`signed char` در C را نشان می‌دهد و مقدار را به‌عنوان عدد صحیح کوچک تفسیر می‌کند. " +"سازنده یک مقدار اولیه‌ی اختیاری از نوع عدد صحیح می‌پذیرد؛ هیچ‌گونه بررسی سرریزی انجام نمی‌شود." -msgid "Represents the C :c:expr:`char` datatype, and interprets the value as a single character. The constructor accepts an optional string initializer, the length of the string must be exactly one character." +msgid "" +"Represents the C :c:expr:`char` datatype, and interprets the value as a single character. The " +"constructor accepts an optional string initializer, the length of the string must be exactly one " +"character." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`char` در C است و مقدار را به‌عنوان یک نویسه تفسیر می‌کند. سازنده یک " +"مقدارده اولیه‌ی رشته‌ای اختیاری را می‌پذیرد، طول رشته باید دقیقاً ۱ نویسه باشد." -msgid "Represents the C :c:expr:`char *` datatype when it points to a zero-terminated string. For a general character pointer that may also point to binary data, ``POINTER(c_char)`` must be used. The constructor accepts an integer address, or a bytes object." +msgid "" +"Represents the C :c:expr:`char *` datatype when it points to a zero-terminated string. For a " +"general character pointer that may also point to binary data, ``POINTER(c_char)`` must be used. " +"The constructor accepts an integer address, or a bytes object." msgstr "" +"نمایانگر نوع داده‌ی C :c:expr:`char *` است، زمانی که به یک رشته‌ی پایان‌یافته با صفر اشاره می‌کند. برای " +"یک اشاره‌گر نویسه‌ای عمومی که ممکن است به داده‌های دودویی نیز اشاره کند، باید از ``POINTER(c_char)`` " +"استفاده شود. سازنده یک نشانی به‌صورت عدد صحیح یا یک شیء bytes را می‌پذیرد." -msgid "Represents the C :c:expr:`double` datatype. The constructor accepts an optional float initializer." +msgid "" +"Represents the C :c:expr:`double` datatype. The constructor accepts an optional float initializer." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`double` در C است. سازنده یک مقدار اولیه‌ی float اختیاری را می‌پذیرد." -msgid "Represents the C :c:expr:`long double` datatype. The constructor accepts an optional float initializer. On platforms where ``sizeof(long double) == sizeof(double)`` it is an alias to :class:`c_double`." +msgid "" +"Represents the C :c:expr:`long double` datatype. The constructor accepts an optional float " +"initializer. On platforms where ``sizeof(long double) == sizeof(double)`` it is an alias " +"to :class:`c_double`." msgstr "" +"نمایانگر نوع داده‌ی C :c:expr:`long double` است. سازنده یک مقدار اولیه float اختیاری را می‌پذیرد. در " +"سکوهایی که ``sizeof(long double) == sizeof(double)`` باشد، این نام مستعاری برای :class:`c_double` " +"است." -msgid "Represents the C :c:expr:`float` datatype. The constructor accepts an optional float initializer." +msgid "" +"Represents the C :c:expr:`float` datatype. The constructor accepts an optional float initializer." msgstr "" +"نوع داده‌ی :c:expr:`float` در C را نشان می‌دهد. سازنده یک مقدار اولیه‌ی اختیاری از نوع float را " +"می‌پذیرد." -msgid "Represents the C :c:expr:`double complex` datatype, if available. The constructor accepts an optional :class:`complex` initializer." +msgid "" +"Represents the C :c:expr:`double complex` datatype, if available. The constructor accepts an " +"optional :class:`complex` initializer." msgstr "" +"در صورت موجود بودن، نشان‌دهنده‌ی نوع داده‌ی :c:expr:`double complex` در C است. سازنده یک مقداردهی " +"اولیه‌ی اختیاری از :class:`complex` را می‌پذیرد." -msgid "Represents the C :c:expr:`float complex` datatype, if available. The constructor accepts an optional :class:`complex` initializer." +msgid "" +"Represents the C :c:expr:`float complex` datatype, if available. The constructor accepts an " +"optional :class:`complex` initializer." msgstr "" +"نوع داده‌ی :c:expr:`float complex` در C را در صورت موجود بودن نشان می‌دهد. سازنده، یک مقدارده اولیه " +"اختیاری از نوع :class:`complex` را می‌پذیرد." -msgid "Represents the C :c:expr:`long double complex` datatype, if available. The constructor accepts an optional :class:`complex` initializer." +msgid "" +"Represents the C :c:expr:`long double complex` datatype, if available. The constructor accepts an " +"optional :class:`complex` initializer." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`long double complex` در C است، در صورت موجود بودن. سازنده یک " +"مقداردهی اولیه‌ی اختیاری :class:`complex` را می‌پذیرد." -msgid "Represents the C :c:expr:`signed int` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." +msgid "" +"Represents the C :c:expr:`signed int` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done. On platforms where ``sizeof(int) == sizeof(long)`` it " +"is an alias to :class:`c_long`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed int` در C است. سازنده یک مقدار اولیه‌ی اختیاری عدد صحیح را " +"می‌پذیرد؛ هیچ بررسی سرریز انجام نمی‌شود. در سکوهایی که ``sizeof(int) == sizeof(long)`` باشد، این یک " +"نام مستعار برای :class:`c_long` است." msgid "Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias for :class:`c_byte`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed int` ۸ بیتی C است. این یک نام مستعار برای :class:`c_byte` است." -msgid "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias for :class:`c_short`." +msgid "" +"Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias for :class:`c_short`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed int` ۱۶ بیتی در C است. معمولاً نام مستعاری برای :class:`c_short` " +"است." msgid "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias for :class:`c_int`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed int` ۳۲ بیتی C است. معمولاً نام مستعاری برای :class:`c_int` است." -msgid "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias for :class:`c_longlong`." +msgid "" +"Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias for :class:`c_longlong`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed int` ۶۴ بیتی C است. معمولاً نام مستعاری برای :class:`c_longlong` " +"است." -msgid "Represents the C :c:expr:`signed long` datatype. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`signed long` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done." msgstr "" +"نشان‌دهنده نوع داده :c:expr:`signed long` در C است. سازنده یک مقدار اولیه عدد صحیح اختیاری را " +"می‌پذیرد؛ هیچ بررسی سرریز انجام نمی‌شود." -msgid "Represents the C :c:expr:`signed long long` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where ``sizeof(long long) == sizeof(long)`` it is an alias to :class:`c_long`." +msgid "" +"Represents the C :c:expr:`signed long long` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done. On platforms where ``sizeof(long long) == " +"sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی C :c:expr:`signed long long` است. سازنده‌ی آن یک مقدار اولیه‌ی اختیاری از نوع عدد " +"صحیح را می‌پذیرد؛ هیچ بررسی سرریز انجام نمی‌شود. در سکوهایی که در آن‌ها ``sizeof(long long) == " +"sizeof(long)`` باشد، این نوع نام مستعاری برای :class:`c_long` است." -msgid "Represents the C :c:expr:`signed short` datatype. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`signed short` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`signed short` در C است. سازنده یک مقداردهی اولیه‌ی اختیاری از نوع عدد " +"صحیح را می‌پذیرد؛ هیچ بررسی‌ای برای سرریز انجام نمی‌شود." -msgid "Represents the C :c:type:`size_t` datatype. Usually an alias for another unsigned integer type." +msgid "" +"Represents the C :c:type:`size_t` datatype. Usually an alias for another unsigned integer type." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:type:`size_t` در C است. معمولاً نام مستعاری برای نوع دیگری از عدد صحیح بدون " +"علامت است." -msgid "Represents the :c:type:`Py_ssize_t` datatype. This is a signed version of :c:type:`size_t`; that is, the POSIX :c:type:`ssize_t` type. Usually an alias for another integer type." +msgid "" +"Represents the :c:type:`Py_ssize_t` datatype. This is a signed version of :c:type:`size_t`; that " +"is, the POSIX :c:type:`ssize_t` type. Usually an alias for another integer type." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:type:`Py_ssize_t` است. این یک نسخه‌ی علامت‌دار از :c:type:`size_t` است؛ یعنی " +"نوع :c:type:`ssize_t` در POSIX. معمولاً نام مستعاری برای یک نوع عدد صحیح دیگر است." msgid "Represents the C :c:type:`time_t` datatype. Usually an alias for another integer type." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:type:`time_t` در C است. معمولاً نام مستعاری برای یک نوع عدد صحیح دیگر است." -msgid "Represents the C :c:expr:`unsigned char` datatype, it interprets the value as small integer. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`unsigned char` datatype, it interprets the value as small integer. The " +"constructor accepts an optional integer initializer; no overflow checking is done." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`unsigned char` در C است و مقدار را به‌عنوان عدد صحیح کوچک تفسیر می‌کند. " +"سازنده یک مقدارده اولیه‌ی اختیاری از نوع عدد صحیح را می‌پذیرد؛ هیچ بررسی‌ای برای سرریز انجام نمی‌شود." -msgid "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." +msgid "" +"Represents the C :c:expr:`unsigned int` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done. On platforms where ``sizeof(int) == sizeof(long)`` it " +"is an alias for :class:`c_ulong`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`unsigned int` در C است. سازنده یک مقدار اولیه‌ی اختیاری از نوع عدد " +"صحیح می‌پذیرد؛ هیچ بررسی سرریزی انجام نمی‌شود. در سکوهایی که ``sizeof(int) == sizeof(long)`` باشد، " +"نام مستعاری برای :class:`c_ulong` است." msgid "Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias for :class:`c_ubyte`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی ۸‌بیتی :c:expr:`unsigned int` در C است. این یک نام مستعار " +"برای :class:`c_ubyte` است." -msgid "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias for :class:`c_ushort`." +msgid "" +"Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias for :class:`c_ushort`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`unsigned int` ۱۶ بیتی در C است. معمولاً نام مستعاری " +"برای :class:`c_ushort` است." -msgid "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias for :class:`c_uint`." +msgid "" +"Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias for :class:`c_uint`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی ۳۲ بیتی :c:expr:`unsigned int` در C است. معمولاً نام مستعاری " +"برای :class:`c_uint` است." -msgid "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias for :class:`c_ulonglong`." +msgid "" +"Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " +"for :class:`c_ulonglong`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`unsigned int` ۶۴ بیتی در C است. معمولاً نام مستعاری " +"برای :class:`c_ulonglong` است." -msgid "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`unsigned long` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done." msgstr "" +"نوع داده‌ی :c:expr:`unsigned long` در C را نشان می‌دهد. سازنده یک مقدار اولیه‌ی اختیاری از نوع عدد " +"صحیح را می‌پذیرد؛ هیچ بررسی‌ای برای سرریز انجام نمی‌شود." -msgid "Represents the C :c:expr:`unsigned long long` datatype. The constructor accepts an optional integer initializer; no overflow checking is done. On platforms where ``sizeof(long long) == sizeof(long)`` it is an alias to :class:`c_long`." +msgid "" +"Represents the C :c:expr:`unsigned long long` datatype. The constructor accepts an optional " +"integer initializer; no overflow checking is done. On platforms where ``sizeof(long long) == " +"sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی C :c:expr:`unsigned long long` است. سازنده یک مقدار اولیه‌ی عدد صحیح اختیاری را " +"می‌پذیرد؛ هیچ بررسی سرریزی انجام نمی‌شود. در سکوهای که ``sizeof(long long) == sizeof(long)`` باشد، " +"نام مستعاری برای :class:`c_long` است." -msgid "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts an optional integer initializer; no overflow checking is done." +msgid "" +"Represents the C :c:expr:`unsigned short` datatype. The constructor accepts an optional integer " +"initializer; no overflow checking is done." msgstr "" +"نوع داده‌ی :c:expr:`unsigned short` در C را نشان می‌دهد. سازنده یک مقدار اولیه‌ی اختیاری از نوع عدد " +"صحیح می‌پذیرد؛ هیچ بررسی سرریزی انجام نمی‌شود." -msgid "Represents the C :c:expr:`void *` type. The value is represented as integer. The constructor accepts an optional integer initializer." +msgid "" +"Represents the C :c:expr:`void *` type. The value is represented as integer. The constructor " +"accepts an optional integer initializer." msgstr "" +"نشان‌دهنده‌ی نوع :c:expr:`void *` در C است. مقدار به‌صورت عدد صحیح نشان داده می‌شود. سازنده یک مقدار " +"اولیه‌ی اختیاری عدد صحیح را می‌پذیرد." -msgid "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a single character unicode string. The constructor accepts an optional string initializer, the length of the string must be exactly one character." +msgid "" +"Represents the C :c:type:`wchar_t` datatype, and interprets the value as a single character " +"unicode string. The constructor accepts an optional string initializer, the length of the string " +"must be exactly one character." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:type:`wchar_t` در C است و مقدار را به‌عنوان یک رشته‌ی یونیکد تک‌نویسه‌ای تفسیر " +"می‌کند. سازنده یک مقدار اولیه‌ی رشته‌ای اختیاری می‌پذیرد؛ طول رشته باید دقیقاً ۱ نویسه باشد." -msgid "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a zero-terminated wide character string. The constructor accepts an integer address, or a string." +msgid "" +"Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a zero-terminated wide " +"character string. The constructor accepts an integer address, or a string." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی C :c:expr:`wchar_t *` است، که باید اشاره‌گری به رشته‌ای از نویسه‌های پهن " +"خاتمه‌یافته با صفر باشد. سازنده یک نشانی عدد صحیحی یا یک رشته را می‌پذیرد." -msgid "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` from C99). Its value can be ``True`` or ``False``, and the constructor accepts any object that has a truth value." +msgid "" +"Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` from C99). Its value " +"can be ``True`` or ``False``, and the constructor accepts any object that has a truth value." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`bool` در C (دقیق‌تر، :c:expr:`_Bool` از C99) است. مقدار آن می‌تواند " +"``True`` یا ``False`` باشد و سازنده‌ی آن هر شیءای را که مقدار درستی داشته باشد می‌پذیرد." -msgid "Represents a :c:type:`!HRESULT` value, which contains success or error information for a function or method call." +msgid "" +"Represents a :c:type:`!HRESULT` value, which contains success or error information for a function " +"or method call." msgstr "" +"بیانگر یک مقدار :c:type:`!HRESULT` است، که حاوی اطلاعات موفقیت یا خطا برای فراخوانی یک تابع یا متد " +"است." -msgid "Represents the C :c:expr:`PyObject *` datatype. Calling this without an argument creates a ``NULL`` :c:expr:`PyObject *` pointer." +msgid "" +"Represents the C :c:expr:`PyObject *` datatype. Calling this without an argument creates a " +"``NULL`` :c:expr:`PyObject *` pointer." msgstr "" +"نشان‌دهنده‌ی نوع داده‌ی :c:expr:`PyObject *` در C است. فراخوانی این بدون آرگومان، یک اشاره‌گر ``NULL`` " +"از نوع :c:expr:`PyObject *` ایجاد می‌کند." msgid ":class:`!py_object` is now a :term:`generic type`." -msgstr "" +msgstr ":class:`!py_object` اکنون یک :term:`generic type` است." -msgid "The :mod:`!ctypes.wintypes` module provides quite some other Windows specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, :c:type:`!VARIANT_BOOL` or :c:type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` are also defined." +msgid "" +"The :mod:`!ctypes.wintypes` module provides quite some other Windows specific data types, for " +"example :c:type:`!HWND`, :c:type:`!WPARAM`, :c:type:`!VARIANT_BOOL` or :c:type:`!DWORD`. Some " +"useful structures like :c:type:`!MSG` or :c:type:`!RECT` are also defined." msgstr "" +"ماژول :mod:`!ctypes.wintypes` تعداد زیادی از انواع داده دیگر مختص ویندوز را فراهم می‌کند، برای " +"مثال :c:type:`!HWND`، :c:type:`!WPARAM`، :c:type:`!VARIANT_BOOL` یا :c:type:`!DWORD`. برخی " +"ساختارهای مفید مانند :c:type:`!MSG` یا :c:type:`!RECT` نیز تعریف شده‌اند." msgid "Structured data types" -msgstr "" +msgstr "انواع داده ساختاریافته" msgid "Abstract base class for unions in native byte order." -msgstr "" +msgstr "کلاس پایه انتزاعی برای اجتماع‌ها (unions) در ترتیب بایت بومی." -msgid "Unions share common attributes and behavior with structures; see :class:`Structure` documentation for details." +msgid "" +"Unions share common attributes and behavior with structures; see :class:`Structure` documentation " +"for details." msgstr "" +"اجتماع‌ها (Unions) ویژگی‌ها و رفتار مشترکی با ساختارها دارند؛ برای جزئیات، " +"مستندات :class:`Structure` را ببینید." msgid "Abstract base class for unions in *big endian* byte order." -msgstr "" +msgstr "کلاس پایه انتزاعی برای اجتماع‌ها با ترتیب بایت *بزرگ‌اندیان*." msgid "Abstract base class for unions in *little endian* byte order." -msgstr "" +msgstr "کلاس پایه انتزاعی برای اجتماع‌ها (union) با ترتیب بایتی کوچک‌اندیان (*little endian*)." msgid "Abstract base class for structures in *big endian* byte order." -msgstr "" +msgstr "کلاس پایه‌ی انتزاعی برای ساختارهایی با ترتیب بایت *بزرگ‌اندیان* (big endian)." msgid "Abstract base class for structures in *little endian* byte order." -msgstr "" +msgstr "کلاس پایه انتزاعی برای ساختارهایی با ترتیب بایت *little endian*." -msgid "Structures and unions with non-native byte order cannot contain pointer type fields, or any other data types containing pointer type fields." +msgid "" +"Structures and unions with non-native byte order cannot contain pointer type fields, or any other " +"data types containing pointer type fields." msgstr "" +"ساختارها و اجتماع‌هایی که ترتیب بایت غیربومی دارند، نمی‌توانند شامل فیلدهایی از نوع اشاره‌گر یا هر " +"نوع داده دیگری باشند که حاوی فیلدهایی از نوع اشاره‌گر باشد." msgid "Abstract base class for structures in *native* byte order." -msgstr "" +msgstr "کلاس پایه انتزاعی برای ساختارها با ترتیب بایت *بومی*." -msgid "Concrete structure and union types must be created by subclassing one of these types, and at least define a :attr:`_fields_` class variable. :mod:`!ctypes` will create :term:`descriptor`\\s which allow reading and writing the fields by direct attribute accesses. These are the" +msgid "" +"Concrete structure and union types must be created by subclassing one of these types, and at least " +"define a :attr:`_fields_` class variable. :mod:`!ctypes` will create :term:`descriptor`\\s which " +"allow reading and writing the fields by direct attribute accesses. These are the" msgstr "" +"انواع عینی ساختار و اجتماع (union) باید با زیرکلاس‌سازی از یکی از این انواع ایجاد شوند، و حداقل یک " +"متغیر کلاس :attr:`_fields_` را تعریف کنند. :mod:`!ctypes` توصیف‌گرها (:term:`descriptor`\\s) را " +"ایجاد می‌کند که امکان خواندن و نوشتن فیلدها را از طریق دسترسی مستقیم به ویژگی‌ها فراهم می‌کنند. این‌ها" -msgid "A sequence defining the structure fields. The items must be 2-tuples or 3-tuples. The first item is the name of the field, the second item specifies the type of the field; it can be any ctypes data type." +msgid "" +"A sequence defining the structure fields. The items must be 2-tuples or 3-tuples. The first item " +"is the name of the field, the second item specifies the type of the field; it can be any ctypes " +"data type." msgstr "" +"دنباله‌ای که فیلدهای ساختار را تعریف می‌کند. آیتم‌ها باید تاپل‌های دوتایی یا سه‌تایی باشند. اولین آیتم، " +"نام فیلد است؛ دومین آیتم، نوع فیلد را مشخص می‌کند و می‌تواند هر نوع داده‌ای از ctypes باشد." -msgid "For integer type fields like :class:`c_int`, a third optional item can be given. It must be a small positive integer defining the bit width of the field." +msgid "" +"For integer type fields like :class:`c_int`, a third optional item can be given. It must be a " +"small positive integer defining the bit width of the field." msgstr "" +"برای فیلدهایی از نوع عدد صحیح مانند :class:`c_int`، می‌توان یک آیتم سوم اختیاری نیز ارائه کرد. این " +"آیتم باید یک عدد صحیح مثبت کوچک باشد که عرض بیت فیلد را تعریف می‌کند." -msgid "Field names must be unique within one structure or union. This is not checked, only one field can be accessed when names are repeated." +msgid "" +"Field names must be unique within one structure or union. This is not checked, only one field can " +"be accessed when names are repeated." msgstr "" +"نام فیلدها باید در یک ساختار یا union یکتا باشند. این موضوع بررسی نمی‌شود؛ وقتی نام‌ها تکراری باشند، " +"تنها به یک فیلد می‌توان دسترسی پیدا کرد." -msgid "It is possible to define the :attr:`_fields_` class variable *after* the class statement that defines the Structure subclass, this allows creating data types that directly or indirectly reference themselves::" +msgid "" +"It is possible to define the :attr:`_fields_` class variable *after* the class statement that " +"defines the Structure subclass, this allows creating data types that directly or indirectly " +"reference themselves::" msgstr "" +"می‌توانید متغیر کلاس :attr:`_fields_` را *پس از* دستور class که زیرکلاس Structure را تعریف می‌کند، " +"تعریف کنید؛ این کار امکان ایجاد انواع داده‌ای را فراهم می‌کند که به‌طور مستقیم یا غیرمستقیم به خودشان " +"ارجاع می‌دهند::" msgid "" "class List(Structure):\n" @@ -2459,78 +4616,172 @@ msgid "" " ...\n" " ]" msgstr "" +"class List(Structure):\n" +" pass\n" +"List._fields_ = [(\"pnext\", POINTER(List)),\n" +" ...\n" +" ]" -msgid "The :attr:`!_fields_` class variable can only be set once. Later assignments will raise an :exc:`AttributeError`." +msgid "" +"The :attr:`!_fields_` class variable can only be set once. Later assignments will raise " +"an :exc:`AttributeError`." msgstr "" +"متغیر کلاس :attr:`!_fields_` را فقط می‌توان یک‌بار تنظیم کرد. انتساب‌های بعدی " +"یک :exc:`AttributeError` را پرتاب خواهند کرد." -msgid "Additionally, the :attr:`!_fields_` class variable must be defined before the structure or union type is first used: an instance or subclass is created, :func:`sizeof` is called on it, and so on. Later assignments to :attr:`!_fields_` will raise an :exc:`AttributeError`. If :attr:`!_fields_` has not been set before such use, the structure or union will have no own fields, as if :attr:`!_fields_` was empty." -msgstr "" +msgid "" +"Additionally, the :attr:`!_fields_` class variable must be defined before the structure or union " +"type is first used: an instance or subclass is created, :func:`sizeof` is called on it, and so on. " +"Later assignments to :attr:`!_fields_` will raise an :exc:`AttributeError`. If :attr:`!_fields_` " +"has not been set before such use, the structure or union will have no own fields, as if :attr:`!" +"_fields_` was empty." +msgstr "" +"علاوه بر این، متغیر کلاس :attr:`!_fields_` باید پیش از اولین استفاده از نوع ساختار یا اجتماع " +"(union) تعریف شود: ایجاد یک نمونه یا زیرکلاس، فراخوانی :func:`sizeof` روی آن، و غیره. انتساب‌های " +"بعدی به :attr:`!_fields_` باعث پرتاب یک :exc:`AttributeError` می‌شوند. اگر :attr:`!_fields_` پیش از " +"چنین استفاده‌ای تنظیم نشده باشد، ساختار یا اجتماع هیچ فیلد مختص به خود نخواهد داشت، گویی :attr:`!" +"_fields_` خالی بوده است." -msgid "Sub-subclasses of structure types inherit the fields of the base class plus the :attr:`_fields_` defined in the sub-subclass, if any." +msgid "" +"Sub-subclasses of structure types inherit the fields of the base class plus the :attr:`_fields_` " +"defined in the sub-subclass, if any." msgstr "" +"زیرزیرکلاس‌های انواع ساختاری، فیلدهای کلاس پایه به‌همراه :attr:`_fields_` تعریف‌شده در زیرزیرکلاس را، " +"در صورت وجود، به ارث می‌برند." -msgid "An optional small integer that allows overriding the alignment of structure fields in the instance." -msgstr "" +msgid "" +"An optional small integer that allows overriding the alignment of structure fields in the instance." +msgstr "یک عدد صحیح کوچک اختیاری که امکان بازنویسی هم‌ترازی فیلدهای ساختار در نمونه را فراهم می‌کند." msgid "This is only implemented for the MSVC-compatible memory layout (see :attr:`_layout_`)." msgstr "" +"این فقط برای چیدمان حافظه سازگار با MSVC پیاده‌سازی شده است (به :attr:`_layout_` مراجعه کنید)." -msgid "Setting :attr:`!_pack_` to 0 is the same as not setting it at all. Otherwise, the value must be a positive power of two. The effect is equivalent to ``#pragma pack(N)`` in C, except :mod:`!ctypes` may allow larger *n* than what the compiler accepts." +msgid "" +"Setting :attr:`!_pack_` to 0 is the same as not setting it at all. Otherwise, the value must be a " +"positive power of two. The effect is equivalent to ``#pragma pack(N)`` in C, except :mod:`!ctypes` " +"may allow larger *n* than what the compiler accepts." msgstr "" +"تنظیم :attr:`!_pack_` به ۰ مانند این است که اصلاً آن را تنظیم نکرده باشید. در غیر این صورت، مقدار " +"باید توان مثبتی از ۲ باشد. این اثر معادل ``#pragma pack(N)`` در C است، با این تفاوت که :mod:`!" +"ctypes` ممکن است *n* بزرگ‌تری را نسبت به آنچه کامپایلر می‌پذیرد مجاز بداند." -msgid ":attr:`!_pack_` must already be defined when :attr:`_fields_` is assigned, otherwise it will have no effect." +msgid "" +":attr:`!_pack_` must already be defined when :attr:`_fields_` is assigned, otherwise it will have " +"no effect." msgstr "" +"هنگامی که :attr:`_fields_ ` انتساب می‌یابد، :attr:`!_pack_ <_fields_>` باید از پیش تعریف " +"شده باشد، در غیر این صورت هیچ اثری نخواهد داشت." -msgid "For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible layout will be used by default. On non-Windows platforms, this default is deprecated and is slated to become an error in Python 3.19. If it is intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." +msgid "" +"For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible layout will be used by " +"default. On non-Windows platforms, this default is deprecated and is slated to become an error in " +"Python 3.19. If it is intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." msgstr "" +"به دلایل تاریخی، اگر :attr:`!_pack_` غیرصفر باشد، چیدمان سازگار با MSVC به‌طور پیش‌فرض استفاده خواهد " +"شد. در سکوهای غیرویندوزی، این پیش‌فرض منسوخ شده است و قرار است در پایتون 3.19 به یک خطا تبدیل شود. " +"اگر این حالت مورد نظر است، :attr:`~Structure._layout_` را به‌صراحت روی ``'ms'`` تنظیم کنید." -msgid "An optional small integer that allows increasing the alignment of the structure when being packed or unpacked to/from memory." +msgid "" +"An optional small integer that allows increasing the alignment of the structure when being packed " +"or unpacked to/from memory." msgstr "" +"یک عدد صحیح کوچک اختیاری که امکان افزایش هم‌ترازی ساختار را هنگام بسته‌بندی یا واگشایی به/از حافظه " +"فراهم می‌کند." -msgid "The value must not be negative. The effect is equivalent to ``__attribute__((aligned(N)))`` on GCC or ``#pragma align(N)`` on MSVC, except :mod:`!ctypes` may allow values that the compiler would reject." +msgid "" +"The value must not be negative. The effect is equivalent to ``__attribute__((aligned(N)))`` on GCC " +"or ``#pragma align(N)`` on MSVC, except :mod:`!ctypes` may allow values that the compiler would " +"reject." msgstr "" +"مقدار نباید منفی باشد. اثر آن معادل ``__attribute__((aligned(N)))`` در GCC یا ``#pragma align(N)`` " +"در MSVC است، با این تفاوت که :mod:`!ctypes` ممکن است مقادیری را بپذیرد که کامپایلر آن‌ها را رد " +"می‌کند." -msgid ":attr:`!_align_` can only *increase* a structure's alignment requirements. Setting it to 0 or 1 has no effect." +msgid "" +":attr:`!_align_` can only *increase* a structure's alignment requirements. Setting it to 0 or 1 " +"has no effect." msgstr "" +":attr:`!_align_` فقط می‌تواند الزامات هم‌ترازی یک ساختار را *افزایش* دهد. تنظیم آن روی ۰ یا ۱ هیچ " +"تأثیری ندارد." msgid "Using values that are not powers of two is discouraged and may lead to surprising behavior." msgstr "" +"استفاده از مقادیری که توان‌های ۲ نیستند، توصیه نمی‌شود و ممکن است به رفتار غیرمنتظره‌ای منجر شود." -msgid ":attr:`!_align_` must already be defined when :attr:`_fields_` is assigned, otherwise it will have no effect." +msgid "" +":attr:`!_align_` must already be defined when :attr:`_fields_` is assigned, otherwise it will have " +"no effect." msgstr "" +":attr:`!_align_` باید هنگامی که :attr:`_fields_` انتساب داده می‌شود از قبل تعریف‌شده باشد، در غیر " +"این صورت بی‌اثر خواهد بود." msgid "An optional string naming the struct/union layout. It can currently be set to:" msgstr "" +"یک رشته اختیاری برای نام‌گذاری چیدمان struct/union. در حال حاضر می‌توان آن را به‌صورت زیر تنظیم کرد:" -msgid "``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and Clang, this layout can be selected with ``__attribute__((ms_struct))``." +msgid "" +"``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and Clang, this layout can be " +"selected with ``__attribute__((ms_struct))``." msgstr "" +"``\"ms\"``: چیدمان استفاده‌شده توسط کامپایلر مایکروسافت (MSVC). در GCC و Clang، این چیدمان را " +"می‌توان با ``__attribute__((ms_struct))`` انتخاب کرد." -msgid "``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” data model, as used on Linux and macOS. With this layout, :attr:`~Structure._pack_` must be unset or zero." +msgid "" +"``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” data model, as used on " +"Linux and macOS. With this layout, :attr:`~Structure._pack_` must be unset or zero." msgstr "" +"``\"gcc-sysv\"``: چیدمان استفاده‌شده توسط GCC با مدل داده System V یا «شبیه SysV»، همان‌طور که در " +"Linux و macOS استفاده می‌شود. در این چیدمان، :attr:`~Structure._pack_` باید تنظیم‌نشده یا صفر باشد." -msgid "If not set explicitly, ``ctypes`` will use a default that matches the platform conventions. This default may change in future Python releases (for example, when a new platform gains official support, or when a difference between similar platforms is found). Currently the default will be:" +msgid "" +"If not set explicitly, ``ctypes`` will use a default that matches the platform conventions. This " +"default may change in future Python releases (for example, when a new platform gains official " +"support, or when a difference between similar platforms is found). Currently the default will be:" msgstr "" +"اگر به‌صراحت تنظیم نشده باشد، ``ctypes`` از پیش‌فرضی استفاده خواهد کرد که با قراردادهای پلتفرم " +"مطابقت دارد. این پیش‌فرض ممکن است در نسخه‌های آینده پایتون تغییر کند (برای مثال، وقتی پشتیبانی رسمی " +"از یک پلتفرم جدید اضافه شود، یا وقتی تفاوتی میان پلتفرم‌های مشابه یافت شود). در حال حاضر پیش‌فرض به " +"این صورت خواهد بود:" msgid "On Windows: ``\"ms\"``" -msgstr "" +msgstr "در ویندوز: ``\"ms\"``" -msgid "When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is deprecated; see :attr:`~Structure._pack_` documentation.)" +msgid "" +"When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is deprecated; " +"see :attr:`~Structure._pack_` documentation.)" msgstr "" +"هنگامی که :attr:`~Structure._pack_` تعیین شده باشد: ``\"ms\"``. (این مورد منسوخ شده است؛ " +"مستندات :attr:`~Structure._pack_` را ببینید.)" msgid "Otherwise: ``\"gcc-sysv\"``" -msgstr "" +msgstr "در غیر این صورت: ``\"gcc-sysv\"``" -msgid ":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` is assigned, otherwise it will have no effect." +msgid "" +":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` is assigned, otherwise " +"it will have no effect." msgstr "" +"هنگامی که :attr:`~Structure._fields_ ` انتساب می‌یابد، :attr:`!_layout_ " +"<~Structure._fields_>` باید از قبل تعریف شده باشد، در غیر این صورت هیچ اثری نخواهد داشت." -msgid "An optional sequence that lists the names of unnamed (anonymous) fields. :attr:`_anonymous_` must be already defined when :attr:`_fields_` is assigned, otherwise it will have no effect." +msgid "" +"An optional sequence that lists the names of unnamed (anonymous) fields. :attr:`_anonymous_` must " +"be already defined when :attr:`_fields_` is assigned, otherwise it will have no effect." msgstr "" +"یک دنباله اختیاری که نام‌های فیلدهای بی‌نام (ناشناس) را فهرست می‌کند. :attr:`_anonymous_` باید هنگامی " +"که :attr:`_fields_` مقداردهی می‌شود، از پیش تعریف شده باشد، در غیر این صورت هیچ اثری نخواهد داشت." -msgid "The fields listed in this variable must be structure or union type fields. :mod:`!ctypes` will create descriptors in the structure type that allows accessing the nested fields directly, without the need to create the structure or union field." +msgid "" +"The fields listed in this variable must be structure or union type fields. :mod:`!ctypes` will " +"create descriptors in the structure type that allows accessing the nested fields directly, without " +"the need to create the structure or union field." msgstr "" +"فیلدهای فهرست‌شده در این متغیر باید فیلدهایی با نوع ساختار یا union باشند. :mod:`!ctypes` " +"توصیف‌گرهایی را در نوع ساختار ایجاد می‌کند که امکان دسترسی مستقیم به فیلدهای تودرتو را بدون نیاز به " +"ایجاد فیلد ساختار یا union فراهم می‌کنند." msgid "Here is an example type (Windows)::" -msgstr "" +msgstr "در اینجا یک نمونه نوع (ویندوز)::" msgid "" "class _U(Union):\n" @@ -2543,9 +4794,26 @@ msgid "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" msgstr "" +"class _U(Union):\n" +" _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" +" (\"lpadesc\", POINTER(ARRAYDESC)),\n" +" (\"hreftype\", HREFTYPE)]\n" +"\n" +"class TYPEDESC(Structure):\n" +" _anonymous_ = (\"u\",)\n" +" _fields_ = [(\"u\", _U),\n" +" (\"vt\", VARTYPE)]" -msgid "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field is defined as anonymous field, it is now possible to access the members directly off the TYPEDESC instance. ``td.lptdesc`` and ``td.u.lptdesc`` are equivalent, but the former is faster since it does not need to create a temporary union instance::" +msgid "" +"The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the " +"union fields is valid. Since the ``u`` field is defined as anonymous field, it is now possible to " +"access the members directly off the TYPEDESC instance. ``td.lptdesc`` and ``td.u.lptdesc`` are " +"equivalent, but the former is faster since it does not need to create a temporary union instance::" msgstr "" +"ساختار ``TYPEDESC`` یک نوع داده COM را توصیف می‌کند، فیلد ``vt`` مشخص می‌کند که کدام‌یک از فیلدهای " +"union معتبر است. از آن‌جا که فیلد ``u`` به‌عنوان فیلد ناشناس تعریف شده است، اکنون امکان دسترسی " +"مستقیم به اعضا از روی نمونه TYPEDESC وجود دارد. ``td.lptdesc`` و ``td.u.lptdesc`` معادل هستند، اما " +"مورد اول سریع‌تر است، زیرا نیازی به ایجاد یک نمونه union موقت ندارد::" msgid "" "td = TYPEDESC()\n" @@ -2553,15 +4821,35 @@ msgid "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" msgstr "" +"td = TYPEDESC()\n" +"td.vt = VT_PTR\n" +"td.lptdesc = POINTER(some_type)\n" +"td.u.lptdesc = POINTER(some_type)" -msgid "It is possible to define sub-subclasses of structures, they inherit the fields of the base class. If the subclass definition has a separate :attr:`_fields_` variable, the fields specified in this are appended to the fields of the base class." +msgid "" +"It is possible to define sub-subclasses of structures, they inherit the fields of the base class. " +"If the subclass definition has a separate :attr:`_fields_` variable, the fields specified in this " +"are appended to the fields of the base class." msgstr "" +"می‌توان زیرزیرکلاس‌هایی از ساختارها تعریف کرد؛ آن‌ها فیلدهای کلاس پایه را به ارث می‌برند. اگر تعریف " +"زیرکلاس دارای یک متغیر :attr:`_fields_` جداگانه باشد، فیلدهای مشخص‌شده در آن به فیلدهای کلاس پایه " +"افزوده می‌شوند." -msgid "Structure and union constructors accept both positional and keyword arguments. Positional arguments are used to initialize member fields in the same order as they are appear in :attr:`_fields_`. Keyword arguments in the constructor are interpreted as attribute assignments, so they will initialize :attr:`_fields_` with the same name, or create new attributes for names not present in :attr:`_fields_`." -msgstr "" +msgid "" +"Structure and union constructors accept both positional and keyword arguments. Positional " +"arguments are used to initialize member fields in the same order as they are appear " +"in :attr:`_fields_`. Keyword arguments in the constructor are interpreted as attribute " +"assignments, so they will initialize :attr:`_fields_` with the same name, or create new attributes " +"for names not present in :attr:`_fields_`." +msgstr "" +"سازنده‌های ساختار و اتحاد، هم آرگومان‌های جایگاهی و هم آرگومان‌های کلیدواژه‌ای را می‌پذیرند. آرگومان‌های " +"جایگاهی برای مقداردهی اولیه‌ی فیلدهای عضو به همان ترتیبی که در :attr:`_fields_` ظاهر می‌شوند، " +"استفاده می‌شوند. آرگومان‌های کلیدواژه‌ای در سازنده به‌عنوان انتساب ویژگی تفسیر می‌شوند، بنابراین " +"فیلدهای :attr:`_fields_` را با همان نام مقداردهی اولیه می‌کنند، یا برای نام‌هایی که " +"در :attr:`_fields_` وجود ندارند، ویژگی‌های جدیدی ایجاد می‌کنند." msgid "Descriptor for fields of a :class:`Structure` and :class:`Union`. For example::" -msgstr "" +msgstr "توصیف‌گر فیلدهای :class:`Structure` و :class:`Union`. برای مثال::" msgid "" ">>> class Color(Structure):\n" @@ -2584,114 +4872,216 @@ msgid "" ">>> Color.blinking.bit_offset\n" "1" msgstr "" +">>> class Color(Structure):\n" +"... _fields_ = (\n" +"... ('red', c_uint8),\n" +"... ('green', c_uint8),\n" +"... ('blue', c_uint8),\n" +"... ('intense', c_bool, 1),\n" +"... ('blinking', c_bool, 1),\n" +"... )\n" +"...\n" +">>> Color.red\n" +"\n" +">>> Color.green.type\n" +"\n" +">>> Color.blue.byte_offset\n" +"2\n" +">>> Color.intense\n" +"\n" +">>> Color.blinking.bit_offset\n" +"1" msgid "All attributes are read-only." -msgstr "" +msgstr "تمام ویژگی‌ها فقط‌خواندنی هستند." -msgid ":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not instantiate the class directly." +msgid "" +":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not instantiate the class " +"directly." msgstr "" +"اشیای :class:`!CField` از طریق :attr:`~Structure._fields_` ایجاد می‌شوند؛ این کلاس را مستقیماً " +"نمونه‌سازی نکنید." -msgid "Previously, descriptors only had ``offset`` and ``size`` attributes and a readable string representation; the :class:`!CField` class was not available directly." +msgid "" +"Previously, descriptors only had ``offset`` and ``size`` attributes and a readable string " +"representation; the :class:`!CField` class was not available directly." msgstr "" +"پیش‌تر، توصیف‌گرها فقط ویژگی‌های ``offset`` و ``size`` و یک نمایش رشته‌ای خوانا داشتند؛ کلاس :class:`!" +"CField` به‌طور مستقیم در دسترس نبود." msgid "Name of the field, as a string." -msgstr "" +msgstr "نام فیلد، به‌صورت یک رشته." msgid "Type of the field, as a :ref:`ctypes class `." -msgstr "" +msgstr "نوع فیلد، به‌صورت یک :ref:`کلاس ctypes `." msgid "Offset of the field, in bytes." -msgstr "" +msgstr "آفست فیلد، بر حسب بایت." -msgid "For bitfields, this is the offset of the underlying byte-aligned *storage unit*; see :attr:`~CField.bit_offset`." +msgid "" +"For bitfields, this is the offset of the underlying byte-aligned *storage unit*; " +"see :attr:`~CField.bit_offset`." msgstr "" +"برای فیلدهای بیتی (bitfields)، این آفست *واحد ذخیره‌سازی* زیربنایی هم‌تراز با بایت است؛ " +"به :attr:`~CField.bit_offset` مراجعه کنید." msgid "Size of the field, in bytes." -msgstr "" +msgstr "اندازه‌ی فیلد، بر حسب بایت." -msgid "For bitfields, this is the size of the underlying *storage unit*. Typically, it has the same size as the bitfield's type." -msgstr "" +msgid "" +"For bitfields, this is the size of the underlying *storage unit*. Typically, it has the same size " +"as the bitfield's type." +msgstr "برای بیت‌فیلدها، این اندازه‌ی *واحد ذخیره‌سازی* زیربنایی است. معمولاً هم‌اندازه‌ی نوع بیت‌فیلد است." msgid "For non-bitfields, equivalent to :attr:`~CField.byte_size`." -msgstr "" +msgstr "برای فیلدهای غیربیتی، معادل :attr:`~CField.byte_size` است." -msgid "For bitfields, this contains a backwards-compatible bit-packed value that combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer using the explicit attributes instead." +msgid "" +"For bitfields, this contains a backwards-compatible bit-packed value that " +"combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer using the explicit " +"attributes instead." msgstr "" +"برای فیلدهای بیتی (bitfields)، این شامل یک مقدار بسته‌بندی‌شده بیتی سازگار با نسخه‌های پیشین است " +"که :attr:`~CField.bit_size` و :attr:`~CField.bit_offset` را ترکیب می‌کند. ترجیحاً به‌جای آن از " +"ویژگی‌های صریح استفاده کنید." msgid "True if this is a bitfield." -msgstr "" +msgstr "اگر این یک فیلد بیتی (bitfield) باشد، True است." -msgid "The location of a bitfield within its *storage unit*, that is, within :attr:`~CField.byte_size` bytes of memory starting at :attr:`~CField.byte_offset`." +msgid "" +"The location of a bitfield within its *storage unit*, that is, within :attr:`~CField.byte_size` " +"bytes of memory starting at :attr:`~CField.byte_offset`." msgstr "" +"موقعیت یک فیلد بیتی (bitfield) در *واحد ذخیره‌سازی* آن، یعنی در :attr:`~CField.byte_size` بایت از " +"حافظه که از :attr:`~CField.byte_offset` آغاز می‌شود." -msgid "To get the field's value, read the storage unit as an integer, :ref:`shift left ` by :attr:`!bit_offset` and take the :attr:`!bit_size` least significant bits." +msgid "" +"To get the field's value, read the storage unit as an integer, :ref:`shift left ` " +"by :attr:`!bit_offset` and take the :attr:`!bit_size` least significant bits." msgstr "" +"برای به‌دست آوردن مقدار فیلد، واحد ذخیره‌سازی را به‌عنوان یک عدد صحیح بخوانید، آن را به " +"اندازه‌ی :attr:`!bit_offset` :ref:`شیفت چپ ` دهید و :attr:`!bit_size` بیت کم‌اهمیت را " +"بگیرید." -msgid "For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is equal to ``byte_size * 8``." +msgid "" +"For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is equal to ``byte_size * 8``." msgstr "" +"برای فیلدهای غیربیتی، :attr:`!bit_offset` صفر است و :attr:`!bit_size` برابر است با ``byte_size * " +"8``." -msgid "True if this field is anonymous, that is, it contains nested sub-fields that should be merged into a containing structure or union." +msgid "" +"True if this field is anonymous, that is, it contains nested sub-fields that should be merged into " +"a containing structure or union." msgstr "" +"True اگر این فیلد ناشناس باشد، یعنی شامل زیرفیلدهای تودرتویی است که باید در ساختار یا union حاوی " +"آن ادغام شوند." msgid "Arrays and pointers" -msgstr "" +msgstr "آرایه‌ها و اشاره‌گرها" msgid "Abstract base class for arrays." -msgstr "" +msgstr "کلاس پایه انتزاعی برای آرایه‌ها." -msgid "The recommended way to create concrete array types is by multiplying any :mod:`!ctypes` data type with a non-negative integer. Alternatively, you can subclass this type and define :attr:`_length_` and :attr:`_type_` class variables. Array elements can be read and written using standard subscript and slice accesses; for slice reads, the resulting object is *not* itself an :class:`Array`." -msgstr "" +msgid "" +"The recommended way to create concrete array types is by multiplying any :mod:`!ctypes` data type " +"with a non-negative integer. Alternatively, you can subclass this type and " +"define :attr:`_length_` and :attr:`_type_` class variables. Array elements can be read and written " +"using standard subscript and slice accesses; for slice reads, the resulting object is *not* itself " +"an :class:`Array`." +msgstr "" +"راه توصیه‌شده برای ایجاد انواع آرایه‌ی مشخص، ضرب کردن هر نوع داده‌ای از :mod:`!ctypes` در یک عدد صحیح " +"نامنفی است. به‌عنوان جایگزین، می‌توانید یک زیرکلاس از این نوع بسازید و متغیرهای " +"کلاس :attr:`_length_` و :attr:`_type_` را تعریف کنید. عناصر آرایه را می‌توان با استفاده از " +"دسترسی‌های استاندارد اندیسی و برشی خواند و نوشت؛ در خواندن‌های برشی، شیء حاصل، خود یک :class:`Array` " +"*نیست*." msgid "Arrays are :ref:`generic ` over the type of their elements." -msgstr "" +msgstr "آرایه‌ها نسبت به نوع عناصر خود :ref:`عام ` هستند." -msgid "A positive integer specifying the number of elements in the array. Out-of-range subscripts result in an :exc:`IndexError`. Will be returned by :func:`len`." +msgid "" +"A positive integer specifying the number of elements in the array. Out-of-range subscripts result " +"in an :exc:`IndexError`. Will be returned by :func:`len`." msgstr "" +"یک عدد صحیح مثبت که تعداد عناصر آرایه را مشخص می‌کند. زیرنویس‌های خارج از محدوده منجر " +"به :exc:`IndexError` می‌شوند. توسط :func:`len` برگردانده می‌شود." msgid "Specifies the type of each element in the array." -msgstr "" +msgstr "نوع هر عنصر در آرایه را مشخص می‌کند." -msgid "Array subclass constructors accept positional arguments, used to initialize the elements in order." +msgid "" +"Array subclass constructors accept positional arguments, used to initialize the elements in order." msgstr "" +"سازنده‌های زیرکلاس آرایه، آرگومان‌های جایگاهی را می‌پذیرند که برای مقداردهی اولیه‌ی عناصر به‌ترتیب " +"استفاده می‌شوند." -msgid "Create an array. Equivalent to ``type * length``, where *type* is a :mod:`!ctypes` data type and *length* an integer." +msgid "" +"Create an array. Equivalent to ``type * length``, where *type* is a :mod:`!ctypes` data type and " +"*length* an integer." msgstr "" +"یک آرایه ایجاد می‌کند. معادل ``type * length`` است، که در آن *type* یک نوع داده از :mod:`!ctypes` و " +"*length* یک عدد صحیح است." msgid "In favor of multiplication." -msgstr "" +msgstr "به نفع ضرب." msgid "Private, abstract base class for pointers." -msgstr "" +msgstr "کلاس پایه خصوصی و انتزاعی برای اشاره‌گرها." -msgid "Concrete pointer types are created by calling :func:`POINTER` with the type that will be pointed to; this is done automatically by :func:`pointer`." +msgid "" +"Concrete pointer types are created by calling :func:`POINTER` with the type that will be pointed " +"to; this is done automatically by :func:`pointer`." msgstr "" +"انواع اشاره‌گر مشخص با فراخوانی :func:`POINTER` با نوعی که به آن اشاره خواهد شد ایجاد می‌شوند؛ این " +"کار به‌طور خودکار توسط :func:`pointer` انجام می‌شود." -msgid "If a pointer points to an array, its elements can be read and written using standard subscript and slice accesses. Pointer objects have no size, so :func:`len` will raise :exc:`TypeError`. Negative subscripts will read from the memory *before* the pointer (as in C), and out-of-range subscripts will probably crash with an access violation (if you're lucky)." +msgid "" +"If a pointer points to an array, its elements can be read and written using standard subscript and " +"slice accesses. Pointer objects have no size, so :func:`len` will raise :exc:`TypeError`. " +"Negative subscripts will read from the memory *before* the pointer (as in C), and out-of-range " +"subscripts will probably crash with an access violation (if you're lucky)." msgstr "" +"اگر یک اشاره‌گر به یک آرایه اشاره کند، می‌توان عناصر آن را با استفاده از دسترسی‌های استاندارد اندیسی " +"و برشی خواند و نوشت. اشیاء اشاره‌گر اندازه‌ای ندارند، بنابراین :func:`len` :exc:`TypeError` را پرتاب " +"خواهد کرد. اندیس‌های منفی حافظه‌ی *پیش از* اشاره‌گر را می‌خوانند (همان‌طور که در C نیز چنین است)، و " +"اندیس‌های خارج از محدوده احتمالاً با نقض دسترسی (access violation) دچار فروپاشی خواهند شد (اگر خوش‌شانس " +"باشید)." msgid "Specifies the type pointed to." -msgstr "" +msgstr "نوعی را که به آن اشاره شده است مشخص می‌کند." -msgid "Returns the object to which to pointer points. Assigning to this attribute changes the pointer to point to the assigned object." +msgid "" +"Returns the object to which to pointer points. Assigning to this attribute changes the pointer to " +"point to the assigned object." msgstr "" +"شیءای را که اشاره‌گر به آن اشاره می‌کند، برمی‌گرداند. انتساب به این ویژگی، اشاره‌گر را طوری تغییر می‌دهد " +"که به شیء انتساب‌یافته اشاره کند." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "This exception is raised when a foreign function call cannot convert one of the passed arguments." +msgid "" +"This exception is raised when a foreign function call cannot convert one of the passed arguments." msgstr "" +"این استثنا زمانی پرتاب می‌شود که یک فراخوانی تابع خارجی نتواند یکی از آرگومان‌های ارسال‌شده را تبدیل " +"کند." msgid "This exception is raised when a COM method call failed." -msgstr "" +msgstr "این استثنا زمانی پرتاب می‌شود که فراخوانی یک متد COM ناموفق باشد." msgid "The integer value representing the error code." -msgstr "" +msgstr "مقدار عدد صحیحی که کد خطا را نشان می‌دهد." msgid "The error message." -msgstr "" +msgstr "پیام خطا." msgid "The 5-tuple ``(descr, source, helpfile, helpcontext, progid)``." -msgstr "" +msgstr "۵-تاییِ ``(descr, source, helpfile, helpcontext, progid)``." -msgid "*descr* is the textual description. *source* is the language-dependent ``ProgID`` for the class or application that raised the error. *helpfile* is the path of the help file. *helpcontext* is the help context identifier. *progid* is the ``ProgID`` of the interface that defined the error." +msgid "" +"*descr* is the textual description. *source* is the language-dependent ``ProgID`` for the class " +"or application that raised the error. *helpfile* is the path of the help file. *helpcontext* is " +"the help context identifier. *progid* is the ``ProgID`` of the interface that defined the error." msgstr "" +"*descr* توضیح متنی است. *source* ``ProgID`` وابسته به زبان برای کلاس یا برنامه‌ای است که خطا را " +"پرتاب کرده است. *helpfile* مسیر فایل راهنما است. *helpcontext* شناسه زمینه راهنما است. *progid* " +"``ProgID`` رابطی است که خطا را تعریف کرده است." diff --git a/library/curses.ascii.po b/library/curses.ascii.po index a74f5634d..1bbc0541d 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -25,208 +25,302 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!curses.ascii` --- Utilities for ASCII characters" -msgstr "" +msgstr ":mod:`!curses.ascii` --- ابزارهایی برای نویسه‌های ASCII" msgid "**Source code:** :source:`Lib/curses/ascii.py`" -msgstr "" +msgstr ":source:`Lib/curses/ascii.py`" -msgid "The :mod:`!curses.ascii` module supplies name constants for ASCII characters and functions to test membership in various ASCII character classes. The constants supplied are names for control characters as follows:" +msgid "" +"The :mod:`!curses.ascii` module supplies name constants for ASCII characters" +" and functions to test membership in various ASCII character classes. The " +"constants supplied are names for control characters as follows:" msgstr "" +"ماژول :mod:`!curses.ascii` ثابت‌های نام‌دار برای نویسه‌های ASCII و توابعی " +"برای بررسی عضویت در کلاس‌های مختلف نویسه‌ای ASCII فراهم می‌کند. ثابت‌های " +"فراهم‌شده نام‌هایی برای نویسه‌های کنترلی هستند، به شرح زیر:" msgid "Name" -msgstr "" +msgstr "نام" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Start of heading, console interrupt" -msgstr "" +msgstr "آغاز سرفصل، وقفه‌ی کنسول" msgid "Start of text" -msgstr "" +msgstr "آغاز متن" msgid "End of text" -msgstr "" +msgstr "پایان متن" msgid "End of transmission" -msgstr "" +msgstr "پایان انتقال" msgid "Enquiry, goes with :const:`ACK` flow control" -msgstr "" +msgstr "استعلام، همراه با کنترل جریان :const:`ACK`" msgid "Acknowledgement" -msgstr "" +msgstr "قدردانی" msgid "Bell" -msgstr "" +msgstr "زنگ" msgid "Backspace" -msgstr "" +msgstr "پس‌بر (Backspace)" msgid "Tab" -msgstr "" +msgstr "تب" msgid "Alias for :const:`TAB`: \"Horizontal tab\"" -msgstr "" +msgstr "نام مستعار برای :const:`TAB`: «تب افقی»" msgid "Line feed" -msgstr "" +msgstr "تغذیه‌ی سطر" msgid "Alias for :const:`LF`: \"New line\"" -msgstr "" +msgstr "نام مستعار برای :const:`LF`: «خط جدید»" msgid "Vertical tab" -msgstr "" +msgstr "تب عمودی" msgid "Form feed" -msgstr "" +msgstr "تغذیه‌ی صفحه" msgid "Carriage return" -msgstr "" +msgstr "بازگشت به ابتدای سطر" msgid "Shift-out, begin alternate character set" -msgstr "" +msgstr "Shift-out، آغاز مجموعه نویسه‌ی جایگزین" msgid "Shift-in, resume default character set" -msgstr "" +msgstr "Shift-in، از سرگیری مجموعه‌نویسه پیش‌فرض" msgid "Data-link escape" -msgstr "" +msgstr "خنثی‌سازی پیوند داده (Data-link escape)" msgid "XON, for flow control" -msgstr "" +msgstr "XON، برای کنترل جریان" msgid "Device control 2, block-mode flow control" -msgstr "" +msgstr "کنترل دستگاه ۲، کنترل جریان حالت بلوکی" msgid "XOFF, for flow control" -msgstr "" +msgstr "XOFF، برای کنترل جریان" msgid "Device control 4" -msgstr "" +msgstr "کنترل دستگاه ۴" msgid "Negative acknowledgement" -msgstr "" +msgstr "تأیید منفی (negative acknowledgement)" msgid "Synchronous idle" -msgstr "" +msgstr "بی‌کاری همگام" msgid "End transmission block" -msgstr "" +msgstr "پایان بلوک انتقال" msgid "Cancel" -msgstr "" +msgstr "لغو" msgid "End of medium" -msgstr "" +msgstr "پایان رسانه (End of medium)" msgid "Substitute" -msgstr "" +msgstr "جایگزینی" msgid "Escape" -msgstr "" +msgstr "خنثی کردن" msgid "File separator" -msgstr "" +msgstr "جداکننده‌ی فایل" msgid "Group separator" -msgstr "" +msgstr "جداکننده‌ی گروه" msgid "Record separator, block-mode terminator" -msgstr "" +msgstr "جداکننده‌ی رکورد، پایان‌دهنده‌ی حالت بلوکی" msgid "Unit separator" -msgstr "" +msgstr "جداکننده‌ی واحد" msgid "Space" -msgstr "" +msgstr "فاصله" msgid "Delete" -msgstr "" +msgstr "حذف" -msgid "Note that many of these have little practical significance in modern usage. The mnemonics derive from teleprinter conventions that predate digital computers." +msgid "" +"Note that many of these have little practical significance in modern usage." +" The mnemonics derive from teleprinter conventions that predate digital " +"computers." msgstr "" +"توجه داشته باشید که بسیاری از این‌ها در کاربرد امروزی اهمیت عملی چندانی " +"ندارند. این نام‌های یادآور برگرفته از قراردادهای تله‌پرینتر مربوط به پیش از " +"رایانه‌های دیجیتال هستند." -msgid "The module supplies the following functions, patterned on those in the standard C library:" +msgid "" +"The module supplies the following functions, patterned on those in the " +"standard C library:" msgstr "" +"این ماژول توابع زیر را فراهم می‌کند که بر اساس توابع کتابخانه استاندارد C " +"طراحی شده‌اند:" -msgid "Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c) or isdigit(c)``." +msgid "" +"Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c)" +" or isdigit(c)``." msgstr "" +"بررسی می‌کند که آیا نویسه‌ای الفبایی‌عددی ASCII است یا خیر؛ این معادل " +"``isalpha(c) or isdigit(c)`` است." -msgid "Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) or islower(c)``." +msgid "" +"Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) " +"or islower(c)``." msgstr "" +"بررسی می‌کند که آیا نویسه الفبایی ASCII است؛ این معادل ``isupper(c) or " +"islower(c)`` است." msgid "Checks for a character value that fits in the 7-bit ASCII set." msgstr "" +"بررسی می‌کند که آیا مقدار نویسه‌ای در مجموعه‌ی ASCII ۷‌بیتی می‌گنجد یا خیر." msgid "Checks for an ASCII blank character; space or horizontal tab." -msgstr "" +msgstr "بررسی نویسه‌ی خالی ASCII؛ فاصله یا تب افقی." -msgid "Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f)." -msgstr "" +msgid "" +"Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f)." +msgstr "بررسی وجود یک نویسه‌ی کنترلی ASCII (در بازه‌ی 0x00 تا 0x1f یا 0x7f)." -msgid "Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is equivalent to ``c in string.digits``." +msgid "" +"Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is " +"equivalent to ``c in string.digits``." msgstr "" +"بررسی می‌کند که یک رقم دهدهی ASCII، ``'0'`` تا ``'9'`` باشد. این معادل ``c " +"in string.digits`` است." msgid "Checks for any ASCII printable character except space." -msgstr "" +msgstr "بررسی هر نویسه‌ی چاپی ASCII به‌جز فاصله." msgid "Checks for an ASCII lower-case character." -msgstr "" +msgstr "بررسی برای یک نویسه‌ی کوچک ASCII." msgid "Checks for any ASCII printable character including space." -msgstr "" +msgstr "هر نویسه‌ی قابل‌چاپ ASCII، از جمله فاصله، بررسی می‌شود." -msgid "Checks for any ASCII printable character which is not a space or an alphanumeric character." +msgid "" +"Checks for any ASCII printable character which is not a space or an " +"alphanumeric character." msgstr "" +"هر نویسه‌ی چاپ‌پذیر ASCII را که فاصله یا نویسه‌ی الفبایی‌عددی نباشد، بررسی " +"می‌کند." -msgid "Checks for ASCII white-space characters; space, line feed, carriage return, form feed, horizontal tab, vertical tab." +msgid "" +"Checks for ASCII white-space characters; space, line feed, carriage return, " +"form feed, horizontal tab, vertical tab." msgstr "" +"بررسی نویسه‌های فضای سفید ASCII؛ فاصله، تغذیه‌ی سطر، بازگشت به ابتدای سطر، تغذیه‌ی " +"تغذیه‌ی صفحه، تب افقی، تب عمودی." msgid "Checks for an ASCII uppercase letter." -msgstr "" +msgstr "بررسی می‌کند که آیا یک نویسه بزرگ ASCII است." -msgid "Checks for an ASCII hexadecimal digit. This is equivalent to ``c in string.hexdigits``." +msgid "" +"Checks for an ASCII hexadecimal digit. This is equivalent to ``c in " +"string.hexdigits``." msgstr "" +"بررسی می‌کند که آیا یک رقم مبنای شانزده ASCII است یا خیر. این معادل ``c in " +"string.hexdigits`` است." -msgid "Checks for an ASCII control character (ordinal values 0 to 31). Unlike :func:`iscntrl`, this does not include the delete character (0x7f)." +msgid "" +"Checks for an ASCII control character (ordinal values 0 to 31). Unlike " +":func:`iscntrl`, this does not include the delete character (0x7f)." msgstr "" +"بررسی می‌کند که آیا یک نویسه‌ی کنترلی ASCII است (مقادیر ترتیبی ۰ تا ۳۱). " +"برخلاف :func:`iscntrl`، نویسه‌ی حذف (0x7f) را شامل نمی‌شود." msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." msgstr "" +"بررسی می‌کند که آیا نویسه‌ای غیرASCII است (مقادیر ترتیبی 0x80 و بالاتر)." -msgid "These functions accept either integers or single-character strings; when the argument is a string, it is first converted using the built-in function :func:`ord`." +msgid "" +"These functions accept either integers or single-character strings; when the" +" argument is a string, it is first converted using the built-in function " +":func:`ord`." msgstr "" +"این توابع، اعداد صحیح یا رشته‌های تک‌نویسه‌ای را می‌پذیرند؛ هنگامی که " +"آرگومان یک رشته باشد، ابتدا با استفاده از تابع توکار :func:`ord` تبدیل " +"می‌شود." -msgid "Note that all these functions check ordinal bit values derived from the character of the string you pass in; they do not actually know anything about the host machine's character encoding." +msgid "" +"Note that all these functions check ordinal bit values derived from the " +"character of the string you pass in; they do not actually know anything " +"about the host machine's character encoding." msgstr "" +"توجه داشته باشید که همه‌ی این توابع مقادیر بیتیِ ترتیبیِ برگرفته از نویسه‌ی " +"رشته‌ای که شما به آن‌ها می‌دهید را بررسی می‌کنند؛ آن‌ها در واقع چیزی درباره‌ی" +" کدگذاری نویسه‌های ماشین میزبان نمی‌دانند." -msgid "The following two functions take either a single-character string or integer byte value; they return a value of the same type." +msgid "" +"The following two functions take either a single-character string or integer" +" byte value; they return a value of the same type." msgstr "" +"دو تابع زیر، یا یک رشته‌ی تک‌نویسه‌ای یا یک مقدار بایت از نوع عدد صحیح را " +"می‌پذیرند؛ آن‌ها مقداری از همان نوع برمی‌گردانند." msgid "Return the ASCII value corresponding to the low 7 bits of *c*." -msgstr "" +msgstr "مقدار ASCII متناظر با ۷ بیت پایینی *c* را برمی‌گرداند." -msgid "Return the control character corresponding to the given character (the character bit value is bitwise-anded with 0x1f)." +msgid "" +"Return the control character corresponding to the given character (the " +"character bit value is bitwise-anded with 0x1f)." msgstr "" +"نویسه کنترلی متناظر با نویسه داده‌شده را برمی‌گرداند (مقدار بیتی نویسه با " +"0x1f به‌صورت بیتی AND می‌شود)." -msgid "Return the 8-bit character corresponding to the given ASCII character (the character bit value is bitwise-ored with 0x80)." +msgid "" +"Return the 8-bit character corresponding to the given ASCII character (the " +"character bit value is bitwise-ored with 0x80)." msgstr "" +"نویسه‌ی ۸‌بیتی متناظر با نویسه‌ی ASCII داده‌شده را برمی‌گرداند (مقدار بیتی " +"نویسه با 0x80 OR بیتی می‌شود)." -msgid "The following function takes either a single-character string or integer value; it returns a string." +msgid "" +"The following function takes either a single-character string or integer " +"value; it returns a string." msgstr "" +"تابع زیر یا یک رشته‌ی تک‌نویسه‌ای یا یک مقدار عدد صحیح را دریافت می‌کند و یک" +" رشته را برمی‌گرداند." -msgid "Return a string representation of the ASCII character *c*. If *c* is printable, this string is the character itself. If the character is a control character (0x00--0x1f) the string consists of a caret (``'^'``) followed by the corresponding uppercase letter. If the character is an ASCII delete (0x7f) the string is ``'^?'``. If the character has its meta bit (0x80) set, the meta bit is stripped, the preceding rules applied, and ``'!'`` prepended to the result." -msgstr "" +msgid "" +"Return a string representation of the ASCII character *c*. If *c* is " +"printable, this string is the character itself. If the character is a " +"control character (0x00--0x1f) the string consists of a caret (``'^'``) " +"followed by the corresponding uppercase letter. If the character is an ASCII" +" delete (0x7f) the string is ``'^?'``. If the character has its meta bit " +"(0x80) set, the meta bit is stripped, the preceding rules applied, and " +"``'!'`` prepended to the result." +msgstr "" +"بازنمایی رشته‌ای از نویسه‌ی ASCII *c* را برمی‌گرداند. اگر *c* قابل چاپ باشد، " +"این رشته خود نویسه است. اگر نویسه یک نویسه‌ی کنترلی (0x00--0x1f) باشد، رشته " +"شامل یک نشانک (``'^'``) است که پس از آن حرف بزرگ متناظر قرار می‌گیرد. اگر " +"نویسه یک نویسه‌ی حذف ASCII (0x7f) باشد، رشته ``'^?'`` است. اگر بیت متا (0x80)" +" نویسه فعال باشد، بیت متا حذف می‌شود، قوانین پیشین اعمال می‌شوند، و ``'!'`` " +"به ابتدای نتیجه اضافه می‌شود." -msgid "A 33-element string array that contains the ASCII mnemonics for the thirty-two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the mnemonic ``SP`` for the space character." +msgid "" +"A 33-element string array that contains the ASCII mnemonics for the thirty-" +"two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " +"mnemonic ``SP`` for the space character." msgstr "" +"یک آرایه‌ی ۳۳ عنصری از رشته‌ها که شامل نام‌های اختصاری ASCII برای سی‌ودو " +"نویسه‌ی کنترلی ASCII از 0 (NUL) تا 0x1f (US)، به‌ترتیب، به‌همراه نام اختصاری" +" ``SP`` برای نویسه‌ی فاصله است." msgid "^ (caret)" -msgstr "" +msgstr "^ (کلاهک)" msgid "in curses module" -msgstr "" +msgstr "در ماژول curses" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" diff --git a/library/curses.panel.po b/library/curses.panel.po index 794273592..0bd4483c9 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -24,76 +24,123 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!curses.panel` --- A panel stack extension for curses" -msgstr "" +msgstr ":mod:`!curses.panel` --- یک افزونه‌ی پشته‌ی پنل برای curses" -msgid "Panels are windows with the added feature of depth, so they can be stacked on top of each other, and only the visible portions of each window will be displayed. Panels can be added, moved up or down in the stack, and removed." +msgid "" +"Panels are windows with the added feature of depth, so they can be stacked " +"on top of each other, and only the visible portions of each window will be " +"displayed. Panels can be added, moved up or down in the stack, and removed." msgstr "" +"پنل‌ها پنجره‌هایی هستند که ویژگی عمق به آن‌ها افزوده شده است، بنابراین " +"می‌توان آن‌ها را روی هم چید و تنها بخش‌های نمایان هر پنجره نمایش داده خواهند" +" شد. می‌توان پنل‌ها را اضافه کرد، در پشته به بالا یا پایین جابه‌جا کرد و حذف" +" کرد." msgid "Functions" -msgstr "" +msgstr "توابع" msgid "The module :mod:`!curses.panel` defines the following exception:" -msgstr "" +msgstr "ماژول :mod:`!curses.panel` استثنای زیر را تعریف می‌کند:" -msgid "Exception raised when a curses panel library function returns an error." +msgid "" +"Exception raised when a curses panel library function returns an error." msgstr "" +"استثنایی که هنگام بازگشت خطا از یک تابع کتابخانه‌ی curses panel پرتاب " +"می‌شود." msgid "The module :mod:`!curses.panel` defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!curses.panel` تابع‌های زیر را تعریف می‌کند:" msgid "Returns the bottom panel in the panel stack." -msgstr "" +msgstr "پایین‌ترین پنل را در پشته‌ی پنل‌ها برمی‌گرداند." -msgid "Returns a panel object, associating it with the given window *win* and placing the new panel on top of the panel stack. Be aware that you need to keep the returned panel object referenced explicitly. If you don't, the panel object is garbage collected and removed from the panel stack." +msgid "" +"Returns a panel object, associating it with the given window *win* and " +"placing the new panel on top of the panel stack. Be aware that you need to " +"keep the returned panel object referenced explicitly. If you don't, the " +"panel object is garbage collected and removed from the panel stack." msgstr "" +"یک شیء پنل برمی‌گرداند، آن را با پنجره داده‌شده *win* مرتبط می‌کند و پنل " +"جدید را در بالای پشته پنل‌ها قرار می‌دهد. توجه داشته باشید که باید به‌صورت " +"صریح ارجاع به شیء پنل برگردانده‌شده را نگه دارید. در غیر این صورت، شیء پنل " +"زباله‌روبی می‌شود و از پشته پنل‌ها حذف می‌شود." msgid "Returns the top panel in the panel stack." -msgstr "" +msgstr "بالاترین پنل در پشته‌ی پنل‌ها را برمی‌گرداند." -msgid "Updates the virtual screen after changes in the panel stack. This does not call :func:`curses.doupdate`, so you'll have to do this yourself." +msgid "" +"Updates the virtual screen after changes in the panel stack. This does not " +"call :func:`curses.doupdate`, so you'll have to do this yourself." msgstr "" +"صفحه مجازی را پس از تغییرات در پشته پنل‌ها به‌روزرسانی می‌کند. این تابع " +":func:`curses.doupdate` را فراخوانی نمی‌کند، بنابراین باید خودتان این کار را" +" انجام دهید." msgid "Panel objects" -msgstr "" +msgstr "اشیای پنل" -msgid "Panel objects, as returned by :func:`new_panel` above, are windows with a stacking order. There's always a window associated with a panel which determines the content, while the panel methods are responsible for the window's depth in the panel stack." +msgid "" +"Panel objects, as returned by :func:`new_panel` above, are windows with a " +"stacking order. There's always a window associated with a panel which " +"determines the content, while the panel methods are responsible for the " +"window's depth in the panel stack." msgstr "" +"اشیای پنل، همان‌طور که در بالا توسط :func:`new_panel` برگردانده می‌شوند، " +"پنجره‌هایی با ترتیب پشته‌بندی هستند. همیشه پنجره‌ای مرتبط با یک پنل وجود " +"دارد که محتوا را تعیین می‌کند، در حالی که متدهای پنل مسئول عمق پنجره در " +"پشته‌ی پنل‌ها هستند." msgid "Panel objects have the following methods:" -msgstr "" +msgstr "اشیای Panel متدهای زیر را دارند:" msgid "Returns the panel above the current panel." -msgstr "" +msgstr "پنل بالای پنل جاری را برمی‌گرداند." msgid "Returns the panel below the current panel." -msgstr "" +msgstr "پنل زیر پنل فعلی را برمی‌گرداند." msgid "Push the panel to the bottom of the stack." -msgstr "" +msgstr "پنل را به پایین پشته منتقل کنید." -msgid "Returns ``True`` if the panel is hidden (not visible), ``False`` otherwise." +msgid "" +"Returns ``True`` if the panel is hidden (not visible), ``False`` otherwise." msgstr "" +"اگر پنل پنهان باشد (قابل مشاهده نباشد)، ``True`` و در غیر این صورت ``False``" +" را برمی‌گرداند." -msgid "Hide the panel. This does not delete the object, it just makes the window on screen invisible." +msgid "" +"Hide the panel. This does not delete the object, it just makes the window on" +" screen invisible." msgstr "" +"پنل را پنهان می‌کند. این کار شیء را حذف نمی‌کند، فقط پنجره‌ی روی صفحه را " +"نامرئی می‌کند." msgid "Move the panel to the screen coordinates ``(y, x)``." -msgstr "" +msgstr "پنل را به مختصات صفحه ``(y, x)`` منتقل کنید." msgid "Change the window associated with the panel to the window *win*." -msgstr "" +msgstr "پنجره‌ی مرتبط با پنل را به پنجره‌ی *win* تغییر دهید." -msgid "Set the panel's user pointer to *obj*. This is used to associate an arbitrary piece of data with the panel, and can be any Python object." +msgid "" +"Set the panel's user pointer to *obj*. This is used to associate an " +"arbitrary piece of data with the panel, and can be any Python object." msgstr "" +"اشاره‌گر کاربر پنل را روی *obj* تنظیم کنید. این برای مرتبط کردن یک قطعه داده" +" دلخواه با پنل استفاده می‌شود و می‌تواند هر شیء پایتون باشد." -msgid "Display the panel (which might have been hidden), placing it on top of the panel stack." +msgid "" +"Display the panel (which might have been hidden), placing it on top of the " +"panel stack." msgstr "" +"پنل را نمایش دهید (که ممکن است پنهان شده باشد) و آن را در بالای پشته‌ی پنل " +"قرار دهید." msgid "Push panel to the top of the stack." -msgstr "" +msgstr "پنل را به بالای پشته منتقل کنید." -msgid "Returns the user pointer for the panel. This might be any Python object." -msgstr "" +msgid "" +"Returns the user pointer for the panel. This might be any Python object." +msgstr "اشاره‌گر کاربرِ پنل را برمی‌گرداند. این ممکن است هر شیء پایتونی باشد." msgid "Returns the window object associated with the panel." -msgstr "" +msgstr "شیء پنجره‌ی مرتبط با پنل را برمی‌گرداند." diff --git a/library/curses.po b/library/curses.po index bf434aae2..b9e190894 100644 --- a/library/curses.po +++ b/library/curses.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"PO-Revision-Date: 2026-08-28 11:25+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -24,1512 +24,2815 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!curses` --- Terminal handling for character-cell displays" msgstr "" +":mod:`!curses` --- مدیریت پایانه برای نمایشگرهای سلول‌نویسه‌ای (character-cell " +"displays)" msgid "**Source code:** :source:`Lib/curses`" -msgstr "" +msgstr ":source:`Lib/curses`" -msgid "The :mod:`!curses` module provides an interface to the curses library, the de-facto standard for portable advanced terminal handling." +msgid "" +"The :mod:`!curses` module provides an interface to the curses library, the de-" +"facto standard for portable advanced terminal handling." msgstr "" +"ماژول :mod:`!curses` رابطی به کتابخانه curses فراهم می‌کند؛ استاندارد دوفاکتو " +"برای مدیریت پیشرفته‌ی پایانه به‌صورت قابل‌حمل." -msgid "While curses is most widely used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well. This extension module is designed to match the API of ncurses, an open-source curses library hosted on Linux and the BSD variants of Unix." +msgid "" +"While curses is most widely used in the Unix environment, versions are " +"available for Windows, DOS, and possibly other systems as well. This " +"extension module is designed to match the API of ncurses, an open-source " +"curses library hosted on Linux and the BSD variants of Unix." msgstr "" +"اگرچه curses بیشترین کاربرد را در محیط یونیکس دارد، نسخه‌هایی برای ویندوز، DOS " +"و احتمالاً سیستم‌های دیگر نیز در دسترس هستند. این ماژول توسعه به‌گونه‌ای طراحی شده " +"است که با API کتابخانه ncurses مطابقت داشته باشد؛ ncurses یک کتابخانه curses " +"متن‌باز است که روی لینوکس و نسخه‌های BSD یونیکس میزبانی می‌شود." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgid "" +"This module is not supported on :ref:`mobile platforms ` " +"or :ref:`WebAssembly platforms `." msgstr "" +"این ماژول در :ref:`سکوهای موبایل ` یا :ref:`سکوهای " +"WebAssembly ` پشتیبانی نمی‌شود." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-module-" +"requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر در نسخه CPython شما " +"موجود نیست، به مستندات توزیع‌کننده خود (یعنی هر کسی که پایتون را در اختیار شما " +"قرار داده است) مراجعه کنید. اگر شما توزیع‌کننده هستید، :ref:`optional-module-" +"requirements` را ببینید." -msgid "Whenever the documentation mentions a *character* it can be specified as an integer, a one-character Unicode string or a one-byte byte string." +msgid "" +"Whenever the documentation mentions a *character* it can be specified as an " +"integer, a one-character Unicode string or a one-byte byte string." msgstr "" +"هر جا که مستندات به یک *نویسه* اشاره می‌کند، می‌توان آن را به‌صورت یک عدد صحیح، " +"یک رشته یونیکد تک‌نویسه‌ای یا یک رشته بایتی تک‌بایتی مشخص کرد." -msgid "Whenever the documentation mentions a *character string* it can be specified as a Unicode string or a byte string." +msgid "" +"Whenever the documentation mentions a *character string* it can be specified " +"as a Unicode string or a byte string." msgstr "" +"هرگاه در مستندات به یک *رشته‌ی نویسه‌ای* اشاره شود، می‌توان آن را به‌صورت یک رشته‌ی " +"یونیکد یا یک رشته‌ی بایت مشخص کرد." msgid "Module :mod:`curses.ascii`" -msgstr "" +msgstr "ماژول :mod:`curses.ascii`" -msgid "Utilities for working with ASCII characters, regardless of your locale settings." +msgid "" +"Utilities for working with ASCII characters, regardless of your locale " +"settings." msgstr "" +"ابزارهایی برای کار با نویسه‌های ASCII، صرف‌نظر از تنظیمات locale (locale) شما." msgid "Module :mod:`curses.panel`" -msgstr "" +msgstr "ماژول :mod:`curses.panel`" msgid "A panel stack extension that adds depth to curses windows." -msgstr "" +msgstr "یک افزونه‌ی پشته‌ی پنل که به پنجره‌های curses عمق می‌بخشد." msgid "Module :mod:`curses.textpad`" -msgstr "" +msgstr "ماژول :mod:`curses.textpad`" -msgid "Editable text widget for curses supporting :program:`Emacs`\\ -like bindings." +msgid "" +"Editable text widget for curses supporting :program:`Emacs`\\ -like bindings." msgstr "" +"ابزارک متنی قابل‌ویرایش برای curses با پشتیبانی از اتصال‌های " +"مشابه :program:`Emacs`." msgid ":ref:`curses-howto`" -msgstr "" +msgstr ":ref:`curses-howto`" -msgid "Tutorial material on using curses with Python, by Andrew Kuchling and Eric Raymond." +msgid "" +"Tutorial material on using curses with Python, by Andrew Kuchling and Eric " +"Raymond." msgstr "" +"مطلب آموزشی درباره‌ی استفاده از curses در پایتون، نوشته‌ی Andrew Kuchling و Eric " +"Raymond." msgid "Functions" -msgstr "" +msgstr "توابع" msgid "The module :mod:`!curses` defines the following exception:" -msgstr "" +msgstr "ماژول :mod:`!curses` استثنای زیر را تعریف می‌کند:" msgid "Exception raised when a curses library function returns an error." msgstr "" +"استثنایی که هنگام برگرداندن خطا توسط تابعی از کتابخانه curses پرتاب می‌شود." -msgid "Whenever *x* or *y* arguments to a function or a method are optional, they default to the current cursor location. Whenever *attr* is optional, it defaults to :const:`A_NORMAL`." +msgid "" +"Whenever *x* or *y* arguments to a function or a method are optional, they " +"default to the current cursor location. Whenever *attr* is optional, it " +"defaults to :const:`A_NORMAL`." msgstr "" +"هرگاه آرگومان‌های *x* یا *y* برای یک تابع یا متد اختیاری باشند، مقدار پیش‌فرض " +"آن‌ها موقعیت فعلی مکان‌نما خواهد بود. هرگاه *attr* اختیاری باشد، مقدار پیش‌فرض " +"آن :const:`A_NORMAL` خواهد بود." msgid "The module :mod:`!curses` defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!curses` توابع زیر را تعریف می‌کند:" -msgid "Allow use of default values for colors on terminals supporting this feature. Use this to support transparency in your application." +msgid "" +"Allow use of default values for colors on terminals supporting this feature. " +"Use this to support transparency in your application." msgstr "" +"اجازه استفاده از مقادیر پیش‌فرض برای رنگ‌ها در پایانه‌هایی که این قابلیت را " +"پشتیبانی می‌کنند. از این برای پشتیبانی از شفافیت در برنامه‌تان استفاده کنید." -msgid "Assign terminal default foreground/background colors to color number ``-1``. So ``init_pair(x, COLOR_RED, -1)`` will initialize pair *x* as red on default background and ``init_pair(x, -1, COLOR_BLUE)`` will initialize pair *x* as default foreground on blue." +msgid "" +"Assign terminal default foreground/background colors to color number ``-1``. " +"So ``init_pair(x, COLOR_RED, -1)`` will initialize pair *x* as red on default " +"background and ``init_pair(x, -1, COLOR_BLUE)`` will initialize pair *x* as " +"default foreground on blue." msgstr "" +"رنگ‌های پیش‌فرض پیش‌زمینه/پس‌زمینه پایانه را به شماره‌ی رنگ ``-1`` اختصاص می‌دهد. " +"بنابراین ``init_pair(x, COLOR_RED, -1)`` جفت *x* را به‌صورت قرمز روی پس‌زمینه " +"پیش‌فرض مقداردهی اولیه می‌کند و ``init_pair(x, -1, COLOR_BLUE)`` جفت *x* را " +"به‌صورت پیش‌زمینه پیش‌فرض روی پس‌زمینه آبی مقداردهی اولیه می‌کند." msgid "Change the definition of the color-pair ``0`` to ``(fg, bg)``." -msgstr "" +msgstr "تعریف جفت‌رنگ ``0`` را به ``(fg, bg)`` تغییر دهید." msgid "This is an ncurses extension." -msgstr "" +msgstr "این یک افزونه برای ncurses است." -msgid "Return the output speed of the terminal in bits per second. On software terminal emulators it will have a fixed high value. Included for historical reasons; in former times, it was used to write output loops for time delays and occasionally to change interfaces depending on the line speed." +msgid "" +"Return the output speed of the terminal in bits per second. On software " +"terminal emulators it will have a fixed high value. Included for historical " +"reasons; in former times, it was used to write output loops for time delays " +"and occasionally to change interfaces depending on the line speed." msgstr "" +"سرعت خروجی پایانه را بر حسب بیت بر ثانیه برمی‌گرداند. در شبیه‌سازهای نرم‌افزاری " +"پایانه، این سرعت مقدار ثابت بالایی خواهد داشت. به دلایل تاریخی گنجانده شده " +"است؛ در گذشته، برای نوشتن حلقه‌های خروجی جهت تأخیرهای زمانی و گاهی برای تغییر " +"رابط‌ها بسته به سرعت خط استفاده می‌شد." msgid "Emit a short attention sound." -msgstr "" +msgstr "یک صدای کوتاه برای جلب توجه پخش می‌کند." -msgid "Return ``True`` or ``False``, depending on whether the programmer can change the colors displayed by the terminal." +msgid "" +"Return ``True`` or ``False``, depending on whether the programmer can change " +"the colors displayed by the terminal." msgstr "" +"برگرداندن ``True`` یا ``False``، بسته به اینکه برنامه‌نویس بتواند رنگ‌هایی را که " +"پایانه نمایش می‌دهد تغییر دهد." -msgid "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal tty line buffering is turned off and characters are available to be read one by one. However, unlike raw mode, special characters (interrupt, quit, suspend, and flow control) retain their effects on the tty driver and calling program. Calling first :func:`raw` then :func:`cbreak` leaves the terminal in cbreak mode." -msgstr "" +msgid "" +"Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal tty " +"line buffering is turned off and characters are available to be read one by " +"one. However, unlike raw mode, special characters (interrupt, quit, suspend, " +"and flow control) retain their effects on the tty driver and calling program. " +"Calling first :func:`raw` then :func:`cbreak` leaves the terminal in cbreak " +"mode." +msgstr "" +"وارد حالت cbreak می‌شود. در حالت cbreak (که گاهی به آن حالت «rare» می‌گویند) " +"بافرینگ خطی معمول tty غیرفعال می‌شود و نویسه‌ها برای خوانده‌شدن به‌صورت یکی‌یکی در " +"دسترس قرار می‌گیرند. با این حال، برخلاف حالت raw، نویسه‌های ویژه (وقفه، خروج، " +"تعلیق و کنترل جریان) اثرات خود را بر راه‌انداز tty و برنامه فراخوان حفظ می‌کنند. " +"اگر ابتدا :func:`raw` و سپس :func:`cbreak` فراخوانی شود، پایانه در حالت cbreak " +"باقی می‌ماند." -msgid "Return the intensity of the red, green, and blue (RGB) components in the color *color_number*, which must be between ``0`` and ``COLORS - 1``. Return a 3-tuple, containing the R,G,B values for the given color, which will be between ``0`` (no component) and ``1000`` (maximum amount of component). Raise an exception if the color is not supported." -msgstr "" +msgid "" +"Return the intensity of the red, green, and blue (RGB) components in the color " +"*color_number*, which must be between ``0`` and ``COLORS - 1``. Return a 3-" +"tuple, containing the R,G,B values for the given color, which will be between " +"``0`` (no component) and ``1000`` (maximum amount of component). Raise an " +"exception if the color is not supported." +msgstr "" +"شدت کامپوننت‌های قرمز، سبز و آبی (RGB) در رنگ *color_number* را برمی‌گرداند. " +"*color_number* باید بین ``0`` و ``COLORS - 1`` باشد. یک تاپل سه‌تایی شامل " +"مقادیر R، G، B برای رنگ داده‌شده برمی‌گرداند؛ این مقادیر بین ``0`` (بدون " +"کامپوننت) و ``1000`` (حداکثر مقدار کامپوننت) خواهند بود. اگر رنگ پشتیبانی " +"نشود، یک استثنا پرتاب می‌کند." -msgid "Return the attribute value for displaying text in the specified color pair. Only the first 256 color pairs are supported. This attribute value can be combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:`!A_\\*` attributes. :func:`pair_number` is the counterpart to this function." +msgid "" +"Return the attribute value for displaying text in the specified color pair. " +"Only the first 256 color pairs are supported. This attribute value can be " +"combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:`!" +"A_\\*` attributes. :func:`pair_number` is the counterpart to this function." msgstr "" +"مقدار ویژگی را برای نمایش متن در جفت رنگ مشخص‌شده برمی‌گرداند. تنها از نخستین " +"۲۵۶ جفت رنگ پشتیبانی می‌شود. این مقدار ویژگی را می‌توان " +"با :const:`A_STANDOUT`، :const:`A_REVERSE` و سایر ویژگی‌های :const:`!A_\\*` " +"ترکیب کرد. :func:`pair_number` متقابل این تابع است." -msgid "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, for invisible, normal, or very visible. If the terminal supports the visibility requested, return the previous cursor state; otherwise raise an exception. On many terminals, the \"visible\" mode is an underline cursor and the \"very visible\" mode is a block cursor." -msgstr "" +msgid "" +"Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, for " +"invisible, normal, or very visible. If the terminal supports the visibility " +"requested, return the previous cursor state; otherwise raise an exception. On " +"many terminals, the \"visible\" mode is an underline cursor and the \"very " +"visible\" mode is a block cursor." +msgstr "" +"وضعیت مکان‌نما را تنظیم می‌کند. می‌توان *visibility* را روی ``0``، ``1``، یا " +"``2`` برای حالت‌های نامرئی، عادی، یا بسیار نمایان تنظیم کرد. اگر پایانه از حالت " +"نمایش درخواستی پشتیبانی کند، وضعیت قبلی مکان‌نما را برمی‌گرداند؛ در غیر این صورت " +"استثنایی پرتاب می‌کند. در بسیاری از پایانه‌ها، حالت «نمایان» یک مکان‌نمای خط زیر " +"و حالت «بسیار نمایان» یک مکان‌نمای بلوکی است." -msgid "Save the current terminal mode as the \"program\" mode, the mode when the running program is using curses. (Its counterpart is the \"shell\" mode, for when the program is not in curses.) Subsequent calls to :func:`reset_prog_mode` will restore this mode." +msgid "" +"Save the current terminal mode as the \"program\" mode, the mode when the " +"running program is using curses. (Its counterpart is the \"shell\" mode, for " +"when the program is not in curses.) Subsequent calls " +"to :func:`reset_prog_mode` will restore this mode." msgstr "" +"حالت فعلی پایانه را به‌عنوان حالت «برنامه» ذخیره می‌کند، حالتی که برنامه‌ی در حال " +"اجرا از curses استفاده می‌کند. (همتای آن حالت «پوسته» است، برای زمانی که برنامه " +"در curses نیست.) فراخوانی‌های بعدی :func:`reset_prog_mode` این حالت را " +"بازمی‌گردانند." -msgid "Save the current terminal mode as the \"shell\" mode, the mode when the running program is not using curses. (Its counterpart is the \"program\" mode, when the program is using curses capabilities.) Subsequent calls to :func:`reset_shell_mode` will restore this mode." +msgid "" +"Save the current terminal mode as the \"shell\" mode, the mode when the " +"running program is not using curses. (Its counterpart is the \"program\" " +"mode, when the program is using curses capabilities.) Subsequent calls " +"to :func:`reset_shell_mode` will restore this mode." msgstr "" +"حالت جاری پایانه را به‌عنوان حالت «پوسته» ذخیره می‌کند، حالتی که برنامه‌ی در حال " +"اجرا از curses استفاده نمی‌کند. (حالت متناظر آن، حالت «برنامه» است، زمانی که " +"برنامه از قابلیت‌های curses استفاده می‌کند.) فراخوانی‌های " +"بعدی :func:`reset_shell_mode` این حالت را بازگردانی می‌کند." msgid "Insert an *ms* millisecond pause in output." -msgstr "" +msgstr "یک مکث *ms* میلی‌ثانیه‌ای در خروجی درج کنید." -msgid "Update the physical screen. The curses library keeps two data structures, one representing the current physical screen contents and a virtual screen representing the desired next state. The :func:`doupdate` function updates the physical screen to match the virtual screen." +msgid "" +"Update the physical screen. The curses library keeps two data structures, one " +"representing the current physical screen contents and a virtual screen " +"representing the desired next state. The :func:`doupdate` function updates " +"the physical screen to match the virtual screen." msgstr "" +"صفحه فیزیکی را به‌روزرسانی می‌کند. کتابخانه‌ی curses دو ساختار داده را نگه می‌دارد: " +"یکی نشان‌دهنده‌ی محتویات فعلی صفحه فیزیکی و دیگری یک صفحه مجازی است که وضعیت بعدی " +"مورد نظر را نشان می‌دهد. تابع :func:`doupdate` صفحه فیزیکی را به‌روزرسانی می‌کند " +"تا با صفحه مجازی مطابقت داشته باشد." -msgid "The virtual screen may be updated by a :meth:`~window.noutrefresh` call after write operations such as :meth:`~window.addstr` have been performed on a window. The normal :meth:`~window.refresh` call is simply :meth:`!noutrefresh` followed by :func:`!doupdate`; if you have to update multiple windows, you can speed performance and perhaps reduce screen flicker by issuing :meth:`!noutrefresh` calls on all windows, followed by a single :func:`!doupdate`." -msgstr "" +msgid "" +"The virtual screen may be updated by a :meth:`~window.noutrefresh` call after " +"write operations such as :meth:`~window.addstr` have been performed on a " +"window. The normal :meth:`~window.refresh` call is simply :meth:`!" +"noutrefresh` followed by :func:`!doupdate`; if you have to update multiple " +"windows, you can speed performance and perhaps reduce screen flicker by " +"issuing :meth:`!noutrefresh` calls on all windows, followed by a " +"single :func:`!doupdate`." +msgstr "" +"صفحه‌ی مجازی می‌تواند پس از انجام عملیات نوشتن مانند :meth:`~window.addstr` روی " +"یک پنجره، با یک فراخوانی :meth:`~window.noutrefresh` به‌روزرسانی شود. فراخوانی " +"معمول :meth:`~window.refresh` صرفاً :meth:`!noutrefresh` و به‌دنبال آن :func:`!" +"doupdate` است؛ اگر لازم است چندین پنجره را به‌روزرسانی کنید، می‌توانید با انجام " +"فراخوانی‌های :meth:`!noutrefresh` روی تمام پنجره‌ها و به‌دنبال آن‌ها یک :func:`!" +"doupdate`، سرعت عملکرد را افزایش دهید و شاید سوسوی صفحه را کاهش دهید." -msgid "Enter echo mode. In echo mode, each character input is echoed to the screen as it is entered." +msgid "" +"Enter echo mode. In echo mode, each character input is echoed to the screen " +"as it is entered." msgstr "" +"وارد حالت بازتاب (echo mode) شوید. در حالت بازتاب، هر نویسه‌ی ورودی به محض وارد " +"شدن، روی صفحه بازتاب داده می‌شود." msgid "De-initialize the library, and return terminal to normal status." msgstr "" +"کتابخانه را از مقداردهی اولیه خارج می‌کند و ترمینال را به وضعیت عادی " +"بازمی‌گرداند." -msgid "Return the user's current erase character as a one-byte bytes object. Under Unix operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself." +msgid "" +"Return the user's current erase character as a one-byte bytes object. Under " +"Unix operating systems this is a property of the controlling tty of the curses " +"program, and is not set by the curses library itself." msgstr "" +"نویسه حذف فعلی کاربر را به‌عنوان یک شیء bytes یک‌بایتی برمی‌گرداند. در " +"سیستم‌عامل‌های یونیکسی، این یک ویژگی از tty کنترل‌کننده برنامه curses است و توسط " +"خود کتابخانه curses تنظیم نمی‌شود." -msgid "The :func:`.filter` routine, if used, must be called before :func:`initscr` is called. The effect is that, during the initialization, :envvar:`LINES` is set to ``1``; the capabilities ``clear``, ``cup``, ``cud``, ``cud1``, ``cuu1``, ``cuu``, ``vpa`` are disabled; and the ``home`` string is set to the value of ``cr``. The effect is that the cursor is confined to the current line, and so are screen updates. This may be used for enabling character-at-a-time line editing without touching the rest of the screen." -msgstr "" +msgid "" +"The :func:`.filter` routine, if used, must be called before :func:`initscr` is " +"called. The effect is that, during the initialization, :envvar:`LINES` is set " +"to ``1``; the capabilities ``clear``, ``cup``, ``cud``, ``cud1``, ``cuu1``, " +"``cuu``, ``vpa`` are disabled; and the ``home`` string is set to the value of " +"``cr``. The effect is that the cursor is confined to the current line, and so " +"are screen updates. This may be used for enabling character-at-a-time line " +"editing without touching the rest of the screen." +msgstr "" +"روال :func:`.filter`، در صورتی که استفاده شود، باید پیش از " +"فراخوانی :func:`initscr` فراخوانی شود. اثر آن این است که در حین " +"راه‌اندازی، :envvar:`LINES` روی ``1`` تنظیم می‌شود؛ قابلیت‌های ``clear``، " +"``cup``، ``cud``، ``cud1``، ``cuu1``، ``cuu`` و ``vpa`` غیرفعال می‌شوند؛ و " +"رشته‌ی ``home`` به مقدار ``cr`` تنظیم می‌شود. اثر آن این است که نشانگر به خط " +"جاری محدود می‌شود و به‌روزرسانی‌های صفحه نیز به خط جاری محدود هستند. می‌توان از " +"این امکان برای فعال‌سازی ویرایش خط به‌صورت نویسه‌به‌نویسه بدون دست زدن به سایر " +"بخش‌های صفحه استفاده کرد." -msgid "Flash the screen. That is, change it to reverse-video and then change it back in a short interval. Some people prefer such as 'visible bell' to the audible attention signal produced by :func:`beep`." +msgid "" +"Flash the screen. That is, change it to reverse-video and then change it back " +"in a short interval. Some people prefer such as 'visible bell' to the audible " +"attention signal produced by :func:`beep`." msgstr "" +"صفحه را چشمک بزنید. یعنی آن را به حالت ویدیوی معکوس (reverse-video) تغییر دهید " +"و سپس در بازه‌ی کوتاهی آن را به حالت پیشین برگردانید. برخی افراد چنین چیزی را " +"به‌عنوان «زنگ قابل مشاهده (visible bell)» به سیگنال جلب توجه شنیداری تولیدشده " +"توسط :func:`beep` ترجیح می‌دهند." -msgid "Flush all input buffers. This throws away any typeahead that has been typed by the user and has not yet been processed by the program." +msgid "" +"Flush all input buffers. This throws away any typeahead that has been " +"typed by the user and has not yet been processed by the program." msgstr "" +"تمام بافرهای ورودی را تخلیه می‌کند. این کار هرگونه پیش‌تایپ (typeahead) را که " +"کاربر تایپ کرده است و برنامه هنوز آن را پردازش نکرده است، دور می‌ریزد." -msgid "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse event, this method should be called to retrieve the queued mouse event, represented as a 5-tuple ``(id, x, y, z, bstate)``. *id* is an ID value used to distinguish multiple devices, and *x*, *y*, *z* are the event's coordinates. (*z* is currently unused.) *bstate* is an integer value whose bits will be set to indicate the type of event, and will be the bitwise OR of one or more of the following constants, where *n* is the button number from 1 to 5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:`BUTTON_ALT`." -msgstr "" +msgid "" +"After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " +"event, this method should be called to retrieve the queued mouse event, " +"represented as a 5-tuple ``(id, x, y, z, bstate)``. *id* is an ID value used " +"to distinguish multiple devices, and *x*, *y*, *z* are the event's " +"coordinates. (*z* is currently unused.) *bstate* is an integer value whose " +"bits will be set to indicate the type of event, and will be the bitwise OR of " +"one or more of the following constants, where *n* is the button number from 1 " +"to " +"5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:`BUTTON_ALT`." +msgstr "" +"پس از اینکه :meth:`~window.getch` :const:`KEY_MOUSE` را برای اعلام یک رویداد " +"ماوس برگرداند، باید این متد فراخوانی شود تا رویداد ماوس در صف بازیابی شود؛ این " +"رویداد به‌صورت یک ۵-تایی ``(id, x, y, z, bstate)`` نمایش داده می‌شود. *id* یک " +"مقدار شناسه برای تمایز دستگاه‌های متعدد است، و *x*، *y*، *z* مختصات رویداد " +"هستند. (*z* در حال حاضر استفاده نشده است.) *bstate* یک مقدار عدد صحیح است که " +"بیت‌های آن برای نشان دادن نوع رویداد تنظیم خواهند شد و برابر با OR بیتی یک یا " +"چند مورد از ثابت‌های زیر خواهد بود، که در آن *n* شماره‌ی دکمه از ۱ تا ۵ " +"است: :const:`BUTTONn_PRESSED`، :const:`BUTTONn_RELEASED`، :const:`BUTTONn_CLICKED`، :const:`BUTTONn_DOUBLE_CLICKED`، :const:`BUTTONn_TRIPLE_CLICKED`، :const:`BUTTON_SHIFT`، :const:`BUTTON_CTRL`، :const:`BUTTON_ALT`." -msgid "The ``BUTTON5_*`` constants are now exposed if they are provided by the underlying curses library." +msgid "" +"The ``BUTTON5_*`` constants are now exposed if they are provided by the " +"underlying curses library." msgstr "" +"ثابت‌های ``BUTTON5_*`` اکنون در صورتی که توسط کتابخانه curses زیرین ارائه شده " +"باشند، در دسترس قرار می‌گیرند." -msgid "Return the current coordinates of the virtual screen cursor as a tuple ``(y, x)``. If :meth:`leaveok ` is currently ``True``, then return ``(-1, -1)``." +msgid "" +"Return the current coordinates of the virtual screen cursor as a tuple ``(y, " +"x)``. If :meth:`leaveok ` is currently ``True``, then return " +"``(-1, -1)``." msgstr "" +"مختصات فعلی نشانگر صفحه‌ی مجازی را به‌صورت یک تاپل ``(y, x)`` برمی‌گرداند. " +"اگر :meth:`leaveok ` در حال حاضر ``True`` باشد، سپس ``(-1, " +"-1)`` را برمی‌گرداند." -msgid "Read window-related data stored in the file by an earlier :meth:`window.putwin` call. The routine then creates and initializes a new window using that data, returning the new window object. The *file* argument must be a file object opened for reading in binary mode." +msgid "" +"Read window-related data stored in the file by an " +"earlier :meth:`window.putwin` call. The routine then creates and initializes a " +"new window using that data, returning the new window object. The *file* " +"argument must be a file object opened for reading in binary mode." msgstr "" +"داده‌های مرتبط با پنجره را که در فایل توسط یک فراخوانی " +"قبلی :meth:`window.putwin` ذخیره شده‌اند، می‌خواند. سپس این روال با استفاده از " +"آن داده‌ها، پنجره‌ی جدیدی را ایجاد و مقداردهی اولیه می‌کند و شیء پنجره‌ی جدید را " +"برمی‌گرداند. آرگومان *file* باید یک شیء فایل باشد که برای خواندن در حالت دودویی " +"باز شده است." -msgid "Return ``True`` if the terminal can display colors; otherwise, return ``False``." +msgid "" +"Return ``True`` if the terminal can display colors; otherwise, return " +"``False``." msgstr "" +"اگر پایانه بتواند رنگ‌ها را نمایش دهد، ``True`` را برمی‌گرداند؛ در غیر این صورت، " +"``False`` را برمی‌گرداند." -msgid "Return ``True`` if the module supports extended colors; otherwise, return ``False``. Extended color support allows more than 256 color pairs for terminals that support more than 16 colors (for example, xterm-256color)." +msgid "" +"Return ``True`` if the module supports extended colors; otherwise, return " +"``False``. Extended color support allows more than 256 color pairs for " +"terminals that support more than 16 colors (for example, xterm-256color)." msgstr "" +"اگر ماژول از رنگ‌های گسترش‌یافته پشتیبانی کند، ``True`` را برمی‌گرداند؛ در غیر " +"این صورت، ``False`` را برمی‌گرداند. پشتیبانی از رنگ‌های گسترش‌یافته، بیش از ۲۵۶ " +"جفت‌رنگ را برای پایانه‌هایی که از بیش از ۱۶ رنگ پشتیبانی می‌کنند (برای مثال، " +"xterm-256color) امکان‌پذیر می‌سازد." msgid "Extended color support requires ncurses version 6.1 or later." -msgstr "" +msgstr "پشتیبانی رنگی گسترده به ncurses نسخه 6.1 یا جدیدتر نیاز دارد." -msgid "Return ``True`` if the terminal has insert- and delete-character capabilities. This function is included for historical reasons only, as all modern software terminal emulators have such capabilities." +msgid "" +"Return ``True`` if the terminal has insert- and delete-character capabilities. " +"This function is included for historical reasons only, as all modern software " +"terminal emulators have such capabilities." msgstr "" +"اگر پایانه قابلیت‌های درج و حذف نویسه را داشته باشد، ``True`` را برمی‌گرداند. " +"این تابع فقط به دلایل تاریخی گنجانده شده است، زیرا همه نرم‌افزارهای شبیه‌ساز " +"پایانه امروزی چنین قابلیت‌هایی دارند." -msgid "Return ``True`` if the terminal has insert- and delete-line capabilities, or can simulate them using scrolling regions. This function is included for historical reasons only, as all modern software terminal emulators have such capabilities." +msgid "" +"Return ``True`` if the terminal has insert- and delete-line capabilities, or " +"can simulate them using scrolling regions. This function is included for " +"historical reasons only, as all modern software terminal emulators have such " +"capabilities." msgstr "" +"اگر پایانه قابلیت‌های درج و حذف خط را داشته باشد، یا بتواند آن‌ها را با استفاده " +"از ناحیه‌های پیمایش شبیه‌سازی کند، ``True`` را برمی‌گرداند. این تابع فقط به دلایل " +"تاریخی گنجانده شده است، زیرا همه‌ی شبیه‌سازهای پایانه‌ای نرم‌افزاری مدرن چنین " +"قابلیت‌هایی دارند." -msgid "Take a key value *ch*, and return ``True`` if the current terminal type recognizes a key with that value." +msgid "" +"Take a key value *ch*, and return ``True`` if the current terminal type " +"recognizes a key with that value." msgstr "" +"مقدار کلید *ch* را می‌گیرد و اگر نوع پایانه‌ی جاری کلیدی با آن مقدار را بشناسد، " +"``True`` را برمی‌گرداند." -msgid "Used for half-delay mode, which is similar to cbreak mode in that characters typed by the user are immediately available to the program. However, after blocking for *tenths* tenths of seconds, raise an exception if nothing has been typed. The value of *tenths* must be a number between ``1`` and ``255``. Use :func:`nocbreak` to leave half-delay mode." -msgstr "" +msgid "" +"Used for half-delay mode, which is similar to cbreak mode in that characters " +"typed by the user are immediately available to the program. However, after " +"blocking for *tenths* tenths of seconds, raise an exception if nothing has " +"been typed. The value of *tenths* must be a number between ``1`` and " +"``255``. Use :func:`nocbreak` to leave half-delay mode." +msgstr "" +"برای حالت نیمه‌تأخیر (half-delay) استفاده می‌شود؛ این حالت شبیه حالت cbreak است، " +"بدین معنا که نویسه‌های تایپ‌شده توسط کاربر بلافاصله در دسترس برنامه قرار " +"می‌گیرند. با این حال، پس از مسدود شدن به مدت *tenths* دهم ثانیه، اگر چیزی تایپ " +"نشده باشد، یک استثنا پرتاب می‌شود. مقدار *tenths* باید عددی بین ``1`` و ``255`` " +"باشد. برای خروج از حالت نیمه‌تأخیر از :func:`nocbreak` استفاده کنید." -msgid "Change the definition of a color, taking the number of the color to be changed followed by three RGB values (for the amounts of red, green, and blue components). The value of *color_number* must be between ``0`` and ``COLORS - 1``. Each of *r*, *g*, *b*, must be a value between ``0`` and ``1000``. When :func:`init_color` is used, all occurrences of that color on the screen immediately change to the new definition. This function is a no-op on most terminals; it is active only if :func:`can_change_color` returns ``True``." -msgstr "" +msgid "" +"Change the definition of a color, taking the number of the color to be changed " +"followed by three RGB values (for the amounts of red, green, and blue " +"components). The value of *color_number* must be between ``0`` and ``COLORS - " +"1``. Each of *r*, *g*, *b*, must be a value between ``0`` and ``1000``. " +"When :func:`init_color` is used, all occurrences of that color on the screen " +"immediately change to the new definition. This function is a no-op on most " +"terminals; it is active only if :func:`can_change_color` returns ``True``." +msgstr "" +"تعریف یک رنگ را تغییر می‌دهد؛ شماره رنگی که باید تغییر کند و سپس سه مقدار RGB " +"(برای میزان کامپوننت‌های قرمز، سبز و آبی) را دریافت می‌کند. مقدار *color_number* " +"باید بین ``0`` و ``COLORS - 1`` باشد. هر یک از *r*، *g* و *b* باید مقداری بین " +"``0`` و ``1000`` باشد. هنگامی که از :func:`init_color` استفاده شود، تمام موارد " +"آن رنگ روی صفحه بلافاصله به تعریف جدید تغییر می‌کنند. این تابع در بیشتر " +"پایانه‌ها هیچ عملیاتی انجام نمی‌دهد؛ تنها زمانی فعال است " +"که :func:`can_change_color` مقدار ``True`` را برگرداند." -msgid "Change the definition of a color-pair. It takes three arguments: the number of the color-pair to be changed, the foreground color number, and the background color number. The value of *pair_number* must be between ``1`` and ``COLOR_PAIRS - 1`` (the ``0`` color pair can only be changed by :func:`use_default_colors` and :func:`assume_default_colors`). The value of *fg* and *bg* arguments must be between ``0`` and ``COLORS - 1``, or, after calling :func:`!use_default_colors` or :func:`!assume_default_colors`, ``-1``. If the color-pair was previously initialized, the screen is refreshed and all occurrences of that color-pair are changed to the new definition." -msgstr "" +msgid "" +"Change the definition of a color-pair. It takes three arguments: the number " +"of the color-pair to be changed, the foreground color number, and the " +"background color number. The value of *pair_number* must be between ``1`` and " +"``COLOR_PAIRS - 1`` (the ``0`` color pair can only be changed " +"by :func:`use_default_colors` and :func:`assume_default_colors`). The value of " +"*fg* and *bg* arguments must be between ``0`` and ``COLORS - 1``, or, after " +"calling :func:`!use_default_colors` or :func:`!assume_default_colors`, ``-1``. " +"If the color-pair was previously initialized, the screen is refreshed and all " +"occurrences of that color-pair are changed to the new definition." +msgstr "" +"تعریف یک جفت‌رنگ را تغییر می‌دهد. این تابع سه آرگومان دریافت می‌کند: شماره‌ی " +"جفت‌رنگی که باید تغییر کند، شماره‌ی رنگ پیش‌زمینه و شماره‌ی رنگ پس‌زمینه. مقدار " +"*pair_number* باید بین ``1`` و ``COLOR_PAIRS - 1`` باشد (جفت‌رنگ ``0`` فقط " +"با :func:`use_default_colors` و :func:`assume_default_colors` قابل تغییر است). " +"مقدار آرگومان‌های *fg* و *bg* باید بین ``0`` و ``COLORS - 1`` باشد، یا پس از " +"فراخوانی :func:`!use_default_colors` یا :func:`!assume_default_colors`، ``-1`` " +"باشد. اگر جفت‌رنگ پیش‌تر مقداردهی اولیه شده باشد، صفحه تازه‌سازی می‌شود و تمام " +"موارد استفاده از آن جفت‌رنگ به تعریف جدید تغییر می‌کنند." -msgid "Initialize the library. Return a :ref:`window ` object which represents the whole screen." +msgid "" +"Initialize the library. Return a :ref:`window ` object " +"which represents the whole screen." msgstr "" +"کتابخانه را مقداردهی اولیه می‌کند. یک شیء :ref:`پنجره ` " +"را برمی‌گرداند که نمایانگر کل صفحه است." msgid "See :func:`setupterm` for a caveat about calling it before this function." msgstr "" +"برای آگاهی از هشداری درباره‌ی فراخوانی آن پیش از این تابع، :func:`setupterm` را " +"ببینید." -msgid "If there is an error opening the terminal, the underlying curses library may cause the interpreter to exit." +msgid "" +"If there is an error opening the terminal, the underlying curses library may " +"cause the interpreter to exit." msgstr "" +"اگر در باز کردن پایانه خطایی رخ دهد، ممکن است کتابخانه curses زیربنایی باعث " +"خروج مفسر شود." -msgid "If *flag* is ``True``, pressing an interrupt key (interrupt, break, or quit) will flush all output in the terminal driver queue. If *flag* is ``False``, no flushing is done." +msgid "" +"If *flag* is ``True``, pressing an interrupt key (interrupt, break, or quit) " +"will flush all output in the terminal driver queue. If *flag* is ``False``, " +"no flushing is done." msgstr "" +"اگر *flag* برابر ``True`` باشد، فشردن یک کلید وقفه (وقفه، قطع یا خروج) تمام " +"خروجی موجود در صف راه‌انداز پایانه را تخلیه می‌کند. اگر *flag* برابر ``False`` " +"باشد، هیچ تخلیه‌ای انجام نمی‌شود." -msgid "Return ``True`` if :func:`resize_term` would modify the window structure, ``False`` otherwise." +msgid "" +"Return ``True`` if :func:`resize_term` would modify the window structure, " +"``False`` otherwise." msgstr "" +"اگر :func:`resize_term` ساختار پنجره را تغییر دهد، ``True`` و در غیر این صورت " +"``False`` را برمی‌گرداند." -msgid "Return ``True`` if :func:`endwin` has been called (that is, the curses library has been deinitialized)." +msgid "" +"Return ``True`` if :func:`endwin` has been called (that is, the curses " +"library has been deinitialized)." msgstr "" +"اگر :func:`endwin` فراخوانی شده باشد (یعنی کتابخانه curses از مقداردهی اولیه " +"خارج شده باشد)، ``True`` را برمی‌گرداند." -msgid "Return the name of the key numbered *k* as a bytes object. The name of a key generating printable ASCII character is the key's character. The name of a control-key combination is a two-byte bytes object consisting of a caret (``b'^'``) followed by the corresponding printable ASCII character. The name of an alt-key combination (128--255) is a bytes object consisting of the prefix ``b'M-'`` followed by the name of the corresponding ASCII character." -msgstr "" +msgid "" +"Return the name of the key numbered *k* as a bytes object. The name of a key " +"generating printable ASCII character is the key's character. The name of a " +"control-key combination is a two-byte bytes object consisting of a caret " +"(``b'^'``) followed by the corresponding printable ASCII character. The name " +"of an alt-key combination (128--255) is a bytes object consisting of the " +"prefix ``b'M-'`` followed by the name of the corresponding ASCII character." +msgstr "" +"نام کلید با شماره‌ی *k* را به‌عنوان یک شیء bytes برمی‌گرداند. نام کلیدی که یک " +"نویسه‌ی ASCII قابل‌چاپ تولید می‌کند، همان نویسه‌ی کلید است. نام یک ترکیب کلید کنترل، " +"یک شیء bytes دو بایتی است که از یک نویسه‌ی caret (``b'^'``) و به‌دنبال آن نویسه‌ی " +"ASCII قابل‌چاپ متناظر تشکیل شده است. نام یک ترکیب کلید Alt (۱۲۸--۲۵۵) یک شیء " +"bytes است که از پیشوند ``b'M-'`` و به‌دنبال آن نام نویسه‌ی ASCII متناظر تشکیل شده " +"است." msgid "Raise a :exc:`ValueError` if *k* is negative." -msgstr "" +msgstr "اگر *k* منفی باشد، یک :exc:`ValueError` پرتاب می‌کند." -msgid "Return the user's current line kill character as a one-byte bytes object. Under Unix operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself." +msgid "" +"Return the user's current line kill character as a one-byte bytes object. " +"Under Unix operating systems this is a property of the controlling tty of the " +"curses program, and is not set by the curses library itself." msgstr "" +"نویسه حذف خط فعلی کاربر را به‌صورت یک شیء bytes یک‌بایتی برمی‌گرداند. در " +"سیستم‌عامل‌های یونیکسی، این یک ویژگی از tty کنترل‌کننده برنامه curses است و توسط " +"خود کتابخانه curses تنظیم نمی‌شود." -msgid "Return a bytes object containing the terminfo long name field describing the current terminal. The maximum length of a verbose description is 128 characters. It is defined only after the call to :func:`initscr`." +msgid "" +"Return a bytes object containing the terminfo long name field describing the " +"current terminal. The maximum length of a verbose description is 128 " +"characters. It is defined only after the call to :func:`initscr`." msgstr "" +"یک شیء بایتی حاوی فیلد نام بلند terminfo را برمی‌گرداند که پایانه فعلی را توصیف " +"می‌کند. حداکثر طول یک توصیف مفصل ۱۲۸ نویسه است. این فیلد فقط پس از " +"فراخوانی :func:`initscr` تعریف می‌شود." -msgid "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is ``False``, allow only 7-bit chars." +msgid "" +"If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " +"``False``, allow only 7-bit chars." msgstr "" +"اگر *flag* برابر ``True`` باشد، اجازه داده می‌شود که نویسه‌های ۸ بیتی ورودی داده " +"شوند. اگر *flag* برابر ``False`` باشد، فقط اجازه داده می‌شود که نویسه‌های ۷ بیتی " +"ورودی داده شوند." -msgid "Set the maximum time in milliseconds that can elapse between press and release events in order for them to be recognized as a click, and return the previous interval value. The default value is 166 milliseconds, or one sixth of a second. Use a negative *interval* to obtain the interval value without changing it." +msgid "" +"Set the maximum time in milliseconds that can elapse between press and release " +"events in order for them to be recognized as a click, and return the previous " +"interval value. The default value is 166 milliseconds, or one sixth of a " +"second. Use a negative *interval* to obtain the interval value without " +"changing it." msgstr "" +"حداکثر زمان بر حسب میلی‌ثانیه که می‌تواند بین رویدادهای فشردن و رها کردن سپری " +"شود تا آن‌ها به‌عنوان یک کلیک شناخته شوند را تنظیم می‌کند و مقدار فاصله پیشین را " +"برمی‌گرداند. مقدار پیش‌فرض ۱۶۶ میلی‌ثانیه، یا یک‌ششم ثانیه است. برای دریافت مقدار " +"فاصله بدون تغییر آن، از یک *interval* منفی استفاده کنید." -msgid "Set the mouse events to be reported, and return a tuple ``(availmask, oldmask)``. *availmask* indicates which of the specified mouse events can be reported; on complete failure it returns ``0``. *oldmask* is the previous value of the mouse event mask. If this function is never called, no mouse events are ever reported." -msgstr "" +msgid "" +"Set the mouse events to be reported, and return a tuple ``(availmask, " +"oldmask)``. *availmask* indicates which of the specified mouse events can be " +"reported; on complete failure it returns ``0``. *oldmask* is the previous " +"value of the mouse event mask. If this function is never called, no mouse " +"events are ever reported." +msgstr "" +"رویدادهای ماوس را برای گزارش‌شدن تنظیم می‌کند و یک تاپل ``(availmask, oldmask)`` " +"را برمی‌گرداند. *availmask* نشان می‌دهد کدام‌یک از رویدادهای تعیین‌شده ماوس " +"می‌توانند گزارش شوند؛ در صورت شکست کامل، ``0`` برگردانده می‌شود. *oldmask* مقدار " +"قبلی ماسک رویدادهای ماوس است. اگر این تابع هرگز فراخوانی نشود، هیچ رویداد " +"ماوسی گزارش نخواهد شد." msgid "Sleep for *ms* milliseconds." -msgstr "" +msgstr "به مدت *ms* میلی‌ثانیه متوقف میشود." -msgid "Create and return a pointer to a new pad data structure with the given number of lines and columns. Return a pad as a window object." +msgid "" +"Create and return a pointer to a new pad data structure with the given number " +"of lines and columns. Return a pad as a window object." msgstr "" +"یک اشاره‌گر به ساختار داده‌ای جدید پد (pad) با تعداد خطوط و ستون‌های داده‌شده " +"ایجاد کرده و برمی‌گرداند. یک پد را به‌عنوان یک شیء پنجره برمی‌گرداند." -msgid "A pad is like a window, except that it is not restricted by the screen size, and is not necessarily associated with a particular part of the screen. Pads can be used when a large window is needed, and only a part of the window will be on the screen at one time. Automatic refreshes of pads (such as from scrolling or echoing of input) do not occur. The :meth:`~window.refresh` and :meth:`~window.noutrefresh` methods of a pad require 6 arguments to specify the part of the pad to be displayed and the location on the screen to be used for the display. The arguments are *pminrow*, *pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p* arguments refer to the upper-left corner of the pad region to be displayed and the *s* arguments define a clipping box on the screen within which the pad region is to be displayed." -msgstr "" +msgid "" +"A pad is like a window, except that it is not restricted by the screen size, " +"and is not necessarily associated with a particular part of the screen. Pads " +"can be used when a large window is needed, and only a part of the window will " +"be on the screen at one time. Automatic refreshes of pads (such as from " +"scrolling or echoing of input) do not occur. The :meth:`~window.refresh` " +"and :meth:`~window.noutrefresh` methods of a pad require 6 arguments to " +"specify the part of the pad to be displayed and the location on the screen to " +"be used for the display. The arguments are *pminrow*, *pmincol*, *sminrow*, " +"*smincol*, *smaxrow*, *smaxcol*; the *p* arguments refer to the upper-left " +"corner of the pad region to be displayed and the *s* arguments define a " +"clipping box on the screen within which the pad region is to be displayed." +msgstr "" +"یک پد (pad) مانند یک پنجره است، با این تفاوت که به اندازه‌ی صفحه‌نمایش محدود " +"نمی‌شود و لزوماً با بخش خاصی از صفحه‌نمایش مرتبط نیست. هنگامی که به یک پنجره‌ی " +"بزرگ نیاز است و تنها بخشی از پنجره در یک زمان روی صفحه‌نمایش قرار می‌گیرد، " +"می‌توان از پدها استفاده کرد. بازسازی خودکار پدها (مانند ناشی از پیمایش یا " +"بازتاب ورودی) رخ نمی‌دهد. متدهای :meth:`~window.refresh` " +"و :meth:`~window.noutrefresh` یک پد برای مشخص کردن بخشی از پد که باید نمایش " +"داده شود و مکان روی صفحه‌نمایش که برای نمایش استفاده می‌شود، به ۶ آرگومان نیاز " +"دارند. آرگومان‌ها *pminrow*، *pmincol*، *sminrow*، *smincol*، *smaxrow*، " +"*smaxcol* هستند؛ آرگومان‌های *p* به گوشه‌ی بالا-چپ ناحیه‌ی پد که باید نمایش داده " +"شود اشاره دارند و آرگومان‌های *s* یک جعبه‌ی برش (clipping box) روی صفحه‌نمایش " +"تعریف می‌کنند که ناحیه‌ی پد باید درون آن نمایش داده شود." -msgid "Return a new :ref:`window `, whose left-upper corner is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." +msgid "" +"Return a new :ref:`window `, whose left-upper corner is " +"at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" +"یک :ref:`پنجره ` جدید برمی‌گرداند که گوشه‌ی بالا-چپ آن در " +"``(begin_y, begin_x)`` قرار دارد و ارتفاع/عرض آن *nlines*/*ncols* است." -msgid "By default, the window will extend from the specified position to the lower right corner of the screen." +msgid "" +"By default, the window will extend from the specified position to the lower " +"right corner of the screen." msgstr "" +"به‌طور پیش‌فرض، پنجره از موقعیت مشخص‌شده تا گوشه‌ی پایین سمت راست صفحه‌نمایش گسترش " +"خواهد یافت." -msgid "Enter newline mode. This mode translates the return key into newline on input, and translates newline into return and line-feed on output. Newline mode is initially on." +msgid "" +"Enter newline mode. This mode translates the return key into newline on " +"input, and translates newline into return and line-feed on output. Newline " +"mode is initially on." msgstr "" +"ورود به حالت خط جدید (newline). این حالت، کلید بازگشت (Return) را در ورودی به " +"خط جدید تبدیل می‌کند و خط جدید را در خروجی به بازگشت (return) و تغذیه‌ی خط (line-" +"feed) تبدیل می‌کند. حالت خط جدید در ابتدا فعال است." msgid "If *flag* is ``False``, the effect is the same as calling :func:`nonl`." -msgstr "" +msgstr "اگر *flag* برابر ``False`` باشد، اثر آن همان فراخوانی :func:`nonl` است." msgid "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" +"از حالت cbreak خارج شوید. به حالت عادی «cooked» همراه با بافرینگ خطی (line " +"buffering) بازگردید." msgid "Leave echo mode. Echoing of input characters is turned off." -msgstr "" +msgstr "از حالت echo خارج شوید. بازتاب نویسه‌های ورودی خاموش می‌شود." -msgid "Leave newline mode. Disable translation of return into newline on input, and disable low-level translation of newline into newline/return on output (but this does not change the behavior of ``addch('\\n')``, which always does the equivalent of return and line feed on the virtual screen). With translation off, curses can sometimes speed up vertical motion a little; also, it will be able to detect the return key on input." -msgstr "" +msgid "" +"Leave newline mode. Disable translation of return into newline on input, and " +"disable low-level translation of newline into newline/return on output (but " +"this does not change the behavior of ``addch('\\n')``, which always does the " +"equivalent of return and line feed on the virtual screen). With translation " +"off, curses can sometimes speed up vertical motion a little; also, it will be " +"able to detect the return key on input." +msgstr "" +"حالت خط جدید را ترک می‌کند. تبدیل بازگشت به خط جدید در ورودی را غیرفعال می‌کند، " +"و تبدیل سطح پایین خط جدید به خط جدید/بازگشت در خروجی را غیرفعال می‌کند (اما این " +"موضوع رفتار ``addch('\\n')`` را تغییر نمی‌دهد، که همواره معادل بازگشت و پیشروی " +"خط را روی صفحه‌ی مجازی انجام می‌دهد). با غیرفعال بودن تبدیل، curses گاهی می‌تواند " +"کمی سرعت حرکت عمودی را افزایش دهد؛ همچنین، قادر خواهد بود کلید بازگشت را در " +"ورودی تشخیص دهد." -msgid "When the :func:`!noqiflush` routine is used, normal flush of input and output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters will not be done. You may want to call :func:`!noqiflush` in a signal handler if you want output to continue as though the interrupt had not occurred, after the handler exits." -msgstr "" +msgid "" +"When the :func:`!noqiflush` routine is used, normal flush of input and output " +"queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters will not " +"be done. You may want to call :func:`!noqiflush` in a signal handler if you " +"want output to continue as though the interrupt had not occurred, after the " +"handler exits." +msgstr "" +"وقتی از روال :func:`!noqiflush` استفاده می‌شود، تخلیه‌ی عادی صف‌های ورودی و خروجی " +"مرتبط با نویسه‌های ``INTR``، ``QUIT`` و ``SUSP`` انجام نخواهد شد. ممکن است " +"بخواهید :func:`!noqiflush` را در یک هندلر سیگنال فراخوانی کنید، اگر " +"می‌خواهید پس از خروج هندلر، خروجی همان‌طور ادامه یابد که گویی وقفه‌ای رخ " +"نداده است." msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" +"از حالت raw خارج شوید. به حالت عادی «cooked» با بافرینگ خطی (line buffering) " +"بازگردید." -msgid "Return a tuple ``(fg, bg)`` containing the colors for the requested color pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - 1``." +msgid "" +"Return a tuple ``(fg, bg)`` containing the colors for the requested color " +"pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - 1``." msgstr "" +"یک تاپل ``(fg, bg)`` را برمی‌گرداند که شامل رنگ‌های جفت‌رنگ درخواستی است. " +"مقدار *pair_number* باید بین ``0`` و ``COLOR_PAIRS - 1`` باشد." -msgid "Return the number of the color-pair set by the attribute value *attr*. :func:`color_pair` is the counterpart to this function." +msgid "" +"Return the number of the color-pair set by the attribute value " +"*attr*. :func:`color_pair` is the counterpart to this function." msgstr "" +"شماره‌ی جفت‌رنگ تنظیم‌شده با مقدار ویژگی *attr* را برمی‌گرداند. :func:`color_pair` " +"همتای این تابع است." -msgid "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified terminfo capability for the current terminal. Note that the output of :func:`putp` always goes to standard output." +msgid "" +"Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " +"terminfo capability for the current terminal. Note that the output " +"of :func:`putp` always goes to standard output." msgstr "" +"معادل ``tputs(str, 1, putchar)`` است؛ مقدار یک قابلیت terminfo مشخص برای " +"پایانه جاری را منتشر می‌کند. توجه داشته باشید که خروجی :func:`putp` همیشه به " +"خروجی استاندارد می‌رود." msgid ":func:`setupterm` (or :func:`initscr`) must be called first." -msgstr "" +msgstr "ابتدا باید :func:`setupterm` (یا :func:`initscr`) فراخوانی شود." -msgid "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. If *flag* is ``True``, or no argument is provided, the queues will be flushed when these control characters are read." +msgid "" +"If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " +"If *flag* is ``True``, or no argument is provided, the queues will be flushed " +"when these control characters are read." msgstr "" +"اگر *flag* برابر ``False`` باشد، نتیجه همانند فراخوانی :func:`noqiflush` است. " +"اگر *flag* برابر ``True`` باشد، یا آرگومانی ارائه نشود، صف‌ها هنگام خوانده شدن " +"این نویسه‌های کنترلی تخلیه می‌شوند." -msgid "Enter raw mode. In raw mode, normal line buffering and processing of interrupt, quit, suspend, and flow control keys are turned off; characters are presented to curses input functions one by one." +msgid "" +"Enter raw mode. In raw mode, normal line buffering and processing of " +"interrupt, quit, suspend, and flow control keys are turned off; characters are " +"presented to curses input functions one by one." msgstr "" +"وارد حالت خام می‌شود. در حالت خام، بافر کردن خطی عادی و پردازش کلیدهای وقفه، " +"خروج، تعلیق و کنترل جریان غیرفعال می‌شوند؛ نویسه‌ها یک‌به‌یک به توابع ورودی curses " +"ارائه می‌شوند." -msgid "Restore the terminal to \"program\" mode, as previously saved by :func:`def_prog_mode`." +msgid "" +"Restore the terminal to \"program\" mode, as previously saved " +"by :func:`def_prog_mode`." msgstr "" +"ترمینال را به حالت «program» بازمی‌گرداند، همان‌طور که پیش‌تر " +"توسط :func:`def_prog_mode` ذخیره‌شده است." -msgid "Restore the terminal to \"shell\" mode, as previously saved by :func:`def_shell_mode`." +msgid "" +"Restore the terminal to \"shell\" mode, as previously saved " +"by :func:`def_shell_mode`." msgstr "" +"پایانه را به حالت «پوسته» بازمی‌گرداند، همان‌طور که پیش‌تر " +"با :func:`def_shell_mode` ذخیره‌شده است." -msgid "Restore the state of the terminal modes to what it was at the last call to :func:`savetty`." +msgid "" +"Restore the state of the terminal modes to what it was at the last call " +"to :func:`savetty`." msgstr "" +"وضعیت حالت‌های پایانه را به وضعیتی که در آخرین فراخوانی :func:`savetty` داشت، " +"بازگردانید." -msgid "Backend function used by :func:`resizeterm`, performing most of the work; when resizing the windows, :func:`resize_term` blank-fills the areas that are extended. The calling application should fill in these areas with appropriate data. The :func:`!resize_term` function attempts to resize all windows. However, due to the calling convention of pads, it is not possible to resize these without additional interaction with the application." -msgstr "" +msgid "" +"Backend function used by :func:`resizeterm`, performing most of the work; when " +"resizing the windows, :func:`resize_term` blank-fills the areas that are " +"extended. The calling application should fill in these areas with appropriate " +"data. The :func:`!resize_term` function attempts to resize all windows. " +"However, due to the calling convention of pads, it is not possible to resize " +"these without additional interaction with the application." +msgstr "" +"تابع بک‌اند (backend) استفاده‌شده توسط :func:`resizeterm` که بیشتر کار را " +"انجام می‌دهد؛ هنگام تغییر اندازه پنجره‌ها، :func:`resize_term` ناحیه‌هایی را که " +"گسترش می‌یابند با نویسه‌های خالی پر می‌کند. برنامه فراخوان باید این ناحیه‌ها را با " +"داده‌های مناسب پر کند. تابع :func:`!resize_term` تلاش می‌کند اندازه همه پنجره‌ها " +"را تغییر دهد. با این حال، به دلیل قرارداد فراخوانی پدها (pads)، تغییر اندازه " +"آن‌ها بدون تعامل اضافی با برنامه ممکن نیست." -msgid "Resize the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by the curses library that record the window dimensions (in particular the SIGWINCH handler)." +msgid "" +"Resize the standard and current windows to the specified dimensions, and " +"adjusts other bookkeeping data used by the curses library that record the " +"window dimensions (in particular the SIGWINCH handler)." msgstr "" +"اندازه‌ی پنجره‌های استاندارد و جاری را به ابعاد مشخص‌شده تغییر می‌دهد و سایر " +"داده‌های مدیریتی مورد استفاده‌ی کتابخانه‌ی curses را که ابعاد پنجره را ثبت " +"می‌کنند، تنظیم می‌کند (به‌ویژه هندلری SIGWINCH)." -msgid "Save the current state of the terminal modes in a buffer, usable by :func:`resetty`." +msgid "" +"Save the current state of the terminal modes in a buffer, usable " +"by :func:`resetty`." msgstr "" +"وضعیت فعلی حالت‌های پایانه را در یک بافر ذخیره می‌کند که توسط :func:`resetty` " +"قابل استفاده است." msgid "Retrieves the value set by :func:`set_escdelay`." -msgstr "" +msgstr "مقدار تنظیم‌شده توسط :func:`set_escdelay` را بازیابی می‌کند." -msgid "Sets the number of milliseconds to wait after reading an escape character, to distinguish between an individual escape character entered on the keyboard from escape sequences sent by cursor and function keys." +msgid "" +"Sets the number of milliseconds to wait after reading an escape character, to " +"distinguish between an individual escape character entered on the keyboard " +"from escape sequences sent by cursor and function keys." msgstr "" +"تعداد میلی‌ثانیه‌های انتظار پس از خواندن یک نویسه‌ی خنثی‌سازی را تنظیم می‌کند، تا " +"میان یک نویسه‌ی خنثی‌سازی منفرد که از صفحه‌کلید وارد شده است و دنباله‌های خنثی‌سازی " +"ارسال‌شده توسط کلیدهای مکان‌نما و کلیدهای تابعی تمایز قائل شود." msgid "Retrieves the value set by :func:`set_tabsize`." -msgstr "" +msgstr "مقدار تنظیم‌شده توسط :func:`set_tabsize` را بازیابی می‌کند." -msgid "Sets the number of columns used by the curses library when converting a tab character to spaces as it adds the tab to a window." +msgid "" +"Sets the number of columns used by the curses library when converting a tab " +"character to spaces as it adds the tab to a window." msgstr "" +"تعداد ستون‌هایی را که کتابخانه curses هنگام تبدیل یک نویسه tab به فاصله‌ها، در " +"زمان افزودن tab به یک پنجره استفاده می‌کند، تنظیم می‌کند." -msgid "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, then :meth:`leaveok ` is set ``True``." +msgid "" +"Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " +"then :meth:`leaveok ` is set ``True``." msgstr "" +"مکان‌نمای صفحه‌ی مجازی را روی *y*، *x* تنظیم می‌کند. اگر *y* و *x* هر دو ``-1`` " +"باشند، :meth:`leaveok ` روی ``True`` تنظیم می‌شود." -msgid "Initialize the terminal. *term* is a string giving the terminal name, or ``None``; if omitted or ``None``, the value of the :envvar:`TERM` environment variable will be used. *fd* is the file descriptor to which any initialization sequences will be sent; if not supplied or ``-1``, the file descriptor for ``sys.stdout`` will be used." -msgstr "" +msgid "" +"Initialize the terminal. *term* is a string giving the terminal name, or " +"``None``; if omitted or ``None``, the value of the :envvar:`TERM` environment " +"variable will be used. *fd* is the file descriptor to which any " +"initialization sequences will be sent; if not supplied or ``-1``, the file " +"descriptor for ``sys.stdout`` will be used." +msgstr "" +"پایانه را راه‌اندازی می‌کند. *term* رشته‌ای است که نام پایانه را مشخص می‌کند، یا " +"``None``؛ اگر حذف شود یا ``None`` باشد، از مقدار متغیر محیطی :envvar:`TERM` " +"استفاده خواهد شد. *fd* توصیف‌گر فایلی است که هر دنباله‌ی راه‌اندازی به آن فرستاده " +"می‌شود؛ اگر ارائه نشود یا ``-1`` باشد، از توصیف‌گر فایل برای ``sys.stdout`` " +"استفاده خواهد شد." -msgid "Raise a :exc:`curses.error` if the terminal could not be found or its terminfo database entry could not be read. If the terminal has already been initialized, this function has no effect." +msgid "" +"Raise a :exc:`curses.error` if the terminal could not be found or its terminfo " +"database entry could not be read. If the terminal has already been " +"initialized, this function has no effect." msgstr "" +"اگر پایانه پیدا نشود یا ورودی پایگاه داده‌ی terminfo آن خوانده نشود، " +"یک :exc:`curses.error` پرتاب می‌شود. اگر پایانه از قبل راه‌اندازی شده باشد، این " +"تابع هیچ تأثیری ندارد." -msgid "Calling :func:`initscr` after :func:`setupterm` leaks the terminal that :func:`setupterm` allocated: the curses library keeps only a single current terminal and does not free the previously allocated one." +msgid "" +"Calling :func:`initscr` after :func:`setupterm` leaks the terminal " +"that :func:`setupterm` allocated: the curses library keeps only a single " +"current terminal and does not free the previously allocated one." msgstr "" +"فراخوانی :func:`initscr` پس از :func:`setupterm` باعث نشت پایانه‌ای می‌شود " +"که :func:`setupterm` آن را اختصاص داده است: کتابخانه curses تنها یک پایانه " +"جاری را نگه می‌دارد و پایانه‌ای را که پیش‌تر اختصاص داده شده است آزاد نمی‌کند." -msgid "Must be called if the programmer wants to use colors, and before any other color manipulation routine is called. It is good practice to call this routine right after :func:`initscr`." +msgid "" +"Must be called if the programmer wants to use colors, and before any other " +"color manipulation routine is called. It is good practice to call this " +"routine right after :func:`initscr`." msgstr "" +"در صورتی که برنامه‌نویس بخواهد از رنگ‌ها استفاده کند، و پیش از فراخوانی هر رویه‌ی " +"دیگری برای دستکاری رنگ‌ها، باید فراخوانی شود. بهتر است این رویه درست پس " +"از :func:`initscr` فراخوانی شود." -msgid ":func:`start_color` initializes eight basic colors (black, red, green, yellow, blue, magenta, cyan, and white), and two global variables in the :mod:`!curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, containing the maximum number of colors and color-pairs the terminal can support. It also restores the colors on the terminal to the values they had when the terminal was just turned on." -msgstr "" +msgid "" +":func:`start_color` initializes eight basic colors (black, red, green, " +"yellow, blue, magenta, cyan, and white), and two global variables in " +"the :mod:`!curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, " +"containing the maximum number of colors and color-pairs the terminal can " +"support. It also restores the colors on the terminal to the values they had " +"when the terminal was just turned on." +msgstr "" +":func:`start_color` هشت رنگ پایه (سیاه، قرمز، سبز، زرد، آبی، سرخابی، فیروزه‌ای " +"و سفید) و دو متغیر سراسری در ماژول :mod:`!curses` یعنی :const:`COLORS` " +"و :const:`COLOR_PAIRS` را مقداردهی اولیه می‌کند که حاوی بیشینه تعداد رنگ‌ها و " +"جفت‌رنگ‌هایی هستند که پایانه می‌تواند پشتیبانی کند. همچنین رنگ‌های پایانه را به " +"مقادیری بازمی‌گرداند که پایانه هنگام روشن شدن داشت." -msgid "Return a logical OR of all video attributes supported by the terminal. This information is useful when a curses program needs complete control over the appearance of the screen." +msgid "" +"Return a logical OR of all video attributes supported by the terminal. This " +"information is useful when a curses program needs complete control over the " +"appearance of the screen." msgstr "" +"یک OR منطقی از تمام ویژگی‌های ویدیویی مورد پشتیبانی ترمینال را برمی‌گرداند. این " +"اطلاعات زمانی مفید است که یک برنامه curses به کنترل کامل بر ظاهر صفحه نیاز " +"داشته باشد." -msgid "Return the value of the environment variable :envvar:`TERM`, as a bytes object, truncated to 14 characters." +msgid "" +"Return the value of the environment variable :envvar:`TERM`, as a bytes " +"object, truncated to 14 characters." msgstr "" +"مقدار متغیر محیطی :envvar:`TERM` را به‌عنوان یک شیء بایتی برمی‌گرداند، که به ۱۴ " +"نویسه کوتاه شده است." -msgid "Return the value of the Boolean capability corresponding to the terminfo capability name *capname* as an integer. Return the value ``-1`` if *capname* is not a Boolean capability, or ``0`` if it is canceled or absent from the terminal description." +msgid "" +"Return the value of the Boolean capability corresponding to the terminfo " +"capability name *capname* as an integer. Return the value ``-1`` if *capname* " +"is not a Boolean capability, or ``0`` if it is canceled or absent from the " +"terminal description." msgstr "" +"مقدار قابلیت بولی متناظر با نام قابلیت *capname* در terminfo را به‌صورت یک عدد " +"صحیح برمی‌گرداند. اگر *capname* یک قابلیت بولی نباشد، مقدار ``-1`` و اگر لغو " +"شده یا در توضیح پایانه وجود نداشته باشد، مقدار ``0`` را برمی‌گرداند." -msgid "Return the value of the numeric capability corresponding to the terminfo capability name *capname* as an integer. Return the value ``-2`` if *capname* is not a numeric capability, or ``-1`` if it is canceled or absent from the terminal description." +msgid "" +"Return the value of the numeric capability corresponding to the terminfo " +"capability name *capname* as an integer. Return the value ``-2`` if *capname* " +"is not a numeric capability, or ``-1`` if it is canceled or absent from the " +"terminal description." msgstr "" +"مقدار قابلیت عددی متناظر با نام قابلیت terminfo به نام *capname* را به‌صورت عدد " +"صحیح برمی‌گرداند. اگر *capname* یک قابلیت عددی نباشد، مقدار ``-2`` و اگر لغوشده " +"یا در توصیف پایانه موجود نباشد، مقدار ``-1`` را برمی‌گرداند." -msgid "Return the value of the string capability corresponding to the terminfo capability name *capname* as a bytes object. Return ``None`` if *capname* is not a terminfo \"string capability\", or is canceled or absent from the terminal description." +msgid "" +"Return the value of the string capability corresponding to the terminfo " +"capability name *capname* as a bytes object. Return ``None`` if *capname* is " +"not a terminfo \"string capability\", or is canceled or absent from the " +"terminal description." msgstr "" +"مقدار قابلیت رشته‌ای متناظر با نام قابلیت *capname* در terminfo را به‌عنوان یک " +"شیء bytes برمی‌گرداند. اگر *capname* یک «قابلیت رشته‌ای» terminfo نباشد، یا لغو " +"شده باشد یا در توصیف پایانه وجود نداشته باشد، ``None`` را برمی‌گرداند." -msgid "Instantiate the bytes object *str* with the supplied parameters, where *str* should be a parameterized string obtained from the terminfo database. For example, ``tparm(tigetstr(\"cup\"), 5, 3)`` could result in ``b'\\033[6;4H'``, the exact result depending on terminal type. Up to nine integer parameters may be supplied." -msgstr "" +msgid "" +"Instantiate the bytes object *str* with the supplied parameters, where *str* " +"should be a parameterized string obtained from the terminfo database. For " +"example, ``tparm(tigetstr(\"cup\"), 5, 3)`` could result in ``b'\\033[6;4H'``, " +"the exact result depending on terminal type. Up to nine integer parameters " +"may be supplied." +msgstr "" +"شیء bytes یعنی *str* با پارامترهای ارائه‌شده نمونه‌سازی می‌شود، که در آن *str* " +"باید رشته‌ای پارامتری‌شده باشد که از پایگاه داده‌ی terminfo به دست آمده است. برای " +"مثال، ``tparm(tigetstr(\"cup\"), 5, 3)`` ممکن است به ``b'\\033[6;4H'`` منجر " +"شود، که نتیجه‌ی دقیق به نوع پایانه بستگی دارد. می‌توان تا ۹ پارامتر عدد صحیح " +"ارائه کرد." -msgid "Specify that the file descriptor *fd* be used for typeahead checking. If *fd* is ``-1``, then no typeahead checking is done." +msgid "" +"Specify that the file descriptor *fd* be used for typeahead checking. If *fd* " +"is ``-1``, then no typeahead checking is done." msgstr "" +"مشخص می‌کند که توصیف‌گر فایل *fd* برای بررسی پیش‌تایپ (typeahead) به کار " +"رود. اگر *fd* ``-1`` باشد، هیچ‌گونه بررسی پیش‌تایپ (typeahead) انجام نمی‌شود." -msgid "The curses library does \"line-breakout optimization\" by looking for typeahead periodically while updating the screen. If input is found, and it is coming from a tty, the current update is postponed until refresh or doupdate is called again, allowing faster response to commands typed in advance. This function allows specifying a different file descriptor for typeahead checking." -msgstr "" +msgid "" +"The curses library does \"line-breakout optimization\" by looking for " +"typeahead periodically while updating the screen. If input is found, and it " +"is coming from a tty, the current update is postponed until refresh or " +"doupdate is called again, allowing faster response to commands typed in " +"advance. This function allows specifying a different file descriptor for " +"typeahead checking." +msgstr "" +"کتابخانه curses با بررسی دوره‌ای ورودی از پیش‌تایپ‌شده (typeahead) در حین " +"به‌روزرسانی صفحه، «بهینه‌سازی شکست خط» (line-breakout optimization) را انجام " +"می‌دهد. اگر ورودی یافت شود و از یک tty بیاید، به‌روزرسانی فعلی تا زمانی که " +"refresh یا doupdate دوباره فراخوانی شود، به تعویق می‌افتد تا پاسخ سریع‌تری به " +"فرمان‌هایی که از پیش‌تایپ‌شده‌اند داده شود. این تابع امکان تعیین یک توصیف‌گر فایل " +"متفاوت برای بررسی typeahead را فراهم می‌کند." -msgid "Return a bytes object which is a printable representation of the character *ch*. Control characters are represented as a caret followed by the character, for example as ``b'^C'``. Printing characters are left as they are." +msgid "" +"Return a bytes object which is a printable representation of the character " +"*ch*. Control characters are represented as a caret followed by the character, " +"for example as ``b'^C'``. Printing characters are left as they are." msgstr "" +"یک شیء bytes برمی‌گرداند که نمایش قابل‌چاپ نویسه *ch* است. نویسه‌های کنترلی " +"به‌صورت یک نشانک (caret) و سپس خود نویسه نمایش داده می‌شوند، برای مثال به‌صورت " +"``b'^C'``. نویسه‌های چاپ‌شدنی همان‌طور که هستند باقی می‌مانند." msgid "Push *ch* so the next :meth:`~window.getch` will return it." -msgstr "" +msgstr "*ch* را فشار دهید تا :meth:`~window.getch` بعدی آن را برگرداند." msgid "Only one *ch* can be pushed before :meth:`!getch` is called." -msgstr "" +msgstr "تنها یک *ch* را می‌توان پیش از فراخوانی :meth:`!getch` پوش کرد (push)." -msgid "Update the :const:`LINES` and :const:`COLS` module variables. Useful for detecting manual screen resize." +msgid "" +"Update the :const:`LINES` and :const:`COLS` module variables. Useful for " +"detecting manual screen resize." msgstr "" +"متغیرهای ماژول :const:`LINES` و :const:`COLS` را به‌روزرسانی کنید. برای تشخیص " +"تغییر دستی اندازه‌ی صفحه مفید است." msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." -msgstr "" +msgstr "*ch* را فشار دهید تا :meth:`~window.get_wch` بعدی آن را برگرداند." msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." -msgstr "" +msgstr "تنها یک *ch* را می‌توان پیش از فراخوانی :meth:`!get_wch` فشار داد." -msgid "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given state data with it." +msgid "" +"Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " +"state data with it." msgstr "" +"یک رویداد :const:`KEY_MOUSE` را به صف ورودی اضافه کنید و داده‌های وضعیت داده‌شده " +"را با آن مرتبط کنید." -msgid "If used, this function should be called before :func:`initscr` or newterm are called. When *flag* is ``False``, the values of lines and columns specified in the terminfo database will be used, even if environment variables :envvar:`LINES` and :envvar:`COLUMNS` (used by default) are set, or if curses is running in a window (in which case default behavior would be to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." -msgstr "" +msgid "" +"If used, this function should be called before :func:`initscr` or newterm are " +"called. When *flag* is ``False``, the values of lines and columns specified " +"in the terminfo database will be used, even if environment " +"variables :envvar:`LINES` and :envvar:`COLUMNS` (used by default) are set, or " +"if curses is running in a window (in which case default behavior would be to " +"use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." +msgstr "" +"در صورت استفاده، این تابع باید پیش از فراخوانی :func:`initscr` یا newterm " +"فراخوانی شود. هنگامی که *flag* برابر ``False`` باشد، مقادیر خطوط و ستون‌های " +"تعیین‌شده در پایگاه داده‌ی terminfo استفاده خواهند شد، حتی اگر متغیرهای " +"محیطی :envvar:`LINES` و :envvar:`COLUMNS` (که به‌طور پیش‌فرض استفاده می‌شوند) " +"تنظیم‌شده باشند، یا اگر curses در یک پنجره در حال اجرا باشد (که در این حالت، " +"رفتار پیش‌فرض استفاده از اندازه‌ی پنجره خواهد بود اگر :envvar:`LINES` " +"و :envvar:`COLUMNS` تنظیم‌نشده باشند)." msgid "Equivalent to ``assume_default_colors(-1, -1)``." -msgstr "" +msgstr "معادل ``assume_default_colors(-1, -1)``." -msgid "Initialize curses and call another callable object, *func*, which should be the rest of your curses-using application. If the application raises an exception, this function will restore the terminal to a sane state before re-raising the exception and generating a traceback. The callable object *func* is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to :func:`!wrapper`. Before calling *func*, :func:`!wrapper` turns on cbreak mode, turns off echo, enables the terminal keypad, and initializes colors if the terminal has color support. On exit (whether normally or by exception) it restores cooked mode, turns on echo, and disables the terminal keypad." -msgstr "" +msgid "" +"Initialize curses and call another callable object, *func*, which should be " +"the rest of your curses-using application. If the application raises an " +"exception, this function will restore the terminal to a sane state before re-" +"raising the exception and generating a traceback. The callable object *func* " +"is then passed the main window 'stdscr' as its first argument, followed by any " +"other arguments passed to :func:`!wrapper`. Before calling *func*, :func:`!" +"wrapper` turns on cbreak mode, turns off echo, enables the terminal keypad, " +"and initializes colors if the terminal has color support. On exit (whether " +"normally or by exception) it restores cooked mode, turns on echo, and disables " +"the terminal keypad." +msgstr "" +"curses را مقداردهی اولیه می‌کند و شیء فراخوانی‌پذیر دیگری به نام *func* را " +"فراخوانی می‌کند که باید بخش باقی‌مانده‌ی برنامه‌ی استفاده‌کننده از curses شما باشد. " +"اگر برنامه استثنایی را پرتاب کند، این تابع پیش از پرتاب دوباره‌ی استثنا و ایجاد " +"ردگیری پشته، پایانه را به وضعیت سالم بازمی‌گرداند. سپس شیء فراخوانی‌پذیر *func*، " +"پنجره‌ی اصلی 'stdscr' را به‌عنوان نخستین آرگومان خود و پس از آن، هر آرگومان دیگری " +"را که به :func:`!wrapper` داده شده باشد دریافت می‌کند. پیش از فراخوانی " +"*func*، :func:`!wrapper` حالت cbreak را روشن می‌کند، بازتاب را خاموش می‌کند، " +"صفحه‌کلید پایانه را فعال می‌کند و اگر پایانه پشتیبانی از رنگ داشته باشد، رنگ‌ها " +"را مقداردهی اولیه می‌کند. هنگام خروج (چه به‌صورت عادی و چه در اثر استثنا) حالت " +"cooked را بازمی‌گرداند، بازتاب را روشن می‌کند و صفحه‌کلید پایانه را غیرفعال می‌کند." msgid "Window objects" -msgstr "" +msgstr "اشیای پنجره" -msgid "Window objects, as returned by :func:`initscr` and :func:`newwin` above, have the following methods and attributes:" +msgid "" +"Window objects, as returned by :func:`initscr` and :func:`newwin` above, have " +"the following methods and attributes:" msgstr "" +"اشیای پنجره، که توسط :func:`initscr` و :func:`newwin` در بالا بازگردانده " +"می‌شوند، دارای متدها و ویژگی‌های زیر هستند:" -msgid "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any character previously painted at that location. By default, the character position and attributes are the current settings for the window object." +msgid "" +"Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " +"character previously painted at that location. By default, the character " +"position and attributes are the current settings for the window object." msgstr "" +"نویسه‌ی *ch* را در ``(y, x)`` با ویژگی‌های *attr* ترسیم می‌کند و هر نویسه‌ای را که " +"پیش‌تر در آن مکان ترسیم شده باشد، بازنویسی می‌کند. به‌طور پیش‌فرض، موقعیت نویسه و " +"ویژگی‌ها، تنظیمات جاری شیء پنجره هستند." -msgid "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. Attempting to write to the lower-right corner of a window, subwindow, or pad will cause an exception to be raised after the character is printed." +msgid "" +"Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " +"Attempting to write to the lower-right corner of a window, subwindow, or pad " +"will cause an exception to be raised after the character is printed." msgstr "" +"نوشتن خارج از پنجره، زیرپنجره یا پد (pad)، باعث پرتاب یک :exc:`curses.error` " +"می‌شود. تلاش برای نوشتن در گوشه‌ی پایین سمت راست یک پنجره، زیرپنجره یا پد (pad)، " +"باعث می‌شود پس از چاپ نویسه، یک استثنا پرتاب شود." -msgid "Paint at most *n* characters of the character string *str* at ``(y, x)`` with attributes *attr*, overwriting anything previously on the display." +msgid "" +"Paint at most *n* characters of the character string *str* at ``(y, x)`` with " +"attributes *attr*, overwriting anything previously on the display." msgstr "" +"حداکثر *n* نویسه از رشته‌ی نویسه‌ای *str* را در ``(y, x)`` با ویژگی‌های *attr* " +"رسم کنید و هر آنچه را که پیش‌تر روی نمایشگر بوده است بازنویسی کنید." -msgid "Paint the character string *str* at ``(y, x)`` with attributes *attr*, overwriting anything previously on the display." +msgid "" +"Paint the character string *str* at ``(y, x)`` with attributes *attr*, " +"overwriting anything previously on the display." msgstr "" +"رشته‌ی نویسه‌ای *str* را در ``(y, x)`` با ویژگی‌های *attr* ترسیم می‌کند و هر چیزی " +"را که پیش‌تر روی نمایشگر بوده، بازنویسی می‌کند." -msgid "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. Attempting to write to the lower-right corner of a window, subwindow, or pad will cause an exception to be raised after the string is printed." +msgid "" +"Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " +"Attempting to write to the lower-right corner of a window, subwindow, or pad " +"will cause an exception to be raised after the string is printed." msgstr "" +"نوشتن بیرون از پنجره، زیرپنجره یا پد (pad) موجب پرتاب :exc:`curses.error` " +"می‌شود. تلاش برای نوشتن در گوشه‌ی پایین سمت راست یک پنجره، زیرپنجره یا پد (pad) " +"منجر به پرتاب یک استثنا پس از چاپ رشته می‌شود." -msgid "A bug in ncurses, the backend for this Python module, could cause segfaults when resizing windows. This was fixed in ncurses-6.1-20190511. If you are stuck with an earlier ncurses, you can avoid triggering it by not calling :meth:`!addstr` with a *str* that has embedded newlines; instead, call :meth:`!addstr` separately for each line." -msgstr "" +msgid "" +"A bug in ncurses, the backend for this Python module, could cause segfaults " +"when resizing windows. This was fixed in ncurses-6.1-20190511. If you are " +"stuck with an earlier ncurses, you can avoid triggering it by not " +"calling :meth:`!addstr` with a *str* that has embedded newlines; instead, " +"call :meth:`!addstr` separately for each line." +msgstr "" +"یک اشکال در ncurses، پشتیانه‌ی این ماژول پایتون، می‌توانست هنگام تغییر اندازه‌ی " +"پنجره‌ها باعث ایجاد خطاهای قطعه‌بندی حافظه (segfaults) شود. این اشکال در " +"ncurses-6.1-20190511 برطرف شد. اگر مجبور به استفاده از نسخه‌ی قدیمی‌تر ncurses " +"هستید، می‌توانید با خودداری از فراخوانی :meth:`!addstr` با یک *str* که حاوی " +"نویسه‌های خط جدید داخلی است، از بروز آن جلوگیری کنید؛ در عوض، :meth:`!addstr` " +"را برای هر خط به‌صورت جداگانه فراخوانی کنید." -msgid "Remove attribute *attr* from the \"background\" set applied to all writes to the current window." +msgid "" +"Remove attribute *attr* from the \"background\" set applied to all writes to " +"the current window." msgstr "" +"ویژگی *attr* را از مجموعه «background» اعمال‌شده بر همه نوشتن‌ها در پنجره جاری " +"حذف کنید." -msgid "Add attribute *attr* to the \"background\" set applied to all writes to the current window." +msgid "" +"Add attribute *attr* to the \"background\" set applied to all writes to the " +"current window." msgstr "" +"ویژگی *attr* را به مجموعه‌ی «background» اضافه کنید که بر تمام نوشتن‌ها در پنجره‌ی " +"جاری اعمال می‌شود." -msgid "Set the \"background\" set of attributes to *attr*. This set is initially ``0`` (no attributes)." +msgid "" +"Set the \"background\" set of attributes to *attr*. This set is initially " +"``0`` (no attributes)." msgstr "" +"مجموعه‌ی ویژگی‌های «پس‌زمینه» را روی *attr* تنظیم کنید. این مجموعه در ابتدا ``0`` " +"است (بدون ویژگی)." -msgid "Set the background property of the window to the character *ch*, with attributes *attr*. The change is then applied to every character position in that window:" +msgid "" +"Set the background property of the window to the character *ch*, with " +"attributes *attr*. The change is then applied to every character position in " +"that window:" msgstr "" +"ویژگی پس‌زمینه‌ی پنجره را روی نویسه‌ی *ch*، با صفت‌های *attr* تنظیم کنید. سپس این " +"تغییر روی همه‌ی موقعیت‌های نویسه در آن پنجره اعمال می‌شود:" -msgid "The attribute of every character in the window is changed to the new background attribute." -msgstr "" +msgid "" +"The attribute of every character in the window is changed to the new " +"background attribute." +msgstr "ویژگی هر نویسه در پنجره به ویژگی پس‌زمینه جدید تغییر می‌کند." -msgid "Wherever the former background character appears, it is changed to the new background character." -msgstr "" +msgid "" +"Wherever the former background character appears, it is changed to the new " +"background character." +msgstr "هر جا نویسه‌ی پس‌زمینه‌ی پیشین ظاهر شود، به نویسه‌ی پس‌زمینه‌ی جدید تغییر می‌یابد." -msgid "Set the window's background. A window's background consists of a character and any combination of attributes. The attribute part of the background is combined (OR'ed) with all non-blank characters that are written into the window. Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations." -msgstr "" +msgid "" +"Set the window's background. A window's background consists of a character " +"and any combination of attributes. The attribute part of the background is " +"combined (OR'ed) with all non-blank characters that are written into the " +"window. Both the character and attribute parts of the background are combined " +"with the blank characters. The background becomes a property of the character " +"and moves with the character through any scrolling and insert/delete line/" +"character operations." +msgstr "" +"پس‌زمینه پنجره را تنظیم کنید. پس‌زمینه یک پنجره از یک نویسه و هر ترکیبی از " +"ویژگی‌ها تشکیل شده است. بخش ویژگی پس‌زمینه با تمام نویسه‌های غیرخالی که در پنجره " +"نوشته می‌شوند، ترکیب (OR) می‌شود. هر دو بخش نویسه و ویژگی پس‌زمینه با نویسه‌های " +"خالی ترکیب می‌شوند. پس‌زمینه به یک خصوصیت نویسه تبدیل می‌شود و همراه با نویسه در " +"هر عملیات پیمایش و درج/حذف خط/نویسه جابه‌جا می‌شود." -msgid "Draw a border around the edges of the window. Each parameter specifies the character to use for a specific part of the border; see the table below for more details." +msgid "" +"Draw a border around the edges of the window. Each parameter specifies the " +"character to use for a specific part of the border; see the table below for " +"more details." msgstr "" +"یک فریم دور لبه‌های پنجره ترسیم می‌کند. هر پارامتر، نویسه‌ی مورد استفاده برای بخش " +"مشخصی از فریم را تعیین می‌کند؛ برای جزئیات بیشتر، جدول زیر را ببینید." -msgid "A ``0`` value for any parameter will cause the default character to be used for that parameter. Keyword parameters can *not* be used. The defaults are listed in this table:" +msgid "" +"A ``0`` value for any parameter will cause the default character to be used " +"for that parameter. Keyword parameters can *not* be used. The defaults are " +"listed in this table:" msgstr "" +"مقدار ``0`` برای هر پارامتر باعث می‌شود که نویسه‌ی پیش‌فرض برای آن پارامتر استفاده " +"شود. از آرگومان‌های کلیدواژه‌ای *نمی‌توان* استفاده کرد. مقادیر پیش‌فرض در این جدول " +"فهرست شده‌اند:" msgid "Parameter" -msgstr "" +msgstr "پارامتر" msgid "Description" -msgstr "" +msgstr "توضیحات" msgid "Default value" -msgstr "" +msgstr "مقدار پیش‌فرض" msgid "*ls*" -msgstr "" +msgstr "*ls*" msgid "Left side" -msgstr "" +msgstr "سمت چپ" msgid ":const:`ACS_VLINE`" -msgstr "" +msgstr ":const:`ACS_VLINE`" msgid "*rs*" -msgstr "" +msgstr "*rs*" msgid "Right side" -msgstr "" +msgstr "سمت راست" msgid "*ts*" -msgstr "" +msgstr "*ts*" msgid "Top" -msgstr "" +msgstr "بالا" msgid ":const:`ACS_HLINE`" -msgstr "" +msgstr ":const:`ACS_HLINE`" msgid "*bs*" -msgstr "" +msgstr "*bs*" msgid "Bottom" -msgstr "" +msgstr "پایین" msgid "*tl*" -msgstr "" +msgstr "*tl*" msgid "Upper-left corner" -msgstr "" +msgstr "گوشه‌ی بالا-چپ" msgid ":const:`ACS_ULCORNER`" -msgstr "" +msgstr ":const:`ACS_ULCORNER`" msgid "*tr*" -msgstr "" +msgstr "*tr*" msgid "Upper-right corner" -msgstr "" +msgstr "گوشه‌ی بالا-راست" msgid ":const:`ACS_URCORNER`" -msgstr "" +msgstr ":const:`ACS_URCORNER`" msgid "*bl*" -msgstr "" +msgstr "*bl*" msgid "Bottom-left corner" -msgstr "" +msgstr "گوشه پایین چپ" msgid ":const:`ACS_LLCORNER`" -msgstr "" +msgstr ":const:`ACS_LLCORNER`" msgid "*br*" -msgstr "" +msgstr "*br*" msgid "Bottom-right corner" -msgstr "" +msgstr "گوشه پایین-راست" msgid ":const:`ACS_LRCORNER`" -msgstr "" +msgstr ":const:`ACS_LRCORNER`" -msgid "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* and *bs* are *horch*. The default corner characters are always used by this function." +msgid "" +"Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " +"and *bs* are *horch*. The default corner characters are always used by this " +"function." msgstr "" +"مشابه :meth:`border`، اما هر دو *ls* و *rs* برابر با *vertch* و هر دو *ts* و " +"*bs* برابر با *horch* هستند. این تابع همیشه از نویسه‌های گوشه پیش‌فرض استفاده " +"می‌کند." -msgid "Set the attributes of *num* characters at the current cursor position, or at position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the attribute will be set on all the characters to the end of the line. This function moves cursor to position ``(y, x)`` if supplied. The changed line will be touched using the :meth:`touchline` method so that the contents will be redisplayed by the next window refresh." -msgstr "" +msgid "" +"Set the attributes of *num* characters at the current cursor position, or at " +"position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " +"attribute will be set on all the characters to the end of the line. This " +"function moves cursor to position ``(y, x)`` if supplied. The changed line " +"will be touched using the :meth:`touchline` method so that the contents will " +"be redisplayed by the next window refresh." +msgstr "" +"ویژگی‌های *num* نویسه را در موقعیت فعلی مکان‌نما، یا در موقعیت ``(y, x)`` در " +"صورت ارائه شدن، تنظیم می‌کند. اگر *num* داده نشده باشد یا ``-1`` باشد، ویژگی " +"برای تمام نویسه‌ها تا پایان خط تنظیم خواهد شد. این تابع مکان‌نما را در صورت " +"ارائه شدن به موقعیت ``(y, x)`` منتقل می‌کند. خط تغییرکرده با استفاده از " +"متد :meth:`touchline` علامت‌گذاری می‌شود تا محتویات در بازخوانی بعدی پنجره " +"دوباره نمایش داده شوند." -msgid "Like :meth:`erase`, but also cause the whole window to be repainted upon next call to :meth:`refresh`." +msgid "" +"Like :meth:`erase`, but also cause the whole window to be repainted upon next " +"call to :meth:`refresh`." msgstr "" +"مانند :meth:`erase`، اما باعث می‌شود در فراخوانی بعدی :meth:`refresh`، کل پنجره " +"دوباره ترسیم شود." -msgid "If *flag* is ``True``, the next call to :meth:`refresh` will clear the window completely." +msgid "" +"If *flag* is ``True``, the next call to :meth:`refresh` will clear the window " +"completely." msgstr "" +"اگر *flag* برابر ``True`` باشد، فراخوانی بعدی :meth:`refresh` پنجره را به‌طور " +"کامل پاک می‌کند." -msgid "Erase from cursor to the end of the window: all lines below the cursor are deleted, and then the equivalent of :meth:`clrtoeol` is performed." +msgid "" +"Erase from cursor to the end of the window: all lines below the cursor are " +"deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" +"پاک کردن از مکان‌نما تا انتهای پنجره: همه خطوط زیر مکان‌نما حذف می‌شوند، سپس " +"معادل :meth:`clrtoeol` اجرا می‌شود." msgid "Erase from cursor to the end of the line." -msgstr "" +msgstr "از مکان‌نما تا انتهای خط را پاک می‌کند." -msgid "Update the current cursor position of all the ancestors of the window to reflect the current cursor position of the window." +msgid "" +"Update the current cursor position of all the ancestors of the window to " +"reflect the current cursor position of the window." msgstr "" +"موقعیت فعلی مکان‌نمای همه‌ی نیاکان پنجره را به‌روزرسانی کنید تا موقعیت فعلی " +"مکان‌نمای پنجره منعکس شود." -msgid "Delete the character under the cursor, or at ``(y, x)`` if specified. All characters to the right on the same line are shifted one position left." +msgid "" +"Delete the character under the cursor, or at ``(y, x)`` if specified. All " +"characters to the right on the same line are shifted one position left." msgstr "" +"نویسه‌ی زیر مکان‌نما، یا در ``(y, x)`` در صورت مشخص شدن، حذف می‌کند. همه‌ی " +"نویسه‌های سمت راست در همان خط یک موقعیت به چپ جابه‌جا می‌شوند." -msgid "Delete the line under the cursor. All following lines are moved up by one line." -msgstr "" +msgid "" +"Delete the line under the cursor. All following lines are moved up by one line." +msgstr "خط زیر نشانگر حذف می‌شود. همه‌ی خطوط بعدی یک خط به بالا جابه‌جا می‌شوند." -msgid "An abbreviation for \"derive window\", :meth:`derwin` is the same as calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to the origin of the window, rather than relative to the entire screen. Return a window object for the derived window." +msgid "" +"An abbreviation for \"derive window\", :meth:`derwin` is the same as " +"calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " +"the origin of the window, rather than relative to the entire screen. Return a " +"window object for the derived window." msgstr "" +":meth:`derwin` که مخفف «derive window» است، همانند فراخوانی :meth:`subwin` " +"است، با این تفاوت که *begin_y* و *begin_x* نسبت به مبدأ پنجره هستند، نه نسبت " +"به کل صفحه‌نمایش. یک شیء پنجره برای پنجره مشتق‌شده برمی‌گرداند." -msgid "Add character *ch* with attribute *attr*, and immediately call :meth:`refresh` on the window." +msgid "" +"Add character *ch* with attribute *attr*, and immediately " +"call :meth:`refresh` on the window." msgstr "" +"نویسه‌ی *ch* را با ویژگی *attr* اضافه کنید و بلافاصله :meth:`refresh` را روی " +"پنجره فراخوانی کنید." -msgid "Test whether the given pair of screen-relative character-cell coordinates are enclosed by the given window, returning ``True`` or ``False``. It is useful for determining what subset of the screen windows enclose the location of a mouse event." +msgid "" +"Test whether the given pair of screen-relative character-cell coordinates are " +"enclosed by the given window, returning ``True`` or ``False``. It is useful " +"for determining what subset of the screen windows enclose the location of a " +"mouse event." msgstr "" +"آزمایش می‌کند که آیا جفت داده‌شده از مختصات سلول‌نویسه‌ای نسبت به صفحه، درون پنجره‌ی " +"داده‌شده قرار دارد یا خیر، و ``True`` یا ``False`` برمی‌گرداند. این برای تعیین " +"اینکه چه زیرمجموعه‌ای از پنجره‌های صفحه محل یک رویداد ماوس را دربر می‌گیرد، مفید " +"است." msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." -msgstr "" +msgstr "پیش‌تر، به‌جای ``True`` یا ``False``، ``1`` یا ``0`` را برمی‌گرداند." -msgid "Encoding used to encode method arguments (Unicode strings and characters). The encoding attribute is inherited from the parent window when a subwindow is created, for example with :meth:`window.subwin`. By default, current locale encoding is used (see :func:`locale.getencoding`)." +msgid "" +"Encoding used to encode method arguments (Unicode strings and characters). The " +"encoding attribute is inherited from the parent window when a subwindow is " +"created, for example with :meth:`window.subwin`. By default, current locale " +"encoding is used (see :func:`locale.getencoding`)." msgstr "" +"کدگذاری مورد استفاده برای کدگذاری آرگومان‌های متد (رشته‌ها و نویسه‌های یونیکد). " +"هنگامی که یک زیرپنجره ایجاد می‌شود، ویژگی encoding از پنجره والد به ارث می‌رسد، " +"برای مثال با :meth:`window.subwin`. به‌طور پیش‌فرض، از کدگذاری locale فعلی " +"استفاده می‌شود (به :func:`locale.getencoding` مراجعه کنید)." msgid "Clear the window." -msgstr "" +msgstr "پنجره را پاک کنید." msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." -msgstr "" +msgstr "یک تاپل ``(y, x)`` از مختصات گوشه‌ی بالا سمت چپ برمی‌گرداند." -msgid "Return the given window's current background character/attribute pair. Its components can be extracted like those of :meth:`inch`." +msgid "" +"Return the given window's current background character/attribute pair. Its " +"components can be extracted like those of :meth:`inch`." msgstr "" +"جفت نویسه/ویژگی پس‌زمینه‌ی جاری پنجره‌ی داده‌شده را برمی‌گرداند. اجزای آن را می‌توان " +"مانند اجزای :meth:`inch` استخراج کرد." -msgid "Get a character. Note that the integer returned does *not* have to be in ASCII range: function keys, keypad keys and so on are represented by numbers higher than 255. In no-delay mode, return ``-1`` if there is no input, otherwise wait until a key is pressed." +msgid "" +"Get a character. Note that the integer returned does *not* have to be in ASCII " +"range: function keys, keypad keys and so on are represented by numbers higher " +"than 255. In no-delay mode, return ``-1`` if there is no input, otherwise " +"wait until a key is pressed." msgstr "" +"یک نویسه دریافت می‌کند. توجه داشته باشید که عدد صحیح برگردانده‌شده *لزوماً* در " +"محدوده ASCII نیست: کلیدهای تابع، کلیدهای صفحه‌کلید عددی و غیره با اعدادی بزرگ‌تر " +"از ۲۵۵ نمایش داده می‌شوند. در حالت بدون تأخیر، اگر ورودی وجود نداشته باشد " +"``-1`` را برمی‌گرداند، در غیر این صورت تا زمانی که یک کلید فشرده شود صبر می‌کند." -msgid "Get a wide character. Return a character for most keys, or an integer for function keys, keypad keys, and other special keys. In no-delay mode, raise an exception if there is no input." +msgid "" +"Get a wide character. Return a character for most keys, or an integer for " +"function keys, keypad keys, and other special keys. In no-delay mode, raise an " +"exception if there is no input." msgstr "" +"یک نویسه‌ی پهن دریافت می‌کند. برای بیشتر کلیدها یک نویسه برمی‌گرداند، یا برای " +"کلیدهای تابعی، کلیدهای صفحه‌کلید عددی و سایر کلیدهای ویژه یک عدد صحیح. در حالت " +"بدون تأخیر، اگر ورودی وجود نداشته باشد، یک استثنا پرتاب می‌کند." -msgid "Get a character, returning a string instead of an integer, as :meth:`getch` does. Function keys, keypad keys and other special keys return a multibyte string containing the key name. In no-delay mode, raise an exception if there is no input." +msgid "" +"Get a character, returning a string instead of an integer, as :meth:`getch` " +"does. Function keys, keypad keys and other special keys return a multibyte " +"string containing the key name. In no-delay mode, raise an exception if there " +"is no input." msgstr "" +"یک نویسه دریافت می‌کند و به‌جای عدد صحیح، یک رشته برمی‌گرداند، همان‌طور " +"که :meth:`getch` انجام می‌دهد. کلیدهای تابعی، کلیدهای صفحه‌کلید عددی و سایر " +"کلیدهای ویژه، یک رشته چندبایتی شامل نام کلید برمی‌گردانند. در حالت بدون تأخیر، " +"در صورت نبود ورودی، یک استثنا پرتاب می‌شود." msgid "Return a tuple ``(y, x)`` of the height and width of the window." -msgstr "" +msgstr "یک تاپل ``(y, x)`` شامل ارتفاع و عرض پنجره برمی‌گرداند." -msgid "Return the beginning coordinates of this window relative to its parent window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no parent." +msgid "" +"Return the beginning coordinates of this window relative to its parent window " +"as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no parent." msgstr "" +"مختصات آغازین این پنجره را نسبت به پنجره والد آن به‌صورت یک تاپل ``(y, x)`` " +"برمی‌گرداند. اگر این پنجره والدی نداشته باشد، ``(-1, -1)`` را برمی‌گرداند." -msgid "Read a bytes object from the user, with primitive line editing capacity. At most *n* characters are read; *n* defaults to and cannot exceed 2047." +msgid "" +"Read a bytes object from the user, with primitive line editing capacity. At " +"most *n* characters are read; *n* defaults to and cannot exceed 2047." msgstr "" +"یک شیء bytes را با قابلیت ابتدایی ویرایش خط از کاربر بخوانید. حداکثر *n* نویسه " +"خوانده می‌شود؛ مقدار پیش‌فرض *n* ۲۰۴۷ است و نمی‌تواند از ۲۰۴۷ فراتر رود." msgid "The maximum value for *n* was increased from 1023 to 2047." -msgstr "" +msgstr "حداکثر مقدار برای *n* از ۱۰۲۳ به ۲۰۴۷ افزایش یافت." -msgid "Return a tuple ``(y, x)`` of current cursor position relative to the window's upper-left corner." +msgid "" +"Return a tuple ``(y, x)`` of current cursor position relative to the window's " +"upper-left corner." msgstr "" +"یک تاپل ``(y, x)`` از موقعیت فعلی مکان‌نما نسبت به گوشه‌ی بالا-چپ پنجره " +"برمی‌گرداند." -msgid "Display a horizontal line starting at ``(y, x)`` with length *n* consisting of the character *ch* with attributes *attr*. The line stops at the right edge of the window if fewer than *n* cells are available." +msgid "" +"Display a horizontal line starting at ``(y, x)`` with length *n* consisting of " +"the character *ch* with attributes *attr*. The line stops at the right edge " +"of the window if fewer than *n* cells are available." msgstr "" +"یک خط افقی را نمایش می‌دهد که از ``(y, x)`` آغاز می‌شود، به طول *n* است و از " +"نویسه *ch* با ویژگی‌های *attr* تشکیل شده است. اگر کمتر از *n* خانه در دسترس " +"باشد، خط در لبه‌ی راست پنجره متوقف می‌شود." -msgid "If *flag* is ``False``, curses no longer considers using the hardware insert/delete character feature of the terminal; if *flag* is ``True``, use of character insertion and deletion is enabled. When curses is first initialized, use of character insert/delete is enabled by default." +msgid "" +"If *flag* is ``False``, curses no longer considers using the hardware insert/" +"delete character feature of the terminal; if *flag* is ``True``, use of " +"character insertion and deletion is enabled. When curses is first " +"initialized, use of character insert/delete is enabled by default." msgstr "" +"اگر *flag* برابر ``False`` باشد، curses دیگر استفاده از قابلیت سخت‌افزاری درج/" +"حذف نویسه پایانه را در نظر نمی‌گیرد؛ اگر *flag* برابر ``True`` باشد، استفاده از " +"درج و حذف نویسه فعال می‌شود. هنگامی که curses برای نخستین بار مقداردهی اولیه " +"می‌شود، استفاده از درج/حذف نویسه به‌طور پیش‌فرض فعال است." -msgid "If *flag* is ``True``, :mod:`!curses` will try to use hardware line editing facilities. Otherwise, curses will not use them." +msgid "" +"If *flag* is ``True``, :mod:`!curses` will try to use hardware line editing " +"facilities. Otherwise, curses will not use them." msgstr "" +"اگر *flag* برابر ``True`` باشد، :mod:`!curses` تلاش می‌کند از امکانات سخت‌افزاری " +"ویرایش خط استفاده کند. در غیر این صورت، curses از آن‌ها استفاده نخواهد کرد." -msgid "If *flag* is ``True``, any change in the window image automatically causes the window to be refreshed; you no longer have to call :meth:`refresh` yourself. However, it may degrade performance considerably, due to repeated calls to wrefresh. This option is disabled by default." +msgid "" +"If *flag* is ``True``, any change in the window image automatically causes the " +"window to be refreshed; you no longer have to call :meth:`refresh` yourself. " +"However, it may degrade performance considerably, due to repeated calls to " +"wrefresh. This option is disabled by default." msgstr "" +"اگر *flag* برابر ``True`` باشد، هر تغییری در تصویر پنجره به‌طور خودکار باعث " +"تازه‌سازی پنجره می‌شود؛ دیگر نیازی نیست خودتان :meth:`refresh` را فراخوانی کنید. " +"با این حال، ممکن است به دلیل فراخوانی‌های مکرر wrefresh، کارایی را به‌طور " +"قابل‌توجهی کاهش دهد. این گزینه به‌طور پیش‌فرض غیرفعال است." -msgid "Return the character at the given position in the window. The bottom 8 bits are the character proper and the upper bits are the attributes; extract them with the :data:`A_CHARTEXT` and :data:`A_ATTRIBUTES` bit-masks, and the color pair with :func:`pair_number`. The character byte is the locale-encoded byte of the cell's character, consistent with :meth:`instr`. On a wide-character build, a character that does not fit in a single byte in the current locale has a character byte of ``0``; use :meth:`instr` to read such characters." -msgstr "" +msgid "" +"Return the character at the given position in the window. The bottom 8 bits " +"are the character proper and the upper bits are the attributes; extract them " +"with the :data:`A_CHARTEXT` and :data:`A_ATTRIBUTES` bit-masks, and the color " +"pair with :func:`pair_number`. The character byte is the locale-encoded byte " +"of the cell's character, consistent with :meth:`instr`. On a wide-character " +"build, a character that does not fit in a single byte in the current locale " +"has a character byte of ``0``; use :meth:`instr` to read such characters." +msgstr "" +"نویسه را در موقعیت داده‌شده در پنجره برمی‌گرداند. ۸ بیت پایینی، خود نویسه است و " +"بیت‌های بالایی، ویژگی‌ها هستند؛ آن‌ها را با ماسک‌های بیتی :data:`A_CHARTEXT` " +"و :data:`A_ATTRIBUTES`، و جفت رنگ را با :func:`pair_number` استخراج کنید. بایت " +"نویسه، بایت کدگذاری‌شده بر اساس تنظیمات locale (locale) برای نویسه‌ی سلول است و " +"با :meth:`instr` سازگار است. در یک ساخت با نویسه‌های پهن (wide-character " +"build)، نویسه‌ای که در تنظیمات locale فعلی در یک بایت جا نمی‌شود، بایت نویسه‌ی آن " +"``0`` است؛ برای خواندن چنین نویسه‌هایی از :meth:`instr` استفاده کنید." -msgid "Insert character *ch* with attributes *attr* before the character under the cursor, or at ``(y, x)`` if specified. All characters to the right of the cursor are shifted one position right, with the rightmost character on the line being lost. The cursor position does not change." +msgid "" +"Insert character *ch* with attributes *attr* before the character under the " +"cursor, or at ``(y, x)`` if specified. All characters to the right of the " +"cursor are shifted one position right, with the rightmost character on the " +"line being lost. The cursor position does not change." msgstr "" +"نویسه *ch* را با ویژگی‌های *attr* پیش از نویسه زیر مکان‌نما، یا در ``(y, x)`` در " +"صورت مشخص بودن، درج می‌کند. تمام نویسه‌های سمت راست مکان‌نما یک موقعیت به راست " +"جابه‌جا می‌شوند و راست‌ترین نویسه خط از بین می‌رود. موقعیت مکان‌نما تغییر نمی‌کند." -msgid "Insert *nlines* lines into the specified window above the current line. The *nlines* bottom lines are lost. For negative *nlines*, delete *nlines* lines starting with the one under the cursor, and move the remaining lines up. The bottom *nlines* lines are cleared. The current cursor position remains the same." +msgid "" +"Insert *nlines* lines into the specified window above the current line. The " +"*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* lines " +"starting with the one under the cursor, and move the remaining lines up. The " +"bottom *nlines* lines are cleared. The current cursor position remains the " +"same." msgstr "" +"*nlines* خط را در پنجره‌ی مشخص‌شده، بالای خط فعلی درج می‌کند. *nlines* خط پایینی " +"از دست می‌روند. برای *nlines* منفی، *nlines* خط را شروع از خط زیر مکان‌نما حذف " +"می‌کند و خطوط باقی‌مانده را به بالا حرکت می‌دهد. *nlines* خط پایینی پاک می‌شوند. " +"موقعیت فعلی مکان‌نما بدون تغییر باقی می‌ماند." -msgid "Insert a blank line under the cursor. All following lines are moved down by one line." +msgid "" +"Insert a blank line under the cursor. All following lines are moved down by " +"one line." msgstr "" +"یک خط خالی زیر مکان‌نما درج می‌کند. همه‌ی خط‌های بعدی یک خط به پایین جابه‌جا می‌شوند." -msgid "Insert a character string (as many characters as will fit on the line) before the character under the cursor, up to *n* characters. If *n* is zero or negative, the entire string is inserted. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to *y*, *x*, if specified)." -msgstr "" +msgid "" +"Insert a character string (as many characters as will fit on the line) before " +"the character under the cursor, up to *n* characters. If *n* is zero or " +"negative, the entire string is inserted. All characters to the right of the " +"cursor are shifted right, with the rightmost characters on the line being " +"lost. The cursor position does not change (after moving to *y*, *x*, if " +"specified)." +msgstr "" +"یک رشته از نویسه‌ها (هر تعداد نویسه که در خط جا شود) را پیش از نویسه‌ی زیر " +"مکان‌نما، تا سقف *n* نویسه درج کنید. اگر *n* صفر یا منفی باشد، تمام رشته درج " +"می‌شود. همه‌ی نویسه‌های سمت راست مکان‌نما به سمت راست جابه‌جا می‌شوند و راست‌ترین " +"نویسه‌های خط از دست می‌روند. موقعیت مکان‌نما تغییر نمی‌کند (پس از حرکت به *y*، " +"*x*، در صورت مشخص بودن)." -msgid "Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to *y*, *x*, if specified)." +msgid "" +"Insert a character string (as many characters as will fit on the line) before " +"the character under the cursor. All characters to the right of the cursor are " +"shifted right, with the rightmost characters on the line being lost. The " +"cursor position does not change (after moving to *y*, *x*, if specified)." msgstr "" +"یک رشته‌ی نویسه‌ای (به تعداد نویسه‌هایی که در خط جا می‌شوند) پیش از نویسه‌ی زیر " +"مکان‌نما درج می‌شود. همه‌ی نویسه‌های سمت راست مکان‌نما به سمت راست جابه‌جا می‌شوند و " +"راست‌ترین نویسه‌های خط از دست می‌روند. موقعیت مکان‌نما تغییر نمی‌کند (پس از حرکت به " +"*y*، *x*، در صورت مشخص بودن)." -msgid "Return a bytes object of characters, extracted from the window starting at the current cursor position, or at *y*, *x* if specified, and stopping at the end of the line. Attributes and color information are stripped from the characters. If *n* is specified, :meth:`instr` returns a string at most *n* characters long (exclusive of the trailing NUL). The maximum value for *n* is 2047." -msgstr "" +msgid "" +"Return a bytes object of characters, extracted from the window starting at the " +"current cursor position, or at *y*, *x* if specified, and stopping at the end " +"of the line. Attributes and color information are stripped from the " +"characters. If *n* is specified, :meth:`instr` returns a string at most *n* " +"characters long (exclusive of the trailing NUL). The maximum value for *n* is " +"2047." +msgstr "" +"یک شیء بایتی از نویسه‌ها را برمی‌گرداند که از پنجره استخراج می‌شوند و از موقعیت " +"فعلی مکان‌نما یا در مختصات *y*، *x* در صورت مشخص بودن شروع می‌شوند و در انتهای " +"خط متوقف می‌شوند. ویژگی‌ها و اطلاعات رنگ از نویسه‌ها حذف می‌شوند. اگر *n* مشخص شده " +"باشد، :meth:`instr` رشته‌ای به طول حداکثر *n* نویسه را برمی‌گرداند (بدون احتساب " +"NUL پایانی). حداکثر مقدار *n* برابر ۲۰۴۷ است." -msgid "Return ``True`` if the specified line was modified since the last call to :meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` exception if *line* is not valid for the given window." +msgid "" +"Return ``True`` if the specified line was modified since the last call " +"to :meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " +"exception if *line* is not valid for the given window." msgstr "" +"اگر خط مشخص‌شده از آخرین فراخوانی :meth:`refresh` تغییر کرده باشد، ``True`` را " +"برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند. اگر *line* برای پنجره " +"داده‌شده معتبر نباشد، استثنای :exc:`curses.error` پرتاب می‌شود." -msgid "Return ``True`` if the specified window was modified since the last call to :meth:`refresh`; otherwise return ``False``." +msgid "" +"Return ``True`` if the specified window was modified since the last call " +"to :meth:`refresh`; otherwise return ``False``." msgstr "" +"اگر پنجره‌ی مشخص‌شده از آخرین فراخوانی :meth:`refresh` تغییر کرده باشد، ``True`` " +"را برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند." -msgid "If *flag* is ``True``, escape sequences generated by some keys (keypad, function keys) will be interpreted by :mod:`!curses`. If *flag* is ``False``, escape sequences will be left as is in the input stream." +msgid "" +"If *flag* is ``True``, escape sequences generated by some keys (keypad, " +"function keys) will be interpreted by :mod:`!curses`. If *flag* is ``False``, " +"escape sequences will be left as is in the input stream." msgstr "" +"اگر *flag* برابر ``True`` باشد، دنباله‌های گریز تولیدشده توسط برخی کلیدها " +"(صفحه‌کلید عددی، کلیدهای تابعی) توسط :mod:`!curses` تفسیر می‌شوند. اگر *flag* " +"برابر ``False`` باشد، دنباله‌های گریز در جریان ورودی به‌همان صورت باقی می‌مانند." -msgid "If *flag* is ``True``, cursor is left where it is on update, instead of being at \"cursor position.\" This reduces cursor movement where possible." +msgid "" +"If *flag* is ``True``, cursor is left where it is on update, instead of being " +"at \"cursor position.\" This reduces cursor movement where possible." msgstr "" +"اگر *flag* برابر ``True`` باشد، مکان‌نما هنگام به‌روزرسانی در همان جای خود باقی " +"می‌ماند، به جای آنکه در «موقعیت مکان‌نما» قرار گیرد. این کار حرکت مکان‌نما را تا " +"حد ممکن کاهش می‌دهد." -msgid "If *flag* is ``False``, cursor will always be at \"cursor position\" after an update." +msgid "" +"If *flag* is ``False``, cursor will always be at \"cursor position\" after an " +"update." msgstr "" +"اگر *flag* برابر ``False`` باشد، مکان‌نما پس از یک به‌روزرسانی همیشه در «موقعیت " +"مکان‌نما» خواهد بود." msgid "Move cursor to ``(new_y, new_x)``." -msgstr "" +msgstr "مکان‌نما را به ``(new_y, new_x)`` حرکت دهید." -msgid "Move the window inside its parent window. The screen-relative parameters of the window are not changed. This routine is used to display different parts of the parent window at the same physical position on the screen." +msgid "" +"Move the window inside its parent window. The screen-relative parameters of " +"the window are not changed. This routine is used to display different parts " +"of the parent window at the same physical position on the screen." msgstr "" +"پنجره را درون پنجره‌ی والد آن جابه‌جا کنید. پارامترهای پنجره نسبت به صفحه‌ی نمایش " +"تغییر داده نمی‌شوند. این رویه برای نمایش بخش‌های مختلف پنجره‌ی والد در یک موقعیت " +"فیزیکی یکسان روی صفحه‌ی نمایش استفاده می‌شود." msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." -msgstr "" +msgstr "پنجره را جابه‌جا کنید تا گوشه‌ی بالا-چپ آن در ``(new_y, new_x)`` قرار گیرد." -msgid "Moving the window so that any part of it would be off the screen is an error: the window is not moved and :exc:`curses.error` is raised." +msgid "" +"Moving the window so that any part of it would be off the screen is an error: " +"the window is not moved and :exc:`curses.error` is raised." msgstr "" +"جابه‌جایی پنجره به گونه‌ای که هر بخشی از آن خارج از صفحه باشد، خطا است: پنجره " +"جابه‌جا نمی‌شود و :exc:`curses.error` پرتاب می‌شود." msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." -msgstr "" +msgstr "اگر *flag* برابر ``True`` باشد، :meth:`getch` غیرمسدود خواهد بود." msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" +"اگر *flag* برابر ``True`` باشد، زمان انقضا برای دنباله‌های خنثی‌سازی اعمال " +"نخواهد شد." -msgid "If *flag* is ``False``, after a few milliseconds, an escape sequence will not be interpreted, and will be left in the input stream as is." +msgid "" +"If *flag* is ``False``, after a few milliseconds, an escape sequence will not " +"be interpreted, and will be left in the input stream as is." msgstr "" +"اگر *flag* برابر ``False`` باشد، پس از چند میلی‌ثانیه، یک دنباله‌ی گریز (escape " +"sequence) تفسیر نخواهد شد و همان‌گونه که هست در جریان ورودی باقی خواهد ماند." -msgid "Mark for refresh but wait. This function updates the data structure representing the desired state of the window, but does not force an update of the physical screen. To accomplish that, call :func:`doupdate`." +msgid "" +"Mark for refresh but wait. This function updates the data structure " +"representing the desired state of the window, but does not force an update of " +"the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" +"برای نوسازی علامت‌گذاری می‌کند، اما درنگ می‌کند. این تابع ساختار داده‌ای را که " +"نشان‌دهنده وضعیت مطلوب پنجره است به‌روزرسانی می‌کند، اما به‌روزرسانی صفحه نمایش " +"فیزیکی را تحمیل نمی‌کند. برای انجام آن، :func:`doupdate` را فراخوانی کنید." -msgid "The 6 arguments can only be specified, and are then required, when the window is a pad created with :func:`newpad`; they have the same meaning as for :meth:`refresh`." +msgid "" +"The 6 arguments can only be specified, and are then required, when the window " +"is a pad created with :func:`newpad`; they have the same meaning as " +"for :meth:`refresh`." msgstr "" +"این ۶ آرگومان را فقط زمانی می‌توان تعیین کرد، و در آن صورت الزامی هستند، که " +"پنجره یک پد (pad) ساخته‌شده با :func:`newpad` باشد؛ معنای آن‌ها همان معنایی است " +"که برای :meth:`refresh` وجود دارد." -msgid "Overlay the window on top of *destwin*. The windows need not be the same size, only the overlapping region is copied. This copy is non-destructive, which means that the current background character does not overwrite the old contents of *destwin*." +msgid "" +"Overlay the window on top of *destwin*. The windows need not be the same size, " +"only the overlapping region is copied. This copy is non-destructive, which " +"means that the current background character does not overwrite the old " +"contents of *destwin*." msgstr "" +"پنجره را بر روی *destwin* همپوشانی می‌کند. لازم نیست پنجره‌ها هم‌اندازه باشند، " +"تنها ناحیه‌ی همپوشانی کپی می‌شود. این کپی غیرمخرب است، به این معنا که نویسه‌ی " +"پس‌زمینه‌ی فعلی محتوای قبلی *destwin* را بازنویسی نمی‌کند." -msgid "To get fine-grained control over the copied region, the second form of :meth:`overlay` can be used. *sminrow* and *smincol* are the upper-left coordinates of the source window, and the other variables mark a rectangle in the destination window." +msgid "" +"To get fine-grained control over the copied region, the second form " +"of :meth:`overlay` can be used. *sminrow* and *smincol* are the upper-left " +"coordinates of the source window, and the other variables mark a rectangle in " +"the destination window." msgstr "" +"برای به‌دست آوردن کنترل دقیق بر ناحیه‌ی کپی‌شده، می‌توان از دومین " +"فرم :meth:`overlay` استفاده کرد. *sminrow* و *smincol* مختصات گوشه‌ی بالا-چپ " +"پنجره‌ی مبدأ هستند، و سایر متغیرها یک مستطیل را در پنجره‌ی مقصد مشخص می‌کنند." -msgid "Overwrite the window on top of *destwin*. The windows need not be the same size, in which case only the overlapping region is copied. This copy is destructive, which means that the current background character overwrites the old contents of *destwin*." +msgid "" +"Overwrite the window on top of *destwin*. The windows need not be the same " +"size, in which case only the overlapping region is copied. This copy is " +"destructive, which means that the current background character overwrites the " +"old contents of *destwin*." msgstr "" +"پنجره را روی *destwin* بازنویسی می‌کند. لازم نیست پنجره‌ها هم‌اندازه باشند؛ در " +"این صورت فقط ناحیه‌ی هم‌پوشانی کپی می‌شود. این کپی مخرب است، به این معنا که نویسه‌ی " +"پس‌زمینه‌ی فعلی محتوای قدیمی *destwin* را بازنویسی می‌کند." -msgid "To get fine-grained control over the copied region, the second form of :meth:`overwrite` can be used. *sminrow* and *smincol* are the upper-left coordinates of the source window, the other variables mark a rectangle in the destination window." +msgid "" +"To get fine-grained control over the copied region, the second form " +"of :meth:`overwrite` can be used. *sminrow* and *smincol* are the upper-left " +"coordinates of the source window, the other variables mark a rectangle in the " +"destination window." msgstr "" +"برای به دست آوردن کنترل ریزدانه بر ناحیه‌ی کپی‌شده، می‌توان از دومین " +"شکل :meth:`overwrite` استفاده کرد. *sminrow* و *smincol* مختصات گوشه‌ی بالا-چپ " +"پنجره‌ی مبدأ هستند، سایر متغیرها یک مستطیل را در پنجره‌ی مقصد مشخص می‌کنند." -msgid "Write all data associated with the window into the provided file object. This information can be later retrieved using the :func:`getwin` function." +msgid "" +"Write all data associated with the window into the provided file object. This " +"information can be later retrieved using the :func:`getwin` function." msgstr "" +"تمام داده‌های مرتبط با پنجره را در شیء فایل ارائه‌شده می‌نویسد. این اطلاعات را " +"می‌توان بعداً با استفاده از تابع :func:`getwin` بازیابی کرد." -msgid "Indicate that the *num* screen lines, starting at line *beg*, are corrupted and should be completely redrawn on the next :meth:`refresh` call." +msgid "" +"Indicate that the *num* screen lines, starting at line *beg*, are corrupted " +"and should be completely redrawn on the next :meth:`refresh` call." msgstr "" +"نشان می‌دهد که *num* خط از خطوط صفحه، که از خط *beg* شروع می‌شوند، آسیب‌دیده‌اند و " +"باید در فراخوانی بعدی :meth:`refresh` به‌طور کامل بازترسیم شوند." -msgid "Touch the entire window, causing it to be completely redrawn on the next :meth:`refresh` call." +msgid "" +"Touch the entire window, causing it to be completely redrawn on the " +"next :meth:`refresh` call." msgstr "" +"کل پنجره را لمس (touch) کنید؛ این کار باعث می‌شود در فراخوانی " +"بعدی :meth:`refresh` به‌طور کامل بازترسیم شود." -msgid "Update the display immediately (sync actual screen with previous drawing/deleting methods)." +msgid "" +"Update the display immediately (sync actual screen with previous drawing/" +"deleting methods)." msgstr "" +"نمایش را بلافاصله به‌روزرسانی کنید (صفحه واقعی را با متدهای قبلی ترسیم/حذف " +"همگام‌سازی کنید)." -msgid "The 6 arguments can only be specified, and are then required, when the window is a pad created with :func:`newpad`. The additional parameters are needed to indicate what part of the pad and screen are involved. *pminrow* and *pmincol* specify the upper-left corner of the rectangle to be displayed in the pad. *sminrow*, *smincol*, *smaxrow*, and *smaxcol* specify the edges of the rectangle to be displayed on the screen. The lower-right corner of the rectangle to be displayed in the pad is calculated from the screen coordinates, since the rectangles must be the same size. Both rectangles must be entirely contained within their respective structures. Negative values of *pminrow*, *pmincol*, *sminrow*, or *smincol* are treated as if they were zero." -msgstr "" +msgid "" +"The 6 arguments can only be specified, and are then required, when the window " +"is a pad created with :func:`newpad`. The additional parameters are needed to " +"indicate what part of the pad and screen are involved. *pminrow* and *pmincol* " +"specify the upper-left corner of the rectangle to be displayed in the pad. " +"*sminrow*, *smincol*, *smaxrow*, and *smaxcol* specify the edges of the " +"rectangle to be displayed on the screen. The lower-right corner of the " +"rectangle to be displayed in the pad is calculated from the screen " +"coordinates, since the rectangles must be the same size. Both rectangles must " +"be entirely contained within their respective structures. Negative values of " +"*pminrow*, *pmincol*, *sminrow*, or *smincol* are treated as if they were zero." +msgstr "" +"این ۶ آرگومان فقط زمانی می‌توانند مشخص شوند، و در آن صورت الزامی هستند، که " +"پنجره یک پد (pad) باشد که با :func:`newpad` ایجاد شده است. پارامترهای اضافی " +"برای مشخص‌کردن اینکه چه بخشی از پد و صفحه درگیر است، لازم هستند. *pminrow* و " +"*pmincol* گوشه‌ی بالا سمت چپ مستطیلی را که باید در پد نمایش داده شود مشخص " +"می‌کنند. *sminrow*، *smincol*، *smaxrow* و *smaxcol* لبه‌های مستطیلی را که باید " +"روی صفحه نمایش داده شود مشخص می‌کنند. گوشه‌ی پایین سمت راست مستطیلی که باید در پد " +"نمایش داده شود، از مختصات صفحه محاسبه می‌شود، زیرا اندازه‌ی مستطیل‌ها باید یکسان " +"باشد. هر دو مستطیل باید به‌طور کامل درون ساختارهای مربوط به خود قرار داشته " +"باشند. مقادیر منفی *pminrow*، *pmincol*، *sminrow* یا *smincol* به‌عنوان صفر در " +"نظر گرفته می‌شوند." -msgid "Reallocate storage for a curses window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition (as set by :meth:`bkgdset`) merged into them." +msgid "" +"Reallocate storage for a curses window to adjust its dimensions to the " +"specified values. If either dimension is larger than the current values, the " +"window's data is filled with blanks that have the current background rendition " +"(as set by :meth:`bkgdset`) merged into them." msgstr "" +"فضای ذخیره‌سازی برای یک پنجره curses را دوباره تخصیص می‌دهد تا ابعاد آن با " +"مقادیر مشخص‌شده تنظیم شود. اگر هر یک از ابعاد بزرگ‌تر از مقادیر فعلی باشد، " +"داده‌های پنجره با نویسه‌های خالی پر می‌شوند که جلوه پس‌زمینه فعلی (که " +"با :meth:`bkgdset` تنظیم شده است) در آن‌ها ادغام شده است." -msgid "Scroll the screen or scrolling region. Scroll upward by *lines* lines if *lines* is positive, or downward if it is negative. Scrolling has no effect unless it has been enabled for the window with :meth:`scrollok`." +msgid "" +"Scroll the screen or scrolling region. Scroll upward by *lines* lines if " +"*lines* is positive, or downward if it is negative. Scrolling has no effect " +"unless it has been enabled for the window with :meth:`scrollok`." msgstr "" +"صفحه یا ناحیه‌ی پیمایش را پیمایش می‌کند. اگر *lines* مثبت باشد، به اندازه‌ی " +"*lines* خط به بالا پیمایش می‌شود و اگر منفی باشد، به پایین پیمایش می‌شود. پیمایش " +"هیچ اثری ندارد مگر اینکه با :meth:`scrollok` برای پنجره فعال شده باشد." -msgid "Control what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If *flag* is ``False``, the cursor is left on the bottom line. If *flag* is ``True``, the window is scrolled up one line. Note that in order to get the physical scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." -msgstr "" +msgid "" +"Control what happens when the cursor of a window is moved off the edge of the " +"window or scrolling region, either as a result of a newline action on the " +"bottom line, or typing the last character of the last line. If *flag* is " +"``False``, the cursor is left on the bottom line. If *flag* is ``True``, the " +"window is scrolled up one line. Note that in order to get the physical " +"scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." +msgstr "" +"کنترل کنید که وقتی مکان‌نمای یک پنجره از لبه‌ی پنجره یا ناحیه‌ی پیمایش خارج می‌شود، " +"چه اتفاقی رخ می‌دهد؛ خواه در نتیجه‌ی یک عمل خط جدید روی خط پایین، خواه با تایپ " +"آخرین نویسه‌ی خط آخر. اگر *flag* برابر ``False`` باشد، مکان‌نما روی خط پایین باقی " +"می‌ماند. اگر *flag* برابر ``True`` باشد، پنجره یک خط به بالا پیمایش می‌شود. توجه " +"داشته باشید که برای دریافت اثر پیمایش فیزیکی روی پایانه، لازم " +"است :meth:`idlok` نیز فراخوانی شود." -msgid "Set the scrolling region from line *top* to line *bottom*. All scrolling actions will take place in this region." +msgid "" +"Set the scrolling region from line *top* to line *bottom*. All scrolling " +"actions will take place in this region." msgstr "" +"ناحیه‌ی پیمایش را از خط *top* تا خط *bottom* تنظیم کنید. تمام عملیات‌های پیمایش " +"در این ناحیه انجام خواهند شد." -msgid "Turn off the standout attribute. On some terminals this has the side effect of turning off all attributes." +msgid "" +"Turn off the standout attribute. On some terminals this has the side effect " +"of turning off all attributes." msgstr "" +"ویژگی standout را خاموش کنید. در برخی پایانه‌ها، این کار به‌عنوان اثر جانبی، " +"تمام ویژگی‌ها را خاموش می‌کند." msgid "Turn on attribute *A_STANDOUT*." -msgstr "" +msgstr "ویژگی *A_STANDOUT* را روشن کنید." -msgid "Return a sub-pad, whose upper-left corner is at ``(begin_y, begin_x)``, and whose width/height is *ncols*/*nlines*. The coordinates are relative to the parent pad (unlike :meth:`subwin`, which uses screen coordinates). This method is only available for pads created with :func:`newpad`." +msgid "" +"Return a sub-pad, whose upper-left corner is at ``(begin_y, begin_x)``, and " +"whose width/height is *ncols*/*nlines*. The coordinates are relative to the " +"parent pad (unlike :meth:`subwin`, which uses screen coordinates). This " +"method is only available for pads created with :func:`newpad`." msgstr "" +"یک زیرپد (sub-pad) برمی‌گرداند که گوشه‌ی بالا-چپ آن در ``(begin_y, begin_x)`` " +"قرار دارد و عرض/ارتفاع آن *ncols*/*nlines* است. مختصات نسبت به پد والد است " +"(برخلاف :meth:`subwin`، که از مختصات صفحه استفاده می‌کند). این متد فقط برای " +"پدهای ایجادشده با :func:`newpad` در دسترس است." -msgid "Return a sub-window, whose upper-left corner is at the screen-relative coordinates ``(begin_y, begin_x)``, and whose width/height is *ncols*/*nlines*." +msgid "" +"Return a sub-window, whose upper-left corner is at the screen-relative " +"coordinates ``(begin_y, begin_x)``, and whose width/height is *ncols*/*nlines*." msgstr "" +"یک زیرپنجره را برمی‌گرداند که گوشه‌ی بالا-چپ آن در مختصات نسبت به صفحه‌ی نمایش " +"``(begin_y, begin_x)`` قرار دارد و عرض/ارتفاع آن *ncols*/*nlines* است." -msgid "By default, the sub-window will extend from the specified position to the lower right corner of the window." +msgid "" +"By default, the sub-window will extend from the specified position to the " +"lower right corner of the window." msgstr "" +"به‌طور پیش‌فرض، زیرپنجره از موقعیت مشخص‌شده تا گوشه‌ی پایین سمت راست پنجره امتداد " +"خواهد یافت." -msgid "Touch each location in the window that has been touched in any of its ancestor windows. This routine is called by :meth:`refresh`, so it should almost never be necessary to call it manually." +msgid "" +"Touch each location in the window that has been touched in any of its ancestor " +"windows. This routine is called by :meth:`refresh`, so it should almost never " +"be necessary to call it manually." msgstr "" +"هر موقعیت در پنجره را که در هر یک از پنجره‌های نیاکان آن لمس شده باشد، لمس " +"کنید. این روال توسط :meth:`refresh` فراخوانی می‌شود، بنابراین تقریباً هرگز نباید " +"لازم باشد آن را به‌صورت دستی فراخوانی کنید." -msgid "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever there is a change in the window." +msgid "" +"If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " +"there is a change in the window." msgstr "" +"اگر *flag* برابر ``True`` باشد، :meth:`syncup` به‌طور خودکار هر زمان که تغییری " +"در پنجره وجود داشته باشد فراخوانی می‌شود." -msgid "Touch all locations in ancestors of the window that have been changed in the window." +msgid "" +"Touch all locations in ancestors of the window that have been changed in the " +"window." msgstr "" +"تمام مکان‌های موجود در نیاکان پنجره را که در پنجره تغییر کرده‌اند، لمس کنید." -msgid "Set blocking or non-blocking read behavior for the window. If *delay* is negative, blocking read is used (which will wait indefinitely for input). If *delay* is zero, then non-blocking read is used, and :meth:`getch` will return ``-1`` if no input is waiting. If *delay* is positive, then :meth:`getch` will block for *delay* milliseconds, and return ``-1`` if there is still no input at the end of that time." -msgstr "" +msgid "" +"Set blocking or non-blocking read behavior for the window. If *delay* is " +"negative, blocking read is used (which will wait indefinitely for input). If " +"*delay* is zero, then non-blocking read is used, and :meth:`getch` will return " +"``-1`` if no input is waiting. If *delay* is positive, then :meth:`getch` " +"will block for *delay* milliseconds, and return ``-1`` if there is still no " +"input at the end of that time." +msgstr "" +"تنظیم رفتار خواندن مسدودکننده یا غیرمسدودکننده برای پنجره. اگر *delay* منفی " +"باشد، از خواندن مسدودکننده استفاده می‌شود (که به‌طور نامحدود برای ورودی منتظر " +"می‌ماند). اگر *delay* صفر باشد، از خواندن غیرمسدودکننده استفاده می‌شود " +"و :meth:`getch` در صورتی که هیچ ورودی در انتظار نباشد، ``-1`` را برمی‌گرداند. " +"اگر *delay* مثبت باشد، :meth:`getch` به مدت *delay* میلی‌ثانیه مسدود می‌شود و " +"اگر در پایان آن زمان هنوز ورودی وجود نداشته باشد، ``-1`` را برمی‌گرداند." -msgid "Pretend *count* lines have been changed, starting with line *start*. If *changed* is supplied, it specifies whether the affected lines are marked as having been changed (*changed*\\ ``=True``) or unchanged (*changed*\\ ``=False``)." +msgid "" +"Pretend *count* lines have been changed, starting with line *start*. If " +"*changed* is supplied, it specifies whether the affected lines are marked as " +"having been changed (*changed*\\ ``=True``) or unchanged (*changed*\\ " +"``=False``)." msgstr "" +"فرض کنید *count* خط با شروع از خط *start* تغییر کرده‌اند. اگر *changed* ارائه " +"شود، مشخص می‌کند که خطوط متأثر به‌عنوان تغییر یافته علامت‌گذاری شده‌اند " +"(*changed*\\ ``=True``) یا بدون تغییر علامت‌گذاری شده‌اند (*changed*\\ " +"``=False``)." -msgid "Pretend the whole window has been changed, for purposes of drawing optimizations." -msgstr "" +msgid "" +"Pretend the whole window has been changed, for purposes of drawing " +"optimizations." +msgstr "برای بهینه‌سازی ترسیم، فرض کنید کل پنجره تغییر کرده است." -msgid "Mark all lines in the window as unchanged since the last call to :meth:`refresh`." +msgid "" +"Mark all lines in the window as unchanged since the last call " +"to :meth:`refresh`." msgstr "" +"تمام خطوط پنجره را از آخرین فراخوانی :meth:`refresh` به‌عنوان بدون تغییر " +"علامت‌گذاری می‌کند." -msgid "Display a vertical line starting at ``(y, x)`` with length *n* consisting of the character *ch* with attributes *attr*." +msgid "" +"Display a vertical line starting at ``(y, x)`` with length *n* consisting of " +"the character *ch* with attributes *attr*." msgstr "" +"یک خط عمودی را از ``(y, x)`` با طول *n* نمایش می‌دهد که از نویسه‌ی *ch* با " +"ویژگی‌های *attr* تشکیل شده است." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" msgid "The :mod:`!curses` module defines the following data members:" -msgstr "" +msgstr "ماژول :mod:`!curses` اعضای داده‌ای زیر را تعریف می‌کند:" -msgid "Some curses routines that return an integer, such as :meth:`~window.getch`, return :const:`ERR` upon failure." +msgid "" +"Some curses routines that return an integer, such as :meth:`~window.getch`, " +"return :const:`ERR` upon failure." msgstr "" +"برخی از روال‌های curses که عدد صحیحی برمی‌گردانند، مانند :meth:`~window.getch`، " +"در صورت شکست :const:`ERR` را برمی‌گردانند." -msgid "Some curses routines that return an integer, such as :func:`napms`, return :const:`OK` upon success." +msgid "" +"Some curses routines that return an integer, such as :func:`napms`, " +"return :const:`OK` upon success." msgstr "" +"برخی روتین‌های curses که یک عدد صحیح برمی‌گردانند، مانند :func:`napms`، در صورت " +"موفقیت :const:`OK` را برمی‌گردانند." msgid "A bytes object representing the current version of the module." -msgstr "" +msgstr "یک شیء bytes که نسخه‌ی فعلی ماژول را نشان می‌دهد." -msgid "A named tuple containing the three components of the ncurses library version: *major*, *minor*, and *patch*. All values are integers. The components can also be accessed by name, so ``curses.ncurses_version[0]`` is equivalent to ``curses.ncurses_version.major`` and so on." +msgid "" +"A named tuple containing the three components of the ncurses library version: " +"*major*, *minor*, and *patch*. All values are integers. The components can " +"also be accessed by name, so ``curses.ncurses_version[0]`` is equivalent to " +"``curses.ncurses_version.major`` and so on." msgstr "" +"یک تاپل نام‌دار (named tuple) شامل سه کامپوننت از نسخه‌ی کتابخانه‌ی ncurses: " +"*major*، *minor* و *patch*. همه‌ی مقدارها عدد صحیح هستند. همچنین می‌توان به این " +"کامپوننت‌ها با نام دسترسی داشت، بنابراین ``curses.ncurses_version[0]`` معادل " +"``curses.ncurses_version.major`` است و به همین ترتیب." msgid "Availability: if the ncurses library is used." -msgstr "" +msgstr "دسترس‌پذیری: اگر از کتابخانه ncurses استفاده شود." -msgid "The maximum number of colors the terminal can support. It is defined only after the call to :func:`start_color`." +msgid "" +"The maximum number of colors the terminal can support. It is defined only " +"after the call to :func:`start_color`." msgstr "" +"حداکثر تعداد رنگ‌هایی که پایانه می‌تواند از آن‌ها پشتیبانی کند. این مقدار فقط پس " +"از فراخوانی :func:`start_color` تعریف می‌شود." -msgid "The maximum number of color pairs the terminal can support. It is defined only after the call to :func:`start_color`." +msgid "" +"The maximum number of color pairs the terminal can support. It is defined only " +"after the call to :func:`start_color`." msgstr "" +"حداکثر تعداد جفت‌های رنگی که پایانه می‌تواند از آن‌ها پشتیبانی کند. این مقدار فقط " +"پس از فراخوانی :func:`start_color` تعریف می‌شود." -msgid "The width of the screen, that is, the number of columns. It is defined only after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." +msgid "" +"The width of the screen, that is, the number of columns. It is defined only " +"after the call to :func:`initscr`. Updated " +"by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." msgstr "" +"عرض صفحه، یعنی تعداد ستون‌ها. این مقدار فقط پس از فراخوانی :func:`initscr` " +"تعریف می‌شود. توسط :func:`update_lines_cols`، :func:`resizeterm` " +"و :func:`resize_term` به‌روزرسانی می‌شود." -msgid "The height of the screen, that is, the number of lines. It is defined only after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." +msgid "" +"The height of the screen, that is, the number of lines. It is defined only " +"after the call to :func:`initscr`. Updated " +"by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." msgstr "" +"ارتفاع صفحه، یعنی تعداد خطوط. این مقدار تنها پس از فراخوانی :func:`initscr` " +"تعریف می‌شود. توسط :func:`update_lines_cols`، :func:`resizeterm` " +"و :func:`resize_term` به‌روزرسانی می‌شود." -msgid "Some constants are available to specify character cell attributes. The exact constants available are system dependent." +msgid "" +"Some constants are available to specify character cell attributes. The exact " +"constants available are system dependent." msgstr "" +"برخی ثابت‌ها برای تعیین ویژگی‌های سلول نویسه در دسترس هستند. ثابت‌های دقیقی که در " +"دسترس هستند، به سیستم وابسته‌اند." msgid "Attribute" -msgstr "" +msgstr "ویژگی" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Alternate character set mode" -msgstr "" +msgstr "حالت مجموعه‌نویسه‌ی جایگزین" msgid "Blink mode" -msgstr "" +msgstr "حالت چشمک‌زن" msgid "Bold mode" -msgstr "" +msgstr "حالت پررنگ" msgid "Dim mode" -msgstr "" +msgstr "حالت کم‌نور" msgid "Invisible or blank mode" -msgstr "" +msgstr "حالت نامرئی یا خالی" msgid "Italic mode" -msgstr "" +msgstr "حالت کج" msgid "Normal attribute" -msgstr "" +msgstr "ویژگی عادی" msgid "Protected mode" -msgstr "" +msgstr "حالت محافظت‌شده" msgid "Reverse background and foreground colors" -msgstr "" +msgstr "معکوس کردن رنگ‌های پس‌زمینه و پیش‌زمینه" msgid "Standout mode" -msgstr "" +msgstr "حالت برجسته (Standout mode)" msgid "Underline mode" -msgstr "" +msgstr "حالت زیرخط" msgid "Horizontal highlight" -msgstr "" +msgstr "برجسته‌سازی افقی" msgid "Left highlight" -msgstr "" +msgstr "برجسته‌سازی سمت چپ" msgid "Low highlight" -msgstr "" +msgstr "برجسته‌سازی کم" msgid "Right highlight" -msgstr "" +msgstr "برجسته‌سازی راست" msgid "Top highlight" -msgstr "" +msgstr "برجسته‌سازی بالا" msgid "Vertical highlight" -msgstr "" +msgstr "برجسته‌سازی عمودی" msgid "``A_ITALIC`` was added." -msgstr "" +msgstr "``A_ITALIC`` افزوده شد." -msgid "Several constants are available to extract corresponding attributes returned by some methods." +msgid "" +"Several constants are available to extract corresponding attributes returned " +"by some methods." msgstr "" +"چندین ثابت برای استخراج ویژگی‌های متناظری که توسط برخی متدها برگردانده می‌شوند، " +"در دسترس هستند." msgid "Bit-mask" -msgstr "" +msgstr "ماسک بیتی" msgid "Bit-mask to extract attributes" -msgstr "" +msgstr "ماسک بیتی (bit-mask) برای استخراج ویژگی‌ها" msgid "Bit-mask to extract a character" -msgstr "" +msgstr "ماسک بیتی برای استخراج یک نویسه" msgid "Bit-mask to extract color-pair field information" -msgstr "" +msgstr "نقاب بیتی (bit-mask) برای استخراج اطلاعات فیلد جفت‌رنگ" -msgid "Keys are referred to by integer constants with names starting with ``KEY_``. The exact keycaps available are system dependent." +msgid "" +"Keys are referred to by integer constants with names starting with ``KEY_``. " +"The exact keycaps available are system dependent." msgstr "" +"کلیدها با ثابت‌های عدد صحیح با نام‌هایی که با ``KEY_`` آغاز می‌شوند، ارجاع داده " +"می‌شوند. کلیدهای دقیق موجود، به سیستم وابسته‌اند." msgid "Key constant" -msgstr "" +msgstr "ثابت کلید" msgid "Key" -msgstr "" +msgstr "کلید" msgid "Minimum key value" -msgstr "" +msgstr "کمینه مقدار کلید" msgid "Break key (unreliable)" -msgstr "" +msgstr "کلید Break (غیرقابل‌اعتماد)" msgid "Down-arrow" -msgstr "" +msgstr "فلش پایین" msgid "Up-arrow" -msgstr "" +msgstr "فلش بالا" msgid "Left-arrow" -msgstr "" +msgstr "پیکان چپ" msgid "Right-arrow" -msgstr "" +msgstr "فلش راست" msgid "Home key (upward+left arrow)" -msgstr "" +msgstr "کلید Home (فلش بالا+چپ)" msgid "Backspace (unreliable)" -msgstr "" +msgstr "پس‌بر (غیرقابل‌اطمینان)" msgid "Function keys. Up to 64 function keys are supported." -msgstr "" +msgstr "کلیدهای تابعی. تا ۶۴ کلید تابعی پشتیبانی می‌شود." msgid "Value of function key *n*" -msgstr "" +msgstr "مقدار کلید تابعی *n*" msgid "Delete line" -msgstr "" +msgstr "حذف خط" msgid "Insert line" -msgstr "" +msgstr "درج خط" msgid "Delete character" -msgstr "" +msgstr "نویسه‌ی حذف" msgid "Insert char or enter insert mode" -msgstr "" +msgstr "درج نویسه یا ورود به حالت درج" msgid "Exit insert char mode" -msgstr "" +msgstr "خروج از حالت درج نویسه" msgid "Clear screen" -msgstr "" +msgstr "پاک‌کردن صفحه" msgid "Clear to end of screen" -msgstr "" +msgstr "پاک کردن تا انتهای صفحه" msgid "Clear to end of line" -msgstr "" +msgstr "پاک‌سازی تا انتهای خط" msgid "Scroll 1 line forward" -msgstr "" +msgstr "پیمایش ۱ خط به جلو" msgid "Scroll 1 line backward (reverse)" -msgstr "" +msgstr "پیمایش ۱ خط به عقب (معکوس)" msgid "Next page" -msgstr "" +msgstr "صفحه بعدی" msgid "Previous page" -msgstr "" +msgstr "صفحه قبلی" msgid "Set tab" -msgstr "" +msgstr "تنظیم زبانه" msgid "Clear tab" -msgstr "" +msgstr "پاک‌کردن زبانه" msgid "Clear all tabs" -msgstr "" +msgstr "پاک کردن همه زبانه‌ها" msgid "Enter or send (unreliable)" -msgstr "" +msgstr "Enter یا ارسال (غیرقابل‌اعتماد)" msgid "Soft (partial) reset (unreliable)" -msgstr "" +msgstr "بازنشانی نرم (جزئی) (غیرقابل‌اطمینان)" msgid "Reset or hard reset (unreliable)" -msgstr "" +msgstr "بازنشانی یا بازنشانی سخت (غیرقابل‌اطمینان)" msgid "Print" -msgstr "" +msgstr "چاپ" msgid "Home down or bottom (lower left)" -msgstr "" +msgstr "Home down یا bottom (پایین سمت چپ)" msgid "Upper left of keypad" -msgstr "" +msgstr "بالا سمت چپ صفحه‌کلید" msgid "Upper right of keypad" -msgstr "" +msgstr "بالا سمت راست صفحه‌کلید" msgid "Center of keypad" -msgstr "" +msgstr "مرکز صفحه‌کلید عددی" msgid "Lower left of keypad" -msgstr "" +msgstr "پایین سمت چپ صفحه‌کلید عددی" msgid "Lower right of keypad" -msgstr "" +msgstr "پایین سمت راست صفحه‌کلید عددی" msgid "Back tab" -msgstr "" +msgstr "تب معکوس (Back tab)" msgid "Beg (beginning)" -msgstr "" +msgstr "Beg (آغاز)" msgid "Cancel" -msgstr "" +msgstr "لغو" msgid "Close" -msgstr "" +msgstr "بستن" msgid "Cmd (command)" -msgstr "" +msgstr "Cmd (فرمان)" msgid "Copy" -msgstr "" +msgstr "کپی" msgid "Create" -msgstr "" +msgstr "ایجاد" msgid "End" -msgstr "" +msgstr "پایان" msgid "Exit" -msgstr "" +msgstr "خروج" msgid "Find" -msgstr "" +msgstr "یافتن" msgid "Help" -msgstr "" +msgstr "راهنما" msgid "Mark" -msgstr "" +msgstr "نشانه" msgid "Message" -msgstr "" +msgstr "پیام" msgid "Move" -msgstr "" +msgstr "انتقال" msgid "Next" -msgstr "" +msgstr "بعدی" msgid "Open" -msgstr "" +msgstr "باز کردن" msgid "Options" -msgstr "" +msgstr "گزینه‌ها" msgid "Prev (previous)" -msgstr "" +msgstr "قبلی (پیشین)" msgid "Redo" -msgstr "" +msgstr "بازانجام" msgid "Ref (reference)" -msgstr "" +msgstr "مرجع (reference)" msgid "Refresh" -msgstr "" +msgstr "تازه‌سازی" msgid "Replace" -msgstr "" +msgstr "جایگزینی" msgid "Restart" -msgstr "" +msgstr "راه‌اندازی مجدد" msgid "Resume" -msgstr "" +msgstr "از سرگیری" msgid "Save" -msgstr "" +msgstr "ذخیره" msgid "Shifted Beg (beginning)" -msgstr "" +msgstr "آغاز جابه‌جاشده (Beg)" msgid "Shifted Cancel" -msgstr "" +msgstr "لغو با Shift" msgid "Shifted Command" -msgstr "" +msgstr "Command همراه با Shift" msgid "Shifted Copy" -msgstr "" +msgstr "کپی جابه‌جا شده" msgid "Shifted Create" -msgstr "" +msgstr "ایجاد با شیفت" msgid "Shifted Delete char" -msgstr "" +msgstr "حذف نویسه با Shift" msgid "Shifted Delete line" -msgstr "" +msgstr "حذف خط با Shift" msgid "Select" -msgstr "" +msgstr "انتخاب" msgid "Shifted End" -msgstr "" +msgstr "End شیفت‌شده" msgid "Shifted Clear line" -msgstr "" +msgstr "پاک‌کردن خط با Shift" msgid "Shifted Exit" -msgstr "" +msgstr "خروج شیفت‌شده" msgid "Shifted Find" -msgstr "" +msgstr "جستجوی Shiftدار" msgid "Shifted Help" -msgstr "" +msgstr "راهنمای شیفت‌شده" msgid "Shifted Home" -msgstr "" +msgstr "Home با Shift" msgid "Shifted Input" -msgstr "" +msgstr "ورودی شیفت‌شده" msgid "Shifted Left arrow" -msgstr "" +msgstr "پیکان چپ همراه با Shift" msgid "Shifted Message" -msgstr "" +msgstr "پیام جابه‌جاشده" msgid "Shifted Move" -msgstr "" +msgstr "جابه‌جایی شیفت‌شده" msgid "Shifted Next" -msgstr "" +msgstr "بعدی شیفت‌شده" msgid "Shifted Options" -msgstr "" +msgstr "گزینه‌های جابه‌جاشده" msgid "Shifted Prev" -msgstr "" +msgstr "شیفت‌شده‌ی قبلی" msgid "Shifted Print" -msgstr "" +msgstr "چاپ شیفت‌شده" msgid "Shifted Redo" -msgstr "" +msgstr "انجام دوباره با Shift" msgid "Shifted Replace" -msgstr "" +msgstr "جایگزینی با Shift" msgid "Shifted Right arrow" -msgstr "" +msgstr "پیکان راست شیفت‌شده" msgid "Shifted Resume" -msgstr "" +msgstr "ازسرگیری جابه‌جاشده" msgid "Shifted Save" -msgstr "" +msgstr "ذخیره با Shift" msgid "Shifted Suspend" -msgstr "" +msgstr "تعلیق شیفت‌شده" msgid "Shifted Undo" -msgstr "" +msgstr "واگرد جابه‌جاشده (Shifted Undo)" msgid "Suspend" -msgstr "" +msgstr "تعلیق" msgid "Undo" -msgstr "" +msgstr "واگرد" msgid "Mouse event has occurred" -msgstr "" +msgstr "رویداد ماوس رخ داده است" msgid "Terminal resize event" -msgstr "" +msgstr "رویداد تغییر اندازه‌ی پایانه" msgid "Maximum key value" -msgstr "" +msgstr "حداکثر مقدار کلید" -msgid "On VT100s and their software emulations, such as X terminal emulators, there are normally at least four function keys (:const:`KEY_F1 `, :const:`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 `) available, and the arrow keys mapped to :const:`KEY_UP`, :const:`KEY_DOWN`, :const:`KEY_LEFT` and :const:`KEY_RIGHT` in the obvious way. If your machine has a PC keyboard, it is safe to expect arrow keys and twelve function keys (older PC keyboards may have only ten function keys); also, the following keypad mappings are standard:" -msgstr "" +msgid "" +"On VT100s and their software emulations, such as X terminal emulators, there " +"are normally at least four function keys (:const:`KEY_F1 " +"`, :const:`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 " +"`) available, and the arrow keys mapped " +"to :const:`KEY_UP`, :const:`KEY_DOWN`, :const:`KEY_LEFT` " +"and :const:`KEY_RIGHT` in the obvious way. If your machine has a PC keyboard, " +"it is safe to expect arrow keys and twelve function keys (older PC keyboards " +"may have only ten function keys); also, the following keypad mappings are " +"standard:" +msgstr "" +"در پایانه‌های VT100 و شبیه‌سازی‌های نرم‌افزاری آن‌ها، مانند شبیه‌سازهای پایانه X، " +"معمولاً حداقل چهار کلید تابع (:const:`KEY_F1 `، :const:`KEY_F2 " +"`، :const:`KEY_F3 `، :const:`KEY_F4 `) در دسترس هستند " +"و کلیدهای جهت به‌شکل بدیهی " +"به :const:`KEY_UP`، :const:`KEY_DOWN`، :const:`KEY_LEFT` و :const:`KEY_RIGHT` " +"نگاشته شده‌اند. اگر رایانه شما صفحه‌کلید PC دارد، می‌توانید با اطمینان انتظار " +"داشته باشید که کلیدهای جهت و دوازده کلید تابع وجود داشته باشند (صفحه‌کلیدهای " +"قدیمی PC ممکن است تنها ده کلید تابع داشته باشند)؛ همچنین، نگاشت‌های صفحه‌کلید " +"عددی زیر استاندارد هستند:" msgid "Keycap" -msgstr "" +msgstr "کلید" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid ":kbd:`Insert`" -msgstr "" +msgstr ":kbd:`Insert`" msgid "KEY_IC" -msgstr "" +msgstr "KEY_IC" msgid ":kbd:`Delete`" -msgstr "" +msgstr ":kbd:`Delete`" msgid "KEY_DC" -msgstr "" +msgstr "KEY_DC" msgid ":kbd:`Home`" -msgstr "" +msgstr ":kbd:`Home`" msgid "KEY_HOME" -msgstr "" +msgstr "KEY_HOME" msgid ":kbd:`End`" -msgstr "" +msgstr ":kbd:`End`" msgid "KEY_END" -msgstr "" +msgstr "KEY_END" msgid ":kbd:`Page Up`" -msgstr "" +msgstr ":kbd:`Page Up`" msgid "KEY_PPAGE" -msgstr "" +msgstr "KEY_PPAGE" msgid ":kbd:`Page Down`" -msgstr "" +msgstr ":kbd:`Page Down`" msgid "KEY_NPAGE" -msgstr "" +msgstr "KEY_NPAGE" -msgid "The following table lists characters from the alternate character set. These are inherited from the VT100 terminal, and will generally be available on software emulations such as X terminals. When there is no graphic available, curses falls back on a crude printable ASCII approximation." +msgid "" +"The following table lists characters from the alternate character set. These " +"are inherited from the VT100 terminal, and will generally be available on " +"software emulations such as X terminals. When there is no graphic available, " +"curses falls back on a crude printable ASCII approximation." msgstr "" +"جدول زیر نویسه‌های مجموعه نویسه جایگزین را فهرست می‌کند. این نویسه‌ها از پایانه " +"VT100 به ارث رسیده‌اند و معمولاً در شبیه‌سازی‌های نرم‌افزاری مانند پایانه‌های X در " +"دسترس خواهند بود. هنگامی که هیچ گرافیکی در دسترس نباشد، curses به یک تقریب خام " +"ASCII قابل‌چاپ برمی‌گردد." msgid "These are available only after :func:`initscr` has been called." -msgstr "" +msgstr "این موارد تنها پس از فراخوانی :func:`initscr` در دسترس هستند." msgid "ACS code" -msgstr "" +msgstr "کد ACS" msgid "alternate name for upper-right corner" -msgstr "" +msgstr "نام جایگزین برای گوشه‌ی بالا سمت راست" msgid "solid square block" -msgstr "" +msgstr "بلوک مربعی توپر" msgid "board of squares" -msgstr "" +msgstr "صفحه‌ای از مربع‌ها" msgid "alternate name for horizontal line" -msgstr "" +msgstr "نام جایگزین برای خط افقی" msgid "alternate name for upper-left corner" -msgstr "" +msgstr "نام جایگزین برای گوشه‌ی بالا سمت چپ" msgid "alternate name for top tee" -msgstr "" +msgstr "نام جایگزین برای T بالایی (top tee)" msgid "bottom tee" -msgstr "" +msgstr "tee پایین (bottom tee)" msgid "bullet" -msgstr "" +msgstr "بولت (bullet)" msgid "checker board (stipple)" -msgstr "" +msgstr "صفحه شطرنجی (stipple)" msgid "arrow pointing down" -msgstr "" +msgstr "فلش رو به پایین" msgid "degree symbol" -msgstr "" +msgstr "نماد درجه" msgid "diamond" -msgstr "" +msgstr "لوزی" msgid "greater-than-or-equal-to" -msgstr "" +msgstr "بزرگ‌تر یا مساوی" msgid "horizontal line" -msgstr "" +msgstr "خط افقی" msgid "lantern symbol" -msgstr "" +msgstr "نماد فانوس" msgid "left arrow" -msgstr "" +msgstr "پیکان چپ" msgid "less-than-or-equal-to" -msgstr "" +msgstr "کمتر یا مساوی" msgid "lower-left corner" -msgstr "" +msgstr "گوشه‌ی پایین سمت چپ" msgid "lower-right corner" -msgstr "" +msgstr "گوشه‌ی پایین-راست" msgid "left tee" -msgstr "" +msgstr "تی چپ (left tee)" msgid "not-equal sign" -msgstr "" +msgstr "علامت نابرابر" msgid "letter pi" -msgstr "" +msgstr "حرف پی" msgid "plus-or-minus sign" -msgstr "" +msgstr "علامت مثبت-منفی" msgid "big plus sign" -msgstr "" +msgstr "علامت جمع بزرگ" msgid "right arrow" -msgstr "" +msgstr "فلش راست" msgid "right tee" -msgstr "" +msgstr "تی راست (right tee)" msgid "scan line 1" -msgstr "" +msgstr "خط پویش ۱" msgid "scan line 3" -msgstr "" +msgstr "خط پویش ۳" msgid "scan line 7" -msgstr "" +msgstr "پویش خط ۷" msgid "scan line 9" -msgstr "" +msgstr "خط پویش ۹" msgid "alternate name for lower-right corner" -msgstr "" +msgstr "نام جایگزین برای گوشه پایین راست" msgid "alternate name for vertical line" -msgstr "" +msgstr "نام جایگزین برای خط عمودی" msgid "alternate name for right tee" -msgstr "" +msgstr "نام جایگزین برای right tee" msgid "alternate name for lower-left corner" -msgstr "" +msgstr "نام جایگزین برای گوشه‌ی پایین چپ" msgid "alternate name for bottom tee" -msgstr "" +msgstr "نام جایگزین برای tee پایین (bottom tee)" msgid "alternate name for left tee" -msgstr "" +msgstr "نام جایگزین برای تی چپ (left tee)" msgid "alternate name for crossover or big plus" -msgstr "" +msgstr "نام جایگزین برای تقاطع (crossover) یا به‌علاوه‌ی بزرگ (big plus)" msgid "pound sterling" -msgstr "" +msgstr "پوند استرلینگ" msgid "top tee" -msgstr "" +msgstr "top tee" msgid "up arrow" -msgstr "" +msgstr "پیکان بالا" msgid "upper-left corner" -msgstr "" +msgstr "گوشه‌ی بالا-چپ" msgid "upper-right corner" -msgstr "" +msgstr "گوشه‌ی بالا-راست" msgid "vertical line" -msgstr "" +msgstr "خط عمودی" -msgid "The following table lists mouse button constants used by :meth:`getmouse`:" +msgid "" +"The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" +"جدول زیر ثابت‌های دکمه‌ی ماوس را که توسط :meth:`getmouse` استفاده می‌شوند، فهرست " +"می‌کند:" msgid "Mouse button constant" -msgstr "" +msgstr "ثابت دکمه‌ی ماوس" msgid "Mouse button *n* pressed" -msgstr "" +msgstr "دکمه‌ی *n* ماوس فشرده شد" msgid "Mouse button *n* released" -msgstr "" +msgstr "دکمه‌ی ماوس *n* رها شد" msgid "Mouse button *n* clicked" -msgstr "" +msgstr "دکمه‌ی ماوس *n* کلیک شد" msgid "Mouse button *n* double clicked" -msgstr "" +msgstr "دکمه ماوس *n* دوبار کلیک شد" msgid "Mouse button *n* triple clicked" -msgstr "" +msgstr "دکمه‌ی ماوس *n* سه‌بار کلیک شد" msgid "Shift was down during button state change" -msgstr "" +msgstr "کلید Shift در حین تغییر وضعیت دکمه فشرده بود" msgid "Control was down during button state change" -msgstr "" +msgstr "کلید Control در حین تغییر وضعیت دکمه فشرده بود" msgid "Alt was down during button state change" -msgstr "" +msgstr "کلید Alt در حین تغییر وضعیت دکمه فشرده شده بود" msgid "The following table lists the predefined colors:" -msgstr "" +msgstr "جدول زیر رنگ‌های از پیش تعریف‌شده را فهرست می‌کند:" msgid "Color" -msgstr "" +msgstr "رنگ" msgid "Black" -msgstr "" +msgstr "Black" msgid "Blue" -msgstr "" +msgstr "آبی" msgid "Cyan (light greenish blue)" -msgstr "" +msgstr "فیروزه‌ای (آبی مایل به سبز روشن)" msgid "Green" -msgstr "" +msgstr "سبز" msgid "Magenta (purplish red)" -msgstr "" +msgstr "سرخابی (قرمز مایل به بنفش)" msgid "Red" -msgstr "" +msgstr "قرمز" msgid "White" -msgstr "" +msgstr "سفید" msgid "Yellow" -msgstr "" +msgstr "زرد" msgid ":mod:`!curses.textpad` --- Text input widget for curses programs" -msgstr "" +msgstr ":mod:`!curses.textpad` --- ابزارک ورودی متن برای برنامه‌های curses" -msgid "The :mod:`!curses.textpad` module provides a :class:`Textbox` class that handles elementary text editing in a curses window, supporting a set of keybindings resembling those of Emacs (thus, also of Netscape Navigator, BBedit 6.x, FrameMaker, and many other programs). The module also provides a rectangle-drawing function useful for framing text boxes or for other purposes." -msgstr "" +msgid "" +"The :mod:`!curses.textpad` module provides a :class:`Textbox` class that " +"handles elementary text editing in a curses window, supporting a set of " +"keybindings resembling those of Emacs (thus, also of Netscape Navigator, " +"BBedit 6.x, FrameMaker, and many other programs). The module also provides a " +"rectangle-drawing function useful for framing text boxes or for other purposes." +msgstr "" +"ماژول :mod:`!curses.textpad` کلاس :class:`Textbox` را فراهم می‌کند که ویرایش " +"مقدماتی متن را در یک پنجره curses مدیریت می‌کند و از مجموعه‌ای از اتصال‌های کلید " +"(keybindings) شبیه به Emacs پشتیبانی می‌کند (بنابراین، همچنین مانند Netscape " +"Navigator، BBedit 6.x، FrameMaker و بسیاری از برنامه‌های دیگر). این ماژول " +"همچنین تابعی برای رسم مستطیل ارائه می‌دهد که برای قاب‌گذاری جعبه‌های متنی یا سایر " +"مقاصد مفید است." msgid "The module :mod:`!curses.textpad` defines the following function:" -msgstr "" +msgstr "ماژول :mod:`!curses.textpad` تابع زیر را تعریف می‌کند:" -msgid "Draw a rectangle. The first argument must be a window object; the remaining arguments are coordinates relative to that window. The second and third arguments are the y and x coordinates of the upper-left corner of the rectangle to be drawn; the fourth and fifth arguments are the y and x coordinates of the lower-right corner. The rectangle will be drawn using VT100/IBM PC forms characters on terminals that make this possible (including xterm and most other software terminal emulators). Otherwise it will be drawn with ASCII dashes, vertical bars, and plus signs." -msgstr "" +msgid "" +"Draw a rectangle. The first argument must be a window object; the remaining " +"arguments are coordinates relative to that window. The second and third " +"arguments are the y and x coordinates of the upper-left corner of the " +"rectangle to be drawn; the fourth and fifth arguments are the y and x " +"coordinates of the lower-right corner. The rectangle will be drawn using VT100/" +"IBM PC forms characters on terminals that make this possible (including xterm " +"and most other software terminal emulators). Otherwise it will be drawn with " +"ASCII dashes, vertical bars, and plus signs." +msgstr "" +"یک مستطیل رسم می‌کند. اولین آرگومان باید یک شیء پنجره باشد؛ آرگومان‌های " +"باقی‌مانده مختصات نسبت به آن پنجره هستند. آرگومان‌های دوم و سوم مختصات y و x " +"گوشه‌ی بالا سمت چپ مستطیلی هستند که رسم می‌شود؛ آرگومان‌های چهارم و پنجم مختصات y " +"و x گوشه‌ی پایین سمت راست هستند. این مستطیل با استفاده از نویسه‌های فرم VT100/" +"IBM PC روی پایانه‌هایی که این امکان را فراهم می‌کنند (از جمله xterm و بیشتر " +"شبیه‌سازهای نرم‌افزاری پایانه دیگر) رسم خواهد شد. در غیر این صورت، با خط‌تیره‌ها، " +"خطوط عمودی و علامت‌های جمع ASCII رسم خواهد شد." msgid "Textbox objects" -msgstr "" +msgstr "اشیاء Textbox" msgid "You can instantiate a :class:`Textbox` object as follows:" -msgstr "" +msgstr "می‌توانید یک شیء :class:`Textbox` را به‌صورت زیر نمونه‌سازی کنید:" -msgid "Return a textbox widget object. The *win* argument should be a curses :ref:`window ` object in which the textbox is to be contained. If *insert_mode* is true, the textbox inserts typed characters, shifting existing text to the right, rather than overwriting it. The edit cursor of the textbox is initially located at the upper-left corner of the containing window, with coordinates ``(0, 0)``. The instance's :attr:`stripspaces` flag is initially on." -msgstr "" +msgid "" +"Return a textbox widget object. The *win* argument should be a " +"curses :ref:`window ` object in which the textbox is to " +"be contained. If *insert_mode* is true, the textbox inserts typed characters, " +"shifting existing text to the right, rather than overwriting it. The edit " +"cursor of the textbox is initially located at the upper-left corner of the " +"containing window, with coordinates ``(0, 0)``. The " +"instance's :attr:`stripspaces` flag is initially on." +msgstr "" +"یک شیء ابزارک جعبه‌متن را برمی‌گرداند. آرگومان *win* باید یک شیء :ref:`پنجره " +"` از curses باشد که جعبه‌متن در آن قرار گیرد. اگر " +"*insert_mode* درست باشد، جعبه‌متن به جای بازنویسی متن موجود، نویسه‌های تایپ‌شده " +"را درج می‌کند و متن موجود را به سمت راست جابه‌جا می‌کند. مکان‌نمای ویرایش جعبه‌متن " +"در ابتدا در گوشه‌ی بالا سمت چپ پنجره‌ی حاوی آن قرار دارد، با مختصات ``(0, 0)``. " +"پرچم :attr:`stripspaces` این نمونه در ابتدا روشن است." msgid ":class:`Textbox` objects have the following methods:" -msgstr "" +msgstr "شیءهای :class:`Textbox` متدهای زیر را دارند:" -msgid "This is the entry point you will normally use. It accepts editing keystrokes until one of the termination keystrokes is entered. If *validate* is supplied, it must be a function. It will be called for each keystroke entered with the keystroke as a parameter; command dispatch is done on the result. If it returns a false value, the keystroke is ignored. This method returns the window contents as a string; whether blanks in the window are included is affected by the :attr:`stripspaces` attribute." -msgstr "" +msgid "" +"This is the entry point you will normally use. It accepts editing keystrokes " +"until one of the termination keystrokes is entered. If *validate* is " +"supplied, it must be a function. It will be called for each keystroke entered " +"with the keystroke as a parameter; command dispatch is done on the result. If " +"it returns a false value, the keystroke is ignored. This method returns the " +"window contents as a string; whether blanks in the window are included is " +"affected by the :attr:`stripspaces` attribute." +msgstr "" +"این نقطه ورودی است که معمولاً از آن استفاده خواهید کرد. این نقطه ورود، کلیدهای " +"ویرایشی را تا زمانی می‌پذیرد که یکی از کلیدهای خاتمه فشرده شود. اگر *validate* " +"ارائه شده باشد، باید یک تابع باشد. این تابع برای هر کلید فشرده‌شده با همان کلید " +"به‌عنوان پارامتر فراخوانی می‌شود؛ توزیع فرمان بر اساس نتیجه انجام می‌شود. اگر " +"مقدار نادرستی برگرداند، کلید نادیده گرفته می‌شود. این متد محتوای پنجره را " +"به‌صورت یک رشته برمی‌گرداند؛ اینکه نویسه‌های خالی درون پنجره گنجانده شوند یا نه، " +"تحت تأثیر ویژگی :attr:`stripspaces` است." -msgid "Process a single command keystroke. Returns ``1`` to continue editing, or ``0`` if a termination keystroke was processed. Here are the supported special keystrokes:" +msgid "" +"Process a single command keystroke. Returns ``1`` to continue editing, or " +"``0`` if a termination keystroke was processed. Here are the supported " +"special keystrokes:" msgstr "" +"یک کلیدفشاری فرمانی را پردازش می‌کند. مقدار ``1`` را برای ادامه‌ی ویرایش " +"بازمی‌گرداند، یا اگر یک کلیدفشاری پایانی پردازش شده باشد، مقدار ``0`` را " +"بازمی‌گرداند. کلیدفشارهای ویژه‌ی پشتیبانی‌شده عبارت‌اند از:" msgid "Keystroke" -msgstr "" +msgstr "فشار کلید" msgid "Action" -msgstr "" +msgstr "عملیات" msgid ":kbd:`Control-A`" -msgstr "" +msgstr ":kbd:`Control-A`" msgid "Go to left edge of window." -msgstr "" +msgstr "به لبه‌ی چپ پنجره بروید." msgid ":kbd:`Control-B`" -msgstr "" +msgstr ":kbd:`Control-B`" msgid "Cursor left, wrapping to previous line if appropriate." -msgstr "" +msgstr "حرکت مکان‌نما به چپ، با انتقال به خط قبلی در صورت لزوم." msgid ":kbd:`Control-D`" -msgstr "" +msgstr ":kbd:`Control-D`" msgid "Delete character under cursor." -msgstr "" +msgstr "حذف نویسه‌ی زیر مکان‌نما." msgid ":kbd:`Control-E`" -msgstr "" +msgstr ":kbd:`Control-E`" msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" +"به لبه‌ی راست (در صورت خاموش بودن stripspaces) یا پایان خط (در صورت روشن بودن " +"stripspaces) بروید." msgid ":kbd:`Control-F`" -msgstr "" +msgstr ":kbd:`Control-F`" msgid "Cursor right, wrapping to next line when appropriate." -msgstr "" +msgstr "مکان‌نما به راست، در صورت لزوم به خط بعدی می‌رود." msgid ":kbd:`Control-G`" -msgstr "" +msgstr ":kbd:`Control-G`" msgid "Terminate, returning the window contents." -msgstr "" +msgstr "خاتمه دادن و برگرداندن محتوای پنجره." msgid ":kbd:`Control-H`" -msgstr "" +msgstr ":kbd:`Control-H`" msgid "Delete character backward." -msgstr "" +msgstr "حذف نویسه‌ی قبلی." msgid ":kbd:`Control-J`" -msgstr "" +msgstr ":kbd:`Control-J`" -msgid "Terminate if the window is 1 line, otherwise move to the start of the next line." +msgid "" +"Terminate if the window is 1 line, otherwise move to the start of the next " +"line." msgstr "" +"اگر پنجره ۱ خطی باشد، خاتمه می‌یابد؛ در غیر این صورت به ابتدای خط بعدی می‌رود." msgid ":kbd:`Control-K`" -msgstr "" +msgstr ":kbd:`Control-K`" msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" +"اگر خط خالی باشد، آن را حذف کنید؛ در غیر این صورت، تا انتهای خط را پاک کنید." msgid ":kbd:`Control-L`" -msgstr "" +msgstr ":kbd:`Control-L`" msgid "Refresh screen." -msgstr "" +msgstr "تازه‌سازی صفحه." msgid ":kbd:`Control-N`" -msgstr "" +msgstr ":kbd:`Control-N`" msgid "Cursor down; move down one line." -msgstr "" +msgstr "نشانگر پایین؛ یک خط به پایین حرکت کنید." msgid ":kbd:`Control-O`" -msgstr "" +msgstr ":kbd:`Control-O`" msgid "Insert a blank line at cursor location." -msgstr "" +msgstr "یک خط خالی در محل مکان‌نما درج کنید." msgid ":kbd:`Control-P`" -msgstr "" +msgstr ":kbd:`Control-P`" msgid "Cursor up; move up one line." -msgstr "" +msgstr "مکان‌نما به بالا؛ یک خط به بالا حرکت کنید." -msgid "Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible:" +msgid "" +"Move operations do nothing if the cursor is at an edge where the movement is " +"not possible. The following synonyms are supported where possible:" msgstr "" +"اگر مکان‌نما در لبه‌ای باشد که جابه‌جایی ممکن نیست، عملیات‌های جابه‌جایی هیچ کاری " +"انجام نمی‌دهند. مترادف‌های زیر در صورت امکان پشتیبانی می‌شوند:" msgid ":const:`~curses.KEY_LEFT`" -msgstr "" +msgstr ":const:`~curses.KEY_LEFT`" msgid ":const:`~curses.KEY_RIGHT`" -msgstr "" +msgstr ":const:`~curses.KEY_RIGHT`" msgid ":const:`~curses.KEY_UP`" -msgstr "" +msgstr ":const:`~curses.KEY_UP`" msgid ":const:`~curses.KEY_DOWN`" -msgstr "" +msgstr ":const:`~curses.KEY_DOWN`" msgid ":const:`~curses.KEY_BACKSPACE`" -msgstr "" +msgstr ":const:`~curses.KEY_BACKSPACE`" msgid ":kbd:`Control-h`" -msgstr "" +msgstr ":kbd:`Control-h`" -msgid "All other keystrokes are treated as a command to insert the given character and move right (with line wrapping)." +msgid "" +"All other keystrokes are treated as a command to insert the given character " +"and move right (with line wrapping)." msgstr "" +"همه‌ی کلیدفشارهای دیگر به‌عنوان فرمانی برای درج نویسه‌ی داده‌شده و حرکت به راست " +"(با پیچیدن خط) تلقی می‌شوند." -msgid "Return the window contents as a string; whether blanks in the window are included is affected by the :attr:`stripspaces` member." +msgid "" +"Return the window contents as a string; whether blanks in the window are " +"included is affected by the :attr:`stripspaces` member." msgstr "" +"محتوای پنجره را به‌عنوان یک رشته برمی‌گرداند؛ اینکه آیا فاصله‌های خالی درون پنجره " +"گنجانده می‌شوند، تحت تأثیر عضو :attr:`stripspaces` قرار می‌گیرد." -msgid "This attribute is a flag which controls the interpretation of blanks in the window. When it is on, trailing blanks on each line are ignored; any cursor motion that would land the cursor on a trailing blank goes to the end of that line instead, and trailing blanks are stripped when the window contents are gathered." -msgstr "" +msgid "" +"This attribute is a flag which controls the interpretation of blanks in the " +"window. When it is on, trailing blanks on each line are ignored; any cursor " +"motion that would land the cursor on a trailing blank goes to the end of that " +"line instead, and trailing blanks are stripped when the window contents are " +"gathered." +msgstr "" +"این ویژگی یک پرچم است که تفسیر فاصله‌ها در پنجره را کنترل می‌کند. وقتی روشن است، " +"فاصله‌های انتهایی هر خط نادیده گرفته می‌شوند؛ هر حرکت مکان‌نما که مکان‌نما را روی " +"یک فاصله‌ی انتهایی قرار دهد، در عوض به انتهای آن خط می‌رود، و فاصله‌های انتهایی " +"هنگام جمع‌آوری محتوای پنجره حذف می‌شوند." diff --git a/library/custominterp.po b/library/custominterp.po index bb6fe29bb..ca7da4bd8 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Custom Python Interpreters" -msgstr "" +msgstr "مفسرهای سفارشی پایتون" -msgid "The modules described in this chapter allow writing interfaces similar to Python's interactive interpreter. If you want a Python interpreter that supports some special feature in addition to the Python language, you should look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, used to support compiling a possibly incomplete chunk of Python code.)" +msgid "" +"The modules described in this chapter allow writing interfaces similar to " +"Python's interactive interpreter. If you want a Python interpreter that " +"supports some special feature in addition to the Python language, you should" +" look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, " +"used to support compiling a possibly incomplete chunk of Python code.)" msgstr "" +"ماژول‌های توصیف‌شده در این فصل امکان نوشتن رابط‌هایی مشابه مفسر تعاملی " +"پایتون را فراهم می‌کنند. اگر مفسر پایتونی می‌خواهید که علاوه بر زبان پایتون " +"از برخی ویژگی‌های خاص پشتیبانی کند، باید به ماژول :mod:`code` نگاه کنید. " +"(ماژول :mod:`codeop` در سطح پایین‌تری قرار دارد و برای پشتیبانی از کامپایل " +"تکه‌ای از کد پایتون که ممکن است ناقص باشد، استفاده می‌شود.)" msgid "The full list of modules described in this chapter is:" -msgstr "" +msgstr "فهرست کامل ماژول‌های شرح‌داده‌شده در این فصل عبارت است از:" diff --git a/library/dataclasses.po b/library/dataclasses.po index 0cb75a06a..36be766ee 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -24,16 +24,28 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!dataclasses` --- Data Classes" -msgstr "" +msgstr ":mod:`!dataclasses` --- کلاس‌های داده" msgid "**Source code:** :source:`Lib/dataclasses.py`" -msgstr "" +msgstr ":source:`Lib/dataclasses.py`" -msgid "This module provides a decorator and functions for automatically adding generated :term:`special methods ` such as :meth:`~object.__init__` and :meth:`~object.__repr__` to user-defined classes. It was originally described in :pep:`557`." +msgid "" +"This module provides a decorator and functions for automatically adding " +"generated :term:`special methods ` such as " +":meth:`~object.__init__` and :meth:`~object.__repr__` to user-defined " +"classes. It was originally described in :pep:`557`." msgstr "" +"این ماژول یک دکوراتور و توابعی را برای افزودن خودکار :term:`متدهای ویژه " +"` تولیدشده مانند :meth:`~object.__init__` و " +":meth:`~object.__repr__` به کلاس‌های تعریف‌شده توسط کاربر فراهم می‌کند. این " +"ماژول در ابتدا در :pep:`557` توصیف‌شده است." -msgid "The member variables to use in these generated methods are defined using :pep:`526` type annotations. For example, this code::" +msgid "" +"The member variables to use in these generated methods are defined using " +":pep:`526` type annotations. For example, this code::" msgstr "" +"متغیرهای عضوی که در این متدهای تولیدشده به کار می‌روند، با یادداشت‌های نوع" +" :pep:`526` تعریف می‌شوند. برای مثال، این کد::" msgid "" "from dataclasses import dataclass\n" @@ -48,9 +60,21 @@ msgid "" " def total_cost(self) -> float:\n" " return self.unit_price * self.quantity_on_hand" msgstr "" +"from dataclasses import dataclass\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" \"\"\"Class for keeping track of an item in inventory.\"\"\"\n" +" name: str\n" +" unit_price: float\n" +" quantity_on_hand: int = 0\n" +"\n" +" def total_cost(self) -> float:\n" +" return self.unit_price * self.quantity_on_hand" msgid "will add, among other things, a :meth:`!__init__` that looks like::" msgstr "" +"خواهد افزود، از جمله موارد دیگر، یک :meth:`!__init__` که به شکل زیر است::" msgid "" "def __init__(self, name: str, unit_price: float, quantity_on_hand: int = 0):\n" @@ -58,27 +82,69 @@ msgid "" " self.unit_price = unit_price\n" " self.quantity_on_hand = quantity_on_hand" msgstr "" +"def __init__(self, name: str, unit_price: float, quantity_on_hand: int = 0):\n" +" self.name = name\n" +" self.unit_price = unit_price\n" +" self.quantity_on_hand = quantity_on_hand" -msgid "Note that this method is automatically added to the class: it is not directly specified in the :class:`!InventoryItem` definition shown above." +msgid "" +"Note that this method is automatically added to the class: it is not " +"directly specified in the :class:`!InventoryItem` definition shown above." msgstr "" +"توجه داشته باشید که این متد به‌طور خودکار به کلاس افزوده می‌شود: این متد " +"به‌طور مستقیم در تعریف :class:`!InventoryItem` که در بالا نشان داده شده است،" +" مشخص نشده است." msgid "Module contents" -msgstr "" +msgstr "محتوای ماژول" -msgid "This function is a :term:`decorator` that is used to add generated :term:`special methods ` to classes, as described below." +msgid "" +"This function is a :term:`decorator` that is used to add generated " +":term:`special methods ` to classes, as described below." msgstr "" +"این تابع یک :term:`دکوراتور ` است که برای افزودن " +":term:`متدهای ویژه ` تولیدشده به کلاس‌ها به کار می‌رود، " +"همان‌طور که در ادامه توضیح داده شده است." -msgid "The ``@dataclass`` decorator examines the class to find ``field``\\s. A ``field`` is defined as a class variable that has a :term:`type annotation `. With two exceptions described below, nothing in ``@dataclass`` examines the type specified in the variable annotation." +msgid "" +"The ``@dataclass`` decorator examines the class to find ``field``\\s. A " +"``field`` is defined as a class variable that has a :term:`type annotation " +"`. With two exceptions described below, nothing in " +"``@dataclass`` examines the type specified in the variable annotation." msgstr "" +"دکوراتور ``@dataclass`` کلاس را بررسی می‌کند تا ``field``\\ها را پیدا کند. " +"یک ``field`` به‌عنوان متغیر کلاس تعریف می‌شود که دارای یک :term:`یادداشت نوع" +" ` است. به‌جز دو استثنا که در زیر توضیح داده شده‌اند، " +"هیچ چیزی در ``@dataclass`` نوع مشخص‌شده در یادداشت متغیر را بررسی نمی‌کند." -msgid "The order of the fields in all of the generated methods is the order in which they appear in the class definition." +msgid "" +"The order of the fields in all of the generated methods is the order in " +"which they appear in the class definition." msgstr "" +"ترتیب فیلدها در تمام متدهای تولیدشده، همان ترتیبی است که در تعریف کلاس " +"دارند." -msgid "The ``@dataclass`` decorator will add various \"dunder\" methods to the class, described below. If any of the added methods already exist in the class, the behavior depends on the parameter, as documented below. The decorator returns the same class that it is called on; no new class is created." -msgstr "" +msgid "" +"The ``@dataclass`` decorator will add various \"dunder\" methods to the " +"class, described below. If any of the added methods already exist in the " +"class, the behavior depends on the parameter, as documented below. The " +"decorator returns the same class that it is called on; no new class is " +"created." +msgstr "" +"دکوراتور ``@dataclass`` متدهای مختلف دو-زیرخطی (dunder) را به کلاس می‌افزاید" +" که در زیر توضیح داده شده‌اند. اگر هر یک از متدهای افزوده‌شده از قبل در کلاس" +" وجود داشته باشند، رفتار به پارامتر بستگی دارد، همان‌طور که در زیر مستند شده" +" است. دکوراتور همان کلاسی را که روی آن فراخوانی‌شده است برمی‌گرداند؛ هیچ " +"کلاس جدیدی ایجاد نمی‌شود." -msgid "If ``@dataclass`` is used just as a simple decorator with no parameters, it acts as if it has the default values documented in this signature. That is, these three uses of ``@dataclass`` are equivalent::" +msgid "" +"If ``@dataclass`` is used just as a simple decorator with no parameters, it " +"acts as if it has the default values documented in this signature. That is," +" these three uses of ``@dataclass`` are equivalent::" msgstr "" +"اگر ``@dataclass`` فقط به‌عنوان یک دکوراتور ساده بدون پارامتر استفاده شود، " +"به‌گونه‌ای عمل می‌کند که گویی مقادیر پیش‌فرض مستندشده در این امضا را دارد. " +"یعنی این سه کاربرد ``@dataclass`` معادل‌اند::" msgid "" "@dataclass\n" @@ -94,93 +160,306 @@ msgid "" "class C:\n" " ..." msgstr "" +"@dataclass\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass()\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False,\n" +" match_args=True, kw_only=False, slots=False, weakref_slot=False)\n" +"class C:\n" +" ..." msgid "The parameters to ``@dataclass`` are:" -msgstr "" +msgstr "پارامترهای ``@dataclass`` عبارتند از:" -msgid "*init*: If true (the default), a :meth:`~object.__init__` method will be generated." +msgid "" +"*init*: If true (the default), a :meth:`~object.__init__` method will be " +"generated." msgstr "" +"*init*: اگر درست باشد (پیش‌فرض)، یک متد :meth:`~object.__init__` تولید خواهد" +" شد." -msgid "If the class already defines :meth:`!__init__`, this parameter is ignored." +msgid "" +"If the class already defines :meth:`!__init__`, this parameter is ignored." msgstr "" +"اگر کلاس از قبل :meth:`!__init__` را تعریف کرده باشد، این پارامتر نادیده " +"گرفته می‌شود." -msgid "*repr*: If true (the default), a :meth:`~object.__repr__` method will be generated. The generated repr string will have the class name and the name and repr of each field, in the order they are defined in the class. Fields that are marked as being excluded from the repr are not included. For example: ``InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10)``." -msgstr "" +msgid "" +"*repr*: If true (the default), a :meth:`~object.__repr__` method will be " +"generated. The generated repr string will have the class name and the name " +"and repr of each field, in the order they are defined in the class. Fields " +"that are marked as being excluded from the repr are not included. For " +"example: ``InventoryItem(name='widget', unit_price=3.0, " +"quantity_on_hand=10)``." +msgstr "" +"*repr*: اگر true باشد (پیش‌فرض)، یک متد :meth:`~object.__repr__` تولید خواهد" +" شد. رشته‌ی repr تولیدشده، نام کلاس و نام و repr هر فیلد را به ترتیبی که در " +"کلاس تعریف شده‌اند، خواهد داشت. فیلدهایی که برای حذف از repr علامت‌گذاری " +"شده باشند، گنجانده نمی‌شوند. برای مثال: ``InventoryItem(name='widget', " +"unit_price=3.0, quantity_on_hand=10)``." -msgid "If the class already defines :meth:`!__repr__`, this parameter is ignored." +msgid "" +"If the class already defines :meth:`!__repr__`, this parameter is ignored." msgstr "" +"اگر کلاس از قبل :meth:`!__repr__` را تعریف کرده باشد، این پارامتر نادیده " +"گرفته می‌شود." -msgid "*eq*: If true (the default), an :meth:`~object.__eq__` method will be generated." +msgid "" +"*eq*: If true (the default), an :meth:`~object.__eq__` method will be " +"generated." msgstr "" +"*eq*: اگر true باشد (پیش‌فرض)، یک متد :meth:`~object.__eq__` تولید خواهد شد." -msgid "This method compares the class by comparing each field in order. Both instances in the comparison must be of the identical type." +msgid "" +"This method compares the class by comparing each field in order. Both " +"instances in the comparison must be of the identical type." msgstr "" +"این متد، کلاس را با مقایسه‌ی هر فیلد به‌ترتیب مقایسه می‌کند. هر دو نمونه در " +"مقایسه باید از نوع یکسان باشند." -msgid "If the class already defines :meth:`!__eq__`, this parameter is ignored." +msgid "" +"If the class already defines :meth:`!__eq__`, this parameter is ignored." msgstr "" +"اگر کلاس از قبل :meth:`!__eq__` را تعریف کرده باشد، این پارامتر نادیده گرفته" +" می‌شود." -msgid "The generated ``__eq__`` method now compares each field individually (for example, ``self.a == other.a and self.b == other.b``), rather than comparing tuples of fields as in previous versions." +msgid "" +"The generated ``__eq__`` method now compares each field individually (for " +"example, ``self.a == other.a and self.b == other.b``), rather than comparing" +" tuples of fields as in previous versions." msgstr "" +"متد ``__eq__`` تولیدشده اکنون هر فیلد را به‌صورت جداگانه مقایسه می‌کند (برای" +" مثال، ``self.a == other.a and self.b == other.b``)، نه اینکه مانند نسخه‌های" +" پیشین تاپل‌های فیلدها را مقایسه کند." -msgid "This change makes the comparison faster but it may alter results in cases where attributes compare equal by identity but not by value (such as ``float('nan')``)." +msgid "" +"This change makes the comparison faster but it may alter results in cases " +"where attributes compare equal by identity but not by value (such as " +"``float('nan')``)." msgstr "" +"این تغییر، مقایسه را سریع‌تر می‌کند، اما ممکن است نتایج را در مواردی که " +"ویژگی‌ها از نظر هویت برابر هستند ولی از نظر مقدار برابر نیستند (مانند " +"``float('nan')``) تغییر دهد." -msgid "In Python 3.12 and earlier, the comparison was performed by creating tuples of the fields and comparing them (for example, ``(self.a, self.b) == (other.a, other.b)``)." +msgid "" +"In Python 3.12 and earlier, the comparison was performed by creating tuples " +"of the fields and comparing them (for example, ``(self.a, self.b) == " +"(other.a, other.b)``)." msgstr "" +"در پایتون 3.12 و نسخه‌های پیشین، مقایسه با ایجاد تاپل‌هایی از فیلدها و " +"مقایسه‌ی آن‌ها انجام می‌شد (برای مثال، ``(self.a, self.b) == (other.a, " +"other.b)``)." -msgid "*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods will be generated. These compare the class as if it were a tuple of its fields, in order. Both instances in the comparison must be of the identical type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." -msgstr "" +msgid "" +"*order*: If true (the default is ``False``), :meth:`~object.__lt__`, " +":meth:`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` " +"methods will be generated. These compare the class as if it were a tuple of" +" its fields, in order. Both instances in the comparison must be of the " +"identical type. If *order* is true and *eq* is false, a :exc:`ValueError` " +"is raised." +msgstr "" +"*order*: اگر درست باشد (پیش‌فرض ``False`` است)، متدهای " +":meth:`~object.__lt__`، :meth:`~object.__le__`، :meth:`~object.__gt__` و " +":meth:`~object.__ge__` تولید می‌شوند. این متدها کلاس را به‌گونه‌ای مقایسه " +"می‌کنند که گویی یک تاپل از فیلدهای آن به‌ترتیب است. هر دو نمونه در مقایسه " +"باید از نوع یکسان باشند. اگر *order* درست باشد و *eq* نادرست باشد، یک " +":exc:`ValueError` پرتاب می‌شود." -msgid "If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." +msgid "" +"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, " +":meth:`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." msgstr "" +"اگر کلاس از قبل هر یک از :meth:`!__lt__`، :meth:`!__le__`، :meth:`!__gt__`، " +"یا :meth:`!__ge__` را تعریف کرده باشد، :exc:`TypeError` پرتاب می‌شود." -msgid "*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object.__hash__` method, even though it may not be safe to do so. Otherwise, generate a :meth:`~object.__hash__` method according to how *eq* and *frozen* are set. The default value is ``False``." +msgid "" +"*unsafe_hash*: If true, force ``dataclasses`` to create a " +":meth:`~object.__hash__` method, even though it may not be safe to do so. " +"Otherwise, generate a :meth:`~object.__hash__` method according to how *eq* " +"and *frozen* are set. The default value is ``False``." msgstr "" +"*unsafe_hash*: اگر true باشد، ``dataclasses`` را وادار به ایجاد یک متد " +":meth:`~object.__hash__` می‌کند، هرچند ممکن است این کار امن نباشد. در غیر " +"این صورت، یک متد :meth:`~object.__hash__` با توجه به نحوه‌ی تنظیم *eq* و " +"*frozen* تولید می‌شود. مقدار پیش‌فرض ``False`` است." -msgid ":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are added to hashed collections such as dictionaries and sets. Having a :meth:`!__hash__` implies that instances of the class are immutable. Mutability is a complicated property that depends on the programmer's intent, the existence and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* flags in the ``@dataclass`` decorator." -msgstr "" +msgid "" +":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " +"added to hashed collections such as dictionaries and sets. Having a " +":meth:`!__hash__` implies that instances of the class are immutable. " +"Mutability is a complicated property that depends on the programmer's " +"intent, the existence and behavior of :meth:`!__eq__`, and the values of the" +" *eq* and *frozen* flags in the ``@dataclass`` decorator." +msgstr "" +":meth:`!__hash__` توسط :meth:`hash` توکار، و هنگام اضافه شدن شیء‌ها به " +"مجموعه‌های هش‌شده مانند دیکشنری‌ها و مجموعه‌ها استفاده می‌شود. وجود " +":meth:`!__hash__` به این معناست که نمونه‌های کلاس تغییرناپذیر هستند. " +"تغییرپذیری ویژگی پیچیده‌ای است که به قصد برنامه‌نویس، وجود و رفتار " +":meth:`!__eq__`، و مقادیر پرچم‌های *eq* و *frozen* در دکوراتور " +"``@dataclass`` بستگی دارد." -msgid "By default, ``@dataclass`` will not implicitly add a :meth:`~object.__hash__` method unless it is safe to do so. Neither will it add or change an existing explicitly defined :meth:`!__hash__` method. Setting the class attribute ``__hash__ = None`` has a specific meaning to Python, as described in the :meth:`!__hash__` documentation." -msgstr "" +msgid "" +"By default, ``@dataclass`` will not implicitly add a " +":meth:`~object.__hash__` method unless it is safe to do so. Neither will it" +" add or change an existing explicitly defined :meth:`!__hash__` method. " +"Setting the class attribute ``__hash__ = None`` has a specific meaning to " +"Python, as described in the :meth:`!__hash__` documentation." +msgstr "" +"به‌طور پیش‌فرض، ``@dataclass`` متد :meth:`~object.__hash__` را به‌صورت ضمنی " +"اضافه نمی‌کند، مگر اینکه انجام این کار امن باشد. همچنین متد " +":meth:`!__hash__` موجودی را که به‌صورت صریح تعریف‌شده است، اضافه یا تغییر " +"نمی‌دهد. تنظیم ویژگی کلاس ``__hash__ = None`` برای پایتون معنای مشخصی دارد، " +"همان‌طور که در مستندات :meth:`!__hash__` آمده است." -msgid "If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. Although not recommended, you can force ``@dataclass`` to create a :meth:`!__hash__` method with ``unsafe_hash=True``. This might be the case if your class is logically immutable but can still be mutated. This is a specialized use case and should be considered carefully." -msgstr "" +msgid "" +"If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``," +" then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. " +"Although not recommended, you can force ``@dataclass`` to create a " +":meth:`!__hash__` method with ``unsafe_hash=True``. This might be the case " +"if your class is logically immutable but can still be mutated. This is a " +"specialized use case and should be considered carefully." +msgstr "" +"اگر :meth:`!__hash__` به‌صراحت تعریف نشده باشد، یا اگر روی ``None`` تنظیم " +"شده باشد، آنگاه ``@dataclass`` *ممکن است* یک متد :meth:`!__hash__` ضمنی " +"اضافه کند. اگرچه توصیه نمی‌شود، اما می‌توانید ``@dataclass`` را وادار کنید " +"تا یک متد :meth:`!__hash__` را با ``unsafe_hash=True`` ایجاد کند. این حالت " +"ممکن است زمانی رخ دهد که کلاس شما از نظر منطقی تغییرناپذیر است اما همچنان " +"می‌تواند تغییر یابد. این یک مورد استفاده تخصصی است و باید با دقت در نظر " +"گرفته شود." -msgid "Here are the rules governing implicit creation of a :meth:`!__hash__` method. Note that you cannot both have an explicit :meth:`!__hash__` method in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:`TypeError`." +msgid "" +"Here are the rules governing implicit creation of a :meth:`!__hash__` " +"method. Note that you cannot both have an explicit :meth:`!__hash__` method" +" in your dataclass and set ``unsafe_hash=True``; this will result in a " +":exc:`TypeError`." msgstr "" +"در ادامه، قواعد حاکم بر ایجاد ضمنی یک متد :meth:`!__hash__` آمده است. توجه " +"داشته باشید که نمی‌توانید همزمان یک متد :meth:`!__hash__` صریح در دیتاکلاس " +"خود داشته باشید و ``unsafe_hash=True`` را تنظیم کنید؛ این کار منجر به " +":exc:`TypeError` می‌شود." -msgid "If *eq* and *frozen* are both true, by default ``@dataclass`` will generate a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :meth:`!__hash__` will be set to ``None``, marking it unhashable (which it is, since it is mutable). If *eq* is false, :meth:`!__hash__` will be left untouched meaning the :meth:`!__hash__` method of the superclass will be used (if the superclass is :class:`object`, this means it will fall back to id-based hashing)." -msgstr "" +msgid "" +"If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " +"a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, " +":meth:`!__hash__` will be set to ``None``, marking it unhashable (which it " +"is, since it is mutable). If *eq* is false, :meth:`!__hash__` will be left " +"untouched meaning the :meth:`!__hash__` method of the superclass will be " +"used (if the superclass is :class:`object`, this means it will fall back to " +"id-based hashing)." +msgstr "" +"اگر *eq* و *frozen* هر دو درست باشند، به‌طور پیش‌فرض ``@dataclass`` یک متد " +":meth:`!__hash__` برای شما تولید خواهد کرد. اگر *eq* درست باشد و *frozen* " +"نادرست باشد، :meth:`!__hash__` روی ``None`` تنظیم خواهد شد، که آن را " +"به‌عنوان هش‌ناپذیر (unhashable) علامت‌گذاری می‌کند (که همین‌طور است، زیرا " +"تغییرپذیر است). اگر *eq* نادرست باشد، :meth:`!__hash__` دست‌نخورده باقی " +"خواهد ماند، به این معنا که متد :meth:`!__hash__` ابرکلاس استفاده خواهد شد " +"(اگر ابرکلاس :class:`object` باشد، این بدان معناست که به هش مبتنی بر شناسه " +"(id-based hashing) بازگشت خواهد شد)." -msgid "*frozen*: If true (the default is ``False``), assigning to fields will generate an exception. This emulates read-only frozen instances. See the :ref:`discussion ` below." +msgid "" +"*frozen*: If true (the default is ``False``), assigning to fields will " +"generate an exception. This emulates read-only frozen instances. See the " +":ref:`discussion ` below." msgstr "" +"*frozen*: اگر true باشد (پیش‌فرض ``False`` است)، انتساب به فیلدها باعث ایجاد" +" یک استثنا می‌شود. این حالت، نمونه‌های فریزشده فقط‌خواندنی را شبیه‌سازی " +"می‌کند. به :ref:`بحث ` در زیر مراجعه کنید." -msgid "If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class and *frozen* is true, then :exc:`TypeError` is raised." +msgid "" +"If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in " +"the class and *frozen* is true, then :exc:`TypeError` is raised." msgstr "" +"اگر :meth:`~object.__setattr__` یا :meth:`~object.__delattr__` در کلاس تعریف" +" شده باشد و *frozen* برابر true باشد، :exc:`TypeError` پرتاب می‌شود." -msgid "*match_args*: If true (the default is ``True``), the :attr:`~object.__match_args__` tuple will be created from the list of non keyword-only parameters to the generated :meth:`~object.__init__` method (even if :meth:`!__init__` is not generated, see above). If false, or if :attr:`!__match_args__` is already defined in the class, then :attr:`!__match_args__` will not be generated." -msgstr "" +msgid "" +"*match_args*: If true (the default is ``True``), the " +":attr:`~object.__match_args__` tuple will be created from the list of non " +"keyword-only parameters to the generated :meth:`~object.__init__` method " +"(even if :meth:`!__init__` is not generated, see above). If false, or if " +":attr:`!__match_args__` is already defined in the class, then " +":attr:`!__match_args__` will not be generated." +msgstr "" +"*match_args*: اگر درست باشد (پیش‌فرض ``True`` است)، تاپل " +":attr:`~object.__match_args__` از فهرست پارامترهای متد تولیدشده‌ی " +":meth:`~object.__init__` که فقط‌کلیدواژه‌ای نیستند ایجاد می‌شود (حتی اگر " +":meth:`!__init__` تولید نشده باشد، بالا را ببینید). اگر نادرست باشد، یا اگر " +":attr:`!__match_args__` از قبل در کلاس تعریف شده باشد، " +":attr:`!__match_args__` تولید نخواهد شد." -msgid "*kw_only*: If true (the default value is ``False``), then all fields will be marked as keyword-only. If a field is marked as keyword-only, then the only effect is that the :meth:`~object.__init__` parameter generated from a keyword-only field must be specified with a keyword when :meth:`!__init__` is called. See the :term:`parameter` glossary entry for details. Also see the :const:`KW_ONLY` section." +msgid "" +"*kw_only*: If true (the default value is ``False``), then all fields will be" +" marked as keyword-only. If a field is marked as keyword-only, then the " +"only effect is that the :meth:`~object.__init__` parameter generated from a " +"keyword-only field must be specified with a keyword when :meth:`!__init__` " +"is called. See the :term:`parameter` glossary entry for details. Also see " +"the :const:`KW_ONLY` section." msgstr "" +"*kw_only*: اگر درست باشد (مقدار پیش‌فرض ``False`` است)، تمام فیلدها به‌عنوان فقط کلیدواژه‌ای علامت‌گذاری می‌شوند. اگر فیلدی به‌عنوان فقط کلیدواژه‌ای علامت‌گذاری شده باشد، تنها اثر آن این است که پارامتر :meth:`~object.__init__` که از یک فیلد فقط کلیدواژه‌ای تولید شده است، باید هنگام فراخوانی :meth:`!__init__` با یک کلیدواژه مشخص شود. برای جزئیات، مدخل :term:`پارامتر ` در واژه‌نامه را ببینید. همچنین بخش :const:`KW_ONLY` را ببینید." msgid "Keyword-only fields are not included in :attr:`!__match_args__`." -msgstr "" +msgstr "فیلدهای فقط‌کلیدواژه‌ای در :attr:`!__match_args__` گنجانده نمی‌شوند." -msgid "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` attribute will be generated and new class will be returned instead of the original one. If :attr:`!__slots__` is already defined in the class, then :exc:`TypeError` is raised." +msgid "" +"*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " +"attribute will be generated and new class will be returned instead of the " +"original one. If :attr:`!__slots__` is already defined in the class, then " +":exc:`TypeError` is raised." msgstr "" +"*slots*: اگر درست باشد (پیش‌فرض ``False`` است)، ویژگی " +":attr:`~object.__slots__` ایجاد می‌شود و کلاس جدید به جای کلاس اصلی " +"برگردانده می‌شود. اگر :attr:`!__slots__` از قبل در کلاس تعریف شده باشد، " +":exc:`TypeError` پرتاب می‌شود." -msgid "Passing parameters to a base class :meth:`~object.__init_subclass__` when using ``slots=True`` will result in a :exc:`TypeError`. Either use ``__init_subclass__`` with no parameters or use default values as a workaround. See :gh:`91126` for full details." +msgid "" +"Passing parameters to a base class :meth:`~object.__init_subclass__` when " +"using ``slots=True`` will result in a :exc:`TypeError`. Either use " +"``__init_subclass__`` with no parameters or use default values as a " +"workaround. See :gh:`91126` for full details." msgstr "" +"ارسال پارامترها به :meth:`~object.__init_subclass__` کلاس پایه، هنگام " +"استفاده از ``slots=True``، به :exc:`TypeError` منجر می‌شود. یا از " +"``__init_subclass__`` بدون پارامتر استفاده کنید یا از مقادیر پیش‌فرض " +"به‌عنوان راه‌حل موقت استفاده کنید. برای جزئیات کامل، :gh:`91126` را ببینید." -msgid "If a field name is already included in the :attr:`!__slots__` of a base class, it will not be included in the generated :attr:`!__slots__` to prevent :ref:`overriding them `. Therefore, do not use :attr:`!__slots__` to retrieve the field names of a dataclass. Use :func:`fields` instead. To be able to determine inherited slots, base class :attr:`!__slots__` may be any iterable, but *not* an iterator." -msgstr "" +msgid "" +"If a field name is already included in the :attr:`!__slots__` of a base " +"class, it will not be included in the generated :attr:`!__slots__` to " +"prevent :ref:`overriding them `. Therefore, do not use" +" :attr:`!__slots__` to retrieve the field names of a dataclass. Use " +":func:`fields` instead. To be able to determine inherited slots, base class " +":attr:`!__slots__` may be any iterable, but *not* an iterator." +msgstr "" +"اگر نام فیلدی از قبل در :attr:`!__slots__` یک کلاس پایه گنجانده شده باشد، " +"برای جلوگیری از :ref:`بازنویسی آن‌ها `، در " +":attr:`!__slots__` تولیدشده گنجانده نخواهد شد. بنابراین، برای بازیابی نام " +"فیلدهای یک دیتاکلاس از :attr:`!__slots__` استفاده نکنید. در عوض از " +":func:`fields` استفاده کنید. برای این که بتوان جایگاه‌های ارث‌بری‌شده را " +"تعیین کرد، :attr:`!__slots__` کلاس پایه می‌تواند هر پیمایش‌پذیری باشد، اما " +"*نه* یک پیمایشگر (iterator)." -msgid "*weakref_slot*: If true (the default is ``False``), add a slot named \"__weakref__\", which is required to make an instance :func:`weakref-able `. It is an error to specify ``weakref_slot=True`` without also specifying ``slots=True``." +msgid "" +"*weakref_slot*: If true (the default is ``False``), add a slot named " +"\"__weakref__\", which is required to make an instance :func:`weakref-able " +"`. It is an error to specify ``weakref_slot=True`` without also" +" specifying ``slots=True``." msgstr "" +"*weakref_slot*: اگر درست باشد (پیش‌فرض ``False`` است)، یک جایگاه (slot) به " +"نام \"__weakref__\" افزوده می‌شود، که برای :func:`weakref-able " +"` کردن یک نمونه لازم است. تعیین ``weakref_slot=True`` بدون " +"این‌که ``slots=True`` نیز تعیین شود، خطا است." -msgid "``field``\\s may optionally specify a default value, using normal Python syntax::" +msgid "" +"``field``\\s may optionally specify a default value, using normal Python " +"syntax::" msgstr "" +"``field``\\s می‌توانند به‌اختیار یک مقدار پیش‌فرض را با استفاده از سینتکس " +"عادی پایتون مشخص کنند::" msgid "" "@dataclass\n" @@ -188,18 +467,42 @@ msgid "" " a: int # 'a' has no default value\n" " b: int = 0 # assign a default value for 'b'" msgstr "" +"@dataclass\n" +"class C:\n" +" a: int # 'a' has no default value\n" +" b: int = 0 # assign a default value for 'b'" -msgid "In this example, both :attr:`!a` and :attr:`!b` will be included in the added :meth:`~object.__init__` method, which will be defined as::" +msgid "" +"In this example, both :attr:`!a` and :attr:`!b` will be included in the " +"added :meth:`~object.__init__` method, which will be defined as::" msgstr "" +"در این مثال، هر دو :attr:`!a` و :attr:`!b` در متد :meth:`~object.__init__` " +"افزوده‌شده گنجانده خواهند شد، که به‌صورت زیر تعریف خواهد شد::" msgid "def __init__(self, a: int, b: int = 0):" -msgstr "" +msgstr "def __init__(self, a: int, b: int = 0):" -msgid ":exc:`TypeError` will be raised if a field without a default value follows a field with a default value. This is true whether this occurs in a single class, or as a result of class inheritance." +msgid "" +":exc:`TypeError` will be raised if a field without a default value follows a" +" field with a default value. This is true whether this occurs in a single " +"class, or as a result of class inheritance." msgstr "" +"اگر یک فیلد بدون مقدار پیش‌فرض پس از یک فیلد دارای مقدار پیش‌فرض قرار بگیرد،" +" :exc:`TypeError` پرتاب خواهد شد. این موضوع چه در یک کلاس واحد رخ دهد و چه " +"در نتیجه وراثت کلاس، صادق است." -msgid "For common and simple use cases, no other functionality is required. There are, however, some dataclass features that require additional per-field information. To satisfy this need for additional information, you can replace the default field value with a call to the provided :func:`!field` function. For example::" -msgstr "" +msgid "" +"For common and simple use cases, no other functionality is required. There " +"are, however, some dataclass features that require additional per-field " +"information. To satisfy this need for additional information, you can " +"replace the default field value with a call to the provided :func:`!field` " +"function. For example::" +msgstr "" +"برای موارد استفاده‌ی رایج و ساده، به قابلیت دیگری نیاز نیست. با این حال، " +"برخی از قابلیت‌های دیتاکلاس (dataclass) به اطلاعات اضافی به‌ازای هر فیلد " +"نیاز دارند. برای برآورده کردن این نیاز به اطلاعات اضافی، می‌توانید مقدار " +"پیش‌فرض فیلد را با فراخوانی تابع ارائه‌شده :func:`!field` جایگزین کنید. برای" +" مثال::" msgid "" "@dataclass\n" @@ -209,48 +512,150 @@ msgid "" "c = C()\n" "c.mylist += [1, 2, 3]" msgstr "" +"@dataclass\n" +"class C:\n" +" mylist: list[int] = field(default_factory=list)\n" +"\n" +"c = C()\n" +"c.mylist += [1, 2, 3]" -msgid "As shown above, the :const:`MISSING` value is a sentinel object used to detect if some parameters are provided by the user. This sentinel is used because ``None`` is a valid value for some parameters with a distinct meaning. No code should directly use the :const:`MISSING` value." +msgid "" +"As shown above, the :const:`MISSING` value is a sentinel object used to " +"detect if some parameters are provided by the user. This sentinel is used " +"because ``None`` is a valid value for some parameters with a distinct " +"meaning. No code should directly use the :const:`MISSING` value." msgstr "" +"همان‌طور که در بالا نشان داده شد، مقدار :const:`MISSING` یک شیء نشانگر " +"(sentinel) است که برای تشخیص این‌که آیا برخی پارامترها توسط کاربر ارائه " +"شده‌اند، استفاده می‌شود. این نشانگر به این دلیل استفاده می‌شود که ``None`` " +"برای برخی پارامترها یک مقدار معتبر با معنایی متمایز است. هیچ کدی نباید " +"به‌طور مستقیم از مقدار :const:`MISSING` استفاده کند." msgid "The parameters to :func:`!field` are:" -msgstr "" +msgstr "پارامترهای :func:`!field` عبارتند از:" -msgid "*default*: If provided, this will be the default value for this field. This is needed because the :func:`!field` call itself replaces the normal position of the default value." +msgid "" +"*default*: If provided, this will be the default value for this field. This" +" is needed because the :func:`!field` call itself replaces the normal " +"position of the default value." msgstr "" +"*default*: اگر ارائه شود، این، مقدار پیش‌فرض این فیلد خواهد بود. این امر " +"لازم است، زیرا فراخوانی :func:`!field` به‌خودی‌خود جایگزین جایگاه عادی مقدار" +" پیش‌فرض می‌شود." -msgid "*default_factory*: If provided, it must be a zero-argument callable that will be called when a default value is needed for this field. Among other purposes, this can be used to specify fields with mutable default values, as discussed below. It is an error to specify both *default* and *default_factory*." -msgstr "" +msgid "" +"*default_factory*: If provided, it must be a zero-argument callable that " +"will be called when a default value is needed for this field. Among other " +"purposes, this can be used to specify fields with mutable default values, as" +" discussed below. It is an error to specify both *default* and " +"*default_factory*." +msgstr "" +"*default_factory*: در صورت ارائه، باید یک شیء قابل فراخوانی (callable) بدون " +"آرگومان باشد که هنگام نیاز به یک مقدار پیش‌فرض برای این فیلد فراخوانی " +"می‌شود. از جمله کاربردهای دیگر، می‌توان از آن برای مشخص کردن فیلدهایی با " +"مقادیر پیش‌فرض تغییرپذیر استفاده کرد، همان‌طور که در ادامه بحث شده است. مشخص" +" کردن هر دو *default* و *default_factory* خطا است." -msgid "*init*: If true (the default), this field is included as a parameter to the generated :meth:`~object.__init__` method." +msgid "" +"*init*: If true (the default), this field is included as a parameter to the " +"generated :meth:`~object.__init__` method." msgstr "" +"*init*: اگر true باشد (پیش‌فرض)، این فیلد به‌عنوان پارامتری به متد " +"تولیدشده‌ی :meth:`~object.__init__` اضافه می‌شود." -msgid "*repr*: If true (the default), this field is included in the string returned by the generated :meth:`~object.__repr__` method." +msgid "" +"*repr*: If true (the default), this field is included in the string returned" +" by the generated :meth:`~object.__repr__` method." msgstr "" +"*repr*: اگر true باشد (پیش‌فرض)، این فیلد در رشته‌ی برگردانده‌شده توسط متد " +"تولیدشده‌ی :meth:`~object.__repr__` گنجانده می‌شود." -msgid "*hash*: This can be a bool or ``None``. If true, this field is included in the generated :meth:`~object.__hash__` method. If false, this field is excluded from the generated :meth:`~object.__hash__`. If ``None`` (the default), use the value of *compare*: this would normally be the expected behavior, since a field should be included in the hash if it's used for comparisons. Setting this value to anything other than ``None`` is discouraged." -msgstr "" +msgid "" +"*hash*: This can be a bool or ``None``. If true, this field is included in " +"the generated :meth:`~object.__hash__` method. If false, this field is " +"excluded from the generated :meth:`~object.__hash__`. If ``None`` (the " +"default), use the value of *compare*: this would normally be the expected " +"behavior, since a field should be included in the hash if it's used for " +"comparisons. Setting this value to anything other than ``None`` is " +"discouraged." +msgstr "" +"*hash*: این مقدار می‌تواند یک بولی یا ``None`` باشد. اگر True باشد، این فیلد" +" در متد :meth:`~object.__hash__` که تولید می‌شود گنجانده می‌شود. اگر False " +"باشد، این فیلد از متد :meth:`~object.__hash__` که تولید می‌شود حذف می‌شود. " +"اگر ``None`` (پیش‌فرض) باشد، از مقدار *compare* استفاده می‌شود: این معمولاً " +"رفتار مورد انتظار است، زیرا اگر از فیلدی برای مقایسه‌ها استفاده شود، باید آن" +" فیلد در هش گنجانده شود. تنظیم این مقدار به مقداری غیر از ``None`` توصیه " +"نمی‌شود." -msgid "One possible reason to set ``hash=False`` but ``compare=True`` would be if a field is expensive to compute a hash value for, that field is needed for equality testing, and there are other fields that contribute to the type's hash value. Even if a field is excluded from the hash, it will still be used for comparisons." -msgstr "" +msgid "" +"One possible reason to set ``hash=False`` but ``compare=True`` would be if a" +" field is expensive to compute a hash value for, that field is needed for " +"equality testing, and there are other fields that contribute to the type's " +"hash value. Even if a field is excluded from the hash, it will still be " +"used for comparisons." +msgstr "" +"یکی از دلایل ممکن برای تنظیم ``hash=False`` اما ``compare=True`` می‌تواند " +"این باشد که محاسبه‌ی مقدار هش برای یک فیلد پرهزینه باشد، آن فیلد برای آزمون " +"برابری لازم باشد و فیلدهای دیگری وجود داشته باشند که در مقدار هشِ نوع نقش " +"دارند. حتی اگر یک فیلد از هش حذف شده باشد، همچنان برای مقایسه‌ها استفاده " +"خواهد شد." -msgid "*compare*: If true (the default), this field is included in the generated equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object.__gt__`, et al.)." +msgid "" +"*compare*: If true (the default), this field is included in the generated " +"equality and comparison methods (:meth:`~object.__eq__`, " +":meth:`~object.__gt__`, et al.)." msgstr "" +"*compare*: اگر true باشد (پیش‌فرض)، این فیلد در متدهای تولیدشده‌ی برابری و " +"مقایسه (:meth:`~object.__eq__`، :meth:`~object.__gt__` و غیره) گنجانده " +"می‌شود." -msgid "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an empty dict. This value is wrapped in :func:`~types.MappingProxyType` to make it read-only, and exposed on the :class:`Field` object. It is not used at all by Data Classes, and is provided as a third-party extension mechanism. Multiple third-parties can each have their own key, to use as a namespace in the metadata." -msgstr "" +msgid "" +"*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " +"empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " +"make it read-only, and exposed on the :class:`Field` object. It is not used " +"at all by Data Classes, and is provided as a third-party extension " +"mechanism. Multiple third-parties can each have their own key, to use as a " +"namespace in the metadata." +msgstr "" +"*metadata*: این مقدار می‌تواند یک نگاشت یا ``None`` باشد. با ``None`` " +"به‌عنوان یک دیکشنری خالی رفتار می‌شود. این مقدار در " +":func:`~types.MappingProxyType` قرار می‌گیرد تا فقط‌خواندنی شود، و بر روی " +"شیء :class:`Field` نمایان می‌شود. این مقدار به‌هیچ‌وجه توسط Data Classes " +"استفاده نمی‌شود، و به‌عنوان سازوکاری برای توسعه توسط شخص ثالث ارائه شده است." +" چندین شخص ثالث می‌توانند هرکدام کلید خودشان را داشته باشند تا از آن " +"به‌عنوان فضای نام در metadata استفاده کنند." -msgid "*kw_only*: If true, this field will be marked as keyword-only. This is used when the generated :meth:`~object.__init__` method's parameters are computed." +msgid "" +"*kw_only*: If true, this field will be marked as keyword-only. This is used " +"when the generated :meth:`~object.__init__` method's parameters are " +"computed." msgstr "" +"*kw_only*: اگر true باشد، این فیلد به‌عنوان فقط کلیدواژه‌ای علامت‌گذاری " +"می‌شود. این موضوع زمانی استفاده می‌شود که پارامترهای متدِ تولیدشده‌ی " +":meth:`~object.__init__` محاسبه می‌شوند." msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." msgstr "" +"فیلدهای فقط کلیدواژه‌ای نیز در :attr:`!__match_args__` گنجانده نمی‌شوند." msgid "*doc*: optional docstring for this field." -msgstr "" +msgstr "*doc*: رشته‌ی مستندسازی اختیاری برای این فیلد." -msgid "If the default value of a field is specified by a call to :func:`!field`, then the class attribute for this field will be replaced by the specified *default* value. If *default* is not provided, then the class attribute will be deleted. The intent is that after the :deco:`dataclass` decorator runs, the class attributes will all contain the default values for the fields, just as if the default value itself were specified. For example, after::" -msgstr "" +msgid "" +"If the default value of a field is specified by a call to :func:`!field`, " +"then the class attribute for this field will be replaced by the specified " +"*default* value. If *default* is not provided, then the class attribute " +"will be deleted. The intent is that after the :deco:`dataclass` decorator " +"runs, the class attributes will all contain the default values for the " +"fields, just as if the default value itself were specified. For example, " +"after::" +msgstr "" +"اگر مقدار پیش‌فرض یک فیلد با فراخوانی :func:`!field` مشخص شده باشد، آنگاه " +"صفت کلاس مربوط به این فیلد با مقدار *default* مشخص‌شده جایگزین می‌شود. اگر " +"*default* ارائه نشده باشد، آنگاه صفت کلاس حذف می‌شود. هدف این است که پس از " +"اجرای دکوراتور :deco:`dataclass`، صفات کلاس همگی حاوی مقادیر پیش‌فرض فیلدها " +"خواهند بود، درست همان‌گونه که اگر خود مقدار پیش‌فرض مشخص شده باشد. برای " +"مثال، پس از::" msgid "" "@dataclass\n" @@ -260,36 +665,94 @@ msgid "" " z: int = field(repr=False, default=10)\n" " t: int = 20" msgstr "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: int = field(repr=False)\n" +" z: int = field(repr=False, default=10)\n" +" t: int = 20" -msgid "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` will not be set." +msgid "" +"The class attribute :attr:`!C.z` will be ``10``, the class attribute " +":attr:`!C.t` will be ``20``, and the class attributes :attr:`!C.x` and " +":attr:`!C.y` will not be set." msgstr "" +"صفت کلاس :attr:`!C.z` برابر ``10`` خواهد بود، صفت کلاس :attr:`!C.t` برابر " +"``20`` خواهد بود، و صفات کلاس :attr:`!C.x` و :attr:`!C.y` تنظیم نخواهند شد." -msgid ":class:`!Field` objects describe each defined field. These objects are created internally, and are returned by the :func:`fields` module-level method (see below). Users should never instantiate a :class:`!Field` object directly. Its documented attributes are:" +msgid "" +":class:`!Field` objects describe each defined field. These objects are " +"created internally, and are returned by the :func:`fields` module-level " +"method (see below). Users should never instantiate a :class:`!Field` object" +" directly. Its documented attributes are:" msgstr "" +"اشیای :class:`!Field` هر فیلد تعریف‌شده را توصیف می‌کنند. این اشیاء به‌صورت " +"داخلی ایجاد می‌شوند و توسط متد :func:`fields` در سطح ماژول برگردانده می‌شوند" +" (در زیر ببینید). کاربران هرگز نباید یک شیء :class:`!Field` را مستقیماً " +"نمونه‌سازی کنند. ویژگی‌های مستندشده‌ی آن عبارت‌اند از:" msgid ":attr:`!name`: The name of the field." -msgstr "" +msgstr ":attr:`!name`: نام فیلد." msgid ":attr:`!type`: The type of the field." -msgstr "" +msgstr ":attr:`!type`: نوع فیلد." -msgid ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have the identical meaning and values as they do in the :func:`field` function." +msgid "" +":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, " +":attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` " +"have the identical meaning and values as they do in the :func:`field` " +"function." msgstr "" +":attr:`!default`، :attr:`!default_factory`، :attr:`!init`، :attr:`!repr`، " +":attr:`!hash`، :attr:`!compare`، :attr:`!metadata` و :attr:`!kw_only` دقیقاً" +" همان معنا و مقادیری را دارند که در تابع :func:`field` دارند." -msgid "Other attributes may exist, but they are private and must not be inspected or relied on." +msgid "" +"Other attributes may exist, but they are private and must not be inspected " +"or relied on." msgstr "" +"ممکن است ویژگی‌های دیگری نیز وجود داشته باشند، اما آن‌ها خصوصی هستند و نباید" +" بررسی شوند یا به آن‌ها اتکا شود." -msgid "``InitVar[T]`` type annotations describe variables that are :ref:`init-only `. Fields annotated with :class:`!InitVar` are considered pseudo-fields, and thus are neither returned by the :func:`fields` function nor used in any way except adding them as parameters to :meth:`~object.__init__` and an optional :meth:`__post_init__`." -msgstr "" +msgid "" +"``InitVar[T]`` type annotations describe variables that are :ref:`init-only " +"`. Fields annotated with :class:`!InitVar` " +"are considered pseudo-fields, and thus are neither returned by the " +":func:`fields` function nor used in any way except adding them as parameters" +" to :meth:`~object.__init__` and an optional :meth:`__post_init__`." +msgstr "" +"حاشیه‌نویسی‌های نوع ``InitVar[T]`` متغیرهایی را توصیف می‌کنند که :ref:`فقط " +"init ` هستند. فیلدهایی که با " +":class:`!InitVar` حاشیه‌نویسی شده‌اند، شبه‌فیلد محسوب می‌شوند، و بنابراین نه" +" توسط تابع :func:`fields` برگردانده می‌شوند و نه به هیچ شکلی استفاده " +"می‌شوند، مگر اینکه به‌عنوان پارامتر به :meth:`~object.__init__` و یک " +":meth:`__post_init__` اختیاری اضافه شوند." -msgid "Returns a tuple of :class:`Field` objects that define the fields for this dataclass. Accepts either a dataclass, or an instance of a dataclass. Raises :exc:`TypeError` if not passed a dataclass or instance of one. Does not return pseudo-fields which are ``ClassVar`` or ``InitVar``." +msgid "" +"Returns a tuple of :class:`Field` objects that define the fields for this " +"dataclass. Accepts either a dataclass, or an instance of a dataclass. " +"Raises :exc:`TypeError` if not passed a dataclass or instance of one. Does " +"not return pseudo-fields which are ``ClassVar`` or ``InitVar``." msgstr "" +"تاپلی از اشیای :class:`Field` برمی‌گرداند که فیلدهای این دیتاکلاس را تعریف " +"می‌کنند. یک دیتاکلاس یا نمونه‌ای از دیتاکلاس را می‌پذیرد. اگر دیتاکلاس یا " +"نمونه‌ای از آن پاس داده نشود، :exc:`TypeError` را پرتاب می‌کند. شبه‌فیلدهایی" +" که ``ClassVar`` یا ``InitVar`` باشند را برنمی‌گرداند." -msgid "Converts the dataclass *obj* to a dict (by using the factory function *dict_factory*). Each dataclass is converted to a dict of its fields, as ``name: value`` pairs. dataclasses, dicts, lists, and tuples are recursed into. Other objects are copied with :func:`copy.deepcopy`." +msgid "" +"Converts the dataclass *obj* to a dict (by using the factory function " +"*dict_factory*). Each dataclass is converted to a dict of its fields, as " +"``name: value`` pairs. dataclasses, dicts, lists, and tuples are recursed " +"into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" +"دیتاکلاس *obj* را به یک دیکشنری تبدیل می‌کند (با استفاده از تابع کارخانه‌ای " +"*dict_factory*). هر دیتاکلاس به دیکشنری از فیلدهای آن، به‌صورت جفت‌های " +"``name: value`` تبدیل می‌شود. دیتاکلاس‌ها، دیکشنری‌ها، فهرست‌ها و تاپل‌ها " +"به‌صورت بازگشتی پردازش می‌شوند. سایر اشیاء با :func:`copy.deepcopy` کپی " +"می‌شوند." msgid "Example of using :func:`!asdict` on nested dataclasses::" -msgstr "" +msgstr "مثالی از استفاده از :func:`!asdict` روی دیتاکلاس‌های تودرتو::" msgid "" "@dataclass\n" @@ -307,44 +770,114 @@ msgid "" "c = C([Point(0, 0), Point(10, 4)])\n" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" msgstr "" +"@dataclass\n" +"class Point:\n" +" x: int\n" +" y: int\n" +"\n" +"@dataclass\n" +"class C:\n" +" mylist: list[Point]\n" +"\n" +"p = Point(10, 20)\n" +"assert asdict(p) == {'x': 10, 'y': 20}\n" +"\n" +"c = C([Point(0, 0), Point(10, 4)])\n" +"assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" msgid "To create a shallow copy, the following workaround may be used::" -msgstr "" +msgstr "برای ایجاد یک کپی سطحی، می‌توان از راه‌حل جایگزین زیر استفاده کرد::" msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" -msgstr "" +msgstr "{field.name: getattr(obj, field.name) for field in fields(obj)}" -msgid ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." +msgid "" +":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass " +"instance." msgstr "" +":func:`!asdict` در صورتی که *obj* نمونه‌ای از دیتاکلاس (dataclass) نباشد، " +":exc:`TypeError` را پرتاب می‌کند." -msgid "Converts the dataclass *obj* to a tuple (by using the factory function *tuple_factory*). Each dataclass is converted to a tuple of its field values. dataclasses, dicts, lists, and tuples are recursed into. Other objects are copied with :func:`copy.deepcopy`." +msgid "" +"Converts the dataclass *obj* to a tuple (by using the factory function " +"*tuple_factory*). Each dataclass is converted to a tuple of its field " +"values. dataclasses, dicts, lists, and tuples are recursed into. Other " +"objects are copied with :func:`copy.deepcopy`." msgstr "" +"دیتاکلاس *obj* را به یک تاپل تبدیل می‌کند (با استفاده از تابع کارخانه‌ای " +"*tuple_factory*). هر دیتاکلاس به یک تاپل از مقادیر فیلدهای آن تبدیل می‌شود. " +"دیتاکلاس‌ها، دیکشنری‌ها، فهرست‌ها و تاپل‌ها به‌صورت بازگشتی پیمایش می‌شوند. " +"سایر اشیاء با :func:`copy.deepcopy` کپی می‌شوند." msgid "Continuing from the previous example::" -msgstr "" +msgstr "در ادامه از مثال پیشین::" msgid "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" msgstr "" +"assert astuple(p) == (10, 20)\n" +"assert astuple(c) == ([(0, 0), (10, 4)],)" msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -msgstr "" +msgstr "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -msgid ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass instance." +msgid "" +":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " +"instance." msgstr "" +":func:`!astuple` در صورتی که *obj* نمونه‌ای از dataclass نباشد، " +":exc:`TypeError` را پرتاب می‌کند." -msgid "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, base classes as given in *bases*, and initialized with a namespace as given in *namespace*. *fields* is an iterable whose elements are each either ``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is supplied, :data:`typing.Any` is used for ``type``. The values of *init*, *repr*, *eq*, *order*, *unsafe_hash*, *frozen*, *match_args*, *kw_only*, *slots*, and *weakref_slot* have the same meaning as they do in :deco:`dataclass`." -msgstr "" +msgid "" +"Creates a new dataclass with name *cls_name*, fields as defined in *fields*," +" base classes as given in *bases*, and initialized with a namespace as given" +" in *namespace*. *fields* is an iterable whose elements are each either " +"``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is" +" supplied, :data:`typing.Any` is used for ``type``. The values of *init*, " +"*repr*, *eq*, *order*, *unsafe_hash*, *frozen*, *match_args*, *kw_only*, " +"*slots*, and *weakref_slot* have the same meaning as they do in " +":deco:`dataclass`." +msgstr "" +"یک دیتاکلاس (dataclass) جدید با نام *cls_name*، فیلدهای تعریف‌شده در " +"*fields*، کلاس‌های پایه داده‌شده در *bases* ایجاد می‌کند و آن را با فضای نام" +" داده‌شده در *namespace* مقداردهی اولیه می‌کند. *fields* یک پیمایش‌پذیر است که" +" هر یک از عناصر آن یکی از ``name``، ``(name, type)`` یا ``(name, type, " +"Field)`` است. اگر فقط ``name`` ارائه شود، برای ``type`` از " +":data:`typing.Any` استفاده می‌شود. مقادیر *init*، *repr*، *eq*، *order*، " +"*unsafe_hash*، *frozen*، *match_args*، *kw_only*، *slots* و *weakref_slot* " +"همان معنایی را دارند که در :deco:`dataclass` دارند." -msgid "If *module* is defined, the :attr:`!__module__` attribute of the dataclass is set to that value. By default, it is set to the module name of the caller." +msgid "" +"If *module* is defined, the :attr:`!__module__` attribute of the dataclass " +"is set to that value. By default, it is set to the module name of the " +"caller." msgstr "" +"اگر *module* تعریف‌شده باشد، ویژگی :attr:`!__module__` دیتاکلاس (dataclass) " +"به آن مقدار تنظیم می‌شود. به‌طور پیش‌فرض، این ویژگی به نام ماژول فراخواننده " +"تنظیم می‌شود." -msgid "The *decorator* parameter is a callable that will be used to create the dataclass. It should take the class object as a first argument and the same keyword arguments as :deco:`dataclass`. By default, the :deco:`dataclass` function is used." +msgid "" +"The *decorator* parameter is a callable that will be used to create the " +"dataclass. It should take the class object as a first argument and the same " +"keyword arguments as :deco:`dataclass`. By default, the :deco:`dataclass` " +"function is used." msgstr "" +"پارامتر *decorator* یک شیء فراخوان‌پذیر است که برای ایجاد دیتاکلاس " +"(dataclass) استفاده خواهد شد. این فراخوان‌پذیر باید شیء کلاس را به‌عنوان " +"اولین آرگومان و همان آرگومان‌های کلیدواژه‌ایِ :deco:`dataclass` را نیز " +"بپذیرد. به‌طور پیش‌فرض، از تابع :deco:`dataclass` استفاده می‌شود." -msgid "This function is not strictly required, because any Python mechanism for creating a new class with :attr:`~object.__annotations__` can then apply the :deco:`dataclass` function to convert that class to a dataclass. This function is provided as a convenience. For example::" +msgid "" +"This function is not strictly required, because any Python mechanism for " +"creating a new class with :attr:`~object.__annotations__` can then apply the" +" :deco:`dataclass` function to convert that class to a dataclass. This " +"function is provided as a convenience. For example::" msgstr "" +"این تابع به‌طور اکید الزامی نیست، زیرا هر سازوکار پایتون برای ایجاد یک کلاس " +"جدید با :attr:`~object.__annotations__` می‌تواند سپس تابع :deco:`dataclass` " +"را برای تبدیل آن کلاس به یک دیتاکلاس (dataclass) اعمال کند. این تابع برای " +"سهولت ارائه شده است. برای مثال::" msgid "" "C = make_dataclass('C',\n" @@ -353,9 +886,14 @@ msgid "" " ('z', int, field(default=5))],\n" " namespace={'add_one': lambda self: self.x + 1})" msgstr "" +"C = make_dataclass('C',\n" +" [('x', int),\n" +" 'y',\n" +" ('z', int, field(default=5))],\n" +" namespace={'add_one': lambda self: self.x + 1})" msgid "Is equivalent to::" -msgstr "" +msgstr "معادل است با::" msgid "" "@dataclass\n" @@ -367,47 +905,132 @@ msgid "" " def add_one(self):\n" " return self.x + 1" msgstr "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: 'typing.Any'\n" +" z: int = 5\n" +"\n" +" def add_one(self):\n" +" return self.x + 1" msgid "Added the *decorator* parameter." -msgstr "" +msgstr "پارامتر *decorator* اضافه شد." -msgid "Creates a new object of the same type as *obj*, replacing fields with values from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If keys in *changes* are not field names of the given dataclass, raises :exc:`TypeError`." +msgid "" +"Creates a new object of the same type as *obj*, replacing fields with values" +" from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If" +" keys in *changes* are not field names of the given dataclass, raises " +":exc:`TypeError`." msgstr "" +"یک شیء جدید از همان نوع *obj* ایجاد می‌کند و فیلدها را با مقادیر *changes* " +"جایگزین می‌کند. اگر *obj* یک دیتاکلاس نباشد، :exc:`TypeError` را پرتاب " +"می‌کند. اگر کلیدهای موجود در *changes* نام فیلدهای دیتادیتاکلاس‌شده " +"نباشند، :exc:`TypeError` را پرتاب می‌کند." -msgid "The newly returned object is created by calling the :meth:`~object.__init__` method of the dataclass. This ensures that :meth:`__post_init__`, if present, is also called." +msgid "" +"The newly returned object is created by calling the :meth:`~object.__init__`" +" method of the dataclass. This ensures that :meth:`__post_init__`, if " +"present, is also called." msgstr "" +"شیء تازه بازگشت‌داده‌شده با فراخوانی متد :meth:`~object.__init__` دیتاکلاس " +"ایجاد می‌شود. این امر تضمین می‌کند که :meth:`__post_init__`، در صورت وجود، " +"نیز فراخوانی شود." -msgid "Init-only variables without default values, if any exist, must be specified on the call to :func:`!replace` so that they can be passed to :meth:`!__init__` and :meth:`__post_init__`." +msgid "" +"Init-only variables without default values, if any exist, must be specified " +"on the call to :func:`!replace` so that they can be passed to " +":meth:`!__init__` and :meth:`__post_init__`." msgstr "" +"متغیرهای فقط مقداردهی اولیه بدون مقدار پیش‌فرض، در صورت وجود، باید در " +"فراخوانی :func:`!replace` مشخص شوند تا بتوان آن‌ها را به :meth:`!__init__` و" +" :meth:`__post_init__` ارسال کرد." -msgid "It is an error for *changes* to contain any fields that are defined as having ``init=False``. A :exc:`ValueError` will be raised in this case." +msgid "" +"It is an error for *changes* to contain any fields that are defined as " +"having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" +"وجود هر فیلدی در *changes* که با ``init=False`` تعریف شده باشد، خطا است. در " +"این حالت یک :exc:`ValueError` پرتاب خواهد شد." -msgid "Be forewarned about how ``init=False`` fields work during a call to :func:`!replace`. They are not copied from the source object, but rather are initialized in :meth:`__post_init__`, if they're initialized at all. It is expected that ``init=False`` fields will be rarely and judiciously used. If they are used, it might be wise to have alternate class constructors, or perhaps a custom :func:`!replace` (or similarly named) method which handles instance copying." -msgstr "" +msgid "" +"Be forewarned about how ``init=False`` fields work during a call to " +":func:`!replace`. They are not copied from the source object, but rather " +"are initialized in :meth:`__post_init__`, if they're initialized at all. It" +" is expected that ``init=False`` fields will be rarely and judiciously used." +" If they are used, it might be wise to have alternate class constructors, " +"or perhaps a custom :func:`!replace` (or similarly named) method which " +"handles instance copying." +msgstr "" +"از پیش آگاه باشید که فیلدهای ``init=False`` در هنگام فراخوانی " +":func:`!replace` چگونه کار می‌کنند. آن‌ها از شیء مبدأ کپی نمی‌شوند، بلکه در " +":meth:`__post_init__` مقداردهی اولیه می‌شوند، اگر اصلاً مقداردهی اولیه شوند." +" انتظار می‌رود فیلدهای ``init=False`` به‌ندرت و با تدبیر مورد استفاده قرار " +"گیرند. اگر از آن‌ها استفاده شود، شاید بهتر باشد سازنده‌های جایگزین کلاس یا " +"شاید یک متد سفارشی :func:`!replace` (یا با نام مشابه) داشته باشید که کپی " +"نمونه را مدیریت می‌کند." -msgid "Dataclass instances are also supported by generic function :func:`copy.replace`." +msgid "" +"Dataclass instances are also supported by generic function " +":func:`copy.replace`." msgstr "" +"تابع عام :func:`copy.replace` نیز از نمونه‌های دیتاکلاس (Dataclass) پشتیبانی" +" می‌کند." -msgid "Return ``True`` if its parameter is a dataclass (including subclasses of a dataclass, but not including :ref:`generic aliases `) or an instance of one, otherwise return ``False``." +msgid "" +"Return ``True`` if its parameter is a dataclass (including subclasses of a " +"dataclass, but not including :ref:`generic aliases `) or" +" an instance of one, otherwise return ``False``." msgstr "" +"اگر پارامتر آن یک دیتاکلاس (dataclass) باشد (شامل زیرکلاس‌های یک دیتاکلاس، " +"اما نه شامل :ref:`نام‌های مستعار عام `) یا نمونه‌ای از " +"آن باشد، ``True`` و در غیر این صورت ``False`` برمی‌گرداند." -msgid "If you need to know if a class is an instance of a dataclass (and not a dataclass itself), then add a further check for ``not isinstance(obj, type)``::" +msgid "" +"If you need to know if a class is an instance of a dataclass (and not a " +"dataclass itself), then add a further check for ``not isinstance(obj, " +"type)``::" msgstr "" +"اگر نیاز دارید بدانید که آیا یک کلاس نمونه‌ای از یک دیتاکلاس (dataclass) است" +" (و نه خود یک دیتاکلاس)، آنگاه یک بررسی دیگر برای ``not isinstance(obj, " +"type)`` اضافه کنید::" msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" msgstr "" +"def is_dataclass_instance(obj):\n" +" return is_dataclass(obj) and not isinstance(obj, type)" msgid "A sentinel value signifying a missing default or default_factory." msgstr "" +"یک مقدار نشانگر (sentinel) که نشان‌دهنده‌ی نبود default یا default_factory " +"است." -msgid "A sentinel value used as a type annotation. Any fields after a pseudo-field with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely ignored. This includes the name of such a field. By convention, a name of ``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields signify :meth:`~object.__init__` parameters that must be specified as keywords when the class is instantiated." -msgstr "" +msgid "" +"A sentinel value used as a type annotation. Any fields after a pseudo-field" +" with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note" +" that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely " +"ignored. This includes the name of such a field. By convention, a name of " +"``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields signify " +":meth:`~object.__init__` parameters that must be specified as keywords when " +"the class is instantiated." +msgstr "" +"یک مقدار نشانگر (sentinel value) که به‌عنوان حاشیه‌نویسی نوع استفاده می‌شود. " +"هر فیلدی که پس از یک شبه‌فیلد (pseudo-field) با نوع :const:`!KW_ONLY` قرار " +"گیرد، به‌عنوان فیلد فقط کلیدواژه‌ای علامت‌گذاری می‌شود. توجه داشته باشید که " +"یک شبه‌فیلد از نوع :const:`!KW_ONLY` در موارد دیگر به‌طور کامل نادیده گرفته" +" می‌شود. این موضوع شامل نام چنین فیلدی نیز می‌شود. طبق قرارداد، برای یک فیلد" +" :const:`!KW_ONLY` از نام ``_`` استفاده می‌شود. فیلدهای فقط کلیدواژه‌ای نشان" +" می‌دهند که پارامترهای :meth:`~object.__init__` باید هنگام نمونه‌سازی از " +"کلاس به‌صورت کلیدواژه مشخص شوند." -msgid "In this example, the fields ``y`` and ``z`` will be marked as keyword-only fields::" +msgid "" +"In this example, the fields ``y`` and ``z`` will be marked as keyword-only " +"fields::" msgstr "" +"در این مثال، فیلدهای ``y`` و ``z`` به‌عنوان فیلدهای فقط کلیدواژه‌ای " +"علامت‌گذاری خواهند شد::" msgid "" "@dataclass\n" @@ -419,21 +1042,56 @@ msgid "" "\n" "p = Point(0, y=1.5, z=2.0)" msgstr "" +"@dataclass\n" +"class Point:\n" +" x: float\n" +" _: KW_ONLY\n" +" y: float\n" +" z: float\n" +"\n" +"p = Point(0, y=1.5, z=2.0)" -msgid "In a single dataclass, it is an error to specify more than one field whose type is :const:`!KW_ONLY`." +msgid "" +"In a single dataclass, it is an error to specify more than one field whose " +"type is :const:`!KW_ONLY`." msgstr "" +"در یک دیتاکلاس واحد، مشخص کردن بیش از یک فیلد که نوع آن :const:`!KW_ONLY` " +"باشد، خطا است." -msgid "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is called on a dataclass which was defined with ``frozen=True``. It is a subclass of :exc:`AttributeError`." +msgid "" +"Raised when an implicitly defined :meth:`~object.__setattr__` or " +":meth:`~object.__delattr__` is called on a dataclass which was defined with " +"``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" +"هنگامی پرتاب می‌شود که یک :meth:`~object.__setattr__` یا " +":meth:`~object.__delattr__` تعریف‌شده به‌صورت ضمنی، روی یک دیتاکلاس " +"(dataclass) که با ``frozen=True`` تعریف شده باشد، فراخوانی شود. این استثنا " +"زیرکلاسی از :exc:`AttributeError` است." msgid "Post-init processing" -msgstr "" +msgstr "پردازش پس از init" -msgid "When defined on the class, it will be called by the generated :meth:`~object.__init__`, normally as :meth:`!self.__post_init__`. However, if any ``InitVar`` fields are defined, they will also be passed to :meth:`!__post_init__` in the order they were defined in the class. If no :meth:`!__init__` method is generated, then :meth:`!__post_init__` will not automatically be called." -msgstr "" +msgid "" +"When defined on the class, it will be called by the generated " +":meth:`~object.__init__`, normally as :meth:`!self.__post_init__`. However, " +"if any ``InitVar`` fields are defined, they will also be passed to " +":meth:`!__post_init__` in the order they were defined in the class. If no " +":meth:`!__init__` method is generated, then :meth:`!__post_init__` will not " +"automatically be called." +msgstr "" +"هنگامی که در کلاس تعریف شود، توسط :meth:`~object.__init__` تولیدشده فراخوانی" +" می‌شود، معمولاً به‌صورت :meth:`!self.__post_init__`. با این حال، اگر " +"فیلدهای ``InitVar`` تعریف شده باشند، آن‌ها نیز به :meth:`!__post_init__` به " +"همان ترتیبی که در کلاس تعریف شده‌اند ارسال می‌شوند. اگر متد " +":meth:`!__init__` تولید نشود، در این صورت :meth:`!__post_init__` به‌صورت " +"خودکار فراخوانی نمی‌شود." -msgid "Among other uses, this allows for initializing field values that depend on one or more other fields. For example::" +msgid "" +"Among other uses, this allows for initializing field values that depend on " +"one or more other fields. For example::" msgstr "" +"در میان سایر کاربردها، این امر امکان مقداردهی اولیه‌ی مقادیر فیلدهایی را " +"فراهم می‌کند که به یک یا چند فیلد دیگر وابسته‌اند. برای مثال::" msgid "" "@dataclass\n" @@ -445,9 +1103,25 @@ msgid "" " def __post_init__(self):\n" " self.c = self.a + self.b" msgstr "" +"@dataclass\n" +"class C:\n" +" a: float\n" +" b: float\n" +" c: float = field(init=False)\n" +"\n" +" def __post_init__(self):\n" +" self.c = self.a + self.b" -msgid "The :meth:`~object.__init__` method generated by :deco:`dataclass` does not call base class :meth:`!__init__` methods. If the base class has an :meth:`!__init__` method that has to be called, it is common to call this method in a :meth:`__post_init__` method::" +msgid "" +"The :meth:`~object.__init__` method generated by :deco:`dataclass` does not " +"call base class :meth:`!__init__` methods. If the base class has an " +":meth:`!__init__` method that has to be called, it is common to call this " +"method in a :meth:`__post_init__` method::" msgstr "" +"متد :meth:`~object.__init__` تولیدشده توسط :deco:`dataclass`، متدهای " +":meth:`!__init__` کلاس پایه را فراخوانی نمی‌کند. اگر کلاس پایه یک متد " +":meth:`!__init__` داشته باشد که باید فراخوانی شود، رایج است که این متد در یک" +" متد :meth:`__post_init__` فراخوانی شود::" msgid "" "class Rectangle:\n" @@ -462,27 +1136,87 @@ msgid "" " def __post_init__(self):\n" " super().__init__(self.side, self.side)" msgstr "" +"class Rectangle:\n" +" def __init__(self, height, width):\n" +" self.height = height\n" +" self.width = width\n" +"\n" +"@dataclass\n" +"class Square(Rectangle):\n" +" side: float\n" +"\n" +" def __post_init__(self):\n" +" super().__init__(self.side, self.side)" -msgid "Note, however, that in general the dataclass-generated :meth:`!__init__` methods don't need to be called, since the derived dataclass will take care of initializing all fields of any base class that is a dataclass itself." +msgid "" +"Note, however, that in general the dataclass-generated :meth:`!__init__` " +"methods don't need to be called, since the derived dataclass will take care " +"of initializing all fields of any base class that is a dataclass itself." msgstr "" +"با این حال، توجه داشته باشید که به‌طور کلی نیازی به فراخوانی متدهای " +":meth:`!__init__` تولیدشده توسط دیتاکلاس نیست، زیرا دیتاکلاس مشتق‌شده " +"مقداردهی اولیه‌ی تمام فیلدهای هر کلاس پایه‌ای که خود یک دیتاکلاس است را بر " +"عهده می‌گیرد." -msgid "See the section below on init-only variables for ways to pass parameters to :meth:`!__post_init__`. Also see the warning about how :func:`replace` handles ``init=False`` fields." +msgid "" +"See the section below on init-only variables for ways to pass parameters to " +":meth:`!__post_init__`. Also see the warning about how :func:`replace` " +"handles ``init=False`` fields." msgstr "" +"برای روش‌های ارسال پارامترها به :meth:`!__post_init__`، بخش زیر درباره‌ی " +"متغیرهای فقط مقداردهی اولیه (init-only) را ببینید. همچنین هشدار درباره‌ی " +"چگونگی مدیریت فیلدهای ``init=False`` توسط :func:`replace` را ببینید." msgid "Class variables" -msgstr "" +msgstr "متغیرهای کلاس" -msgid "One of the few places where :deco:`dataclass` actually inspects the type of a field is to determine if a field is a class variable as defined in :pep:`526`. It does this by checking if the type of the field is :data:`typing.ClassVar`. If a field is a ``ClassVar``, it is excluded from consideration as a field and is ignored by the dataclass mechanisms. Such ``ClassVar`` pseudo-fields are not returned by the module-level :func:`fields` function." -msgstr "" +msgid "" +"One of the few places where :deco:`dataclass` actually inspects the type of " +"a field is to determine if a field is a class variable as defined in " +":pep:`526`. It does this by checking if the type of the field is " +":data:`typing.ClassVar`. If a field is a ``ClassVar``, it is excluded from " +"consideration as a field and is ignored by the dataclass mechanisms. Such " +"``ClassVar`` pseudo-fields are not returned by the module-level " +":func:`fields` function." +msgstr "" +"یکی از معدود مواردی که :deco:`dataclass` در واقع نوع یک فیلد را بررسی " +"می‌کند، تشخیص این است که آیا یک فیلد یک متغیر کلاس است، همان‌طور که در " +":pep:`526` تعریف شده است. این کار با بررسی این‌که آیا نوع فیلد " +":data:`typing.ClassVar` است انجام می‌شود. اگر یک فیلد ``ClassVar`` باشد، از " +"در نظر گرفته شدن به‌عنوان یک فیلد خارج می‌شود و سازوکارهای dataclass آن را " +"نادیده می‌گیرند. چنین شبه‌فیلدهایی از جنس ``ClassVar`` توسط تابع " +":func:`fields` در سطح ماژول برگردانده نمی‌شوند." msgid "Init-only variables" -msgstr "" +msgstr "متغیرهای فقط مقداردهی اولیه" -msgid "Another place where :deco:`dataclass` inspects a type annotation is to determine if a field is an init-only variable. It does this by seeing if the type of a field is of type :class:`InitVar`. If a field is an :class:`InitVar`, it is considered a pseudo-field called an init-only field. As it is not a true field, it is not returned by the module-level :func:`fields` function. Init-only fields are added as parameters to the generated :meth:`~object.__init__` method, and are passed to the optional :meth:`__post_init__` method. They are not otherwise used by dataclasses." -msgstr "" +msgid "" +"Another place where :deco:`dataclass` inspects a type annotation is to " +"determine if a field is an init-only variable. It does this by seeing if " +"the type of a field is of type :class:`InitVar`. If a field is an " +":class:`InitVar`, it is considered a pseudo-field called an init-only field." +" As it is not a true field, it is not returned by the module-level " +":func:`fields` function. Init-only fields are added as parameters to the " +"generated :meth:`~object.__init__` method, and are passed to the optional " +":meth:`__post_init__` method. They are not otherwise used by dataclasses." +msgstr "" +"مورد دیگری که در آن :deco:`dataclass` یک حاشیه‌نویسی نوع را بررسی می‌کند، " +"برای تشخیص این است که آیا یک فیلد یک متغیر فقط مقداردهی اولیه است یا خیر. " +"این کار را با بررسی این انجام می‌دهد که آیا نوع یک فیلد از نوع " +":class:`InitVar` است یا خیر. اگر یک فیلد از نوع :class:`InitVar` باشد، " +"به‌عنوان یک شبه‌فیلد به نام فیلد فقط مقداردهی اولیه در نظر گرفته می‌شود. از " +"آنجا که فیلد واقعی نیست، توسط تابع :func:`fields` در سطح ماژول برگردانده " +"نمی‌شود. فیلدهای فقط مقداردهی اولیه به‌عنوان پارامتر به متد تولیدشده‌ی " +":meth:`~object.__init__` اضافه می‌شوند، و به متد اختیاری " +":meth:`__post_init__` ارسال می‌شوند. به‌جز این موارد، دیتاکلاس‌ها از آن‌ها " +"استفاده نمی‌کنند." -msgid "For example, suppose a field will be initialized from a database, if a value is not provided when creating the class::" +msgid "" +"For example, suppose a field will be initialized from a database, if a value" +" is not provided when creating the class::" msgstr "" +"برای مثال، فرض کنید اگر هنگام ایجاد کلاس مقداری ارائه نشود، یک فیلد از " +"پایگاه داده مقداردهی اولیه می‌شود::" msgid "" "@dataclass\n" @@ -497,24 +1231,72 @@ msgid "" "\n" "c = C(10, database=my_database)" msgstr "" +"@dataclass\n" +"class C:\n" +" i: int\n" +" j: int | None = None\n" +" database: InitVar[DatabaseType | None] = None\n" +"\n" +" def __post_init__(self, database):\n" +" if self.j is None and database is not None:\n" +" self.j = database.lookup('j')\n" +"\n" +"c = C(10, database=my_database)" -msgid "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!i` and :attr:`!j`, but not for :attr:`!database`." +msgid "" +"In this case, :func:`fields` will return :class:`Field` objects for " +":attr:`!i` and :attr:`!j`, but not for :attr:`!database`." msgstr "" +"در این حالت، :func:`fields` اشیاء :class:`Field` را برای :attr:`!i` و " +":attr:`!j` برمی‌گرداند، اما نه برای :attr:`!database`." msgid "Frozen instances" -msgstr "" +msgstr "نمونه‌های فریزشده" -msgid "It is not possible to create truly immutable Python objects. However, by passing ``frozen=True`` to the :deco:`dataclass` decorator you can emulate immutability. In that case, dataclasses will add :meth:`~object.__setattr__` and :meth:`~object.__delattr__` methods to the class. These methods will raise a :exc:`FrozenInstanceError` when invoked." -msgstr "" +msgid "" +"It is not possible to create truly immutable Python objects. However, by " +"passing ``frozen=True`` to the :deco:`dataclass` decorator you can emulate " +"immutability. In that case, dataclasses will add " +":meth:`~object.__setattr__` and :meth:`~object.__delattr__` methods to the " +"class. These methods will raise a :exc:`FrozenInstanceError` when invoked." +msgstr "" +"ایجاد اشیای پایتونی که واقعاً تغییرناپذیر باشند، امکان‌پذیر نیست. با این " +"حال، با ارسال ``frozen=True`` به دکوراتور :deco:`dataclass` می‌توانید " +"تغییرناپذیری را شبیه‌سازی کنید. در این صورت، دیتاکلاس‌ها متدهای " +":meth:`~object.__setattr__` و :meth:`~object.__delattr__` را به کلاس اضافه " +"می‌کنند. این متدها هنگام فراخوانی، :exc:`FrozenInstanceError` را پرتاب " +"می‌کنند." -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__`." +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__`." msgstr "" +"هنگام استفاده از ``frozen=True``، هزینه عملکردی بسیار کمی وجود دارد: " +":meth:`~object.__init__` نمی‌تواند از انتساب ساده برای مقداردهی اولیه " +"فیلدها استفاده کند و باید از :meth:`!object.__setattr__` استفاده کند." msgid "Inheritance" -msgstr "" +msgstr "وراثت" -msgid "When the dataclass is being created by the :deco:`dataclass` decorator, it looks through all of the class's base classes in reverse MRO (that is, starting at :class:`object`) and, for each dataclass that it finds, adds the fields from that base class to an ordered mapping of fields. After all of the base class fields are added, it adds its own fields to the ordered mapping. All of the generated methods will use this combined, calculated ordered mapping of fields. Because the fields are in insertion order, derived classes override base classes. An example::" -msgstr "" +msgid "" +"When the dataclass is being created by the :deco:`dataclass` decorator, it " +"looks through all of the class's base classes in reverse MRO (that is, " +"starting at :class:`object`) and, for each dataclass that it finds, adds the" +" fields from that base class to an ordered mapping of fields. After all of " +"the base class fields are added, it adds its own fields to the ordered " +"mapping. All of the generated methods will use this combined, calculated " +"ordered mapping of fields. Because the fields are in insertion order, " +"derived classes override base classes. An example::" +msgstr "" +"هنگامی که دیتاکلاس (dataclass) توسط دکوراتور :deco:`dataclass` ایجاد می‌شود،" +" این دکوراتور همه‌ی کلاس‌های پایه‌ی کلاس را در MRO معکوس (یعنی با شروع از " +":class:`object`) بررسی می‌کند و برای هر دیتاکلاسی که پیدا کند، فیلدهای آن " +"کلاس پایه را به یک نگاشت مرتب از فیلدها اضافه می‌کند. پس از افزودن همه‌ی " +"فیلدهای کلاس‌های پایه، فیلدهای خودش را به نگاشت مرتب اضافه می‌کند. همه‌ی " +"متدهای تولیدشده از این نگاشت مرتبِ محاسبه‌شده و ترکیبی فیلدها استفاده " +"خواهند کرد. چون فیلدها به ترتیب درج قرار دارند، کلاس‌های مشتق‌شده کلاس‌های " +"پایه را می‌پوشانند. یک مثال::" msgid "" "@dataclass\n" @@ -527,24 +1309,57 @@ msgid "" " z: int = 10\n" " x: int = 15" msgstr "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" y: int = 0\n" +"\n" +"@dataclass\n" +"class C(Base):\n" +" z: int = 10\n" +" x: int = 15" -msgid "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!C`." +msgid "" +"The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " +"The final type of :attr:`!x` is :class:`int`, as specified in class " +":class:`!C`." msgstr "" +"فهرست نهایی فیلدها، به ترتیب، :attr:`!x`، :attr:`!y`، :attr:`!z` است. نوع " +"نهایی :attr:`!x`، :class:`int` است، همان‌طور که در کلاس :class:`!C` مشخص شده" +" است." -msgid "The generated :meth:`~object.__init__` method for :class:`!C` will look like::" +msgid "" +"The generated :meth:`~object.__init__` method for :class:`!C` will look " +"like::" msgstr "" +"متد :meth:`~object.__init__` تولیدشده برای :class:`!C` به‌شکل زیر خواهد " +"بود::" msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" -msgstr "" +msgstr "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" -msgstr "" +msgstr "تغییر ترتیب پارامترهای فقط کلیدواژه‌ای در :meth:`!__init__`" -msgid "After the parameters needed for :meth:`~object.__init__` are computed, any keyword-only parameters are moved to come after all regular (non-keyword-only) parameters. This is a requirement of how keyword-only parameters are implemented in Python: they must come after non-keyword-only parameters." +msgid "" +"After the parameters needed for :meth:`~object.__init__` are computed, any " +"keyword-only parameters are moved to come after all regular (non-keyword-" +"only) parameters. This is a requirement of how keyword-only parameters are " +"implemented in Python: they must come after non-keyword-only parameters." msgstr "" +"پس از این که پارامترهای مورد نیاز برای :meth:`~object.__init__` محاسبه شدند،" +" همه‌ی پارامترهای فقط کلیدواژه‌ای جابه‌جا می‌شوند تا پس از تمام پارامترهای " +"معمولی (غیر فقط کلیدواژه‌ای) قرار بگیرند. این یک الزام در نحوه‌ی پیاده‌سازی " +"پارامترهای فقط کلیدواژه‌ای در پایتون است: آن‌ها باید پس از پارامترهای غیر " +"فقط کلیدواژه‌ای بیایند." -msgid "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular fields::" +msgid "" +"In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " +"keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " +"fields::" msgstr "" +"در این مثال، :attr:`!Base.y`، :attr:`!Base.w` و :attr:`!D.t` فیلدهای فقط " +"کلیدواژه‌ای هستند و :attr:`!Base.x` و :attr:`!D.z` فیلدهای معمولی هستند::" msgid "" "@dataclass\n" @@ -559,36 +1374,83 @@ msgid "" " z: int = 10\n" " t: int = field(kw_only=True, default=0)" msgstr "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" _: KW_ONLY\n" +" y: int = 0\n" +" w: int = 1\n" +"\n" +"@dataclass\n" +"class D(Base):\n" +" z: int = 10\n" +" t: int = field(kw_only=True, default=0)" -msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" +msgid "" +"The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "" +"متد تولیدشده‌ی :meth:`!__init__` برای :class:`!D` به‌صورت زیر خواهد بود::" -msgid "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: int = 0):" +msgid "" +"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t:" +" int = 0):" msgstr "" +"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t:" +" int = 0):" -msgid "Note that the parameters have been re-ordered from how they appear in the list of fields: parameters derived from regular fields are followed by parameters derived from keyword-only fields." +msgid "" +"Note that the parameters have been re-ordered from how they appear in the " +"list of fields: parameters derived from regular fields are followed by " +"parameters derived from keyword-only fields." msgstr "" +"توجه داشته باشید که پارامترها نسبت به آنچه در فهرست فیلدها آمده است دوباره " +"مرتب شده‌اند: پس از پارامترهای حاصل از فیلدهای عادی، پارامترهای حاصل از " +"فیلدهای فقط کلیدواژه‌ای می‌آیند." -msgid "The relative ordering of keyword-only parameters is maintained in the re-ordered :meth:`!__init__` parameter list." +msgid "" +"The relative ordering of keyword-only parameters is maintained in the re-" +"ordered :meth:`!__init__` parameter list." msgstr "" +"ترتیب نسبی پارامترهای فقط کلیدواژه‌ای در فهرست پارامترهای :meth:`!__init__` " +"که دوباره مرتب‌شده است، حفظ می‌شود." msgid "Default factory functions" -msgstr "" +msgstr "توابع کارخانه پیش‌فرض" -msgid "If a :func:`field` specifies a *default_factory*, it is called with zero arguments when a default value for the field is needed. For example, to create a new instance of a list, use::" +msgid "" +"If a :func:`field` specifies a *default_factory*, it is called with zero " +"arguments when a default value for the field is needed. For example, to " +"create a new instance of a list, use::" msgstr "" +"اگر یک :func:`field` یک *default_factory* تعیین کند، هنگامی که به یک مقدار " +"پیش‌فرض برای آن فیلد نیاز باشد، با صفر آرگومان فراخوانی می‌شود. برای مثال، " +"برای ایجاد یک نمونه جدید از فهرست، به‌صورت زیر عمل کنید::" msgid "mylist: list = field(default_factory=list)" -msgstr "" +msgstr "mylist: list = field(default_factory=list)" -msgid "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) and the field also specifies *default_factory*, then the default factory function will always be called from the generated :meth:`!__init__` function. This happens because there is no other way to give the field an initial value." -msgstr "" +msgid "" +"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " +"and the field also specifies *default_factory*, then the default factory " +"function will always be called from the generated :meth:`!__init__` " +"function. This happens because there is no other way to give the field an " +"initial value." +msgstr "" +"اگر یک فیلد از :meth:`~object.__init__` حذف‌شده باشد (با استفاده از " +"``init=False``) و برای آن فیلد همچنین *default_factory* مشخص‌شده باشد، آنگاه" +" تابع کارخانه‌ی پیش‌فرض همیشه از تابع :meth:`!__init__` تولیدشده فراخوانی " +"می‌شود. این امر به این دلیل است که هیچ راه دیگری برای دادن یک مقدار اولیه به" +" فیلد وجود ندارد." msgid "Mutable default values" -msgstr "" +msgstr "مقادیر پیش‌فرض تغییرپذیر" -msgid "Python stores default member variable values in class attributes. Consider this example, not using dataclasses::" +msgid "" +"Python stores default member variable values in class attributes. Consider " +"this example, not using dataclasses::" msgstr "" +"پایتون مقادیر پیش‌فرض متغیرهای عضو را در ویژگی‌های کلاس ذخیره می‌کند. این " +"مثال را در نظر بگیرید که از dataclasses استفاده نمی‌کند::" msgid "" "class C:\n" @@ -603,12 +1465,27 @@ msgid "" "assert o1.x == [1, 2]\n" "assert o1.x is o2.x" msgstr "" +"class C:\n" +" x = []\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"o1 = C()\n" +"o2 = C()\n" +"o1.add(1)\n" +"o2.add(2)\n" +"assert o1.x == [1, 2]\n" +"assert o1.x is o2.x" -msgid "Note that the two instances of class :class:`!C` share the same class variable :attr:`!x`, as expected." +msgid "" +"Note that the two instances of class :class:`!C` share the same class " +"variable :attr:`!x`, as expected." msgstr "" +"توجه داشته باشید که دو نمونه از کلاس :class:`!C`، همان‌طور که انتظار می‌رود،" +" همان متغیر کلاس :attr:`!x` را به اشتراک می‌گذارند." msgid "Using dataclasses, *if* this code was valid::" -msgstr "" +msgstr "با استفاده از dataclasses، *اگر* این کد معتبر بود::" msgid "" "@dataclass\n" @@ -617,9 +1494,14 @@ msgid "" " def add(self, element):\n" " self.x.append(element)" msgstr "" +"@dataclass\n" +"class D:\n" +" x: list = [] # این کد باعث پرتاب ValueError می‌شود\n" +" def add(self, element):\n" +" self.x.append(element)" msgid "it would generate code similar to::" -msgstr "" +msgstr "کدی مشابه زیر تولید می‌شود::" msgid "" "class D:\n" @@ -631,12 +1513,42 @@ msgid "" "\n" "assert D().x is D().x" msgstr "" +"class D:\n" +" x = []\n" +" def __init__(self, x=x):\n" +" self.x = x\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"assert D().x is D().x" -msgid "This has the same issue as the original example using class :class:`!C`. That is, two instances of class :class:`!D` that do not specify a value for :attr:`!x` when creating a class instance will share the same copy of :attr:`!x`. Because dataclasses just use normal Python class creation they also share this behavior. There is no general way for Data Classes to detect this condition. Instead, the :deco:`dataclass` decorator will raise a :exc:`ValueError` if it detects an unhashable default parameter. The assumption is that if a value is unhashable, it is mutable. This is a partial solution, but it does protect against many common errors." -msgstr "" +msgid "" +"This has the same issue as the original example using class :class:`!C`. " +"That is, two instances of class :class:`!D` that do not specify a value for " +":attr:`!x` when creating a class instance will share the same copy of " +":attr:`!x`. Because dataclasses just use normal Python class creation they " +"also share this behavior. There is no general way for Data Classes to " +"detect this condition. Instead, the :deco:`dataclass` decorator will raise " +"a :exc:`ValueError` if it detects an unhashable default parameter. The " +"assumption is that if a value is unhashable, it is mutable. This is a " +"partial solution, but it does protect against many common errors." +msgstr "" +"این همان مشکلی است که مثال اصلی با استفاده از کلاس :class:`!C` داشت. یعنی دو" +" نمونه از کلاس :class:`!D` که هنگام ایجاد یک نمونه کلاس، مقداری برای " +":attr:`!x` تعیین نمی‌کنند، نسخه یکسانی از :attr:`!x` را به اشتراک می‌گذارند." +" از آن‌جا که کلاس‌های داده صرفاً از ایجاد کلاس معمولی پایتون استفاده " +"می‌کنند، آن‌ها نیز همین رفتار را دارند. کلاس‌های داده هیچ راه کلی برای تشخیص" +" این وضعیت ندارند. در عوض، دکوراتور :deco:`dataclass` در صورت تشخیص یک " +"پارامتر پیش‌فرض هش‌ناپذیر (unhashable)، یک :exc:`ValueError` پرتاب می‌کند. " +"فرض بر این است که اگر یک مقدار هش‌ناپذیر (unhashable) باشد، تغییرپذیر است. " +"این یک راه‌حل نسبی است، اما در برابر بسیاری از خطاهای رایج محافظت می‌کند." -msgid "Using default factory functions is a way to create new instances of mutable types as default values for fields::" +msgid "" +"Using default factory functions is a way to create new instances of mutable " +"types as default values for fields::" msgstr "" +"استفاده از توابع کارخانه پیش‌فرض راهی برای ایجاد نمونه‌های جدید از انواع " +"تغییرپذیر به‌عنوان مقادیر پیش‌فرض برای فیلدها است::" msgid "" "@dataclass\n" @@ -645,24 +1557,63 @@ msgid "" "\n" "assert D().x is not D().x" msgstr "" +"@dataclass\n" +"class D:\n" +" x: list = field(default_factory=list)\n" +"\n" +"assert D().x is not D().x" -msgid "Instead of looking for and disallowing objects of type :class:`list`, :class:`dict`, or :class:`set`, unhashable objects are now not allowed as default values. Unhashability is used to approximate mutability." +msgid "" +"Instead of looking for and disallowing objects of type :class:`list`, " +":class:`dict`, or :class:`set`, unhashable objects are now not allowed as " +"default values. Unhashability is used to approximate mutability." msgstr "" +"به‌جای جست‌وجو و ممنوع‌کردن اشیایی از نوع :class:`list`، :class:`dict` یا " +":class:`set`، اکنون اشیای هش‌ناپذیر به‌عنوان مقادیر پیش‌فرض مجاز نیستند. از " +"هش‌ناپذیری برای تقریب‌زدن تغییرپذیری استفاده می‌شود." msgid "Descriptor-typed fields" -msgstr "" +msgstr "فیلدهای نوع توصیف‌گر" -msgid "Fields that are assigned :ref:`descriptor objects ` as their default value have the following special behaviors:" +msgid "" +"Fields that are assigned :ref:`descriptor objects ` as their " +"default value have the following special behaviors:" msgstr "" +"فیلدهایی که :ref:`اشیای توصیف‌گر (descriptor objects) ` " +"به‌عنوان مقدار پیش‌فرض آن‌ها تخصیص داده شده‌اند، رفتارهای ویژه زیر را دارند:" -msgid "The value for the field passed to the dataclass's :meth:`~object.__init__` method is passed to the descriptor's :meth:`~object.__set__` method rather than overwriting the descriptor object." +msgid "" +"The value for the field passed to the dataclass's :meth:`~object.__init__` " +"method is passed to the descriptor's :meth:`~object.__set__` method rather " +"than overwriting the descriptor object." msgstr "" +"مقداری که برای فیلد به متد :meth:`~object.__init__` دیتاکلاس ارسال می‌شود، " +"به متد :meth:`~object.__set__` توصیف‌گر ارسال می‌شود، نه اینکه شیء توصیف‌گر " +"بازنویسی شود." -msgid "Similarly, when getting or setting the field, the descriptor's :meth:`~object.__get__` or :meth:`!__set__` method is called rather than returning or overwriting the descriptor object." +msgid "" +"Similarly, when getting or setting the field, the descriptor's " +":meth:`~object.__get__` or :meth:`!__set__` method is called rather than " +"returning or overwriting the descriptor object." msgstr "" +"به همین ترتیب، هنگام دریافت یا تنظیم فیلد، به جای بازگرداندن یا بازنویسی شیء" +" توصیف‌گر، متد :meth:`~object.__get__` یا :meth:`!__set__` توصیف‌گر فراخوانی" +" می‌شود." -msgid "To determine whether a field contains a default value, :deco:`dataclass` will call the descriptor's :meth:`!__get__` method using its class access form: ``descriptor.__get__(obj=None, type=cls)``. If the descriptor returns a value in this case, it will be used as the field's default. On the other hand, if the descriptor raises :exc:`AttributeError` in this situation, no default value will be provided for the field." -msgstr "" +msgid "" +"To determine whether a field contains a default value, :deco:`dataclass` " +"will call the descriptor's :meth:`!__get__` method using its class access " +"form: ``descriptor.__get__(obj=None, type=cls)``. If the descriptor returns" +" a value in this case, it will be used as the field's default. On the other " +"hand, if the descriptor raises :exc:`AttributeError` in this situation, no " +"default value will be provided for the field." +msgstr "" +"برای تشخیص اینکه آیا یک فیلد دارای مقدار پیش‌فرض است، :deco:`dataclass` متد " +":meth:`!__get__` توصیف‌گر را با استفاده از شکل دسترسی کلاسی آن فراخوانی " +"می‌کند: ``descriptor.__get__(obj=None, type=cls)``. اگر توصیف‌گر در این حالت" +" مقداری برگرداند، آن مقدار به‌عنوان مقدار پیش‌فرض فیلد استفاده خواهد شد. از " +"سوی دیگر، اگر توصیف‌گر در این موقعیت :exc:`AttributeError` را پرتاب کند، هیچ" +" مقدار پیش‌فرضی برای فیلد ارائه نخواهد شد." msgid "" "class IntConversionDescriptor:\n" @@ -690,6 +1641,36 @@ msgid "" "i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" "print(i.quantity_on_hand) # 2" msgstr "" +"class IntConversionDescriptor:\n" +" def __init__(self, *, default):\n" +" self._default = default\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self._name = \"_\" + name\n" +"\n" +" def __get__(self, obj, type):\n" +" if obj is None:\n" +" return self._default\n" +"\n" +" return getattr(obj, self._name, self._default)\n" +"\n" +" def __set__(self, obj, value):\n" +" setattr(obj, self._name, int(value))\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" quantity_on_hand: IntConversionDescriptor = IntConversionDescriptor(default=100)\n" +"\n" +"i = InventoryItem()\n" +"print(i.quantity_on_hand) # 100\n" +"i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" +"print(i.quantity_on_hand) # 2" -msgid "Note that if a field is annotated with a descriptor type, but is not assigned a descriptor object as its default value, the field will act like a normal field." +msgid "" +"Note that if a field is annotated with a descriptor type, but is not " +"assigned a descriptor object as its default value, the field will act like a" +" normal field." msgstr "" +"توجه داشته باشید که اگر یک فیلد با یک نوع توصیف‌گر (descriptor) حاشیه‌نویسی " +"شده باشد، اما یک شیء توصیف‌گر به‌عنوان مقدار پیش‌فرض آن تخصیص داده نشده " +"باشد، آن فیلد مانند یک فیلد معمولی رفتار خواهد کرد." diff --git a/library/datatypes.po b/library/datatypes.po index 7c40a2265..22bf903ce 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -22,13 +22,28 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Data Types" -msgstr "" +msgstr "انواع داده" -msgid "The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, double-ended queues, and enumerations." +msgid "" +"The modules described in this chapter provide a variety of specialized data " +"types such as dates and times, fixed-type arrays, heap queues, double-ended " +"queues, and enumerations." msgstr "" +"ماژول‌های توصیف‌شده در این فصل، انواع داده تخصصی متنوعی مانند تاریخ‌ها و " +"زمان‌ها، آرایه‌های با نوع ثابت، صف‌های heap (heap queues)، صف‌های دوطرفه و " +"شمارش‌ها را فراهم می‌کنند." -msgid "Python also provides some built-in data types, in particular, :class:`dict`, :class:`list`, :class:`set` and :class:`frozenset`, and :class:`tuple`. The :class:`str` class is used to hold Unicode strings, and the :class:`bytes` and :class:`bytearray` classes are used to hold binary data." +msgid "" +"Python also provides some built-in data types, in particular, :class:`dict`," +" :class:`list`, :class:`set` and :class:`frozenset`, and :class:`tuple`. " +"The :class:`str` class is used to hold Unicode strings, and the " +":class:`bytes` and :class:`bytearray` classes are used to hold binary data." msgstr "" +"پایتون همچنین برخی از انواع داده‌ی توکار را فراهم می‌کند، به‌ویژه " +":class:`dict`، :class:`list`، :class:`set` و :class:`frozenset`، و " +":class:`tuple`. کلاس :class:`str` برای نگهداری رشته‌های یونیکد استفاده " +"می‌شود، و کلاس‌های :class:`bytes` و :class:`bytearray` برای نگهداری داده‌های" +" دودویی استفاده می‌شوند." msgid "The following modules are documented in this chapter:" -msgstr "" +msgstr "ماژول‌های زیر در این فصل مستند شده‌اند:" diff --git a/library/datetime.po b/library/datetime.po index de1addf3e..05ad7de12 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"PO-Revision-Date: 2026-08-28 11:20+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -24,203 +24,363 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!datetime` --- Basic date and time types" -msgstr "" +msgstr ":mod:`!datetime` --- انواع پایه تاریخ و زمان" msgid "**Source code:** :source:`Lib/datetime.py`" -msgstr "" +msgstr ":source:`Lib/datetime.py`" -msgid "The :mod:`!datetime` module supplies classes for manipulating dates and times." +msgid "" +"The :mod:`!datetime` module supplies classes for manipulating dates and " +"times." msgstr "" +"ماژول :mod:`!datetime` کلاس‌هایی برای دستکاری تاریخ‌ها و زمان‌ها فراهم می‌کند." -msgid "While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation." +msgid "" +"While date and time arithmetic is supported, the focus of the " +"implementation is on efficient attribute extraction for output formatting " +"and manipulation." msgstr "" +"اگرچه از محاسبات تاریخ و زمان پشتیبانی می‌شود، تمرکز پیاده‌سازی بر استخراج " +"کارآمد ویژگی‌ها برای قالب‌بندی و دستکاری خروجی است." msgid "Skip to :ref:`the format codes `." -msgstr "" +msgstr "پرش به :ref:`کدهای قالب `." msgid "Module :mod:`calendar`" -msgstr "" +msgstr "ماژول :mod:`calendar`" msgid "General calendar related functions." -msgstr "" +msgstr "توابع عمومی مرتبط با گاه‌شماری." msgid "Module :mod:`time`" -msgstr "" +msgstr "ماژول :mod:`time`" msgid "Time access and conversions." -msgstr "" +msgstr "دسترسی به زمان و تبدیل‌ها." msgid "Module :mod:`zoneinfo`" -msgstr "" +msgstr "ماژول :mod:`zoneinfo`" msgid "Concrete time zones representing the IANA time zone database." -msgstr "" +msgstr "مناطق زمانی عینی که نشان‌دهنده‌ی پایگاه داده‌ی مناطق زمانی IANA هستند." msgid "Package `dateutil `_" -msgstr "" +msgstr "بسته `dateutil `_" msgid "Third-party library with expanded time zone and parsing support." -msgstr "" +msgstr "کتابخانه شخص ثالث با پشتیبانی گسترده‌تر از منطقه‌های زمانی و تجزیه." msgid "Package :pypi:`DateType`" -msgstr "" +msgstr "بسته :pypi:`DateType`" -msgid "Third-party library that introduces distinct static types to for example, allow :term:`static type checkers ` to differentiate between naive and aware datetimes." +msgid "" +"Third-party library that introduces distinct static types to for example, " +"allow :term:`static type checkers ` to differentiate " +"between naive and aware datetimes." msgstr "" +"کتابخانه شخص ثالثی که انواع ایستای متمایزی را معرفی می‌کند تا برای مثال، " +"به :term:`بررسی‌کننده‌های نوع ایستا ` اجازه دهد بین " +"datetimeهای naive و aware تمایز قائل شوند." msgid "Aware and naive objects" -msgstr "" +msgstr "اشیای آگاه و ساده" -msgid "Date and time objects may be categorized as \"aware\" or \"naive\" depending on whether or not they include time zone information." +msgid "" +"Date and time objects may be categorized as \"aware\" or \"naive\" " +"depending on whether or not they include time zone information." msgstr "" +"اشیاء تاریخ و زمان ممکن است بسته به اینکه شامل اطلاعات منطقه‌ی زمانی باشند یا " +"نه، به‌عنوان «آگاه» (aware) یا «ساده» (naive) دسته‌بندی شوند." -msgid "With sufficient knowledge of applicable algorithmic and political time adjustments, such as time zone and daylight saving time information, an **aware** object can locate itself relative to other aware objects. An aware object represents a specific moment in time that is not open to interpretation. [#]_" +msgid "" +"With sufficient knowledge of applicable algorithmic and political time " +"adjustments, such as time zone and daylight saving time information, an " +"**aware** object can locate itself relative to other aware objects. An " +"aware object represents a specific moment in time that is not open to " +"interpretation. [#]_" msgstr "" +"با دانش کافی درباره‌ی تنظیم‌های زمانی الگوریتمی و سیاسی قابل‌اعمال، مانند " +"اطلاعات منطقه‌ی زمانی و ساعت تابستانی، یک شیء **آگاه** می‌تواند موقعیت خود را " +"نسبت به سایر اشیاء آگاه تعیین کند. یک شیء آگاه، یک لحظه‌ی مشخص از زمان را " +"نشان می‌دهد که جای تفسیر ندارد. [#]_" -msgid "A **naive** object does not contain enough information to unambiguously locate itself relative to other date/time objects. Whether a naive object represents Coordinated Universal Time (UTC), local time, or time in some other time zone is purely up to the program, just like it is up to the program whether a particular number represents metres, miles, or mass. Naive objects are easy to understand and to work with, at the cost of ignoring some aspects of reality." -msgstr "" +msgid "" +"A **naive** object does not contain enough information to unambiguously " +"locate itself relative to other date/time objects. Whether a naive object " +"represents Coordinated Universal Time (UTC), local time, or time in some " +"other time zone is purely up to the program, just like it is up to the " +"program whether a particular number represents metres, miles, or mass. " +"Naive objects are easy to understand and to work with, at the cost of " +"ignoring some aspects of reality." +msgstr "" +"یک شیء **ساده** (naive) حاوی اطلاعات کافی برای تعیین موقعیت خود به‌صورت " +"غیرمبهم نسبت به سایر اشیای تاریخ/زمان نیست. این‌که یک شیء ساده نشان‌دهنده‌ی " +"زمان هماهنگ جهانی (UTC)، زمان محلی یا زمان در یک منطقه‌ی زمانی دیگر باشد، " +"کاملاً به برنامه بستگی دارد؛ درست همان‌طور که این‌که یک عدد خاص نشان‌دهنده‌ی متر، " +"مایل یا جرم باشد، به برنامه بستگی دارد. درک و کار کردن با اشیای ساده آسان " +"است، به بهای چشم‌پوشی از برخی جنبه‌های واقعیت." -msgid "For applications requiring aware objects, :class:`.datetime` and :class:`.time` objects have an optional time zone information attribute, :attr:`!tzinfo`, that can be set to an instance of a subclass of the abstract :class:`!tzinfo` class. These :class:`tzinfo` objects capture information about the offset from UTC time, the time zone name, and whether daylight saving time is in effect." -msgstr "" +msgid "" +"For applications requiring aware objects, :class:`.datetime` " +"and :class:`.time` objects have an optional time zone information " +"attribute, :attr:`!tzinfo`, that can be set to an instance of a subclass of " +"the abstract :class:`!tzinfo` class. These :class:`tzinfo` objects capture " +"information about the offset from UTC time, the time zone name, and whether " +"daylight saving time is in effect." +msgstr "" +"برای برنامه‌هایی که به اشیای آگاه نیاز دارند، اشیای :class:`.datetime` " +"و :class:`.time` دارای یک ویژگی اختیاری اطلاعات منطقه‌ی زمانی، :attr:`!" +"tzinfo`، هستند که می‌تواند به نمونه‌ای از زیرکلاسی از کلاس انتزاعی :class:`!" +"tzinfo` تنظیم شود. این اشیای :class:`tzinfo` اطلاعات مربوط به اختلاف نسبت " +"به زمان UTC، نام منطقه‌ی زمانی و فعال بودن ساعت تابستانی را ذخیره می‌کنند." -msgid "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is supplied by the :mod:`!datetime` module. The :class:`!timezone` class can represent simple time zones with fixed offsets from UTC, such as UTC itself or North American EST and EDT time zones. Supporting time zones at deeper levels of detail is up to the application. The rules for time adjustment across the world are more political than rational, change frequently, and there is no standard suitable for every application aside from UTC." -msgstr "" +msgid "" +"Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " +"supplied by the :mod:`!datetime` module. The :class:`!timezone` class can " +"represent simple time zones with fixed offsets from UTC, such as UTC itself " +"or North American EST and EDT time zones. Supporting time zones at deeper " +"levels of detail is up to the application. The rules for time adjustment " +"across the world are more political than rational, change frequently, and " +"there is no standard suitable for every application aside from UTC." +msgstr "" +"تنها یک کلاس عینی :class:`tzinfo`، یعنی کلاس :class:`timezone`، توسط " +"ماژول :mod:`!datetime` ارائه شده است. کلاس :class:`!timezone` می‌تواند مناطق " +"زمانی ساده با فاصله‌های ثابت از UTC را نشان دهد، مانند خود UTC یا مناطق " +"زمانی EST و EDT آمریکای شمالی. پشتیبانی از مناطق زمانی با سطوح عمیق‌تری از " +"جزئیات بر عهده‌ی برنامه است. قوانین تنظیم زمان در سراسر جهان بیشتر سیاسی " +"هستند تا منطقی، به‌طور مکرر تغییر می‌کنند، و هیچ استاندارد مناسبی برای همه‌ی " +"برنامه‌ها به‌جز UTC وجود ندارد." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" msgid "The :mod:`!datetime` module exports the following constants:" -msgstr "" +msgstr "ماژول :mod:`!datetime` ثابت‌های زیر را صادر می‌کند:" -msgid "The smallest year number allowed in a :class:`date` or :class:`.datetime` object. :const:`MINYEAR` is 1." +msgid "" +"The smallest year number allowed in a :class:`date` or :class:`.datetime` " +"object. :const:`MINYEAR` is 1." msgstr "" +"کوچک‌ترین شماره سال مجاز در یک شیء :class:`date` " +"یا :class:`.datetime`. :const:`MINYEAR` برابر ۱ است." -msgid "The largest year number allowed in a :class:`date` or :class:`.datetime` object. :const:`MAXYEAR` is 9999." +msgid "" +"The largest year number allowed in a :class:`date` or :class:`.datetime` " +"object. :const:`MAXYEAR` is 9999." msgstr "" +"بزرگ‌ترین شماره سال مجاز در یک شیء :class:`date` " +"یا :class:`.datetime`. :const:`MAXYEAR` برابر ۹۹۹۹ است." msgid "Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`." msgstr "" +"نام مستعاری برای تک‌نمونه‌ی منطقه‌ی زمانی UTC :attr:`datetime.timezone.utc`." msgid "Available types" -msgstr "" +msgstr "انواع موجود" -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`." +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 "" +"یک تاریخ ساده‌ی ایده‌آل‌سازی‌شده، با فرض این‌که گاه‌شماری میلادی جاری همیشه برقرار " +"بوده و همیشه برقرار خواهد بود. ویژگی‌ها: :attr:`year`، :attr:`month` " +"و :attr:`day`." -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 seconds\" here.) Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond`, and :attr:`.tzinfo`." -msgstr "" +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 " +"seconds\" here.) " +"Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond`, " +"and :attr:`.tzinfo`." +msgstr "" +"یک زمان ایده‌آل‌سازی‌شده، مستقل از هر روز معین، با این فرض که هر روز دقیقاً " +"۲۴\\*۶۰\\*۶۰ ثانیه دارد. (در اینجا هیچ مفهومی از «ثانیه‌های کبیسه» وجود " +"ندارد.) " +"ویژگی‌ها: :attr:`hour`، :attr:`minute`، :attr:`second`، :attr:`microsecond` " +"و :attr:`.tzinfo`." -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`." +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 "" +"ترکیبی از یک تاریخ و یک زمان. " +"ویژگی‌ها: :attr:`year`، :attr:`month`، :attr:`day`، :attr:`hour`، :attr:`minute`، :attr:`second`، :attr:`microsecond` " +"و :attr:`.tzinfo`." -msgid "A duration expressing the difference between two :class:`.datetime` or :class:`date` instances to microsecond resolution." +msgid "" +"A duration expressing the difference between two :class:`.datetime` " +"or :class:`date` instances to microsecond resolution." msgstr "" +"مدت‌زمانی که تفاوت بین دو نمونه از :class:`.datetime` یا :class:`date` را تا " +"دقت میکروثانیه بیان می‌کند." -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 notion of time adjustment (for example, to account for time zone and/or daylight saving time)." +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 " +"notion of time adjustment (for example, to account for time zone and/or " +"daylight saving time)." msgstr "" +"یک کلاس پایه انتزاعی برای اشیای اطلاعات منطقه زمانی. این اشیاء توسط " +"کلاس‌های :class:`.datetime` و :class:`.time` استفاده می‌شوند تا مفهومی قابل " +"سفارشی‌سازی از تنظیم زمان فراهم شود (برای مثال، برای در نظر گرفتن منطقه " +"زمانی و/یا ساعت تابستانی)." -msgid "A class that implements the :class:`tzinfo` abstract base class as a fixed offset from the UTC." +msgid "" +"A class that implements the :class:`tzinfo` abstract base class as a fixed " +"offset from the UTC." msgstr "" +"کلاسی که کلاس پایه انتزاعی :class:`tzinfo` را به‌صورت یک آفست ثابت از UTC " +"پیاده‌سازی می‌کند." msgid "Objects of these types are immutable." -msgstr "" +msgstr "اشیای این نوع‌ها تغییرناپذیر هستند." msgid "Subclass relationships:" -msgstr "" +msgstr "روابط زیرکلاس‌ها:" msgid "" "timedelta, tzinfo, time, and date inherit from object; timezone inherits\n" "from tzinfo; and datetime inherits from date." msgstr "" +"timedelta، tzinfo، time و date از object ارث می‌برند؛ timezone از tzinfo ارث " +"می‌برد؛ و datetime از date ارث می‌برد." msgid "Common properties" -msgstr "" +msgstr "ویژگی‌های مشترک" -msgid "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` types share these common features:" +msgid "" +"The :class:`date`, :class:`.datetime`, :class:`.time`, " +"and :class:`timezone` types share these common features:" msgstr "" +"انواع :class:`date`، :class:`.datetime`، :class:`.time` و :class:`timezone` " +"این ویژگی‌های مشترک را دارند:" -msgid "Objects of these types are :term:`hashable`, meaning that they can be used as dictionary keys." +msgid "" +"Objects of these types are :term:`hashable`, meaning that they can be used " +"as dictionary keys." msgstr "" +"اشیای این نوع‌ها :term:`هش‌پذیر ` هستند، یعنی می‌توان از آن‌ها " +"به‌عنوان کلیدهای دیکشنری استفاده کرد." -msgid "Objects of these types support efficient pickling via the :mod:`pickle` module." +msgid "" +"Objects of these types support efficient pickling via the :mod:`pickle` " +"module." msgstr "" +"اشیاء این نوع‌ها از پیکل‌کردن (pickling) کارآمد از طریق ماژول :mod:`pickle` " +"پشتیبانی می‌کنند." msgid "Determining if an object is aware or naive" -msgstr "" +msgstr "تعیین آگاه (aware) یا ساده (naive) بودن یک شیء" msgid "Objects of the :class:`date` type are always naive." -msgstr "" +msgstr "اشیای نوع :class:`date` همیشه ساده (naive) هستند." -msgid "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." +msgid "" +"An object of type :class:`.time` or :class:`.datetime` may be aware or " +"naive." msgstr "" +"یک شیء از نوع :class:`.time` یا :class:`.datetime` ممکن است آگاه (aware) یا " +"ساده (naive) باشد." -msgid "A :class:`.datetime` object ``d`` is aware if both of the following hold:" +msgid "" +"A :class:`.datetime` object ``d`` is aware if both of the following hold:" msgstr "" +"یک شیء :class:`.datetime` به نام ``d`` آگاه (aware) است اگر هر دو شرط زیر " +"برقرار باشند:" msgid "``d.tzinfo`` is not ``None``" -msgstr "" +msgstr "``d.tzinfo`` برابر با ``None`` نیست" msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" -msgstr "" +msgstr "``d.tzinfo.utcoffset(d)`` مقدار ``None`` را برنمی‌گرداند" msgid "Otherwise, ``d`` is naive." -msgstr "" +msgstr "در غیر این صورت، ``d`` ساده است." msgid "A :class:`.time` object ``t`` is aware if both of the following hold:" msgstr "" +"یک شیء ``t`` از کلاس :class:`.time` آگاه است اگر هر دو مورد زیر برقرار " +"باشند:" msgid "``t.tzinfo`` is not ``None``" -msgstr "" +msgstr "``t.tzinfo`` برابر ``None`` نیست" msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." -msgstr "" +msgstr "``t.tzinfo.utcoffset(None)`` مقدار ``None`` را برنمی‌گرداند." msgid "Otherwise, ``t`` is naive." -msgstr "" +msgstr "در غیر این صورت، ``t`` ساده است." -msgid "The distinction between aware and naive doesn't apply to :class:`timedelta` objects." +msgid "" +"The distinction between aware and naive doesn't apply to :class:`timedelta` " +"objects." msgstr "" +"تمایز میان آگاه (aware) و ساده (naive) برای اشیای :class:`timedelta` صدق " +"نمی‌کند." msgid ":class:`!timedelta` objects" -msgstr "" +msgstr "اشیاء :class:`!timedelta`" -msgid "A :class:`timedelta` object represents a duration, the difference between two :class:`.datetime` or :class:`date` instances." +msgid "" +"A :class:`timedelta` object represents a duration, the difference between " +"two :class:`.datetime` or :class:`date` instances." msgstr "" +"یک شیء :class:`timedelta` نشان‌دهنده‌ی یک بازه‌ی زمانی، یعنی اختلاف بین دو " +"نمونه از :class:`.datetime` یا :class:`date` است." -msgid "All arguments are optional and default to 0. Arguments may be integers or floats, and may be positive or negative." +msgid "" +"All arguments are optional and default to 0. Arguments may be integers or " +"floats, and may be positive or negative." msgstr "" +"تمام آرگومان‌ها اختیاری هستند و مقدار پیش‌فرض آن‌ها ۰ است. آرگومان‌ها می‌توانند " +"عدد صحیح یا عدد اعشاری باشند و می‌توانند مثبت یا منفی باشند." -msgid "Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units:" +msgid "" +"Only *days*, *seconds* and *microseconds* are stored internally. Arguments " +"are converted to those units:" msgstr "" +"فقط *روز*، *ثانیه* و *میکروثانیه* به‌صورت داخلی ذخیره می‌شوند. آرگومان‌ها به " +"آن واحدها تبدیل می‌شوند:" msgid "A millisecond is converted to 1000 microseconds." -msgstr "" +msgstr "یک میلی‌ثانیه به ۱۰۰۰ میکروثانیه تبدیل می‌شود." msgid "A minute is converted to 60 seconds." -msgstr "" +msgstr "یک دقیقه به ۶۰ ثانیه تبدیل می‌شود." msgid "An hour is converted to 3600 seconds." -msgstr "" +msgstr "یک ساعت به ۳۶۰۰ ثانیه تبدیل می‌شود." msgid "A week is converted to 7 days." -msgstr "" +msgstr "یک هفته به ۷ روز تبدیل می‌شود." -msgid "and days, seconds and microseconds are then normalized so that the representation is unique, with" +msgid "" +"and days, seconds and microseconds are then normalized so that the " +"representation is unique, with" msgstr "" +"و روزها، ثانیه‌ها و میکروثانیه‌ها سپس نرمال می‌شوند تا نمایش یکتا باشد، با" msgid "``0 <= microseconds < 1000000``" -msgstr "" +msgstr "``0 <= microseconds < 1000000``" msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" -msgstr "" +msgstr "``0 <= seconds < 3600*24`` (تعداد ثانیه‌ها در یک روز)" msgid "``-999999999 <= days <= 999999999``" -msgstr "" +msgstr "``-999999999 <= days <= 999999999``" -msgid "The following example illustrates how any arguments besides *days*, *seconds* and *microseconds* are \"merged\" and normalized into those three resulting attributes::" +msgid "" +"The following example illustrates how any arguments besides *days*, " +"*seconds* and *microseconds* are \"merged\" and normalized into those three " +"resulting attributes::" msgstr "" +"مثال زیر نشان می‌دهد که چگونه هر آرگومانی به‌جز *days*، *seconds* و " +"*microseconds* «ادغام» و در آن سه ویژگی حاصل نرمال‌سازی می‌شود::" msgid "" ">>> import datetime as dt\n" @@ -237,18 +397,58 @@ msgid "" ">>> delta\n" "datetime.timedelta(days=64, seconds=29156, microseconds=10)" msgstr "" +">>> import datetime as dt\n" +">>> delta = dt.timedelta(\n" +"... days=50,\n" +"... seconds=27,\n" +"... microseconds=10,\n" +"... milliseconds=29000,\n" +"... minutes=5,\n" +"... hours=8,\n" +"... weeks=2\n" +"... )\n" +">>> # Only days, seconds, and microseconds remain\n" +">>> delta\n" +"datetime.timedelta(days=64, seconds=29156, microseconds=10)" -msgid "``import datetime as dt`` instead of ``import datetime`` or ``from datetime import datetime`` to avoid confusion between the module and the class. See `How I Import Python’s datetime Module `__." +msgid "" +"``import datetime as dt`` instead of ``import datetime`` or ``from datetime " +"import datetime`` to avoid confusion between the module and the class. See " +"`How I Import Python’s datetime Module `__." msgstr "" +"``import datetime as dt`` به‌جای ``import datetime`` یا ``from datetime " +"import datetime``، برای جلوگیری از اشتباه گرفتن ماژول با کلاس. به `چگونه " +"ماژول datetime پایتون را ایمپورت می‌کنم `__ مراجعه کنید." -msgid "If any argument is a float and there are fractional microseconds, the fractional microseconds left over from all arguments are combined and their sum is rounded to the nearest microsecond using round-half-to-even tiebreaker. If no argument is a float, the conversion and normalization processes are exact (no information is lost)." -msgstr "" +msgid "" +"If any argument is a float and there are fractional microseconds, the " +"fractional microseconds left over from all arguments are combined and their " +"sum is rounded to the nearest microsecond using round-half-to-even " +"tiebreaker. If no argument is a float, the conversion and normalization " +"processes are exact (no information is lost)." +msgstr "" +"اگر دست‌کم یکی از آرگومان‌ها عدد اعشاری (float) باشد و بخش‌های کسری میکروثانیه " +"وجود داشته باشد، بخش‌های کسری میکروثانیه باقی‌مانده از همه آرگومان‌ها با هم " +"ترکیب می‌شوند و مجموع آن‌ها با استفاده از قاعده‌ی رفع تساوی گرد کردن نیمه به " +"زوج (round-half-to-even) به نزدیک‌ترین میکروثانیه گرد می‌شود. اگر هیچ " +"آرگومانی عدد اعشاری (float) نباشد، فرآیندهای تبدیل و عادی‌سازی دقیق هستند " +"(هیچ اطلاعاتی از دست نمی‌رود)." -msgid "If the normalized value of days lies outside the indicated range, :exc:`OverflowError` is raised." +msgid "" +"If the normalized value of days lies outside the indicated " +"range, :exc:`OverflowError` is raised." msgstr "" +"اگر مقدار نرمال‌شده‌ی days خارج از محدوده‌ی مشخص‌شده باشد، :exc:`OverflowError` " +"پرتاب می‌شود." -msgid "Note that normalization of negative values may be surprising at first. For example::" +msgid "" +"Note that normalization of negative values may be surprising at first. For " +"example::" msgstr "" +"توجه داشته باشید که نرمال‌سازی مقادیر منفی ممکن است در ابتدا شگفت‌آور باشد. " +"برای مثال::" msgid "" ">>> import datetime as dt\n" @@ -256,9 +456,17 @@ msgid "" ">>> (d.days, d.seconds, d.microseconds)\n" "(-1, 86399, 999999)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" -msgid "Since the string representation of :class:`!timedelta` objects can be confusing, use the following recipe to produce a more readable format:" +msgid "" +"Since the string representation of :class:`!timedelta` objects can be " +"confusing, use the following recipe to produce a more readable format:" msgstr "" +"از آنجا که نمایش رشته‌ای اشیاء :class:`!timedelta` می‌تواند گیج‌کننده باشد، " +"برای تولید قالبی خواناتر از راهکار زیر استفاده کنید:" msgid "" ">>> def pretty_timedelta(td):\n" @@ -272,33 +480,64 @@ msgid "" ">>> pretty_timedelta(d)\n" "'-(1:00:00)'" msgstr "" +">>> def pretty_timedelta(td):\n" +"... if td.days >= 0:\n" +"... return str(td)\n" +"... return f'-({-td!s})'\n" +"...\n" +">>> d = timedelta(hours=-1)\n" +">>> str(d) # not human-friendly\n" +"'-1 day, 23:00:00'\n" +">>> pretty_timedelta(d)\n" +"'-(1:00:00)'" msgid "Class attributes:" -msgstr "" +msgstr "ویژگی‌های کلاس:" -msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." -msgstr "" +msgid "" +"The most negative :class:`timedelta` object, ``timedelta(-999999999)``." +msgstr "منفی‌ترین شیء :class:`timedelta`، ``timedelta(-999999999)``." -msgid "The most positive :class:`timedelta` object, ``timedelta(days=999999999, hours=23, minutes=59, seconds=59, microseconds=999999)``." +msgid "" +"The most positive :class:`timedelta` object, ``timedelta(days=999999999, " +"hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" +"مثبت‌ترین شیء :class:`timedelta`، ``timedelta(days=999999999, hours=23, " +"minutes=59, seconds=59, microseconds=999999)``." -msgid "The smallest possible difference between non-equal :class:`timedelta` objects, ``timedelta(microseconds=1)``." +msgid "" +"The smallest possible difference between non-equal :class:`timedelta` " +"objects, ``timedelta(microseconds=1)``." msgstr "" +"کوچک‌ترین اختلاف ممکن بین شیءهای غیرمساوی :class:`timedelta`، " +"``timedelta(microseconds=1)``." -msgid "Note that, because of normalization, ``timedelta.max`` is greater than ``-timedelta.min``. ``-timedelta.max`` is not representable as a :class:`timedelta` object." +msgid "" +"Note that, because of normalization, ``timedelta.max`` is greater than ``-" +"timedelta.min``. ``-timedelta.max`` is not representable as " +"a :class:`timedelta` object." msgstr "" +"توجه داشته باشید که به دلیل نرمال‌سازی، ``timedelta.max`` بزرگ‌تر از ``-" +"timedelta.min`` است. ``-timedelta.max`` به‌صورت یک شیء :class:`timedelta` " +"قابل بازنمایی نیست." msgid "Instance attributes (read-only):" -msgstr "" +msgstr "ویژگی‌های نمونه (فقط‌خواندنی):" msgid "Between -999,999,999 and 999,999,999 inclusive." -msgstr "" +msgstr "بین -۹۹۹٬۹۹۹٬۹۹۹ و ۹۹۹٬۹۹۹٬۹۹۹، شامل هر دو مقدار." msgid "Between 0 and 86,399 inclusive." -msgstr "" +msgstr "بین ۰ تا ۸۶٬۳۹۹ (شامل هر دو)." -msgid "It is a somewhat common bug for code to unintentionally use this attribute when it is actually intended to get a :meth:`~timedelta.total_seconds` value instead:" +msgid "" +"It is a somewhat common bug for code to unintentionally use this attribute " +"when it is actually intended to get a :meth:`~timedelta.total_seconds` " +"value instead:" msgstr "" +"این اشکالی نسبتاً رایج است که کد به‌طور غیرعمدی از این ویژگی استفاده کند، در " +"حالی که در واقع قصد بر این بوده است که به‌جای آن " +"مقدار :meth:`~timedelta.total_seconds` دریافت شود:" msgid "" ">>> import datetime as dt\n" @@ -308,123 +547,185 @@ msgid "" ">>> duration.total_seconds()\n" "11235813.0" msgstr "" +">>> import datetime as dt\n" +">>> duration = dt.timedelta(seconds=11235813)\n" +">>> duration.days, duration.seconds\n" +"(130, 3813)\n" +">>> duration.total_seconds()\n" +"11235813.0" msgid "Between 0 and 999,999 inclusive." -msgstr "" +msgstr "از ۰ تا ۹۹۹٬۹۹۹ (شامل هر دو)." msgid "Supported operations:" -msgstr "" +msgstr "عملیات پشتیبانی‌شده:" msgid "Operation" -msgstr "" +msgstr "عملیات" msgid "Result" -msgstr "" +msgstr "نتیجه" msgid "``t1 = t2 + t3``" -msgstr "" +msgstr "``t1 = t2 + t3``" -msgid "Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` are true. (1)" +msgid "" +"Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == " +"t2`` are true. (1)" msgstr "" +"مجموع ``t2`` و ``t3``. پس از آن، ``t1 - t2 == t3`` و ``t1 - t3 == t2`` درست " +"هستند. (1)" msgid "``t1 = t2 - t3``" -msgstr "" +msgstr "``t1 = t2 - t3``" -msgid "Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == t1 + t3`` are true. (1)(6)" +msgid "" +"Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " +"t1 + t3`` are true. (1)(6)" msgstr "" +"تفاضل ``t2`` و ``t3``. پس از آن ``t1 == t2 - t3`` و ``t2 == t1 + t3`` " +"برقرار هستند. (1)(6)" msgid "``t1 = t2 * i or t1 = i * t2``" -msgstr "" +msgstr "``t1 = t2 * i or t1 = i * t2``" -msgid "Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, provided ``i != 0``." +msgid "" +"Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " +"provided ``i != 0``." msgstr "" +"دلتا ضرب‌شده در یک عدد صحیح. پس از آن ``t1 // i == t2`` برقرار است، به شرطی " +"که ``i != 0``." msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" -msgstr "" +msgstr "به‌طور کلی، ``t1 * i == t1 * (i-1) + t1`` برقرار است. (1)" msgid "``t1 = t2 * f or t1 = f * t2``" -msgstr "" +msgstr "``t1 = t2 * f or t1 = f * t2``" -msgid "Delta multiplied by a float. The result is rounded to the nearest multiple of timedelta.resolution using round-half-to-even." +msgid "" +"Delta multiplied by a float. The result is rounded to the nearest multiple " +"of timedelta.resolution using round-half-to-even." msgstr "" +"دلتا در یک float ضرب می‌شود. نتیجه به نزدیک‌ترین مضرب timedelta.resolution با " +"استفاده از روش گرد کردن نیمه به زوج (round-half-to-even) گرد می‌شود." msgid "``f = t2 / t3``" -msgstr "" +msgstr "``f = t2 / t3``" -msgid "Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :class:`float` object." +msgid "" +"Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns " +"a :class:`float` object." msgstr "" +"تقسیم (۳) مدت‌زمان کل ``t2`` بر واحد بازه ``t3``. یک شیء :class:`float` " +"برمی‌گرداند." msgid "``t1 = t2 / f or t1 = t2 / i``" -msgstr "" +msgstr "``t1 = t2 / f or t1 = t2 / i``" -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." +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 "" +"دلتا تقسیم‌شده بر یک float یا int. نتیجه به نزدیک‌ترین مضرب " +"timedelta.resolution با استفاده از گرد کردن نیمه به زوج (round-half-to-" +"even) گرد می‌شود." msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" -msgstr "" +msgstr "``t1 = t2 // i`` یا ``t1 = t2 // t3``" -msgid "The floor is computed and the remainder (if any) is thrown away. In the second case, an integer is returned. (3)" +msgid "" +"The floor is computed and the remainder (if any) is thrown away. In the " +"second case, an integer is returned. (3)" msgstr "" +"مقدار کف محاسبه می‌شود و باقی‌مانده (در صورت وجود) دور انداخته می‌شود. در حالت " +"دوم، یک عدد صحیح برگردانده می‌شود. (۳)" msgid "``t1 = t2 % t3``" -msgstr "" +msgstr "``t1 = t2 % t3``" msgid "The remainder is computed as a :class:`timedelta` object. (3)" -msgstr "" +msgstr "باقی‌مانده به‌صورت یک شیء :class:`timedelta` محاسبه می‌شود. (3)" msgid "``q, r = divmod(t1, t2)``" -msgstr "" +msgstr "``q, r = divmod(t1, t2)``" -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." +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 "" +"خارج‌قسمت و باقی‌مانده را محاسبه می‌کند: ``q = t1 // t2`` (3) و ``r = t1 % " +"t2``. ``q`` یک عدد صحیح است و ``r`` یک شیء :class:`timedelta` است." msgid "``+t1``" -msgstr "" +msgstr "``+t1``" msgid "Returns a :class:`timedelta` object with the same value. (2)" -msgstr "" +msgstr "یک شیء :class:`timedelta` با همان مقدار برمی‌گرداند. (2)" msgid "``-t1``" -msgstr "" +msgstr "``-t1``" -msgid "Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to ``t1 * -1``. (1)(4)" +msgid "" +"Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and " +"to ``t1 * -1``. (1)(4)" msgstr "" +"معادل ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)`` و ``t1 * -1`` " +"است. (1)(4)" msgid "``abs(t)``" -msgstr "" +msgstr "``abs(t)``" -msgid "Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < 0``. (2)" +msgid "" +"Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " +"0``. (2)" msgstr "" +"هنگامی که ``t.days >= 0`` باشد، معادل ``+t`` و هنگامی که ``t.days < 0`` " +"باشد، معادل ``-t`` است. (2)" msgid "``str(t)``" -msgstr "" +msgstr "``str(t)``" -msgid "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is negative for negative ``t``. (5)" +msgid "" +"Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D " +"is negative for negative ``t``. (5)" msgstr "" +"رشته‌ای را در قالب ``[D day[s], ][H]H:MM:SS[.UUUUUU]`` برمی‌گرداند، که در آن " +"D در صورت منفی بودن ``t`` منفی است. (5)" msgid "``repr(t)``" -msgstr "" +msgstr "``repr(t)``" -msgid "Returns a string representation of the :class:`timedelta` object as a constructor call with canonical attribute values." +msgid "" +"Returns a string representation of the :class:`timedelta` object as a " +"constructor call with canonical attribute values." msgstr "" +"نمایش رشته‌ای شیء :class:`timedelta` را به‌صورت یک فراخوانی سازنده با مقادیر " +"ویژگی‌های کانونیکال برمی‌گرداند." msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" msgid "This is exact but may overflow." -msgstr "" +msgstr "این دقیق است، اما ممکن است سرریز شود." msgid "This is exact and cannot overflow." -msgstr "" +msgstr "این دقیق است و نمی‌تواند سرریز کند." msgid "Division by zero raises :exc:`ZeroDivisionError`." -msgstr "" +msgstr "تقسیم بر صفر باعث پرتاب :exc:`ZeroDivisionError` می‌شود." -msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." -msgstr "" +msgid "" +"``-timedelta.max`` is not representable as a :class:`timedelta` object." +msgstr "``-timedelta.max`` به‌صورت یک شیء :class:`timedelta` قابل نمایش نیست." -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::" +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 "" +"نمایش‌های رشته‌ای اشیای :class:`timedelta` به‌صورت مشابهی با نمایش داخلی آن‌ها " +"نرمال می‌شوند. این موضوع برای timedeltaهای منفی به نتایج نسبتاً غیرمعمولی " +"منجر می‌شود. برای مثال::" msgid "" ">>> timedelta(hours=-5)\n" @@ -432,36 +733,76 @@ msgid "" ">>> print(_)\n" "-1 day, 19:00:00" msgstr "" +">>> timedelta(hours=-5)\n" +"datetime.timedelta(days=-1, seconds=68400)\n" +">>> print(_)\n" +"-1 day, 19:00:00" -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." +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 "" +"عبارت ``t2 - t3`` همیشه با عبارت ``t2 + (-t3)`` برابر خواهد بود، مگر وقتی " +"t3 برابر ``timedelta.max`` باشد؛ در آن حالت، عبارت اول نتیجه‌ای تولید می‌کند، " +"در حالی که عبارت دوم سرریز می‌شود." -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)." +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 "" +"علاوه بر عملیات فهرست‌شده در بالا، اشیای :class:`timedelta` از برخی عملیات " +"جمع و تفریق با اشیای :class:`date` و :class:`.datetime` پشتیبانی می‌کنند (در " +"ادامه ببینید)." -msgid "Floor division and true division of a :class:`timedelta` object by another :class:`!timedelta` object are now supported, as are remainder operations and the :func:`divmod` function. True division and multiplication of a :class:`!timedelta` object by a :class:`float` object are now supported." +msgid "" +"Floor division and true division of a :class:`timedelta` object by " +"another :class:`!timedelta` object are now supported, as are remainder " +"operations and the :func:`divmod` function. True division and " +"multiplication of a :class:`!timedelta` object by a :class:`float` object " +"are now supported." msgstr "" +"تقسیم کف و تقسیم حقیقی یک شیء :class:`timedelta` بر یک شیء :class:`!" +"timedelta` دیگر اکنون پشتیبانی می‌شوند؛ همچنین عملیات باقی‌مانده و " +"تابع :func:`divmod` نیز پشتیبانی می‌شوند. تقسیم حقیقی و ضرب یک شیء :class:`!" +"timedelta` در یک شیء :class:`float` اکنون پشتیبانی می‌شوند." msgid ":class:`timedelta` objects support equality and order comparisons." -msgstr "" +msgstr "اشیای :class:`timedelta` از مقایسه‌های برابری و ترتیب پشتیبانی می‌کنند." -msgid "In Boolean contexts, a :class:`timedelta` object is considered to be true if and only if it isn't equal to ``timedelta(0)``." +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 "" +"در زمینه‌های بولی، یک شیء :class:`timedelta` تنها و تنها در صورتی درست در " +"نظر گرفته می‌شود که با ``timedelta(0)`` برابر نباشد." msgid "Instance methods:" -msgstr "" +msgstr "متدهای نمونه:" -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 (for example, ``td / timedelta(microseconds=1)``)." +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 (for example, ``td / " +"timedelta(microseconds=1)``)." msgstr "" +"تعداد کل ثانیه‌های موجود در مدت را برمی‌گرداند. معادل ``td / " +"timedelta(seconds=1)`` است. برای واحدهای بازه‌ای غیر از ثانیه، از شکل تقسیم " +"به‌طور مستقیم استفاده کنید (برای مثال، ``td / timedelta(microseconds=1)``)." -msgid "Note that for very large time intervals (greater than 270 years on most platforms) this method will lose microsecond accuracy." +msgid "" +"Note that for very large time intervals (greater than 270 years on most " +"platforms) this method will lose microsecond accuracy." msgstr "" +"توجه داشته باشید که برای بازه‌های زمانی بسیار بزرگ (بیش از ۲۷۰ سال در بیشتر " +"پلتفرم‌ها)، این متد دقت میکروثانیه‌ای را از دست خواهد داد." msgid "Examples of usage: :class:`!timedelta`" -msgstr "" +msgstr "نمونه‌های کاربرد: :class:`!timedelta`" msgid "An additional example of normalization::" -msgstr "" +msgstr "مثالی اضافی از نرمال‌سازی::" msgid "" ">>> # Components of another_year add up to exactly 365 days\n" @@ -474,9 +815,18 @@ msgid "" ">>> year.total_seconds()\n" "31536000.0" msgstr "" +">>> # Components of another_year add up to exactly 365 days\n" +">>> import datetime as dt\n" +">>> year = dt.timedelta(days=365)\n" +">>> another_year = dt.timedelta(weeks=40, days=84, hours=23,\n" +"... minutes=50, seconds=600)\n" +">>> year == another_year\n" +"True\n" +">>> year.total_seconds()\n" +"31536000.0" msgid "Examples of :class:`timedelta` arithmetic::" -msgstr "" +msgstr "نمونه‌هایی از محاسبات :class:`timedelta`::" msgid "" ">>> import datetime as dt\n" @@ -493,69 +843,142 @@ msgid "" ">>> three_years, three_years.days // 365\n" "(datetime.timedelta(days=1095), 3)" msgstr "" +">>> import datetime as dt\n" +">>> year = dt.timedelta(days=365)\n" +">>> ten_years = 10 * year\n" +">>> ten_years\n" +"datetime.timedelta(days=3650)\n" +">>> ten_years.days // 365\n" +"10\n" +">>> nine_years = ten_years - year\n" +">>> nine_years\n" +"datetime.timedelta(days=3285)\n" +">>> three_years = nine_years // 3\n" +">>> three_years, three_years.days // 365\n" +"(datetime.timedelta(days=1095), 3)" msgid ":class:`!date` objects" -msgstr "" +msgstr "اشیای :class:`!date`" -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." +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 "" +"یک شیء :class:`date` نشان‌دهنده یک تاریخ (سال، ماه و روز) در یک گاه‌شماری ایده‌آل " +"است، یعنی گاه‌شماری میلادی کنونی که به‌طور نامحدود در هر دو جهت امتداد یافته است." -msgid "January 1 of year 1 is called day number 1, January 2 of year 1 is called day number 2, and so on. [#]_" +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 "" +"۱ ژانویه سال ۱، روز شماره‌ی ۱ نامیده می‌شود، ۲ ژانویه سال ۱، روز شماره‌ی ۲ " +"نامیده می‌شود و به همین ترتیب. [#]_" -msgid "All arguments are required. Arguments must be integers, in the following ranges:" +msgid "" +"All arguments are required. Arguments must be integers, in the following " +"ranges:" msgstr "" +"همه‌ی آرگومان‌ها الزامی هستند. آرگومان‌ها باید عدد صحیح باشند و در بازه‌های زیر " +"قرار داشته باشند:" msgid "``MINYEAR <= year <= MAXYEAR``" -msgstr "" +msgstr "``MINYEAR <= year <= MAXYEAR``" msgid "``1 <= month <= 12``" -msgstr "" +msgstr "``1 <= month <= 12``" msgid "``1 <= day <= number of days in the given month and year``" -msgstr "" +msgstr "``1 <= day <= number of days in the given month and year``" -msgid "If an argument outside those ranges is given, :exc:`ValueError` is raised." +msgid "" +"If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" +"اگر آرگومانی خارج از آن بازه‌ها داده شود، :exc:`ValueError` پرتاب می‌شود." msgid "Other constructors, all class methods:" -msgstr "" +msgstr "سازنده‌های دیگر، همه متدهای کلاس:" msgid "Return the current local date." -msgstr "" +msgstr "تاریخ محلی فعلی را برمی‌گرداند." msgid "This is equivalent to ``date.fromtimestamp(time.time())``." -msgstr "" +msgstr "این معادل ``date.fromtimestamp(time.time())`` است." -msgid "Return the local date corresponding to the POSIX *timestamp*, such as is returned by :func:`time.time`." +msgid "" +"Return the local date corresponding to the POSIX *timestamp*, such as is " +"returned by :func:`time.time`." msgstr "" +"تاریخ محلی متناظر با *برچسب زمانی* (timestamp) POSIX را برمی‌گرداند، مانند " +"مقداری که توسط :func:`time.time` برگردانده می‌شود." -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:`OSError` on :c:func:`localtime` failure. It's common for this to be restricted to years from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`." -msgstr "" +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:`OSError` on :c:func:`localtime` failure. It's common for this to " +"be restricted to years from 1970 through 2038. Note that on non-POSIX " +"systems that include leap seconds in their notion of a timestamp, leap " +"seconds are ignored by :meth:`fromtimestamp`." +msgstr "" +"این ممکن است در صورتی که برچسب زمانی خارج از بازه مقادیر پشتیبانی‌شده توسط " +"تابع C :c:func:`localtime` در سکو باشد، :exc:`OverflowError` را پرتاب کند، " +"و در صورت شکست :c:func:`localtime` نیز :exc:`OSError` را پرتاب کند. این " +"معمولاً به سال‌های ۱۹۷۰ تا ۲۰۳۸ محدود است. توجه داشته باشید که در سیستم‌های " +"غیر POSIX که ثانیه‌های کبیسه را در مفهوم برچسب زمانی خود لحاظ می‌کنند، " +"ثانیه‌های کبیسه توسط :meth:`fromtimestamp` نادیده گرفته می‌شوند." -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` function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`localtime` failure." +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` " +"function. Raise :exc:`OSError` instead of :exc:`ValueError` " +"on :c:func:`localtime` failure." msgstr "" +"اگر برچسب زمانی (timestamp) خارج از محدوده مقادیر پشتیبانی‌شده توسط " +"تابع :c:func:`localtime` در C پلتفرم باشد، :exc:`OverflowError` به " +"جای :exc:`ValueError` پرتاب می‌شود. در صورت " +"شکست :c:func:`localtime`، :exc:`OSError` به جای :exc:`ValueError` پرتاب " +"می‌شود." -msgid "Return the date corresponding to the proleptic Gregorian *ordinal*, where January 1 of year 1 has ordinal 1." +msgid "" +"Return the date corresponding to the proleptic Gregorian *ordinal*, where " +"January 1 of year 1 has ordinal 1." msgstr "" +"تاریخ متناظر با *ordinal* در گاه‌شماری میلادی تعمیم‌یافته (proleptic Gregorian) را " +"برمی‌گرداند؛ به‌طوری‌که ۱ ژانویه سال ۱ دارای شماره ترتیبی ۱ است." -msgid ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." +msgid "" +":exc:`ValueError` is raised unless ``1 <= ordinal <= " +"date.max.toordinal()``. For any date ``d``, " +"``date.fromordinal(d.toordinal()) == d``." msgstr "" +"استثنای :exc:`ValueError` پرتاب می‌شود مگر اینکه ``1 <= ordinal <= " +"date.max.toordinal()``. برای هر تاریخ ``d``، " +"``date.fromordinal(d.toordinal()) == d``." -msgid "Return a :class:`date` corresponding to a *date_string* given in any valid ISO 8601 format, with the following exceptions:" +msgid "" +"Return a :class:`date` corresponding to a *date_string* given in any valid " +"ISO 8601 format, with the following exceptions:" msgstr "" +"یک :class:`date` متناظر با *date_string* داده‌شده در هر قالب معتبر ISO 8601 " +"برمی‌گرداند، با استثناهای زیر:" -msgid "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." +msgid "" +"Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" +"تاریخ‌های با دقت کاهش‌یافته در حال حاضر پشتیبانی نمی‌شوند (``YYYY-MM``، " +"``YYYY``)." -msgid "Extended date representations are not currently supported (``±YYYYYY-MM-DD``)." +msgid "" +"Extended date representations are not currently supported (``±YYYYYY-MM-" +"DD``)." msgstr "" +"بازنمایی‌های گسترده‌ی تاریخ در حال حاضر پشتیبانی نمی‌شوند (``±YYYYYY-MM-DD``)." msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." -msgstr "" +msgstr "تاریخ‌های ترتیبی در حال حاضر پشتیبانی نمی‌شوند (``YYYY-OOO``)." msgid "Examples::" -msgstr "" +msgstr "مثال‌ها::" msgid "" ">>> import datetime as dt\n" @@ -566,125 +989,222 @@ msgid "" ">>> dt.date.fromisoformat('2021-W01-1')\n" "datetime.date(2021, 1, 4)" msgstr "" +">>> import datetime as dt\n" +">>> dt.date.fromisoformat('2019-12-04')\n" +"datetime.date(2019, 12, 4)\n" +">>> dt.date.fromisoformat('20191204')\n" +"datetime.date(2019, 12, 4)\n" +">>> dt.date.fromisoformat('2021-W01-1')\n" +"datetime.date(2021, 1, 4)" msgid "Previously, this method only supported the format ``YYYY-MM-DD``." -msgstr "" +msgstr "پیش‌تر، این متد فقط از قالب ``YYYY-MM-DD`` پشتیبانی می‌کرد." -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`." +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 "" +"یک :class:`date` متناظر با تاریخ گاه‌شماری ISO مشخص‌شده با *year*، *week* و " +"*day* برمی‌گرداند. این معکوس تابع :meth:`date.isocalendar` است." -msgid "Return a :class:`.date` corresponding to *date_string*, parsed according to *format*. This is equivalent to::" +msgid "" +"Return a :class:`.date` corresponding to *date_string*, parsed according to " +"*format*. This is equivalent to::" msgstr "" +"یک :class:`.date` متناظر با *date_string* را برمی‌گرداند، که بر اساس " +"*format* تجزیه‌شده است. این معادل است با::" msgid "date(*(time.strptime(date_string, format)[0:3]))" -msgstr "" +msgstr "date(*(time.strptime(date_string, format)[0:3]))" -msgid ":exc:`ValueError` is raised if the date_string and format can't be parsed by :func:`time.strptime` or if it returns a value which isn't a time tuple. See also :ref:`strftime-strptime-behavior` and :meth:`date.fromisoformat`." +msgid "" +":exc:`ValueError` is raised if the date_string and format can't be parsed " +"by :func:`time.strptime` or if it returns a value which isn't a time " +"tuple. See also :ref:`strftime-strptime-behavior` " +"and :meth:`date.fromisoformat`." msgstr "" +":exc:`ValueError` در صورتی پرتاب می‌شود که date_string و format " +"توسط :func:`time.strptime` قابل تجزیه نباشند یا این تابع مقداری برگرداند که " +"یک تاپل زمانیی (time tuple) نیست. همچنین ببینید :ref:`strftime-strptime-" +"behavior` و :meth:`date.fromisoformat`." -msgid "If *format* specifies a day of month without a year a :exc:`DeprecationWarning` is emitted. This is to avoid a quadrennial leap year bug in code seeking to parse only a month and day as the default year used in absence of one in the format is not a leap year. Such *format* values may raise an error as of Python 3.15. The workaround is to always include a year in your *format*. If parsing *date_string* values that do not have a year, explicitly add a year that is a leap year before parsing:" -msgstr "" +msgid "" +"If *format* specifies a day of month without a year " +"a :exc:`DeprecationWarning` is emitted. This is to avoid a quadrennial " +"leap year bug in code seeking to parse only a month and day as the default " +"year used in absence of one in the format is not a leap year. Such *format* " +"values may raise an error as of Python 3.15. The workaround is to always " +"include a year in your *format*. If parsing *date_string* values that do " +"not have a year, explicitly add a year that is a leap year before parsing:" +msgstr "" +"اگر *format* روزی از ماه را بدون سال تعیین کند، " +"یک :exc:`DeprecationWarning` صادر می‌شود. این کار برای اجتناب از یک اشکال " +"چهارساله‌ی مربوط به سال کبیسه در کدی است که فقط به دنبال تجزیه‌ی ماه و روز است، " +"زیرا سال پیش‌فرضی که در نبود سال در قالب استفاده می‌شود، سال کبیسه نیست. چنین " +"مقادیر *format* ممکن است از پایتون 3.15 به بعد خطایی پرتاب کنند. راه‌حل این " +"است که همیشه یک سال را در *format* خود بگنجانید. اگر مقادیر *date_string* " +"را که سال ندارند تجزیه می‌کنید، پیش از تجزیه به‌صراحت یک سال کبیسه اضافه کنید:" msgid "" ">>> import datetime as dt\n" ">>> date_string = \"02/29\"\n" -">>> when = dt.date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # Avoids leap year bug.\n" +">>> when = dt.date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" ">>> when.strftime(\"%B %d\")\n" "'February 29'" msgstr "" +">>> import datetime as dt\n" +">>> date_string = \"02/29\"\n" +">>> when = dt.date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." -msgstr "" +msgstr "زودترین تاریخ قابل نمایش، ``date(MINYEAR, 1, 1)``." msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." -msgstr "" +msgstr "آخرین تاریخ قابل‌نمایش، ``date(MAXYEAR, 12, 31)``." -msgid "The smallest possible difference between non-equal date objects, ``timedelta(days=1)``." -msgstr "" +msgid "" +"The smallest possible difference between non-equal date objects, " +"``timedelta(days=1)``." +msgstr "کمترین اختلاف ممکن بین اشیای date نابرابر، ``timedelta(days=1)``." msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." -msgstr "" +msgstr "بین :const:`MINYEAR` و :const:`MAXYEAR` (شامل هر دو مقدار)." msgid "Between 1 and 12 inclusive." -msgstr "" +msgstr "بین ۱ تا ۱۲، شامل هر دو." msgid "Between 1 and the number of days in the given month of the given year." -msgstr "" +msgstr "بین ۱ تا تعداد روزهای ماه داده‌شده در سال داده‌شده." msgid "``date2 = date1 + timedelta``" -msgstr "" +msgstr "``date2 = date1 + timedelta``" msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" msgstr "" +"``date2`` به اندازه‌ی ``timedelta.days`` روز پس از ``date1`` خواهد بود. (1)" msgid "``date2 = date1 - timedelta``" -msgstr "" +msgstr "``date2 = date1 - timedelta``" msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" msgstr "" +"``date2`` را به‌گونه‌ای محاسبه می‌کند که ``date2 + timedelta == date1``. (2)" msgid "``timedelta = date1 - date2``" -msgstr "" +msgstr "``timedelta = date1 - date2``" msgid "\\(3)" -msgstr "" +msgstr "\\(3)" msgid "``date1 == date2``" -msgstr "" +msgstr "``date1 == date2``" msgid "``date1 != date2``" -msgstr "" +msgstr "``date1 != date2``" msgid "Equality comparison. (4)" -msgstr "" +msgstr "مقایسه برابری. (۴)" msgid "``date1 < date2``" -msgstr "" +msgstr "``date1 < date2``" msgid "``date1 > date2``" -msgstr "" +msgstr "``date1 > date2``" msgid "``date1 <= date2``" -msgstr "" +msgstr "``date1 <= date2``" msgid "``date1 >= date2``" -msgstr "" +msgstr "``date1 >= date2``" msgid "Order comparison. (5)" -msgstr "" +msgstr "مقایسه‌ی ترتیب. (۵)" -msgid "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if ``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. ``timedelta.seconds`` and ``timedelta.microseconds`` are ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`." -msgstr "" +msgid "" +"*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " +"``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " +"``timedelta.seconds`` and ``timedelta.microseconds`` are " +"ignored. :exc:`OverflowError` is raised if ``date2.year`` would be smaller " +"than :const:`MINYEAR` or larger than :const:`MAXYEAR`." +msgstr "" +"*date2* اگر ``timedelta.days > 0`` باشد، به جلو در زمان منتقل می‌شود، یا اگر " +"``timedelta.days < 0`` باشد، به عقب در زمان منتقل می‌شود. پس از آن ``date2 - " +"date1 == timedelta.days`` خواهد بود. ``timedelta.seconds`` و " +"``timedelta.microseconds`` نادیده گرفته می‌شوند. اگر ``date2.year`` کوچک‌تر " +"از :const:`MINYEAR` یا بزرگ‌تر از :const:`MAXYEAR` " +"باشد، :exc:`OverflowError` پرتاب می‌شود." msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "" +"``timedelta.seconds`` و ``timedelta.microseconds`` نادیده گرفته می‌شوند." -msgid "This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after." +msgid "" +"This is exact, and cannot overflow. ``timedelta.seconds`` and " +"``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after." msgstr "" +"این دقیق است و امکان سرریز ندارد. ``timedelta.seconds`` و " +"``timedelta.microseconds`` برابر ۰ هستند و پس از آن ``date2 + timedelta == " +"date1`` برقرار است." msgid ":class:`date` objects are equal if they represent the same date." -msgstr "" +msgstr "اشیای :class:`date` زمانی با هم برابرند که تاریخ یکسانی را نشان دهند." -msgid ":class:`!date` objects that are not also :class:`.datetime` instances are never equal to :class:`!datetime` objects, even if they represent the same date." +msgid "" +":class:`!date` objects that are not also :class:`.datetime` instances are " +"never equal to :class:`!datetime` objects, even if they represent the same " +"date." msgstr "" +"اشیای :class:`!date` که نمونه‌های :class:`.datetime` نیز نیستند، هرگز با " +"اشیای :class:`!datetime` برابر نیستند، حتی اگر نشان‌دهنده‌ی تاریخ یکسانی باشند." -msgid "*date1* is considered less than *date2* when *date1* precedes *date2* in time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2.toordinal()``." +msgid "" +"*date1* is considered less than *date2* when *date1* precedes *date2* in " +"time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() " +"< date2.toordinal()``." msgstr "" +"*date1* کمتر از *date2* در نظر گرفته می‌شود هرگاه *date1* از نظر زمانی پیش " +"از *date2* باشد. به عبارت دیگر، ``date1 < date2`` اگر و فقط اگر " +"``date1.toordinal() < date2.toordinal()``." -msgid "Order comparison between a :class:`date` object that is not also a :class:`.datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." +msgid "" +"Order comparison between a :class:`date` object that is not also " +"a :class:`.datetime` instance and a :class:`!datetime` object " +"raises :exc:`TypeError`." msgstr "" +"مقایسه ترتیبی بین یک شیء :class:`date` که نمونه‌ای از :class:`.datetime` نیز " +"نیست و یک شیء :class:`!datetime` باعث پرتاب :exc:`TypeError` می‌شود." -msgid "Comparison between :class:`.datetime` object and an instance of the :class:`date` subclass that is not a :class:`!datetime` subclass no longer converts the latter to :class:`!date`, ignoring the time part and the time zone. The default behavior can be changed by overriding the special comparison methods in subclasses." +msgid "" +"Comparison between :class:`.datetime` object and an instance of " +"the :class:`date` subclass that is not a :class:`!datetime` subclass no " +"longer converts the latter to :class:`!date`, ignoring the time part and " +"the time zone. The default behavior can be changed by overriding the " +"special comparison methods in subclasses." msgstr "" +"مقایسه بین شیء :class:`.datetime` و نمونه‌ای از زیرکلاس :class:`date` که " +"زیرکلاسی از :class:`!datetime` نیست، دیگر دومی را با نادیده گرفتن بخش زمان " +"و منطقه‌ی زمانی به :class:`!date` تبدیل نمی‌کند. می‌توان رفتار پیش‌فرض را با " +"بازنویسی متدهای ویژه‌ی مقایسه در زیرکلاس‌ها تغییر داد." -msgid "In Boolean contexts, all :class:`date` objects are considered to be true." +msgid "" +"In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" +"در زمینه‌های بولی، تمام اشیاء :class:`date` به‌عنوان درست در نظر گرفته می‌شوند." -msgid "Return a new :class:`date` object with the same values, but with specified parameters updated." +msgid "" +"Return a new :class:`date` object with the same values, but with specified " +"parameters updated." msgstr "" +"یک شیء :class:`date` جدید با همان مقادیر برمی‌گرداند، اما پارامترهای مشخص‌شده " +"به‌روزرسانی می‌شوند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import datetime as dt\n" @@ -692,45 +1212,100 @@ msgid "" ">>> d.replace(day=26)\n" "datetime.date(2002, 12, 26)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.date(2002, 12, 31)\n" +">>> d.replace(day=26)\n" +"datetime.date(2002, 12, 26)" -msgid "The generic function :func:`copy.replace` also supports :class:`date` objects." +msgid "" +"The generic function :func:`copy.replace` also supports :class:`date` " +"objects." msgstr "" +"تابع عام :func:`copy.replace` همچنین از اشیای :class:`date` پشتیبانی " +"می‌کند." -msgid "Return a :class:`time.struct_time` such as returned by :func:`time.localtime`." +msgid "" +"Return a :class:`time.struct_time` such as returned " +"by :func:`time.localtime`." msgstr "" +"یک :class:`time.struct_time` برمی‌گرداند، مانند آنچه :func:`time.localtime` " +"برمی‌گرداند." msgid "The hours, minutes and seconds are 0, and the DST flag is -1." -msgstr "" +msgstr "ساعت‌ها، دقیقه‌ها و ثانیه‌ها ۰ هستند و پرچم DST برابر منفی ۱ است." msgid "``d.timetuple()`` is equivalent to::" -msgstr "" +msgstr "``d.timetuple()`` معادل است با::" -msgid "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" +msgid "" +"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" msgstr "" +"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" -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." +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 "" +"که در آن ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` " +"شماره‌ی روز در سال جاری است و از ۱ برای ۱ ژانویه آغاز می‌شود." -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``." +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 "" +"شماره‌ی ترتیبی تاریخ در گاه‌شماری میلادی پیش‌نگر را برمی‌گرداند، که در آن ۱ " +"ژانویه سال ۱ دارای شماره‌ی ترتیبی ۱ است. برای هر شیء :class:`date` مانند " +"``d``، ``date.fromordinal(d.toordinal()) == d`` است." -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`." +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 "" +"روز هفته را به‌صورت یک عدد صحیح برمی‌گرداند، که در آن دوشنبه ۰ و یکشنبه ۶ " +"است. برای مثال، ``date(2002, 12, 4).weekday() == 2``، یک چهارشنبه. " +"همچنین :meth:`isoweekday` را ببینید." -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`." +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 "" +"روز هفته را به‌صورت یک عدد صحیح برمی‌گرداند، به‌گونه‌ای که دوشنبه ۱ و یکشنبه ۷ " +"است. برای مثال، ``date(2002, 12, 4).isoweekday() == 3``، یک چهارشنبه. " +"همچنین ببینید :meth:`weekday`، :meth:`isocalendar`." -msgid "Return a :term:`named tuple` object with three components: ``year``, ``week`` and ``weekday``." +msgid "" +"Return a :term:`named tuple` object with three components: ``year``, " +"``week`` and ``weekday``." msgstr "" +"یک شیء :term:`named tuple` با سه کامپوننت برمی‌گرداند: ``year``، ``week`` و " +"``weekday``." -msgid "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" -msgstr "" +msgid "" +"The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" +msgstr "گاه‌شماری ISO گونه‌ای پرکاربرد از گاه‌شماری میلادی است. [#]_" -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 (Gregorian) calendar week of a year containing a Thursday. This is called week number 1, and the ISO year of that Thursday is the same as its Gregorian year." +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 " +"(Gregorian) calendar week of a year containing a Thursday. This is called " +"week number 1, and the ISO year of that Thursday is the same as its " +"Gregorian year." msgstr "" +"سال ISO شامل ۵۲ یا ۵۳ هفته‌ی کامل است و هر هفته از دوشنبه شروع می‌شود و در " +"یکشنبه پایان می‌یابد. اولین هفته‌ی سال ISO، اولین هفته‌ی گاه‌شماریی (میلادی) از " +"سال است که شامل یک پنجشنبه باشد. این هفته، هفته شماره ۱ نامیده می‌شود و سال " +"ISO آن پنجشنبه برابر با سال میلادی آن است." -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::" +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 "" +"برای مثال، سال ۲۰۰۴ در پنج‌شنبه آغاز می‌شود، بنابراین نخستین هفته‌ی سال ISO " +"۲۰۰۴ در دوشنبه، ۲۹ دسامبر ۲۰۰۳ آغاز می‌شود و در یکشنبه، ۴ ژانویه‌ی ۲۰۰۴ پایان " +"می‌یابد::" msgid "" ">>> import datetime as dt\n" @@ -739,51 +1314,86 @@ msgid "" ">>> dt.date(2004, 1, 4).isocalendar()\n" "datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2003, 12, 29).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=1)\n" +">>> dt.date(2004, 1, 4).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" msgid "Result changed from a tuple to a :term:`named tuple`." -msgstr "" +msgstr "نتیجه از یک تاپل به یک :term:`تاپل نام‌دار ` تغییر کرد." -msgid "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" +msgid "" +"Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" +"رشته‌ای را برمی‌گرداند که نشان‌دهنده‌ی تاریخ در قالب ISO 8601 است، ``YYYY-MM-" +"DD``::" msgid "" ">>> import datetime as dt\n" ">>> dt.date(2002, 12, 4).isoformat()\n" "'2002-12-04'" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2002, 12, 4).isoformat()\n" +"'2002-12-04'" msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." -msgstr "" +msgstr "برای یک تاریخ ``d``، ``str(d)`` معادل ``d.isoformat()`` است." msgid "Return a string representing the date::" -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که نشان‌دهنده‌ی تاریخ است::" msgid "" ">>> import datetime as dt\n" ">>> dt.date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" msgstr "" +">>> import datetime as dt\n" +">>> dt.date(2002, 12, 4).ctime()\n" +"'Wed Dec 4 00:00:00 2002'" msgid "``d.ctime()`` is equivalent to::" -msgstr "" +msgstr "``d.ctime()`` معادل است با::" msgid "time.ctime(time.mktime(d.timetuple()))" -msgstr "" +msgstr "time.ctime(time.mktime(d.timetuple()))" -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." +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 "" +"در سکوهایی که تابع بومی C :c:func:`ctime` (که :func:`time.ctime` آن را " +"فراخوانی می‌کند، اما :meth:`date.ctime` آن را فراخوانی نمی‌کند) با استاندارد " +"C مطابقت دارد." -msgid "Return a string representing the date, controlled by an explicit format string. Format codes referring to hours, minutes or seconds will see 0 values. See also :ref:`strftime-strptime-behavior` and :meth:`date.isoformat`." +msgid "" +"Return a string representing the date, controlled by an explicit format " +"string. Format codes referring to hours, minutes or seconds will see 0 " +"values. See also :ref:`strftime-strptime-behavior` " +"and :meth:`date.isoformat`." msgstr "" +"رشته‌ای برمی‌گرداند که نشان‌دهنده‌ی تاریخ است و با یک رشته قالب صریح کنترل " +"می‌شود. کدهای قالب مربوط به ساعت، دقیقه یا ثانیه مقدار ۰ خواهند داشت. همچنین " +"ببینید :ref:`strftime-strptime-behavior` و :meth:`date.isoformat`." -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 ` and when using :meth:`str.format`. See also :ref:`strftime-strptime-behavior` and :meth:`date.isoformat`." +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 ` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`date.isoformat`." msgstr "" +"همانند :meth:`.date.strftime`. این امر به شما امکان می‌دهد که یک رشته‌ی قالب " +"را برای یک شیء :class:`.date` در :ref:`رشته‌های قالب‌بندی‌شده ` و " +"هنگام استفاده از :meth:`str.format` تعیین کنید. همچنین :ref:`strftime-" +"strptime-behavior` و :meth:`date.isoformat` را ببینید." msgid "Examples of usage: :class:`!date`" -msgstr "" +msgstr "نمونه‌هایی از کاربرد: :class:`!date`" msgid "Example of counting days to an event::" -msgstr "" +msgstr "مثالی از شمارش روزها تا یک رویداد::" msgid "" ">>> import time\n" @@ -803,9 +1413,25 @@ msgid "" ">>> time_to_birthday.days\n" "202" msgstr "" +">>> import time\n" +">>> import datetime as dt\n" +">>> today = dt.date.today()\n" +">>> today\n" +"datetime.date(2007, 12, 5)\n" +">>> today == dt.date.fromtimestamp(time.time())\n" +"True\n" +">>> my_birthday = dt.date(today.year, 6, 24)\n" +">>> if my_birthday < today:\n" +"... my_birthday = my_birthday.replace(year=today.year + 1)\n" +"...\n" +">>> my_birthday\n" +"datetime.date(2008, 6, 24)\n" +">>> time_to_birthday = abs(my_birthday - today)\n" +">>> time_to_birthday.days\n" +"202" msgid "More examples of working with :class:`date`:" -msgstr "" +msgstr "مثال‌های بیشتر از کار با :class:`date`:" msgid "" ">>> import datetime as dt\n" @@ -849,162 +1475,375 @@ msgid "" ">>> d.replace(year=2005)\n" "datetime.date(2005, 3, 11)" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" +">>> d\n" +"datetime.date(2002, 3, 11)\n" +"\n" +">>> # Methods related to formatting string output\n" +">>> d.isoformat()\n" +"'2002-03-11'\n" +">>> d.strftime(\"%d/%m/%y\")\n" +"'11/03/02'\n" +">>> d.strftime(\"%A %d. %B %Y\")\n" +"'Monday 11. March 2002'\n" +">>> d.ctime()\n" +"'Mon Mar 11 00:00:00 2002'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n" +"'The day is 11, the month is March.'\n" +"\n" +">>> # Methods for extracting 'components' under different calendars\n" +">>> t = d.timetuple()\n" +">>> for i in t:\n" +"... print(i)\n" +"2002 # year\n" +"3 # month\n" +"11 # day\n" +"0\n" +"0\n" +"0\n" +"0 # weekday (0 = Monday)\n" +"70 # 70th day in the year\n" +"-1\n" +">>> ic = d.isocalendar()\n" +">>> for i in ic:\n" +"... print(i)\n" +"2002 # ISO year\n" +"11 # ISO week number\n" +"1 # ISO day number ( 1 = Monday )\n" +"\n" +">>> # A date object is immutable; all operations produce a new object\n" +">>> d.replace(year=2005)\n" +"datetime.date(2005, 3, 11)" msgid ":class:`!datetime` objects" -msgstr "" +msgstr "اشیاء :class:`!datetime`" -msgid "A :class:`.datetime` object is a single object containing all the information from a :class:`date` object and a :class:`.time` object." +msgid "" +"A :class:`.datetime` object is a single object containing all the " +"information from a :class:`date` object and a :class:`.time` object." msgstr "" +"یک شیء :class:`.datetime`، یک شیء واحد است که شامل تمام اطلاعات یک " +"شیء :class:`date` و یک شیء :class:`.time` می‌شود." -msgid "Like a :class:`date` object, :class:`.datetime` assumes the current Gregorian calendar extended in both directions; like a :class:`.time` object, :class:`!datetime` assumes there are exactly 3600\\*24 seconds in every day." +msgid "" +"Like a :class:`date` object, :class:`.datetime` assumes the current " +"Gregorian calendar extended in both directions; like a :class:`.time` " +"object, :class:`!datetime` assumes there are exactly 3600\\*24 seconds in " +"every day." msgstr "" +"مانند یک شیء :class:`date`، :class:`.datetime` فرض می‌کند که گاه‌شماری میلادی " +"کنونی در هر دو جهت گسترش‌یافته است؛ مانند یک شیء :class:`.time`، :class:`!" +"datetime` فرض می‌کند که در هر روز دقیقاً ۳۶۰۰\\*۲۴ ثانیه وجود دارد." msgid "Constructor:" -msgstr "" +msgstr "سازنده:" -msgid "The *year*, *month* and *day* arguments are required. *tzinfo* may be ``None``, or an instance of a :class:`tzinfo` subclass. The remaining arguments must be integers in the following ranges:" +msgid "" +"The *year*, *month* and *day* arguments are required. *tzinfo* may be " +"``None``, or an instance of a :class:`tzinfo` subclass. The remaining " +"arguments must be integers in the following ranges:" msgstr "" +"آرگومان‌های *year*، *month* و *day* الزامی هستند. *tzinfo* می‌تواند ``None`` " +"یا نمونه‌ای از یک زیرکلاس :class:`tzinfo` باشد. آرگومان‌های باقی‌مانده باید " +"اعداد صحیحی در بازه‌های زیر باشند:" msgid "``MINYEAR <= year <= MAXYEAR``," -msgstr "" +msgstr "``MINYEAR <= year <= MAXYEAR``," msgid "``1 <= month <= 12``," -msgstr "" +msgstr "``1 <= month <= 12``," msgid "``1 <= day <= number of days in the given month and year``," -msgstr "" +msgstr "``1 <= day <= number of days in the given month and year``," msgid "``0 <= hour < 24``," -msgstr "" +msgstr "``0 <= hour < 24``," msgid "``0 <= minute < 60``," -msgstr "" +msgstr "``0 <= minute < 60``," msgid "``0 <= second < 60``," -msgstr "" +msgstr "``0 <= second < 60``," msgid "``0 <= microsecond < 1000000``," -msgstr "" +msgstr "``0 <= microsecond < 1000000``," msgid "``fold in [0, 1]``." -msgstr "" +msgstr "``fold in [0, 1]``." msgid "Added the *fold* parameter." -msgstr "" +msgstr "پارامتر *fold* اضافه شد." msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." msgstr "" +"تاریخ و زمان محلی فعلی را با :attr:`.tzinfo` برابر ``None`` بازمی‌گرداند." msgid "Equivalent to::" -msgstr "" +msgstr "معادل با::" msgid "datetime.fromtimestamp(time.time())" -msgstr "" +msgstr "datetime.fromtimestamp(time.time())" msgid "See also :meth:`now`, :meth:`fromtimestamp`." -msgstr "" +msgstr "همچنین ببینید :meth:`now`، :meth:`fromtimestamp`." -msgid "This method is functionally equivalent to :meth:`now`, but without a ``tz`` parameter." +msgid "" +"This method is functionally equivalent to :meth:`now`, but without a ``tz`` " +"parameter." msgstr "" +"این متد از نظر عملکردی معادل :meth:`now` است، اما بدون پارامتر ``tz``." msgid "Return the current local date and time." -msgstr "" +msgstr "تاریخ و زمان محلی فعلی را برمی‌گرداند." -msgid "If optional argument *tz* is ``None`` or not specified, this is like :meth:`today`, but, if possible, supplies more precision than can be gotten from going through a :func:`time.time` timestamp (for example, this may be possible on platforms supplying the C :c:func:`gettimeofday` function)." -msgstr "" +msgid "" +"If optional argument *tz* is ``None`` or not specified, this is " +"like :meth:`today`, but, if possible, supplies more precision than can be " +"gotten from going through a :func:`time.time` timestamp (for example, this " +"may be possible on platforms supplying the C :c:func:`gettimeofday` " +"function)." +msgstr "" +"اگر آرگومان اختیاری *tz* برابر ``None`` باشد یا مشخص ن‌شده باشد، این " +"مانند :meth:`today` است، اما در صورت امکان، دقت بیشتری نسبت به آنچه می‌توان " +"از طریق یک مهر زمانی (timestamp) از :func:`time.time` به دست آورد، فراهم " +"می‌کند (برای مثال، این ممکن است در سکوهایی که تابع C :c:func:`gettimeofday` " +"را ارائه می‌کنند، امکان‌پذیر باشد)." -msgid "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the current date and time are converted to *tz*’s time zone." +msgid "" +"If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " +"subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" +"اگر *tz* ``None`` نباشد، باید نمونه‌ای از یک زیرکلاس :class:`tzinfo` باشد و " +"تاریخ و زمان جاری به منطقه‌ی زمانی *tz* تبدیل می‌شوند." msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." -msgstr "" +msgstr "این تابع به :meth:`today` و :meth:`utcnow` ترجیح داده می‌شود." -msgid "Subsequent calls to :meth:`!datetime.now` may return the same instant depending on the precision of the underlying clock." +msgid "" +"Subsequent calls to :meth:`!datetime.now` may return the same instant " +"depending on the precision of the underlying clock." msgstr "" +"فراخوانی‌های بعدی به :meth:`!datetime.now` ممکن است بسته به دقت ساعت " +"زیربنایی، همان لحظه را برگردانند." msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" +"تاریخ و زمان UTC جاری را با :attr:`.tzinfo` برابر ``None`` برمی‌گرداند." -msgid "This is like :meth:`now`, but returns the current UTC date and time, as a naive :class:`.datetime` object. An aware current UTC datetime can be obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." +msgid "" +"This is like :meth:`now`, but returns the current UTC date and time, as a " +"naive :class:`.datetime` object. An aware current UTC datetime can be " +"obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" +"این مانند :meth:`now` است، اما تاریخ و زمان جاری UTC را به‌عنوان یک " +"شیء :class:`.datetime` ساده برمی‌گرداند. یک datetime جاری UTC آگاه را می‌توان " +"با فراخوانی ``datetime.now(timezone.utc)`` به‌دست آورد. همچنین :meth:`now` " +"را ببینید." -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 UTC. As such, the recommended way to create an object representing the current time in UTC is by calling ``datetime.now(timezone.utc)``." +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 UTC. As such, the recommended way to create an object representing the " +"current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" +"از آنجا که اشیای ``datetime`` ساده (naive) توسط بسیاری از متدهای " +"``datetime`` به‌عنوان زمان‌های محلی در نظر گرفته می‌شوند، ترجیح داده می‌شود " +"برای نمایش زمان‌ها در UTC از datetimes آگاه (aware) استفاده کنید. بنابراین، " +"روش توصیه‌شده برای ایجاد شیءای که زمان فعلی در UTC را نشان می‌دهد، فراخوانی " +"``datetime.now(timezone.utc)`` است." msgid "Use :meth:`datetime.now` with :const:`UTC` instead." -msgstr "" +msgstr "به‌جای آن از :meth:`datetime.now` با :const:`UTC` استفاده کنید." -msgid "Return the local date and time corresponding to the POSIX timestamp, such as is returned by :func:`time.time`. If optional argument *tz* is ``None`` or not specified, the timestamp is converted to the platform's local date and time, and the returned :class:`.datetime` object is naive." +msgid "" +"Return the local date and time corresponding to the POSIX timestamp, such " +"as is returned by :func:`time.time`. If optional argument *tz* is ``None`` " +"or not specified, the timestamp is converted to the platform's local date " +"and time, and the returned :class:`.datetime` object is naive." msgstr "" +"تاریخ و زمان محلی متناظر با مهر زمانی POSIX را برمی‌گرداند، مانند آنچه که " +"توسط :func:`time.time` برگردانده می‌شود. اگر آرگومان اختیاری *tz* برابر " +"``None`` باشد یا مشخص‌نشده باشد، مهر زمانی به تاریخ و زمان محلی پلتفرم تبدیل " +"می‌شود و شیء :class:`.datetime` برگردانده‌شده ساده (naive) است." -msgid "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the timestamp is converted to *tz*’s time zone." +msgid "" +"If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " +"subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" +"اگر *tz* برابر ``None`` نباشد، باید نمونه‌ای از یک زیرکلاس :class:`tzinfo` " +"باشد، و مهر زمانی به منطقه‌ی زمانی *tz* تبدیل می‌شود." -msgid ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is out of the range of values supported by the platform C :c:func:`localtime` or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :c:func:`gmtime` failure. It's common for this to be restricted to years in 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by :meth:`fromtimestamp`, and then it's possible to have two timestamps differing by a second that yield identical :class:`.datetime` objects. This method is preferred over :meth:`utcfromtimestamp`." -msgstr "" +msgid "" +":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " +"out of the range of values supported by the platform C :c:func:`localtime` " +"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` " +"or :c:func:`gmtime` failure. It's common for this to be restricted to years " +"in 1970 through 2038. Note that on non-POSIX systems that include leap " +"seconds in their notion of a timestamp, leap seconds are ignored " +"by :meth:`fromtimestamp`, and then it's possible to have two timestamps " +"differing by a second that yield identical :class:`.datetime` objects. This " +"method is preferred over :meth:`utcfromtimestamp`." +msgstr "" +":meth:`fromtimestamp` ممکن است اگر مهر زمانی (timestamp) خارج از محدوده‌ی " +"مقادیر پشتیبانی‌شده توسط توابع :c:func:`localtime` یا :c:func:`gmtime` در C " +"سکو باشد، :exc:`OverflowError` پرتاب کند، و در صورت " +"شکست :c:func:`localtime` یا :c:func:`gmtime` نیز :exc:`OSError` پرتاب کند. " +"معمولاً این محدوده به سال‌های ۱۹۷۰ تا ۲۰۳۸ محدود می‌شود. توجه داشته باشید که " +"در سامانه‌های غیر POSIX که ثانیه‌های کبیسه را در مفهوم خود از مهر زمانی لحاظ " +"می‌کنند، ثانیه‌های کبیسه در :meth:`fromtimestamp` در نظر گرفته نمی‌شوند، و در " +"نتیجه ممکن است دو مهر زمانی با اختلاف یک ثانیه، اشیاء :class:`.datetime` " +"یکسانی برگردانند. این متد به :meth:`utcfromtimestamp` ترجیح داده می‌شود." -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` or :c:func:`gmtime` functions. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." +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` " +"or :c:func:`gmtime` functions. Raise :exc:`OSError` instead " +"of :exc:`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" +"اگر برچسب زمانی خارج از محدوده مقادیر پشتیبانی‌شده توسط توابع C " +"سکو، :c:func:`localtime` یا :c:func:`gmtime`، باشد، :exc:`OverflowError` " +"به‌جای :exc:`ValueError` پرتاب می‌شود. در صورت شکست :c:func:`localtime` " +"یا :c:func:`gmtime`، :exc:`OSError` به‌جای :exc:`ValueError` پرتاب می‌شود." -msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." +msgid "" +":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" +":meth:`fromtimestamp` ممکن است نمونه‌هایی را برگرداند که :attr:`.fold` آن‌ها " +"روی ۱ تنظیم شده است." -msgid "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" +msgid "" +"Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " +"with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" +":class:`.datetime` UTC متناظر با مهر زمانی POSIX را با :attr:`.tzinfo` " +"برابر ``None`` برمی‌گرداند. (شیء حاصل ساده (naive) است.)" -msgid "This may raise :exc:`OverflowError`, if the timestamp is out of the range of values supported by the platform C :c:func:`gmtime` function, and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be restricted to years in 1970 through 2038." +msgid "" +"This may raise :exc:`OverflowError`, if the timestamp is out of the range " +"of values supported by the platform C :c:func:`gmtime` function, " +"and :exc:`OSError` on :c:func:`gmtime` failure. It's common for this to be " +"restricted to years in 1970 through 2038." msgstr "" +"این ممکن است در صورتی که مهر زمانی (timestamp) خارج از محدوده مقادیر " +"پشتیبانی‌شده توسط تابع C :c:func:`gmtime` در پلتفرم " +"باشد، :exc:`OverflowError` را پرتاب کند، و در صورت " +"شکست :c:func:`gmtime`، :exc:`OSError` را نیز پرتاب کند. معمولاً این به " +"سال‌های ۱۹۷۰ تا ۲۰۳۸ محدود است." -msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" +msgid "" +"To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" +"برای دریافت یک شیء :class:`.datetime` آگاه، متد :meth:`fromtimestamp` را " +"فراخوانی کنید::" msgid "datetime.fromtimestamp(timestamp, timezone.utc)" -msgstr "" +msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" -msgid "On the POSIX compliant platforms, it is equivalent to the following expression::" -msgstr "" +msgid "" +"On the POSIX compliant platforms, it is equivalent to the following " +"expression::" +msgstr "در پلتفرم‌های سازگار با POSIX، معادل عبارت زیر است::" -msgid "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" +msgid "" +"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" +"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -msgid "except the latter formula always supports the full years range: between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." +msgid "" +"except the latter formula always supports the full years range: " +"between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" +"با این تفاوت که فرمول دوم همیشه از بازه‌ی کامل سال‌ها پشتیبانی می‌کند: " +"بین :const:`MINYEAR` و :const:`MAXYEAR` به‌صورت شامل هر دو." -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 UTC. As such, the recommended way to create an object representing a specific timestamp in UTC is by calling ``datetime.fromtimestamp(timestamp, tz=timezone.utc)``." -msgstr "" +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 UTC. As such, the recommended way to create an object representing a " +"specific timestamp in UTC is by calling ``datetime.fromtimestamp(timestamp, " +"tz=timezone.utc)``." +msgstr "" +"از آن‌جا که بسیاری از متدهای ``datetime`` با شیءهای ``datetime`` ساده " +"(naive) به‌عنوان زمان‌های محلی رفتار می‌کنند، ترجیح داده می‌شود برای نمایش " +"زمان‌ها در UTC از datetimeهای آگاه (aware) استفاده شود. بنابراین، روش " +"توصیه‌شده برای ایجاد یک شیء برای نمایش یک برچسب زمانی (timestamp) مشخص در " +"UTC، فراخوانی ``datetime.fromtimestamp(timestamp, tz=timezone.utc)`` است." -msgid "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is out of the range of values supported by the platform C :c:func:`gmtime` function. Raise :exc:`OSError` instead of :exc:`ValueError` on :c:func:`gmtime` failure." +msgid "" +"Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " +"out of the range of values supported by the platform C :c:func:`gmtime` " +"function. Raise :exc:`OSError` instead of :exc:`ValueError` " +"on :c:func:`gmtime` failure." msgstr "" +"اگر برچسب زمانی (timestamp) خارج از محدوده مقادیر پشتیبانی‌شده توسط " +"تابع :c:func:`gmtime` در زبان C پلتفرم باشد، :exc:`OverflowError` " +"به‌جای :exc:`ValueError` پرتاب می‌شود. در صورت " +"شکست :c:func:`gmtime`، :exc:`OSError` به‌جای :exc:`ValueError` پرتاب می‌شود." msgid "Accepts any real number as *timestamp*, not only integer or float." msgstr "" +"هر عدد حقیقی را به‌عنوان *timestamp* می‌پذیرد، نه فقط عدد صحیح یا float." msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" +"به‌جای آن از :meth:`datetime.fromtimestamp` با :const:`UTC` استفاده کنید." -msgid "Return the :class:`.datetime` corresponding to the proleptic Gregorian ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is raised unless ``1 <= ordinal <= datetime.max.toordinal()``. The hour, minute, second and microsecond of the result are all 0, and :attr:`.tzinfo` is ``None``." -msgstr "" +msgid "" +"Return the :class:`.datetime` corresponding to the proleptic Gregorian " +"ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " +"raised unless ``1 <= ordinal <= datetime.max.toordinal()``. The hour, " +"minute, second and microsecond of the result are all 0, and :attr:`.tzinfo` " +"is ``None``." +msgstr "" +":class:`.datetime` متناظر با شماره ترتیبی گاه‌شماری میلادی پیش‌رو (proleptic " +"Gregorian ordinal) را برمی‌گرداند، که در آن ۱ ژانویه سال ۱ شماره ترتیبی ۱ را " +"دارد. استثنای :exc:`ValueError` پرتاب می‌شود، مگر اینکه ``1 <= ordinal <= " +"datetime.max.toordinal()`` باشد. ساعت، دقیقه، ثانیه و میکروثانیه‌ی نتیجه " +"همگی ۰ هستند و :attr:`.tzinfo` برابر ``None`` است." -msgid "Return a new :class:`.datetime` object whose date components are equal to the given :class:`date` object's, and whose time components are equal to the given :class:`.time` object's. If the *tzinfo* argument is provided, its value is used to set the :attr:`.tzinfo` attribute of the result, otherwise the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the *date* argument is a :class:`!datetime` object, its time components and :attr:`.tzinfo` attributes are ignored." -msgstr "" +msgid "" +"Return a new :class:`.datetime` object whose date components are equal to " +"the given :class:`date` object's, and whose time components are equal to " +"the given :class:`.time` object's. If the *tzinfo* argument is provided, " +"its value is used to set the :attr:`.tzinfo` attribute of the result, " +"otherwise the :attr:`~.time.tzinfo` attribute of the *time* argument is " +"used. If the *date* argument is a :class:`!datetime` object, its time " +"components and :attr:`.tzinfo` attributes are ignored." +msgstr "" +"یک شیء جدید :class:`.datetime` برمی‌گرداند که کامپوننت‌های تاریخ آن برابر با " +"کامپوننت‌های تاریخ شیء :class:`date` داده‌شده است، و کامپوننت‌های زمان آن " +"برابر با کامپوننت‌های زمان شیء :class:`.time` داده‌شده است. اگر آرگومان " +"*tzinfo* ارائه شود، از مقدار آن برای تنظیم ویژگی :attr:`.tzinfo` نتیجه " +"استفاده می‌شود، در غیر این صورت از ویژگی :attr:`~.time.tzinfo` آرگومان " +"*time* استفاده می‌شود. اگر آرگومان *date* یک شیء :class:`!datetime` باشد، " +"کامپوننت‌های زمان و ویژگی :attr:`.tzinfo` آن نادیده گرفته می‌شوند." -msgid "For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d.time(), d.tzinfo)``." +msgid "" +"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), " +"d.time(), d.tzinfo)``." msgstr "" +"برای هر شیء ``d`` از کلاس :class:`.datetime`، ``d == " +"datetime.combine(d.date(), d.time(), d.tzinfo)``." msgid "Added the *tzinfo* argument." -msgstr "" +msgstr "آرگومان *tzinfo* افزوده شد." -msgid "Return a :class:`.datetime` corresponding to a *date_string* in any valid ISO 8601 format, with the following exceptions:" +msgid "" +"Return a :class:`.datetime` corresponding to a *date_string* in any valid " +"ISO 8601 format, with the following exceptions:" msgstr "" +"یک :class:`.datetime` متناظر با *date_string* را در هر قالب معتبر ISO 8601 " +"برمی‌گرداند، با استثناهای زیر:" msgid "Time zone offsets may have fractional seconds." -msgstr "" +msgstr "آفست‌های منطقه زمانی ممکن است ثانیه‌های کسری داشته باشند." msgid "The ``T`` separator may be replaced by any single unicode character." -msgstr "" +msgstr "می‌توان جداکننده‌ی ``T`` را با هر نویسه‌ی یونیکد واحدی جایگزین کرد." msgid "Fractional hours and minutes are not supported." -msgstr "" +msgstr "ساعت‌ها و دقیقه‌های کسری پشتیبانی نمی‌شوند." msgid "" ">>> import datetime as dt\n" @@ -1023,169 +1862,428 @@ msgid "" ">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" ">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone.utc)\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, " +"tzinfo=datetime.timezone.utc)\n" ">>> dt.datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.fromisoformat('2011-11-04')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> dt.datetime.fromisoformat('20111104')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23Z')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n" +">>> dt.datetime.fromisoformat('20111104T000523')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> dt.datetime.fromisoformat('2011-W01-2T00:05:23.283')\n" +"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n" +">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" +">>> dt.datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, " +"tzinfo=datetime.timezone.utc)\n" +">>> dt.datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23,\n" +" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -msgid "Previously, this method only supported formats that could be emitted by :meth:`date.isoformat` or :meth:`datetime.isoformat`." +msgid "" +"Previously, this method only supported formats that could be emitted " +"by :meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" +"پیش از این، این متد فقط از قالب‌هایی پشتیبانی می‌کرد که می‌توانستند " +"خروجی :meth:`date.isoformat` یا :meth:`datetime.isoformat` باشند." -msgid "Return a :class:`.datetime` corresponding to the ISO calendar date specified by *year*, *week* and *day*. The non-date components of the datetime are populated with their normal default values. This is the inverse of the function :meth:`datetime.isocalendar`." +msgid "" +"Return a :class:`.datetime` corresponding to the ISO calendar date " +"specified by *year*, *week* and *day*. The non-date components of the " +"datetime are populated with their normal default values. This is the " +"inverse of the function :meth:`datetime.isocalendar`." msgstr "" +"یک :class:`.datetime` متناظر با تاریخ گاه‌شماری ISO مشخص‌شده با *year*، *week* و " +"*day* برمی‌گرداند. اجزای غیرتاریخی datetime با مقادیر پیش‌فرض معمول خود " +"مقداردهی می‌شوند. این، معکوس تابع :meth:`datetime.isocalendar` است." -msgid "Return a :class:`.datetime` corresponding to *date_string*, parsed according to *format*." +msgid "" +"Return a :class:`.datetime` corresponding to *date_string*, parsed " +"according to *format*." msgstr "" +"یک :class:`.datetime` متناظر با *date_string* برمی‌گرداند که طبق *format* " +"تجزیه شده است." -msgid "If *format* does not contain microseconds or time zone information, this is equivalent to::" +msgid "" +"If *format* does not contain microseconds or time zone information, this is " +"equivalent to::" msgstr "" +"اگر *format* شامل میکروثانیه یا اطلاعات منطقه زمانی نباشد، این معادل است " +"با::" msgid "datetime(*(time.strptime(date_string, format)[0:6]))" -msgstr "" +msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" -msgid ":exc:`ValueError` is raised if the date_string and format can't be parsed by :func:`time.strptime` or if it returns a value which isn't a time tuple. See also :ref:`strftime-strptime-behavior` and :meth:`datetime.fromisoformat`." +msgid "" +":exc:`ValueError` is raised if the date_string and format can't be parsed " +"by :func:`time.strptime` or if it returns a value which isn't a time " +"tuple. See also :ref:`strftime-strptime-behavior` " +"and :meth:`datetime.fromisoformat`." msgstr "" +":exc:`ValueError` پرتاب می‌شود اگر date_string و format " +"توسط :func:`time.strptime` قابل تجزیه نباشند یا اگر مقداری برگرداند که یک " +"تاپل زمانیی نباشد. همچنین :ref:`strftime-strptime-behavior` " +"و :meth:`datetime.fromisoformat` را ببینید." -msgid "If *format* specifies a day of month without a year a :exc:`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap year bug in code seeking to parse only a month and day as the default year used in absence of one in the format is not a leap year. Such *format* values may raise an error as of Python 3.15. The workaround is to always include a year in your *format*. If parsing *date_string* values that do not have a year, explicitly add a year that is a leap year before parsing:" -msgstr "" +msgid "" +"If *format* specifies a day of month without a year " +"a :exc:`DeprecationWarning` is now emitted. This is to avoid a quadrennial " +"leap year bug in code seeking to parse only a month and day as the default " +"year used in absence of one in the format is not a leap year. Such *format* " +"values may raise an error as of Python 3.15. The workaround is to always " +"include a year in your *format*. If parsing *date_string* values that do " +"not have a year, explicitly add a year that is a leap year before parsing:" +msgstr "" +"اگر *format* روزی از ماه را بدون سال تعیین کند، اکنون " +"یک :exc:`DeprecationWarning` صادر می‌شود. این کار برای اجتناب از یک باگ سال " +"کبیسه‌ای چهارساله در کدی است که می‌خواهد فقط ماه و روز را تجزیه کند، زیرا سال " +"پیش‌فرضی که در نبود سال در قالب استفاده می‌شود، سال کبیسه نیست. چنین مقادیری " +"برای *format* ممکن است از پایتون 3.15 به بعد خطایی پرتاب کنند. راه‌حل این " +"است که همیشه یک سال در *format* خود بگنجانید. اگر مقادیر *date_string* بدون " +"سال را تجزیه می‌کنید، پیش از تجزیه به‌صراحت یک سال کبیسه اضافه کنید:" msgid "" ">>> import datetime as dt\n" ">>> date_string = \"02/29\"\n" -">>> when = dt.datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # Avoids leap year bug.\n" +">>> when = dt.datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" ">>> when.strftime(\"%B %d\")\n" "'February 29'" msgstr "" +">>> import datetime as dt\n" +">>> date_string = \"02/29\"\n" +">>> when = dt.datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" -msgid "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, tzinfo=None)``." +msgid "" +"The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " +"tzinfo=None)``." msgstr "" +"زودترین :class:`.datetime` قابل‌نمایش، ``datetime(MINYEAR, 1, 1, " +"tzinfo=None)``." -msgid "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=None)``." +msgid "" +"The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, " +"23, 59, 59, 999999, tzinfo=None)``." msgstr "" +"آخرین :class:`.datetime` قابل‌نمایش، ``datetime(MAXYEAR, 12, 31, 23, 59, 59, " +"999999, tzinfo=None)``." -msgid "The smallest possible difference between non-equal :class:`.datetime` objects, ``timedelta(microseconds=1)``." +msgid "" +"The smallest possible difference between non-equal :class:`.datetime` " +"objects, ``timedelta(microseconds=1)``." msgstr "" +"کوچک‌ترین تفاوت ممکن بین اشیای :class:`.datetime` که برابر نیستند، " +"``timedelta(microseconds=1)``." msgid "In ``range(24)``." -msgstr "" +msgstr "در ``range(24)``." msgid "In ``range(60)``." -msgstr "" +msgstr "در ``range(60)``." msgid "In ``range(1000000)``." -msgstr "" +msgstr "در ``range(1000000)``." -msgid "The object passed as the *tzinfo* argument to the :class:`.datetime` constructor, or ``None`` if none was passed." +msgid "" +"The object passed as the *tzinfo* argument to the :class:`.datetime` " +"constructor, or ``None`` if none was passed." msgstr "" +"شیء داده‌شده به‌عنوان آرگومان *tzinfo* به سازنده‌ی :class:`.datetime`، یا " +"``None`` اگر هیچ شیء داده نشده باشد." -msgid "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A repeated interval occurs when clocks are rolled back at the end of daylight saving time or when the UTC offset for the current zone is decreased for political reasons.) The values 0 and 1 represent, respectively, the earlier and later of the two moments with the same wall time representation." -msgstr "" +msgid "" +"In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " +"(A repeated interval occurs when clocks are rolled back at the end of " +"daylight saving time or when the UTC offset for the current zone is " +"decreased for political reasons.) The values 0 and 1 represent, " +"respectively, the earlier and later of the two moments with the same wall " +"time representation." +msgstr "" +"در ``[0, 1]``. برای رفع ابهام از زمان‌های دیواری (wall time) در یک بازه‌ی " +"تکرارشده استفاده می‌شود. (یک بازه‌ی تکرارشده زمانی رخ می‌دهد که ساعت‌ها در پایان " +"ساعت تابستانی به عقب برگردانده شوند یا آفست UTC (UTC offset) برای منطقه‌ی " +"زمانی فعلی به دلایل سیاسی کاهش یابد.) مقادیر ۰ و ۱، به‌ترتیب، نشان‌دهنده‌ی لحظه‌ی " +"زودتر و دیرتر از میان دو لحظه‌ای هستند که نمایش زمان دیواری یکسانی دارند." msgid "``datetime2 = datetime1 + timedelta``" -msgstr "" +msgstr "``datetime2 = datetime1 + timedelta``" msgid "\\(1)" -msgstr "" +msgstr "\\(1)" msgid "``datetime2 = datetime1 - timedelta``" -msgstr "" +msgstr "``datetime2 = datetime1 - timedelta``" msgid "\\(2)" -msgstr "" +msgstr "\\(2)" msgid "``timedelta = datetime1 - datetime2``" -msgstr "" +msgstr "``timedelta = datetime1 - datetime2``" msgid "``datetime1 == datetime2``" -msgstr "" +msgstr "``datetime1 == datetime2``" msgid "``datetime1 != datetime2``" -msgstr "" +msgstr "``datetime1 != datetime2``" msgid "``datetime1 < datetime2``" -msgstr "" +msgstr "``datetime1 < datetime2``" msgid "``datetime1 > datetime2``" -msgstr "" +msgstr "``datetime1 > datetime2``" msgid "``datetime1 <= datetime2``" -msgstr "" +msgstr "``datetime1 <= datetime2``" msgid "``datetime1 >= datetime2``" -msgstr "" +msgstr "``datetime1 >= datetime2``" -msgid "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta.days < 0``. The result has the same :attr:`~.datetime.tzinfo` attribute as the input datetime, and ``datetime2 - datetime1 == timedelta`` after. :exc:`OverflowError` is raised if ``datetime2.year`` would be smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone adjustments are done even if the input is an aware object." -msgstr "" +msgid "" +"``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " +"moving forward in time if ``timedelta.days > 0``, or backward if " +"``timedelta.days < 0``. The result has the same :attr:`~.datetime.tzinfo` " +"attribute as the input datetime, and ``datetime2 - datetime1 == timedelta`` " +"after. :exc:`OverflowError` is raised if ``datetime2.year`` would be " +"smaller than :const:`MINYEAR` or larger than :const:`MAXYEAR`. Note that no " +"time zone adjustments are done even if the input is an aware object." +msgstr "" +"``datetime2`` به اندازه‌ی یک بازه‌ی زمانی ``timedelta`` از ``datetime1`` " +"فاصله دارد؛ اگر ``timedelta.days > 0`` باشد در زمان به جلو حرکت می‌کند و اگر " +"``timedelta.days < 0`` باشد در زمان به عقب حرکت می‌کند. نتیجه همان " +"ویژگی :attr:`~.datetime.tzinfo` را دارد که datetime ورودی دارد، و پس از آن " +"``datetime2 - datetime1 == timedelta`` برقرار است. اگر ``datetime2.year`` " +"کوچک‌تر از :const:`MINYEAR` یا بزرگ‌تر از :const:`MAXYEAR` " +"باشد، :exc:`OverflowError` پرتاب می‌شود. توجه داشته باشید که حتی اگر ورودی " +"یک شیء آگاه باشد، هیچ‌گونه تنظیمی برای منطقه‌ی زمانی انجام نمی‌شود." -msgid "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the input datetime, and no time zone adjustments are done even if the input is aware." +msgid "" +"Computes the ``datetime2`` such that ``datetime2 + timedelta == " +"datetime1``. As for addition, the result has the " +"same :attr:`~.datetime.tzinfo` attribute as the input datetime, and no time " +"zone adjustments are done even if the input is aware." msgstr "" +"``datetime2`` را به‌گونه‌ای محاسبه می‌کند که ``datetime2 + timedelta == " +"datetime1``. همانند عمل جمع، نتیجه همان ویژگی :attr:`~.datetime.tzinfo` را " +"دارد که datetime ورودی دارد، و حتی اگر ورودی آگاه از منطقه زمانی باشد، هیچ " +"تنظیمی برای منطقه زمانی انجام نمی‌شود." -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." +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 "" +"تفریق یک :class:`.datetime` از یک :class:`!datetime` تنها در صورتی تعریف " +"شده است که هر دو عملوند ساده باشند، یا هر دو آگاه باشند. اگر یکی آگاه و " +"دیگری ساده باشد، :exc:`TypeError` پرتاب می‌شود." -msgid "If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == datetime1``. No time zone adjustments are done in this case." -msgstr "" +msgid "" +"If both are naive, or both are aware and have the " +"same :attr:`~.datetime.tzinfo` attribute, the :attr:`~.datetime.tzinfo` " +"attributes are ignored, and the result is a :class:`timedelta` object ``t`` " +"such that ``datetime2 + t == datetime1``. No time zone adjustments are done " +"in this case." +msgstr "" +"اگر هر دو ساده (naive) باشند، یا هر دو آگاه (aware) باشند و " +"ویژگی :attr:`~.datetime.tzinfo` یکسانی داشته باشند، " +"ویژگی‌های :attr:`~.datetime.tzinfo` نادیده گرفته می‌شوند و نتیجه یک " +"شیء :class:`timedelta` به نام ``t`` است، به‌طوری که ``datetime2 + t == " +"datetime1``. در این حالت هیچ تنظیمی برای منطقه زمانی انجام نمی‌شود." -msgid "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, ``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation never overflows." -msgstr "" +msgid "" +"If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " +"``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " +"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - " +"(b.replace(tzinfo=None) - b.utcoffset())`` except that the implementation " +"never overflows." +msgstr "" +"اگر هر دو آگاه (aware) باشند و ویژگی‌های :attr:`~.datetime.tzinfo` متفاوتی " +"داشته باشند، ``a-b`` طوری عمل می‌کند که گویی ``a`` و ``b`` ابتدا به " +"دیت‌تایم‌های ساده (naive) UTC تبدیل شده باشند. نتیجه " +"``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - " +"b.utcoffset())`` است، با این تفاوت که پیاده‌سازی هرگز دچار سرریز نمی‌شود." -msgid ":class:`.datetime` objects are equal if they represent the same date and time, taking into account the time zone." +msgid "" +":class:`.datetime` objects are equal if they represent the same date and " +"time, taking into account the time zone." msgstr "" +"اشیای :class:`.datetime` در صورتی برابر هستند که تاریخ و زمان یکسانی را " +"نشان دهند، با در نظر گرفتن منطقه‌ی زمانی." msgid "Naive and aware :class:`.datetime` objects are never equal." -msgstr "" +msgstr "اشیای :class:`.datetime` ساده و آگاه هرگز برابر نیستند." -msgid "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and the base datetimes are compared. If both comparands are aware and have different :attr:`~.datetime.tzinfo` attributes, the comparison acts as comparands were first converted to UTC datetimes except that the implementation never overflows. :class:`.datetime` instances in a repeated interval are never equal to :class:`!datetime` instances in other time zone." -msgstr "" +msgid "" +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows. :class:`.datetime` instances in a repeated " +"interval are never equal to :class:`!datetime` instances in other time zone." +msgstr "" +"اگر هر دو طرف مقایسه آگاه باشند و ویژگی :attr:`!tzinfo` یکسانی داشته باشند، " +"ویژگی‌های :attr:`!tzinfo` و :attr:`~.datetime.fold` نادیده گرفته می‌شوند و " +"تاریخ‌زمان‌های پایه مقایسه می‌شوند. اگر هر دو طرف مقایسه آگاه باشند و " +"ویژگی‌های :attr:`~.datetime.tzinfo` متفاوتی داشته باشند، مقایسه به‌گونه‌ای عمل " +"می‌کند که گویی دو طرف مقایسه ابتدا به تاریخ‌زمان‌های UTC تبدیل شده‌اند، با این " +"تفاوت که پیاده‌سازی هرگز دچار سرریز نمی‌شود. نمونه‌های :class:`.datetime` در " +"یک بازه تکراری هرگز با نمونه‌های :class:`!datetime` در منطقه زمانی دیگر " +"برابر نیستند." -msgid "*datetime1* is considered less than *datetime2* when *datetime1* precedes *datetime2* in time, taking into account the time zone." +msgid "" +"*datetime1* is considered less than *datetime2* when *datetime1* precedes " +"*datetime2* in time, taking into account the time zone." msgstr "" +"*datetime1* کمتر از *datetime2* در نظر گرفته می‌شود، هرگاه *datetime1* با در " +"نظر گرفتن منطقه زمانی، از نظر زمانی قبل از *datetime2* قرار داشته باشد." -msgid "Order comparison between naive and aware :class:`.datetime` objects raises :exc:`TypeError`." +msgid "" +"Order comparison between naive and aware :class:`.datetime` objects " +"raises :exc:`TypeError`." msgstr "" +"مقایسه‌ی ترتیبی بین اشیای :class:`.datetime` ساده (naive) و آگاه (aware)، " +"باعث پرتاب :exc:`TypeError` می‌شود." -msgid "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and the base datetimes are compared. If both comparands are aware and have different :attr:`~.datetime.tzinfo` attributes, the comparison acts as comparands were first converted to UTC datetimes except that the implementation never overflows." -msgstr "" +msgid "" +"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " +"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " +"the base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " +"comparands were first converted to UTC datetimes except that the " +"implementation never overflows." +msgstr "" +"اگر هر دو طرف مقایسه آگاه باشند و ویژگی :attr:`!tzinfo` یکسانی داشته باشند، " +"ویژگی‌های :attr:`!tzinfo` و :attr:`~.datetime.fold` نادیده گرفته می‌شوند و " +"datetimeهای پایه مقایسه می‌شوند. اگر هر دو طرف مقایسه آگاه باشند و " +"ویژگی‌های :attr:`~.datetime.tzinfo` متفاوتی داشته باشند، مقایسه به‌گونه‌ای " +"رفتار می‌کند که گویی طرفین مقایسه ابتدا به datetimeهای UTC تبدیل شده‌اند، با " +"این تفاوت که پیاده‌سازی هرگز دچار سرریز نمی‌شود." -msgid "Equality comparisons between aware and naive :class:`.datetime` instances don't raise :exc:`TypeError`." +msgid "" +"Equality comparisons between aware and naive :class:`.datetime` instances " +"don't raise :exc:`TypeError`." msgstr "" +"مقایسه‌های برابری بین نمونه‌های :class:`.datetime` آگاه و ساده، " +"استثنای :exc:`TypeError` را پرتاب نمی‌کنند." msgid "Return :class:`date` object with same year, month and day." -msgstr "" +msgstr "بازگرداندن شیء :class:`date` با همان سال، ماه و روز." -msgid "Return :class:`.time` object with same hour, minute, second, microsecond and fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." +msgid "" +"Return :class:`.time` object with same hour, minute, second, microsecond " +"and fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" +"شیء :class:`.time` را با همان ساعت، دقیقه، ثانیه، میکروثانیه و fold " +"برمی‌گرداند. :attr:`.tzinfo` برابر ``None`` است. همچنین متد :meth:`timetz` " +"را ببینید." msgid "The fold value is copied to the returned :class:`.time` object." -msgstr "" +msgstr "مقدار fold به شیء :class:`.time` برگردانده‌شده کپی می‌شود." -msgid "Return :class:`.time` object with same hour, minute, second, microsecond, fold, and tzinfo attributes. See also method :meth:`time`." +msgid "" +"Return :class:`.time` object with same hour, minute, second, microsecond, " +"fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" +"یک شیء :class:`.time` با همان ویژگی‌های hour، minute، second، microsecond، " +"fold و tzinfo را برمی‌گرداند. همچنین متد :meth:`time` را ببینید." -msgid "Return a new :class:`datetime` object with the same attributes, but with specified parameters updated. Note that ``tzinfo=None`` can be specified to create a naive datetime from an aware datetime with no conversion of date and time data." +msgid "" +"Return a new :class:`datetime` object with the same attributes, but with " +"specified parameters updated. Note that ``tzinfo=None`` can be specified to " +"create a naive datetime from an aware datetime with no conversion of date " +"and time data." msgstr "" +"یک شیء :class:`datetime` جدید با همان ویژگی‌ها برمی‌گرداند، اما پارامترهای " +"مشخص‌شده در آن به‌روزرسانی شده‌اند. توجه داشته باشید که می‌توان ``tzinfo=None`` " +"را مشخص کرد تا بدون هیچ‌گونه تبدیل داده‌های تاریخ و زمان، یک datetime ساده " +"(naive) از یک datetime آگاه (aware) ایجاد شود." -msgid ":class:`.datetime` objects are also supported by generic function :func:`copy.replace`." +msgid "" +":class:`.datetime` objects are also supported by generic " +"function :func:`copy.replace`." msgstr "" +"تابع عام :func:`copy.replace` همچنین از اشیای :class:`.datetime` پشتیبانی " +"می‌کند." -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." +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 "" +"یک شیء :class:`.datetime` با ویژگی جدید :attr:`.tzinfo` به مقدار *tz* " +"برمی‌گرداند و داده‌های تاریخ و زمان را چنان تنظیم می‌کند که نتیجه همان زمان " +"UTC مربوط به *self* باشد، اما به زمان محلی *tz*." -msgid "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If *self* is naive, it is presumed to represent time in the system time zone." +msgid "" +"If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " +"its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " +"*self* is naive, it is presumed to represent time in the system time zone." msgstr "" +"در صورت ارائه، *tz* باید نمونه‌ای از یک زیرکلاس :class:`tzinfo` باشد، و " +"متدهای :meth:`utcoffset` و :meth:`dst` آن نباید ``None`` برگردانند. اگر " +"*self* ساده (naive) باشد، فرض می‌شود که زمان را در منطقه زمانی سیستم نشان " +"می‌دهد." -msgid "If called without arguments (or with ``tz=None``) the system local time zone is assumed for the target time zone. The ``.tzinfo`` attribute of the converted datetime instance will be set to an instance of :class:`timezone` with the zone name and offset obtained from the OS." +msgid "" +"If called without arguments (or with ``tz=None``) the system local time " +"zone is assumed for the target time zone. The ``.tzinfo`` attribute of the " +"converted datetime instance will be set to an instance of :class:`timezone` " +"with the zone name and offset obtained from the OS." msgstr "" +"اگر بدون آرگومان (یا با ``tz=None``) فراخوانی شود، منطقه زمانی محلی سیستم " +"به‌عنوان منطقه زمانی مقصد فرض می‌شود. ویژگی ``.tzinfo`` نمونه‌ی datetime " +"تبدیل‌شده به نمونه‌ای از :class:`timezone` تنظیم می‌شود که نام منطقه و آفست " +"(offset) آن از سیستم‌عامل به‌دست آمده است." -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 in the time zone *tz*, representing the same UTC time as *self*: after ``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have the same date and time data as ``dt - dt.utcoffset()``." -msgstr "" +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 " +"in the time zone *tz*, representing the same UTC time as *self*: after " +"``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have the " +"same date and time data as ``dt - dt.utcoffset()``." +msgstr "" +"اگر ``self.tzinfo`` همان *tz* باشد، ``self.astimezone(tz)`` برابر *self* " +"است: هیچ تنظیمی بر داده‌های تاریخ یا زمان اعمال نمی‌شود. در غیر این صورت، " +"نتیجه زمان محلی در منطقه زمانی *tz* است که همان زمان UTC مربوط به *self* را " +"نشان می‌دهد: پس از ``astz = dt.astimezone(tz)``، عبارت ``astz - " +"astz.utcoffset()`` همان داده‌های تاریخ و زمان ``dt - dt.utcoffset()`` را " +"خواهد داشت." -msgid "If you merely want to attach a :class:`timezone` object *tz* to a datetime *dt* without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If you merely want to remove the :class:`!timezone` object from an aware datetime *dt* without conversion of date and time data, use ``dt.replace(tzinfo=None)``." -msgstr "" +msgid "" +"If you merely want to attach a :class:`timezone` object *tz* to a datetime " +"*dt* without adjustment of date and time data, use " +"``dt.replace(tzinfo=tz)``. If you merely want to remove the :class:`!" +"timezone` object from an aware datetime *dt* without conversion of date and " +"time data, use ``dt.replace(tzinfo=None)``." +msgstr "" +"اگر صرفاً می‌خواهید یک شیء :class:`timezone` به نام *tz* را بدون تنظیم " +"داده‌های تاریخ و زمان به یک datetime به نام *dt* متصل کنید، از " +"``dt.replace(tzinfo=tz)`` استفاده کنید. اگر صرفاً می‌خواهید شیء :class:`!" +"timezone` را از یک datetime آگاه به نام *dt* بدون تبدیل داده‌های تاریخ و " +"زمان حذف کنید، از ``dt.replace(tzinfo=None)`` استفاده کنید." -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::" +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 "" +"توجه داشته باشید که متد پیش‌فرض :meth:`tzinfo.fromutc` می‌تواند در یک زیرکلاس " +"از :class:`tzinfo` بازنویسی شود تا بر نتیجه‌ی برگردانده‌شده " +"توسط :meth:`astimezone` تأثیر بگذارد. با صرف‌نظر از حالت‌های " +"خطا، :meth:`astimezone` مانند زیر عمل می‌کند::" msgid "" "def astimezone(self, tz):\n" @@ -1196,102 +2294,247 @@ msgid "" " # Convert from UTC to tz's local time.\n" " return tz.fromutc(utc)" msgstr "" +"def astimezone(self, tz):\n" +" if self.tzinfo is tz:\n" +" return self\n" +" # Convert self to UTC, and attach the new timezone object.\n" +" utc = (self - self.utcoffset()).replace(tzinfo=tz)\n" +" # Convert from UTC to tz's local time.\n" +" return tz.fromutc(utc)" msgid "*tz* now can be omitted." -msgstr "" +msgstr "اکنون می‌توان *tz* را حذف کرد." -msgid "The :meth:`astimezone` method can now be called on naive instances that are presumed to represent system local time." +msgid "" +"The :meth:`astimezone` method can now be called on naive instances that are " +"presumed to represent system local time." msgstr "" +"اکنون می‌توان متد :meth:`astimezone` را بر روی نمونه‌های ساده (naive) که فرض " +"می‌شود زمان محلی سیستم را نشان می‌دهند، فراخوانی کرد." -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." +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 "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را برمی‌گرداند، در غیر این " +"صورت ``self.tzinfo.utcoffset(self)`` را برمی‌گرداند، و اگر این فراخوانی " +"``None`` یا یک شیء :class:`timedelta` با اندازه‌ای کمتر از یک روز را " +"برنگرداند، استثنایی پرتاب می‌کند." msgid "The UTC offset is not restricted to a whole number of minutes." -msgstr "" +msgstr "فاصله زمانی UTC به تعداد صحیحی از دقیقه‌ها محدود نمی‌شود." -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." +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 "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را برمی‌گرداند، در غیر این " +"صورت ``self.tzinfo.dst(self)`` را برمی‌گرداند، و اگر این فراخوانی ``None`` " +"یا یک شیء :class:`timedelta` با اندازه‌ای کمتر از یک روز را برنگرداند، " +"استثنا پرتاب می‌کند." msgid "The DST offset is not restricted to a whole number of minutes." -msgstr "" +msgstr "آفست ساعت تابستانی (DST offset) به تعداد صحیحی از دقیقه‌ها محدود نیست." -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," +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 "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را بازمی‌گرداند، در غیر " +"این صورت ``self.tzinfo.tzname(self)`` را بازمی‌گرداند، و اگر مورد اخیر " +"``None`` یا یک شیء رشته را برنگرداند، استثنایی را پرتاب می‌کند،" msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" msgstr "" +"time.struct_time((d.year, d.month, d.day,\n" +" d.hour, d.minute, d.second,\n" +" d.weekday(), yday, dst))" -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 :attr:`~time.struct_time.tm_isdst` flag of the result is set according to the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns ``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` returns a non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is set to 0." -msgstr "" +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 :attr:`~time.struct_time.tm_isdst` flag of the result is set according " +"to the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` " +"returns ``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` " +"returns a non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!" +"tm_isdst` is set to 0." +msgstr "" +"که در آن ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` " +"شماره‌ی روز در سال جاری است که با ۱ برای اول ژانویه آغاز می‌شود. " +"پرچم :attr:`~time.struct_time.tm_isdst` در نتیجه بر اساس متد :meth:`dst` " +"تنظیم می‌شود: اگر :attr:`.tzinfo` برابر ``None`` باشد یا :meth:`dst` مقدار " +"``None`` را برگرداند، :attr:`!tm_isdst` روی ``-1`` تنظیم می‌شود؛ در غیر این " +"صورت، اگر :meth:`dst` مقداری غیرصفر برگرداند، :attr:`!tm_isdst` روی ۱ تنظیم " +"می‌شود؛ در غیر این صورت، :attr:`!tm_isdst` روی ۰ تنظیم می‌شود." -msgid "If :class:`.datetime` instance ``d`` is naive, this is the same as ``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a UTC time." +msgid "" +"If :class:`.datetime` instance ``d`` is naive, this is the same as " +"``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced " +"to 0 regardless of what ``d.dst()`` returns. DST is never in effect for a " +"UTC time." msgstr "" +"اگر نمونه‌ی ``d`` از :class:`.datetime` ساده (naive) باشد، این معادل " +"``d.timetuple()`` است، به جز اینکه :attr:`~.time.struct_time.tm_isdst` بدون " +"توجه به اینکه ``d.dst()`` چه مقداری برمی‌گرداند، به‌طور اجباری روی ۰ تنظیم " +"می‌شود. DST هرگز برای زمان UTC فعال نیست." -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 returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year boundary." -msgstr "" +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 returned. :attr:`!tm_isdst` is forced to 0. Note that " +"an :exc:`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or " +"``MAXYEAR`` and UTC adjustment spills over a year boundary." +msgstr "" +"اگر ``d`` آگاه باشد، ``d`` با کم کردن ``d.utcoffset()`` به زمان UTC بهنجار " +"می‌شود و یک :class:`time.struct_time` برای زمان بهنجار برگردانده " +"می‌شود. :attr:`!tm_isdst` به‌اجبار روی ۰ قرار می‌گیرد. توجه داشته باشید که اگر " +"``d.year`` برابر ``MINYEAR`` یا ``MAXYEAR`` باشد و تنظیم UTC از مرز یک سال " +"عبور کند، ممکن است یک :exc:`OverflowError` پرتاب شود." -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 UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading results. If you have a naive ``datetime`` representing UTC, use ``datetime.replace(tzinfo=timezone.utc)`` to make it aware, at which point you can use :meth:`.datetime.timetuple`." -msgstr "" +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 UTC; as a result, using :meth:`datetime.utctimetuple` may give " +"misleading results. If you have a naive ``datetime`` representing UTC, use " +"``datetime.replace(tzinfo=timezone.utc)`` to make it aware, at which point " +"you can use :meth:`.datetime.timetuple`." +msgstr "" +"از آن‌جا که اشیای ``datetime`` ساده (naive) توسط بسیاری از متدهای " +"``datetime`` به‌عنوان زمان‌های محلی در نظر گرفته می‌شوند، ترجیح داده می‌شود که " +"برای نمایش زمان‌ها در UTC از datetimeهای آگاه (aware) استفاده کنید؛ در " +"نتیجه، استفاده از :meth:`datetime.utctimetuple` ممکن است نتایج گمراه‌کننده‌ای " +"بدهد. اگر یک ``datetime`` ساده (naive) دارید که UTC را نشان می‌دهد، از " +"``datetime.replace(tzinfo=timezone.utc)`` استفاده کنید تا آگاه (aware) شود؛ " +"پس از آن می‌توانید از :meth:`.datetime.timetuple` استفاده کنید." -msgid "Return the proleptic Gregorian ordinal of the date. The same as ``self.date().toordinal()``." +msgid "" +"Return the proleptic Gregorian ordinal of the date. The same as " +"``self.date().toordinal()``." msgstr "" +"شماره ترتیبی تاریخ در گاه‌شماری میلادی تعمیم‌یافته (proleptic Gregorian ordinal) " +"را برمی‌گرداند. این مقدار همان ``self.date().toordinal()`` است." -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`." +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 "" +"مهر زمانی POSIX متناظر با نمونه‌ی :class:`.datetime` را برمی‌گرداند. مقدار " +"بازگشتی یک :class:`float` مشابه مقداری است که :func:`time.time` برمی‌گرداند." -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 the conversion. Since :class:`!datetime` supports wider range of values than :c:func:`mktime` on many platforms, this method may raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or far in the future." -msgstr "" +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 " +"the conversion. Since :class:`!datetime` supports wider range of values " +"than :c:func:`mktime` on many platforms, this method may " +"raise :exc:`OverflowError` or :exc:`OSError` for times far in the past or " +"far in the future." +msgstr "" +"نمونه‌های ساده‌ی :class:`.datetime` (naive) بیانگر زمان محلی فرض می‌شوند و این " +"متد برای انجام تبدیل، به تابع C :c:func:`mktime` در سکو متکی است. از آن‌جا " +"که :class:`!datetime` در بسیاری از سکوها بازه‌ی وسیع‌تری از مقادیر را نسبت " +"به :c:func:`mktime` پشتیبانی می‌کند، این متد ممکن است برای زمان‌های بسیار دور " +"در گذشته یا بسیار دور در آینده، :exc:`OverflowError` یا :exc:`OSError` را " +"پرتاب کند." -msgid "For aware :class:`.datetime` instances, the return value is computed as::" +msgid "" +"For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" +"برای نمونه‌های :class:`.datetime` آگاه، مقدار بازگشتی به‌صورت زیر محاسبه " +"می‌شود::" msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -msgstr "" +msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -msgid "There is no method to obtain the POSIX timestamp directly from a naive :class:`.datetime` instance representing UTC time. If your application uses this convention and your system time zone is not set to UTC, you can obtain the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" -msgstr "" +msgid "" +"There is no method to obtain the POSIX timestamp directly from a " +"naive :class:`.datetime` instance representing UTC time. If your " +"application uses this convention and your system time zone is not set to " +"UTC, you can obtain the POSIX timestamp by supplying " +"``tzinfo=timezone.utc``::" +msgstr "" +"هیچ متدی برای به‌دست آوردن برچسب زمانی POSIX به‌صورت مستقیم از یک نمونه‌ی " +"ساده‌ی :class:`.datetime` که نشان‌دهنده‌ی زمان UTC است وجود ندارد. اگر برنامه‌ی " +"شما از این قرارداد استفاده می‌کند و منطقه‌ی زمانی سیستم شما روی UTC تنظیم " +"نشده است، می‌توانید با ارائه‌ی ``tzinfo=timezone.utc`` برچسب زمانی POSIX را " +"به‌دست آورید::" msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -msgstr "" +msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgid "or by calculating the timestamp directly::" -msgstr "" +msgstr "یا با محاسبه‌ی مستقیم مهر زمانی::" msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -msgstr "" +msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -msgid "The :meth:`timestamp` method uses the :attr:`.fold` attribute to disambiguate the times during a repeated interval." +msgid "" +"The :meth:`timestamp` method uses the :attr:`.fold` attribute to " +"disambiguate the times during a repeated interval." msgstr "" +"متد :meth:`timestamp` از ویژگی :attr:`.fold` برای رفع ابهام زمان‌ها در طول " +"یک بازه‌ی تکرارشده استفاده می‌کند." -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`." +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 "" +"روز هفته را به‌عنوان عدد صحیح بازمی‌گرداند، به‌طوری که دوشنبه ۰ و یکشنبه ۶ " +"است. معادل ``self.date().weekday()`` است. همچنین :meth:`isoweekday` را " +"ببینید." -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`." +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 "" +"روز هفته را به‌صورت عدد صحیح برمی‌گرداند، که در آن دوشنبه ۱ و یکشنبه ۷ است. " +"معادل ``self.date().isoweekday()`` است. همچنین :meth:`weekday` " +"و :meth:`isocalendar` را ببینید." -msgid "Return a :term:`named tuple` with three components: ``year``, ``week`` and ``weekday``. The same as ``self.date().isocalendar()``." +msgid "" +"Return a :term:`named tuple` with three components: ``year``, ``week`` and " +"``weekday``. The same as ``self.date().isocalendar()``." msgstr "" +"یک :term:`named tuple` با سه کامپوننت برمی‌گرداند: ``year``، ``week`` و " +"``weekday``. معادل ``self.date().isocalendar()`` است." msgid "Return a string representing the date and time in ISO 8601 format:" -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که تاریخ و زمان را در قالب ISO 8601 نشان می‌دهد:" msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" -msgstr "" +msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``، اگر :attr:`microsecond` برابر ۰ نباشد" msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" -msgstr "" +msgstr "``YYYY-MM-DDTHH:MM:SS``، اگر :attr:`microsecond` برابر ۰ باشد" -msgid "If :meth:`utcoffset` does not return ``None``, a string is appended, giving the UTC offset:" +msgid "" +"If :meth:`utcoffset` does not return ``None``, a string is appended, giving " +"the UTC offset:" msgstr "" +"اگر :meth:`utcoffset` مقدار ``None`` را برنگرداند، رشته‌ای اضافه می‌شود که " +"فاصله زمانی از UTC را نشان می‌دهد:" -msgid "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is not 0" +msgid "" +"``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " +"is not 0" msgstr "" +"``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``، اگر :attr:`microsecond` " +"برابر ۰ نباشد" -msgid "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" +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` برابر " +"۰ باشد" msgid "" ">>> import datetime as dt\n" @@ -1300,9 +2543,18 @@ msgid "" ">>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" +"'2019-05-18T15:17:08.132263'\n" +">>> dt.datetime(2019, 5, 18, 15, 17, tzinfo=dt.timezone.utc).isoformat()\n" +"'2019-05-18T15:17:00+00:00'" -msgid "The optional argument *sep* (default ``'T'``) is a one-character separator, placed between the date and time portions of the result. For example::" +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 "" +"آرگومان اختیاری *sep* (پیش‌فرض ``'T'``) یک جداکننده تک‌نویسه‌ای است که بین " +"بخش‌های تاریخ و زمان نتیجه قرار می‌گیرد. برای مثال::" msgid "" ">>> import datetime as dt\n" @@ -1316,33 +2568,63 @@ msgid "" ">>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" +">>> import datetime as dt\n" +">>> class TZ(dt.tzinfo):\n" +"... \"\"\"A time zone with an arbitrary, constant -06:39 offset.\"\"\"\n" +"... def utcoffset(self, when):\n" +"... return dt.timedelta(hours=-6, minutes=-39)\n" +"...\n" +">>> dt.datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')\n" +"'2002-12-25 00:00:00-06:39'\n" +">>> dt.datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" +"'2009-11-27T00:00:00.000100-06:39'" -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:" +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 "" +"آرگومان اختیاری *timespec* تعداد کامپوننت‌های اضافی زمان برای شامل شدن را مشخص " +"می‌کند (پیش‌فرض ``'auto'`` است). این می‌تواند یکی از موارد زیر باشد:" -msgid "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as ``'microseconds'`` otherwise." +msgid "" +"``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " +"``'microseconds'`` otherwise." msgstr "" +"``'auto'``: اگر :attr:`microsecond` برابر ۰ باشد، مانند ``'seconds'`` و در " +"غیر این صورت مانند ``'microseconds'`` است." msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." -msgstr "" +msgstr "``'hours'``: :attr:`hour` را در قالب دو رقمی ``HH`` بگنجانید." -msgid "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." -msgstr "" +msgid "" +"``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." +msgstr "``'minutes'``: شامل :attr:`hour` و :attr:`minute` در قالب ``HH:MM``." -msgid "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in ``HH:MM:SS`` format." +msgid "" +"``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " +"``HH:MM:SS`` format." msgstr "" +"``'seconds'``: شامل :attr:`hour`، :attr:`minute` و :attr:`second` در قالب " +"``HH:MM:SS``." -msgid "``'milliseconds'``: Include full time, but truncate fractional second part to milliseconds. ``HH:MM:SS.sss`` format." +msgid "" +"``'milliseconds'``: Include full time, but truncate fractional second part " +"to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" +"``'milliseconds'``: زمان کامل را شامل می‌شود، اما بخش کسری ثانیه را به " +"میلی‌ثانیه قطع می‌کند. قالب ``HH:MM:SS.sss``." msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" +"``'microseconds'``: زمان کامل را در قالب ``HH:MM:SS.ffffff`` بگنجانید." msgid "Excluded time components are truncated, not rounded." -msgstr "" +msgstr "کامپوننت‌های زمانی حذف‌شده بریده می‌شوند، نه اینکه گرد شوند." msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" +":exc:`ValueError` در صورت نامعتبر بودن آرگومان *timespec* پرتاب می‌شود::" msgid "" ">>> import datetime as dt\n" @@ -1352,39 +2634,76 @@ msgid "" ">>> my_datetime.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.now().isoformat(timespec='minutes')\n" +"'2002-12-25T00:00'\n" +">>> my_datetime = dt.datetime(2015, 1, 1, 12, 30, 59, 0)\n" +">>> my_datetime.isoformat(timespec='microseconds')\n" +"'2015-01-01T12:30:59.000000'" msgid "Added the *timespec* parameter." -msgstr "" +msgstr "پارامتر *timespec* افزوده شد." -msgid "For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d.isoformat(' ')``." +msgid "" +"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to " +"``d.isoformat(' ')``." msgstr "" +"برای یک نمونه ``d`` از :class:`.datetime`، ``str(d)`` معادل ``d.isoformat(' " +"')`` است." msgid "Return a string representing the date and time::" -msgstr "" +msgstr "رشته‌ای برمی‌گرداند که تاریخ و زمان را نشان می‌دهد::" msgid "" ">>> import datetime as dt\n" ">>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime(2002, 12, 4, 20, 30, 40).ctime()\n" +"'Wed Dec 4 20:30:40 2002'" -msgid "The output string will *not* include time zone information, regardless of whether the input is aware or naive." +msgid "" +"The output string will *not* include time zone information, regardless of " +"whether the input is aware or naive." msgstr "" +"رشته خروجی شامل اطلاعات منطقه زمانی *نخواهد* شد، صرف‌نظر از اینکه ورودی آگاه " +"(aware) باشد یا ساده (naive)." -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." +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 "" +"در سکوهایی که تابع C بومی :c:func:`ctime` (که :func:`time.ctime` آن را " +"فراخوانی می‌کند، اما :meth:`datetime.ctime` آن را فراخوانی نمی‌کند) با " +"استاندارد C مطابقت دارد." -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`." +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 "" +"رشته‌ای را برمی‌گرداند که نشان‌دهنده تاریخ و زمان است و توسط یک رشته قالب صریح " +"کنترل می‌شود. همچنین :ref:`strftime-strptime-behavior` " +"و :meth:`datetime.isoformat` را ببینید." -msgid "Same as :meth:`.datetime.strftime`. This makes it possible to specify a format string for a :class:`.datetime` object in :ref:`formatted string literals ` and when using :meth:`str.format`. See also :ref:`strftime-strptime-behavior` and :meth:`datetime.isoformat`." +msgid "" +"Same as :meth:`.datetime.strftime`. This makes it possible to specify a " +"format string for a :class:`.datetime` object in :ref:`formatted string " +"literals ` and when using :meth:`str.format`. See " +"also :ref:`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" +"مشابه :meth:`.datetime.strftime`. این امکان را فراهم می‌کند که یک رشته قالب " +"را برای یک شیء :class:`.datetime` در :ref:`رشته‌های قالب‌بندی‌شده ` " +"و هنگام استفاده از :meth:`str.format` مشخص کنید. همچنین " +"ببینید :ref:`strftime-strptime-behavior` و :meth:`datetime.isoformat`." msgid "Examples of usage: :class:`!datetime`" -msgstr "" +msgstr "نمونه‌های استفاده: :class:`!datetime`" msgid "Examples of working with :class:`.datetime` objects:" -msgstr "" +msgstr "نمونه‌هایی از کار با اشیای :class:`.datetime`:" msgid "" ">>> import datetime as dt\n" @@ -1399,10 +2718,12 @@ msgid "" ">>> dt.datetime.now()\n" "datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" ">>> dt.datetime.now(dt.timezone.utc)\n" -"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone.utc)\n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, " +"tzinfo=datetime.timezone.utc)\n" "\n" ">>> # Using datetime.strptime()\n" -">>> my_datetime = dt.datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n" +">>> my_datetime = dt.datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:" +"%M\")\n" ">>> my_datetime\n" "datetime.datetime(2006, 11, 21, 16, 30)\n" "\n" @@ -1433,12 +2754,70 @@ msgid "" ">>> # Formatting a datetime\n" ">>> my_datetime.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" "'Tuesday, 21. November 2006 04:30PM'\n" -">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(my_datetime, \"day\", \"month\", \"time\")\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:" +"%M%p}.'.format(my_datetime, \"day\", \"month\", \"time\")\n" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" +">>> import datetime as dt\n" +"\n" +">>> # Using datetime.combine()\n" +">>> d = dt.date(2005, 7, 14)\n" +">>> t = dt.time(12, 30)\n" +">>> dt.datetime.combine(d, t)\n" +"datetime.datetime(2005, 7, 14, 12, 30)\n" +"\n" +">>> # Using datetime.now()\n" +">>> dt.datetime.now()\n" +"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" +">>> dt.datetime.now(dt.timezone.utc)\n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, " +"tzinfo=datetime.timezone.utc)\n" +"\n" +">>> # Using datetime.strptime()\n" +">>> my_datetime = dt.datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:" +"%M\")\n" +">>> my_datetime\n" +"datetime.datetime(2006, 11, 21, 16, 30)\n" +"\n" +">>> # Using datetime.timetuple() to get tuple of all attributes\n" +">>> tt = my_datetime.timetuple()\n" +">>> for it in tt:\n" +"... print(it)\n" +"...\n" +"2006 # year\n" +"11 # month\n" +"21 # day\n" +"16 # hour\n" +"30 # minute\n" +"0 # second\n" +"1 # weekday (0 = Monday)\n" +"325 # number of days since 1st January\n" +"-1 # dst - method tzinfo.dst() returned None\n" +"\n" +">>> # Date in ISO format\n" +">>> ic = my_datetime.isocalendar()\n" +">>> for it in ic:\n" +"... print(it)\n" +"...\n" +"2006 # ISO year\n" +"47 # ISO week\n" +"2 # ISO weekday\n" +"\n" +">>> # Formatting a datetime\n" +">>> my_datetime.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" +"'Tuesday, 21. November 2006 04:30PM'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:" +"%M%p}.'.format(my_datetime, \"day\", \"month\", \"time\")\n" +"'The day is 21, the month is November, the time is 04:30PM.'" -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::" +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 "" +"مثال زیر یک زیرکلاس از :class:`tzinfo` تعریف می‌کند که اطلاعات منطقه زمانی " +"کابل، افغانستان را ثبت می‌کند؛ منطقه‌ای که تا سال ۱۹۴۵ از +4 UTC استفاده " +"می‌کرد و پس از آن +4:30 UTC را به‌کار برد::" msgid "" "import datetime as dt\n" @@ -1450,7 +2829,8 @@ msgid "" " def utcoffset(self, when):\n" " if when.year < 1945:\n" " return dt.timedelta(hours=4)\n" -" elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, 30):\n" +" elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, " +"30):\n" " # An ambiguous (\"imaginary\") half-hour range representing\n" " # a 'fold' in time due to the shift from +4 to +4:30.\n" " # If when falls in the imaginary range, use fold to decide how\n" @@ -1484,9 +2864,52 @@ msgid "" " return \"+04:30\"\n" " return \"+04\"" msgstr "" +"import datetime as dt\n" +"\n" +"class KabulTz(dt.tzinfo):\n" +" # Kabul used +4 until 1945, when they moved to +4:30\n" +" UTC_MOVE_DATE = dt.datetime(1944, 12, 31, 20, tzinfo=dt.timezone.utc)\n" +"\n" +" def utcoffset(self, when):\n" +" if when.year < 1945:\n" +" return dt.timedelta(hours=4)\n" +" elif (1945, 1, 1, 0, 0) <= when.timetuple()[:5] < (1945, 1, 1, 0, " +"30):\n" +" # An ambiguous (\"imaginary\") half-hour range representing\n" +" # a 'fold' in time due to the shift from +4 to +4:30.\n" +" # If when falls in the imaginary range, use fold to decide how\n" +" # to resolve. See PEP 495.\n" +" return dt.timedelta(hours=4, minutes=(30 if when.fold else 0))\n" +" else:\n" +" return dt.timedelta(hours=4, minutes=30)\n" +"\n" +" def fromutc(self, when):\n" +" # Follow same validations as in datetime.tzinfo\n" +" if not isinstance(when, dt.datetime):\n" +" raise TypeError(\"fromutc() requires a datetime argument\")\n" +" if when.tzinfo is not self:\n" +" raise ValueError(\"when.tzinfo is not self\")\n" +"\n" +" # A custom implementation is required for fromutc as\n" +" # the input to this function is a datetime with utc values\n" +" # but with a tzinfo set to self.\n" +" # See datetime.astimezone or fromtimestamp.\n" +" if when.replace(tzinfo=dt.timezone.utc) >= self.UTC_MOVE_DATE:\n" +" return when + dt.timedelta(hours=4, minutes=30)\n" +" else:\n" +" return when + dt.timedelta(hours=4)\n" +"\n" +" def dst(self, when):\n" +" # Kabul does not observe daylight saving time.\n" +" return dt.timedelta(0)\n" +"\n" +" def tzname(self, when):\n" +" if when >= self.UTC_MOVE_DATE:\n" +" return \"+04:30\"\n" +" return \"+04\"" msgid "Usage of ``KabulTz`` from above::" -msgstr "" +msgstr "استفاده از ``KabulTz`` در بالا::" msgid "" ">>> tz1 = KabulTz()\n" @@ -1510,63 +2933,153 @@ msgid "" ">>> dt2 == dt3\n" "True" msgstr "" +">>> tz1 = KabulTz()\n" +"\n" +">>> # Datetime before the change\n" +">>> dt1 = dt.datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" +">>> print(dt1.utcoffset())\n" +"4:00:00\n" +"\n" +">>> # Datetime after the change\n" +">>> dt2 = dt.datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" +">>> print(dt2.utcoffset())\n" +"4:30:00\n" +"\n" +">>> # Convert datetime to another time zone\n" +">>> dt3 = dt2.astimezone(dt.timezone.utc)\n" +">>> dt3\n" +"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" +">>> dt2\n" +"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" +">>> dt2 == dt3\n" +"True" msgid ":class:`!time` objects" -msgstr "" +msgstr "اشیاء :class:`!time`" -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." +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 "" +"یک شیء :class:`.time` نشان‌دهنده‌ی یک زمان روز (محلی) است، مستقل از هر روز " +"خاص، و از طریق یک شیء :class:`tzinfo` قابل تنظیم است." -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:" +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 "" +"تمام آرگومان‌ها اختیاری هستند. *tzinfo* می‌تواند ``None`` یا نمونه‌ای از یک " +"زیرکلاس :class:`tzinfo` باشد. آرگومان‌های باقی‌مانده باید اعداد صحیحی در " +"بازه‌های زیر باشند:" -msgid "If an argument outside those ranges is given, :exc:`ValueError` is raised. All default to 0 except *tzinfo*, which defaults to ``None``." +msgid "" +"If an argument outside those ranges is given, :exc:`ValueError` is raised. " +"All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" +"اگر آرگومانی خارج از آن بازه‌ها داده شود، :exc:`ValueError` پرتاب می‌شود. " +"مقدار پیش‌فرض همه ۰ است، به جز *tzinfo* که مقدار پیش‌فرض آن ``None`` است." msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." -msgstr "" +msgstr "زودترین :class:`.time` قابل‌نمایش، ``time(0, 0, 0, 0)``." msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" +"آخرین زمان قابل‌نمایش برای کلاس :class:`.time`، ``time(23, 59, 59, 999999)``." -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." +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 "" +"کمترین تفاوت ممکن بین اشیای :class:`.time` نابرابر، " +"``timedelta(microseconds=1)``، هرچند توجه داشته باشید که عملیات حسابی روی " +"اشیای :class:`.time` پشتیبانی نمی‌شود." -msgid "The object passed as the tzinfo argument to the :class:`.time` constructor, or ``None`` if none was passed." +msgid "" +"The object passed as the tzinfo argument to the :class:`.time` constructor, " +"or ``None`` if none was passed." msgstr "" +"شیء‌ای که به‌عنوان آرگومان tzinfo به سازنده‌ی :class:`.time` داده می‌شود، یا " +"``None`` اگر هیچ موردی داده نشده باشد." -msgid ":class:`.time` objects support equality and order comparisons, where ``a`` is considered less than ``b`` when ``a`` precedes ``b`` in time." +msgid "" +":class:`.time` objects support equality and order comparisons, where ``a`` " +"is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" +"اشیای :class:`.time` از مقایسه‌های برابری و ترتیبی پشتیبانی می‌کنند، به‌طوری‌که " +"``a`` کمتر از ``b`` در نظر گرفته می‌شود هنگامی که ``a`` از نظر زمانی پیش از " +"``b`` باشد." -msgid "Naive and aware :class:`!time` objects are never equal. Order comparison between naive and aware :class:`!time` objects raises :exc:`TypeError`." +msgid "" +"Naive and aware :class:`!time` objects are never equal. Order comparison " +"between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" +"شیءهای :class:`!time` ساده و آگاه هرگز برابر نیستند. مقایسه‌ی ترتیبی بین " +"شیءهای :class:`!time` ساده و آگاه منجر به پرتاب :exc:`TypeError` می‌شود." -msgid "If both comparands are aware, and have the same :attr:`~.time.tzinfo` attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and the base times are compared. If both comparands are aware and have different :attr:`!tzinfo` attributes, the comparands are first adjusted by subtracting their UTC offsets (obtained from ``self.utcoffset()``)." -msgstr "" +msgid "" +"If both comparands are aware, and have the same :attr:`~.time.tzinfo` " +"attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " +"the base times are compared. If both comparands are aware and have " +"different :attr:`!tzinfo` attributes, the comparands are first adjusted by " +"subtracting their UTC offsets (obtained from ``self.utcoffset()``)." +msgstr "" +"اگر هر دو طرف مقایسه آگاه باشند و ویژگی :attr:`~.time.tzinfo` یکسانی داشته " +"باشند، از ویژگی‌های :attr:`!tzinfo` و :attr:`!fold` چشم‌پوشی می‌شود و زمان‌های " +"پایه مقایسه می‌شوند. اگر هر دو طرف مقایسه آگاه باشند و ویژگی‌های :attr:`!" +"tzinfo` متفاوتی داشته باشند، ابتدا طرفین مقایسه با کم کردن آفست‌های UTC خود " +"(که از ``self.utcoffset()`` به دست می‌آیند) تنظیم می‌شوند." -msgid "Equality comparisons between aware and naive :class:`.time` instances don't raise :exc:`TypeError`." +msgid "" +"Equality comparisons between aware and naive :class:`.time` instances don't " +"raise :exc:`TypeError`." msgstr "" +"مقایسه‌های برابری بین نمونه‌های آگاه (aware) و ساده (naive) " +"از :class:`.time`، باعث پرتاب :exc:`TypeError` نمی‌شوند." -msgid "In Boolean contexts, a :class:`.time` object is always considered to be true." +msgid "" +"In Boolean contexts, a :class:`.time` object is always considered to be " +"true." msgstr "" +"در زمینه‌های بولی، یک شیء :class:`.time` همیشه درست در نظر گرفته می‌شود." -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-prone and has been removed in Python 3.5. See :issue:`13936` for more information." +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-" +"prone and has been removed in Python 3.5. See :issue:`13936` for more " +"information." msgstr "" +"پیش از پایتون 3.5، یک شیء :class:`.time` اگر نشان‌دهنده‌ی نیمه‌شب به وقت UTC " +"بود، نادرست در نظر گرفته می‌شد. این رفتار مبهم و خطاخیز تلقی می‌شد و در " +"پایتون 3.5 حذف شده است. برای اطلاعات بیشتر :issue:`13936` را ببینید." msgid "Other constructors:" -msgstr "" +msgstr "سازنده‌های دیگر:" -msgid "Return a :class:`.time` corresponding to a *time_string* in any valid ISO 8601 format, with the following exceptions:" +msgid "" +"Return a :class:`.time` corresponding to a *time_string* in any valid ISO " +"8601 format, with the following exceptions:" msgstr "" +"یک :class:`.time` متناظر با *time_string* در هر قالب معتبر ISO 8601 را " +"برمی‌گرداند، با استثناهای زیر:" -msgid "The leading ``T``, normally required in cases where there may be ambiguity between a date and a time, is not required." +msgid "" +"The leading ``T``, normally required in cases where there may be ambiguity " +"between a date and a time, is not required." msgstr "" +"``T`` آغازین، که معمولاً در مواردی که ممکن است بین تاریخ و زمان ابهام وجود " +"داشته باشد لازم است، لازم نیست." -msgid "Fractional seconds may have any number of digits (anything beyond 6 will be truncated)." +msgid "" +"Fractional seconds may have any number of digits (anything beyond 6 will be " +"truncated)." msgstr "" +"ثانیه‌های کسری می‌توانند هر تعداد رقم داشته باشند (ارقام بیش از ۶ حذف خواهند " +"شد)." msgid "Examples:" -msgstr "" +msgstr "مثال‌ها:" msgid "" ">>> import datetime as dt\n" @@ -1581,55 +3094,115 @@ msgid "" ">>> dt.time.fromisoformat('04:23:01,000384')\n" "datetime.time(4, 23, 1, 384)\n" ">>> dt.time.fromisoformat('04:23:01+04:00')\n" -"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))\n" +"datetime.time(4, 23, 1, " +"tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))\n" ">>> dt.time.fromisoformat('04:23:01Z')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" ">>> dt.time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" msgstr "" +">>> import datetime as dt\n" +">>> dt.time.fromisoformat('04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('T04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('T042301')\n" +"datetime.time(4, 23, 1)\n" +">>> dt.time.fromisoformat('04:23:01.000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> dt.time.fromisoformat('04:23:01,000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> dt.time.fromisoformat('04:23:01+04:00')\n" +"datetime.time(4, 23, 1, " +"tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))\n" +">>> dt.time.fromisoformat('04:23:01Z')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" +">>> dt.time.fromisoformat('04:23:01+00:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -msgid "Previously, this method only supported formats that could be emitted by :meth:`time.isoformat`." +msgid "" +"Previously, this method only supported formats that could be emitted " +"by :meth:`time.isoformat`." msgstr "" +"پیش‌تر، این متد فقط از قالب‌هایی پشتیبانی می‌کرد که :meth:`time.isoformat` " +"می‌توانست آن‌ها را تولید کند." -msgid "Return a :class:`.time` corresponding to *date_string*, parsed according to *format*." +msgid "" +"Return a :class:`.time` corresponding to *date_string*, parsed according to " +"*format*." msgstr "" +"یک :class:`.time` متناظر با *date_string*، تجزیه‌شده بر اساس *format*، " +"برمی‌گرداند." -msgid "If *format* does not contain microseconds or timezone information, this is equivalent to::" +msgid "" +"If *format* does not contain microseconds or timezone information, this is " +"equivalent to::" msgstr "" +"اگر *format* شامل میکروثانیه یا اطلاعات منطقه زمانی نباشد، این معادل است " +"با::" msgid "time(*(time.strptime(date_string, format)[3:6]))" -msgstr "" +msgstr "time(*(time.strptime(date_string, format)[3:6]))" -msgid ":exc:`ValueError` is raised if the *date_string* and *format* cannot be parsed by :func:`time.strptime` or if it returns a value which is not a time tuple. See also :ref:`strftime-strptime-behavior` and :meth:`time.fromisoformat`." +msgid "" +":exc:`ValueError` is raised if the *date_string* and *format* cannot be " +"parsed by :func:`time.strptime` or if it returns a value which is not a " +"time tuple. See also :ref:`strftime-strptime-behavior` " +"and :meth:`time.fromisoformat`." msgstr "" +":exc:`ValueError` زمانی پرتاب می‌شود که *date_string* و *format* " +"توسط :func:`time.strptime` قابل تجزیه نباشند، یا اگر این تابع مقداری " +"برگرداند که تاپل زمانی (time tuple) نباشد. همچنین :ref:`strftime-strptime-" +"behavior` و :meth:`time.fromisoformat` را ببینید." -msgid "Return a new :class:`.time` with the same values, but with specified parameters updated. Note that ``tzinfo=None`` can be specified to create a naive :class:`!time` from an aware :class:`!time`, without conversion of the time data." +msgid "" +"Return a new :class:`.time` with the same values, but with specified " +"parameters updated. Note that ``tzinfo=None`` can be specified to create a " +"naive :class:`!time` from an aware :class:`!time`, without conversion of " +"the time data." msgstr "" +"یک :class:`.time` جدید با همان مقدارها برمی‌گرداند، اما پارامترهای مشخص‌شده " +"در آن به‌روزرسانی شده‌اند. توجه داشته باشید که می‌توان ``tzinfo=None`` را برای " +"ایجاد یک :class:`!time` ساده (naive) از یک :class:`!time` آگاه (aware)، " +"بدون تبدیل داده‌های زمان مشخص کرد." -msgid ":class:`.time` objects are also supported by generic function :func:`copy.replace`." +msgid "" +":class:`.time` objects are also supported by generic " +"function :func:`copy.replace`." msgstr "" +"تابع عام :func:`copy.replace` نیز از اشیای :class:`.time` پشتیبانی می‌کند." msgid "Return a string representing the time in ISO 8601 format, one of:" -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که زمان را در قالب ISO 8601 نشان می‌دهد، یکی از:" msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" -msgstr "" +msgstr "``HH:MM:SS.ffffff``، اگر :attr:`microsecond` برابر ۰ نباشد" msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" -msgstr "" +msgstr "``HH:MM:SS``، اگر :attr:`microsecond` برابر ۰ باشد" -msgid "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``" +msgid "" +"``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " +"return ``None``" msgstr "" +"``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``، اگر :meth:`utcoffset` ``None`` را " +"برنگرداند" -msgid "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``" +msgid "" +"``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 " +"and :meth:`utcoffset` does not return ``None``" msgstr "" +"``HH:MM:SS+HH:MM[:SS[.ffffff]]``، اگر :attr:`microsecond` برابر با ۰ باشد " +"و :meth:`utcoffset` مقدار ``None`` را برنگرداند" msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" +":exc:`ValueError` در صورت نامعتبر بودن آرگومان *timespec* پرتاب می‌شود." msgid "" ">>> import datetime as dt\n" -">>> dt.time(hour=12, minute=34, second=56, microsecond=123456).isoformat(timespec='minutes')\n" +">>> dt.time(hour=12, minute=34, second=56, " +"microsecond=123456).isoformat(timespec='minutes')\n" "'12:34'\n" ">>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0)\n" ">>> my_time.isoformat(timespec='microseconds')\n" @@ -1637,30 +3210,75 @@ msgid "" ">>> my_time.isoformat(timespec='auto')\n" "'12:34:56'" msgstr "" +">>> import datetime as dt\n" +">>> dt.time(hour=12, minute=34, second=56, " +"microsecond=123456).isoformat(timespec='minutes')\n" +"'12:34'\n" +">>> my_time = dt.time(hour=12, minute=34, second=56, microsecond=0)\n" +">>> my_time.isoformat(timespec='microseconds')\n" +"'12:34:56.000000'\n" +">>> my_time.isoformat(timespec='auto')\n" +"'12:34:56'" msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." -msgstr "" +msgstr "برای یک زمان ``t``، ``str(t)`` معادل ``t.isoformat()`` است." -msgid "Return a string representing the time, controlled by an explicit format string. See also :ref:`strftime-strptime-behavior` and :meth:`time.isoformat`." +msgid "" +"Return a string representing the time, controlled by an explicit format " +"string. See also :ref:`strftime-strptime-behavior` " +"and :meth:`time.isoformat`." msgstr "" +"رشته‌ای را برمی‌گرداند که بازنمایی‌کننده‌ی زمان است و با یک رشته‌ی قالب صریح کنترل " +"می‌شود. همچنین :ref:`strftime-strptime-behavior` و :meth:`time.isoformat` را " +"ببینید." -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 ` and when using :meth:`str.format`. See also :ref:`strftime-strptime-behavior` and :meth:`time.isoformat`." +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 ` and when using :meth:`str.format`. See also :ref:`strftime-" +"strptime-behavior` and :meth:`time.isoformat`." msgstr "" +"مشابه :meth:`.time.strftime`. این امکان را به شما می‌دهد که یک رشته قالب‌بندی " +"را برای یک شیء :class:`.time` در :ref:`رشته‌های قالب‌بندی‌شده ` و " +"هنگام استفاده از :meth:`str.format` مشخص کنید. همچنین ببینید :ref:`strftime-" +"strptime-behavior` و :meth:`time.isoformat`." -msgid "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo.utcoffset(None)``, and raises an exception if the latter doesn't return ``None`` or a :class:`timedelta` object with magnitude less than one day." +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " +"``self.tzinfo.utcoffset(None)``, and raises an exception if the latter " +"doesn't return ``None`` or a :class:`timedelta` object with magnitude less " +"than one day." msgstr "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را برمی‌گرداند، در غیر این " +"صورت ``self.tzinfo.utcoffset(None)`` را برمی‌گرداند، و اگر مورد اخیر " +"``None`` یا یک شیء :class:`timedelta` با اندازه‌ای کمتر از یک روز را " +"برنگرداند، استثنایی پرتاب می‌کند." -msgid "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo.dst(None)``, and raises an exception if the latter doesn't return ``None``, or a :class:`timedelta` object with magnitude less than one day." +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " +"``self.tzinfo.dst(None)``, and raises an exception if the latter doesn't " +"return ``None``, or a :class:`timedelta` object with magnitude less than " +"one day." msgstr "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را برمی‌گرداند، در غیر این " +"صورت ``self.tzinfo.dst(None)`` را برمی‌گرداند، و اگر دومی ``None`` یا یک " +"شیء :class:`timedelta` با اندازه‌ای کمتر از یک روز را برنگرداند، استثنایی را " +"پرتاب می‌کند." -msgid "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo.tzname(None)``, or raises an exception if the latter doesn't return ``None`` or a string object." +msgid "" +"If :attr:`.tzinfo` is ``None``, returns ``None``, else returns " +"``self.tzinfo.tzname(None)``, or raises an exception if the latter doesn't " +"return ``None`` or a string object." msgstr "" +"اگر :attr:`.tzinfo` برابر ``None`` باشد، ``None`` را برمی‌گرداند، در غیر این " +"صورت ``self.tzinfo.tzname(None)`` را برمی‌گرداند، یا اگر دومی ``None`` یا یک " +"شیء رشته را برنگرداند، استثنایی را پرتاب می‌کند." msgid "Examples of usage: :class:`!time`" -msgstr "" +msgstr "نمونه‌های کاربرد: :class:`!time`" msgid "Examples of working with a :class:`.time` object::" -msgstr "" +msgstr "نمونه‌هایی از کار با یک شیء :class:`.time`::" msgid "" ">>> import datetime as dt\n" @@ -1688,59 +3306,209 @@ msgid "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" msgstr "" +">>> import datetime as dt\n" +">>> class TZ1(dt.tzinfo):\n" +"... def utcoffset(self, when):\n" +"... return dt.timedelta(hours=1)\n" +"... def dst(self, when):\n" +"... return dt.timedelta(0)\n" +"... def tzname(self, when):\n" +"... return \"+01:00\"\n" +"... def __repr__(self):\n" +"... return f\"{self.__class__.__name__}()\"\n" +"...\n" +">>> t = dt.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t\n" +"datetime.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t.isoformat()\n" +"'12:10:30+01:00'\n" +">>> t.dst()\n" +"datetime.timedelta(0)\n" +">>> t.tzname()\n" +"'+01:00'\n" +">>> t.strftime(\"%H:%M:%S %Z\")\n" +"'12:10:30 +01:00'\n" +">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" +"'The time is 12:10.'" msgid ":class:`!tzinfo` objects" -msgstr "" +msgstr "اشیاء :class:`!tzinfo`" -msgid "This is an :term:`abstract base class`, meaning that this class should not be instantiated directly. Define a subclass of :class:`tzinfo` to capture information about a particular time zone." +msgid "" +"This is an :term:`abstract base class`, meaning that this class should not " +"be instantiated directly. Define a subclass of :class:`tzinfo` to capture " +"information about a particular time zone." msgstr "" +"این یک :term:`کلاس پایه انتزاعی ` است، به این معنا که " +"این کلاس نباید مستقیماً نمونه‌سازی شود. برای ثبت اطلاعات درباره‌ی یک منطقه " +"زمانی خاص، یک زیرکلاس از :class:`tzinfo` تعریف کنید." -msgid "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the constructors for :class:`.datetime` and :class:`.time` objects. The latter objects view their attributes as being in local time, and the :class:`!tzinfo` object supports methods revealing offset of local time from UTC, the name of the time zone, and DST offset, all relative to a date or time object passed to them." -msgstr "" +msgid "" +"An instance of (a concrete subclass of) :class:`tzinfo` can be passed to " +"the constructors for :class:`.datetime` and :class:`.time` objects. The " +"latter objects view their attributes as being in local time, and " +"the :class:`!tzinfo` object supports methods revealing offset of local time " +"from UTC, the name of the time zone, and DST offset, all relative to a date " +"or time object passed to them." +msgstr "" +"می‌توان یک نمونه از (یک زیرکلاس ملموس از) :class:`tzinfo` را به سازنده‌های " +"اشیاء :class:`.datetime` و :class:`.time` پاس داد. این اشیاء ویژگی‌های خود " +"را به‌صورت زمان محلی در نظر می‌گیرند و شیء :class:`!tzinfo` از متدهایی " +"پشتیبانی می‌کند که اختلاف زمان محلی از UTC، نام منطقه‌ی زمانی و اختلاف DST " +"را، همگی نسبت به یک شیء date یا time که به آن‌ها پاس داده شده است، آشکار " +"می‌کنند." -msgid "You need to derive a concrete subclass, and (at least) supply implementations of the standard :class:`tzinfo` methods needed by the :class:`.datetime` methods you use. The :mod:`!datetime` module provides :class:`timezone`, a simple concrete subclass of :class:`!tzinfo` which can represent time zones with fixed offset from UTC such as UTC itself or North American EST and EDT." -msgstr "" +msgid "" +"You need to derive a concrete subclass, and (at least) supply " +"implementations of the standard :class:`tzinfo` methods needed by " +"the :class:`.datetime` methods you use. The :mod:`!datetime` module " +"provides :class:`timezone`, a simple concrete subclass of :class:`!tzinfo` " +"which can represent time zones with fixed offset from UTC such as UTC " +"itself or North American EST and EDT." +msgstr "" +"شما باید یک زیرکلاس عینی مشتق کنید و (حداقل) پیاده‌سازی متدهای " +"استاندارد :class:`tzinfo` مورد نیاز متدهای :class:`.datetime` مورد استفاده " +"شما را فراهم کنید. ماژول :mod:`!datetime` :class:`timezone` را فراهم می‌کند؛ " +"یک زیرکلاس عینی ساده از :class:`!tzinfo` که می‌تواند مناطق زمانی با اختلاف " +"ثابت از UTC، مانند خود UTC یا EST و EDT آمریکای شمالی را نمایش دهد." -msgid "Special requirement for pickling: A :class:`tzinfo` subclass must have an :meth:`~object.__init__` method that can be called with no arguments, otherwise it can be pickled but possibly not unpickled again. This is a technical requirement that may be relaxed in the future." +msgid "" +"Special requirement for pickling: A :class:`tzinfo` subclass must have " +"an :meth:`~object.__init__` method that can be called with no arguments, " +"otherwise it can be pickled but possibly not unpickled again. This is a " +"technical requirement that may be relaxed in the future." msgstr "" +"الزام ویژه برای پیکل‌کردن (pickling): یک زیرکلاس از :class:`tzinfo` باید یک " +"متد :meth:`~object.__init__` داشته باشد که بتوان آن را بدون آرگومان " +"فراخوانی کرد، در غیر این صورت می‌توان آن را پیکل کرد، اما ممکن است دیگر " +"نتوان آن را از حالت پیکل خارج کرد. این یک الزام فنی است که ممکن است در " +"آینده تعدیل شود." -msgid "A concrete subclass of :class:`tzinfo` may need to implement the following methods. Exactly which methods are needed depends on the uses made of aware :mod:`!datetime` objects. If in doubt, simply implement all of them." +msgid "" +"A concrete subclass of :class:`tzinfo` may need to implement the following " +"methods. Exactly which methods are needed depends on the uses made of " +"aware :mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" +"یک زیرکلاس عینی از :class:`tzinfo` ممکن است نیاز داشته باشد متدهای زیر را " +"پیاده‌سازی کند. اینکه دقیقاً کدام متدها مورد نیاز هستند، به نحوه‌ی استفاده از " +"اشیای آگاه :mod:`!datetime` بستگی دارد. در صورت تردید، کافی است همه‌ی آن‌ها را " +"پیاده‌سازی کنید." -msgid "Return offset of local time from UTC, as a :class:`timedelta` object that is positive east of UTC. If local time is west of UTC, this should be negative." +msgid "" +"Return offset of local time from UTC, as a :class:`timedelta` object that " +"is positive east of UTC. If local time is west of UTC, this should be " +"negative." msgstr "" +"انحراف زمان محلی از UTC را به‌صورت یک شیء :class:`timedelta` برمی‌گرداند که " +"برای شرق UTC مثبت است. اگر زمان محلی در غرب UTC باشد، این مقدار باید منفی " +"باشد." -msgid "This represents the *total* offset from UTC; for example, if a :class:`tzinfo` object represents both time zone and DST adjustments, :meth:`utcoffset` should return their sum. If the UTC offset isn't known, return ``None``. Else the value returned must be a :class:`timedelta` object strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)`` (the magnitude of the offset must be less than one day). Most implementations of :meth:`utcoffset` will probably look like one of these two::" -msgstr "" +msgid "" +"This represents the *total* offset from UTC; for example, if " +"a :class:`tzinfo` object represents both time zone and DST " +"adjustments, :meth:`utcoffset` should return their sum. If the UTC offset " +"isn't known, return ``None``. Else the value returned must be " +"a :class:`timedelta` object strictly between ``-timedelta(hours=24)`` and " +"``timedelta(hours=24)`` (the magnitude of the offset must be less than one " +"day). Most implementations of :meth:`utcoffset` will probably look like one " +"of these two::" +msgstr "" +"این نشان‌دهنده‌ی *کل* فاصله از UTC است؛ برای مثال، اگر یک شیء :class:`tzinfo` " +"هم تنظیمات منطقه‌ی زمانی و هم تنظیمات ساعت تابستانی (DST) را نشان " +"دهد، :meth:`utcoffset` باید مجموع آن‌ها را برگرداند. اگر فاصله از UTC مشخص " +"نیست، ``None`` را برگردانید. در غیر این صورت، مقدار برگردانده‌شده باید یک " +"شیء :class:`timedelta` باشد که اکیداً بین ``-timedelta(hours=24)`` و " +"``timedelta(hours=24)`` قرار دارد (اندازه‌ی فاصله باید کمتر از ۱ روز باشد). " +"بیشتر پیاده‌سازی‌های :meth:`utcoffset` احتمالاً شبیه یکی از این دو خواهند بود::" msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" +"return CONSTANT # fixed-offset class\n" +"return CONSTANT + self.dst(dt) # daylight-aware class" -msgid "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return ``None`` either." +msgid "" +"If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not " +"return ``None`` either." msgstr "" +"اگر :meth:`utcoffset` ``None`` را برنگرداند، :meth:`dst` نیز نباید ``None`` " +"را برگرداند." -msgid "The default implementation of :meth:`utcoffset` raises :exc:`NotImplementedError`." +msgid "" +"The default implementation of :meth:`utcoffset` " +"raises :exc:`NotImplementedError`." msgstr "" +"پیاده‌سازی پیش‌فرض :meth:`utcoffset`، استثنای :exc:`NotImplementedError` را " +"پرتاب می‌کند." -msgid "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` object or ``None`` if DST information isn't known." +msgid "" +"Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " +"object or ``None`` if DST information isn't known." msgstr "" +"مقدار تنظیم ساعت تابستانی (DST) را به‌صورت یک شیء :class:`timedelta` یا " +"``None`` برمی‌گرداند، اگر اطلاعات DST شناخته‌نشده باشد." -msgid "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return the offset as a :class:`timedelta` object (see :meth:`utcoffset` for details). Note that DST offset, if applicable, has already been added to the UTC offset returned by :meth:`utcoffset`, so there's no need to consult :meth:`dst` unless you're interested in obtaining DST info separately. For example, :meth:`datetime.timetuple` calls its :attr:`~.datetime.tzinfo` attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time.tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes when crossing time zones." -msgstr "" +msgid "" +"Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, " +"return the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " +"details). Note that DST offset, if applicable, has already been added to " +"the UTC offset returned by :meth:`utcoffset`, so there's no need to " +"consult :meth:`dst` unless you're interested in obtaining DST info " +"separately. For example, :meth:`datetime.timetuple` calls " +"its :attr:`~.datetime.tzinfo` attribute's :meth:`dst` method to determine " +"how the :attr:`~time.struct_time.tm_isdst` flag should be set, " +"and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for DST changes " +"when crossing time zones." +msgstr "" +"اگر ساعت تابستانی فعال نباشد، ``timedelta(0)`` را برمی‌گرداند. اگر ساعت " +"تابستانی فعال باشد، آفست را به‌صورت یک شیء :class:`timedelta` برمی‌گرداند " +"(برای جزئیات :meth:`utcoffset` را ببینید). توجه داشته باشید که آفست ساعت " +"تابستانی، در صورت اقتضا، از قبل به آفست UTC که :meth:`utcoffset` برمی‌گرداند " +"افزوده شده است، بنابراین نیازی به مراجعه به :meth:`dst` نیست، مگر اینکه به " +"کسب اطلاعات ساعت تابستانی به‌طور جداگانه علاقه‌مند باشید. برای " +"مثال، :meth:`datetime.timetuple` متد :meth:`dst` مربوط به " +"ویژگی :attr:`~.datetime.tzinfo` خود را فراخوانی می‌کند تا تعیین کند " +"پرچم :attr:`~time.struct_time.tm_isdst` چگونه باید تنظیم شود، " +"و :meth:`tzinfo.fromutc` متد :meth:`dst` را فراخوانی می‌کند تا تغییرات ساعت " +"تابستانی را هنگام گذر از منطقه‌های زمانی در نظر بگیرد." -msgid "An instance *tz* of a :class:`tzinfo` subclass that models both standard and daylight times must be consistent in this sense:" +msgid "" +"An instance *tz* of a :class:`tzinfo` subclass that models both standard " +"and daylight times must be consistent in this sense:" msgstr "" +"یک نمونه *tz* از یک زیرکلاس :class:`tzinfo` که هم زمان استاندارد و هم زمان " +"تابستانی را مدل‌سازی می‌کند، باید از این نظر سازگار باشد:" msgid "``tz.utcoffset(dt) - tz.dst(dt)``" -msgstr "" +msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -msgid "must return the same result for every :class:`.datetime` *dt* with ``dt.tzinfo == tz``. For sane :class:`!tzinfo` subclasses, this expression yields the time zone's \"standard offset\", which should not depend on the date or the time, but only on geographic location. The implementation of :meth:`datetime.astimezone` relies on this, but cannot detect violations; it's the programmer's responsibility to ensure it. If a :class:`!tzinfo` subclass cannot guarantee this, it may be able to override the default implementation of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime.astimezone` regardless." -msgstr "" +msgid "" +"must return the same result for every :class:`.datetime` *dt* with " +"``dt.tzinfo == tz``. For sane :class:`!tzinfo` subclasses, this expression " +"yields the time zone's \"standard offset\", which should not depend on the " +"date or the time, but only on geographic location. The implementation " +"of :meth:`datetime.astimezone` relies on this, but cannot detect " +"violations; it's the programmer's responsibility to ensure it. If " +"a :class:`!tzinfo` subclass cannot guarantee this, it may be able to " +"override the default implementation of :meth:`tzinfo.fromutc` to work " +"correctly with :meth:`~.datetime.astimezone` regardless." +msgstr "" +"باید برای هر :class:`.datetime` *dt* با ``dt.tzinfo == tz`` نتیجه‌ی یکسانی " +"برگرداند. برای زیرکلاس‌های معقول :class:`!tzinfo`، این عبارت، «انحراف " +"استاندارد» منطقه زمانی را به دست می‌دهد که نباید به تاریخ یا زمان وابسته " +"باشد، بلکه فقط به موقعیت جغرافیایی وابسته باشد. " +"پیاده‌سازی :meth:`datetime.astimezone` به این موضوع متکی است، اما نمی‌تواند " +"موارد نقض را تشخیص دهد؛ اطمینان از این موضوع بر عهده‌ی برنامه‌نویس است. اگر " +"یک زیرکلاس :class:`!tzinfo` نتواند این موضوع را تضمین کند، ممکن است بتواند " +"پیاده‌سازی پیش‌فرض :meth:`tzinfo.fromutc` را بازنویسی کند تا در هر صورت " +"با :meth:`~.datetime.astimezone` به‌درستی کار کند." -msgid "Most implementations of :meth:`dst` will probably look like one of these two::" +msgid "" +"Most implementations of :meth:`dst` will probably look like one of these " +"two::" msgstr "" +"بیشتر پیاده‌سازی‌های :meth:`dst` احتمالاً به یکی از این دو شکل خواهند بود::" msgid "" "import datetime as dt\n" @@ -1749,9 +3517,14 @@ msgid "" " # a fixed-offset class: doesn't account for DST\n" " return dt.timedelta(0)" msgstr "" +"import datetime as dt\n" +"\n" +"def dst(self, when):\n" +" # a fixed-offset class: doesn't account for DST\n" +" return dt.timedelta(0)" msgid "or::" -msgstr "" +msgstr "یا::" msgid "" "import datetime as dt\n" @@ -1766,36 +3539,149 @@ msgid "" " else:\n" " return dt.timedelta(0)" msgstr "" +"import datetime as dt\n" +"\n" +"def dst(self, when):\n" +" # Code to set dston and dstoff to the time zone's DST\n" +" # transition times based on the input when.year, and expressed\n" +" # in standard local time.\n" +"\n" +" if dston <= when.replace(tzinfo=None) < dstoff:\n" +" return dt.timedelta(hours=1)\n" +" else:\n" +" return dt.timedelta(0)" -msgid "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." +msgid "" +"The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" +"پیاده‌سازی پیش‌فرض :meth:`dst` استثنای :exc:`NotImplementedError` را پرتاب " +"می‌کند." -msgid "Return the time zone name corresponding to the :class:`.datetime` object *dt*, as a string. Nothing about string names is defined by the :mod:`!datetime` module, and there's no requirement that it mean anything in particular. For example, ``\"GMT\"``, ``\"UTC\"``, ``\"-500\"``, ``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, ``\"America/New York\"`` are all valid replies. Return ``None`` if a string name isn't known. Note that this is a method rather than a fixed string primarily because some :class:`tzinfo` subclasses will wish to return different names depending on the specific value of *dt* passed, especially if the :class:`!tzinfo` class is accounting for daylight time." -msgstr "" +msgid "" +"Return the time zone name corresponding to the :class:`.datetime` object " +"*dt*, as a string. Nothing about string names is defined by the :mod:`!" +"datetime` module, and there's no requirement that it mean anything in " +"particular. For example, ``\"GMT\"``, ``\"UTC\"``, ``\"-500\"``, " +"``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, ``\"America/New York\"`` " +"are all valid replies. Return ``None`` if a string name isn't known. Note " +"that this is a method rather than a fixed string primarily because " +"some :class:`tzinfo` subclasses will wish to return different names " +"depending on the specific value of *dt* passed, especially if the :class:`!" +"tzinfo` class is accounting for daylight time." +msgstr "" +"نام منطقه‌ی زمانی متناظر با شیء :class:`.datetime` یعنی *dt* را به‌صورت یک " +"رشته برمی‌گرداند. ماژول :mod:`!datetime` هیچ موردی را درباره‌ی نام‌های رشته‌ای " +"تعریف نکرده است و الزامی ندارد که این نام معنای خاصی داشته باشد. برای مثال، " +"``\"GMT\"``، ``\"UTC\"``، ``\"-500\"``، ``\"-5:00\"``، ``\"EDT\"``، ``\"US/" +"Eastern\"``، ``\"America/New York\"`` همگی پاسخ‌های معتبر هستند. اگر نام " +"رشته‌ای شناخته‌شده نباشد، ``None`` را برمی‌گرداند. توجه داشته باشید که این یک " +"متد است نه یک رشته ثابت، عمدتاً به این دلیل که برخی " +"زیرکلاس‌های :class:`tzinfo` ممکن است بخواهند بسته به مقدار مشخص *dt* " +"داده‌شده، نام‌های متفاوتی برگردانند، به‌ویژه اگر کلاس :class:`!tzinfo` ساعت " +"تابستانی را در نظر بگیرد." -msgid "The default implementation of :meth:`tzname` raises :exc:`NotImplementedError`." +msgid "" +"The default implementation of :meth:`tzname` " +"raises :exc:`NotImplementedError`." msgstr "" +"پیاده‌سازی پیش‌فرض :meth:`tzname`، استثنای :exc:`NotImplementedError` را " +"پرتاب می‌کند." -msgid "These methods are called by a :class:`.datetime` or :class:`.time` object, in response to their methods of the same names. A :class:`!datetime` object passes itself as the argument, and a :class:`!time` object passes ``None`` as the argument. A :class:`tzinfo` subclass's methods should therefore be prepared to accept a *dt* argument of ``None``, or of class :class:`!datetime`." -msgstr "" +msgid "" +"These methods are called by a :class:`.datetime` or :class:`.time` object, " +"in response to their methods of the same names. A :class:`!datetime` object " +"passes itself as the argument, and a :class:`!time` object passes ``None`` " +"as the argument. A :class:`tzinfo` subclass's methods should therefore be " +"prepared to accept a *dt* argument of ``None``, or of class :class:`!" +"datetime`." +msgstr "" +"این متدها توسط یک شیء :class:`.datetime` یا :class:`.time`، در پاسخ به " +"متدهای هم‌نام آن‌ها فراخوانی می‌شوند. یک شیء :class:`!datetime` خود را به‌عنوان " +"آرگومان ارسال می‌کند، و یک شیء :class:`!time` مقدار ``None`` را به‌عنوان " +"آرگومان ارسال می‌کند. بنابراین متدهای یک کلاس فرعی از :class:`tzinfo` باید " +"برای پذیرفتن یک آرگومان *dt* با مقدار ``None`` یا از کلاس :class:`!" +"datetime` آماده باشند." -msgid "When ``None`` is passed, it's up to the class designer to decide the best response. For example, returning ``None`` is appropriate if the class wishes to say that time objects don't participate in the :class:`tzinfo` protocols. It may be more useful for ``utcoffset(None)`` to return the standard UTC offset, as there is no other convention for discovering the standard offset." -msgstr "" +msgid "" +"When ``None`` is passed, it's up to the class designer to decide the best " +"response. For example, returning ``None`` is appropriate if the class " +"wishes to say that time objects don't participate in the :class:`tzinfo` " +"protocols. It may be more useful for ``utcoffset(None)`` to return the " +"standard UTC offset, as there is no other convention for discovering the " +"standard offset." +msgstr "" +"وقتی ``None`` ارسال می‌شود، تصمیم درباره‌ی بهترین پاسخ بر عهده‌ی طراح کلاس " +"است. برای مثال، اگر کلاس بخواهد بگوید که اشیای زمانی در " +"پروتکل‌های :class:`tzinfo` شرکت نمی‌کنند، بازگرداندن ``None`` مناسب است. ممکن " +"است مفیدتر باشد که ``utcoffset(None)`` آفست استاندارد UTC را برگرداند، زیرا " +"قرارداد دیگری برای پیدا کردن آفست استاندارد وجود ندارد." -msgid "When a :class:`.datetime` object is passed in response to a :class:`!datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:`tzinfo` methods can rely on this, unless user code calls :class:`!tzinfo` methods directly. The intent is that the :class:`!tzinfo` methods interpret *dt* as being in local time, and not need worry about objects in other time zones." -msgstr "" +msgid "" +"When a :class:`.datetime` object is passed in response to a :class:`!" +"datetime` method, ``dt.tzinfo`` is the same object as " +"*self*. :class:`tzinfo` methods can rely on this, unless user code " +"calls :class:`!tzinfo` methods directly. The intent is that the :class:`!" +"tzinfo` methods interpret *dt* as being in local time, and not need worry " +"about objects in other time zones." +msgstr "" +"هنگامی که یک شیء :class:`.datetime` در پاسخ به یک متد :class:`!datetime` " +"ارسال می‌شود، ``dt.tzinfo`` همان شیء *self* است. متدهای :class:`tzinfo` " +"می‌توانند به این موضوع اتکا کنند، مگر آنکه کد کاربر متدهای :class:`!tzinfo` " +"را مستقیماً فراخوانی کند. هدف این است که متدهای :class:`!tzinfo`، *dt* را " +"به‌عنوان زمان محلی تفسیر کنند و نیازی به نگرانی درباره اشیاء در مناطق زمانی " +"دیگر نداشته باشند." -msgid "There is one more :class:`tzinfo` method that a subclass may wish to override:" +msgid "" +"There is one more :class:`tzinfo` method that a subclass may wish to " +"override:" msgstr "" +"یک متد دیگر از :class:`tzinfo` وجود دارد که ممکن است یک کلاس فرعی بخواهد آن " +"را بازنویسی کند:" -msgid "This is called from the default :meth:`datetime.astimezone` implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time data are to be viewed as expressing a UTC time. The purpose of :meth:`fromutc` is to adjust the date and time data, returning an equivalent datetime in *self*'s local time." -msgstr "" +msgid "" +"This is called from the default :meth:`datetime.astimezone` implementation. " +"When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " +"data are to be viewed as expressing a UTC time. The purpose " +"of :meth:`fromutc` is to adjust the date and time data, returning an " +"equivalent datetime in *self*'s local time." +msgstr "" +"این متد از پیاده‌سازی پیش‌فرض :meth:`datetime.astimezone` فراخوانی می‌شود. " +"هنگامی که از آن فراخوانی شود، ``dt.tzinfo`` همان *self* است و داده‌های تاریخ " +"و زمان *dt* باید به‌عنوان بیانگر یک زمان UTC در نظر گرفته شوند. هدف " +"از :meth:`fromutc` تنظیم داده‌های تاریخ و زمان و برگرداندن یک datetime معادل " +"در زمان محلی *self* است." -msgid "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:`fromutc` implementation without problems. It's strong enough to handle fixed-offset time zones, and time zones accounting for both standard and daylight time, and the latter even if the DST transition times differ in different years. An example of a time zone the default :meth:`fromutc` implementation may not handle correctly in all cases is one where the standard offset (from UTC) depends on the specific date and time passed, which can happen for political reasons. The default implementations of :meth:`~.datetime.astimezone` and :meth:`fromutc` may not produce the result you want if the result is one of the hours straddling the moment the standard offset changes." -msgstr "" +msgid "" +"Most :class:`tzinfo` subclasses should be able to inherit the " +"default :meth:`fromutc` implementation without problems. It's strong enough " +"to handle fixed-offset time zones, and time zones accounting for both " +"standard and daylight time, and the latter even if the DST transition times " +"differ in different years. An example of a time zone the " +"default :meth:`fromutc` implementation may not handle correctly in all " +"cases is one where the standard offset (from UTC) depends on the specific " +"date and time passed, which can happen for political reasons. The default " +"implementations of :meth:`~.datetime.astimezone` and :meth:`fromutc` may " +"not produce the result you want if the result is one of the hours " +"straddling the moment the standard offset changes." +msgstr "" +"بیشتر زیرکلاس‌های :class:`tzinfo` باید بتوانند پیاده‌سازی " +"پیش‌فرض :meth:`fromutc` را بدون مشکل به ارث ببرند. این پیاده‌سازی به‌اندازه‌ای " +"قوی است که مناطق زمانی با آفست ثابت و مناطق زمانی را که هم زمان استاندارد و " +"هم ساعت تابستانی را در نظر می‌گیرند مدیریت کند، و مورد دوم را حتی اگر " +"زمان‌های گذار ساعت تابستانی در سال‌های مختلف متفاوت باشد نیز مدیریت کند. " +"مثالی از یک منطقه زمانی که پیاده‌سازی پیش‌فرض :meth:`fromutc` ممکن است در " +"تمام حالت‌ها آن را به‌درستی مدیریت نکند، منطقه‌ای است که آفست استاندارد آن (از " +"UTC) به تاریخ و زمان مشخصی که داده می‌شود بستگی دارد؛ اتفاقی که ممکن است به " +"دلایل سیاسی رخ دهد. پیاده‌سازی‌های پیش‌فرض :meth:`~.datetime.astimezone` " +"و :meth:`fromutc` ممکن است نتیجه‌ای را که می‌خواهید تولید نکنند، اگر نتیجه " +"یکی از ساعت‌هایی باشد که لحظه‌ی تغییر آفست استاندارد را در بر می‌گیرد." -msgid "Skipping code for error cases, the default :meth:`fromutc` implementation acts like::" +msgid "" +"Skipping code for error cases, the default :meth:`fromutc` implementation " +"acts like::" msgstr "" +"با صرف‌نظر از کد مربوط به موارد خطا، پیاده‌سازی پیش‌فرض :meth:`fromutc` مانند " +"زیر عمل می‌کند::" msgid "" "import datetime as dt\n" @@ -1815,11 +3701,212 @@ msgid "" " else:\n" " return when" msgstr "" +"import datetime as dt\n" +"\n" +"def fromutc(self, when):\n" +" # raise ValueError error if when.tzinfo is not self\n" +" dtoff = when.utcoffset()\n" +" dtdst = when.dst()\n" +" # raise ValueError if dtoff is None or dtdst is None\n" +" delta = dtoff - dtdst # this is self's standard offset\n" +" if delta:\n" +" when += delta # convert to standard local time\n" +" dtdst = when.dst()\n" +" # raise ValueError if dtdst is None\n" +" if dtdst:\n" +" return when + dtdst\n" +" else:\n" +" return when" + +msgid "" +"In the following :download:`tzinfo_examples.py <../includes/" +"tzinfo_examples.py>` file there are some examples of :class:`tzinfo` " +"classes:" +msgstr "" +"در فایل :download:`tzinfo_examples.py <../includes/tzinfo_examples.py>` " +"زیر، چند نمونه از کلاس‌های :class:`tzinfo` وجود دارد:" -msgid "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples.py>` file there are some examples of :class:`tzinfo` classes:" +msgid "" +"import datetime as dt\n" +"\n" +"# A class capturing the platform's idea of local time.\n" +"# (May result in wrong values on historical times in\n" +"# timezones where UTC offset and/or the DST rules had\n" +"# changed in the past.)\n" +"import time\n" +"\n" +"ZERO = dt.timedelta(0)\n" +"HOUR = dt.timedelta(hours=1)\n" +"SECOND = dt.timedelta(seconds=1)\n" +"\n" +"STDOFFSET = dt.timedelta(seconds=-time.timezone)\n" +"if time.daylight:\n" +" DSTOFFSET = dt.timedelta(seconds=-time.altzone)\n" +"else:\n" +" DSTOFFSET = STDOFFSET\n" +"\n" +"DSTDIFF = DSTOFFSET - STDOFFSET\n" +"\n" +"\n" +"class LocalTimezone(dt.tzinfo):\n" +"\n" +" def fromutc(self, when):\n" +" assert when.tzinfo is self\n" +" stamp = (when - dt.datetime(1970, 1, 1, tzinfo=self)) // SECOND\n" +" args = time.localtime(stamp)[:6]\n" +" dst_diff = DSTDIFF // SECOND\n" +" # Detect fold\n" +" fold = (args == time.localtime(stamp - dst_diff))\n" +" return dt.datetime(*args, microsecond=when.microsecond,\n" +" tzinfo=self, fold=fold)\n" +"\n" +" def utcoffset(self, when):\n" +" if self._isdst(when):\n" +" return DSTOFFSET\n" +" else:\n" +" return STDOFFSET\n" +"\n" +" def dst(self, when):\n" +" if self._isdst(when):\n" +" return DSTDIFF\n" +" else:\n" +" return ZERO\n" +"\n" +" def tzname(self, when):\n" +" return time.tzname[self._isdst(when)]\n" +"\n" +" def _isdst(self, when):\n" +" tt = (when.year, when.month, when.day,\n" +" when.hour, when.minute, when.second,\n" +" when.weekday(), 0, 0)\n" +" stamp = time.mktime(tt)\n" +" tt = time.localtime(stamp)\n" +" return tt.tm_isdst > 0\n" +"\n" +"\n" +"Local = LocalTimezone()\n" +"\n" +"\n" +"# A complete implementation of current DST rules for major US time zones.\n" +"\n" +"def first_sunday_on_or_after(when):\n" +" days_to_go = 6 - when.weekday()\n" +" if days_to_go:\n" +" when += dt.timedelta(days_to_go)\n" +" return when\n" +"\n" +"\n" +"# US DST Rules\n" +"#\n" +"# This is a simplified (i.e., wrong for a few cases) set of rules for US\n" +"# DST start and end times. For a complete and up-to-date set of DST rules\n" +"# and timezone definitions, visit the Olson Database (or try pytz):\n" +"# http://www.twinsun.com/tz/tz-link.htm\n" +"# https://sourceforge.net/projects/pytz/ (might not be up-to-date)\n" +"#\n" +"# In the US, since 2007, DST starts at 2am (standard time) on the second\n" +"# Sunday in March, which is the first Sunday on or after Mar 8.\n" +"DSTSTART_2007 = dt.datetime(1, 3, 8, 2)\n" +"# and ends at 2am (DST time) on the first Sunday of Nov.\n" +"DSTEND_2007 = dt.datetime(1, 11, 1, 2)\n" +"# From 1987 to 2006, DST used to start at 2am (standard time) on the first\n" +"# Sunday in April and to end at 2am (DST time) on the last\n" +"# Sunday of October, which is the first Sunday on or after Oct 25.\n" +"DSTSTART_1987_2006 = dt.datetime(1, 4, 1, 2)\n" +"DSTEND_1987_2006 = dt.datetime(1, 10, 25, 2)\n" +"# From 1967 to 1986, DST used to start at 2am (standard time) on the last\n" +"# Sunday in April (the one on or after April 24) and to end at 2am (DST " +"time)\n" +"# on the last Sunday of October, which is the first Sunday\n" +"# on or after Oct 25.\n" +"DSTSTART_1967_1986 = dt.datetime(1, 4, 24, 2)\n" +"DSTEND_1967_1986 = DSTEND_1987_2006\n" +"\n" +"\n" +"def us_dst_range(year):\n" +" # Find start and end times for US DST. For years before 1967, return\n" +" # start = end for no DST.\n" +" if 2006 < year:\n" +" dststart, dstend = DSTSTART_2007, DSTEND_2007\n" +" elif 1986 < year < 2007:\n" +" dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006\n" +" elif 1966 < year < 1987:\n" +" dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986\n" +" else:\n" +" return (dt.datetime(year, 1, 1), ) * 2\n" +"\n" +" start = first_sunday_on_or_after(dststart.replace(year=year))\n" +" end = first_sunday_on_or_after(dstend.replace(year=year))\n" +" return start, end\n" +"\n" +"\n" +"class USTimeZone(dt.tzinfo):\n" +"\n" +" def __init__(self, hours, reprname, stdname, dstname):\n" +" self.stdoffset = dt.timedelta(hours=hours)\n" +" self.reprname = reprname\n" +" self.stdname = stdname\n" +" self.dstname = dstname\n" +"\n" +" def __repr__(self):\n" +" return self.reprname\n" +"\n" +" def tzname(self, when):\n" +" if self.dst(when):\n" +" return self.dstname\n" +" else:\n" +" return self.stdname\n" +"\n" +" def utcoffset(self, when):\n" +" return self.stdoffset + self.dst(when)\n" +"\n" +" def dst(self, when):\n" +" if when is None or when.tzinfo is None:\n" +" # An exception may be sensible here, in one or both cases.\n" +" # It depends on how you want to treat them. The default\n" +" # fromutc() implementation (called by the default astimezone()\n" +" # implementation) passes a datetime with when.tzinfo is self.\n" +" return ZERO\n" +" assert when.tzinfo is self\n" +" start, end = us_dst_range(when.year)\n" +" # Can't compare naive to aware objects, so strip the timezone from\n" +" # when first.\n" +" when = when.replace(tzinfo=None)\n" +" if start + HOUR <= when < end - HOUR:\n" +" # DST is in effect.\n" +" return HOUR\n" +" if end - HOUR <= when < end:\n" +" # Fold (an ambiguous hour): use when.fold to disambiguate.\n" +" return ZERO if when.fold else HOUR\n" +" if start <= when < start + HOUR:\n" +" # Gap (a non-existent hour): reverse the fold rule.\n" +" return HOUR if when.fold else ZERO\n" +" # DST is off.\n" +" return ZERO\n" +"\n" +" def fromutc(self, when):\n" +" assert when.tzinfo is self\n" +" start, end = us_dst_range(when.year)\n" +" start = start.replace(tzinfo=self)\n" +" end = end.replace(tzinfo=self)\n" +" std_time = when + self.stdoffset\n" +" dst_time = std_time + HOUR\n" +" if end <= dst_time < end + HOUR:\n" +" # Repeated hour\n" +" return std_time.replace(fold=1)\n" +" if std_time < start or dst_time >= end:\n" +" # Standard time\n" +" return std_time\n" +" if start <= std_time < end - HOUR:\n" +" # Daylight saving time\n" +" return dst_time\n" +"\n" +"\n" +"Eastern = USTimeZone(-5, \"Eastern\", \"EST\", \"EDT\")\n" +"Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" +"Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" +"Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" - -msgid "" "import datetime as dt\n" "\n" "# A class capturing the platform's idea of local time.\n" @@ -1908,7 +3995,8 @@ msgid "" "DSTSTART_1987_2006 = dt.datetime(1, 4, 1, 2)\n" "DSTEND_1987_2006 = dt.datetime(1, 10, 25, 2)\n" "# From 1967 to 1986, DST used to start at 2am (standard time) on the last\n" -"# Sunday in April (the one on or after April 24) and to end at 2am (DST time)\n" +"# Sunday in April (the one on or after April 24) and to end at 2am (DST " +"time)\n" "# on the last Sunday of October, which is the first Sunday\n" "# on or after Oct 25.\n" "DSTSTART_1967_1986 = dt.datetime(1, 4, 24, 2)\n" @@ -1998,10 +4086,21 @@ msgid "" "Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" "Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" -msgstr "" -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 transition points. For concreteness, consider US Eastern (UTC -0500), where EDT begins the minute after 1:59 (EST) on the second Sunday in March, and ends the minute after 1:59 (EDT) on the first Sunday in November::" -msgstr "" +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 transition points. For concreteness, consider US Eastern (UTC " +"-0500), where EDT begins the minute after 1:59 (EST) on the second Sunday " +"in March, and ends the minute after 1:59 (EDT) on the first Sunday in " +"November::" +msgstr "" +"توجه داشته باشید که در یک زیرکلاس :class:`tzinfo` که هم زمان استاندارد و هم " +"زمان تابستانی را در نظر می‌گیرد، دو بار در سال، در نقاط تغییر ساعت تابستانی " +"(DST)، ظرافت‌های اجتناب‌ناپذیری وجود دارد. برای وضوح بیشتر، شرق ایالات متحده " +"(UTC -0500) را در نظر بگیرید، که در آن EDT یک دقیقه پس از ۱:۵۹ (EST) در " +"دومین یکشنبه مارس آغاز می‌شود و یک دقیقه پس از ۱:۵۹ (EDT) در نخستین یکشنبه " +"نوامبر پایان می‌یابد::" msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" @@ -2012,9 +4111,26 @@ msgid "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" msgstr "" +" UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" +" EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" +" EDT 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM\n" +"\n" +" شروع 22:MM 23:MM 0:MM 1:MM 3:MM 4:MM\n" +"\n" +"پایان 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -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, so ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` on the day DST begins. For example, at the Spring forward transition of 2016, we get::" -msgstr "" +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, so ``astimezone(Eastern)`` won't deliver a result with ``hour == 2`` " +"on the day DST begins. For example, at the Spring forward transition of " +"2016, we get::" +msgstr "" +"هنگامی که ساعت تابستانی آغاز می‌شود (خط «start»)، ساعت دیواری محلی از ۱:۵۹ " +"به ۳:۰۰ جهش می‌کند. زمان دیواری به شکل 2:MM در آن روز واقعاً معنایی ندارد، " +"بنابراین ``astimezone(Eastern)`` در روزی که ساعت تابستانی آغاز می‌شود، " +"نتیجه‌ای که ``hour == 2`` باشد برنمی‌گرداند. برای مثال، در انتقال به جلو بهار " +"سال ۲۰۱۶، چنین نتیجه‌ای می‌گیریم::" msgid "" ">>> import datetime as dt\n" @@ -2030,9 +4146,44 @@ msgid "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" msgstr "" +">>> import datetime as dt\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = dt.datetime(2016, 3, 13, 5, tzinfo=dt.timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname())\n" +"...\n" +"05:00:00 UTC = 00:00:00 EST\n" +"06:00:00 UTC = 01:00:00 EST\n" +"07:00:00 UTC = 03:00:00 EDT\n" +"08:00:00 UTC = 04:00:00 EDT" -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 last hour of daylight time. In Eastern, that's times of the form 5:MM UTC on the day daylight time ends. The local wall clock leaps from 1:59 (daylight time) back to 1:00 (standard time) again. Local times of the form 1:MM are ambiguous. :meth:`~.datetime.astimezone` mimics the local clock's behavior by mapping two adjacent UTC hours into the same local hour then. In the Eastern example, UTC times of the form 5:MM and 6:MM both map to 1:MM when converted to Eastern, but earlier times have the :attr:`~.datetime.fold` attribute set to 0 and the later times have it set to 1. For example, at the Fall back transition of 2016, we get::" -msgstr "" +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 " +"last hour of daylight time. In Eastern, that's times of the form 5:MM UTC " +"on the day daylight time ends. The local wall clock leaps from 1:59 " +"(daylight time) back to 1:00 (standard time) again. Local times of the form " +"1:MM are ambiguous. :meth:`~.datetime.astimezone` mimics the local clock's " +"behavior by mapping two adjacent UTC hours into the same local hour then. " +"In the Eastern example, UTC times of the form 5:MM and 6:MM both map to " +"1:MM when converted to Eastern, but earlier times have " +"the :attr:`~.datetime.fold` attribute set to 0 and the later times have it " +"set to 1. For example, at the Fall back transition of 2016, we get::" +msgstr "" +"هنگامی که ساعت تابستانی (DST) به پایان می‌رسد (ردیف «end»)، یک مشکل بالقوه " +"جدی‌تر وجود دارد: ساعتی وجود دارد که نمی‌توان آن را در زمان دیواری محلی به‌طور " +"غیرمبهم نوشت: آخرین ساعت از زمان تابستانی. در Eastern، این زمان‌ها در روزی " +"که زمان تابستانی به پایان می‌رسد، به شکل 5:MM UTC هستند. ساعت دیواری محلی از " +"1:59 (زمان تابستانی) دوباره به 1:00 (زمان استاندارد) به عقب برمی‌گردد. " +"زمان‌های محلی به شکل 1:MM مبهم هستند. در این " +"حالت، :meth:`~.datetime.astimezone` رفتار ساعت محلی را با نگاشت دو ساعت UTC " +"متوالی به همان ساعت محلی تقلید می‌کند. در مثال Eastern، زمان‌های UTC به شکل " +"5:MM و 6:MM هر دو هنگام تبدیل به Eastern به 1:MM نگاشت می‌شوند، اما در " +"زمان‌های پیشین، ویژگی :attr:`~.datetime.fold` روی 0 تنظیم شده است و در " +"زمان‌های بعدی روی 1 تنظیم شده است. برای مثال، در گذار عقب‌گرد (Fall back) سال " +"۲۰۱۶، به نتیجه زیر می‌رسیم::" msgid "" ">>> import datetime as dt\n" @@ -2048,114 +4199,232 @@ msgid "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" msgstr "" +">>> import datetime as dt\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = dt.datetime(2016, 11, 6, 4, tzinfo=dt.timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname(), t.fold)\n" +"...\n" +"04:00:00 UTC = 00:00:00 EDT 0\n" +"05:00:00 UTC = 01:00:00 EDT 0\n" +"06:00:00 UTC = 01:00:00 EST 1\n" +"07:00:00 UTC = 02:00:00 EST 0" -msgid "Note that the :class:`.datetime` instances that differ only by the value of the :attr:`~.datetime.fold` attribute are considered equal in comparisons." +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 "" +"توجه داشته باشید که نمونه‌های :class:`.datetime` که فقط از نظر مقدار " +"ویژگی :attr:`~.datetime.fold` با هم تفاوت دارند، در مقایسه‌ها برابر در نظر " +"گرفته می‌شوند." -msgid "Applications that can't bear wall-time ambiguities should explicitly check the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :class:`tzinfo` subclasses; there are no ambiguities when using :class:`timezone`, or any other fixed-offset :class:`!tzinfo` subclass (such as a class representing only EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours))." -msgstr "" +msgid "" +"Applications that can't bear wall-time ambiguities should explicitly check " +"the value of the :attr:`~.datetime.fold` attribute or avoid using " +"hybrid :class:`tzinfo` subclasses; there are no ambiguities when " +"using :class:`timezone`, or any other fixed-offset :class:`!tzinfo` " +"subclass (such as a class representing only EST (fixed offset -5 hours), or " +"only EDT (fixed offset -4 hours))." +msgstr "" +"برنامه‌های کاربردی که نمی‌توانند ابهام‌های زمان دیواری (wall-time) را تحمل " +"کنند، باید به‌صراحت مقدار ویژگی :attr:`~.datetime.fold` را بررسی کنند یا از " +"استفاده از زیرکلاس‌های ترکیبی :class:`tzinfo` اجتناب کنند؛ هنگام استفاده " +"از :class:`timezone`، یا هر زیرکلاس دیگری از :class:`!tzinfo` با آفست ثابت، " +"هیچ ابهامی وجود ندارد (مانند کلاسی که فقط EST (آفست ثابت منفی ۵ ساعت) یا " +"فقط EDT (آفست ثابت منفی ۴ ساعت) را نشان می‌دهد)." msgid ":mod:`zoneinfo`" -msgstr "" +msgstr ":mod:`zoneinfo`" -msgid "The :mod:`!datetime` module has a basic :class:`timezone` class (for handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a UTC :class:`!timezone` instance)." +msgid "" +"The :mod:`!datetime` module has a basic :class:`timezone` class (for " +"handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " +"attribute (a UTC :class:`!timezone` instance)." msgstr "" +"ماژول :mod:`!datetime` دارای یک کلاس :class:`timezone` ساده (برای مدیریت " +"آفست‌های ثابت دلخواه نسبت به UTC) و ویژگی :attr:`timezone.utc` آن (یک نمونه " +"از :class:`!timezone` برای UTC) است." -msgid "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson database) to Python, and its usage is recommended." +msgid "" +"``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " +"database) to Python, and its usage is recommended." msgstr "" +"``zoneinfo`` پایگاه داده *مناطق زمانی IANA* (که با نام پایگاه داده Olson " +"نیز شناخته می‌شود) را در پایتون در دسترس قرار می‌دهد و استفاده از آن توصیه " +"می‌شود." msgid "`IANA time zone database `_" -msgstr "" +msgstr "`پایگاه داده‌ی منطقه‌های زمانی IANA `_" -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 locations around the globe. It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules." -msgstr "" +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 " +"locations around the globe. It is updated periodically to reflect changes " +"made by political bodies to time zone boundaries, UTC offsets, and daylight-" +"saving rules." +msgstr "" +"پایگاه داده‌ی مناطق زمانی (که اغلب tz، tzdata یا zoneinfo نامیده می‌شود) حاوی " +"کد و داده‌هایی است که تاریخچه‌ی زمان محلی را برای بسیاری از مکان‌های معرف در " +"سراسر جهان نشان می‌دهند. این پایگاه داده به‌طور دوره‌ای به‌روزرسانی می‌شود تا " +"تغییراتی را که نهادهای سیاسی در مرزهای مناطق زمانی، آفست‌های UTC و قوانین " +"ساعت تابستانی اعمال می‌کنند، منعکس کند." msgid ":class:`!timezone` objects" -msgstr "" +msgstr "اشیاء :class:`!timezone`" -msgid "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance of which represents a time zone defined by a fixed offset from UTC." +msgid "" +"The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " +"of which represents a time zone defined by a fixed offset from UTC." msgstr "" +"کلاس :class:`timezone` زیرکلاسی از :class:`tzinfo` است که هر نمونه از آن " +"نشان‌دهنده‌ی یک منطقه‌ی زمانی تعریف‌شده با یک آفست ثابت از UTC است." -msgid "Objects of this class cannot be used to represent time zone information in the locations where different offsets are used in different days of the year or where historical changes have been made to civil time." +msgid "" +"Objects of this class cannot be used to represent time zone information in " +"the locations where different offsets are used in different days of the " +"year or where historical changes have been made to civil time." msgstr "" +"نمی‌توان از اشیای این کلاس برای نمایش اطلاعات منطقه زمانی در مکان‌هایی " +"استفاده کرد که در روزهای مختلفی از سال از آفست‌های متفاوت (offset) استفاده " +"می‌شود یا تغییرات تاریخی در زمان مدنی اعمال شده‌اند." -msgid "The *offset* argument must be specified as a :class:`timedelta` object representing the difference between the local time and UTC. It must be strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)``, otherwise :exc:`ValueError` is raised." +msgid "" +"The *offset* argument must be specified as a :class:`timedelta` object " +"representing the difference between the local time and UTC. It must be " +"strictly between ``-timedelta(hours=24)`` and ``timedelta(hours=24)``, " +"otherwise :exc:`ValueError` is raised." msgstr "" +"آرگومان *offset* باید به‌صورت یک شیء :class:`timedelta` مشخص شود که اختلاف " +"بین زمان محلی و UTC را نشان می‌دهد. این مقدار باید به‌طور اکید بین ``-" +"timedelta(hours=24)`` و ``timedelta(hours=24)`` باشد، در غیر این " +"صورت :exc:`ValueError` پرتاب می‌شود." -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." +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 "" +"آرگومان *name* اختیاری است. در صورت مشخص شدن، باید رشته‌ای باشد که به‌عنوان " +"مقدار بازگشتی متد :meth:`datetime.tzname` استفاده می‌شود." -msgid "Return the fixed value specified when the :class:`timezone` instance is constructed." +msgid "" +"Return the fixed value specified when the :class:`timezone` instance is " +"constructed." msgstr "" +"مقدار ثابتی را که هنگام ساخت نمونه‌ی :class:`timezone` تعیین شده است، " +"برمی‌گرداند." -msgid "The *dt* argument is ignored. The return value is a :class:`timedelta` instance equal to the difference between the local time and UTC." +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 "" +"آرگومان *dt* نادیده گرفته می‌شود. مقدار بازگشتی یک نمونه‌ی :class:`timedelta` " +"است که برابر با اختلاف بین زمان محلی و UTC است." -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 *offset* is ``timedelta(0)``, the name is \"UTC\", otherwise it is a string in the format ``UTC±HH:MM``, where ± is the sign of ``offset``, HH and MM are two digits of ``offset.hours`` and ``offset.minutes`` respectively." -msgstr "" +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 " +"*offset* is ``timedelta(0)``, the name is \"UTC\", otherwise it is a string " +"in the format ``UTC±HH:MM``, where ± is the sign of ``offset``, HH and MM " +"are two digits of ``offset.hours`` and ``offset.minutes`` respectively." +msgstr "" +"اگر *name* در سازنده ارائه نشده باشد، نامی که ``tzname(dt)`` برمی‌گرداند از " +"مقدار ``offset`` به‌صورت زیر تولید می‌شود. اگر *offset* برابر " +"``timedelta(0)`` باشد، نام \"UTC\" است، در غیر این صورت، رشته‌ای در قالب " +"``UTC±HH:MM`` خواهد بود که در آن ± علامت ``offset`` است و HH و MM به‌ترتیب " +"دو رقمِ ``offset.hours`` و ``offset.minutes`` هستند." -msgid "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not ``'UTC+00:00'``." +msgid "" +"Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " +"``'UTC+00:00'``." msgstr "" +"نام تولیدشده از ``offset=timedelta(0)`` اکنون ``'UTC'`` ساده است، نه " +"``'UTC+00:00'``." msgid "Always returns ``None``." -msgstr "" +msgstr "همیشه ``None`` را برمی‌گرداند." -msgid "Return ``dt + offset``. The *dt* argument must be an aware :class:`.datetime` instance, with ``tzinfo`` set to ``self``." +msgid "" +"Return ``dt + offset``. The *dt* argument must be an " +"aware :class:`.datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" +"``dt + offset`` را برمی‌گرداند. آرگومان *dt* باید یک نمونه‌ی آگاه " +"از :class:`.datetime` باشد که ``tzinfo`` آن روی ``self`` تنظیم شده باشد." msgid "The UTC time zone, ``timezone(timedelta(0))``." -msgstr "" +msgstr "منطقه زمانی UTC، ``timezone(timedelta(0))``." msgid ":meth:`!strftime` and :meth:`!strptime` behavior" -msgstr "" +msgstr "رفتار :meth:`!strftime` و :meth:`!strptime`" -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." +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 "" +"اشیاء :class:`date`، :class:`.datetime` و :class:`.time` همگی از متد " +"``strftime(format)`` پشتیبانی می‌کنند تا رشته‌ای ایجاد کنند که زمان را تحت " +"کنترل یک رشته قالب صریح نشان می‌دهد." -msgid "Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:`time.strptime` class methods create an object from a string representing the time and a corresponding format string." +msgid "" +"Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` " +"and :meth:`time.strptime` class methods create an object from a string " +"representing the time and a corresponding format string." msgstr "" +"در مقابل، متدهای کلاس :meth:`date.strptime`، :meth:`datetime.strptime` " +"و :meth:`time.strptime` یک شیء را از یک رشته که زمان را نشان می‌دهد و یک " +"رشته قالب متناظر ایجاد می‌کنند." -msgid "The table below provides a high-level comparison of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:" +msgid "" +"The table below provides a high-level comparison " +"of :meth:`~.datetime.strftime` versus :meth:`~.datetime.strptime`:" msgstr "" +"جدول زیر مقایسه‌ای سطح بالا بین :meth:`~.datetime.strftime` " +"و :meth:`~.datetime.strptime` ارائه می‌دهد:" msgid "``strftime``" -msgstr "" +msgstr "``strftime``" msgid "``strptime``" -msgstr "" +msgstr "``strptime``" msgid "Usage" -msgstr "" +msgstr "استفاده" msgid "Convert object to a string according to a given format" -msgstr "" +msgstr "تبدیل شیء به یک رشته مطابق با یک قالب داده‌شده" msgid "Parse a string into an object given a corresponding format" -msgstr "" +msgstr "تجزیه یک رشته به یک شیء بر اساس قالب متناظر" msgid "Type of method" -msgstr "" +msgstr "نوع متد" msgid "Instance method" -msgstr "" +msgstr "متد نمونه" msgid "Class method" -msgstr "" +msgstr "متد کلاس" msgid "Signature" -msgstr "" +msgstr "امضا" msgid "``strftime(format)``" -msgstr "" +msgstr "``strftime(format)``" msgid "``strptime(date_string, format)``" -msgstr "" +msgstr "``strptime(date_string, format)``" msgid ":meth:`!strftime` and :meth:`!strptime` format codes" -msgstr "" +msgstr "کدهای قالب‌بندی :meth:`!strftime` و :meth:`!strptime`" -msgid "These methods accept format codes that can be used to parse and format dates::" +msgid "" +"These methods accept format codes that can be used to parse and format " +"dates::" msgstr "" +"این متدها کدهای قالبی را می‌پذیرند که می‌توان از آن‌ها برای تجزیه و قالب‌بندی " +"تاریخ‌ها استفاده کرد::" msgid "" ">>> import datetime as dt\n" @@ -2165,342 +4434,435 @@ msgid "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" msgstr "" +">>> import datetime as dt\n" +">>> dt.datetime.strptime('31/01/22 23:59:59.999999',\n" +"... '%d/%m/%y %H:%M:%S.%f')\n" +"datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)\n" +">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" +"'Mon 31 Jan 2022, 11:59PM'" -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." +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 "" +"فهرست زیر شامل تمام کدهای قالب‌بندی است که استاندارد C سال ۱۹۸۹ آن‌ها را " +"الزامی می‌کند، و این کدها روی تمام سکوهای دارای پیاده‌سازی استاندارد C کار " +"می‌کنند." msgid "Directive" -msgstr "" +msgstr "دایرکتیو" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Example" -msgstr "" +msgstr "مثال" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "``%a``" -msgstr "" +msgstr "``%a``" msgid "Weekday as locale's abbreviated name." -msgstr "" +msgstr "روز هفته به‌صورت نام اختصاری محلی (locale)." msgid "Sun, Mon, ..., Sat (en_US);" -msgstr "" +msgstr "Sun, Mon, ..., Sat (en_US);" msgid "So, Mo, ..., Sa (de_DE)" -msgstr "" +msgstr "So, Mo, ..., Sa (de_DE)" msgid "``%A``" -msgstr "" +msgstr "``%A``" msgid "Weekday as locale's full name." -msgstr "" +msgstr "نام کامل روز هفته بر اساس locale." msgid "Sunday, Monday, ..., Saturday (en_US);" -msgstr "" +msgstr "یکشنبه، دوشنبه، ...، شنبه (en_US);" msgid "Sonntag, Montag, ..., Samstag (de_DE)" -msgstr "" +msgstr "Sonntag, Montag, ..., Samstag (de_DE)" msgid "``%w``" -msgstr "" +msgstr "``%w``" msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." -msgstr "" +msgstr "روز هفته به‌صورت عدد دهدهی، که در آن ۰ یکشنبه و ۶ شنبه است." msgid "0, 1, ..., 6" -msgstr "" +msgstr "0, 1, ..., 6" msgid "``%d``" -msgstr "" +msgstr "``%d``" msgid "Day of the month as a zero-padded decimal number." -msgstr "" +msgstr "روز ماه به‌صورت عدد دهدهی با صفرهای پیشرو." msgid "01, 02, ..., 31" -msgstr "" +msgstr "01, 02, ..., 31" msgid "\\(9)" -msgstr "" +msgstr "\\(9)" msgid "``%b``" -msgstr "" +msgstr "``%b``" msgid "Month as locale's abbreviated name." -msgstr "" +msgstr "ماه به‌صورت نام اختصاری locale." msgid "Jan, Feb, ..., Dec (en_US);" -msgstr "" +msgstr "Jan، Feb، ...، Dec (en_US)؛" msgid "Jan, Feb, ..., Dez (de_DE)" -msgstr "" +msgstr "Jan, Feb, ..., Dez (de_DE)" msgid "``%B``" -msgstr "" +msgstr "``%B``" msgid "Month as locale's full name." -msgstr "" +msgstr "ماه به‌صورت نام کامل locale." msgid "January, February, ..., December (en_US);" -msgstr "" +msgstr "ژانویه، فوریه، ...، دسامبر (en_US)؛" msgid "Januar, Februar, ..., Dezember (de_DE)" -msgstr "" +msgstr "ژانویه، فوریه، ...، دسامبر (de_DE)" msgid "``%m``" -msgstr "" +msgstr "``%m``" msgid "Month as a zero-padded decimal number." -msgstr "" +msgstr "ماه به‌صورت عدد دهدهی با صفر پر شده." msgid "01, 02, ..., 12" -msgstr "" +msgstr "01, 02, ..., 12" msgid "``%y``" -msgstr "" +msgstr "``%y``" msgid "Year without century as a zero-padded decimal number." -msgstr "" +msgstr "سال بدون قرن به‌صورت عدد دهدهی با صفرِ پیش‌رو." msgid "00, 01, ..., 99" -msgstr "" +msgstr "00, 01, ..., 99" msgid "``%Y``" -msgstr "" +msgstr "``%Y``" msgid "Year with century as a decimal number." -msgstr "" +msgstr "سال همراه با قرن به‌صورت عدد دهدهی." msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -msgstr "" +msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgid "``%H``" -msgstr "" +msgstr "``%H``" msgid "Hour (24-hour clock) as a zero-padded decimal number." -msgstr "" +msgstr "ساعت (ساعت ۲۴ ساعته) به‌صورت عدد دهدهی با صفر پرشده." msgid "00, 01, ..., 23" -msgstr "" +msgstr "00, 01, ..., 23" msgid "``%I``" -msgstr "" +msgstr "``%I``" msgid "Hour (12-hour clock) as a zero-padded decimal number." -msgstr "" +msgstr "ساعت (ساعت ۱۲ ساعته) به‌صورت عدد دهدهی با صفر پرشده." msgid "``%p``" -msgstr "" +msgstr "``%p``" msgid "Locale's equivalent of either AM or PM." -msgstr "" +msgstr "معادل locale برای AM یا PM." msgid "AM, PM (en_US);" -msgstr "" +msgstr "ق.ظ، ب.ظ (en_US)؛" msgid "am, pm (de_DE)" -msgstr "" +msgstr "am, pm (de_DE)" msgid "\\(1), \\(3)" -msgstr "" +msgstr "\\(1), \\(3)" msgid "``%M``" -msgstr "" +msgstr "``%M``" msgid "Minute as a zero-padded decimal number." -msgstr "" +msgstr "دقیقه به‌صورت یک عدد ده‌دهی پر شده با صفر." msgid "00, 01, ..., 59" -msgstr "" +msgstr "00, 01, ..., 59" msgid "``%S``" -msgstr "" +msgstr "``%S``" msgid "Second as a zero-padded decimal number." -msgstr "" +msgstr "ثانیه به‌صورت عدد ده‌دهی با صفر پرشده." msgid "\\(4), \\(9)" -msgstr "" +msgstr "\\(4), \\(9)" msgid "``%f``" -msgstr "" +msgstr "``%f``" msgid "Microsecond as a decimal number, zero-padded to 6 digits." -msgstr "" +msgstr "میکروثانیه به‌صورت عدد دهدهی، با صفر پر شده تا ۶ رقم." msgid "000000, 000001, ..., 999999" -msgstr "" +msgstr "000000, 000001, ..., 999999" msgid "\\(5)" -msgstr "" +msgstr "\\(5)" msgid "``%z``" -msgstr "" +msgstr "``%z``" -msgid "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is naive)." +msgid "" +"UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object " +"is naive)." msgstr "" +"اختلاف از UTC در قالب ``±HHMM[SS[.ffffff]]`` (اگر شیء ساده (naive) باشد، " +"رشته خالی)." msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" -msgstr "" +msgstr "(خالی)، +0000، -0400، +1030، +063415، -030712.345216" msgid "\\(6)" -msgstr "" +msgstr "\\(6)" msgid "``%Z``" -msgstr "" +msgstr "``%Z``" msgid "Time zone name (empty string if the object is naive)." -msgstr "" +msgstr "نام منطقه زمانی (رشته خالی اگر شیء ساده باشد)." msgid "(empty), UTC, GMT" -msgstr "" +msgstr "(خالی)، UTC، GMT" msgid "``%j``" -msgstr "" +msgstr "``%j``" msgid "Day of the year as a zero-padded decimal number." -msgstr "" +msgstr "روز سال به‌صورت عدد دهدهی با صفر پرشده." msgid "001, 002, ..., 366" -msgstr "" +msgstr "001, 002, ..., 366" msgid "``%U``" -msgstr "" +msgstr "``%U``" -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." +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 "" +"شماره‌ی هفته‌ی سال (یکشنبه به‌عنوان اولین روز هفته) به‌صورت عدد ده‌دهی با صفر " +"پرشده. همه‌ی روزهای سال جدید پیش از اولین یکشنبه، در هفته‌ی ۰ در نظر گرفته " +"می‌شوند." msgid "00, 01, ..., 53" -msgstr "" +msgstr "00, 01, ..., 53" msgid "\\(7), \\(9)" -msgstr "" +msgstr "\\(7), \\(9)" msgid "``%W``" -msgstr "" +msgstr "``%W``" -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." +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 "" +"شماره‌ی هفته‌ی سال (دوشنبه به‌عنوان نخستین روز هفته) به‌صورت عدد دهدهی با صفر " +"پرشده. همه‌ی روزهای سال جدید پیش از نخستین دوشنبه، در هفته‌ی ۰ در نظر گرفته " +"می‌شوند." msgid "``%c``" -msgstr "" +msgstr "``%c``" msgid "Locale's appropriate date and time representation." -msgstr "" +msgstr "نمایش مناسب تاریخ و زمان بر اساس تنظیمات locale (Locale)." msgid "Tue Aug 16 21:30:00 1988 (en_US);" -msgstr "" +msgstr "Tue Aug 16 21:30:00 1988 (en_US);" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" -msgstr "" +msgstr "Di 16 Aug 21:30:00 1988 (de_DE)" msgid "``%x``" -msgstr "" +msgstr "``%x``" msgid "Locale's appropriate date representation." -msgstr "" +msgstr "نمایش مناسب تاریخ بر اساس تنظیمات locale." msgid "08/16/88 (None);" -msgstr "" +msgstr "08/16/88 (None);" msgid "08/16/1988 (en_US);" -msgstr "" +msgstr "08/16/1988 (en_US);" msgid "16.08.1988 (de_DE)" -msgstr "" +msgstr "16.08.1988 (de_DE)" msgid "``%X``" -msgstr "" +msgstr "``%X``" msgid "Locale's appropriate time representation." -msgstr "" +msgstr "نمایش زمان مناسب برای Locale." msgid "21:30:00 (en_US);" -msgstr "" +msgstr "21:30:00 (en_US);" msgid "21:30:00 (de_DE)" -msgstr "" +msgstr "21:30:00 (de_DE)" msgid "``%%``" -msgstr "" +msgstr "``%%``" msgid "A literal ``'%'`` character." -msgstr "" +msgstr "یک نویسه‌ی ``'%'`` به‌صورت لفظی." msgid "%" -msgstr "" +msgstr "%" -msgid "Several additional directives not required by the C89 standard are included for convenience. These parameters all correspond to ISO 8601 date values." +msgid "" +"Several additional directives not required by the C89 standard are included " +"for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" +"چند دایرکتیو اضافی که استاندارد C89 آن‌ها را الزامی نمی‌داند، برای سهولت " +"گنجانده شده‌اند. این پارامترها همگی با مقادیر تاریخ ISO 8601 مطابقت دارند." msgid "``%G``" -msgstr "" +msgstr "``%G``" -msgid "ISO 8601 year with century representing the year that contains the greater part of the ISO week (``%V``)." +msgid "" +"ISO 8601 year with century representing the year that contains the greater " +"part of the ISO week (``%V``)." msgstr "" +"سال ISO 8601 همراه با قرن، نشان‌دهنده‌ی سالی که بخش بزرگ‌تر هفته‌ی ISO (``%V``) " +"در آن قرار دارد." msgid "\\(8)" -msgstr "" +msgstr "\\(8)" msgid "``%u``" -msgstr "" +msgstr "``%u``" msgid "ISO 8601 weekday as a decimal number where 1 is Monday." -msgstr "" +msgstr "روز هفته در ISO 8601 به‌صورت عدد دهدهی که در آن ۱ دوشنبه است." msgid "1, 2, ..., 7" -msgstr "" +msgstr "1, 2, ..., 7" msgid "``%V``" -msgstr "" +msgstr "``%V``" -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." +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 "" +"هفته‌ی ISO 8601 به‌صورت عدد ده‌دهی با دوشنبه به‌عنوان نخستین روز هفته. هفته‌ی 01 " +"هفته‌ای است که شامل ۴ ژانویه می‌شود." msgid "01, 02, ..., 53" -msgstr "" +msgstr "01, 02, ..., 53" msgid "\\(8), \\(9)" -msgstr "" +msgstr "\\(8), \\(9)" msgid "``%:z``" -msgstr "" +msgstr "``%:z``" -msgid "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object is naive)." +msgid "" +"UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " +"is naive)." msgstr "" +"فاصله زمانی از UTC در قالب ``±HH:MM[:SS[.ffffff]]`` (اگر شیء ساده (naive) " +"باشد، رشته خالی)." msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" -msgstr "" +msgstr "(خالی)، +00:00، -04:00، +10:30، +06:34:15، -03:07:12.345216" -msgid "These may not be available on all platforms when used with the :meth:`~.datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives are not interchangeable with the year and week number directives above. Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO 8601 directives will raise a :exc:`ValueError`." -msgstr "" +msgid "" +"These may not be available on all platforms when used with " +"the :meth:`~.datetime.strftime` method. The ISO 8601 year and ISO 8601 week " +"directives are not interchangeable with the year and week number directives " +"above. Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO " +"8601 directives will raise a :exc:`ValueError`." +msgstr "" +"ممکن است این‌ها هنگام استفاده با متد :meth:`~.datetime.strftime` در همه " +"سکوها در دسترس نباشند. دایرکتیوهای سال ISO 8601 و هفته ISO 8601 با " +"دایرکتیوهای سال و شماره هفته در بالا قابل تعویض نیستند. " +"فراخوانی :meth:`~.datetime.strptime` با دایرکتیوهای ناقص یا مبهم ISO 8601 " +"باعث پرتاب :exc:`ValueError` می‌شود." -msgid "The full set of format codes supported varies across platforms, because Python calls the platform C library's :c:func:`strftime` function, and platform variations are common. To see the full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. There are also differences between platforms in handling of unsupported format specifiers." -msgstr "" +msgid "" +"The full set of format codes supported varies across platforms, because " +"Python calls the platform C library's :c:func:`strftime` function, and " +"platform variations are common. To see the full set of format codes " +"supported on your platform, consult the :manpage:`strftime(3)` " +"documentation. There are also differences between platforms in handling of " +"unsupported format specifiers." +msgstr "" +"مجموعه کامل کدهای قالب‌بندی پشتیبانی‌شده در پلتفرم‌های مختلف متفاوت است، زیرا " +"پایتون تابع :c:func:`strftime` از کتابخانه C پلتفرم را فراخوانی می‌کند و " +"تفاوت‌های بین پلتفرم‌ها رایج است. برای مشاهده مجموعه کامل کدهای قالب‌بندی " +"پشتیبانی‌شده در پلتفرم شما، به مستندات :manpage:`strftime(3)` مراجعه کنید. " +"همچنین در مدیریت مشخص‌کننده‌های قالب‌بندی پشتیبانی‌نشده، بین پلتفرم‌ها تفاوت‌هایی " +"وجود دارد." msgid "``%G``, ``%u`` and ``%V`` were added." -msgstr "" +msgstr "``%G``، ``%u`` و ``%V`` افزوده شدند." msgid "``%:z`` was added." -msgstr "" +msgstr "``%:z`` افزوده شد." msgid "Technical detail" -msgstr "" +msgstr "جزئیات فنی" -msgid "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's ``time.strftime(fmt, d.timetuple())`` although not all objects support a :meth:`~date.timetuple` method." +msgid "" +"Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " +"``time.strftime(fmt, d.timetuple())`` although not all objects support " +"a :meth:`~date.timetuple` method." msgstr "" +"به‌طور کلی، ``d.strftime(fmt)`` مانند ``time.strftime(fmt, d.timetuple())`` " +"در ماژول :mod:`time` عمل می‌کند، اگرچه همه‌ی شی‌ها از " +"متد :meth:`~date.timetuple` پشتیبانی نمی‌کنند." -msgid "For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class methods, 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." +msgid "" +"For the :meth:`.datetime.strptime` and :meth:`.date.strptime` class " +"methods, 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 "" +"برای متدهای کلاس :meth:`.datetime.strptime` و :meth:`.date.strptime`، مقدار " +"پیش‌فرض ``1900-01-01T00:00:00.000`` است: هر کامپوننتی که در رشته‌ی قالب مشخص " +"نشده باشد، از مقدار پیش‌فرض گرفته می‌شود." -msgid "Format strings without separators can be ambiguous for parsing. For example, with ``%Y%m%d``, the string ``2026111`` may be parsed either as ``2026-11-01`` or as ``2026-01-11``. Use separators to ensure the input is parsed as intended." +msgid "" +"Format strings without separators can be ambiguous for parsing. For " +"example, with ``%Y%m%d``, the string ``2026111`` may be parsed either as " +"``2026-11-01`` or as ``2026-01-11``. Use separators to ensure the input is " +"parsed as intended." msgstr "" +"رشته‌های قالب بدون جداکننده ممکن است در تجزیه مبهم باشند. برای مثال، با " +"``%Y%m%d``، ممکن است رشته‌ی ``2026111`` به‌صورت ``2026-11-01`` یا به‌صورت " +"``2026-01-11`` تجزیه شود. برای اطمینان از اینکه ورودی مطابق منظور تجزیه " +"می‌شود، از جداکننده‌ها استفاده کنید." -msgid "When used to parse partial dates lacking a year, :meth:`.datetime.strptime` and :meth:`.date.strptime` will raise when encountering February 29 because the default year of 1900 is *not* a leap year. Always add a default leap year to partial date strings before parsing." +msgid "" +"When used to parse partial dates lacking a year, :meth:`.datetime.strptime` " +"and :meth:`.date.strptime` will raise when encountering February 29 because " +"the default year of 1900 is *not* a leap year. Always add a default leap " +"year to partial date strings before parsing." msgstr "" +"هنگامی که برای تجزیه‌ی تاریخ‌های ناقص فاقد سال استفاده " +"شوند، :meth:`.datetime.strptime` و :meth:`.date.strptime` در صورت مواجهه با " +"۲۹ فوریه استثنا پرتاب می‌کنند، زیرا سال پیش‌فرض ۱۹۰۰ یک سال کبیسه *نیست*. " +"همیشه پیش از تجزیه، یک سال کبیسه‌ی پیش‌فرض به رشته‌های تاریخ ناقص اضافه کنید." msgid "" ">>> import datetime as dt\n" @@ -2512,111 +4874,302 @@ msgid "" ">>> dt.datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n" "datetime.datetime(1904, 2, 29, 0, 0)" msgstr "" +">>> import datetime as dt\n" +">>> value = \"2/29\"\n" +">>> dt.datetime.strptime(value, \"%m/%d\")\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: day 29 must be in range 1..28 for month 2 in year 1900\n" +">>> dt.datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n" +"datetime.datetime(1904, 2, 29, 0, 0)" msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" -msgstr "" +msgstr "استفاده از ``datetime.strptime(date_string, format)`` معادل است با::" -msgid "except when the format includes sub-second components or time zone offset information, which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``." +msgid "" +"except when the format includes sub-second components or time zone offset " +"information, which are supported in ``datetime.strptime`` but are discarded " +"by ``time.strptime``." msgstr "" +"مگر زمانی که قالب شامل کامپوننت‌های زیرثانیه‌ای یا اطلاعات اختلاف منطقه زمانی " +"باشد، که در ``datetime.strptime`` پشتیبانی می‌شوند اما در ``time.strptime`` " +"حذف می‌شوند." -msgid "For :class:`.time` objects, the format codes for year, month, and day should not be used, as :class:`!time` objects have no such values. If they're used anyway, 1900 is substituted for the year, and 1 for the month and day." +msgid "" +"For :class:`.time` objects, the format codes for year, month, and day " +"should not be used, as :class:`!time` objects have no such values. If " +"they're used anyway, 1900 is substituted for the year, and 1 for the month " +"and day." msgstr "" +"برای اشیای :class:`.time`، نباید از کدهای قالب مربوط به سال، ماه و روز " +"استفاده شود، زیرا اشیای :class:`!time` چنین مقادیری ندارند. اگر با این حال " +"از آن‌ها استفاده شود، ۱۹۰۰ به‌جای سال و ۱ به‌جای ماه و روز جایگزین می‌شود." -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 values. If they're used anyway, 0 is substituted for them." +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 " +"values. If they're used anyway, 0 is substituted for them." msgstr "" +"برای اشیای :class:`date`، نباید از کدهای قالب مربوط به ساعت، دقیقه، ثانیه " +"و میکروثانیه استفاده کرد، زیرا اشیای :class:`date` چنین مقادیری ندارند. " +"اگر با این حال از آن‌ها استفاده شود، ۰ جایگزین آن‌ها می‌شود." -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 also platform-dependent. On some platforms such code points are preserved intact in the output, while on others ``strftime`` may raise :exc:`UnicodeError` or return an empty string instead." -msgstr "" +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 " +"also platform-dependent. On some platforms such code points are preserved " +"intact in the output, while on others ``strftime`` may " +"raise :exc:`UnicodeError` or return an empty string instead." +msgstr "" +"به همین دلیل، پردازش رشته‌های قالب‌بندی حاوی نقاط کد یونیکد که در مجموعه " +"نویسه‌های منطقه‌ی فعلی (locale) قابل بازنمایی نیستند نیز وابسته به سکو است. در " +"برخی سکوها چنین نقاط کدی به‌صورت دست‌نخورده در خروجی حفظ می‌شوند، در حالی که " +"در سکوهایی دیگر ``strftime`` ممکن است :exc:`UnicodeError` را پرتاب کند یا " +"در عوض یک رشته‌ی خالی برگرداند." -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 example, \"month/day/year\" versus \"day/month/year\"), and the output may contain non-ASCII characters." +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 " +"example, \"month/day/year\" versus \"day/month/year\"), and the output may " +"contain non-ASCII characters." msgstr "" +"از آنجا که قالب به locale (locale) بستگی دارد، هنگامی که درباره‌ی مقدار " +"خروجی فرض‌هایی می‌کنید، باید احتیاط کنید. ترتیب فیلدها متفاوت خواهد بود (برای " +"مثال، «ماه/روز/سال» در برابر «روز/ماه/سال»)، و خروجی ممکن است شامل نویسه‌های " +"غیر ASCII باشد." -msgid "The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but years < 1000 must be zero-filled to 4-digit width." +msgid "" +"The :meth:`~.datetime.strptime` method can parse years in the full [1, " +"9999] range, but years < 1000 must be zero-filled to 4-digit width." msgstr "" +"متد :meth:`~.datetime.strptime` می‌تواند سال‌ها را در بازه‌ی کامل [۱، ۹۹۹۹] " +"تجزیه کند، اما سال‌های کوچک‌تر از ۱۰۰۰ باید با صفر تا عرض ۴ رقمی پر شوند." -msgid "In previous versions, :meth:`~.datetime.strftime` method was restricted to years >= 1900." +msgid "" +"In previous versions, :meth:`~.datetime.strftime` method was restricted to " +"years >= 1900." msgstr "" +"در نسخه‌های پیشین، متد :meth:`~.datetime.strftime` به سال‌های >= ۱۹۰۰ محدود " +"شده بود." -msgid "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years >= 1000." +msgid "" +"In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " +">= 1000." msgstr "" +"در نسخه 3.2، متد :meth:`~.datetime.strftime` به سال‌های >= 1000 محدود شد." -msgid "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive only affects the output hour field if the ``%I`` directive is used to parse the hour." +msgid "" +"When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " +"only affects the output hour field if the ``%I`` directive is used to parse " +"the hour." msgstr "" +"هنگامی که همراه با متد :meth:`~.datetime.strptime` استفاده شود، دایرکتیو " +"``%p`` تنها در صورتی بر فیلد ساعت خروجی تأثیر می‌گذارد که از دایرکتیو ``%I`` " +"برای تجزیه ساعت استفاده شود." -msgid "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support leap seconds." +msgid "" +"Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " +"leap seconds." msgstr "" +"برخلاف ماژول :mod:`time`، ماژول :mod:`!datetime` از ثانیه‌های کبیسه پشتیبانی " +"نمی‌کند." -msgid "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive accepts from one to six digits and zero pads on the right. ``%f`` is an extension to the set of format characters in the C standard (but implemented separately in datetime objects, and therefore always available)." +msgid "" +"When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " +"accepts from one to six digits and zero pads on the right. ``%f`` is an " +"extension to the set of format characters in the C standard (but " +"implemented separately in datetime objects, and therefore always available)." msgstr "" +"هنگامی که با متد :meth:`~.datetime.strptime` استفاده شود، دایرکتیو ``%f`` از ۱ " +"تا ۶ رقم را می‌پذیرد و سمت راست آن را با صفر پر می‌کند. ``%f`` افزونه‌ای بر " +"مجموعه‌ی نویسه‌های قالب‌بندی در استاندارد C است (اما به‌طور جداگانه در اشیای " +"datetime پیاده‌سازی شده است و بنابراین همیشه در دسترس است)." -msgid "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced by empty strings." +msgid "" +"For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are " +"replaced by empty strings." msgstr "" +"برای یک شیء ساده (naive)، کدهای قالب ``%z``، ``%:z`` و ``%Z`` با رشته‌های " +"خالی جایگزین می‌شوند." msgid "For an aware object:" -msgstr "" +msgstr "برای یک شیء آگاه (aware):" -msgid ":meth:`~.datetime.utcoffset` is transformed into a string of the form ``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset hours, ``MM`` is a 2-digit string giving the number of UTC offset minutes, ``SS`` is a 2-digit string giving the number of UTC offset seconds and ``ffffff`` is a 6-digit string giving the number of UTC offset microseconds. The ``ffffff`` part is omitted when the offset is a whole number of seconds and both the ``ffffff`` and the ``SS`` part is omitted when the offset is a whole number of minutes. For example, if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``." -msgstr "" +msgid "" +":meth:`~.datetime.utcoffset` is transformed into a string of the form " +"``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " +"of UTC offset hours, ``MM`` is a 2-digit string giving the number of UTC " +"offset minutes, ``SS`` is a 2-digit string giving the number of UTC offset " +"seconds and ``ffffff`` is a 6-digit string giving the number of UTC offset " +"microseconds. The ``ffffff`` part is omitted when the offset is a whole " +"number of seconds and both the ``ffffff`` and the ``SS`` part is omitted " +"when the offset is a whole number of minutes. For example, " +"if :meth:`~.datetime.utcoffset` returns ``timedelta(hours=-3, " +"minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``." +msgstr "" +":meth:`~.datetime.utcoffset` به رشته‌ای به شکل ``±HHMM[SS[.ffffff]]`` تبدیل " +"می‌شود، که در آن ``HH`` رشته‌ای ۲ رقمی است که تعداد ساعت‌های اختلاف از UTC را " +"نشان می‌دهد، ``MM`` رشته‌ای ۲ رقمی است که تعداد دقیقه‌های اختلاف از UTC را " +"نشان می‌دهد، ``SS`` رشته‌ای ۲ رقمی است که تعداد ثانیه‌های اختلاف از UTC را " +"نشان می‌دهد و ``ffffff`` رشته‌ای ۶ رقمی است که تعداد میکروثانیه‌های اختلاف از " +"UTC را نشان می‌دهد. بخش ``ffffff`` زمانی حذف می‌شود که اختلاف، عدد صحیحی بر " +"حسب ثانیه باشد و هنگامی که اختلاف، عدد صحیحی بر حسب دقیقه باشد، هر دو بخش " +"``ffffff`` و ``SS`` حذف می‌شوند. برای مثال، اگر :meth:`~.datetime.utcoffset` " +"مقدار ``timedelta(hours=-3, minutes=-30)`` را برگرداند، ``%z`` با رشته‌ی " +"``'-0330'`` جایگزین می‌شود." -msgid "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method, the UTC offsets can have a colon as a separator between hours, minutes and seconds. For example, ``'+01:00:00'`` will be parsed as an offset of one hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." -msgstr "" +msgid "" +"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " +"method, the UTC offsets can have a colon as a separator between hours, " +"minutes and seconds. For example, ``'+01:00:00'`` will be parsed as an " +"offset of one hour. In addition, providing ``'Z'`` is identical to " +"``'+00:00'``." +msgstr "" +"هنگامی که دایرکتیو ``%z`` به متد :meth:`~.datetime.strptime` ارائه شود، " +"انحراف‌های UTC می‌توانند دارای علامت دونقطه به‌عنوان جداکننده بین ساعت‌ها، " +"دقیقه‌ها و ثانیه‌ها باشند. برای مثال، ``'+01:00:00'`` به‌عنوان انحرافی به " +"اندازه یک ساعت تجزیه می‌شود. علاوه بر این، ارائه ``'Z'`` معادل ``'+00:00'`` " +"است." -msgid "Behaves exactly as ``%z``, but has a colon separator added between hours, minutes and seconds." +msgid "" +"Behaves exactly as ``%z``, but has a colon separator added between hours, " +"minutes and seconds." msgstr "" +"دقیقاً مانند ``%z`` رفتار می‌کند، اما یک دونقطه به‌عنوان جداکننده بین ساعت‌ها، " +"دقیقه‌ها و ثانیه‌ها اضافه شده است." -msgid "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by the returned value, which must be a string." +msgid "" +"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string " +"if :meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced " +"by the returned value, which must be a string." msgstr "" +"در :meth:`~.datetime.strftime`، اگر :meth:`~.datetime.tzname` مقدار " +"``None`` را برگرداند، ``%Z`` با یک رشته‌ی خالی جایگزین می‌شود؛ در غیر این صورت " +"``%Z`` با مقدار برگردانده‌شده جایگزین می‌شود، که باید یک رشته باشد." msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" -msgstr "" +msgstr ":meth:`~.datetime.strptime` تنها مقادیر مشخصی را برای ``%Z`` می‌پذیرد:" msgid "any value in ``time.tzname`` for your machine's locale" -msgstr "" +msgstr "هر مقداری در ``time.tzname`` برای تنظیمات locale (locale) رایانه‌ی شما" msgid "the hard-coded values ``UTC`` and ``GMT``" -msgstr "" +msgstr "مقادیر سخت‌کد ``UTC`` و ``GMT``" -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." +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 "" +"بنابراین شخصی که در ژاپن زندگی می‌کند ممکن است ``JST``، ``UTC`` و ``GMT`` را " +"به‌عنوان مقادیر معتبر داشته باشد، اما احتمالاً ``EST`` را نه. برای مقادیر " +"نامعتبر، ``ValueError`` پرتاب خواهد شد." -msgid "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` of the result will be set to a :class:`timezone` instance." +msgid "" +"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " +"method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " +"of the result will be set to a :class:`timezone` instance." msgstr "" +"هنگامی که دایرکتیو ``%z`` به متد :meth:`~.datetime.strptime` ارائه شود، یک " +"شیء :class:`.datetime` آگاه از منطقه‌ی زمانی تولید می‌شود. ``tzinfo`` نتیجه " +"به یک نمونه از :class:`timezone` تنظیم می‌شود." -msgid "When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are only used in calculations when the day of the week and the calendar year (``%Y``) are specified." +msgid "" +"When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` " +"are only used in calculations when the day of the week and the calendar " +"year (``%Y``) are specified." msgstr "" +"هنگامی که با متد :meth:`~.datetime.strptime` استفاده شوند، ``%U`` و ``%W`` " +"فقط زمانی در محاسبات به کار می‌روند که روز هفته و سال گاه‌شماریی (``%Y``) مشخص " +"شده باشند." -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:`~.datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not interchangeable." +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:`~.datetime.strptime` format string. Also note that ``%G`` and " +"``%Y`` are not interchangeable." msgstr "" +"مانند ``%U`` و ``%W``، از ``%V`` فقط در محاسبات استفاده می‌شود، وقتی که روز " +"هفته و سال ISO (``%G``) در یک رشته‌ی قالب :meth:`~.datetime.strptime` تعیین " +"شده باشند. همچنین توجه داشته باشید که ``%G`` و ``%Y`` قابل تعویض با یکدیگر " +"نیستند." -msgid "When used with the :meth:`~.datetime.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." +msgid "" +"When used with the :meth:`~.datetime.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 "" +"هنگام استفاده با متد :meth:`~.datetime.strptime`، صفر پیشتاز برای قالب‌های " +"``%d``، ``%m``، ``%H``، ``%I``، ``%M``، ``%S``، ``%j``، ``%U``، ``%W`` و " +"``%V`` اختیاری است. برای قالب ``%y``، صفر پیشتاز الزامی است." -msgid "When parsing a month and day using :meth:`~.datetime.strptime`, always include a year in the format. If the value you need to parse lacks a year, append an explicit dummy leap year. Otherwise your code will raise an exception when it encounters leap day because the default year used by the parser (1900) is not a leap year. Users run into that bug every leap year." -msgstr "" +msgid "" +"When parsing a month and day using :meth:`~.datetime.strptime`, always " +"include a year in the format. If the value you need to parse lacks a year, " +"append an explicit dummy leap year. Otherwise your code will raise an " +"exception when it encounters leap day because the default year used by the " +"parser (1900) is not a leap year. Users run into that bug every leap year." +msgstr "" +"هنگام تجزیه‌ی ماه و روز با استفاده از :meth:`~.datetime.strptime`، همیشه یک " +"سال را در قالب بگنجانید. اگر مقداری که باید تجزیه کنید سال ندارد، یک سال " +"کبیسه‌ی ساختگی را به‌صورت صریح به آن اضافه کنید. در غیر این صورت، کد شما " +"هنگام مواجهه با روز کبیسه استثنایی پرتاب می‌کند، زیرا سال پیش‌فرض استفاده‌شده " +"توسط پارسر (۱۹۰۰) سال کبیسه نیست. کاربران هر سال کبیسه با این اشکال مواجه " +"می‌شوند." msgid "" ">>> month_day = \"02/29\"\n" -">>> dt.datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year bug.\n" +">>> dt.datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap " +"year bug.\n" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" +">>> month_day = \"02/29\"\n" +">>> dt.datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap " +"year bug.\n" +"datetime.datetime(1984, 2, 29, 0, 0)" -msgid ":meth:`~.datetime.strptime` calls using a format string containing a day of month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later we may change this into an error or change the default year to a leap year. See :gh:`70647`." +msgid "" +":meth:`~.datetime.strptime` calls using a format string containing a day of " +"month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " +"we may change this into an error or change the default year to a leap year. " +"See :gh:`70647`." msgstr "" +"فراخوانی‌های :meth:`~.datetime.strptime` که از یک رشته قالب شامل روز ماه " +"بدون سال استفاده می‌کنند، اکنون یک :exc:`DeprecationWarning` صادر می‌کنند. در " +"3.15 یا بعد از آن ممکن است این را به یک خطا تغییر دهیم یا سال پیش‌فرض را به " +"یک سال کبیسه تغییر دهیم. :gh:`70647` را ببینید." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" msgid "If, that is, we ignore the effects of relativity." -msgstr "" +msgstr "اگر، یعنی، اثرات نسبیت را نادیده بگیریم." -msgid "This matches the definition of the \"proleptic Gregorian\" calendar in Dershowitz and Reingold's book *Calendrical Calculations*, where it's the base calendar for all computations. See the book for algorithms for converting between proleptic Gregorian ordinals and many other calendar systems." -msgstr "" +msgid "" +"This matches the definition of the \"proleptic Gregorian\" calendar in " +"Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " +"base calendar for all computations. See the book for algorithms for " +"converting between proleptic Gregorian ordinals and many other calendar " +"systems." +msgstr "" +"این با تعریف گاه‌شماری «میلادی تعمیم‌یافته» (proleptic Gregorian) در کتاب " +"*Calendrical Calculations* اثر Dershowitz و Reingold مطابقت دارد، که در آن " +"این گاه‌شماری، گاه‌شماری پایه برای تمام محاسبات است. برای الگوریتم‌های تبدیل بین " +"شماره‌های ترتیبی گاه‌شماری میلادی تعمیم‌یافته و بسیاری از نظام‌های گاه‌شماریی دیگر، به کتاب " +"مراجعه کنید." -msgid "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar `_ for a good explanation." +msgid "" +"See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " +"`_ for a good explanation." msgstr "" +"برای توضیحی خوب، `راهنمای ریاضیات گاه‌شماری ISO 8601 `_ اثر R. H. van Gent را ببینید." msgid "% (percent)" -msgstr "" +msgstr "% (درصد)" msgid "datetime format" -msgstr "" +msgstr "قالب datetime" diff --git a/library/dbm.po b/library/dbm.po index 5b64f3638..10996b08e 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -24,106 +24,194 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!dbm` --- Interfaces to Unix \"databases\"" -msgstr "" +msgstr ":mod:`!dbm` --- رابط‌هایی برای «پایگاه‌های داده»ی یونیکس" msgid "**Source code:** :source:`Lib/dbm/__init__.py`" -msgstr "" +msgstr ":source:`Lib/dbm/__init__.py`" msgid ":mod:`!dbm` is a generic interface to variants of the DBM database:" -msgstr "" +msgstr ":mod:`!dbm` یک رابط عام برای انواع پایگاه داده DBM است:" msgid ":mod:`dbm.sqlite3`" -msgstr "" +msgstr ":mod:`dbm.sqlite3`" msgid ":mod:`dbm.gnu`" -msgstr "" +msgstr ":mod:`dbm.gnu`" msgid ":mod:`dbm.ndbm`" -msgstr "" +msgstr ":mod:`dbm.ndbm`" -msgid "If none of these modules are installed, the slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There is a `third party interface `_ to the Oracle Berkeley DB." +msgid "" +"If none of these modules are installed, the slow-but-simple implementation " +"in module :mod:`dbm.dumb` will be used. There is a `third party interface " +"`_ to the Oracle Berkeley DB." msgstr "" +"اگر هیچ‌کدام از این ماژول‌ها نصب‌نشده باشند، از پیاده‌سازی کند اما ساده در " +"ماژول :mod:`dbm.dumb` استفاده خواهد شد. یک `رابط شخص ثالث " +"`_ برای Oracle Berkeley DB " +"وجود دارد." -msgid "A tuple containing the exceptions that can be raised by each of the supported modules, with a unique exception also named :exc:`dbm.error` as the first item --- the latter is used when :exc:`dbm.error` is raised." +msgid "" +"A tuple containing the exceptions that can be raised by each of the " +"supported modules, with a unique exception also named :exc:`dbm.error` as " +"the first item --- the latter is used when :exc:`dbm.error` is raised." msgstr "" +"تاپلی شامل استثناهایی که هر یک از ماژول‌های پشتیبانی‌شده می‌توانند پرتاب " +"کنند، با یک استثنای یکتا که آن نیز :exc:`dbm.error` نام دارد به‌عنوان اولین " +"آیتم --- این استثنا زمانی استفاده می‌شود که :exc:`dbm.error` پرتاب شود." -msgid "This function attempts to guess which of the several simple database modules available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:`dbm.dumb` --- should be used to open a given file." +msgid "" +"This function attempts to guess which of the several simple database modules" +" available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or " +":mod:`dbm.dumb` --- should be used to open a given file." msgstr "" +"این تابع تلاش می‌کند حدس بزند که کدام‌یک از چندین ماژول ساده پایگاه داده " +"موجود --- :mod:`dbm.sqlite3`، :mod:`dbm.gnu`، :mod:`dbm.ndbm`، یا " +":mod:`dbm.dumb` --- باید برای باز کردن یک فایل مشخص استفاده شود." msgid "Return one of the following values:" -msgstr "" +msgstr "یکی از مقادیر زیر را برمی‌گرداند:" -msgid "``None`` if the file can't be opened because it's unreadable or doesn't exist" +msgid "" +"``None`` if the file can't be opened because it's unreadable or doesn't " +"exist" msgstr "" +"``None`` اگر فایل به دلیل غیرقابل‌خواندن بودن یا وجود نداشتن نتواند باز شود" msgid "the empty string (``''``) if the file's format can't be guessed" -msgstr "" +msgstr "رشته خالی (``''``) اگر نتوان قالب فایل را حدس زد" -msgid "a string containing the required module name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``" +msgid "" +"a string containing the required module name, such as ``'dbm.ndbm'`` or " +"``'dbm.gnu'``" msgstr "" +"رشته‌ای شامل نام ماژول مورد نیاز، مانند ``'dbm.ndbm'`` یا ``'dbm.gnu'``" msgid "*filename* accepts a :term:`path-like object`." msgstr "" +"*filename* یک :term:`شیء مسیرمانند (path-like object) ` " +"را می‌پذیرد." msgid "Open a database and return the corresponding database object." msgstr "" +"یک پایگاه داده را باز می‌کند و شیء پایگاه داده‌ی متناظر را برمی‌گرداند." msgid "Parameters" -msgstr "" +msgstr "پارامترها" -msgid "The database file to open. If the database file already exists, the :func:`whichdb` function is used to determine its type and the appropriate module is used; if it does not exist, the first submodule listed above that can be imported is used." +msgid "" +"The database file to open. If the database file already exists, the " +":func:`whichdb` function is used to determine its type and the appropriate " +"module is used; if it does not exist, the first submodule listed above that " +"can be imported is used." msgstr "" +"فایل پایگاه داده برای باز کردن. اگر فایل پایگاه داده از قبل وجود داشته باشد،" +" از تابع :func:`whichdb` برای تعیین نوع آن استفاده می‌شود و ماژول مناسب به " +"کار می‌رود؛ اگر وجود نداشته باشد، از اولین زیرماژول فهرست‌شده در بالا که " +"قابل ایمپورت باشد استفاده می‌شود." msgid "The database file to open." -msgstr "" +msgstr "فایل پایگاه داده‌ای که باید باز شود." -msgid "If the database file already exists, the :func:`whichdb` function is used to determine its type and the appropriate module is used; if it does not exist, the first submodule listed above that can be imported is used." +msgid "" +"If the database file already exists, the :func:`whichdb` function is used to" +" determine its type and the appropriate module is used; if it does not " +"exist, the first submodule listed above that can be imported is used." msgstr "" +"اگر فایل پایگاه داده از قبل وجود داشته باشد، برای تعیین نوع آن از تابع " +":func:`whichdb` استفاده می‌شود و ماژول مناسب به کار می‌رود؛ اگر وجود نداشته " +"باشد، اولین زیرماژول فهرست‌شده در بالا که بتوان آن را ایمپورت کرد، استفاده " +"می‌شود." -msgid "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * ``'n'``: |flag_n|" +msgid "" +"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n|" msgstr "" +"* ``'r'`` (پیش‌فرض): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n|" msgid "``'r'`` (default): |flag_r|" -msgstr "" +msgstr "``'r'`` (پیش‌فرض): |flag_r|" msgid "``'w'``: |flag_w|" -msgstr "" +msgstr "``'w'``: |flag_w|" msgid "``'c'``: |flag_c|" -msgstr "" +msgstr "``'c'``: |flag_c|" msgid "``'n'``: |flag_n|" -msgstr "" +msgstr "``'n'``: |flag_n|" msgid "|mode_param_doc|" -msgstr "" +msgstr "|mode_param_doc|" msgid "*file* accepts a :term:`path-like object`." -msgstr "" +msgstr "*file* یک :term:`path-like object` را می‌پذیرد." -msgid "The object returned by :func:`~dbm.open` supports the basic functionality of mutable :term:`mappings `; keys and their corresponding values can be stored, retrieved, and deleted, and iteration, the :keyword:`in` operator and methods :meth:`!keys`, :meth:`!get`, :meth:`!setdefault` and :meth:`!clear` are available. The :meth:`!keys` method returns a list instead of a view object. The :meth:`!setdefault` method requires two arguments." -msgstr "" +msgid "" +"The object returned by :func:`~dbm.open` supports the basic functionality of" +" mutable :term:`mappings `; keys and their corresponding values can" +" be stored, retrieved, and deleted, and iteration, the :keyword:`in` " +"operator and methods :meth:`!keys`, :meth:`!get`, :meth:`!setdefault` and " +":meth:`!clear` are available. The :meth:`!keys` method returns a list " +"instead of a view object. The :meth:`!setdefault` method requires two " +"arguments." +msgstr "" +"شیء برگردانده‌شده توسط :func:`~dbm.open`، از کارکرد پایه‌ی :term:`نگاشت‌های " +"تغییرپذیر ` پشتیبانی می‌کند؛ کلیدها و مقدارهای متناظرشان " +"می‌توانند ذخیره، بازیابی و حذف شوند و تکرار، عملگر :keyword:`in` و متدهای " +":meth:`!keys`، :meth:`!get`، :meth:`!setdefault` و :meth:`!clear` در دسترس " +"هستند. متد :meth:`!keys` به‌جای یک شیء نما، یک فهرست برمی‌گرداند. متد " +":meth:`!setdefault` به دو آرگومان نیاز دارد." -msgid "Key and values are always stored as :class:`bytes`. This means that when strings are used they are implicitly converted to the default encoding before being stored." +msgid "" +"Key and values are always stored as :class:`bytes`. This means that when " +"strings are used they are implicitly converted to the default encoding " +"before being stored." msgstr "" +"کلید و مقادیر همیشه به‌صورت :class:`bytes` ذخیره می‌شوند. این بدان معناست که" +" وقتی از رشته‌ها استفاده می‌شود، آن‌ها پیش از ذخیره شدن به‌طور ضمنی به " +"کدگذاری پیش‌فرض تبدیل می‌شوند." -msgid "These objects also support being used in a :keyword:`with` statement, which will automatically close them when done." +msgid "" +"These objects also support being used in a :keyword:`with` statement, which " +"will automatically close them when done." msgstr "" +"این اشیاء همچنین از استفاده در دستور :keyword:`with` پشتیبانی می‌کنند، که " +"به‌طور خودکار آن‌ها را پس از اتمام کار می‌بندد." -msgid ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:`!dbm` backends." +msgid "" +":meth:`!get` and :meth:`!setdefault` methods are now available for all " +":mod:`!dbm` backends." msgstr "" +"متدهای :meth:`!get` و :meth:`!setdefault` اکنون برای تمام بک‌اندهای " +"(backends) :mod:`!dbm` در دسترس هستند." -msgid "Added native support for the context management protocol to the objects returned by :func:`~dbm.open`." +msgid "" +"Added native support for the context management protocol to the objects " +"returned by :func:`~dbm.open`." msgstr "" +"پشتیبانی ذاتی از پروتکل مدیریت زمینه به اشیای برگردانده‌شده از " +":func:`~dbm.open` افزوده شد." -msgid "Deleting a key from a read-only database raises a database module specific exception instead of :exc:`KeyError`." +msgid "" +"Deleting a key from a read-only database raises a database module specific " +"exception instead of :exc:`KeyError`." msgstr "" +"حذف یک کلید از پایگاه داده‌ی فقط‌خواندنی، به‌جای :exc:`KeyError`، یک استثنای " +"مخصوص ماژول پایگاه داده را پرتاب می‌کند." msgid ":meth:`!clear` methods are now available for all :mod:`!dbm` backends." msgstr "" +"متدهای :meth:`!clear` اکنون برای تمام پشتیبان‌های :mod:`!dbm` در دسترس " +"هستند." -msgid "The following example records some hostnames and a corresponding title, and then prints out the contents of the database::" +msgid "" +"The following example records some hostnames and a corresponding title, and" +" then prints out the contents of the database::" msgstr "" +"مثال زیر چند نام میزبان و یک عنوان متناظر را ثبت می‌کند، و سپس محتویات " +"پایگاه داده را چاپ می‌کند::" msgid "" "import dbm\n" @@ -150,117 +238,245 @@ msgid "" "\n" "# db is automatically closed when leaving the with statement." msgstr "" +"import dbm\n" +"\n" +"# Open database, creating it if necessary.\n" +"with dbm.open('cache', 'c') as db:\n" +"\n" +" # Record some values\n" +" db[b'hello'] = b'there'\n" +" db['www.python.org'] = 'Python Website'\n" +" db['www.cnn.com'] = 'Cable News Network'\n" +"\n" +" # Note that the keys are considered bytes now.\n" +" assert db[b'www.python.org'] == b'Python Website'\n" +" # Notice how the value is now in bytes.\n" +" assert db['www.cnn.com'] == b'Cable News Network'\n" +"\n" +" # Often-used methods of the dict interface work too.\n" +" print(db.get('python.org', b'not present'))\n" +"\n" +" # Storing a non-string key or value will raise an exception (most\n" +" # likely a TypeError).\n" +" db['www.yahoo.com'] = 4\n" +"\n" +"# db is automatically closed when leaving the with statement." msgid "Module :mod:`shelve`" -msgstr "" +msgstr "ماژول :mod:`shelve`" msgid "Persistence module which stores non-string data." -msgstr "" +msgstr "ماژول ماندگاری که داده‌های غیررشته‌ای را ذخیره می‌کند." msgid "The individual submodules are described in the following sections." -msgstr "" +msgstr "هر یک از زیرماژول‌ها در بخش‌های زیر شرح داده شده‌اند." msgid ":mod:`!dbm.sqlite3` --- SQLite backend for dbm" -msgstr "" +msgstr ":mod:`!dbm.sqlite3` --- پشتیبان SQLite برای dbm" msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/dbm/sqlite3.py`" -msgid "This module uses the standard library :mod:`sqlite3` module to provide an SQLite backend for the :mod:`!dbm` module. The files created by :mod:`!dbm.sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, including the SQLite CLI." +msgid "" +"This module uses the standard library :mod:`sqlite3` module to provide an " +"SQLite backend for the :mod:`!dbm` module. The files created by " +":mod:`!dbm.sqlite3` can thus be opened by :mod:`sqlite3`, or any other " +"SQLite browser, including the SQLite CLI." msgstr "" +"این ماژول از ماژول :mod:`sqlite3` در کتابخانه استاندارد استفاده می‌کند تا یک" +" پشتیبان SQLite برای ماژول :mod:`!dbm` فراهم کند. در نتیجه، فایل‌های " +"ایجادشده توسط :mod:`!dbm.sqlite3` را می‌توان با :mod:`sqlite3` یا هر مرورگر" +" SQLite دیگری، از جمله SQLite CLI، باز کرد." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "Open an SQLite database." -msgstr "" +msgstr "باز کردن یک پایگاه داده SQLite." msgid "The path to the database to be opened." -msgstr "" +msgstr "مسیر پایگاه داده‌ای که باید باز شود." -msgid "The Unix file access mode of the file (default: octal ``0o666``), used only when the database has to be created." +msgid "" +"The Unix file access mode of the file (default: octal ``0o666``), used only " +"when the database has to be created." msgstr "" +"حالت دسترسی یونیکسی فایل (پیش‌فرض: ``0o666`` در مبنای هشت)، که تنها زمانی " +"استفاده می‌شود که پایگاه داده باید ایجاد شود." -msgid "The returned database object behaves similar to a mutable :term:`mapping`, but the :meth:`!keys` method returns a list, and the :meth:`!setdefault` method requires two arguments. It also supports a \"closing\" context manager via the :keyword:`with` keyword." +msgid "" +"The returned database object behaves similar to a mutable :term:`mapping`, " +"but the :meth:`!keys` method returns a list, and the :meth:`!setdefault` " +"method requires two arguments. It also supports a \"closing\" context " +"manager via the :keyword:`with` keyword." msgstr "" +"شیء پایگاه داده‌ی برگردانده‌شده رفتاری مشابه یک :term:`mapping` تغییرپذیر " +"دارد، اما متد :meth:`!keys` یک فهرست برمی‌گرداند و متد :meth:`!setdefault` " +"به دو آرگومان نیاز دارد. همچنین از یک مدیر زمینه‌ی «بستن» از طریق کلیدواژه " +":keyword:`with` پشتیبانی می‌کند." msgid "The following method is also provided:" -msgstr "" +msgstr "متد زیر نیز ارائه شده است:" msgid "Close the SQLite database." -msgstr "" +msgstr "پایگاه داده‌ی SQLite را ببندید." msgid ":mod:`!dbm.gnu` --- GNU database manager" -msgstr "" +msgstr ":mod:`!dbm.gnu` --- مدیر پایگاه‌داده GNU" msgid "**Source code:** :source:`Lib/dbm/gnu.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/dbm/gnu.py`" -msgid "The :mod:`!dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional functionality like crash tolerance." +msgid "" +"The :mod:`!dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " +"dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " +"functionality like crash tolerance." msgstr "" +"ماژول :mod:`!dbm.gnu` رابطی برای کتابخانه‌ی :abbr:`GDBM (GNU dbm)` فراهم " +"می‌کند، مشابه ماژول :mod:`dbm.ndbm`، اما با قابلیت‌های اضافی مانند تحمل " +"خرابی (crash tolerance)." -msgid "The file formats created by :mod:`!dbm.gnu` and :mod:`dbm.ndbm` are incompatible and can not be used interchangeably." +msgid "" +"The file formats created by :mod:`!dbm.gnu` and :mod:`dbm.ndbm` are " +"incompatible and can not be used interchangeably." msgstr "" +"قالب‌های فایل ایجادشده توسط :mod:`!dbm.gnu` و :mod:`dbm.ndbm` ناسازگار هستند" +" و نمی‌توانند به‌جای یکدیگر استفاده شوند." -msgid "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" +"این ماژول در :ref:`پلتفرم‌های موبایل ` یا " +":ref:`پلتفرم‌های WebAssembly ` پشتیبانی نمی‌شود." -msgid "Raised on :mod:`!dbm.gnu`-specific errors, such as I/O errors. :exc:`KeyError` is raised for general mapping errors like specifying an incorrect key." +msgid "" +"Raised on :mod:`!dbm.gnu`-specific errors, such as I/O errors. " +":exc:`KeyError` is raised for general mapping errors like specifying an " +"incorrect key." msgstr "" +"در صورت بروز خطاهای خاص :mod:`!dbm.gnu`، مانند خطاهای I/O، پرتاب می‌شود. " +":exc:`KeyError` برای خطاهای عمومی نگاشت، مانند مشخص کردن یک کلید نادرست، " +"پرتاب می‌شود." -msgid "A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` supports." +msgid "" +"A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " +"supports." msgstr "" +"رشته‌ای از نویسه‌ها که پارامتر *flag* در :meth:`~dbm.gnu.open` از آن‌ها " +"پشتیبانی می‌کند." msgid "Open a GDBM database and return a :class:`!gdbm` object." msgstr "" +"یک پایگاه داده GDBM را باز می‌کند و یک شیء :class:`!gdbm` را برمی‌گرداند." -msgid "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * ``'n'``: |flag_n| The following additional characters may be appended to control how the database is opened: * ``'f'``: Open the database in fast mode. Writes to the database will not be synchronized. * ``'s'``: Synchronized mode. Changes to the database will be written immediately to the file. * ``'u'``: Do not lock database. Not all flags are valid for all versions of GDBM. See the :data:`open_flags` member for a list of supported flag characters." -msgstr "" +msgid "" +"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n| The following additional characters may be appended to " +"control how the database is opened: * ``'f'``: Open the database in fast " +"mode. Writes to the database will not be synchronized. * ``'s'``: " +"Synchronized mode. Changes to the database will be written immediately to " +"the file. * ``'u'``: Do not lock database. Not all flags are valid for all " +"versions of GDBM. See the :data:`open_flags` member for a list of supported " +"flag characters." +msgstr "" +"* ``'r'`` (پیش‌فرض): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " +"``'n'``: |flag_n| می‌توان نویسه‌های اضافی زیر را برای کنترل چگونگی باز شدن " +"پایگاه داده افزود: * ``'f'``: باز کردن پایگاه داده در حالت سریع. نوشتن‌ها" +" در پایگاه داده همگام‌سازی نخواهند شد. * ``'s'``: حالت همگام. تغییرات " +"پایگاه داده بلافاصله در فایل نوشته خواهند شد. * ``'u'``: قفل نکردن پایگاه " +"داده. همه‌ی پرچم‌ها برای همه‌ی نسخه‌های GDBM معتبر نیستند. برای فهرستی از " +"نویسه‌های پرچم پشتیبانی‌شده، عضو :data:`open_flags` را ببینید." -msgid "The following additional characters may be appended to control how the database is opened:" +msgid "" +"The following additional characters may be appended to control how the " +"database is opened:" msgstr "" +"می‌توان نویسه‌های اضافی زیر را برای کنترل چگونگی باز شدن پایگاه داده اضافه " +"کرد:" -msgid "``'f'``: Open the database in fast mode. Writes to the database will not be synchronized." +msgid "" +"``'f'``: Open the database in fast mode. Writes to the database will not be " +"synchronized." msgstr "" +"``'f'``: پایگاه داده را در حالت سریع باز می‌کند. نوشتن‌ها در پایگاه داده " +"همگام‌سازی نخواهند شد." -msgid "``'s'``: Synchronized mode. Changes to the database will be written immediately to the file." +msgid "" +"``'s'``: Synchronized mode. Changes to the database will be written " +"immediately to the file." msgstr "" +"``'s'``: حالت همگام‌سازی‌شده. تغییرات پایگاه داده بلافاصله در فایل نوشته " +"می‌شوند." msgid "``'u'``: Do not lock database." -msgstr "" +msgstr "``'u'``: پایگاه داده را قفل نکنید." -msgid "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` member for a list of supported flag characters." +msgid "" +"Not all flags are valid for all versions of GDBM. See the :data:`open_flags`" +" member for a list of supported flag characters." msgstr "" +"همه‌ی پرچم‌ها برای همه‌ی نسخه‌های GDBM معتبر نیستند. برای فهرستی از " +"نویسه‌های پرچم پشتیبانی‌شده، عضو :data:`open_flags` را ببینید." msgid "Raises" -msgstr "" +msgstr "پرتاب می‌کند" msgid "If an invalid *flag* argument is passed." -msgstr "" +msgstr "اگر آرگومان *flag* نامعتبری ارسال شود." -msgid ":class:`!gdbm` objects behave similar to mutable :term:`mappings `, but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, and :meth:`!update` are not supported, the :meth:`!keys` method returns a list, and the :meth:`!setdefault` method requires two arguments. It also supports a \"closing\" context manager via the :keyword:`with` keyword." -msgstr "" +msgid "" +":class:`!gdbm` objects behave similar to mutable :term:`mappings `," +" but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, " +":meth:`!popitem`, and :meth:`!update` are not supported, the :meth:`!keys` " +"method returns a list, and the :meth:`!setdefault` method requires two " +"arguments. It also supports a \"closing\" context manager via the " +":keyword:`with` keyword." +msgstr "" +"اشیای :class:`!gdbm` مانند :term:`نگاشت‌های تغییرپذیر ` رفتار " +"می‌کنند، اما متدهای :meth:`!items`، :meth:`!values`، :meth:`!pop`، " +":meth:`!popitem` و :meth:`!update` پشتیبانی نمی‌شوند؛ متد :meth:`!keys` یک " +"فهرست برمی‌گرداند و متد :meth:`!setdefault` به ۲ آرگومان نیاز دارد. همچنین " +"از یک مدیر زمینه‌ی «بستن» از طریق کلیدواژه‌ی :keyword:`with` پشتیبانی " +"می‌کند." msgid "Added the :meth:`!get` and :meth:`!setdefault` methods." -msgstr "" +msgstr "متدهای :meth:`!get` و :meth:`!setdefault` افزوده شدند." msgid "Added the :meth:`!clear` method." -msgstr "" +msgstr "متد :meth:`!clear` افزوده شد." msgid "The following methods are also provided:" -msgstr "" +msgstr "متدهای زیر نیز ارائه شده‌اند:" msgid "Close the GDBM database." -msgstr "" +msgstr "پایگاه داده GDBM را ببندید." -msgid "It's possible to loop over every key in the database using this method and the :meth:`nextkey` method. The traversal is ordered by GDBM's internal hash values, and won't be sorted by the key values. This method returns the starting key." +msgid "" +"It's possible to loop over every key in the database using this method and " +"the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " +"hash values, and won't be sorted by the key values. This method returns the" +" starting key." msgstr "" +"می‌توان با استفاده از این متد و متد :meth:`nextkey`، روی تمام کلیدهای پایگاه" +" داده حلقه زد. پیمایش به ترتیب مقادیر هش داخلی GDBM است و بر اساس مقادیر " +"کلید مرتب نخواهد شد. این متد کلید شروع را برمی‌گرداند." -msgid "Returns the key that follows *key* in the traversal. The following code prints every key in the database ``db``, without having to create a list in memory that contains them all::" +msgid "" +"Returns the key that follows *key* in the traversal. The following code " +"prints every key in the database ``db``, without having to create a list in " +"memory that contains them all::" msgstr "" +"کلیدی را که در پیمایش پس از *key* می‌آید برمی‌گرداند. کد زیر همه‌ی کلیدهای " +"پایگاه داده‌ی ``db`` را، بدون نیاز به ایجاد فهرستی حاوی همه‌ی آن‌ها در " +"حافظه، چاپ می‌کند::" msgid "" "k = db.firstkey()\n" @@ -268,108 +484,224 @@ msgid "" " print(k)\n" " k = db.nextkey(k)" msgstr "" +"k = db.firstkey()\n" +"while k is not None:\n" +" print(k)\n" +" k = db.nextkey(k)" -msgid "If you have carried out a lot of deletions and would like to shrink the space used by the GDBM file, this routine will reorganize the database. :class:`!gdbm` objects will not shorten the length of a database file except by using this reorganization; otherwise, deleted file space will be kept and reused as new (key, value) pairs are added." -msgstr "" +msgid "" +"If you have carried out a lot of deletions and would like to shrink the " +"space used by the GDBM file, this routine will reorganize the database. " +":class:`!gdbm` objects will not shorten the length of a database file except" +" by using this reorganization; otherwise, deleted file space will be kept " +"and reused as new (key, value) pairs are added." +msgstr "" +"اگر حذف‌های زیادی انجام داده‌اید و می‌خواهید فضای مصرفی فایل GDBM را کاهش " +"دهید، این روتین پایگاه داده را بازآرایی می‌کند. اشیای :class:`!gdbm` طول " +"فایل پایگاه داده را کوتاه نمی‌کنند، مگر با استفاده از این بازآرایی؛ در غیر " +"این صورت، فضای حذف‌شده در فایل نگه داشته شده و با افزودن جفت‌های جدید (کلید،" +" مقدار) دوباره استفاده می‌شود." -msgid "When the database has been opened in fast mode, this method forces any unwritten data to be written to the disk." +msgid "" +"When the database has been opened in fast mode, this method forces any " +"unwritten data to be written to the disk." msgstr "" +"هنگامی که پایگاه داده در حالت سریع باز شده باشد، این متد باعث می‌شود هرگونه " +"داده‌ی نوشته‌نشده روی دیسک نوشته شود." msgid ":mod:`!dbm.ndbm` --- New Database Manager" -msgstr "" +msgstr ":mod:`!dbm.ndbm` --- مدیر پایگاه داده جدید" msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/dbm/ndbm.py`" -msgid "The :mod:`!dbm.ndbm` module provides an interface to the :abbr:`NDBM (New Database Manager)` library. This module can be used with the \"classic\" NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." +msgid "" +"The :mod:`!dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " +"Database Manager)` library. This module can be used with the \"classic\" " +"NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" +"ماژول :mod:`!dbm.ndbm` رابطی به کتابخانه‌ی :abbr:`NDBM (New Database " +"Manager)` فراهم می‌کند. این ماژول را می‌توان با رابط «کلاسیک» NDBM یا رابط " +"سازگاری :abbr:`GDBM (GNU dbm)` استفاده کرد." -msgid "The file formats created by :mod:`dbm.gnu` and :mod:`!dbm.ndbm` are incompatible and can not be used interchangeably." +msgid "" +"The file formats created by :mod:`dbm.gnu` and :mod:`!dbm.ndbm` are " +"incompatible and can not be used interchangeably." msgstr "" +"قالب‌های فایلی که :mod:`dbm.gnu` و :mod:`!dbm.ndbm` ایجاد می‌کنند ناسازگار " +"هستند و نمی‌توان از آن‌ها به‌جای یکدیگر استفاده کرد." -msgid "The NDBM library shipped as part of macOS has an undocumented limitation on the size of values, which can result in corrupted database files when storing values larger than this limit. Reading such corrupted files can result in a hard crash (segmentation fault)." +msgid "" +"The NDBM library shipped as part of macOS has an undocumented limitation on " +"the size of values, which can result in corrupted database files when " +"storing values larger than this limit. Reading such corrupted files can " +"result in a hard crash (segmentation fault)." msgstr "" +"کتابخانه NDBM که به‌عنوان بخشی از macOS عرضه می‌شود، محدودیت مستندنشده‌ای " +"در اندازه‌ی مقادیر دارد که می‌تواند هنگام ذخیره مقادیر بزرگ‌تر از این حد، " +"منجر به خرابی فایل‌های پایگاه داده شود. خواندن چنین فایل‌های خرابی می‌تواند " +"منجر به خرابی سخت (segmentation fault) شود." -msgid "Raised on :mod:`!dbm.ndbm`-specific errors, such as I/O errors. :exc:`KeyError` is raised for general mapping errors like specifying an incorrect key." +msgid "" +"Raised on :mod:`!dbm.ndbm`-specific errors, such as I/O errors. " +":exc:`KeyError` is raised for general mapping errors like specifying an " +"incorrect key." msgstr "" +"در صورت بروز خطاهای خاص :mod:`!dbm.ndbm`، مانند خطاهای ورودی/خروجی، پرتاب " +"می‌شود. :exc:`KeyError` برای خطاهای عمومی نگاشت، مانند تعیین یک کلید نادرست،" +" پرتاب می‌شود." msgid "Name of the NDBM implementation library used." -msgstr "" +msgstr "نام کتابخانه پیاده‌سازی NDBM استفاده‌شده." msgid "Open an NDBM database and return an :class:`!ndbm` object." msgstr "" +"یک پایگاه داده NDBM را باز می‌کند و یک شیء :class:`!ndbm` را برمی‌گرداند." -msgid "The basename of the database file (without the :file:`.dir` or :file:`.pag` extensions)." +msgid "" +"The basename of the database file (without the :file:`.dir` or :file:`.pag` " +"extensions)." msgstr "" +"نام پایه‌ی فایل پایگاه داده (بدون پسوندهای :file:`.dir` یا :file:`.pag`)." msgid "Accepts :term:`path-like object` for filename." -msgstr "" +msgstr ":term:`path-like object` را برای نام فایل می‌پذیرد." -msgid ":class:`!ndbm` objects behave similar to mutable :term:`mappings `, but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, and :meth:`!update` are not supported, the :meth:`!keys` method returns a list, and the :meth:`!setdefault` method requires two arguments. It also supports a \"closing\" context manager via the :keyword:`with` keyword." -msgstr "" +msgid "" +":class:`!ndbm` objects behave similar to mutable :term:`mappings `," +" but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, " +":meth:`!popitem`, and :meth:`!update` are not supported, the :meth:`!keys` " +"method returns a list, and the :meth:`!setdefault` method requires two " +"arguments. It also supports a \"closing\" context manager via the " +":keyword:`with` keyword." +msgstr "" +"اشیای :class:`!ndbm` رفتاری مشابه :term:`نگاشت‌های ` تغییرپذیر " +"دارند، اما متدهای :meth:`!items`، :meth:`!values`، :meth:`!pop`، " +":meth:`!popitem` و :meth:`!update` پشتیبانی نمی‌شوند؛ متد :meth:`!keys` یک " +"فهرست برمی‌گرداند و متد :meth:`!setdefault` به دو آرگومان نیاز دارد. همچنین " +"از یک مدیر زمینه «بستن» از طریق کلیدواژه :keyword:`with` پشتیبانی می‌کند." msgid "Close the NDBM database." -msgstr "" +msgstr "پایگاه داده NDBM را ببندید." msgid ":mod:`!dbm.dumb` --- Portable DBM implementation" -msgstr "" +msgstr ":mod:`!dbm.dumb` --- پیاده‌سازی قابل‌حمل DBM" msgid "**Source code:** :source:`Lib/dbm/dumb.py`" -msgstr "" +msgstr ":source:`Lib/dbm/dumb.py`" -msgid "The :mod:`!dbm.dumb` module is intended as a last resort fallback for the :mod:`!dbm` module when a more robust module is not available. The :mod:`!dbm.dumb` module is not written for speed and is not nearly as heavily used as the other database modules." +msgid "" +"The :mod:`!dbm.dumb` module is intended as a last resort fallback for the " +":mod:`!dbm` module when a more robust module is not available. The " +":mod:`!dbm.dumb` module is not written for speed and is not nearly as " +"heavily used as the other database modules." msgstr "" +"ماژول :mod:`!dbm.dumb` به‌عنوان آخرین راه‌حل جایگزین برای ماژول :mod:`!dbm` " +"در نظر گرفته شده است، برای زمانی که ماژول قوی‌تری در دسترس نباشد. ماژول " +":mod:`!dbm.dumb` برای سرعت نوشته نشده است و تقریباً به اندازه‌ی سایر " +"ماژول‌های پایگاه داده پرکاربرد نیست." -msgid "The :mod:`!dbm.dumb` module provides a persistent :class:`dict`-like interface which is written entirely in Python. Unlike other :mod:`!dbm` backends, such as :mod:`dbm.gnu`, no external library is required." +msgid "" +"The :mod:`!dbm.dumb` module provides a persistent :class:`dict`-like " +"interface which is written entirely in Python. Unlike other :mod:`!dbm` " +"backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" +"ماژول :mod:`!dbm.dumb` رابطی پایا شبیه به :class:`dict` فراهم می‌کند که " +"به‌طور کامل به زبان پایتون نوشته شده است. برخلاف سایر بک‌اندهای :mod:`!dbm`،" +" مانند :mod:`dbm.gnu`، نیازی به کتابخانه‌ی خارجی نیست." msgid "The :mod:`!dbm.dumb` module defines the following:" -msgstr "" +msgstr "ماژول :mod:`!dbm.dumb` موارد زیر را تعریف می‌کند:" -msgid "Raised on :mod:`!dbm.dumb`-specific errors, such as I/O errors. :exc:`KeyError` is raised for general mapping errors like specifying an incorrect key." +msgid "" +"Raised on :mod:`!dbm.dumb`-specific errors, such as I/O errors. " +":exc:`KeyError` is raised for general mapping errors like specifying an " +"incorrect key." msgstr "" +"در صورت بروز خطاهای مختص :mod:`!dbm.dumb`، مانند خطاهای ورودی/خروجی، پرتاب " +"می‌شود. :exc:`KeyError` برای خطاهای عمومی نگاشت، مانند مشخص کردن کلید " +"نادرست، پرتاب می‌شود." msgid "Open a :mod:`!dbm.dumb` database." -msgstr "" +msgstr "یک پایگاه داده‌ی :mod:`!dbm.dumb` را باز کنید." -msgid "The basename of the database file (without extensions). A new database creates the following files: - :file:`{filename}.dat` - :file:`{filename}.dir`" +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files: - :file:`{filename}.dat` - " +":file:`{filename}.dir`" msgstr "" +"نام پایه فایل پایگاه داده (بدون پسوندها). یک پایگاه داده جدید فایل‌های زیر " +"را ایجاد می‌کند: - :file:`{filename}.dat` - :file:`{filename}.dir`" -msgid "The basename of the database file (without extensions). A new database creates the following files:" +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files:" msgstr "" +"نام پایه‌ی فایل پایگاه داده (بدون پسوندها). یک پایگاه داده‌ی جدید فایل‌های زیر" +" را ایجاد می‌کند:" msgid ":file:`{filename}.dat`" -msgstr "" +msgstr ":file:`{filename}.dat`" msgid ":file:`{filename}.dir`" -msgstr "" +msgstr ":file:`{filename}.dir`" -msgid "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * ``'n'``: |flag_n|" +msgid "" +"* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " +"``'n'``: |flag_n|" msgstr "" +"* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (پیش‌فرض): |flag_c| * " +"``'n'``: |flag_n|" msgid "``'r'``: |flag_r|" -msgstr "" +msgstr "``'r'``: |flag_r|" msgid "``'c'`` (default): |flag_c|" -msgstr "" +msgstr "``'c'`` (پیش‌فرض): |flag_c|" -msgid "It is possible to crash the Python interpreter when loading a database with a sufficiently large/complex entry due to stack depth limitations in Python's AST compiler." +msgid "" +"It is possible to crash the Python interpreter when loading a database with " +"a sufficiently large/complex entry due to stack depth limitations in " +"Python's AST compiler." msgstr "" +"ممکن است بارگذاری پایگاه داده‌ای با یک ورودی به‌اندازه کافی بزرگ/پیچیده، به " +"دلیل محدودیت‌های عمق پشته در کامپایلر AST پایتون، باعث از کار افتادن مفسر " +"پایتون شود." -msgid ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." +msgid "" +":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" +":func:`~dbm.dumb.open` همیشه وقتی *flag* برابر ``'n'`` باشد، یک پایگاه داده " +"جدید ایجاد می‌کند." -msgid "A database opened read-only if *flag* is ``'r'``. A database is not created if it does not exist if *flag* is ``'r'`` or ``'w'``." +msgid "" +"A database opened read-only if *flag* is ``'r'``. A database is not created " +"if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" +"اگر *flag* برابر ``'r'`` باشد، پایگاه داده به‌صورت فقط‌خواندنی باز می‌شود. " +"اگر *flag* برابر ``'r'`` یا ``'w'`` باشد، در صورتی که پایگاه داده وجود " +"نداشته باشد، ایجاد نمی‌شود." -msgid "The returned database object behaves similar to a mutable :term:`mapping`, but the :meth:`!keys` and :meth:`!items` methods return lists, and the :meth:`!setdefault` method requires two arguments. It also supports a \"closing\" context manager via the :keyword:`with` keyword." +msgid "" +"The returned database object behaves similar to a mutable :term:`mapping`, " +"but the :meth:`!keys` and :meth:`!items` methods return lists, and the " +":meth:`!setdefault` method requires two arguments. It also supports a " +"\"closing\" context manager via the :keyword:`with` keyword." msgstr "" +"شیء پایگاه داده‌ی برگردانده‌شده مانند یک :term:`نگاشت ` تغییرپذیر " +"رفتار می‌کند، اما متدهای :meth:`!keys` و :meth:`!items` فهرست‌ها را " +"برمی‌گردانند و متد :meth:`!setdefault` به دو آرگومان نیاز دارد. همچنین از یک" +" مدیر زمینه‌ی «بستن» از طریق کلیدواژه‌ی :keyword:`with` پشتیبانی می‌کند." msgid "Close the database." -msgstr "" +msgstr "پایگاه داده را ببندید." -msgid "Synchronize the on-disk directory and data files. This method is called by the :meth:`shelve.Shelf.sync` method." +msgid "" +"Synchronize the on-disk directory and data files. This method is called by " +"the :meth:`shelve.Shelf.sync` method." msgstr "" +"پوشه و فایل‌های داده روی دیسک را همگام‌سازی می‌کند. این متد توسط متد " +":meth:`shelve.Shelf.sync` فراخوانی می‌شود." msgid "databases" -msgstr "" +msgstr "پایگاه‌های داده" diff --git a/library/debug.po b/library/debug.po index a28a2ca51..b8ae3587f 100644 --- a/library/debug.po +++ b/library/debug.po @@ -22,7 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Debugging and Profiling" -msgstr "" +msgstr "اشکال‌زدایی و پروفایل‌گیری" -msgid "These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed breakdown of execution times, allowing you to identify bottlenecks in your programs. Auditing events provide visibility into runtime behaviors that would otherwise require intrusive debugging or patching." +msgid "" +"These libraries help you with Python development: the debugger enables you " +"to step through code, analyze stack frames and set breakpoints etc., and the" +" profilers run code and give you a detailed breakdown of execution times, " +"allowing you to identify bottlenecks in your programs. Auditing events " +"provide visibility into runtime behaviors that would otherwise require " +"intrusive debugging or patching." msgstr "" +"این کتابخانه‌ها به شما در توسعه پایتون کمک می‌کنند: اشکال‌زدا به شما امکان " +"می‌دهد کد را گام‌به‌گام اجرا کنید، فریم‌های پشته را تحلیل کنید و نقاط توقف " +"را تنظیم کنید و غیره، و پروفایل‌گیرها (profilers) کد را اجرا می‌کنند و تفکیک " +"دقیقی از زمان‌های اجرا به شما ارائه می‌دهند تا بتوانید گلوگاه‌های " +"برنامه‌هایتان را شناسایی کنید. رویدادهای حسابرسی، دیدی نسبت به رفتارهای " +"ران‌تایم فراهم می‌کنند که در غیر این صورت به اشکال‌زدایی یا وصله‌کردن " +"مداخله‌جویانه نیاز داشت." diff --git a/library/decimal.po b/library/decimal.po index 956a8658b..02a7b055f 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"PO-Revision-Date: 2026-08-28 10:07+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,60 +23,184 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!decimal` --- Decimal fixed-point and floating-point arithmetic" -msgstr "" +msgstr ":mod:`!decimal` --- حساب دهدهی ممیز ثابت و ممیز شناور" msgid "**Source code:** :source:`Lib/decimal.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/decimal.py`" -msgid "The :mod:`!decimal` module provides support for fast correctly rounded decimal floating-point arithmetic. It offers several advantages over the :class:`float` datatype:" +msgid "" +"The :mod:`!decimal` module provides support for fast correctly rounded decimal " +"floating-point arithmetic. It offers several advantages over the :class:`float` " +"datatype:" msgstr "" +"ماژول :mod:`!decimal` پشتیبانی از محاسبات ممیز شناور اعشاری سریع و با گرد کردن " +"صحیح را فراهم می‌کند. این ماژول چندین مزیت نسبت به نوع داده :class:`float` دارد:" -msgid "Decimal \"is based on a `floating-point model `__ which was designed with people in mind, and necessarily has a paramount guiding principle -- computers must provide an arithmetic that works in the same way as the arithmetic that people learn at school.\" -- excerpt from the decimal arithmetic specification." -msgstr "" +msgid "" +"Decimal \"is based on a `floating-point model `__ which was designed with people in mind, and " +"necessarily has a paramount guiding principle -- computers must provide an " +"arithmetic that works in the same way as the arithmetic that people learn at " +"school.\" -- excerpt from the decimal arithmetic specification." +msgstr "" +"Decimal «بر اساس یک `مدل ممیز شناور `__ است که با در نظر گرفتن انسان‌ها طراحی شده و لزوماً " +"دارای یک اصل راهنمای برتر است -- رایانه‌ها باید حسابی فراهم کنند که به همان " +"شیوه‌ای کار کند که حسابی که مردم در مدرسه می‌آموزند، کار می‌کند.» -- گزیده‌ای از " +"مشخصات حساب اعشاری." -msgid "Decimal numbers can be represented exactly. In contrast, numbers like ``1.1`` and ``2.2`` do not have exact representations in binary floating point. End users typically would not expect ``1.1 + 2.2`` to display as ``3.3000000000000003`` as it does with binary floating point." +msgid "" +"Decimal numbers can be represented exactly. In contrast, numbers like ``1.1`` " +"and ``2.2`` do not have exact representations in binary floating point. End " +"users typically would not expect ``1.1 + 2.2`` to display as " +"``3.3000000000000003`` as it does with binary floating point." msgstr "" +"اعداد دهدهی را می‌توان به‌صورت دقیق بازنمایی کرد. در مقابل، اعدادی مانند ``1.1`` " +"و ``2.2`` بازنمایی دقیقی در ممیز شناور دودویی ندارند. کاربران نهایی معمولاً " +"انتظار ندارند ``1.1 + 2.2`` به‌صورت ``3.3000000000000003`` نمایش داده شود، " +"همان‌گونه که در ممیز شناور دودویی رخ می‌دهد." -msgid "The exactness carries over into arithmetic. In decimal floating point, ``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating point, the result is ``5.5511151231257827e-017``. While near to zero, the differences prevent reliable equality testing and differences can accumulate. For this reason, decimal is preferred in accounting applications which have strict equality invariants." -msgstr "" +msgid "" +"The exactness carries over into arithmetic. In decimal floating point, ``0.1 + " +"0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating point, the " +"result is ``5.5511151231257827e-017``. While near to zero, the differences " +"prevent reliable equality testing and differences can accumulate. For this " +"reason, decimal is preferred in accounting applications which have strict " +"equality invariants." +msgstr "" +"این دقت در محاسبات حسابی نیز برقرار است. در ممیز شناور اعشاری، ``0.1 + 0.1 + " +"0.1 - 0.3`` دقیقاً برابر با صفر است. در ممیز شناور دودویی، نتیجه " +"``5.5511151231257827e-017`` است. هرچند به صفر نزدیک است، اما این تفاوت‌ها مانع " +"از بررسی برابری قابل‌اعتماد می‌شوند و ممکن است انباشته شوند. به همین دلیل، ممیز " +"شناور اعشاری در برنامه‌های حسابداری که دارای ناورداهای برابری دقیق هستند، ترجیح " +"داده می‌شود." -msgid "The decimal module incorporates a notion of significant places so that ``1.30 + 1.20`` is ``2.50``. The trailing zero is kept to indicate significance. This is the customary presentation for monetary applications. For multiplication, the \"schoolbook\" approach uses all the figures in the multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * 1.20`` gives ``1.5600``." -msgstr "" +msgid "" +"The decimal module incorporates a notion of significant places so that ``1.30 + " +"1.20`` is ``2.50``. The trailing zero is kept to indicate significance. This " +"is the customary presentation for monetary applications. For multiplication, " +"the \"schoolbook\" approach uses all the figures in the multiplicands. For " +"instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * 1.20`` gives ``1.5600``." +msgstr "" +"ماژول decimal مفهوم ارقام معنادار را در بر می‌گیرد، به‌طوری‌که ``1.30 + 1.20`` " +"برابر ``2.50`` است. صفر پایانی برای نشان دادن معناداری حفظ می‌شود. این نمایش " +"مرسوم برای کاربردهای مالی است. برای ضرب، روش «کتاب درسی» از تمام ارقام عوامل " +"ضرب استفاده می‌کند. برای مثال، ``1.3 * 1.2`` مقدار ``1.56`` را می‌دهد، در حالی که " +"``1.30 * 1.20`` مقدار ``1.5600`` را می‌دهد." -msgid "Unlike hardware based binary floating point, the decimal module has a user alterable precision (defaulting to 28 places) which can be as large as needed for a given problem:" +msgid "" +"Unlike hardware based binary floating point, the decimal module has a user " +"alterable precision (defaulting to 28 places) which can be as large as needed " +"for a given problem:" msgstr "" +"برخلاف ممیز شناور دودویی مبتنی بر سخت‌افزار، ماژول decimal دارای دقت قابل تغییر " +"توسط کاربر (با پیش‌فرض ۲۸ رقم اعشار) است که می‌تواند به هر اندازه‌ای که برای یک " +"مسئله مشخص لازم باشد، بزرگ باشد:" -msgid "Both binary and decimal floating point are implemented in terms of published standards. While the built-in float type exposes only a modest portion of its capabilities, the decimal module exposes all required parts of the standard. When needed, the programmer has full control over rounding and signal handling. This includes an option to enforce exact arithmetic by using exceptions to block any inexact operations." -msgstr "" +msgid "" +"Both binary and decimal floating point are implemented in terms of published " +"standards. While the built-in float type exposes only a modest portion of its " +"capabilities, the decimal module exposes all required parts of the standard. " +"When needed, the programmer has full control over rounding and signal handling. " +"This includes an option to enforce exact arithmetic by using exceptions to " +"block any inexact operations." +msgstr "" +"هر دو نوع ممیز شناور دودویی و اعشاری بر اساس استانداردهای منتشرشده پیاده‌سازی " +"شده‌اند. در حالی که نوع float توکار تنها بخش محدودی از قابلیت‌های خود را در " +"اختیار می‌گذارد، ماژول decimal تمام بخش‌های مورد نیاز استاندارد را در اختیار " +"می‌گذارد. در صورت نیاز، برنامه‌نویس کنترل کاملی بر گرد کردن و مدیریت سیگنال دارد. " +"این شامل گزینه‌ای برای اعمال حساب دقیق با استفاده از استثناها جهت مسدود کردن " +"هرگونه عملیات غیردقیق است." -msgid "The decimal module was designed to support \"without prejudice, both exact unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and rounded floating-point arithmetic.\" -- excerpt from the decimal arithmetic specification." +msgid "" +"The decimal module was designed to support \"without prejudice, both exact " +"unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and " +"rounded floating-point arithmetic.\" -- excerpt from the decimal arithmetic " +"specification." msgstr "" +"ماژول decimal طراحی شده است تا «بدون جانبداری، هم از حساب اعشاری دقیق و بدون " +"گرد کردن (که گاهی حساب ممیز ثابت نامیده می‌شود) و هم از حساب ممیز شناور گردشده» " +"پشتیبانی کند. — گزیده‌ای از مشخصات حساب اعشاری." -msgid "The module design is centered around three concepts: the decimal number, the context for arithmetic, and signals." +msgid "" +"The module design is centered around three concepts: the decimal number, the " +"context for arithmetic, and signals." msgstr "" +"طراحی ماژول بر سه مفهوم متمرکز است: عدد اعشاری، زمینه محاسبات، و سیگنال‌ها." -msgid "A decimal number is immutable. It has a sign, coefficient digits, and an exponent. To preserve significance, the coefficient digits do not truncate trailing zeros. Decimals also include special values such as ``Infinity``, ``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from ``+0``." +msgid "" +"A decimal number is immutable. It has a sign, coefficient digits, and an " +"exponent. To preserve significance, the coefficient digits do not truncate " +"trailing zeros. Decimals also include special values such as ``Infinity``, ``-" +"Infinity``, and ``NaN``. The standard also differentiates ``-0`` from ``+0``." msgstr "" +"یک عدد ده‌دهی تغییرناپذیر است. این عدد دارای علامت، ارقام ضریب و توان است. برای " +"حفظ معناداری، صفرهای انتهایی از ارقام ضریب حذف نمی‌شوند. اعداد ده‌دهی همچنین شامل " +"مقادیر خاصی مانند ``Infinity``، ``-Infinity`` و ``NaN`` هستند. این استاندارد " +"همچنین ``-0`` را از ``+0`` متمایز می‌کند." -msgid "The context for arithmetic is an environment specifying precision, rounding rules, limits on exponents, flags indicating the results of operations, and trap enablers which determine whether signals are treated as exceptions. Rounding options include :const:`ROUND_CEILING`, :const:`ROUND_DOWN`, :const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`, :const:`ROUND_HALF_UP`, :const:`ROUND_UP`, and :const:`ROUND_05UP`." -msgstr "" +msgid "" +"The context for arithmetic is an environment specifying precision, rounding " +"rules, limits on exponents, flags indicating the results of operations, and " +"trap enablers which determine whether signals are treated as exceptions. " +"Rounding options " +"include :const:`ROUND_CEILING`, :const:`ROUND_DOWN`, :const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`, :const:`ROUND_HALF_UP`, :const:`ROUND_UP`, " +"and :const:`ROUND_05UP`." +msgstr "" +"زمینه‌ی محاسبات، محیطی است که دقت، قواعد گرد کردن، محدودیت‌های توان‌ها، " +"پرچم‌های نشان‌دهنده‌ی نتایج عملیات و فعال‌سازهای تله را مشخص می‌کند؛ " +"فعال‌سازهای تله تعیین می‌کنند که آیا سیگنال‌ها به‌عنوان استثنا در نظر گرفته " +"می‌شوند یا خیر. گزینه‌های گرد کردن " +"شامل :const:`ROUND_CEILING`، :const:`ROUND_DOWN`، :const:`ROUND_FLOOR`، " +":const:`ROUND_HALF_DOWN`، :const:`ROUND_HALF_EVEN`، " +":const:`ROUND_HALF_UP`، :const:`ROUND_UP` و :const:`ROUND_05UP` هستند." -msgid "Signals are groups of exceptional conditions arising during the course of computation. Depending on the needs of the application, signals may be ignored, considered as informational, or treated as exceptions. The signals in the decimal module are: :const:`Clamped`, :const:`InvalidOperation`, :const:`DivisionByZero`, :const:`Inexact`, :const:`Rounded`, :const:`Subnormal`, :const:`Overflow`, :const:`Underflow` and :const:`FloatOperation`." -msgstr "" +msgid "" +"Signals are groups of exceptional conditions arising during the course of " +"computation. Depending on the needs of the application, signals may be " +"ignored, considered as informational, or treated as exceptions. The signals in " +"the decimal module " +"are: :const:`Clamped`, :const:`InvalidOperation`, :const:`DivisionByZero`, :const:`Inexact`, :const:`Rounded`, :const:`Subnormal`, :const:`Overflow`, :const:`Underflow` " +"and :const:`FloatOperation`." +msgstr "" +"سیگنال‌ها گروه‌هایی از شرایط استثنایی هستند که در طول محاسبات رخ می‌دهند. بسته به " +"نیازهای برنامه، ممکن است سیگنال‌ها نادیده گرفته شوند، به‌عنوان اطلاع‌رسانی در نظر " +"گرفته شوند، یا به‌عنوان استثنا مدیریت شوند. سیگنال‌های ماژول decimal عبارتند " +"از: :const:`Clamped`، :const:`InvalidOperation`، :const:`DivisionByZero`، :const:`Inexact`، :const:`Rounded`، :const:`Subnormal`، :const:`Overflow`، :const:`Underflow` " +"و :const:`FloatOperation`." -msgid "For each signal there is a flag and a trap enabler. When a signal is encountered, its flag is set to one, then, if the trap enabler is set to one, an exception is raised. Flags are sticky, so the user needs to reset them before monitoring a calculation." +msgid "" +"For each signal there is a flag and a trap enabler. When a signal is " +"encountered, its flag is set to one, then, if the trap enabler is set to one, " +"an exception is raised. Flags are sticky, so the user needs to reset them " +"before monitoring a calculation." msgstr "" +"برای هر سیگنال، یک پرچم و یک فعال‌ساز تله وجود دارد. هنگامی که یک سیگنال " +"رخ می‌دهد، پرچم آن روی ۱ تنظیم می‌شود؛ سپس اگر فعال‌ساز تله روی ۱ تنظیم شده " +"باشد، یک استثنا پرتاب می‌شود. پرچم‌ها پایا هستند، بنابراین کاربر باید پیش از " +"پایش یک محاسبه، آن‌ها را بازنشانی کند." -msgid "IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic Specification `_." +msgid "" +"IBM's General Decimal Arithmetic Specification, `The General Decimal Arithmetic " +"Specification `_." msgstr "" +"مشخصات حساب اعشاری عمومی IBM، `The General Decimal Arithmetic Specification " +"`_." msgid "Quick-start tutorial" -msgstr "" +msgstr "آموزش شروع سریع" -msgid "The usual start to using decimals is importing the module, viewing the current context with :func:`getcontext` and, if necessary, setting new values for precision, rounding, or enabled traps::" +msgid "" +"The usual start to using decimals is importing the module, viewing the current " +"context with :func:`getcontext` and, if necessary, setting new values for " +"precision, rounding, or enabled traps::" msgstr "" +"آغاز معمول استفاده از اعداد اعشاری، ایمپورت کردن ماژول، مشاهده‌ی زمینه‌ی فعلی " +"با :func:`getcontext` و، در صورت لزوم، تنظیم مقادیر جدید برای دقت، گرد کردن، یا " +"تله‌های فعال است::" msgid "" ">>> from decimal import *\n" @@ -87,9 +211,25 @@ msgid "" "\n" ">>> getcontext().prec = 7 # Set a new precision" msgstr "" +">>> from decimal import *\n" +">>> getcontext()\n" +"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n" +" InvalidOperation])\n" +"\n" +">>> getcontext().prec = 7 # Set a new precision" -msgid "Decimal instances can be constructed from integers, strings, floats, or tuples. Construction from an integer or a float performs an exact conversion of the value of that integer or float. Decimal numbers include special values such as ``NaN`` which stands for \"Not a number\", positive and negative ``Infinity``, and ``-0``::" +msgid "" +"Decimal instances can be constructed from integers, strings, floats, or tuples. " +"Construction from an integer or a float performs an exact conversion of the " +"value of that integer or float. Decimal numbers include special values such as " +"``NaN`` which stands for \"Not a number\", positive and negative ``Infinity``, " +"and ``-0``::" msgstr "" +"نمونه‌های Decimal را می‌توان از اعداد صحیح، رشته‌ها، اعداد اعشاری یا تاپل‌ها ساخت. " +"ساخت از یک عدد صحیح یا عدد اعشاری، تبدیل دقیق مقدار آن عدد صحیح یا عدد اعشاری " +"را انجام می‌دهد. اعداد Decimal شامل مقادیر ویژه‌ای مانند ``NaN`` هستند که مخفف " +"«Not a number» است، همچنین ``Infinity`` مثبت و منفی، و ``-0``::" msgid "" ">>> getcontext().prec = 28\n" @@ -110,9 +250,30 @@ msgid "" ">>> Decimal('-Infinity')\n" "Decimal('-Infinity')" msgstr "" +">>> getcontext().prec = 28\n" +">>> Decimal(10)\n" +"Decimal('10')\n" +">>> Decimal('3.14')\n" +"Decimal('3.14')\n" +">>> Decimal(3.14)\n" +"Decimal('3.140000000000000124344978758017532527446746826171875')\n" +">>> Decimal((0, (3, 1, 4), -2))\n" +"Decimal('3.14')\n" +">>> Decimal(str(2.0 ** 0.5))\n" +"Decimal('1.4142135623730951')\n" +">>> Decimal(2) ** Decimal('0.5')\n" +"Decimal('1.414213562373095048801688724')\n" +">>> Decimal('NaN')\n" +"Decimal('NaN')\n" +">>> Decimal('-Infinity')\n" +"Decimal('-Infinity')" -msgid "If the :exc:`FloatOperation` signal is trapped, accidental mixing of decimals and floats in constructors or ordering comparisons raises an exception::" +msgid "" +"If the :exc:`FloatOperation` signal is trapped, accidental mixing of decimals " +"and floats in constructors or ordering comparisons raises an exception::" msgstr "" +"اگر سیگنال :exc:`FloatOperation` به دام بیفتد، ترکیب ناخواسته‌ی decimalها و " +"floatها در سازنده‌ها یا مقایسه‌های ترتیبی باعث پرتاب یک استثنا می‌شود::" msgid "" ">>> c = getcontext()\n" @@ -128,9 +289,26 @@ msgid "" ">>> Decimal('3.5') == 3.5\n" "True" msgstr "" +">>> c = getcontext()\n" +">>> c.traps[FloatOperation] = True\n" +">>> Decimal(3.14)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') < 3.7\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') == 3.5\n" +"True" -msgid "The significance of a new Decimal is determined solely by the number of digits input. Context precision and rounding only come into play during arithmetic operations." +msgid "" +"The significance of a new Decimal is determined solely by the number of digits " +"input. Context precision and rounding only come into play during arithmetic " +"operations." msgstr "" +"معناداری یک Decimal جدید صرفاً با تعداد ارقام ورودی تعیین می‌شود. دقت و گرد کردن " +"زمینه فقط در حین عملیات حسابی اعمال می‌شوند." msgid "" ">>> getcontext().prec = 6\n" @@ -144,9 +322,23 @@ msgid "" ">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" "Decimal('5.85988')" msgstr "" +">>> getcontext().prec = 6\n" +">>> Decimal('3.0')\n" +"Decimal('3.0')\n" +">>> Decimal('3.1415926535')\n" +"Decimal('3.1415926535')\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85987')\n" +">>> getcontext().rounding = ROUND_UP\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85988')" -msgid "If the internal limits of the C version are exceeded, constructing a decimal raises :class:`InvalidOperation`::" +msgid "" +"If the internal limits of the C version are exceeded, constructing a decimal " +"raises :class:`InvalidOperation`::" msgstr "" +"در صورت تجاوز از محدودیت‌های داخلی نسخه C، ساخت یک decimal باعث " +"پرتاب :class:`InvalidOperation` می‌شود::" msgid "" ">>> Decimal(\"1e9999999999999999999\")\n" @@ -154,9 +346,17 @@ msgid "" " File \"\", line 1, in \n" "decimal.InvalidOperation: []" msgstr "" +">>> Decimal(\"1e9999999999999999999\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.InvalidOperation: []" -msgid "Decimals interact well with much of the rest of Python. Here is a small decimal floating-point flying circus:" +msgid "" +"Decimals interact well with much of the rest of Python. Here is a small " +"decimal floating-point flying circus:" msgstr "" +"دسیمال‌ها با بسیاری از بخش‌های دیگر پایتون به‌خوبی تعامل می‌کنند. در اینجا یک سیرک " +"پرنده کوچک ممیز شناور دسیمال آمده است:" msgid "" ">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" @@ -185,9 +385,40 @@ msgid "" ">>> c % a\n" "Decimal('0.77')" msgstr "" +">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" +">>> max(data)\n" +"Decimal('9.25')\n" +">>> min(data)\n" +"Decimal('0.03')\n" +">>> sorted(data)\n" +"[Decimal('0.03'), Decimal('1.00'), Decimal('1.34'), Decimal('1.87'),\n" +" Decimal('2.35'), Decimal('3.45'), Decimal('9.25')]\n" +">>> sum(data)\n" +"Decimal('19.29')\n" +">>> a,b,c = data[:3]\n" +">>> str(a)\n" +"'1.34'\n" +">>> float(a)\n" +"1.34\n" +">>> round(a, 1)\n" +"Decimal('1.3')\n" +">>> int(a)\n" +"1\n" +">>> a * 5\n" +"Decimal('6.70')\n" +">>> a * b\n" +"Decimal('2.5058')\n" +">>> c % a\n" +"Decimal('0.77')" -msgid "Decimals can be formatted (with :func:`format` built-in or :ref:`f-strings`) in fixed-point or scientific notation, using the same formatting syntax (see :ref:`formatspec`) as builtin :class:`float` type:" +msgid "" +"Decimals can be formatted (with :func:`format` built-in or :ref:`f-strings`) in " +"fixed-point or scientific notation, using the same formatting syntax " +"(see :ref:`formatspec`) as builtin :class:`float` type:" msgstr "" +"دسیمال‌ها را می‌توان (با تابع توکار :func:`format` یا :ref:`f-strings`) به‌صورت " +"نماد ممیز ثابت یا علمی قالب‌بندی کرد، با استفاده از همان نحو قالب‌بندی (مراجعه " +"کنید به :ref:`formatspec`) که نوع توکار :class:`float` دارد:" msgid "" ">>> format(Decimal('2.675'), \"f\")\n" @@ -204,21 +435,59 @@ msgid "" "...\n" "2.67" msgstr "" +">>> format(Decimal('2.675'), \"f\")\n" +"'2.675'\n" +">>> format(Decimal('2.675'), \".2f\")\n" +"'2.68'\n" +">>> f\"{Decimal('2.675'):.2f}\"\n" +"'2.68'\n" +">>> format(Decimal('2.675'), \".2e\")\n" +"'2.68e+0'\n" +">>> with localcontext() as ctx:\n" +"... ctx.rounding = ROUND_DOWN\n" +"... print(format(Decimal('2.675'), \".2f\"))\n" +"...\n" +"2.67" msgid "And some mathematical functions are also available to Decimal:" -msgstr "" +msgstr "و برخی از توابع ریاضی نیز برای Decimal در دسترس هستند:" -msgid "The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. This method is useful for monetary applications that often round results to a fixed number of places:" +msgid "" +"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. This " +"method is useful for monetary applications that often round results to a fixed " +"number of places:" msgstr "" +"متد :meth:`~Decimal.quantize` یک عدد را به یک توان ثابت گرد می‌کند. این متد برای " +"کاربردهای مالی که اغلب نتایج را به تعداد ثابتی از ارقام اعشار گرد می‌کنند، مفید " +"است:" -msgid "As shown above, the :func:`getcontext` function accesses the current context and allows the settings to be changed. This approach meets the needs of most applications." +msgid "" +"As shown above, the :func:`getcontext` function accesses the current context " +"and allows the settings to be changed. This approach meets the needs of most " +"applications." msgstr "" +"همان‌طور که در بالا نشان داده شد، تابع :func:`getcontext` به زمینه‌ی جاری دسترسی " +"پیدا می‌کند و امکان تغییر تنظیمات را فراهم می‌کند. این رویکرد نیازهای بیشتر " +"برنامه‌های کاربردی را برآورده می‌کند." -msgid "For more advanced work, it may be useful to create alternate contexts using the :meth:`Context` constructor. To make an alternate active, use the :func:`setcontext` function." +msgid "" +"For more advanced work, it may be useful to create alternate contexts using " +"the :meth:`Context` constructor. To make an alternate active, use " +"the :func:`setcontext` function." msgstr "" +"برای کارهای پیشرفته‌تر، ممکن است ایجاد زمینه‌های جایگزین با استفاده از " +"سازنده‌ی :meth:`Context` مفید باشد. برای فعال کردن یک زمینه جایگزین، از " +"تابع :func:`setcontext` استفاده کنید." -msgid "In accordance with the standard, the :mod:`!decimal` module provides two ready to use standard contexts, :const:`BasicContext` and :const:`ExtendedContext`. The former is especially useful for debugging because many of the traps are enabled:" +msgid "" +"In accordance with the standard, the :mod:`!decimal` module provides two ready " +"to use standard contexts, :const:`BasicContext` and :const:`ExtendedContext`. " +"The former is especially useful for debugging because many of the traps are " +"enabled:" msgstr "" +"مطابق با استاندارد، ماژول :mod:`!decimal` دو زمینه استاندارد آماده " +"استفاده، :const:`BasicContext` و :const:`ExtendedContext` را فراهم می‌کند. مورد " +"اول به‌ویژه برای اشکال‌زدایی مفید است، زیرا بسیاری از تله‌ها فعال هستند:" msgid "" ">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" @@ -242,9 +511,37 @@ msgid "" " Decimal(42) / Decimal(0)\n" "DivisionByZero: x / 0" msgstr "" +">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" +">>> setcontext(myothercontext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857142857142857142857142857')\n" +"\n" +">>> ExtendedContext\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[])\n" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857143')\n" +">>> Decimal(42) / Decimal(0)\n" +"Decimal('Infinity')\n" +"\n" +">>> setcontext(BasicContext)\n" +">>> Decimal(42) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(42) / Decimal(0)\n" +"DivisionByZero: x / 0" -msgid "Contexts also have signal flags for monitoring exceptional conditions encountered during computations. The flags remain set until explicitly cleared, so it is best to clear the flags before each set of monitored computations by using the :meth:`~Context.clear_flags` method. ::" +msgid "" +"Contexts also have signal flags for monitoring exceptional conditions " +"encountered during computations. The flags remain set until explicitly " +"cleared, so it is best to clear the flags before each set of monitored " +"computations by using the :meth:`~Context.clear_flags` method. ::" msgstr "" +"زمینه‌ها همچنین پرچم‌های سیگنال برای پایش شرایط استثنایی پیش‌آمده در حین محاسبات " +"دارند. این پرچم‌ها تا زمانی که به‌صراحت پاک نشوند، فعال باقی می‌مانند؛ بنابراین " +"بهتر است پیش از هر مجموعه‌ای از محاسبات تحت پایش، پرچم‌ها را با استفاده از " +"متد :meth:`~Context.clear_flags` پاک کنید. ::" msgid "" ">>> setcontext(ExtendedContext)\n" @@ -255,12 +552,29 @@ msgid "" "Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" " capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" msgstr "" +">>> setcontext(ExtendedContext)\n" +">>> getcontext().clear_flags()\n" +">>> Decimal(355) / Decimal(113)\n" +"Decimal('3.14159292')\n" +">>> getcontext()\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" -msgid "The *flags* entry shows that the rational approximation to pi was rounded (digits beyond the context precision were thrown away) and that the result is inexact (some of the discarded digits were non-zero)." +msgid "" +"The *flags* entry shows that the rational approximation to pi was rounded " +"(digits beyond the context precision were thrown away) and that the result is " +"inexact (some of the discarded digits were non-zero)." msgstr "" +"مدخل *flags* نشان می‌دهد که تقریب گویای عدد پی گرد شده است (ارقام فراتر از دقت " +"زمینه دور ریخته شدند) و نتیجه نادقیق است (برخی از ارقام دور ریخته‌شده غیرصفر " +"بودند)." -msgid "Individual traps are set using the dictionary in the :attr:`~Context.traps` attribute of a context:" +msgid "" +"Individual traps are set using the dictionary in the :attr:`~Context.traps` " +"attribute of a context:" msgstr "" +"تله‌های منفرد با استفاده از دیکشنری موجود در ویژگی :attr:`~Context.traps` یک " +"زمینه تنظیم می‌شوند:" msgid "" ">>> setcontext(ExtendedContext)\n" @@ -273,18 +587,46 @@ msgid "" " Decimal(1) / Decimal(0)\n" "DivisionByZero: x / 0" msgstr "" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(0)\n" +"Decimal('Infinity')\n" +">>> getcontext().traps[DivisionByZero] = 1\n" +">>> Decimal(1) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(1) / Decimal(0)\n" +"DivisionByZero: x / 0" -msgid "Most programs adjust the current context only once, at the beginning of the program. And, in many applications, data is converted to :class:`Decimal` with a single cast inside a loop. With context set and decimals created, the bulk of the program manipulates the data no differently than with other Python numeric types." +msgid "" +"Most programs adjust the current context only once, at the beginning of the " +"program. And, in many applications, data is converted to :class:`Decimal` with " +"a single cast inside a loop. With context set and decimals created, the bulk " +"of the program manipulates the data no differently than with other Python " +"numeric types." msgstr "" +"بیشتر برنامه‌ها زمینه‌ی جاری را تنها یک بار، در آغاز برنامه تنظیم می‌کنند. و در " +"بسیاری از برنامه‌های کاربردی، داده‌ها درون یک حلقه با یک تبدیل (cast) واحد " +"به :class:`Decimal` تبدیل می‌شوند. پس از تنظیم زمینه و ایجاد مقادیر Decimal، بخش " +"عمده‌ی برنامه داده‌ها را دقیقاً مانند سایر انواع عددی پایتون دستکاری می‌کند." msgid "Decimal objects" -msgstr "" +msgstr "اشیای Decimal" msgid "Construct a new :class:`Decimal` object based from *value*." -msgstr "" +msgstr "یک شیء جدید :class:`Decimal` بر اساس *value* بسازید." -msgid "*value* can be an integer, string, tuple, :class:`float`, or another :class:`Decimal` object. If no *value* is given, returns ``Decimal('0')``. If *value* is a string, it should conform to the decimal numeric string syntax after leading and trailing whitespace characters, as well as underscores throughout, are removed::" -msgstr "" +msgid "" +"*value* can be an integer, string, tuple, :class:`float`, or " +"another :class:`Decimal` object. If no *value* is given, returns " +"``Decimal('0')``. If *value* is a string, it should conform to the decimal " +"numeric string syntax after leading and trailing whitespace characters, as well " +"as underscores throughout, are removed::" +msgstr "" +"*value* می‌تواند یک عدد صحیح، رشته، تاپل ، :class:`float`، یا یک " +"شیء :class:`Decimal` دیگر باشد. اگر *value* ارائه نشود، ``Decimal('0')`` " +"برگردانده می‌شود. اگر *value* یک رشته باشد، باید پس از حذف نویسه‌های فضای سفید در " +"ابتدا و انتها، و همچنین زیرخط‌ها در سراسر آن، با نحو رشته عددی اعشاری مطابقت " +"کند::" msgid "" "sign ::= '+' | '-'\n" @@ -298,39 +640,121 @@ msgid "" "numeric-value ::= decimal-part [exponent-part] | infinity\n" "numeric-string ::= [sign] numeric-value | [sign] nan" msgstr "" +"sign ::= '+' | '-'\n" +"digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'\n" +"indicator ::= 'e' | 'E'\n" +"digits ::= digit [digit]...\n" +"decimal-part ::= digits '.' [digits] | ['.'] digits\n" +"exponent-part ::= indicator [sign] digits\n" +"infinity ::= 'Infinity' | 'Inf'\n" +"nan ::= 'NaN' [digits] | 'sNaN' [digits]\n" +"numeric-value ::= decimal-part [exponent-part] | infinity\n" +"numeric-string ::= [sign] numeric-value | [sign] nan" -msgid "Other Unicode decimal digits are also permitted where ``digit`` appears above. These include decimal digits from various other alphabets (for example, Arabic-Indic and Devanāgarī digits) along with the fullwidth digits ``'\\uff10'`` through ``'\\uff19'``. Case is not significant, so, for example, ``inf``, ``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable spellings for positive infinity." -msgstr "" +msgid "" +"Other Unicode decimal digits are also permitted where ``digit`` appears above. " +"These include decimal digits from various other alphabets (for example, Arabic-" +"Indic and Devanāgarī digits) along with the fullwidth digits ``'\\uff10'`` " +"through ``'\\uff19'``. Case is not significant, so, for example, ``inf``, " +"``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable spellings for " +"positive infinity." +msgstr "" +"سایر ارقام دهدهی یونیکد نیز در هر جایی که ``digit`` در بالا آمده است، مجاز " +"هستند. این موارد شامل ارقام دهدهی از الفباهای مختلف دیگر (برای مثال، ارقام عربی-" +"هندی و دوناگری) به‌همراه ارقام تمام‌عرض ``'\\uff10'`` تا ``'\\uff19'`` می‌شوند. " +"بزرگی و کوچکی حروف اهمیت ندارد، بنابراین، برای مثال، ``inf``، ``Inf``، " +"``INFINITY`` و ``iNfINity`` همگی نگارش‌های قابل‌قبول برای بی‌نهایت مثبت هستند." -msgid "If *value* is a :class:`tuple`, it should have three components, a sign (``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns ``Decimal('1.414')``." +msgid "" +"If *value* is a :class:`tuple`, it should have three components, a sign (``0`` " +"for positive or ``1`` for negative), a :class:`tuple` of digits, and an integer " +"exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " +"``Decimal('1.414')``." msgstr "" +"اگر *value* یک :class:`tuple` باشد، باید سه کامپوننت داشته باشد: یک علامت " +"(``0`` برای مثبت یا ``1`` برای منفی)، یک :class:`tuple` از ارقام، و یک توان عدد " +"صحیح. برای مثال، ``Decimal((0, (1, 4, 1, 4), -3))`` ``Decimal('1.414')`` را " +"برمی‌گرداند." -msgid "If *value* is a :class:`float`, the binary floating-point value is losslessly converted to its exact decimal equivalent. This conversion can often require 53 or more digits of precision. For example, ``Decimal(float('1.1'))`` converts to ``Decimal('1.100000000000000088817841970012523233890533447265625')``." -msgstr "" +msgid "" +"If *value* is a :class:`float`, the binary floating-point value is losslessly " +"converted to its exact decimal equivalent. This conversion can often require " +"53 or more digits of precision. For example, ``Decimal(float('1.1'))`` " +"converts to " +"``Decimal('1.100000000000000088817841970012523233890533447265625')``." +msgstr "" +"اگر *value* یک :class:`float` باشد، مقدار ممیز شناور دودویی بدون از دست دادن " +"دقت به معادل دهدهی دقیق خود تبدیل می‌شود. این تبدیل اغلب ممکن است به ۵۳ رقم دقت " +"یا بیشتر نیاز داشته باشد. برای مثال، ``Decimal(float('1.1'))`` به " +"``Decimal('1.100000000000000088817841970012523233890533447265625')`` تبدیل " +"می‌شود." -msgid "The *context* precision does not affect how many digits are stored. That is determined exclusively by the number of digits in *value*. For example, ``Decimal('3.00000')`` records all five zeros even if the context precision is only three." +msgid "" +"The *context* precision does not affect how many digits are stored. That is " +"determined exclusively by the number of digits in *value*. For example, " +"``Decimal('3.00000')`` records all five zeros even if the context precision is " +"only three." msgstr "" +"دقت *زمینه* بر تعداد ارقام ذخیره‌شده تأثیر نمی‌گذارد. این موضوع منحصراً بر اساس " +"تعداد ارقام موجود در *مقدار* تعیین می‌شود. برای مثال، ``Decimal('3.00000')`` حتی " +"اگر دقت زمینه فقط ۳ باشد، هر ۵ صفر را ثبت می‌کند." -msgid "The purpose of the *context* argument is determining what to do if *value* is a malformed string. If the context traps :const:`InvalidOperation`, an exception is raised; otherwise, the constructor returns a new Decimal with the value of ``NaN``." +msgid "" +"The purpose of the *context* argument is determining what to do if *value* is a " +"malformed string. If the context traps :const:`InvalidOperation`, an exception " +"is raised; otherwise, the constructor returns a new Decimal with the value of " +"``NaN``." msgstr "" +"هدف از آرگومان *context* تعیین این است که اگر *value* رشته‌ای نامعتبر باشد، چه " +"کاری انجام شود. اگر زمینه برای :const:`InvalidOperation` دام داشته باشد، یک " +"استثنا پرتاب می‌شود؛ در غیر این صورت، سازنده یک Decimal جدید با مقدار ``NaN`` " +"برمی‌گرداند." msgid "Once constructed, :class:`Decimal` objects are immutable." -msgstr "" +msgstr "پس از ساخته شدن، اشیای :class:`Decimal` تغییرناپذیر هستند." -msgid "The argument to the constructor is now permitted to be a :class:`float` instance." -msgstr "" +msgid "" +"The argument to the constructor is now permitted to be a :class:`float` " +"instance." +msgstr "آرگومان سازنده اکنون می‌تواند یک نمونه :class:`float` باشد." -msgid ":class:`float` arguments raise an exception if the :exc:`FloatOperation` trap is set. By default the trap is off." +msgid "" +":class:`float` arguments raise an exception if the :exc:`FloatOperation` trap " +"is set. By default the trap is off." msgstr "" +"آرگومان‌های :class:`float` در صورت تنظیم بودن تله‌ی :exc:`FloatOperation` " +"یک استثنا پرتاب می‌کنند. به‌طور پیش‌فرض، این تله غیرفعال است." -msgid "Underscores are allowed for grouping, as with integral and floating-point literals in code." +msgid "" +"Underscores are allowed for grouping, as with integral and floating-point " +"literals in code." msgstr "" +"زیرخط‌ها برای گروه‌بندی مجاز هستند، همان‌گونه که در مقادیر لفظی عدد صحیح و ممیز " +"شناور در کد استفاده می‌شوند." -msgid "Decimal floating-point objects share many properties with the other built-in numeric types such as :class:`float` and :class:`int`. All of the usual math operations and special methods apply. Likewise, decimal objects can be copied, pickled, printed, used as dictionary keys, used as set elements, compared, sorted, and coerced to another type (such as :class:`float` or :class:`int`)." -msgstr "" +msgid "" +"Decimal floating-point objects share many properties with the other built-in " +"numeric types such as :class:`float` and :class:`int`. All of the usual math " +"operations and special methods apply. Likewise, decimal objects can be copied, " +"pickled, printed, used as dictionary keys, used as set elements, compared, " +"sorted, and coerced to another type (such as :class:`float` or :class:`int`)." +msgstr "" +"اشیای ممیز شناور اعشاری بسیاری از ویژگی‌ها را با سایر انواع عددی توکار " +"مانند :class:`float` و :class:`int` به اشتراک می‌گذارند. تمام عملیات ریاضی معمول " +"و متدهای ویژه قابل اعمال هستند. به همین ترتیب، اشیای اعشاری را می‌توان کپی کرد، " +"پیکل کرد، چاپ کرد، به‌عنوان کلیدهای دیکشنری استفاده کرد، به‌عنوان عناصر مجموعه " +"استفاده کرد، مقایسه کرد، مرتب کرد و به نوع دیگری (مانند :class:`float` " +"یا :class:`int`) تبدیل کرد." -msgid "There are some small differences between arithmetic on Decimal objects and arithmetic on integers and floats. When the remainder operator ``%`` is applied to Decimal objects, the sign of the result is the sign of the *dividend* rather than the sign of the divisor::" +msgid "" +"There are some small differences between arithmetic on Decimal objects and " +"arithmetic on integers and floats. When the remainder operator ``%`` is " +"applied to Decimal objects, the sign of the result is the sign of the " +"*dividend* rather than the sign of the divisor::" msgstr "" +"تفاوت‌های کوچکی میان عملیات حسابی بر روی اشیای Decimal و عملیات حسابی بر روی " +"اعداد صحیح و اعداد اعشاری وجود دارد. هنگامی که عملگر باقی‌مانده ``%`` بر روی " +"اشیای Decimal اعمال شود، علامت نتیجه، علامت *مقسوم* است، نه علامت مقسوم‌علیه::" msgid "" ">>> (-7) % 4\n" @@ -338,9 +762,19 @@ msgid "" ">>> Decimal(-7) % Decimal(4)\n" "Decimal('-3')" msgstr "" +">>> (-7) % 4\n" +"1\n" +">>> Decimal(-7) % Decimal(4)\n" +"Decimal('-3')" -msgid "The integer division operator ``//`` behaves analogously, returning the integer part of the true quotient (truncating towards zero) rather than its floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::" +msgid "" +"The integer division operator ``//`` behaves analogously, returning the integer " +"part of the true quotient (truncating towards zero) rather than its floor, so " +"as to preserve the usual identity ``x == (x // y) * y + x % y``::" msgstr "" +"عملگر تقسیم عدد صحیح ``//`` به‌طور مشابه رفتار می‌کند و به جای کف خارج‌قسمت واقعی، " +"بخش عدد صحیح آن را (با قطع به سمت صفر) برمی‌گرداند تا اتحاد معمول ``x == (x // " +"y) * y + x % y`` حفظ شود::" msgid "" ">>> -7 // 4\n" @@ -348,41 +782,102 @@ msgid "" ">>> Decimal(-7) // Decimal(4)\n" "Decimal('-1')" msgstr "" +">>> -7 // 4\n" +"-2\n" +">>> Decimal(-7) // Decimal(4)\n" +"Decimal('-1')" -msgid "The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-integer`` operations (respectively) as described in the specification." +msgid "" +"The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" +"integer`` operations (respectively) as described in the specification." msgstr "" +"عملگرهای ``%`` و ``//`` به‌ترتیب عملیات ``remainder`` و ``divide-integer`` را " +"همان‌گونه که در مشخصات آمده است پیاده‌سازی می‌کنند." -msgid "Decimal objects cannot generally be combined with floats or instances of :class:`fractions.Fraction` in arithmetic operations: an attempt to add a :class:`Decimal` to a :class:`float`, for example, will raise a :exc:`TypeError`. However, it is possible to use Python's comparison operators to compare a :class:`Decimal` instance ``x`` with another number ``y``. This avoids confusing results when doing equality comparisons between numbers of different types." -msgstr "" +msgid "" +"Decimal objects cannot generally be combined with floats or instances " +"of :class:`fractions.Fraction` in arithmetic operations: an attempt to add " +"a :class:`Decimal` to a :class:`float`, for example, will raise " +"a :exc:`TypeError`. However, it is possible to use Python's comparison " +"operators to compare a :class:`Decimal` instance ``x`` with another number " +"``y``. This avoids confusing results when doing equality comparisons between " +"numbers of different types." +msgstr "" +"به‌طور کلی نمی‌توان اشیاء Decimal را در عملیات حسابی با floatها یا نمونه‌هایی " +"از :class:`fractions.Fraction` ترکیب کرد: برای مثال، تلاش برای جمع کردن " +"یک :class:`Decimal` با یک :class:`float` باعث پرتاب یک :exc:`TypeError` می‌شود. " +"با این حال، می‌توان از عملگرهای مقایسه‌ای پایتون برای مقایسه‌ی یک " +"نمونه‌ی :class:`Decimal` یعنی ``x`` با عدد دیگری ``y`` استفاده کرد. این کار از " +"بروز نتایج گیج‌کننده هنگام انجام مقایسه‌های برابری میان اعدادی از انواع مختلف " +"جلوگیری می‌کند." -msgid "Mixed-type comparisons between :class:`Decimal` instances and other numeric types are now fully supported." +msgid "" +"Mixed-type comparisons between :class:`Decimal` instances and other numeric " +"types are now fully supported." msgstr "" +"مقایسه‌های بین انواع مختلف میان نمونه‌های :class:`Decimal` و سایر انواع عددی " +"اکنون به‌طور کامل پشتیبانی می‌شوند." -msgid "In addition to the standard numeric properties, decimal floating-point objects also have a number of specialized methods:" +msgid "" +"In addition to the standard numeric properties, decimal floating-point objects " +"also have a number of specialized methods:" msgstr "" +"علاوه بر ویژگی‌های عددی استاندارد، اشیای ممیز شناور اعشاری تعدادی متد تخصصی نیز " +"دارند:" -msgid "Return the adjusted exponent after shifting out the coefficient's rightmost digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` returns seven. Used for determining the position of the most significant digit with respect to the decimal point." +msgid "" +"Return the adjusted exponent after shifting out the coefficient's rightmost " +"digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` " +"returns seven. Used for determining the position of the most significant digit " +"with respect to the decimal point." msgstr "" +"توان تنظیم‌شده را پس از حذف رقم‌های سمت راست ضریب تا جایی که تنها رقم نخست باقی " +"بماند، برمی‌گرداند: ``Decimal('321e+5').adjusted()`` عدد هفت را برمی‌گرداند. برای " +"تعیین موقعیت باارزش‌ترین رقم نسبت به نقطه اعشار استفاده می‌شود." -msgid "Return a pair ``(n, d)`` of integers that represent the given :class:`Decimal` instance as a fraction, in lowest terms and with a positive denominator::" +msgid "" +"Return a pair ``(n, d)`` of integers that represent the given :class:`Decimal` " +"instance as a fraction, in lowest terms and with a positive denominator::" msgstr "" +"یک جفت عدد صحیح ``(n, d)`` برمی‌گرداند که نمونه‌ی :class:`Decimal` داده‌شده را " +"به‌صورت کسر، در ساده‌ترین حالت و با مخرج مثبت نمایش می‌دهد::" msgid "" ">>> Decimal('-3.14').as_integer_ratio()\n" "(-157, 50)" msgstr "" +">>> Decimal('-3.14').as_integer_ratio()\n" +"(-157, 50)" -msgid "The conversion is exact. Raise OverflowError on infinities and ValueError on NaNs." +msgid "" +"The conversion is exact. Raise OverflowError on infinities and ValueError on " +"NaNs." msgstr "" +"این تبدیل دقیق است. برای بی‌نهایت‌ها، OverflowError و برای NaNها، ValueError " +"پرتاب می‌شود." -msgid "Return a :term:`named tuple` representation of the number: ``DecimalTuple(sign, digits, exponent)``." +msgid "" +"Return a :term:`named tuple` representation of the number: ``DecimalTuple(sign, " +"digits, exponent)``." msgstr "" +"نمایشی به‌صورت :term:`named tuple` از عدد برمی‌گرداند: ``DecimalTuple(sign, " +"digits, exponent)``." -msgid "Return the canonical encoding of the argument. Currently, the encoding of a :class:`Decimal` instance is always canonical, so this operation returns its argument unchanged." +msgid "" +"Return the canonical encoding of the argument. Currently, the encoding of " +"a :class:`Decimal` instance is always canonical, so this operation returns its " +"argument unchanged." msgstr "" +"کدگذاری کانونیکال (canonical) آرگومان را برمی‌گرداند. در حال حاضر، کدگذاری یک " +"نمونه‌ی :class:`Decimal` همیشه کانونیکال است، بنابراین این عملیات آرگومان خود را " +"بدون تغییر برمی‌گرداند." -msgid "Compare the values of two Decimal instances. :meth:`compare` returns a Decimal instance, and if either operand is a NaN then the result is a NaN::" +msgid "" +"Compare the values of two Decimal instances. :meth:`compare` returns a Decimal " +"instance, and if either operand is a NaN then the result is a NaN::" msgstr "" +"مقادیر دو نمونه از Decimal را مقایسه می‌کند. :meth:`compare` یک نمونه از Decimal " +"برمی‌گرداند، و اگر هر یک از دو عملوند NaN باشد، نتیجه NaN است::" msgid "" "a or b is a NaN ==> Decimal('NaN')\n" @@ -390,45 +885,126 @@ msgid "" "a == b ==> Decimal('0')\n" "a > b ==> Decimal('1')" msgstr "" +"a یا b یک NaN باشد ==> Decimal('NaN')\n" +"a < b ==> Decimal('-1')\n" +"a == b ==> Decimal('0')\n" +"a > b ==> Decimal('1')" -msgid "This operation is identical to the :meth:`compare` method, except that all NaNs signal. That is, if neither operand is a signaling NaN then any quiet NaN operand is treated as though it were a signaling NaN." +msgid "" +"This operation is identical to the :meth:`compare` method, except that all NaNs " +"signal. That is, if neither operand is a signaling NaN then any quiet NaN " +"operand is treated as though it were a signaling NaN." msgstr "" +"این عملیات دقیقاً مشابه متد :meth:`compare` است، با این تفاوت که همه NaNها " +"سیگنال‌دهی می‌کنند. یعنی، اگر هیچ‌کدام از عملوندها یک NaN سیگنال‌دهنده (signaling " +"NaN) نباشد، هر عملوند NaN ساکت (quiet NaN) به‌عنوان یک NaN سیگنال‌دهنده در نظر " +"گرفته می‌شود." -msgid "Compare two operands using their abstract representation rather than their numerical value. Similar to the :meth:`compare` method, but the result gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances with the same numeric value but different representations compare unequal in this ordering:" +msgid "" +"Compare two operands using their abstract representation rather than their " +"numerical value. Similar to the :meth:`compare` method, but the result gives a " +"total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances " +"with the same numeric value but different representations compare unequal in " +"this ordering:" msgstr "" +"دو عملوند را با استفاده از بازنمایی انتزاعی آن‌ها به جای مقدار عددی‌شان مقایسه " +"می‌کند. مشابه متد :meth:`compare`، اما نتیجه ترتیب کاملی بر " +"نمونه‌های :class:`Decimal` ارائه می‌دهد. دو نمونه‌ی :class:`Decimal` با مقدار عددی " +"یکسان اما بازنمایی‌های متفاوت، در این ترتیب نابرابر مقایسه می‌شوند:" -msgid "Quiet and signaling NaNs are also included in the total ordering. The result of this function is ``Decimal('0')`` if both operands have the same representation, ``Decimal('-1')`` if the first operand is lower in the total order than the second, and ``Decimal('1')`` if the first operand is higher in the total order than the second operand. See the specification for details of the total order." -msgstr "" +msgid "" +"Quiet and signaling NaNs are also included in the total ordering. The result " +"of this function is ``Decimal('0')`` if both operands have the same " +"representation, ``Decimal('-1')`` if the first operand is lower in the total " +"order than the second, and ``Decimal('1')`` if the first operand is higher in " +"the total order than the second operand. See the specification for details of " +"the total order." +msgstr "" +"NaNهای آرام (quiet) و سیگنال‌ده (signaling) نیز در ترتیب کامل گنجانده شده‌اند. " +"نتیجه این تابع ``Decimal('0')`` است اگر هر دو عملوند نمایش یکسانی داشته باشند، " +"``Decimal('-1')`` است اگر عملوند اول در ترتیب کامل پایین‌تر از عملوند دوم باشد، " +"و ``Decimal('1')`` است اگر عملوند اول در ترتیب کامل بالاتر از عملوند دوم باشد. " +"برای جزئیات ترتیب کامل، به مشخصات مراجعه کنید." -msgid "This operation is unaffected by context and is quiet: no flags are changed and no rounding is performed. As an exception, the C version may raise InvalidOperation if the second operand cannot be converted exactly." +msgid "" +"This operation is unaffected by context and is quiet: no flags are changed and " +"no rounding is performed. As an exception, the C version may raise " +"InvalidOperation if the second operand cannot be converted exactly." msgstr "" +"این عملیات تحت تأثیر زمینه قرار نمی‌گیرد و ساکت است: هیچ پرچمی تغییر نمی‌کند و " +"هیچ گردکردنی انجام نمی‌شود. به‌عنوان یک استثنا، نسخه‌ی C ممکن است در صورتی که " +"عملوند دوم نتواند به‌طور دقیق تبدیل شود، استثنای InvalidOperation را پرتاب کند." -msgid "Compare two operands using their abstract representation rather than their value as in :meth:`compare_total`, but ignoring the sign of each operand. ``x.compare_total_mag(y)`` is equivalent to ``x.copy_abs().compare_total(y.copy_abs())``." +msgid "" +"Compare two operands using their abstract representation rather than their " +"value as in :meth:`compare_total`, but ignoring the sign of each operand. " +"``x.compare_total_mag(y)`` is equivalent to " +"``x.copy_abs().compare_total(y.copy_abs())``." msgstr "" +"دو عملوند را همانند :meth:`compare_total` با استفاده از نمایش انتزاعی آن‌ها " +"مقایسه می‌کند، نه با استفاده از مقدارشان، اما علامت هر عملوند را نادیده می‌گیرد. " +"``x.compare_total_mag(y)`` معادل ``x.copy_abs().compare_total(y.copy_abs())`` " +"است." -msgid "Just returns self, this method is only to comply with the Decimal Specification." +msgid "" +"Just returns self, this method is only to comply with the Decimal Specification." msgstr "" +"فقط self را برمی‌گرداند؛ این متد تنها برای انطباق با Decimal Specification است." -msgid "Return the absolute value of the argument. This operation is unaffected by the context and is quiet: no flags are changed and no rounding is performed." +msgid "" +"Return the absolute value of the argument. This operation is unaffected by the " +"context and is quiet: no flags are changed and no rounding is performed." msgstr "" +"مقدار مطلق آرگومان را برمی‌گرداند. این عملیات از زمینه تأثیر نمی‌پذیرد و خاموش " +"است: هیچ پرچمی تغییر نمی‌کند و هیچ گردکردنی انجام نمی‌شود." -msgid "Return the negation of the argument. This operation is unaffected by the context and is quiet: no flags are changed and no rounding is performed." +msgid "" +"Return the negation of the argument. This operation is unaffected by the " +"context and is quiet: no flags are changed and no rounding is performed." msgstr "" +"منفی آرگومان را بازمی‌گرداند. این عملیات تحت تأثیر زمینه نیست و خاموش است: هیچ " +"پرچمی تغییر نمی‌کند و هیچ گردکردنی انجام نمی‌شود." -msgid "Return a copy of the first operand with the sign set to be the same as the sign of the second operand. For example:" +msgid "" +"Return a copy of the first operand with the sign set to be the same as the sign " +"of the second operand. For example:" msgstr "" +"یک کپی از عملوند اول را با علامتی که همان علامت عملوند دوم است برمی‌گرداند. برای " +"مثال:" -msgid "Return the value of the (natural) exponential function ``e**x`` at the given number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." +msgid "" +"Return the value of the (natural) exponential function ``e**x`` at the given " +"number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` " +"rounding mode." msgstr "" +"مقدار تابع نمایی (طبیعی) ``e**x`` را برای عدد داده‌شده برمی‌گرداند. نتیجه با " +"استفاده از حالت گرد کردن :const:`ROUND_HALF_EVEN` به‌درستی گرد می‌شود." -msgid "Alternative constructor that only accepts instances of :class:`float` or :class:`int`." +msgid "" +"Alternative constructor that only accepts instances of :class:`float` " +"or :class:`int`." msgstr "" +"سازنده جایگزینی که فقط نمونه‌هایی از :class:`float` یا :class:`int` را می‌پذیرد." -msgid "Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. Since 0.1 is not exactly representable in binary floating point, the value is stored as the nearest representable value which is ``0x1.999999999999ap-4``. That equivalent value in decimal is ``0.1000000000000000055511151231257827021181583404541015625``." -msgstr "" +msgid "" +"Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. Since " +"0.1 is not exactly representable in binary floating point, the value is stored " +"as the nearest representable value which is ``0x1.999999999999ap-4``. That " +"equivalent value in decimal is " +"``0.1000000000000000055511151231257827021181583404541015625``." +msgstr "" +"توجه داشته باشید که ``Decimal.from_float(0.1)`` با ``Decimal('0.1')`` یکسان " +"نیست. از آنجا که ۰٫۱ در نقطه‌شناور دودویی دقیقاً قابل بازنمایی نیست، مقدار به " +"نزدیک‌ترین مقدار قابل بازنمایی ذخیره می‌شود که ``0x1.999999999999ap-4`` است. " +"مقدار معادل آن در مبنای ده " +"``0.1000000000000000055511151231257827021181583404541015625`` است." -msgid "From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed directly from a :class:`float`." +msgid "" +"From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed " +"directly from a :class:`float`." msgstr "" +"از پایتون 3.2 به بعد، همچنین می‌توان یک نمونه :class:`Decimal` را مستقیماً از " +"یک :class:`float` ساخت." msgid "" ">>> Decimal.from_float(0.1)\n" @@ -440,9 +1016,21 @@ msgid "" ">>> Decimal.from_float(float('-inf'))\n" "Decimal('-Infinity')" msgstr "" +">>> Decimal.from_float(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_float(float('nan'))\n" +"Decimal('NaN')\n" +">>> Decimal.from_float(float('inf'))\n" +"Decimal('Infinity')\n" +">>> Decimal.from_float(float('-inf'))\n" +"Decimal('-Infinity')" -msgid "Alternative constructor that only accepts instances of :class:`float`, :class:`int` or :class:`Decimal`, but not strings or tuples." +msgid "" +"Alternative constructor that only accepts instances " +"of :class:`float`, :class:`int` or :class:`Decimal`, but not strings or tuples." msgstr "" +"سازنده جایگزینی که فقط نمونه‌های :class:`float`، :class:`int` " +"یا :class:`Decimal` را می‌پذیرد، اما رشته‌ها یا تاپل‌ها را نمی‌پذیرد." msgid "" ">>> Decimal.from_number(314)\n" @@ -452,207 +1040,499 @@ msgid "" ">>> Decimal.from_number(Decimal('3.14'))\n" "Decimal('3.14')" msgstr "" +">>> Decimal.from_number(314)\n" +"Decimal('314')\n" +">>> Decimal.from_number(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_number(Decimal('3.14'))\n" +"Decimal('3.14')" -msgid "Fused multiply-add. Return self*other+third with no rounding of the intermediate product self*other." +msgid "" +"Fused multiply-add. Return self*other+third with no rounding of the " +"intermediate product self*other." msgstr "" +"ضرب-جمع ادغام‌شده (Fused multiply-add). حاصل self*other+third را بدون گرد کردن " +"حاصل‌ضرب میانی self*other برمی‌گرداند." -msgid "Return :const:`True` if the argument is canonical and :const:`False` otherwise. Currently, a :class:`Decimal` instance is always canonical, so this operation always returns :const:`True`." +msgid "" +"Return :const:`True` if the argument is canonical and :const:`False` " +"otherwise. Currently, a :class:`Decimal` instance is always canonical, so this " +"operation always returns :const:`True`." msgstr "" +"اگر آرگومان کانونیکال (canonical) باشد، :const:`True` و در غیر این " +"صورت :const:`False` را برمی‌گرداند. در حال حاضر، یک نمونه از :class:`Decimal` " +"همیشه کانونیکال است، بنابراین این عملیات همیشه :const:`True` را برمی‌گرداند." -msgid "Return :const:`True` if the argument is a finite number, and :const:`False` if the argument is an infinity or a NaN." +msgid "" +"Return :const:`True` if the argument is a finite number, and :const:`False` if " +"the argument is an infinity or a NaN." msgstr "" +"اگر آرگومان یک عدد متناهی باشد، :const:`True` را برمی‌گرداند، و اگر آرگومان یک " +"بی‌نهایت یا NaN باشد، :const:`False` را برمی‌گرداند." -msgid "Return :const:`True` if the argument is either positive or negative infinity and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is either positive or negative infinity " +"and :const:`False` otherwise." msgstr "" +"اگر آرگومان بی‌نهایت مثبت یا منفی باشد، :const:`True` و در غیر این " +"صورت :const:`False` برمی‌گرداند." -msgid "Return :const:`True` if the argument is a (quiet or signaling) NaN and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is a (quiet or signaling) NaN " +"and :const:`False` otherwise." msgstr "" +"اگر آرگومان یک NaN (بی‌صدا یا سیگنال‌دهنده) باشد، :const:`True` و در غیر این " +"صورت :const:`False` را برمی‌گرداند." -msgid "Return :const:`True` if the argument is a *normal* finite number. Return :const:`False` if the argument is zero, subnormal, infinite or a NaN." +msgid "" +"Return :const:`True` if the argument is a *normal* finite number. " +"Return :const:`False` if the argument is zero, subnormal, infinite or a NaN." msgstr "" +"اگر آرگومان یک عدد متناهی *نرمال* باشد، :const:`True` را برمی‌گرداند. اگر " +"آرگومان صفر، زیرنرمال (subnormal)، بی‌نهایت یا یک NaN باشد، :const:`False` را " +"برمی‌گرداند." -msgid "Return :const:`True` if the argument is a quiet NaN, and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is a quiet NaN, and :const:`False` " +"otherwise." msgstr "" +"اگر آرگومان یک NaN ساکت (quiet NaN) باشد، :const:`True` و در غیر این " +"صورت :const:`False` را برمی‌گرداند." -msgid "Return :const:`True` if the argument has a negative sign and :const:`False` otherwise. Note that zeros and NaNs can both carry signs." +msgid "" +"Return :const:`True` if the argument has a negative sign and :const:`False` " +"otherwise. Note that zeros and NaNs can both carry signs." msgstr "" +"اگر آرگومان علامت منفی داشته باشد، :const:`True` و در غیر این " +"صورت :const:`False` بازمی‌گرداند. توجه داشته باشید که صفرها و NaNها هر دو " +"می‌توانند علامت داشته باشند." -msgid "Return :const:`True` if the argument is a signaling NaN and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is a signaling NaN and :const:`False` " +"otherwise." msgstr "" +"اگر آرگومان یک NaN سیگنال‌دهنده (signaling NaN) باشد، :const:`True` و در غیر این " +"صورت :const:`False` را برمی‌گرداند." -msgid "Return :const:`True` if the argument is subnormal, and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is subnormal, and :const:`False` otherwise." msgstr "" +"اگر آرگومان زیرنرمال (subnormal) باشد، :const:`True` و در غیر این " +"صورت :const:`False` را برمی‌گرداند." -msgid "Return :const:`True` if the argument is a (positive or negative) zero and :const:`False` otherwise." +msgid "" +"Return :const:`True` if the argument is a (positive or negative) zero " +"and :const:`False` otherwise." msgstr "" +"اگر آرگومان صفر (مثبت یا منفی) باشد، :const:`True` را برمی‌گرداند و در غیر این " +"صورت :const:`False` را برمی‌گرداند." -msgid "Return the natural (base e) logarithm of the operand. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." +msgid "" +"Return the natural (base e) logarithm of the operand. The result is correctly " +"rounded using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" +"لگاریتم طبیعی (مبنای e) عملوند را برمی‌گرداند. نتیجه با استفاده از حالت " +"گردکردن :const:`ROUND_HALF_EVEN` به‌درستی گرد می‌شود." -msgid "Return the base ten logarithm of the operand. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." +msgid "" +"Return the base ten logarithm of the operand. The result is correctly rounded " +"using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" +"لگاریتم عملوند در مبنای ۱۰ را برمی‌گرداند. نتیجه با استفاده از حالت گرد " +"کردن :const:`ROUND_HALF_EVEN` به‌درستی گرد می‌شود." -msgid "For a nonzero number, return the adjusted exponent of its operand as a :class:`Decimal` instance. If the operand is a zero then ``Decimal('-Infinity')`` is returned and the :const:`DivisionByZero` flag is raised. If the operand is an infinity then ``Decimal('Infinity')`` is returned." +msgid "" +"For a nonzero number, return the adjusted exponent of its operand as " +"a :class:`Decimal` instance. If the operand is a zero then ``Decimal('-" +"Infinity')`` is returned and the :const:`DivisionByZero` flag is raised. If " +"the operand is an infinity then ``Decimal('Infinity')`` is returned." msgstr "" +"برای یک عدد غیرصفر، توان تعدیل‌شده‌ی عملوندش را به‌عنوان یک نمونه‌ی :class:`Decimal` " +"برمی‌گرداند. اگر عملوند صفر باشد، ``Decimal('-Infinity')`` برگردانده می‌شود و " +"پرچم :const:`DivisionByZero` پرتاب می‌شود. اگر عملوند بی‌نهایت باشد، " +"``Decimal('Infinity')`` برگردانده می‌شود." -msgid ":meth:`logical_and` is a logical operation which takes two *logical operands* (see :ref:`logical_operands_label`). The result is the digit-wise ``and`` of the two operands." +msgid "" +":meth:`logical_and` is a logical operation which takes two *logical operands* " +"(see :ref:`logical_operands_label`). The result is the digit-wise ``and`` of " +"the two operands." msgstr "" +":meth:`logical_and` یک عمل منطقی است که دو *عملوند منطقی* می‌گیرد " +"(به :ref:`logical_operands_label` مراجعه کنید). نتیجه، ``and`` رقم‌به‌رقم دو " +"عملوند است." -msgid ":meth:`logical_invert` is a logical operation. The result is the digit-wise inversion of the operand." +msgid "" +":meth:`logical_invert` is a logical operation. The result is the digit-wise " +"inversion of the operand." msgstr "" +":meth:`logical_invert` یک عملیات منطقی است. نتیجه، وارونگی رقم‌به‌رقم عملوند است." -msgid ":meth:`logical_or` is a logical operation which takes two *logical operands* (see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of the two operands." +msgid "" +":meth:`logical_or` is a logical operation which takes two *logical operands* " +"(see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of " +"the two operands." msgstr "" +":meth:`logical_or` یک عملیات منطقی است که دو *عملوند منطقی* می‌گیرد " +"(ببینید :ref:`logical_operands_label`). نتیجه، ``or`` رقم‌به‌رقم دو عملوند است." -msgid ":meth:`logical_xor` is a logical operation which takes two *logical operands* (see :ref:`logical_operands_label`). The result is the digit-wise exclusive or of the two operands." +msgid "" +":meth:`logical_xor` is a logical operation which takes two *logical operands* " +"(see :ref:`logical_operands_label`). The result is the digit-wise exclusive or " +"of the two operands." msgstr "" +":meth:`logical_xor` یک عملیات منطقی است که دو *عملوند منطقی* را می‌گیرد " +"(ببینید :ref:`logical_operands_label`). نتیجه، یا انحصاری رقم‌به‌رقم دو عملوند " +"است." -msgid "Like ``max(self, other)`` except that the context rounding rule is applied before returning and that ``NaN`` values are either signaled or ignored (depending on the context and whether they are signaling or quiet)." +msgid "" +"Like ``max(self, other)`` except that the context rounding rule is applied " +"before returning and that ``NaN`` values are either signaled or ignored " +"(depending on the context and whether they are signaling or quiet)." msgstr "" +"مانند ``max(self, other)`` است، با این تفاوت که پیش از برگرداندن، قاعده‌ی گرد " +"کردن زمینه اعمال می‌شود و مقادیر ``NaN`` یا سیگنال‌دهی می‌شوند یا نادیده گرفته " +"می‌شوند (بسته به زمینه و این‌که سیگنال‌دهنده (signaling) باشند یا آرام (quiet))." -msgid "Similar to the :meth:`.max` method, but the comparison is done using the absolute values of the operands." +msgid "" +"Similar to the :meth:`.max` method, but the comparison is done using the " +"absolute values of the operands." msgstr "" +"مشابه متد :meth:`.max`، اما مقایسه با استفاده از مقادیر مطلق عملوندها انجام " +"می‌شود." -msgid "Like ``min(self, other)`` except that the context rounding rule is applied before returning and that ``NaN`` values are either signaled or ignored (depending on the context and whether they are signaling or quiet)." +msgid "" +"Like ``min(self, other)`` except that the context rounding rule is applied " +"before returning and that ``NaN`` values are either signaled or ignored " +"(depending on the context and whether they are signaling or quiet)." msgstr "" +"مانند ``min(self, other)`` است، به جز اینکه قاعده‌ی گرد کردن زمینه پیش از " +"بازگرداندن اعمال می‌شود و مقادیر ``NaN`` یا سیگنال داده می‌شوند یا نادیده گرفته " +"می‌شوند (بسته به زمینه و اینکه آن‌ها سیگنال‌دهنده باشند یا ساکت)." -msgid "Similar to the :meth:`.min` method, but the comparison is done using the absolute values of the operands." +msgid "" +"Similar to the :meth:`.min` method, but the comparison is done using the " +"absolute values of the operands." msgstr "" +"مشابه متد :meth:`.min`، اما مقایسه با استفاده از مقادیر مطلق عملوندها انجام " +"می‌شود." -msgid "Return the largest number representable in the given context (or in the current thread's context if no context is given) that is smaller than the given operand." +msgid "" +"Return the largest number representable in the given context (or in the current " +"thread's context if no context is given) that is smaller than the given operand." msgstr "" +"بزرگ‌ترین عدد قابل نمایش در زمینه‌ی داده‌شده (یا در زمینه‌ی نخ جاری اگر زمینه‌ای داده " +"نشده باشد) که از عملوند داده‌شده کوچک‌تر است را برمی‌گرداند." -msgid "Return the smallest number representable in the given context (or in the current thread's context if no context is given) that is larger than the given operand." +msgid "" +"Return the smallest number representable in the given context (or in the " +"current thread's context if no context is given) that is larger than the given " +"operand." msgstr "" +"کوچک‌ترین عدد قابل بازنمایی در زمینه‌ی داده‌شده (یا در زمینه‌ی نخ جاری اگر زمینه‌ای " +"داده نشده باشد) که از عملوند داده‌شده بزرگ‌تر باشد را برمی‌گرداند." -msgid "If the two operands are unequal, return the number closest to the first operand in the direction of the second operand. If both operands are numerically equal, return a copy of the first operand with the sign set to be the same as the sign of the second operand." +msgid "" +"If the two operands are unequal, return the number closest to the first operand " +"in the direction of the second operand. If both operands are numerically " +"equal, return a copy of the first operand with the sign set to be the same as " +"the sign of the second operand." msgstr "" +"اگر دو عملوند نابرابر باشند، نزدیک‌ترین عدد به عملوند اول در جهت عملوند دوم را " +"برمی‌گرداند. اگر هر دو عملوند از نظر عددی برابر باشند، یک کپی از عملوند اول را " +"با علامتی برابر با علامت عملوند دوم برمی‌گرداند." -msgid "Used for producing canonical values of an equivalence class within either the current context or the specified context." +msgid "" +"Used for producing canonical values of an equivalence class within either the " +"current context or the specified context." msgstr "" +"برای تولید مقادیر کانونیکال یک کلاس هم‌ارزی، چه در زمینه جاری و چه در زمینه " +"مشخص‌شده، استفاده می‌شود." -msgid "This has the same semantics as the unary plus operation, except that if the final result is finite it is reduced to its simplest form, with all trailing zeros removed and its sign preserved. That is, while the coefficient is non-zero and a multiple of ten the coefficient is divided by ten and the exponent is incremented by 1. Otherwise (the coefficient is zero) the exponent is set to 0. In all cases the sign is unchanged." -msgstr "" +msgid "" +"This has the same semantics as the unary plus operation, except that if the " +"final result is finite it is reduced to its simplest form, with all trailing " +"zeros removed and its sign preserved. That is, while the coefficient is non-" +"zero and a multiple of ten the coefficient is divided by ten and the exponent " +"is incremented by 1. Otherwise (the coefficient is zero) the exponent is set to " +"0. In all cases the sign is unchanged." +msgstr "" +"این همان معنای عملیات جمع یک‌عملوندی را دارد، به‌جز اینکه اگر نتیجه نهایی متناهی " +"باشد، به ساده‌ترین شکل خود تقلیل می‌یابد، به‌طوری‌که تمام صفرهای پایانی حذف می‌شوند " +"و علامت آن حفظ می‌شود. یعنی تا زمانی که ضریب غیرصفر و مضربی از ده باشد، ضریب بر " +"ده تقسیم می‌شود و توان ۱ واحد افزایش می‌یابد. در غیر این صورت (ضریب صفر است)، " +"توان برابر ۰ قرار می‌گیرد. در همه حالت‌ها علامت بدون تغییر می‌ماند." -msgid "For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both normalize to the equivalent value ``Decimal('32.1')``." +msgid "" +"For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " +"normalize to the equivalent value ``Decimal('32.1')``." msgstr "" +"برای مثال، ``Decimal('32.100')`` و ``Decimal('0.321000e+2')`` هر دو به مقدار " +"معادل ``Decimal('32.1')`` نرمال می‌شوند." msgid "Note that rounding is applied *before* reducing to simplest form." msgstr "" +"توجه داشته باشید که گرد کردن *پیش از* ساده‌سازی به ساده‌ترین شکل اعمال می‌شود." -msgid "In the latest versions of the specification, this operation is also known as ``reduce``." +msgid "" +"In the latest versions of the specification, this operation is also known as " +"``reduce``." msgstr "" +"در آخرین نسخه‌های مشخصات، این عملیات همچنین با نام ``reduce`` نیز شناخته می‌شود." -msgid "Return a string describing the *class* of the operand. The returned value is one of the following ten strings." +msgid "" +"Return a string describing the *class* of the operand. The returned value is " +"one of the following ten strings." msgstr "" +"رشته‌ای را برمی‌گرداند که *کلاس* عملوند را توصیف می‌کند. مقدار برگردانده‌شده یکی از " +"ده رشته زیر است." msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." -msgstr "" +msgstr "``\"-Infinity\"``، که نشان می‌دهد عملوند بی‌نهایت منفی است." msgid "``\"-Normal\"``, indicating that the operand is a negative normal number." -msgstr "" +msgstr "``\"-Normal\"``، نشان می‌دهد که عملوند یک عدد نرمال منفی است." msgid "``\"-Subnormal\"``, indicating that the operand is negative and subnormal." -msgstr "" +msgstr "``\"-Subnormal\"``، که نشان می‌دهد عملوند منفی و زیرنرمال (subnormal) است." msgid "``\"-Zero\"``, indicating that the operand is a negative zero." -msgstr "" +msgstr "``\"-Zero\"``، که نشان می‌دهد عملوند یک صفر منفی است." msgid "``\"+Zero\"``, indicating that the operand is a positive zero." -msgstr "" +msgstr "``\"+Zero\"``، نشان می‌دهد که عملوند یک صفر مثبت است." msgid "``\"+Subnormal\"``, indicating that the operand is positive and subnormal." -msgstr "" +msgstr "``\"+Subnormal\"``، نشان می‌دهد که عملوند مثبت و زیرنرمال است." msgid "``\"+Normal\"``, indicating that the operand is a positive normal number." -msgstr "" +msgstr "``\"+Normal\"``، که نشان می‌دهد عملوند یک عدد نرمال مثبت است." msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." -msgstr "" +msgstr "``\"+Infinity\"``، که نشان‌دهنده‌ی بی‌نهایت مثبت بودن عملوند است." msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." -msgstr "" +msgstr "``\"NaN\"``، که نشان می‌دهد عملوند یک NaN ساکت (Not a Number) است." msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." msgstr "" +"``\"sNaN\"``، که نشان می‌دهد عملوند یک NaN سیگنال‌دهنده (signaling NaN) است." -msgid "Return a value equal to the first operand after rounding and having the exponent of the second operand." +msgid "" +"Return a value equal to the first operand after rounding and having the " +"exponent of the second operand." msgstr "" +"مقداری برابر با عملوند اول برمی‌گرداند که پس از گرد کردن، توان عملوند دوم را " +"دارد." -msgid "Unlike other operations, if the length of the coefficient after the quantize operation would be greater than precision, then an :const:`InvalidOperation` is signaled. This guarantees that, unless there is an error condition, the quantized exponent is always equal to that of the right-hand operand." +msgid "" +"Unlike other operations, if the length of the coefficient after the quantize " +"operation would be greater than precision, then an :const:`InvalidOperation` is " +"signaled. This guarantees that, unless there is an error condition, the " +"quantized exponent is always equal to that of the right-hand operand." msgstr "" +"برخلاف سایر عملیات، اگر طول ضریب پس از عملیات کوانتایز (quantize) بیشتر از دقت " +"باشد، یک :const:`InvalidOperation` علامت‌دهی می‌شود. این تضمین می‌کند که، مگر " +"اینکه شرایط خطایی وجود داشته باشد، توان کوانتایزشده همواره برابر با توان عملوند " +"سمت راست است." -msgid "Also unlike other operations, quantize never signals Underflow, even if the result is subnormal and inexact." +msgid "" +"Also unlike other operations, quantize never signals Underflow, even if the " +"result is subnormal and inexact." msgstr "" +"همچنین برخلاف سایر عملیات‌ها، quantize هرگز سیگنال Underflow صادر نمی‌کند، حتی " +"اگر نتیجه زیرنرمال (subnormal) و غیردقیق باشد." -msgid "If the exponent of the second operand is larger than that of the first then rounding may be necessary. In this case, the rounding mode is determined by the ``rounding`` argument if given, else by the given ``context`` argument; if neither argument is given the rounding mode of the current thread's context is used." -msgstr "" +msgid "" +"If the exponent of the second operand is larger than that of the first then " +"rounding may be necessary. In this case, the rounding mode is determined by " +"the ``rounding`` argument if given, else by the given ``context`` argument; if " +"neither argument is given the rounding mode of the current thread's context is " +"used." +msgstr "" +"اگر توان عملوند دوم بزرگ‌تر از توان عملوند اول باشد، ممکن است گرد کردن لازم " +"باشد. در این حالت، حالت گرد کردن توسط آرگومان ``rounding`` در صورتی که داده شده " +"باشد تعیین می‌شود، در غیر این صورت توسط آرگومان ``context`` داده‌شده تعیین می‌شود؛ " +"اگر هیچ‌کدام از آرگومان‌ها داده نشوند، از حالت گرد کردن زمینه‌ی نخ جاری استفاده " +"می‌شود." -msgid "An error is returned whenever the resulting exponent is greater than :attr:`~Context.Emax` or less than :meth:`~Context.Etiny`." +msgid "" +"An error is returned whenever the resulting exponent is greater " +"than :attr:`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" +"هر زمان که توان حاصل بزرگ‌تر از :attr:`~Context.Emax` یا کوچک‌تر " +"از :meth:`~Context.Etiny` باشد، یک خطا بازگردانده می‌شود." -msgid "Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class does all its arithmetic. Included for compatibility with the specification." +msgid "" +"Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " +"does all its arithmetic. Included for compatibility with the specification." msgstr "" +"``Decimal(10)`` را برمی‌گرداند، یعنی مبنایی (پایه‌ای) که کلاس :class:`Decimal` " +"تمام محاسبات خود را در آن انجام می‌دهد. برای سازگاری با مشخصات گنجانده شده است." -msgid "Return the remainder from dividing *self* by *other*. This differs from ``self % other`` in that the sign of the remainder is chosen so as to minimize its absolute value. More precisely, the return value is ``self - n * other`` where ``n`` is the integer nearest to the exact value of ``self / other``, and if two integers are equally near then the even one is chosen." -msgstr "" +msgid "" +"Return the remainder from dividing *self* by *other*. This differs from ``self " +"% other`` in that the sign of the remainder is chosen so as to minimize its " +"absolute value. More precisely, the return value is ``self - n * other`` where " +"``n`` is the integer nearest to the exact value of ``self / other``, and if two " +"integers are equally near then the even one is chosen." +msgstr "" +"باقی‌مانده‌ی تقسیم *self* بر *other* را برمی‌گرداند. این با ``self % other`` در این " +"تفاوت دارد که علامت باقی‌مانده به‌گونه‌ای انتخاب می‌شود که مقدار مطلق آن کمینه شود. " +"دقیق‌تر، مقدار بازگشتی ``self - n * other`` است که در آن ``n`` نزدیک‌ترین عدد " +"صحیح به مقدار دقیق ``self / other`` است، و اگر دو عدد صحیح به یک اندازه نزدیک " +"باشند، عدد زوج انتخاب می‌شود." msgid "If the result is zero then its sign will be the sign of *self*." -msgstr "" +msgstr "اگر نتیجه صفر باشد، علامت آن همان علامت *self* خواهد بود." -msgid "Return the result of rotating the digits of the first operand by an amount specified by the second operand. The second operand must be an integer in the range -precision through precision. The absolute value of the second operand gives the number of places to rotate. If the second operand is positive then rotation is to the left; otherwise rotation is to the right. The coefficient of the first operand is padded on the left with zeros to length precision if necessary. The sign and exponent of the first operand are unchanged." -msgstr "" +msgid "" +"Return the result of rotating the digits of the first operand by an amount " +"specified by the second operand. The second operand must be an integer in the " +"range -precision through precision. The absolute value of the second operand " +"gives the number of places to rotate. If the second operand is positive then " +"rotation is to the left; otherwise rotation is to the right. The coefficient of " +"the first operand is padded on the left with zeros to length precision if " +"necessary. The sign and exponent of the first operand are unchanged." +msgstr "" +"نتیجه‌ی چرخاندن ارقام اولین عملوند به میزان مشخص‌شده توسط دومین عملوند را " +"برمی‌گرداند. دومین عملوند باید عدد صحیحی در بازه‌ی منفی دقت تا دقت باشد. مقدار " +"مطلق دومین عملوند، تعداد موقعیت‌های چرخش را مشخص می‌کند. اگر دومین عملوند مثبت " +"باشد، چرخش به سمت چپ است؛ در غیر این صورت، چرخش به سمت راست است. در صورت لزوم، " +"سمت چپ ضریب اولین عملوند با صفرها پر می‌شود تا طول آن برابر با دقت شود. علامت و " +"توان اولین عملوند بدون تغییر می‌مانند." -msgid "Test whether self and other have the same exponent or whether both are ``NaN``." +msgid "" +"Test whether self and other have the same exponent or whether both are ``NaN``." msgstr "" +"بررسی می‌کند که آیا self و other توان یکسانی دارند یا اینکه هر دو ``NaN`` هستند." -msgid "Return the first operand with exponent adjusted by the second. Equivalently, return the first operand multiplied by ``10**other``. The second operand must be an integer." +msgid "" +"Return the first operand with exponent adjusted by the second. Equivalently, " +"return the first operand multiplied by ``10**other``. The second operand must " +"be an integer." msgstr "" +"عملوند اول را با توان تنظیم‌شده توسط عملوند دوم بازمی‌گرداند. معادل آن، عملوند " +"اول ضرب‌شده در ``10**other`` را بازمی‌گرداند. عملوند دوم باید یک عدد صحیح باشد." -msgid "Return the result of shifting the digits of the first operand by an amount specified by the second operand. The second operand must be an integer in the range -precision through precision. The absolute value of the second operand gives the number of places to shift. If the second operand is positive then the shift is to the left; otherwise the shift is to the right. Digits shifted into the coefficient are zeros. The sign and exponent of the first operand are unchanged." -msgstr "" +msgid "" +"Return the result of shifting the digits of the first operand by an amount " +"specified by the second operand. The second operand must be an integer in the " +"range -precision through precision. The absolute value of the second operand " +"gives the number of places to shift. If the second operand is positive then " +"the shift is to the left; otherwise the shift is to the right. Digits shifted " +"into the coefficient are zeros. The sign and exponent of the first operand are " +"unchanged." +msgstr "" +"نتیجه‌ی جابه‌جایی ارقام عملوند اول به مقدار مشخص‌شده توسط عملوند دوم را برمی‌گرداند. " +"عملوند دوم باید عدد صحیحی در بازه‌ی منفی دقت تا دقت باشد. قدر مطلق عملوند دوم، " +"تعداد جایگاه‌های جابه‌جایی را مشخص می‌کند. اگر عملوند دوم مثبت باشد، جابه‌جایی به " +"سمت چپ است؛ در غیر این صورت، جابه‌جایی به سمت راست است. ارقامی که به داخل ضریب " +"جابه‌جا می‌شوند، صفر هستند. علامت و توان عملوند اول تغییر نمی‌کنند." msgid "Return the square root of the argument to full precision." -msgstr "" +msgstr "ریشه دوم آرگومان را با دقت کامل بازمی‌گرداند." msgid "Convert to a string, using engineering notation if an exponent is needed." msgstr "" +"به یک رشته تبدیل می‌کند، و در صورت نیاز به توان، از نماد مهندسی استفاده می‌کند." -msgid "Engineering notation has an exponent which is a multiple of 3. This can leave up to 3 digits to the left of the decimal place and may require the addition of either one or two trailing zeros." +msgid "" +"Engineering notation has an exponent which is a multiple of 3. This can leave " +"up to 3 digits to the left of the decimal place and may require the addition of " +"either one or two trailing zeros." msgstr "" +"در نمادگذاری مهندسی، توان مضربی از ۳ است. این موضوع می‌تواند تا ۳ رقم را در سمت " +"چپ نقطه اعشار باقی بگذارد و ممکن است به افزودن یک یا دو صفر انتهایی نیاز داشته " +"باشد." -msgid "For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." +msgid "" +"For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." msgstr "" +"برای مثال، این ``Decimal('123E+1')`` را به ``Decimal('1.23E+3')`` تبدیل می‌کند." -msgid "Identical to the :meth:`to_integral_value` method. The ``to_integral`` name has been kept for compatibility with older versions." +msgid "" +"Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " +"has been kept for compatibility with older versions." msgstr "" +"یکسان با متد :meth:`to_integral_value`. نام ``to_integral`` برای سازگاری با " +"نسخه‌های قدیمی‌تر حفظ شده است." -msgid "Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` as appropriate if rounding occurs. The rounding mode is determined by the ``rounding`` parameter if given, else by the given ``context``. If neither parameter is given then the rounding mode of the current context is used." +msgid "" +"Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` as " +"appropriate if rounding occurs. The rounding mode is determined by the " +"``rounding`` parameter if given, else by the given ``context``. If neither " +"parameter is given then the rounding mode of the current context is used." msgstr "" +"به نزدیک‌ترین عدد صحیح گرد می‌شود، و در صورت وقوع گرد کردن، بنا به " +"مورد :const:`Inexact` یا :const:`Rounded` سیگنال داده می‌شود. حالت گرد کردن در " +"صورت داده شدن پارامتر ``rounding`` با آن، و در غیر این صورت با ``context`` " +"داده‌شده تعیین می‌شود. اگر هیچ‌کدام از پارامترها داده نشود، حالت گرد کردن زمینه‌ی " +"جاری استفاده می‌شود." -msgid "Round to the nearest integer without signaling :const:`Inexact` or :const:`Rounded`. If given, applies *rounding*; otherwise, uses the rounding method in either the supplied *context* or the current context." +msgid "" +"Round to the nearest integer without signaling :const:`Inexact` " +"or :const:`Rounded`. If given, applies *rounding*; otherwise, uses the " +"rounding method in either the supplied *context* or the current context." msgstr "" +"به نزدیک‌ترین عدد صحیح گرد می‌کند، بدون این‌که :const:`Inexact` " +"یا :const:`Rounded` سیگنال داده شود. در صورت داده شدن، *rounding* را اعمال " +"می‌کند؛ در غیر این صورت، از روش گرد کردن در *context* ارائه‌شده یا زمینه‌ی جاری " +"استفاده می‌کند." msgid "Decimal numbers can be rounded using the :func:`.round` function:" -msgstr "" +msgstr "می‌توان اعداد اعشاری را با استفاده از تابع :func:`.round` گرد کرد:" -msgid "If *ndigits* is not given or ``None``, returns the nearest :class:`int` to *number*, rounding ties to even, and ignoring the rounding mode of the :class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." +msgid "" +"If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " +"*number*, rounding ties to even, and ignoring the rounding mode of " +"the :class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an " +"infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." msgstr "" +"اگر *ndigits* داده نشود یا ``None`` باشد، نزدیک‌ترین :class:`int` به *number* " +"بازگردانده می‌شود، به‌گونه‌ای که موارد تساوی در گرد کردن به عدد زوج گرد می‌شوند و " +"حالت گرد کردن زمینه‌ی :class:`Decimal` نادیده گرفته می‌شود. اگر *number* یک " +"بی‌نهایت باشد، :exc:`OverflowError` پرتاب می‌شود و اگر یک NaN (ساکت یا سیگنال‌دهی) " +"باشد، :exc:`ValueError` پرتاب می‌شود." -msgid "If *ndigits* is an :class:`int`, the context's rounding mode is respected and a :class:`Decimal` representing *number* rounded to the nearest multiple of ``Decimal('1E-ndigits')`` is returned; in this case, ``round(number, ndigits)`` is equivalent to ``self.quantize(Decimal('1E-ndigits'))``. Returns ``Decimal('NaN')`` if *number* is a quiet NaN. Raises :class:`InvalidOperation` if *number* is an infinity, a signaling NaN, or if the length of the coefficient after the quantize operation would be greater than the current context's precision. In other words, for the non-corner cases:" -msgstr "" +msgid "" +"If *ndigits* is an :class:`int`, the context's rounding mode is respected and " +"a :class:`Decimal` representing *number* rounded to the nearest multiple of " +"``Decimal('1E-ndigits')`` is returned; in this case, ``round(number, ndigits)`` " +"is equivalent to ``self.quantize(Decimal('1E-ndigits'))``. Returns " +"``Decimal('NaN')`` if *number* is a quiet NaN. " +"Raises :class:`InvalidOperation` if *number* is an infinity, a signaling NaN, " +"or if the length of the coefficient after the quantize operation would be " +"greater than the current context's precision. In other words, for the non-" +"corner cases:" +msgstr "" +"اگر *ndigits* یک :class:`int` باشد، حالت گرد کردن زمینه رعایت می‌شود و " +"یک :class:`Decimal` برگردانده می‌شود که نشان‌دهنده‌ی *number* گردشده به نزدیک‌ترین " +"مضرب ``Decimal('1E-ndigits')`` است؛ در این حالت، ``round(number, ndigits)`` " +"معادل ``self.quantize(Decimal('1E-ndigits'))`` است. اگر *number* یک NaN ساکت " +"(quiet NaN) باشد، ``Decimal('NaN')`` را برمی‌گرداند. اگر *number* یک بی‌نهایت یا " +"یک NaN سیگنال‌دهنده (signaling NaN) باشد، یا اگر طول ضریب پس از عملیات quantize " +"بیشتر از دقت زمینه‌ی فعلی باشد، :class:`InvalidOperation` را پرتاب می‌کند. به " +"عبارت دیگر، برای حالت‌های غیرمرزی:" -msgid "if *ndigits* is positive, return *number* rounded to *ndigits* decimal places;" +msgid "" +"if *ndigits* is positive, return *number* rounded to *ndigits* decimal places;" msgstr "" +"اگر *ndigits* مثبت باشد، *number* را که تا *ndigits* رقم اعشاری گرد شده است " +"برمی‌گرداند؛" msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" msgstr "" +"اگر *ndigits* صفر باشد، *number* را به نزدیک‌ترین عدد صحیح گرد شده برگردانید؛" -msgid "if *ndigits* is negative, return *number* rounded to the nearest multiple of ``10**abs(ndigits)``." +msgid "" +"if *ndigits* is negative, return *number* rounded to the nearest multiple of " +"``10**abs(ndigits)``." msgstr "" +"اگر *ndigits* منفی باشد، *number* را که به نزدیک‌ترین مضرب ``10**abs(ndigits)`` " +"گرد شده است، برمی‌گرداند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" @@ -668,36 +1548,84 @@ msgid "" ">>> round(Decimal('3.75'), -1)\n" "Decimal('0E+1')" msgstr "" +">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" +">>> getcontext().rounding = ROUND_DOWN\n" +">>> round(Decimal('3.75')) # context rounding ignored\n" +"4\n" +">>> round(Decimal('3.5')) # round-ties-to-even\n" +"4\n" +">>> round(Decimal('3.75'), 0) # uses the context rounding\n" +"Decimal('3')\n" +">>> round(Decimal('3.75'), 1)\n" +"Decimal('3.7')\n" +">>> round(Decimal('3.75'), -1)\n" +"Decimal('0E+1')" msgid "Logical operands" -msgstr "" +msgstr "عملوندهای منطقی" -msgid "The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their arguments to be *logical operands*. A *logical operand* is a :class:`Decimal` instance whose exponent and sign are both zero, and whose digits are all either ``0`` or ``1``." +msgid "" +"The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:`~Decimal.logical_or`, " +"and :meth:`~Decimal.logical_xor` methods expect their arguments to be *logical " +"operands*. A *logical operand* is a :class:`Decimal` instance whose exponent " +"and sign are both zero, and whose digits are all either ``0`` or ``1``." msgstr "" +"متدهای :meth:`~Decimal.logical_and`، :meth:`~Decimal.logical_invert`، :meth:`~Decimal.logical_or` " +"و :meth:`~Decimal.logical_xor` انتظار دارند که آرگومان‌های آن‌ها *عملوندهای " +"منطقی* باشند. یک *عملوند منطقی* نمونه‌ای از :class:`Decimal` است که توان و علامت " +"آن هر دو صفر هستند و تمام ارقام آن یا ``0`` هستند یا ``1``." msgid "Context objects" -msgstr "" +msgstr "اشیاء زمینه" -msgid "Contexts are environments for arithmetic operations. They govern precision, set rules for rounding, determine which signals are treated as exceptions, and limit the range for exponents." +msgid "" +"Contexts are environments for arithmetic operations. They govern precision, " +"set rules for rounding, determine which signals are treated as exceptions, and " +"limit the range for exponents." msgstr "" +"زمینه‌ها محیط‌هایی برای عملیات حسابی هستند. آن‌ها دقت را کنترل می‌کنند، قواعد گرد " +"کردن را تنظیم می‌کنند، تعیین می‌کنند که کدام سیگنال‌ها به‌عنوان استثنا در نظر گرفته " +"شوند، و بازه‌ی توان‌ها را محدود می‌کنند." -msgid "Each thread has its own current context which is accessed or changed using the :func:`getcontext` and :func:`setcontext` functions:" +msgid "" +"Each thread has its own current context which is accessed or changed using " +"the :func:`getcontext` and :func:`setcontext` functions:" msgstr "" +"هر نخ زمینه‌ی جاری خود را دارد که با استفاده از توابع :func:`getcontext` " +"و :func:`setcontext` قابل دسترسی یا تغییر است:" msgid "Return the current context for the active thread." -msgstr "" +msgstr "زمینه فعلی برای نخ فعال را برمی‌گرداند." msgid "Set the current context for the active thread to *c*." -msgstr "" +msgstr "زمینه فعلی نخ فعال را روی *c* تنظیم کنید." -msgid "You can also use the :keyword:`with` statement and the :func:`localcontext` function to temporarily change the active context." +msgid "" +"You can also use the :keyword:`with` statement and the :func:`localcontext` " +"function to temporarily change the active context." msgstr "" +"شما همچنین می‌توانید از دستور :keyword:`with` و تابع :func:`localcontext` برای " +"تغییر موقت زمینه‌ی فعال استفاده کنید." -msgid "Return a context manager that will set the current context for the active thread to a copy of *ctx* on entry to the with-statement and restore the previous context when exiting the with-statement. If no context is specified, a copy of the current context is used. The *kwargs* argument is used to set the attributes of the new context." +msgid "" +"Return a context manager that will set the current context for the active " +"thread to a copy of *ctx* on entry to the with-statement and restore the " +"previous context when exiting the with-statement. If no context is specified, a " +"copy of the current context is used. The *kwargs* argument is used to set the " +"attributes of the new context." msgstr "" +"یک مدیر زمینه برمی‌گرداند که هنگام ورود به دستور with، زمینه فعلی نخ فعال را به " +"یک کپی از *ctx* تنظیم می‌کند و هنگام خروج از دستور with، زمینه قبلی را بازگردانی " +"می‌کند. اگر هیچ زمینه‌ای مشخص نشده باشد، از یک کپی از زمینه فعلی استفاده می‌شود. " +"آرگومان *kwargs* برای تنظیم ویژگی‌های زمینه جدید استفاده می‌شود." -msgid "For example, the following code sets the current decimal precision to 42 places, performs a calculation, and then automatically restores the previous context::" +msgid "" +"For example, the following code sets the current decimal precision to 42 " +"places, performs a calculation, and then automatically restores the previous " +"context::" msgstr "" +"برای مثال، کد زیر دقت اعشاری کنونی را روی ۴۲ رقم اعشار تنظیم می‌کند، یک محاسبه " +"انجام می‌دهد و سپس به‌طور خودکار زمینه پیشین را بازمی‌گرداند::" msgid "" "from decimal import localcontext\n" @@ -707,9 +1635,15 @@ msgid "" " s = calculate_something()\n" "s = +s # Round the final result back to the default precision" msgstr "" +"from decimal import localcontext\n" +"\n" +"with localcontext() as ctx:\n" +" ctx.prec = 42 # Perform a high precision calculation\n" +" s = calculate_something()\n" +"s = +s # Round the final result back to the default precision" msgid "Using keyword arguments, the code would be the following::" -msgstr "" +msgstr "با استفاده از آرگومان‌های کلیدواژه‌ای، کد به‌شکل زیر خواهد بود::" msgid "" "from decimal import localcontext\n" @@ -718,95 +1652,258 @@ msgid "" " s = calculate_something()\n" "s = +s" msgstr "" +"from decimal import localcontext\n" +"\n" +"with localcontext(prec=42) as ctx:\n" +" s = calculate_something()\n" +"s = +s" -msgid "Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:`Context` doesn't support. Raises either :exc:`TypeError` or :exc:`ValueError` if *kwargs* supplies an invalid value for an attribute." +msgid "" +"Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:`Context` " +"doesn't support. Raises either :exc:`TypeError` or :exc:`ValueError` if " +"*kwargs* supplies an invalid value for an attribute." msgstr "" +"اگر *kwargs* ویژگی‌ای را ارائه دهد که :class:`Context` از آن پشتیبانی " +"نمی‌کند، :exc:`TypeError` پرتاب می‌شود. اگر *kwargs* مقدار نامعتبری برای یک ویژگی " +"ارائه دهد، یا :exc:`TypeError` یا :exc:`ValueError` پرتاب می‌شود." -msgid ":meth:`localcontext` now supports setting context attributes through the use of keyword arguments." +msgid "" +":meth:`localcontext` now supports setting context attributes through the use of " +"keyword arguments." msgstr "" +":meth:`localcontext` اکنون از تنظیم ویژگی‌های زمینه از طریق آرگومان‌های " +"کلیدواژه‌ای پشتیبانی می‌کند." -msgid "Return a context object initialized to the proper values for one of the IEEE interchange formats. The argument must be a multiple of 32 and less than :const:`IEEE_CONTEXT_MAX_BITS`." +msgid "" +"Return a context object initialized to the proper values for one of the IEEE " +"interchange formats. The argument must be a multiple of 32 and less " +"than :const:`IEEE_CONTEXT_MAX_BITS`." msgstr "" +"یک شیء زمینه را برمی‌گرداند که با مقادیر مناسب برای یکی از قالب‌های مبادله‌ای IEEE " +"مقداردهی اولیه‌شده است. آرگومان باید مضربی از ۳۲ و کمتر " +"از :const:`IEEE_CONTEXT_MAX_BITS` باشد." -msgid "New contexts can also be created using the :class:`Context` constructor described below. In addition, the module provides three pre-made contexts:" +msgid "" +"New contexts can also be created using the :class:`Context` constructor " +"described below. In addition, the module provides three pre-made contexts:" msgstr "" +"همچنین می‌توان زمینه‌های جدید را با استفاده از سازنده‌ی :class:`Context` که در زیر " +"توضیح داده شده است، ایجاد کرد. علاوه بر این، این ماژول سه زمینه‌ی از پیش ساخته‌شده " +"ارائه می‌دهد:" -msgid "This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as exceptions) except :const:`Inexact`, :const:`Rounded`, and :const:`Subnormal`." -msgstr "" +msgid "" +"This is a standard context defined by the General Decimal Arithmetic " +"Specification. Precision is set to nine. Rounding is set " +"to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled " +"(treated as exceptions) except :const:`Inexact`, :const:`Rounded`, " +"and :const:`Subnormal`." +msgstr "" +"این یک زمینه استاندارد است که توسط مشخصات عمومی محاسبات اعشاری (General Decimal " +"Arithmetic Specification) تعریف شده است. دقت روی ۹ تنظیم شده است. گرد کردن " +"روی :const:`ROUND_HALF_UP` تنظیم شده است. همه پرچم‌ها پاک شده‌اند. همه تله‌ها فعال " +"شده‌اند (به‌عنوان استثنا در نظر گرفته می‌شوند)، به " +"جز :const:`Inexact`، :const:`Rounded` و :const:`Subnormal`." -msgid "Because many of the traps are enabled, this context is useful for debugging." -msgstr "" +msgid "" +"Because many of the traps are enabled, this context is useful for debugging." +msgstr "چون بسیاری از تله‌ها فعال هستند، این زمینه برای اشکال‌زدایی مفید است." -msgid "This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to :const:`ROUND_HALF_EVEN`. All flags are cleared. No traps are enabled (so that exceptions are not raised during computations)." +msgid "" +"This is a standard context defined by the General Decimal Arithmetic " +"Specification. Precision is set to nine. Rounding is set " +"to :const:`ROUND_HALF_EVEN`. All flags are cleared. No traps are enabled (so " +"that exceptions are not raised during computations)." msgstr "" +"این یک زمینه استاندارد است که توسط مشخصات عمومی محاسبات اعشاری (General Decimal " +"Arithmetic Specification) تعریف شده است. دقت روی ۹ تنظیم شده است. گرد کردن " +"روی :const:`ROUND_HALF_EVEN` تنظیم شده است. همه پرچم‌ها پاک شده‌اند. هیچ تله‌ای " +"فعال نیست (تا استثناها در حین محاسبات پرتاب نشوند)." -msgid "Because the traps are disabled, this context is useful for applications that prefer to have result value of ``NaN`` or ``Infinity`` instead of raising exceptions. This allows an application to complete a run in the presence of conditions that would otherwise halt the program." +msgid "" +"Because the traps are disabled, this context is useful for applications that " +"prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " +"exceptions. This allows an application to complete a run in the presence of " +"conditions that would otherwise halt the program." msgstr "" +"از آنجا که تله‌ها غیرفعال هستند، این زمینه برای برنامه‌هایی مفید است که ترجیح " +"می‌دهند به‌جای پرتاب استثنا، مقدار نتیجه ``NaN`` یا ``Infinity`` باشد. این امر به " +"برنامه اجازه می‌دهد که اجرا را در شرایطی که در غیر این صورت موجب توقف برنامه " +"می‌شدند، به پایان برساند." -msgid "This context is used by the :class:`Context` constructor as a prototype for new contexts. Changing a field (such a precision) has the effect of changing the default for new contexts created by the :class:`Context` constructor." +msgid "" +"This context is used by the :class:`Context` constructor as a prototype for new " +"contexts. Changing a field (such a precision) has the effect of changing the " +"default for new contexts created by the :class:`Context` constructor." msgstr "" +"این زمینه توسط سازنده‌ی :class:`Context` به‌عنوان یک نمونه‌ی اولیه برای زمینه‌های " +"جدید استفاده می‌شود. تغییر یک فیلد (مانند دقت) باعث تغییر پیش‌فرض برای زمینه‌های " +"جدید ایجادشده توسط سازنده‌ی :class:`Context` می‌شود." -msgid "This context is most useful in multi-threaded environments. Changing one of the fields before threads are started has the effect of setting system-wide defaults. Changing the fields after threads have started is not recommended as it would require thread synchronization to prevent race conditions." +msgid "" +"This context is most useful in multi-threaded environments. Changing one of " +"the fields before threads are started has the effect of setting system-wide " +"defaults. Changing the fields after threads have started is not recommended as " +"it would require thread synchronization to prevent race conditions." msgstr "" +"این زمینه بیشترین کاربرد را در محیط‌های چندنخی دارد. تغییر یکی از فیلدها پیش از " +"آغاز نخ‌ها، به‌منزله‌ی تنظیم پیش‌فرض‌های سراسری سیستم است. تغییر فیلدها پس از آغاز " +"نخ‌ها توصیه نمی‌شود، زیرا نیازمند همگام‌سازی نخ‌ها برای جلوگیری از شرایط رقابتی " +"خواهد بود." -msgid "In single threaded environments, it is preferable to not use this context at all. Instead, simply create contexts explicitly as described below." +msgid "" +"In single threaded environments, it is preferable to not use this context at " +"all. Instead, simply create contexts explicitly as described below." msgstr "" +"در محیط‌های تک‌نخی، بهتر است اصلاً از این زمینه استفاده نکنید. در عوض، به‌سادگی " +"زمینه‌ها را به‌صراحت همان‌طور که در زیر توضیح داده شده است ایجاد کنید." -msgid "The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context.rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." +msgid "" +"The default values are :attr:`Context.prec`\\ =\\ " +"``28``, :attr:`Context.rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled " +"traps for :class:`Overflow`, :class:`InvalidOperation`, " +"and :class:`DivisionByZero`." msgstr "" +"مقادیر پیش‌فرض عبارت‌اند از :attr:`Context.prec`\\ =\\ " +"``28``، :attr:`Context.rounding`\\ =\\ :const:`ROUND_HALF_EVEN`، و تله‌های فعال " +"برای :class:`Overflow`، :class:`InvalidOperation` و :class:`DivisionByZero`." -msgid "In addition to the three supplied contexts, new contexts can be created with the :class:`Context` constructor." +msgid "" +"In addition to the three supplied contexts, new contexts can be created with " +"the :class:`Context` constructor." msgstr "" +"علاوه بر سه زمینه‌ی فراهم‌شده، می‌توان زمینه‌های جدید را با سازنده‌ی :class:`Context` " +"ایجاد کرد." -msgid "Creates a new context. If a field is not specified or is :const:`None`, the default values are copied from the :const:`DefaultContext`. If the *flags* field is not specified or is :const:`None`, all flags are cleared." +msgid "" +"Creates a new context. If a field is not specified or is :const:`None`, the " +"default values are copied from the :const:`DefaultContext`. If the *flags* " +"field is not specified or is :const:`None`, all flags are cleared." msgstr "" +"یک زمینه جدید ایجاد می‌کند. اگر فیلدی مشخص‌نشده باشد یا :const:`None` باشد، " +"مقادیر پیش‌فرض از :const:`DefaultContext` کپی می‌شوند. اگر فیلد *flags* مشخص‌نشده " +"باشد یا :const:`None` باشد، تمام پرچم‌ها پاک می‌شوند." -msgid "An integer in the range [``1``, :const:`MAX_PREC`] that sets the precision for arithmetic operations in the context." +msgid "" +"An integer in the range [``1``, :const:`MAX_PREC`] that sets the precision for " +"arithmetic operations in the context." msgstr "" +"یک عدد صحیح در بازه‌ی [``1``, :const:`MAX_PREC`] که دقت عملیات حسابی را در زمینه " +"تنظیم می‌کند." msgid "One of the constants listed in the section `Rounding Modes`_." -msgstr "" +msgstr "یکی از ثابت‌های فهرست‌شده در بخش `Rounding Modes`_." -msgid "Lists of any signals to be set. Generally, new contexts should only set traps and leave the flags clear." +msgid "" +"Lists of any signals to be set. Generally, new contexts should only set traps " +"and leave the flags clear." msgstr "" +"فهرست‌هایی از هر سیگنالی که باید تنظیم شود. به‌طور کلی، زمینه‌های جدید فقط باید " +"تله‌ها را تنظیم کنند و پرچم‌ها را پاک باقی بگذارند." -msgid "Integers specifying the outer limits allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, ``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." +msgid "" +"Integers specifying the outer limits allowable for exponents. *Emin* must be in " +"the range [:const:`MIN_EMIN`, ``0``], *Emax* in the range " +"[``0``, :const:`MAX_EMAX`]." msgstr "" +"اعداد صحیحی که کران‌های بیرونی مجاز برای توان‌ها را مشخص می‌کنند. *Emin* باید در " +"بازه‌ی [:const:`MIN_EMIN`، ``0``] باشد، *Emax* در بازه‌ی " +"[``0``، :const:`MAX_EMAX`]." -msgid "Either ``0`` or ``1`` (the default). If set to ``1``, exponents are printed with a capital ``E``; otherwise, a lowercase ``e`` is used: ``Decimal('6.02e+23')``." +msgid "" +"Either ``0`` or ``1`` (the default). If set to ``1``, exponents are printed " +"with a capital ``E``; otherwise, a lowercase ``e`` is used: " +"``Decimal('6.02e+23')``." msgstr "" +"یا ``0`` یا ``1`` (پیش‌فرض). اگر روی ``1`` تنظیم شود، توان‌ها با ``E`` بزرگ چاپ " +"می‌شوند؛ در غیر این صورت، از ``e`` کوچک استفاده می‌شود: ``Decimal('6.02e+23')``." -msgid "Either ``0`` (the default) or ``1``. If set to ``1``, the exponent ``e`` of a :class:`Decimal` instance representable in this context is strictly limited to the range ``Emin - prec + 1 <= e <= Emax - prec + 1``. If *clamp* is ``0`` then a weaker condition holds: the adjusted exponent of the :class:`Decimal` instance is at most :attr:`~Context.Emax`. When *clamp* is ``1``, a large normal number will, where possible, have its exponent reduced and a corresponding number of zeros added to its coefficient, in order to fit the exponent constraints; this preserves the value of the number but loses information about significant trailing zeros. For example::" -msgstr "" +msgid "" +"Either ``0`` (the default) or ``1``. If set to ``1``, the exponent ``e`` of " +"a :class:`Decimal` instance representable in this context is strictly limited " +"to the range ``Emin - prec + 1 <= e <= Emax - prec + 1``. If *clamp* is ``0`` " +"then a weaker condition holds: the adjusted exponent of the :class:`Decimal` " +"instance is at most :attr:`~Context.Emax`. When *clamp* is ``1``, a large " +"normal number will, where possible, have its exponent reduced and a " +"corresponding number of zeros added to its coefficient, in order to fit the " +"exponent constraints; this preserves the value of the number but loses " +"information about significant trailing zeros. For example::" +msgstr "" +"یا ``0`` (پیش‌فرض) یا ``1``. اگر روی ``1`` تنظیم شود، توان ``e`` " +"نمونه‌ی :class:`Decimal` قابل‌نمایش در این زمینه، به‌طور دقیق به محدوده ``Emin - " +"prec + 1 <= e <= Emax - prec + 1`` محدود می‌شود. اگر *clamp* برابر ``0`` باشد، " +"شرط ضعیف‌تری برقرار است: توان تنظیم‌شده‌ی نمونه‌ی :class:`Decimal` " +"حداکثر :attr:`~Context.Emax` است. هنگامی که *clamp* برابر ``1`` باشد، توان یک " +"عدد عادی بزرگ، در صورت امکان، کاهش می‌یابد و تعداد متناظری صفر به ضریب آن اضافه " +"می‌شود تا محدودیت‌های توان رعایت شود؛ این کار مقدار عدد را حفظ می‌کند، اما اطلاعات " +"مربوط به صفرهای انتهایی معنادار را از دست می‌دهد. برای مثال::" msgid "" ">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" "Decimal('1.23000E+999')" msgstr "" +">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" +"Decimal('1.23000E+999')" -msgid "A *clamp* value of ``1`` allows compatibility with the fixed-width decimal interchange formats specified in IEEE 754." +msgid "" +"A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " +"interchange formats specified in IEEE 754." msgstr "" +"مقدار *clamp* (محدودسازی) برابر با ``1`` امکان سازگاری با قالب‌های مبادله‌ای " +"اعشاری با عرض ثابت مشخص‌شده در IEEE 754 را فراهم می‌کند." -msgid "The :class:`Context` class defines several general purpose methods as well as a large number of methods for doing arithmetic directly in a given context. In addition, for each of the :class:`Decimal` methods described above (with the exception of the :meth:`~Decimal.adjusted` and :meth:`~Decimal.as_tuple` methods) there is a corresponding :class:`Context` method. For example, for a :class:`Context` instance ``C`` and :class:`Decimal` instance ``x``, ``C.exp(x)`` is equivalent to ``x.exp(context=C)``. Each :class:`Context` method accepts a Python integer (an instance of :class:`int`) anywhere that a Decimal instance is accepted." -msgstr "" +msgid "" +"The :class:`Context` class defines several general purpose methods as well as a " +"large number of methods for doing arithmetic directly in a given context. In " +"addition, for each of the :class:`Decimal` methods described above (with the " +"exception of the :meth:`~Decimal.adjusted` and :meth:`~Decimal.as_tuple` " +"methods) there is a corresponding :class:`Context` method. For example, for " +"a :class:`Context` instance ``C`` and :class:`Decimal` instance ``x``, " +"``C.exp(x)`` is equivalent to ``x.exp(context=C)``. Each :class:`Context` " +"method accepts a Python integer (an instance of :class:`int`) anywhere that a " +"Decimal instance is accepted." +msgstr "" +"کلاس :class:`Context` چندین متد با کاربرد عمومی و همچنین تعداد زیادی متد برای " +"انجام عملیات حسابی به‌صورت مستقیم در یک زمینه‌ی داده‌شده تعریف می‌کند. علاوه بر این، " +"به ازای هر یک از متدهای :class:`Decimal` که در بالا توضیح داده شده‌اند " +"(به‌استثنای متدهای :meth:`~Decimal.adjusted` و :meth:`~Decimal.as_tuple`)، یک " +"متد متناظر در :class:`Context` وجود دارد. برای مثال، برای یک " +"نمونه‌ی :class:`Context` به نام ``C`` و یک نمونه‌ی :class:`Decimal` به نام ``x``، " +"عبارت ``C.exp(x)`` معادل ``x.exp(context=C)`` است. هر متد :class:`Context` در " +"هر جا که یک نمونه‌ی Decimal پذیرفته شود، یک عدد صحیح پایتون (نمونه‌ای " +"از :class:`int`) را می‌پذیرد." msgid "Resets all of the flags to ``0``." -msgstr "" +msgstr "همه‌ی پرچم‌ها را به ``0`` بازنشانی می‌کند." msgid "Resets all of the traps to ``0``." -msgstr "" +msgstr "همه‌ی تله‌ها را به ``0`` بازنشانی می‌کند." msgid "Return a duplicate of the context." -msgstr "" +msgstr "یک کپی از زمینه را برمی‌گرداند." msgid "Return a copy of the Decimal instance num." -msgstr "" +msgstr "یک رونوشت از نمونه‌ی Decimal به نام num برمی‌گرداند." -msgid "Creates a new Decimal instance from *num* but using *self* as context. Unlike the :class:`Decimal` constructor, the context precision, rounding method, flags, and traps are applied to the conversion." +msgid "" +"Creates a new Decimal instance from *num* but using *self* as context. Unlike " +"the :class:`Decimal` constructor, the context precision, rounding method, " +"flags, and traps are applied to the conversion." msgstr "" +"یک نمونه جدید از Decimal را از *num* ایجاد می‌کند، اما از *self* به‌عنوان زمینه " +"استفاده می‌کند. برخلاف سازنده‌ی :class:`Decimal`، دقت زمینه، روش گرد کردن، پرچم‌ها " +"و تله‌ها در تبدیل اعمال می‌شوند." -msgid "This is useful because constants are often given to a greater precision than is needed by the application. Another benefit is that rounding immediately eliminates unintended effects from digits beyond the current precision. In the following example, using unrounded inputs means that adding zero to a sum can change the result:" +msgid "" +"This is useful because constants are often given to a greater precision than is " +"needed by the application. Another benefit is that rounding immediately " +"eliminates unintended effects from digits beyond the current precision. In the " +"following example, using unrounded inputs means that adding zero to a sum can " +"change the result:" msgstr "" +"این مفید است، زیرا ثابت‌ها اغلب با دقتی بیشتر از حد نیاز برنامه ارائه می‌شوند. " +"مزیت دیگر این است که گرد کردن بلافاصله اثرات ناخواسته‌ی ارقام فراتر از دقت فعلی " +"را حذف می‌کند. در مثال زیر، استفاده از ورودی‌های گردنشده به این معناست که افزودن " +"صفر به یک مجموع می‌تواند نتیجه را تغییر دهد:" msgid "" ">>> getcontext().prec = 3\n" @@ -815,12 +1912,28 @@ msgid "" ">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" "Decimal('4.44')" msgstr "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.4445') + Decimal('1.0023')\n" +"Decimal('4.45')\n" +">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" +"Decimal('4.44')" -msgid "This method implements the to-number operation of the IBM specification. If the argument is a string, no leading or trailing whitespace or underscores are permitted." +msgid "" +"This method implements the to-number operation of the IBM specification. If the " +"argument is a string, no leading or trailing whitespace or underscores are " +"permitted." msgstr "" +"این متد عملیات تبدیل به عددِ مشخصات IBM را پیاده‌سازی می‌کند. اگر آرگومان یک رشته " +"باشد، هیچ‌گونه فضای سفید یا زیرخطی در ابتدا یا انتها مجاز نیست." -msgid "Creates a new Decimal instance from a float *f* but rounding using *self* as the context. Unlike the :meth:`Decimal.from_float` class method, the context precision, rounding method, flags, and traps are applied to the conversion." +msgid "" +"Creates a new Decimal instance from a float *f* but rounding using *self* as " +"the context. Unlike the :meth:`Decimal.from_float` class method, the context " +"precision, rounding method, flags, and traps are applied to the conversion." msgstr "" +"یک نمونه جدید Decimal از float *f* ایجاد می‌کند، اما گرد کردن با استفاده از " +"*self* به‌عنوان زمینه انجام می‌شود. برخلاف متد کلاس :meth:`Decimal.from_float`، " +"دقت زمینه، روش گرد کردن، پرچم‌ها و تله‌ها بر تبدیل اعمال می‌شوند." msgid "" ">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" @@ -832,321 +1945,472 @@ msgid "" " ...\n" "decimal.Inexact: None" msgstr "" +">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Decimal('3.1415')\n" +">>> context = Context(prec=5, traps=[Inexact])\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Traceback (most recent call last):\n" +" ...\n" +"decimal.Inexact: None" -msgid "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent value for subnormal results. When underflow occurs, the exponent is set to :const:`Etiny`." +msgid "" +"Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " +"value for subnormal results. When underflow occurs, the exponent is set " +"to :const:`Etiny`." msgstr "" +"مقداری برابر با ``Emin - prec + 1`` برمی‌گرداند که کمترین مقدار توان برای نتایج " +"زیرنرمال (subnormal) است. هنگامی که زیرریز (underflow) رخ می‌دهد، توان " +"روی :const:`Etiny` تنظیم می‌شود." msgid "Returns a value equal to ``Emax - prec + 1``." -msgstr "" +msgstr "مقداری برابر با ``Emax - prec + 1`` برمی‌گرداند." -msgid "The usual approach to working with decimals is to create :class:`Decimal` instances and then apply arithmetic operations which take place within the current context for the active thread. An alternative approach is to use context methods for calculating within a specific context. The methods are similar to those for the :class:`Decimal` class and are only briefly recounted here." -msgstr "" +msgid "" +"The usual approach to working with decimals is to create :class:`Decimal` " +"instances and then apply arithmetic operations which take place within the " +"current context for the active thread. An alternative approach is to use " +"context methods for calculating within a specific context. The methods are " +"similar to those for the :class:`Decimal` class and are only briefly recounted " +"here." +msgstr "" +"رویکرد معمول برای کار با اعداد اعشاری، ایجاد نمونه‌های :class:`Decimal` و سپس " +"اعمال عملیات حسابی است که در زمینه‌ی جاری برای نخ فعال انجام می‌شوند. رویکرد " +"جایگزین، استفاده از متدهای زمینه برای محاسبه در یک زمینه‌ی مشخص است. این متدها " +"مشابه متدهای کلاس :class:`Decimal` هستند و در اینجا تنها به‌اختصار بازگو شده‌اند." msgid "Returns the absolute value of *x*." -msgstr "" +msgstr "مقدار مطلق *x* را برمی‌گرداند." msgid "Return the sum of *x* and *y*." -msgstr "" +msgstr "مجموع *x* و *y* را برمی‌گرداند." msgid "Returns the same Decimal object *x*." -msgstr "" +msgstr "همان شیء Decimal یعنی *x* را بازمی‌گرداند." msgid "Compares *x* and *y* numerically." -msgstr "" +msgstr "*x* و *y* را به‌صورت عددی مقایسه می‌کند." msgid "Compares the values of the two operands numerically." -msgstr "" +msgstr "مقادیر دو عملوند را به‌صورت عددی مقایسه می‌کند." msgid "Compares two operands using their abstract representation." -msgstr "" +msgstr "دو عملوند را با استفاده از نمایش انتزاعی آن‌ها مقایسه می‌کند." msgid "Compares two operands using their abstract representation, ignoring sign." msgstr "" +"دو عملوند را با استفاده از بازنمایی انتزاعی آن‌ها، با چشم‌پوشی از علامت، مقایسه " +"می‌کند." msgid "Returns a copy of *x* with the sign set to 0." -msgstr "" +msgstr "نسخه‌ای از *x* برمی‌گرداند که علامت آن روی ۰ تنظیم شده است." msgid "Returns a copy of *x* with the sign inverted." -msgstr "" +msgstr "یک کپی از *x* با علامت معکوس‌شده برمی‌گرداند." msgid "Copies the sign from *y* to *x*." -msgstr "" +msgstr "علامت را از *y* به *x* کپی می‌کند." msgid "Return *x* divided by *y*." -msgstr "" +msgstr "*x* تقسیم‌شده بر *y* را برمی‌گرداند." msgid "Return *x* divided by *y*, truncated to an integer." -msgstr "" +msgstr "حاصل تقسیم *x* بر *y* را به‌صورت یک عدد صحیح بریده‌شده برمی‌گرداند." msgid "Divides two numbers and returns the integer part of the result." -msgstr "" +msgstr "دو عدد را تقسیم می‌کند و بخش صحیح نتیجه را برمی‌گرداند." msgid "Returns ``e ** x``." -msgstr "" +msgstr "``e ** x`` را برمی‌گرداند." msgid "Returns *x* multiplied by *y*, plus *z*." -msgstr "" +msgstr "حاصل‌ضرب *x* در *y* به‌علاوه *z* را برمی‌گرداند." msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" +"اگر *x* کانونیکال (canonical) باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت " +"``False`` را برمی‌گرداند." msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "" +"اگر *x* متناهی باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را " +"برمی‌گرداند." msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "" +"اگر *x* بی‌نهایت باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را " +"برمی‌گرداند." msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" +"اگر *x* یک qNaN یا sNaN باشد، ``True`` برمی‌گرداند؛ در غیر این صورت ``False`` " +"برمی‌گرداند." msgid "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" +"اگر *x* یک عدد عادی باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را " +"برمی‌گرداند." msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" +"اگر *x* یک NaN ساکت (quiet NaN) باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت " +"``False`` را برمی‌گرداند." msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" +"اگر *x* منفی باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را " +"برمی‌گرداند." msgid "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" +"اگر *x* یک NaN سیگنال‌دهنده (signaling NaN) باشد، ``True`` را برمی‌گرداند؛ در غیر " +"این صورت ``False`` را برمی‌گرداند." msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" +"اگر *x* زیرنرمال (subnormal) باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت " +"``False`` را برمی‌گرداند." msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "" +"اگر *x* صفر باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را " +"برمی‌گرداند." msgid "Returns the natural (base e) logarithm of *x*." -msgstr "" +msgstr "لگاریتم طبیعی *x* (مبنای e) را برمی‌گرداند." msgid "Returns the base 10 logarithm of *x*." -msgstr "" +msgstr "لگاریتم *x* در مبنای ۱۰ را برمی‌گرداند." msgid "Returns the exponent of the magnitude of the operand's MSD." -msgstr "" +msgstr "توان مرتبه‌ی بزرگی پرارزش‌ترین رقم (MSD) عملوند را برمی‌گرداند." msgid "Applies the logical operation *and* between each operand's digits." -msgstr "" +msgstr "عملیات منطقی *and* را بین رقم‌های هر عملوند اعمال می‌کند." msgid "Invert all the digits in *x*." -msgstr "" +msgstr "تمام ارقام *x* را معکوس کنید." msgid "Applies the logical operation *or* between each operand's digits." -msgstr "" +msgstr "عملیات منطقی *or* را بین ارقام هر عملوند اعمال می‌کند." msgid "Applies the logical operation *xor* between each operand's digits." -msgstr "" +msgstr "عملیات منطقی *xor* را بین رقم‌های هر عملوند اعمال می‌کند." msgid "Compares two values numerically and returns the maximum." -msgstr "" +msgstr "دو مقدار را به‌صورت عددی مقایسه می‌کند و بیشینه را برمی‌گرداند." msgid "Compares the values numerically with their sign ignored." -msgstr "" +msgstr "مقادیر را به‌صورت عددی با نادیده گرفتن علامت آن‌ها مقایسه می‌کند." msgid "Compares two values numerically and returns the minimum." -msgstr "" +msgstr "دو مقدار را به‌صورت عددی مقایسه می‌کند و کمینه را برمی‌گرداند." msgid "Minus corresponds to the unary prefix minus operator in Python." -msgstr "" +msgstr "منها با عملگر پیشوندی یک‌عملوندی منها در پایتون متناظر است." msgid "Return the product of *x* and *y*." -msgstr "" +msgstr "حاصل‌ضرب *x* و *y* را برمی‌گرداند." msgid "Returns the largest representable number smaller than *x*." -msgstr "" +msgstr "بزرگ‌ترین عدد قابل نمایش کوچک‌تر از *x* را بازمی‌گرداند." msgid "Returns the smallest representable number larger than *x*." -msgstr "" +msgstr "کوچک‌ترین عدد قابل‌نمایش بزرگ‌تر از *x* را برمی‌گرداند." msgid "Returns the number closest to *x*, in direction towards *y*." -msgstr "" +msgstr "نزدیک‌ترین عدد به *x* را در جهت به سمت *y* برمی‌گرداند." msgid "Reduces *x* to its simplest form." -msgstr "" +msgstr "*x* را به ساده‌ترین شکل خود تقلیل می‌دهد." msgid "Returns an indication of the class of *x*." -msgstr "" +msgstr "نشانگر کلاس *x* را برمی‌گرداند." -msgid "Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is *not* an identity operation." +msgid "" +"Plus corresponds to the unary prefix plus operator in Python. This operation " +"applies the context precision and rounding, so it is *not* an identity " +"operation." msgstr "" +"Plus معادل عملگر یک‌دایی پیش‌وندی پلاس در پایتون است. این عملیات دقت و گرد کردن " +"زمینه را اعمال می‌کند، بنابراین یک عملیات همانی *نیست*." msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" +"``x`` به توان ``y`` را برمی‌گرداند و در صورت داده شدن، به پیمانه‌ی ``modulo`` " +"کاهش می‌یابد." -msgid "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must be integral. The result will be inexact unless ``y`` is integral and the result is finite and can be expressed exactly in 'precision' digits. The rounding mode of the context is used. Results are always correctly rounded in the Python version." +msgid "" +"With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must be " +"integral. The result will be inexact unless ``y`` is integral and the result " +"is finite and can be expressed exactly in 'precision' digits. The rounding mode " +"of the context is used. Results are always correctly rounded in the Python " +"version." msgstr "" +"با دو آرگومان، ``x**y`` محاسبه می‌شود. اگر ``x`` منفی باشد، ``y`` باید عدد صحیح " +"باشد. نتیجه نادقیق خواهد بود، مگر اینکه ``y`` عدد صحیح باشد و نتیجه متناهی باشد " +"و بتوان آن را دقیقاً با 'precision' رقم بیان کرد. از حالت گرد کردن زمینه استفاده " +"می‌شود. نتایج در نسخه‌ی پایتون همیشه به‌درستی گرد می‌شوند." -msgid "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if ``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." +msgid "" +"``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " +"``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" +"``Decimal(0) ** Decimal(0)`` منجر به ``InvalidOperation`` می‌شود، و اگر " +"``InvalidOperation`` به دام نیفتد، نتیجه ``Decimal('NaN')`` خواهد بود." -msgid "The C module computes :meth:`power` in terms of the correctly rounded :meth:`exp` and :meth:`ln` functions. The result is well-defined but only \"almost always correctly rounded\"." +msgid "" +"The C module computes :meth:`power` in terms of the correctly " +"rounded :meth:`exp` and :meth:`ln` functions. The result is well-defined but " +"only \"almost always correctly rounded\"." msgstr "" +"ماژول C، :meth:`power` را بر حسب توابع :meth:`exp` و :meth:`ln` که به‌درستی گرد " +"شده‌اند محاسبه می‌کند. نتیجه خوش‌تعریف است، اما فقط «تقریباً همیشه به‌درستی گرد شده» " +"است." -msgid "With three arguments, compute ``(x**y) % modulo``. For the three argument form, the following restrictions on the arguments hold:" +msgid "" +"With three arguments, compute ``(x**y) % modulo``. For the three argument " +"form, the following restrictions on the arguments hold:" msgstr "" +"با سه آرگومان، ``(x**y) % modulo`` را محاسبه می‌کند. برای قالب با سه آرگومان، " +"محدودیت‌های زیر روی آرگومان‌ها برقرار است:" msgid "all three arguments must be integral" -msgstr "" +msgstr "هر سه آرگومان باید عدد صحیح باشند" msgid "``y`` must be nonnegative" -msgstr "" +msgstr "``y`` باید غیرمنفی باشد" msgid "at least one of ``x`` or ``y`` must be nonzero" -msgstr "" +msgstr "حداقل یکی از ``x`` یا ``y`` باید غیرصفر باشد" msgid "``modulo`` must be nonzero and have at most 'precision' digits" -msgstr "" +msgstr "``modulo`` باید غیرصفر باشد و حداکثر 'precision' رقم داشته باشد" -msgid "The value resulting from ``Context.power(x, y, modulo)`` is equal to the value that would be obtained by computing ``(x**y) % modulo`` with unbounded precision, but is computed more efficiently. The exponent of the result is zero, regardless of the exponents of ``x``, ``y`` and ``modulo``. The result is always exact." +msgid "" +"The value resulting from ``Context.power(x, y, modulo)`` is equal to the value " +"that would be obtained by computing ``(x**y) % modulo`` with unbounded " +"precision, but is computed more efficiently. The exponent of the result is " +"zero, regardless of the exponents of ``x``, ``y`` and ``modulo``. The result " +"is always exact." msgstr "" +"مقدار حاصل از ``Context.power(x, y, modulo)`` برابر با مقداری است که از محاسبه‌ی " +"``(x**y) % modulo`` با دقت نامحدود به دست می‌آید، اما به‌صورت کارآمدتری محاسبه " +"می‌شود. توان نتیجه صفر است، صرف‌نظر از توان‌های ``x``، ``y`` و ``modulo``. نتیجه " +"همیشه دقیق است." msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." -msgstr "" +msgstr "مقداری برابر با *x* (گردشده) برمی‌گرداند که دارای توان *y* است." msgid "Just returns 10, as this is Decimal, :)" -msgstr "" +msgstr "فقط ۱۰ را برمی‌گرداند، زیرا این Decimal است، :)" msgid "Returns the remainder from integer division." -msgstr "" +msgstr "باقی‌مانده‌ی تقسیم عدد صحیح را برمی‌گرداند." -msgid "The sign of the result, if non-zero, is the same as that of the original dividend." -msgstr "" +msgid "" +"The sign of the result, if non-zero, is the same as that of the original " +"dividend." +msgstr "علامت نتیجه، اگر غیرصفر باشد، همان علامت مقسوم اصلی است." -msgid "Returns ``x - y * n``, where *n* is the integer nearest the exact value of ``x / y`` (if the result is 0 then its sign will be the sign of *x*)." +msgid "" +"Returns ``x - y * n``, where *n* is the integer nearest the exact value of " +"``x / y`` (if the result is 0 then its sign will be the sign of *x*)." msgstr "" +"``x - y * n`` را برمی‌گرداند، که در آن *n* نزدیک‌ترین عدد صحیح به مقدار دقیق " +"``x / y`` است (اگر نتیجه ۰ باشد، علامت آن علامت *x* خواهد بود)." msgid "Returns a rotated copy of *x*, *y* times." -msgstr "" +msgstr "نسخه‌ای چرخش‌یافته از *x* را به تعداد *y* بار برمی‌گرداند." msgid "Returns ``True`` if the two operands have the same exponent." -msgstr "" +msgstr "اگر دو عملوند توان یکسانی داشته باشند، ``True`` برمی‌گرداند." msgid "Returns the first operand after adding the second value its exp." -msgstr "" +msgstr "اولین عملوند را پس از افزودن مقدار دوم به توان آن برمی‌گرداند." msgid "Returns a shifted copy of *x*, *y* times." -msgstr "" +msgstr "رونوشتی از *x* برمی‌گرداند که *y* بار جابه‌جاشده است." msgid "Square root of a non-negative number to context precision." -msgstr "" +msgstr "ریشه دوم یک عدد غیرمنفی تا دقت زمینه." msgid "Return the difference between *x* and *y*." -msgstr "" +msgstr "اختلاف بین *x* و *y* را برمی‌گرداند." msgid "Rounds to an integer." -msgstr "" +msgstr "به یک عدد صحیح گرد می‌شود." msgid "Converts a number to a string using scientific notation." -msgstr "" +msgstr "یک عدد را با استفاده از نماد علمی به رشته تبدیل می‌کند." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" -msgid "The constants in this section are only relevant for the C module. They are also included in the pure Python version for compatibility." +msgid "" +"The constants in this section are only relevant for the C module. They are also " +"included in the pure Python version for compatibility." msgstr "" +"ثابت‌های این بخش تنها برای ماژول C مرتبط هستند. این ثابت‌ها برای سازگاری در نسخه " +"پایتون خالص نیز گنجانده شده‌اند." msgid "32-bit" -msgstr "" +msgstr "۳۲ بیتی" msgid "64-bit" -msgstr "" +msgstr "۶۴ بیتی" msgid "``425000000``" -msgstr "" +msgstr "``425000000``" msgid "``999999999999999999``" -msgstr "" +msgstr "``999999999999999999``" msgid "``-425000000``" -msgstr "" +msgstr "``-425000000``" msgid "``-999999999999999999``" -msgstr "" +msgstr "``-999999999999999999``" msgid "``-849999999``" -msgstr "" +msgstr "``-849999999``" msgid "``-1999999999999999997``" -msgstr "" +msgstr "``-1999999999999999997``" msgid "``256``" -msgstr "" +msgstr "``256``" msgid "``512``" -msgstr "" +msgstr "``512``" msgid "The value is ``True``. Deprecated, because Python now always has threads." -msgstr "" +msgstr "مقدار ``True`` است. منسوخ شده است، زیرا پایتون اکنون همیشه نخ دارد." -msgid "The default value is ``True``. If Python is :option:`configured using the --without-decimal-contextvar option <--without-decimal-contextvar>`, the C version uses a thread-local rather than a coroutine-local context and the value is ``False``. This is slightly faster in some nested context scenarios." +msgid "" +"The default value is ``True``. If Python is :option:`configured using the --" +"without-decimal-contextvar option <--without-decimal-contextvar>`, the C " +"version uses a thread-local rather than a coroutine-local context and the value " +"is ``False``. This is slightly faster in some nested context scenarios." msgstr "" +"مقدار پیش‌فرض ``True`` است. اگر پایتون :option:`با گزینه‌ی --without-decimal-" +"contextvar پیکربندی شده باشد <--without-decimal-contextvar>`، نسخه‌ی C به‌جای " +"زمینه‌ی محلی به هم‌روال از زمینه‌ی محلی به نخ استفاده می‌کند و مقدار ``False`` " +"خواهد بود. این حالت در برخی سناریوهای زمینه‌ی تودرتو کمی سریع‌تر است." msgid "Rounding modes" -msgstr "" +msgstr "حالت‌های گرد کردن" msgid "Round towards ``Infinity``." -msgstr "" +msgstr "گرد کردن به سمت ``Infinity``." msgid "Round towards zero." -msgstr "" +msgstr "گرد کردن به سمت صفر." msgid "Round towards ``-Infinity``." -msgstr "" +msgstr "گرد کردن به سمت ``-Infinity``." msgid "Round to nearest with ties going towards zero." -msgstr "" +msgstr "گرد کردن به نزدیک‌ترین مقدار، در موارد مساوی به سمت صفر." msgid "Round to nearest with ties going to nearest even integer." msgstr "" +"گرد کردن به نزدیک‌ترین مقدار، به‌طوری که موارد تساوی به نزدیک‌ترین عدد صحیح زوج " +"گرد شوند." msgid "Round to nearest with ties going away from zero." msgstr "" +"گرد کردن به نزدیک‌ترین مقدار، به‌طوری که در موارد تساوی، دور از صفر گرد می‌شود." msgid "Round away from zero." -msgstr "" +msgstr "گرد کردن به دور از صفر." -msgid "Round away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise round towards zero." +msgid "" +"Round away from zero if last digit after rounding towards zero would have been " +"0 or 5; otherwise round towards zero." msgstr "" +"اگر آخرین رقم پس از گرد کردن به سمت صفر، ۰ یا ۵ باشد، به دور از صفر گرد می‌شود؛ " +"در غیر این صورت به سمت صفر گرد می‌شود." msgid "Signals" -msgstr "" +msgstr "سیگنال‌ها" -msgid "Signals represent conditions that arise during computation. Each corresponds to one context flag and one context trap enabler." +msgid "" +"Signals represent conditions that arise during computation. Each corresponds to " +"one context flag and one context trap enabler." msgstr "" +"سیگنال‌ها نشان‌دهنده‌ی شرایطی هستند که در حین محاسبه رخ می‌دهند. هر یک با " +"یک پرچم زمینه و یک فعال‌ساز تله‌ی زمینه متناظر است." -msgid "The context flag is set whenever the condition is encountered. After the computation, flags may be checked for informational purposes (for instance, to determine whether a computation was exact). After checking the flags, be sure to clear all flags before starting the next computation." +msgid "" +"The context flag is set whenever the condition is encountered. After the " +"computation, flags may be checked for informational purposes (for instance, to " +"determine whether a computation was exact). After checking the flags, be sure " +"to clear all flags before starting the next computation." msgstr "" +"پرچم زمینه هرگاه که شرط رخ دهد تنظیم می‌شود. پس از محاسبه، پرچم‌ها را می‌توان " +"برای اهداف اطلاع‌رسانی بررسی کرد (برای نمونه، برای تعیین اینکه آیا یک محاسبه " +"دقیق بوده است). پس از بررسی پرچم‌ها، حتماً همه‌ی پرچم‌ها را پیش از آغاز " +"محاسبه‌ی بعدی پاک کنید." -msgid "If the context's trap enabler is set for the signal, then the condition causes a Python exception to be raised. For example, if the :class:`DivisionByZero` trap is set, then a :exc:`DivisionByZero` exception is raised upon encountering the condition." +msgid "" +"If the context's trap enabler is set for the signal, then the condition causes " +"a Python exception to be raised. For example, if the :class:`DivisionByZero` " +"trap is set, then a :exc:`DivisionByZero` exception is raised upon encountering " +"the condition." msgstr "" +"اگر فعال‌ساز تله‌ی زمینه برای سیگنال تنظیم شده باشد، آنگاه شرط باعث پرتاب یک " +"استثنای پایتون می‌شود. برای مثال، اگر تله‌ی :class:`DivisionByZero` تنظیم " +"شده باشد، هنگام مواجهه با شرط، یک استثنای :exc:`DivisionByZero` پرتاب می‌شود." msgid "Altered an exponent to fit representation constraints." -msgstr "" +msgstr "توانی برای تطابق با محدودیت‌های بازنمایی تغییر داده شد." -msgid "Typically, clamping occurs when an exponent falls outside the context's :attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the exponent is reduced to fit by adding zeros to the coefficient." +msgid "" +"Typically, clamping occurs when an exponent falls outside the " +"context's :attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, " +"the exponent is reduced to fit by adding zeros to the coefficient." msgstr "" +"معمولاً، محدودسازی (clamping) زمانی رخ می‌دهد که یک توان خارج از " +"محدوده‌های :attr:`~Context.Emin` و :attr:`~Context.Emax` زمینه قرار گیرد. در " +"صورت امکان، توان با افزودن صفر به ضریب کاهش می‌یابد تا در محدوده قرار گیرد." msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." -msgstr "" +msgstr "کلاس پایه برای سایر سیگنال‌ها و زیرکلاسی از :exc:`ArithmeticError`." msgid "Signals the division of a non-infinite number by zero." -msgstr "" +msgstr "نشان‌دهنده تقسیم یک عدد غیربی‌نهایت بر صفر است." -msgid "Can occur with division, modulo division, or when raising a number to a negative power. If this signal is not trapped, returns ``Infinity`` or ``-Infinity`` with the sign determined by the inputs to the calculation." +msgid "" +"Can occur with division, modulo division, or when raising a number to a " +"negative power. If this signal is not trapped, returns ``Infinity`` or ``-" +"Infinity`` with the sign determined by the inputs to the calculation." msgstr "" +"ممکن است در تقسیم، تقسیم پیمانه‌ای، یا هنگام رساندن یک عدد به توان منفی رخ دهد. " +"اگر این سیگنال به دام نیفتد، ``Infinity`` یا ``-Infinity`` را با علامتی که توسط " +"ورودی‌های محاسبه تعیین می‌شود برمی‌گرداند." msgid "Indicates that rounding occurred and the result is not exact." -msgstr "" +msgstr "نشان می‌دهد که گرد کردن رخ داده است و نتیجه دقیق نیست." -msgid "Signals when non-zero digits were discarded during rounding. The rounded result is returned. The signal flag or trap is used to detect when results are inexact." +msgid "" +"Signals when non-zero digits were discarded during rounding. The rounded result " +"is returned. The signal flag or trap is used to detect when results are " +"inexact." msgstr "" +"سیگنال زمانی رخ می‌دهد که رقم‌های غیرصفر در حین گرد کردن دور ریخته شوند. " +"نتیجه‌ی گرد شده بازگردانده می‌شود. پرچم سیگنال یا تله برای تشخیص زمانی که " +"نتایج نادقیق هستند استفاده می‌شود." msgid "An invalid operation was performed." -msgstr "" +msgstr "یک عملیات نامعتبر انجام شد." -msgid "Indicates that an operation was requested that does not make sense. If not trapped, returns ``NaN``. Possible causes include::" +msgid "" +"Indicates that an operation was requested that does not make sense. If not " +"trapped, returns ``NaN``. Possible causes include::" msgstr "" +"نشان می‌دهد که عملیاتی درخواست شده است که معنادار نیست. اگر تله‌گذاری (trap) نشده " +"باشد، ``NaN`` را برمی‌گرداند. علل احتمالی عبارت‌اند از::" msgid "" "Infinity - Infinity\n" @@ -1159,42 +2423,91 @@ msgid "" "x ** (non-integer)\n" "x ** Infinity" msgstr "" +"بی نهایت - بی نهایت\n" +"0 * بی نهایت\n" +"بی نهایت / بی نهایت\n" +"x % 0\n" +"بی نهایت % x\n" +"sqrt(-x) و x > 0\n" +"0 ** 0\n" +"x ** (غیر عدد صحیح)\n" +"x ** بی نهایت" msgid "Numerical overflow." -msgstr "" +msgstr "سرریز عددی." -msgid "Indicates the exponent is larger than :attr:`Context.Emax` after rounding has occurred. If not trapped, the result depends on the rounding mode, either pulling inward to the largest representable finite number or rounding outward to ``Infinity``. In either case, :class:`Inexact` and :class:`Rounded` are also signaled." +msgid "" +"Indicates the exponent is larger than :attr:`Context.Emax` after rounding has " +"occurred. If not trapped, the result depends on the rounding mode, either " +"pulling inward to the largest representable finite number or rounding outward " +"to ``Infinity``. In either case, :class:`Inexact` and :class:`Rounded` are " +"also signaled." msgstr "" +"نشان می‌دهد که توان پس از انجام گرد کردن، بزرگ‌تر از :attr:`Context.Emax` است. " +"اگر تله‌گذاری نشده باشد، نتیجه به حالت گرد کردن بستگی دارد؛ یا به سمت داخل به " +"بزرگ‌ترین عدد متناهی قابل نمایش کشیده می‌شود یا به سمت خارج به ``Infinity`` گرد " +"می‌شود. در هر صورت، :class:`Inexact` و :class:`Rounded` نیز علامت داده می‌شوند." msgid "Rounding occurred though possibly no information was lost." -msgstr "" +msgstr "گرد کردن رخ داد، هرچند ممکن است اطلاعاتی از دست نرفته باشد." -msgid "Signaled whenever rounding discards digits; even if those digits are zero (such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result unchanged. This signal is used to detect loss of significant digits." +msgid "" +"Signaled whenever rounding discards digits; even if those digits are zero (such " +"as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " +"unchanged. This signal is used to detect loss of significant digits." msgstr "" +"این سیگنال هرگاه گرد کردن باعث حذف ارقامی شود، داده می‌شود؛ حتی اگر آن ارقام صفر " +"باشند (مانند گرد کردن ``5.00`` به ``5.0``). اگر به دام نیفتد، نتیجه بدون تغییر " +"برگردانده می‌شود. این سیگنال برای تشخیص از دست رفتن ارقام معنادار استفاده می‌شود." msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." -msgstr "" +msgstr "توان پیش از گرد کردن کمتر از :attr:`~Context.Emin` بود." -msgid "Occurs when an operation result is subnormal (the exponent is too small). If not trapped, returns the result unchanged." +msgid "" +"Occurs when an operation result is subnormal (the exponent is too small). If " +"not trapped, returns the result unchanged." msgstr "" +"هنگامی رخ می‌دهد که نتیجه‌ی یک عملیات زیرنرمال باشد (توان بیش از حد کوچک " +"باشد). اگر تله برای آن فعال نباشد، نتیجه بدون تغییر بازگردانده می‌شود." msgid "Numerical underflow with result rounded to zero." -msgstr "" +msgstr "زیرریز عددی با نتیجه‌ای که به صفر گرد شده است." -msgid "Occurs when a subnormal result is pushed to zero by rounding. :class:`Inexact` and :class:`Subnormal` are also signaled." +msgid "" +"Occurs when a subnormal result is pushed to zero by rounding. :class:`Inexact` " +"and :class:`Subnormal` are also signaled." msgstr "" +"هنگامی رخ می‌دهد که یک نتیجه زیرنرمال (subnormal) بر اثر گرد کردن به صفر رانده " +"شود. :class:`Inexact` و :class:`Subnormal` نیز سیگنال داده می‌شوند." msgid "Enable stricter semantics for mixing floats and Decimals." -msgstr "" +msgstr "فعال‌سازی معناشناسی سخت‌گیرانه‌تر برای ترکیب اعداد اعشاری و Decimalها." -msgid "If the signal is not trapped (default), mixing floats and Decimals is permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal.Context.create_decimal` and all comparison operators. Both conversion and comparisons are exact. Any occurrence of a mixed operation is silently recorded by setting :exc:`FloatOperation` in the context flags. Explicit conversions with :meth:`~decimal.Decimal.from_float` or :meth:`~decimal.Context.create_decimal_from_float` do not set the flag." -msgstr "" +msgid "" +"If the signal is not trapped (default), mixing floats and Decimals is permitted " +"in the :class:`~decimal.Decimal` " +"constructor, :meth:`~decimal.Context.create_decimal` and all comparison " +"operators. Both conversion and comparisons are exact. Any occurrence of a mixed " +"operation is silently recorded by setting :exc:`FloatOperation` in the context " +"flags. Explicit conversions with :meth:`~decimal.Decimal.from_float` " +"or :meth:`~decimal.Context.create_decimal_from_float` do not set the flag." +msgstr "" +"اگر سیگنال به دام نیفتد (پیش‌فرض)، ترکیب شناورها و Decimalها در " +"سازنده‌ی :class:`~decimal.Decimal`، :meth:`~decimal.Context.create_decimal` و " +"تمام عملگرهای مقایسه‌ای مجاز است. هم تبدیل‌ها و هم مقایسه‌ها دقیق هستند. هر بار " +"وقوع یک عملیات مختلط، به‌صورت خاموش با تنظیم :exc:`FloatOperation` در پرچم‌های " +"زمینه ثبت می‌شود. تبدیل‌های صریح با :meth:`~decimal.Decimal.from_float` " +"یا :meth:`~decimal.Context.create_decimal_from_float` این پرچم را تنظیم نمی‌کنند." -msgid "Otherwise (the signal is trapped), only equality comparisons and explicit conversions are silent. All other mixed operations raise :exc:`FloatOperation`." +msgid "" +"Otherwise (the signal is trapped), only equality comparisons and explicit " +"conversions are silent. All other mixed operations raise :exc:`FloatOperation`." msgstr "" +"در غیر این صورت (سیگنال به دام افتاده است)، فقط مقایسه‌های برابری و تبدیل‌های " +"صریح بی‌صدا هستند. تمام عملیات مختلط دیگر :exc:`FloatOperation` را پرتاب می‌کنند." msgid "The following table summarizes the hierarchy of signals::" -msgstr "" +msgstr "جدول زیر سلسله‌مراتب سیگنال‌ها را خلاصه می‌کند::" msgid "" "exceptions.ArithmeticError(exceptions.Exception)\n" @@ -1209,18 +2522,44 @@ msgid "" " Subnormal\n" " FloatOperation(DecimalException, exceptions.TypeError)" msgstr "" +"exceptions.ArithmeticError(exceptions.Exception)\n" +" DecimalException\n" +" Clamped\n" +" DivisionByZero(DecimalException, exceptions.ZeroDivisionError)\n" +" Inexact\n" +" Overflow(Inexact, Rounded)\n" +" Underflow(Inexact, Rounded, Subnormal)\n" +" InvalidOperation\n" +" Rounded\n" +" Subnormal\n" +" FloatOperation(DecimalException, exceptions.TypeError)" -msgid "Floating-point notes" -msgstr "" - -msgid "Mitigating round-off error with increased precision" -msgstr "" - -msgid "The use of decimal floating point eliminates decimal representation error (making it possible to represent ``0.1`` exactly); however, some operations can still incur round-off error when non-zero digits exceed the fixed precision." +msgid "Floating-point notes" +msgstr "نکات مربوط به اعداد اعشاری" + +msgid "Mitigating round-off error with increased precision" +msgstr "کاهش خطای گرد کردن با افزایش دقت" + +msgid "" +"The use of decimal floating point eliminates decimal representation error " +"(making it possible to represent ``0.1`` exactly); however, some operations can " +"still incur round-off error when non-zero digits exceed the fixed precision." msgstr "" +"استفاده از ممیز شناور اعشاری، خطای بازنمایی اعشاری را برطرف می‌کند (و امکان " +"بازنمایی دقیق ``0.1`` را ممکن می‌سازد)؛ با این حال، برخی عملیات هنوز ممکن است " +"دچار خطای گرد کردن شوند، هنگامی که ارقام غیرصفر از دقت ثابت بیشتر شوند." -msgid "The effects of round-off error can be amplified by the addition or subtraction of nearly offsetting quantities resulting in loss of significance. Knuth provides two instructive examples where rounded floating-point arithmetic with insufficient precision causes the breakdown of the associative and distributive properties of addition:" +msgid "" +"The effects of round-off error can be amplified by the addition or subtraction " +"of nearly offsetting quantities resulting in loss of significance. Knuth " +"provides two instructive examples where rounded floating-point arithmetic with " +"insufficient precision causes the breakdown of the associative and distributive " +"properties of addition:" msgstr "" +"اثرات خطای گرد کردن می‌تواند با جمع یا تفریق کمیت‌هایی که تقریباً یکدیگر را خنثی " +"می‌کنند، تشدید شود و به از دست رفتن ارقام معنادار بینجامد. کنوت دو مثال آموزنده " +"ارائه می‌دهد که در آن‌ها حساب ممیز شناور گردشده با دقت ناکافی باعث از کار افتادن " +"ویژگی‌های شرکت‌پذیری و توزیع‌پذیری جمع می‌شود:" msgid "" "# Examples from Seminumerical Algorithms, Section 4.2.2.\n" @@ -1239,9 +2578,28 @@ msgid "" ">>> u * (v+w)\n" "Decimal('0.0060000')" msgstr "" +"# Examples from Seminumerical Algorithms, Section 4.2.2.\n" +">>> from decimal import Decimal, getcontext\n" +">>> getcontext().prec = 8\n" +"\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.5111111')\n" +">>> u + (v + w)\n" +"Decimal('10')\n" +"\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.01')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" -msgid "The :mod:`!decimal` module makes it possible to restore the identities by expanding the precision sufficiently to avoid loss of significance:" +msgid "" +"The :mod:`!decimal` module makes it possible to restore the identities by " +"expanding the precision sufficiently to avoid loss of significance:" msgstr "" +"ماژول :mod:`!decimal` امکان برقراری مجدد اتحادها را با افزایش دقت به‌اندازه کافی " +"برای جلوگیری از از دست رفتن معناداری فراهم می‌کند:" msgid "" ">>> getcontext().prec = 20\n" @@ -1257,51 +2615,184 @@ msgid "" ">>> u * (v+w)\n" "Decimal('0.0060000')" msgstr "" +">>> getcontext().prec = 20\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.51111111')\n" +">>> u + (v + w)\n" +"Decimal('9.51111111')\n" +">>>\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.0060000')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" msgid "Special values" -msgstr "" +msgstr "مقادیر خاص" -msgid "The number system for the :mod:`!decimal` module provides special values including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, ``+0`` and ``-0``." +msgid "" +"The number system for the :mod:`!decimal` module provides special values " +"including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, ``+0`` " +"and ``-0``." msgstr "" +"سیستم اعداد ماژول :mod:`!decimal` مقادیر ویژه‌ای از جمله ``NaN``، ``sNaN``، ``-" +"Infinity``، ``Infinity`` و دو صفر، ``+0`` و ``-0`` را فراهم می‌کند." -msgid "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, they can arise from dividing by zero when the :exc:`DivisionByZero` signal is not trapped. Likewise, when the :exc:`Overflow` signal is not trapped, infinity can result from rounding beyond the limits of the largest representable number." -msgstr "" +msgid "" +"Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " +"they can arise from dividing by zero when the :exc:`DivisionByZero` signal is " +"not trapped. Likewise, when the :exc:`Overflow` signal is not trapped, " +"infinity can result from rounding beyond the limits of the largest " +"representable number." +msgstr "" +"بی‌نهایت‌ها را می‌توان مستقیماً با ``Decimal('Infinity')`` ساخت. همچنین، آن‌ها " +"می‌توانند در اثر تقسیم بر صفر، زمانی که سیگنال :exc:`DivisionByZero` به دام " +"نیفتاده باشد، به وجود آیند. به همین ترتیب، زمانی که سیگنال :exc:`Overflow` به " +"دام نیفتاده باشد، بی‌نهایت می‌تواند در اثر گرد کردن فراتر از محدوده‌ی بزرگ‌ترین عدد " +"قابل نمایش حاصل شود." -msgid "The infinities are signed (affine) and can be used in arithmetic operations where they get treated as very large, indeterminate numbers. For instance, adding a constant to infinity gives another infinite result." +msgid "" +"The infinities are signed (affine) and can be used in arithmetic operations " +"where they get treated as very large, indeterminate numbers. For instance, " +"adding a constant to infinity gives another infinite result." msgstr "" +"بی‌نهایت‌ها علامت‌دار (affine) هستند و می‌توان از آن‌ها در عملیات حسابی استفاده کرد، " +"که در آن‌ها به‌عنوان اعدادی بسیار بزرگ و نامعین در نظر گرفته می‌شوند. برای مثال، " +"افزودن یک ثابت به بی‌نهایت، نتیجه‌ی بی‌نهایت دیگری می‌دهد." -msgid "Some operations are indeterminate and return ``NaN``, or if the :exc:`InvalidOperation` signal is trapped, raise an exception. For example, ``0/0`` returns ``NaN`` which means \"not a number\". This variety of ``NaN`` is quiet and, once created, will flow through other computations always resulting in another ``NaN``. This behavior can be useful for a series of computations that occasionally have missing inputs --- it allows the calculation to proceed while flagging specific results as invalid." -msgstr "" +msgid "" +"Some operations are indeterminate and return ``NaN``, or if " +"the :exc:`InvalidOperation` signal is trapped, raise an exception. For " +"example, ``0/0`` returns ``NaN`` which means \"not a number\". This variety of " +"``NaN`` is quiet and, once created, will flow through other computations always " +"resulting in another ``NaN``. This behavior can be useful for a series of " +"computations that occasionally have missing inputs --- it allows the " +"calculation to proceed while flagging specific results as invalid." +msgstr "" +"برخی عملیات‌ها نامعین هستند و ``NaN`` را برمی‌گردانند، یا اگر " +"سیگنال :exc:`InvalidOperation` به دام افتاده باشد، استثنایی را پرتاب می‌کنند. " +"برای مثال، ``0/0`` مقدار ``NaN`` را برمی‌گرداند که به معنای «عدد نیست» است. این " +"نوع ``NaN`` ساکت (quiet) است و پس از ایجاد، در دیگر محاسبات جریان می‌یابد و " +"همیشه به ``NaN`` دیگری منجر می‌شود. این رفتار می‌تواند برای مجموعه‌ای از محاسبات " +"که گاهی ورودی‌های ناموجود دارند مفید باشد — این امر اجازه می‌دهد محاسبه ادامه " +"یابد، در حالی که نتایج خاصی را به‌عنوان نامعتبر علامت‌گذاری می‌کند." -msgid "A variant is ``sNaN`` which signals rather than remaining quiet after every operation. This is a useful return value when an invalid result needs to interrupt a calculation for special handling." +msgid "" +"A variant is ``sNaN`` which signals rather than remaining quiet after every " +"operation. This is a useful return value when an invalid result needs to " +"interrupt a calculation for special handling." msgstr "" +"یکی از گونه‌ها ``sNaN`` است که به‌جای ساکت ماندن پس از هر عملیات، سیگنال می‌دهد. " +"این مقدار بازگشتی مفیدی است، هنگامی که نیاز است یک نتیجه نامعتبر محاسبه‌ای را " +"برای مدیریت ویژه متوقف کند." -msgid "The behavior of Python's comparison operators can be a little surprising where a ``NaN`` is involved. A test for equality where one of the operands is a quiet or signaling ``NaN`` always returns :const:`False` (even when doing ``Decimal('NaN')==Decimal('NaN')``), while a test for inequality always returns :const:`True`. An attempt to compare two Decimals using any of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:`InvalidOperation` signal if either operand is a ``NaN``, and return :const:`False` if this signal is not trapped. Note that the General Decimal Arithmetic specification does not specify the behavior of direct comparisons; these rules for comparisons involving a ``NaN`` were taken from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal.compare_signal` methods instead." -msgstr "" +msgid "" +"The behavior of Python's comparison operators can be a little surprising where " +"a ``NaN`` is involved. A test for equality where one of the operands is a " +"quiet or signaling ``NaN`` always returns :const:`False` (even when doing " +"``Decimal('NaN')==Decimal('NaN')``), while a test for inequality always " +"returns :const:`True`. An attempt to compare two Decimals using any of the " +"``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:`InvalidOperation` " +"signal if either operand is a ``NaN``, and return :const:`False` if this signal " +"is not trapped. Note that the General Decimal Arithmetic specification does " +"not specify the behavior of direct comparisons; these rules for comparisons " +"involving a ``NaN`` were taken from the IEEE 854 standard (see Table 3 in " +"section 5.7). To ensure strict standards-compliance, use " +"the :meth:`~Decimal.compare` and :meth:`~Decimal.compare_signal` methods " +"instead." +msgstr "" +"رفتار عملگرهای مقایسه‌ای پایتون می‌تواند در مواردی که یک ``NaN`` در میان باشد، " +"کمی غافلگیرکننده باشد. آزمون برابری در صورتی که یکی از عملوندها یک ``NaN`` ساکت " +"یا سیگنال‌دهنده باشد، همیشه :const:`False` برمی‌گرداند (حتی هنگام انجام " +"``Decimal('NaN')==Decimal('NaN')``)، در حالی که آزمون نابرابری " +"همیشه :const:`True` برمی‌گرداند. تلاش برای مقایسه‌ی دو Decimal با استفاده از هر یک " +"از عملگرهای ``<``، ``<=``، ``>`` یا ``>=``، در صورتی که یکی از عملوندها ``NaN`` " +"باشد، سیگنال :exc:`InvalidOperation` را پرتاب می‌کند و اگر این سیگنال به دام " +"نیفتد، :const:`False` برمی‌گرداند. توجه داشته باشید که مشخصه‌ی General Decimal " +"Arithmetic رفتار مقایسه‌های مستقیم را تعیین نمی‌کند؛ این قواعد برای مقایسه‌های " +"شامل یک ``NaN`` از استاندارد IEEE 854 گرفته شده‌اند (جدول ۳ در بخش ۵.۷ را " +"ببینید). برای اطمینان از انطباق دقیق با استانداردها، در عوض از " +"متدهای :meth:`~Decimal.compare` و :meth:`~Decimal.compare_signal` استفاده کنید." -msgid "The signed zeros can result from calculations that underflow. They keep the sign that would have resulted if the calculation had been carried out to greater precision. Since their magnitude is zero, both positive and negative zeros are treated as equal and their sign is informational." +msgid "" +"The signed zeros can result from calculations that underflow. They keep the " +"sign that would have resulted if the calculation had been carried out to " +"greater precision. Since their magnitude is zero, both positive and negative " +"zeros are treated as equal and their sign is informational." msgstr "" +"صفرهای علامت‌دار می‌توانند از محاسباتی که دچار زیرریز (underflow) می‌شوند حاصل " +"شوند. آن‌ها علامتی را حفظ می‌کنند که اگر محاسبه با دقت بیشتری انجام می‌شد، حاصل " +"می‌شد. از آنجا که بزرگی آن‌ها صفر است، صفرهای مثبت و منفی هر دو برابر در نظر " +"گرفته می‌شوند و علامت آن‌ها صرفاً اطلاع‌رسانی است." -msgid "In addition to the two signed zeros which are distinct yet equal, there are various representations of zero with differing precisions yet equivalent in value. This takes a bit of getting used to. For an eye accustomed to normalized floating-point representations, it is not immediately obvious that the following calculation returns a value equal to zero:" +msgid "" +"In addition to the two signed zeros which are distinct yet equal, there are " +"various representations of zero with differing precisions yet equivalent in " +"value. This takes a bit of getting used to. For an eye accustomed to " +"normalized floating-point representations, it is not immediately obvious that " +"the following calculation returns a value equal to zero:" msgstr "" +"علاوه بر دو صفر علامت‌دار که متمایز اما برابر هستند، نمایش‌های گوناگونی از صفر با " +"دقت‌های متفاوت اما هم‌ارز در مقدار وجود دارد. این موضوع کمی نیاز به عادت کردن " +"دارد. برای چشمی که به نمایش‌های نقطه‌شناور نرمال‌شده عادت کرده است، فوراً بدیهی " +"نیست که محاسبه‌ی زیر مقداری برابر با صفر برمی‌گرداند:" msgid "Working with threads" -msgstr "" +msgstr "کار با نخ‌ها" -msgid "The :func:`getcontext` function accesses a different :class:`Context` object for each thread. Having separate thread contexts means that threads may make changes (such as ``getcontext().prec=10``) without interfering with other threads." +msgid "" +"The :func:`getcontext` function accesses a different :class:`Context` object " +"for each thread. Having separate thread contexts means that threads may make " +"changes (such as ``getcontext().prec=10``) without interfering with other " +"threads." msgstr "" +"تابع :func:`getcontext` برای هر نخ به یک شیء :class:`Context` متفاوت دسترسی " +"دارد. داشتن زمینه‌های جداگانه برای نخ‌ها به این معناست که نخ‌ها می‌توانند تغییراتی " +"(مانند ``getcontext().prec=10``) بدون تداخل با سایر نخ‌ها ایجاد کنند." -msgid "Likewise, the :func:`setcontext` function automatically assigns its target to the current thread." +msgid "" +"Likewise, the :func:`setcontext` function automatically assigns its target to " +"the current thread." msgstr "" +"به همین ترتیب، تابع :func:`setcontext` به‌طور خودکار هدف خود را به نخ جاری " +"اختصاص می‌دهد." -msgid "If :func:`setcontext` has not been called before :func:`getcontext`, then :func:`getcontext` will automatically create a new context for use in the current thread. New context objects have default values set from the :data:`decimal.DefaultContext` object." +msgid "" +"If :func:`setcontext` has not been called before :func:`getcontext`, " +"then :func:`getcontext` will automatically create a new context for use in the " +"current thread. New context objects have default values set from " +"the :data:`decimal.DefaultContext` object." msgstr "" +"اگر :func:`setcontext` پیش از :func:`getcontext` فراخوانی نشده باشد، " +"آنگاه :func:`getcontext` به‌طور خودکار یک زمینه جدید برای استفاده در نخ جاری " +"ایجاد می‌کند. اشیای زمینه جدید دارای مقادیر پیش‌فرضی هستند که از " +"شیء :data:`decimal.DefaultContext` تنظیم شده‌اند." -msgid "The :data:`sys.flags.thread_inherit_context` flag affects the context for new threads. If the flag is false, new threads will start with an empty context. In this case, :func:`getcontext` will create a new context object when called and use the default values from *DefaultContext*. If the flag is true, new threads will start with a copy of context from the caller of :meth:`threading.Thread.start`." -msgstr "" +msgid "" +"The :data:`sys.flags.thread_inherit_context` flag affects the context for new " +"threads. If the flag is false, new threads will start with an empty context. " +"In this case, :func:`getcontext` will create a new context object when called " +"and use the default values from *DefaultContext*. If the flag is true, new " +"threads will start with a copy of context from the caller " +"of :meth:`threading.Thread.start`." +msgstr "" +"پرچم :data:`sys.flags.thread_inherit_context` بر زمینه‌ی نخ‌های جدید تأثیر " +"می‌گذارد. اگر پرچم نادرست باشد، نخ‌های جدید با یک زمینه‌ی خالی آغاز می‌شوند. در این " +"حالت، :func:`getcontext` هنگام فراخوانی یک شیء زمینه‌ی جدید ایجاد می‌کند و از " +"مقادیر پیش‌فرض *DefaultContext* استفاده می‌کند. اگر پرچم درست باشد، نخ‌های جدید با " +"رونوشتی از زمینه‌ی فراخواننده‌ی :meth:`threading.Thread.start` آغاز می‌شوند." -msgid "To control the defaults so that each thread will use the same values throughout the application, directly modify the *DefaultContext* object. This should be done *before* any threads are started so that there won't be a race condition between threads calling :func:`getcontext`. For example::" +msgid "" +"To control the defaults so that each thread will use the same values throughout " +"the application, directly modify the *DefaultContext* object. This should be " +"done *before* any threads are started so that there won't be a race condition " +"between threads calling :func:`getcontext`. For example::" msgstr "" +"برای کنترل پیش‌فرض‌ها به گونه‌ای که هر نخ در سراسر برنامه از مقادیر یکسانی استفاده " +"کند، مستقیماً شیء *DefaultContext* را تغییر دهید. این کار باید *پیش از* شروع هر " +"نخی انجام شود تا شرایط رقابتی بین نخ‌هایی که :func:`getcontext` را فراخوانی " +"می‌کنند، وجود نداشته باشد. برای مثال::" msgid "" "# Set applicationwide defaults for all threads about to be launched\n" @@ -1317,12 +2808,29 @@ msgid "" "t3.start()\n" " . . ." msgstr "" +"# پیش‌فرض‌های سراسری برنامه را برای همه نخ‌هایی که در آستانه راه‌اندازی هستند، " +"تنظیم کنید\n" +"DefaultContext.prec = 12\n" +"DefaultContext.rounding = ROUND_DOWN\n" +"DefaultContext.traps = ExtendedContext.traps.copy()\n" +"DefaultContext.traps[InvalidOperation] = 1\n" +"setcontext(DefaultContext)\n" +"\n" +"# پس از آن، می‌توانید نخ‌ها را راه‌اندازی کنید\n" +"t1.start()\n" +"t2.start()\n" +"t3.start()\n" +" . . ." msgid "Recipes" -msgstr "" +msgstr "دستورهای عملی" -msgid "Here are a few recipes that serve as utility functions and that demonstrate ways to work with the :class:`Decimal` class::" +msgid "" +"Here are a few recipes that serve as utility functions and that demonstrate " +"ways to work with the :class:`Decimal` class::" msgstr "" +"در ادامه چند راه‌حل آورده شده است که به‌عنوان توابع سودمند به کار می‌روند و " +"روش‌هایی برای کار با کلاس :class:`Decimal` را نشان می‌دهند::" msgid "" "def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" @@ -1470,42 +2978,235 @@ msgid "" " getcontext().prec -= 2\n" " return +s" msgstr "" +"def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" +" pos='', neg='-', trailneg=''):\n" +" \"\"\"Convert Decimal to a money formatted string.\n" +"\n" +" places: required number of places after the decimal point\n" +" curr: optional currency symbol before the sign (may be blank)\n" +" sep: optional grouping separator (comma, period, space, or blank)\n" +" dp: decimal point indicator (comma or period)\n" +" only specify as blank when places is zero\n" +" pos: optional sign for positive numbers: '+', space or blank\n" +" neg: optional sign for negative numbers: '-', '(', space or blank\n" +" trailneg:optional trailing minus indicator: '-', ')', space or blank\n" +"\n" +" >>> d = Decimal('-1234567.8901')\n" +" >>> moneyfmt(d, curr='$')\n" +" '-$1,234,567.89'\n" +" >>> moneyfmt(d, places=0, sep='.', dp='', neg='', trailneg='-')\n" +" '1.234.568-'\n" +" >>> moneyfmt(d, curr='$', neg='(', trailneg=')')\n" +" '($1,234,567.89)'\n" +" >>> moneyfmt(Decimal(123456789), sep=' ')\n" +" '123 456 789.00'\n" +" >>> moneyfmt(Decimal('-0.02'), neg='<', trailneg='>')\n" +" '<0.02>'\n" +"\n" +" \"\"\"\n" +" q = Decimal(10) ** -places # 2 places --> '0.01'\n" +" sign, digits, exp = value.quantize(q).as_tuple()\n" +" result = []\n" +" digits = list(map(str, digits))\n" +" build, next = result.append, digits.pop\n" +" if sign:\n" +" build(trailneg)\n" +" for i in range(places):\n" +" build(next() if digits else '0')\n" +" if places:\n" +" build(dp)\n" +" if not digits:\n" +" build('0')\n" +" i = 0\n" +" while digits:\n" +" build(next())\n" +" i += 1\n" +" if i == 3 and digits:\n" +" i = 0\n" +" build(sep)\n" +" build(curr)\n" +" build(neg if sign else pos)\n" +" return ''.join(reversed(result))\n" +"\n" +"def pi():\n" +" \"\"\"Compute Pi to the current precision.\n" +"\n" +" >>> print(pi())\n" +" 3.141592653589793238462643383\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2 # extra digits for intermediate steps\n" +" three = Decimal(3) # substitute \"three=3.0\" for regular floats\n" +" lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24\n" +" while s != lasts:\n" +" lasts = s\n" +" n, na = n+na, na+8\n" +" d, da = d+da, da+32\n" +" t = (t * n) / d\n" +" s += t\n" +" getcontext().prec -= 2\n" +" return +s # unary plus applies the new precision\n" +"\n" +"def exp(x):\n" +" \"\"\"Return e raised to the power of x. Result type matches input type.\n" +"\n" +" >>> print(exp(Decimal(1)))\n" +" 2.718281828459045235360287471\n" +" >>> print(exp(Decimal(2)))\n" +" 7.389056098930650227230427461\n" +" >>> print(exp(2.0))\n" +" 7.38905609893\n" +" >>> print(exp(2+0j))\n" +" (7.38905609893+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num = 0, 0, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 1\n" +" fact *= i\n" +" num *= x\n" +" s += num / fact\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def cos(x):\n" +" \"\"\"Return the cosine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(cos(Decimal('0.5')))\n" +" 0.8775825618903727161162815826\n" +" >>> print(cos(0.5))\n" +" 0.87758256189\n" +" >>> print(cos(0.5+0j))\n" +" (0.87758256189+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def sin(x):\n" +" \"\"\"Return the sine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(sin(Decimal('0.5')))\n" +" 0.4794255386042030002732879352\n" +" >>> print(sin(0.5))\n" +" 0.479425538604\n" +" >>> print(sin(0.5+0j))\n" +" (0.479425538604+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s" msgid "Decimal FAQ" -msgstr "" +msgstr "پرسش‌های متداول Decimal" -msgid "Q: It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way to minimize typing when using the interactive interpreter?" +msgid "" +"Q: It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way to " +"minimize typing when using the interactive interpreter?" msgstr "" +"پرسش: وارد کردن ``decimal.Decimal('1234.5')`` دشوار است. آیا راهی برای به حداقل " +"رساندن میزان تایپ هنگام استفاده از مفسر تعاملی وجود دارد؟" msgid "A: Some users abbreviate the constructor to just a single letter:" -msgstr "" +msgstr "پاسخ: برخی کاربران سازنده را فقط به یک حرف خلاصه می‌کنند:" -msgid "Q: In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. Others are not supposed to have excess digits and need to be validated. What methods should be used?" +msgid "" +"Q: In a fixed-point application with two decimal places, some inputs have many " +"places and need to be rounded. Others are not supposed to have excess digits " +"and need to be validated. What methods should be used?" msgstr "" +"پرسش: در یک برنامه ممیز ثابت با دو رقم اعشار، برخی ورودی‌ها رقم‌های اعشار زیادی " +"دارند و باید گرد شوند. برخی دیگر نباید ارقام اضافی داشته باشند و باید " +"اعتبارسنجی شوند. از چه متدهایی باید استفاده کرد؟" -msgid "A: The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal places. If the :const:`Inexact` trap is set, it is also useful for validation:" +msgid "" +"A: The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " +"places. If the :const:`Inexact` trap is set, it is also useful for validation:" msgstr "" +"A: متد :meth:`~Decimal.quantize` به تعداد ثابتی از رقم‌های اعشاری گرد می‌کند. " +"اگر تله‌ی :const:`Inexact` تنظیم شده باشد، برای اعتبارسنجی نیز مفید است:" -msgid "Q: Once I have valid two place inputs, how do I maintain that invariant throughout an application?" +msgid "" +"Q: Once I have valid two place inputs, how do I maintain that invariant " +"throughout an application?" msgstr "" +"پ: هنگامی که ورودی‌های معتبر با دو رقم اعشاری داشته باشم، چگونه می‌توانم آن " +"ناوردا را در سراسر یک برنامه حفظ کنم؟" -msgid "A: Some operations like addition, subtraction, and multiplication by an integer will automatically preserve fixed point. Others operations, like division and non-integer multiplication, will change the number of decimal places and need to be followed-up with a :meth:`~Decimal.quantize` step:" +msgid "" +"A: Some operations like addition, subtraction, and multiplication by an integer " +"will automatically preserve fixed point. Others operations, like division and " +"non-integer multiplication, will change the number of decimal places and need " +"to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" +"پاسخ: برخی عملیات مانند جمع، تفریق و ضرب در یک عدد صحیح به‌طور خودکار ممیز ثابت " +"را حفظ می‌کنند. عملیات دیگر، مانند تقسیم و ضرب در عدد غیرصحیح، تعداد ارقام اعشار " +"را تغییر می‌دهند و باید پس از آن‌ها یک مرحله :meth:`~Decimal.quantize` انجام شود:" -msgid "In developing fixed-point applications, it is convenient to define functions to handle the :meth:`~Decimal.quantize` step:" +msgid "" +"In developing fixed-point applications, it is convenient to define functions to " +"handle the :meth:`~Decimal.quantize` step:" msgstr "" +"در توسعه‌ی برنامه‌های ممیز ثابت، تعریف توابع برای مدیریت " +"مرحله‌ی :meth:`~Decimal.quantize` مطلوب است:" -msgid "Q: There are many ways to express the same value. The numbers ``200``, ``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various precisions. Is there a way to transform them to a single recognizable canonical value?" +msgid "" +"Q: There are many ways to express the same value. The numbers ``200``, " +"``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " +"precisions. Is there a way to transform them to a single recognizable canonical " +"value?" msgstr "" +"پرسش: راه‌های زیادی برای بیان یک مقدار یکسان وجود دارد. اعداد ``200``، " +"``200.000``، ``2E2`` و ``.02E+4`` همگی در دقت‌های مختلف مقدار یکسانی دارند. آیا " +"راهی برای تبدیل آن‌ها به یک مقدار کانونیکال (canonical) واحد و قابل‌تشخیص وجود دارد؟" -msgid "A: The :meth:`~Decimal.normalize` method maps all equivalent values to a single representative:" +msgid "" +"A: The :meth:`~Decimal.normalize` method maps all equivalent values to a single " +"representative:" msgstr "" +"پاسخ: متد :meth:`~Decimal.normalize` تمام مقادیر هم‌ارز را به یک نماینده‌ی واحد " +"نگاشت می‌کند:" msgid "Q: When does rounding occur in a computation?" -msgstr "" +msgstr "پ: گرد کردن در یک محاسبه چه زمانی رخ می‌دهد؟" -msgid "A: It occurs *after* the computation. The philosophy of the decimal specification is that numbers are considered exact and are created independent of the current context. They can even have greater precision than current context. Computations process with those exact inputs and then rounding (or other context operations) is applied to the *result* of the computation::" +msgid "" +"A: It occurs *after* the computation. The philosophy of the decimal " +"specification is that numbers are considered exact and are created independent " +"of the current context. They can even have greater precision than current " +"context. Computations process with those exact inputs and then rounding (or " +"other context operations) is applied to the *result* of the computation::" msgstr "" +"پاسخ: این امر *پس از* محاسبه رخ می‌دهد. فلسفه‌ی مشخصات decimal این است که اعداد " +"دقیق فرض می‌شوند و مستقل از زمینه‌ی جاری ایجاد می‌شوند. حتی می‌توانند دقتی بیشتر از " +"زمینه‌ی جاری داشته باشند. محاسبات با آن ورودی‌های دقیق انجام می‌شوند و سپس گرد " +"کردن (یا سایر عملیات زمینه) به *نتیجه‌ی* محاسبه اعمال می‌شود::" msgid "" ">>> getcontext().prec = 5\n" @@ -1519,38 +3220,99 @@ msgid "" ">>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded\n" "Decimal('3.1416')" msgstr "" +">>> getcontext().prec = 5\n" +">>> pi = Decimal('3.1415926535') # More than 5 digits\n" +">>> pi # All digits are retained\n" +"Decimal('3.1415926535')\n" +">>> pi + 0 # Rounded after an addition\n" +"Decimal('3.1416')\n" +">>> pi - Decimal('0.00005') # Subtract unrounded numbers, then round\n" +"Decimal('3.1415')\n" +">>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded\n" +"Decimal('3.1416')" -msgid "Q: Some decimal values always print with exponential notation. Is there a way to get a non-exponential representation?" +msgid "" +"Q: Some decimal values always print with exponential notation. Is there a way " +"to get a non-exponential representation?" msgstr "" +"پرسش: برخی مقادیر اعشاری همیشه با نماد نمایی چاپ می‌شوند. آیا راهی برای دریافت " +"نمایش غیرنمایی وجود دارد؟" -msgid "A: For some values, exponential notation is the only way to express the number of significant places in the coefficient. For example, expressing ``5.0E+3`` as ``5000`` keeps the value constant but cannot show the original's two-place significance." +msgid "" +"A: For some values, exponential notation is the only way to express the number " +"of significant places in the coefficient. For example, expressing ``5.0E+3`` " +"as ``5000`` keeps the value constant but cannot show the original's two-place " +"significance." msgstr "" +"پاسخ: برای برخی از مقدارها، نماد نمایی تنها راه بیان تعداد ارقام معنادار در " +"ضریب است. برای مثال، بیان ``5.0E+3`` به‌صورت ``5000`` مقدار را ثابت نگه می‌دارد، " +"اما نمی‌تواند نشان دهد که مقدار اصلی دو رقم معنادار دارد." -msgid "If an application does not care about tracking significance, it is easy to remove the exponent and trailing zeroes, losing significance, but keeping the value unchanged:" +msgid "" +"If an application does not care about tracking significance, it is easy to " +"remove the exponent and trailing zeroes, losing significance, but keeping the " +"value unchanged:" msgstr "" +"اگر برنامه‌ای به پیگیری ارقام معنادار اهمیتی نمی‌دهد، می‌توان به‌راحتی توان و " +"صفرهای انتهایی را حذف کرد؛ با این کار ارقام معنادار از دست می‌روند، اما مقدار " +"بدون تغییر می‌ماند:" msgid "Q: Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" +"پرسش: آیا راهی برای تبدیل یک عدد اعشاری معمولی به :class:`Decimal` وجود دارد؟" -msgid "A: Yes, any binary floating-point number can be exactly expressed as a Decimal though an exact conversion may take more precision than intuition would suggest:" +msgid "" +"A: Yes, any binary floating-point number can be exactly expressed as a Decimal " +"though an exact conversion may take more precision than intuition would suggest:" msgstr "" +"پ: بله، هر عدد ممیز شناور دودویی را می‌توان دقیقاً به‌صورت یک Decimal بیان کرد، " +"هرچند یک تبدیل دقیق ممکن است به دقت بیشتری نسبت به آنچه به‌طور شهودی انتظار " +"می‌رود نیاز داشته باشد:" msgid "" ">>> Decimal(math.pi)\n" "Decimal('3.141592653589793115997963468544185161590576171875')" msgstr "" +">>> Decimal(math.pi)\n" +"Decimal('3.141592653589793115997963468544185161590576171875')" -msgid "Q: Within a complex calculation, how can I make sure that I haven't gotten a spurious result because of insufficient precision or rounding anomalies." +msgid "" +"Q: Within a complex calculation, how can I make sure that I haven't gotten a " +"spurious result because of insufficient precision or rounding anomalies." msgstr "" +"پرسش: در یک محاسبه‌ی پیچیده، چگونه می‌توانم مطمئن شوم که به دلیل دقت ناکافی یا " +"ناهنجاری‌های گردکردن، نتیجه‌ای کاذب به دست نیاورده‌ام." -msgid "A: The decimal module makes it easy to test results. A best practice is to re-run calculations using greater precision and with various rounding modes. Widely differing results indicate insufficient precision, rounding mode issues, ill-conditioned inputs, or a numerically unstable algorithm." +msgid "" +"A: The decimal module makes it easy to test results. A best practice is to re-" +"run calculations using greater precision and with various rounding modes. " +"Widely differing results indicate insufficient precision, rounding mode issues, " +"ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" +"پاسخ: ماژول decimal آزمایش نتایج را آسان می‌کند. بهترین روش این است که محاسبات " +"را با دقت بیشتر و با حالت‌های مختلف گرد کردن دوباره اجرا کنید. نتایج بسیار " +"متفاوت، دقت ناکافی، مشکلات مربوط به حالت گرد کردن، ورودی‌های بدشرط یا یک " +"الگوریتم ناپایدار عددی را نشان می‌دهند." -msgid "Q: I noticed that context precision is applied to the results of operations but not to the inputs. Is there anything to watch out for when mixing values of different precisions?" +msgid "" +"Q: I noticed that context precision is applied to the results of operations but " +"not to the inputs. Is there anything to watch out for when mixing values of " +"different precisions?" msgstr "" +"پرسش: متوجه شده‌ام که دقت زمینه بر نتایج عملیات اعمال می‌شود، اما نه بر ورودی‌ها. " +"آیا هنگام ترکیب مقادیر با دقت‌های مختلف، نکته‌ای وجود دارد که باید به آن توجه " +"کنید؟" -msgid "A: Yes. The principle is that all values are considered to be exact and so is the arithmetic on those values. Only the results are rounded. The advantage for inputs is that \"what you type is what you get\". A disadvantage is that the results can look odd if you forget that the inputs haven't been rounded:" +msgid "" +"A: Yes. The principle is that all values are considered to be exact and so is " +"the arithmetic on those values. Only the results are rounded. The advantage " +"for inputs is that \"what you type is what you get\". A disadvantage is that " +"the results can look odd if you forget that the inputs haven't been rounded:" msgstr "" +"پاسخ: بله. اصل این است که همه مقادیر دقیق در نظر گرفته می‌شوند و عملیات حسابی " +"روی آن مقادیر نیز دقیق است. فقط نتایج گرد می‌شوند. مزیت آن برای ورودی‌ها این است " +"که «آنچه تایپ می‌کنید، همان را دریافت می‌کنید». عیب آن این است که اگر فراموش کنید " +"ورودی‌ها گرد نشده‌اند، نتایج ممکن است عجیب به نظر برسند:" msgid "" ">>> getcontext().prec = 3\n" @@ -1559,30 +3321,74 @@ msgid "" ">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" "Decimal('5.20')" msgstr "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.104') + Decimal('2.104')\n" +"Decimal('5.21')\n" +">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" +"Decimal('5.20')" -msgid "The solution is either to increase precision or to force rounding of inputs using the unary plus operation:" +msgid "" +"The solution is either to increase precision or to force rounding of inputs " +"using the unary plus operation:" msgstr "" +"راه‌حل یا افزایش دقت است یا گرد کردن اجباری ورودی‌ها با استفاده از عملیات مثبت " +"یک‌ظرفیتی:" msgid "" ">>> getcontext().prec = 3\n" ">>> +Decimal('1.23456789') # unary plus triggers rounding\n" "Decimal('1.23')" msgstr "" +">>> getcontext().prec = 3\n" +">>> +Decimal('1.23456789') # unary plus triggers rounding\n" +"Decimal('1.23')" -msgid "Alternatively, inputs can be rounded upon creation using the :meth:`Context.create_decimal` method:" +msgid "" +"Alternatively, inputs can be rounded upon creation using " +"the :meth:`Context.create_decimal` method:" msgstr "" +"به‌عنوان جایگزین، ورودی‌ها می‌توانند در زمان ایجاد با استفاده از " +"متد :meth:`Context.create_decimal` گرد شوند:" msgid "Q: Is the CPython implementation fast for large numbers?" -msgstr "" +msgstr "پرسش: آیا پیاده‌سازی CPython برای اعداد بزرگ سریع است؟" -msgid "A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of the decimal module integrate the high speed `libmpdec `_ library for arbitrary precision correctly rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses `Karatsuba multiplication `_ for medium-sized numbers and the `Number Theoretic Transform `_ for very large numbers." -msgstr "" +msgid "" +"A: Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of the " +"decimal module integrate the high speed `libmpdec `_ library for arbitrary precision correctly " +"rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses `Karatsuba " +"multiplication `_ for medium-" +"sized numbers and the `Number Theoretic Transform `_ for " +"very large numbers." +msgstr "" +"پاسخ: بله. در پیاده‌سازی‌های CPython و PyPy3، نسخه‌های C/CFFI ماژول decimal از " +"کتابخانه پرسرعت `libmpdec `_ برای حساب ممیز شناور اعشاری با دقت دلخواه و گردکردن صحیح بهره " +"می‌برند [#]_. ``libmpdec`` برای اعداد با اندازه متوسط از `ضرب کاراتسوبا `_ و برای اعداد بسیار بزرگ از `تبدیل " +"نظریه‌ای اعداد (Number Theoretic Transform) `_ استفاده " +"می‌کند." -msgid "The context must be adapted for exact arbitrary precision arithmetic. :attr:`~Context.Emin` and :attr:`~Context.Emax` should always be set to the maximum values, :attr:`~Context.clamp` should always be 0 (the default). Setting :attr:`~Context.prec` requires some care." +msgid "" +"The context must be adapted for exact arbitrary precision " +"arithmetic. :attr:`~Context.Emin` and :attr:`~Context.Emax` should always be " +"set to the maximum values, :attr:`~Context.clamp` should always be 0 (the " +"default). Setting :attr:`~Context.prec` requires some care." msgstr "" +"زمینه باید برای عملیات حسابی دقیق با دقت دلخواه تطبیق داده " +"شود. :attr:`~Context.Emin` و :attr:`~Context.Emax` باید همیشه روی مقادیر بیشینه " +"تنظیم شوند، :attr:`~Context.clamp` باید همیشه ۰ (پیش‌فرض) باشد. " +"تنظیم :attr:`~Context.prec` به کمی دقت نیاز دارد." -msgid "The easiest approach for trying out bignum arithmetic is to use the maximum value for :attr:`~Context.prec` as well [#]_::" +msgid "" +"The easiest approach for trying out bignum arithmetic is to use the maximum " +"value for :attr:`~Context.prec` as well [#]_::" msgstr "" +"ساده‌ترین روش برای آزمایش حساب اعداد بزرگ (bignum arithmetic) این است که از " +"حداکثر مقدار :attr:`~Context.prec` نیز استفاده کنید [#]_::" msgid "" ">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" @@ -1590,9 +3396,17 @@ msgid "" ">>> x / 128\n" "Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" msgstr "" +">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" +">>> x = Decimal(2) ** 256\n" +">>> x / 128\n" +"Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" -msgid "For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms and the available memory will be insufficient::" +msgid "" +"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms and " +"the available memory will be insufficient::" msgstr "" +"برای نتایج غیردقیق، :const:`MAX_PREC` در پلتفرم‌های ۶۴ بیتی بسیار بیش‌ازحد بزرگ " +"است و حافظه‌ی در دسترس کافی نخواهد بود::" msgid "" ">>> Decimal(1) / 3\n" @@ -1600,14 +3414,27 @@ msgid "" " File \"\", line 1, in \n" "MemoryError" msgstr "" +">>> Decimal(1) / 3\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"MemoryError" -msgid "On systems with overallocation (e.g. Linux), a more sophisticated approach is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose that you have 8GB of RAM and expect 10 simultaneous operands using a maximum of 500MB each::" +msgid "" +"On systems with overallocation (e.g. Linux), a more sophisticated approach is " +"to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose that " +"you have 8GB of RAM and expect 10 simultaneous operands using a maximum of " +"500MB each::" msgstr "" +"در سیستم‌هایی با تخصیص بیش‌ازحد (overallocation)، مانند لینوکس، رویکرد پیشرفته‌تر " +"این است که :attr:`~Context.prec` را متناسب با مقدار RAM در دسترس تنظیم کنید. " +"فرض کنید ۸ گیگابایت RAM دارید و انتظار ۱۰ عملوند همزمان را دارید که هرکدام " +"حداکثر ۵۰۰ مگابایت مصرف می‌کنند::" msgid "" ">>> import sys\n" ">>>\n" -">>> # Maximum number of digits for a single operand using 500MB in 8-byte words\n" +">>> # Maximum number of digits for a single operand using 500MB in 8-byte " +"words\n" ">>> # with 19 digits per word (4-byte and 9 digits for the 32-bit build):\n" ">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" ">>>\n" @@ -1625,9 +3452,37 @@ msgid "" " File \"\", line 1, in \n" " decimal.Inexact: []" msgstr "" +">>> import sys\n" +">>>\n" +">>> # Maximum number of digits for a single operand using 500MB in 8-byte " +"words\n" +">>> # with 19 digits per word (4-byte and 9 digits for the 32-bit build):\n" +">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" +">>>\n" +">>> # Check that this works:\n" +">>> c = Context(prec=maxdigits, Emax=MAX_EMAX, Emin=MIN_EMIN)\n" +">>> c.traps[Inexact] = True\n" +">>> setcontext(c)\n" +">>>\n" +">>> # Fill the available precision with nines:\n" +">>> x = Decimal(0).logical_invert() * 9\n" +">>> sys.getsizeof(x)\n" +"524288112\n" +">>> x + 2\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" decimal.Inexact: []" -msgid "In general (and especially on systems without overallocation), it is recommended to estimate even tighter bounds and set the :attr:`Inexact` trap if all calculations are expected to be exact." +msgid "" +"In general (and especially on systems without overallocation), it is " +"recommended to estimate even tighter bounds and set the :attr:`Inexact` trap if " +"all calculations are expected to be exact." msgstr "" +"به‌طور کلی (و به‌ویژه در سیستم‌های بدون تخصیص بیش‌ازحد (overallocation))، " +"توصیه می‌شود کران‌های حتی محدودتری را برآورد کنید و اگر انتظار می‌رود همه‌ی " +"محاسبات دقیق باشند، تله‌ی :attr:`Inexact` را تنظیم کنید." -msgid "This approach now works for all exact results except for non-integer powers." +msgid "" +"This approach now works for all exact results except for non-integer powers." msgstr "" +"این روش اکنون برای همه‌ی نتایج دقیق، به‌جز توان‌هایی که عدد صحیح نیستند، کار می‌کند." diff --git a/library/development.po b/library/development.po index aff500ec2..d7564f03c 100644 --- a/library/development.po +++ b/library/development.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Development Tools" -msgstr "" +msgstr "ابزارهای توسعه" -msgid "The modules described in this chapter help you write software. For example, the :mod:`pydoc` module takes a module and generates documentation based on the module's contents. The :mod:`doctest` and :mod:`unittest` modules contains frameworks for writing unit tests that automatically exercise code and verify that the expected output is produced." +msgid "" +"The modules described in this chapter help you write software. For example," +" the :mod:`pydoc` module takes a module and generates documentation based on" +" the module's contents. The :mod:`doctest` and :mod:`unittest` modules " +"contains frameworks for writing unit tests that automatically exercise code " +"and verify that the expected output is produced." msgstr "" +"ماژول‌های توصیف‌شده در این فصل به شما در نوشتن نرم‌افزار کمک می‌کنند. برای " +"مثال، ماژول :mod:`pydoc` یک ماژول را می‌گیرد و مستنداتی بر اساس محتوای آن " +"ماژول تولید می‌کند. ماژول‌های :mod:`doctest` و :mod:`unittest` شامل " +"چارچوب‌هایی برای نوشتن آزمون واحد‌هایی هستند که به‌طور خودکار کد را اجرا " +"می‌کنند و تأیید می‌کنند که خروجی مورد انتظار تولید می‌شود." msgid "The list of modules described in this chapter is:" -msgstr "" +msgstr "فهرست ماژول‌های توصیف‌شده در این فصل:" diff --git a/library/devmode.po b/library/devmode.po index ca13cbd89..1c5d151d0 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -25,121 +25,237 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Python Development Mode" -msgstr "" +msgstr "حالت توسعه پایتون" -msgid "The Python Development Mode introduces additional runtime checks that are too expensive to be enabled by default. It should not be more verbose than the default if the code is correct; new warnings are only emitted when an issue is detected." +msgid "" +"The Python Development Mode introduces additional runtime checks that are " +"too expensive to be enabled by default. It should not be more verbose than " +"the default if the code is correct; new warnings are only emitted when an " +"issue is detected." msgstr "" +"حالت توسعه پایتون، بررسی‌های ران‌تایم اضافی‌ای را ارائه می‌دهد که فعال بودن " +"آن‌ها به‌طور پیش‌فرض بیش از حد پرهزینه است. اگر کد صحیح باشد، نباید " +"پرجزئیات‌تر از حالت پیش‌فرض باشد؛ هشدارهای جدید تنها زمانی صادر می‌شوند که " +"مشکلی شناسایی شود." -msgid "It can be enabled using the :option:`-X dev <-X>` command line option or by setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." +msgid "" +"It can be enabled using the :option:`-X dev <-X>` command line option or by " +"setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." msgstr "" +"می‌توان آن را با استفاده از گزینه‌ی خط فرمان :option:`-X dev <-X>` یا با " +"تنظیم متغیر محیطی :envvar:`PYTHONDEVMODE` روی ``1`` فعال کرد." msgid "See also :ref:`Python debug build `." -msgstr "" +msgstr "همچنین ببینید :ref:`ساخت اشکال‌زدایی پایتون `." msgid "Effects of the Python Development Mode" -msgstr "" +msgstr "اثرات حالت توسعه پایتون" -msgid "Enabling the Python Development Mode is similar to the following command, but with additional effects described below::" +msgid "" +"Enabling the Python Development Mode is similar to the following command, " +"but with additional effects described below::" msgstr "" +"فعال‌سازی حالت توسعه پایتون مشابه دستور زیر است، اما با اثرات اضافی که در " +"زیر شرح داده شده‌اند::" -msgid "PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" +msgid "" +"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" msgstr "" +"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" msgid "Effects of the Python Development Mode:" -msgstr "" +msgstr "تأثیرات حالت توسعه پایتون:" -msgid "Add ``default`` :ref:`warning filter `. The following warnings are shown:" +msgid "" +"Add ``default`` :ref:`warning filter `. The " +"following warnings are shown:" msgstr "" +"افزودن :ref:`فیلتر هشدار ` ``default``. " +"هشدارهای زیر نمایش داده می‌شوند:" msgid ":exc:`DeprecationWarning`" -msgstr "" +msgstr ":exc:`DeprecationWarning`" msgid ":exc:`ImportWarning`" -msgstr "" +msgstr ":exc:`ImportWarning`" msgid ":exc:`PendingDeprecationWarning`" -msgstr "" +msgstr ":exc:`PendingDeprecationWarning`" msgid ":exc:`ResourceWarning`" -msgstr "" +msgstr ":exc:`ResourceWarning`" -msgid "Normally, the above warnings are filtered by the default :ref:`warning filters `." +msgid "" +"Normally, the above warnings are filtered by the default :ref:`warning " +"filters `." msgstr "" +"معمولاً :ref:`فیلترهای هشدار ` پیش‌فرض، هشدارهای" +" بالا را فیلتر می‌کنند." -msgid "It behaves as if the :option:`-W default <-W>` command line option is used." +msgid "" +"It behaves as if the :option:`-W default <-W>` command line option is used." msgstr "" +"این‌گونه رفتار می‌کند که گویی گزینه خط فرمان :option:`-W default <-W>` " +"استفاده شده است." -msgid "Use the :option:`-W error <-W>` command line option or set the :envvar:`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as errors." +msgid "" +"Use the :option:`-W error <-W>` command line option or set the " +":envvar:`PYTHONWARNINGS` environment variable to ``error`` to treat warnings" +" as errors." msgstr "" +"برای در نظر گرفتن هشدارها به‌عنوان خطا، از گزینه‌ی خط فرمان :option:`-W " +"error <-W>` استفاده کنید یا متغیر محیطی :envvar:`PYTHONWARNINGS` را روی " +"``error`` تنظیم کنید." msgid "Install debug hooks on memory allocators to check for:" msgstr "" +"برای بررسی، قلاب‌های اشکال‌زدایی را روی تخصیص‌دهنده‌های حافظه نصب کنید:" msgid "Buffer underflow" -msgstr "" +msgstr "زیرریز بافر (Buffer underflow)" msgid "Buffer overflow" -msgstr "" +msgstr "سرریز بافر" msgid "Memory allocator API violation" -msgstr "" +msgstr "نقض API تخصیص‌دهنده حافظه" msgid "Unsafe usage of the GIL" -msgstr "" +msgstr "استفاده‌ی ناایمن از GIL" msgid "See the :c:func:`PyMem_SetupDebugHooks` C function." -msgstr "" +msgstr "به تابع C :c:func:`PyMem_SetupDebugHooks` مراجعه کنید." -msgid "It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to ``debug``." +msgid "" +"It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to " +"``debug``." msgstr "" +"به‌گونه‌ای رفتار می‌کند که گویی متغیر محیطی :envvar:`PYTHONMALLOC` روی " +"``debug`` تنظیم شده است." -msgid "To enable the Python Development Mode without installing debug hooks on memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to ``default``." +msgid "" +"To enable the Python Development Mode without installing debug hooks on " +"memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to " +"``default``." msgstr "" +"برای فعال کردن حالت توسعه پایتون بدون نصب قلاب‌های اشکال‌زدایی روی " +"تخصیص‌دهنده‌های حافظه، متغیر محیطی :envvar:`PYTHONMALLOC` را روی ``default``" +" تنظیم کنید." -msgid "Call :func:`faulthandler.enable` at Python startup to install handlers for the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python traceback on a crash." +msgid "" +"Call :func:`faulthandler.enable` at Python startup to install handlers for " +"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, " +":const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and " +":const:`~signal.SIGILL` signals to dump the Python traceback on a crash." msgstr "" +"در زمان راه‌اندازی پایتون، :func:`faulthandler.enable` را فراخوانی کنید تا " +"هندلرهایی برای سیگنال‌های :const:`~signal.SIGSEGV`، " +":const:`~signal.SIGFPE`، :const:`~signal.SIGABRT`، :const:`~signal.SIGBUS` و" +" :const:`~signal.SIGILL` نصب شوند که در صورت سقوط، ردگیری پشته پایتون را " +"برون‌ریزی می‌کنند." -msgid "It behaves as if the :option:`-X faulthandler <-X>` command line option is used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to ``1``." +msgid "" +"It behaves as if the :option:`-X faulthandler <-X>` command line option is " +"used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " +"``1``." msgstr "" +"این به‌گونه‌ای رفتار می‌کند که گویی از گزینه‌ی خط فرمان :option:`-X " +"faulthandler <-X>` استفاده شده باشد یا متغیر محیطی " +":envvar:`PYTHONFAULTHANDLER` روی ``1`` تنظیم شده باشد." -msgid "Enable :ref:`asyncio debug mode `. For example, :mod:`asyncio` checks for coroutines that were not awaited and logs them." +msgid "" +"Enable :ref:`asyncio debug mode `. For example, " +":mod:`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" +":ref:`حالت اشکال‌زدایی asyncio ` را فعال کنید. برای " +"مثال، :mod:`asyncio` هم‌روال‌هایی را که await نشده‌اند بررسی می‌کند و آن‌ها " +"را ثبت می‌کند." -msgid "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is set to ``1``." +msgid "" +"It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " +"set to ``1``." msgstr "" +"این به‌گونه‌ای رفتار می‌کند که گویی متغیر محیطی :envvar:`PYTHONASYNCIODEBUG`" +" روی ``1`` تنظیم شده است." -msgid "Check the *encoding* and *errors* arguments for string encoding and decoding operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`." +msgid "" +"Check the *encoding* and *errors* arguments for string encoding and decoding" +" operations. Examples: :func:`open`, :meth:`str.encode` and " +":meth:`bytes.decode`." msgstr "" +"آرگومان‌های *encoding* و *errors* را برای عملیات کدگذاری و کدگشایی رشته " +"بررسی کنید. مثال‌ها: :func:`open`، :meth:`str.encode` و " +":meth:`bytes.decode`." -msgid "By default, for best performance, the *errors* argument is only checked at the first encoding/decoding error and the *encoding* argument is sometimes ignored for empty strings." +msgid "" +"By default, for best performance, the *errors* argument is only checked at " +"the first encoding/decoding error and the *encoding* argument is sometimes " +"ignored for empty strings." msgstr "" +"به‌طور پیش‌فرض، برای بهترین عملکرد، آرگومان *errors* فقط در اولین خطای " +"کدگذاری/کدگشایی بررسی می‌شود و آرگومان *encoding* گاهی برای رشته‌های خالی " +"نادیده گرفته می‌شود." msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." -msgstr "" +msgstr "تخریب‌کننده‌ی :class:`io.IOBase` استثناهای ``close()`` را ثبت می‌کند." -msgid "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to ``True``." +msgid "" +"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " +"``True``." msgstr "" +"ویژگی :attr:`~sys.flags.dev_mode` از :data:`sys.flags` را روی ``True`` تنظیم" +" کنید." -msgid "The Python Development Mode does not enable the :mod:`tracemalloc` module by default, because the overhead cost (to performance and memory) would be too large. Enabling the :mod:`tracemalloc` module provides additional information on the origin of some errors. For example, :exc:`ResourceWarning` logs the traceback where the resource was allocated, and a buffer overflow error logs the traceback where the memory block was allocated." -msgstr "" +msgid "" +"The Python Development Mode does not enable the :mod:`tracemalloc` module by" +" default, because the overhead cost (to performance and memory) would be too" +" large. Enabling the :mod:`tracemalloc` module provides additional " +"information on the origin of some errors. For example, " +":exc:`ResourceWarning` logs the traceback where the resource was allocated, " +"and a buffer overflow error logs the traceback where the memory block was " +"allocated." +msgstr "" +"حالت توسعه پایتون به‌طور پیش‌فرض ماژول :mod:`tracemalloc` را فعال نمی‌کند، " +"زیرا هزینه سربار (برای عملکرد و حافظه) بیش از حد زیاد خواهد بود. فعال‌سازی " +"ماژول :mod:`tracemalloc` اطلاعات بیشتری درباره منشأ برخی خطاها فراهم " +"می‌کند. برای مثال، :exc:`ResourceWarning` ردگیری پشته محل تخصیص منبع را ثبت " +"می‌کند، و یک خطای سرریز بافر ردگیری پشته محل تخصیص بلوک حافظه را ثبت می‌کند." -msgid "The Python Development Mode does not prevent the :option:`-O` command line option from removing :keyword:`assert` statements nor from setting :const:`__debug__` to ``False``." +msgid "" +"The Python Development Mode does not prevent the :option:`-O` command line " +"option from removing :keyword:`assert` statements nor from setting " +":const:`__debug__` to ``False``." msgstr "" +"حالت توسعه پایتون مانع از آن نمی‌شود که گزینه خط فرمان :option:`-O` دستورهای" +" :keyword:`assert` را حذف کند یا :const:`__debug__` را روی ``False`` تنظیم " +"کند." -msgid "The Python Development Mode can only be enabled at the Python startup. Its value can be read from :data:`sys.flags.dev_mode `." +msgid "" +"The Python Development Mode can only be enabled at the Python startup. Its " +"value can be read from :data:`sys.flags.dev_mode `." msgstr "" +"حالت توسعه پایتون را فقط می‌توان در هنگام راه‌اندازی پایتون فعال کرد. مقدار " +"آن را می‌توان از :data:`sys.flags.dev_mode ` خواند." msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" +"تخریب‌کننده‌ی :class:`io.IOBase` اکنون استثناهای ``close()`` را ثبت می‌کند." -msgid "The *encoding* and *errors* arguments are now checked for string encoding and decoding operations." +msgid "" +"The *encoding* and *errors* arguments are now checked for string encoding " +"and decoding operations." msgstr "" +"آرگومان‌های *encoding* و *errors* اکنون برای عملیات کدگذاری و کدگشایی رشته " +"بررسی می‌شوند." msgid "ResourceWarning Example" -msgstr "" +msgstr "مثال ResourceWarning" -msgid "Example of a script counting the number of lines of the text file specified in the command line::" +msgid "" +"Example of a script counting the number of lines of the text file specified " +"in the command line::" msgstr "" +"مثالی از یک اسکریپت برای شمارش تعداد خطوط فایل متنی مشخص‌شده در خط فرمان::" msgid "" "import sys\n" @@ -153,17 +269,36 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import sys\n" +"\n" +"def main():\n" +" fp = open(sys.argv[1])\n" +" nlines = len(fp.readlines())\n" +" print(nlines)\n" +" # The file is closed implicitly\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" -msgid "The script does not close the file explicitly. By default, Python does not emit any warning. Example using README.txt, which has 269 lines:" +msgid "" +"The script does not close the file explicitly. By default, Python does not " +"emit any warning. Example using README.txt, which has 269 lines:" msgstr "" +"اسکریپت فایل را به‌صراحت نمی‌بندد. به‌طور پیش‌فرض، پایتون هیچ هشداری صادر " +"نمی‌کند. مثالی با استفاده از README.txt که ۲۶۹ خط دارد:" msgid "" "$ python script.py README.txt\n" "269" msgstr "" +"$ python script.py README.txt\n" +"269" -msgid "Enabling the Python Development Mode displays a :exc:`ResourceWarning` warning:" +msgid "" +"Enabling the Python Development Mode displays a :exc:`ResourceWarning` " +"warning:" msgstr "" +"فعال‌سازی حالت توسعه پایتون یک هشدار :exc:`ResourceWarning` را نمایش می‌دهد:" msgid "" "$ python -X dev script.py README.txt\n" @@ -172,9 +307,18 @@ msgid "" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback" msgstr "" +"$ python -X dev script.py README.txt\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback" -msgid "In addition, enabling :mod:`tracemalloc` shows the line where the file was opened:" +msgid "" +"In addition, enabling :mod:`tracemalloc` shows the line where the file was " +"opened:" msgstr "" +"علاوه بر این، فعال‌سازی :mod:`tracemalloc` خطی را نشان می‌دهد که فایل در آن " +"باز شده است:" msgid "" "$ python -X dev -X tracemalloc=5 script.py README.rst\n" @@ -187,9 +331,21 @@ msgid "" " File \"script.py\", lineno 4\n" " fp = open(sys.argv[1])" msgstr "" +"$ python -X dev -X tracemalloc=5 script.py README.rst\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"Object allocated at (most recent call last):\n" +" File \"script.py\", lineno 10\n" +" main()\n" +" File \"script.py\", lineno 4\n" +" fp = open(sys.argv[1])" -msgid "The fix is to close explicitly the file. Example using a context manager::" +msgid "" +"The fix is to close explicitly the file. Example using a context manager::" msgstr "" +"راه‌حل این است که فایل را به‌صورت صریح ببندید. مثال با استفاده از یک مدیر " +"زمینه::" msgid "" "def main():\n" @@ -198,15 +354,28 @@ msgid "" " nlines = len(fp.readlines())\n" " print(nlines)" msgstr "" +"def main():\n" +" # Close the file explicitly when exiting the with block\n" +" with open(sys.argv[1]) as fp:\n" +" nlines = len(fp.readlines())\n" +" print(nlines)" -msgid "Not closing a resource explicitly can leave a resource open for way longer than expected; it can cause severe issues upon exiting Python. It is bad in CPython, but it is even worse in PyPy. Closing resources explicitly makes an application more deterministic and more reliable." +msgid "" +"Not closing a resource explicitly can leave a resource open for way longer " +"than expected; it can cause severe issues upon exiting Python. It is bad in " +"CPython, but it is even worse in PyPy. Closing resources explicitly makes an" +" application more deterministic and more reliable." msgstr "" +"نبستن یک منبع به‌طور صریح می‌تواند باعث شود آن منبع بسیار بیشتر از حد انتظار" +" باز بماند؛ این موضوع می‌تواند هنگام خروج از Python مشکلات شدیدی ایجاد کند. " +"این موضوع در CPython بد است، اما در PyPy حتی بدتر است. بستن منابع به‌طور " +"صریح، یک برنامه را قطعی‌تر و قابل‌اعتمادتر می‌کند." msgid "Bad file descriptor error example" -msgstr "" +msgstr "مثال خطای توصیف‌گر فایل نامعتبر" msgid "Script displaying the first line of itself::" -msgstr "" +msgstr "اسکریپتی که خط نخست خود را نمایش می‌دهد::" msgid "" "import os\n" @@ -220,17 +389,33 @@ msgid "" "\n" "main()" msgstr "" +"import os\n" +"\n" +"def main():\n" +" fp = open(__file__)\n" +" firstline = fp.readline()\n" +" print(firstline.rstrip())\n" +" os.close(fp.fileno())\n" +" # The file is closed implicitly\n" +"\n" +"main()" msgid "By default, Python does not emit any warning:" -msgstr "" +msgstr "به‌طور پیش‌فرض، پایتون هیچ هشداری صادر نمی‌کند:" msgid "" "$ python script.py\n" "import os" msgstr "" +"$ python script.py\n" +"import os" -msgid "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad file descriptor\" error when finalizing the file object:" +msgid "" +"The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " +"file descriptor\" error when finalizing the file object:" msgstr "" +"حالت توسعه پایتون هنگام نهایی‌سازی شیء فایل، یک :exc:`ResourceWarning` را " +"نمایش می‌دهد و خطای «Bad file descriptor» را ثبت می‌کند:" msgid "" "$ python -X dev script.py\n" @@ -244,9 +429,33 @@ msgid "" " main()\n" "OSError: [Errno 9] Bad file descriptor" msgstr "" +"$ python -X dev script.py\n" +"import os\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" +"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" +"Traceback (most recent call last):\n" +" File \"script.py\", line 10, in \n" +" main()\n" +"OSError: [Errno 9] Bad file descriptor" -msgid "``os.close(fp.fileno())`` closes the file descriptor. When the file object finalizer tries to close the file descriptor again, it fails with the ``Bad file descriptor`` error. A file descriptor must be closed only once. In the worst case scenario, closing it twice can lead to a crash (see :issue:`18748` for an example)." -msgstr "" +msgid "" +"``os.close(fp.fileno())`` closes the file descriptor. When the file object " +"finalizer tries to close the file descriptor again, it fails with the ``Bad " +"file descriptor`` error. A file descriptor must be closed only once. In the " +"worst case scenario, closing it twice can lead to a crash (see " +":issue:`18748` for an example)." +msgstr "" +"``os.close(fp.fileno())`` توصیف‌گر فایل را می‌بندد. هنگامی که نهایی‌ساز " +"شیء فایل تلاش می‌کند توصیف‌گر فایل را دوباره ببندد، با خطای ``Bad file " +"descriptor`` مواجه می‌شود. توصیف‌گر فایل باید تنها یک بار بسته شود. در " +"بدترین حالت، دو بار بستن آن می‌تواند منجر به فروپاشی شود (برای نمونه " +":issue:`18748` را ببینید)." -msgid "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file with ``closefd=False``." +msgid "" +"The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " +"with ``closefd=False``." msgstr "" +"راه‌حل، حذف خط ``os.close(fp.fileno())`` یا باز کردن فایل با " +"``closefd=False`` است." diff --git a/library/dialog.po b/library/dialog.po index 38ae67ad1..bc8ef0388 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -22,205 +22,410 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Tkinter dialogs" -msgstr "" +msgstr "دیالوگ‌های Tkinter" msgid ":mod:`!tkinter.simpledialog` --- Standard Tkinter input dialogs" -msgstr "" +msgstr ":mod:`!tkinter.simpledialog` --- محاوره‌های ورودی استاندارد Tkinter" msgid "**Source code:** :source:`Lib/tkinter/simpledialog.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/tkinter/simpledialog.py`" -msgid "The :mod:`!tkinter.simpledialog` module contains convenience classes and functions for creating simple modal dialogs to get a value from the user." +msgid "" +"The :mod:`!tkinter.simpledialog` module contains convenience classes and " +"functions for creating simple modal dialogs to get a value from the user." msgstr "" +"ماژول :mod:`!tkinter.simpledialog` شامل کلاس‌ها و توابع تسهیل‌کننده‌ای برای " +"ایجاد پنجره‌های محاوره‌ای مودال (modal) ساده است تا مقداری را از کاربر " +"دریافت کند." -msgid "Prompt the user to enter a value of the desired type and return it, or ``None`` if the dialog is cancelled." +msgid "" +"Prompt the user to enter a value of the desired type and return it, or " +"``None`` if the dialog is cancelled." msgstr "" +"از کاربر برای وارد کردن مقداری از نوع موردنظر درخواست می‌کند و آن را " +"برمی‌گرداند، یا اگر پنجره‌ی محاوره‌ای لغو شود، ``None`` برمی‌گرداند." -msgid "*title* is the dialog title and *prompt* the message shown above the entry. *initialvalue* is the value initially placed in the entry. *parent* is the window over which the dialog is shown. :func:`askinteger` and :func:`askfloat` also accept *minvalue* and *maxvalue*, which bound the accepted value. :func:`askstring` also accepts *show*, a character used to mask the entered text, for example ``'*'`` to hide a password." -msgstr "" +msgid "" +"*title* is the dialog title and *prompt* the message shown above the entry. " +"*initialvalue* is the value initially placed in the entry. *parent* is the " +"window over which the dialog is shown. :func:`askinteger` and " +":func:`askfloat` also accept *minvalue* and *maxvalue*, which bound the " +"accepted value. :func:`askstring` also accepts *show*, a character used to " +"mask the entered text, for example ``'*'`` to hide a password." +msgstr "" +"*title* عنوان محاوره است و *prompt* پیامی است که بالای ورودی نمایش داده " +"می‌شود. *initialvalue* مقداری است که در ابتدا در ورودی قرار داده می‌شود. " +"*parent* پنجره‌ای است که محاوره روی آن نمایش داده می‌شود. :func:`askinteger`" +" و :func:`askfloat` همچنین *minvalue* و *maxvalue* را می‌پذیرند، که مقدار " +"پذیرفته‌شده را محدود می‌کنند. :func:`askstring` همچنین *show* را می‌پذیرد، " +"نویسه‌ای که برای پوشاندن متن واردشده استفاده می‌شود، برای مثال ``'*'`` برای " +"پنهان کردن گذرواژه." -msgid "The base class for custom dialogs. Instantiating it shows the dialog modally and returns once the user closes it; the entered value is then available in the :attr:`!result` attribute." +msgid "" +"The base class for custom dialogs. Instantiating it shows the dialog modally" +" and returns once the user closes it; the entered value is then available in" +" the :attr:`!result` attribute." msgstr "" +"کلاس پایه برای محاوره‌های سفارشی. نمونه‌سازی از آن، محاوره را به‌صورت مودال " +"نمایش می‌دهد و پس از اینکه کاربر آن را ببندد، بازمی‌گردد؛ سپس مقدار واردشده " +"در ویژگی :attr:`!result` در دسترس است." -msgid "The value produced by :meth:`apply`, or ``None`` if the dialog was cancelled." -msgstr "" +msgid "" +"The value produced by :meth:`apply`, or ``None`` if the dialog was " +"cancelled." +msgstr "مقدار حاصل از :meth:`apply`، یا ``None`` اگر محاوره لغو شده باشد." -msgid "Override to construct the dialog's interface and return the widget that should have initial focus." +msgid "" +"Override to construct the dialog's interface and return the widget that " +"should have initial focus." msgstr "" +"بازنویسی کنید تا رابط دیالوگ را بسازد و ابزارکی که باید فوکوس اولیه را داشته" +" باشد برگرداند." -msgid "Default behaviour adds OK and Cancel buttons. Override for custom button layouts." +msgid "" +"Default behaviour adds OK and Cancel buttons. Override for custom button " +"layouts." msgstr "" +"رفتار پیش‌فرض، دکمه‌های OK و Cancel را اضافه می‌کند. برای چیدمان‌های سفارشی " +"دکمه‌ها، آن را بازنویسی کنید." -msgid "Validate the data entered by the user. Return true if it is valid, in which case the dialog proceeds to :meth:`apply`; return false to keep the dialog open. The default implementation always returns true; override it to check the input." +msgid "" +"Validate the data entered by the user. Return true if it is valid, in which " +"case the dialog proceeds to :meth:`apply`; return false to keep the dialog " +"open. The default implementation always returns true; override it to check " +"the input." msgstr "" +"داده واردشده توسط کاربر را اعتبارسنجی کنید. اگر معتبر باشد، true را " +"برگردانید، که در این صورت محاوره به :meth:`apply` می‌رود؛ برای باز نگه‌داشتن" +" محاوره، false را برگردانید. پیاده‌سازی پیش‌فرض همیشه true را برمی‌گرداند؛ " +"برای بررسی ورودی، آن را بازنویسی کنید." -msgid "Process the data entered by the user, for example by storing it in the :attr:`!result` attribute. Called after :meth:`validate` succeeds and just before the dialog is destroyed. The default implementation does nothing; override it to act on or store the result." +msgid "" +"Process the data entered by the user, for example by storing it in the " +":attr:`!result` attribute. Called after :meth:`validate` succeeds and just " +"before the dialog is destroyed. The default implementation does nothing; " +"override it to act on or store the result." msgstr "" +"داده‌های واردشده توسط کاربر را پردازش کنید، برای مثال با ذخیره‌ی آن‌ها در " +"ویژگی :attr:`!result`. پس از موفقیت :meth:`validate` و درست پیش از تخریب " +"محاوره فراخوانی می‌شود. پیاده‌سازی پیش‌فرض هیچ کاری انجام نمی‌دهد؛ آن را " +"بازنویسی کنید تا بر اساس نتیجه عمل کند یا آن را ذخیره کند." -msgid "Destroy the dialog window, clearing the reference to the widget that had the initial focus." +msgid "" +"Destroy the dialog window, clearing the reference to the widget that had the" +" initial focus." msgstr "" +"پنجره‌ی محاوره را از بین می‌برد و ارجاع به ابزارکی که فوکوس اولیه را داشت پاک " +"می‌کند." -msgid "A simple modal dialog that displays the message *text* above a row of push buttons whose labels are given by *buttons*, and returns the index of the button the user presses. *default* is the index of the button activated by the Return key, *cancel* the index returned when the window is closed through the window manager, *title* the window title, and *class_* the Tk class name of the window." -msgstr "" +msgid "" +"A simple modal dialog that displays the message *text* above a row of push " +"buttons whose labels are given by *buttons*, and returns the index of the " +"button the user presses. *default* is the index of the button activated by " +"the Return key, *cancel* the index returned when the window is closed " +"through the window manager, *title* the window title, and *class_* the Tk " +"class name of the window." +msgstr "" +"یک پنجره‌ی محاوره‌ای مودال ساده که پیام *text* را بالای ردیفی از دکمه‌های " +"فشاری نمایش می‌دهد که برچسب‌های آن‌ها با *buttons* مشخص شده‌اند، و اندیس " +"دکمه‌ای را که کاربر فشار می‌دهد برمی‌گرداند. *default* اندیس دکمه‌ای است که " +"با کلید Return فعال می‌شود، *cancel* اندیسی است که هنگام بسته شدن پنجره از " +"طریق مدیر پنجره برگردانده می‌شود، *title* عنوان پنجره است، و *class_* نام " +"کلاس Tk پنجره است." -msgid "Display the dialog, wait until the user presses a button or closes the window, and return the index of the chosen button." +msgid "" +"Display the dialog, wait until the user presses a button or closes the " +"window, and return the index of the chosen button." msgstr "" +"محاوره را نمایش دهید، منتظر بمانید تا کاربر دکمه‌ای را فشار دهد یا پنجره را " +"ببندد، و اندیس دکمه‌ی انتخاب‌شده را برگردانید." msgid ":mod:`!tkinter.filedialog` --- File selection dialogs" -msgstr "" +msgstr ":mod:`!tkinter.filedialog` --- محاوره‌های انتخاب فایل" msgid "**Source code:** :source:`Lib/tkinter/filedialog.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/filedialog.py`" -msgid "The :mod:`!tkinter.filedialog` module provides classes and factory functions for creating file/directory selection windows." +msgid "" +"The :mod:`!tkinter.filedialog` module provides classes and factory functions" +" for creating file/directory selection windows." msgstr "" +"ماژول :mod:`!tkinter.filedialog` کلاس‌ها و توابع کارخانه‌ای (factory " +"functions) را برای ایجاد پنجره‌های انتخاب فایل/پوشه ارائه می‌دهد." msgid "Native load/save dialogs" -msgstr "" +msgstr "محاوره‌های بومی بارگذاری/ذخیره" -msgid "The following classes and functions provide file dialog windows that combine a native look-and-feel with configuration options to customize behaviour. The following keyword arguments are applicable to the classes and functions listed below:" +msgid "" +"The following classes and functions provide file dialog windows that combine" +" a native look-and-feel with configuration options to customize behaviour. " +"The following keyword arguments are applicable to the classes and functions " +"listed below:" msgstr "" +"کلاس‌ها و توابع زیر پنجره‌های محاوره‌ای فایل را فراهم می‌کنند که ظاهر و " +"رفتار بومی را با گزینه‌های پیکربندی برای سفارشی‌سازی رفتار ترکیب می‌کنند. " +"آرگومان‌های کلیدواژه‌ای زیر بر کلاس‌ها و توابع فهرست‌شده در زیر قابل اعمال " +"هستند:" msgid "*parent* - the window to place the dialog on top of" -msgstr "" +msgstr "*parent* - پنجره‌ای که محاوره روی آن قرار می‌گیرد" msgid "*title* - the title of the window" -msgstr "" +msgstr "*title* - عنوان پنجره" msgid "*initialdir* - the directory that the dialog starts in" -msgstr "" +msgstr "*initialdir* - پوشه‌ای که پنجره‌ی محاوره‌ای در آن آغاز می‌شود" msgid "*initialfile* - the file selected upon opening of the dialog" -msgstr "" +msgstr "*initialfile* - فایل انتخاب‌شده هنگام باز شدن دیالوگ" -msgid "*filetypes* - a sequence of (label, pattern) tuples, '*' wildcard is allowed" +msgid "" +"*filetypes* - a sequence of (label, pattern) tuples, '*' wildcard is allowed" msgstr "" +"*filetypes* - دنباله‌ای از تاپل‌های (label, pattern)، وایلدکارد '*' مجاز " +"است" -msgid "*defaultextension* - default extension to append to file (save dialogs)" +msgid "" +"*defaultextension* - default extension to append to file (save dialogs)" msgstr "" +"*defaultextension* - پسوند پیش‌فرض برای افزودن به فایل (پنجره‌های محاوره‌ای " +"ذخیره)" msgid "*multiple* - when true, selection of multiple items is allowed" -msgstr "" +msgstr "*multiple* - هنگامی که true باشد، انتخاب چند آیتم مجاز است" msgid "**Static factory functions**" -msgstr "" +msgstr "توابع کارخانه‌ای ایستا" -msgid "The below functions when called create a modal, native look-and-feel dialog, wait for the user's selection, and return it. The exact return value depends on the function (see below); when the dialog is cancelled it is an empty string, an empty tuple or ``None``. The precise type of this empty value may vary between platforms and Tk versions, so test the result for truth rather than comparing it with a specific value." -msgstr "" +msgid "" +"The below functions when called create a modal, native look-and-feel dialog," +" wait for the user's selection, and return it. The exact return value " +"depends on the function (see below); when the dialog is cancelled it is an " +"empty string, an empty tuple or ``None``. The precise type of this empty " +"value may vary between platforms and Tk versions, so test the result for " +"truth rather than comparing it with a specific value." +msgstr "" +"توابع زیر هنگام فراخوانی، یک پنجره محاوره‌ای مودال (modal) با ظاهر و رفتار " +"بومی ایجاد می‌کنند، منتظر انتخاب کاربر می‌مانند و آن را برمی‌گردانند. مقدار " +"بازگشتی دقیق به تابع بستگی دارد (در زیر ببینید)؛ هنگامی که پنجره محاوره‌ای " +"لغو می‌شود، این مقدار یک رشته خالی، یک تاپل خالی یا ``None`` است. نوع دقیق " +"این مقدار خالی ممکن است بین سکوها و نسخه‌های Tk متفاوت باشد، بنابراین " +"به‌جای مقایسه آن با یک مقدار خاص، درستی نتیجه را بسنجید." -msgid "Create an :class:`Open` dialog. :func:`askopenfile` returns the opened file object, or ``None`` if the dialog is cancelled. :func:`askopenfiles` returns a list of the opened file objects, or an empty tuple if cancelled. The files are opened in mode *mode* (read-only ``'r'`` by default)." +msgid "" +"Create an :class:`Open` dialog. :func:`askopenfile` returns the opened file " +"object, or ``None`` if the dialog is cancelled. :func:`askopenfiles` returns" +" a list of the opened file objects, or an empty tuple if cancelled. The " +"files are opened in mode *mode* (read-only ``'r'`` by default)." msgstr "" +"یک پنجره‌ی محاوره‌ای :class:`Open` ایجاد کنید. :func:`askopenfile` شیء فایل " +"بازشده را برمی‌گرداند، یا اگر پنجره‌ی محاوره‌ای لغو شود، ``None`` را " +"برمی‌گرداند. :func:`askopenfiles` فهرستی از اشیای فایل بازشده را " +"برمی‌گرداند، یا در صورت لغو شدن، یک تاپل خالی را برمی‌گرداند. فایل‌ها در " +"حالت *mode* باز می‌شوند (به‌طور پیش‌فرض، حالت فقط‌خواندنی ``'r'``)." -msgid "Create a :class:`SaveAs` dialog and return the opened file object, or ``None`` if the dialog is cancelled. The file is opened in mode *mode* (``'w'`` by default)." +msgid "" +"Create a :class:`SaveAs` dialog and return the opened file object, or " +"``None`` if the dialog is cancelled. The file is opened in mode *mode* " +"(``'w'`` by default)." msgstr "" +"یک پنجره‌ی محاوره‌ای :class:`SaveAs` ایجاد می‌کند و شیء فایل بازشده را " +"برمی‌گرداند، یا اگر پنجره‌ی محاوره‌ای لغو شود، ``None`` را برمی‌گرداند. فایل" +" در حالت *mode* باز می‌شود (به‌طور پیش‌فرض ``'w'``)." -msgid "Create an :class:`Open` dialog. :func:`askopenfilename` returns the selected filename as a string, or an empty string if the dialog is cancelled. :func:`askopenfilenames` returns a tuple of the selected filenames, or an empty tuple if cancelled." +msgid "" +"Create an :class:`Open` dialog. :func:`askopenfilename` returns the selected" +" filename as a string, or an empty string if the dialog is cancelled. " +":func:`askopenfilenames` returns a tuple of the selected filenames, or an " +"empty tuple if cancelled." msgstr "" +"یک پنجره‌ی محاوره‌ای :class:`Open` ایجاد کنید. :func:`askopenfilename` نام " +"فایل انتخاب‌شده را به‌صورت یک رشته برمی‌گرداند، یا اگر پنجره‌ی محاوره‌ای لغو" +" شود، یک رشته‌ی خالی برمی‌گرداند. :func:`askopenfilenames` یک تاپل از نام " +"فایل‌های انتخاب‌شده برمی‌گرداند، یا در صورت لغو، یک تاپل خالی برمی‌گرداند." -msgid "Create a :class:`SaveAs` dialog and return the selected filename as a string, or an empty string if the dialog is cancelled." +msgid "" +"Create a :class:`SaveAs` dialog and return the selected filename as a " +"string, or an empty string if the dialog is cancelled." msgstr "" +"یک پنجره‌ی محاوره‌ای :class:`SaveAs` ایجاد کنید و نام فایل انتخاب‌شده را " +"به‌عنوان یک رشته برگردانید، یا اگر پنجره‌ی محاوره‌ای لغو شد، یک رشته‌ی خالی " +"برگردانید." -msgid "Prompt the user to select a directory, and return its path as a string, or an empty string if the dialog is cancelled. Additional keyword option: *mustexist* - if true, the user may only select an existing directory (false by default)." +msgid "" +"Prompt the user to select a directory, and return its path as a string, or " +"an empty string if the dialog is cancelled. Additional keyword option: " +"*mustexist* - if true, the user may only select an existing directory (false" +" by default)." msgstr "" +"از کاربر برای انتخاب یک پوشه درخواست می‌کند و مسیر آن را به‌صورت یک رشته " +"برمی‌گرداند، یا اگر پنجره‌ی گفتگو لغو شود، یک رشته خالی برمی‌گرداند. گزینه " +"کلیدواژه‌ای اضافی: *mustexist* - اگر true باشد، کاربر فقط می‌تواند یک پوشه‌ی " +"موجود را انتخاب کند (به‌طور پیش‌فرض false است)." -msgid "The above three classes provide native dialog windows for loading and saving files and for selecting a directory." +msgid "" +"The above three classes provide native dialog windows for loading and saving" +" files and for selecting a directory." msgstr "" +"سه کلاس بالا، پنجره‌های محاوره‌ای بومی را برای بارگذاری و ذخیره فایل‌ها و " +"برای انتخاب یک پوشه فراهم می‌کنند." msgid "**Convenience classes**" -msgstr "" +msgstr "کلاس‌های راحتی" -msgid "The below classes are used for creating file/directory windows from scratch. These do not emulate the native look-and-feel of the platform." +msgid "" +"The below classes are used for creating file/directory windows from scratch." +" These do not emulate the native look-and-feel of the platform." msgstr "" +"کلاس‌های زیر برای ایجاد پنجره‌های فایل/پوشه از صفر استفاده می‌شوند. این‌ها " +"ظاهر و رفتار بومی پلتفرم را شبیه‌سازی نمی‌کنند." -msgid "The *FileDialog* class should be subclassed for custom event handling and behaviour." +msgid "" +"The *FileDialog* class should be subclassed for custom event handling and " +"behaviour." msgstr "" +"برای مدیریت رویداد و رفتار سفارشی، باید از کلاس *FileDialog* زیرکلاس ساخته " +"شود." msgid "Create a basic file selection dialog." -msgstr "" +msgstr "یک محاوره‌ی انتخاب فایل ساده ایجاد کنید." msgid "Trigger the termination of the dialog window." -msgstr "" +msgstr "باعث پایان یافتن پنجره‌ی محاوره‌ای شوید." msgid "Event handler for double-click event on directory." -msgstr "" +msgstr "مدیر رویداد دوبارکلیک روی پوشه." msgid "Event handler for click event on directory." -msgstr "" +msgstr "مدیر رویداد برای رویداد کلیک روی پوشه." msgid "Event handler for double-click event on file." -msgstr "" +msgstr "مدیر رویداد برای رویداد دوبارکلیک روی فایل." msgid "Event handler for single-click event on file." -msgstr "" +msgstr "مدیر رویداد برای رویداد تک‌کلیک روی فایل." msgid "Filter the files by directory." -msgstr "" +msgstr "فایل‌ها را بر اساس پوشه فیلتر کنید." msgid "Retrieve the file filter currently in use." -msgstr "" +msgstr "فیلتر فایل در حال استفاده را دریافت کنید." msgid "Retrieve the currently selected item." -msgstr "" +msgstr "آیتم انتخاب‌شده‌ی فعلی را بازیابی کنید." msgid "Render dialog and start event loop." -msgstr "" +msgstr "دیالوگ را ترسیم کنید و حلقه رویداد را آغاز کنید." msgid "Exit dialog returning current selection." -msgstr "" +msgstr "خروج از پنجره‌ی محاوره با برگرداندن انتخاب فعلی." -msgid "Called when the user confirms the current selection. The base implementation accepts the selection and closes the dialog; :class:`LoadFileDialog` and :class:`SaveFileDialog` override it to check the selection first." +msgid "" +"Called when the user confirms the current selection. The base implementation" +" accepts the selection and closes the dialog; :class:`LoadFileDialog` and " +":class:`SaveFileDialog` override it to check the selection first." msgstr "" +"هنگامی که کاربر انتخاب فعلی را تأیید می‌کند، فراخوانی می‌شود. پیاده‌سازی " +"پایه انتخاب را می‌پذیرد و پنجره‌ی محاوره‌ای را می‌بندد؛ " +":class:`LoadFileDialog` و :class:`SaveFileDialog` آن را بازنویسی می‌کنند تا " +"ابتدا انتخاب را بررسی کنند." msgid "Exit dialog returning filename, if any." -msgstr "" +msgstr "محاوره‌ی خروج که نام فایل را در صورت وجود برمی‌گرداند." msgid "Set the file filter." -msgstr "" +msgstr "فیلتر فایل را تنظیم کنید." msgid "Update the current file selection to *file*." -msgstr "" +msgstr "انتخاب فایل جاری را به *file* به‌روزرسانی کنید." -msgid "A subclass of FileDialog that creates a dialog window for selecting an existing file." +msgid "" +"A subclass of FileDialog that creates a dialog window for selecting an " +"existing file." msgstr "" +"یک زیرکلاس از FileDialog که یک پنجره‌ی محاوره‌ای برای انتخاب یک فایل موجود " +"ایجاد می‌کند." -msgid "Test that a file is provided and that the selection indicates an already existing file." +msgid "" +"Test that a file is provided and that the selection indicates an already " +"existing file." msgstr "" +"آزمایش کنید که فایلی ارائه‌شده باشد و انتخاب، نشان‌دهنده‌ی یک فایل از قبل " +"موجود باشد." -msgid "A subclass of FileDialog that creates a dialog window for selecting a destination file." +msgid "" +"A subclass of FileDialog that creates a dialog window for selecting a " +"destination file." msgstr "" +"زیرکلاسی از FileDialog که یک پنجره‌ی محاوره‌ای برای انتخاب فایل مقصد ایجاد " +"می‌کند." -msgid "Test whether or not the selection points to a valid file that is not a directory. Confirmation is required if an already existing file is selected." +msgid "" +"Test whether or not the selection points to a valid file that is not a " +"directory. Confirmation is required if an already existing file is selected." msgstr "" +"بررسی می‌کند که آیا مورد انتخاب‌شده به یک فایل معتبر اشاره می‌کند که پوشه " +"نیست یا خیر. اگر یک فایل از پیش موجود انتخاب شده باشد، تأیید لازم است." msgid ":mod:`!tkinter.commondialog` --- Dialog window templates" -msgstr "" +msgstr ":mod:`!tkinter.commondialog` --- قالب‌های پنجره محاوره‌ای" msgid "**Source code:** :source:`Lib/tkinter/commondialog.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/commondialog.py`" -msgid "The :mod:`!tkinter.commondialog` module provides the :class:`Dialog` class that is the base class for dialogs defined in other supporting modules." +msgid "" +"The :mod:`!tkinter.commondialog` module provides the :class:`Dialog` class " +"that is the base class for dialogs defined in other supporting modules." msgstr "" +"ماژول :mod:`!tkinter.commondialog` کلاس :class:`Dialog` را فراهم می‌کند که " +"کلاس پایه برای محاوره‌های تعریف‌شده در سایر ماژول‌های پشتیبانی است." msgid "Render the Dialog window." -msgstr "" +msgstr "پنجره‌ی Dialog را رندر کنید." msgid ":mod:`!tkinter.dialog` --- Classic Tk dialog boxes" -msgstr "" +msgstr ":mod:`!tkinter.dialog` --- جعبه‌های محاوره‌ای کلاسیک Tk" msgid "**Source code:** :source:`Lib/tkinter/dialog.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/tkinter/dialog.py`" -msgid "The :mod:`!tkinter.dialog` module provides a simple modal dialog box built on the classic (non-themed) Tk widgets." +msgid "" +"The :mod:`!tkinter.dialog` module provides a simple modal dialog box built " +"on the classic (non-themed) Tk widgets." msgstr "" +"ماژول :mod:`!tkinter.dialog` یک جعبه‌ی محاوره‌ی مودال ساده ارائه می‌دهد که " +"مبتنی بر ابزارک‌های کلاسیک Tk (بدون تم) است." -msgid "The name of a bitmap (``'questhead'``) suitable for use as the *bitmap* of a :class:`Dialog`." +msgid "" +"The name of a bitmap (``'questhead'``) suitable for use as the *bitmap* of a" +" :class:`Dialog`." msgstr "" +"نام یک بیت‌مپ (``'questhead'``) مناسب برای استفاده به‌عنوان *بیت‌مپ* یک " +":class:`Dialog`." -msgid "Display a modal dialog box built from the classic (non-themed) Tk widgets and wait for the user to press one of its buttons. The options, given through *cnf* or as keyword arguments, are all required: *title* (the window title), *text* (the message), *bitmap* (the name of a bitmap icon, such as :data:`DIALOG_ICON`), *default* (the index of the default button) and *strings* (the sequence of button labels). After construction, the :attr:`!num` attribute holds the index of the button the user pressed." -msgstr "" +msgid "" +"Display a modal dialog box built from the classic (non-themed) Tk widgets " +"and wait for the user to press one of its buttons. The options, given " +"through *cnf* or as keyword arguments, are all required: *title* (the window" +" title), *text* (the message), *bitmap* (the name of a bitmap icon, such as " +":data:`DIALOG_ICON`), *default* (the index of the default button) and " +"*strings* (the sequence of button labels). After construction, the " +":attr:`!num` attribute holds the index of the button the user pressed." +msgstr "" +"یک جعبه محاوره‌ای مودال ساخته‌شده از ابزارک‌های کلاسیک Tk (بدون تم) را نمایش" +" می‌دهد و منتظر می‌ماند تا کاربر یکی از دکمه‌های آن را فشار دهد. گزینه‌ها، " +"که از طریق *cnf* یا به‌صورت آرگومان‌های کلیدواژه‌ای داده می‌شوند، همه الزامی" +" هستند: *title* (عنوان پنجره)، *text* (پیام)، *bitmap* (نام یک آیکون بیت‌مپ،" +" مانند :data:`DIALOG_ICON`)، *default* (اندیس دکمه پیش‌فرض) و *strings* " +"(دنباله‌ای از برچسب‌های دکمه). پس از ساخت، ویژگی :attr:`!num` حاوی اندیس " +"دکمه‌ای است که کاربر فشار داده است." -msgid "Do nothing. The dialog window is destroyed automatically before the constructor returns, so there is nothing left for this method to do." +msgid "" +"Do nothing. The dialog window is destroyed automatically before the " +"constructor returns, so there is nothing left for this method to do." msgstr "" +"هیچ کاری انجام نمی‌دهد. پنجره‌ی محاوره‌ای به‌طور خودکار پیش از بازگشت سازنده" +" تخریب می‌شود، بنابراین هیچ کاری برای این متد باقی نمی‌ماند." msgid "Modules :mod:`tkinter.messagebox`, :ref:`tut-files`" -msgstr "" +msgstr "ماژول‌ها :mod:`tkinter.messagebox`، :ref:`tut-files`" diff --git a/library/difflib.po b/library/difflib.po index 5b1e6fe80..7a1bd542a 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"PO-Revision-Date: 2026-08-28 10:12+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,363 +22,884 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!difflib` --- Helpers for computing deltas" -msgstr "" +msgstr ":mod:`!difflib` --- کمک‌کننده‌هایی برای محاسبه‌ی تفاوت‌ها" msgid "**Source code:** :source:`Lib/difflib.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/difflib.py`" -msgid "This module provides classes and functions for comparing sequences. Most of them compare sequences of text lines (for example lists of strings, or :term:`file objects `) and produce :dfn:`diffs` -- reports on the differences. Diffs can be produced in in various formats, including HTML and context and unified diffs -- formats produced by tools like :manpage:`diff ` and :manpage:`git diff `." -msgstr "" +msgid "" +"This module provides classes and functions for comparing sequences. Most of " +"them compare sequences of text lines (for example lists of strings, " +"or :term:`file objects `) and produce :dfn:`diffs` -- reports " +"on the differences. Diffs can be produced in in various formats, including " +"HTML and context and unified diffs -- formats produced by tools " +"like :manpage:`diff ` and :manpage:`git diff `." +msgstr "" +"این ماژول، کلاس‌ها و توابعی را برای مقایسه‌ی دنباله‌ها فراهم می‌کند. بیشتر آن‌ها " +"دنباله‌هایی از خطوط متن را مقایسه می‌کنند (برای مثال فهرست‌هایی از رشته‌ها، " +"یا :term:`اشیای فایل `) و :dfn:`تفاوت‌ها (diffs) ` را " +"تولید می‌کنند -- گزارش‌هایی درباره‌ی تفاوت‌ها. می‌توان تفاوت‌ها را در قالب‌های " +"مختلفی تولید کرد، از جمله HTML و تفاوت‌های زمینه (context) و تفاوت‌های " +"یک‌پارچه (unified) -- قالب‌هایی که توسط ابزارهایی مانند :manpage:`diff " +"` و :manpage:`git diff ` تولید می‌شوند." -msgid "Comparisons are done using a matching algorithm implemented in :class:`SequenceMatcher` -- a flexible class for comparing pairs of sequences of any type, not just text, so long as the sequence elements are :term:`hashable`." +msgid "" +"Comparisons are done using a matching algorithm implemented " +"in :class:`SequenceMatcher` -- a flexible class for comparing pairs of " +"sequences of any type, not just text, so long as the sequence elements " +"are :term:`hashable`." msgstr "" +"مقایسه‌ها با استفاده از الگوریتم تطبیقی انجام می‌شوند که " +"در :class:`SequenceMatcher` پیاده‌سازی شده است — کلاسی انعطاف‌پذیر برای " +"مقایسه‌ی جفت‌هایی از دنباله‌های هر نوعی، نه فقط متن، مشروط بر اینکه عناصر " +"دنباله :term:`hashable` باشند." msgid "Junk heuristic" -msgstr "" +msgstr "هیوریستیک زباله (Junk heuristic)" -msgid ":mod:`!difflib` uses a :dfn:`junk` heuristic: some items are deemed to be :dfn:`junk`, and ignored when searching for similarities. Ideally, these are uninteresting or common items, such as blank lines or whitespace." +msgid "" +":mod:`!difflib` uses a :dfn:`junk` heuristic: some items are deemed to " +"be :dfn:`junk`, and ignored when searching for similarities. Ideally, these " +"are uninteresting or common items, such as blank lines or whitespace." msgstr "" +":mod:`!difflib` از یک اکتشافی :dfn:`junk` استفاده می‌کند: برخی آیتم‌ها " +"به‌عنوان :dfn:`junk` تلقی می‌شوند و هنگام جست‌وجوی شباهت‌ها نادیده گرفته " +"می‌شوند. در حالت ایده‌آل، این‌ها آیتم‌های بی‌اهمیت یا رایج هستند، مانند خطوط " +"خالی یا فضای سفید." -msgid "This heuristic can speed the algorithm up (because it reduces the number of possible combinations) and it can produce results that are more understandable for humans (typically breaking on whitespace). But it can also cause pathological cases:" +msgid "" +"This heuristic can speed the algorithm up (because it reduces the number of " +"possible combinations) and it can produce results that are more " +"understandable for humans (typically breaking on whitespace). But it can " +"also cause pathological cases:" msgstr "" +"این روش اکتشافی می‌تواند سرعت الگوریتم را افزایش دهد (زیرا تعداد ترکیب‌های " +"ممکن را کاهش می‌دهد) و می‌تواند نتایجی تولید کند که برای انسان قابل‌فهم‌تر " +"هستند (معمولاً شکستن در فضای خالی). اما همچنین می‌تواند باعث ایجاد موارد " +"آسیب‌شناختی شود:" -msgid "Inappropriately chosen junk items can cause an unexpectedly **large** (but still correct) result." +msgid "" +"Inappropriately chosen junk items can cause an unexpectedly **large** (but " +"still correct) result." msgstr "" +"آیتم‌های هرزی که به‌صورت نامناسب انتخاب شده‌اند، می‌توانند منجر به نتیجه‌ای " +"به‌طور غیرمنتظره‌ای **بزرگ** (اما همچنان صحیح) شوند." -msgid "The default heuristic is **asymmetric**: only the second sequence is inspected when determining what is considered junk, so comparing A to B can give different results than comparing B to A and reversing the result." +msgid "" +"The default heuristic is **asymmetric**: only the second sequence is " +"inspected when determining what is considered junk, so comparing A to B can " +"give different results than comparing B to A and reversing the result." msgstr "" +"روش اکتشافی پیش‌فرض **نامتقارن** است: هنگام تعیین این‌که چه چیزی آشغال محسوب " +"می‌شود، فقط دنباله‌ی دوم بررسی می‌شود؛ بنابراین مقایسه‌ی A با B می‌تواند نتایج " +"متفاوتی نسبت به مقایسه‌ی B با A و معکوس کردن نتیجه بدهد." -msgid "By default, if the second input sequence is at least 200 items long, items that account for more than 1% it are considered *junk*." +msgid "" +"By default, if the second input sequence is at least 200 items long, items " +"that account for more than 1% it are considered *junk*." msgstr "" +"به‌طور پیش‌فرض، اگر طول دومین دنباله ورودی حداقل ۲۰۰ آیتم باشد، آیتم‌هایی که " +"بیش از ۱٪ آن را تشکیل می‌دهند، *آشغال* در نظر گرفته می‌شوند." -msgid "Depending on your data, you should consider turning this heuristic off (setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to to ``False``) or tuning it (using the *isjunk* argument, perhaps to one of the :ref:`predefined functions `)." +msgid "" +"Depending on your data, you should consider turning this heuristic off " +"(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to to " +"``False``) or tuning it (using the *isjunk* argument, perhaps to one of " +"the :ref:`predefined functions `)." msgstr "" +"بسته به داده‌های شما، باید غیرفعال کردن این روش اکتشافی (تنظیم آرگومان " +"*autojunk* در :class:`~difflib.SequenceMatcher` روی ``False``) یا تنظیم آن " +"(با استفاده از آرگومان *isjunk*، شاید به یکی از :ref:`توابع از پیش تعریف‌شده " +"`) را در نظر بگیرید." msgid "The :mod:`!difflib` algorithm" -msgstr "" +msgstr "الگوریتم :mod:`!difflib`" -msgid "The algorithm used in :class:`SequenceMatcher` predates, and is a little fancier than, an algorithm published in the late 1980s by Ratcliff and Obershelp under the hyperbolic name \"gestalt pattern matching.\" The idea is to find the longest contiguous subsequence common to both inputs, then recursively handle the pieces of the sequences to the left and to the right of the matching subsequence." -msgstr "" +msgid "" +"The algorithm used in :class:`SequenceMatcher` predates, and is a little " +"fancier than, an algorithm published in the late 1980s by Ratcliff and " +"Obershelp under the hyperbolic name \"gestalt pattern matching.\" The idea " +"is to find the longest contiguous subsequence common to both inputs, then " +"recursively handle the pieces of the sequences to the left and to the right " +"of the matching subsequence." +msgstr "" +"الگوریتم استفاده‌شده در :class:`SequenceMatcher` از الگوریتمی که در اواخر " +"دهه‌ی ۱۹۸۰ توسط رتکلیف و اوبرزهلپ با نام اغراق‌آمیز «تطبیق الگوی گشتالت " +"(gestalt pattern matching)» منتشر شد، قدیمی‌تر است و کمی پیشرفته‌تر از آن " +"است. ایده این است که طولانی‌ترین زیردنباله‌ی پیوسته‌ی مشترک بین هر دو ورودی پیدا " +"شود، سپس بخش‌های دنباله‌ها در سمت چپ و راست زیردنباله‌ی منطبق به‌صورت بازگشتی " +"پردازش شوند." -msgid "`Pattern Matching: The Gestalt Approach `_" +msgid "" +"`Pattern Matching: The Gestalt Approach `_" msgstr "" +"`تطبیق الگو: رویکرد گشتالت `_" -msgid "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This was published in Dr. Dobb's Journal in July, 1988." +msgid "" +"Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " +"This was published in Dr. Dobb's Journal in July, 1988." msgstr "" +"بحثی درباره‌ی یک الگوریتم مشابه توسط John W. Ratcliff و D. E. Metzener. این " +"مطلب در ژوئیه‌ی ۱۹۸۸ در مجله‌ی Dr. Dobb's Journal منتشر شد." -msgid "As an extension to the Ratcliff and Obershelp algorithm, :mod:`!difflib` searches for the longest *junk-free* contiguous subsequence. See the :ref:`difflib-junk` section for details." +msgid "" +"As an extension to the Ratcliff and Obershelp algorithm, :mod:`!difflib` " +"searches for the longest *junk-free* contiguous subsequence. See " +"the :ref:`difflib-junk` section for details." msgstr "" +"به‌عنوان گسترشی بر الگوریتم Ratcliff و Obershelp، :mod:`!difflib` به دنبال " +"طولانی‌ترین زیردنباله‌ی پیوسته‌ی *عاری از هرز* می‌گردد. برای جزئیات، " +"بخش :ref:`difflib-junk` را ببینید." msgid "Timing" -msgstr "" +msgstr "زمان‌سنجی" -msgid "The basic Ratcliff-Obershelp algorithm is cubic time in the worst case and quadratic time in the expected case. :mod:`difflib`'s algorithm is quadratic time for the worst case and has expected-case behavior dependent in a complicated way on how many elements the sequences have in common; best case time is linear." +msgid "" +"The basic Ratcliff-Obershelp algorithm is cubic time in the worst case and " +"quadratic time in the expected case. :mod:`difflib`'s algorithm is " +"quadratic time for the worst case and has expected-case behavior dependent " +"in a complicated way on how many elements the sequences have in common; " +"best case time is linear." msgstr "" +"الگوریتم پایه‌ی Ratcliff-Obershelp در بدترین حالت دارای زمان مکعبی و در حالت " +"مورد انتظار دارای زمان مربعی است. الگوریتم :mod:`difflib` در بدترین حالت " +"دارای زمان مربعی است و رفتار آن در حالت مورد انتظار به‌شکل پیچیده‌ای به تعداد " +"عناصر مشترک دنباله‌ها وابسته است؛ زمان بهترین حالت خطی است." msgid "Diff generation" -msgstr "" +msgstr "تولید تفاوت (diff)" -msgid "This is a class for comparing sequences of lines of text, and producing human-readable differences or deltas. Differ uses :class:`SequenceMatcher` both to compare sequences of lines, and to compare sequences of characters within similar (near-matching) lines." +msgid "" +"This is a class for comparing sequences of lines of text, and producing " +"human-readable differences or deltas. Differ uses :class:`SequenceMatcher` " +"both to compare sequences of lines, and to compare sequences of characters " +"within similar (near-matching) lines." msgstr "" +"این یک کلاس برای مقایسه‌ی دنباله‌هایی از خطوط متن و تولید تفاوت‌ها یا دلتاهای " +"قابل‌خواندن برای انسان است. Differ از :class:`SequenceMatcher` هم برای " +"مقایسه‌ی دنباله‌هایی از خطوط و هم برای مقایسه‌ی دنباله‌هایی از نویسه‌ها درون خطوط " +"مشابه (تقریباً منطبق) استفاده می‌کند." msgid "Each line of a :class:`Differ` delta begins with a two-letter code:" -msgstr "" +msgstr "هر خط از دلتای :class:`Differ` با کدی دو نویسه‌ای آغاز می‌شود:" msgid "Code" -msgstr "" +msgstr "کد" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``'- '``" -msgstr "" +msgstr "``'- '``" msgid "line unique to sequence 1" -msgstr "" +msgstr "خط مختص دنباله‌ی ۱" msgid "``'+ '``" -msgstr "" +msgstr "``'+ '``" msgid "line unique to sequence 2" -msgstr "" +msgstr "خط یکتا برای دنباله ۲" msgid "``' '``" -msgstr "" +msgstr "``' '``" msgid "line common to both sequences" -msgstr "" +msgstr "خط مشترک بین هر دو دنباله" msgid "``'? '``" -msgstr "" +msgstr "``'? '``" msgid "line not present in either input sequence" -msgstr "" +msgstr "خط در هیچ‌یک از دنباله‌های ورودی وجود ندارد" -msgid "Lines beginning with '``?``' attempt to guide the eye to intraline differences, and were not present in either input sequence. These lines can be confusing if the sequences contain whitespace characters, such as spaces, tabs or line breaks." +msgid "" +"Lines beginning with '``?``' attempt to guide the eye to intraline " +"differences, and were not present in either input sequence. These lines can " +"be confusing if the sequences contain whitespace characters, such as " +"spaces, tabs or line breaks." msgstr "" +"خط‌هایی که با '``?``' شروع می‌شوند، تلاش می‌کنند توجه را به تفاوت‌های درون‌خطی " +"جلب کنند، و در هیچ‌یک از دنباله‌های ورودی وجود نداشتند. این خطوط ممکن است در " +"صورتی گیج‌کننده باشند که دنباله‌ها حاوی نویسه‌های فضای خالی مانند فاصله‌ها، " +"تب‌ها یا خط‌های جدید باشند." -msgid "Note that :class:`Differ`\\ -generated deltas make no claim to be **minimal** diffs. To the contrary, minimal diffs are often counter-intuitive for humans, because they synch up anywhere possible, sometimes at accidental matches 100 pages apart. Restricting synch points to contiguous matches preserves some notion of locality, at the occasional cost of producing a longer diff." -msgstr "" +msgid "" +"Note that :class:`Differ`\\ -generated deltas make no claim to be " +"**minimal** diffs. To the contrary, minimal diffs are often counter-" +"intuitive for humans, because they synch up anywhere possible, sometimes at " +"accidental matches 100 pages apart. Restricting synch points to contiguous " +"matches preserves some notion of locality, at the occasional cost of " +"producing a longer diff." +msgstr "" +"توجه داشته باشید که دلتاهای تولیدشده توسط :class:`Differ` ادعایی ندارند که " +"تفاوت‌های **کمینه** باشند. برعکس، تفاوت‌های کمینه اغلب برای انسان‌ها برخلاف " +"شهود هستند، زیرا در هر جایی که ممکن باشد همگام می‌شوند، گاهی در تطابق‌های " +"تصادفی که ۱۰۰ صفحه با یکدیگر فاصله دارند. محدود کردن نقاط همگام‌سازی به " +"تطابق‌های متوالی، تا حدی مفهوم محلی بودن را حفظ می‌کند، هرچند گاهی به بهای " +"تولید یک تفاوت طولانی‌تر تمام می‌شود." msgid "The :class:`Differ` class has this constructor:" -msgstr "" +msgstr "کلاس :class:`Differ` این سازنده را دارد:" -msgid "Optional keyword parameters *linejunk* and *charjunk* are for filter functions (or ``None``):" +msgid "" +"Optional keyword parameters *linejunk* and *charjunk* are for filter " +"functions (or ``None``):" msgstr "" +"پارامترهای کلیدواژه‌ای اختیاری *linejunk* و *charjunk* برای توابع فیلتر (یا " +"``None``) هستند:" -msgid "*linejunk*: A function that accepts a single string argument, and returns true if the string is junk. The default is ``None``, meaning that no line is considered junk." +msgid "" +"*linejunk*: A function that accepts a single string argument, and returns " +"true if the string is junk. The default is ``None``, meaning that no line " +"is considered junk." msgstr "" +"*linejunk*: تابعی که تنها یک آرگومان رشته‌ای می‌پذیرد و اگر رشته هرز باشد، " +"مقدار true را برمی‌گرداند. مقدار پیش‌فرض ``None`` است، به این معنا که هیچ خطی " +"هرز در نظر گرفته نمی‌شود." -msgid "*charjunk*: A function that accepts a single character argument (a string of length 1), and returns true if the character is junk. The default is ``None``, meaning that no character is considered junk." +msgid "" +"*charjunk*: A function that accepts a single character argument (a string " +"of length 1), and returns true if the character is junk. The default is " +"``None``, meaning that no character is considered junk." msgstr "" +"*charjunk*: تابعی که یک آرگومان تک‌نویسه‌ای (رشته‌ای به طول ۱) می‌پذیرد و اگر " +"نویسه هرز باشد، مقدار درست برمی‌گرداند. مقدار پیش‌فرض ``None`` است، یعنی هیچ " +"نویسه‌ای هرز در نظر گرفته نمی‌شود." -msgid "These junk-filtering functions speed up matching to find differences and do not cause any differing lines or characters to be ignored. Read the description of the :meth:`~SequenceMatcher.find_longest_match` method's *isjunk* parameter for an explanation." +msgid "" +"These junk-filtering functions speed up matching to find differences and do " +"not cause any differing lines or characters to be ignored. Read the " +"description of the :meth:`~SequenceMatcher.find_longest_match` method's " +"*isjunk* parameter for an explanation." msgstr "" +"این توابع پالایش زباله (junk-filtering) سرعت تطبیق برای یافتن تفاوت‌ها را " +"افزایش می‌دهند و باعث نمی‌شوند هیچ خط یا نویسه‌ی متفاوتی نادیده گرفته شود. " +"برای توضیح، شرح پارامتر *isjunk* " +"متد :meth:`~SequenceMatcher.find_longest_match` را بخوانید." -msgid ":class:`Differ` objects are used (deltas generated) via a single method:" +msgid "" +":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" +"از اشیای :class:`Differ` از طریق یک متد واحد استفاده می‌شود (دلتاها تولید " +"می‌شوند):" -msgid "Compare two sequences of lines, and generate the delta (a sequence of lines)." +msgid "" +"Compare two sequences of lines, and generate the delta (a sequence of " +"lines)." msgstr "" +"دو دنباله از خطوط را مقایسه می‌کند و دلتا (دنباله‌ای از خطوط) را تولید می‌کند." -msgid "Each sequence must contain individual single-line strings ending with newlines. Such sequences can be obtained from the :meth:`~io.IOBase.readlines` method of file-like objects. The generated delta also consists of newline-terminated strings, ready to be printed as-is via the :meth:`~io.IOBase.writelines` method of a file-like object." -msgstr "" +msgid "" +"Each sequence must contain individual single-line strings ending with " +"newlines. Such sequences can be obtained from " +"the :meth:`~io.IOBase.readlines` method of file-like objects. The " +"generated delta also consists of newline-terminated strings, ready to be " +"printed as-is via the :meth:`~io.IOBase.writelines` method of a file-like " +"object." +msgstr "" +"هر دنباله باید شامل رشته‌های تک‌خطی جداگانه‌ای باشد که به خط جدید ختم می‌شوند. " +"چنین دنباله‌هایی را می‌توان از متد :meth:`~io.IOBase.readlines` اشیاء شبه‌فایل " +"به‌دست آورد. دلتای تولیدشده نیز از رشته‌های ختم‌شده به خط جدید تشکیل شده است، " +"که آماده‌اند به‌همین‌صورت از طریق متد :meth:`~io.IOBase.writelines` یک شیء " +"شبه‌فایل چاپ شوند." -msgid "This class can be used to create an HTML table (or a complete HTML file containing the table) showing a side by side, line by line comparison of text with inter-line and intra-line change highlights. The table can be generated in either full or contextual difference mode." +msgid "" +"This class can be used to create an HTML table (or a complete HTML file " +"containing the table) showing a side by side, line by line comparison of " +"text with inter-line and intra-line change highlights. The table can be " +"generated in either full or contextual difference mode." msgstr "" +"از این کلاس می‌توان برای ایجاد یک جدول HTML (یا یک فایل HTML کامل شامل جدول) " +"استفاده کرد که مقایسه‌ی کنار هم و خط‌به‌خط متن را با برجسته‌سازی تغییرات بین‌خطی " +"و درون‌خطی نشان می‌دهد. این جدول را می‌توان در حالت تفاوت کامل یا زمینه‌ای " +"تولید کرد." -msgid "The trailing newlines get stripped before the diff, so the result can be incomplete. See :gh:`71896` for details." +msgid "" +"The trailing newlines get stripped before the diff, so the result can be " +"incomplete. See :gh:`71896` for details." msgstr "" +"خطوط جدید پایانی پیش از diff حذف می‌شوند، بنابراین نتیجه ممکن است ناقص باشد. " +"برای جزئیات :gh:`71896` را ببینید." msgid "The constructor for this class is:" -msgstr "" +msgstr "سازنده‌ی این کلاس عبارت است از:" msgid "Initializes instance of :class:`HtmlDiff`." -msgstr "" +msgstr "نمونه‌ای از :class:`HtmlDiff` را مقداردهی اولیه می‌کند." -msgid "*tabsize* is an optional keyword argument to specify tab stop spacing and defaults to ``8``." +msgid "" +"*tabsize* is an optional keyword argument to specify tab stop spacing and " +"defaults to ``8``." msgstr "" +"*tabsize* یک آرگومان کلیدواژه‌ای اختیاری برای تعیین فاصله‌گذاری تب " +"است و مقدار پیش‌فرض آن ``8`` است." -msgid "*wrapcolumn* is an optional keyword to specify column number where lines are broken and wrapped, defaults to ``None`` where lines are not wrapped." +msgid "" +"*wrapcolumn* is an optional keyword to specify column number where lines " +"are broken and wrapped, defaults to ``None`` where lines are not wrapped." msgstr "" +"*wrapcolumn* یک کلیدواژه اختیاری برای مشخص کردن شماره ستونی است که خطوط در " +"آن شکسته و به خط بعد منتقل می‌شوند، و به‌طور پیش‌فرض ``None`` است که در این " +"حالت خطوط به خط بعد منتقل نمی‌شوند." -msgid "*linejunk* and *charjunk* are optional keyword arguments passed into :func:`ndiff` (used by :class:`HtmlDiff` to generate the side by side HTML differences). See :func:`ndiff` documentation for argument default values and descriptions." +msgid "" +"*linejunk* and *charjunk* are optional keyword arguments passed " +"into :func:`ndiff` (used by :class:`HtmlDiff` to generate the side by side " +"HTML differences). See :func:`ndiff` documentation for argument default " +"values and descriptions." msgstr "" +"*linejunk* و *charjunk* آرگومان‌های کلیدواژه‌ای اختیاری هستند که " +"به :func:`ndiff` ارسال می‌شوند (توسط :class:`HtmlDiff` برای تولید تفاوت‌های " +"HTML به‌صورت کنار هم استفاده می‌شود). برای مقادیر پیش‌فرض و توضیحات آرگومان‌ها، " +"مستندات :func:`ndiff` را ببینید." msgid "The following methods are public:" -msgstr "" +msgstr "متدهای زیر عمومی هستند:" -msgid "Compares *fromlines* and *tolines* (lists of strings) and returns a string which is a complete HTML file containing a table showing line by line differences with inter-line and intra-line changes highlighted." +msgid "" +"Compares *fromlines* and *tolines* (lists of strings) and returns a string " +"which is a complete HTML file containing a table showing line by line " +"differences with inter-line and intra-line changes highlighted." msgstr "" +"*fromlines* و *tolines* (فهرست‌هایی از رشته‌ها) را مقایسه می‌کند و رشته‌ای را " +"برمی‌گرداند که یک فایل HTML کامل حاوی جدولی است که تفاوت‌ها را به‌صورت خط‌به‌خط " +"نشان می‌دهد و تغییرات بین‌خطی و درون‌خطی در آن برجسته شده‌اند." -msgid "*fromdesc* and *todesc* are optional keyword arguments to specify from/to file column header strings (both default to an empty string)." +msgid "" +"*fromdesc* and *todesc* are optional keyword arguments to specify from/to " +"file column header strings (both default to an empty string)." msgstr "" +"*fromdesc* و *todesc* آرگومان‌های کلیدواژه‌ای اختیاری هستند که برای مشخص کردن " +"رشته‌های سرآیند ستون فایل مبدأ/مقصد استفاده می‌شوند (مقدار پیش‌فرض هر دو یک " +"رشته خالی است)." -msgid "*context* and *numlines* are both optional keyword arguments. Set *context* to ``True`` when contextual differences are to be shown, else the default is ``False`` to show the full files. *numlines* defaults to ``5``. When *context* is ``True`` *numlines* controls the number of context lines which surround the difference highlights. When *context* is ``False`` *numlines* controls the number of lines which are shown before a difference highlight when using the \"next\" hyperlinks (setting to zero would cause the \"next\" hyperlinks to place the next difference highlight at the top of the browser without any leading context)." -msgstr "" +msgid "" +"*context* and *numlines* are both optional keyword arguments. Set *context* " +"to ``True`` when contextual differences are to be shown, else the default " +"is ``False`` to show the full files. *numlines* defaults to ``5``. When " +"*context* is ``True`` *numlines* controls the number of context lines which " +"surround the difference highlights. When *context* is ``False`` *numlines* " +"controls the number of lines which are shown before a difference highlight " +"when using the \"next\" hyperlinks (setting to zero would cause the " +"\"next\" hyperlinks to place the next difference highlight at the top of " +"the browser without any leading context)." +msgstr "" +"*context* و *numlines* هر دو آرگومان کلیدواژه‌ای اختیاری هستند. هنگامی که " +"باید تفاوت‌های همراه با زمینه نمایش داده شوند، *context* را روی ``True`` " +"تنظیم کنید، در غیر این صورت مقدار پیش‌فرض ``False`` است تا فایل‌های کامل " +"نمایش داده شوند. مقدار پیش‌فرض *numlines* برابر ``5`` است. وقتی *context* " +"برابر ``True`` است، *numlines* تعداد خطوط زمینه‌ای را که تفاوت‌های برجسته‌شده " +"را در بر می‌گیرند، کنترل می‌کند. وقتی *context* برابر ``False`` است، " +"*numlines* تعداد خطوطی را که هنگام استفاده از ابرپیوندهای «next» پیش از یک " +"تفاوت برجسته‌شده نمایش داده می‌شوند، کنترل می‌کند (تنظیم آن روی صفر باعث می‌شود " +"ابرپیوندهای «next» تفاوت برجسته‌شده بعدی را بدون هیچ زمینه پیشین در بالای " +"مرورگر قرار دهند)." -msgid "*fromdesc* and *todesc* are interpreted as unescaped HTML and should be properly escaped while receiving input from untrusted sources." +msgid "" +"*fromdesc* and *todesc* are interpreted as unescaped HTML and should be " +"properly escaped while receiving input from untrusted sources." msgstr "" +"*fromdesc* و *todesc* به‌عنوان HTML خنثی‌نشده تفسیر می‌شوند و باید هنگام " +"دریافت ورودی از منابع نامطمئن، به‌درستی خنثی شوند." -msgid "*charset* keyword-only argument was added. The default charset of HTML document changed from ``'ISO-8859-1'`` to ``'utf-8'``." +msgid "" +"*charset* keyword-only argument was added. The default charset of HTML " +"document changed from ``'ISO-8859-1'`` to ``'utf-8'``." msgstr "" +"آرگومان فقط کلیدواژه‌ای *charset* اضافه شد. مجموعه‌نویسه پیش‌فرض سند HTML از " +"``'ISO-8859-1'`` به ``'utf-8'`` تغییر کرد." -msgid "Compares *fromlines* and *tolines* (lists of strings) and returns a string which is a complete HTML table showing line by line differences with inter-line and intra-line changes highlighted." +msgid "" +"Compares *fromlines* and *tolines* (lists of strings) and returns a string " +"which is a complete HTML table showing line by line differences with inter-" +"line and intra-line changes highlighted." msgstr "" +"*fromlines* و *tolines* (فهرست‌هایی از رشته‌ها) را مقایسه می‌کند و رشته‌ای را " +"برمی‌گرداند که یک جدول HTML کامل است و تفاوت‌های خط‌به‌خط را با تغییرات بین‌خطی " +"و درون‌خطی برجسته‌شده نشان می‌دهد." -msgid "The arguments for this method are the same as those for the :meth:`make_file` method." -msgstr "" +msgid "" +"The arguments for this method are the same as those for " +"the :meth:`make_file` method." +msgstr "آرگومان‌های این متد همان آرگومان‌های متد :meth:`make_file` هستند." -msgid "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` generating the delta lines) in context diff format." +msgid "" +"Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " +"generating the delta lines) in context diff format." msgstr "" +"*a* و *b* (فهرست‌هایی از رشته‌ها) را مقایسه می‌کند؛ دلتایی (یک :term:`تولیدگر " +"` که خط‌های دلتا را تولید می‌کند) را در قالب context diff " +"برمی‌گرداند." -msgid "Context diffs are a compact way of showing just the lines that have changed plus a few lines of context. The changes are shown in a before/after style. The number of context lines is set by *n* which defaults to three." +msgid "" +"Context diffs are a compact way of showing just the lines that have changed " +"plus a few lines of context. The changes are shown in a before/after " +"style. The number of context lines is set by *n* which defaults to three." msgstr "" +"دیف‌های زمینه‌ای (context diffs) روشی فشرده برای نمایش تنها خطوطی هستند که " +"تغییر کرده‌اند، به‌علاوه چند خط زمینه. تغییرها به سبک پیش/پس نمایش داده " +"می‌شوند. تعداد خطوط زمینه توسط *n* تنظیم می‌شود که مقدار پیش‌فرض آن ۳ است." -msgid "By default, the diff control lines (those with ``***`` or ``---``) are created with a trailing newline. This is helpful so that inputs created from :func:`io.IOBase.readlines` result in diffs that are suitable for use with :func:`io.IOBase.writelines` since both the inputs and outputs have trailing newlines." -msgstr "" +msgid "" +"By default, the diff control lines (those with ``***`` or ``---``) are " +"created with a trailing newline. This is helpful so that inputs created " +"from :func:`io.IOBase.readlines` result in diffs that are suitable for use " +"with :func:`io.IOBase.writelines` since both the inputs and outputs have " +"trailing newlines." +msgstr "" +"به‌طور پیش‌فرض، خطوط کنترلی تفاوت (diff) (آن‌هایی که ``***`` یا ``---`` دارند) " +"با یک نویسه‌ی خط جدید در انتها ایجاد می‌شوند. این موضوع مفید است تا ورودی‌های " +"ایجادشده از :func:`io.IOBase.readlines` به تفاوت‌هایی منجر شوند که برای " +"استفاده با :func:`io.IOBase.writelines` مناسب باشند، زیرا هم ورودی‌ها و هم " +"خروجی‌ها دارای نویسه‌ی خط جدید در انتها هستند." -msgid "For inputs that do not have trailing newlines, set the *lineterm* argument to ``\"\"`` so that the output will be uniformly newline free." +msgid "" +"For inputs that do not have trailing newlines, set the *lineterm* argument " +"to ``\"\"`` so that the output will be uniformly newline free." msgstr "" +"برای ورودی‌هایی که خط جدید پایانی ندارند، آرگومان *lineterm* را روی ``\"\"`` " +"تنظیم کنید تا خروجی به‌طور یکنواخت فاقد خط جدید باشد." -msgid "The context diff format normally has a header for filenames and modification times. Any or all of these may be specified using strings for *fromfile*, *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally expressed in the ISO 8601 format. If not specified, the strings default to blanks." -msgstr "" +msgid "" +"The context diff format normally has a header for filenames and " +"modification times. Any or all of these may be specified using strings for " +"*fromfile*, *tofile*, *fromfiledate*, and *tofiledate*. The modification " +"times are normally expressed in the ISO 8601 format. If not specified, the " +"strings default to blanks." +msgstr "" +"قالب diff زمینه‌ای (context diff) معمولاً دارای سرآیندی برای نام فایل‌ها و " +"زمان‌های تغییر است. هر یک یا همه‌ی این موارد را می‌توان با استفاده از رشته‌هایی " +"برای *fromfile*، *tofile*، *fromfiledate* و *tofiledate* مشخص کرد. زمان‌های " +"تغییر معمولاً در قالب ISO 8601 بیان می‌شوند. اگر مشخص نشوند، رشته‌ها به‌طور " +"پیش‌فرض خالی خواهند بود." msgid "See :ref:`difflib-interface` for a more detailed example." -msgstr "" +msgstr "برای مثالی با جزئیات بیشتر، :ref:`difflib-interface` را ببینید." -msgid "Return a list of the best \"good enough\" matches. *word* is a sequence for which close matches are desired (typically a string), and *possibilities* is a list of sequences against which to match *word* (typically a list of strings)." +msgid "" +"Return a list of the best \"good enough\" matches. *word* is a sequence " +"for which close matches are desired (typically a string), and " +"*possibilities* is a list of sequences against which to match *word* " +"(typically a list of strings)." msgstr "" +"فهرستی از بهترین تطابق‌های «به‌اندازه‌ی کافی خوب» را برمی‌گرداند. *word* " +"دنباله‌ای است که تطابق‌های نزدیک برای آن مطلوب است (معمولاً یک رشته)، و " +"*possibilities* فهرستی از دنباله‌هاست که *word* با آن‌ها تطبیق داده می‌شود " +"(معمولاً فهرستی از رشته‌ها)." -msgid "Optional argument *n* (default ``3``) is the maximum number of close matches to return; *n* must be greater than ``0``." +msgid "" +"Optional argument *n* (default ``3``) is the maximum number of close " +"matches to return; *n* must be greater than ``0``." msgstr "" +"آرگومان اختیاری *n* (پیش‌فرض ``3``) حداکثر تعداد تطابق‌های نزدیکی است که " +"بازگردانده می‌شود؛ *n* باید بزرگ‌تر از ``0`` باشد." -msgid "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. Possibilities that don't score at least that similar to *word* are ignored." +msgid "" +"Optional argument *cutoff* (default ``0.6``) is a float in the range [0, " +"1]. Possibilities that don't score at least that similar to *word* are " +"ignored." msgstr "" +"آرگومان اختیاری *cutoff* (پیش‌فرض ``0.6``) یک عدد اعشاری در بازه [۰، ۱] است. " +"گزینه‌هایی که امتیاز شباهت آن‌ها به *word* حداقل این میزان نباشد، نادیده " +"گرفته می‌شوند." -msgid "The best (no more than *n*) matches among the possibilities are returned in a list, sorted by similarity score, most similar first." +msgid "" +"The best (no more than *n*) matches among the possibilities are returned in " +"a list, sorted by similarity score, most similar first." msgstr "" +"بهترین تطابق‌ها (حداکثر *n* مورد) از میان گزینه‌های ممکن در یک فهرست " +"بازگردانده می‌شوند و بر اساس امتیاز شباهت مرتب شده‌اند، به طوری که مشابه‌ترین " +"مورد در ابتدا قرار دارد." -msgid "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style delta (a :term:`generator` generating the delta lines)." +msgid "" +"Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " +"delta (a :term:`generator` generating the delta lines)." msgstr "" +"*a* و *b* (فهرست‌هایی از رشته‌ها) را مقایسه می‌کند؛ یک دلتا به سبک :class:`Differ` را برمی‌گرداند (یک :term:`تولیدگر ` که خطوط دلتا را تولید می‌کند)." -msgid "Optional keyword parameters *linejunk* and *charjunk* are filtering functions (or ``None``):" +msgid "" +"Optional keyword parameters *linejunk* and *charjunk* are filtering " +"functions (or ``None``):" msgstr "" +"پارامترهای کلیدواژه‌ای اختیاری *linejunk* و *charjunk* توابع پالایشگر (یا " +"``None``) هستند:" -msgid "*linejunk*: A function that accepts a single string argument, and returns true if the string is junk, or false if not. The default is ``None``. There is also a module-level function :func:`IS_LINE_JUNK`, which filters out lines without visible characters, except for at most one hash character (``'#'``) -- however the underlying :class:`SequenceMatcher` class does a dynamic analysis of which lines are so frequent as to constitute noise, and this usually works better than using this function." -msgstr "" +msgid "" +"*linejunk*: A function that accepts a single string argument, and returns " +"true if the string is junk, or false if not. The default is ``None``. There " +"is also a module-level function :func:`IS_LINE_JUNK`, which filters out " +"lines without visible characters, except for at most one hash character " +"(``'#'``) -- however the underlying :class:`SequenceMatcher` class does a " +"dynamic analysis of which lines are so frequent as to constitute noise, and " +"this usually works better than using this function." +msgstr "" +"*linejunk*: تابعی که تنها یک آرگومان رشته‌ای را می‌پذیرد، و اگر رشته هرز باشد " +"مقدار درست، و در غیر این صورت مقدار نادرست را برمی‌گرداند. مقدار پیش‌فرض " +"``None`` است. همچنین یک تابع در سطح ماژول :func:`IS_LINE_JUNK` وجود دارد که " +"خطوطی را که نویسه‌های قابل مشاهده ندارند، به‌جز حداکثر یک نویسه هش (``'#'``)، " +"فیلتر می‌کند -- با این حال، کلاس زیربنایی :class:`SequenceMatcher` تحلیلی " +"پویا انجام می‌دهد تا مشخص کند کدام خطوط آن‌قدر پرتکرار هستند که نویز محسوب " +"می‌شوند، و این معمولاً بهتر از استفاده از این تابع عمل می‌کند." -msgid "*charjunk*: A function that accepts a character (a string of length 1), and returns if the character is junk, or false if not. The default is module-level function :func:`IS_CHARACTER_JUNK`, which filters out whitespace characters (a blank or tab; it's a bad idea to include newline in this!)." +msgid "" +"*charjunk*: A function that accepts a character (a string of length 1), and " +"returns if the character is junk, or false if not. The default is module-" +"level function :func:`IS_CHARACTER_JUNK`, which filters out whitespace " +"characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" +"*charjunk*: تابعی که یک نویسه (رشته‌ای به طول ۱) می‌پذیرد، و اگر نویسه هرز " +"(junk) باشد، مقداری برمی‌گرداند، و در غیر این صورت false برمی‌گرداند. مقدار " +"پیش‌فرض، تابع :func:`IS_CHARACTER_JUNK` در سطح ماژول است که نویسه‌های فضای " +"سفید (فاصله یا تب؛ کار بدی است که خط جدید را در آن بگنجانید!) را فیلتر " +"می‌کند." msgid "Return one of the two sequences that generated a delta." -msgstr "" +msgstr "یکی از دو دنباله‌ای را که دلتایی (delta) تولید کرده‌اند، برمی‌گرداند." -msgid "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, extract lines originating from file 1 or 2 (parameter *which*), stripping off line prefixes." +msgid "" +"Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " +"extract lines originating from file 1 or 2 (parameter *which*), stripping " +"off line prefixes." msgstr "" +"با داشتن یک *دنباله* تولیدشده توسط :meth:`Differ.compare` یا :func:`ndiff`، " +"خطوطی را که از فایل ۱ یا ۲ آمده‌اند (پارامتر *which*) استخراج کنید و " +"پیشوندهای خطوط را حذف کنید." msgid "Example:" -msgstr "" +msgstr "مثال:" -msgid "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` generating the delta lines) in unified diff format." +msgid "" +"Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " +"generating the delta lines) in unified diff format." msgstr "" +"*a* و *b* (فهرست‌هایی از رشته‌ها) را مقایسه می‌کند؛ یک دلتا (delta) " +"(یک :term:`تولیدگر ` که خط‌های دلتا را تولید می‌کند) را در قالب " +"unified diff بازمی‌گرداند." -msgid "Unified diffs are a compact way of showing just the lines that have changed plus a few lines of context. The changes are shown in an inline style (instead of separate before/after blocks). The number of context lines is set by *n* which defaults to three." +msgid "" +"Unified diffs are a compact way of showing just the lines that have changed " +"plus a few lines of context. The changes are shown in an inline style " +"(instead of separate before/after blocks). The number of context lines is " +"set by *n* which defaults to three." msgstr "" +"تفاوت‌های یکپارچه (unified diffs) روشی فشرده برای نمایش تنها خطوطی که تغییر " +"کرده‌اند به‌همراه چند خط زمینه هستند. تغییرات به‌صورت درون‌خطی نمایش داده " +"می‌شوند (به‌جای بلوک‌های جداگانه‌ی قبل/بعد). تعداد خطوط زمینه با *n* تنظیم می‌شود " +"که مقدار پیش‌فرض آن ۳ است." -msgid "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) are created with a trailing newline. This is helpful so that inputs created from :func:`io.IOBase.readlines` result in diffs that are suitable for use with :func:`io.IOBase.writelines` since both the inputs and outputs have trailing newlines." -msgstr "" +msgid "" +"By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " +"are created with a trailing newline. This is helpful so that inputs " +"created from :func:`io.IOBase.readlines` result in diffs that are suitable " +"for use with :func:`io.IOBase.writelines` since both the inputs and outputs " +"have trailing newlines." +msgstr "" +"به‌طور پیش‌فرض، خطوط کنترلی diff (آن‌هایی که دارای ``---``، ``+++`` یا ``@@`` " +"هستند) با یک خط جدید در پایان ایجاد می‌شوند. این موضوع مفید است تا ورودی‌هایی " +"که از :func:`io.IOBase.readlines` ایجاد شده‌اند، منجر به diffهایی شوند که " +"برای استفاده با :func:`io.IOBase.writelines` مناسب هستند، زیرا هم ورودی‌ها و " +"هم خروجی‌ها دارای خط جدید در پایان هستند." -msgid "The unified diff format normally has a header for filenames and modification times. Any or all of these may be specified using strings for *fromfile*, *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally expressed in the ISO 8601 format. If not specified, the strings default to blanks." -msgstr "" +msgid "" +"The unified diff format normally has a header for filenames and " +"modification times. Any or all of these may be specified using strings for " +"*fromfile*, *tofile*, *fromfiledate*, and *tofiledate*. The modification " +"times are normally expressed in the ISO 8601 format. If not specified, the " +"strings default to blanks." +msgstr "" +"قالب unified diff معمولاً دارای سرآیندی برای نام فایل‌ها و زمان‌های تغییر است. " +"هرکدام یا همه‌ی این موارد را می‌توان با استفاده از رشته‌هایی برای *fromfile*، " +"*tofile*، *fromfiledate* و *tofiledate* مشخص کرد. زمان‌های تغییر معمولاً در " +"قالب ISO 8601 بیان می‌شوند. اگر مشخص نشوند، رشته‌ها به‌طور پیش‌فرض خالی خواهند " +"بود." -msgid "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must be a callable, typically either :func:`unified_diff` or :func:`context_diff`." +msgid "" +"Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a " +"sequence of delta lines (also bytes) in the format returned by *dfunc*. " +"*dfunc* must be a callable, typically either :func:`unified_diff` " +"or :func:`context_diff`." msgstr "" +"*a* و *b* (فهرست‌هایی از اشیای bytes) را با استفاده از *dfunc* مقایسه " +"می‌کند؛ دنباله‌ای از خط‌های دلتا (که آن‌ها نیز bytes هستند) را در قالبی که " +"*dfunc* برمی‌گرداند تولید می‌کند. *dfunc* باید یک شیء قابل فراخوانی باشد، " +"معمولاً یا :func:`unified_diff` یا :func:`context_diff`." -msgid "Allows you to compare data with unknown or inconsistent encoding. All inputs except *n* must be bytes objects, not str. Works by losslessly converting all inputs (except *n*) to str, and calling ``dfunc(a, b, fromfile, tofile, fromfiledate, tofiledate, n, lineterm)``. The output of *dfunc* is then converted back to bytes, so the delta lines that you receive have the same unknown/inconsistent encodings as *a* and *b*." -msgstr "" +msgid "" +"Allows you to compare data with unknown or inconsistent encoding. All " +"inputs except *n* must be bytes objects, not str. Works by losslessly " +"converting all inputs (except *n*) to str, and calling ``dfunc(a, b, " +"fromfile, tofile, fromfiledate, tofiledate, n, lineterm)``. The output of " +"*dfunc* is then converted back to bytes, so the delta lines that you " +"receive have the same unknown/inconsistent encodings as *a* and *b*." +msgstr "" +"به شما امکان می‌دهد داده‌هایی با کدگذاری ناشناخته یا ناهماهنگ را مقایسه کنید. " +"همه‌ی ورودی‌ها به‌جز *n* باید اشیای bytes باشند، نه str. با تبدیل بدون اتلاف " +"همه‌ی ورودی‌ها (به‌جز *n*) به str و فراخوانی ``dfunc(a, b, fromfile, tofile, " +"fromfiledate, tofiledate, n, lineterm)`` کار می‌کند. سپس خروجی *dfunc* " +"دوباره به bytes تبدیل می‌شود، بنابراین خطوط دلتایی که دریافت می‌کنید، همان " +"کدگذاری‌های ناشناخته/ناهماهنگ *a* و *b* را دارند." msgid "Junk definition functions" -msgstr "" +msgstr "توابع تعریف زباله" -msgid "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* is blank or contains a single ``'#'``, otherwise it is not ignorable. Used as a default for parameter *linejunk* in :func:`ndiff` in older versions." +msgid "" +"Return ``True`` for ignorable lines. The line *line* is ignorable if " +"*line* is blank or contains a single ``'#'``, otherwise it is not " +"ignorable. Used as a default for parameter *linejunk* in :func:`ndiff` in " +"older versions." msgstr "" +"برای خطوط قابل‌چشم‌پوشی ``True`` برمی‌گرداند. خط *line* قابل‌چشم‌پوشی است اگر " +"*line* خالی باشد یا شامل یک ``'#'`` باشد، در غیر این صورت قابل‌چشم‌پوشی نیست. " +"در نسخه‌های قدیمی‌تر به‌عنوان پیش‌فرض پارامتر *linejunk* در :func:`ndiff` " +"استفاده می‌شد." -msgid "Return ``True`` for ignorable characters. The character *ch* is ignorable if *ch* is a space or tab, otherwise it is not ignorable. Used as a default for parameter *charjunk* in :func:`ndiff`." +msgid "" +"Return ``True`` for ignorable characters. The character *ch* is ignorable " +"if *ch* is a space or tab, otherwise it is not ignorable. Used as a " +"default for parameter *charjunk* in :func:`ndiff`." msgstr "" +"``True`` را برای نویسه‌های قابل چشم‌پوشی برمی‌گرداند. نویسه *ch* در صورتی قابل " +"چشم‌پوشی است که *ch* فاصله یا تب باشد، در غیر این صورت قابل چشم‌پوشی نیست. " +"به‌عنوان پیش‌فرض برای پارامتر *charjunk* در :func:`ndiff` استفاده می‌شود." msgid "SequenceMatcher objects" -msgstr "" +msgstr "اشیای SequenceMatcher" -msgid "Optional argument *isjunk* must be ``None`` (the default) or a one-argument function that takes a sequence element and returns true if and only if the element is \"junk\" and should be ignored. Passing ``None`` for *isjunk* is equivalent to passing ``lambda x: False``; in other words, no elements are ignored. For example, pass::" -msgstr "" +msgid "" +"Optional argument *isjunk* must be ``None`` (the default) or a one-argument " +"function that takes a sequence element and returns true if and only if the " +"element is \"junk\" and should be ignored. Passing ``None`` for *isjunk* is " +"equivalent to passing ``lambda x: False``; in other words, no elements are " +"ignored. For example, pass::" +msgstr "" +"آرگومان اختیاری *isjunk* باید ``None`` (پیش‌فرض) یا تابعی با یک آرگومان باشد " +"که عنصری از یک دنباله را می‌گیرد و اگر و تنها اگر آن عنصر «زائد» باشد و باید " +"نادیده گرفته شود، مقدار درست برمی‌گرداند. پاس دادن ``None`` برای *isjunk* " +"معادل پاس دادن ``lambda x: False`` است؛ به عبارت دیگر، هیچ عنصری نادیده " +"گرفته نمی‌شود. برای مثال، این را پاس دهید::" msgid "lambda x: x in \" \\t\"" -msgstr "" +msgstr "lambda x: x in \" \\t\"" -msgid "if you're comparing lines as sequences of characters, and don't want to synch up on blanks or hard tabs." +msgid "" +"if you're comparing lines as sequences of characters, and don't want to " +"synch up on blanks or hard tabs." msgstr "" +"اگر خطوط را به‌عنوان دنباله‌هایی از نویسه‌ها مقایسه می‌کنید و نمی‌خواهید بر اساس " +"فاصله‌ها یا تب‌های سخت همگام‌سازی کنید." -msgid "The optional arguments *a* and *b* are sequences to be compared; both default to empty strings. The elements of both sequences must be :term:`hashable`." +msgid "" +"The optional arguments *a* and *b* are sequences to be compared; both " +"default to empty strings. The elements of both sequences must " +"be :term:`hashable`." msgstr "" +"آرگومان‌های اختیاری *a* و *b* دنباله‌هایی هستند که با هم مقایسه می‌شوند؛ مقدار " +"پیش‌فرض هر دو، رشته‌های خالی است. عناصر هر دو دنباله باید :term:`hashable` " +"باشند." -msgid "The optional argument *autojunk* can be used to disable the automatic junk heuristic." +msgid "" +"The optional argument *autojunk* can be used to disable the automatic junk " +"heuristic." msgstr "" +"می‌توانید از آرگومان اختیاری *autojunk* برای غیرفعال کردن هیوریستیک خودکار " +"هرز استفاده کنید." msgid "Added the *autojunk* parameter." -msgstr "" +msgstr "پارامتر *autojunk* اضافه شد." -msgid "SequenceMatcher objects get three data attributes: *bjunk* is the set of elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-junk elements considered popular by the heuristic (if it is not disabled); *b2j* is a dict mapping the remaining elements of *b* to a list of positions where they occur. All three are reset whenever *b* is reset with :meth:`set_seqs` or :meth:`set_seq2`." -msgstr "" +msgid "" +"SequenceMatcher objects get three data attributes: *bjunk* is the set of " +"elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of " +"non-junk elements considered popular by the heuristic (if it is not " +"disabled); *b2j* is a dict mapping the remaining elements of *b* to a list " +"of positions where they occur. All three are reset whenever *b* is reset " +"with :meth:`set_seqs` or :meth:`set_seq2`." +msgstr "" +"اشیای SequenceMatcher سه ویژگی داده دارند: *bjunk* مجموعه‌ای از عناصر *b* " +"است که *isjunk* برای آن‌ها ``True`` است؛ *bpopular* مجموعه‌ای از عناصر " +"غیرزائد است که توسط اکتشافی، محبوب در نظر گرفته می‌شوند (اگر غیرفعال نشده " +"باشد)؛ *b2j* دیکشنری است که عناصر باقی‌مانده‌ی *b* را به فهرستی از موقعیت‌هایی " +"که در آن‌ها ظاهر می‌شوند نگاشت می‌کند. هر سه هر زمان که *b* " +"با :meth:`set_seqs` یا :meth:`set_seq2` بازنشانی شود، بازنشانی می‌شوند." msgid "The *bjunk* and *bpopular* attributes." -msgstr "" +msgstr "ویژگی‌های *bjunk* و *bpopular*." msgid ":class:`SequenceMatcher` objects have the following methods:" -msgstr "" +msgstr "اشیای :class:`SequenceMatcher` متدهای زیر را دارند:" msgid "Set the two sequences to be compared." -msgstr "" +msgstr "دو دنباله را برای مقایسه تنظیم می‌کند." -msgid ":class:`SequenceMatcher` computes and caches detailed information about the second sequence, so if you want to compare one sequence against many sequences, use :meth:`set_seq2` to set the commonly used sequence once and call :meth:`set_seq1` repeatedly, once for each of the other sequences." +msgid "" +":class:`SequenceMatcher` computes and caches detailed information about the " +"second sequence, so if you want to compare one sequence against many " +"sequences, use :meth:`set_seq2` to set the commonly used sequence once and " +"call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" +":class:`SequenceMatcher` جزئیات مربوط به دنباله دوم را محاسبه و در نهانگاه " +"ذخیره می‌کند، بنابراین اگر می‌خواهید یک دنباله را با چندین دنباله مقایسه " +"کنید، از :meth:`set_seq2` استفاده کنید تا دنباله‌ی پرکاربرد را یک بار تنظیم " +"کنید و :meth:`set_seq1` را به‌طور مکرر، یک بار برای هر یک از دنباله‌های دیگر، " +"فراخوانی کنید." -msgid "Set the first sequence to be compared. The second sequence to be compared is not changed." +msgid "" +"Set the first sequence to be compared. The second sequence to be compared " +"is not changed." msgstr "" +"نخستین دنباله‌ی مورد مقایسه را تنظیم کنید. دومین دنباله‌ی مورد مقایسه تغییر " +"نمی‌کند." -msgid "Set the second sequence to be compared. The first sequence to be compared is not changed." +msgid "" +"Set the second sequence to be compared. The first sequence to be compared " +"is not changed." msgstr "" +"دومین دنباله‌ی مورد مقایسه را تنظیم کنید. اولین دنباله‌ی مورد مقایسه تغییر " +"نمی‌کند." msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." -msgstr "" +msgstr "طولانی‌ترین بلوک منطبق را در ``a[alo:ahi]`` و ``b[blo:bhi]`` بیابید." -msgid "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns ``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo <= i <= i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', k')`` meeting those conditions, the additional conditions ``k >= k'``, ``i <= i'``, and if ``i == i'``, ``j <= j'`` are also met. In other words, of all maximal matching blocks, return one that starts earliest in *a*, and of all those maximal matching blocks that start earliest in *a*, return the one that starts earliest in *b*." -msgstr "" +msgid "" +"If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " +"``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " +"<= i <= i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', " +"k')`` meeting those conditions, the additional conditions ``k >= k'``, ``i " +"<= i'``, and if ``i == i'``, ``j <= j'`` are also met. In other words, of " +"all maximal matching blocks, return one that starts earliest in *a*, and of " +"all those maximal matching blocks that start earliest in *a*, return the " +"one that starts earliest in *b*." +msgstr "" +"اگر *isjunk* حذف شده باشد یا ``None`` باشد، :meth:`find_longest_match` " +"``(i, j, k)`` را برمی‌گرداند به‌طوری که ``a[i:i+k]`` برابر با ``b[j:j+k]`` " +"است، که در آن ``alo <= i <= i+k <= ahi`` و ``blo <= j <= j+k <= bhi``. برای " +"همه‌ی ``(i', j', k')`` که این شرایط را دارند، شرایط اضافی ``k >= k'``، ``i " +"<= i'`` و اگر ``i == i'``، ``j <= j'`` نیز برقرار هستند. به عبارت دیگر، از " +"میان همه‌ی بلوک‌های منطبق بیشینه، یکی را برمی‌گرداند که زودترین شروع را در *a* " +"دارد، و از میان همه‌ی آن بلوک‌های منطبق بیشینه که زودترین شروع را در *a* " +"دارند، آن را برمی‌گرداند که زودترین شروع را در *b* دارد." -msgid "If *isjunk* was provided, first the longest matching block is determined as above, but with the additional restriction that no junk element appears in the block. Then that block is extended as far as possible by matching (only) junk elements on both sides. So the resulting block never matches on junk except as identical junk happens to be adjacent to an interesting match." -msgstr "" +msgid "" +"If *isjunk* was provided, first the longest matching block is determined as " +"above, but with the additional restriction that no junk element appears in " +"the block. Then that block is extended as far as possible by matching " +"(only) junk elements on both sides. So the resulting block never matches on " +"junk except as identical junk happens to be adjacent to an interesting " +"match." +msgstr "" +"اگر *isjunk* ارائه شده باشد، ابتدا طولانی‌ترین بلوک منطبق همان‌گونه که در " +"بالا توضیح داده شد تعیین می‌شود، اما با این محدودیت اضافی که هیچ عنصر هرز " +"(junk) در بلوک وجود نداشته باشد. سپس آن بلوک تا حد ممکن با تطبیق (فقط) " +"عناصر هرز در هر دو طرف گسترش می‌یابد. بنابراین بلوک حاصل هرگز بر عناصر هرز " +"منطبق نمی‌شود، مگر آنکه عناصر هرز یکسان به‌طور تصادفی مجاور یک تطبیق معنادار " +"باشند." -msgid "Here's the same example as before, but considering blanks to be junk. That prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the second sequence directly. Instead only the ``'abcd'`` can match, and matches the leftmost ``'abcd'`` in the second sequence:" +msgid "" +"Here's the same example as before, but considering blanks to be junk. That " +"prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " +"second sequence directly. Instead only the ``'abcd'`` can match, and " +"matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" +"این همان مثال پیشین است، اما فاصله‌ها را هرز (junk) در نظر می‌گیریم. این امر " +"مانع از آن می‌شود که ``' abcd'`` مستقیماً با ``' abcd'`` در انتهای دنباله دوم " +"تطابق داشته باشد. در عوض، تنها ``'abcd'`` می‌تواند تطابق داشته باشد و با " +"چپ‌ترین ``'abcd'`` در دنباله دوم مطابقت دارد:" msgid "If no blocks match, this returns ``(alo, blo, 0)``." -msgstr "" +msgstr "اگر هیچ بلوکی مطابقت نداشته باشد، ``(alo, blo, 0)`` برگردانده می‌شود." msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" +"این متد یک :term:`named tuple` با قالب ``Match(a, b, size)`` برمی‌گرداند." msgid "Added default arguments." -msgstr "" +msgstr "آرگومان‌های پیش‌فرض اضافه شد." -msgid "Return list of triples describing non-overlapping matching subsequences. Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j+n]``. The triples are monotonically increasing in *i* and *j*." +msgid "" +"Return list of triples describing non-overlapping matching subsequences. " +"Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == " +"b[j:j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" +"فهرستی از سه‌تایی‌ها را برمی‌گرداند که زیردنباله‌های منطبق غیرهمپوشان را توصیف " +"می‌کنند. هر سه‌تایی به شکل ``(i, j, n)`` است و به این معناست که ``a[i:i+n] == " +"b[j:j+n]``. سه‌تایی‌ها از نظر *i* و *j* به‌طور یکنواخت صعودی هستند." -msgid "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` are adjacent triples in the list, and the second is not the last triple in the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent triples always describe non-adjacent equal blocks." -msgstr "" +msgid "" +"The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " +"is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " +"are adjacent triples in the list, and the second is not the last triple in " +"the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent " +"triples always describe non-adjacent equal blocks." +msgstr "" +"آخرین سه‌تایی ساختگی است و مقدار ``(len(a), len(b), 0)`` را دارد. این تنها " +"سه‌تایی با ``n == 0`` است. اگر ``(i, j, n)`` و ``(i', j', n')`` سه‌تایی‌های " +"مجاور در فهرست باشند و دومی آخرین سه‌تایی در فهرست نباشد، آنگاه ``i+n < i'`` " +"یا ``j+n < j'`` برقرار است؛ به عبارت دیگر، سه‌تایی‌های مجاور همیشه بلوک‌های " +"برابرِ غیرمجاور را توصیف می‌کنند." msgid "" ">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" ">>> s.get_matching_blocks()\n" "[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" msgstr "" +">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" +">>> s.get_matching_blocks()\n" +"[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" -msgid "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == 0``, and remaining tuples have *i1* equal to the *i2* from the preceding tuple, and, likewise, *j1* equal to the previous *j2*." +msgid "" +"Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " +"of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " +"0``, and remaining tuples have *i1* equal to the *i2* from the preceding " +"tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" +"فهرستی از ۵-تایی‌ها برمی‌گرداند که چگونگی تبدیل *a* به *b* را توصیف می‌کنند. " +"هر ۵-تایی به شکل ``(tag, i1, i2, j1, j2)`` است. در اولین ۵-تایی، ``i1 == j1 " +"== 0`` است، و در ۵-تایی‌های باقی‌مانده، *i1* برابر با *i2* از ۵-تایی پیشین " +"است، و به همین ترتیب، *j1* برابر با *j2* پیشین است." msgid "The *tag* values are strings, with these meanings:" -msgstr "" +msgstr "مقادیر *tag* رشته‌هایی با این معانی هستند:" msgid "Value" -msgstr "" +msgstr "مقدار" msgid "``'replace'``" -msgstr "" +msgstr "``'replace'``" msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." -msgstr "" +msgstr "``a[i1:i2]`` باید با ``b[j1:j2]`` جایگزین شود." msgid "``'delete'``" -msgstr "" +msgstr "``'delete'``" msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" +"``a[i1:i2]`` باید حذف شود. توجه داشته باشید که در این حالت ``j1 == j2``." msgid "``'insert'``" -msgstr "" +msgstr "``'insert'``" -msgid "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in this case." +msgid "" +"``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " +"this case." msgstr "" +"``b[j1:j2]`` باید در ``a[i1:i1]`` درج شود. توجه داشته باشید که در این حالت " +"``i1 == i2`` است." msgid "``'equal'``" -msgstr "" +msgstr "``'equal'``" msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." -msgstr "" +msgstr "``a[i1:i2] == b[j1:j2]`` (زیردنباله‌ها برابر هستند)." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> a = \"qabxcd\"\n" @@ -393,90 +914,192 @@ msgid "" "equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" "insert a[6:6] --> b[5:6] '' --> 'f'" msgstr "" +">>> a = \"qabxcd\"\n" +">>> b = \"abycdf\"\n" +">>> s = SequenceMatcher(None, a, b)\n" +">>> for tag, i1, i2, j1, j2 in s.get_opcodes():\n" +"... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(\n" +"... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n" +"delete a[0:1] --> b[0:0] 'q' --> ''\n" +"equal a[1:3] --> b[0:2] 'ab' --> 'ab'\n" +"replace a[3:4] --> b[2:3] 'x' --> 'y'\n" +"equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" +"insert a[6:6] --> b[5:6] '' --> 'f'" msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" +"یک :term:`تولیدگر ` از گروه‌هایی با حداکثر *n* خط از زمینه " +"برمی‌گرداند." -msgid "Starting with the groups returned by :meth:`get_opcodes`, this method splits out smaller change clusters and eliminates intervening ranges which have no changes." +msgid "" +"Starting with the groups returned by :meth:`get_opcodes`, this method " +"splits out smaller change clusters and eliminates intervening ranges which " +"have no changes." msgstr "" +"این متد با شروع از گروه‌های برگردانده‌شده توسط :meth:`get_opcodes`، خوشه‌های " +"تغییر کوچک‌تر را جدا می‌کند و بازه‌های میانی را که تغییری ندارند حذف می‌کند." msgid "The groups are returned in the same format as :meth:`get_opcodes`." -msgstr "" +msgstr "گروه‌ها در همان قالب :meth:`get_opcodes` برگردانده می‌شوند." -msgid "Return a measure of the sequences' similarity as a float in the range [0, 1]." +msgid "" +"Return a measure of the sequences' similarity as a float in the range [0, " +"1]." msgstr "" +"معیاری از شباهت دنباله‌ها را به‌صورت یک عدد اعشاری در بازه‌ی [۰، ۱] برمی‌گرداند." -msgid "Where T is the total number of elements in both sequences, and M is the number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the sequences are identical, and ``0.0`` if they have nothing in common." +msgid "" +"Where T is the total number of elements in both sequences, and M is the " +"number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " +"sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" +"اگر T تعداد کل عناصر هر دو دنباله و M تعداد تطابق‌ها باشد، این مقدار برابر " +"با 2.0\\*M / T است. توجه داشته باشید که اگر دنباله‌ها یکسان باشند، این مقدار " +"``1.0`` است و اگر هیچ اشتراکی نداشته باشند، ``0.0`` است." -msgid "This is expensive to compute if :meth:`get_matching_blocks` or :meth:`get_opcodes` hasn't already been called, in which case you may want to try :meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." +msgid "" +"This is expensive to compute if :meth:`get_matching_blocks` " +"or :meth:`get_opcodes` hasn't already been called, in which case you may " +"want to try :meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an " +"upper bound." msgstr "" +"محاسبه‌ی این مقدار در صورتی پرهزینه است که :meth:`get_matching_blocks` " +"یا :meth:`get_opcodes` از قبل فراخوانی نشده باشند؛ در این صورت ممکن است " +"بخواهید ابتدا :meth:`quick_ratio` یا :meth:`real_quick_ratio` را امتحان " +"کنید تا کران بالایی به دست آورید." msgid "Return an upper bound on :meth:`ratio` relatively quickly." -msgstr "" +msgstr "یک کران بالا برای :meth:`ratio` نسبتاً سریع برمی‌گرداند." msgid "Return an upper bound on :meth:`ratio` very quickly." -msgstr "" +msgstr "یک کران بالا برای :meth:`ratio` را بسیار سریع برمی‌گرداند." -msgid "The three methods that return the ratio of matching to total characters can give different results due to differing levels of approximation, although :meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher.real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher.ratio`:" -msgstr "" +msgid "" +"The three methods that return the ratio of matching to total characters can " +"give different results due to differing levels of approximation, " +"although :meth:`~SequenceMatcher.quick_ratio` " +"and :meth:`~SequenceMatcher.real_quick_ratio` are always at least as large " +"as :meth:`~SequenceMatcher.ratio`:" +msgstr "" +"سه متدی که نسبت نویسه‌های منطبق به کل نویسه‌ها را برمی‌گردانند، می‌توانند به " +"دلیل سطوح متفاوت تقریب، نتایج متفاوتی داشته باشند، " +"اگرچه :meth:`~SequenceMatcher.quick_ratio` " +"و :meth:`~SequenceMatcher.real_quick_ratio` همواره دست‌کم به " +"بزرگی :meth:`~SequenceMatcher.ratio` هستند:" msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "SequenceMatcher examples" -msgstr "" +msgstr "مثال‌های SequenceMatcher" msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" +"این مثال دو رشته را با در نظر گرفتن فاصله‌ها به‌عنوان «زائد» مقایسه می‌کند:" -msgid ":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher.ratio` value over 0.6 means the sequences are close matches:" +msgid "" +":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " +"similarity of the sequences. As a rule of thumb, " +"a :meth:`~SequenceMatcher.ratio` value over 0.6 means the sequences are " +"close matches:" msgstr "" +":meth:`~SequenceMatcher.ratio` یک عدد اعشاری در بازه‌ی [۰، ۱] برمی‌گرداند که " +"شباهت دنباله‌ها را می‌سنجد. به‌عنوان یک قاعده سرانگشتی، " +"مقدار :meth:`~SequenceMatcher.ratio` بیش از ۰٫۶ به این معناست که دنباله‌ها " +"تطابق‌های نزدیکی هستند:" -msgid "If you're only interested in where the sequences match, :meth:`~SequenceMatcher.get_matching_blocks` is handy:" +msgid "" +"If you're only interested in where the sequences " +"match, :meth:`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" +"اگر فقط به محل تطابق دنباله‌ها علاقه‌مند " +"هستید، :meth:`~SequenceMatcher.get_matching_blocks` مفید است:" -msgid "Note that the last tuple returned by :meth:`~SequenceMatcher.get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last tuple element (number of elements matched) is ``0``." +msgid "" +"Note that the last tuple returned " +"by :meth:`~SequenceMatcher.get_matching_blocks` is always a dummy, " +"``(len(a), len(b), 0)``, and this is the only case in which the last tuple " +"element (number of elements matched) is ``0``." msgstr "" +"توجه داشته باشید که آخرین چندگانه‌ای " +"که :meth:`~SequenceMatcher.get_matching_blocks` برمی‌گرداند همیشه یک چندگانه " +"ساختگی، ``(len(a), len(b), 0)``، است و این تنها حالتی است که آخرین عنصر " +"چندگانه (تعداد عناصر مطابقت‌داده‌شده) برابر ``0`` است." -msgid "If you want to know how to change the first sequence into the second, use :meth:`~SequenceMatcher.get_opcodes`:" +msgid "" +"If you want to know how to change the first sequence into the second, " +"use :meth:`~SequenceMatcher.get_opcodes`:" msgstr "" +"اگر می‌خواهید بدانید چگونه دنباله اول را به دنباله دوم تبدیل کنید، " +"از :meth:`~SequenceMatcher.get_opcodes` استفاده کنید:" -msgid "The :func:`get_close_matches` function in this module which shows how simple code building on :class:`SequenceMatcher` can be used to do useful work." +msgid "" +"The :func:`get_close_matches` function in this module which shows how " +"simple code building on :class:`SequenceMatcher` can be used to do useful " +"work." msgstr "" +"تابع :func:`get_close_matches` در این ماژول که نشان می‌دهد چگونه کد ساده‌ای " +"که بر پایه‌ی :class:`SequenceMatcher` ساخته شده است، می‌تواند برای انجام کار " +"مفید استفاده شود." -msgid "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." +msgid "" +"`Simple version control recipe `_ for a small application built " +"with :class:`SequenceMatcher`." msgstr "" +"`دستور ساده‌ی کنترل نسخه `_ برای یک برنامه‌ی کوچک ساخته‌شده " +"با :class:`SequenceMatcher`." msgid "Differ example" -msgstr "" +msgstr "مثال Differ" -msgid "This example compares two texts. First we set up the texts, sequences of individual single-line strings ending with newlines (such sequences can also be obtained from the :meth:`~io.IOBase.readlines` method of file-like objects):" +msgid "" +"This example compares two texts. First we set up the texts, sequences of " +"individual single-line strings ending with newlines (such sequences can " +"also be obtained from the :meth:`~io.IOBase.readlines` method of file-like " +"objects):" msgstr "" +"این مثال دو متن را مقایسه می‌کند. ابتدا متن‌ها را آماده می‌کنیم، دنباله‌هایی از " +"رشته‌های تک‌خطی جداگانه که با خط جدید پایان می‌یابند (چنین دنباله‌هایی را " +"همچنین می‌توان از متد :meth:`~io.IOBase.readlines` اشیای شبه‌فایل به دست " +"آورد):" msgid "Next we instantiate a Differ object:" -msgstr "" +msgstr "سپس یک شیء Differ را نمونه‌سازی می‌کنیم:" -msgid "Note that when instantiating a :class:`Differ` object we may pass functions to filter out line and character \"junk.\" See the :meth:`Differ` constructor for details." +msgid "" +"Note that when instantiating a :class:`Differ` object we may pass functions " +"to filter out line and character \"junk.\" See the :meth:`Differ` " +"constructor for details." msgstr "" +"توجه داشته باشید که هنگام نمونه‌سازی یک شیء :class:`Differ`، می‌توانید توابعی " +"را برای فیلتر کردن «اضافات» خطی و نویسه‌ای ارسال کنید. برای جزئیات، " +"سازنده‌ی :meth:`Differ` را ببینید." msgid "Finally, we compare the two:" -msgstr "" +msgstr "در نهایت، این دو را با هم مقایسه می‌کنیم:" msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" +"``result`` یک فهرست از رشته‌ها است، بنابراین بیایید آن را زیبانویسی " +"کنیم (pretty-print):" msgid "As a single multi-line string it looks like this:" -msgstr "" +msgstr "به‌صورت یک رشته‌ی چندخطی واحد، به این شکل است:" msgid "A command-line interface to difflib" -msgstr "" +msgstr "یک رابط خط فرمان برای difflib" -msgid "This example shows how to use difflib to create a ``diff``-like utility." +msgid "" +"This example shows how to use difflib to create a ``diff``-like utility." msgstr "" +"این مثال نشان می‌دهد که چگونه از difflib برای ایجاد یک ابزار مشابه ``diff`` " +"استفاده کنید." msgid "" -"\"\"\" Command-line interface to difflib.py providing diffs in four formats:\n" +"\"\"\" Command-line interface to difflib.py providing diffs in four " +"formats:\n" "\n" "* ndiff: lists every line and highlights interline changes.\n" "* context: highlights clusters of changes in a before/after format.\n" @@ -523,25 +1146,91 @@ msgid "" " tolines = tf.readlines()\n" "\n" " if options.u:\n" -" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)\n" +" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" " elif options.n:\n" " diff = difflib.ndiff(fromlines, tolines)\n" " elif options.m:\n" -" diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile,tofile,context=options.c,numlines=n)\n" +" diff = " +"difflib.HtmlDiff().make_file(fromlines,tolines,fromfile,tofile,context=options.c,numlines=n)\n" " else:\n" -" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)\n" +" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" "\n" " sys.stdout.writelines(diff)\n" "\n" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"\"\"\" Command-line interface to difflib.py providing diffs in four " +"formats:\n" +"\n" +"* ndiff: lists every line and highlights interline changes.\n" +"* context: highlights clusters of changes in a before/after format.\n" +"* unified: highlights clusters of changes in an inline format.\n" +"* html: generates side by side comparison with change highlights.\n" +"\n" +"\"\"\"\n" +"\n" +"import sys, os, difflib, argparse\n" +"import datetime as dt\n" +"\n" +"def file_mtime(path):\n" +" t = dt.datetime.fromtimestamp(os.stat(path).st_mtime,\n" +" dt.timezone.utc)\n" +" return t.astimezone().isoformat()\n" +"\n" +"def main():\n" +"\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-c', action='store_true', default=False,\n" +" help='Produce a context format diff (default)')\n" +" parser.add_argument('-u', action='store_true', default=False,\n" +" help='Produce a unified format diff')\n" +" parser.add_argument('-m', action='store_true', default=False,\n" +" help='Produce HTML side by side diff '\n" +" '(can use -c and -l in conjunction)')\n" +" parser.add_argument('-n', action='store_true', default=False,\n" +" help='Produce a ndiff format diff')\n" +" parser.add_argument('-l', '--lines', type=int, default=3,\n" +" help='Set number of context lines (default 3)')\n" +" parser.add_argument('fromfile')\n" +" parser.add_argument('tofile')\n" +" options = parser.parse_args()\n" +"\n" +" n = options.lines\n" +" fromfile = options.fromfile\n" +" tofile = options.tofile\n" +"\n" +" fromdate = file_mtime(fromfile)\n" +" todate = file_mtime(tofile)\n" +" with open(fromfile) as ff:\n" +" fromlines = ff.readlines()\n" +" with open(tofile) as tf:\n" +" tolines = tf.readlines()\n" +"\n" +" if options.u:\n" +" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +" elif options.n:\n" +" diff = difflib.ndiff(fromlines, tolines)\n" +" elif options.m:\n" +" diff = " +"difflib.HtmlDiff().make_file(fromlines,tolines,fromfile,tofile,context=options.c,numlines=n)\n" +" else:\n" +" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +"\n" +" sys.stdout.writelines(diff)\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" msgid "ndiff example" -msgstr "" +msgstr "مثال ndiff" msgid "This example shows how to use :func:`difflib.ndiff`." -msgstr "" +msgstr "این مثال نشان می‌دهد که چگونه از :func:`difflib.ndiff` استفاده کنید." msgid "" "\"\"\"ndiff [-q] file1 file2\n" @@ -566,13 +1255,16 @@ msgid "" " \"? \" line not present in either input file\n" "\n" "Lines beginning with \"? \" attempt to guide the eye to intraline\n" -"differences, and were not present in either input file. These lines can be\n" +"differences, and were not present in either input file. These lines can " +"be\n" "confusing if the source files contain tab characters.\n" "\n" "The first file can be recovered by retaining only lines that begin with\n" -"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with -r1.\n" +"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with " +"-r1.\n" "\n" -"The second file can be recovered similarly, but by retaining only \" \" and\n" +"The second file can be recovered similarly, but by retaining only \" \" " +"and\n" "\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n" "recovered by piping the output through\n" "\n" @@ -656,3 +1348,117 @@ msgid "" "if __name__ == '__main__':\n" " main(sys.argv[1:])\n" msgstr "" +"\"\"\"ndiff [-q] file1 file2\n" +" or\n" +"ndiff (-r1 | -r2) < ndiff_output > file1_or_file2\n" +"\n" +"Print a human-friendly file difference report to stdout. Both inter-\n" +"and intra-line differences are noted. In the second form, recreate file1\n" +"(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.\n" +"\n" +"In the first form, if -q (\"quiet\") is not specified, the first two lines\n" +"of output are\n" +"\n" +"-: file1\n" +"+: file2\n" +"\n" +"Each remaining line begins with a two-letter code:\n" +"\n" +" \"- \" line unique to file1\n" +" \"+ \" line unique to file2\n" +" \" \" line common to both files\n" +" \"? \" line not present in either input file\n" +"\n" +"Lines beginning with \"? \" attempt to guide the eye to intraline\n" +"differences, and were not present in either input file. These lines can " +"be\n" +"confusing if the source files contain tab characters.\n" +"\n" +"The first file can be recovered by retaining only lines that begin with\n" +"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with " +"-r1.\n" +"\n" +"The second file can be recovered similarly, but by retaining only \" \" " +"and\n" +"\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n" +"recovered by piping the output through\n" +"\n" +" sed -n '/^[+ ] /s/^..//p'\n" +"\"\"\"\n" +"\n" +"__version__ = 1, 7, 0\n" +"\n" +"import difflib, sys\n" +"\n" +"def fail(msg):\n" +" out = sys.stderr.write\n" +" out(msg + \"\\n\\n\")\n" +" out(__doc__)\n" +" return 0\n" +"\n" +"# open a file & return the file object; gripe and return 0 if it\n" +"# couldn't be opened\n" +"def fopen(fname):\n" +" try:\n" +" return open(fname)\n" +" except IOError as detail:\n" +" return fail(\"couldn't open \" + fname + \": \" + str(detail))\n" +"\n" +"# open two files & spray the diff to stdout; return false iff a problem\n" +"def fcompare(f1name, f2name):\n" +" f1 = fopen(f1name)\n" +" f2 = fopen(f2name)\n" +" if not f1 or not f2:\n" +" return 0\n" +"\n" +" a = f1.readlines(); f1.close()\n" +" b = f2.readlines(); f2.close()\n" +" for line in difflib.ndiff(a, b):\n" +" print(line, end=' ')\n" +"\n" +" return 1\n" +"\n" +"# crack args (sys.argv[1:] is normal) & compare;\n" +"# return false iff a problem\n" +"\n" +"def main(args):\n" +" import getopt\n" +" try:\n" +" opts, args = getopt.getopt(args, \"qr:\")\n" +" except getopt.error as detail:\n" +" return fail(str(detail))\n" +" noisy = 1\n" +" qseen = rseen = 0\n" +" for opt, val in opts:\n" +" if opt == \"-q\":\n" +" qseen = 1\n" +" noisy = 0\n" +" elif opt == \"-r\":\n" +" rseen = 1\n" +" whichfile = val\n" +" if qseen and rseen:\n" +" return fail(\"can't specify both -q and -r\")\n" +" if rseen:\n" +" if args:\n" +" return fail(\"no args allowed with -r option\")\n" +" if whichfile in (\"1\", \"2\"):\n" +" restore(whichfile)\n" +" return 1\n" +" return fail(\"-r value must be 1 or 2\")\n" +" if len(args) != 2:\n" +" return fail(\"need 2 filename args\")\n" +" f1name, f2name = args\n" +" if noisy:\n" +" print('-:', f1name)\n" +" print('+:', f2name)\n" +" return fcompare(f1name, f2name)\n" +"\n" +"# read ndiff output from stdin, and print file1 (which=='1') or\n" +"# file2 (which=='2') to stdout\n" +"\n" +"def restore(which):\n" +" restored = difflib.restore(sys.stdin.readlines(), which)\n" +" sys.stdout.writelines(restored)\n" +"\n" +"if __name__ == '__main__':\n" +" main(sys.argv[1:])\n" diff --git a/library/dis.po b/library/dis.po index 6b67719f9..50de0ceff 100644 --- a/library/dis.po +++ b/library/dis.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"PO-Revision-Date: 2026-08-28 11:27+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,53 +22,116 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!dis` --- Disassembler for Python bytecode" -msgstr "" +msgstr ":mod:`!dis` --- واساز برای بایت‌کد پایتون" msgid "**Source code:** :source:`Lib/dis.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/dis.py`" -msgid "The :mod:`!dis` module supports the analysis of CPython :term:`bytecode` by disassembling it. The CPython bytecode which this module takes as an input is defined in the file :file:`Include/opcode.h` and used by the compiler and the interpreter." +msgid "" +"The :mod:`!dis` module supports the analysis of CPython :term:`bytecode` by " +"disassembling it. The CPython bytecode which this module takes as an input is " +"defined in the file :file:`Include/opcode.h` and used by the compiler and the " +"interpreter." msgstr "" +"ماژول :mod:`!dis` از تحلیل :term:`بایت‌کد ` CPython با واسازی کردن " +"آن پشتیبانی می‌کند. بایت‌کد CPython که این ماژول آن را به‌عنوان ورودی دریافت " +"می‌کند، در فایل :file:`Include/opcode.h` تعریف شده است و توسط کامپایلر و مفسر " +"استفاده می‌شود." -msgid "Bytecode is an implementation detail of the CPython interpreter. No guarantees are made that bytecode will not be added, removed, or changed between versions of Python. Use of this module should not be considered to work across Python VMs or Python releases." +msgid "" +"Bytecode is an implementation detail of the CPython interpreter. No " +"guarantees are made that bytecode will not be added, removed, or changed " +"between versions of Python. Use of this module should not be considered to " +"work across Python VMs or Python releases." msgstr "" +"بایت‌کد یکی از جزئیات پیاده‌سازی مفسر CPython است. هیچ تضمینی داده نمی‌شود که " +"بایت‌کد بین نسخه‌های پایتون اضافه، حذف یا تغییر داده نشود. نباید فرض شود که " +"استفاده از این ماژول در میان ماشین‌های مجازی پایتون یا نسخه‌های منتشرشده پایتون " +"کار می‌کند." -msgid "Use 2 bytes for each instruction. Previously the number of bytes varied by instruction." +msgid "" +"Use 2 bytes for each instruction. Previously the number of bytes varied by " +"instruction." msgstr "" +"برای هر دستور از ۲ بایت استفاده می‌شود. پیش از این، تعداد بایت‌ها بسته به دستور " +"متفاوت بود." -msgid "The argument of jump, exception handling and loop instructions is now the instruction offset rather than the byte offset." +msgid "" +"The argument of jump, exception handling and loop instructions is now the " +"instruction offset rather than the byte offset." msgstr "" +"آرگومان دستورالعمل‌های پرش، مدیریت استثنا و حلقه اکنون به‌جای آفست بایت، آفست " +"دستورالعمل است." -msgid "Some instructions are accompanied by one or more inline cache entries, which take the form of :opcode:`CACHE` instructions. These instructions are hidden by default, but can be shown by passing ``show_caches=True`` to any :mod:`!dis` utility. Furthermore, the interpreter now adapts the bytecode to specialize it for different runtime conditions. The adaptive bytecode can be shown by passing ``adaptive=True``." -msgstr "" +msgid "" +"Some instructions are accompanied by one or more inline cache entries, which " +"take the form of :opcode:`CACHE` instructions. These instructions are hidden " +"by default, but can be shown by passing ``show_caches=True`` to any :mod:`!" +"dis` utility. Furthermore, the interpreter now adapts the bytecode to " +"specialize it for different runtime conditions. The adaptive bytecode can be " +"shown by passing ``adaptive=True``." +msgstr "" +"برخی دستورالعمل‌ها همراه با یک یا چند ورودی نهانگاه درون‌خطی هستند که در قالب " +"دستورالعمل‌های :opcode:`CACHE` ظاهر می‌شوند. این دستورالعمل‌ها به‌طور پیش‌فرض " +"پنهان هستند، اما می‌توان آن‌ها را با ارسال ``show_caches=True`` به هر " +"ابزار :mod:`!dis` نمایش داد. علاوه بر این، مفسر اکنون بایت‌کد را تطبیق می‌دهد " +"تا آن را برای شرایط مختلف ران‌تایم تخصصی کند. بایت‌کد تطبیقی را می‌توان با ارسال " +"``adaptive=True`` نمایش داد." -msgid "The argument of a jump is the offset of the target instruction relative to the instruction that appears immediately after the jump instruction's :opcode:`CACHE` entries." +msgid "" +"The argument of a jump is the offset of the target instruction relative to " +"the instruction that appears immediately after the jump " +"instruction's :opcode:`CACHE` entries." msgstr "" +"آرگومان یک پرش، آفست دستور مقصد نسبت به دستوری است که بلافاصله پس از " +"ورودی‌های :opcode:`CACHE` دستور پرش می‌آید." -msgid "As a consequence, the presence of the :opcode:`CACHE` instructions is transparent for forward jumps but needs to be taken into account when reasoning about backward jumps." +msgid "" +"As a consequence, the presence of the :opcode:`CACHE` instructions is " +"transparent for forward jumps but needs to be taken into account when " +"reasoning about backward jumps." msgstr "" +"در نتیجه، وجود دستورالعمل‌های :opcode:`CACHE` برای پرش‌های رو به جلو شفاف است، " +"اما هنگام استدلال درباره پرش‌های رو به عقب باید در نظر گرفته شود." -msgid "The output shows logical labels rather than instruction offsets for jump targets and exception handlers. The ``-O`` command line option and the ``show_offsets`` argument were added." +msgid "" +"The output shows logical labels rather than instruction offsets for jump " +"targets and exception handlers. The ``-O`` command line option and the " +"``show_offsets`` argument were added." msgstr "" +"خروجی برای مقاصد پرش و هندلرهای استثنا، به‌جای آفست‌های دستورالعمل، " +"برچسب‌های منطقی را نشان می‌دهد. گزینه خط فرمان ``-O`` و آرگومان " +"``show_offsets`` افزوده شدند." -msgid "The :option:`-P ` command-line option and the ``show_positions`` argument were added." +msgid "" +"The :option:`-P ` command-line option and the " +"``show_positions`` argument were added." msgstr "" +"گزینه‌ی خط فرمان :option:`-P ` و آرگومان " +"``show_positions`` افزوده شدند." msgid "The :option:`-S ` command-line option is added." -msgstr "" +msgstr "گزینه‌ی خط فرمان :option:`-S ` افزوده شده است." msgid "Example: Given the function :func:`!myfunc`::" -msgstr "" +msgstr "مثال: با فرض تابع :func:`!myfunc`::" msgid "" "def myfunc(alist):\n" " return len(alist)" msgstr "" +"def myfunc(alist):\n" +" return len(alist)" -msgid "the following command can be used to display the disassembly of :func:`!myfunc`:" +msgid "" +"the following command can be used to display the disassembly of :func:`!" +"myfunc`:" msgstr "" +"می‌توان از فرمان زیر برای نمایش واسازی (disassembly) :func:`!myfunc` استفاده " +"کرد:" msgid "" ">>> dis.dis(myfunc)\n" @@ -79,99 +142,173 @@ msgid "" " CALL 1\n" " RETURN_VALUE" msgstr "" +">>> dis.dis(myfunc)\n" +" 2 RESUME 0\n" +"\n" +" 3 LOAD_GLOBAL 1 (len + NULL)\n" +" LOAD_FAST_BORROW 0 (alist)\n" +" CALL 1\n" +" RETURN_VALUE" msgid "(The \"2\" is a line number)." -msgstr "" +msgstr "(«2» شماره‌ی خط است)." msgid "Command-line interface" -msgstr "" +msgstr "رابط خط فرمان" msgid "The :mod:`!dis` module can be invoked as a script from the command line:" -msgstr "" +msgstr "ماژول :mod:`!dis` می‌تواند به‌عنوان یک اسکریپت از خط فرمان فراخوانی شود:" msgid "python -m dis [-h] [-C] [-O] [-P] [-S] [infile]" -msgstr "" +msgstr "python -m dis [-h] [-C] [-O] [-P] [-S] [infile]" msgid "The following options are accepted:" -msgstr "" +msgstr "گزینه‌های زیر پذیرفته می‌شوند:" msgid "Display usage and exit." -msgstr "" +msgstr "نمایش کاربرد و خروج." msgid "Show inline caches." -msgstr "" +msgstr "نمایش نهانگاه‌های درون‌خطی." msgid "Show offsets of instructions." -msgstr "" +msgstr "نمایش آفست‌های دستورالعمل‌ها." msgid "Show positions of instructions in the source code." -msgstr "" +msgstr "نمایش موقعیت‌های دستورالعمل‌ها در کد منبع." msgid "Show specialized bytecode." -msgstr "" +msgstr "نمایش بایت‌کد تخصصی." -msgid "If :file:`infile` is specified, its disassembled code will be written to stdout. Otherwise, disassembly is performed on compiled source code received from stdin." +msgid "" +"If :file:`infile` is specified, its disassembled code will be written to " +"stdout. Otherwise, disassembly is performed on compiled source code received " +"from stdin." msgstr "" +"اگر :file:`infile` مشخص‌شده باشد، کد واسازی‌شده‌ی آن در stdout نوشته خواهد شد. " +"در غیر این صورت، دی‌اسمبل بر روی کد منبع کامپایل‌شده دریافت‌شده از stdin انجام " +"می‌شود." msgid "Bytecode analysis" -msgstr "" +msgstr "تحلیل بایت‌کد" -msgid "The bytecode analysis API allows pieces of Python code to be wrapped in a :class:`Bytecode` object that provides easy access to details of the compiled code." +msgid "" +"The bytecode analysis API allows pieces of Python code to be wrapped in " +"a :class:`Bytecode` object that provides easy access to details of the " +"compiled code." msgstr "" +"API تحلیل بایت‌کد به شما امکان می‌دهد تکه‌هایی از کد پایتون را در یک " +"شیء :class:`Bytecode` قرار دهید، که دسترسی آسان به جزئیات کد کامپایل‌شده را " +"فراهم می‌کند." -msgid "Analyse the bytecode corresponding to a function, generator, asynchronous generator, coroutine, method, string of source code, or a code object (as returned by :func:`compile`)." +msgid "" +"Analyse the bytecode corresponding to a function, generator, asynchronous " +"generator, coroutine, method, string of source code, or a code object (as " +"returned by :func:`compile`)." msgstr "" +"بایت‌کد متناظر با یک تابع، تولیدگر، تولیدگر ناهمگام، هم‌روال، متد، رشته‌ای از کد " +"منبع، یا شیء کد (همان‌طور که توسط :func:`compile` برگردانده می‌شود) را تحلیل " +"کنید." -msgid "This is a convenience wrapper around many of the functions listed below, most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` instance yields the bytecode operations as :class:`Instruction` instances." +msgid "" +"This is a convenience wrapper around many of the functions listed below, most " +"notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " +"instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" +"این پوششی آسان‌کننده برای بسیاری از توابع فهرست‌شده در زیر است، " +"به‌ویژه :func:`get_instructions`، زیرا پیمایش روی یک نمونه " +"از :class:`Bytecode`، عملیات‌های بایت‌کد را به‌صورت " +"نمونه‌های :class:`Instruction` برمی‌گرداند." -msgid "If *first_line* is not ``None``, it indicates the line number that should be reported for the first source line in the disassembled code. Otherwise, the source line information (if any) is taken directly from the disassembled code object." +msgid "" +"If *first_line* is not ``None``, it indicates the line number that should be " +"reported for the first source line in the disassembled code. Otherwise, the " +"source line information (if any) is taken directly from the disassembled code " +"object." msgstr "" +"اگر *first_line* برابر ``None`` نباشد، شماره خطی را نشان می‌دهد که باید برای " +"اولین خط منبع در کد واسازی‌شده گزارش شود. در غیر این صورت، اطلاعات خط منبع " +"(در صورت وجود) مستقیماً از شیء کد واسازی‌شده گرفته می‌شود." -msgid "If *current_offset* is not ``None``, it refers to an instruction offset in the disassembled code. Setting this means :meth:`.dis` will display a \"current instruction\" marker against the specified opcode." +msgid "" +"If *current_offset* is not ``None``, it refers to an instruction offset in " +"the disassembled code. Setting this means :meth:`.dis` will display a " +"\"current instruction\" marker against the specified opcode." msgstr "" +"اگر *current_offset* برابر ``None`` نباشد، به یک آفست دستورالعمل (instruction " +"offset) در کد دیس‌اسمبل‌شده (disassembled code) اشاره می‌کند. تنظیم این مقدار به " +"این معناست که :meth:`.dis` یک نشانگر «دستورالعمل فعلی» را در کنار کد عملیاتی " +"(opcode) مشخص‌شده نمایش خواهد داد." -msgid "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries used by the interpreter to specialize the bytecode." +msgid "" +"If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " +"used by the interpreter to specialize the bytecode." msgstr "" +"اگر *show_caches* برابر ``True`` باشد، :meth:`.dis` ورودی‌های نهانگاه درون‌خطی " +"مورد استفاده‌ی مفسر برای تخصصی‌سازی بایت‌کد (bytecode) را نمایش می‌دهد." -msgid "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode that may be different from the original bytecode." +msgid "" +"If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " +"that may be different from the original bytecode." msgstr "" +"اگر *adaptive* برابر ``True`` باشد، :meth:`.dis` بایت‌کد تخصصی‌شده‌ای را نمایش " +"می‌دهد که ممکن است با بایت‌کد اصلی متفاوت باشد." -msgid "If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets in the output." +msgid "" +"If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " +"in the output." msgstr "" +"اگر *show_offsets* برابر ``True`` باشد، :meth:`.dis` آفست‌های دستورالعمل را در " +"خروجی قرار می‌دهد." -msgid "If *show_positions* is ``True``, :meth:`.dis` will include instruction source code positions in the output." +msgid "" +"If *show_positions* is ``True``, :meth:`.dis` will include instruction source " +"code positions in the output." msgstr "" +"اگر *show_positions* برابر ``True`` باشد، :meth:`.dis` موقعیت‌های کد منبع " +"دستورالعمل‌ها را در خروجی قرار می‌دهد." -msgid "Construct a :class:`Bytecode` instance from the given traceback, setting *current_offset* to the instruction responsible for the exception." +msgid "" +"Construct a :class:`Bytecode` instance from the given traceback, setting " +"*current_offset* to the instruction responsible for the exception." msgstr "" +"با تنظیم *current_offset* روی دستور مسئول استثنا، یک نمونه :class:`Bytecode` " +"از ردگیری داده‌شده بسازید." msgid "The compiled code object." -msgstr "" +msgstr "شیء کد کامپایل‌شده." msgid "The first source line of the code object (if available)" -msgstr "" +msgstr "اولین خط منبع شیء کد (در صورت موجود بودن)" -msgid "Return a formatted view of the bytecode operations (the same as printed by :func:`dis.dis`, but returned as a multi-line string)." +msgid "" +"Return a formatted view of the bytecode operations (the same as printed " +"by :func:`dis.dis`, but returned as a multi-line string)." msgstr "" +"نمای قالب‌بندی‌شده‌ای از عملیات‌های بایت‌کد را برمی‌گرداند (همان چیزی که " +"توسط :func:`dis.dis` چاپ می‌شود، اما به‌صورت یک رشته چندخطی برگردانده می‌شود)." -msgid "Return a formatted multi-line string with detailed information about the code object, like :func:`code_info`." +msgid "" +"Return a formatted multi-line string with detailed information about the code " +"object, like :func:`code_info`." msgstr "" +"یک رشته چندخطی قالب‌بندی‌شده حاوی اطلاعات دقیق درباره شیء کد برمی‌گرداند، " +"مانند :func:`code_info`." msgid "This can now handle coroutine and asynchronous generator objects." -msgstr "" +msgstr "این اکنون می‌تواند اشیای هم‌روال و تولیدگر ناهمگام را مدیریت کند." msgid "Added the *show_caches* and *adaptive* parameters." -msgstr "" +msgstr "پارامترهای *show_caches* و *adaptive* اضافه شدند." msgid "Added the *show_offsets* parameter" -msgstr "" +msgstr "پارامتر *show_offsets* افزوده شد" msgid "Added the *show_positions* parameter." -msgstr "" +msgstr "پارامتر *show_positions* افزوده شد." msgid "Example:" -msgstr "" +msgstr "مثال:" msgid "" ">>> bytecode = dis.Bytecode(myfunc)\n" @@ -184,296 +321,572 @@ msgid "" "CALL\n" "RETURN_VALUE" msgstr "" +">>> bytecode = dis.Bytecode(myfunc)\n" +">>> for instr in bytecode:\n" +"... print(instr.opname)\n" +"...\n" +"RESUME\n" +"LOAD_GLOBAL\n" +"LOAD_FAST_BORROW\n" +"CALL\n" +"RETURN_VALUE" msgid "Analysis functions" -msgstr "" +msgstr "توابع تحلیل" -msgid "The :mod:`!dis` module also defines the following analysis functions that convert the input directly to the desired output. They can be useful if only a single operation is being performed, so the intermediate analysis object isn't useful:" +msgid "" +"The :mod:`!dis` module also defines the following analysis functions that " +"convert the input directly to the desired output. They can be useful if only " +"a single operation is being performed, so the intermediate analysis object " +"isn't useful:" msgstr "" +"ماژول :mod:`!dis` همچنین توابع تحلیل زیر را تعریف می‌کند که ورودی را مستقیماً " +"به خروجی دلخواه تبدیل می‌کنند. این توابع می‌توانند زمانی مفید باشند که فقط یک " +"عملیات واحد در حال انجام است، بنابراین شیء تحلیل میانی مفید نیست:" -msgid "Return a formatted multi-line string with detailed code object information for the supplied function, generator, asynchronous generator, coroutine, method, source code string or code object." +msgid "" +"Return a formatted multi-line string with detailed code object information " +"for the supplied function, generator, asynchronous generator, coroutine, " +"method, source code string or code object." msgstr "" +"یک رشته‌ی چندخطی قالب‌بندی‌شده حاوی اطلاعات دقیق شیء کد را برای تابع، تولیدگر، " +"تولیدگر ناهمگام، هم‌روال، متد، رشته‌ی کد منبع یا شیء کد ارائه‌شده برمی‌گرداند." -msgid "Note that the exact contents of code info strings are highly implementation dependent and they may change arbitrarily across Python VMs or Python releases." +msgid "" +"Note that the exact contents of code info strings are highly implementation " +"dependent and they may change arbitrarily across Python VMs or Python " +"releases." msgstr "" +"توجه داشته باشید که محتوای دقیق رشته‌های اطلاعات کد به‌شدت به پیاده‌سازی وابسته " +"است و ممکن است در ماشین‌های مجازی پایتون یا نسخه‌های پایتون به‌صورت دلخواه تغییر " +"کند." -msgid "Print detailed code object information for the supplied function, method, source code string or code object to *file* (or ``sys.stdout`` if *file* is not specified)." +msgid "" +"Print detailed code object information for the supplied function, method, " +"source code string or code object to *file* (or ``sys.stdout`` if *file* is " +"not specified)." msgstr "" +"اطلاعات دقیق شیء کد را برای تابع، متد، رشته‌ی کد منبع یا شیء کد ارائه‌شده در " +"*file* (یا ``sys.stdout`` اگر *file* مشخص‌نشده باشد) چاپ می‌کند." -msgid "This is a convenient shorthand for ``print(code_info(x), file=file)``, intended for interactive exploration at the interpreter prompt." +msgid "" +"This is a convenient shorthand for ``print(code_info(x), file=file)``, " +"intended for interactive exploration at the interpreter prompt." msgstr "" +"این میان‌بر مناسبی برای ``print(code_info(x), file=file)`` است و برای کاوش " +"تعاملی در اعلان مفسر در نظر گرفته شده است." msgid "Added *file* parameter." -msgstr "" +msgstr "پارامتر *file* افزوده شد." -msgid "Disassemble the *x* object. *x* can denote either a module, a class, a method, a function, a generator, an asynchronous generator, a coroutine, a code object, a string of source code or a byte sequence of raw bytecode. For a module, it disassembles all functions. For a class, it disassembles all methods (including class and static methods). For a code object or sequence of raw bytecode, it prints one line per bytecode instruction. It also recursively disassembles nested code objects. These can include generator expressions, nested functions, the bodies of nested classes, and the code objects used for :ref:`annotation scopes `. Strings are first compiled to code objects with the :func:`compile` built-in function before being disassembled. If no object is provided, this function disassembles the last traceback." -msgstr "" +msgid "" +"Disassemble the *x* object. *x* can denote either a module, a class, a " +"method, a function, a generator, an asynchronous generator, a coroutine, a " +"code object, a string of source code or a byte sequence of raw bytecode. For " +"a module, it disassembles all functions. For a class, it disassembles all " +"methods (including class and static methods). For a code object or sequence " +"of raw bytecode, it prints one line per bytecode instruction. It also " +"recursively disassembles nested code objects. These can include generator " +"expressions, nested functions, the bodies of nested classes, and the code " +"objects used for :ref:`annotation scopes `. Strings are " +"first compiled to code objects with the :func:`compile` built-in function " +"before being disassembled. If no object is provided, this function " +"disassembles the last traceback." +msgstr "" +"شیء *x* را واسازی (disassemble) می‌کند. *x* می‌تواند یک ماژول، کلاس، متد، " +"تابع، تولیدگر، تولیدگر ناهمگام، هم‌روال، شیء کد، رشته‌ای از کد منبع یا دنباله‌ای " +"بایتی از بایت‌کد خام (raw bytecode) باشد. برای یک ماژول، تمام توابع را " +"واسازی می‌کند. برای یک کلاس، تمام متدها (از جمله متدهای کلاسی و ایستا) را " +"واسازی می‌کند. برای یک شیء کد یا دنباله‌ای از بایت‌کد خام، به ازای هر دستور " +"بایت‌کد یک خط چاپ می‌کند. همچنین اشیاء کد تودرتو را به‌صورت بازگشتی واسازی " +"می‌کند. این موارد می‌توانند شامل عبارات تولیدگر، توابع تودرتو، بدنه‌های کلاس‌های " +"تودرتو و اشیاء کدی باشند که برای :ref:`محدوده‌های annotation ` استفاده می‌شوند. رشته‌ها پیش از واسازی شدن، ابتدا با تابع " +"توکار :func:`compile` به اشیاء کد کامپایل می‌شوند. اگر شیءای ارائه نشود، این " +"تابع آخرین ردگیری (traceback) را واسازی می‌کند." -msgid "The disassembly is written as text to the supplied *file* argument if provided and to ``sys.stdout`` otherwise." +msgid "" +"The disassembly is written as text to the supplied *file* argument if " +"provided and to ``sys.stdout`` otherwise." msgstr "" +"واسازی به‌صورت متن، در صورت ارائه شدن آرگومان *file*، در آن نوشته می‌شود و در " +"غیر این صورت در ``sys.stdout``." -msgid "The maximal depth of recursion is limited by *depth* unless it is ``None``. ``depth=0`` means no recursion." +msgid "" +"The maximal depth of recursion is limited by *depth* unless it is ``None``. " +"``depth=0`` means no recursion." msgstr "" +"حداکثر عمق بازگشت توسط *depth* محدود می‌شود، مگر اینکه ``None`` باشد. " +"``depth=0`` به معنای نبود بازگشت است." -msgid "If *show_caches* is ``True``, this function will display inline cache entries used by the interpreter to specialize the bytecode." +msgid "" +"If *show_caches* is ``True``, this function will display inline cache entries " +"used by the interpreter to specialize the bytecode." msgstr "" +"اگر *show_caches* برابر ``True`` باشد، این تابع ورودی‌های نهانگاه درون‌خطی را " +"که مفسر برای تخصصی‌سازی بایت‌کد از آن‌ها استفاده می‌کند، نمایش می‌دهد." -msgid "If *adaptive* is ``True``, this function will display specialized bytecode that may be different from the original bytecode." +msgid "" +"If *adaptive* is ``True``, this function will display specialized bytecode " +"that may be different from the original bytecode." msgstr "" +"اگر *adaptive* برابر ``True`` باشد، این تابع بایت‌کد تخصصی‌شده را نمایش می‌دهد " +"که ممکن است با بایت‌کد اصلی متفاوت باشد." msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" +"از هم باز کردن بازگشتی (disassembling) پیاده‌سازی شد و پارامتر *depth* افزوده " +"شد." msgid "Added the *show_offsets* parameter." -msgstr "" +msgstr "پارامتر *show_offsets* افزوده شد." -msgid "Disassemble the top-of-stack function of a traceback, using the last traceback if none was passed. The instruction causing the exception is indicated." +msgid "" +"Disassemble the top-of-stack function of a traceback, using the last " +"traceback if none was passed. The instruction causing the exception is " +"indicated." msgstr "" +"تابع بالای پشته در یک ردگیری پشته را واسازی (disassemble) می‌کند؛ اگر ردگیری " +"پشته‌ای ارسال نشده باشد، از آخرین ردگیری پشته استفاده می‌شود. دستوری که باعث " +"ایجاد استثنا شده است، مشخص می‌شود." -msgid "Disassemble a code object, indicating the last instruction if *lasti* was provided. The output is divided in the following columns:" +msgid "" +"Disassemble a code object, indicating the last instruction if *lasti* was " +"provided. The output is divided in the following columns:" msgstr "" +"یک شیء کد را واسازی (disassemble) می‌کند و در صورت ارائه *lasti*، آخرین " +"دستورالعمل را مشخص می‌کند. خروجی به ستون‌های زیر تقسیم می‌شود:" -msgid "the source code location of the instruction. Complete location information is shown if *show_positions* is true. Otherwise (the default) only the line number is displayed." +msgid "" +"the source code location of the instruction. Complete location information is " +"shown if *show_positions* is true. Otherwise (the default) only the line " +"number is displayed." msgstr "" +"موقعیت کد منبع دستورالعمل. اگر *show_positions* برابر true باشد، اطلاعات کامل " +"موقعیت نمایش داده می‌شود. در غیر این صورت (حالت پیش‌فرض) فقط شماره خط نمایش " +"داده می‌شود." msgid "the current instruction, indicated as ``-->``," -msgstr "" +msgstr "دستور جاری، که با ``-->`` نشان داده شده است،" msgid "a labelled instruction, indicated with ``>>``," -msgstr "" +msgstr "یک دستور برچسب‌دار، مشخص‌شده با ``>>``،" msgid "the address of the instruction," -msgstr "" +msgstr "نشانی دستور،" msgid "the operation code name," -msgstr "" +msgstr "نام کد عملیات،" msgid "operation parameters, and" -msgstr "" +msgstr "پارامترهای عملیات، و" msgid "interpretation of the parameters in parentheses." -msgstr "" +msgstr "تفسیر پارامترهای داخل پرانتز." -msgid "The parameter interpretation recognizes local and global variable names, constant values, branch targets, and compare operators." +msgid "" +"The parameter interpretation recognizes local and global variable names, " +"constant values, branch targets, and compare operators." msgstr "" +"تفسیر پارامتر، نام متغیرهای محلی و سراسری، مقادیر ثابت، مقاصد شاخه و عملگرهای " +"مقایسه را تشخیص می‌دهد." -msgid "Return an iterator over the instructions in the supplied function, method, source code string or code object." +msgid "" +"Return an iterator over the instructions in the supplied function, method, " +"source code string or code object." msgstr "" +"یک پیمایش‌گر بر روی دستورالعمل‌های موجود در تابع، متد، رشته‌ی کد منبع یا شیء کد " +"ارائه‌شده برمی‌گرداند." -msgid "The iterator generates a series of :class:`Instruction` named tuples giving the details of each operation in the supplied code." +msgid "" +"The iterator generates a series of :class:`Instruction` named tuples giving " +"the details of each operation in the supplied code." msgstr "" +"این پیمایشگر دنباله‌ای از چندتایی‌های نام‌دار (named tuple) از " +"نوع :class:`Instruction` تولید می‌کند که جزئیات هر عملیات در کد ارائه‌شده را " +"نشان می‌دهد." msgid "The *adaptive* parameter works as it does in :func:`dis`." -msgstr "" +msgstr "پارامتر *adaptive* همان رفتاری را دارد که در :func:`dis` دارد." -msgid "The *show_caches* parameter is deprecated and has no effect. The iterator generates the :class:`Instruction` instances with the *cache_info* field populated (regardless of the value of *show_caches*) and it no longer generates separate items for the cache entries." +msgid "" +"The *show_caches* parameter is deprecated and has no effect. The iterator " +"generates the :class:`Instruction` instances with the *cache_info* field " +"populated (regardless of the value of *show_caches*) and it no longer " +"generates separate items for the cache entries." msgstr "" +"پارامتر *show_caches* منسوخ است و هیچ اثری ندارد. پیمایش‌گر " +"نمونه‌های :class:`Instruction` را با فیلد *cache_info* مقداردهی‌شده تولید می‌کند " +"(صرف‌نظر از مقدار *show_caches*) و دیگر آیتم‌های جداگانه برای ورودی‌های نهانگاه " +"تولید نمی‌کند." -msgid "This generator function uses the :meth:`~codeobject.co_lines` method of the :ref:`code object ` *code* to find the offsets which are starts of lines in the source code. They are generated as ``(offset, lineno)`` pairs." +msgid "" +"This generator function uses the :meth:`~codeobject.co_lines` method of " +"the :ref:`code object ` *code* to find the offsets which are " +"starts of lines in the source code. They are generated as ``(offset, " +"lineno)`` pairs." msgstr "" +"این تابع تولیدگر از متد :meth:`~codeobject.co_lines` مربوط به :ref:`شیء کد " +"` *code* برای یافتن آفست‌هایی که آغاز خطوط در کد منبع هستند " +"استفاده می‌کند. آن‌ها به‌صورت جفت‌های ``(offset, lineno)`` تولید می‌شوند." msgid "Line numbers can be decreasing. Before, they were always increasing." -msgstr "" +msgstr "شماره‌های خط می‌توانند کاهشی باشند. پیش از این، همیشه افزایشی بودند." -msgid "The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` attributes of the :ref:`code object `." +msgid "" +"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of " +"the :attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " +"attributes of the :ref:`code object `." msgstr "" +"متد :meth:`~codeobject.co_lines` مربوط به :pep:`626`، به‌جای " +"ویژگی‌های :attr:`~codeobject.co_firstlineno` و :attr:`~codeobject.co_lnotab` " +"در :ref:`شیء کد ` استفاده می‌شود." -msgid "Line numbers can be ``None`` for bytecode that does not map to source lines." +msgid "" +"Line numbers can be ``None`` for bytecode that does not map to source lines." msgstr "" +"شماره‌های خط می‌توانند برای بایت‌کدی که به خطوط منبع نگاشت نمی‌شود، ``None`` " +"باشند." -msgid "Detect all offsets in the raw compiled bytecode string *code* which are jump targets, and return a list of these offsets." +msgid "" +"Detect all offsets in the raw compiled bytecode string *code* which are jump " +"targets, and return a list of these offsets." msgstr "" +"تمام آفست‌های موجود در رشته‌ی بایت‌کد خام کامپایل‌شده‌ی *code* را که مقصدهای پرش " +"هستند، شناسایی می‌کند و فهرستی از این آفست‌ها را برمی‌گرداند." msgid "Compute the stack effect of *opcode* with argument *oparg*." -msgstr "" +msgstr "اثر پشته‌ی *opcode* را با آرگومان *oparg* محاسبه می‌کند." -msgid "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` will return the stack effect of jumping. If *jump* is ``False``, it will return the stack effect of not jumping. And if *jump* is ``None`` (default), it will return the maximal stack effect of both cases." +msgid "" +"If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " +"will return the stack effect of jumping. If *jump* is ``False``, it will " +"return the stack effect of not jumping. And if *jump* is ``None`` (default), " +"it will return the maximal stack effect of both cases." msgstr "" +"اگر کد دارای هدف پرش باشد و *jump* برابر ``True`` باشد، :func:`~stack_effect` " +"اثر پشته‌ی پرش را برمی‌گرداند. اگر *jump* برابر ``False`` باشد، اثر پشته‌ی عدم پرش " +"را برمی‌گرداند. و اگر *jump* برابر ``None`` باشد (پیش‌فرض)، بیشینه‌ی اثر پشته در " +"هر دو حالت را برمی‌گرداند." msgid "Added *jump* parameter." -msgstr "" +msgstr "پارامتر *jump* افزوده شد." -msgid "If ``oparg`` is omitted (or ``None``), the stack effect is now returned for ``oparg=0``. Previously this was an error for opcodes that use their arg. It is also no longer an error to pass an integer ``oparg`` when the ``opcode`` does not use it; the ``oparg`` in this case is ignored." +msgid "" +"If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " +"``oparg=0``. Previously this was an error for opcodes that use their arg. It " +"is also no longer an error to pass an integer ``oparg`` when the ``opcode`` " +"does not use it; the ``oparg`` in this case is ignored." msgstr "" +"اگر ``oparg`` حذف شود (یا ``None`` باشد)، اثر پشته اکنون برای ``oparg=0`` " +"بازگردانده می‌شود. پیش‌تر این حالت برای کدهای عملیاتی (opcode) که از آرگومان " +"خود استفاده می‌کنند، خطا بود. همچنین دیگر ارسال یک ``oparg`` عدد صحیح وقتی که " +"``opcode`` از آن استفاده نمی‌کند، خطا نیست؛ در این حالت ``oparg`` نادیده گرفته " +"می‌شود." msgid "Python Bytecode Instructions" -msgstr "" +msgstr "دستورالعمل‌های بایت‌کد پایتون" -msgid "The :func:`get_instructions` function and :class:`Bytecode` class provide details of bytecode instructions as :class:`Instruction` instances:" +msgid "" +"The :func:`get_instructions` function and :class:`Bytecode` class provide " +"details of bytecode instructions as :class:`Instruction` instances:" msgstr "" +"تابع :func:`get_instructions` و کلاس :class:`Bytecode` جزئیات دستورالعمل‌های " +"بایت‌کد را به‌صورت نمونه‌های :class:`Instruction` ارائه می‌کنند:" msgid "Details for a bytecode operation" -msgstr "" +msgstr "جزئیات یک عملیات بایت‌کد" -msgid "numeric code for operation, corresponding to the opcode values listed below and the bytecode values in the :ref:`opcode_collections`." +msgid "" +"numeric code for operation, corresponding to the opcode values listed below " +"and the bytecode values in the :ref:`opcode_collections`." msgstr "" +"کد عددی برای عملیات، متناظر با مقادیر کد عملیاتی (opcode) فهرست‌شده در زیر و " +"مقادیر بایت‌کد (bytecode) در :ref:`opcode_collections`." msgid "human readable name for operation" -msgstr "" +msgstr "نام قابل‌خواندن برای انسان برای عملیات" -msgid "numeric code for the base operation if operation is specialized; otherwise equal to :data:`opcode`" +msgid "" +"numeric code for the base operation if operation is specialized; otherwise " +"equal to :data:`opcode`" msgstr "" +"کد عددی برای عملیات پایه اگر عملیات تخصصی‌شده باشد؛ در غیر این صورت برابر " +"با :data:`opcode`" -msgid "human readable name for the base operation if operation is specialized; otherwise equal to :data:`opname`" +msgid "" +"human readable name for the base operation if operation is specialized; " +"otherwise equal to :data:`opname`" msgstr "" +"نام قابل‌خواندن برای انسان برای عملیات پایه، اگر عملیات تخصصی‌شده باشد؛ در غیر " +"این صورت برابر با :data:`opname`" msgid "numeric argument to operation (if any), otherwise ``None``" -msgstr "" +msgstr "آرگومان عددی عملیات (در صورت وجود)، در غیر این صورت ``None``" msgid "alias for :data:`arg`" -msgstr "" +msgstr "نام مستعار برای :data:`arg`" msgid "resolved arg value (if any), otherwise ``None``" -msgstr "" +msgstr "مقدار آرگومان تعیین‌شده (در صورت وجود)، در غیر این صورت ``None``" -msgid "human readable description of operation argument (if any), otherwise an empty string." +msgid "" +"human readable description of operation argument (if any), otherwise an empty " +"string." msgstr "" +"توضیح قابل‌خواندن برای انسان درباره‌ی آرگومان عملیات (در صورت وجود)، در غیر این " +"صورت یک رشته خالی." msgid "start index of operation within bytecode sequence" -msgstr "" +msgstr "اندیس شروع عملیات در دنباله‌ی بایت‌کد" -msgid "start index of operation within bytecode sequence, including prefixed ``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" +msgid "" +"start index of operation within bytecode sequence, including prefixed " +"``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" msgstr "" +"اندیس شروع عملیات در دنباله‌ی بایت‌کد (bytecode)، شامل عملیات‌های پیشوندی " +"``EXTENDED_ARG`` در صورت وجود؛ در غیر این صورت برابر با :data:`offset`" msgid "start index of the cache entries following the operation" -msgstr "" +msgstr "اندیس شروع آیتم‌های نهانگاه پس از عملیات" msgid "end index of the cache entries following the operation" -msgstr "" +msgstr "اندیس پایانی آیتم‌های نهانگاه پس از عملیات" msgid "``True`` if this opcode starts a source line, otherwise ``False``" msgstr "" +"``True`` اگر این کد عملیاتی (opcode) یک خط منبع را آغاز کند، در غیر این صورت " +"``False``" -msgid "source line number associated with this opcode (if any), otherwise ``None``" +msgid "" +"source line number associated with this opcode (if any), otherwise ``None``" msgstr "" +"شماره‌ی خط منبع مرتبط با این کد عملیاتی (opcode) (در صورت وجود)، در غیر این " +"صورت ``None``" msgid "``True`` if other code jumps to here, otherwise ``False``" -msgstr "" +msgstr "اگر کد دیگری به اینجا بپرد، ``True`` و در غیر این صورت ``False``" -msgid "bytecode index of the jump target if this is a jump operation, otherwise ``None``" +msgid "" +"bytecode index of the jump target if this is a jump operation, otherwise " +"``None``" msgstr "" +"اندیس بایت‌کد هدف پرش، اگر این یک عملیات پرش باشد، در غیر این صورت ``None``" -msgid ":class:`dis.Positions` object holding the start and end locations that are covered by this instruction." +msgid "" +":class:`dis.Positions` object holding the start and end locations that are " +"covered by this instruction." msgstr "" +"شیء :class:`dis.Positions` که موقعیت‌های شروع و پایان تحت پوشش این دستور را " +"نگه می‌دارد." -msgid "Information about the cache entries of this instruction, as triplets of the form ``(name, size, data)``, where the ``name`` and ``size`` describe the cache format and data is the contents of the cache. ``cache_info`` is ``None`` if the instruction does not have caches." +msgid "" +"Information about the cache entries of this instruction, as triplets of the " +"form ``(name, size, data)``, where the ``name`` and ``size`` describe the " +"cache format and data is the contents of the cache. ``cache_info`` is " +"``None`` if the instruction does not have caches." msgstr "" +"اطلاعات مربوط به ورودی‌های نهانگاه این دستور، به‌صورت سه‌تایی‌هایی با قالب " +"``(name, size, data)``، که در آن ``name`` و ``size`` قالب نهانگاه را توصیف " +"می‌کنند و data محتوای نهانگاه است. اگر این دستور نهانگاه نداشته باشد، " +"``cache_info`` برابر ``None`` خواهد بود." msgid "Field ``positions`` is added." -msgstr "" +msgstr "فیلد ``positions`` اضافه شده است." msgid "Changed field ``starts_line``." -msgstr "" +msgstr "فیلد ``starts_line`` تغییر کرد." -msgid "Added fields ``start_offset``, ``cache_offset``, ``end_offset``, ``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` and ``cache_info``." +msgid "" +"Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " +"``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " +"and ``cache_info``." msgstr "" +"فیلدهای ``start_offset``، ``cache_offset``، ``end_offset``، ``baseopname``، " +"``baseopcode``، ``jump_target``، ``oparg``، ``line_number`` و ``cache_info`` " +"افزوده شدند." msgid "In case the information is not available, some fields might be ``None``." msgstr "" +"در صورتی که اطلاعات در دسترس نباشد، ممکن است برخی فیلدها ``None`` باشند." -msgid "The Python compiler currently generates the following bytecode instructions." -msgstr "" +msgid "" +"The Python compiler currently generates the following bytecode instructions." +msgstr "کامپایلر پایتون در حال حاضر دستورالعمل‌های بایت‌کد زیر را تولید می‌کند." msgid "**General instructions**" -msgstr "" +msgstr "دستورالعمل‌های عمومی" -msgid "In the following, We will refer to the interpreter stack as ``STACK`` and describe operations on it as if it was a Python list. The top of the stack corresponds to ``STACK[-1]`` in this language." +msgid "" +"In the following, We will refer to the interpreter stack as ``STACK`` and " +"describe operations on it as if it was a Python list. The top of the stack " +"corresponds to ``STACK[-1]`` in this language." msgstr "" +"در ادامه، از پشته‌ی مفسر با نام ``STACK`` یاد می‌کنیم و عملیات روی آن را " +"به‌گونه‌ای توصیف می‌کنیم که گویی یک فهرست پایتون است. در این زبان، بالای پشته با " +"``STACK[-1]`` متناظر است." -msgid "Do nothing code. Used as a placeholder by the bytecode optimizer, and to generate line tracing events." +msgid "" +"Do nothing code. Used as a placeholder by the bytecode optimizer, and to " +"generate line tracing events." msgstr "" +"کد بدون عمل. توسط بهینه‌ساز بایت‌کد به‌عنوان جای‌نگهدار و برای تولید رویدادهای " +"ردگیری خط استفاده می‌شود." -msgid "Do nothing code. Used by the interpreter to record :monitoring-event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events for :mod:`sys.monitoring`." +msgid "" +"Do nothing code. Used by the interpreter to record :monitoring-" +"event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events " +"for :mod:`sys.monitoring`." msgstr "" +"کد بدون عمل. توسط مفسر برای ثبت رویدادهای :monitoring-event:`BRANCH_LEFT` " +"و :monitoring-event:`BRANCH_RIGHT` برای :mod:`sys.monitoring` استفاده می‌شود." msgid "Removes the iterator from the top of the stack." -msgstr "" +msgstr "پیمایش‌گر را از بالای پشته حذف می‌کند." msgid "Removes the top-of-stack item::" -msgstr "" +msgstr "آیتم بالای پشته را حذف می‌کند::" msgid "STACK.pop()" -msgstr "" +msgstr "STACK.pop()" -msgid "Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up at the end of loops, hence the name." +msgid "" +"Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up at " +"the end of loops, hence the name." msgstr "" +"آیتم بالای پشته را حذف می‌کند. معادل ``POP_TOP`` است. برای پاک‌سازی در پایان " +"حلقه‌ها استفاده می‌شود، به همین دلیل این نام را دارد." msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" +"``del STACK[-2]`` را پیاده‌سازی می‌کند. برای پاک‌سازی هنگام خروج یک تولیدگر " +"استفاده می‌شود." -msgid "Push the i-th item to the top of the stack without removing it from its original location::" -msgstr "" +msgid "" +"Push the i-th item to the top of the stack without removing it from its " +"original location::" +msgstr "آیتم iاُم را بدون حذف آن از محل اصلی‌اش، در بالای پشته قرار می‌دهد::" msgid "" "assert i > 0\n" "STACK.append(STACK[-i])" msgstr "" +"assert i > 0\n" +"STACK.append(STACK[-i])" msgid "Swap the top of the stack with the i-th element::" -msgstr "" +msgstr "جابه‌جایی بالای پشته با عنصر iام::" msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -msgstr "" +msgstr "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -msgid "Rather than being an actual instruction, this opcode is used to mark extra space for the interpreter to cache useful data directly in the bytecode itself. It is automatically hidden by all ``dis`` utilities, but can be viewed with ``show_caches=True``." +msgid "" +"Rather than being an actual instruction, this opcode is used to mark extra " +"space for the interpreter to cache useful data directly in the bytecode " +"itself. It is automatically hidden by all ``dis`` utilities, but can be " +"viewed with ``show_caches=True``." msgstr "" +"این کدعمل (opcode) به‌جای آنکه یک دستور واقعی باشد، برای علامت‌گذاری فضای " +"اضافی استفاده می‌شود تا مفسر بتواند داده‌های مفید را مستقیماً در خود بایت‌کد " +"(bytecode) نهانگاه‌سازی کند. این کدعمل به‌طور خودکار توسط همه ابزارهای " +"``dis`` پنهان می‌شود، اما می‌توان آن را با ``show_caches=True`` مشاهده کرد." -msgid "Logically, this space is part of the preceding instruction. Many opcodes expect to be followed by an exact number of caches, and will instruct the interpreter to skip over them at runtime." +msgid "" +"Logically, this space is part of the preceding instruction. Many opcodes " +"expect to be followed by an exact number of caches, and will instruct the " +"interpreter to skip over them at runtime." msgstr "" +"از نظر منطقی، این فضا بخشی از دستور پیشین است. بسیاری از کدهای عملیاتی " +"(opcode) انتظار دارند تعداد دقیقی نهانگاه به دنبال آن‌ها بیاید و به مفسر دستور " +"می‌دهند تا در ران‌تایم از روی آن‌ها بپرد." -msgid "Populated caches can look like arbitrary instructions, so great care should be taken when reading or modifying raw, adaptive bytecode containing quickened data." +msgid "" +"Populated caches can look like arbitrary instructions, so great care should " +"be taken when reading or modifying raw, adaptive bytecode containing " +"quickened data." msgstr "" +"نهانگاه‌های پرشده می‌توانند شبیه دستورالعمل‌های دلخواه به نظر برسند، بنابراین " +"هنگام خواندن یا تغییر بایت‌کد خام و تطبیقی حاوی داده‌های سریع‌شده (quickened) " +"باید دقت زیادی به عمل آید." msgid "**Unary operations**" -msgstr "" +msgstr "عملیات‌های یک‌عملوندی" -msgid "Unary operations take the top of the stack, apply the operation, and push the result back on the stack." +msgid "" +"Unary operations take the top of the stack, apply the operation, and push the " +"result back on the stack." msgstr "" +"عملیات‌های یک‌عملوندی، عنصر بالایی پشته را برمی‌دارند، عملیات را اعمال می‌کنند و " +"نتیجه را دوباره روی پشته قرار می‌دهند." msgid "Implements ``STACK[-1] = -STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = -STACK[-1]`` را پیاده‌سازی می‌کند." msgid "Implements ``STACK[-1] = not STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = not STACK[-1]`` را پیاده‌سازی می‌کند." msgid "This instruction now requires an exact :class:`bool` operand." -msgstr "" +msgstr "این دستور اکنون به عملوندی دقیقاً از نوع :class:`bool` نیاز دارد." msgid "Implements ``STACK[-1] = ~STACK[-1]``." -msgstr "" +msgstr "``STACK[-1] = ~STACK[-1]`` را پیاده‌سازی می‌کند." msgid "Implements ``STACK[-1] = iter(STACK[-1])``." -msgstr "" +msgstr "``STACK[-1] = iter(STACK[-1])`` را پیاده‌سازی می‌کند." -msgid "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." +msgid "" +"If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " +"it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" +"اگر ``STACK[-1]`` یک شیء :term:`generator iterator` یا :term:`هم‌روال ` باشد، به همان صورت باقی می‌ماند. در غیر این صورت، ``STACK[-1] = iter(STACK[-1])`` را پیاده‌سازی می‌کند." msgid "Implements ``STACK[-1] = bool(STACK[-1])``." -msgstr "" +msgstr "``STACK[-1] = bool(STACK[-1])`` را پیاده‌سازی می‌کند." msgid "**Binary and in-place operations**" -msgstr "" +msgstr "عملیات دودویی و درجایی" -msgid "Binary operations remove the top two items from the stack (``STACK[-1]`` and ``STACK[-2]``). They perform the operation, then put the result back on the stack." +msgid "" +"Binary operations remove the top two items from the stack (``STACK[-1]`` and " +"``STACK[-2]``). They perform the operation, then put the result back on the " +"stack." msgstr "" +"عملیات‌های دودویی دو آیتم بالایی را از پشته (``STACK[-1]`` و ``STACK[-2]``) " +"برمی‌دارند. آن‌ها عملیات را انجام می‌دهند، سپس نتیجه را دوباره روی پشته قرار " +"می‌دهند." -msgid "In-place operations are like binary operations, but the operation is done in-place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be (but does not have to be) the original ``STACK[-2]``." +msgid "" +"In-place operations are like binary operations, but the operation is done in-" +"place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " +"(but does not have to be) the original ``STACK[-2]``." msgstr "" +"عملیات‌های درجا مانند عملیات‌های دودویی هستند، اما زمانی که ``STACK[-2]`` از آن " +"پشتیبانی کند، عملیات به‌صورت درجا انجام می‌شود، و ``STACK[-1]`` حاصل ممکن است " +"(اما لازم نیست) همان ``STACK[-2]`` اصلی باشد." -msgid "Implements the binary and in-place operators (depending on the value of *op*)::" -msgstr "" +msgid "" +"Implements the binary and in-place operators (depending on the value of " +"*op*)::" +msgstr "عملگرهای دودویی و درجا را (بسته به مقدار *op*) پیاده‌سازی می‌کند::" msgid "" "rhs = STACK.pop()\n" "lhs = STACK.pop()\n" "STACK.append(lhs op rhs)" msgstr "" +"rhs = STACK.pop()\n" +"lhs = STACK.pop()\n" +"STACK.append(lhs op rhs)" -msgid "With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode ``BINARY_SUBSCR``)" +msgid "" +"With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode " +"``BINARY_SUBSCR``)" msgstr "" +"با oparg :``NB_SUBSCR``، زیرنویس دودویی (binary subscript) را پیاده‌سازی می‌کند " +"(جایگزین opcode ``BINARY_SUBSCR`` می‌شود)" msgid "Implements::" -msgstr "" +msgstr "پیاده‌سازی::" msgid "" "key = STACK.pop()\n" @@ -481,12 +894,19 @@ msgid "" "value = STACK.pop()\n" "container[key] = value" msgstr "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[key] = value" msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" "del container[key]" msgstr "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"del container[key]" msgid "" "end = STACK.pop()\n" @@ -494,6 +914,10 @@ msgid "" "container = STACK.pop()\n" "STACK.append(container[start:end])" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[start:end])" msgid "" "end = STACK.pop()\n" @@ -502,224 +926,481 @@ msgid "" "value = STACK.pop()\n" "container[start:end] = value" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[start:end] = value" msgid "**Coroutine opcodes**" -msgstr "" +msgstr "کدهای عملیاتی هم‌روال" -msgid "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where ``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or resolves ``o.__await__``." +msgid "" +"Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " +"``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " +"generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " +"resolves ``o.__await__``." msgstr "" +"``STACK[-1] = get_awaitable(STACK[-1])`` را پیاده‌سازی می‌کند، که در آن " +"``get_awaitable(o)`` اگر ``o`` یک شیء هم‌روال یا یک شیء تولیدگر با " +"پرچم :data:`~inspect.CO_ITERABLE_COROUTINE` باشد، ``o`` را برمی‌گرداند، یا " +"``o.__await__`` را حل می‌کند." -msgid "If the ``where`` operand is nonzero, it indicates where the instruction occurs:" -msgstr "" +msgid "" +"If the ``where`` operand is nonzero, it indicates where the instruction " +"occurs:" +msgstr "اگر عملوند ``where`` غیرصفر باشد، محل وقوع دستورالعمل را نشان می‌دهد:" msgid "``1``: After a call to ``__aenter__``" -msgstr "" +msgstr "``1``: پس از فراخوانی ``__aenter__``" msgid "``2``: After a call to ``__aexit__``" -msgstr "" +msgstr "``2``: پس از فراخوانی ``__aexit__``" msgid "Previously, this instruction did not have an oparg." -msgstr "" +msgstr "پیش‌تر، این دستور oparg نداشت." msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." -msgstr "" +msgstr "``STACK[-1] = STACK[-1].__aiter__()`` را پیاده‌سازی می‌کند." msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." -msgstr "" +msgstr "برگرداندن اشیای awaitable از ``__aiter__`` دیگر پشتیبانی نمی‌شود." -msgid "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." +msgid "" +"Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " +"stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" +"``STACK.append(get_awaitable(STACK[-1].__anext__()))`` را روی پشته پیاده‌سازی " +"کنید. برای جزئیات درباره‌ی ``get_awaitable``، ``GET_AWAITABLE`` را ببینید." -msgid "Terminates an :keyword:`async for` loop. Handles an exception raised when awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` and the raised exception in ``STACK[-1]``. Both are popped. If the exception is not :exc:`StopAsyncIteration`, it is re-raised." +msgid "" +"Terminates an :keyword:`async for` loop. Handles an exception raised when " +"awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " +"and the raised exception in ``STACK[-1]``. Both are popped. If the exception " +"is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" +"حلقه‌ی :keyword:`async for` را پایان می‌دهد. استثنای پرتاب‌شده هنگام await برای " +"آیتم بعدی را مدیریت می‌کند. پشته حاوی پیمایش‌پذیر ناهمگام در ``STACK[-2]`` و " +"استثنای پرتاب‌شده در ``STACK[-1]`` است. هر دو از پشته برداشته می‌شوند. اگر " +"استثنا :exc:`StopAsyncIteration` نباشد، دوباره پرتاب می‌شود." -msgid "Exception representation on the stack now consist of one, not three, items." -msgstr "" +msgid "" +"Exception representation on the stack now consist of one, not three, items." +msgstr "نمایش استثنا روی پشته اکنون شامل ۱ آیتم است، نه ۳ آیتم." -msgid "Handles an exception raised during a :meth:`~generator.throw` or :meth:`~generator.close` call through the current frame. If ``STACK[-1]`` is an instance of :exc:`StopIteration`, pop three values from the stack and push its ``value`` member. Otherwise, re-raise ``STACK[-1]``." +msgid "" +"Handles an exception raised during a :meth:`~generator.throw` " +"or :meth:`~generator.close` call through the current frame. If ``STACK[-1]`` " +"is an instance of :exc:`StopIteration`, pop three values from the stack and " +"push its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" +"استثنای پرتاب‌شده در حین فراخوانی :meth:`~generator.throw` " +"یا :meth:`~generator.close` از طریق فریم جاری را مدیریت می‌کند. اگر " +"``STACK[-1]`` نمونه‌ای از :exc:`StopIteration` باشد، سه مقدار را از پشته " +"برمی‌دارد و ویژگی ``value`` آن را بر پشته می‌گذارد. در غیر این صورت، " +"``STACK[-1]`` را دوباره پرتاب می‌کند." msgid "**Miscellaneous opcodes**" -msgstr "" +msgstr "کدهای عملیاتی متفرقه" msgid "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" msgstr "" +"item = STACK.pop()\n" +"set.add(STACK[-i], item)" msgid "Used to implement set comprehensions." -msgstr "" +msgstr "برای پیاده‌سازی درک‌های مجموعه‌ای استفاده می‌شود." msgid "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" msgstr "" +"item = STACK.pop()\n" +"list.append(STACK[-i], item)" msgid "Used to implement list comprehensions." -msgstr "" +msgstr "برای پیاده‌سازی درک‌های فهرستی استفاده می‌شود." msgid "" "value = STACK.pop()\n" "key = STACK.pop()\n" "dict.__setitem__(STACK[-i], key, value)" msgstr "" +"value = STACK.pop()\n" +"key = STACK.pop()\n" +"dict.__setitem__(STACK[-i], key, value)" msgid "Used to implement dict comprehensions." -msgstr "" +msgstr "برای پیاده‌سازی درک دیکشنری استفاده می‌شود." -msgid "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were reversed." +msgid "" +"Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " +"reversed." msgstr "" +"مقدار نگاشت ``STACK[-1]`` و کلید نگاشت ``STACK[-2]`` است. پیش از این، این دو " +"معکوس بودند." -msgid "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:`MAP_ADD` instructions, while the added value or key/value pair is popped off, the container object remains on the stack so that it is available for further iterations of the loop." +msgid "" +"For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:`MAP_ADD` " +"instructions, while the added value or key/value pair is popped off, the " +"container object remains on the stack so that it is available for further " +"iterations of the loop." msgstr "" +"برای تمام دستورالعمل‌های :opcode:`SET_ADD`، :opcode:`LIST_APPEND` " +"و :opcode:`MAP_ADD`، در حالی که مقدار یا جفت کلید/مقدار افزوده‌شده از پشته " +"برداشته می‌شود، شیء نگهدارنده روی پشته باقی می‌ماند تا برای تکرارهای بعدی حلقه " +"در دسترس باشد." msgid "Returns with ``STACK[-1]`` to the caller of the function." -msgstr "" +msgstr "با ``STACK[-1]`` به فراخواننده‌ی تابع بازمی‌گردد." msgid "Yields ``STACK.pop()`` from a :term:`generator`." -msgstr "" +msgstr "``STACK.pop()`` را از یک :term:`تولیدگر ` yield می‌کند." msgid "oparg set to be the stack depth." -msgstr "" +msgstr "oparg برابر با عمق پشته تنظیم می‌شود." -msgid "oparg set to be the exception block depth, for efficient closing of generators." -msgstr "" +msgid "" +"oparg set to be the exception block depth, for efficient closing of " +"generators." +msgstr "oparg به‌عنوان عمق بلوک استثنا تنظیم می‌شود، برای بستن کارآمد تولیدگرها." -msgid "oparg is ``1`` if this instruction is part of a yield-from or await, and ``0`` otherwise." +msgid "" +"oparg is ``1`` if this instruction is part of a yield-from or await, and " +"``0`` otherwise." msgstr "" +"oparg در صورتی ``1`` است که این دستور بخشی از yield-from یا await باشد، و در " +"غیر این صورت ``0`` است." -msgid "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is set up to an empty ``dict``. This opcode is only emitted if a class or module body contains :term:`variable annotations ` statically." +msgid "" +"Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " +"set up to an empty ``dict``. This opcode is only emitted if a class or module " +"body contains :term:`variable annotations ` statically." msgstr "" +"بررسی می‌کند که آیا ``__annotations__`` در ``locals()`` تعریف‌شده است یا خیر؛ " +"در غیر این صورت، به یک ``dict`` خالی تنظیم می‌شود. این کد عملیاتی (opcode) " +"تنها در صورتی صادر می‌شود که بدنه‌ی یک کلاس یا ماژول به‌صورت ایستا " +"حاوی :term:`variable annotations ` باشد." -msgid "Pops a value from the stack, which is used to restore the exception state." -msgstr "" +msgid "" +"Pops a value from the stack, which is used to restore the exception state." +msgstr "یک مقدار را از پشته برمی‌دارد که برای بازیابی وضعیت استثنا به کار می‌رود." -msgid "Re-raises the exception currently on top of the stack. If oparg is non-zero, pops an additional value from the stack which is used to set :attr:`~frame.f_lasti` of the current frame." +msgid "" +"Re-raises the exception currently on top of the stack. If oparg is non-zero, " +"pops an additional value from the stack which is used to " +"set :attr:`~frame.f_lasti` of the current frame." msgstr "" +"استثنایی را که در حال حاضر در بالای پشته قرار دارد، مجدداً پرتاب می‌کند. اگر " +"oparg غیرصفر باشد، یک مقدار اضافی را از پشته برمی‌دارد که برای " +"تنظیم :attr:`~frame.f_lasti` فریم جاری استفاده می‌شود." -msgid "Pops a value from the stack. Pushes the current exception to the top of the stack. Pushes the value originally popped back to the stack. Used in exception handlers." +msgid "" +"Pops a value from the stack. Pushes the current exception to the top of the " +"stack. Pushes the value originally popped back to the stack. Used in " +"exception handlers." msgstr "" +"یک مقدار را از پشته برمی‌دارد. استثنای فعلی را به بالای پشته می‌گذارد. مقداری " +"را که در اصل برداشته شده بود دوباره به پشته بازمی‌گرداند. در هندلرهای " +"استثنا استفاده می‌شود." -msgid "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the boolean result of the test." +msgid "" +"Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " +"is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " +"boolean result of the test." msgstr "" +"عملیات تطبیق استثنا برای ``except`` را انجام می‌دهد. بررسی می‌کند که آیا " +"``STACK[-2]`` استثنایی است که با ``STACK[-1]`` مطابقت دارد یا خیر. " +"``STACK[-1]`` را از پشته برمی‌دارد و نتیجه بولی این بررسی را روی پشته قرار " +"می‌دهد." -msgid "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on the exception group representing ``STACK[-2]``." +msgid "" +"Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " +"the exception group representing ``STACK[-2]``." msgstr "" +"تطبیق استثنا را برای ``except*`` انجام می‌دهد. ``split(STACK[-1])`` را روی " +"گروه استثنا که نشان‌دهنده‌ی ``STACK[-2]`` است اعمال می‌کند." -msgid "In case of a match, pops two items from the stack and pushes the non-matching subgroup (``None`` in case of full match) followed by the matching subgroup. When there is no match, pops one item (the match type) and pushes ``None``." +msgid "" +"In case of a match, pops two items from the stack and pushes the non-matching " +"subgroup (``None`` in case of full match) followed by the matching subgroup. " +"When there is no match, pops one item (the match type) and pushes ``None``." msgstr "" +"در صورت تطابق، دو آیتم را از پشته برمی‌دارد و زیرگروه غیرمنطبق (در صورت تطابق " +"کامل ``None``) و سپس زیرگروه منطبق را بر پشته می‌گذارد. هنگامی که تطابقی وجود " +"ندارد، یک آیتم (نوع تطابق) را برمی‌دارد و ``None`` را بر پشته می‌گذارد." -msgid "Calls the function in position 4 on the stack with arguments (type, val, tb) representing the exception at the top of the stack. Used to implement the call ``context_manager.__exit__(*exc_info())`` when an exception has occurred in a :keyword:`with` statement." +msgid "" +"Calls the function in position 4 on the stack with arguments (type, val, tb) " +"representing the exception at the top of the stack. Used to implement the " +"call ``context_manager.__exit__(*exc_info())`` when an exception has occurred " +"in a :keyword:`with` statement." msgstr "" +"تابع موجود در جایگاه ۴ روی پشته را با آرگومان‌های (type, val, tb) که استثنا در " +"بالای پشته را نشان می‌دهند، فراخوانی می‌کند. برای پیاده‌سازی فراخوانی " +"``context_manager.__exit__(*exc_info())`` هنگامی که استثنایی در یک " +"دستور :keyword:`with` رخ داده باشد، استفاده می‌شود." -msgid "The ``__exit__`` function is in position 4 of the stack rather than 7. Exception representation on the stack now consist of one, not three, items." +msgid "" +"The ``__exit__`` function is in position 4 of the stack rather than 7. " +"Exception representation on the stack now consist of one, not three, items." msgstr "" +"تابع ``__exit__`` به جای موقعیت ۷، در موقعیت ۴ پشته قرار دارد. بازنمایی " +"استثنا در پشته اکنون شامل یک آیتم است، نه سه آیتم." -msgid "Pushes a common constant onto the stack. The interpreter contains a hardcoded list of constants supported by this instruction. Used by the :keyword:`assert` statement to load :exc:`AssertionError`." +msgid "" +"Pushes a common constant onto the stack. The interpreter contains a hardcoded " +"list of constants supported by this instruction. Used by " +"the :keyword:`assert` statement to load :exc:`AssertionError`." msgstr "" +"یک ثابت رایج را روی پشته قرار می‌دهد. مفسر حاوی یک فهرست سخت‌کدشده از ثابت‌های " +"پشتیبانی‌شده توسط این دستورالعمل است. در دستور :keyword:`assert` برای " +"بارگذاری :exc:`AssertionError` استفاده می‌شود." -msgid "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called to construct a class." +msgid "" +"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " +"to construct a class." msgstr "" +":func:`!builtins.__build_class__` را روی پشته می‌گذارد. سپس برای ساخت یک کلاس " +"فراخوانی می‌شود." -msgid "Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` statements where comparison with structure of pattern is needed." +msgid "" +"Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` statements " +"where comparison with structure of pattern is needed." msgstr "" +"``STACK.append(len(STACK[-1]))`` را اجرا می‌کند. در دستورهای :keyword:`match` " +"که در آن‌ها مقایسه با ساختار الگو لازم است، استفاده می‌شود." -msgid "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, push ``False``." +msgid "" +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, more " +"technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." msgstr "" +"اگر ``STACK[-1]`` نمونه‌ای از :class:`collections.abc.Mapping` باشد (یا، از " +"نظر فنی دقیق‌تر: اگر پرچم :c:macro:`Py_TPFLAGS_MAPPING` " +"در :c:member:`~PyTypeObject.tp_flags` آن تنظیم شده باشد)، ``True`` را روی " +"پشته قرار دهید. در غیر این صورت، ``False`` را روی پشته قرار دهید." -msgid "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is *not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, push ``False``." -msgstr "" +msgid "" +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " +"*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more " +"technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." +msgstr "" +"اگر ``STACK[-1]`` نمونه‌ای از :class:`collections.abc.Sequence` باشد و نمونه‌ای " +"از :class:`str`/:class:`bytes`/:class:`bytearray` *نباشد* (یا به بیان فنی‌تر: " +"اگر پرچم :c:macro:`Py_TPFLAGS_SEQUENCE` در :c:member:`~PyTypeObject.tp_flags` " +"آن تنظیم‌شده باشد)، ``True`` را روی پشته قرار دهید. در غیر این صورت، ``False`` " +"را روی پشته قرار دهید." -msgid "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :class:`tuple` containing the corresponding values. Otherwise, push ``None``." +msgid "" +"``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " +"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push " +"a :class:`tuple` containing the corresponding values. Otherwise, push " +"``None``." msgstr "" +"``STACK[-1]`` یک تاپل از کلیدهای نگاشت است، و ``STACK[-2]`` موضوع تطبیق است. " +"اگر ``STACK[-2]`` شامل همه‌ی کلیدهای ``STACK[-1]`` باشد، یک :class:`tuple` " +"حاوی مقادیر متناظر را روی پشته قرار دهید. در غیر این صورت، ``None`` را روی " +"پشته قرار دهید." -msgid "Previously, this instruction also pushed a boolean value indicating success (``True``) or failure (``False``)." +msgid "" +"Previously, this instruction also pushed a boolean value indicating success " +"(``True``) or failure (``False``)." msgstr "" +"پیش‌تر، این دستورالعمل همچنین یک مقدار بولی را که نشان‌دهنده‌ی موفقیت (``True``) " +"یا شکست (``False``) بود، روی پشته می‌گذاشت." -msgid "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." +msgid "" +"Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " +"attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` " +"or :opcode:`STORE_GLOBAL` if possible." msgstr "" +"``name = STACK.pop()`` را پیاده‌سازی می‌کند. *namei* اندیس *name* در " +"ویژگی :attr:`~codeobject.co_names` از :ref:`شیء کد ` است. " +"کامپایلر در صورت امکان تلاش می‌کند از :opcode:`STORE_FAST` " +"یا :opcode:`STORE_GLOBAL` استفاده کند." -msgid "Implements ``del name``, where *namei* is the index into :attr:`~codeobject.co_names` attribute of the :ref:`code object `." +msgid "" +"Implements ``del name``, where *namei* is the index " +"into :attr:`~codeobject.co_names` attribute of the :ref:`code object `." msgstr "" +"``del name`` را پیاده‌سازی می‌کند، که در آن *namei* اندیسی در " +"ویژگی :attr:`~codeobject.co_names` از :ref:`شیء کد ` است." -msgid "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the stack right-to-left. Require there to be exactly *count* values.::" +msgid "" +"Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " +"stack right-to-left. Require there to be exactly *count* values.::" msgstr "" +"``STACK[-1]`` را به *count* مقدار جداگانه واگشایی می‌کند، که این مقادیر به‌صورت " +"راست‌به‌چپ روی پشته قرار می‌گیرند. نیاز دارد که دقیقاً *count* مقدار وجود داشته " +"باشد.::" msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" msgstr "" +"assert(len(STACK[-1]) == count)\n" +"STACK.extend(STACK.pop()[:-count-1:-1])" -msgid "Implements assignment with a starred target: Unpacks an iterable in ``STACK[-1]`` into individual values, where the total number of values can be smaller than the number of items in the iterable: one of the new values will be a list of all leftover items." +msgid "" +"Implements assignment with a starred target: Unpacks an iterable in " +"``STACK[-1]`` into individual values, where the total number of values can be " +"smaller than the number of items in the iterable: one of the new values will " +"be a list of all leftover items." msgstr "" +"انتساب با یک هدف ستاره‌دار را پیاده‌سازی می‌کند: یک پیمایش‌پذیر موجود در " +"``STACK[-1]`` را به مقادیر جداگانه واگشایی می‌کند، که تعداد کل مقادیر می‌تواند " +"کمتر از تعداد آیتم‌های موجود در پیمایش‌پذیر باشد: یکی از مقادیر جدید، فهرستی از " +"تمام آیتم‌های باقی‌مانده خواهد بود." msgid "The number of values before and after the list value is limited to 255." -msgstr "" +msgstr "تعداد مقادیر پیش و پس از مقدار فهرست به ۲۵۵ محدود شده است." -msgid "The number of values before the list value is encoded in the argument of the opcode. The number of values after the list if any is encoded using an ``EXTENDED_ARG``. As a consequence, the argument can be seen as a two bytes values where the low byte of *counts* is the number of values before the list value, the high byte of *counts* the number of values after it." -msgstr "" +msgid "" +"The number of values before the list value is encoded in the argument of the " +"opcode. The number of values after the list if any is encoded using an " +"``EXTENDED_ARG``. As a consequence, the argument can be seen as a two bytes " +"values where the low byte of *counts* is the number of values before the list " +"value, the high byte of *counts* the number of values after it." +msgstr "" +"تعداد مقادیر پیش از مقدار فهرست در آرگومان کد عملیاتی (opcode) کدگذاری می‌شود. " +"تعداد مقادیر پس از فهرست، در صورت وجود، با استفاده از ``EXTENDED_ARG`` " +"کدگذاری می‌شود. در نتیجه، می‌توان آرگومان را به‌عنوان یک مقدار دو بایتی در نظر " +"گرفت که در آن بایت پایینی *counts* تعداد مقادیر پیش از مقدار فهرست و بایت " +"بالایی *counts* تعداد مقادیر پس از آن است." -msgid "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = d`` will be stored after execution as ``STACK.extend((a, b, c))``." +msgid "" +"The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " +"d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" +"مقادیر استخراج‌شده از راست به چپ روی پشته قرار می‌گیرند، یعنی ``a, *b, c = d`` " +"پس از اجرا به‌صورت ``STACK.extend((a, b, c))`` ذخیره می‌شود." msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" "obj.name = value" msgstr "" +"obj = STACK.pop()\n" +"value = STACK.pop()\n" +"obj.name = value" -msgid "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :ref:`code object `." +msgid "" +"where *namei* is the index of name in :attr:`~codeobject.co_names` of " +"the :ref:`code object `." msgstr "" +"که در آن *namei* اندیس name در :attr:`~codeobject.co_names` از :ref:`شیء کد " +"` است." msgid "" "obj = STACK.pop()\n" "del obj.name" msgstr "" +"obj = STACK.pop()\n" +"del obj.name" -msgid "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :ref:`code object `." +msgid "" +"where *namei* is the index of name into :attr:`~codeobject.co_names` of " +"the :ref:`code object `." msgstr "" +"که در آن *namei* اندیسِ name در :attr:`~codeobject.co_names` از :ref:`شیء کد " +"` است." msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" +"مانند :opcode:`STORE_NAME` عمل می‌کند، اما نام را به‌صورت سراسری ذخیره می‌کند." msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." -msgstr "" +msgstr "مانند :opcode:`DELETE_NAME` عمل می‌کند، اما یک نام سراسری را حذف می‌کند." msgid "Pushes ``co_consts[consti]`` onto the stack." -msgstr "" +msgstr "``co_consts[consti]`` را روی پشته می‌گذارد." msgid "Pushes the integer ``i`` onto the stack. ``i`` must be in ``range(256)``" msgstr "" +"عدد صحیح ``i`` را روی پشته قرار می‌دهد. ``i`` باید در ``range(256)`` باشد" -msgid "Pushes the value associated with ``co_names[namei]`` onto the stack. The name is looked up within the locals, then the globals, then the builtins." +msgid "" +"Pushes the value associated with ``co_names[namei]`` onto the stack. The name " +"is looked up within the locals, then the globals, then the builtins." msgstr "" +"مقدار مرتبط با ``co_names[namei]`` را روی پشته می‌گذارد. این نام ابتدا در فضای " +"نام محلی، سپس در فضای نام سراسری و سپس در توکارها جستجو می‌شود." -msgid "Pushes a reference to the locals dictionary onto the stack. This is used to prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :opcode:`LOAD_FROM_DICT_OR_GLOBALS`." +msgid "" +"Pushes a reference to the locals dictionary onto the stack. This is used to " +"prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` " +"and :opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" +"یک ارجاع به دیکشنری متغیرهای محلی را روی پشته قرار می‌دهد. این برای آماده‌سازی " +"دیکشنری‌های فضای نام برای :opcode:`LOAD_FROM_DICT_OR_DEREF` " +"و :opcode:`LOAD_FROM_DICT_OR_GLOBALS` استفاده می‌شود." -msgid "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. If the name is not found there, looks it up in the globals and then the builtins, similar to :opcode:`LOAD_GLOBAL`. This is used for loading global variables in :ref:`annotation scopes ` within class bodies." +msgid "" +"Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " +"If the name is not found there, looks it up in the globals and then the " +"builtins, similar to :opcode:`LOAD_GLOBAL`. This is used for loading global " +"variables in :ref:`annotation scopes ` within class bodies." msgstr "" +"یک نگاشت را از پشته برمی‌دارد و مقدار متناظر با ``co_names[namei]`` را جست‌وجو " +"می‌کند. اگر نام در آن یافت نشود، آن را در نام‌های سراسری و سپس در نام‌های توکار " +"جست‌وجو می‌کند، مشابه :opcode:`LOAD_GLOBAL`. این برای بارگذاری متغیرهای سراسری " +"در :ref:`محدوده‌های annotation ` در بدنه‌های کلاس استفاده " +"می‌شود." -msgid "Constructs a new :class:`~string.templatelib.Template` instance from a tuple of strings and a tuple of interpolations and pushes the resulting object onto the stack::" +msgid "" +"Constructs a new :class:`~string.templatelib.Template` instance from a tuple " +"of strings and a tuple of interpolations and pushes the resulting object onto " +"the stack::" msgstr "" +"یک نمونه‌ی :class:`~string.templatelib.Template` جدید را از یک تاپل از رشته‌ها و " +"یک تاپل از درون‌یابی‌ها می‌سازد و شیء حاصل را روی پشته قرار می‌دهد::" msgid "" "interpolations = STACK.pop()\n" "strings = STACK.pop()\n" "STACK.append(_build_template(strings, interpolations))" msgstr "" +"interpolations = STACK.pop()\n" +"strings = STACK.pop()\n" +"STACK.append(_build_template(strings, interpolations))" -msgid "Constructs a new :class:`~string.templatelib.Interpolation` instance from a value and its source expression and pushes the resulting object onto the stack." +msgid "" +"Constructs a new :class:`~string.templatelib.Interpolation` instance from a " +"value and its source expression and pushes the resulting object onto the " +"stack." msgstr "" +"نمونه‌ی جدیدی از :class:`~string.templatelib.Interpolation` را از یک مقدار و " +"عبارت منبع آن می‌سازد و شیء حاصل را روی پشته قرار می‌دهد." -msgid "If no conversion or format specification is present, ``format`` is set to ``2``." +msgid "" +"If no conversion or format specification is present, ``format`` is set to " +"``2``." msgstr "" +"اگر تبدیل یا مشخصه‌ی قالبی وجود نداشته باشد، ``format`` روی ``2`` تنظیم می‌شود." -msgid "If the low bit of ``format`` is set, it indicates that the interpolation contains a format specification." +msgid "" +"If the low bit of ``format`` is set, it indicates that the interpolation " +"contains a format specification." msgstr "" +"اگر بیت کم‌ارزش ``format`` تنظیم شده باشد، نشان می‌دهد که درون‌یابی " +"(interpolation) حاوی مشخصات قالب است." -msgid "If ``format >> 2`` is non-zero, it indicates that the interpolation contains a conversion. The value of ``format >> 2`` is the conversion type (``0`` for no conversion, ``1`` for ``!s``, ``2`` for ``!r``, and ``3`` for ``!a``)::" +msgid "" +"If ``format >> 2`` is non-zero, it indicates that the interpolation contains " +"a conversion. The value of ``format >> 2`` is the conversion type (``0`` for " +"no conversion, ``1`` for ``!s``, ``2`` for ``!r``, and ``3`` for ``!a``)::" msgstr "" +"اگر ``format >> 2`` غیرصفر باشد، نشان می‌دهد که درون‌یابی شامل یک تبدیل است. " +"مقدار ``format >> 2`` نوع تبدیل است (``0`` برای بدون تبدیل، ``1`` برای ``!" +"s``، ``2`` برای ``!r`` و ``3`` برای ``!a``)::" msgid "" "conversion = format >> 2\n" @@ -731,9 +1412,21 @@ msgid "" "value = STACK.pop()\n" "STACK.append(_build_interpolation(value, expression, conversion, format_spec))" msgstr "" +"conversion = format >> 2\n" +"if format & 1:\n" +" format_spec = STACK.pop()\n" +"else:\n" +" format_spec = None\n" +"expression = STACK.pop()\n" +"value = STACK.pop()\n" +"STACK.append(_build_interpolation(value, expression, conversion, format_spec))" -msgid "Creates a tuple consuming *count* items from the stack, and pushes the resulting tuple onto the stack::" +msgid "" +"Creates a tuple consuming *count* items from the stack, and pushes the " +"resulting tuple onto the stack::" msgstr "" +"با مصرف *count* آیتم از پشته، یک تاپل ایجاد می‌کند و تاپل حاصل را روی پشته " +"قرار می‌دهد::" msgid "" "if count == 0:\n" @@ -744,294 +1437,591 @@ msgid "" "\n" "STACK.append(value)" msgstr "" +"if count == 0:\n" +" value = ()\n" +"else:\n" +" value = tuple(STACK[-count:])\n" +" STACK = STACK[:-count]\n" +"\n" +"STACK.append(value)" msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." -msgstr "" +msgstr "مانند :opcode:`BUILD_TUPLE` عمل می‌کند، اما یک فهرست ایجاد می‌کند." msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." -msgstr "" +msgstr "مانند :opcode:`BUILD_TUPLE` عمل می‌کند، اما یک مجموعه می‌سازد." -msgid "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], STACK[-2]: STACK[-1]}``." +msgid "" +"Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " +"that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " +"STACK[-2]: STACK[-1]}``." msgstr "" +"یک شیء دیکشنری جدید را روی پشته قرار می‌دهد. ``2 * count`` آیتم را برمی‌دارد تا " +"دیکشنری دارای *count* آیتم باشد: ``{..., STACK[-4]: STACK[-3], STACK[-2]: " +"STACK[-1]}``." -msgid "The dictionary is created from stack items instead of creating an empty dictionary pre-sized to hold *count* items." +msgid "" +"The dictionary is created from stack items instead of creating an empty " +"dictionary pre-sized to hold *count* items." msgstr "" +"دیکشنری به‌جای ایجاد یک دیکشنری خالی با اندازه‌ی از پیش تعیین‌شده برای نگه‌داری " +"*count* آیتم، از آیتم‌های پشته ایجاد می‌شود." -msgid "Concatenates *count* strings from the stack and pushes the resulting string onto the stack." +msgid "" +"Concatenates *count* strings from the stack and pushes the resulting string " +"onto the stack." msgstr "" +"*count* رشته را از پشته به هم الحاق می‌کند و رشته‌ی حاصل را روی پشته می‌گذارد." msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" msgstr "" +"seq = STACK.pop()\n" +"list.extend(STACK[-i], seq)" msgid "Used to build lists." -msgstr "" +msgstr "برای ساخت فهرست‌ها استفاده می‌شود." msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" msgstr "" +"seq = STACK.pop()\n" +"set.update(STACK[-i], seq)" msgid "Used to build sets." -msgstr "" +msgstr "برای ساخت مجموعه‌ها استفاده می‌شود." msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" msgstr "" +"map = STACK.pop()\n" +"dict.update(STACK[-i], map)" msgid "Used to build dicts." -msgstr "" +msgstr "برای ساخت دیکشنری‌ها استفاده می‌شود." msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" +"مانند :opcode:`DICT_UPDATE` است، اما برای کلیدهای تکراری یک استثنا پرتاب " +"می‌کند." -msgid "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with ``getattr(STACK[-1], co_names[namei>>1])``." +msgid "" +"If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " +"``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" +"اگر بیت کم‌ارزش ``namei`` تنظیم نشده باشد، این عمل ``STACK[-1]`` را با " +"``getattr(STACK[-1], co_names[namei>>1])`` جایگزین می‌کند." -msgid "If the low bit of ``namei`` is set, this will attempt to load a method named ``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method with the correct name, the bytecode pushes the unbound method and ``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) by :opcode:`CALL` or :opcode:`CALL_KW` when calling the unbound method. Otherwise, ``NULL`` and the object returned by the attribute lookup are pushed." -msgstr "" +msgid "" +"If the low bit of ``namei`` is set, this will attempt to load a method named " +"``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " +"popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method " +"with the correct name, the bytecode pushes the unbound method and " +"``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) " +"by :opcode:`CALL` or :opcode:`CALL_KW` when calling the unbound method. " +"Otherwise, ``NULL`` and the object returned by the attribute lookup are " +"pushed." +msgstr "" +"اگر بیت کم‌ارزش ``namei`` تنظیم شده باشد، این بایت‌کد تلاش می‌کند متدی به نام " +"``co_names[namei>>1]`` را از شیء ``STACK[-1]`` بارگذاری کند. ``STACK[-1]`` از " +"پشته خارج می‌شود. این بایت‌کد دو حالت را تفکیک می‌کند: اگر ``STACK[-1]`` متدی با " +"نام صحیح داشته باشد، بایت‌کد متد غیرمقید و ``STACK[-1]`` را روی پشته قرار " +"می‌دهد. ``STACK[-1]`` به‌عنوان نخستین آرگومان (``self``) توسط :opcode:`CALL` " +"یا :opcode:`CALL_KW` هنگام فراخوانی متد غیرمقید استفاده خواهد شد. در غیر این " +"صورت، ``NULL`` و شیء برگردانده‌شده از جستجوی ویژگی روی پشته قرار می‌گیرند." -msgid "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to the stack before the attribute or unbound method respectively." +msgid "" +"If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " +"the stack before the attribute or unbound method respectively." msgstr "" +"اگر بیت کم‌ارزش ``namei`` تنظیم‌شده باشد، آنگاه ``NULL`` یا ``self`` به‌ترتیب " +"پیش از ویژگی یا متد غیرمقید به پشته فرستاده می‌شود." -msgid "This opcode implements :func:`super`, both in its zero-argument and two-argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, self).method()``, ``super(cls, self).attr``)." +msgid "" +"This opcode implements :func:`super`, both in its zero-argument and two-" +"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " +"self).method()``, ``super(cls, self).attr``)." msgstr "" +"این کد عملیاتی (opcode)، :func:`super` را در هر دو شکل بدون آرگومان و دو " +"آرگومانی پیاده‌سازی می‌کند (برای مثال ``super().method()``، ``super().attr`` و " +"``super(cls, self).method()``، ``super(cls, self).attr``)." msgid "It pops three values from the stack (from top of stack down):" -msgstr "" +msgstr "سه مقدار را از پشته برمی‌دارد (از بالای پشته به پایین):" msgid "``self``: the first argument to the current method" -msgstr "" +msgstr "``self``: نخستین آرگومان متد جاری" msgid "``cls``: the class within which the current method was defined" -msgstr "" +msgstr "``cls``: کلاسی که متد جاری در آن تعریف شده است" msgid "the global ``super``" -msgstr "" +msgstr "``super`` سراسری" -msgid "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, except that ``namei`` is shifted left by 2 bits instead of 1." +msgid "" +"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " +"except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" +"از نظر آرگومان خود، مانند :opcode:`LOAD_ATTR` عمل می‌کند، با این تفاوت که " +"``namei`` به جای ۱ بیت، ۲ بیت به چپ شیفت داده می‌شود." -msgid "The low bit of ``namei`` signals to attempt a method load, as with :opcode:`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When it is unset a single value is pushed to the stack." +msgid "" +"The low bit of ``namei`` signals to attempt a method load, as " +"with :opcode:`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded " +"method. When it is unset a single value is pushed to the stack." msgstr "" +"بیت پایینی ``namei`` نشان می‌دهد که باید برای بارگذاری یک متد تلاش شود، " +"مانند :opcode:`LOAD_ATTR`، که باعث می‌شود ``NULL`` و متد بارگذاری‌شده به پشته " +"فشار داده شوند. وقتی این بیت تنظیم‌نشده باشد، یک مقدار واحد به پشته فشار داده " +"می‌شود." -msgid "The second-low bit of ``namei``, if set, means that this was a two-argument call to :func:`super` (unset means zero-argument)." +msgid "" +"The second-low bit of ``namei``, if set, means that this was a two-argument " +"call to :func:`super` (unset means zero-argument)." msgstr "" +"دومین بیت کم‌ارزشِ ``namei``، اگر تنظیم‌شده باشد، به این معناست که این یک " +"فراخوانی با دو آرگومان به :func:`super` بوده است (تنظیم‌نشده به معنای صفر " +"آرگومان است)." -msgid "Performs a Boolean operation. The operation name can be found in ``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set (``opname & 16``), the result should be coerced to ``bool``." +msgid "" +"Performs a Boolean operation. The operation name can be found in " +"``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " +"(``opname & 16``), the result should be coerced to ``bool``." msgstr "" +"یک عملیات بولی انجام می‌دهد. نام عملیات را می‌توان در ``cmp_op[opname >> 5]`` " +"یافت. اگر پنجمین بیت از پایینِ ``opname`` برابر ۱ باشد (``opname & 16``)، " +"نتیجه باید به ``bool`` تبدیل شود." -msgid "The fifth-lowest bit of the oparg now indicates a forced conversion to :class:`bool`." +msgid "" +"The fifth-lowest bit of the oparg now indicates a forced conversion " +"to :class:`bool`." msgstr "" +"پنجمین بیت کم‌ارزشِ oparg اکنون نشان‌دهنده‌ی تبدیل اجباری به :class:`bool` است." msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" +"مقایسه‌ی ``is`` را انجام می‌دهد، یا اگر ``invert`` برابر ۱ باشد، مقایسه‌ی ``is " +"not`` را انجام می‌دهد." msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" +"مقایسه‌ی ``in`` را انجام می‌دهد، یا اگر ``invert`` برابر با ۱ باشد، مقایسه‌ی " +"``not in`` را انجام می‌دهد." -msgid "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are popped and provide the *fromlist* and *level* arguments of :func:`__import__`. The module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent :opcode:`STORE_FAST` instruction modifies the namespace." -msgstr "" +msgid "" +"Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " +"popped and provide the *fromlist* and *level* arguments " +"of :func:`__import__`. The module object is pushed onto the stack. The " +"current namespace is not affected: for a proper import statement, a " +"subsequent :opcode:`STORE_FAST` instruction modifies the namespace." +msgstr "" +"ماژول ``co_names[namei]`` را ایمپورت می‌کند. ``STACK[-1]`` و ``STACK[-2]`` از " +"پشته برداشته می‌شوند و آرگومان‌های *fromlist* و *level* برای :func:`__import__` " +"را فراهم می‌کنند. شیء ماژول روی پشته قرار می‌گیرد. فضای نام جاری تحت تأثیر قرار " +"نمی‌گیرد: برای یک دستور ایمپورت صحیح، یک دستورالعمل :opcode:`STORE_FAST` بعدی " +"فضای نام را تغییر می‌دهد." -msgid "Loads the attribute ``co_names[namei]`` from the module found in ``STACK[-1]``. The resulting object is pushed onto the stack, to be subsequently stored by a :opcode:`STORE_FAST` instruction." +msgid "" +"Loads the attribute ``co_names[namei]`` from the module found in " +"``STACK[-1]``. The resulting object is pushed onto the stack, to be " +"subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" +"ویژگی ``co_names[namei]`` را از ماژول یافت‌شده در ``STACK[-1]`` بارگذاری " +"می‌کند. شیء حاصل بر روی پشته قرار می‌گیرد تا سپس توسط یک " +"دستور :opcode:`STORE_FAST` ذخیره شود." msgid "Increments bytecode counter by *delta*." -msgstr "" +msgstr "شمارنده‌ی بایت‌کد را به اندازه‌ی *delta* افزایش می‌دهد." msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" +"شمارنده‌ی بایت‌کد را به اندازه‌ی *delta* کاهش می‌دهد. وقفه‌ها را بررسی می‌کند." msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." -msgstr "" +msgstr "شمارنده بایت‌کد را به اندازه *delta* کاهش می‌دهد. وقفه‌ها را بررسی نمی‌کند." -msgid "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. ``STACK[-1]`` is popped." +msgid "" +"If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" +"اگر ``STACK[-1]`` درست باشد، شمارنده‌ی بایت‌کد به میزان *delta* افزایش می‌یابد. " +"``STACK[-1]`` پاپ می‌شود." -msgid "The oparg is now a relative delta rather than an absolute target. This opcode is a pseudo-instruction, replaced in final bytecode by the directed versions (forward/backward)." +msgid "" +"The oparg is now a relative delta rather than an absolute target. This opcode " +"is a pseudo-instruction, replaced in final bytecode by the directed versions " +"(forward/backward)." msgstr "" +"oparg اکنون یک دلتای نسبی است، نه یک هدف مطلق. این کدعمل (opcode) یک " +"شبه‌دستور است که در بایت‌کد نهایی با نسخه‌های جهت‌دار (رو به جلو/رو به عقب) " +"جایگزین می‌شود." msgid "This is no longer a pseudo-instruction." -msgstr "" +msgstr "این دیگر یک شبه‌دستور نیست." -msgid "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. ``STACK[-1]`` is popped." +msgid "" +"If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" +"اگر ``STACK[-1]`` نادرست باشد، شمارنده‌ی بایت‌کد را به اندازه‌ی *delta* افزایش " +"می‌دهد. ``STACK[-1]`` پاپ می‌شود." -msgid "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by *delta*. ``STACK[-1]`` is popped." +msgid "" +"If ``STACK[-1]`` is not ``None``, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" +"اگر ``STACK[-1]`` برابر ``None`` نباشد، شمارنده بایت‌کد را به اندازه *delta* " +"افزایش می‌دهد. ``STACK[-1]`` پاپ می‌شود." -msgid "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. ``STACK[-1]`` is popped." +msgid "" +"If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" +"اگر ``STACK[-1]`` برابر ``None`` باشد، شمارنده بایت‌کد را به اندازه *delta* " +"افزایش می‌دهد. ``STACK[-1]`` برداشته می‌شود." -msgid "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If this yields a new value, push it on the stack (leaving the iterator below it). If the iterator indicates it is exhausted then the byte code counter is incremented by *delta*." +msgid "" +"``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " +"method. If this yields a new value, push it on the stack (leaving the " +"iterator below it). If the iterator indicates it is exhausted then the byte " +"code counter is incremented by *delta*." msgstr "" +"``STACK[-1]`` یک :term:`iterator` است. متد :meth:`~iterator.__next__` آن را " +"فراخوانی کنید. اگر این فراخوانی مقدار جدیدی برگرداند، آن را روی پشته قرار " +"دهید (در حالی که پیمایش‌گر زیر آن باقی می‌ماند). اگر پیمایش‌گر نشان دهد که به " +"پایان رسیده است، شمارنده‌ی بایت‌کد به اندازه‌ی *delta* افزایش می‌یابد." msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" +"تا پیش از 3.11، پیمایشگر هنگامی که به پایان می‌رسید، از پشته برداشته می‌شد." msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" +"متغیر سراسری با نام ``co_names[namei>>1]`` را بر روی پشته بارگذاری می‌کند." -msgid "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack before the global variable." +msgid "" +"If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " +"before the global variable." msgstr "" +"اگر بیت کم‌ارزشِ ``namei`` تنظیم شده باشد، یک ``NULL`` پیش از متغیر سراسری روی " +"پشته قرار می‌گیرد." msgid "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." -msgstr "" +msgstr "ارجاعی به متغیر محلی ``co_varnames[var_num]`` را روی پشته می‌گذارد." -msgid "This opcode is now only used in situations where the local variable is guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." +msgid "" +"This opcode is now only used in situations where the local variable is " +"guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" +"این کد عملیاتی (opcode) اکنون تنها در موقعیت‌هایی استفاده می‌شود که مقداردهی " +"اولیه‌ی متغیر locale تضمین‌شده باشد. نمی‌تواند :exc:`UnboundLocalError` را پرتاب " +"کند." -msgid "Pushes a borrowed reference to the local ``co_varnames[var_num]`` onto the stack." +msgid "" +"Pushes a borrowed reference to the local ``co_varnames[var_num]`` onto the " +"stack." msgstr "" +"یک ارجاع قرضی به متغیر محلی ``co_varnames[var_num]`` را روی پشته قرار می‌دهد." -msgid "Pushes references to ``co_varnames[var_nums >> 4]`` and ``co_varnames[var_nums & 15]`` onto the stack." +msgid "" +"Pushes references to ``co_varnames[var_nums >> 4]`` and " +"``co_varnames[var_nums & 15]`` onto the stack." msgstr "" +"ارجاع‌ها به ``co_varnames[var_nums >> 4]`` و ``co_varnames[var_nums & 15]`` را " +"روی پشته می‌گذارد." -msgid "Pushes borrowed references to ``co_varnames[var_nums >> 4]`` and ``co_varnames[var_nums & 15]`` onto the stack." +msgid "" +"Pushes borrowed references to ``co_varnames[var_nums >> 4]`` and " +"``co_varnames[var_nums & 15]`` onto the stack." msgstr "" +"ارجاع‌های قرضی به ``co_varnames[var_nums >> 4]`` و ``co_varnames[var_nums & " +"15]`` را روی پشته قرار می‌دهد." -msgid "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, raising an :exc:`UnboundLocalError` if the local variable has not been initialized." +msgid "" +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " +"raising an :exc:`UnboundLocalError` if the local variable has not been " +"initialized." msgstr "" +"ارجاعی به متغیر محلی ``co_varnames[var_num]`` را روی پشته قرار می‌دهد و اگر " +"متغیر محلی مقداردهی اولیه نشده باشد، یک :exc:`UnboundLocalError` پرتاب می‌کند." -msgid "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or pushes ``NULL`` onto the stack if the local variable has not been initialized) and sets ``co_varnames[var_num]`` to ``NULL``." +msgid "" +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " +"pushes ``NULL`` onto the stack if the local variable has not been " +"initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" +"ارجاعی به متغیر محلی ``co_varnames[var_num]`` را روی پشته می‌گذارد (یا اگر " +"متغیر محلی مقداردهی اولیه نشده باشد، ``NULL`` را روی پشته می‌گذارد) و " +"``co_varnames[var_num]`` را ``NULL`` قرار می‌دهد." msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." -msgstr "" +msgstr "``STACK.pop()`` را در متغیر محلی ``co_varnames[var_num]`` ذخیره می‌کند." -msgid "Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` into ``co_varnames[var_nums & 15]``." +msgid "" +"Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " +"into ``co_varnames[var_nums & 15]``." msgstr "" +"``STACK[-1]`` را در ``co_varnames[var_nums >> 4]`` و ``STACK[-2]`` را در " +"``co_varnames[var_nums & 15]`` ذخیره می‌کند." -msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the stack." +msgid "" +"Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " +"pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the stack." msgstr "" +"``STACK.pop()`` را در متغیر محلی ``co_varnames[var_nums >> 4]`` ذخیره می‌کند و " +"ارجاعی به متغیر محلی ``co_varnames[var_nums & 15]`` را روی پشته قرار می‌دهد." msgid "Deletes local ``co_varnames[var_num]``." -msgstr "" +msgstr "متغیر محلی ``co_varnames[var_num]`` را حذف می‌کند." -msgid "Creates a new cell in slot ``i``. If that slot is nonempty then that value is stored into the new cell." +msgid "" +"Creates a new cell in slot ``i``. If that slot is nonempty then that value " +"is stored into the new cell." msgstr "" +"یک سلول جدید در جایگاه (slot) ``i`` ایجاد می‌کند. اگر آن جایگاه خالی نباشد، آن " +"مقدار در سلول جدید ذخیره می‌شود." -msgid "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. Pushes a reference to the object the cell contains on the stack." +msgid "" +"Loads the cell contained in slot ``i`` of the \"fast locals\" storage. Pushes " +"a reference to the object the cell contains on the stack." msgstr "" +"سلول (cell) موجود در جایگاه (slot) ``i`` از فضای ذخیره‌سازی «fast locals» را " +"بارگذاری می‌کند. ارجاعی به شیء درون سلول را روی پشته قرار می‌دهد." -msgid "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." +msgid "" +"``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" +"``i`` دیگر به اندازه‌ی طول :attr:`~codeobject.co_varnames` جابجا (offset) " +"نمی‌شود." -msgid "Pops a mapping off the stack and looks up the name associated with slot ``i`` of the \"fast locals\" storage in this mapping. If the name is not found there, loads it from the cell contained in slot ``i``, similar to :opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables ` in class bodies (which previously used :opcode:`!LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within class bodies." -msgstr "" +msgid "" +"Pops a mapping off the stack and looks up the name associated with slot ``i`` " +"of the \"fast locals\" storage in this mapping. If the name is not found " +"there, loads it from the cell contained in slot ``i``, similar " +"to :opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"` in class bodies (which previously used :opcode:`!" +"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " +"class bodies." +msgstr "" +"یک نگاشت را از پشته برمی‌دارد و نام مرتبط با جایگاه ``i`` در فضای ذخیره‌سازی " +"«fast locals» را در این نگاشت جستجو می‌کند. اگر نام در آن‌جا پیدا نشود، آن را " +"از سلول موجود در جایگاه ``i`` بارگذاری می‌کند، مشابه :opcode:`LOAD_DEREF`. این " +"برای بارگذاری :term:`متغیرهای closure ` در بدنه‌ی کلاس‌ها (که " +"پیش‌تر از :opcode:`!LOAD_CLASSDEREF` استفاده می‌شد) و در :ref:`محدوده‌های " +"annotation ` در داخل بدنه‌ی کلاس‌ها استفاده می‌شود." -msgid "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast locals\" storage." +msgid "" +"Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " +"locals\" storage." msgstr "" +"``STACK.pop()`` را در سلول موجود در جایگاه ``i`` از فضای ذخیره‌سازی «fast " +"locals» ذخیره می‌کند." -msgid "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. Used by the :keyword:`del` statement." +msgid "" +"Empties the cell contained in slot ``i`` of the \"fast locals\" storage. Used " +"by the :keyword:`del` statement." msgstr "" +"سلول موجود در جایگاه ``i`` از فضای ذخیره‌سازی «fast locals» را خالی می‌کند. توسط " +"دستور :keyword:`del` استفاده می‌شود." -msgid "Copies the ``n`` :term:`free (closure) variables ` from the closure into the frame. Removes the need for special code on the caller's side when calling closures." +msgid "" +"Copies the ``n`` :term:`free (closure) variables ` from the " +"closure into the frame. Removes the need for special code on the caller's " +"side when calling closures." msgstr "" +"``n`` :term:`متغیرهای بستار (closure) ` را از بستار (closure) " +"به فریم کپی می‌کند. نیاز به کد خاص در سمت فراخواننده هنگام فراخوانی " +"بسته‌ها را حذف می‌کند." -msgid "Raises an exception using one of the 3 forms of the ``raise`` statement, depending on the value of *argc*:" +msgid "" +"Raises an exception using one of the 3 forms of the ``raise`` statement, " +"depending on the value of *argc*:" msgstr "" +"با استفاده از یکی از ۳ شکل دستور ``raise``، بسته به مقدار *argc*، استثنایی را " +"پرتاب می‌کند:" msgid "0: ``raise`` (re-raise previous exception)" -msgstr "" +msgstr "0: ``raise`` (پرتاب مجدد استثنای قبلی)" -msgid "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" -msgstr "" +msgid "" +"1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" +msgstr "1: ``raise STACK[-1]`` (پرتاب نمونه یا نوع استثنا در ``STACK[-1]``)" -msgid "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at ``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" +msgid "" +"2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " +"``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" +"2: ``raise STACK[-2] from STACK[-1]`` (پرتاب نمونه یا نوع استثنای موجود در " +"``STACK[-2]`` که ``__cause__`` آن به ``STACK[-1]`` تنظیم شده است)" -msgid "Calls a callable object with the number of arguments specified by ``argc``. On the stack are (in ascending order):" +msgid "" +"Calls a callable object with the number of arguments specified by ``argc``. " +"On the stack are (in ascending order):" msgstr "" +"یک شیء فراخوان‌پذیر را با تعداد آرگومان‌های مشخص‌شده توسط ``argc`` فراخوانی " +"می‌کند. روی پشته (به ترتیب صعودی) این موارد قرار دارند:" msgid "The callable" -msgstr "" +msgstr "شیء قابل فراخوانی" msgid "``self`` or ``NULL``" -msgstr "" +msgstr "``self`` یا ``NULL``" msgid "The remaining positional arguments" -msgstr "" +msgstr "آرگومان‌های جایگاهی باقی‌مانده" msgid "``argc`` is the total of the positional arguments, excluding ``self``." -msgstr "" +msgstr "``argc`` تعداد کل آرگومان‌های جایگاهی است، بدون احتساب ``self``." -msgid "``CALL`` pops all arguments and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object." +msgid "" +"``CALL`` pops all arguments and the callable object off the stack, calls the " +"callable object with those arguments, and pushes the return value returned by " +"the callable object." msgstr "" +"``CALL`` تمام آرگومان‌ها و شیء فراخوانی‌پذیر را از پشته برمی‌دارد، شیء " +"فراخوانی‌پذیر را با آن آرگومان‌ها فراخوانی می‌کند و مقدار بازگشتی برگردانده‌شده " +"توسط شیء فراخوانی‌پذیر را روی پشته می‌گذارد." msgid "The callable now always appears at the same position on the stack." -msgstr "" +msgstr "شیء فراخوان‌پذیر اکنون همیشه در جایگاه یکسانی در پشته ظاهر می‌شود." msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" +"فراخوانی‌های دارای آرگومان کلیدواژه‌ای اکنون توسط :opcode:`CALL_KW` مدیریت " +"می‌شوند." -msgid "Calls a callable object with the number of arguments specified by ``argc``, including one or more named arguments. On the stack are (in ascending order):" +msgid "" +"Calls a callable object with the number of arguments specified by ``argc``, " +"including one or more named arguments. On the stack are (in ascending order):" msgstr "" +"یک شیء فراخوان‌پذیر را با تعداد آرگومان‌های مشخص‌شده توسط ``argc``، شامل یک یا " +"چند آرگومان نام‌دار، فراخوانی می‌کند. روی پشته قرار دارند (به ترتیب صعودی):" msgid "The named arguments" -msgstr "" +msgstr "آرگومان‌های نام‌دار" msgid "A :class:`tuple` of keyword argument names" -msgstr "" +msgstr "یک :class:`tuple` از نام‌های آرگومان‌های کلیدواژه‌ای" -msgid "``argc`` is the total of the positional and named arguments, excluding ``self``. The length of the tuple of keyword argument names is the number of named arguments." +msgid "" +"``argc`` is the total of the positional and named arguments, excluding " +"``self``. The length of the tuple of keyword argument names is the number of " +"named arguments." msgstr "" +"``argc`` مجموع تعداد آرگومان‌های جایگاهی و نام‌دار، به‌جز ``self``، است. طول " +"تاپل نام‌های آرگومان کلیدواژه‌ای برابر با تعداد آرگومان‌های نام‌دار است." -msgid "``CALL_KW`` pops all arguments, the keyword names, and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object." +msgid "" +"``CALL_KW`` pops all arguments, the keyword names, and the callable object " +"off the stack, calls the callable object with those arguments, and pushes the " +"return value returned by the callable object." msgstr "" +"``CALL_KW`` تمام آرگومان‌ها، نام‌های کلیدواژه‌ای و شیء قابل فراخوانی را از پشته " +"برمی‌دارد، شیء قابل فراخوانی را با آن آرگومان‌ها فراخوانی می‌کند و مقدار بازگشتی " +"را که شیء قابل فراخوانی برمی‌گرداند، روی پشته قرار می‌دهد." -msgid "Calls a callable object with variable set of positional and keyword arguments. If the lowest bit of *flags* is set, the top of the stack contains a mapping object containing additional keyword arguments. Before the callable is called, the mapping object and iterable object are each \"unpacked\" and their contents passed in as keyword and positional arguments respectively. ``CALL_FUNCTION_EX`` pops all arguments and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object." -msgstr "" +msgid "" +"Calls a callable object with variable set of positional and keyword " +"arguments. If the lowest bit of *flags* is set, the top of the stack " +"contains a mapping object containing additional keyword arguments. Before the " +"callable is called, the mapping object and iterable object are each " +"\"unpacked\" and their contents passed in as keyword and positional arguments " +"respectively. ``CALL_FUNCTION_EX`` pops all arguments and the callable object " +"off the stack, calls the callable object with those arguments, and pushes the " +"return value returned by the callable object." +msgstr "" +"یک شیء فراخوان‌پذیر را با مجموعه‌ای متغیر از آرگومان‌های جایگاهی و کلیدواژه‌ای " +"فراخوانی می‌کند. اگر پایین‌ترین بیت *flags* تنظیم شده باشد، بالای پشته شامل یک " +"شیء نگاشت است که حاوی آرگومان‌های کلیدواژه‌ای اضافی است. پیش از فراخوانی شیء " +"فراخوان‌پذیر، شیء نگاشت و شیء پیمایش‌پذیر هرکدام «واگشایی» می‌شوند و محتویات آن‌ها " +"به‌ترتیب به‌عنوان آرگومان‌های کلیدواژه‌ای و جایگاهی ارسال می‌شوند. " +"``CALL_FUNCTION_EX`` تمام آرگومان‌ها و شیء فراخوان‌پذیر را از پشته برمی‌دارد، " +"شیء فراخوان‌پذیر را با آن آرگومان‌ها فراخوانی می‌کند و مقدار بازگشتی " +"برگردانده‌شده توسط شیء فراخوان‌پذیر را بر پشته می‌گذارد." -msgid "Pushes a ``NULL`` to the stack. Used in the call sequence to match the ``NULL`` pushed by :opcode:`!LOAD_METHOD` for non-method calls." +msgid "" +"Pushes a ``NULL`` to the stack. Used in the call sequence to match the " +"``NULL`` pushed by :opcode:`!LOAD_METHOD` for non-method calls." msgstr "" +"یک ``NULL`` را روی پشته قرار می‌دهد. در دنباله‌ی فراخوانی استفاده می‌شود تا با " +"``NULL``\\ ای که توسط :opcode:`!LOAD_METHOD` برای فراخوانی‌های غیرمتدی روی " +"پشته قرار گرفته است، مطابقت داشته باشد." -msgid "Pushes a new function object on the stack built from the code object at ``STACK[-1]``." +msgid "" +"Pushes a new function object on the stack built from the code object at " +"``STACK[-1]``." msgstr "" +"یک شیء تابع جدید را که از شیء کد در ``STACK[-1]`` ساخته شده است، روی پشته " +"می‌گذارد." msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" -msgstr "" +msgstr "مقدار پرچم ``0x04`` به‌جای دیکشنری، یک تاپل از رشته‌ها است" msgid "Qualified name at ``STACK[-1]`` was removed." -msgstr "" +msgstr "نام کامل (qualified name) در ``STACK[-1]`` حذف شد." -msgid "Extra function attributes on the stack, signaled by oparg flags, were removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." +msgid "" +"Extra function attributes on the stack, signaled by oparg flags, were " +"removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" +"ویژگی‌های اضافی تابع روی پشته، که با پرچم‌های oparg مشخص می‌شدند، حذف شدند. " +"اکنون برای آن‌ها از :opcode:`SET_FUNCTION_ATTRIBUTE` استفاده می‌شود." -msgid "Sets an attribute on a function object. Expects the function at ``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both and leaves the function at ``STACK[-1]``. The flag determines which attribute to set:" +msgid "" +"Sets an attribute on a function object. Expects the function at ``STACK[-1]`` " +"and the attribute value to set at ``STACK[-2]``; consumes both and leaves the " +"function at ``STACK[-1]``. The flag determines which attribute to set:" msgstr "" +"یک ویژگی را روی یک شیء تابع تنظیم می‌کند. انتظار دارد که تابع در ``STACK[-1]`` " +"و مقدار ویژگی برای تنظیم در ``STACK[-2]`` قرار داشته باشد؛ هر دو را مصرف " +"می‌کند و تابع را در ``STACK[-1]`` باقی می‌گذارد. پرچم تعیین می‌کند کدام ویژگی " +"تنظیم شود:" -msgid "``0x01`` a tuple of default values for positional-only and positional-or-keyword parameters in positional order" +msgid "" +"``0x01`` a tuple of default values for positional-only and positional-or-" +"keyword parameters in positional order" msgstr "" +"``0x01`` یک تاپل از مقادیر پیش‌فرض برای پارامترهای فقط جایگاهی و جایگاهی یا " +"کلیدواژه‌ای به ترتیب جایگاهی" msgid "``0x02`` a dictionary of keyword-only parameters' default values" -msgstr "" +msgstr "``0x02`` یک دیکشنری از مقادیر پیش‌فرض پارامترهای فقط کلیدواژه‌ای" msgid "``0x04`` a tuple of strings containing parameters' annotations" -msgstr "" +msgstr "``0x04`` یک تاپل از رشته‌ها شامل حاشیه‌نویسی‌های پارامترها" msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" +"``0x08`` یک تاپل حاوی سلول‌هایی برای متغیرهای آزاد، که یک بستار (closure) می‌سازد" msgid "``0x10`` the :term:`annotate function` for the function object" -msgstr "" +msgstr "``0x10`` :term:`annotate function` برای شیء تابع" -msgid "Added ``0x10`` to indicate the annotate function for the function object." -msgstr "" +msgid "" +"Added ``0x10`` to indicate the annotate function for the function object." +msgstr "``0x10`` برای نشان دادن تابع حاشیه‌نویسی (annotate) شیء تابع اضافه شد." -msgid "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, implements::" +msgid "" +"Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " +"implements::" msgstr "" +"یک شیء برش (slice) را روی پشته قرار می‌دهد. *argc* باید ۲ یا ۳ باشد. اگر ۲ " +"باشد، پیاده‌سازی می‌کند::" msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end))" msgid "if it is 3, implements::" -msgstr "" +msgstr "اگر ۳ باشد، پیاده‌سازی می‌کند::" msgid "" "step = STACK.pop()\n" @@ -1039,45 +2029,63 @@ msgid "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" msgstr "" +"step = STACK.pop()\n" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end, step))" msgid "See the :func:`slice` built-in function for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، تابع توکار :func:`slice` را ببینید." -msgid "Prefixes any opcode which has an argument too big to fit into the default one byte. *ext* holds an additional byte which act as higher bits in the argument. For each opcode, at most three prefixal ``EXTENDED_ARG`` are allowed, forming an argument from two-byte to four-byte." +msgid "" +"Prefixes any opcode which has an argument too big to fit into the default one " +"byte. *ext* holds an additional byte which act as higher bits in the " +"argument. For each opcode, at most three prefixal ``EXTENDED_ARG`` are " +"allowed, forming an argument from two-byte to four-byte." msgstr "" +"قبل از هر کد عملیاتی (opcode) که آرگومان آن آن‌قدر بزرگ است که در ۱ بایت " +"پیش‌فرض نمی‌گنجد، به‌عنوان پیشوند قرار می‌گیرد. *ext* یک بایت اضافی را نگه می‌دارد " +"که به‌عنوان بیت‌های بالاتر آرگومان عمل می‌کند. برای هر کد عملیاتی، حداکثر ۳ " +"``EXTENDED_ARG`` پیشوندی مجاز است تا آرگومانی از ۲ بایت تا ۴ بایت تشکیل دهند." msgid "Convert value to a string, depending on ``oparg``::" -msgstr "" +msgstr "مقدار را به رشته تبدیل می‌کند، بسته به ``oparg``::" msgid "" "value = STACK.pop()\n" "result = func(value)\n" "STACK.append(result)" msgstr "" +"value = STACK.pop()\n" +"result = func(value)\n" +"STACK.append(result)" msgid "``oparg == 1``: call :func:`str` on *value*" -msgstr "" +msgstr "``oparg == 1``: تابع :func:`str` را روی *value* فراخوانی کنید" msgid "``oparg == 2``: call :func:`repr` on *value*" -msgstr "" +msgstr "``oparg == 2``: :func:`repr` را روی *value* فراخوانی می‌کند" msgid "``oparg == 3``: call :func:`ascii` on *value*" -msgstr "" +msgstr "``oparg == 3``: :func:`ascii` روی *value* فراخوانی می‌شود" msgid "Used for implementing formatted string literals (f-strings)." -msgstr "" +msgstr "برای پیاده‌سازی مقادیر لفظی رشته قالب‌بندی‌شده (اف‌استرینگ‌ها) استفاده می‌شود." msgid "Formats the value on top of stack::" -msgstr "" +msgstr "مقدار بالای پشته را قالب‌بندی می‌کند::" msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" "STACK.append(result)" msgstr "" +"value = STACK.pop()\n" +"result = value.__format__(\"\")\n" +"STACK.append(result)" msgid "Formats the given value with the given format spec::" -msgstr "" +msgstr "مقدار داده‌شده را با مشخصه قالب داده‌شده قالب‌بندی می‌کند::" msgid "" "spec = STACK.pop()\n" @@ -1085,147 +2093,232 @@ msgid "" "result = value.__format__(spec)\n" "STACK.append(result)" msgstr "" +"spec = STACK.pop()\n" +"value = STACK.pop()\n" +"result = value.__format__(spec)\n" +"STACK.append(result)" -msgid "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the class being matched against, and ``STACK[-3]`` is the match subject. *count* is the number of positional sub-patterns." +msgid "" +"``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " +"class being matched against, and ``STACK[-3]`` is the match subject. *count* " +"is the number of positional sub-patterns." msgstr "" +"``STACK[-1]`` تاپلی از نام ویژگی‌های کلیدواژه‌ای است، ``STACK[-2]`` کلاسی است " +"که با آن تطبیق داده می‌شود، و ``STACK[-3]`` موضوع تطبیق است. *count* تعداد " +"زیرالگوهای جایگاهی است." -msgid "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an instance of ``STACK[-2]`` and has the positional and keyword attributes required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. Otherwise, push ``None``." +msgid "" +"Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " +"instance of ``STACK[-2]`` and has the positional and keyword attributes " +"required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. " +"Otherwise, push ``None``." msgstr "" +"``STACK[-1]``، ``STACK[-2]`` و ``STACK[-3]`` را از پشته بردارید. اگر " +"``STACK[-3]`` نمونه‌ای از ``STACK[-2]`` باشد و دارای ویژگی‌های جایگاهی و " +"کلیدواژه‌ای مورد نیاز *count* و ``STACK[-1]`` باشد، یک تاپل از ویژگی‌های " +"استخراج‌شده را روی پشته قرار دهید. در غیر این صورت، ``None`` را روی پشته قرار " +"دهید." msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" +"عملیات بی‌اثر (no-op). بررسی‌های ردگیری داخلی، اشکال‌زدایی و بهینه‌سازی را انجام " +"می‌دهد." -msgid "The ``context`` operand consists of two parts. The lowest two bits indicate where the ``RESUME`` occurs:" +msgid "" +"The ``context`` operand consists of two parts. The lowest two bits indicate " +"where the ``RESUME`` occurs:" msgstr "" +"عملوند ``context`` از دو بخش تشکیل شده است. دو بیت کم‌ارزش نشان می‌دهند که " +"``RESUME`` کجا رخ می‌دهد:" -msgid "``0`` The start of a function, which is neither a generator, coroutine nor an async generator" -msgstr "" +msgid "" +"``0`` The start of a function, which is neither a generator, coroutine nor an " +"async generator" +msgstr "``0`` آغاز تابعی که نه تولیدگر، نه هم‌روال و نه تولیدگر ناهمگام است" msgid "``1`` After a ``yield`` expression" -msgstr "" +msgstr "``1`` پس از یک عبارت ``yield``" msgid "``2`` After a ``yield from`` expression" -msgstr "" +msgstr "``2`` پس از یک عبارت ``yield from``" msgid "``3`` After an ``await`` expression" -msgstr "" +msgstr "``3`` پس از یک عبارت ``await``" -msgid "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` otherwise." +msgid "" +"The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " +"otherwise." msgstr "" +"بیت بعدی، اگر RESUME در عمق استثنا (except-depth) ``1`` باشد، ``1`` است و در " +"غیر این صورت ``0`` است." msgid "The oparg value changed to include information about except-depth" msgstr "" +"مقدار oparg تغییر کرد تا شامل اطلاعاتی درباره‌ی عمق استثنا (except-depth) شود." -msgid "Create a generator, coroutine, or async generator from the current frame. Used as first opcode of in code object for the above mentioned callables. Clear the current frame and return the newly created generator." +msgid "" +"Create a generator, coroutine, or async generator from the current frame. " +"Used as first opcode of in code object for the above mentioned callables. " +"Clear the current frame and return the newly created generator." msgstr "" +"یک تولیدگر، هم‌روال یا تولیدگر ناهمگام از فریم جاری ایجاد می‌کند. به‌عنوان " +"نخستین کد عملیات (opcode) در شیء کد برای موارد فراخوانی‌پذیر ذکرشده در بالا " +"استفاده می‌شود. فریم جاری را پاک می‌کند و تولیدگر تازه‌ساخته را برمی‌گرداند." -msgid "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield from`` and ``await`` statements." +msgid "" +"Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " +"from`` and ``await`` statements." msgstr "" +"معادل ``STACK[-1] = STACK[-2].send(STACK[-1])`` است. در دستورات ``yield " +"from`` و ``await`` استفاده می‌شود." -msgid "If the call raises :exc:`StopIteration`, pop the top value from the stack, push the exception's ``value`` attribute, and increment the bytecode counter by *delta*." +msgid "" +"If the call raises :exc:`StopIteration`, pop the top value from the stack, " +"push the exception's ``value`` attribute, and increment the bytecode counter " +"by *delta*." msgstr "" +"اگر فراخوانی :exc:`StopIteration` را پرتاب کند، مقدار سر پشته را بردارید، " +"ویژگی ``value`` استثنا را بر پشته بگذارید و شمارنده بایت‌کد را به اندازه‌ی " +"*delta* افزایش دهید." -msgid "This is not really an opcode. It identifies the dividing line between opcodes in the range [0,255] which don't use their argument and those that do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." +msgid "" +"This is not really an opcode. It identifies the dividing line between " +"opcodes in the range [0,255] which don't use their argument and those that do " +"(``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" +"این واقعاً یک کد عملیاتی (opcode) نیست. این خط جداکننده‌ی میان کدهای عملیاتی در " +"بازه‌ی [۰،۲۵۵] را مشخص می‌کند: میان کدهایی که از آرگومان خود استفاده نمی‌کنند و " +"کدهایی که استفاده می‌کنند (به‌ترتیب ``< HAVE_ARGUMENT`` و ``>= HAVE_ARGUMENT``)." -msgid "If your application uses pseudo instructions or specialized instructions, use the :data:`hasarg` collection instead." +msgid "" +"If your application uses pseudo instructions or specialized instructions, use " +"the :data:`hasarg` collection instead." msgstr "" +"اگر برنامه‌ی شما از شبه‌دستورالعمل‌ها یا دستورالعمل‌های تخصصی استفاده می‌کند، در " +"عوض از مجموعه‌ی :data:`hasarg` استفاده کنید." -msgid "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." +msgid "" +"Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` ignore " +"it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" +"اکنون هر دستورالعمل یک آرگومان دارد، اما opcodeهای ``< HAVE_ARGUMENT`` آن را " +"در نظر نمی‌گیرند. پیش از این، فقط opcodeهای ``>= HAVE_ARGUMENT`` آرگومان " +"داشتند." -msgid "Pseudo instructions were added to the :mod:`!dis` module, and for them it is not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use their arg." +msgid "" +"Pseudo instructions were added to the :mod:`!dis` module, and for them it is " +"not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " +"their arg." msgstr "" +"شبه‌دستورالعمل‌ها به ماژول :mod:`!dis` افزوده شدند، و در مورد آن‌ها مقایسه با " +"``HAVE_ARGUMENT`` نشان نمی‌دهد که آیا از آرگومان خود استفاده می‌کنند." msgid "Use :data:`hasarg` instead." -msgstr "" +msgstr "به‌جای آن از :data:`hasarg` استفاده کنید." -msgid "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the argument and sets ``STACK[-1]`` to the result. Used to implement functionality that is not performance critical." +msgid "" +"Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " +"argument and sets ``STACK[-1]`` to the result. Used to implement " +"functionality that is not performance critical." msgstr "" +"یک تابع ذاتی (intrinsic function) را با یک آرگومان فراخوانی می‌کند. " +"``STACK[-1]`` را به‌عنوان آرگومان ارسال می‌کند و ``STACK[-1]`` را برابر با " +"نتیجه قرار می‌دهد. برای پیاده‌سازی قابلیتی استفاده می‌شود که از نظر کارایی حیاتی " +"نیست." msgid "The operand determines which intrinsic function is called:" -msgstr "" +msgstr "عملوند تعیین می‌کند که کدام تابع ذاتی فراخوانی می‌شود:" msgid "Operand" -msgstr "" +msgstr "عملوند" msgid "Description" -msgstr "" +msgstr "توضیحات" msgid "``INTRINSIC_1_INVALID``" -msgstr "" +msgstr "``INTRINSIC_1_INVALID``" msgid "Not valid" -msgstr "" +msgstr "نامعتبر" msgid "``INTRINSIC_PRINT``" -msgstr "" +msgstr "``INTRINSIC_PRINT``" msgid "Prints the argument to standard out. Used in the REPL." -msgstr "" +msgstr "آرگومان را در خروجی استاندارد چاپ می‌کند. در REPL استفاده می‌شود." msgid "``INTRINSIC_IMPORT_STAR``" -msgstr "" +msgstr "``INTRINSIC_IMPORT_STAR``" msgid "Performs ``import *`` for the named module." -msgstr "" +msgstr "``import *`` را برای ماژول نام‌برده‌شده اجرا می‌کند." msgid "``INTRINSIC_STOPITERATION_ERROR``" -msgstr "" +msgstr "``INTRINSIC_STOPITERATION_ERROR``" msgid "Extracts the return value from a ``StopIteration`` exception." -msgstr "" +msgstr "مقدار بازگشتی را از یک استثنای ``StopIteration`` استخراج می‌کند." msgid "``INTRINSIC_ASYNC_GEN_WRAP``" -msgstr "" +msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" msgid "Wraps an async generator value" -msgstr "" +msgstr "یک مقدار تولیدگر ناهمگام را دربر می‌گیرد" msgid "``INTRINSIC_UNARY_POSITIVE``" -msgstr "" +msgstr "``INTRINSIC_UNARY_POSITIVE``" msgid "Performs the unary ``+`` operation" -msgstr "" +msgstr "عملیات ``+`` یک‌عملوندی را انجام می‌دهد" msgid "``INTRINSIC_LIST_TO_TUPLE``" -msgstr "" +msgstr "``INTRINSIC_LIST_TO_TUPLE``" msgid "Converts a list to a tuple" -msgstr "" +msgstr "یک فهرست را به تاپلتبدیل می‌کند" msgid "``INTRINSIC_TYPEVAR``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR``" msgid "Creates a :class:`typing.TypeVar`" -msgstr "" +msgstr "یک :class:`typing.TypeVar` ایجاد می‌کند" msgid "``INTRINSIC_PARAMSPEC``" -msgstr "" +msgstr "``INTRINSIC_PARAMSPEC``" msgid "Creates a :class:`typing.ParamSpec`" -msgstr "" +msgstr "یک :class:`typing.ParamSpec` ایجاد می‌کند" msgid "``INTRINSIC_TYPEVARTUPLE``" -msgstr "" +msgstr "``INTRINSIC_TYPEVARTUPLE``" msgid "Creates a :class:`typing.TypeVarTuple`" -msgstr "" +msgstr "یک :class:`typing.TypeVarTuple` ایجاد می‌کند" msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" -msgstr "" +msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" msgid "Returns :class:`typing.Generic` subscripted with the argument" -msgstr "" +msgstr ":class:`typing.Generic` زیرنویس‌شده با آرگومان را برمی‌گرداند" msgid "``INTRINSIC_TYPEALIAS``" -msgstr "" +msgstr "``INTRINSIC_TYPEALIAS``" -msgid "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` statement. The argument is a tuple of the type alias's name, type parameters, and value." +msgid "" +"Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " +"statement. The argument is a tuple of the type alias's name, type parameters, " +"and value." msgstr "" +"یک :class:`typing.TypeAliasType` ایجاد می‌کند؛ در دستور :keyword:`type` " +"استفاده می‌شود. آرگومان، تاپلی از نام، پارامترهای نوع و مقدار نام‌مستعار نوع " +"است." -msgid "Calls an intrinsic function with two arguments. Used to implement functionality that is not performance critical::" +msgid "" +"Calls an intrinsic function with two arguments. Used to implement " +"functionality that is not performance critical::" msgstr "" +"یک تابع ذاتی را با دو آرگومان فراخوانی می‌کند. برای پیاده‌سازی قابلیتی که از " +"نظر کارایی حیاتی نیست، استفاده می‌شود::" msgid "" "arg2 = STACK.pop()\n" @@ -1233,132 +2326,219 @@ msgid "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" msgstr "" +"arg2 = STACK.pop()\n" +"arg1 = STACK.pop()\n" +"result = intrinsic2(arg1, arg2)\n" +"STACK.append(result)" msgid "``INTRINSIC_2_INVALID``" -msgstr "" +msgstr "``INTRINSIC_2_INVALID``" msgid "``INTRINSIC_PREP_RERAISE_STAR``" -msgstr "" +msgstr "``INTRINSIC_PREP_RERAISE_STAR``" msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." -msgstr "" +msgstr ":exc:`ExceptionGroup` را برای پرتاب از یک ``try-except*`` محاسبه می‌کند." msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgid "Creates a :class:`typing.TypeVar` with a bound." -msgstr "" +msgstr "یک :class:`typing.TypeVar` با یک کران ایجاد می‌کند." msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgid "Creates a :class:`typing.TypeVar` with constraints." -msgstr "" +msgstr "یک :class:`typing.TypeVar` با محدودیت‌ها ایجاد می‌کند." msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -msgstr "" +msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgid "Sets the ``__type_params__`` attribute of a function." -msgstr "" +msgstr "ویژگی ``__type_params__`` یک تابع را تنظیم می‌کند." -msgid "Performs special method lookup on ``STACK[-1]``. If ``type(STACK[-1]).__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; STACK[-1]`` on the stack. If ``type(STACK[-1]).__xxx__`` is not a method, leave ``STACK[-1].__xxx__; NULL`` on the stack." +msgid "" +"Performs special method lookup on ``STACK[-1]``. If " +"``type(STACK[-1]).__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; " +"STACK[-1]`` on the stack. If ``type(STACK[-1]).__xxx__`` is not a method, " +"leave ``STACK[-1].__xxx__; NULL`` on the stack." msgstr "" +"جستجوی متد خاص را روی ``STACK[-1]`` انجام می‌دهد. اگر " +"``type(STACK[-1]).__xxx__`` یک متد باشد، ``type(STACK[-1]).__xxx__; " +"STACK[-1]`` را روی پشته باقی می‌گذارد. اگر ``type(STACK[-1]).__xxx__`` یک متد " +"نباشد، ``STACK[-1].__xxx__; NULL`` را روی پشته باقی می‌گذارد." msgid "**Pseudo-instructions**" -msgstr "" +msgstr "شبه‌دستورالعمل‌ها" -msgid "These opcodes do not appear in Python bytecode. They are used by the compiler but are replaced by real opcodes or removed before bytecode is generated." +msgid "" +"These opcodes do not appear in Python bytecode. They are used by the compiler " +"but are replaced by real opcodes or removed before bytecode is generated." msgstr "" +"این کدهای عملیاتی (opcodes) در بایت‌کد پایتون ظاهر نمی‌شوند. کامپایلر از آن‌ها " +"استفاده می‌کند، اما پیش از تولید بایت‌کد، با کدهای عملیاتی واقعی جایگزین یا حذف " +"می‌شوند." -msgid "Set up an exception handler for the following code block. If an exception occurs, the value stack level is restored to its current state and control is transferred to the exception handler at ``target``." +msgid "" +"Set up an exception handler for the following code block. If an exception " +"occurs, the value stack level is restored to its current state and control is " +"transferred to the exception handler at ``target``." msgstr "" +"برای بلوک کد زیر یک مدیر استثنا تنظیم کنید. اگر استثنایی رخ دهد، سطح پشته‌ی " +"مقدار به وضعیت فعلی خود بازمی‌گردد و کنترل به مدیر استثنا در ``target`` منتقل " +"می‌شود." -msgid "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If an exception occurs, the value stack level and the last instruction on the frame are restored to their current state, and control is transferred to the exception handler at ``target``." +msgid "" +"Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " +"instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " +"an exception occurs, the value stack level and the last instruction on the " +"frame are restored to their current state, and control is transferred to the " +"exception handler at ``target``." msgstr "" +"مانند ``SETUP_FINALLY``، اما در صورت بروز استثنا، آخرین دستور (``lasti``) را " +"نیز روی پشته می‌گذارد تا ``RERAISE`` بتواند آن را بازیابی کند. اگر استثنا رخ " +"دهد، سطح پشته‌ی مقدار و آخرین دستور روی فریم به وضعیت کنونی خود بازمی‌گردند و " +"کنترل به مدیر استثنا در ``target`` منتقل می‌شود." -msgid "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped from the stack before control is transferred to the exception handler at ``target``." +msgid "" +"Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " +"from the stack before control is transferred to the exception handler at " +"``target``." msgstr "" +"مانند ``SETUP_CLEANUP``، اما در صورت بروز استثنا، یک آیتم دیگر از پشته " +"برداشته می‌شود، پیش از آنکه کنترل به مدیر استثنا در ``target`` منتقل شود." -msgid "This variant is used in :keyword:`with` and :keyword:`async with` constructs, which push the return value of the context manager's :meth:`~object.__enter__` or :meth:`~object.__aenter__` to the stack." +msgid "" +"This variant is used in :keyword:`with` and :keyword:`async with` constructs, " +"which push the return value of the context " +"manager's :meth:`~object.__enter__` or :meth:`~object.__aenter__` to the " +"stack." msgstr "" +"این گونه در ساخت‌های :keyword:`with` و :keyword:`async with` استفاده می‌شود، که " +"مقدار بازگشتی :meth:`~object.__enter__` یا :meth:`~object.__aenter__` مدیر " +"زمینه را روی پشته قرار می‌دهند." -msgid "Marks the end of the code block associated with the last ``SETUP_FINALLY``, ``SETUP_CLEANUP`` or ``SETUP_WITH``." +msgid "" +"Marks the end of the code block associated with the last ``SETUP_FINALLY``, " +"``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" +"پایان بلوک کد مرتبط با آخرین ``SETUP_FINALLY``، ``SETUP_CLEANUP`` یا " +"``SETUP_WITH`` را مشخص می‌کند." -msgid "Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects." +msgid "" +"Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects." msgstr "" +"مانند :opcode:`LOAD_CONST` عمل می‌کند، اما برای اشیاء نامیرا کارآمدتر است." -msgid "Undirected relative jump instructions which are replaced by their directed (forward/backward) counterparts by the assembler." +msgid "" +"Undirected relative jump instructions which are replaced by their directed " +"(forward/backward) counterparts by the assembler." msgstr "" +"دستورهای پرش نسبی بدون جهت که توسط اسمبلر با همتایان جهت‌دار (رو به جلو/رو به " +"عقب) خود جایگزین می‌شوند." -msgid "Conditional jumps which do not impact the stack. Replaced by the sequence ``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." +msgid "" +"Conditional jumps which do not impact the stack. Replaced by the sequence " +"``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." msgstr "" +"پرش‌های شرطی که بر پشته تأثیر نمی‌گذارند. با دنباله‌ی ``COPY 1``، ``TO_BOOL``، " +"``POP_JUMP_IF_TRUE/FALSE`` جایگزین شده‌اند." -msgid "Pushes a reference to the cell contained in slot ``i`` of the \"fast locals\" storage." +msgid "" +"Pushes a reference to the cell contained in slot ``i`` of the \"fast locals\" " +"storage." msgstr "" +"ارجاعی به سلول موجود در جایگاه ``i`` از فضای ذخیره‌سازی «متغیرهای محلی سریع» " +"(fast locals) را روی پشته قرار می‌دهد." -msgid "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." +msgid "" +"Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" +"توجه داشته باشید که ``LOAD_CLOSURE`` در اسمبلر (assembler) با ``LOAD_FAST`` " +"جایگزین می‌شود." msgid "This opcode is now a pseudo-instruction." -msgstr "" +msgstr "این کد عملیاتی (opcode) اکنون یک شبه‌دستور (pseudo-instruction) است." msgid "Opcode collections" -msgstr "" +msgstr "مجموعه‌های کد عملیاتی (opcode)" -msgid "These collections are provided for automatic introspection of bytecode instructions:" -msgstr "" +msgid "" +"These collections are provided for automatic introspection of bytecode " +"instructions:" +msgstr "این مجموعه‌ها برای درون‌نگری خودکار دستورالعمل‌های بایت‌کد فراهم شده‌اند:" -msgid "The collections now contain pseudo instructions and instrumented instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` and ``>= MIN_INSTRUMENTED_OPCODE``." +msgid "" +"The collections now contain pseudo instructions and instrumented instructions " +"as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` and ``>= " +"MIN_INSTRUMENTED_OPCODE``." msgstr "" +"مجموعه‌ها اکنون شامل شبه‌دستورالعمل‌ها (pseudo instructions) و دستورالعمل‌های " +"ابزاربندی‌شده (instrumented instructions) نیز هستند. این‌ها کدهای عملیاتی " +"(opcodes) با مقادیر ``>= MIN_PSEUDO_OPCODE`` و ``>= MIN_INSTRUMENTED_OPCODE`` " +"هستند." msgid "Sequence of operation names, indexable using the bytecode." msgstr "" +"دنباله‌ای از نام‌های عملیات، که با استفاده از بایت‌کد (bytecode) قابل اندیس‌دهی " +"است." msgid "Dictionary mapping operation names to bytecodes." -msgstr "" +msgstr "دیکشنری که نام عملیات‌ها را به بایت‌کدها نگاشت می‌کند." msgid "Sequence of all compare operation names." -msgstr "" +msgstr "دنباله‌ای از تمام نام‌های عملیات مقایسه." msgid "Sequence of bytecodes that use their argument." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که از آرگومان خود استفاده می‌کنند." msgid "Sequence of bytecodes that access a constant." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که به یک ثابت دسترسی دارند." -msgid "Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that are referenced by inner scopes or names in outer scopes that are referenced from this scope. It does *not* include references to global or builtin scopes." -msgstr "" +msgid "" +"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " +"are referenced by inner scopes or names in outer scopes that are referenced " +"from this scope. It does *not* include references to global or builtin " +"scopes." +msgstr "" +"دنباله‌ای از بایت‌کدها که به یک :term:`متغیر آزاد (بستار) ` " +"دسترسی دارند. در این زمینه، «آزاد» به نام‌هایی در محدوده فعلی اشاره دارد که " +"محدوده‌های داخلی به آن‌ها ارجاع داده‌اند، یا به نام‌هایی در محدوده‌های بیرونی که " +"این محدوده به آن‌ها ارجاع داده است. این شامل ارجاع‌ها به محدوده‌های سراسری یا " +"توکار *نمی‌شود*." msgid "Sequence of bytecodes that access an attribute by name." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که به یک ویژگی بر اساس نام دسترسی پیدا می‌کنند." msgid "Sequence of bytecodes that have a jump target. All jumps are relative." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که هدف پرش دارند. تمام پرش‌ها نسبی هستند." msgid "Sequence of bytecodes that access a local variable." msgstr "" +"دنباله‌ای از بایت‌کدها (bytecodes) که به یک متغیر محلی دسترسی پیدا می‌کنند." msgid "Sequence of bytecodes of Boolean operations." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدهای عملیات بولی." msgid "Sequence of bytecodes that set an exception handler." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که یک هندلر استثنا را تنظیم می‌کنند." msgid "Sequence of bytecodes that have a relative jump target." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که مقصد پرش نسبی دارند." msgid "All jumps are now relative. Use :data:`hasjump`." -msgstr "" +msgstr "همه پرش‌ها اکنون نسبی هستند. از :data:`hasjump` استفاده کنید." msgid "Sequence of bytecodes that have an absolute jump target." -msgstr "" +msgstr "دنباله‌ای از بایت‌کدها که هدف پرش مطلق دارند." msgid "All jumps are now relative. This list is empty." -msgstr "" +msgstr "همه‌ی پرش‌ها اکنون نسبی هستند. این فهرست خالی است." msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "slice" -msgstr "" +msgstr "برش" diff --git a/library/distribution.po b/library/distribution.po index 47bcd2873..07479b925 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -22,7 +22,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Software Packaging and Distribution" -msgstr "" +msgstr "بسته‌بندی و توزیع نرم‌افزار" -msgid "These libraries help you with publishing and installing Python software. While these modules are designed to work in conjunction with the `Python Package Index `__, they can also be used with a local index server, or without any index server at all." +msgid "" +"These libraries help you with publishing and installing Python software. " +"While these modules are designed to work in conjunction with the `Python " +"Package Index `__, they can also be used with a local " +"index server, or without any index server at all." msgstr "" +"این کتابخانه‌ها به شما در انتشار و نصب نرم‌افزار پایتون کمک می‌کنند. هرچند " +"این ماژول‌ها برای کار هماهنگ با `Python Package Index `__ " +"طراحی شده‌اند، اما همچنین می‌توان از آن‌ها با یک سرور اندیس محلی، یا اصلاً " +"بدون هیچ سرور اندیسی استفاده کرد." diff --git a/library/distutils.po b/library/distutils.po index c64489bdf..25e7411c5 100644 --- a/library/distutils.po +++ b/library/distutils.po @@ -22,10 +22,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!distutils` --- Building and installing Python modules" -msgstr "" +msgstr ":mod:`!distutils` --- ساخت و نصب ماژول‌های پایتون" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.12 ` after being deprecated in Python 3.10. The removal was decided in :pep:`632`, which has `migration advice `_." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.12 ` after being " +"deprecated in Python 3.10. The removal was decided in :pep:`632`, which has" +" `migration advice `_." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در Python 3.10، :ref:`در Python 3.12 حذف شد `. تصمیم برای این حذف در :pep:`632` گرفته شد، که دارای `توصیه‌های " +"مهاجرت `_ است." -msgid "The last version of Python that provided the :mod:`!distutils` module was `Python 3.11 `_." +msgid "" +"The last version of Python that provided the :mod:`!distutils` module was " +"`Python 3.11 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!distutils` را ارائه می‌کرد، `Python 3.11" +" `_ بود." diff --git a/library/doctest.po b/library/doctest.po index dab17bbc9..61cb811d3 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -24,25 +24,48 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!doctest` --- Test interactive Python examples" -msgstr "" +msgstr ":mod:`!doctest` --- آزمون مثال‌های تعاملی پایتون" msgid "**Source code:** :source:`Lib/doctest.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/doctest.py`" -msgid "The :mod:`!doctest` module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown. There are several common ways to use doctest:" +msgid "" +"The :mod:`!doctest` module searches for pieces of text that look like " +"interactive Python sessions, and then executes those sessions to verify that" +" they work exactly as shown. There are several common ways to use doctest:" msgstr "" +"ماژول :mod:`!doctest` به دنبال تکه‌هایی از متن می‌گردد که شبیه نشست‌های " +"تعاملی پایتون هستند، سپس آن نشست‌ها را اجرا می‌کند تا تأیید کند که دقیقاً " +"همان‌طور که نشان داده شده‌اند کار می‌کنند. چندین روش رایج برای استفاده از " +"doctest وجود دارد:" -msgid "To check that a module's docstrings are up-to-date by verifying that all interactive examples still work as documented." +msgid "" +"To check that a module's docstrings are up-to-date by verifying that all " +"interactive examples still work as documented." msgstr "" +"برای بررسی به‌روز بودن رشته مستندات‌های یک ماژول با صحت‌سنجی اینکه همه " +"مثال‌های تعاملی هنوز مطابق مستندات کار می‌کنند." -msgid "To perform regression testing by verifying that interactive examples from a test file or a test object work as expected." +msgid "" +"To perform regression testing by verifying that interactive examples from a " +"test file or a test object work as expected." msgstr "" +"برای انجام آزمون رگرسیون با صحت‌سنجی اینکه مثال‌های تعاملی از یک فایل آزمون " +"یا یک شیء آزمون همان‌طور که انتظار می‌رود کار می‌کنند." -msgid "To write tutorial documentation for a package, liberally illustrated with input-output examples. Depending on whether the examples or the expository text are emphasized, this has the flavor of \"literate testing\" or \"executable documentation\"." +msgid "" +"To write tutorial documentation for a package, liberally illustrated with " +"input-output examples. Depending on whether the examples or the expository " +"text are emphasized, this has the flavor of \"literate testing\" or " +"\"executable documentation\"." msgstr "" +"برای نوشتن مستندات آموزشی یک بسته، که به‌وفور با مثال‌های ورودی-خروجی همراه " +"شده است. بسته به این‌که مثال‌ها یا متن توضیحی بیشتر مورد تأکید باشند، این " +"حالت، حال‌وهوای «آزمون باسواد» (literate testing) یا «مستندات اجرایی» " +"(executable documentation) را دارد." msgid "Here's a complete but small example module::" -msgstr "" +msgstr "در اینجا یک ماژول نمونه‌ی کامل اما کوچک آمده است::" msgid "" "\"\"\"\n" @@ -100,17 +123,83 @@ msgid "" " import doctest\n" " doctest.testmod()" msgstr "" +"\"\"\"\n" +"This is the \"example\" module.\n" +"\n" +"The example module supplies one function, factorial(). For example,\n" +"\n" +">>> factorial(5)\n" +"120\n" +"\"\"\"\n" +"\n" +"def factorial(n):\n" +" \"\"\"Return the factorial of n, an exact integer >= 0.\n" +"\n" +" >>> [factorial(n) for n in range(6)]\n" +" [1, 1, 2, 6, 24, 120]\n" +" >>> factorial(30)\n" +" 265252859812191058636308480000000\n" +" >>> factorial(-1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be >= 0\n" +"\n" +" Factorials of floats are OK, but the float must be an exact integer:\n" +" >>> factorial(30.1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be exact integer\n" +" >>> factorial(30.0)\n" +" 265252859812191058636308480000000\n" +"\n" +" It must also not be ridiculously large:\n" +" >>> factorial(1e100)\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +" \"\"\"\n" +"\n" +" import math\n" +" if not n >= 0:\n" +" raise ValueError(\"n must be >= 0\")\n" +" if math.floor(n) != n:\n" +" raise ValueError(\"n must be exact integer\")\n" +" if n+1 == n: # catch a value like 1e300\n" +" raise OverflowError(\"n too large\")\n" +" result = 1\n" +" factor = 2\n" +" while factor <= n:\n" +" result *= factor\n" +" factor += 1\n" +" return result\n" +"\n" +"\n" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" -msgid "If you run :file:`example.py` directly from the command line, :mod:`!doctest` works its magic:" +msgid "" +"If you run :file:`example.py` directly from the command line, " +":mod:`!doctest` works its magic:" msgstr "" +"اگر :file:`example.py` را مستقیماً از خط فرمان اجرا کنید، :mod:`!doctest` " +"جادوی خود را انجام می‌دهد:" msgid "" "$ python example.py\n" "$" msgstr "" +"$ python example.py\n" +"$" -msgid "There's no output! That's normal, and it means all the examples worked. Pass ``-v`` to the script, and :mod:`!doctest` prints a detailed log of what it's trying, and prints a summary at the end:" +msgid "" +"There's no output! That's normal, and it means all the examples worked. " +"Pass ``-v`` to the script, and :mod:`!doctest` prints a detailed log of what" +" it's trying, and prints a summary at the end:" msgstr "" +"هیچ خروجی‌ای وجود ندارد! این طبیعی است و به این معناست که همه‌ی مثال‌ها کار " +"کرده‌اند. آرگومان ``-v`` را به اسکریپت بدهید، و :mod:`!doctest` گزارش دقیقی " +"از آنچه آزمایش می‌کند چاپ می‌کند و در پایان خلاصه‌ای چاپ می‌کند:" msgid "" "$ python example.py -v\n" @@ -125,9 +214,20 @@ msgid "" " [1, 1, 2, 6, 24, 120]\n" "ok" msgstr "" +"$ python example.py -v\n" +"Trying:\n" +" factorial(5)\n" +"Expecting:\n" +" 120\n" +"ok\n" +"Trying:\n" +" [factorial(n) for n in range(6)]\n" +"Expecting:\n" +" [1, 1, 2, 6, 24, 120]\n" +"ok" msgid "And so on, eventually ending with:" -msgstr "" +msgstr "و به همین ترتیب، که در نهایت با … پایان می‌یابد:" msgid "" "Trying:\n" @@ -145,68 +245,151 @@ msgid "" "Test passed.\n" "$" msgstr "" +"Trying:\n" +" factorial(1e100)\n" +"Expecting:\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +"ok\n" +"2 items passed all tests:\n" +" 1 test in __main__\n" +" 6 tests in __main__.factorial\n" +"7 tests in 2 items.\n" +"7 passed.\n" +"Test passed.\n" +"$" -msgid "That's all you need to know to start making productive use of :mod:`!doctest`! Jump in. The following sections provide full details. Note that there are many examples of doctests in the standard Python test suite and libraries. Especially useful examples can be found in the standard test file :file:`Lib/test/test_doctest/test_doctest.py`." -msgstr "" +msgid "" +"That's all you need to know to start making productive use of " +":mod:`!doctest`! Jump in. The following sections provide full details. " +"Note that there are many examples of doctests in the standard Python test " +"suite and libraries. Especially useful examples can be found in the standard" +" test file :file:`Lib/test/test_doctest/test_doctest.py`." +msgstr "" +"این تمام چیزی است که برای شروع استفاده‌ی مؤثر از :mod:`!doctest` نیاز دارید " +"بدانید! شروع کنید. بخش‌های زیر جزئیات کامل را ارائه می‌دهند. توجه داشته " +"باشید که نمونه‌های doctest زیادی در مجموعه‌ی آزمون و کتابخانه‌های استاندارد " +"پایتون وجود دارد. نمونه‌های به‌ویژه مفید را می‌توان در پرونده‌ی آزمون استاندارد" +" :file:`Lib/test/test_doctest/test_doctest.py` یافت." -msgid "Output is colorized by default and can be :ref:`controlled using environment variables `." +msgid "" +"Output is colorized by default and can be :ref:`controlled using environment" +" variables `." msgstr "" +"خروجی به‌طور پیش‌فرض رنگی است و می‌تواند :ref:`با استفاده از متغیرهای محیطی " +"کنترل شود `." msgid "Simple Usage: Checking Examples in Docstrings" -msgstr "" +msgstr "استفاده ساده: بررسی مثال‌ها در رشته مستندات" -msgid "The simplest way to start using doctest (but not necessarily the way you'll continue to do it) is to end each module :mod:`!M` with::" +msgid "" +"The simplest way to start using doctest (but not necessarily the way you'll " +"continue to do it) is to end each module :mod:`!M` with::" msgstr "" +"ساده‌ترین روش برای شروع استفاده از doctest (اما نه لزوماً روشی که به آن " +"ادامه خواهید داد) این است که در پایان هر ماژول :mod:`!M` این را قرار دهید::" msgid "" "if __name__ == \"__main__\":\n" " import doctest\n" " doctest.testmod()" msgstr "" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." msgstr "" +":mod:`!doctest` سپس رشته‌های مستندسازی (docstrings) را در ماژول :mod:`!M` " +"بررسی می‌کند." -msgid "Running the module as a script causes the examples in the docstrings to get executed and verified::" +msgid "" +"Running the module as a script causes the examples in the docstrings to get " +"executed and verified::" msgstr "" +"اجرای ماژول به‌عنوان یک اسکریپت باعث می‌شود مثال‌های موجود در رشته مستندات" +" اجرا و تأیید شوند::" msgid "python M.py" -msgstr "" +msgstr "python M.py" -msgid "This won't display anything unless an example fails, in which case the failing example(s) and the cause(s) of the failure(s) are printed to stdout, and the final line of output is ``***Test Failed*** N failures.``, where *N* is the number of examples that failed." +msgid "" +"This won't display anything unless an example fails, in which case the " +"failing example(s) and the cause(s) of the failure(s) are printed to stdout," +" and the final line of output is ``***Test Failed*** N failures.``, where " +"*N* is the number of examples that failed." msgstr "" +"این هیچ چیزی را نمایش نمی‌دهد، مگر اینکه مثالی شکست بخورد؛ در این صورت، " +"مثال‌های شکست‌خورده و علت‌های شکست در stdout چاپ می‌شوند و آخرین خط خروجی " +"``***Test Failed*** N failures.`` است، که در آن *N* تعداد مثال‌هایی است که " +"شکست خورده‌اند." msgid "Run it with the ``-v`` switch instead::" -msgstr "" +msgstr "در عوض آن را با گزینه ``-v`` اجرا کنید::" msgid "python M.py -v" -msgstr "" +msgstr "python M.py -v" -msgid "and a detailed report of all examples tried is printed to standard output, along with assorted summaries at the end." +msgid "" +"and a detailed report of all examples tried is printed to standard output, " +"along with assorted summaries at the end." msgstr "" +"و گزارش دقیقی از همه مثال‌های آزمایش‌شده در خروجی استاندارد چاپ می‌شود، " +"به‌همراه خلاصه‌های گوناگونی در پایان." -msgid "You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, or prohibit it by passing ``verbose=False``. In either of those cases, :data:`sys.argv` is not examined by :func:`testmod` (so passing ``-v`` or not has no effect)." +msgid "" +"You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, " +"or prohibit it by passing ``verbose=False``. In either of those cases, " +":data:`sys.argv` is not examined by :func:`testmod` (so passing ``-v`` or " +"not has no effect)." msgstr "" +"می‌توانید با گذراندن ``verbose=True`` به :func:`testmod`، حالت پرگو (verbose" +" mode) را تحمیل کنید، یا با گذراندن ``verbose=False`` از آن جلوگیری کنید. در" +" هر یک از این موارد، :data:`sys.argv` توسط :func:`testmod` بررسی نمی‌شود " +"(بنابراین گذراندن ``-v`` یا نگذراندن آن تأثیری ندارد)." -msgid "There is also a command line shortcut for running :func:`testmod`, see section :ref:`doctest-cli`." +msgid "" +"There is also a command line shortcut for running :func:`testmod`, see " +"section :ref:`doctest-cli`." msgstr "" +"همچنین یک میان‌بر خط فرمان برای اجرای :func:`testmod` وجود دارد، بخش " +":ref:`doctest-cli` را ببینید." -msgid "For more information on :func:`testmod`, see section :ref:`doctest-basic-api`." +msgid "" +"For more information on :func:`testmod`, see section :ref:`doctest-basic-" +"api`." msgstr "" +"برای اطلاعات بیشتر درباره :func:`testmod`، بخش :ref:`doctest-basic-api` را " +"ببینید." msgid "Simple Usage: Checking Examples in a Text File" -msgstr "" +msgstr "استفاده ساده: بررسی مثال‌ها در یک فایل متنی" -msgid "Another simple application of doctest is testing interactive examples in a text file. This can be done with the :func:`testfile` function::" +msgid "" +"Another simple application of doctest is testing interactive examples in a " +"text file. This can be done with the :func:`testfile` function::" msgstr "" +"یکی دیگر از کاربردهای ساده‌ی doctest، آزمایش مثال‌های تعاملی در یک فایل متنی " +"است. این کار را می‌توان با تابع :func:`testfile` انجام داد::" msgid "" "import doctest\n" "doctest.testfile(\"example.txt\")" msgstr "" +"import doctest\n" +"doctest.testfile(\"example.txt\")" -msgid "That short script executes and verifies any interactive Python examples contained in the file :file:`example.txt`. The file content is treated as if it were a single giant docstring; the file doesn't need to contain a Python program! For example, perhaps :file:`example.txt` contains this:" +msgid "" +"That short script executes and verifies any interactive Python examples " +"contained in the file :file:`example.txt`. The file content is treated as " +"if it were a single giant docstring; the file doesn't need to contain a " +"Python program! For example, perhaps :file:`example.txt` contains this:" msgstr "" +"آن اسکریپت کوتاه، هر مثال تعاملی پایتون موجود در فایل :file:`example.txt` را" +" اجرا و صحت‌سنجی می‌کند. محتوای فایل به‌عنوان یک رشته‌ی مستندسازی " +" بزرگ و واحد در نظر گرفته می‌شود؛ لازم نیست فایل حاوی یک برنامه‌ی" +" پایتون باشد! برای مثال، ممکن است :file:`example.txt` شامل این باشد:" msgid "" "The ``example`` module\n" @@ -225,9 +408,28 @@ msgid "" " >>> factorial(6)\n" " 120" msgstr "" +"ماژول ``example``\n" +"======================\n" +"\n" +"استفاده از ``factorial``\n" +"--------------------------\n" +"\n" +"این یک فایل متنی نمونه در قالب reStructuredText است. ابتدا ``factorial`` را\n" +"از ماژول ``example`` ایمپورت کنید:\n" +"\n" +" >>> from example import factorial\n" +"\n" +"اکنون از آن استفاده کنید:\n" +"\n" +" >>> factorial(6)\n" +" 120" -msgid "Running ``doctest.testfile(\"example.txt\")`` then finds the error in this documentation::" +msgid "" +"Running ``doctest.testfile(\"example.txt\")`` then finds the error in this " +"documentation::" msgstr "" +"سپس با اجرای ``doctest.testfile(\"example.txt\")`` خطا در این مستندات پیدا " +"می‌شود::" msgid "" "File \"./example.txt\", line 14, in example.txt\n" @@ -238,69 +440,161 @@ msgid "" "Got:\n" " 720" msgstr "" +"فایل \"./example.txt\"، خط 14، در example.txt\n" +"مثال شکست خورده:\n" +" factorial(6)\n" +"انتظار می‌رفت:\n" +" 120\n" +"دریافت شد:\n" +" 720" -msgid "As with :func:`testmod`, :func:`testfile` won't display anything unless an example fails. If an example does fail, then the failing example(s) and the cause(s) of the failure(s) are printed to stdout, using the same format as :func:`!testmod`." +msgid "" +"As with :func:`testmod`, :func:`testfile` won't display anything unless an " +"example fails. If an example does fail, then the failing example(s) and the" +" cause(s) of the failure(s) are printed to stdout, using the same format as " +":func:`!testmod`." msgstr "" +"مانند :func:`testmod`، :func:`testfile` نیز چیزی نمایش نمی‌دهد مگر آنکه " +"مثالی شکست بخورد. اگر مثالی شکست بخورد، مثال(های) شکست‌خورده و علت(های) شکست" +" با همان قالب :func:`!testmod` در stdout چاپ می‌شوند." -msgid "By default, :func:`testfile` looks for files in the calling module's directory. See section :ref:`doctest-basic-api` for a description of the optional arguments that can be used to tell it to look for files in other locations." +msgid "" +"By default, :func:`testfile` looks for files in the calling module's " +"directory. See section :ref:`doctest-basic-api` for a description of the " +"optional arguments that can be used to tell it to look for files in other " +"locations." msgstr "" +"به‌طور پیش‌فرض، :func:`testfile` در پوشه‌ی ماژول فراخوان به دنبال فایل‌ها " +"می‌گردد. برای توضیح آرگومان‌های اختیاری که می‌توان از آن‌ها استفاده کرد تا " +"به آن گفته شود فایل‌ها را در مکان‌های دیگر جستجو کند، بخش :ref:`doctest-" +"basic-api` را ببینید." -msgid "Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the ``-v`` command-line switch or with the optional keyword argument *verbose*." +msgid "" +"Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the " +"``-v`` command-line switch or with the optional keyword argument *verbose*." msgstr "" +"مانند :func:`testmod`، میزان پرگویی :func:`testfile` را می‌توان با گزینه خط " +"فرمان ``-v`` یا آرگومان کلیدواژه‌ای اختیاری *verbose* تنظیم کرد." -msgid "There is also a command line shortcut for running :func:`testfile`, see section :ref:`doctest-cli`." +msgid "" +"There is also a command line shortcut for running :func:`testfile`, see " +"section :ref:`doctest-cli`." msgstr "" +"همچنین یک میان‌بر خط فرمان برای اجرای :func:`testfile` وجود دارد، بخش " +":ref:`doctest-cli` را ببینید." -msgid "For more information on :func:`testfile`, see section :ref:`doctest-basic-api`." +msgid "" +"For more information on :func:`testfile`, see section :ref:`doctest-basic-" +"api`." msgstr "" +"برای اطلاعات بیشتر درباره :func:`testfile`، بخش :ref:`doctest-basic-api` را " +"ببینید." msgid "Command-line Usage" -msgstr "" +msgstr "استفاده از خط فرمان" -msgid "The :mod:`!doctest` module can be invoked as a script from the command line:" +msgid "" +"The :mod:`!doctest` module can be invoked as a script from the command line:" msgstr "" +"ماژول :mod:`!doctest` را می‌توان به‌عنوان یک اسکریپت از خط فرمان فراخوانی " +"کرد:" msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" -msgstr "" +msgstr "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" -msgid "Detailed report of all examples tried is printed to standard output, along with assorted summaries at the end::" +msgid "" +"Detailed report of all examples tried is printed to standard output, along " +"with assorted summaries at the end::" msgstr "" +"گزارش دقیقی از تمام مثال‌های آزمایش‌شده در خروجی استاندارد چاپ می‌شود، به " +"همراه خلاصه‌های گوناگونی در پایان::" msgid "python -m doctest -v example.py" -msgstr "" +msgstr "python -m doctest -v example.py" -msgid "This will import :file:`example.py` as a standalone module and run :func:`testmod` on it. Note that this may not work correctly if the file is part of a package and imports other submodules from that package." +msgid "" +"This will import :file:`example.py` as a standalone module and run " +":func:`testmod` on it. Note that this may not work correctly if the file is " +"part of a package and imports other submodules from that package." msgstr "" +"این کار :file:`example.py` را به‌عنوان یک ماژول مستقل ایمپورت می‌کند و " +":func:`testmod` را روی آن اجرا می‌کند. توجه داشته باشید که اگر فایل بخشی از " +"یک بسته باشد و زیرماژول‌های دیگری را از آن بسته ایمپورت کند، ممکن است این " +"کار به‌درستی انجام نشود." -msgid "If the file name does not end with :file:`.py`, :mod:`!doctest` infers that it must be run with :func:`testfile` instead::" +msgid "" +"If the file name does not end with :file:`.py`, :mod:`!doctest` infers that " +"it must be run with :func:`testfile` instead::" msgstr "" +"اگر نام فایل به :file:`.py` ختم نشود، :mod:`!doctest` استنباط می‌کند که باید" +" در عوض با :func:`testfile` اجرا شود::" msgid "python -m doctest -v example.txt" -msgstr "" +msgstr "python -m doctest -v example.txt" -msgid "Option flags control various aspects of doctest's behavior, see section :ref:`doctest-options`." +msgid "" +"Option flags control various aspects of doctest's behavior, see section " +":ref:`doctest-options`." msgstr "" +"پرچم‌های گزینه، جنبه‌های گوناگون رفتار doctest را کنترل می‌کنند؛ بخش " +":ref:`doctest-options` را ببینید." msgid "This is shorthand for ``-o FAIL_FAST``." -msgstr "" +msgstr "این میان‌بری برای ``-o FAIL_FAST`` است." msgid "How It Works" -msgstr "" +msgstr "چگونه کار می‌کند" -msgid "This section examines in detail how doctest works: which docstrings it looks at, how it finds interactive examples, what execution context it uses, how it handles exceptions, and how option flags can be used to control its behavior. This is the information that you need to know to write doctest examples; for information about actually running doctest on these examples, see the following sections." -msgstr "" +msgid "" +"This section examines in detail how doctest works: which docstrings it looks" +" at, how it finds interactive examples, what execution context it uses, how " +"it handles exceptions, and how option flags can be used to control its " +"behavior. This is the information that you need to know to write doctest " +"examples; for information about actually running doctest on these examples, " +"see the following sections." +msgstr "" +"این بخش با جزئیات بررسی می‌کند که doctest چگونه کار می‌کند: به کدام " +"رشته‌مستندها نگاه می‌کند، چگونه مثال‌های تعاملی را پیدا می‌کند،" +" از چه زمینه اجرا استفاده می‌کند، چگونه استثناها را مدیریت می‌کند، و چگونه " +"می‌توان از پرچم‌های گزینه برای کنترل رفتار آن استفاده کرد. این اطلاعاتی است " +"که شما برای نوشتن مثال‌های doctest باید بدانید؛ برای اطلاع از اجرای واقعی " +"doctest روی این مثال‌ها، بخش‌های زیر را ببینید." msgid "Which Docstrings Are Examined?" -msgstr "" +msgstr "کدام رشته مستندات بررسی می‌شوند؟" -msgid "The module docstring, and all function, class and method docstrings are searched. Objects imported into the module are not searched." +msgid "" +"The module docstring, and all function, class and method docstrings are " +"searched. Objects imported into the module are not searched." msgstr "" +"رشته مستندات ماژول و تمام رشته مستندات تابع، کلاس و متد جستجو می‌شوند. " +"اشیایی که به ماژول ایمپورت شده‌اند، جستجو نمی‌شوند." -msgid "In addition, there are cases when you want tests to be part of a module but not part of the help text, which requires that the tests not be included in the docstring. Doctest looks for a module-level variable called ``__test__`` and uses it to locate other tests. If ``M.__test__`` exists, it must be a dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ``M.__test__`` are searched, and strings are treated as if they were docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M.__test__.K``." -msgstr "" +msgid "" +"In addition, there are cases when you want tests to be part of a module but " +"not part of the help text, which requires that the tests not be included in " +"the docstring. Doctest looks for a module-level variable called ``__test__``" +" and uses it to locate other tests. If ``M.__test__`` exists, it must be a " +"dict, and each entry maps a (string) name to a function object, class " +"object, or string. Function and class object docstrings found from " +"``M.__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name " +"``M.__test__.K``." +msgstr "" +"علاوه بر این، مواردی وجود دارد که می‌خواهید آزمون‌ها بخشی از یک ماژول باشند " +"اما بخشی از متن راهنما نباشند، که این مستلزم آن است که آزمون‌ها در " +"رشته مستند گنجانده نشوند. Doctest به دنبال یک متغیر سطح " +"ماژول به نام ``__test__`` می‌گردد و از آن برای یافتن سایر آزمون‌ها استفاده " +"می‌کند. اگر ``M.__test__`` وجود داشته باشد، باید یک دیکشنری باشد، و هر آیتم " +"یک نام (رشته‌ای) را به یک شیء تابع، شیء کلاس یا رشته نگاشت می‌کند. " +"رشته مستندات اشیاء تابع و کلاس که از ``M.__test__`` یافت می‌شوند، " +"جستجو می‌شوند، و رشته‌ها طوری رفتار می‌شوند که گویی رشته مستند هستند. " +"در خروجی، یک کلید ``K`` در ``M.__test__`` با نام ``M.__test__.K`` ظاهر " +"می‌شود." -msgid "For example, place this block of code at the top of :file:`example.py`:" -msgstr "" +msgid "" +"For example, place this block of code at the top of :file:`example.py`:" +msgstr "برای مثال، این قطعه کد را در ابتدای :file:`example.py` قرار دهید:" msgid "" "__test__ = {\n" @@ -313,24 +607,61 @@ msgid "" "\"\"\"\n" "}" msgstr "" +"__test__ = {\n" +" 'numbers': \"\"\"\n" +">>> factorial(6)\n" +"720\n" +"\n" +">>> [factorial(n) for n in range(6)]\n" +"[1, 1, 2, 6, 24, 120]\n" +"\"\"\"\n" +"}" -msgid "The value of ``example.__test__[\"numbers\"]`` will be treated as a docstring and all the tests inside it will be run. It is important to note that the value can be mapped to a function, class object, or module; if so, :mod:`!doctest` searches them recursively for docstrings, which are then scanned for tests." -msgstr "" +msgid "" +"The value of ``example.__test__[\"numbers\"]`` will be treated as a " +"docstring and all the tests inside it will be run. It is important to note " +"that the value can be mapped to a function, class object, or module; if so, " +":mod:`!doctest` searches them recursively for docstrings, which are then " +"scanned for tests." +msgstr "" +"مقدار ``example.__test__[\"numbers\"]`` به‌عنوان یک رشته مستندسازی در نظر " +"گرفته می‌شود و همه‌ی آزمون‌های داخل آن اجرا خواهند شد. توجه داشته باشید که این " +"مقدار می‌تواند به یک تابع، شیء کلاس یا ماژول نگاشته شود؛ در این صورت، " +":mod:`!doctest` آن‌ها را به‌صورت بازگشتی برای یافتن رشته‌های مستندسازی جستجو" +" می‌کند و سپس این رشته‌ها برای یافتن آزمون‌ها پویش می‌شوند." -msgid "Any classes found are recursively searched similarly, to test docstrings in their contained methods and nested classes." +msgid "" +"Any classes found are recursively searched similarly, to test docstrings in " +"their contained methods and nested classes." msgstr "" +"هر کلاس یافت‌شده به‌طور بازگشتی به‌همین ترتیب جستجو می‌شود تا رشته‌مستندها " +"(docstrings) در متدها و کلاس‌های تودرتوی درون آن آزمایش شوند." -msgid "``doctest`` can only automatically discover classes and functions that are defined at the module level or inside other classes." +msgid "" +"``doctest`` can only automatically discover classes and functions that are " +"defined at the module level or inside other classes." msgstr "" +"``doctest`` تنها می‌تواند به‌صورت خودکار کلاس‌ها و توابعی را که در سطح ماژول" +" یا درون کلاس‌های دیگر تعریف شده‌اند، کشف کند." -msgid "Since nested classes and functions only exist when an outer function is called, they cannot be discovered. Define them outside to make them visible." +msgid "" +"Since nested classes and functions only exist when an outer function is " +"called, they cannot be discovered. Define them outside to make them visible." msgstr "" +"از آنجا که کلاس‌ها و توابع تودرتو تنها زمانی وجود دارند که یک تابع بیرونی " +"فراخوانی شود، نمی‌توان آن‌ها را کشف کرد. آن‌ها را بیرون تعریف کنید تا قابل " +"مشاهده شوند." msgid "How are Docstring Examples Recognized?" -msgstr "" +msgstr "مثال‌های رشته‌ی مستندسازی چگونه شناسایی می‌شوند؟" -msgid "In most cases a copy-and-paste of an interactive console session works fine, but doctest isn't trying to do an exact emulation of any specific Python shell." +msgid "" +"In most cases a copy-and-paste of an interactive console session works fine," +" but doctest isn't trying to do an exact emulation of any specific Python " +"shell." msgstr "" +"در بیشتر موارد، کپی-پیست یک نشست کنسول تعاملی به‌خوبی کار می‌کند، اما " +"doctest در پی شبیه‌سازی دقیق هیچ پوسته‌ی خاصی از پایتون نیست." msgid "" ">>> # comments are ignored\n" @@ -349,24 +680,86 @@ msgid "" "NO!!!\n" ">>>" msgstr "" +">>> # comments are ignored\n" +">>> x = 12\n" +">>> x\n" +"12\n" +">>> if x == 13:\n" +"... print(\"yes\")\n" +"... else:\n" +"... print(\"no\")\n" +"... print(\"NO\")\n" +"... print(\"NO!!!\")\n" +"...\n" +"no\n" +"NO\n" +"NO!!!\n" +">>>" -msgid "Any expected output must immediately follow the final ``'>>> '`` or ``'... '`` line containing the code, and the expected output (if any) extends to the next ``'>>> '`` or all-whitespace line." +msgid "" +"Any expected output must immediately follow the final ``'>>> '`` or ``'... " +"'`` line containing the code, and the expected output (if any) extends to " +"the next ``'>>> '`` or all-whitespace line." msgstr "" +"هر خروجی مورد انتظار باید بلافاصله پس از آخرین خط ``'>>> '`` یا ``'... '`` " +"حاوی کد بیاید، و خروجی مورد انتظار (در صورت وجود) تا خط ``'>>> '`` بعدی یا " +"خط فقط شامل فضای خالی ادامه می‌یابد." msgid "The fine print:" -msgstr "" +msgstr "نکات ریز:" -msgid "Expected output cannot contain an all-whitespace line, since such a line is taken to signal the end of expected output. If expected output does contain a blank line, put ```` in your doctest example each place a blank line is expected." +msgid "" +"Expected output cannot contain an all-whitespace line, since such a line is " +"taken to signal the end of expected output. If expected output does contain" +" a blank line, put ```` in your doctest example each place a " +"blank line is expected." msgstr "" +"خروجی مورد انتظار نمی‌تواند شامل خطی باشد که فقط فضای خالی است، زیرا چنین " +"خطی به‌عنوان نشانه پایان خروجی مورد انتظار در نظر گرفته می‌شود. اگر خروجی " +"مورد انتظار شامل یک خط خالی است، در مثال doctest خود، در هر جایی که یک خط " +"خالی انتظار می‌رود، ```` قرار دهید." -msgid "All hard tab characters are expanded to spaces, using 8-column tab stops. Tabs in output generated by the tested code are not modified. Because any hard tabs in the sample output *are* expanded, this means that if the code output includes hard tabs, the only way the doctest can pass is if the :const:`NORMALIZE_WHITESPACE` option or :ref:`directive ` is in effect. Alternatively, the test can be rewritten to capture the output and compare it to an expected value as part of the test. This handling of tabs in the source was arrived at through trial and error, and has proven to be the least error prone way of handling them. It is possible to use a different algorithm for handling tabs by writing a custom :class:`DocTestParser` class." -msgstr "" +msgid "" +"All hard tab characters are expanded to spaces, using 8-column tab stops. " +"Tabs in output generated by the tested code are not modified. Because any " +"hard tabs in the sample output *are* expanded, this means that if the code " +"output includes hard tabs, the only way the doctest can pass is if the " +":const:`NORMALIZE_WHITESPACE` option or :ref:`directive ` is in effect. Alternatively, the test can be rewritten to " +"capture the output and compare it to an expected value as part of the test." +" This handling of tabs in the source was arrived at through trial and " +"error, and has proven to be the least error prone way of handling them. It " +"is possible to use a different algorithm for handling tabs by writing a " +"custom :class:`DocTestParser` class." +msgstr "" +"همه‌ی نویسه‌های تب سخت با استفاده از محل‌های توقف تب ۸ ستونه به فاصله‌ها " +"تبدیل می‌شوند. تب‌های موجود در خروجی تولیدشده به‌وسیله‌ی کد آزمایش‌شده تغییر" +" نمی‌کنند. از آنجا که هر تب سختی در خروجی نمونه *تبدیل می‌شود*، این بدان " +"معناست که اگر خروجی کد شامل تب‌های سخت باشد، تنها راه قبولی doctest این است " +"که گزینه‌ی :const:`NORMALIZE_WHITESPACE` یا :ref:`دایرکتیو ` فعال باشد. به‌عنوان جایگزین، می‌توان آزمون را بازنویسی کرد تا " +"خروجی را ضبط کند و آن را با یک مقدار مورد انتظار به‌عنوان بخشی از آزمون " +"مقایسه کند. این نحوه‌ی مدیریت تب‌ها در منبع از طریق آزمون و خطا به دست آمده " +"و نشان داده است که کم‌خطاترین روش برای مدیریت آن‌ها است. با نوشتن یک کلاس " +":class:`DocTestParser` سفارشی، می‌توان از الگوریتم متفاوتی برای مدیریت تب‌ها" +" استفاده کرد." -msgid "Output to stdout is captured, but not output to stderr (exception tracebacks are captured via a different means)." +msgid "" +"Output to stdout is captured, but not output to stderr (exception tracebacks" +" are captured via a different means)." msgstr "" +"خروجی به stdout ضبط می‌شود، اما خروجی به stderr ضبط نمی‌شود (ردگیری‌های " +"پشته‌ی استثنا از روش دیگری ضبط می‌شوند)." -msgid "If you continue a line via backslashing in an interactive session, or for any other reason use a backslash, you should use a raw docstring, which will preserve your backslashes exactly as you type them::" +msgid "" +"If you continue a line via backslashing in an interactive session, or for " +"any other reason use a backslash, you should use a raw docstring, which will" +" preserve your backslashes exactly as you type them::" msgstr "" +"اگر در یک نشست تعاملی خطی را با بک‌اسلش ادامه می‌دهید، یا به هر دلیل دیگری " +"از بک‌اسلش استفاده می‌کنید، باید از یک رشته مستند خام " +"استفاده کنید، که بک‌اسلش‌های شما را دقیقاً همان‌گونه که تایپ می‌کنید حفظ " +"می‌کند::" msgid "" ">>> def f(x):\n" @@ -375,9 +768,22 @@ msgid "" ">>> print(f.__doc__)\n" "Backslashes in a raw docstring: m\\n" msgstr "" +">>> def f(x):\n" +"... r'''Backslashes in a raw docstring: m\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" -msgid "Otherwise, the backslash will be interpreted as part of the string. For example, the ``\\n`` above would be interpreted as a newline character. Alternatively, you can double each backslash in the doctest version (and not use a raw string)::" +msgid "" +"Otherwise, the backslash will be interpreted as part of the string. For " +"example, the ``\\n`` above would be interpreted as a newline character. " +"Alternatively, you can double each backslash in the doctest version (and not" +" use a raw string)::" msgstr "" +"در غیر این صورت، بک‌اسلش به‌عنوان بخشی از رشته تفسیر می‌شود. برای مثال، " +"``\\n`` بالا به‌عنوان یک نویسه‌ی خط جدید تفسیر می‌شود. به‌عنوان جایگزین، " +"می‌توانید هر بک‌اسلش را در نسخه‌ی doctest دو بار تکرار کنید (و از یک رشته‌ی " +"خام استفاده نکنید)::" msgid "" ">>> def f(x):\n" @@ -386,9 +792,14 @@ msgid "" ">>> print(f.__doc__)\n" "Backslashes in a raw docstring: m\\n" msgstr "" +">>> def f(x):\n" +"... '''Backslashes in a raw docstring: m\\\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" msgid "The starting column doesn't matter::" -msgstr "" +msgstr "ستون آغازین اهمیتی ندارد::" msgid "" ">>> assert \"Easy!\"\n" @@ -396,27 +807,65 @@ msgid "" " >>> math.floor(1.9)\n" " 1" msgstr "" +">>> assert \"Easy!\"\n" +" >>> import math\n" +" >>> math.floor(1.9)\n" +" 1" -msgid "and as many leading whitespace characters are stripped from the expected output as appeared in the initial ``'>>> '`` line that started the example." +msgid "" +"and as many leading whitespace characters are stripped from the expected " +"output as appeared in the initial ``'>>> '`` line that started the example." msgstr "" +"و به همان تعداد نویسه‌ی فضای سفید ابتدایی که در خط نخست ``'>>> '`` آغازگر " +"مثال ظاهر شده است، از خروجی مورد انتظار حذف می‌شود." msgid "What's the Execution Context?" -msgstr "" +msgstr "زمینه اجرا (Execution Context) چیست؟" -msgid "By default, each time :mod:`!doctest` finds a docstring to test, it uses a *shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change the module's real globals, and so that one test in :mod:`!M` can't leave behind crumbs that accidentally allow another test to work. This means examples can freely use any names defined at top-level in :mod:`!M`, and names defined earlier in the docstring being run. Examples cannot see names defined in other docstrings." -msgstr "" +msgid "" +"By default, each time :mod:`!doctest` finds a docstring to test, it uses a " +"*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " +"the module's real globals, and so that one test in :mod:`!M` can't leave " +"behind crumbs that accidentally allow another test to work. This means " +"examples can freely use any names defined at top-level in :mod:`!M`, and " +"names defined earlier in the docstring being run. Examples cannot see names " +"defined in other docstrings." +msgstr "" +"به‌طور پیش‌فرض، هر بار که :mod:`!doctest` رشته مستندی برای آزمون پیدا " +"می‌کند، از یک *کپی کم‌عمق* از سراسری‌های :mod:`!M` استفاده می‌کند، تا اجرای " +"آزمون‌ها سراسری‌های واقعی ماژول را تغییر ندهد و تا یک آزمون در :mod:`!M` " +"نتواند بقایایی بر جای بگذارد که به‌طور تصادفی موجب کار کردن آزمون دیگری شود." +" این بدان معناست که مثال‌ها می‌توانند آزادانه از هر نامی که در سطح بالای " +":mod:`!M` تعریف شده است و از نام‌هایی که پیش‌تر در رشته مستندی که در حال " +"اجرا است تعریف شده‌اند، استفاده کنند. مثال‌ها نمی‌توانند نام‌های تعریف‌شده " +"در رشته مستندات‌های دیگر را ببینند." -msgid "You can force use of your own dict as the execution context by passing ``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." +msgid "" +"You can force use of your own dict as the execution context by passing " +"``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." msgstr "" +"در عوض، می‌توانید با ارسال ``globs=your_dict`` به :func:`testmod` یا " +":func:`testfile`، استفاده از دیکشنری خودتان را به‌عنوان زمینه اجرا تحمیل " +"کنید." msgid "What About Exceptions?" -msgstr "" +msgstr "در مورد استثناها چطور؟" -msgid "No problem, provided that the traceback is the only output produced by the example: just paste in the traceback. [#]_ Since tracebacks contain details that are likely to change rapidly (for example, exact file paths and line numbers), this is one case where doctest works hard to be flexible in what it accepts." -msgstr "" +msgid "" +"No problem, provided that the traceback is the only output produced by the " +"example: just paste in the traceback. [#]_ Since tracebacks contain details" +" that are likely to change rapidly (for example, exact file paths and line " +"numbers), this is one case where doctest works hard to be flexible in what " +"it accepts." +msgstr "" +"مشکلی نیست، به شرطی که ردگیری پشته تنها خروجی تولیدشده توسط مثال باشد: فقط " +"ردگیری پشته را بچسبانید. [#]_ از آنجا که ردگیری‌های پشته حاوی جزئیاتی هستند " +"که احتمالاً به‌سرعت تغییر می‌کنند (برای مثال، مسیرهای دقیق فایل و شماره " +"خطوط)، این یکی از مواردی است که doctest تلاش زیادی می‌کند تا نسبت به آنچه " +"می‌پذیرد انعطاف‌پذیر باشد." msgid "Simple example::" -msgstr "" +msgstr "مثال ساده::" msgid "" ">>> [1, 2, 3].remove(42)\n" @@ -424,23 +873,52 @@ msgid "" " File \"\", line 1, in \n" "ValueError: list.remove(x): x not in list" msgstr "" +">>> [1, 2, 3].remove(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: list.remove(x): x not in list" -msgid "That doctest succeeds if :exc:`ValueError` is raised, with the ``list.remove(x): x not in list`` detail as shown." +msgid "" +"That doctest succeeds if :exc:`ValueError` is raised, with the " +"``list.remove(x): x not in list`` detail as shown." msgstr "" +"آن doctest در صورتی موفق می‌شود که :exc:`ValueError` پرتاب شود، با جزئیات " +"``list.remove(x): x not in list`` همان‌طور که نشان داده شده است." -msgid "The expected output for an exception must start with a traceback header, which may be either of the following two lines, indented the same as the first line of the example::" +msgid "" +"The expected output for an exception must start with a traceback header, " +"which may be either of the following two lines, indented the same as the " +"first line of the example::" msgstr "" +"خروجی مورد انتظار برای یک استثنا باید با یک سرآیند ردگیری پشته شروع شود؛ این" +" سرآیند می‌تواند یکی از دو خط زیر باشد و تورفتگی آن باید مشابه خط اول مثال " +"باشد::" msgid "" "Traceback (most recent call last):\n" "Traceback (innermost last):" msgstr "" +"Traceback (most recent call last):\n" +"Traceback (innermost last):" -msgid "The traceback header is followed by an optional traceback stack, whose contents are ignored by doctest. The traceback stack is typically omitted, or copied verbatim from an interactive session." +msgid "" +"The traceback header is followed by an optional traceback stack, whose " +"contents are ignored by doctest. The traceback stack is typically omitted, " +"or copied verbatim from an interactive session." msgstr "" +"پس از سرآیند ردگیری پشته، یک پشته‌ی ردگیری اختیاری می‌آید که محتوای آن توسط " +"doctest نادیده گرفته می‌شود. پشته‌ی ردگیری معمولاً حذف می‌شود، یا عیناً از یک" +" نشست تعاملی کپی می‌شود." -msgid "The traceback stack is followed by the most interesting part: the line(s) containing the exception type and detail. This is usually the last line of a traceback, but can extend across multiple lines if the exception has a multi-line detail::" +msgid "" +"The traceback stack is followed by the most interesting part: the line(s) " +"containing the exception type and detail. This is usually the last line of " +"a traceback, but can extend across multiple lines if the exception has a " +"multi-line detail::" msgstr "" +"پس از پشته‌ی ردگیری، جالب‌ترین بخش می‌آید: خط(ها)ی حاوی نوع استثنا و جزئیات " +"آن. این معمولاً آخرین خط یک ردگیری است، اما اگر استثنا دارای جزئیات چندخطی " +"باشد، می‌تواند چندین خط را در بر بگیرد::" msgid "" ">>> raise ValueError('multi\\n line\\ndetail')\n" @@ -450,12 +928,28 @@ msgid "" " line\n" "detail" msgstr "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: multi\n" +" line\n" +"detail" -msgid "The last three lines (starting with :exc:`ValueError`) are compared against the exception's type and detail, and the rest are ignored." +msgid "" +"The last three lines (starting with :exc:`ValueError`) are compared against " +"the exception's type and detail, and the rest are ignored." msgstr "" +"سه خط آخر (که با :exc:`ValueError` شروع می‌شوند) با نوع و جزئیات استثنا " +"مقایسه می‌شوند، و بقیه نادیده گرفته می‌شوند." -msgid "Best practice is to omit the traceback stack, unless it adds significant documentation value to the example. So the last example is probably better as::" +msgid "" +"Best practice is to omit the traceback stack, unless it adds significant " +"documentation value to the example. So the last example is probably better " +"as::" msgstr "" +"بهترین روش این است که ردگیری پشته را حذف کنید، مگر اینکه ارزش مستندسازی " +"قابل‌توجهی به مثال ببخشد. بنابراین احتمالاً مثال آخر بهتر است به این صورت " +"باشد::" msgid "" ">>> raise ValueError('multi\\n line\\ndetail')\n" @@ -465,27 +959,87 @@ msgid "" " line\n" "detail" msgstr "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: multi\n" +" line\n" +"detail" -msgid "Note that tracebacks are treated very specially. In particular, in the rewritten example, the use of ``...`` is independent of doctest's :const:`ELLIPSIS` option. The ellipsis in that example could be left out, or could just as well be three (or three hundred) commas or digits, or an indented transcript of a Monty Python skit." -msgstr "" +msgid "" +"Note that tracebacks are treated very specially. In particular, in the " +"rewritten example, the use of ``...`` is independent of doctest's " +":const:`ELLIPSIS` option. The ellipsis in that example could be left out, " +"or could just as well be three (or three hundred) commas or digits, or an " +"indented transcript of a Monty Python skit." +msgstr "" +"توجه داشته باشید که با ردگیری‌های پشته برخورد بسیار ویژه‌ای می‌شود. به‌ویژه،" +" در مثال بازنویسی‌شده، استفاده از ``...`` مستقل از گزینه‌ی :const:`ELLIPSIS`" +" در doctest است. سه‌نقطه‌ی آن مثال می‌تواند حذف شود، یا به‌همان‌خوبی " +"می‌تواند سه (یا سیصد) کاما یا رقم، یا یک متن دارای تورفتگی از یک قطعه‌ی کمدی" +" مانتی پایتون باشد." msgid "Some details you should read once, but won't need to remember:" msgstr "" +"برخی جزئیات را باید یک بار بخوانید، اما نیازی به یادآوری آن‌ها نخواهید داشت:" -msgid "Doctest can't guess whether your expected output came from an exception traceback or from ordinary printing. So, e.g., an example that expects ``ValueError: 42 is prime`` will pass whether :exc:`ValueError` is actually raised or if the example merely prints that traceback text. In practice, ordinary output rarely begins with a traceback header line, so this doesn't create real problems." -msgstr "" +msgid "" +"Doctest can't guess whether your expected output came from an exception " +"traceback or from ordinary printing. So, e.g., an example that expects " +"``ValueError: 42 is prime`` will pass whether :exc:`ValueError` is actually " +"raised or if the example merely prints that traceback text. In practice, " +"ordinary output rarely begins with a traceback header line, so this doesn't " +"create real problems." +msgstr "" +"Doctest نمی‌تواند حدس بزند که خروجی مورد انتظار شما از ردگیری پشته‌ی یک " +"استثنا آمده است یا از چاپ معمولی. بنابراین، برای مثال، مثالی که انتظار " +"``ValueError: 42 is prime`` را دارد، قبول می‌شود؛ چه :exc:`ValueError` " +"واقعاً پرتاب شود و چه مثال صرفاً همان متن ردگیری پشته را چاپ کند. در عمل، " +"خروجی معمولی به‌ندرت با یک خط سرآیند ردگیری پشته آغاز می‌شود، بنابراین این " +"موضوع مشکل واقعی ایجاد نمی‌کند." -msgid "Each line of the traceback stack (if present) must be indented further than the first line of the example, *or* start with a non-alphanumeric character. The first line following the traceback header indented the same and starting with an alphanumeric is taken to be the start of the exception detail. Of course this does the right thing for genuine tracebacks." -msgstr "" +msgid "" +"Each line of the traceback stack (if present) must be indented further than " +"the first line of the example, *or* start with a non-alphanumeric character." +" The first line following the traceback header indented the same and " +"starting with an alphanumeric is taken to be the start of the exception " +"detail. Of course this does the right thing for genuine tracebacks." +msgstr "" +"هر خط از ردگیری پشته (در صورت وجود) باید بیشتر از خط اول مثال تورفتگی داشته " +"باشد، *یا* با یک نویسه‌ی غیرحرفی‌عددی شروع شود. نخستین خط پس از سرآیند ردگیری" +" پشته که تورفتگی یکسانی داشته باشد و با یک حرف یا عدد شروع شود، به‌عنوان " +"آغاز جزئیات استثنا در نظر گرفته می‌شود. البته این برای ردگیری‌های پشته‌ی " +"واقعی به‌درستی عمل می‌کند." -msgid "When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, everything following the leftmost colon and any module information in the exception name is ignored." +msgid "" +"When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " +"everything following the leftmost colon and any module information in the " +"exception name is ignored." msgstr "" +"هنگامی که گزینه‌ی doctest با نام :const:`IGNORE_EXCEPTION_DETAIL` مشخص شود، " +"هر آنچه پس از چپ‌ترین دونقطه بیاید و هرگونه اطلاعات ماژول در نام استثنا " +"نادیده گرفته می‌شود." -msgid "The interactive shell omits the traceback header line for some :exc:`SyntaxError`\\ s. But doctest uses the traceback header line to distinguish exceptions from non-exceptions. So in the rare case where you need to test a :exc:`!SyntaxError` that omits the traceback header, you will need to manually add the traceback header line to your test example." -msgstr "" +msgid "" +"The interactive shell omits the traceback header line for some " +":exc:`SyntaxError`\\ s. But doctest uses the traceback header line to " +"distinguish exceptions from non-exceptions. So in the rare case where you " +"need to test a :exc:`!SyntaxError` that omits the traceback header, you will" +" need to manually add the traceback header line to your test example." +msgstr "" +"پوسته تعاملی خط سرآیند ردگیری پشته را برای برخی از استثناهای " +":exc:`SyntaxError` حذف می‌کند. اما doctest از خط سرآیند ردگیری پشته برای " +"تمایز استثناها از غیراستثناها استفاده می‌کند. بنابراین در موارد نادری که " +"نیاز دارید یک :exc:`!SyntaxError` را که فاقد خط سرآیند ردگیری پشته است آزمون " +"کنید، لازم است خط سرآیند ردگیری پشته را به‌صورت دستی به مثال آزمون خود اضافه " +"کنید." -msgid "For some exceptions, Python displays the position of the error using ``^`` markers and tildes::" +msgid "" +"For some exceptions, Python displays the position of the error using ``^`` " +"markers and tildes::" msgstr "" +"برای برخی استثناها، پایتون موقعیت خطا را با نشانگرهای ``^`` و تیلداها نمایش " +"می‌دهد::" msgid "" ">>> 1 + None\n" @@ -494,9 +1048,21 @@ msgid "" " ~~^~~~~~\n" "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" msgstr "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ~~^~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" -msgid "Since the lines showing the position of the error come before the exception type and detail, they are not checked by doctest. For example, the following test would pass, even though it puts the ``^`` marker in the wrong location::" +msgid "" +"Since the lines showing the position of the error come before the exception " +"type and detail, they are not checked by doctest. For example, the " +"following test would pass, even though it puts the ``^`` marker in the wrong" +" location::" msgstr "" +"از آنجا که خط‌هایی که موقعیت خطا را نشان می‌دهند پیش از نوع استثنا و جزئیات " +"آن می‌آیند، توسط doctest بررسی نمی‌شوند. برای مثال، آزمون زیر قبول می‌شود، " +"حتی اگر نشانگر ``^`` را در مکان نادرست قرار دهد::" msgid "" ">>> 1 + None\n" @@ -505,33 +1071,125 @@ msgid "" " ^~~~~~~~\n" "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" msgstr "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ^~~~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" msgid "Option Flags" -msgstr "" +msgstr "پرچم‌های گزینه" -msgid "A number of option flags control various aspects of doctest's behavior. Symbolic names for the flags are supplied as module constants, which can be :ref:`bitwise ORed ` together and passed to various functions. The names can also be used in :ref:`doctest directives `, and may be passed to the doctest command line interface via the ``-o`` option." -msgstr "" +msgid "" +"A number of option flags control various aspects of doctest's behavior. " +"Symbolic names for the flags are supplied as module constants, which can be " +":ref:`bitwise ORed ` together and passed to various functions. The " +"names can also be used in :ref:`doctest directives `, " +"and may be passed to the doctest command line interface via the ``-o`` " +"option." +msgstr "" +"تعدادی از پرچم‌های گزینه، جنبه‌های مختلف رفتار doctest را کنترل می‌کنند. " +"نام‌های نمادین این پرچم‌ها به‌عنوان ثابت‌های ماژول ارائه شده‌اند و می‌توان " +"آن‌ها را با هم به‌صورت :ref:`OR بیتی ` ترکیب کرد و به توابع مختلف " +"فرستاد. این نام‌ها همچنین می‌توانند در :ref:`دایرکتیوهای doctest " +"` استفاده شوند و از طریق گزینه ``-o`` به رابط خط فرمان " +"doctest فرستاده شوند." -msgid "The first group of options define test semantics, controlling aspects of how doctest decides whether actual output matches an example's expected output:" +msgid "" +"The first group of options define test semantics, controlling aspects of how" +" doctest decides whether actual output matches an example's expected output:" msgstr "" +"اولین گروه از گزینه‌ها، معنای آزمون را تعریف می‌کنند و جنبه‌هایی از چگونگی " +"تصمیم‌گیری doctest در مورد این‌که آیا خروجی واقعی با خروجی مورد انتظار یک " +"مثال مطابقت دارد یا نه را کنترل می‌کنند:" -msgid "By default, if an expected output block contains just ``1``, an actual output block containing just ``1`` or just ``True`` is considered to be a match, and similarly for ``0`` versus ``False``. When :const:`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is allowed. The default behavior caters to that Python changed the return type of many functions from integer to boolean; doctests expecting \"little integer\" output still work in these cases. This option will probably go away, but not for several years." -msgstr "" +msgid "" +"By default, if an expected output block contains just ``1``, an actual " +"output block containing just ``1`` or just ``True`` is considered to be a " +"match, and similarly for ``0`` versus ``False``. When " +":const:`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is " +"allowed. The default behavior caters to that Python changed the return type" +" of many functions from integer to boolean; doctests expecting \"little " +"integer\" output still work in these cases. This option will probably go " +"away, but not for several years." +msgstr "" +"به‌طور پیش‌فرض، اگر یک بلوک خروجی مورد انتظار فقط شامل ``1`` باشد، بلوک " +"خروجی واقعی که فقط شامل ``1`` یا فقط ``True`` باشد، به‌عنوان تطابق در نظر " +"گرفته می‌شود، و به‌همین ترتیب برای ``0`` در برابر ``False`` نیز چنین است. " +"هنگامی که :const:`DONT_ACCEPT_TRUE_FOR_1` مشخص شده باشد، هیچ‌یک از این " +"جایگزینی‌ها مجاز نیست. رفتار پیش‌فرض با این واقعیت سازگار است که پایتون نوع " +"بازگشتی بسیاری از توابع را از عدد صحیح به بولی تغییر داده است؛ doctestهایی " +"که انتظار خروجی «عدد صحیح کوچک» دارند، در این موارد همچنان کار می‌کنند. این " +"گزینه احتمالاً حذف خواهد شد، اما نه برای چندین سال." -msgid "By default, if an expected output block contains a line containing only the string ````, then that line will match a blank line in the actual output. Because a genuinely blank line delimits the expected output, this is the only way to communicate that a blank line is expected. When :const:`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." -msgstr "" +msgid "" +"By default, if an expected output block contains a line containing only the " +"string ````, then that line will match a blank line in the actual" +" output. Because a genuinely blank line delimits the expected output, this " +"is the only way to communicate that a blank line is expected. When " +":const:`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not " +"allowed." +msgstr "" +"به‌طور پیش‌فرض، اگر یک بلوک خروجی مورد انتظار شامل خطی باشد که فقط شامل " +"رشته‌ی ```` است، آن خط با یک خط خالی در خروجی واقعی مطابقت خواهد " +"داشت. از آنجا که یک خط خالی واقعی پایان خروجی مورد انتظار را مشخص می‌کند، " +"این تنها راه برای اعلام این است که یک خط خالی مورد انتظار است. هنگامی که " +":const:`DONT_ACCEPT_BLANKLINE` مشخص شده باشد، این جایگزینی مجاز نیست." -msgid "When specified, all sequences of whitespace (blanks and newlines) are treated as equal. Any sequence of whitespace within the expected output will match any sequence of whitespace within the actual output. By default, whitespace must match exactly. :const:`NORMALIZE_WHITESPACE` is especially useful when a line of expected output is very long, and you want to wrap it across multiple lines in your source." -msgstr "" +msgid "" +"When specified, all sequences of whitespace (blanks and newlines) are " +"treated as equal. Any sequence of whitespace within the expected output " +"will match any sequence of whitespace within the actual output. By default, " +"whitespace must match exactly. :const:`NORMALIZE_WHITESPACE` is especially " +"useful when a line of expected output is very long, and you want to wrap it " +"across multiple lines in your source." +msgstr "" +"در صورت مشخص شدن، تمام دنباله‌های فضای سفید (فاصله‌ها و خط‌های جدید) یکسان " +"در نظر گرفته می‌شوند. هر دنباله‌ای از فضای سفید در خروجی مورد انتظار با هر " +"دنباله‌ای از فضای سفید در خروجی واقعی مطابقت خواهد داشت. به‌طور پیش‌فرض، " +"فضای سفید باید دقیقاً مطابقت داشته باشد. :const:`NORMALIZE_WHITESPACE` " +"به‌ویژه زمانی مفید است که یک خط از خروجی مورد انتظار بسیار طولانی باشد و " +"بخواهید آن را در کد منبع خود در چند خط بشکنید." -msgid "When specified, an ellipsis marker (``...``) in the expected output can match any substring in the actual output. This includes substrings that span line boundaries, and empty substrings, so it's best to keep usage of this simple. Complicated uses can lead to the same kinds of \"oops, it matched too much!\" surprises that ``.*`` is prone to in regular expressions." -msgstr "" +msgid "" +"When specified, an ellipsis marker (``...``) in the expected output can " +"match any substring in the actual output. This includes substrings that " +"span line boundaries, and empty substrings, so it's best to keep usage of " +"this simple. Complicated uses can lead to the same kinds of \"oops, it " +"matched too much!\" surprises that ``.*`` is prone to in regular " +"expressions." +msgstr "" +"در صورت مشخص شدن، نشانگر سه‌نقطه (``...``) در خروجی مورد انتظار می‌تواند با " +"هر زیررشته‌ای در خروجی واقعی مطابقت کند. این شامل زیررشته‌هایی می‌شود که از " +"مرزهای خطوط می‌گذرند، و شامل زیررشته‌های خالی نیز می‌شود؛ بنابراین بهتر است " +"استفاده از آن را ساده نگه دارید. استفاده‌های پیچیده می‌توانند به همان انواع " +"غافلگیری‌های «ای وای، بیش از حد مطابقت کرد!» منجر شوند که ``.*`` در عبارات " +"باقاعده مستعد ایجاد آن‌هاست." -msgid "When specified, doctests expecting exceptions pass so long as an exception of the expected type is raised, even if the details (message and fully qualified exception name) don't match." +msgid "" +"When specified, doctests expecting exceptions pass so long as an exception " +"of the expected type is raised, even if the details (message and fully " +"qualified exception name) don't match." msgstr "" +"در صورت مشخص شدن، doctestهایی که انتظار استثنا دارند، تا زمانی که استثنایی " +"از نوع مورد انتظار پرتاب شود، موفق می‌شوند، حتی اگر جزئیات (پیام و نام کامل " +"استثنا) مطابقت نداشته باشند." -msgid "For example, an example expecting ``ValueError: 42`` will pass if the actual exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:`TypeError` is raised instead. It will also ignore any fully qualified name included before the exception class, which can vary between implementations and versions of Python and the code/libraries in use. Hence, all three of these variations will work with the flag specified:" -msgstr "" +msgid "" +"For example, an example expecting ``ValueError: 42`` will pass if the actual" +" exception raised is ``ValueError: 3*14``, but will fail if, say, a " +":exc:`TypeError` is raised instead. It will also ignore any fully qualified " +"name included before the exception class, which can vary between " +"implementations and versions of Python and the code/libraries in use. Hence," +" all three of these variations will work with the flag specified:" +msgstr "" +"برای مثال، مثالی که انتظار ``ValueError: 42`` را دارد، در صورتی موفق می‌شود " +"که استثنای واقعی پرتاب‌شده ``ValueError: 3*14`` باشد، اما اگر، مثلاً، به‌جای" +" آن استثنای :exc:`TypeError` پرتاب شود، ناموفق خواهد بود. همچنین هر نام " +"کاملاً مشخصی (fully qualified name) را که پیش از کلاس استثنا آمده باشد " +"نادیده می‌گیرد، که این نام ممکن است بین پیاده‌سازی‌ها و نسخه‌های پایتون و " +"کد/کتابخانه‌های در حال استفاده متفاوت باشد. بنابراین، هر سه مورد از این " +"حالت‌ها با پرچم مشخص‌شده کار خواهند کرد:" msgid "" ">>> raise Exception('message')\n" @@ -546,143 +1204,326 @@ msgid "" "Traceback (most recent call last):\n" "__main__.Exception: message" msgstr "" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"builtins.Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"__main__.Exception: message" -msgid "Note that :const:`ELLIPSIS` can also be used to ignore the details of the exception message, but such a test may still fail based on whether the module name is present or matches exactly." +msgid "" +"Note that :const:`ELLIPSIS` can also be used to ignore the details of the " +"exception message, but such a test may still fail based on whether the " +"module name is present or matches exactly." msgstr "" +"توجه داشته باشید که می‌توان از :const:`ELLIPSIS` همچنین برای نادیده گرفتن " +"جزئیات پیام استثنا استفاده کرد، اما چنین آزمونی ممکن است همچنان بسته به " +"اینکه نام ماژول موجود باشد یا دقیقاً مطابقت داشته باشد، شکست بخورد." -msgid ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating to the module containing the exception under test." +msgid "" +":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " +"to the module containing the exception under test." msgstr "" +":const:`IGNORE_EXCEPTION_DETAIL` اکنون هرگونه اطلاعات مربوط به ماژول حاوی " +"استثنای در حال آزمون را نیز نادیده می‌گیرد." -msgid "When specified, do not run the example at all. This can be useful in contexts where doctest examples serve as both documentation and test cases, and an example should be included for documentation purposes, but should not be checked. E.g., the example's output might be random; or the example might depend on resources which would be unavailable to the test driver." -msgstr "" +msgid "" +"When specified, do not run the example at all. This can be useful in " +"contexts where doctest examples serve as both documentation and test cases, " +"and an example should be included for documentation purposes, but should not" +" be checked. E.g., the example's output might be random; or the example " +"might depend on resources which would be unavailable to the test driver." +msgstr "" +"هنگامی که مشخص شده باشد، مثال به‌هیچ‌وجه اجرا نمی‌شود. این می‌تواند در " +"زمینه‌هایی مفید باشد که مثال‌های doctest هم به‌عنوان مستندات و هم به‌عنوان " +"موارد آزمون به کار می‌روند و باید مثالی برای اهداف مستندسازی گنجانده شود، " +"اما نباید بررسی شود. برای مثال، ممکن است خروجی مثال تصادفی باشد؛ یا مثال " +"ممکن است به منابعی وابسته باشد که برای راه‌انداز آزمون (test driver) در " +"دسترس نباشند." -msgid "The SKIP flag can also be used for temporarily \"commenting out\" examples." +msgid "" +"The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" +"همچنین می‌توان از پرچم SKIP برای «کامنت کردن» موقت مثال‌ها استفاده کرد." msgid "A bitmask or'ing together all the comparison flags above." msgstr "" +"یک نقاب بیتی (bitmask) حاصل از ترکیب همه‌ی پرچم‌های مقایسه‌ی بالا با عملگر " +"OR." msgid "The second group of options controls how test failures are reported:" -msgstr "" +msgstr "گروه دوم گزینه‌ها، نحوه گزارش شکست آزمون‌ها را کنترل می‌کند:" -msgid "When specified, failures that involve multi-line expected and actual outputs are displayed using a unified diff." +msgid "" +"When specified, failures that involve multi-line expected and actual outputs" +" are displayed using a unified diff." msgstr "" +"در صورت مشخص شدن، شکست‌هایی که شامل خروجی‌های مورد انتظار و واقعی چندخطی " +"هستند، با استفاده از تفاوت یکپارچه (unified diff) نمایش داده می‌شوند." -msgid "When specified, failures that involve multi-line expected and actual outputs will be displayed using a context diff." +msgid "" +"When specified, failures that involve multi-line expected and actual outputs" +" will be displayed using a context diff." msgstr "" +"در صورت مشخص شدن، شکست‌هایی که خروجی‌های مورد انتظار و واقعی آن‌ها چندخطی " +"هستند، با استفاده از diff زمینه‌ای (context diff) نمایش داده می‌شوند." -msgid "When specified, differences are computed by ``difflib.Differ``, using the same algorithm as the popular :file:`ndiff.py` utility. This is the only method that marks differences within lines as well as across lines. For example, if a line of expected output contains digit ``1`` where actual output contains letter ``l``, a line is inserted with a caret marking the mismatching column positions." -msgstr "" +msgid "" +"When specified, differences are computed by ``difflib.Differ``, using the " +"same algorithm as the popular :file:`ndiff.py` utility. This is the only " +"method that marks differences within lines as well as across lines. For " +"example, if a line of expected output contains digit ``1`` where actual " +"output contains letter ``l``, a line is inserted with a caret marking the " +"mismatching column positions." +msgstr "" +"در صورت تعیین شدن، تفاوت‌ها توسط ``difflib.Differ`` و با استفاده از همان " +"الگوریتم ابزار محبوب :file:`ndiff.py` محاسبه می‌شوند. این تنها متدی است که " +"تفاوت‌ها را هم درون خطوط و هم میان خطوط علامت‌گذاری می‌کند. برای مثال، اگر " +"یک خط از خروجی مورد انتظار شامل رقم ``1`` باشد در حالی که خروجی واقعی شامل " +"حرف ``l`` باشد، خطی درج می‌شود که با علامت ^ موقعیت‌های ستونی ناهمخوان را " +"مشخص می‌کند." -msgid "When specified, display the first failing example in each doctest, but suppress output for all remaining examples. This will prevent doctest from reporting correct examples that break because of earlier failures; but it might also hide incorrect examples that fail independently of the first failure. When :const:`REPORT_ONLY_FIRST_FAILURE` is specified, the remaining examples are still run, and still count towards the total number of failures reported; only the output is suppressed." -msgstr "" +msgid "" +"When specified, display the first failing example in each doctest, but " +"suppress output for all remaining examples. This will prevent doctest from " +"reporting correct examples that break because of earlier failures; but it " +"might also hide incorrect examples that fail independently of the first " +"failure. When :const:`REPORT_ONLY_FIRST_FAILURE` is specified, the " +"remaining examples are still run, and still count towards the total number " +"of failures reported; only the output is suppressed." +msgstr "" +"در صورت تعیین شدن، نخستین مثال ناموفق در هر doctest نمایش داده می‌شود، اما " +"خروجی تمام مثال‌های باقی‌مانده سرکوب می‌شود. این کار مانع از آن می‌شود که " +"doctest مثال‌های درستی را گزارش کند که به دلیل شکست‌های پیشین خراب می‌شوند؛ " +"اما ممکن است مثال‌های نادرستی را نیز پنهان کند که مستقل از نخستین شکست، شکست" +" می‌خورند. هنگامی که :const:`REPORT_ONLY_FIRST_FAILURE` تعیین شود، مثال‌های " +"باقی‌مانده همچنان اجرا می‌شوند و همچنان در تعداد کل شکست‌های گزارش‌شده لحاظ " +"می‌شوند؛ فقط خروجی سرکوب می‌شود." -msgid "When specified, exit after the first failing example and don't attempt to run the remaining examples. Thus, the number of failures reported will be at most 1. This flag may be useful during debugging, since examples after the first failure won't even produce debugging output." +msgid "" +"When specified, exit after the first failing example and don't attempt to " +"run the remaining examples. Thus, the number of failures reported will be at" +" most 1. This flag may be useful during debugging, since examples after the" +" first failure won't even produce debugging output." msgstr "" +"در صورت مشخص شدن، پس از نخستین مثال شکست‌خورده خارج می‌شود و برای اجرای " +"مثال‌های باقی‌مانده تلاشی نمی‌کند. بنابراین، تعداد شکست‌های گزارش‌شده حداکثر" +" ۱ خواهد بود. این پرچم ممکن است در حین اشکال‌زدایی مفید باشد، زیرا مثال‌های " +"پس از نخستین شکست حتی خروجی اشکال‌زدایی تولید نمی‌کنند." msgid "A bitmask or'ing together all the reporting flags above." msgstr "" +"نقاب بیتی (bitmask) که همه‌ی پرچم‌های گزارش‌دهی بالا را با OR بیتی ترکیب " +"می‌کند." -msgid "There is also a way to register new option flag names, though this isn't useful unless you intend to extend :mod:`!doctest` internals via subclassing:" +msgid "" +"There is also a way to register new option flag names, though this isn't " +"useful unless you intend to extend :mod:`!doctest` internals via " +"subclassing:" msgstr "" +"همچنین راهی برای ثبت نام‌های جدید پرچم‌های گزینه وجود دارد، هرچند این کار " +"مفید نیست مگر اینکه قصد داشته باشید درونی‌های :mod:`!doctest` را از طریق " +"زیرکلاس‌سازی گسترش دهید:" -msgid "Create a new option flag with a given name, and return the new flag's integer value. :func:`register_optionflag` can be used when subclassing :class:`OutputChecker` or :class:`DocTestRunner` to create new options that are supported by your subclasses. :func:`register_optionflag` should always be called using the following idiom::" -msgstr "" +msgid "" +"Create a new option flag with a given name, and return the new flag's " +"integer value. :func:`register_optionflag` can be used when subclassing " +":class:`OutputChecker` or :class:`DocTestRunner` to create new options that " +"are supported by your subclasses. :func:`register_optionflag` should always" +" be called using the following idiom::" +msgstr "" +"یک پرچم گزینه جدید با نام داده‌شده ایجاد می‌کند و مقدار عدد صحیح پرچم جدید " +"را برمی‌گرداند. می‌توان از :func:`register_optionflag` هنگام زیرکلاس‌سازی از" +" :class:`OutputChecker` یا :class:`DocTestRunner` برای ایجاد گزینه‌های جدیدی" +" که توسط زیرکلاس‌های شما پشتیبانی می‌شوند استفاده کرد. " +":func:`register_optionflag` باید همیشه با استفاده از الگوی زیر فراخوانی " +"شود::" msgid "MY_FLAG = register_optionflag('MY_FLAG')" -msgstr "" +msgstr "MY_FLAG = register_optionflag('MY_FLAG')" msgid "Directives" -msgstr "" +msgstr "دایرکتیوها" -msgid "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python comments following an example's source code:" +msgid "" +"Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " +"comments following an example's source code:" msgstr "" +"می‌توان از دایرکتیوهای doctest برای تغییر :ref:`پرچم‌های گزینه ` برای یک مثال منفرد استفاده کرد. دایرکتیوهای doctest، توضیحات ویژه " +"پایتون هستند که پس از کد منبع یک مثال می‌آیند:" -msgid "Whitespace is not allowed between the ``+`` or ``-`` and the directive option name. The directive option name can be any of the option flag names explained above." +msgid "" +"Whitespace is not allowed between the ``+`` or ``-`` and the directive " +"option name. The directive option name can be any of the option flag names " +"explained above." msgstr "" +"فضای سفید میان ``+`` یا ``-`` و نام گزینه‌ی دایرکتیو مجاز نیست. نام گزینه‌ی" +" دایرکتیو می‌تواند هر یک از نام‌های پرچم گزینه باشد که در بالا توضیح داده " +"شده‌اند." -msgid "An example's doctest directives modify doctest's behavior for that single example. Use ``+`` to enable the named behavior, or ``-`` to disable it." +msgid "" +"An example's doctest directives modify doctest's behavior for that single " +"example. Use ``+`` to enable the named behavior, or ``-`` to disable it." msgstr "" +"دایرکتیوهای doctestِ یک مثال، رفتار doctest را برای همان یک مثال تغییر " +"می‌دهند. برای فعال کردن رفتار نام‌برده از ``+`` و برای غیرفعال کردن آن از " +"``-`` استفاده کنید." msgid "For example, this test passes:" -msgstr "" +msgstr "برای مثال، این آزمون قبول می‌شود:" msgid "" ">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" "10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" +"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" -msgid "Without the directive it would fail, both because the actual output doesn't have two blanks before the single-digit list elements, and because the actual output is on a single line. This test also passes, and also requires a directive to do so:" +msgid "" +"Without the directive it would fail, both because the actual output doesn't " +"have two blanks before the single-digit list elements, and because the " +"actual output is on a single line. This test also passes, and also requires" +" a directive to do so:" msgstr "" +"بدون دایرکتیو (directive) این آزمون شکست می‌خورد، هم به این دلیل که خروجی واقعی" +" پیش از المان‌های فهرست تک‌رقمی ۲ فاصله‌ی خالی ندارد، و هم به این دلیل که " +"خروجی واقعی در یک خط واحد قرار دارد. این آزمون نیز قبول می‌شود، و برای این " +"کار نیز به یک دایرکتیو (directive) نیاز دارد:" msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"[0, 1, ..., 18, 19]" -msgid "Multiple directives can be used on a single physical line, separated by commas:" +msgid "" +"Multiple directives can be used on a single physical line, separated by " +"commas:" msgstr "" +"می‌توان چندین دایرکتیو (directives) را در یک خط فیزیکی واحد استفاده کرد، که با " +"کاما از هم جدا شده‌اند:" msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" -msgid "If multiple directive comments are used for a single example, then they are combined:" +msgid "" +"If multiple directive comments are used for a single example, then they are " +"combined:" msgstr "" +"اگر برای یک مثال از چندین کامنت دایرکتیو (directive comments) استفاده شود، " +"آن‌ها با هم ترکیب می‌شوند:" msgid "" ">>> print(list(range(20))) # doctest: +ELLIPSIS\n" "... # doctest: +NORMALIZE_WHITESPACE\n" "[0, 1, ..., 18, 19]" msgstr "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"... # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" -msgid "As the previous example shows, you can add ``...`` lines to your example containing only directives. This can be useful when an example is too long for a directive to comfortably fit on the same line:" +msgid "" +"As the previous example shows, you can add ``...`` lines to your example " +"containing only directives. This can be useful when an example is too long " +"for a directive to comfortably fit on the same line:" msgstr "" +"همان‌طور که مثال پیشین نشان می‌دهد، می‌توانید خطوط ``...`` را به مثال خود " +"اضافه کنید که فقط حاوی دایرکتیوها (directives) باشند. این می‌تواند زمانی " +"مفید باشد که یک مثال آن‌قدر طولانی است که یک دایرکتیو (directive) به‌راحتی " +"در همان خط جا نمی‌شود:" msgid "" ">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" "... # doctest: +ELLIPSIS\n" "[0, ..., 4, 10, ..., 19, 30, ..., 39]" msgstr "" +">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" +"... # doctest: +ELLIPSIS\n" +"[0, ..., 4, 10, ..., 19, 30, ..., 39]" -msgid "Note that since all options are disabled by default, and directives apply only to the example they appear in, enabling options (via ``+`` in a directive) is usually the only meaningful choice. However, option flags can also be passed to functions that run doctests, establishing different defaults. In such cases, disabling an option via ``-`` in a directive can be useful." -msgstr "" +msgid "" +"Note that since all options are disabled by default, and directives apply " +"only to the example they appear in, enabling options (via ``+`` in a " +"directive) is usually the only meaningful choice. However, option flags can" +" also be passed to functions that run doctests, establishing different " +"defaults. In such cases, disabling an option via ``-`` in a directive can " +"be useful." +msgstr "" +"توجه داشته باشید که چون همه‌ی گزینه‌ها به‌طور پیش‌فرض غیرفعال هستند و " +"دایرکتیوها فقط بر مثالی که در آن قرار دارند اعمال می‌شوند، فعال کردن " +"گزینه‌ها (از طریق ``+`` در یک دایرکتیو) معمولاً تنها انتخاب معنادار است. " +"با این حال، پرچم‌های گزینه را نیز می‌توان به توابعی که doctestها را اجرا " +"می‌کنند ارسال کرد و بدین ترتیب پیش‌فرض‌های متفاوتی برقرار ساخت. در چنین " +"مواردی، غیرفعال کردن یک گزینه از طریق ``-`` در یک دایرکتیو می‌تواند مفید " +"باشد." msgid "Warnings" -msgstr "" +msgstr "هشدارها" -msgid ":mod:`!doctest` is serious about requiring exact matches in expected output. If even a single character doesn't match, the test fails. This will probably surprise you a few times, as you learn exactly what Python does and doesn't guarantee about output. For example, when printing a set, Python doesn't guarantee that the element is printed in any particular order, so a test like ::" -msgstr "" +msgid "" +":mod:`!doctest` is serious about requiring exact matches in expected output." +" If even a single character doesn't match, the test fails. This will " +"probably surprise you a few times, as you learn exactly what Python does and" +" doesn't guarantee about output. For example, when printing a set, Python " +"doesn't guarantee that the element is printed in any particular order, so a " +"test like ::" +msgstr "" +":mod:`!doctest` در الزام به تطابق دقیق در خروجی مورد انتظار سخت‌گیر است. اگر" +" حتی یک نویسه مطابقت نداشته باشد، آزمون شکست می‌خورد. این موضوع احتمالاً چند " +"بار شما را غافلگیر خواهد کرد، هنگامی که دقیقاً یاد می‌گیرید که پایتون درباره" +" خروجی چه چیزی را تضمین می‌کند و چه چیزی را تضمین نمی‌کند. برای مثال، هنگام " +"چاپ یک مجموعه، پایتون تضمین نمی‌کند که المان‌ها با ترتیب خاصی چاپ شوند، " +"بنابراین آزمونی مانند ::" msgid "" ">>> foo()\n" "{\"spam\", \"eggs\"}" msgstr "" +">>> foo()\n" +"{\"spam\", \"eggs\"}" msgid "is vulnerable! One workaround is to do ::" -msgstr "" +msgstr "آسیب‌پذیر است! یک راه‌حل موقت این است که ::" msgid "" ">>> foo() == {\"spam\", \"eggs\"}\n" "True" msgstr "" +">>> foo() == {\"spam\", \"eggs\"}\n" +"True" msgid "instead. Another is to do ::" -msgstr "" +msgstr "در عوض. راه دیگر این است که آن را انجام دهید ::" msgid "" ">>> d = sorted(foo())\n" ">>> d\n" "['eggs', 'spam']" msgstr "" +">>> d = sorted(foo())\n" +">>> d\n" +"['eggs', 'spam']" msgid "There are others, but you get the idea." -msgstr "" +msgstr "موارد دیگری نیز وجود دارند، اما منظور را متوجه می‌شوید." msgid "Another bad idea is to print things that embed an object address, like" msgstr "" +"ایده بد دیگر چاپ مواردی است که آدرس شیء در آن‌ها جاسازی شده‌است، مانند" msgid "" ">>> id(1.0) # certain to fail some of the time\n" @@ -691,17 +1532,31 @@ msgid "" ">>> C() # the default repr() for instances embeds an address\n" "" msgstr "" +">>> id(1.0) # certain to fail some of the time\n" +"7948648\n" +">>> class C: pass\n" +">>> C() # the default repr() for instances embeds an address\n" +"" -msgid "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" -msgstr "" +msgid "" +"The :const:`ELLIPSIS` directive gives a nice approach for the last example:" +msgstr "دایرکتیو :const:`ELLIPSIS` رویکرد مناسبی برای آخرین مثال ارائه می‌دهد:" msgid "" ">>> C() # doctest: +ELLIPSIS\n" "" msgstr "" +">>> C() # doctest: +ELLIPSIS\n" +"" -msgid "Floating-point numbers are also subject to small output variations across platforms, because Python defers to the platform C library for some floating-point calculations, and C libraries vary widely in quality here. ::" +msgid "" +"Floating-point numbers are also subject to small output variations across " +"platforms, because Python defers to the platform C library for some " +"floating-point calculations, and C libraries vary widely in quality here. ::" msgstr "" +"اعداد ممیز شناور نیز در پلتفرم‌های مختلف دچار تفاوت‌های کوچک در خروجی " +"می‌شوند، زیرا پایتون برخی محاسبات ممیز شناور را به کتابخانه C پلتفرم واگذار " +"می‌کند و کتابخانه‌های C از نظر کیفیت در این زمینه بسیار متفاوت هستند. ::" msgid "" ">>> 1000**0.1 # risky\n" @@ -711,116 +1566,336 @@ msgid "" ">>> print(f'{1000**0.1:.4f}') # much safer\n" "1.9953" msgstr "" +">>> 1000**0.1 # risky\n" +"1.9952623149688797\n" +">>> round(1000**0.1, 9) # safer\n" +"1.995262315\n" +">>> print(f'{1000**0.1:.4f}') # much safer\n" +"1.9953" -msgid "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often contrive doctest examples to produce numbers of that form::" +msgid "" +"Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " +"contrive doctest examples to produce numbers of that form::" msgstr "" +"اعدادی به شکل ``I/2.**J`` در همه‌ی سکوها ایمن هستند، و من اغلب مثال‌های " +"doctest را به‌گونه‌ای طراحی می‌کنم که اعدادی به آن شکل تولید کنند::" msgid "" ">>> 3./4 # utterly safe\n" "0.75" msgstr "" +">>> 3./4 # utterly safe\n" +"0.75" -msgid "Simple fractions are also easier for people to understand, and that makes for better documentation." +msgid "" +"Simple fractions are also easier for people to understand, and that makes " +"for better documentation." msgstr "" +"درک کسرهای ساده نیز برای افراد آسان‌تر است و این موضوع باعث بهتر شدن مستندات" +" می‌شود." msgid "Basic API" -msgstr "" +msgstr "API پایه" -msgid "The functions :func:`testmod` and :func:`testfile` provide a simple interface to doctest that should be sufficient for most basic uses. For a less formal introduction to these two functions, see sections :ref:`doctest-simple-testmod` and :ref:`doctest-simple-testfile`." +msgid "" +"The functions :func:`testmod` and :func:`testfile` provide a simple " +"interface to doctest that should be sufficient for most basic uses. For a " +"less formal introduction to these two functions, see sections :ref:`doctest-" +"simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" +"تابع‌های :func:`testmod` و :func:`testfile` رابط ساده‌ای برای doctest فراهم " +"می‌کنند که باید برای بیشتر استفاده‌های پایه کافی باشد. برای آشنایی " +"غیررسمی‌تر با این دو تابع، بخش‌های :ref:`doctest-simple-testmod` و " +":ref:`doctest-simple-testfile` را ببینید." -msgid "All arguments except *filename* are optional, and should be specified in keyword form." +msgid "" +"All arguments except *filename* are optional, and should be specified in " +"keyword form." msgstr "" +"همه آرگومان‌ها به‌جز *filename* اختیاری هستند و باید به‌صورت آرگومان " +"کلیدواژه‌ای مشخص شوند." -msgid "Test examples in the file named *filename*. Return ``(failure_count, test_count)``." +msgid "" +"Test examples in the file named *filename*. Return ``(failure_count, " +"test_count)``." msgstr "" +"مثال‌های موجود در فایلی با نام *filename* را آزمون می‌کند. ``(failure_count, " +"test_count)`` را برمی‌گرداند." -msgid "Optional argument *module_relative* specifies how the filename should be interpreted:" +msgid "" +"Optional argument *module_relative* specifies how the filename should be " +"interpreted:" msgstr "" +"آرگومان اختیاری *module_relative* مشخص می‌کند که نام فایل چگونه باید تفسیر " +"شود:" -msgid "If *module_relative* is ``True`` (the default), then *filename* specifies an OS-independent module-relative path. By default, this path is relative to the calling module's directory; but if the *package* argument is specified, then it is relative to that package. To ensure OS-independence, *filename* should use ``/`` characters to separate path segments, and may not be an absolute path (i.e., it may not begin with ``/``)." -msgstr "" +msgid "" +"If *module_relative* is ``True`` (the default), then *filename* specifies an" +" OS-independent module-relative path. By default, this path is relative to " +"the calling module's directory; but if the *package* argument is specified, " +"then it is relative to that package. To ensure OS-independence, *filename* " +"should use ``/`` characters to separate path segments, and may not be an " +"absolute path (i.e., it may not begin with ``/``)." +msgstr "" +"اگر *module_relative* برابر ``True`` باشد (حالت پیش‌فرض)، آنگاه *filename* " +"یک مسیر مستقل از سیستم‌عامل و نسبت به ماژول را مشخص می‌کند. به‌طور پیش‌فرض، " +"این مسیر نسبت به پوشه‌ی ماژول فراخوان است؛ اما اگر آرگومان *package* مشخص شده" +" باشد، نسبت به آن بسته است. برای اطمینان از استقلال از سیستم‌عامل، " +"*filename* باید از نویسه‌های ``/`` برای جداسازی بخش‌های مسیر استفاده کند و " +"نباید یک مسیر مطلق باشد (یعنی نباید با ``/`` شروع شود)." -msgid "If *module_relative* is ``False``, then *filename* specifies an OS-specific path. The path may be absolute or relative; relative paths are resolved with respect to the current working directory." +msgid "" +"If *module_relative* is ``False``, then *filename* specifies an OS-specific " +"path. The path may be absolute or relative; relative paths are resolved " +"with respect to the current working directory." msgstr "" +"اگر *module_relative* برابر ``False`` باشد، آنگاه *filename* مسیری مختص " +"سیستم‌عامل را مشخص می‌کند. این مسیر ممکن است مطلق یا نسبی باشد؛ مسیرهای نسبی" +" با توجه به پوشه کاری فعلی تعیین می‌شوند." -msgid "Optional argument *name* gives the name of the test; by default, or if ``None``, ``os.path.basename(filename)`` is used." +msgid "" +"Optional argument *name* gives the name of the test; by default, or if " +"``None``, ``os.path.basename(filename)`` is used." msgstr "" +"آرگومان اختیاری *name* نام آزمون را مشخص می‌کند؛ به‌طور پیش‌فرض، یا اگر " +"``None`` باشد، از ``os.path.basename(filename)`` استفاده می‌شود." -msgid "Optional argument *package* is a Python package or the name of a Python package whose directory should be used as the base directory for a module-relative filename. If no package is specified, then the calling module's directory is used as the base directory for module-relative filenames. It is an error to specify *package* if *module_relative* is ``False``." -msgstr "" +msgid "" +"Optional argument *package* is a Python package or the name of a Python " +"package whose directory should be used as the base directory for a module-" +"relative filename. If no package is specified, then the calling module's " +"directory is used as the base directory for module-relative filenames. It " +"is an error to specify *package* if *module_relative* is ``False``." +msgstr "" +"آرگومان اختیاری *package* یک بسته پایتون یا نام یک بسته پایتون است که پوشه‌ی" +" آن باید به‌عنوان پوشه‌ی پایه برای نام فایل نسبی نسبت به ماژول استفاده شود. " +"اگر بسته‌ای مشخص نشده باشد، پوشه‌ی ماژول فراخوان به‌عنوان پوشه‌ی پایه برای " +"نام فایل‌های نسبی نسبت به ماژول استفاده می‌شود. اگر *module_relative* برابر " +"``False`` باشد، مشخص کردن *package* خطا است." -msgid "Optional argument *globs* gives a dict to be used as the globals when executing examples. A new shallow copy of this dict is created for the doctest, so its examples start with a clean slate. By default, or if ``None``, a new empty dict is used." +msgid "" +"Optional argument *globs* gives a dict to be used as the globals when " +"executing examples. A new shallow copy of this dict is created for the " +"doctest, so its examples start with a clean slate. By default, or if " +"``None``, a new empty dict is used." msgstr "" +"آرگومان اختیاری *globs* یک دیکشنری برای استفاده به‌عنوان متغیرهای سراسری " +"هنگام اجرای مثال‌ها مشخص می‌کند. یک رونوشت سطحی جدید از این دیکشنری برای " +"doctest ایجاد می‌شود، بنابراین مثال‌های آن با وضعیتی تازه آغاز می‌شوند. " +"به‌طور پیش‌فرض، یا اگر ``None`` باشد، از یک دیکشنری خالی جدید استفاده " +"می‌شود." -msgid "Optional argument *extraglobs* gives a dict merged into the globals used to execute examples. This works like :meth:`dict.update`: if *globs* and *extraglobs* have a common key, the associated value in *extraglobs* appears in the combined dict. By default, or if ``None``, no extra globals are used. This is an advanced feature that allows parameterization of doctests. For example, a doctest can be written for a base class, using a generic name for the class, then reused to test any number of subclasses by passing an *extraglobs* dict mapping the generic name to the subclass to be tested." -msgstr "" +msgid "" +"Optional argument *extraglobs* gives a dict merged into the globals used to " +"execute examples. This works like :meth:`dict.update`: if *globs* and " +"*extraglobs* have a common key, the associated value in *extraglobs* appears" +" in the combined dict. By default, or if ``None``, no extra globals are " +"used. This is an advanced feature that allows parameterization of doctests." +" For example, a doctest can be written for a base class, using a generic " +"name for the class, then reused to test any number of subclasses by passing " +"an *extraglobs* dict mapping the generic name to the subclass to be tested." +msgstr "" +"آرگومان اختیاری *extraglobs* دیکشنری‌ای را ارائه می‌دهد که در متغیرهای " +"سراسری استفاده‌شده برای اجرای مثال‌ها ادغام می‌شود. این مانند " +":meth:`dict.update` عمل می‌کند: اگر *globs* و *extraglobs* کلید مشترکی داشته" +" باشند، مقدار متناظر در *extraglobs* در دیکشنری ترکیب‌شده ظاهر می‌شود. " +"به‌طور پیش‌فرض، یا اگر ``None`` باشد، از متغیرهای سراسری اضافی استفاده " +"نمی‌شود. این یک قابلیت پیشرفته است که امکان پارامتری‌سازی doctestها را " +"فراهم می‌کند. برای مثال، می‌توان یک doctest را برای یک کلاس پایه با استفاده " +"از یک نام عام برای کلاس نوشت، و سپس با دادن یک دیکشنری *extraglobs* که نام" +" عام را به زیرکلاس مورد آزمایش نگاشت می‌کند، از آن برای آزمایش هر تعداد " +"زیرکلاس استفاده مجدد کرد." -msgid "Optional argument *verbose* prints lots of stuff if true, and prints only failures if false; by default, or if ``None``, it's true if and only if ``'-v'`` is in :data:`sys.argv`." +msgid "" +"Optional argument *verbose* prints lots of stuff if true, and prints only " +"failures if false; by default, or if ``None``, it's true if and only if " +"``'-v'`` is in :data:`sys.argv`." msgstr "" +"آرگومان اختیاری *verbose* در صورت درست بودن، خروجی زیادی چاپ می‌کند و در " +"صورت نادرست بودن، فقط شکست‌ها را چاپ می‌کند؛ به‌طور پیش‌فرض، یا اگر ``None``" +" باشد، مقدار آن درست است اگر و فقط اگر ``'-v'`` در :data:`sys.argv` وجود " +"داشته باشد." -msgid "Optional argument *report* prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else the summary is very brief (in fact, empty if all tests passed)." +msgid "" +"Optional argument *report* prints a summary at the end when true, else " +"prints nothing at the end. In verbose mode, the summary is detailed, else " +"the summary is very brief (in fact, empty if all tests passed)." msgstr "" +"آرگومان اختیاری *report* در صورت درست بودن، در پایان خلاصه‌ای چاپ می‌کند؛ در" +" غیر این صورت، در پایان چیزی چاپ نمی‌کند. در حالت پرگو، خلاصه پرجزئیات است؛ " +"در غیر این صورت، خلاصه بسیار مختصر است (در واقع اگر همه‌ی آزمون‌ها با موفقیت " +"گذشتند، خالی است)." -msgid "Optional argument *optionflags* (default value ``0``) takes the :ref:`bitwise OR ` of option flags. See section :ref:`doctest-options`." +msgid "" +"Optional argument *optionflags* (default value ``0``) takes the " +":ref:`bitwise OR ` of option flags. See section :ref:`doctest-" +"options`." msgstr "" +"آرگومان اختیاری *optionflags* (مقدار پیش‌فرض ``0``) پرچم‌های گزینه را " +"به‌صورت :ref:`OR بیتی ` می‌پذیرد. بخش :ref:`doctest-options` را " +"ببینید." -msgid "Optional argument *raise_on_error* defaults to false. If true, an exception is raised upon the first failure or unexpected exception in an example. This allows failures to be post-mortem debugged. Default behavior is to continue running examples." +msgid "" +"Optional argument *raise_on_error* defaults to false. If true, an exception" +" is raised upon the first failure or unexpected exception in an example. " +"This allows failures to be post-mortem debugged. Default behavior is to " +"continue running examples." msgstr "" +"مقدار پیش‌فرض آرگومان اختیاری *raise_on_error* برابر false است. اگر true " +"باشد، در اولین شکست یا استثنای غیرمنتظره در یک مثال، یک استثنا پرتاب می‌شود." +" این امکان را می‌دهد که شکست‌ها به‌صورت پس‌مرگ (post-mortem) اشکال‌زدایی " +"شوند. رفتار پیش‌فرض، ادامه اجرای مثال‌ها است." -msgid "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) that should be used to extract tests from the files. It defaults to a normal parser (i.e., ``DocTestParser()``)." +msgid "" +"Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " +"that should be used to extract tests from the files. It defaults to a " +"normal parser (i.e., ``DocTestParser()``)." msgstr "" +"آرگومان اختیاری *parser*، یک :class:`DocTestParser` (یا زیرکلاس) را مشخص " +"می‌کند که باید برای استخراج آزمون‌ها از فایل‌ها استفاده شود. مقدار پیش‌فرض آن " +"یک پارسر معمولی است (یعنی ``DocTestParser()``)." -msgid "Optional argument *encoding* specifies an encoding that should be used to convert the file to unicode." +msgid "" +"Optional argument *encoding* specifies an encoding that should be used to " +"convert the file to unicode." msgstr "" +"آرگومان اختیاری *encoding*، کدگذاری‌ای را که باید برای تبدیل فایل به یونیکد " +"استفاده شود، مشخص می‌کند." -msgid "All arguments are optional, and all except for *m* should be specified in keyword form." +msgid "" +"All arguments are optional, and all except for *m* should be specified in " +"keyword form." msgstr "" +"همه آرگومان‌ها اختیاری هستند، و همه به‌جز *m* باید به‌صورت آرگومان " +"کلیدواژه‌ای مشخص شوند." -msgid "Test examples in docstrings in functions and classes reachable from module *m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with ``m.__doc__``." +msgid "" +"Test examples in docstrings in functions and classes reachable from module " +"*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " +"starting with ``m.__doc__``." msgstr "" +"آزمایش مثال‌های موجود در رشته‌مستندها در توابع و کلاس‌های " +"قابل‌دسترس از ماژول *m* (یا ماژول :mod:`__main__` اگر *m* ارائه نشده باشد یا" +" ``None`` باشد)، آغاز از ``m.__doc__``." -msgid "Also test examples reachable from dict ``m.__test__``, if it exists. ``m.__test__`` maps names (strings) to functions, classes and strings; function and class docstrings are searched for examples; strings are searched directly, as if they were docstrings." +msgid "" +"Also test examples reachable from dict ``m.__test__``, if it exists. " +"``m.__test__`` maps names (strings) to functions, classes and strings; " +"function and class docstrings are searched for examples; strings are " +"searched directly, as if they were docstrings." msgstr "" +"همچنین مثال‌های قابل دسترس از دیکشنری ``m.__test__`` را نیز، در صورت وجود، " +"آزمون می‌کند. ``m.__test__`` نام‌ها (رشته‌ها) را به توابع، کلاس‌ها و رشته‌ها " +"نگاشت می‌کند؛ در رشته‌مستندهای توابع و کلاس‌ها برای یافتن " +"مثال‌ها جستجو می‌شود؛ رشته‌ها مستقیماً جستجو می‌شوند، گویی رشته‌مستند " +"هستند." -msgid "Only docstrings attached to objects belonging to module *m* are searched." +msgid "" +"Only docstrings attached to objects belonging to module *m* are searched." msgstr "" +"تنها رشته‌مستندها (docstrings) که به اشیای متعلق به ماژول *m* متصل هستند، " +"جستجو می‌شوند." msgid "Return ``(failure_count, test_count)``." -msgstr "" +msgstr "``(failure_count, test_count)`` را برمی‌گرداند." -msgid "Optional argument *name* gives the name of the module; by default, or if ``None``, ``m.__name__`` is used." +msgid "" +"Optional argument *name* gives the name of the module; by default, or if " +"``None``, ``m.__name__`` is used." msgstr "" +"آرگومان اختیاری *name* نام ماژول را مشخص می‌کند؛ به‌طور پیش‌فرض، یا اگر " +"``None`` باشد، از ``m.__name__`` استفاده می‌شود." -msgid "Optional argument *exclude_empty* defaults to false. If true, objects for which no doctests are found are excluded from consideration. The default is a backward compatibility hack, so that code still using :meth:`doctest.master.summarize ` in conjunction with :func:`testmod` continues to get output for objects with no tests. The *exclude_empty* argument to the newer :class:`DocTestFinder` constructor defaults to true." -msgstr "" +msgid "" +"Optional argument *exclude_empty* defaults to false. If true, objects for " +"which no doctests are found are excluded from consideration. The default is " +"a backward compatibility hack, so that code still using " +":meth:`doctest.master.summarize ` in conjunction " +"with :func:`testmod` continues to get output for objects with no tests. The " +"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor " +"defaults to true." +msgstr "" +"آرگومان اختیاری *exclude_empty* به‌طور پیش‌فرض false است. اگر true باشد، " +"اشیایی که برای آن‌ها هیچ doctestای یافت نشود، از بررسی خارج می‌شوند. این " +"پیش‌فرض یک ترفند سازگاری با عقب است، تا کدی که هنوز از " +":meth:`doctest.master.summarize ` همراه با " +":func:`testmod` استفاده می‌کند، همچنان برای اشیای بدون آزمون خروجی بگیرد. " +"آرگومان *exclude_empty* در سازنده‌ی جدیدتر :class:`DocTestFinder` به‌طور " +"پیش‌فرض true است." -msgid "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, *raise_on_error*, and *globs* are the same as for function :func:`testfile` above, except that *globs* defaults to ``m.__dict__``." +msgid "" +"Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " +"*raise_on_error*, and *globs* are the same as for function :func:`testfile` " +"above, except that *globs* defaults to ``m.__dict__``." msgstr "" +"آرگومان‌های اختیاری *extraglobs*، *verbose*، *report*، *optionflags*، " +"*raise_on_error* و *globs* همان آرگومان‌های تابع :func:`testfile` در بالا " +"هستند، با این تفاوت که مقدار پیش‌فرض *globs* برابر با ``m.__dict__`` است." -msgid "Test examples associated with object *f*; for example, *f* may be a string, a module, a function, or a class object." +msgid "" +"Test examples associated with object *f*; for example, *f* may be a string, " +"a module, a function, or a class object." msgstr "" +"مثال‌های مرتبط با شیء *f* را آزمون کنید؛ برای مثال، *f* می‌تواند یک رشته، یک " +"ماژول، یک تابع یا یک شیء کلاس باشد." -msgid "A shallow copy of dictionary argument *globs* is used for the execution context." +msgid "" +"A shallow copy of dictionary argument *globs* is used for the execution " +"context." msgstr "" +"برای زمینه اجرا از یک کپی سطحی از آرگومان دیکشنری *globs* استفاده می‌شود." -msgid "Optional argument *name* is used in failure messages, and defaults to ``\"NoName\"``." +msgid "" +"Optional argument *name* is used in failure messages, and defaults to " +"``\"NoName\"``." msgstr "" +"آرگومان اختیاری *name* در پیام‌های شکست استفاده می‌شود و مقدار پیش‌فرض آن " +"``\"NoName\"`` است." -msgid "If optional argument *verbose* is true, output is generated even if there are no failures. By default, output is generated only in case of an example failure." +msgid "" +"If optional argument *verbose* is true, output is generated even if there " +"are no failures. By default, output is generated only in case of an example" +" failure." msgstr "" +"اگر آرگومان اختیاری *verbose* مقدار درست داشته باشد، حتی اگر هیچ شکستی وجود " +"نداشته باشد، خروجی تولید می‌شود. به‌طور پیش‌فرض، خروجی فقط در صورت شکست یک " +"مثال تولید می‌شود." -msgid "Optional argument *compileflags* gives the set of flags that should be used by the Python compiler when running the examples. By default, or if ``None``, flags are deduced corresponding to the set of future features found in *globs*." +msgid "" +"Optional argument *compileflags* gives the set of flags that should be used " +"by the Python compiler when running the examples. By default, or if " +"``None``, flags are deduced corresponding to the set of future features " +"found in *globs*." msgstr "" +"آرگومان اختیاری *compileflags* مجموعه پرچم‌هایی را مشخص می‌کند که کامپایلر " +"پایتون باید هنگام اجرای مثال‌ها از آن‌ها استفاده کند. به‌طور پیش‌فرض، یا اگر" +" ``None`` باشد، پرچم‌ها متناظر با مجموعه ویژگی‌های آینده یافت‌شده در *globs*" +" استنتاج می‌شوند." -msgid "Optional argument *optionflags* works as for function :func:`testfile` above." +msgid "" +"Optional argument *optionflags* works as for function :func:`testfile` " +"above." msgstr "" +"آرگومان اختیاری *optionflags* همانند تابع :func:`testfile` در بالا عمل " +"می‌کند." msgid "Unittest API" -msgstr "" +msgstr "API آزمون واحد" -msgid "As your collection of doctest'ed modules grows, you'll want a way to run all their doctests systematically. :mod:`!doctest` provides two functions that can be used to create :mod:`unittest` test suites from modules and text files containing doctests. To integrate with :mod:`unittest` test discovery, include a :ref:`load_tests ` function in your test module::" -msgstr "" +msgid "" +"As your collection of doctest'ed modules grows, you'll want a way to run all" +" their doctests systematically. :mod:`!doctest` provides two functions that" +" can be used to create :mod:`unittest` test suites from modules and text " +"files containing doctests. To integrate with :mod:`unittest` test " +"discovery, include a :ref:`load_tests ` function in " +"your test module::" +msgstr "" +"با رشد مجموعه ماژول‌های دارای doctest، به روشی برای اجرای سیستماتیک تمام " +"doctestهای آن‌ها نیاز خواهید داشت. :mod:`!doctest` دو تابع ارائه می‌دهد که " +"می‌توان از آن‌ها برای ایجاد مجموعه‌های آزمون :mod:`unittest` از ماژول‌ها و " +"فایل‌های متنی حاوی doctest استفاده کرد. برای یکپارچه‌سازی با کشف آزمون " +":mod:`unittest`، یک تابع :ref:`load_tests ` در ماژول " +"آزمون خود قرار دهید::" msgid "" "import unittest\n" @@ -831,132 +1906,397 @@ msgid "" " tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" " return tests" msgstr "" +"import unittest\n" +"import doctest\n" +"import my_module_with_doctests\n" +"\n" +"def load_tests(loader, tests, ignore):\n" +" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" +" return tests" -msgid "There are two main functions for creating :class:`unittest.TestSuite` instances from text files and modules with doctests:" +msgid "" +"There are two main functions for creating :class:`unittest.TestSuite` " +"instances from text files and modules with doctests:" msgstr "" +"دو تابع اصلی برای ایجاد نمونه‌های :class:`unittest.TestSuite` از فایل‌های " +"متنی و ماژول‌های دارای doctest وجود دارد:" -msgid "Convert doctest tests from one or more text files to a :class:`unittest.TestSuite`." +msgid "" +"Convert doctest tests from one or more text files to a " +":class:`unittest.TestSuite`." msgstr "" +"تبدیل آزمون‌های doctest از یک یا چند پرونده‌ی متنی به یک " +":class:`unittest.TestSuite`." -msgid "The returned :class:`unittest.TestSuite` is to be run by the unittest framework and runs the interactive examples in each file. If an example in any file fails, then the synthesized unit test fails, and a :exc:`~unittest.TestCase.failureException` exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. If all the examples in a file are skipped, then the synthesized unit test is also marked as skipped." -msgstr "" +msgid "" +"The returned :class:`unittest.TestSuite` is to be run by the unittest " +"framework and runs the interactive examples in each file. If an example in " +"any file fails, then the synthesized unit test fails, and a " +":exc:`~unittest.TestCase.failureException` exception is raised showing the " +"name of the file containing the test and a (sometimes approximate) line " +"number. If all the examples in a file are skipped, then the synthesized " +"unit test is also marked as skipped." +msgstr "" +":class:`unittest.TestSuite` بازگشتی برای اجرا توسط چارچوب unittest در نظر " +"گرفته شده است و مثال‌های تعاملی در هر فایل را اجرا می‌کند. اگر مثالی در هر " +"فایلی شکست بخورد، آزمون واحد ساخته‌شده شکست می‌خورد و استثنای " +":exc:`~unittest.TestCase.failureException` پرتاب می‌شود که نام فایل حاوی آزمون" +" و شماره خطی (گاهی تقریبی) را نشان می‌دهد. اگر تمام مثال‌های یک فایل رد شده " +"باشند، آزمون واحد ساخته‌شده نیز به‌عنوان ردشده علامت‌گذاری می‌شود." msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" +"یک یا چند مسیر (به‌صورت رشته) برای فایل‌های متنی که باید بررسی شوند، ارائه " +"دهید." msgid "Options may be provided as keyword arguments:" -msgstr "" +msgstr "می‌توان گزینه‌ها را به‌عنوان آرگومان‌های کلیدواژه‌ای ارائه کرد:" -msgid "Optional argument *module_relative* specifies how the filenames in *paths* should be interpreted:" +msgid "" +"Optional argument *module_relative* specifies how the filenames in *paths* " +"should be interpreted:" msgstr "" +"آرگومان اختیاری *module_relative* مشخص می‌کند که نام فایل‌ها در *paths* " +"چگونه باید تفسیر شوند:" -msgid "If *module_relative* is ``True`` (the default), then each filename in *paths* specifies an OS-independent module-relative path. By default, this path is relative to the calling module's directory; but if the *package* argument is specified, then it is relative to that package. To ensure OS-independence, each filename should use ``/`` characters to separate path segments, and may not be an absolute path (i.e., it may not begin with ``/``)." -msgstr "" +msgid "" +"If *module_relative* is ``True`` (the default), then each filename in " +"*paths* specifies an OS-independent module-relative path. By default, this " +"path is relative to the calling module's directory; but if the *package* " +"argument is specified, then it is relative to that package. To ensure OS-" +"independence, each filename should use ``/`` characters to separate path " +"segments, and may not be an absolute path (i.e., it may not begin with " +"``/``)." +msgstr "" +"اگر *module_relative* برابر ``True`` باشد (پیش‌فرض)، آنگاه هر نام پرونده در " +"*paths* مسیری نسبی به ماژول و مستقل از سیستم‌عامل را مشخص می‌کند. به‌طور " +"پیش‌فرض، این مسیر نسبت به پوشه‌ی ماژول فراخوان نسبی است؛ اما اگر آرگومان " +"*package* مشخص شده باشد، نسبت به آن بسته نسبی است. برای اطمینان از استقلال " +"از سیستم‌عامل، هر نام پرونده باید از نویسه‌های ``/`` برای جداسازی بخش‌های " +"مسیر استفاده کند و نباید یک مسیر مطلق باشد (یعنی نباید با ``/`` شروع شود)." -msgid "If *module_relative* is ``False``, then each filename in *paths* specifies an OS-specific path. The path may be absolute or relative; relative paths are resolved with respect to the current working directory." +msgid "" +"If *module_relative* is ``False``, then each filename in *paths* specifies " +"an OS-specific path. The path may be absolute or relative; relative paths " +"are resolved with respect to the current working directory." msgstr "" +"اگر *module_relative* برابر ``False`` باشد، هر نام فایل در *paths* یک مسیر " +"خاصِ سیستم‌عامل را مشخص می‌کند. مسیر می‌تواند مطلق یا نسبی باشد؛ مسیرهای " +"نسبی با توجه به پوشه کاری جاری حل می‌شوند." -msgid "Optional argument *package* is a Python package or the name of a Python package whose directory should be used as the base directory for module-relative filenames in *paths*. If no package is specified, then the calling module's directory is used as the base directory for module-relative filenames. It is an error to specify *package* if *module_relative* is ``False``." -msgstr "" +msgid "" +"Optional argument *package* is a Python package or the name of a Python " +"package whose directory should be used as the base directory for module-" +"relative filenames in *paths*. If no package is specified, then the calling" +" module's directory is used as the base directory for module-relative " +"filenames. It is an error to specify *package* if *module_relative* is " +"``False``." +msgstr "" +"آرگومان اختیاری *package* یک بسته پایتون یا نام یک بسته پایتون است که پوشه " +"آن باید به‌عنوان پوشه پایه برای نام فایل‌های نسبت به ماژول در *paths* " +"استفاده شود. اگر بسته‌ای مشخص نشده باشد، پوشه ماژول فراخوان به‌عنوان پوشه " +"پایه برای نام فایل‌های نسبت به ماژول استفاده می‌شود. اگر *module_relative* " +"برابر ``False`` باشد، مشخص کردن *package* خطا است." -msgid "Optional argument *setUp* specifies a set-up function for the test suite. This is called before running the tests in each file. The *setUp* function will be passed a :class:`DocTest` object. The *setUp* function can access the test globals as the :attr:`~DocTest.globs` attribute of the test passed." +msgid "" +"Optional argument *setUp* specifies a set-up function for the test suite. " +"This is called before running the tests in each file. The *setUp* function " +"will be passed a :class:`DocTest` object. The *setUp* function can access " +"the test globals as the :attr:`~DocTest.globs` attribute of the test passed." msgstr "" +"آرگومان اختیاری *setUp* یک تابع راه‌اندازی برای مجموعه آزمون مشخص می‌کند. این " +"تابع پیش از اجرای آزمون‌ها در هر فایل فراخوانی می‌شود. یک شیء :class:`DocTest` " +"به تابع *setUp* ارسال می‌شود. تابع *setUp* می‌تواند به متغیرهای سراسری آزمون " +"به‌عنوان ویژگی :attr:`~DocTest.globs` شیء آزمون ارسال‌شده دسترسی داشته باشد." -msgid "Optional argument *tearDown* specifies a tear-down function for the test suite. This is called after running the tests in each file. The *tearDown* function will be passed a :class:`DocTest` object. The *tearDown* function can access the test globals as the :attr:`~DocTest.globs` attribute of the test passed." -msgstr "" +msgid "" +"Optional argument *tearDown* specifies a tear-down function for the test " +"suite. This is called after running the tests in each file. The *tearDown*" +" function will be passed a :class:`DocTest` object. The *tearDown* function" +" can access the test globals as the :attr:`~DocTest.globs` attribute of the " +"test passed." +msgstr "" +"آرگومان اختیاری *tearDown* یک تابع پاک‌سازی (tear-down) برای مجموعه آزمون مشخص" +" می‌کند. این تابع پس از اجرای آزمون‌ها در هر فایل فراخوانی می‌شود. یک شیء " +":class:`DocTest` به تابع *tearDown* گذرانده خواهد شد. تابع *tearDown* " +"می‌تواند به متغیرهای سراسری آزمون به‌عنوان ویژگی :attr:`~DocTest.globs` شیء " +"آزمون گذرانده‌شده دسترسی داشته باشد." -msgid "Optional argument *globs* is a dictionary containing the initial global variables for the tests. A new copy of this dictionary is created for each test. By default, *globs* is a new empty dictionary." +msgid "" +"Optional argument *globs* is a dictionary containing the initial global " +"variables for the tests. A new copy of this dictionary is created for each " +"test. By default, *globs* is a new empty dictionary." msgstr "" +"آرگومان اختیاری *globs* یک دیکشنری حاوی متغیرهای سراسری اولیه برای آزمون‌ها " +"است. یک رونوشت جدید از این دیکشنری برای هر آزمون ایجاد می‌شود. به‌طور " +"پیش‌فرض، *globs* یک دیکشنری خالی جدید است." -msgid "Optional argument *optionflags* specifies the default doctest options for the tests, created by or-ing together individual option flags. See section :ref:`doctest-options`. See function :func:`set_unittest_reportflags` below for a better way to set reporting options." +msgid "" +"Optional argument *optionflags* specifies the default doctest options for " +"the tests, created by or-ing together individual option flags. See section " +":ref:`doctest-options`. See function :func:`set_unittest_reportflags` below " +"for a better way to set reporting options." msgstr "" +"آرگومان اختیاری *optionflags*، که با OR کردن پرچم‌های گزینه‌ی جداگانه با " +"یکدیگر ایجاد می‌شود، گزینه‌های پیش‌فرض doctest برای آزمون‌ها را مشخص می‌کند." +" بخش :ref:`doctest-options` را ببینید. برای روش بهتر تنظیم گزینه‌های " +"گزارش‌دهی، تابع :func:`set_unittest_reportflags` را در زیر ببینید." -msgid "The global ``__file__`` is added to the globals provided to doctests loaded from a text file using :func:`DocFileSuite`." +msgid "" +"The global ``__file__`` is added to the globals provided to doctests loaded " +"from a text file using :func:`DocFileSuite`." msgstr "" +"متغیر سراسری ``__file__`` به متغیرهای سراسری ارائه‌شده به doctestهایی که از " +"یک فایل متنی با استفاده از :func:`DocFileSuite` بارگذاری می‌شوند، افزوده " +"می‌شود." msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." -msgstr "" +msgstr "تبدیل آزمون‌های doctest یک ماژول به :class:`unittest.TestSuite`." -msgid "The returned :class:`unittest.TestSuite` is to be run by the unittest framework and runs each doctest in the module. Each docstring is run as a separate unit test. If any of the doctests fail, then the synthesized unit test fails, and a :exc:`unittest.TestCase.failureException` exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. If all the examples in a docstring are skipped, then the" -msgstr "" +msgid "" +"The returned :class:`unittest.TestSuite` is to be run by the unittest " +"framework and runs each doctest in the module. Each docstring is run as a " +"separate unit test. If any of the doctests fail, then the synthesized unit " +"test fails, and a :exc:`unittest.TestCase.failureException` exception is " +"raised showing the name of the file containing the test and a (sometimes " +"approximate) line number. If all the examples in a docstring are skipped, " +"then the" +msgstr "" +":class:`unittest.TestSuite` برگردانده‌شده برای اجرا توسط چارچوب unittest در " +"نظر گرفته شده است و هر doctest را در ماژول اجرا می‌کند. هر رشته مستند " +"به‌عنوان یک آزمون واحد جداگانه اجرا می‌شود. اگر هر یک از doctestها شکست " +"بخورد، آزمون واحد ساخته‌شده شکست می‌خورد و یک استثنای " +":exc:`unittest.TestCase.failureException` پرتاب می‌شود که نام فایل حاوی آزمون " +"و شماره خطی (گاهی تقریبی) را نشان می‌دهد. اگر همه‌ی مثال‌های یک رشته مستند " +"رد شوند، آنگاه" -msgid "Optional argument *module* provides the module to be tested. It can be a module object or a (possibly dotted) module name. If not specified, the module calling this function is used." +msgid "" +"Optional argument *module* provides the module to be tested. It can be a " +"module object or a (possibly dotted) module name. If not specified, the " +"module calling this function is used." msgstr "" +"آرگومان اختیاری *module* ماژول مورد آزمایش را فراهم می‌کند. این آرگومان " +"می‌تواند یک شیء ماژول یا یک نام ماژول (که ممکن است نقطه‌دار باشد) باشد. اگر " +"مشخص نشده باشد، از ماژول فراخواننده این تابع استفاده می‌شود." -msgid "Optional argument *globs* is a dictionary containing the initial global variables for the tests. A new copy of this dictionary is created for each test. By default, *globs* is the module's :attr:`~module.__dict__`." +msgid "" +"Optional argument *globs* is a dictionary containing the initial global " +"variables for the tests. A new copy of this dictionary is created for each " +"test. By default, *globs* is the module's :attr:`~module.__dict__`." msgstr "" +"آرگومان اختیاری *globs* یک دیکشنری حاوی متغیرهای سراسری اولیه برای آزمون‌ها " +"است. برای هر آزمون، یک رونوشت جدید از این دیکشنری ایجاد می‌شود. به‌طور " +"پیش‌فرض، *globs* همان :attr:`~module.__dict__` ماژول است." -msgid "Optional argument *extraglobs* specifies an extra set of global variables, which is merged into *globs*. By default, no extra globals are used." +msgid "" +"Optional argument *extraglobs* specifies an extra set of global variables, " +"which is merged into *globs*. By default, no extra globals are used." msgstr "" +"آرگومان اختیاری *extraglobs* مجموعه‌ای اضافی از متغیرهای سراسری را مشخص " +"می‌کند که در *globs* ادغام می‌شود. به‌طور پیش‌فرض، از هیچ متغیر سراسری اضافی" +" استفاده نمی‌شود." -msgid "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a drop-in replacement) that is used to extract doctests from the module." +msgid "" +"Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " +"drop-in replacement) that is used to extract doctests from the module." msgstr "" +"آرگومان اختیاری *test_finder*، شیء :class:`DocTestFinder` (یا یک جایگزین " +"مستقیم) است که برای استخراج doctestها از ماژول استفاده می‌شود." -msgid "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as for function :func:`DocFileSuite` above, but they are called for each docstring." +msgid "" +"Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " +"for function :func:`DocFileSuite` above, but they are called for each " +"docstring." msgstr "" +"آرگومان‌های اختیاری *setUp*، *tearDown* و *optionflags* همانند تابع " +":func:`DocFileSuite` در بالا هستند، اما برای هر رشته مستند فراخوانی " +"می‌شوند." msgid "This function uses the same search technique as :func:`testmod`." -msgstr "" +msgstr "این تابع از همان روش جست‌وجوی :func:`testmod` استفاده می‌کند." -msgid ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if *module* contains no docstrings instead of raising :exc:`ValueError`." +msgid "" +":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " +"*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" +":func:`DocTestSuite` اگر *module* حاوی هیچ رشته‌مستندی نباشد، " +"به‌جای پرتاب :exc:`ValueError`، یک :class:`unittest.TestSuite` خالی را " +"برمی‌گرداند." -msgid "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't documented here (it's an internal detail), but studying its code can answer questions about the exact details of :mod:`unittest` integration." -msgstr "" +msgid "" +"Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite`" +" out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` " +"is a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't " +"documented here (it's an internal detail), but studying its code can answer " +"questions about the exact details of :mod:`unittest` integration." +msgstr "" +"در پشت صحنه، :func:`DocTestSuite` از نمونه‌های :class:`!doctest.DocTestCase`" +" یک :class:`unittest.TestSuite` می‌سازد، و :class:`!DocTestCase` زیرکلاسی از" +" :class:`unittest.TestCase` است. :class:`!DocTestCase` در اینجا مستند نشده " +"است (این جزئیاتی داخلی است)، اما بررسی کد آن می‌تواند به پرسش‌هایی درباره‌ی " +"جزئیات دقیق ادغام :mod:`unittest` پاسخ دهد." -msgid "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a subclass of :class:`!DocTestCase`." +msgid "" +"Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out of" +" :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " +"subclass of :class:`!DocTestCase`." msgstr "" +"به‌طور مشابه، :func:`DocFileSuite` از نمونه‌های :class:`!doctest.DocFileCase" +" ` یک :class:`unittest.TestSuite `" +" ایجاد می‌کند، و :class:`!DocFileCase` زیرکلاسی از :class:`!DocTestCase` " +"است." -msgid "So both ways of creating a :class:`unittest.TestSuite` run instances of :class:`!DocTestCase`. This is important for a subtle reason: when you run :mod:`!doctest` functions yourself, you can control the :mod:`!doctest` options in use directly, by passing option flags to :mod:`!doctest` functions. However, if you're writing a :mod:`unittest` framework, :mod:`!unittest` ultimately controls when and how tests get run. The framework author typically wants to control :mod:`!doctest` reporting options (perhaps, e.g., specified by command line options), but there's no way to pass options through :mod:`!unittest` to :mod:`!doctest` test runners." -msgstr "" +msgid "" +"So both ways of creating a :class:`unittest.TestSuite` run instances of " +":class:`!DocTestCase`. This is important for a subtle reason: when you run " +":mod:`!doctest` functions yourself, you can control the :mod:`!doctest` " +"options in use directly, by passing option flags to :mod:`!doctest` " +"functions. However, if you're writing a :mod:`unittest` framework, " +":mod:`!unittest` ultimately controls when and how tests get run. The " +"framework author typically wants to control :mod:`!doctest` reporting " +"options (perhaps, e.g., specified by command line options), but there's no " +"way to pass options through :mod:`!unittest` to :mod:`!doctest` test " +"runners." +msgstr "" +"بنابراین هر دو روش ایجاد یک :class:`unittest.TestSuite` نمونه‌های " +":class:`!DocTestCase` را اجرا می‌کنند. این موضوع به یک دلیل ظریف مهم است: " +"وقتی خودتان توابع :mod:`!doctest` را اجرا می‌کنید، می‌توانید گزینه‌های " +":mod:`!doctest` در حال استفاده را مستقیماً با ارسال پرچم‌های گزینه به توابع " +":mod:`!doctest` کنترل کنید. با این حال، اگر در حال نوشتن یک چارچوب " +":mod:`unittest` هستید، :mod:`!unittest` در نهایت کنترل می‌کند که آزمون‌ها چه" +" زمانی و چگونه اجرا شوند. نویسنده چارچوب معمولاً می‌خواهد گزینه‌های " +"گزارش‌دهی :mod:`!doctest` را کنترل کند (شاید، مثلاً، مشخص‌شده با گزینه‌های " +"خط فرمان)، اما راهی برای ارسال گزینه‌ها از طریق :mod:`!unittest` به " +"اجراکننده‌های آزمون :mod:`!doctest` وجود ندارد." -msgid "For this reason, :mod:`!doctest` also supports a notion of :mod:`!doctest` reporting flags specific to :mod:`unittest` support, via this function:" +msgid "" +"For this reason, :mod:`!doctest` also supports a notion of :mod:`!doctest` " +"reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" +"به همین دلیل، :mod:`!doctest` همچنین از مفهومی از پرچم‌های گزارش‌دهی " +":mod:`!doctest` که مخصوص پشتیبانی از :mod:`unittest` است، از طریق این تابع " +"پشتیبانی می‌کند:" msgid "Set the :mod:`!doctest` reporting flags to use." -msgstr "" +msgstr "پرچم‌های گزارش‌دهی :mod:`!doctest` را برای استفاده تنظیم کنید." -msgid "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See section :ref:`doctest-options`. Only \"reporting flags\" can be used." +msgid "" +"Argument *flags* takes the :ref:`bitwise OR ` of option flags. See" +" section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" +"آرگومان *flags* :ref:`OR بیتی ` پرچم‌های گزینه را می‌گیرد. بخش " +":ref:`doctest-options` را ببینید. فقط می‌توان از «پرچم‌های گزارش‌دهی» " +"استفاده کرد." -msgid "This is a module-global setting, and affects all future doctests run by module :mod:`unittest`: the :meth:`!runTest` method of :class:`!DocTestCase` looks at the option flags specified for the test case when the :class:`!DocTestCase` instance was constructed. If no reporting flags were specified (which is the typical and expected case), :mod:`!doctest`'s :mod:`!unittest` reporting flags are :ref:`bitwise ORed ` into the option flags, and the option flags so augmented are passed to the :class:`DocTestRunner` instance created to run the doctest. If any reporting flags were specified when the :class:`!DocTestCase` instance was constructed, :mod:`!doctest`'s :mod:`!unittest` reporting flags are ignored." -msgstr "" +msgid "" +"This is a module-global setting, and affects all future doctests run by " +"module :mod:`unittest`: the :meth:`!runTest` method of " +":class:`!DocTestCase` looks at the option flags specified for the test case " +"when the :class:`!DocTestCase` instance was constructed. If no reporting " +"flags were specified (which is the typical and expected case), " +":mod:`!doctest`'s :mod:`!unittest` reporting flags are :ref:`bitwise ORed " +"` into the option flags, and the option flags so augmented are " +"passed to the :class:`DocTestRunner` instance created to run the doctest. " +"If any reporting flags were specified when the :class:`!DocTestCase` " +"instance was constructed, :mod:`!doctest`'s :mod:`!unittest` reporting flags" +" are ignored." +msgstr "" +"این یک تنظیم سراسری ماژول است و بر تمام دوک‌آزمون‌های آینده (doctest) که توسط " +"ماژول :mod:`unittest` اجرا می‌شوند، تأثیر می‌گذارد: متد :meth:`!runTest` " +"کلاس :class:`!DocTestCase` پرچم‌های گزینه را که هنگام ساخت نمونه‌ی " +":class:`!DocTestCase` برای مورد آزمون مشخص‌شده‌اند، بررسی می‌کند. اگر " +"پرچم‌های گزارش‌دهی مشخص‌نشده باشند (که حالت معمول و مورد انتظار است)، " +"پرچم‌های گزارش‌دهی :mod:`!unittest` در :mod:`!doctest` با پرچم‌های گزینه " +"به‌صورت :ref:`OR بیتی ` ترکیب می‌شوند، و پرچم‌های گزینه‌ای که " +"بدین‌ترتیب افزایش‌یافته‌اند، به نمونه‌ی :class:`DocTestRunner` ساخته‌شده " +"برای اجرای دوک‌آزمون داده می‌شوند. اگر هنگام ساخت نمونه‌ی " +":class:`!DocTestCase` پرچم‌های گزارش‌دهی مشخص‌شده باشند، پرچم‌های گزارش‌دهی " +":mod:`!unittest` در :mod:`!doctest` نادیده گرفته می‌شوند." -msgid "The value of the :mod:`unittest` reporting flags in effect before the function was called is returned by the function." +msgid "" +"The value of the :mod:`unittest` reporting flags in effect before the " +"function was called is returned by the function." msgstr "" +"مقدار پرچم‌های گزارش‌دهی :mod:`unittest` که پیش از فراخوانی تابع فعال بودند،" +" توسط تابع بازگردانده می‌شود." msgid "Advanced API" -msgstr "" +msgstr "API پیشرفته" -msgid "The basic API is a simple wrapper that's intended to make doctest easy to use. It is fairly flexible, and should meet most users' needs; however, if you require more fine-grained control over testing, or wish to extend doctest's capabilities, then you should use the advanced API." +msgid "" +"The basic API is a simple wrapper that's intended to make doctest easy to " +"use. It is fairly flexible, and should meet most users' needs; however, if " +"you require more fine-grained control over testing, or wish to extend " +"doctest's capabilities, then you should use the advanced API." msgstr "" +"API پایه پوششی ساده است که برای آسان کردن استفاده از doctest در نظر گرفته " +"شده است. این API نسبتاً انعطاف‌پذیر است و باید نیازهای بیشتر کاربران را " +"برآورده کند؛ با این حال، اگر به کنترل ریزدانه‌تری بر آزمون نیاز دارید یا " +"می‌خواهید قابلیت‌های doctest را گسترش دهید، باید از API پیشرفته استفاده " +"کنید." -msgid "The advanced API revolves around two container classes, which are used to store the interactive examples extracted from doctest cases:" +msgid "" +"The advanced API revolves around two container classes, which are used to " +"store the interactive examples extracted from doctest cases:" msgstr "" +"API پیشرفته حول دو کلاس ظرف می‌چرخد که برای ذخیره‌سازی مثال‌های تعاملی " +"استخراج‌شده از موارد doctest به‌کار می‌روند:" -msgid ":class:`Example`: A single Python :term:`statement`, paired with its expected output." +msgid "" +":class:`Example`: A single Python :term:`statement`, paired with its " +"expected output." msgstr "" +":class:`Example`: یک :term:`دستور ` پایتون، همراه با خروجی مورد انتظار آن." -msgid ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted from a single docstring or text file." +msgid "" +":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " +"from a single docstring or text file." msgstr "" +":class:`DocTest`: مجموعه‌ای از نمونه‌های :class:`Example`، که معمولاً از یک " +"رشته مستند یا فایل متنی واحد استخراج می‌شود." -msgid "Additional processing classes are defined to find, parse, and run, and check doctest examples:" +msgid "" +"Additional processing classes are defined to find, parse, and run, and check" +" doctest examples:" msgstr "" +"کلاس‌های پردازش دیگری برای یافتن، تجزیه، اجرا و بررسی نمونه‌های doctest " +"تعریف شده‌اند:" -msgid ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :class:`DocTestParser` to create a :class:`DocTest` from every docstring that contains interactive examples." +msgid "" +":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a " +":class:`DocTestParser` to create a :class:`DocTest` from every docstring " +"that contains interactive examples." msgstr "" +":class:`DocTestFinder`: همه‌ی رشته‌های مستندسازی را در یک ماژول " +"داده‌شده پیدا می‌کند و از یک :class:`DocTestParser` برای ایجاد یک " +":class:`DocTest` از هر رشته مستندسازی که شامل مثال‌های تعاملی باشد، استفاده " +"می‌کند." -msgid ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string (such as an object's docstring)." +msgid "" +":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " +"(such as an object's docstring)." msgstr "" +":class:`DocTestParser`: یک شیء :class:`DocTest` را از یک رشته ایجاد می‌کند " +"(مانند رشته‌ی مستندسازی رشته مستند یک شیء)." -msgid ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and uses an :class:`OutputChecker` to verify their output." +msgid "" +":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " +"uses an :class:`OutputChecker` to verify their output." msgstr "" +":class:`DocTestRunner`: مثال‌های موجود در یک :class:`DocTest` را اجرا می‌کند" +" و برای صحت‌سنجی خروجی آن‌ها از یک :class:`OutputChecker` استفاده می‌کند." -msgid ":class:`OutputChecker`: Compares the actual output from a doctest example with the expected output, and decides whether they match." +msgid "" +":class:`OutputChecker`: Compares the actual output from a doctest example " +"with the expected output, and decides whether they match." msgstr "" +":class:`OutputChecker`: خروجی واقعی یک مثال doctest را با خروجی مورد انتظار " +"مقایسه می‌کند و تصمیم می‌گیرد که آیا این دو با هم مطابقت دارند یا خیر." -msgid "The relationships among these processing classes are summarized in the following diagram::" -msgstr "" +msgid "" +"The relationships among these processing classes are summarized in the " +"following diagram::" +msgstr "روابط میان این کلاس‌های پردازشی در نمودار زیر خلاصه شده‌اند::" msgid "" " list of:\n" @@ -968,252 +2308,649 @@ msgid "" " DocTestParser | Example | OutputChecker\n" " +---------+" msgstr "" +" فهرستی از:\n" +"+------+ +---------+\n" +"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> نتایج\n" +"+------+ | ^ +---------+ | ^ (چاپ شده)\n" +" | | | Example | | |\n" +" v | | ... | v |\n" +" DocTestParser | Example | OutputChecker\n" +" +---------+" msgid "DocTest Objects" -msgstr "" +msgstr "اشیای DocTest" -msgid "A collection of doctest examples that should be run in a single namespace. The constructor arguments are used to initialize the attributes of the same names." +msgid "" +"A collection of doctest examples that should be run in a single namespace. " +"The constructor arguments are used to initialize the attributes of the same " +"names." msgstr "" +"مجموعه‌ای از مثال‌های doctest که باید در یک فضای نام واحد اجرا شوند. " +"آرگومان‌های سازنده برای مقداردهی اولیه ویژگی‌هایی با همان نام‌ها استفاده " +"می‌شوند." -msgid ":class:`DocTest` defines the following attributes. They are initialized by the constructor, and should not be modified directly." +msgid "" +":class:`DocTest` defines the following attributes. They are initialized by " +"the constructor, and should not be modified directly." msgstr "" +":class:`DocTest` ویژگی‌های زیر را تعریف می‌کند. این ویژگی‌ها توسط سازنده " +"مقداردهی اولیه می‌شوند و نباید به‌طور مستقیم تغییر داده شوند." -msgid "A list of :class:`Example` objects encoding the individual interactive Python examples that should be run by this test." +msgid "" +"A list of :class:`Example` objects encoding the individual interactive " +"Python examples that should be run by this test." msgstr "" +"فهرستی از اشیای :class:`Example` که نمونه‌های تعاملی پایتونِ جداگانه‌ای را، " +"که باید توسط این آزمون اجرا شوند، کدگذاری می‌کنند." -msgid "The namespace (aka globals) that the examples should be run in. This is a dictionary mapping names to values. Any changes to the namespace made by the examples (such as binding new variables) will be reflected in :attr:`globs` after the test is run." +msgid "" +"The namespace (aka globals) that the examples should be run in. This is a " +"dictionary mapping names to values. Any changes to the namespace made by " +"the examples (such as binding new variables) will be reflected in " +":attr:`globs` after the test is run." msgstr "" +"فضای نامی (که به آن globals نیز گفته می‌شود) که مثال‌ها باید در آن اجرا " +"شوند. این یک دیکشنری است که نام‌ها را به مقدارها نگاشت می‌کند. هر تغییری در " +"فضای نام که توسط مثال‌ها انجام شود (مانند ایجاد متغیرهای جدید) پس از اجرای " +"آزمون در :attr:`globs` منعکس خواهد شد." -msgid "A string name identifying the :class:`DocTest`. Typically, this is the name of the object or file that the test was extracted from." +msgid "" +"A string name identifying the :class:`DocTest`. Typically, this is the name" +" of the object or file that the test was extracted from." msgstr "" +"یک نام رشته‌ای که :class:`DocTest` را شناسایی می‌کند. معمولاً این نام، نام " +"شیء یا فایلی است که آزمون از آن استخراج شده است." -msgid "The name of the file that this :class:`DocTest` was extracted from; or ``None`` if the filename is unknown, or if the :class:`!DocTest` was not extracted from a file." +msgid "" +"The name of the file that this :class:`DocTest` was extracted from; or " +"``None`` if the filename is unknown, or if the :class:`!DocTest` was not " +"extracted from a file." msgstr "" +"نام فایلی که این :class:`DocTest` از آن استخراج شده است؛ یا ``None`` اگر نام" +" فایل معلوم نباشد، یا اگر :class:`!DocTest` از فایلی استخراج نشده باشد." -msgid "The line number within :attr:`filename` where this :class:`DocTest` begins, or ``None`` if the line number is unavailable. This line number is zero-based with respect to the beginning of the file." +msgid "" +"The line number within :attr:`filename` where this :class:`DocTest` begins, " +"or ``None`` if the line number is unavailable. This line number is zero-" +"based with respect to the beginning of the file." msgstr "" +"شماره خط در :attr:`filename` که این :class:`DocTest` در آن آغاز می‌شود، یا " +"``None`` اگر شماره خط در دسترس نیست. این شماره خط نسبت به ابتدای فایل " +"صفرپایه است." -msgid "The string that the test was extracted from, or ``None`` if the string is unavailable, or if the test was not extracted from a string." +msgid "" +"The string that the test was extracted from, or ``None`` if the string is " +"unavailable, or if the test was not extracted from a string." msgstr "" +"رشته‌ای که آزمون از آن استخراج شده است، یا ``None`` اگر رشته در دسترس نباشد، " +"یا اگر آزمون از رشته‌ای استخراج نشده باشد." msgid "Example Objects" -msgstr "" +msgstr "اشیای نمونه" -msgid "A single interactive example, consisting of a Python statement and its expected output. The constructor arguments are used to initialize the attributes of the same names." +msgid "" +"A single interactive example, consisting of a Python statement and its " +"expected output. The constructor arguments are used to initialize the " +"attributes of the same names." msgstr "" +"یک مثال تعاملی واحد، شامل یک دستور پایتون و خروجی مورد انتظار آن. " +"آرگومان‌های سازنده برای مقداردهی اولیه ویژگی‌هایی با همان نام‌ها استفاده " +"می‌شوند." -msgid ":class:`Example` defines the following attributes. They are initialized by the constructor, and should not be modified directly." +msgid "" +":class:`Example` defines the following attributes. They are initialized by " +"the constructor, and should not be modified directly." msgstr "" +":class:`Example` ویژگی‌های زیر را تعریف می‌کند. این ویژگی‌ها توسط سازنده " +"مقداردهی اولیه می‌شوند و نباید به‌طور مستقیم تغییر داده شوند." -msgid "A string containing the example's source code. This source code consists of a single Python statement, and always ends with a newline; the constructor adds a newline when necessary." +msgid "" +"A string containing the example's source code. This source code consists of" +" a single Python statement, and always ends with a newline; the constructor " +"adds a newline when necessary." msgstr "" +"رشته‌ای حاوی کد منبع مثال. این کد منبع شامل یک دستور پایتون است و همیشه با " +"یک خط جدید پایان می‌یابد؛ سازنده در صورت لزوم یک خط جدید اضافه می‌کند." -msgid "The expected output from running the example's source code (either from stdout, or a traceback in case of exception). :attr:`want` ends with a newline unless no output is expected, in which case it's an empty string. The constructor adds a newline when necessary." +msgid "" +"The expected output from running the example's source code (either from " +"stdout, or a traceback in case of exception). :attr:`want` ends with a " +"newline unless no output is expected, in which case it's an empty string. " +"The constructor adds a newline when necessary." msgstr "" +"خروجی مورد انتظار از اجرای کد منبع مثال (یا از stdout، یا ردگیری پشته در " +"صورت بروز استثنا). :attr:`want` با یک نویسه خط جدید پایان می‌یابد، مگر اینکه" +" هیچ خروجی‌ای مورد انتظار نباشد، که در این صورت یک رشته خالی است. سازنده در " +"صورت لزوم یک نویسه خط جدید اضافه می‌کند." -msgid "The exception message generated by the example, if the example is expected to generate an exception; or ``None`` if it is not expected to generate an exception. This exception message is compared against the return value of :func:`traceback.format_exception_only`. :attr:`exc_msg` ends with a newline unless it's ``None``. The constructor adds a newline if needed." -msgstr "" +msgid "" +"The exception message generated by the example, if the example is expected " +"to generate an exception; or ``None`` if it is not expected to generate an " +"exception. This exception message is compared against the return value of " +":func:`traceback.format_exception_only`. :attr:`exc_msg` ends with a " +"newline unless it's ``None``. The constructor adds a newline if needed." +msgstr "" +"پیام استثنای تولیدشده توسط مثال، اگر انتظار می‌رود که مثال یک استثنا تولید " +"کند؛ یا ``None`` اگر انتظار نمی‌رود که استثنا تولید کند. این پیام استثنا با " +"مقدار بازگشتی :func:`traceback.format_exception_only` مقایسه می‌شود. " +":attr:`exc_msg` به یک خط جدید ختم می‌شود، مگر اینکه ``None`` باشد. سازنده در" +" صورت نیاز یک خط جدید اضافه می‌کند." -msgid "The line number within the string containing this example where the example begins. This line number is zero-based with respect to the beginning of the containing string." +msgid "" +"The line number within the string containing this example where the example " +"begins. This line number is zero-based with respect to the beginning of the" +" containing string." msgstr "" +"شماره خط در رشته حاوی این مثال که مثال در آن آغاز می‌شود. این شماره خط نسبت " +"به ابتدای رشته حاوی، صفرمبنا است." -msgid "The example's indentation in the containing string, i.e., the number of space characters that precede the example's first prompt." +msgid "" +"The example's indentation in the containing string, i.e., the number of " +"space characters that precede the example's first prompt." msgstr "" +"تورفتگی مثال در رشته‌ی حاوی آن، یعنی تعداد نویسه‌های فاصله‌ای که پیش از اولین" +" اعلان (prompt) مثال قرار دارند." -msgid "A dictionary mapping from option flags to ``True`` or ``False``, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the :class:`DocTestRunner`'s :ref:`optionflags `). By default, no options are set." -msgstr "" +msgid "" +"A dictionary mapping from option flags to ``True`` or ``False``, which is " +"used to override default options for this example. Any option flags not " +"contained in this dictionary are left at their default value (as specified " +"by the :class:`DocTestRunner`'s :ref:`optionflags `). By " +"default, no options are set." +msgstr "" +"دیکشنری‌ای که نگاشتی از پرچم‌های گزینه به ``True`` یا ``False`` است و برای " +"بازنویسی گزینه‌های پیش‌فرض این مثال استفاده می‌شود. پرچم‌های گزینه‌ای که در " +"این دیکشنری وجود نداشته باشند، روی مقدار پیش‌فرض خود باقی می‌مانند (طبق " +":ref:`optionflags ` :class:`DocTestRunner`). به‌طور " +"پیش‌فرض، هیچ گزینه‌ای تنظیم نشده است." msgid "DocTestFinder objects" -msgstr "" +msgstr "اشیای DocTestFinder" -msgid "A processing class used to extract the :class:`DocTest`\\ s that are relevant to a given object, from its docstring and the docstrings of its contained objects. :class:`DocTest`\\ s can be extracted from modules, classes, functions, methods, staticmethods, classmethods, and properties." +msgid "" +"A processing class used to extract the :class:`DocTest`\\ s that are " +"relevant to a given object, from its docstring and the docstrings of its " +"contained objects. :class:`DocTest`\\ s can be extracted from modules, " +"classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" +"یک کلاس پردازشی که برای استخراج :class:`DocTest`\\ های مرتبط با یک شی" +"ء داده‌شده، از رشته‌ی مستندسازی آن و رشته‌های مستندسازی اشیاء درو" +"ن آن استفاده می‌شود. :class:`DocTest` ها را می‌توان از ماژول‌ها، کلاس‌ها" +"، توابع، متدها، متدهای ایستا (staticmethod)، متدهای کلاس (classmethod) " +"و پراپرتی‌ها استخراج کرد." -msgid "The optional argument *verbose* can be used to display the objects searched by the finder. It defaults to ``False`` (no output)." +msgid "" +"The optional argument *verbose* can be used to display the objects searched " +"by the finder. It defaults to ``False`` (no output)." msgstr "" +"از آرگومان اختیاری *verbose* می‌توان برای نمایش اشیای جستجوشده توسط یابنده " +"استفاده کرد. مقدار پیش‌فرض آن ``False`` است (بدون خروجی)." -msgid "The optional argument *parser* specifies the :class:`DocTestParser` object (or a drop-in replacement) that is used to extract doctests from docstrings." +msgid "" +"The optional argument *parser* specifies the :class:`DocTestParser` object " +"(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" +"آرگومان اختیاری *parser*، شیء :class:`DocTestParser` (یا یک جایگزین مستقیم " +"(drop-in replacement)) را که برای استخراج doctestها از docstringها به کار " +"می‌رود، تعیین می‌کند." -msgid "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` will only examine the given object, and not any contained objects." +msgid "" +"If the optional argument *recurse* is false, then :meth:`DocTestFinder.find`" +" will only examine the given object, and not any contained objects." msgstr "" +"اگر آرگومان اختیاری *recurse* نادرست باشد، آنگاه :meth:`DocTestFinder.find` " +"فقط شیء داده‌شده را بررسی می‌کند و هیچ‌یک از اشیای درون آن را بررسی نمی‌کند." -msgid "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder.find` will include tests for objects with empty docstrings." +msgid "" +"If the optional argument *exclude_empty* is false, then " +":meth:`DocTestFinder.find` will include tests for objects with empty " +"docstrings." msgstr "" +"اگر آرگومان اختیاری *exclude_empty* نادرست باشد، :meth:`DocTestFinder.find` " +"شامل آزمون‌هایی برای اشیایی با رشته مستندات‌های خالی خواهد شد." msgid ":class:`DocTestFinder` defines the following method:" -msgstr "" +msgstr ":class:`DocTestFinder` متد زیر را تعریف می‌کند:" -msgid "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s docstring, or by any of its contained objects' docstrings." +msgid "" +"Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " +"docstring, or by any of its contained objects' docstrings." msgstr "" +"فهرستی از :class:`DocTest`\\ s را برمی‌گرداند که توسط رشته‌ی مستندسازی " +"رشته مستند شیء *obj*، یا توسط هر یک از رشته‌های مستندسازی اشیاء درون آن " +"تعریف شده‌اند." -msgid "The optional argument *name* specifies the object's name; this name will be used to construct names for the returned :class:`DocTest`\\ s. If *name* is not specified, then ``obj.__name__`` is used." +msgid "" +"The optional argument *name* specifies the object's name; this name will be " +"used to construct names for the returned :class:`DocTest`\\ s. If *name* is" +" not specified, then ``obj.__name__`` is used." msgstr "" +"آرگومان اختیاری *name* نام شیء را مشخص می‌کند؛ این نام برای ساخت نام‌هایی " +"برای :class:`DocTest`\\ s بازگشتی استفاده خواهد شد. اگر *name* مشخص نشده " +"باشد، از ``obj.__name__`` استفاده می‌شود." -msgid "The optional parameter *module* is the module that contains the given object. If the module is not specified or is ``None``, then the test finder will attempt to automatically determine the correct module. The object's module is used:" +msgid "" +"The optional parameter *module* is the module that contains the given " +"object. If the module is not specified or is ``None``, then the test finder " +"will attempt to automatically determine the correct module. The object's " +"module is used:" msgstr "" +"پارامتر اختیاری *module* ماژولی است که شیء داده‌شده را در بر دارد. اگر ماژول" +" مشخص نشده باشد یا ``None`` باشد، یافت‌کننده آزمون تلاش می‌کند تا ماژول صحیح " +"را به‌طور خودکار تعیین کند. ماژول شیء مورد استفاده قرار می‌گیرد:" msgid "As a default namespace, if *globs* is not specified." -msgstr "" +msgstr "به‌عنوان یک فضای نام پیش‌فرض، اگر *globs* مشخص نشده باشد." -msgid "To prevent the DocTestFinder from extracting DocTests from objects that are imported from other modules. (Contained objects with modules other than *module* are ignored.)" +msgid "" +"To prevent the DocTestFinder from extracting DocTests from objects that are " +"imported from other modules. (Contained objects with modules other than " +"*module* are ignored.)" msgstr "" +"برای جلوگیری از استخراج DocTests از اشیایی که از ماژول‌های دیگر ایمپورت " +"شده‌اند. (اشیای دربرگرفته‌شده‌ای که ماژول آن‌ها غیر از *module* است، نادیده " +"گرفته می‌شوند.)" msgid "To find the name of the file containing the object." -msgstr "" +msgstr "برای یافتن نام فایلی که حاوی شیء است." msgid "To help find the line number of the object within its file." -msgstr "" +msgstr "برای کمک به یافتن شماره‌ی خط شیء در فایل آن." -msgid "If *module* is ``False``, no attempt to find the module will be made. This is obscure, of use mostly in testing doctest itself: if *module* is ``False``, or is ``None`` but cannot be found automatically, then all objects are considered to belong to the (non-existent) module, so all contained objects will (recursively) be searched for doctests." -msgstr "" +msgid "" +"If *module* is ``False``, no attempt to find the module will be made. This " +"is obscure, of use mostly in testing doctest itself: if *module* is " +"``False``, or is ``None`` but cannot be found automatically, then all " +"objects are considered to belong to the (non-existent) module, so all " +"contained objects will (recursively) be searched for doctests." +msgstr "" +"اگر *module* برابر ``False`` باشد، هیچ تلاشی برای یافتن ماژول انجام نخواهد " +"شد. این حالت مبهم است و بیشتر در آزمایش خود doctest کاربرد دارد: اگر " +"*module* برابر ``False`` باشد، یا ``None`` باشد ولی به‌طور خودکار یافت نشود،" +" آنگاه تمام اشیاء متعلق به ماژول (ناموجود) در نظر گرفته می‌شوند، بنابراین " +"تمام اشیاء داخلی به‌صورت بازگشتی برای یافتن doctestها جستجو خواهند شد." -msgid "The globals for each :class:`DocTest` is formed by combining *globs* and *extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new shallow copy of the globals dictionary is created for each :class:`!DocTest`. If *globs* is not specified, then it defaults to the module's :attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If *extraglobs* is not specified, then it defaults to ``{}``." -msgstr "" +msgid "" +"The globals for each :class:`DocTest` is formed by combining *globs* and " +"*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new" +" shallow copy of the globals dictionary is created for each " +":class:`!DocTest`. If *globs* is not specified, then it defaults to the " +"module's :attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If " +"*extraglobs* is not specified, then it defaults to ``{}``." +msgstr "" +"متغیرهای سراسری هر :class:`DocTest` با ترکیب *globs* و *extraglobs* تشکیل " +"می‌شود (انتساب‌های موجود در *extraglobs* جایگزین انتساب‌های موجود در *globs*" +" می‌شوند). برای هر :class:`!DocTest` یک کپی کم‌عمق جدید از دیکشنری متغیرهای" +" سراسری ایجاد می‌شود. اگر *globs* مشخص‌نشده باشد، مقدار پیش‌فرض آن " +":attr:`~module.__dict__` ماژول، در صورت مشخص بودن ماژول، و در غیر این صورت " +"``{}`` خواهد بود. اگر *extraglobs* مشخص‌نشده باشد، مقدار پیش‌فرض آن ``{}`` " +"است." msgid "DocTestParser objects" -msgstr "" +msgstr "اشیای DocTestParser" -msgid "A processing class used to extract interactive examples from a string, and use them to create a :class:`DocTest` object." +msgid "" +"A processing class used to extract interactive examples from a string, and " +"use them to create a :class:`DocTest` object." msgstr "" +"یک کلاس پردازشی که برای استخراج مثال‌های تعاملی از یک رشته و استفاده از " +"آن‌ها برای ایجاد یک شیء :class:`DocTest` به کار می‌رود." msgid ":class:`DocTestParser` defines the following methods:" -msgstr "" +msgstr ":class:`DocTestParser` متدهای زیر را تعریف می‌کند:" -msgid "Extract all doctest examples from the given string, and collect them into a :class:`DocTest` object." +msgid "" +"Extract all doctest examples from the given string, and collect them into a " +":class:`DocTest` object." msgstr "" +"تمام مثال‌های doctest را از رشته‌ی داده‌شده استخراج می‌کند و آن‌ها را در یک " +"شیء :class:`DocTest` جمع‌آوری می‌کند." -msgid "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:`!DocTest` object. See the documentation for :class:`DocTest` for more information." +msgid "" +"*globs*, *name*, *filename*, and *lineno* are attributes for the new " +":class:`!DocTest` object. See the documentation for :class:`DocTest` for " +"more information." msgstr "" +"*globs*، *name*، *filename* و *lineno* ویژگی‌های شیء جدید :class:`!DocTest` " +"هستند. برای اطلاعات بیشتر، مستندات :class:`DocTest` را ببینید." -msgid "Extract all doctest examples from the given string, and return them as a list of :class:`Example` objects. Line numbers are 0-based. The optional argument *name* is a name identifying this string, and is only used for error messages." +msgid "" +"Extract all doctest examples from the given string, and return them as a " +"list of :class:`Example` objects. Line numbers are 0-based. The optional " +"argument *name* is a name identifying this string, and is only used for " +"error messages." msgstr "" +"تمام مثال‌های doctest را از رشته داده‌شده استخراج می‌کند و آن‌ها را به‌صورت " +"فهرستی از اشیای :class:`Example` برمی‌گرداند. شماره خطوط از ۰ شروع می‌شود." +" آرگومان اختیاری *name* نامی برای شناسایی این رشته است و فقط در پیام‌های خطا" +" استفاده می‌شود." -msgid "Divide the given string into examples and intervening text, and return them as a list of alternating :class:`Example`\\ s and strings. Line numbers for the :class:`!Example`\\ s are 0-based. The optional argument *name* is a name identifying this string, and is only used for error messages." +msgid "" +"Divide the given string into examples and intervening text, and return them " +"as a list of alternating :class:`Example`\\ s and strings. Line numbers for " +"the :class:`!Example`\\ s are 0-based. The optional argument *name* is a " +"name identifying this string, and is only used for error messages." msgstr "" +"رشته داده‌شده را به مثال‌ها و متن‌های میان آن‌ها تقسیم می‌کند و آن‌ها را " +"به‌صورت فهرستی متناوب از :class:`Example` ها و رشته‌ها برمی‌گرداند. شماره‌ی " +"خطوط برای :class:`!Example` ها مبنای ۰ است. آرگومان اختیاری *name* نامی برای" +" شناسایی این رشته است و فقط برای پیام‌های خطا استفاده می‌شود." msgid "TestResults objects" -msgstr "" +msgstr "اشیاء TestResults" msgid "Number of failed tests." -msgstr "" +msgstr "تعداد آزمون‌های ناموفق." msgid "Number of attempted tests." -msgstr "" +msgstr "تعداد آزمون‌های انجام‌شده." msgid "Number of skipped tests." -msgstr "" +msgstr "تعداد آزمون‌های ردشده." msgid "DocTestRunner objects" -msgstr "" +msgstr "اشیای DocTestRunner" -msgid "A processing class used to execute and verify the interactive examples in a :class:`DocTest`." +msgid "" +"A processing class used to execute and verify the interactive examples in a " +":class:`DocTest`." msgstr "" +"یک کلاس پردازشی که برای اجرا و صحت‌سنجی مثال‌های تعاملی در یک " +":class:`DocTest` استفاده می‌شود." -msgid "The comparison between expected outputs and actual outputs is done by an :class:`OutputChecker`. This comparison may be customized with a number of option flags; see section :ref:`doctest-options` for more information. If the option flags are insufficient, then the comparison may also be customized by passing a subclass of :class:`!OutputChecker` to the constructor." -msgstr "" +msgid "" +"The comparison between expected outputs and actual outputs is done by an " +":class:`OutputChecker`. This comparison may be customized with a number of " +"option flags; see section :ref:`doctest-options` for more information. If " +"the option flags are insufficient, then the comparison may also be " +"customized by passing a subclass of :class:`!OutputChecker` to the " +"constructor." +msgstr "" +"مقایسه بین خروجی‌های مورد انتظار و خروجی‌های واقعی توسط یک " +":class:`OutputChecker` انجام می‌شود. این مقایسه می‌تواند با تعدادی پرچم " +"گزینه سفارشی‌سازی شود؛ برای اطلاعات بیشتر بخش :ref:`doctest-options` را " +"ببینید. اگر پرچم‌های گزینه کافی نباشند، این مقایسه همچنین می‌تواند با ارسال " +"یک زیرکلاس از :class:`!OutputChecker` به سازنده سفارشی‌سازی شود." -msgid "The test runner's display output can be controlled in two ways. First, an output function can be passed to :meth:`run`; this function will be called with strings that should be displayed. It defaults to ``sys.stdout.write``. If capturing the output is not sufficient, then the display output can be also customized by subclassing DocTestRunner, and overriding the methods :meth:`report_start`, :meth:`report_success`, :meth:`report_unexpected_exception`, and :meth:`report_failure`." -msgstr "" +msgid "" +"The test runner's display output can be controlled in two ways. First, an " +"output function can be passed to :meth:`run`; this function will be called " +"with strings that should be displayed. It defaults to ``sys.stdout.write``." +" If capturing the output is not sufficient, then the display output can be " +"also customized by subclassing DocTestRunner, and overriding the methods " +":meth:`report_start`, :meth:`report_success`, " +":meth:`report_unexpected_exception`, and :meth:`report_failure`." +msgstr "" +"خروجی نمایشی اجراکننده‌ی آزمون را می‌توان به دو روش کنترل کرد. نخست، می‌توان" +" یک تابع خروجی به :meth:`run` ارسال کرد؛ این تابع با رشته‌هایی که باید نمایش" +" داده شوند فراخوانی می‌شود. مقدار پیش‌فرض آن ``sys.stdout.write`` است. اگر " +"گرفتن خروجی کافی نباشد، می‌توان خروجی نمایشی را نیز با ایجاد زیرکلاس از " +"DocTestRunner و بازنویسی متدهای :meth:`report_start`، " +":meth:`report_success`، :meth:`report_unexpected_exception` و " +":meth:`report_failure` سفارشی‌سازی کرد." -msgid "The optional keyword argument *checker* specifies the :class:`OutputChecker` object (or drop-in replacement) that should be used to compare the expected outputs to the actual outputs of doctest examples." +msgid "" +"The optional keyword argument *checker* specifies the :class:`OutputChecker`" +" object (or drop-in replacement) that should be used to compare the expected" +" outputs to the actual outputs of doctest examples." msgstr "" +"آرگومان کلیدواژه‌ای اختیاری *checker*، شیء :class:`OutputChecker` (یا " +"جایگزین مستقیم (drop-in replacement)) را مشخص می‌کند که باید برای مقایسه‌ی " +"خروجی‌های مورد انتظار با خروجی‌های واقعی مثال‌های doctest استفاده شود." -msgid "The optional keyword argument *verbose* controls the :class:`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is printed about each example, as it is run. If *verbose* is ``False``, then only failures are printed. If *verbose* is unspecified, or ``None``, then verbose output is used iff the command-line switch ``-v`` is used." -msgstr "" +msgid "" +"The optional keyword argument *verbose* controls the " +":class:`DocTestRunner`'s verbosity. If *verbose* is ``True``, then " +"information is printed about each example, as it is run. If *verbose* is " +"``False``, then only failures are printed. If *verbose* is unspecified, or " +"``None``, then verbose output is used iff the command-line switch ``-v`` is " +"used." +msgstr "" +"آرگومان کلیدواژه‌ای اختیاری *verbose* میزان پرگویی :class:`DocTestRunner` را" +" کنترل می‌کند. اگر *verbose* برابر ``True`` باشد، اطلاعات مربوط به هر مثال " +"هنگام اجرای آن چاپ می‌شود. اگر *verbose* برابر ``False`` باشد، فقط شکست‌ها " +"چاپ می‌شوند. اگر *verbose* مشخص‌نشده باشد یا ``None`` باشد، خروجی پرگو فقط " +"و فقط در صورتی به کار می‌رود که از سوییچ خط فرمان ``-v`` استفاده شود." -msgid "The optional keyword argument *optionflags* can be used to control how the test runner compares expected output to actual output, and how it displays failures. For more information, see section :ref:`doctest-options`." +msgid "" +"The optional keyword argument *optionflags* can be used to control how the " +"test runner compares expected output to actual output, and how it displays " +"failures. For more information, see section :ref:`doctest-options`." msgstr "" +"می‌توان از آرگومان کلیدواژه‌ای اختیاری *optionflags* برای کنترل نحوه‌ی " +"مقایسه‌ی خروجی مورد انتظار با خروجی واقعی توسط اجراکننده‌ی آزمون و نحوه‌ی " +"نمایش شکست‌ها استفاده کرد. برای اطلاعات بیشتر، بخش :ref:`doctest-options` را" +" ببینید." -msgid "The test runner accumulates statistics. The aggregated number of attempted, failed and skipped examples is also available via the :attr:`tries`, :attr:`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:`summarize` methods return a :class:`TestResults` instance." +msgid "" +"The test runner accumulates statistics. The aggregated number of attempted, " +"failed and skipped examples is also available via the :attr:`tries`, " +":attr:`failures` and :attr:`skips` attributes. The :meth:`run` and " +":meth:`summarize` methods return a :class:`TestResults` instance." msgstr "" +"اجراکننده آزمون آمار را گردآوری می‌کند. تعداد تجمیعی مثال‌های اجراشده، ناموفق " +"و ردشده نیز از طریق ویژگی‌های :attr:`tries`، :attr:`failures` و " +":attr:`skips` در دسترس است. متدهای :meth:`run` و :meth:`summarize` یک نمونه " +"از :class:`TestResults` را برمی‌گردانند." msgid ":class:`DocTestRunner` defines the following methods:" -msgstr "" +msgstr ":class:`DocTestRunner` متدهای زیر را تعریف می‌کند:" -msgid "Report that the test runner is about to process the given example. This method is provided to allow subclasses of :class:`DocTestRunner` to customize their output; it should not be called directly." +msgid "" +"Report that the test runner is about to process the given example. This " +"method is provided to allow subclasses of :class:`DocTestRunner` to " +"customize their output; it should not be called directly." msgstr "" +"گزارش می‌دهد که اجراکننده‌ی آزمون (test runner) در آستانه‌ی پردازش مثال " +"داده‌شده است. این متد ارائه شده است تا زیرکلاس‌های :class:`DocTestRunner` " +"بتوانند خروجی خود را سفارشی‌سازی کنند؛ نباید مستقیماً فراخوانی شود." -msgid "*example* is the example about to be processed. *test* is the test containing *example*. *out* is the output function that was passed to :meth:`DocTestRunner.run`." +msgid "" +"*example* is the example about to be processed. *test* is the test " +"containing *example*. *out* is the output function that was passed to " +":meth:`DocTestRunner.run`." msgstr "" +"*example* مثالی است که در آستانه‌ی پردازش قرار دارد. *test* آزمونی است که " +"شامل *example* می‌شود. *out* تابع خروجی است که به :meth:`DocTestRunner.run`" +" پاس داده شده است." -msgid "Report that the given example ran successfully. This method is provided to allow subclasses of :class:`DocTestRunner` to customize their output; it should not be called directly." +msgid "" +"Report that the given example ran successfully. This method is provided to " +"allow subclasses of :class:`DocTestRunner` to customize their output; it " +"should not be called directly." msgstr "" +"گزارش می‌دهد که مثال داده‌شده با موفقیت اجرا شده است. این متد ارائه شده است " +"تا زیرکلاس‌های :class:`DocTestRunner` بتوانند خروجی خود را سفارشی‌سازی کنند؛" +" نباید مستقیماً فراخوانی شود." -msgid "*example* is the example about to be processed. *got* is the actual output from the example. *test* is the test containing *example*. *out* is the output function that was passed to :meth:`DocTestRunner.run`." +msgid "" +"*example* is the example about to be processed. *got* is the actual output " +"from the example. *test* is the test containing *example*. *out* is the " +"output function that was passed to :meth:`DocTestRunner.run`." msgstr "" +"*example* مثالی است که در شرف پردازش قرار دارد. *got* خروجی واقعی مثال است. " +"*test* آزمونی است که *example* را شامل می‌شود. *out* تابع خروجی‌ای است که به" +" :meth:`DocTestRunner.run` ارسال شده است." -msgid "Report that the given example failed. This method is provided to allow subclasses of :class:`DocTestRunner` to customize their output; it should not be called directly." +msgid "" +"Report that the given example failed. This method is provided to allow " +"subclasses of :class:`DocTestRunner` to customize their output; it should " +"not be called directly." msgstr "" +"گزارش می‌دهد که مثال داده‌شده شکست خورده است. این متد ارائه شده است تا " +"زیرکلاس‌های :class:`DocTestRunner` بتوانند خروجی خود را سفارشی کنند؛ نباید " +"به‌صورت مستقیم فراخوانی شود." -msgid "Report that the given example raised an unexpected exception. This method is provided to allow subclasses of :class:`DocTestRunner` to customize their output; it should not be called directly." +msgid "" +"Report that the given example raised an unexpected exception. This method is" +" provided to allow subclasses of :class:`DocTestRunner` to customize their " +"output; it should not be called directly." msgstr "" +"گزارش کن که مثال داده‌شده استثنای غیرمنتظره‌ای را پرتاب کرده است. این متد " +"ارائه شده است تا زیرکلاس‌های :class:`DocTestRunner` بتوانند خروجی خود را " +"سفارشی‌سازی کنند؛ نباید مستقیماً فراخوانی شود." -msgid "*example* is the example about to be processed. *exc_info* is a tuple containing information about the unexpected exception (as returned by :func:`sys.exc_info`). *test* is the test containing *example*. *out* is the output function that was passed to :meth:`DocTestRunner.run`." +msgid "" +"*example* is the example about to be processed. *exc_info* is a tuple " +"containing information about the unexpected exception (as returned by " +":func:`sys.exc_info`). *test* is the test containing *example*. *out* is " +"the output function that was passed to :meth:`DocTestRunner.run`." msgstr "" +"*example* مثالی است که در آستانه‌ی پردازش است. *exc_info* تاپلی شامل اطلاعات " +"مربوط به استثنای غیرمنتظره است (همان‌طور که توسط :func:`sys.exc_info` " +"برگردانده می‌شود). *test* آزمونی است که شامل *example* است. *out* تابع " +"خروجی‌ای است که به :meth:`DocTestRunner.run` پاس داده شده است." -msgid "Run the examples in *test* (a :class:`DocTest` object), and display the results using the writer function *out*. Return a :class:`TestResults` instance." +msgid "" +"Run the examples in *test* (a :class:`DocTest` object), and display the " +"results using the writer function *out*. Return a :class:`TestResults` " +"instance." msgstr "" +"مثال‌های موجود در *test* (یک شیء :class:`DocTest`) را اجرا می‌کند و نتایج را" +" با استفاده از تابع نویسنده *out* نمایش می‌دهد. یک نمونه " +":class:`TestResults` را برمی‌گرداند." -msgid "The examples are run in the namespace ``test.globs``. If *clear_globs* is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use *clear_globs=False*." +msgid "" +"The examples are run in the namespace ``test.globs``. If *clear_globs* is " +"true (the default), then this namespace will be cleared after the test runs," +" to help with garbage collection. If you would like to examine the namespace" +" after the test completes, then use *clear_globs=False*." msgstr "" +"مثال‌ها در فضای نام ``test.globs`` اجرا می‌شوند. اگر *clear_globs* درست باشد" +" (پیش‌فرض)، این فضای نام پس از اجرای آزمون پاک‌سازی می‌شود تا به زباله‌روبی " +"کمک کند. اگر می‌خواهید پس از پایان آزمون فضای نام را بررسی کنید، از " +"*clear_globs=False* استفاده کنید." -msgid "*compileflags* gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to *globs*." +msgid "" +"*compileflags* gives the set of flags that should be used by the Python " +"compiler when running the examples. If not specified, then it will default " +"to the set of future-import flags that apply to *globs*." msgstr "" +"*compileflags* مجموعه‌ای از پرچم‌ها را مشخص می‌کند که باید هنگام اجرای " +"مثال‌ها توسط کامپایلر پایتون استفاده شوند. اگر مشخص نشده باشد، به‌طور " +"پیش‌فرض مجموعه‌ای از پرچم‌های future-import خواهد بود که بر *globs* اعمال " +"می‌شوند." -msgid "The output of each example is checked using the :class:`DocTestRunner`'s output checker, and the results are formatted by the :meth:`!DocTestRunner.report_\\*` methods." +msgid "" +"The output of each example is checked using the :class:`DocTestRunner`'s " +"output checker, and the results are formatted by the " +":meth:`!DocTestRunner.report_\\*` methods." msgstr "" +"خروجی هر مثال با استفاده از بررسی‌کننده خروجی :class:`DocTestRunner` بررسی " +"می‌شود، و نتایج توسط متدهای :meth:`!DocTestRunner.report_\\*` قالب‌بندی " +"می‌شوند." -msgid "Print a summary of all the test cases that have been run by this DocTestRunner, and return a :class:`TestResults` instance." +msgid "" +"Print a summary of all the test cases that have been run by this " +"DocTestRunner, and return a :class:`TestResults` instance." msgstr "" +"خلاصه‌ای از تمام موارد آزمونی که توسط این DocTestRunner اجرا شده‌اند را چاپ " +"می‌کند و نمونه‌ای از :class:`TestResults` را بازمی‌گرداند." -msgid "The optional *verbose* argument controls how detailed the summary is. If the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity is used." +msgid "" +"The optional *verbose* argument controls how detailed the summary is. If " +"the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " +"is used." msgstr "" +"آرگومان اختیاری *verbose* میزان جزئیات خلاصه را کنترل می‌کند. اگر میزان " +"جزئیات مشخص نشده باشد، از میزان جزئیات :class:`DocTestRunner` استفاده " +"می‌شود." msgid ":class:`DocTestParser` has the following attributes:" -msgstr "" +msgstr ":class:`DocTestParser` ویژگی‌های زیر را دارد:" msgid "Number of attempted examples." -msgstr "" +msgstr "تعداد مثال‌های آزمایش‌شده." msgid "Number of failed examples." -msgstr "" +msgstr "تعداد مثال‌های ناموفق." msgid "Number of skipped examples." -msgstr "" +msgstr "تعداد مثال‌های ردشده." msgid "OutputChecker objects" -msgstr "" +msgstr "اشیای OutputChecker" -msgid "A class used to check the whether the actual output from a doctest example matches the expected output. :class:`OutputChecker` defines two methods: :meth:`check_output`, which compares a given pair of outputs, and returns ``True`` if they match; and :meth:`output_difference`, which returns a string describing the differences between two outputs." -msgstr "" +msgid "" +"A class used to check the whether the actual output from a doctest example " +"matches the expected output. :class:`OutputChecker` defines two methods: " +":meth:`check_output`, which compares a given pair of outputs, and returns " +"``True`` if they match; and :meth:`output_difference`, which returns a " +"string describing the differences between two outputs." +msgstr "" +"کلاسی که برای بررسی تطابق خروجی واقعی یک مثال doctest با خروجی مورد انتظار " +"استفاده می‌شود. :class:`OutputChecker` دو متد تعریف می‌کند: " +":meth:`check_output`، که یک جفت خروجی داده‌شده را مقایسه می‌کند و در صورت " +"مطابقت آن‌ها ``True`` را برمی‌گرداند؛ و :meth:`output_difference`، که " +"رشته‌ای را برمی‌گرداند که تفاوت‌های بین دو خروجی را توصیف می‌کند." msgid ":class:`OutputChecker` defines the following methods:" -msgstr "" +msgstr ":class:`OutputChecker` متدهای زیر را تعریف می‌کند:" -msgid "Return ``True`` iff the actual output from an example (*got*) matches the expected output (*want*). These strings are always considered to match if they are identical; but depending on what option flags the test runner is using, several non-exact match types are also possible. See section :ref:`doctest-options` for more information about option flags." -msgstr "" +msgid "" +"Return ``True`` iff the actual output from an example (*got*) matches the " +"expected output (*want*). These strings are always considered to match if " +"they are identical; but depending on what option flags the test runner is " +"using, several non-exact match types are also possible. See section " +":ref:`doctest-options` for more information about option flags." +msgstr "" +"اگر و تنها اگر خروجی واقعی یک مثال (*got*) با خروجی مورد انتظار (*want*) " +"مطابقت داشته باشد، ``True`` را برمی‌گرداند. این رشته‌ها همیشه در صورتی که " +"یکسان باشند، منطبق در نظر گرفته می‌شوند؛ اما بسته به پرچم‌های گزینه‌ای که " +"اجراکننده‌ی آزمون از آن‌ها استفاده می‌کند، چندین نوع انطباق غیردقیق نیز " +"امکان‌پذیر است. برای اطلاعات بیشتر درباره‌ی پرچم‌های گزینه، بخش " +":ref:`doctest-options` را ببینید." -msgid "Return a string describing the differences between the expected output for a given example (*example*) and the actual output (*got*). *optionflags* is the set of option flags used to compare *want* and *got*." +msgid "" +"Return a string describing the differences between the expected output for a" +" given example (*example*) and the actual output (*got*). *optionflags* is " +"the set of option flags used to compare *want* and *got*." msgstr "" +"رشته‌ای برمی‌گرداند که تفاوت‌های بین خروجی مورد انتظار برای یک مثال داده‌شده" +" (*example*) و خروجی واقعی (*got*) را توصیف می‌کند. *optionflags* مجموعه‌ای " +"از پرچم‌های گزینه است که برای مقایسه‌ی *want* و *got* به کار می‌رود." msgid "Debugging" -msgstr "" +msgstr "اشکال‌زدایی" msgid "Doctest provides several mechanisms for debugging doctest examples:" -msgstr "" +msgstr "Doctest چندین سازوکار برای اشکال‌زدایی مثال‌های doctest فراهم می‌کند:" -msgid "Several functions convert doctests to executable Python programs, which can be run under the Python debugger, :mod:`pdb`." +msgid "" +"Several functions convert doctests to executable Python programs, which can " +"be run under the Python debugger, :mod:`pdb`." msgstr "" +"چندین تابع doctestها را به برنامه‌های قابل‌اجرای پایتون تبدیل می‌کنند که " +"می‌توان آن‌ها را تحت اشکال‌زدای پایتون، :mod:`pdb` اجرا کرد." -msgid "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that raises an exception for the first failing example, containing information about that example. This information can be used to perform post-mortem debugging on the example." +msgid "" +"The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " +"raises an exception for the first failing example, containing information " +"about that example. This information can be used to perform post-mortem " +"debugging on the example." msgstr "" +"کلاس :class:`DebugRunner` یک زیرکلاس از :class:`DocTestRunner` است که برای " +"اولین مثال ناموفق، استثنایی پرتاب می‌کند که حاوی اطلاعاتی درباره آن مثال " +"است. می‌توان از این اطلاعات برای انجام اشکال‌زدایی پس از وقوع خطا (post-" +"mortem debugging) روی مثال استفاده کرد." -msgid "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :meth:`debug` method defined by :class:`unittest.TestCase`." +msgid "" +"The :mod:`unittest` cases generated by :func:`DocTestSuite` support the " +":meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" +"موارد آزمون :mod:`unittest` که توسط :func:`DocTestSuite` تولید شده‌اند، از " +"متد :meth:`debug` تعریف‌شده در :class:`unittest.TestCase` پشتیبانی می‌کنند." -msgid "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll drop into the Python debugger when that line is executed. Then you can inspect current values of variables, and so on. For example, suppose :file:`a.py` contains just this module docstring::" +msgid "" +"You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll" +" drop into the Python debugger when that line is executed. Then you can " +"inspect current values of variables, and so on. For example, suppose " +":file:`a.py` contains just this module docstring::" msgstr "" +"می‌توانید یک فراخوانی به :func:`pdb.set_trace` را در یک مثال doctest اضافه " +"کنید، و هنگامی که آن خط اجرا می‌شود، وارد اشکال‌زدای پایتون می‌شوید. سپس " +"می‌توانید مقادیر فعلی متغیرها و غیره را بررسی کنید. برای مثال، فرض کنید " +":file:`a.py` فقط شامل این رشته‌مستندات ماژول است::" msgid "" "\"\"\"\n" @@ -1226,9 +2963,16 @@ msgid "" "9\n" "\"\"\"" msgstr "" +">>> def f(x):\n" +"... g(x*2)\n" +">>> def g(x):\n" +"... print(x+3)\n" +"... import pdb; pdb.set_trace()\n" +">>> f(3)\n" +"9" msgid "Then an interactive Python session may look like this::" -msgstr "" +msgstr "سپس یک نشست تعاملی پایتون ممکن است به این شکل باشد::" msgid "" ">>> import a, doctest\n" @@ -1261,15 +3005,56 @@ msgid "" "(0, 3)\n" ">>>" msgstr "" +">>> import a, doctest\n" +">>> doctest.testmod(a)\n" +"--Return--\n" +"> (3)g()->None\n" +"-> import pdb; pdb.set_trace()\n" +"(Pdb) list\n" +" 1 def g(x):\n" +" 2 print(x+3)\n" +" 3 -> import pdb; pdb.set_trace()\n" +"[EOF]\n" +"(Pdb) p x\n" +"6\n" +"(Pdb) step\n" +"--Return--\n" +"> (2)f()->None\n" +"-> g(x*2)\n" +"(Pdb) list\n" +" 1 def f(x):\n" +" 2 -> g(x*2)\n" +"[EOF]\n" +"(Pdb) p x\n" +"3\n" +"(Pdb) step\n" +"--Return--\n" +"> (1)?()->None\n" +"-> f(3)\n" +"(Pdb) cont\n" +"(0, 3)\n" +">>>" -msgid "Functions that convert doctests to Python code, and possibly run the synthesized code under the debugger:" +msgid "" +"Functions that convert doctests to Python code, and possibly run the " +"synthesized code under the debugger:" msgstr "" +"تابع‌هایی که doctestها را به کد پایتون تبدیل می‌کنند، و احتمالاً کد " +"ساخته‌شده را زیر نظر اشکال‌زدا اجرا می‌کنند:" msgid "Convert text with examples to a script." -msgstr "" +msgstr "متن همراه با مثال‌ها را به یک اسکریپت تبدیل کنید." -msgid "Argument *s* is a string containing doctest examples. The string is converted to a Python script, where doctest examples in *s* are converted to regular code, and everything else is converted to Python comments. The generated script is returned as a string. For example, ::" +msgid "" +"Argument *s* is a string containing doctest examples. The string is " +"converted to a Python script, where doctest examples in *s* are converted to" +" regular code, and everything else is converted to Python comments. The " +"generated script is returned as a string. For example, ::" msgstr "" +"آرگومان *s* رشته‌ای حاوی مثال‌های doctest است. این رشته به یک اسکریپت پایتون" +" تبدیل می‌شود، به‌طوری که مثال‌های doctest درون *s* به کد معمولی تبدیل " +"می‌شوند و هر چیز دیگر به کامنت‌های پایتون تبدیل می‌شود. اسکریپت تولیدشده " +"به‌صورت یک رشته برگردانده می‌شود. برای مثال، ::" msgid "" "import doctest\n" @@ -1282,9 +3067,18 @@ msgid "" " 3\n" "\"\"\"))" msgstr "" +"import doctest\n" +"print(doctest.script_from_examples(r\"\"\"\n" +" Set x and y to 1 and 2.\n" +" >>> x, y = 1, 2\n" +"\n" +" Print their sum:\n" +" >>> print(x+y)\n" +" 3\n" +"\"\"\"))" msgid "displays::" -msgstr "" +msgstr "نمایش می‌دهد::" msgid "" "# Set x and y to 1 and 2.\n" @@ -1295,122 +3089,335 @@ msgid "" "# Expected:\n" "## 3" msgstr "" +"# x و y را برابر ۱ و ۲ قرار دهید.\n" +"x, y = 1, 2\n" +"#\n" +"# مجموع آن‌ها را چاپ کنید:\n" +"print(x+y)\n" +"# خروجی مورد انتظار:\n" +"## 3" -msgid "This function is used internally by other functions (see below), but can also be useful when you want to transform an interactive Python session into a Python script." +msgid "" +"This function is used internally by other functions (see below), but can " +"also be useful when you want to transform an interactive Python session into" +" a Python script." msgstr "" +"این تابع به‌صورت داخلی توسط توابع دیگر استفاده می‌شود (در زیر ببینید)، اما " +"می‌تواند هنگامی که بخواهید یک نشست تعاملی پایتون را به یک اسکریپت پایتون " +"(Python script) تبدیل کنید نیز مفید باشد." msgid "Convert the doctest for an object to a script." -msgstr "" +msgstr "doctest یک شیء را به یک اسکریپت تبدیل کنید." -msgid "Argument *module* is a module object, or dotted name of a module, containing the object whose doctests are of interest. Argument *name* is the name (within the module) of the object with the doctests of interest. The result is a string, containing the object's docstring converted to a Python script, as described for :func:`script_from_examples` above. For example, if module :file:`a.py` contains a top-level function :func:`!f`, then ::" -msgstr "" +msgid "" +"Argument *module* is a module object, or dotted name of a module, containing" +" the object whose doctests are of interest. Argument *name* is the name " +"(within the module) of the object with the doctests of interest. The result" +" is a string, containing the object's docstring converted to a Python " +"script, as described for :func:`script_from_examples` above. For example, " +"if module :file:`a.py` contains a top-level function :func:`!f`, then ::" +msgstr "" +"آرگومان *module* یک شیء ماژول، یا نام نقطه‌دار یک ماژول است که شامل شیءای است" +" که آزمون‌های مستند (doctests) آن مورد نظر هستند. آرگومان *name* نام شیء " +"(درون ماژول) با آزمون‌های مستند (doctests) مورد نظر است. نتیجه یک رشته است " +"که شامل رشته مستند شیء است که به یک اسکریپت پایتون تبدیل شده " +"است، همان‌طور که برای :func:`script_from_examples` در بالا توضیح داده شد. " +"برای مثال، اگر ماژول :file:`a.py` شامل یک تابع سطح بالا :func:`!f` باشد، " +"آنگاه ::" msgid "" "import a, doctest\n" "print(doctest.testsource(a, \"a.f\"))" msgstr "" +"import a, doctest\n" +"print(doctest.testsource(a, \"a.f\"))" -msgid "prints a script version of function :func:`!f`'s docstring, with doctests converted to code, and the rest placed in comments." +msgid "" +"prints a script version of function :func:`!f`'s docstring, with doctests " +"converted to code, and the rest placed in comments." msgstr "" +"نسخه‌ی اسکریپتی رشته‌مستند تابع :func:`!f` را چاپ می‌کند، به‌طوری" +" که doctestها به کد تبدیل شده‌اند و بقیه در کامنت‌ها قرار گرفته‌اند." msgid "Debug the doctests for an object." -msgstr "" +msgstr "doctestهای یک شیء را اشکال‌زدایی کنید." -msgid "The *module* and *name* arguments are the same as for function :func:`testsource` above. The synthesized Python script for the named object's docstring is written to a temporary file, and then that file is run under the control of the Python debugger, :mod:`pdb`." +msgid "" +"The *module* and *name* arguments are the same as for function " +":func:`testsource` above. The synthesized Python script for the named " +"object's docstring is written to a temporary file, and then that file is run" +" under the control of the Python debugger, :mod:`pdb`." msgstr "" +"آرگومان‌های *module* و *name* همان آرگومان‌های تابع :func:`testsource` در " +"بالا هستند. اسکریپت پایتون ساخته‌شده برای رشته‌مستند شیء " +"نام‌برده‌شده، در یک فایل موقت نوشته می‌شود و سپس آن فایل تحت کنترل " +"اشکال‌زدای پایتون، :mod:`pdb`، اجرا می‌شود." -msgid "A shallow copy of ``module.__dict__`` is used for both local and global execution context." +msgid "" +"A shallow copy of ``module.__dict__`` is used for both local and global " +"execution context." msgstr "" +"یک کپی سطحی از ``module.__dict__`` برای هر دو زمینه اجرای محلی و سراسری " +"استفاده می‌شود." -msgid "Optional argument *pm* controls whether post-mortem debugging is used. If *pm* has a true value, the script file is run directly, and the debugger gets involved only if the script terminates via raising an unhandled exception. If it does, then post-mortem debugging is invoked, via :func:`pdb.post_mortem`, passing the traceback object from the unhandled exception. If *pm* is not specified, or is false, the script is run under the debugger from the start, via passing an appropriate :func:`exec` call to :func:`pdb.run`." -msgstr "" +msgid "" +"Optional argument *pm* controls whether post-mortem debugging is used. If " +"*pm* has a true value, the script file is run directly, and the debugger " +"gets involved only if the script terminates via raising an unhandled " +"exception. If it does, then post-mortem debugging is invoked, via " +":func:`pdb.post_mortem`, passing the traceback object from the unhandled " +"exception. If *pm* is not specified, or is false, the script is run under " +"the debugger from the start, via passing an appropriate :func:`exec` call to" +" :func:`pdb.run`." +msgstr "" +"آرگومان اختیاری *pm* تعیین می‌کند که آیا از اشکال‌زدایی پس از خاتمه (post-" +"mortem debugging) استفاده شود یا خیر. اگر *pm* مقدار درست داشته باشد، " +"پرونده‌ی اسکریپت مستقیماً اجرا می‌شود و اشکال‌زدا تنها در صورتی وارد عمل " +"می‌شود که اسکریپت با پرتاب یک استثنای مدیریت‌نشده خاتمه یابد. اگر چنین شود، " +"اشکال‌زدایی پس از خاتمه از طریق :func:`pdb.post_mortem` و با ارسال شیء ردگیری " +"از استثنای مدیریت‌نشده فراخوانی می‌شود. اگر *pm* مشخص نشده باشد یا مقدار " +"نادرست داشته باشد، اسکریپت از همان ابتدا با ارسال یک فراخوانی مناسب از " +":func:`exec` به :func:`pdb.run`، زیر نظر اشکال‌زدا اجرا می‌شود." msgid "Debug the doctests in a string." -msgstr "" +msgstr "doctestها را در یک رشته اشکال‌زدایی کنید." -msgid "This is like function :func:`debug` above, except that a string containing doctest examples is specified directly, via the *src* argument." +msgid "" +"This is like function :func:`debug` above, except that a string containing " +"doctest examples is specified directly, via the *src* argument." msgstr "" +"این مانند تابع :func:`debug` در بالا است، با این تفاوت که یک رشته حاوی " +"نمونه‌های doctest مستقیماً از طریق آرگومان *src* مشخص می‌شود." -msgid "Optional argument *pm* has the same meaning as in function :func:`debug` above." +msgid "" +"Optional argument *pm* has the same meaning as in function :func:`debug` " +"above." msgstr "" +"آرگومان اختیاری *pm* همان معنایی را دارد که در تابع :func:`debug` در بالا " +"آمده است." -msgid "Optional argument *globs* gives a dictionary to use as both local and global execution context. If not specified, or ``None``, an empty dictionary is used. If specified, a shallow copy of the dictionary is used." +msgid "" +"Optional argument *globs* gives a dictionary to use as both local and global" +" execution context. If not specified, or ``None``, an empty dictionary is " +"used. If specified, a shallow copy of the dictionary is used." msgstr "" +"آرگومان اختیاری *globs* یک دیکشنری را برای استفاده به‌عنوان زمینه‌ی اجرای " +"محلی و سراسری فراهم می‌کند. اگر مشخص نشده باشد، یا ``None`` باشد، از یک " +"دیکشنری خالی استفاده می‌شود. اگر مشخص شده باشد، از یک کپی کم‌عمق از دیکشنری " +"استفاده می‌شود." -msgid "The :class:`DebugRunner` class, and the special exceptions it may raise, are of most interest to testing framework authors, and will only be sketched here. See the source code, and especially :class:`DebugRunner`'s docstring (which is a doctest!) for more details:" +msgid "" +"The :class:`DebugRunner` class, and the special exceptions it may raise, are" +" of most interest to testing framework authors, and will only be sketched " +"here. See the source code, and especially :class:`DebugRunner`'s docstring " +"(which is a doctest!) for more details:" msgstr "" +"کلاس :class:`DebugRunner` و استثناهای ویژه‌ای که ممکن است پرتاب کند، بیشتر " +"مورد توجه نویسندگان چارچوب‌های آزمون هستند و در اینجا تنها به‌طور خلاصه شرح " +"داده می‌شوند. برای جزئیات بیشتر، کد منبع و به‌ویژه رشته‌مستند " +":class:`DebugRunner` (که یک doctest است!) را ببینید:" -msgid "A subclass of :class:`DocTestRunner` that raises an exception as soon as a failure is encountered. If an unexpected exception occurs, an :exc:`UnexpectedException` exception is raised, containing the test, the example, and the original exception. If the output doesn't match, then a :exc:`DocTestFailure` exception is raised, containing the test, the example, and the actual output." -msgstr "" +msgid "" +"A subclass of :class:`DocTestRunner` that raises an exception as soon as a " +"failure is encountered. If an unexpected exception occurs, an " +":exc:`UnexpectedException` exception is raised, containing the test, the " +"example, and the original exception. If the output doesn't match, then a " +":exc:`DocTestFailure` exception is raised, containing the test, the example," +" and the actual output." +msgstr "" +"زیرکلاسی از :class:`DocTestRunner` که به محض مواجهه با یک شکست، یک استثنا " +"پرتاب می‌کند. اگر یک استثنای غیرمنتظره رخ دهد، یک استثنای " +":exc:`UnexpectedException` پرتاب می‌شود که شامل آزمون، مثال و استثنای اصلی " +"است. اگر خروجی مطابقت نداشته باشد، یک استثنای :exc:`DocTestFailure` پرتاب " +"می‌شود که شامل آزمون، مثال و خروجی واقعی است." -msgid "For information about the constructor parameters and methods, see the documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-api`." +msgid "" +"For information about the constructor parameters and methods, see the " +"documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" +"api`." msgstr "" +"برای اطلاعات در مورد پارامترهای سازنده و متدها، مستندات " +":class:`DocTestRunner` را در بخش :ref:`doctest-advanced-api` ببینید." -msgid "There are two exceptions that may be raised by :class:`DebugRunner` instances:" +msgid "" +"There are two exceptions that may be raised by :class:`DebugRunner` " +"instances:" msgstr "" +"دو استثنا وجود دارد که ممکن است توسط نمونه‌های :class:`DebugRunner` پرتاب " +"شوند:" -msgid "An exception raised by :class:`DocTestRunner` to signal that a doctest example's actual output did not match its expected output. The constructor arguments are used to initialize the attributes of the same names." +msgid "" +"An exception raised by :class:`DocTestRunner` to signal that a doctest " +"example's actual output did not match its expected output. The constructor " +"arguments are used to initialize the attributes of the same names." msgstr "" +"استثنایی که :class:`DocTestRunner` آن را پرتاب می‌کند تا نشان دهد خروجی " +"واقعی یک مثال doctest با خروجی مورد انتظار آن مطابقت ندارد. آرگومان‌های " +"سازنده برای مقداردهی اولیه‌ی ویژگی‌هایی با همان نام‌ها استفاده می‌شوند." msgid ":exc:`DocTestFailure` defines the following attributes:" -msgstr "" +msgstr ":exc:`DocTestFailure` ویژگی‌های زیر را تعریف می‌کند:" -msgid "The :class:`DocTest` object that was being run when the example failed." -msgstr "" +msgid "" +"The :class:`DocTest` object that was being run when the example failed." +msgstr "شیء :class:`DocTest` که در زمان شکست خوردن مثال در حال اجرا بود." msgid "The :class:`Example` that failed." -msgstr "" +msgstr ":class:`Example` که شکست خورد." msgid "The example's actual output." -msgstr "" +msgstr "خروجی واقعی مثال." -msgid "An exception raised by :class:`DocTestRunner` to signal that a doctest example raised an unexpected exception. The constructor arguments are used to initialize the attributes of the same names." +msgid "" +"An exception raised by :class:`DocTestRunner` to signal that a doctest " +"example raised an unexpected exception. The constructor arguments are used " +"to initialize the attributes of the same names." msgstr "" +"استثنایی که توسط :class:`DocTestRunner` پرتاب می‌شود تا نشان دهد که یک مثال " +"doctest استثنای غیرمنتظره‌ای را پرتاب کرده است. آرگومان‌های سازنده برای " +"مقداردهی اولیه‌ی ویژگی‌هایی با همان نام‌ها استفاده می‌شوند." msgid ":exc:`UnexpectedException` defines the following attributes:" -msgstr "" +msgstr ":exc:`UnexpectedException` ویژگی‌های زیر را تعریف می‌کند:" -msgid "A tuple containing information about the unexpected exception, as returned by :func:`sys.exc_info`." +msgid "" +"A tuple containing information about the unexpected exception, as returned " +"by :func:`sys.exc_info`." msgstr "" +"یک تاپل حاوی اطلاعات درباره استثنای غیرمنتظره، همان‌طور که توسط " +":func:`sys.exc_info` برگردانده می‌شود." msgid "Soapbox" -msgstr "" +msgstr "تریبون" -msgid "As mentioned in the introduction, :mod:`!doctest` has grown to have three primary uses:" +msgid "" +"As mentioned in the introduction, :mod:`!doctest` has grown to have three " +"primary uses:" msgstr "" +"همان‌طور که در مقدمه ذکر شد، :mod:`!doctest` گسترش یافته است تا سه کاربرد " +"اصلی داشته باشد:" msgid "Checking examples in docstrings." -msgstr "" +msgstr "بررسی مثال‌ها در رشته مستندات." msgid "Regression testing." -msgstr "" +msgstr "آزمون بازگشتی." msgid "Executable documentation / literate testing." -msgstr "" +msgstr "مستندات قابل‌اجرا / آزمون‌نویسی ادبی." -msgid "These uses have different requirements, and it is important to distinguish them. In particular, filling your docstrings with obscure test cases makes for bad documentation." +msgid "" +"These uses have different requirements, and it is important to distinguish " +"them. In particular, filling your docstrings with obscure test cases makes " +"for bad documentation." msgstr "" +"این کاربردها نیازمندی‌های متفاوتی دارند و مهم است که میان آن‌ها تمایز قائل " +"شوید. به‌ویژه، پر کردن رشته مستنداتاتتان با موارد آزمون مبهم، باعث ایجاد " +"مستندات بد می‌شود." -msgid "When writing a docstring, choose docstring examples with care. There's an art to this that needs to be learned---it may not be natural at first. Examples should add genuine value to the documentation. A good example can often be worth many words. If done with care, the examples will be invaluable for your users, and will pay back the time it takes to collect them many times over as the years go by and things change. I'm still amazed at how often one of my :mod:`!doctest` examples stops working after a \"harmless\" change." -msgstr "" +msgid "" +"When writing a docstring, choose docstring examples with care. There's an " +"art to this that needs to be learned---it may not be natural at first. " +"Examples should add genuine value to the documentation. A good example can " +"often be worth many words. If done with care, the examples will be " +"invaluable for your users, and will pay back the time it takes to collect " +"them many times over as the years go by and things change. I'm still amazed" +" at how often one of my :mod:`!doctest` examples stops working after a " +"\"harmless\" change." +msgstr "" +"هنگام نوشتن یک رشته‌ی مستندسازی رشته مستند، مثال‌های آن را با دقت انتخاب " +"کنید. این کار ظرافتی دارد که باید آموخته شود — ممکن است در ابتدا برایتان " +"طبیعی نباشد. مثال‌ها باید ارزش واقعی به مستندات بیفزایند. یک مثال خوب اغلب " +"می‌تواند ارزشی برابر با کلمات بسیاری داشته باشد. اگر با دقت تهیه شوند، " +"مثال‌ها برای کاربران شما بی‌نهایت ارزشمند خواهند بود و با گذشت سال‌ها و " +"تغییر شرایط، زمانی را که صرف گردآوری آن‌ها شده است، چندین برابر جبران خواهند" +" کرد. هنوز هم از تعداد دفعاتی که یکی از مثال‌های :mod:`!doctest` من پس از یک" +" تغییر «بی‌خطر» از کار می‌افتد، شگفت‌زده می‌شوم." -msgid "Doctest also makes an excellent tool for regression testing, especially if you don't skimp on explanatory text. By interleaving prose and examples, it becomes much easier to keep track of what's actually being tested, and why. When a test fails, good prose can make it much easier to figure out what the problem is, and how it should be fixed. It's true that you could write extensive comments in code-based testing, but few programmers do. Many have found that using doctest approaches instead leads to much clearer tests. Perhaps this is simply because doctest makes writing prose a little easier than writing code, while writing comments in code is a little harder. I think it goes deeper than just that: the natural attitude when writing a doctest-based test is that you want to explain the fine points of your software, and illustrate them with examples. This in turn naturally leads to test files that start with the simplest features, and logically progress to complications and edge cases. A coherent narrative is the result, instead of a collection of isolated functions that test isolated bits of functionality seemingly at random. It's a different attitude, and produces different results, blurring the distinction between testing and explaining." -msgstr "" +msgid "" +"Doctest also makes an excellent tool for regression testing, especially if " +"you don't skimp on explanatory text. By interleaving prose and examples, it" +" becomes much easier to keep track of what's actually being tested, and why." +" When a test fails, good prose can make it much easier to figure out what " +"the problem is, and how it should be fixed. It's true that you could write " +"extensive comments in code-based testing, but few programmers do. Many have " +"found that using doctest approaches instead leads to much clearer tests. " +"Perhaps this is simply because doctest makes writing prose a little easier " +"than writing code, while writing comments in code is a little harder. I " +"think it goes deeper than just that: the natural attitude when writing a " +"doctest-based test is that you want to explain the fine points of your " +"software, and illustrate them with examples. This in turn naturally leads to" +" test files that start with the simplest features, and logically progress to" +" complications and edge cases. A coherent narrative is the result, instead " +"of a collection of isolated functions that test isolated bits of " +"functionality seemingly at random. It's a different attitude, and produces " +"different results, blurring the distinction between testing and explaining." +msgstr "" +"Doctest همچنین ابزار عالی برای آزمون بازگشتی است، به‌ویژه اگر در متن توضیحی " +"کم‌کاری نکنید. با درهم‌آمیختن متن و مثال‌ها، پیگیری اینکه چه چیزی واقعاً " +"آزمون می‌شود و چرا، بسیار آسان‌تر می‌شود. هنگامی که یک آزمون شکست می‌خورد، " +"متن خوب می‌تواند تشخیص مشکل و چگونگی اصلاح آن را بسیار آسان‌تر کند. درست است" +" که می‌توانید کامنت‌ها مفصلی در آزمون مبتنی بر کد بنویسید، اما برنامه‌نویسان " +"کمی این کار را انجام می‌دهند. بسیاری دریافته‌اند که در عوض، استفاده از " +"رویکردهای doctest به آزمون‌های بسیار واضح‌تری منجر می‌شود. شاید این صرفاً به" +" این دلیل باشد که doctest نوشتن متن را کمی آسان‌تر از نوشتن کد می‌کند، در " +"حالی که نوشتن کامنت در کد کمی سخت‌تر است. به نظر من، موضوع عمیق‌تر از این " +"است: نگرش طبیعی هنگام نوشتن آزمون مبتنی بر doctest این است که می‌خواهید نکات" +" دقیق نرم‌افزار خود را توضیح دهید و آن‌ها را با مثال‌ها نشان دهید. این امر " +"به‌نوبه خود به‌طور طبیعی به فایل‌های آزمون منجر می‌شود که با ساده‌ترین " +"قابلیت‌ها شروع می‌شوند و به‌صورت منطقی به سمت پیچیدگی‌ها و حالت‌های مرزی پیش" +" می‌روند. نتیجه یک روایت منسجم است، نه مجموعه‌ای از توابع جداگانه که بخش‌های" +" جداگانه‌ای از قابلیت‌ها را گویا به‌صورت تصادفی آزمون می‌کنند. این نگرشی " +"متفاوت است و نتایج متفاوتی به وجود می‌آورد و تمایز میان آزمون و توضیح را " +"کم‌رنگ می‌کند." -msgid "Regression testing is best confined to dedicated objects or files. There are several options for organizing tests:" +msgid "" +"Regression testing is best confined to dedicated objects or files. There " +"are several options for organizing tests:" msgstr "" +"بهتر است آزمون پسرفت (regression testing) به اشیاء یا فایل‌های اختصاصی محدود" +" شود. گزینه‌های متعددی برای سازمان‌دهی آزمون‌ها وجود دارد:" -msgid "Write text files containing test cases as interactive examples, and test the files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, although is easiest to do for new projects, designed from the start to use doctest." +msgid "" +"Write text files containing test cases as interactive examples, and test the" +" files using :func:`testfile` or :func:`DocFileSuite`. This is recommended," +" although is easiest to do for new projects, designed from the start to use " +"doctest." msgstr "" +"فایل‌های متنی حاوی موارد آزمون را به‌صورت مثال‌های تعاملی بنویسید و این " +"فایل‌ها را با استفاده از :func:`testfile` یا :func:`DocFileSuite` آزمایش " +"کنید. این روش توصیه می‌شود، هرچند انجام آن برای پروژه‌های جدیدی که از ابتدا " +"برای استفاده از doctest طراحی شده‌اند، آسان‌تر است." -msgid "Define functions named ``_regrtest_topic`` that consist of single docstrings, containing test cases for the named topics. These functions can be included in the same file as the module, or separated out into a separate test file." +msgid "" +"Define functions named ``_regrtest_topic`` that consist of single " +"docstrings, containing test cases for the named topics. These functions can" +" be included in the same file as the module, or separated out into a " +"separate test file." msgstr "" +"تابع‌هایی به نام ``_regrtest_topic`` تعریف کنید که هر کدام تنها از یک " +"رشته‌مستند حاوی موارد آزمون برای موضوعات نام‌برده تشکیل شده‌اند." +" این تابع‌ها می‌توانند در همان فایل ماژول گنجانده شوند، یا در یک فایل آزمون " +"جداگانه قرار گیرند." -msgid "Define a :attr:`~module.__test__` dictionary mapping from regression test topics to docstrings containing test cases." +msgid "" +"Define a :attr:`~module.__test__` dictionary mapping from regression test " +"topics to docstrings containing test cases." msgstr "" +"یک دیکشنری :attr:`~module.__test__` تعریف کنید که موضوعات آزمون پسرفت را به " +"رشته مستندات‌های حاوی موارد آزمون نگاشت می‌کند." -msgid "When you have placed your tests in a module, the module can itself be the test runner. When a test fails, you can arrange for your test runner to re-run only the failing doctest while you debug the problem. Here is a minimal example of such a test runner::" +msgid "" +"When you have placed your tests in a module, the module can itself be the " +"test runner. When a test fails, you can arrange for your test runner to re-" +"run only the failing doctest while you debug the problem. Here is a minimal" +" example of such a test runner::" msgstr "" +"هنگامی که آزمون‌های خود را در یک ماژول قرار داده باشید، خود ماژول می‌تواند " +"اجراکننده آزمون باشد. هنگامی که یک آزمون شکست می‌خورد، می‌توانید اجراکننده آزمون " +"خود را به‌گونه‌ای تنظیم کنید که در حین اشکال‌زدایی مشکل، فقط doctest " +"شکست‌خورده را دوباره اجرا کند. در اینجا یک مثال کمینه از چنین اجراکننده آزمونی" +" آمده است::" msgid "" "if __name__ == '__main__':\n" @@ -1428,39 +3435,59 @@ msgid "" " fail, total = doctest.testmod(optionflags=flags)\n" " print(f\"{fail} failures out of {total} tests\")" msgstr "" +"if __name__ == '__main__':\n" +" import doctest\n" +" flags = doctest.REPORT_NDIFF|doctest.FAIL_FAST\n" +" if len(sys.argv) > 1:\n" +" name = sys.argv[1]\n" +" if name in globals():\n" +" obj = globals()[name]\n" +" else:\n" +" obj = __test__[name]\n" +" doctest.run_docstring_examples(obj, globals(), name=name,\n" +" optionflags=flags)\n" +" else:\n" +" fail, total = doctest.testmod(optionflags=flags)\n" +" print(f\"{fail} failures out of {total} tests\")" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Examples containing both expected output and an exception are not supported. Trying to guess where one ends and the other begins is too error-prone, and that also makes for a confusing test." +msgid "" +"Examples containing both expected output and an exception are not supported." +" Trying to guess where one ends and the other begins is too error-prone, and" +" that also makes for a confusing test." msgstr "" +"مثال‌هایی که شامل هر دو خروجی مورد انتظار و یک استثنا باشند، پشتیبانی " +"نمی‌شوند. تلاش برای حدس زدن اینکه یکی کجا تمام می‌شود و دیگری آغاز می‌شود، " +"بسیار مستعد خطا است و این موضوع همچنین باعث ایجاد یک آزمون گیج‌کننده می‌شود." msgid ">>>" -msgstr "" +msgstr ">>>" msgid "interpreter prompt" -msgstr "" +msgstr "اعلان مفسر" msgid "..." -msgstr "" +msgstr "..." msgid "^ (caret)" -msgstr "" +msgstr "^ (کارت)" msgid "marker" -msgstr "" +msgstr "نشانگر" msgid "" -msgstr "" +msgstr "" msgid "in doctests" -msgstr "" +msgstr "در doctestها" msgid "# (hash)" -msgstr "" +msgstr "# (هش)" msgid "+ (plus)" -msgstr "" +msgstr "+ (مثبت)" msgid "- (minus)" -msgstr "" +msgstr "- (منها)" diff --git a/library/email.charset.po b/library/email.charset.po index 8158c99ac..c968d6847 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -24,133 +24,330 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.charset`: Representing character sets" -msgstr "" +msgstr ":mod:`!email.charset`: بازنمایی مجموعه‌های نویسه‌ای" msgid "**Source code:** :source:`Lib/email/charset.py`" -msgstr "" +msgstr ":source:`Lib/email/charset.py`" -msgid "This module is part of the legacy (``Compat32``) email API. In the new API only the aliases table is used." +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the new API " +"only the aliases table is used." msgstr "" +"این ماژول بخشی از API ایمیل قدیمی (``Compat32``) است. در API جدید، فقط از " +"جدول نام‌های مستعار استفاده می‌شود." -msgid "The remaining text in this section is the original documentation of the module." -msgstr "" +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "متن باقی‌مانده در این بخش، مستندات اصلی ماژول است." -msgid "This module provides a class :class:`Charset` for representing character sets and character set conversions in email messages, as well as a character set registry and several convenience methods for manipulating this registry. Instances of :class:`Charset` are used in several other modules within the :mod:`email` package." +msgid "" +"This module provides a class :class:`Charset` for representing character " +"sets and character set conversions in email messages, as well as a character" +" set registry and several convenience methods for manipulating this " +"registry. Instances of :class:`Charset` are used in several other modules " +"within the :mod:`email` package." msgstr "" +"این ماژول یک کلاس :class:`Charset` برای بازنمایی مجموعه‌نویسه‌ها و تبدیل‌های" +" مجموعه‌نویسه‌ها در پیام‌های ایمیل، و همچنین یک رجیستری مجموعه‌نویسه‌ها و " +"چند متد کمکی برای دستکاری این رجیستری فراهم می‌کند. نمونه‌های " +":class:`Charset` در چند ماژول دیگر درون بسته :mod:`email` استفاده می‌شوند." msgid "Import this class from the :mod:`!email.charset` module." -msgstr "" +msgstr "این کلاس را از ماژول :mod:`!email.charset` ایمپورت کنید." msgid "Map character sets to their email properties." -msgstr "" +msgstr "مجموعه‌نویسه‌ها را به ویژگی‌های ایمیلی آن‌ها نگاشت می‌کند." -msgid "This class provides information about the requirements imposed on email for a specific character set. It also provides convenience routines for converting between character sets, given the availability of the applicable codecs. Given a character set, it will do its best to provide information on how to use that character set in an email message in an RFC-compliant way." -msgstr "" +msgid "" +"This class provides information about the requirements imposed on email for " +"a specific character set. It also provides convenience routines for " +"converting between character sets, given the availability of the applicable " +"codecs. Given a character set, it will do its best to provide information " +"on how to use that character set in an email message in an RFC-compliant " +"way." +msgstr "" +"این کلاس اطلاعاتی درباره الزامات تحمیل‌شده بر ایمیل برای یک مجموعه‌نویسه خاص" +" ارائه می‌دهد. همچنین روال‌های آسان‌کننده‌ای برای تبدیل بین مجموعه‌نویسه‌ها،" +" با توجه به دسترس‌پذیری کدک‌های مربوطه، ارائه می‌دهد. با داشتن یک " +"مجموعه‌نویسه، این کلاس نهایت تلاش خود را می‌کند تا اطلاعاتی درباره نحوه " +"استفاده از آن مجموعه‌نویسه در یک پیام ایمیل به شیوه‌ای منطبق با RFC ارائه " +"دهد." -msgid "Certain character sets must be encoded with quoted-printable or base64 when used in email headers or bodies. Certain character sets must be converted outright, and are not allowed in email." +msgid "" +"Certain character sets must be encoded with quoted-printable or base64 when " +"used in email headers or bodies. Certain character sets must be converted " +"outright, and are not allowed in email." msgstr "" +"برخی مجموعه‌های نویسه باید هنگام استفاده در سرآیندها یا بدنه‌های ایمیل با " +"quoted-printable یا base64 کدگذاری شوند. برخی مجموعه‌های نویسه باید به‌طور " +"کامل تبدیل شوند و در ایمیل مجاز نیستند." -msgid "Optional *input_charset* is as described below; it is always coerced to lower case. After being alias normalized it is also used as a lookup into the registry of character sets to find out the header encoding, body encoding, and output conversion codec to be used for the character set. For example, if *input_charset* is ``iso-8859-1``, then headers and bodies will be encoded using quoted-printable and no output conversion codec is necessary. If *input_charset* is ``euc-jp``, then headers will be encoded with base64, bodies will not be encoded, but output text will be converted from the ``euc-jp`` character set to the ``iso-2022-jp`` character set." -msgstr "" +msgid "" +"Optional *input_charset* is as described below; it is always coerced to " +"lower case. After being alias normalized it is also used as a lookup into " +"the registry of character sets to find out the header encoding, body " +"encoding, and output conversion codec to be used for the character set. For" +" example, if *input_charset* is ``iso-8859-1``, then headers and bodies will" +" be encoded using quoted-printable and no output conversion codec is " +"necessary. If *input_charset* is ``euc-jp``, then headers will be encoded " +"with base64, bodies will not be encoded, but output text will be converted " +"from the ``euc-jp`` character set to the ``iso-2022-jp`` character set." +msgstr "" +"*input_charset* اختیاری همان‌گونه است که در ادامه توضیح داده شده است؛ این " +"مقدار همیشه به حروف کوچک تبدیل می‌شود. پس از نرمال‌سازی نام مستعار، از آن " +"برای جست‌وجو در فهرست ثبت مجموعه‌های نویسه‌ای نیز استفاده می‌شود تا کدگذاری " +"سرآیند، کدگذاری بدنه و کدک تبدیل خروجی مورد استفاده برای آن مجموعه نویسه‌ای " +"مشخص شود. برای مثال، اگر *input_charset* برابر ``iso-8859-1`` باشد، سرآیندها" +" و بدنه‌ها با استفاده از quoted-printable کدگذاری می‌شوند و نیازی به کدک " +"تبدیل خروجی نیست. اگر *input_charset* برابر ``euc-jp`` باشد، سرآیندها با " +"base64 کدگذاری می‌شوند، بدنه‌ها کدگذاری نمی‌شوند، اما متن خروجی از مجموعه " +"نویسه‌ای ``euc-jp`` به مجموعه نویسه‌ای ``iso-2022-jp`` تبدیل می‌شود." msgid ":class:`Charset` instances have the following data attributes:" -msgstr "" +msgstr "نمونه‌های :class:`Charset` دارای ویژگی‌های داده‌ای زیر هستند:" -msgid "The initial character set specified. Common aliases are converted to their *official* email names (e.g. ``latin_1`` is converted to ``iso-8859-1``). Defaults to 7-bit ``us-ascii``." +msgid "" +"The initial character set specified. Common aliases are converted to their " +"*official* email names (e.g. ``latin_1`` is converted to ``iso-8859-1``). " +"Defaults to 7-bit ``us-ascii``." msgstr "" +"مجموعه نویسه‌ی اولیه‌ی مشخص‌شده. نام‌های مستعار رایج به نام‌های ایمیلی *رسمی* " +"خود تبدیل می‌شوند (برای مثال ``latin_1`` به ``iso-8859-1`` تبدیل می‌شود). " +"مقدار پیش‌فرض آن ``us-ascii`` ۷ بیتی است." -msgid "If the character set must be encoded before it can be used in an email header, this attribute will be set to ``charset.QP`` (for quoted-printable), ``charset.BASE64`` (for base64 encoding), or ``charset.SHORTEST`` for the shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." +msgid "" +"If the character set must be encoded before it can be used in an email " +"header, this attribute will be set to ``charset.QP`` (for quoted-printable)," +" ``charset.BASE64`` (for base64 encoding), or ``charset.SHORTEST`` for the " +"shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." msgstr "" +"اگر لازم باشد مجموعه نویسه‌ها پیش از استفاده در سرآیند ایمیل کدگذاری شود، " +"این ویژگی روی ``charset.QP`` (برای quoted-printable)، ``charset.BASE64`` " +"(برای کدگذاری base64) یا ``charset.SHORTEST`` برای کوتاه‌ترین حالت بین " +"کدگذاری QP و BASE64 تنظیم می‌شود. در غیر این صورت، ``None`` خواهد بود." -msgid "Same as *header_encoding*, but describes the encoding for the mail message's body, which indeed may be different than the header encoding. ``charset.SHORTEST`` is not allowed for *body_encoding*." +msgid "" +"Same as *header_encoding*, but describes the encoding for the mail message's" +" body, which indeed may be different than the header encoding. " +"``charset.SHORTEST`` is not allowed for *body_encoding*." msgstr "" +"مشابه *header_encoding*، اما کدگذاری بدنه‌ی پیام ایمیل را توصیف می‌کند، که " +"در واقع ممکن است با کدگذاری سرآیند متفاوت باشد. ``charset.SHORTEST`` برای " +"*body_encoding* مجاز نیست." -msgid "Some character sets must be converted before they can be used in email headers or bodies. If the *input_charset* is one of them, this attribute will contain the name of the character set output will be converted to. Otherwise, it will be ``None``." +msgid "" +"Some character sets must be converted before they can be used in email " +"headers or bodies. If the *input_charset* is one of them, this attribute " +"will contain the name of the character set output will be converted to. " +"Otherwise, it will be ``None``." msgstr "" +"برخی مجموعه‌نویسه‌ها باید پیش از استفاده در سرآیندها یا بدنه‌های ایمیل تبدیل" +" شوند. اگر *input_charset* یکی از آن‌ها باشد، این ویژگی شامل نام " +"مجموعه‌نویسه‌ای خواهد بود که خروجی به آن تبدیل می‌شود. در غیر این صورت، " +"``None`` خواهد بود." -msgid "The name of the Python codec used to convert the *input_charset* to Unicode. If no conversion codec is necessary, this attribute will be ``None``." +msgid "" +"The name of the Python codec used to convert the *input_charset* to Unicode." +" If no conversion codec is necessary, this attribute will be ``None``." msgstr "" +"نام کدک پایتون استفاده‌شده برای تبدیل *input_charset* به یونیکد. اگر نیازی " +"به کدک تبدیل نباشد، این ویژگی ``None`` خواهد بود." -msgid "The name of the Python codec used to convert Unicode to the *output_charset*. If no conversion codec is necessary, this attribute will have the same value as the *input_codec*." +msgid "" +"The name of the Python codec used to convert Unicode to the " +"*output_charset*. If no conversion codec is necessary, this attribute will " +"have the same value as the *input_codec*." msgstr "" +"نام کدک پایتون که برای تبدیل یونیکد به *output_charset* استفاده می‌شود. اگر " +"به کدک تبدیل نیازی نباشد، این ویژگی همان مقدار *input_codec* را خواهد داشت." msgid ":class:`Charset` instances also have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`Charset` همچنین دارای متدهای زیر هستند:" msgid "Return the content transfer encoding used for body encoding." msgstr "" +"کدگذاری انتقال محتوا را که برای کدگذاری بدنه استفاده می‌شود، برمی‌گرداند." -msgid "This is either the string ``quoted-printable`` or ``base64`` depending on the encoding used, or it is a function, in which case you should call the function with a single argument, the Message object being encoded. The function should then set the :mailheader:`Content-Transfer-Encoding` header itself to whatever is appropriate." -msgstr "" +msgid "" +"This is either the string ``quoted-printable`` or ``base64`` depending on " +"the encoding used, or it is a function, in which case you should call the " +"function with a single argument, the Message object being encoded. The " +"function should then set the :mailheader:`Content-Transfer-Encoding` header " +"itself to whatever is appropriate." +msgstr "" +"این مقدار بسته به کدگذاری استفاده‌شده، یا رشته ``quoted-printable`` است یا " +"``base64``، یا یک تابع است؛ در این صورت باید تابع را با یک آرگومان فراخوانی " +"کنید: شیء Message که کدگذاری می‌شود. سپس تابع باید خودش سرآیند " +":mailheader:`Content-Transfer-Encoding` را روی هر مقداری که مناسب است تنظیم " +"کند." -msgid "Returns the string ``quoted-printable`` if *body_encoding* is ``QP``, returns the string ``base64`` if *body_encoding* is ``BASE64``, and returns the string ``7bit`` otherwise." +msgid "" +"Returns the string ``quoted-printable`` if *body_encoding* is ``QP``, " +"returns the string ``base64`` if *body_encoding* is ``BASE64``, and returns " +"the string ``7bit`` otherwise." msgstr "" +"اگر *body_encoding* ``QP`` باشد، رشته ``quoted-printable`` را برمی‌گرداند، " +"اگر *body_encoding* ``BASE64`` باشد، رشته ``base64`` را برمی‌گرداند، و در " +"غیر این صورت رشته ``7bit`` را برمی‌گرداند." msgid "Return the output character set." -msgstr "" +msgstr "مجموعه نویسه‌های خروجی را برمی‌گرداند." -msgid "This is the *output_charset* attribute if that is not ``None``, otherwise it is *input_charset*." +msgid "" +"This is the *output_charset* attribute if that is not ``None``, otherwise it" +" is *input_charset*." msgstr "" +"این ویژگی *output_charset* است اگر آن ``None`` نباشد، در غیر این صورت " +"*input_charset* است." msgid "Header-encode the string *string*." -msgstr "" +msgstr "رشته‌ی *string* را به‌صورت سرآیند کدگذاری کنید." -msgid "The type of encoding (base64 or quoted-printable) will be based on the *header_encoding* attribute." +msgid "" +"The type of encoding (base64 or quoted-printable) will be based on the " +"*header_encoding* attribute." msgstr "" +"نوع کدگذاری (base64 یا quoted-printable) بر اساس ویژگی *header_encoding* " +"خواهد بود." msgid "Header-encode a *string* by converting it first to bytes." msgstr "" +"یک *رشته* را با تبدیل آن به بایت‌ها در ابتدا، کدگذاری سرآیند (Header-encode) " +"کنید." -msgid "This is similar to :meth:`header_encode` except that the string is fit into maximum line lengths as given by the argument *maxlengths*, which must be an iterator: each element returned from this iterator will provide the next maximum line length." +msgid "" +"This is similar to :meth:`header_encode` except that the string is fit into " +"maximum line lengths as given by the argument *maxlengths*, which must be an" +" iterator: each element returned from this iterator will provide the next " +"maximum line length." msgstr "" +"این مشابه :meth:`header_encode` است، با این تفاوت که رشته در حداکثر طول‌های " +"خط داده‌شده توسط آرگومان *maxlengths*، که باید یک پیمایش‌گر (iterator) " +"باشد، جای داده می‌شود: هر عنصری که از این پیمایش‌گر بازگردانده شود، حداکثر " +"طول خط بعدی را فراهم می‌کند." msgid "Body-encode the string *string*." -msgstr "" +msgstr "رشته‌ی *string* را کدگذاری بدنه کنید." -msgid "The type of encoding (base64 or quoted-printable) will be based on the *body_encoding* attribute." +msgid "" +"The type of encoding (base64 or quoted-printable) will be based on the " +"*body_encoding* attribute." msgstr "" +"نوع کدگذاری (base64 یا quoted-printable) بر اساس ویژگی *body_encoding* خواهد" +" بود." -msgid "The :class:`Charset` class also provides a number of methods to support standard operations and built-in functions." +msgid "" +"The :class:`Charset` class also provides a number of methods to support " +"standard operations and built-in functions." msgstr "" +"کلاس :class:`Charset` همچنین تعدادی متد برای پشتیبانی از عملیات استاندارد و " +"توابع توکار فراهم می‌کند." -msgid "Returns *input_charset* as a string coerced to lower case. :meth:`!__repr__` is an alias for :meth:`!__str__`." +msgid "" +"Returns *input_charset* as a string coerced to lower case. :meth:`!__repr__`" +" is an alias for :meth:`!__str__`." msgstr "" +"*input_charset* را به‌صورت رشته‌ای که به حروف کوچک تبدیل‌شده است " +"برمی‌گرداند. :meth:`!__repr__` نام مستعاری برای :meth:`!__str__` است." -msgid "This method allows you to compare two :class:`Charset` instances for equality." +msgid "" +"This method allows you to compare two :class:`Charset` instances for " +"equality." msgstr "" +"این متد به شما امکان می‌دهد دو نمونه از :class:`Charset` را از نظر برابری " +"مقایسه کنید." -msgid "This method allows you to compare two :class:`Charset` instances for inequality." +msgid "" +"This method allows you to compare two :class:`Charset` instances for " +"inequality." msgstr "" +"این متد به شما امکان می‌دهد دو نمونه از :class:`Charset` را از نظر نابرابری " +"مقایسه کنید." -msgid "The :mod:`!email.charset` module also provides the following functions for adding new entries to the global character set, alias, and codec registries:" +msgid "" +"The :mod:`!email.charset` module also provides the following functions for " +"adding new entries to the global character set, alias, and codec registries:" msgstr "" +"ماژول :mod:`!email.charset` همچنین توابع زیر را برای افزودن ورودی‌های جدید " +"به رجیستری‌های سراسری مجموعه‌نویسه، نام مستعار و کدک فراهم می‌کند:" msgid "Add character properties to the global registry." -msgstr "" +msgstr "ویژگی‌های نویسه را به رجیستری سراسری اضافه کنید." -msgid "*charset* is the input character set, and must be the canonical name of a character set." +msgid "" +"*charset* is the input character set, and must be the canonical name of a " +"character set." msgstr "" +"*charset* مجموعه نویسه‌های ورودی است و باید نام کانونیکال یک مجموعه نویسه باشد." -msgid "Optional *header_enc* and *body_enc* is either ``charset.QP`` for quoted-printable, ``charset.BASE64`` for base64 encoding, ``charset.SHORTEST`` for the shortest of quoted-printable or base64 encoding, or ``None`` for no encoding. ``SHORTEST`` is only valid for *header_enc*. The default is ``None`` for no encoding." -msgstr "" +msgid "" +"Optional *header_enc* and *body_enc* is either ``charset.QP`` for quoted-" +"printable, ``charset.BASE64`` for base64 encoding, ``charset.SHORTEST`` for " +"the shortest of quoted-printable or base64 encoding, or ``None`` for no " +"encoding. ``SHORTEST`` is only valid for *header_enc*. The default is " +"``None`` for no encoding." +msgstr "" +"*header_enc* و *body_enc* اختیاری می‌توانند یکی از مقادیر زیر باشند: " +"``charset.QP`` برای کدگذاری quoted-printable، ``charset.BASE64`` برای " +"کدگذاری base64، ``charset.SHORTEST`` برای کوتاه‌ترین حالت از کدگذاری quoted-" +"printable یا base64، یا ``None`` برای بدون کدگذاری. ``SHORTEST`` فقط برای " +"*header_enc* معتبر است. مقدار پیش‌فرض ``None`` برای بدون کدگذاری است." -msgid "Optional *output_charset* is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset when the method :meth:`Charset.convert` is called. The default is to output in the same character set as the input." +msgid "" +"Optional *output_charset* is the character set that the output should be in." +" Conversions will proceed from input charset, to Unicode, to the output " +"charset when the method :meth:`Charset.convert` is called. The default is " +"to output in the same character set as the input." msgstr "" +"*output_charset* اختیاری، مجموعه نویسه‌ای است که خروجی باید با آن باشد. " +"هنگامی که متد :meth:`Charset.convert` فراخوانی می‌شود، تبدیل‌ها از مجموعه " +"نویسه ورودی، به یونیکد و سپس به مجموعه نویسه خروجی انجام می‌شوند. به‌طور " +"پیش‌فرض، خروجی با همان مجموعه نویسه ورودی خواهد بود." -msgid "Both *input_charset* and *output_charset* must have Unicode codec entries in the module's character set-to-codec mapping; use :func:`add_codec` to add codecs the module does not know about. See the :mod:`codecs` module's documentation for more information." +msgid "" +"Both *input_charset* and *output_charset* must have Unicode codec entries in" +" the module's character set-to-codec mapping; use :func:`add_codec` to add " +"codecs the module does not know about. See the :mod:`codecs` module's " +"documentation for more information." msgstr "" +"هر دو *input_charset* و *output_charset* باید دارای مداخل کدک یونیکد در " +"نگاشت مجموعه نویسه به کدک ماژول باشند؛ برای افزودن کدک‌هایی که ماژول آن‌ها " +"را نمی‌شناسد، از :func:`add_codec` استفاده کنید. برای اطلاعات بیشتر، مستندات" +" ماژول :mod:`codecs` را ببینید." -msgid "The global character set registry is kept in the module global dictionary ``CHARSETS``." +msgid "" +"The global character set registry is kept in the module global dictionary " +"``CHARSETS``." msgstr "" +"ثبت سراسری مجموعه نویسه‌ها در دیکشنری سراسری ماژول ``CHARSETS`` نگهداری " +"می‌شود." -msgid "Add a character set alias. *alias* is the alias name, e.g. ``latin-1``. *canonical* is the character set's canonical name, e.g. ``iso-8859-1``." +msgid "" +"Add a character set alias. *alias* is the alias name, e.g. ``latin-1``. " +"*canonical* is the character set's canonical name, e.g. ``iso-8859-1``." msgstr "" +"یک نام مستعار برای مجموعه نویسه اضافه کنید. *alias* نام مستعار است، مثلاً " +"``latin-1``. *canonical* نام کانونیکال مجموعه نویسه است، مثلاً ``iso-8859-1``." -msgid "The global charset alias registry is kept in the module global dictionary ``ALIASES``." +msgid "" +"The global charset alias registry is kept in the module global dictionary " +"``ALIASES``." msgstr "" +"ثبت سراسری نام‌های مستعار مجموعه‌نویسه در دیکشنری سراسری ماژول ``ALIASES`` " +"نگهداری می‌شود." -msgid "Add a codec that map characters in the given character set to and from Unicode." +msgid "" +"Add a codec that map characters in the given character set to and from " +"Unicode." msgstr "" +"یک کدک اضافه کنید که نویسه‌های موجود در مجموعه نویسه داده‌شده را به یونیکد و" +" از یونیکد نگاشت می‌کند." -msgid "*charset* is the canonical name of a character set. *codecname* is the name of a Python codec, as appropriate for the second argument to the :class:`str`'s :meth:`~str.encode` method." +msgid "" +"*charset* is the canonical name of a character set. *codecname* is the name " +"of a Python codec, as appropriate for the second argument to the " +":class:`str`'s :meth:`~str.encode` method." msgstr "" +"*charset* نام کانونیکال مجموعه‌ای از نویسه‌ها است. *codecname* نام یک کدک پایتون " +"است، مناسب برای آرگومان دوم متد :meth:`~str.encode` کلاس :class:`str`." diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index cb869e9a8..a64375681 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -21,44 +21,163 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -msgid ":mod:`email.message.Message`: Representing an email message using the :data:`~email.policy.compat32` API" +msgid "" +":mod:`email.message.Message`: Representing an email message using the " +":data:`~email.policy.compat32` API" msgstr "" +":mod:`email.message.Message`: بازنمایی یک پیام ایمیل با استفاده از API " +":data:`~email.policy.compat32`" -msgid "The :class:`Message` class is very similar to the :class:`~email.message.EmailMessage` class, without the methods added by that class, and with the default behavior of certain other methods being slightly different. We also document here some methods that, while supported by the :class:`~email.message.EmailMessage` class, are not recommended unless you are dealing with legacy code." -msgstr "" +msgid "" +"The :class:`Message` class is very similar to the " +":class:`~email.message.EmailMessage` class, without the methods added by " +"that class, and with the default behavior of certain other methods being " +"slightly different. We also document here some methods that, while " +"supported by the :class:`~email.message.EmailMessage` class, are not " +"recommended unless you are dealing with legacy code." +msgstr "" +"کلاس :class:`Message` بسیار شبیه به کلاس " +":class:`~email.message.EmailMessage` است، با این تفاوت که متدهای اضافه‌شده " +"توسط آن کلاس را ندارد و رفتار پیش‌فرض برخی متدهای دیگر آن اندکی متفاوت است. " +"ما در اینجا برخی متدها را نیز مستند کرده‌ایم که اگرچه توسط کلاس " +":class:`~email.message.EmailMessage` پشتیبانی می‌شوند، توصیه نمی‌شوند مگر " +"اینکه با کد قدیمی سروکار داشته باشید." msgid "The philosophy and structure of the two classes is otherwise the same." -msgstr "" +msgstr "فلسفه و ساختار این دو کلاس، در سایر موارد یکسان است." -msgid "This document describes the behavior under the default (for :class:`Message`) policy :attr:`~email.policy.Compat32`. If you are going to use another policy, you should be using the :class:`~email.message.EmailMessage` class instead." +msgid "" +"This document describes the behavior under the default (for " +":class:`Message`) policy :attr:`~email.policy.Compat32`. If you are going " +"to use another policy, you should be using the " +":class:`~email.message.EmailMessage` class instead." msgstr "" +"این سند رفتار تحت سیاست پیش‌فرض (برای :class:`Message`) یعنی " +":attr:`~email.policy.Compat32` را توصیف می‌کند. اگر قصد استفاده از سیاست " +"دیگری را دارید، باید به‌جای آن از کلاس :class:`~email.message.EmailMessage` " +"استفاده کنید." -msgid "An email message consists of *headers* and a *payload*. Headers must be :rfc:`5322` style names and values, where the field name and value are separated by a colon. The colon is not part of either the field name or the field value. The payload may be a simple text message, or a binary object, or a structured sequence of sub-messages each with their own set of headers and their own payload. The latter type of payload is indicated by the message having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:`message/rfc822`." -msgstr "" +msgid "" +"An email message consists of *headers* and a *payload*. Headers must be " +":rfc:`5322` style names and values, where the field name and value are " +"separated by a colon. The colon is not part of either the field name or the" +" field value. The payload may be a simple text message, or a binary object," +" or a structured sequence of sub-messages each with their own set of headers" +" and their own payload. The latter type of payload is indicated by the " +"message having a MIME type such as :mimetype:`multipart/\\*` or " +":mimetype:`message/rfc822`." +msgstr "" +"یک پیام ایمیل از *سرآیندها* و یک *بار (payload)* تشکیل می‌شود. سرآیندها باید" +" نام‌ها و مقدارهایی به سبک :rfc:`5322` باشند، که در آن نام فیلد و مقدار آن " +"با یک دونقطه از هم جدا می‌شوند. دونقطه بخشی از نام فیلد یا مقدار فیلد نیست. " +"بار ممکن است یک پیام متنی ساده، یا یک شیء دودویی، یا دنباله‌ای ساختاریافته " +"از پیام‌های فرعی باشد که هرکدام مجموعه‌ای از سرآیندها و بار خود را دارند. " +"نوع اخیر بار با این مشخص می‌شود که پیام دارای یک نوع MIME مانند " +":mimetype:`multipart/\\*` یا :mimetype:`message/rfc822` باشد." -msgid "The conceptual model provided by a :class:`Message` object is that of an ordered dictionary of headers with additional methods for accessing both specialized information from the headers, for accessing the payload, for generating a serialized version of the message, and for recursively walking over the object tree. Note that duplicate headers are supported but special methods must be used to access them." -msgstr "" +msgid "" +"The conceptual model provided by a :class:`Message` object is that of an " +"ordered dictionary of headers with additional methods for accessing both " +"specialized information from the headers, for accessing the payload, for " +"generating a serialized version of the message, and for recursively walking " +"over the object tree. Note that duplicate headers are supported but special" +" methods must be used to access them." +msgstr "" +"مدل مفهومی ارائه‌شده توسط یک شیء :class:`Message`، یک دیکشنری مرتب از " +"سرآیندها به همراه متدهای اضافی برای دسترسی به اطلاعات تخصصی از سرآیندها، " +"دسترسی به بار (payload)، تولید یک نسخه سریال‌شده از پیام و پیمایش " +"بازگشتی روی درخت شیء است. توجه داشته باشید که سرآیندهای تکراری پشتیبانی " +"می‌شوند، اما برای دسترسی به آن‌ها باید از متدهای خاصی استفاده شود." -msgid "The :class:`Message` pseudo-dictionary is indexed by the header names, which must be ASCII values. The values of the dictionary are strings that are supposed to contain only ASCII characters; there is some special handling for non-ASCII input, but it doesn't always produce the correct results. Headers are stored and returned in case-preserving form, but field names are matched case-insensitively. There may also be a single envelope header, also known as the *Unix-From* header or the ``From_`` header. The *payload* is either a string or bytes, in the case of simple message objects, or a list of :class:`Message` objects, for MIME container documents (e.g. :mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." -msgstr "" +msgid "" +"The :class:`Message` pseudo-dictionary is indexed by the header names, which" +" must be ASCII values. The values of the dictionary are strings that are " +"supposed to contain only ASCII characters; there is some special handling " +"for non-ASCII input, but it doesn't always produce the correct results. " +"Headers are stored and returned in case-preserving form, but field names are" +" matched case-insensitively. There may also be a single envelope header, " +"also known as the *Unix-From* header or the ``From_`` header. The *payload*" +" is either a string or bytes, in the case of simple message objects, or a " +"list of :class:`Message` objects, for MIME container documents (e.g. " +":mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." +msgstr "" +"شبه‌دیکشنری :class:`Message` با نام سرآیندها اندیس‌دهی می‌شود، که باید مقادیر " +"ASCII باشند. مقادیر این دیکشنری رشته‌هایی هستند که انتظار می‌رود فقط شامل " +"نویسه‌های ASCII باشند؛ برای ورودی غیر ASCII مدیریت ویژه‌ای وجود دارد، اما " +"این مدیریت همیشه نتایج صحیح را تولید نمی‌کند. سرآیندها با حفظ بزرگی و کوچکی " +"حروف ذخیره و برگردانده می‌شوند، اما نام فیلدها بدون حساسیت به بزرگی و کوچکی" +" حروف تطبیق داده می‌شوند. همچنین ممکن است یک سرآیند پاکت (envelope header) واحد" +" وجود داشته باشد، که به آن سرآیند *Unix-From* یا سرآیند ``From_`` نیز گفته می‌شود." +" *بار* (payload) در اشیای پیام ساده، یا یک رشته است یا بایت‌ها، و در اسناد " +"ظرف MIME (مانند :mimetype:`multipart/\\*` و :mimetype:`message/rfc822`) " +"فهرستی از اشیای :class:`Message` است." msgid "Here are the methods of the :class:`Message` class:" -msgstr "" +msgstr "در اینجا متدهای کلاس :class:`Message` آمده است:" -msgid "If *policy* is specified (it must be an instance of a :mod:`~email.policy` class) use the rules it specifies to update and serialize the representation of the message. If *policy* is not set, use the :class:`compat32 ` policy, which maintains backward compatibility with the Python 3.2 version of the email package. For more information see the :mod:`~email.policy` documentation." -msgstr "" +msgid "" +"If *policy* is specified (it must be an instance of a :mod:`~email.policy` " +"class) use the rules it specifies to update and serialize the representation" +" of the message. If *policy* is not set, use the :class:`compat32 " +"` policy, which maintains backward compatibility with" +" the Python 3.2 version of the email package. For more information see the " +":mod:`~email.policy` documentation." +msgstr "" +"اگر *policy* مشخص‌شده باشد (باید نمونه‌ای از یک کلاس :mod:`~email.policy` " +"باشد)، از قواعد مشخص‌شده توسط آن برای به‌روزرسانی و سریال‌سازی بازنمایی پیام" +" استفاده می‌شود. اگر *policy* تنظیم‌نشده باشد، از سیاست :class:`compat32 " +"` استفاده می‌شود که سازگاری با نسخه‌ی بسته‌ی email در " +"پایتون 3.2 را حفظ می‌کند. برای اطلاعات بیشتر، مستندات :mod:`~email.policy` " +"را ببینید." msgid "The *policy* keyword argument was added." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *policy* افزوده شد." -msgid "Return the entire message flattened as a string. When optional *unixfrom* is true, the envelope header is included in the returned string. *unixfrom* defaults to ``False``. For backward compatibility reasons, *maxheaderlen* defaults to ``0``, so if you want a different value you must override it explicitly (the value specified for *max_line_length* in the policy will be ignored by this method). The *policy* argument may be used to override the default policy obtained from the message instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the ``Generator``." -msgstr "" +msgid "" +"Return the entire message flattened as a string. When optional *unixfrom* " +"is true, the envelope header is included in the returned string. *unixfrom* " +"defaults to ``False``. For backward compatibility reasons, *maxheaderlen* " +"defaults to ``0``, so if you want a different value you must override it " +"explicitly (the value specified for *max_line_length* in the policy will be " +"ignored by this method). The *policy* argument may be used to override the " +"default policy obtained from the message instance. This can be used to " +"control some of the formatting produced by the method, since the specified " +"*policy* will be passed to the ``Generator``." +msgstr "" +"کل پیام را به‌صورت یک رشته‌ی تخت‌شده برمی‌گرداند. هرگاه آرگومان اختیاری " +"*unixfrom* درست باشد، سرآیند پاکت در رشته‌ی برگردانده‌شده گنجانده می‌شود. " +"مقدار پیش‌فرض *unixfrom* برابر ``False`` است. به دلایل سازگاری با نسخه‌های " +"پیشین، مقدار پیش‌فرض *maxheaderlen* برابر ``0`` است، بنابراین اگر مقدار " +"دیگری می‌خواهید، باید آن را به‌صراحت بازنویسی کنید (مقدار مشخص‌شده برای " +"*max_line_length* در سیاست توسط این متد نادیده گرفته می‌شود). می‌توان از " +"آرگومان *policy* برای بازنویسی سیاست پیش‌فرض گرفته‌شده از نمونه‌ی پیام " +"استفاده کرد. از آن‌جا که *policy* مشخص‌شده به ``Generator`` ارسال می‌شود، " +"می‌توان از آن برای کنترل برخی از قالب‌بندی‌های تولیدشده توسط این متد استفاده" +" کرد." -msgid "Flattening the message may trigger changes to the :class:`Message` if defaults need to be filled in to complete the transformation to a string (for example, MIME boundaries may be generated or modified)." +msgid "" +"Flattening the message may trigger changes to the :class:`Message` if " +"defaults need to be filled in to complete the transformation to a string " +"(for example, MIME boundaries may be generated or modified)." msgstr "" +"تخت‌سازی پیام (flattening) ممکن است باعث ایجاد تغییراتی در :class:`Message` " +"شود، اگر برای تکمیل تبدیل به رشته نیاز باشد مقادیر پیش‌فرض پر شوند (برای " +"مثال، ممکن است مرزهای MIME تولید یا اصلاح شوند)." -msgid "Note that this method is provided as a convenience and may not always format the message the way you want. For example, by default it does not do the mangling of lines that begin with ``From`` that is required by the Unix mbox format. For more flexibility, instantiate a :class:`~email.generator.Generator` instance and use its :meth:`~email.generator.Generator.flatten` method directly. For example::" -msgstr "" +msgid "" +"Note that this method is provided as a convenience and may not always format" +" the message the way you want. For example, by default it does not do the " +"mangling of lines that begin with ``From`` that is required by the Unix mbox" +" format. For more flexibility, instantiate a " +":class:`~email.generator.Generator` instance and use its " +":meth:`~email.generator.Generator.flatten` method directly. For example::" +msgstr "" +"توجه داشته باشید که این متد برای سهولت فراهم شده است و ممکن است همیشه پیام " +"را آن‌گونه که می‌خواهید قالب‌بندی نکند. برای مثال، به‌طور پیش‌فرض، دست‌کاری " +"خطوطی که با ``From`` شروع می‌شوند و قالب mbox یونیکس آن را ایجاب می‌کند " +"انجام نمی‌دهد. برای انعطاف‌پذیری بیشتر، نمونه‌ای از " +":class:`~email.generator.Generator` ایجاد کنید و مستقیماً از متد " +":meth:`~email.generator.Generator.flatten` آن استفاده کنید. برای مثال::" msgid "" "from io import StringIO\n" @@ -68,21 +187,65 @@ msgid "" "g.flatten(msg)\n" "text = fp.getvalue()" msgstr "" +"from io import StringIO\n" +"from email.generator import Generator\n" +"fp = StringIO()\n" +"g = Generator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" -msgid "If the message object contains binary data that is not encoded according to RFC standards, the non-compliant data will be replaced by unicode \"unknown character\" code points. (See also :meth:`.as_bytes` and :class:`~email.generator.BytesGenerator`.)" +msgid "" +"If the message object contains binary data that is not encoded according to " +"RFC standards, the non-compliant data will be replaced by unicode \"unknown " +"character\" code points. (See also :meth:`.as_bytes` and " +":class:`~email.generator.BytesGenerator`.)" msgstr "" +"اگر شیء پیام حاوی داده‌های دودویی باشد که مطابق استانداردهای RFC " +"کدگذاری‌نشده باشند، داده‌های نامنطبق با نقاط کد یونیکد «نویسه ناشناخته» " +"جایگزین خواهند شد. (همچنین :meth:`.as_bytes` و " +":class:`~email.generator.BytesGenerator` را ببینید.)" msgid "the *policy* keyword argument was added." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *policy* افزوده شد." -msgid "Equivalent to :meth:`.as_string`. Allows ``str(msg)`` to produce a string containing the formatted message." +msgid "" +"Equivalent to :meth:`.as_string`. Allows ``str(msg)`` to produce a string " +"containing the formatted message." msgstr "" +"معادل :meth:`.as_string`. به ``str(msg)`` اجازه می‌دهد رشته‌ای حاوی پیام " +"قالب‌بندی‌شده تولید کند." -msgid "Return the entire message flattened as a bytes object. When optional *unixfrom* is true, the envelope header is included in the returned string. *unixfrom* defaults to ``False``. The *policy* argument may be used to override the default policy obtained from the message instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the ``BytesGenerator``." -msgstr "" +msgid "" +"Return the entire message flattened as a bytes object. When optional " +"*unixfrom* is true, the envelope header is included in the returned string." +" *unixfrom* defaults to ``False``. The *policy* argument may be used to " +"override the default policy obtained from the message instance. This can be " +"used to control some of the formatting produced by the method, since the " +"specified *policy* will be passed to the ``BytesGenerator``." +msgstr "" +"کل پیام را به‌صورت یک شیء bytes مسطح‌شده برمی‌گرداند. هنگامی که آرگومان " +"اختیاری *unixfrom* true باشد، سرآیند پاکت (envelope header) در رشته " +"برگردانده‌شده گنجانده می‌شود. *unixfrom* به‌طور پیش‌فرض ``False`` است. " +"می‌توان از آرگومان *policy* برای نادیده گرفتن سیاست پیش‌فرض گرفته‌شده از " +"نمونه پیام استفاده کرد. می‌توان از این کار برای کنترل برخی از قالب‌بندی‌های " +"تولیدشده توسط متد استفاده کرد، زیرا *policy* مشخص‌شده به ``BytesGenerator``" +" ارسال می‌شود." -msgid "Note that this method is provided as a convenience and may not always format the message the way you want. For example, by default it does not do the mangling of lines that begin with ``From`` that is required by the Unix mbox format. For more flexibility, instantiate a :class:`~email.generator.BytesGenerator` instance and use its :meth:`~email.generator.BytesGenerator.flatten` method directly. For example::" -msgstr "" +msgid "" +"Note that this method is provided as a convenience and may not always format" +" the message the way you want. For example, by default it does not do the " +"mangling of lines that begin with ``From`` that is required by the Unix mbox" +" format. For more flexibility, instantiate a " +":class:`~email.generator.BytesGenerator` instance and use its " +":meth:`~email.generator.BytesGenerator.flatten` method directly. For " +"example::" +msgstr "" +"توجه داشته باشید که این متد برای سهولت ارائه شده است و ممکن است همیشه پیام " +"را به شکلی که می‌خواهید قالب‌بندی نکند. برای مثال، به‌طور پیش‌فرض، دستکاری " +"خطوطی که با ``From`` آغاز می‌شوند و قالب mbox یونیکس به آن نیاز دارد را " +"انجام نمی‌دهد. برای انعطاف‌پذیری بیشتر، یک نمونه از " +":class:`~email.generator.BytesGenerator` ایجاد کنید و مستقیماً از متد " +":meth:`~email.generator.BytesGenerator.flatten` آن استفاده کنید. برای مثال::" msgid "" "from io import BytesIO\n" @@ -92,266 +255,846 @@ msgid "" "g.flatten(msg)\n" "text = fp.getvalue()" msgstr "" +"from io import BytesIO\n" +"from email.generator import BytesGenerator\n" +"fp = BytesIO()\n" +"g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" -msgid "Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes object containing the formatted message." +msgid "" +"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"object containing the formatted message." msgstr "" +"معادل با :meth:`.as_bytes` است. به ``bytes(msg)`` اجازه می‌دهد که یک شیء " +"bytes حاوی پیام قالب‌بندی‌شده تولید کند." -msgid "Return ``True`` if the message's payload is a list of sub-\\ :class:`Message` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload). (Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that \"msg.get_content_maintype() == 'multipart'\" will return the ``True``. For example, ``is_multipart`` will return ``True`` when the :class:`Message` is of type ``message/rfc822``.)" -msgstr "" +msgid "" +"Return ``True`` if the message's payload is a list of sub-\\ " +":class:`Message` objects, otherwise return ``False``. When " +":meth:`is_multipart` returns ``False``, the payload should be a string " +"object (which might be a CTE encoded binary payload). (Note that " +":meth:`is_multipart` returning ``True`` does not necessarily mean that " +"\"msg.get_content_maintype() == 'multipart'\" will return the ``True``. For " +"example, ``is_multipart`` will return ``True`` when the :class:`Message` is " +"of type ``message/rfc822``.)" +msgstr "" +"اگر بار پیام فهرستی از اشیای sub-\\ :class:`Message` باشد، ``True`` را " +"برمی‌گرداند، در غیر این صورت ``False`` را برمی‌گرداند. هنگامی که " +":meth:`is_multipart` مقدار ``False`` را برمی‌گرداند، بار باید یک شیء رشته" +" باشد (که ممکن است یک بار دودویی کدگذاری‌شده با CTE باشد). (توجه داشته " +"باشید که برگرداندن ``True`` توسط :meth:`is_multipart` لزوماً به این معنا " +"نیست که \"msg.get_content_maintype() == 'multipart'\" مقدار ``True`` را " +"برمی‌گرداند. برای مثال، هنگامی که :class:`Message` از نوع ``message/rfc822``" +" باشد، ``is_multipart`` مقدار ``True`` را برمی‌گرداند.)" -msgid "Set the message's envelope header to *unixfrom*, which should be a string." -msgstr "" +msgid "" +"Set the message's envelope header to *unixfrom*, which should be a string." +msgstr "سرآیند پاکت پیام را روی *unixfrom* تنظیم کنید، که باید یک رشته باشد." -msgid "Return the message's envelope header. Defaults to ``None`` if the envelope header was never set." +msgid "" +"Return the message's envelope header. Defaults to ``None`` if the envelope " +"header was never set." msgstr "" +"سرصفحه‌ی پاکت پیام را برمی‌گرداند. اگر سرصفحه‌ی پاکت هرگز تنظیم نشده باشد، " +"مقدار پیش‌فرض ``None`` است." -msgid "Add the given *payload* to the current payload, which must be ``None`` or a list of :class:`Message` objects before the call. After the call, the payload will always be a list of :class:`Message` objects. If you want to set the payload to a scalar object (e.g. a string), use :meth:`set_payload` instead." -msgstr "" +msgid "" +"Add the given *payload* to the current payload, which must be ``None`` or a " +"list of :class:`Message` objects before the call. After the call, the " +"payload will always be a list of :class:`Message` objects. If you want to " +"set the payload to a scalar object (e.g. a string), use :meth:`set_payload` " +"instead." +msgstr "" +"بار داده‌شده (*payload*) را به بار کنونی اضافه کنید، که باید پیش از " +"فراخوانی ``None`` یا فهرستی از اشیای :class:`Message` باشد. پس از " +"فراخوانی، بار همیشه فهرستی از اشیای :class:`Message` خواهد بود. اگر " +"می‌خواهید بار را روی یک شیء اسکالر (scalar)، برای مثال یک رشته، تنظیم " +"کنید، در عوض از :meth:`set_payload` استفاده کنید." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by :meth:`~email.message.EmailMessage.set_content` and the related ``make`` and ``add`` methods." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by " +":meth:`~email.message.EmailMessage.set_content` and the related ``make`` and" +" ``add`` methods." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با :meth:`~email.message.EmailMessage.set_content` و متدهای مرتبط " +"``make`` و ``add`` جایگزین شده است." -msgid "Return the current payload, which will be a list of :class:`Message` objects when :meth:`is_multipart` is ``True``, or a string when :meth:`is_multipart` is ``False``. If the payload is a list and you mutate the list object, you modify the message's payload in place." +msgid "" +"Return the current payload, which will be a list of :class:`Message` objects" +" when :meth:`is_multipart` is ``True``, or a string when " +":meth:`is_multipart` is ``False``. If the payload is a list and you mutate " +"the list object, you modify the message's payload in place." msgstr "" +"بار (payload) فعلی را بازمی‌گرداند، که هنگامی که :meth:`is_multipart` برابر " +"``True`` باشد، فهرستی از اشیاء :class:`Message` خواهد بود، یا هنگامی که " +":meth:`is_multipart` برابر ``False`` باشد، یک رشته خواهد بود. اگر بار یک " +"فهرست باشد و شما شیء فهرست را تغییر دهید، بار پیام را درجا تغییر می‌دهید." -msgid "With optional argument *i*, :meth:`get_payload` will return the *i*-th element of the payload, counting from zero, if :meth:`is_multipart` is ``True``. An :exc:`IndexError` will be raised if *i* is less than 0 or greater than or equal to the number of items in the payload. If the payload is a string (i.e. :meth:`is_multipart` is ``False``) and *i* is given, a :exc:`TypeError` is raised." -msgstr "" +msgid "" +"With optional argument *i*, :meth:`get_payload` will return the *i*-th " +"element of the payload, counting from zero, if :meth:`is_multipart` is " +"``True``. An :exc:`IndexError` will be raised if *i* is less than 0 or " +"greater than or equal to the number of items in the payload. If the payload" +" is a string (i.e. :meth:`is_multipart` is ``False``) and *i* is given, a " +":exc:`TypeError` is raised." +msgstr "" +"با آرگومان اختیاری *i*، اگر :meth:`is_multipart` برابر ``True`` باشد، " +":meth:`get_payload` عنصر *i*ام بار را، با شمارش از صفر، برمی‌گرداند. اگر " +"*i* کمتر از ۰ یا بزرگ‌تر یا مساوی تعداد آیتم‌های بار باشد، :exc:`IndexError`" +" پرتاب می‌شود. اگر بار یک رشته باشد (یعنی :meth:`is_multipart` برابر " +"``False`` باشد) و *i* داده شده باشد، :exc:`TypeError` پرتاب می‌شود." -msgid "Optional *decode* is a flag indicating whether the payload should be decoded or not, according to the :mailheader:`Content-Transfer-Encoding` header. When ``True`` and the message is not a multipart, the payload will be decoded if this header's value is ``quoted-printable`` or ``base64``. If some other encoding is used, or :mailheader:`Content-Transfer-Encoding` header is missing, the payload is returned as-is (undecoded). In all cases the returned value is binary data. If the message is a multipart and the *decode* flag is ``True``, then ``None`` is returned. If the payload is base64 and it was not perfectly formed (missing padding, characters outside the base64 alphabet), then an appropriate defect will be added to the message's defect property (:class:`~email.errors.InvalidBase64PaddingDefect` or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." -msgstr "" +msgid "" +"Optional *decode* is a flag indicating whether the payload should be decoded" +" or not, according to the :mailheader:`Content-Transfer-Encoding` header. " +"When ``True`` and the message is not a multipart, the payload will be " +"decoded if this header's value is ``quoted-printable`` or ``base64``. If " +"some other encoding is used, or :mailheader:`Content-Transfer-Encoding` " +"header is missing, the payload is returned as-is (undecoded). In all cases " +"the returned value is binary data. If the message is a multipart and the " +"*decode* flag is ``True``, then ``None`` is returned. If the payload is " +"base64 and it was not perfectly formed (missing padding, characters outside " +"the base64 alphabet), then an appropriate defect will be added to the " +"message's defect property (:class:`~email.errors.InvalidBase64PaddingDefect`" +" or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." +msgstr "" +"*decode* اختیاری پرچمی است که نشان می‌دهد بار باید بر اساس سرآیند " +":mailheader:`Content-Transfer-Encoding` کدگشایی شود یا خیر. هنگامی که " +"``True`` باشد و پیام چندبخشی نباشد، اگر مقدار این سرآیند ``quoted-" +"printable`` یا ``base64`` باشد، بار کدگشایی خواهد شد. اگر از کدگذاری " +"دیگری استفاده شده باشد یا سرآیند :mailheader:`Content-Transfer-Encoding` وجود" +" نداشته باشد، بار به‌همان‌صورت (کدگشایی‌نشده) برگردانده می‌شود. در همه " +"حالت‌ها، مقدار برگردانده‌شده داده‌های دودویی است. اگر پیام چندبخشی باشد و " +"پرچم *decode* ``True`` باشد، ``None`` برگردانده می‌شود. اگر بار base64 " +"باشد و به‌طور کامل درست تشکیل نشده باشد (نبود پدینگ، نویسه‌های خارج از " +"الفبای base64)، نقص مناسبی به ویژگی نقص پیام افزوده خواهد شد " +"(:class:`~email.errors.InvalidBase64PaddingDefect` یا " +":class:`~email.errors.InvalidBase64CharactersDefect`، به‌ترتیب)." -msgid "When *decode* is ``False`` (the default) the body is returned as a string without decoding the :mailheader:`Content-Transfer-Encoding`. However, for a :mailheader:`Content-Transfer-Encoding` of 8bit, an attempt is made to decode the original bytes using the ``charset`` specified by the :mailheader:`Content-Type` header, using the ``replace`` error handler. If no ``charset`` is specified, or if the ``charset`` given is not recognized by the email package, the body is decoded using the default ASCII charset." -msgstr "" +msgid "" +"When *decode* is ``False`` (the default) the body is returned as a string " +"without decoding the :mailheader:`Content-Transfer-Encoding`. However, for " +"a :mailheader:`Content-Transfer-Encoding` of 8bit, an attempt is made to " +"decode the original bytes using the ``charset`` specified by the " +":mailheader:`Content-Type` header, using the ``replace`` error handler. If " +"no ``charset`` is specified, or if the ``charset`` given is not recognized " +"by the email package, the body is decoded using the default ASCII charset." +msgstr "" +"هنگامی که *decode* برابر ``False`` باشد (پیش‌فرض)، بدنه به‌صورت یک رشته بدون" +" کدگشایی بر اساس :mailheader:`Content-Transfer-Encoding` بازگردانده می‌شود. " +"با این حال، برای :mailheader:`Content-Transfer-Encoding` با مقدار 8bit، " +"تلاشی برای کدگشایی بایت‌های اصلی با استفاده از ``charset`` مشخص‌شده توسط " +"سرآیند :mailheader:`Content-Type` و با کنترل‌کننده‌ی خطای ``replace`` صورت " +"می‌گیرد. اگر هیچ ``charset`` مشخص نشده باشد، یا ``charset`` داده‌شده توسط " +"بسته‌ی email شناخته نشود، بدنه با استفاده از نویسه‌گان پیش‌فرض ASCII کدگشایی " +"می‌شود." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by :meth:`~email.message.EmailMessage.get_content` and :meth:`~email.message.EmailMessage.iter_parts`." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by " +":meth:`~email.message.EmailMessage.get_content` and " +":meth:`~email.message.EmailMessage.iter_parts`." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با :meth:`~email.message.EmailMessage.get_content` و " +":meth:`~email.message.EmailMessage.iter_parts` جایگزین شده است." -msgid "Set the entire message object's payload to *payload*. It is the client's responsibility to ensure the payload invariants. Optional *charset* sets the message's default character set; see :meth:`set_charset` for details." +msgid "" +"Set the entire message object's payload to *payload*. It is the client's " +"responsibility to ensure the payload invariants. Optional *charset* sets " +"the message's default character set; see :meth:`set_charset` for details." msgstr "" +"کل بار (payload) شیء پیام را روی *payload* تنظیم کنید. مسئولیت اطمینان از " +"برقراری ناورداهای بار بر عهده کارخواه است. *charset* اختیاری، مجموعه‌ی " +"نویسه‌ی پیش‌فرض پیام را تنظیم می‌کند؛ برای جزئیات :meth:`set_charset` را " +"ببینید." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by :meth:`~email.message.EmailMessage.set_content`." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by " +":meth:`~email.message.EmailMessage.set_content`." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با :meth:`~email.message.EmailMessage.set_content` جایگزین شده است." -msgid "Set the character set of the payload to *charset*, which can either be a :class:`~email.charset.Charset` instance (see :mod:`email.charset`), a string naming a character set, or ``None``. If it is a string, it will be converted to a :class:`~email.charset.Charset` instance. If *charset* is ``None``, the ``charset`` parameter will be removed from the :mailheader:`Content-Type` header (the message will not be otherwise modified). Anything else will generate a :exc:`TypeError`." -msgstr "" +msgid "" +"Set the character set of the payload to *charset*, which can either be a " +":class:`~email.charset.Charset` instance (see :mod:`email.charset`), a " +"string naming a character set, or ``None``. If it is a string, it will be " +"converted to a :class:`~email.charset.Charset` instance. If *charset* is " +"``None``, the ``charset`` parameter will be removed from the " +":mailheader:`Content-Type` header (the message will not be otherwise " +"modified). Anything else will generate a :exc:`TypeError`." +msgstr "" +"مجموعه‌ی نویسه‌های بار را روی *charset* تنظیم کنید، که می‌تواند یک نمونه از " +":class:`~email.charset.Charset` (به :mod:`email.charset` مراجعه کنید)، " +"رشته‌ای که نام یک مجموعه نویسه را مشخص می‌کند، یا ``None`` باشد. اگر یک رشته" +" باشد، به یک نمونه از :class:`~email.charset.Charset` تبدیل خواهد شد. اگر " +"*charset* برابر ``None`` باشد، پارامتر ``charset`` از سرآیند " +":mailheader:`Content-Type` حذف خواهد شد (پیام به‌جز این مورد تغییر دیگری " +"نخواهد کرد). هر چیز دیگری باعث ایجاد :exc:`TypeError` خواهد شد." -msgid "If there is no existing :mailheader:`MIME-Version` header one will be added. If there is no existing :mailheader:`Content-Type` header, one will be added with a value of :mimetype:`text/plain`. Whether the :mailheader:`Content-Type` header already exists or not, its ``charset`` parameter will be set to *charset.output_charset*. If *charset.input_charset* and *charset.output_charset* differ, the payload will be re-encoded to the *output_charset*. If there is no existing :mailheader:`Content-Transfer-Encoding` header, then the payload will be transfer-encoded, if needed, using the specified :class:`~email.charset.Charset`, and a header with the appropriate value will be added. If a :mailheader:`Content-Transfer-Encoding` header already exists, the payload is assumed to already be correctly encoded using that :mailheader:`Content-Transfer-Encoding` and is not modified." -msgstr "" +msgid "" +"If there is no existing :mailheader:`MIME-Version` header one will be added." +" If there is no existing :mailheader:`Content-Type` header, one will be " +"added with a value of :mimetype:`text/plain`. Whether the " +":mailheader:`Content-Type` header already exists or not, its ``charset`` " +"parameter will be set to *charset.output_charset*. If " +"*charset.input_charset* and *charset.output_charset* differ, the payload " +"will be re-encoded to the *output_charset*. If there is no existing " +":mailheader:`Content-Transfer-Encoding` header, then the payload will be " +"transfer-encoded, if needed, using the specified " +":class:`~email.charset.Charset`, and a header with the appropriate value " +"will be added. If a :mailheader:`Content-Transfer-Encoding` header already " +"exists, the payload is assumed to already be correctly encoded using that " +":mailheader:`Content-Transfer-Encoding` and is not modified." +msgstr "" +"اگر سرآیند :mailheader:`MIME-Version` از قبل وجود نداشته باشد، یکی افزوده " +"می‌شود. اگر سرآیند :mailheader:`Content-Type` از قبل وجود نداشته باشد، یکی با" +" مقدار :mimetype:`text/plain` افزوده می‌شود. چه سرآیند :mailheader:`Content-" +"Type` از قبل وجود داشته باشد و چه نداشته باشد، پارامتر ``charset`` آن به " +"*charset.output_charset* تنظیم می‌شود. اگر *charset.input_charset* و " +"*charset.output_charset* متفاوت باشند، بار به *output_charset* دوباره " +"کدگذاری می‌شود. اگر سرآیند :mailheader:`Content-Transfer-Encoding` از قبل " +"وجود نداشته باشد، در صورت نیاز، بار با استفاده از " +":class:`~email.charset.Charset` تعیین‌شده، کدگذاری انتقالی می‌شود و سرآیندی " +"با مقدار مناسب افزوده می‌شود. اگر سرآیند :mailheader:`Content-Transfer-" +"Encoding` از قبل وجود داشته باشد، فرض می‌شود بار از قبل به‌درستی با استفاده " +"از همان :mailheader:`Content-Transfer-Encoding` کدگذاری شده است و تغییر داده" +" نمی‌شود." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by the *charset* parameter of the :meth:`email.message.EmailMessage.set_content` method." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *charset* parameter of the " +":meth:`email.message.EmailMessage.set_content` method." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با پارامتر *charset* متد :meth:`email.message.EmailMessage.set_content` " +"جایگزین شده است." -msgid "Return the :class:`~email.charset.Charset` instance associated with the message's payload." +msgid "" +"Return the :class:`~email.charset.Charset` instance associated with the " +"message's payload." msgstr "" +"نمونه‌ی :class:`~email.charset.Charset` مرتبط با بار (payload) پیام را " +"برمی‌گرداند." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class it always returns ``None``." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"it always returns ``None``." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage` همیشه " +"``None`` را برمی‌گرداند." -msgid "The following methods implement a mapping-like interface for accessing the message's :rfc:`2822` headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by :meth:`keys`, but in a :class:`Message` object, headers are always returned in the order they appeared in the original message, or were added to the message later. Any header deleted and then re-added are always appended to the end of the header list." -msgstr "" +msgid "" +"The following methods implement a mapping-like interface for accessing the " +"message's :rfc:`2822` headers. Note that there are some semantic " +"differences between these methods and a normal mapping (i.e. dictionary) " +"interface. For example, in a dictionary there are no duplicate keys, but " +"here there may be duplicate message headers. Also, in dictionaries there is" +" no guaranteed order to the keys returned by :meth:`keys`, but in a " +":class:`Message` object, headers are always returned in the order they " +"appeared in the original message, or were added to the message later. Any " +"header deleted and then re-added are always appended to the end of the " +"header list." +msgstr "" +"متدهای زیر یک رابط نگاشت‌مانند برای دسترسی به سرآیندهای :rfc:`2822` پیام " +"پیاده‌سازی می‌کنند. توجه داشته باشید که برخی تفاوت‌های معنایی میان این " +"متدها و یک رابط نگاشت معمول (یعنی دیکشنری) وجود دارد. برای مثال، در دیکشنری" +" هیچ کلید تکراری وجود ندارد، اما اینجا ممکن است سرآیندهای تکراری پیام وجود " +"داشته باشد. همچنین، در دیکشنری‌ها ترتیبی برای کلیدهای برگردانده‌شده توسط " +":meth:`keys` تضمین نمی‌شود، اما در یک شیء :class:`Message`، سرآیندها همیشه " +"به همان ترتیبی که در پیام اصلی ظاهر شده‌اند یا بعداً به پیام اضافه شده‌اند، " +"برگردانده می‌شوند. هر سرآیندی که حذف و سپس دوباره اضافه شود، همیشه به انتهای " +"فهرست سرآیندها افزوده می‌شود." -msgid "These semantic differences are intentional and are biased toward maximal convenience." -msgstr "" +msgid "" +"These semantic differences are intentional and are biased toward maximal " +"convenience." +msgstr "این تفاوت‌های معنایی عمدی هستند و به سمت حداکثر سهولت تمایل دارند." -msgid "Note that in all cases, any envelope header present in the message is not included in the mapping interface." +msgid "" +"Note that in all cases, any envelope header present in the message is not " +"included in the mapping interface." msgstr "" +"توجه داشته باشید که در همه موارد، هر سرآیند پاکت (envelope header) موجود در " +"پیام، در رابط نگاشت گنجانده نمی‌شود." -msgid "In a model generated from bytes, any header values that (in contravention of the RFCs) contain non-ASCII bytes will, when retrieved through this interface, be represented as :class:`~email.header.Header` objects with a charset of ``unknown-8bit``." +msgid "" +"In a model generated from bytes, any header values that (in contravention of" +" the RFCs) contain non-ASCII bytes will, when retrieved through this " +"interface, be represented as :class:`~email.header.Header` objects with a " +"charset of ``unknown-8bit``." msgstr "" +"در مدلی که از بایت‌ها تولید شده است، هر یک از مقادیر سرآیند که (برخلاف RFCها)" +" حاوی بایت‌های غیرASCII باشند، هنگام بازیابی از طریق این رابط، به‌صورت " +"اشیای :class:`~email.header.Header` با مجموعه‌نویسه‌ی ``unknown-8bit`` " +"نمایش داده می‌شوند." msgid "Return the total number of headers, including duplicates." -msgstr "" +msgstr "تعداد کل سرصفحه‌ها، شامل تکراری‌ها را برمی‌گرداند." -msgid "Return ``True`` if the message object has a field named *name*. Matching is done case-insensitively and *name* should not include the trailing colon. Used for the ``in`` operator, e.g.::" +msgid "" +"Return ``True`` if the message object has a field named *name*. Matching is " +"done case-insensitively and *name* should not include the trailing colon. " +"Used for the ``in`` operator, e.g.::" msgstr "" +"اگر شیء پیام دارای فیلدی به نام *name* باشد، ``True`` را برمی‌گرداند. تطبیق " +"بدون حساسیت به بزرگی و کوچکی حروف انجام می‌شود و *name* نباید شامل دونقطه " +"پایانی باشد. برای عملگر ``in`` استفاده می‌شود، برای مثال::" msgid "" "if 'message-id' in myMessage:\n" " print('Message-ID:', myMessage['message-id'])" msgstr "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" -msgid "Return the value of the named header field. *name* should not include the colon field separator. If the header is missing, ``None`` is returned; a :exc:`KeyError` is never raised." +msgid "" +"Return the value of the named header field. *name* should not include the " +"colon field separator. If the header is missing, ``None`` is returned; a " +":exc:`KeyError` is never raised." msgstr "" +"مقدار فیلد سرآیند نام‌برده‌شده را برمی‌گرداند. *name* نباید شامل دونقطه‌ی " +"جداکننده‌ی فیلد باشد. اگر سرآیند وجود نداشته باشد، ``None`` بازگشت داده " +"می‌شود؛ هرگز :exc:`KeyError` پرتاب نمی‌شود." -msgid "Note that if the named field appears more than once in the message's headers, exactly which of those field values will be returned is undefined. Use the :meth:`get_all` method to get the values of all the extant named headers." +msgid "" +"Note that if the named field appears more than once in the message's " +"headers, exactly which of those field values will be returned is undefined." +" Use the :meth:`get_all` method to get the values of all the extant named " +"headers." msgstr "" +"توجه داشته باشید که اگر فیلد نام‌برده‌شده بیش از یک بار در سرصفحه‌های پیام " +"ظاهر شود، دقیقاً این‌که کدام‌یک از مقادیر آن فیلد برگردانده خواهد شد، " +"تعریف‌نشده است. برای دریافت مقادیر همه‌ی سرصفحه‌های نام‌برده‌شده‌ی موجود، از " +"متد :meth:`get_all` استفاده کنید." -msgid "Add a header to the message with field name *name* and value *val*. The field is appended to the end of the message's existing fields." +msgid "" +"Add a header to the message with field name *name* and value *val*. The " +"field is appended to the end of the message's existing fields." msgstr "" +"یک سرآیند با نام فیلد *name* و مقدار *val* به پیام اضافه کنید. این فیلد به " +"انتهای فیلدهای موجود پیام افزوده می‌شود." -msgid "Note that this does *not* overwrite or delete any existing header with the same name. If you want to ensure that the new header is the only one present in the message with field name *name*, delete the field first, e.g.::" +msgid "" +"Note that this does *not* overwrite or delete any existing header with the " +"same name. If you want to ensure that the new header is the only one " +"present in the message with field name *name*, delete the field first, " +"e.g.::" msgstr "" +"توجه داشته باشید که این کار هیچ سرآیند موجودی با نام یکسان را بازنویسی یا حذف" +" *نمی‌کند*. اگر می‌خواهید اطمینان حاصل کنید که سرآیند جدید تنها سرآیند موجود " +"در پیام با نام فیلد *name* است، ابتدا فیلد را حذف کنید، برای مثال::" msgid "" "del msg['subject']\n" "msg['subject'] = 'Python roolz!'" msgstr "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" -msgid "Delete all occurrences of the field with name *name* from the message's headers. No exception is raised if the named field isn't present in the headers." +msgid "" +"Delete all occurrences of the field with name *name* from the message's " +"headers. No exception is raised if the named field isn't present in the " +"headers." msgstr "" +"تمام موارد فیلد با نام *name* را از سرصفحه‌های پیام حذف می‌کند. اگر فیلد " +"نام‌برده‌شده در سرصفحه‌ها وجود نداشته باشد، هیچ استثنایی پرتاب نمی‌شود." msgid "Return a list of all the message's header field names." -msgstr "" +msgstr "فهرستی از همه‌ی نام‌های فیلد سرایند پیام را برمی‌گرداند." msgid "Return a list of all the message's field values." -msgstr "" +msgstr "فهرستی از تمام مقادیر فیلدهای پیام را برمی‌گرداند." -msgid "Return a list of 2-tuples containing all the message's field headers and values." +msgid "" +"Return a list of 2-tuples containing all the message's field headers and " +"values." msgstr "" +"فهرستی از تاپل‌های دوتایی شامل تمام سرصفحه‌ها و مقادیر فیلدهای پیام را " +"برمی‌گرداند." -msgid "Return the value of the named header field. This is identical to :meth:`~object.__getitem__` except that optional *failobj* is returned if the named header is missing (defaults to ``None``)." +msgid "" +"Return the value of the named header field. This is identical to " +":meth:`~object.__getitem__` except that optional *failobj* is returned if " +"the named header is missing (defaults to ``None``)." msgstr "" +"مقدار فیلد سرآیند با نام مشخص‌شده را برمی‌گرداند. این دقیقاً مانند " +":meth:`~object.__getitem__` است، با این تفاوت که اگر سرآیند با نام مشخص‌شده " +"وجود نداشته باشد، *failobj* اختیاری برگردانده می‌شود (پیش‌فرض ``None`` است)." msgid "Here are some additional useful methods:" -msgstr "" +msgstr "در اینجا چند متد مفید دیگر آمده است:" -msgid "Return a list of all the values for the field named *name*. If there are no such named headers in the message, *failobj* is returned (defaults to ``None``)." +msgid "" +"Return a list of all the values for the field named *name*. If there are no " +"such named headers in the message, *failobj* is returned (defaults to " +"``None``)." msgstr "" +"فهرستی از تمام مقدارهای فیلدی به نام *name* برمی‌گرداند. اگر هیچ سرصفحه‌ای " +"با این نام در پیام وجود نداشته باشد، *failobj* برگردانده می‌شود (پیش‌فرض " +"``None`` است)." -msgid "Extended header setting. This method is similar to :meth:`__setitem__` except that additional header parameters can be provided as keyword arguments. *_name* is the header field to add and *_value* is the *primary* value for the header." +msgid "" +"Extended header setting. This method is similar to :meth:`__setitem__` " +"except that additional header parameters can be provided as keyword " +"arguments. *_name* is the header field to add and *_value* is the *primary*" +" value for the header." msgstr "" +"تنظیم سرآیند گسترش‌یافته. این متد مشابه :meth:`__setitem__` است، با این تفاوت" +" که می‌توان پارامترهای اضافی سرآیند را به‌عنوان آرگومان‌های کلیدواژه‌ای ارائه" +" کرد. *_name* فیلد سرآیندی است که باید اضافه شود، و *_value* مقدار *اصلی* " +"برای سرآیند است." -msgid "For each item in the keyword argument dictionary *_params*, the key is taken as the parameter name, with underscores converted to dashes (since dashes are illegal in Python identifiers). Normally, the parameter will be added as ``key=\"value\"`` unless the value is ``None``, in which case only the key will be added. If the value contains non-ASCII characters, it can be specified as a three tuple in the format ``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the charset to be used to encode the value, ``LANGUAGE`` can usually be set to ``None`` or the empty string (see :rfc:`2231` for other possibilities), and ``VALUE`` is the string value containing non-ASCII code points. If a three tuple is not passed and the value contains non-ASCII characters, it is automatically encoded in :rfc:`2231` format using a ``CHARSET`` of ``utf-8`` and a ``LANGUAGE`` of ``None``." -msgstr "" +msgid "" +"For each item in the keyword argument dictionary *_params*, the key is taken" +" as the parameter name, with underscores converted to dashes (since dashes " +"are illegal in Python identifiers). Normally, the parameter will be added " +"as ``key=\"value\"`` unless the value is ``None``, in which case only the " +"key will be added. If the value contains non-ASCII characters, it can be " +"specified as a three tuple in the format ``(CHARSET, LANGUAGE, VALUE)``, " +"where ``CHARSET`` is a string naming the charset to be used to encode the " +"value, ``LANGUAGE`` can usually be set to ``None`` or the empty string (see " +":rfc:`2231` for other possibilities), and ``VALUE`` is the string value " +"containing non-ASCII code points. If a three tuple is not passed and the " +"value contains non-ASCII characters, it is automatically encoded in " +":rfc:`2231` format using a ``CHARSET`` of ``utf-8`` and a ``LANGUAGE`` of " +"``None``." +msgstr "" +"برای هر آیتم در دیکشنری آرگومان‌های کلیدواژه‌ای *_params*، کلید به‌عنوان نام" +" پارامتر در نظر گرفته می‌شود و زیرخط‌ها به خط تیره تبدیل می‌شوند (زیرا خط " +"تیره در شناسه‌های پایتون غیرمجاز است). معمولاً، پارامتر به‌صورت " +"``key=\"value\"`` اضافه می‌شود، مگر اینکه مقدار ``None`` باشد، که در این " +"صورت فقط کلید اضافه می‌شود. اگر مقدار شامل نویسه‌های غیر ASCII باشد، می‌توان" +" آن را به‌صورت یک سه‌تایی در قالب ``(CHARSET, LANGUAGE, VALUE)`` مشخص کرد، " +"که در آن ``CHARSET`` رشته‌ای است که نام مجموعه‌نویسه مورد استفاده برای " +"کدگذاری مقدار را مشخص می‌کند، ``LANGUAGE`` معمولاً می‌تواند روی ``None`` یا " +"رشته خالی تنظیم شود (برای سایر امکان‌ها :rfc:`2231` را ببینید)، و ``VALUE`` " +"مقدار رشته‌ای حاوی نقاط کد غیر ASCII است. اگر یک سه‌تایی ارسال نشود و مقدار " +"شامل نویسه‌های غیر ASCII باشد، به‌صورت خودکار در قالب :rfc:`2231` با " +"``CHARSET`` برابر با ``utf-8`` و ``LANGUAGE`` برابر با ``None`` کدگذاری " +"می‌شود." msgid "Here's an example::" -msgstr "" +msgstr "در اینجا یک مثال آمده است::" -msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgid "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgstr "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgid "This will add a header that looks like ::" -msgstr "" +msgstr "این یک سرآیند اضافه می‌کند که به این شکل است ::" msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" +msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" msgid "An example with non-ASCII characters::" -msgstr "" +msgstr "مثالی با نویسه‌های غیر ASCII::" msgid "" "msg.add_header('Content-Disposition', 'attachment',\n" " filename=('iso-8859-1', '', 'Fußballer.ppt'))" msgstr "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" msgid "Which produces ::" -msgstr "" +msgstr "که تولید می‌کند ::" msgid "Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" msgstr "" +"Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" -msgid "Replace a header. Replace the first header found in the message that matches *_name*, retaining header order and field name case. If no matching header was found, a :exc:`KeyError` is raised." +msgid "" +"Replace a header. Replace the first header found in the message that " +"matches *_name*, retaining header order and field name case. If no matching" +" header was found, a :exc:`KeyError` is raised." msgstr "" +"یک سرآیند را جایگزین می‌کند. نخستین سرآیند یافت‌شده در پیام را که با *_name* " +"مطابقت دارد، با حفظ ترتیب سرآیندها و حالت حروف نام فیلد جایگزین می‌کند. اگر " +"هیچ سرآیند مطابقی یافت نشد، یک :exc:`KeyError` پرتاب می‌شود." -msgid "Return the message's content type. The returned string is coerced to lower case of the form :mimetype:`maintype/subtype`. If there was no :mailheader:`Content-Type` header in the message the default type as given by :meth:`get_default_type` will be returned. Since according to :rfc:`2045`, messages always have a default type, :meth:`get_content_type` will always return a value." -msgstr "" +msgid "" +"Return the message's content type. The returned string is coerced to lower " +"case of the form :mimetype:`maintype/subtype`. If there was no " +":mailheader:`Content-Type` header in the message the default type as given " +"by :meth:`get_default_type` will be returned. Since according to " +":rfc:`2045`, messages always have a default type, :meth:`get_content_type` " +"will always return a value." +msgstr "" +"نوع محتوای پیام را بازمی‌گرداند. رشته‌ی بازگردانده‌شده به حروف کوچک تبدیل " +"می‌شود و در قالب :mimetype:`maintype/subtype` خواهد بود. اگر سرآیند " +":mailheader:`Content-Type` در پیام وجود نداشته باشد، نوع پیش‌فرض داده‌شده " +"توسط :meth:`get_default_type` بازگردانده خواهد شد. از آنجا که طبق " +":rfc:`2045`، پیام‌ها همیشه یک نوع پیش‌فرض دارند، :meth:`get_content_type` " +"همیشه یک مقدار بازمی‌گرداند." -msgid ":rfc:`2045` defines a message's default type to be :mimetype:`text/plain` unless it appears inside a :mimetype:`multipart/digest` container, in which case it would be :mimetype:`message/rfc822`. If the :mailheader:`Content-Type` header has an invalid type specification, :rfc:`2045` mandates that the default type be :mimetype:`text/plain`." -msgstr "" +msgid "" +":rfc:`2045` defines a message's default type to be :mimetype:`text/plain` " +"unless it appears inside a :mimetype:`multipart/digest` container, in which " +"case it would be :mimetype:`message/rfc822`. If the :mailheader:`Content-" +"Type` header has an invalid type specification, :rfc:`2045` mandates that " +"the default type be :mimetype:`text/plain`." +msgstr "" +":rfc:`2045` نوع پیش‌فرض یک پیام را :mimetype:`text/plain` تعریف می‌کند، مگر " +"آنکه درون یک ظرف :mimetype:`multipart/digest` قرار داشته باشد، که در این " +"صورت :mimetype:`message/rfc822` خواهد بود. اگر سرآیند :mailheader:`Content-" +"Type` دارای مشخصه‌ی نوع نامعتبر باشد، :rfc:`2045` الزام می‌کند که نوع " +"پیش‌فرض :mimetype:`text/plain` باشد." -msgid "Return the message's main content type. This is the :mimetype:`maintype` part of the string returned by :meth:`get_content_type`." +msgid "" +"Return the message's main content type. This is the :mimetype:`maintype` " +"part of the string returned by :meth:`get_content_type`." msgstr "" +"نوع محتوای اصلی پیام را برمی‌گرداند. این بخش :mimetype:`maintype` از رشته‌ای" +" است که :meth:`get_content_type` برمی‌گرداند." -msgid "Return the message's sub-content type. This is the :mimetype:`subtype` part of the string returned by :meth:`get_content_type`." +msgid "" +"Return the message's sub-content type. This is the :mimetype:`subtype` part" +" of the string returned by :meth:`get_content_type`." msgstr "" +"زیرنوع محتوای پیام را برمی‌گرداند. این، بخش :mimetype:`subtype` از رشته‌ای " +"است که توسط :meth:`get_content_type` برگردانده می‌شود." -msgid "Return the default content type. Most messages have a default content type of :mimetype:`text/plain`, except for messages that are subparts of :mimetype:`multipart/digest` containers. Such subparts have a default content type of :mimetype:`message/rfc822`." +msgid "" +"Return the default content type. Most messages have a default content type " +"of :mimetype:`text/plain`, except for messages that are subparts of " +":mimetype:`multipart/digest` containers. Such subparts have a default " +"content type of :mimetype:`message/rfc822`." msgstr "" +"نوع محتوای پیش‌فرض را برمی‌گرداند. بیشتر پیام‌ها نوع محتوای پیش‌فرض " +":mimetype:`text/plain` دارند، به‌جز پیام‌هایی که زیربخش‌هایی از ظرف‌های " +":mimetype:`multipart/digest` هستند. چنین زیربخش‌هایی نوع محتوای پیش‌فرض " +":mimetype:`message/rfc822` دارند." -msgid "Set the default content type. *ctype* should either be :mimetype:`text/plain` or :mimetype:`message/rfc822`, although this is not enforced. The default content type is not stored in the :mailheader:`Content-Type` header." +msgid "" +"Set the default content type. *ctype* should either be " +":mimetype:`text/plain` or :mimetype:`message/rfc822`, although this is not " +"enforced. The default content type is not stored in the " +":mailheader:`Content-Type` header." msgstr "" +"نوع محتوای پیش‌فرض را تنظیم کنید. *ctype* باید یکی از :mimetype:`text/plain`" +" یا :mimetype:`message/rfc822` باشد، اگرچه این موضوع اعمال نمی‌شود. نوع " +"محتوای پیش‌فرض در سرآیند :mailheader:`Content-Type` ذخیره نمی‌شود." -msgid "Return the message's :mailheader:`Content-Type` parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as split on the ``'='`` sign. The left hand side of the ``'='`` is the key, while the right hand side is the value. If there is no ``'='`` sign in the parameter the value is the empty string, otherwise the value is as described in :meth:`get_param` and is unquoted if optional *unquote* is ``True`` (the default)." -msgstr "" +msgid "" +"Return the message's :mailheader:`Content-Type` parameters, as a list. The " +"elements of the returned list are 2-tuples of key/value pairs, as split on " +"the ``'='`` sign. The left hand side of the ``'='`` is the key, while the " +"right hand side is the value. If there is no ``'='`` sign in the parameter " +"the value is the empty string, otherwise the value is as described in " +":meth:`get_param` and is unquoted if optional *unquote* is ``True`` (the " +"default)." +msgstr "" +"پارامترهای :mailheader:`Content-Type` پیام را به‌صورت یک فهرست بازمی‌گرداند." +" عناصر فهرست برگردانده‌شده تاپل‌های دوتایی از جفت‌های کلید/مقدار هستند که بر" +" اساس علامت ``'='`` تفکیک شده‌اند. سمت چپ علامت ``'='`` کلید است، در حالی که" +" سمت راست آن مقدار است. اگر علامت ``'='`` در پارامتر وجود نداشته باشد، مقدار" +" یک رشته خالی است؛ در غیر این صورت مقدار همان‌گونه است که در " +":meth:`get_param` توضیح داده شده است و اگر پارامتر اختیاری *unquote* برابر " +"``True`` باشد (پیش‌فرض)، بدون علامت نقل‌قول می‌شود." -msgid "Optional *failobj* is the object to return if there is no :mailheader:`Content-Type` header. Optional *header* is the header to search instead of :mailheader:`Content-Type`." +msgid "" +"Optional *failobj* is the object to return if there is no " +":mailheader:`Content-Type` header. Optional *header* is the header to " +"search instead of :mailheader:`Content-Type`." msgstr "" +"*failobj* اختیاری، شیءای است که اگر سرآیند :mailheader:`Content-Type` وجود " +"نداشته باشد، بازگردانده می‌شود. *header* اختیاری، سرآیندی است که به‌جای " +":mailheader:`Content-Type` جستجو می‌شود." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by the *params* property of the individual header objects returned by the header access methods." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the *params* property of the individual " +"header objects returned by the header access methods." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با ویژگی *params* اشیای سرآیند جداگانه‌ای که توسط متدهای دسترسی به سرآیند" +" برگردانده می‌شوند، جایگزین شده است." -msgid "Return the value of the :mailheader:`Content-Type` header's parameter *param* as a string. If the message has no :mailheader:`Content-Type` header or if there is no such parameter, then *failobj* is returned (defaults to ``None``)." +msgid "" +"Return the value of the :mailheader:`Content-Type` header's parameter " +"*param* as a string. If the message has no :mailheader:`Content-Type` " +"header or if there is no such parameter, then *failobj* is returned " +"(defaults to ``None``)." msgstr "" +"مقدار پارامتر *param* از سرآیند :mailheader:`Content-Type` را به‌صورت یک رشته" +" برمی‌گرداند. اگر پیام سرآیند :mailheader:`Content-Type` نداشته باشد یا چنین " +"پارامتری وجود نداشته باشد، *failobj* برگردانده می‌شود (پیش‌فرض آن ``None`` " +"است)." -msgid "Optional *header* if given, specifies the message header to use instead of :mailheader:`Content-Type`." +msgid "" +"Optional *header* if given, specifies the message header to use instead of " +":mailheader:`Content-Type`." msgstr "" +"*header* اختیاری، در صورت داده شدن، سرآیند پیامی را مشخص می‌کند که به‌جای " +":mailheader:`Content-Type` استفاده می‌شود." -msgid "Parameter keys are always compared case insensitively. The return value can either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded. When it's a 3-tuple, the elements of the value are of the form ``(CHARSET, LANGUAGE, VALUE)``. Note that both ``CHARSET`` and ``LANGUAGE`` can be ``None``, in which case you should consider ``VALUE`` to be encoded in the ``us-ascii`` charset. You can usually ignore ``LANGUAGE``." -msgstr "" +msgid "" +"Parameter keys are always compared case insensitively. The return value can" +" either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded." +" When it's a 3-tuple, the elements of the value are of the form ``(CHARSET," +" LANGUAGE, VALUE)``. Note that both ``CHARSET`` and ``LANGUAGE`` can be " +"``None``, in which case you should consider ``VALUE`` to be encoded in the " +"``us-ascii`` charset. You can usually ignore ``LANGUAGE``." +msgstr "" +"کلیدهای پارامتر همیشه بدون حساسیت به بزرگی و کوچکی حروف مقایسه می‌شوند. " +"مقدار بازگشتی می‌تواند یک رشته باشد، یا یک تاپل سه‌تایی در صورتی که پارامتر " +"مطابق :rfc:`2231` کدگذاری شده باشد. هنگامی که یک تاپل سه‌تایی باشد، عناصر " +"مقدار به شکل ``(CHARSET, LANGUAGE, VALUE)`` هستند. توجه داشته باشید که هر دو" +" ``CHARSET`` و ``LANGUAGE`` می‌توانند ``None`` باشند، که در این صورت باید " +"فرض کنید ``VALUE`` با مجموعه‌نویسه ``us-ascii`` کدگذاری شده است. معمولاً " +"می‌توانید ``LANGUAGE`` را نادیده بگیرید." -msgid "If your application doesn't care whether the parameter was encoded as in :rfc:`2231`, you can collapse the parameter value by calling :func:`email.utils.collapse_rfc2231_value`, passing in the return value from :meth:`get_param`. This will return a suitably decoded Unicode string when the value is a tuple, or the original string unquoted if it isn't. For example::" -msgstr "" +msgid "" +"If your application doesn't care whether the parameter was encoded as in " +":rfc:`2231`, you can collapse the parameter value by calling " +":func:`email.utils.collapse_rfc2231_value`, passing in the return value from" +" :meth:`get_param`. This will return a suitably decoded Unicode string when" +" the value is a tuple, or the original string unquoted if it isn't. For " +"example::" +msgstr "" +"اگر برای برنامه‌ی شما اهمیتی ندارد که پارامتر مطابق :rfc:`2231` کدگذاری شده " +"باشد، می‌توانید با فراخوانی :func:`email.utils.collapse_rfc2231_value` و " +"ارسال مقدار بازگشتی از :meth:`get_param`، مقدار پارامتر را یکپارچه کنید. این" +" تابع، هنگامی که مقدار یک تاپل باشد، یک رشته‌ی Unicode را که به‌طور مناسب " +"کدگشایی شده است برمی‌گرداند، یا در غیر این صورت رشته‌ی اصلی بدون علامت " +"نقل‌قول را برمی‌گرداند. برای مثال::" msgid "" "rawparam = msg.get_param('foo')\n" "param = email.utils.collapse_rfc2231_value(rawparam)" msgstr "" +"rawparam = msg.get_param('foo')\n" +"param = email.utils.collapse_rfc2231_value(rawparam)" -msgid "In any case, the parameter value (either the returned string, or the ``VALUE`` item in the 3-tuple) is always unquoted, unless *unquote* is set to ``False``." +msgid "" +"In any case, the parameter value (either the returned string, or the " +"``VALUE`` item in the 3-tuple) is always unquoted, unless *unquote* is set " +"to ``False``." msgstr "" +"در هر صورت، مقدار پارامتر (چه رشته‌ی برگردانده‌شده، چه آیتم ``VALUE`` در " +"۳-تایی) همیشه بدون علامت نقل‌قول است، مگر اینکه *unquote* روی ``False`` " +"تنظیم شده باشد." -msgid "Set a parameter in the :mailheader:`Content-Type` header. If the parameter already exists in the header, its value will be replaced with *value*. If the :mailheader:`Content-Type` header as not yet been defined for this message, it will be set to :mimetype:`text/plain` and the new parameter value will be appended as per :rfc:`2045`." -msgstr "" +msgid "" +"Set a parameter in the :mailheader:`Content-Type` header. If the parameter " +"already exists in the header, its value will be replaced with *value*. If " +"the :mailheader:`Content-Type` header as not yet been defined for this " +"message, it will be set to :mimetype:`text/plain` and the new parameter " +"value will be appended as per :rfc:`2045`." +msgstr "" +"پارامتری را در سرآیند :mailheader:`Content-Type` تنظیم کنید. اگر پارامتر از " +"قبل در سرآیند وجود داشته باشد، مقدار آن با *value* جایگزین خواهد شد. اگر " +"سرآیند :mailheader:`Content-Type` هنوز برای این پیام تعریف‌نشده باشد، به " +":mimetype:`text/plain` تنظیم خواهد شد و مقدار پارامتر جدید مطابق :rfc:`2045`" +" افزوده خواهد شد." -msgid "Optional *header* specifies an alternative header to :mailheader:`Content-Type`, and all parameters will be quoted as necessary unless optional *requote* is ``False`` (the default is ``True``)." +msgid "" +"Optional *header* specifies an alternative header to :mailheader:`Content-" +"Type`, and all parameters will be quoted as necessary unless optional " +"*requote* is ``False`` (the default is ``True``)." msgstr "" +"*header* اختیاری یک سرآیند جایگزین به‌جای :mailheader:`Content-Type` مشخص " +"می‌کند، و همه‌ی پارامترها در صورت لزوم داخل علامت نقل‌قول قرار می‌گیرند، مگر " +"آنکه *requote* اختیاری ``False`` باشد (پیش‌فرض ``True`` است)." -msgid "If optional *charset* is specified, the parameter will be encoded according to :rfc:`2231`. Optional *language* specifies the RFC 2231 language, defaulting to the empty string. Both *charset* and *language* should be strings." +msgid "" +"If optional *charset* is specified, the parameter will be encoded according " +"to :rfc:`2231`. Optional *language* specifies the RFC 2231 language, " +"defaulting to the empty string. Both *charset* and *language* should be " +"strings." msgstr "" +"اگر *charset* اختیاری مشخص شده باشد، پارامتر مطابق :rfc:`2231` کدگذاری خواهد" +" شد. *language* اختیاری، زبان RFC 2231 را مشخص می‌کند و مقدار پیش‌فرض آن " +"رشته خالی است. هر دو *charset* و *language* باید رشته باشند." -msgid "If *replace* is ``False`` (the default) the header is moved to the end of the list of headers. If *replace* is ``True``, the header will be updated in place." +msgid "" +"If *replace* is ``False`` (the default) the header is moved to the end of " +"the list of headers. If *replace* is ``True``, the header will be updated " +"in place." msgstr "" +"اگر *replace* برابر ``False`` باشد (حالت پیش‌فرض)، سرآیند به انتهای فهرست " +"سرآیندها منتقل می‌شود. اگر *replace* برابر ``True`` باشد، سرآیند در همان محل " +"به‌روزرسانی می‌شود." msgid "``replace`` keyword was added." -msgstr "" +msgstr "کلیدواژه‌ی ``replace`` افزوده شد." -msgid "Remove the given parameter completely from the :mailheader:`Content-Type` header. The header will be re-written in place without the parameter or its value. All values will be quoted as necessary unless *requote* is ``False`` (the default is ``True``). Optional *header* specifies an alternative to :mailheader:`Content-Type`." -msgstr "" +msgid "" +"Remove the given parameter completely from the :mailheader:`Content-Type` " +"header. The header will be re-written in place without the parameter or its" +" value. All values will be quoted as necessary unless *requote* is " +"``False`` (the default is ``True``). Optional *header* specifies an " +"alternative to :mailheader:`Content-Type`." +msgstr "" +"پارامتر داده‌شده را به‌طور کامل از سرآیند :mailheader:`Content-Type` حذف " +"می‌کند. سرآیند به‌صورت درجا بدون پارامتر یا مقدار آن بازنویسی خواهد شد. همه " +"مقادیر در صورت لزوم داخل علامت نقل‌قول قرار می‌گیرند، مگر اینکه *requote* " +"``False`` باشد (پیش‌فرض ``True`` است). پارامتر اختیاری *header*، جایگزینی " +"برای :mailheader:`Content-Type` مشخص می‌کند." -msgid "Set the main type and subtype for the :mailheader:`Content-Type` header. *type* must be a string in the form :mimetype:`maintype/subtype`, otherwise a :exc:`ValueError` is raised." +msgid "" +"Set the main type and subtype for the :mailheader:`Content-Type` header. " +"*type* must be a string in the form :mimetype:`maintype/subtype`, otherwise " +"a :exc:`ValueError` is raised." msgstr "" +"نوع اصلی و نوع فرعی را برای سرآیند :mailheader:`Content-Type` تنظیم کنید. " +"*type* باید رشته‌ای به شکل :mimetype:`maintype/subtype` باشد، در غیر این " +"صورت یک :exc:`ValueError` پرتاب می‌شود." -msgid "This method replaces the :mailheader:`Content-Type` header, keeping all the parameters in place. If *requote* is ``False``, this leaves the existing header's quoting as is, otherwise the parameters will be quoted (the default)." +msgid "" +"This method replaces the :mailheader:`Content-Type` header, keeping all the " +"parameters in place. If *requote* is ``False``, this leaves the existing " +"header's quoting as is, otherwise the parameters will be quoted (the " +"default)." msgstr "" +"این متد سرآیند :mailheader:`Content-Type` را جایگزین می‌کند و تمام پارامترها" +" را در جای خود نگه می‌دارد. اگر *requote* برابر ``False`` باشد، نقل‌قول " +"سرآیند موجود همان‌طور که هست باقی می‌ماند، در غیر این صورت پارامترها داخل " +"علامت نقل‌قول قرار می‌گیرند (حالت پیش‌فرض)." -msgid "An alternative header can be specified in the *header* argument. When the :mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header is also added." +msgid "" +"An alternative header can be specified in the *header* argument. When the " +":mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header" +" is also added." msgstr "" +"می‌توان یک سرآیند جایگزین را در آرگومان *header* مشخص کرد. هنگامی که سرآیند " +":mailheader:`Content-Type` تنظیم شود، سرآیند :mailheader:`MIME-Version` نیز " +"اضافه می‌شود." -msgid "This is a legacy method. On the :class:`~email.message.EmailMessage` class its functionality is replaced by the ``make_`` and ``add_`` methods." +msgid "" +"This is a legacy method. On the :class:`~email.message.EmailMessage` class " +"its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" +"این یک متد قدیمی است. در کلاس :class:`~email.message.EmailMessage`، عملکرد " +"آن با متدهای ``make_`` و ``add_`` جایگزین شده است." -msgid "Return the value of the ``filename`` parameter of the :mailheader:`Content-Disposition` header of the message. If the header does not have a ``filename`` parameter, this method falls back to looking for the ``name`` parameter on the :mailheader:`Content-Type` header. If neither is found, or the header is missing, then *failobj* is returned. The returned string will always be unquoted as per :func:`email.utils.unquote`." -msgstr "" +msgid "" +"Return the value of the ``filename`` parameter of the :mailheader:`Content-" +"Disposition` header of the message. If the header does not have a " +"``filename`` parameter, this method falls back to looking for the ``name`` " +"parameter on the :mailheader:`Content-Type` header. If neither is found, or" +" the header is missing, then *failobj* is returned. The returned string will" +" always be unquoted as per :func:`email.utils.unquote`." +msgstr "" +"مقدار پارامتر ``filename`` از سرآیند :mailheader:`Content-Disposition` پیام " +"را برمی‌گرداند. اگر سرآیند پارامتر ``filename`` نداشته باشد، این متد به‌عنوان" +" جایگزین پارامتر ``name`` را در سرآیند :mailheader:`Content-Type` جست‌وجو " +"می‌کند. اگر هیچ‌کدام پیدا نشود یا سرآیند وجود نداشته باشد، *failobj* " +"برگردانده می‌شود. رشته‌ی برگردانده‌شده همیشه مطابق " +":func:`email.utils.unquote` بدون علامت نقل‌قول خواهد بود." -msgid "Return the value of the ``boundary`` parameter of the :mailheader:`Content-Type` header of the message, or *failobj* if either the header is missing, or has no ``boundary`` parameter. The returned string will always be unquoted as per :func:`email.utils.unquote`." +msgid "" +"Return the value of the ``boundary`` parameter of the :mailheader:`Content-" +"Type` header of the message, or *failobj* if either the header is missing, " +"or has no ``boundary`` parameter. The returned string will always be " +"unquoted as per :func:`email.utils.unquote`." msgstr "" +"مقدار پارامتر ``boundary`` در سرآیند :mailheader:`Content-Type` پیام را " +"بازمی‌گرداند، یا اگر سرآیند وجود نداشته باشد یا پارامتر ``boundary`` نداشته " +"باشد، *failobj* را بازمی‌گرداند. رشته‌ی بازگشتی همیشه طبق " +":func:`email.utils.unquote` بدون علامت نقل‌قول خواهد بود." -msgid "Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to *boundary*. :meth:`set_boundary` will always quote *boundary* if necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message object has no :mailheader:`Content-Type` header." +msgid "" +"Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " +"*boundary*. :meth:`set_boundary` will always quote *boundary* if necessary." +" A :exc:`~email.errors.HeaderParseError` is raised if the message object " +"has no :mailheader:`Content-Type` header." msgstr "" +"پارامتر ``boundary`` در سرآیند :mailheader:`Content-Type` را روی *boundary* " +"تنظیم کنید. :meth:`set_boundary` همیشه در صورت لزوم *boundary* را داخل علامت" +" نقل‌قول قرار می‌دهد. اگر شیء پیام فاقد سرآیند :mailheader:`Content-Type` " +"باشد، یک :exc:`~email.errors.HeaderParseError` پرتاب می‌شود." -msgid "Note that using this method is subtly different than deleting the old :mailheader:`Content-Type` header and adding a new one with the new boundary via :meth:`add_header`, because :meth:`set_boundary` preserves the order of the :mailheader:`Content-Type` header in the list of headers. However, it does *not* preserve any continuation lines which may have been present in the original :mailheader:`Content-Type` header." -msgstr "" +msgid "" +"Note that using this method is subtly different than deleting the old " +":mailheader:`Content-Type` header and adding a new one with the new boundary" +" via :meth:`add_header`, because :meth:`set_boundary` preserves the order of" +" the :mailheader:`Content-Type` header in the list of headers. However, it " +"does *not* preserve any continuation lines which may have been present in " +"the original :mailheader:`Content-Type` header." +msgstr "" +"توجه داشته باشید که استفاده از این متد به‌طور ظریفی با حذف سرآیند قدیمی " +":mailheader:`Content-Type` و افزودن یک سرآیند جدید با مرز جدید (boundary) از " +"طریق :meth:`add_header` متفاوت است، زیرا :meth:`set_boundary` ترتیب سرآیند " +":mailheader:`Content-Type` را در فهرست سرآیندها حفظ می‌کند. با این حال، این " +"کار هیچ‌یک از خط‌های ادامه‌ای را که ممکن است در سرآیند اصلی " +":mailheader:`Content-Type` وجود داشته باشد، حفظ *نمی‌کند*." -msgid "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, coerced to lower case. If there is no :mailheader:`Content-Type` header, or if that header has no ``charset`` parameter, *failobj* is returned." +msgid "" +"Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " +"coerced to lower case. If there is no :mailheader:`Content-Type` header, or" +" if that header has no ``charset`` parameter, *failobj* is returned." msgstr "" +"پارامتر ``charset`` سرآیند :mailheader:`Content-Type` را به‌صورت حروف کوچک " +"برمی‌گرداند. اگر سرآیند :mailheader:`Content-Type` وجود نداشته باشد، یا اگر " +"آن سرآیند پارامتر ``charset`` نداشته باشد، *failobj* برگردانده می‌شود." -msgid "Note that this method differs from :meth:`get_charset` which returns the :class:`~email.charset.Charset` instance for the default encoding of the message body." +msgid "" +"Note that this method differs from :meth:`get_charset` which returns the " +":class:`~email.charset.Charset` instance for the default encoding of the " +"message body." msgstr "" +"توجه داشته باشید که این متد با :meth:`get_charset` متفاوت است، که نمونه‌ی " +":class:`~email.charset.Charset` را برای کدگذاری پیش‌فرض بدنه‌ی پیام " +"برمی‌گرداند." -msgid "Return a list containing the character set names in the message. If the message is a :mimetype:`multipart`, then the list will contain one element for each subpart in the payload, otherwise, it will be a list of length 1." +msgid "" +"Return a list containing the character set names in the message. If the " +"message is a :mimetype:`multipart`, then the list will contain one element " +"for each subpart in the payload, otherwise, it will be a list of length 1." msgstr "" +"فهرستی شامل نام مجموعه‌نویسه‌های موجود در پیام برمی‌گرداند. اگر پیام از نوع " +":mimetype:`multipart` باشد، فهرست شامل یک المان به‌ازای هر زیربخش در بار " +"(payload) خواهد بود، در غیر این صورت، فهرستی به طول ۱ خواهد بود." -msgid "Each item in the list will be a string which is the value of the ``charset`` parameter in the :mailheader:`Content-Type` header for the represented subpart. However, if the subpart has no :mailheader:`Content-Type` header, no ``charset`` parameter, or is not of the :mimetype:`text` main MIME type, then that item in the returned list will be *failobj*." -msgstr "" +msgid "" +"Each item in the list will be a string which is the value of the ``charset``" +" parameter in the :mailheader:`Content-Type` header for the represented " +"subpart. However, if the subpart has no :mailheader:`Content-Type` header, " +"no ``charset`` parameter, or is not of the :mimetype:`text` main MIME type, " +"then that item in the returned list will be *failobj*." +msgstr "" +"هر آیتم در فهرست رشته‌ای خواهد بود که مقدار پارامتر ``charset`` در سرآیند " +":mailheader:`Content-Type` برای زیربخش بازنمایی‌شده است. با این حال، اگر " +"زیربخش فاقد سرآیند :mailheader:`Content-Type` یا فاقد پارامتر ``charset`` " +"باشد، یا از نوع اصلی MIME :mimetype:`text` نباشد، آن آیتم در فهرست " +"برگردانده‌شده *failobj* خواهد بود." -msgid "Return the lowercased value (without parameters) of the message's :mailheader:`Content-Disposition` header if it has one, or ``None``. The possible values for this method are *inline*, *attachment* or ``None`` if the message follows :rfc:`2183`." +msgid "" +"Return the lowercased value (without parameters) of the message's " +":mailheader:`Content-Disposition` header if it has one, or ``None``. The " +"possible values for this method are *inline*, *attachment* or ``None`` if " +"the message follows :rfc:`2183`." msgstr "" +"در صورتی که پیام سرآیند :mailheader:`Content-Disposition` داشته باشد، مقدار " +"با حروف کوچک (بدون پارامترها) آن را برمی‌گرداند؛ در غیر این صورت ``None`` را" +" برمی‌گرداند. در صورتی که پیام از :rfc:`2183` پیروی کند، مقادیر ممکن برای " +"این متد *inline*، *attachment* یا ``None`` هستند." -msgid "The :meth:`walk` method is an all-purpose generator which can be used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use :meth:`walk` as the iterator in a ``for`` loop; each iteration returns the next subpart." +msgid "" +"The :meth:`walk` method is an all-purpose generator which can be used to " +"iterate over all the parts and subparts of a message object tree, in depth-" +"first traversal order. You will typically use :meth:`walk` as the iterator " +"in a ``for`` loop; each iteration returns the next subpart." msgstr "" +"متد :meth:`walk` یک تولیدگر همه‌منظوره است که می‌توان از آن برای پیمایش تمام" +" بخش‌ها و زیربخش‌های یک درخت شیء پیام، به ترتیب پیمایش عمق‌اول استفاده کرد. " +"شما معمولاً از :meth:`walk` به عنوان پیمایش‌گر در یک حلقه ``for`` استفاده " +"می‌کنید؛ هر تکرار، زیربخش بعدی را برمی‌گرداند." -msgid "Here's an example that prints the MIME type of every part of a multipart message structure:" +msgid "" +"Here's an example that prints the MIME type of every part of a multipart " +"message structure:" msgstr "" +"در اینجا مثالی آمده است که نوع MIME هر بخش از یک ساختار پیام چندبخشی را چاپ " +"می‌کند:" msgid "" ">>> for part in msg.walk():\n" @@ -364,9 +1107,26 @@ msgid "" "message/rfc822\n" "text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" -msgid "``walk`` iterates over the subparts of any part where :meth:`is_multipart` returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` may return ``False``. We can see this in our example by making use of the ``_structure`` debug helper function:" +msgid "" +"``walk`` iterates over the subparts of any part where :meth:`is_multipart` " +"returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " +"may return ``False``. We can see this in our example by making use of the " +"``_structure`` debug helper function:" msgstr "" +"``walk`` روی زیربخش‌های هر بخشی که :meth:`is_multipart` مقدار ``True`` " +"برمی‌گرداند، پیمایش می‌کند، هرچند ممکن است ``msg.get_content_maintype() == " +"'multipart'`` مقدار ``False`` برگرداند. می‌توانیم این را در مثال خود با " +"استفاده از تابع کمکی اشکال‌زدایی ``_structure`` ببینیم:" msgid "" ">>> for part in msg.walk():\n" @@ -388,27 +1148,102 @@ msgid "" " message/rfc822\n" " text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" -msgid "Here the ``message`` parts are not ``multiparts``, but they do contain subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the subparts." +msgid "" +"Here the ``message`` parts are not ``multiparts``, but they do contain " +"subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the" +" subparts." msgstr "" +"در اینجا بخش‌های ``message``، ``multiparts`` نیستند، اما حاوی زیربخش‌هایی " +"هستند. ``is_multipart()`` مقدار ``True`` را برمی‌گرداند و ``walk`` وارد " +"زیربخش‌ها می‌شود." -msgid ":class:`Message` objects can also optionally contain two instance attributes, which can be used when generating the plain text of a MIME message." +msgid "" +":class:`Message` objects can also optionally contain two instance " +"attributes, which can be used when generating the plain text of a MIME " +"message." msgstr "" +"اشیای :class:`Message` همچنین می‌توانند به‌صورت اختیاری دارای دو ویژگی نمونه" +" باشند، که می‌توان از آن‌ها هنگام تولید متن ساده یک پیام MIME استفاده کرد." -msgid "The format of a MIME document allows for some text between the blank line following the headers, and the first multipart boundary string. Normally, this text is never visible in a MIME-aware mail reader because it falls outside the standard MIME armor. However, when viewing the raw text of the message, or when viewing the message in a non-MIME aware reader, this text can become visible." -msgstr "" +msgid "" +"The format of a MIME document allows for some text between the blank line " +"following the headers, and the first multipart boundary string. Normally, " +"this text is never visible in a MIME-aware mail reader because it falls " +"outside the standard MIME armor. However, when viewing the raw text of the " +"message, or when viewing the message in a non-MIME aware reader, this text " +"can become visible." +msgstr "" +"قالب یک سند MIME اجازه می‌دهد که مقداری متن میان خط خالی پس از سرصفحه‌ها و " +"نخستین رشته‌ی مرزی چندبخشی وجود داشته باشد. به‌طور معمول، این متن در یک " +"نامه‌خوان آگاه از MIME هرگز قابل مشاهده نیست، زیرا خارج از پوشش استاندارد " +"MIME قرار دارد. با این حال، هنگام مشاهده‌ی متن خام پیام، یا هنگام مشاهده‌ی " +"پیام در نامه‌خوانی که از MIME آگاه نیست، این متن می‌تواند قابل مشاهده شود." -msgid "The *preamble* attribute contains this leading extra-armor text for MIME documents. When the :class:`~email.parser.Parser` discovers some text after the headers but before the first boundary string, it assigns this text to the message's *preamble* attribute. When the :class:`~email.generator.Generator` is writing out the plain text representation of a MIME message, and it finds the message has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details." -msgstr "" +msgid "" +"The *preamble* attribute contains this leading extra-armor text for MIME " +"documents. When the :class:`~email.parser.Parser` discovers some text after" +" the headers but before the first boundary string, it assigns this text to " +"the message's *preamble* attribute. When the " +":class:`~email.generator.Generator` is writing out the plain text " +"representation of a MIME message, and it finds the message has a *preamble* " +"attribute, it will write this text in the area between the headers and the " +"first boundary. See :mod:`email.parser` and :mod:`email.generator` for " +"details." +msgstr "" +"ویژگی *preamble* شامل این متن نگهبان اضافی آغازین (extra-armor) برای اسناد " +"MIME است. هنگامی که :class:`~email.parser.Parser` متنی را پس از سرآیندها اما" +" پیش از نخستین رشته‌ی مرزی پیدا کند، این متن را به ویژگی *preamble* پیام " +"اختصاص می‌دهد. هنگامی که :class:`~email.generator.Generator` در حال نوشتن " +"نمایش متنی ساده‌ی یک پیام MIME است و متوجه شود که پیام دارای ویژگی *preamble*" +" است، این متن را در ناحیه‌ی بین سرآیندها و نخستین مرز می‌نویسد. برای جزئیات، " +":mod:`email.parser` و :mod:`email.generator` را ببینید." -msgid "Note that if the message object has no preamble, the *preamble* attribute will be ``None``." +msgid "" +"Note that if the message object has no preamble, the *preamble* attribute " +"will be ``None``." msgstr "" +"توجه داشته باشید که اگر شیء پیام فاقد *preamble* باشد، ویژگی *preamble* " +"برابر ``None`` خواهد بود." -msgid "The *epilogue* attribute acts the same way as the *preamble* attribute, except that it contains text that appears between the last boundary and the end of the message." +msgid "" +"The *epilogue* attribute acts the same way as the *preamble* attribute, " +"except that it contains text that appears between the last boundary and the " +"end of the message." msgstr "" +"ویژگی *epilogue* مانند ویژگی *preamble* عمل می‌کند، با این تفاوت که شامل " +"متنی است که میان آخرین مرز (boundary) و پایان پیام قرار می‌گیرد." -msgid "You do not need to set the epilogue to the empty string in order for the :class:`~email.generator.Generator` to print a newline at the end of the file." +msgid "" +"You do not need to set the epilogue to the empty string in order for the " +":class:`~email.generator.Generator` to print a newline at the end of the " +"file." msgstr "" +"برای اینکه :class:`~email.generator.Generator` یک خط جدید در پایان فایل چاپ " +"کند، نیازی نیست بخش پایانی (epilogue) را به رشته خالی تنظیم کنید." -msgid "The *defects* attribute contains a list of all the problems found when parsing this message. See :mod:`email.errors` for a detailed description of the possible parsing defects." +msgid "" +"The *defects* attribute contains a list of all the problems found when " +"parsing this message. See :mod:`email.errors` for a detailed description of" +" the possible parsing defects." msgstr "" +"ویژگی *defects* شامل فهرستی از تمام مشکلات یافت‌شده هنگام تجزیه‌ی این پیام " +"است. برای شرح دقیق نقص‌های ممکن در تجزیه، :mod:`email.errors` را ببینید." diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index fd82902e2..a1356f087 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -24,127 +24,345 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.contentmanager`: Managing MIME Content" -msgstr "" +msgstr ":mod:`!email.contentmanager`: مدیریت محتوای MIME" msgid "**Source code:** :source:`Lib/email/contentmanager.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/contentmanager.py`" msgid "[1]_" -msgstr "" +msgstr "[1]_" -msgid "Base class for content managers. Provides the standard registry mechanisms to register converters between MIME content and other representations, as well as the ``get_content`` and ``set_content`` dispatch methods." +msgid "" +"Base class for content managers. Provides the standard registry mechanisms " +"to register converters between MIME content and other representations, as " +"well as the ``get_content`` and ``set_content`` dispatch methods." msgstr "" +"کلاس پایه برای مدیران محتوا. سازوکارهای استاندارد ثبت (registry) برای ثبت " +"مبدل‌ها میان محتوای MIME و سایر نمایش‌ها، و همچنین متدهای اعزام (dispatch) " +"``get_content`` و ``set_content`` را فراهم می‌کند." -msgid "Look up a handler function based on the ``mimetype`` of *msg* (see next paragraph), call it, passing through all arguments, and return the result of the call. The expectation is that the handler will extract the payload from *msg* and return an object that encodes information about the extracted data." -msgstr "" +msgid "" +"Look up a handler function based on the ``mimetype`` of *msg* (see next " +"paragraph), call it, passing through all arguments, and return the result of" +" the call. The expectation is that the handler will extract the payload " +"from *msg* and return an object that encodes information about the extracted" +" data." +msgstr "" +"یک تابع کنترل‌گر را بر اساس ``mimetype`` مربوط به *msg* پیدا کنید (پاراگراف " +"بعدی را ببینید)، آن را با ارسال همه‌ی آرگومان‌ها فراخوانی کنید و نتیجه‌ی " +"فراخوانی را برگردانید. انتظار می‌رود که کنترل‌گر بار (payload) را از " +"*msg* استخراج کند و شیءای را برگرداند که اطلاعاتی درباره‌ی داده‌ی استخراج‌شده " +"را کدگذاری می‌کند." -msgid "To find the handler, look for the following keys in the registry, stopping with the first one found:" +msgid "" +"To find the handler, look for the following keys in the registry, stopping " +"with the first one found:" msgstr "" +"برای یافتن هندلر (handler)، کلیدهای زیر را در رجیستری جستجو کنید و با " +"پیدا شدن اولین مورد، متوقف شوید:" msgid "the string representing the full MIME type (``maintype/subtype``)" -msgstr "" +msgstr "رشته‌ای که نوع کامل MIME را نشان می‌دهد (``maintype/subtype``)" msgid "the string representing the ``maintype``" -msgstr "" +msgstr "رشته‌ی نشان‌دهنده‌ی ``maintype``" msgid "the empty string" -msgstr "" +msgstr "رشته خالی" -msgid "If none of these keys produce a handler, raise a :exc:`KeyError` for the full MIME type." +msgid "" +"If none of these keys produce a handler, raise a :exc:`KeyError` for the " +"full MIME type." msgstr "" +"اگر هیچ‌کدام از این کلیدها یک هندلر (handler) ایجاد نکردند، برای نوع " +"کامل MIME یک :exc:`KeyError` پرتاب کنید." -msgid "If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise look up a handler function based on the type of *obj* (see next paragraph), call :meth:`~email.message.EmailMessage.clear_content` on the *msg*, and call the handler function, passing through all arguments. The expectation is that the handler will transform and store *obj* into *msg*, possibly making other changes to *msg* as well, such as adding various MIME headers to encode information needed to interpret the stored data." -msgstr "" +msgid "" +"If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise " +"look up a handler function based on the type of *obj* (see next paragraph), " +"call :meth:`~email.message.EmailMessage.clear_content` on the *msg*, and " +"call the handler function, passing through all arguments. The expectation " +"is that the handler will transform and store *obj* into *msg*, possibly " +"making other changes to *msg* as well, such as adding various MIME headers " +"to encode information needed to interpret the stored data." +msgstr "" +"اگر ``maintype`` برابر با ``multipart`` باشد، استثنای :exc:`TypeError` پرتاب" +" می‌شود؛ در غیر این صورت، یک تابع هندلر بر اساس نوع *obj* جستجو " +"می‌شود (بند بعدی را ببینید)، " +":meth:`~email.message.EmailMessage.clear_content` روی *msg* فراخوانی می‌شود " +"و تابع هندلر با ارسال تمام آرگومان‌ها فراخوانی می‌شود. انتظار می‌رود " +"که هندلر *obj* را تبدیل کرده و در *msg* ذخیره کند، و احتمالاً تغییرات" +" دیگری نیز در *msg* اعمال کند، مانند افزودن سرآیندهای MIME مختلف برای " +"کدگذاری اطلاعات لازم برای تفسیر داده‌ی ذخیره‌شده." -msgid "To find the handler, obtain the type of *obj* (``typ = type(obj)``), and look for the following keys in the registry, stopping with the first one found:" +msgid "" +"To find the handler, obtain the type of *obj* (``typ = type(obj)``), and " +"look for the following keys in the registry, stopping with the first one " +"found:" msgstr "" +"برای یافتن مدیر، نوع *obj* را به دست آورید (``typ = type(obj)``) و در " +"رجیستری به دنبال کلیدهای زیر بگردید و با نخستین کلید یافت‌شده متوقف شوید:" msgid "the type itself (``typ``)" -msgstr "" +msgstr "خودِ نوع (``typ``)" -msgid "the type's fully qualified name (``typ.__module__ + '.' + typ.__qualname__``)." -msgstr "" +msgid "" +"the type's fully qualified name (``typ.__module__ + '.' + " +"typ.__qualname__``)." +msgstr "نام کامل مشخص نوع (``typ.__module__ + '.' + typ.__qualname__``)." msgid "the type's :attr:`qualname ` (``typ.__qualname__``)" -msgstr "" +msgstr ":attr:`qualname ` نوع (``typ.__qualname__``)" msgid "the type's :attr:`name ` (``typ.__name__``)." -msgstr "" +msgstr ":attr:`name `\\ نوع (``typ.__name__``)." -msgid "If none of the above match, repeat all of the checks above for each of the types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if no other key yields a handler, check for a handler for the key ``None``. If there is no handler for ``None``, raise a :exc:`KeyError` for the fully qualified name of the type." -msgstr "" +msgid "" +"If none of the above match, repeat all of the checks above for each of the " +"types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if " +"no other key yields a handler, check for a handler for the key ``None``. If" +" there is no handler for ``None``, raise a :exc:`KeyError` for the fully " +"qualified name of the type." +msgstr "" +"اگر هیچ‌یک از موارد بالا مطابقت نداشت، تمام بررسی‌های بالا را برای هر یک از " +"انواع موجود در :term:`MRO` (:attr:`typ.__mro__ `) تکرار کنید. " +"در نهایت، اگر هیچ کلید دیگری مدیری را برنگرداند، بررسی کنید که آیا مدیری " +"برای کلید ``None`` وجود دارد. اگر مدیری برای ``None`` وجود نداشت، " +":exc:`KeyError` را برای نام کامل نوع پرتاب کنید." -msgid "Also add a :mailheader:`MIME-Version` header if one is not present (see also :class:`.MIMEPart`)." +msgid "" +"Also add a :mailheader:`MIME-Version` header if one is not present (see also" +" :class:`.MIMEPart`)." msgstr "" +"همچنین اگر سرآیند :mailheader:`MIME-Version` وجود ندارد، آن را اضافه کنید " +"(همچنین :class:`.MIMEPart` را ببینید)." -msgid "Record the function *handler* as the handler for *key*. For the possible values of *key*, see :meth:`get_content`." +msgid "" +"Record the function *handler* as the handler for *key*. For the possible " +"values of *key*, see :meth:`get_content`." msgstr "" +"تابع *handler* را به‌عنوان هندلر (handler) برای *key* ثبت کنید. برای " +"مقادیر ممکن *key*، :meth:`get_content` را ببینید." -msgid "Record *handler* as the function to call when an object of a type matching *typekey* is passed to :meth:`set_content`. For the possible values of *typekey*, see :meth:`set_content`." +msgid "" +"Record *handler* as the function to call when an object of a type matching " +"*typekey* is passed to :meth:`set_content`. For the possible values of " +"*typekey*, see :meth:`set_content`." msgstr "" +"*handler* را به‌عنوان تابعی ثبت کنید که هنگام ارسال شیءای از نوع مطابق با " +"*typekey* به :meth:`set_content` فراخوانی می‌شود. برای مقادیر ممکن " +"*typekey*، :meth:`set_content` را ببینید." msgid "Content Manager Instances" -msgstr "" +msgstr "نمونه‌های مدیر محتوا (Content Manager)" -msgid "Currently the email package provides only one concrete content manager, :data:`raw_data_manager`, although more may be added in the future. :data:`raw_data_manager` is the :attr:`~email.policy.EmailPolicy.content_manager` provided by :attr:`~email.policy.EmailPolicy` and its derivatives." -msgstr "" +msgid "" +"Currently the email package provides only one concrete content manager, " +":data:`raw_data_manager`, although more may be added in the future. " +":data:`raw_data_manager` is the " +":attr:`~email.policy.EmailPolicy.content_manager` provided by " +":attr:`~email.policy.EmailPolicy` and its derivatives." +msgstr "" +"در حال حاضر بسته‌ی email تنها یک مدیر محتوای عینی (concrete content manager)،" +" :data:`raw_data_manager`، ارائه می‌دهد، هرچند ممکن است در آینده موارد " +"بیشتری افزوده شوند. :data:`raw_data_manager` همان " +":attr:`~email.policy.EmailPolicy.content_manager` ارائه‌شده از سوی " +":attr:`~email.policy.EmailPolicy` و مشتقات آن است." -msgid "This content manager provides only a minimum interface beyond that provided by :class:`~email.message.Message` itself: it deals only with text, raw byte strings, and :class:`~email.message.Message` objects. Nevertheless, it provides significant advantages compared to the base API: ``get_content`` on a text part will return a unicode string without the application needing to manually decode it, ``set_content`` provides a rich set of options for controlling the headers added to a part and controlling the content transfer encoding, and it enables the use of the various ``add_`` methods, thereby simplifying the creation of multipart messages." -msgstr "" +msgid "" +"This content manager provides only a minimum interface beyond that provided " +"by :class:`~email.message.Message` itself: it deals only with text, raw " +"byte strings, and :class:`~email.message.Message` objects. Nevertheless, it" +" provides significant advantages compared to the base API: ``get_content`` " +"on a text part will return a unicode string without the application needing " +"to manually decode it, ``set_content`` provides a rich set of options for " +"controlling the headers added to a part and controlling the content transfer" +" encoding, and it enables the use of the various ``add_`` methods, thereby " +"simplifying the creation of multipart messages." +msgstr "" +"این مدیر محتوا تنها حداقل رابطی را فراتر از آنچه خود " +":class:`~email.message.Message` فراهم می‌کند، ارائه می‌دهد: این مدیر فقط با " +"متن، رشته‌های بایت خام و اشیاء :class:`~email.message.Message` سروکار دارد. " +"با این حال، مزایای قابل‌توجهی نسبت به API پایه فراهم می‌کند: ``get_content``" +" روی یک بخش متنی، یک رشته یونیکد را برمی‌گرداند، بدون اینکه برنامه نیاز " +"داشته باشد آن را به‌صورت دستی کدگشایی کند؛ ``set_content`` مجموعه‌ای غنی از " +"گزینه‌ها را برای کنترل سرصفحه‌های افزوده‌شده به یک بخش و کنترل کدگذاری " +"انتقال محتوا فراهم می‌کند، و استفاده از متدهای مختلف ``add_`` را ممکن " +"می‌سازد و بدین ترتیب ایجاد پیام‌های چندبخشی را ساده‌تر می‌کند." -msgid "Return the payload of the part as either a string (for ``text`` parts), an :class:`~email.message.EmailMessage` object (for ``message/rfc822`` parts), or a ``bytes`` object (for all other non-multipart types). Raise a :exc:`KeyError` if called on a ``multipart``. If the part is a ``text`` part and *errors* is specified, use it as the error handler when decoding the payload to unicode. The default error handler is ``replace``." -msgstr "" +msgid "" +"Return the payload of the part as either a string (for ``text`` parts), an " +":class:`~email.message.EmailMessage` object (for ``message/rfc822`` parts), " +"or a ``bytes`` object (for all other non-multipart types). Raise a " +":exc:`KeyError` if called on a ``multipart``. If the part is a ``text`` " +"part and *errors* is specified, use it as the error handler when decoding " +"the payload to unicode. The default error handler is ``replace``." +msgstr "" +"بار این بخش را به‌صورت یک رشته (برای بخش‌های ``text``)، یک شیء " +":class:`~email.message.EmailMessage` (برای بخش‌های ``message/rfc822``)، یا " +"یک شیء ``bytes`` (برای همه‌ی انواع دیگر غیرچندبخشی) برمی‌گرداند. اگر روی یک " +"``multipart`` فراخوانی شود، :exc:`KeyError` را پرتاب می‌کند. اگر این بخش یک " +"بخش ``text`` باشد و *errors* مشخص شده باشد، از آن به‌عنوان مدیر خطا هنگام " +"کدگشایی بار به یونیکد استفاده می‌شود. مدیر خطای پیش‌فرض ``replace`` است." msgid "Add headers and payload to *msg*:" -msgstr "" +msgstr "سرصفحه‌ها و بار را به *msg* اضافه کنید:" -msgid "Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." +msgid "" +"Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." msgstr "" +"یک سرآیند :mailheader:`Content-Type` با مقدار ``maintype/subtype`` اضافه " +"کنید." -msgid "For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to *subtype* if it is specified, or ``plain`` if it is not." +msgid "" +"For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to " +"*subtype* if it is specified, or ``plain`` if it is not." msgstr "" +"برای ``str``، ``maintype`` MIME را روی ``text`` تنظیم کنید، و زیرنوع را اگر " +"مشخص شده باشد روی *subtype* و در غیر این صورت روی ``plain`` تنظیم کنید." -msgid "For ``bytes``, use the specified *maintype* and *subtype*, or raise a :exc:`TypeError` if they are not specified." +msgid "" +"For ``bytes``, use the specified *maintype* and *subtype*, or raise a " +":exc:`TypeError` if they are not specified." msgstr "" +"برای ``bytes``، از *maintype* و *subtype* مشخص‌شده استفاده می‌شود، یا اگر " +"مشخص نشده باشند، استثنای :exc:`TypeError` پرتاب می‌شود." -msgid "For :class:`~email.message.EmailMessage` objects, set the maintype to ``message``, and set the subtype to *subtype* if it is specified or ``rfc822`` if it is not. If *subtype* is ``partial``, raise an error (``bytes`` objects must be used to construct ``message/partial`` parts)." +msgid "" +"For :class:`~email.message.EmailMessage` objects, set the maintype to " +"``message``, and set the subtype to *subtype* if it is specified or " +"``rfc822`` if it is not. If *subtype* is ``partial``, raise an error " +"(``bytes`` objects must be used to construct ``message/partial`` parts)." msgstr "" +"برای اشیای :class:`~email.message.EmailMessage`، نوع اصلی (maintype) روی " +"``message`` تنظیم می‌شود، و اگر *subtype* مشخص شده باشد، زیرنوع " +"روی *subtype* و در غیر این صورت روی ``rfc822`` تنظیم می‌شود. اگر *subtype* " +"برابر ``partial`` باشد، خطایی پرتاب می‌شود (برای ساخت بخش‌های " +"``message/partial`` باید از اشیای ``bytes`` استفاده شود)." -msgid "If *charset* is provided (which is valid only for ``str``), encode the string to bytes using the specified character set. The default is ``utf-8``. If the specified *charset* is a known alias for a standard MIME charset name, use the standard charset instead." +msgid "" +"If *charset* is provided (which is valid only for ``str``), encode the " +"string to bytes using the specified character set. The default is " +"``utf-8``. If the specified *charset* is a known alias for a standard MIME " +"charset name, use the standard charset instead." msgstr "" +"اگر *charset* ارائه شده باشد (که فقط برای ``str`` معتبر است)، رشته با " +"استفاده از مجموعه نویسه مشخص‌شده به بایت‌ها کدگذاری می‌شود. مقدار پیش‌فرض " +"``utf-8`` است. اگر *charset* مشخص‌شده نام مستعار شناخته‌شده‌ای برای یک نام " +"مجموعه نویسه استاندارد MIME باشد، به‌جای آن از مجموعه نویسه استاندارد " +"استفاده می‌شود." -msgid "If *cte* is set, encode the payload using the specified content transfer encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that value. Possible values for *cte* are ``quoted-printable``, ``base64``, ``7bit``, ``8bit``, and ``binary``. If the input cannot be encoded in the specified encoding (for example, specifying a *cte* of ``7bit`` for an input that contains non-ASCII values), raise a :exc:`ValueError`." -msgstr "" +msgid "" +"If *cte* is set, encode the payload using the specified content transfer " +"encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that" +" value. Possible values for *cte* are ``quoted-printable``, ``base64``, " +"``7bit``, ``8bit``, and ``binary``. If the input cannot be encoded in the " +"specified encoding (for example, specifying a *cte* of ``7bit`` for an input" +" that contains non-ASCII values), raise a :exc:`ValueError`." +msgstr "" +"اگر *cte* تنظیم‌شده باشد، بار (payload) با استفاده از کدگذاری انتقال " +"محتوای مشخص‌شده کدگذاری می‌شود و سرآیند :mailheader:`Content-Transfer-" +"Encoding` روی آن مقدار تنظیم می‌شود. مقادیر ممکن برای *cte* عبارت‌اند از " +"``quoted-printable``، ``base64``، ``7bit``، ``8bit`` و ``binary``. اگر " +"ورودی نتواند با کدگذاری مشخص‌شده کدگذاری شود (برای مثال، مشخص کردن *cte* با " +"مقدار ``7bit`` برای ورودی‌ای که حاوی مقادیر غیر ASCII است)، یک " +":exc:`ValueError` پرتاب می‌شود." -msgid "For ``str`` objects, if *cte* is not set use heuristics to determine the most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to normalize all line boundaries, ensuring that each line of the payload is terminated by the current policy's :data:`~email.policy.Policy.linesep` property (even if the original string did not end with one)." -msgstr "" +msgid "" +"For ``str`` objects, if *cte* is not set use heuristics to determine the " +"most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to" +" normalize all line boundaries, ensuring that each line of the payload is " +"terminated by the current policy's :data:`~email.policy.Policy.linesep` " +"property (even if the original string did not end with one)." +msgstr "" +"برای اشیاء ``str``، اگر *cte* تنظیم‌نشده باشد، از روش‌های اکتشافی برای تعیین" +" فشرده‌ترین کدگذاری استفاده می‌شود. پیش از کدگذاری، :meth:`str.splitlines` " +"برای عادی‌سازی تمام مرزهای خط استفاده می‌شود تا اطمینان حاصل شود که هر خط از" +" بار با ویژگی :data:`~email.policy.Policy.linesep` سیاست جاری پایان " +"می‌یابد (حتی اگر رشته اصلی با آن پایان‌نیافته باشد)." -msgid "For ``bytes`` objects, *cte* is taken to be base64 if not set, and the aforementioned newline translation is not performed." +msgid "" +"For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " +"aforementioned newline translation is not performed." msgstr "" +"برای اشیاء ``bytes``، اگر *cte* تنظیم نشده باشد، مقدار آن base64 در نظر " +"گرفته می‌شود و ترجمه‌ی خط جدید مذکور انجام نمی‌شود." -msgid "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* ``rfc822``, and for any *cte* other than ``7bit`` for *subtype* ``external-body``. For ``message/rfc822``, use ``8bit`` if *cte* is not specified. For all other values of *subtype*, use ``7bit``." -msgstr "" +msgid "" +"For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if" +" a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " +"``rfc822``, and for any *cte* other than ``7bit`` for *subtype* ``external-" +"body``. For ``message/rfc822``, use ``8bit`` if *cte* is not specified. " +"For all other values of *subtype*, use ``7bit``." +msgstr "" +"برای :class:`~email.message.EmailMessage`، بر اساس :rfc:`2046`، اگر برای " +"*subtype* ``rfc822``، *cte* برابر ``quoted-printable`` یا ``base64`` درخواست" +" شود، یا برای *subtype* ``external-body`` هر *cte* غیر از ``7bit`` درخواست " +"شود، خطایی پرتاب می‌کند. برای ``message/rfc822``، اگر *cte* مشخص نشده باشد،" +" از ``8bit`` استفاده می‌شود. برای تمام مقدارهای دیگر *subtype*، از ``7bit``" +" استفاده می‌شود." -msgid "A *cte* of ``binary`` does not actually work correctly yet. The ``EmailMessage`` object as modified by ``set_content`` is correct, but :class:`~email.generator.BytesGenerator` does not serialize it correctly." +msgid "" +"A *cte* of ``binary`` does not actually work correctly yet. The " +"``EmailMessage`` object as modified by ``set_content`` is correct, but " +":class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" +"یک *cte* از ``binary`` هنوز واقعاً به‌درستی کار نمی‌کند. شیء " +"``EmailMessage`` که با ``set_content`` تغییر یافته است، صحیح است، اما " +":class:`~email.generator.BytesGenerator` آن را به‌درستی سریال‌سازی نمی‌کند." -msgid "If *disposition* is set, use it as the value of the :mailheader:`Content-Disposition` header. If not specified, and *filename* is specified, add the header with the value ``attachment``. If *disposition* is not specified and *filename* is also not specified, do not add the header. The only valid values for *disposition* are ``attachment`` and ``inline``." -msgstr "" +msgid "" +"If *disposition* is set, use it as the value of the :mailheader:`Content-" +"Disposition` header. If not specified, and *filename* is specified, add the" +" header with the value ``attachment``. If *disposition* is not specified and" +" *filename* is also not specified, do not add the header. The only valid " +"values for *disposition* are ``attachment`` and ``inline``." +msgstr "" +"اگر *disposition* تنظیم شده باشد، از آن به‌عنوان مقدار سرآیند " +":mailheader:`Content-Disposition` استفاده می‌شود. اگر مشخص نشده باشد و " +"*filename* مشخص شده باشد، سرآیند با مقدار ``attachment`` افزوده می‌شود. اگر " +"*disposition* مشخص نشده باشد و *filename* نیز مشخص نشده باشد، سرآیند افزوده " +"نمی‌شود. تنها مقادیر معتبر برای *disposition*، ``attachment`` و ``inline`` " +"هستند." -msgid "If *filename* is specified, use it as the value of the ``filename`` parameter of the :mailheader:`Content-Disposition` header." +msgid "" +"If *filename* is specified, use it as the value of the ``filename`` " +"parameter of the :mailheader:`Content-Disposition` header." msgstr "" +"اگر *filename* تعیین شده باشد، از آن به‌عنوان مقدار پارامتر ``filename`` در " +"سرآیند :mailheader:`Content-Disposition` استفاده کنید." -msgid "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as its value." +msgid "" +"If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " +"its value." msgstr "" +"اگر *cid* مشخص شده باشد، یک سرآیند :mailheader:`Content-ID` با *cid* " +"به‌عنوان مقدار آن اضافه می‌شود." -msgid "If *params* is specified, iterate its ``items`` method and use the resulting ``(key, value)`` pairs to set additional parameters on the :mailheader:`Content-Type` header." +msgid "" +"If *params* is specified, iterate its ``items`` method and use the resulting" +" ``(key, value)`` pairs to set additional parameters on the " +":mailheader:`Content-Type` header." msgstr "" +"اگر *params* تعیین شده باشد، متد ``items`` آن را پیمایش کنید و از جفت‌های " +"``(key, value)`` حاصل برای تنظیم پارامترهای اضافی در سرآیند " +":mailheader:`Content-Type` استفاده کنید." -msgid "If *headers* is specified and is a list of strings of the form ``headername: headervalue`` or a list of ``header`` objects (distinguished from strings by having a ``name`` attribute), add the headers to *msg*." +msgid "" +"If *headers* is specified and is a list of strings of the form ``headername:" +" headervalue`` or a list of ``header`` objects (distinguished from strings " +"by having a ``name`` attribute), add the headers to *msg*." msgstr "" +"اگر *headers* مشخص شده باشد و فهرستی از رشته‌هایی به‌صورت ``headername: " +"headervalue`` یا فهرستی از اشیای ``header`` باشد (که با داشتن ویژگی " +"``name`` از رشته‌ها متمایز می‌شوند)، سرآیندها به *msg* اضافه می‌شوند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Originally added in 3.4 as a :term:`provisional module `" +msgid "" +"Originally added in 3.4 as a :term:`provisional module `" msgstr "" +"در ابتدا در 3.4 به‌عنوان یک :term:`ماژول موقت ` اضافه " +"شد" diff --git a/library/email.encoders.po b/library/email.encoders.po index 8dfdd5f2f..a2207a56c 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -24,46 +24,126 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.encoders`: Encoders" -msgstr "" +msgstr ":mod:`!email.encoders`: کدگذارها" msgid "**Source code:** :source:`Lib/email/encoders.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/email/encoders.py`" -msgid "This module is part of the legacy (``Compat32``) email API. In the new API the functionality is provided by the *cte* parameter of the :meth:`~email.message.EmailMessage.set_content` method." +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the new API " +"the functionality is provided by the *cte* parameter of the " +":meth:`~email.message.EmailMessage.set_content` method." msgstr "" +"این ماژول بخشی از API ایمیل قدیمی (``Compat32``) است. در API جدید، این " +"عملکرد توسط پارامتر *cte* در متد " +":meth:`~email.message.EmailMessage.set_content` ارائه می‌شود." -msgid "This module is deprecated in Python 3. The functions provided here should not be called explicitly since the :class:`~email.mime.text.MIMEText` class sets the content type and CTE header using the *_subtype* and *_charset* values passed during the instantiation of that class." -msgstr "" +msgid "" +"This module is deprecated in Python 3. The functions provided here should " +"not be called explicitly since the :class:`~email.mime.text.MIMEText` class " +"sets the content type and CTE header using the *_subtype* and *_charset* " +"values passed during the instantiation of that class." +msgstr "" +"این ماژول در پایتون 3 منسوخ شده است. توابع ارائه‌شده در اینجا نباید به‌صراحت" +" فراخوانی شوند، زیرا کلاس :class:`~email.mime.text.MIMEText` نوع محتوا و " +"سرآیند CTE را با استفاده از مقادیر *_subtype* و *_charset* که در هنگام " +"نمونه‌سازی آن کلاس ارسال می‌شوند، تنظیم می‌کند." -msgid "The remaining text in this section is the original documentation of the module." -msgstr "" +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "متن باقی‌مانده در این بخش، مستندات اصلی ماژول است." -msgid "When creating :class:`~email.message.Message` objects from scratch, you often need to encode the payloads for transport through compliant mail servers. This is especially true for :mimetype:`image/\\*` and :mimetype:`text/\\*` type messages containing binary data." -msgstr "" +msgid "" +"When creating :class:`~email.message.Message` objects from scratch, you " +"often need to encode the payloads for transport through compliant mail " +"servers. This is especially true for :mimetype:`image/\\*` and " +":mimetype:`text/\\*` type messages containing binary data." +msgstr "" +"هنگام ایجاد اشیای :class:`~email.message.Message` از صفر، اغلب لازم است " +"بارهای مفید (payload) را برای انتقال از طریق سرورهای ایمیل سازگار با " +"استانداردها کدگذاری کنید. این موضوع به‌ویژه برای پیام‌هایی از نوع " +":mimetype:`image/\\*` و :mimetype:`text/\\*` که حاوی داده‌های دودویی هستند، " +"صادق است." -msgid "The :mod:`email` package provides some convenient encoders in its :mod:`!encoders` module. These encoders are actually used by the :class:`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class constructors to provide default encodings. All encoder functions take exactly one argument, the message object to encode. They usually extract the payload, encode it, and reset the payload to this newly encoded value. They should also set the :mailheader:`Content-Transfer-Encoding` header as appropriate." -msgstr "" +msgid "" +"The :mod:`email` package provides some convenient encoders in its " +":mod:`!encoders` module. These encoders are actually used by the " +":class:`~email.mime.audio.MIMEAudio` and " +":class:`~email.mime.image.MIMEImage` class constructors to provide default " +"encodings. All encoder functions take exactly one argument, the message " +"object to encode. They usually extract the payload, encode it, and reset " +"the payload to this newly encoded value. They should also set the " +":mailheader:`Content-Transfer-Encoding` header as appropriate." +msgstr "" +"بسته‌ی :mod:`email` چند کدگذار کاربردی در ماژول :mod:`!encoders` خود فراهم " +"می‌کند. این کدگذارها در واقع توسط سازنده‌های کلاس‌های " +":class:`~email.mime.audio.MIMEAudio` و :class:`~email.mime.image.MIMEImage` " +"برای فراهم کردن کدگذاری‌های پیش‌فرض استفاده می‌شوند. همه‌ی توابع کدگذار " +"دقیقاً یک آرگومان می‌گیرند: شیء پیامی که باید کدگذاری شود. آن‌ها معمولاً بار" +" مفید (payload) را استخراج می‌کنند، آن را کدگذاری می‌کنند و بار را به " +"این مقدار تازه کدگذاری‌شده بازنشانی می‌کنند. آن‌ها همچنین باید سرصفحه‌ی " +":mailheader:`Content-Transfer-Encoding` را به‌شکل مناسب تنظیم کنند." -msgid "Note that these functions are not meaningful for a multipart message. They must be applied to individual subparts instead, and will raise a :exc:`TypeError` if passed a message whose type is multipart." -msgstr "" +msgid "" +"Note that these functions are not meaningful for a multipart message. They " +"must be applied to individual subparts instead, and will raise a " +":exc:`TypeError` if passed a message whose type is multipart." +msgstr "" +"توجه داشته باشید که این توابع برای یک پیام چندبخشی (multipart) معنایی " +"ندارند. در عوض، باید روی زیربخش‌های جداگانه اعمال شوند و اگر پیامی که نوع آن" +" چندبخشی (multipart) باشد به آن‌ها داده شود، :exc:`TypeError` را پرتاب " +"می‌کنند." msgid "Here are the encoding functions provided:" -msgstr "" +msgstr "در اینجا توابع کدگذاری ارائه‌شده آمده است:" -msgid "Encodes the payload into quoted-printable form and sets the :mailheader:`Content-Transfer-Encoding` header to ``quoted-printable`` [#]_. This is a good encoding to use when most of your payload is normal printable data, but contains a few unprintable characters." -msgstr "" +msgid "" +"Encodes the payload into quoted-printable form and sets the " +":mailheader:`Content-Transfer-Encoding` header to ``quoted-printable`` [#]_." +" This is a good encoding to use when most of your payload is normal " +"printable data, but contains a few unprintable characters." +msgstr "" +"بار (payload) را به قالب quoted-printable کدگذاری می‌کند و سرصفحه‌ی " +":mailheader:`Content-Transfer-Encoding` را روی ``quoted-printable`` [#]_ " +"تنظیم می‌کند. این کدگذاری برای استفاده زمانی مناسب است که بیشتر بار شما " +"داده‌ی قابل‌چاپ معمولی باشد، اما شامل چند نویسه‌ی غیرقابل‌چاپ نیز باشد." -msgid "Encodes the payload into base64 form and sets the :mailheader:`Content-Transfer-Encoding` header to ``base64``. This is a good encoding to use when most of your payload is unprintable data since it is a more compact form than quoted-printable. The drawback of base64 encoding is that it renders the text non-human readable." -msgstr "" +msgid "" +"Encodes the payload into base64 form and sets the :mailheader:`Content-" +"Transfer-Encoding` header to ``base64``. This is a good encoding to use " +"when most of your payload is unprintable data since it is a more compact " +"form than quoted-printable. The drawback of base64 encoding is that it " +"renders the text non-human readable." +msgstr "" +"بار را به قالب base64 کدگذاری می‌کند و سرآیند :mailheader:`Content-" +"Transfer-Encoding` را روی ``base64`` تنظیم می‌کند. این کدگذاری برای استفاده " +"هنگامی که بیشتر بار شما داده‌های غیرقابل‌چاپ است، مناسب است، زیرا قالب " +"فشرده‌تری نسبت به quoted-printable دارد. عیب کدگذاری base64 این است که متن " +"را برای انسان غیرقابل‌خواندن می‌کند." -msgid "This doesn't actually modify the message's payload, but it does set the :mailheader:`Content-Transfer-Encoding` header to either ``7bit`` or ``8bit`` as appropriate, based on the payload data." +msgid "" +"This doesn't actually modify the message's payload, but it does set the " +":mailheader:`Content-Transfer-Encoding` header to either ``7bit`` or " +"``8bit`` as appropriate, based on the payload data." msgstr "" +"این در واقع بار پیام را تغییر نمی‌دهد، اما سرآیند :mailheader:`Content-" +"Transfer-Encoding` را بر اساس داده‌های بار، به‌صورت مناسب به ``7bit`` " +"یا ``8bit`` تنظیم می‌کند." -msgid "This does nothing; it doesn't even set the :mailheader:`Content-Transfer-Encoding` header." +msgid "" +"This does nothing; it doesn't even set the :mailheader:`Content-Transfer-" +"Encoding` header." msgstr "" +"این هیچ کاری انجام نمی‌دهد؛ حتی سرآیند :mailheader:`Content-Transfer-" +"Encoding` را نیز تنظیم نمی‌کند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Note that encoding with :meth:`encode_quopri` also encodes all tabs and space characters in the data." +msgid "" +"Note that encoding with :meth:`encode_quopri` also encodes all tabs and " +"space characters in the data." msgstr "" +"توجه داشته باشید که کدگذاری با :meth:`encode_quopri` تمام نویسه‌های تب و " +"فاصله موجود در داده‌ها را نیز کدگذاری می‌کند." diff --git a/library/email.errors.po b/library/email.errors.po index fd9f81647..70a8f0cf8 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -22,79 +22,195 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.errors`: Exception and Defect classes" -msgstr "" +msgstr ":mod:`!email.errors`: کلاس‌های استثنا و نقص (Defect)" msgid "**Source code:** :source:`Lib/email/errors.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/errors.py`" -msgid "The following exception classes are defined in the :mod:`!email.errors` module:" -msgstr "" +msgid "" +"The following exception classes are defined in the :mod:`!email.errors` " +"module:" +msgstr "کلاس‌های استثنای زیر در ماژول :mod:`!email.errors` تعریف شده‌اند:" -msgid "This is the base class for all exceptions that the :mod:`email` package can raise. It is derived from the standard :exc:`Exception` class and defines no additional methods." +msgid "" +"This is the base class for all exceptions that the :mod:`email` package can " +"raise. It is derived from the standard :exc:`Exception` class and defines " +"no additional methods." msgstr "" +"این کلاس، کلاس پایه برای تمام استثناهایی است که بسته‌ی :mod:`email` " +"می‌تواند پرتاب کند. این کلاس از کلاس استاندارد :exc:`Exception` مشتق شده است" +" و هیچ متد اضافه‌ای تعریف نمی‌کند." -msgid "This is the base class for exceptions raised by the :class:`~email.parser.Parser` class. It is derived from :exc:`MessageError`. This class is also used internally by the parser used by :mod:`~email.headerregistry`." +msgid "" +"This is the base class for exceptions raised by the " +":class:`~email.parser.Parser` class. It is derived from " +":exc:`MessageError`. This class is also used internally by the parser used " +"by :mod:`~email.headerregistry`." msgstr "" +"این کلاس پایه‌ای برای استثناهای پرتاب‌شده توسط کلاس " +":class:`~email.parser.Parser` است. این کلاس از :exc:`MessageError` مشتق شده " +"است. این کلاس همچنین به‌صورت داخلی توسط پارسرای که " +":mod:`~email.headerregistry` از آن استفاده می‌کند، به کار می‌رود." -msgid "Raised under some error conditions when parsing the :rfc:`5322` headers of a message, this class is derived from :exc:`MessageParseError`. The :meth:`~email.message.EmailMessage.set_boundary` method will raise this error if the content type is unknown when the method is called. :class:`~email.header.Header` may raise this error for certain base64 decoding errors, and when an attempt is made to create a header that appears to contain an embedded header (that is, there is what is supposed to be a continuation line that has no leading whitespace and looks like a header)." -msgstr "" +msgid "" +"Raised under some error conditions when parsing the :rfc:`5322` headers of a" +" message, this class is derived from :exc:`MessageParseError`. The " +":meth:`~email.message.EmailMessage.set_boundary` method will raise this " +"error if the content type is unknown when the method is called. " +":class:`~email.header.Header` may raise this error for certain base64 " +"decoding errors, and when an attempt is made to create a header that appears" +" to contain an embedded header (that is, there is what is supposed to be a " +"continuation line that has no leading whitespace and looks like a header)." +msgstr "" +"این کلاس که تحت برخی شرایط خطا هنگام تجزیه سرآیندهای :rfc:`5322` یک پیام " +"پرتاب می‌شود، از :exc:`MessageParseError` مشتق شده است. متد " +":meth:`~email.message.EmailMessage.set_boundary` این خطا را در صورتی پرتاب " +"می‌کند که نوع محتوا هنگام فراخوانی متد ناشناخته باشد. " +":class:`~email.header.Header` ممکن است این خطا را برای برخی خطاهای کدگشایی " +"base64، و همچنین هنگامی که تلاشی برای ایجاد سرآیندی انجام شود که به نظر " +"می‌رسد حاوی یک سرآیند جاسازی‌شده است (یعنی خطی که قرار است خط ادامه باشد، " +"فضای سفید پیشرو ندارد و شبیه یک سرآیند است)، پرتاب کند." msgid "Deprecated and no longer used." -msgstr "" +msgstr "منسوخ شده و دیگر استفاده نمی‌شود." -msgid "Raised if the :meth:`~email.message.Message.attach` method is called on an instance of a class derived from :class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. :class:`~email.mime.image.MIMEImage`). :exc:`MultipartConversionError` multiply inherits from :exc:`MessageError` and the built-in :exc:`TypeError`." -msgstr "" +msgid "" +"Raised if the :meth:`~email.message.Message.attach` method is called on an " +"instance of a class derived from " +":class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. " +":class:`~email.mime.image.MIMEImage`). :exc:`MultipartConversionError` " +"multiply inherits from :exc:`MessageError` and the built-in " +":exc:`TypeError`." +msgstr "" +"در صورتی پرتاب می‌شود که متد :meth:`~email.message.Message.attach` روی " +"نمونه‌ای از کلاسی مشتق‌شده از " +":class:`~email.mime.nonmultipart.MIMENonMultipart` فراخوانی شود (برای مثال " +":class:`~email.mime.image.MIMEImage`). :exc:`MultipartConversionError` " +"به‌صورت چندگانه از :exc:`MessageError` و استثنای توکار :exc:`TypeError` ارث " +"می‌برد." -msgid "Raised when an error occurs when the :mod:`~email.generator` outputs headers." +msgid "" +"Raised when an error occurs when the :mod:`~email.generator` outputs " +"headers." msgstr "" +"هنگامی پرتاب می‌شود که هنگام خروجی‌دادن سرآیندها توسط " +":mod:`~email.generator` خطایی رخ دهد." -msgid "This is the base class for all defects found when parsing email messages. It is derived from :exc:`ValueError`." +msgid "" +"This is the base class for all defects found when parsing email messages. It" +" is derived from :exc:`ValueError`." msgstr "" +"این کلاس، کلاس پایه برای تمام نقص‌های یافت‌شده هنگام تجزیه پیام‌های ایمیل " +"است. این کلاس از :exc:`ValueError` مشتق شده است." -msgid "This is the base class for all defects found when parsing email headers. It is derived from :exc:`MessageDefect`." +msgid "" +"This is the base class for all defects found when parsing email headers. It " +"is derived from :exc:`MessageDefect`." msgstr "" +"این کلاس، کلاس پایه برای همه نقص‌های یافت‌شده هنگام تجزیه سرآیندهای ایمیل " +"است. این کلاس از :exc:`MessageDefect` مشتق شده است." -msgid "Here is the list of the defects that the :class:`~email.parser.FeedParser` can find while parsing messages. Note that the defects are added to the message where the problem was found, so for example, if a message nested inside a :mimetype:`multipart/alternative` had a malformed header, that nested message object would have a defect, but the containing messages would not." -msgstr "" +msgid "" +"Here is the list of the defects that the :class:`~email.parser.FeedParser` " +"can find while parsing messages. Note that the defects are added to the " +"message where the problem was found, so for example, if a message nested " +"inside a :mimetype:`multipart/alternative` had a malformed header, that " +"nested message object would have a defect, but the containing messages would" +" not." +msgstr "" +"در اینجا فهرستی از نقص‌هایی آمده است که :class:`~email.parser.FeedParser` " +"می‌تواند هنگام تجزیه پیام‌ها پیدا کند. توجه داشته باشید که نقص‌ها به پیامی " +"اضافه می‌شوند که مشکل در آن یافت شده است؛ بنابراین برای مثال، اگر پیامی که " +"درون یک :mimetype:`multipart/alternative` تودرتو شده است سرآیند با قالب " +"نادرست داشته باشد، آن شیء پیام تودرتو نقص خواهد داشت، اما پیام‌های حاوی آن " +"نقص نخواهند داشت." -msgid "All defect classes are subclassed from :class:`email.errors.MessageDefect`." +msgid "" +"All defect classes are subclassed from :class:`email.errors.MessageDefect`." msgstr "" +"همه‌ی کلاس‌های نقص، زیرکلاس‌های :class:`email.errors.MessageDefect` هستند." -msgid "A message claimed to be a multipart, but had no :mimetype:`boundary` parameter." +msgid "" +"A message claimed to be a multipart, but had no :mimetype:`boundary` " +"parameter." msgstr "" +"پیامی ادعا کرده بود که چندبخشی (multipart) است، اما پارامتر " +":mimetype:`boundary` نداشت." -msgid "The start boundary claimed in the :mailheader:`Content-Type` header was never found." +msgid "" +"The start boundary claimed in the :mailheader:`Content-Type` header was " +"never found." msgstr "" +"مرز آغازین اعلام‌شده در سرآیند :mailheader:`Content-Type` هرگز پیدا نشد." -msgid "A start boundary was found, but no corresponding close boundary was ever found." -msgstr "" +msgid "" +"A start boundary was found, but no corresponding close boundary was ever " +"found." +msgstr "یک مرز آغازین یافت شد، اما هرگز مرز پایانی متناظری یافت نشد." msgid "The message had a continuation line as its first header line." -msgstr "" +msgstr "پیام دارای یک خط ادامه به‌عنوان نخستین خط سرآیند خود بود." msgid "A \"Unix From\" header was found in the middle of a header block." -msgstr "" +msgstr "یک سرآیند «Unix From» در میانه‌ی یک بلوک سرآیند یافت شد." -msgid "A line was found while parsing headers that had no leading white space but contained no ':'. Parsing continues assuming that the line represents the first line of the body." +msgid "" +"A line was found while parsing headers that had no leading white space but " +"contained no ':'. Parsing continues assuming that the line represents the " +"first line of the body." msgstr "" +"در هنگام تجزیه سرآیندها، خطی یافت شد که فضای سفید پیشرو نداشت اما شامل «:» " +"نبود. تجزیه با این فرض ادامه می‌یابد که این خط، نشان‌دهنده نخستین خط بدنه " +"است." -msgid "A header was found that was missing a colon, or was otherwise malformed." -msgstr "" +msgid "" +"A header was found that was missing a colon, or was otherwise malformed." +msgstr "سرآیندی یافت شد که فاقد علامت دونقطه بود یا به شکل دیگری نامعتبر بود." msgid "This defect has not been used for several Python versions." -msgstr "" +msgstr "این نقص برای چندین نسخه پایتون استفاده نشده است." -msgid "A message claimed to be a :mimetype:`multipart`, but no subparts were found. Note that when a message has this defect, its :meth:`~email.message.Message.is_multipart` method may return ``False`` even though its content type claims to be :mimetype:`multipart`." +msgid "" +"A message claimed to be a :mimetype:`multipart`, but no subparts were found." +" Note that when a message has this defect, its " +":meth:`~email.message.Message.is_multipart` method may return ``False`` even" +" though its content type claims to be :mimetype:`multipart`." msgstr "" +"پیامی ادعا می‌کرد که :mimetype:`multipart` است، اما هیچ زیربخشی یافت نشد. " +"توجه داشته باشید که هنگامی که پیامی این نقص را دارد، ممکن است متد " +":meth:`~email.message.Message.is_multipart` آن ``False`` را برگرداند، حتی " +"اگر نوع محتوای آن ادعا کند که :mimetype:`multipart` است." -msgid "When decoding a block of base64 encoded bytes, the padding was not correct. Enough padding is added to perform the decode, but the resulting decoded bytes may be invalid." +msgid "" +"When decoding a block of base64 encoded bytes, the padding was not correct. " +"Enough padding is added to perform the decode, but the resulting decoded " +"bytes may be invalid." msgstr "" +"هنگام کدگشایی بلوکی از بایت‌های کدگذاری‌شده با base64، پرکننده (padding) " +"صحیح نبود. پرکننده‌ی کافی برای انجام کدگشایی اضافه می‌شود، اما بایت‌های حاصل" +" از کدگشایی ممکن است نامعتبر باشند." -msgid "When decoding a block of base64 encoded bytes, characters outside the base64 alphabet were encountered. The characters are ignored, but the resulting decoded bytes may be invalid." +msgid "" +"When decoding a block of base64 encoded bytes, characters outside the base64" +" alphabet were encountered. The characters are ignored, but the resulting " +"decoded bytes may be invalid." msgstr "" +"هنگام کدگشایی یک بلوک از بایت‌های کدگذاری‌شده‌ی base64، نویسه‌هایی خارج از " +"الفبای base64 مشاهده شدند. این نویسه‌ها نادیده گرفته می‌شوند، اما بایت‌های " +"کدگشایی‌شده‌ی حاصل ممکن است نامعتبر باشند." -msgid "When decoding a block of base64 encoded bytes, the number of non-padding base64 characters was invalid (1 more than a multiple of 4). The encoded block was kept as-is." +msgid "" +"When decoding a block of base64 encoded bytes, the number of non-padding " +"base64 characters was invalid (1 more than a multiple of 4). The encoded " +"block was kept as-is." msgstr "" +"هنگام کدگشایی یک بلوک از بایت‌های کدگذاری‌شده به base64، تعداد نویسه‌های " +"base64 غیر از پرکننده (padding) نامعتبر بود (۱ بیشتر از مضربی از ۴). بلوک " +"کدگذاری‌شده بدون تغییر نگه داشته شد." -msgid "When decoding an invalid or unparsable date field. The original value is kept as-is." +msgid "" +"When decoding an invalid or unparsable date field. The original value is " +"kept as-is." msgstr "" +"هنگام کدگشایی یک فیلد تاریخ نامعتبر یا غیرقابل‌تجزیه. مقدار اصلی همان‌طور که" +" هست نگه داشته می‌شود." diff --git a/library/email.examples.po b/library/email.examples.po index 44197932c..8647fa398 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"PO-Revision-Date: 2026-08-28 11:35+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,15 +22,25 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`email`: Examples" -msgstr "" +msgstr ":mod:`email`: مثال‌ها" -msgid "Here are a few examples of how to use the :mod:`email` package to read, write, and send simple email messages, as well as more complex MIME messages." +msgid "" +"Here are a few examples of how to use the :mod:`email` package to read, " +"write, and send simple email messages, as well as more complex MIME " +"messages." msgstr "" +"در اینجا چند مثال از نحوه استفاده از بسته :mod:`email` برای خواندن، نوشتن و " +"ارسال پیام‌های ایمیلی ساده، و همچنین پیام‌های MIME پیچیده‌تر آورده شده است." -msgid "First, let's see how to create and send a simple text message (both the text content and the addresses may contain unicode characters):" +msgid "" +"First, let's see how to create and send a simple text message (both the " +"text content and the addresses may contain unicode characters):" msgstr "" +"ابتدا، بیایید ببینیم چگونه یک پیام متنی ساده را ایجاد و ارسال کنیم (هم " +"محتوای متنی و هم نشانی‌ها ممکن است حاوی نویسه‌های یونیکد باشند):" msgid "" "# Import smtplib for the actual sending function\n" @@ -56,9 +66,35 @@ msgid "" "s.send_message(msg)\n" "s.quit()\n" msgstr "" +"# Import smtplib for the actual sending function\n" +"import smtplib\n" +"\n" +"# Import the email modules we'll need\n" +"from email.message import EmailMessage\n" +"\n" +"# Open the plain text file whose name is in textfile for reading.\n" +"with open(textfile) as fp:\n" +" # Create a text/plain message\n" +" msg = EmailMessage()\n" +" msg.set_content(fp.read())\n" +"\n" +"# me == the sender's email address\n" +"# you == the recipient's email address\n" +"msg['Subject'] = f'The contents of {textfile}'\n" +"msg['From'] = me\n" +"msg['To'] = you\n" +"\n" +"# Send the message via our own SMTP server.\n" +"s = smtplib.SMTP('localhost')\n" +"s.send_message(msg)\n" +"s.quit()\n" -msgid "Parsing :rfc:`822` headers can easily be done by the using the classes from the :mod:`~email.parser` module:" +msgid "" +"Parsing :rfc:`822` headers can easily be done by the using the classes from " +"the :mod:`~email.parser` module:" msgstr "" +"تجزیه سرآیندهای :rfc:`822` را می‌توان به‌راحتی با استفاده از کلاس‌های " +"ماژول :mod:`~email.parser` انجام داد:" msgid "" "# Import the email modules we'll need\n" @@ -70,7 +106,8 @@ msgid "" "# with open(messagefile, 'rb') as fp:\n" "# headers = BytesParser(policy=default).parse(fp)\n" "\n" -"# Or for parsing headers in a string (this is an uncommon operation), use:\n" +"# Or for parsing headers in a string (this is an uncommon operation), " +"use:\n" "headers = Parser(policy=default).parsestr(\n" " 'From: Foo Bar \\n'\n" " 'To: \\n'\n" @@ -84,12 +121,44 @@ msgid "" "print('Subject: {}'.format(headers['subject']))\n" "\n" "# You can also access the parts of the addresses:\n" -"print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" +"print('Recipient username: " +"{}'.format(headers['to'].addresses[0].username))\n" "print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" msgstr "" +"# Import the email modules we'll need\n" +"#from email.parser import BytesParser\n" +"from email.parser import Parser\n" +"from email.policy import default\n" +"\n" +"# If the e-mail headers are in a file, uncomment these two lines:\n" +"# with open(messagefile, 'rb') as fp:\n" +"# headers = BytesParser(policy=default).parse(fp)\n" +"\n" +"# Or for parsing headers in a string (this is an uncommon operation), " +"use:\n" +"headers = Parser(policy=default).parsestr(\n" +" 'From: Foo Bar \\n'\n" +" 'To: \\n'\n" +" 'Subject: Test message\\n'\n" +" '\\n'\n" +" 'Body would go here\\n')\n" +"\n" +"# Now the header items can be accessed as a dictionary:\n" +"print('To: {}'.format(headers['to']))\n" +"print('From: {}'.format(headers['from']))\n" +"print('Subject: {}'.format(headers['subject']))\n" +"\n" +"# You can also access the parts of the addresses:\n" +"print('Recipient username: " +"{}'.format(headers['to'].addresses[0].username))\n" +"print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" -msgid "Here's an example of how to send a MIME message containing a bunch of family pictures that may be residing in a directory:" +msgid "" +"Here's an example of how to send a MIME message containing a bunch of " +"family pictures that may be residing in a directory:" msgstr "" +"در اینجا مثالی از نحوه ارسال یک پیام MIME حاوی دسته‌ای از عکس‌های خانوادگی که " +"ممکن است در یک پوشه قرار داشته باشند آمده است:" msgid "" "# Import smtplib for the actual sending function.\n" @@ -119,9 +188,39 @@ msgid "" "with smtplib.SMTP('localhost') as s:\n" " s.send_message(msg)\n" msgstr "" +"# Import smtplib for the actual sending function.\n" +"import smtplib\n" +"\n" +"# Here are the email package modules we'll need.\n" +"from email.message import EmailMessage\n" +"\n" +"# Create the container email message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = 'Our family reunion'\n" +"# me == the sender's email address\n" +"# family = the list of all recipients' email addresses\n" +"msg['From'] = me\n" +"msg['To'] = ', '.join(family)\n" +"msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +"# Open the files in binary mode. You can also omit the subtype\n" +"# if you want MIMEImage to guess it.\n" +"for file in pngfiles:\n" +" with open(file, 'rb') as fp:\n" +" img_data = fp.read()\n" +" msg.add_attachment(img_data, maintype='image',\n" +" subtype='png')\n" +"\n" +"# Send the email via our own SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" -msgid "Here's an example of how to send the entire contents of a directory as an email message: [1]_" +msgid "" +"Here's an example of how to send the entire contents of a directory as an " +"email message: [1]_" msgstr "" +"در اینجا نمونه‌ای از نحوه ارسال کل محتویات یک پوشه به‌عنوان یک پیام ایمیل " +"آمده است: [1]_" msgid "" "#!/usr/bin/env python3\n" @@ -142,18 +241,24 @@ msgid "" "def main():\n" " parser = ArgumentParser(description=\"\"\"\\\n" "Send the contents of a directory as a MIME message.\n" -"Unless the -o option is given, the email is sent by forwarding to your local\n" -"SMTP server, which then does the normal delivery process. Your local machine\n" +"Unless the -o option is given, the email is sent by forwarding to your " +"local\n" +"SMTP server, which then does the normal delivery process. Your local " +"machine\n" "must be running an SMTP server.\n" "\"\"\")\n" " parser.add_argument('-d', '--directory',\n" -" help=\"\"\"Mail the contents of the specified directory,\n" -" otherwise use the current directory. Only the regular\n" -" files in the directory are sent, and we don't recurse to\n" +" help=\"\"\"Mail the contents of the specified " +"directory,\n" +" otherwise use the current directory. Only the " +"regular\n" +" files in the directory are sent, and we don't " +"recurse to\n" " subdirectories.\"\"\")\n" " parser.add_argument('-o', '--output',\n" " metavar='FILE',\n" -" help=\"\"\"Print the composed message to FILE instead of\n" +" help=\"\"\"Print the composed message to FILE " +"instead of\n" " sending the message to the SMTP server.\"\"\")\n" " parser.add_argument('-s', '--sender', required=True,\n" " help='The value of the From: header (required)')\n" @@ -181,7 +286,8 @@ msgid "" " # gzip'd or compressed files.\n" " ctype, encoding = mimetypes.guess_file_type(path)\n" " if ctype is None or encoding is not None:\n" -" # No guess could be made, or the file is encoded (compressed), so\n" +" # No guess could be made, or the file is encoded (compressed), " +"so\n" " # use a generic bag-of-bits type.\n" " ctype = 'application/octet-stream'\n" " maintype, subtype = ctype.split('/', 1)\n" @@ -202,9 +308,97 @@ msgid "" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Send the contents of a directory as a MIME message.\"\"\"\n" +"\n" +"import os\n" +"import smtplib\n" +"# For guessing MIME type based on file name extension\n" +"import mimetypes\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"from email.message import EmailMessage\n" +"from email.policy import SMTP\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Send the contents of a directory as a MIME message.\n" +"Unless the -o option is given, the email is sent by forwarding to your " +"local\n" +"SMTP server, which then does the normal delivery process. Your local " +"machine\n" +"must be running an SMTP server.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory',\n" +" help=\"\"\"Mail the contents of the specified " +"directory,\n" +" otherwise use the current directory. Only the " +"regular\n" +" files in the directory are sent, and we don't " +"recurse to\n" +" subdirectories.\"\"\")\n" +" parser.add_argument('-o', '--output',\n" +" metavar='FILE',\n" +" help=\"\"\"Print the composed message to FILE " +"instead of\n" +" sending the message to the SMTP server.\"\"\")\n" +" parser.add_argument('-s', '--sender', required=True,\n" +" help='The value of the From: header (required)')\n" +" parser.add_argument('-r', '--recipient', required=True,\n" +" action='append', metavar='RECIPIENT',\n" +" default=[], dest='recipients',\n" +" help='A To: header value (at least one required)')\n" +" args = parser.parse_args()\n" +" directory = args.directory\n" +" if not directory:\n" +" directory = '.'\n" +" # Create the message\n" +" msg = EmailMessage()\n" +" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n" +" msg['To'] = ', '.join(args.recipients)\n" +" msg['From'] = args.sender\n" +" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +" for filename in os.listdir(directory):\n" +" path = os.path.join(directory, filename)\n" +" if not os.path.isfile(path):\n" +" continue\n" +" # Guess the content type based on the file's extension. Encoding\n" +" # will be ignored, although we should check for simple things like\n" +" # gzip'd or compressed files.\n" +" ctype, encoding = mimetypes.guess_file_type(path)\n" +" if ctype is None or encoding is not None:\n" +" # No guess could be made, or the file is encoded (compressed), " +"so\n" +" # use a generic bag-of-bits type.\n" +" ctype = 'application/octet-stream'\n" +" maintype, subtype = ctype.split('/', 1)\n" +" with open(path, 'rb') as fp:\n" +" msg.add_attachment(fp.read(),\n" +" maintype=maintype,\n" +" subtype=subtype,\n" +" filename=filename)\n" +" # Now send or store the message\n" +" if args.output:\n" +" with open(args.output, 'wb') as fp:\n" +" fp.write(msg.as_bytes(policy=SMTP))\n" +" else:\n" +" with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" -msgid "Here's an example of how to unpack a MIME message like the one above, into a directory of files:" +msgid "" +"Here's an example of how to unpack a MIME message like the one above, into " +"a directory of files:" msgstr "" +"در اینجا مثالی از نحوه واگشایی یک پیام MIME مانند نمونه بالا در یک پوشه از " +"فایل‌ها آمده است:" msgid "" "#!/usr/bin/env python3\n" @@ -226,7 +420,8 @@ msgid "" "\"\"\")\n" " parser.add_argument('-d', '--directory', required=True,\n" " help=\"\"\"Unpack the MIME message into the named\n" -" directory, which will be created if it doesn't already\n" +" directory, which will be created if it doesn't " +"already\n" " exist.\"\"\")\n" " parser.add_argument('msgfile')\n" " args = parser.parse_args()\n" @@ -244,7 +439,8 @@ msgid "" " # multipart/* are just containers\n" " if part.get_content_maintype() == 'multipart':\n" " continue\n" -" # Applications should really sanitize the given filename so that an\n" +" # Applications should really sanitize the given filename so that " +"an\n" " # email message can't be used to overwrite important files\n" " filename = part.get_filename()\n" " if not filename:\n" @@ -261,9 +457,72 @@ msgid "" "if __name__ == '__main__':\n" " main()\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Unpack a MIME message into a directory of files.\"\"\"\n" +"\n" +"import os\n" +"import email\n" +"import mimetypes\n" +"\n" +"from email.policy import default\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Unpack a MIME message into a directory of files.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory', required=True,\n" +" help=\"\"\"Unpack the MIME message into the named\n" +" directory, which will be created if it doesn't " +"already\n" +" exist.\"\"\")\n" +" parser.add_argument('msgfile')\n" +" args = parser.parse_args()\n" +"\n" +" with open(args.msgfile, 'rb') as fp:\n" +" msg = email.message_from_binary_file(fp, policy=default)\n" +"\n" +" try:\n" +" os.mkdir(args.directory)\n" +" except FileExistsError:\n" +" pass\n" +"\n" +" counter = 1\n" +" for part in msg.walk():\n" +" # multipart/* are just containers\n" +" if part.get_content_maintype() == 'multipart':\n" +" continue\n" +" # Applications should really sanitize the given filename so that " +"an\n" +" # email message can't be used to overwrite important files\n" +" filename = part.get_filename()\n" +" if not filename:\n" +" ext = mimetypes.guess_extension(part.get_content_type())\n" +" if not ext:\n" +" # Use a generic bag-of-bits extension\n" +" ext = '.bin'\n" +" filename = f'part-{counter:03d}{ext}'\n" +" counter += 1\n" +" with open(os.path.join(args.directory, filename), 'wb') as fp:\n" +" fp.write(part.get_payload(decode=True))\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" -msgid "Here's an example of how to create an HTML message with an alternative plain text version. To make things a bit more interesting, we include a related image in the html part, and we save a copy of what we are going to send to disk, as well as sending it." +msgid "" +"Here's an example of how to create an HTML message with an alternative " +"plain text version. To make things a bit more interesting, we include a " +"related image in the html part, and we save a copy of what we are going to " +"send to disk, as well as sending it." msgstr "" +"در اینجا مثالی از نحوه ایجاد یک پیام HTML با یک نسخه جایگزین به‌صورت متن " +"ساده آورده شده است. برای کمی جالب‌تر شدن موضوع، یک تصویر مرتبط در بخش HTML " +"قرار می‌دهیم و یک نسخه از آنچه قرار است ارسال شود را روی دیسک ذخیره می‌کنیم و " +"همچنین آن را ارسال می‌کنیم." msgid "" "#!/usr/bin/env python3\n" @@ -278,8 +537,10 @@ msgid "" "msg = EmailMessage()\n" "msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" "msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" -"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" -" Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" +"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", " +"\"example.com\"),\n" +" Address(\"Fabrette Pussycat\", \"fabrette\", " +"\"example.com\"))\n" "msg.set_content(\"\"\"\\\n" "Salut!\n" "\n" @@ -290,8 +551,10 @@ msgid "" "--Pepé\n" "\"\"\")\n" "\n" -"# Add the html version. This converts the message into a multipart/alternative\n" -"# container, with the original text message as the first part and the new html\n" +"# Add the html version. This converts the message into a multipart/" +"alternative\n" +"# container, with the original text message as the first part and the new " +"html\n" "# message as the second part.\n" "asparagus_cid = make_msgid()\n" "msg.add_alternative(\"\"\"\\\n" @@ -300,7 +563,8 @@ msgid "" " \n" "

Salut!

\n" "

Cette\n" -" \n" +" \n" " recette\n" " sera sûrement un très bon repas.\n" "

\n" @@ -323,9 +587,74 @@ msgid "" "with smtplib.SMTP('localhost') as s:\n" " s.send_message(msg)\n" msgstr "" +"#!/usr/bin/env python3\n" +"\n" +"import smtplib\n" +"\n" +"from email.message import EmailMessage\n" +"from email.headerregistry import Address\n" +"from email.utils import make_msgid\n" +"\n" +"# Create the base text message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" +"msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" +"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", " +"\"example.com\"),\n" +" Address(\"Fabrette Pussycat\", \"fabrette\", " +"\"example.com\"))\n" +"msg.set_content(\"\"\"\\\n" +"Salut!\n" +"\n" +"Cette recette [1] sera sûrement un très bon repas.\n" +"\n" +"[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" +"\n" +"--Pepé\n" +"\"\"\")\n" +"\n" +"# Add the html version. This converts the message into a multipart/" +"alternative\n" +"# container, with the original text message as the first part and the new " +"html\n" +"# message as the second part.\n" +"asparagus_cid = make_msgid()\n" +"msg.add_alternative(\"\"\"\\\n" +"\n" +" \n" +" \n" +"

Salut!

\n" +"

Cette\n" +" \n" +" recette\n" +" sera sûrement un très bon repas.\n" +"

\n" +" \n" +" \n" +"\n" +"\"\"\".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')\n" +"# note that we needed to peel the <> off the msgid for use in the html.\n" +"\n" +"# Now add the related image to the html part.\n" +"with open(\"roasted-asparagus.jpg\", 'rb') as img:\n" +" msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',\n" +" cid=asparagus_cid)\n" +"\n" +"# Make a local copy of what we are going to send.\n" +"with open('outgoing.msg', 'wb') as f:\n" +" f.write(bytes(msg))\n" +"\n" +"# Send the message via local SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" -msgid "If we were sent the message from the last example, here is one way we could process it:" +msgid "" +"If we were sent the message from the last example, here is one way we could " +"process it:" msgstr "" +"اگر پیام مثال پیشین برای ما ارسال شده باشد، یکی از راه‌های پردازش آن به این " +"صورت است:" msgid "" "import os\n" @@ -342,7 +671,8 @@ msgid "" "def magic_html_parser(html_text, partfiles):\n" " \"\"\"Return safety-sanitized html linked to partfiles.\n" "\n" -" Rewrite the href=\"cid:....\" attributes to point to the filenames in partfiles.\n" +" Rewrite the href=\"cid:....\" attributes to point to the filenames in " +"partfiles.\n" " Though not trivial, this should be possible using html.parser.\n" " \"\"\"\n" " raise NotImplementedError(\"Add the magic needed\")\n" @@ -352,15 +682,19 @@ msgid "" "with open('outgoing.msg', 'rb') as fp:\n" " msg = BytesParser(policy=policy.default).parse(fp)\n" "\n" -"# Now the header items can be accessed as a dictionary, and any non-ASCII will\n" +"# Now the header items can be accessed as a dictionary, and any non-ASCII " +"will\n" "# be converted to unicode:\n" "print('To:', msg['to'])\n" "print('From:', msg['from'])\n" "print('Subject:', msg['subject'])\n" "\n" -"# If we want to print a preview of the message content, we can extract whatever\n" -"# the least formatted payload is and print the first three lines. Of course,\n" -"# if the message has no plain text part printing the first three lines of html\n" +"# If we want to print a preview of the message content, we can extract " +"whatever\n" +"# the least formatted payload is and print the first three lines. Of " +"course,\n" +"# if the message has no plain text part printing the first three lines of " +"html\n" "# is probably useless, but this is just a conceptual example.\n" "simplest = msg.get_body(preferencelist=('plain', 'html'))\n" "print()\n" @@ -381,7 +715,8 @@ msgid "" " elif richest['content-type'].subtype == 'html':\n" " body = richest\n" " else:\n" -" print(\"Don't know how to display {}\".format(richest.get_content_type()))\n" +" print(\"Don't know how to display {}" +"\".format(richest.get_content_type()))\n" " sys.exit()\n" "elif richest['content-type'].content_type == 'multipart/related':\n" " body = richest.get_body(preferencelist=('html'))\n" @@ -391,12 +726,15 @@ msgid "" " extension = os.path.splitext(part.get_filename())[1]\n" " else:\n" " extension = mimetypes.guess_extension(part.get_content_type())\n" -" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as f:\n" +" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " +"f:\n" " f.write(part.get_content())\n" -" # again strip the <> to go from email form of cid to html form.\n" +" # again strip the <> to go from email form of cid to html " +"form.\n" " partfiles[part['content-id'][1:-1]] = f.name\n" "else:\n" -" print(\"Don't know how to display {}\".format(richest.get_content_type()))\n" +" print(\"Don't know how to display {}" +"\".format(richest.get_content_type()))\n" " sys.exit()\n" "with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" " f.write(magic_html_parser(body.get_content(), partfiles))\n" @@ -408,12 +746,101 @@ msgid "" "# Of course, there are lots of email messages that could break this simple\n" "# minded program, but it will handle the most common ones.\n" msgstr "" +"import os\n" +"import sys\n" +"import tempfile\n" +"import mimetypes\n" +"import webbrowser\n" +"\n" +"# Import the email modules we'll need\n" +"from email import policy\n" +"from email.parser import BytesParser\n" +"\n" +"\n" +"def magic_html_parser(html_text, partfiles):\n" +" \"\"\"Return safety-sanitized html linked to partfiles.\n" +"\n" +" Rewrite the href=\"cid:....\" attributes to point to the filenames in " +"partfiles.\n" +" Though not trivial, this should be possible using html.parser.\n" +" \"\"\"\n" +" raise NotImplementedError(\"Add the magic needed\")\n" +"\n" +"\n" +"# In a real program you'd get the filename from the arguments.\n" +"with open('outgoing.msg', 'rb') as fp:\n" +" msg = BytesParser(policy=policy.default).parse(fp)\n" +"\n" +"# Now the header items can be accessed as a dictionary, and any non-ASCII " +"will\n" +"# be converted to unicode:\n" +"print('To:', msg['to'])\n" +"print('From:', msg['from'])\n" +"print('Subject:', msg['subject'])\n" +"\n" +"# If we want to print a preview of the message content, we can extract " +"whatever\n" +"# the least formatted payload is and print the first three lines. Of " +"course,\n" +"# if the message has no plain text part printing the first three lines of " +"html\n" +"# is probably useless, but this is just a conceptual example.\n" +"simplest = msg.get_body(preferencelist=('plain', 'html'))\n" +"print()\n" +"print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))\n" +"\n" +"ans = input(\"View full message?\")\n" +"if ans.lower()[0] == 'n':\n" +" sys.exit()\n" +"\n" +"# We can extract the richest alternative in order to display it:\n" +"richest = msg.get_body()\n" +"partfiles = {}\n" +"if richest['content-type'].maintype == 'text':\n" +" if richest['content-type'].subtype == 'plain':\n" +" for line in richest.get_content().splitlines():\n" +" print(line)\n" +" sys.exit()\n" +" elif richest['content-type'].subtype == 'html':\n" +" body = richest\n" +" else:\n" +" print(\"Don't know how to display {}" +"\".format(richest.get_content_type()))\n" +" sys.exit()\n" +"elif richest['content-type'].content_type == 'multipart/related':\n" +" body = richest.get_body(preferencelist=('html'))\n" +" for part in richest.iter_attachments():\n" +" fn = part.get_filename()\n" +" if fn:\n" +" extension = os.path.splitext(part.get_filename())[1]\n" +" else:\n" +" extension = mimetypes.guess_extension(part.get_content_type())\n" +" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " +"f:\n" +" f.write(part.get_content())\n" +" # again strip the <> to go from email form of cid to html " +"form.\n" +" partfiles[part['content-id'][1:-1]] = f.name\n" +"else:\n" +" print(\"Don't know how to display {}" +"\".format(richest.get_content_type()))\n" +" sys.exit()\n" +"with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" +" f.write(magic_html_parser(body.get_content(), partfiles))\n" +"webbrowser.open(f.name)\n" +"os.remove(f.name)\n" +"for fn in partfiles.values():\n" +" os.remove(fn)\n" +"\n" +"# Of course, there are lots of email messages that could break this simple\n" +"# minded program, but it will handle the most common ones.\n" msgid "Up to the prompt, the output from the above is:" -msgstr "" +msgstr "تا اعلان، خروجی مورد بالا به این صورت است:" msgid "" -"To: Penelope Pussycat , Fabrette Pussycat \n" +"To: Penelope Pussycat , Fabrette Pussycat " +"\n" "From: Pepé Le Pew \n" "Subject: Pourquoi pas des asperges pour ce midi ?\n" "\n" @@ -421,9 +848,18 @@ msgid "" "\n" "Cette recette [1] sera sûrement un très bon repas." msgstr "" +"To: Penelope Pussycat , Fabrette Pussycat " +"\n" +"From: Pepé Le Pew \n" +"Subject: چرا برای ناهار امروز مارچوبه نه؟\n" +"\n" +"سلام!\n" +"\n" +"این دستور پخت [1] قطعاً یک وعده غذایی بسیار خوب خواهد بود." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Thanks to Matthew Dixon Cowles for the original inspiration and examples." -msgstr "" +msgid "" +"Thanks to Matthew Dixon Cowles for the original inspiration and examples." +msgstr "سپاس از متیو دیکسون کاولز برای الهام و مثال‌های اولیه." diff --git a/library/email.generator.po b/library/email.generator.po index 17f1c5cdc..87b25eee5 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -24,124 +24,415 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.generator`: Generating MIME documents" -msgstr "" +msgstr ":mod:`!email.generator`: تولید اسناد MIME" msgid "**Source code:** :source:`Lib/email/generator.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/generator.py`" -msgid "One of the most common tasks is to generate the flat (serialized) version of the email message represented by a message object structure. You will need to do this if you want to send your message via :meth:`smtplib.SMTP.sendmail`, or print the message on the console. Taking a message object structure and producing a serialized representation is the job of the generator classes." -msgstr "" +msgid "" +"One of the most common tasks is to generate the flat (serialized) version of" +" the email message represented by a message object structure. You will need" +" to do this if you want to send your message via " +":meth:`smtplib.SMTP.sendmail`, or print the message on the console. Taking " +"a message object structure and producing a serialized representation is the " +"job of the generator classes." +msgstr "" +"یکی از رایج‌ترین وظایف، تولید نسخه‌ی تخت (سریال‌شده) پیام ایمیلی است که توسط " +"یک ساختار شیء پیام نمایش داده می‌شود. اگر بخواهید پیام خود را از طریق " +":meth:`smtplib.SMTP.sendmail` ارسال کنید، یا پیام را در کنسول چاپ کنید، باید" +" این کار را انجام دهید. دریافت یک ساختار شیء پیام و تولید یک بازنمایی " +"سریال‌شده، وظیفه‌ی کلاس‌های تولیدگر است." -msgid "As with the :mod:`email.parser` module, you aren't limited to the functionality of the bundled generator; you could write one from scratch yourself. However the bundled generator knows how to generate most email in a standards-compliant way, should handle MIME and non-MIME email messages just fine, and is designed so that the bytes-oriented parsing and generation operations are inverses, assuming the same non-transforming :mod:`~email.policy` is used for both. That is, parsing the serialized byte stream via the :class:`~email.parser.BytesParser` class and then regenerating the serialized byte stream using :class:`BytesGenerator` should produce output identical to the input [#]_. (On the other hand, using the generator on an :class:`~email.message.EmailMessage` constructed by program may result in changes to the :class:`~email.message.EmailMessage` object as defaults are filled in.)" -msgstr "" +msgid "" +"As with the :mod:`email.parser` module, you aren't limited to the " +"functionality of the bundled generator; you could write one from scratch " +"yourself. However the bundled generator knows how to generate most email in" +" a standards-compliant way, should handle MIME and non-MIME email messages " +"just fine, and is designed so that the bytes-oriented parsing and generation" +" operations are inverses, assuming the same non-transforming " +":mod:`~email.policy` is used for both. That is, parsing the serialized byte" +" stream via the :class:`~email.parser.BytesParser` class and then " +"regenerating the serialized byte stream using :class:`BytesGenerator` should" +" produce output identical to the input [#]_. (On the other hand, using the " +"generator on an :class:`~email.message.EmailMessage` constructed by program " +"may result in changes to the :class:`~email.message.EmailMessage` object as " +"defaults are filled in.)" +msgstr "" +"مانند ماژول :mod:`email.parser`، شما محدود به کارکرد تولیدگر همراه نیستید؛ " +"می‌توانید خودتان یکی را از صفر بنویسید. با این حال، تولیدگر همراه می‌داند " +"چگونه بیشتر پیام‌های ایمیل را به‌صورت سازگار با استانداردها تولید کند، باید" +" پیام‌های ایمیل MIME و غیر MIME را به‌خوبی مدیریت کند، و به‌گونه‌ای طراحی " +"شده است که عملیات تجزیه و تولید مبتنی بر بایت معکوس یکدیگر باشند، به‌شرط " +"آنکه برای هر دو از همان سیاست بدون تبدیل :mod:`~email.policy` استفاده شود. " +"یعنی تجزیه‌ی جریان بایت سریال‌شده از طریق کلاس " +":class:`~email.parser.BytesParser` و سپس تولید مجدد جریان بایت سریال‌شده با " +"استفاده از :class:`BytesGenerator` باید خروجی‌ای کاملاً یکسان با ورودی تولید" +" کند [#]_. (از سوی دیگر، استفاده از تولیدگر روی یک " +":class:`~email.message.EmailMessage` که به‌صورت برنامه‌ای ساخته شده است ممکن" +" است باعث ایجاد تغییراتی در شیء :class:`~email.message.EmailMessage` شود، " +"زیرا مقادیر پیش‌فرض پر می‌شوند.)" -msgid "The :class:`Generator` class can be used to flatten a message into a text (as opposed to binary) serialized representation, but since Unicode cannot represent binary data directly, the message is of necessity transformed into something that contains only ASCII characters, using the standard email RFC Content Transfer Encoding techniques for encoding email messages for transport over channels that are not \"8 bit clean\"." -msgstr "" +msgid "" +"The :class:`Generator` class can be used to flatten a message into a text " +"(as opposed to binary) serialized representation, but since Unicode cannot " +"represent binary data directly, the message is of necessity transformed into" +" something that contains only ASCII characters, using the standard email RFC" +" Content Transfer Encoding techniques for encoding email messages for " +"transport over channels that are not \"8 bit clean\"." +msgstr "" +"می‌توان از کلاس :class:`Generator` برای تبدیل یک پیام به یک نمایش " +"سریال‌سازی‌شده‌ی متنی (در مقابل دودویی) استفاده کرد، اما از آن‌جا که یونیکد " +"نمی‌تواند داده‌های دودویی را مستقیماً بازنمایی کند، پیام ناگزیر با استفاده " +"از روش‌های استاندارد RFC ایمیل برای کدگذاری انتقال محتوا (Content Transfer " +"Encoding) جهت کدگذاری پیام‌های ایمیل برای انتقال بر روی کانال‌هایی که «8 bit" +" clean» نیستند، به چیزی تبدیل می‌شود که فقط شامل نویسه‌های ASCII باشد." -msgid "To accommodate reproducible processing of SMIME-signed messages :class:`Generator` disables header folding for message parts of type ``multipart/signed`` and all subparts." +msgid "" +"To accommodate reproducible processing of SMIME-signed messages " +":class:`Generator` disables header folding for message parts of type " +"``multipart/signed`` and all subparts." msgstr "" +"برای پشتیبانی از پردازش بازتولیدپذیر پیام‌های امضاشده با SMIME، " +":class:`Generator` شکستن سرآیند (header folding) را برای بخش‌های پیام از نوع " +"``multipart/signed`` و همه زیربخش‌ها غیرفعال می‌کند." -msgid "Return a :class:`BytesGenerator` object that will write any message provided to the :meth:`flatten` method, or any surrogateescape encoded text provided to the :meth:`write` method, to the :term:`file-like object` *outfp*. *outfp* must support a ``write`` method that accepts binary data." +msgid "" +"Return a :class:`BytesGenerator` object that will write any message provided" +" to the :meth:`flatten` method, or any surrogateescape encoded text provided" +" to the :meth:`write` method, to the :term:`file-like object` *outfp*. " +"*outfp* must support a ``write`` method that accepts binary data." msgstr "" +"یک شیء :class:`BytesGenerator` برمی‌گرداند که هر پیام ارائه‌شده به متد " +":meth:`flatten`، یا هر متن کدگذاری‌شده با surrogateescape ارائه‌شده به متد " +":meth:`write` را در :term:`file-like object` *outfp* می‌نویسد. *outfp* باید " +"از یک متد ``write`` پشتیبانی کند که داده‌های دودویی را می‌پذیرد." -msgid "If optional *mangle_from_* is ``True``, put a ``>`` character in front of any line in the body that starts with the exact string ``\"From \"``, that is ``From`` followed by a space at the beginning of a line. *mangle_from_* defaults to the value of the :attr:`~email.policy.Policy.mangle_from_` setting of the *policy* (which is ``True`` for the :data:`~email.policy.compat32` policy and ``False`` for all others). *mangle_from_* is intended for use when messages are stored in Unix mbox format (see :mod:`mailbox` and `WHY THE CONTENT-LENGTH FORMAT IS BAD `_)." -msgstr "" +msgid "" +"If optional *mangle_from_* is ``True``, put a ``>`` character in front of " +"any line in the body that starts with the exact string ``\"From \"``, that " +"is ``From`` followed by a space at the beginning of a line. *mangle_from_* " +"defaults to the value of the :attr:`~email.policy.Policy.mangle_from_` " +"setting of the *policy* (which is ``True`` for the " +":data:`~email.policy.compat32` policy and ``False`` for all others). " +"*mangle_from_* is intended for use when messages are stored in Unix mbox " +"format (see :mod:`mailbox` and `WHY THE CONTENT-LENGTH FORMAT IS BAD " +"`_)." +msgstr "" +"اگر *mangle_from_* اختیاری ``True`` باشد، یک نویسه ``>`` در ابتدای هر خط از " +"بدنه که با رشته دقیق ``\"From \"`` شروع می‌شود، قرار می‌گیرد، یعنی ``From`` " +"و به‌دنبال آن یک فاصله در ابتدای خط. مقدار پیش‌فرض *mangle_from_* برابر با " +"مقدار تنظیم :attr:`~email.policy.Policy.mangle_from_` در *policy* است (که " +"برای سیاست :data:`~email.policy.compat32` برابر ``True`` و برای همه " +"سیاست‌های دیگر ``False`` است). *mangle_from_* برای استفاده در مواردی در نظر " +"گرفته شده است که پیام‌ها در قالب mbox یونیکس ذخیره می‌شوند (ببینید " +":mod:`mailbox` و `WHY THE CONTENT-LENGTH FORMAT IS BAD " +"`_)." -msgid "If *maxheaderlen* is not ``None``, refold any header lines that are longer than *maxheaderlen*, or if ``0``, do not rewrap any headers. If *manheaderlen* is ``None`` (the default), wrap headers and other message lines according to the *policy* settings." +msgid "" +"If *maxheaderlen* is not ``None``, refold any header lines that are longer " +"than *maxheaderlen*, or if ``0``, do not rewrap any headers. If " +"*manheaderlen* is ``None`` (the default), wrap headers and other message " +"lines according to the *policy* settings." msgstr "" +"اگر *maxheaderlen* برابر ``None`` نباشد، هر خط سرصفحه‌ای که طولانی‌تر از " +"*maxheaderlen* باشد دوباره تا زده می‌شود، یا اگر ``0`` باشد، هیچ سرصفحه‌ای " +"دوباره پیچیده نمی‌شود. اگر *manheaderlen* برابر ``None`` باشد (پیش‌فرض)، " +"سرصفحه‌ها و سایر خط‌های پیام طبق تنظیمات *policy* پیچیده می‌شوند." -msgid "If *policy* is specified, use that policy to control message generation. If *policy* is ``None`` (the default), use the policy associated with the :class:`~email.message.Message` or :class:`~email.message.EmailMessage` object passed to ``flatten`` to control the message generation. See :mod:`email.policy` for details on what *policy* controls." -msgstr "" +msgid "" +"If *policy* is specified, use that policy to control message generation. If" +" *policy* is ``None`` (the default), use the policy associated with the " +":class:`~email.message.Message` or :class:`~email.message.EmailMessage` " +"object passed to ``flatten`` to control the message generation. See " +":mod:`email.policy` for details on what *policy* controls." +msgstr "" +"اگر *policy* مشخص شده باشد، از آن سیاست برای کنترل تولید پیام استفاده " +"می‌شود. اگر *policy* برابر ``None`` باشد (پیش‌فرض)، از سیاست مرتبط با شیء " +":class:`~email.message.Message` یا :class:`~email.message.EmailMessage` " +"ارسال‌شده به ``flatten`` برای کنترل تولید پیام استفاده می‌شود. برای جزئیات " +"درباره اینکه *policy* چه چیزی را کنترل می‌کند، :mod:`email.policy` را " +"ببینید." msgid "Added the *policy* keyword." -msgstr "" +msgstr "کلیدواژه‌ی *policy* افزوده شد." -msgid "The default behavior of the *mangle_from_* and *maxheaderlen* parameters is to follow the policy." +msgid "" +"The default behavior of the *mangle_from_* and *maxheaderlen* parameters is " +"to follow the policy." msgstr "" +"رفتار پیش‌فرض پارامترهای *mangle_from_* و *maxheaderlen* پیروی از سیاست است." -msgid "Print the textual representation of the message object structure rooted at *msg* to the output file specified when the :class:`BytesGenerator` instance was created." +msgid "" +"Print the textual representation of the message object structure rooted at " +"*msg* to the output file specified when the :class:`BytesGenerator` instance" +" was created." msgstr "" +"نمایش متنی ساختار شیء پیام ریشه‌گرفته از *msg* را در فایل خروجی مشخص‌شده " +"هنگام ایجاد نمونه :class:`BytesGenerator` چاپ می‌کند." -msgid "If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is ``8bit`` (the default), copy any headers in the original parsed message that have not been modified to the output with any bytes with the high bit set reproduced as in the original, and preserve the non-ASCII :mailheader:`Content-Transfer-Encoding` of any body parts that have them. If ``cte_type`` is ``7bit``, convert the bytes with the high bit set as needed using an ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is, transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible :mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII bytes in headers using the MIME ``unknown-8bit`` character set, thus rendering them RFC-compliant." -msgstr "" +msgid "" +"If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " +"``8bit`` (the default), copy any headers in the original parsed message that" +" have not been modified to the output with any bytes with the high bit set " +"reproduced as in the original, and preserve the non-ASCII " +":mailheader:`Content-Transfer-Encoding` of any body parts that have them. If" +" ``cte_type`` is ``7bit``, convert the bytes with the high bit set as needed" +" using an ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is," +" transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding` " +"(:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible " +":mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII " +"bytes in headers using the MIME ``unknown-8bit`` character set, thus " +"rendering them RFC-compliant." +msgstr "" +"اگر گزینه‌ی :mod:`~email.policy` یعنی :attr:`~email.policy.Policy.cte_type` " +"برابر ``8bit`` باشد (پیش‌فرض)، تمام سرآیندهای موجود در پیام اصلی تجزیه‌شده " +"که تغییر نکرده‌اند، به خروجی کپی می‌شوند، به‌گونه‌ای که بایت‌هایی که بیت " +"بالایی آن‌ها تنظیم‌شده است، همان‌طور که در پیام اصلی بوده‌اند بازتولید شوند،" +" و :mailheader:`Content-Transfer-Encoding` غیر ASCII هر بخش بدنه‌ای که دارای" +" آن است حفظ می‌شود. اگر ``cte_type`` برابر ``7bit`` باشد، بایت‌هایی که بیت " +"بالایی آن‌ها تنظیم‌شده است، در صورت نیاز با استفاده از یک " +":mailheader:`Content-Transfer-Encoding` سازگار با ASCII تبدیل می‌شوند. یعنی " +"بخش‌هایی که :mailheader:`Content-Transfer-Encoding` غیر ASCII دارند " +"(:mailheader:`Content-Transfer-Encoding: 8bit`)، به یک :mailheader:`Content-" +"Transfer-Encoding` سازگار با ASCII تبدیل می‌شوند، و بایت‌های غیر ASCII " +"نامعتبر از نظر RFC در سرآیندها، با استفاده از مجموعه‌نویسه‌ی ``unknown-8bit``" +" در MIME کدگذاری می‌شوند، و بدین ترتیب، آن‌ها را با RFC سازگار می‌کند." -msgid "If *unixfrom* is ``True``, print the envelope header delimiter used by the Unix mailbox format (see :mod:`mailbox`) before the first of the :rfc:`5322` headers of the root message object. If the root object has no envelope header, craft a standard one. The default is ``False``. Note that for subparts, no envelope header is ever printed." -msgstr "" +msgid "" +"If *unixfrom* is ``True``, print the envelope header delimiter used by the " +"Unix mailbox format (see :mod:`mailbox`) before the first of the :rfc:`5322`" +" headers of the root message object. If the root object has no envelope " +"header, craft a standard one. The default is ``False``. Note that for " +"subparts, no envelope header is ever printed." +msgstr "" +"اگر *unixfrom* برابر ``True`` باشد، جداکننده‌ی سرآیند پاکت (envelope header " +"delimiter) که در قالب صندوق پستی یونیکس استفاده می‌شود (به :mod:`mailbox` " +"مراجعه کنید) پیش از نخستین سرآیند از سرآیندهای :rfc:`5322` شیء پیام ریشه درج " +"می‌شود. اگر شیء ریشه سرآیند پاکت نداشته باشد، یک سرآیند پاکت استاندارد ایجاد " +"می‌شود. مقدار پیش‌فرض ``False`` است. توجه داشته باشید که برای زیربخش‌ها، " +"هرگز هیچ سرآیند پاکتی درج نمی‌شود." -msgid "If *linesep* is not ``None``, use it as the separator character between all the lines of the flattened message. If *linesep* is ``None`` (the default), use the value specified in the *policy*." +msgid "" +"If *linesep* is not ``None``, use it as the separator character between all " +"the lines of the flattened message. If *linesep* is ``None`` (the default)," +" use the value specified in the *policy*." msgstr "" +"اگر *linesep* ``None`` نباشد، از آن به‌عنوان نویسه جداکننده میان تمام خطوط " +"پیام مسطح‌شده استفاده می‌شود. اگر *linesep* ``None`` باشد (پیش‌فرض)، از " +"مقدار تعیین‌شده در *policy* استفاده می‌شود." -msgid "Return an independent clone of this :class:`BytesGenerator` instance with the exact same option settings, and *fp* as the new *outfp*." +msgid "" +"Return an independent clone of this :class:`BytesGenerator` instance with " +"the exact same option settings, and *fp* as the new *outfp*." msgstr "" +"یک رونوشت (clone) مستقل از این نمونه‌ی :class:`BytesGenerator` با دقیقاً همان " +"تنظیمات گزینه‌ها، و با *fp* به‌عنوان *outfp* جدید برمی‌گرداند." -msgid "Encode *s* using the ``ASCII`` codec and the ``surrogateescape`` error handler, and pass it to the *write* method of the *outfp* passed to the :class:`BytesGenerator`'s constructor." +msgid "" +"Encode *s* using the ``ASCII`` codec and the ``surrogateescape`` error " +"handler, and pass it to the *write* method of the *outfp* passed to the " +":class:`BytesGenerator`'s constructor." msgstr "" +"*s* را با کدک ``ASCII`` و مدیر خطای ``surrogateescape`` کدگذاری کنید و آن را" +" به متد *write* از *outfp* که به سازنده‌ی :class:`BytesGenerator` ارسال شده " +"است، بفرستید." -msgid "As a convenience, :class:`~email.message.EmailMessage` provides the methods :meth:`~email.message.EmailMessage.as_bytes` and ``bytes(aMessage)`` (a.k.a. :meth:`~email.message.EmailMessage.__bytes__`), which simplify the generation of a serialized binary representation of a message object. For more detail, see :mod:`email.message`." -msgstr "" +msgid "" +"As a convenience, :class:`~email.message.EmailMessage` provides the methods " +":meth:`~email.message.EmailMessage.as_bytes` and ``bytes(aMessage)`` (a.k.a." +" :meth:`~email.message.EmailMessage.__bytes__`), which simplify the " +"generation of a serialized binary representation of a message object. For " +"more detail, see :mod:`email.message`." +msgstr "" +"برای سهولت، :class:`~email.message.EmailMessage` متدهای " +":meth:`~email.message.EmailMessage.as_bytes` و ``bytes(aMessage)`` (که به " +":meth:`~email.message.EmailMessage.__bytes__` نیز شناخته می‌شود) را فراهم " +"می‌کند، که تولید یک نمایش دودویی سریال‌شده از یک شیء پیام را ساده می‌کنند. " +"برای جزئیات بیشتر، :mod:`email.message` را ببینید." -msgid "Because strings cannot represent binary data, the :class:`Generator` class must convert any binary data in any message it flattens to an ASCII compatible format, by converting them to an ASCII compatible :mailheader:`Content-Transfer_Encoding`. Using the terminology of the email RFCs, you can think of this as :class:`Generator` serializing to an I/O stream that is not \"8 bit clean\". In other words, most applications will want to be using :class:`BytesGenerator`, and not :class:`Generator`." -msgstr "" +msgid "" +"Because strings cannot represent binary data, the :class:`Generator` class " +"must convert any binary data in any message it flattens to an ASCII " +"compatible format, by converting them to an ASCII compatible " +":mailheader:`Content-Transfer_Encoding`. Using the terminology of the email" +" RFCs, you can think of this as :class:`Generator` serializing to an I/O " +"stream that is not \"8 bit clean\". In other words, most applications will " +"want to be using :class:`BytesGenerator`, and not :class:`Generator`." +msgstr "" +"از آن‌جا که رشته‌ها نمی‌توانند داده‌های دودویی را نشان دهند، کلاس " +":class:`Generator` باید هرگونه داده‌ی دودویی موجود در هر پیامی را که به‌صورت" +" مسطح درمی‌آورد، با تبدیل آن به یک :mailheader:`Content-Transfer_Encoding` " +"سازگار با ASCII، به قالبی سازگار با ASCII تبدیل کند. با استفاده از اصطلاحات " +"RFCهای ایمیل، می‌توانید این‌طور تصور کنید که :class:`Generator` در حال " +"سریال‌سازی به یک جریان ورودی/خروجی است که «8 bit clean» نیست. به بیان دیگر، " +"بیشتر برنامه‌ها خواهند خواست از :class:`BytesGenerator` استفاده کنند، نه " +":class:`Generator`." -msgid "Return a :class:`Generator` object that will write any message provided to the :meth:`flatten` method, or any text provided to the :meth:`write` method, to the :term:`file-like object` *outfp*. *outfp* must support a ``write`` method that accepts string data." +msgid "" +"Return a :class:`Generator` object that will write any message provided to " +"the :meth:`flatten` method, or any text provided to the :meth:`write` " +"method, to the :term:`file-like object` *outfp*. *outfp* must support a " +"``write`` method that accepts string data." msgstr "" +"یک شیء :class:`Generator` بازگشت می‌دهد که هر پیام ارائه‌شده به متد " +":meth:`flatten`، یا هر متن ارائه‌شده به متد :meth:`write` را در :term:`file-" +"like object` *outfp* می‌نویسد. *outfp* باید از یک متد ``write`` پشتیبانی کند" +" که داده‌های رشته‌ای را می‌پذیرد." -msgid "Print the textual representation of the message object structure rooted at *msg* to the output file specified when the :class:`Generator` instance was created." +msgid "" +"Print the textual representation of the message object structure rooted at " +"*msg* to the output file specified when the :class:`Generator` instance was " +"created." msgstr "" +"نمایش متنی ساختار شیء پیام که ریشه در *msg* دارد را به فایل خروجی مشخص‌شده " +"در زمان ایجاد نمونه‌ی :class:`Generator` چاپ می‌کند." -msgid "If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is ``8bit``, generate the message as if the option were set to ``7bit``. (This is required because strings cannot represent non-ASCII bytes.) Convert any bytes with the high bit set as needed using an ASCII-compatible :mailheader:`Content-Transfer-Encoding`. That is, transform parts with non-ASCII :mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-Transfer-Encoding: 8bit`) to an ASCII compatible :mailheader:`Content-Transfer-Encoding`, and encode RFC-invalid non-ASCII bytes in headers using the MIME ``unknown-8bit`` character set, thus rendering them RFC-compliant." -msgstr "" +msgid "" +"If the :mod:`~email.policy` option :attr:`~email.policy.Policy.cte_type` is " +"``8bit``, generate the message as if the option were set to ``7bit``. (This " +"is required because strings cannot represent non-ASCII bytes.) Convert any " +"bytes with the high bit set as needed using an ASCII-compatible " +":mailheader:`Content-Transfer-Encoding`. That is, transform parts with non-" +"ASCII :mailheader:`Content-Transfer-Encoding` (:mailheader:`Content-" +"Transfer-Encoding: 8bit`) to an ASCII compatible :mailheader:`Content-" +"Transfer-Encoding`, and encode RFC-invalid non-ASCII bytes in headers using " +"the MIME ``unknown-8bit`` character set, thus rendering them RFC-compliant." +msgstr "" +"اگر گزینه‌ی :attr:`~email.policy.Policy.cte_type` در :mod:`~email.policy` " +"برابر ``8bit`` باشد، پیام به‌گونه‌ای تولید می‌شود که گویی این گزینه روی " +"``7bit`` تنظیم شده است. (این کار لازم است، زیرا رشته‌ها نمی‌توانند بایت‌های " +"غیرASCII را بازنمایی کنند.) بایت‌هایی که بیت پرارزش آن‌ها ۱ است، در صورت " +"لزوم با استفاده از یک :mailheader:`Content-Transfer-Encoding` سازگار با " +"ASCII تبدیل می‌شوند. یعنی بخش‌هایی که :mailheader:`Content-Transfer-" +"Encoding` غیرASCII دارند (:mailheader:`Content-Transfer-Encoding: 8bit`) به" +" یک :mailheader:`Content-Transfer-Encoding` سازگار با ASCII تبدیل می‌شوند و " +"بایت‌های غیرASCII نامعتبر از نظر RFC در سرصفحه‌ها با استفاده از مجموعه " +"نویسه‌ی ``unknown-8bit`` در MIME کدگذاری می‌شوند، تا بدین ترتیب آن‌ها مطابق " +"RFC شوند." -msgid "Added support for re-encoding ``8bit`` message bodies, and the *linesep* argument." +msgid "" +"Added support for re-encoding ``8bit`` message bodies, and the *linesep* " +"argument." msgstr "" +"پشتیبانی از کدگذاری مجدد بدنه‌های پیام ``8bit`` و آرگومان *linesep* افزوده " +"شد." -msgid "Return an independent clone of this :class:`Generator` instance with the exact same options, and *fp* as the new *outfp*." +msgid "" +"Return an independent clone of this :class:`Generator` instance with the " +"exact same options, and *fp* as the new *outfp*." msgstr "" +"یک نسخه‌ی رونوشت (clone) از این نمونه‌ی :class:`Generator` با دقیقاً همان " +"گزینه‌ها و با *fp* به‌عنوان *outfp* جدید برمی‌گرداند." -msgid "Write *s* to the *write* method of the *outfp* passed to the :class:`Generator`'s constructor. This provides just enough file-like API for :class:`Generator` instances to be used in the :func:`print` function." +msgid "" +"Write *s* to the *write* method of the *outfp* passed to the " +":class:`Generator`'s constructor. This provides just enough file-like API " +"for :class:`Generator` instances to be used in the :func:`print` function." msgstr "" +"*s* را با استفاده از متد *write* از *outfp* که به سازنده‌ی " +":class:`Generator` داده شده است، می‌نویسد. این کار API فایل‌مانند کافی را " +"برای استفاده از نمونه‌های :class:`Generator` در تابع :func:`print` فراهم " +"می‌کند." -msgid "As a convenience, :class:`~email.message.EmailMessage` provides the methods :meth:`~email.message.EmailMessage.as_string` and ``str(aMessage)`` (a.k.a. :meth:`~email.message.EmailMessage.__str__`), which simplify the generation of a formatted string representation of a message object. For more detail, see :mod:`email.message`." -msgstr "" +msgid "" +"As a convenience, :class:`~email.message.EmailMessage` provides the methods " +":meth:`~email.message.EmailMessage.as_string` and ``str(aMessage)`` (a.k.a. " +":meth:`~email.message.EmailMessage.__str__`), which simplify the generation " +"of a formatted string representation of a message object. For more detail, " +"see :mod:`email.message`." +msgstr "" +"برای سهولت، :class:`~email.message.EmailMessage` متدهای " +":meth:`~email.message.EmailMessage.as_string` و ``str(aMessage)`` (یا همان " +":meth:`~email.message.EmailMessage.__str__`) را فراهم می‌کند، که تولید یک " +"نمایش رشته‌ای قالب‌بندی‌شده از یک شیء پیام را ساده می‌کنند. برای جزئیات " +"بیشتر، :mod:`email.message` را ببینید." -msgid "The :mod:`!email.generator` module also provides a derived class, :class:`DecodedGenerator`, which is like the :class:`Generator` base class, except that non-\\ :mimetype:`text` parts are not serialized, but are instead represented in the output stream by a string derived from a template filled in with information about the part." -msgstr "" +msgid "" +"The :mod:`!email.generator` module also provides a derived class, " +":class:`DecodedGenerator`, which is like the :class:`Generator` base class, " +"except that non-\\ :mimetype:`text` parts are not serialized, but are " +"instead represented in the output stream by a string derived from a template" +" filled in with information about the part." +msgstr "" +"ماژول :mod:`!email.generator` همچنین یک کلاس مشتق، " +":class:`DecodedGenerator`، ارائه می‌کند که مانند کلاس پایه‌ی " +":class:`Generator` است، با این تفاوت که بخش‌های غیر \\ :mimetype:`text` " +"سریال‌سازی نمی‌شوند، بلکه در جریان خروجی به‌وسیله‌ی رشته‌ای نمایش داده " +"می‌شوند که حاصل از الگویی است که با اطلاعات مربوط به آن بخش پر شده است." -msgid "Act like :class:`Generator`, except that for any subpart of the message passed to :meth:`Generator.flatten`, if the subpart is of main type :mimetype:`text`, print the decoded payload of the subpart, and if the main type is not :mimetype:`text`, instead of printing it fill in the string *fmt* using information from the part and print the resulting filled-in string." -msgstr "" +msgid "" +"Act like :class:`Generator`, except that for any subpart of the message " +"passed to :meth:`Generator.flatten`, if the subpart is of main type " +":mimetype:`text`, print the decoded payload of the subpart, and if the main " +"type is not :mimetype:`text`, instead of printing it fill in the string " +"*fmt* using information from the part and print the resulting filled-in " +"string." +msgstr "" +"مانند :class:`Generator` عمل می‌کند، با این تفاوت که برای هر زیربخشی از " +"پیامی که به :meth:`Generator.flatten` داده می‌شود، اگر زیربخش از نوع اصلی " +":mimetype:`text` باشد، بار کدگشایی‌شده‌ی آن زیربخش را چاپ می‌کند، و اگر نوع " +"اصلی :mimetype:`text` نباشد، به‌جای چاپ آن، رشته *fmt* را با استفاده از " +"اطلاعات آن بخش تکمیل می‌کند و رشته‌ی تکمیل‌شده‌ی حاصل را چاپ می‌کند." -msgid "To fill in *fmt*, execute ``fmt % part_info``, where ``part_info`` is a dictionary composed of the following keys and values:" +msgid "" +"To fill in *fmt*, execute ``fmt % part_info``, where ``part_info`` is a " +"dictionary composed of the following keys and values:" msgstr "" +"برای پر کردن *fmt*، دستور ``fmt % part_info`` را اجرا کنید، که در آن " +"``part_info`` یک دیکشنری متشکل از کلیدها و مقدارهای زیر است:" msgid "``type`` -- Full MIME type of the non-\\ :mimetype:`text` part" -msgstr "" +msgstr "``type`` -- نوع MIME کاملِ بخش غیرِ \\ :mimetype:`text`" msgid "``maintype`` -- Main MIME type of the non-\\ :mimetype:`text` part" -msgstr "" +msgstr "``maintype`` -- نوع MIME اصلیِ بخش غیرِ :mimetype:`text`" msgid "``subtype`` -- Sub-MIME type of the non-\\ :mimetype:`text` part" -msgstr "" +msgstr "``subtype`` -- زیرنوع MIME برای بخش غیر \\ :mimetype:`text`" msgid "``filename`` -- Filename of the non-\\ :mimetype:`text` part" -msgstr "" +msgstr "``filename`` -- نام فایل بخش غیر \\ :mimetype:`text`" -msgid "``description`` -- Description associated with the non-\\ :mimetype:`text` part" -msgstr "" +msgid "" +"``description`` -- Description associated with the non-\\ :mimetype:`text` " +"part" +msgstr "``description`` -- توضیح مرتبط با بخش غیر\\ :mimetype:`text`" -msgid "``encoding`` -- Content transfer encoding of the non-\\ :mimetype:`text` part" -msgstr "" +msgid "" +"``encoding`` -- Content transfer encoding of the non-\\ :mimetype:`text` " +"part" +msgstr "``encoding`` -- کدگذاری انتقال محتوا برای بخش غیر :mimetype:`text`" msgid "If *fmt* is ``None``, use the following default *fmt*:" -msgstr "" +msgstr "اگر *fmt* برابر ``None`` باشد، از *fmt* پیش‌فرض زیر استفاده کنید:" msgid "\"[Non-text (%(type)s) part of message omitted, filename %(filename)s]\"" -msgstr "" +msgstr "[بخش غیرمتنی (%(type)s) پیام حذف شد، نام فایل %(filename)s]" -msgid "Optional *_mangle_from_* and *maxheaderlen* are as with the :class:`Generator` base class." +msgid "" +"Optional *_mangle_from_* and *maxheaderlen* are as with the " +":class:`Generator` base class." msgstr "" +"آرگومان‌های اختیاری *_mangle_from_* و *maxheaderlen* همانند کلاس پایه‌ی " +":class:`Generator` هستند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "This statement assumes that you use the appropriate setting for ``unixfrom``, and that there are no :mod:`email.policy` settings calling for automatic adjustments (for example, :attr:`~email.policy.EmailPolicy.refold_source` must be ``none``, which is *not* the default). It is also not 100% true, since if the message does not conform to the RFC standards occasionally information about the exact original text is lost during parsing error recovery. It is a goal to fix these latter edge cases when possible." -msgstr "" +msgid "" +"This statement assumes that you use the appropriate setting for " +"``unixfrom``, and that there are no :mod:`email.policy` settings calling for" +" automatic adjustments (for example, " +":attr:`~email.policy.EmailPolicy.refold_source` must be ``none``, which is " +"*not* the default). It is also not 100% true, since if the message does not" +" conform to the RFC standards occasionally information about the exact " +"original text is lost during parsing error recovery. It is a goal to fix " +"these latter edge cases when possible." +msgstr "" +"این دستور فرض می‌کند که شما از تنظیم مناسب برای ``unixfrom`` استفاده " +"می‌کنید، و هیچ تنظیمی از :mod:`email.policy` وجود ندارد که نیازمند تنظیمات " +"خودکار باشد (برای مثال، :attr:`~email.policy.EmailPolicy.refold_source` باید" +" ``none`` باشد، که پیش‌فرض *نیست*). این نیز ۱۰۰٪ درست نیست، زیرا اگر پیام با" +" استانداردهای RFC مطابقت نداشته باشد، گاهی اطلاعاتی درباره‌ی متن اصلی دقیق در" +" حین بازیابی از خطای تجزیه از دست می‌رود. هدف این است که این موارد مرزی اخیر" +" در صورت امکان رفع شوند." diff --git a/library/email.header.po b/library/email.header.po index 6a5574c6d..22db6f1e6 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -24,25 +24,78 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.header`: Internationalized headers" -msgstr "" +msgstr ":mod:`!email.header`: سرآیندهای بین‌المللی‌سازی‌شده" msgid "**Source code:** :source:`Lib/email/header.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/header.py`" -msgid "This module is part of the legacy (``Compat32``) email API. In the current API encoding and decoding of headers is handled transparently by the dictionary-like API of the :class:`~email.message.EmailMessage` class. In addition to uses in legacy code, this module can be useful in applications that need to completely control the character sets used when encoding headers." -msgstr "" +msgid "" +"This module is part of the legacy (``Compat32``) email API. In the current " +"API encoding and decoding of headers is handled transparently by the " +"dictionary-like API of the :class:`~email.message.EmailMessage` class. In " +"addition to uses in legacy code, this module can be useful in applications " +"that need to completely control the character sets used when encoding " +"headers." +msgstr "" +"این ماژول بخشی از API ایمیل قدیمی (``Compat32``) است. در API کنونی، کدگذاری " +"و کدگشایی سرصفحه‌ها به‌صورت شفاف توسط API دیکشنری‌مانند کلاس " +":class:`~email.message.EmailMessage` انجام می‌شود. علاوه بر استفاده در کد " +"قدیمی، این ماژول می‌تواند در برنامه‌هایی که نیاز دارند مجموعه‌های نویسه‌ای " +"را که هنگام کدگذاری سرصفحه‌ها استفاده می‌شوند به‌طور کامل کنترل کنند، مفید " +"باشد." -msgid "The remaining text in this section is the original documentation of the module." -msgstr "" +msgid "" +"The remaining text in this section is the original documentation of the " +"module." +msgstr "متن باقی‌مانده در این بخش، مستندات اصلی ماژول است." -msgid ":rfc:`2822` is the base standard that describes the format of email messages. It derives from the older :rfc:`822` standard which came into widespread use at a time when most email was composed of ASCII characters only. :rfc:`2822` is a specification written assuming email contains only 7-bit ASCII characters." -msgstr "" +msgid "" +":rfc:`2822` is the base standard that describes the format of email " +"messages. It derives from the older :rfc:`822` standard which came into " +"widespread use at a time when most email was composed of ASCII characters " +"only. :rfc:`2822` is a specification written assuming email contains only " +"7-bit ASCII characters." +msgstr "" +":rfc:`2822` استاندارد پایه‌ای است که قالب پیام‌های ایمیل را توصیف می‌کند. " +"این استاندارد برگرفته از استاندارد قدیمی‌تر :rfc:`822` است که در زمانی " +"به‌طور گسترده‌ای استفاده می‌شد که بیشتر ایمیل‌ها فقط از نویسه‌های ASCII " +"تشکیل شده بودند. :rfc:`2822` مشخصاتی است که با این فرض نوشته شده است که " +"ایمیل فقط شامل نویسه‌های ASCII هفت‌بیتی است." -msgid "Of course, as email has been deployed worldwide, it has become internationalized, such that language specific character sets can now be used in email messages. The base standard still requires email messages to be transferred using only 7-bit ASCII characters, so a slew of RFCs have been written describing how to encode email containing non-ASCII characters into :rfc:`2822`\\ -compliant format. These RFCs include :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports these standards in its :mod:`!email.header` and :mod:`email.charset` modules." -msgstr "" +msgid "" +"Of course, as email has been deployed worldwide, it has become " +"internationalized, such that language specific character sets can now be " +"used in email messages. The base standard still requires email messages to " +"be transferred using only 7-bit ASCII characters, so a slew of RFCs have " +"been written describing how to encode email containing non-ASCII characters " +"into :rfc:`2822`\\ -compliant format. These RFCs include :rfc:`2045`, " +":rfc:`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports" +" these standards in its :mod:`!email.header` and :mod:`email.charset` " +"modules." +msgstr "" +"البته، از آن‌جا که ایمیل در سراسر جهان گسترش یافته است، بین‌المللی شده است، " +"به‌طوری که اکنون می‌توان از مجموعه‌نویسه‌های مختص هر زبان در پیام‌های ایمیل " +"استفاده کرد. استاندارد پایه همچنان نیاز دارد که پیام‌های ایمیل فقط با " +"نویسه‌های ASCII هفت‌بیتی منتقل شوند، بنابراین RFCهای متعددی نوشته شده‌اند " +"که نحوه‌ی کدگذاری ایمیل حاوی نویسه‌های غیر ASCII به قالب سازگار با " +":rfc:`2822` را توصیف می‌کنند. این RFCها شامل :rfc:`2045`، :rfc:`2046`، " +":rfc:`2047` و :rfc:`2231` هستند. بسته‌ی :mod:`email` از این استانداردها در " +"ماژول‌های :mod:`!email.header` و :mod:`email.charset` پشتیبانی می‌کند." -msgid "If you want to include non-ASCII characters in your email headers, say in the :mailheader:`Subject` or :mailheader:`To` fields, you should use the :class:`Header` class and assign the field in the :class:`~email.message.Message` object to an instance of :class:`Header` instead of using a string for the header value. Import the :class:`Header` class from the :mod:`!email.header` module. For example::" -msgstr "" +msgid "" +"If you want to include non-ASCII characters in your email headers, say in " +"the :mailheader:`Subject` or :mailheader:`To` fields, you should use the " +":class:`Header` class and assign the field in the " +":class:`~email.message.Message` object to an instance of :class:`Header` " +"instead of using a string for the header value. Import the :class:`Header` " +"class from the :mod:`!email.header` module. For example::" +msgstr "" +"اگر می‌خواهید نویسه‌های غیر ASCII را در سرآیندهای ایمیل خود بگنجانید، مثلاً " +"در فیلدهای :mailheader:`Subject` یا :mailheader:`To`، باید از کلاس " +":class:`Header` استفاده کنید و فیلد را در شیء " +":class:`~email.message.Message` به نمونه‌ای از :class:`Header` اختصاص دهید، " +"به‌جای آن‌که برای مقدار سرآیند از یک رشته استفاده کنید. کلاس :class:`Header` " +"را از ماژول :mod:`!email.header` ایمپورت کنید. برای مثال::" msgid "" ">>> from email.message import Message\n" @@ -53,117 +106,317 @@ msgid "" ">>> msg.as_string()\n" "'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" msgstr "" +">>> from email.message import Message\n" +">>> from email.header import Header\n" +">>> msg = Message()\n" +">>> h = Header('p\\xf6stal', 'iso-8859-1')\n" +">>> msg['Subject'] = h\n" +">>> msg.as_string()\n" +"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" -msgid "Notice here how we wanted the :mailheader:`Subject` field to contain a non-ASCII character? We did this by creating a :class:`Header` instance and passing in the character set that the byte string was encoded in. When the subsequent :class:`~email.message.Message` instance was flattened, the :mailheader:`Subject` field was properly :rfc:`2047` encoded. MIME-aware mail readers would show this header using the embedded ISO-8859-1 character." -msgstr "" +msgid "" +"Notice here how we wanted the :mailheader:`Subject` field to contain a non-" +"ASCII character? We did this by creating a :class:`Header` instance and " +"passing in the character set that the byte string was encoded in. When the " +"subsequent :class:`~email.message.Message` instance was flattened, the " +":mailheader:`Subject` field was properly :rfc:`2047` encoded. MIME-aware " +"mail readers would show this header using the embedded ISO-8859-1 character." +msgstr "" +"در اینجا توجه کنید که چگونه می‌خواستیم فیلد :mailheader:`Subject` حاوی یک " +"نویسه‌ی غیر ASCII باشد؟ این کار را با ایجاد یک نمونه از :class:`Header` و " +"ارسال مجموعه نویسه‌ای که رشته بایتی با آن کدگذاری شده بود، انجام دادیم. " +"هنگامی که نمونه بعدی :class:`~email.message.Message` به‌صورت رشته درآمد، " +"فیلد :mailheader:`Subject` به‌درستی مطابق :rfc:`2047` کدگذاری شد. " +"ایمیل‌خوان‌های آگاه از MIME، این سرآیند را با استفاده از نویسه‌ی ISO-8859-1 " +"جاسازی‌شده نمایش می‌دهند." msgid "Here is the :class:`Header` class description:" -msgstr "" +msgstr "در اینجا توضیح کلاس :class:`Header` آمده است:" -msgid "Create a MIME-compliant header that can contain strings in different character sets." +msgid "" +"Create a MIME-compliant header that can contain strings in different " +"character sets." msgstr "" +"یک سرآیند سازگار با MIME ایجاد کنید که بتواند حاوی رشته‌هایی در " +"مجموعه‌نویسه‌های مختلف باشد." -msgid "Optional *s* is the initial header value. If ``None`` (the default), the initial header value is not set. You can later append to the header with :meth:`append` method calls. *s* may be an instance of :class:`bytes` or :class:`str`, but see the :meth:`append` documentation for semantics." +msgid "" +"Optional *s* is the initial header value. If ``None`` (the default), the " +"initial header value is not set. You can later append to the header with " +":meth:`append` method calls. *s* may be an instance of :class:`bytes` or " +":class:`str`, but see the :meth:`append` documentation for semantics." msgstr "" +"آرگومان اختیاری *s*، مقدار اولیه‌ی سرآیند است. اگر ``None`` (پیش‌فرض) باشد، " +"مقدار اولیه‌ی سرآیند تنظیم نمی‌شود. می‌توانید بعداً با فراخوانی‌های متد " +":meth:`append` به سرآیند اضافه کنید. *s* ممکن است یک نمونه از :class:`bytes` " +"یا :class:`str` باشد، اما برای معناییات، مستندات :meth:`append` را ببینید." -msgid "Optional *charset* serves two purposes: it has the same meaning as the *charset* argument to the :meth:`append` method. It also sets the default character set for all subsequent :meth:`append` calls that omit the *charset* argument. If *charset* is not provided in the constructor (the default), the ``us-ascii`` character set is used both as *s*'s initial charset and as the default for subsequent :meth:`append` calls." -msgstr "" +msgid "" +"Optional *charset* serves two purposes: it has the same meaning as the " +"*charset* argument to the :meth:`append` method. It also sets the default " +"character set for all subsequent :meth:`append` calls that omit the " +"*charset* argument. If *charset* is not provided in the constructor (the " +"default), the ``us-ascii`` character set is used both as *s*'s initial " +"charset and as the default for subsequent :meth:`append` calls." +msgstr "" +"*charset* اختیاری دو هدف دارد: این آرگومان همان معنای آرگومان *charset* در " +"متد :meth:`append` را دارد. همچنین مجموعه نویسه‌ی پیش‌فرض را برای تمام " +"فراخوانی‌های بعدی :meth:`append` که در آن‌ها آرگومان *charset* ذکر نشده است،" +" تنظیم می‌کند. اگر *charset* در سازنده ارائه نشود (پیش‌فرض)، مجموعه نویسه‌ی " +"``us-ascii`` هم به‌عنوان مجموعه نویسه اولیه‌ی *s* و هم به‌عنوان پیش‌فرض برای" +" فراخوانی‌های بعدی :meth:`append` استفاده می‌شود." -msgid "The maximum line length can be specified explicitly via *maxlinelen*. For splitting the first line to a shorter value (to account for the field header which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name of the field in *header_name*. The default *maxlinelen* is 78, and the default value for *header_name* is ``None``, meaning it is not taken into account for the first line of a long, split header." -msgstr "" +msgid "" +"The maximum line length can be specified explicitly via *maxlinelen*. For " +"splitting the first line to a shorter value (to account for the field header" +" which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name " +"of the field in *header_name*. The default *maxlinelen* is 78, and the " +"default value for *header_name* is ``None``, meaning it is not taken into " +"account for the first line of a long, split header." +msgstr "" +"می‌توان حداکثر طول خط را به‌صورت صریح از طریق *maxlinelen* مشخص کرد. برای " +"شکستن خط اول به طول کوتاه‌تر (برای در نظر گرفتن سرآیند فیلد که در *s* لحاظ " +"نشده است، مثلاً :mailheader:`Subject`)، نام فیلد را در *header_name* وارد " +"کنید. مقدار پیش‌فرض *maxlinelen* برابر ۷۸ است و مقدار پیش‌فرض *header_name* " +"برابر ``None`` است، به این معنا که برای خط اولِ یک سرآیند طولانیِ شکسته‌شده " +"در نظر گرفته نمی‌شود." -msgid "Optional *continuation_ws* must be :rfc:`2822`\\ -compliant folding whitespace, and is usually either a space or a hard tab character. This character will be prepended to continuation lines. *continuation_ws* defaults to a single space character." +msgid "" +"Optional *continuation_ws* must be :rfc:`2822`\\ -compliant folding " +"whitespace, and is usually either a space or a hard tab character. This " +"character will be prepended to continuation lines. *continuation_ws* " +"defaults to a single space character." msgstr "" +"*continuation_ws* اختیاری باید فضای خالی برای تا کردن خطوط (folding " +"whitespace) سازگار با :rfc:`2822` باشد، و معمولاً یا یک فاصله است یا یک " +"نویسه‌ی تب سخت (hard tab). این نویسه به ابتدای خطوط ادامه افزوده می‌شود. " +"مقدار پیش‌فرض *continuation_ws* یک نویسه‌ی فاصله است." -msgid "Optional *errors* is passed straight through to the :meth:`append` method." -msgstr "" +msgid "" +"Optional *errors* is passed straight through to the :meth:`append` method." +msgstr "آرگومان اختیاری *errors* مستقیماً به متد :meth:`append` ارسال می‌شود." msgid "Append the string *s* to the MIME header." -msgstr "" +msgstr "رشته‌ی *s* را به سرآیند MIME می‌افزاید." -msgid "Optional *charset*, if given, should be a :class:`~email.charset.Charset` instance (see :mod:`email.charset`) or the name of a character set, which will be converted to a :class:`~email.charset.Charset` instance. A value of ``None`` (the default) means that the *charset* given in the constructor is used." -msgstr "" +msgid "" +"Optional *charset*, if given, should be a :class:`~email.charset.Charset` " +"instance (see :mod:`email.charset`) or the name of a character set, which " +"will be converted to a :class:`~email.charset.Charset` instance. A value of" +" ``None`` (the default) means that the *charset* given in the constructor is" +" used." +msgstr "" +"*charset* اختیاری، در صورت داده شدن، باید نمونه‌ای از " +":class:`~email.charset.Charset` (ببینید :mod:`email.charset`) یا نام یک " +"مجموعه‌ی نویسه باشد، که به نمونه‌ای از :class:`~email.charset.Charset` تبدیل" +" خواهد شد. مقدار ``None`` (پیش‌فرض) به این معناست که *charset* داده‌شده در " +"سازنده استفاده می‌شود." -msgid "*s* may be an instance of :class:`bytes` or :class:`str`. If it is an instance of :class:`bytes`, then *charset* is the encoding of that byte string, and a :exc:`UnicodeError` will be raised if the string cannot be decoded with that character set." +msgid "" +"*s* may be an instance of :class:`bytes` or :class:`str`. If it is an " +"instance of :class:`bytes`, then *charset* is the encoding of that byte " +"string, and a :exc:`UnicodeError` will be raised if the string cannot be " +"decoded with that character set." msgstr "" +"*s* می‌تواند نمونه‌ای از :class:`bytes` یا :class:`str` باشد. اگر نمونه‌ای " +"از :class:`bytes` باشد، آنگاه *charset* کدگذاری آن رشته بایتی است، و اگر " +"رشته نتواند با آن مجموعه نویسه کدگشایی شود، :exc:`UnicodeError` پرتاب خواهد " +"شد." -msgid "If *s* is an instance of :class:`str`, then *charset* is a hint specifying the character set of the characters in the string." +msgid "" +"If *s* is an instance of :class:`str`, then *charset* is a hint specifying " +"the character set of the characters in the string." msgstr "" +"اگر *s* نمونه‌ای از :class:`str` باشد، آنگاه *charset* راهنمایی است که " +"مجموعه نویسه‌های موجود در رشته را مشخص می‌کند." -msgid "In either case, when producing an :rfc:`2822`\\ -compliant header using :rfc:`2047` rules, the string will be encoded using the output codec of the charset. If the string cannot be encoded using the output codec, a UnicodeError will be raised." +msgid "" +"In either case, when producing an :rfc:`2822`\\ -compliant header using " +":rfc:`2047` rules, the string will be encoded using the output codec of the " +"charset. If the string cannot be encoded using the output codec, a " +"UnicodeError will be raised." msgstr "" +"در هر یک از این دو حالت، هنگام تولید سرآیندی مطابق با :rfc:`2822` با استفاده" +" از قوانین :rfc:`2047`، رشته با کدک خروجی مجموعه‌نویسه کدگذاری می‌شود. اگر " +"رشته با کدک خروجی قابل کدگذاری نباشد، یک UnicodeError پرتاب خواهد شد." -msgid "Optional *errors* is passed as the errors argument to the decode call if *s* is a byte string." +msgid "" +"Optional *errors* is passed as the errors argument to the decode call if *s*" +" is a byte string." msgstr "" +"اگر *s* یک رشته بایتی باشد، *errors* اختیاری به‌عنوان آرگومان errors به " +"فراخوانی decode ارسال می‌شود." -msgid "Encode a message header into an RFC-compliant format, possibly wrapping long lines and encapsulating non-ASCII parts in base64 or quoted-printable encodings." +msgid "" +"Encode a message header into an RFC-compliant format, possibly wrapping long" +" lines and encapsulating non-ASCII parts in base64 or quoted-printable " +"encodings." msgstr "" +"کدگذاری یک سرآیند پیام در قالبی مطابق با RFC، احتمالاً با شکستن خطوط طولانی و" +" بسته‌بندی بخش‌های غیر ASCII در کدگذاری‌های base64 یا quoted-printable." -msgid "Optional *splitchars* is a string containing characters which should be given extra weight by the splitting algorithm during normal header wrapping. This is in very rough support of :RFC:`2822`\\'s 'higher level syntactic breaks': split points preceded by a splitchar are preferred during line splitting, with the characters preferred in the order in which they appear in the string. Space and tab may be included in the string to indicate whether preference should be given to one over the other as a split point when other split chars do not appear in the line being split. Splitchars does not affect :RFC:`2047` encoded lines." -msgstr "" +msgid "" +"Optional *splitchars* is a string containing characters which should be " +"given extra weight by the splitting algorithm during normal header wrapping." +" This is in very rough support of :RFC:`2822`\\'s 'higher level syntactic " +"breaks': split points preceded by a splitchar are preferred during line " +"splitting, with the characters preferred in the order in which they appear " +"in the string. Space and tab may be included in the string to indicate " +"whether preference should be given to one over the other as a split point " +"when other split chars do not appear in the line being split. Splitchars " +"does not affect :RFC:`2047` encoded lines." +msgstr "" +"*splitchars* اختیاری، رشته‌ای است شامل نویسه‌هایی که الگوریتم شکستن باید در " +"جریان شکستن عادی خطوط سرایند، وزن بیشتری به آن‌ها بدهد. این موضوع، پشتیبانی " +"بسیار تقریبی از «شکست‌های نحوی سطح بالاتر» در :RFC:`2822` است: هنگام شکستن " +"خطوط، نقاط شکستی که پیش از آن‌ها یک نویسه‌ی شکست قرار دارد، ترجیح داده " +"می‌شوند و نویسه‌ها به همان ترتیبی که در رشته ظاهر می‌شوند، ترجیح داده " +"می‌شوند. فاصله و تب می‌توانند در رشته گنجانده شوند تا مشخص شود که در صورت " +"نبودن سایر نویسه‌های شکست در خطی که شکسته می‌شود، باید به کدام‌یک به‌عنوان " +"نقطه‌ی شکست ترجیح داده شود. Splitchars بر خط‌های کدگذاری‌شده‌ی :RFC:`2047` " +"تأثیری ندارد." -msgid "*maxlinelen*, if given, overrides the instance's value for the maximum line length." +msgid "" +"*maxlinelen*, if given, overrides the instance's value for the maximum line " +"length." msgstr "" +"اگر داده شود، *maxlinelen* مقدار نمونه برای حداکثر طول خط را نادیده می‌گیرد." -msgid "*linesep* specifies the characters used to separate the lines of the folded header. It defaults to the most useful value for Python application code (``\\n``), but ``\\r\\n`` can be specified in order to produce headers with RFC-compliant line separators." +msgid "" +"*linesep* specifies the characters used to separate the lines of the folded " +"header. It defaults to the most useful value for Python application code " +"(``\\n``), but ``\\r\\n`` can be specified in order to produce headers with " +"RFC-compliant line separators." msgstr "" +"*linesep* نویسه‌های استفاده‌شده برای جدا کردن خط‌های سرآیند تاشده را مشخص " +"می‌کند. مقدار پیش‌فرض آن مفیدترین مقدار برای کد برنامه پایتون (``\\n``) است،" +" اما می‌توان ``\\r\\n`` را مشخص کرد تا سرآیندهایی با جداکننده‌های خط منطبق " +"با RFC تولید شوند." msgid "Added the *linesep* argument." -msgstr "" +msgstr "آرگومان *linesep* افزوده شد." -msgid "The :class:`Header` class also provides a number of methods to support standard operators and built-in functions." +msgid "" +"The :class:`Header` class also provides a number of methods to support " +"standard operators and built-in functions." msgstr "" +"کلاس :class:`Header` همچنین تعدادی متد برای پشتیبانی از عملگرهای استاندارد و" +" توابع توکار فراهم می‌کند." -msgid "Returns an approximation of the :class:`Header` as a string, using an unlimited line length. All pieces are converted to unicode using the specified encoding and joined together appropriately. Any pieces with a charset of ``'unknown-8bit'`` are decoded as ASCII using the ``'replace'`` error handler." -msgstr "" +msgid "" +"Returns an approximation of the :class:`Header` as a string, using an " +"unlimited line length. All pieces are converted to unicode using the " +"specified encoding and joined together appropriately. Any pieces with a " +"charset of ``'unknown-8bit'`` are decoded as ASCII using the ``'replace'`` " +"error handler." +msgstr "" +"تقریبی از :class:`Header` را به‌صورت یک رشته، با استفاده از طول خط نامحدود " +"برمی‌گرداند. تمام بخش‌ها با استفاده از کدگذاری مشخص‌شده به یونیکد تبدیل " +"می‌شوند و به‌شکل مناسبی به هم پیوند داده می‌شوند. هر بخشی که مجموعه‌نویسه‌ی " +"آن ``'unknown-8bit'`` باشد، با استفاده از هندلر خطای ``'replace'`` " +"به‌صورت ASCII کدگشایی می‌شود." msgid "Added handling for the ``'unknown-8bit'`` charset." -msgstr "" +msgstr "پشتیبانی از مجموعه‌نویسه‌ی ``'unknown-8bit'`` افزوده شد." -msgid "This method allows you to compare two :class:`Header` instances for equality." +msgid "" +"This method allows you to compare two :class:`Header` instances for " +"equality." msgstr "" +"این متد به شما امکان می‌دهد دو نمونه از :class:`Header` را از نظر برابری " +"مقایسه کنید." -msgid "This method allows you to compare two :class:`Header` instances for inequality." +msgid "" +"This method allows you to compare two :class:`Header` instances for " +"inequality." msgstr "" +"این متد به شما امکان می‌دهد دو نمونه از :class:`Header` را از نظر نابرابری " +"مقایسه کنید." -msgid "The :mod:`!email.header` module also provides the following convenient functions." +msgid "" +"The :mod:`!email.header` module also provides the following convenient " +"functions." msgstr "" +"ماژول :mod:`!email.header` همچنین تابع‌های کاربردی زیر را فراهم می‌کند." -msgid "Decode a message header value without converting the character set. The header value is in *header*." +msgid "" +"Decode a message header value without converting the character set. The " +"header value is in *header*." msgstr "" +"یک مقدار سرآیند پیام را بدون تبدیل مجموعه نویسه کدگشایی کنید. مقدار سرآیند در " +"*header* قرار دارد." msgid "For historical reasons, this function may return either:" -msgstr "" +msgstr "به دلایل تاریخی، این تابع ممکن است یکی از این دو مورد را برگرداند:" -msgid "A list of pairs containing each of the decoded parts of the header, ``(decoded_bytes, charset)``, where *decoded_bytes* is always an instance of :class:`bytes`, and *charset* is either:" +msgid "" +"A list of pairs containing each of the decoded parts of the header, " +"``(decoded_bytes, charset)``, where *decoded_bytes* is always an instance of" +" :class:`bytes`, and *charset* is either:" msgstr "" +"فهرستی از جفت‌ها که شامل هر یک از بخش‌های کدگشایی‌شده‌ی سرآیند است، " +"``(decoded_bytes, charset)``، که در آن *decoded_bytes* همیشه یک نمونه از " +":class:`bytes` است و *charset* یکی از موارد زیر است:" -msgid "A lower case string containing the name of the character set specified." -msgstr "" +msgid "" +"A lower case string containing the name of the character set specified." +msgstr "رشته‌ای با حروف کوچک که شامل نام مجموعه‌ی نویسه‌ی مشخص‌شده است." msgid "``None`` for non-encoded parts of the header." -msgstr "" +msgstr "``None`` برای بخش‌های کدگذاری‌نشده‌ی سرآیند." -msgid "A list of length 1 containing a pair ``(string, None)``, where *string* is always an instance of :class:`str`." +msgid "" +"A list of length 1 containing a pair ``(string, None)``, where *string* is " +"always an instance of :class:`str`." msgstr "" +"فهرستی به طول ۱ شامل یک جفت ``(string, None)``، که در آن *string* همیشه " +"نمونه‌ای از :class:`str` است." -msgid "An :exc:`email.errors.HeaderParseError` may be raised when certain decoding errors occur (e.g. a base64 decoding exception)." +msgid "" +"An :exc:`email.errors.HeaderParseError` may be raised when certain decoding " +"errors occur (e.g. a base64 decoding exception)." msgstr "" +"هنگامی که خطاهای کدگشایی خاصی رخ می‌دهند (برای مثال، یک استثنای کدگشایی " +"base64)، ممکن است :exc:`email.errors.HeaderParseError` پرتاب شود." msgid "Here are examples:" -msgstr "" +msgstr "در اینجا مثال‌هایی آمده است:" -msgid "This function exists for backwards compatibility only. For new code, we recommend using :class:`email.headerregistry.HeaderRegistry`." +msgid "" +"This function exists for backwards compatibility only. For new code, we " +"recommend using :class:`email.headerregistry.HeaderRegistry`." msgstr "" +"این تابع فقط برای سازگاری با نسخه‌های قدیمی‌تر وجود دارد. برای کد جدید، " +"توصیه می‌کنیم از :class:`email.headerregistry.HeaderRegistry` استفاده کنید." -msgid "Create a :class:`Header` instance from a sequence of pairs as returned by :func:`decode_header`." +msgid "" +"Create a :class:`Header` instance from a sequence of pairs as returned by " +":func:`decode_header`." msgstr "" +"یک نمونه :class:`Header` را از دنباله‌ای از جفت‌ها، همان‌گونه که توسط " +":func:`decode_header` برگردانده می‌شود، ایجاد کنید." -msgid ":func:`decode_header` takes a header value string and returns a sequence of pairs of the format ``(decoded_string, charset)`` where *charset* is the name of the character set." +msgid "" +":func:`decode_header` takes a header value string and returns a sequence of " +"pairs of the format ``(decoded_string, charset)`` where *charset* is the " +"name of the character set." msgstr "" +":func:`decode_header` یک رشته مقدار سرآیند را می‌گیرد و دنباله‌ای از جفت‌ها " +"در قالب ``(decoded_string, charset)`` برمی‌گرداند که *charset* نام مجموعه " +"نویسه‌ها است." -msgid "This function takes one of those sequence of pairs and returns a :class:`Header` instance. Optional *maxlinelen*, *header_name*, and *continuation_ws* are as in the :class:`Header` constructor." +msgid "" +"This function takes one of those sequence of pairs and returns a " +":class:`Header` instance. Optional *maxlinelen*, *header_name*, and " +"*continuation_ws* are as in the :class:`Header` constructor." msgstr "" +"این تابع یکی از آن دنباله‌های جفت‌ها را می‌گیرد و یک نمونه :class:`Header` " +"را برمی‌گرداند. آرگومان‌های اختیاری *maxlinelen*، *header_name* و " +"*continuation_ws* همانند سازنده‌ی :class:`Header` هستند." -msgid "This function exists for backwards compatibility only, and is not recommended for use in new code." +msgid "" +"This function exists for backwards compatibility only, and is not " +"recommended for use in new code." msgstr "" +"این تابع فقط برای سازگاری با نسخه‌های قبلی وجود دارد و استفاده از آن در کد " +"جدید توصیه نمی‌شود." diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index f27d4d198..a203c220a 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"PO-Revision-Date: 2026-08-28 11:26+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,339 +23,753 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!email.headerregistry`: Custom Header Objects" -msgstr "" +msgstr ":mod:`!email.headerregistry`: اشیاء سرآیند سفارشی" msgid "**Source code:** :source:`Lib/email/headerregistry.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/email/headerregistry.py`" msgid "[1]_" -msgstr "" +msgstr "[1]_" -msgid "Headers are represented by customized subclasses of :class:`str`. The particular class used to represent a given header is determined by the :attr:`~email.policy.EmailPolicy.header_factory` of the :mod:`~email.policy` in effect when the headers are created. This section documents the particular ``header_factory`` implemented by the email package for handling :RFC:`5322` compliant email messages, which not only provides customized header objects for various header types, but also provides an extension mechanism for applications to add their own custom header types." -msgstr "" +msgid "" +"Headers are represented by customized subclasses of :class:`str`. The " +"particular class used to represent a given header is determined by " +"the :attr:`~email.policy.EmailPolicy.header_factory` of " +"the :mod:`~email.policy` in effect when the headers are created. This " +"section documents the particular ``header_factory`` implemented by the email " +"package for handling :RFC:`5322` compliant email messages, which not only " +"provides customized header objects for various header types, but also " +"provides an extension mechanism for applications to add their own custom " +"header types." +msgstr "" +"سرآیندها با زیرکلاس‌های سفارشی از :class:`str` نمایش داده می‌شوند. کلاس خاصی که " +"برای نمایش یک سرآیند مشخص به کار می‌رود، " +"توسط :attr:`~email.policy.EmailPolicy.header_factory` " +"از :mod:`~email.policy` که در زمان ایجاد سرآیندها معتبر است، تعیین می‌شود. این " +"بخش ``header_factory`` خاصی را مستند می‌کند که توسط بسته email برای مدیریت " +"پیام‌های ایمیل منطبق با :RFC:`5322` پیاده‌سازی شده است و نه‌تنها اشیای سرآیند " +"سفارشی برای انواع مختلف سرآیند فراهم می‌کند، بلکه سازوکار توسعه‌ای برای " +"برنامه‌ها فراهم می‌کند تا انواع سرآیند سفارشی خود را اضافه کنند." -msgid "When using any of the policy objects derived from :data:`~email.policy.EmailPolicy`, all headers are produced by :class:`.HeaderRegistry` and have :class:`.BaseHeader` as their last base class. Each header class has an additional base class that is determined by the type of the header. For example, many headers have the class :class:`.UnstructuredHeader` as their other base class. The specialized second class for a header is determined by the name of the header, using a lookup table stored in the :class:`.HeaderRegistry`. All of this is managed transparently for the typical application program, but interfaces are provided for modifying the default behavior for use by more complex applications." -msgstr "" +msgid "" +"When using any of the policy objects derived " +"from :data:`~email.policy.EmailPolicy`, all headers are produced " +"by :class:`.HeaderRegistry` and have :class:`.BaseHeader` as their last base " +"class. Each header class has an additional base class that is determined by " +"the type of the header. For example, many headers have the " +"class :class:`.UnstructuredHeader` as their other base class. The " +"specialized second class for a header is determined by the name of the " +"header, using a lookup table stored in the :class:`.HeaderRegistry`. All of " +"this is managed transparently for the typical application program, but " +"interfaces are provided for modifying the default behavior for use by more " +"complex applications." +msgstr "" +"هنگام استفاده از هر یک از اشیاء سیاست مشتق‌شده " +"از :data:`~email.policy.EmailPolicy`، تمام سرآیندها " +"توسط :class:`.HeaderRegistry` تولید می‌شوند و :class:`.BaseHeader` را به‌عنوان " +"آخرین کلاس پایه خود دارند. هر کلاس سرآیند یک کلاس پایه اضافی دارد که بر اساس " +"نوع سرآیند تعیین می‌شود. برای مثال، بسیاری از سرآیندها " +"کلاس :class:`.UnstructuredHeader` را به‌عنوان کلاس پایه دیگر خود دارند. کلاس " +"دوم تخصصی برای یک سرآیند، با استفاده از جدول جستجویی که " +"در :class:`.HeaderRegistry` ذخیره‌شده است، بر اساس نام سرآیند تعیین می‌شود. همه " +"این موارد برای برنامه کاربردی معمول به‌صورت شفاف مدیریت می‌شوند، اما رابط‌هایی " +"برای تغییر رفتار پیش‌فرض جهت استفاده در برنامه‌های پیچیده‌تر فراهم شده‌اند." -msgid "The sections below first document the header base classes and their attributes, followed by the API for modifying the behavior of :class:`.HeaderRegistry`, and finally the support classes used to represent the data parsed from structured headers." +msgid "" +"The sections below first document the header base classes and their " +"attributes, followed by the API for modifying the behavior " +"of :class:`.HeaderRegistry`, and finally the support classes used to " +"represent the data parsed from structured headers." msgstr "" +"بخش‌های زیر ابتدا کلاس‌های پایه‌ی سرصفحه و ویژگی‌های آن‌ها را مستند می‌کنند، سپس به " +"API برای تغییر رفتار :class:`.HeaderRegistry` می‌پردازند، و در نهایت کلاس‌های " +"پشتیبانی مورد استفاده برای بازنمایی داده‌های تجزیه‌شده از سرصفحه‌های " +"ساختاریافته را پوشش می‌دهند." -msgid "*name* and *value* are passed to ``BaseHeader`` from the :attr:`~email.policy.EmailPolicy.header_factory` call. The string value of any header object is the *value* fully decoded to unicode." +msgid "" +"*name* and *value* are passed to ``BaseHeader`` from " +"the :attr:`~email.policy.EmailPolicy.header_factory` call. The string value " +"of any header object is the *value* fully decoded to unicode." msgstr "" +"*name* و *value* از " +"فراخوانی :attr:`~email.policy.EmailPolicy.header_factory` به ``BaseHeader`` " +"ارسال می‌شوند. مقدار رشته‌ای هر شیء سرآیند، همان *value* است که به‌طور کامل به " +"یونیکد کدگشایی شده است." msgid "This base class defines the following read-only properties:" -msgstr "" +msgstr "این کلاس پایه، ویژگی‌های فقط‌خواندنی زیر را تعریف می‌کند:" -msgid "The name of the header (the portion of the field before the ':'). This is exactly the value passed in the :attr:`~email.policy.EmailPolicy.header_factory` call for *name*; that is, case is preserved." +msgid "" +"The name of the header (the portion of the field before the ':'). This is " +"exactly the value passed in " +"the :attr:`~email.policy.EmailPolicy.header_factory` call for *name*; that " +"is, case is preserved." msgstr "" +"نام سرآیند (بخش فیلد پیش از ':'). این دقیقاً همان مقداری است که به‌عنوان *name* " +"در فراخوانی :attr:`~email.policy.EmailPolicy.header_factory` ارسال شده است؛ " +"یعنی بزرگی و کوچکی حروف حفظ می‌شود." -msgid "A tuple of :exc:`~email.errors.HeaderDefect` instances reporting any RFC compliance problems found during parsing. The email package tries to be complete about detecting compliance issues. See the :mod:`~email.errors` module for a discussion of the types of defects that may be reported." +msgid "" +"A tuple of :exc:`~email.errors.HeaderDefect` instances reporting any RFC " +"compliance problems found during parsing. The email package tries to be " +"complete about detecting compliance issues. See the :mod:`~email.errors` " +"module for a discussion of the types of defects that may be reported." msgstr "" +"یک تاپل از نمونه‌های :exc:`~email.errors.HeaderDefect` که هر مشکل انطباق با " +"RFC را که در حین تجزیه یافت می‌شود، گزارش می‌کنند. بسته‌ی email تلاش می‌کند در " +"تشخیص مسائل انطباق کامل باشد. برای بحثی در مورد انواع نقص‌هایی که ممکن است " +"گزارش شوند، ماژول :mod:`~email.errors` را ببینید." -msgid "The maximum number of headers of this type that can have the same ``name``. A value of ``None`` means unlimited. The ``BaseHeader`` value for this attribute is ``None``; it is expected that specialized header classes will override this value as needed." +msgid "" +"The maximum number of headers of this type that can have the same ``name``. " +"A value of ``None`` means unlimited. The ``BaseHeader`` value for this " +"attribute is ``None``; it is expected that specialized header classes will " +"override this value as needed." msgstr "" +"حداکثر تعداد سرآیندهای این نوع که می‌توانند ``name`` یکسانی داشته باشند. مقدار " +"``None`` به معنای نامحدود است. مقدار این ویژگی در ``BaseHeader`` برابر " +"``None`` است؛ انتظار می‌رود کلاس‌های سرآیند تخصصی این مقدار را در صورت نیاز " +"بازنویسی کنند." -msgid "``BaseHeader`` also provides the following method, which is called by the email library code and should not in general be called by application programs:" +msgid "" +"``BaseHeader`` also provides the following method, which is called by the " +"email library code and should not in general be called by application " +"programs:" msgstr "" +"``BaseHeader`` همچنین متد زیر را ارائه می‌دهد، که توسط کد کتابخانه ایمیل " +"فراخوانی می‌شود و به‌طور کلی نباید توسط برنامه‌های کاربردی فراخوانی شود:" -msgid "Return a string containing :attr:`~email.policy.Policy.linesep` characters as required to correctly fold the header according to *policy*. A :attr:`~email.policy.Policy.cte_type` of ``8bit`` will be treated as if it were ``7bit``, since headers may not contain arbitrary binary data. If :attr:`~email.policy.EmailPolicy.utf8` is ``False``, non-ASCII data will be :rfc:`2047` encoded." -msgstr "" +msgid "" +"Return a string containing :attr:`~email.policy.Policy.linesep` characters " +"as required to correctly fold the header according to *policy*. " +"A :attr:`~email.policy.Policy.cte_type` of ``8bit`` will be treated as if it " +"were ``7bit``, since headers may not contain arbitrary binary data. " +"If :attr:`~email.policy.EmailPolicy.utf8` is ``False``, non-ASCII data will " +"be :rfc:`2047` encoded." +msgstr "" +"رشته‌ای حاوی نویسه‌های :attr:`~email.policy.Policy.linesep` به‌میزان لازم برای " +"تا کردن صحیح سرآیند مطابق *policy* " +"برمی‌گرداند. :attr:`~email.policy.Policy.cte_type` با مقدار ``8bit`` به‌صورت " +"``7bit`` در نظر گرفته می‌شود، زیرا سرآیندها نمی‌توانند حاوی داده‌های دودویی " +"دلخواه باشند. اگر :attr:`~email.policy.EmailPolicy.utf8` برابر ``False`` " +"باشد، داده‌های غیر ASCII طبق :rfc:`2047` کدگذاری می‌شوند." -msgid "``BaseHeader`` by itself cannot be used to create a header object. It defines a protocol that each specialized header cooperates with in order to produce the header object. Specifically, ``BaseHeader`` requires that the specialized class provide a :func:`classmethod` named ``parse``. This method is called as follows::" -msgstr "" +msgid "" +"``BaseHeader`` by itself cannot be used to create a header object. It " +"defines a protocol that each specialized header cooperates with in order to " +"produce the header object. Specifically, ``BaseHeader`` requires that the " +"specialized class provide a :func:`classmethod` named ``parse``. This " +"method is called as follows::" +msgstr "" +"``BaseHeader`` به‌تنهایی نمی‌تواند برای ایجاد یک شیء سرآیند به کار رود. این " +"کلاس پروتکلی را تعریف می‌کند که هر سرآیند تخصصی برای ایجاد شیء سرآیند با آن " +"همکاری می‌کند. به‌طور مشخص، ``BaseHeader`` الزام می‌کند که کلاس تخصصی " +"یک :func:`classmethod` به نام ``parse`` فراهم کند. این متد به‌صورت زیر " +"فراخوانی می‌شود::" msgid "parse(string, kwds)" -msgstr "" +msgstr "parse(string, kwds)" -msgid "``kwds`` is a dictionary containing one pre-initialized key, ``defects``. ``defects`` is an empty list. The parse method should append any detected defects to this list. On return, the ``kwds`` dictionary *must* contain values for at least the keys ``decoded``, ``defects`` and ``parse_tree``. ``decoded`` should be the string value for the header (that is, the header value fully decoded to unicode). ``parse_tree`` is set to the parse tree obtained from parsing the header. The parse method should assume that *string* may contain content-transfer-encoded parts, but should correctly handle all valid unicode characters as well so that it can parse un-encoded header values." -msgstr "" +msgid "" +"``kwds`` is a dictionary containing one pre-initialized key, ``defects``. " +"``defects`` is an empty list. The parse method should append any detected " +"defects to this list. On return, the ``kwds`` dictionary *must* contain " +"values for at least the keys ``decoded``, ``defects`` and ``parse_tree``. " +"``decoded`` should be the string value for the header (that is, the header " +"value fully decoded to unicode). ``parse_tree`` is set to the parse tree " +"obtained from parsing the header. The parse method should assume that " +"*string* may contain content-transfer-encoded parts, but should correctly " +"handle all valid unicode characters as well so that it can parse un-encoded " +"header values." +msgstr "" +"``kwds`` یک دیکشنری شامل یک کلید از پیش مقداردهی‌شده به نام ``defects`` است. " +"``defects`` یک فهرست خالی است. متد parse باید هر عیب شناسایی‌شده را به این " +"فهرست اضافه کند. در زمان بازگشت، دیکشنری ``kwds`` *باید* دست‌کم شامل مقادیری " +"برای کلیدهای ``decoded``، ``defects`` و ``parse_tree`` باشد. ``decoded`` " +"باید مقدار رشته‌ای سرآیند باشد (یعنی مقدار سرآیند به‌طور کامل به یونیکد " +"کدگشایی‌شده). ``parse_tree`` برابر با درخت تجزیه‌ی حاصل از تجزیه‌ی سرآیند تنظیم " +"می‌شود. متد parse باید فرض کند که *string* ممکن است شامل بخش‌های کدگذاری‌شده " +"برای انتقال محتوا باشد، اما باید تمام نویسه‌های معتبر یونیکد را نیز به‌درستی " +"مدیریت کند تا بتواند مقادیر سرآیند کدگذاری‌نشده را تجزیه کند." -msgid "``BaseHeader``'s ``__new__`` then creates the header instance, and calls its ``init`` method. The specialized class only needs to provide an ``init`` method if it wishes to set additional attributes beyond those provided by ``BaseHeader`` itself. Such an ``init`` method should look like this::" +msgid "" +"``BaseHeader``'s ``__new__`` then creates the header instance, and calls its " +"``init`` method. The specialized class only needs to provide an ``init`` " +"method if it wishes to set additional attributes beyond those provided by " +"``BaseHeader`` itself. Such an ``init`` method should look like this::" msgstr "" +"سپس ``__new__``\\ ``BaseHeader`` نمونه‌ی سرآیند را ایجاد می‌کند و متد ``init`` " +"آن را فراخوانی می‌کند. کلاس تخصصی تنها در صورتی لازم است یک متد ``init`` " +"ارائه کند که بخواهد ویژگی‌های اضافی، فراتر از آنچه خود ``BaseHeader`` فراهم " +"می‌کند، تنظیم کند. چنین متد ``init`` باید به این صورت باشد::" msgid "" "def init(self, /, *args, **kw):\n" " self._myattr = kw.pop('myattr')\n" " super().init(*args, **kw)" msgstr "" +"def init(self, /, *args, **kw):\n" +" self._myattr = kw.pop('myattr')\n" +" super().init(*args, **kw)" -msgid "That is, anything extra that the specialized class puts in to the ``kwds`` dictionary should be removed and handled, and the remaining contents of ``kw`` (and ``args``) passed to the ``BaseHeader`` ``init`` method." +msgid "" +"That is, anything extra that the specialized class puts in to the ``kwds`` " +"dictionary should be removed and handled, and the remaining contents of " +"``kw`` (and ``args``) passed to the ``BaseHeader`` ``init`` method." msgstr "" +"یعنی هر چیز اضافی که کلاس تخصصی در دیکشنری ``kwds`` قرار می‌دهد باید حذف و " +"مدیریت شود، و محتوای باقی‌مانده‌ی ``kw`` (و ``args``) به متد ``init`` از " +"``BaseHeader`` ارسال شود." -msgid "An \"unstructured\" header is the default type of header in :rfc:`5322`. Any header that does not have a specified syntax is treated as unstructured. The classic example of an unstructured header is the :mailheader:`Subject` header." +msgid "" +"An \"unstructured\" header is the default type of header in :rfc:`5322`. Any " +"header that does not have a specified syntax is treated as unstructured. " +"The classic example of an unstructured header is the :mailheader:`Subject` " +"header." msgstr "" +"یک سرآیند «بدون ساختار»، نوع پیش‌فرض سرآیند در :rfc:`5322` است. هر سرآیندی که " +"سینتکس مشخصی نداشته باشد، بدون ساختار تلقی می‌شود. یک نمونه کلاسیک از سرآیند " +"بدون ساختار، سرآیند :mailheader:`Subject` است." -msgid "In :rfc:`5322`, an unstructured header is a run of arbitrary text in the ASCII character set. :rfc:`2047`, however, has an :rfc:`5322` compatible mechanism for encoding non-ASCII text as ASCII characters within a header value. When a *value* containing encoded words is passed to the constructor, the ``UnstructuredHeader`` parser converts such encoded words into unicode, following the :rfc:`2047` rules for unstructured text. The parser uses heuristics to attempt to decode certain non-compliant encoded words. Defects are registered in such cases, as well as defects for issues such as invalid characters within the encoded words or the non-encoded text." -msgstr "" +msgid "" +"In :rfc:`5322`, an unstructured header is a run of arbitrary text in the " +"ASCII character set. :rfc:`2047`, however, has an :rfc:`5322` compatible " +"mechanism for encoding non-ASCII text as ASCII characters within a header " +"value. When a *value* containing encoded words is passed to the " +"constructor, the ``UnstructuredHeader`` parser converts such encoded words " +"into unicode, following the :rfc:`2047` rules for unstructured text. The " +"parser uses heuristics to attempt to decode certain non-compliant encoded " +"words. Defects are registered in such cases, as well as defects for issues " +"such as invalid characters within the encoded words or the non-encoded text." +msgstr "" +"در :rfc:`5322`، یک سرآیند بدون ساختار، دنباله‌ای از متن دلخواه در مجموعه " +"نویسه‌های ASCII است. با این حال، :rfc:`2047` یک سازوکار سازگار با :rfc:`5322` " +"برای کدگذاری متن غیر ASCII به‌عنوان نویسه‌های ASCII درون مقدار سرآیند دارد. " +"هنگامی که یک *value* حاوی کلمات کدگذاری‌شده به سازنده داده می‌شود، پارسر " +"``UnstructuredHeader`` چنین کلمات کدگذاری‌شده‌ای را با پیروی از " +"قوانین :rfc:`2047` برای متن بدون ساختار، به یونیکد تبدیل می‌کند. این پارسر " +"با استفاده از روش‌های اکتشافی تلاش می‌کند برخی کلمات کدگذاری‌شده‌ی نامنطبق را " +"کدگشایی کند. در چنین مواردی، نقص‌ها ثبت می‌شوند؛ همچنین نقص‌هایی برای مسائلی " +"مانند نویسه‌های نامعتبر درون کلمات کدگذاری‌شده یا متن کدگذاری‌نشده." msgid "This header type provides no additional attributes." -msgstr "" +msgstr "این نوع سرآیند، هیچ ویژگی اضافه‌ای ارائه نمی‌دهد." -msgid ":rfc:`5322` specifies a very specific format for dates within email headers. The ``DateHeader`` parser recognizes that date format, as well as recognizing a number of variant forms that are sometimes found \"in the wild\"." +msgid "" +":rfc:`5322` specifies a very specific format for dates within email headers. " +"The ``DateHeader`` parser recognizes that date format, as well as " +"recognizing a number of variant forms that are sometimes found \"in the " +"wild\"." msgstr "" +":rfc:`5322` قالب بسیار مشخصی را برای تاریخ‌ها در سرآیندهای ایمیل تعیین می‌کند. " +"پارسر ``DateHeader`` آن قالب تاریخ و همچنین تعدادی از صورت‌های متفاوت را " +"که گاهی «در عمل» یافت می‌شوند، تشخیص می‌دهد." msgid "This header type provides the following additional attributes:" -msgstr "" +msgstr "این نوع سرآیند، ویژگی‌های اضافی زیر را فراهم می‌کند:" -msgid "If the header value can be recognized as a valid date of one form or another, this attribute will contain a :class:`~datetime.datetime` instance representing that date. If the timezone of the input date is specified as ``-0000`` (indicating it is in UTC but contains no information about the source timezone), then :attr:`.datetime` will be a naive :class:`~datetime.datetime`. If a specific timezone offset is found (including ``+0000``), then :attr:`.datetime` will contain an aware ``datetime`` that uses :class:`datetime.timezone` to record the timezone offset." -msgstr "" +msgid "" +"If the header value can be recognized as a valid date of one form or " +"another, this attribute will contain a :class:`~datetime.datetime` instance " +"representing that date. If the timezone of the input date is specified as " +"``-0000`` (indicating it is in UTC but contains no information about the " +"source timezone), then :attr:`.datetime` will be a " +"naive :class:`~datetime.datetime`. If a specific timezone offset is found " +"(including ``+0000``), then :attr:`.datetime` will contain an aware " +"``datetime`` that uses :class:`datetime.timezone` to record the timezone " +"offset." +msgstr "" +"اگر مقدار سرآیند بتواند به‌عنوان یک تاریخ معتبر در یکی از قالب‌ها تشخیص داده " +"شود، این ویژگی شامل یک نمونه :class:`~datetime.datetime` خواهد بود که " +"نشان‌دهنده آن تاریخ است. اگر منطقه زمانی تاریخ ورودی به‌صورت ``-0000`` مشخص " +"شده باشد (که نشان می‌دهد در UTC است اما حاوی اطلاعاتی درباره منطقه زمانی منبع " +"نیست)، آنگاه :attr:`.datetime` یک :class:`~datetime.datetime` ساده خواهد " +"بود. اگر یک آفست منطقه زمانی مشخص یافت شود (از جمله ``+0000``)، " +"آنگاه :attr:`.datetime` شامل یک ``datetime`` آگاه خواهد بود که " +"از :class:`datetime.timezone` برای ثبت آفست منطقه زمانی استفاده می‌کند." -msgid "The ``decoded`` value of the header is determined by formatting the ``datetime`` according to the :rfc:`5322` rules; that is, it is set to::" +msgid "" +"The ``decoded`` value of the header is determined by formatting the " +"``datetime`` according to the :rfc:`5322` rules; that is, it is set to::" msgstr "" +"مقدار ``decoded`` سرآیند با قالب‌بندی ``datetime`` مطابق قواعد :rfc:`5322` " +"تعیین می‌شود؛ یعنی، به‌صورت زیر تنظیم می‌شود::" msgid "email.utils.format_datetime(self.datetime)" -msgstr "" +msgstr "email.utils.format_datetime(self.datetime)" -msgid "When creating a ``DateHeader``, *value* may be :class:`~datetime.datetime` instance. This means, for example, that the following code is valid and does what one would expect::" +msgid "" +"When creating a ``DateHeader``, *value* may be :class:`~datetime.datetime` " +"instance. This means, for example, that the following code is valid and " +"does what one would expect::" msgstr "" +"هنگام ایجاد یک ``DateHeader``، *value* می‌تواند نمونه‌ای " +"از :class:`~datetime.datetime` باشد. این بدان معناست که، برای مثال، کد زیر " +"معتبر است و همان کاری را که انتظار می‌رود انجام می‌دهد::" msgid "msg['Date'] = datetime(2011, 7, 15, 21)" -msgstr "" +msgstr "msg['Date'] = datetime(2011, 7, 15, 21)" -msgid "Because this is a naive ``datetime`` it will be interpreted as a UTC timestamp, and the resulting value will have a timezone of ``-0000``. Much more useful is to use the :func:`~email.utils.localtime` function from the :mod:`~email.utils` module::" +msgid "" +"Because this is a naive ``datetime`` it will be interpreted as a UTC " +"timestamp, and the resulting value will have a timezone of ``-0000``. Much " +"more useful is to use the :func:`~email.utils.localtime` function from " +"the :mod:`~email.utils` module::" msgstr "" +"از آن‌جا که این یک ``datetime`` ساده (naive) است، به‌عنوان یک مهر زمانی UTC " +"تفسیر می‌شود و مقدار حاصل دارای منطقه زمانی ``-0000`` خواهد بود. بسیار مفیدتر " +"آن است که از تابع :func:`~email.utils.localtime` در " +"ماژول :mod:`~email.utils` استفاده کنید::" msgid "msg['Date'] = utils.localtime()" -msgstr "" +msgstr "msg['Date'] = utils.localtime()" -msgid "This example sets the date header to the current time and date using the current timezone offset." +msgid "" +"This example sets the date header to the current time and date using the " +"current timezone offset." msgstr "" +"این مثال سرآیند تاریخ را با استفاده از آفست منطقه‌ی زمانی (timezone offset) " +"فعلی، روی زمان و تاریخ فعلی تنظیم می‌کند." -msgid "Address headers are one of the most complex structured header types. The ``AddressHeader`` class provides a generic interface to any address header." +msgid "" +"Address headers are one of the most complex structured header types. The " +"``AddressHeader`` class provides a generic interface to any address header." msgstr "" +"سرآیندهای نشانی یکی از پیچیده‌ترین انواع سرآیندهای ساختاریافته هستند. کلاس " +"``AddressHeader`` یک رابط عام برای هر سرآیند نشانی ارائه می‌دهد." -msgid "A tuple of :class:`.Group` objects encoding the addresses and groups found in the header value. Addresses that are not part of a group are represented in this list as single-address ``Groups`` whose :attr:`~.Group.display_name` is ``None``." +msgid "" +"A tuple of :class:`.Group` objects encoding the addresses and groups found " +"in the header value. Addresses that are not part of a group are represented " +"in this list as single-address ``Groups`` whose :attr:`~.Group.display_name` " +"is ``None``." msgstr "" +"یک تاپل از اشیای :class:`.Group` که نشانی‌ها و گروه‌های یافت‌شده در مقدار سرآیند " +"را کدگذاری می‌کنند. نشانی‌هایی که بخشی از یک گروه نیستند، در این فهرست به‌صورت " +"``Groups``\\ های تک‌نشانی بازنمایی می‌شوند که :attr:`~.Group.display_name` " +"آن‌ها ``None`` است." -msgid "A tuple of :class:`.Address` objects encoding all of the individual addresses from the header value. If the header value contains any groups, the individual addresses from the group are included in the list at the point where the group occurs in the value (that is, the list of addresses is \"flattened\" into a one dimensional list)." +msgid "" +"A tuple of :class:`.Address` objects encoding all of the individual " +"addresses from the header value. If the header value contains any groups, " +"the individual addresses from the group are included in the list at the " +"point where the group occurs in the value (that is, the list of addresses is " +"\"flattened\" into a one dimensional list)." msgstr "" +"تاپلی از اشیای :class:`.Address` که همه‌ی نشانی‌های منفردِ موجود در مقدار سرایند " +"را کدگذاری می‌کنند. اگر مقدار سرایند شامل گروهی باشد، نشانی‌های منفردِ آن گروه " +"در نقطه‌ای که گروه در مقدار ظاهر می‌شود، در فهرست گنجانده می‌شوند (یعنی فهرست " +"نشانی‌ها به یک فهرست یک‌بعدی «تخت‌شده» تبدیل می‌شود)." -msgid "The ``decoded`` value of the header will have all encoded words decoded to unicode. :class:`~encodings.idna` encoded domain names are also decoded to unicode. The ``decoded`` value is set by :ref:`joining ` the :class:`str` value of the elements of the ``groups`` attribute with ``', '``." +msgid "" +"The ``decoded`` value of the header will have all encoded words decoded to " +"unicode. :class:`~encodings.idna` encoded domain names are also decoded to " +"unicode. The ``decoded`` value is set by :ref:`joining ` " +"the :class:`str` value of the elements of the ``groups`` attribute with ``', " +"'``." msgstr "" +"در مقدار ``decoded`` سرآیند، تمام واژه‌های کدگذاری‌شده به یونیکد کدگشایی " +"می‌شوند. نام‌های دامنه کدگذاری‌شده با :class:`~encodings.idna` نیز به یونیکد " +"کدگشایی می‌شوند. مقدار ``decoded`` با :ref:`پیوند دادن ` " +"مقادیر :class:`str` عناصر ویژگی ``groups`` با ``', '`` تنظیم می‌شود." -msgid "A list of :class:`.Address` and :class:`.Group` objects in any combination may be used to set the value of an address header. ``Group`` objects whose ``display_name`` is ``None`` will be interpreted as single addresses, which allows an address list to be copied with groups intact by using the list obtained from the ``groups`` attribute of the source header." -msgstr "" +msgid "" +"A list of :class:`.Address` and :class:`.Group` objects in any combination " +"may be used to set the value of an address header. ``Group`` objects whose " +"``display_name`` is ``None`` will be interpreted as single addresses, which " +"allows an address list to be copied with groups intact by using the list " +"obtained from the ``groups`` attribute of the source header." +msgstr "" +"می‌توان از فهرستی از اشیاء :class:`.Address` و :class:`.Group` در هر ترکیبی " +"برای تنظیم مقدار یک سرآیند نشانی استفاده کرد. اشیاء ``Group`` که " +"``display_name`` آن‌ها ``None`` است، به‌عنوان نشانی‌های منفرد تعبیر می‌شوند؛ این " +"امر امکان می‌دهد یک فهرست نشانی با حفظ گروه‌ها، با استفاده از فهرستی که از " +"ویژگی ``groups`` سرآیند مبدأ به دست می‌آید، کپی شود." -msgid "A subclass of :class:`.AddressHeader` that adds one additional attribute:" -msgstr "" +msgid "" +"A subclass of :class:`.AddressHeader` that adds one additional attribute:" +msgstr "زیرکلاسی از :class:`.AddressHeader` که یک ویژگی اضافی می‌افزاید:" -msgid "The single address encoded by the header value. If the header value actually contains more than one address (which would be a violation of the RFC under the default :mod:`~email.policy`), accessing this attribute will result in a :exc:`ValueError`." +msgid "" +"The single address encoded by the header value. If the header value " +"actually contains more than one address (which would be a violation of the " +"RFC under the default :mod:`~email.policy`), accessing this attribute will " +"result in a :exc:`ValueError`." msgstr "" +"تنها نشانی کدگذاری‌شده توسط مقدار سرآیند. اگر مقدار سرآیند در واقع شامل بیش از " +"یک نشانی باشد (که تحت :mod:`~email.policy` پیش‌فرض، نقض RFC خواهد بود)، " +"دسترسی به این ویژگی منجر به :exc:`ValueError` خواهد شد." -msgid "Many of the above classes also have a ``Unique`` variant (for example, ``UniqueUnstructuredHeader``). The only difference is that in the ``Unique`` variant, :attr:`~.BaseHeader.max_count` is set to 1." +msgid "" +"Many of the above classes also have a ``Unique`` variant (for example, " +"``UniqueUnstructuredHeader``). The only difference is that in the " +"``Unique`` variant, :attr:`~.BaseHeader.max_count` is set to 1." msgstr "" +"بسیاری از کلاس‌های فوق همچنین دارای یک گونه‌ی ``Unique`` هستند (برای مثال، " +"``UniqueUnstructuredHeader``). تنها تفاوت این است که در گونه‌ی " +"``Unique``، :attr:`~.BaseHeader.max_count` روی ۱ تنظیم شده است." -msgid "There is really only one valid value for the :mailheader:`MIME-Version` header, and that is ``1.0``. For future proofing, this header class supports other valid version numbers. If a version number has a valid value per :rfc:`2045`, then the header object will have non-``None`` values for the following attributes:" -msgstr "" +msgid "" +"There is really only one valid value for the :mailheader:`MIME-Version` " +"header, and that is ``1.0``. For future proofing, this header class " +"supports other valid version numbers. If a version number has a valid value " +"per :rfc:`2045`, then the header object will have non-``None`` values for " +"the following attributes:" +msgstr "" +"در واقع تنها یک مقدار معتبر برای سرآیند :mailheader:`MIME-Version` وجود دارد، " +"و آن ``1.0`` است. برای سازگاری با آینده، این کلاس سرآیند از سایر شماره‌های " +"نسخه معتبر نیز پشتیبانی می‌کند. اگر یک شماره نسخه مقدار معتبری " +"مطابق :rfc:`2045` داشته باشد، شیء سرآیند برای ویژگی‌های زیر مقادیر غیر " +"``None`` خواهد داشت:" -msgid "The version number as a string, with any whitespace and/or comments removed." -msgstr "" +msgid "" +"The version number as a string, with any whitespace and/or comments removed." +msgstr "شماره نسخه به‌صورت یک رشته، با حذف هرگونه فضای سفید و/یا کامنت." msgid "The major version number as an integer" -msgstr "" +msgstr "شماره نسخه اصلی به‌صورت عدد صحیح" msgid "The minor version number as an integer" -msgstr "" +msgstr "شماره نسخه فرعی به‌صورت عدد صحیح" -msgid "MIME headers all start with the prefix 'Content-'. Each specific header has a certain value, described under the class for that header. Some can also take a list of supplemental parameters, which have a common format. This class serves as a base for all the MIME headers that take parameters." +msgid "" +"MIME headers all start with the prefix 'Content-'. Each specific header has " +"a certain value, described under the class for that header. Some can also " +"take a list of supplemental parameters, which have a common format. This " +"class serves as a base for all the MIME headers that take parameters." msgstr "" +"همه سرآیندهای MIME با پیشوند 'Content-' شروع می‌شوند. هر سرآیند خاص، مقدار " +"معینی دارد که در ذیل کلاس مربوط به آن سرآیند توضیح داده شده است. برخی نیز " +"می‌توانند فهرستی از پارامترهای تکمیلی را بپذیرند که قالب مشترکی دارند. این " +"کلاس به‌عنوان پایه‌ای برای همه سرآیندهای MIME که پارامتر می‌پذیرند، عمل می‌کند." msgid "A dictionary mapping parameter names to parameter values." -msgstr "" +msgstr "یک دیکشنری که نام‌های پارامتر را به مقادیر پارامتر نگاشت می‌کند." -msgid "A :class:`ParameterizedMIMEHeader` class that handles the :mailheader:`Content-Type` header." +msgid "" +"A :class:`ParameterizedMIMEHeader` class that handles " +"the :mailheader:`Content-Type` header." msgstr "" +"یک کلاس :class:`ParameterizedMIMEHeader` که سرآیند :mailheader:`Content-Type` " +"را مدیریت می‌کند." msgid "The content type string, in the form ``maintype/subtype``." -msgstr "" +msgstr "رشته‌ی نوع محتوا، در قالب ``maintype/subtype``." -msgid "A :class:`ParameterizedMIMEHeader` class that handles the :mailheader:`Content-Disposition` header." +msgid "" +"A :class:`ParameterizedMIMEHeader` class that handles " +"the :mailheader:`Content-Disposition` header." msgstr "" +"یک کلاس :class:`ParameterizedMIMEHeader` که سرآیند :mailheader:`Content-" +"Disposition` را مدیریت می‌کند." msgid "``inline`` and ``attachment`` are the only valid values in common use." -msgstr "" +msgstr "تنها مقادیر معتبرِ رایج، ``inline`` و ``attachment`` هستند." msgid "Handles the :mailheader:`Content-Transfer-Encoding` header." -msgstr "" +msgstr "سرآیند :mailheader:`Content-Transfer-Encoding` را مدیریت می‌کند." -msgid "Valid values are ``7bit``, ``8bit``, ``base64``, and ``quoted-printable``. See :rfc:`2045` for more information." +msgid "" +"Valid values are ``7bit``, ``8bit``, ``base64``, and ``quoted-printable``. " +"See :rfc:`2045` for more information." msgstr "" +"مقادیر معتبر عبارتند از ``7bit``، ``8bit``، ``base64`` و ``quoted-" +"printable``. برای اطلاعات بیشتر :rfc:`2045` را ببینید." -msgid "This is the factory used by :class:`~email.policy.EmailPolicy` by default. ``HeaderRegistry`` builds the class used to create a header instance dynamically, using *base_class* and a specialized class retrieved from a registry that it holds. When a given header name does not appear in the registry, the class specified by *default_class* is used as the specialized class. When *use_default_map* is ``True`` (the default), the standard mapping of header names to classes is copied in to the registry during initialization. *base_class* is always the last class in the generated class's :class:`~type.__bases__` list." -msgstr "" +msgid "" +"This is the factory used by :class:`~email.policy.EmailPolicy` by default. " +"``HeaderRegistry`` builds the class used to create a header instance " +"dynamically, using *base_class* and a specialized class retrieved from a " +"registry that it holds. When a given header name does not appear in the " +"registry, the class specified by *default_class* is used as the specialized " +"class. When *use_default_map* is ``True`` (the default), the standard " +"mapping of header names to classes is copied in to the registry during " +"initialization. *base_class* is always the last class in the generated " +"class's :class:`~type.__bases__` list." +msgstr "" +"این کارخانه‌ای است که :class:`~email.policy.EmailPolicy` به‌طور پیش‌فرض از آن " +"استفاده می‌کند. ``HeaderRegistry`` با استفاده از *base_class* و یک کلاس تخصصی " +"بازیابی‌شده از رجیستری که در اختیار دارد، به‌صورت پویا کلاسی را می‌سازد که برای " +"ایجاد یک نمونه سرآیند استفاده می‌شود. هنگامی که یک نام سرآیند معین در رجیستری " +"وجود نداشته باشد، کلاس مشخص‌شده توسط *default_class* به‌عنوان کلاس تخصصی " +"استفاده می‌شود. هنگامی که *use_default_map* برابر ``True`` باشد (مقدار " +"پیش‌فرض)، نگاشت استاندارد نام‌های سرآیند به کلاس‌ها در حین مقداردهی اولیه به " +"رجیستری کپی می‌شود. *base_class* همیشه آخرین کلاس در " +"فهرست :class:`~type.__bases__` کلاس ساخته‌شده است." msgid "The default mappings are:" -msgstr "" +msgstr "نگاشت‌های پیش‌فرض عبارتند از:" msgid "subject" -msgstr "" +msgstr "موضوع" msgid "UniqueUnstructuredHeader" -msgstr "" +msgstr "UniqueUnstructuredHeader" msgid "date" -msgstr "" +msgstr "تاریخ" msgid "UniqueDateHeader" -msgstr "" +msgstr "UniqueDateHeader" msgid "resent-date" -msgstr "" +msgstr "resent-date" msgid "DateHeader" -msgstr "" +msgstr "DateHeader" msgid "orig-date" -msgstr "" +msgstr "orig-date" msgid "sender" -msgstr "" +msgstr "فرستنده" msgid "UniqueSingleAddressHeader" -msgstr "" +msgstr "UniqueSingleAddressHeader" msgid "resent-sender" -msgstr "" +msgstr "resent-sender" msgid "SingleAddressHeader" -msgstr "" +msgstr "SingleAddressHeader" msgid "to" -msgstr "" +msgstr "به" msgid "UniqueAddressHeader" -msgstr "" +msgstr "UniqueAddressHeader" msgid "resent-to" -msgstr "" +msgstr "resent-to" msgid "AddressHeader" -msgstr "" +msgstr "AddressHeader" msgid "cc" -msgstr "" +msgstr "cc" msgid "resent-cc" -msgstr "" +msgstr "resent-cc" msgid "bcc" -msgstr "" +msgstr "bcc" msgid "resent-bcc" -msgstr "" +msgstr "resent-bcc" msgid "from" -msgstr "" +msgstr "از" msgid "resent-from" -msgstr "" +msgstr "resent-from" msgid "reply-to" -msgstr "" +msgstr "پاسخ به" msgid "mime-version" -msgstr "" +msgstr "mime-version" msgid "MIMEVersionHeader" -msgstr "" +msgstr "MIMEVersionHeader" msgid "content-type" -msgstr "" +msgstr "نوع محتوا" msgid "ContentTypeHeader" -msgstr "" +msgstr "ContentTypeHeader" msgid "content-disposition" -msgstr "" +msgstr "چیدمان محتوا (content-disposition)" msgid "ContentDispositionHeader" -msgstr "" +msgstr "ContentDispositionHeader" msgid "content-transfer-encoding" -msgstr "" +msgstr "کدگذاری انتقال محتوا (content-transfer-encoding)" msgid "ContentTransferEncodingHeader" -msgstr "" +msgstr "ContentTransferEncodingHeader" msgid "message-id" -msgstr "" +msgstr "شناسه پیام" msgid "MessageIDHeader" -msgstr "" +msgstr "MessageIDHeader" msgid "``HeaderRegistry`` has the following methods:" -msgstr "" +msgstr "``HeaderRegistry`` متدهای زیر را دارد:" -msgid "*name* is the name of the header to be mapped. It will be converted to lower case in the registry. *cls* is the specialized class to be used, along with *base_class*, to create the class used to instantiate headers that match *name*." +msgid "" +"*name* is the name of the header to be mapped. It will be converted to " +"lower case in the registry. *cls* is the specialized class to be used, " +"along with *base_class*, to create the class used to instantiate headers " +"that match *name*." msgstr "" +"*name* نام سرآیندی است که باید نگاشت شود. این نام در رجیستری (registry) به " +"حروف کوچک تبدیل می‌شود. *cls* کلاس تخصصی است که به همراه *base_class*، برای " +"ایجاد کلاسی به کار می‌رود که سرآیندهای منطبق با *name* را نمونه‌سازی می‌کند." msgid "Construct and return a class to handle creating a *name* header." -msgstr "" +msgstr "یک کلاس را برای مدیریت ایجاد سرآیند *name* بسازید و برگردانید." -msgid "Retrieves the specialized header associated with *name* from the registry (using *default_class* if *name* does not appear in the registry) and composes it with *base_class* to produce a class, calls the constructed class's constructor, passing it the same argument list, and finally returns the class instance created thereby." -msgstr "" +msgid "" +"Retrieves the specialized header associated with *name* from the registry " +"(using *default_class* if *name* does not appear in the registry) and " +"composes it with *base_class* to produce a class, calls the constructed " +"class's constructor, passing it the same argument list, and finally returns " +"the class instance created thereby." +msgstr "" +"سرآیند اختصاصی مرتبط با *name* را از رجیستری (registry) بازیابی می‌کند (اگر " +"*name* در رجیستری وجود نداشته باشد، از *default_class* استفاده می‌شود) و آن " +"را با *base_class* ترکیب می‌کند تا کلاسی تولید شود، سازنده‌ی کلاس ساخته‌شده را " +"با همان فهرست آرگومان‌ها فراخوانی می‌کند و در نهایت نمونه‌ی کلاس ایجادشده از " +"این طریق را برمی‌گرداند." -msgid "The following classes are the classes used to represent data parsed from structured headers and can, in general, be used by an application program to construct structured values to assign to specific headers." +msgid "" +"The following classes are the classes used to represent data parsed from " +"structured headers and can, in general, be used by an application program to " +"construct structured values to assign to specific headers." msgstr "" +"کلاس‌های زیر کلاس‌هایی هستند که برای نمایش داده‌های تجزیه‌شده از سرآیندهای " +"ساخت‌یافته استفاده می‌شوند و به‌طور کلی یک برنامه کاربردی می‌تواند از آن‌ها برای " +"ساخت مقادیر ساخت‌یافته جهت انتساب به سرآیندهای مشخص استفاده کند." -msgid "The class used to represent an email address. The general form of an address is::" +msgid "" +"The class used to represent an email address. The general form of an " +"address is::" msgstr "" +"کلاسی که برای نمایش یک نشانی ایمیل استفاده می‌شود. شکل کلی یک نشانی به این " +"صورت است::" msgid "[display_name] " -msgstr "" +msgstr "[display_name] " msgid "or::" -msgstr "" +msgstr "یا::" msgid "username@domain" -msgstr "" +msgstr "username@domain" -msgid "where each part must conform to specific syntax rules spelled out in :rfc:`5322`." +msgid "" +"where each part must conform to specific syntax rules spelled out " +"in :rfc:`5322`." msgstr "" +"که هر بخش باید با قواعد سینتکسی خاصی که در :rfc:`5322` تشریح شده است مطابقت " +"داشته باشد." -msgid "As a convenience *addr_spec* can be specified instead of *username* and *domain*, in which case *username* and *domain* will be parsed from the *addr_spec*. An *addr_spec* must be a properly RFC quoted string; if it is not ``Address`` will raise an error. Unicode characters are allowed and will be property encoded when serialized. However, per the RFCs, unicode is *not* allowed in the username portion of the address." -msgstr "" +msgid "" +"As a convenience *addr_spec* can be specified instead of *username* and " +"*domain*, in which case *username* and *domain* will be parsed from the " +"*addr_spec*. An *addr_spec* must be a properly RFC quoted string; if it is " +"not ``Address`` will raise an error. Unicode characters are allowed and " +"will be property encoded when serialized. However, per the RFCs, unicode is " +"*not* allowed in the username portion of the address." +msgstr "" +"برای سهولت، می‌توان *addr_spec* را به‌جای *username* و *domain* مشخص کرد؛ در " +"این صورت *username* و *domain* از *addr_spec* تجزیه می‌شوند. *addr_spec* باید " +"یک رشته‌ی نقل‌قول‌شده‌ی صحیح مطابق RFC باشد؛ اگر این‌طور نباشد، ``Address`` خطایی " +"پرتاب خواهد کرد. نویسه‌های یونیکد مجاز هستند و هنگام سریال‌سازی به‌درستی " +"کدگذاری خواهند شد. با این حال، طبق RFCها، یونیکد در بخش نام‌کاربری نشانی مجاز " +"*نیست*." -msgid "The display name portion of the address, if any, with all quoting removed. If the address does not have a display name, this attribute will be an empty string." +msgid "" +"The display name portion of the address, if any, with all quoting removed. " +"If the address does not have a display name, this attribute will be an empty " +"string." msgstr "" +"بخش نام نمایشی نشانی، در صورت وجود، با حذف تمام علامت‌های نقل‌قول. اگر نشانی " +"نام نمایشی نداشته باشد، این ویژگی یک رشته خالی خواهد بود." msgid "The ``username`` portion of the address, with all quoting removed." -msgstr "" +msgstr "بخش ``username`` از نشانی، با حذف تمام علامت‌های نقل‌قول." msgid "The ``domain`` portion of the address." -msgstr "" +msgstr "بخش ``domain`` از نشانی." -msgid "The ``username@domain`` portion of the address, correctly quoted for use as a bare address (the second form shown above). This attribute is not mutable." +msgid "" +"The ``username@domain`` portion of the address, correctly quoted for use as " +"a bare address (the second form shown above). This attribute is not mutable." msgstr "" +"بخش ``username@domain`` از نشانی، که به‌درستی در علامت نقل‌قول قرار گرفته است " +"تا به‌عنوان یک نشانی ساده (دومین شکل نشان‌داده‌شده در بالا) استفاده شود. این " +"ویژگی تغییرپذیر نیست." -msgid "The ``str`` value of the object is the address quoted according to :rfc:`5322` rules, but with no Content Transfer Encoding of any non-ASCII characters." +msgid "" +"The ``str`` value of the object is the address quoted according " +"to :rfc:`5322` rules, but with no Content Transfer Encoding of any non-ASCII " +"characters." msgstr "" +"مقدار ``str`` شیء، نشانی نقل‌قول‌شده مطابق قواعد :rfc:`5322` است، اما بدون " +"کدگذاری انتقال محتوا (Content Transfer Encoding) برای هیچ‌یک از نویسه‌های غیر " +"ASCII." -msgid "To support SMTP (:rfc:`5321`), ``Address`` handles one special case: if ``username`` and ``domain`` are both the empty string (or ``None``), then the string value of the ``Address`` is ``<>``." +msgid "" +"To support SMTP (:rfc:`5321`), ``Address`` handles one special case: if " +"``username`` and ``domain`` are both the empty string (or ``None``), then " +"the string value of the ``Address`` is ``<>``." msgstr "" +"برای پشتیبانی از SMTP (:rfc:`5321`)، ``Address`` یک حالت خاص را مدیریت " +"می‌کند: اگر ``username`` و ``domain`` هر دو رشته خالی (یا ``None``) باشند، " +"مقدار رشته‌ای ``Address`` برابر ``<>`` است." -msgid "The class used to represent an address group. The general form of an address group is::" +msgid "" +"The class used to represent an address group. The general form of an " +"address group is::" msgstr "" +"کلاسی که برای بازنمایی یک گروه نشانی استفاده می‌شود. شکل کلی یک گروه نشانی به " +"این صورت است::" msgid "display_name: [address-list];" -msgstr "" +msgstr "display_name: [address-list];" -msgid "As a convenience for processing lists of addresses that consist of a mixture of groups and single addresses, a ``Group`` may also be used to represent single addresses that are not part of a group by setting *display_name* to ``None`` and providing a list of the single address as *addresses*." +msgid "" +"As a convenience for processing lists of addresses that consist of a mixture " +"of groups and single addresses, a ``Group`` may also be used to represent " +"single addresses that are not part of a group by setting *display_name* to " +"``None`` and providing a list of the single address as *addresses*." msgstr "" +"برای سهولت در پردازش فهرست‌هایی از نشانی‌ها که شامل ترکیبی از گروه‌ها و " +"نشانی‌های تکی هستند، می‌توان از ``Group`` همچنین برای نمایش نشانی‌های تکی که " +"بخشی از یک گروه نیستند استفاده کرد؛ برای این کار *display_name* را روی " +"``None`` تنظیم کنید و فهرستی از نشانی تکی را به‌عنوان *addresses* ارائه دهید." -msgid "The ``display_name`` of the group. If it is ``None`` and there is exactly one ``Address`` in ``addresses``, then the ``Group`` represents a single address that is not in a group." +msgid "" +"The ``display_name`` of the group. If it is ``None`` and there is exactly " +"one ``Address`` in ``addresses``, then the ``Group`` represents a single " +"address that is not in a group." msgstr "" +"``display_name`` گروه. اگر این مقدار ``None`` باشد و دقیقاً یک ``Address`` در " +"``addresses`` وجود داشته باشد، آنگاه ``Group`` نشان‌دهنده‌ی یک نشانی واحد است " +"که در گروهی نیست." -msgid "A possibly empty tuple of :class:`.Address` objects representing the addresses in the group." +msgid "" +"A possibly empty tuple of :class:`.Address` objects representing the " +"addresses in the group." msgstr "" +"یک تاپل احتمالاً خالی از اشیای :class:`.Address` که نشان‌دهنده‌ی نشانی‌های درون " +"گروه هستند." -msgid "The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`, but with no Content Transfer Encoding of any non-ASCII characters. If ``display_name`` is none and there is a single ``Address`` in the ``addresses`` list, the ``str`` value will be the same as the ``str`` of that single ``Address``." -msgstr "" +msgid "" +"The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`, but " +"with no Content Transfer Encoding of any non-ASCII characters. If " +"``display_name`` is none and there is a single ``Address`` in the " +"``addresses`` list, the ``str`` value will be the same as the ``str`` of " +"that single ``Address``." +msgstr "" +"مقدار ``str`` یک ``Group`` مطابق :rfc:`5322` قالب‌بندی می‌شود، اما بدون اعمال " +"کدگذاری انتقال محتوا (Content Transfer Encoding) بر هیچ‌یک از نویسه‌های غیر " +"ASCII. اگر ``display_name`` وجود نداشته باشد و تنها یک ``Address`` در فهرست " +"``addresses`` وجود داشته باشد، مقدار ``str`` برابر با ``str`` همان " +"``Address`` تنها خواهد بود." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Originally added in 3.3 as a :term:`provisional module `" +msgid "" +"Originally added in 3.3 as a :term:`provisional module `" msgstr "" +"در ابتدا در 3.3 به‌عنوان یک :term:`ماژول موقتی ` افزوده " +"شد" diff --git a/library/email.iterators.po b/library/email.iterators.po index ab251ef0f..6eaa72690 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -22,34 +22,80 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.iterators`: Iterators" -msgstr "" +msgstr ":mod:`!email.iterators`: پیمایش‌گرها" msgid "**Source code:** :source:`Lib/email/iterators.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/iterators.py`" -msgid "Iterating over a message object tree is fairly easy with the :meth:`Message.walk ` method. The :mod:`!email.iterators` module provides some useful higher level iterations over message object trees." +msgid "" +"Iterating over a message object tree is fairly easy with the " +":meth:`Message.walk ` method. The " +":mod:`!email.iterators` module provides some useful higher level iterations " +"over message object trees." msgstr "" +"پیمایش روی یک درخت شیء پیام با متد :meth:`Message.walk " +"` نسبتاً آسان است. ماژول :mod:`!email.iterators`" +" چند پیمایش سطح بالاتر مفید روی درخت‌های شیء پیام ارائه می‌دهد." -msgid "This iterates over all the payloads in all the subparts of *msg*, returning the string payloads line-by-line. It skips over all the subpart headers, and it skips over any subpart with a payload that isn't a Python string. This is somewhat equivalent to reading the flat text representation of the message from a file using :meth:`~io.TextIOBase.readline`, skipping over all the intervening headers." +msgid "" +"This iterates over all the payloads in all the subparts of *msg*, returning " +"the string payloads line-by-line. It skips over all the subpart headers, " +"and it skips over any subpart with a payload that isn't a Python string. " +"This is somewhat equivalent to reading the flat text representation of the " +"message from a file using :meth:`~io.TextIOBase.readline`, skipping over all" +" the intervening headers." msgstr "" +"این تمام بارها (payload) در همه‌ی زیربخش‌های *msg* را پیمایش می‌کند و " +"بارهای رشته‌ای را خط‌به‌خط برمی‌گرداند. این تمام سرصفحه‌های زیربخش‌ها را " +"نادیده می‌گیرد و از هر زیربخشی که بار آن یک رشته‌ی پایتون نیست، صرف‌نظر " +"می‌کند. این کار تا حدی معادل خواندن نمایش متنی مسطح پیام از یک فایل با " +"استفاده از :meth:`~io.TextIOBase.readline` و نادیده گرفتن تمام سرصفحه‌های " +"میانی است." -msgid "Optional *decode* is passed through to :meth:`Message.get_payload `." +msgid "" +"Optional *decode* is passed through to :meth:`Message.get_payload " +"`." msgstr "" +"آرگومان اختیاری *decode* به :meth:`Message.get_payload " +"` ارسال می‌شود." -msgid "This iterates over all the subparts of *msg*, returning only those subparts that match the MIME type specified by *maintype* and *subtype*." +msgid "" +"This iterates over all the subparts of *msg*, returning only those subparts " +"that match the MIME type specified by *maintype* and *subtype*." msgstr "" +"این تمام زیربخش‌های *msg* را پیمایش می‌کند و فقط آن زیربخش‌هایی را " +"برمی‌گرداند که با نوع MIME تعیین‌شده توسط *maintype* و *subtype* مطابقت " +"دارند." -msgid "Note that *subtype* is optional; if omitted, then subpart MIME type matching is done only with the main type. *maintype* is optional too; it defaults to :mimetype:`text`." +msgid "" +"Note that *subtype* is optional; if omitted, then subpart MIME type matching" +" is done only with the main type. *maintype* is optional too; it defaults " +"to :mimetype:`text`." msgstr "" +"توجه داشته باشید که *subtype* اختیاری است؛ اگر حذف شود، تطبیق نوع MIME " +"زیربخش تنها با نوع اصلی انجام می‌شود. *maintype* نیز اختیاری است؛ مقدار " +"پیش‌فرض آن :mimetype:`text` است." -msgid "Thus, by default :func:`typed_subpart_iterator` returns each subpart that has a MIME type of :mimetype:`text/\\*`." +msgid "" +"Thus, by default :func:`typed_subpart_iterator` returns each subpart that " +"has a MIME type of :mimetype:`text/\\*`." msgstr "" +"بنابراین، به‌طور پیش‌فرض :func:`typed_subpart_iterator` هر زیربخشی را که نوع" +" MIME آن :mimetype:`text/\\*` باشد برمی‌گرداند." -msgid "The following function has been added as a useful debugging tool. It should *not* be considered part of the supported public interface for the package." +msgid "" +"The following function has been added as a useful debugging tool. It should" +" *not* be considered part of the supported public interface for the package." msgstr "" +"تابع زیر به‌عنوان یک ابزار اشکال‌زدایی مفید اضافه شده است. این تابع *نباید* " +"بخشی از رابط عمومی پشتیبانی‌شده برای بسته در نظر گرفته شود." -msgid "Prints an indented representation of the content types of the message object structure. For example:" +msgid "" +"Prints an indented representation of the content types of the message object" +" structure. For example:" msgstr "" +"یک نمایش تورفتگی‌دار از انواع محتوای ساختار شیء پیام را چاپ می‌کند. برای " +"مثال:" msgid "" ">>> msg = email.message_from_file(somefile)\n" @@ -70,6 +116,30 @@ msgid "" " text/plain\n" " text/plain" msgstr "" +">>> msg = email.message_from_file(somefile)\n" +">>> _structure(msg)\n" +"multipart/mixed\n" +" text/plain\n" +" text/plain\n" +" multipart/digest\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" text/plain" -msgid "Optional *fp* is a file-like object to print the output to. It must be suitable for Python's :func:`print` function. *level* is used internally. *include_default*, if true, prints the default type as well." +msgid "" +"Optional *fp* is a file-like object to print the output to. It must be " +"suitable for Python's :func:`print` function. *level* is used internally. " +"*include_default*, if true, prints the default type as well." msgstr "" +"آرگومان اختیاری *fp* یک شیء فایل‌مانند است که خروجی در آن چاپ می‌شود. این " +"شیء باید برای تابع :func:`print` پایتون مناسب باشد. *level* به‌صورت داخلی " +"استفاده می‌شود. *include_default*، اگر true باشد، نوع پیش‌فرض را نیز چاپ " +"می‌کند." diff --git a/library/email.message.po b/library/email.message.po index e87498cd7..202211cee 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -24,241 +24,753 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.message`: Representing an email message" -msgstr "" +msgstr ":mod:`!email.message`: بازنمایی یک پیام ایمیل" msgid "**Source code:** :source:`Lib/email/message.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/message.py`" msgid "[1]_" -msgstr "" +msgstr "[1]_" -msgid "The central class in the :mod:`email` package is the :class:`EmailMessage` class, imported from the :mod:`!email.message` module. It is the base class for the :mod:`email` object model. :class:`EmailMessage` provides the core functionality for setting and querying header fields, for accessing message bodies, and for creating or modifying structured messages." -msgstr "" +msgid "" +"The central class in the :mod:`email` package is the :class:`EmailMessage` " +"class, imported from the :mod:`!email.message` module. It is the base class" +" for the :mod:`email` object model. :class:`EmailMessage` provides the core" +" functionality for setting and querying header fields, for accessing message" +" bodies, and for creating or modifying structured messages." +msgstr "" +"کلاس مرکزی در بسته‌ی :mod:`email`، کلاس :class:`EmailMessage` است که از ماژول" +" :mod:`!email.message` ایمپورت می‌شود. این کلاس، کلاس پایه‌ی مدل شیء " +":mod:`email` است. :class:`EmailMessage` کارکرد اصلی را برای تنظیم و پرس‌وجوی" +" فیلدهای سرآیند، دسترسی به بدنه‌های پیام و ایجاد یا تغییر پیام‌های " +"ساختاریافته فراهم می‌کند." -msgid "An email message consists of *headers* and a *payload* (which is also referred to as the *content*). Headers are :rfc:`5322` or :rfc:`6532` style field names and values, where the field name and value are separated by a colon. The colon is not part of either the field name or the field value. The payload may be a simple text message, or a binary object, or a structured sequence of sub-messages each with their own set of headers and their own payload. The latter type of payload is indicated by the message having a MIME type such as :mimetype:`multipart/\\*` or :mimetype:`message/rfc822`." -msgstr "" +msgid "" +"An email message consists of *headers* and a *payload* (which is also " +"referred to as the *content*). Headers are :rfc:`5322` or :rfc:`6532` style" +" field names and values, where the field name and value are separated by a " +"colon. The colon is not part of either the field name or the field value. " +"The payload may be a simple text message, or a binary object, or a " +"structured sequence of sub-messages each with their own set of headers and " +"their own payload. The latter type of payload is indicated by the message " +"having a MIME type such as :mimetype:`multipart/\\*` or " +":mimetype:`message/rfc822`." +msgstr "" +"یک پیام ایمیلی از *سرصفحه‌ها* و یک *بار* (payload) تشکیل شده است (که به آن " +"*محتوا* نیز گفته می‌شود). سرصفحه‌ها نام‌ها و مقدارهای فیلد به سبک " +":rfc:`5322` یا :rfc:`6532` هستند، که در آن‌ها نام فیلد و مقدار با یک دونقطه " +"از هم جدا می‌شوند. دونقطه نه بخشی از نام فیلد است و نه بخشی از مقدار فیلد. " +"بار ممکن است یک پیام متنی ساده، یا یک شیء دودویی، یا دنباله‌ای ساختارمند از " +"زیرپیام‌ها باشد که هرکدام مجموعه‌ای از سرصفحه‌ها و بار خود را دارند. نوع " +"اخیر بار با نوع MIME پیام، مانند :mimetype:`multipart/\\*` یا " +":mimetype:`message/rfc822`، مشخص می‌شود." -msgid "The conceptual model provided by an :class:`EmailMessage` object is that of an ordered dictionary of headers coupled with a *payload* that represents the :rfc:`5322` body of the message, which might be a list of sub-``EmailMessage`` objects. In addition to the normal dictionary methods for accessing the header names and values, there are methods for accessing specialized information from the headers (for example the MIME content type), for operating on the payload, for generating a serialized version of the message, and for recursively walking over the object tree." -msgstr "" +msgid "" +"The conceptual model provided by an :class:`EmailMessage` object is that of " +"an ordered dictionary of headers coupled with a *payload* that represents " +"the :rfc:`5322` body of the message, which might be a list of " +"sub-``EmailMessage`` objects. In addition to the normal dictionary methods " +"for accessing the header names and values, there are methods for accessing " +"specialized information from the headers (for example the MIME content " +"type), for operating on the payload, for generating a serialized version of " +"the message, and for recursively walking over the object tree." +msgstr "" +"مدل مفهومی ارائه‌شده توسط یک شیء :class:`EmailMessage`، به‌صورت یک دیکشنری " +"مرتب از سرصفحه‌ها همراه با یک *بار* (payload) است که بدنه‌ی پیام مطابق " +":rfc:`5322` را نشان می‌دهد و ممکن است فهرستی از اشیاء ``EmailMessage`` فرعی " +"باشد. علاوه بر متدهای معمول دیکشنری برای دسترسی به نام‌ها و مقادیر " +"سرصفحه‌ها، متدهایی برای دسترسی به اطلاعات تخصصی از سرصفحه‌ها (برای مثال نوع " +"محتوای MIME)، برای انجام عملیات بر روی بار (payload)، برای تولید " +"نسخه‌ای سریال‌شده از پیام، و برای پیمایش بازگشتی بر روی درخت اشیاء وجود " +"دارد." -msgid "The :class:`EmailMessage` dictionary-like interface is indexed by the header names, which must be ASCII values. The values of the dictionary are strings with some extra methods. Headers are stored and returned in case-preserving form, but field names are matched case-insensitively. The keys are ordered, but unlike a real dict, there can be duplicates. Additional methods are provided for working with headers that have duplicate keys." -msgstr "" +msgid "" +"The :class:`EmailMessage` dictionary-like interface is indexed by the header" +" names, which must be ASCII values. The values of the dictionary are " +"strings with some extra methods. Headers are stored and returned in case-" +"preserving form, but field names are matched case-insensitively. The keys " +"are ordered, but unlike a real dict, there can be duplicates. Additional " +"methods are provided for working with headers that have duplicate keys." +msgstr "" +"رابط دیکشنری‌مانند :class:`EmailMessage` با نام‌های سرآیند اندیس‌دهی می‌شود؛ " +"این نام‌ها باید مقادیر ASCII باشند. مقادیر دیکشنری، رشته‌هایی هستند که چند " +"متد اضافی دارند. سرآیندها با حفظ حالت حروف ذخیره و بازگردانده می‌شوند، اما " +"نام‌های فیلد بدون حساسیت به حالت حروف تطبیق داده می‌شوند. کلیدها مرتب " +"هستند، اما برخلاف یک دیکشنری واقعی، ممکن است کلیدهای تکراری وجود داشته " +"باشد. متدهای اضافی برای کار با سرآیندهایی که کلیدهای تکراری دارند ارائه " +"شده‌اند." -msgid "The *payload* is either a string or bytes object, in the case of simple message objects, or a list of :class:`EmailMessage` objects, for MIME container documents such as :mimetype:`multipart/\\*` and :mimetype:`message/rfc822` message objects." +msgid "" +"The *payload* is either a string or bytes object, in the case of simple " +"message objects, or a list of :class:`EmailMessage` objects, for MIME " +"container documents such as :mimetype:`multipart/\\*` and " +":mimetype:`message/rfc822` message objects." msgstr "" +"*بار* (payload) در مورد اشیاء پیام ساده، یا یک شیء رشته یا bytes است، یا در " +"مورد اشیاء پیامِ اسناد نگهدارنده‌ی MIME مانند :mimetype:`multipart/\\*` و " +":mimetype:`message/rfc822`، فهرستی از اشیاء :class:`EmailMessage` است." -msgid "If *policy* is specified use the rules it specifies to update and serialize the representation of the message. If *policy* is not set, use the :class:`~email.policy.default` policy, which follows the rules of the email RFCs except for line endings (instead of the RFC mandated ``\\r\\n``, it uses the Python standard ``\\n`` line endings). For more information see the :mod:`~email.policy` documentation. [2]_" -msgstr "" +msgid "" +"If *policy* is specified use the rules it specifies to update and serialize " +"the representation of the message. If *policy* is not set, use the " +":class:`~email.policy.default` policy, which follows the rules of the email " +"RFCs except for line endings (instead of the RFC mandated ``\\r\\n``, it " +"uses the Python standard ``\\n`` line endings). For more information see " +"the :mod:`~email.policy` documentation. [2]_" +msgstr "" +"اگر *policy* مشخص شده باشد، از قوانین مشخص‌شده توسط آن برای به‌روزرسانی و " +"سریال‌سازی بازنمایی پیام استفاده می‌شود. اگر *policy* تنظیم نشده باشد، از " +"سیاست :class:`~email.policy.default` استفاده می‌شود، که از قوانین RFCهای " +"ایمیل پیروی می‌کند، به‌جز در مورد پایان خطوط (به‌جای ``\\r\\n`` مورد الزام " +"RFC، از پایان خطوط استاندارد پایتون یعنی ``\\n`` استفاده می‌کند). برای " +"اطلاعات بیشتر، مستندات :mod:`~email.policy` را ببینید. [2]_" -msgid "Return the entire message flattened as a string. When optional *unixfrom* is true, the envelope header is included in the returned string. *unixfrom* defaults to ``False``. For backward compatibility with the base :class:`~email.message.Message` class *maxheaderlen* is accepted, but defaults to ``None``, which means that by default the line length is controlled by the :attr:`~email.policy.Policy.max_line_length` of the policy. The *policy* argument may be used to override the default policy obtained from the message instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the :class:`~email.generator.Generator`." -msgstr "" +msgid "" +"Return the entire message flattened as a string. When optional *unixfrom* " +"is true, the envelope header is included in the returned string. *unixfrom*" +" defaults to ``False``. For backward compatibility with the base " +":class:`~email.message.Message` class *maxheaderlen* is accepted, but " +"defaults to ``None``, which means that by default the line length is " +"controlled by the :attr:`~email.policy.Policy.max_line_length` of the " +"policy. The *policy* argument may be used to override the default policy " +"obtained from the message instance. This can be used to control some of the" +" formatting produced by the method, since the specified *policy* will be " +"passed to the :class:`~email.generator.Generator`." +msgstr "" +"کل پیام را به‌صورت یک رشته‌ی مسطح برمی‌گرداند. هنگامی که آرگومان اختیاری " +"*unixfrom* درست باشد، سرآیند پاکت (envelope header) در رشته‌ی برگردانده‌شده " +"گنجانده می‌شود. مقدار پیش‌فرض *unixfrom* برابر ``False`` است. برای سازگاری " +"عقب‌رو با کلاس پایه‌ی :class:`~email.message.Message`، *maxheaderlen* پذیرفته" +" می‌شود، اما مقدار پیش‌فرض آن ``None`` است، که به این معناست که به‌طور " +"پیش‌فرض طول خط توسط :attr:`~email.policy.Policy.max_line_length` سیاست کنترل" +" می‌شود. می‌توان از آرگومان *policy* برای نادیده گرفتن سیاست پیش‌فرضی که از " +"نمونه‌ی پیام گرفته می‌شود استفاده کرد. این می‌تواند برای کنترل برخی از " +"قالب‌بندی‌های تولیدشده توسط متد به کار رود، زیرا *policy* مشخص‌شده به " +":class:`~email.generator.Generator` ارسال می‌شود." -msgid "Flattening the message may trigger changes to the :class:`EmailMessage` if defaults need to be filled in to complete the transformation to a string (for example, MIME boundaries may be generated or modified)." +msgid "" +"Flattening the message may trigger changes to the :class:`EmailMessage` if " +"defaults need to be filled in to complete the transformation to a string " +"(for example, MIME boundaries may be generated or modified)." msgstr "" +"تسطیح پیام ممکن است باعث ایجاد تغییراتی در :class:`EmailMessage` شود، اگر " +"برای تکمیل تبدیل به یک رشته نیاز باشد مقادیر پیش‌فرض پر شوند (برای مثال، " +"ممکن است مرزهای MIME تولید یا اصلاح شوند)." -msgid "Note that this method is provided as a convenience and may not be the most useful way to serialize messages in your application, especially if you are dealing with multiple messages. See :class:`email.generator.Generator` for a more flexible API for serializing messages. Note also that this method is restricted to producing messages serialized as \"7 bit clean\" when :attr:`~email.policy.EmailPolicy.utf8` is ``False``, which is the default." -msgstr "" +msgid "" +"Note that this method is provided as a convenience and may not be the most " +"useful way to serialize messages in your application, especially if you are " +"dealing with multiple messages. See :class:`email.generator.Generator` for " +"a more flexible API for serializing messages. Note also that this method is" +" restricted to producing messages serialized as \"7 bit clean\" when " +":attr:`~email.policy.EmailPolicy.utf8` is ``False``, which is the default." +msgstr "" +"توجه داشته باشید که این متد برای راحتی کار ارائه شده است و ممکن است مفیدترین" +" روش برای سریال‌سازی پیام‌ها در برنامه شما نباشد، به‌ویژه اگر با چندین پیام " +"سروکار دارید. برای یک API انعطاف‌پذیرتر جهت سریال‌سازی پیام‌ها، " +":class:`email.generator.Generator` را ببینید. همچنین توجه داشته باشید که این" +" متد، وقتی :attr:`~email.policy.EmailPolicy.utf8` برابر ``False`` باشد (که " +"مقدار پیش‌فرض است)، محدود به تولید پیام‌هایی است که به‌صورت «7 bit clean» " +"سریال‌سازی شده‌اند." -msgid "the default behavior when *maxheaderlen* is not specified was changed from defaulting to 0 to defaulting to the value of *max_line_length* from the policy." +msgid "" +"the default behavior when *maxheaderlen* is not specified was changed from " +"defaulting to 0 to defaulting to the value of *max_line_length* from the " +"policy." msgstr "" +"رفتار پیش‌فرض زمانی که *maxheaderlen* مشخص‌نشده باشد، از پیش‌فرض ۰ به " +"پیش‌فرض مقدار *max_line_length* از سیاست تغییر کرده است." -msgid "Equivalent to ``as_string(policy=self.policy.clone(utf8=True))``. Allows ``str(msg)`` to produce a string containing the serialized message in a readable format." +msgid "" +"Equivalent to ``as_string(policy=self.policy.clone(utf8=True))``. Allows " +"``str(msg)`` to produce a string containing the serialized message in a " +"readable format." msgstr "" +"معادل ``as_string(policy=self.policy.clone(utf8=True))`` است و به " +"``str(msg)`` اجازه می‌دهد رشته‌ای حاوی پیام سریال‌شده در قالبی خوانا تولید " +"کند." -msgid "the method was changed to use ``utf8=True``, thus producing an :rfc:`6531`-like message representation, instead of being a direct alias for :meth:`as_string`." +msgid "" +"the method was changed to use ``utf8=True``, thus producing an " +":rfc:`6531`-like message representation, instead of being a direct alias for" +" :meth:`as_string`." msgstr "" +"این متد تغییر یافت تا از ``utf8=True`` استفاده کند، در نتیجه بازنمایی پیامی " +"شبیه به :rfc:`6531` تولید می‌کند، به‌جای آنکه نام مستعار مستقیمی برای " +":meth:`as_string` باشد." -msgid "Return the entire message flattened as a bytes object. When optional *unixfrom* is true, the envelope header is included in the returned string. *unixfrom* defaults to ``False``. The *policy* argument may be used to override the default policy obtained from the message instance. This can be used to control some of the formatting produced by the method, since the specified *policy* will be passed to the :class:`~email.generator.BytesGenerator`." -msgstr "" +msgid "" +"Return the entire message flattened as a bytes object. When optional " +"*unixfrom* is true, the envelope header is included in the returned string." +" *unixfrom* defaults to ``False``. The *policy* argument may be used to " +"override the default policy obtained from the message instance. This can be " +"used to control some of the formatting produced by the method, since the " +"specified *policy* will be passed to the " +":class:`~email.generator.BytesGenerator`." +msgstr "" +"کل پیام را به‌صورت یک شیء بایتی مسطح‌شده برمی‌گرداند. هنگامی که آرگومان " +"اختیاری *unixfrom* مقدار true داشته باشد، سرآیند پاکت در رشته برگردانده‌شده " +"گنجانده می‌شود. مقدار پیش‌فرض *unixfrom* برابر ``False`` است. می‌توان از " +"آرگومان *policy* برای لغو سیاست پیش‌فرض به‌دست‌آمده از نمونه پیام استفاده " +"کرد. از این می‌توان برای کنترل بخشی از قالب‌بندی تولیدشده توسط متد استفاده " +"کرد، زیرا *policy* مشخص‌شده به :class:`~email.generator.BytesGenerator` " +"ارسال خواهد شد." -msgid "Note that this method is provided as a convenience and may not be the most useful way to serialize messages in your application, especially if you are dealing with multiple messages. See :class:`email.generator.BytesGenerator` for a more flexible API for serializing messages." +msgid "" +"Note that this method is provided as a convenience and may not be the most " +"useful way to serialize messages in your application, especially if you are " +"dealing with multiple messages. See :class:`email.generator.BytesGenerator`" +" for a more flexible API for serializing messages." msgstr "" +"توجه داشته باشید که این متد به‌منظور سهولت ارائه شده است و ممکن است مفیدترین" +" روش برای سریال‌سازی پیام‌ها در برنامه شما نباشد، به‌ویژه اگر با چندین پیام " +"سروکار دارید. برای یک API انعطاف‌پذیرتر جهت سریال‌سازی پیام‌ها، " +":class:`email.generator.BytesGenerator` را ببینید." -msgid "Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes object containing the serialized message." +msgid "" +"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"object containing the serialized message." msgstr "" +"معادل :meth:`.as_bytes` است. اجازه می‌دهد ``bytes(msg)`` یک شیء bytes حاوی " +"پیام سریال‌شده تولید کند." -msgid "Return ``True`` if the message's payload is a list of sub-\\ :class:`EmailMessage` objects, otherwise return ``False``. When :meth:`is_multipart` returns ``False``, the payload should be a string object (which might be a CTE encoded binary payload). Note that :meth:`is_multipart` returning ``True`` does not necessarily mean that \"msg.get_content_maintype() == 'multipart'\" will return the ``True``. For example, ``is_multipart`` will return ``True`` when the :class:`EmailMessage` is of type ``message/rfc822``." -msgstr "" +msgid "" +"Return ``True`` if the message's payload is a list of sub-\\ " +":class:`EmailMessage` objects, otherwise return ``False``. When " +":meth:`is_multipart` returns ``False``, the payload should be a string " +"object (which might be a CTE encoded binary payload). Note that " +":meth:`is_multipart` returning ``True`` does not necessarily mean that " +"\"msg.get_content_maintype() == 'multipart'\" will return the ``True``. For " +"example, ``is_multipart`` will return ``True`` when the " +":class:`EmailMessage` is of type ``message/rfc822``." +msgstr "" +"اگر بار پیام فهرستی از اشیای sub-\\ :class:`EmailMessage` باشد، ``True`` " +"را برمی‌گرداند، در غیر این صورت ``False`` را برمی‌گرداند. هنگامی که " +":meth:`is_multipart` مقدار ``False`` را برمی‌گرداند، بار باید یک شیء رشته‌ای" +" باشد (که ممکن است یک بار دودویی کدگذاری‌شده با CTE باشد). توجه داشته باشید " +"که برگرداندن ``True`` از سوی :meth:`is_multipart` لزوماً به این معنا نیست که" +" \"msg.get_content_maintype() == 'multipart'\" مقدار ``True`` را " +"برمی‌گرداند. برای مثال، هنگامی که :class:`EmailMessage` از نوع " +"``message/rfc822`` باشد، ``is_multipart`` مقدار ``True`` را برمی‌گرداند." -msgid "Set the message's envelope header to *unixfrom*, which should be a string. (See :class:`~mailbox.mboxMessage` for a brief description of this header.)" +msgid "" +"Set the message's envelope header to *unixfrom*, which should be a string. " +"(See :class:`~mailbox.mboxMessage` for a brief description of this header.)" msgstr "" +"سرآیند پاکت پیام را روی *unixfrom* تنظیم کنید، که باید یک رشته باشد. (برای " +"شرح کوتاهی از این سرآیند، :class:`~mailbox.mboxMessage` را ببینید.)" -msgid "Return the message's envelope header. Defaults to ``None`` if the envelope header was never set." +msgid "" +"Return the message's envelope header. Defaults to ``None`` if the envelope " +"header was never set." msgstr "" +"سرآیند پاکت پیام را بازمی‌گرداند. اگر سرآیند پاکت هرگز تنظیم نشده باشد، مقدار " +"پیش‌فرض آن ``None`` است." -msgid "The following methods implement the mapping-like interface for accessing the message's headers. Note that there are some semantic differences between these methods and a normal mapping (i.e. dictionary) interface. For example, in a dictionary there are no duplicate keys, but here there may be duplicate message headers. Also, in dictionaries there is no guaranteed order to the keys returned by :meth:`keys`, but in an :class:`EmailMessage` object, headers are always returned in the order they appeared in the original message, or in which they were added to the message later. Any header deleted and then re-added is always appended to the end of the header list." -msgstr "" +msgid "" +"The following methods implement the mapping-like interface for accessing the" +" message's headers. Note that there are some semantic differences between " +"these methods and a normal mapping (i.e. dictionary) interface. For " +"example, in a dictionary there are no duplicate keys, but here there may be " +"duplicate message headers. Also, in dictionaries there is no guaranteed " +"order to the keys returned by :meth:`keys`, but in an :class:`EmailMessage` " +"object, headers are always returned in the order they appeared in the " +"original message, or in which they were added to the message later. Any " +"header deleted and then re-added is always appended to the end of the header" +" list." +msgstr "" +"متدهای زیر رابط شبه‌نگاشتی را برای دسترسی به سرآیندهای پیام پیاده‌سازی " +"می‌کنند. توجه داشته باشید که تفاوت‌های معنایی میان این متدها و یک رابط نگاشت" +" معمولی (یعنی دیکشنری) وجود دارد. برای مثال، در یک دیکشنری کلید تکراری وجود " +"ندارد، اما اینجا ممکن است سرآیندهای پیام تکراری باشند. همچنین، در دیکشنری‌ها" +" ترتیب کلیدهای برگردانده‌شده توسط :meth:`keys` تضمین‌شده نیست، اما در یک شیء" +" :class:`EmailMessage`، سرآیندها همیشه به همان ترتیبی که در پیام اصلی ظاهر " +"شده‌اند، یا به همان ترتیبی که بعداً به پیام افزوده شده‌اند، برگردانده " +"می‌شوند. هر سرآیندی که حذف و سپس دوباره افزوده شود، همیشه به انتهای فهرست " +"سرآیندها الحاق می‌شود." -msgid "These semantic differences are intentional and are biased toward convenience in the most common use cases." +msgid "" +"These semantic differences are intentional and are biased toward convenience" +" in the most common use cases." msgstr "" +"این تفاوت‌های معنایی عمدی هستند و به سمت سهولت در رایج‌ترین موارد استفاده " +"تمایل دارند." -msgid "Note that in all cases, any envelope header present in the message is not included in the mapping interface." +msgid "" +"Note that in all cases, any envelope header present in the message is not " +"included in the mapping interface." msgstr "" +"توجه داشته باشید که در همه موارد، هر سرآیند پاکتی (envelope header) که در " +"پیام وجود دارد، در رابط نگاشت گنجانده نمی‌شود." msgid "Return the total number of headers, including duplicates." -msgstr "" +msgstr "تعداد کل سرآیندها، از جمله تکراری‌ها را برمی‌گرداند." -msgid "Return ``True`` if the message object has a field named *name*. Matching is done without regard to case and *name* does not include the trailing colon. Used for the ``in`` operator. For example::" +msgid "" +"Return ``True`` if the message object has a field named *name*. Matching is " +"done without regard to case and *name* does not include the trailing colon." +" Used for the ``in`` operator. For example::" msgstr "" +"اگر شیء پیام فیلدی به نام *name* داشته باشد، ``True`` را برمی‌گرداند. تطبیق " +"بدون در نظر گرفتن بزرگی و کوچکی حروف انجام می‌شود و *name* شامل دونقطه " +"پایانی نمی‌شود. برای عملگر ``in`` استفاده می‌شود. برای مثال::" msgid "" "if 'message-id' in myMessage:\n" " print('Message-ID:', myMessage['message-id'])" msgstr "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" -msgid "Return the value of the named header field. *name* does not include the colon field separator. If the header is missing, ``None`` is returned; a :exc:`KeyError` is never raised." +msgid "" +"Return the value of the named header field. *name* does not include the " +"colon field separator. If the header is missing, ``None`` is returned; a " +":exc:`KeyError` is never raised." msgstr "" +"مقدار فیلد سرآیند با نام مشخص را برمی‌گرداند. *name* شامل جداکننده‌ی دونقطه‌ای" +" فیلد نمی‌شود. اگر سرآیند موجود نباشد، ``None`` برگردانده می‌شود؛ هرگز " +"استثنای :exc:`KeyError` پرتاب نمی‌شود." -msgid "Note that if the named field appears more than once in the message's headers, exactly which of those field values will be returned is undefined. Use the :meth:`get_all` method to get the values of all the extant headers named *name*." +msgid "" +"Note that if the named field appears more than once in the message's " +"headers, exactly which of those field values will be returned is undefined." +" Use the :meth:`get_all` method to get the values of all the extant headers" +" named *name*." msgstr "" +"توجه داشته باشید که اگر فیلد نام‌برده‌شده بیش از یک بار در سرصفحه‌های پیام " +"ظاهر شود، دقیقاً اینکه کدام‌یک از مقدارهای آن فیلد برگردانده می‌شود، " +"تعریف‌نشده است. برای دریافت مقدارهای همه سرصفحه‌های موجود با نام *name* از " +"متد :meth:`get_all` استفاده کنید." -msgid "Using the standard (non-``compat32``) policies, the returned value is an instance of a subclass of :class:`email.headerregistry.BaseHeader`." +msgid "" +"Using the standard (non-``compat32``) policies, the returned value is an " +"instance of a subclass of :class:`email.headerregistry.BaseHeader`." msgstr "" +"با استفاده از سیاست‌های استاندارد (غیر ``compat32``)، مقدار برگردانده‌شده " +"نمونه‌ای از زیرکلاسی از :class:`email.headerregistry.BaseHeader` است." -msgid "Add a header to the message with field name *name* and value *val*. The field is appended to the end of the message's existing headers." +msgid "" +"Add a header to the message with field name *name* and value *val*. The " +"field is appended to the end of the message's existing headers." msgstr "" +"یک سرآیند با نام فیلد *name* و مقدار *val* به پیام اضافه کنید. این فیلد به " +"پایان سرآیندهای موجود پیام افزوده می‌شود." -msgid "Note that this does *not* overwrite or delete any existing header with the same name. If you want to ensure that the new header is the only one present in the message with field name *name*, delete the field first, e.g.::" +msgid "" +"Note that this does *not* overwrite or delete any existing header with the " +"same name. If you want to ensure that the new header is the only one " +"present in the message with field name *name*, delete the field first, " +"e.g.::" msgstr "" +"توجه داشته باشید که این کار هیچ سرآیند موجودی با نام یکسان را بازنویسی یا حذف" +" *نمی‌کند*. اگر می‌خواهید اطمینان حاصل کنید که سرآیند جدید، تنها سرآیند موجود " +"در پیام با نام فیلد *name* است، ابتدا فیلد را حذف کنید، برای مثال::" msgid "" "del msg['subject']\n" "msg['subject'] = 'Python roolz!'" msgstr "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" -msgid "If the :mod:`policy ` defines certain headers to be unique (as the standard policies do), this method may raise a :exc:`ValueError` when an attempt is made to assign a value to such a header when one already exists. This behavior is intentional for consistency's sake, but do not depend on it as we may choose to make such assignments do an automatic deletion of the existing header in the future." -msgstr "" +msgid "" +"If the :mod:`policy ` defines certain headers to be unique (as" +" the standard policies do), this method may raise a :exc:`ValueError` when " +"an attempt is made to assign a value to such a header when one already " +"exists. This behavior is intentional for consistency's sake, but do not " +"depend on it as we may choose to make such assignments do an automatic " +"deletion of the existing header in the future." +msgstr "" +"اگر :mod:`policy ` برخی سرآیندها را یکتا تعریف کند (همان‌طور " +"که سیاست‌های استاندارد این‌گونه تعریف می‌کنند)، این متد ممکن است هنگامی که " +"تلاش شود مقداری به چنین سرآیندی اختصاص یابد، در صورتی که از قبل سرآیندی موجود " +"باشد، یک :exc:`ValueError` پرتاب کند. این رفتار به‌منظور سازگاری عمدی است، " +"اما به آن اتکا نکنید، زیرا ممکن است در آینده تصمیم بگیریم که چنین " +"انتساب‌هایی موجب حذف خودکار سرآیند موجود شوند." -msgid "Delete all occurrences of the field with name *name* from the message's headers. No exception is raised if the named field isn't present in the headers." +msgid "" +"Delete all occurrences of the field with name *name* from the message's " +"headers. No exception is raised if the named field isn't present in the " +"headers." msgstr "" +"تمام موارد فیلد با نام *name* را از سرآیندهای پیام حذف می‌کند. اگر فیلد " +"نام‌برده در سرآیندها وجود نداشته باشد، هیچ استثنایی پرتاب نمی‌شود." msgid "Return a list of all the message's header field names." -msgstr "" +msgstr "فهرستی از نام تمام فیلدهای سرایند پیام را برمی‌گرداند." msgid "Return a list of all the message's field values." -msgstr "" +msgstr "فهرستی از همه‌ی مقدارهای فیلدهای پیام را برمی‌گرداند." -msgid "Return a list of 2-tuples containing all the message's field headers and values." +msgid "" +"Return a list of 2-tuples containing all the message's field headers and " +"values." msgstr "" +"فهرستی از تاپل‌های دوتایی برمی‌گرداند که شامل تمام سرآیندها و مقادیر " +"فیلدهای پیام است." -msgid "Return the value of the named header field. This is identical to :meth:`~object.__getitem__` except that optional *failobj* is returned if the named header is missing (*failobj* defaults to ``None``)." +msgid "" +"Return the value of the named header field. This is identical to " +":meth:`~object.__getitem__` except that optional *failobj* is returned if " +"the named header is missing (*failobj* defaults to ``None``)." msgstr "" +"مقدار فیلد سرآیندِ نام‌برده‌شده را برمی‌گرداند. این با " +":meth:`~object.__getitem__` یکسان است، با این تفاوت که اگر سرآیند " +"نام‌برده‌شده وجود نداشته باشد، *failobj* اختیاری برگردانده می‌شود (مقدار " +"پیش‌فرض *failobj* ``None`` است)." msgid "Here are some additional useful header related methods:" -msgstr "" +msgstr "در اینجا چند متد مفید دیگر مرتبط با سرآیند آمده است:" -msgid "Return a list of all the values for the field named *name*. If there are no such named headers in the message, *failobj* is returned (defaults to ``None``)." +msgid "" +"Return a list of all the values for the field named *name*. If there are no " +"such named headers in the message, *failobj* is returned (defaults to " +"``None``)." msgstr "" +"فهرستی از همه‌ی مقادیر فیلدی با نام *name* را برمی‌گرداند. اگر هیچ سرصفحه‌ای " +"با این نام در پیام وجود نداشته باشد، *failobj* برگردانده می‌شود (پیش‌فرض " +"``None`` است)." -msgid "Extended header setting. This method is similar to :meth:`__setitem__` except that additional header parameters can be provided as keyword arguments. *_name* is the header field to add and *_value* is the *primary* value for the header." +msgid "" +"Extended header setting. This method is similar to :meth:`__setitem__` " +"except that additional header parameters can be provided as keyword " +"arguments. *_name* is the header field to add and *_value* is the *primary*" +" value for the header." msgstr "" +"تنظیم سرآیند گسترش‌یافته. این متد مشابه :meth:`__setitem__` است، با این " +"تفاوت که می‌توان پارامترهای اضافی سرآیند را به‌صورت آرگومان‌های کلیدواژه‌ای " +"ارائه کرد. *_name* فیلد سرآیندی است که باید افزوده شود و *_value* مقدار " +"*اصلی* برای سرآیند است." -msgid "For each item in the keyword argument dictionary *_params*, the key is taken as the parameter name, with underscores converted to dashes (since dashes are illegal in Python identifiers). Normally, the parameter will be added as ``key=\"value\"`` unless the value is ``None``, in which case only the key will be added." -msgstr "" +msgid "" +"For each item in the keyword argument dictionary *_params*, the key is taken" +" as the parameter name, with underscores converted to dashes (since dashes " +"are illegal in Python identifiers). Normally, the parameter will be added " +"as ``key=\"value\"`` unless the value is ``None``, in which case only the " +"key will be added." +msgstr "" +"برای هر آیتم در دیکشنری آرگومان‌های کلیدواژه‌ای *_params*، کلید به‌عنوان نام" +" پارامتر در نظر گرفته می‌شود و زیرخط‌ها به خط تیره تبدیل می‌شوند (زیرا خط " +"تیره در شناسه‌های پایتون غیرمجاز است). معمولاً، پارامتر به‌صورت " +"``key=\"value\"`` اضافه می‌شود، مگر اینکه مقدار ``None`` باشد، که در این " +"صورت فقط کلید اضافه می‌شود." -msgid "If the value contains non-ASCII characters, the charset and language may be explicitly controlled by specifying the value as a three tuple in the format ``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the charset to be used to encode the value, ``LANGUAGE`` can usually be set to ``None`` or the empty string (see :rfc:`2231` for other possibilities), and ``VALUE`` is the string value containing non-ASCII code points. If a three tuple is not passed and the value contains non-ASCII characters, it is automatically encoded in :rfc:`2231` format using a ``CHARSET`` of ``utf-8`` and a ``LANGUAGE`` of ``None``." -msgstr "" +msgid "" +"If the value contains non-ASCII characters, the charset and language may be " +"explicitly controlled by specifying the value as a three tuple in the format" +" ``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the " +"charset to be used to encode the value, ``LANGUAGE`` can usually be set to " +"``None`` or the empty string (see :rfc:`2231` for other possibilities), and " +"``VALUE`` is the string value containing non-ASCII code points. If a three " +"tuple is not passed and the value contains non-ASCII characters, it is " +"automatically encoded in :rfc:`2231` format using a ``CHARSET`` of ``utf-8``" +" and a ``LANGUAGE`` of ``None``." +msgstr "" +"اگر مقدار حاوی نویسه‌های غیر ASCII باشد، می‌توان مجموعه نویسه و زبان را " +"به‌صراحت با تعیین مقدار به‌صورت یک تاپل سه‌تایی در قالب ``(CHARSET, " +"LANGUAGE, VALUE)`` کنترل کرد، که در آن ``CHARSET`` رشته‌ای است که نام مجموعه" +" نویسه مورد استفاده برای کدگذاری مقدار را مشخص می‌کند، ``LANGUAGE`` معمولاً " +"می‌تواند ``None`` یا رشته خالی باشد (برای سایر حالت‌ها :rfc:`2231` را " +"ببینید)، و ``VALUE`` مقدار رشته‌ای حاوی نقاط کد غیر ASCII است. اگر یک تاپل " +"سه‌تایی ارسال نشود و مقدار حاوی نویسه‌های غیر ASCII باشد، به‌طور خودکار در " +"قالب :rfc:`2231` با ``CHARSET`` برابر ``utf-8`` و ``LANGUAGE`` برابر " +"``None`` کدگذاری می‌شود." msgid "Here is an example::" -msgstr "" +msgstr "در اینجا مثالی آمده است::" -msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgid "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgstr "" +"msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" msgid "This will add a header that looks like ::" -msgstr "" +msgstr "این یک سرآیند اضافه می‌کند که به این شکل است ::" msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" +msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" msgid "An example of the extended interface with non-ASCII characters::" -msgstr "" +msgstr "مثالی از رابط گسترش‌یافته با نویسه‌های غیر ASCII::" msgid "" "msg.add_header('Content-Disposition', 'attachment',\n" " filename=('iso-8859-1', '', 'Fußballer.ppt'))" msgstr "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" -msgid "Replace a header. Replace the first header found in the message that matches *_name*, retaining header order and field name case of the original header. If no matching header is found, raise a :exc:`KeyError`." +msgid "" +"Replace a header. Replace the first header found in the message that " +"matches *_name*, retaining header order and field name case of the original " +"header. If no matching header is found, raise a :exc:`KeyError`." msgstr "" +"یک سرآیند را جایگزین می‌کند. اولین سرآیند یافت‌شده در پیام را که با *_name* " +"مطابقت داشته باشد جایگزین می‌کند، در حالی که ترتیب سرآیندها و بزرگی و کوچکی " +"حروف نام فیلد سرآیند اصلی را حفظ می‌کند. اگر هیچ سرآیند منطبقی یافت نشد، " +"استثنای :exc:`KeyError` پرتاب می‌شود." -msgid "Return the message's content type, coerced to lower case of the form :mimetype:`maintype/subtype`. If there is no :mailheader:`Content-Type` header in the message return the value returned by :meth:`get_default_type`. If the :mailheader:`Content-Type` header is invalid, return ``text/plain``." +msgid "" +"Return the message's content type, coerced to lower case of the form " +":mimetype:`maintype/subtype`. If there is no :mailheader:`Content-Type` " +"header in the message return the value returned by :meth:`get_default_type`." +" If the :mailheader:`Content-Type` header is invalid, return " +"``text/plain``." msgstr "" +"نوع محتوای پیام را به صورت حروف کوچک و در قالب :mimetype:`maintype/subtype` " +"برمی‌گرداند. اگر سرآیند :mailheader:`Content-Type` در پیام وجود نداشته باشد،" +" مقدار بازگشتی از :meth:`get_default_type` را برمی‌گرداند. اگر سرآیند " +":mailheader:`Content-Type` نامعتبر باشد، ``text/plain`` را برمی‌گرداند." -msgid "(According to :rfc:`2045`, messages always have a default type, :meth:`get_content_type` will always return a value. :rfc:`2045` defines a message's default type to be :mimetype:`text/plain` unless it appears inside a :mimetype:`multipart/digest` container, in which case it would be :mimetype:`message/rfc822`. If the :mailheader:`Content-Type` header has an invalid type specification, :rfc:`2045` mandates that the default type be :mimetype:`text/plain`.)" -msgstr "" +msgid "" +"(According to :rfc:`2045`, messages always have a default type, " +":meth:`get_content_type` will always return a value. :rfc:`2045` defines a " +"message's default type to be :mimetype:`text/plain` unless it appears inside" +" a :mimetype:`multipart/digest` container, in which case it would be " +":mimetype:`message/rfc822`. If the :mailheader:`Content-Type` header has an" +" invalid type specification, :rfc:`2045` mandates that the default type be " +":mimetype:`text/plain`.)" +msgstr "" +"(بر اساس :rfc:`2045`، پیام‌ها همیشه یک نوع پیش‌فرض دارند؛ " +":meth:`get_content_type` همیشه یک مقدار برمی‌گرداند. :rfc:`2045` نوع پیش‌فرض" +" یک پیام را :mimetype:`text/plain` تعریف می‌کند، مگر اینکه داخل یک ظرف " +":mimetype:`multipart/digest` قرار داشته باشد، که در این صورت " +":mimetype:`message/rfc822` خواهد بود. اگر سرآیند :mailheader:`Content-Type` " +"دارای مشخصه‌ی نوع نامعتبر باشد، :rfc:`2045` الزام می‌کند که نوع پیش‌فرض " +":mimetype:`text/plain` باشد.)" -msgid "Return the message's main content type. This is the :mimetype:`maintype` part of the string returned by :meth:`get_content_type`." +msgid "" +"Return the message's main content type. This is the :mimetype:`maintype` " +"part of the string returned by :meth:`get_content_type`." msgstr "" +"نوع محتوای اصلی پیام را برمی‌گرداند. این، بخش :mimetype:`maintype` از " +"رشته‌ای است که توسط :meth:`get_content_type` برگردانده می‌شود." -msgid "Return the message's sub-content type. This is the :mimetype:`subtype` part of the string returned by :meth:`get_content_type`." +msgid "" +"Return the message's sub-content type. This is the :mimetype:`subtype` part" +" of the string returned by :meth:`get_content_type`." msgstr "" +"زیرنوع محتوای پیام را برمی‌گرداند. این مقدار بخش :mimetype:`subtype` از " +"رشته‌ای است که :meth:`get_content_type` برمی‌گرداند." -msgid "Return the default content type. Most messages have a default content type of :mimetype:`text/plain`, except for messages that are subparts of :mimetype:`multipart/digest` containers. Such subparts have a default content type of :mimetype:`message/rfc822`." +msgid "" +"Return the default content type. Most messages have a default content type " +"of :mimetype:`text/plain`, except for messages that are subparts of " +":mimetype:`multipart/digest` containers. Such subparts have a default " +"content type of :mimetype:`message/rfc822`." msgstr "" +"نوع محتوای پیش‌فرض را برمی‌گرداند. بیشتر پیام‌ها نوع محتوای پیش‌فرض " +":mimetype:`text/plain` دارند، به جز پیام‌هایی که زیربخش‌هایی از ظرف‌های " +":mimetype:`multipart/digest` هستند. این زیربخش‌ها نوع محتوای پیش‌فرض " +":mimetype:`message/rfc822` دارند." -msgid "Set the default content type. *ctype* should either be :mimetype:`text/plain` or :mimetype:`message/rfc822`, although this is not enforced. The default content type is not stored in the :mailheader:`Content-Type` header, so it only affects the return value of the ``get_content_type`` methods when no :mailheader:`Content-Type` header is present in the message." -msgstr "" +msgid "" +"Set the default content type. *ctype* should either be " +":mimetype:`text/plain` or :mimetype:`message/rfc822`, although this is not " +"enforced. The default content type is not stored in the " +":mailheader:`Content-Type` header, so it only affects the return value of " +"the ``get_content_type`` methods when no :mailheader:`Content-Type` header " +"is present in the message." +msgstr "" +"نوع محتوای پیش‌فرض را تنظیم کنید. *ctype* باید یا :mimetype:`text/plain` یا " +":mimetype:`message/rfc822` باشد، اگرچه این موضوع اعمال نمی‌شود. نوع محتوای " +"پیش‌فرض در سرآیند :mailheader:`Content-Type` ذخیره نمی‌شود، بنابراین تنها " +"زمانی بر مقدار بازگشتی متدهای ``get_content_type`` تأثیر می‌گذارد که هیچ " +"سرآیند :mailheader:`Content-Type` در پیام وجود نداشته باشد." -msgid "Set a parameter in the :mailheader:`Content-Type` header. If the parameter already exists in the header, replace its value with *value*. When *header* is ``Content-Type`` (the default) and the header does not yet exist in the message, add it, set its value to :mimetype:`text/plain`, and append the new parameter value. Optional *header* specifies an alternative header to :mailheader:`Content-Type`." -msgstr "" +msgid "" +"Set a parameter in the :mailheader:`Content-Type` header. If the parameter " +"already exists in the header, replace its value with *value*. When *header* " +"is ``Content-Type`` (the default) and the header does not yet exist in the " +"message, add it, set its value to :mimetype:`text/plain`, and append the new" +" parameter value. Optional *header* specifies an alternative header to " +":mailheader:`Content-Type`." +msgstr "" +"پارامتری را در سرآیند :mailheader:`Content-Type` تنظیم می‌کند. اگر پارامتر از" +" قبل در سرآیند وجود داشته باشد، مقدار آن را با *value* جایگزین می‌کند. هنگامی" +" که *header* برابر ``Content-Type`` (پیش‌فرض) باشد و سرآیند هنوز در پیام وجود" +" نداشته باشد، آن را اضافه می‌کند، مقدار آن را روی :mimetype:`text/plain` " +"تنظیم می‌کند و مقدار پارامتر جدید را به آن می‌افزاید. *header* اختیاری، " +"سرآیند جایگزینی را برای :mailheader:`Content-Type` مشخص می‌کند." -msgid "If the value contains non-ASCII characters, the charset and language may be explicitly specified using the optional *charset* and *language* parameters. Optional *language* specifies the :rfc:`2231` language, defaulting to the empty string. Both *charset* and *language* should be strings. The default is to use the ``utf8`` *charset* and ``None`` for the *language*." -msgstr "" +msgid "" +"If the value contains non-ASCII characters, the charset and language may be " +"explicitly specified using the optional *charset* and *language* parameters." +" Optional *language* specifies the :rfc:`2231` language, defaulting to the " +"empty string. Both *charset* and *language* should be strings. The default" +" is to use the ``utf8`` *charset* and ``None`` for the *language*." +msgstr "" +"اگر مقدار شامل نویسه‌های غیر ASCII باشد، می‌توان مجموعه نویسه (charset) و " +"زبان را با استفاده از پارامترهای اختیاری *charset* و *language* به‌صراحت " +"مشخص کرد. پارامتر اختیاری *language* زبان :rfc:`2231` را مشخص می‌کند و " +"پیش‌فرض آن رشته خالی است. هر دو پارامتر *charset* و *language* باید رشته " +"باشند. پیش‌فرض استفاده از ``utf8`` برای *charset* و ``None`` برای *language*" +" است." -msgid "If *replace* is ``False`` (the default) the header is moved to the end of the list of headers. If *replace* is ``True``, the header will be updated in place." +msgid "" +"If *replace* is ``False`` (the default) the header is moved to the end of " +"the list of headers. If *replace* is ``True``, the header will be updated " +"in place." msgstr "" +"اگر *replace* برابر ``False`` باشد (پیش‌فرض)، سرآیند به انتهای فهرست سرآیندها" +" منتقل می‌شود. اگر *replace* برابر ``True`` باشد، سرآیند در همان جای خود " +"به‌روزرسانی خواهد شد." -msgid "Use of the *requote* parameter with :class:`EmailMessage` objects is deprecated." +msgid "" +"Use of the *requote* parameter with :class:`EmailMessage` objects is " +"deprecated." msgstr "" +"استفاده از پارامتر *requote* با اشیای :class:`EmailMessage` منسوخ شده است." -msgid "Note that existing parameter values of headers may be accessed through the :attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of the header value (for example, ``msg['Content-Type'].params['charset']``)." +msgid "" +"Note that existing parameter values of headers may be accessed through the " +":attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of " +"the header value (for example, ``msg['Content-Type'].params['charset']``)." msgstr "" +"توجه داشته باشید که مقادیر پارامترهای موجود در سرآیندها از طریق ویژگی " +":attr:`~email.headerregistry.ParameterizedMIMEHeader.params` در مقدار سرآیند " +"قابل دسترسی هستند (برای مثال، ``msg['Content-Type'].params['charset']``)." msgid "``replace`` keyword was added." -msgstr "" +msgstr "کلیدواژه‌ی ``replace`` اضافه شد." -msgid "Remove the given parameter completely from the :mailheader:`Content-Type` header. The header will be re-written in place without the parameter or its value. Optional *header* specifies an alternative to :mailheader:`Content-Type`." +msgid "" +"Remove the given parameter completely from the :mailheader:`Content-Type` " +"header. The header will be re-written in place without the parameter or its" +" value. Optional *header* specifies an alternative to :mailheader:`Content-" +"Type`." msgstr "" +"پارامتر داده‌شده را به‌طور کامل از سرآیند :mailheader:`Content-Type` حذف " +"کنید. سرآیند به‌صورت درجا بدون پارامتر یا مقدار آن بازنویسی خواهد شد. پارامتر" +" اختیاری *header* جایگزینی برای :mailheader:`Content-Type` مشخص می‌کند." -msgid "Return the value of the ``filename`` parameter of the :mailheader:`Content-Disposition` header of the message. If the header does not have a ``filename`` parameter, this method falls back to looking for the ``name`` parameter on the :mailheader:`Content-Type` header. If neither is found, or the header is missing, then *failobj* is returned. The returned string will always be unquoted as per :func:`email.utils.unquote`." -msgstr "" +msgid "" +"Return the value of the ``filename`` parameter of the :mailheader:`Content-" +"Disposition` header of the message. If the header does not have a " +"``filename`` parameter, this method falls back to looking for the ``name`` " +"parameter on the :mailheader:`Content-Type` header. If neither is found, or" +" the header is missing, then *failobj* is returned. The returned string will" +" always be unquoted as per :func:`email.utils.unquote`." +msgstr "" +"مقدار پارامتر ``filename`` در سرآیند :mailheader:`Content-Disposition` پیام " +"را برمی‌گرداند. اگر سرآیند پارامتر ``filename`` نداشته باشد، این متد به‌عنوان" +" جایگزین، پارامتر ``name`` را در سرآیند :mailheader:`Content-Type` جست‌وجو " +"می‌کند. اگر هیچ‌کدام پیدا نشود یا سرآیند وجود نداشته باشد، *failobj* " +"برگردانده می‌شود. رشته برگردانده‌شده همیشه طبق :func:`email.utils.unquote` " +"بدون علامت نقل‌قول خواهد بود." -msgid "Return the value of the ``boundary`` parameter of the :mailheader:`Content-Type` header of the message, or *failobj* if either the header is missing, or has no ``boundary`` parameter. The returned string will always be unquoted as per :func:`email.utils.unquote`." +msgid "" +"Return the value of the ``boundary`` parameter of the :mailheader:`Content-" +"Type` header of the message, or *failobj* if either the header is missing, " +"or has no ``boundary`` parameter. The returned string will always be " +"unquoted as per :func:`email.utils.unquote`." msgstr "" +"مقدار پارامتر ``boundary`` از سرآیند :mailheader:`Content-Type` پیام را " +"برمی‌گرداند، یا اگر سرآیند موجود نباشد یا پارامتر ``boundary`` نداشته باشد، " +"*failobj* را برمی‌گرداند. رشته‌ی بازگشتی همیشه مطابق " +":func:`email.utils.unquote` بدون علامت نقل‌قول خواهد بود." -msgid "Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to *boundary*. :meth:`set_boundary` will always quote *boundary* if necessary. A :exc:`~email.errors.HeaderParseError` is raised if the message object has no :mailheader:`Content-Type` header." +msgid "" +"Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " +"*boundary*. :meth:`set_boundary` will always quote *boundary* if necessary." +" A :exc:`~email.errors.HeaderParseError` is raised if the message object " +"has no :mailheader:`Content-Type` header." msgstr "" +"پارامتر ``boundary`` در سرآیند :mailheader:`Content-Type` را روی *boundary* " +"تنظیم کنید. :meth:`set_boundary` در صورت لزوم همیشه *boundary* را داخل " +"علامت نقل‌قول قرار می‌دهد. اگر شیء پیام فاقد سرآیند :mailheader:`Content-" +"Type` باشد، استثنای :exc:`~email.errors.HeaderParseError` پرتاب می‌شود." -msgid "Note that using this method is subtly different from deleting the old :mailheader:`Content-Type` header and adding a new one with the new boundary via :meth:`add_header`, because :meth:`set_boundary` preserves the order of the :mailheader:`Content-Type` header in the list of headers." +msgid "" +"Note that using this method is subtly different from deleting the old " +":mailheader:`Content-Type` header and adding a new one with the new boundary" +" via :meth:`add_header`, because :meth:`set_boundary` preserves the order of" +" the :mailheader:`Content-Type` header in the list of headers." msgstr "" +"توجه داشته باشید که استفاده از این متد به‌صورت ظریفی با حذف سرآیند قدیمی " +":mailheader:`Content-Type` و افزودن یک سرآیند جدید با مرز جدید (boundary) از " +"طریق :meth:`add_header` متفاوت است، زیرا :meth:`set_boundary` ترتیب سرآیند " +":mailheader:`Content-Type` را در فهرست سرآیندها حفظ می‌کند." -msgid "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, coerced to lower case. If there is no :mailheader:`Content-Type` header, or if that header has no ``charset`` parameter, *failobj* is returned." +msgid "" +"Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " +"coerced to lower case. If there is no :mailheader:`Content-Type` header, or" +" if that header has no ``charset`` parameter, *failobj* is returned." msgstr "" +"پارامتر ``charset`` سرآیند :mailheader:`Content-Type` را، پس از تبدیل به حروف" +" کوچک، برمی‌گرداند. اگر سرآیند :mailheader:`Content-Type` وجود نداشته باشد، " +"یا آن سرآیند پارامتر ``charset`` نداشته باشد، *failobj* برگردانده می‌شود." -msgid "Return a list containing the character set names in the message. If the message is a :mimetype:`multipart`, then the list will contain one element for each subpart in the payload, otherwise, it will be a list of length 1." +msgid "" +"Return a list containing the character set names in the message. If the " +"message is a :mimetype:`multipart`, then the list will contain one element " +"for each subpart in the payload, otherwise, it will be a list of length 1." msgstr "" +"فهرستی شامل نام‌های مجموعه‌نویسه در پیام را برمی‌گرداند. اگر پیام از نوع " +":mimetype:`multipart` باشد، فهرست شامل یک المان برای هر زیربخش در بار " +"(payload) خواهد بود، در غیر این صورت، فهرستی به طول ۱ خواهد بود." -msgid "Each item in the list will be a string which is the value of the ``charset`` parameter in the :mailheader:`Content-Type` header for the represented subpart. If the subpart has no :mailheader:`Content-Type` header, no ``charset`` parameter, or is not of the :mimetype:`text` main MIME type, then that item in the returned list will be *failobj*." -msgstr "" +msgid "" +"Each item in the list will be a string which is the value of the ``charset``" +" parameter in the :mailheader:`Content-Type` header for the represented " +"subpart. If the subpart has no :mailheader:`Content-Type` header, no " +"``charset`` parameter, or is not of the :mimetype:`text` main MIME type, " +"then that item in the returned list will be *failobj*." +msgstr "" +"هر آیتم در فهرست، یک رشته خواهد بود که مقدار پارامتر ``charset`` در سرآیند " +":mailheader:`Content-Type` برای زیربخش متناظر است. اگر زیربخش سرآیند " +":mailheader:`Content-Type` یا پارامتر ``charset`` نداشته باشد، یا نوع اصلی " +"MIME آن :mimetype:`text` نباشد، آن آیتم در فهرست بازگشتی برابر *failobj* " +"خواهد بود." -msgid "Return ``True`` if there is a :mailheader:`Content-Disposition` header and its (case insensitive) value is ``attachment``, ``False`` otherwise." +msgid "" +"Return ``True`` if there is a :mailheader:`Content-Disposition` header and " +"its (case insensitive) value is ``attachment``, ``False`` otherwise." msgstr "" +"اگر سرآیند :mailheader:`Content-Disposition` وجود داشته باشد و مقدار آن (بدون" +" حساسیت به بزرگی و کوچکی حروف) ``attachment`` باشد، ``True`` را برمی‌گرداند " +"و در غیر این صورت ``False`` را برمی‌گرداند." -msgid "is_attachment is now a method instead of a property, for consistency with :meth:`~email.message.Message.is_multipart`." +msgid "" +"is_attachment is now a method instead of a property, for consistency with " +":meth:`~email.message.Message.is_multipart`." msgstr "" +"is_attachment اکنون برای هماهنگی با " +":meth:`~email.message.Message.is_multipart`، به‌جای یک پراپرتی، یک متد است." -msgid "Return the lowercased value (without parameters) of the message's :mailheader:`Content-Disposition` header if it has one, or ``None``. The possible values for this method are *inline*, *attachment* or ``None`` if the message follows :rfc:`2183`." +msgid "" +"Return the lowercased value (without parameters) of the message's " +":mailheader:`Content-Disposition` header if it has one, or ``None``. The " +"possible values for this method are *inline*, *attachment* or ``None`` if " +"the message follows :rfc:`2183`." msgstr "" +"اگر پیام سرآیند :mailheader:`Content-Disposition` داشته باشد، مقدار با حروف " +"کوچک آن (بدون پارامترها) را برمی‌گرداند؛ در غیر این صورت ``None`` را " +"برمی‌گرداند. اگر پیام از :rfc:`2183` پیروی کند، مقادیر ممکن برای این متد " +"*inline*، *attachment* یا ``None`` هستند." -msgid "The following methods relate to interrogating and manipulating the content (payload) of the message." -msgstr "" +msgid "" +"The following methods relate to interrogating and manipulating the content " +"(payload) of the message." +msgstr "متدهای زیر به بررسی و دستکاری محتوای پیام (payload) مربوط می‌شوند." -msgid "The :meth:`walk` method is an all-purpose generator which can be used to iterate over all the parts and subparts of a message object tree, in depth-first traversal order. You will typically use :meth:`walk` as the iterator in a ``for`` loop; each iteration returns the next subpart." +msgid "" +"The :meth:`walk` method is an all-purpose generator which can be used to " +"iterate over all the parts and subparts of a message object tree, in depth-" +"first traversal order. You will typically use :meth:`walk` as the iterator " +"in a ``for`` loop; each iteration returns the next subpart." msgstr "" +"متد :meth:`walk` یک تولیدگر همه‌منظوره است که می‌توان از آن برای تکرار روی " +"تمام بخش‌ها و زیربخش‌های درخت شیء پیام، به ترتیب پیمایش عمق‌اول استفاده کرد." +" شما معمولاً از :meth:`walk` به‌عنوان پیمایش‌گر در یک حلقه ``for`` استفاده " +"می‌کنید؛ هر تکرار، زیربخش بعدی را برمی‌گرداند." -msgid "Here's an example that prints the MIME type of every part of a multipart message structure:" +msgid "" +"Here's an example that prints the MIME type of every part of a multipart " +"message structure:" msgstr "" +"در اینجا مثالی آمده که نوع MIME هر بخش از یک ساختار پیام چندبخشی را چاپ " +"می‌کند:" msgid "" ">>> for part in msg.walk():\n" @@ -271,9 +783,26 @@ msgid "" "message/rfc822\n" "text/plain" msgstr "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" -msgid "``walk`` iterates over the subparts of any part where :meth:`is_multipart` returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` may return ``False``. We can see this in our example by making use of the ``_structure`` debug helper function:" +msgid "" +"``walk`` iterates over the subparts of any part where :meth:`is_multipart` " +"returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " +"may return ``False``. We can see this in our example by making use of the " +"``_structure`` debug helper function:" msgstr "" +"``walk`` زیربخش‌های هر بخشی را که :meth:`is_multipart` مقدار ``True`` " +"برمی‌گرداند، پیمایش می‌کند، هرچند ممکن است ``msg.get_content_maintype() == " +"'multipart'`` مقدار ``False`` برگرداند. می‌توانیم این را در مثال خود با " +"استفاده از تابع کمکی اشکال‌زدایی ``_structure`` ببینیم:" msgid "" ">>> from email.iterators import _structure\n" @@ -296,96 +825,388 @@ msgid "" " message/rfc822\n" " text/plain" msgstr "" +">>> from email.iterators import _structure\n" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" -msgid "Here the ``message`` parts are not ``multiparts``, but they do contain subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the subparts." +msgid "" +"Here the ``message`` parts are not ``multiparts``, but they do contain " +"subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the" +" subparts." msgstr "" +"در اینجا بخش‌های ``message`` از نوع ``multiparts`` نیستند، اما شامل " +"زیربخش‌هایی هستند. ``is_multipart()`` مقدار ``True`` را برمی‌گرداند و " +"``walk`` وارد زیربخش‌ها می‌شود." -msgid "Return the MIME part that is the best candidate to be the \"body\" of the message." -msgstr "" +msgid "" +"Return the MIME part that is the best candidate to be the \"body\" of the " +"message." +msgstr "بخش MIME را که بهترین نامزد برای «بدنه» پیام است، برمی‌گرداند." -msgid "*preferencelist* must be a sequence of strings from the set ``related``, ``html``, and ``plain``, and indicates the order of preference for the content type of the part returned." +msgid "" +"*preferencelist* must be a sequence of strings from the set ``related``, " +"``html``, and ``plain``, and indicates the order of preference for the " +"content type of the part returned." msgstr "" +"*preferencelist* باید دنباله‌ای از رشته‌هایی از مجموعه ``related``، ``html``" +" و ``plain`` باشد و ترتیب اولویت برای نوع محتوای بخش برگردانده‌شده را نشان " +"می‌دهد." -msgid "Start looking for candidate matches with the object on which the ``get_body`` method is called." +msgid "" +"Start looking for candidate matches with the object on which the " +"``get_body`` method is called." msgstr "" +"جست‌وجوی تطبیق‌های نامزد را با شیءای که متد ``get_body`` روی آن فراخوانی " +"می‌شود، آغاز کنید." -msgid "If ``related`` is not included in *preferencelist*, consider the root part (or subpart of the root part) of any related encountered as a candidate if the (sub-)part matches a preference." +msgid "" +"If ``related`` is not included in *preferencelist*, consider the root part " +"(or subpart of the root part) of any related encountered as a candidate if " +"the (sub-)part matches a preference." msgstr "" +"اگر ``related`` در *preferencelist* گنجانده نشده باشد، بخش ریشه (یا زیربخشی" +" از بخش ریشه) هر related که با آن مواجه می‌شوید را در صورتی به‌عنوان نامزد " +"در نظر بگیرید که آن (زیر)بخش با ترجیحی مطابقت داشته باشد." -msgid "When encountering a ``multipart/related``, check the ``start`` parameter and if a part with a matching :mailheader:`Content-ID` is found, consider only it when looking for candidate matches. Otherwise consider only the first (default root) part of the ``multipart/related``." +msgid "" +"When encountering a ``multipart/related``, check the ``start`` parameter and" +" if a part with a matching :mailheader:`Content-ID` is found, consider only " +"it when looking for candidate matches. Otherwise consider only the first " +"(default root) part of the ``multipart/related``." msgstr "" +"هنگام مواجهه با ``multipart/related``، پارامتر ``start`` را بررسی کنید و اگر" +" بخشی با :mailheader:`Content-ID` منطبق پیدا شد، هنگام جست‌وجو برای " +"تطابق‌های محتمل فقط آن را در نظر بگیرید. در غیر این صورت فقط بخش نخست (ریشه " +"پیش‌فرض) از ``multipart/related`` را در نظر بگیرید." -msgid "If a part has a :mailheader:`Content-Disposition` header, only consider the part a candidate match if the value of the header is ``inline``." +msgid "" +"If a part has a :mailheader:`Content-Disposition` header, only consider the " +"part a candidate match if the value of the header is ``inline``." msgstr "" +"اگر بخشی سرآیند :mailheader:`Content-Disposition` داشته باشد، تنها در صورتی " +"آن بخش را یک نامزد تطابق در نظر بگیرید که مقدار سرآیند ``inline`` باشد." -msgid "If none of the candidates matches any of the preferences in *preferencelist*, return ``None``." +msgid "" +"If none of the candidates matches any of the preferences in " +"*preferencelist*, return ``None``." msgstr "" +"اگر هیچ‌یک از نامزدها با هیچ‌یک از ترجیحات موجود در *preferencelist* مطابقت " +"نداشت، ``None`` را برگردانید." -msgid "Notes: (1) For most applications the only *preferencelist* combinations that really make sense are ``('plain',)``, ``('html', 'plain')``, and the default ``('related', 'html', 'plain')``. (2) Because matching starts with the object on which ``get_body`` is called, calling ``get_body`` on a ``multipart/related`` will return the object itself unless *preferencelist* has a non-default value. (3) Messages (or message parts) that do not specify a :mailheader:`Content-Type` or whose :mailheader:`Content-Type` header is invalid will be treated as if they are of type ``text/plain``, which may occasionally cause ``get_body`` to return unexpected results." -msgstr "" +msgid "" +"Notes: (1) For most applications the only *preferencelist* combinations that" +" really make sense are ``('plain',)``, ``('html', 'plain')``, and the " +"default ``('related', 'html', 'plain')``. (2) Because matching starts with " +"the object on which ``get_body`` is called, calling ``get_body`` on a " +"``multipart/related`` will return the object itself unless *preferencelist* " +"has a non-default value. (3) Messages (or message parts) that do not specify" +" a :mailheader:`Content-Type` or whose :mailheader:`Content-Type` header is " +"invalid will be treated as if they are of type ``text/plain``, which may " +"occasionally cause ``get_body`` to return unexpected results." +msgstr "" +"یادداشت‌ها: (۱) برای بیشتر برنامه‌ها، تنها ترکیب‌های *preferencelist* که " +"واقعاً منطقی هستند، ``('plain',)``، ``('html', 'plain')`` و پیش‌فرض " +"``('related', 'html', 'plain')`` هستند. (۲) از آنجا که تطبیق از شیءای آغاز " +"می‌شود که ``get_body`` روی آن فراخوانی می‌شود، فراخوانی ``get_body`` روی یک " +"``multipart/related`` خود شیء را برمی‌گرداند، مگر اینکه *preferencelist* " +"مقداری غیر از مقدار پیش‌فرض داشته باشد. (۳) پیام‌ها (یا بخش‌های پیام) که " +":mailheader:`Content-Type` را مشخص نمی‌کنند یا سرآیند :mailheader:`Content-" +"Type` آن‌ها نامعتبر است، به‌عنوان نوع ``text/plain`` در نظر گرفته می‌شوند، " +"که ممکن است گاهی باعث شود ``get_body`` نتایج غیرمنتظره‌ای برگرداند." -msgid "Return an iterator over all of the immediate sub-parts of the message that are not candidate \"body\" parts. That is, skip the first occurrence of each of ``text/plain``, ``text/html``, ``multipart/related``, or ``multipart/alternative`` (unless they are explicitly marked as attachments via :mailheader:`Content-Disposition: attachment`), and return all remaining parts. When applied directly to a ``multipart/related``, return an iterator over the all the related parts except the root part (ie: the part pointed to by the ``start`` parameter, or the first part if there is no ``start`` parameter or the ``start`` parameter doesn't match the :mailheader:`Content-ID` of any of the parts). When applied directly to a ``multipart/alternative`` or a non-``multipart``, return an empty iterator." -msgstr "" +msgid "" +"Return an iterator over all of the immediate sub-parts of the message that " +"are not candidate \"body\" parts. That is, skip the first occurrence of " +"each of ``text/plain``, ``text/html``, ``multipart/related``, or " +"``multipart/alternative`` (unless they are explicitly marked as attachments " +"via :mailheader:`Content-Disposition: attachment`), and return all remaining" +" parts. When applied directly to a ``multipart/related``, return an " +"iterator over the all the related parts except the root part (ie: the part " +"pointed to by the ``start`` parameter, or the first part if there is no " +"``start`` parameter or the ``start`` parameter doesn't match the " +":mailheader:`Content-ID` of any of the parts). When applied directly to a " +"``multipart/alternative`` or a non-``multipart``, return an empty iterator." +msgstr "" +"پیمایش‌گری بر همه زیربخش‌های مستقیم پیام که بخش‌های نامزد «بدنه» نیستند " +"برمی‌گرداند. یعنی از نخستین رخداد هر یک از ``text/plain``، ``text/html``، " +"``multipart/related`` یا ``multipart/alternative`` می‌گذرد (مگر اینکه " +"به‌صراحت از طریق :mailheader:`Content-Disposition: attachment` به‌عنوان " +"پیوست علامت‌گذاری شده باشند) و همه بخش‌های باقی‌مانده را برمی‌گرداند. هنگامی" +" که مستقیماً بر یک ``multipart/related`` اعمال شود، پیمایش‌گری بر همه بخش‌های " +"مرتبط به جز بخش ریشه برمی‌گرداند (یعنی بخشی که پارامتر ``start`` به آن اشاره" +" دارد، یا نخستین بخش در صورتی که پارامتر ``start`` وجود نداشته باشد یا " +"پارامتر ``start`` با :mailheader:`Content-ID` هیچ‌یک از بخش‌ها مطابقت نداشته" +" باشد). هنگامی که مستقیماً بر یک ``multipart/alternative`` یا غیر " +"``multipart`` اعمال شود، یک پیمایش‌گر خالی برمی‌گرداند." -msgid "Return an iterator over all of the immediate sub-parts of the message, which will be empty for a non-``multipart``. (See also :meth:`~email.message.EmailMessage.walk`.)" +msgid "" +"Return an iterator over all of the immediate sub-parts of the message, which" +" will be empty for a non-``multipart``. (See also " +":meth:`~email.message.EmailMessage.walk`.)" msgstr "" +"پیمایش‌گری روی همه‌ی زیربخش‌های مستقیم پیام برمی‌گرداند که برای یک پیام غیر " +"``multipart`` خالی خواهد بود. (همچنین " +":meth:`~email.message.EmailMessage.walk` را ببینید.)" -msgid "Call the :meth:`~email.contentmanager.ContentManager.get_content` method of the *content_manager*, passing self as the message object, and passing along any other arguments or keywords as additional arguments. If *content_manager* is not specified, use the ``content_manager`` specified by the current :mod:`~email.policy`." -msgstr "" +msgid "" +"Call the :meth:`~email.contentmanager.ContentManager.get_content` method of " +"the *content_manager*, passing self as the message object, and passing along" +" any other arguments or keywords as additional arguments. If " +"*content_manager* is not specified, use the ``content_manager`` specified by" +" the current :mod:`~email.policy`." +msgstr "" +"متد :meth:`~email.contentmanager.ContentManager.get_content` از " +"*content_manager* را فراخوانی کنید، self را به‌عنوان شیء پیام ارسال کنید، و " +"هر آرگومان یا کلیدواژه دیگر را نیز به‌عنوان آرگومان‌های اضافی همراه آن ارسال" +" کنید. اگر *content_manager* مشخص نشده باشد، از ``content_manager`` مشخص‌شده" +" توسط :mod:`~email.policy` فعلی استفاده کنید." -msgid "Call the :meth:`~email.contentmanager.ContentManager.set_content` method of the *content_manager*, passing self as the message object, and passing along any other arguments or keywords as additional arguments. If *content_manager* is not specified, use the ``content_manager`` specified by the current :mod:`~email.policy`." -msgstr "" +msgid "" +"Call the :meth:`~email.contentmanager.ContentManager.set_content` method of " +"the *content_manager*, passing self as the message object, and passing along" +" any other arguments or keywords as additional arguments. If " +"*content_manager* is not specified, use the ``content_manager`` specified by" +" the current :mod:`~email.policy`." +msgstr "" +"متد :meth:`~email.contentmanager.ContentManager.set_content` از " +"*content_manager* را فراخوانی کنید و self را به‌عنوان شیء پیام و هر آرگومان " +"یا کلیدواژه دیگر را به‌عنوان آرگومان‌های اضافی ارسال کنید. اگر " +"*content_manager* مشخص‌نشده باشد، از ``content_manager`` تعیین‌شده توسط " +":mod:`~email.policy` جاری استفاده کنید." -msgid "Convert a non-``multipart`` message into a ``multipart/related`` message, moving any existing :mailheader:`Content-` headers and payload into a (new) first part of the ``multipart``. If *boundary* is specified, use it as the boundary string in the multipart, otherwise leave the boundary to be automatically created when it is needed (for example, when the message is serialized)." -msgstr "" +msgid "" +"Convert a non-``multipart`` message into a ``multipart/related`` message, " +"moving any existing :mailheader:`Content-` headers and payload into a (new) " +"first part of the ``multipart``. If *boundary* is specified, use it as the " +"boundary string in the multipart, otherwise leave the boundary to be " +"automatically created when it is needed (for example, when the message is " +"serialized)." +msgstr "" +"یک پیام غیر ``multipart`` را به یک پیام ``multipart/related`` تبدیل می‌کند و" +" هرگونه سرآیند :mailheader:`Content-` و بار (payload) موجود را به بخش نخست " +"(جدید) از ``multipart`` منتقل می‌کند. اگر *boundary* مشخص شده باشد، از آن " +"به‌عنوان رشته‌ی مرز در multipart استفاده می‌شود؛ در غیر این صورت، مرز " +"به‌صورت خودکار در زمان نیاز ایجاد می‌شود (برای مثال، هنگامی که پیام " +"سریال‌سازی می‌شود)." -msgid "Convert a non-``multipart`` or a ``multipart/related`` into a ``multipart/alternative``, moving any existing :mailheader:`Content-` headers and payload into a (new) first part of the ``multipart``. If *boundary* is specified, use it as the boundary string in the multipart, otherwise leave the boundary to be automatically created when it is needed (for example, when the message is serialized)." -msgstr "" +msgid "" +"Convert a non-``multipart`` or a ``multipart/related`` into a " +"``multipart/alternative``, moving any existing :mailheader:`Content-` " +"headers and payload into a (new) first part of the ``multipart``. If " +"*boundary* is specified, use it as the boundary string in the multipart, " +"otherwise leave the boundary to be automatically created when it is needed " +"(for example, when the message is serialized)." +msgstr "" +"یک پیام غیر ``multipart`` یا یک ``multipart/related`` را به " +"``multipart/alternative`` تبدیل می‌کند و تمام سرآیندهای " +":mailheader:`Content-` و بار (payload) موجود را به اولین بخش (جدید) از " +"``multipart`` منتقل می‌کند. اگر *boundary* مشخص شده باشد، از آن به‌عنوان " +"رشته‌ی مرزی در multipart استفاده می‌کند، در غیر این صورت اجازه می‌دهد مرز " +"به‌صورت خودکار در زمانی که به آن نیاز است (برای مثال، هنگامی که پیام " +"سریال‌سازی می‌شود) ایجاد شود." -msgid "Convert a non-``multipart``, a ``multipart/related``, or a ``multipart-alternative`` into a ``multipart/mixed``, moving any existing :mailheader:`Content-` headers and payload into a (new) first part of the ``multipart``. If *boundary* is specified, use it as the boundary string in the multipart, otherwise leave the boundary to be automatically created when it is needed (for example, when the message is serialized)." -msgstr "" +msgid "" +"Convert a non-``multipart``, a ``multipart/related``, or a ``multipart-" +"alternative`` into a ``multipart/mixed``, moving any existing " +":mailheader:`Content-` headers and payload into a (new) first part of the " +"``multipart``. If *boundary* is specified, use it as the boundary string in" +" the multipart, otherwise leave the boundary to be automatically created " +"when it is needed (for example, when the message is serialized)." +msgstr "" +"یک پیام غیر ``multipart``، یک ``multipart/related``، یا یک ``multipart-" +"alternative`` را به یک ``multipart/mixed`` تبدیل می‌کند و همه‌ی سرآیندهای " +":mailheader:`Content-` و بار (payload) موجود را به نخستین بخش (جدید) از " +"``multipart`` منتقل می‌کند. اگر *boundary* مشخص شده باشد، از آن به‌عنوان " +"رشته‌ی مرز در multipart استفاده می‌شود، در غیر این صورت مرز به‌صورت خودکار در" +" زمان نیاز (برای مثال، هنگامی که پیام سریال‌سازی می‌شود) ایجاد می‌شود." -msgid "If the message is a ``multipart/related``, create a new message object, pass all of the arguments to its :meth:`set_content` method, and :meth:`~email.message.Message.attach` it to the ``multipart``. If the message is a non-``multipart``, call :meth:`make_related` and then proceed as above. If the message is any other type of ``multipart``, raise a :exc:`TypeError`. If *content_manager* is not specified, use the ``content_manager`` specified by the current :mod:`~email.policy`. If the added part has no :mailheader:`Content-Disposition` header, add one with the value ``inline``." -msgstr "" +msgid "" +"If the message is a ``multipart/related``, create a new message object, pass" +" all of the arguments to its :meth:`set_content` method, and " +":meth:`~email.message.Message.attach` it to the ``multipart``. If the " +"message is a non-``multipart``, call :meth:`make_related` and then proceed " +"as above. If the message is any other type of ``multipart``, raise a " +":exc:`TypeError`. If *content_manager* is not specified, use the " +"``content_manager`` specified by the current :mod:`~email.policy`. If the " +"added part has no :mailheader:`Content-Disposition` header, add one with the" +" value ``inline``." +msgstr "" +"اگر پیام یک ``multipart/related`` باشد، یک شیء پیام جدید ایجاد کنید، تمام " +"آرگومان‌ها را به متد :meth:`set_content` آن منتقل کنید و آن را با " +":meth:`~email.message.Message.attach` به ``multipart`` پیوست کنید. اگر پیام " +"غیر ``multipart`` باشد، :meth:`make_related` را فراخوانی کنید و سپس مطابق " +"آنچه گفته شد ادامه دهید. اگر پیام هر نوع دیگری از ``multipart`` باشد، یک " +":exc:`TypeError` پرتاب کنید. اگر *content_manager* مشخص نشده باشد، از " +"``content_manager`` مشخص‌شده توسط :mod:`~email.policy` فعلی استفاده کنید. " +"اگر بخش افزوده‌شده سرآیند :mailheader:`Content-Disposition` نداشته باشد، " +"سرآیندی با مقدار ``inline`` اضافه کنید." -msgid "If the message is a ``multipart/alternative``, create a new message object, pass all of the arguments to its :meth:`set_content` method, and :meth:`~email.message.Message.attach` it to the ``multipart``. If the message is a non-``multipart`` or ``multipart/related``, call :meth:`make_alternative` and then proceed as above. If the message is any other type of ``multipart``, raise a :exc:`TypeError`. If *content_manager* is not specified, use the ``content_manager`` specified by the current :mod:`~email.policy`." -msgstr "" +msgid "" +"If the message is a ``multipart/alternative``, create a new message object, " +"pass all of the arguments to its :meth:`set_content` method, and " +":meth:`~email.message.Message.attach` it to the ``multipart``. If the " +"message is a non-``multipart`` or ``multipart/related``, call " +":meth:`make_alternative` and then proceed as above. If the message is any " +"other type of ``multipart``, raise a :exc:`TypeError`. If *content_manager* " +"is not specified, use the ``content_manager`` specified by the current " +":mod:`~email.policy`." +msgstr "" +"اگر پیام ``multipart/alternative`` باشد، یک شیء پیام جدید ایجاد کنید، همه‌ی " +"آرگومان‌ها را به متد :meth:`set_content` آن ارسال کنید و آن را با " +":meth:`~email.message.Message.attach` به ``multipart`` پیوست کنید. اگر پیام" +" غیر ``multipart`` یا ``multipart/related`` باشد، :meth:`make_alternative` " +"را فراخوانی کنید و سپس مطابق بالا ادامه دهید. اگر پیام هر نوع دیگری از " +"``multipart`` باشد، یک :exc:`TypeError` پرتاب کنید. اگر *content_manager* " +"مشخص نشده باشد، از ``content_manager`` تعیین‌شده توسط :mod:`~email.policy` " +"فعلی استفاده کنید." -msgid "If the message is a ``multipart/mixed``, create a new message object, pass all of the arguments to its :meth:`set_content` method, and :meth:`~email.message.Message.attach` it to the ``multipart``. If the message is a non-``multipart``, ``multipart/related``, or ``multipart/alternative``, call :meth:`make_mixed` and then proceed as above. If *content_manager* is not specified, use the ``content_manager`` specified by the current :mod:`~email.policy`. If the added part has no :mailheader:`Content-Disposition` header, add one with the value ``attachment``. This method can be used both for explicit attachments (:mailheader:`Content-Disposition: attachment`) and ``inline`` attachments (:mailheader:`Content-Disposition: inline`), by passing appropriate options to the ``content_manager``." -msgstr "" +msgid "" +"If the message is a ``multipart/mixed``, create a new message object, pass " +"all of the arguments to its :meth:`set_content` method, and " +":meth:`~email.message.Message.attach` it to the ``multipart``. If the " +"message is a non-``multipart``, ``multipart/related``, or " +"``multipart/alternative``, call :meth:`make_mixed` and then proceed as " +"above. If *content_manager* is not specified, use the ``content_manager`` " +"specified by the current :mod:`~email.policy`. If the added part has no " +":mailheader:`Content-Disposition` header, add one with the value " +"``attachment``. This method can be used both for explicit attachments " +"(:mailheader:`Content-Disposition: attachment`) and ``inline`` attachments " +"(:mailheader:`Content-Disposition: inline`), by passing appropriate options " +"to the ``content_manager``." +msgstr "" +"اگر پیام ``multipart/mixed`` باشد، یک شیء پیام جدید ایجاد کنید، تمام " +"آرگومان‌ها را به متد :meth:`set_content` آن ارسال کنید، و آن را به " +"``multipart`` :meth:`~email.message.Message.attach` کنید. اگر پیام غیر " +"``multipart``، ``multipart/related`` یا ``multipart/alternative`` باشد، " +":meth:`make_mixed` را فراخوانی کنید و سپس مطابق بالا ادامه دهید. اگر " +"*content_manager* مشخص نشده باشد، از ``content_manager`` مشخص‌شده توسط " +":mod:`~email.policy` فعلی استفاده کنید. اگر بخش افزوده‌شده سرآیند " +":mailheader:`Content-Disposition` نداشته باشد، سرآیندی با مقدار " +"``attachment`` اضافه کنید. از این متد می‌توان هم برای پیوست‌های صریح " +"(:mailheader:`Content-Disposition: attachment`) و هم برای پیوست‌های " +"``inline`` (:mailheader:`Content-Disposition: inline`)، با ارسال گزینه‌های " +"مناسب به ``content_manager`` استفاده کرد." msgid "Remove the payload and all of the headers." -msgstr "" +msgstr "بار (payload) و همه‌ی سرآیندها را حذف کنید." -msgid "Remove the payload and all of the :mailheader:`!Content-` headers, leaving all other headers intact and in their original order." +msgid "" +"Remove the payload and all of the :mailheader:`!Content-` headers, leaving " +"all other headers intact and in their original order." msgstr "" +"بار (payload) و تمام سرآیندهای :mailheader:`!Content-` را حذف کنید و تمام" +" سرآیندهای دیگر را دست‌نخورده و با ترتیب اصلی خود باقی بگذارید." msgid ":class:`EmailMessage` objects have the following instance attributes:" -msgstr "" +msgstr "اشیاء :class:`EmailMessage` دارای ویژگی‌های نمونه زیر هستند:" -msgid "The format of a MIME document allows for some text between the blank line following the headers, and the first multipart boundary string. Normally, this text is never visible in a MIME-aware mail reader because it falls outside the standard MIME armor. However, when viewing the raw text of the message, or when viewing the message in a non-MIME aware reader, this text can become visible." -msgstr "" +msgid "" +"The format of a MIME document allows for some text between the blank line " +"following the headers, and the first multipart boundary string. Normally, " +"this text is never visible in a MIME-aware mail reader because it falls " +"outside the standard MIME armor. However, when viewing the raw text of the " +"message, or when viewing the message in a non-MIME aware reader, this text " +"can become visible." +msgstr "" +"قالب یک سند MIME اجازه می‌دهد که مقداری متن بین خط خالی پس از سرآیندها و " +"اولین رشته‌ی مرزی چندبخشی قرار گیرد. معمولاً، این متن در یک خواننده‌ی ایمیل " +"آگاه از MIME هرگز قابل مشاهده نیست، زیرا خارج از پوشش استاندارد MIME قرار " +"می‌گیرد. با این حال، هنگام مشاهده‌ی متن خام پیام، یا هنگام مشاهده‌ی پیام در " +"یک خواننده‌ی غیرآگاه از MIME، این متن می‌تواند قابل مشاهده شود." -msgid "The *preamble* attribute contains this leading extra-armor text for MIME documents. When the :class:`~email.parser.Parser` discovers some text after the headers but before the first boundary string, it assigns this text to the message's *preamble* attribute. When the :class:`~email.generator.Generator` is writing out the plain text representation of a MIME message, and it finds the message has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details." -msgstr "" +msgid "" +"The *preamble* attribute contains this leading extra-armor text for MIME " +"documents. When the :class:`~email.parser.Parser` discovers some text after" +" the headers but before the first boundary string, it assigns this text to " +"the message's *preamble* attribute. When the " +":class:`~email.generator.Generator` is writing out the plain text " +"representation of a MIME message, and it finds the message has a *preamble* " +"attribute, it will write this text in the area between the headers and the " +"first boundary. See :mod:`email.parser` and :mod:`email.generator` for " +"details." +msgstr "" +"ویژگی *preamble* شامل این متن محافظتی اضافی پیشرو برای اسناد MIME است. " +"هنگامی که :class:`~email.parser.Parser` متنی را پس از سرآیندها اما پیش از " +"اولین رشته‌ی مرزی پیدا کند، آن متن را به ویژگی *preamble* پیام اختصاص " +"می‌دهد. هنگامی که :class:`~email.generator.Generator` در حال نوشتن نمایش " +"متنی ساده‌ی یک پیام MIME باشد و ببیند پیام دارای ویژگی *preamble* است، این " +"متن را در ناحیه‌ی بین سرآیندها و اولین مرز می‌نویسد. برای جزئیات، " +":mod:`email.parser` و :mod:`email.generator` را ببینید." -msgid "Note that if the message object has no preamble, the *preamble* attribute will be ``None``." +msgid "" +"Note that if the message object has no preamble, the *preamble* attribute " +"will be ``None``." msgstr "" +"توجه داشته باشید که اگر شیء پیام فاقد پیش‌درآمد (preamble) باشد، ویژگی " +"*preamble* برابر ``None`` خواهد بود." -msgid "The *epilogue* attribute acts the same way as the *preamble* attribute, except that it contains text that appears between the last boundary and the end of the message. As with the :attr:`~EmailMessage.preamble`, if there is no epilog text this attribute will be ``None``." +msgid "" +"The *epilogue* attribute acts the same way as the *preamble* attribute, " +"except that it contains text that appears between the last boundary and the " +"end of the message. As with the :attr:`~EmailMessage.preamble`, if there is" +" no epilog text this attribute will be ``None``." msgstr "" +"ویژگی *epilogue* همانند ویژگی *preamble* عمل می‌کند، با این تفاوت که شامل " +"متنی است که بین آخرین مرز و پایان پیام ظاهر می‌شود. همان‌طور که در مورد " +":attr:`~EmailMessage.preamble` نیز صدق می‌کند، اگر متن پس‌درآمد وجود نداشته " +"باشد، این ویژگی ``None`` خواهد بود." -msgid "The *defects* attribute contains a list of all the problems found when parsing this message. See :mod:`email.errors` for a detailed description of the possible parsing defects." +msgid "" +"The *defects* attribute contains a list of all the problems found when " +"parsing this message. See :mod:`email.errors` for a detailed description of" +" the possible parsing defects." msgstr "" +"ویژگی *defects* شامل فهرستی از تمام مشکلات یافت‌شده هنگام تجزیه این پیام " +"است. برای شرح دقیق نقص‌های ممکن در تجزیه، :mod:`email.errors` را ببینید." -msgid "This class represents a subpart of a MIME message. It is identical to :class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are added when :meth:`~EmailMessage.set_content` is called, since sub-parts do not need their own :mailheader:`MIME-Version` headers." +msgid "" +"This class represents a subpart of a MIME message. It is identical to " +":class:`EmailMessage`, except that no :mailheader:`MIME-Version` headers are" +" added when :meth:`~EmailMessage.set_content` is called, since sub-parts do " +"not need their own :mailheader:`MIME-Version` headers." msgstr "" +"این کلاس نمایانگر یک زیربخش از پیام MIME است. این کلاس با " +":class:`EmailMessage` یکسان است، با این تفاوت که هنگام فراخوانی " +":meth:`~EmailMessage.set_content`، هیچ سرآیند :mailheader:`MIME-Version` " +"اضافه نمی‌شود، زیرا زیربخش‌ها به سرآیندهای :mailheader:`MIME-Version` خود " +"نیاز ندارند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Originally added in 3.4 as a :term:`provisional module `. Docs for legacy message class moved to :ref:`compat32_message`." +msgid "" +"Originally added in 3.4 as a :term:`provisional module `. Docs for legacy message class moved to :ref:`compat32_message`." msgstr "" +"در ابتدا در 3.4 به‌عنوان یک :term:`ماژول موقت (provisional module) " +"` افزوده شد. مستندات کلاس پیام قدیمی به " +":ref:`compat32_message` منتقل شد." -msgid "The :class:`EmailMessage` class requires a policy that provides a ``content_manager`` attribute for content management methods like ``set_content()`` and ``get_content()`` to work. The legacy :const:`~email.policy.compat32` policy does not support these methods and should not be used with :class:`EmailMessage`." -msgstr "" +msgid "" +"The :class:`EmailMessage` class requires a policy that provides a " +"``content_manager`` attribute for content management methods like " +"``set_content()`` and ``get_content()`` to work. The legacy " +":const:`~email.policy.compat32` policy does not support these methods and " +"should not be used with :class:`EmailMessage`." +msgstr "" +"کلاس :class:`EmailMessage` به یک سیاست نیاز دارد که ویژگی " +"``content_manager`` را فراهم کند تا متدهای مدیریت محتوا مانند " +"``set_content()`` و ``get_content()`` کار کنند. سیاست قدیمی " +":const:`~email.policy.compat32` این متدها را پشتیبانی نمی‌کند و نباید با " +":class:`EmailMessage` استفاده شود." diff --git a/library/email.mime.po b/library/email.mime.po index be03bc78e..8fcbc3f3b 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -22,115 +22,384 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.mime`: Creating email and MIME objects from scratch" -msgstr "" +msgstr ":mod:`!email.mime`: ایجاد اشیای ایمیل و MIME از پایه" msgid "**Source code:** :source:`Lib/email/mime/`" -msgstr "" +msgstr ":source:`Lib/email/mime/`" -msgid "This module is part of the legacy (``Compat32``) email API. Its functionality is partially replaced by the :mod:`~email.contentmanager` in the new API, but in certain applications these classes may still be useful, even in non-legacy code." +msgid "" +"This module is part of the legacy (``Compat32``) email API. Its " +"functionality is partially replaced by the :mod:`~email.contentmanager` in " +"the new API, but in certain applications these classes may still be useful, " +"even in non-legacy code." msgstr "" +"این ماژول بخشی از API قدیمی ایمیل (``Compat32``) است. عملکرد آن تا حدی توسط " +":mod:`~email.contentmanager` در API جدید جایگزین شده است، اما در برخی " +"کاربردها ممکن است این کلاس‌ها هنوز مفید باشند، حتی در کد غیرقدیمی." -msgid "Ordinarily, you get a message object structure by passing a file or some text to a parser, which parses the text and returns the root message object. However you can also build a complete message structure from scratch, or even individual :class:`~email.message.Message` objects by hand. In fact, you can also take an existing structure and add new :class:`~email.message.Message` objects, move them around, etc. This makes a very convenient interface for slicing-and-dicing MIME messages." -msgstr "" +msgid "" +"Ordinarily, you get a message object structure by passing a file or some " +"text to a parser, which parses the text and returns the root message object." +" However you can also build a complete message structure from scratch, or " +"even individual :class:`~email.message.Message` objects by hand. In fact, " +"you can also take an existing structure and add new " +":class:`~email.message.Message` objects, move them around, etc. This makes " +"a very convenient interface for slicing-and-dicing MIME messages." +msgstr "" +"به‌طور معمول، شما با ارسال یک فایل یا مقداری متن به یک پارسر، ساختاری از " +"اشیاء پیام را دریافت می‌کنید؛ این پارسر متن را تجزیه می‌کند و شیء پیام " +"ریشه‌ای را بازمی‌گرداند. با این حال، می‌توانید یک ساختار کامل پیام را از صفر" +" بسازید، یا حتی اشیاء منفرد :class:`~email.message.Message` را به‌صورت دستی " +"بسازید. در واقع، می‌توانید یک ساختار موجود را بردارید و اشیاء جدید " +":class:`~email.message.Message` را به آن اضافه کنید، آن‌ها را جابه‌جا کنید و" +" غیره. این امر رابط بسیار مناسبی را برای برش و خرد کردن پیام‌های MIME فراهم " +"می‌کند." -msgid "You can create a new object structure by creating :class:`~email.message.Message` instances, adding attachments and all the appropriate headers manually. For MIME messages though, the :mod:`email` package provides some convenient subclasses to make things easier." +msgid "" +"You can create a new object structure by creating " +":class:`~email.message.Message` instances, adding attachments and all the " +"appropriate headers manually. For MIME messages though, the :mod:`email` " +"package provides some convenient subclasses to make things easier." msgstr "" +"شما می‌توانید با ایجاد نمونه‌های :class:`~email.message.Message`، افزودن " +"پیوست‌ها و همه سرآیندهای مناسب به‌صورت دستی، یک ساختار شیء جدید بسازید. " +"البته برای پیام‌های MIME، بسته :mod:`email` چند زیرکلاس مناسب ارائه می‌دهد " +"تا کارها آسان‌تر شود." msgid "Here are the classes:" -msgstr "" +msgstr "کلاس‌ها به شرح زیر هستند:" msgid "Module: :mod:`email.mime.base`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.base`" -msgid "This is the base class for all the MIME-specific subclasses of :class:`~email.message.Message`. Ordinarily you won't create instances specifically of :class:`MIMEBase`, although you could. :class:`MIMEBase` is provided primarily as a convenient base class for more specific MIME-aware subclasses." -msgstr "" +msgid "" +"This is the base class for all the MIME-specific subclasses of " +":class:`~email.message.Message`. Ordinarily you won't create instances " +"specifically of :class:`MIMEBase`, although you could. :class:`MIMEBase` is" +" provided primarily as a convenient base class for more specific MIME-aware " +"subclasses." +msgstr "" +"این کلاس پایه برای همه زیرکلاس‌های مختص MIMEِ " +":class:`~email.message.Message` است. معمولاً شما نمونه‌هایی را به‌طور خاص از" +" :class:`MIMEBase` ایجاد نمی‌کنید، هرچند می‌توانید این کار را بکنید. " +":class:`MIMEBase` عمدتاً به‌عنوان یک کلاس پایه مناسب برای زیرکلاس‌های " +"خاص‌ترِ آگاه از MIME ارائه شده است." -msgid "*_maintype* is the :mailheader:`Content-Type` major type (e.g. :mimetype:`text` or :mimetype:`image`), and *_subtype* is the :mailheader:`Content-Type` minor type (e.g. :mimetype:`plain` or :mimetype:`gif`). *_params* is a parameter key/value dictionary and is passed directly to :meth:`Message.add_header `." -msgstr "" +msgid "" +"*_maintype* is the :mailheader:`Content-Type` major type (e.g. " +":mimetype:`text` or :mimetype:`image`), and *_subtype* is the " +":mailheader:`Content-Type` minor type (e.g. :mimetype:`plain` or " +":mimetype:`gif`). *_params* is a parameter key/value dictionary and is " +"passed directly to :meth:`Message.add_header " +"`." +msgstr "" +"*_maintype* نوع اصلی :mailheader:`Content-Type` است (برای مثال " +":mimetype:`text` یا :mimetype:`image`)، و *_subtype* نوع فرعی " +":mailheader:`Content-Type` است (برای مثال :mimetype:`plain` یا " +":mimetype:`gif`). *_params* یک دیکشنری کلید/مقدار پارامترها است و مستقیماً " +"به :meth:`Message.add_header ` ارسال " +"می‌شود." -msgid "If *policy* is specified, (defaults to the :class:`compat32 ` policy) it will be passed to :class:`~email.message.Message`." +msgid "" +"If *policy* is specified, (defaults to the :class:`compat32 " +"` policy) it will be passed to " +":class:`~email.message.Message`." msgstr "" +"اگر *policy* مشخص شده باشد، (پیش‌فرض آن سیاست :class:`compat32 " +"` است) به :class:`~email.message.Message` ارسال " +"می‌شود." -msgid "The :class:`MIMEBase` class always adds a :mailheader:`Content-Type` header (based on *_maintype*, *_subtype*, and *_params*), and a :mailheader:`MIME-Version` header (always set to ``1.0``)." +msgid "" +"The :class:`MIMEBase` class always adds a :mailheader:`Content-Type` header " +"(based on *_maintype*, *_subtype*, and *_params*), and a :mailheader:`MIME-" +"Version` header (always set to ``1.0``)." msgstr "" +"کلاس :class:`MIMEBase` همیشه یک سرآیند :mailheader:`Content-Type` (بر اساس " +"*_maintype*، *_subtype* و *_params*) و یک سرآیند :mailheader:`MIME-Version` " +"(که همیشه بر روی ``1.0`` تنظیم شده است) اضافه می‌کند." msgid "Added *policy* keyword-only parameter." -msgstr "" +msgstr "پارامتر فقط کلیدواژه‌ای *policy* اضافه شد." msgid "Module: :mod:`email.mime.nonmultipart`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.nonmultipart`" -msgid "A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate base class for MIME messages that are not :mimetype:`multipart`. The primary purpose of this class is to prevent the use of the :meth:`~email.message.Message.attach` method, which only makes sense for :mimetype:`multipart` messages. If :meth:`~email.message.Message.attach` is called, a :exc:`~email.errors.MultipartConversionError` exception is raised." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate " +"base class for MIME messages that are not :mimetype:`multipart`. The " +"primary purpose of this class is to prevent the use of the " +":meth:`~email.message.Message.attach` method, which only makes sense for " +":mimetype:`multipart` messages. If :meth:`~email.message.Message.attach` is" +" called, a :exc:`~email.errors.MultipartConversionError` exception is " +"raised." +msgstr "" +"این کلاس، زیرکلاسی از :class:`~email.mime.base.MIMEBase` و یک کلاس پایه " +"میانی برای پیام‌های MIME است که :mimetype:`multipart` نیستند. هدف اصلی این " +"کلاس، جلوگیری از استفاده از متد :meth:`~email.message.Message.attach` است که" +" فقط برای پیام‌های :mimetype:`multipart` معنا دارد. اگر " +":meth:`~email.message.Message.attach` فراخوانی شود، استثنای " +":exc:`~email.errors.MultipartConversionError` پرتاب می‌شود." msgid "Module: :mod:`email.mime.multipart`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.multipart`" -msgid "A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate base class for MIME messages that are :mimetype:`multipart`. Optional *_subtype* defaults to :mimetype:`mixed`, but can be used to specify the subtype of the message. A :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be added to the message object. A :mailheader:`MIME-Version` header will also be added." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.base.MIMEBase`, this is an intermediate " +"base class for MIME messages that are :mimetype:`multipart`. Optional " +"*_subtype* defaults to :mimetype:`mixed`, but can be used to specify the " +"subtype of the message. A :mailheader:`Content-Type` header of " +":mimetype:`multipart/_subtype` will be added to the message object. A " +":mailheader:`MIME-Version` header will also be added." +msgstr "" +"این کلاس، زیرکلاسی از :class:`~email.mime.base.MIMEBase` و کلاس پایه‌ای " +"میانی برای پیام‌های MIME از نوع :mimetype:`multipart` است. *_subtype* " +"اختیاری به‌طور پیش‌فرض :mimetype:`mixed` است، اما می‌توان از آن برای مشخص " +"کردن زیرنوع پیام استفاده کرد. یک سرآیند :mailheader:`Content-Type` با " +":mimetype:`multipart/_subtype` به شیء پیام افزوده خواهد شد. سرآیند " +":mailheader:`MIME-Version` نیز افزوده خواهد شد." -msgid "Optional *boundary* is the multipart boundary string. When ``None`` (the default), the boundary is calculated when needed (for example, when the message is serialized)." +msgid "" +"Optional *boundary* is the multipart boundary string. When ``None`` (the " +"default), the boundary is calculated when needed (for example, when the " +"message is serialized)." msgstr "" +"*boundary* اختیاری، رشته‌ی مرز چندبخشی است. هنگامی که ``None`` باشد " +"(پیش‌فرض)، مرز در زمان نیاز محاسبه می‌شود (برای مثال، هنگامی که پیام " +"سریال‌سازی می‌شود)." -msgid "*_subparts* is a sequence of initial subparts for the payload. It must be possible to convert this sequence to a list. You can always attach new subparts to the message by using the :meth:`Message.attach ` method." +msgid "" +"*_subparts* is a sequence of initial subparts for the payload. It must be " +"possible to convert this sequence to a list. You can always attach new " +"subparts to the message by using the :meth:`Message.attach " +"` method." msgstr "" +"*_subparts* دنباله‌ای از زیربخش‌های اولیه برای بار (payload) است. باید " +"بتوان این دنباله را به یک فهرست تبدیل کرد. شما همیشه می‌توانید با استفاده از" +" متد :meth:`Message.attach `، زیربخش‌های جدیدی" +" را به پیام پیوست کنید." -msgid "Optional *policy* argument defaults to :class:`compat32 `." +msgid "" +"Optional *policy* argument defaults to :class:`compat32 " +"`." msgstr "" +"آرگومان اختیاری *policy* به‌طور پیش‌فرض :class:`compat32 " +"` است." -msgid "Additional parameters for the :mailheader:`Content-Type` header are taken from the keyword arguments, or passed into the *_params* argument, which is a keyword dictionary." +msgid "" +"Additional parameters for the :mailheader:`Content-Type` header are taken " +"from the keyword arguments, or passed into the *_params* argument, which is " +"a keyword dictionary." msgstr "" +"پارامترهای اضافی برای سرآیند :mailheader:`Content-Type` از آرگومان‌های " +"کلیدواژه‌ای دریافت می‌شوند، یا به آرگومان *_params* که یک دیکشنری " +"کلیدواژه‌ای است، ارسال می‌شوند." msgid "Module: :mod:`email.mime.application`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.application`" -msgid "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:`MIMEApplication` class is used to represent MIME message objects of major type :mimetype:`application`. *_data* contains the bytes for the raw application data. Optional *_subtype* specifies the MIME subtype and defaults to :mimetype:`octet-stream`." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the " +":class:`MIMEApplication` class is used to represent MIME message objects of " +"major type :mimetype:`application`. *_data* contains the bytes for the raw " +"application data. Optional *_subtype* specifies the MIME subtype and " +"defaults to :mimetype:`octet-stream`." +msgstr "" +"کلاس :class:`MIMEApplication <~email.mime.nonmultipart.MIMENonMultipart>` یک" +" زیرکلاس از :class:`~email.mime.nonmultipart.MIMENonMultipart " +"` است و برای بازنمایی اشیاء پیام MIME از نوع اصلی " +":mimetype:`application` استفاده می‌شود. *_data* حاوی بایت‌های داده‌های خام " +"application است. *_subtype* اختیاری، زیرنوع MIME را مشخص می‌کند و پیش‌فرض آن" +" :mimetype:`octet-stream` است." -msgid "Optional *_encoder* is a callable (i.e. function) which will perform the actual encoding of the data for transport. This callable takes one argument, which is the :class:`MIMEApplication` instance. It should use :meth:`~email.message.Message.get_payload` and :meth:`~email.message.Message.set_payload` to change the payload to encoded form. It should also add any :mailheader:`Content-Transfer-Encoding` or other headers to the message object as necessary. The default encoding is base64. See the :mod:`email.encoders` module for a list of the built-in encoders." -msgstr "" +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the data for transport. This callable takes one " +"argument, which is the :class:`MIMEApplication` instance. It should use " +":meth:`~email.message.Message.get_payload` and " +":meth:`~email.message.Message.set_payload` to change the payload to encoded " +"form. It should also add any :mailheader:`Content-Transfer-Encoding` or " +"other headers to the message object as necessary. The default encoding is " +"base64. See the :mod:`email.encoders` module for a list of the built-in " +"encoders." +msgstr "" +"*_encoder* اختیاری یک قابل فراخوانی (callable)، یعنی یک تابع، است که کدگذاری" +" واقعی داده‌ها برای انتقال را انجام می‌دهد. این قابل فراخوانی یک آرگومان " +"می‌گیرد که یک نمونه از :class:`MIMEApplication` است. این قابل فراخوانی باید " +"از :meth:`~email.message.Message.get_payload` و " +":meth:`~email.message.Message.set_payload` استفاده کند تا بار (payload)" +" را به صورت کدگذاری‌شده تغییر دهد. همچنین باید در صورت لزوم، سرآیند " +":mailheader:`Content-Transfer-Encoding` یا هر سرآیند دیگری را به شیء پیام " +"اضافه کند. کدگذاری پیش‌فرض base64 است. برای مشاهده فهرستی از کدگذارهای " +"توکار، ماژول :mod:`email.encoders` را ببینید." msgid "*_params* are passed straight through to the base class constructor." -msgstr "" +msgstr "*_params* به‌طور مستقیم به سازنده کلاس پایه ارسال می‌شوند." msgid "Module: :mod:`email.mime.audio`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.audio`" -msgid "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:`MIMEAudio` class is used to create MIME message objects of major type :mimetype:`audio`. *_audiodata* contains the bytes for the raw audio data. If this data can be decoded as au, wav, aiff, or aifc, then the subtype will be automatically included in the :mailheader:`Content-Type` header. Otherwise you can explicitly specify the audio subtype via the *_subtype* argument. If the minor type could not be guessed and *_subtype* was not given, then :exc:`TypeError` is raised." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the " +":class:`MIMEAudio` class is used to create MIME message objects of major " +"type :mimetype:`audio`. *_audiodata* contains the bytes for the raw audio " +"data. If this data can be decoded as au, wav, aiff, or aifc, then the " +"subtype will be automatically included in the :mailheader:`Content-Type` " +"header. Otherwise you can explicitly specify the audio subtype via the " +"*_subtype* argument. If the minor type could not be guessed and *_subtype* " +"was not given, then :exc:`TypeError` is raised." +msgstr "" +"کلاس :class:`MIMEAudio <~email.mime.nonmultipart.MIMENonMultipart>`، یک " +"زیرکلاس از :class:`~email.mime.nonmultipart.MIMENonMultipart `، " +"برای ایجاد اشیای پیام MIME از نوع اصلی :mimetype:`audio` استفاده می‌شود. " +"*_audiodata* شامل بایت‌های داده‌ی صوتی خام است. اگر این داده بتواند به‌صورت " +"au، wav، aiff یا aifc کدگشایی شود، آنگاه زیرنوع به‌طور خودکار در سرآیند " +":mailheader:`Content-Type` درج می‌شود. در غیر این صورت می‌توانید زیرنوع " +"صوتی را به‌صراحت از طریق آرگومان *_subtype* مشخص کنید. اگر نوع فرعی قابل حدس" +" زدن نبود و *_subtype* داده نشد، آنگاه :exc:`TypeError` پرتاب می‌شود." -msgid "Optional *_encoder* is a callable (i.e. function) which will perform the actual encoding of the audio data for transport. This callable takes one argument, which is the :class:`MIMEAudio` instance. It should use :meth:`~email.message.Message.get_payload` and :meth:`~email.message.Message.set_payload` to change the payload to encoded form. It should also add any :mailheader:`Content-Transfer-Encoding` or other headers to the message object as necessary. The default encoding is base64. See the :mod:`email.encoders` module for a list of the built-in encoders." -msgstr "" +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the audio data for transport. This callable takes one " +"argument, which is the :class:`MIMEAudio` instance. It should use " +":meth:`~email.message.Message.get_payload` and " +":meth:`~email.message.Message.set_payload` to change the payload to encoded " +"form. It should also add any :mailheader:`Content-Transfer-Encoding` or " +"other headers to the message object as necessary. The default encoding is " +"base64. See the :mod:`email.encoders` module for a list of the built-in " +"encoders." +msgstr "" +"*_encoder* اختیاری یک فراخوان‌پذیر (یعنی تابع) است که کدگذاری واقعی داده‌های" +" صوتی برای انتقال را انجام می‌دهد. این فراخوان‌پذیر یک آرگومان می‌گیرد، که " +"نمونه‌ای از :class:`MIMEAudio` است. باید از " +":meth:`~email.message.Message.get_payload` و " +":meth:`~email.message.Message.set_payload` برای تغییر بار به شکل کدگذاری‌شده" +" استفاده کند. همچنین باید در صورت لزوم، سرصفحه‌ی :mailheader:`Content-" +"Transfer-Encoding` یا سایر سرصفحه‌ها را به شیء پیام اضافه کند. کدگذاری " +"پیش‌فرض، base64 است. برای فهرستی از کدگذارهای توکار، ماژول " +":mod:`email.encoders` را ببینید." msgid "Module: :mod:`email.mime.image`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.image`" -msgid "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:`MIMEImage` class is used to create MIME message objects of major type :mimetype:`image`. *_imagedata* contains the bytes for the raw image data. If this data type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm, rast, xbm, bmp, webp, and exr attempted), then the subtype will be automatically included in the :mailheader:`Content-Type` header. Otherwise you can explicitly specify the image subtype via the *_subtype* argument. If the minor type could not be guessed and *_subtype* was not given, then :exc:`TypeError` is raised." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the " +":class:`MIMEImage` class is used to create MIME message objects of major " +"type :mimetype:`image`. *_imagedata* contains the bytes for the raw image " +"data. If this data type can be detected (jpeg, png, gif, tiff, rgb, pbm, " +"pgm, ppm, rast, xbm, bmp, webp, and exr attempted), then the subtype will be" +" automatically included in the :mailheader:`Content-Type` header. Otherwise " +"you can explicitly specify the image subtype via the *_subtype* argument. If" +" the minor type could not be guessed and *_subtype* was not given, then " +":exc:`TypeError` is raised." +msgstr "" +"کلاس :class:`MIMEImage <~email.mime.nonmultipart.MIMENonMultipart>` یک " +"زیرکلاس از :class:`~email.mime.nonmultipart.MIMENonMultipart ` " +"است و برای ایجاد اشیای پیام MIME با نوع اصلی :mimetype:`image` استفاده " +"می‌شود. *_imagedata* شامل بایت‌های داده‌ی خام تصویر است. اگر این نوع داده " +"قابل تشخیص باشد (jpeg، png، gif، tiff، rgb، pbm، pgm، ppm، rast، xbm، bmp، " +"webp و exr بررسی می‌شوند)، آنگاه زیرنوع به‌طور خودکار در سرآیند " +":mailheader:`Content-Type` گنجانده می‌شود. در غیر این صورت می‌توانید زیرنوع " +"تصویر را به‌صراحت از طریق آرگومان *_subtype* مشخص کنید. اگر نوع فرعی را " +"نتوان حدس زد و *_subtype* داده نشده باشد، آنگاه :exc:`TypeError` پرتاب " +"می‌شود." -msgid "Optional *_encoder* is a callable (i.e. function) which will perform the actual encoding of the image data for transport. This callable takes one argument, which is the :class:`MIMEImage` instance. It should use :meth:`~email.message.Message.get_payload` and :meth:`~email.message.Message.set_payload` to change the payload to encoded form. It should also add any :mailheader:`Content-Transfer-Encoding` or other headers to the message object as necessary. The default encoding is base64. See the :mod:`email.encoders` module for a list of the built-in encoders." -msgstr "" +msgid "" +"Optional *_encoder* is a callable (i.e. function) which will perform the " +"actual encoding of the image data for transport. This callable takes one " +"argument, which is the :class:`MIMEImage` instance. It should use " +":meth:`~email.message.Message.get_payload` and " +":meth:`~email.message.Message.set_payload` to change the payload to encoded " +"form. It should also add any :mailheader:`Content-Transfer-Encoding` or " +"other headers to the message object as necessary. The default encoding is " +"base64. See the :mod:`email.encoders` module for a list of the built-in " +"encoders." +msgstr "" +"*_encoder* اختیاری، یک فراخوان‌پذیر (یعنی تابع) است که کدگذاری واقعی " +"داده‌های تصویر برای انتقال را انجام می‌دهد. این فراخوان‌پذیر یک آرگومان " +"می‌گیرد که نمونه‌ی :class:`MIMEImage` است. باید از " +":meth:`~email.message.Message.get_payload` و " +":meth:`~email.message.Message.set_payload` برای تغییر بار (payload) به‌صورت " +"کدگذاری‌شده استفاده کند. همچنین باید در صورت لزوم، :mailheader:`Content-" +"Transfer-Encoding` یا سایر سرصفحه‌ها را به شیء پیام اضافه کند. کدگذاری " +"پیش‌فرض، base64 است. برای دیدن فهرستی از کدگذارهای توکار، ماژول " +":mod:`email.encoders` را ببینید." -msgid "*_params* are passed straight through to the :class:`~email.mime.base.MIMEBase` constructor." +msgid "" +"*_params* are passed straight through to the " +":class:`~email.mime.base.MIMEBase` constructor." msgstr "" +"*_params* مستقیماً به سازنده‌ی :class:`~email.mime.base.MIMEBase` ارسال " +"می‌شوند." msgid "Module: :mod:`email.mime.message`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.message`" -msgid "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:`MIMEMessage` class is used to create MIME objects of main type :mimetype:`message`. *_msg* is used as the payload, and must be an instance of class :class:`~email.message.Message` (or a subclass thereof), otherwise a :exc:`TypeError` is raised." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the " +":class:`MIMEMessage` class is used to create MIME objects of main type " +":mimetype:`message`. *_msg* is used as the payload, and must be an instance " +"of class :class:`~email.message.Message` (or a subclass thereof), otherwise " +"a :exc:`TypeError` is raised." +msgstr "" +"کلاس :class:`MIMEMessage <~email.mime.nonmultipart.MIMENonMultipart>`، " +"زیرکلاسی از :class:`~email.mime.nonmultipart.MIMENonMultipart " +"`، برای ساخت اشیای MIME از نوع اصلی :mimetype:`message` استفاده" +" می‌شود. از *_msg* به‌عنوان بار (payload) استفاده می‌شود و باید " +"نمونه‌ای از کلاس :class:`~email.message.Message` (یا زیرکلاسی از آن) باشد، " +"در غیر این صورت :exc:`TypeError` پرتاب می‌شود." -msgid "Optional *_subtype* sets the subtype of the message; it defaults to :mimetype:`rfc822`." +msgid "" +"Optional *_subtype* sets the subtype of the message; it defaults to " +":mimetype:`rfc822`." msgstr "" +"*_subtype* اختیاری، زیرنوع پیام را تنظیم می‌کند؛ مقدار پیش‌فرض آن " +":mimetype:`rfc822` است." msgid "Module: :mod:`email.mime.text`" -msgstr "" +msgstr "ماژول: :mod:`email.mime.text`" -msgid "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:`MIMEText` class is used to create MIME objects of major type :mimetype:`text`. *_text* is the string for the payload. *_subtype* is the minor type and defaults to :mimetype:`plain`. *_charset* is the character set of the text and is passed as an argument to the :class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults to ``us-ascii`` if the string contains only ``ascii`` code points, and ``utf-8`` otherwise. The *_charset* parameter accepts either a string or a :class:`~email.charset.Charset` instance." -msgstr "" +msgid "" +"A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the " +":class:`MIMEText` class is used to create MIME objects of major type " +":mimetype:`text`. *_text* is the string for the payload. *_subtype* is the " +"minor type and defaults to :mimetype:`plain`. *_charset* is the character " +"set of the text and is passed as an argument to the " +":class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults " +"to ``us-ascii`` if the string contains only ``ascii`` code points, and " +"``utf-8`` otherwise. The *_charset* parameter accepts either a string or a " +":class:`~email.charset.Charset` instance." +msgstr "" +"کلاس :class:`MIMEText`، زیرکلاسی از " +":class:`~email.mime.nonmultipart.MIMENonMultipart`، برای ایجاد اشیاء MIME از" +" نوع اصلی :mimetype:`text` استفاده می‌شود. *_text* رشته‌ای برای بار " +"(payload) است. *_subtype* نوع فرعی است و پیش‌فرض آن :mimetype:`plain` است. " +"*_charset* مجموعه نویسه‌ی متن است و به‌عنوان آرگومان به سازنده‌ی " +":class:`~email.mime.nonmultipart.MIMENonMultipart` ارسال می‌شود؛ اگر رشته " +"فقط شامل نقاط کد ``ascii`` باشد، پیش‌فرض آن ``us-ascii`` و در غیر این صورت " +"``utf-8`` است. پارامتر *_charset* یک رشته یا یک نمونه از " +":class:`~email.charset.Charset` را می‌پذیرد." -msgid "Unless the *_charset* argument is explicitly set to ``None``, the MIMEText object created will have both a :mailheader:`Content-Type` header with a ``charset`` parameter, and a :mailheader:`Content-Transfer-Encoding` header. This means that a subsequent ``set_payload`` call will not result in an encoded payload, even if a charset is passed in the ``set_payload`` command. You can \"reset\" this behavior by deleting the ``Content-Transfer-Encoding`` header, after which a ``set_payload`` call will automatically encode the new payload (and add a new :mailheader:`Content-Transfer-Encoding` header)." -msgstr "" +msgid "" +"Unless the *_charset* argument is explicitly set to ``None``, the MIMEText " +"object created will have both a :mailheader:`Content-Type` header with a " +"``charset`` parameter, and a :mailheader:`Content-Transfer-Encoding` header." +" This means that a subsequent ``set_payload`` call will not result in an " +"encoded payload, even if a charset is passed in the ``set_payload`` command." +" You can \"reset\" this behavior by deleting the ``Content-Transfer-" +"Encoding`` header, after which a ``set_payload`` call will automatically " +"encode the new payload (and add a new :mailheader:`Content-Transfer-" +"Encoding` header)." +msgstr "" +"مگر اینکه آرگومان *_charset* به‌صراحت روی ``None`` تنظیم شده باشد، شیء " +"MIMEText ایجادشده هم یک سرآیند :mailheader:`Content-Type` با پارامتر " +"``charset`` و هم یک سرآیند :mailheader:`Content-Transfer-Encoding` خواهد " +"داشت. این بدان معناست که فراخوانی بعدی ``set_payload`` به یک باری " +"کدگذاری‌شده منجر نخواهد شد، حتی اگر یک نویسه‌گان در دستور ``set_payload`` " +"داده شود. شما می‌توانید این رفتار را با حذف سرآیند ``Content-Transfer-" +"Encoding`` «بازنشانی» کنید؛ پس از آن، فراخوانی ``set_payload`` به‌طور خودکار" +" باری جدید را کدگذاری می‌کند (و یک سرآیند جدید :mailheader:`Content-" +"Transfer-Encoding` را می‌افزاید)." msgid "*_charset* also accepts :class:`~email.charset.Charset` instances." msgstr "" +"*_charset* همچنین نمونه‌های :class:`~email.charset.Charset` را می‌پذیرد." diff --git a/library/email.parser.po b/library/email.parser.po index 9c9dd91c5..78ccfaae6 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -24,147 +24,482 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.parser`: Parsing email messages" -msgstr "" +msgstr ":mod:`!email.parser`: تجزیه پیام‌های ایمیل" msgid "**Source code:** :source:`Lib/email/parser.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/email/parser.py`" -msgid "Message object structures can be created in one of two ways: they can be created from whole cloth by creating an :class:`~email.message.EmailMessage` object, adding headers using the dictionary interface, and adding payload(s) using :meth:`~email.message.EmailMessage.set_content` and related methods, or they can be created by parsing a serialized representation of the email message." -msgstr "" +msgid "" +"Message object structures can be created in one of two ways: they can be " +"created from whole cloth by creating an :class:`~email.message.EmailMessage`" +" object, adding headers using the dictionary interface, and adding " +"payload(s) using :meth:`~email.message.EmailMessage.set_content` and related" +" methods, or they can be created by parsing a serialized representation of " +"the email message." +msgstr "" +"ساختارهای شیء پیام را می‌توان به یکی از دو روش ایجاد کرد: می‌توان آن‌ها را " +"از پایه با ایجاد یک شیء :class:`~email.message.EmailMessage`، افزودن " +"سرصفحه‌ها با استفاده از رابط دیکشنری، و افزودن بار(ها) (payload) با " +"استفاده از :meth:`~email.message.EmailMessage.set_content` و متدهای مرتبط " +"ایجاد کرد، یا می‌توان آن‌ها را با تجزیه‌ی یک نمایش سریال‌شده از پیام ایمیل " +"ایجاد کرد." -msgid "The :mod:`email` package provides a standard parser that understands most email document structures, including MIME documents. You can pass the parser a bytes, string or file object, and the parser will return to you the root :class:`~email.message.EmailMessage` instance of the object structure. For simple, non-MIME messages the payload of this root object will likely be a string containing the text of the message. For MIME messages, the root object will return ``True`` from its :meth:`~email.message.EmailMessage.is_multipart` method, and the subparts can be accessed via the payload manipulation methods, such as :meth:`~email.message.EmailMessage.get_body`, :meth:`~email.message.EmailMessage.iter_parts`, and :meth:`~email.message.EmailMessage.walk`." -msgstr "" +msgid "" +"The :mod:`email` package provides a standard parser that understands most " +"email document structures, including MIME documents. You can pass the " +"parser a bytes, string or file object, and the parser will return to you the" +" root :class:`~email.message.EmailMessage` instance of the object structure." +" For simple, non-MIME messages the payload of this root object will likely " +"be a string containing the text of the message. For MIME messages, the root" +" object will return ``True`` from its " +":meth:`~email.message.EmailMessage.is_multipart` method, and the subparts " +"can be accessed via the payload manipulation methods, such as " +":meth:`~email.message.EmailMessage.get_body`, " +":meth:`~email.message.EmailMessage.iter_parts`, and " +":meth:`~email.message.EmailMessage.walk`." +msgstr "" +"بسته‌ی :mod:`email` یک پارسر استاندارد ارائه می‌کند که بیشتر ساختارهای اسناد" +" ایمیل، از جمله اسناد MIME را درک می‌کند. شما می‌توانید یک شیء بایتی، رشته " +"یا فایل را به پارسر بدهید و پارسر نمونه‌ی ریشه‌ی " +":class:`~email.message.EmailMessage` از ساختار شیء را به شما بازمی‌گرداند. " +"برای پیام‌های ساده و غیر MIME، بار این شیء ریشه به احتمال زیاد یک رشته " +"حاوی متن پیام خواهد بود. برای پیام‌های MIME، شیء ریشه از متد " +":meth:`~email.message.EmailMessage.is_multipart` خود مقدار ``True`` را " +"بازمی‌گرداند و می‌توان به زیربخش‌ها از طریق متدهای دستکاری بار، مانند " +":meth:`~email.message.EmailMessage.get_body`، " +":meth:`~email.message.EmailMessage.iter_parts` و " +":meth:`~email.message.EmailMessage.walk` دسترسی یافت." -msgid "There are actually two parser interfaces available for use, the :class:`Parser` API and the incremental :class:`FeedParser` API. The :class:`Parser` API is most useful if you have the entire text of the message in memory, or if the entire message lives in a file on the file system. :class:`FeedParser` is more appropriate when you are reading the message from a stream which might block waiting for more input (such as reading an email message from a socket). The :class:`FeedParser` can consume and parse the message incrementally, and only returns the root object when you close the parser." -msgstr "" +msgid "" +"There are actually two parser interfaces available for use, the " +":class:`Parser` API and the incremental :class:`FeedParser` API. The " +":class:`Parser` API is most useful if you have the entire text of the " +"message in memory, or if the entire message lives in a file on the file " +"system. :class:`FeedParser` is more appropriate when you are reading the " +"message from a stream which might block waiting for more input (such as " +"reading an email message from a socket). The :class:`FeedParser` can " +"consume and parse the message incrementally, and only returns the root " +"object when you close the parser." +msgstr "" +"در واقع دو رابط پارسر برای استفاده در دسترس هستند: API :class:`Parser` و " +"API افزایشی :class:`FeedParser`. API :class:`Parser` زمانی بیشترین کاربرد را" +" دارد که کل متن پیام را در حافظه داشته باشید، یا اینکه کل پیام در فایلی روی " +"سیستم فایل قرار داشته باشد. :class:`FeedParser` زمانی مناسب‌تر است که پیام " +"را از جریانی می‌خوانید که ممکن است در انتظار ورودی بیشتر مسدود شود (مانند " +"خواندن یک پیام ایمیل از یک سوکت). :class:`FeedParser` می‌تواند پیام را " +"به‌صورت افزایشی مصرف و تجزیه کند، و تنها زمانی که پارسر را ببندید، شیء " +"ریشه را برمی‌گرداند." -msgid "Note that the parser can be extended in limited ways, and of course you can implement your own parser completely from scratch. All of the logic that connects the :mod:`email` package's bundled parser and the :class:`~email.message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` class, so a custom parser can create message object trees any way it finds necessary by implementing custom versions of the appropriate :class:`!Policy` methods." -msgstr "" +msgid "" +"Note that the parser can be extended in limited ways, and of course you can " +"implement your own parser completely from scratch. All of the logic that " +"connects the :mod:`email` package's bundled parser and the " +":class:`~email.message.EmailMessage` class is embodied in the " +":class:`~email.policy.Policy` class, so a custom parser can create message " +"object trees any way it finds necessary by implementing custom versions of " +"the appropriate :class:`!Policy` methods." +msgstr "" +"توجه داشته باشید که پارسر را می‌توان به روش‌های محدودی گسترش داد و " +"البته می‌توانید پارسرٔ خودتان را کاملاً از صفر پیاده‌سازی کنید. تمام " +"منطقی که پارسرٔ همراه با بسته‌ی :mod:`email` و کلاس " +":class:`~email.message.EmailMessage` را به هم متصل می‌کند، در کلاس " +":class:`~email.policy.Policy` نهفته است، بنابراین یک پارسرٔ سفارشی " +"می‌تواند با پیاده‌سازی نسخه‌های سفارشی متدهای مناسب :class:`!Policy`، " +"درخت‌های شیء پیام را به هر روشی که لازم بداند ایجاد کند." msgid "FeedParser API" -msgstr "" +msgstr "API مربوط به FeedParser" -msgid "The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module, provides an API that is conducive to incremental parsing of email messages, such as would be necessary when reading the text of an email message from a source that can block (such as a socket). The :class:`BytesFeedParser` can of course be used to parse an email message fully contained in a :term:`bytes-like object`, string, or file, but the :class:`BytesParser` API may be more convenient for such use cases. The semantics and results of the two parser APIs are identical." -msgstr "" +msgid "" +"The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` " +"module, provides an API that is conducive to incremental parsing of email " +"messages, such as would be necessary when reading the text of an email " +"message from a source that can block (such as a socket). The " +":class:`BytesFeedParser` can of course be used to parse an email message " +"fully contained in a :term:`bytes-like object`, string, or file, but the " +":class:`BytesParser` API may be more convenient for such use cases. The " +"semantics and results of the two parser APIs are identical." +msgstr "" +":class:`BytesFeedParser`، که از ماژول :mod:`email.feedparser` ایمپورت " +"می‌شود، یک API فراهم می‌کند که برای تجزیه تدریجی پیام‌های ایمیل مناسب است، " +"مانند حالتی که لازم باشد متن یک پیام ایمیل از منبعی که ممکن است مسدودکننده " +"باشد (مانند سوکت) خوانده شود. البته می‌توان از :class:`BytesFeedParser` برای" +" تجزیه پیام ایمیلی که به‌طور کامل در یک :term:`bytes-like object`، رشته یا " +"فایل قرار دارد استفاده کرد، اما ممکن است API :class:`BytesParser` برای چنین " +"موارد استفاده‌ای مناسب‌تر باشد. معناشناسی و نتایج این دو API پارسر یکسان " +"است." -msgid "The :class:`BytesFeedParser`'s API is simple; you create an instance, feed it a bunch of bytes until there's no more to feed it, then close the parser to retrieve the root message object. The :class:`BytesFeedParser` is extremely accurate when parsing standards-compliant messages, and it does a very good job of parsing non-compliant messages, providing information about how a message was deemed broken. It will populate a message object's :attr:`~email.message.EmailMessage.defects` attribute with a list of any problems it found in a message. See the :mod:`email.errors` module for the list of defects that it can find." -msgstr "" +msgid "" +"The :class:`BytesFeedParser`'s API is simple; you create an instance, feed " +"it a bunch of bytes until there's no more to feed it, then close the parser " +"to retrieve the root message object. The :class:`BytesFeedParser` is " +"extremely accurate when parsing standards-compliant messages, and it does a " +"very good job of parsing non-compliant messages, providing information about" +" how a message was deemed broken. It will populate a message object's " +":attr:`~email.message.EmailMessage.defects` attribute with a list of any " +"problems it found in a message. See the :mod:`email.errors` module for the " +"list of defects that it can find." +msgstr "" +"API مربوط به :class:`BytesFeedParser` ساده است؛ شما یک نمونه ایجاد می‌کنید، " +"تعدادی بایت به آن می‌دهید تا زمانی که دیگر بایتی برای دادن به آن باقی نمانده" +" باشد، سپس پارسر را می‌بندید تا شیء پیام ریشه را دریافت کنید. " +":class:`BytesFeedParser` هنگام تجزیه‌ی پیام‌های مطابق با استاندارد بسیار " +"دقیق است و در تجزیه‌ی پیام‌های غیرمطابق با استاندارد نیز بسیار خوب عمل " +"می‌کند و اطلاعاتی درباره‌ی چگونگی معیوب تشخیص داده شدن یک پیام ارائه می‌دهد. " +"این پارسر ویژگی :attr:`~email.message.EmailMessage.defects` یک شیء پیام " +"را با فهرستی از هرگونه مشکلی که در یک پیام پیدا کرده است، پر می‌کند. برای " +"فهرست نقص‌هایی که می‌تواند پیدا کند، ماژول :mod:`email.errors` را ببینید." msgid "Here is the API for the :class:`BytesFeedParser`:" -msgstr "" +msgstr "در اینجا API مربوط به :class:`BytesFeedParser` آمده است:" -msgid "Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-argument callable; if not specified use the :attr:`~email.policy.Policy.message_factory` from the *policy*. Call *_factory* whenever a new message object is needed." +msgid "" +"Create a :class:`BytesFeedParser` instance. Optional *_factory* is a no-" +"argument callable; if not specified use the " +":attr:`~email.policy.Policy.message_factory` from the *policy*. Call " +"*_factory* whenever a new message object is needed." msgstr "" +"نمونه‌ای از :class:`BytesFeedParser` ایجاد کنید. *_factory* اختیاری، یک شیء " +"قابل فراخوانی (callable) بدون آرگومان است؛ اگر مشخص نشده باشد، از " +":attr:`~email.policy.Policy.message_factory` از *policy* استفاده می‌شود. " +"هرگاه به یک شیء پیام جدید نیاز باشد، *_factory* فراخوانی می‌شود." -msgid "If *policy* is specified use the rules it specifies to update the representation of the message. If *policy* is not set, use the :class:`compat32 ` policy, which maintains backward compatibility with the Python 3.2 version of the email package and provides :class:`~email.message.Message` as the default factory. All other policies provide :class:`~email.message.EmailMessage` as the default *_factory*. For more information on what else *policy* controls, see the :mod:`~email.policy` documentation." -msgstr "" +msgid "" +"If *policy* is specified use the rules it specifies to update the " +"representation of the message. If *policy* is not set, use the " +":class:`compat32 ` policy, which maintains backward " +"compatibility with the Python 3.2 version of the email package and provides " +":class:`~email.message.Message` as the default factory. All other policies " +"provide :class:`~email.message.EmailMessage` as the default *_factory*. For " +"more information on what else *policy* controls, see the " +":mod:`~email.policy` documentation." +msgstr "" +"اگر *policy* مشخص شده باشد، برای به‌روزرسانی بازنمایی پیام از قواعدی که مشخص" +" می‌کند استفاده می‌شود. اگر *policy* تنظیم نشده باشد، از سیاست " +":class:`compat32 ` استفاده می‌شود، که سازگاری با " +"نسخه‌ی Python 3.2 بسته‌ی email را حفظ می‌کند و :class:`~email.message.Message`" +" را به‌عنوان کارخانه‌ی پیش‌فرض فراهم می‌کند. تمام سیاست‌های دیگر " +":class:`~email.message.EmailMessage` را به‌عنوان *_factory* پیش‌فرض فراهم " +"می‌کنند. برای اطلاعات بیشتر درباره‌ی سایر مواردی که *policy* کنترل می‌کند، به" +" مستندات :mod:`~email.policy` مراجعه کنید." -msgid "Note: **The policy keyword should always be specified**; The default will change to :data:`email.policy.default` in a future version of Python." +msgid "" +"Note: **The policy keyword should always be specified**; The default will " +"change to :data:`email.policy.default` in a future version of Python." msgstr "" +"توجه: **کلیدواژه‌ی policy همیشه باید تعیین شود**؛ مقدار پیش‌فرض در نسخه‌ی " +"آینده‌ی پایتون به :data:`email.policy.default` تغییر خواهد کرد." msgid "Added the *policy* keyword." -msgstr "" +msgstr "کلیدواژه‌ی *policy* افزوده شد." msgid "*_factory* defaults to the policy ``message_factory``." -msgstr "" +msgstr "*_factory* به‌صورت پیش‌فرض برابر با ``message_factory``\\ سیاست است." -msgid "Feed the parser some more data. *data* should be a :term:`bytes-like object` containing one or more lines. The lines can be partial and the parser will stitch such partial lines together properly. The lines can have any of the three common line endings: carriage return, newline, or carriage return and newline (they can even be mixed)." -msgstr "" +msgid "" +"Feed the parser some more data. *data* should be a :term:`bytes-like " +"object` containing one or more lines. The lines can be partial and the " +"parser will stitch such partial lines together properly. The lines can have" +" any of the three common line endings: carriage return, newline, or carriage" +" return and newline (they can even be mixed)." +msgstr "" +"داده‌های بیشتری به پارسر بدهید. *data* باید یک :term:`bytes-like " +"object` حاوی یک یا چند خط باشد. خطوط می‌توانند ناقص باشند و پارسر چنین" +" خطوط ناقصی را به‌درستی به یکدیگر متصل خواهد کرد. خطوط می‌توانند دارای هر یک" +" از سه پایان‌خط رایج باشند: بازگشت به ابتدای سطر، خط جدید، یا بازگشت به ابتدای سطر و خط جدید " +"(حتی می‌توانند به‌صورت ترکیبی باشند)." -msgid "Complete the parsing of all previously fed data and return the root message object. It is undefined what happens if :meth:`~feed` is called after this method has been called." +msgid "" +"Complete the parsing of all previously fed data and return the root message " +"object. It is undefined what happens if :meth:`~feed` is called after this " +"method has been called." msgstr "" +"تجزیه‌ی تمام داده‌های پیش‌تر خورانده‌شده را کامل می‌کند و شیء پیام ریشه را " +"برمی‌گرداند. اینکه اگر پس از فراخوانی این متد، :meth:`~feed` فراخوانی شود چه" +" اتفاقی می‌افتد، تعریف‌نشده است." -msgid "Works like :class:`BytesFeedParser` except that the input to the :meth:`~BytesFeedParser.feed` method must be a string. This is of limited utility, since the only way for such a message to be valid is for it to contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, no binary attachments." -msgstr "" +msgid "" +"Works like :class:`BytesFeedParser` except that the input to the " +":meth:`~BytesFeedParser.feed` method must be a string. This is of limited " +"utility, since the only way for such a message to be valid is for it to " +"contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is " +"``True``, no binary attachments." +msgstr "" +"مانند :class:`BytesFeedParser` عمل می‌کند، به‌جز اینکه ورودی متد " +":meth:`~BytesFeedParser.feed` باید یک رشته باشد. این کاربرد محدودی دارد، " +"زیرا تنها راه برای معتبر بودن چنین پیامی این است که فقط شامل متن ASCII باشد " +"یا، اگر :attr:`~email.policy.EmailPolicy.utf8` برابر ``True`` باشد، هیچ " +"پیوست دودویی‌ای نداشته باشد." msgid "Parser API" -msgstr "" +msgstr "API پارسر" -msgid "The :class:`BytesParser` class, imported from the :mod:`!email.parser` module, provides an API that can be used to parse a message when the complete contents of the message are available in a :term:`bytes-like object` or file. The :mod:`!email.parser` module also provides :class:`Parser` for parsing strings, and header-only parsers, :class:`BytesHeaderParser` and :class:`HeaderParser`, which can be used if you're only interested in the headers of the message. :class:`BytesHeaderParser` and :class:`HeaderParser` can be much faster in these situations, since they do not attempt to parse the message body, instead setting the payload to the raw body." -msgstr "" +msgid "" +"The :class:`BytesParser` class, imported from the :mod:`!email.parser` " +"module, provides an API that can be used to parse a message when the " +"complete contents of the message are available in a :term:`bytes-like " +"object` or file. The :mod:`!email.parser` module also provides " +":class:`Parser` for parsing strings, and header-only parsers, " +":class:`BytesHeaderParser` and :class:`HeaderParser`, which can be used if " +"you're only interested in the headers of the message. " +":class:`BytesHeaderParser` and :class:`HeaderParser` can be much faster in " +"these situations, since they do not attempt to parse the message body, " +"instead setting the payload to the raw body." +msgstr "" +"کلاس :class:`BytesParser`، که از ماژول :mod:`!email.parser` ایمپورت می‌شود، " +"یک API فراهم می‌کند که می‌توان از آن برای تجزیه‌ی یک پیام استفاده کرد، " +"هنگامی که محتوای کامل پیام در یک :term:`bytes-like object` یا فایل در دسترس " +"باشد. ماژول :mod:`!email.parser` همچنین :class:`Parser` را برای تجزیه‌ی " +"رشته‌ها، و نیز پارسرهای فقط سرآیند، :class:`BytesHeaderParser` و " +":class:`HeaderParser`، فراهم می‌کند؛ از این پارسرها می‌توان در صورتی " +"استفاده کرد که فقط به سرآیندهای پیام علاقه‌مند باشید. " +":class:`BytesHeaderParser` و :class:`HeaderParser` می‌توانند در این شرایط " +"بسیار سریع‌تر باشند، زیرا تلاش نمی‌کنند بدنه پیام را تجزیه کنند، بلکه در عوض" +" بار (payload) را به بدنه خام تنظیم می‌کنند." -msgid "Create a :class:`BytesParser` instance. The *_class* and *policy* arguments have the same meaning and semantics as the *_factory* and *policy* arguments of :class:`BytesFeedParser`." +msgid "" +"Create a :class:`BytesParser` instance. The *_class* and *policy* arguments" +" have the same meaning and semantics as the *_factory* and *policy* " +"arguments of :class:`BytesFeedParser`." msgstr "" +"یک نمونه از :class:`BytesParser` ایجاد کنید. آرگومان‌های *_class* و *policy*" +" همان معنا و معناشناسی آرگومان‌های *_factory* و *policy* در " +":class:`BytesFeedParser` را دارند." -msgid "Removed the *strict* argument that was deprecated in 2.4. Added the *policy* keyword." +msgid "" +"Removed the *strict* argument that was deprecated in 2.4. Added the " +"*policy* keyword." msgstr "" +"آرگومان *strict* که در 2.4 منسوخ شده بود، حذف شد. کلیدواژه‌ی *policy* افزوده " +"شد." msgid "*_class* defaults to the policy ``message_factory``." -msgstr "" +msgstr "*_class* به‌طور پیش‌فرض برابر با سیاست ``message_factory`` است." -msgid "Read all the data from the binary file-like object *fp*, parse the resulting bytes, and return the message object. *fp* must support both the :meth:`~io.IOBase.readline` and the :meth:`~io.BufferedIOBase.read` methods." +msgid "" +"Read all the data from the binary file-like object *fp*, parse the resulting" +" bytes, and return the message object. *fp* must support both the " +":meth:`~io.IOBase.readline` and the :meth:`~io.BufferedIOBase.read` methods." msgstr "" +"تمام داده‌ها را از شیء فایل‌مانند دودویی *fp* می‌خواند، بایت‌های حاصل را " +"تجزیه می‌کند و شیء پیام را برمی‌گرداند. *fp* باید از هر دو متد " +":meth:`~io.IOBase.readline` و :meth:`~io.BufferedIOBase.read` پشتیبانی کند." -msgid "The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) style headers and header continuation lines, optionally preceded by an envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of the message (which may contain MIME-encoded subparts, including subparts with a :mailheader:`Content-Transfer-Encoding` of ``8bit``)." -msgstr "" +msgid "" +"The bytes contained in *fp* must be formatted as a block of :rfc:`5322` (or," +" if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) style " +"headers and header continuation lines, optionally preceded by an envelope " +"header. The header block is terminated either by the end of the data or by " +"a blank line. Following the header block is the body of the message (which " +"may contain MIME-encoded subparts, including subparts with a " +":mailheader:`Content-Transfer-Encoding` of ``8bit``)." +msgstr "" +"بایت‌های موجود در *fp* باید به‌صورت بلوکی از سرصفحه‌ها و خطوط ادامه‌ی سرصفحه " +"به سبک :rfc:`5322` (یا اگر :attr:`~email.policy.EmailPolicy.utf8` برابر " +"``True`` باشد، :rfc:`6532`) قالب‌بندی شده باشند؛ به‌صورت اختیاری ممکن است یک" +" سرصفحه‌ی پاکت (envelope header) پیش از آن‌ها بیاید. بلوک سرصفحه یا با پایان " +"داده‌ها یا با یک خط خالی پایان می‌یابد. پس از بلوک سرصفحه، بدنه‌ی پیام قرار " +"دارد (که ممکن است شامل زیربخش‌های کدگذاری‌شده با MIME باشد، از جمله " +"زیربخش‌هایی که :mailheader:`Content-Transfer-Encoding` آن‌ها ``8bit`` است)." -msgid "Optional *headersonly* is a flag specifying whether to stop parsing after reading the headers or not. The default is ``False``, meaning it parses the entire contents of the file." +msgid "" +"Optional *headersonly* is a flag specifying whether to stop parsing after " +"reading the headers or not. The default is ``False``, meaning it parses the" +" entire contents of the file." msgstr "" +"*headersonly* اختیاری، پرچمی است که مشخص می‌کند آیا پس از خواندن سرآیندها " +"تجزیه متوقف شود یا خیر. مقدار پیش‌فرض ``False`` است، به این معنا که کل " +"محتویات فایل تجزیه می‌شود." -msgid "Similar to the :meth:`parse` method, except it takes a :term:`bytes-like object` instead of a file-like object. Calling this method on a :term:`bytes-like object` is equivalent to wrapping *bytes* in a :class:`~io.BytesIO` instance first and calling :meth:`parse`." +msgid "" +"Similar to the :meth:`parse` method, except it takes a :term:`bytes-like " +"object` instead of a file-like object. Calling this method on a " +":term:`bytes-like object` is equivalent to wrapping *bytes* in a " +":class:`~io.BytesIO` instance first and calling :meth:`parse`." msgstr "" +"مانند متد :meth:`parse` است، با این تفاوت که به‌جای یک شیء شبه‌فایل، یک " +":term:`bytes-like object` دریافت می‌کند. فراخوانی این متد بر روی یک " +":term:`bytes-like object` معادل آن است که ابتدا *bytes* را در یک نمونه از " +":class:`~io.BytesIO` قرار دهید و سپس :meth:`parse` را فراخوانی کنید." msgid "Optional *headersonly* is as with the :meth:`parse` method." -msgstr "" +msgstr "آرگومان اختیاری *headersonly* مانند متد :meth:`parse` است." -msgid "Exactly like :class:`BytesParser`, except that *headersonly* defaults to ``True``." +msgid "" +"Exactly like :class:`BytesParser`, except that *headersonly* defaults to " +"``True``." msgstr "" +"دقیقاً مانند :class:`BytesParser`، با این تفاوت که *headersonly* به‌طور " +"پیش‌فرض ``True`` است." -msgid "This class is parallel to :class:`BytesParser`, but handles string input." +msgid "" +"This class is parallel to :class:`BytesParser`, but handles string input." msgstr "" +"این کلاس مشابه :class:`BytesParser` است، اما ورودی رشته‌ای را پردازش می‌کند." msgid "Removed the *strict* argument. Added the *policy* keyword." -msgstr "" +msgstr "آرگومان *strict* حذف شد. کلیدواژه *policy* افزوده شد." -msgid "Read all the data from the text-mode file-like object *fp*, parse the resulting text, and return the root message object. *fp* must support both the :meth:`~io.TextIOBase.readline` and the :meth:`~io.TextIOBase.read` methods on file-like objects." +msgid "" +"Read all the data from the text-mode file-like object *fp*, parse the " +"resulting text, and return the root message object. *fp* must support both " +"the :meth:`~io.TextIOBase.readline` and the :meth:`~io.TextIOBase.read` " +"methods on file-like objects." msgstr "" +"تمام داده‌ها را از شیء فایل‌مانند در حالت متنی *fp* می‌خواند، متن حاصل را " +"تجزیه می‌کند و شیء پیام ریشه را برمی‌گرداند. *fp* باید از هر دو متد " +":meth:`~io.TextIOBase.readline` و :meth:`~io.TextIOBase.read` در اشیاء " +"فایل‌مانند پشتیبانی کند." -msgid "Other than the text mode requirement, this method operates like :meth:`BytesParser.parse`." +msgid "" +"Other than the text mode requirement, this method operates like " +":meth:`BytesParser.parse`." msgstr "" +"غیر از الزام حالت متنی، این متد مانند :meth:`BytesParser.parse` عمل می‌کند." -msgid "Similar to the :meth:`parse` method, except it takes a string object instead of a file-like object. Calling this method on a string is equivalent to wrapping *text* in a :class:`~io.StringIO` instance first and calling :meth:`parse`." +msgid "" +"Similar to the :meth:`parse` method, except it takes a string object instead" +" of a file-like object. Calling this method on a string is equivalent to " +"wrapping *text* in a :class:`~io.StringIO` instance first and calling " +":meth:`parse`." msgstr "" +"مشابه متد :meth:`parse`، با این تفاوت که به‌جای یک شیء شبه‌فایل ،" +" یک شیء رشته دریافت می‌کند. فراخوانی این متد روی یک رشته، معادل آن است که " +"ابتدا *text* را درون یک نمونه از :class:`~io.StringIO` قرار دهید و سپس " +":meth:`parse` را فراخوانی کنید." -msgid "Exactly like :class:`Parser`, except that *headersonly* defaults to ``True``." +msgid "" +"Exactly like :class:`Parser`, except that *headersonly* defaults to " +"``True``." msgstr "" +"دقیقاً مانند :class:`Parser`، با این تفاوت که *headersonly* به‌طور پیش‌فرض " +"``True`` است." -msgid "Since creating a message object structure from a string or a file object is such a common task, four functions are provided as a convenience. They are available in the top-level :mod:`email` package namespace." +msgid "" +"Since creating a message object structure from a string or a file object is " +"such a common task, four functions are provided as a convenience. They are " +"available in the top-level :mod:`email` package namespace." msgstr "" +"از آنجا که ایجاد ساختار شیء پیام از یک رشته یا شیء فایل کاری بسیار رایج است،" +" چهار تابع برای سهولت ارائه شده‌اند. این توابع در فضای نام سطح بالای بسته‌ی " +":mod:`email` در دسترس هستند." -msgid "Return a message object structure from a :term:`bytes-like object`. This is equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and *policy* are interpreted as with the :class:`~email.parser.BytesParser` class constructor." +msgid "" +"Return a message object structure from a :term:`bytes-like object`. This is" +" equivalent to ``BytesParser().parsebytes(s)``. Optional *_class* and " +"*policy* are interpreted as with the :class:`~email.parser.BytesParser` " +"class constructor." msgstr "" +"ساختار شیء پیام را از یک شیء شبه‌بایت (:term:`bytes-like object`) " +"برمی‌گرداند. این معادل ``BytesParser().parsebytes(s)`` است. آرگومان‌های " +"اختیاری *_class* و *policy* همان‌گونه تفسیر می‌شوند که در سازنده کلاس " +":class:`~email.parser.BytesParser` تفسیر می‌شوند." -msgid "Return a message object structure tree from an open binary :term:`file object`. This is equivalent to ``BytesParser().parse(fp)``. *_class* and *policy* are interpreted as with the :class:`~email.parser.BytesParser` class constructor." +msgid "" +"Return a message object structure tree from an open binary :term:`file " +"object`. This is equivalent to ``BytesParser().parse(fp)``. *_class* and " +"*policy* are interpreted as with the :class:`~email.parser.BytesParser` " +"class constructor." msgstr "" +"یک درخت ساختار شیء پیام را از یک :term:`file object` دودویی باز برمی‌گرداند." +" این معادل ``BytesParser().parse(fp)`` است. *_class* و *policy* همانند " +"سازنده کلاس :class:`~email.parser.BytesParser` تفسیر می‌شوند." -msgid "Return a message object structure from a string. This is equivalent to ``Parser().parsestr(s)``. *_class* and *policy* are interpreted as with the :class:`~email.parser.Parser` class constructor." +msgid "" +"Return a message object structure from a string. This is equivalent to " +"``Parser().parsestr(s)``. *_class* and *policy* are interpreted as with the" +" :class:`~email.parser.Parser` class constructor." msgstr "" +"یک ساختار شیء پیام را از یک رشته برمی‌گرداند. این معادل " +"``Parser().parsestr(s)`` است. *_class* و *policy* همان‌گونه تفسیر می‌شوند که" +" در سازنده‌ی کلاس :class:`~email.parser.Parser` تفسیر می‌شوند." -msgid "Return a message object structure tree from an open :term:`file object`. This is equivalent to ``Parser().parse(fp)``. *_class* and *policy* are interpreted as with the :class:`~email.parser.Parser` class constructor." +msgid "" +"Return a message object structure tree from an open :term:`file object`. " +"This is equivalent to ``Parser().parse(fp)``. *_class* and *policy* are " +"interpreted as with the :class:`~email.parser.Parser` class constructor." msgstr "" +"یک درخت ساختار شیء پیام را از یک :term:`file object` باز برمی‌گرداند. این " +"معادل ``Parser().parse(fp)`` است. *_class* و *policy* همانند سازنده کلاس " +":class:`~email.parser.Parser` تفسیر می‌شوند." -msgid "Here's an example of how you might use :func:`message_from_bytes` at an interactive Python prompt::" +msgid "" +"Here's an example of how you might use :func:`message_from_bytes` at an " +"interactive Python prompt::" msgstr "" +"در اینجا نمونه‌ای از چگونگی استفاده از :func:`message_from_bytes` در یک خط " +"فرمان تعاملی پایتون آورده شده است::" msgid "" ">>> import email\n" ">>> msg = email.message_from_bytes(myBytes)" msgstr "" +">>> import email\n" +">>> msg = email.message_from_bytes(myBytes)" msgid "Additional notes" -msgstr "" +msgstr "نکات تکمیلی" msgid "Here are some notes on the parsing semantics:" -msgstr "" +msgstr "در اینجا چند نکته درباره‌ی معناشناسی تجزیه آمده است:" -msgid "Most non-\\ :mimetype:`multipart` type messages are parsed as a single message object with a string payload. These objects will return ``False`` for :meth:`~email.message.EmailMessage.is_multipart`, and :meth:`~email.message.EmailMessage.iter_parts` will yield an empty list." +msgid "" +"Most non-\\ :mimetype:`multipart` type messages are parsed as a single " +"message object with a string payload. These objects will return ``False`` " +"for :meth:`~email.message.EmailMessage.is_multipart`, and " +":meth:`~email.message.EmailMessage.iter_parts` will yield an empty list." msgstr "" +"بیشتر پیام‌هایی که نوع آن‌ها غیر :mimetype:`multipart` است، به‌عنوان یک شیء " +"پیام واحد با بار (payload) رشته‌ای تجزیه می‌شوند. این شیء‌ها برای " +":meth:`~email.message.EmailMessage.is_multipart` مقدار ``False`` را " +"برمی‌گردانند، و :meth:`~email.message.EmailMessage.iter_parts` یک فهرست خالی" +" تولید می‌کند." -msgid "All :mimetype:`multipart` type messages will be parsed as a container message object with a list of sub-message objects for their payload. The outer container message will return ``True`` for :meth:`~email.message.EmailMessage.is_multipart`, and :meth:`~email.message.EmailMessage.iter_parts` will yield a list of subparts." -msgstr "" +msgid "" +"All :mimetype:`multipart` type messages will be parsed as a container " +"message object with a list of sub-message objects for their payload. The " +"outer container message will return ``True`` for " +":meth:`~email.message.EmailMessage.is_multipart`, and " +":meth:`~email.message.EmailMessage.iter_parts` will yield a list of " +"subparts." +msgstr "" +"همه‌ی پیام‌های نوع :mimetype:`multipart` به‌صورت یک شیء پیام ظرف تجزیه " +"می‌شوند که بارٔ آن فهرستی از اشیاء زیرپیام است. پیام ظرف بیرونی برای " +":meth:`~email.message.EmailMessage.is_multipart` مقدار ``True`` را " +"برمی‌گرداند، و :meth:`~email.message.EmailMessage.iter_parts` فهرستی از " +"زیربخش‌ها را تولید می‌کند." -msgid "Most messages with a content type of :mimetype:`message/\\*` (such as :mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will also be parsed as container object containing a list payload of length 1. Their :meth:`~email.message.EmailMessage.is_multipart` method will return ``True``. The single element yielded by :meth:`~email.message.EmailMessage.iter_parts` will be a sub-message object." -msgstr "" +msgid "" +"Most messages with a content type of :mimetype:`message/\\*` (such as " +":mimetype:`message/delivery-status` and :mimetype:`message/rfc822`) will " +"also be parsed as container object containing a list payload of length 1. " +"Their :meth:`~email.message.EmailMessage.is_multipart` method will return " +"``True``. The single element yielded by " +":meth:`~email.message.EmailMessage.iter_parts` will be a sub-message object." +msgstr "" +"بیشتر پیام‌هایی که نوع محتوای آن‌ها :mimetype:`message/\\*` است (مانند " +":mimetype:`message/delivery-status` و :mimetype:`message/rfc822`) نیز " +"به‌صورت یک شیء ظرف حاوی یک بار (payload) از نوع فهرست به طول ۱ تجزیه " +"می‌شوند. متد :meth:`~email.message.EmailMessage.is_multipart` این پیام‌ها " +"مقدار ``True`` را برمی‌گرداند. تنها عنصری که توسط " +":meth:`~email.message.EmailMessage.iter_parts` تولید می‌شود، یک شیء زیرپیام" +" خواهد بود." -msgid "Some non-standards-compliant messages may not be internally consistent about their :mimetype:`multipart`\\ -edness. Such messages may have a :mailheader:`Content-Type` header of type :mimetype:`multipart`, but their :meth:`~email.message.EmailMessage.is_multipart` method may return ``False``. If such messages were parsed with the :class:`~email.parser.FeedParser`, they will have an instance of the :class:`~email.errors.MultipartInvariantViolationDefect` class in their *defects* attribute list. See :mod:`email.errors` for details." -msgstr "" +msgid "" +"Some non-standards-compliant messages may not be internally consistent about" +" their :mimetype:`multipart`\\ -edness. Such messages may have a " +":mailheader:`Content-Type` header of type :mimetype:`multipart`, but their " +":meth:`~email.message.EmailMessage.is_multipart` method may return " +"``False``. If such messages were parsed with the " +":class:`~email.parser.FeedParser`, they will have an instance of the " +":class:`~email.errors.MultipartInvariantViolationDefect` class in their " +"*defects* attribute list. See :mod:`email.errors` for details." +msgstr "" +"ممکن است برخی پیام‌های ناسازگار با استاندارد، از نظر درونی با چندبخشی بودن " +"(:mimetype:`multipart`\\ -edness) خود سازگار نباشند. چنین پیام‌هایی ممکن است" +" سرآیند :mailheader:`Content-Type` از نوع :mimetype:`multipart` داشته باشند،" +" اما متد :meth:`~email.message.EmailMessage.is_multipart` آن‌ها ممکن است " +"``False`` برگرداند. اگر چنین پیام‌هایی با :class:`~email.parser.FeedParser` " +"تجزیه شده باشند، در فهرست ویژگی *defects* خود نمونه‌ای از کلاس " +":class:`~email.errors.MultipartInvariantViolationDefect` خواهند داشت. برای " +"جزئیات، :mod:`email.errors` را ببینید." diff --git a/library/email.po b/library/email.po index 20ecb7984..4b8c36467 100644 --- a/library/email.po +++ b/library/email.po @@ -22,70 +22,227 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email` --- An email and MIME handling package" -msgstr "" +msgstr ":mod:`!email` --- بسته‌ای برای مدیریت ایمیل و MIME" msgid "**Source code:** :source:`Lib/email/__init__.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/__init__.py`" -msgid "The :mod:`!email` package is a library for managing email messages. It is specifically *not* designed to do any sending of email messages to SMTP (:rfc:`2821`), NNTP, or other servers; those are functions of modules such as :mod:`smtplib`. The :mod:`!email` package attempts to be as RFC-compliant as possible, supporting :rfc:`5322` and :rfc:`6532`, as well as such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:`2231`." -msgstr "" +msgid "" +"The :mod:`!email` package is a library for managing email messages. It is " +"specifically *not* designed to do any sending of email messages to SMTP " +"(:rfc:`2821`), NNTP, or other servers; those are functions of modules such " +"as :mod:`smtplib`. The :mod:`!email` package attempts to be as RFC-" +"compliant as possible, supporting :rfc:`5322` and :rfc:`6532`, as well as " +"such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, " +":rfc:`2183`, and :rfc:`2231`." +msgstr "" +"بسته‌ی :mod:`!email` کتابخانه‌ای برای مدیریت پیام‌های ایمیل است. این بسته " +"به‌طور مشخص برای ارسال هیچ‌گونه پیام ایمیل به SMTP (:rfc:`2821`)، NNTP یا " +"سایر سرورها طراحی *نشده* است؛ این موارد، کارکردهای ماژول‌هایی مانند " +":mod:`smtplib` هستند. بسته‌ی :mod:`!email` تلاش می‌کند تا حد امکان با " +"RFCها منطبق باشد و از :rfc:`5322` و :rfc:`6532` و همچنین RFCهای مرتبط با " +"MIME مانند :rfc:`2045`، :rfc:`2046`، :rfc:`2047`، :rfc:`2183` و :rfc:`2231` " +"پشتیبانی می‌کند." -msgid "The overall structure of the email package can be divided into three major components, plus a fourth component that controls the behavior of the other components." +msgid "" +"The overall structure of the email package can be divided into three major " +"components, plus a fourth component that controls the behavior of the other " +"components." msgstr "" +"ساختار کلی بسته email را می‌توان به سه کامپوننت اصلی تقسیم کرد، به‌علاوه یک " +"کامپوننت چهارم که رفتار سایر کامپوننت‌ها را کنترل می‌کند." -msgid "The central component of the package is an \"object model\" that represents email messages. An application interacts with the package primarily through the object model interface defined in the :mod:`~email.message` sub-module. The application can use this API to ask questions about an existing email, to construct a new email, or to add or remove email subcomponents that themselves use the same object model interface. That is, following the nature of email messages and their MIME subcomponents, the email object model is a tree structure of objects that all provide the :class:`~email.message.EmailMessage` API." -msgstr "" +msgid "" +"The central component of the package is an \"object model\" that represents " +"email messages. An application interacts with the package primarily through" +" the object model interface defined in the :mod:`~email.message` sub-module." +" The application can use this API to ask questions about an existing email," +" to construct a new email, or to add or remove email subcomponents that " +"themselves use the same object model interface. That is, following the " +"nature of email messages and their MIME subcomponents, the email object " +"model is a tree structure of objects that all provide the " +":class:`~email.message.EmailMessage` API." +msgstr "" +"کامپوننت مرکزی بسته، یک «مدل شیء» است که پیام‌های ایمیل را بازنمایی می‌کند. " +"برنامه عمدتاً از طریق رابط مدل شیء که در زیرماژول :mod:`~email.message` " +"تعریف‌شده است، با بسته تعامل می‌کند. برنامه می‌تواند از این API برای پرسش " +"درباره یک ایمیل موجود، ساخت یک ایمیل جدید، یا افزودن یا حذف زیرکامپوننت‌های " +"ایمیل که خود از همان رابط مدل شیء استفاده می‌کنند، استفاده کند. یعنی، با " +"توجه به ماهیت پیام‌های ایمیل و زیرکامپوننت‌های MIME آن‌ها، مدل شیء ایمیل " +"ساختاری درختی از اشیاء است که همگی API :class:`~email.message.EmailMessage` " +"را فراهم می‌کنند." -msgid "The other two major components of the package are the :mod:`~email.parser` and the :mod:`~email.generator`. The parser takes the serialized version of an email message (a stream of bytes) and converts it into a tree of :class:`~email.message.EmailMessage` objects. The generator takes an :class:`~email.message.EmailMessage` and turns it back into a serialized byte stream. (The parser and generator also handle streams of text characters, but this usage is discouraged as it is too easy to end up with messages that are not valid in one way or another.)" -msgstr "" +msgid "" +"The other two major components of the package are the :mod:`~email.parser` " +"and the :mod:`~email.generator`. The parser takes the serialized version of" +" an email message (a stream of bytes) and converts it into a tree of " +":class:`~email.message.EmailMessage` objects. The generator takes an " +":class:`~email.message.EmailMessage` and turns it back into a serialized " +"byte stream. (The parser and generator also handle streams of text " +"characters, but this usage is discouraged as it is too easy to end up with " +"messages that are not valid in one way or another.)" +msgstr "" +"دو کامپوننت اصلی دیگر بسته، :mod:`~email.parser` و :mod:`~email.generator` " +"هستند. پارسر نسخه‌ی سریال‌شده‌ی یک پیام ایمیل (جریانی از بایت‌ها) را " +"می‌گیرد و آن را به درختی از اشیای :class:`~email.message.EmailMessage` " +"تبدیل می‌کند. تولیدگر یک :class:`~email.message.EmailMessage` را می‌گیرد و " +"آن را دوباره به یک جریان بایت سریال‌شده تبدیل می‌کند. (پارسر و تولیدگر" +" جریان‌هایی از نویسه‌های متنی را نیز مدیریت می‌کنند، اما این کاربرد توصیه " +"نمی‌شود، زیرا بسیار آسان است که در نهایت به پیام‌هایی برسید که به نحوی " +"نامعتبر هستند.)" -msgid "The control component is the :mod:`~email.policy` module. Every :class:`~email.message.EmailMessage`, every :mod:`~email.generator`, and every :mod:`~email.parser` has an associated :mod:`~email.policy` object that controls its behavior. Usually an application only needs to specify the policy when an :class:`~email.message.EmailMessage` is created, either by directly instantiating an :class:`~email.message.EmailMessage` to create a new email, or by parsing an input stream using a :mod:`~email.parser`. But the policy can be changed when the message is serialized using a :mod:`~email.generator`. This allows, for example, a generic email message to be parsed from disk, but to serialize it using standard SMTP settings when sending it to an email server." -msgstr "" +msgid "" +"The control component is the :mod:`~email.policy` module. Every " +":class:`~email.message.EmailMessage`, every :mod:`~email.generator`, and " +"every :mod:`~email.parser` has an associated :mod:`~email.policy` object " +"that controls its behavior. Usually an application only needs to specify " +"the policy when an :class:`~email.message.EmailMessage` is created, either " +"by directly instantiating an :class:`~email.message.EmailMessage` to create" +" a new email, or by parsing an input stream using a :mod:`~email.parser`. " +"But the policy can be changed when the message is serialized using a " +":mod:`~email.generator`. This allows, for example, a generic email message " +"to be parsed from disk, but to serialize it using standard SMTP settings " +"when sending it to an email server." +msgstr "" +"کامپوننت کنترلی، ماژول :mod:`~email.policy` است. هر " +":class:`~email.message.EmailMessage`، هر :mod:`~email.generator` و هر " +":mod:`~email.parser` یک شیء :mod:`~email.policy` مرتبط دارد که رفتار آن را " +"کنترل می‌کند. معمولاً یک برنامه فقط نیاز دارد سیاست را هنگام ایجاد یک " +":class:`~email.message.EmailMessage` مشخص کند؛ چه با نمونه‌سازی مستقیم یک " +":class:`~email.message.EmailMessage` برای ایجاد یک ایمیل جدید، چه با تجزیه " +"یک جریان ورودی با استفاده از :mod:`~email.parser`. اما می‌توان سیاست را " +"هنگام سریال‌سازی پیام با استفاده از :mod:`~email.generator` تغییر داد. این " +"امکان را فراهم می‌کند که برای مثال یک پیام ایمیل عام از دیسک تجزیه شود، " +"اما هنگام ارسال آن به یک سرور ایمیل، با استفاده از تنظیمات استاندارد SMTP " +"سریال‌سازی شود." -msgid "The email package does its best to hide the details of the various governing RFCs from the application. Conceptually the application should be able to treat the email message as a structured tree of unicode text and binary attachments, without having to worry about how these are represented when serialized. In practice, however, it is often necessary to be aware of at least some of the rules governing MIME messages and their structure, specifically the names and nature of the MIME \"content types\" and how they identify multipart documents. For the most part this knowledge should only be required for more complex applications, and even then it should only be the high level structure in question, and not the details of how those structures are represented. Since MIME content types are used widely in modern internet software (not just email), this will be a familiar concept to many programmers." -msgstr "" +msgid "" +"The email package does its best to hide the details of the various governing" +" RFCs from the application. Conceptually the application should be able to " +"treat the email message as a structured tree of unicode text and binary " +"attachments, without having to worry about how these are represented when " +"serialized. In practice, however, it is often necessary to be aware of at " +"least some of the rules governing MIME messages and their structure, " +"specifically the names and nature of the MIME \"content types\" and how they" +" identify multipart documents. For the most part this knowledge should only" +" be required for more complex applications, and even then it should only be " +"the high level structure in question, and not the details of how those " +"structures are represented. Since MIME content types are used widely in " +"modern internet software (not just email), this will be a familiar concept " +"to many programmers." +msgstr "" +"بسته email تمام تلاش خود را می‌کند تا جزئیات RFCهای حاکم مختلف را از برنامه" +" کاربردی پنهان کند. از نظر مفهومی، برنامه کاربردی باید بتواند پیام ایمیل را " +"به‌عنوان درختی ساختاریافته از متن یونیکد و پیوست‌های دودویی در نظر بگیرد، " +"بدون این‌که نگران چگونگی بازنمایی آن‌ها هنگام سریال‌سازی باشد. اما در عمل، " +"اغلب لازم است حداقل از برخی قوانین حاکم بر پیام‌های MIME و ساختار آن‌ها آگاه" +" باشید، به‌ویژه نام‌ها و ماهیت انواع محتوای MIME و این‌که آن‌ها اسناد " +"چندبخشی (multipart) را چگونه شناسایی می‌کنند. در بیشتر موارد، این دانش فقط " +"برای برنامه‌های کاربردی پیچیده‌تر مورد نیاز است، و حتی در آن موارد نیز فقط " +"ساختار سطح بالا باید مورد بحث باشد، نه جزئیات چگونگی بازنمایی آن ساختارها. " +"از آن‌جا که انواع محتوای MIME به‌طور گسترده در نرم‌افزارهای اینترنتی مدرن " +"(نه فقط ایمیل) استفاده می‌شوند، این مفهوم برای بسیاری از برنامه‌نویسان آشنا " +"خواهد بود." -msgid "The following sections describe the functionality of the :mod:`!email` package. We start with the :mod:`~email.message` object model, which is the primary interface an application will use, and follow that with the :mod:`~email.parser` and :mod:`~email.generator` components. Then we cover the :mod:`~email.policy` controls, which completes the treatment of the main components of the library." -msgstr "" +msgid "" +"The following sections describe the functionality of the :mod:`!email` " +"package. We start with the :mod:`~email.message` object model, which is the " +"primary interface an application will use, and follow that with the " +":mod:`~email.parser` and :mod:`~email.generator` components. Then we cover " +"the :mod:`~email.policy` controls, which completes the treatment of the main" +" components of the library." +msgstr "" +"بخش‌های زیر کارکرد بسته‌ی :mod:`!email` را توصیف می‌کنند. ما با مدل شیء " +":mod:`~email.message` آغاز می‌کنیم، که رابط اصلی‌ای است که یک برنامه از آن " +"استفاده خواهد کرد، و پس از آن به کامپوننت‌های :mod:`~email.parser` و " +":mod:`~email.generator` می‌پردازیم. سپس کنترل‌های :mod:`~email.policy` را " +"پوشش می‌دهیم، که بررسی کامپوننت‌های اصلی کتابخانه را کامل می‌کند." -msgid "The next three sections cover the exceptions the package may raise and the defects (non-compliance with the RFCs) that the :mod:`~email.parser` may detect. Then we cover the :mod:`~email.headerregistry` and the :mod:`~email.contentmanager` sub-components, which provide tools for doing more detailed manipulation of headers and payloads, respectively. Both of these components contain features relevant to consuming and producing non-trivial messages, but also document their extensibility APIs, which will be of interest to advanced applications." -msgstr "" +msgid "" +"The next three sections cover the exceptions the package may raise and the " +"defects (non-compliance with the RFCs) that the :mod:`~email.parser` may " +"detect. Then we cover the :mod:`~email.headerregistry` and the " +":mod:`~email.contentmanager` sub-components, which provide tools for doing " +"more detailed manipulation of headers and payloads, respectively. Both of " +"these components contain features relevant to consuming and producing non-" +"trivial messages, but also document their extensibility APIs, which will be " +"of interest to advanced applications." +msgstr "" +"سه بخش بعدی به بررسی استثناهایی می‌پردازند که این بسته ممکن است پرتاب کند و " +"نقص‌ها (عدم انطباق با RFCها) را که :mod:`~email.parser` ممکن است شناسایی " +"کند. سپس به بررسی کامپوننت‌های فرعی :mod:`~email.headerregistry` و " +":mod:`~email.contentmanager` می‌پردازیم، که به ترتیب ابزارهایی برای دستکاری " +"جزئی‌تر سرصفحه‌ها و بارهای پیام فراهم می‌کنند. هر دوی این کامپوننت‌ها دارای" +" ویژگی‌هایی مرتبط با مصرف و تولید پیام‌های غیرساده هستند و همچنین مستندات " +"APIهای توسعه‌پذیری خود را نیز ارائه می‌کنند، که برای برنامه‌های پیشرفته " +"جالب توجه خواهد بود." -msgid "Following those is a set of examples of using the fundamental parts of the APIs covered in the preceding sections." +msgid "" +"Following those is a set of examples of using the fundamental parts of the " +"APIs covered in the preceding sections." msgstr "" +"پس از آن‌ها، مجموعه‌ای از مثال‌ها برای استفاده از بخش‌های بنیادی APIهای " +"پوشش‌داده‌شده در بخش‌های پیشین آمده است." -msgid "The foregoing represent the modern (unicode friendly) API of the email package. The remaining sections, starting with the :class:`~email.message.Message` class, cover the legacy :data:`~email.policy.compat32` API that deals much more directly with the details of how email messages are represented. The :data:`~email.policy.compat32` API does *not* hide the details of the RFCs from the application, but for applications that need to operate at that level, they can be useful tools. This documentation is also relevant for applications that are still using the :mod:`~email.policy.compat32` API for backward compatibility reasons." -msgstr "" +msgid "" +"The foregoing represent the modern (unicode friendly) API of the email " +"package. The remaining sections, starting with the " +":class:`~email.message.Message` class, cover the legacy " +":data:`~email.policy.compat32` API that deals much more directly with the " +"details of how email messages are represented. The " +":data:`~email.policy.compat32` API does *not* hide the details of the RFCs " +"from the application, but for applications that need to operate at that " +"level, they can be useful tools. This documentation is also relevant for " +"applications that are still using the :mod:`~email.policy.compat32` API for " +"backward compatibility reasons." +msgstr "" +"موارد فوق نشان‌دهنده‌ی API مدرن (سازگار با یونیکد) بسته‌ی email هستند. " +"بخش‌های باقی‌مانده، که با کلاس :class:`~email.message.Message` آغاز می‌شوند،" +" API قدیمی :data:`~email.policy.compat32` را پوشش می‌دهند که بسیار مستقیم‌تر" +" به جزئیات نحوه‌ی بازنمایی پیام‌های ایمیل می‌پردازد. API " +":data:`~email.policy.compat32` جزئیات RFCها را از برنامه *پنهان نمی‌کند*، " +"اما برای برنامه‌هایی که نیاز دارند در آن سطح کار کنند، می‌تواند ابزار مفیدی " +"باشد. این مستندات برای برنامه‌هایی که هنوز به دلایل سازگاری با عقب از API " +":mod:`~email.policy.compat32` استفاده می‌کنند نیز مرتبط است." -msgid "Docs reorganized and rewritten to promote the new :class:`~email.message.EmailMessage`/:class:`~email.policy.EmailPolicy` API." +msgid "" +"Docs reorganized and rewritten to promote the new " +":class:`~email.message.EmailMessage`/:class:`~email.policy.EmailPolicy` API." msgstr "" +"مستندات برای ترویج API جدید " +":class:`~email.message.EmailMessage`/:class:`~email.policy.EmailPolicy` " +"بازآرایی و بازنویسی شدند." msgid "Contents of the :mod:`!email` package documentation:" -msgstr "" +msgstr "محتویات مستندات بسته‌ی :mod:`!email`:" msgid "Legacy API:" -msgstr "" +msgstr "API قدیمی:" msgid "Module :mod:`smtplib`" -msgstr "" +msgstr "ماژول :mod:`smtplib`" msgid "SMTP (Simple Mail Transport Protocol) client" -msgstr "" +msgstr "کارخواه SMTP (پروتکل انتقال ایمیل ساده)" msgid "Module :mod:`poplib`" -msgstr "" +msgstr "ماژول :mod:`poplib`" msgid "POP (Post Office Protocol) client" -msgstr "" +msgstr "کارخواه POP (Post Office Protocol)" msgid "Module :mod:`imaplib`" -msgstr "" +msgstr "ماژول :mod:`imaplib`" msgid "IMAP (Internet Message Access Protocol) client" -msgstr "" +msgstr "کارخواه IMAP (Internet Message Access Protocol)" msgid "Module :mod:`mailbox`" -msgstr "" +msgstr "ماژول :mod:`mailbox`" -msgid "Tools for creating, reading, and managing collections of messages on disk using a variety standard formats." +msgid "" +"Tools for creating, reading, and managing collections of messages on disk " +"using a variety standard formats." msgstr "" +"ابزارهایی برای ایجاد، خواندن و مدیریت مجموعه‌هایی از پیام‌ها روی دیسک با " +"استفاده از انواع قالب‌های استاندارد." diff --git a/library/email.policy.po b/library/email.policy.po index 4dc22f58a..b41a90dd7 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"PO-Revision-Date: 2026-08-28 10:15+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,42 +22,154 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!email.policy`: Policy Objects" -msgstr "" +msgstr ":mod:`!email.policy`: اشیاء Policy" msgid "**Source code:** :source:`Lib/email/policy.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/email/policy.py`" -msgid "The :mod:`email` package's prime focus is the handling of email messages as described by the various email and MIME RFCs. However, the general format of email messages (a block of header fields each consisting of a name followed by a colon followed by a value, the whole block followed by a blank line and an arbitrary 'body'), is a format that has found utility outside of the realm of email. Some of these uses conform fairly closely to the main email RFCs, some do not. Even when working with email, there are times when it is desirable to break strict compliance with the RFCs, such as generating emails that interoperate with email servers that do not themselves follow the standards, or that implement extensions you want to use in ways that violate the standards." -msgstr "" +msgid "" +"The :mod:`email` package's prime focus is the handling of email messages as " +"described by the various email and MIME RFCs. However, the general format " +"of email messages (a block of header fields each consisting of a name " +"followed by a colon followed by a value, the whole block followed by a " +"blank line and an arbitrary 'body'), is a format that has found utility " +"outside of the realm of email. Some of these uses conform fairly closely " +"to the main email RFCs, some do not. Even when working with email, there " +"are times when it is desirable to break strict compliance with the RFCs, " +"such as generating emails that interoperate with email servers that do not " +"themselves follow the standards, or that implement extensions you want to " +"use in ways that violate the standards." +msgstr "" +"تمرکز اصلی بسته‌ی :mod:`email` پردازش پیام‌های ایمیلی است، همان‌گونه که در " +"RFCهای مختلف ایمیل و MIME توصیف شده است. با این حال، قالب کلی پیام‌های " +"ایمیلی (بلوکی از فیلدهای سرآیند که هر یک شامل یک نام، به‌دنبال آن یک دونقطه " +"و به‌دنبال آن یک مقدار است و کل بلوک با یک خط خالی و یک «بدنه» دلخواه دنبال " +"می‌شود)، قالبی است که فراتر از حوزه‌ی ایمیل نیز کاربرد یافته است. برخی از این " +"کاربردها تا حد زیادی با RFCهای اصلی ایمیل مطابقت دارند، برخی مطابقت ندارند. " +"حتی هنگام کار با ایمیل، گاهی اوقات خروج از انطباق دقیق با RFCها مطلوب است، " +"مانند تولید ایمیل‌هایی که با سرورهای ایمیلی که خودشان استانداردها را رعایت " +"نمی‌کنند یا افزونه‌هایی را پیاده‌سازی می‌کنند که می‌خواهید به روش‌هایی که " +"استانداردها را نقض می‌کنند از آن‌ها استفاده کنید، تعامل دارند." -msgid "Policy objects give the email package the flexibility to handle all these disparate use cases." +msgid "" +"Policy objects give the email package the flexibility to handle all these " +"disparate use cases." msgstr "" +"اشیای Policy به بسته‌ی email انعطاف‌پذیری می‌دهند تا تمام این موارد استفاده‌ی " +"متفاوت را مدیریت کند." -msgid "A :class:`Policy` object encapsulates a set of attributes and methods that control the behavior of various components of the email package during use. :class:`Policy` instances can be passed to various classes and methods in the email package to alter the default behavior. The settable values and their defaults are described below." -msgstr "" +msgid "" +"A :class:`Policy` object encapsulates a set of attributes and methods that " +"control the behavior of various components of the email package during " +"use. :class:`Policy` instances can be passed to various classes and methods " +"in the email package to alter the default behavior. The settable values " +"and their defaults are described below." +msgstr "" +"یک شیء :class:`Policy` مجموعه‌ای از ویژگی‌ها و متدها را در بر می‌گیرد که رفتار " +"کامپوننت‌های مختلف بسته‌ی email را در هنگام استفاده کنترل می‌کنند. می‌توان " +"نمونه‌های :class:`Policy` را به کلاس‌ها و متدهای مختلف بسته‌ی email ارسال کرد " +"تا رفتار پیش‌فرض تغییر کند. مقادیر قابل‌تنظیم و پیش‌فرض‌های آن‌ها در زیر توضیح " +"داده شده‌اند." -msgid "There is a default policy used by all classes in the email package. For all of the :mod:`~email.parser` classes and the related convenience functions, and for the :class:`~email.message.Message` class, this is the :class:`Compat32` policy, via its corresponding pre-defined instance :const:`compat32`. This policy provides for complete backward compatibility (in some cases, including bug compatibility) with the pre-Python3.3 version of the email package." -msgstr "" +msgid "" +"There is a default policy used by all classes in the email package. For " +"all of the :mod:`~email.parser` classes and the related convenience " +"functions, and for the :class:`~email.message.Message` class, this is " +"the :class:`Compat32` policy, via its corresponding pre-defined " +"instance :const:`compat32`. This policy provides for complete backward " +"compatibility (in some cases, including bug compatibility) with the pre-" +"Python3.3 version of the email package." +msgstr "" +"یک سیاست پیش‌فرض وجود دارد که توسط همه‌ی کلاس‌های بسته‌ی email استفاده می‌شود. " +"برای همه‌ی کلاس‌های :mod:`~email.parser` و توابع سهولت‌بخش مرتبط، و برای " +"کلاس :class:`~email.message.Message`، این سیاست :class:`Compat32` است، از " +"طریق نمونه‌ی از پیش تعریف‌شده‌ی متناظر آن :const:`compat32`. این سیاست سازگاری " +"کامل رو به عقب (در برخی موارد، شامل سازگاری با اشکال‌ها) با نسخه‌ی پیش از " +"Python3.3 بسته‌ی email را فراهم می‌کند." -msgid "This default value for the *policy* keyword to :class:`~email.message.EmailMessage` is the :class:`EmailPolicy` policy, via its pre-defined instance :data:`~default`." +msgid "" +"This default value for the *policy* keyword " +"to :class:`~email.message.EmailMessage` is the :class:`EmailPolicy` policy, " +"via its pre-defined instance :data:`~default`." msgstr "" +"این مقدار پیش‌فرض برای کلیدواژه‌ی *policy* " +"در :class:`~email.message.EmailMessage`، سیاست :class:`EmailPolicy` است که " +"از طریق نمونه‌ی از پیش تعریف‌شده‌ی آن، :data:`~default`، فراهم می‌شود." -msgid "When a :class:`~email.message.Message` or :class:`~email.message.EmailMessage` object is created, it acquires a policy. If the message is created by a :mod:`~email.parser`, a policy passed to the parser will be the policy used by the message it creates. If the message is created by the program, then the policy can be specified when it is created. When a message is passed to a :mod:`~email.generator`, the generator uses the policy from the message by default, but you can also pass a specific policy to the generator that will override the one stored on the message object." -msgstr "" +msgid "" +"When a :class:`~email.message.Message` " +"or :class:`~email.message.EmailMessage` object is created, it acquires a " +"policy. If the message is created by a :mod:`~email.parser`, a policy " +"passed to the parser will be the policy used by the message it creates. If " +"the message is created by the program, then the policy can be specified " +"when it is created. When a message is passed to a :mod:`~email.generator`, " +"the generator uses the policy from the message by default, but you can also " +"pass a specific policy to the generator that will override the one stored " +"on the message object." +msgstr "" +"هنگامی که یک شیء :class:`~email.message.Message` " +"یا :class:`~email.message.EmailMessage` ایجاد می‌شود، یک سیاست کسب می‌کند. " +"اگر پیام توسط یک :mod:`~email.parser` ایجاد شود، سیاستی که به پارسر ارسال " +"شود، سیاستی خواهد بود که پیام ایجادشده از آن استفاده می‌کند. اگر پیام توسط " +"برنامه ایجاد شود، می‌توان سیاست را هنگام ایجاد آن مشخص کرد. هنگامی که یک " +"پیام به یک :mod:`~email.generator` ارسال می‌شود، تولیدگر به‌طور پیش‌فرض از " +"سیاست پیام استفاده می‌کند، اما می‌توانید یک سیاست مشخص را نیز به تولیدگر " +"ارسال کنید که جایگزین سیاست ذخیره‌شده در شیء پیام می‌شود." -msgid "The default value for the *policy* keyword for the :mod:`email.parser` classes and the parser convenience functions **will be changing** in a future version of Python. Therefore you should **always specify explicitly which policy you want to use** when calling any of the classes and functions described in the :mod:`~email.parser` module." -msgstr "" +msgid "" +"The default value for the *policy* keyword for the :mod:`email.parser` " +"classes and the parser convenience functions **will be changing** in a " +"future version of Python. Therefore you should **always specify explicitly " +"which policy you want to use** when calling any of the classes and " +"functions described in the :mod:`~email.parser` module." +msgstr "" +"مقدار پیش‌فرض برای کلیدواژه‌ی *policy* در کلاس‌های :mod:`email.parser` و توابع " +"سهولت‌بخش پارسر، در نسخه‌ای آینده از پایتون **تغییر خواهد کرد**. بنابراین شما " +"باید هنگام فراخوانی هر یک از کلاس‌ها و توابع توصیف‌شده در " +"ماژول :mod:`~email.parser`، **همیشه به‌صورت صریح مشخص کنید که می‌خواهید از " +"کدام policy استفاده کنید**." -msgid "The first part of this documentation covers the features of :class:`Policy`, an :term:`abstract base class` that defines the features that are common to all policy objects, including :const:`compat32`. This includes certain hook methods that are called internally by the email package, which a custom policy could override to obtain different behavior. The second part describes the concrete classes :class:`EmailPolicy` and :class:`Compat32`, which implement the hooks that provide the standard behavior and the backward compatible behavior and features, respectively." -msgstr "" +msgid "" +"The first part of this documentation covers the features " +"of :class:`Policy`, an :term:`abstract base class` that defines the " +"features that are common to all policy objects, " +"including :const:`compat32`. This includes certain hook methods that are " +"called internally by the email package, which a custom policy could " +"override to obtain different behavior. The second part describes the " +"concrete classes :class:`EmailPolicy` and :class:`Compat32`, which " +"implement the hooks that provide the standard behavior and the backward " +"compatible behavior and features, respectively." +msgstr "" +"بخش نخست این مستندات قابلیت‌های :class:`Policy`، یک :term:`abstract base " +"class` که قابلیت‌های مشترک میان تمام اشیای سیاست، از جمله :const:`compat32`، " +"را تعریف می‌کند، پوشش می‌دهد. این قابلیت‌ها شامل برخی متدهای قلابهستند " +"که به‌صورت داخلی توسط بسته email فراخوانی می‌شوند و یک سیاست سفارشی می‌تواند " +"آن‌ها را برای به دست آوردن رفتاری متفاوت بازنویسی کند. بخش دوم کلاس‌های " +"عینی :class:`EmailPolicy` و :class:`Compat32` را توصیف می‌کند، که به‌ترتیب " +"قلاب‌هایی را پیاده‌سازی می‌کنند که رفتار استاندارد و رفتار و قابلیت‌های سازگار " +"با نسخه‌های قدیمی را فراهم می‌کنند." -msgid ":class:`Policy` instances are immutable, but they can be cloned, accepting the same keyword arguments as the class constructor and returning a new :class:`Policy` instance that is a copy of the original but with the specified attributes values changed." +msgid "" +":class:`Policy` instances are immutable, but they can be cloned, accepting " +"the same keyword arguments as the class constructor and returning a " +"new :class:`Policy` instance that is a copy of the original but with the " +"specified attributes values changed." msgstr "" +"نمونه‌های :class:`Policy` تغییرناپذیر هستند، اما می‌توان آن‌ها را همانندسازی " +"کرد؛ این عملیات همان آرگومان‌های کلیدواژه‌ای سازنده‌ی کلاس را می‌پذیرد و یک " +"نمونه‌ی جدید از :class:`Policy` بازمی‌گرداند که کپی نمونه‌ی اصلی است، اما " +"مقادیر ویژگی‌های مشخص‌شده در آن تغییر کرده‌اند." -msgid "As an example, the following code could be used to read an email message from a file on disk and pass it to the system ``sendmail`` program on a Unix system:" +msgid "" +"As an example, the following code could be used to read an email message " +"from a file on disk and pass it to the system ``sendmail`` program on a " +"Unix system:" msgstr "" +"برای مثال، می‌توان از کد زیر برای خواندن یک پیام ایمیل از یک فایل روی دیسک و " +"ارسال آن به برنامه ``sendmail`` سیستم در یک سیستم یونیکس استفاده کرد:" msgid "" ">>> from email import message_from_binary_file\n" @@ -73,12 +185,42 @@ msgid "" ">>> p.stdin.close()\n" ">>> rc = p.wait()" msgstr "" +">>> from email import message_from_binary_file\n" +">>> from email.generator import BytesGenerator\n" +">>> from email import policy\n" +">>> from subprocess import Popen, PIPE\n" +">>> with open('mymsg.txt', 'rb') as f:\n" +"... msg = message_from_binary_file(f, policy=policy.default)\n" +"...\n" +">>> p = Popen(['sendmail', msg['To'].addresses[0]], stdin=PIPE)\n" +">>> g = BytesGenerator(p.stdin, policy=msg.policy.clone(linesep='\\r\\n'))\n" +">>> g.flatten(msg)\n" +">>> p.stdin.close()\n" +">>> rc = p.wait()" -msgid "Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC correct line separator characters when creating the binary string to feed into ``sendmail's`` ``stdin``, where the default policy would use ``\\n`` line separators." +msgid "" +"Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " +"correct line separator characters when creating the binary string to feed " +"into ``sendmail's`` ``stdin``, where the default policy would use ``\\n`` " +"line separators." msgstr "" +"در اینجا ما به :class:`~email.generator.BytesGenerator` می‌گوییم که هنگام " +"ایجاد رشته دودویی برای فرستادن به ``sendmail's`` ``stdin``، از نویسه‌های " +"جداکننده خط صحیح مطابق RFC استفاده کند، در حالی که سیاست پیش‌فرض از " +"جداکننده‌های خط ``\\n`` استفاده می‌کرد." -msgid "Some email package methods accept a *policy* keyword argument, allowing the policy to be overridden for that method. For example, the following code uses the :meth:`~email.message.Message.as_bytes` method of the *msg* object from the previous example and writes the message to a file using the native line separators for the platform on which it is running::" -msgstr "" +msgid "" +"Some email package methods accept a *policy* keyword argument, allowing the " +"policy to be overridden for that method. For example, the following code " +"uses the :meth:`~email.message.Message.as_bytes` method of the *msg* object " +"from the previous example and writes the message to a file using the native " +"line separators for the platform on which it is running::" +msgstr "" +"برخی از متدهای بسته‌ی email آرگومان کلیدواژه‌ای *policy* را می‌پذیرند، که امکان " +"جایگزینی سیاست برای آن متد را فراهم می‌کند. برای مثال، کد زیر از " +"متد :meth:`~email.message.Message.as_bytes` شیء *msg* از مثال پیشین استفاده " +"می‌کند و پیام را با استفاده از جداکننده‌های خط بومیِ سکویی که روی آن اجرا " +"می‌شود، در یک فایل می‌نویسد::" msgid "" ">>> import os\n" @@ -86,18 +228,34 @@ msgid "" "... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" "17" msgstr "" +">>> import os\n" +">>> with open('converted.txt', 'wb') as f:\n" +"... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" +"17" -msgid "Policy objects can also be combined using the addition operator, producing a policy object whose settings are a combination of the non-default values of the summed objects::" +msgid "" +"Policy objects can also be combined using the addition operator, producing " +"a policy object whose settings are a combination of the non-default values " +"of the summed objects::" msgstr "" +"همچنین می‌توان با استفاده از عملگر جمع، اشیای Policy را ترکیب کرد و به یک " +"شیء Policy رسید که تنظیمات آن ترکیبی از مقادیر غیرپیش‌فرض اشیای جمع‌شده است::" msgid "" ">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" ">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" ">>> compat_strict_SMTP = compat_SMTP + compat_strict" msgstr "" +">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" +">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" +">>> compat_strict_SMTP = compat_SMTP + compat_strict" -msgid "This operation is not commutative; that is, the order in which the objects are added matters. To illustrate::" +msgid "" +"This operation is not commutative; that is, the order in which the objects " +"are added matters. To illustrate::" msgstr "" +"این عملیات جابه‌جایی‌پذیر نیست؛ یعنی ترتیبی که اشیاء اضافه می‌شوند اهمیت دارد. " +"برای نمونه::" msgid "" ">>> policy100 = policy.compat32.clone(max_line_length=100)\n" @@ -109,267 +267,796 @@ msgid "" ">>> apolicy.max_line_length\n" "100" msgstr "" +">>> policy100 = policy.compat32.clone(max_line_length=100)\n" +">>> policy80 = policy.compat32.clone(max_line_length=80)\n" +">>> apolicy = policy100 + policy80\n" +">>> apolicy.max_line_length\n" +"80\n" +">>> apolicy = policy80 + policy100\n" +">>> apolicy.max_line_length\n" +"100" -msgid "This is the :term:`abstract base class` for all policy classes. It provides default implementations for a couple of trivial methods, as well as the implementation of the immutability property, the :meth:`clone` method, and the constructor semantics." +msgid "" +"This is the :term:`abstract base class` for all policy classes. It " +"provides default implementations for a couple of trivial methods, as well " +"as the implementation of the immutability property, the :meth:`clone` " +"method, and the constructor semantics." msgstr "" +"این :term:`کلاس پایه انتزاعی ` برای تمام کلاس‌های سیاست " +"است. این کلاس پیاده‌سازی‌های پیش‌فرضی برای چند متد ساده، و همچنین پیاده‌سازی " +"ویژگی تغییرناپذیری، متد :meth:`clone` و معنای سازنده را ارائه می‌دهد." -msgid "The constructor of a policy class can be passed various keyword arguments. The arguments that may be specified are any non-method properties on this class, plus any additional non-method properties on the concrete class. A value specified in the constructor will override the default value for the corresponding attribute." +msgid "" +"The constructor of a policy class can be passed various keyword arguments. " +"The arguments that may be specified are any non-method properties on this " +"class, plus any additional non-method properties on the concrete class. A " +"value specified in the constructor will override the default value for the " +"corresponding attribute." msgstr "" +"سازنده‌ی یک کلاس سیاست می‌تواند آرگومان‌های کلیدواژه‌ای مختلفی را بپذیرد. " +"آرگومان‌هایی که می‌توان مشخص کرد، شامل هر پراپرتی غیرمتدی این کلاس، به‌علاوه‌ی " +"هر پراپرتی غیرمتدی اضافه‌ای در کلاس عینی می‌شوند. مقداری که در سازنده مشخص " +"شود، مقدار پیش‌فرض ویژگی متناظر را بازنویسی می‌کند." -msgid "This class defines the following properties, and thus values for the following may be passed in the constructor of any policy class:" +msgid "" +"This class defines the following properties, and thus values for the " +"following may be passed in the constructor of any policy class:" msgstr "" +"این کلاس ویژگی‌های زیر را تعریف می‌کند، بنابراین مقادیر موارد زیر می‌توانند به " +"سازنده‌ی هر کلاس سیاست پاس داده شوند:" -msgid "The maximum length of any line in the serialized output, not counting the end of line character(s). Default is 78, per :rfc:`5322`. A value of ``0`` or :const:`None` indicates that no line wrapping should be done at all." +msgid "" +"The maximum length of any line in the serialized output, not counting the " +"end of line character(s). Default is 78, per :rfc:`5322`. A value of " +"``0`` or :const:`None` indicates that no line wrapping should be done at " +"all." msgstr "" +"حداکثر طول هر خط در خروجی سریال‌شده، بدون احتساب نویسه(های) پایان خط. مقدار " +"پیش‌فرض ۷۸ است، مطابق :rfc:`5322`. مقدار ``0`` یا :const:`None` نشان می‌دهد " +"که به‌هیچ‌وجه نباید خطوط شکسته شوند." -msgid "The string to be used to terminate lines in serialized output. The default is ``\\n`` because that's the internal end-of-line discipline used by Python, though ``\\r\\n`` is required by the RFCs." +msgid "" +"The string to be used to terminate lines in serialized output. The default " +"is ``\\n`` because that's the internal end-of-line discipline used by " +"Python, though ``\\r\\n`` is required by the RFCs." msgstr "" +"رشته‌ای که برای پایان‌دادن به خط‌ها در خروجی سریال‌سازی‌شده استفاده می‌شود. مقدار " +"پیش‌فرض ``\\n`` است، زیرا این قاعده‌ی درونی پایان خطی است که پایتون از آن " +"استفاده می‌کند، اگرچه ``\\r\\n`` توسط RFCها الزامی شده است." -msgid "Controls the type of Content Transfer Encodings that may be or are required to be used. The possible values are:" +msgid "" +"Controls the type of Content Transfer Encodings that may be or are required " +"to be used. The possible values are:" msgstr "" +"نوع کدگذاری‌های انتقال محتوارا که ممکن است " +"استفاده شوند یا استفاده از آن‌ها الزامی باشد، کنترل می‌کند. مقادیر ممکن " +"عبارت‌اند از:" msgid "``7bit``" -msgstr "" +msgstr "``7bit``" -msgid "all data must be \"7 bit clean\" (ASCII-only). This means that where necessary data will be encoded using either quoted-printable or base64 encoding." +msgid "" +"all data must be \"7 bit clean\" (ASCII-only). This means that where " +"necessary data will be encoded using either quoted-printable or base64 " +"encoding." msgstr "" +"تمام داده‌ها باید «7 bit clean» (فقط ASCII) باشند. این بدان معناست که در " +"صورت لزوم، داده‌ها با استفاده از کدگذاری quoted-printable یا base64 کدگذاری " +"می‌شوند." msgid "``8bit``" -msgstr "" +msgstr "``8bit``" -msgid "data is not constrained to be 7 bit clean. Data in headers is still required to be ASCII-only and so will be encoded (see :meth:`fold_binary` and :attr:`~EmailPolicy.utf8` below for exceptions), but body parts may use the ``8bit`` CTE." +msgid "" +"data is not constrained to be 7 bit clean. Data in headers is still " +"required to be ASCII-only and so will be encoded (see :meth:`fold_binary` " +"and :attr:`~EmailPolicy.utf8` below for exceptions), but body parts may use " +"the ``8bit`` CTE." msgstr "" +"داده محدود نیست که ۷ بیتی پاک (7 bit clean) باشد. داده‌های موجود در سرصفحه‌ها " +"همچنان باید فقط ASCII باشند و بنابراین کدگذاری خواهند شد (برای موارد " +"استثنا، :meth:`fold_binary` و :attr:`~EmailPolicy.utf8` را در زیر ببینید)، " +"اما بخش‌های بدنه می‌توانند از CTE ``8bit`` استفاده کنند." -msgid "A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not ``Generator``, because strings cannot contain binary data. If a ``Generator`` is operating under a policy that specifies ``cte_type=8bit``, it will act as if ``cte_type`` is ``7bit``." +msgid "" +"A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not " +"``Generator``, because strings cannot contain binary data. If a " +"``Generator`` is operating under a policy that specifies ``cte_type=8bit``, " +"it will act as if ``cte_type`` is ``7bit``." msgstr "" +"مقدار ``8bit`` برای ``cte_type`` فقط با ``BytesGenerator`` کار می‌کند، نه " +"``Generator``، زیرا رشته‌ها نمی‌توانند حاوی داده‌های دودویی باشند. اگر یک " +"``Generator`` تحت سیاستی کار کند که ``cte_type=8bit`` را تعیین کرده باشد، " +"به‌گونه‌ای رفتار می‌کند که گویی ``cte_type`` برابر ``7bit`` است." -msgid "If :const:`True`, any defects encountered will be raised as errors. If :const:`False` (the default), defects will be passed to the :meth:`register_defect` method." +msgid "" +"If :const:`True`, any defects encountered will be raised as errors. " +"If :const:`False` (the default), defects will be passed to " +"the :meth:`register_defect` method." msgstr "" +"اگر :const:`True` باشد، هر نقصی که با آن مواجه شود به‌عنوان خطا پرتاب خواهد " +"شد. اگر :const:`False` باشد (پیش‌فرض)، نقص‌ها به متد :meth:`register_defect` " +"ارسال می‌شوند." -msgid "If :const:`True`, lines starting with *\"From \"* in the body are escaped by putting a ``>`` in front of them. This parameter is used when the message is being serialized by a generator. Default: :const:`False`." +msgid "" +"If :const:`True`, lines starting with *\"From \"* in the body are escaped " +"by putting a ``>`` in front of them. This parameter is used when the " +"message is being serialized by a generator. Default: :const:`False`." msgstr "" +"اگر :const:`True` باشد، خط‌هایی که در بدنه با *\"From \"* شروع می‌شوند، با " +"قرار دادن یک ``>`` در ابتدای آن‌ها خنثی می‌شوند. این پارامتر زمانی استفاده " +"می‌شود که پیام توسط یک تولیدگر سریال‌سازی می‌شود. پیش‌فرض: :const:`False`." -msgid "A factory function for constructing a new empty message object. Used by the parser when building messages. Defaults to ``None``, in which case :class:`~email.message.Message` is used." +msgid "" +"A factory function for constructing a new empty message object. Used by " +"the parser when building messages. Defaults to ``None``, in which " +"case :class:`~email.message.Message` is used." msgstr "" +"یک تابع کارخانه‌ای (factory function) برای ساختن یک شیء پیام خالی جدید. توسط " +"پارسر هنگام ساخت پیام‌ها استفاده می‌شود. پیش‌فرض آن ``None`` است، که در " +"این صورت از :class:`~email.message.Message` استفاده می‌شود." -msgid "If ``True`` (the default), the generator will raise :exc:`~email.errors.HeaderWriteError` instead of writing a header that is improperly folded or delimited, such that it would be parsed as multiple headers or joined with adjacent data. Such headers can be generated by custom header classes or bugs in the ``email`` module." -msgstr "" +msgid "" +"If ``True`` (the default), the generator will " +"raise :exc:`~email.errors.HeaderWriteError` instead of writing a header " +"that is improperly folded or delimited, such that it would be parsed as " +"multiple headers or joined with adjacent data. Such headers can be " +"generated by custom header classes or bugs in the ``email`` module." +msgstr "" +"اگر ``True`` باشد (پیش‌فرض)، تولیدگر به‌جای نوشتن سرآیندی که به‌شکل نادرست " +"تاخورده یا مرزبندی‌شده است، به‌گونه‌ای که به‌عنوان چند سرآیند تجزیه شود یا با " +"داده‌های مجاور ادغام گردد، :exc:`~email.errors.HeaderWriteError` را پرتاب " +"می‌کند. چنین سرآیندهایی ممکن است توسط کلاس‌های سرآیند سفارشی یا به‌دلیل اشکالات " +"ماژول ``email`` تولید شوند." -msgid "As it's a security feature, this defaults to ``True`` even in the :class:`~email.policy.Compat32` policy. For backwards compatible, but unsafe, behavior, it must be set to ``False`` explicitly." +msgid "" +"As it's a security feature, this defaults to ``True`` even in " +"the :class:`~email.policy.Compat32` policy. For backwards compatible, but " +"unsafe, behavior, it must be set to ``False`` explicitly." msgstr "" +"از آنجا که این یک ویژگی امنیتی است، مقدار پیش‌فرض آن حتی در " +"سیاست :class:`~email.policy.Compat32` برابر ``True`` است. برای رفتار سازگار " +"با عقب‌گرد، اما ناامن، باید به‌صراحت روی ``False`` تنظیم شود." -msgid "The following :class:`Policy` method is intended to be called by code using the email library to create policy instances with custom settings:" +msgid "" +"The following :class:`Policy` method is intended to be called by code using " +"the email library to create policy instances with custom settings:" msgstr "" +"متد :class:`Policy` زیر برای فراخوانی توسط کدی در نظر گرفته شده است که از " +"کتابخانه email برای ایجاد نمونه‌های سیاست با تنظیمات سفارشی استفاده می‌کند:" -msgid "Return a new :class:`Policy` instance whose attributes have the same values as the current instance, except where those attributes are given new values by the keyword arguments." +msgid "" +"Return a new :class:`Policy` instance whose attributes have the same values " +"as the current instance, except where those attributes are given new values " +"by the keyword arguments." msgstr "" +"یک نمونه جدید از :class:`Policy` برمی‌گرداند که ویژگی‌های آن مقادیری مشابه " +"مقادیر نمونه فعلی دارند، مگر در مواردی که مقادیر جدیدی به آن ویژگی‌ها توسط " +"آرگومان‌های کلیدواژه‌ای داده شده باشد." -msgid "The remaining :class:`Policy` methods are called by the email package code, and are not intended to be called by an application using the email package. A custom policy must implement all of these methods." +msgid "" +"The remaining :class:`Policy` methods are called by the email package code, " +"and are not intended to be called by an application using the email " +"package. A custom policy must implement all of these methods." msgstr "" +"متدهای باقی‌مانده‌ی :class:`Policy` توسط کد بسته‌ی email فراخوانی می‌شوند و برای " +"فراخوانی توسط برنامه‌ای که از بسته‌ی email استفاده می‌کند، در نظر گرفته " +"نشده‌اند. یک سیاست سفارشی باید تمام این متدها را پیاده‌سازی کند." -msgid "Handle a *defect* found on *obj*. When the email package calls this method, *defect* will always be a subclass of :class:`~email.errors.MessageDefect`." +msgid "" +"Handle a *defect* found on *obj*. When the email package calls this " +"method, *defect* will always be a subclass " +"of :class:`~email.errors.MessageDefect`." msgstr "" +"یک *defect* یافت‌شده در *obj* را مدیریت کنید. وقتی بسته‌ی email این متد را " +"فراخوانی می‌کند، *defect* همواره یک زیرکلاس " +"از :class:`~email.errors.MessageDefect` خواهد بود." -msgid "The default implementation checks the :attr:`raise_on_defect` flag. If it is ``True``, *defect* is raised as an exception. If it is ``False`` (the default), *obj* and *defect* are passed to :meth:`register_defect`." +msgid "" +"The default implementation checks the :attr:`raise_on_defect` flag. If it " +"is ``True``, *defect* is raised as an exception. If it is ``False`` (the " +"default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" +"پیاده‌سازی پیش‌فرض، پرچم :attr:`raise_on_defect` را بررسی می‌کند. اگر ``True`` " +"باشد، *defect* به‌عنوان یک استثنا پرتاب می‌شود. اگر ``False`` باشد (حالت " +"پیش‌فرض)، *obj* و *defect* به :meth:`register_defect` ارسال می‌شوند." -msgid "Register a *defect* on *obj*. In the email package, *defect* will always be a subclass of :class:`~email.errors.MessageDefect`." +msgid "" +"Register a *defect* on *obj*. In the email package, *defect* will always " +"be a subclass of :class:`~email.errors.MessageDefect`." msgstr "" +"یک *defect* را روی *obj* ثبت کنید. در بسته‌ی email، *defect* همواره زیرکلاسی " +"از :class:`~email.errors.MessageDefect` خواهد بود." -msgid "The default implementation calls the ``append`` method of the ``defects`` attribute of *obj*. When the email package calls :attr:`handle_defect`, *obj* will normally have a ``defects`` attribute that has an ``append`` method. Custom object types used with the email package (for example, custom ``Message`` objects) should also provide such an attribute, otherwise defects in parsed messages will raise unexpected errors." -msgstr "" +msgid "" +"The default implementation calls the ``append`` method of the ``defects`` " +"attribute of *obj*. When the email package calls :attr:`handle_defect`, " +"*obj* will normally have a ``defects`` attribute that has an ``append`` " +"method. Custom object types used with the email package (for example, " +"custom ``Message`` objects) should also provide such an attribute, " +"otherwise defects in parsed messages will raise unexpected errors." +msgstr "" +"پیاده‌سازی پیش‌فرض، متد ``append`` ویژگی ``defects`` متعلق به *obj* را " +"فراخوانی می‌کند. هنگامی که بسته email، :attr:`handle_defect` را فراخوانی " +"می‌کند، *obj* معمولاً دارای یک ویژگی ``defects`` خواهد بود که متد ``append`` " +"دارد. انواع اشیاء سفارشی که با بسته email استفاده می‌شوند (برای مثال، اشیاء " +"``Message`` سفارشی) نیز باید چنین ویژگی‌ای را فراهم کنند، در غیر این صورت " +"نقص‌های موجود در پیام‌های تجزیه‌شده باعث پرتاب خطاهای غیرمنتظره‌ای خواهند شد." msgid "Return the maximum allowed number of headers named *name*." -msgstr "" +msgstr "بیشینه تعداد مجاز سرآیندهایی با نام *name* را برمی‌گرداند." -msgid "Called when a header is added to an :class:`~email.message.EmailMessage` or :class:`~email.message.Message` object. If the returned value is not ``0`` or ``None``, and there are already a number of headers with the name *name* greater than or equal to the value returned, a :exc:`ValueError` is raised." -msgstr "" +msgid "" +"Called when a header is added to an :class:`~email.message.EmailMessage` " +"or :class:`~email.message.Message` object. If the returned value is not " +"``0`` or ``None``, and there are already a number of headers with the name " +"*name* greater than or equal to the value returned, a :exc:`ValueError` is " +"raised." +msgstr "" +"هنگامی که یک سرآیند به یک شیء :class:`~email.message.EmailMessage` " +"یا :class:`~email.message.Message` اضافه شود، فراخوانی می‌شود. اگر مقدار " +"بازگشتی ``0`` یا ``None`` نباشد، و تعداد سرآیندهایی که از قبل با نام *name* " +"وجود دارند، بزرگ‌تر یا مساوی با مقدار بازگشتی باشد، یک :exc:`ValueError` " +"پرتاب می‌شود." -msgid "Because the default behavior of ``Message.__setitem__`` is to append the value to the list of headers, it is easy to create duplicate headers without realizing it. This method allows certain headers to be limited in the number of instances of that header that may be added to a ``Message`` programmatically. (The limit is not observed by the parser, which will faithfully produce as many headers as exist in the message being parsed.)" -msgstr "" +msgid "" +"Because the default behavior of ``Message.__setitem__`` is to append the " +"value to the list of headers, it is easy to create duplicate headers " +"without realizing it. This method allows certain headers to be limited in " +"the number of instances of that header that may be added to a ``Message`` " +"programmatically. (The limit is not observed by the parser, which will " +"faithfully produce as many headers as exist in the message being parsed.)" +msgstr "" +"از آن‌جا که رفتار پیش‌فرض ``Message.__setitem__`` افزودن مقدار به فهرست " +"سرآیندها است، ایجاد سرآیندهای تکراری بدون این‌که متوجه شوید، آسان است. این متد " +"به شما امکان می‌دهد تعداد نمونه‌هایی از برخی سرآیندها را که می‌توانند به‌صورت " +"برنامه‌ای به یک ``Message`` اضافه شوند، محدود کنید. (این محدودیت توسط " +"پارسر رعایت نمی‌شود؛ پارسر با امانت‌داری همان تعداد سرآیندی را که در پیام " +"در حال تجزیه وجود دارد، تولید می‌کند.)" msgid "The default implementation returns ``None`` for all header names." -msgstr "" +msgstr "پیاده‌سازی پیش‌فرض برای همه‌ی نام‌های سرآیند ``None`` را برمی‌گرداند." -msgid "The email package calls this method with a list of strings, each string ending with the line separation characters found in the source being parsed. The first line includes the field header name and separator. All whitespace in the source is preserved. The method should return the ``(name, value)`` tuple that is to be stored in the ``Message`` to represent the parsed header." -msgstr "" +msgid "" +"The email package calls this method with a list of strings, each string " +"ending with the line separation characters found in the source being " +"parsed. The first line includes the field header name and separator. All " +"whitespace in the source is preserved. The method should return the " +"``(name, value)`` tuple that is to be stored in the ``Message`` to " +"represent the parsed header." +msgstr "" +"بسته‌ی email این متد را با فهرستی از رشته‌ها فراخوانی می‌کند، که هر رشته با " +"نویسه‌های جداکننده‌ی خط موجود در منبع در حال تجزیه پایان می‌یابد. خط اول شامل " +"نام فیلد سرآیند و جداکننده است. تمام فضای خالی موجود در منبع حفظ می‌شود. این " +"متد باید تاپل ``(name, value)`` را برگرداند که قرار است در ``Message`` " +"ذخیره شود تا سرآیند تجزیه‌شده را نشان دهد." -msgid "If an implementation wishes to retain compatibility with the existing email package policies, *name* should be the case preserved name (all characters up to the '``:``' separator), while *value* should be the unfolded value (all line separator characters removed, but whitespace kept intact), stripped of leading whitespace." -msgstr "" +msgid "" +"If an implementation wishes to retain compatibility with the existing email " +"package policies, *name* should be the case preserved name (all characters " +"up to the '``:``' separator), while *value* should be the unfolded value " +"(all line separator characters removed, but whitespace kept intact), " +"stripped of leading whitespace." +msgstr "" +"اگر یک پیاده‌سازی بخواهد سازگاری با سیاست‌های موجود بسته email را حفظ کند، " +"*name* باید نام با حفظ بزرگی و کوچکی حروف باشد (همه نویسه‌ها تا پیش از " +"جداکننده '``:``')، در حالی که *value* باید مقدار بازشده باشد (همه نویسه‌های " +"جداکننده خط حذف شده‌اند، اما فضای سفید دست‌نخورده باقی مانده است) و فضای سفید " +"ابتدایی آن حذف شده باشد." msgid "*sourcelines* may contain surrogateescaped binary data." -msgstr "" +msgstr "*sourcelines* ممکن است حاوی داده‌های دودویی surrogateescaped باشد." msgid "There is no default implementation" -msgstr "" +msgstr "هیچ پیاده‌سازی پیش‌فرضی وجود ندارد" -msgid "The email package calls this method with the name and value provided by the application program when the application program is modifying a ``Message`` programmatically (as opposed to a ``Message`` created by a parser). The method should return the ``(name, value)`` tuple that is to be stored in the ``Message`` to represent the header." -msgstr "" +msgid "" +"The email package calls this method with the name and value provided by the " +"application program when the application program is modifying a ``Message`` " +"programmatically (as opposed to a ``Message`` created by a parser). The " +"method should return the ``(name, value)`` tuple that is to be stored in " +"the ``Message`` to represent the header." +msgstr "" +"بسته‌ی email این متد را با نام و مقدار ارائه‌شده توسط برنامه‌ی کاربردی، هنگامی " +"که برنامه‌ی کاربردی در حال تغییر یک ``Message`` به‌صورت برنامه‌ای است (در مقابل " +"یک ``Message`` که توسط یک پارسر ایجاد شده است)، فراخوانی می‌کند. این متد " +"باید تاپل ``(name, value)`` را که قرار است در ``Message`` ذخیره شود تا " +"نشان‌دهنده‌ی سرآیند باشد، برگرداند." -msgid "If an implementation wishes to retain compatibility with the existing email package policies, the *name* and *value* should be strings or string subclasses that do not change the content of the passed in arguments." +msgid "" +"If an implementation wishes to retain compatibility with the existing email " +"package policies, the *name* and *value* should be strings or string " +"subclasses that do not change the content of the passed in arguments." msgstr "" +"اگر یک پیاده‌سازی بخواهد سازگاری با سیاست‌های موجود در بسته email را حفظ کند، " +"*name* و *value* باید رشته‌ها یا زیرکلاس‌های رشته باشند که محتوای آرگومان‌های " +"داده‌شده را تغییر نمی‌دهند." -msgid "The email package calls this method with the *name* and *value* currently stored in the ``Message`` when that header is requested by the application program, and whatever the method returns is what is passed back to the application as the value of the header being retrieved. Note that there may be more than one header with the same name stored in the ``Message``; the method is passed the specific name and value of the header destined to be returned to the application." -msgstr "" +msgid "" +"The email package calls this method with the *name* and *value* currently " +"stored in the ``Message`` when that header is requested by the application " +"program, and whatever the method returns is what is passed back to the " +"application as the value of the header being retrieved. Note that there may " +"be more than one header with the same name stored in the ``Message``; the " +"method is passed the specific name and value of the header destined to be " +"returned to the application." +msgstr "" +"بسته‌ی email این متد را هنگامی که برنامه کاربردی آن سرآیند را درخواست کند، با " +"*name* و *value* ذخیره‌شده در ``Message`` فراخوانی می‌کند، و هر آنچه این متد " +"برمی‌گرداند، همان چیزی است که به‌عنوان مقدار سرآیندی که واکشی می‌شود، به برنامه " +"کاربردی بازگردانده می‌شود. توجه داشته باشید که ممکن است بیش از یک سرآیند با " +"نام یکسان در ``Message`` ذخیره‌شده باشد؛ به این متد نام و مقدار مشخص سرآیندی " +"که قرار است به برنامه کاربردی بازگردانده شود، داده می‌شود." -msgid "*value* may contain surrogateescaped binary data. There should be no surrogateescaped binary data in the value returned by the method." +msgid "" +"*value* may contain surrogateescaped binary data. There should be no " +"surrogateescaped binary data in the value returned by the method." msgstr "" +"ممکن است *value* حاوی داده‌های دودویی surrogateescaped باشد. نباید هیچ داده‌ی " +"دودویی surrogateescaped در مقداری که متد برمی‌گرداند وجود داشته باشد." -msgid "The email package calls this method with the *name* and *value* currently stored in the ``Message`` for a given header. The method should return a string that represents that header \"folded\" correctly (according to the policy settings) by composing the *name* with the *value* and inserting :attr:`linesep` characters at the appropriate places. See :rfc:`5322` for a discussion of the rules for folding email headers." -msgstr "" +msgid "" +"The email package calls this method with the *name* and *value* currently " +"stored in the ``Message`` for a given header. The method should return a " +"string that represents that header \"folded\" correctly (according to the " +"policy settings) by composing the *name* with the *value* and " +"inserting :attr:`linesep` characters at the appropriate places. " +"See :rfc:`5322` for a discussion of the rules for folding email headers." +msgstr "" +"بسته‌ی email این متد را با *name* و *value* که در حال حاضر در ``Message`` " +"برای یک سرآیند مشخص ذخیره شده‌اند، فراخوانی می‌کند. این متد باید با ترکیب " +"*name* با *value* و درج نویسه‌های :attr:`linesep` در محل‌های مناسب، رشته‌ای " +"برگرداند که آن سرآیند را به‌درستی به‌صورت «تا شده (folded)» (بر اساس تنظیمات " +"سیاست) نشان می‌دهد. برای بحث درباره‌ی قوانین تا کردن (folding) سرآیندهای " +"ایمیل، :rfc:`5322` را ببینید." -msgid "*value* may contain surrogateescaped binary data. There should be no surrogateescaped binary data in the string returned by the method." +msgid "" +"*value* may contain surrogateescaped binary data. There should be no " +"surrogateescaped binary data in the string returned by the method." msgstr "" +"*value* ممکن است حاوی داده‌های دودویی surrogateescaped باشد. رشته‌ای که این " +"متد برمی‌گرداند نباید حاوی داده‌های دودویی surrogateescaped باشد." -msgid "The same as :meth:`fold`, except that the returned value should be a bytes object rather than a string." +msgid "" +"The same as :meth:`fold`, except that the returned value should be a bytes " +"object rather than a string." msgstr "" +"مشابه :meth:`fold`، با این تفاوت که مقدار بازگشتی باید به جای یک رشته، یک " +"شیء بایتی (bytes) باشد." -msgid "*value* may contain surrogateescaped binary data. These could be converted back into binary data in the returned bytes object." +msgid "" +"*value* may contain surrogateescaped binary data. These could be converted " +"back into binary data in the returned bytes object." msgstr "" +"*value* ممکن است حاوی داده‌های دودویی surrogateescaped باشد. این داده‌ها " +"می‌توانند در شیء bytes برگردانده‌شده دوباره به داده‌های دودویی تبدیل شوند." -msgid "This concrete :class:`Policy` provides behavior that is intended to be fully compliant with the current email RFCs. These include (but are not limited to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." +msgid "" +"This concrete :class:`Policy` provides behavior that is intended to be " +"fully compliant with the current email RFCs. These include (but are not " +"limited to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" +"این :class:`Policy` ملموس، رفتاری را فراهم می‌کند که هدف آن انطباق کامل با " +"RFCهای فعلی ایمیل است. این RFCها شامل (اما نه محدود " +"به) :rfc:`5322`، :rfc:`2047` و RFCهای فعلی MIME هستند." -msgid "This policy adds new header parsing and folding algorithms. Instead of simple strings, headers are ``str`` subclasses with attributes that depend on the type of the field. The parsing and folding algorithm fully implement :rfc:`2047` and :rfc:`5322`." +msgid "" +"This policy adds new header parsing and folding algorithms. Instead of " +"simple strings, headers are ``str`` subclasses with attributes that depend " +"on the type of the field. The parsing and folding algorithm fully " +"implement :rfc:`2047` and :rfc:`5322`." msgstr "" +"این سیاست الگوریتم‌های جدیدی برای تجزیه (parsing) و تا کردن (folding) " +"سرصفحه‌ها اضافه می‌کند. به‌جای رشته‌های ساده، سرصفحه‌ها زیرکلاس‌هایی از ``str`` " +"هستند که ویژگی‌هایی وابسته به نوع فیلد دارند. الگوریتم تجزیه و تا " +"کردن، :rfc:`2047` و :rfc:`5322` را به‌طور کامل پیاده‌سازی می‌کند." -msgid "The default value for the :attr:`~email.policy.Policy.message_factory` attribute is :class:`~email.message.EmailMessage`." +msgid "" +"The default value for the :attr:`~email.policy.Policy.message_factory` " +"attribute is :class:`~email.message.EmailMessage`." msgstr "" +"مقدار پیش‌فرض برای " +"ویژگی :attr:`~email.policy.Policy.message_factory`، :class:`~email.message.EmailMessage` " +"است." -msgid "In addition to the settable attributes listed above that apply to all policies, this policy adds the following additional attributes:" +msgid "" +"In addition to the settable attributes listed above that apply to all " +"policies, this policy adds the following additional attributes:" msgstr "" +"علاوه بر ویژگی‌های قابل تنظیم فهرست‌شده در بالا که به همه‌ی سیاست‌ها اعمال " +"می‌شوند، این سیاست ویژگی‌های اضافی زیر را اضافه می‌کند:" msgid "[1]_" -msgstr "" +msgstr "[1]_" -msgid "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and use ``utf-8`` encoding for headers. Messages formatted in this way may be passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." -msgstr "" +msgid "" +"If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in " +"headers by encoding them as \"encoded words\". If ``True``, " +"follow :rfc:`6532` and use ``utf-8`` encoding for headers. Messages " +"formatted in this way may be passed to SMTP servers that support the " +"``SMTPUTF8`` extension (:rfc:`6531`)." +msgstr "" +"اگر ``False`` باشد، از :rfc:`5322` پیروی می‌کند و با کدگذاری نویسه‌های غیر " +"ASCII موجود در سرآیندها به‌عنوان «کلمات کدگذاری‌شده»، از آن‌ها پشتیبانی می‌کند. " +"اگر ``True`` باشد، از :rfc:`6532` پیروی می‌کند و برای سرآیندها از کدگذاری " +"``utf-8`` استفاده می‌کند. پیام‌هایی که به این شکل قالب‌بندی شده‌اند، می‌توانند " +"به سرورهای SMTP که از افزونه ``SMTPUTF8`` پشتیبانی می‌کنند (:rfc:`6531`) " +"ارسال شوند." -msgid "If the value for a header in the ``Message`` object originated from a :mod:`~email.parser` (as opposed to being set by a program), this attribute indicates whether or not a generator should refold that value when transforming the message back into serialized form. The possible values are:" +msgid "" +"If the value for a header in the ``Message`` object originated from " +"a :mod:`~email.parser` (as opposed to being set by a program), this " +"attribute indicates whether or not a generator should refold that value " +"when transforming the message back into serialized form. The possible " +"values are:" msgstr "" +"اگر مقدار یک سرآیند در شیء ``Message`` از :mod:`~email.parser` آمده باشد (در " +"مقابل تنظیم شدن توسط یک برنامه)، این ویژگی نشان می‌دهد که آیا یک تولیدگر " +"باید آن مقدار را هنگام بازگرداندن پیام به قالب سریالی‌شده دوباره تا بزند " +"(refold) یا خیر. مقادیر ممکن عبارت‌اند از:" msgid "``none``" -msgstr "" +msgstr "``none``" msgid "all source values use original folding" -msgstr "" +msgstr "همه‌ی مقادیر منبع از تا کردن (folding) اصلی استفاده می‌کنند" msgid "``long``" -msgstr "" +msgstr "``long``" -msgid "source values that have any line that is longer than ``max_line_length`` will be refolded" +msgid "" +"source values that have any line that is longer than ``max_line_length`` " +"will be refolded" msgstr "" +"مقادیر مبدأ که هر یک از خط‌هایشان طولانی‌تر از ``max_line_length`` باشد، " +"دوباره تا خواهند شد" msgid "``all``" -msgstr "" +msgstr "``all``" msgid "all values are refolded." -msgstr "" +msgstr "تمام مقادیر دوباره تا می‌شوند." msgid "The default is ``long``." -msgstr "" +msgstr "مقدار پیش‌فرض ``long`` است." -msgid "A callable that takes two arguments, ``name`` and ``value``, where ``name`` is a header field name and ``value`` is an unfolded header field value, and returns a string subclass that represents that header. A default ``header_factory`` (see :mod:`~email.headerregistry`) is provided that supports custom parsing for the various address and date :RFC:`5322` header field types, and the major MIME header field stypes. Support for additional custom parsing will be added in the future." -msgstr "" +msgid "" +"A callable that takes two arguments, ``name`` and ``value``, where ``name`` " +"is a header field name and ``value`` is an unfolded header field value, and " +"returns a string subclass that represents that header. A default " +"``header_factory`` (see :mod:`~email.headerregistry`) is provided that " +"supports custom parsing for the various address and date :RFC:`5322` header " +"field types, and the major MIME header field stypes. Support for " +"additional custom parsing will be added in the future." +msgstr "" +"یک شیء فراخوان‌پذیر که دو آرگومان ``name`` و ``value`` را می‌گیرد؛ در اینجا " +"``name`` نام فیلد سرآیند و ``value`` مقدار فیلد سرآیند بازشده (unfolded) است، " +"و نمونه‌ای از یک زیرکلاس رشته را برمی‌گرداند که نمایانگر آن سرآیند است. یک " +"``header_factory`` پیش‌فرض (به :mod:`~email.headerregistry` مراجعه کنید) " +"فراهم شده است که از تجزیه سفارشی برای انواع مختلف فیلد سرآیند نشانی و " +"تاریخ :RFC:`5322` و انواع اصلی فیلد سرآیند MIME پشتیبانی می‌کند. پشتیبانی از " +"تجزیه سفارشی بیشتر در آینده افزوده خواهد شد." -msgid "An object with at least two methods: get_content and set_content. When the :meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message.EmailMessage.set_content` method of an :class:`~email.message.EmailMessage` object is called, it calls the corresponding method of this object, passing it the message object as its first argument, and any arguments or keywords that were passed to it as additional arguments. By default ``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." -msgstr "" +msgid "" +"An object with at least two methods: get_content and set_content. When " +"the :meth:`~email.message.EmailMessage.get_content` " +"or :meth:`~email.message.EmailMessage.set_content` method of " +"an :class:`~email.message.EmailMessage` object is called, it calls the " +"corresponding method of this object, passing it the message object as its " +"first argument, and any arguments or keywords that were passed to it as " +"additional arguments. By default ``content_manager`` is set " +"to :data:`~email.contentmanager.raw_data_manager`." +msgstr "" +"یک شیء با حداقل دو متد: get_content و set_content. هنگامی که " +"متد :meth:`~email.message.EmailMessage.get_content` " +"یا :meth:`~email.message.EmailMessage.set_content` از یک " +"شیء :class:`~email.message.EmailMessage` فراخوانی می‌شود، متد متناظر این شیء " +"را فراخوانی می‌کند و شیء پیام را به‌عنوان اولین آرگومان آن و هر آرگومان یا " +"کلیدواژه‌ای را که به آن ارسال شده است، به‌عنوان آرگومان‌های اضافی به آن منتقل " +"می‌کند. به‌طور پیش‌فرض ``content_manager`` " +"روی :data:`~email.contentmanager.raw_data_manager` تنظیم شده است." -msgid "The class provides the following concrete implementations of the abstract methods of :class:`Policy`:" +msgid "" +"The class provides the following concrete implementations of the abstract " +"methods of :class:`Policy`:" msgstr "" +"این کلاس پیاده‌سازی‌های عینی زیر را برای متدهای انتزاعی :class:`Policy` ارائه " +"می‌دهد:" -msgid "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` attribute of the specialized class used to represent the header with the given name." +msgid "" +"Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " +"attribute of the specialized class used to represent the header with the " +"given name." msgstr "" +"مقدار ویژگی :attr:`~email.headerregistry.BaseHeader.max_count` کلاس تخصصی " +"استفاده‌شده برای نمایش سرآیند با نام داده‌شده را برمی‌گرداند." -msgid "The name is parsed as everything up to the '``:``' and returned unmodified. The value is determined by stripping leading whitespace off the remainder of the first line, joining all subsequent lines together, and stripping any trailing carriage return or linefeed characters." +msgid "" +"The name is parsed as everything up to the '``:``' and returned " +"unmodified. The value is determined by stripping leading whitespace off " +"the remainder of the first line, joining all subsequent lines together, and " +"stripping any trailing carriage return or linefeed characters." msgstr "" +"نام به‌عنوان همه‌چیز تا '``:``' تجزیه می‌شود و بدون تغییر بازگردانده می‌شود. " +"مقدار با حذف فضای سفید ابتدایی از باقی‌مانده خط اول، به هم پیوستن تمام خطوط " +"بعدی و حذف هرگونه نویسه بازگشت به ابتدای سطر یا خط جدید در انتها تعیین می‌شود." -msgid "The name is returned unchanged. If the input value has a ``name`` attribute and it matches *name* ignoring case, the value is returned unchanged. Otherwise the *name* and *value* are passed to ``header_factory``, and the resulting header object is returned as the value. In this case a ``ValueError`` is raised if the input value contains CR or LF characters." -msgstr "" +msgid "" +"The name is returned unchanged. If the input value has a ``name`` " +"attribute and it matches *name* ignoring case, the value is returned " +"unchanged. Otherwise the *name* and *value* are passed to " +"``header_factory``, and the resulting header object is returned as the " +"value. In this case a ``ValueError`` is raised if the input value contains " +"CR or LF characters." +msgstr "" +"نام بدون تغییر بازگردانده می‌شود. اگر مقدار ورودی دارای ویژگی ``name`` باشد " +"و آن با *name* بدون در نظر گرفتن بزرگی و کوچکی حروف مطابقت داشته باشد، " +"مقدار بدون تغییر بازگردانده می‌شود. در غیر این صورت *name* و *value* به " +"``header_factory`` داده می‌شوند و شیء سرآیند حاصل به‌عنوان مقدار بازگردانده " +"می‌شود. در این حالت اگر مقدار ورودی شامل نویسه‌های CR یا LF باشد، یک " +"``ValueError`` پرتاب می‌شود." -msgid "If the value has a ``name`` attribute, it is returned to unmodified. Otherwise the *name*, and the *value* with any CR or LF characters removed, are passed to the ``header_factory``, and the resulting header object is returned. Any surrogateescaped bytes get turned into the unicode unknown-character glyph." +msgid "" +"If the value has a ``name`` attribute, it is returned to unmodified. " +"Otherwise the *name*, and the *value* with any CR or LF characters removed, " +"are passed to the ``header_factory``, and the resulting header object is " +"returned. Any surrogateescaped bytes get turned into the unicode unknown-" +"character glyph." msgstr "" +"اگر مقدار دارای ویژگی ``name`` باشد، بدون تغییر بازگردانده می‌شود. در غیر " +"این صورت، *name* و *value*، پس از حذف هرگونه نویسه CR یا LF از مقدار، به " +"``header_factory`` فرستاده می‌شوند و شیء سرآیند حاصل بازگردانده می‌شود. " +"بایت‌های surrogateescaped به علامت نویسه‌ی ناشناخته‌ی یونیکد تبدیل می‌شوند." -msgid "Header folding is controlled by the :attr:`refold_source` policy setting. A value is considered to be a 'source value' if and only if it does not have a ``name`` attribute (having a ``name`` attribute means it is a header object of some sort). If a source value needs to be refolded according to the policy, it is converted into a header object by passing the *name* and the *value* with any CR and LF characters removed to the ``header_factory``. Folding of a header object is done by calling its ``fold`` method with the current policy." -msgstr "" +msgid "" +"Header folding is controlled by the :attr:`refold_source` policy setting. A " +"value is considered to be a 'source value' if and only if it does not have " +"a ``name`` attribute (having a ``name`` attribute means it is a header " +"object of some sort). If a source value needs to be refolded according to " +"the policy, it is converted into a header object by passing the *name* and " +"the *value* with any CR and LF characters removed to the " +"``header_factory``. Folding of a header object is done by calling its " +"``fold`` method with the current policy." +msgstr "" +"تا کردن سرصفحه با تنظیم سیاست :attr:`refold_source` کنترل می‌شود. یک مقدار " +"اگر و تنها اگر ویژگی ``name`` نداشته باشد، یک «مقدار منبع» در نظر گرفته " +"می‌شود (داشتن ویژگی ``name`` به این معناست که آن مقدار به نوعی یک شیء سرصفحه " +"است). اگر یک مقدار منبع نیاز داشته باشد طبق سیاست دوباره تا شود، با ارسال " +"*name* و *value* به ``header_factory`` — پس از حذف همه نویسه‌های CR و LF — " +"به یک شیء سرصفحه تبدیل می‌شود. تا کردن یک شیء سرصفحه با فراخوانی متد " +"``fold`` آن با سیاست جاری انجام می‌شود." -msgid "Source values are split into lines using :meth:`~str.splitlines`. If the value is not to be refolded, the lines are rejoined using the ``linesep`` from the policy and returned. The exception is lines containing non-ascii binary data. In that case the value is refolded regardless of the ``refold_source`` setting, which causes the binary data to be CTE encoded using the ``unknown-8bit`` charset." -msgstr "" +msgid "" +"Source values are split into lines using :meth:`~str.splitlines`. If the " +"value is not to be refolded, the lines are rejoined using the ``linesep`` " +"from the policy and returned. The exception is lines containing non-ascii " +"binary data. In that case the value is refolded regardless of the " +"``refold_source`` setting, which causes the binary data to be CTE encoded " +"using the ``unknown-8bit`` charset." +msgstr "" +"مقادیر منبع با استفاده از :meth:`~str.splitlines` به خطوط تقسیم می‌شوند. اگر " +"قرار نباشد مقدار دوباره تا شود، خطوط با استفاده از ``linesep`` از سیاست " +"دوباره به هم پیوسته و برگردانده می‌شوند. استثنا، خطوطی هستند که حاوی داده‌های " +"دودویی غیر ASCII هستند. در این صورت، مقدار صرف‌نظر از تنظیم " +"``refold_source`` دوباره تا می‌شود که باعث می‌شود داده‌های دودویی با استفاده " +"از مجموعه‌نویسه ``unknown-8bit`` به‌صورت CTE کدگذاری شوند." -msgid "The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except that the returned value is bytes." +msgid "" +"The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " +"that the returned value is bytes." msgstr "" +"اگر :attr:`~Policy.cte_type` برابر ``7bit`` باشد، همانند :meth:`fold` است، " +"با این تفاوت که مقدار بازگشتی bytes است." -msgid "If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted back into bytes. Headers with binary data are not refolded, regardless of the ``refold_header`` setting, since there is no way to know whether the binary data consists of single byte characters or multibyte characters." +msgid "" +"If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " +"back into bytes. Headers with binary data are not refolded, regardless of " +"the ``refold_header`` setting, since there is no way to know whether the " +"binary data consists of single byte characters or multibyte characters." msgstr "" +"اگر :attr:`~Policy.cte_type` برابر ``8bit`` باشد، داده دودویی غیر ASCII به " +"بایت‌ها بازگردانده می‌شود. سرصفحه‌های حاوی داده دودویی، صرف‌نظر از تنظیم " +"``refold_header``، دوباره تا زده نمی‌شوند، زیرا هیچ راهی برای دانستن اینکه " +"داده دودویی از نویسه‌های تک‌بایتی تشکیل شده است یا نویسه‌های چندبایتی، وجود " +"ندارد." -msgid "The following instances of :class:`EmailPolicy` provide defaults suitable for specific application domains. Note that in the future the behavior of these instances (in particular the ``HTTP`` instance) may be adjusted to conform even more closely to the RFCs relevant to their domains." +msgid "" +"The following instances of :class:`EmailPolicy` provide defaults suitable " +"for specific application domains. Note that in the future the behavior of " +"these instances (in particular the ``HTTP`` instance) may be adjusted to " +"conform even more closely to the RFCs relevant to their domains." msgstr "" +"نمونه‌های زیر از :class:`EmailPolicy` پیش‌فرض‌هایی مناسب برای حوزه‌های کاربردی " +"خاص فراهم می‌کنند. توجه داشته باشید که در آینده ممکن است رفتار این نمونه‌ها " +"(به‌ویژه نمونه ``HTTP``) تنظیم شود تا حتی نزدیک‌تر با RFCهای مرتبط با " +"حوزه‌هایشان انطباق داشته باشد." -msgid "An instance of ``EmailPolicy`` with all defaults unchanged. This policy uses the standard Python ``\\n`` line endings rather than the RFC-correct ``\\r\\n``." +msgid "" +"An instance of ``EmailPolicy`` with all defaults unchanged. This policy " +"uses the standard Python ``\\n`` line endings rather than the RFC-correct " +"``\\r\\n``." msgstr "" +"نمونه‌ای از ``EmailPolicy`` که تمام پیش‌فرض‌های آن بدون تغییر هستند. این سیاست " +"به‌جای پایان خط‌های ``\\r\\n`` مطابق RFC، از پایان خط‌های ``\\n`` استاندارد " +"پایتون استفاده می‌کند." -msgid "Suitable for serializing messages in conformance with the email RFCs. Like ``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." +msgid "" +"Suitable for serializing messages in conformance with the email RFCs. Like " +"``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" +"مناسب برای سریال‌سازی پیام‌ها مطابق با RFCهای ایمیل. مانند ``default``، اما " +"با ``linesep`` تنظیم‌شده روی ``\\r\\n``، که مطابق با RFC است." -msgid "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. Useful for serializing messages to a message store without using encoded words in the headers. Should only be used for SMTP transmission if the sender or recipient addresses have non-ASCII characters (the :meth:`smtplib.SMTP.send_message` method handles this automatically)." -msgstr "" +msgid "" +"The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " +"Useful for serializing messages to a message store without using encoded " +"words in the headers. Should only be used for SMTP transmission if the " +"sender or recipient addresses have non-ASCII characters " +"(the :meth:`smtplib.SMTP.send_message` method handles this automatically)." +msgstr "" +"مانند ``SMTP`` است، با این تفاوت که :attr:`~EmailPolicy.utf8` برابر " +"``True`` است. برای سریال‌سازی پیام‌ها به یک مخزن پیام بدون استفاده از واژه‌های " +"کدگذاری‌شده در سرآیندها مفید است. فقط باید زمانی برای انتقال از طریق SMTP از " +"آن استفاده شود که آدرس‌های فرستنده یا گیرنده دارای نویسه‌های غیرASCII باشند " +"(متد :meth:`smtplib.SMTP.send_message` این مورد را به‌طور خودکار مدیریت " +"می‌کند)." -msgid "Suitable for serializing headers with for use in HTTP traffic. Like ``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." +msgid "" +"Suitable for serializing headers with for use in HTTP traffic. Like " +"``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" +"مناسب برای سریال‌سازی سرآیندها جهت استفاده در ترافیک HTTP. مانند ``SMTP``، با " +"این تفاوت که ``max_line_length`` روی ``None`` تنظیم شده است (نامحدود)." -msgid "Convenience instance. The same as ``default`` except that ``raise_on_defect`` is set to ``True``. This allows any policy to be made strict by writing::" +msgid "" +"Convenience instance. The same as ``default`` except that " +"``raise_on_defect`` is set to ``True``. This allows any policy to be made " +"strict by writing::" msgstr "" +"نمونه‌ی سهولت. همان ``default`` است، با این تفاوت که ``raise_on_defect`` روی " +"``True`` تنظیم شده است. این امکان را می‌دهد که هر سیاستی با نوشتن:: " +"سخت‌گیرانه شود" msgid "somepolicy + policy.strict" -msgstr "" +msgstr "somepolicy + policy.strict" -msgid "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API of the email package is changed from the Python 3.2 API in the following ways:" +msgid "" +"With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " +"of the email package is changed from the Python 3.2 API in the following " +"ways:" msgstr "" +"با تمام این :class:`EmailPolicies <.EmailPolicy>`، API مؤثر بسته‌ی email " +"به‌صورت‌های زیر نسبت به API پایتون 3.2 تغییر کرده است:" -msgid "Setting a header on a :class:`~email.message.Message` results in that header being parsed and a header object created." +msgid "" +"Setting a header on a :class:`~email.message.Message` results in that " +"header being parsed and a header object created." msgstr "" +"تنظیم یک سرآیند روی یک :class:`~email.message.Message` باعث می‌شود آن سرآیند " +"تجزیه شود و یک شیء سرآیند ایجاد گردد." -msgid "Fetching a header value from a :class:`~email.message.Message` results in that header being parsed and a header object created and returned." +msgid "" +"Fetching a header value from a :class:`~email.message.Message` results in " +"that header being parsed and a header object created and returned." msgstr "" +"واکشی مقدار یک سرآیند از یک :class:`~email.message.Message` باعث می‌شود آن " +"سرآیند تجزیه شود و یک شیء سرآیند ایجاد و برگردانده شود." -msgid "Any header object, or any header that is refolded due to the policy settings, is folded using an algorithm that fully implements the RFC folding algorithms, including knowing where encoded words are required and allowed." +msgid "" +"Any header object, or any header that is refolded due to the policy " +"settings, is folded using an algorithm that fully implements the RFC " +"folding algorithms, including knowing where encoded words are required and " +"allowed." msgstr "" +"هر شیء سرآیند، یا هر سرآیندی که به‌دلیل تنظیمات سیاست دوباره تا می‌شود، با " +"استفاده از الگوریتمی تا می‌شود که الگوریتم‌های تا کردن (folding) RFC را به‌طور " +"کامل پیاده‌سازی می‌کند، از جمله این‌که می‌داند واژه‌های کدگذاری‌شده در کجا الزامی " +"و مجاز هستند." -msgid "From the application view, this means that any header obtained through the :class:`~email.message.EmailMessage` is a header object with extra attributes, whose string value is the fully decoded unicode value of the header. Likewise, a header may be assigned a new value, or a new header created, using a unicode string, and the policy will take care of converting the unicode string into the correct RFC encoded form." -msgstr "" +msgid "" +"From the application view, this means that any header obtained through " +"the :class:`~email.message.EmailMessage` is a header object with extra " +"attributes, whose string value is the fully decoded unicode value of the " +"header. Likewise, a header may be assigned a new value, or a new header " +"created, using a unicode string, and the policy will take care of " +"converting the unicode string into the correct RFC encoded form." +msgstr "" +"از دید برنامه، این بدان معناست که هر سرآیندی که از " +"طریق :class:`~email.message.EmailMessage` دریافت می‌شود، یک شیء سرآیند با " +"ویژگی‌های اضافی است که مقدار رشته‌ای آن، مقدار یونیکد کاملاً کدگشایی‌شده‌ی سرآیند " +"است. به همین ترتیب، می‌توان با استفاده از یک رشته‌ی یونیکد، مقدار جدیدی به یک " +"سرآیند اختصاص داد یا یک سرآیند جدید ایجاد کرد، و سیاست، تبدیل رشته‌ی یونیکد به " +"قالب صحیح کدگذاری‌شده‌ی RFC را بر عهده خواهد گرفت." -msgid "The header objects and their attributes are described in :mod:`~email.headerregistry`." +msgid "" +"The header objects and their attributes are described " +"in :mod:`~email.headerregistry`." msgstr "" +"اشیای سرآیند و ویژگی‌های آن‌ها در :mod:`~email.headerregistry` شرح داده " +"شده‌اند." -msgid "This concrete :class:`Policy` is the backward compatibility policy. It replicates the behavior of the email package in Python 3.2. The :mod:`!policy` module also defines an instance of this class, :const:`compat32`, that is used as the default policy. Thus the default behavior of the email package is to maintain compatibility with Python 3.2." +msgid "" +"This concrete :class:`Policy` is the backward compatibility policy. It " +"replicates the behavior of the email package in Python 3.2. The :mod:`!" +"policy` module also defines an instance of this class, :const:`compat32`, " +"that is used as the default policy. Thus the default behavior of the email " +"package is to maintain compatibility with Python 3.2." msgstr "" +"این :class:`Policy` عینی، سیاست سازگاری با عقب است. این رفتار بسته‌ی email در " +"Python 3.2 را بازتولید می‌کند. ماژول :mod:`!policy` همچنین یک نمونه از این " +"کلاس، :const:`compat32`، را تعریف می‌کند که به‌عنوان سیاست پیش‌فرض استفاده " +"می‌شود. بنابراین رفتار پیش‌فرض بسته‌ی email، حفظ سازگاری با Python 3.2 است." -msgid "The following attributes have values that are different from the :class:`Policy` default:" -msgstr "" +msgid "" +"The following attributes have values that are different from " +"the :class:`Policy` default:" +msgstr "ویژگی‌های زیر مقادیری متفاوت با پیش‌فرض :class:`Policy` دارند:" msgid "The default is ``True``." -msgstr "" +msgstr "مقدار پیش‌فرض ``True`` است." msgid "The name and value are returned unmodified." -msgstr "" +msgstr "نام و مقدار بدون تغییر بازگردانده می‌شوند." -msgid "If the value contains binary data, it is converted into a :class:`~email.header.Header` object using the ``unknown-8bit`` charset. Otherwise it is returned unmodified." +msgid "" +"If the value contains binary data, it is converted into " +"a :class:`~email.header.Header` object using the ``unknown-8bit`` charset. " +"Otherwise it is returned unmodified." msgstr "" +"اگر مقدار شامل داده‌های دودویی باشد، با استفاده از مجموعه‌نویسه " +"``unknown-8bit`` به یک شیء :class:`~email.header.Header` تبدیل می‌شود. در " +"غیر این صورت، بدون تغییر بازگردانده می‌شود." -msgid "Headers are folded using the :class:`~email.header.Header` folding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to the ``max_line_length``. Non-ASCII binary data are CTE encoded using the ``unknown-8bit`` charset." +msgid "" +"Headers are folded using the :class:`~email.header.Header` folding " +"algorithm, which preserves existing line breaks in the value, and wraps " +"each resulting line to the ``max_line_length``. Non-ASCII binary data are " +"CTE encoded using the ``unknown-8bit`` charset." msgstr "" +"سرآیندها با استفاده از الگوریتم تا کردن (folding) " +"کلاس :class:`~email.header.Header` تا می‌شوند، که شکستگی‌های خط موجود در " +"مقدار را حفظ می‌کند و هر خط حاصل را تا ``max_line_length`` می‌شکند. داده‌های " +"دودویی غیر ASCII با استفاده از نویسه‌گان ``unknown-8bit`` به‌صورت CTE کدگذاری " +"می‌شوند." -msgid "Headers are folded using the :class:`~email.header.Header` folding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to the ``max_line_length``. If ``cte_type`` is ``7bit``, non-ascii binary data is CTE encoded using the ``unknown-8bit`` charset. Otherwise the original source header is used, with its existing line breaks and any (RFC invalid) binary data it may contain." -msgstr "" +msgid "" +"Headers are folded using the :class:`~email.header.Header` folding " +"algorithm, which preserves existing line breaks in the value, and wraps " +"each resulting line to the ``max_line_length``. If ``cte_type`` is " +"``7bit``, non-ascii binary data is CTE encoded using the ``unknown-8bit`` " +"charset. Otherwise the original source header is used, with its existing " +"line breaks and any (RFC invalid) binary data it may contain." +msgstr "" +"سرصفحه‌ها با استفاده از الگوریتم تا کردن (folding) " +"کلاس :class:`~email.header.Header` تا زده می‌شوند، که شکستگی‌های خط موجود در " +"مقدار را حفظ می‌کند و هر خط حاصل را متناسب با ``max_line_length`` می‌شکند. " +"اگر ``cte_type`` برابر ``7bit`` باشد، داده‌های دودویی غیر ASCII به‌صورت CTE و " +"با استفاده از مجموعه‌نویسه‌ی ``unknown-8bit`` کدگذاری می‌شوند. در غیر این صورت، " +"سرصفحه‌ی منبع اصلی، همراه با شکستگی‌های خط موجود و هرگونه داده‌ی دودویی (نامعتبر " +"از نظر RFC) که ممکن است حاوی آن باشد، استفاده می‌شود." -msgid "An instance of :class:`Compat32`, providing backward compatibility with the behavior of the email package in Python 3.2." +msgid "" +"An instance of :class:`Compat32`, providing backward compatibility with " +"the behavior of the email package in Python 3.2." msgstr "" +"یک نمونه از :class:`Compat32`، که سازگاری با عقب را با رفتار بسته‌ی email در " +"Python 3.2 فراهم می‌کند." -msgid "The :const:`compat32` policy should not be used as a policy for :class:`~email.message.EmailMessage` objects, and should only be used to serialize messages that were created using the :const:`compat32` policy." +msgid "" +"The :const:`compat32` policy should not be used as a policy " +"for :class:`~email.message.EmailMessage` objects, and should only be used " +"to serialize messages that were created using the :const:`compat32` policy." msgstr "" +"از سیاست :const:`compat32` نباید به‌عنوان سیاستی برای " +"اشیاء :class:`~email.message.EmailMessage` استفاده شود، و فقط باید برای " +"سریال‌سازی پیام‌هایی استفاده شود که با سیاست :const:`compat32` ایجاد شده‌اند." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Originally added in 3.3 as a :term:`provisional feature `." +msgid "" +"Originally added in 3.3 as a :term:`provisional feature `." msgstr "" +"در ابتدا در 3.3 به‌عنوان یک :term:`ویژگی موقت ` افزوده " +"شد." diff --git a/library/email.utils.po b/library/email.utils.po index 78b475fa0..9c6e9effb 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -24,58 +24,141 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!email.utils`: Miscellaneous utilities" -msgstr "" +msgstr ":mod:`!email.utils`: ابزارهای متفرقه" msgid "**Source code:** :source:`Lib/email/utils.py`" -msgstr "" +msgstr ":source:`Lib/email/utils.py`" -msgid "There are a couple of useful utilities provided in the :mod:`!email.utils` module:" -msgstr "" +msgid "" +"There are a couple of useful utilities provided in the :mod:`!email.utils` " +"module:" +msgstr "در ماژول :mod:`!email.utils` چند ابزار مفید ارائه شده است:" -msgid "Return local time as an aware datetime object. If called without arguments, return current time. Otherwise *dt* argument should be a :class:`~datetime.datetime` instance, and it is converted to the local time zone according to the system time zone database. If *dt* is naive (that is, ``dt.tzinfo`` is ``None``), it is assumed to be in local time." -msgstr "" +msgid "" +"Return local time as an aware datetime object. If called without arguments," +" return current time. Otherwise *dt* argument should be a " +":class:`~datetime.datetime` instance, and it is converted to the local time " +"zone according to the system time zone database. If *dt* is naive (that is," +" ``dt.tzinfo`` is ``None``), it is assumed to be in local time." +msgstr "" +"زمان محلی را به‌صورت یک شیء datetime آگاه (aware) برمی‌گرداند. اگر بدون " +"آرگومان فراخوانی شود، زمان جاری را برمی‌گرداند. در غیر این صورت، آرگومان " +"*dt* باید یک نمونه از :class:`~datetime.datetime` باشد، و این نمونه به منطقه" +" زمانی محلی بر اساس پایگاه داده منطقه زمانی سیستم تبدیل می‌شود. اگر *dt* " +"ساده (naive) باشد (یعنی ``dt.tzinfo`` برابر ``None`` است)، فرض می‌شود که در " +"زمان محلی قرار دارد." msgid "The *isdst* parameter." -msgstr "" +msgstr "پارامتر *isdst*." -msgid "Returns a string suitable for an :rfc:`2822`\\ -compliant :mailheader:`Message-ID` header. Optional *idstring* if given, is a string used to strengthen the uniqueness of the message id. Optional *domain* if given provides the portion of the msgid after the '@'. The default is the local hostname. It is not normally necessary to override this default, but may be useful certain cases, such as a constructing distributed system that uses a consistent domain name across multiple hosts." -msgstr "" +msgid "" +"Returns a string suitable for an :rfc:`2822`\\ -compliant " +":mailheader:`Message-ID` header. Optional *idstring* if given, is a string " +"used to strengthen the uniqueness of the message id. Optional *domain* if " +"given provides the portion of the msgid after the '@'. The default is the " +"local hostname. It is not normally necessary to override this default, but " +"may be useful certain cases, such as a constructing distributed system that " +"uses a consistent domain name across multiple hosts." +msgstr "" +"رشته‌ای مناسب برای سرآیند :mailheader:`Message-ID` منطبق با :rfc:`2822` " +"برمی‌گرداند. اگر *idstring* اختیاری داده شود، رشته‌ای است که برای تقویت " +"یکتایی شناسه‌ی پیام استفاده می‌شود. اگر *domain* اختیاری داده شود، بخش پس از" +" '@' در msgid را فراهم می‌کند. مقدار پیش‌فرض، نام میزبان محلی است. معمولاً " +"نیازی به تغییر این پیش‌فرض نیست، اما ممکن است در موارد خاصی مفید باشد، مانند" +" ساخت یک سیستم توزیع‌شده که از یک نام دامنه‌ی ثابت در چندین میزبان استفاده " +"می‌کند." msgid "Added the *domain* keyword." -msgstr "" +msgstr "کلیدواژه‌ی *domain* افزوده شد." -msgid "The remaining functions are part of the legacy (``Compat32``) email API. There is no need to directly use these with the new API, since the parsing and formatting they provide is done automatically by the header parsing machinery of the new API." +msgid "" +"The remaining functions are part of the legacy (``Compat32``) email API. " +"There is no need to directly use these with the new API, since the parsing " +"and formatting they provide is done automatically by the header parsing " +"machinery of the new API." msgstr "" +"توابع باقی‌مانده بخشی از API ایمیل قدیمی (``Compat32``) هستند. نیازی به " +"استفاده‌ی مستقیم از این‌ها با API جدید نیست، زیرا تجزیه و قالب‌بندی " +"ارائه‌شده توسط آن‌ها به‌طور خودکار توسط سازوکار تجزیه‌ی سرآیند در API جدید " +"انجام می‌شود." -msgid "Return a new string with backslashes in *str* replaced by two backslashes, and double quotes replaced by backslash-double quote." +msgid "" +"Return a new string with backslashes in *str* replaced by two backslashes, " +"and double quotes replaced by backslash-double quote." msgstr "" +"یک رشته جدید برمی‌گرداند که در آن بک‌اسلش‌های موجود در *str* با دو بک‌اسلش، " +"و علامت‌های نقل‌قول دوتایی با بک‌اسلش-علامت نقل‌قول دوتایی جایگزین شده‌اند." -msgid "Return a new string which is an *unquoted* version of *str*. If *str* ends and begins with double quotes, they are stripped off. Likewise if *str* ends and begins with angle brackets, they are stripped off." +msgid "" +"Return a new string which is an *unquoted* version of *str*. If *str* ends " +"and begins with double quotes, they are stripped off. Likewise if *str* " +"ends and begins with angle brackets, they are stripped off." msgstr "" +"یک رشته جدید برمی‌گرداند که نسخه‌ی *بدون علامت نقل‌قول* از *str* است. اگر " +"*str* با علامت نقل‌قول دوتایی شروع و تمام شود، آن‌ها حذف می‌شوند. به همین " +"ترتیب، اگر *str* با علامت‌های زاویه‌ای شروع و تمام شود، آن‌ها حذف می‌شوند." -msgid "Parse address -- which should be the value of some address-containing field such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent *realname* and *email address* parts. Returns a tuple of that information, unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." +msgid "" +"Parse address -- which should be the value of some address-containing field " +"such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent " +"*realname* and *email address* parts. Returns a tuple of that information, " +"unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." msgstr "" +"نشانی را تجزیه می‌کند -- که باید مقدار یک فیلد حاوی نشانی مانند " +":mailheader:`To` یا :mailheader:`Cc` باشد -- به اجزای تشکیل‌دهنده‌ی آن، یعنی " +"*نام واقعی* و *نشانی ایمیل*. یک تاپل از آن اطلاعات برمی‌گرداند، مگر اینکه " +"تجزیه ناموفق باشد، که در این صورت یک تاپل دوتایی از ``('', '')`` برگردانده " +"می‌شود." -msgid "If *strict* is true, use a strict parser which rejects malformed inputs." +msgid "" +"If *strict* is true, use a strict parser which rejects malformed inputs." msgstr "" +"اگر *strict* درست باشد، از یک پارسر (parser) سخت‌گیر استفاده می‌شود که " +"ورودی‌های بدشکل را رد می‌کند." -msgid "Add *strict* optional parameter and reject malformed inputs by default." +msgid "" +"Add *strict* optional parameter and reject malformed inputs by default." msgstr "" +"افزودن پارامتر اختیاری *strict* و رد کردن ورودی‌های بدشکل به‌صورت پیش‌فرض." -msgid "The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form ``(realname, email_address)`` and returns the string value suitable for a :mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair* is false, then the second element is returned unmodified." +msgid "" +"The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " +"``(realname, email_address)`` and returns the string value suitable for a " +":mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair*" +" is false, then the second element is returned unmodified." msgstr "" +"این تابع معکوس :meth:`parseaddr` است و یک تاپل دوتایی به شکل ``(realname, " +"email_address)`` دریافت می‌کند و مقدار رشته‌ای مناسب برای سرآیند " +":mailheader:`To` یا :mailheader:`Cc` را بازمی‌گرداند. اگر عنصر اول *pair* " +"نادرست باشد، عنصر دوم بدون تغییر بازگردانده می‌شود." -msgid "Optional *charset* is the character set that will be used in the :rfc:`2047` encoding of the ``realname`` if the ``realname`` contains non-ASCII characters. Can be an instance of :class:`str` or a :class:`~email.charset.Charset`. Defaults to ``utf-8``." +msgid "" +"Optional *charset* is the character set that will be used in the :rfc:`2047`" +" encoding of the ``realname`` if the ``realname`` contains non-ASCII " +"characters. Can be an instance of :class:`str` or a " +":class:`~email.charset.Charset`. Defaults to ``utf-8``." msgstr "" +"*charset* اختیاری، مجموعه نویسه‌ای است که در کدگذاری :rfc:`2047` برای " +"``realname`` استفاده خواهد شد، اگر ``realname`` حاوی نویسه‌های غیر ASCII " +"باشد. می‌تواند نمونه‌ای از :class:`str` یا :class:`~email.charset.Charset` " +"باشد. مقدار پیش‌فرض آن ``utf-8`` است." msgid "Added the *charset* option." -msgstr "" +msgstr "گزینه‌ی *charset* افزوده شد." -msgid "This method returns a list of 2-tuples of the form returned by ``parseaddr()``. *fieldvalues* is a sequence of header field values as might be returned by :meth:`Message.get_all `." +msgid "" +"This method returns a list of 2-tuples of the form returned by " +"``parseaddr()``. *fieldvalues* is a sequence of header field values as might" +" be returned by :meth:`Message.get_all `." msgstr "" +"این متد فهرستی از تاپل‌های دوتایی با قالبی که توسط ``parseaddr()`` برگردانده" +" می‌شود را برمی‌گرداند. *fieldvalues* دنباله‌ای از مقادیر فیلد سرآیند است که " +"ممکن است توسط :meth:`Message.get_all ` " +"برگردانده شود." msgid "Here's a simple example that gets all the recipients of a message::" msgstr "" +"در اینجا یک مثال ساده آمده است که تمام گیرندگان یک پیام را به دست می‌آورد::" msgid "" "from email.utils import getaddresses\n" @@ -86,54 +169,196 @@ msgid "" "resent_ccs = msg.get_all('resent-cc', [])\n" "all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" msgstr "" +"from email.utils import getaddresses\n" +"\n" +"tos = msg.get_all('to', [])\n" +"ccs = msg.get_all('cc', [])\n" +"resent_tos = msg.get_all('resent-to', [])\n" +"resent_ccs = msg.get_all('resent-cc', [])\n" +"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" -msgid "Attempts to parse a date according to the rules in :rfc:`2822`. however, some mailers don't follow that format as specified, so :func:`parsedate` tries to guess correctly in such cases. *date* is a string containing an :rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If it succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that can be passed directly to :func:`time.mktime`; otherwise ``None`` will be returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." -msgstr "" +msgid "" +"Attempts to parse a date according to the rules in :rfc:`2822`. however, " +"some mailers don't follow that format as specified, so :func:`parsedate` " +"tries to guess correctly in such cases. *date* is a string containing an " +":rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If it " +"succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that can " +"be passed directly to :func:`time.mktime`; otherwise ``None`` will be " +"returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." +msgstr "" +"تلاش می‌کند یک تاریخ را طبق قواعد :rfc:`2822` تجزیه کند. با این حال، برخی " +"برنامه‌های ایمیل آن قالب را همان‌طور که مشخص شده است دنبال نمی‌کنند، " +"بنابراین :func:`parsedate` سعی می‌کند در این موارد به‌درستی حدس بزند. *date*" +" رشته‌ای حاوی یک تاریخ :rfc:`2822` است، مانند ``\"Mon, 20 Nov 1995 19:12:08 " +"-0500\"``. اگر در تجزیه تاریخ موفق شود، :func:`parsedate` یک تاپل ۹تایی " +"برمی‌گرداند که می‌توان آن را مستقیماً به :func:`time.mktime` ارسال کرد؛ در " +"غیر این صورت ``None`` برگردانده می‌شود. توجه داشته باشید که اندیس‌های ۶، ۷ و" +" ۸ تاپل نتیجه قابل استفاده نیستند." -msgid "Performs the same function as :func:`parsedate`, but returns either ``None`` or a 10-tuple; the first 9 elements make up a tuple that can be passed directly to :func:`time.mktime`, and the tenth is the offset of the date's timezone from UTC (which is the official term for Greenwich Mean Time) [#]_. If the input string has no timezone, the last element of the tuple returned is ``0``, which represents UTC. Note that indexes 6, 7, and 8 of the result tuple are not usable." -msgstr "" +msgid "" +"Performs the same function as :func:`parsedate`, but returns either ``None``" +" or a 10-tuple; the first 9 elements make up a tuple that can be passed " +"directly to :func:`time.mktime`, and the tenth is the offset of the date's " +"timezone from UTC (which is the official term for Greenwich Mean Time) [#]_." +" If the input string has no timezone, the last element of the tuple " +"returned is ``0``, which represents UTC. Note that indexes 6, 7, and 8 of " +"the result tuple are not usable." +msgstr "" +"همان عملکرد :func:`parsedate` را انجام می‌دهد، اما یا ``None`` یا یک تاپل " +"۱۰تایی بازمی‌گرداند؛ ۹ عنصر اول، تاپلی را تشکیل می‌دهند که می‌توان آن را " +"مستقیماً به :func:`time.mktime` ارسال کرد، و عنصر دهم، اختلاف منطقه زمانی " +"تاریخ نسبت به UTC (که اصطلاح رسمی برای زمان میانگین گرینویچ است) [#]_ است. " +"اگر رشته ورودی منطقه زمانی نداشته باشد، آخرین عنصر تاپل برگردانده‌شده ``0`` " +"است که نشان‌دهنده UTC است. توجه داشته باشید که اندیس‌های ۶، ۷ و ۸ تاپل نتیجه" +" قابل استفاده نیستند." -msgid "The inverse of :func:`format_datetime`. Performs the same function as :func:`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise ``ValueError`` is raised if *date* contains an invalid value such as an hour greater than 23 or a timezone offset not between -24 and 24 hours. If the input date has a timezone of ``-0000``, the ``datetime`` will be a naive ``datetime``, and if the date is conforming to the RFCs it will represent a time in UTC but with no indication of the actual source timezone of the message the date comes from. If the input date has any other valid timezone offset, the ``datetime`` will be an aware ``datetime`` with the corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." -msgstr "" +msgid "" +"The inverse of :func:`format_datetime`. Performs the same function as " +":func:`parsedate`, but on success returns a :mod:`~datetime.datetime`; " +"otherwise ``ValueError`` is raised if *date* contains an invalid value such " +"as an hour greater than 23 or a timezone offset not between -24 and 24 " +"hours. If the input date has a timezone of ``-0000``, the ``datetime`` will " +"be a naive ``datetime``, and if the date is conforming to the RFCs it will " +"represent a time in UTC but with no indication of the actual source timezone" +" of the message the date comes from. If the input date has any other valid " +"timezone offset, the ``datetime`` will be an aware ``datetime`` with the " +"corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." +msgstr "" +"معکوس :func:`format_datetime`. همان کارکرد :func:`parsedate` را دارد، اما در" +" صورت موفقیت یک :mod:`~datetime.datetime` برمی‌گرداند؛ در غیر این صورت، اگر " +"*date* حاوی مقدار نامعتبری باشد، مانند ساعتی بزرگ‌تر از ۲۳ یا آفست منطقه " +"زمانی خارج از بازه‌ی -۲۴ تا ۲۴ ساعت، ``ValueError`` پرتاب می‌شود. اگر تاریخ " +"ورودی دارای منطقه زمانی ``-0000`` باشد، ``datetime`` یک ``datetime`` ساده " +"خواهد بود، و اگر تاریخ مطابق RFCها باشد، نشان‌دهنده‌ی زمانی در UTC خواهد بود،" +" اما بدون هیچ نشانه‌ای از منطقه زمانی واقعی مبدأ پیامی که تاریخ از آن آمده " +"است. اگر تاریخ ورودی دارای هر آفست منطقه زمانی معتبر دیگری باشد، " +"``datetime`` یک ``datetime`` آگاه همراه با یک :class:`~datetime.timezone` " +":class:`~datetime.tzinfo` متناظر خواهد بود." -msgid "Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp (seconds since the Epoch). If the timezone item in the tuple is ``None``, assume local time." +msgid "" +"Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp " +"(seconds since the Epoch). If the timezone item in the tuple is ``None``, " +"assume local time." msgstr "" +"یک تاپل ۱۰تایی را که توسط :func:`parsedate_tz` برگردانده می‌شود، به یک برچسب" +" زمانی UTC (ثانیه‌های سپری‌شده از Epoch) تبدیل می‌کند. اگر آیتم منطقه‌ی " +"زمانی در تاپل ``None`` باشد، زمان محلی فرض می‌شود." msgid "Returns a date string as per :rfc:`2822`, e.g.::" -msgstr "" +msgstr "یک رشته‌ی تاریخ را مطابق با :rfc:`2822` برمی‌گرداند، برای نمونه::" msgid "Fri, 09 Nov 2001 01:08:47 -0000" -msgstr "" +msgstr "Fri, 09 Nov 2001 01:08:47 -0000" -msgid "Optional *timeval* if given is a floating-point time value as accepted by :func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is used." +msgid "" +"Optional *timeval* if given is a floating-point time value as accepted by " +":func:`time.gmtime` and :func:`time.localtime`, otherwise the current time " +"is used." msgstr "" +"*timeval* اختیاری، در صورت ارائه، یک مقدار زمان ممیز شناور است که " +":func:`time.gmtime` و :func:`time.localtime` آن را می‌پذیرند؛ در غیر این " +"صورت از زمان جاری استفاده می‌شود." -msgid "Optional *localtime* is a flag that when ``True``, interprets *timeval*, and returns a date relative to the local timezone instead of UTC, properly taking daylight savings time into account. The default is ``False`` meaning UTC is used." +msgid "" +"Optional *localtime* is a flag that when ``True``, interprets *timeval*, and" +" returns a date relative to the local timezone instead of UTC, properly " +"taking daylight savings time into account. The default is ``False`` meaning " +"UTC is used." msgstr "" +"*localtime* پرچمی اختیاری است که وقتی ``True`` باشد، *timeval* را تفسیر " +"می‌کند و تاریخی بر اساس منطقه‌ی زمانی محلی به‌جای UTC برمی‌گرداند و ساعت " +"تابستانی را به‌درستی در نظر می‌گیرد. مقدار پیش‌فرض ``False`` است، به این " +"معنا که از UTC استفاده می‌شود." -msgid "Optional *usegmt* is a flag that when ``True``, outputs a date string with the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. This is needed for some protocols (such as HTTP). This only applies when *localtime* is ``False``. The default is ``False``." +msgid "" +"Optional *usegmt* is a flag that when ``True``, outputs a date string with " +"the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. " +"This is needed for some protocols (such as HTTP). This only applies when " +"*localtime* is ``False``. The default is ``False``." msgstr "" +"*usegmt* اختیاری، پرچمی است که وقتی ``True`` باشد، یک رشته‌ی تاریخ را با " +"منطقه‌ی زمانی به‌صورت رشته‌ی ASCII ``GMT`` خروجی می‌دهد، نه به‌صورت عددی " +"``-0000``. این برای برخی پروتکل‌ها (مانند HTTP) لازم است. این فقط زمانی " +"اعمال می‌شود که *localtime* برابر ``False`` باشد. مقدار پیش‌فرض ``False`` " +"است." -msgid "Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is a naive datetime, it is assumed to be \"UTC with no information about the source timezone\", and the conventional ``-0000`` is used for the timezone. If it is an aware ``datetime``, then the numeric timezone offset is used. If it is an aware timezone with offset zero, then *usegmt* may be set to ``True``, in which case the string ``GMT`` is used instead of the numeric timezone offset. This provides a way to generate standards conformant HTTP date headers." -msgstr "" +msgid "" +"Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is " +"a naive datetime, it is assumed to be \"UTC with no information about the " +"source timezone\", and the conventional ``-0000`` is used for the timezone. " +"If it is an aware ``datetime``, then the numeric timezone offset is used. If" +" it is an aware timezone with offset zero, then *usegmt* may be set to " +"``True``, in which case the string ``GMT`` is used instead of the numeric " +"timezone offset. This provides a way to generate standards conformant HTTP " +"date headers." +msgstr "" +"مانند ``formatdate``، اما ورودی یک نمونه :mod:`datetime` است. اگر یک " +"datetime ساده (naive) باشد، فرض می‌شود «UTC بدون اطلاعات درباره منطقه‌ی زمانی" +" مبدأ» است و برای منطقه‌ی زمانی از ``-0000`` قراردادی استفاده می‌شود. اگر یک " +"``datetime`` آگاه (aware) باشد، از آفست عددی منطقه‌ی زمانی استفاده می‌شود. " +"اگر یک منطقه‌ی زمانی آگاه (aware) با آفست صفر باشد، می‌توان *usegmt* را روی " +"``True`` تنظیم کرد، که در این صورت رشته‌ی ``GMT`` به‌جای آفست عددی منطقه‌ی " +"زمانی استفاده می‌شود. این راهی برای تولید سرآیندهای تاریخ HTTP مطابق با " +"استانداردها فراهم می‌کند." msgid "Decode the string *s* according to :rfc:`2231`." -msgstr "" +msgstr "رشته‌ی *s* را مطابق :rfc:`2231` کدگشایی کنید." -msgid "Encode the string *s* according to :rfc:`2231`. Optional *charset* and *language*, if given is the character set name and language name to use. If neither is given, *s* is returned as-is. If *charset* is given but *language* is not, the string is encoded using the empty string for *language*." -msgstr "" +msgid "" +"Encode the string *s* according to :rfc:`2231`. Optional *charset* and " +"*language*, if given is the character set name and language name to use. If" +" neither is given, *s* is returned as-is. If *charset* is given but " +"*language* is not, the string is encoded using the empty string for " +"*language*." +msgstr "" +"رشته‌ی *s* را مطابق :rfc:`2231` کدگذاری می‌کند. آرگومان‌های اختیاری *charset*" +" و *language*، در صورت داده شدن، به ترتیب نام مجموعه‌نویسه و نام زبان مورد " +"استفاده هستند. اگر هیچ‌کدام داده نشود، *s* همان‌طور که هست برگردانده می‌شود." +" اگر *charset* داده شود اما *language* داده نشود، رشته با استفاده از رشته‌ی " +"خالی برای *language* کدگذاری می‌شود." -msgid "When a header parameter is encoded in :rfc:`2231` format, :meth:`Message.get_param ` may return a 3-tuple containing the character set, language, and value. :func:`collapse_rfc2231_value` turns this into a unicode string. Optional *errors* is passed to the *errors* argument of :class:`str`'s :func:`~str.encode` method; it defaults to ``'replace'``. Optional *fallback_charset* specifies the character set to use if the one in the :rfc:`2231` header is not known by Python; it defaults to ``'us-ascii'``." -msgstr "" +msgid "" +"When a header parameter is encoded in :rfc:`2231` format, " +":meth:`Message.get_param ` may return a " +"3-tuple containing the character set, language, and value. " +":func:`collapse_rfc2231_value` turns this into a unicode string. Optional " +"*errors* is passed to the *errors* argument of :class:`str`'s " +":func:`~str.encode` method; it defaults to ``'replace'``. Optional " +"*fallback_charset* specifies the character set to use if the one in the " +":rfc:`2231` header is not known by Python; it defaults to ``'us-ascii'``." +msgstr "" +"هنگامی که یک پارامتر سرآیند در قالب :rfc:`2231` کدگذاری‌شده باشد، " +":meth:`Message.get_param ` ممکن است یک تاپل" +" سه‌تایی شامل مجموعه نویسه، زبان و مقدار را بازگشت دهد. " +":func:`collapse_rfc2231_value` این را به یک رشته یونیکد تبدیل می‌کند. " +"پارامتر اختیاری *errors* به آرگومان *errors* متد :func:`~str.encode` کلاس " +":class:`str` ارسال می‌شود؛ مقدار پیش‌فرض آن ``'replace'`` است. پارامتر " +"اختیاری *fallback_charset* مجموعه نویسه‌ای را مشخص می‌کند که در صورتی که " +"مجموعه نویسه موجود در سرآیند :rfc:`2231` برای پایتون شناخته‌شده نباشد، " +"استفاده شود؛ مقدار پیش‌فرض آن ``'us-ascii'`` است." -msgid "For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is not a tuple, it should be a string and it is returned unquoted." +msgid "" +"For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is " +"not a tuple, it should be a string and it is returned unquoted." msgstr "" +"برای سهولت، اگر *مقدار* ارسال‌شده به :func:`collapse_rfc2231_value` یک تاپل " +"نباشد، باید یک رشته باشد و بدون علامت نقل‌قول برگردانده می‌شود." -msgid "Decode parameters list according to :rfc:`2231`. *params* is a sequence of 2-tuples containing elements of the form ``(content-type, string-value)``." +msgid "" +"Decode parameters list according to :rfc:`2231`. *params* is a sequence of " +"2-tuples containing elements of the form ``(content-type, string-value)``." msgstr "" +"کدگشایی فهرست پارامترها مطابق :rfc:`2231`. *params* دنباله‌ای از ۲-تایی‌ها " +"شامل عناصری به‌شکل ``(content-type, string-value)`` است." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Note that the sign of the timezone offset is the opposite of the sign of the ``time.timezone`` variable for the same timezone; the latter variable follows the POSIX standard while this module follows :rfc:`2822`." +msgid "" +"Note that the sign of the timezone offset is the opposite of the sign of the" +" ``time.timezone`` variable for the same timezone; the latter variable " +"follows the POSIX standard while this module follows :rfc:`2822`." msgstr "" +"توجه داشته باشید که علامت آفست منطقه زمانی مخالف علامت متغیر " +"``time.timezone`` برای همان منطقه زمانی است؛ این متغیر از استاندارد POSIX " +"پیروی می‌کند، در حالی که این ماژول از :rfc:`2822` پیروی می‌کند." diff --git a/library/ensurepip.po b/library/ensurepip.po index d787ccbb0..200c45192 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -24,121 +24,250 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!ensurepip` --- Bootstrapping the ``pip`` installer" -msgstr "" +msgstr ":mod:`!ensurepip` --- راه‌اندازی اولیه‌ی نصب‌کننده‌ی ``pip``" msgid "**Source code:** :source:`Lib/ensurepip`" -msgstr "" +msgstr ":source:`Lib/ensurepip`" -msgid "The :mod:`!ensurepip` package provides support for bootstrapping the ``pip`` installer into an existing Python installation or virtual environment. This bootstrapping approach reflects the fact that ``pip`` is an independent project with its own release cycle, and the latest available stable version is bundled with maintenance and feature releases of the CPython reference interpreter." -msgstr "" +msgid "" +"The :mod:`!ensurepip` package provides support for bootstrapping the ``pip``" +" installer into an existing Python installation or virtual environment. This" +" bootstrapping approach reflects the fact that ``pip`` is an independent " +"project with its own release cycle, and the latest available stable version " +"is bundled with maintenance and feature releases of the CPython reference " +"interpreter." +msgstr "" +"بسته‌ی :mod:`!ensurepip` پشتیبانی برای بوت‌استرپ کردن (bootstrapping) " +"نصب‌کننده‌ی ``pip`` در یک نصب پایتون موجود یا محیط مجازی را فراهم می‌کند. این" +" رویکرد بوت‌استرپ نشان‌دهنده‌ی این واقعیت است که ``pip`` پروژه‌ای مستقل با " +"چرخه‌ی انتشار خود است و آخرین نسخه‌ی پایدار موجود همراه با انتشارهای نگهداشت و" +" ویژگی مفسر مرجع CPython گنجانده شده است." -msgid "In most cases, end users of Python shouldn't need to invoke this module directly (as ``pip`` should be bootstrapped by default), but it may be needed if installing ``pip`` was skipped when installing Python (or when creating a virtual environment) or after explicitly uninstalling ``pip``." +msgid "" +"In most cases, end users of Python shouldn't need to invoke this module " +"directly (as ``pip`` should be bootstrapped by default), but it may be " +"needed if installing ``pip`` was skipped when installing Python (or when " +"creating a virtual environment) or after explicitly uninstalling ``pip``." msgstr "" +"در بیشتر موارد، کاربران نهایی پایتون نباید نیازی به فراخوانی مستقیم این " +"ماژول داشته باشند (زیرا ``pip`` باید به‌طور پیش‌فرض بوت‌استرپ (bootstrapped)" +" شده باشد)، اما ممکن است در صورتی که از نصب ``pip`` هنگام نصب پایتون (یا " +"هنگام ایجاد یک محیط مجازی) صرف‌نظر شده باشد، یا پس از حذف صریح ``pip``، به " +"فراخوانی آن نیاز باشد." -msgid "This module *does not* access the internet. All of the components needed to bootstrap ``pip`` are included as internal parts of the package." +msgid "" +"This module *does not* access the internet. All of the components needed to " +"bootstrap ``pip`` are included as internal parts of the package." msgstr "" +"این ماژول به اینترنت *دسترسی ندارد*. تمام کامپوننت‌های مورد نیاز برای " +"راه‌اندازی اولیه (bootstrap) ``pip`` به‌عنوان بخش‌های داخلی بسته گنجانده " +"شده‌اند." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر این ماژول در نسخه " +"CPython شما وجود ندارد، برای مستندات به توزیع‌کننده خود مراجعه کنید (یعنی " +"کسی که پایتون را در اختیار شما قرار داده است). اگر شما توزیع‌کننده هستید، " +":ref:`optional-module-requirements` را ببینید." msgid ":ref:`installing-index`" -msgstr "" +msgstr ":ref:`installing-index`" msgid "The end user guide for installing Python packages" -msgstr "" +msgstr "راهنمای کاربر نهایی برای نصب بسته‌های پایتون" msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" msgstr "" +":pep:`453`: راه‌اندازی اولیه (bootstrapping) صریح pip در نصب‌های پایتون" msgid "The original rationale and specification for this module." -msgstr "" +msgstr "مبانی و مشخصات اولیه‌ی این ماژول." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" +"این ماژول در :ref:`سکوهای موبایل ` یا :ref:`سکوهای " +"WebAssembly ` پشتیبانی نمی‌شود." msgid "Command-line interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "The command line interface is invoked using the interpreter's ``-m`` switch." -msgstr "" +msgid "" +"The command line interface is invoked using the interpreter's ``-m`` switch." +msgstr "رابط خط فرمان با استفاده از سوئیچ ``-m`` مفسر فراخوانی می‌شود." msgid "The simplest possible invocation is::" -msgstr "" +msgstr "ساده‌ترین فراخوانی ممکن به این صورت است::" msgid "python -m ensurepip" -msgstr "" +msgstr "python -m ensurepip" -msgid "This invocation will install ``pip`` if it is not already installed, but otherwise does nothing. To ensure the installed version of ``pip`` is at least as recent as the one available in ``ensurepip``, pass the ``--upgrade`` option::" +msgid "" +"This invocation will install ``pip`` if it is not already installed, but " +"otherwise does nothing. To ensure the installed version of ``pip`` is at " +"least as recent as the one available in ``ensurepip``, pass the " +"``--upgrade`` option::" msgstr "" +"این فراخوانی در صورتی ``pip`` را نصب می‌کند که پیش‌تر نصب نشده باشد، اما در " +"غیر این صورت هیچ کاری انجام نمی‌دهد. برای اطمینان از اینکه نسخه نصب‌شده " +"``pip`` حداقل به‌اندازه نسخه موجود در ``ensurepip`` جدید باشد، گزینه " +"``--upgrade`` را به کار ببرید::" msgid "python -m ensurepip --upgrade" -msgstr "" +msgstr "python -m ensurepip --upgrade" -msgid "By default, ``pip`` is installed into the current virtual environment (if one is active) or into the system site packages (if there is no active virtual environment). The installation location can be controlled through two additional command line options:" +msgid "" +"By default, ``pip`` is installed into the current virtual environment (if " +"one is active) or into the system site packages (if there is no active " +"virtual environment). The installation location can be controlled through " +"two additional command line options:" msgstr "" +"به‌طور پیش‌فرض، ``pip`` در محیط مجازی فعلی (اگر یکی فعال باشد) یا در " +"بسته‌های سایت سیستم (اگر هیچ محیط مجازی فعالی وجود نداشته باشد) نصب می‌شود. " +"محل نصب را می‌توان از طریق دو گزینه اضافی خط فرمان کنترل کرد:" -msgid "Installs ``pip`` relative to the given root directory rather than the root of the currently active virtual environment (if any) or the default root for the current Python installation." +msgid "" +"Installs ``pip`` relative to the given root directory rather than the root " +"of the currently active virtual environment (if any) or the default root for" +" the current Python installation." msgstr "" +"``pip`` را نسبت به پوشه‌ی ریشه‌ی داده‌شده نصب می‌کند، نه نسبت به ریشه‌ی محیط " +"مجازی فعال کنونی (در صورت وجود) یا ریشه‌ی پیش‌فرض برای نصب پایتون کنونی." -msgid "Installs ``pip`` into the user site packages directory rather than globally for the current Python installation (this option is not permitted inside an active virtual environment)." +msgid "" +"Installs ``pip`` into the user site packages directory rather than globally " +"for the current Python installation (this option is not permitted inside an " +"active virtual environment)." msgstr "" +"``pip`` را به‌جای نصب به‌صورت سراسری برای نصب پایتون جاری، در پوشه‌ی site " +"packages کاربر نصب می‌کند (این گزینه در یک محیط مجازی فعال مجاز نیست)." -msgid "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y stands for the version of Python used to invoke ``ensurepip``). The scripts installed can be controlled through two additional command line options:" +msgid "" +"By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y" +" stands for the version of Python used to invoke ``ensurepip``). The scripts" +" installed can be controlled through two additional command line options:" msgstr "" +"به‌طور پیش‌فرض، اسکریپت‌های ``pipX`` و ``pipX.Y`` نصب خواهند شد (که X.Y " +"نشان‌دهنده‌ی نسخه‌ی پایتون استفاده‌شده برای فراخوانی ``ensurepip`` است). " +"اسکریپت‌های نصب‌شده را می‌توان از طریق دو گزینه‌ی اضافی خط فرمان کنترل کرد:" -msgid "If an alternate installation is requested, the ``pipX`` script will *not* be installed." -msgstr "" +msgid "" +"If an alternate installation is requested, the ``pipX`` script will *not* be" +" installed." +msgstr "اگر نصب جایگزینی درخواست شود، اسکریپت ``pipX`` *نصب نخواهد شد*." -msgid "If a \"default pip\" installation is requested, the ``pip`` script will be installed in addition to the two regular scripts." +msgid "" +"If a \"default pip\" installation is requested, the ``pip`` script will be " +"installed in addition to the two regular scripts." msgstr "" +"اگر نصب «pip پیش‌فرض» درخواست شود، اسکریپت ``pip`` علاوه بر دو اسکریپت معمول" +" نصب خواهد شد." -msgid "Providing both of the script selection options will trigger an exception." -msgstr "" +msgid "" +"Providing both of the script selection options will trigger an exception." +msgstr "ارائه هر دو گزینه‌ی انتخاب اسکریپت، باعث پرتاب یک استثنا می‌شود." msgid "Module API" -msgstr "" +msgstr "API ماژول" msgid ":mod:`!ensurepip` exposes two functions for programmatic use:" -msgstr "" +msgstr ":mod:`!ensurepip` دو تابع را برای استفاده‌ی برنامه‌ای ارائه می‌دهد:" -msgid "Returns a string specifying the available version of pip that will be installed when bootstrapping an environment." +msgid "" +"Returns a string specifying the available version of pip that will be " +"installed when bootstrapping an environment." msgstr "" +"رشته‌ای را برمی‌گرداند که نسخه‌ی در دسترس pip را مشخص می‌کند؛ این نسخه هنگام" +" راه‌اندازی اولیه (bootstrapping) یک محیط نصب خواهد شد." msgid "Bootstraps ``pip`` into the current or designated environment." msgstr "" +"``pip`` را در محیط فعلی یا تعیین‌شده راه‌اندازی اولیه (bootstrap) می‌کند." -msgid "*root* specifies an alternative root directory to install relative to. If *root* is ``None``, then installation uses the default install location for the current environment." +msgid "" +"*root* specifies an alternative root directory to install relative to. If " +"*root* is ``None``, then installation uses the default install location for " +"the current environment." msgstr "" +"*root* یک پوشه ریشه جایگزین را مشخص می‌کند که نصب نسبت به آن انجام می‌شود. " +"اگر *root* برابر ``None`` باشد، نصب از محل پیش‌فرض نصب برای محیط فعلی " +"استفاده می‌کند." -msgid "*upgrade* indicates whether or not to upgrade an existing installation of an earlier version of ``pip`` to the available version." +msgid "" +"*upgrade* indicates whether or not to upgrade an existing installation of an" +" earlier version of ``pip`` to the available version." msgstr "" +"*upgrade* مشخص می‌کند که آیا یک نصب موجود از نسخه‌ی قدیمی‌تر ``pip`` باید به " +"نسخه‌ی در دسترس ارتقا یابد یا خیر." -msgid "*user* indicates whether to use the user scheme rather than installing globally." +msgid "" +"*user* indicates whether to use the user scheme rather than installing " +"globally." msgstr "" +"*user* نشان می‌دهد که آیا باید از طرح‌واره کاربر به‌جای نصب به‌صورت سراسری " +"استفاده شود." -msgid "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y stands for the current version of Python)." +msgid "" +"By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y" +" stands for the current version of Python)." msgstr "" +"به‌طور پیش‌فرض، اسکریپت‌های ``pipX`` و ``pipX.Y`` نصب خواهند شد (که X.Y " +"نشان‌دهنده‌ی نسخه‌ی جاری پایتون است)." msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." -msgstr "" +msgstr "اگر *altinstall* تنظیم شده باشد، ``pipX`` نصب *نخواهد شد*." -msgid "If *default_pip* is set, then ``pip`` will be installed in addition to the two regular scripts." +msgid "" +"If *default_pip* is set, then ``pip`` will be installed in addition to the " +"two regular scripts." msgstr "" +"اگر *default_pip* تنظیم شده باشد، آنگاه ``pip`` علاوه بر ۲ اسکریپت معمولی " +"نصب خواهد شد." -msgid "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." +msgid "" +"Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." msgstr "" +"تنظیم همزمان *altinstall* و *default_pip* باعث پرتاب :exc:`ValueError` " +"می‌شود." -msgid "*verbosity* controls the level of output to :data:`sys.stdout` from the bootstrapping operation." +msgid "" +"*verbosity* controls the level of output to :data:`sys.stdout` from the " +"bootstrapping operation." msgstr "" +"*verbosity* سطح خروجی به :data:`sys.stdout` از عملیات راه‌اندازی اولیه " +"(bootstrapping) را کنترل می‌کند." -msgid "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with argument ``root``." +msgid "" +"Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " +"argument ``root``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ensurepip.bootstrap`` را با آرگومان " +"``root`` پرتاب می‌کند." -msgid "The bootstrapping process has side effects on both ``sys.path`` and ``os.environ``. Invoking the command line interface in a subprocess instead allows these side effects to be avoided." +msgid "" +"The bootstrapping process has side effects on both ``sys.path`` and " +"``os.environ``. Invoking the command line interface in a subprocess instead " +"allows these side effects to be avoided." msgstr "" +"فرایند بوت‌استرپ (bootstrapping) بر هر دو ``sys.path`` و ``os.environ`` " +"عوارض جانبی دارد. در عوض، فراخوانی رابط خط فرمان در یک زیرفرایند " +"(subprocess) امکان اجتناب از این عوارض جانبی را فراهم می‌کند." -msgid "The bootstrapping process may install additional modules required by ``pip``, but other software should not assume those dependencies will always be present by default (as the dependencies may be removed in a future version of ``pip``)." -msgstr "" +msgid "" +"The bootstrapping process may install additional modules required by " +"``pip``, but other software should not assume those dependencies will always" +" be present by default (as the dependencies may be removed in a future " +"version of ``pip``)." +msgstr "" +"فرایند بوت‌استرپ (bootstrapping) ممکن است ماژول‌های اضافی مورد نیاز ``pip`` " +"را نصب کند، اما سایر نرم‌افزارها نباید فرض کنند که آن وابستگی‌ها همیشه " +"به‌صورت پیش‌فرض موجود خواهند بود (زیرا ممکن است آن وابستگی‌ها در نسخه‌ای " +"آینده از ``pip`` حذف شوند)." diff --git a/library/enum.po b/library/enum.po index dc0988ff3..44ba85494 100644 --- a/library/enum.po +++ b/library/enum.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"PO-Revision-Date: 2026-08-28 11:27+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,42 +23,43 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!enum` --- Support for enumerations" -msgstr "" +msgstr ":mod:`!enum` --- پشتیبانی از شمارش‌ها" msgid "**Source code:** :source:`Lib/enum.py`" -msgstr "" +msgstr ":source:`Lib/enum.py`" msgid "This page contains the API reference information. For tutorial information and discussion of more advanced topics, see" -msgstr "" +msgstr "این صفحه شامل اطلاعات مرجع API است. برای اطلاعات آموزشی و بحث درباره‌ی موضوعات پیشرفته‌تر، ببینید" msgid ":ref:`Basic Tutorial `" -msgstr "" +msgstr ":ref:`خودآموز مقدماتی `" msgid ":ref:`Advanced Tutorial `" -msgstr "" +msgstr ":ref:`آموزش پیشرفته `" msgid ":ref:`Enum Cookbook `" -msgstr "" +msgstr ":ref:`کتاب آشپزی Enum `" msgid "An enumeration:" -msgstr "" +msgstr "یک شمارش:" msgid "is a set of symbolic names (members) bound to unique values" -msgstr "" +msgstr "مجموعه‌ای از نام‌های نمادین (اعضا) است که به مقادیر یکتا متصل شده‌اند" msgid "can be iterated over to return its canonical (i.e. non-alias) members in definition order" -msgstr "" +msgstr "می‌توان آن را پیمایش کرد تا اعضای کانونیکال (یعنی غیرمستعار) آن به ترتیب تعریف برگردانده شوند" msgid "uses *call* syntax to return members by value" -msgstr "" +msgstr "از سینتکس *call* برای برگرداندن اعضا بر اساس مقدار استفاده می‌کند" msgid "uses *index* syntax to return members by name" -msgstr "" +msgstr "از نحو *اندیس* برای برگرداندن اعضا بر اساس نام استفاده می‌کند" msgid "Enumerations are created either by using :keyword:`class` syntax, or by using function-call syntax::" -msgstr "" +msgstr "شمارش‌ها یا با استفاده از نحو :keyword:`class` یا با استفاده از نحو فراخوانی تابع ایجاد می‌شوند::" msgid "" ">>> from enum import Enum\n" @@ -72,222 +73,252 @@ msgid "" ">>> # functional syntax\n" ">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" msgstr "" +">>> from enum import Enum\n" +"\n" +">>> # class syntax\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"\n" +">>> # functional syntax\n" +">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" -msgid "Even though we can use :keyword:`class` syntax to create Enums, Enums are not normal Python classes. See :ref:`How are Enums different? ` for more details." +msgid "" +"Even though we can use :keyword:`class` syntax to create Enums, Enums are not normal Python classes. See :ref:`How are Enums different? ` for more details." msgstr "" +"اگرچه شما می‌توانید از نحو :keyword:`class` برای ایجاد Enumها استفاده کنید، Enumها کلاس‌های معمولی پایتون نیستند. برای جزئیات بیشتر :ref:`Enumها چگونه متفاوت هستند؟ ` را ببینید." msgid "Nomenclature" -msgstr "" +msgstr "نام‌گذاری" msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" -msgstr "" +msgstr "کلاس :class:`!Color` یک *شمارش* (یا *enum*) است" msgid "The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are *enumeration members* (or *members*) and are functionally constants." -msgstr "" +msgstr "ویژگی‌های :attr:`!Color.RED`، :attr:`!Color.GREEN` و غیره، *اعضای شمارشی* (یا *اعضا*) هستند و از نظر عملکردی ثابت هستند." msgid "The enum members have *names* and *values* (the name of :attr:`!Color.RED` is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" -msgstr "" +msgstr "اعضای enum دارای *نام‌ها* و *مقدارها* هستند (نام :attr:`!Color.RED` برابر ``RED`` است، مقدار :attr:`!Color.BLUE` برابر ``3`` است، و غیره)" msgid "Module contents" -msgstr "" +msgstr "محتویات ماژول" msgid ":class:`EnumType`" -msgstr "" +msgstr ":class:`EnumType`" msgid "The ``type`` for Enum and its subclasses." -msgstr "" +msgstr "``type`` برای Enum و زیرکلاس‌های آن." msgid ":class:`Enum`" -msgstr "" +msgstr ":class:`Enum`" msgid "Base class for creating enumerated constants." -msgstr "" +msgstr "کلاس پایه برای ایجاد ثوابت شمارشی." msgid ":class:`IntEnum`" -msgstr "" +msgstr ":class:`IntEnum`" msgid "Base class for creating enumerated constants that are also subclasses of :class:`int`. (`Notes`_)" -msgstr "" +msgstr "کلاس پایه برای ایجاد ثابت‌های شمارشی که همچنین زیرکلاس‌هایی از :class:`int` هستند. (`Notes`_)" msgid ":class:`StrEnum`" -msgstr "" +msgstr ":class:`StrEnum`" msgid "Base class for creating enumerated constants that are also subclasses of :class:`str`. (`Notes`_)" -msgstr "" +msgstr "کلاس پایه برای ایجاد ثابت‌های شمارشی که زیرکلاس‌هایی از :class:`str` نیز هستند. (`Notes`_)" msgid ":class:`Flag`" -msgstr "" +msgstr ":class:`Flag`" msgid "Base class for creating enumerated constants that can be combined using the bitwise operations without losing their :class:`Flag` membership." -msgstr "" +msgstr "کلاس پایه برای ایجاد ثابت‌های شمارش‌شده که می‌توان آن‌ها را با استفاده از عملیات بیتی ترکیب کرد، بدون آنکه عضویت آن‌ها در :class:`Flag` از دست برود." msgid ":class:`IntFlag`" -msgstr "" +msgstr ":class:`IntFlag`" -msgid "Base class for creating enumerated constants that can be combined using the bitwise operators without losing their :class:`IntFlag` membership. :class:`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" +msgid "" +"Base class for creating enumerated constants that can be combined using the bitwise operators without losing their :class:`IntFlag` membership. :class:`IntFlag` members are also " +"subclasses of :class:`int`. (`Notes`_)" msgstr "" +"کلاس پایه برای ایجاد ثابت‌های شمارشی که می‌توان آن‌ها را با استفاده از عملگرهای بیتی ترکیب کرد، بدون از دست دادن عضویت آن‌ها در :class:`IntFlag`. اعضای :class:`IntFlag` همچنین " +"زیرکلاس‌هایی از :class:`int` هستند. (`Notes`_)" msgid ":class:`ReprEnum`" -msgstr "" +msgstr ":class:`ReprEnum`" msgid "Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep the :class:`str() ` of the mixed-in type." -msgstr "" +msgstr "توسط :class:`IntEnum`، :class:`StrEnum` و :class:`IntFlag` استفاده می‌شود تا :class:`str() ` نوع افزوده‌شده (mixed-in) حفظ شود." msgid ":class:`EnumCheck`" -msgstr "" +msgstr ":class:`EnumCheck`" msgid "An enumeration with the values ``CONTINUOUS``, ``NAMED_FLAGS``, and ``UNIQUE``, for use with :func:`verify` to ensure various constraints are met by a given enumeration." -msgstr "" +msgstr "یک شمارش با مقادیر ``CONTINUOUS``، ``NAMED_FLAGS`` و ``UNIQUE``، برای استفاده با :func:`verify` تا اطمینان حاصل شود که محدودیت‌های مختلف توسط یک شمارش مشخص برآورده می‌شوند." msgid ":class:`FlagBoundary`" -msgstr "" +msgstr ":class:`FlagBoundary`" -msgid "An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP`` which allows for more fine-grained control over how invalid values are dealt with in an enumeration." -msgstr "" +msgid "" +"An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP`` which allows for more fine-grained control over how invalid values are dealt with in an enumeration." +msgstr "یک شمارش با مقادیر ``STRICT``، ``CONFORM``، ``EJECT`` و ``KEEP`` که امکان کنترل دقیق‌تر بر چگونگی رسیدگی به مقادیر نامعتبر در یک شمارش را فراهم می‌کند." msgid ":class:`EnumDict`" -msgstr "" +msgstr ":class:`EnumDict`" msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." -msgstr "" +msgstr "زیرکلاسی از :class:`dict` برای استفاده هنگام زیرکلاس‌سازی از :class:`EnumType`." msgid ":class:`auto`" -msgstr "" +msgstr ":class:`auto`" -msgid "Instances are replaced with an appropriate value for Enum members. :class:`StrEnum` defaults to the lower-cased version of the member name, while other Enums default to 1 and increase from there." +msgid "" +"Instances are replaced with an appropriate value for Enum members. :class:`StrEnum` defaults to the lower-cased version of the member name, while other Enums default to 1 and " +"increase from there." msgstr "" +"نمونه‌ها با مقدار مناسبی برای اعضای Enum جایگزین می‌شوند. مقدار پیش‌فرض :class:`StrEnum` نسخه با حروف کوچک نام عضو است، در حالی که مقدار پیش‌فرض سایر Enumها ۱ است و از آن مقدار افزایش " +"می‌یابد." msgid ":deco:`~enum.property`" -msgstr "" +msgstr ":deco:`~enum.property`" msgid "Allows :class:`Enum` members to have attributes without conflicting with member names. The ``value`` and ``name`` attributes are implemented this way." -msgstr "" +msgstr "به اعضای :class:`Enum` اجازه می‌دهد ویژگی‌هایی داشته باشند که با نام اعضا تداخل نمی‌کنند. ویژگی‌های ``value`` و ``name`` به همین شکل پیاده‌سازی شده‌اند." msgid ":deco:`unique`" -msgstr "" +msgstr ":deco:`unique`" msgid "Enum class decorator that ensures only one name is bound to any one value." -msgstr "" +msgstr "دکوراتور کلاس Enum که تضمین می‌کند به هر مقدار تنها یک نام مقید شده باشد." msgid ":deco:`verify`" -msgstr "" +msgstr ":deco:`verify`" msgid "Enum class decorator that checks user-selectable constraints on an enumeration." -msgstr "" +msgstr "دکوراتور کلاس Enum که محدودیت‌های قابل‌انتخاب توسط کاربر روی یک شمارش را بررسی می‌کند." msgid ":deco:`member`" -msgstr "" +msgstr ":deco:`member`" msgid "Make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "``obj`` را به یک عضو تبدیل می‌کند. می‌تواند به‌عنوان دکوراتور استفاده شود." msgid ":deco:`nonmember`" -msgstr "" +msgstr ":deco:`nonmember`" msgid "Do not make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "``obj`` را عضو نکنید. می‌تواند به‌عنوان دکوراتور استفاده شود." msgid ":deco:`global_enum`" -msgstr "" +msgstr ":deco:`global_enum`" -msgid "Modify the :class:`str() ` and :func:`repr` of an enum to show its members as belonging to the module instead of its class, and export the enum members to the global namespace." -msgstr "" +msgid "" +"Modify the :class:`str() ` and :func:`repr` of an enum to show its members as belonging to the module instead of its class, and export the enum members to the global " +"namespace." +msgstr ":class:`str() ` و :func:`repr` یک شمارش (enum) را تغییر دهید تا اعضای آن به‌جای کلاس آن، متعلق به ماژول نمایش داده شوند و اعضای شمارش را به فضای نام سراسری صادر کنید." msgid ":func:`show_flag_values`" -msgstr "" +msgstr ":func:`show_flag_values`" msgid "Return a list of all power-of-two integers contained in a flag." -msgstr "" +msgstr "فهرستی از تمام اعداد صحیح توان دو موجود در یک پرچم را برمی‌گرداند." msgid ":func:`enum.bin`" -msgstr "" +msgstr ":func:`enum.bin`" -msgid "Like built-in :func:`bin`, except negative values are represented in two's complement, and the leading bit always indicates sign (``0`` implies positive, ``1`` implies negative)." -msgstr "" +msgid "" +"Like built-in :func:`bin`, except negative values are represented in two's complement, and the leading bit always indicates sign (``0`` implies positive, ``1`` implies negative)." +msgstr "مانند :func:`bin` توکار، با این تفاوت که مقادیر منفی به‌صورت مکمل دو نمایش داده می‌شوند و بیت پیشرو همیشه علامت را نشان می‌دهد (``0`` به معنای مثبت و ``1`` به معنای منفی است)." msgid "``Flag``, ``IntFlag``, ``auto``" -msgstr "" +msgstr "``Flag``, ``IntFlag``, ``auto``" msgid "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -msgstr "" +msgstr "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" msgid "``EnumDict``" -msgstr "" +msgstr "``EnumDict``" msgid "Data types" -msgstr "" +msgstr "انواع داده" msgid "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" +"*EnumType* :term:`فراکلاس ` برای شمارش‌های *enum* است. امکان زیرکلاس‌سازی *EnumType* وجود دارد -- برای جزئیات، :ref:`زیرکلاس‌سازی EnumType ` را ببینید." -msgid "``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final *enum*, as well as creating the enum members, properly handling duplicates, providing iteration over the enum class, etc." +msgid "" +"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final *enum*, as well as " +"creating the enum members, properly handling duplicates, providing iteration over the enum class, etc." msgstr "" +"``EnumType`` مسئول تنظیم متدهای صحیح :meth:`!__repr__`، :meth:`!__str__`، :meth:`!__format__` و :meth:`!__reduce__` بر روی *enum* نهایی، و همچنین ایجاد اعضای enum، مدیریت صحیح " +"موارد تکراری، فراهم کردن تکرار بر روی کلاس enum و غیره است." msgid "Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available as an alias." -msgstr "" +msgstr "پیش از 3.11، ``EnumType`` با نام ``EnumMeta`` شناخته می‌شد، که هنوز به‌عنوان یک نام مستعار در دسترس است." msgid "This method is called in two different ways:" -msgstr "" +msgstr "این متد به دو روش مختلف فراخوانی می‌شود:" msgid "to look up an existing member:" -msgstr "" +msgstr "برای جست‌وجوی یک عضو موجود:" msgid "cls" -msgstr "" +msgstr "cls" msgid "The enum class being called." -msgstr "" +msgstr "کلاس enum که فراخوانی می‌شود." msgid "value" -msgstr "" +msgstr "مقدار" msgid "The value to lookup." -msgstr "" +msgstr "مقدار مورد جستجو." msgid "to use the ``cls`` enum to create a new enum (only if the existing enum does not have any members):" -msgstr "" +msgstr "برای استفاده از enum ``cls`` جهت ایجاد یک enum جدید (تنها در صورتی که enum موجود هیچ عضوی نداشته باشد):" msgid "The name of the new Enum to create." -msgstr "" +msgstr "نام Enum جدیدی که باید ایجاد شود." msgid "names" -msgstr "" +msgstr "نام‌ها" msgid "The names/values of the members for the new Enum." -msgstr "" +msgstr "نام‌ها/مقادیر اعضای Enum جدید." msgid "module" -msgstr "" +msgstr "ماژول" msgid "The name of the module the new Enum is created in." -msgstr "" +msgstr "نام ماژولی که Enum جدید در آن ایجاد می‌شود." msgid "qualname" -msgstr "" +msgstr "نام کامل (qualname)" msgid "The actual location in the module where this Enum can be found." -msgstr "" +msgstr "مکان واقعی در ماژول که این Enum در آن یافت می‌شود." msgid "type" -msgstr "" +msgstr "نوع" msgid "A mix-in type for the new Enum." -msgstr "" +msgstr "یک نوع میکس‌این برای Enum جدید." msgid "start" -msgstr "" +msgstr "شروع" msgid "The first integer value for the Enum (used by :class:`auto`)." -msgstr "" +msgstr "اولین مقدار عدد صحیح برای Enum (که توسط :class:`auto` استفاده می‌شود)." msgid "boundary" -msgstr "" +msgstr "مرز" msgid "How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "" +msgstr "چگونگی مدیریت مقادیر خارج از محدوده حاصل از عملیات بیتی (فقط :class:`Flag`)." msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "" +msgstr "اگر عضو به ``cls`` تعلق داشته باشد، ``True`` را برمی‌گرداند::" msgid "" ">>> some_var = Color.RED\n" @@ -296,92 +327,123 @@ msgid "" ">>> Color.RED.value in Color\n" "True" msgstr "" +">>> some_var = Color.RED\n" +">>> some_var in Color\n" +"True\n" +">>> Color.RED.value in Color\n" +"True" msgid "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used in a containment check." -msgstr "" +msgstr "پیش از Python 3.12، اگر از مقداری که عضو Enum نیست در بررسی عضویت استفاده شود، یک ``TypeError`` پرتاب می‌شود." msgid "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the names of the members in *cls*::" -msgstr "" +msgstr "``['__class__', '__doc__', '__members__', '__module__']`` و نام اعضای *cls* را برمی‌گرداند::" msgid "" ">>> dir(Color)\n" "['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', '__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', '__module__', '__name__', '__qualname__']" msgstr "" +">>> dir(Color)\n" +"['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', '__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', '__module__', '__name__', '__qualname__']" msgid "Returns the Enum member in *cls* matching *name*, or raises a :exc:`KeyError`::" -msgstr "" +msgstr "عضو Enum در *cls* را که با *name* مطابقت دارد برمی‌گرداند، یا یک :exc:`KeyError` را پرتاب می‌کند::" msgid "" ">>> Color['BLUE']\n" "" msgstr "" +">>> Color['BLUE']\n" +"" msgid "Returns each member in *cls* in definition order::" -msgstr "" +msgstr "هر یک از اعضای *cls* را به ترتیب تعریف برمی‌گرداند::" msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" +">>> list(Color)\n" +"[, , ]" msgid "Returns the number of members in *cls*::" -msgstr "" +msgstr "تعداد اعضای *cls* را برمی‌گرداند::" msgid "" ">>> len(Color)\n" "3" msgstr "" +">>> len(Color)\n" +"3" msgid "Returns a mapping of every enum name to its member, including aliases" -msgstr "" +msgstr "یک نگاشت از هر نام enum به عضو آن، از جمله نام‌های مستعار، برمی‌گرداند" msgid "Returns each member in *cls* in reverse definition order::" -msgstr "" +msgstr "هر یک از اعضای *cls* را به ترتیب معکوس تعریف برمی‌گرداند::" msgid "" ">>> list(reversed(Color))\n" "[, , ]" msgstr "" +">>> list(reversed(Color))\n" +"[, , ]" msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "" +msgstr "*Enum* کلاس پایه برای تمام شمارش‌های *enum* است." msgid "The name used to define the ``Enum`` member::" -msgstr "" +msgstr "نام استفاده‌شده برای تعریف عضو ``Enum``::" msgid "" ">>> Color.BLUE.name\n" "'BLUE'" msgstr "" +">>> Color.BLUE.name\n" +"'BLUE'" msgid "The value given to the ``Enum`` member::" -msgstr "" +msgstr "مقدار داده‌شده به عضو ``Enum``::" msgid "" ">>> Color.RED.value\n" "1" msgstr "" +">>> Color.RED.value\n" +"1" msgid "Value of the member, can be set in :meth:`~Enum.__new__`." -msgstr "" +msgstr "مقدار عضو را می‌توان در :meth:`~Enum.__new__` تنظیم کرد." msgid "Enum member values" -msgstr "" +msgstr "مقادیر اعضای Enum" -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." +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 "" +"مقادیر اعضا می‌توانند هر چیزی باشند: :class:`int`، :class:`str` و غیره. اگر مقدار دقیق مهم نیست، می‌توانید از نمونه‌های :class:`auto` استفاده کنید و مقدار مناسبی برای شما انتخاب " +"خواهد شد. برای جزئیات، :class:`auto` را ببینید." -msgid "While mutable/unhashable values, such as :class:`dict`, :class:`list` or a mutable :class:`~dataclasses.dataclass`, can be used, they will have a quadratic performance impact during creation relative to the total number of mutable/unhashable values in the enum." +msgid "" +"While mutable/unhashable values, such as :class:`dict`, :class:`list` or a mutable :class:`~dataclasses.dataclass`, can be used, they will have a quadratic performance impact " +"during creation relative to the total number of mutable/unhashable values in the enum." msgstr "" +"اگرچه می‌توان از مقادیر تغییرپذیر/هش‌ناپذیر (unhashable)، مانند :class:`dict`، :class:`list` یا یک :class:`~dataclasses.dataclass` تغییرپذیر استفاده کرد، اما این مقادیر در هنگام " +"ایجاد، تأثیری درجه‌دو بر عملکرد نسبت به تعداد کل مقادیر تغییرپذیر/هش‌ناپذیر در enum خواهند داشت." msgid "Name of the member." -msgstr "" +msgstr "نام عضو." msgid "No longer used, kept for backward compatibility. (class attribute, removed during class creation)." -msgstr "" +msgstr "دیگر استفاده نمی‌شود و برای سازگاری با نسخه‌های پیشین حفظ شده است. (صفت کلاس، در هنگام ایجاد کلاس حذف می‌شود)." -msgid "The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / Python 3 code in sync. It will be checked against the actual order of the enumeration and raise an error if the two do not match::" +msgid "" +"The :attr:`~Enum._order_` attribute can be provided to help keep Python 2 / Python 3 code in sync. It will be checked against the actual order of the enumeration and raise an " +"error if the two do not match::" msgstr "" +"می‌توان ویژگی :attr:`~Enum._order_` را برای کمک به همگام نگه‌داشتن کد Python 2 / Python 3 ارائه کرد. این ویژگی با ترتیب واقعی شمارش مقایسه می‌شود و اگر این دو با هم مطابقت نداشته " +"باشند، خطایی پرتاب می‌شود::" msgid "" ">>> class Color(Enum):\n" @@ -396,18 +458,31 @@ msgid "" " ['RED', 'BLUE', 'GREEN']\n" " ['RED', 'GREEN', 'BLUE']" msgstr "" +">>> class Color(Enum):\n" +"... _order_ = 'RED GREEN BLUE'\n" +"... RED = 1\n" +"... BLUE = 3\n" +"... GREEN = 2\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: member order does not match _order_:\n" +" ['RED', 'BLUE', 'GREEN']\n" +" ['RED', 'GREEN', 'BLUE']" msgid "In Python 2 code the :attr:`~Enum._order_` attribute is necessary as definition order is lost before it can be recorded." -msgstr "" +msgstr "در کد Python 2، ویژگی :attr:`~Enum._order_` ضروری است، زیرا ترتیب تعریف پیش از آنکه بتوان آن را ثبت کرد، از دست می‌رود." msgid "``_ignore_`` is only used during creation and is removed from the enumeration once creation is complete." -msgstr "" +msgstr "``_ignore_`` تنها در حین ایجاد استفاده می‌شود و پس از تکمیل ایجاد، از شمارش حذف می‌شود." -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 "" +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 "``_ignore_`` فهرستی از نام‌ها است که عضو نخواهند شد و نام‌هایشان نیز از شمارش کامل‌شده حذف خواهند شد. برای مشاهده یک مثال، :ref:`TimePeriod ` را ببینید." msgid "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any public methods defined on *self.__class__*::" -msgstr "" +msgstr "بازمی‌گرداند ``['__class__', '__doc__', '__module__', 'name', 'value']`` و هر متد عمومی تعریف‌شده در *self.__class__*::" msgid "" ">>> from enum import Enum\n" @@ -427,39 +502,55 @@ msgid "" ">>> dir(Weekday.SATURDAY)\n" "['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', 'today', 'value']" msgstr "" +">>> from enum import Enum\n" +">>> import datetime as dt\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... @classmethod\n" +"... def today(cls):\n" +"... print(f'today is {cls(dt.date.today().isoweekday()).name}')\n" +"...\n" +">>> dir(Weekday.SATURDAY)\n" +"['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', 'today', 'value']" msgid "name" -msgstr "" +msgstr "نام" msgid "The name of the member being defined (e.g. 'RED')." -msgstr "" +msgstr "نام عضوی که تعریف می‌شود (مثلاً 'RED')." msgid "The start value for the Enum; the default is 1." -msgstr "" +msgstr "مقدار شروع برای Enum؛ مقدار پیش‌فرض ۱ است." msgid "count" -msgstr "" +msgstr "تعداد" msgid "The number of members currently defined, not including this one." -msgstr "" +msgstr "تعداد اعضای تعریف‌شده در حال حاضر، بدون احتساب این عضو." msgid "last_values" -msgstr "" +msgstr "last_values" msgid "A list of the previous values." -msgstr "" +msgstr "فهرستی از مقادیر پیشین." msgid "A *staticmethod* that is used to determine the next value returned by :class:`auto`." -msgstr "" +msgstr "یک *staticmethod* که برای تعیین مقدار بعدی برگردانده‌شده توسط :class:`auto` استفاده می‌شود." msgid "For standard :class:`Enum` classes the next value chosen is the highest value seen incremented by one." -msgstr "" +msgstr "برای کلاس‌های استاندارد :class:`Enum`، مقدار بعدی انتخاب‌شده برابر با بالاترین مقدار مشاهده‌شده به‌اضافه‌ی یک است." msgid "For :class:`Flag` classes the next value chosen will be the next highest power-of-two." -msgstr "" +msgstr "برای کلاس‌های :class:`Flag`، مقدار انتخاب‌شده‌ی بعدی، بالاترین توان بعدی عدد ۲ خواهد بود." msgid "This method may be overridden, e.g.::" -msgstr "" +msgstr "می‌توان این متد را بازنویسی کرد، برای مثال::" msgid "" ">>> from enum import auto, Enum\n" @@ -473,21 +564,31 @@ msgid "" ">>> PowersOfThree.SECOND.value\n" "9" msgstr "" +">>> from enum import auto, Enum\n" +">>> class PowersOfThree(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return 3 ** (count + 1)\n" +"... FIRST = auto()\n" +"... SECOND = auto()\n" +"...\n" +">>> PowersOfThree.SECOND.value\n" +"9" msgid "Prior versions would use the last seen value instead of the highest value." -msgstr "" +msgstr "نسخه‌های پیشین به‌جای بیشترین مقدار، از آخرین مقدار دیده‌شده استفاده می‌کردند." msgid "By default, does nothing. If multiple values are given in the member assignment, those values become separate arguments to ``__init__``; e.g." -msgstr "" +msgstr "به‌طور پیش‌فرض، هیچ کاری انجام نمی‌دهد. اگر چندین مقدار در انتساب عضو داده شوند، آن مقادیر به آرگومان‌های جداگانه‌ای برای ``__init__`` تبدیل می‌شوند؛ برای مثال" msgid "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, 'Mon')``" -msgstr "" +msgstr "``Weekday.__init__()`` به‌صورت ``Weekday.__init__(self, 1, 'Mon')`` فراخوانی می‌شود" msgid "A *classmethod* that is used to further configure subsequent subclasses. By default, does nothing." -msgstr "" +msgstr "یک *classmethod* که برای پیکربندی بیشتر زیرکلاس‌های بعدی به کار می‌رود. به‌طور پیش‌فرض، کاری انجام نمی‌دهد." 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 "" +msgstr "یک *classmethod* برای جست‌وجوی مقادیری که در *cls* یافت نمی‌شوند. به‌طور پیش‌فرض هیچ کاری انجام نمی‌دهد، اما می‌توان آن را برای پیاده‌سازی رفتار جست‌وجوی سفارشی بازنویسی کرد::" msgid "" ">>> from enum import auto, StrEnum\n" @@ -507,18 +608,35 @@ msgid "" ">>> Build('deBUG')\n" "" msgstr "" +">>> from enum import auto, StrEnum\n" +">>> class Build(StrEnum):\n" +"... DEBUG = auto()\n" +"... OPTIMIZED = auto()\n" +"... @classmethod\n" +"... def _missing_(cls, value):\n" +"... value = value.lower()\n" +"... for member in cls:\n" +"... if member.value == value:\n" +"... return member\n" +"... return None\n" +"...\n" +">>> Build.DEBUG.value\n" +"'debug'\n" +">>> Build('deBUG')\n" +"" -msgid "By default, doesn't exist. If specified, either in the enum class definition or in a mixin class (such as ``int``), all values given in the member assignment will be passed; e.g." -msgstr "" +msgid "" +"By default, doesn't exist. If specified, either in the enum class definition or in a mixin class (such as ``int``), all values given in the member assignment will be passed; e.g." +msgstr "به‌طور پیش‌فرض، وجود ندارد. اگر مشخص شده باشد، چه در تعریف کلاس enum و چه در یک کلاس mixin (مانند ``int``)، تمام مقادیر داده‌شده در انتساب عضو ارسال خواهند شد؛ برای مثال" msgid "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." -msgstr "" +msgstr "به فراخوانی ``int('1a', 16)`` و مقدار ``26`` برای عضو منجر می‌شود." msgid "When writing a custom ``__new__``, do not use ``super().__new__`` -- call the appropriate ``__new__`` instead." -msgstr "" +msgstr "هنگام نوشتن ``__new__`` سفارشی، از ``super().__new__`` استفاده نکنید -- در عوض، ``__new__`` مناسب را فراخوانی کنید." msgid "Returns the string used for *repr()* calls. By default, returns the *Enum* name, member name, and value, but can be overridden::" -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که برای فراخوانی‌های *repr()* استفاده می‌شود. به‌طور پیش‌فرض، نام *Enum*، نام عضو و مقدار را برمی‌گرداند، اما می‌توان آن را بازنویسی کرد::" msgid "" ">>> from enum import auto, Enum\n" @@ -533,9 +651,20 @@ msgid "" ">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __repr__(self):\n" +"... cls_name = self.__class__.__name__\n" +"... return f'{cls_name}.{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" +"(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" msgid "Returns the string used for *str()* calls. By default, returns the *Enum* name and member name, but can be overridden::" -msgstr "" +msgstr "رشته‌ی استفاده‌شده برای فراخوانی‌های *str()* را بازمی‌گرداند. به‌طور پیش‌فرض، نام *Enum* و نام عضو را بازمی‌گرداند، اما می‌توان آن را بازنویسی کرد::" msgid "" ">>> from enum import auto, Enum\n" @@ -549,9 +678,19 @@ msgid "" ">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" "(, 'ALTERNATE', 'ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __str__(self):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" +"(, 'ALTERNATE', 'ALTERNATE')" msgid "Returns the string used for *format()* and *f-string* calls. By default, returns :meth:`__str__` return value, but can be overridden::" -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که برای فراخوانی‌های *format()* و *اف‌استرینگ* استفاده می‌شود. به‌طور پیش‌فرض، مقدار بازگشتی :meth:`__str__` را برمی‌گرداند، اما می‌توان آن را بازنویسی کرد::" msgid "" ">>> from enum import auto, Enum\n" @@ -565,66 +704,106 @@ msgid "" ">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" msgstr "" +">>> from enum import auto, Enum\n" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __format__(self, spec):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle.ALTERNATE}\"\n" +"(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" msgid "Using :class:`auto` with :class:`Enum` results in integers of increasing value, starting with ``1``." -msgstr "" +msgstr "استفاده از :class:`auto` همراه با :class:`Enum` منجر به اعداد صحیحی با مقادیر افزایشی می‌شود که از ``1`` شروع می‌شوند." msgid "Added :ref:`enum-dataclass-support`" -msgstr "" +msgstr ":ref:`enum-dataclass-support` افزوده شد" msgid "Adds a new name as an alias to an existing member::" -msgstr "" +msgstr "یک نام جدید را به‌عنوان نام مستعار به یک عضو موجود اضافه می‌کند::" msgid "" ">>> Color.RED._add_alias_(\"ERROR\")\n" ">>> Color.ERROR\n" "" msgstr "" +">>> Color.RED._add_alias_(\"ERROR\")\n" +">>> Color.ERROR\n" +"" msgid "Raises a :exc:`NameError` if the name is already assigned to a different member." -msgstr "" +msgstr "اگر نام از پیش به عضو دیگری اختصاص داده شده باشد، یک :exc:`NameError` پرتاب می‌کند." msgid "Adds a new value as an alias to an existing member::" -msgstr "" +msgstr "یک مقدار جدید را به‌عنوان نام مستعار برای یک عضو موجود اضافه می‌کند::" msgid "" ">>> Color.RED._add_value_alias_(42)\n" ">>> Color(42)\n" "" msgstr "" +">>> Color.RED._add_value_alias_(42)\n" +">>> Color(42)\n" +"" msgid "Raises a :exc:`ValueError` if the value is already linked with a different member." -msgstr "" +msgstr "اگر مقدار از قبل به عضو دیگری پیوند داده شده باشد، یک :exc:`ValueError` پرتاب می‌کند." msgid "See :ref:`multi-value-enum` for an example." -msgstr "" +msgstr "برای دیدن یک مثال به :ref:`multi-value-enum` مراجعه کنید." -msgid "*IntEnum* is the same as :class:`Enum`, but its members are also integers and can be used anywhere that an integer can be used. If any integer operation is performed with an *IntEnum* member, the resulting value loses its enumeration status." +msgid "" +"*IntEnum* is the same as :class:`Enum`, but its members are also integers and can be used anywhere that an integer can be used. If any integer operation is performed with an " +"*IntEnum* member, the resulting value loses its enumeration status." msgstr "" +"*IntEnum* همانند :class:`Enum` است، اما اعضای آن همچنین عدد صحیح هستند و می‌توانند در هر جایی که یک عدد صحیح می‌تواند استفاده شود، به کار روند. اگر هرگونه عملیات مربوط به عدد صحیح " +"با یک عضو *IntEnum* انجام شود، مقدار حاصل وضعیت شمارشی خود را از دست می‌دهد." msgid "Using :class:`auto` with :class:`IntEnum` results in integers of increasing value, starting with ``1``." -msgstr "" +msgstr "استفاده از :class:`auto` با :class:`IntEnum` باعث ایجاد اعداد صحیحی با مقادیر افزایشی می‌شود که از ``1`` شروع می‌شوند." -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." +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 "" +":meth:`~object.__str__` اکنون :meth:`!int.__str__` است تا بهتر از کاربرد *جایگزینی ثابت‌های موجود* پشتیبانی کند. :meth:`~object.__format__` از پیش به همین دلیل :meth:`!" +"int.__format__` بود." -msgid "*StrEnum* is the same as :class:`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 any string operation performed on or with a *StrEnum* member is not part of the enumeration." +msgid "" +"*StrEnum* is the same as :class:`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 any string operation " +"performed on or with a *StrEnum* member is not part of the enumeration." msgstr "" +"*StrEnum* همانند :class:`Enum` است، اما اعضای آن نیز رشته هستند و می‌توان از آن‌ها در بیشتر همان جاهایی استفاده کرد که از یک رشته استفاده می‌شود. نتیجه‌ی هر عملیات رشته‌ای که بر روی یک " +"عضو *StrEnum* یا با آن انجام شود، بخشی از شمارش نیست." -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 ``isinstance(unknown, str)``), and in those locations you will need to use ``str(MyStrEnum.MY_MEMBER)``." +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 ``isinstance(unknown, str)``), and " +"in those locations you will need to use ``str(MyStrEnum.MY_MEMBER)``." msgstr "" +"در کتابخانه استاندارد (stdlib) جاهایی وجود دارند که دقیقاً :class:`str` را به‌جای زیرکلاسی از :class:`str` بررسی می‌کنند (یعنی ``type(unknown) == str`` به‌جای ``isinstance(unknown, " +"str)``)، و در آن مکان‌ها باید از ``str(MyStrEnum.MY_MEMBER)`` استفاده کنید." msgid "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member name as the value." -msgstr "" +msgstr "استفاده از :class:`auto` با :class:`StrEnum` منجر به استفاده از نام عضو با حروف کوچک به‌عنوان مقدار می‌شود." -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." +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 "" +":meth:`~object.__str__` همان :meth:`!str.__str__` است تا بهتر از مورد استفاده‌ی *جایگزینی ثابت‌های موجود* پشتیبانی کند. :meth:`~object.__format__` نیز به همین دلیل همان :meth:`!" +"str.__format__` است." -msgid "``Flag`` is the same as :class:`Enum`, but its members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operations are (aliases of) members of the enumeration." +msgid "" +"``Flag`` is the same as :class:`Enum`, but its members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); the results of those " +"operations are (aliases of) members of the enumeration." msgstr "" +"``Flag`` همان :class:`Enum` است، اما اعضای آن از عملگرهای بیتی ``&`` (*AND*)، ``|`` (*OR*)، ``^`` (*XOR*) و ``~`` (*INVERT*) پشتیبانی می‌کنند؛ نتایج این عملیات، اعضای این شمارش " +"هستند (نام‌های مستعار اعضای آن)." msgid "Returns *True* if value is in self::" -msgstr "" +msgstr "اگر مقدار در self وجود داشته باشد، *True* را برمی‌گرداند::" msgid "" ">>> from enum import Flag, auto\n" @@ -644,9 +823,25 @@ msgid "" ">>> white in purple\n" "False" msgstr "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> purple = Color.RED | Color.BLUE\n" +">>> white = Color.RED | Color.GREEN | Color.BLUE\n" +">>> Color.GREEN in purple\n" +"False\n" +">>> Color.GREEN in white\n" +"True\n" +">>> purple in white\n" +"True\n" +">>> white in purple\n" +"False" msgid "Returns all contained non-alias members::" -msgstr "" +msgstr "تمام اعضای غیرمستعار موجود را بازمی‌گرداند::" msgid "" ">>> list(Color.RED)\n" @@ -654,9 +849,13 @@ msgid "" ">>> list(purple)\n" "[, ]" msgstr "" +">>> list(Color.RED)\n" +"[]\n" +">>> list(purple)\n" +"[, ]" msgid "Returns number of members in flag::" -msgstr "" +msgstr "تعداد اعضای پرچم را برمی‌گرداند::" msgid "" ">>> len(Color.GREEN)\n" @@ -664,9 +863,13 @@ msgid "" ">>> len(white)\n" "3" msgstr "" +">>> len(Color.GREEN)\n" +"1\n" +">>> len(white)\n" +"3" msgid "Returns *True* if any members in flag, *False* otherwise::" -msgstr "" +msgstr "اگر پرچم دارای حداقل یک عضو باشد، *True* و در غیر این صورت *False* برمی‌گرداند::" msgid "" ">>> bool(Color.GREEN)\n" @@ -677,17 +880,26 @@ msgid "" ">>> bool(black)\n" "False" msgstr "" +">>> bool(Color.GREEN)\n" +"True\n" +">>> bool(white)\n" +"True\n" +">>> black = Color(0)\n" +">>> bool(black)\n" +"False" msgid "Returns current flag binary or'ed with other::" -msgstr "" +msgstr "مقدار دودویی پرچم جاری را که با other به‌صورت OR دودویی ترکیب شده است، برمی‌گرداند::" msgid "" ">>> Color.RED | Color.GREEN\n" "" msgstr "" +">>> Color.RED | Color.GREEN\n" +"" msgid "Returns current flag binary and'ed with other::" -msgstr "" +msgstr "پرچم فعلی را که با other AND دودویی‌شده است برمی‌گرداند::" msgid "" ">>> purple & white\n" @@ -695,9 +907,13 @@ msgid "" ">>> purple & Color.GREEN\n" "" msgstr "" +">>> purple & white\n" +"\n" +">>> purple & Color.GREEN\n" +"" msgid "Returns current flag binary xor'ed with other::" -msgstr "" +msgstr "پرچم فعلی را که با other XOR دودویی‌شده است، برمی‌گرداند::" msgid "" ">>> purple ^ white\n" @@ -705,9 +921,13 @@ msgid "" ">>> purple ^ Color.GREEN\n" "" msgstr "" +">>> purple ^ white\n" +"\n" +">>> purple ^ Color.GREEN\n" +"" msgid "Returns all the flags in *type(self)* that are not in *self*::" -msgstr "" +msgstr "تمام پرچم‌های موجود در *type(self)* را که در *self* نیستند، برمی‌گرداند::" msgid "" ">>> ~white\n" @@ -717,70 +937,91 @@ msgid "" ">>> ~Color.RED\n" "" msgstr "" +">>> ~white\n" +"\n" +">>> ~purple\n" +"\n" +">>> ~Color.RED\n" +"" 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 "" +msgstr "تابعی که برای قالب‌بندی هر مقدار عددی بی‌نام باقی‌مانده استفاده می‌شود. پیش‌فرض، repr مقدار است؛ انتخاب‌های رایج :func:`hex` و :func:`oct` هستند." msgid "Using :class:`auto` with :class:`Flag` results in integers that are powers of two, starting with ``1``." -msgstr "" +msgstr "استفاده از :class:`auto` با :class:`Flag` منجر به اعداد صحیحی می‌شود که توان‌های دو هستند و با ``1`` شروع می‌شوند." msgid "The *repr()* of zero-valued flags has changed. It is now:" -msgstr "" +msgstr "خروجی *repr()* پرچم‌های با مقدار صفر تغییر کرده است. اکنون به این صورت است:" msgid "``IntFlag`` is the same as :class:`Flag`, but its members are also integers and can be used anywhere that an integer can be used." -msgstr "" +msgstr "``IntFlag`` همان :class:`Flag` است، اما اعضای آن همچنین اعداد صحیح هستند و می‌توانند در هر جایی که بتوان از یک عدد صحیح استفاده کرد، به کار بروند." msgid "If any integer operation is performed with an *IntFlag* member, the result is not an *IntFlag*::" -msgstr "" +msgstr "اگر هرگونه عملیات عدد صحیح با یک عضو *IntFlag* انجام شود، نتیجه یک *IntFlag* نخواهد بود::" msgid "" ">>> Color.RED + 2\n" "3" msgstr "" +">>> Color.RED + 2\n" +"3" msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" -msgstr "" +msgstr "اگر یک عملیات :class:`Flag` با یک عضو *IntFlag* انجام شود و:" msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" -msgstr "" +msgstr "نتیجه یک *IntFlag* معتبر است: یک *IntFlag* بازگردانده می‌شود" msgid "the result is not a valid *IntFlag*: the result depends on the :class:`FlagBoundary` setting" -msgstr "" +msgstr "نتیجه یک *IntFlag* معتبر نیست: نتیجه به تنظیم :class:`FlagBoundary` بستگی دارد" msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now::" -msgstr "" +msgstr "خروجی :func:`repr` پرچم‌های بی‌نام با مقدار صفر تغییر کرده است. اکنون به این صورت است::" msgid "" ">>> Color(0)\n" "" msgstr "" +">>> Color(0)\n" +"" msgid "Using :class:`auto` with :class:`IntFlag` results in integers that are powers of two, starting with ``1``." -msgstr "" +msgstr "استفاده از :class:`auto` همراه با :class:`IntFlag`، به اعداد صحیحی منجر می‌شود که توان‌های دو هستند و از ``1`` شروع می‌شوند." -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." +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 "" +":meth:`~object.__str__` اکنون :meth:`!int.__str__` است تا بهتر از سناریوی استفاده‌ی *جایگزینی ثابت‌های موجود* پشتیبانی کند. :meth:`~object.__format__` از پیش به همین دلیل :meth:`!" +"int.__format__` بود." -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." +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 "" +"وارونه‌سازی یک :class:`!IntFlag` اکنون به‌جای یک مقدار منفی، مقدار مثبتی را برمی‌گرداند که اجتماع تمام پرچم‌هایی است که در پرچم داده‌شده وجود ندارند. این با رفتار موجود :class:`Flag` " +"مطابقت دارد." msgid ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, but the :class:`str() ` of the mixed-in data type:" -msgstr "" +msgstr ":class:`!ReprEnum` از :meth:`repr() ` :class:`Enum` استفاده می‌کند، اما از :class:`str() `\\ نوع داده‌ی افزوده‌شده (mixed-in) استفاده می‌کند:" msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" -msgstr "" +msgstr ":meth:`!int.__str__` برای :class:`IntEnum` و :class:`IntFlag`" msgid ":meth:`!str.__str__` for :class:`StrEnum`" -msgstr "" +msgstr ":meth:`!str.__str__` برای :class:`StrEnum`" -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() `." +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 "" +"برای حفظ :class:`str() ` / :func:`format` نوع داده‌ی افزوده‌شده (mixed-in) به‌جای استفاده از :meth:`str() ` پیش‌فرض :class:`Enum`، از :class:`!ReprEnum` ارث ببرید." msgid "*EnumCheck* contains the options used by the :func:`verify` decorator to ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" +"*EnumCheck* شامل گزینه‌هایی است که دکوراتور :func:`verify` برای اطمینان از برقراری محدودیت‌های مختلف از آن‌ها استفاده می‌کند؛ محدودیت‌های ناموفق به یک :exc:`ValueError` منجر می‌شوند." msgid "Ensure that each value has only one name::" -msgstr "" +msgstr "اطمینان حاصل کنید که هر مقدار تنها یک نام دارد::" msgid "" ">>> from enum import Enum, verify, UNIQUE\n" @@ -794,9 +1035,19 @@ msgid "" "...\n" "ValueError: aliases found in : CRIMSON -> RED" msgstr "" +">>> from enum import Enum, verify, UNIQUE\n" +">>> @verify(UNIQUE)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... CRIMSON = 1\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: aliases found in : CRIMSON -> RED" msgid "Ensure that there are no missing values between the lowest-valued member and the highest-valued member::" -msgstr "" +msgstr "اطمینان حاصل کنید که هیچ مقدار جاافتاده‌ای بین عضو با کم‌ترین مقدار و عضو با بیش‌ترین مقدار وجود ندارد::" msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" @@ -809,9 +1060,18 @@ msgid "" "...\n" "ValueError: invalid enum 'Color': missing values 3, 4" msgstr "" +">>> from enum import Enum, verify, CONTINUOUS\n" +">>> @verify(CONTINUOUS)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 5\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid enum 'Color': missing values 3, 4" msgid "Ensure that any flag groups/masks contain only named flags -- useful when values are specified instead of being generated by :func:`auto`::" -msgstr "" +msgstr "اطمینان حاصل کنید که هر گروه/ماسک پرچم فقط شامل پرچم‌های نام‌دار باشد — زمانی مفید است که مقادیر به‌جای تولید شدن توسط :func:`auto` مشخص شده باشند::" msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" @@ -826,15 +1086,26 @@ msgid "" "...\n" "ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing combined values of 0x18 [use enum.show_flag_values(value) for details]" msgstr "" +">>> from enum import Flag, verify, NAMED_FLAGS\n" +">>> @verify(NAMED_FLAGS)\n" +"... class Color(Flag):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... WHITE = 15\n" +"... NEON = 31\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing combined values of 0x18 [use enum.show_flag_values(value) for details]" msgid "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." -msgstr "" +msgstr "CONTINUOUS و NAMED_FLAGS برای کار با اعضای دارای مقدار عدد صحیح طراحی شده‌اند." msgid "``FlagBoundary`` controls how out-of-range values are handled in :class:`Flag` and its subclasses." -msgstr "" +msgstr "``FlagBoundary`` کنترل می‌کند که مقادیر خارج از محدوده در :class:`Flag` و زیرکلاس‌های آن چگونه مدیریت شوند." msgid "Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`::" -msgstr "" +msgstr "مقدارهای خارج از محدوده باعث پرتاب :exc:`ValueError` می‌شوند. این حالت پیش‌فرض برای :class:`Flag` است::" msgid "" ">>> from enum import Flag, STRICT, auto\n" @@ -850,9 +1121,21 @@ msgid "" " given 0b0 10100\n" " allowed 0b0 00111" msgstr "" +">>> from enum import Flag, STRICT, auto\n" +">>> class StrictFlag(Flag, boundary=STRICT):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> StrictFlag(2**2 + 2**4)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid value 20\n" +" given 0b0 10100\n" +" allowed 0b0 00111" msgid "Out-of-range values have invalid values removed, leaving a valid :class:`Flag` value::" -msgstr "" +msgstr "در مقادیر خارج از محدوده، مقادیر نامعتبر حذف می‌شوند و یک مقدار معتبر :class:`Flag` باقی می‌ماند::" msgid "" ">>> from enum import Flag, CONFORM, auto\n" @@ -864,12 +1147,20 @@ msgid "" ">>> ConformFlag(2**2 + 2**4)\n" "" msgstr "" +">>> from enum import Flag, CONFORM, auto\n" +">>> class ConformFlag(Flag, boundary=CONFORM):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> ConformFlag(2**2 + 2**4)\n" +"" msgid "Out-of-range values lose their :class:`Flag` membership and revert to :class:`int`." -msgstr "" +msgstr "مقدارهای خارج از محدوده، عضویت خود در :class:`Flag` را از دست می‌دهند و به :class:`int` بازمی‌گردند." msgid "Out-of-range values are kept, and the :class:`Flag` membership is kept. This is the default for :class:`IntFlag`::" -msgstr "" +msgstr "مقادیر خارج از محدوده حفظ می‌شوند، و عضویت در :class:`Flag` حفظ می‌شود. این پیش‌فرض برای :class:`IntFlag` است::" msgid "" ">>> from enum import Flag, KEEP, auto\n" @@ -881,102 +1172,138 @@ msgid "" ">>> KeepFlag(2**2 + 2**4)\n" "" msgstr "" +">>> from enum import Flag, KEEP, auto\n" +">>> class KeepFlag(Flag, boundary=KEEP):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> KeepFlag(2**2 + 2**4)\n" +"" -msgid "*EnumDict* is a subclass of :class:`dict` that is used as the namespace for defining enum classes (see :ref:`prepare`). It is exposed to allow subclasses of :class:`EnumType` with advanced behavior like having multiple values per member. It should be called with the name of the enum class being created, otherwise private names and internal classes will not be handled correctly." +msgid "" +"*EnumDict* is a subclass of :class:`dict` that is used as the namespace for defining enum classes (see :ref:`prepare`). It is exposed to allow subclasses of :class:`EnumType` with " +"advanced behavior like having multiple values per member. It should be called with the name of the enum class being created, otherwise private names and internal classes will not " +"be handled correctly." msgstr "" +"*EnumDict* یک زیرکلاس از :class:`dict` است که به‌عنوان فضای نام برای تعریف کلاس‌های enum استفاده می‌شود (به :ref:`prepare` مراجعه کنید). این کلاس در دسترس قرار داده شده است تا " +"زیرکلاس‌هایی از :class:`EnumType` با رفتار پیشرفته، مانند داشتن چندین مقدار به ازای هر عضو، امکان‌پذیر شوند. باید با نام کلاس enum در حال ایجاد فراخوانی شود، در غیر این صورت نام‌های " +"خصوصی و کلاس‌های داخلی به‌درستی مدیریت نخواهند شد." -msgid "Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be possible to bypass the checks using other :class:`!dict` operations like :meth:`|= `." +msgid "" +"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be possible to bypass the checks " +"using other :class:`!dict` operations like :meth:`|= `." msgstr "" +"توجه داشته باشید که فقط رابط :class:`~collections.abc.MutableMapping` (:meth:`~object.__setitem__` و :meth:`~dict.update`) بازنویسی شده است. ممکن است بتوان با استفاده از سایر " +"عملیات‌های :class:`!dict` مانند :meth:`|= ` این بررسی‌ها را دور زد." msgid "A list of member names." -msgstr "" +msgstr "فهرستی از نام‌های اعضا." msgid "Supported ``__dunder__`` names" -msgstr "" +msgstr "نام‌های ``__dunder__`` پشتیبانی‌شده" msgid ":attr:`~EnumType.__members__` is a read-only ordered mapping of ``member_name``:``member`` items. It is only available on the class." -msgstr "" +msgstr ":attr:`~EnumType.__members__` یک نگاشت مرتب فقط‌خواندنی از آیتم‌های ``member_name``:``member`` است. این ویژگی فقط بر روی کلاس در دسترس است." -msgid ":meth:`~Enum.__new__`, if specified, must create and return the enum members; it is also a very good idea to set the member's :attr:`~Enum._value_` appropriately. Once all the members are created it is no longer used." +msgid "" +":meth:`~Enum.__new__`, if specified, must create and return the enum members; it is also a very good idea to set the member's :attr:`~Enum._value_` appropriately. Once all the " +"members are created it is no longer used." msgstr "" +":meth:`~Enum.__new__`، در صورت مشخص شدن، باید اعضای enum را ایجاد کرده و بازگرداند؛ همچنین بسیار خوب است که :attr:`~Enum._value_` عضو را به‌شکل مناسبی تنظیم کنید. پس از ایجاد همه " +"اعضا، دیگر از آن استفاده نمی‌شود." msgid "Supported ``_sunder_`` names" -msgstr "" +msgstr "نام‌های ``_sunder_`` پشتیبانی‌شده" msgid ":attr:`~Enum._name_` -- name of the member" -msgstr "" +msgstr ":attr:`~Enum._name_` -- نام عضو" msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" -msgstr "" +msgstr ":attr:`~Enum._value_` -- مقدار عضو؛ می‌تواند در ``__new__`` تنظیم شود" msgid ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; may be overridden" -msgstr "" +msgstr ":meth:`~Enum._missing_` -- تابع جست‌وجویی که هنگام پیدا نشدن یک مقدار استفاده می‌شود؛ می‌توان آن را بازنویسی کرد" msgid ":attr:`~Enum._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 "" +msgstr ":attr:`~Enum._ignore_` -- فهرستی از نام‌ها، چه به‌صورت یک :class:`list` و چه به‌صورت یک :class:`str`، که به اعضا تبدیل نخواهند شد و از کلاس نهایی حذف خواهند شد" msgid ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility (class attribute, removed during class creation)" -msgstr "" +msgstr ":attr:`~Enum._order_` -- دیگر استفاده نمی‌شود، برای سازگاری با نسخه‌های پیشین حفظ شده است (ویژگی کلاس، در هنگام ایجاد کلاس حذف می‌شود)" msgid ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for an enum member; may be overridden" -msgstr "" +msgstr ":meth:`~Enum._generate_next_value_` -- برای دریافت مقدار مناسب برای یک عضو enum به کار می‌رود؛ قابل بازنویسی است" msgid ":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing member." -msgstr "" +msgstr ":meth:`~Enum._add_alias_` -- یک نام جدید را به‌عنوان نام مستعار به یک عضو موجود اضافه می‌کند." msgid ":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an existing member." -msgstr "" +msgstr ":meth:`~Enum._add_value_alias_` -- یک مقدار جدید را به‌عنوان نام مستعار به یک عضو موجود اضافه می‌کند." msgid "While ``_sunder_`` names are generally reserved for the further development of the :class:`Enum` class and can not be used, some are explicitly allowed:" -msgstr "" +msgstr "اگرچه نام‌های ``_sunder_`` به‌طور کلی برای توسعه‌ی آتی کلاس :class:`Enum` رزرو شده‌اند و نمی‌توان از آن‌ها استفاده کرد، برخی به‌طور صریح مجاز هستند:" msgid "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" -msgstr "" +msgstr "``_repr_*`` (برای مثال ``_repr_html_``)، همان‌طور که در `IPython's rich display`_ استفاده می‌شود" msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" -msgstr "" +msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" msgid "``_ignore_``" -msgstr "" +msgstr "``_ignore_``" msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" -msgstr "" +msgstr "``_add_alias_``، ``_add_value_alias_``، ``_repr_*``" msgid "Utilities and decorators" -msgstr "" +msgstr "ابزارهای کاربردی و دکوراتورها" -msgid "*auto* can be used in place of a value. If used, the *Enum* machinery will call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an appropriate value. For :class:`Enum` and :class:`IntEnum` that appropriate value will be the last value plus one; for :class:`Flag` and :class:`IntFlag` it will be the first power-of-two greater than the highest value; for :class:`StrEnum` it will be the lower-cased version of the member's name. Care must be taken if mixing *auto()* with manually specified values." +msgid "" +"*auto* can be used in place of a value. If used, the *Enum* machinery will call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an appropriate value. " +"For :class:`Enum` and :class:`IntEnum` that appropriate value will be the last value plus one; for :class:`Flag` and :class:`IntFlag` it will be the first power-of-two greater " +"than the highest value; for :class:`StrEnum` it will be the lower-cased version of the member's name. Care must be taken if mixing *auto()* with manually specified values." msgstr "" +"از *auto* می‌توان به‌جای یک مقدار استفاده کرد. در صورت استفاده، سازوکار *Enum* متد :meth:`~Enum._generate_next_value_` یک :class:`Enum` را فراخوانی می‌کند تا مقدار مناسبی به دست " +"آورد. برای :class:`Enum` و :class:`IntEnum`، آن مقدار مناسب برابر با آخرین مقدار به‌علاوه یک خواهد بود؛ برای :class:`Flag` و :class:`IntFlag`، اولین توانِ ۲ که از بیشترین مقدار " +"بزرگ‌تر باشد خواهد بود؛ برای :class:`StrEnum`، نام عضو با حروف کوچک خواهد بود. هنگام ترکیب *auto()* با مقادیر مشخص‌شده به‌صورت دستی باید دقت کنید." msgid "*auto* instances are only resolved when at the top level of an assignment, either by itself or as part of a tuple:" -msgstr "" +msgstr "نمونه‌های *auto* تنها زمانی حل می‌شوند که در بالاترین سطح یک انتساب قرار داشته باشند، چه به‌تنهایی و چه به‌عنوان بخشی از یک تاپل:" msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" -msgstr "" +msgstr "``FIRST = auto()`` کار خواهد کرد (auto() با ``1`` جایگزین می‌شود)؛" msgid "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is used to create the ``SECOND`` enum member;" -msgstr "" +msgstr "``SECOND = auto(), -2`` کار خواهد کرد (auto با ``2`` جایگزین می‌شود، بنابراین ``2, -2`` برای ایجاد عضو ``SECOND`` در enum استفاده می‌شود؛" msgid "``THREE = [auto(), -3]`` will *not* work (``[, -3]`` is used to create the ``THREE`` enum member)" -msgstr "" +msgstr "``THREE = [auto(), -3]`` کار *نخواهد کرد* (``[, -3]`` برای ایجاد عضو enum ``THREE`` استفاده می‌شود)" msgid "In prior versions, ``auto()`` had to be the only thing on the assignment line to work properly." -msgstr "" +msgstr "در نسخه‌های پیشین، ``auto()`` باید تنها مورد موجود در خط انتساب می‌بود تا به‌درستی کار کند." msgid "``_generate_next_value_`` can be overridden to customize the values used by *auto*." -msgstr "" +msgstr "می‌توان ``_generate_next_value_`` را برای سفارشی‌سازی مقادیر استفاده‌شده توسط *auto* بازنویسی کرد." 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 "" +msgstr "در 3.13، ``_generate_next_value_`` پیش‌فرض همیشه بالاترین مقدار عضو را با افزایش ۱ برمی‌گرداند و اگر نوع هر یک از اعضا ناسازگار باشد، شکست خواهد خورد." msgid "A decorator similar to the built-in :deco:`property`, but specifically for enumerations. It allows member attributes to have the same names as members themselves." -msgstr "" +msgstr "دکوراتوری مشابه :deco:`property` توکار، اما به‌طور خاص برای شمارش‌ها. این دکوراتور اجازه می‌دهد ویژگی‌های اعضا نام‌هایی مشابه نام خود اعضا داشته باشند." -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, and *Enum* subclasses can define members with the names ``value`` and ``name``." +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, and *Enum* subclasses can define " +"members with the names ``value`` and ``name``." msgstr "" +"*پراپرتی* و عضو باید در کلاس‌های جداگانه تعریف شوند؛ برای مثال، ویژگی‌های *value* و *name* در کلاس *Enum* تعریف شده‌اند و زیرکلاس‌های *Enum* می‌توانند اعضایی با نام‌های ``value`` و " +"``name`` تعریف کنند." -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::" +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 "" +"یک دکوراتور :keyword:`class` به‌طور خاص برای شمارش‌ها. این دکوراتور :attr:`~EnumType.__members__` یک شمارش را جستجو می‌کند و هر نام مستعاری را که بیابد، گردآوری می‌کند؛ در صورت یافتن " +"هر نام مستعار، :exc:`ValueError` همراه با جزئیات پرتاب می‌شود::" msgid "" ">>> from enum import Enum, unique\n" @@ -991,51 +1318,73 @@ msgid "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" msgstr "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" -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 "" +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 "یک آراینده :keyword:`class` به‌طور خاص برای شمارش‌ها. از اعضای :class:`EnumCheck` برای مشخص کردن اینکه کدام محدودیت‌ها باید بر روی شمارش آراسته‌شده بررسی شوند، استفاده می‌شود." msgid "A decorator for use in enums: its target will become a member." -msgstr "" +msgstr "دکوراتوری برای استفاده در enumها: هدف آن به یک عضو تبدیل می‌شود." msgid "A decorator for use in enums: its target will not become a member." -msgstr "" +msgstr "دکوراتوری برای استفاده در enumها: هدف آن به یک عضو تبدیل نمی‌شود." -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 only be used when the enum members are exported to the module global namespace (see :class:`re.RegexFlag` for an example)." +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 only be used when the enum " +"members are exported to the module global namespace (see :class:`re.RegexFlag` for an example)." msgstr "" +"یک دکوراتور برای تغییر :class:`str() ` و :func:`repr` یک enum تا اعضای آن به‌عنوان متعلق به ماژول، نه کلاس آن، نشان داده شوند. این دکوراتور فقط باید زمانی استفاده شود که اعضای " +"enum به فضای نام سراسری ماژول صادر شده‌اند (برای نمونه :class:`re.RegexFlag` را ببینید)." msgid "Return a list of all power-of-two integers contained in a flag *value*." -msgstr "" +msgstr "فهرستی از تمام اعداد صحیح توان دو موجود در یک *مقدار* پرچم را برمی‌گرداند." msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" -msgstr "" +msgstr ":class:`IntEnum`، :class:`StrEnum` و :class:`IntFlag`" 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 "" +msgstr "این سه نوع enum به‌عنوان جایگزین‌های مستقیم (drop-in) برای مقادیر موجود مبتنی بر عدد صحیح و رشته طراحی شده‌اند؛ به همین دلیل، محدودیت‌های اضافی دارند:" msgid "``__str__`` uses the value and not the name of the enum member" -msgstr "" +msgstr "``__str__`` از مقدار عضو enum استفاده می‌کند، نه از نام آن" msgid "``__format__``, because it uses ``__str__``, will also use the value of the enum member instead of its name" -msgstr "" +msgstr "``__format__`` نیز، از آن‌جا که از ``__str__`` استفاده می‌کند، از مقدار عضو enum به‌جای نام آن استفاده خواهد کرد" 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 "" +msgstr "اگر به آن محدودیت‌ها نیاز ندارید یا آن‌ها را نمی‌خواهید، می‌توانید خودتان کلاس پایه‌ی خود را با درآمیختن نوع ``int`` یا ``str`` بسازید::" msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" "... pass" msgstr "" +">>> from enum import Enum\n" +">>> class MyIntEnum(int, Enum):\n" +"... pass" msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" -msgstr "" +msgstr "یا می‌توانید :meth:`str` مناسب و غیره را در enum خود مجدداً انتساب دهید::" msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" "... __str__ = Enum.__str__" msgstr "" +">>> from enum import Enum, IntEnum\n" +">>> class MyIntEnum(IntEnum):\n" +"... __str__ = Enum.__str__" diff --git a/library/errno.po b/library/errno.po index 3ff7c71e1..2ed137eb2 100644 --- a/library/errno.po +++ b/library/errno.po @@ -13,493 +13,587 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"PO-Revision-Date: 2026-08-28 11:25+0330\n" +"Last-Translator: \n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!errno` --- Standard errno system symbols" -msgstr "" +msgstr ":mod:`!errno` --- نمادهای سیستمی استاندارد errno" -msgid "This module makes available standard ``errno`` system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from :file:`linux/include/errno.h`, which should be all-inclusive." +msgid "" +"This module makes available standard ``errno`` system symbols. The value of " +"each symbol is the corresponding integer value. The names and descriptions " +"are borrowed from :file:`linux/include/errno.h`, which should be all-" +"inclusive." msgstr "" +"این ماژول نمادهای سیستمی استاندارد ``errno`` را در دسترس قرار می‌دهد. مقدار " +"هر نماد، مقدار عدد صحیح متناظر آن است. نام‌ها و توضیحات از :file:`linux/" +"include/errno.h` گرفته شده‌اند، که باید شامل همه موارد باشد." -msgid "Dictionary providing a mapping from the errno value to the string name in the underlying system. For instance, ``errno.errorcode[errno.EPERM]`` maps to ``'EPERM'``." +msgid "" +"Dictionary providing a mapping from the errno value to the string name in " +"the underlying system. For instance, ``errno.errorcode[errno.EPERM]`` maps " +"to ``'EPERM'``." msgstr "" +"دیکشنری‌ای که نگاشتی از مقدار errno به نام رشته‌ای در سیستم زیرین ارائه " +"می‌دهد. برای مثال، ``errno.errorcode[errno.EPERM]`` به ``'EPERM'`` نگاشت " +"می‌شود." -msgid "To translate a numeric error code to an error message, use :func:`os.strerror`." +msgid "" +"To translate a numeric error code to an error message, " +"use :func:`os.strerror`." msgstr "" +"برای تبدیل یک کد خطای عددی به پیام خطا، از :func:`os.strerror` استفاده کنید." -msgid "Of the following list, symbols that are not used on the current platform are not defined by the module. The specific list of defined symbols is available as ``errno.errorcode.keys()``. Symbols available can include:" +msgid "" +"Of the following list, symbols that are not used on the current platform " +"are not defined by the module. The specific list of defined symbols is " +"available as ``errno.errorcode.keys()``. Symbols available can include:" msgstr "" +"از میان فهرست زیر، نمادهایی که در سکوی فعلی استفاده نمی‌شوند، توسط ماژول " +"تعریف نشده‌اند. فهرست مشخصی از نمادهای تعریف‌شده به‌صورت " +"``errno.errorcode.keys()`` در دسترس است. نمادهای در دسترس ممکن است شامل " +"موارد زیر باشند:" -msgid "Operation not permitted. This error is mapped to the exception :exc:`PermissionError`." +msgid "" +"Operation not permitted. This error is mapped to the " +"exception :exc:`PermissionError`." msgstr "" +"عملیات مجاز نیست. این خطا به استثنای :exc:`PermissionError` نگاشت می‌شود." -msgid "No such file or directory. This error is mapped to the exception :exc:`FileNotFoundError`." +msgid "" +"No such file or directory. This error is mapped to the " +"exception :exc:`FileNotFoundError`." msgstr "" +"چنین فایل یا پوشه‌ای وجود ندارد. این خطا به استثنای :exc:`FileNotFoundError` " +"نگاشته شده است." -msgid "No such process. This error is mapped to the exception :exc:`ProcessLookupError`." +msgid "" +"No such process. This error is mapped to the " +"exception :exc:`ProcessLookupError`." msgstr "" +"چنین فرایندی وجود ندارد. این خطا به استثنای :exc:`ProcessLookupError` نگاشت " +"شده است." -msgid "Interrupted system call. This error is mapped to the exception :exc:`InterruptedError`." +msgid "" +"Interrupted system call. This error is mapped to the " +"exception :exc:`InterruptedError`." msgstr "" +"فراخوانی سیستمی قطع‌شده. این خطا به استثنای :exc:`InterruptedError` نگاشته " +"شده است." msgid "I/O error" -msgstr "" +msgstr "خطای ورودی/خروجی" msgid "No such device or address" -msgstr "" +msgstr "چنین دستگاه یا نشانی‌ای وجود ندارد" msgid "Arg list too long" -msgstr "" +msgstr "فهرست آرگومان‌ها بیش از حد طولانی است" msgid "Exec format error" -msgstr "" +msgstr "خطای قالب اجرایی" msgid "Bad file number" -msgstr "" +msgstr "شماره‌ی فایل نامعتبر" -msgid "No child processes. This error is mapped to the exception :exc:`ChildProcessError`." +msgid "" +"No child processes. This error is mapped to the " +"exception :exc:`ChildProcessError`." msgstr "" +"هیچ فرایند فرزندی وجود ندارد. این خطا به استثنای :exc:`ChildProcessError` " +"نگاشت شده است." -msgid "Try again. This error is mapped to the exception :exc:`BlockingIOError`." +msgid "" +"Try again. This error is mapped to the exception :exc:`BlockingIOError`." msgstr "" +"دوباره تلاش کنید. این خطا به استثنای :exc:`BlockingIOError` نگاشته شده است." msgid "Out of memory" -msgstr "" +msgstr "کمبود حافظه" -msgid "Permission denied. This error is mapped to the exception :exc:`PermissionError`." +msgid "" +"Permission denied. This error is mapped to the " +"exception :exc:`PermissionError`." msgstr "" +"دسترسی غیرمجاز است. این خطا به استثنای :exc:`PermissionError` نگاشته شده " +"است." msgid "Bad address" -msgstr "" +msgstr "نشانی نامعتبر" msgid "Block device required" -msgstr "" +msgstr "دستگاه بلوکی مورد نیاز است" msgid "Device or resource busy" -msgstr "" +msgstr "دستگاه یا منبع مشغول" -msgid "File exists. This error is mapped to the exception :exc:`FileExistsError`." +msgid "" +"File exists. This error is mapped to the exception :exc:`FileExistsError`." msgstr "" +"فایل وجود دارد. این خطا به استثنای :exc:`FileExistsError` نگاشت می‌شود." msgid "Cross-device link" -msgstr "" +msgstr "پیوند بین‌دستگاهی" msgid "No such device" -msgstr "" +msgstr "چنین دستگاهی وجود ندارد" -msgid "Not a directory. This error is mapped to the exception :exc:`NotADirectoryError`." +msgid "" +"Not a directory. This error is mapped to the " +"exception :exc:`NotADirectoryError`." msgstr "" +"پوشه نیست. این خطا به استثنای :exc:`NotADirectoryError` نگاشته شده است." -msgid "Is a directory. This error is mapped to the exception :exc:`IsADirectoryError`." +msgid "" +"Is a directory. This error is mapped to the " +"exception :exc:`IsADirectoryError`." msgstr "" +"یک پوشه است. این خطا به استثنا :exc:`IsADirectoryError` نگاشته شده است." msgid "Invalid argument" -msgstr "" +msgstr "آرگومان نامعتبر" msgid "File table overflow" -msgstr "" +msgstr "سرریز جدول فایل" msgid "Too many open files" -msgstr "" +msgstr "تعداد فایل‌های باز بیش از حد است" msgid "Not a typewriter" -msgstr "" +msgstr "ماشین تحریر نیست" msgid "Text file busy" -msgstr "" +msgstr "فایل متنی مشغول" msgid "File too large" -msgstr "" +msgstr "فایل بیش از حد بزرگ است" msgid "No space left on device" -msgstr "" +msgstr "هیچ فضایی در دستگاه باقی نمانده است" msgid "Illegal seek" -msgstr "" +msgstr "جستجوی غیرمجاز" msgid "Read-only file system" -msgstr "" +msgstr "سیستم فایل فقط‌خواندنی" msgid "Too many links" -msgstr "" +msgstr "پیوندهای بیش‌ازحد" -msgid "Broken pipe. This error is mapped to the exception :exc:`BrokenPipeError`." +msgid "" +"Broken pipe. This error is mapped to the exception :exc:`BrokenPipeError`." msgstr "" +"پایپ‌ی شکسته. این خطا به استثنای :exc:`BrokenPipeError` نگاشته شده است." msgid "Math argument out of domain of func" -msgstr "" +msgstr "آرگومان ریاضی خارج از دامنه‌ی تابع" msgid "Math result not representable" -msgstr "" +msgstr "نتیجه‌ی ریاضی قابل بازنمایی نیست" msgid "Resource deadlock would occur" -msgstr "" +msgstr "بن‌بست منابع رخ خواهد داد" msgid "File name too long" -msgstr "" +msgstr "نام فایل بیش از حد طولانی است" msgid "No record locks available" -msgstr "" +msgstr "هیچ قفل رکوردی در دسترس نیست" msgid "Function not implemented" -msgstr "" +msgstr "تابع پیاده‌سازی نشده است" msgid "Directory not empty" -msgstr "" +msgstr "پوشه خالی نیست" msgid "Too many symbolic links encountered" -msgstr "" +msgstr "با پیوندهای نمادین بیش از حد مواجه شد" -msgid "Operation would block. This error is mapped to the exception :exc:`BlockingIOError`." +msgid "" +"Operation would block. This error is mapped to the " +"exception :exc:`BlockingIOError`." msgstr "" +"عملیات مسدود خواهد شد. این خطا به استثنای :exc:`BlockingIOError` نگاشت " +"می‌شود." msgid "No message of desired type" -msgstr "" +msgstr "پیامی از نوع مطلوب وجود ندارد" msgid "Identifier removed" -msgstr "" +msgstr "شناسه حذف شد" msgid "Channel number out of range" -msgstr "" +msgstr "شماره کانال خارج از محدوده است" msgid "Level 2 not synchronized" -msgstr "" +msgstr "سطح ۲ همگام‌سازی‌نشده" msgid "Level 3 halted" -msgstr "" +msgstr "سطح ۳ متوقف شد" msgid "Level 3 reset" -msgstr "" +msgstr "بازنشانی سطح ۳" msgid "Link number out of range" -msgstr "" +msgstr "شماره‌ی پیوند خارج از محدوده" msgid "Protocol driver not attached" -msgstr "" +msgstr "راه‌انداز پروتکل متصل نیست" msgid "No CSI structure available" -msgstr "" +msgstr "هیچ ساختار CSI در دسترس نیست" msgid "Level 2 halted" -msgstr "" +msgstr "سطح ۲ متوقف شد" msgid "Invalid exchange" -msgstr "" +msgstr "تبادل نامعتبر" msgid "Invalid request descriptor" -msgstr "" +msgstr "توصیف‌گر درخواست نامعتبر" msgid "Exchange full" -msgstr "" +msgstr "تبادل کامل" msgid "No anode" -msgstr "" +msgstr "بدون آند" msgid "Invalid request code" -msgstr "" +msgstr "کد درخواست نامعتبر" msgid "Invalid slot" -msgstr "" +msgstr "جایگاه نامعتبر (slot)" msgid "File locking deadlock error" -msgstr "" +msgstr "خطای بن‌بست در قفل فایل" msgid "Bad font file format" -msgstr "" +msgstr "قالب فایل فونت نامعتبر" msgid "Device not a stream" -msgstr "" +msgstr "دستگاه یک جریان نیست" msgid "No data available" -msgstr "" +msgstr "داده‌ای موجود نیست" msgid "Timer expired" -msgstr "" +msgstr "زمان‌سنج منقضی شد" msgid "Out of streams resources" -msgstr "" +msgstr "اتمام منابع جریان‌ها" msgid "Machine is not on the network" -msgstr "" +msgstr "ماشین در شبکه نیست" msgid "Package not installed" -msgstr "" +msgstr "بسته نصب‌نشده" msgid "Object is remote" -msgstr "" +msgstr "شیء راه دور است" msgid "Link has been severed" -msgstr "" +msgstr "پیوند قطع شده است" msgid "Advertise error" -msgstr "" +msgstr "خطای آگهی (Advertise)" msgid "Srmount error" -msgstr "" +msgstr "خطای Srmount" msgid "Communication error on send" -msgstr "" +msgstr "خطای ارتباطی هنگام ارسال" msgid "Protocol error" -msgstr "" +msgstr "خطای پروتکل" msgid "Multihop attempted" -msgstr "" +msgstr "تلاش برای چندپرش (multihop) انجام شد" msgid "RFS specific error" -msgstr "" +msgstr "خطای خاص RFS" msgid "Not a data message" -msgstr "" +msgstr "پیام داده نیست" msgid "Value too large for defined data type" -msgstr "" +msgstr "مقدار برای نوع داده‌ی تعریف‌شده بیش از حد بزرگ است" msgid "Name not unique on network" -msgstr "" +msgstr "نام در شبکه یکتا نیست" msgid "File descriptor in bad state" -msgstr "" +msgstr "توصیف‌گر فایل در وضعیت نامناسب" msgid "Remote address changed" -msgstr "" +msgstr "نشانی دوردست تغییر کرد" msgid "Can not access a needed shared library" -msgstr "" +msgstr "نمی‌توان به یک کتابخانه اشتراکی مورد نیاز دسترسی یافت" msgid "Accessing a corrupted shared library" -msgstr "" +msgstr "دسترسی به کتابخانه‌ی مشترک آسیب‌دیده" msgid ".lib section in a.out corrupted" -msgstr "" +msgstr "بخش .lib در a.out خراب است" msgid "Attempting to link in too many shared libraries" -msgstr "" +msgstr "تلاش برای پیوند دادن تعداد بیش از حدی از کتابخانه‌های مشترک" msgid "Cannot exec a shared library directly" -msgstr "" +msgstr "نمی‌توان یک کتابخانه‌ی اشتراکی را مستقیماً اجرا کرد" msgid "Illegal byte sequence" -msgstr "" +msgstr "دنباله بایت غیرمجاز" msgid "Interrupted system call should be restarted" -msgstr "" +msgstr "فراخوانی سیستمی قطع‌شده باید از نو اجرا شود" msgid "Streams pipe error" -msgstr "" +msgstr "خطای پایپ جریان‌ها" msgid "Too many users" -msgstr "" +msgstr "تعداد کاربران بیش از حد است" msgid "Socket operation on non-socket" -msgstr "" +msgstr "عملیات سوکت بر روی غیرسوکت" msgid "Destination address required" -msgstr "" +msgstr "نشانی مقصد مورد نیاز است" msgid "Message too long" -msgstr "" +msgstr "پیام بیش از حد طولانی است" msgid "Protocol wrong type for socket" -msgstr "" +msgstr "نوع پروتکل برای سوکت نادرست است" msgid "Protocol not available" -msgstr "" +msgstr "پروتکل در دسترس نیست" msgid "Protocol not supported" -msgstr "" +msgstr "پروتکل پشتیبانی نمی‌شود" msgid "Socket type not supported" -msgstr "" +msgstr "نوع سوکت پشتیبانی نمی‌شود" msgid "Operation not supported on transport endpoint" -msgstr "" +msgstr "عملیات روی پایانه‌ی انتقال پشتیبانی نمی‌شود" msgid "Operation not supported" -msgstr "" +msgstr "عملیات پشتیبانی نمی‌شود" msgid "Protocol family not supported" -msgstr "" +msgstr "خانواده‌ی پروتکل پشتیبانی نمی‌شود" msgid "Address family not supported by protocol" -msgstr "" +msgstr "خانواده آدرس توسط پروتکل پشتیبانی نمی‌شود" msgid "Address already in use" -msgstr "" +msgstr "نشانی از قبل در حال استفاده است" msgid "Cannot assign requested address" -msgstr "" +msgstr "نمی‌توان نشانی درخواستی را اختصاص داد" msgid "Network is down" -msgstr "" +msgstr "شبکه قطع است" msgid "Network is unreachable" -msgstr "" +msgstr "شبکه در دسترس نیست" msgid "Network dropped connection because of reset" -msgstr "" +msgstr "شبکه به‌دلیل بازنشانی، اتصال را قطع کرد" -msgid "Software caused connection abort. This error is mapped to the exception :exc:`ConnectionAbortedError`." +msgid "" +"Software caused connection abort. This error is mapped to the " +"exception :exc:`ConnectionAbortedError`." msgstr "" +"نرم‌افزار باعث لغو اتصال شد. این خطا به " +"استثنای :exc:`ConnectionAbortedError` نگاشته شده است." -msgid "Connection reset by peer. This error is mapped to the exception :exc:`ConnectionResetError`." +msgid "" +"Connection reset by peer. This error is mapped to the " +"exception :exc:`ConnectionResetError`." msgstr "" +"اتصال توسط طرف مقابل بازنشانی شد. این خطا به " +"استثنای :exc:`ConnectionResetError` نگاشت شده است." msgid "No buffer space available" -msgstr "" +msgstr "هیچ فضای بافری در دسترس نیست" msgid "Transport endpoint is already connected" -msgstr "" +msgstr "پایانه‌ی انتقال از قبل متصل است" msgid "Transport endpoint is not connected" -msgstr "" +msgstr "پایانه‌ی انتقال متصل نیست" -msgid "Cannot send after transport endpoint shutdown. This error is mapped to the exception :exc:`BrokenPipeError`." +msgid "" +"Cannot send after transport endpoint shutdown. This error is mapped to the " +"exception :exc:`BrokenPipeError`." msgstr "" +"ارسال پس از خاموش شدن پایانه‌ی انتقال ممکن نیست. این خطا به " +"استثنای :exc:`BrokenPipeError` نگاشت داده شده است." msgid "Too many references: cannot splice" -msgstr "" +msgstr "ارجاع‌های بیش‌ازحد: نمی‌توان الحاق کرد (splice)" -msgid "Connection timed out. This error is mapped to the exception :exc:`TimeoutError`." +msgid "" +"Connection timed out. This error is mapped to the " +"exception :exc:`TimeoutError`." msgstr "" +"مهلت اتصال به پایان رسید. این خطا به استثنای :exc:`TimeoutError` نگاشته شده " +"است." -msgid "Connection refused. This error is mapped to the exception :exc:`ConnectionRefusedError`." +msgid "" +"Connection refused. This error is mapped to the " +"exception :exc:`ConnectionRefusedError`." msgstr "" +"اتصال رد شد. این خطا به استثنای :exc:`ConnectionRefusedError` نگاشت شده است." msgid "Host is down" -msgstr "" +msgstr "میزبان از کار افتاده است" msgid "No route to host" -msgstr "" +msgstr "مسیری به میزبان وجود ندارد" msgid "Memory page has hardware error." -msgstr "" +msgstr "صفحه حافظه دارای خطای سخت‌افزاری است." -msgid "Operation already in progress. This error is mapped to the exception :exc:`BlockingIOError`." +msgid "" +"Operation already in progress. This error is mapped to the " +"exception :exc:`BlockingIOError`." msgstr "" +"عملیات از قبل در حال انجام است. این خطا به استثنای :exc:`BlockingIOError` " +"نگاشت می‌شود." -msgid "Operation now in progress. This error is mapped to the exception :exc:`BlockingIOError`." +msgid "" +"Operation now in progress. This error is mapped to the " +"exception :exc:`BlockingIOError`." msgstr "" +"عملیات اکنون در حال انجام است. این خطا به استثنای :exc:`BlockingIOError` " +"نگاشت شده است." msgid "Stale NFS file handle" -msgstr "" +msgstr "دسته‌ی فایل NFS قدیمی" msgid "Structure needs cleaning" -msgstr "" +msgstr "ساختار نیاز به پاک‌سازی دارد" msgid "Not a XENIX named type file" -msgstr "" +msgstr "یک فایل از نوع نام‌گذاری‌شده‌ی XENIX نیست" msgid "No XENIX semaphores available" -msgstr "" +msgstr "هیچ سمافور XENIX در دسترس نیست" msgid "Is a named type file" -msgstr "" +msgstr "یک فایل نوع نام‌دار است" msgid "Remote I/O error" -msgstr "" +msgstr "خطای ورودی/خروجی راه دور" msgid "Quota exceeded" -msgstr "" +msgstr "سهمیه بیش از حد مجاز است" msgid "Interface output queue is full" -msgstr "" +msgstr "صف خروجی رابط پر است" msgid "No medium found" -msgstr "" +msgstr "هیچ رسانه‌ای یافت نشد" msgid "Wrong medium type" -msgstr "" +msgstr "نوع رسانه اشتباه" msgid "Required key not available" -msgstr "" +msgstr "کلید موردنیاز در دسترس نیست" msgid "Key has expired" -msgstr "" +msgstr "کلید منقضی شده است" msgid "Key has been revoked" -msgstr "" +msgstr "کلید باطل شده است" msgid "Key was rejected by service" -msgstr "" +msgstr "کلید توسط سرویس رد شد" msgid "Operation not possible due to RF-kill" -msgstr "" +msgstr "عملیات به‌دلیل RF-kill امکان‌پذیر نیست" msgid "Locked lock was unmapped" -msgstr "" +msgstr "قفل قفل‌شده از نگاشت خارج شد" msgid "Facility is not active" -msgstr "" +msgstr "امکان فعال نیست" msgid "Authentication error" -msgstr "" +msgstr "خطای احراز هویت" msgid "Bad CPU type in executable" -msgstr "" +msgstr "نوع پردازنده نامعتبر در فایل اجرایی" msgid "Bad executable (or shared library)" -msgstr "" +msgstr "فایل اجرایی (یا کتابخانه اشتراکی) نامعتبر" msgid "Malformed Mach-o file" -msgstr "" +msgstr "فایل Mach-o نامعتبر" msgid "Device error" -msgstr "" +msgstr "خطای دستگاه" msgid "Inappropriate file type or format" -msgstr "" +msgstr "نوع یا قالب فایل نامناسب" msgid "Need authenticator" -msgstr "" +msgstr "نیاز به اصالت‌سنج (authenticator)" msgid "Attribute not found" -msgstr "" +msgstr "ویژگی یافت نشد" msgid "Policy not found" -msgstr "" +msgstr "سیاست یافت نشد" msgid "Too many processes" -msgstr "" +msgstr "فرایندهای بیش‌ازحد" msgid "Bad procedure for program" -msgstr "" +msgstr "رویه‌ی بد برای برنامه" msgid "Program version wrong" -msgstr "" +msgstr "نسخه برنامه نادرست است" msgid "RPC prog. not avail" -msgstr "" +msgstr "برنامه‌ی RPC در دسترس نیست" msgid "Device power is off" -msgstr "" +msgstr "برق دستگاه خاموش است" msgid "RPC struct is bad" -msgstr "" +msgstr "ساختار RPC نامعتبر است" msgid "RPC version wrong" -msgstr "" +msgstr "نسخه‌ی RPC نادرست است" msgid "Shared library version mismatch" -msgstr "" +msgstr "عدم تطابق نسخه کتابخانه مشترک" -msgid "Capabilities insufficient. This error is mapped to the exception :exc:`PermissionError`." +msgid "" +"Capabilities insufficient. This error is mapped to the " +"exception :exc:`PermissionError`." msgstr "" +"قابلیت‌ها ناکافی است. این خطا به استثنای :exc:`PermissionError` نگاشت می‌شود." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" msgid "Operation canceled" -msgstr "" +msgstr "عملیات لغو شد" msgid "Owner died" -msgstr "" +msgstr "مالک از بین رفت" msgid "State not recoverable" -msgstr "" +msgstr "وضعیت غیرقابل بازیابی" diff --git a/library/exceptions.po b/library/exceptions.po index d786c9a48..1b74f5bcc 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-27 14:53+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"POT-Creation-Date: 2026-08-26 07:47+0330\n" +"PO-Revision-Date: 2026-08-28 11:31+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -21,69 +21,221 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Built-in Exceptions" -msgstr "" +msgstr "استثناهای توکار" -msgid "In Python, all exceptions must be instances of a class that derives from :class:`BaseException`. In a :keyword:`try` statement with an :keyword:`except` clause that mentions a particular class, that clause also handles any exception classes derived from that class (but not exception classes from which *it* is derived). Two exception classes that are not related via subclassing are never equivalent, even if they have the same name." -msgstr "" +msgid "" +"In Python, all exceptions must be instances of a class that derives " +"from :class:`BaseException`. In a :keyword:`try` statement with " +"an :keyword:`except` clause that mentions a particular class, that clause " +"also handles any exception classes derived from that class (but not " +"exception classes from which *it* is derived). Two exception classes that " +"are not related via subclassing are never equivalent, even if they have the " +"same name." +msgstr "" +"در پایتون، همه‌ی استثناها باید نمونه‌هایی از کلاسی باشند که " +"از :class:`BaseException` مشتق شده است. در یک دستور :keyword:`try` با یک " +"بند :keyword:`except` که به کلاس خاصی اشاره می‌کند، آن بند همچنین هر کلاس " +"استثنا را که از آن کلاس مشتق شده باشد مدیریت می‌کند (اما نه کلاس‌های استثنا " +"را که *آن* از آن‌ها مشتق شده است). دو کلاس استثنا که از طریق زیرکلاس‌سازی با " +"هم مرتبط نیستند، هرگز معادل نیستند، حتی اگر نام یکسانی داشته باشند." -msgid "The built-in exceptions listed in this chapter can be generated by the interpreter or built-in functions. Except where mentioned, they have an \"associated value\" indicating the detailed cause of the error. This may be a string or a tuple of several items of information (e.g., an error code and a string explaining the code). The associated value is usually passed as arguments to the exception class's constructor." -msgstr "" +msgid "" +"The built-in exceptions listed in this chapter can be generated by the " +"interpreter or built-in functions. Except where mentioned, they have an " +"\"associated value\" indicating the detailed cause of the error. This may " +"be a string or a tuple of several items of information (e.g., an error code " +"and a string explaining the code). The associated value is usually passed " +"as arguments to the exception class's constructor." +msgstr "" +"استثناهای توکار فهرست‌شده در این فصل می‌توانند توسط مفسر یا توابع توکار ایجاد " +"شوند. مگر در مواردی که ذکر شده است، این استثناها دارای یک «مقدار مرتبط» " +"هستند که علت دقیق خطا را نشان می‌دهد. این مقدار ممکن است یک رشته یا تاپلی از " +"چند آیتم اطلاعات باشد (مثلاً یک کد خطا و یک رشته که آن کد را توضیح می‌دهد). " +"مقدار مرتبط معمولاً به‌صورت آرگومان‌هایی به سازنده‌ی کلاس استثنا ارسال می‌شود." -msgid "User code can raise built-in exceptions. This can be used to test an exception handler or to report an error condition \"just like\" the situation in which the interpreter raises the same exception; but beware that there is nothing to prevent user code from raising an inappropriate error." +msgid "" +"User code can raise built-in exceptions. This can be used to test an " +"exception handler or to report an error condition \"just like\" the " +"situation in which the interpreter raises the same exception; but beware " +"that there is nothing to prevent user code from raising an inappropriate " +"error." msgstr "" +"کد کاربر می‌تواند استثناهای توکار را پرتاب کند. این کار می‌تواند برای آزمایش " +"یک هندلر استثنا یا گزارش یک وضعیت خطا «دقیقاً مانند» شرایطی که مفسر " +"همان استثنا را پرتاب می‌کند استفاده شود؛ اما توجه داشته باشید که هیچ چیز " +"مانع از پرتاب یک خطای نامناسب توسط کد کاربر نمی‌شود." -msgid "The built-in exception classes can be subclassed to define new exceptions; programmers are encouraged to derive new exceptions from the :exc:`Exception` class or one of its subclasses, and not from :exc:`BaseException`. More information on defining exceptions is available in the Python Tutorial under :ref:`tut-userexceptions`." -msgstr "" +msgid "" +"The built-in exception classes can be subclassed to define new exceptions; " +"programmers are encouraged to derive new exceptions from " +"the :exc:`Exception` class or one of its subclasses, and not " +"from :exc:`BaseException`. More information on defining exceptions is " +"available in the Python Tutorial under :ref:`tut-userexceptions`." +msgstr "" +"می‌توان با ایجاد زیرکلاس از کلاس‌های استثنای توکار، استثناهای جدید تعریف کرد؛ " +"به برنامه‌نویسان توصیه می‌شود استثناهای جدید را از کلاس :exc:`Exception` یا " +"یکی از زیرکلاس‌های آن مشتق کنند، نه از :exc:`BaseException`. اطلاعات بیشتر " +"در مورد تعریف استثناها در آموزش پایتون در :ref:`tut-userexceptions` در " +"دسترس است." msgid "Exception context" -msgstr "" +msgstr "زمینه استثنا" -msgid "Three attributes on exception objects provide information about the context in which the exception was raised:" +msgid "" +"Three attributes on exception objects provide information about the context " +"in which the exception was raised:" msgstr "" +"سه ویژگی در اشیای استثنا اطلاعاتی درباره زمینه‌ای که استثنا در آن پرتاب شده " +"است فراهم می‌کنند:" -msgid "When raising a new exception while another exception is already being handled, the new exception's :attr:`!__context__` attribute is automatically set to the handled exception. An exception may be handled when an :keyword:`except` or :keyword:`finally` clause, or a :keyword:`with` statement, is used." -msgstr "" +msgid "" +"When raising a new exception while another exception is already being " +"handled, the new exception's :attr:`!__context__` attribute is " +"automatically set to the handled exception. An exception may be handled " +"when an :keyword:`except` or :keyword:`finally` clause, or " +"a :keyword:`with` statement, is used." +msgstr "" +"هنگام پرتاب یک استثنای جدید در حالی که استثنای دیگری از قبل در حال رسیدگی " +"است، ویژگی :attr:`!__context__` استثنای جدید به‌طور خودکار به استثنای در حال " +"رسیدگی تنظیم می‌شود. یک استثنا ممکن است زمانی رسیدگی شود که از یک " +"بند :keyword:`except` یا :keyword:`finally`، یا یک دستور :keyword:`with` " +"استفاده شود." -msgid "This implicit exception context can be supplemented with an explicit cause by using :keyword:`!from` with :keyword:`raise`::" +msgid "" +"This implicit exception context can be supplemented with an explicit cause " +"by using :keyword:`!from` with :keyword:`raise`::" msgstr "" +"این زمینه‌ی استثنای ضمنی را می‌توان با استفاده از :keyword:`!from` همراه " +"با :keyword:`raise` با یک علت صریح تکمیل کرد::" msgid "raise new_exc from original_exc" -msgstr "" +msgstr "raise new_exc from original_exc" -msgid "The expression following :keyword:`from` must be an exception or ``None``. It will be set as :attr:`!__cause__` on the raised exception. Setting :attr:`!__cause__` also implicitly sets the :attr:`!__suppress_context__` attribute to ``True``, so that using ``raise new_exc from None`` effectively replaces the old exception with the new one for display purposes (e.g. converting :exc:`KeyError` to :exc:`AttributeError`), while leaving the old exception available in :attr:`!__context__` for introspection when debugging." -msgstr "" +msgid "" +"The expression following :keyword:`from` must be an exception or " +"``None``. It will be set as :attr:`!__cause__` on the raised exception. " +"Setting :attr:`!__cause__` also implicitly sets the :attr:`!" +"__suppress_context__` attribute to ``True``, so that using ``raise new_exc " +"from None`` effectively replaces the old exception with the new one for " +"display purposes (e.g. converting :exc:`KeyError` " +"to :exc:`AttributeError`), while leaving the old exception available " +"in :attr:`!__context__` for introspection when debugging." +msgstr "" +"عبارت پس از :keyword:`from` باید یک استثنا یا ``None`` باشد. این " +"مقدار به‌عنوان :attr:`!__cause__` روی استثنای پرتاب‌شده تنظیم می‌شود. " +"تنظیم :attr:`!__cause__` همچنین به‌صورت ضمنی ویژگی :attr:`!" +"__suppress_context__` را روی ``True`` تنظیم می‌کند، به‌طوری که استفاده از " +"``raise new_exc from None`` عملاً استثنای قدیمی را با استثنای جدید برای " +"اهداف نمایش جایگزین می‌کند (برای مثال تبدیل :exc:`KeyError` " +"به :exc:`AttributeError`)، در حالی که استثنای قدیمی را در :attr:`!" +"__context__` برای درون‌نگری هنگام اشکال‌زدایی در دسترس نگه می‌دارد." -msgid "The default traceback display code shows these chained exceptions in addition to the traceback for the exception itself. An explicitly chained exception in :attr:`!__cause__` is always shown when present. An implicitly chained exception in :attr:`!__context__` is shown only if :attr:`!__cause__` is :const:`None` and :attr:`!__suppress_context__` is false." -msgstr "" +msgid "" +"The default traceback display code shows these chained exceptions in " +"addition to the traceback for the exception itself. An explicitly chained " +"exception in :attr:`!__cause__` is always shown when present. An implicitly " +"chained exception in :attr:`!__context__` is shown only if :attr:`!" +"__cause__` is :const:`None` and :attr:`!__suppress_context__` is false." +msgstr "" +"کد پیش‌فرض نمایش ردگیری پشته، این استثناهای زنجیره‌ای را علاوه بر ردگیری پشته " +"خود استثنا نشان می‌دهد. یک استثنای زنجیره‌ای صریح در :attr:`!__cause__` همیشه " +"در صورت وجود نمایش داده می‌شود. یک استثنای زنجیره‌ای ضمنی در :attr:`!" +"__context__` تنها در صورتی نمایش داده می‌شود که :attr:`!__cause__` " +"برابر :const:`None` و :attr:`!__suppress_context__` نادرست باشد." -msgid "In either case, the exception itself is always shown after any chained exceptions so that the final line of the traceback always shows the last exception that was raised." +msgid "" +"In either case, the exception itself is always shown after any chained " +"exceptions so that the final line of the traceback always shows the last " +"exception that was raised." msgstr "" +"در هر صورت، خود استثنا همیشه پس از هرگونه استثنای زنجیره‌ای نمایش داده " +"می‌شود، به‌طوری که خط پایانی ردگیری پشته همیشه آخرین استثنایی را که پرتاب شده " +"است نشان می‌دهد." msgid "Inheriting from built-in exceptions" -msgstr "" +msgstr "ارث‌بری از استثناهای توکار" -msgid "User code can create subclasses that inherit from an exception type. It's recommended to only subclass one exception type at a time to avoid any possible conflicts between how the bases handle the ``args`` attribute, as well as due to possible memory layout incompatibilities." +msgid "" +"User code can create subclasses that inherit from an exception type. It's " +"recommended to only subclass one exception type at a time to avoid any " +"possible conflicts between how the bases handle the ``args`` attribute, as " +"well as due to possible memory layout incompatibilities." msgstr "" +"کد کاربر می‌تواند زیرکلاس‌هایی بسازد که از یک نوع استثنا ارث می‌برند. توصیه " +"می‌شود برای جلوگیری از هرگونه تداخل احتمالی در نحوه‌ی مدیریت ویژگی ``args`` " +"توسط کلاس‌های پایه، و نیز به دلیل ناسازگاری‌های احتمالی در چیدمان حافظه، در " +"هر زمان فقط از یک نوع استثنا زیرکلاس‌گیری کنید." -msgid "Most built-in exceptions are implemented in C for efficiency, see: :source:`Objects/exceptions.c`. Some have custom memory layouts which makes it impossible to create a subclass that inherits from multiple exception types. The memory layout of a type is an implementation detail and might change between Python versions, leading to new conflicts in the future. Therefore, it's recommended to avoid subclassing multiple exception types altogether." -msgstr "" +msgid "" +"Most built-in exceptions are implemented in C for efficiency, " +"see: :source:`Objects/exceptions.c`. Some have custom memory layouts which " +"makes it impossible to create a subclass that inherits from multiple " +"exception types. The memory layout of a type is an implementation detail " +"and might change between Python versions, leading to new conflicts in the " +"future. Therefore, it's recommended to avoid subclassing multiple " +"exception types altogether." +msgstr "" +"بیشتر استثناهای توکار برای کارایی به زبان C پیاده‌سازی شده‌اند، " +"ببینید: :source:`Objects/exceptions.c`. برخی از آن‌ها چیدمان‌های حافظه سفارشی " +"دارند که ایجاد زیرکلاسی را که از چندین نوع استثنا ارث می‌برد، غیرممکن " +"می‌سازد. چیدمان حافظه‌ی یک نوع، جزئیاتی از پیاده‌سازی است و ممکن است بین " +"نسخه‌های پایتون تغییر کند و در آینده به تعارض‌های جدیدی منجر شود. بنابراین، " +"توصیه می‌شود به‌طور کلی از ایجاد زیرکلاس از چندین نوع استثنا پرهیز کنید." msgid "Base classes" -msgstr "" +msgstr "کلاس‌های پایه" -msgid "The following exceptions are used mostly as base classes for other exceptions." +msgid "" +"The following exceptions are used mostly as base classes for other " +"exceptions." msgstr "" +"استثناهای زیر بیشتر به‌عنوان کلاس‌های پایه برای سایر استثناها استفاده می‌شوند." -msgid "The base class for all built-in exceptions. It is not meant to be directly inherited by user-defined classes (for that, use :exc:`Exception`). If :func:`str` is called on an instance of this class, the representation of the argument(s) to the instance are returned, or the empty string when there were no arguments." -msgstr "" +msgid "" +"The base class for all built-in exceptions. It is not meant to be directly " +"inherited by user-defined classes (for that, use :exc:`Exception`). " +"If :func:`str` is called on an instance of this class, the representation " +"of the argument(s) to the instance are returned, or the empty string when " +"there were no arguments." +msgstr "" +"کلاس پایه برای تمام استثناهای توکار. این کلاس برای ارث‌بری مستقیم توسط " +"کلاس‌های تعریف‌شده توسط کاربر در نظر گرفته نشده است (برای این کار، " +"از :exc:`Exception` استفاده کنید). اگر :func:`str` روی نمونه‌ای از این کلاس " +"فراخوانی شود، بازنمایی آرگومان(های) آن نمونه برگردانده می‌شود، یا رشته خالی " +"در صورتی که هیچ آرگومانی وجود نداشته باشد." -msgid "The tuple of arguments given to the exception constructor. Some built-in exceptions (like :exc:`OSError`) expect a certain number of arguments and assign a special meaning to the elements of this tuple, while others are usually called only with a single string giving an error message." +msgid "" +"The tuple of arguments given to the exception constructor. Some built-in " +"exceptions (like :exc:`OSError`) expect a certain number of arguments and " +"assign a special meaning to the elements of this tuple, while others are " +"usually called only with a single string giving an error message." msgstr "" +"تاپل آرگومان‌های داده‌شده به سازنده‌ی استثنا. برخی از استثناهای توکار " +"(مانند :exc:`OSError`) تعداد معینی آرگومان را انتظار دارند و معنای خاصی به " +"عناصر این تاپل نسبت می‌دهند، در حالی که سایر استثناها معمولاً فقط با یک رشته " +"حاوی پیام خطا فراخوانی می‌شوند." -msgid "This method sets *tb* as the new traceback for the exception and returns the exception object. It was more commonly used before the exception chaining features of :pep:`3134` became available. The following example shows how we can convert an instance of ``SomeException`` into an instance of ``OtherException`` while preserving the traceback. Once raised, the current frame is pushed onto the traceback of the ``OtherException``, as would have happened to the traceback of the original ``SomeException`` had we allowed it to propagate to the caller. ::" -msgstr "" +msgid "" +"This method sets *tb* as the new traceback for the exception and returns " +"the exception object. It was more commonly used before the exception " +"chaining features of :pep:`3134` became available. The following example " +"shows how we can convert an instance of ``SomeException`` into an instance " +"of ``OtherException`` while preserving the traceback. Once raised, the " +"current frame is pushed onto the traceback of the ``OtherException``, as " +"would have happened to the traceback of the original ``SomeException`` had " +"we allowed it to propagate to the caller. ::" +msgstr "" +"این متد، *tb* را به‌عنوان ردگیری پشته‌ی جدید برای استثنا تنظیم می‌کند و شیء " +"استثنا را برمی‌گرداند. پیش از در دسترس قرار گرفتن قابلیت‌های زنجیره‌سازی " +"استثنا در :pep:`3134`، این متد بیشتر استفاده می‌شد. مثال زیر نشان می‌دهد که " +"چگونه می‌توانیم یک نمونه از ``SomeException`` را به یک نمونه از " +"``OtherException`` تبدیل کنیم، در حالی که ردگیری پشته حفظ می‌شود. پس از " +"پرتاب شدن، فریم جاری بر ردگیری پشته‌ی ``OtherException`` افزوده " +"می‌شود، همان‌گونه که برای ردگیری پشته‌ی ``SomeException`` اصلی رخ می‌داد اگر " +"اجازه می‌دادیم آن به فراخواننده منتشر شود. ::" msgid "" "try:\n" @@ -92,495 +244,1223 @@ msgid "" " tb = sys.exception().__traceback__\n" " raise OtherException(...).with_traceback(tb)" msgstr "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" -msgid "A writable field that holds the :ref:`traceback object ` associated with this exception. See also: :ref:`raise`." +msgid "" +"A writable field that holds the :ref:`traceback object ` " +"associated with this exception. See also: :ref:`raise`." msgstr "" +"یک فیلد قابل‌نوشتن که :ref:`شیء ردگیری پشته ` مرتبط با این استثنا را نگه می‌دارد. همچنین ببینید: :ref:`پرتاب `." -msgid "Add the string ``note`` to the exception's notes which appear in the standard traceback after the exception string. A :exc:`TypeError` is raised if ``note`` is not a string." +msgid "" +"Add the string ``note`` to the exception's notes which appear in the " +"standard traceback after the exception string. A :exc:`TypeError` is raised " +"if ``note`` is not a string." msgstr "" +"رشته ``note`` را به یادداشت‌های استثنا که در ردگیری پشته‌ی استاندارد پس از " +"رشته‌ی استثنا نمایش داده می‌شوند، اضافه کنید. اگر ``note`` یک رشته نباشد، " +"یک :exc:`TypeError` پرتاب می‌شود." -msgid "A list of the notes of this exception, which were added with :meth:`add_note`. This attribute is created when :meth:`add_note` is called." +msgid "" +"A list of the notes of this exception, which were added " +"with :meth:`add_note`. This attribute is created when :meth:`add_note` is " +"called." msgstr "" +"فهرستی از یادداشت‌های این استثنا، که با :meth:`add_note` افزوده شده‌اند. این " +"ویژگی هنگام فراخوانی :meth:`add_note` ایجاد می‌شود." -msgid "All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class." +msgid "" +"All built-in, non-system-exiting exceptions are derived from this class. " +"All user-defined exceptions should also be derived from this class." msgstr "" +"تمام استثناهای توکار که باعث خروج از سیستم نمی‌شوند، از این کلاس مشتق " +"شده‌اند. تمام استثناهای تعریف‌شده توسط کاربر نیز باید از این کلاس مشتق شده " +"باشند." -msgid "The base class for those built-in exceptions that are raised for various arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:`FloatingPointError`." +msgid "" +"The base class for those built-in exceptions that are raised for various " +"arithmetic " +"errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:`FloatingPointError`." msgstr "" +"کلاس پایه برای آن دسته از استثناهای توکار که برای خطاهای حسابی مختلف پرتاب " +"می‌شوند: :exc:`OverflowError`، :exc:`ZeroDivisionError`، :exc:`FloatingPointError`." -msgid "Raised when a :ref:`buffer ` related operation cannot be performed." +msgid "" +"Raised when a :ref:`buffer ` related operation cannot be " +"performed." msgstr "" +"هنگامی که یک عملیات مرتبط با :ref:`بافر ` قابل انجام نباشد، " +"پرتاب می‌شود." -msgid "The base class for the exceptions that are raised when a key or index used on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This can be raised directly by :func:`codecs.lookup`." +msgid "" +"The base class for the exceptions that are raised when a key or index used " +"on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. " +"This can be raised directly by :func:`codecs.lookup`." msgstr "" +"کلاس پایه برای استثناهایی که هنگام نامعتبر بودن یک کلید یا اندیس استفاده‌شده " +"در یک نگاشت یا دنباله پرتاب می‌شوند: :exc:`IndexError`، :exc:`KeyError`. این " +"استثنا می‌تواند مستقیماً توسط :func:`codecs.lookup` پرتاب شود." msgid "Concrete exceptions" -msgstr "" +msgstr "استثناهای مشخص" msgid "The following exceptions are the exceptions that are usually raised." -msgstr "" +msgstr "استثناهای زیر، استثناهایی هستند که معمولاً پرتاب می‌شوند." msgid "Raised when an :keyword:`assert` statement fails." -msgstr "" +msgstr "هنگامی که دستور :keyword:`assert` شکست بخورد، پرتاب می‌شود." -msgid "Raised when an attribute reference (see :ref:`attribute-references`) or assignment fails. (When an object does not support attribute references or attribute assignments at all, :exc:`TypeError` is raised.)" +msgid "" +"Raised when an attribute reference (see :ref:`attribute-references`) or " +"assignment fails. (When an object does not support attribute references or " +"attribute assignments at all, :exc:`TypeError` is raised.)" msgstr "" +"هنگامی که ارجاع به ویژگی (به :ref:`attribute-references` مراجعه کنید) یا " +"انتساب ناموفق باشد، پرتاب می‌شود. (هرگاه یک شیء به‌هیچ‌وجه از ارجاع به ویژگی " +"یا انتساب ویژگی پشتیبانی نکند، :exc:`TypeError` پرتاب می‌شود.)" -msgid "The optional *name* and *obj* keyword-only arguments set the corresponding attributes:" +msgid "" +"The optional *name* and *obj* keyword-only arguments set the corresponding " +"attributes:" msgstr "" +"آرگومان‌های اختیاری *name* و *obj* که فقط کلیدواژه‌ای هستند، ویژگی‌های متناظر " +"را تنظیم می‌کنند:" msgid "The name of the attribute that was attempted to be accessed." -msgstr "" +msgstr "نام ویژگی‌ای که برای دسترسی به آن تلاش شده است." msgid "The object that was accessed for the named attribute." -msgstr "" +msgstr "شیء‌ای که برای ویژگی نام‌برده‌شده به آن دسترسی پیدا شده است." msgid "Added the :attr:`name` and :attr:`obj` attributes." -msgstr "" +msgstr "ویژگی‌های :attr:`name` و :attr:`obj` اضافه شدند." -msgid "Raised when the :func:`input` function hits an end-of-file condition (EOF) without reading any data. (Note: the :meth:`io.TextIOBase.read` and :meth:`io.IOBase.readline` methods return an empty string when they hit EOF.)" +msgid "" +"Raised when the :func:`input` function hits an end-of-file condition (EOF) " +"without reading any data. (Note: the :meth:`io.TextIOBase.read` " +"and :meth:`io.IOBase.readline` methods return an empty string when they hit " +"EOF.)" msgstr "" +"زمانی پرتاب می‌شود که تابع :func:`input` بدون خواندن هیچ داده‌ای به وضعیت " +"پایان فایل (EOF) برسد. (توجه: متدهای :meth:`io.TextIOBase.read` " +"و :meth:`io.IOBase.readline` هنگام رسیدن به EOF یک رشته‌ی خالی برمی‌گردانند.)" msgid "Not currently used." -msgstr "" +msgstr "در حال حاضر استفاده نمی‌شود." -msgid "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:`generator.close` and :meth:`coroutine.close`. It directly inherits from :exc:`BaseException` instead of :exc:`Exception` since it is technically not an error." +msgid "" +"Raised when a :term:`generator` or :term:`coroutine` is closed; " +"see :meth:`generator.close` and :meth:`coroutine.close`. It directly " +"inherits from :exc:`BaseException` instead of :exc:`Exception` since it is " +"technically not an error." msgstr "" +"هنگامی که یک :term:`تولیدگر ` یا :term:`هم‌روال ` بسته " +"شود، پرتاب می‌شود؛ :meth:`generator.close` و :meth:`coroutine.close` را " +"ببینید. این استثنا مستقیماً به‌جای :exc:`Exception ` " +"از :exc:`BaseException ` ارث می‌برد، زیرا از نظر فنی یک خطا نیست." -msgid "Raised when the :keyword:`import` statement has troubles trying to load a module. Also raised when the \"from list\" in ``from ... import`` has a name that cannot be found." +msgid "" +"Raised when the :keyword:`import` statement has troubles trying to load a " +"module. Also raised when the \"from list\" in ``from ... import`` has a " +"name that cannot be found." msgstr "" +"هنگامی پرتاب می‌شود که دستور :keyword:`import` در تلاش برای بارگذاری یک " +"ماژول دچار مشکل شود. همچنین هنگامی پرتاب می‌شود که «فهرست from» در " +"``from ... import`` شامل نامی باشد که نمی‌توان آن را پیدا کرد." -msgid "The optional *name* and *path* keyword-only arguments set the corresponding attributes:" +msgid "" +"The optional *name* and *path* keyword-only arguments set the corresponding " +"attributes:" msgstr "" +"آرگومان‌های اختیاری *name* و *path* که فقط کلیدواژه‌ای هستند، ویژگی‌های متناظر " +"را تنظیم می‌کنند:" msgid "The name of the module that was attempted to be imported." -msgstr "" +msgstr "نام ماژولی که برای ایمپورت آن تلاش شد." msgid "The path to any file which triggered the exception." -msgstr "" +msgstr "مسیر هر فایلی که باعث پرتاب استثنا شده است." msgid "Added the :attr:`name` and :attr:`path` attributes." -msgstr "" +msgstr "ویژگی‌های :attr:`name` و :attr:`path` اضافه شدند." -msgid "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a module could not be located. It is also raised when ``None`` is found in :data:`sys.modules`." +msgid "" +"A subclass of :exc:`ImportError` which is raised by :keyword:`import` when " +"a module could not be located. It is also raised when ``None`` is found " +"in :data:`sys.modules`." msgstr "" +"زیرکلاسی از :exc:`ImportError` که توسط :keyword:`import` زمانی پرتاب می‌شود " +"که نتوان یک ماژول را یافت. همچنین زمانی که ``None`` در :data:`sys.modules` " +"یافت شود نیز پرتاب می‌شود." -msgid "Raised when a sequence subscript is out of range. (Slice indices are silently truncated to fall in the allowed range; if an index is not an integer, :exc:`TypeError` is raised.)" +msgid "" +"Raised when a sequence subscript is out of range. (Slice indices are " +"silently truncated to fall in the allowed range; if an index is not an " +"integer, :exc:`TypeError` is raised.)" msgstr "" +"زمانی پرتاب می‌شود که زیرنویس یک دنباله خارج از محدوده باشد. (اندیس‌های برش " +"به‌صورت خاموش محدود می‌شوند تا در محدوده مجاز قرار گیرند؛ اگر اندیس عدد صحیح " +"نباشد، :exc:`TypeError` پرتاب می‌شود.)" -msgid "Raised when a mapping (dictionary) key is not found in the set of existing keys." +msgid "" +"Raised when a mapping (dictionary) key is not found in the set of existing " +"keys." msgstr "" +"زمانی پرتاب می‌شود که کلید یک نگاشت (دیکشنری) در مجموعه‌ی کلیدهای موجود یافت " +"نشود." -msgid "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :kbd:`Delete`). During execution, a check for interrupts is made regularly. The exception inherits from :exc:`BaseException` so as to not be accidentally caught by code that catches :exc:`Exception` and thus prevent the interpreter from exiting." -msgstr "" +msgid "" +"Raised when the user hits the interrupt key (normally :kbd:`Control-C` " +"or :kbd:`Delete`). During execution, a check for interrupts is made " +"regularly. The exception inherits from :exc:`BaseException` so as to not be " +"accidentally caught by code that catches :exc:`Exception` and thus prevent " +"the interpreter from exiting." +msgstr "" +"این استثنا زمانی پرتاب می‌شود که کاربر کلید وقفه را فشار دهد " +"(معمولاً :kbd:`Control-C` یا :kbd:`Delete`). در طول اجرا، بررسی وقفه‌ها به‌طور " +"منظم انجام می‌شود. این استثنا از :exc:`BaseException` ارث می‌برد تا به‌طور " +"تصادفی توسط کدی که :exc:`Exception` را می‌گیرد، گرفته نشود و در نتیجه مانع " +"از خروج مفسر نگردد." -msgid "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because it can be raised at unpredictable points, it may, in some circumstances, leave the running program in an inconsistent state. It is generally best to allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" -msgstr "" +msgid "" +"Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " +"it can be raised at unpredictable points, it may, in some circumstances, " +"leave the running program in an inconsistent state. It is generally best to " +"allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or " +"avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" +msgstr "" +"گرفتن :exc:`KeyboardInterrupt` نیازمند ملاحظه ویژه است. از آنجا که ممکن است " +"در نقاط غیرقابل‌پیش‌بینی پرتاب شود، در برخی شرایط ممکن است برنامه‌ی در حال اجرا " +"را در وضعیتی ناسازگار باقی بگذارد. معمولاً بهتر است اجازه " +"دهید :exc:`KeyboardInterrupt` برنامه را هرچه سریع‌تر پایان دهد یا کلاً از " +"پرتاب آن اجتناب کنید. (به :ref:`handlers-and-exceptions` مراجعه کنید.)" -msgid "Raised when an operation runs out of memory but the situation may still be rescued (by deleting some objects). The associated value is a string indicating what kind of (internal) operation ran out of memory. Note that because of the underlying memory management architecture (C's :c:func:`malloc` function), the interpreter may not always be able to completely recover from this situation; it nevertheless raises an exception so that a stack traceback can be printed, in case a run-away program was the cause." -msgstr "" +msgid "" +"Raised when an operation runs out of memory but the situation may still be " +"rescued (by deleting some objects). The associated value is a string " +"indicating what kind of (internal) operation ran out of memory. Note that " +"because of the underlying memory management architecture " +"(C's :c:func:`malloc` function), the interpreter may not always be able to " +"completely recover from this situation; it nevertheless raises an exception " +"so that a stack traceback can be printed, in case a run-away program was " +"the cause." +msgstr "" +"زمانی پرتاب می‌شود که یک عملیات با کمبود حافظه مواجه شود، اما وضعیت هنوز " +"ممکن است قابل نجات باشد (با حذف برخی اشیاء). مقدار مرتبط، رشته‌ای است که " +"نشان می‌دهد چه نوع عملیات (داخلی) با کمبود حافظه مواجه شده است. توجه داشته " +"باشید که به دلیل معماری زیربنایی مدیریت حافظه (تابع :c:func:`malloc` در C)، " +"مفسر ممکن است همیشه قادر به بازیابی کامل از این وضعیت نباشد؛ با این حال " +"استثنایی پرتاب می‌کند تا در صورتی که علت، یک برنامه مهارنشدنی بوده باشد، " +"بتوان ردگیری پشته را چاپ کرد." -msgid "Raised when a local or global name is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found." +msgid "" +"Raised when a local or global name is not found. This applies only to " +"unqualified names. The associated value is an error message that includes " +"the name that could not be found." msgstr "" +"هنگامی پرتاب می‌شود که یک نام محلی یا سراسری یافت نشود. این مورد فقط برای " +"نام‌های فاقد صلاحیت (unqualified) صدق می‌کند. مقدار مرتبط، پیام خطایی است که " +"شامل نامی است که یافت نشد." msgid "The optional *name* keyword-only argument sets the attribute:" msgstr "" +"آرگومان اختیاری *name* که فقط به‌صورت کلیدواژه‌ای پذیرفته می‌شود، ویژگی را " +"تنظیم می‌کند:" msgid "The name of the variable that was attempted to be accessed." -msgstr "" +msgstr "نام متغیری که تلاش شد به آن دسترسی پیدا شود." msgid "Added the :attr:`name` attribute." -msgstr "" +msgstr "ویژگی :attr:`name` اضافه شد." -msgid "This exception is derived from :exc:`RuntimeError`. In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added." +msgid "" +"This exception is derived from :exc:`RuntimeError`. In user defined base " +"classes, abstract methods should raise this exception when they require " +"derived classes to override the method, or while the class is being " +"developed to indicate that the real implementation still needs to be added." msgstr "" +"این استثنا از :exc:`RuntimeError` مشتق شده است. در کلاس‌های پایه تعریف‌شده " +"توسط کاربر، متدهای انتزاعی باید این استثنا را زمانی پرتاب کنند که لازم باشد " +"کلاس‌های مشتق‌شده متد را بازنویسی کنند، یا هنگامی که کلاس در حال توسعه است تا " +"نشان دهند پیاده‌سازی واقعی هنوز باید اضافه شود." -msgid "It should not be used to indicate that an operator or method is not meant to be supported at all -- in that case either leave the operator / method undefined or, if a subclass, set it to :data:`None`." +msgid "" +"It should not be used to indicate that an operator or method is not meant " +"to be supported at all -- in that case either leave the operator / method " +"undefined or, if a subclass, set it to :data:`None`." msgstr "" +"نباید برای نشان دادن اینکه یک عملگر یا متد به‌هیچ‌وجه قرار نیست پشتیبانی شود، " +"استفاده شود — در این حالت یا عملگر / متد را تعریف‌نشده بگذارید یا، اگر یک " +"زیرکلاس است، آن را روی :data:`None` قرار دهید." -msgid ":exc:`!NotImplementedError` and :data:`!NotImplemented` are not interchangeable. This exception should only be used as described above; see :data:`NotImplemented` for details on correct usage of the built-in constant." +msgid "" +":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " +"interchangeable. This exception should only be used as described above; " +"see :data:`NotImplemented` for details on correct usage of the built-in " +"constant." msgstr "" +":exc:`!NotImplementedError` و :data:`!NotImplemented` قابل تعویض با یکدیگر " +"نیستند. این استثنا باید فقط همان‌طور که در بالا توضیح داده شد استفاده شود؛ " +"برای جزئیات درباره‌ی استفاده‌ی صحیح از ثابت توکار، :data:`NotImplemented` را " +"ببینید." -msgid "This exception is raised when a system function returns a system-related error, including I/O failures such as \"file not found\" or \"disk full\" (not for illegal argument types or other incidental errors)." +msgid "" +"This exception is raised when a system function returns a system-related " +"error, including I/O failures such as \"file not found\" or \"disk full\" " +"(not for illegal argument types or other incidental errors)." msgstr "" +"این استثنا زمانی پرتاب می‌شود که یک تابع سیستمی خطایی مرتبط با سیستم را " +"برگرداند، از جمله خطاهای ورودی/خروجی مانند «فایل یافت نشد» یا «دیسک پر است» " +"(نه برای انواع غیرمجاز آرگومان یا سایر خطاهای اتفاقی)." -msgid "The second form of the constructor sets the corresponding attributes, described below. The attributes default to :const:`None` if not specified. For backwards compatibility, if three arguments are passed, the :attr:`~BaseException.args` attribute contains only a 2-tuple of the first two constructor arguments." -msgstr "" +msgid "" +"The second form of the constructor sets the corresponding attributes, " +"described below. The attributes default to :const:`None` if not " +"specified. For backwards compatibility, if three arguments are passed, " +"the :attr:`~BaseException.args` attribute contains only a 2-tuple of the " +"first two constructor arguments." +msgstr "" +"دومین شکل سازنده، ویژگی‌های متناظر را که در ادامه توضیح داده شده‌اند، تنظیم " +"می‌کند. مقدار پیش‌فرض این ویژگی‌ها در صورتی که مشخص نشده باشند، :const:`None` " +"است. برای سازگاری با نسخه‌های پیشین، اگر سه آرگومان ارسال شود، " +"ویژگی :attr:`~BaseException.args` فقط شامل یک تاپل دوتایی از دو آرگومان " +"نخست سازنده خواهد بود." -msgid "The constructor often actually returns a subclass of :exc:`OSError`, as described in `OS exceptions`_ below. The particular subclass depends on the final :attr:`.errno` value. This behaviour only occurs when constructing :exc:`OSError` directly or via an alias, and is not inherited when subclassing." -msgstr "" +msgid "" +"The constructor often actually returns a subclass of :exc:`OSError`, as " +"described in `OS exceptions`_ below. The particular subclass depends on " +"the final :attr:`.errno` value. This behaviour only occurs when " +"constructing :exc:`OSError` directly or via an alias, and is not inherited " +"when subclassing." +msgstr "" +"سازنده در واقع اغلب یک زیرکلاس از :exc:`OSError` را برمی‌گرداند، همان‌طور که " +"در `OS exceptions`_ در ادامه توضیح داده شده است. زیرکلاس خاص به مقدار " +"نهایی :attr:`.errno` بستگی دارد. این رفتار فقط زمانی رخ می‌دهد " +"که :exc:`OSError` مستقیماً یا از طریق یک نام مستعار ساخته شود و هنگام ایجاد " +"زیرکلاس به ارث نمی‌رسد." msgid "A numeric error code from the C variable :c:data:`errno`." -msgstr "" +msgstr "یک کد خطای عددی از متغیر C با نام :c:data:`errno`." -msgid "Under Windows, this gives you the native Windows error code. The :attr:`.errno` attribute is then an approximate translation, in POSIX terms, of that native error code." +msgid "" +"Under Windows, this gives you the native Windows error code. " +"The :attr:`.errno` attribute is then an approximate translation, in POSIX " +"terms, of that native error code." msgstr "" +"در ویندوز، این به شما کد خطای بومی ویندوز را می‌دهد. در این صورت، " +"ویژگی :attr:`.errno` ترجمه‌ای تقریبی، در اصطلاحات POSIX، از آن کد خطای بومی " +"است." -msgid "Under Windows, if the *winerror* constructor argument is an integer, the :attr:`.errno` attribute is determined from the Windows error code, and the *errno* argument is ignored. On other platforms, the *winerror* argument is ignored, and the :attr:`winerror` attribute does not exist." +msgid "" +"Under Windows, if the *winerror* constructor argument is an integer, " +"the :attr:`.errno` attribute is determined from the Windows error code, and " +"the *errno* argument is ignored. On other platforms, the *winerror* " +"argument is ignored, and the :attr:`winerror` attribute does not exist." msgstr "" +"در ویندوز، اگر آرگومان سازنده‌ی *winerror* یک عدد صحیح باشد، " +"ویژگی :attr:`.errno` از کد خطای ویندوز تعیین می‌شود و آرگومان *errno* نادیده " +"گرفته می‌شود. در سکوهای دیگر، آرگومان *winerror* نادیده گرفته می‌شود و " +"ویژگی :attr:`winerror` وجود ندارد." -msgid "The corresponding error message, as provided by the operating system. It is formatted by the C functions :c:func:`!perror` under POSIX, and :c:func:`!FormatMessage` under Windows." +msgid "" +"The corresponding error message, as provided by the operating system. It " +"is formatted by the C functions :c:func:`!perror` under POSIX, " +"and :c:func:`!FormatMessage` under Windows." msgstr "" +"پیام خطای متناظر، همان‌طور که توسط سیستم‌عامل ارائه می‌شود. این پیام توسط " +"توابع C :c:func:`!perror` در POSIX و :c:func:`!FormatMessage` در ویندوز " +"قالب‌بندی می‌شود." -msgid "For exceptions that involve a file system path (such as :func:`open` or :func:`os.unlink`), :attr:`filename` is the file name passed to the function. For functions that involve two file system paths (such as :func:`os.rename`), :attr:`filename2` corresponds to the second file name passed to the function." -msgstr "" +msgid "" +"For exceptions that involve a file system path (such as :func:`open` " +"or :func:`os.unlink`), :attr:`filename` is the file name passed to the " +"function. For functions that involve two file system paths (such " +"as :func:`os.rename`), :attr:`filename2` corresponds to the second file " +"name passed to the function." +msgstr "" +"برای استثناهایی که شامل یک مسیر سیستم‌فایل هستند (مانند :func:`open` " +"یا :func:`os.unlink`)، :attr:`filename` نام فایلی است که به تابع داده شده " +"است. برای توابعی که شامل دو مسیر سیستم‌فایل هستند " +"(مانند :func:`os.rename`)، :attr:`filename2` متناظر با دومین نام فایل " +"داده‌شده به تابع است." -msgid ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the constructor may return a subclass." +msgid "" +":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` " +"and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the " +"constructor may return a subclass." msgstr "" +":exc:`EnvironmentError`، :exc:`IOError`، :exc:`WindowsError`، :exc:`socket.error`، :exc:`select.error` " +"و :exc:`!mmap.error` در :exc:`OSError` ادغام شده‌اند و سازنده ممکن است یک " +"زیرکلاس برگرداند." -msgid "The :attr:`filename` attribute is now the original file name passed to the function, instead of the name encoded to or decoded from the :term:`filesystem encoding and error handler`. Also, the *filename2* constructor argument and attribute was added." +msgid "" +"The :attr:`filename` attribute is now the original file name passed to the " +"function, instead of the name encoded to or decoded from " +"the :term:`filesystem encoding and error handler`. Also, the *filename2* " +"constructor argument and attribute was added." msgstr "" +"ویژگی :attr:`filename` اکنون نام اصلی فایل ارسال‌شده به تابع است، به‌جای نامی " +"که به :term:`filesystem encoding and error handler` کدگذاری یا از آن " +"کدگشایی شده است. همچنین، آرگومان سازنده و ویژگی *filename2* افزوده شد." -msgid "Raised when the result of an arithmetic operation is too large to be represented. This cannot occur for integers (which would rather raise :exc:`MemoryError` than give up). However, for historical reasons, OverflowError is sometimes raised for integers that are outside a required range. Because of the lack of standardization of floating-point exception handling in C, most floating-point operations are not checked." -msgstr "" +msgid "" +"Raised when the result of an arithmetic operation is too large to be " +"represented. This cannot occur for integers (which would rather " +"raise :exc:`MemoryError` than give up). However, for historical reasons, " +"OverflowError is sometimes raised for integers that are outside a required " +"range. Because of the lack of standardization of floating-point exception " +"handling in C, most floating-point operations are not checked." +msgstr "" +"زمانی پرتاب می‌شود که نتیجه‌ی یک عملیات حسابی آن‌قدر بزرگ باشد که نتوان آن را " +"نمایش داد. این حالت برای اعداد صحیح رخ نمی‌دهد (که به‌جای تسلیم " +"شدن، :exc:`MemoryError` را پرتاب می‌کنند). با این حال، به دلایل تاریخی، گاهی " +"OverflowError برای اعداد صحیحی که خارج از محدوده‌ی مورد نیاز هستند پرتاب " +"می‌شود. به دلیل نبود استانداردسازی در مدیریت استثناهای ممیز شناور در C، " +"بیشتر عملیات‌های ممیز شناور بررسی نمی‌شوند." -msgid "This exception is derived from :exc:`RuntimeError`. It is raised when an operation is blocked during interpreter shutdown also known as :term:`Python finalization `." +msgid "" +"This exception is derived from :exc:`RuntimeError`. It is raised when an " +"operation is blocked during interpreter shutdown also known " +"as :term:`Python finalization `." msgstr "" +"این استثنا از :exc:`RuntimeError` مشتق شده است. این استثنا زمانی پرتاب " +"می‌شود که عملیاتی در حین خاموش شدن مفسر، که با عنوان :term:`نهایی‌سازی پایتون " +"` نیز شناخته می‌شود، مسدود شده باشد." -msgid "Examples of operations which can be blocked with a :exc:`PythonFinalizationError` during the Python finalization:" +msgid "" +"Examples of operations which can be blocked with " +"a :exc:`PythonFinalizationError` during the Python finalization:" msgstr "" +"نمونه‌هایی از عملیات‌هایی که ممکن است در طول نهایی‌سازی پایتون (Python " +"finalization) با :exc:`PythonFinalizationError` مسدود شوند:" msgid "Creating a new Python thread." -msgstr "" +msgstr "ایجاد یک نخ پایتون جدید." msgid ":meth:`Joining ` a running daemon thread." -msgstr "" +msgstr ":meth:`پیوستن ` به یک نخ daemon در حال اجرا." msgid ":func:`os.fork`." -msgstr "" +msgstr ":func:`os.fork`." msgid "See also the :func:`sys.is_finalizing` function." -msgstr "" +msgstr "همچنین تابع :func:`sys.is_finalizing` را ببینید." msgid "Previously, a plain :exc:`RuntimeError` was raised." -msgstr "" +msgstr "پیش از این، یک :exc:`RuntimeError` ساده پرتاب می‌شد." msgid ":meth:`threading.Thread.join` can now raise this exception." -msgstr "" +msgstr ":meth:`threading.Thread.join` اکنون می‌تواند این استثنا را پرتاب کند." -msgid "This exception is derived from :exc:`RuntimeError`. It is raised when the interpreter detects that the maximum recursion depth (see :func:`sys.getrecursionlimit`) is exceeded." +msgid "" +"This exception is derived from :exc:`RuntimeError`. It is raised when the " +"interpreter detects that the maximum recursion depth " +"(see :func:`sys.getrecursionlimit`) is exceeded." msgstr "" +"این استثنا از :exc:`RuntimeError` مشتق شده است. این استثنا زمانی پرتاب " +"می‌شود که مفسر تشخیص دهد که از حداکثر عمق بازگشت " +"(به :func:`sys.getrecursionlimit` مراجعه کنید) فراتر رفته است." -msgid "This exception is raised when a weak reference proxy, created by the :func:`weakref.proxy` function, is used to access an attribute of the referent after it has been garbage collected. For more information on weak references, see the :mod:`weakref` module." +msgid "" +"This exception is raised when a weak reference proxy, created by " +"the :func:`weakref.proxy` function, is used to access an attribute of the " +"referent after it has been garbage collected. For more information on weak " +"references, see the :mod:`weakref` module." msgstr "" +"این استثنا زمانی پرتاب می‌شود که از یک پراکسی ارجاع ضعیف، که توسط " +"تابع :func:`weakref.proxy` ایجاد شده است، برای دسترسی به ویژگی‌ای از شیء " +"مورد ارجاع پس از زباله‌روبی شدن آن استفاده شود. برای اطلاعات بیشتر درباره‌ی " +"ارجاع‌های ضعیف، ماژول :mod:`weakref` را ببینید." -msgid "Raised when an error is detected that doesn't fall in any of the other categories. The associated value is a string indicating what precisely went wrong." +msgid "" +"Raised when an error is detected that doesn't fall in any of the other " +"categories. The associated value is a string indicating what precisely " +"went wrong." msgstr "" +"زمانی پرتاب می‌شود که خطایی تشخیص داده شود که در هیچ‌یک از دسته‌های دیگر قرار " +"نمی‌گیرد. مقدار مرتبط، رشته‌ای است که نشان می‌دهد دقیقاً چه چیزی اشتباه پیش رفت." -msgid "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:`~iterator.__next__` method to signal that there are no further items produced by the iterator." +msgid "" +"Raised by built-in function :func:`next` and " +"an :term:`iterator`\\'s :meth:`~iterator.__next__` method to signal that " +"there are no further items produced by the iterator." msgstr "" +"توسط تابع توکار :func:`next` و متد :meth:`~iterator.__next__` از " +"یک :term:`iterator` پرتاب می‌شود تا نشان دهد که دیگر آیتمی از آن تولید " +"نمی‌شود." -msgid "The exception object has a single attribute :attr:`!value`, which is given as an argument when constructing the exception, and defaults to :const:`None`." +msgid "" +"The exception object has a single attribute :attr:`!value`, which is given " +"as an argument when constructing the exception, and defaults " +"to :const:`None`." msgstr "" +"شیء استثنا دارای یک ویژگی واحد به نام :attr:`!value` است که به‌عنوان آرگومان " +"هنگام ساخت استثنا داده می‌شود و مقدار پیش‌فرض آن :const:`None` است." -msgid "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:`StopIteration` instance is raised, and the value returned by the function is used as the :attr:`value` parameter to the constructor of the exception." +msgid "" +"When a :term:`generator` or :term:`coroutine` function returns, a " +"new :exc:`StopIteration` instance is raised, and the value returned by the " +"function is used as the :attr:`value` parameter to the constructor of the " +"exception." msgstr "" +"هنگامی که یک تابع :term:`تولیدگر ` یا :term:`هم‌روال ` " +"بازگشت می‌کند، نمونه‌ی جدیدی از :exc:`StopIteration` پرتاب می‌شود، و مقدار " +"برگردانده‌شده توسط تابع به‌عنوان پارامتر :attr:`value` برای سازنده‌ی استثنا " +"استفاده می‌شود." -msgid "If a generator code directly or indirectly raises :exc:`StopIteration`, it is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` as the new exception's cause)." +msgid "" +"If a generator code directly or indirectly raises :exc:`StopIteration`, it " +"is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " +"as the new exception's cause)." msgstr "" +"اگر کد یک تولیدگر به‌طور مستقیم یا غیرمستقیم :exc:`StopIteration` را پرتاب " +"کند، این استثنا به :exc:`RuntimeError` تبدیل می‌شود (در حالی " +"که :exc:`StopIteration` به‌عنوان علت استثنای جدید حفظ می‌شود)." -msgid "Added ``value`` attribute and the ability for generator functions to use it to return a value." +msgid "" +"Added ``value`` attribute and the ability for generator functions to use it " +"to return a value." msgstr "" +"ویژگی ``value`` و توانایی توابع تولیدگر برای استفاده از آن جهت برگرداندن یک " +"مقدار افزوده شد." -msgid "Introduced the RuntimeError transformation via ``from __future__ import generator_stop``, see :pep:`479`." +msgid "" +"Introduced the RuntimeError transformation via ``from __future__ import " +"generator_stop``, see :pep:`479`." msgstr "" +"تبدیل RuntimeError از طریق ``from __future__ import generator_stop`` معرفی " +"شد، :pep:`479` را ببینید." -msgid "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error raised in a generator is transformed into a :exc:`RuntimeError`." +msgid "" +"Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " +"raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" +"فعال‌سازی :pep:`479` برای تمام کدها به‌صورت پیش‌فرض: خطای :exc:`StopIteration` " +"که در یک تولیدگر پرتاب می‌شود، به :exc:`RuntimeError` تبدیل می‌شود." -msgid "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous iterator` object to stop the iteration." +msgid "" +"Must be raised by :meth:`~object.__anext__` method of " +"an :term:`asynchronous iterator` object to stop the iteration." msgstr "" +"باید توسط متد :meth:`~object.__anext__` یک شیء :term:`asynchronous " +"iterator` پرتاب شود تا تکرار متوقف شود." -msgid "Raised when the parser encounters a syntax error. This may occur in an :keyword:`import` statement, in a call to the built-in functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script or standard input (also interactively)." +msgid "" +"Raised when the parser encounters a syntax error. This may occur in " +"an :keyword:`import` statement, in a call to the built-in " +"functions :func:`compile`, :func:`exec`, or :func:`eval`, or when reading " +"the initial script or standard input (also interactively)." msgstr "" +"زمانی که پارسر با یک خطای نحوی مواجه شود، پرتاب می‌شود. این ممکن است در " +"یک دستور :keyword:`import`، در فراخوانی توابع " +"توکار :func:`compile`، :func:`exec`، یا :func:`eval`، یا هنگام خواندن " +"اسکریپت اولیه یا ورودی استاندارد (همچنین به‌صورت تعاملی) رخ دهد." -msgid "The :func:`str` of the exception instance returns only the error message. Details is a tuple whose members are also available as separate attributes." +msgid "" +"The :func:`str` of the exception instance returns only the error message. " +"Details is a tuple whose members are also available as separate attributes." msgstr "" +":func:`str` از نمونه‌ی استثنا فقط پیام خطا را برمی‌گرداند. جزئیات یک تاپل است " +"که اعضای آن به‌عنوان ویژگی‌های جداگانه نیز در دسترس هستند." msgid "The name of the file the syntax error occurred in." -msgstr "" +msgstr "نام فایلی که خطای سینتکسی در آن رخ داد." -msgid "Which line number in the file the error occurred in. This is 1-indexed: the first line in the file has a ``lineno`` of 1." +msgid "" +"Which line number in the file the error occurred in. This is 1-indexed: the " +"first line in the file has a ``lineno`` of 1." msgstr "" +"شماره خطی در فایل که خطا در آن رخ داده است. این اندیس‌گذاری ۱-مبنا است: " +"اولین خط فایل دارای ``lineno`` برابر ۱ است." -msgid "The column in the line where the error occurred. This is 1-indexed: the first character in the line has an ``offset`` of 1." +msgid "" +"The column in the line where the error occurred. This is 1-indexed: the " +"first character in the line has an ``offset`` of 1." msgstr "" +"ستون در خطی که خطا در آن رخ داده است. این مقدار ۱-اندیس‌گذاری‌شده است: اولین " +"نویسه‌ی خط دارای ``offset`` برابر با ۱ است." msgid "The source code text involved in the error." -msgstr "" +msgstr "متن کد منبعی که در خطا دخیل است." -msgid "Which line number in the file the error occurred ends in. This is 1-indexed: the first line in the file has a ``lineno`` of 1." +msgid "" +"Which line number in the file the error occurred ends in. This is 1-" +"indexed: the first line in the file has a ``lineno`` of 1." msgstr "" +"شماره خطی در فایل که خطای رخ‌داده در آن به پایان می‌رسد. این مقدار از ۱ " +"اندیس‌گذاری شده است: اولین خط فایل ``lineno`` برابر ۱ دارد." -msgid "The column in the end line where the error occurred finishes. This is 1-indexed: the first character in the line has an ``offset`` of 1." +msgid "" +"The column in the end line where the error occurred finishes. This is 1-" +"indexed: the first character in the line has an ``offset`` of 1." msgstr "" +"ستونی در خط پایانی که خطا در آن پایان می‌یابد. این مقدار ۱-اندیس‌دار است: " +"نخستین نویسه‌ی خط دارای ``offset`` برابر با ۱ است." -msgid "For errors in f-string fields, the message is prefixed by \"f-string: \" and the offsets are offsets in a text constructed from the replacement expression. For example, compiling f'Bad {a b} field' results in this args attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." +msgid "" +"For errors in f-string fields, the message is prefixed by \"f-string: \" " +"and the offsets are offsets in a text constructed from the replacement " +"expression. For example, compiling f'Bad {a b} field' results in this args " +"attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" +"برای خطاهای فیلدهای اف‌استرینگ، پیام با پیشوند \"f-string: \" آغاز می‌شود و " +"آفست‌ها، آفست‌هایی در متنی هستند که از عبارت جایگزینی ساخته می‌شود. برای مثال، " +"کامپایل کردن f'Bad {a b} field' منجر به این ویژگی args می‌شود: ('f-" +"string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." -msgstr "" +msgstr "ویژگی‌های :attr:`end_lineno` و :attr:`end_offset` افزوده شدند." -msgid "Base class for syntax errors related to incorrect indentation. This is a subclass of :exc:`SyntaxError`." +msgid "" +"Base class for syntax errors related to incorrect indentation. This is a " +"subclass of :exc:`SyntaxError`." msgstr "" +"کلاس پایه برای خطاهای سینتکسی مربوط به تورفتگی نادرست. این یک زیرکلاس " +"از :exc:`SyntaxError` است." -msgid "Raised when indentation contains an inconsistent use of tabs and spaces. This is a subclass of :exc:`IndentationError`." +msgid "" +"Raised when indentation contains an inconsistent use of tabs and spaces. " +"This is a subclass of :exc:`IndentationError`." msgstr "" +"هنگامی که تورفتگی شامل استفاده‌ی ناسازگار از تب‌ها و فاصله‌ها باشد، پرتاب " +"می‌شود. این یک زیرکلاس از :exc:`IndentationError` است." -msgid "Raised when the interpreter finds an internal error, but the situation does not look so serious to cause it to abandon all hope. The associated value is a string indicating what went wrong (in low-level terms). In :term:`CPython`, this could be raised by incorrectly using Python's C API, such as returning a ``NULL`` value without an exception set." -msgstr "" +msgid "" +"Raised when the interpreter finds an internal error, but the situation does " +"not look so serious to cause it to abandon all hope. The associated value " +"is a string indicating what went wrong (in low-level terms). " +"In :term:`CPython`, this could be raised by incorrectly using Python's C " +"API, such as returning a ``NULL`` value without an exception set." +msgstr "" +"زمانی پرتاب می‌شود که مفسر یک خطای داخلی پیدا کند، اما وضعیت آن‌قدر جدی به " +"نظر نمی‌رسد که باعث شود همه امید را از دست بدهد. مقدار مرتبط، رشته‌ای است که " +"نشان می‌دهد چه مشکلی پیش آمده است (در اصطلاحات سطح پایین). " +"در :term:`CPython`، این استثنا ممکن است به دلیل استفاده نادرست از C API " +"پایتون پرتاب شود، مانند برگرداندن مقدار ``NULL`` بدون تنظیم استثنا." -msgid "If you're confident that this exception wasn't your fault, or the fault of a package you're using, you should report this to the author or maintainer of your Python interpreter. Be sure to report the version of the Python interpreter (``sys.version``; it is also printed at the start of an interactive Python session), the exact error message (the exception's associated value) and if possible the source of the program that triggered the error." -msgstr "" +msgid "" +"If you're confident that this exception wasn't your fault, or the fault of " +"a package you're using, you should report this to the author or maintainer " +"of your Python interpreter. Be sure to report the version of the Python " +"interpreter (``sys.version``; it is also printed at the start of an " +"interactive Python session), the exact error message (the exception's " +"associated value) and if possible the source of the program that triggered " +"the error." +msgstr "" +"اگر مطمئن هستید که این استثنا تقصیر شما یا تقصیر بسته‌ای که استفاده می‌کنید " +"نیست، باید آن را به نویسنده یا نگه‌دارنده مفسر پایتون خود گزارش دهید. حتماً " +"نسخه مفسر پایتون (``sys.version``؛ این نسخه در ابتدای یک نشست تعاملی پایتون " +"نیز چاپ می‌شود)، پیام خطای دقیق (مقدار مرتبط با استثنا) و در صورت امکان کد " +"منبع برنامه‌ای که باعث بروز خطا شده است را گزارش دهید." -msgid "This exception is raised by the :func:`sys.exit` function. It inherits from :exc:`BaseException` instead of :exc:`Exception` so that it is not accidentally caught by code that catches :exc:`Exception`. This allows the exception to properly propagate up and cause the interpreter to exit. When it is not handled, the Python interpreter exits; no stack traceback is printed. The constructor accepts the same optional argument passed to :func:`sys.exit`. If the value is an integer, it specifies the system exit status (passed to C's :c:func:`!exit` function); if it is ``None``, the exit status is zero; if it has another type (such as a string), the object's value is printed and the exit status is one." -msgstr "" +msgid "" +"This exception is raised by the :func:`sys.exit` function. It inherits " +"from :exc:`BaseException` instead of :exc:`Exception` so that it is not " +"accidentally caught by code that catches :exc:`Exception`. This allows the " +"exception to properly propagate up and cause the interpreter to exit. When " +"it is not handled, the Python interpreter exits; no stack traceback is " +"printed. The constructor accepts the same optional argument passed " +"to :func:`sys.exit`. If the value is an integer, it specifies the system " +"exit status (passed to C's :c:func:`!exit` function); if it is ``None``, " +"the exit status is zero; if it has another type (such as a string), the " +"object's value is printed and the exit status is one." +msgstr "" +"این استثنا توسط تابع :func:`sys.exit` پرتاب می‌شود. این استثنا به " +"جای :exc:`Exception` از :exc:`BaseException` ارث می‌برد تا به‌طور تصادفی توسط " +"کدی که :exc:`Exception` را می‌گیرد، گرفته نشود. این امکان را می‌دهد که استثنا " +"به‌درستی به بالا منتشر شود و باعث خروج مفسر شود. هنگامی که این استثنا مدیریت " +"نشود، مفسر پایتون خارج می‌شود؛ هیچ ردگیری پشته‌ای چاپ نمی‌شود. سازنده همان " +"آرگومان اختیاری منتقل‌شده به :func:`sys.exit` را می‌پذیرد. اگر مقدار یک عدد " +"صحیح باشد، وضعیت خروج سیستم را مشخص می‌کند (که به تابع :c:func:`!exit` در C " +"منتقل می‌شود)؛ اگر ``None`` باشد، وضعیت خروج ۰ است؛ اگر نوع دیگری داشته باشد " +"(مانند یک رشته)، مقدار شیء چاپ می‌شود و وضعیت خروج ۱ است." -msgid "A call to :func:`sys.exit` is translated into an exception so that clean-up handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be executed, and so that a debugger can execute a script without running the risk of losing control. The :func:`os._exit` function can be used if it is absolutely positively necessary to exit immediately (for example, in the child process after a call to :func:`os.fork`)." -msgstr "" +msgid "" +"A call to :func:`sys.exit` is translated into an exception so that clean-up " +"handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " +"executed, and so that a debugger can execute a script without running the " +"risk of losing control. The :func:`os._exit` function can be used if it is " +"absolutely positively necessary to exit immediately (for example, in the " +"child process after a call to :func:`os.fork`)." +msgstr "" +"فراخوانی :func:`sys.exit` به یک استثنا تبدیل می‌شود تا هندلرهای پاک‌سازی " +"(بندهای :keyword:`finally` از دستورات :keyword:`try`) بتوانند اجرا شوند، و " +"تا یک اشکال‌زدا بتواند یک اسکریپت را بدون خطر از دست دادن کنترل اجرا کند. " +"اگر خروج فوری به‌طور مطلق و قطعی ضروری باشد، می‌توان از تابع :func:`os._exit` " +"استفاده کرد (برای مثال، در فرایند فرزند پس از فراخوانی :func:`os.fork`)." -msgid "The exit status or error message that is passed to the constructor. (Defaults to ``None``.)" +msgid "" +"The exit status or error message that is passed to the constructor. " +"(Defaults to ``None``.)" msgstr "" +"وضعیت خروج یا پیام خطایی که به سازنده داده می‌شود. (پیش‌فرض ``None`` است.)" -msgid "Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch." +msgid "" +"Raised when an operation or function is applied to an object of " +"inappropriate type. The associated value is a string giving details about " +"the type mismatch." msgstr "" +"هنگامی که یک عملیات یا تابع بر شیء‌ای با نوع نامناسب اعمال شود، پرتاب می‌شود. " +"مقدار مرتبط، رشته‌ای است که جزئیاتی درباره‌ی عدم تطابق نوع ارائه می‌دهد." -msgid "This exception may be raised by user code to indicate that an attempted operation on an object is not supported, and is not meant to be. If an object is meant to support a given operation but has not yet provided an implementation, :exc:`NotImplementedError` is the proper exception to raise." +msgid "" +"This exception may be raised by user code to indicate that an attempted " +"operation on an object is not supported, and is not meant to be. If an " +"object is meant to support a given operation but has not yet provided an " +"implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" +"این استثنا ممکن است توسط کد کاربر پرتاب شود تا نشان دهد که عملیات تلاش‌شده " +"روی یک شیء پشتیبانی نمی‌شود، و قرار نیست پشتیبانی شود. اگر قرار باشد یک شیء " +"از عملیات مشخصی پشتیبانی کند اما هنوز پیاده‌سازی آن را ارائه نکرده " +"باشد، :exc:`NotImplementedError` استثنای مناسب برای پرتاب است." -msgid "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :class:`int` is expected) should result in a :exc:`TypeError`, but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in a :exc:`ValueError`." +msgid "" +"Passing arguments of the wrong type (e.g. passing a :class:`list` when " +"an :class:`int` is expected) should result in a :exc:`TypeError`, but " +"passing arguments with the wrong value (e.g. a number outside expected " +"boundaries) should result in a :exc:`ValueError`." msgstr "" +"ارسال آرگومان‌هایی با نوع نادرست (برای مثال، ارسال یک :class:`list` هنگامی " +"که یک :class:`int` انتظار می‌رود) باید منجر به :exc:`TypeError` شود، اما " +"ارسال آرگومان‌هایی با مقدار نادرست (برای مثال، عددی خارج از محدوده‌های مورد " +"انتظار) باید منجر به :exc:`ValueError` شود." -msgid "Raised when a reference is made to a local variable in a function or method, but no value has been bound to that variable. This is a subclass of :exc:`NameError`." +msgid "" +"Raised when a reference is made to a local variable in a function or " +"method, but no value has been bound to that variable. This is a subclass " +"of :exc:`NameError`." msgstr "" +"هنگامی پرتاب می‌شود که در یک تابع یا متد، به یک متغیر محلی ارجاع داده شود، " +"اما هیچ مقداری به آن متغیر اختصاص نیافته باشد. این استثنا زیرکلاسی " +"از :exc:`NameError` است." -msgid "Raised when a Unicode-related encoding or decoding error occurs. It is a subclass of :exc:`ValueError`." +msgid "" +"Raised when a Unicode-related encoding or decoding error occurs. It is a " +"subclass of :exc:`ValueError`." msgstr "" +"هنگامی که خطای کدگذاری یا کدگشایی مرتبط با یونیکد رخ می‌دهد، پرتاب می‌شود. " +"این یک زیرکلاس از :exc:`ValueError` است." -msgid ":exc:`UnicodeError` has attributes that describe the encoding or decoding error. For example, ``err.object[err.start:err.end]`` gives the particular invalid input that the codec failed on." +msgid "" +":exc:`UnicodeError` has attributes that describe the encoding or decoding " +"error. For example, ``err.object[err.start:err.end]`` gives the particular " +"invalid input that the codec failed on." msgstr "" +":exc:`UnicodeError` دارای ویژگی‌هایی است که خطای کدگذاری یا کدگشایی را توصیف " +"می‌کنند. برای مثال، ``err.object[err.start:err.end]`` ورودی نامعتبر خاصی را " +"می‌دهد که کدک (codec) در پردازش آن ناموفق بوده است." msgid "The name of the encoding that raised the error." -msgstr "" +msgstr "نام کدگذاری‌ای که خطا را پرتاب کرد." msgid "A string describing the specific codec error." -msgstr "" +msgstr "رشته‌ای که خطای خاص کدک را توصیف می‌کند." msgid "The object the codec was attempting to encode or decode." -msgstr "" +msgstr "شیءای که کدک در حال تلاش برای کدگذاری یا کدگشایی آن بود." msgid "The first index of invalid data in :attr:`object`." -msgstr "" +msgstr "اولین اندیس داده‌های نامعتبر در :attr:`object`." -msgid "This value should not be negative as it is interpreted as an absolute offset but this constraint is not enforced at runtime." +msgid "" +"This value should not be negative as it is interpreted as an absolute " +"offset but this constraint is not enforced at runtime." msgstr "" +"این مقدار نباید منفی باشد، زیرا به‌عنوان یک آفست مطلق (absolute offset) " +"تفسیر می‌شود، اما این محدودیت در ران‌تایم اعمال نمی‌شود." msgid "The index after the last invalid data in :attr:`object`." -msgstr "" +msgstr "اندیس پس از آخرین داده‌ی نامعتبر در :attr:`object`." -msgid "Raised when a Unicode-related error occurs during encoding. It is a subclass of :exc:`UnicodeError`." +msgid "" +"Raised when a Unicode-related error occurs during encoding. It is a " +"subclass of :exc:`UnicodeError`." msgstr "" +"هنگامی که خطایی مرتبط با Unicode در حین کدگذاری رخ دهد، پرتاب می‌شود. این، " +"زیرکلاسی از :exc:`UnicodeError` است." -msgid "Raised when a Unicode-related error occurs during decoding. It is a subclass of :exc:`UnicodeError`." +msgid "" +"Raised when a Unicode-related error occurs during decoding. It is a " +"subclass of :exc:`UnicodeError`." msgstr "" +"هنگامی که یک خطای مرتبط با یونیکد در حین کدگشایی رخ دهد، پرتاب می‌شود. این " +"یک زیرکلاس از :exc:`UnicodeError` است." -msgid "Raised when a Unicode-related error occurs during translating. It is a subclass of :exc:`UnicodeError`." +msgid "" +"Raised when a Unicode-related error occurs during translating. It is a " +"subclass of :exc:`UnicodeError`." msgstr "" +"هنگامی که خطای مرتبط با یونیکد در حین ترجمه رخ می‌دهد، پرتاب می‌شود. این یک " +"زیرکلاس از :exc:`UnicodeError` است." -msgid "Raised when an operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as :exc:`IndexError`." +msgid "" +"Raised when an operation or function receives an argument that has the " +"right type but an inappropriate value, and the situation is not described " +"by a more precise exception such as :exc:`IndexError`." msgstr "" +"هنگامی پرتاب می‌شود که یک عملیات یا تابع آرگومانی دریافت کند که نوع آن درست " +"است اما مقدار آن نامناسب است، و این وضعیت با استثنای دقیق‌تری " +"مانند :exc:`IndexError` توصیف نشود." -msgid "Raised when the second argument of a division or modulo operation is zero. The associated value is a string indicating the type of the operands and the operation." +msgid "" +"Raised when the second argument of a division or modulo operation is zero. " +"The associated value is a string indicating the type of the operands and " +"the operation." msgstr "" +"هنگامی پرتاب می‌شود که دومین آرگومان یک عمل تقسیم یا پیمانه صفر باشد. مقدار " +"مرتبط، رشته‌ای است که نوع عملوندها و عمل را نشان می‌دهد." -msgid "The following exceptions are kept for compatibility with previous versions; starting from Python 3.3, they are aliases of :exc:`OSError`." +msgid "" +"The following exceptions are kept for compatibility with previous versions; " +"starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" +"استثناهای زیر برای سازگاری با نسخه‌های پیشین حفظ شده‌اند؛ از پایتون 3.3 به " +"بعد، آن‌ها نام‌های مستعارِ :exc:`OSError` هستند." msgid "Only available on Windows." -msgstr "" +msgstr "فقط در ویندوز در دسترس است." msgid "OS exceptions" -msgstr "" +msgstr "استثناهای سیستم‌عاملی" -msgid "The following exceptions are subclasses of :exc:`OSError`, they get raised depending on the system error code." +msgid "" +"The following exceptions are subclasses of :exc:`OSError`, they get raised " +"depending on the system error code." msgstr "" +"استثناهای زیر زیرکلاس‌هایی از :exc:`OSError` هستند و بسته به کد خطای سیستم " +"پرتاب می‌شوند." -msgid "Raised when an operation would block on an object (e.g. socket) set for non-blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:const:`~errno.EINPROGRESS`." +msgid "" +"Raised when an operation would block on an object (e.g. socket) set for non-" +"blocking operation. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` " +"and :py:const:`~errno.EINPROGRESS`." msgstr "" +"هنگامی پرتاب می‌شود که یک عملیات روی شیء (مثلاً سوکت) که برای عملیات " +"غیرمسدودکننده تنظیم شده است، مسدود شود. متناظر است " +"با :c:data:`errno` :py:const:`~errno.EAGAIN`، :py:const:`~errno.EALREADY`، :py:const:`~errno.EWOULDBLOCK` " +"و :py:const:`~errno.EINPROGRESS`." -msgid "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one more attribute:" +msgid "" +"In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " +"more attribute:" msgstr "" +"علاوه بر ویژگی‌های :exc:`OSError`، :exc:`BlockingIOError` می‌تواند یک ویژگی " +"دیگر نیز داشته باشد:" -msgid "An integer containing the number of **bytes** written to the stream before it blocked. This attribute is available when using the buffered I/O classes from the :mod:`io` module." +msgid "" +"An integer containing the number of **bytes** written to the stream before " +"it blocked. This attribute is available when using the buffered I/O classes " +"from the :mod:`io` module." msgstr "" +"یک عدد صحیح حاوی تعداد **بایت‌های** نوشته‌شده در جریان پیش از مسدود شدن آن " +"است. این ویژگی هنگام استفاده از کلاس‌های I/O بافرشده در ماژول :mod:`io` در " +"دسترس است." -msgid "Raised when an operation on a child process failed. Corresponds to :c:data:`errno` :py:const:`~errno.ECHILD`." +msgid "" +"Raised when an operation on a child process failed. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECHILD`." msgstr "" +"هنگامی پرتاب می‌شود که عملیاتی روی یک فرایند فرزند ناموفق باشد. " +"با :c:data:`errno` :py:const:`~errno.ECHILD` متناظر است." msgid "A base class for connection-related issues." -msgstr "" +msgstr "کلاس پایه‌ای برای مشکلات مرتبط با اتصال." -msgid "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:`ConnectionRefusedError` and :exc:`ConnectionResetError`." +msgid "" +"Subclasses " +"are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:`ConnectionRefusedError` " +"and :exc:`ConnectionResetError`." msgstr "" +"زیرکلاس‌ها عبارتند " +"از :exc:`BrokenPipeError`، :exc:`ConnectionAbortedError`، :exc:`ConnectionRefusedError` " +"و :exc:`ConnectionResetError`." -msgid "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe while the other end has been closed, or trying to write on a socket which has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." -msgstr "" +msgid "" +"A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " +"while the other end has been closed, or trying to write on a socket which " +"has been shutdown for writing. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EPIPE` " +"and :py:const:`~errno.ESHUTDOWN`." +msgstr "" +"زیرکلاسی از :exc:`ConnectionError`، که هنگام تلاش برای نوشتن روی یک پایپ، " +"در حالی که سر دیگر آن بسته شده است، یا تلاش برای نوشتن روی سوکتی که برای " +"نوشتن خاموش شده است، پرتاب می‌شود. " +"با :c:data:`errno` :py:const:`~errno.EPIPE` و :py:const:`~errno.ESHUTDOWN` " +"متناظر است." -msgid "A subclass of :exc:`ConnectionError`, raised when a connection attempt is aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNABORTED`." +msgid "" +"A subclass of :exc:`ConnectionError`, raised when a connection attempt is " +"aborted by the peer. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECONNABORTED`." msgstr "" +"یک زیرکلاس از :exc:`ConnectionError` است که هنگامی پرتاب می‌شود که تلاش برای " +"اتصال از سوی طرف مقابل قطع شود. متناظر " +"با :c:data:`errno` :py:const:`~errno.ECONNABORTED` است." -msgid "A subclass of :exc:`ConnectionError`, raised when a connection attempt is refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNREFUSED`." +msgid "" +"A subclass of :exc:`ConnectionError`, raised when a connection attempt is " +"refused by the peer. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECONNREFUSED`." msgstr "" +"زیرکلاسی از :exc:`ConnectionError` که هنگامی پرتاب می‌شود که تلاش برای اتصال " +"از سوی طرف مقابل رد شود. " +"معادل :c:data:`errno` :py:const:`~errno.ECONNREFUSED` است." -msgid "A subclass of :exc:`ConnectionError`, raised when a connection is reset by the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." +msgid "" +"A subclass of :exc:`ConnectionError`, raised when a connection is reset by " +"the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" +"زیرکلاسی از :exc:`ConnectionError`، که هنگامی پرتاب می‌شود که اتصال توسط " +"همتا بازنشانی شود. با :c:data:`errno` :py:const:`~errno.ECONNRESET` متناظر " +"است." -msgid "Raised when trying to create a file or directory which already exists. Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." +msgid "" +"Raised when trying to create a file or directory which already exists. " +"Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" +"هنگام تلاش برای ایجاد فایل یا پوشه‌ای که از قبل وجود دارد، پرتاب می‌شود. " +"متناظر با :c:data:`errno` :py:const:`~errno.EEXIST` است." -msgid "Raised when a file or directory is requested but doesn't exist. Corresponds to :c:data:`errno` :py:const:`~errno.ENOENT`." +msgid "" +"Raised when a file or directory is requested but doesn't exist. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" +"هنگامی که فایل یا پوشه‌ای درخواست شود اما وجود نداشته باشد، پرتاب می‌شود. " +"متناظر با :c:data:`errno` :py:const:`~errno.ENOENT` است." -msgid "Raised when a system call is interrupted by an incoming signal. Corresponds to :c:data:`errno` :py:const:`~errno.EINTR`." +msgid "" +"Raised when a system call is interrupted by an incoming signal. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" +"هنگامی پرتاب می‌شود که یک فراخوانی سیستمی توسط یک سیگنال ورودی قطع شود. " +"متناظر با :c:data:`errno` :py:const:`~errno.EINTR` است." -msgid "Python now retries system calls when a syscall is interrupted by a signal, except if the signal handler raises an exception (see :pep:`475` for the rationale), instead of raising :exc:`InterruptedError`." +msgid "" +"Python now retries system calls when a syscall is interrupted by a signal, " +"except if the signal handler raises an exception (see :pep:`475` for the " +"rationale), instead of raising :exc:`InterruptedError`." msgstr "" +"پایتون اکنون به‌جای پرتاب :exc:`InterruptedError`، فراخوانی‌های سیستمی را " +"هنگامی که با سیگنالی قطع شوند دوباره تلاش می‌کند، مگر اینکه مدیر سیگنال " +"استثنایی را پرتاب کند (برای دلیل آن :pep:`475` را ببینید)." -msgid "Raised when a file operation (such as :func:`os.remove`) is requested on a directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." +msgid "" +"Raised when a file operation (such as :func:`os.remove`) is requested on a " +"directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" +"هنگامی که یک عملیات فایل (مانند :func:`os.remove`) روی یک پوشه درخواست شود، " +"پرتاب می‌شود. با :c:data:`errno` :py:const:`~errno.EISDIR` متناظر است." -msgid "Raised when a directory operation (such as :func:`os.listdir`) is requested on something which is not a directory. On most POSIX platforms, it may also be raised if an operation attempts to open or traverse a non-directory file as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno.ENOTDIR`." +msgid "" +"Raised when a directory operation (such as :func:`os.listdir`) is requested " +"on something which is not a directory. On most POSIX platforms, it may " +"also be raised if an operation attempts to open or traverse a non-directory " +"file as if it were a directory. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ENOTDIR`." msgstr "" +"هنگامی پرتاب می‌شود که یک عملیات پوشه (مانند :func:`os.listdir`) روی چیزی که " +"پوشه نیست درخواست شود. در بیشتر پلتفرم‌های POSIX، ممکن است همچنین در صورتی " +"پرتاب شود که یک عملیات تلاش کند یک فایل غیرپوشه‌ای را به‌عنوان یک پوشه باز " +"کند یا پیمایش کند. متناظر با :c:data:`errno` :py:const:`~errno.ENOTDIR` است." -msgid "Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno.ENOTCAPABLE`." +msgid "" +"Raised when trying to run an operation without the adequate access rights - " +"for example filesystem permissions. Corresponds " +"to :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, " +"and :py:const:`~errno.ENOTCAPABLE`." msgstr "" +"هنگام تلاش برای اجرای یک عملیات بدون حق دسترسی کافی، برای مثال مجوزهای " +"سیستم‌فایل، پرتاب می‌شود. متناظر " +"با :c:data:`errno` :py:const:`~errno.EACCES`، :py:const:`~errno.EPERM` " +"و :py:const:`~errno.ENOTCAPABLE` است." -msgid "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:`PermissionError`." +msgid "" +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped " +"to :exc:`PermissionError`." msgstr "" +":py:const:`~errno.ENOTCAPABLE` در WASI اکنون به :exc:`PermissionError` " +"نگاشت می‌شود." -msgid "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :py:const:`~errno.ESRCH`." +msgid "" +"Raised when a given process doesn't exist. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ESRCH`." msgstr "" +"هنگامی که یک فرایند مشخص وجود ندارد، پرتاب می‌شود. متناظر " +"با :c:data:`errno` :py:const:`~errno.ESRCH` است." -msgid "Raised when a system function timed out at the system level. Corresponds to :c:data:`errno` :py:const:`~errno.ETIMEDOUT`." +msgid "" +"Raised when a system function timed out at the system level. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" +"هنگامی که یک تابع سیستمی در سطح سیستم دچار مهلت زمانی (timeout) شود، پرتاب " +"می‌شود. متناظر با :c:data:`errno` :py:const:`~errno.ETIMEDOUT` است." msgid "All the above :exc:`OSError` subclasses were added." -msgstr "" +msgstr "همه‌ی زیرکلاس‌های :exc:`OSError` فوق افزوده شدند." msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" -msgstr "" +msgstr ":pep:`3151` - بازطراحی سلسله‌مراتب استثناهای OS و IO" msgid "Warnings" -msgstr "" +msgstr "هشدارها" -msgid "The following exceptions are used as warning categories; see the :ref:`warning-categories` documentation for more details." +msgid "" +"The following exceptions are used as warning categories; see " +"the :ref:`warning-categories` documentation for more details." msgstr "" +"استثناهای زیر به‌عنوان دسته‌های هشدار استفاده می‌شوند؛ برای جزئیات بیشتر، " +"مستندات :ref:`warning-categories` را ببینید." msgid "Base class for warning categories." -msgstr "" +msgstr "کلاس پایه برای دسته‌های هشدار." msgid "Base class for warnings generated by user code." -msgstr "" +msgstr "کلاس پایه برای هشدارهای تولیدشده توسط کد کاربر." -msgid "Base class for warnings about deprecated features when those warnings are intended for other Python developers." +msgid "" +"Base class for warnings about deprecated features when those warnings are " +"intended for other Python developers." msgstr "" +"کلاس پایه برای هشدارهای مربوط به ویژگی‌های منسوخ، وقتی آن هشدارها برای سایر " +"توسعه‌دهندگان پایتون در نظر گرفته شده‌اند." -msgid "Ignored by the default warning filters, except in the ``__main__`` module (:pep:`565`). Enabling the :ref:`Python Development Mode ` shows this warning." +msgid "" +"Ignored by the default warning filters, except in the ``__main__`` module " +"(:pep:`565`). Enabling the :ref:`Python Development Mode ` shows " +"this warning." msgstr "" +"توسط فیلترهای هشدار پیش‌فرض نادیده گرفته می‌شود، مگر در ماژول ``__main__`` " +"(:pep:`565`). فعال‌سازی :ref:`حالت توسعه پایتون ` این هشدار را " +"نمایش می‌دهد." msgid "The deprecation policy is described in :pep:`387`." -msgstr "" +msgstr "سیاست منسوخ‌سازی در :pep:`387` توضیح داده شده است." -msgid "Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment." +msgid "" +"Base class for warnings about features which are obsolete and expected to " +"be deprecated in the future, but are not deprecated at the moment." msgstr "" +"کلاس پایه برای هشدارهای مربوط به قابلیت‌هایی که قدیمی شده‌اند و انتظار می‌رود " +"در آینده منسوخ شوند، اما در حال حاضر منسوخ نیستند." -msgid "This class is rarely used as emitting a warning about a possible upcoming deprecation is unusual, and :exc:`DeprecationWarning` is preferred for already active deprecations." +msgid "" +"This class is rarely used as emitting a warning about a possible upcoming " +"deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " +"already active deprecations." msgstr "" +"این کلاس به‌ندرت استفاده می‌شود، زیرا صدور هشدار درباره‌ی یک منسوخ‌سازی احتمالی " +"در آینده غیرمعمول است و برای موارد منسوخ‌شده‌ی از قبل " +"فعال، :exc:`DeprecationWarning` ترجیح داده می‌شود." -msgid "Ignored by the default warning filters. Enabling the :ref:`Python Development Mode ` shows this warning." +msgid "" +"Ignored by the default warning filters. Enabling the :ref:`Python " +"Development Mode ` shows this warning." msgstr "" +"توسط فیلترهای هشدار پیش‌فرض نادیده گرفته می‌شود. فعال‌سازی :ref:`حالت توسعه " +"پایتون ` این هشدار را نمایش می‌دهد." msgid "Base class for warnings about dubious syntax." -msgstr "" +msgstr "کلاس پایه برای هشدارهای مربوط به نحو مشکوک." -msgid "This warning is typically emitted when compiling Python source code, and usually won't be reported when running already compiled code." +msgid "" +"This warning is typically emitted when compiling Python source code, and " +"usually won't be reported when running already compiled code." msgstr "" +"این هشدار معمولاً هنگام کامپایل کد منبع پایتون صادر می‌شود و معمولاً هنگام " +"اجرای کد از پیش کامپایل‌شده گزارش نمی‌شود." msgid "Base class for warnings about dubious runtime behavior." -msgstr "" +msgstr "کلاس پایه برای هشدارهای مربوط به رفتار مشکوک در ران‌تایم." -msgid "Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python." +msgid "" +"Base class for warnings about deprecated features when those warnings are " +"intended for end users of applications that are written in Python." msgstr "" +"کلاس پایه برای هشدارهای مربوط به قابلیت‌های منسوخ، زمانی که آن هشدارها برای " +"کاربران نهایی برنامه‌هایی که به زبان پایتون نوشته شده‌اند در نظر گرفته شده‌اند." msgid "Base class for warnings about probable mistakes in module imports." -msgstr "" +msgstr "کلاس پایه برای هشدارها در مورد اشتباهات احتمالی در ایمپورت ماژول‌ها." msgid "Base class for warnings related to Unicode." -msgstr "" +msgstr "کلاس پایه برای هشدارهای مرتبط با یونیکد." msgid "Base class for warnings related to encodings." -msgstr "" +msgstr "کلاس پایه برای هشدارهای مرتبط با کدگذاری‌ها." msgid "See :ref:`io-encoding-warning` for details." -msgstr "" +msgstr "برای جزئیات، :ref:`io-encoding-warning` را ببینید." -msgid "Base class for warnings related to :class:`bytes` and :class:`bytearray`." -msgstr "" +msgid "" +"Base class for warnings related to :class:`bytes` and :class:`bytearray`." +msgstr "کلاس پایه برای هشدارهای مرتبط با :class:`bytes` و :class:`bytearray`." msgid "Base class for warnings related to resource usage." -msgstr "" +msgstr "کلاس پایه برای هشدارهای مربوط به مصرف منابع." msgid "Exception groups" -msgstr "" +msgstr "گروه‌های استثنا" -msgid "The following are used when it is necessary to raise multiple unrelated exceptions. They are part of the exception hierarchy so they can be handled with :keyword:`except` like all other exceptions. In addition, they are recognised by :keyword:`except*`, which matches their subgroups based on the types of the contained exceptions." -msgstr "" +msgid "" +"The following are used when it is necessary to raise multiple unrelated " +"exceptions. They are part of the exception hierarchy so they can be handled " +"with :keyword:`except` like all other exceptions. In addition, they are " +"recognised by :keyword:`except*`, which matches their " +"subgroups based on the types of the contained exceptions." +msgstr "" +"موارد زیر زمانی استفاده می‌شوند که لازم باشد چندین استثنای غیرمرتبط پرتاب " +"شوند. این موارد بخشی از سلسله‌مراتب استثناها هستند، بنابراین می‌توان آن‌ها را " +"مانند تمام استثناهای دیگر با :keyword:`except` مدیریت کرد. علاوه بر " +"این، :keyword:`except*` آن‌ها را شناسایی می‌کند و زیرگروه‌های " +"آن‌ها را بر اساس انواع استثناهای موجود در آن‌ها تطبیق می‌دهد." -msgid "Both of these exception types wrap the exceptions in the sequence ``excs``. The ``msg`` parameter must be a string. The difference between the two classes is that :exc:`BaseExceptionGroup` extends :exc:`BaseException` and it can wrap any exception, while :exc:`ExceptionGroup` extends :exc:`Exception` and it can only wrap subclasses of :exc:`Exception`. This design is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :exc:`BaseExceptionGroup`." -msgstr "" +msgid "" +"Both of these exception types wrap the exceptions in the sequence ``excs``. " +"The ``msg`` parameter must be a string. The difference between the two " +"classes is that :exc:`BaseExceptionGroup` extends :exc:`BaseException` and " +"it can wrap any exception, while :exc:`ExceptionGroup` " +"extends :exc:`Exception` and it can only wrap subclasses " +"of :exc:`Exception`. This design is so that ``except Exception`` catches " +"an :exc:`ExceptionGroup` but not :exc:`BaseExceptionGroup`." +msgstr "" +"هر دوی این انواع استثنا، استثناهای موجود در دنباله ``excs`` را دربر " +"می‌گیرند. پارامتر ``msg`` باید یک رشته باشد. تفاوت این دو کلاس در این است " +"که :exc:`BaseExceptionGroup` از :exc:`BaseException` ارث می‌برد و می‌تواند هر " +"استثنایی را دربر بگیرد، در حالی که :exc:`ExceptionGroup` " +"از :exc:`Exception` ارث می‌برد و فقط می‌تواند زیرکلاس‌های :exc:`Exception` را " +"دربر بگیرد. این طراحی به این منظور است که ``except " +"Exception`` :exc:`ExceptionGroup` را بگیرد، اما :exc:`BaseExceptionGroup` " +"را نگیرد." -msgid "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:`Exception` instances, so it can be used to make the selection automatic. The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:`TypeError` if any contained exception is not an :exc:`Exception` subclass." -msgstr "" +msgid "" +"The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " +"rather than a :exc:`BaseExceptionGroup` if all contained exceptions " +"are :exc:`Exception` instances, so it can be used to make the selection " +"automatic. The :exc:`ExceptionGroup` constructor, on the other hand, raises " +"a :exc:`TypeError` if any contained exception is not an :exc:`Exception` " +"subclass." +msgstr "" +"سازنده‌ی :exc:`BaseExceptionGroup` اگر همه‌ی استثناهای درون آن نمونه‌هایی " +"از :exc:`Exception` باشند، یک :exc:`ExceptionGroup` را به‌جای " +"یک :exc:`BaseExceptionGroup` برمی‌گرداند، بنابراین می‌توان از آن برای خودکار " +"کردن انتخاب استفاده کرد. از سوی دیگر، سازنده‌ی :exc:`ExceptionGroup` اگر یکی " +"از استثناهای درون آن زیرکلاسی از :exc:`Exception` نباشد، " +"یک :exc:`TypeError` را پرتاب می‌کند." -msgid "Exception groups are :ref:`generic ` over the type of their contained exceptions." +msgid "" +"Exception groups are :ref:`generic ` over the type of their " +"contained exceptions." msgstr "" +"گروه‌های استثنا نسبت به نوع استثناهای درون خود :ref:`عام ` هستند." -msgid "The ``excs`` parameter may be any sequence, but lists and tuples are specifically processed more efficiently here. For optimal performance, pass a tuple as ``excs``." +msgid "" +"The ``excs`` parameter may be any sequence, but lists and tuples are " +"specifically processed more efficiently here. For optimal performance, pass " +"a tuple as ``excs``." msgstr "" +"پارامتر ``excs`` می‌تواند هر دنباله‌ای باشد، اما فهرست‌ها و تاپل‌ها به‌طور خاص " +"در اینجا با کارایی بیشتری پردازش می‌شوند. برای عملکرد بهینه، یک تاپل را " +"به‌عنوان ``excs`` ارسال کنید." -msgid "The ``msg`` argument to the constructor. This is a read-only attribute." -msgstr "" +msgid "" +"The ``msg`` argument to the constructor. This is a read-only attribute." +msgstr "آرگومان ``msg`` برای سازنده. این یک ویژگی فقط‌خواندنی است." -msgid "A tuple of the exceptions in the ``excs`` sequence given to the constructor. This is a read-only attribute." +msgid "" +"A tuple of the exceptions in the ``excs`` sequence given to the " +"constructor. This is a read-only attribute." msgstr "" +"تاپلی از استثناهای موجود در دنباله‌ی ``excs`` که به سازنده داده‌شده است. این " +"ویژگی فقط‌خواندنی است." -msgid "Returns an exception group that contains only the exceptions from the current group that match *condition*, or ``None`` if the result is empty." +msgid "" +"Returns an exception group that contains only the exceptions from the " +"current group that match *condition*, or ``None`` if the result is empty." msgstr "" +"یک گروه استثنا برمی‌گرداند که فقط شامل استثناهایی از گروه فعلی است که با " +"*condition* مطابقت دارند، یا اگر نتیجه خالی باشد ``None`` برمی‌گرداند." -msgid "The condition can be an exception type or tuple of exception types, in which case each exception is checked for a match using the same check that is used in an ``except`` clause. The condition can also be a callable (other than a type object) that accepts an exception as its single argument and returns true for the exceptions that should be in the subgroup." -msgstr "" +msgid "" +"The condition can be an exception type or tuple of exception types, in " +"which case each exception is checked for a match using the same check that " +"is used in an ``except`` clause. The condition can also be a callable " +"(other than a type object) that accepts an exception as its single argument " +"and returns true for the exceptions that should be in the subgroup." +msgstr "" +"شرط می‌تواند یک نوع استثنا یا تاپلی از انواع استثنا باشد، که در این صورت هر " +"استثنا با استفاده از همان بررسی‌ای که در بند ``except`` استفاده می‌شود، برای " +"تطابق بررسی می‌شود. شرط همچنین می‌تواند یک شیء فراخوان‌پذیر (به‌جز یک شیء نوع) " +"باشد که یک استثنا را به‌عنوان تنها آرگومان خود می‌پذیرد و برای استثناهایی که " +"باید در زیرگروه باشند، مقدار true برمی‌گرداند." -msgid "The nesting structure of the current exception is preserved in the result, as are the values of its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` and :attr:`~BaseException.__notes__` fields. Empty nested groups are omitted from the result." +msgid "" +"The nesting structure of the current exception is preserved in the result, " +"as are the values of " +"its :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"and :attr:`~BaseException.__notes__` fields. Empty nested groups are " +"omitted from the result." msgstr "" +"ساختار تودرتوی استثنای جاری در نتیجه حفظ می‌شود؛ مقادیر " +"فیلدهای :attr:`message`، :attr:`~BaseException.__traceback__`، :attr:`~BaseException.__cause__`، :attr:`~BaseException.__context__` " +"و :attr:`~BaseException.__notes__` آن نیز حفظ می‌شوند. گروه‌های تودرتوی خالی " +"از نتیجه حذف می‌شوند." -msgid "The condition is checked for all exceptions in the nested exception group, including the top-level and any nested exception groups. If the condition is true for such an exception group, it is included in the result in full." +msgid "" +"The condition is checked for all exceptions in the nested exception group, " +"including the top-level and any nested exception groups. If the condition " +"is true for such an exception group, it is included in the result in full." msgstr "" +"شرط برای تمام استثناهای درون گروه استثنای تودرتو بررسی می‌شود، از جمله گروه " +"استثنای سطح بالا و هر گروه استثنای تودرتویی. اگر شرط برای چنین گروه " +"استثنایی برقرار باشد، آن گروه به‌طور کامل در نتیجه گنجانده می‌شود." msgid "``condition`` can be any callable which is not a type object." -msgstr "" +msgstr "``condition`` می‌تواند هر شیء قابل فراخوانی باشد که یک شیء نوع نباشد." -msgid "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where ``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-matching part." +msgid "" +"Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " +"``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" +"matching part." msgstr "" +"مانند :meth:`subgroup`، اما جفت ``(match, rest)`` را برمی‌گرداند که در آن " +"``match`` برابر با ``subgroup(condition)`` است و ``rest`` بخش باقی‌مانده‌ی " +"غیرمنطبق است." -msgid "Returns an exception group with the same :attr:`message`, but which wraps the exceptions in ``excs``." +msgid "" +"Returns an exception group with the same :attr:`message`, but which wraps " +"the exceptions in ``excs``." msgstr "" +"یک گروه استثنا با همان :attr:`message` برمی‌گرداند، اما استثناهای درون " +"``excs`` را در بر می‌گیرد." -msgid "This method is used by :meth:`subgroup` and :meth:`split`, which are used in various contexts to break up an exception group. A subclass needs to override it in order to make :meth:`subgroup` and :meth:`split` return instances of the subclass rather than :exc:`ExceptionGroup`." +msgid "" +"This method is used by :meth:`subgroup` and :meth:`split`, which are used " +"in various contexts to break up an exception group. A subclass needs to " +"override it in order to make :meth:`subgroup` and :meth:`split` return " +"instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" +"این متد توسط :meth:`subgroup` و :meth:`split` استفاده می‌شود، که در زمینه‌های " +"مختلف برای تجزیه یک گروه استثنا به کار می‌روند. یک زیرکلاس باید آن را " +"بازنویسی کند تا :meth:`subgroup` و :meth:`split` " +"به‌جای :exc:`ExceptionGroup` نمونه‌هایی از زیرکلاس را برگردانند." -msgid ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` and :attr:`~BaseException.__notes__` fields from the original exception group to the one returned by :meth:`derive`, so these fields do not need to be updated by :meth:`derive`." -msgstr "" +msgid "" +":meth:`subgroup` and :meth:`split` copy " +"the :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"and :attr:`~BaseException.__notes__` fields from the original exception " +"group to the one returned by :meth:`derive`, so these fields do not need to " +"be updated by :meth:`derive`." +msgstr "" +":meth:`subgroup` و :meth:`split` " +"ویژگی‌های :attr:`~BaseException.__traceback__`، :attr:`~BaseException.__cause__`، :attr:`~BaseException.__context__` " +"و :attr:`~BaseException.__notes__` را از گروه استثنای اصلی به گروهی " +"که :meth:`derive` آن را برمی‌گرداند کپی می‌کنند، بنابراین نیازی نیست این " +"ویژگی‌ها توسط :meth:`derive` به‌روزرسانی شوند." msgid "" ">>> class MyGroup(ExceptionGroup):\n" @@ -598,17 +1478,55 @@ msgid "" "...\n" ">>> match, rest = exc.split(ValueError)\n" ">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" -"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), Exception('cause'), ['a note'])\n" +"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " +"Exception('cause'), ['a note'])\n" ">>> match, match.__context__, match.__cause__, match.__notes__\n" -"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), ['a note'])\n" +"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " +"['a note'])\n" ">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" -"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), ['a note'])\n" +"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " +"['a note'])\n" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" msgstr "" +">>> class MyGroup(ExceptionGroup):\n" +"... def derive(self, excs):\n" +"... return MyGroup(self.message, excs)\n" +"...\n" +">>> e = MyGroup(\"eg\", [ValueError(1), TypeError(2)])\n" +">>> e.add_note(\"a note\")\n" +">>> e.__context__ = Exception(\"context\")\n" +">>> e.__cause__ = Exception(\"cause\")\n" +">>> try:\n" +"... raise e\n" +"... except Exception as e:\n" +"... exc = e\n" +"...\n" +">>> match, rest = exc.split(ValueError)\n" +">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" +"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " +"Exception('cause'), ['a note'])\n" +">>> match, match.__context__, match.__cause__, match.__notes__\n" +"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" +"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" +"True" -msgid "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so subclasses that need a different constructor signature need to override that rather than :meth:`~object.__init__`. For example, the following defines an exception group subclass which accepts an exit_code and constructs the group's message from it. ::" -msgstr "" +msgid "" +"Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " +"subclasses that need a different constructor signature need to override " +"that rather than :meth:`~object.__init__`. For example, the following " +"defines an exception group subclass which accepts an exit_code and " +"constructs the group's message from it. ::" +msgstr "" +"توجه داشته باشید که :exc:`BaseExceptionGroup`، :meth:`~object.__new__` را " +"تعریف می‌کند، بنابراین زیرکلاس‌هایی که به امضای سازنده‌ای متفاوت نیاز دارند، " +"باید به‌جای :meth:`~object.__init__`، آن را بازنویسی کنند. برای مثال، کد زیر " +"یک زیرکلاس از گروه استثنا تعریف می‌کند که یک exit_code می‌پذیرد و پیام گروه " +"را از روی آن می‌سازد. ::" msgid "" "class Errors(ExceptionGroup):\n" @@ -620,48 +1538,201 @@ msgid "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" msgstr "" +"class Errors(ExceptionGroup):\n" +" def __new__(cls, errors, exit_code):\n" +" self = super().__new__(Errors, f\"exit code: {exit_code}\", errors)\n" +" self.exit_code = exit_code\n" +" return self\n" +"\n" +" def derive(self, excs):\n" +" return Errors(excs, self.exit_code)" -msgid "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which is also a subclass of :exc:`Exception` can only wrap instances of :exc:`Exception`." +msgid "" +"Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " +"is also a subclass of :exc:`Exception` can only wrap instances " +"of :exc:`Exception`." msgstr "" +"مانند :exc:`ExceptionGroup`، هر زیرکلاسی از :exc:`BaseExceptionGroup` که " +"همچنین زیرکلاسی از :exc:`Exception` باشد، فقط می‌تواند نمونه‌هایی " +"از :exc:`Exception` را در بر بگیرد." msgid "Exception hierarchy" -msgstr "" +msgstr "سلسله‌مراتب استثنا" msgid "The class hierarchy for built-in exceptions is:" -msgstr "" +msgstr "سلسله‌مراتب کلاس برای استثناهای توکار به صورت زیر است:" + +msgid "" +"BaseException\n" +" ├── BaseExceptionGroup\n" +" ├── GeneratorExit\n" +" ├── KeyboardInterrupt\n" +" ├── SystemExit\n" +" └── Exception\n" +" ├── ArithmeticError\n" +" │ ├── FloatingPointError\n" +" │ ├── OverflowError\n" +" │ └── ZeroDivisionError\n" +" ├── AssertionError\n" +" ├── AttributeError\n" +" ├── BufferError\n" +" ├── EOFError\n" +" ├── ExceptionGroup [BaseExceptionGroup]\n" +" ├── ImportError\n" +" │ └── ModuleNotFoundError\n" +" ├── LookupError\n" +" │ ├── IndexError\n" +" │ └── KeyError\n" +" ├── MemoryError\n" +" ├── NameError\n" +" │ └── UnboundLocalError\n" +" ├── OSError\n" +" │ ├── BlockingIOError\n" +" │ ├── ChildProcessError\n" +" │ ├── ConnectionError\n" +" │ │ ├── BrokenPipeError\n" +" │ │ ├── ConnectionAbortedError\n" +" │ │ ├── ConnectionRefusedError\n" +" │ │ └── ConnectionResetError\n" +" │ ├── FileExistsError\n" +" │ ├── FileNotFoundError\n" +" │ ├── InterruptedError\n" +" │ ├── IsADirectoryError\n" +" │ ├── NotADirectoryError\n" +" │ ├── PermissionError\n" +" │ ├── ProcessLookupError\n" +" │ └── TimeoutError\n" +" ├── ReferenceError\n" +" ├── RuntimeError\n" +" │ ├── NotImplementedError\n" +" │ ├── PythonFinalizationError\n" +" │ └── RecursionError\n" +" ├── StopAsyncIteration\n" +" ├── StopIteration\n" +" ├── SyntaxError\n" +" │ └── IndentationError\n" +" │ └── TabError\n" +" ├── SystemError\n" +" ├── TypeError\n" +" ├── ValueError\n" +" │ └── UnicodeError\n" +" │ ├── UnicodeDecodeError\n" +" │ ├── UnicodeEncodeError\n" +" │ └── UnicodeTranslateError\n" +" └── Warning\n" +" ├── BytesWarning\n" +" ├── DeprecationWarning\n" +" ├── EncodingWarning\n" +" ├── FutureWarning\n" +" ├── ImportWarning\n" +" ├── PendingDeprecationWarning\n" +" ├── ResourceWarning\n" +" ├── RuntimeWarning\n" +" ├── SyntaxWarning\n" +" ├── UnicodeWarning\n" +" └── UserWarning\n" +msgstr "" +"BaseException\n" +" ├── BaseExceptionGroup\n" +" ├── GeneratorExit\n" +" ├── KeyboardInterrupt\n" +" ├── SystemExit\n" +" └── Exception\n" +" ├── ArithmeticError\n" +" │ ├── FloatingPointError\n" +" │ ├── OverflowError\n" +" │ └── ZeroDivisionError\n" +" ├── AssertionError\n" +" ├── AttributeError\n" +" ├── BufferError\n" +" ├── EOFError\n" +" ├── ExceptionGroup [BaseExceptionGroup]\n" +" ├── ImportError\n" +" │ └── ModuleNotFoundError\n" +" ├── LookupError\n" +" │ ├── IndexError\n" +" │ └── KeyError\n" +" ├── MemoryError\n" +" ├── NameError\n" +" │ └── UnboundLocalError\n" +" ├── OSError\n" +" │ ├── BlockingIOError\n" +" │ ├── ChildProcessError\n" +" │ ├── ConnectionError\n" +" │ │ ├── BrokenPipeError\n" +" │ │ ├── ConnectionAbortedError\n" +" │ │ ├── ConnectionRefusedError\n" +" │ │ └── ConnectionResetError\n" +" │ ├── FileExistsError\n" +" │ ├── FileNotFoundError\n" +" │ ├── InterruptedError\n" +" │ ├── IsADirectoryError\n" +" │ ├── NotADirectoryError\n" +" │ ├── PermissionError\n" +" │ ├── ProcessLookupError\n" +" │ └── TimeoutError\n" +" ├── ReferenceError\n" +" ├── RuntimeError\n" +" │ ├── NotImplementedError\n" +" │ ├── PythonFinalizationError\n" +" │ └── RecursionError\n" +" ├── StopAsyncIteration\n" +" ├── StopIteration\n" +" ├── SyntaxError\n" +" │ └── IndentationError\n" +" │ └── TabError\n" +" ├── SystemError\n" +" ├── TypeError\n" +" ├── ValueError\n" +" │ └── UnicodeError\n" +" │ ├── UnicodeDecodeError\n" +" │ ├── UnicodeEncodeError\n" +" │ └── UnicodeTranslateError\n" +" └── Warning\n" +" ├── BytesWarning\n" +" ├── DeprecationWarning\n" +" ├── EncodingWarning\n" +" ├── FutureWarning\n" +" ├── ImportWarning\n" +" ├── PendingDeprecationWarning\n" +" ├── ResourceWarning\n" +" ├── RuntimeWarning\n" +" ├── SyntaxWarning\n" +" ├── UnicodeWarning\n" +" └── UserWarning\n" msgid "statement" -msgstr "" +msgstr "دستور" msgid "try" -msgstr "" +msgstr "try" msgid "except" -msgstr "" +msgstr "except" msgid "raise" -msgstr "" +msgstr "پرتاب" msgid "exception" -msgstr "" +msgstr "استثنا" msgid "chaining" -msgstr "" +msgstr "زنجیره‌سازی" msgid "__cause__ (exception attribute)" -msgstr "" +msgstr "__cause__ (ویژگی استثنا)" msgid "__context__ (exception attribute)" -msgstr "" +msgstr "__context__ (صفت استثنا)" msgid "__suppress_context__ (exception attribute)" -msgstr "" +msgstr "__suppress_context__ (ویژگی استثنا)" msgid "assert" -msgstr "" +msgstr "assert" msgid "module" -msgstr "" +msgstr "ماژول" msgid "errno" -msgstr "" +msgstr "errno" diff --git a/library/faulthandler.po b/library/faulthandler.po index 1b3fcf196..c2620a970 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -25,160 +25,338 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!faulthandler` --- Dump the Python traceback" -msgstr "" +msgstr ":mod:`!faulthandler` --- برون‌ریزی ردگیری پشته پایتون" -msgid "This module contains functions to dump Python tracebacks explicitly, on a fault, after a timeout, or on a user signal. Call :func:`faulthandler.enable` to install fault handlers for the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and :const:`~signal.SIGILL` signals. You can also enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment variable or by using the :option:`-X` ``faulthandler`` command line option." -msgstr "" +msgid "" +"This module contains functions to dump Python tracebacks explicitly, on a " +"fault, after a timeout, or on a user signal. Call " +":func:`faulthandler.enable` to install fault handlers for the " +":const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`," +" :const:`~signal.SIGBUS`, and :const:`~signal.SIGILL` signals. You can also " +"enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` " +"environment variable or by using the :option:`-X` ``faulthandler`` command " +"line option." +msgstr "" +"این ماژول شامل توابعی برای خروجی‌گیری از ردگیری‌های پشته‌ی پایتون به‌صورت " +"صریح، در صورت بروز خطا، پس از پایان مهلت، یا هنگام دریافت سیگنال کاربر است. " +":func:`faulthandler.enable` را فراخوانی کنید تا هندلرهای خطا برای " +"سیگنال‌های :const:`~signal.SIGSEGV`، :const:`~signal.SIGFPE`، " +":const:`~signal.SIGABRT`، :const:`~signal.SIGBUS` و :const:`~signal.SIGILL` " +"نصب شوند. همچنین می‌توانید آن‌ها را در زمان راه‌اندازی با تنظیم متغیر محیطی " +":envvar:`PYTHONFAULTHANDLER` یا با استفاده از گزینه‌ی خط فرمان :option:`-X` " +"``faulthandler`` فعال کنید." -msgid "The fault handler is compatible with system fault handlers like Apport or the Windows fault handler. The module uses an alternative stack for signal handlers if the :c:func:`!sigaltstack` function is available. This allows it to dump the traceback even on a stack overflow." +msgid "" +"The fault handler is compatible with system fault handlers like Apport or " +"the Windows fault handler. The module uses an alternative stack for signal " +"handlers if the :c:func:`!sigaltstack` function is available. This allows it" +" to dump the traceback even on a stack overflow." msgstr "" +"مدیر خطا با هندلرهای خطای سیستمی مانند Apport یا مدیر خطای ویندوز سازگار است." +" در صورتی که تابع :c:func:`!sigaltstack` در دسترس باشد، این ماژول برای " +"هندلرهای سیگنال از یک پشته جایگزین استفاده می‌کند. این امر به آن امکان می‌دهد" +" که ردگیری پشته را حتی در صورت سرریز پشته نیز برون‌ریزی کند." -msgid "The fault handler is called on catastrophic cases and therefore can only use signal-safe functions (e.g. it cannot allocate memory on the heap). Because of this limitation traceback dumping is minimal compared to normal Python tracebacks:" +msgid "" +"The fault handler is called on catastrophic cases and therefore can only use" +" signal-safe functions (e.g. it cannot allocate memory on the heap). Because" +" of this limitation traceback dumping is minimal compared to normal Python " +"tracebacks:" msgstr "" +"مدیر خطا (fault handler) در موارد فاجعه‌بار فراخوانی می‌شود و بنابراین تنها " +"می‌تواند از توابع ایمن در برابر سیگنال (signal-safe) استفاده کند (برای مثال،" +" نمی‌تواند حافظه‌ای را در هیپ تخصیص دهد). به دلیل این محدودیت، خروجی ردگیری" +" پشته در مقایسه با ردگیری‌های پشته‌ی معمول پایتون حداقلی است:" -msgid "Only ASCII is supported. The ``backslashreplace`` error handler is used on encoding." +msgid "" +"Only ASCII is supported. The ``backslashreplace`` error handler is used on " +"encoding." msgstr "" +"فقط ASCII پشتیبانی می‌شود. هنگام کدگذاری از مدیر خطای ``backslashreplace`` " +"استفاده می‌شود." msgid "Each string is limited to 500 characters." -msgstr "" +msgstr "هر رشته به ۵۰۰ نویسه محدود است." -msgid "Only the filename, the function name and the line number are displayed. (no source code)" +msgid "" +"Only the filename, the function name and the line number are displayed. (no " +"source code)" msgstr "" +"فقط نام فایل، نام تابع و شماره‌ی خط نمایش داده می‌شوند. (بدون کد منبع)" msgid "It is limited to 100 frames and 100 threads." -msgstr "" +msgstr "آن به ۱۰۰ فریم و ۱۰۰ نخ محدود شده است." msgid "The order is reversed: the most recent call is shown first." -msgstr "" +msgstr "ترتیب معکوس است: جدیدترین فراخوانی ابتدا نمایش داده می‌شود." -msgid "By default, the Python traceback is written to :data:`sys.stderr`. To see tracebacks, applications must be run in the terminal. A log file can alternatively be passed to :func:`faulthandler.enable`." +msgid "" +"By default, the Python traceback is written to :data:`sys.stderr`. To see " +"tracebacks, applications must be run in the terminal. A log file can " +"alternatively be passed to :func:`faulthandler.enable`." msgstr "" +"به‌طور پیش‌فرض، ردگیری پشته پایتون در :data:`sys.stderr` نوشته می‌شود. برای " +"مشاهده ردگیری‌های پشته، برنامه‌ها باید در پایانه اجرا شوند. به‌عنوان " +"جایگزین، می‌توان یک فایل گزارش را به :func:`faulthandler.enable` پاس داد." -msgid "The module is implemented in C, so tracebacks can be dumped on a crash or when Python is deadlocked." +msgid "" +"The module is implemented in C, so tracebacks can be dumped on a crash or " +"when Python is deadlocked." msgstr "" +"این ماژول به زبان C پیاده‌سازی شده است، بنابراین در صورت بروز فروپاشی (crash) یا" +" هنگامی که پایتون در بن‌بست (deadlock) باشد، می‌توان ردگیری‌های پشته را برون‌ریزی" +" (dump) کرد." -msgid "The :ref:`Python Development Mode ` calls :func:`faulthandler.enable` at Python startup." +msgid "" +"The :ref:`Python Development Mode ` calls " +":func:`faulthandler.enable` at Python startup." msgstr "" +":ref:`حالت توسعه پایتون ` در زمان راه‌اندازی پایتون، " +":func:`faulthandler.enable` را فراخوانی می‌کند." msgid "Module :mod:`pdb`" -msgstr "" +msgstr "ماژول :mod:`pdb`" msgid "Interactive source code debugger for Python programs." -msgstr "" +msgstr "اشکال‌زدای تعاملی کد منبع برای برنامه‌های پایتون." msgid "Module :mod:`traceback`" -msgstr "" +msgstr "ماژول :mod:`traceback`" -msgid "Standard interface to extract, format and print stack traces of Python programs." +msgid "" +"Standard interface to extract, format and print stack traces of Python " +"programs." msgstr "" +"رابط استاندارد برای استخراج، قالب‌بندی و چاپ ردگیری‌های پشته در برنامه‌های " +"پایتون." msgid "Dumping the traceback" -msgstr "" +msgstr "تخلیه‌ی ردگیری پشته" -msgid "Dump the tracebacks of all threads into *file*. If *all_threads* is ``False``, dump only the current thread." +msgid "" +"Dump the tracebacks of all threads into *file*. If *all_threads* is " +"``False``, dump only the current thread." msgstr "" +"ردگیری‌های پشته‌ی همه‌ی نخ‌ها را در *file* بنویسید. اگر *all_threads* " +"``False`` باشد، فقط ردگیری پشته‌ی نخ جاری را بنویسید." -msgid ":func:`traceback.print_tb`, which can be used to print a traceback object." +msgid "" +":func:`traceback.print_tb`, which can be used to print a traceback object." msgstr "" +":func:`traceback.print_tb`، که می‌تواند برای چاپ یک شیء ردگیری پشته استفاده " +"شود." msgid "Added support for passing file descriptor to this function." msgstr "" +"پشتیبانی از ارسال توصیف‌گر فایل (file descriptor) به این تابع افزوده شد." msgid "Dumping the C stack" -msgstr "" +msgstr "تخلیه‌ی پشته‌ی C" msgid "Dump the C stack trace of the current thread into *file*." -msgstr "" +msgstr "خروجی ردگیری پشته‌ی C نخ جاری را در *file* بگیرید." -msgid "If the Python build does not support it or the operating system does not provide a stack trace, then this prints an error in place of a dumped C stack." +msgid "" +"If the Python build does not support it or the operating system does not " +"provide a stack trace, then this prints an error in place of a dumped C " +"stack." msgstr "" +"اگر ساخت پایتون از آن پشتیبانی نکند یا سیستم‌عامل ردگیری پشته را فراهم نکند،" +" این مورد به‌جای پشته‌ی C تخلیه‌شده، خطایی را چاپ می‌کند." msgid "C Stack Compatibility" -msgstr "" +msgstr "سازگاری پشته‌ی C" -msgid "If the system does not support the C-level :manpage:`backtrace(3)` or :manpage:`dladdr1(3)`, then C stack dumps will not work. An error will be printed instead of the stack." +msgid "" +"If the system does not support the C-level :manpage:`backtrace(3)` or " +":manpage:`dladdr1(3)`, then C stack dumps will not work. An error will be " +"printed instead of the stack." msgstr "" +"اگر سیستم از :manpage:`backtrace(3)` یا :manpage:`dladdr1(3)` در سطح C " +"پشتیبانی نکند، تخلیه‌ی پشته‌ی C کار نخواهد کرد. به‌جای پشته، خطایی چاپ خواهد " +"شد." -msgid "Additionally, some compilers do not support :term:`CPython's ` implementation of C stack dumps. As a result, a different error may be printed instead of the stack, even if the operating system supports dumping stacks." +msgid "" +"Additionally, some compilers do not support :term:`CPython's ` " +"implementation of C stack dumps. As a result, a different error may be " +"printed instead of the stack, even if the operating system supports dumping " +"stacks." msgstr "" +"علاوه بر این، برخی کامپایلرها از پیاده‌سازی :term:`CPython ` برای " +"تخلیه پشته‌های C (stack dumps) پشتیبانی نمی‌کنند. در نتیجه، حتی اگر " +"سیستم‌عامل از تخلیه پشته‌ها پشتیبانی کند، ممکن است به‌جای پشته، خطای متفاوتی" +" چاپ شود." -msgid "Dumping C stacks can be arbitrarily slow, depending on the DWARF level of the binaries in the call stack." +msgid "" +"Dumping C stacks can be arbitrarily slow, depending on the DWARF level of " +"the binaries in the call stack." msgstr "" +"تخلیه‌ی پشته‌های C می‌تواند بسته به سطح DWARF فایل‌های دودویی موجود در پشته‌ی " +"فراخوانی، به‌هر اندازه‌ای کند باشد." msgid "Fault handler state" -msgstr "" +msgstr "وضعیت هندلر خطا (fault handler)" -msgid "Enable the fault handler: install handlers for the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python traceback. If *all_threads* is ``True``, produce tracebacks for every running thread. Otherwise, dump only the current thread." -msgstr "" +msgid "" +"Enable the fault handler: install handlers for the :const:`~signal.SIGSEGV`," +" :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` " +"and :const:`~signal.SIGILL` signals to dump the Python traceback. If " +"*all_threads* is ``True``, produce tracebacks for every running thread. " +"Otherwise, dump only the current thread." +msgstr "" +"فعال‌سازی مدیر خطا (fault handler): نصب هندلرهایی برای سیگنال‌های " +":const:`~signal.SIGSEGV`، :const:`~signal.SIGFPE`، :const:`~signal.SIGABRT`،" +" :const:`~signal.SIGBUS` و :const:`~signal.SIGILL` برای خروجی گرفتن از " +"ردگیری پشته پایتون. اگر *all_threads* برابر ``True`` باشد، برای هر نخ در حال" +" اجرا ردگیری پشته تولید می‌شود. در غیر این صورت، فقط ردگیری پشته نخ جاری " +"خروجی گرفته می‌شود." -msgid "The *file* must be kept open until the fault handler is disabled: see :ref:`issue with file descriptors `." +msgid "" +"The *file* must be kept open until the fault handler is disabled: see " +":ref:`issue with file descriptors `." msgstr "" +"*فایل* باید تا پیش از غیرفعال‌شدن مدیر خطا (fault handler) باز بماند: " +":ref:`مشکل توصیف‌گرهای فایل ` را ببینید." -msgid "If *c_stack* is ``True``, then the C stack trace is printed after the Python traceback, unless the system does not support it. See :func:`dump_c_stack` for more information on compatibility." +msgid "" +"If *c_stack* is ``True``, then the C stack trace is printed after the Python" +" traceback, unless the system does not support it. See :func:`dump_c_stack` " +"for more information on compatibility." msgstr "" +"اگر *c_stack* برابر ``True`` باشد، ردگیری پشته C پس از ردگیری پشته پایتون " +"چاپ می‌شود، مگر آنکه سیستم از آن پشتیبانی نکند. برای اطلاعات بیشتر درباره " +"سازگاری، :func:`dump_c_stack` را ببینید." msgid "On Windows, a handler for Windows exception is also installed." -msgstr "" +msgstr "در ویندوز، یک هندلر برای استثنای ویندوز نیز نصب می‌شود." -msgid "The dump now mentions if a garbage collector collection is running if *all_threads* is true." +msgid "" +"The dump now mentions if a garbage collector collection is running if " +"*all_threads* is true." msgstr "" +"اگر *all_threads* true باشد، اکنون در برون‌ریزی (dump) ذکر می‌شود که آیا یک " +"جمع‌آوری زباله‌روبی در حال اجرا است یا خیر." -msgid "Only the current thread is dumped if the :term:`GIL` is disabled to prevent the risk of data races." +msgid "" +"Only the current thread is dumped if the :term:`GIL` is disabled to prevent " +"the risk of data races." msgstr "" +"در صورت غیرفعال بودن :term:`GIL`، فقط نخ جاری dump می‌شود تا از خطر " +"رقابت‌های داده‌ای جلوگیری شود." msgid "The dump now displays the C stack trace if *c_stack* is true." msgstr "" +"برون‌ریزی (dump) اکنون در صورتی که *c_stack* برابر true باشد، ردگیری پشته‌ی C را " +"نمایش می‌دهد." -msgid "Disable the fault handler: uninstall the signal handlers installed by :func:`enable`." +msgid "" +"Disable the fault handler: uninstall the signal handlers installed by " +":func:`enable`." msgstr "" +"غیرفعال‌سازی مدیر خطا (fault handler): حذف مدیرهای سیگنال نصب‌شده توسط " +":func:`enable`." msgid "Check if the fault handler is enabled." -msgstr "" +msgstr "بررسی کنید که آیا مدیر خطا (fault handler) فعال است یا خیر." msgid "Dumping the tracebacks after a timeout" -msgstr "" +msgstr "برون‌ریزی ردگیری‌های پشته پس از پایان مهلت" -msgid "Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, call :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note :c:func:`!_exit` exits the process immediately, which means it doesn't do any cleanup like flushing file buffers.) If the function is called twice, the new call replaces previous parameters and resets the timeout. The timer has a sub-second resolution." -msgstr "" +msgid "" +"Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or" +" every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, " +"call :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note " +":c:func:`!_exit` exits the process immediately, which means it doesn't do " +"any cleanup like flushing file buffers.) If the function is called twice, " +"the new call replaces previous parameters and resets the timeout. The timer " +"has a sub-second resolution." +msgstr "" +"ردگیری‌های پشته‌ی تمام نخ‌ها را پس از گذشت *timeout* ثانیه، یا هر *timeout* " +"ثانیه در صورتی که *repeat* برابر ``True`` باشد، برون‌ریزی می‌کند. اگر *exit* " +"برابر ``True`` باشد، پس از برون‌ریزی ردگیری‌های پشته، :c:func:`!_exit` را با " +"status=1 فراخوانی می‌کند. (توجه: :c:func:`!_exit` فرآیند را بلافاصله خاتمه " +"می‌دهد، به این معنا که هیچ‌گونه پاک‌سازی مانند تخلیه‌ی بافرهای فایل انجام " +"نمی‌دهد.) اگر این تابع دو بار فراخوانی شود، فراخوانی جدید پارامترهای پیشین " +"را جایگزین می‌کند و مهلت زمانی را بازنشانی می‌کند. زمان‌سنج دقتی کمتر از یک" +" ثانیه دارد." -msgid "The *file* must be kept open until the traceback is dumped or :func:`cancel_dump_traceback_later` is called: see :ref:`issue with file descriptors `." +msgid "" +"The *file* must be kept open until the traceback is dumped or " +":func:`cancel_dump_traceback_later` is called: see :ref:`issue with file " +"descriptors `." msgstr "" +"*file* باید تا زمانی که ردگیری پشته تخلیه شود یا " +":func:`cancel_dump_traceback_later` فراخوانی شود، باز بماند: :ref:`مسئله‌ی " +"توصیف‌گرهای فایل ` را ببینید." msgid "This function is implemented using a watchdog thread." msgstr "" +"این تابع با استفاده از یک نخ دیده‌بان (watchdog thread) پیاده‌سازی شده است." msgid "This function is now always available." -msgstr "" +msgstr "این تابع اکنون همیشه در دسترس است." msgid "Cancel the last call to :func:`dump_traceback_later`." -msgstr "" +msgstr "آخرین فراخوانی :func:`dump_traceback_later` را لغو می‌کند." msgid "Dumping the traceback on a user signal" -msgstr "" +msgstr "تخلیه‌ی ردگیری پشته در سیگنال کاربر" -msgid "Register a user signal: install a handler for the *signum* signal to dump the traceback of all threads, or of the current thread if *all_threads* is ``False``, into *file*. Call the previous handler if chain is ``True``." +msgid "" +"Register a user signal: install a handler for the *signum* signal to dump " +"the traceback of all threads, or of the current thread if *all_threads* is " +"``False``, into *file*. Call the previous handler if chain is ``True``." msgstr "" +"ثبت یک سیگنال کاربر: یک هندلر برای سیگنال *signum* نصب می‌شود تا " +"ردگیری پشته همه نخ‌ها، یا نخ جاری اگر *all_threads* برابر ``False`` باشد، در" +" *file* نوشته شود. اگر chain برابر ``True`` باشد، هندلر پیشین فراخوانی" +" می‌شود." -msgid "The *file* must be kept open until the signal is unregistered by :func:`unregister`: see :ref:`issue with file descriptors `." +msgid "" +"The *file* must be kept open until the signal is unregistered by " +":func:`unregister`: see :ref:`issue with file descriptors `." msgstr "" +"*فایل* باید تا زمانی که سیگنال توسط :func:`unregister` از ثبت خارج شود، باز " +"بماند: به :ref:`مشکل توصیف‌گرهای فایل ` مراجعه کنید." msgid "Not available on Windows." -msgstr "" +msgstr "در ویندوز در دسترس نیست." -msgid "Unregister a user signal: uninstall the handler of the *signum* signal installed by :func:`register`. Return ``True`` if the signal was registered, ``False`` otherwise." +msgid "" +"Unregister a user signal: uninstall the handler of the *signum* signal " +"installed by :func:`register`. Return ``True`` if the signal was registered," +" ``False`` otherwise." msgstr "" +"لغو ثبت یک سیگنال کاربر: حذف هندلر سیگنال *signum* نصب‌شده توسط " +":func:`register`. اگر سیگنال ثبت‌شده باشد، ``True`` و در غیر این صورت " +"``False`` برمی‌گرداند." msgid "Issue with file descriptors" -msgstr "" +msgstr "مشکل مربوط به توصیف‌گرهای فایل" -msgid ":func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the file descriptor of their *file* argument. If the file is closed and its file descriptor is reused by a new file, or if :func:`os.dup2` is used to replace the file descriptor, the traceback will be written into a different file. Call these functions again each time that the file is replaced." -msgstr "" +msgid "" +":func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the " +"file descriptor of their *file* argument. If the file is closed and its file" +" descriptor is reused by a new file, or if :func:`os.dup2` is used to " +"replace the file descriptor, the traceback will be written into a different " +"file. Call these functions again each time that the file is replaced." +msgstr "" +":func:`enable`، :func:`dump_traceback_later` و :func:`register` توصیف‌گر " +"فایلِ آرگومان *file* خود را نگه می‌دارند. اگر فایل بسته شود و توصیف‌گر فایل " +"آن توسط یک فایل جدید دوباره استفاده شود، یا اگر از :func:`os.dup2` برای " +"جایگزینی توصیف‌گر فایل استفاده شود، ردگیری پشته در یک فایل دیگر نوشته خواهد " +"شد. هر بار که فایل جایگزین می‌شود، این توابع را دوباره فراخوانی کنید." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "Example of a segmentation fault on Linux with and without enabling the fault handler:" +msgid "" +"Example of a segmentation fault on Linux with and without enabling the fault" +" handler:" msgstr "" +"نمونه‌ای از خطای قطعه‌بندی (segmentation fault) در لینوکس، با فعال‌سازی مدیر" +" خطا (fault handler) و بدون فعال‌سازی آن:" msgid "" "$ python -c \"import ctypes; ctypes.string_at(0)\"\n" @@ -229,3 +407,50 @@ msgid "" " \n" "Segmentation fault" msgstr "" +"$ python -c \"import ctypes; ctypes.string_at(0)\"\n" +"Segmentation fault\n" +"\n" +"$ python -q -X faulthandler\n" +">>> import ctypes\n" +">>> ctypes.string_at(0)\n" +"Fatal Python error: Segmentation fault\n" +"\n" +"Current thread 0x00007fb899f39700 (most recent call first):\n" +" File \"/opt/python/Lib/ctypes/__init__.py\", line 486 in string_at\n" +" File \"\", line 1 in \n" +"\n" +"Current thread's C stack trace (most recent call first):\n" +" Binary file \"/opt/python/python\", at _Py_DumpStack+0x42 [0x5b27f7d7147e]\n" +" Binary file \"/opt/python/python\", at +0x32dcbd [0x5b27f7d85cbd]\n" +" Binary file \"/opt/python/python\", at +0x32df8a [0x5b27f7d85f8a]\n" +" Binary file \"/usr/lib/libc.so.6\", at +0x3def0 [0x77b73226bef0]\n" +" Binary file \"/usr/lib/libc.so.6\", at +0x17ef9c [0x77b7323acf9c]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so\", at +0xcdf6 [0x77b7315dddf6]\n" +" Binary file \"/usr/lib/libffi.so.8\", at +0x7976 [0x77b73158f976]\n" +" Binary file \"/usr/lib/libffi.so.8\", at +0x413c [0x77b73158c13c]\n" +" Binary file \"/usr/lib/libffi.so.8\", at ffi_call+0x12e [0x77b73158ef0e]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so\", at +0x15a33 [0x77b7315e6a33]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so\", at +0x164fa [0x77b7315e74fa]\n" +" Binary file \"/opt/python/build/lib.linux-x86_64-3.14/_ctypes.cpython-314d-x86_64-linux-gnu.so\", at +0xc624 [0x77b7315dd624]\n" +" Binary file \"/opt/python/python\", at _PyObject_MakeTpCall+0xce [0x5b27f7b73883]\n" +" Binary file \"/opt/python/python\", at +0x11bab6 [0x5b27f7b73ab6]\n" +" Binary file \"/opt/python/python\", at PyObject_Vectorcall+0x23 [0x5b27f7b73b04]\n" +" Binary file \"/opt/python/python\", at _PyEval_EvalFrameDefault+0x490c [0x5b27f7cbb302]\n" +" Binary file \"/opt/python/python\", at +0x2818e6 [0x5b27f7cd98e6]\n" +" Binary file \"/opt/python/python\", at +0x281aab [0x5b27f7cd9aab]\n" +" Binary file \"/opt/python/python\", at PyEval_EvalCode+0xc5 [0x5b27f7cd9ba3]\n" +" Binary file \"/opt/python/python\", at +0x255957 [0x5b27f7cad957]\n" +" Binary file \"/opt/python/python\", at +0x255ab4 [0x5b27f7cadab4]\n" +" Binary file \"/opt/python/python\", at _PyEval_EvalFrameDefault+0x6c3e [0x5b27f7cbd634]\n" +" Binary file \"/opt/python/python\", at +0x2818e6 [0x5b27f7cd98e6]\n" +" Binary file \"/opt/python/python\", at +0x281aab [0x5b27f7cd9aab]\n" +" Binary file \"/opt/python/python\", at +0x11b6e1 [0x5b27f7b736e1]\n" +" Binary file \"/opt/python/python\", at +0x11d348 [0x5b27f7b75348]\n" +" Binary file \"/opt/python/python\", at +0x11d626 [0x5b27f7b75626]\n" +" Binary file \"/opt/python/python\", at PyObject_Call+0x20 [0x5b27f7b7565e]\n" +" Binary file \"/opt/python/python\", at +0x32a67a [0x5b27f7d8267a]\n" +" Binary file \"/opt/python/python\", at +0x32a7f8 [0x5b27f7d827f8]\n" +" Binary file \"/opt/python/python\", at +0x32ac1b [0x5b27f7d82c1b]\n" +" Binary file \"/opt/python/python\", at Py_RunMain+0x31 [0x5b27f7d82ebe]\n" +" \n" +"Segmentation fault" diff --git a/library/fcntl.po b/library/fcntl.po index 9d795bba5..0a15af17e 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -24,88 +24,294 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!fcntl` --- The ``fcntl`` and ``ioctl`` system calls" -msgstr "" +msgstr ":mod:`!fcntl` --- فراخوانی‌های سیستمی ``fcntl`` و ``ioctl``" -msgid "This module performs file and I/O control on file descriptors. It is an interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full details." +msgid "" +"This module performs file and I/O control on file descriptors. It is an " +"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the " +":manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " +"details." msgstr "" +"این ماژول کنترل فایل و ورودی/خروجی را روی توصیف‌گرهای فایل انجام می‌دهد. این" +" ماژول رابطی به روتین‌های :c:func:`fcntl` و :c:func:`ioctl` یونیکس است. برای" +" جزئیات کامل، صفحه‌های راهنمای یونیکس :manpage:`fcntl(2)` و " +":manpage:`ioctl(2)` را ببینید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "All functions in this module take a file descriptor *fd* as their first argument. This can be an integer file descriptor, such as returned by ``sys.stdin.fileno()``, or an :class:`io.IOBase` object, such as ``sys.stdin`` itself, which provides a :meth:`~io.IOBase.fileno` that returns a genuine file descriptor." -msgstr "" +msgid "" +"All functions in this module take a file descriptor *fd* as their first " +"argument. This can be an integer file descriptor, such as returned by " +"``sys.stdin.fileno()``, or an :class:`io.IOBase` object, such as " +"``sys.stdin`` itself, which provides a :meth:`~io.IOBase.fileno` that " +"returns a genuine file descriptor." +msgstr "" +"تمام توابع این ماژول یک توصیف‌گر فایل *fd* را به‌عنوان نخستین آرگومان خود " +"می‌پذیرند. این می‌تواند یک توصیف‌گر فایل از نوع عدد صحیح باشد، مانند آنچه " +"``sys.stdin.fileno()`` برمی‌گرداند، یا یک شیء :class:`io.IOBase`، مانند خود " +"``sys.stdin``، که متد :meth:`~io.IOBase.fileno` را فراهم می‌کند و این متد یک" +" توصیف‌گر فایل واقعی برمی‌گرداند." -msgid "Operations in this module used to raise an :exc:`IOError` where they now raise an :exc:`OSError`." +msgid "" +"Operations in this module used to raise an :exc:`IOError` where they now " +"raise an :exc:`OSError`." msgstr "" +"عملیات این ماژول پیش‌تر :exc:`IOError` را پرتاب می‌کردند، در حالی که اکنون " +":exc:`OSError` را پرتاب می‌کنند." -msgid "The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and ``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file descriptors." +msgid "" +"The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " +"``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file " +"descriptors." msgstr "" +"ماژول :mod:`!fcntl` اکنون شامل ثابت‌های ``F_ADD_SEALS``، ``F_GET_SEALS`` و " +"``F_SEAL_*`` برای مهر و موم کردن (sealing) توصیف‌گرهای فایل " +":func:`os.memfd_create` است." -msgid "On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which obtains the path of a file from a file descriptor. On Linux(>=3.15), the :mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and ``F_OFD_SETLKW`` constants, which are used when working with open file description locks." -msgstr "" +msgid "" +"On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which" +" obtains the path of a file from a file descriptor. On Linux(>=3.15), the " +":mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " +"``F_OFD_SETLKW`` constants, which are used when working with open file " +"description locks." +msgstr "" +"در macOS، ماژول :mod:`!fcntl` ثابت ``F_GETPATH`` را در دسترس قرار می‌دهد که " +"مسیر یک فایل را از یک توصیف‌گر فایل به دست می‌آورد. در لینوکس (>=3.15)، " +"ماژول :mod:`!fcntl` ثابت‌های ``F_OFD_GETLK``، ``F_OFD_SETLK`` و " +"``F_OFD_SETLKW`` را در دسترس قرار می‌دهد که هنگام کار با قفل‌های توصیف فایل " +"باز (open file description locks) استفاده می‌شوند." -msgid "On Linux >= 2.6.11, the :mod:`!fcntl` module exposes the ``F_GETPIPE_SZ`` and ``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size respectively." +msgid "" +"On Linux >= 2.6.11, the :mod:`!fcntl` module exposes the ``F_GETPIPE_SZ`` " +"and ``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's " +"size respectively." msgstr "" +"در لینوکس >= 2.6.11، ماژول :mod:`!fcntl` ثابت‌های ``F_GETPIPE_SZ`` و " +"``F_SETPIPE_SZ`` را در معرض قرار می‌دهد که به ترتیب امکان بررسی و تغییر " +"اندازه‌ی پایپرا فراهم می‌کنند." -msgid "On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and ``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, the latter setting ``FD_CLOEXEC`` flag in addition." +msgid "" +"On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and " +"``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, " +"the latter setting ``FD_CLOEXEC`` flag in addition." msgstr "" +"در FreeBSD، ماژول :mod:`!fcntl` ثابت‌های ``F_DUP2FD`` و ``F_DUP2FD_CLOEXEC``" +" را در دسترس قرار می‌دهد که امکان تکثیر یک توصیف‌گر فایل را فراهم می‌کنند؛ " +"دومی علاوه بر این، پرچم ``FD_CLOEXEC`` را نیز تنظیم می‌کند." -msgid "On Linux >= 4.5, the :mod:`!fcntl` module exposes the ``FICLONE`` and ``FICLONERANGE`` constants, which allow to share some data of one file with another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and XFS). This behavior is commonly referred to as \"copy-on-write\"." +msgid "" +"On Linux >= 4.5, the :mod:`!fcntl` module exposes the ``FICLONE`` and " +"``FICLONERANGE`` constants, which allow to share some data of one file with " +"another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " +"XFS). This behavior is commonly referred to as \"copy-on-write\"." msgstr "" +"در لینوکس 4.5 و بالاتر، ماژول :mod:`!fcntl` ثابت‌های ``FICLONE`` و " +"``FICLONERANGE`` را ارائه می‌دهد، که امکان اشتراک‌گذاری بخشی از داده‌های یک " +"فایل با فایلی دیگر را از طریق بازپیوند (reflinking) در برخی سیستم‌های فایل " +"(مانند btrfs، OCFS2 و XFS) فراهم می‌کنند. این رفتار معمولاً به‌عنوان «کپی " +"هنگام نوشتن (copy-on-write)» شناخته می‌شود." -msgid "On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, ``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` constants, which allow to direct I/O availability signals to a specific thread, process, or process group. On Linux >= 4.13, the :mod:`!fcntl` module exposes the ``F_GET_RW_HINT``, ``F_SET_RW_HINT``, ``F_GET_FILE_RW_HINT``, ``F_SET_FILE_RW_HINT``, and ``RWH_WRITE_LIFE_*`` constants, which allow to inform the kernel about the relative expected lifetime of writes on a given inode or via a particular open file description. On Linux >= 5.1 and NetBSD, the :mod:`!fcntl` module exposes the ``F_SEAL_FUTURE_WRITE`` constant for use with ``F_ADD_SEALS`` and ``F_GET_SEALS`` operations. On FreeBSD, the :mod:`!fcntl` module exposes the ``F_READAHEAD``, ``F_ISUNIONSTACK``, and ``F_KINFO`` constants. On macOS and FreeBSD, the :mod:`!fcntl` module exposes the ``F_RDAHEAD`` constant. On NetBSD and AIX, the :mod:`!fcntl` module exposes the ``F_CLOSEM`` constant. On NetBSD, the :mod:`!fcntl` module exposes the ``F_MAXFD`` constant. On macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` and ``F_SETNOSIGPIPE`` constant." -msgstr "" +msgid "" +"On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, " +"``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` " +"constants, which allow to direct I/O availability signals to a specific " +"thread, process, or process group. On Linux >= 4.13, the :mod:`!fcntl` " +"module exposes the ``F_GET_RW_HINT``, ``F_SET_RW_HINT``, " +"``F_GET_FILE_RW_HINT``, ``F_SET_FILE_RW_HINT``, and ``RWH_WRITE_LIFE_*`` " +"constants, which allow to inform the kernel about the relative expected " +"lifetime of writes on a given inode or via a particular open file " +"description. On Linux >= 5.1 and NetBSD, the :mod:`!fcntl` module exposes " +"the ``F_SEAL_FUTURE_WRITE`` constant for use with ``F_ADD_SEALS`` and " +"``F_GET_SEALS`` operations. On FreeBSD, the :mod:`!fcntl` module exposes the" +" ``F_READAHEAD``, ``F_ISUNIONSTACK``, and ``F_KINFO`` constants. On macOS " +"and FreeBSD, the :mod:`!fcntl` module exposes the ``F_RDAHEAD`` constant. On" +" NetBSD and AIX, the :mod:`!fcntl` module exposes the ``F_CLOSEM`` constant." +" On NetBSD, the :mod:`!fcntl` module exposes the ``F_MAXFD`` constant. On " +"macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` " +"and ``F_SETNOSIGPIPE`` constant." +msgstr "" +"در لینوکس >= 2.6.32، ماژول :mod:`!fcntl` ثابت‌های ``F_GETOWN_EX``، " +"``F_SETOWN_EX``، ``F_OWNER_TID``، ``F_OWNER_PID`` و ``F_OWNER_PGRP`` را در " +"معرض قرار می‌دهد، که امکان هدایت سیگنال‌های دسترس‌پذیری I/O به یک نخ، " +"فرایند یا گروه فرایند خاص را فراهم می‌کنند. در لینوکس >= 4.13، ماژول " +":mod:`!fcntl` ثابت‌های ``F_GET_RW_HINT``، ``F_SET_RW_HINT``، " +"``F_GET_FILE_RW_HINT``، ``F_SET_FILE_RW_HINT`` و ``RWH_WRITE_LIFE_*`` را در " +"معرض قرار می‌دهد، که امکان اطلاع‌رسانی به هسته درباره طول عمر مورد انتظار " +"نسبی نوشتن‌ها روی یک آی‌نود (inode) مشخص یا از طریق یک توصیف فایل باز (open " +"file description) خاص را فراهم می‌کنند. در لینوکس >= 5.1 و NetBSD، ماژول " +":mod:`!fcntl` ثابت ``F_SEAL_FUTURE_WRITE`` را برای استفاده با عملیات‌های " +"``F_ADD_SEALS`` و ``F_GET_SEALS`` در معرض قرار می‌دهد. در FreeBSD، ماژول " +":mod:`!fcntl` ثابت‌های ``F_READAHEAD``، ``F_ISUNIONSTACK`` و ``F_KINFO`` را " +"در معرض قرار می‌دهد. در macOS و FreeBSD، ماژول :mod:`!fcntl` ثابت " +"``F_RDAHEAD`` را در معرض قرار می‌دهد. در NetBSD و AIX، ماژول :mod:`!fcntl` " +"ثابت ``F_CLOSEM`` را در معرض قرار می‌دهد. در NetBSD، ماژول :mod:`!fcntl` " +"ثابت ``F_MAXFD`` را در معرض قرار می‌دهد. در macOS و NetBSD، ماژول " +":mod:`!fcntl` ثابت‌های ``F_GETNOSIGPIPE`` و ``F_SETNOSIGPIPE`` را در معرض " +"قرار می‌دهد." -msgid "On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY`` to query a file descriptor pointing to the same file." +msgid "" +"On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY`` to " +"query a file descriptor pointing to the same file." msgstr "" +"در لینوکس 6.1 یا بالاتر، ماژول :mod:`!fcntl`، ``F_DUPFD_QUERY`` را برای " +"استعلام توصیف‌گر فایلی که به همان فایل اشاره دارد، در دسترس قرار می‌دهد." msgid "The module defines the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را تعریف می‌کند:" -msgid "Perform the operation *cmd* on file descriptor *fd* (file objects providing a :meth:`~io.IOBase.fileno` method are accepted as well). The values used for *cmd* are operating system dependent, and are available as constants in the :mod:`!fcntl` module, using the same names as used in the relevant C header files. The argument *arg* can either be an integer value, a :term:`bytes-like object`, or a string. The type and size of *arg* must match the type and size of the argument of the operation as specified in the relevant C documentation." -msgstr "" +msgid "" +"Perform the operation *cmd* on file descriptor *fd* (file objects providing " +"a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " +"for *cmd* are operating system dependent, and are available as constants in " +"the :mod:`!fcntl` module, using the same names as used in the relevant C " +"header files. The argument *arg* can either be an integer value, a " +":term:`bytes-like object`, or a string. The type and size of *arg* must " +"match the type and size of the argument of the operation as specified in the" +" relevant C documentation." +msgstr "" +"عملیات *cmd* را روی توصیف‌گر فایل *fd* انجام می‌دهد (اشیای فایلی که متد " +":meth:`~io.IOBase.fileno` را فراهم می‌کنند نیز پذیرفته می‌شوند). مقادیر مورد" +" استفاده برای *cmd* به سیستم‌عامل وابسته‌اند و به‌عنوان ثابت‌هایی در ماژول " +":mod:`!fcntl` در دسترس هستند، با همان نام‌هایی که در فایل‌های سرآیند C مرتبط " +"استفاده شده‌اند. آرگومان *arg* می‌تواند یک مقدار عدد صحیح، یک :term:`bytes-" +"like object` یا یک رشته باشد. نوع و اندازه‌ی *arg* باید با نوع و اندازه‌ی " +"آرگومان عملیات، همان‌طور که در مستندات C مرتبط مشخص شده است، مطابقت داشته " +"باشد." -msgid "When *arg* is an integer, the function returns the integer return value of the C :c:func:`fcntl` call." +msgid "" +"When *arg* is an integer, the function returns the integer return value of " +"the C :c:func:`fcntl` call." msgstr "" +"هنگامی که *arg* عدد صحیح باشد، تابع مقدار بازگشتی از نوع عدد صحیحِ فراخوانی " +"C :c:func:`fcntl` را برمی‌گرداند." -msgid "When the argument is bytes-like object, it represents a binary structure, for example, created by :func:`struct.pack`. A string value is encoded to binary using the UTF-8 encoding. The binary data is copied to a buffer whose address is passed to the C :c:func:`fcntl` call. The return value after a successful call is the contents of the buffer, converted to a :class:`bytes` object. The length of the returned object will be the same as the length of the *arg* argument. This is limited to 1024 bytes." -msgstr "" +msgid "" +"When the argument is bytes-like object, it represents a binary structure, " +"for example, created by :func:`struct.pack`. A string value is encoded to " +"binary using the UTF-8 encoding. The binary data is copied to a buffer whose" +" address is passed to the C :c:func:`fcntl` call. The return value after a " +"successful call is the contents of the buffer, converted to a :class:`bytes`" +" object. The length of the returned object will be the same as the length of" +" the *arg* argument. This is limited to 1024 bytes." +msgstr "" +"هنگامی که آرگومان یک شیء شبه‌بایت (bytes-like) باشد، این آرگومان یک ساختار" +" دودویی را نشان می‌دهد؛ برای مثال، ساختاری که با :func:`struct.pack` ایجاد " +"شده است. یک مقدار رشته‌ای با استفاده از کدگذاری UTF-8 به دودویی کدگذاری " +"می‌شود. داده‌های دودویی به یک بافر کپی می‌شوند و نشانی آن به فراخوانی " +":c:func:`fcntl` در C ارسال می‌شود. مقدار بازگشتی پس از یک فراخوانی موفق، " +"محتوای بافر است که به یک شیء :class:`bytes` تبدیل می‌شود. طول شیء " +"برگردانده‌شده همان طول آرگومان *arg* خواهد بود. این مقدار به ۱۰۲۴ بایت محدود" +" است." msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." msgstr "" +"اگر فراخوانی :c:func:`fcntl` با شکست مواجه شود، یک :exc:`OSError` پرتاب " +"می‌شود." -msgid "If the type or the size of *arg* does not match the type or size of the argument of the operation (for example, if an integer is passed when a pointer is expected, or the information returned in the buffer by the operating system is larger than 1024 bytes), this is most likely to result in a segmentation violation or a more subtle data corruption." -msgstr "" +msgid "" +"If the type or the size of *arg* does not match the type or size of the " +"argument of the operation (for example, if an integer is passed when a " +"pointer is expected, or the information returned in the buffer by the " +"operating system is larger than 1024 bytes), this is most likely to result " +"in a segmentation violation or a more subtle data corruption." +msgstr "" +"اگر نوع یا اندازه‌ی *arg* با نوع یا اندازه‌ی آرگومان عملیات مطابقت نداشته باشد" +" (برای مثال، اگر زمانی که اشاره‌گر مورد انتظار است، یک عدد صحیح ارسال شود، " +"یا اطلاعاتی که سیستم‌عامل در حافظه‌ی موقت برمی‌گرداند بزرگ‌تر از ۱۰۲۴ بایت " +"باشد)، این حالت به احتمال زیاد منجر به نقض قطعه‌بندی یا خرابی داده‌ی پنهان‌تر" +" می‌شود." -msgid "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments ``fd``, ``cmd``, ``arg``." +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " +"``fd``, ``cmd``, ``arg``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``fcntl.fcntl`` را با آرگومان‌های " +"``fd``، ``cmd`` و ``arg`` پرتاب می‌کند." -msgid "Add support of arbitrary :term:`bytes-like objects `, not only :class:`bytes`." +msgid "" +"Add support of arbitrary :term:`bytes-like objects `, not" +" only :class:`bytes`." msgstr "" +"افزودن پشتیبانی از هرگونه :term:`شیء شبه‌بایت (bytes-like object) `، نه فقط :class:`bytes`." -msgid "This function is identical to the :func:`~fcntl.fcntl` function, except that the argument handling is even more complicated." +msgid "" +"This function is identical to the :func:`~fcntl.fcntl` function, except that" +" the argument handling is even more complicated." msgstr "" +"این تابع با تابع :func:`~fcntl.fcntl` یکسان است، با این تفاوت که مدیریت " +"آرگومان‌ها حتی پیچیده‌تر است." -msgid "The *request* parameter is limited to values that can fit in 32-bits or 64-bits, depending on the platform. Additional constants of interest for use as the *request* argument can be found in the :mod:`termios` module, under the same names as used in the relevant C header files." +msgid "" +"The *request* parameter is limited to values that can fit in 32-bits or " +"64-bits, depending on the platform. Additional constants of interest for use" +" as the *request* argument can be found in the :mod:`termios` module, under " +"the same names as used in the relevant C header files." msgstr "" +"پارامتر *request* به مقادیری محدود است که می‌توانند در ۳۲ بیت یا ۶۴ بیت جا " +"بگیرند، بسته به سکو. ثابت‌های اضافی مورد توجه برای استفاده به‌عنوان آرگومان " +"*request* را می‌توان در ماژول :mod:`termios` یافت، با همان نام‌هایی که در " +"فایل‌های سرآیند C مربوطه استفاده می‌شوند." -msgid "The parameter *arg* can be an integer, a :term:`bytes-like object`, or a string. The type and size of *arg* must match the type and size of the argument of the operation as specified in the relevant C documentation." +msgid "" +"The parameter *arg* can be an integer, a :term:`bytes-like object`, or a " +"string. The type and size of *arg* must match the type and size of the " +"argument of the operation as specified in the relevant C documentation." msgstr "" +"پارامتر *arg* می‌تواند یک عدد صحیح، یک :term:`bytes-like object`، یا یک رشته" +" باشد. نوع و اندازه‌ی *arg* باید با نوع و اندازه‌ی آرگومان عملیات، همان‌طور " +"که در مستندات C مربوطه مشخص شده است، مطابقت داشته باشد." -msgid "If *arg* does not support the read-write buffer interface or the *mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` function." +msgid "" +"If *arg* does not support the read-write buffer interface or the " +"*mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` " +"function." msgstr "" +"اگر *arg* از رابط بافر خواندن-نوشتن پشتیبانی نکند یا *mutate_flag* نادرست " +"باشد، رفتار مانند تابع :func:`~fcntl.fcntl` است." -msgid "If *arg* supports the read-write buffer interface (like :class:`bytearray`) and *mutate_flag* is true (the default), then the buffer is (in effect) passed to the underlying :c:func:`!ioctl` system call, the latter's return code is passed back to the calling Python, and the buffer's new contents reflect the action of the :c:func:`ioctl`. This is a slight simplification, because if the supplied buffer is less than 1024 bytes long it is first copied into a static buffer 1024 bytes long which is then passed to :func:`ioctl` and copied back into the supplied buffer." -msgstr "" +msgid "" +"If *arg* supports the read-write buffer interface (like :class:`bytearray`) " +"and *mutate_flag* is true (the default), then the buffer is (in effect) " +"passed to the underlying :c:func:`!ioctl` system call, the latter's return " +"code is passed back to the calling Python, and the buffer's new contents " +"reflect the action of the :c:func:`ioctl`. This is a slight simplification," +" because if the supplied buffer is less than 1024 bytes long it is first " +"copied into a static buffer 1024 bytes long which is then passed to " +":func:`ioctl` and copied back into the supplied buffer." +msgstr "" +"اگر *arg* از رابط بافر خواندنی-نوشتنی (مانند :class:`bytearray`) پشتیبانی " +"کند و *mutate_flag* درست باشد (پیش‌فرض)، آنگاه بافر (در عمل) به فراخوانی " +"سیستمی زیرین :c:func:`!ioctl` ارسال می‌شود، کد بازگشتی آن به پایتون " +"فراخواننده بازگردانده می‌شود، و محتوای جدید بافر بازتاب عمل :c:func:`ioctl` " +"است. این یک ساده‌سازی جزئی است، زیرا اگر طول بافر ارائه‌شده کمتر از ۱۰۲۴ " +"بایت باشد، ابتدا در یک بافر ایستا به طول ۱۰۲۴ بایت کپی می‌شود؛ سپس همان بافر" +" به :func:`ioctl` ارسال می‌شود و دوباره در بافر ارائه‌شده کپی می‌شود." -msgid "If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." +msgid "" +"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." msgstr "" +"اگر فراخوانی :c:func:`ioctl` با شکست مواجه شود، یک استثنای :exc:`OSError` " +"پرتاب می‌شود." -msgid "If the type or size of *arg* does not match the type or size of the operation's argument (for example, if an integer is passed when a pointer is expected, or the information returned in the buffer by the operating system is larger than 1024 bytes, or the size of the mutable bytes-like object is too small), this is most likely to result in a segmentation violation or a more subtle data corruption." -msgstr "" +msgid "" +"If the type or size of *arg* does not match the type or size of the " +"operation's argument (for example, if an integer is passed when a pointer is" +" expected, or the information returned in the buffer by the operating system" +" is larger than 1024 bytes, or the size of the mutable bytes-like object is " +"too small), this is most likely to result in a segmentation violation or a " +"more subtle data corruption." +msgstr "" +"اگر نوع یا اندازه‌ی *arg* با نوع یا اندازه‌ی آرگومان عملیات مطابقت نداشته باشد" +" (برای مثال، اگر زمانی که یک اشاره‌گر انتظار می‌رود، یک عدد صحیح ارسال شود، " +"یا اطلاعاتی که سیستم‌عامل در بافر برمی‌گرداند بزرگ‌تر از ۱۰۲۴ بایت باشد، یا " +"اندازه‌ی شیء شبه‌بایت (bytes-like) تغییرپذیر بیش از حد کوچک باشد)، این " +"موضوع به احتمال زیاد منجر به خطای قطعه‌بندی (segmentation violation) یا " +"خرابی داده‌ای ظریف‌تر خواهد شد." msgid "An example::" -msgstr "" +msgstr "یک مثال::" msgid "" ">>> import array, fcntl, struct, termios, os\n" @@ -119,60 +325,134 @@ msgid "" ">>> buf\n" "array('h', [13341])" msgstr "" +">>> import array, fcntl, struct, termios, os\n" +">>> os.getpgrp()\n" +"13341\n" +">>> struct.unpack('h', fcntl.ioctl(0, termios.TIOCGPGRP, \" \"))[0]\n" +"13341\n" +">>> buf = array.array('h', [0])\n" +">>> fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)\n" +"0\n" +">>> buf\n" +"array('h', [13341])" -msgid "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments ``fd``, ``request``, ``arg``." +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " +"``fd``, ``request``, ``arg``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``fcntl.ioctl`` را با آرگومان‌های ``fd``، " +"``request`` و ``arg`` پرتاب می‌کند." -msgid "The GIL is always released during a system call. System calls failing with EINTR are automatically retried." +msgid "" +"The GIL is always released during a system call. System calls failing with " +"EINTR are automatically retried." msgstr "" +"GIL همیشه در حین یک فراخوانی سیستمی آزاد می‌شود. فراخوانی‌های سیستمی که با " +"EINTR ناموفق می‌شوند، به‌طور خودکار دوباره تلاش می‌شوند." -msgid "Perform the lock operation *operation* on file descriptor *fd* (file objects providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the Unix manual :manpage:`flock(2)` for details. (On some systems, this function is emulated using :c:func:`fcntl`.)" +msgid "" +"Perform the lock operation *operation* on file descriptor *fd* (file objects" +" providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the" +" Unix manual :manpage:`flock(2)` for details. (On some systems, this " +"function is emulated using :c:func:`fcntl`.)" msgstr "" +"عملیات قفل *operation* را روی توصیف‌گر فایل *fd* انجام دهید (اشیاء فایلی که " +"یک متد :meth:`~io.IOBase.fileno` ارائه می‌دهند نیز پذیرفته می‌شوند). برای " +"جزئیات، صفحه‌ی راهنمای Unix :manpage:`flock(2)` را ببینید. (در برخی سیستم‌ها،" +" این تابع با استفاده از :c:func:`fcntl` شبیه‌سازی می‌شود.)" -msgid "If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." +msgid "" +"If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." msgstr "" +"اگر فراخوانی :c:func:`flock` ناموفق باشد، استثنای :exc:`OSError` پرتاب " +"می‌شود." -msgid "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments ``fd``, ``operation``." +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " +"``fd``, ``operation``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``fcntl.flock`` را با آرگومان‌های ``fd``" +" و ``operation`` پرتاب می‌کند." -msgid "This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. *fd* is the file descriptor (file objects providing a :meth:`~io.IOBase.fileno` method are accepted as well) of the file to lock or unlock, and *cmd* is one of the following values:" +msgid "" +"This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls." +" *fd* is the file descriptor (file objects providing a " +":meth:`~io.IOBase.fileno` method are accepted as well) of the file to lock " +"or unlock, and *cmd* is one of the following values:" msgstr "" +"این اساساً پوششی بر روی فراخوانی‌های قفل‌کردن :func:`~fcntl.fcntl` است. *fd*" +" توصیف‌گر فایل برای فایلی است که باید قفل یا باز شود (اشیای فایلی که متد " +":meth:`~io.IOBase.fileno` را ارائه می‌دهند نیز پذیرفته می‌شوند)، و *cmd* یکی" +" از مقادیر زیر است:" msgid "Release an existing lock." -msgstr "" +msgstr "یک قفل موجود را آزاد کنید." msgid "Acquire a shared lock." -msgstr "" +msgstr "یک قفل مشترک را به دست آورید." msgid "Acquire an exclusive lock." -msgstr "" +msgstr "یک قفل متقابل کسب کنید." -msgid "Bitwise OR with any of the other three ``LOCK_*`` constants to make the request non-blocking." +msgid "" +"Bitwise OR with any of the other three ``LOCK_*`` constants to make the " +"request non-blocking." msgstr "" +"برای غیرمسدودکننده کردن درخواست، از عملگر OR بیتی با هر یک از سه ثابت دیگر " +"``LOCK_*`` استفاده کنید." -msgid "If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:`OSError` will be raised and the exception will have an *errno* attribute set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending on the operating system; for portability, check for both values). On at least some systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to a file opened for writing." -msgstr "" +msgid "" +"If :const:`!LOCK_NB` is used and the lock cannot be acquired, an " +":exc:`OSError` will be raised and the exception will have an *errno* " +"attribute set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending" +" on the operating system; for portability, check for both values). On at " +"least some systems, :const:`!LOCK_EX` can only be used if the file " +"descriptor refers to a file opened for writing." +msgstr "" +"اگر از :const:`!LOCK_NB` استفاده شود و نتوان قفل را کسب کرد، یک " +":exc:`OSError` پرتاب خواهد شد و ویژگی *errno* این استثنا روی " +":const:`~errno.EACCES` یا :const:`~errno.EAGAIN` تنظیم خواهد شد (بسته به " +"سیستم‌عامل؛ برای قابلیت حمل، هر دو مقدار را بررسی کنید). در حداقل برخی " +"سیستم‌ها، تنها در صورتی می‌توان از :const:`!LOCK_EX` استفاده کرد که توصیف‌گر " +"فایل به فایلی اشاره کند که برای نوشتن باز شده است." -msgid "*len* is the number of bytes to lock, *start* is the byte offset at which the lock starts, relative to *whence*, and *whence* is as with :func:`io.IOBase.seek`, specifically:" +msgid "" +"*len* is the number of bytes to lock, *start* is the byte offset at which " +"the lock starts, relative to *whence*, and *whence* is as with " +":func:`io.IOBase.seek`, specifically:" msgstr "" +"*len* تعداد بایت‌هایی است که باید قفل شوند، *start* آفست بایتی است که قفل از" +" آن شروع می‌شود، نسبت به *whence*، و *whence* همانند :func:`io.IOBase.seek` " +"است، به‌طور مشخص:" msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" -msgstr "" +msgstr "``0`` -- نسبت به ابتدای فایل (:const:`os.SEEK_SET`)" -msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" -msgstr "" +msgid "" +"``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" +msgstr "``1`` -- نسبت به موقعیت فعلی بافر (:const:`os.SEEK_CUR`)" msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" -msgstr "" +msgstr "``2`` -- نسبت به پایان پرونده (:const:`os.SEEK_END`)" -msgid "The default for *start* is 0, which means to start at the beginning of the file. The default for *len* is 0 which means to lock to the end of the file. The default for *whence* is also 0." +msgid "" +"The default for *start* is 0, which means to start at the beginning of the " +"file. The default for *len* is 0 which means to lock to the end of the file." +" The default for *whence* is also 0." msgstr "" +"مقدار پیش‌فرض برای *start* برابر ۰ است، که به معنای آغاز از ابتدای فایل است." +" مقدار پیش‌فرض برای *len* برابر ۰ است، که به معنای قفل کردن تا پایان پرونده " +"است. مقدار پیش‌فرض برای *whence* نیز ۰ است." -msgid "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments ``fd``, ``cmd``, ``len``, ``start``, ``whence``." +msgid "" +"Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " +"``fd``, ``cmd``, ``len``, ``start``, ``whence``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``fcntl.lockf`` را با آرگومان‌های " +"``fd``، ``cmd``، ``len``، ``start`` و ``whence`` پرتاب می‌کند." msgid "Examples (all on a SVR4 compliant system)::" -msgstr "" +msgstr "مثال‌ها (همه روی یک سیستم منطبق با SVR4)::" msgid "" "import struct, fcntl, os\n" @@ -183,21 +463,42 @@ msgid "" "lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" "rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" msgstr "" +"import struct, fcntl, os\n" +"\n" +"f = open(...)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)\n" +"\n" +"lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" -msgid "Note that in the first example the return value variable *rv* will hold an integer value; in the second example it will hold a :class:`bytes` object. The structure lay-out for the *lockdata* variable is system dependent --- therefore using the :func:`flock` call may be better." +msgid "" +"Note that in the first example the return value variable *rv* will hold an " +"integer value; in the second example it will hold a :class:`bytes` object. " +"The structure lay-out for the *lockdata* variable is system dependent --- " +"therefore using the :func:`flock` call may be better." msgstr "" +"توجه داشته باشید که در مثال اول، متغیر مقدار بازگشتی *rv* حاوی یک مقدار عدد " +"صحیح خواهد بود؛ در مثال دوم، حاوی یک شیء :class:`bytes` خواهد بود. چیدمان " +"ساختار متغیر *lockdata* وابسته به سیستم است --- بنابراین استفاده از فراخوانی" +" :func:`flock` ممکن است بهتر باشد." msgid "Module :mod:`os`" -msgstr "" +msgstr "ماژول :mod:`os`" -msgid "If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are present in the :mod:`os` module (on BSD only), the :func:`os.open` function provides an alternative to the :func:`lockf` and :func:`flock` functions." +msgid "" +"If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " +"present in the :mod:`os` module (on BSD only), the :func:`os.open` function " +"provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" +"اگر پرچم‌های قفل‌گذاری :const:`~os.O_SHLOCK` و :const:`~os.O_EXLOCK` در " +"ماژول :mod:`os` موجود باشند (فقط در BSD)، تابع :func:`os.open` جایگزینی برای" +" توابع :func:`lockf` و :func:`flock` فراهم می‌کند." msgid "UNIX" -msgstr "" +msgstr "یونیکس" msgid "file control" -msgstr "" +msgstr "کنترل فایل" msgid "I/O control" -msgstr "" +msgstr "کنترل ورودی/خروجی" diff --git a/library/filecmp.po b/library/filecmp.po index c35123485..523375241 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -22,127 +22,244 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!filecmp` --- File and Directory Comparisons" -msgstr "" +msgstr ":mod:`!filecmp` --- مقایسه فایل‌ها و پوشه‌ها" msgid "**Source code:** :source:`Lib/filecmp.py`" -msgstr "" +msgstr ":source:`Lib/filecmp.py`" -msgid "The :mod:`!filecmp` module defines functions to compare files and directories, with various optional time/correctness trade-offs. For comparing files, see also the :mod:`difflib` module." +msgid "" +"The :mod:`!filecmp` module defines functions to compare files and " +"directories, with various optional time/correctness trade-offs. For " +"comparing files, see also the :mod:`difflib` module." msgstr "" +"ماژول :mod:`!filecmp` توابعی برای مقایسه فایل‌ها و پوشه‌ها تعریف می‌کند، با " +"موازنه‌های اختیاری مختلف بین زمان و صحت. برای مقایسه فایل‌ها، ماژول " +":mod:`difflib` را نیز ببینید." msgid "The :mod:`!filecmp` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!filecmp` تابع‌های زیر را تعریف می‌کند:" -msgid "Compare the files named *f1* and *f2*, returning ``True`` if they seem equal, ``False`` otherwise." +msgid "" +"Compare the files named *f1* and *f2*, returning ``True`` if they seem " +"equal, ``False`` otherwise." msgstr "" +"فایل‌هایی با نام‌های *f1* و *f2* را مقایسه می‌کند و اگر به نظر برابر باشند، " +"``True`` و در غیر این صورت ``False`` را برمی‌گرداند." -msgid "If *shallow* is true and the :func:`os.stat` signatures (file type, size, and modification time) of both files are identical, the files are taken to be equal." +msgid "" +"If *shallow* is true and the :func:`os.stat` signatures (file type, size, " +"and modification time) of both files are identical, the files are taken to " +"be equal." msgstr "" +"اگر *shallow* درست باشد و امضاهای :func:`os.stat` هر دو فایل (نوع فایل، " +"اندازه و زمان اصلاح) یکسان باشند، فایل‌ها برابر در نظر گرفته می‌شوند." -msgid "Otherwise, the files are treated as different if their sizes or contents differ." +msgid "" +"Otherwise, the files are treated as different if their sizes or contents " +"differ." msgstr "" +"در غیر این صورت، اگر اندازه یا محتوای فایل‌ها متفاوت باشد، آن‌ها متفاوت در " +"نظر گرفته می‌شوند." -msgid "Note that no external programs are called from this function, giving it portability and efficiency." +msgid "" +"Note that no external programs are called from this function, giving it " +"portability and efficiency." msgstr "" +"توجه داشته باشید که هیچ برنامه‌ی خارجی‌ای توسط این تابع فراخوانی نمی‌شود، که" +" این امر باعث قابلیت حمل و کارایی آن می‌شود." -msgid "This function uses a cache for past comparisons and the results, with cache entries invalidated if the :func:`os.stat` information for the file changes. The entire cache may be cleared using :func:`clear_cache`." +msgid "" +"This function uses a cache for past comparisons and the results, with cache " +"entries invalidated if the :func:`os.stat` information for the file changes." +" The entire cache may be cleared using :func:`clear_cache`." msgstr "" +"این تابع از یک نهانگاه برای مقایسه‌ها و نتایج گذشته استفاده می‌کند و چنانچه " +"اطلاعات :func:`os.stat` مربوط به فایل تغییر کند، ورودی‌های نهانگاه نامعتبر " +"می‌شوند. می‌توان کل نهانگاه را با استفاده از :func:`clear_cache` پاک کرد." -msgid "Compare the files in the two directories *a* and *b* whose names are given by *common*." +msgid "" +"Compare the files in the two directories *a* and *b* whose names are given " +"by *common*." msgstr "" +"فایل‌های موجود در دو پوشه‌ی *a* و *b* را که نام‌های آن‌ها توسط *common* داده" +" شده است، مقایسه کنید." -msgid "Returns three lists of file names: *match*, *mismatch*, *errors*. *match* contains the list of files that match, *mismatch* contains the names of those that don't, and *errors* lists the names of files which could not be compared. Files are listed in *errors* if they don't exist in one of the directories, the user lacks permission to read them or if the comparison could not be done for some other reason." -msgstr "" +msgid "" +"Returns three lists of file names: *match*, *mismatch*, *errors*. *match* " +"contains the list of files that match, *mismatch* contains the names of " +"those that don't, and *errors* lists the names of files which could not be " +"compared. Files are listed in *errors* if they don't exist in one of the " +"directories, the user lacks permission to read them or if the comparison " +"could not be done for some other reason." +msgstr "" +"سه فهرست از نام فایل‌ها برمی‌گرداند: *match*، *mismatch*، *errors*. *match* " +"شامل فهرست فایل‌هایی است که مطابقت دارند، *mismatch* شامل نام آن‌هایی است که" +" مطابقت ندارند، و *errors* نام فایل‌هایی را فهرست می‌کند که مقایسه آن‌ها " +"ممکن نبوده است. فایل‌ها در *errors* فهرست می‌شوند اگر در یکی از پوشه‌ها وجود" +" نداشته باشند، کاربر دسترسی لازم برای خواندن آن‌ها را نداشته باشد، یا مقایسه" +" به دلیل دیگری امکان‌پذیر نباشد." -msgid "The *shallow* parameter has the same meaning and default value as for :func:`filecmp.cmp`." +msgid "" +"The *shallow* parameter has the same meaning and default value as for " +":func:`filecmp.cmp`." msgstr "" +"پارامتر *shallow* همان معنا و مقدار پیش‌فرضِ :func:`filecmp.cmp` را دارد." -msgid "For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with ``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in one of the three returned lists." +msgid "" +"For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with " +"``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in" +" one of the three returned lists." msgstr "" +"برای مثال، ``cmpfiles('a', 'b', ['c', 'd/e'])`` ``a/c`` را با ``b/c`` و " +"``a/d/e`` را با ``b/d/e`` مقایسه می‌کند. ``'c'`` و ``'d/e'`` هرکدام در یکی " +"از سه فهرست برگردانده‌شده قرار خواهند گرفت." -msgid "Clear the filecmp cache. This may be useful if a file is compared so quickly after it is modified that it is within the mtime resolution of the underlying filesystem." +msgid "" +"Clear the filecmp cache. This may be useful if a file is compared so quickly" +" after it is modified that it is within the mtime resolution of the " +"underlying filesystem." msgstr "" +"نهانگاه filecmp را پاک کنید. این ممکن است زمانی مفید باشد که فایلی آن‌قدر " +"سریع پس از تغییرش مقایسه شود که در محدوده‌ی دقت mtime سیستم‌فایل زیرین قرار " +"گیرد." msgid "The :class:`dircmp` class" -msgstr "" +msgstr "کلاس :class:`dircmp`" -msgid "Construct a new directory comparison object, to compare the directories *a* and *b*. *ignore* is a list of names to ignore, and defaults to :const:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults to ``[os.curdir, os.pardir]``." +msgid "" +"Construct a new directory comparison object, to compare the directories *a* " +"and *b*. *ignore* is a list of names to ignore, and defaults to " +":const:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and " +"defaults to ``[os.curdir, os.pardir]``." msgstr "" +"یک شیء جدید مقایسه‌ی پوشه می‌سازد، تا پوشه‌های *a* و *b* را مقایسه کند. " +"*ignore* فهرستی از نام‌ها برای نادیده‌گرفتن است و مقدار پیش‌فرض آن " +":const:`filecmp.DEFAULT_IGNORES` است. *hide* فهرستی از نام‌ها برای " +"پنهان‌کردن است و مقدار پیش‌فرض آن ``[os.curdir, os.pardir]`` است." -msgid "The :class:`dircmp` class compares files by doing *shallow* comparisons as described for :func:`filecmp.cmp` by default using the *shallow* parameter." +msgid "" +"The :class:`dircmp` class compares files by doing *shallow* comparisons as " +"described for :func:`filecmp.cmp` by default using the *shallow* parameter." msgstr "" +"کلاس :class:`dircmp` به‌طور پیش‌فرض با استفاده از پارامتر *shallow*، فایل‌ها" +" را با انجام مقایسه‌های سطحی (*shallow*) مقایسه می‌کند، همان‌گونه که برای " +":func:`filecmp.cmp` شرح داده شده است." msgid "Added the *shallow* parameter." -msgstr "" +msgstr "پارامتر *shallow* اضافه شد." msgid "The :class:`dircmp` class provides the following methods:" -msgstr "" +msgstr "کلاس :class:`dircmp` متدهای زیر را ارائه می‌کند:" msgid "Print (to :data:`sys.stdout`) a comparison between *a* and *b*." -msgstr "" +msgstr "مقایسه‌ای بین *a* و *b* را (در :data:`sys.stdout`) چاپ کنید." -msgid "Print a comparison between *a* and *b* and common immediate subdirectories." -msgstr "" +msgid "" +"Print a comparison between *a* and *b* and common immediate subdirectories." +msgstr "مقایسه‌ای میان *a* و *b* و زیرپوشه‌های مستقیم مشترک را چاپ می‌کند." -msgid "Print a comparison between *a* and *b* and common subdirectories (recursively)." +msgid "" +"Print a comparison between *a* and *b* and common subdirectories " +"(recursively)." msgstr "" +"مقایسه‌ای بین *a* و *b* و زیرپوشه‌های مشترک (به‌صورت بازگشتی) را چاپ می‌کند." -msgid "The :class:`dircmp` class offers a number of interesting attributes that may be used to get various bits of information about the directory trees being compared." +msgid "" +"The :class:`dircmp` class offers a number of interesting attributes that may" +" be used to get various bits of information about the directory trees being " +"compared." msgstr "" +"کلاس :class:`dircmp` تعدادی ویژگی جالب ارائه می‌دهد که می‌توان از آن‌ها برای" +" دریافت اطلاعات گوناگون درباره درخت‌های پوشه مقایسه‌شده استفاده کرد." -msgid "Note that via :meth:`~object.__getattr__` hooks, all attributes are computed lazily, so there is no speed penalty if only those attributes which are lightweight to compute are used." +msgid "" +"Note that via :meth:`~object.__getattr__` hooks, all attributes are computed" +" lazily, so there is no speed penalty if only those attributes which are " +"lightweight to compute are used." msgstr "" +"توجه داشته باشید که از طریق قلاب‌های :meth:`~object.__getattr__`، همه " +"ویژگی‌ها به‌صورت تنبل محاسبه می‌شوند، بنابراین اگر فقط از ویژگی‌هایی استفاده" +" شود که محاسبه‌شان کم‌هزینه است، هیچ هزینه‌ای از نظر سرعت وجود ندارد." msgid "The directory *a*." -msgstr "" +msgstr "پوشه‌ی *a*." msgid "The directory *b*." -msgstr "" +msgstr "پوشه‌ی *b*." msgid "Files and subdirectories in *a*, filtered by *hide* and *ignore*." msgstr "" +"فایل‌ها و زیرپوشه‌های درون *a*، که با *hide* و *ignore* فیلتر شده‌اند." msgid "Files and subdirectories in *b*, filtered by *hide* and *ignore*." msgstr "" +"فایل‌ها و زیرپوشه‌های موجود در *b*، پالایش‌شده بر اساس *hide* و *ignore*." msgid "Files and subdirectories in both *a* and *b*." -msgstr "" +msgstr "فایل‌ها و زیرپوشه‌ها در هر دو *a* و *b*." msgid "Files and subdirectories only in *a*." -msgstr "" +msgstr "فایل‌ها و زیرپوشه‌ها فقط در *a*." msgid "Files and subdirectories only in *b*." -msgstr "" +msgstr "فایل‌ها و زیرپوشه‌هایی که فقط در *b* وجود دارند." msgid "Subdirectories in both *a* and *b*." -msgstr "" +msgstr "زیرپوشه‌های موجود در هر دو *a* و *b*." msgid "Files in both *a* and *b*." -msgstr "" +msgstr "فایل‌های موجود در هر دو *a* و *b*." -msgid "Names in both *a* and *b*, such that the type differs between the directories, or names for which :func:`os.stat` reports an error." +msgid "" +"Names in both *a* and *b*, such that the type differs between the " +"directories, or names for which :func:`os.stat` reports an error." msgstr "" +"نام‌هایی که در هر دو *a* و *b* وجود دارند، به‌طوری که نوع آن‌ها بین پوشه‌ها " +"متفاوت است، یا نام‌هایی که :func:`os.stat` برای آن‌ها خطا گزارش می‌دهد." -msgid "Files which are identical in both *a* and *b*, using the class's file comparison operator." +msgid "" +"Files which are identical in both *a* and *b*, using the class's file " +"comparison operator." msgstr "" +"فایل‌هایی که در هر دو *a* و *b* یکسان هستند، با استفاده از عملگر مقایسه‌ی " +"فایلِ کلاس." -msgid "Files which are in both *a* and *b*, whose contents differ according to the class's file comparison operator." +msgid "" +"Files which are in both *a* and *b*, whose contents differ according to the " +"class's file comparison operator." msgstr "" +"فایل‌هایی که در هر دو *a* و *b* وجود دارند و محتوای آن‌ها بر اساس عملگر " +"مقایسه‌ی فایلِ کلاس متفاوت است." msgid "Files which are in both *a* and *b*, but could not be compared." -msgstr "" +msgstr "فایل‌هایی که در هر دو *a* و *b* وجود دارند، اما قابل مقایسه نبودند." -msgid "A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` instances (or MyDirCmp instances if this instance is of type MyDirCmp, a subclass of :class:`dircmp`)." +msgid "" +"A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` " +"instances (or MyDirCmp instances if this instance is of type MyDirCmp, a " +"subclass of :class:`dircmp`)." msgstr "" +"دیکشنری‌ای که نام‌های موجود در :attr:`common_dirs` را به نمونه‌های " +":class:`dircmp` نگاشت می‌کند (یا به نمونه‌های MyDirCmp، در صورتی که این " +"نمونه از نوع MyDirCmp، که یک کلاس فرعی از :class:`dircmp` است، باشد)." -msgid "Previously entries were always :class:`dircmp` instances. Now entries are the same type as *self*, if *self* is a subclass of :class:`dircmp`." +msgid "" +"Previously entries were always :class:`dircmp` instances. Now entries are " +"the same type as *self*, if *self* is a subclass of :class:`dircmp`." msgstr "" +"پیش‌تر، مدخل‌ها همیشه نمونه‌های :class:`dircmp` بودند. اکنون مدخل‌ها همان " +"نوع *self* هستند، اگر *self* زیرکلاسی از :class:`dircmp` باشد." msgid "List of directories ignored by :class:`dircmp` by default." msgstr "" +"فهرست پوشه‌هایی که به‌طور پیش‌فرض توسط :class:`dircmp` نادیده گرفته می‌شوند." -msgid "Here is a simplified example of using the ``subdirs`` attribute to search recursively through two directories to show common different files::" +msgid "" +"Here is a simplified example of using the ``subdirs`` attribute to search " +"recursively through two directories to show common different files::" msgstr "" +"در اینجا یک مثال ساده‌شده از استفاده از ویژگی ``subdirs`` برای جستجوی " +"بازگشتی در دو پوشه جهت نمایش فایل‌های مشترک متفاوت آمده است::" msgid "" ">>> from filecmp import dircmp\n" @@ -156,3 +273,13 @@ msgid "" ">>> dcmp = dircmp('dir1', 'dir2')\n" ">>> print_diff_files(dcmp)" msgstr "" +">>> from filecmp import dircmp\n" +">>> def print_diff_files(dcmp):\n" +"... for name in dcmp.diff_files:\n" +"... print(\"diff_file %s found in %s and %s\" % (name, dcmp.left,\n" +"... dcmp.right))\n" +"... for sub_dcmp in dcmp.subdirs.values():\n" +"... print_diff_files(sub_dcmp)\n" +"...\n" +">>> dcmp = dircmp('dir1', 'dir2')\n" +">>> print_diff_files(dcmp)" diff --git a/library/fileformats.po b/library/fileformats.po index a931f5a21..2d9c6dbda 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -22,7 +22,11 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "File Formats" -msgstr "" +msgstr "قالب‌های فایل" -msgid "The modules described in this chapter parse various miscellaneous file formats that aren't markup languages and are not related to e-mail." +msgid "" +"The modules described in this chapter parse various miscellaneous file " +"formats that aren't markup languages and are not related to e-mail." msgstr "" +"ماژول‌های توصیف‌شده در این فصل، قالب‌های فایل متفرقه و گوناگونی را تجزیه " +"می‌کنند که زبان‌های نمادگذاری نیستند و به ایمیل مربوط نمی‌شوند." diff --git a/library/fileinput.po b/library/fileinput.po index 1fd61d280..2248dedd6 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -22,147 +22,368 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!fileinput` --- Iterate over lines from multiple input streams" -msgstr "" +msgstr ":mod:`!fileinput` --- پیمایش خطوط از چندین جریان ورودی" msgid "**Source code:** :source:`Lib/fileinput.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/fileinput.py`" -msgid "This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see :func:`open`." +msgid "" +"This module implements a helper class and functions to quickly write a loop " +"over standard input or a list of files. If you just want to read or write " +"one file see :func:`open`." msgstr "" +"این ماژول یک کلاس کمکی و توابعی را پیاده‌سازی می‌کند تا به‌سرعت حلقه‌ای روی " +"ورودی استاندارد یا فهرستی از فایل‌ها بنویسید. اگر فقط می‌خواهید یک فایل را " +"بخوانید یا بنویسید، :func:`open` را ببینید." msgid "The typical use is::" -msgstr "" +msgstr "استفاده معمول به این صورت است::" msgid "" "import fileinput\n" "for line in fileinput.input(encoding=\"utf-8\"):\n" " process(line)" msgstr "" +"import fileinput\n" +"for line in fileinput.input(encoding=\"utf-8\"):\n" +" process(line)" -msgid "This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook* are ignored. To specify an alternative list of filenames, pass it as the first argument to :func:`.input`. A single file name is also allowed." -msgstr "" +msgid "" +"This iterates over the lines of all files listed in ``sys.argv[1:]``, " +"defaulting to ``sys.stdin`` if the list is empty. If a filename is ``'-'``," +" it is also replaced by ``sys.stdin`` and the optional arguments *mode* and " +"*openhook* are ignored. To specify an alternative list of filenames, pass " +"it as the first argument to :func:`.input`. A single file name is also " +"allowed." +msgstr "" +"این تابع بر خط‌های تمام فایل‌های فهرست‌شده در ``sys.argv[1:]`` پیمایش می‌کند" +" و اگر فهرست خالی باشد، به‌طور پیش‌فرض از ``sys.stdin`` استفاده می‌کند. اگر " +"نام فایل ``'-'`` باشد، آن نیز با ``sys.stdin`` جایگزین می‌شود و آرگومان‌های " +"اختیاری *mode* و *openhook* نادیده گرفته می‌شوند. برای مشخص کردن فهرستی " +"جایگزین از نام فایل‌ها، آن را به‌عنوان اولین آرگومان به :func:`.input` ارسال" +" کنید. یک نام فایل تکی نیز مجاز است." -msgid "All files are opened in text mode by default, but you can override this by specifying the *mode* parameter in the call to :func:`.input` or :class:`FileInput`. If an I/O error occurs during opening or reading a file, :exc:`OSError` is raised." +msgid "" +"All files are opened in text mode by default, but you can override this by " +"specifying the *mode* parameter in the call to :func:`.input` or " +":class:`FileInput`. If an I/O error occurs during opening or reading a " +"file, :exc:`OSError` is raised." msgstr "" +"همه‌ی فایل‌ها به‌طور پیش‌فرض در حالت متنی باز می‌شوند، اما شما می‌توانید با " +"تعیین پارامتر *mode* در فراخوانی :func:`.input` یا :class:`FileInput` این " +"پیش‌فرض را تغییر دهید. اگر هنگام باز کردن یا خواندن یک فایل، خطای I/O رخ " +"دهد، :exc:`OSError` پرتاب می‌شود." -msgid ":exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`." +msgid "" +":exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`." msgstr "" +":exc:`IOError` پیش‌تر پرتاب می‌شد؛ اکنون نام مستعاری از :exc:`OSError` است." -msgid "If ``sys.stdin`` is used more than once, the second and further use will return no lines, except perhaps for interactive use, or if it has been explicitly reset (e.g. using ``sys.stdin.seek(0)``)." +msgid "" +"If ``sys.stdin`` is used more than once, the second and further use will " +"return no lines, except perhaps for interactive use, or if it has been " +"explicitly reset (e.g. using ``sys.stdin.seek(0)``)." msgstr "" +"اگر از ``sys.stdin`` بیش از یک بار استفاده شود، استفاده‌ی دوم و استفاده‌های " +"بعدی هیچ خطی را برنمی‌گردانند، مگر شاید در استفاده‌ی تعاملی، یا اگر به‌صراحت" +" بازنشانی شده باشد (مثلاً با استفاده از ``sys.stdin.seek(0)``)." -msgid "Empty files are opened and immediately closed; the only time their presence in the list of filenames is noticeable at all is when the last file opened is empty." +msgid "" +"Empty files are opened and immediately closed; the only time their presence " +"in the list of filenames is noticeable at all is when the last file opened " +"is empty." msgstr "" +"فایل‌های خالی باز می‌شوند و بلافاصله بسته می‌شوند؛ تنها زمانی وجود آن‌ها در " +"فهرست نام فایل‌ها اصلاً محسوس است که آخرین فایل بازشده خالی باشد." -msgid "Lines are returned with any newlines intact, which means that the last line in a file may not have one." +msgid "" +"Lines are returned with any newlines intact, which means that the last line " +"in a file may not have one." msgstr "" +"خط‌ها به‌همراه نویسه‌های خط جدید دست‌نخورده بازگردانده می‌شوند؛ این بدان " +"معناست که ممکن است آخرین خط یک فایل فاقد آن باشد." -msgid "You can control how files are opened by providing an opening hook via the *openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The hook must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. If *encoding* and/or *errors* are specified, they will be passed to the hook as additional keyword arguments. This module provides a :func:`hook_compressed` to support compressed files." -msgstr "" +msgid "" +"You can control how files are opened by providing an opening hook via the " +"*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The " +"hook must be a function that takes two arguments, *filename* and *mode*, and" +" returns an accordingly opened file-like object. If *encoding* and/or " +"*errors* are specified, they will be passed to the hook as additional " +"keyword arguments. This module provides a :func:`hook_compressed` to support" +" compressed files." +msgstr "" +"شما می‌توانید با فراهم کردن یک هوک باز کردن (opening hook) از طریق پارامتر " +"*openhook* به :func:`fileinput.input` یا :func:`FileInput`، چگونگی باز شدن " +"فایل‌ها را کنترل کنید. هوک باید تابعی باشد که دو آرگومان، *filename* و " +"*mode*، را دریافت می‌کند و شیء شبه‌فایلی را که به‌صورت متناسب باز شده است " +"برمی‌گرداند. اگر *encoding* و/یا *errors* تعیین شده باشند، آن‌ها به‌عنوان " +"آرگومان‌های کلیدواژه‌ای اضافی به هوک ارسال می‌شوند. این ماژول " +":func:`hook_compressed` را برای پشتیبانی از فایل‌های فشرده فراهم می‌کند." msgid "The following function is the primary interface of this module:" -msgstr "" +msgstr "تابع زیر رابط اصلی این ماژول است:" -msgid "Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use during iteration. The parameters to this function will be passed along to the constructor of the :class:`FileInput` class." +msgid "" +"Create an instance of the :class:`FileInput` class. The instance will be " +"used as global state for the functions of this module, and is also returned " +"to use during iteration. The parameters to this function will be passed " +"along to the constructor of the :class:`FileInput` class." msgstr "" +"یک نمونه از کلاس :class:`FileInput` ایجاد می‌کند. این نمونه به‌عنوان وضعیت " +"سراسری برای توابع این ماژول استفاده می‌شود و همچنین برای استفاده در حین " +"تکرار بازگردانده می‌شود. پارامترهای این تابع به سازنده‌ی کلاس " +":class:`FileInput` منتقل می‌شوند." -msgid "The :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs::" +msgid "" +"The :class:`FileInput` instance can be used as a context manager in the " +":keyword:`with` statement. In this example, *input* is closed after the " +":keyword:`!with` statement is exited, even if an exception occurs::" msgstr "" +"می‌توان از نمونه‌ی :class:`FileInput` به‌عنوان مدیر زمینه در دستور " +":keyword:`with` استفاده کرد. در این مثال، *input* پس از خروج از دستور " +":keyword:`!with` بسته می‌شود، حتی اگر استثنایی رخ دهد::" msgid "" "with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as f:\n" " for line in f:\n" " process(line)" msgstr "" +"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as f:\n" +" for line in f:\n" +" process(line)" msgid "Can be used as a context manager." -msgstr "" +msgstr "می‌تواند به‌عنوان یک مدیر زمینه استفاده شود." msgid "The keyword parameters *mode* and *openhook* are now keyword-only." msgstr "" +"پارامترهای کلیدواژه‌ای *mode* و *openhook* اکنون فقط کلیدواژه‌ای هستند." msgid "The keyword-only parameter *encoding* and *errors* are added." -msgstr "" +msgstr "پارامترهای فقط کلیدواژه‌ای *encoding* و *errors* افزوده شدند." -msgid "The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised." +msgid "" +"The following functions use the global state created by " +":func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is" +" raised." msgstr "" +"توابع زیر از وضعیت سراسری ایجادشده توسط :func:`fileinput.input` استفاده " +"می‌کنند؛ اگر وضعیت فعالی وجود نداشته باشد، :exc:`RuntimeError` پرتاب می‌شود." -msgid "Return the name of the file currently being read. Before the first line has been read, returns ``None``." +msgid "" +"Return the name of the file currently being read. Before the first line has" +" been read, returns ``None``." msgstr "" +"نام فایلی را که در حال حاضر خوانده می‌شود برمی‌گرداند. پیش از خوانده شدن خط " +"اول، ``None`` را برمی‌گرداند." -msgid "Return the integer \"file descriptor\" for the current file. When no file is opened (before the first line and between files), returns ``-1``." +msgid "" +"Return the integer \"file descriptor\" for the current file. When no file is" +" opened (before the first line and between files), returns ``-1``." msgstr "" +"عدد صحیح «توصیف‌گر فایل» (file descriptor) برای فایل جاری را برمی‌گرداند. " +"هنگامی که هیچ فایلی باز نیست (پیش از نخستین خط و میان فایل‌ها)، ``-1`` را " +"برمی‌گرداند." -msgid "Return the cumulative line number of the line that has just been read. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line." +msgid "" +"Return the cumulative line number of the line that has just been read. " +"Before the first line has been read, returns ``0``. After the last line of " +"the last file has been read, returns the line number of that line." msgstr "" +"شماره‌ی خط تجمعیِ خطی را که به‌تازگی خوانده شده است برمی‌گرداند. پیش از " +"خوانده شدن نخستین خط، ``0`` را برمی‌گرداند. پس از خوانده شدن آخرین خط از " +"آخرین فایل، شماره آن خط را برمی‌گرداند." -msgid "Return the line number in the current file. Before the first line has been read, returns ``0``. After the last line of the last file has been read, returns the line number of that line within the file." +msgid "" +"Return the line number in the current file. Before the first line has been " +"read, returns ``0``. After the last line of the last file has been read, " +"returns the line number of that line within the file." msgstr "" +"شماره‌ی خط در فایل جاری را برمی‌گرداند. پیش از خوانده شدن اولین خط، ``0`` را" +" برمی‌گرداند. پس از خوانده شدن آخرین خط از آخرین فایل، شماره‌ی آن خط در آن " +"فایل را برمی‌گرداند." -msgid "Return ``True`` if the line just read is the first line of its file, otherwise return ``False``." +msgid "" +"Return ``True`` if the line just read is the first line of its file, " +"otherwise return ``False``." msgstr "" +"اگر خطی که به‌تازگی خوانده شده است اولین خط فایل خود باشد، ``True`` " +"برمی‌گرداند، در غیر این صورت ``False`` برمی‌گرداند." -msgid "Return ``True`` if the last line was read from ``sys.stdin``, otherwise return ``False``." +msgid "" +"Return ``True`` if the last line was read from ``sys.stdin``, otherwise " +"return ``False``." msgstr "" +"اگر آخرین خط از ``sys.stdin`` خوانده شده باشد، ``True`` را برمی‌گرداند، در " +"غیر این صورت ``False`` را برمی‌گرداند." -msgid "Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before the first line has been read, this function has no effect; it cannot be used to skip the first file. After the last line of the last file has been read, this function has no effect." -msgstr "" +msgid "" +"Close the current file so that the next iteration will read the first line " +"from the next file (if any); lines not read from the file will not count " +"towards the cumulative line count. The filename is not changed until after " +"the first line of the next file has been read. Before the first line has " +"been read, this function has no effect; it cannot be used to skip the first " +"file. After the last line of the last file has been read, this function has" +" no effect." +msgstr "" +"فایل جاری را می‌بندد تا در تکرار بعدی، اولین خط از فایل بعدی (در صورت وجود) " +"خوانده شود؛ خطوطی که از فایل خوانده نشده‌اند، در شمارش تجمعی خطوط به حساب " +"نمی‌آیند. نام فایل تا پس از خوانده شدن اولین خط از فایل بعدی تغییر نمی‌کند. " +"پیش از خوانده شدن اولین خط، این تابع هیچ اثری ندارد؛ نمی‌توان از آن برای پرش" +" از اولین فایل استفاده کرد. پس از خوانده شدن آخرین خط از آخرین فایل، این " +"تابع هیچ اثری ندارد." msgid "Close the sequence." -msgstr "" +msgstr "دنباله را ببندید." -msgid "The class which implements the sequence behavior provided by the module is available for subclassing as well:" +msgid "" +"The class which implements the sequence behavior provided by the module is " +"available for subclassing as well:" msgstr "" +"کلاسی که رفتار دنباله‌ای ارائه‌شده توسط ماژول را پیاده‌سازی می‌کند، برای " +"زیرکلاس‌سازی نیز در دسترس است:" -msgid "Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` correspond to the functions of the same name in the module. In addition it is :term:`iterable` and has a :meth:`~io.TextIOBase.readline` method which returns the next input line. The sequence must be accessed in strictly sequential order; random access and :meth:`~io.TextIOBase.readline` cannot be mixed." -msgstr "" +msgid "" +"Class :class:`FileInput` is the implementation; its methods " +":meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, " +":meth:`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` " +"correspond to the functions of the same name in the module. In addition it " +"is :term:`iterable` and has a :meth:`~io.TextIOBase.readline` method which " +"returns the next input line. The sequence must be accessed in strictly " +"sequential order; random access and :meth:`~io.TextIOBase.readline` cannot " +"be mixed." +msgstr "" +"کلاس :class:`FileInput` پیاده‌سازی است؛ متدهای آن :meth:`filename`، " +":meth:`fileno`، :meth:`lineno`، :meth:`filelineno`، :meth:`isfirstline`، " +":meth:`isstdin`، :meth:`nextfile` و :meth:`close` با توابع هم‌نام در ماژول " +"مطابقت دارند. علاوه بر این، این کلاس :term:`پیمایش‌پذیر ` است و یک " +"متد :meth:`~io.TextIOBase.readline` دارد که خط ورودی بعدی را برمی‌گرداند. " +"این دنباله باید اکیداً به ترتیب پیاپی دسترسی یابد؛ دسترسی تصادفی و " +":meth:`~io.TextIOBase.readline` نمی‌توانند با هم ترکیب شوند." -msgid "With *mode* you can specify which file mode will be passed to :func:`open`. It must be one of ``'r'`` and ``'rb'``." +msgid "" +"With *mode* you can specify which file mode will be passed to :func:`open`. " +"It must be one of ``'r'`` and ``'rb'``." msgstr "" +"با *mode* می‌توانید مشخص کنید که کدام حالت فایل به :func:`open` ارسال " +"می‌شود. این مقدار باید یکی از ``'r'`` و ``'rb'`` باشد." -msgid "The *openhook*, when given, must be a function that takes two arguments, *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together." +msgid "" +"The *openhook*, when given, must be a function that takes two arguments, " +"*filename* and *mode*, and returns an accordingly opened file-like object. " +"You cannot use *inplace* and *openhook* together." msgstr "" +"*openhook*، در صورت ارائه، باید تابعی باشد که دو آرگومان *filename* و *mode*" +" را می‌گیرد و یک شیء شبه‌فایل را که به‌طور متناسب بازشده است برمی‌گرداند. " +"شما نمی‌توانید *inplace* و *openhook* را با هم استفاده کنید." -msgid "You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*." +msgid "" +"You can specify *encoding* and *errors* that is passed to :func:`open` or " +"*openhook*." msgstr "" +"می‌توانید *encoding* و *errors* را که به :func:`open` یا *openhook* فرستاده " +"می‌شوند، مشخص کنید." -msgid "A :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs::" +msgid "" +"A :class:`FileInput` instance can be used as a context manager in the " +":keyword:`with` statement. In this example, *input* is closed after the " +":keyword:`!with` statement is exited, even if an exception occurs::" msgstr "" +"یک نمونه از :class:`FileInput` می‌تواند به‌عنوان مدیر زمینه در دستور " +":keyword:`with` استفاده شود. در این مثال، *input* پس از خروج از دستور " +":keyword:`!with` بسته می‌شود، حتی اگر یک استثنا رخ دهد::" msgid "" "with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" " process(input)" msgstr "" +"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" +" process(input)" msgid "The keyword parameter *mode* and *openhook* are now keyword-only." -msgstr "" +msgstr "پارامترهای *mode* و *openhook* اکنون فقط کلیدواژه‌ای هستند." -msgid "The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been removed." -msgstr "" +msgid "" +"The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been" +" removed." +msgstr "حالت‌های ``'rU'`` و ``'U'`` و متد :meth:`!__getitem__` حذف شده‌اند." -msgid "**Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is moved to a backup file and standard output is directed to the input file (if a file of the same name as the backup file already exists, it will be replaced silently). This makes it possible to write a filter that rewrites its input file in place. If the *backup* parameter is given (typically as ``backup='.'``), it specifies the extension for the backup file, and the backup file remains around; by default, the extension is ``'.bak'`` and it is deleted when the output file is closed. In-place filtering is disabled when standard input is read." -msgstr "" +msgid "" +"**Optional in-place filtering:** if the keyword argument ``inplace=True`` is" +" passed to :func:`fileinput.input` or to the :class:`FileInput` constructor," +" the file is moved to a backup file and standard output is directed to the " +"input file (if a file of the same name as the backup file already exists, it" +" will be replaced silently). This makes it possible to write a filter that " +"rewrites its input file in place. If the *backup* parameter is given " +"(typically as ``backup='.'``), it specifies the extension " +"for the backup file, and the backup file remains around; by default, the " +"extension is ``'.bak'`` and it is deleted when the output file is closed. " +"In-place filtering is disabled when standard input is read." +msgstr "" +"**فیلتر کردن اختیاری درجا:** اگر آرگومان کلیدواژه‌ای ``inplace=True`` به " +":func:`fileinput.input` یا به سازنده‌ی :class:`FileInput` داده شود، فایل به " +"یک فایل پشتیبان منتقل می‌شود و خروجی استاندارد به فایل ورودی هدایت می‌شود " +"(اگر فایلی با همان نام فایل پشتیبان از قبل وجود داشته باشد، به‌صورت بی‌صدا " +"جایگزین می‌شود). این کار نوشتن فیلتری را ممکن می‌سازد که فایل ورودی خود را " +"درجا بازنویسی کند. اگر پارامتر *backup* داده شود (معمولاً به‌صورت " +"``backup='.'``)، پسوند فایل پشتیبان را مشخص می‌کند و فایل " +"پشتیبان باقی می‌ماند؛ به‌طور پیش‌فرض، پسوند ``'.bak'`` است و فایل پشتیبان " +"وقتی فایل خروجی بسته می‌شود، حذف می‌شود. فیلتر کردن درجا هنگامی که ورودی " +"استاندارد خوانده می‌شود، غیرفعال است." msgid "The two following opening hooks are provided by this module:" -msgstr "" +msgstr "این ماژول دو قلاببازکننده‌ی زیر را فراهم می‌کند:" -msgid "Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression)." +msgid "" +"Transparently opens files compressed with gzip and bzip2 (recognized by the " +"extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` " +"modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file" +" is opened normally (ie, using :func:`open` without any decompression)." msgstr "" +"به‌صورت شفاف فایل‌های فشرده‌شده با gzip و bzip2 را (که با پسوندهای " +"``'.gz'`` و ``'.bz2'`` شناخته می‌شوند) با استفاده از ماژول‌های :mod:`gzip` و" +" :mod:`bz2` باز می‌کند. اگر پسوند نام فایل ``'.gz'`` یا ``'.bz2'`` نباشد، " +"فایل به‌صورت عادی باز می‌شود (یعنی با استفاده از :func:`open` بدون هیچ‌گونه " +"خارج‌سازی از فشردگی)." -msgid "The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` for compressed files and open for normal files." +msgid "" +"The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` " +"for compressed files and open for normal files." msgstr "" +"مقادیر *encoding* و *errors* برای فایل‌های فشرده به " +":class:`io.TextIOWrapper` و برای فایل‌های عادی به open ارسال می‌شوند." -msgid "Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed, encoding=\"utf-8\")``" +msgid "" +"Usage example: ``fi = " +"fileinput.FileInput(openhook=fileinput.hook_compressed, " +"encoding=\"utf-8\")``" msgstr "" +"مثال استفاده: ``fi = " +"fileinput.FileInput(openhook=fileinput.hook_compressed, " +"encoding=\"utf-8\")``" -msgid "Returns a hook which opens each file with :func:`open`, using the given *encoding* and *errors* to read the file." +msgid "" +"Returns a hook which opens each file with :func:`open`, using the given " +"*encoding* and *errors* to read the file." msgstr "" +"قلابی را برمی‌گرداند که هر فایل را با :func:`open` باز می‌کند و برای خواندن " +"فایل، از *encoding* و *errors* داده‌شده استفاده می‌کند." -msgid "Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_encoded(\"utf-8\", \"surrogateescape\"))``" +msgid "" +"Usage example: ``fi = " +"fileinput.FileInput(openhook=fileinput.hook_encoded(\"utf-8\", " +"\"surrogateescape\"))``" msgstr "" +"مثال استفاده: ``fi = " +"fileinput.FileInput(openhook=fileinput.hook_encoded(\"utf-8\", " +"\"surrogateescape\"))``" msgid "Added the optional *errors* parameter." -msgstr "" +msgstr "پارامتر اختیاری *errors* افزوده شد." -msgid "This function is deprecated since :func:`fileinput.input` and :class:`FileInput` now have *encoding* and *errors* parameters." +msgid "" +"This function is deprecated since :func:`fileinput.input` and " +":class:`FileInput` now have *encoding* and *errors* parameters." msgstr "" +"این تابع منسوخ شده است، زیرا :func:`fileinput.input` و :class:`FileInput` " +"اکنون پارامترهای *encoding* و *errors* دارند." diff --git a/library/filesys.po b/library/filesys.po index 136f703df..90e2ff118 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -22,25 +22,41 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "File and Directory Access" -msgstr "" +msgstr "دسترسی به فایل و پوشه" -msgid "The modules described in this chapter deal with disk files and directories. For example, there are modules for reading the properties of files, manipulating paths in a portable way, and creating temporary files. The full list of modules in this chapter is:" +msgid "" +"The modules described in this chapter deal with disk files and directories." +" For example, there are modules for reading the properties of files, " +"manipulating paths in a portable way, and creating temporary files. The " +"full list of modules in this chapter is:" msgstr "" +"ماژول‌های توصیف‌شده در این فصل با فایل‌ها و پوشه‌های دیسک سروکار دارند. برای" +" مثال، ماژول‌هایی برای خواندن ویژگی‌های فایل‌ها، دستکاری مسیرها به‌شکلی " +"قابل‌حمل، و ایجاد فایل‌های موقت وجود دارد. فهرست کامل ماژول‌های این فصل " +"عبارت است از:" msgid "Module :mod:`os`" -msgstr "" +msgstr "ماژول :mod:`os`" -msgid "Operating system interfaces, including functions to work with files at a lower level than Python :term:`file objects `." +msgid "" +"Operating system interfaces, including functions to work with files at a " +"lower level than Python :term:`file objects `." msgstr "" +"رابط‌های سیستم‌عامل، از جمله توابعی برای کار با فایل‌ها در سطحی پایین‌تر از " +":term:`اشیای فایل ` پایتون." msgid "Module :mod:`io`" -msgstr "" +msgstr "ماژول :mod:`io`" -msgid "Python's built-in I/O library, including both abstract classes and some concrete classes such as file I/O." +msgid "" +"Python's built-in I/O library, including both abstract classes and some " +"concrete classes such as file I/O." msgstr "" +"کتابخانه‌ی I/O توکار پایتون، شامل هر دو دسته کلاس‌های انتزاعی و برخی کلاس‌های" +" عینی، مانند I/O فایل." msgid "Built-in function :func:`open`" -msgstr "" +msgstr "تابع توکار :func:`open`" msgid "The standard way to open files for reading and writing with Python." -msgstr "" +msgstr "روش استاندارد برای باز کردن فایل‌ها جهت خواندن و نوشتن با پایتون." diff --git a/library/fnmatch.po b/library/fnmatch.po index 8d96b43ec..bee872358 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -24,61 +24,112 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!fnmatch` --- Unix filename pattern matching" -msgstr "" +msgstr ":mod:`!fnmatch` --- تطبیق الگوی نام‌فایل یونیکس" msgid "**Source code:** :source:`Lib/fnmatch.py`" -msgstr "" +msgstr ":source:`Lib/fnmatch.py`" -msgid "This module provides support for Unix shell-style wildcards, which are *not* the same as regular expressions (which are documented in the :mod:`re` module). The special characters used in shell-style wildcards are:" +msgid "" +"This module provides support for Unix shell-style wildcards, which are *not*" +" the same as regular expressions (which are documented in the :mod:`re` " +"module). The special characters used in shell-style wildcards are:" msgstr "" +"این ماژول از وایلدکارد به‌سبک پوسته یونیکس پشتیبانی می‌کند، " +"که با عبارات باقاعده (که در ماژول :mod:`re` مستند شده‌اند) *یکسان نیستند*. " +"نویسه‌های ویژه استفاده‌شده در وایلدکارد به‌سبک پوسته عبارتند از:" msgid "Pattern" -msgstr "" +msgstr "الگو" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``*``" -msgstr "" +msgstr "``*``" msgid "matches everything" -msgstr "" +msgstr "با همه‌چیز مطابقت دارد" msgid "``?``" -msgstr "" +msgstr "``?``" msgid "matches any single character" -msgstr "" +msgstr "با هر نویسه‌ی منفرد تطابق دارد" msgid "``[seq]``" -msgstr "" +msgstr "``[seq]``" msgid "matches any character in *seq*" -msgstr "" +msgstr "با هر نویسه‌ای در *seq* مطابقت می‌کند" msgid "``[!seq]``" -msgstr "" +msgstr "``[!seq]``" msgid "matches any character not in *seq*" -msgstr "" +msgstr "با هر نویسه‌ای که در *seq* نباشد، مطابقت می‌کند" -msgid "For a literal match, wrap the meta-characters in brackets. For example, ``'[?]'`` matches the character ``'?'``." +msgid "" +"For a literal match, wrap the meta-characters in brackets. For example, " +"``'[?]'`` matches the character ``'?'``." msgstr "" +"برای تطبیق لفظی، فرانویسه‌ها را در براکت قرار دهید. برای مثال، ``'[?]'`` با" +" نویسه‌ی ``'?'`` مطابقت دارد." -msgid "Note that the filename separator (``'/'`` on Unix) is *not* special to this module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses :func:`.filter` to match pathname segments). Similarly, filenames starting with a period are not special for this module, and are matched by the ``*`` and ``?`` patterns." -msgstr "" +msgid "" +"Note that the filename separator (``'/'`` on Unix) is *not* special to this " +"module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses " +":func:`.filter` to match pathname segments). Similarly, filenames starting " +"with a period are not special for this module, and are matched by the ``*`` " +"and ``?`` patterns." +msgstr "" +"توجه داشته باشید که جداکننده نام فایل (``'/'`` در یونیکس) برای این ماژول " +"ویژه *نیست*. برای بسط مسیر، ماژول :mod:`glob` را ببینید (:mod:`glob` از " +":func:`.filter` برای تطبیق بخش‌های مسیر استفاده می‌کند). به‌طور مشابه، " +"فایل‌هایی که نامشان با یک نقطه شروع می‌شود، برای این ماژول ویژه نیستند و با " +"الگوهای ``*`` و ``?`` تطبیق داده می‌شوند." -msgid "Unless stated otherwise, \"filename string\" and \"pattern string\" either refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note that the functions documented below do not allow to mix a :class:`!bytes` pattern with a :class:`!str` filename, and vice-versa." +msgid "" +"Unless stated otherwise, \"filename string\" and \"pattern string\" either " +"refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note" +" that the functions documented below do not allow to mix a :class:`!bytes` " +"pattern with a :class:`!str` filename, and vice-versa." msgstr "" +"مگر آنکه خلاف آن ذکر شده باشد، «رشته‌ی نام فایل» و «رشته‌ی الگو» هر یک به " +"اشیای :class:`str` یا اشیای :class:`bytes` کدگذاری‌شده با ``ISO-8859-1`` " +"اشاره دارند. توجه داشته باشید که توابع مستندشده در زیر اجازه نمی‌دهند یک " +"الگوی :class:`!bytes` را با یک نام فایل :class:`!str` ترکیب کنید، و برعکس." -msgid "Finally, note that :deco:`functools.lru_cache` with a *maxsize* of 32768 is used to cache the (typed) compiled regex patterns in the following functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filterfalse`." +msgid "" +"Finally, note that :deco:`functools.lru_cache` with a *maxsize* of 32768 is " +"used to cache the (typed) compiled regex patterns in the following " +"functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, " +":func:`.filterfalse`." msgstr "" +"در نهایت، توجه داشته باشید که :deco:`functools.lru_cache` با *maxsize* برابر" +" ۳۲۷۶۸ برای نهانگاه‌سازی الگوهای regex کامپایل‌شده (تایپ‌شده) در توابع زیر " +"استفاده می‌شود: :func:`fnmatch`، :func:`fnmatchcase`، :func:`.filter`، " +":func:`.filterfalse`." -msgid "Test whether the filename string *name* matches the pattern string *pat*, returning ``True`` or ``False``. Both parameters are case-normalized using :func:`os.path.normcase`. :func:`fnmatchcase` can be used to perform a case-sensitive comparison, regardless of whether that's standard for the operating system." -msgstr "" +msgid "" +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``. Both parameters are case-normalized using " +":func:`os.path.normcase`. :func:`fnmatchcase` can be used to perform a case-" +"sensitive comparison, regardless of whether that's standard for the " +"operating system." +msgstr "" +"بررسی می‌کند که آیا رشته‌ی نام فایل *name* با رشته‌ی الگو *pat* مطابقت دارد " +"یا خیر، و ``True`` یا ``False`` برمی‌گرداند. هر دو پارامتر با استفاده از " +":func:`os.path.normcase` از نظر بزرگی و کوچکی حروف نرمال‌سازی می‌شوند. " +"می‌توان از :func:`fnmatchcase` برای انجام مقایسه‌ی حساس به بزرگی و کوچکی " +"حروف استفاده کرد، صرف‌نظر از اینکه این مقایسه برای سیستم‌عامل استاندارد باشد" +" یا خیر." -msgid "This example will print all file names in the current directory with the extension ``.txt``::" +msgid "" +"This example will print all file names in the current directory with the " +"extension ``.txt``::" msgstr "" +"این مثال تمام نام فایل‌های موجود در پوشه جاری با پسوند ``.txt`` را چاپ " +"می‌کند::" msgid "" "import fnmatch\n" @@ -88,57 +139,84 @@ msgid "" " if fnmatch.fnmatch(file, '*.txt'):\n" " print(file)" msgstr "" +"import fnmatch\n" +"import os\n" +"\n" +"for file in os.listdir('.'):\n" +" if fnmatch.fnmatch(file, '*.txt'):\n" +" print(file)" -msgid "Test whether the filename string *name* matches the pattern string *pat*, returning ``True`` or ``False``; the comparison is case-sensitive and does not apply :func:`os.path.normcase`." +msgid "" +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``; the comparison is case-sensitive and does " +"not apply :func:`os.path.normcase`." msgstr "" +"آزمایش می‌کند که آیا رشته‌ی نام فایل *name* با رشته‌ی الگوی *pat* مطابقت " +"دارد، و ``True`` یا ``False`` را برمی‌گرداند؛ این مقایسه حساس به بزرگی و " +"کوچکی حروف است و :func:`os.path.normcase` را اعمال نمی‌کند." -msgid "Construct a list from those elements of the :term:`iterable` of filename strings *names* that match the pattern string *pat*. It is the same as ``[n for n in names if fnmatch(n, pat)]``, but implemented more efficiently." +msgid "" +"Construct a list from those elements of the :term:`iterable` of filename " +"strings *names* that match the pattern string *pat*. It is the same as ``[n " +"for n in names if fnmatch(n, pat)]``, but implemented more efficiently." msgstr "" +"فهرستی از آن عناصرِ :term:`پیمایش‌پذیر ` *names* از رشته‌های نام " +"فایل که با رشته‌ی الگو *pat* مطابقت دارند، می‌سازد. این معادل ``[n for n in " +"names if fnmatch(n, pat)]`` است، اما به‌صورت کارآمدتری پیاده‌سازی شده است." -msgid "Construct a list from those elements of the :term:`iterable` of filename strings *names* that do not match the pattern string *pat*. It is the same as ``[n for n in names if not fnmatch(n, pat)]``, but implemented more efficiently." +msgid "" +"Construct a list from those elements of the :term:`iterable` of filename " +"strings *names* that do not match the pattern string *pat*. It is the same " +"as ``[n for n in names if not fnmatch(n, pat)]``, but implemented more " +"efficiently." msgstr "" +"فهرستی از آن عناصر :term:`پیمایش‌پذیر ` از رشته‌های نام فایل *names* می‌سازد که با رشته‌ی الگو *pat* مطابقت ندارند. این معادل ``[n for n in names if not fnmatch(n, pat)]`` است، اما به‌صورت کارآمدتری پیاده‌سازی شده است." -msgid "Return the shell-style pattern *pat* converted to a regular expression for using with :func:`re.match`. The pattern is expected to be a :class:`str`." +msgid "" +"Return the shell-style pattern *pat* converted to a regular expression for " +"using with :func:`re.match`. The pattern is expected to be a :class:`str`." msgstr "" +"الگوی سبک پوسته *pat* را به‌صورت یک عبارت باقاعده برای استفاده با " +":func:`re.match` برمی‌گرداند. انتظار می‌رود الگو یک :class:`str` باشد." msgid "Example:" -msgstr "" +msgstr "مثال:" msgid "Module :mod:`glob`" -msgstr "" +msgstr "ماژول :mod:`glob`" msgid "Unix shell-style path expansion." -msgstr "" +msgstr "بسط مسیر به سبک پوسته‌ی یونیکس." msgid "filenames" -msgstr "" +msgstr "نام فایل‌ها" msgid "wildcard expansion" -msgstr "" +msgstr "بسط وایلدکارد" msgid "module" -msgstr "" +msgstr "ماژول" msgid "re" -msgstr "" +msgstr "re" msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" msgid "in glob-style wildcards" -msgstr "" +msgstr "در وایلدکارد به‌سبک glob" msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" msgid "[] (square brackets)" -msgstr "" +msgstr "[] (کروشه‌ها)" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" msgid "- (minus)" -msgstr "" +msgstr "- (منها)" msgid "glob" -msgstr "" +msgstr "glob" diff --git a/library/fractions.po b/library/fractions.po index c0d198fe0..44762bb79 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -24,31 +24,84 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!fractions` --- Rational numbers" -msgstr "" +msgstr ":mod:`!fractions` --- اعداد گویا" msgid "**Source code:** :source:`Lib/fractions.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/fractions.py`" -msgid "The :mod:`!fractions` module provides support for rational number arithmetic." -msgstr "" +msgid "" +"The :mod:`!fractions` module provides support for rational number " +"arithmetic." +msgstr "ماژول :mod:`!fractions` از حساب اعداد گویا پشتیبانی می‌کند." -msgid "A Fraction instance can be constructed from a pair of rational numbers, from a single number, or from a string." +msgid "" +"A Fraction instance can be constructed from a pair of rational numbers, from" +" a single number, or from a string." msgstr "" +"یک نمونه از Fraction می‌تواند از یک جفت عدد گویا، از یک عدد، یا از یک رشته " +"ساخته شود." -msgid "The first version requires that *numerator* and *denominator* are instances of :class:`numbers.Rational` and returns a new :class:`Fraction` instance with a value equal to ``numerator/denominator``. If *denominator* is zero, it raises a :exc:`ZeroDivisionError`." +msgid "" +"The first version requires that *numerator* and *denominator* are instances " +"of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " +"with a value equal to ``numerator/denominator``. If *denominator* is zero, " +"it raises a :exc:`ZeroDivisionError`." msgstr "" +"اولین نسخه نیاز دارد که *numerator* و *denominator* نمونه‌هایی از " +":class:`numbers.Rational` باشند و یک نمونه جدید از :class:`Fraction` را با " +"مقداری برابر با ``numerator/denominator`` برمی‌گرداند. اگر *denominator* صفر" +" باشد، :exc:`ZeroDivisionError` را پرتاب می‌کند." -msgid "The second version requires that *number* is an instance of :class:`numbers.Rational` or has the :meth:`!as_integer_ratio` method (this includes :class:`float` and :class:`decimal.Decimal`). It returns a :class:`Fraction` instance with exactly the same value. Assumed, that the :meth:`!as_integer_ratio` method returns a pair of coprime integers and last one is positive. Note that due to the usual issues with binary point (see :ref:`tut-fp-issues`), the argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so ``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might expect. (But see the documentation for the :meth:`limit_denominator` method below.)" -msgstr "" +msgid "" +"The second version requires that *number* is an instance of " +":class:`numbers.Rational` or has the :meth:`!as_integer_ratio` method (this " +"includes :class:`float` and :class:`decimal.Decimal`). It returns a " +":class:`Fraction` instance with exactly the same value. Assumed, that the " +":meth:`!as_integer_ratio` method returns a pair of coprime integers and last" +" one is positive. Note that due to the usual issues with binary point (see " +":ref:`tut-fp-issues`), the argument to ``Fraction(1.1)`` is not exactly " +"equal to 11/10, and so ``Fraction(1.1)`` does *not* return ``Fraction(11, " +"10)`` as one might expect. (But see the documentation for the " +":meth:`limit_denominator` method below.)" +msgstr "" +"نسخه دوم مستلزم آن است که *number* نمونه‌ای از :class:`numbers.Rational` " +"باشد یا دارای متد :meth:`!as_integer_ratio` باشد (این شامل :class:`float` و " +":class:`decimal.Decimal` می‌شود). این نسخه یک نمونه :class:`Fraction` با " +"دقیقاً همان مقدار برمی‌گرداند. فرض می‌شود که متد :meth:`!as_integer_ratio` " +"جفتی از اعداد صحیح اول نسبت به هم برمی‌گرداند و دومی مثبت است. توجه داشته " +"باشید که به دلیل مسائل معمول ممیز دودویی (به :ref:`tut-fp-issues` مراجعه " +"کنید)، آرگومان ``Fraction(1.1)`` دقیقاً برابر با ۱۱/۱۰ نیست، و بنابراین " +"``Fraction(1.1)``، ``Fraction(11, 10)`` را آن‌گونه که ممکن است انتظار رود " +"*برنمی‌گرداند*. (اما مستندات متد :meth:`limit_denominator` را در زیر " +"ببینید.)" -msgid "The last version of the constructor expects a string. The usual form for this instance is::" +msgid "" +"The last version of the constructor expects a string. The usual form for " +"this instance is::" msgstr "" +"آخرین نسخه‌ی سازنده انتظار یک رشته را دارد. شکل معمول برای این نمونه به این " +"صورت است::" msgid "[sign] numerator ['/' denominator]" -msgstr "" +msgstr "[علامت] صورت ['/' مخرج]" -msgid "where the optional ``sign`` may be either '+' or '-' and ``numerator`` and ``denominator`` (if present) are strings of decimal digits (underscores may be used to delimit digits as with integral literals in code). In addition, any string that represents a finite value and is accepted by the :class:`float` constructor is also accepted by the :class:`Fraction` constructor. In either form the input string may also have leading and/or trailing whitespace. Here are some examples::" -msgstr "" +msgid "" +"where the optional ``sign`` may be either '+' or '-' and ``numerator`` and " +"``denominator`` (if present) are strings of decimal digits (underscores may " +"be used to delimit digits as with integral literals in code). In addition, " +"any string that represents a finite value and is accepted by the " +":class:`float` constructor is also accepted by the :class:`Fraction` " +"constructor. In either form the input string may also have leading and/or " +"trailing whitespace. Here are some examples::" +msgstr "" +"که در آن ``sign`` اختیاری می‌تواند '+' یا '-' باشد و ``numerator`` و " +"``denominator`` (در صورت وجود) رشته‌هایی از ارقام ده‌دهی هستند (می‌توان از " +"زیرخط‌ها برای جدا کردن ارقام استفاده کرد، همان‌طور که در لفظ‌های عدد صحیح در" +" کد استفاده می‌شود). علاوه بر این، هر رشته‌ای که نشان‌دهنده‌ی یک مقدار متناهی" +" باشد و توسط سازنده‌ی :class:`float` پذیرفته شود، توسط سازنده‌ی " +":class:`Fraction` نیز پذیرفته می‌شود. در هر یک از این قالب‌ها، رشته‌ی ورودی " +"همچنین می‌تواند در ابتدا و/یا انتها دارای فضای خالی باشد. در اینجا چند مثال " +"آمده است::" msgid "" ">>> from fractions import Fraction\n" @@ -76,87 +129,242 @@ msgid "" ">>> Fraction(Decimal('1.1'))\n" "Fraction(11, 10)" msgstr "" +">>> from fractions import Fraction\n" +">>> Fraction(16, -10)\n" +"Fraction(-8, 5)\n" +">>> Fraction(123)\n" +"Fraction(123, 1)\n" +">>> Fraction()\n" +"Fraction(0, 1)\n" +">>> Fraction('3/7')\n" +"Fraction(3, 7)\n" +">>> Fraction(' -3/7 ')\n" +"Fraction(-3, 7)\n" +">>> Fraction('1.414213 \\t\\n')\n" +"Fraction(1414213, 1000000)\n" +">>> Fraction('-.125')\n" +"Fraction(-1, 8)\n" +">>> Fraction('7e-6')\n" +"Fraction(7, 1000000)\n" +">>> Fraction(2.25)\n" +"Fraction(9, 4)\n" +">>> Fraction(1.1)\n" +"Fraction(2476979795053773, 2251799813685248)\n" +">>> from decimal import Decimal\n" +">>> Fraction(Decimal('1.1'))\n" +"Fraction(11, 10)" -msgid "The :class:`Fraction` class inherits from the abstract base class :class:`numbers.Rational`, and implements all of the methods and operations from that class. :class:`Fraction` instances are :term:`hashable`, and should be treated as immutable. In addition, :class:`Fraction` has the following properties and methods:" -msgstr "" +msgid "" +"The :class:`Fraction` class inherits from the abstract base class " +":class:`numbers.Rational`, and implements all of the methods and operations " +"from that class. :class:`Fraction` instances are :term:`hashable`, and " +"should be treated as immutable. In addition, :class:`Fraction` has the " +"following properties and methods:" +msgstr "" +"کلاس :class:`Fraction` از کلاس پایه انتزاعی :class:`numbers.Rational` ارث " +"می‌برد و تمام متدها و عملیات‌های آن کلاس را پیاده‌سازی می‌کند. نمونه‌های " +":class:`Fraction`، :term:`hashable` هستند و باید به‌عنوان تغییرناپذیر در نظر" +" گرفته شوند. علاوه بر این، :class:`Fraction` دارای ویژگی‌ها و متدهای زیر " +"است:" -msgid "The :class:`Fraction` constructor now accepts :class:`float` and :class:`decimal.Decimal` instances." +msgid "" +"The :class:`Fraction` constructor now accepts :class:`float` and " +":class:`decimal.Decimal` instances." msgstr "" +"سازنده‌ی :class:`Fraction` اکنون نمونه‌های :class:`float` و " +":class:`decimal.Decimal` را می‌پذیرد." -msgid "The :func:`math.gcd` function is now used to normalize the *numerator* and *denominator*. :func:`math.gcd` always returns an :class:`int` type. Previously, the GCD type depended on *numerator* and *denominator*." +msgid "" +"The :func:`math.gcd` function is now used to normalize the *numerator* and " +"*denominator*. :func:`math.gcd` always returns an :class:`int` type. " +"Previously, the GCD type depended on *numerator* and *denominator*." msgstr "" +"اکنون از تابع :func:`math.gcd` برای به‌هنجار کردن *صورت* و *مخرج* استفاده " +"می‌شود. :func:`math.gcd` همیشه مقداری از نوع :class:`int` برمی‌گرداند. پیش " +"از این، نوع ب.م.م به *صورت* و *مخرج* بستگی داشت." -msgid "Underscores are now permitted when creating a :class:`Fraction` instance from a string, following :PEP:`515` rules." +msgid "" +"Underscores are now permitted when creating a :class:`Fraction` instance " +"from a string, following :PEP:`515` rules." msgstr "" +"اکنون استفاده از زیرخط‌ها هنگام ایجاد یک نمونه از :class:`Fraction` از روی " +"یک رشته، مطابق قوانین :PEP:`515` مجاز است." -msgid ":class:`Fraction` implements ``__int__`` now to satisfy ``typing.SupportsInt`` instance checks." +msgid "" +":class:`Fraction` implements ``__int__`` now to satisfy " +"``typing.SupportsInt`` instance checks." msgstr "" +":class:`Fraction` اکنون ``__int__`` را پیاده‌سازی می‌کند تا بررسی‌های نمونه " +"از ``typing.SupportsInt`` برآورده شوند." -msgid "Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." +msgid "" +"Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." msgstr "" +"برای ورودی‌های رشته‌ای، وجود فاصله در اطراف اسلش مجاز است: ``Fraction('2 / " +"3')``." -msgid ":class:`Fraction` instances now support float-style formatting, with presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, ``\"G\"`` and ``\"%\"\"``." +msgid "" +":class:`Fraction` instances now support float-style formatting, with " +"presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " +"``\"G\"`` and ``\"%\"\"``." msgstr "" +"نمونه‌های :class:`Fraction` اکنون از قالب‌بندی به‌سبک float با انواع نمایش " +"``\"e\"``، ``\"E\"``، ``\"f\"``، ``\"F\"``، ``\"g\"``، ``\"G\"`` و " +"``\"%\"\"`` پشتیبانی می‌کنند." -msgid "Formatting of :class:`Fraction` instances without a presentation type now supports fill, alignment, sign handling, minimum width and grouping." +msgid "" +"Formatting of :class:`Fraction` instances without a presentation type now " +"supports fill, alignment, sign handling, minimum width and grouping." msgstr "" +"قالب‌بندی نمونه‌های :class:`Fraction` بدون نوع نمایش، اکنون از پرکننده، " +"تراز، مدیریت علامت، حداقل عرض و گروه‌بندی پشتیبانی می‌کند." -msgid "The :class:`Fraction` constructor now accepts any objects with the :meth:`!as_integer_ratio` method." +msgid "" +"The :class:`Fraction` constructor now accepts any objects with the " +":meth:`!as_integer_ratio` method." msgstr "" +"سازنده‌ی :class:`Fraction` اکنون هر شیء دارای متد :meth:`!as_integer_ratio` " +"را می‌پذیرد." msgid "Numerator of the Fraction in lowest term." -msgstr "" +msgstr "صورت کسر در ساده‌ترین شکل." -msgid "Denominator of the Fraction in lowest terms. Guaranteed to be positive." -msgstr "" +msgid "" +"Denominator of the Fraction in lowest terms. Guaranteed to be positive." +msgstr "مخرج کسر در ساده‌ترین شکل. تضمین می‌شود که مثبت باشد." -msgid "Return a tuple of two integers, whose ratio is equal to the original Fraction. The ratio is in lowest terms and has a positive denominator." +msgid "" +"Return a tuple of two integers, whose ratio is equal to the original " +"Fraction. The ratio is in lowest terms and has a positive denominator." msgstr "" +"یک تاپل از دو عدد صحیح برمی‌گرداند، که نسبت آن‌ها برابر با Fraction اصلی " +"است. این نسبت در ساده‌ترین شکل است و مخرج آن مثبت است." msgid "Return ``True`` if the Fraction is an integer." -msgstr "" +msgstr "اگر Fraction یک عدد صحیح باشد، ``True`` برمی‌گرداند." -msgid "Alternative constructor which only accepts instances of :class:`float` or :class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not the same value as ``Fraction(3, 10)``." +msgid "" +"Alternative constructor which only accepts instances of :class:`float` or " +":class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " +"the same value as ``Fraction(3, 10)``." msgstr "" +"سازنده جایگزین که فقط نمونه‌های :class:`float` یا :class:`numbers.Integral` " +"را می‌پذیرد. توجه داشته باشید که مقدار ``Fraction.from_float(0.3)`` با مقدار" +" ``Fraction(3, 10)`` یکسان نیست." -msgid "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance directly from a :class:`float`." +msgid "" +"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance" +" directly from a :class:`float`." msgstr "" +"از پایتون 3.2 به بعد، می‌توانید نمونه‌ای از :class:`Fraction` را مستقیماً از" +" یک :class:`float` بسازید." -msgid "Alternative constructor which only accepts instances of :class:`decimal.Decimal` or :class:`numbers.Integral`." +msgid "" +"Alternative constructor which only accepts instances of " +":class:`decimal.Decimal` or :class:`numbers.Integral`." msgstr "" +"سازنده جایگزینی که فقط نمونه‌های :class:`decimal.Decimal` یا " +":class:`numbers.Integral` را می‌پذیرد." -msgid "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance directly from a :class:`decimal.Decimal` instance." +msgid "" +"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance" +" directly from a :class:`decimal.Decimal` instance." msgstr "" +"از پایتون 3.2 به بعد، همچنین می‌توانید یک نمونه :class:`Fraction` را " +"مستقیماً از یک نمونه :class:`decimal.Decimal` ایجاد کنید." -msgid "Alternative constructor which only accepts instances of :class:`numbers.Integral`, :class:`numbers.Rational`, :class:`float` or :class:`decimal.Decimal`, and objects with the :meth:`!as_integer_ratio` method, but not strings." +msgid "" +"Alternative constructor which only accepts instances of " +":class:`numbers.Integral`, :class:`numbers.Rational`, :class:`float` or " +":class:`decimal.Decimal`, and objects with the :meth:`!as_integer_ratio` " +"method, but not strings." msgstr "" +"سازنده جایگزینی که فقط نمونه‌های :class:`numbers.Integral`، " +":class:`numbers.Rational`، :class:`float` یا :class:`decimal.Decimal` و " +"اشیایی که متد :meth:`!as_integer_ratio` دارند را می‌پذیرد، اما رشته‌ها را " +"نمی‌پذیرد." -msgid "Finds and returns the closest :class:`Fraction` to ``self`` that has denominator at most max_denominator. This method is useful for finding rational approximations to a given floating-point number:" +msgid "" +"Finds and returns the closest :class:`Fraction` to ``self`` that has " +"denominator at most max_denominator. This method is useful for finding " +"rational approximations to a given floating-point number:" msgstr "" +"نزدیک‌ترین :class:`Fraction` به ``self`` را که مخرج آن حداکثر " +"max_denominator باشد، پیدا می‌کند و برمی‌گرداند. این متد برای یافتن " +"تقریب‌های گویای یک عدد ممیز شناور داده‌شده مفید است:" msgid "or for recovering a rational number that's represented as a float:" msgstr "" +"یا برای بازیابی عدد گویایی که به‌صورت یک شناور (float) نمایش داده شده است:" -msgid "Returns the greatest :class:`int` ``<= self``. This method can also be accessed through the :func:`math.floor` function:" +msgid "" +"Returns the greatest :class:`int` ``<= self``. This method can also be " +"accessed through the :func:`math.floor` function:" msgstr "" +"بزرگ‌ترین :class:`int` ``<= self`` را برمی‌گرداند. این متد همچنین از طریق " +"تابع :func:`math.floor` نیز قابل دسترسی است:" -msgid "Returns the least :class:`int` ``>= self``. This method can also be accessed through the :func:`math.ceil` function." +msgid "" +"Returns the least :class:`int` ``>= self``. This method can also be " +"accessed through the :func:`math.ceil` function." msgstr "" +"کوچک‌ترین :class:`int` که ``>= self`` باشد را برمی‌گرداند. همچنین می‌توان از" +" طریق تابع :func:`math.ceil` به این متد دسترسی داشت." -msgid "The first version returns the nearest :class:`int` to ``self``, rounding half to even. The second version rounds ``self`` to the nearest multiple of ``Fraction(1, 10**ndigits)`` (logically, if ``ndigits`` is negative), again rounding half toward even. This method can also be accessed through the :func:`round` function." -msgstr "" +msgid "" +"The first version returns the nearest :class:`int` to ``self``, rounding " +"half to even. The second version rounds ``self`` to the nearest multiple of " +"``Fraction(1, 10**ndigits)`` (logically, if ``ndigits`` is negative), again " +"rounding half toward even. This method can also be accessed through the " +":func:`round` function." +msgstr "" +"نسخه‌ی نخست نزدیک‌ترین :class:`int` به ``self`` را بازمی‌گرداند، با گرد کردن" +" نیمه به سمت زوج. نسخه‌ی دوم ``self`` را به نزدیک‌ترین مضرب ``Fraction(1, " +"10**ndigits)`` گرد می‌کند (از نظر منطقی، اگر ``ndigits`` منفی باشد)، باز هم " +"با گرد کردن نیمه به سمت زوج. می‌توان به این متد از طریق تابع :func:`round` " +"نیز دسترسی داشت." -msgid "Provides support for formatting of :class:`Fraction` instances via the :meth:`str.format` method, the :func:`format` built-in function, or :ref:`Formatted string literals `." +msgid "" +"Provides support for formatting of :class:`Fraction` instances via the " +":meth:`str.format` method, the :func:`format` built-in function, or " +":ref:`Formatted string literals `." msgstr "" +"پشتیبانی از قالب‌بندی نمونه‌های :class:`Fraction` را از طریق متد " +":meth:`str.format`، تابع توکار :func:`format`، یا :ref:`رشته‌های " +"قالب‌بندی‌شده ` فراهم می‌کند." -msgid "If the ``format_spec`` format specification string does not end with one of the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or ``'%'`` then formatting follows the general rules for fill, alignment, sign handling, minimum width, and grouping as described in the :ref:`format specification mini-language `. The \"alternate form\" flag ``'#'`` is supported: if present, it forces the output string to always include an explicit denominator, even when the value being formatted is an exact integer. The zero-fill flag ``'0'`` is not supported." -msgstr "" +msgid "" +"If the ``format_spec`` format specification string does not end with one of " +"the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " +"or ``'%'`` then formatting follows the general rules for fill, alignment, " +"sign handling, minimum width, and grouping as described in the :ref:`format " +"specification mini-language `. The \"alternate form\" flag " +"``'#'`` is supported: if present, it forces the output string to always " +"include an explicit denominator, even when the value being formatted is an " +"exact integer. The zero-fill flag ``'0'`` is not supported." +msgstr "" +"اگر رشته مشخصات قالب‌بندی ``format_spec`` به یکی از انواع نمایش ``'e'``، " +"``'E'``، ``'f'``، ``'F'``، ``'g'``، ``'G'`` یا ``'%'`` ختم نشود، قالب‌بندی " +"از قواعد عمومی مربوط به پر کردن، ترازبندی، مدیریت علامت، حداقل عرض و " +"گروه‌بندی پیروی می‌کند، همان‌طور که در :ref:`زبان کوچک مشخصات قالب‌بندی " +"` توضیح داده شده است. پرچم «شکل جایگزین» (alternate form) " +"``'#'`` پشتیبانی می‌شود: در صورت وجود، رشته خروجی را وادار می‌کند که همیشه " +"شامل یک مخرج صریح باشد، حتی وقتی که مقدار مورد قالب‌بندی یک عدد صحیح دقیق " +"باشد. از پرچم پرکننده با صفر ``'0'`` پشتیبانی نمی‌شود." -msgid "If the ``format_spec`` format specification string ends with one of the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or ``'%'`` then formatting follows the rules outlined for the :class:`float` type in the :ref:`formatspec` section." +msgid "" +"If the ``format_spec`` format specification string ends with one of the " +"presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " +"``'%'`` then formatting follows the rules outlined for the :class:`float` " +"type in the :ref:`formatspec` section." msgstr "" +"اگر رشته مشخصات قالب ``format_spec`` به یکی از انواع نمایش ``'e'``، ``'E'``،" +" ``'f'``، ``'F'``، ``'g'``، ``'G'`` یا ``'%'`` ختم شود، قالب‌بندی از قواعدی " +"پیروی می‌کند که برای نوع :class:`float` در بخش :ref:`formatspec` شرح داده " +"شده است." msgid "Here are some examples::" -msgstr "" +msgstr "در ادامه چند مثال آمده است::" msgid "" ">>> from fractions import Fraction\n" @@ -178,12 +386,30 @@ msgid "" ">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" "'34.67% price increase'" msgstr "" +">>> from fractions import Fraction\n" +">>> format(Fraction(103993, 33102), '_')\n" +"'103_993/33_102'\n" +">>> format(Fraction(1, 7), '.^+10')\n" +"'...+1/7...'\n" +">>> format(Fraction(3, 1), '')\n" +"'3'\n" +">>> format(Fraction(3, 1), '#')\n" +"'3/1'\n" +">>> format(Fraction(1, 7), '.40g')\n" +"'0.1428571428571428571428571428571428571429'\n" +">>> format(Fraction('1234567.855'), '_.2f')\n" +"'1_234_567.86'\n" +">>> f\"{Fraction(355, 113):*>20.6e}\"\n" +"'********3.141593e+00'\n" +">>> old_price, new_price = 499, 672\n" +">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" +"'34.67% price increase'" msgid "Module :mod:`numbers`" -msgstr "" +msgstr "ماژول :mod:`numbers`" msgid "The abstract base classes making up the numeric tower." -msgstr "" +msgstr "کلاس‌های پایه انتزاعی که برج عددی (numeric tower) را تشکیل می‌دهند." msgid "as_integer_ratio()" -msgstr "" +msgstr "as_integer_ratio()" diff --git a/library/frameworks.po b/library/frameworks.po index c62d6520e..afcd33e27 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -22,16 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Program frameworks" -msgstr "" +msgstr "چارچوب‌های برنامه" -msgid "This chapter is no longer maintained, and the modules it contained have been moved to their respective topical documentation." +msgid "" +"This chapter is no longer maintained, and the modules it contained have been" +" moved to their respective topical documentation." msgstr "" +"این فصل دیگر نگهداری نمی‌شود و ماژول‌هایی که در آن قرار داشتند، به مستندات " +"موضوعی مربوطه منتقل شده‌اند." msgid ":mod:`cmd` — :doc:`Command Line Interface Libraries <./cmdlinelibs>`" -msgstr "" +msgstr ":mod:`cmd` — :doc:`کتابخانه‌های رابط خط فرمان <./cmdlinelibs>`" msgid ":mod:`shlex` — :doc:`Unix Specific Services <./unix>`" -msgstr "" +msgstr ":mod:`shlex` — :doc:`خدمات مختص یونیکس <./unix>`" msgid ":mod:`turtle` — :doc:`Graphical User Interfaces with Tk <./tk>`" -msgstr "" +msgstr ":mod:`turtle` — :doc:`رابط‌های کاربری گرافیکی با Tk <./tk>`" diff --git a/library/ftplib.po b/library/ftplib.po index 67d700344..1ded3ef2d 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -24,25 +24,42 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!ftplib` --- FTP protocol client" -msgstr "" +msgstr ":mod:`!ftplib` --- کارخواه پروتکل FTP" msgid "**Source code:** :source:`Lib/ftplib.py`" -msgstr "" +msgstr ":source:`Lib/ftplib.py`" -msgid "This module defines the class :class:`FTP` and a few related items. The :class:`FTP` class implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such as mirroring other FTP servers. It is also used by the module :mod:`urllib.request` to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see internet :rfc:`959`." -msgstr "" +msgid "" +"This module defines the class :class:`FTP` and a few related items. The " +":class:`FTP` class implements the client side of the FTP protocol. You can " +"use this to write Python programs that perform a variety of automated FTP " +"jobs, such as mirroring other FTP servers. It is also used by the module " +":mod:`urllib.request` to handle URLs that use FTP. For more information on " +"FTP (File Transfer Protocol), see internet :rfc:`959`." +msgstr "" +"این ماژول، کلاس :class:`FTP` و چند آیتم مرتبط را تعریف می‌کند. کلاس " +":class:`FTP` سمت کلاینت پروتکل FTP را پیاده‌سازی می‌کند. شما می‌توانید از آن" +" برای نوشتن برنامه‌های پایتون استفاده کنید که انواع مختلفی از وظایف خودکار " +"FTP را انجام می‌دهند، مانند آینه‌سازی سایر سرورهای FTP. همچنین توسط ماژول " +":mod:`urllib.request` برای مدیریت URLهایی که از FTP استفاده می‌کنند، " +"استفاده می‌شود. برای اطلاعات بیشتر درباره FTP (پروتکل انتقال فایل)، سند " +"اینترنتی :rfc:`959` را ببینید." msgid "The default encoding is UTF-8, following :rfc:`2640`." -msgstr "" +msgstr "کدگذاری پیش‌فرض UTF-8 است، مطابق با :rfc:`2640`." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول در WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "Here's a sample session using the :mod:`!ftplib` module::" -msgstr "" +msgstr "در اینجا یک نشست نمونه با استفاده از ماژول :mod:`!ftplib` آمده است::" msgid "" ">>> from ftplib import FTP\n" @@ -64,222 +81,522 @@ msgid "" ">>> ftp.quit()\n" "'221 Goodbye.'" msgstr "" +">>> from ftplib import FTP\n" +">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n" +">>> ftp.login() # user anonymous, passwd anonymous@\n" +"'230 Login successful.'\n" +">>> ftp.cwd('debian') # change into \"debian\" directory\n" +"'250 Directory successfully changed.'\n" +">>> ftp.retrlines('LIST') # list directory contents\n" +"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n" +"...\n" +"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n" +"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n" +"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n" +"'226 Directory send OK.'\n" +">>> with open('README', 'wb') as fp:\n" +">>> ftp.retrbinary('RETR README', fp.write)\n" +"'226 Transfer complete.'\n" +">>> ftp.quit()\n" +"'221 Goodbye.'" msgid "Reference" -msgstr "" +msgstr "مرجع" msgid "FTP objects" -msgstr "" +msgstr "اشیای FTP" msgid "Return a new instance of the :class:`FTP` class." -msgstr "" +msgstr "یک نمونه جدید از کلاس :class:`FTP` برمی‌گرداند." msgid "Parameters" -msgstr "" +msgstr "پارامترها" -msgid "The hostname to connect to. If given, :code:`connect(host)` is implicitly called by the constructor." +msgid "" +"The hostname to connect to. If given, :code:`connect(host)` is implicitly " +"called by the constructor." msgstr "" +"نام میزبان برای اتصال. اگر ارائه شود، :code:`connect(host)` به‌طور ضمنی توسط" +" سازنده فراخوانی می‌شود." -msgid "|param_doc_user| If given, :code:`login(host, passwd, acct)` is implicitly called by the constructor." +msgid "" +"|param_doc_user| If given, :code:`login(host, passwd, acct)` is implicitly " +"called by the constructor." msgstr "" +"|param_doc_user| در صورت ارائه، :code:`login(host, passwd, acct)` به‌طور " +"ضمنی توسط سازنده فراخوانی می‌شود." msgid "|param_doc_passwd|" -msgstr "" +msgstr "|param_doc_passwd|" msgid "|param_doc_acct|" -msgstr "" +msgstr "|param_doc_acct|" -msgid "A timeout in seconds for blocking operations like :meth:`connect` (default: the global default timeout setting)." +msgid "" +"A timeout in seconds for blocking operations like :meth:`connect` (default: " +"the global default timeout setting)." msgstr "" +"مهلت زمانی به ثانیه برای عملیات‌های مسدودکننده مانند :meth:`connect` (پیش‌فرض:" +" تنظیم مهلت زمانی پیش‌فرض سراسری)." msgid "|param_doc_source_address|" -msgstr "" +msgstr "|param_doc_source_address|" msgid "|param_doc_encoding|" -msgstr "" +msgstr "|param_doc_encoding|" msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" msgstr "" +"کلاس :class:`FTP` از دستور :keyword:`with` پشتیبانی می‌کند، برای مثال:" msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "پشتیبانی از دستور :keyword:`with` افزوده شد." msgid "*source_address* parameter was added." -msgstr "" +msgstr "پارامتر *source_address* افزوده شد." -msgid "If the *timeout* parameter is set to be zero, it will raise a :class:`ValueError` to prevent the creation of a non-blocking socket. The *encoding* parameter was added, and the default was changed from Latin-1 to UTF-8 to follow :rfc:`2640`." +msgid "" +"If the *timeout* parameter is set to be zero, it will raise a " +":class:`ValueError` to prevent the creation of a non-blocking socket. The " +"*encoding* parameter was added, and the default was changed from Latin-1 to " +"UTF-8 to follow :rfc:`2640`." msgstr "" +"اگر پارامتر *timeout* روی صفر تنظیم شود، برای جلوگیری از ایجاد یک سوکت " +"غیرمسدودکننده، :class:`ValueError` پرتاب خواهد شد. پارامتر *encoding* افزوده" +" شد و مقدار پیش‌فرض از Latin-1 به UTF-8 تغییر یافت تا از :rfc:`2640` پیروی " +"شود." -msgid "Several :class:`!FTP` methods are available in two flavors: one for handling text files and another for binary files. The methods are named for the command which is used followed by ``lines`` for the text version or ``binary`` for the binary version." +msgid "" +"Several :class:`!FTP` methods are available in two flavors: one for handling" +" text files and another for binary files. The methods are named for the " +"command which is used followed by ``lines`` for the text version or " +"``binary`` for the binary version." msgstr "" +"چندین متد :class:`!FTP` در دو گونه در دسترس هستند: یکی برای کار با فایل‌های " +"متنی و دیگری برای فایل‌های دودویی. این متدها به نام دستور مورد استفاده، " +"به‌دنبال ``lines`` برای نسخه‌ی متنی یا ``binary`` برای نسخه‌ی دودویی نام‌گذاری" +" شده‌اند." msgid ":class:`FTP` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`FTP` دارای متدهای زیر هستند:" -msgid "Set the instance's debugging level as an :class:`int`. This controls the amount of debugging output printed. The debug levels are:" +msgid "" +"Set the instance's debugging level as an :class:`int`. This controls the " +"amount of debugging output printed. The debug levels are:" msgstr "" +"سطح اشکال‌زدایی نمونه را به‌عنوان یک :class:`int` تنظیم کنید. این موضوع " +"میزان خروجی اشکال‌زدایی چاپ‌شده را کنترل می‌کند. سطوح اشکال‌زدایی عبارتند " +"از:" msgid "``0`` (default): No debug output." -msgstr "" +msgstr "``0`` (پیش‌فرض): بدون خروجی اشکال‌زدایی." -msgid "``1``: Produce a moderate amount of debug output, generally a single line per request." +msgid "" +"``1``: Produce a moderate amount of debug output, generally a single line " +"per request." msgstr "" +"``1``: مقدار متوسطی از خروجی اشکال‌زدایی تولید می‌کند، معمولاً یک خط به ازای" +" هر درخواست." -msgid "``2`` or higher: Produce the maximum amount of debugging output, logging each line sent and received on the control connection." +msgid "" +"``2`` or higher: Produce the maximum amount of debugging output, logging " +"each line sent and received on the control connection." msgstr "" +"``2`` یا بالاتر: بیشترین مقدار خروجی اشکال‌زدایی تولید می‌کند و هر خط " +"ارسال‌شده و دریافت‌شده روی اتصال کنترل را ثبت می‌کند." -msgid "Connect to the given host and port. This function should be called only once for each instance; it should not be called if a *host* argument was given when the :class:`FTP` instance was created. All other :class:`!FTP` methods can only be called after a connection has successfully been made." +msgid "" +"Connect to the given host and port. This function should be called only once" +" for each instance; it should not be called if a *host* argument was given " +"when the :class:`FTP` instance was created. All other :class:`!FTP` methods " +"can only be called after a connection has successfully been made." msgstr "" +"به میزبان و پورت داده‌شده متصل می‌شود. این تابع باید فقط یک بار برای هر " +"نمونه فراخوانی شود؛ اگر هنگام ایجاد نمونه :class:`FTP` آرگومان *host* داده " +"شده باشد، نباید فراخوانی شود. سایر متدهای :class:`!FTP` را تنها پس از " +"برقراری موفق اتصال می‌توان فراخوانی کرد." msgid "The host to connect to." -msgstr "" +msgstr "میزبانی که باید به آن متصل شوید." -msgid "The TCP port to connect to (default: ``21``, as specified by the FTP protocol specification). It is rarely needed to specify a different port number." +msgid "" +"The TCP port to connect to (default: ``21``, as specified by the FTP " +"protocol specification). It is rarely needed to specify a different port " +"number." msgstr "" +"پورت TCP برای اتصال (پیش‌فرض: ``21``، همان‌طور که در مشخصات پروتکل FTP آمده " +"است). به‌ندرت لازم است شماره پورت متفاوتی را مشخص کنید." -msgid "A timeout in seconds for the connection attempt (default: the global default timeout setting)." +msgid "" +"A timeout in seconds for the connection attempt (default: the global default" +" timeout setting)." msgstr "" +"یک مهلت زمانی بر حسب ثانیه برای تلاش اتصال (پیش‌فرض: تنظیم مهلت پیش‌فرض " +"سراسری)." -msgid "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments ``self``, ``host``, ``port``." +msgid "" +"Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments" +" ``self``, ``host``, ``port``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ftplib.connect`` را با آرگومان‌های " +"``self``، ``host`` و ``port`` پرتاب می‌کند." -msgid "Return the welcome message sent by the server in reply to the initial connection. (This message sometimes contains disclaimers or help information that may be relevant to the user.)" +msgid "" +"Return the welcome message sent by the server in reply to the initial " +"connection. (This message sometimes contains disclaimers or help " +"information that may be relevant to the user.)" msgstr "" +"پیام خوش‌آمدگویی ارسال‌شده از سوی سرور در پاسخ به اتصال اولیه را " +"بازمی‌گرداند. (این پیام گاهی شامل موارد سلب مسئولیت یا اطلاعات راهنمایی است " +"که ممکن است برای کاربر مرتبط باشد.)" -msgid "Log on to the connected FTP server. This function should be called only once for each instance, after a connection has been established; it should not be called if the *host* and *user* arguments were given when the :class:`FTP` instance was created. Most FTP commands are only allowed after the client has logged in." +msgid "" +"Log on to the connected FTP server. This function should be called only once" +" for each instance, after a connection has been established; it should not " +"be called if the *host* and *user* arguments were given when the " +":class:`FTP` instance was created. Most FTP commands are only allowed after " +"the client has logged in." msgstr "" +"به سرور FTP متصل‌شده وارد شوید. این تابع باید فقط یک بار برای هر نمونه، پس " +"از برقراری اتصال فراخوانی شود؛ اگر آرگومان‌های *host* و *user* هنگام ایجاد " +"نمونه‌ی :class:`FTP` داده شده باشند، نباید فراخوانی شود. بیشتر دستورات FTP " +"فقط پس از ورود کارخواه مجاز هستند." msgid "|param_doc_user|" -msgstr "" +msgstr "|param_doc_user|" -msgid "Abort a file transfer that is in progress. Using this does not always work, but it's worth a try." +msgid "" +"Abort a file transfer that is in progress. Using this does not always work," +" but it's worth a try." msgstr "" +"انتقال فایلی را که در حال انجام است قطع کنید. استفاده از این همیشه کارساز " +"نیست، اما ارزش امتحان کردن دارد." -msgid "Send a simple command string to the server and return the response string." -msgstr "" +msgid "" +"Send a simple command string to the server and return the response string." +msgstr "یک رشته فرمان ساده را به سرور ارسال کنید و رشته پاسخ را برگردانید." -msgid "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments ``self``, ``cmd``." +msgid "" +"Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments" +" ``self``, ``cmd``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``ftplib.sendcmd`` را با آرگومان‌های " +"``self`` و ``cmd`` پرتاب می‌کند." -msgid "Send a simple command string to the server and handle the response. Return the response string if the response code corresponds to success (codes in the range 200--299). Raise :exc:`error_reply` otherwise." +msgid "" +"Send a simple command string to the server and handle the response. Return " +"the response string if the response code corresponds to success (codes in " +"the range 200--299). Raise :exc:`error_reply` otherwise." msgstr "" +"یک رشته‌ی فرمان ساده را به سرور ارسال کنید و پاسخ را مدیریت کنید. اگر کد " +"پاسخ متناظر با موفقیت باشد (کدها در بازه‌ی ۲۰۰ تا ۲۹۹)، رشته‌ی پاسخ را " +"برگردانید. در غیر این صورت :exc:`error_reply` را پرتاب کنید." msgid "Retrieve a file in binary transfer mode." -msgstr "" +msgstr "دریافت یک فایل در حالت انتقال دودویی." msgid "An appropriate ``RETR`` command: :samp:`\"RETR {filename}\"`." -msgstr "" +msgstr "یک دستور ``RETR`` مناسب: :samp:`\"RETR {filename}\"`." -msgid "A single parameter callable that is called for each block of data received, with its single argument being the data as :class:`bytes`." +msgid "" +"A single parameter callable that is called for each block of data received, " +"with its single argument being the data as :class:`bytes`." msgstr "" +"یک شیء قابل فراخوانی با یک پارامتر که برای هر بلوک داده‌ی دریافتی فراخوانی " +"می‌شود و تنها آرگومان آن، داده به صورت :class:`bytes` است." -msgid "The maximum chunk size to read on the low-level :class:`~socket.socket` object created to do the actual transfer. This also corresponds to the largest size of data that will be passed to *callback*. Defaults to ``8192``." +msgid "" +"The maximum chunk size to read on the low-level :class:`~socket.socket` " +"object created to do the actual transfer. This also corresponds to the " +"largest size of data that will be passed to *callback*. Defaults to " +"``8192``." msgstr "" +"حداکثر اندازه تکه (chunk) برای خواندن از شیء :class:`~socket.socket` سطح " +"پایین که برای انجام انتقال واقعی ایجاد شده است. این مقدار همچنین متناظر با " +"بیشترین اندازه داده‌ای است که به *callback* ارسال می‌شود. مقدار پیش‌فرض آن " +"``8192`` است." -msgid "A ``REST`` command to be sent to the server. See the documentation for the *rest* parameter of the :meth:`transfercmd` method." +msgid "" +"A ``REST`` command to be sent to the server. See the documentation for the " +"*rest* parameter of the :meth:`transfercmd` method." msgstr "" +"یک دستور ``REST`` برای ارسال به سرور. مستندات پارامتر *rest* متد " +":meth:`transfercmd` را مشاهده کنید." -msgid "Retrieve a file or directory listing in the encoding specified by the *encoding* parameter at initialization. *cmd* should be an appropriate ``RETR`` command (see :meth:`retrbinary`) or a command such as ``LIST`` or ``NLST`` (usually just the string ``'LIST'``). ``LIST`` retrieves a list of files and information about those files. ``NLST`` retrieves a list of file names. The *callback* function is called for each line with a string argument containing the line with the trailing CRLF stripped. The default *callback* prints the line to :data:`sys.stdout`." -msgstr "" +msgid "" +"Retrieve a file or directory listing in the encoding specified by the " +"*encoding* parameter at initialization. *cmd* should be an appropriate " +"``RETR`` command (see :meth:`retrbinary`) or a command such as ``LIST`` or " +"``NLST`` (usually just the string ``'LIST'``). ``LIST`` retrieves a list of " +"files and information about those files. ``NLST`` retrieves a list of file " +"names. The *callback* function is called for each line with a string " +"argument containing the line with the trailing CRLF stripped. The default " +"*callback* prints the line to :data:`sys.stdout`." +msgstr "" +"یک فایل یا فهرست پوشه را با کدگذاری مشخص‌شده توسط پارامتر *encoding* در زمان" +" مقداردهی اولیه بازیابی کنید. *cmd* باید یک فرمان ``RETR`` مناسب باشد (به " +":meth:`retrbinary` مراجعه کنید) یا فرمانی مانند ``LIST`` یا ``NLST`` " +"(معمولاً فقط رشته ``'LIST'``). ``LIST`` فهرستی از فایل‌ها و اطلاعات مربوط به" +" آن فایل‌ها را بازیابی می‌کند. ``NLST`` فهرستی از نام فایل‌ها را بازیابی " +"می‌کند. تابع *callback* برای هر خط با یک آرگومان رشته‌ای حاوی همان خط بدون " +"CRLF پایانی فراخوانی می‌شود. *callback* پیش‌فرض خط را در :data:`sys.stdout` " +"چاپ می‌کند." -msgid "Enable \"passive\" mode if *val* is true, otherwise disable passive mode. Passive mode is on by default." +msgid "" +"Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " +"Passive mode is on by default." msgstr "" +"اگر *val* درست باشد، حالت «passive» را فعال کنید، در غیر این صورت حالت " +"passive را غیرفعال کنید. حالت passive به‌طور پیش‌فرض فعال است." msgid "Store a file in binary transfer mode." -msgstr "" +msgstr "یک فایل را در حالت انتقال دودویی ذخیره کنید." msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." -msgstr "" +msgstr "یک فرمان ``STOR`` مناسب: :samp:`\"STOR {filename}\"`." -msgid "A file object (opened in binary mode) which is read until EOF, using its :meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide the data to be stored." +msgid "" +"A file object (opened in binary mode) which is read until EOF, using its " +":meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide " +"the data to be stored." msgstr "" +"یک شیء فایل (بازشده در حالت دودویی) که تا EOF، با استفاده از متد " +":meth:`~io.RawIOBase.read` خود و در بلوک‌هایی به اندازه‌ی *blocksize* خوانده " +"می‌شود تا داده‌های موردنیاز برای ذخیره را فراهم کند." msgid "The read block size. Defaults to ``8192``." -msgstr "" +msgstr "اندازه‌ی بلوک خواندن. پیش‌فرض آن ``8192`` است." -msgid "A single parameter callable that is called for each block of data sent, with its single argument being the data as :class:`bytes`." +msgid "" +"A single parameter callable that is called for each block of data sent, with" +" its single argument being the data as :class:`bytes`." msgstr "" +"یک فراخوان‌پذیر با یک پارامتر که برای هر بلوک داده‌ی ارسالی فراخوانی می‌شود " +"و تنها آرگومان آن داده به‌صورت :class:`bytes` است." msgid "The *rest* parameter was added." -msgstr "" +msgstr "پارامتر *rest* افزوده شد." -msgid "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the :term:`file object` *fp* (opened in binary mode) using its :meth:`~io.IOBase.readline` method to provide the data to be stored. *callback* is an optional single parameter callable that is called on each line after it is sent." -msgstr "" +msgid "" +"Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " +"(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " +"object` *fp* (opened in binary mode) using its :meth:`~io.IOBase.readline` " +"method to provide the data to be stored. *callback* is an optional single " +"parameter callable that is called on each line after it is sent." +msgstr "" +"یک فایل را در حالت خطی ذخیره می‌کند. *cmd* باید یک دستور ``STOR`` مناسب باشد" +" (به :meth:`storbinary` مراجعه کنید). خط‌ها تا EOF از :term:`file object` " +"*fp* (که در حالت دودویی باز شده است) با استفاده از متد " +":meth:`~io.IOBase.readline` آن خوانده می‌شوند تا داده‌های موردنیاز برای " +"ذخیره فراهم شوند. *callback* یک کال‌بک اختیاری با یک پارامتر است که پس از " +"ارسال هر خط، برای آن خط فراخوانی می‌شود." -msgid "Initiate a transfer over the data connection. If the transfer is active, send an ``EPRT`` or ``PORT`` command and the transfer command specified by *cmd*, and accept the connection. If the server is passive, send an ``EPSV`` or ``PASV`` command, connect to it, and start the transfer command. Either way, return the socket for the connection." -msgstr "" +msgid "" +"Initiate a transfer over the data connection. If the transfer is active, " +"send an ``EPRT`` or ``PORT`` command and the transfer command specified by " +"*cmd*, and accept the connection. If the server is passive, send an " +"``EPSV`` or ``PASV`` command, connect to it, and start the transfer command." +" Either way, return the socket for the connection." +msgstr "" +"یک انتقال را بر روی اتصال داده آغاز می‌کند. اگر انتقال فعال باشد، یک فرمان " +"``EPRT`` یا ``PORT`` و فرمان انتقال مشخص‌شده با *cmd* را ارسال می‌کند و " +"اتصال را می‌پذیرد. اگر سرور غیرفعال باشد، یک فرمان ``EPSV`` یا ``PASV`` را " +"ارسال می‌کند، به آن متصل می‌شود و فرمان انتقال را آغاز می‌کند. در هر صورت، " +"سوکت اتصال را برمی‌گرداند." -msgid "If optional *rest* is given, a ``REST`` command is sent to the server, passing *rest* as an argument. *rest* is usually a byte offset into the requested file, telling the server to restart sending the file's bytes at the requested offset, skipping over the initial bytes. Note however that the :meth:`transfercmd` method converts *rest* to a string with the *encoding* parameter specified at initialization, but no check is performed on the string's contents. If the server does not recognize the ``REST`` command, an :exc:`error_reply` exception will be raised. If this happens, simply call :meth:`transfercmd` without a *rest* argument." -msgstr "" +msgid "" +"If optional *rest* is given, a ``REST`` command is sent to the server, " +"passing *rest* as an argument. *rest* is usually a byte offset into the " +"requested file, telling the server to restart sending the file's bytes at " +"the requested offset, skipping over the initial bytes. Note however that " +"the :meth:`transfercmd` method converts *rest* to a string with the " +"*encoding* parameter specified at initialization, but no check is performed " +"on the string's contents. If the server does not recognize the ``REST`` " +"command, an :exc:`error_reply` exception will be raised. If this happens, " +"simply call :meth:`transfercmd` without a *rest* argument." +msgstr "" +"اگر آرگومان اختیاری *rest* داده شود، یک دستور ``REST`` به سرور ارسال می‌شود " +"و *rest* به‌عنوان آرگومان به آن گذرانده می‌شود. *rest* معمولاً یک آفست بایتی" +" در فایل درخواستی است و به سرور می‌گوید که ارسال بایت‌های فایل را از آفست " +"درخواستی از سر بگیرد و بایت‌های ابتدایی را رد کند. با این حال توجه داشته " +"باشید که متد :meth:`transfercmd`، *rest* را با پارامتر *encoding* مشخص‌شده " +"در مقداردهی اولیه به یک رشته تبدیل می‌کند، اما هیچ بررسی‌ای روی محتوای رشته " +"انجام نمی‌شود. اگر سرور دستور ``REST`` را نشناسد، استثنای :exc:`error_reply`" +" پرتاب خواهد شد. اگر این اتفاق افتاد، کافی است :meth:`transfercmd` را بدون " +"آرگومان *rest* فراخوانی کنید." -msgid "Like :meth:`transfercmd`, but returns a tuple of the data connection and the expected size of the data. If the expected size could not be computed, ``None`` will be returned as the expected size. *cmd* and *rest* means the same thing as in :meth:`transfercmd`." +msgid "" +"Like :meth:`transfercmd`, but returns a tuple of the data connection and the" +" expected size of the data. If the expected size could not be computed, " +"``None`` will be returned as the expected size. *cmd* and *rest* means the " +"same thing as in :meth:`transfercmd`." msgstr "" +"مانند :meth:`transfercmd`، اما تاپلی از اتصال داده و اندازه‌ی مورد انتظار " +"داده برمی‌گرداند. اگر اندازه‌ی مورد انتظار قابل محاسبه نباشد، ``None`` " +"به‌عنوان اندازه‌ی مورد انتظار بازگردانده می‌شود. *cmd* و *rest* همان معنایی " +"را دارند که در :meth:`transfercmd` دارند." -msgid "List a directory in a standardized format by using ``MLSD`` command (:rfc:`3659`). If *path* is omitted the current directory is assumed. *facts* is a list of strings representing the type of information desired (e.g. ``[\"type\", \"size\", \"perm\"]``). Return a generator object yielding a tuple of two elements for every file found in path. First element is the file name, the second one is a dictionary containing facts about the file name. Content of this dictionary might be limited by the *facts* argument but server is not guaranteed to return all requested facts." -msgstr "" +msgid "" +"List a directory in a standardized format by using ``MLSD`` command " +"(:rfc:`3659`). If *path* is omitted the current directory is assumed. " +"*facts* is a list of strings representing the type of information desired " +"(e.g. ``[\"type\", \"size\", \"perm\"]``). Return a generator object " +"yielding a tuple of two elements for every file found in path. First " +"element is the file name, the second one is a dictionary containing facts " +"about the file name. Content of this dictionary might be limited by the " +"*facts* argument but server is not guaranteed to return all requested facts." +msgstr "" +"فهرست کردن یک پوشه در قالبی استاندارد با استفاده از دستور ``MLSD`` " +"(:rfc:`3659`). اگر *path* حذف شود، پوشه فعلی فرض می‌شود. *facts* فهرستی از " +"رشته‌ها است که نوع اطلاعات مورد نظر را نشان می‌دهد (مثلاً ``[\"type\", " +"\"size\", \"perm\"]``). یک شیء تولیدگر برمی‌گرداند که برای هر فایل یافت‌شده " +"در مسیر، یک تاپلبا دو المان تولید می‌کند. المان اول نام فایل است، " +"المان دوم یک دیکشنری حاوی اطلاعاتی درباره نام فایل است. محتوای این دیکشنری " +"ممکن است با آرگومان *facts* محدود شود، اما تضمینی نیست که سرور تمام اطلاعات " +"درخواست‌شده را برگرداند." -msgid "Return a list of file names as returned by the ``NLST`` command. The optional *argument* is a directory to list (default is the current server directory). Multiple arguments can be used to pass non-standard options to the ``NLST`` command." +msgid "" +"Return a list of file names as returned by the ``NLST`` command. The " +"optional *argument* is a directory to list (default is the current server " +"directory). Multiple arguments can be used to pass non-standard options to " +"the ``NLST`` command." msgstr "" +"فهرستی از نام پرونده‌ها را، همان‌گونه که توسط فرمان ``NLST`` برگردانده " +"می‌شود، برمی‌گرداند. *آرگومان* اختیاری، پوشه‌ای برای فهرست کردن است " +"(پیش‌فرض، پوشه‌ی جاری کارساز است). می‌توان از آرگومان‌های متعدد برای ارسال " +"گزینه‌های غیراستاندارد به فرمان ``NLST`` استفاده کرد." msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "" +"اگر سرور شما از این فرمان پشتیبانی کند، :meth:`mlsd` API بهتری ارائه می‌دهد." -msgid "Produce a directory listing as returned by the ``LIST`` command, printing it to standard output. The optional *argument* is a directory to list (default is the current server directory). Multiple arguments can be used to pass non-standard options to the ``LIST`` command. If the last argument is a function, it is used as a *callback* function as for :meth:`retrlines`; the default prints to :data:`sys.stdout`. This method returns ``None``." -msgstr "" +msgid "" +"Produce a directory listing as returned by the ``LIST`` command, printing it" +" to standard output. The optional *argument* is a directory to list " +"(default is the current server directory). Multiple arguments can be used " +"to pass non-standard options to the ``LIST`` command. If the last argument " +"is a function, it is used as a *callback* function as for :meth:`retrlines`;" +" the default prints to :data:`sys.stdout`. This method returns ``None``." +msgstr "" +"فهرستی از پوشه را مانند آنچه دستور ``LIST`` برمی‌گرداند تولید می‌کند و آن را" +" در خروجی استاندارد چاپ می‌کند. *آرگومان* اختیاری، پوشه‌ای برای فهرست کردن " +"است (پیش‌فرض، پوشه‌ی جاری کارساز است). می‌توان از آرگومان‌های متعدد برای " +"ارسال گزینه‌های غیراستاندارد به دستور ``LIST`` استفاده کرد. اگر آخرین " +"آرگومان یک تابع باشد، از آن به‌عنوان تابع *کال‌بک* مانند :meth:`retrlines` " +"استفاده می‌شود؛ در حالت پیش‌فرض در :data:`sys.stdout` چاپ می‌شود. این متد " +"``None`` را برمی‌گرداند." msgid "Rename file *fromname* on the server to *toname*." -msgstr "" +msgstr "نام فایل *fromname* را روی سرور به *toname* تغییر می‌دهد." -msgid "Remove the file named *filename* from the server. If successful, returns the text of the response, otherwise raises :exc:`error_perm` on permission errors or :exc:`error_reply` on other errors." +msgid "" +"Remove the file named *filename* from the server. If successful, returns " +"the text of the response, otherwise raises :exc:`error_perm` on permission " +"errors or :exc:`error_reply` on other errors." msgstr "" +"فایلی به نام *filename* را از سرور حذف می‌کند. در صورت موفقیت، متن پاسخ را " +"برمی‌گرداند؛ در غیر این صورت، در خطاهای دسترسی :exc:`error_perm` یا در سایر " +"خطاها :exc:`error_reply` را پرتاب می‌کند." msgid "Set the current directory on the server." -msgstr "" +msgstr "پوشه جاری را روی سرور تنظیم می‌کند." msgid "Create a new directory on the server." -msgstr "" +msgstr "یک پوشه‌ی جدید روی سرور ایجاد کنید." msgid "Return the pathname of the current directory on the server." -msgstr "" +msgstr "مسیر پوشه‌ی فعلی روی سرور را برمی‌گرداند." msgid "Remove the directory named *dirname* on the server." -msgstr "" +msgstr "پوشه‌ای به نام *dirname* را روی سرور حذف کنید." -msgid "Request the size of the file named *filename* on the server. On success, the size of the file is returned as an integer, otherwise ``None`` is returned. Note that the ``SIZE`` command is not standardized, but is supported by many common server implementations." +msgid "" +"Request the size of the file named *filename* on the server. On success, " +"the size of the file is returned as an integer, otherwise ``None`` is " +"returned. Note that the ``SIZE`` command is not standardized, but is " +"supported by many common server implementations." msgstr "" +"اندازه فایلی به نام *filename* را از سرور درخواست می‌کند. در صورت موفقیت، " +"اندازه فایل به‌عنوان یک عدد صحیح برگردانده می‌شود، در غیر این صورت ``None`` " +"برگردانده می‌شود. توجه داشته باشید که دستور ``SIZE`` استانداردسازی نشده است،" +" اما توسط بسیاری از پیاده‌سازی‌های رایج سرور پشتیبانی می‌شود." -msgid "Send a ``QUIT`` command to the server and close the connection. This is the \"polite\" way to close a connection, but it may raise an exception if the server responds with an error to the ``QUIT`` command. This implies a call to the :meth:`close` method which renders the :class:`FTP` instance useless for subsequent calls (see below)." +msgid "" +"Send a ``QUIT`` command to the server and close the connection. This is the " +"\"polite\" way to close a connection, but it may raise an exception if the " +"server responds with an error to the ``QUIT`` command. This implies a call " +"to the :meth:`close` method which renders the :class:`FTP` instance useless " +"for subsequent calls (see below)." msgstr "" +"یک دستور ``QUIT`` به سرور بفرستید و اتصال را ببندید. این روش «مؤدبانه» برای " +"بستن اتصال است، اما اگر سرور به دستور ``QUIT`` با خطا پاسخ دهد، ممکن است " +"استثنایی پرتاب شود. این مستلزم فراخوانی متد :meth:`close` است که نمونه " +":class:`FTP` را برای فراخوانی‌های بعدی بی‌استفاده می‌کند (در زیر ببینید)." -msgid "Close the connection unilaterally. This should not be applied to an already closed connection such as after a successful call to :meth:`~FTP.quit`. After this call the :class:`FTP` instance should not be used any more (after a call to :meth:`close` or :meth:`~FTP.quit` you cannot reopen the connection by issuing another :meth:`login` method)." -msgstr "" +msgid "" +"Close the connection unilaterally. This should not be applied to an already" +" closed connection such as after a successful call to :meth:`~FTP.quit`. " +"After this call the :class:`FTP` instance should not be used any more (after" +" a call to :meth:`close` or :meth:`~FTP.quit` you cannot reopen the " +"connection by issuing another :meth:`login` method)." +msgstr "" +"اتصال را به‌صورت یک‌طرفه ببندید. این نباید بر اتصال از پیش بسته‌شده اعمال " +"شود، برای نمونه پس از فراخوانی موفق :meth:`~FTP.quit`. پس از این فراخوانی، " +"دیگر نباید از نمونه‌ی :class:`FTP` استفاده شود (پس از فراخوانی :meth:`close`" +" یا :meth:`~FTP.quit` نمی‌توانید با فراخوانی دوباره‌ی متد :meth:`login`، " +"اتصال را بازگشایی کنید)." msgid "FTP_TLS objects" -msgstr "" +msgstr "اشیای FTP_TLS" -msgid "An :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:`4217`. Connect to port 21 implicitly securing the FTP control connection before authenticating." +msgid "" +"An :class:`FTP` subclass which adds TLS support to FTP as described in " +":rfc:`4217`. Connect to port 21 implicitly securing the FTP control " +"connection before authenticating." msgstr "" +"زیرکلاسی از :class:`FTP` که پشتیبانی از TLS را مطابق :rfc:`4217` به FTP " +"می‌افزاید. هنگام اتصال به پورت ۲۱، اتصال کنترلی FTP را پیش از احراز هویت " +"به‌طور ضمنی ایمن می‌کند." -msgid "The user must explicitly secure the data connection by calling the :meth:`prot_p` method." +msgid "" +"The user must explicitly secure the data connection by calling the " +":meth:`prot_p` method." msgstr "" +"کاربر باید با فراخوانی متد :meth:`prot_p`، اتصال داده را به‌صراحت ایمن کند." -msgid "An SSL context object which allows bundling SSL configuration options, certificates and private keys into a single, potentially long-lived, structure. Please read :ref:`ssl-security` for best practices." +msgid "" +"An SSL context object which allows bundling SSL configuration options, " +"certificates and private keys into a single, potentially long-lived, " +"structure. Please read :ref:`ssl-security` for best practices." msgstr "" +"یک شیء زمینه SSL که امکان گردآوری گزینه‌های پیکربندی SSL، گواهی‌ها و کلیدهای" +" خصوصی را در یک ساختار واحد و احتمالاً طولانی‌مدت فراهم می‌کند. لطفاً برای " +"بهترین شیوه‌ها، :ref:`ssl-security` را بخوانید." -msgid "A timeout in seconds for blocking operations like :meth:`~FTP.connect` (default: the global default timeout setting)." +msgid "" +"A timeout in seconds for blocking operations like :meth:`~FTP.connect` " +"(default: the global default timeout setting)." msgstr "" +"مهلت زمانی بر حسب ثانیه برای عملیات‌های مسدودکننده مانند " +":meth:`~FTP.connect` (پیش‌فرض: تنظیم پیش‌فرض سراسری مهلت زمانی)." msgid "Added the *source_address* parameter." -msgstr "" +msgstr "پارامتر *source_address* افزوده شد." -msgid "The class now supports hostname check with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgid "" +"The class now supports hostname check with " +":attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see " +":const:`ssl.HAS_SNI`)." msgstr "" +"این کلاس اکنون از بررسی نام میزبان با :attr:`ssl.SSLContext.check_hostname` " +"و *نشانگر نام سرور* (Server Name Indication) پشتیبانی می‌کند (به " +":const:`ssl.HAS_SNI` مراجعه کنید)." msgid "The deprecated *keyfile* and *certfile* parameters have been removed." -msgstr "" +msgstr "پارامترهای منسوخ *keyfile* و *certfile* حذف شده‌اند." msgid "Here's a sample session using the :class:`FTP_TLS` class::" -msgstr "" +msgstr "در ادامه یک نشست نمونه با استفاده از کلاس :class:`FTP_TLS` آمده است::" msgid "" ">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" @@ -290,57 +607,112 @@ msgid "" ">>> ftps.nlst()\n" "['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', 'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', 'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', 'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', 'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', 'sound', 'tmp', 'ucarp']" msgstr "" +">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" +">>> ftps.login()\n" +"'230 Anonymous user logged in'\n" +">>> ftps.prot_p()\n" +"'200 Data protection level set to \"private\"'\n" +">>> ftps.nlst()\n" +"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', 'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', 'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', 'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', 'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', 'sound', 'tmp', 'ucarp']" -msgid ":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these additional methods and attributes:" +msgid "" +":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " +"additional methods and attributes:" msgstr "" +"کلاس :class:`!FTP_TLS` از :class:`FTP` ارث می‌برد و این متدها و ویژگی‌های " +"اضافی را تعریف می‌کند:" msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." -msgstr "" +msgstr "نسخه‌ی SSL برای استفاده (به‌طور پیش‌فرض :data:`ssl.PROTOCOL_SSLv23`)." -msgid "Set up a secure control connection by using TLS or SSL, depending on what is specified in the :attr:`ssl_version` attribute." +msgid "" +"Set up a secure control connection by using TLS or SSL, depending on what is" +" specified in the :attr:`ssl_version` attribute." msgstr "" +"بسته به آنچه در ویژگی :attr:`ssl_version` مشخص شده است، با استفاده از TLS یا" +" SSL یک اتصال کنترلی امن برقرار کنید." -msgid "The method now supports hostname check with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgid "" +"The method now supports hostname check with " +":attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see " +":const:`ssl.HAS_SNI`)." msgstr "" +"این متد اکنون از بررسی نام میزبان با :attr:`ssl.SSLContext.check_hostname` و" +" *Server Name Indication* پشتیبانی می‌کند (به :const:`ssl.HAS_SNI` مراجعه " +"کنید)." -msgid "Revert control channel back to plaintext. This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports." +msgid "" +"Revert control channel back to plaintext. This can be useful to take " +"advantage of firewalls that know how to handle NAT with non-secure FTP " +"without opening fixed ports." msgstr "" +"کانال کنترل را به متن آشکار بازمی‌گرداند. این می‌تواند برای بهره‌گیری از " +"فایروال‌هایی که می‌دانند چگونه NAT را با FTP غیرامن بدون باز کردن پورت‌های " +"ثابت مدیریت کنند، مفید باشد." msgid "Set up secure data connection." -msgstr "" +msgstr "اتصال امن داده را راه‌اندازی کنید." msgid "Set up clear text data connection." -msgstr "" +msgstr "اتصال داده‌ی متن آشکار (clear text) را برقرار کنید." msgid "Module variables" -msgstr "" +msgstr "متغیرهای ماژول" msgid "Exception raised when an unexpected reply is received from the server." -msgstr "" +msgstr "استثنایی که هنگام دریافت پاسخی غیرمنتظره از سرور پرتاب می‌شود." -msgid "Exception raised when an error code signifying a temporary error (response codes in the range 400--499) is received." +msgid "" +"Exception raised when an error code signifying a temporary error (response " +"codes in the range 400--499) is received." msgstr "" +"استثنایی که هنگام دریافت کد خطایی که نشان‌دهنده‌ی یک خطای موقت است (کدهای " +"پاسخ در بازه‌ی ۴۰۰--۴۹۹) پرتاب می‌شود." -msgid "Exception raised when an error code signifying a permanent error (response codes in the range 500--599) is received." +msgid "" +"Exception raised when an error code signifying a permanent error (response " +"codes in the range 500--599) is received." msgstr "" +"استثنایی که هنگام دریافت کد خطایی که نشان‌دهنده خطای دائمی است (کدهای پاسخ " +"در بازه ۵۰۰--۵۹۹) پرتاب می‌شود." -msgid "Exception raised when a reply is received from the server that does not fit the response specifications of the File Transfer Protocol, i.e. begin with a digit in the range 1--5." +msgid "" +"Exception raised when a reply is received from the server that does not fit " +"the response specifications of the File Transfer Protocol, i.e. begin with a" +" digit in the range 1--5." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که پاسخی از سرور دریافت شود که با مشخصات " +"پاسخ پروتکل انتقال فایل مطابقت ندارد، یعنی با رقمی در بازه‌ی ۱--۵ آغاز " +"نمی‌شود." -msgid "The set of all exceptions (as a tuple) that methods of :class:`FTP` instances may raise as a result of problems with the FTP connection (as opposed to programming errors made by the caller). This set includes the four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." +msgid "" +"The set of all exceptions (as a tuple) that methods of :class:`FTP` " +"instances may raise as a result of problems with the FTP connection (as " +"opposed to programming errors made by the caller). This set includes the " +"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." msgstr "" +"مجموعه‌ی تمام استثناها (به‌صورت یک چندتایی ) که متدهای نمونه‌های " +":class:`FTP` ممکن است آن‌ها را در اثر مشکلات اتصال FTP (در مقابل خطاهای " +"برنامه‌نویسی ایجادشده توسط فراخواننده) پرتاب کنند. این مجموعه شامل چهار " +"استثنای فهرست‌شده در بالا و همچنین :exc:`OSError` و :exc:`EOFError` است." msgid "Module :mod:`netrc`" -msgstr "" +msgstr "ماژول :mod:`netrc`" -msgid "Parser for the :file:`.netrc` file format. The file :file:`.netrc` is typically used by FTP clients to load user authentication information before prompting the user." +msgid "" +"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " +"typically used by FTP clients to load user authentication information before" +" prompting the user." msgstr "" +"پارسرای برای قالب فایل :file:`.netrc`. فایل :file:`.netrc` معمولاً " +"توسط کلاینت‌های FTP برای بارگذاری اطلاعات احراز هویت کاربر پیش از پرسش از " +"کاربر استفاده می‌شود." msgid "FTP" -msgstr "" +msgstr "FTP" msgid "protocol" -msgstr "" +msgstr "پروتکل" msgid "ftplib (standard module)" -msgstr "" +msgstr "ftplib (ماژول استاندارد)" diff --git a/library/functional.po b/library/functional.po index 5f085d1d1..e278efe05 100644 --- a/library/functional.po +++ b/library/functional.po @@ -22,10 +22,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Functional Programming Modules" -msgstr "" +msgstr "ماژول‌های برنامه‌نویسی تابعی" -msgid "The modules described in this chapter provide functions and classes that support a functional programming style, and general operations on callables." +msgid "" +"The modules described in this chapter provide functions and classes that " +"support a functional programming style, and general operations on callables." msgstr "" +"ماژول‌های توصیف‌شده در این فصل، توابع و کلاس‌هایی را فراهم می‌کنند که از سبک" +" برنامه‌نویسی تابعی پشتیبانی می‌کنند، و نیز عملیات عمومی روی اشیای " +"فراخوانی‌پذیر را ارائه می‌دهند." msgid "The following modules are documented in this chapter:" -msgstr "" +msgstr "ماژول‌های زیر در این فصل مستند شده‌اند:" diff --git a/library/functions.po b/library/functions.po index f108687fc..80250453f 100644 --- a/library/functions.po +++ b/library/functions.po @@ -18,7 +18,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2026-08-26 06:41+0330\n" +"PO-Revision-Date: 2026-09-04 07:21+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/)\n" "Language: fa\n" @@ -31,8 +31,12 @@ msgstr "" msgid "Built-in Functions" msgstr "توابع توکار" -msgid "The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order." -msgstr "مفسر پایتون دارای تعدادی تابع و نوع داده (type) است که در آن بصورت توکار (built-in) همیشه در دسترس می‌باشند. آن‌ها در اینجا به ترتیب حروف الفبا فهرست شده‌اند." +msgid "" +"The Python interpreter has a number of functions and types built into it that are always available. They are listed " +"here in alphabetical order." +msgstr "" +"مفسر پایتون دارای تعدادی تابع و نوع داده (type) است که در آن بصورت توکار (built-in) همیشه در دسترس می‌باشند. آن‌ها در " +"اینجا به ترتیب حروف الفبا فهرست شده‌اند." msgid "**A**" msgstr "**A**" @@ -307,11 +311,19 @@ msgstr "**_**" msgid ":func:`__import__`" msgstr ":func:`__import__`" -msgid "Return the absolute value of a number. The argument may be an integer, a floating-point number, or an object implementing :meth:`~object.__abs__`. If the argument is a complex number, its magnitude is returned." -msgstr "مقدار قدر مطلق یک عدد را برمی‌گرداند. آرگومان می تواند یک عدد صحیح، یک عدد اعشاری، یا یک شیء که :meth:`~object.__abs__` را پیاده‌سازی می‌کند، باشد. اگر ارگومان یک عدد مختلط باشد، بزرگی آن بازگردانده می‌شود." +msgid "" +"Return the absolute value of a number. The argument may be an integer, a floating-point number, or an object " +"implementing :meth:`~object.__abs__`. If the argument is a complex number, its magnitude is returned." +msgstr "" +"مقدار قدر مطلق یک عدد را برمی‌گرداند. آرگومان می تواند یک عدد صحیح، یک عدد اعشاری، یا یک شیء " +"که :meth:`~object.__abs__` را پیاده‌سازی می‌کند، باشد. اگر ارگومان یک عدد مختلط باشد، بزرگی آن بازگردانده می‌شود." -msgid "Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. Equivalent to calling ``x.__aiter__()``." -msgstr "بازگرداندن یک :term:`asynchronous iterator` برای یک :term:`asynchronous iterable` معادل فراخوانی ``x.__aiter__()`` است." +msgid "" +"Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. Equivalent to calling " +"``x.__aiter__()``." +msgstr "" +"بازگرداندن یک :term:`asynchronous iterator` برای یک :term:`asynchronous iterable` معادل فراخوانی ``x.__aiter__()`` " +"است." msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." msgstr "توجه: برخلاف :func:`iter`، :func:`aiter` نسخه دو آرگومانی ندارد." @@ -332,17 +344,31 @@ msgstr "" " return False\n" " return True" -msgid "When awaited, return the next item from the given :term:`asynchronous iterator`, or *default* if given and the iterator is exhausted." -msgstr "هنگام اِنتظار (await)، عنصر بعدی را از :term:`asynchronous iterator` داده شده برمی‌گرداند، یا اگر آرگومان *default* ارائه شده و تکرارکننده به پایان رسیده باشد، مقدار *default* را برمی‌گرداند." +msgid "" +"When awaited, return the next item from the given :term:`asynchronous iterator`, or *default* if given and the " +"iterator is exhausted." +msgstr "" +"هنگام اِنتظار (await)، عنصر بعدی را از :term:`asynchronous iterator` داده شده برمی‌گرداند، یا اگر آرگومان *default* " +"ارائه شده و پیمایش‌گر به پایان رسیده باشد، مقدار *default* را برمی‌گرداند." msgid "This is the async variant of the :func:`next` builtin, and behaves similarly." msgstr "این، نسخه ناهمگامِ تابع توکار :func:`next` است و به طور مشابه عمل می‌کند." -msgid "This calls the :meth:`~object.__anext__` method of *async_iterator*, returning an :term:`awaitable`. Awaiting this returns the next value of the iterator. If *default* is given, it is returned if the iterator is exhausted, otherwise :exc:`StopAsyncIteration` is raised." -msgstr "این متد :meth:`~object.__anext__` از *async_iterator* را فراخوانی می کند و یک :term:`awaitable` را برمی گرداند. در انتظار این مقدار بعدی تکرارگر را برمی گرداند. اگر *default* داده شود، اگر تکرارگر تمام شده باشد، برگردانده می شود، در غیر این صورت :exc:`StopAsyncIteration` پرتاب میشود." +msgid "" +"This calls the :meth:`~object.__anext__` method of *async_iterator*, returning an :term:`awaitable`. Awaiting this " +"returns the next value of the iterator. If *default* is given, it is returned if the iterator is exhausted, " +"otherwise :exc:`StopAsyncIteration` is raised." +msgstr "" +"این متد :meth:`~object.__anext__` از *async_iterator* را فراخوانی می کند و یک :term:`awaitable` را برمی گرداند. در " +"انتظار این مقدار بعدی پیمایش‌گر را برمی گرداند. اگر *default* داده شود، اگر پیمایش‌گر تمام شده باشد، برگردانده می شود، " +"در غیر این صورت :exc:`StopAsyncIteration` پرتاب میشود." -msgid "Return ``True`` if any element of the *iterable* is true. If the iterable is empty, return ``False``. Equivalent to::" -msgstr "اگر هر عنصری از *iterable* درست باشد، ``True`` را برگردانید. اگر iterable خالی باشد، ``False`` را برگردانید. معادل با::" +msgid "" +"Return ``True`` if any element of the *iterable* is true. If the iterable is empty, return ``False``. Equivalent " +"to::" +msgstr "" +"اگر هر عنصری از *iterable* درست باشد، ``True`` را برگردانید. اگر iterable خالی باشد، ``False`` را برگردانید. معادل " +"با::" msgid "" "def any(iterable):\n" @@ -357,11 +383,23 @@ msgstr "" " return True\n" " return False" -msgid "As :func:`repr`, return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by :func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string similar to that returned by :func:`repr` in Python 2." -msgstr "مانند تابع :func:`repr`، رشته‌ای حاوی نمایش قابل چاپ یک شیء را برمی‌گرداند، اما نویسه‌های غیر اَسکی (non-ASCII) را در رشته‌ی بازگردانده‌شده توسط تابع :func:`repr`، با استفاده از توالی‌های گریز (escapes) ``\\x``، ``\\u`` یا ``\\U`` اِسکِیپ (escape) می‌کند. این عمل، رشته‌ای مشابه آنچه تابع :func:`repr` در پایتون ۲ بازمی‌گرداند، تولید می‌کند." +msgid "" +"As :func:`repr`, return a string containing a printable representation of an object, but escape the non-ASCII " +"characters in the string returned by :func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a " +"string similar to that returned by :func:`repr` in Python 2." +msgstr "" +"مانند تابع :func:`repr`، رشته‌ای حاوی نمایش قابل چاپ یک شیء را برمی‌گرداند، اما نویسه‌های غیر اَسکی (non-ASCII) را در " +"رشته‌ی بازگردانده‌شده توسط تابع :func:`repr`، با استفاده از توالی‌های گریز (escapes) ``\\x``، ``\\u`` یا ``\\U`` اِسکِیپ " +"(escape) می‌کند. این عمل، رشته‌ای مشابه آنچه تابع :func:`repr` در پایتون ۲ بازمی‌گرداند، تولید می‌کند." -msgid "Convert an integer number to a binary string prefixed with \"0b\". The result is a valid Python expression. If *integer* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. Some examples:" -msgstr "تبدیل یک عدد صحیح به یک رشته باینری که با \"0b\" پیشوند شده است. نتیجه یک عبارت معتبر پایتون خواهد بود. اگر *integer* یک شیء پایتون :class:`int` نباشد، لازم است یک متد :meth:`~object.__index__` تعریف کند که یک عدد صحیح برگرداند. برخی مثال ها:" +msgid "" +"Convert an integer number to a binary string prefixed with \"0b\". The result is a valid Python expression. If " +"*integer* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an " +"integer. Some examples:" +msgstr "" +"تبدیل یک عدد صحیح به یک رشته دودویی که با \"0b\" پیشوند شده است. نتیجه یک عبارت معتبر پایتون خواهد بود. اگر " +"*integer* یک شیء پایتون :class:`int` نباشد، لازم است یک متد :meth:`~object.__index__` تعریف کند که یک عدد صحیح " +"برگرداند. برخی مثال ها:" msgid "If the prefix \"0b\" is desired or not, you can use either of the following ways." msgstr "چنانچه پیشوند \"0b\" مطلوب باشد یا نباشد، می‌توانید از یکی از روش‌های زیر استفاده کنید." @@ -372,41 +410,88 @@ msgstr "همچنین برای نمایش مقادیر منفی به‌صورت msgid "See also :func:`format` for more information." msgstr "همچنین برای اطلاعات بیشتر، به تابع :func:`format` مراجعه کنید." -msgid "Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is converted using the standard :ref:`truth testing procedure `. If the argument is false or omitted, this returns ``False``; otherwise, it returns ``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). It cannot be subclassed further. Its only instances are ``False`` and ``True`` (see :ref:`typebool`)." -msgstr "یک مقدار بولی، یعنی یکی از ``True`` یا ``False`` را بر می‌گرداند. آرگومان با استفاده از استاندارد :ref:`truth testing procedure ` تبدیل می شود. اگر آرگومان نادرست یا حذف شده باشد، ``False`` را برمی گرداند. در غیر این صورت، ``True`` را برمی گرداند. کلاس :class:`bool` یک زیر کلاس از :class:`int` است (به :ref:`typesnumeric` مراجعه کنید). این کلاس دیگر قابل زیرکلاس‌بندی نیست. تنها نمونه های آن ``False`` و ``True`` هستند (به :ref:`typebool` مراجعه کنید)." +msgid "" +"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is converted using the standard :ref:`truth " +"testing procedure `. If the argument is false or omitted, this returns ``False``; otherwise, it returns " +"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). It cannot be subclassed " +"further. Its only instances are ``False`` and ``True`` (see :ref:`typebool`)." +msgstr "" +"یک مقدار بولی، یعنی یکی از ``True`` یا ``False`` را بر می‌گرداند. آرگومان با استفاده از استاندارد :ref:`truth " +"testing procedure ` تبدیل می شود. اگر آرگومان نادرست یا حذف شده باشد، ``False`` را برمی گرداند. در غیر این " +"صورت، ``True`` را برمی گرداند. کلاس :class:`bool` یک زیر کلاس از :class:`int` است (به :ref:`typesnumeric` مراجعه " +"کنید). این کلاس دیگر قابل زیرکلاس‌بندی نیست. تنها نمونه های آن ``False`` و ``True`` هستند (به :ref:`typebool` مراجعه " +"کنید)." msgid "The parameter is now positional-only." msgstr "این آرگومان اکنون فقط‌جایگاهی (positional-only) است." -msgid "This function drops you into the debugger at the call site. Specifically, it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` expecting no arguments. In this case, it is purely a convenience function so you don't have to explicitly import :mod:`pdb` or type as much code to enter the debugger. However, :func:`sys.breakpointhook` can be set to some other function and :func:`breakpoint` will automatically call that, allowing you to drop into the debugger of choice. If :func:`sys.breakpointhook` is not accessible, this function will raise :exc:`RuntimeError`." -msgstr "این تابع، اجرای برنامه را در محل فراخوانی متوقف کرده و شما را وارد محیط اشکال‌زدا (debugger) می‌کند. به طور خاص، این تابع، :func:`sys.breakpointhook` را فراخوانی کرده و مقادیر ``args`` و ``kws`` مستقیماً به آن ارسال (pass) می‌کند. به طور پیش‌فرض، تابع ``sys.breakpointhook()`` بدون نیاز به هیچ آرگومانی :func:`pdb.set_trace` را فراخوانی می کند. در این حالت، این صرفاً یک تابع کمکی (convenience function) است تا مجبور نباشید ماژول :mod:`pdb` را به صراحت ایمپورت (import) کنید یا برای ورود به اشکال‌زدا، کد زیادی بنویسید. با این حال، می‌توان :func:`sys.breakpointhook` را روی تابع دیگری تنظیم کرد و در این صورت، :func:`breakpoint` به طور خودکار آن را فراخوانی می کند و به شما این امکان را می دهد که به اشکال‌زدای مورد نظر خود وارد شوید. اگر :func:`sys.breakpointhook` قابل دسترسی نباشد، این تابع، استثنای :exc:`RuntimeError` را پرتاب خواهد کرد." +msgid "" +"This function drops you into the debugger at the call site. Specifically, it calls :func:`sys.breakpointhook`, " +"passing ``args`` and ``kws`` straight through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` " +"expecting no arguments. In this case, it is purely a convenience function so you don't have to explicitly " +"import :mod:`pdb` or type as much code to enter the debugger. However, :func:`sys.breakpointhook` can be set to " +"some other function and :func:`breakpoint` will automatically call that, allowing you to drop into the debugger of " +"choice. If :func:`sys.breakpointhook` is not accessible, this function will raise :exc:`RuntimeError`." +msgstr "" +"این تابع، اجرای برنامه را در محل فراخوانی متوقف کرده و شما را وارد محیط اشکال‌زدا (debugger) می‌کند. به طور خاص، این " +"تابع، :func:`sys.breakpointhook` را فراخوانی کرده و مقادیر ``args`` و ``kws`` مستقیماً به آن ارسال (pass) می‌کند. به " +"طور پیش‌فرض، تابع ``sys.breakpointhook()`` بدون نیاز به هیچ آرگومانی :func:`pdb.set_trace` را فراخوانی می کند. در این " +"حالت، این صرفاً یک تابع کمکی (convenience function) است تا مجبور نباشید ماژول :mod:`pdb` را به صراحت ایمپورت (import) " +"کنید یا برای ورود به اشکال‌زدا، کد زیادی بنویسید. با این حال، می‌توان :func:`sys.breakpointhook` را روی تابع دیگری " +"تنظیم کرد و در این صورت، :func:`breakpoint` به طور خودکار آن را فراخوانی می کند و به شما این امکان را می دهد که به " +"اشکال‌زدای مورد نظر خود وارد شوید. اگر :func:`sys.breakpointhook` قابل دسترسی نباشد، این تابع، " +"استثنای :exc:`RuntimeError` را پرتاب خواهد کرد." -msgid "By default, the behavior of :func:`breakpoint` can be changed with the :envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys.breakpointhook` for usage details." -msgstr "به طور پیش‌فرض، رفتار تابع :func:`breakpoint` را می‌توان با متغیر محیطی :envvar:`PYTHONBREAKPOINT` تغییر داد. برای جزئیات استفاده، به تابع :func:`sys.breakpointhook` مراجعه کنید." +msgid "" +"By default, the behavior of :func:`breakpoint` can be changed with the :envvar:`PYTHONBREAKPOINT` environment " +"variable. See :func:`sys.breakpointhook` for usage details." +msgstr "" +"به طور پیش‌فرض، رفتار تابع :func:`breakpoint` را می‌توان با متغیر محیطی :envvar:`PYTHONBREAKPOINT` تغییر داد. برای " +"جزئیات استفاده، به تابع :func:`sys.breakpointhook` مراجعه کنید." msgid "Note that this is not guaranteed if :func:`sys.breakpointhook` has been replaced." msgstr "توجه داشته باشید که این امر تضمین نمی‌شود اگر تابع :func:`sys.breakpointhook` جایگزین شده باشد." msgid "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with argument ``breakpointhook``." -msgstr "یک :ref:`رویداد ممیزی ` ``builtins.breakpoint`` با آرگومان ``breakpointhook`` پرتاب می‌کند." +msgstr "یک :ref:`رویداد حسابرسی ` ``builtins.breakpoint`` با آرگومان ``breakpointhook`` پرتاب می‌کند." -msgid "Return a new array of bytes. The :class:`bytearray` class is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in :ref:`typesseq-mutable`, as well as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." -msgstr "یک آرایهٔ جدید از بایت‌ها را برمی‌گرداند. کلاس :class:`bytearray` دنباله‌ای قابل‌تغییر از اعداد صحیح در بازهٔ 0 <= x < 256 است. این کلاس بیشتر متدهای معمول دنباله‌های قابل‌تغییر را دارد که در :ref:`typesseq-mutable` شرح داده شده‌اند، و همچنین بیشتر متدهایی را دارد که نوع :class:`bytes` دارد؛ به :ref:`bytes-methods` مراجعه کنید." +msgid "" +"Return a new array of bytes. The :class:`bytearray` class is a mutable sequence of integers in the range 0 <= x < " +"256. It has most of the usual methods of mutable sequences, described in :ref:`typesseq-mutable`, as well as most " +"methods that the :class:`bytes` type has, see :ref:`bytes-methods`." +msgstr "" +"یک آرایه‌ی جدید از بایت‌ها را برمی‌گرداند. کلاس :class:`bytearray` دنباله‌ای قابل‌تغییر از اعداد صحیح در بازه‌ی 0 <= x < " +"256 است. این کلاس بیشتر متدهای معمول دنباله‌های قابل‌تغییر را دارد که در :ref:`typesseq-mutable` شرح داده شده‌اند، و " +"همچنین بیشتر متدهایی را دارد که نوع :class:`bytes` دارد؛ به :ref:`bytes-methods` مراجعه کنید." msgid "The optional *source* parameter can be used to initialize the array in a few different ways:" msgstr "از پارامتر اختیاری *source* می‌توان برای مقداردهی اولیه آرایه به چند روش مختلف استفاده کرد:" -msgid "If it is a *string*, you must also give the *encoding* (and optionally, *errors*) parameters; :func:`bytearray` then converts the string to bytes using :meth:`str.encode`." -msgstr "اگر *source* یک *رشته* «*string*» باشد، باید پارامترهای *encoding* و (به‌صورت اختیاری) *errors* را نیز مشخص کنید؛ سپس تابع :func:`bytearray` آن رشته را با استفاده از متد :meth:`str.encode` به بایت‌ها تبدیل می‌کند." +msgid "" +"If it is a *string*, you must also give the *encoding* (and optionally, *errors*) parameters; :func:`bytearray` then " +"converts the string to bytes using :meth:`str.encode`." +msgstr "" +"اگر *source* یک *رشته* «*string*» باشد، باید پارامترهای *encoding* و (به‌صورت اختیاری) *errors* را نیز مشخص کنید؛ سپس " +"تابع :func:`bytearray` آن رشته را با استفاده از متد :meth:`str.encode` به بایت‌ها تبدیل می‌کند." msgid "If it is an *integer*, the array will have that size and will be initialized with null bytes." -msgstr "اگر «*source*» یک *عدد صحیح* «integer» باشد، آرایه به اندازه همان عدد ایجاد شده و با بایت‌های تهی «null byte» مقداردهی اولیه خواهد شد." +msgstr "" +"اگر «*source*» یک *عدد صحیح* «integer» باشد، آرایه به اندازه همان عدد ایجاد شده و با بایت‌های تهی «null byte» " +"مقداردهی اولیه خواهد شد." -msgid "If it is an object conforming to the :ref:`buffer interface `, a read-only buffer of the object will be used to initialize the bytes array." -msgstr "اگر آرگومان، شیئی سازگار با :ref:`رابط بافر ` باشد، از یک بافر فقط‌خواندنیِ آن شیء برای مقداردهی اولیهٔ آرایهٔ بایت‌ها استفاده خواهد شد." +msgid "" +"If it is an object conforming to the :ref:`buffer interface `, a read-only buffer of the object will " +"be used to initialize the bytes array." +msgstr "" +"اگر آرگومان، شیئی سازگار با :ref:`رابط بافر ` باشد، از یک بافر فقط‌خواندنیِ آن شیء برای مقداردهی اولیه‌ی " +"آرایه‌ی بایت‌ها استفاده خواهد شد." -msgid "If it is an *iterable*, it must be an iterable of integers in the range ``0 <= x < 256``, which are used as the initial contents of the array." -msgstr "اگر «*source*» یک *تکرارپذیر* «iterable» باشد، باید یک تکرارپذیر از اعداد صحیح در بازه ``0 <= x < 256`` باشد، که این اعداد به‌عنوان محتویات اولیه آرایه استفاده می‌شوند." +msgid "" +"If it is an *iterable*, it must be an iterable of integers in the range ``0 <= x < 256``, which are used as the " +"initial contents of the array." +msgstr "" +"اگر «*source*» یک *پیمایش‌پذیر* «iterable» باشد، باید یک پیمایش‌پذیر از اعداد صحیح در بازه ``0 <= x < 256`` باشد، که " +"این اعداد به‌عنوان محتویات اولیه آرایه استفاده می‌شوند." msgid "Without an argument, an array of size 0 is created." msgstr "بدون آرگومان، یک آرایه با اندازه صفر «0» ایجاد می شود." @@ -414,8 +499,14 @@ msgstr "بدون آرگومان، یک آرایه با اندازه صفر «0» msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "همچنین به :ref:`binaryseq` و :ref:`typebytearray` مراجعه کنید." -msgid "Return a new \"bytes\" object which is an immutable sequence of integers in the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the same indexing and slicing behavior." -msgstr "یک شیء «bytes» جدید را برمی‌گرداند که دنباله‌ای تغییرناپذیر از اعداد صحیح در بازهٔ ``0 <= x < 256`` است. :class:`bytes` نسخهٔ تغییرناپذیر :class:`bytearray` است؛ همان متدهای غیرتغییردهنده و همان رفتار اندیس‌گذاری و برش (slicing) را دارد." +msgid "" +"Return a new \"bytes\" object which is an immutable sequence of integers in the range ``0 <= x < " +"256``. :class:`bytes` is an immutable version of :class:`bytearray` -- it has the same non-mutating methods and the " +"same indexing and slicing behavior." +msgstr "" +"یک شیء «bytes» جدید را برمی‌گرداند که دنباله‌ای تغییرناپذیر از اعداد صحیح در بازه‌ی ``0 <= x < 256`` " +"است. :class:`bytes` نسخه‌ی تغییرناپذیر :class:`bytearray` است؛ همان متدهای غیرتغییردهنده و همان رفتار اندیس‌گذاری و " +"برش (slicing) را دارد." msgid "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "بر این اساس، آرگومان‌های سازنده همانند :func:`bytearray` تفسیر می‌شوند." @@ -426,23 +517,43 @@ msgstr "اشیای bytes را می‌توان با استفاده از ثابت msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "همچنین به :ref:`binaryseq`، :ref:`typebytes` و :ref:`bytes-methods` مراجعه کنید." -msgid "Return :const:`True` if the *object* argument appears callable, :const:`False` if not. If this returns ``True``, it is still possible that a call fails, but if it is ``False``, calling *object* will never succeed. Note that classes are callable (calling a class returns a new instance); instances are callable if their class has a :meth:`~object.__call__` method." -msgstr "اگر آرگومان *object* فراخوانی‌پذیر باشد، مقدار :const:`True` و در غیر این صورت مقدار :const:`False` را برمی‌گرداند. اگر نتیجه ``True`` باشد، همچنان ممکن است فراخوانی با شکست مواجه شود؛ اما اگر ``False`` باشد، فراخوانی *object* هرگز موفق نخواهد شد. توجه داشته باشید که کلاس‌ها فراخوانی‌پذیر هستند (فراخوانی یک کلاس یک نمونهٔ جدید برمی‌گرداند) و نمونه‌ها نیز در صورتی فراخوانی‌پذیر هستند که کلاس آن‌ها متد :meth:`~object.__call__` را داشته باشد." +msgid "" +"Return :const:`True` if the *object* argument appears callable, :const:`False` if not. If this returns ``True``, it " +"is still possible that a call fails, but if it is ``False``, calling *object* will never succeed. Note that classes " +"are callable (calling a class returns a new instance); instances are callable if their class has " +"a :meth:`~object.__call__` method." +msgstr "" +"اگر آرگومان *object* فراخوانی‌پذیر باشد، مقدار :const:`True` و در غیر این صورت مقدار :const:`False` را برمی‌گرداند. " +"اگر نتیجه ``True`` باشد، همچنان ممکن است فراخوانی با شکست مواجه شود؛ اما اگر ``False`` باشد، فراخوانی *object* هرگز " +"موفق نخواهد شد. توجه داشته باشید که کلاس‌ها فراخوانی‌پذیر هستند (فراخوانی یک کلاس یک نمونه‌ی جدید برمی‌گرداند) و نمونه‌ها " +"نیز در صورتی فراخوانی‌پذیر هستند که کلاس آن‌ها متد :meth:`~object.__call__` را داشته باشد." msgid "This function was first removed in Python 3.0 and then brought back in Python 3.2." msgstr "این تابع ابتدا در پایتون ۳٫۰ حذف شد و سپس در پایتون ۳٫۲ دوباره بازگردانده شد." -msgid "Return the string representing a character with the specified Unicode code point. For example, ``chr(97)`` returns the string ``'a'``, while ``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." -msgstr "رشته‌ای را که نویسهٔ متناظر با نقطهٔ کد یونی‌کد مشخص‌شده را نمایش می‌دهد، برمی‌گرداند. برای مثال، ``chr(97)`` رشتهٔ ``'a'`` و ``chr(8364)`` رشتهٔ ``'€'`` را برمی‌گرداند. این تابع معکوس :func:`ord` است." +msgid "" +"Return the string representing a character with the specified Unicode code point. For example, ``chr(97)`` returns " +"the string ``'a'``, while ``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." +msgstr "" +"رشته‌ای را که نویسه‌ی متناظر با نقطه‌ی کد یونیکد مشخص‌شده را نمایش می‌دهد، برمی‌گرداند. برای مثال، ``chr(97)`` رشته‌ی " +"``'a'`` و ``chr(8364)`` رشته‌ی ``'€'`` را برمی‌گرداند. این تابع معکوس :func:`ord` است." -msgid "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16). :exc:`ValueError` will be raised if it is outside that range." -msgstr "بازهٔ معتبر برای این آرگومان از ۰ تا ۱٬۱۱۴٬۱۱۱ (برابر با 0x10FFFF در مبنای ۱۶) است. اگر مقدار خارج از این بازه باشد، استثنای :exc:`ValueError` پرتاب خواهد شد." +msgid "" +"The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16). :exc:`ValueError` will be " +"raised if it is outside that range." +msgstr "" +"بازه‌ی معتبر برای این آرگومان از ۰ تا ۱٬۱۱۴٬۱۱۱ (برابر با 0x10FFFF در مبنای ۱۶) است. اگر مقدار خارج از این بازه باشد، " +"استثنای :exc:`ValueError` پرتاب خواهد شد." msgid "Transform a method into a class method." msgstr "یک متد را به متد کلاسی تبدیل می‌کند." -msgid "A class method receives the class as an implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom::" -msgstr "یک متد کلاس، همان‌طور که متد نمونه، نمونه را به‌عنوان نخستین آرگومان ضمنی دریافت می‌کند، کلاس را به‌عنوان نخستین آرگومان ضمنی دریافت می‌کند. برای تعریف یک متد کلاس، از الگوی زیر استفاده کنید::" +msgid "" +"A class method receives the class as an implicit first argument, just like an instance method receives the instance. " +"To declare a class method, use this idiom::" +msgstr "" +"یک متد کلاس، همان‌طور که متد نمونه، نمونه را به‌عنوان نخستین آرگومان ضمنی دریافت می‌کند، کلاس را به‌عنوان نخستین آرگومان " +"ضمنی دریافت می‌کند. برای تعریف یک متد کلاس، از الگوی زیر استفاده کنید::" msgid "" "class C:\n" @@ -454,40 +565,103 @@ msgstr "" " def f(cls, arg1, arg2): ..." msgid "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:`function` for details." -msgstr "شکل ``@classmethod`` یک :term:`تزئین‌کننده ` تابع است؛ برای جزئیات به :ref:`function` مراجعه کنید." +msgstr "" +"شکل ``@classmethod`` یک :term:`تزئین‌کننده ` تابع است؛ برای جزئیات به :ref:`تابع ` مراجعه کنید." -msgid "A class method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument." -msgstr "یک متد کلاس را می‌توان هم روی خود کلاس (مانند ``C.f()``) و هم روی یک نمونه (مانند ``C().f()``) فراخوانی کرد. در حالت دوم، نمونه نادیده گرفته می‌شود و فقط کلاس آن در نظر گرفته می‌شود. اگر متد کلاس برای یک کلاس مشتق‌شده فراخوانی شود، شیء کلاس مشتق‌شده به‌عنوان نخستین آرگومان ضمنی ارسال می‌شود." +msgid "" +"A class method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). The " +"instance is ignored except for its class. If a class method is called for a derived class, the derived class object " +"is passed as the implied first argument." +msgstr "" +"یک متد کلاس را می‌توان هم روی خود کلاس (مانند ``C.f()``) و هم روی یک نمونه (مانند ``C().f()``) فراخوانی کرد. در حالت " +"دوم، نمونه نادیده گرفته می‌شود و فقط کلاس آن در نظر گرفته می‌شود. اگر متد کلاس برای یک کلاس مشتق‌شده فراخوانی شود، شیء " +"کلاس مشتق‌شده به‌عنوان نخستین آرگومان ضمنی ارسال می‌شود." -msgid "Class methods are different than C++ or Java static methods. If you want those, see :func:`staticmethod` in this section. For more information on class methods, see :ref:`types`." -msgstr "متدهای کلاس با متدهای ایستای زبان‌های ++C یا Java تفاوت دارند. اگر به آن نوع متدها نیاز دارید، به :func:`staticmethod` در همین بخش مراجعه کنید. برای اطلاعات بیشتر دربارهٔ متدهای کلاس، :ref:`types` را ببینید." +msgid "" +"Class methods are different than C++ or Java static methods. If you want those, see :func:`staticmethod` in this " +"section. For more information on class methods, see :ref:`types`." +msgstr "" +"متدهای کلاس با متدهای ایستای زبان‌های ++C یا Java تفاوت دارند. اگر به آن نوع متدها نیاز دارید، " +"به :func:`staticmethod` در همین بخش مراجعه کنید. برای اطلاعات بیشتر درباره‌ی متدهای کلاس، :ref:`types` را ببینید." msgid "Class methods can now wrap other :term:`descriptors ` such as :func:`property`." -msgstr "اکنون متدهای کلاس می‌توانند سایر :term:`توصیفگرها `، مانند :func:`property`، را دربر بگیرند." +msgstr "اکنون متدهای کلاس می‌توانند سایر :term:`توصیف‌گرها `، مانند :func:`property`، را دربر بگیرند." -msgid "Class methods now inherit the method attributes (:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a new ``__wrapped__`` attribute." -msgstr "اکنون متدهای کلاس ویژگی‌های متد (:attr:`~function.__module__`، :attr:`~function.__name__`، :attr:`~function.__qualname__`، :attr:`~function.__doc__` و :attr:`~function.__annotations__`) را به ارث می‌برند و همچنین دارای ویژگی جدید ``__wrapped__`` هستند." +msgid "" +"Class methods now inherit the method attributes " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " +"and :attr:`~function.__annotations__`) and have a new ``__wrapped__`` attribute." +msgstr "" +"اکنون متدهای کلاس ویژگی‌های متد " +"(:attr:`~function.__module__`، :attr:`~function.__name__`، :attr:`~function.__qualname__`، :attr:`~function.__doc__` " +"و :attr:`~function.__annotations__`) را به ارث می‌برند و همچنین دارای ویژگی جدید ``__wrapped__`` هستند." msgid "Class methods can no longer wrap other :term:`descriptors ` such as :func:`property`." -msgstr "دیگر متدهای کلاس نمی‌توانند سایر :term:`توصیفگرها `، مانند :func:`property`، را دربر بگیرند." +msgstr "دیگر متدهای کلاس نمی‌توانند سایر :term:`توصیف‌گرها `، مانند :func:`property`، را دربر بگیرند." -msgid "Compile the *source* into a code or AST object. Code objects can be executed by :func:`exec` or :func:`eval`. *source* can either be a normal string, a byte string, or an AST object. Refer to the :mod:`ast` module documentation for information on how to work with AST objects." -msgstr "*source* را به یک شیء کد یا AST کامپایل می‌کند. اشیای کد را می‌توان با :func:`exec` یا :func:`eval` اجرا کرد. *source* می‌تواند یک رشتهٔ معمولی، یک رشتهٔ بایتی یا یک شیء AST باشد. برای اطلاعات بیشتر دربارهٔ کار با اشیای AST، به مستندات ماژول :mod:`ast` مراجعه کنید." +msgid "" +"Compile the *source* into a code or AST object. Code objects can be executed by :func:`exec` or :func:`eval`. " +"*source* can either be a normal string, a byte string, or an AST object. Refer to the :mod:`ast` module " +"documentation for information on how to work with AST objects." +msgstr "" +"*source* را به یک شیء کد یا AST کامپایل می‌کند. اشیای کد را می‌توان با :func:`exec` یا :func:`eval` اجرا کرد. *source* " +"می‌تواند یک رشته‌ی معمولی، یک رشته‌ی بایتی یا یک شیء AST باشد. برای اطلاعات بیشتر درباره‌ی کار با اشیای AST، به مستندات " +"ماژول :mod:`ast` مراجعه کنید." -msgid "The *filename* argument should give the file from which the code was read; pass some recognizable value if it wasn't read from a file (``''`` is commonly used)." -msgstr "آرگومان *filename* باید نام پرونده‌ای را مشخص کند که کد از آن خوانده شده است؛ اگر کد از پرونده خوانده نشده، مقدار قابل تشخیصی را ارسال کنید (معمولاً از ``''`` استفاده می‌شود)." +msgid "" +"The *filename* argument should give the file from which the code was read; pass some recognizable value if it wasn't " +"read from a file (``''`` is commonly used)." +msgstr "" +"آرگومان *filename* باید نام پرونده‌ای را مشخص کند که کد از آن خوانده شده است؛ اگر کد از پرونده خوانده نشده، مقدار " +"قابل تشخیصی را ارسال کنید (معمولاً از ``''`` استفاده می‌شود)." -msgid "The *mode* argument specifies what kind of code must be compiled; it can be ``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if it consists of a single expression, or ``'single'`` if it consists of a single interactive statement (in the latter case, expression statements that evaluate to something other than ``None`` will be printed)." -msgstr "آرگومان *mode* مشخص می‌کند که چه نوع کدی باید کامپایل شود؛ اگر *source* شامل دنباله‌ای از دستورها باشد، می‌تواند ``'exec'`` باشد؛ اگر شامل تنها یک عبارت باشد، ``'eval'``؛ و اگر شامل تنها یک دستور تعاملی باشد، ``'single'`` (در حالت آخر، اگر عبارت مقداری غیر از ``None`` تولید کند، آن مقدار چاپ خواهد شد)." +msgid "" +"The *mode* argument specifies what kind of code must be compiled; it can be ``'exec'`` if *source* consists of a " +"sequence of statements, ``'eval'`` if it consists of a single expression, or ``'single'`` if it consists of a single " +"interactive statement (in the latter case, expression statements that evaluate to something other than ``None`` will " +"be printed)." +msgstr "" +"آرگومان *mode* مشخص می‌کند که چه نوع کدی باید کامپایل شود؛ اگر *source* شامل دنباله‌ای از دستورها باشد، می‌تواند " +"``'exec'`` باشد؛ اگر شامل تنها یک عبارت باشد، ``'eval'``؛ و اگر شامل تنها یک دستور تعاملی باشد، ``'single'`` (در " +"حالت آخر، اگر عبارت مقداری غیر از ``None`` تولید کند، آن مقدار چاپ خواهد شد)." -msgid "The optional arguments *flags* and *dont_inherit* control which :ref:`compiler options ` should be activated and which :ref:`future features ` should be allowed. If neither is present (or both are zero) the code is compiled with the same flags that affect the code that is calling :func:`compile`. If the *flags* argument is given and *dont_inherit* is not (or is zero) then the compiler options and the future statements specified by the *flags* argument are used in addition to those that would be used anyway. If *dont_inherit* is a non-zero integer then the *flags* argument is it -- the flags (future features and compiler options) in the surrounding code are ignored." -msgstr "آرگومان‌های اختیاری *flags* و *dont_inherit* تعیین می‌کنند که کدام :ref:`گزینه‌های کامپایلر ` فعال شوند و کدام :ref:`قابلیت‌های آینده ` مجاز باشند. اگر هیچ‌یک از آن‌ها ارائه نشوند (یا هر دو صفر باشند)، کد با همان پرچم‌هایی کامپایل می‌شود که بر کدی که :func:`compile` را فراخوانی کرده است اعمال می‌شوند. اگر آرگومان *flags* ارائه شود و *dont_inherit* ارائه نشود (یا صفر باشد)، گزینه‌های کامپایلر و دستورهای future مشخص‌شده توسط *flags* علاوه بر مواردی که به‌طور معمول اعمال می‌شوند، استفاده خواهند شد. اگر *dont_inherit* یک عدد صحیح ناصفر باشد، تنها از *flags* استفاده می‌شود و پرچم‌های (قابلیت‌های future و گزینه‌های کامپایلر) موجود در کد پیرامون نادیده گرفته می‌شوند." +msgid "" +"The optional arguments *flags* and *dont_inherit* control which :ref:`compiler options ` should " +"be activated and which :ref:`future features ` should be allowed. If neither is present (or both are zero) " +"the code is compiled with the same flags that affect the code that is calling :func:`compile`. If the *flags* " +"argument is given and *dont_inherit* is not (or is zero) then the compiler options and the future statements " +"specified by the *flags* argument are used in addition to those that would be used anyway. If *dont_inherit* is a " +"non-zero integer then the *flags* argument is it -- the flags (future features and compiler options) in the " +"surrounding code are ignored." +msgstr "" +"آرگومان‌های اختیاری *flags* و *dont_inherit* تعیین می‌کنند که کدام :ref:`گزینه‌های کامپایلر ` فعال " +"شوند و کدام :ref:`قابلیت‌های آینده ` مجاز باشند. اگر هیچ‌یک از آن‌ها ارائه نشوند (یا هر دو صفر باشند)، کد با " +"همان پرچم‌هایی کامپایل می‌شود که بر کدی که :func:`compile` را فراخوانی کرده است اعمال می‌شوند. اگر آرگومان *flags* " +"ارائه شود و *dont_inherit* ارائه نشود (یا صفر باشد)، گزینه‌های کامپایلر و دستورهای future مشخص‌شده توسط *flags* علاوه " +"بر مواردی که به‌طور معمول اعمال می‌شوند، استفاده خواهند شد. اگر *dont_inherit* یک عدد صحیح ناصفر باشد، تنها از *flags* " +"استفاده می‌شود و پرچم‌های (قابلیت‌های future و گزینه‌های کامپایلر) موجود در کد پیرامون نادیده گرفته می‌شوند." -msgid "Compiler options and future statements are specified by bits which can be bitwise ORed together to specify multiple options. The bitfield required to specify a given future feature can be found as the :attr:`~__future__._Feature.compiler_flag` attribute on the :class:`~__future__._Feature` instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." -msgstr "گزینه‌های کامپایلر و دستورهای future با استفاده از بیت‌هایی مشخص می‌شوند که می‌توان آن‌ها را با عملگر OR بیتی با یکدیگر ترکیب کرد تا چندین گزینه به‌طور هم‌زمان مشخص شوند. بیت‌فیلد لازم برای مشخص کردن هر قابلیت future را می‌توان در ویژگی :attr:`~__future__._Feature.compiler_flag` از نمونهٔ :class:`~__future__._Feature` در ماژول :mod:`__future__` یافت. :ref:`پرچم‌های کامپایلر ` نیز با پیشوند ``PyCF_`` در ماژول :mod:`ast` موجود هستند." +msgid "" +"Compiler options and future statements are specified by bits which can be bitwise ORed together to specify multiple " +"options. The bitfield required to specify a given future feature can be found as " +"the :attr:`~__future__._Feature.compiler_flag` attribute on the :class:`~__future__._Feature` instance in " +"the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with " +"``PyCF_`` prefix." +msgstr "" +"گزینه‌های کامپایلر و دستورهای future با استفاده از بیت‌هایی مشخص می‌شوند که می‌توان آن‌ها را با عملگر OR بیتی با یکدیگر " +"ترکیب کرد تا چندین گزینه به‌طور همزمان مشخص شوند. بیت‌فیلد لازم برای مشخص کردن هر قابلیت future را می‌توان در " +"ویژگی :attr:`~__future__._Feature.compiler_flag` از نمونه‌ی :class:`~__future__._Feature` در ماژول :mod:`__future__` " +"یافت. :ref:`پرچم‌های کامپایلر ` نیز با پیشوند ``PyCF_`` در ماژول :mod:`ast` موجود هستند." -msgid "The argument *optimize* specifies the optimization level of the compiler; the default value of ``-1`` selects the optimization level of the interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no optimization; ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) or ``2`` (docstrings are removed too)." -msgstr "آرگومان *optimize* سطح بهینه‌سازی کامپایلر را مشخص می‌کند؛ مقدار پیش‌فرض ``-1`` سطح بهینه‌سازی مفسر را مطابق گزینه‌های :option:`-O` انتخاب می‌کند. سطوح صریح عبارت‌اند از: ``0`` (بدون بهینه‌سازی؛ ``__debug__`` برابر با true است)، ``1`` (دستورهای assert حذف می‌شوند و ``__debug__`` برابر false است)، و ``2`` (علاوه بر آن، docstringها نیز حذف می‌شوند)." +msgid "" +"The argument *optimize* specifies the optimization level of the compiler; the default value of ``-1`` selects the " +"optimization level of the interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no optimization; " +"``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false) or ``2`` (docstrings are removed too)." +msgstr "" +"آرگومان *optimize* سطح بهینه‌سازی کامپایلر را مشخص می‌کند؛ مقدار پیش‌فرض ``-1`` سطح بهینه‌سازی مفسر را مطابق " +"گزینه‌های :option:`-O` انتخاب می‌کند. سطوح صریح عبارت‌اند از: ``0`` (بدون بهینه‌سازی؛ ``__debug__`` برابر با true است)، " +"``1`` (دستورهای assert حذف می‌شوند و ``__debug__`` برابر false است)، و ``2`` (علاوه بر آن، docstringها نیز حذف " +"می‌شوند)." msgid "This function raises :exc:`SyntaxError` or :exc:`ValueError` if the compiled source is invalid." msgstr "اگر کد منبع کامپایل‌شده نامعتبر باشد، این تابع استثنای :exc:`SyntaxError` یا :exc:`ValueError` پرتاب می‌کند." @@ -495,25 +669,47 @@ msgstr "اگر کد منبع کامپایل‌شده نامعتبر باشد، msgid "If you want to parse Python code into its AST representation, see :func:`ast.parse`." msgstr "اگر می‌خواهید کد پایتون را به نمایش AST آن تجزیه کنید، به :func:`ast.parse` مراجعه کنید." -msgid "Raises an :ref:`auditing event ` ``compile`` with arguments ``source`` and ``filename``. This event may also be raised by implicit compilation." -msgstr "یک :ref:`رویداد ممیزی ` با نام ``compile`` و آرگومان‌های ``source`` و ``filename`` پرتاب می‌کند. این رویداد ممکن است در نتیجهٔ کامپایل ضمنی نیز پرتاب شود." +msgid "" +"Raises an :ref:`auditing event ` ``compile`` with arguments ``source`` and ``filename``. This event may " +"also be raised by implicit compilation." +msgstr "" +"یک :ref:`رویداد حسابرسی ` با نام ``compile`` و آرگومان‌های ``source`` و ``filename`` پرتاب می‌کند. این " +"رویداد ممکن است در نتیجه‌ی کامپایل ضمنی نیز پرتاب شود." -msgid "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` mode, input must be terminated by at least one newline character. This is to facilitate detection of incomplete and complete statements in the :mod:`code` module." -msgstr "هنگام کامپایل یک رشته شامل کد چندخطی در حالت ``'single'`` یا ``'eval'``، ورودی باید دست‌کم با یک نویسهٔ پایان خط خاتمه یابد. این کار تشخیص دستورات ناقص و کامل را در ماژول :mod:`code` تسهیل می‌کند." +msgid "" +"When compiling a string with multi-line code in ``'single'`` or ``'eval'`` mode, input must be terminated by at " +"least one newline character. This is to facilitate detection of incomplete and complete statements in " +"the :mod:`code` module." +msgstr "" +"هنگام کامپایل یک رشته شامل کد چندخطی در حالت ``'single'`` یا ``'eval'``، ورودی باید دست‌کم با یک نویسه‌ی پایان خط " +"خاتمه یابد. این کار تشخیص دستورات ناقص و کامل را در ماژول :mod:`code` تسهیل می‌کند." -msgid "It is possible to crash the Python interpreter with a sufficiently large/complex string when compiling to an AST object due to stack depth limitations in Python's AST compiler." -msgstr "به دلیل محدودیت عمق پشته (stack depth) در کامپایلر AST پایتون، کامپایل یک رشتهٔ به‌اندازهٔ کافی بزرگ یا پیچیده به یک شیء AST ممکن است باعث ازکارافتادن (crash) مفسر پایتون شود." +msgid "" +"It is possible to crash the Python interpreter with a sufficiently large/complex string when compiling to an AST " +"object due to stack depth limitations in Python's AST compiler." +msgstr "" +"به دلیل محدودیت عمق پشته (stack depth) در کامپایلر AST پایتون، کامپایل یک رشته‌ی به‌اندازه‌ی کافی بزرگ یا پیچیده به یک " +"شیء AST ممکن است باعث کرش (crash) مفسر پایتون شود." -msgid "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode does not have to end in a newline anymore. Added the *optimize* parameter." -msgstr "استفاده از نویسه‌های پایان خط ویندوز و مک مجاز شد. همچنین، ورودی در حالت ``'exec'`` دیگر لازم نیست با یک نویسهٔ پایان خط خاتمه یابد. پارامتر *optimize* نیز اضافه شد." +msgid "" +"Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode does not have to end in a newline anymore. " +"Added the *optimize* parameter." +msgstr "" +"استفاده از نویسه‌های پایان خط ویندوز و مک مجاز شد. همچنین، ورودی در حالت ``'exec'`` دیگر لازم نیست با یک نویسه‌ی پایان " +"خط خاتمه یابد. پارامتر *optimize* نیز اضافه شد." msgid "Previously, :exc:`TypeError` was raised when null bytes were encountered in *source*." msgstr "پیش از این، هنگام برخورد با بایت‌های تهی در *source*، استثنای :exc:`TypeError` پرتاب می‌شد." -msgid "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable support for top-level ``await``, ``async for``, and ``async with``." -msgstr "اکنون می‌توان ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` را در پرچم‌ها ارسال کرد تا از ``await``، ``async for`` و ``async with`` در سطح بالای کد (top-level) پشتیبانی شود." +msgid "" +"``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable support for top-level ``await``, ``async " +"for``, and ``async with``." +msgstr "" +"اکنون می‌توان ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` را در پرچم‌ها ارسال کرد تا از ``await``، ``async for`` و ``async " +"with`` در سطح بالای کد (top-level) پشتیبانی شود." -msgid "Convert a single string or number to a complex number, or create a complex number from real and imaginary parts." +msgid "" +"Convert a single string or number to a complex number, or create a complex number from real and imaginary parts." msgstr "تبدیل یک رشته یا عدد به یک عدد مختلط، یا ایجاد یک عدد مختلط از بخش‌های حقیقی و موهومی یک عدد." msgid "Examples:" @@ -554,20 +750,53 @@ msgstr "" ">>> complex(-1.23, 4.5)\n" "(-1.23+4.5j)" -msgid "If the argument is a string, it must contain either a real part (in the same format as for :func:`float`) or an imaginary part (in the same format but with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the sign of the imaginary part is mandatory in this case). The string can optionally be surrounded by whitespaces and the round parentheses ``'('`` and ``')'``, which are ignored. The string must not contain whitespace between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` raises :exc:`ValueError`. More precisely, the input must conform to the :token:`~float:complexvalue` production rule in the following grammar, after parentheses and leading and trailing whitespace characters are removed:" -msgstr "اگر آرگومان یک رشته باشد، باید شامل بخش حقیقی (با همان قالبی که برای :func:`float` استفاده می‌شود)، یا بخش موهومی (با همان قالب اما همراه با پسوند ``'j'`` یا ``'J'``)، یا هر دو بخش حقیقی و موهومی باشد (در این حالت، وجود علامت بخش موهومی الزامی است). رشته می‌تواند به‌صورت اختیاری با نویسه‌های فاصلهٔ سفید و پرانتزهای گرد ``'('`` و ``')'`` احاطه شده باشد که نادیده گرفته می‌شوند. همچنین، نباید بین ``'+'``، ``'-'``، پسوند ``'j'`` یا ``'J'`` و عدد ده‌دهی فاصلهٔ سفید وجود داشته باشد. برای مثال، ``complex('1+2j')`` معتبر است، اما ``complex('1 + 2j')`` باعث پرتاب استثنای :exc:`ValueError` می‌شود. به‌طور دقیق‌تر، پس از حذف پرانتزها و نویسه‌های فاصلهٔ سفید ابتدا و انتهای رشته، ورودی باید با قاعدهٔ تولید :token:`~float:complexvalue` در دستور زبان زیر مطابقت داشته باشد:" +msgid "" +"If the argument is a string, it must contain either a real part (in the same format as for :func:`float`) or an " +"imaginary part (in the same format but with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the sign " +"of the imaginary part is mandatory in this case). The string can optionally be surrounded by whitespaces and the " +"round parentheses ``'('`` and ``')'``, which are ignored. The string must not contain whitespace between ``'+'``, " +"``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal number. For example, ``complex('1+2j')`` is fine, but " +"``complex('1 + 2j')`` raises :exc:`ValueError`. More precisely, the input must conform to " +"the :token:`~float:complexvalue` production rule in the following grammar, after parentheses and leading and " +"trailing whitespace characters are removed:" +msgstr "" +"اگر آرگومان یک رشته باشد، باید شامل بخش حقیقی (با همان قالبی که برای :func:`float` استفاده می‌شود)، یا بخش موهومی (با " +"همان قالب اما همراه با پسوند ``'j'`` یا ``'J'``)، یا هر دو بخش حقیقی و موهومی باشد (در این حالت، وجود علامت بخش " +"موهومی الزامی است). رشته می‌تواند به‌صورت اختیاری با نویسه‌های فاصله‌ی سفید و پرانتزهای گرد ``'('`` و ``')'`` احاطه شده " +"باشد که نادیده گرفته می‌شوند. همچنین، نباید بین ``'+'``، ``'-'``، پسوند ``'j'`` یا ``'J'`` و عدد ده‌دهی فاصله‌ی سفید " +"وجود داشته باشد. برای مثال، ``complex('1+2j')`` معتبر است، اما ``complex('1 + 2j')`` باعث پرتاب " +"استثنای :exc:`ValueError` می‌شود. به‌طور دقیق‌تر، پس از حذف پرانتزها و نویسه‌های فاصله‌ی سفید ابتدا و انتهای رشته، ورودی " +"باید با قاعده‌ی تولید :token:`~float:complexvalue` در دستور زبان زیر مطابقت داشته باشد:" -msgid "If the argument is a number, the constructor serves as a numeric conversion like :class:`int` and :class:`float`. For a general Python object ``x``, ``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`." -msgstr "اگر آرگومان یک عدد باشد، سازنده مانند :class:`int` و :class:`float` به‌عنوان یک تبدیل عددی عمل می‌کند. برای یک شیء عمومی پایتون به نام ``x``، تابع ``complex(x)`` فراخوانی را به ``x.__complex__()`` واگذار می‌کند. اگر :meth:`~object.__complex__` تعریف نشده باشد، به :meth:`~object.__float__` بازمی‌گردد. اگر :meth:`!__float__` نیز تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." +msgid "" +"If the argument is a number, the constructor serves as a numeric conversion like :class:`int` and :class:`float`. " +"For a general Python object ``x``, ``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object.__complex__` " +"is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls " +"back to :meth:`~object.__index__`." +msgstr "" +"اگر آرگومان یک عدد باشد، سازنده مانند :class:`int` و :class:`float` به‌عنوان یک تبدیل عددی عمل می‌کند. برای یک شیء " +"عمومی پایتون به نام ``x``، تابع ``complex(x)`` فراخوانی را به ``x.__complex__()`` واگذار می‌کند. " +"اگر :meth:`~object.__complex__` تعریف نشده باشد، به :meth:`~object.__float__` بازمی‌گردد. اگر :meth:`!__float__` نیز " +"تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." -msgid "If two arguments are provided or keyword arguments are used, each argument may be any numeric type (including complex). If both arguments are real numbers, return a complex number with the real component *real* and the imaginary component *imag*. If both arguments are complex numbers, return a complex number with the real component ``real.real-imag.imag`` and the imaginary component ``real.imag+imag.real``. If one of arguments is a real number, only its real component is used in the above expressions." -msgstr "اگر دو آرگومان ارائه شوند یا از آرگومان‌های کلیدواژه‌ای استفاده شود، هر آرگومان می‌تواند از هر نوع عددی (از جمله اعداد مختلط) باشد. اگر هر دو آرگومان عدد حقیقی باشند، یک عدد مختلط با بخش حقیقی *real* و بخش موهومی *imag* برگردانده می‌شود. اگر هر دو آرگومان عدد مختلط باشند، عدد مختلطی با بخش حقیقی ``real.real-imag.imag`` و بخش موهومی ``real.imag+imag.real`` برگردانده می‌شود. اگر یکی از آرگومان‌ها عدد حقیقی باشد، فقط بخش حقیقی آن در عبارت‌های بالا استفاده می‌شود." +msgid "" +"If two arguments are provided or keyword arguments are used, each argument may be any numeric type (including " +"complex). If both arguments are real numbers, return a complex number with the real component *real* and the " +"imaginary component *imag*. If both arguments are complex numbers, return a complex number with the real component " +"``real.real-imag.imag`` and the imaginary component ``real.imag+imag.real``. If one of arguments is a real number, " +"only its real component is used in the above expressions." +msgstr "" +"اگر دو آرگومان ارائه شوند یا از آرگومان‌های کلیدواژه‌ای استفاده شود، هر آرگومان می‌تواند از هر نوع عددی (از جمله اعداد " +"مختلط) باشد. اگر هر دو آرگومان عدد حقیقی باشند، یک عدد مختلط با بخش حقیقی *real* و بخش موهومی *imag* برگردانده " +"می‌شود. اگر هر دو آرگومان عدد مختلط باشند، عدد مختلطی با بخش حقیقی ``real.real-imag.imag`` و بخش موهومی " +"``real.imag+imag.real`` برگردانده می‌شود. اگر یکی از آرگومان‌ها عدد حقیقی باشد، فقط بخش حقیقی آن در عبارت‌های بالا " +"استفاده می‌شود." msgid "See also :meth:`complex.from_number` which only accepts a single numeric argument." msgstr "همچنین به :meth:`complex.from_number` مراجعه کنید که فقط یک آرگومان عددی را می‌پذیرد." msgid "If all arguments are omitted, returns ``0j``." -msgstr "اگر همهٔ آرگومان‌ها حذف شوند، مقدار ``0j`` برگردانده می‌شود." +msgstr "اگر همه‌ی آرگومان‌ها حذف شوند، مقدار ``0j`` برگردانده می‌شود." msgid "The complex type is described in :ref:`typesnumeric`." msgstr "نوع مختلط در :ref:`typesnumeric` توضیح داده شده است." @@ -575,53 +804,125 @@ msgstr "نوع مختلط در :ref:`typesnumeric` توضیح داده شده ا msgid "Grouping digits with underscores as in code literals is allowed." msgstr "گروه‌بندی رقم‌ها با استفاده از زیرخط، همانند ثابت‌های عددی در کد، مجاز است." -msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :meth:`~object.__float__` are not defined." -msgstr "اگر :meth:`~object.__complex__` و :meth:`~object.__float__` تعریف نشده باشند، به :meth:`~object.__index__` بازمی‌گردد." +msgid "" +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :meth:`~object.__float__` are not defined." +msgstr "" +"اگر :meth:`~object.__complex__ <~object.__index__>` و :meth:`~object.__float__ <~object.__complex__>` تعریف نشده " +"باشند، به :meth:`~object.__index__ <~object.__float__>` بازمی‌گردد." -msgid "Passing a complex number as the *real* or *imag* argument is now deprecated; it should only be passed as a single positional argument." -msgstr "ارسال یک عدد مختلط به‌عنوان آرگومان *real* یا *imag* اکنون منسوخ شده است؛ عدد مختلط باید فقط به‌صورت یک آرگومان مکانی ارسال شود." +msgid "" +"Passing a complex number as the *real* or *imag* argument is now deprecated; it should only be passed as a single " +"positional argument." +msgstr "" +"ارسال یک عدد مختلط به‌عنوان آرگومان *real* یا *imag* اکنون منسوخ شده است؛ عدد مختلط باید فقط به‌صورت یک آرگومان " +"جایگاهی ارسال شود." -msgid "This is a relative of :func:`setattr`. The arguments are an object and a string. The string must be the name of one of the object's attributes. The function deletes the named attribute, provided the object allows it. For example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* need not be a Python identifier (see :func:`setattr`)." -msgstr "این تابع همتای :func:`setattr` است. آرگومان‌های آن یک شیء و یک رشته هستند. رشته باید نام یکی از ویژگی‌های شیء باشد. در صورت مجاز بودن، این تابع ویژگی نام‌برده را حذف می‌کند. برای مثال، ``delattr(x, 'foobar')`` معادل ``del x.foobar`` است. *name* الزامی ندارد که یک شناسهٔ معتبر پایتون باشد (به :func:`setattr` مراجعه کنید)." +msgid "" +"This is a relative of :func:`setattr`. The arguments are an object and a string. The string must be the name of " +"one of the object's attributes. The function deletes the named attribute, provided the object allows it. For " +"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* need not be a Python identifier " +"(see :func:`setattr`)." +msgstr "" +"این تابع همتای :func:`setattr` است. آرگومان‌های آن یک شیء و یک رشته هستند. رشته باید نام یکی از ویژگی‌های شیء باشد. در " +"صورت مجاز بودن، این تابع ویژگی نام‌برده را حذف می‌کند. برای مثال، ``delattr(x, 'foobar')`` معادل ``del x.foobar`` است. " +"*name* الزامی ندارد که یک شناسه‌ی معتبر پایتون باشد (به :func:`setattr` مراجعه کنید)." -msgid "Create a new dictionary. The :class:`dict` object is the dictionary class. See also :ref:`typesmapping` for documentation about this class." -msgstr "ایجاد یک دیکشنری جدید. شیء :class:`dict` کلاس دیکشنری است. برای مستندات این کلاس، به :ref:`typesmapping` مراجعه کنید." +msgid "" +"Create a new dictionary. The :class:`dict` object is the dictionary class. See also :ref:`typesmapping` for " +"documentation about this class." +msgstr "" +"ایجاد یک دیکشنری جدید. شیء :class:`dict` کلاس دیکشنری است. برای مستندات این کلاس، به :ref:`typesmapping` مراجعه کنید." -msgid "For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, as well as the :mod:`collections` module." -msgstr "برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`list`، :class:`set` و :class:`tuple`، و همچنین ماژول :mod:`collections` مراجعه کنید." +msgid "" +"For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, as well as " +"the :mod:`collections` module." +msgstr "" +"برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`list`، :class:`set` و :class:`tuple`، و همچنین " +"ماژول :mod:`collections` مراجعه کنید." -msgid "Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object." -msgstr "بدون آرگومان، فهرست نام‌های موجود در دامنهٔ محلیِ فعلی را بازمی‌گرداند. با ارسال یک آرگومان، تلاش می‌کند فهرستی از ویژگی‌های معتبر آن شیء را بازگرداند." +msgid "" +"Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list " +"of valid attributes for that object." +msgstr "" +"بدون آرگومان، فهرست نام‌های موجود در دامنه‌ی محلیِ فعلی را بازمی‌گرداند. با ارسال یک آرگومان، تلاش می‌کند فهرستی از " +"ویژگی‌های معتبر آن شیء را بازگرداند." -msgid "If the object has a method named :meth:`~object.__dir__`, this method will be called and must return the list of attributes. This allows objects that implement a custom :func:`~object.__getattr__` or :func:`~object.__getattribute__` function to customize the way :func:`dir` reports their attributes." -msgstr "اگر شیء متدی با نام :meth:`~object.__dir__` داشته باشد، این متد فراخوانی می‌شود و باید فهرستی از ویژگی‌ها را برگرداند. این امکان را فراهم می‌کند که اشیایی که :func:`~object.__getattr__` یا :func:`~object.__getattribute__` سفارشی را پیاده‌سازی کرده‌اند، نحوهٔ گزارش ویژگی‌های خود توسط :func:`dir` را سفارشی‌سازی کنند." +msgid "" +"If the object has a method named :meth:`~object.__dir__`, this method will be called and must return the list of " +"attributes. This allows objects that implement a custom :func:`~object.__getattr__` " +"or :func:`~object.__getattribute__` function to customize the way :func:`dir` reports their attributes." +msgstr "" +"اگر شیء متدی با نام :meth:`~object.__dir__` داشته باشد، این متد فراخوانی می‌شود و باید فهرستی از ویژگی‌ها را برگرداند. " +"این امکان را فراهم می‌کند که اشیایی که :func:`~object.__getattr__` یا :func:`~object.__getattribute__` سفارشی را " +"پیاده‌سازی کرده‌اند، نحوه‌ی گزارش ویژگی‌های خود توسط :func:`dir` را سفارشی‌سازی کنند." -msgid "If the object does not provide :meth:`~object.__dir__`, the function tries its best to gather information from the object's :attr:`~object.__dict__` attribute, if defined, and from its type object. The resulting list is not necessarily complete and may be inaccurate when the object has a custom :func:`~object.__getattr__`." -msgstr "اگر شیء متد :meth:`~object.__dir__` را ارائه نکند، این تابع در صورت تعریف شدن، تلاش می‌کند تا حد امکان اطلاعات را از ویژگی :attr:`~object.__dict__` شیء و همچنین از شیء نوع (type object) آن جمع‌آوری کند. فهرست حاصل لزوماً کامل نیست و اگر شیء دارای :func:`~object.__getattr__` سفارشی باشد، ممکن است دقیق هم نباشد." +msgid "" +"If the object does not provide :meth:`~object.__dir__`, the function tries its best to gather information from the " +"object's :attr:`~object.__dict__` attribute, if defined, and from its type object. The resulting list is not " +"necessarily complete and may be inaccurate when the object has a custom :func:`~object.__getattr__`." +msgstr "" +"اگر شیء متد :meth:`~object.__dir__` را ارائه نکند، این تابع در صورت تعریف شدن، تلاش می‌کند تا حد امکان اطلاعات را از " +"ویژگی :attr:`~object.__dict__` شیء و همچنین از شیء نوع (type object) آن جمع‌آوری کند. فهرست حاصل لزوماً کامل نیست و " +"اگر شیء دارای :func:`~object.__getattr__` سفارشی باشد، ممکن است دقیق هم نباشد." -msgid "The default :func:`dir` mechanism behaves differently with different types of objects, as it attempts to produce the most relevant, rather than complete, information:" -msgstr "سازوکار پیش‌فرض :func:`dir` بسته به نوع شیء رفتار متفاوتی دارد، زیرا تلاش می‌کند به‌جای ارائهٔ اطلاعات کامل، مرتبط‌ترین اطلاعات را ارائه دهد:" +msgid "" +"The default :func:`dir` mechanism behaves differently with different types of objects, as it attempts to produce the " +"most relevant, rather than complete, information:" +msgstr "" +"سازوکار پیش‌فرض :func:`dir` بسته به نوع شیء رفتار متفاوتی دارد، زیرا تلاش می‌کند به‌جای ارائه‌ی اطلاعات کامل، مرتبط‌ترین " +"اطلاعات را ارائه دهد:" msgid "If the object is a module object, the list contains the names of the module's attributes." msgstr "اگر شیء یک ماژول باشد، فهرست شامل نام ویژگی‌های آن ماژول خواهد بود." -msgid "If the object is a type or class object, the list contains the names of its attributes, and recursively of the attributes of its bases." -msgstr "اگر شیء یک نوع (type) یا کلاس باشد، فهرست شامل نام ویژگی‌های آن و همچنین، به‌صورت بازگشتی، نام ویژگی‌های کلاس‌های پایهٔ آن خواهد بود." +msgid "" +"If the object is a type or class object, the list contains the names of its attributes, and recursively of the " +"attributes of its bases." +msgstr "" +"اگر شیء یک نوع (type) یا کلاس باشد، فهرست شامل نام ویژگی‌های آن و همچنین، به‌صورت بازگشتی، نام ویژگی‌های کلاس‌های پایه‌ی " +"آن خواهد بود." -msgid "Otherwise, the list contains the object's attributes' names, the names of its class's attributes, and recursively of the attributes of its class's base classes." -msgstr "در غیر این صورت، فهرست شامل نام ویژگی‌های شیء، نام ویژگی‌های کلاس آن، و همچنین به‌صورت بازگشتی، نام ویژگی‌های کلاس‌های پایهٔ آن خواهد بود." +msgid "" +"Otherwise, the list contains the object's attributes' names, the names of its class's attributes, and recursively of " +"the attributes of its class's base classes." +msgstr "" +"در غیر این صورت، فهرست شامل نام ویژگی‌های شیء، نام ویژگی‌های کلاس آن، و همچنین به‌صورت بازگشتی، نام ویژگی‌های کلاس‌های " +"پایه‌ی آن خواهد بود." msgid "The resulting list is sorted alphabetically. For example:" msgstr "فهرست حاصل به‌ترتیب الفبایی مرتب می‌شود. برای مثال:" -msgid "Because :func:`dir` is supplied primarily as a convenience for use at an interactive prompt, it tries to supply an interesting set of names more than it tries to supply a rigorously or consistently defined set of names, and its detailed behavior may change across releases. For example, metaclass attributes are not in the result list when the argument is a class." -msgstr "از آنجا که :func:`dir` در درجهٔ اول برای سهولت استفاده در اعلان تعاملی طراحی شده است، بیشتر تلاش می‌کند مجموعه‌ای مفید از نام‌ها را ارائه دهد تا مجموعه‌ای با تعریف دقیق و سازگار. بنابراین، رفتار دقیق آن ممکن است بین نسخه‌های مختلف تغییر کند. برای مثال، اگر آرگومان یک کلاس باشد، ویژگی‌های فراداده در فهرست نتایج قرار نمی‌گیرند." +msgid "" +"Because :func:`dir` is supplied primarily as a convenience for use at an interactive prompt, it tries to supply an " +"interesting set of names more than it tries to supply a rigorously or consistently defined set of names, and its " +"detailed behavior may change across releases. For example, metaclass attributes are not in the result list when the " +"argument is a class." +msgstr "" +"از آنجا که :func:`dir` در درجه‌ی اول برای سهولت استفاده در اعلان تعاملی طراحی شده است، بیشتر تلاش می‌کند مجموعه‌ای مفید " +"از نام‌ها را ارائه دهد تا مجموعه‌ای با تعریف دقیق و سازگار. بنابراین، رفتار دقیق آن ممکن است بین نسخه‌های مختلف تغییر " +"کند. برای مثال، اگر آرگومان یک کلاس باشد، ویژگی‌های فراداده در فهرست نتایج قرار نمی‌گیرند." -msgid "Take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as ``(a // b, a % b)``. For floating-point numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b) < abs(b)``." -msgstr "دو عدد (غیرمختلط) را به‌عنوان آرگومان می‌گیرد و جفتی از اعداد شامل خارج‌قسمت و باقیماندهٔ تقسیم صحیح آن‌ها را برمی‌گرداند. در صورت متفاوت بودن نوع عملوندها، قواعد عملگرهای حسابی دودویی اعمال می‌شود. برای اعداد صحیح، نتیجه برابر با ``(a // b, a % b)`` است. برای اعداد ممیز شناور، نتیجه ``(q, a % b)`` است که در آن *q* معمولاً برابر ``math.floor(a / b)`` است، اما ممکن است یک واحد کمتر از آن باشد. در هر صورت، مقدار ``q * b + a % b`` بسیار به *a* نزدیک است، و اگر ``a % b`` صفر نباشد، هم‌علامت با *b* خواهد بود و همچنین ``0 <= abs(a % b) < abs(b)`` برقرار است." +msgid "" +"Take two (non-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder " +"when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For " +"integers, the result is the same as ``(a // b, a % b)``. For floating-point numbers the result is ``(q, a % b)``, " +"where *q* is usually ``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very close " +"to *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b) < abs(b)``." +msgstr "" +"دو عدد (غیرمختلط) را به‌عنوان آرگومان می‌گیرد و جفتی از اعداد شامل خارج‌قسمت و باقیمانده‌ی تقسیم صحیح آن‌ها را " +"برمی‌گرداند. در صورت متفاوت بودن نوع عملوندها، قواعد عملگرهای حسابی دودویی اعمال می‌شود. برای اعداد صحیح، نتیجه برابر " +"با ``(a // b, a % b)`` است. برای اعداد ممیز شناور، نتیجه ``(q, a % b)`` است که در آن *q* معمولاً برابر " +"``math.floor(a / b)`` است، اما ممکن است یک واحد کمتر از آن باشد. در هر صورت، مقدار ``q * b + a % b`` بسیار به *a* " +"نزدیک است، و اگر ``a % b`` صفر نباشد، هم‌علامت با *b* خواهد بود و همچنین ``0 <= abs(a % b) < abs(b)`` برقرار است." -msgid "Return an enumerate object. *iterable* must be a sequence, an :term:`iterator`, or some other object which supports iteration. The :meth:`~iterator.__next__` method of the iterator returned by :func:`enumerate` returns a tuple containing a count (from *start* which defaults to 0) and the values obtained from iterating over *iterable*." -msgstr "یک شیء enumerate را برمی‌گرداند. *iterable* باید یک دنباله، یک :term:`تکرارگر ` یا هر شیء دیگری باشد که از پیمایش پشتیبانی می‌کند. متد :meth:`~iterator.__next__` تکرارگر بازگردانده‌شده توسط :func:`enumerate`، تاپلی شامل یک شمارنده (که از *start* آغاز می‌شود و مقدار پیش‌فرض آن 0 است) و مقادیر به‌دست‌آمده از پیمایش *iterable* را برمی‌گرداند." +msgid "" +"Return an enumerate object. *iterable* must be a sequence, an :term:`iterator`, or some other object which supports " +"iteration. The :meth:`~iterator.__next__` method of the iterator returned by :func:`enumerate` returns a tuple " +"containing a count (from *start* which defaults to 0) and the values obtained from iterating over *iterable*." +msgstr "" +"یک شیء enumerate را برمی‌گرداند. *iterable* باید یک دنباله، یک :term:`پیمایش‌گر ` یا هر شیء دیگری باشد که از " +"پیمایش پشتیبانی می‌کند. متد :meth:`~iterator.__next__` پیمایش‌گر بازگردانده‌شده توسط :func:`enumerate`، تاپلی شامل یک " +"شمارنده (که از *start* آغاز می‌شود و مقدار پیش‌فرض آن 0 است) و مقادیر به‌دست‌آمده از پیمایش *iterable* را برمی‌گرداند." msgid "Equivalent to::" msgstr "مساوی است با::" @@ -655,7 +956,7 @@ msgid "Returns" msgstr "بازمیگرداند" msgid "The result of the evaluated expression." -msgstr "نتیجهٔ عبارت ارزیابی‌شده." +msgstr "نتیجه‌ی عبارت ارزیابی‌شده." msgid "raises" msgstr "پرتاب می‌کند" @@ -663,29 +964,71 @@ msgstr "پرتاب می‌کند" msgid "Syntax errors are reported as exceptions." msgstr "خطاهای نحوی به‌صورت استثنا گزارش می‌شوند." -msgid "This function executes arbitrary code. Calling it with untrusted user-supplied input will lead to security vulnerabilities." -msgstr "این تابع کد دلخواه را اجرا می‌کند. فراخوانی آن با ورودیِ تأمین‌شده از سوی کاربر که قابل اعتماد نیست، منجر به آسیب‌پذیری‌های امنیتی خواهد شد." +msgid "" +"This function executes arbitrary code. Calling it with untrusted user-supplied input will lead to security " +"vulnerabilities." +msgstr "" +"این تابع کد دلخواه را اجرا می‌کند. فراخوانی آن با ورودیِ تأمین‌شده از سوی کاربر که قابل اعتماد نیست، منجر به " +"آسیب‌پذیری‌های امنیتی خواهد شد." -msgid "The *source* argument is parsed and evaluated as a Python expression (technically speaking, an :ref:`expression list `) using the *globals* and *locals* mappings as global and local namespace. If the *globals* dictionary is present and does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used to restrict or change the available names, but this is **not** a security mechanism: the executed code can still access all builtins. If the *locals* mapping is omitted it defaults to the *globals* dictionary. If both mappings are omitted, the source is executed with the *globals* and *locals* in the environment where :func:`eval` is called. Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the enclosing environment if they are already referenced in the scope that is calling :func:`eval` (e.g. via a :keyword:`nonlocal` statement)." -msgstr "آرگومان *source* به‌عنوان یک عبارت پایتون (از نظر فنی، یک :ref:`فهرست عبارات `) با استفاده از نگاشت‌های *globals* و *locals* به‌ترتیب به‌عنوان فضای نام سراسری و محلی، تجزیه و ارزیابی می‌شود. اگر دیکشنری *globals* وجود داشته باشد اما کلید ``__builtins__`` را نداشته باشد، پیش از تجزیهٔ *source*، ارجاعی به دیکشنری ماژول توکار :mod:`builtins` تحت این کلید درج می‌شود. بازنویسی ``__builtins__`` می‌تواند برای محدود کردن یا تغییر نام‌های در دسترس استفاده شود، اما این **یک سازوکار امنیتی نیست**؛ زیرا کد اجراشده همچنان می‌تواند به تمام توابع و اشیای توکار دسترسی داشته باشد. اگر نگاشت *locals* ارائه نشود، به‌طور پیش‌فرض از دیکشنری *globals* استفاده می‌شود. اگر هر دو نگاشت حذف شوند، *source* با استفاده از *globals* و *locals* محیطی که :func:`eval` در آن فراخوانی شده اجرا می‌شود. توجه داشته باشید که *eval()* تنها در صورتی به :term:`دامنه‌های تو‌در‌تو ` (متغیرهای nonlocal) محیط پیرامون دسترسی خواهد داشت که آن‌ها از قبل در دامنه‌ای که :func:`eval` را فراخوانی می‌کند ارجاع داده شده باشند (برای مثال، از طریق دستور :keyword:`nonlocal`)." +msgid "" +"The *source* argument is parsed and evaluated as a Python expression (technically speaking, an :ref:`expression list " +"`) using the *globals* and *locals* mappings as global and local namespace. If the *globals* dictionary " +"is present and does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in " +"module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used " +"to restrict or change the available names, but this is **not** a security mechanism: the executed code can still " +"access all builtins. If the *locals* mapping is omitted it defaults to the *globals* dictionary. If both mappings " +"are omitted, the source is executed with the *globals* and *locals* in the environment where :func:`eval` is " +"called. Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the " +"enclosing environment if they are already referenced in the scope that is calling :func:`eval` (e.g. via " +"a :keyword:`nonlocal` statement)." +msgstr "" +"آرگومان *source* به‌عنوان یک عبارت پایتون (از نظر فنی، یک :ref:`فهرست عبارات `) با استفاده از نگاشت‌های " +"*globals* و *locals* به‌ترتیب به‌عنوان فضای نام سراسری و محلی، تجزیه و ارزیابی می‌شود. اگر دیکشنری *globals* وجود داشته " +"باشد اما کلید ``__builtins__`` را نداشته باشد، پیش از تجزیه‌ی *source*، ارجاعی به دیکشنری ماژول توکار :mod:`builtins` " +"تحت این کلید درج می‌شود. بازنویسی ``__builtins__`` می‌تواند برای محدود کردن یا تغییر نام‌های در دسترس استفاده شود، اما " +"این **یک سازوکار امنیتی نیست**؛ زیرا کد اجراشده همچنان می‌تواند به تمام توابع و اشیای توکار دسترسی داشته باشد. اگر " +"نگاشت *locals* ارائه نشود، به‌طور پیش‌فرض از دیکشنری *globals* استفاده می‌شود. اگر هر دو نگاشت حذف شوند، *source* با " +"استفاده از *globals* و *locals* محیطی که :func:`eval` در آن فراخوانی شده اجرا می‌شود. توجه داشته باشید که *eval()* " +"تنها در صورتی به :term:`دامنه‌های تودرتو ` (متغیرهای nonlocal) محیط پیرامون دسترسی خواهد داشت که آن‌ها " +"از قبل در دامنه‌ای که :func:`eval` را فراخوانی می‌کند ارجاع داده شده باشند (برای مثال، از طریق " +"دستور :keyword:`nonlocal`)." msgid "Example:" msgstr "مثال:" -msgid "This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In this case, pass a code object instead of a string. If the code object has been compiled with ``'exec'`` as the *mode* argument, :func:`eval`\\'s return value will be ``None``." -msgstr "از این تابع همچنین می‌توان برای اجرای اشیای کد دلخواه (مانند اشیایی که توسط :func:`compile` ایجاد شده‌اند) استفاده کرد. در این حالت، به‌جای رشته، یک شیء کد ارسال کنید. اگر شیء کد با آرگومان *mode* برابر ``'exec'`` کامپایل شده باشد، مقدار بازگشتی :func:`eval` برابر ``None`` خواهد بود." +msgid "" +"This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In " +"this case, pass a code object instead of a string. If the code object has been compiled with ``'exec'`` as the " +"*mode* argument, :func:`eval`\\'s return value will be ``None``." +msgstr "" +"از این تابع همچنین می‌توان برای اجرای اشیای کد دلخواه (مانند اشیایی که توسط :func:`compile` ایجاد شده‌اند) استفاده " +"کرد. در این حالت، به‌جای رشته، یک شیء کد ارسال کنید. اگر شیء کد با آرگومان *mode* برابر ``'exec'`` کامپایل شده باشد، " +"مقدار بازگشتی :func:`eval` برابر ``None`` خواهد بود." -msgid "Hints: dynamic execution of statements is supported by the :func:`exec` function. The :func:`globals` and :func:`locals` functions return the current global and local dictionary, respectively, which may be useful to pass around for use by :func:`eval` or :func:`exec`." -msgstr "راهنمایی: اجرای پویای دستورها توسط تابع :func:`exec` پشتیبانی می‌شود. توابع :func:`globals` و :func:`locals` به‌ترتیب دیکشنری سراسری و محلی فعلی را برمی‌گردانند که می‌توان آن‌ها را برای استفاده در :func:`eval` یا :func:`exec` به توابع دیگر ارسال کرد." +msgid "" +"Hints: dynamic execution of statements is supported by the :func:`exec` function. The :func:`globals` " +"and :func:`locals` functions return the current global and local dictionary, respectively, which may be useful to " +"pass around for use by :func:`eval` or :func:`exec`." +msgstr "" +"راهنمایی: اجرای پویای دستورها توسط تابع :func:`exec` پشتیبانی می‌شود. توابع :func:`globals` و :func:`locals` به‌ترتیب " +"دیکشنری سراسری و محلی فعلی را برمی‌گردانند که می‌توان آن‌ها را برای استفاده در :func:`eval` یا :func:`exec` به توابع " +"دیگر ارسال کرد." msgid "If the given source is a string, then leading and trailing spaces and tabs are stripped." msgstr "اگر کد منبع داده‌شده یک رشته باشد، فاصله‌ها و نویسه‌های تب ابتدا و انتهای آن حذف می‌شوند." msgid "See :func:`ast.literal_eval` for a function to evaluate strings with expressions containing only literals." -msgstr "برای تابعی که رشته‌های حاوی عبارت‌هایی متشکل فقط از مقادیر ثابت را ارزیابی می‌کند، به :func:`ast.literal_eval` مراجعه کنید." +msgstr "" +"برای تابعی که رشته‌های حاوی عبارت‌هایی متشکل فقط از مقادیر ثابت را ارزیابی می‌کند، به :func:`ast.literal_eval` مراجعه " +"کنید." -msgid "Raises an :ref:`auditing event ` ``exec`` with the code object as the argument. Code compilation events may also be raised." -msgstr "یک :ref:`رویداد ممیزی ` با نام ``exec`` و شیء کد به‌عنوان آرگومان پرتاب می‌کند. رویدادهای مربوط به کامپایل کد نیز ممکن است پرتاب شوند." +msgid "" +"Raises an :ref:`auditing event ` ``exec`` with the code object as the argument. Code compilation events " +"may also be raised." +msgstr "" +"یک :ref:`رویداد حسابرسی ` با نام ``exec`` و شیء کد به‌عنوان آرگومان پرتاب می‌کند. رویدادهای مربوط به کامپایل " +"کد نیز ممکن است پرتاب شوند." msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "آرگومان‌های *globals* و *locals* اکنون می‌توانند به‌صورت آرگومان کلیدواژه‌ای نیز ارسال شوند." @@ -693,38 +1036,101 @@ msgstr "آرگومان‌های *globals* و *locals* اکنون می‌توان msgid "The semantics of the default *locals* namespace have been adjusted as described for the :func:`locals` builtin." msgstr "معنای فضای نام پیش‌فرض *locals* مطابق توضیحات ارائه‌شده برای تابع توکار :func:`locals` تنظیم شده است." -msgid "This function supports dynamic execution of Python code. *source* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [#]_ If it is a code object, it is simply executed. In all cases, the code that's executed is expected to be valid as file input (see the section :ref:`file-input` in the Reference Manual). Be aware that the :keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may not be used outside of function definitions even within the context of code passed to the :func:`exec` function. The return value is ``None``." -msgstr "این تابع از اجرای پویای کد پایتون پشتیبانی می‌کند. *source* باید یا یک رشته باشد یا یک شیء کد. اگر رشته باشد، به‌عنوان مجموعه‌ای از دستورهای پایتون تجزیه و سپس اجرا می‌شود (مگر اینکه خطای نحوی رخ دهد). [#]_ اگر یک شیء کد باشد، مستقیماً اجرا می‌شود. در همهٔ موارد، انتظار می‌رود کد اجراشده به‌عنوان ورودی فایل معتبر باشد (به بخش :ref:`file-input` در راهنمای مرجع مراجعه کنید). توجه داشته باشید که دستورهای :keyword:`nonlocal`، :keyword:`yield` و :keyword:`return` حتی در کدی که از طریق :func:`exec` اجرا می‌شود نیز خارج از تعریف تابع قابل استفاده نیستند. مقدار بازگشتی ``None`` است." +msgid "" +"This function supports dynamic execution of Python code. *source* must be either a string or a code object. If it " +"is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error " +"occurs). [#]_ If it is a code object, it is simply executed. In all cases, the code that's executed is expected to " +"be valid as file input (see the section :ref:`file-input` in the Reference Manual). Be aware that " +"the :keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may not be used outside of function " +"definitions even within the context of code passed to the :func:`exec` function. The return value is ``None``." +msgstr "" +"این تابع از اجرای پویای کد پایتون پشتیبانی می‌کند. *source* باید یا یک رشته باشد یا یک شیء کد. اگر رشته باشد، به‌عنوان " +"مجموعه‌ای از دستورهای پایتون تجزیه و سپس اجرا می‌شود (مگر اینکه خطای نحوی رخ دهد). [#]_ اگر یک شیء کد باشد، مستقیماً " +"اجرا می‌شود. در همه‌ی موارد، انتظار می‌رود کد اجراشده به‌عنوان ورودی فایل معتبر باشد (به بخش :ref:`file-input` در " +"راهنمای مرجع مراجعه کنید). توجه داشته باشید که دستورهای :keyword:`nonlocal`، :keyword:`yield` و :keyword:`return` " +"حتی در کدی که از طریق :func:`exec` اجرا می‌شود نیز خارج از تعریف تابع قابل استفاده نیستند. مقدار بازگشتی ``None`` است." -msgid "In all cases, if the optional parts are omitted, the code is executed in the current scope. If only *globals* is provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the local variables. If *globals* and *locals* are given, they are used for the global and local variables, respectively. If provided, *locals* can be any mapping object. Remember that at the module level, globals and locals are the same dictionary." -msgstr "در همهٔ حالت‌ها، اگر بخش‌های اختیاری حذف شوند، کد در محدوده فعلی اجرا می‌شود. اگر فقط *globals* ارائه شود، باید یک دیکشنری باشد (و نه یک زیرکلاس از دیکشنری) که هم برای متغیرهای سراسری و هم برای متغیرهای محلی استفاده خواهد شد. اگر هر دو *globals* و *locals* ارائه شوند، به‌ترتیب برای متغیرهای سراسری و محلی استفاده می‌شوند. در صورت ارائه، *locals* می‌تواند هر شیء نگاشتی باشد. به خاطر داشته باشید که در سطح ماژول، globals و locals همان دیکشنری یکسان هستند." +msgid "" +"In all cases, if the optional parts are omitted, the code is executed in the current scope. If only *globals* is " +"provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the " +"local variables. If *globals* and *locals* are given, they are used for the global and local variables, " +"respectively. If provided, *locals* can be any mapping object. Remember that at the module level, globals and " +"locals are the same dictionary." +msgstr "" +"در همه‌ی حالت‌ها، اگر بخش‌های اختیاری حذف شوند، کد در محدوده فعلی اجرا می‌شود. اگر فقط *globals* ارائه شود، باید یک " +"دیکشنری باشد (و نه یک زیرکلاس از دیکشنری) که هم برای متغیرهای سراسری و هم برای متغیرهای محلی استفاده خواهد شد. اگر " +"هر دو *globals* و *locals* ارائه شوند، به‌ترتیب برای متغیرهای سراسری و محلی استفاده می‌شوند. در صورت ارائه، *locals* " +"می‌تواند هر شیء نگاشتی باشد. به خاطر داشته باشید که در سطح ماژول، globals و locals همان دیکشنری یکسان هستند." -msgid "When ``exec`` gets two separate objects as *globals* and *locals*, the code will be executed as if it were embedded in a class definition. This means functions and classes defined in the executed code will not be able to access variables assigned at the top level (as the \"top level\" variables are treated as class variables in a class definition)." -msgstr "وقتی ``exec`` دو شیء جداگانه را به‌عنوان *globals* و *locals* دریافت می‌کند، کد به‌گونه‌ای اجرا می‌شود که گویی درون یک تعریف کلاس قرار دارد. این بدان معناست که توابع و کلاس‌های تعریف‌شده در کد اجراشده نمی‌توانند به متغیرهای اختصاص‌یافته در سطح بالا دسترسی داشته باشند (زیرا متغیرهای «سطح بالا» در تعریف کلاس به‌عنوان متغیرهای کلاس در نظر گرفته می‌شوند)." +msgid "" +"When ``exec`` gets two separate objects as *globals* and *locals*, the code will be executed as if it were embedded " +"in a class definition. This means functions and classes defined in the executed code will not be able to access " +"variables assigned at the top level (as the \"top level\" variables are treated as class variables in a class " +"definition)." +msgstr "" +"وقتی ``exec`` دو شیء جداگانه را به‌عنوان *globals* و *locals* دریافت می‌کند، کد به‌گونه‌ای اجرا می‌شود که گویی درون یک " +"تعریف کلاس قرار دارد. این بدان معناست که توابع و کلاس‌های تعریف‌شده در کد اجراشده نمی‌توانند به متغیرهای اختصاص‌یافته در " +"سطح بالا دسترسی داشته باشند (زیرا متغیرهای «سطح بالا» در تعریف کلاس به‌عنوان متغیرهای کلاس در نظر گرفته می‌شوند)." -msgid "If the *globals* dictionary does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key. Overriding ``__builtins__`` can be used to restrict or change the available names, but this is **not** a security mechanism: the executed code can still access all builtins." -msgstr "اگر دیکشنری *globals* مقداری برای کلید ``__builtins__`` نداشته باشد، ارجاعی به دیکشنری ماژول توکار :mod:`builtins` با همان کلید در آن درج می‌شود. بازنویسی ``__builtins__`` می‌تواند برای محدود کردن یا تغییر نام‌های در دسترس استفاده شود، اما این **یک سازوکار امنیتی نیست**؛ زیرا کدی که اجرا می‌شود همچنان می‌تواند به تمام اشیای توکار دسترسی داشته باشد." +msgid "" +"If the *globals* dictionary does not contain a value for the key ``__builtins__``, a reference to the dictionary of " +"the built-in module :mod:`builtins` is inserted under that key. Overriding ``__builtins__`` can be used to restrict " +"or change the available names, but this is **not** a security mechanism: the executed code can still access all " +"builtins." +msgstr "" +"اگر دیکشنری *globals* مقداری برای کلید ``__builtins__`` نداشته باشد، ارجاعی به دیکشنری ماژول توکار :mod:`builtins` " +"با همان کلید در آن درج می‌شود. بازنویسی ``__builtins__`` می‌تواند برای محدود کردن یا تغییر نام‌های در دسترس استفاده " +"شود، اما این **یک سازوکار امنیتی نیست**؛ زیرا کدی که اجرا می‌شود همچنان می‌تواند به تمام اشیای توکار دسترسی داشته باشد." -msgid "The *closure* argument specifies a closure--a tuple of cellvars. It's only valid when the *object* is a code object containing :term:`free (closure) variables `. The length of the tuple must exactly match the length of the code object's :attr:`~codeobject.co_freevars` attribute." -msgstr "آرگومان *closure* یک closure را مشخص می‌کند؛ یعنی یک تاپل از cellvarها. این آرگومان تنها زمانی معتبر است که *object* یک شیء کد باشد که شامل :term:`متغیرهای آزاد (closure) ` باشد. طول این تاپل باید دقیقاً با طول ویژگی :attr:`~codeobject.co_freevars` شیء کد برابر باشد." +msgid "" +"The *closure* argument specifies a closure--a tuple of cellvars. It's only valid when the *object* is a code object " +"containing :term:`free (closure) variables `. The length of the tuple must exactly match the " +"length of the code object's :attr:`~codeobject.co_freevars` attribute." +msgstr "" +"آرگومان *بستار* یک بستار را مشخص می‌کند؛ یعنی یک تاپل از cellvarها. این آرگومان تنها زمانی معتبر است که *object* یک " +"شیء کد باشد که شامل :term:`متغیرهای آزاد (بستار) ` باشد. طول این تاپل باید دقیقاً با طول " +"ویژگی :attr:`~codeobject.co_freevars` شیء کد برابر باشد." -msgid "The built-in functions :func:`globals` and :func:`locals` return the current global and local namespace, respectively, which may be useful to pass around for use as the second and third argument to :func:`exec`." -msgstr "توابع توکار :func:`globals` و :func:`locals` به‌ترتیب فضای نام سراسری و محلی فعلی را برمی‌گردانند که می‌توانند برای ارسال به‌عنوان آرگومان دوم و سوم تابع :func:`exec` مفید باشند." +msgid "" +"The built-in functions :func:`globals` and :func:`locals` return the current global and local namespace, " +"respectively, which may be useful to pass around for use as the second and third argument to :func:`exec`." +msgstr "" +"توابع توکار :func:`globals` و :func:`locals` به‌ترتیب فضای نام سراسری و محلی فعلی را برمی‌گردانند که می‌توانند برای " +"ارسال به‌عنوان آرگومان دوم و سوم تابع :func:`exec` مفید باشند." -msgid "The default *locals* act as described for function :func:`locals` below. Pass an explicit *locals* dictionary if you need to see effects of the code on *locals* after function :func:`exec` returns." -msgstr "*locals* پیش‌فرض همان‌گونه عمل می‌کند که در ادامه برای تابع :func:`locals` توضیح داده شده است. اگر لازم است پس از بازگشت تابع :func:`exec` تغییرات اعمال‌شده روی *locals* را مشاهده کنید، یک دیکشنری *locals* صریح ارسال کنید." +msgid "" +"The default *locals* act as described for function :func:`locals` below. Pass an explicit *locals* dictionary if you " +"need to see effects of the code on *locals* after function :func:`exec` returns." +msgstr "" +"*locals* پیش‌فرض همان‌گونه عمل می‌کند که در ادامه برای تابع :func:`locals` توضیح داده شده است. اگر لازم است پس از " +"بازگشت تابع :func:`exec` تغییرات اعمال‌شده روی *locals* را مشاهده کنید، یک دیکشنری *locals* صریح ارسال کنید." msgid "Added the *closure* parameter." msgstr "پارامتر *closure* اضافه شد." -msgid "Construct an iterator from those elements of *iterable* for which *function* is true. *iterable* may be either a sequence, a container which supports iteration, or an iterator. If *function* is ``None``, the identity function is assumed, that is, all elements of *iterable* that are false are removed." -msgstr "از میان عناصر *iterable*، آن‌هایی را که *function* برایشان مقدار True برمی‌گرداند، انتخاب کرده و یک تکرارگر می‌سازد. *iterable* می‌تواند یک دنباله، یک محفظهٔ تکرارپذیر، یا یک تکرارگر باشد. اگر *function* برابر ``None`` باشد، تابع همانی در نظر گرفته می‌شود؛ یعنی تمام عناصری از *iterable* که نادرست (False) هستند، حذف می‌شوند." +msgid "" +"Construct an iterator from those elements of *iterable* for which *function* is true. *iterable* may be either a " +"sequence, a container which supports iteration, or an iterator. If *function* is ``None``, the identity function is " +"assumed, that is, all elements of *iterable* that are false are removed." +msgstr "" +"از میان عناصر *iterable*، آن‌هایی را که *function* برایشان مقدار True برمی‌گرداند، انتخاب کرده و یک پیمایش‌گر می‌سازد. " +"*iterable* می‌تواند یک دنباله، یک محفظه‌ی پیمایش‌پذیر، یا یک پیمایش‌گر باشد. اگر *function* برابر ``None`` باشد، تابع " +"همانی در نظر گرفته می‌شود؛ یعنی تمام عناصری از *iterable* که نادرست (False) هستند، حذف می‌شوند." -msgid "Note that ``filter(function, iterable)`` is equivalent to the generator expression ``(item for item in iterable if function(item))`` if function is not ``None`` and ``(item for item in iterable if item)`` if function is ``None``." -msgstr "توجه داشته باشید که اگر *function* برابر ``None`` نباشد، ``filter(function, iterable)`` معادل عبارت تولیدگر ``(item for item in iterable if function(item))`` است، و اگر *function* برابر ``None`` باشد، معادل ``(item for item in iterable if item)`` خواهد بود." +msgid "" +"Note that ``filter(function, iterable)`` is equivalent to the generator expression ``(item for item in iterable if " +"function(item))`` if function is not ``None`` and ``(item for item in iterable if item)`` if function is ``None``." +msgstr "" +"توجه داشته باشید که اگر *function* برابر ``None`` نباشد، ``filter(function, iterable)`` معادل عبارت تولیدگر ``(item " +"for item in iterable if function(item))`` است، و اگر *function* برابر ``None`` باشد، معادل ``(item for item in " +"iterable if item)`` خواهد بود." -msgid "See :func:`itertools.filterfalse` for the complementary function that returns elements of *iterable* for which *function* is false." -msgstr "برای تابع مکملی که عناصر *iterable* را که *function* برای آن‌ها مقدار نادرست (false) برمی‌گرداند، بازمی‌گرداند، به :func:`itertools.filterfalse` مراجعه کنید." +msgid "" +"See :func:`itertools.filterfalse` for the complementary function that returns elements of *iterable* for which " +"*function* is false." +msgstr "" +"برای تابع مکملی که عناصر *iterable* را که *function* برای آن‌ها مقدار نادرست (false) برمی‌گرداند، بازمی‌گرداند، " +"به :func:`itertools.filterfalse` مراجعه کنید." msgid "Return a floating-point number constructed from a number or a string." msgstr "یک عدد ممیز شناور که از یک عدد یا یک رشته ساخته شده است را برمی‌گرداند." @@ -752,17 +1158,41 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -msgid "If the argument is a string, it should contain a decimal number, optionally preceded by a sign, and optionally embedded in whitespace. The optional sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value produced. The argument may also be a string representing a NaN (not-a-number), or positive or negative infinity. More precisely, the input must conform to the :token:`~float:floatvalue` production rule in the following grammar, after leading and trailing whitespace characters are removed:" -msgstr "اگر آرگومان یک رشته باشد، باید شامل یک عدد ده‌دهی باشد که به‌صورت اختیاری با یک علامت و همچنین با فاصلهٔ سفید احاطه شده باشد. علامت اختیاری می‌تواند ``'+'`` یا ``'-'`` باشد؛ علامت ``'+'`` تأثیری بر مقدار تولیدشده ندارد. آرگومان همچنین می‌تواند رشته‌ای باشد که یک NaN (عدد نیست) یا بی‌نهایت مثبت یا منفی را نمایش می‌دهد. به‌طور دقیق‌تر، پس از حذف نویسه‌های فاصلهٔ سفید ابتدا و انتهای رشته، ورودی باید با قاعدهٔ تولید :token:`~float:floatvalue` در دستور زبان زیر مطابقت داشته باشد:" +msgid "" +"If the argument is a string, it should contain a decimal number, optionally preceded by a sign, and optionally " +"embedded in whitespace. The optional sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value " +"produced. The argument may also be a string representing a NaN (not-a-number), or positive or negative infinity. " +"More precisely, the input must conform to the :token:`~float:floatvalue` production rule in the following grammar, " +"after leading and trailing whitespace characters are removed:" +msgstr "" +"اگر آرگومان یک رشته باشد، باید شامل یک عدد ده‌دهی باشد که به‌صورت اختیاری با یک علامت و همچنین با فاصله‌ی سفید احاطه " +"شده باشد. علامت اختیاری می‌تواند ``'+'`` یا ``'-'`` باشد؛ علامت ``'+'`` تأثیری بر مقدار تولیدشده ندارد. آرگومان " +"همچنین می‌تواند رشته‌ای باشد که یک NaN (عدد نیست) یا بی‌نهایت مثبت یا منفی را نمایش می‌دهد. به‌طور دقیق‌تر، پس از حذف " +"نویسه‌های فاصله‌ی سفید ابتدا و انتهای رشته، ورودی باید با قاعده‌ی تولید :token:`~float:floatvalue` در دستور زبان زیر " +"مطابقت داشته باشد:" -msgid "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", and \"iNfINity\" are all acceptable spellings for positive infinity." -msgstr "بزرگی و کوچکی حروف (case) اهمیتی ندارد؛ بنابراین، برای مثال، «inf»، «Inf»، «INFINITY» و «iNfINity» همگی برای نمایش بی‌نهایت مثبت معتبر هستند." +msgid "" +"Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", and \"iNfINity\" are all acceptable " +"spellings for positive infinity." +msgstr "" +"بزرگی و کوچکی حروف (case) اهمیتی ندارد؛ بنابراین، برای مثال، «inf»، «Inf»، «INFINITY» و «iNfINity» همگی برای نمایش " +"بی‌نهایت مثبت معتبر هستند." -msgid "Otherwise, if the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised." -msgstr "در غیر این صورت، اگر آرگومان یک عدد صحیح یا یک عدد ممیز شناور باشد، یک عدد ممیز شناور با همان مقدار (در محدودهٔ دقت اعداد ممیز شناور پایتون) برگردانده می‌شود. اگر آرگومان خارج از محدودهٔ یک عدد ممیز شناور در پایتون باشد، استثنای :exc:`OverflowError` پرتاب خواهد شد." +msgid "" +"Otherwise, if the argument is an integer or a floating-point number, a floating-point number with the same value " +"(within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, " +"an :exc:`OverflowError` will be raised." +msgstr "" +"در غیر این صورت، اگر آرگومان یک عدد صحیح یا یک عدد ممیز شناور باشد، یک عدد ممیز شناور با همان مقدار (در محدوده‌ی دقت " +"اعداد ممیز شناور پایتون) برگردانده می‌شود. اگر آرگومان خارج از محدوده‌ی یک عدد ممیز شناور در پایتون باشد، " +"استثنای :exc:`OverflowError` پرتاب خواهد شد." -msgid "For a general Python object ``x``, ``float(x)`` delegates to ``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls back to :meth:`~object.__index__`." -msgstr "برای یک شیء عمومی پایتون به نام ``x``، تابع ``float(x)`` فراخوانی را به ``x.__float__()`` واگذار می‌کند. اگر :meth:`~object.__float__` تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." +msgid "" +"For a general Python object ``x``, ``float(x)`` delegates to ``x.__float__()``. If :meth:`~object.__float__` is not " +"defined then it falls back to :meth:`~object.__index__`." +msgstr "" +"برای یک شیء عمومی پایتون به نام ``x``، تابع ``float(x)`` فراخوانی را به ``x.__float__()`` واگذار می‌کند. " +"اگر :meth:`~object.__float__` تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." msgid "See also :meth:`float.from_number` which only accepts a numeric argument." msgstr "همچنین به :meth:`float.from_number` مراجعه کنید که فقط یک آرگومان عددی را می‌پذیرد." @@ -774,79 +1204,177 @@ msgid "The float type is described in :ref:`typesnumeric`." msgstr "نوع ممیز شناور در :ref:`typesnumeric` توضیح داده شده است." msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not defined." -msgstr "اگر :meth:`~object.__float__` تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." +msgstr "" +"اگر :meth:`~object.__float__ <~object.__index__>` تعریف نشده باشد، به :meth:`~object.__index__ <~object.__float__>` " +"بازمی‌گردد." -msgid "Convert a *value* to a \"formatted\" representation, as controlled by *format_spec*. The interpretation of *format_spec* will depend on the type of the *value* argument; however, there is a standard formatting syntax that is used by most built-in types: :ref:`formatspec`." -msgstr "*value* را مطابق با *format_spec* به یک نمایش قالب‌بندی‌شده تبدیل می‌کند. نحوهٔ تفسیر *format_spec* به نوع آرگومان *value* بستگی دارد؛ با این حال، یک نحو استاندارد برای قالب‌بندی وجود دارد که بیشتر انواع توکار از آن استفاده می‌کنند: :ref:`formatspec`." +msgid "" +"Convert a *value* to a \"formatted\" representation, as controlled by *format_spec*. The interpretation of " +"*format_spec* will depend on the type of the *value* argument; however, there is a standard formatting syntax that " +"is used by most built-in types: :ref:`formatspec`." +msgstr "" +"*value* را مطابق با *format_spec* به یک نمایش قالب‌بندی‌شده تبدیل می‌کند. نحوه‌ی تفسیر *format_spec* به نوع آرگومان " +"*value* بستگی دارد؛ با این حال، یک نحو استاندارد برای قالب‌بندی وجود دارد که بیشتر انواع توکار از آن استفاده " +"می‌کنند: :ref:`formatspec`." -msgid "The default *format_spec* is an empty string which usually gives the same effect as calling :func:`str(value) `." -msgstr "مقدار پیش‌فرض *format_spec* یک رشتهٔ خالی است که معمولاً همان اثری را دارد که فراخوانی :func:`str(value) ` ایجاد می‌کند." +msgid "" +"The default *format_spec* is an empty string which usually gives the same effect as calling :func:`str(value) `." +msgstr "" +"مقدار پیش‌فرض *format_spec* یک رشته‌ی خالی است که معمولاً همان اثری را دارد که فراخوانی :func:`str(value) ` ایجاد " +"می‌کند." -msgid "A call to ``format(value, format_spec)`` is translated to ``type(value).__format__(value, format_spec)`` which bypasses the instance dictionary when searching for the value's :meth:`~object.__format__` method. A :exc:`TypeError` exception is raised if the method search reaches :mod:`object` and the *format_spec* is non-empty, or if either the *format_spec* or the return value are not strings." -msgstr "فراخوانی ``format(value, format_spec)`` به ``type(value).__format__(value, format_spec)`` تبدیل می‌شود که هنگام جست‌وجوی متد :meth:`~object.__format__` مربوط به *value*، دیکشنری نمونه را نادیده می‌گیرد. اگر جست‌وجوی متد به :mod:`object` برسد و *format_spec* خالی نباشد، یا اگر *format_spec* یا مقدار بازگشتی رشته نباشند، استثنای :exc:`TypeError` پرتاب می‌شود." +msgid "" +"A call to ``format(value, format_spec)`` is translated to ``type(value).__format__(value, format_spec)`` which " +"bypasses the instance dictionary when searching for the value's :meth:`~object.__format__` method. " +"A :exc:`TypeError` exception is raised if the method search reaches :mod:`object` and the *format_spec* is non-" +"empty, or if either the *format_spec* or the return value are not strings." +msgstr "" +"فراخوانی ``format(value, format_spec)`` به ``type(value).__format__(value, format_spec)`` تبدیل می‌شود که هنگام " +"جست‌وجوی متد :meth:`~object.__format__` مربوط به *value*، دیکشنری نمونه را نادیده می‌گیرد. اگر جست‌وجوی متد " +"به :mod:`object` برسد و *format_spec* خالی نباشد، یا اگر *format_spec* یا مقدار بازگشتی رشته نباشند، " +"استثنای :exc:`TypeError` پرتاب می‌شود." msgid "``object().__format__(format_spec)`` raises :exc:`TypeError` if *format_spec* is not an empty string." -msgstr "اگر *format_spec* یک رشتهٔ خالی نباشد، ``object().__format__(format_spec)`` استثنای :exc:`TypeError` پرتاب می‌کند." +msgstr "" +"اگر *format_spec* یک رشته‌ی خالی نباشد، ``object().__format__(format_spec)`` استثنای :exc:`TypeError` پرتاب می‌کند." -msgid "Return a new :class:`frozenset` object, optionally with elements taken from *iterable*. :class:`frozenset` is a built-in class. See also :ref:`types-set` for documentation about this class." -msgstr "یک شیء جدید از نوع :class:`frozenset` را برمی‌گرداند که در صورت ارائه، عناصر آن از *iterable* گرفته می‌شوند. :class:`frozenset` یک کلاس توکار است. برای مستندات این کلاس، به :ref:`types-set` مراجعه کنید." +msgid "" +"Return a new :class:`frozenset` object, optionally with elements taken from *iterable*. :class:`frozenset` is a " +"built-in class. See also :ref:`types-set` for documentation about this class." +msgstr "" +"یک شیء جدید از نوع :class:`frozenset` را برمی‌گرداند که در صورت ارائه، عناصر آن از *iterable* گرفته " +"می‌شوند. :class:`frozenset` یک کلاس توکار است. برای مستندات این کلاس، به :ref:`types-set` مراجعه کنید." -msgid "For other containers see the built-in :class:`set`, :class:`list`, :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." -msgstr "برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`set`، :class:`list`، :class:`tuple` و :class:`dict`، و همچنین ماژول :mod:`collections` مراجعه کنید." +msgid "" +"For other containers see the built-in :class:`set`, :class:`list`, :class:`tuple`, and :class:`dict` classes, as " +"well as the :mod:`collections` module." +msgstr "" +"برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`set`، :class:`list`، :class:`tuple` و :class:`dict`، و همچنین " +"ماژول :mod:`collections` مراجعه کنید." -msgid "Return the value of the named attribute of *object*. *name* must be a string. If the string is the name of one of the object's attributes, the result is the value of that attribute. For example, ``getattr(x, 'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not exist, *default* is returned if provided, otherwise :exc:`AttributeError` is raised. *name* need not be a Python identifier (see :func:`setattr`)." -msgstr "مقدار ویژگیِ نام‌گذاری‌شدهٔ *object* را برمی‌گرداند. *name* باید یک رشته باشد. اگر رشته، نام یکی از ویژگی‌های شیء باشد، نتیجه مقدار آن ویژگی خواهد بود. برای مثال، ``getattr(x, 'foobar')`` معادل ``x.foobar`` است. اگر ویژگیِ نام‌گذاری‌شده وجود نداشته باشد، در صورت ارائه، *default* برگردانده می‌شود؛ در غیر این صورت، استثنای :exc:`AttributeError` پرتاب می‌شود. لازم نیست *name* یک شناسهٔ معتبر پایتون باشد (به :func:`setattr` مراجعه کنید)." +msgid "" +"Return the value of the named attribute of *object*. *name* must be a string. If the string is the name of one of " +"the object's attributes, the result is the value of that attribute. For example, ``getattr(x, 'foobar')`` is " +"equivalent to ``x.foobar``. If the named attribute does not exist, *default* is returned if provided, " +"otherwise :exc:`AttributeError` is raised. *name* need not be a Python identifier (see :func:`setattr`)." +msgstr "" +"مقدار ویژگیِ نام‌گذاری‌شده‌ی *object* را برمی‌گرداند. *name* باید یک رشته باشد. اگر رشته، نام یکی از ویژگی‌های شیء باشد، " +"نتیجه مقدار آن ویژگی خواهد بود. برای مثال، ``getattr(x, 'foobar')`` معادل ``x.foobar`` است. اگر ویژگیِ نام‌گذاری‌شده " +"وجود نداشته باشد، در صورت ارائه، *default* برگردانده می‌شود؛ در غیر این صورت، استثنای :exc:`AttributeError` پرتاب " +"می‌شود. لازم نیست *name* یک شناسه‌ی معتبر پایتون باشد (به :func:`setattr` مراجعه کنید)." -msgid "Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a private attribute's (attributes with two leading underscores) name in order to retrieve it with :func:`getattr`." -msgstr "از آنجا که :ref:`تغییر نام خصوصی ` در زمان کامپایل انجام می‌شود، برای بازیابی یک ویژگی خصوصی (ویژگی‌هایی که با دو زیرخط آغاز می‌شوند) با استفاده از :func:`getattr`، باید نام آن را به‌صورت دستی تغییر دهید." +msgid "" +"Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a " +"private attribute's (attributes with two leading underscores) name in order to retrieve it with :func:`getattr`." +msgstr "" +"از آنجا که :ref:`تغییر نام خصوصی ` در زمان کامپایل انجام می‌شود، برای بازیابی یک ویژگی خصوصی " +"(ویژگی‌هایی که با دو زیرخط آغاز می‌شوند) با استفاده از :func:`getattr`، باید نام آن را به‌صورت دستی تغییر دهید." -msgid "Return the dictionary implementing the current module namespace. For code within functions, this is set when the function is defined and remains the same regardless of where the function is called." -msgstr "دیکشنریی را که فضای نام ماژول فعلی را پیاده‌سازی می‌کند، برمی‌گرداند. برای کدهای داخل توابع، این مقدار هنگام تعریف تابع تنظیم می‌شود و بدون توجه به این‌که تابع از کجا فراخوانی شود، ثابت باقی می‌ماند." +msgid "" +"Return the dictionary implementing the current module namespace. For code within functions, this is set when the " +"function is defined and remains the same regardless of where the function is called." +msgstr "" +"دیکشنریی را که فضای نام ماژول فعلی را پیاده‌سازی می‌کند، برمی‌گرداند. برای کدهای داخل توابع، این مقدار هنگام تعریف تابع " +"تنظیم می‌شود و بدون توجه به این‌که تابع از کجا فراخوانی شود، ثابت باقی می‌ماند." -msgid "The arguments are an object and a string. The result is ``True`` if the string is the name of one of the object's attributes, ``False`` if not. (This is implemented by calling ``getattr(object, name)`` and seeing whether it raises an :exc:`AttributeError` or not.)" -msgstr "آرگومان‌ها شامل یک شیء و یک رشته هستند. اگر رشته نام یکی از ویژگی‌های آن شیء باشد، نتیجه ``True`` و در غیر این صورت ``False`` خواهد بود. (این کار با فراخوانی ``getattr(object, name)`` و بررسی اینکه آیا استثنای :exc:`AttributeError` پرتاب می‌شود یا نه، پیاده‌سازی شده است.)" +msgid "" +"The arguments are an object and a string. The result is ``True`` if the string is the name of one of the object's " +"attributes, ``False`` if not. (This is implemented by calling ``getattr(object, name)`` and seeing whether it raises " +"an :exc:`AttributeError` or not.)" +msgstr "" +"آرگومان‌ها شامل یک شیء و یک رشته هستند. اگر رشته نام یکی از ویژگی‌های آن شیء باشد، نتیجه ``True`` و در غیر این صورت " +"``False`` خواهد بود. (این کار با فراخوانی ``getattr(object, name)`` و بررسی اینکه آیا استثنای :exc:`AttributeError` " +"پرتاب می‌شود یا نه، پیاده‌سازی شده است.)" -msgid "Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if they are of different types, as is the case for 1 and 1.0)." -msgstr "مقدار هش شیء را (در صورتی که داشته باشد) برمی‌گرداند. مقادیر هش اعداد صحیح هستند. از آن‌ها برای مقایسهٔ سریع کلیدهای دیکشنری هنگام جست‌وجو در دیکشنری استفاده می‌شود. مقادیر عددی که با یکدیگر برابر مقایسه می‌شوند، مقدار هش یکسانی دارند (حتی اگر از نوع‌های متفاوتی باشند، مانند 1 و 1.0)." +msgid "" +"Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare " +"dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if " +"they are of different types, as is the case for 1 and 1.0)." +msgstr "" +"مقدار هش شیء را (در صورتی که داشته باشد) برمی‌گرداند. مقادیر هش اعداد صحیح هستند. از آن‌ها برای مقایسه‌ی سریع کلیدهای " +"دیکشنری هنگام جست‌وجو در دیکشنری استفاده می‌شود. مقادیر عددی که با یکدیگر برابر مقایسه می‌شوند، مقدار هش یکسانی دارند " +"(حتی اگر از نوع‌های متفاوتی باشند، مانند 1 و 1.0)." -msgid "For objects with custom :meth:`~object.__hash__` methods, note that :func:`hash` truncates the return value based on the bit width of the host machine." -msgstr "برای اشیایی که متد :meth:`~object.__hash__` سفارشی دارند، توجه داشته باشید که :func:`hash` مقدار بازگشتی را بر اساس پهنای بیت ماشین میزبان کوتاه می‌کند." +msgid "" +"For objects with custom :meth:`~object.__hash__` methods, note that :func:`hash` truncates the return value based on " +"the bit width of the host machine." +msgstr "" +"برای اشیایی که متد :meth:`~object.__hash__` سفارشی دارند، توجه داشته باشید که :func:`hash` مقدار بازگشتی را بر اساس " +"پهنای بیت ماشین میزبان کوتاه می‌کند." -msgid "Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated." -msgstr "سامانهٔ راهنمای توکار را فراخوانی می‌کند. (این تابع برای استفادهٔ تعاملی طراحی شده است.) اگر هیچ آرگومانی ارائه نشود، سامانهٔ راهنمای تعاملی در کنسول مفسر آغاز می‌شود. اگر آرگومان یک رشته باشد، آن رشته به‌عنوان نام یک ماژول، تابع، کلاس، متد، کلیدواژه یا موضوع مستندات جست‌وجو می‌شود و صفحهٔ راهنمای آن در کنسول نمایش داده می‌شود. اگر آرگومان هر نوع شیء دیگری باشد، صفحهٔ راهنمای مربوط به آن شیء تولید می‌شود." +msgid "" +"Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the " +"interactive help system starts on the interpreter console. If the argument is a string, then the string is looked " +"up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on " +"the console. If the argument is any other kind of object, a help page on the object is generated." +msgstr "" +"سامانه‌ی راهنمای توکار را فراخوانی می‌کند. (این تابع برای استفاده‌ی تعاملی طراحی شده است.) اگر هیچ آرگومانی ارائه نشود، " +"سامانه‌ی راهنمای تعاملی در کنسول مفسر آغاز می‌شود. اگر آرگومان یک رشته باشد، آن رشته به‌عنوان نام یک ماژول، تابع، کلاس، " +"متد، کلیدواژه یا موضوع مستندات جست‌وجو می‌شود و صفحه‌ی راهنمای آن در کنسول نمایش داده می‌شود. اگر آرگومان هر نوع شیء " +"دیگری باشد، صفحه‌ی راهنمای مربوط به آن شیء تولید می‌شود." -msgid "Note that if a slash(/) appears in the parameter list of a function when invoking :func:`help`, it means that the parameters prior to the slash are positional-only. For more info, see :ref:`the FAQ entry on positional-only parameters `." -msgstr "توجه داشته باشید که اگر هنگام فراخوانی :func:`help` یک اسلش (/) در فهرست پارامترهای یک تابع ظاهر شود، به این معناست که پارامترهای قبل از اسلش فقط به‌صورت مکانی قابل ارسال هستند. برای اطلاعات بیشتر، به :ref:`پرسش متداول مربوط به پارامترهای فقط مکانی ` مراجعه کنید." +msgid "" +"Note that if a slash(/) appears in the parameter list of a function when invoking :func:`help`, it means that the " +"parameters prior to the slash are positional-only. For more info, see :ref:`the FAQ entry on positional-only " +"parameters `." +msgstr "" +"توجه داشته باشید که اگر هنگام فراخوانی :func:`help` یک اسلش (/) در فهرست پارامترهای یک تابع ظاهر شود، به این معناست " +"که پارامترهای قبل از اسلش فقط به‌صورت جایگاهی قابل ارسال هستند. برای اطلاعات بیشتر، به :ref:`پرسش متداول مربوط به " +"پارامترهای فقط جایگاهی ` مراجعه کنید." msgid "This function is added to the built-in namespace by the :mod:`site` module." msgstr "این تابع توسط ماژول :mod:`site` به فضای نام توکار (built-in namespace) اضافه می‌شود." -msgid "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures for callables are now more comprehensive and consistent." -msgstr "تغییرات اعمال‌شده در :mod:`pydoc` و :mod:`inspect` باعث شده‌اند امضاهای گزارش‌شده برای اشیای فراخوانی‌پذیر اکنون کامل‌تر و سازگارتر باشند." +msgid "" +"Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures for callables are now more " +"comprehensive and consistent." +msgstr "" +"تغییرات اعمال‌شده در :mod:`pydoc` و :mod:`inspect` باعث شده‌اند امضاهای گزارش‌شده برای اشیای فراخوانی‌پذیر اکنون کامل‌تر " +"و سازگارتر باشند." -msgid "Convert an integer number to a lowercase hexadecimal string prefixed with \"0x\". If *integer* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. Some examples:" -msgstr "یک عدد صحیح را به یک رشتهٔ شانزده‌شانزدهی کوچک‌حرف با پیشوند «0x» تبدیل می‌کند. اگر *integer* یک شیء از نوع :class:`int` پایتون نباشد، باید متدی به نام :meth:`~object.__index__` تعریف کند که یک عدد صحیح برمی‌گرداند. چند نمونه:" +msgid "" +"Convert an integer number to a lowercase hexadecimal string prefixed with \"0x\". If *integer* is not a " +"Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. Some " +"examples:" +msgstr "" +"یک عدد صحیح را به یک رشته‌ی شانزده‌شانزدهی کوچک‌حرف با پیشوند «0x» تبدیل می‌کند. اگر *integer* یک شیء از " +"نوع :class:`int` پایتون نباشد، باید متدی به نام :meth:`~object.__index__` تعریف کند که یک عدد صحیح برمی‌گرداند. چند " +"نمونه:" -msgid "If you want to convert an integer number to an uppercase or lower hexadecimal string with prefix or not, you can use either of the following ways:" -msgstr "اگر می‌خواهید یک عدد صحیح را به یک رشتهٔ شانزده‌شانزدهی با حروف بزرگ یا کوچک، با پیشوند یا بدون آن، تبدیل کنید، می‌توانید از هر یک از روش‌های زیر استفاده کنید:" +msgid "" +"If you want to convert an integer number to an uppercase or lower hexadecimal string with prefix or not, you can use " +"either of the following ways:" +msgstr "" +"اگر می‌خواهید یک عدد صحیح را به یک رشته‌ی شانزده‌شانزدهی با حروف بزرگ یا کوچک، با پیشوند یا بدون آن، تبدیل کنید، " +"می‌توانید از هر یک از روش‌های زیر استفاده کنید:" msgid "See also :func:`int` for converting a hexadecimal string to an integer using a base of 16." -msgstr "همچنین برای تبدیل یک رشتهٔ شانزده‌شانزدهی به یک عدد صحیح با استفاده از مبنای 16، به :func:`int` مراجعه کنید." +msgstr "همچنین برای تبدیل یک رشته‌ی شانزده‌شانزدهی به یک عدد صحیح با استفاده از مبنای 16، به :func:`int` مراجعه کنید." msgid "To obtain a hexadecimal string representation for a float, use the :meth:`float.hex` method." msgstr "برای به‌دست‌آوردن نمایش شانزدهی یک عدد ممیز شناور، از متد :meth:`float.hex` استفاده کنید." -msgid "Return the \"identity\" of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same :func:`id` value." -msgstr "«شناسه» یک شیء را برمی‌گرداند. این مقدار یک عدد صحیح است که در طول عمر آن شیء، یکتا و ثابت بودنش تضمین شده است. دو شیء که طول عمر آن‌ها با یکدیگر هم‌پوشانی ندارد، ممکن است مقدار یکسانی از :func:`id` داشته باشند." +msgid "" +"Return the \"identity\" of an object. This is an integer which is guaranteed to be unique and constant for this " +"object during its lifetime. Two objects with non-overlapping lifetimes may have the same :func:`id` value." +msgstr "" +"«شناسه» یک شیء را برمی‌گرداند. این مقدار یک عدد صحیح است که در طول عمر آن شیء، یکتا و ثابت بودنش تضمین شده است. دو " +"شیء که طول عمر آن‌ها با یکدیگر هم‌پوشانی ندارد، ممکن است مقدار یکسانی از :func:`id` داشته باشند." msgid "This is the address of the object in memory." msgstr "این، آدرس شیء در حافظه است." msgid "Raises an :ref:`auditing event ` ``builtins.id`` with argument ``id``." -msgstr "یک :ref:`رویداد ممیزی ` با نام ``builtins.id`` و آرگومان ``id`` پرتاب می‌کند." +msgstr "یک :ref:`رویداد حسابرسی ` با نام ``builtins.id`` و آرگومان ``id`` پرتاب می‌کند." -msgid "If the *prompt* argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, :exc:`EOFError` is raised. Example::" -msgstr "اگر آرگومان *prompt* ارائه شود، بدون افزودن نویسهٔ پایان خط در خروجی استاندارد نوشته می‌شود. سپس تابع یک خط از ورودی می‌خواند، آن را به یک رشته تبدیل می‌کند (با حذف نویسهٔ پایان خط انتهایی) و همان را برمی‌گرداند. اگر به انتهای فایل (EOF) برسد، استثنای :exc:`EOFError` پرتاب می‌شود. مثال::" +msgid "" +"If the *prompt* argument is present, it is written to standard output without a trailing newline. The function then " +"reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is " +"read, :exc:`EOFError` is raised. Example::" +msgstr "" +"اگر آرگومان *prompt* ارائه شود، بدون افزودن نویسه‌ی پایان خط در خروجی استاندارد نوشته می‌شود. سپس تابع یک خط از ورودی " +"می‌خواند، آن را به یک رشته تبدیل می‌کند (با حذف نویسه‌ی پایان خط انتهایی) و همان را برمی‌گرداند. اگر به پایان پرونده " +"(EOF) برسد، استثنای :exc:`EOFError` پرتاب می‌شود. مثال::" msgid "" ">>> s = input('--> ')\n" @@ -859,17 +1387,28 @@ msgstr "" ">>> s\n" "\"Monty Python's Flying Circus\"" -msgid "If the :mod:`readline` module was loaded, then :func:`input` will use it to provide elaborate line editing and history features." -msgstr "اگر ماژول :mod:`readline` بارگذاری شده باشد، :func:`input` از آن برای فراهم کردن امکانات پیشرفتهٔ ویرایش خط و تاریخچهٔ ورودی استفاده می‌کند." +msgid "" +"If the :mod:`readline` module was loaded, then :func:`input` will use it to provide elaborate line editing and " +"history features." +msgstr "" +"اگر ماژول :mod:`readline` بارگذاری شده باشد، :func:`input` از آن برای فراهم کردن امکانات پیشرفته‌ی ویرایش خط و " +"تاریخچه‌ی ورودی استفاده می‌کند." msgid "Raises an :ref:`auditing event ` ``builtins.input`` with argument ``prompt`` before reading input" -msgstr "پیش از خواندن ورودی، یک :ref:`رویداد ممیزی ` با نام ``builtins.input`` و آرگومان ``prompt`` پرتاب می‌کند" +msgstr "" +"پیش از خواندن ورودی، یک :ref:`رویداد حسابرسی ` با نام ``builtins.input`` و آرگومان ``prompt`` پرتاب می‌کند" -msgid "Raises an :ref:`auditing event ` ``builtins.input/result`` with the result after successfully reading input." -msgstr "پس از خواندن موفقیت‌آمیز ورودی، یک :ref:`رویداد ممیزی ` با نام ``builtins.input/result`` و نتیجهٔ خوانده‌شده پرتاب می‌کند." +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input/result`` with the result after successfully reading " +"input." +msgstr "" +"پس از خواندن موفقیت‌آمیز ورودی، یک :ref:`رویداد حسابرسی ` با نام ``builtins.input/result`` و نتیجه‌ی " +"خوانده‌شده پرتاب می‌کند." msgid "Return an integer object constructed from a number or a string, or return ``0`` if no arguments are given." -msgstr "یک شیء عدد صحیح را که از یک عدد یا یک رشته ساخته شده است برمی‌گرداند، یا اگر هیچ آرگومانی داده نشده باشد، مقدار ``0`` را برمی‌گرداند." +msgstr "" +"یک شیء عدد صحیح را که از یک عدد یا یک رشته ساخته شده است برمی‌گرداند، یا اگر هیچ آرگومانی داده نشده باشد، مقدار ``0`` " +"را برمی‌گرداند." msgid "" ">>> int(123.45)\n" @@ -898,50 +1437,133 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -msgid "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x.__int__()``. If the argument defines :meth:`~object.__index__`, it returns ``x.__index__()``. For floating-point numbers, this truncates towards zero." -msgstr "اگر آرگومان متد :meth:`~object.__int__` را تعریف کرده باشد، ``int(x)`` مقدار ``x.__int__()`` را برمی‌گرداند. اگر آرگومان متد :meth:`~object.__index__` را تعریف کرده باشد، مقدار ``x.__index__()`` برگردانده می‌شود. برای اعداد ممیز شناور، این تبدیل بخش اعشاری را در جهت صفر حذف می‌کند." +msgid "" +"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x.__int__()``. If the argument " +"defines :meth:`~object.__index__`, it returns ``x.__index__()``. For floating-point numbers, this truncates towards " +"zero." +msgstr "" +"اگر آرگومان متد :meth:`~object.__int__` را تعریف کرده باشد، ``int(x)`` مقدار ``x.__int__()`` را برمی‌گرداند. اگر " +"آرگومان متد :meth:`~object.__index__` را تعریف کرده باشد، مقدار ``x.__index__()`` برگردانده می‌شود. برای اعداد ممیز " +"شناور، این تبدیل بخش اعشاری را در جهت صفر حذف می‌کند." -msgid "If the argument is not a number or if *base* is given, then it must be a string, :class:`bytes`, or :class:`bytearray` instance representing an integer in radix *base*. Optionally, the string can be preceded by ``+`` or ``-`` (with no space in between), have leading zeros, be surrounded by whitespace, and have single underscores interspersed between digits." -msgstr "اگر آرگومان یک عدد نباشد یا *base* مشخص شده باشد، باید نمونه‌ای از :class:`bytes` یا :class:`bytearray` باشد که یک عدد صحیح در مبنای *base* را نمایش می‌دهد. به‌صورت اختیاری، رشته می‌تواند با ``+`` یا ``-`` (بدون فاصله بین آن‌ها و عدد) آغاز شود، دارای صفرهای ابتدایی باشد، با فاصلهٔ سفید احاطه شده باشد و بین رقم‌های آن زیرخط‌های تکی قرار گرفته باشند." +msgid "" +"If the argument is not a number or if *base* is given, then it must be a string, :class:`bytes`, " +"or :class:`bytearray` instance representing an integer in radix *base*. Optionally, the string can be preceded by " +"``+`` or ``-`` (with no space in between), have leading zeros, be surrounded by whitespace, and have single " +"underscores interspersed between digits." +msgstr "" +"اگر آرگومان یک عدد نباشد یا *base* مشخص شده باشد، باید نمونه‌ای از :class:`bytes` یا :class:`bytearray` باشد که یک " +"عدد صحیح در مبنای *base* را نمایش می‌دهد. به‌صورت اختیاری، رشته می‌تواند با ``+`` یا ``-`` (بدون فاصله بین آن‌ها و عدد) " +"آغاز شود، دارای صفرهای ابتدایی باشد، با فاصله‌ی سفید احاطه شده باشد و بین رقم‌های آن زیرخط‌های تکی قرار گرفته باشند." -msgid "A base-n integer string contains digits, each representing a value from 0 to n-1. The values 0--9 can be represented by any Unicode decimal digit. The values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16 strings can be optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. For base 0, the string is interpreted in a similar way to an :ref:`integer literal in code `, in that the actual base is 2, 8, 10, or 16 as determined by the prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, while ``int('010')`` and ``int('010', 8)`` are." -msgstr "یک رشتهٔ عدد صحیح در مبنای n شامل رقم‌هایی است که هر یک مقداری بین 0 تا n-1 را نمایش می‌دهند. مقادیر 0 تا 9 را می‌توان با هر رقم ده‌دهی یونیکد نمایش داد. مقادیر 10 تا 35 را می‌توان با نویسه‌های ``a`` تا ``z`` (یا ``A`` تا ``Z``) نمایش داد. مقدار پیش‌فرض *base* برابر 10 است. مبناهای مجاز عبارت‌اند از 0 و 2 تا 36. رشته‌های مبنای 2، 8 و 16 می‌توانند، همانند ثابت‌های عدد صحیح در کد، به‌ترتیب با پیشوندهای ``0b``/``0B``، ``0o``/``0O`` یا ``0x``/``0X`` آغاز شوند. برای مبنای 0، رشته مشابه یک :ref:`ثابت عدد صحیح در کد ` تفسیر می‌شود؛ یعنی مبنای واقعی بر اساس پیشوند، یکی از 2، 8، 10 یا 16 خواهد بود. همچنین در مبنای 0 استفاده از صفرهای ابتدایی مجاز نیست؛ بنابراین ``int('010', 0)`` معتبر نیست، در حالی که ``int('010')`` و ``int('010', 8)`` معتبر هستند." +msgid "" +"A base-n integer string contains digits, each representing a value from 0 to n-1. The values 0--9 can be represented " +"by any Unicode decimal digit. The values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The " +"default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16 strings can be optionally prefixed with " +"``0b``/``0B``, ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. For base 0, the string is " +"interpreted in a similar way to an :ref:`integer literal in code `, in that the actual base is 2, 8, 10, " +"or 16 as determined by the prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, while " +"``int('010')`` and ``int('010', 8)`` are." +msgstr "" +"یک رشته‌ی عدد صحیح در مبنای n شامل رقم‌هایی است که هر یک مقداری بین 0 تا n-1 را نمایش می‌دهند. مقادیر 0 تا 9 را می‌توان " +"با هر رقم ده‌دهی یونیکد نمایش داد. مقادیر 10 تا 35 را می‌توان با نویسه‌های ``a`` تا ``z`` (یا ``A`` تا ``Z``) نمایش " +"داد. مقدار پیش‌فرض *base* برابر 10 است. مبناهای مجاز عبارت‌اند از 0 و 2 تا 36. رشته‌های مبنای 2، 8 و 16 می‌توانند، " +"همانند ثابت‌های عدد صحیح در کد، به‌ترتیب با پیشوندهای ``0b``/``0B``، ``0o``/``0O`` یا ``0x``/``0X`` آغاز شوند. برای " +"مبنای 0، رشته مشابه یک :ref:`ثابت عدد صحیح در کد ` تفسیر می‌شود؛ یعنی مبنای واقعی بر اساس پیشوند، یکی از 2، " +"8، 10 یا 16 خواهد بود. همچنین در مبنای 0 استفاده از صفرهای ابتدایی مجاز نیست؛ بنابراین ``int('010', 0)`` معتبر نیست، " +"در حالی که ``int('010')`` و ``int('010', 8)`` معتبر هستند." msgid "The integer type is described in :ref:`typesnumeric`." msgstr "نوع عدد صحیح (integer) در :ref:`typesnumeric` توضیح داده شده است." -msgid "If *base* is not an instance of :class:`int` and the *base* object has a :meth:`base.__index__ ` method, that method is called to obtain an integer for the base. Previous versions used :meth:`base.__int__ ` instead of :meth:`base.__index__ `." -msgstr "اگر *base* نمونه‌ای از :class:`int` نباشد و شیء *base* متد :meth:`base.__index__ ` را تعریف کرده باشد، آن متد برای به‌دست آوردن یک عدد صحیح به‌عنوان مبنا فراخوانی می‌شود. در نسخه‌های پیشین، به‌جای :meth:`base.__index__ ` از :meth:`base.__int__ ` استفاده می‌شد." +msgid "" +"If *base* is not an instance of :class:`int` and the *base* object has a :meth:`base.__index__ ` " +"method, that method is called to obtain an integer for the base. Previous versions used :meth:`base.__int__ " +"` instead of :meth:`base.__index__ `." +msgstr "" +"اگر *base* نمونه‌ای از :class:`int` نباشد و شیء *base* متد :meth:`base.__index__ ` را تعریف کرده " +"باشد، آن متد برای به‌دست آوردن یک عدد صحیح به‌عنوان مبنا فراخوانی می‌شود. در نسخه‌های پیشین، به‌جای :meth:`base.__index__ " +"` از :meth:`base.__int__ ` استفاده می‌شد." msgid "The first parameter is now positional-only." msgstr "پارامتر اول اکنون فقط به‌صورت فقط‌جایگاهی قابل ارسال است." msgid "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not defined." -msgstr "اگر :meth:`~object.__int__` تعریف نشده باشد، به :meth:`~object.__index__` بازمی‌گردد." +msgstr "" +"اگر :meth:`~object.__int__ <~object.__index__>` تعریف نشده باشد، به :meth:`~object.__index__ <~object.__int__>` " +"بازمی‌گردد." -msgid ":class:`int` string inputs and string representations can be limited to help avoid denial of service attacks. A :exc:`ValueError` is raised when the limit is exceeded while converting a string to an :class:`int` or when converting an :class:`int` into a string would exceed the limit. See the :ref:`integer string conversion length limitation ` documentation." -msgstr "ورودی‌های رشته‌ای :class:`int` و نمایش‌های رشته‌ای آن را می‌توان برای کمک به جلوگیری از حملات منع سرویس (Denial of Service) محدود کرد. اگر هنگام تبدیل یک رشته به :class:`int` از این محدودیت فراتر رود، یا تبدیل یک :class:`int` به رشته باعث عبور از این محدودیت شود، استثنای :exc:`ValueError` پرتاب می‌شود. برای اطلاعات بیشتر، مستندات :ref:`محدودیت طول تبدیل رشته‌ای اعداد صحیح ` را ببینید." +msgid "" +":class:`int` string inputs and string representations can be limited to help avoid denial of service attacks. " +"A :exc:`ValueError` is raised when the limit is exceeded while converting a string to an :class:`int` or when " +"converting an :class:`int` into a string would exceed the limit. See the :ref:`integer string conversion length " +"limitation ` documentation." +msgstr "" +"ورودی‌های رشته‌ای :class:`int` و نمایش‌های رشته‌ای آن را می‌توان برای کمک به جلوگیری از حملات منع سرویس (Denial of " +"Service) محدود کرد. اگر هنگام تبدیل یک رشته به :class:`int` از این محدودیت فراتر رود، یا تبدیل یک :class:`int` به " +"رشته باعث عبور از این محدودیت شود، استثنای :exc:`ValueError` پرتاب می‌شود. برای اطلاعات بیشتر، مستندات :ref:`محدودیت " +"طول تبدیل رشته‌ای اعداد صحیح ` را ببینید." msgid ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr ":func:`int` دیگر فراخوانی را به متد :meth:`~object.__trunc__` واگذار نمی‌کند." -msgid "Return ``True`` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, the function always returns ``False``. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a :ref:`types-union` of multiple types, return ``True`` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a :exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for an invalid type if an earlier check succeeds." -msgstr "اگر آرگومان *object* نمونه‌ای از *classinfo* یا از یکی از زیرکلاس‌های آن (مستقیم، غیرمستقیم یا :term:`مجازی `) باشد، مقدار ``True`` را برمی‌گرداند. اگر *object* از نوع داده‌شده نباشد، این تابع همیشه ``False`` برمی‌گرداند. اگر *classinfo* یک تاپل از نوع‌ها (یا به‌صورت بازگشتی، تاپل‌هایی از این نوع) یا یک :ref:`types-union` از چندین نوع باشد، در صورتی که *object* نمونه‌ای از هر یک از آن نوع‌ها باشد، مقدار ``True`` برگردانده می‌شود. اگر *classinfo* یک نوع، یا تاپلی از نوع‌ها و تاپل‌های مشابه نباشد، استثنای :exc:`TypeError` پرتاب می‌شود. با این حال، اگر یک بررسیِ زودتر با موفقیت انجام شود، ممکن است برای یک نوع نامعتبر استثنای :exc:`TypeError` پرتاب نشود." +msgid "" +"Return ``True`` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, " +"or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, the " +"function always returns ``False``. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or " +"a :ref:`types-union` of multiple types, return ``True`` if *object* is an instance of any of the types. If " +"*classinfo* is not a type or tuple of types and such tuples, a :exc:`TypeError` exception is " +"raised. :exc:`TypeError` may not be raised for an invalid type if an earlier check succeeds." +msgstr "" +"اگر آرگومان *object* نمونه‌ای از *classinfo* یا از یکی از زیرکلاس‌های آن (مستقیم، غیرمستقیم یا :term:`مجازی `) باشد، مقدار ``True`` را برمی‌گرداند. اگر *object* از نوع داده‌شده نباشد، این تابع همیشه ``False`` " +"برمی‌گرداند. اگر *classinfo* یک تاپل از نوع‌ها (یا به‌صورت بازگشتی، تاپل‌هایی از این نوع) یا یک :ref:`types-union` از " +"چندین نوع باشد، در صورتی که *object* نمونه‌ای از هر یک از آن نوع‌ها باشد، مقدار ``True`` برگردانده می‌شود. اگر " +"*classinfo* یک نوع، یا تاپلی از نوع‌ها و تاپل‌های مشابه نباشد، استثنای :exc:`TypeError` پرتاب می‌شود. با این حال، اگر " +"یک بررسیِ زودتر با موفقیت انجام شود، ممکن است برای یک نوع نامعتبر استثنای :exc:`TypeError` پرتاب نشود." msgid "*classinfo* can be a :ref:`types-union`." msgstr "*classinfo* می‌تواند یک :ref:`types-union` باشد." -msgid "Return ``True`` if *class* is a subclass (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a subclass of itself. *classinfo* may be a tuple of class objects (or recursively, other such tuples) or a :ref:`types-union`, in which case return ``True`` if *class* is a subclass of any entry in *classinfo*. In any other case, a :exc:`TypeError` exception is raised." -msgstr "اگر *class* زیرکلاس (مستقیم، غیرمستقیم یا :term:`مجازی `) *classinfo* باشد، مقدار ``True`` را برمی‌گرداند. هر کلاس، زیرکلاس خودش نیز در نظر گرفته می‌شود. *classinfo* می‌تواند یک تاپل از اشیای کلاس (یا به‌صورت بازگشتی، تاپل‌هایی از این نوع) یا یک :ref:`types-union` باشد؛ در این صورت، اگر *class* زیرکلاس هر یک از اعضای *classinfo* باشد، مقدار ``True`` برگردانده می‌شود. در هر حالت دیگر، استثنای :exc:`TypeError` پرتاب می‌شود." +msgid "" +"Return ``True`` if *class* is a subclass (direct, indirect, or :term:`virtual `) of " +"*classinfo*. A class is considered a subclass of itself. *classinfo* may be a tuple of class objects (or " +"recursively, other such tuples) or a :ref:`types-union`, in which case return ``True`` if *class* is a subclass of " +"any entry in *classinfo*. In any other case, a :exc:`TypeError` exception is raised." +msgstr "" +"اگر *class* زیرکلاس (مستقیم، غیرمستقیم یا :term:`مجازی `) *classinfo* باشد، مقدار ``True`` را " +"برمی‌گرداند. هر کلاس، زیرکلاس خودش نیز در نظر گرفته می‌شود. *classinfo* می‌تواند یک تاپل از اشیای کلاس (یا به‌صورت " +"بازگشتی، تاپل‌هایی از این نوع) یا یک :ref:`types-union` باشد؛ در این صورت، اگر *class* زیرکلاس هر یک از اعضای " +"*classinfo* باشد، مقدار ``True`` برگردانده می‌شود. در هر حالت دیگر، استثنای :exc:`TypeError` پرتاب می‌شود." -msgid "Return an :term:`iterator` object. The first argument is interpreted very differently depending on the presence of the second argument. Without a second argument, the single argument must be a collection object which supports the :term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must support the sequence protocol (the :meth:`~object.__getitem__` method with integer arguments starting at ``0``). If it does not support either of those protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, is given, then the first argument must be a callable object. The iterator created in this case will call *callable* with no arguments for each call to its :meth:`~iterator.__next__` method; if the value returned is equal to *sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be returned." -msgstr "یک شیء :term:`تکرارگر ` را برمی‌گرداند. تفسیر آرگومان اول به وجود یا عدم وجود آرگومان دوم بستگی دارد. اگر آرگومان دومی وجود نداشته باشد، آرگومان اول باید یک شیء مجموعه باشد که از پروتکل :term:`تکرارپذیر ` (متد :meth:`~object.__iter__`) پشتیبانی کند، یا از پروتکل دنباله (متد :meth:`~object.__getitem__` با آرگومان‌های صحیح که از ``0`` شروع می‌شوند) پشتیبانی کند. اگر از هیچ‌یک از این پروتکل‌ها پشتیبانی نکند، استثنای :exc:`TypeError` پرتاب می‌شود. اگر آرگومان دوم، یعنی *sentinel*، ارائه شود، آرگومان اول باید یک شیء فراخوانی‌پذیر باشد. تکرارگر ایجادشده در این حالت، در هر فراخوانی متد :meth:`~iterator.__next__`، *callable* را بدون آرگومان فراخوانی می‌کند؛ اگر مقدار بازگردانده‌شده برابر *sentinel* باشد، استثنای :exc:`StopIteration` پرتاب می‌شود؛ در غیر این صورت، همان مقدار برگردانده می‌شود." +msgid "" +"Return an :term:`iterator` object. The first argument is interpreted very differently depending on the presence of " +"the second argument. Without a second argument, the single argument must be a collection object which supports " +"the :term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must support the sequence protocol " +"(the :meth:`~object.__getitem__` method with integer arguments starting at ``0``). If it does not support either of " +"those protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, is given, then the first argument " +"must be a callable object. The iterator created in this case will call *callable* with no arguments for each call " +"to its :meth:`~iterator.__next__` method; if the value returned is equal to *sentinel*, :exc:`StopIteration` will be " +"raised, otherwise the value will be returned." +msgstr "" +"یک شیء :term:`پیمایش‌گر ` را برمی‌گرداند. تفسیر آرگومان اول به وجود یا عدم وجود آرگومان دوم بستگی دارد. اگر " +"آرگومان دومی وجود نداشته باشد، آرگومان اول باید یک شیء مجموعه باشد که از پروتکل :term:`پیمایش‌پذیر ` " +"(متد :meth:`~object.__iter__`) پشتیبانی کند، یا از پروتکل دنباله (متد :meth:`~object.__getitem__` با آرگومان‌های صحیح " +"که از ``0`` شروع می‌شوند) پشتیبانی کند. اگر از هیچ‌یک از این پروتکل‌ها پشتیبانی نکند، استثنای :exc:`TypeError` پرتاب " +"می‌شود. اگر آرگومان دوم، یعنی *sentinel*، ارائه شود، آرگومان اول باید یک شیء فراخوانی‌پذیر باشد. پیمایش‌گر ایجادشده در " +"این حالت، در هر فراخوانی متد :meth:`~iterator.__next__`، *callable* را بدون آرگومان فراخوانی می‌کند؛ اگر مقدار " +"بازگردانده‌شده برابر *sentinel* باشد، استثنای :exc:`StopIteration` پرتاب می‌شود؛ در غیر این صورت، همان مقدار برگردانده " +"می‌شود." msgid "See also :ref:`typeiter`." msgstr "همچنین به :ref:`typeiter` مراجعه کنید." -msgid "One useful application of the second form of :func:`iter` is to build a block-reader. For example, reading fixed-width blocks from a binary database file until the end of file is reached::" -msgstr "یکی از کاربردهای مفید شکل دوم :func:`iter`، ساختن یک خوانندهٔ بلوکی (block reader) است. برای مثال، خواندن بلوک‌هایی با اندازهٔ ثابت از یک پروندهٔ پایگاه دادهٔ دودویی تا رسیدن به انتهای پرونده::" +msgid "" +"One useful application of the second form of :func:`iter` is to build a block-reader. For example, reading fixed-" +"width blocks from a binary database file until the end of file is reached::" +msgstr "" +"یکی از کاربردهای مفید شکل دوم :func:`iter`، ساختن یک خواننده‌ی بلوکی (block reader) است. برای مثال، خواندن بلوک‌هایی " +"با اندازه‌ی ثابت از یک پرونده‌ی پایگاه داده‌ی دودویی تا رسیدن به انتهای پرونده::" msgid "" "from functools import partial\n" @@ -954,110 +1576,255 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -msgid "Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set)." -msgstr "طول یک شیء (تعداد عناصر آن) را برمی‌گرداند. آرگومان می‌تواند یک دنباله (مانند رشته، bytes، تاپل، فهرست یا range) یا یک مجموعه (مانند دیکشنری، set یا frozenset) باشد." +msgid "" +"Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, " +"tuple, list, or range) or a collection (such as a dictionary, set, or frozen set)." +msgstr "" +"طول یک شیء (تعداد عناصر آن) را برمی‌گرداند. آرگومان می‌تواند یک دنباله (مانند رشته، bytes، تاپل، فهرست یا range) یا یک " +"مجموعه (مانند دیکشنری، set یا frozenset) باشد." -msgid "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys.maxsize`, such as :class:`range(2 ** 100) `." -msgstr "``len`` برای طول‌هایی بزرگ‌تر از :data:`sys.maxsize`، مانند :class:`range(2 ** 100) `، استثنای :exc:`OverflowError` پرتاب می‌کند." +msgid "" +"``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys.maxsize`, such as :class:`range(2 ** 100) " +"`." +msgstr "" +"``len`` برای طول‌هایی بزرگ‌تر از :data:`sys.maxsize`، مانند :class:`range(2 ** 100) `، " +"استثنای :exc:`OverflowError` پرتاب می‌کند." -msgid "Rather than being a function, :class:`list` is actually a mutable sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." -msgstr ":class:`list` در واقع یک نوع دنبالهٔ تغییرپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-list` و :ref:`typesseq` مستند شده است." +msgid "" +"Rather than being a function, :class:`list` is actually a mutable sequence type, as documented in :ref:`typesseq-" +"list` and :ref:`typesseq`." +msgstr "" +":class:`list` در واقع یک نوع دنباله‌ی تغییرپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-list` " +"و :ref:`typesseq` مستند شده است." -msgid "Return a mapping object representing the current local symbol table, with variable names as the keys, and their currently bound references as the values." -msgstr "یک شیء نگاشتی را برمی‌گرداند که جدول نمادهای محلی فعلی را نمایش می‌دهد؛ در آن، نام متغیرها کلیدها و ارجاع‌های فعلی آن‌ها مقادیر هستند." +msgid "" +"Return a mapping object representing the current local symbol table, with variable names as the keys, and their " +"currently bound references as the values." +msgstr "" +"یک شیء نگاشتی را برمی‌گرداند که جدول نمادهای محلی فعلی را نمایش می‌دهد؛ در آن، نام متغیرها کلیدها و ارجاع‌های فعلی آن‌ها " +"مقادیر هستند." -msgid "At module scope, as well as when using :func:`exec` or :func:`eval` with a single namespace, this function returns the same namespace as :func:`globals`." -msgstr "در محدوده‌ی ماژول، و همچنین هنگام استفاده از :func:`exec` یا :func:`eval` با یک فضای نام واحد، این تابع همان فضای نامی را برمی‌گرداند که :func:`globals` برمی‌گرداند." +msgid "" +"At module scope, as well as when using :func:`exec` or :func:`eval` with a single namespace, this function returns " +"the same namespace as :func:`globals`." +msgstr "" +"در محدوده‌ی ماژول، و همچنین هنگام استفاده از :func:`exec` یا :func:`eval` با یک فضای نام واحد، این تابع همان فضای " +"نامی را برمی‌گرداند که :func:`globals` برمی‌گرداند." msgid "At class scope, it returns the namespace that will be passed to the metaclass constructor." -msgstr "در محدوده‌ی کلاس، این تابع فضای نامی را برمی‌گرداند که به سازندهٔ فراداده ارسال خواهد شد." +msgstr "در محدوده‌ی کلاس، این تابع فضای نامی را برمی‌گرداند که به سازنده‌ی فراداده ارسال خواهد شد." -msgid "When using ``exec()`` or ``eval()`` with separate local and global arguments, it returns the local namespace passed in to the function call." -msgstr "هنگام استفاده از ``exec()`` یا ``eval()`` با آرگومان‌های محلی و سراسریِ جداگانه، این تابع فضای نام محلیِ ارسال‌شده به فراخوانی تابع را بازمی‌گرداند." +msgid "" +"When using ``exec()`` or ``eval()`` with separate local and global arguments, it returns the local namespace passed " +"in to the function call." +msgstr "" +"هنگام استفاده از ``exec()`` یا ``eval()`` با آرگومان‌های محلی و سراسریِ جداگانه، این تابع فضای نام محلیِ ارسال‌شده به " +"فراخوانی تابع را بازمی‌گرداند." -msgid "In all of the above cases, each call to ``locals()`` in a given frame of execution will return the *same* mapping object. Changes made through the mapping object returned from ``locals()`` will be visible as assigned, reassigned, or deleted local variables, and assigning, reassigning, or deleting local variables will immediately affect the contents of the returned mapping object." -msgstr "در همهٔ حالت‌های بالا، هر فراخوانی ``locals()`` در یک قاب (frame) مشخص از اجرا، *همان* شیء نگاشتی را برمی‌گرداند. تغییراتی که از طریق شیء نگاشتیِ بازگردانده‌شده توسط ``locals()`` اعمال شوند، به‌صورت انتساب، انتساب مجدد یا حذف متغیرهای محلی قابل مشاهده خواهند بود، و انتساب، انتساب مجدد یا حذف متغیرهای محلی نیز بلافاصله محتوای شیء نگاشتیِ بازگردانده‌شده را تغییر می‌دهد." +msgid "" +"In all of the above cases, each call to ``locals()`` in a given frame of execution will return the *same* mapping " +"object. Changes made through the mapping object returned from ``locals()`` will be visible as assigned, reassigned, " +"or deleted local variables, and assigning, reassigning, or deleting local variables will immediately affect the " +"contents of the returned mapping object." +msgstr "" +"در همه‌ی حالت‌های بالا، هر فراخوانی ``locals()`` در یک فریممشخص از اجرا، *همان* شیء نگاشتی را برمی‌گرداند. تغییراتی که " +"از طریق شیء نگاشتیِ بازگردانده‌شده توسط ``locals()`` اعمال شوند، به‌صورت انتساب، انتساب مجدد یا حذف متغیرهای محلی قابل " +"مشاهده خواهند بود، و انتساب، انتساب مجدد یا حذف متغیرهای محلی نیز بلافاصله محتوای شیء نگاشتیِ بازگردانده‌شده را تغییر " +"می‌دهد." -msgid "In an :term:`optimized scope` (including functions, generators, and coroutines), each call to ``locals()`` instead returns a fresh dictionary containing the current bindings of the function's local variables and any nonlocal cell references. In this case, name binding changes made via the returned dict are *not* written back to the corresponding local variables or nonlocal cell references, and assigning, reassigning, or deleting local variables and nonlocal cell references does *not* affect the contents of previously returned dictionaries." -msgstr "در یک :term:`محدوده‌ی بهینه‌شده ` (از جمله توابع، تولیدگرها و هم‌روال‌ها)، هر فراخوانی ``locals()`` یک دیکشنری جدید برمی‌گرداند که شامل انتساب‌های فعلی متغیرهای محلی تابع و هرگونه ارجاع به سلول‌های غیرمحلی است. در این حالت، تغییرات انتساب نام که از طریق دیکشنری بازگردانده‌شده انجام شوند، به متغیرهای محلی یا ارجاع‌های سلول‌های غیرمحلی متناظر بازنویسی *نمی‌شوند*، و انتساب، انتساب مجدد یا حذف متغیرهای محلی و ارجاع‌های سلول‌های غیرمحلی نیز بر محتوای دیکشنری‌های بازگردانده‌شدهٔ قبلی تأثیری *ندارد*." +msgid "" +"In an :term:`optimized scope` (including functions, generators, and coroutines), each call to ``locals()`` instead " +"returns a fresh dictionary containing the current bindings of the function's local variables and any nonlocal cell " +"references. In this case, name binding changes made via the returned dict are *not* written back to the " +"corresponding local variables or nonlocal cell references, and assigning, reassigning, or deleting local variables " +"and nonlocal cell references does *not* affect the contents of previously returned dictionaries." +msgstr "" +"در یک :term:`محدوده‌ی بهینه‌شده ` (از جمله توابع، تولیدگرها و هم‌روال‌ها)، هر فراخوانی ``locals()`` یک " +"دیکشنری جدید برمی‌گرداند که شامل انتساب‌های فعلی متغیرهای محلی تابع و هرگونه ارجاع به سلول‌های غیرمحلی است. در این " +"حالت، تغییرات انتساب نام که از طریق دیکشنری بازگردانده‌شده انجام شوند، به متغیرهای محلی یا ارجاع‌های سلول‌های غیرمحلی " +"متناظر بازنویسی *نمی‌شوند*، و انتساب، انتساب مجدد یا حذف متغیرهای محلی و ارجاع‌های سلول‌های غیرمحلی نیز بر محتوای " +"دیکشنری‌های بازگردانده‌شده‌ی قبلی تأثیری *ندارد*." -msgid "Calling ``locals()`` as part of a comprehension in a function, generator, or coroutine is equivalent to calling it in the containing scope, except that the comprehension's initialised iteration variables will be included. In other scopes, it behaves as if the comprehension were running as a nested function." -msgstr "فراخوانی ``locals()`` درون یک comprehension در یک تابع، تولیدگر یا هم‌روال، معادل فراخوانی آن در محدوده‌ی دربرگیرنده است، با این تفاوت که متغیرهای پیمایشِ مقداردهی‌شدهٔ comprehension نیز در آن گنجانده می‌شوند. در سایر محدوده‌ها رفتار آن به‌گونه‌ای است که گویی comprehension به‌صورت یک تابع تو‌در‌تو اجرا می‌شود." +msgid "" +"Calling ``locals()`` as part of a comprehension in a function, generator, or coroutine is equivalent to calling it " +"in the containing scope, except that the comprehension's initialised iteration variables will be included. In other " +"scopes, it behaves as if the comprehension were running as a nested function." +msgstr "" +"فراخوانی ``locals()`` درون یک comprehension در یک تابع، تولیدگر یا هم‌روال، معادل فراخوانی آن در محدوده‌ی دربرگیرنده " +"است، با این تفاوت که متغیرهای پیمایشِ مقداردهی‌شده‌ی comprehension نیز در آن گنجانده می‌شوند. در سایر محدوده‌ها رفتار آن " +"به‌گونه‌ای است که گویی comprehension به‌صورت یک تابع تودرتو اجرا می‌شود." -msgid "Calling ``locals()`` as part of a generator expression is equivalent to calling it in a nested generator function." -msgstr "فراخوانی ``locals()`` درون یک عبارت تولیدگر معادل فراخوانی آن در یک تابع تولیدگر تو‌در‌تو است." +msgid "" +"Calling ``locals()`` as part of a generator expression is equivalent to calling it in a nested generator function." +msgstr "فراخوانی ``locals()`` درون یک عبارت تولیدگر معادل فراخوانی آن در یک تابع تولیدگر تودرتو است." msgid "The behaviour of ``locals()`` in a comprehension has been updated as described in :pep:`709`." msgstr "رفتار ``locals()`` در comprehensionها مطابق :pep:`709` به‌روزرسانی شده است." -msgid "As part of :pep:`667`, the semantics of mutating the mapping objects returned from this function are now defined. The behavior in :term:`optimized scopes ` is now as described above. Aside from being defined, the behaviour in other scopes remains unchanged from previous versions." -msgstr "به‌عنوان بخشی از :pep:`667`، اکنون معناشناسی تغییر دادن اشیای نگاشتی که این تابع برمی‌گرداند، تعریف شده است. رفتار این تابع در :term:`محدوده‌های بهینه‌شده ` اکنون همان‌گونه است که در بالا توضیح داده شد. به‌جز تعریف رسمی این رفتار، عملکرد آن در سایر محدوده‌ها نسبت به نسخه‌های پیشین تغییری نکرده است." +msgid "" +"As part of :pep:`667`, the semantics of mutating the mapping objects returned from this function are now defined. " +"The behavior in :term:`optimized scopes ` is now as described above. Aside from being defined, the " +"behaviour in other scopes remains unchanged from previous versions." +msgstr "" +"به‌عنوان بخشی از :pep:`667`، اکنون معناشناسی تغییر دادن اشیای نگاشتی که این تابع برمی‌گرداند، تعریف شده است. رفتار این " +"تابع در :term:`محدوده‌های بهینه‌شده ` اکنون همان‌گونه است که در بالا توضیح داده شد. به‌جز تعریف رسمی " +"این رفتار، عملکرد آن در سایر محدوده‌ها نسبت به نسخه‌های پیشین تغییری نکرده است." -msgid "Return an iterator that applies *function* to every item of *iterable*, yielding the results. If additional *iterables* arguments are passed, *function* must take that many arguments and is applied to the items from all iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. If *strict* is ``True`` and one of the iterables is exhausted before the others, a :exc:`ValueError` is raised. For cases where the function inputs are already arranged into argument tuples, see :func:`itertools.starmap`." -msgstr "تکرارگری را برمی‌گرداند که *function* را روی هر عنصر *iterable* اعمال کرده و نتایج را تولید می‌کند. اگر آرگومان‌های *iterables* اضافی ارائه شوند، *function* باید به همان تعداد آرگومان بپذیرد و به‌طور هم‌زمان روی عناصر همهٔ تکرارپذیرها اعمال شود. در صورت وجود چند تکرارپذیر، تکرارگر زمانی متوقف می‌شود که کوتاه‌ترین تکرارپذیر به پایان برسد. اگر *strict* برابر ``True`` باشد و یکی از تکرارپذیرها زودتر از بقیه به پایان برسد، استثنای :exc:`ValueError` پرتاب می‌شود. در مواردی که ورودی‌های تابع از پیش به‌صورت تاپل‌های آرگومان مرتب شده‌اند، به :func:`itertools.starmap` مراجعه کنید." +msgid "" +"Return an iterator that applies *function* to every item of *iterable*, yielding the results. If additional " +"*iterables* arguments are passed, *function* must take that many arguments and is applied to the items from all " +"iterables in parallel. With multiple iterables, the iterator stops when the shortest iterable is exhausted. If " +"*strict* is ``True`` and one of the iterables is exhausted before the others, a :exc:`ValueError` is raised. For " +"cases where the function inputs are already arranged into argument tuples, see :func:`itertools.starmap`." +msgstr "" +"پیمایش‌گری را برمی‌گرداند که *function* را روی هر عنصر *iterable* اعمال کرده و نتایج را تولید می‌کند. اگر آرگومان‌های " +"*iterables* اضافی ارائه شوند، *function* باید به همان تعداد آرگومان بپذیرد و به‌طور همزمان روی عناصر همه‌ی " +"پیمایش‌پذیرها اعمال شود. در صورت وجود چند پیمایش‌پذیر، پیمایش‌گر زمانی متوقف می‌شود که کوتاه‌ترین پیمایش‌پذیر به پایان " +"برسد. اگر *strict* برابر ``True`` باشد و یکی از پیمایش‌پذیرها زودتر از بقیه به پایان برسد، استثنای :exc:`ValueError` " +"پرتاب می‌شود. در مواردی که ورودی‌های تابع از پیش به‌صورت تاپل‌های آرگومان مرتب شده‌اند، به :func:`itertools.starmap` " +"مراجعه کنید." msgid "Added the *strict* parameter." msgstr "پارامتر *strict* اضافه شد." msgid "Return the largest item in an iterable or the largest of two or more arguments." -msgstr "بزرگ‌ترین عنصر یک تکرارپذیر، یا بزرگ‌ترین مقدار از میان دو یا چند آرگومان را برمی‌گرداند." +msgstr "بزرگ‌ترین عنصر یک پیمایش‌پذیر، یا بزرگ‌ترین مقدار از میان دو یا چند آرگومان را برمی‌گرداند." -msgid "If one positional argument is provided, it should be an :term:`iterable`. The largest item in the iterable is returned. If two or more positional arguments are provided, the largest of the positional arguments is returned." -msgstr "اگر یک آرگومان مکانی ارائه شود، باید یک :term:`تکرارپذیر ` باشد. در این صورت، بزرگ‌ترین عنصر آن تکرارپذیر برگردانده می‌شود. اگر دو یا چند آرگومان مکانی ارائه شوند، بزرگ‌ترین آرگومان مکانی برگردانده می‌شود." +msgid "" +"If one positional argument is provided, it should be an :term:`iterable`. The largest item in the iterable is " +"returned. If two or more positional arguments are provided, the largest of the positional arguments is returned." +msgstr "" +"اگر یک آرگومان جایگاهی ارائه شود، باید یک :term:`پیمایش‌پذیر ` باشد. در این صورت، بزرگ‌ترین عنصر آن " +"پیمایش‌پذیر برگردانده می‌شود. اگر دو یا چند آرگومان جایگاهی ارائه شوند، بزرگ‌ترین آرگومان جایگاهی برگردانده می‌شود." -msgid "There are two optional keyword-only arguments. The *key* argument specifies a one-argument ordering function like that used for :meth:`list.sort`. The *default* argument specifies an object to return if the provided iterable is empty. If the iterable is empty and *default* is not provided, a :exc:`ValueError` is raised." -msgstr "دو آرگومان اختیاریِ فقط-کلیدواژه‌ای (keyword-only) وجود دارد. آرگومان *key* یک تابع مرتب‌سازی تک‌آرگومانی، مشابه آنچه در :meth:`list.sort` استفاده می‌شود، مشخص می‌کند. آرگومان *default* شی‌ءای را مشخص می‌کند که در صورت خالی بودن تکرارپذیر بازگردانده شود. اگر تکرارپذیر خالی باشد و *default* ارائه نشده باشد، استثنای :exc:`ValueError` پرتاب می‌شود." +msgid "" +"There are two optional keyword-only arguments. The *key* argument specifies a one-argument ordering function like " +"that used for :meth:`list.sort`. The *default* argument specifies an object to return if the provided iterable is " +"empty. If the iterable is empty and *default* is not provided, a :exc:`ValueError` is raised." +msgstr "" +"دو آرگومان اختیاریِ فقط-کلیدواژه‌ای (keyword-only) وجود دارد. آرگومان *key* یک تابع مرتب‌سازی تک‌آرگومانی، مشابه آنچه " +"در :meth:`list.sort` استفاده می‌شود، مشخص می‌کند. آرگومان *default* شی‌ءای را مشخص می‌کند که در صورت خالی بودن " +"پیمایش‌پذیر بازگردانده شود. اگر پیمایش‌پذیر خالی باشد و *default* ارائه نشده باشد، استثنای :exc:`ValueError` پرتاب " +"می‌شود." -msgid "If multiple items are maximal, the function returns the first one encountered. This is consistent with other sort-stability preserving tools such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and ``heapq.nlargest(1, iterable, key=keyfunc)``." -msgstr "اگر چندین عنصر دارای بیشترین مقدار باشند، تابع نخستین موردی را که با آن برخورد کند برمی‌گرداند. این رفتار با سایر ابزارهایی که پایداری مرتب‌سازی را حفظ می‌کنند، مانند ``sorted(iterable, key=keyfunc, reverse=True)[0]`` و ``heapq.nlargest(1, iterable, key=keyfunc)``، سازگار است." +msgid "" +"If multiple items are maximal, the function returns the first one encountered. This is consistent with other sort-" +"stability preserving tools such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and ``heapq.nlargest(1, " +"iterable, key=keyfunc)``." +msgstr "" +"اگر چندین عنصر دارای بیشترین مقدار باشند، تابع نخستین موردی را که با آن برخورد کند برمی‌گرداند. این رفتار با سایر " +"ابزارهایی که پایداری مرتب‌سازی را حفظ می‌کنند، مانند ``sorted(iterable, key=keyfunc, reverse=True)[0]`` و " +"``heapq.nlargest(1, iterable, key=keyfunc)``، سازگار است." msgid "Added the *default* keyword-only parameter." -msgstr "پارامتر فقط-کلیدواژهٔ *default* اضافه شد." +msgstr "پارامتر فقط-کلیدواژه‌ی *default* اضافه شد." msgid "The *key* can be ``None``." msgstr "*key* می‌تواند ``None`` باشد." -msgid "Return a \"memory view\" object created from the given argument. See :ref:`typememoryview` for more information." -msgstr "یک شیء «memory view» ایجادشده از آرگومان داده‌شده را برمی‌گرداند. برای اطلاعات بیشتر، به :ref:`typememoryview` مراجعه کنید." +msgid "" +"Return a \"memory view\" object created from the given argument. See :ref:`typememoryview` for more information." +msgstr "" +"یک شیء «memory view» ایجادشده از آرگومان داده‌شده را برمی‌گرداند. برای اطلاعات بیشتر، به :ref:`typememoryview` مراجعه " +"کنید." msgid "Return the smallest item in an iterable or the smallest of two or more arguments." -msgstr "کوچک‌ترین عنصر یک تکرارپذیر، یا کوچک‌ترین مقدار از میان دو یا چند آرگومان را برمی‌گرداند." +msgstr "کوچک‌ترین عنصر یک پیمایش‌پذیر، یا کوچک‌ترین مقدار از میان دو یا چند آرگومان را برمی‌گرداند." -msgid "If one positional argument is provided, it should be an :term:`iterable`. The smallest item in the iterable is returned. If two or more positional arguments are provided, the smallest of the positional arguments is returned." -msgstr "اگر یک آرگومان مکانی ارائه شود، باید یک :term:`تکرارپذیر ` باشد. در این صورت، کوچک‌ترین عنصر آن تکرارپذیر برگردانده می‌شود. اگر دو یا چند آرگومان مکانی ارائه شوند، کوچک‌ترین آرگومان مکانی برگردانده می‌شود." +msgid "" +"If one positional argument is provided, it should be an :term:`iterable`. The smallest item in the iterable is " +"returned. If two or more positional arguments are provided, the smallest of the positional arguments is returned." +msgstr "" +"اگر یک آرگومان جایگاهی ارائه شود، باید یک :term:`پیمایش‌پذیر ` باشد. در این صورت، کوچک‌ترین عنصر آن " +"پیمایش‌پذیر برگردانده می‌شود. اگر دو یا چند آرگومان جایگاهی ارائه شوند، کوچک‌ترین آرگومان جایگاهی برگردانده می‌شود." -msgid "If multiple items are minimal, the function returns the first one encountered. This is consistent with other sort-stability preserving tools such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, iterable, key=keyfunc)``." -msgstr "اگر چندین عنصر دارای کمترین مقدار باشند، تابع نخستین موردی را که با آن برخورد کند برمی‌گرداند. این رفتار با سایر ابزارهایی که پایداری مرتب‌سازی را حفظ می‌کنند، مانند ``sorted(iterable, key=keyfunc)[0]`` و ``heapq.nsmallest(1, iterable, key=keyfunc)``، سازگار است." +msgid "" +"If multiple items are minimal, the function returns the first one encountered. This is consistent with other sort-" +"stability preserving tools such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1, iterable, " +"key=keyfunc)``." +msgstr "" +"اگر چندین عنصر دارای کمترین مقدار باشند، تابع نخستین موردی را که با آن برخورد کند برمی‌گرداند. این رفتار با سایر " +"ابزارهایی که پایداری مرتب‌سازی را حفظ می‌کنند، مانند ``sorted(iterable, key=keyfunc)[0]`` و ``heapq.nsmallest(1, " +"iterable, key=keyfunc)``، سازگار است." -msgid "Retrieve the next item from the :term:`iterator` by calling its :meth:`~iterator.__next__` method. If *default* is given, it is returned if the iterator is exhausted, otherwise :exc:`StopIteration` is raised." -msgstr "با فراخوانی متد :meth:`~iterator.__next__`، عنصر بعدی را از :term:`تکرارگر ` دریافت می‌کند. اگر *default* مشخص شده باشد، در صورت پایان یافتن تکرارگر همان مقدار برگردانده می‌شود؛ در غیر این صورت، استثنای :exc:`StopIteration` پرتاب می‌شود." +msgid "" +"Retrieve the next item from the :term:`iterator` by calling its :meth:`~iterator.__next__` method. If *default* is " +"given, it is returned if the iterator is exhausted, otherwise :exc:`StopIteration` is raised." +msgstr "" +"با فراخوانی متد :meth:`~iterator.__next__`، عنصر بعدی را از :term:`پیمایش‌گر ` دریافت می‌کند. اگر *default* " +"مشخص شده باشد، در صورت پایان یافتن پیمایش‌گر همان مقدار برگردانده می‌شود؛ در غیر این صورت، " +"استثنای :exc:`StopIteration` پرتاب می‌شود." -msgid "This is the ultimate base class of all other classes. It has methods that are common to all instances of Python classes. When the constructor is called, it returns a new featureless object. The constructor does not accept any arguments." -msgstr "این، کلاس پایهٔ نهایی همهٔ کلاس‌های دیگر است. این کلاس متدهایی را در اختیار دارد که میان تمام نمونه‌های کلاس‌های پایتون مشترک هستند. هنگام فراخوانی سازندهٔ آن، یک شیء جدید و بدون ویژگی ایجاد می‌شود. این سازنده هیچ آرگومانی را نمی‌پذیرد." +msgid "" +"This is the ultimate base class of all other classes. It has methods that are common to all instances of Python " +"classes. When the constructor is called, it returns a new featureless object. The constructor does not accept any " +"arguments." +msgstr "" +"این، کلاس پایه‌ی نهایی همه‌ی کلاس‌های دیگر است. این کلاس متدهایی را در اختیار دارد که میان تمام نمونه‌های کلاس‌های پایتون " +"مشترک هستند. هنگام فراخوانی سازنده‌ی آن، یک شیء جدید و بدون ویژگی ایجاد می‌شود. این سازنده هیچ آرگومانی را نمی‌پذیرد." -msgid ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, so you can't assign arbitrary attributes to an instance of :class:`object`." -msgstr "نمونه‌های :class:`object` دارای ویژگی :attr:`~object.__dict__` *نیستند*؛ بنابراین نمی‌توانید ویژگی‌های دلخواهی را به یک نمونه از :class:`object` اختصاص دهید." +msgid "" +":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, so you can't assign arbitrary " +"attributes to an instance of :class:`object`." +msgstr "" +"نمونه‌های :class:`object` دارای ویژگی :attr:`~object.__dict__` *نیستند*؛ بنابراین نمی‌توانید ویژگی‌های دلخواهی را به یک " +"نمونه از :class:`object` اختصاص دهید." -msgid "Convert an integer number to an octal string prefixed with \"0o\". The result is a valid Python expression. If *integer* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an integer. For example:" -msgstr "یک عدد صحیح را به یک رشتهٔ هشت‌هشتی با پیشوند «0o» تبدیل کنید. نتیجه یک عبارت معتبر پایتون است. اگر *integer* یک شیء :class:`int` پایتون نباشد، باید متد :meth:`~object.__index__` را تعریف کند که یک عدد صحیح بازمی‌گرداند. برای مثال:" +msgid "" +"Convert an integer number to an octal string prefixed with \"0o\". The result is a valid Python expression. If " +"*integer* is not a Python :class:`int` object, it has to define an :meth:`~object.__index__` method that returns an " +"integer. For example:" +msgstr "" +"یک عدد صحیح را به یک رشته‌ی هشت‌هشتی با پیشوند «0o» تبدیل کنید. نتیجه یک عبارت معتبر پایتون است. اگر *integer* یک " +"شیء :class:`int` پایتون نباشد، باید متد :meth:`~object.__index__` را تعریف کند که یک عدد صحیح بازمی‌گرداند. برای مثال:" -msgid "If you want to convert an integer number to an octal string either with the prefix \"0o\" or not, you can use either of the following ways." -msgstr "اگر می‌خواهید یک عدد صحیح را به یک رشتهٔ هشت‌هشتی، با پیشوند «0o» یا بدون آن، تبدیل کنید، می‌توانید از هر یک از روش‌های زیر استفاده کنید." +msgid "" +"If you want to convert an integer number to an octal string either with the prefix \"0o\" or not, you can use either " +"of the following ways." +msgstr "" +"اگر می‌خواهید یک عدد صحیح را به یک رشته‌ی هشت‌هشتی، با پیشوند «0o» یا بدون آن، تبدیل کنید، می‌توانید از هر یک از روش‌های " +"زیر استفاده کنید." -msgid "Open *file* and return a corresponding :term:`file object`. If the file cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more examples of how to use this function." -msgstr "*file* را باز کرده و :term:`شیء پرونده ` متناظر با آن را برمی‌گرداند. اگر پرونده قابل باز شدن نباشد، استثنای :exc:`OSError` پرتاب می‌شود. برای مثال‌های بیشتر دربارهٔ نحوهٔ استفاده از این تابع، به :ref:`tut-files` مراجعه کنید." +msgid "" +"Open *file* and return a corresponding :term:`file object`. If the file cannot be opened, an :exc:`OSError` is " +"raised. See :ref:`tut-files` for more examples of how to use this function." +msgstr "" +"*file* را باز کرده و :term:`شیء پرونده ` متناظر با آن را برمی‌گرداند. اگر پرونده قابل باز شدن نباشد، " +"استثنای :exc:`OSError` پرتاب می‌شود. برای مثال‌های بیشتر درباره‌ی نحوه‌ی استفاده از این تابع، به :ref:`tut-files` مراجعه " +"کنید." -msgid "*file* is a :term:`path-like object` giving the pathname (absolute or relative to the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed unless *closefd* is set to ``False``.)" -msgstr "*file* یک :term:`شیء مسیرمانند ` است که مسیر پرونده (مطلق یا نسبی نسبت به پوشهٔ کاری فعلی) را برای باز شدن مشخص می‌کند، یا یک توصیفگر عددی پرونده مربوط به پرونده‌ای است که باید در یک شیء ورودی/خروجی بسته‌بندی شود. (اگر یک توصیفگر پرونده ارائه شود، هنگام بسته شدن شیء ورودی/خروجیِ بازگشتی نیز بسته خواهد شد، مگر اینکه *closefd* برابر ``False`` تنظیم شده باشد.)" +msgid "" +"*file* is a :term:`path-like object` giving the pathname (absolute or relative to the current working directory) of " +"the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it " +"is closed when the returned I/O object is closed unless *closefd* is set to ``False``.)" +msgstr "" +"*file* یک :term:`شیء مسیرمانند ` است که مسیر پرونده (مطلق یا نسبی نسبت به پوشه‌ی کاری فعلی) را برای " +"باز شدن مشخص می‌کند، یا یک توصیف‌گر عددی پرونده مربوط به پرونده‌ای است که باید در یک شیء ورودی/خروجی بسته‌بندی شود. (اگر " +"یک توصیف‌گر پرونده ارائه شود، هنگام بسته شدن شیء ورودی/خروجیِ بازگشتی نیز بسته خواهد شد، مگر اینکه *closefd* برابر " +"``False`` تنظیم شده باشد.)" -msgid "*mode* is an optional string that specifies the mode in which the file is opened. It defaults to ``'r'`` which means open for reading in text mode. Other common values are ``'w'`` for writing (truncating the file if it already exists), ``'x'`` for exclusive creation, and ``'a'`` for appending (which on *some* Unix systems, means that *all* writes append to the end of the file regardless of the current seek position). In text mode, if *encoding* is not specified the encoding used is platform-dependent: :func:`locale.getencoding` is called to get the current locale encoding. (For reading and writing raw bytes use binary mode and leave *encoding* unspecified.) The available modes are:" -msgstr "*mode* یک رشتهٔ اختیاری است که حالت باز شدن پرونده را مشخص می‌کند. مقدار پیش‌فرض آن ``'r'`` است که به معنای باز کردن پرونده برای خواندن در حالت متنی است. مقادیر رایج دیگر عبارت‌اند از ``'w'`` برای نوشتن (که اگر پرونده از قبل وجود داشته باشد، محتوای آن را حذف می‌کند)، ``'x'`` برای ایجاد انحصاری، و ``'a'`` برای افزودن به انتهای پرونده (که در *برخی* از سیستم‌های یونیکس به این معناست که *تمام* عملیات نوشتن، صرف‌نظر از موقعیت فعلی نشانگر، به انتهای پرونده افزوده می‌شوند). در حالت متنی، اگر *encoding* مشخص نشده باشد، کدگذاری مورد استفاده به سکو بستگی دارد؛ در این حالت، :func:`locale.getencoding` برای دریافت کدگذاری محلی (locale) فعلی فراخوانی می‌شود. (برای خواندن و نوشتن بایت‌های خام، از حالت دودویی استفاده کنید و *encoding* را مشخص نکنید.) حالت‌های موجود عبارت‌اند از:" +msgid "" +"*mode* is an optional string that specifies the mode in which the file is opened. It defaults to ``'r'`` which " +"means open for reading in text mode. Other common values are ``'w'`` for writing (truncating the file if it already " +"exists), ``'x'`` for exclusive creation, and ``'a'`` for appending (which on *some* Unix systems, means that *all* " +"writes append to the end of the file regardless of the current seek position). In text mode, if *encoding* is not " +"specified the encoding used is platform-dependent: :func:`locale.getencoding` is called to get the current locale " +"encoding. (For reading and writing raw bytes use binary mode and leave *encoding* unspecified.) The available modes " +"are:" +msgstr "" +"*mode* یک رشته‌ی اختیاری است که حالت باز شدن پرونده را مشخص می‌کند. مقدار پیش‌فرض آن ``'r'`` است که به معنای باز کردن " +"پرونده برای خواندن در حالت متنی است. مقادیر رایج دیگر عبارت‌اند از ``'w'`` برای نوشتن (که اگر پرونده از قبل وجود " +"داشته باشد، محتوای آن را حذف می‌کند)، ``'x'`` برای ایجاد انحصاری، و ``'a'`` برای افزودن به انتهای پرونده (که در " +"*برخی* از سیستم‌های یونیکس به این معناست که *تمام* عملیات نوشتن، صرف‌نظر از موقعیت فعلی نشانگر، به انتهای پرونده " +"افزوده می‌شوند). در حالت متنی، اگر *encoding* مشخص نشده باشد، کدگذاری مورد استفاده به سکو بستگی دارد؛ در این " +"حالت، :func:`locale.getencoding` برای دریافت کدگذاری locale (locale) فعلی فراخوانی می‌شود. (برای خواندن و نوشتن " +"بایت‌های خام، از حالت دودویی استفاده کنید و *encoding* را مشخص نکنید.) حالت‌های موجود عبارت‌اند از:" msgid "Character" msgstr "نویسه" msgid "Meaning" -msgstr "به معنی" +msgstr "معنی" msgid "``'r'``" msgstr "``'r'``" @@ -1101,71 +1868,186 @@ msgstr "``'+'``" msgid "open for updating (reading and writing)" msgstr "باز کردن برای به‌روزرسانی (خواندن و نوشتن)" -msgid "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and ``'r+b'`` open the file with no truncation." -msgstr "حالت پیش‌فرض ``'r'`` است (باز کردن پرونده برای خواندن متن، که معادل ``'rt'`` است). حالت‌های ``'w+'`` و ``'w+b'`` پرونده را باز کرده و محتوای آن را حذف می‌کنند. حالت‌های ``'r+'`` و ``'r+b'`` پرونده را بدون حذف محتوا باز می‌کنند." +msgid "" +"The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). Modes ``'w+'`` and ``'w+b'`` open and " +"truncate the file. Modes ``'r+'`` and ``'r+b'`` open the file with no truncation." +msgstr "" +"حالت پیش‌فرض ``'r'`` است (باز کردن پرونده برای خواندن متن، که معادل ``'rt'`` است). حالت‌های ``'w+'`` و ``'w+b'`` " +"پرونده را باز کرده و محتوای آن را حذف می‌کنند. حالت‌های ``'r+'`` و ``'r+b'`` پرونده را بدون حذف محتوا باز می‌کنند." -msgid "As mentioned in the :ref:`io-overview`, Python distinguishes between binary and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* argument) return contents as :class:`bytes` objects without any decoding. In text mode (the default, or when ``'t'`` is included in the *mode* argument), the contents of the file are returned as :class:`str`, the bytes having been first decoded using a platform-dependent encoding or using the specified *encoding* if given." -msgstr "همان‌طور که در :ref:`io-overview` اشاره شد، پایتون بین ورودی/خروجی دودویی و متنی تفاوت قائل می‌شود. پرونده‌هایی که در حالت دودویی باز می‌شوند (یعنی *mode* شامل ``'b'`` باشد)، محتوا را بدون هیچ کدگشایی به‌صورت اشیای :class:`bytes` برمی‌گردانند. در حالت متنی (حالت پیش‌فرض، یا زمانی که *mode* شامل ``'t'`` باشد)، محتوای پرونده به‌صورت :class:`str` برگردانده می‌شود؛ در این حالت، بایت‌ها ابتدا با استفاده از کدگذاری وابسته به سکو یا، در صورت مشخص شدن، با استفاده از *encoding* داده‌شده کدگشایی می‌شوند." +msgid "" +"As mentioned in the :ref:`io-overview`, Python distinguishes between binary and text I/O. Files opened in binary " +"mode (including ``'b'`` in the *mode* argument) return contents as :class:`bytes` objects without any decoding. In " +"text mode (the default, or when ``'t'`` is included in the *mode* argument), the contents of the file are returned " +"as :class:`str`, the bytes having been first decoded using a platform-dependent encoding or using the specified " +"*encoding* if given." +msgstr "" +"همان‌طور که در :ref:`io-overview` اشاره شد، پایتون بین ورودی/خروجی دودویی و متنی تفاوت قائل می‌شود. پرونده‌هایی که در " +"حالت دودویی باز می‌شوند (یعنی *mode* شامل ``'b'`` باشد)، محتوا را بدون هیچ کدگشایی به‌صورت اشیای :class:`bytes` " +"برمی‌گردانند. در حالت متنی (حالت پیش‌فرض، یا زمانی که *mode* شامل ``'t'`` باشد)، محتوای پرونده به‌صورت :class:`str` " +"برگردانده می‌شود؛ در این حالت، بایت‌ها ابتدا با استفاده از کدگذاری وابسته به سکو یا، در صورت مشخص شدن، با استفاده از " +"*encoding* داده‌شده کدگشایی می‌شوند." -msgid "Python doesn't depend on the underlying operating system's notion of text files; all the processing is done by Python itself, and is therefore platform-independent." -msgstr "پایتون به مفهوم پروندهٔ متنی در سیستم‌عامل زیربنایی وابسته نیست؛ تمام پردازش‌ها توسط خود پایتون انجام می‌شوند و بنابراین مستقل از سکو هستند." +msgid "" +"Python doesn't depend on the underlying operating system's notion of text files; all the processing is done by " +"Python itself, and is therefore platform-independent." +msgstr "" +"پایتون به مفهوم پرونده‌ی متنی در سیستم‌عامل زیربنایی وابسته نیست؛ تمام پردازش‌ها توسط خود پایتون انجام می‌شوند و " +"بنابراین مستقل از سکو هستند." -msgid "*buffering* is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable when writing in text mode), and an integer > 1 to indicate the size in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this way applies for binary buffered I/O, but ``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another buffering. To disable buffering in ``TextIOWrapper``, consider using the ``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is given, the default buffering policy works as follows:" -msgstr "آرگومان *buffering* یک عدد صحیح اختیاری است که برای تعیین سیاست بافرگذاری استفاده می‌شود. برای غیرفعال کردن بافرگذاری مقدار 0 را وارد کنید (که فقط در حالت دودویی مجاز است)، برای انتخاب بافرگذاری خطی مقدار 1 را وارد کنید (که فقط هنگام نوشتن در حالت متنی قابل استفاده است)، و یک عدد صحیح بزرگ‌تر از 1 را برای تعیین اندازهٔ یک بافر با اندازهٔ ثابت (بر حسب بایت) مشخص کنید. توجه داشته باشید که تعیین اندازهٔ بافر به این روش فقط برای ورودی/خروجی دودوییِ بافرشده اعمال می‌شود، اما ``TextIOWrapper`` (یعنی پرونده‌هایی که با ``mode='r+'`` باز می‌شوند) از بافرگذاری دیگری استفاده می‌کند. برای غیرفعال کردن بافرگذاری در ``TextIOWrapper``، استفاده از پرچم ``write_through`` برای :func:`io.TextIOWrapper.reconfigure` را در نظر بگیرید. اگر آرگومان *buffering* مشخص نشود، سیاست پیش‌فرض بافرگذاری به صورت زیر عمل می‌کند:" +msgid "" +"*buffering* is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed " +"in binary mode), 1 to select line buffering (only usable when writing in text mode), and an integer > 1 to indicate " +"the size in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this way applies for binary " +"buffered I/O, but ``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another buffering. To disable " +"buffering in ``TextIOWrapper``, consider using the ``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. " +"When no *buffering* argument is given, the default buffering policy works as follows:" +msgstr "" +"آرگومان *buffering* یک عدد صحیح اختیاری است که برای تعیین سیاست بافرگذاری استفاده می‌شود. برای غیرفعال کردن بافرگذاری " +"مقدار 0 را وارد کنید (که فقط در حالت دودویی مجاز است)، برای انتخاب بافرگذاری خطی مقدار 1 را وارد کنید (که فقط هنگام " +"نوشتن در حالت متنی قابل استفاده است)، و یک عدد صحیح بزرگ‌تر از 1 را برای تعیین اندازه‌ی یک بافر با اندازه‌ی ثابت (بر " +"حسب بایت) مشخص کنید. توجه داشته باشید که تعیین اندازه‌ی بافر به این روش فقط برای ورودی/خروجی دودوییِ بافرشده اعمال " +"می‌شود، اما ``TextIOWrapper`` (یعنی پرونده‌هایی که با ``mode='r+'`` باز می‌شوند) از بافرگذاری دیگری استفاده می‌کند. برای " +"غیرفعال کردن بافرگذاری در ``TextIOWrapper``، استفاده از پرچم ``write_through`` " +"برای :func:`io.TextIOWrapper.reconfigure` را در نظر بگیرید. اگر آرگومان *buffering* مشخص نشود، سیاست پیش‌فرض " +"بافرگذاری به صورت زیر عمل می‌کند:" -msgid "Binary files are buffered in fixed-size chunks; the size of the buffer is ``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)`` when the device block size is available. On most systems, the buffer will typically be 128 kilobytes long." -msgstr "پرونده‌های دودویی در قطعه‌هایی با اندازهٔ ثابت بافر می‌شوند؛ اگر اندازهٔ بلوک دستگاه در دسترس باشد، اندازهٔ بافر برابر با ``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)`` خواهد بود. در بیشتر سیستم‌ها، اندازهٔ بافر معمولاً ۱۲۸ کیلوبایت است." +msgid "" +"Binary files are buffered in fixed-size chunks; the size of the buffer is ``max(min(blocksize, 8 MiB), " +"DEFAULT_BUFFER_SIZE)`` when the device block size is available. On most systems, the buffer will typically be 128 " +"kilobytes long." +msgstr "" +"پرونده‌های دودویی در قطعه‌هایی با اندازه‌ی ثابت بافر می‌شوند؛ اگر اندازه‌ی بلوک دستگاه در دسترس باشد، اندازه‌ی بافر برابر " +"با ``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)`` خواهد بود. در بیشتر سیستم‌ها، اندازه‌ی بافر معمولاً ۱۲۸ کیلوبایت " +"است." -msgid "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` returns ``True``) use line buffering. Other text files use the policy described above for binary files." -msgstr "پرونده‌های متنی «تعاملی» (پرونده‌هایی که :meth:`~io.IOBase.isatty` برای آن‌ها مقدار ``True`` برمی‌گرداند) از بافرگذاری خطی استفاده می‌کنند. سایر پرونده‌های متنی از سیاستی که در بالا برای پرونده‌های دودویی توضیح داده شده است، پیروی می‌کنند." +msgid "" +"\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` returns ``True``) use line buffering. Other " +"text files use the policy described above for binary files." +msgstr "" +"پرونده‌های متنی «تعاملی» (پرونده‌هایی که :meth:`~io.IOBase.isatty` برای آن‌ها مقدار ``True`` برمی‌گرداند) از بافرگذاری " +"خطی استفاده می‌کنند. سایر پرونده‌های متنی از سیاستی که در بالا برای پرونده‌های دودویی توضیح داده شده است، پیروی می‌کنند." -msgid "*encoding* is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent (whatever :func:`locale.getencoding` returns), but any :term:`text encoding` supported by Python can be used. See the :mod:`codecs` module for the list of supported encodings." -msgstr "*encoding* نام کدگذاری مورد استفاده برای کدگشایی یا کدگذاری پرونده است. این گزینه فقط باید در حالت متنی استفاده شود. کدگذاری پیش‌فرض به سکو بستگی دارد (هر مقداری که :func:`locale.getencoding` برگرداند)، اما می‌توان از هر :term:`کدگذاری متنی ` که توسط پایتون پشتیبانی می‌شود استفاده کرد. برای مشاهدهٔ فهرست کدگذاری‌های پشتیبانی‌شده، به ماژول :mod:`codecs` مراجعه کنید." +msgid "" +"*encoding* is the name of the encoding used to decode or encode the file. This should only be used in text mode. " +"The default encoding is platform dependent (whatever :func:`locale.getencoding` returns), but any :term:`text " +"encoding` supported by Python can be used. See the :mod:`codecs` module for the list of supported encodings." +msgstr "" +"*encoding* نام کدگذاری مورد استفاده برای کدگشایی یا کدگذاری پرونده است. این گزینه فقط باید در حالت متنی استفاده شود. " +"کدگذاری پیش‌فرض به سکو بستگی دارد (هر مقداری که :func:`locale.getencoding` برگرداند)، اما می‌توان از هر :term:`کدگذاری " +"متنی ` که توسط پایتون پشتیبانی می‌شود استفاده کرد. برای مشاهده‌ی فهرست کدگذاری‌های پشتیبانی‌شده، به " +"ماژول :mod:`codecs` مراجعه کنید." -msgid "*errors* is an optional string that specifies how encoding and decoding errors are to be handled—this cannot be used in binary mode. A variety of standard error handlers are available (listed under :ref:`error-handlers`), though any error handling name that has been registered with :func:`codecs.register_error` is also valid. The standard names include:" -msgstr "*errors* یک رشتهٔ اختیاری است که مشخص می‌کند خطاهای کدگذاری و کدگشایی چگونه مدیریت شوند؛ این گزینه در حالت دودویی قابل استفاده نیست. مجموعه‌ای از مدیریت‌کننده‌های استاندارد خطا (که در :ref:`error-handlers` فهرست شده‌اند) در دسترس هستند، با این حال هر نام مدیریت خطایی که با :func:`codecs.register_error` ثبت شده باشد نیز معتبر است. نام‌های استاندارد شامل موارد زیر هستند:" +msgid "" +"*errors* is an optional string that specifies how encoding and decoding errors are to be handled—this cannot be used " +"in binary mode. A variety of standard error handlers are available (listed under :ref:`error-handlers`), though any " +"error handling name that has been registered with :func:`codecs.register_error` is also valid. The standard names " +"include:" +msgstr "" +"*errors* یک رشته‌ی اختیاری است که مشخص می‌کند خطاهای کدگذاری و کدگشایی چگونه مدیریت شوند؛ این گزینه در حالت دودویی " +"قابل استفاده نیست. مجموعه‌ای از هندلرهای استاندارد خطا (که در :ref:`error-handlers` فهرست شده‌اند) در دسترس هستند، با " +"این حال هر نام مدیریت خطایی که با :func:`codecs.register_error` ثبت شده باشد نیز معتبر است. نام‌های استاندارد شامل " +"موارد زیر هستند:" -msgid "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding error. The default value of ``None`` has the same effect." -msgstr "``'strict'`` در صورت بروز خطای کدگذاری، استثنای :exc:`ValueError` پرتاب می‌کند. مقدار پیش‌فرض ``None`` نیز همین رفتار را دارد." +msgid "" +"``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding error. The default value of ``None`` " +"has the same effect." +msgstr "" +"``'strict'`` در صورت بروز خطای کدگذاری، استثنای :exc:`ValueError` پرتاب می‌کند. مقدار پیش‌فرض ``None`` نیز همین رفتار " +"را دارد." msgid "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to data loss." -msgstr "``'ignore'`` خطاها را نادیده می‌گیرد. توجه داشته باشید که نادیده گرفتن خطاهای کدگذاری ممکن است به از دست رفتن داده‌ها منجر شود." +msgstr "" +"``'ignore'`` خطاها را نادیده می‌گیرد. توجه داشته باشید که نادیده گرفتن خطاهای کدگذاری ممکن است به از دست رفتن داده‌ها " +"منجر شود." msgid "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted where there is malformed data." -msgstr "``'replace'`` باعث می‌شود در محل داده‌های نادرست، یک نویسهٔ جایگزین (مانند ``'?'``) درج شود." +msgstr "``'replace'`` باعث می‌شود در محل داده‌های نادرست، یک نویسه‌ی جایگزین (مانند ``'?'``) درج شود." -msgid "``'surrogateescape'`` will represent any incorrect bytes as low surrogate code units ranging from U+DC80 to U+DCFF. These surrogate code units will then be turned back into the same bytes when the ``surrogateescape`` error handler is used when writing data. This is useful for processing files in an unknown encoding." -msgstr "``'surrogateescape'`` هر بایت نادرست را به‌صورت واحدهای کد جانشین پایینی در بازهٔ U+DC80 تا U+DCFF نمایش می‌دهد. سپس، هنگام نوشتن داده‌ها و استفاده از مدیریت‌کنندهٔ خطای ``surrogateescape``، این واحدهای کد جانشین دوباره به همان بایت‌ها تبدیل می‌شوند. این قابلیت برای پردازش پرونده‌هایی با کدگذاری نامشخص مفید است." +msgid "" +"``'surrogateescape'`` will represent any incorrect bytes as low surrogate code units ranging from U+DC80 to U+DCFF. " +"These surrogate code units will then be turned back into the same bytes when the ``surrogateescape`` error handler " +"is used when writing data. This is useful for processing files in an unknown encoding." +msgstr "" +"``'surrogateescape'`` هر بایت نادرست را به‌صورت واحدهای کد جانشین پایینی در بازه‌ی U+DC80 تا U+DCFF نمایش می‌دهد. سپس، " +"هنگام نوشتن داده‌ها و استفاده از هندلر خطای ``surrogateescape``، این واحدهای کد جانشین دوباره به همان بایت‌ها تبدیل " +"می‌شوند. این قابلیت برای پردازش پرونده‌هایی با کدگذاری نامشخص مفید است." -msgid "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters not supported by the encoding are replaced with the appropriate XML character reference :samp:`&#{nnn};`." -msgstr "``'xmlcharrefreplace'`` فقط هنگام نوشتن در یک پرونده پشتیبانی می‌شود. نویسه‌هایی که توسط کدگذاری پشتیبانی نمی‌شوند، با ارجاع نویسهٔ XML متناظر آن‌ها به صورت :samp:`&#{nnn};` جایگزین می‌شوند." +msgid "" +"``'xmlcharrefreplace'`` is only supported when writing to a file. Characters not supported by the encoding are " +"replaced with the appropriate XML character reference :samp:`&#{nnn};`." +msgstr "" +"``'xmlcharrefreplace'`` فقط هنگام نوشتن در یک پرونده پشتیبانی می‌شود. نویسه‌هایی که توسط کدگذاری پشتیبانی نمی‌شوند، با " +"ارجاع نویسه‌ی XML متناظر آن‌ها به صورت :samp:`&#{nnn};` جایگزین می‌شوند." msgid "``'backslashreplace'`` replaces malformed data by Python's backslashed escape sequences." msgstr "``'backslashreplace'`` داده‌های نادرست را با توالی‌های گریز دارای بک‌اسلش در پایتون جایگزین می‌کند." -msgid "``'namereplace'`` (also only supported when writing) replaces unsupported characters with ``\\N{...}`` escape sequences." -msgstr "``'namereplace'`` (که آن هم فقط هنگام نوشتن پشتیبانی می‌شود) نویسه‌های پشتیبانی‌نشده را با توالی‌های گریز ``\\N{...}`` جایگزین می‌کند." +msgid "" +"``'namereplace'`` (also only supported when writing) replaces unsupported characters with ``\\N{...}`` escape " +"sequences." +msgstr "" +"``'namereplace'`` (که آن هم فقط هنگام نوشتن پشتیبانی می‌شود) نویسه‌های پشتیبانی‌نشده را با توالی‌های گریز ``\\N{...}`` " +"جایگزین می‌کند." -msgid "*newline* determines how to parse newline characters from the stream. It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" -msgstr "*newline* مشخص می‌کند که نویسه‌های پایان خط در جریان داده چگونه تجزیه شوند. این مقدار می‌تواند ``None``، ``''``، ``'\\n'``، ``'\\r'`` یا ``'\\r\\n'`` باشد. عملکرد آن به صورت زیر است:" +msgid "" +"*newline* determines how to parse newline characters from the stream. It can be ``None``, ``''``, ``'\\n'``, " +"``'\\r'``, and ``'\\r\\n'``. It works as follows:" +msgstr "" +"*newline* مشخص می‌کند که نویسه‌های پایان خط در جریان داده چگونه تجزیه شوند. این مقدار می‌تواند ``None``، ``''``، " +"``'\\n'``، ``'\\r'`` یا ``'\\r\\n'`` باشد. عملکرد آن به صورت زیر است:" -msgid "When reading input from the stream, if *newline* is ``None``, universal newlines mode is enabled. Lines in the input can end in ``'\\n'``, ``'\\r'``, or ``'\\r\\n'``, and these are translated into ``'\\n'`` before being returned to the caller. If it is ``''``, universal newlines mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated." -msgstr "هنگام خواندن ورودی از جریان، اگر *newline* برابر ``None`` باشد، حالت پایان‌خط‌های همگانی فعال می‌شود. در این حالت، خطوط ورودی می‌توانند با ``'\\n'``، ``'\\r'`` یا ``'\\r\\n'`` پایان یابند و پیش از بازگردانده شدن به فراخواننده، همگی به ``'\\n'`` تبدیل می‌شوند. اگر مقدار آن ``''`` باشد، حالت پایان‌خط‌های همگانی همچنان فعال است، اما نویسه‌های پایان خط بدون تبدیل به فراخواننده بازگردانده می‌شوند. اگر *newline* یکی از مقادیر مجاز دیگر را داشته باشد، خطوط ورودی فقط با همان رشته خاتمه می‌یابند و نویسهٔ پایان خط بدون تبدیل بازگردانده می‌شود." +msgid "" +"When reading input from the stream, if *newline* is ``None``, universal newlines mode is enabled. Lines in the " +"input can end in ``'\\n'``, ``'\\r'``, or ``'\\r\\n'``, and these are translated into ``'\\n'`` before being " +"returned to the caller. If it is ``''``, universal newlines mode is enabled, but line endings are returned to the " +"caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, " +"and the line ending is returned to the caller untranslated." +msgstr "" +"هنگام خواندن ورودی از جریان، اگر *newline* برابر ``None`` باشد، حالت پایان‌خط‌های همگانی فعال می‌شود. در این حالت، خطوط " +"ورودی می‌توانند با ``'\\n'``، ``'\\r'`` یا ``'\\r\\n'`` پایان یابند و پیش از بازگردانده شدن به فراخواننده، همگی به " +"``'\\n'`` تبدیل می‌شوند. اگر مقدار آن ``''`` باشد، حالت پایان‌خط‌های همگانی همچنان فعال است، اما نویسه‌های پایان خط بدون " +"تبدیل به فراخواننده بازگردانده می‌شوند. اگر *newline* یکی از مقادیر مجاز دیگر را داشته باشد، خطوط ورودی فقط با همان " +"رشته خاتمه می‌یابند و نویسه‌ی پایان خط بدون تبدیل بازگردانده می‌شود." -msgid "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` characters written are translated to the system default line separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation takes place. If *newline* is any of the other legal values, any ``'\\n'`` characters written are translated to the given string." -msgstr "هنگام نوشتن خروجی در جریان، اگر *newline* برابر ``None`` باشد، هر نویسهٔ ``'\\n'`` نوشته‌شده به جداکنندهٔ پیش‌فرض پایان خط سیستم، یعنی :data:`os.linesep`، تبدیل می‌شود. اگر *newline* برابر ``''`` یا ``'\\n'`` باشد، هیچ تبدیلی انجام نمی‌شود. اگر *newline* یکی از مقادیر مجاز دیگر را داشته باشد، هر ``'\\n'`` نوشته‌شده به همان رشتهٔ مشخص‌شده تبدیل خواهد شد." +msgid "" +"When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` characters written are translated to the " +"system default line separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation takes " +"place. If *newline* is any of the other legal values, any ``'\\n'`` characters written are translated to the given " +"string." +msgstr "" +"هنگام نوشتن خروجی در جریان، اگر *newline* برابر ``None`` باشد، هر نویسه‌ی ``'\\n'`` نوشته‌شده به جداکننده‌ی پیش‌فرض " +"پایان خط سیستم، یعنی :data:`os.linesep`، تبدیل می‌شود. اگر *newline* برابر ``''`` یا ``'\\n'`` باشد، هیچ تبدیلی انجام " +"نمی‌شود. اگر *newline* یکی از مقادیر مجاز دیگر را داشته باشد، هر ``'\\n'`` نوشته‌شده به همان رشته‌ی مشخص‌شده تبدیل خواهد " +"شد." -msgid "If *closefd* is ``False`` and a file descriptor rather than a filename was given, the underlying file descriptor will be kept open when the file is closed. If a filename is given *closefd* must be ``True`` (the default); otherwise, an error will be raised." -msgstr "اگر *closefd* برابر ``False`` باشد و به‌جای نام پرونده یک توصیفگر پرونده ارائه شده باشد، هنگام بسته شدن پرونده، توصیفگر پروندهٔ زیربنایی باز خواهد ماند. اگر نام پرونده ارائه شود، *closefd* باید برابر ``True`` (مقدار پیش‌فرض) باشد؛ در غیر این صورت، خطا پرتاب خواهد شد." +msgid "" +"If *closefd* is ``False`` and a file descriptor rather than a filename was given, the underlying file descriptor " +"will be kept open when the file is closed. If a filename is given *closefd* must be ``True`` (the default); " +"otherwise, an error will be raised." +msgstr "" +"اگر *closefd* برابر ``False`` باشد و به‌جای نام پرونده یک توصیف‌گر پرونده ارائه شده باشد، هنگام بسته شدن پرونده، " +"توصیف‌گر پرونده‌ی زیربنایی باز خواهد ماند. اگر نام پرونده ارائه شود، *closefd* باید برابر ``True`` (مقدار پیش‌فرض) " +"باشد؛ در غیر این صورت، خطا پرتاب خواهد شد." -msgid "A custom opener can be used by passing a callable as *opener*. The underlying file descriptor for the file object is then obtained by calling *opener* with (*file*, *flags*). *opener* must return an open file descriptor (passing :mod:`os.open` as *opener* results in functionality similar to passing ``None``)." -msgstr "با ارسال یک شیء فراخوانی‌پذیر به‌عنوان *opener* می‌توان از یک بازکنندهٔ سفارشی استفاده کرد. در این صورت، توصیفگر پروندهٔ زیربناییِ شیء پرونده با فراخوانی *opener* و ارسال (*file*, *flags*) به آن به‌دست می‌آید. *opener* باید یک توصیفگر پروندهٔ باز برگرداند (ارسال :mod:`os.open` به‌عنوان *opener* رفتاری مشابه ارسال ``None`` خواهد داشت)." +msgid "" +"A custom opener can be used by passing a callable as *opener*. The underlying file descriptor for the file object is " +"then obtained by calling *opener* with (*file*, *flags*). *opener* must return an open file descriptor " +"(passing :mod:`os.open` as *opener* results in functionality similar to passing ``None``)." +msgstr "" +"با ارسال یک شیء فراخوانی‌پذیر به‌عنوان *opener* می‌توان از یک بازکننده‌ی سفارشی استفاده کرد. در این صورت، توصیف‌گر " +"پرونده‌ی زیربناییِ شیء پرونده با فراخوانی *opener* و ارسال (*file*, *flags*) به آن به‌دست می‌آید. *opener* باید یک " +"توصیف‌گر پرونده‌ی باز برگرداند (ارسال :mod:`os.open` به‌عنوان *opener* رفتاری مشابه ارسال ``None`` خواهد داشت)." msgid "The newly created file is :ref:`non-inheritable `." -msgstr "پروندهٔ تازه ایجادشده :ref:`غیرقابل‌وراثت ` است." +msgstr "پرونده‌ی تازه ایجادشده :ref:`غیرقابل‌وراثت ` است." -msgid "The following example uses the :ref:`dir_fd ` parameter of the :func:`os.open` function to open a file relative to a given directory::" -msgstr "مثال زیر از پارامتر :ref:`dir_fd ` تابع :func:`os.open` برای باز کردن پرونده‌ای نسبت به یک پوشه مشخص استفاده می‌کند::" +msgid "" +"The following example uses the :ref:`dir_fd ` parameter of the :func:`os.open` function to open a file " +"relative to a given directory::" +msgstr "" +"مثال زیر از پارامتر :ref:`dir_fd ` تابع :func:`os.open` برای باز کردن پرونده‌ای نسبت به یک پوشه مشخص استفاده " +"می‌کند::" msgid "" ">>> import os\n" @@ -1188,17 +2070,37 @@ msgstr "" "...\n" ">>> os.close(dir_fd) # don't leak a file descriptor" -msgid "The type of :term:`file object` returned by the :func:`open` function depends on the mode. When :func:`open` is used to open a file in a text mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used to open a file in a binary mode with buffering, the returned class is a subclass of :class:`io.BufferedIOBase`. The exact class varies: in read binary mode, it returns an :class:`io.BufferedReader`; in write binary and append binary modes, it returns an :class:`io.BufferedWriter`, and in read/write mode, it returns an :class:`io.BufferedRandom`. When buffering is disabled, the raw stream, a subclass of :class:`io.RawIOBase`, :class:`io.FileIO`, is returned." -msgstr "نوع :term:`شیء فایل ` بازگردانده‌شده توسط تابع :func:`open` به حالت (mode) بستگی دارد. هنگامی که :func:`open` برای باز کردن پرونده در حالت متنی (مانند ``'w'``، ``'r'``، ``'wt'``، ``'rt'`` و غیره) استفاده شود، زیرکلاسی از :class:`io.TextIOBase` (به‌طور مشخص :class:`io.TextIOWrapper`) را بازمی‌گرداند. هنگام باز کردن پرونده در حالت دودویی همراه با بافر، کلاس بازگردانده‌شده زیرکلاسی از :class:`io.BufferedIOBase` خواهد بود. کلاس دقیق بسته به حالت متفاوت است: در حالت خواندن دودویی، :class:`io.BufferedReader`؛ در حالت‌های نوشتن دودویی و افزودن به انتهای پرونده، :class:`io.BufferedWriter`؛ و در حالت خواندن/نوشتن، :class:`io.BufferedRandom` بازگردانده می‌شود. اگر بافر غیرفعال باشد، جریان خام (raw stream)، یعنی :class:`io.FileIO` که زیرکلاسی از :class:`io.RawIOBase` است، بازگردانده می‌شود." +msgid "" +"The type of :term:`file object` returned by the :func:`open` function depends on the mode. When :func:`open` is " +"used to open a file in a text mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass " +"of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used to open a file in a binary mode with " +"buffering, the returned class is a subclass of :class:`io.BufferedIOBase`. The exact class varies: in read binary " +"mode, it returns an :class:`io.BufferedReader`; in write binary and append binary modes, it returns " +"an :class:`io.BufferedWriter`, and in read/write mode, it returns an :class:`io.BufferedRandom`. When buffering is " +"disabled, the raw stream, a subclass of :class:`io.RawIOBase`, :class:`io.FileIO`, is returned." +msgstr "" +"نوع :term:`شیء فایل ` بازگردانده‌شده توسط تابع :func:`open` به حالت (mode) بستگی دارد. هنگامی " +"که :func:`open` برای باز کردن پرونده در حالت متنی (مانند ``'w'``، ``'r'``، ``'wt'``، ``'rt'`` و غیره) استفاده شود، " +"زیرکلاسی از :class:`io.TextIOBase` (به‌طور مشخص :class:`io.TextIOWrapper`) را بازمی‌گرداند. هنگام باز کردن پرونده در " +"حالت دودویی همراه با بافر، کلاس بازگردانده‌شده زیرکلاسی از :class:`io.BufferedIOBase` خواهد بود. کلاس دقیق بسته به " +"حالت متفاوت است: در حالت خواندن دودویی، :class:`io.BufferedReader`؛ در حالت‌های نوشتن دودویی و افزودن به انتهای " +"پرونده، :class:`io.BufferedWriter`؛ و در حالت خواندن/نوشتن، :class:`io.BufferedRandom` بازگردانده می‌شود. اگر بافر " +"غیرفعال باشد، جریان خام (raw stream)، یعنی :class:`io.FileIO ` که زیرکلاسی از :class:`io.RawIOBase " +"` است، بازگردانده می‌شود." -msgid "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` (where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and :mod:`shutil`." -msgstr "همچنین به ماژول‌های مربوط به کار با پرونده‌ها، مانند :mod:`fileinput`، :mod:`io` (که :func:`open` در آن تعریف شده است)، :mod:`os`، :mod:`os.path`، :mod:`tempfile` و :mod:`shutil` مراجعه کنید." +msgid "" +"See also the file handling modules, such as :mod:`fileinput`, :mod:`io` (where :func:`open` is " +"declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and :mod:`shutil`." +msgstr "" +"همچنین به ماژول‌های مربوط به کار با پرونده‌ها، مانند :mod:`fileinput`، :mod:`io` (که :func:`open` در آن تعریف شده " +"است)، :mod:`os`، :mod:`os.path`، :mod:`tempfile` و :mod:`shutil` مراجعه کنید." msgid "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, ``mode``, ``flags``." -msgstr "یک :ref:`رویداد ممیزی ` با نام ``open`` و آرگومان‌های ``path``، ``mode`` و ``flags`` پرتاب می‌کند." +msgstr "یک :ref:`رویداد حسابرسی ` با نام ``open`` و آرگومان‌های ``path``، ``mode`` و ``flags`` پرتاب می‌کند." msgid "The ``mode`` and ``flags`` arguments may have been modified or inferred from the original call." -msgstr "آرگومان‌های ``mode`` و ``flags`` ممکن است بر اساس فراخوانی اولیه تغییر داده شده یا مقدار آن‌ها استنباط شده باشند." +msgstr "" +"آرگومان‌های ``mode`` و ``flags`` ممکن است بر اساس فراخوانی اولیه تغییر داده شده یا مقدار آن‌ها استنباط شده باشند." msgid "The *opener* parameter was added." msgstr "پارامتر *opener* اضافه شده است." @@ -1210,13 +2112,19 @@ msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "در گذشته استثنای :exc:`IOError` پرتاب می‌شد؛ اکنون این استثنا نام مستعاری برای :exc:`OSError` است." msgid ":exc:`FileExistsError` is now raised if the file opened in exclusive creation mode (``'x'``) already exists." -msgstr "اگر فایلی که در حالت ایجاد انحصاری (``'x'``) باز می‌شود از قبل وجود داشته باشد، اکنون استثنای :exc:`FileExistsError` پرتاب می‌شود." +msgstr "" +"اگر فایلی که در حالت ایجاد انحصاری (``'x'``) باز می‌شود از قبل وجود داشته باشد، اکنون استثنای :exc:`FileExistsError` " +"پرتاب می‌شود." msgid "The file is now non-inheritable." msgstr "اکنون این پرونده غیرقابل‌وراثت است." -msgid "If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." -msgstr "اگر فراخوانی سیستمی متوقف شود و مدیریت‌کنندهٔ سیگنال استثنایی پرتاب نکند، اکنون این تابع به‌جای پرتاب استثنای :exc:`InterruptedError`، فراخوانی سیستمی را دوباره امتحان می‌کند (برای دلیل این تغییر، :pep:`475` را ببینید)." +msgid "" +"If the system call is interrupted and the signal handler does not raise an exception, the function now retries the " +"system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +msgstr "" +"اگر فراخوانی سیستمی متوقف شود و هندلر سیگنال استثنایی پرتاب نکند، اکنون این تابع به‌جای پرتاب " +"استثنای :exc:`InterruptedError`، فراخوانی سیستمی را دوباره امتحان می‌کند (برای دلیل این تغییر، :pep:`475` را ببینید)." msgid "The ``'namereplace'`` error handler was added." msgstr "مدیر خطای ``'namereplace'`` اضافه شده است." @@ -1224,8 +2132,10 @@ msgstr "مدیر خطای ``'namereplace'`` اضافه شده است." msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "پشتیبانی از پذیرش اشیایی که :class:`os.PathLike` را پیاده‌سازی می‌کنند، اضافه شده است." -msgid "On Windows, opening a console buffer may return a subclass of :class:`io.RawIOBase` other than :class:`io.FileIO`." -msgstr "در ویندوز، باز کردن یک بافر کنسول ممکن است زیرکلاسی از :class:`io.RawIOBase` غیر از :class:`io.FileIO` را برگرداند." +msgid "" +"On Windows, opening a console buffer may return a subclass of :class:`io.RawIOBase` other than :class:`io.FileIO`." +msgstr "" +"در ویندوز، باز کردن یک بافر کنسول ممکن است زیرکلاسی از :class:`io.RawIOBase` غیر از :class:`io.FileIO` را برگرداند." msgid "The ``'U'`` mode has been removed." msgstr "حالت ``'U'`` حذف شده است." @@ -1233,23 +2143,59 @@ msgstr "حالت ``'U'`` حذف شده است." msgid "Return the ordinal value of a character." msgstr "مقدار ترتیبی (ordinal) یک نویسه را برمی‌گرداند." -msgid "If the argument is a one-character string, return the Unicode code point of that character. For example, ``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns ``8364``. This is the inverse of :func:`chr`." -msgstr "اگر آرگومان یک رشتهٔ تک‌نویسه‌ای باشد، نقطهٔ کد یونیکد آن نویسه برگردانده می‌شود. برای مثال، ``ord('a')`` عدد صحیح ``97`` و ``ord('€')`` (نماد یورو) عدد ``8364`` را برمی‌گرداند. این تابع معکوس :func:`chr` است." +msgid "" +"If the argument is a one-character string, return the Unicode code point of that character. For example, " +"``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns ``8364``. This is the inverse " +"of :func:`chr`." +msgstr "" +"اگر آرگومان یک رشته‌ی تک‌نویسه‌ای باشد، نقطه‌ی کد یونیکد آن نویسه برگردانده می‌شود. برای مثال، ``ord('a')`` عدد صحیح " +"``97`` و ``ord('€')`` (نماد یورو) عدد ``8364`` را برمی‌گرداند. این تابع معکوس :func:`chr` است." -msgid "If the argument is a :class:`bytes` or :class:`bytearray` object of length 1, return its single byte value. For example, ``ord(b'a')`` returns the integer ``97``." -msgstr "اگر آرگومان یک شیء :class:`bytes` یا :class:`bytearray` با طول ۱ باشد، مقدار تنها بایت آن برگردانده می‌شود. برای مثال، ``ord(b'a')`` عدد صحیح ``97`` را برمی‌گرداند." +msgid "" +"If the argument is a :class:`bytes` or :class:`bytearray` object of length 1, return its single byte value. For " +"example, ``ord(b'a')`` returns the integer ``97``." +msgstr "" +"اگر آرگومان یک شیء :class:`bytes` یا :class:`bytearray` با طول ۱ باشد، مقدار تنها بایت آن برگردانده می‌شود. برای " +"مثال، ``ord(b'a')`` عدد صحیح ``97`` را برمی‌گرداند." -msgid "Return *base* to the power *exp*; if *mod* is present, return *base* to the power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the power operator: ``base**exp``." -msgstr "*base* را به توان *exp* می‌رساند؛ اگر *mod* مشخص شده باشد، مقدار *base* به توان *exp* را به پیمانهٔ *mod* برمی‌گرداند (که کارآمدتر از ``pow(base, exp) % mod`` محاسبه می‌شود). شکل دوآرگومانی ``pow(base, exp)`` معادل استفاده از عملگر توان، یعنی ``base**exp``، است." +msgid "" +"Return *base* to the power *exp*; if *mod* is present, return *base* to the power *exp*, modulo *mod* (computed more " +"efficiently than ``pow(base, exp) % mod``). The two-argument form ``pow(base, exp)`` is equivalent to using the " +"power operator: ``base**exp``." +msgstr "" +"*base* را به توان *exp* می‌رساند؛ اگر *mod* مشخص شده باشد، مقدار *base* به توان *exp* را به پیمانه‌ی *mod* برمی‌گرداند " +"(که کارآمدتر از ``pow(base, exp) % mod`` محاسبه می‌شود). شکل دوآرگومانی ``pow(base, exp)`` معادل استفاده از عملگر " +"توان، یعنی ``base**exp``، است." -msgid "When arguments are builtin numeric types with mixed operand types, the coercion rules for binary arithmetic operators apply. For :class:`int` operands, the result has the same type as the operands (after coercion) unless the second argument is negative; in that case, all arguments are converted to float and a float result is delivered. For example, ``pow(10, 2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative base of type :class:`int` or :class:`float` and a non-integral exponent, a complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:`float` with an integral exponent, a float result is delivered. For example, ``pow(-9, 2.0)`` returns ``81.0``." -msgstr "وقتی آرگومان‌ها از انواع عددی توکار با انواع عملوند متفاوت باشند، قواعد تبدیل (coercion) عملگرهای حسابی دودویی اعمال می‌شود. برای عملوندهای :class:`int`، نتیجه پس از اعمال تبدیل، همان نوع عملوندها را خواهد داشت؛ مگر اینکه آرگومان دوم منفی باشد که در این صورت همهٔ آرگومان‌ها به float تبدیل شده و نتیجه نیز از نوع float خواهد بود. برای مثال، ``pow(10, 2)`` مقدار ``100`` را برمی‌گرداند، اما ``pow(10, -2)`` مقدار ``0.01`` را بازمی‌گرداند. اگر پایهٔ منفی از نوع :class:`int` یا :class:`float` باشد و توان عددی غیرصحیح باشد، نتیجه از نوع مختلط خواهد بود. برای مثال، ``pow(-9, 0.5)`` مقداری نزدیک به ``3j`` را برمی‌گرداند. در مقابل، اگر پایهٔ منفی از نوع :class:`int` یا :class:`float` باشد و توان عددی صحیح باشد، نتیجه از نوع float خواهد بود. برای مثال، ``pow(-9, 2.0)`` مقدار ``81.0`` را برمی‌گرداند." +msgid "" +"When arguments are builtin numeric types with mixed operand types, the coercion rules for binary arithmetic " +"operators apply. For :class:`int` operands, the result has the same type as the operands (after coercion) unless " +"the second argument is negative; in that case, all arguments are converted to float and a float result is " +"delivered. For example, ``pow(10, 2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative base " +"of type :class:`int` or :class:`float` and a non-integral exponent, a complex result is delivered. For example, " +"``pow(-9, 0.5)`` returns a value close to ``3j``. Whereas, for a negative base of type :class:`int` " +"or :class:`float` with an integral exponent, a float result is delivered. For example, ``pow(-9, 2.0)`` returns " +"``81.0``." +msgstr "" +"وقتی آرگومان‌ها از انواع عددی توکار با انواع عملوند متفاوت باشند، قواعد تبدیل (coercion) عملگرهای حسابی دودویی اعمال " +"می‌شود. برای عملوندهای :class:`int`، نتیجه پس از اعمال تبدیل، همان نوع عملوندها را خواهد داشت؛ مگر اینکه آرگومان دوم " +"منفی باشد که در این صورت همه‌ی آرگومان‌ها به float تبدیل شده و نتیجه نیز از نوع float خواهد بود. برای مثال، ``pow(10, " +"2)`` مقدار ``100`` را برمی‌گرداند، اما ``pow(10, -2)`` مقدار ``0.01`` را بازمی‌گرداند. اگر پایه‌ی منفی از " +"نوع :class:`int` یا :class:`float` باشد و توان عددی غیرصحیح باشد، نتیجه از نوع مختلط خواهد بود. برای مثال، ``pow(-9, " +"0.5)`` مقداری نزدیک به ``3j`` را برمی‌گرداند. در مقابل، اگر پایه‌ی منفی از نوع :class:`int` یا :class:`float` باشد و " +"توان عددی صحیح باشد، نتیجه از نوع float خواهد بود. برای مثال، ``pow(-9, 2.0)`` مقدار ``81.0`` را برمی‌گرداند." -msgid "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must also be of integer type and *mod* must be nonzero. If *mod* is present and *exp* is negative, *base* must be relatively prime to *mod*. In that case, ``pow(inv_base, -exp, mod)`` is returned, where *inv_base* is an inverse to *base* modulo *mod*." -msgstr "برای عملوندهای :class:`int` یعنی *base* و *exp*، اگر *mod* ارائه شود، باید از نوع عدد صحیح باشد و مقدار آن نیز نباید صفر باشد. اگر *mod* ارائه شده باشد و *exp* منفی باشد، *base* و *mod* باید نسبت به هم اول باشند. در این حالت، ``pow(inv_base, -exp, mod)`` برگردانده می‌شود که در آن *inv_base* وارونِ *base* به پیمانهٔ *mod* است." +msgid "" +"For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must also be of integer type and *mod* must " +"be nonzero. If *mod* is present and *exp* is negative, *base* must be relatively prime to *mod*. In that case, " +"``pow(inv_base, -exp, mod)`` is returned, where *inv_base* is an inverse to *base* modulo *mod*." +msgstr "" +"برای عملوندهای :class:`int` یعنی *base* و *exp*، اگر *mod* ارائه شود، باید از نوع عدد صحیح باشد و مقدار آن نیز نباید " +"صفر باشد. اگر *mod* ارائه شده باشد و *exp* منفی باشد، *base* و *mod* باید نسبت به هم اول باشند. در این حالت، " +"``pow(inv_base, -exp, mod)`` برگردانده می‌شود که در آن *inv_base* وارونِ *base* به پیمانه‌ی *mod* است." msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" -msgstr "در اینجا مثالی از محاسبهٔ وارون پیمانه‌ایِ ``38`` به پیمانهٔ ``97`` آورده شده است::" +msgstr "در اینجا مثالی از محاسبه‌ی وارون پیمانه‌ایِ ``38`` به پیمانه‌ی ``97`` آورده شده است::" msgid "" ">>> pow(38, -1, mod=97)\n" @@ -1262,23 +2208,46 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -msgid "For :class:`int` operands, the three-argument form of ``pow`` now allows the second argument to be negative, permitting computation of modular inverses." -msgstr "برای عملوندهای :class:`int`، شکل سه‌آرگومانی ``pow`` اکنون اجازه می‌دهد آرگومان دوم منفی باشد و در نتیجه امکان محاسبهٔ وارون پیمانه‌ای را فراهم می‌کند." +msgid "" +"For :class:`int` operands, the three-argument form of ``pow`` now allows the second argument to be negative, " +"permitting computation of modular inverses." +msgstr "" +"برای عملوندهای :class:`int`، شکل سه‌آرگومانی ``pow`` اکنون اجازه می‌دهد آرگومان دوم منفی باشد و در نتیجه امکان محاسبه‌ی " +"وارون پیمانه‌ای را فراهم می‌کند." msgid "Allow keyword arguments. Formerly, only positional arguments were supported." -msgstr "امکان استفاده از آرگومان‌های کلیدواژه‌ای اضافه شد. پیش از این، فقط آرگومان‌های مکانی پشتیبانی می‌شدند." +msgstr "امکان استفاده از آرگومان‌های کلیدواژه‌ای اضافه شد. پیش از این، فقط آرگومان‌های جایگاهی پشتیبانی می‌شدند." -msgid "Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments." -msgstr "*objects* را با جداکنندهٔ *sep* و در انتها با *end* در جریان متنی *file* چاپ می‌کند. اگر *sep*، *end*، *file* یا *flush* مشخص شوند، باید به‌صورت آرگومان‌های کلیدواژه‌ای ارائه شوند." +msgid "" +"Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and " +"*flush*, if present, must be given as keyword arguments." +msgstr "" +"*objects* را با جداکننده‌ی *sep* و در انتها با *end* در جریان متنی *file* چاپ می‌کند. اگر *sep*، *end*، *file* یا " +"*flush* مشخص شوند، باید به‌صورت آرگومان‌های کلیدواژه‌ای ارائه شوند." -msgid "All non-keyword arguments are converted to strings like :func:`str` does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be ``None``, which means to use the default values. If no *objects* are given, :func:`print` will just write *end*." -msgstr "همهٔ آرگومان‌های غیرکلیدواژه‌ای، همانند :func:`str`، به رشته تبدیل شده و با جداکنندهٔ *sep* از یکدیگر جدا شده و سپس همراه با *end* در جریان (stream) نوشته می‌شوند. هر دو مقدار *sep* و *end* باید رشته باشند؛ همچنین می‌توانند ``None`` باشند که در این صورت از مقادیر پیش‌فرض استفاده می‌شود. اگر هیچ *objects*\\ ی ارائه نشود، :func:`print` فقط مقدار *end* را خواهد نوشت." +msgid "" +"All non-keyword arguments are converted to strings like :func:`str` does and written to the stream, separated by " +"*sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be ``None``, which means to use " +"the default values. If no *objects* are given, :func:`print` will just write *end*." +msgstr "" +"همه‌ی آرگومان‌های غیرکلیدواژه‌ای، همانند :func:`str`، به رشته تبدیل شده و با جداکننده‌ی *sep* از یکدیگر جدا شده و سپس " +"همراه با *end* در جریان نوشته می‌شوند. هر دو مقدار *sep* و *end* باید رشته باشند؛ همچنین می‌توانند ``None`` باشند که " +"در این صورت از مقادیر پیش‌فرض استفاده می‌شود. اگر هیچ *objects*\\ ی ارائه نشود، :func:`print` فقط مقدار *end* را خواهد " +"نوشت." -msgid "The *file* argument must be an object with a ``write(string)`` method; if it is not present or ``None``, :data:`sys.stdout` will be used. Since printed arguments are converted to text strings, :func:`print` cannot be used with binary mode file objects. For these, use ``file.write(...)`` instead." -msgstr "آرگومان *file* باید شی‌ءای باشد که متد ``write(string)`` را داشته باشد؛ اگر این آرگومان ارائه نشود یا ``None`` باشد، از :data:`sys.stdout` استفاده خواهد شد. از آنجا که آرگومان‌های چاپ‌شده به رشتهٔ متنی تبدیل می‌شوند، :func:`print` را نمی‌توان با اشیای فایل در حالت دودویی استفاده کرد. برای چنین مواردی، به‌جای آن از ``file.write(...)`` استفاده کنید." +msgid "" +"The *file* argument must be an object with a ``write(string)`` method; if it is not present or " +"``None``, :data:`sys.stdout` will be used. Since printed arguments are converted to text strings, :func:`print` " +"cannot be used with binary mode file objects. For these, use ``file.write(...)`` instead." +msgstr "" +"آرگومان *file* باید شی‌ءای باشد که متد ``write(string)`` را داشته باشد؛ اگر این آرگومان ارائه نشود یا ``None`` باشد، " +"از :data:`sys.stdout` استفاده خواهد شد. از آنجا که آرگومان‌های چاپ‌شده به رشته‌ی متنی تبدیل می‌شوند، :func:`print` را " +"نمی‌توان با اشیای فایل در حالت دودویی استفاده کرد. برای چنین مواردی، به‌جای آن از ``file.write(...)`` استفاده کنید." msgid "Output buffering is usually determined by *file*. However, if *flush* is true, the stream is forcibly flushed." -msgstr "بافرگذاری خروجی معمولاً توسط *file* تعیین می‌شود. با این حال، اگر *flush* برابر True باشد، جریان داده به‌اجبار تخلیه می‌شود." +msgstr "" +"بافرگذاری خروجی معمولاً توسط *file* تعیین می‌شود. با این حال، اگر *flush* برابر True باشد، جریان داده به‌اجبار تخلیه " +"می‌شود." msgid "Added the *flush* keyword argument." msgstr "آرگومان کلیدواژه‌ای *flush* اضافه شد." @@ -1286,11 +2255,15 @@ msgstr "آرگومان کلیدواژه‌ای *flush* اضافه شد." msgid "Return a property attribute." msgstr "یک ویژگی از نوع property را برمی‌گرداند." -msgid "*fget* is a function for getting an attribute value. *fset* is a function for setting an attribute value. *fdel* is a function for deleting an attribute value. And *doc* creates a docstring for the attribute." -msgstr "*fget* تابعی برای دریافت مقدار یک ویژگی است. *fset* تابعی برای تنظیم مقدار یک ویژگی است. *fdel* تابعی برای حذف مقدار یک ویژگی است. همچنین *doc* یک رشتهٔ مستندات برای آن ویژگی ایجاد می‌کند." +msgid "" +"*fget* is a function for getting an attribute value. *fset* is a function for setting an attribute value. *fdel* is " +"a function for deleting an attribute value. And *doc* creates a docstring for the attribute." +msgstr "" +"*fget* تابعی برای دریافت مقدار یک ویژگی است. *fset* تابعی برای تنظیم مقدار یک ویژگی است. *fdel* تابعی برای حذف مقدار " +"یک ویژگی است. همچنین *doc* یک رشته‌ی مستندات برای آن ویژگی ایجاد می‌کند." msgid "A typical use is to define a managed attribute ``x``::" -msgstr "یک کاربرد رایج، تعریف ویژگی مدیریت‌شدهٔ ``x`` به‌صورت زیر است::" +msgstr "یک کاربرد رایج، تعریف ویژگی مدیریت‌شده‌ی ``x`` به‌صورت زیر است::" msgid "" "class C:\n" @@ -1323,11 +2296,21 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -msgid "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = value`` will invoke the setter, and ``del c.x`` the deleter." -msgstr "اگر *c* نمونه‌ای از *C* باشد، عبارت ``c.x`` فراخوانی‌کنندهٔ getter، عبارت ``c.x = value`` فراخوانی‌کنندهٔ setter، و عبارت ``del c.x`` فراخوانی‌کنندهٔ deleter خواهد بود." +msgid "" +"If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = value`` will invoke the setter, and ``del " +"c.x`` the deleter." +msgstr "" +"اگر *c* نمونه‌ای از *C* باشد، عبارت ``c.x`` فراخوانی‌کننده‌ی getter، عبارت ``c.x = value`` فراخوانی‌کننده‌ی setter، و " +"عبارت ``del c.x`` فراخوانی‌کننده‌ی deleter خواهد بود." -msgid "If given, *doc* will be the docstring of the property attribute. Otherwise, the property will copy *fget*'s docstring (if it exists). This makes it possible to create read-only properties easily using :deco:`property` as a :term:`decorator`::" -msgstr "اگر *doc* مشخص شده باشد، به‌عنوان docstring ویژگی property استفاده خواهد شد. در غیر این صورت، property، docstring مربوط به *fget* را (در صورت وجود) کپی می‌کند. این امکان را فراهم می‌کند که با استفاده از :deco:`property` به‌عنوان یک :term:`دکوراتور `، به‌سادگی ویژگی‌های فقط‌خواندنی ایجاد شوند::" +msgid "" +"If given, *doc* will be the docstring of the property attribute. Otherwise, the property will copy *fget*'s " +"docstring (if it exists). This makes it possible to create read-only properties easily using :deco:`property` as " +"a :term:`decorator`::" +msgstr "" +"اگر *doc* مشخص شده باشد، به‌عنوان docstring ویژگی property استفاده خواهد شد. در غیر این صورت، property، docstring " +"مربوط به *fget* را (در صورت وجود) کپی می‌کند. این امکان را فراهم می‌کند که با استفاده از :deco:`property` به‌عنوان " +"یک :term:`دکوراتور `، به‌سادگی ویژگی‌های فقط‌خواندنی ایجاد شوند::" msgid "" "class Parrot:\n" @@ -1348,11 +2331,21 @@ msgstr "" " \"\"\"Get the current voltage.\"\"\"\n" " return self._voltage" -msgid "The ``@property`` decorator turns the :meth:`!voltage` method into a \"getter\" for a read-only attribute with the same name, and it sets the docstring for *voltage* to \"Get the current voltage.\"" -msgstr "تزئین‌کنندهٔ ``@property`` متد :meth:`!voltage` را به یک «getter» برای ویژگی فقط‌خواندنی‌ای با همان نام تبدیل می‌کند و docstring ویژگی *voltage* را روی «Get the current voltage.» تنظیم می‌کند." +msgid "" +"The ``@property`` decorator turns the :meth:`!voltage` method into a \"getter\" for a read-only attribute with the " +"same name, and it sets the docstring for *voltage* to \"Get the current voltage.\"" +msgstr "" +"تزئین‌کننده‌ی ``@property`` متد :meth:`!voltage` را به یک «getter» برای ویژگی فقط‌خواندنی‌ای با همان نام تبدیل می‌کند و " +"docstring ویژگی *voltage* را روی «Get the current voltage.» تنظیم می‌کند." -msgid "A property object has ``getter``, ``setter``, and ``deleter`` methods usable as decorators that create a copy of the property with the corresponding accessor function set to the decorated function. This is best explained with an example:" -msgstr "یک شیء property دارای متدهای ``getter``، ``setter`` و ``deleter`` است که می‌توان از آن‌ها به‌عنوان دکوراتور استفاده کرد. این متدها نسخه‌ای از property را ایجاد می‌کنند که تابع دسترسی متناظر آن با تابع دکوراتورشده جایگزین شده است. این موضوع با یک مثال بهتر توضیح داده می‌شود:" +msgid "" +"A property object has ``getter``, ``setter``, and ``deleter`` methods usable as decorators that create a copy of the " +"property with the corresponding accessor function set to the decorated function. This is best explained with an " +"example:" +msgstr "" +"یک شیء property دارای متدهای ``getter``، ``setter`` و ``deleter`` است که می‌توان از آن‌ها به‌عنوان دکوراتور استفاده " +"کرد. این متدها نسخه‌ای از property را ایجاد می‌کنند که تابع دسترسی متناظر آن با تابع دکوراتورشده جایگزین شده است. این " +"موضوع با یک مثال بهتر توضیح داده می‌شود:" msgid "" "class C:\n" @@ -1389,11 +2382,18 @@ msgstr "" " def x(self):\n" " del self._x" -msgid "This code is exactly equivalent to the first example. Be sure to give the additional functions the same name as the original property (``x`` in this case.)" -msgstr "این کد دقیقاً معادل مثال اول است. دقت کنید که توابع اضافی نیز همان نام property اصلی (در این مثال ``x``) را داشته باشند." +msgid "" +"This code is exactly equivalent to the first example. Be sure to give the additional functions the same name as the " +"original property (``x`` in this case.)" +msgstr "" +"این کد دقیقاً معادل مثال اول است. دقت کنید که توابع اضافی نیز همان نام property اصلی (در این مثال ``x``) را داشته " +"باشند." -msgid "The returned property object also has the attributes ``fget``, ``fset``, and ``fdel`` corresponding to the constructor arguments." -msgstr "شیء property بازگردانده‌شده همچنین دارای ویژگی‌های ``fget``، ``fset`` و ``fdel`` متناظر با آرگومان‌های سازنده است." +msgid "" +"The returned property object also has the attributes ``fget``, ``fset``, and ``fdel`` corresponding to the " +"constructor arguments." +msgstr "" +"شیء property بازگردانده‌شده همچنین دارای ویژگی‌های ``fget``، ``fset`` و ``fdel`` متناظر با آرگومان‌های سازنده است." msgid "The docstrings of property objects are now writeable." msgstr "اکنون docstring اشیای property قابل‌ویرایش است." @@ -1401,11 +2401,26 @@ msgstr "اکنون docstring اشیای property قابل‌ویرایش است. msgid "Attribute holding the name of the property. The name of the property can be changed at runtime." msgstr "ویژگی‌ای که نام property را نگه می‌دارد. نام property را می‌توان در زمان اجرا تغییر داد." -msgid "Rather than being a function, :class:`range` is actually an immutable sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." -msgstr ":class:`range` در واقع یک نوع دنبالهٔ تغییرناپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-range` و :ref:`typesseq` مستند شده است." +msgid "" +"Rather than being a function, :class:`range` is actually an immutable sequence type, as documented in :ref:`typesseq-" +"range` and :ref:`typesseq`." +msgstr "" +":class:`range` در واقع یک نوع دنباله‌ی تغییرناپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-range` " +"و :ref:`typesseq` مستند شده است." -msgid "Return a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to :func:`eval`; otherwise, the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a :meth:`~object.__repr__` method. If :func:`sys.displayhook` is not accessible, this function will raise :exc:`RuntimeError`." -msgstr "رشته‌ای را برمی‌گرداند که نمایش قابل چاپی از یک شیء را در بر دارد. برای بسیاری از نوع‌ها، این تابع تلاش می‌کند رشته‌ای برگرداند که اگر به :func:`eval` داده شود، شی‌ءای با همان مقدار تولید کند؛ در غیر این صورت، نمایش به‌صورت رشته‌ای درون کروشه‌های زاویه‌دار خواهد بود که نام نوع شیء و اطلاعات اضافی، که معمولاً شامل نام و نشانی شیء است، در آن قرار دارد. یک کلاس می‌تواند با تعریف متد :meth:`~object.__repr__` مشخص کند که این تابع برای نمونه‌های آن چه مقداری برگرداند. اگر :func:`sys.displayhook` در دسترس نباشد، این تابع استثنای :exc:`RuntimeError` پرتاب می‌کند." +msgid "" +"Return a string containing a printable representation of an object. For many types, this function makes an attempt " +"to return a string that would yield an object with the same value when passed to :func:`eval`; otherwise, the " +"representation is a string enclosed in angle brackets that contains the name of the type of the object together with " +"additional information often including the name and address of the object. A class can control what this function " +"returns for its instances by defining a :meth:`~object.__repr__` method. If :func:`sys.displayhook` is not " +"accessible, this function will raise :exc:`RuntimeError`." +msgstr "" +"رشته‌ای را برمی‌گرداند که نمایش قابل چاپی از یک شیء را در بر دارد. برای بسیاری از نوع‌ها، این تابع تلاش می‌کند رشته‌ای " +"برگرداند که اگر به :func:`eval` داده شود، شی‌ءای با همان مقدار تولید کند؛ در غیر این صورت، نمایش به‌صورت رشته‌ای درون " +"کروشه‌های زاویه‌دار خواهد بود که نام نوع شیء و اطلاعات اضافی، که معمولاً شامل نام و نشانی شیء است، در آن قرار دارد. یک " +"کلاس می‌تواند با تعریف متد :meth:`~object.__repr__` مشخص کند که این تابع برای نمونه‌های آن چه مقداری برگرداند. " +"اگر :func:`sys.displayhook` در دسترس نباشد، این تابع استثنای :exc:`RuntimeError` پرتاب می‌کند." msgid "This class has a custom representation that can be evaluated::" msgstr "این کلاس یک نمایش (representation) سفارشی دارد که قابل ارزیابی است::" @@ -1427,74 +2442,165 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -msgid "Return a reverse :term:`iterator`. The argument must be an object which has a :meth:`~object.__reversed__` method or supports the sequence protocol (the :meth:`~object.__len__` method and the :meth:`~object.__getitem__` method with integer arguments starting at ``0``)." -msgstr "یک :term:`تکرارگر ` معکوس را برمی‌گرداند. آرگومان باید شی‌ءای باشد که متد :meth:`~object.__reversed__` را داشته باشد یا از پروتکل دنباله (متد :meth:`~object.__len__` و متد :meth:`~object.__getitem__` با آرگومان‌های صحیح که از ``0`` شروع می‌شوند) پشتیبانی کند." +msgid "" +"Return a reverse :term:`iterator`. The argument must be an object which has a :meth:`~object.__reversed__` method " +"or supports the sequence protocol (the :meth:`~object.__len__` method and the :meth:`~object.__getitem__` method " +"with integer arguments starting at ``0``)." +msgstr "" +"یک :term:`پیمایش‌گر ` معکوس را برمی‌گرداند. آرگومان باید شی‌ءای باشد که متد :meth:`~object.__reversed__` را " +"داشته باشد یا از پروتکل دنباله (متد :meth:`~object.__len__` و متد :meth:`~object.__getitem__` با آرگومان‌های صحیح که " +"از ``0`` شروع می‌شوند) پشتیبانی کند." -msgid "Return *number* rounded to *ndigits* precision after the decimal point. If *ndigits* is omitted or is ``None``, it returns the nearest integer to its input." -msgstr "*number* را با دقت *ndigits* رقم پس از ممیز گرد می‌کند. اگر *ndigits* حذف شده باشد یا برابر ``None`` باشد، نزدیک‌ترین عدد صحیح به ورودی را برمی‌گرداند." +msgid "" +"Return *number* rounded to *ndigits* precision after the decimal point. If *ndigits* is omitted or is ``None``, it " +"returns the nearest integer to its input." +msgstr "" +"*number* را با دقت *ndigits* رقم پس از ممیز گرد می‌کند. اگر *ndigits* حذف شده باشد یا برابر ``None`` باشد، نزدیک‌ترین " +"عدد صحیح به ورودی را برمی‌گرداند." -msgid "For the built-in types supporting :func:`round`, values are rounded to the closest multiple of 10 to the power minus *ndigits*; if two multiples are equally close, rounding is done toward the even choice (so, for example, both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``). Any integer value is valid for *ndigits* (positive, zero, or negative). The return value is an integer if *ndigits* is omitted or ``None``. Otherwise, the return value has the same type as *number*." -msgstr "برای انواع توکاری که از :func:`round` پشتیبانی می‌کنند، مقادیر به نزدیک‌ترین مضرب 10 به توان منفی *ndigits* گرد می‌شوند. اگر دو مضرب به یک اندازه نزدیک باشند، گرد کردن به سمت مقدار زوج انجام می‌شود (برای مثال، هر دو عبارت ``round(0.5)`` و ``round(-0.5)`` برابر ``0`` هستند و ``round(1.5)`` برابر ``2`` است). هر مقدار صحیحی (مثبت، صفر یا منفی) برای *ndigits* معتبر است. اگر *ndigits* حذف شود یا ``None`` باشد، مقدار بازگشتی یک عدد صحیح خواهد بود. در غیر این صورت، مقدار بازگشتی همان نوع *number* را خواهد داشت." +msgid "" +"For the built-in types supporting :func:`round`, values are rounded to the closest multiple of 10 to the power minus " +"*ndigits*; if two multiples are equally close, rounding is done toward the even choice (so, for example, both " +"``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``). Any integer value is valid for " +"*ndigits* (positive, zero, or negative). The return value is an integer if *ndigits* is omitted or ``None``. " +"Otherwise, the return value has the same type as *number*." +msgstr "" +"برای انواع توکاری که از :func:`round` پشتیبانی می‌کنند، مقادیر به نزدیک‌ترین مضرب 10 به توان منفی *ndigits* گرد " +"می‌شوند. اگر دو مضرب به یک اندازه نزدیک باشند، گرد کردن به سمت مقدار زوج انجام می‌شود (برای مثال، هر دو عبارت " +"``round(0.5)`` و ``round(-0.5)`` برابر ``0`` هستند و ``round(1.5)`` برابر ``2`` است). هر مقدار صحیحی (مثبت، صفر یا " +"منفی) برای *ndigits* معتبر است. اگر *ndigits* حذف شود یا ``None`` باشد، مقدار بازگشتی یک عدد صحیح خواهد بود. در غیر " +"این صورت، مقدار بازگشتی همان نوع *number* را خواهد داشت." msgid "For a general Python object ``number``, ``round`` delegates to ``number.__round__``." msgstr "برای یک شیء عمومی پایتون به نام ``number``، تابع ``round`` فراخوانی را به ``number.__round__`` واگذار می‌کند." -msgid "The behavior of :func:`round` for floats can be surprising: for example, ``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is not a bug: it's a result of the fact that most decimal fractions can't be represented exactly as a float. See :ref:`tut-fp-issues` for more information." -msgstr "رفتار :func:`round` برای اعداد ممیز شناور ممکن است غافلگیرکننده باشد؛ برای مثال، ``round(2.675, 2)`` به‌جای ``2.68`` مقدار ``2.67`` را برمی‌گرداند. این یک باگ نیست؛ بلکه نتیجهٔ این واقعیت است که بیشتر کسرهای ده‌دهی را نمی‌توان به‌طور دقیق به‌صورت عدد ممیز شناور نمایش داد. برای اطلاعات بیشتر به :ref:`tut-fp-issues` مراجعه کنید." +msgid "" +"The behavior of :func:`round` for floats can be surprising: for example, ``round(2.675, 2)`` gives ``2.67`` instead " +"of the expected ``2.68``. This is not a bug: it's a result of the fact that most decimal fractions can't be " +"represented exactly as a float. See :ref:`tut-fp-issues` for more information." +msgstr "" +"رفتار :func:`round` برای اعداد ممیز شناور ممکن است غافلگیرکننده باشد؛ برای مثال، ``round(2.675, 2)`` به‌جای ``2.68`` " +"مقدار ``2.67`` را برمی‌گرداند. این یک باگ نیست؛ بلکه نتیجه‌ی این واقعیت است که بیشتر کسرهای ده‌دهی را نمی‌توان به‌طور " +"دقیق به‌صورت عدد ممیز شناور نمایش داد. برای اطلاعات بیشتر به :ref:`tut-fp-issues` مراجعه کنید." -msgid "Return a new :class:`set` object, optionally with elements taken from *iterable*. :class:`set` is a built-in class. See also :ref:`types-set` for documentation about this class." -msgstr "یک شیء جدید از نوع :class:`set` را برمی‌گرداند و به صورت اختیاری، عناصر آن از *iterable* گرفته می‌شوند. :class:`set` یک کلاس توکار است. برای مستندات این کلاس، به :ref:`types-set` مراجعه کنید." +msgid "" +"Return a new :class:`set` object, optionally with elements taken from *iterable*. :class:`set` is a built-in " +"class. See also :ref:`types-set` for documentation about this class." +msgstr "" +"یک شیء جدید از نوع :class:`set` را برمی‌گرداند و به صورت اختیاری، عناصر آن از *iterable* گرفته می‌شوند. :class:`set` " +"یک کلاس توکار است. برای مستندات این کلاس، به :ref:`types-set` مراجعه کنید." -msgid "For other containers see the built-in :class:`frozenset`, :class:`list`, :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." -msgstr "برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`frozenset`، :class:`list`، :class:`tuple` و :class:`dict`، و همچنین ماژول :mod:`collections` مراجعه کنید." +msgid "" +"For other containers see the built-in :class:`frozenset`, :class:`list`, :class:`tuple`, and :class:`dict` classes, " +"as well as the :mod:`collections` module." +msgstr "" +"برای سایر انواع محفظه‌ها، به کلاس‌های توکار :class:`frozenset`، :class:`list`، :class:`tuple` و :class:`dict`، و " +"همچنین ماژول :mod:`collections` مراجعه کنید." -msgid "This is the counterpart of :func:`getattr`. The arguments are an object, a string, and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` is equivalent to ``x.foobar = 123``." -msgstr "این تابع همتای :func:`getattr` است. آرگومان‌های آن یک شیء، یک رشته و یک مقدار دلخواه هستند. رشته می‌تواند نام یک ویژگی موجود یا یک ویژگی جدید باشد. در صورت مجاز بودن، تابع مقدار را به آن ویژگی اختصاص می‌دهد. برای مثال، ``setattr(x, 'foobar', 123)`` معادل ``x.foobar = 123`` است." +msgid "" +"This is the counterpart of :func:`getattr`. The arguments are an object, a string, and an arbitrary value. The " +"string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided " +"the object allows it. For example, ``setattr(x, 'foobar', 123)`` is equivalent to ``x.foobar = 123``." +msgstr "" +"این تابع همتای :func:`getattr` است. آرگومان‌های آن یک شیء، یک رشته و یک مقدار دلخواه هستند. رشته می‌تواند نام یک ویژگی " +"موجود یا یک ویژگی جدید باشد. در صورت مجاز بودن، تابع مقدار را به آن ویژگی اختصاص می‌دهد. برای مثال، ``setattr(x, " +"'foobar', 123)`` معادل ``x.foobar = 123`` است." -msgid "*name* need not be a Python identifier as defined in :ref:`identifiers` unless the object chooses to enforce that, for example in a custom :meth:`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute whose name is not an identifier will not be accessible using the dot notation, but is accessible through :func:`getattr` etc.." -msgstr "*name* لازم نیست یک شناسهٔ پایتون، مطابق تعریف :ref:`identifiers`، باشد؛ مگر اینکه خود شیء این موضوع را اعمال کند، برای مثال در یک :meth:`~object.__getattribute__` سفارشی یا از طریق :attr:`~object.__slots__`. ویژگی‌ای که نام آن یک شناسه نباشد، با استفاده از نماد نقطه قابل دسترسی نیست، اما از طریق :func:`getattr` و توابع مشابه قابل دسترسی خواهد بود." +msgid "" +"*name* need not be a Python identifier as defined in :ref:`identifiers` unless the object chooses to enforce that, " +"for example in a custom :meth:`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute whose name " +"is not an identifier will not be accessible using the dot notation, but is accessible through :func:`getattr` etc.." +msgstr "" +"*name* لازم نیست یک شناسه‌ی پایتون، مطابق تعریف :ref:`identifiers`، باشد؛ مگر اینکه خود شیء این موضوع را اعمال کند، " +"برای مثال در یک :meth:`~object.__getattribute__` سفارشی یا از طریق :attr:`~object.__slots__`. ویژگی‌ای که نام آن یک " +"شناسه نباشد، با استفاده از نماد نقطه قابل دسترسی نیست، اما از طریق :func:`getattr` و توابع مشابه قابل دسترسی خواهد " +"بود." -msgid "Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a private attribute's (attributes with two leading underscores) name in order to set it with :func:`setattr`." -msgstr "از آنجا که :ref:`تغییر نام خصوصی ` در زمان کامپایل انجام می‌شود، برای تنظیم مقدار یک ویژگی خصوصی (ویژگی‌هایی که با دو زیرخط آغاز می‌شوند) با استفاده از :func:`setattr`، باید نام آن را به‌صورت دستی تغییر دهید." +msgid "" +"Since :ref:`private name mangling ` happens at compilation time, one must manually mangle a " +"private attribute's (attributes with two leading underscores) name in order to set it with :func:`setattr`." +msgstr "" +"از آنجا که :ref:`تغییر نام خصوصی ` در زمان کامپایل انجام می‌شود، برای تنظیم مقدار یک ویژگی " +"خصوصی (ویژگی‌هایی که با دو زیرخط آغاز می‌شوند) با استفاده از :func:`setattr`، باید نام آن را به‌صورت دستی تغییر دهید." -msgid "Return a :term:`slice` object representing the set of indices specified by ``range(start, stop, step)``. The *start* and *step* arguments default to ``None``." -msgstr "یک شیء :term:`slice` را برمی‌گرداند که مجموعهٔ اندیس‌های مشخص‌شده توسط ``range(start, stop, step)`` را نمایش می‌دهد. آرگومان‌های *start* و *step* به‌طور پیش‌فرض برابر ``None`` هستند." +msgid "" +"Return a :term:`slice` object representing the set of indices specified by ``range(start, stop, step)``. The " +"*start* and *step* arguments default to ``None``." +msgstr "" +"یک شیء :term:`slice` را برمی‌گرداند که مجموعه‌ی اندیس‌های مشخص‌شده توسط ``range(start, stop, step)`` را نمایش می‌دهد. " +"آرگومان‌های *start* و *step* به‌طور پیش‌فرض برابر ``None`` هستند." -msgid "Slice objects are also generated when :ref:`slicing syntax ` is used. For example: ``a[start:stop:step]`` or ``a[start:stop, i]``." -msgstr "اشیای slice هنگام استفاده از :ref:`نحو برش ` نیز ایجاد می‌شوند. برای مثال: ``a[start:stop:step]`` یا ``a[start:stop, i]``." +msgid "" +"Slice objects are also generated when :ref:`slicing syntax ` is used. For example: ``a[start:stop:step]`` " +"or ``a[start:stop, i]``." +msgstr "" +"اشیای slice هنگام استفاده از :ref:`نحو برش ` نیز ایجاد می‌شوند. برای مثال: ``a[start:stop:step]`` یا " +"``a[start:stop, i]``." msgid "See :func:`itertools.islice` for an alternate version that returns an :term:`iterator`." -msgstr "برای نسخهٔ جایگزینی که یک :term:`تکرارگر ` برمی‌گرداند، به :func:`itertools.islice` مراجعه کنید." +msgstr "برای نسخه‌ی جایگزینی که یک :term:`پیمایش‌گر ` برمی‌گرداند، به :func:`itertools.islice` مراجعه کنید." -msgid "These read-only attributes are set to the argument values (or their default). They have no other explicit functionality; however, they are used by NumPy and other third-party packages." -msgstr "این ویژگی‌های فقط‌خواندنی بر اساس مقادیر آرگومان‌ها (یا مقادیر پیش‌فرض آن‌ها) تنظیم می‌شوند. خود آن‌ها قابلیت صریح دیگری ندارند؛ بااین‌حال، توسط NumPy و سایر بسته‌های شخص ثالث استفاده می‌شوند." +msgid "" +"These read-only attributes are set to the argument values (or their default). They have no other explicit " +"functionality; however, they are used by NumPy and other third-party packages." +msgstr "" +"این ویژگی‌های فقط‌خواندنی بر اساس مقادیر آرگومان‌ها (یا مقادیر پیش‌فرض آن‌ها) تنظیم می‌شوند. خود آن‌ها قابلیت صریح دیگری " +"ندارند؛ بااین‌حال، توسط NumPy و سایر بسته‌های شخص ثالث استفاده می‌شوند." -msgid "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` are hashable)." -msgstr "اشیای slice اکنون :term:`هش‌پذیر ` هستند (به شرطی که :attr:`~slice.start`، :attr:`~slice.stop` و :attr:`~slice.step` نیز هش‌پذیر باشند)." +msgid "" +"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` " +"are hashable)." +msgstr "" +"اشیای slice اکنون :term:`هش‌پذیر ` هستند (به شرطی که :attr:`~slice.start`، :attr:`~slice.stop` " +"و :attr:`~slice.step` نیز هش‌پذیر باشند)." msgid "Return a new sorted list from the items in *iterable*." -msgstr "یک فهرست مرتب‌شدهٔ جدید از عناصر *iterable* را برمی‌گرداند." +msgstr "یک فهرست مرتب‌شده‌ی جدید از عناصر *iterable* را برمی‌گرداند." msgid "Has two optional arguments which must be specified as keyword arguments." msgstr "دارای دو آرگومان اختیاری است که باید به‌صورت آرگومان‌های کلیدواژه‌ای مشخص شوند." -msgid "*key* specifies a function of one argument that is used to extract a comparison key from each element in *iterable* (for example, ``key=str.lower``). The default value is ``None`` (compare the elements directly)." -msgstr "*key* تابعی با یک آرگومان را مشخص می‌کند که برای استخراج یک کلید مقایسه از هر عنصر در *iterable* استفاده می‌شود (برای مثال، ``key=str.lower``). مقدار پیش‌فرض آن ``None`` است (در این حالت، عناصر مستقیماً با یکدیگر مقایسه می‌شوند)." +msgid "" +"*key* specifies a function of one argument that is used to extract a comparison key from each element in *iterable* " +"(for example, ``key=str.lower``). The default value is ``None`` (compare the elements directly)." +msgstr "" +"*key* تابعی با یک آرگومان را مشخص می‌کند که برای استخراج یک کلید مقایسه از هر عنصر در *iterable* استفاده می‌شود (برای " +"مثال، ``key=str.lower``). مقدار پیش‌فرض آن ``None`` است (در این حالت، عناصر مستقیماً با یکدیگر مقایسه می‌شوند)." -msgid "*reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed." -msgstr "*reverse* یک مقدار بولی است. اگر برابر ``True`` باشد، عناصر فهرست به گونه‌ای مرتب می‌شوند که گویی نتیجهٔ هر مقایسه معکوس شده است." +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were " +"reversed." +msgstr "" +"*reverse* یک مقدار بولی است. اگر برابر ``True`` باشد، عناصر فهرست به گونه‌ای مرتب می‌شوند که گویی نتیجه‌ی هر مقایسه " +"معکوس شده است." msgid "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a *key* function." msgstr "برای تبدیل یک تابع *cmp* به سبک قدیمی به یک تابع *key*، از :func:`functools.cmp_to_key` استفاده کنید." -msgid "The built-in :func:`sorted` function is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade)." -msgstr "تابع توکار :func:`sorted` تضمین می‌کند که مرتب‌سازی پایدار باشد. مرتب‌سازی پایدار به این معناست که ترتیب نسبی عناصری که با هم برابر مقایسه می‌شوند تغییر نمی‌کند؛ این ویژگی برای مرتب‌سازی چندمرحله‌ای (برای مثال، ابتدا بر اساس دپارتمان و سپس بر اساس ردهٔ حقوق) مفید است." +msgid "" +"The built-in :func:`sorted` function is guaranteed to be stable. A sort is stable if it guarantees not to change the " +"relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort " +"by department, then by salary grade)." +msgstr "" +"تابع توکار :func:`sorted` تضمین می‌کند که مرتب‌سازی پایدار باشد. مرتب‌سازی پایدار به این معناست که ترتیب نسبی عناصری که " +"با هم برابر مقایسه می‌شوند تغییر نمی‌کند؛ این ویژگی برای مرتب‌سازی چندمرحله‌ای (برای مثال، ابتدا بر اساس دپارتمان و سپس " +"بر اساس رده‌ی حقوق) مفید است." -msgid "The sort algorithm uses only ``<`` comparisons between items. While defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` recommends that all six :ref:`rich comparisons ` be implemented. This will help avoid bugs when using the same data with other ordering tools such as :func:`max` that rely on a different underlying method. Implementing all six comparisons also helps avoid confusion for mixed type comparisons which can call the reflected :meth:`~object.__gt__` method." -msgstr "الگوریتم مرتب‌سازی تنها از مقایسه‌های ``<`` بین عناصر استفاده می‌کند. هرچند تعریف متد :meth:`~object.__lt__` برای مرتب‌سازی کافی است، :PEP:`8` توصیه می‌کند که هر شش عملگر :ref:`مقایسهٔ غنی ` پیاده‌سازی شوند. این کار به جلوگیری از بروز خطا هنگام استفاده از همان داده‌ها با ابزارهای مرتب‌سازی دیگری مانند :func:`max` که به متد زیربنایی متفاوتی متکی هستند کمک می‌کند. همچنین، پیاده‌سازی هر شش مقایسه از سردرگمی در مقایسهٔ انواع مختلف که ممکن است متد بازتابی :meth:`~object.__gt__` را فراخوانی کنند جلوگیری می‌کند." +msgid "" +"The sort algorithm uses only ``<`` comparisons between items. While defining an :meth:`~object.__lt__` method will " +"suffice for sorting, :PEP:`8` recommends that all six :ref:`rich comparisons ` be implemented. This " +"will help avoid bugs when using the same data with other ordering tools such as :func:`max` that rely on a different " +"underlying method. Implementing all six comparisons also helps avoid confusion for mixed type comparisons which can " +"call the reflected :meth:`~object.__gt__` method." +msgstr "" +"الگوریتم مرتب‌سازی تنها از مقایسه‌های ``<`` بین عناصر استفاده می‌کند. هرچند تعریف متد :meth:`~object.__lt__` برای " +"مرتب‌سازی کافی است، :PEP:`8` توصیه می‌کند که هر شش عملگر :ref:`مقایسه‌ی غنی ` پیاده‌سازی شوند. این کار به " +"جلوگیری از بروز خطا هنگام استفاده از همان داده‌ها با ابزارهای مرتب‌سازی دیگری مانند :func:`max` که به متد زیربنایی " +"متفاوتی متکی هستند کمک می‌کند. همچنین، پیاده‌سازی هر شش مقایسه از سردرگمی در مقایسه‌ی انواع مختلف که ممکن است متد " +"بازتابی :meth:`~object.__gt__` را فراخوانی کنند جلوگیری می‌کند." msgid "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." -msgstr "برای مثال‌هایی از مرتب‌سازی و یک آموزش کوتاه دربارهٔ آن، به :ref:`sortinghowto` مراجعه کنید." +msgstr "برای مثال‌هایی از مرتب‌سازی و یک آموزش کوتاه درباره‌ی آن، به :ref:`sortinghowto` مراجعه کنید." msgid "Transform a method into a static method." msgstr "یک متد را به متد ایستا تبدیل می‌کند." @@ -1512,16 +2618,33 @@ msgstr "" " def f(arg1, arg2, argN): ..." msgid "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:`function` for details." -msgstr "شکل ``@staticmethod`` یک :term:`تزئین‌کننده ` تابع است؛ برای جزئیات به :ref:`function` مراجعه کنید." +msgstr "" +"شکل ``@staticmethod`` یک :term:`تزئین‌کننده ` تابع است؛ برای جزئیات به :ref:`تابع ` مراجعه کنید." -msgid "A static method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). Moreover, the static method :term:`descriptor` is also callable, so it can be used in the class definition (such as ``f()``)." -msgstr "یک متد ایستا را می‌توان هم روی خود کلاس (مانند ``C.f()``) و هم روی یک نمونه (مانند ``C().f()``) فراخوانی کرد. علاوه بر این، :term:`توصیفگر ` متد ایستا نیز فراخوانی‌پذیر است؛ بنابراین می‌توان از آن در تعریف کلاس (مانند ``f()``) استفاده کرد." +msgid "" +"A static method can be called either on the class (such as ``C.f()``) or on an instance (such as ``C().f()``). " +"Moreover, the static method :term:`descriptor` is also callable, so it can be used in the class definition (such as " +"``f()``)." +msgstr "" +"یک متد ایستا را می‌توان هم روی خود کلاس (مانند ``C.f()``) و هم روی یک نمونه (مانند ``C().f()``) فراخوانی کرد. علاوه " +"بر این، :term:`توصیف‌گر ` متد ایستا نیز فراخوانی‌پذیر است؛ بنابراین می‌توان از آن در تعریف کلاس (مانند " +"``f()``) استفاده کرد." -msgid "Static methods in Python are similar to those found in Java or C++. Also, see :deco:`classmethod` for a variant that is useful for creating alternate class constructors." -msgstr "متدهای ایستا در پایتون مشابه متدهای ایستای موجود در جاوا یا ++C هستند. همچنین، برای گونه‌ای که در ایجاد سازنده‌های جایگزین برای کلاس مفید است، به :deco:`classmethod` مراجعه کنید." +msgid "" +"Static methods in Python are similar to those found in Java or C++. Also, see :deco:`classmethod` for a variant that " +"is useful for creating alternate class constructors." +msgstr "" +"متدهای ایستا در پایتون مشابه متدهای ایستای موجود در جاوا یا ++C هستند. همچنین، برای گونه‌ای که در ایجاد سازنده‌های " +"جایگزین برای کلاس مفید است، به :deco:`classmethod` مراجعه کنید." -msgid "Like all decorators, it is also possible to call ``staticmethod`` as a regular function and do something with its result. This is needed in some cases where you need a reference to a function from a class body and you want to avoid the automatic transformation to instance method. For these cases, use this idiom::" -msgstr "مانند همهٔ دکوراتورها، می‌توان ``staticmethod`` را نیز به‌صورت یک تابع معمولی فراخوانی کرد و از نتیجهٔ آن استفاده نمود. این کار در برخی موارد که به ارجاعی به یک تابع از درون بدنهٔ کلاس نیاز دارید و می‌خواهید از تبدیل خودکار آن به متد نمونه جلوگیری کنید، ضروری است. در چنین مواردی، از الگوی زیر استفاده کنید::" +msgid "" +"Like all decorators, it is also possible to call ``staticmethod`` as a regular function and do something with its " +"result. This is needed in some cases where you need a reference to a function from a class body and you want to " +"avoid the automatic transformation to instance method. For these cases, use this idiom::" +msgstr "" +"مانند همه‌ی دکوراتورها، می‌توان ``staticmethod`` را نیز به‌صورت یک تابع معمولی فراخوانی کرد و از نتیجه‌ی آن استفاده " +"نمود. این کار در برخی موارد که به ارجاعی به یک تابع از درون بدنه‌ی کلاس نیاز دارید و می‌خواهید از تبدیل خودکار آن به " +"متد نمونه جلوگیری کنید، ضروری است. در چنین مواردی، از الگوی زیر استفاده کنید::" msgid "" "def regular_function():\n" @@ -1537,55 +2660,126 @@ msgstr "" " method = staticmethod(regular_function)" msgid "For more information on static methods, see :ref:`types`." -msgstr "برای اطلاعات بیشتر دربارهٔ متدهای ایستا، به :ref:`types` مراجعه کنید." +msgstr "برای اطلاعات بیشتر درباره‌ی متدهای ایستا، به :ref:`types` مراجعه کنید." -msgid "Static methods now inherit the method attributes (:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new ``__wrapped__`` attribute, and are now callable as regular functions." -msgstr "متدهای ایستا اکنون ویژگی‌های متد (:attr:`~function.__module__`، :attr:`~function.__name__`، :attr:`~function.__qualname__`، :attr:`~function.__doc__` و :attr:`~function.__annotations__`) را به ارث می‌برند، دارای ویژگی جدید ``__wrapped__`` هستند و همچنین اکنون مانند توابع معمولی قابل فراخوانی‌اند." +msgid "" +"Static methods now inherit the method attributes " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " +"and :attr:`~function.__annotations__`), have a new ``__wrapped__`` attribute, and are now callable as regular " +"functions." +msgstr "" +"متدهای ایستا اکنون ویژگی‌های متد " +"(:attr:`~function.__module__`، :attr:`~function.__name__`، :attr:`~function.__qualname__`، :attr:`~function.__doc__` " +"و :attr:`~function.__annotations__`) را به ارث می‌برند، دارای ویژگی جدید ``__wrapped__`` هستند و همچنین اکنون مانند " +"توابع معمولی قابل فراخوانی‌اند." msgid "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "نسخه‌ای از *object* از نوع :class:`str` را برمی‌گرداند. برای جزئیات بیشتر، به :func:`str` مراجعه کنید." msgid "``str`` is the built-in string :term:`class`. For general information about strings, see :ref:`textseq`." -msgstr "``str`` :term:`کلاس ` رشتهٔ توکار پایتون است. برای اطلاعات کلی دربارهٔ رشته‌ها، :ref:`textseq` را ببینید." +msgstr "" +"``str`` :term:`کلاس ` رشته‌ی توکار پایتون است. برای اطلاعات کلی درباره‌ی رشته‌ها، :ref:`textseq` را ببینید." -msgid "Sums *start* and the items of an *iterable* from left to right and returns the total. The *iterable*'s items are normally numbers, and the start value is not allowed to be a string." -msgstr "*start* و عناصر *iterable* را از چپ به راست با هم جمع می‌کند و مجموع را برمی‌گرداند. عناصر *iterable* معمولاً عدد هستند و مقدار *start* مجاز نیست رشته باشد." +msgid "" +"Sums *start* and the items of an *iterable* from left to right and returns the total. The *iterable*'s items are " +"normally numbers, and the start value is not allowed to be a string." +msgstr "" +"*start* و عناصر *iterable* را از چپ به راست با هم جمع می‌کند و مجموع را برمی‌گرداند. عناصر *iterable* معمولاً عدد هستند " +"و مقدار *start* مجاز نیست رشته باشد." -msgid "For some use cases, there are good alternatives to :func:`sum`. The preferred, fast way to concatenate a sequence of strings is by calling ``''.join(sequence)``. To add floating-point values with extended precision, see :func:`math.fsum`\\. To concatenate a series of iterables, consider using :func:`itertools.chain`." -msgstr "برای برخی کاربردها، جایگزین‌های مناسبی برای :func:`sum` وجود دارد. روش ترجیحی و سریع برای به‌هم‌چسباندن یک دنباله از رشته‌ها، فراخوانی ``''.join(sequence)`` است. برای جمع کردن اعداد ممیز شناور با دقت بیشتر، به :func:`math.fsum` مراجعه کنید. همچنین برای به‌هم‌پیوستن مجموعه‌ای از تکرارپذیرها، استفاده از :func:`itertools.chain` را در نظر بگیرید." +msgid "" +"For some use cases, there are good alternatives to :func:`sum`. The preferred, fast way to concatenate a sequence of " +"strings is by calling ``''.join(sequence)``. To add floating-point values with extended precision, " +"see :func:`math.fsum`\\. To concatenate a series of iterables, consider using :func:`itertools.chain`." +msgstr "" +"برای برخی کاربردها، جایگزین‌های مناسبی برای :func:`sum` وجود دارد. روش ترجیحی و سریع برای به‌هم‌چسباندن یک دنباله از " +"رشته‌ها، فراخوانی ``''.join(sequence)`` است. برای جمع کردن اعداد ممیز شناور با دقت بیشتر، به :func:`math.fsum` مراجعه " +"کنید. همچنین برای به‌هم‌پیوستن مجموعه‌ای از پیمایش‌پذیرها، استفاده از :func:`itertools.chain` را در نظر بگیرید." msgid "The *start* parameter can be specified as a keyword argument." msgstr "پارامتر *start* را می‌توان به‌صورت آرگومان کلیدواژه‌ای مشخص کرد." -msgid "Summation of floats switched to an algorithm that gives higher accuracy and better commutativity on most builds." -msgstr "الگوریتم جمع اعداد ممیز شناور به الگوریتمی تغییر یافته است که در بیشتر نسخه‌های ساخت (buildها)، دقت بیشتر و جابجاپذیری بهتری فراهم می‌کند." +msgid "" +"Summation of floats switched to an algorithm that gives higher accuracy and better commutativity on most builds." +msgstr "" +"الگوریتم جمع اعداد ممیز شناور به الگوریتمی تغییر یافته است که در بیشتر نسخه‌های ساخت (buildها)، دقت بیشتر و " +"جابجاپذیری بهتری فراهم می‌کند." msgid "Added specialization for summation of complexes, using same algorithm as for summation of floats." msgstr "بهینه‌سازی ویژه‌ای برای جمع اعداد مختلط، با استفاده از همان الگوریتم جمع اعداد اعشاری، اضافه شد." -msgid "Return a proxy object that delegates method calls to a parent or sibling class of *type*. This is useful for accessing inherited methods that have been overridden in a class." -msgstr "یک شیء واسط را برمی‌گرداند که فراخوانی متدها را به یک کلاس والد یا هم‌ردهٔ *type* واگذار می‌کند. این قابلیت برای دسترسی به متدهای به‌ارث‌رسیده‌ای که در یک کلاس بازنویسی شده‌اند، مفید است." +msgid "" +"Return a proxy object that delegates method calls to a parent or sibling class of *type*. This is useful for " +"accessing inherited methods that have been overridden in a class." +msgstr "" +"یک شیء واسط را برمی‌گرداند که فراخوانی متدها را به یک کلاس والد یا هم‌رده‌ی *type* واگذار می‌کند. این قابلیت برای دسترسی " +"به متدهای به‌ارث‌رسیده‌ای که در یک کلاس بازنویسی شده‌اند، مفید است." -msgid "The *object_or_type* determines the :term:`method resolution order` to be searched. The search starts from the class right after the *type*." -msgstr "*object_or_type* ترتیب :term:`حل متد ` را که باید جست‌وجو شود تعیین می‌کند. جست‌وجو از کلاسی که بلافاصله پس از *type* قرار دارد آغاز می‌شود." +msgid "" +"The *object_or_type* determines the :term:`method resolution order` to be searched. The search starts from the " +"class right after the *type*." +msgstr "" +"*object_or_type* ترتیب :term:`حل متد ` را که باید جست‌وجو شود تعیین می‌کند. جست‌وجو از کلاسی " +"که بلافاصله پس از *type* قرار دارد آغاز می‌شود." -msgid "For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -> A -> object`` and the value of *type* is ``B``, then :func:`super` searches ``C -> A -> object``." -msgstr "برای مثال، اگر :attr:`~type.__mro__` مربوط به *object_or_type* برابر با ``D -> B -> C -> A -> object`` باشد و مقدار *type* برابر ``B`` باشد، در این صورت :func:`super` در مسیر ``C -> A -> object`` جست‌وجو می‌کند." +msgid "" +"For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -> A -> object`` and the value of *type* " +"is ``B``, then :func:`super` searches ``C -> A -> object``." +msgstr "" +"برای مثال، اگر :attr:`~type.__mro__` مربوط به *object_or_type* برابر با ``D -> B -> C -> A -> object`` باشد و مقدار " +"*type* برابر ``B`` باشد، در این صورت :func:`super` در مسیر ``C -> A -> object`` جست‌وجو می‌کند." -msgid "The :attr:`~type.__mro__` attribute of the class corresponding to *object_or_type* lists the method resolution search order used by both :func:`getattr` and :func:`super`. The attribute is dynamic and can change whenever the inheritance hierarchy is updated." -msgstr "ویژگی :attr:`~type.__mro__` کلاس متناظر با *object_or_type* ترتیب جست‌وجوی حل متد را که هم توسط :func:`getattr` و هم توسط :func:`super` استفاده می‌شود، فهرست می‌کند. این ویژگی پویا است و هر زمان که سلسله‌مراتب وراثت تغییر کند، ممکن است تغییر یابد." +msgid "" +"The :attr:`~type.__mro__` attribute of the class corresponding to *object_or_type* lists the method resolution " +"search order used by both :func:`getattr` and :func:`super`. The attribute is dynamic and can change whenever the " +"inheritance hierarchy is updated." +msgstr "" +"ویژگی :attr:`~type.__mro__` کلاس متناظر با *object_or_type* ترتیب جست‌وجوی حل متد را که هم توسط :func:`getattr` و هم " +"توسط :func:`super` استفاده می‌شود، فهرست می‌کند. این ویژگی پویا است و هر زمان که سلسله‌مراتب وراثت تغییر کند، ممکن است " +"تغییر یابد." -msgid "If the second argument is omitted, the super object returned is unbound. If the second argument is an object, ``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true (this is useful for classmethods)." -msgstr "اگر آرگومان دوم حذف شود، شیء super بازگردانده‌شده بدون اتصال (unbound) خواهد بود. اگر آرگومان دوم یک شیء باشد، باید ``isinstance(obj, type)`` برقرار باشد. اگر آرگومان دوم یک نوع (type) باشد، باید ``issubclass(type2, type)`` برقرار باشد (این مورد برای متدهای کلاس مفید است)." +msgid "" +"If the second argument is omitted, the super object returned is unbound. If the second argument is an object, " +"``isinstance(obj, type)`` must be true. If the second argument is a type, ``issubclass(type2, type)`` must be true " +"(this is useful for classmethods)." +msgstr "" +"اگر آرگومان دوم حذف شود، شیء super بازگردانده‌شده بدون اتصال (unbound) خواهد بود. اگر آرگومان دوم یک شیء باشد، باید " +"``isinstance(obj, type)`` برقرار باشد. اگر آرگومان دوم یک نوع (type) باشد، باید ``issubclass(type2, type)`` برقرار " +"باشد (این مورد برای متدهای کلاس مفید است)." -msgid "When called directly within an ordinary method of a class, both arguments may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will be the enclosing class, and *obj* will be the first argument of the immediately enclosing function (typically ``self``). (This means that zero-argument :func:`!super` will not work as expected within nested functions, including generator expressions, which implicitly create nested functions.)" -msgstr "هنگامی که این تابع مستقیماً درون یک متد معمولیِ یک کلاس فراخوانی شود، هر دو آرگومان را می‌توان حذف کرد («:func:`!super` بدون آرگومان»). در این حالت، *type* همان کلاسِ محصورکننده خواهد بود و *obj* اولین آرگومانِ تابعِ بلافاصله محصورکننده (معمولاً ``self``) خواهد بود. (این بدان معناست که :func:`!super` بدون آرگومان در توابع تو‌در‌تو، از جمله عبارت‌های تولیدگر که به‌طور ضمنی توابع تو‌در‌تو ایجاد می‌کنند، مطابق انتظار عمل نخواهد کرد.)" +msgid "" +"When called directly within an ordinary method of a class, both arguments may be omitted (\"zero-argument :func:`!" +"super`\"). In this case, *type* will be the enclosing class, and *obj* will be the first argument of the immediately " +"enclosing function (typically ``self``). (This means that zero-argument :func:`!super` will not work as expected " +"within nested functions, including generator expressions, which implicitly create nested functions.)" +msgstr "" +"هنگامی که این تابع مستقیماً درون یک متد معمولیِ یک کلاس فراخوانی شود، هر دو آرگومان را می‌توان حذف کرد («:func:`!super` " +"بدون آرگومان»). در این حالت، *type* همان کلاسِ محصورکننده خواهد بود و *obj* اولین آرگومانِ تابعِ بلافاصله محصورکننده " +"(معمولاً ``self``) خواهد بود. (این بدان معناست که :func:`!super` بدون آرگومان در توابع تودرتو، از جمله عبارت‌های " +"تولیدگر که به‌طور ضمنی توابع تودرتو ایجاد می‌کنند، مطابق انتظار عمل نخواهد کرد.)" -msgid "There are two typical use cases for *super*. In a class hierarchy with single inheritance, *super* can be used to refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely parallels the use of *super* in other programming languages." -msgstr "دو کاربرد متداول برای *super* وجود دارد. در سلسله‌مراتب کلاسی با وراثت تکی، می‌توان از *super* برای ارجاع به کلاس‌های والد بدون نام بردن صریح از آن‌ها استفاده کرد و در نتیجه نگهداری کد را آسان‌تر ساخت. این کاربرد بسیار مشابه استفاده از *super* در سایر زبان‌های برنامه‌نویسی است." +msgid "" +"There are two typical use cases for *super*. In a class hierarchy with single inheritance, *super* can be used to " +"refer to parent classes without naming them explicitly, thus making the code more maintainable. This use closely " +"parallels the use of *super* in other programming languages." +msgstr "" +"دو کاربرد متداول برای *super* وجود دارد. در سلسله‌مراتب کلاسی با وراثت تکی، می‌توان از *super* برای ارجاع به کلاس‌های " +"والد بدون نام بردن صریح از آن‌ها استفاده کرد و در نتیجه نگهداری کد را آسان‌تر ساخت. این کاربرد بسیار مشابه استفاده از " +"*super* در سایر زبان‌های برنامه‌نویسی است." -msgid "The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use case is unique to Python and is not found in statically compiled languages or languages that only support single inheritance. This makes it possible to implement \"diamond diagrams\" where multiple base classes implement the same method. Good design dictates that such implementations have the same calling signature in every case (because the order of calls is determined at runtime, because that order adapts to changes in the class hierarchy, and because that order can include sibling classes that are unknown prior to runtime)." -msgstr "کاربرد متداول دوم، پشتیبانی از وراثت چندگانهٔ مشارکتی در یک محیط اجرای پویا است. این کاربرد مختص پایتون است و در زبان‌های کامپایل‌شوندهٔ ایستا یا زبان‌هایی که فقط از وراثت تکی پشتیبانی می‌کنند وجود ندارد. این قابلیت امکان پیاده‌سازی «الگوهای الماسی» را فراهم می‌کند؛ جایی که چندین کلاس پایه یک متد یکسان را پیاده‌سازی می‌کنند. طراحی مناسب ایجاب می‌کند که چنین پیاده‌سازی‌هایی در همهٔ موارد امضای فراخوانی یکسانی داشته باشند (زیرا ترتیب فراخوانی‌ها در زمان اجرا تعیین می‌شود، با تغییرات سلسله‌مراتب کلاس تطبیق می‌یابد و ممکن است شامل کلاس‌های هم‌سطحی باشد که پیش از زمان اجرا ناشناخته هستند)." +msgid "" +"The second use case is to support cooperative multiple inheritance in a dynamic execution environment. This use " +"case is unique to Python and is not found in statically compiled languages or languages that only support single " +"inheritance. This makes it possible to implement \"diamond diagrams\" where multiple base classes implement the " +"same method. Good design dictates that such implementations have the same calling signature in every case (because " +"the order of calls is determined at runtime, because that order adapts to changes in the class hierarchy, and " +"because that order can include sibling classes that are unknown prior to runtime)." +msgstr "" +"کاربرد متداول دوم، پشتیبانی از وراثت چندگانه‌ی مشارکتی در یک محیط اجرای پویا است. این کاربرد مختص پایتون است و در " +"زبان‌های کامپایل‌شونده‌ی ایستا یا زبان‌هایی که فقط از وراثت تکی پشتیبانی می‌کنند وجود ندارد. این قابلیت امکان پیاده‌سازی " +"«الگوهای الماسی» را فراهم می‌کند؛ جایی که چندین کلاس پایه یک متد یکسان را پیاده‌سازی می‌کنند. طراحی مناسب ایجاب می‌کند " +"که چنین پیاده‌سازی‌هایی در همه‌ی موارد امضای فراخوانی یکسانی داشته باشند (زیرا ترتیب فراخوانی‌ها در ران‌تایم تعیین می‌شود، " +"با تغییرات سلسله‌مراتب کلاس تطبیق می‌یابد و ممکن است شامل کلاس‌های هم‌سطحی باشد که پیش از ران‌تایم ناشناخته هستند)." msgid "For both use cases, a typical superclass call looks like this::" msgstr "در هر دو مورد استفاده، یک فراخوانی معمول به ابرکلاس به صورت زیر است::" @@ -1601,32 +2795,80 @@ msgstr "" " super().method(arg) # This does the same thing as:\n" " # super(C, self).method(arg)" -msgid "In addition to method lookups, :func:`super` also works for attribute lookups. One possible use case for this is calling :term:`descriptors ` in a parent or sibling class." -msgstr "علاوه بر جست‌وجوی متدها، :func:`super` برای جست‌وجوی ویژگی‌ها نیز عمل می‌کند. یکی از کاربردهای ممکن آن، فراخوانی :term:`توصیفگرها ` در یک کلاس والد یا هم‌رده است." +msgid "" +"In addition to method lookups, :func:`super` also works for attribute lookups. One possible use case for this is " +"calling :term:`descriptors ` in a parent or sibling class." +msgstr "" +"علاوه بر جست‌وجوی متدها، :func:`super` برای جست‌وجوی ویژگی‌ها نیز عمل می‌کند. یکی از کاربردهای ممکن آن، " +"فراخوانی :term:`توصیف‌گرها ` در یک کلاس والد یا هم‌رده است." -msgid "Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. It does so by implementing its own :meth:`~object.__getattribute__` method for searching classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` is undefined for implicit lookups using statements or operators such as ``super()[name]``." -msgstr "توجه داشته باشید که :func:`super` به‌عنوان بخشی از فرایند اتصال برای جست‌وجوی صریح ویژگی‌ها با نماد نقطه، مانند ``super().__getitem__(name)``, پیاده‌سازی شده است. این کار از طریق پیاده‌سازی متد :meth:`~object.__getattribute__` خودش انجام می‌شود تا کلاس‌ها را با ترتیبی قابل پیش‌بینی جست‌وجو کند؛ ترتیبی که از وراثت چندگانهٔ مشارکتی (cooperative multiple inheritance) پشتیبانی می‌کند. بر این اساس، رفتار :func:`super` برای جست‌وجوهای ضمنی که با دستورها یا عملگرهایی مانند ``super()[name]`` انجام می‌شوند، تعریف نشده است." +msgid "" +"Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as " +"``super().__getitem__(name)``. It does so by implementing its own :meth:`~object.__getattribute__` method for " +"searching classes in a predictable order that supports cooperative multiple inheritance. Accordingly, :func:`super` " +"is undefined for implicit lookups using statements or operators such as ``super()[name]``." +msgstr "" +"توجه داشته باشید که :func:`super` به‌عنوان بخشی از فرایند اتصال برای جست‌وجوی صریح ویژگی‌ها با نماد نقطه، مانند " +"``super().__getitem__(name)``, پیاده‌سازی شده است. این کار از طریق پیاده‌سازی متد :meth:`~object.__getattribute__` " +"خودش انجام می‌شود تا کلاس‌ها را با ترتیبی قابل پیش‌بینی جست‌وجو کند؛ ترتیبی که از وراثت چندگانه‌ی مشارکتی (cooperative " +"multiple inheritance) پشتیبانی می‌کند. بر این اساس، رفتار :func:`super` برای جست‌وجوهای ضمنی که با دستورها یا " +"عملگرهایی مانند ``super()[name]`` انجام می‌شوند، تعریف نشده است." -msgid "Also note that, aside from the zero argument form, :func:`super` is not limited to use inside methods. The two argument form specifies the arguments exactly and makes the appropriate references. The zero argument form only works inside a class definition, as the compiler fills in the necessary details to correctly retrieve the class being defined, as well as accessing the current instance for ordinary methods." -msgstr "همچنین توجه داشته باشید که، به‌جز حالت بدون آرگومان، :func:`super` محدود به استفاده درون متدها نیست. شکل دوآرگومانی، آرگومان‌ها را دقیقاً همان‌گونه که داده شده‌اند استفاده کرده و ارجاعات مناسب را ایجاد می‌کند. شکل بدون آرگومان فقط درون تعریف یک کلاس کار می‌کند، زیرا کامپایلر جزئیات لازم را برای بازیابی صحیح کلاس در حال تعریف و همچنین دسترسی به نمونهٔ فعلی در متدهای معمولی به‌طور خودکار فراهم می‌کند." +msgid "" +"Also note that, aside from the zero argument form, :func:`super` is not limited to use inside methods. The two " +"argument form specifies the arguments exactly and makes the appropriate references. The zero argument form only " +"works inside a class definition, as the compiler fills in the necessary details to correctly retrieve the class " +"being defined, as well as accessing the current instance for ordinary methods." +msgstr "" +"همچنین توجه داشته باشید که، به‌جز حالت بدون آرگومان، :func:`super` محدود به استفاده درون متدها نیست. شکل دوآرگومانی، " +"آرگومان‌ها را دقیقاً همان‌گونه که داده شده‌اند استفاده کرده و ارجاعات مناسب را ایجاد می‌کند. شکل بدون آرگومان فقط درون " +"تعریف یک کلاس کار می‌کند، زیرا کامپایلر جزئیات لازم را برای بازیابی صحیح کلاس در حال تعریف و همچنین دسترسی به نمونه‌ی " +"فعلی در متدهای معمولی به‌طور خودکار فراهم می‌کند." -msgid "For practical suggestions on how to design cooperative classes using :func:`super`, see `guide to using super() `_." -msgstr "برای پیشنهادهای کاربردی دربارهٔ طراحی کلاس‌های مشارکتی با استفاده از :func:`super`، به `راهنمای استفاده از super() `_ مراجعه کنید." +msgid "" +"For practical suggestions on how to design cooperative classes using :func:`super`, see `guide to using super() " +"`_." +msgstr "" +"برای پیشنهادهای کاربردی درباره‌ی طراحی کلاس‌های مشارکتی با استفاده از :func:`super`، به `راهنمای استفاده از super() " +"`_ مراجعه کنید." msgid ":class:`super` objects are now :mod:`pickleable ` and :mod:`copyable `." msgstr "اکنون اشیای :class:`super` از :mod:`سریال‌سازی با pickle ` و :mod:`کپی شدن ` پشتیبانی می‌کنند." -msgid "Rather than being a function, :class:`tuple` is actually an immutable sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." -msgstr ":class:`tuple` در واقع یک نوع دنبالهٔ تغییرناپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-tuple` و :ref:`typesseq` مستند شده است." +msgid "" +"Rather than being a function, :class:`tuple` is actually an immutable sequence type, as documented in :ref:`typesseq-" +"tuple` and :ref:`typesseq`." +msgstr "" +":class:`tuple` در واقع یک نوع دنباله‌ی تغییرناپذیر است، نه یک تابع؛ همان‌گونه که در :ref:`typesseq-tuple` " +"و :ref:`typesseq` مستند شده است." -msgid "With one argument, return the type of an *object*. The return value is a type object and generally the same object as returned by :attr:`object.__class__`." -msgstr "در صورت ارسال یک آرگومان، نوعِ یک *object* را بازمی‌گرداند. مقدار بازگشتی یک شیء از نوع type است و معمولاً همان شی‌ءای است که توسط :attr:`object.__class__` بازگردانده می‌شود." +msgid "" +"With one argument, return the type of an *object*. The return value is a type object and generally the same object " +"as returned by :attr:`object.__class__`." +msgstr "" +"در صورت ارسال یک آرگومان، نوعِ یک *object* را بازمی‌گرداند. مقدار بازگشتی یک شیء از نوع type است و معمولاً همان شی‌ءای " +"است که توسط :attr:`object.__class__` بازگردانده می‌شود." -msgid "The :func:`isinstance` built-in function is recommended for testing the type of an object, because it takes subclasses into account." -msgstr "برای بررسی نوع یک شیء، استفاده از تابع توکار :func:`isinstance` توصیه می‌شود، زیرا زیرکلاس‌ها را نیز در نظر می‌گیرد." +msgid "" +"The :func:`isinstance` built-in function is recommended for testing the type of an object, because it takes " +"subclasses into account." +msgstr "" +"برای بررسی نوع یک شیء، استفاده از تابع توکار :func:`isinstance` توصیه می‌شود، زیرا زیرکلاس‌ها را نیز در نظر می‌گیرد." -msgid "With three arguments, return a new type object. This is essentially a dynamic form of the :keyword:`class` statement. The *name* string is the class name and becomes the :attr:`~type.__name__` attribute. The *bases* tuple contains the base classes and becomes the :attr:`~type.__bases__` attribute; if empty, :class:`object`, the ultimate base of all classes, is added. The *dict* dictionary contains attribute and method definitions for the class body; it may be copied or wrapped before becoming the :attr:`~type.__dict__` attribute. The following two statements create identical :class:`!type` objects:" -msgstr "در صورت ارسال سه آرگومان، یک شیء type جدید بازمی‌گرداند. این در واقع شکل پویای دستور :keyword:`class` است. رشتهٔ *name* نام کلاس را مشخص می‌کند و به ویژگی :attr:`~type.__name__` تبدیل می‌شود. تاپل *bases* کلاس‌های پایه را در خود نگه می‌دارد و به ویژگی :attr:`~type.__bases__` تبدیل می‌شود؛ اگر خالی باشد، :class:`object`، که کلاس پایهٔ نهایی همهٔ کلاس‌ها است، به آن افزوده می‌شود. دیکشنری *dict* شامل تعریف ویژگی‌ها و متدهای بدنهٔ کلاس است؛ این دیکشنری ممکن است پیش از تبدیل شدن به ویژگی :attr:`~type.__dict__` کپی یا در یک wrapper قرار داده شود. دو دستور زیر اشیای :class:`!type` یکسانی ایجاد می‌کنند:" +msgid "" +"With three arguments, return a new type object. This is essentially a dynamic form of the :keyword:`class` " +"statement. The *name* string is the class name and becomes the :attr:`~type.__name__` attribute. The *bases* tuple " +"contains the base classes and becomes the :attr:`~type.__bases__` attribute; if empty, :class:`object`, the ultimate " +"base of all classes, is added. The *dict* dictionary contains attribute and method definitions for the class body; " +"it may be copied or wrapped before becoming the :attr:`~type.__dict__` attribute. The following two statements " +"create identical :class:`!type` objects:" +msgstr "" +"در صورت ارسال سه آرگومان، یک شیء type جدید بازمی‌گرداند. این در واقع شکل پویای دستور :keyword:`class` است. رشته‌ی " +"*name* نام کلاس را مشخص می‌کند و به ویژگی :attr:`~type.__name__` تبدیل می‌شود. تاپل *bases* کلاس‌های پایه را در خود نگه " +"می‌دارد و به ویژگی :attr:`~type.__bases__` تبدیل می‌شود؛ اگر خالی باشد، :class:`object`، که کلاس پایه‌ی نهایی همه‌ی " +"کلاس‌ها است، به آن افزوده می‌شود. دیکشنری *dict* شامل تعریف ویژگی‌ها و متدهای بدنه‌ی کلاس است؛ این دیکشنری ممکن است پیش " +"از تبدیل شدن به ویژگی :attr:`~type.__dict__` کپی یا در یک wrapper قرار داده شود. دو دستور زیر اشیای :class:`!type` " +"یکسانی ایجاد می‌کنند:" msgid "See also:" msgstr "همچنین ببینید:" @@ -1637,35 +2879,65 @@ msgstr ":ref:`مستندات ویژگی‌ها و متدهای کلاس‌ها < msgid ":ref:`bltin-type-objects`" msgstr ":ref:`bltin-type-objects`" -msgid "Keyword arguments provided to the three argument form are passed to the appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) in the same way that keywords in a class definition (besides *metaclass*) would." -msgstr "آرگومان‌های کلیدواژه‌ای که به شکل سه‌آرگومانی ارسال می‌شوند، همانند کلیدواژه‌های موجود در تعریف یک کلاس (به‌جز *فراکلاس*) به سازوکار مناسب فراداده (معمولاً :meth:`~object.__init_subclass__`) ارسال می‌شوند." +msgid "" +"Keyword arguments provided to the three argument form are passed to the appropriate metaclass machinery " +"(usually :meth:`~object.__init_subclass__`) in the same way that keywords in a class definition (besides " +"*metaclass*) would." +msgstr "" +"آرگومان‌های کلیدواژه‌ای که به شکل سه‌آرگومانی ارسال می‌شوند، همانند کلیدواژه‌های موجود در تعریف یک کلاس (به‌جز *فراکلاس*) " +"به سازوکار مناسب فراداده (معمولاً :meth:`~object.__init_subclass__`) ارسال می‌شوند." -msgid "Unlike a :keyword:`class` statement, the three argument form does not call the metaclass ``__prepare__`` method (see :ref:`prepare`). Use :func:`types.new_class` to dynamically create a class using the appropriate metaclass." -msgstr "برخلاف دستور :keyword:`class`، فرم سه‌آرگومانی متد ``__prepare__`` فراکلاس را فراخوانی نمی‌کند (به :ref:`prepare` مراجعه کنید). برای ایجاد پویای یک کلاس با استفاده از فراکلاس مناسب، از :func:`types.new_class` استفاده کنید." +msgid "" +"Unlike a :keyword:`class` statement, the three argument form does not call the metaclass ``__prepare__`` method " +"(see :ref:`prepare`). Use :func:`types.new_class` to dynamically create a class using the appropriate metaclass." +msgstr "" +"برخلاف دستور :keyword:`class`، فرم سه‌آرگومانی متد ``__prepare__`` فراکلاس را فراخوانی نمی‌کند (به :ref:`prepare` " +"مراجعه کنید). برای ایجاد پویای یک کلاس با استفاده از فراکلاس مناسب، از :func:`types.new_class` استفاده کنید." msgid "See also :ref:`class-customization`." msgstr "همچنین به :ref:`class-customization` مراجعه کنید." -msgid "Subclasses of :class:`!type` which don't override ``type.__new__`` may no longer use the one-argument form to get the type of an object." -msgstr "زیرکلاس‌های :class:`!type` که ``type.__new__`` را بازنویسی نمی‌کنند، دیگر نمی‌توانند از شکل تک‌آرگومانی برای دریافت نوع یک شیء استفاده کنند." +msgid "" +"Subclasses of :class:`!type` which don't override ``type.__new__`` may no longer use the one-argument form to get " +"the type of an object." +msgstr "" +"زیرکلاس‌های :class:`!type` که ``type.__new__`` را بازنویسی نمی‌کنند، دیگر نمی‌توانند از شکل تک‌آرگومانی برای دریافت نوع " +"یک شیء استفاده کنند." -msgid "Return the :attr:`~object.__dict__` attribute for a module, class, instance, or any other object with a :attr:`!__dict__` attribute." -msgstr "ویژگی :attr:`~object.__dict__` یک ماژول، کلاس، نمونه یا هر شیء دیگری که دارای ویژگی :attr:`!__dict__` باشد را برمی‌گرداند." +msgid "" +"Return the :attr:`~object.__dict__` attribute for a module, class, instance, or any other object with a :attr:`!" +"__dict__` attribute." +msgstr "" +"ویژگی :attr:`~object.__dict__` یک ماژول، کلاس، نمونه یا هر شیء دیگری که دارای ویژگی :attr:`!__dict__` باشد را " +"برمی‌گرداند." -msgid "Objects such as modules and instances have an updateable :attr:`~object.__dict__` attribute; however, other objects may have write restrictions on their :attr:`!__dict__` attributes (for example, classes use a :class:`types.MappingProxyType` to prevent direct dictionary updates)." -msgstr "اشیایی مانند ماژول‌ها و نمونه‌ها دارای ویژگی :attr:`~object.__dict__` قابل‌به‌روزرسانی هستند؛ با این حال، برخی اشیای دیگر ممکن است محدودیت‌هایی برای نوشتن در ویژگی :attr:`!__dict__` خود داشته باشند (برای مثال، کلاس‌ها از :class:`types.MappingProxyType` برای جلوگیری از به‌روزرسانی مستقیم دیکشنری استفاده می‌کنند)." +msgid "" +"Objects such as modules and instances have an updateable :attr:`~object.__dict__` attribute; however, other objects " +"may have write restrictions on their :attr:`!__dict__` attributes (for example, classes use " +"a :class:`types.MappingProxyType` to prevent direct dictionary updates)." +msgstr "" +"اشیایی مانند ماژول‌ها و نمونه‌ها دارای ویژگی :attr:`~object.__dict__` قابل‌به‌روزرسانی هستند؛ با این حال، برخی اشیای " +"دیگر ممکن است محدودیت‌هایی برای نوشتن در ویژگی :attr:`!__dict__` خود داشته باشند (برای مثال، کلاس‌ها " +"از :class:`types.MappingProxyType` برای جلوگیری از به‌روزرسانی مستقیم دیکشنری استفاده می‌کنند)." msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "در صورت نداشتن آرگومان، :func:`vars` همانند :func:`locals` عمل می‌کند." -msgid "A :exc:`TypeError` exception is raised if an object is specified but it doesn't have a :attr:`~object.__dict__` attribute (for example, if its class defines the :attr:`~object.__slots__` attribute)." -msgstr "اگر شی‌ءای مشخص شود اما دارای ویژگی :attr:`~object.__dict__` نباشد (برای مثال، اگر کلاس آن ویژگی :attr:`~object.__slots__` را تعریف کرده باشد)، استثنای :exc:`TypeError` پرتاب می‌شود." +msgid "" +"A :exc:`TypeError` exception is raised if an object is specified but it doesn't have a :attr:`~object.__dict__` " +"attribute (for example, if its class defines the :attr:`~object.__slots__` attribute)." +msgstr "" +"اگر شی‌ءای مشخص شود اما دارای ویژگی :attr:`~object.__dict__` نباشد (برای مثال، اگر کلاس آن " +"ویژگی :attr:`~object.__slots__` را تعریف کرده باشد)، استثنای :exc:`TypeError` پرتاب می‌شود." -msgid "The result of calling this function without an argument has been updated as described for the :func:`locals` builtin." -msgstr "نتیجهٔ فراخوانی این تابع بدون آرگومان، مطابق توضیحات ارائه‌شده برای تابع توکار :func:`locals` به‌روزرسانی شده است." +msgid "" +"The result of calling this function without an argument has been updated as described for the :func:`locals` builtin." +msgstr "" +"نتیجه‌ی فراخوانی این تابع بدون آرگومان، مطابق توضیحات ارائه‌شده برای تابع توکار :func:`locals` به‌روزرسانی شده است." msgid "Iterate over several iterables in parallel, producing tuples with an item from each one." -msgstr "روی چندین تکرارپذیر به‌طور هم‌زمان پیمایش می‌کند و تاپل‌هایی تولید می‌کند که هر یک شامل یک عنصر از هر تکرارپذیر هستند." +msgstr "" +"روی چندین پیمایش‌پذیر به‌طور همزمان پیمایش می‌کند و تاپل‌هایی تولید می‌کند که هر یک شامل یک عنصر از هر پیمایش‌پذیر هستند." msgid "Example::" msgstr "مثال::" @@ -1685,20 +2957,42 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -msgid "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from each of the argument iterables." -msgstr "به‌طور دقیق‌تر، :func:`zip` یک تکرارگر از تاپل‌ها برمی‌گرداند که در آن، تاپل *i*\\ ام شامل عنصر *i*\\ ام از هر یک از تکرارپذیرهای آرگومان‌ها است." +msgid "" +"More formally: :func:`zip` returns an iterator of tuples, where the *i*-th tuple contains the *i*-th element from " +"each of the argument iterables." +msgstr "" +"به‌طور دقیق‌تر، :func:`zip` یک پیمایش‌گر از تاپل‌ها برمی‌گرداند که در آن، تاپل *i*\\ ام شامل عنصر *i*\\ ام از هر یک از " +"پیمایش‌پذیرهای آرگومان‌ها است." -msgid "Another way to think of :func:`zip` is that it turns rows into columns, and columns into rows. This is similar to `transposing a matrix `_." -msgstr "راه دیگری برای درک :func:`zip` این است که سطرها را به ستون‌ها و ستون‌ها را به سطرها تبدیل می‌کند. این کار مشابه `ترانهادهٔ یک ماتریس `_ است." +msgid "" +"Another way to think of :func:`zip` is that it turns rows into columns, and columns into rows. This is similar to " +"`transposing a matrix `_." +msgstr "" +"راه دیگری برای درک :func:`zip` این است که ردیفها را به ستون‌ها و ستون‌ها را به ردیفها تبدیل می‌کند. این کار مشابه " +"`ترانهاده‌ی یک ماتریس `_ است." -msgid ":func:`zip` is lazy: The elements won't be processed until the iterable is iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:`list`." -msgstr ":func:`zip` تنبل است؛ عناصر تا زمانی که روی تکرارپذیر پیمایش انجام نشود، پردازش نمی‌شوند؛ برای مثال، با یک حلقهٔ :keyword:`!for` یا با قرار دادن آن در :class:`list`." +msgid "" +":func:`zip` is lazy: The elements won't be processed until the iterable is iterated on, e.g. by a :keyword:`!for` " +"loop or by wrapping in a :class:`list`." +msgstr "" +":func:`zip` تنبل است؛ عناصر تا زمانی که روی پیمایش‌پذیر پیمایش انجام نشود، پردازش نمی‌شوند؛ برای مثال، با یک " +"حلقه‌ی :keyword:`!for` یا با قرار دادن آن در :class:`list`." -msgid "One thing to consider is that the iterables passed to :func:`zip` could have different lengths; sometimes by design, and sometimes because of a bug in the code that prepared these iterables. Python offers three different approaches to dealing with this issue:" -msgstr "یکی از نکاتی که باید در نظر داشت این است که تکرارپذیرهای ارسال‌شده به :func:`zip` ممکن است طول‌های متفاوتی داشته باشند؛ گاهی این موضوع عمدی است و گاهی به دلیل وجود یک باگ در کدی است که این تکرارپذیرها را آماده کرده است. پایتون سه روش مختلف برای برخورد با این مسئله ارائه می‌دهد:" +msgid "" +"One thing to consider is that the iterables passed to :func:`zip` could have different lengths; sometimes by design, " +"and sometimes because of a bug in the code that prepared these iterables. Python offers three different approaches " +"to dealing with this issue:" +msgstr "" +"یکی از نکاتی که باید در نظر داشت این است که پیمایش‌پذیرهای ارسال‌شده به :func:`zip` ممکن است طول‌های متفاوتی داشته " +"باشند؛ گاهی این موضوع عمدی است و گاهی به دلیل وجود یک باگ در کدی است که این پیمایش‌پذیرها را آماده کرده است. پایتون " +"سه روش مختلف برای برخورد با این مسئله ارائه می‌دهد:" -msgid "By default, :func:`zip` stops when the shortest iterable is exhausted. It will ignore the remaining items in the longer iterables, cutting off the result to the length of the shortest iterable::" -msgstr "به‌طور پیش‌فرض، :func:`zip` زمانی متوقف می‌شود که کوتاه‌ترین تکرارپذیر به پایان برسد. در این حالت، عناصر باقی‌مانده در تکرارپذیرهای بلندتر نادیده گرفته می‌شوند و طول نتیجه برابر با طول کوتاه‌ترین تکرارپذیر خواهد بود::" +msgid "" +"By default, :func:`zip` stops when the shortest iterable is exhausted. It will ignore the remaining items in the " +"longer iterables, cutting off the result to the length of the shortest iterable::" +msgstr "" +"به‌طور پیش‌فرض، :func:`zip` زمانی متوقف می‌شود که کوتاه‌ترین پیمایش‌پذیر به پایان برسد. در این حالت، عناصر باقی‌مانده در " +"پیمایش‌پذیرهای بلندتر نادیده گرفته می‌شوند و طول نتیجه برابر با طول کوتاه‌ترین پیمایش‌پذیر خواهد بود::" msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" @@ -1707,8 +3001,12 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -msgid ":func:`zip` is often used in cases where the iterables are assumed to be of equal length. In such cases, it's recommended to use the ``strict=True`` option. Its output is the same as regular :func:`zip`::" -msgstr "از :func:`zip` اغلب در مواردی استفاده می‌شود که فرض بر این است تکرارپذیرها طول یکسانی دارند. در چنین مواردی، توصیه می‌شود از گزینهٔ ``strict=True`` استفاده کنید. خروجی آن با :func:`zip` معمولی یکسان است::" +msgid "" +":func:`zip` is often used in cases where the iterables are assumed to be of equal length. In such cases, it's " +"recommended to use the ``strict=True`` option. Its output is the same as regular :func:`zip`::" +msgstr "" +"از :func:`zip` اغلب در مواردی استفاده می‌شود که فرض بر این است پیمایش‌پذیرها طول یکسانی دارند. در چنین مواردی، توصیه " +"می‌شود از گزینه‌ی ``strict=True`` استفاده کنید. خروجی آن با :func:`zip` معمولی یکسان است::" msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" @@ -1718,22 +3016,42 @@ msgstr "" "[('a', 1), ('b', 2), ('c', 3)]" msgid "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable is exhausted before the others:" -msgstr "برخلاف رفتار پیش‌فرض، اگر یکی از تکرارپذیرها پیش از بقیه به پایان برسد، استثنای :exc:`ValueError` پرتاب می‌کند:" +msgstr "برخلاف رفتار پیش‌فرض، اگر یکی از پیمایش‌پذیرها پیش از بقیه به پایان برسد، استثنای :exc:`ValueError` پرتاب می‌کند:" -msgid "Without the ``strict=True`` argument, any bug that results in iterables of different lengths will be silenced, possibly manifesting as a hard-to-find bug in another part of the program." -msgstr "بدون آرگومان ``strict=True``، هر اشکالی که باعث شود تکرارشونده‌ها طول‌های متفاوتی داشته باشند، بی‌صدا نادیده گرفته می‌شود و ممکن است در بخش دیگری از برنامه به‌صورت یک باگ دشوار برای یافتن ظاهر شود." +msgid "" +"Without the ``strict=True`` argument, any bug that results in iterables of different lengths will be silenced, " +"possibly manifesting as a hard-to-find bug in another part of the program." +msgstr "" +"بدون آرگومان ``strict=True``، هر اشکالی که باعث شود تکرارشونده‌ها طول‌های متفاوتی داشته باشند، بی‌صدا نادیده گرفته " +"می‌شود و ممکن است در بخش دیگری از برنامه به‌صورت یک باگ دشوار برای یافتن ظاهر شود." -msgid "Shorter iterables can be padded with a constant value to make all the iterables have the same length. This is done by :func:`itertools.zip_longest`." -msgstr "می‌توان تکرارپذیرهای کوتاه‌تر را با یک مقدار ثابت پُر کرد تا همهٔ تکرارپذیرها طول یکسانی داشته باشند. این کار توسط :func:`itertools.zip_longest` انجام می‌شود." +msgid "" +"Shorter iterables can be padded with a constant value to make all the iterables have the same length. This is done " +"by :func:`itertools.zip_longest`." +msgstr "" +"می‌توان پیمایش‌پذیرهای کوتاه‌تر را با یک مقدار ثابت پُر کرد تا همه‌ی پیمایش‌پذیرها طول یکسانی داشته باشند. این کار " +"توسط :func:`itertools.zip_longest` انجام می‌شود." -msgid "Edge cases: With a single iterable argument, :func:`zip` returns an iterator of 1-tuples. With no arguments, it returns an empty iterator." -msgstr "حالت‌های خاص: اگر فقط یک آرگومان تکرارپذیر به :func:`zip` داده شود، یک تکرارگر از تاپل‌های تک‌عضوی برمی‌گرداند. اگر هیچ آرگومانی داده نشود، یک تکرارگر خالی برمی‌گرداند." +msgid "" +"Edge cases: With a single iterable argument, :func:`zip` returns an iterator of 1-tuples. With no arguments, it " +"returns an empty iterator." +msgstr "" +"حالت‌های خاص: اگر فقط یک آرگومان پیمایش‌پذیر به :func:`zip` داده شود، یک پیمایش‌گر از تاپل‌های تک‌عضوی برمی‌گرداند. اگر " +"هیچ آرگومانی داده نشود، یک پیمایش‌گر خالی برمی‌گرداند." msgid "Tips and tricks:" msgstr "نکته‌ها و ترفندها:" -msgid "The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a data series into n-length groups using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator ``n`` times so that each output tuple has the result of ``n`` calls to the iterator. This has the effect of dividing the input into n-length chunks." -msgstr "ترتیب ارزیابی تکرارپذیرها از چپ به راست تضمین شده است. این موضوع امکان استفاده از الگوی ``zip(*[iter(s)]*n, strict=True)`` را برای گروه‌بندی یک دنبالهٔ داده به گروه‌هایی با طول n فراهم می‌کند. در این روش، *همان* تکرارگر ``n`` بار تکرار می‌شود تا هر تاپل خروجی حاصل ``n`` فراخوانی از همان تکرارگر باشد. نتیجهٔ این کار تقسیم ورودی به قطعاتی با طول n است." +msgid "" +"The left-to-right evaluation order of the iterables is guaranteed. This makes possible an idiom for clustering a " +"data series into n-length groups using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator ``n`` " +"times so that each output tuple has the result of ``n`` calls to the iterator. This has the effect of dividing the " +"input into n-length chunks." +msgstr "" +"ترتیب ارزیابی پیمایش‌پذیرها از چپ به راست تضمین شده است. این موضوع امکان استفاده از الگوی ``zip(*[iter(s)]*n, " +"strict=True)`` را برای گروه‌بندی یک دنباله‌ی داده به گروه‌هایی با طول n فراهم می‌کند. در این روش، *همان* پیمایش‌گر ``n`` " +"بار تکرار می‌شود تا هر تاپل خروجی حاصل ``n`` فراخوانی از همان پیمایش‌گر باشد. نتیجه‌ی این کار تقسیم ورودی به قطعاتی با " +"طول n است." msgid ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a list::" msgstr "می‌توان از :func:`zip` همراه با عملگر ``*`` برای بازکردن یک فهرست استفاده کرد::" @@ -1758,20 +3076,54 @@ msgstr "" msgid "Added the ``strict`` argument." msgstr "آرگومان ``strict`` اضافه شد." -msgid "This is an advanced function that is not needed in everyday Python programming, unlike :func:`importlib.import_module`." -msgstr "این تابع پیشرفته‌ای است که برخلاف :func:`importlib.import_module` در برنامه‌نویسی روزمرهٔ پایتون معمولاً به آن نیازی نخواهید داشت." +msgid "" +"This is an advanced function that is not needed in everyday Python programming, " +"unlike :func:`importlib.import_module`." +msgstr "" +"این تابع پیشرفته‌ای است که برخلاف :func:`importlib.import_module` در برنامه‌نویسی روزمره‌ی پایتون معمولاً به آن نیازی " +"نخواهید داشت." -msgid "This function is invoked by the :keyword:`import` statement. It can be replaced (by importing the :mod:`builtins` module and assigning to ``builtins.__import__``) in order to change semantics of the :keyword:`!import` statement, but doing so is **strongly** discouraged as it is usually simpler to use import hooks (see :pep:`302`) to attain the same goals and does not cause issues with code which assumes the default import implementation is in use. Direct use of :func:`__import__` is also discouraged in favor of :func:`importlib.import_module`." -msgstr "این تابع توسط دستور :keyword:`import` فراخوانی می‌شود. برای تغییر معنای دستور :keyword:`!import` می‌توان آن را (با وارد کردن ماژول :mod:`builtins` و انتساب به ``builtins.__import__``) جایگزین کرد، اما انجام این کار **اکیداً توصیه نمی‌شود**، زیرا معمولاً استفاده از import hookها (به :pep:`302` مراجعه کنید) برای دستیابی به همان هدف ساده‌تر است و با کدی که فرض می‌کند پیاده‌سازی پیش‌فرض import در حال استفاده است نیز مشکلی ایجاد نمی‌کند. همچنین استفادهٔ مستقیم از :func:`__import__` به نفع :func:`importlib.import_module` توصیه نمی‌شود." +msgid "" +"This function is invoked by the :keyword:`import` statement. It can be replaced (by importing the :mod:`builtins` " +"module and assigning to ``builtins.__import__``) in order to change semantics of the :keyword:`!import` statement, " +"but doing so is **strongly** discouraged as it is usually simpler to use import hooks (see :pep:`302`) to attain the " +"same goals and does not cause issues with code which assumes the default import implementation is in use. Direct " +"use of :func:`__import__` is also discouraged in favor of :func:`importlib.import_module`." +msgstr "" +"این تابع توسط دستور :keyword:`import` فراخوانی می‌شود. برای تغییر معنای دستور :keyword:`!import` می‌توان آن را (با " +"وارد کردن ماژول :mod:`builtins` و انتساب به ``builtins.__import__``) جایگزین کرد، اما انجام این کار **اکیداً توصیه " +"نمی‌شود**، زیرا معمولاً استفاده از import hookها (به :pep:`302` مراجعه کنید) برای دستیابی به همان هدف ساده‌تر است و با " +"کدی که فرض می‌کند پیاده‌سازی پیش‌فرض import در حال استفاده است نیز مشکلی ایجاد نمی‌کند. همچنین استفاده‌ی مستقیم " +"از :func:`__import__` به نفع :func:`importlib.import_module` توصیه نمی‌شود." -msgid "The function imports the module *name*, potentially using the given *globals* and *locals* to determine how to interpret the name in a package context. The *fromlist* gives the names of objects or submodules that should be imported from the module given by *name*. The standard implementation does not use its *locals* argument at all and uses its *globals* only to determine the package context of the :keyword:`import` statement." -msgstr "این تابع ماژول *name* را ایمپورت می‌کند و در صورت نیاز از *globals* و *locals* داده‌شده برای تعیین نحوهٔ تفسیر نام در زمینهٔ یک بسته استفاده می‌کند. آرگومان *fromlist* نام اشیا یا زیرماژول‌هایی را مشخص می‌کند که باید از ماژول مشخص‌شده توسط *name* وارد شوند. پیاده‌سازی استاندارد اصلاً از آرگومان *locals* استفاده نمی‌کند و از *globals* تنها برای تعیین زمینهٔ بسته در دستور :keyword:`import` بهره می‌برد." +msgid "" +"The function imports the module *name*, potentially using the given *globals* and *locals* to determine how to " +"interpret the name in a package context. The *fromlist* gives the names of objects or submodules that should be " +"imported from the module given by *name*. The standard implementation does not use its *locals* argument at all and " +"uses its *globals* only to determine the package context of the :keyword:`import` statement." +msgstr "" +"این تابع ماژول *name* را ایمپورت می‌کند و در صورت نیاز از *globals* و *locals* داده‌شده برای تعیین نحوه‌ی تفسیر نام در " +"زمینه‌ی یک بسته استفاده می‌کند. آرگومان *fromlist* نام اشیا یا زیرماژول‌هایی را مشخص می‌کند که باید از ماژول مشخص‌شده " +"توسط *name* وارد شوند. پیاده‌سازی استاندارد اصلاً از آرگومان *locals* استفاده نمی‌کند و از *globals* تنها برای تعیین " +"زمینه‌ی بسته در دستور :keyword:`import` بهره می‌برد." -msgid "*level* specifies whether to use absolute or relative imports. ``0`` (the default) means only perform absolute imports. Positive values for *level* indicate the number of parent directories to search relative to the directory of the module calling :func:`__import__` (see :pep:`328` for the details)." -msgstr "*level* مشخص می‌کند که از ایمپورت مطلق استفاده شود یا نسبی. مقدار ``0`` (که مقدار پیش‌فرض است) به این معناست که فقط ایمپورت مطلق انجام شود. مقادیر مثبت برای *level* تعداد پوشه‌های والد را مشخص می‌کنند که باید نسبت به پوشهٔ ماژولی که :func:`__import__` را فراخوانی کرده است جست‌وجو شوند (برای جزئیات، :pep:`328` را ببینید)." +msgid "" +"*level* specifies whether to use absolute or relative imports. ``0`` (the default) means only perform absolute " +"imports. Positive values for *level* indicate the number of parent directories to search relative to the directory " +"of the module calling :func:`__import__` (see :pep:`328` for the details)." +msgstr "" +"*level* مشخص می‌کند که از ایمپورت مطلق استفاده شود یا نسبی. مقدار ``0`` (که مقدار پیش‌فرض است) به این معناست که فقط " +"ایمپورت مطلق انجام شود. مقادیر مثبت برای *level* تعداد پوشه‌های والد را مشخص می‌کنند که باید نسبت به پوشه‌ی ماژولی " +"که :func:`__import__` را فراخوانی کرده است جست‌وجو شوند (برای جزئیات، :pep:`328` را ببینید)." -msgid "When the *name* variable is of the form ``package.module``, normally, the top-level package (the name up till the first dot) is returned, *not* the module named by *name*. However, when a non-empty *fromlist* argument is given, the module named by *name* is returned." -msgstr "وقتی متغیر *name* به شکل ``package.module`` باشد، به‌طور معمول بستهٔ سطح بالا (بخشی از نام تا اولین نقطه) بازگردانده می‌شود، نه ماژولی که *name* به آن اشاره می‌کند. با این حال، اگر آرگومان *fromlist* ناتهی باشد، ماژول مشخص‌شده توسط *name* بازگردانده می‌شود." +msgid "" +"When the *name* variable is of the form ``package.module``, normally, the top-level package (the name up till the " +"first dot) is returned, *not* the module named by *name*. However, when a non-empty *fromlist* argument is given, " +"the module named by *name* is returned." +msgstr "" +"وقتی متغیر *name* به شکل ``package.module`` باشد، به‌طور معمول بسته‌ی سطح بالا (بخشی از نام تا اولین نقطه) بازگردانده " +"می‌شود، نه ماژولی که *name* به آن اشاره می‌کند. با این حال، اگر آرگومان *fromlist* ناتهی باشد، ماژول مشخص‌شده توسط " +"*name* بازگردانده می‌شود." msgid "For example, the statement ``import spam`` results in bytecode resembling the following code::" msgstr "برای مثال، دستور ``import spam`` به بایت‌کدی مشابه کد زیر تبدیل می‌شود::" @@ -1785,11 +3137,15 @@ msgstr "دستور ``import spam.ham`` منجر به این فراخوانی م msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -msgid "Note how :func:`__import__` returns the toplevel module here because this is the object that is bound to a name by the :keyword:`import` statement." -msgstr "توجه داشته باشید که :func:`__import__` در اینجا ماژول سطح بالا را برمی‌گرداند، زیرا این همان شی‌ءای است که توسط دستور :keyword:`import` به یک نام منتسب می‌شود." +msgid "" +"Note how :func:`__import__` returns the toplevel module here because this is the object that is bound to a name by " +"the :keyword:`import` statement." +msgstr "" +"توجه داشته باشید که :func:`__import__` در اینجا ماژول سطح بالا را برمی‌گرداند، زیرا این همان شی‌ءای است که توسط " +"دستور :keyword:`import` به یک نام منتسب می‌شود." msgid "On the other hand, the statement ``from spam.ham import eggs, sausage as saus`` results in ::" -msgstr "از سوی دیگر، دستور ``from spam.ham import eggs, sausage as saus`` به نتیجهٔ زیر منجر می‌شود::" +msgstr "از سوی دیگر، دستور ``from spam.ham import eggs, sausage as saus`` به نتیجه‌ی زیر منجر می‌شود::" msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" @@ -1800,23 +3156,38 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -msgid "Here, the ``spam.ham`` module is returned from :func:`__import__`. From this object, the names to import are retrieved and assigned to their respective names." -msgstr "در اینجا، ماژول ``spam.ham`` از :func:`__import__` بازگردانده می‌شود. سپس، نام‌هایی که باید ایمپورت شوند از این شیء استخراج شده و به نام‌های متناظر خود اختصاص داده می‌شوند." +msgid "" +"Here, the ``spam.ham`` module is returned from :func:`__import__`. From this object, the names to import are " +"retrieved and assigned to their respective names." +msgstr "" +"در اینجا، ماژول ``spam.ham`` از :func:`__import__` بازگردانده می‌شود. سپس، نام‌هایی که باید ایمپورت شوند از این شیء " +"استخراج شده و به نام‌های متناظر خود اختصاص داده می‌شوند." -msgid "If you simply want to import a module (potentially within a package) by name, use :func:`importlib.import_module`." -msgstr "اگر فقط می‌خواهید یک ماژول (احتمالاً درون یک بسته) را بر اساس نام آن ایمپورت کنید، از :func:`importlib.import_module` استفاده کنید." +msgid "" +"If you simply want to import a module (potentially within a package) by name, use :func:`importlib.import_module`." +msgstr "" +"اگر فقط می‌خواهید یک ماژول (احتمالاً درون یک بسته) را بر اساس نام آن ایمپورت کنید، از :func:`importlib.import_module` " +"استفاده کنید." msgid "Negative values for *level* are no longer supported (which also changes the default value to 0)." msgstr "مقادیر منفی برای *level* دیگر پشتیبانی نمی‌شوند (در نتیجه، مقدار پیش‌فرض آن نیز به 0 تغییر کرده است)." -msgid "When the command line options :option:`-E` or :option:`-I` are being used, the environment variable :envvar:`PYTHONCASEOK` is now ignored." -msgstr "هنگامی که گزینه‌های خط فرمان :option:`-E` یا :option:`-I` استفاده شوند، متغیر محیطی :envvar:`PYTHONCASEOK` نادیده گرفته می‌شود." +msgid "" +"When the command line options :option:`-E` or :option:`-I` are being used, the environment " +"variable :envvar:`PYTHONCASEOK` is now ignored." +msgstr "" +"هنگامی که گزینه‌های خط فرمان :option:`-E` یا :option:`-I` استفاده شوند، متغیر محیطی :envvar:`PYTHONCASEOK` نادیده " +"گرفته می‌شود." msgid "Footnotes" -msgstr "پاورقی‌ها" +msgstr "پانویس‌ها" -msgid "Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, make sure to use newline conversion mode to convert Windows or Mac-style newlines." -msgstr "توجه داشته باشید که تجزیه‌کننده (parser) فقط قرارداد پایان خط به سبک یونیکس را می‌پذیرد. اگر کد را از یک پرونده می‌خوانید، مطمئن شوید که از حالت تبدیل نویسهٔ پایان خط برای تبدیل پایان خط‌های ویندوز یا مک استفاده می‌کنید." +msgid "" +"Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, " +"make sure to use newline conversion mode to convert Windows or Mac-style newlines." +msgstr "" +"توجه داشته باشید که پارسر (parser) فقط قرارداد پایان خط به سبک یونیکس را می‌پذیرد. اگر کد را از یک پرونده می‌خوانید، " +"مطمئن شوید که از حالت تبدیل نویسه‌ی پایان خط برای تبدیل پایان خط‌های ویندوز یا مک استفاده می‌کنید." msgid "Boolean" msgstr "بولی" @@ -1867,7 +3238,7 @@ msgid "unbuffered I/O" msgstr "ورودی/خروجی بافرگذاری‌نشده" msgid "buffer size, I/O" -msgstr "اندازهٔ بافر، ورودی/خروجی" +msgstr "اندازه‌ی بافر، ورودی/خروجی" msgid "I/O control" msgstr "کنترل ورودی/خروجی" @@ -1897,4 +3268,4 @@ msgid "import" msgstr "ایمپورت" msgid "builtins" -msgstr "توکار‌ها" +msgstr "توکارها" diff --git a/library/functools.po b/library/functools.po index 9bb54a607..748ae187b 100644 --- a/library/functools.po +++ b/library/functools.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"PO-Revision-Date: 2026-08-28 11:33+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,52 +22,105 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" -msgid ":mod:`!functools` --- Higher-order functions and operations on callable objects" +msgid "" +":mod:`!functools` --- Higher-order functions and operations on callable " +"objects" msgstr "" +":mod:`!functools` --- توابع مرتبه بالاتر و عملیات روی اشیای قابل فراخوانی" msgid "**Source code:** :source:`Lib/functools.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/functools.py`" -msgid "The :mod:`!functools` module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated as a function for the purposes of this module." +msgid "" +"The :mod:`!functools` module is for higher-order functions: functions that " +"act on or return other functions. In general, any callable object can be " +"treated as a function for the purposes of this module." msgstr "" +"ماژول :mod:`!functools` برای توابع مرتبه بالاتر است: توابعی که روی تابع‌های " +"دیگر عمل می‌کنند یا آن‌ها را برمی‌گردانند. به‌طور کلی، هر شیء قابل فراخوانی " +"می‌تواند برای مقاصد این ماژول به‌عنوان یک تابع در نظر گرفته شود." msgid "The :mod:`!functools` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!functools` توابع زیر را تعریف می‌کند:" -msgid "Simple lightweight unbounded function cache. Sometimes called `\"memoize\" `_." +msgid "" +"Simple lightweight unbounded function cache. Sometimes called `\"memoize\" " +"`_." msgstr "" +"نهانگاه ساده، سبک و نامحدود توابع. گاهی به آن `\"memoize\" `_ گفته می‌شود." -msgid "Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper around a dictionary lookup for the function arguments. Because it never needs to evict old values, this is smaller and faster than :deco:`lru_cache` with a size limit." +msgid "" +"Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper " +"around a dictionary lookup for the function arguments. Because it never " +"needs to evict old values, this is smaller and faster " +"than :deco:`lru_cache` with a size limit." msgstr "" +"مشابه ``lru_cache(maxsize=None)`` را برمی‌گرداند و پوششی نازک حول جست‌وجوی " +"آرگومان‌های تابع در دیکشنری ایجاد می‌کند. از آنجا که هرگز نیازی به حذف مقادیر " +"قدیمی ندارد، این از :deco:`lru_cache` با محدودیت اندازه کوچک‌تر و سریع‌تر است." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "@cache\n" "def factorial(n):\n" " return n * factorial(n-1) if n else 1\n" "\n" -">>> factorial(10) # no previously cached result, makes 11 recursive calls\n" +">>> factorial(10) # no previously cached result, makes 11 recursive " +"calls\n" "3628800\n" ">>> factorial(5) # no new calls, just returns the cached result\n" "120\n" ">>> factorial(12) # two new recursive calls, factorial(10) is cached\n" "479001600" msgstr "" +"@cache\n" +"def factorial(n):\n" +" return n * factorial(n-1) if n else 1\n" +"\n" +">>> factorial(10) # no previously cached result, makes 11 recursive " +"calls\n" +"3628800\n" +">>> factorial(5) # no new calls, just returns the cached result\n" +"120\n" +">>> factorial(12) # two new recursive calls, factorial(10) is cached\n" +"479001600" -msgid "The cache is threadsafe so that the wrapped function can be used in multiple threads. This means that the underlying data structure will remain coherent during concurrent updates." +msgid "" +"The cache is threadsafe so that the wrapped function can be used in " +"multiple threads. This means that the underlying data structure will " +"remain coherent during concurrent updates." msgstr "" +"نهانگاه ایمن برای نخ‌ها است تا بتوان از تابع پوشش‌داده‌شده در چندین نخ استفاده " +"کرد. این بدان معناست که ساختار داده زیرین در حین به‌روزرسانی‌های همزمان منسجم " +"باقی می‌ماند." -msgid "It is possible for the wrapped function to be called more than once if another thread makes an additional call before the initial call has been completed and cached." +msgid "" +"It is possible for the wrapped function to be called more than once if " +"another thread makes an additional call before the initial call has been " +"completed and cached." msgstr "" +"ممکن است تابع پوشیده‌شده بیش از یک بار فراخوانی شود، اگر نخ دیگری پیش از " +"آنکه فراخوانی اولیه کامل شده و در نهانگاه ذخیره شده باشد، یک فراخوانی اضافی " +"انجام دهد." -msgid "Transform a method of a class into a property whose value is computed once and then cached as a normal attribute for the life of the instance. Similar to :deco:`property`, with the addition of caching. Useful for expensive computed properties of instances that are otherwise effectively immutable." +msgid "" +"Transform a method of a class into a property whose value is computed once " +"and then cached as a normal attribute for the life of the instance. Similar " +"to :deco:`property`, with the addition of caching. Useful for expensive " +"computed properties of instances that are otherwise effectively immutable." msgstr "" +"یک متد از کلاس را به پراپرتی تبدیل می‌کند که مقدار آن یک بار محاسبه می‌شود و " +"سپس برای طول عمر نمونه به‌عنوان یک ویژگی معمولی در نهانگاه ذخیره می‌شود. " +"مشابه :deco:`property`، با افزودن نهانگاه‌سازی. برای پراپرتی‌های محاسبه‌شده‌ی " +"پرهزینه در نمونه‌هایی که در غیر این صورت عملاً تغییرناپذیر هستند، مفید است." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "class DataSet:\n" @@ -79,96 +132,306 @@ msgid "" " def stdev(self):\n" " return statistics.stdev(self._data)" msgstr "" +"class DataSet:\n" +"\n" +" def __init__(self, sequence_of_numbers):\n" +" self._data = tuple(sequence_of_numbers)\n" +"\n" +" @cached_property\n" +" def stdev(self):\n" +" return statistics.stdev(self._data)" -msgid "The mechanics of :deco:`cached_property` are somewhat different from :deco:`property`. A regular property blocks attribute writes unless a setter is defined. In contrast, a *cached_property* allows writes." +msgid "" +"The mechanics of :deco:`cached_property` are somewhat different " +"from :deco:`property`. A regular property blocks attribute writes unless a " +"setter is defined. In contrast, a *cached_property* allows writes." msgstr "" +"سازوکار :deco:`cached_property` تا حدی با :deco:`property` متفاوت است. یک " +"پراپرتی معمولی، نوشتن روی ویژگی را مسدود می‌کند، مگر اینکه یک تنظیم‌کننده " +"(setter) تعریف شده باشد. در مقابل، یک *cached_property* اجازه‌ی نوشتن می‌دهد." -msgid "The *cached_property* decorator only runs on lookups and only when an attribute of the same name doesn't exist. When it does run, the *cached_property* writes to the attribute with the same name. Subsequent attribute reads and writes take precedence over the *cached_property* method and it works like a normal attribute." +msgid "" +"The *cached_property* decorator only runs on lookups and only when an " +"attribute of the same name doesn't exist. When it does run, the " +"*cached_property* writes to the attribute with the same name. Subsequent " +"attribute reads and writes take precedence over the *cached_property* " +"method and it works like a normal attribute." msgstr "" +"دکوراتور *cached_property* فقط در جست‌وجوها اجرا می‌شود و تنها زمانی که " +"ویژگی‌ای با همان نام وجود نداشته باشد. هنگامی که اجرا شود، *cached_property* " +"در ویژگی با همان نام می‌نویسد. خواندن‌ها و نوشتن‌های بعدی ویژگی بر متد " +"*cached_property* تقدم دارند و مانند یک ویژگی عادی کار می‌کند." -msgid "The cached value can be cleared by deleting the attribute. This allows the *cached_property* method to run again." +msgid "" +"The cached value can be cleared by deleting the attribute. This allows the " +"*cached_property* method to run again." msgstr "" +"مقدار نهانگاه‌شده را می‌توان با حذف ویژگی پاک کرد. این کار باعث می‌شود متد " +"*cached_property* دوباره اجرا شود." -msgid "The *cached_property* does not prevent a possible race condition in multi-threaded usage. The getter function could run more than once on the same instance, with the latest run setting the cached value. If the cached property is idempotent or otherwise not harmful to run more than once on an instance, this is fine. If synchronization is needed, implement the necessary locking inside the decorated getter function or around the cached property access." -msgstr "" +msgid "" +"The *cached_property* does not prevent a possible race condition in multi-" +"threaded usage. The getter function could run more than once on the same " +"instance, with the latest run setting the cached value. If the cached " +"property is idempotent or otherwise not harmful to run more than once on an " +"instance, this is fine. If synchronization is needed, implement the " +"necessary locking inside the decorated getter function or around the cached " +"property access." +msgstr "" +"*cached_property* از یک شرایط رقابتی احتمالی در استفاده چندنخی جلوگیری " +"نمی‌کند. ممکن است تابع دریافت‌کننده (getter) بیش از ۱ بار روی یک نمونه اجرا " +"شود، به‌طوری که آخرین اجرا مقدار نهانگاه‌شده را تنظیم کند. اگر ویژگی " +"نهانگاه‌شده بی‌اثر در اجرای هم‌توان باشد یا به‌هر شکل دیگر اجرای بیش " +"از ۱ بار آن روی یک نمونه مضر نباشد، این موضوع مشکلی ندارد. در صورت نیاز به " +"همگام‌سازی، قفل‌گذاری لازم را درون تابع دریافت‌کننده دکوراتورشده یا پیرامون " +"دسترسی به ویژگی نهانگاه‌شده پیاده‌سازی کنید." -msgid "Note, this decorator interferes with the operation of :pep:`412` key-sharing dictionaries. This means that instance dictionaries can take more space than usual." +msgid "" +"Note, this decorator interferes with the operation of :pep:`412` key-" +"sharing dictionaries. This means that instance dictionaries can take more " +"space than usual." msgstr "" +"توجه داشته باشید که این دکوراتور در عملکرد دیکشنری‌های کلید-مشترک :pep:`412` " +"اختلال ایجاد می‌کند. این بدان معناست که دیکشنری‌های نمونه می‌توانند فضای " +"بیشتری نسبت به حالت عادی اشغال کنند." -msgid "Also, this decorator requires that the ``__dict__`` attribute on each instance be a mutable mapping. This means it will not work with some types, such as metaclasses (since the ``__dict__`` attributes on type instances are read-only proxies for the class namespace), and those that specify ``__slots__`` without including ``__dict__`` as one of the defined slots (as such classes don't provide a ``__dict__`` attribute at all)." -msgstr "" +msgid "" +"Also, this decorator requires that the ``__dict__`` attribute on each " +"instance be a mutable mapping. This means it will not work with some types, " +"such as metaclasses (since the ``__dict__`` attributes on type instances " +"are read-only proxies for the class namespace), and those that specify " +"``__slots__`` without including ``__dict__`` as one of the defined slots " +"(as such classes don't provide a ``__dict__`` attribute at all)." +msgstr "" +"همچنین، این دکوراتور نیاز دارد که ویژگی ``__dict__`` هر نمونه یک نگاشت " +"تغییرپذیر باشد. این بدان معناست که با برخی از انواع کار نمی‌کند، مانند " +"فراکلاس‌ها (زیرا ویژگی‌های ``__dict__`` در نمونه‌های type، پراکسی‌های " +"فقط‌خواندنی برای فضای نام کلاس هستند) و انواعی که ``__slots__`` را بدون " +"گنجاندن ``__dict__`` به‌عنوان یکی از جایگاه‌های تعریف‌شده تعیین می‌کنند (زیرا " +"چنین کلاس‌هایی اصلاً ویژگی ``__dict__`` را فراهم نمی‌کنند)." -msgid "If a mutable mapping is not available or if space-efficient key sharing is desired, an effect similar to :deco:`cached_property` can also be achieved by stacking :deco:`property` on top of :deco:`lru_cache`. See :ref:`faq-cache-method-calls` for more details on how this differs from :deco:`cached_property`." -msgstr "" +msgid "" +"If a mutable mapping is not available or if space-efficient key sharing is " +"desired, an effect similar to :deco:`cached_property` can also be achieved " +"by stacking :deco:`property` on top of :deco:`lru_cache`. See :ref:`faq-" +"cache-method-calls` for more details on how this differs " +"from :deco:`cached_property`." +msgstr "" +"اگر نگاشت تغییرپذیر در دسترس نباشد یا اشتراک‌گذاری کلیدها به‌صورت بهینه از " +"نظر فضا مطلوب باشد، می‌توان اثری مشابه :deco:`cached_property` را نیز با " +"قرار دادن :deco:`property` بر روی :deco:`lru_cache` به‌دست آورد. برای جزئیات " +"بیشتر درباره‌ی تفاوت این روش با :deco:`cached_property`، :ref:`faq-cache-" +"method-calls` را ببینید." -msgid "Prior to Python 3.12, :deco:`!cached_property` included an undocumented lock to ensure that in multi-threaded usage the getter function was guaranteed to run only once per instance. However, the lock was per-property, not per-instance, which could result in unacceptably high lock contention. In Python 3.12+ this locking is removed." -msgstr "" +msgid "" +"Prior to Python 3.12, :deco:`!cached_property` included an undocumented " +"lock to ensure that in multi-threaded usage the getter function was " +"guaranteed to run only once per instance. However, the lock was per-" +"property, not per-instance, which could result in unacceptably high lock " +"contention. In Python 3.12+ this locking is removed." +msgstr "" +"پیش از پایتون 3.12، :deco:`!cached_property` شامل یک قفل مستندنشده بود تا " +"تضمین کند که در استفاده‌ی چندنخی، تابع دریافت‌کننده (getter) فقط یک‌بار به‌ازای " +"هر نمونه اجرا می‌شود. با این حال، این قفل به‌ازای هر پراپرتی بود، نه به‌ازای " +"هر نمونه، که می‌توانست منجر به رقابت قفل بسیار بالا و غیرقابل‌قبول شود. در " +"پایتون 3.12 و بالاتر این قفل‌سازی حذف شده است." -msgid "Transform an old-style comparison function to a :term:`key function`. Used with tools that accept key functions (such as :func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:`itertools.groupby`). This function is primarily used as a transition tool for programs being converted from Python 2 which supported the use of comparison functions." -msgstr "" +msgid "" +"Transform an old-style comparison function to a :term:`key function`. Used " +"with tools that accept key functions (such " +"as :func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:`itertools.groupby`). " +"This function is primarily used as a transition tool for programs being " +"converted from Python 2 which supported the use of comparison functions." +msgstr "" +"یک تابع مقایسه به سبک قدیمی را به یک :term:`key function` تبدیل می‌کند. با " +"ابزارهایی که تابع‌های کلید را می‌پذیرند استفاده می‌شود " +"(مانند :func:`sorted`، :func:`min`، :func:`max`، :func:`heapq.nlargest`، :func:`heapq.nsmallest`، :func:`itertools.groupby`). " +"این تابع عمدتاً به‌عنوان ابزاری برای گذار برنامه‌هایی استفاده می‌شود که در حال " +"تبدیل از Python 2 (که از استفاده از توابع مقایسه پشتیبانی می‌کرد) هستند." -msgid "A comparison function is any callable that accepts two arguments, compares them, and returns a negative number for less-than, zero for equality, or a positive number for greater-than. A key function is a callable that accepts one argument and returns another value to be used as the sort key." +msgid "" +"A comparison function is any callable that accepts two arguments, compares " +"them, and returns a negative number for less-than, zero for equality, or a " +"positive number for greater-than. A key function is a callable that " +"accepts one argument and returns another value to be used as the sort key." msgstr "" +"تابع مقایسه، هر فراخوان‌پذیری است که دو آرگومان می‌پذیرد، آن‌ها را مقایسه " +"می‌کند و برای کوچک‌تر بودن یک عدد منفی، برای برابری صفر، یا برای بزرگ‌تر بودن " +"یک عدد مثبت برمی‌گرداند. تابع کلید، یک فراخوان‌پذیر است که یک آرگومان می‌پذیرد " +"و مقدار دیگری را برمی‌گرداند تا به‌عنوان کلید مرتب‌سازی استفاده شود." -msgid "sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" +msgid "" +"sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" msgstr "" +"sorted(iterable, key=cmp_to_key(locale.strcoll)) # ترتیب مرتب‌سازی آگاه از " +"locale" -msgid "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." +msgid "" +"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" +"برای مثال‌های مرتب‌سازی و یک آموزش کوتاه مرتب‌سازی، به :ref:`sortinghowto` " +"مراجعه کنید." -msgid "Decorator to wrap a function with a memoizing callable that saves up to the *maxsize* most recent calls. It can save time when an expensive or I/O bound function is periodically called with the same arguments." +msgid "" +"Decorator to wrap a function with a memoizing callable that saves up to the " +"*maxsize* most recent calls. It can save time when an expensive or I/O " +"bound function is periodically called with the same arguments." msgstr "" +"دکوراتوری برای دربرگرفتن یک تابع با یک فراخوان‌پذیر memoizing که حداکثر " +"*maxsize* فراخوانی اخیر را ذخیره می‌کند. این دکوراتور می‌تواند هنگامی که یک " +"تابع پرهزینه یا وابسته به I/O به‌صورت دوره‌ای با آرگومان‌های یکسان فراخوانی " +"می‌شود، باعث صرفه‌جویی در زمان شود." -msgid "Since a dictionary is used to cache results, the positional and keyword arguments to the function must be :term:`hashable`." +msgid "" +"Since a dictionary is used to cache results, the positional and keyword " +"arguments to the function must be :term:`hashable`." msgstr "" +"از آن‌جا که از یک دیکشنری برای نهانگاه‌سازی نتایج استفاده می‌شود، آرگومان‌های " +"جایگاهی و کلیدواژه‌ای تابع باید :term:`hashable` باشند." -msgid "Distinct argument patterns may be considered to be distinct calls with separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` differ in their keyword argument order and may have two separate cache entries." +msgid "" +"Distinct argument patterns may be considered to be distinct calls with " +"separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " +"differ in their keyword argument order and may have two separate cache " +"entries." msgstr "" +"الگوهای متمایز آرگومان‌ها ممکن است به‌عنوان فراخوانی‌های متمایز با ورودی‌های " +"جداگانه در نهانگاه در نظر گرفته شوند. برای مثال، ``f(a=1, b=2)`` و ``f(b=2, " +"a=1)`` در ترتیب آرگومان‌های کلیدواژه‌ای خود تفاوت دارند و ممکن است دو ورودی " +"جداگانه در نهانگاه داشته باشند." -msgid "If *user_function* is specified, it must be a callable. This allows the *lru_cache* decorator to be applied directly to a user function, leaving the *maxsize* at its default value of 128::" +msgid "" +"If *user_function* is specified, it must be a callable. This allows the " +"*lru_cache* decorator to be applied directly to a user function, leaving " +"the *maxsize* at its default value of 128::" msgstr "" +"اگر *user_function* مشخص شده باشد، باید قابل فراخوانی باشد. این امکان را " +"فراهم می‌کند که دکوراتور *lru_cache* مستقیماً روی یک تابع کاربر اعمال شود، در " +"حالی که *maxsize* روی مقدار پیش‌فرض خود یعنی ۱۲۸ باقی می‌ماند::" msgid "" "@lru_cache\n" "def count_vowels(sentence):\n" " return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')" msgstr "" +"@lru_cache\n" +"def count_vowels(sentence):\n" +" return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')" -msgid "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can grow without bound." +msgid "" +"If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " +"can grow without bound." msgstr "" +"اگر *maxsize* برابر ``None`` قرار داده شود، قابلیت LRU غیرفعال می‌شود و " +"نهانگاه می‌تواند بدون محدودیت رشد کند." -msgid "If *typed* is set to true, function arguments of different types will be cached separately. If *typed* is false, the implementation will usually regard them as equivalent calls and only cache a single result. (Some types such as *str* and *int* may be cached separately even when *typed* is false.)" -msgstr "" +msgid "" +"If *typed* is set to true, function arguments of different types will be " +"cached separately. If *typed* is false, the implementation will usually " +"regard them as equivalent calls and only cache a single result. (Some types " +"such as *str* and *int* may be cached separately even when *typed* is " +"false.)" +msgstr "" +"اگر *typed* روی درست تنظیم شود، آرگومان‌های تابع از انواع مختلف به‌طور " +"جداگانه در نهانگاه ذخیره می‌شوند. اگر *typed* نادرست باشد، پیاده‌سازی معمولاً " +"آن‌ها را به‌عنوان فراخوانی‌های هم‌ارز در نظر می‌گیرد و فقط یک نتیجه را در " +"نهانگاه ذخیره می‌کند. (برخی انواع مانند *str* و *int* ممکن است حتی وقتی " +"*typed* نادرست است، به‌طور جداگانه در نهانگاه ذخیره شوند.)" -msgid "Note, type specificity applies only to the function's immediate arguments rather than their contents. The scalar arguments, ``Decimal(42)`` and ``Fraction(42)`` are treated as distinct calls with distinct results. In contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', Fraction(42))`` are treated as equivalent." -msgstr "" +msgid "" +"Note, type specificity applies only to the function's immediate arguments " +"rather than their contents. The scalar arguments, ``Decimal(42)`` and " +"``Fraction(42)`` are treated as distinct calls with distinct results. In " +"contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', " +"Fraction(42))`` are treated as equivalent." +msgstr "" +"توجه داشته باشید که ویژگی خاص‌بودن نوع (type specificity) فقط به آرگومان‌های " +"مستقیم تابع اعمال می‌شود، نه به محتوای آن‌ها. آرگومان‌های اسکالر (scalar)، " +"``Decimal(42)`` و ``Fraction(42)``، به‌عنوان فراخوانی‌های مجزا با نتایج مجزا " +"در نظر گرفته می‌شوند. در مقابل، آرگومان‌های تاپل ، ``('answer', " +"Decimal(42))`` و ``('answer', Fraction(42))``، معادل یکدیگر در نظر گرفته " +"می‌شوند." -msgid "The wrapped function is instrumented with a :func:`!cache_parameters` function that returns a new :class:`dict` showing the values for *maxsize* and *typed*. This is for information purposes only. Mutating the values has no effect." +msgid "" +"The wrapped function is instrumented with a :func:`!cache_parameters` " +"function that returns a new :class:`dict` showing the values for *maxsize* " +"and *typed*. This is for information purposes only. Mutating the values " +"has no effect." msgstr "" +"تابع دربرگرفته‌شده به یک تابع :func:`!cache_parameters` مجهز شده است که " +"یک :class:`dict` جدید برمی‌گرداند و مقادیر *maxsize* و *typed* را نشان " +"می‌دهد. این صرفاً برای اطلاع‌رسانی است. تغییر مقادیر هیچ تأثیری ندارد." -msgid "To help measure the effectiveness of the cache and tune the *maxsize* parameter, the wrapped function is instrumented with a :func:`!cache_info` function that returns a :term:`named tuple` showing *hits*, *misses*, *maxsize* and *currsize*." +msgid "" +"To help measure the effectiveness of the cache and tune the *maxsize* " +"parameter, the wrapped function is instrumented with a :func:`!cache_info` " +"function that returns a :term:`named tuple` showing *hits*, *misses*, " +"*maxsize* and *currsize*." msgstr "" +"برای کمک به اندازه‌گیری اثربخشی نهانگاه و تنظیم پارامتر *maxsize*، تابع " +"دربرگرفته‌شده به یک تابع :func:`!cache_info` مجهز شده است که یک :term:`named " +"tuple` برمی‌گرداند و *hits*، *misses*، *maxsize* و *currsize* را نشان می‌دهد." -msgid "The decorator also provides a :func:`!cache_clear` function for clearing or invalidating the cache." +msgid "" +"The decorator also provides a :func:`!cache_clear` function for clearing or " +"invalidating the cache." msgstr "" +"این دکوراتور همچنین یک تابع :func:`!cache_clear` برای پاک‌سازی یا بی‌اعتبار " +"کردن نهانگاه فراهم می‌کند." -msgid "The original underlying function is accessible through the :attr:`__wrapped__` attribute. This is useful for introspection, for bypassing the cache, or for rewrapping the function with a different cache." +msgid "" +"The original underlying function is accessible through " +"the :attr:`__wrapped__` attribute. This is useful for introspection, for " +"bypassing the cache, or for rewrapping the function with a different cache." msgstr "" +"تابع زیربنایی اصلی از طریق ویژگی :attr:`__wrapped__` در دسترس است. این برای " +"درون‌نگری، دور زدن نهانگاه، یا پیچیدن دوباره تابع با نهانگاهی متفاوت مفید " +"است." -msgid "The cache keeps references to the arguments and return values until they age out of the cache or until the cache is cleared." +msgid "" +"The cache keeps references to the arguments and return values until they " +"age out of the cache or until the cache is cleared." msgstr "" +"نهانگاه ارجاع‌ها به آرگومان‌ها و مقادیر بازگشتی را نگه می‌دارد، تا زمانی که به " +"دلیل انقضا از نهانگاه خارج شوند یا نهانگاه پاک شود." -msgid "If a method is cached, the ``self`` instance argument is included in the cache. See :ref:`faq-cache-method-calls`" +msgid "" +"If a method is cached, the ``self`` instance argument is included in the " +"cache. See :ref:`faq-cache-method-calls`" msgstr "" +"اگر یک متد نهانگاه‌شده باشد، آرگومان نمونه ``self`` در نهانگاه لحاظ " +"می‌شود. :ref:`faq-cache-method-calls` را ببینید" -msgid "An `LRU (least recently used) cache `_ works best when the most recent calls are the best predictors of upcoming calls (for example, the most popular articles on a news server tend to change each day). The cache's size limit assures that the cache does not grow without bound on long-running processes such as web servers." -msgstr "" +msgid "" +"An `LRU (least recently used) cache `_ works best when the " +"most recent calls are the best predictors of upcoming calls (for example, " +"the most popular articles on a news server tend to change each day). The " +"cache's size limit assures that the cache does not grow without bound on " +"long-running processes such as web servers." +msgstr "" +"`نهانگاه LRU (کمترین استفاده‌ی اخیر) `_ زمانی بهترین عملکرد را دارد " +"که آخرین فراخوانی‌ها بهترین پیش‌بینی‌کننده‌های فراخوانی‌های آینده باشند (برای " +"مثال، محبوب‌ترین مقاله‌ها در یک سرور خبری معمولاً هر روز تغییر می‌کنند). " +"محدودیت اندازه‌ی نهانگاه تضمین می‌کند که نهانگاه در فرآیندهای طولانی‌مدت مانند " +"سرورهای وب بدون محدودیت رشد نمی‌کند." -msgid "In general, the LRU cache should only be used when you want to reuse previously computed values. Accordingly, it doesn't make sense to cache functions with side-effects, functions that need to create distinct mutable objects on each call (such as generators and async functions), or impure functions such as time() or random()." -msgstr "" +msgid "" +"In general, the LRU cache should only be used when you want to reuse " +"previously computed values. Accordingly, it doesn't make sense to cache " +"functions with side-effects, functions that need to create distinct mutable " +"objects on each call (such as generators and async functions), or impure " +"functions such as time() or random()." +msgstr "" +"به‌طور کلی، نهانگاه LRU فقط زمانی باید استفاده شود که بخواهید مقادیر از پیش " +"محاسبه‌شده را دوباره به کار ببرید. بر همین اساس، منطقی نیست که توابع دارای " +"اثرات جانبی، توابعی که نیاز دارند در هر فراخوانی اشیاء تغییرپذیر متمایزی " +"ایجاد کنند (مانند تولیدگرها و توابع ناهمگام)، یا توابع غیرخالص مانند time() " +"یا random() را نهان‌سازی کنید." msgid "Example of an LRU cache for static web content::" -msgstr "" +msgstr "نمونه‌ای از یک نهانگاه LRU برای محتوای وب ثابت::" msgid "" "@lru_cache(maxsize=32)\n" @@ -188,9 +451,32 @@ msgid "" ">>> get_pep.cache_info()\n" "CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" msgstr "" +"@lru_cache(maxsize=32)\n" +"def get_pep(num):\n" +" 'Retrieve text of a Python Enhancement Proposal'\n" +" resource = f'https://peps.python.org/pep-{num:04d}'\n" +" try:\n" +" with urllib.request.urlopen(resource) as s:\n" +" return s.read()\n" +" except urllib.error.HTTPError:\n" +" return 'Not Found'\n" +"\n" +">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" +"... pep = get_pep(n)\n" +"... print(n, len(pep))\n" +"\n" +">>> get_pep.cache_info()\n" +"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" -msgid "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic programming `_ technique::" +msgid "" +"Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a " +"`dynamic programming `_ " +"technique::" msgstr "" +"مثالی از محاسبه‌ی کارآمد `اعداد فیبوناچی `_ با استفاده از یک نهانگاه برای پیاده‌سازی تکنیک " +"`برنامه‌نویسی پویا `_::" msgid "" "@lru_cache(maxsize=None)\n" @@ -205,21 +491,46 @@ msgid "" ">>> fib.cache_info()\n" "CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" msgstr "" +"@lru_cache(maxsize=None)\n" +"def fib(n):\n" +" if n < 2:\n" +" return n\n" +" return fib(n-1) + fib(n-2)\n" +"\n" +">>> [fib(n) for n in range(16)]\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" +"\n" +">>> fib.cache_info()\n" +"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" msgid "Added the *typed* option." -msgstr "" +msgstr "گزینه‌ی *typed* اضافه شد." msgid "Added the *user_function* option." -msgstr "" +msgstr "گزینه‌ی *user_function* افزوده شد." msgid "Added the function :func:`!cache_parameters`" -msgstr "" +msgstr "تابع :func:`!cache_parameters` افزوده شد" -msgid "Given a class defining one or more rich comparison ordering methods, this class decorator supplies the rest. This simplifies the effort involved in specifying all of the possible rich comparison operations:" +msgid "" +"Given a class defining one or more rich comparison ordering methods, this " +"class decorator supplies the rest. This simplifies the effort involved in " +"specifying all of the possible rich comparison operations:" msgstr "" +"با فرض کلاسی که یک یا چند متد مرتبه‌بندی مقایسه غنی را تعریف می‌کند، این " +"دکوراتور کلاس، بقیه را فراهم می‌کند. این کار تلاش لازم برای مشخص کردن تمام " +"عملیات مقایسه غنی ممکن را ساده می‌کند:" -msgid "The class must define one of :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`. In addition, the class should supply an :meth:`~object.__eq__` method." +msgid "" +"The class must define one " +"of :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " +"or :meth:`~object.__ge__`. In addition, the class should supply " +"an :meth:`~object.__eq__` method." msgstr "" +"کلاس باید یکی " +"از :meth:`~object.__lt__`، :meth:`~object.__le__`، :meth:`~object.__gt__` " +"یا :meth:`~object.__ge__` را تعریف کند. علاوه بر این، بهتر است کلاس یک " +"متد :meth:`~object.__eq__` نیز فراهم کند." msgid "" "@total_ordering\n" @@ -238,21 +549,74 @@ msgid "" " return ((self.lastname.lower(), self.firstname.lower()) <\n" " (other.lastname.lower(), other.firstname.lower()))" msgstr "" +"@total_ordering\n" +"class Student:\n" +" def _is_valid_operand(self, other):\n" +" return (hasattr(other, \"lastname\") and\n" +" hasattr(other, \"firstname\"))\n" +" def __eq__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) ==\n" +" (other.lastname.lower(), other.firstname.lower()))\n" +" def __lt__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) <\n" +" (other.lastname.lower(), other.firstname.lower()))" -msgid "While this decorator makes it easy to create well behaved totally ordered types, it *does* come at the cost of slower execution and more complex stack traces for the derived comparison methods. If performance benchmarking indicates this is a bottleneck for a given application, implementing all six rich comparison methods instead is likely to provide an easy speed boost." -msgstr "" +msgid "" +"While this decorator makes it easy to create well behaved totally ordered " +"types, it *does* come at the cost of slower execution and more complex " +"stack traces for the derived comparison methods. If performance " +"benchmarking indicates this is a bottleneck for a given application, " +"implementing all six rich comparison methods instead is likely to provide " +"an easy speed boost." +msgstr "" +"هرچند این دکوراتور ایجاد انواع با ترتیب کامل و رفتار مناسب را آسان می‌سازد، " +"اما *واقعاً* با هزینه‌ی اجرای کندتر و ردگیری‌های پشته‌ی پیچیده‌تر برای متدهای " +"مقایسه‌ای مشتق‌شده همراه است. اگر محک‌زنی عملکرد نشان دهد که این موضوع برای یک " +"برنامه‌ی مشخص گلوگاه است، در عوض پیاده‌سازی هر شش متد مقایسه‌ی غنی احتمالاً " +"می‌تواند به‌راحتی باعث افزایش سرعت شود." -msgid "This decorator makes no attempt to override methods that have been declared in the class *or its superclasses*. Meaning that if a superclass defines a comparison operator, *total_ordering* will not implement it again, even if the original method is abstract." +msgid "" +"This decorator makes no attempt to override methods that have been declared " +"in the class *or its superclasses*. Meaning that if a superclass defines a " +"comparison operator, *total_ordering* will not implement it again, even if " +"the original method is abstract." msgstr "" +"این دکوراتور هیچ تلاشی برای بازنویسی متدهایی که در کلاس *یا ابرکلاس‌های آن* " +"تعریف‌شده‌اند، نمی‌کند. به این معنا که اگر یک ابرکلاس یک عملگر مقایسه را تعریف " +"کند، *total_ordering* آن را دوباره پیاده‌سازی نخواهد کرد، حتی اگر متد اصلی " +"انتزاعی باشد." -msgid "Returning ``NotImplemented`` from the underlying comparison function for unrecognised types is now supported." +msgid "" +"Returning ``NotImplemented`` from the underlying comparison function for " +"unrecognised types is now supported." msgstr "" +"بازگرداندن ``NotImplemented`` از تابع مقایسه‌ی زیربنایی برای انواع ناشناخته " +"اکنون پشتیبانی می‌شود." -msgid "A singleton object used as a sentinel to reserve a place for positional arguments when calling :func:`partial` and :func:`partialmethod`." +msgid "" +"A singleton object used as a sentinel to reserve a place for positional " +"arguments when calling :func:`partial` and :func:`partialmethod`." msgstr "" +"شیء یگانه‌ای که به‌عنوان نشانگر (sentinel) برای رزرو جایگاهی برای آرگومان‌های " +"جایگاهی هنگام فراخوانی :func:`partial` و :func:`partialmethod` استفاده " +"می‌شود." -msgid "Return a new :ref:`partial object` which when called will behave like *func* called with the positional arguments *args* and keyword arguments *keywords*. If more arguments are supplied to the call, they are appended to *args*. If additional keyword arguments are supplied, they extend and override *keywords*. Roughly equivalent to::" -msgstr "" +msgid "" +"Return a new :ref:`partial object ` which when called will " +"behave like *func* called with the positional arguments *args* and keyword " +"arguments *keywords*. If more arguments are supplied to the call, they are " +"appended to *args*. If additional keyword arguments are supplied, they " +"extend and override *keywords*. Roughly equivalent to::" +msgstr "" +"یک :ref:`شیء partial ` جدید برمی‌گرداند که هنگام فراخوانی، " +"مانند *func* فراخوانی‌شده با آرگومان‌های جایگاهی *args* و آرگومان‌های " +"کلیدواژه‌ای *keywords* رفتار می‌کند. اگر آرگومان‌های بیشتری در فراخوانی ارائه " +"شوند، به *args* افزوده می‌شوند. اگر آرگومان‌های کلیدواژه‌ای اضافی ارائه شوند، " +"*keywords* را گسترش می‌دهند و بازنویسی می‌کنند. تقریباً معادل است با::" msgid "" "def partial(func, /, *args, **keywords):\n" @@ -263,9 +627,26 @@ msgid "" " newfunc.keywords = keywords\n" " return newfunc" msgstr "" +"def partial(func, /, *args, **keywords):\n" +" def newfunc(*more_args, **more_keywords):\n" +" return func(*args, *more_args, **(keywords | more_keywords))\n" +" newfunc.func = func\n" +" newfunc.args = args\n" +" newfunc.keywords = keywords\n" +" return newfunc" -msgid "The :func:`!partial` function is used for partial function application which \"freezes\" some portion of a function's arguments and/or keywords resulting in a new object with a simplified signature. For example, :func:`partial` can be used to create a callable that behaves like the :func:`int` function where the *base* argument defaults to ``2``:" -msgstr "" +msgid "" +"The :func:`!partial` function is used for partial function application " +"which \"freezes\" some portion of a function's arguments and/or keywords " +"resulting in a new object with a simplified signature. For " +"example, :func:`partial` can be used to create a callable that behaves like " +"the :func:`int` function where the *base* argument defaults to ``2``:" +msgstr "" +"تابع :func:`!partial` برای اعمال جزئی تابع استفاده می‌شود که در آن بخشی از " +"آرگومان‌ها و/یا کلیدواژه‌های یک تابع «فریز» می‌شود و یک شیء جدید با امضای " +"ساده‌تر به دست می‌آید. برای مثال، می‌توان از :func:`partial` برای ایجاد یک شیء " +"فراخوانی‌پذیر استفاده کرد که مانند تابع :func:`int` رفتار می‌کند، به‌طوری که " +"مقدار پیش‌فرض آرگومان *base* آن ``2`` است:" msgid "" ">>> basetwo = partial(int, base=2)\n" @@ -273,24 +654,60 @@ msgid "" ">>> basetwo('10010')\n" "18" msgstr "" +">>> basetwo = partial(int, base=2)\n" +">>> basetwo.__doc__ = 'Convert base 2 string to an int.'\n" +">>> basetwo('10010')\n" +"18" -msgid "If :data:`Placeholder` sentinels are present in *args*, they will be filled first when :func:`!partial` is called. This makes it possible to pre-fill any positional argument with a call to :func:`!partial`; without :data:`!Placeholder`, only the chosen number of leading positional arguments can be pre-filled." -msgstr "" +msgid "" +"If :data:`Placeholder` sentinels are present in *args*, they will be filled " +"first when :func:`!partial` is called. This makes it possible to pre-fill " +"any positional argument with a call to :func:`!partial`; without :data:`!" +"Placeholder`, only the chosen number of leading positional arguments can be " +"pre-filled." +msgstr "" +"اگر نشانگرهای :data:`Placeholder` (sentinels) در *args* وجود داشته باشند، " +"هنگام فراخوانی :func:`!partial` ابتدا آن‌ها پر می‌شوند. این کار از پیش پر " +"کردن هر آرگومان جایگاهی را با فراخوانی :func:`!partial` ممکن می‌سازد؛ " +"بدون :data:`!Placeholder`، تنها می‌توان تعداد انتخاب‌شده‌ای از آرگومان‌های " +"جایگاهی ابتدایی را از پیش پر کرد." -msgid "If any :data:`!Placeholder` sentinels are present, all must be filled at call time:" +msgid "" +"If any :data:`!Placeholder` sentinels are present, all must be filled at " +"call time:" msgstr "" +"اگر هر نشانگر (sentinel) از :data:`!Placeholder` وجود داشته باشد، همه باید " +"در زمان فراخوانی پر شوند:" msgid "" ">>> say_to_world = partial(print, Placeholder, Placeholder, \"world!\")\n" ">>> say_to_world('Hello', 'dear')\n" "Hello dear world!" msgstr "" +">>> say_to_world = partial(print, Placeholder, Placeholder, \"world!\")\n" +">>> say_to_world('Hello', 'dear')\n" +"Hello dear world!" -msgid "Calling ``say_to_world('Hello')`` raises a :exc:`TypeError`, because only one positional argument is provided, but there are two placeholders that must be filled in." +msgid "" +"Calling ``say_to_world('Hello')`` raises a :exc:`TypeError`, because only " +"one positional argument is provided, but there are two placeholders that " +"must be filled in." msgstr "" +"فراخوانی ``say_to_world('Hello')`` باعث پرتاب یک :exc:`TypeError` می‌شود، " +"زیرا تنها یک آرگومان جایگاهی ارائه شده است، اما دو جای‌نگهدار وجود دارد که " +"باید پر شوند." -msgid "If :func:`!partial` is applied to an existing :ref:`partial object `, :data:`!Placeholder` sentinels of the input object are filled in with new positional arguments. A placeholder can be retained by inserting a new :data:`!Placeholder` sentinel to the place held by a previous :data:`!Placeholder`:" +msgid "" +"If :func:`!partial` is applied to an existing :ref:`partial object `, :data:`!Placeholder` sentinels of the input object are filled in " +"with new positional arguments. A placeholder can be retained by inserting a " +"new :data:`!Placeholder` sentinel to the place held by a previous :data:`!" +"Placeholder`:" msgstr "" +"اگر :func:`!partial` بر یک :ref:`شیء partial ` موجود اعمال " +"شود، نشانگرهای :data:`!Placeholder` شیء ورودی با آرگومان‌های جایگاهی جدید پر " +"می‌شوند. می‌توان یک جای‌نگهدار را با درج یک نشانگر :data:`!Placeholder` جدید " +"در جایگاهی که یک :data:`!Placeholder` پیشین آن را نگه‌داشته است، حفظ کرد:" msgid "" ">>> from functools import partial, Placeholder as _\n" @@ -305,24 +722,69 @@ msgid "" ">>> remove_first_dear(message)\n" "'Hello, dear world!'" msgstr "" +">>> from functools import partial, Placeholder as _\n" +">>> remove = partial(str.replace, _, _, '')\n" +">>> message = 'Hello, dear dear world!'\n" +">>> remove(message, ' dear')\n" +"'Hello, world!'\n" +">>> remove_dear = partial(remove, _, ' dear')\n" +">>> remove_dear(message)\n" +"'Hello, world!'\n" +">>> remove_first_dear = partial(remove_dear, _, 1)\n" +">>> remove_first_dear(message)\n" +"'Hello, dear world!'" -msgid ":data:`!Placeholder` cannot be passed to :func:`!partial` as a keyword argument." +msgid "" +":data:`!Placeholder` cannot be passed to :func:`!partial` as a keyword " +"argument." msgstr "" +":data:`!Placeholder` نمی‌تواند به‌عنوان آرگومان کلیدواژه‌ای به :func:`!" +"partial` ارسال شود." msgid "Added support for :data:`Placeholder` in positional arguments." -msgstr "" +msgstr "پشتیبانی از :data:`Placeholder` در آرگومان‌های جایگاهی اضافه شد." -msgid "Return a new :class:`partialmethod` descriptor which behaves like :class:`partial` except that it is designed to be used as a method definition rather than being directly callable." +msgid "" +"Return a new :class:`partialmethod` descriptor which behaves " +"like :class:`partial` except that it is designed to be used as a method " +"definition rather than being directly callable." msgstr "" +"یک توصیف‌گر :class:`partialmethod` جدید برمی‌گرداند که مانند :class:`partial` " +"رفتار می‌کند، با این تفاوت که برای استفاده به‌عنوان تعریف متد طراحی شده است، " +"نه اینکه مستقیماً فراخوانی‌پذیر باشد." -msgid "*func* must be a :term:`descriptor` or a callable (objects which are both, like normal functions, are handled as descriptors)." +msgid "" +"*func* must be a :term:`descriptor` or a callable (objects which are both, " +"like normal functions, are handled as descriptors)." msgstr "" +"*func* باید یک :term:`توصیف‌گر ` یا فراخوانی‌پذیر باشد (اشیایی که " +"هر دو هستند، مانند توابع معمولی، به‌عنوان توصیف‌گر در نظر گرفته می‌شوند)." -msgid "When *func* is a descriptor (such as a normal Python function, :func:`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or another instance of :class:`partialmethod`), calls to ``__get__`` are delegated to the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." -msgstr "" +msgid "" +"When *func* is a descriptor (such as a normal Python " +"function, :func:`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` " +"or another instance of :class:`partialmethod`), calls to ``__get__`` are " +"delegated to the underlying descriptor, and an appropriate :ref:`partial " +"object ` returned as the result." +msgstr "" +"هنگامی که *func* یک توصیف‌گر (descriptor) باشد (مانند یک تابع معمولی " +"پایتون، :func:`classmethod`، :func:`staticmethod`، :func:`~abc.abstractmethod` " +"یا نمونه‌ای دیگر از :class:`partialmethod`)، فراخوانی‌های ``__get__`` به " +"توصیف‌گری زیربنایی محول می‌شوند و یک :ref:`شیء partial ` " +"مناسب به‌عنوان نتیجه برگردانده می‌شود." -msgid "When *func* is a non-descriptor callable, an appropriate bound method is created dynamically. This behaves like a normal Python function when used as a method: the *self* argument will be inserted as the first positional argument, even before the *args* and *keywords* supplied to the :class:`partialmethod` constructor." -msgstr "" +msgid "" +"When *func* is a non-descriptor callable, an appropriate bound method is " +"created dynamically. This behaves like a normal Python function when used " +"as a method: the *self* argument will be inserted as the first positional " +"argument, even before the *args* and *keywords* supplied to " +"the :class:`partialmethod` constructor." +msgstr "" +"هنگامی که *func* یک شیء قابل فراخوانی غیرتوصیف‌گر باشد، یک متد مقید مناسب " +"به‌صورت پویا ایجاد می‌شود. این متد هنگامی که به‌عنوان یک متد استفاده شود، " +"مانند یک تابع معمولی پایتون رفتار می‌کند: آرگومان *self* به‌عنوان اولین " +"آرگومان جایگاهی درج می‌شود، حتی پیش از *args* و *keywords* ارائه‌شده به " +"سازنده‌ی :class:`partialmethod`." msgid "" ">>> class Cell:\n" @@ -343,12 +805,46 @@ msgid "" ">>> c.alive\n" "True" msgstr "" +">>> class Cell:\n" +"... def __init__(self):\n" +"... self._alive = False\n" +"... @property\n" +"... def alive(self):\n" +"... return self._alive\n" +"... def set_state(self, state):\n" +"... self._alive = bool(state)\n" +"... set_alive = partialmethod(set_state, True)\n" +"... set_dead = partialmethod(set_state, False)\n" +"...\n" +">>> c = Cell()\n" +">>> c.alive\n" +"False\n" +">>> c.set_alive()\n" +">>> c.alive\n" +"True" -msgid "Apply *function* of two arguments cumulatively to the items of *iterable*, from left to right, so as to reduce the iterable to a single value. For example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates ``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and the right argument, *y*, is the update value from the *iterable*. If the optional *initial* is present, it is placed before the items of the iterable in the calculation, and serves as a default when the iterable is empty. If *initial* is not given and *iterable* contains only one item, the first item is returned." -msgstr "" +msgid "" +"Apply *function* of two arguments cumulatively to the items of *iterable*, " +"from left to right, so as to reduce the iterable to a single value. For " +"example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates " +"``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and " +"the right argument, *y*, is the update value from the *iterable*. If the " +"optional *initial* is present, it is placed before the items of the " +"iterable in the calculation, and serves as a default when the iterable is " +"empty. If *initial* is not given and *iterable* contains only one item, " +"the first item is returned." +msgstr "" +"*function* با ۲ آرگومان را به‌صورت تجمیعی روی آیتم‌های *iterable*، از چپ به " +"راست، اعمال می‌کند تا پیمایش‌پذیر را به یک مقدار واحد کاهش دهد. برای مثال، " +"``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` ``((((1+2)+3)+4)+5)`` را " +"محاسبه می‌کند. آرگومان سمت چپ، *x*، مقدار انباشته‌شده است و آرگومان سمت راست، " +"*y*، مقدار به‌روزرسانی از *iterable* است. اگر *initial* اختیاری وجود داشته " +"باشد، در محاسبه پیش از آیتم‌های پیمایش‌پذیر قرار می‌گیرد و به‌عنوان مقدار پیش‌فرض " +"زمانی که پیمایش‌پذیر خالی است عمل می‌کند. اگر *initial* داده نشود و *iterable* " +"فقط یک آیتم داشته باشد، اولین آیتم برگردانده می‌شود." msgid "Roughly equivalent to::" -msgstr "" +msgstr "تقریباً معادل با::" msgid "" "initial_missing = object()\n" @@ -363,18 +859,43 @@ msgid "" " value = function(value, element)\n" " return value" msgstr "" +"initial_missing = object()\n" +"\n" +"def reduce(function, iterable, /, initial=initial_missing):\n" +" it = iter(iterable)\n" +" if initial is initial_missing:\n" +" value = next(it)\n" +" else:\n" +" value = initial\n" +" for element in it:\n" +" value = function(value, element)\n" +" return value" -msgid "See :func:`itertools.accumulate` for an iterator that yields all intermediate values." +msgid "" +"See :func:`itertools.accumulate` for an iterator that yields all " +"intermediate values." msgstr "" +"برای پیمایش‌گری که تمام مقادیر میانی را تولید " +"می‌کند، :func:`itertools.accumulate` را ببینید." msgid "*initial* is now supported as a keyword argument." -msgstr "" +msgstr "اکنون *initial* به‌عنوان یک آرگومان کلیدواژه‌ای پشتیبانی می‌شود." -msgid "Transform a function into a :term:`single-dispatch ` :term:`generic function`." +msgid "" +"Transform a function into a :term:`single-dispatch ` :term:`generic function`." msgstr "" +"یک تابع را به یک :term:`تابع عام ` :term:`تک‌اعزامی " +"` تبدیل می‌کند." -msgid "To define a generic function, decorate it with the ``@singledispatch`` decorator. When defining a function using ``@singledispatch``, note that the dispatch happens on the type of the first argument::" +msgid "" +"To define a generic function, decorate it with the ``@singledispatch`` " +"decorator. When defining a function using ``@singledispatch``, note that " +"the dispatch happens on the type of the first argument::" msgstr "" +"برای تعریف یک تابع عام، آن را با دکوراتور ``@singledispatch`` بیارایید. " +"هنگام تعریف یک تابع با استفاده از ``@singledispatch``، توجه داشته باشید که " +"اعزام (dispatch) بر اساس نوع اولین آرگومان انجام می‌شود::" msgid "" ">>> from functools import singledispatch\n" @@ -384,9 +905,23 @@ msgid "" "... print(\"Let me just say,\", end=\" \")\n" "... print(arg)" msgstr "" +">>> from functools import singledispatch\n" +">>> @singledispatch\n" +"... def fun(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Let me just say,\", end=\" \")\n" +"... print(arg)" -msgid "To add overloaded implementations to the function, use the :func:`!register` attribute of the generic function, which can be used as a decorator. For functions annotated with types, the decorator will infer the type of the first argument automatically::" +msgid "" +"To add overloaded implementations to the function, use the :func:`!" +"register` attribute of the generic function, which can be used as a " +"decorator. For functions annotated with types, the decorator will infer " +"the type of the first argument automatically::" msgstr "" +"برای افزودن پیاده‌سازی‌های سربارگذاری‌شده به تابع، از ویژگی :func:`!register` تابع " +"عام استفاده کنید، که می‌توان از آن به‌عنوان دکوراتور استفاده کرد. برای توابعی " +"که با نوع‌ها نمادگذاری شده‌اند، دکوراتور نوع اولین آرگومان را به‌طور خودکار " +"استنتاج می‌کند::" msgid "" ">>> @fun.register\n" @@ -402,9 +937,21 @@ msgid "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" msgstr "" +">>> @fun.register\n" +"... def _(arg: int, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> @fun.register\n" +"... def _(arg: list, verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" msgid ":class:`typing.Union` can also be used::" -msgstr "" +msgstr "همچنین می‌توان از :class:`typing.Union` استفاده کرد::" msgid "" ">>> @fun.register\n" @@ -422,9 +969,27 @@ msgid "" "... print(i, elem)\n" "..." msgstr "" +">>> @fun.register\n" +"... def _(arg: int | float, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> from typing import Union\n" +">>> @fun.register\n" +"... def _(arg: Union[list, set], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)\n" +"..." -msgid "For code which doesn't use type annotations, the appropriate type argument can be passed explicitly to the decorator itself::" +msgid "" +"For code which doesn't use type annotations, the appropriate type argument " +"can be passed explicitly to the decorator itself::" msgstr "" +"برای کدی که از حاشیه‌نویسی‌های نوع استفاده نمی‌کند، می‌توان آرگومان نوع مناسب " +"را به‌صراحت به خود دکوراتور منتقل کرد::" msgid "" ">>> @fun.register(complex)\n" @@ -434,9 +999,23 @@ msgid "" "... print(arg.real, arg.imag)\n" "..." msgstr "" +">>> @fun.register(complex)\n" +"... def _(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Better than complicated.\", end=\" \")\n" +"... print(arg.real, arg.imag)\n" +"..." -msgid "For code that dispatches on a collections type (e.g., ``list``), but wants to typehint the items of the collection (e.g., ``list[int]``), the dispatch type should be passed explicitly to the decorator itself with the typehint going into the function definition::" +msgid "" +"For code that dispatches on a collections type (e.g., ``list``), but wants " +"to typehint the items of the collection (e.g., ``list[int]``), the dispatch " +"type should be passed explicitly to the decorator itself with the typehint " +"going into the function definition::" msgstr "" +"برای کدی که بر اساس نوع یک مجموعه اعزام (dispatch) می‌کند (مثلاً ``list``)، " +"اما می‌خواهد راهنمای نوع (type hint) آیتم‌های مجموعه را مشخص کند (مثلاً " +"``list[int]``)، نوع اعزام (dispatch) باید به‌صراحت به خود دکوراتور ارسال شود " +"و راهنمای نوع (type hint) در تعریف تابع قرار بگیرد::" msgid "" ">>> @fun.register(list)\n" @@ -446,12 +1025,32 @@ msgid "" "... for i, elem in enumerate(arg):\n" "... print(i, elem)" msgstr "" +">>> @fun.register(list)\n" +"... def _(arg: list[int], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" -msgid "At runtime the function will dispatch on an instance of a list regardless of the type contained within the list i.e. ``[1,2,3]`` will be dispatched the same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in this example is for static type checkers only and has no runtime impact." +msgid "" +"At runtime the function will dispatch on an instance of a list regardless " +"of the type contained within the list i.e. ``[1,2,3]`` will be dispatched " +"the same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in " +"this example is for static type checkers only and has no runtime impact." msgstr "" +"در ران‌تایم، تابع بر اساس یک نمونه از فهرست اعزام (dispatch) می‌شود، صرف‌نظر " +"از نوع موجود در فهرست؛ یعنی ``[1,2,3]`` همانند ``[\"foo\", \"bar\", " +"\"baz\"]`` اعزام می‌شود. یادداشتارائه‌شده در این مثال فقط برای " +"بررسی‌کننده‌های نوع ایستا است و هیچ تأثیری در ران‌تایم ندارد." -msgid "To enable registering :term:`lambdas` and pre-existing functions, the :func:`~singledispatch.register` attribute can also be used in a functional form::" +msgid "" +"To enable registering :term:`lambdas ` and pre-existing functions, " +"the :func:`~singledispatch.register` attribute can also be used in a " +"functional form::" msgstr "" +"برای امکان‌پذیر کردن ثبت :term:`لامبداها ` و توابع از پیش موجود، " +"همچنین می‌توان از ویژگی :func:`~singledispatch.register` به‌شکل تابعی استفاده " +"کرد::" msgid "" ">>> def nothing(arg, verbose=False):\n" @@ -459,9 +1058,19 @@ msgid "" "...\n" ">>> fun.register(type(None), nothing)" msgstr "" +">>> def nothing(arg, verbose=False):\n" +"... print(\"Nothing.\")\n" +"...\n" +">>> fun.register(type(None), nothing)" -msgid "The :func:`~singledispatch.register` attribute returns the undecorated function. This enables decorator stacking, :mod:`pickling`, and the creation of unit tests for each variant independently::" +msgid "" +"The :func:`~singledispatch.register` attribute returns the undecorated " +"function. This enables decorator stacking, :mod:`pickling`, and the " +"creation of unit tests for each variant independently::" msgstr "" +"ویژگی :func:`~singledispatch.register` تابع بدون دکوراتور را برمی‌گرداند. " +"این امر امکان چیدن دکوراتورها روی هم، :mod:`pickling` و ایجاد یونیت " +"آزمون‌ها برای هر گونه به‌طور مستقل را فراهم می‌کند::" msgid "" ">>> @fun.register(float)\n" @@ -474,9 +1083,21 @@ msgid "" ">>> fun_num is fun\n" "False" msgstr "" +">>> @fun.register(float)\n" +"... @fun.register(Decimal)\n" +"... def fun_num(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Half of your number:\", end=\" \")\n" +"... print(arg / 2)\n" +"...\n" +">>> fun_num is fun\n" +"False" -msgid "When called, the generic function dispatches on the type of the first argument::" +msgid "" +"When called, the generic function dispatches on the type of the first " +"argument::" msgstr "" +"هنگام فراخوانی، تابع عام بر اساس نوع اولین آرگومان، اعزام (dispatch) می‌شود::" msgid "" ">>> fun(\"Hello, world.\")\n" @@ -496,12 +1117,42 @@ msgid "" ">>> fun(1.23)\n" "0.615" msgstr "" +">>> fun(\"Hello, world.\")\n" +"Hello, world.\n" +">>> fun(\"test.\", verbose=True)\n" +"Let me just say, test.\n" +">>> fun(42, verbose=True)\n" +"Strength in numbers, eh? 42\n" +">>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)\n" +"Enumerate this:\n" +"0 spam\n" +"1 spam\n" +"2 eggs\n" +"3 spam\n" +">>> fun(None)\n" +"Nothing.\n" +">>> fun(1.23)\n" +"0.615" -msgid "Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. The original function decorated with ``@singledispatch`` is registered for the base :class:`object` type, which means it is used if no better implementation is found." +msgid "" +"Where there is no registered implementation for a specific type, its method " +"resolution order is used to find a more generic implementation. The " +"original function decorated with ``@singledispatch`` is registered for the " +"base :class:`object` type, which means it is used if no better " +"implementation is found." msgstr "" +"هرگاه برای یک نوع خاص، پیاده‌سازی ثبت‌شده‌ای وجود نداشته باشد، از ترتیب حل متد " +"آن برای یافتن یک پیاده‌سازی عام‌تر استفاده می‌شود. تابع اصلی که با " +"``@singledispatch`` آراسته شده است، برای نوع پایه‌ی :class:`object` ثبت شده " +"است؛ این یعنی اگر پیاده‌سازی بهتری یافت نشود، از آن استفاده می‌شود." -msgid "If an implementation is registered to an :term:`abstract base class`, virtual subclasses of the base class will be dispatched to that implementation::" +msgid "" +"If an implementation is registered to an :term:`abstract base class`, " +"virtual subclasses of the base class will be dispatched to that " +"implementation::" msgstr "" +"اگر یک پیاده‌سازی برای یک :term:`abstract base class` ثبت شده باشد، " +"زیرکلاس‌های مجازیِ کلاس پایه به آن پیاده‌سازی ارسال می‌شوند::" msgid "" ">>> from collections.abc import Mapping\n" @@ -515,9 +1166,23 @@ msgid "" ">>> fun({\"a\": \"b\"})\n" "a => b" msgstr "" +">>> from collections.abc import Mapping\n" +">>> @fun.register\n" +"... def _(arg: Mapping, verbose=False):\n" +"... if verbose:\n" +"... print(\"Keys & Values\")\n" +"... for key, value in arg.items():\n" +"... print(key, \"=>\", value)\n" +"...\n" +">>> fun({\"a\": \"b\"})\n" +"a => b" -msgid "To check which implementation the generic function will choose for a given type, use the ``dispatch()`` attribute::" +msgid "" +"To check which implementation the generic function will choose for a given " +"type, use the ``dispatch()`` attribute::" msgstr "" +"برای بررسی این‌که تابع عام کدام پیاده‌سازی را برای یک نوع مشخص انتخاب " +"می‌کند، از ویژگی ``dispatch()`` استفاده کنید::" msgid "" ">>> fun.dispatch(float)\n" @@ -525,9 +1190,17 @@ msgid "" ">>> fun.dispatch(dict) # note: default implementation\n" "" msgstr "" +">>> fun.dispatch(float)\n" +"\n" +">>> fun.dispatch(dict) # note: default implementation\n" +"" -msgid "To access all registered implementations, use the read-only ``registry`` attribute::" +msgid "" +"To access all registered implementations, use the read-only ``registry`` " +"attribute::" msgstr "" +"برای دسترسی به همه پیاده‌سازی‌های ثبت‌شده، از ویژگی ``registry`` فقط‌خواندنی " +"استفاده کنید::" msgid "" ">>> fun.registry.keys()\n" @@ -539,18 +1212,46 @@ msgid "" ">>> fun.registry[object]\n" "" msgstr "" +">>> fun.registry.keys()\n" +"dict_keys([, , ,\n" +" , ,\n" +" ])\n" +">>> fun.registry[float]\n" +"\n" +">>> fun.registry[object]\n" +"" -msgid "The :func:`~singledispatch.register` attribute now supports using type annotations." +msgid "" +"The :func:`~singledispatch.register` attribute now supports using type " +"annotations." msgstr "" +"ویژگی :func:`~singledispatch.register` اکنون از حاشیه‌نویسی‌های نوع (type " +"annotations) پشتیبانی می‌کند." -msgid "The :func:`~singledispatch.register` attribute now supports :class:`typing.Union` as a type annotation." +msgid "" +"The :func:`~singledispatch.register` attribute now " +"supports :class:`typing.Union` as a type annotation." msgstr "" +"ویژگی :func:`~singledispatch.register` اکنون از :class:`typing.Union` " +"به‌عنوان یک حاشیه‌نویسی نوع پشتیبانی می‌کند." -msgid "Transform a method into a :term:`single-dispatch ` :term:`generic function`." +msgid "" +"Transform a method into a :term:`single-dispatch ` :term:`generic function`." msgstr "" +"یک متد را به یک :term:`تابع عام ` :term:`تک‌اعزامی " +"(single-dispatch) ` تبدیل می‌کند." -msgid "To define a generic method, decorate it with the ``@singledispatchmethod`` decorator. When defining a method using ``@singledispatchmethod``, note that the dispatch happens on the type of the first non-*self* or non-*cls* argument::" +msgid "" +"To define a generic method, decorate it with the ``@singledispatchmethod`` " +"decorator. When defining a method using ``@singledispatchmethod``, note " +"that the dispatch happens on the type of the first non-*self* or non-*cls* " +"argument::" msgstr "" +"برای تعریف یک متد عام، از دکوراتور ``@singledispatchmethod`` استفاده کنید. " +"هنگام تعریف یک متد با استفاده از ``@singledispatchmethod``، توجه داشته " +"باشید که اعزام (dispatch) بر اساس نوع اولین آرگومان به‌جز *self* یا *cls* " +"صورت می‌گیرد::" msgid "" "class Negator:\n" @@ -566,9 +1267,31 @@ msgid "" " def _(self, arg: bool):\n" " return not arg" msgstr "" +"class Negator:\n" +" @singledispatchmethod\n" +" def neg(self, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" def _(self, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" def _(self, arg: bool):\n" +" return not arg" -msgid "``@singledispatchmethod`` supports nesting with other decorators such as :deco:`classmethod`. Note that to allow for ``dispatcher.register``, ``singledispatchmethod`` must be the *outer most* decorator. Here is the ``Negator`` class with the ``neg`` methods bound to the class, rather than an instance of the class::" -msgstr "" +msgid "" +"``@singledispatchmethod`` supports nesting with other decorators such " +"as :deco:`classmethod`. Note that to allow for ``dispatcher.register``, " +"``singledispatchmethod`` must be the *outer most* decorator. Here is the " +"``Negator`` class with the ``neg`` methods bound to the class, rather than " +"an instance of the class::" +msgstr "" +"``@singledispatchmethod`` از تودرتو شدن با سایر دکوراتورها " +"مانند :deco:`classmethod` پشتیبانی می‌کند. توجه داشته باشید که برای امکان " +"استفاده از ``dispatcher.register``، ``singledispatchmethod`` باید " +"*بیرونی‌ترین* دکوراتور باشد. در اینجا کلاس ``Negator`` با متدهای ``neg`` " +"آمده است که به‌جای نمونه‌ای از کلاس، به خود کلاس متصل شده‌اند::" msgid "" "class Negator:\n" @@ -587,33 +1310,117 @@ msgid "" " def _(cls, arg: bool):\n" " return not arg" msgstr "" +"class Negator:\n" +" @singledispatchmethod\n" +" @classmethod\n" +" def neg(cls, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: bool):\n" +" return not arg" -msgid "The same pattern can be used for other similar decorators: :deco:`staticmethod`, :deco:`~abc.abstractmethod`, and others." +msgid "" +"The same pattern can be used for other similar " +"decorators: :deco:`staticmethod`, :deco:`~abc.abstractmethod`, and others." msgstr "" +"می‌توان از همین الگو برای دکوراتورهای مشابه دیگر نیز استفاده " +"کرد: :deco:`staticmethod`، :deco:`~abc.abstractmethod` و دیگر موارد." -msgid "Update a *wrapper* function to look like the *wrapped* function. The optional arguments are tuples to specify which attributes of the original function are assigned directly to the matching attributes on the wrapper function and which attributes of the wrapper function are updated with the corresponding attributes from the original function. The default values for these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` (which assigns to the wrapper function's :attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__annotations__`, :attr:`~function.__type_params__`, and :attr:`~function.__doc__`, the documentation string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's :attr:`~function.__dict__`, i.e. the instance dictionary)." -msgstr "" +msgid "" +"Update a *wrapper* function to look like the *wrapped* function. The " +"optional arguments are tuples to specify which attributes of the original " +"function are assigned directly to the matching attributes on the wrapper " +"function and which attributes of the wrapper function are updated with the " +"corresponding attributes from the original function. The default values for " +"these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " +"(which assigns to the wrapper " +"function's :attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__annotations__`, :attr:`~function.__type_params__`, " +"and :attr:`~function.__doc__`, the documentation string) and " +"``WRAPPER_UPDATES`` (which updates the wrapper " +"function's :attr:`~function.__dict__`, i.e. the instance dictionary)." +msgstr "" +"یک تابع *پوششی* را به‌روزرسانی کنید تا شبیه تابع *پوشیده‌شده* به نظر برسد. " +"آرگومان‌های اختیاری، تاپل‌هایی هستند که مشخص می‌کنند کدام ویژگی‌های تابع اصلی " +"مستقیماً به ویژگی‌های متناظر در تابع پوششی انتساب داده می‌شوند و کدام ویژگی‌های " +"تابع پوششی با ویژگی‌های متناظر از تابع اصلی به‌روزرسانی می‌شوند. مقادیر پیش‌فرض " +"این آرگومان‌ها، ثابت‌های سطح ماژول ``WRAPPER_ASSIGNMENTS`` (که به ویژگی‌های " +"تابع پوششی " +"شامل :attr:`~function.__module__`، :attr:`~function.__name__`، :attr:`~function.__qualname__`، :attr:`~function.__annotations__`، :attr:`~function.__type_params__` " +"و :attr:`~function.__doc__`، یعنی رشته مستندسازی، مقدار انتساب می‌دهد) و " +"``WRAPPER_UPDATES`` (که :attr:`~function.__dict__` تابع پوششی، یعنی دیکشنری " +"نمونه، را به‌روزرسانی می‌کند) هستند." -msgid "To allow access to the original function for introspection and other purposes (e.g. bypassing a caching decorator such as :deco:`lru_cache`), this function automatically adds a ``__wrapped__`` attribute to the wrapper that refers to the function being wrapped." +msgid "" +"To allow access to the original function for introspection and other " +"purposes (e.g. bypassing a caching decorator such as :deco:`lru_cache`), " +"this function automatically adds a ``__wrapped__`` attribute to the wrapper " +"that refers to the function being wrapped." msgstr "" +"برای امکان دسترسی به تابع اصلی جهت درون‌نگری و سایر اهداف (مثلاً دور زدن یک " +"دکوراتور نهان‌سازی مانند :deco:`lru_cache`)، این تابع به‌طور خودکار یک ویژگی " +"``__wrapped__`` را که به تابع پوشیده‌شده اشاره می‌کند، به تابع پوششی اضافه " +"می‌کند." -msgid "The main intended use for this function is in :term:`decorator` functions which wrap the decorated function and return the wrapper. If the wrapper function is not updated, the metadata of the returned function will reflect the wrapper definition rather than the original function definition, which is typically less than helpful." +msgid "" +"The main intended use for this function is in :term:`decorator` functions " +"which wrap the decorated function and return the wrapper. If the wrapper " +"function is not updated, the metadata of the returned function will reflect " +"the wrapper definition rather than the original function definition, which " +"is typically less than helpful." msgstr "" +"کاربرد اصلی در نظر گرفته‌شده برای این تابع، در توابع :term:`دکوراتور، آراینده ` است که تابع دکورشده را می‌پوشانند و تابع پوششی را برمی‌گردانند. اگر تابع پوششی به‌روزرسانی نشود، فراداده تابع برگردانده‌شده، تعریف تابع پوششی را به جای تعریف تابع اصلی منعکس می‌کند، که معمولاً چندان مفید نیست." -msgid ":func:`update_wrapper` may be used with callables other than functions. Any attributes named in *assigned* or *updated* that are missing from the object being wrapped are ignored (i.e. this function will not attempt to set them on the wrapper function). :exc:`AttributeError` is still raised if the wrapper function itself is missing any attributes named in *updated*." -msgstr "" +msgid "" +":func:`update_wrapper` may be used with callables other than functions. Any " +"attributes named in *assigned* or *updated* that are missing from the " +"object being wrapped are ignored (i.e. this function will not attempt to " +"set them on the wrapper function). :exc:`AttributeError` is still raised if " +"the wrapper function itself is missing any attributes named in *updated*." +msgstr "" +":func:`update_wrapper` می‌تواند با فراخواندنی‌هایی غیر از توابع نیز استفاده " +"شود. هر یک از ویژگی‌هایی که در *assigned* یا *updated* نام برده شده‌اند و در " +"شیءای که پوشش داده می‌شود وجود نداشته باشند، نادیده گرفته می‌شوند (یعنی این " +"تابع تلاش نخواهد کرد آن‌ها را روی تابع پوششی تنظیم کند). اگر خود تابع پوششی " +"فاقد هر یک از ویژگی‌هایی باشد که در *updated* نام برده شده‌اند، " +"همچنان :exc:`AttributeError` پرتاب می‌شود." -msgid "The ``__wrapped__`` attribute is now automatically added. The :attr:`~function.__annotations__` attribute is now copied by default. Missing attributes no longer trigger an :exc:`AttributeError`." +msgid "" +"The ``__wrapped__`` attribute is now automatically added. " +"The :attr:`~function.__annotations__` attribute is now copied by default. " +"Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" +"ویژگی ``__wrapped__`` اکنون به‌صورت خودکار اضافه می‌شود. " +"ویژگی :attr:`~function.__annotations__` اکنون به‌طور پیش‌فرض کپی می‌شود. " +"ویژگی‌های ناموجود دیگر باعث :exc:`AttributeError` نمی‌شوند." -msgid "The ``__wrapped__`` attribute now always refers to the wrapped function, even if that function defined a ``__wrapped__`` attribute. (see :issue:`17482`)" +msgid "" +"The ``__wrapped__`` attribute now always refers to the wrapped function, " +"even if that function defined a ``__wrapped__`` attribute. " +"(see :issue:`17482`)" msgstr "" +"ویژگی ``__wrapped__`` اکنون همیشه به تابع پوشش‌داده‌شده ارجاع می‌دهد، حتی اگر " +"آن تابع ویژگی ``__wrapped__`` را تعریف کرده باشد. (ببینید :issue:`17482`)" -msgid "The :attr:`~function.__type_params__` attribute is now copied by default." -msgstr "" +msgid "" +"The :attr:`~function.__type_params__` attribute is now copied by default." +msgstr "ویژگی :attr:`~function.__type_params__` اکنون به‌طور پیش‌فرض کپی می‌شود." -msgid "This is a convenience function for invoking :func:`update_wrapper` as a function decorator when defining a wrapper function. It is equivalent to ``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)``. For example::" +msgid "" +"This is a convenience function for invoking :func:`update_wrapper` as a " +"function decorator when defining a wrapper function. It is equivalent to " +"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, " +"updated=updated)``. For example::" msgstr "" +"این یک تابع راحتی برای فراخوانی :func:`update_wrapper` به‌عنوان دکوراتور " +"تابع هنگام تعریف یک تابع پوششی است. این معادل ``partial(update_wrapper, " +"wrapped=wrapped, assigned=assigned, updated=updated)`` است. برای مثال::" msgid "" ">>> from functools import wraps\n" @@ -637,24 +1444,75 @@ msgid "" ">>> example.__doc__\n" "'Docstring'" msgstr "" +">>> from functools import wraps\n" +">>> def my_decorator(f):\n" +"... @wraps(f)\n" +"... def wrapper(*args, **kwds):\n" +"... print('Calling decorated function')\n" +"... return f(*args, **kwds)\n" +"... return wrapper\n" +"...\n" +">>> @my_decorator\n" +"... def example():\n" +"... \"\"\"Docstring\"\"\"\n" +"... print('Called example function')\n" +"...\n" +">>> example()\n" +"Calling decorated function\n" +"Called example function\n" +">>> example.__name__\n" +"'example'\n" +">>> example.__doc__\n" +"'Docstring'" -msgid "Without the use of this decorator factory, the name of the example function would have been ``'wrapper'``, and the docstring of the original :func:`!example` would have been lost." +msgid "" +"Without the use of this decorator factory, the name of the example function " +"would have been ``'wrapper'``, and the docstring of the original :func:`!" +"example` would have been lost." msgstr "" +"بدون استفاده از این کارخانه‌ی دکوراتور، نام تابع نمونه ``'wrapper'`` می‌شد و " +"رشته‌ی مستندسازی تابع اصلی :func:`!example` از بین می‌رفت." msgid ":class:`partial` Objects" -msgstr "" +msgstr "اشیای :class:`partial`" -msgid ":class:`partial` objects are callable objects created by :func:`partial`. They have three read-only attributes:" +msgid "" +":class:`partial` objects are callable objects created by :func:`partial`. " +"They have three read-only attributes:" msgstr "" +"اشیای :class:`partial`، اشیای فراخوانی‌پذیری هستند که توسط :func:`partial` " +"ایجاد شده‌اند. آن‌ها ۳ ویژگی فقط‌خواندنی دارند:" -msgid "A callable object or function. Calls to the :class:`partial` object will be forwarded to :attr:`func` with new arguments and keywords." +msgid "" +"A callable object or function. Calls to the :class:`partial` object will " +"be forwarded to :attr:`func` with new arguments and keywords." msgstr "" +"یک شیء یا تابع فراخواندنی. فراخوانی‌های شیء :class:`partial` به :attr:`func` " +"ارجاع داده می‌شوند، همراه با آرگومان‌ها و کلیدواژه‌های جدید." -msgid "The leftmost positional arguments that will be prepended to the positional arguments provided to a :class:`partial` object call." +msgid "" +"The leftmost positional arguments that will be prepended to the positional " +"arguments provided to a :class:`partial` object call." msgstr "" +"چپ‌ترین آرگومان‌های جایگاهی که به ابتدای آرگومان‌های جایگاهی ارائه‌شده به " +"فراخوانی شیء :class:`partial` اضافه می‌شوند." -msgid "The keyword arguments that will be supplied when the :class:`partial` object is called." +msgid "" +"The keyword arguments that will be supplied when the :class:`partial` " +"object is called." msgstr "" +"آرگومان‌های کلیدواژه‌ای که هنگام فراخوانی شیء :class:`partial` تأمین خواهند " +"شد." -msgid ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have attributes. There are some important differences. For instance, the :attr:`~definition.__name__` and :attr:`~definition.__doc__` attributes are not created automatically." -msgstr "" +msgid "" +":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " +"attributes. There are some important differences. For instance, " +"the :attr:`~definition.__name__` and :attr:`~definition.__doc__` attributes " +"are not created automatically." +msgstr "" +"اشیاء :class:`partial` از این جهت شبیه :ref:`اشیاء تابعی ` هستند که قابل فراخوانی و قابل ارجاع ضعیف (weak referenceable) هستند " +"و می‌توانند ویژگی داشته باشند. برخی تفاوت‌های مهم وجود دارد. برای مثال، " +"ویژگی‌های :attr:`~definition.__name__` و :attr:`~definition.__doc__` به‌صورت " +"خودکار ایجاد نمی‌شوند." diff --git a/library/gc.po b/library/gc.po index 6c9eb47d1..f775a2bbb 100644 --- a/library/gc.po +++ b/library/gc.po @@ -22,115 +22,302 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!gc` --- Garbage Collector interface" -msgstr "" +msgstr ":mod:`!gc` --- رابط زباله‌رو" -msgid "This module provides an interface to the optional garbage collector. It provides the ability to disable the collector, tune the collection frequency, and set debugging options. It also provides access to unreachable objects that the collector found but cannot free. Since the collector supplements the reference counting already used in Python, you can disable the collector if you are sure your program does not create reference cycles. Automatic collection can be disabled by calling ``gc.disable()``. To debug a leaking program call ``gc.set_debug(gc.DEBUG_LEAK)``. Notice that this includes ``gc.DEBUG_SAVEALL``, causing garbage-collected objects to be saved in gc.garbage for inspection." -msgstr "" +msgid "" +"This module provides an interface to the optional garbage collector. It " +"provides the ability to disable the collector, tune the collection " +"frequency, and set debugging options. It also provides access to " +"unreachable objects that the collector found but cannot free. Since the " +"collector supplements the reference counting already used in Python, you can" +" disable the collector if you are sure your program does not create " +"reference cycles. Automatic collection can be disabled by calling " +"``gc.disable()``. To debug a leaking program call " +"``gc.set_debug(gc.DEBUG_LEAK)``. Notice that this includes " +"``gc.DEBUG_SAVEALL``, causing garbage-collected objects to be saved in " +"gc.garbage for inspection." +msgstr "" +"این ماژول رابطی برای جمع‌آور زباله اختیاری فراهم می‌کند. این ماژول توانایی " +"غیرفعال کردن جمع‌آور، تنظیم بسامد جمع‌آوری و تنظیم گزینه‌های اشکال‌زدایی را " +"فراهم می‌کند. همچنین به اشیای غیرقابل‌دسترسی که جمع‌آور آن‌ها را پیدا کرده " +"است اما نمی‌تواند آزاد کند، دسترسی می‌دهد. از آنجا که جمع‌آور، شمارش ارجاعی " +"را که از قبل در پایتون استفاده می‌شود تکمیل می‌کند، اگر مطمئن هستید برنامه " +"شما چرخه‌های ارجاع ایجاد نمی‌کند، می‌توانید جمع‌آور را غیرفعال کنید. " +"جمع‌آوری خودکار می‌تواند با فراخوانی ``gc.disable()`` غیرفعال شود. برای " +"اشکال‌زدایی یک برنامه دارای نشتی، ``gc.set_debug(gc.DEBUG_LEAK)`` را " +"فراخوانی کنید. توجه داشته باشید که این شامل ``gc.DEBUG_SAVEALL`` نیز می‌شود " +"و باعث می‌شود اشیای زباله‌روبی‌شده در gc.garbage برای بازرسی ذخیره شوند." msgid "The :mod:`!gc` module provides the following functions:" -msgstr "" +msgstr "ماژول :mod:`!gc` توابع زیر را فراهم می‌کند:" msgid "Enable automatic garbage collection." -msgstr "" +msgstr "فعال‌سازی زباله‌روبی خودکار." msgid "Disable automatic garbage collection." -msgstr "" +msgstr "غیرفعال‌سازی زباله‌روبی خودکار." msgid "Return ``True`` if automatic collection is enabled." -msgstr "" +msgstr "اگر زباله‌روبی خودکار فعال باشد، ``True`` را برمی‌گرداند." -msgid "With no arguments, run a full collection. The optional argument *generation* may be an integer specifying which generation to collect (from 0 to 2). A :exc:`ValueError` is raised if the generation number is invalid. The sum of collected objects and uncollectable objects is returned." +msgid "" +"With no arguments, run a full collection. The optional argument " +"*generation* may be an integer specifying which generation to collect (from " +"0 to 2). A :exc:`ValueError` is raised if the generation number is invalid." +" The sum of collected objects and uncollectable objects is returned." msgstr "" +"بدون آرگومان، یک زباله‌روبی کامل اجرا می‌شود. آرگومان اختیاری *generation* " +"می‌تواند یک عدد صحیح باشد که مشخص می‌کند کدام نسل باید زباله‌روبی شود (از ۰ " +"تا ۲). اگر شماره نسل نامعتبر باشد، یک :exc:`ValueError` پرتاب می‌شود. مجموع " +"اشیای جمع‌آوری‌شده و اشیای غیرقابل جمع‌آوری برگردانده می‌شود." -msgid "The free lists maintained for a number of built-in types are cleared whenever a full collection or collection of the highest generation (2) is run. Not all items in some free lists may be freed due to the particular implementation, in particular :class:`float`." +msgid "" +"The free lists maintained for a number of built-in types are cleared " +"whenever a full collection or collection of the highest generation (2) is " +"run. Not all items in some free lists may be freed due to the particular " +"implementation, in particular :class:`float`." msgstr "" +"هر زمان که یک زباله‌روبی کامل یا زباله‌روبی بالاترین نسل (۲) اجرا شود، " +"فهرست‌های آزاد (free lists) که برای تعدادی از انواع توکار نگهداری می‌شوند، " +"پاک می‌شوند. ممکن است به دلیل جزئیات پیاده‌سازی، همه‌ی آیتم‌های موجود در " +"برخی فهرست‌های آزاد آزاد نشوند، به‌ویژه در مورد :class:`float`." -msgid "The effect of calling ``gc.collect()`` while the interpreter is already performing a collection is undefined." +msgid "" +"The effect of calling ``gc.collect()`` while the interpreter is already " +"performing a collection is undefined." msgstr "" +"اثر فراخوانی ``gc.collect()`` در حالی که مفسر از قبل در حال انجام زباله‌روبی" +" است، تعریف‌نشده است." msgid "``generation=1`` performs an increment of collection." -msgstr "" +msgstr "``generation=1`` یک افزایش زباله‌روبی را انجام می‌دهد." msgid "``generation=1`` performs collection of the middle generation." -msgstr "" +msgstr "``generation=1`` زباله‌روبی نسل میانی را انجام می‌دهد." -msgid "Set the garbage collection debugging flags. Debugging information will be written to ``sys.stderr``. See below for a list of debugging flags which can be combined using bit operations to control debugging." +msgid "" +"Set the garbage collection debugging flags. Debugging information will be " +"written to ``sys.stderr``. See below for a list of debugging flags which " +"can be combined using bit operations to control debugging." msgstr "" +"پرچم‌های اشکال‌زدایی زباله‌روبی را تنظیم کنید. اطلاعات اشکال‌زدایی در " +"``sys.stderr`` نوشته خواهد شد. برای مشاهده فهرستی از پرچم‌های اشکال‌زدایی که" +" می‌توان آن‌ها را با استفاده از عملیات بیتی برای کنترل اشکال‌زدایی ترکیب " +"کرد، به ادامه مراجعه کنید." msgid "Return the debugging flags currently set." -msgstr "" +msgstr "پرچم‌های اشکال‌زدایی را که در حال حاضر تنظیم شده‌اند، برمی‌گرداند." -msgid "Returns a list of all objects tracked by the collector, excluding the list returned. If *generation* is not ``None``, return only the objects tracked by the collector that are in that generation." +msgid "" +"Returns a list of all objects tracked by the collector, excluding the list " +"returned. If *generation* is not ``None``, return only the objects tracked " +"by the collector that are in that generation." msgstr "" +"فهرستی از تمام اشیای پیگیری‌شده توسط جمع‌کننده را بازمی‌گرداند، به‌جز " +"فهرست برگردانده‌شده. اگر *generation* برابر ``None`` نباشد، فقط اشیای " +"پیگیری‌شده توسط جمع‌کننده را که در آن نسل قرار دارند، بازمی‌گرداند." msgid "New *generation* parameter." -msgstr "" +msgstr "پارامتر *generation* جدید." msgid "Generation 1 is removed" -msgstr "" +msgstr "نسل ۱ حذف می‌شود" msgid "Generation 1 is reintroduced to maintain GC behavior from 3.13." -msgstr "" +msgstr "نسل ۱ دوباره معرفی شده است تا رفتار زباله‌روبی از 3.13 حفظ شود." -msgid "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument ``generation``." +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " +"``generation``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``gc.get_objects`` را با آرگومان " +"``generation`` پرتاب می‌کند." -msgid "Return a list of three per-generation dictionaries containing collection statistics since interpreter start. The number of keys may change in the future, but currently each dictionary will contain the following items:" +msgid "" +"Return a list of three per-generation dictionaries containing collection " +"statistics since interpreter start. The number of keys may change in the " +"future, but currently each dictionary will contain the following items:" msgstr "" +"فهرستی از سه دیکشنری به‌ازای هر نسل حاوی آمار زباله‌روبی از آغاز مفسر " +"برمی‌گرداند. تعداد کلیدها ممکن است در آینده تغییر کند، اما در حال حاضر هر " +"دیکشنری شامل آیتم‌های زیر خواهد بود:" msgid "``collections`` is the number of times this generation was collected;" -msgstr "" +msgstr "``collections`` تعداد دفعاتی است که این نسل جمع‌آوری شده است؛" -msgid "``collected`` is the total number of objects collected inside this generation;" -msgstr "" +msgid "" +"``collected`` is the total number of objects collected inside this " +"generation;" +msgstr "``collected`` تعداد کل اشیایی است که در این نسل جمع‌آوری شده‌اند؛" -msgid "``uncollectable`` is the total number of objects which were found to be uncollectable (and were therefore moved to the :data:`garbage` list) inside this generation." +msgid "" +"``uncollectable`` is the total number of objects which were found to be " +"uncollectable (and were therefore moved to the :data:`garbage` list) inside " +"this generation." msgstr "" +"``uncollectable`` تعداد کل اشیایی است که در این نسل غیرقابل جمع‌آوری تشخیص " +"داده شدند (و بنابراین به فهرست :data:`garbage` منتقل شدند)." -msgid "Set the garbage collection thresholds (the collection frequency). Setting *threshold0* to zero disables collection." +msgid "" +"Set the garbage collection thresholds (the collection frequency). Setting " +"*threshold0* to zero disables collection." msgstr "" +"آستانه‌های زباله‌روبی (فرکانس جمع‌آوری) را تنظیم کنید. قرار دادن " +"*threshold0* روی ۰، جمع‌آوری را غیرفعال می‌کند." -msgid "The GC classifies objects into three generations depending on how many collection sweeps they have survived. New objects are placed in the youngest generation (generation ``0``). If an object survives a collection it is moved into the next older generation. Since generation ``2`` is the oldest generation, objects in that generation remain there after a collection. In order to decide when to run, the collector keeps track of the number object allocations and deallocations since the last collection. When the number of allocations minus the number of deallocations exceeds *threshold0*, collection starts. Initially only generation ``0`` is examined. If generation ``0`` has been examined more than *threshold1* times since generation ``1`` has been examined, then generation ``1`` is examined as well. With the third generation, things are a bit more complicated, see `Collecting the oldest generation `_ for more information." -msgstr "" +msgid "" +"The GC classifies objects into three generations depending on how many " +"collection sweeps they have survived. New objects are placed in the " +"youngest generation (generation ``0``). If an object survives a collection " +"it is moved into the next older generation. Since generation ``2`` is the " +"oldest generation, objects in that generation remain there after a " +"collection. In order to decide when to run, the collector keeps track of " +"the number object allocations and deallocations since the last collection. " +"When the number of allocations minus the number of deallocations exceeds " +"*threshold0*, collection starts. Initially only generation ``0`` is " +"examined. If generation ``0`` has been examined more than *threshold1* " +"times since generation ``1`` has been examined, then generation ``1`` is " +"examined as well. With the third generation, things are a bit more " +"complicated, see `Collecting the oldest generation " +"`_ for more information." +msgstr "" +"GC اشیاء را بسته به اینکه از چند دور زباله‌روبی جان به در برده‌اند، به سه " +"نسل طبقه‌بندی می‌کند. اشیاء جدید در جوان‌ترین نسل (نسل ``0``) قرار می‌گیرند." +" اگر شیء از یک زباله‌روبی جان به در ببرد، به نسل قدیمی‌تر بعدی منتقل می‌شود." +" از آنجا که نسل ``2`` قدیمی‌ترین نسل است، اشیاء موجود در آن نسل پس از " +"زباله‌روبی در همان‌جا باقی می‌مانند. جمع‌کننده برای تصمیم‌گیری درباره زمان " +"اجرا، تعداد تخصیص‌ها و آزادسازی‌های اشیاء از آخرین زباله‌روبی را پیگیری " +"می‌کند. هنگامی که تعداد تخصیص‌ها منهای تعداد آزادسازی‌ها از *threshold0* " +"بیشتر شود، زباله‌روبی آغاز می‌شود. در ابتدا فقط نسل ``0`` بررسی می‌شود. اگر " +"نسل ``0`` از زمانی که نسل ``1`` بررسی شده است بیش از *threshold1* بار بررسی " +"شده باشد، نسل ``1`` نیز بررسی می‌شود. در مورد نسل سوم، اوضاع کمی پیچیده‌تر " +"است؛ برای اطلاعات بیشتر `جمع‌آوری قدیمی‌ترین نسل " +"`_ را ببینید." -msgid "In the free-threaded build, the increase in process memory usage is also checked before running the collector. If the memory usage has not increased by 10% since the last collection and the net number of object allocations has not exceeded 40 times *threshold0*, the collection is not run." +msgid "" +"In the free-threaded build, the increase in process memory usage is also " +"checked before running the collector. If the memory usage has not increased" +" by 10% since the last collection and the net number of object allocations " +"has not exceeded 40 times *threshold0*, the collection is not run." msgstr "" +"در ساخت آزادنخی (free-threaded build)، افزایش مصرف حافظه‌ی فرایند نیز پیش از" +" اجرای جمع‌آور بررسی می‌شود. اگر مصرف حافظه از زمان آخرین جمع‌آوری ۱۰ درصد " +"افزایش پیدا نکرده باشد و تعداد خالص تخصیص‌های شیء از ۴۰ برابر *threshold0* " +"فراتر نرفته باشد، جمع‌آوری اجرا نمی‌شود." -msgid "See `Garbage collector design `_ for more information." +msgid "" +"See `Garbage collector design " +"`_" +" for more information." msgstr "" +"برای اطلاعات بیشتر، `طراحی زباله‌رو " +"`_" +" را ببینید." msgid "*threshold2* is ignored" -msgstr "" +msgstr "*threshold2* نادیده گرفته می‌شود" msgid "*threshold2* is restored to match Python 3.13 behavior." -msgstr "" +msgstr "*threshold2* برای مطابقت با رفتار پایتون 3.13 بازگردانده شده است." -msgid "Return the current collection counts as a tuple of ``(count0, count1, count2)``." +msgid "" +"Return the current collection counts as a tuple of ``(count0, count1, " +"count2)``." msgstr "" +"شمارش‌های فعلی جمع‌آوری را به‌صورت یک تاپل از ``(count0, count1, count2)`` " +"برمی‌گرداند." -msgid "Return the current collection thresholds as a tuple of ``(threshold0, threshold1, threshold2)``." +msgid "" +"Return the current collection thresholds as a tuple of ``(threshold0, " +"threshold1, threshold2)``." msgstr "" +"آستانه‌های فعلی زباله‌روبی را به‌صورت تاپلی از ``(threshold0, threshold1, " +"threshold2)`` برمی‌گرداند." -msgid "Return the list of objects that directly refer to any of objs. This function will only locate those containers which support garbage collection; extension types which do refer to other objects but do not support garbage collection will not be found." +msgid "" +"Return the list of objects that directly refer to any of objs. This function" +" will only locate those containers which support garbage collection; " +"extension types which do refer to other objects but do not support garbage " +"collection will not be found." msgstr "" +"فهرستی از اشیایی که مستقیماً به هر یک از objs ارجاع می‌دهند را برمی‌گرداند. " +"این تابع فقط آن دسته از ظرف‌هایی را پیدا می‌کند که از زباله‌روبی پشتیبانی " +"می‌کنند؛ انواع توسعه‌ای (extension types) که به اشیای دیگر ارجاع می‌دهند اما " +"از زباله‌روبی پشتیبانی نمی‌کنند، پیدا نخواهند شد." -msgid "Note that objects which have already been dereferenced, but which live in cycles and have not yet been collected by the garbage collector can be listed among the resulting referrers. To get only currently live objects, call :func:`collect` before calling :func:`get_referrers`." +msgid "" +"Note that objects which have already been dereferenced, but which live in " +"cycles and have not yet been collected by the garbage collector can be " +"listed among the resulting referrers. To get only currently live objects, " +"call :func:`collect` before calling :func:`get_referrers`." msgstr "" +"توجه داشته باشید که اشیایی که پیش‌تر از ارجاع خارج شده‌اند، اما در چرخه‌ها " +"زنده‌اند و هنوز توسط زباله‌روبی جمع‌آوری نشده‌اند، ممکن است در میان " +"ارجاع‌دهنده‌های حاصل فهرست شوند. برای دریافت تنها اشیای زنده‌ی کنونی، پیش از " +"فراخوانی :func:`get_referrers `، :func:`collect ` را" +" فراخوانی کنید." -msgid "Care must be taken when using objects returned by :func:`get_referrers` because some of them could still be under construction and hence in a temporarily invalid state. Avoid using :func:`get_referrers` for any purpose other than debugging." +msgid "" +"Care must be taken when using objects returned by :func:`get_referrers` " +"because some of them could still be under construction and hence in a " +"temporarily invalid state. Avoid using :func:`get_referrers` for any purpose" +" other than debugging." msgstr "" +"هنگام استفاده از اشیای برگردانده‌شده توسط :func:`get_referrers` باید " +"احتیاط کنید، زیرا برخی از آن‌ها ممکن است هنوز در حال ساخت باشند و بنابراین " +"به‌طور موقت در وضعیت نامعتبری قرار داشته باشند. از استفاده از " +":func:`get_referrers` برای هر منظوری به‌جز اشکال‌زدایی خودداری کنید." -msgid "Raises an :ref:`auditing event ` ``gc.get_referrers`` with argument ``objs``." +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_referrers`` with " +"argument ``objs``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``gc.get_referrers`` را با آرگومان " +"``objs`` پرتاب می‌کند." -msgid "Return a list of objects directly referred to by any of the arguments. The referents returned are those objects visited by the arguments' C-level :c:member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all objects actually directly reachable. :c:member:`~PyTypeObject.tp_traverse` methods are supported only by objects that support garbage collection, and are only required to visit objects that may be involved in a cycle. So, for example, if an integer is directly reachable from an argument, that integer object may or may not appear in the result list." -msgstr "" +msgid "" +"Return a list of objects directly referred to by any of the arguments. The " +"referents returned are those objects visited by the arguments' C-level " +":c:member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all " +"objects actually directly reachable. :c:member:`~PyTypeObject.tp_traverse` " +"methods are supported only by objects that support garbage collection, and " +"are only required to visit objects that may be involved in a cycle. So, for" +" example, if an integer is directly reachable from an argument, that integer" +" object may or may not appear in the result list." +msgstr "" +"فهرستی از اشیایی را برمی‌گرداند که به‌طور مستقیم توسط هر یک از آرگومان‌ها به" +" آن‌ها ارجاع‌شده‌اند. موارد ارجاع‌شده‌ی بازگشتی همان اشیایی هستند که توسط " +"متدهای :c:member:`~PyTypeObject.tp_traverse` آرگومان‌ها در سطح C (در صورت " +"وجود) بازدید شده‌اند، و ممکن است همه‌ی اشیایی را که واقعاً به‌طور مستقیم " +"قابل دسترسی هستند شامل نشوند. متدهای :c:member:`~PyTypeObject.tp_traverse` " +"فقط توسط اشیایی پشتیبانی می‌شوند که از زباله‌روبی پشتیبانی می‌کنند، و فقط " +"لازم است اشیایی را بازدید کنند که ممکن است در یک چرخه دخیل باشند. بنابراین، " +"برای مثال، اگر یک عدد صحیح به‌طور مستقیم از یک آرگومان قابل دسترسی باشد، " +"ممکن است آن شیء عدد صحیح در فهرست نتیجه ظاهر شود یا نشود." -msgid "Raises an :ref:`auditing event ` ``gc.get_referents`` with argument ``objs``." +msgid "" +"Raises an :ref:`auditing event ` ``gc.get_referents`` with " +"argument ``objs``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``gc.get_referents`` را با آرگومان " +"``objs`` پرتاب می‌کند." -msgid "Returns ``True`` if the object is currently tracked by the garbage collector, ``False`` otherwise. As a general rule, instances of atomic types aren't tracked and instances of non-atomic types (containers, user-defined objects...) are. However, some type-specific optimizations can be present in order to suppress the garbage collector footprint of simple instances (e.g. dicts containing only atomic keys and values)::" -msgstr "" +msgid "" +"Returns ``True`` if the object is currently tracked by the garbage " +"collector, ``False`` otherwise. As a general rule, instances of atomic " +"types aren't tracked and instances of non-atomic types (containers, user-" +"defined objects...) are. However, some type-specific optimizations can be " +"present in order to suppress the garbage collector footprint of simple " +"instances (e.g. dicts containing only atomic keys and values)::" +msgstr "" +"اگر شیء در حال حاضر توسط زباله‌روبی پیگیری شود، ``True`` و در غیر این صورت " +"``False`` برمی‌گرداند. به‌عنوان قاعده‌ای کلی، نمونه‌های انواع اتمی پیگیری " +"نمی‌شوند و نمونه‌های انواع غیراتمی (ظرف‌ها، اشیای تعریف‌شده توسط کاربر...)" +" پیگیری می‌شوند. با این حال، ممکن است برخی بهینه‌سازی‌های مختص نوع وجود " +"داشته باشند تا ردپای زباله‌روبی نمونه‌های ساده را کاهش دهند (برای مثال، " +"دیکشنری‌هایی که تنها کلیدها و مقادیر اتمی دارند)::" msgid "" ">>> gc.is_tracked(0)\n" @@ -144,9 +331,23 @@ msgid "" ">>> gc.is_tracked({\"a\": 1})\n" "True" msgstr "" +">>> gc.is_tracked(0)\n" +"False\n" +">>> gc.is_tracked(\"a\")\n" +"False\n" +">>> gc.is_tracked([])\n" +"True\n" +">>> gc.is_tracked({})\n" +"False\n" +">>> gc.is_tracked({\"a\": 1})\n" +"True" -msgid "Returns ``True`` if the given object has been finalized by the garbage collector, ``False`` otherwise. ::" +msgid "" +"Returns ``True`` if the given object has been finalized by the garbage " +"collector, ``False`` otherwise. ::" msgstr "" +"اگر شیء داده‌شده توسط زباله‌رو نهایی‌سازی شده باشد، ``True`` و در غیر این " +"صورت ``False`` برمی‌گرداند. ::" msgid "" ">>> x = None\n" @@ -162,84 +363,203 @@ msgid "" ">>> gc.is_finalized(x)\n" "True" msgstr "" +">>> x = None\n" +">>> class Lazarus:\n" +"... def __del__(self):\n" +"... global x\n" +"... x = self\n" +"...\n" +">>> lazarus = Lazarus()\n" +">>> gc.is_finalized(lazarus)\n" +"False\n" +">>> del lazarus\n" +">>> gc.is_finalized(x)\n" +"True" -msgid "Freeze all the objects tracked by the garbage collector; move them to a permanent generation and ignore them in all the future collections." +msgid "" +"Freeze all the objects tracked by the garbage collector; move them to a " +"permanent generation and ignore them in all the future collections." msgstr "" +"همه اشیای پیگیری‌شده توسط زباله‌روبی را فریز می‌کند؛ آن‌ها را به یک نسل " +"دائمی منتقل می‌کند و در همه جمع‌آوری‌های آینده نادیده می‌گیرد." -msgid "If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-on-write in child processes will maximize memory sharing and reduce overall memory usage. This requires both avoiding creation of freed \"holes\" in memory pages in the parent process and ensuring that GC collections in child processes won't touch the ``gc_refs`` counter of long-lived objects originating in the parent process. To accomplish both, call ``gc.disable()`` early in the parent process, ``gc.freeze()`` right before ``fork()``, and ``gc.enable()`` early in child processes." -msgstr "" +msgid "" +"If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" +"on-write in child processes will maximize memory sharing and reduce overall " +"memory usage. This requires both avoiding creation of freed \"holes\" in " +"memory pages in the parent process and ensuring that GC collections in child" +" processes won't touch the ``gc_refs`` counter of long-lived objects " +"originating in the parent process. To accomplish both, call ``gc.disable()``" +" early in the parent process, ``gc.freeze()`` right before ``fork()``, and " +"``gc.enable()`` early in child processes." +msgstr "" +"اگر فرایندی ``fork()`` را بدون ``exec()`` فراخوانی کند، اجتناب از کپی-در-" +"نوشتن (copy-on-write) غیرضروری در فرایندهای فرزند، اشتراک‌گذاری حافظه را " +"بیشینه می‌کند و مصرف کلی حافظه را کاهش می‌دهد. این امر مستلزم دو چیز است: " +"اجتناب از ایجاد «حفره‌های» آزادشده در صفحات حافظه در فرایند والد، و اطمینان " +"از اینکه عملیات‌های زباله‌روبی در فرایندهای فرزند، شمارنده ``gc_refs`` " +"اشیاء طولانی‌عمری را که از فرایند والد منشأ گرفته‌اند، تغییر ندهند. برای " +"دستیابی به هر دو مورد، در اوایل فرایند والد ``gc.disable()``، درست قبل از " +"``fork()`` ``gc.freeze()`` و در اوایل فرایندهای فرزند ``gc.enable()`` را " +"فراخوانی کنید." -msgid "Unfreeze the objects in the permanent generation, put them back into the oldest generation." +msgid "" +"Unfreeze the objects in the permanent generation, put them back into the " +"oldest generation." msgstr "" +"اشیای موجود در نسل دائمی را از حالت انجماد خارج می‌کند و آن‌ها را به " +"قدیمی‌ترین نسل بازمی‌گرداند." msgid "Return the number of objects in the permanent generation." -msgstr "" +msgstr "تعداد شیء‌ها در نسل دائمی را برمی‌گرداند." -msgid "The following variables are provided for read-only access (you can mutate the values but should not rebind them):" +msgid "" +"The following variables are provided for read-only access (you can mutate " +"the values but should not rebind them):" msgstr "" +"متغیرهای زیر برای دسترسی فقط‌خواندنی ارائه شده‌اند (می‌توانید مقادیر را " +"تغییر دهید، اما نباید آن‌ها را بازپیوند (rebind) کنید):" -msgid "A list of objects which the collector found to be unreachable but could not be freed (uncollectable objects). Starting with Python 3.4, this list should be empty most of the time, except when using instances of C extension types with a non-``NULL`` ``tp_del`` slot." +msgid "" +"A list of objects which the collector found to be unreachable but could not " +"be freed (uncollectable objects). Starting with Python 3.4, this list " +"should be empty most of the time, except when using instances of C extension" +" types with a non-``NULL`` ``tp_del`` slot." msgstr "" +"فهرستی از اشیایی که زباله‌رو آن‌ها را غیرقابل دسترس تشخیص داده است، اما " +"نتوانسته است آن‌ها را آزاد کند (اشیاء غیرقابل جمع‌آوری). از پایتون 3.4 به " +"بعد، این فهرست باید در بیشتر مواقع خالی باشد، مگر هنگام استفاده از نمونه‌های" +" انواع افزونه‌ی C با جایگاه (slot) ``tp_del`` غیر ``NULL``." -msgid "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added to this list rather than freed." +msgid "" +"If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added" +" to this list rather than freed." msgstr "" +"اگر :const:`DEBUG_SAVEALL` تنظیم شده باشد، تمام اشیای غیرقابل‌دسترسی به‌جای " +"آزاد شدن، به این فهرست افزوده می‌شوند." -msgid "If this list is non-empty at :term:`interpreter shutdown`, a :exc:`ResourceWarning` is emitted, which is silent by default. If :const:`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects are printed." +msgid "" +"If this list is non-empty at :term:`interpreter shutdown`, a " +":exc:`ResourceWarning` is emitted, which is silent by default. If " +":const:`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects " +"are printed." msgstr "" +"اگر این فهرست در زمان :term:`interpreter shutdown` خالی نباشد، یک " +":exc:`ResourceWarning` صادر می‌شود که به‌طور پیش‌فرض خاموش است. اگر " +":const:`DEBUG_UNCOLLECTABLE` تنظیم شده باشد، علاوه بر این، همه‌ی اشیای " +"غیرقابل جمع‌آوری نیز چاپ می‌شوند." -msgid "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't end up in :data:`gc.garbage` anymore." +msgid "" +"Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " +"end up in :data:`gc.garbage` anymore." msgstr "" +"بر اساس :pep:`442`، اشیایی که متد :meth:`~object.__del__` دارند، دیگر در " +":data:`gc.garbage` قرار نمی‌گیرند." -msgid "A list of callbacks that will be invoked by the garbage collector before and after collection. The callbacks will be called with two arguments, *phase* and *info*." +msgid "" +"A list of callbacks that will be invoked by the garbage collector before and" +" after collection. The callbacks will be called with two arguments, *phase*" +" and *info*." msgstr "" +"فهرستی از کال‌بک‌ها که توسط جمع‌کننده زباله پیش و پس از زباله‌روبی فراخوانی " +"می‌شوند. این کال‌بک‌ها با دو آرگومان، *phase* و *info* فراخوانی می‌شوند." msgid "*phase* can be one of two values:" -msgstr "" +msgstr "*phase* می‌تواند یکی از دو مقدار باشد:" msgid "\"start\": The garbage collection is about to start." -msgstr "" +msgstr "\"start\": زباله‌روبی در آستانه شروع است." msgid "\"stop\": The garbage collection has finished." -msgstr "" +msgstr "\"stop\": زباله‌روبی به پایان رسید." -msgid "*info* is a dict providing more information for the callback. The following keys are currently defined:" +msgid "" +"*info* is a dict providing more information for the callback. The following" +" keys are currently defined:" msgstr "" +"*info* یک دیکشنری است که اطلاعات بیشتری برای کال‌بک ارائه می‌دهد. کلیدهای " +"زیر در حال حاضر تعریف شده‌اند:" msgid "\"generation\": The oldest generation being collected." -msgstr "" +msgstr "\"generation\": قدیمی‌ترین نسلی که در حال جمع‌آوری است." -msgid "\"collected\": When *phase* is \"stop\", the number of objects successfully collected." +msgid "" +"\"collected\": When *phase* is \"stop\", the number of objects successfully " +"collected." msgstr "" +"\"collected\": هنگامی که *phase* برابر \"stop\" باشد، تعداد شیءهایی که با " +"موفقیت جمع‌آوری شده‌اند." -msgid "\"uncollectable\": When *phase* is \"stop\", the number of objects that could not be collected and were put in :data:`garbage`." +msgid "" +"\"uncollectable\": When *phase* is \"stop\", the number of objects that " +"could not be collected and were put in :data:`garbage`." msgstr "" +"\"uncollectable\": وقتی *phase* برابر \"stop\" است، تعداد اشیایی که جمع‌آوری" +" نشدند و در :data:`garbage` قرار گرفتند." -msgid "Applications can add their own callbacks to this list. The primary use cases are:" +msgid "" +"Applications can add their own callbacks to this list. The primary use " +"cases are:" msgstr "" +"برنامه‌ها می‌توانند کال‌بک‌های خود را به این فهرست اضافه کنند. موارد استفاده" +" اصلی عبارتند از:" -msgid "Gathering statistics about garbage collection, such as how often various generations are collected, and how long the collection takes." +msgid "" +"Gathering statistics about garbage collection, such as how often various " +"generations are collected, and how long the collection takes." msgstr "" +"جمع‌آوری آمار درباره زباله‌روبی، مانند تعداد دفعات جمع‌آوری نسل‌های مختلف و " +"مدت‌زمان جمع‌آوری." -msgid "Allowing applications to identify and clear their own uncollectable types when they appear in :data:`garbage`." +msgid "" +"Allowing applications to identify and clear their own uncollectable types " +"when they appear in :data:`garbage`." msgstr "" +"اجازه دادن به برنامه‌ها برای شناسایی و پاک‌سازی انواع غیرقابل‌جمع‌آوری " +"خودشان، هنگامی که در :data:`garbage` ظاهر می‌شوند." msgid "The following constants are provided for use with :func:`set_debug`:" -msgstr "" +msgstr "ثابت‌های زیر برای استفاده با :func:`set_debug` ارائه شده‌اند:" -msgid "Print statistics during collection. This information can be useful when tuning the collection frequency." +msgid "" +"Print statistics during collection. This information can be useful when " +"tuning the collection frequency." msgstr "" +"چاپ آمار در حین زباله‌روبی. این اطلاعات می‌تواند هنگام تنظیم فرکانس " +"زباله‌روبی مفید باشد." msgid "Print information on collectable objects found." -msgstr "" +msgstr "اطلاعات مربوط به اشیای قابل جمع‌آوری یافت‌شده را چاپ می‌کند." -msgid "Print information of uncollectable objects found (objects which are not reachable but cannot be freed by the collector). These objects will be added to the ``garbage`` list." +msgid "" +"Print information of uncollectable objects found (objects which are not " +"reachable but cannot be freed by the collector). These objects will be " +"added to the ``garbage`` list." msgstr "" +"اطلاعات اشیای غیرقابل جمع‌آوری یافت‌شده را چاپ می‌کند (اشیایی که قابل دسترس " +"نیستند اما جمع‌کننده نمی‌تواند آن‌ها را آزاد کند). این اشیاء به فهرست " +"``garbage`` افزوده خواهند شد." -msgid "Also print the contents of the :data:`garbage` list at :term:`interpreter shutdown`, if it isn't empty." +msgid "" +"Also print the contents of the :data:`garbage` list at :term:`interpreter " +"shutdown`, if it isn't empty." msgstr "" +"همچنین اگر فهرست :data:`garbage` خالی نباشد، محتویات آن را در زمان " +":term:`interpreter shutdown` چاپ کنید." -msgid "When set, all unreachable objects found will be appended to *garbage* rather than being freed. This can be useful for debugging a leaking program." +msgid "" +"When set, all unreachable objects found will be appended to *garbage* rather" +" than being freed. This can be useful for debugging a leaking program." msgstr "" +"هنگامی که تنظیم شود، تمام اشیاء غیرقابل‌دسترس یافت‌شده به جای آزاد شدن، به " +"*garbage* افزوده می‌شوند. این می‌تواند برای اشکال‌زدایی برنامه‌ای که نشتی " +"دارد مفید باشد." -msgid "The debugging flags necessary for the collector to print information about a leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``)." +msgid "" +"The debugging flags necessary for the collector to print information about a" +" leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " +"DEBUG_SAVEALL``)." msgstr "" +"پرچم‌های اشکال‌زدایی مورد نیاز برای جمع‌کننده تا اطلاعات مربوط به برنامه‌ای " +"که نشتی دارد را چاپ کند (برابر با ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE " +"| DEBUG_SAVEALL``)." diff --git a/library/getopt.po b/library/getopt.po index fd9279349..cfcc79204 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -22,61 +22,197 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!getopt` --- C-style parser for command line options" -msgstr "" +msgstr ":mod:`!getopt` --- پارسرای به‌سبک C برای گزینه‌های خط فرمان" msgid "**Source code:** :source:`Lib/getopt.py`" -msgstr "" +msgstr ":source:`Lib/getopt.py`" -msgid "This module is considered feature complete. A more declarative and extensible alternative to this API is provided in the :mod:`optparse` module. Further functional enhancements for command line parameter processing are provided either as third party modules on PyPI, or else as features in the :mod:`argparse` module." +msgid "" +"This module is considered feature complete. A more declarative and " +"extensible alternative to this API is provided in the :mod:`optparse` " +"module. Further functional enhancements for command line parameter " +"processing are provided either as third party modules on PyPI, or else as " +"features in the :mod:`argparse` module." msgstr "" +"این ماژول از نظر قابلیت‌ها کامل تلقی می‌شود. جایگزینی اعلامی‌تر و " +"توسعه‌پذیرتر برای این API در ماژول :mod:`optparse` ارائه شده است. بهبودهای " +"کارکردی بیشتر برای پردازش پارامترهای خط فرمان یا به‌صورت ماژول‌های شخص ثالث " +"در PyPI، یا به‌عنوان قابلیت‌هایی در ماژول :mod:`argparse` ارائه شده‌اند." -msgid "This module helps scripts to parse the command line arguments in ``sys.argv``. It supports the same conventions as the Unix :c:func:`!getopt` function (including the special meanings of arguments of the form '``-``' and '``--``'). Long options similar to those supported by GNU software may be used as well via an optional third argument." -msgstr "" +msgid "" +"This module helps scripts to parse the command line arguments in " +"``sys.argv``. It supports the same conventions as the Unix :c:func:`!getopt`" +" function (including the special meanings of arguments of the form '``-``' " +"and '``--``'). Long options similar to those supported by GNU software may " +"be used as well via an optional third argument." +msgstr "" +"این ماژول به اسکریپت‌ها کمک می‌کند تا آرگومان‌های خط فرمان را در " +"``sys.argv`` تجزیه کنند. این ماژول از همان قراردادهای تابع :c:func:`!getopt`" +" یونیکس پشتیبانی می‌کند (از جمله معانی خاص آرگومان‌هایی با قالب '``-``' و " +"'``--``'). همچنین می‌توان از طریق یک آرگومان سوم اختیاری، از گزینه‌های بلندی" +" مشابه گزینه‌های پشتیبانی‌شده توسط نرم‌افزارهای GNU استفاده کرد." -msgid "Users who are unfamiliar with the Unix :c:func:`!getopt` function should consider using the :mod:`argparse` module instead. Users who are familiar with the Unix :c:func:`!getopt` function, but would like to get equivalent behavior while writing less code and getting better help and error messages should consider using the :mod:`optparse` module. See :ref:`choosing-an-argument-parser` for additional details." -msgstr "" +msgid "" +"Users who are unfamiliar with the Unix :c:func:`!getopt` function should " +"consider using the :mod:`argparse` module instead. Users who are familiar " +"with the Unix :c:func:`!getopt` function, but would like to get equivalent " +"behavior while writing less code and getting better help and error messages " +"should consider using the :mod:`optparse` module. See :ref:`choosing-an-" +"argument-parser` for additional details." +msgstr "" +"کاربرانی که با تابع :c:func:`!getopt` در یونیکس آشنا نیستند، بهتر است در عوض" +" از ماژول :mod:`argparse` استفاده کنند. کاربرانی که با تابع " +":c:func:`!getopt` در یونیکس آشنا هستند، اما می‌خواهند با نوشتن کد کمتر، " +"رفتار معادل و پیام‌های راهنما و خطای بهتری به دست آورند، بهتر است از ماژول " +":mod:`optparse` استفاده کنند. برای جزئیات بیشتر، :ref:`choosing-an-argument-" +"parser` را ببینید." msgid "This module provides two functions and an exception:" -msgstr "" +msgstr "این ماژول دو تابع و یک استثنا را فراهم می‌کند:" -msgid "Parses command line options and parameter list. *args* is the argument list to be parsed, without the leading reference to the running program. Typically, this means ``sys.argv[1:]``. *shortopts* is the string of option letters that the script wants to recognize, with options that require an argument followed by a colon (``':'``) and options that accept an optional argument followed by two colons (``'::'``); i.e., the same format that Unix :c:func:`!getopt` uses." -msgstr "" +msgid "" +"Parses command line options and parameter list. *args* is the argument list" +" to be parsed, without the leading reference to the running program. " +"Typically, this means ``sys.argv[1:]``. *shortopts* is the string of option " +"letters that the script wants to recognize, with options that require an " +"argument followed by a colon (``':'``) and options that accept an optional " +"argument followed by two colons (``'::'``); i.e., the same format that Unix " +":c:func:`!getopt` uses." +msgstr "" +"گزینه‌های خط فرمان و فهرست پارامترها را تجزیه می‌کند. *args* فهرست " +"آرگومان‌هایی است که باید تجزیه شوند، بدون ارجاع ابتدایی به برنامه‌ی در حال " +"اجرا. معمولاً این به معنای ``sys.argv[1:]`` است. *shortopts* رشته‌ای از حروف" +" گزینه‌ها است که اسکریپت می‌خواهد آن‌ها را بشناسد، به‌طوری که گزینه‌های " +"نیازمند آرگومان با یک علامت دونقطه (``':'``) و گزینه‌هایی که آرگومان اختیاری" +" می‌پذیرند با دو علامت دونقطه (``'::'``) دنبال می‌شوند؛ یعنی همان قالبی که " +":c:func:`!getopt` در یونیکس استفاده می‌کند." -msgid "Unlike GNU :c:func:`!getopt`, after a non-option argument, all further arguments are considered also non-options. This is similar to the way non-GNU Unix systems work." +msgid "" +"Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " +"arguments are considered also non-options. This is similar to the way non-" +"GNU Unix systems work." msgstr "" +"برخلاف :c:func:`!getopt` در GNU، پس از یک آرگومان غیرگزینه‌ای، تمام " +"آرگومان‌های بعدی نیز غیرگزینه‌ای در نظر گرفته می‌شوند. این مشابه روش کار " +"سیستم‌های یونیکس غیر GNU است." -msgid "*longopts*, if specified, must be a list of strings with the names of the long options which should be supported. The leading ``'--'`` characters should not be included in the option name. Long options which require an argument should be followed by an equal sign (``'='``). Long options which accept an optional argument should be followed by an equal sign and question mark (``'=?'``). To accept only long options, *shortopts* should be an empty string. Long options on the command line can be recognized so long as they provide a prefix of the option name that matches exactly one of the accepted options. For example, if *longopts* is ``['foo', 'frob']``, the option ``--fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:`GetoptError` will be raised." -msgstr "" +msgid "" +"*longopts*, if specified, must be a list of strings with the names of the " +"long options which should be supported. The leading ``'--'`` characters " +"should not be included in the option name. Long options which require an " +"argument should be followed by an equal sign (``'='``). Long options which " +"accept an optional argument should be followed by an equal sign and question" +" mark (``'=?'``). To accept only long options, *shortopts* should be an " +"empty string. Long options on the command line can be recognized so long as" +" they provide a prefix of the option name that matches exactly one of the " +"accepted options. For example, if *longopts* is ``['foo', 'frob']``, the " +"option ``--fo`` will match as ``--foo``, but ``--f`` will not match " +"uniquely, so :exc:`GetoptError` will be raised." +msgstr "" +"*longopts*، در صورت مشخص بودن، باید فهرستی از رشته‌ها حاوی نام گزینه‌های " +"بلندی باشد که باید پشتیبانی شوند. نویسه‌های ``'--'`` ابتدایی نباید در نام " +"گزینه گنجانده شوند. گزینه‌های بلندی که به آرگومان نیاز دارند، باید به دنبال " +"آن‌ها علامت برابر (``'='``) بیاید. گزینه‌های بلندی که آرگومان اختیاری " +"می‌پذیرند، باید به دنبال آن‌ها علامت برابر و علامت سؤال (``'=?'``) بیاید. " +"برای پذیرش فقط گزینه‌های بلند، *shortopts* باید یک رشته خالی باشد. گزینه‌های" +" بلند در خط فرمان تا زمانی قابل شناسایی هستند که پیشوندی از نام گزینه ارائه " +"شود که دقیقاً با یکی از گزینه‌های پذیرفته‌شده مطابقت داشته باشد. برای مثال، " +"اگر *longopts* برابر با ``['foo', 'frob']`` باشد، گزینه ``--fo`` به‌صورت " +"``--foo`` مطابقت خواهد داشت، اما ``--f`` به‌طور یکتا مطابقت نخواهد داشت، " +"بنابراین :exc:`GetoptError` پرتاب خواهد شد." -msgid "If *longopts* is a string it gets treated as a list of a single element." +msgid "" +"If *longopts* is a string it gets treated as a list of a single element." msgstr "" +"اگر *longopts* یک رشته باشد، به‌عنوان فهرستی با یک عنصر در نظر گرفته می‌شود." -msgid "The return value consists of two elements: the first is a list of ``(option, value)`` pairs; the second is the list of program arguments left after the option list was stripped (this is a trailing slice of *args*). Each option-and-value pair returned has the option as its first element, prefixed with a hyphen for short options (e.g., ``'-x'``) or two hyphens for long options (e.g., ``'--long-option'``), and the option argument as its second element, or an empty string if the option has no argument. The options occur in the list in the same order in which they were found, thus allowing multiple occurrences. Long and short options may be mixed." -msgstr "" +msgid "" +"The return value consists of two elements: the first is a list of ``(option," +" value)`` pairs; the second is the list of program arguments left after the " +"option list was stripped (this is a trailing slice of *args*). Each option-" +"and-value pair returned has the option as its first element, prefixed with a" +" hyphen for short options (e.g., ``'-x'``) or two hyphens for long options " +"(e.g., ``'--long-option'``), and the option argument as its second element, " +"or an empty string if the option has no argument. The options occur in the " +"list in the same order in which they were found, thus allowing multiple " +"occurrences. Long and short options may be mixed." +msgstr "" +"مقدار بازگشتی از دو عنصر تشکیل شده است: اولی فهرستی از جفت‌های ``(option, " +"value)`` است؛ دومی فهرست آرگومان‌های برنامه باقی‌مانده پس از حذف فهرست " +"گزینه‌ها است (این یک برش انتهایی از *args* است). هر جفت گزینه-و-مقدار " +"بازگشتی، گزینه را به‌عنوان اولین عنصر خود دارد؛ این گزینه با یک خط تیره برای" +" گزینه‌های کوتاه (برای نمونه، ``'-x'``) یا دو خط تیره برای گزینه‌های بلند " +"(برای نمونه، ``'--long-option'``) پیشوند داده شده است، و آرگومان گزینه را " +"به‌عنوان عنصر دوم خود دارد، یا اگر گزینه آرگومانی نداشته باشد، عنصر دوم یک " +"رشته‌ی خالی است. گزینه‌ها در فهرست به همان ترتیبی که پیدا شده‌اند ظاهر " +"می‌شوند، بنابراین امکان تکرار آن‌ها وجود دارد. گزینه‌های بلند و کوتاه " +"می‌توانند با هم ترکیب شوند." msgid "Optional arguments are supported." -msgstr "" +msgstr "از آرگومان‌های اختیاری پشتیبانی می‌شود." -msgid "This function works like :func:`getopt`, except that GNU style scanning mode is used by default. This means that option and non-option arguments may be intermixed. The :func:`getopt` function stops processing options as soon as a non-option argument is encountered." +msgid "" +"This function works like :func:`getopt`, except that GNU style scanning mode" +" is used by default. This means that option and non-option arguments may be " +"intermixed. The :func:`getopt` function stops processing options as soon as " +"a non-option argument is encountered." msgstr "" +"این تابع مانند :func:`getopt` عمل می‌کند، با این تفاوت که حالت پویش به‌سبک " +"GNU به‌طور پیش‌فرض استفاده می‌شود. این بدان معناست که آرگومان‌های گزینه‌ای و" +" غیرگزینه‌ای می‌توانند به‌صورت درهم قرار گیرند. تابع :func:`getopt` به محض " +"مواجهه با یک آرگومان غیرگزینه‌ای، پردازش گزینه‌ها را متوقف می‌کند." -msgid "If the first character of the option string is ``'+'``, or if the environment variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as soon as a non-option argument is encountered." +msgid "" +"If the first character of the option string is ``'+'``, or if the " +"environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " +"processing stops as soon as a non-option argument is encountered." msgstr "" +"اگر نخستین نویسه‌ی رشته گزینه ``'+'`` باشد، یا اگر متغیر محیطی " +":envvar:`!POSIXLY_CORRECT` تنظیم شده باشد، پردازش گزینه‌ها به محض مواجهه با " +"یک آرگومان غیرگزینه‌ای متوقف می‌شود." -msgid "If the first character of the option string is ``'-'``, non-option arguments that are followed by options are added to the list of option-and-value pairs as a pair that has ``None`` as its first element and the list of non-option arguments as its second element. The second element of the :func:`!gnu_getopt` result is a list of program arguments after the last option." -msgstr "" +msgid "" +"If the first character of the option string is ``'-'``, non-option arguments" +" that are followed by options are added to the list of option-and-value " +"pairs as a pair that has ``None`` as its first element and the list of non-" +"option arguments as its second element. The second element of the " +":func:`!gnu_getopt` result is a list of program arguments after the last " +"option." +msgstr "" +"اگر نخستین نویسه‌ی رشته‌ی گزینه‌ها ``'-'`` باشد، آرگومان‌های غیرگزینه‌ای که " +"پس از آن‌ها گزینه‌ها می‌آیند، به فهرست جفت‌های گزینه و مقدار به‌صورت جفتی " +"افزوده می‌شوند که عنصر نخست آن ``None`` و عنصر دوم آن فهرست آرگومان‌های " +"غیرگزینه‌ای است. عنصر دوم نتیجه‌ی :func:`!gnu_getopt` فهرستی از آرگومان‌های " +"برنامه پس از آخرین گزینه است." -msgid "Support for returning intermixed options and non-option arguments in order." +msgid "" +"Support for returning intermixed options and non-option arguments in order." msgstr "" +"پشتیبانی از بازگرداندن گزینه‌ها و آرگومان‌های غیرگزینه‌ای درهم‌آمیخته " +"به‌ترتیب." -msgid "This is raised when an unrecognized option is found in the argument list or when an option requiring an argument is given none. The argument to the exception is a string indicating the cause of the error. For long options, an argument given to an option which does not require one will also cause this exception to be raised. The attributes :attr:`!msg` and :attr:`!opt` give the error message and related option; if there is no specific option to which the exception relates, :attr:`!opt` is an empty string." -msgstr "" +msgid "" +"This is raised when an unrecognized option is found in the argument list or " +"when an option requiring an argument is given none. The argument to the " +"exception is a string indicating the cause of the error. For long options, " +"an argument given to an option which does not require one will also cause " +"this exception to be raised. The attributes :attr:`!msg` and :attr:`!opt` " +"give the error message and related option; if there is no specific option to" +" which the exception relates, :attr:`!opt` is an empty string." +msgstr "" +"این استثنا زمانی پرتاب می‌شود که یک گزینه ناشناخته در فهرست آرگومان‌ها پیدا " +"شود یا گزینه‌ای که به آرگومان نیاز دارد، بدون آرگومان ارائه شود. آرگومان این" +" استثنا یک رشته است که علت خطا را نشان می‌دهد. برای گزینه‌های بلند، اگر به " +"گزینه‌ای که به آرگومان نیاز ندارد آرگومان داده شود، این استثنا نیز پرتاب " +"می‌شود. ویژگی‌های :attr:`!msg` و :attr:`!opt` پیام خطا و گزینه مرتبط را " +"ارائه می‌دهند؛ اگر گزینه مشخصی وجود نداشته باشد که استثنا به آن مربوط باشد، " +":attr:`!opt` یک رشته خالی است." msgid "Alias for :exc:`GetoptError`; for backward compatibility." -msgstr "" +msgstr "نام مستعاری برای :exc:`GetoptError`؛ برای سازگاری با نسخه‌های قدیمی." msgid "An example using only Unix style options:" -msgstr "" +msgstr "مثالی که فقط از گزینه‌های به سبک یونیکس استفاده می‌کند:" msgid "" ">>> import getopt\n" @@ -89,9 +225,18 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> import getopt\n" +">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" +">>> args\n" +"['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'abc:d:')\n" +">>> optlist\n" +"[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n" +">>> args\n" +"['a1', 'a2']" msgid "Using long option names is equally easy:" -msgstr "" +msgstr "استفاده از نام‌های بلند گزینه‌ها نیز به همان اندازه آسان است:" msgid "" ">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" @@ -105,9 +250,19 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'x', [\n" +"... 'condition=', 'output-file=', 'testing'])\n" +">>> optlist\n" +"[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')]\n" +">>> args\n" +"['a1', 'a2']" msgid "Optional arguments should be specified explicitly:" -msgstr "" +msgstr "آرگومان‌های اختیاری باید به‌صراحت مشخص شوند:" msgid "" ">>> s = '-Con -C --color=off --color a1 a2'\n" @@ -120,9 +275,18 @@ msgid "" ">>> args\n" "['a1', 'a2']" msgstr "" +">>> s = '-Con -C --color=off --color a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['-Con', '-C', '--color=off', '--color', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])\n" +">>> optlist\n" +"[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]\n" +">>> args\n" +"['a1', 'a2']" msgid "The order of options and non-option arguments can be preserved:" -msgstr "" +msgstr "می‌توان ترتیب گزینه‌ها و آرگومان‌های غیرگزینه‌ای را حفظ کرد:" msgid "" ">>> s = 'a1 -x a2 a3 a4 --long a5 a6'\n" @@ -135,9 +299,18 @@ msgid "" ">>> args\n" "['a6']" msgstr "" +">>> s = 'a1 -x a2 a3 a4 --long a5 a6'\n" +">>> args = s.split()\n" +">>> args\n" +"['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']\n" +">>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])\n" +">>> optlist\n" +"[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]\n" +">>> args\n" +"['a6']" msgid "In a script, typical usage is something like this:" -msgstr "" +msgstr "در یک اسکریپت، استفاده‌ی معمول چیزی شبیه به این است:" msgid "" "import getopt, sys\n" @@ -167,9 +340,40 @@ msgid "" "if __name__ == \"__main__\":\n" " main()" msgstr "" +"import getopt, sys\n" +"\n" +"def main():\n" +" try:\n" +" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", \"output=\"])\n" +" except getopt.GetoptError as err:\n" +" # print help information and exit:\n" +" print(err) # will print something like \"option -a not recognized\"\n" +" usage()\n" +" sys.exit(2)\n" +" output = None\n" +" verbose = False\n" +" for o, a in opts:\n" +" if o == \"-v\":\n" +" verbose = True\n" +" elif o in (\"-h\", \"--help\"):\n" +" usage()\n" +" sys.exit()\n" +" elif o in (\"-o\", \"--output\"):\n" +" output = a\n" +" else:\n" +" assert False, \"unhandled option\"\n" +" process(args, output=output, verbose=verbose)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" -msgid "Note that an equivalent command line interface could be produced with less code and more informative help and error messages by using the :mod:`optparse` module:" +msgid "" +"Note that an equivalent command line interface could be produced with less " +"code and more informative help and error messages by using the " +":mod:`optparse` module:" msgstr "" +"توجه داشته باشید که با استفاده از ماژول :mod:`optparse` می‌توان یک رابط خط " +"فرمان معادل با کد کمتر و پیام‌های راهنما و خطای گویاتر ایجاد کرد:" msgid "" "import optparse\n" @@ -181,9 +385,21 @@ msgid "" " opts, args = parser.parse_args()\n" " process(args, output=opts.output, verbose=opts.verbose)" msgstr "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" -msgid "A roughly equivalent command line interface for this case can also be produced by using the :mod:`argparse` module:" +msgid "" +"A roughly equivalent command line interface for this case can also be " +"produced by using the :mod:`argparse` module:" msgstr "" +"همچنین می‌توان یک رابط خط فرمان تقریباً معادل برای این حالت را با استفاده از" +" ماژول :mod:`argparse` ایجاد کرد:" msgid "" "import argparse\n" @@ -196,18 +412,35 @@ msgid "" " args = parser.parse_args()\n" " process(args.rest, output=args.output, verbose=args.verbose)" msgstr "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" -msgid "See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` version of this code differs in behaviour from the ``optparse`` (and ``getopt``) version." +msgid "" +"See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " +"version of this code differs in behaviour from the ``optparse`` (and " +"``getopt``) version." msgstr "" +"برای جزئیات درباره‌ی اینکه نسخه‌ی ``argparse`` این کد از نظر رفتار چه تفاوتی" +" با نسخه‌ی ``optparse`` (و ``getopt``) دارد، :ref:`choosing-an-argument-" +"parser` را ببینید." msgid "Module :mod:`optparse`" -msgstr "" +msgstr "ماژول :mod:`optparse`" msgid "Declarative command line option parsing." -msgstr "" +msgstr "تجزیه‌ی اعلامی گزینه‌های خط فرمان." msgid "Module :mod:`argparse`" -msgstr "" +msgstr "ماژول :mod:`argparse`" msgid "More opinionated command line option and argument parsing library." msgstr "" +"کتابخانه‌ای با رویکردی سخت‌گیرانه‌تر برای تجزیه‌ی گزینه‌ها و آرگومان‌های خط " +"فرمان." diff --git a/library/getpass.po b/library/getpass.po index b4c94effd..84555756b 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -22,49 +22,111 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!getpass` --- Portable password input" -msgstr "" +msgstr ":mod:`!getpass` --- ورودی قابل‌حمل گذرواژه" msgid "**Source code:** :source:`Lib/getpass.py`" -msgstr "" +msgstr ":source:`Lib/getpass.py`" msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "The :mod:`!getpass` module provides two functions:" -msgstr "" +msgstr "ماژول :mod:`!getpass` دو تابع ارائه می‌دهد:" -msgid "Prompt the user for a password without echoing. The user is prompted using the string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt is written to the file-like object *stream* using the replace error handler if needed. *stream* defaults to the controlling terminal (:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this argument is ignored on Windows)." -msgstr "" +msgid "" +"Prompt the user for a password without echoing. The user is prompted using " +"the string *prompt*, which defaults to ``'Password: '``. On Unix, the " +"prompt is written to the file-like object *stream* using the replace error " +"handler if needed. *stream* defaults to the controlling terminal " +"(:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this " +"argument is ignored on Windows)." +msgstr "" +"از کاربر درخواست می‌شود گذرواژه‌ای را بدون بازتاب وارد کند. از کاربر با " +"استفاده از رشته‌ی *prompt* درخواست می‌شود، که مقدار پیش‌فرض آن ``'Password: " +"'`` است. در یونیکس، پیام درخواست در صورت نیاز با استفاده از مدیر خطای " +"replace به شیء شبه‌فایل *stream* نوشته می‌شود. مقدار پیش‌فرض *stream* " +"پایانه‌ی هندلر (:file:`/dev/tty`) است یا اگر آن در دسترس نباشد، " +"``sys.stderr`` است (این آرگومان در ویندوز نادیده گرفته می‌شود)." -msgid "The *echo_char* argument controls how user input is displayed while typing. If *echo_char* is ``None`` (default), input remains hidden. Otherwise, *echo_char* must be a single printable ASCII character and each typed character is replaced by it. For example, ``echo_char='*'`` will display asterisks instead of the actual input." -msgstr "" +msgid "" +"The *echo_char* argument controls how user input is displayed while typing. " +"If *echo_char* is ``None`` (default), input remains hidden. Otherwise, " +"*echo_char* must be a single printable ASCII character and each typed " +"character is replaced by it. For example, ``echo_char='*'`` will display " +"asterisks instead of the actual input." +msgstr "" +"آرگومان *echo_char* نحوه‌ی نمایش ورودی کاربر هنگام تایپ را کنترل می‌کند. اگر " +"*echo_char* برابر ``None`` (پیش‌فرض) باشد، ورودی مخفی می‌ماند. در غیر این " +"صورت، *echo_char* باید یک نویسه‌ی ASCII قابل‌چاپ واحد باشد و هر نویسه‌ی " +"تایپ‌شده با آن جایگزین می‌شود. برای مثال، ``echo_char='*'`` به‌جای ورودی " +"واقعی، ستاره‌ها را نمایش می‌دهد." -msgid "If echo free input is unavailable getpass() falls back to printing a warning message to *stream* and reading from ``sys.stdin`` and issuing a :exc:`GetPassWarning`." +msgid "" +"If echo free input is unavailable getpass() falls back to printing a warning" +" message to *stream* and reading from ``sys.stdin`` and issuing a " +":exc:`GetPassWarning`." msgstr "" +"اگر ورودی بدون بازتاب در دسترس نباشد، getpass() به چاپ یک پیام هشدار در " +"*stream*، خواندن از ``sys.stdin`` و صدور یک :exc:`GetPassWarning` متوسل " +"می‌شود." -msgid "If you call getpass from within IDLE, the input may be done in the terminal you launched IDLE from rather than the idle window itself." +msgid "" +"If you call getpass from within IDLE, the input may be done in the terminal " +"you launched IDLE from rather than the idle window itself." msgstr "" +"اگر getpass را از درون IDLE فراخوانی کنید، ممکن است ورودی به‌جای خود پنجره " +"IDLE، در پایانه‌ای که IDLE را از آن راه‌اندازی کرده‌اید انجام شود." -msgid "On Unix systems, when *echo_char* is set, the terminal will be configured to operate in :manpage:`noncanonical mode `. In particular, this means that line editing shortcuts such as :kbd:`Ctrl+U` will not work and may insert unexpected characters into the input." -msgstr "" +msgid "" +"On Unix systems, when *echo_char* is set, the terminal will be configured to" +" operate in :manpage:`noncanonical mode " +"`. In particular, this means " +"that line editing shortcuts such as :kbd:`Ctrl+U` will not work and may " +"insert unexpected characters into the input." +msgstr "" +"در سیستم‌های یونیکسی، هنگامی که *echo_char* تنظیم شده باشد، پایانه " +"به‌گونه‌ای پیکربندی می‌شود که در :manpage:`حالت غیرکانونیکال (noncanonical " +"mode) ` عمل کند. به‌ویژه، این " +"بدان معناست که میان‌برهای ویرایش خط مانند :kbd:`Ctrl+U` کار نخواهند کرد و " +"ممکن است نویسه‌های غیرمنتظره را در ورودی درج کنند." msgid "Added the *echo_char* parameter for keyboard feedback." -msgstr "" +msgstr "پارامتر *echo_char* برای بازخورد صفحه‌کلید افزوده شد." -msgid "A :exc:`UserWarning` subclass issued when password input may be echoed." +msgid "" +"A :exc:`UserWarning` subclass issued when password input may be echoed." msgstr "" +"یک زیرکلاس از :exc:`UserWarning` که زمانی صادر می‌شود که ممکن است ورودی " +"گذرواژه بازتاب داده شود." msgid "Return the \"login name\" of the user." -msgstr "" +msgstr "«نام ورود» کاربر را برمی‌گرداند." -msgid "This function checks the environment variables :envvar:`LOGNAME`, :envvar:`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the value of the first one which is set to a non-empty string. If none are set, the login name from the password database is returned on systems which support the :mod:`pwd` module, otherwise, an :exc:`OSError` is raised." -msgstr "" +msgid "" +"This function checks the environment variables :envvar:`LOGNAME`, " +":envvar:`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and " +"returns the value of the first one which is set to a non-empty string. If " +"none are set, the login name from the password database is returned on " +"systems which support the :mod:`pwd` module, otherwise, an :exc:`OSError` is" +" raised." +msgstr "" +"این تابع متغیرهای محیطی :envvar:`LOGNAME`، :envvar:`USER`، :envvar:`!LNAME` " +"و :envvar:`USERNAME` را به ترتیب بررسی می‌کند و مقدار اولین متغیری را که به " +"یک رشته غیرخالی تنظیم شده باشد برمی‌گرداند. اگر هیچ‌کدام تنظیم نشده باشند، " +"در سیستم‌هایی که از ماژول :mod:`pwd` پشتیبانی می‌کنند، نام ورود از پایگاه " +"داده‌ی گذرواژه برگردانده می‌شود؛ در غیر این صورت، یک :exc:`OSError` پرتاب " +"می‌شود." -msgid "In general, this function should be preferred over :func:`os.getlogin`." -msgstr "" +msgid "" +"In general, this function should be preferred over :func:`os.getlogin`." +msgstr "به‌طور کلی، این تابع باید به :func:`os.getlogin` ترجیح داده شود." msgid "Previously, various exceptions beyond just :exc:`OSError` were raised." -msgstr "" +msgstr "پیش‌تر، استثناهای مختلفی علاوه بر :exc:`OSError` نیز پرتاب می‌شدند." diff --git a/library/gettext.po b/library/gettext.po index 4a9e77c1a..a6f93a700 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -24,55 +24,151 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!gettext` --- Multilingual internationalization services" -msgstr "" +msgstr ":mod:`!gettext` --- خدمات بین‌المللی‌سازی چندزبانه" msgid "**Source code:** :source:`Lib/gettext.py`" -msgstr "" +msgstr ":source:`Lib/gettext.py`" -msgid "The :mod:`!gettext` module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications. It supports both the GNU :program:`gettext` message catalog API and a higher level, class-based API that may be more appropriate for Python files. The interface described below allows you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural languages." -msgstr "" +msgid "" +"The :mod:`!gettext` module provides internationalization (I18N) and " +"localization (L10N) services for your Python modules and applications. It " +"supports both the GNU :program:`gettext` message catalog API and a higher " +"level, class-based API that may be more appropriate for Python files. The " +"interface described below allows you to write your module and application " +"messages in one natural language, and provide a catalog of translated " +"messages for running under different natural languages." +msgstr "" +"ماژول :mod:`!gettext` خدمات بین‌المللی‌سازی (I18N) و بومی‌سازی (L10N) را " +"برای ماژول‌ها و برنامه‌های پایتون شما فراهم می‌کند. این ماژول هم از API " +"فهرست پیام‌های :program:`gettext` گنو و هم از یک API سطح بالاتر و مبتنی بر " +"کلاس پشتیبانی می‌کند که ممکن است برای فایل‌های پایتون مناسب‌تر باشد. رابطی " +"که در زیر توضیح داده شده است، به شما امکان می‌دهد پیام‌های ماژول و برنامه " +"خود را به یک زبان طبیعی بنویسید و فهرستی از پیام‌های ترجمه‌شده برای اجرا در " +"زبان‌های طبیعی مختلف ارائه دهید." -msgid "Some hints on localizing your Python modules and applications are also given." +msgid "" +"Some hints on localizing your Python modules and applications are also " +"given." msgstr "" +"همچنین برخی نکات درباره بومی‌سازی ماژول‌ها و برنامه‌های پایتون شما ارائه شده" +" است." msgid "GNU :program:`gettext` API" -msgstr "" +msgstr "API مربوط به GNU :program:`gettext`" -msgid "The :mod:`!gettext` module defines the following API, which is very similar to the GNU :program:`gettext` API. If you use this API you will affect the translation of your entire application globally. Often this is what you want if your application is monolingual, with the choice of language dependent on the locale of your user. If you are localizing a Python module, or if your application needs to switch languages on the fly, you probably want to use the class-based API instead." -msgstr "" +msgid "" +"The :mod:`!gettext` module defines the following API, which is very similar " +"to the GNU :program:`gettext` API. If you use this API you will affect the " +"translation of your entire application globally. Often this is what you " +"want if your application is monolingual, with the choice of language " +"dependent on the locale of your user. If you are localizing a Python " +"module, or if your application needs to switch languages on the fly, you " +"probably want to use the class-based API instead." +msgstr "" +"ماژول :mod:`!gettext`، API زیر را تعریف می‌کند که بسیار شبیه به API " +":program:`gettext` گنو است. اگر از این API استفاده کنید، ترجمه‌ی کل برنامه‌ی " +"خود را به‌صورت سراسری تحت تأثیر قرار می‌دهید. معمولاً اگر برنامه‌ی شما " +"تک‌زبانه باشد و انتخاب زبان به تنظیمات locale (locale) کاربر شما وابسته باشد، " +"این همان چیزی است که می‌خواهید. اگر در حال localeسازی یک ماژول پایتون هستید، " +"یا اگر برنامه‌ی شما نیاز دارد زبان‌ها را در حین اجرا تغییر دهد، احتمالاً بهتر" +" است به‌جای آن از API مبتنی بر کلاس استفاده کنید." -msgid "Bind the *domain* to the locale directory *localedir*. More concretely, :mod:`!gettext` will look for binary :file:`.mo` files for the given domain using the path (on Unix): :file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`, where *language* is searched for in the environment variables :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` respectively." -msgstr "" +msgid "" +"Bind the *domain* to the locale directory *localedir*. More concretely, " +":mod:`!gettext` will look for binary :file:`.mo` files for the given domain " +"using the path (on Unix): " +":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`, where *language* is " +"searched for in the environment variables :envvar:`LANGUAGE`, " +":envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG` respectively." +msgstr "" +"دامنه‌ی *domain* را به پوشه‌ی locale با مسیر *localedir* مقید می‌کند. به‌طور " +"مشخص‌تر، :mod:`!gettext` فایل‌های دودویی :file:`.mo` را برای دامنه‌ی داده‌شده" +" با استفاده از مسیر (در یونیکس) جستجو می‌کند: " +":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`، که در آن *language* " +"به‌ترتیب در متغیرهای محیطی :envvar:`LANGUAGE`، :envvar:`LC_ALL`، " +":envvar:`LC_MESSAGES` و :envvar:`LANG` جستجو می‌شود." -msgid "If *localedir* is omitted or ``None``, then the current binding for *domain* is returned. [#]_" +msgid "" +"If *localedir* is omitted or ``None``, then the current binding for *domain*" +" is returned. [#]_" msgstr "" +"اگر *localedir* حذف شود یا ``None`` باشد، اتصال جاری برای *domain* برگردانده" +" می‌شود. [#]_" -msgid "Change or query the current global domain. If *domain* is ``None``, then the current global domain is returned, otherwise the global domain is set to *domain*, which is returned." +msgid "" +"Change or query the current global domain. If *domain* is ``None``, then " +"the current global domain is returned, otherwise the global domain is set to" +" *domain*, which is returned." msgstr "" +"دامنه سراسری کنونی را تغییر دهید یا پرس‌وجو کنید. اگر *domain* برابر " +"``None`` باشد، دامنه سراسری کنونی برگردانده می‌شود، در غیر این صورت دامنه " +"سراسری روی *domain* تنظیم می‌شود که برگردانده می‌شود." -msgid "Return the localized translation of *message*, based on the current global domain, language, and locale directory. This function is usually aliased as :func:`!_` in the local namespace (see examples below)." +msgid "" +"Return the localized translation of *message*, based on the current global " +"domain, language, and locale directory. This function is usually aliased as" +" :func:`!_` in the local namespace (see examples below)." msgstr "" +"ترجمه localeسازی‌شده *message* را بر اساس دامنه سراسری، زبان و پوشه locale " +"جاری برمی‌گرداند. این تابع معمولاً با نام :func:`!_` در فضای نام locale مستعار" +" می‌شود (نمونه‌های زیر را ببینید)." -msgid "Like :func:`.gettext`, but look the message up in the specified *domain*." +msgid "" +"Like :func:`.gettext`, but look the message up in the specified *domain*." msgstr "" +"مانند :func:`.gettext` است، اما پیام را در *domain* مشخص‌شده جستجو می‌کند." -msgid "Like :func:`.gettext`, but consider plural forms. If a translation is found, apply the plural formula to *n*, and return the resulting message (some languages have more than two plural forms). If no translation is found, return *singular* if *n* is 1; return *plural* otherwise." +msgid "" +"Like :func:`.gettext`, but consider plural forms. If a translation is found," +" apply the plural formula to *n*, and return the resulting message (some " +"languages have more than two plural forms). If no translation is found, " +"return *singular* if *n* is 1; return *plural* otherwise." msgstr "" +"مانند :func:`.gettext`، اما شکل‌های جمع را در نظر می‌گیرد. اگر ترجمه‌ای پیدا" +" شود، فرمول جمع را روی *n* اعمال می‌کند و پیام حاصل را برمی‌گرداند (برخی " +"زبان‌ها بیش از دو شکل جمع دارند). اگر ترجمه‌ای پیدا نشود، در صورتی که *n* " +"برابر ۱ باشد *singular* را برمی‌گرداند؛ در غیر این صورت *plural* را " +"برمی‌گرداند." -msgid "The Plural formula is taken from the catalog header. It is a C or Python expression that has a free variable *n*; the expression evaluates to the index of the plural in the catalog. See `the GNU gettext documentation `__ for the precise syntax to be used in :file:`.po` files and the formulas for a variety of languages." -msgstr "" +msgid "" +"The Plural formula is taken from the catalog header. It is a C or Python " +"expression that has a free variable *n*; the expression evaluates to the " +"index of the plural in the catalog. See `the GNU gettext documentation " +"`__ for the " +"precise syntax to be used in :file:`.po` files and the formulas for a " +"variety of languages." +msgstr "" +"فرمول جمع از سرآیند کاتالوگ گرفته می‌شود. این یک عبارت C یا Python است که یک " +"متغیر آزاد *n* دارد؛ حاصل این عبارت، اندیس جمع در کاتالوگ است. برای سینتکس " +"دقیق مورد استفاده در فایل‌های :file:`.po` و فرمول‌های زبان‌های مختلف، به " +"`مستندات GNU gettext " +"`__ مراجعه کنید." -msgid "Like :func:`ngettext`, but look the message up in the specified *domain*." +msgid "" +"Like :func:`ngettext`, but look the message up in the specified *domain*." msgstr "" +"مانند :func:`ngettext`، اما پیام را در *domain*\\ِ مشخص‌شده جستجو می‌کند." -msgid "Similar to the corresponding functions without the ``p`` in the prefix (that is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), but the translation is restricted to the given message *context*." +msgid "" +"Similar to the corresponding functions without the ``p`` in the prefix (that" +" is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, " +":func:`dngettext`), but the translation is restricted to the given message " +"*context*." msgstr "" +"مشابه توابع متناظر بدون ``p`` در پیشوند (یعنی :func:`gettext`، " +":func:`dgettext`، :func:`ngettext`، :func:`dngettext`)، اما ترجمه به *زمینه*" +" پیام داده‌شده محدود می‌شود." -msgid "Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, but this was deemed not useful and so it is currently unimplemented." +msgid "" +"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " +"but this was deemed not useful and so it is currently unimplemented." msgstr "" +"توجه داشته باشید که GNU :program:`gettext` همچنین یک متد :func:`!dcgettext` " +"تعریف می‌کند، اما این متد مفید تشخیص داده نشد و بنابراین در حال حاضر " +"پیاده‌سازی نشده است." msgid "Here's an example of typical usage for this API::" -msgstr "" +msgstr "در اینجا نمونه‌ای از استفاده رایج از این API آمده است::" msgid "" "import gettext\n" @@ -82,147 +178,406 @@ msgid "" "# ...\n" "print(_('This is a translatable string.'))" msgstr "" +"import gettext\n" +"gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" +"gettext.textdomain('myapplication')\n" +"_ = gettext.gettext\n" +"# ...\n" +"print(_('This is a translatable string.'))" msgid "Class-based API" -msgstr "" +msgstr "API مبتنی بر کلاس" -msgid "The class-based API of the :mod:`!gettext` module gives you more flexibility and greater convenience than the GNU :program:`gettext` API. It is the recommended way of localizing your Python applications and modules. :mod:`!gettext` defines a :class:`GNUTranslations` class which implements the parsing of GNU :file:`.mo` format files, and has methods for returning strings. Instances of this class can also install themselves in the built-in namespace as the function :func:`!_`." -msgstr "" +msgid "" +"The class-based API of the :mod:`!gettext` module gives you more flexibility" +" and greater convenience than the GNU :program:`gettext` API. It is the " +"recommended way of localizing your Python applications and modules. " +":mod:`!gettext` defines a :class:`GNUTranslations` class which implements " +"the parsing of GNU :file:`.mo` format files, and has methods for returning " +"strings. Instances of this class can also install themselves in the built-in" +" namespace as the function :func:`!_`." +msgstr "" +"API مبتنی بر کلاس ماژول :mod:`!gettext` در مقایسه با API :program:`gettext` " +"GNU، انعطاف‌پذیری بیشتر و سهولت بیشتری به شما می‌دهد. این روش توصیه‌شده برای" +" محلی‌سازی برنامه‌ها و ماژول‌های پایتون شما است. :mod:`!gettext` یک کلاس " +":class:`GNUTranslations` را تعریف می‌کند که تجزیه‌ی فایل‌های با قالب " +":file:`.mo` GNU را پیاده‌سازی می‌کند و متدهایی برای برگرداندن رشته‌ها دارد. " +"نمونه‌های این کلاس همچنین می‌توانند خود را در فضای نام توکار به‌عنوان تابع " +":func:`!_` نصب کنند." -msgid "This function implements the standard :file:`.mo` file search algorithm. It takes a *domain*, identical to what :func:`textdomain` takes. Optional *localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list of strings, where each string is a language code." +msgid "" +"This function implements the standard :file:`.mo` file search algorithm. It" +" takes a *domain*, identical to what :func:`textdomain` takes. Optional " +"*localedir* is as in :func:`bindtextdomain`. Optional *languages* is a list " +"of strings, where each string is a language code." msgstr "" +"این تابع، الگوریتم استاندارد جستجوی فایل :file:`.mo` را پیاده‌سازی می‌کند. " +"این تابع یک *domain* می‌گیرد، دقیقاً مشابه آنچه :func:`textdomain` می‌گیرد. " +"*localedir* اختیاری مانند :func:`bindtextdomain` است. *languages* اختیاری " +"فهرستی از رشته‌هاست که هر رشته یک کد زبان است." -msgid "If *localedir* is not given, then the default system locale directory is used. [#]_ If *languages* is not given, then the following environment variables are searched: :envvar:`LANGUAGE`, :envvar:`LC_ALL`, :envvar:`LC_MESSAGES`, and :envvar:`LANG`. The first one returning a non-empty value is used for the *languages* variable. The environment variables should contain a colon separated list of languages, which will be split on the colon to produce the expected list of language code strings." -msgstr "" +msgid "" +"If *localedir* is not given, then the default system locale directory is " +"used. [#]_ If *languages* is not given, then the following environment " +"variables are searched: :envvar:`LANGUAGE`, :envvar:`LC_ALL`, " +":envvar:`LC_MESSAGES`, and :envvar:`LANG`. The first one returning a non-" +"empty value is used for the *languages* variable. The environment variables " +"should contain a colon separated list of languages, which will be split on " +"the colon to produce the expected list of language code strings." +msgstr "" +"اگر *localedir* داده نشود، از پوشه‌ی locale پیش‌فرض سیستم استفاده می‌شود. " +"[#]_ اگر *languages* داده نشود، متغیرهای محیطی زیر جستجو می‌شوند: " +":envvar:`LANGUAGE`، :envvar:`LC_ALL`، :envvar:`LC_MESSAGES` و " +":envvar:`LANG`. اولین متغیری که مقداری غیرخالی برمی‌گرداند، برای متغیر " +"*languages* استفاده می‌شود. متغیرهای محیطی باید حاوی فهرستی از زبان‌ها " +"جداشده با دونقطه باشند که بر اساس دونقطه تفکیک می‌شود تا فهرست مورد انتظار " +"از رشته‌های کد زبان تولید شود." -msgid ":func:`find` then expands and normalizes the languages, and then iterates through them, searching for an existing file built of these components:" +msgid "" +":func:`find` then expands and normalizes the languages, and then iterates " +"through them, searching for an existing file built of these components:" msgstr "" +":func:`find` سپس زبان‌ها را بسط می‌دهد و عادی‌سازی می‌کند، سپس آن‌ها را " +"پیمایش می‌کند و به دنبال فایل موجودی می‌گردد که از این کامپوننت‌ها ساخته‌شده" +" است:" msgid ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" -msgstr "" +msgstr ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" -msgid "The first such file name that exists is returned by :func:`find`. If no such file is found, then ``None`` is returned. If *all* is given, it returns a list of all file names, in the order in which they appear in the languages list or the environment variables." +msgid "" +"The first such file name that exists is returned by :func:`find`. If no such" +" file is found, then ``None`` is returned. If *all* is given, it returns a " +"list of all file names, in the order in which they appear in the languages " +"list or the environment variables." msgstr "" +":func:`find` اولین نام فایلی را که از این نوع وجود دارد، بازمی‌گرداند. اگر " +"چنین فایلی پیدا نشود، ``None`` بازگردانده می‌شود. اگر *all* داده شود، فهرستی" +" از همه‌ی نام فایل‌ها را به ترتیبی که در فهرست زبان‌ها یا متغیرهای محیطی " +"ظاهر می‌شوند، برمی‌گرداند." -msgid "Return a ``*Translations`` instance based on the *domain*, *localedir*, and *languages*, which are first passed to :func:`find` to get a list of the associated :file:`.mo` file paths. Instances with identical :file:`.mo` file names are cached. The actual class instantiated is *class_* if provided, otherwise :class:`GNUTranslations`. The class's constructor must take a single :term:`file object` argument." -msgstr "" +msgid "" +"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " +"*languages*, which are first passed to :func:`find` to get a list of the " +"associated :file:`.mo` file paths. Instances with identical :file:`.mo` " +"file names are cached. The actual class instantiated is *class_* if " +"provided, otherwise :class:`GNUTranslations`. The class's constructor must " +"take a single :term:`file object` argument." +msgstr "" +"یک نمونه از ``*Translations`` بر اساس *domain*، *localedir* و *languages* " +"برمی‌گرداند، که ابتدا به :func:`find` داده می‌شوند تا فهرستی از مسیرهای فایل" +" :file:`.mo` مرتبط به دست آید. نمونه‌هایی با نام فایل :file:`.mo` یکسان در " +"نهانگاه ذخیره می‌شوند. کلاس واقعی که نمونه‌سازی می‌شود، اگر ارائه شده باشد، " +"*class_* است؛ در غیر این صورت :class:`GNUTranslations` است. سازنده‌ی کلاس " +"باید تنها یک آرگومان :term:`file object` بپذیرد." -msgid "If multiple files are found, later files are used as fallbacks for earlier ones. To allow setting the fallback, :func:`copy.copy` is used to clone each translation object from the cache; the actual instance data is still shared with the cache." +msgid "" +"If multiple files are found, later files are used as fallbacks for earlier " +"ones. To allow setting the fallback, :func:`copy.copy` is used to clone each" +" translation object from the cache; the actual instance data is still shared" +" with the cache." msgstr "" +"اگر چندین فایل یافت شوند، فایل‌های بعدی به‌عنوان جایگزین (fallback) برای " +"فایل‌های قبلی استفاده می‌شوند. برای امکان تنظیم جایگزین از " +":func:`copy.copy` برای شبیه‌سازی هر شیء ترجمه از نهانگاه استفاده می‌شود؛ " +"داده‌های واقعی نمونه همچنان با نهانگاه مشترک هستند." -msgid "If no :file:`.mo` file is found, this function raises :exc:`OSError` if *fallback* is false (which is the default), and returns a :class:`NullTranslations` instance if *fallback* is true." +msgid "" +"If no :file:`.mo` file is found, this function raises :exc:`OSError` if " +"*fallback* is false (which is the default), and returns a " +":class:`NullTranslations` instance if *fallback* is true." msgstr "" +"اگر هیچ فایل :file:`.mo` یافت نشود، این تابع در صورتی که *fallback* نادرست " +"باشد (که پیش‌فرض است)، استثنای :exc:`OSError` را پرتاب می‌کند و اگر " +"*fallback* درست باشد، یک نمونه از :class:`NullTranslations` را برمی‌گرداند." -msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." +msgid "" +":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" +":exc:`IOError` در گذشته پرتاب می‌شد، اما اکنون نام مستعاری از :exc:`OSError`" +" است." msgid "*codeset* parameter is removed." -msgstr "" +msgstr "پارامتر *codeset* حذف شده است." -msgid "This installs the function :func:`!_` in Python's builtins namespace, based on *domain* and *localedir* which are passed to the function :func:`translation`." +msgid "" +"This installs the function :func:`!_` in Python's builtins namespace, based " +"on *domain* and *localedir* which are passed to the function " +":func:`translation`." msgstr "" +"این کار تابع :func:`!_` را در فضای نام توکارهای پایتون نصب می‌کند، بر اساس " +"*domain* و *localedir* که به تابع :func:`translation` ارسال می‌شوند." -msgid "For the *names* parameter, please see the description of the translation object's :meth:`~NullTranslations.install` method." +msgid "" +"For the *names* parameter, please see the description of the translation " +"object's :meth:`~NullTranslations.install` method." msgstr "" +"برای پارامتر *names*، لطفاً توضیح متد :meth:`~NullTranslations.install` شیء " +"ترجمه را ببینید." -msgid "As seen below, you usually mark the strings in your application that are candidates for translation, by wrapping them in a call to the :func:`!_` function, like this::" +msgid "" +"As seen below, you usually mark the strings in your application that are " +"candidates for translation, by wrapping them in a call to the :func:`!_` " +"function, like this::" msgstr "" +"همان‌طور که در زیر می‌بینید، معمولاً رشته‌های برنامه‌تان را که نامزد ترجمه " +"هستند، با قرار دادن آن‌ها در فراخوانی تابع :func:`!_` علامت‌گذاری می‌کنید، " +"به این صورت::" msgid "print(_('This string will be translated.'))" -msgstr "" +msgstr "print(_('This string will be translated.'))" -msgid "For convenience, you want the :func:`!_` function to be installed in Python's builtins namespace, so it is easily accessible in all modules of your application." +msgid "" +"For convenience, you want the :func:`!_` function to be installed in " +"Python's builtins namespace, so it is easily accessible in all modules of " +"your application." msgstr "" +"برای سهولت، می‌خواهید تابع :func:`!_` در فضای نام توکار پایتون نصب شود، تا " +"به‌راحتی در تمام ماژول‌های برنامه شما در دسترس باشد." msgid "*names* is now a keyword-only parameter." -msgstr "" +msgstr "*names* اکنون یک پارامتر فقط کلیدواژه‌ای است." msgid "The :class:`NullTranslations` class" -msgstr "" +msgstr "کلاس :class:`NullTranslations`" -msgid "Translation classes are what actually implement the translation of original source file message strings to translated message strings. The base class used by all translation classes is :class:`NullTranslations`; this provides the basic interface you can use to write your own specialized translation classes. Here are the methods of :class:`!NullTranslations`:" -msgstr "" +msgid "" +"Translation classes are what actually implement the translation of original " +"source file message strings to translated message strings. The base class " +"used by all translation classes is :class:`NullTranslations`; this provides " +"the basic interface you can use to write your own specialized translation " +"classes. Here are the methods of :class:`!NullTranslations`:" +msgstr "" +"کلاس‌های ترجمه، در واقع ترجمه‌ی رشته‌های پیام فایل منبع اصلی به رشته‌های " +"پیام ترجمه‌شده را پیاده‌سازی می‌کنند. کلاس پایه‌ای که همه‌ی کلاس‌های ترجمه " +"از آن استفاده می‌کنند، :class:`NullTranslations` است؛ این کلاس، رابط پایه‌ای" +" را فراهم می‌کند که می‌توانید برای نوشتن کلاس‌های ترجمه‌ی اختصاصی خود از آن " +"استفاده کنید. متدهای :class:`!NullTranslations` به شرح زیر است:" -msgid "Takes an optional :term:`file object` *fp*, which is ignored by the base class. Initializes \"protected\" instance variables *_info* and *_charset* which are set by derived classes, as well as *_fallback*, which is set through :meth:`add_fallback`. It then calls ``self._parse(fp)`` if *fp* is not ``None``." -msgstr "" +msgid "" +"Takes an optional :term:`file object` *fp*, which is ignored by the base " +"class. Initializes \"protected\" instance variables *_info* and *_charset* " +"which are set by derived classes, as well as *_fallback*, which is set " +"through :meth:`add_fallback`. It then calls ``self._parse(fp)`` if *fp* is " +"not ``None``." +msgstr "" +"یک :term:`شیء فایل ` اختیاری به نام *fp* دریافت می‌کند که توسط " +"کلاس پایه نادیده گرفته می‌شود. متغیرهای نمونه «محافظت‌شده» *_info* و " +"*_charset* را که توسط کلاس‌های مشتق‌شده تنظیم می‌شوند، و همچنین *_fallback* " +"را که از طریق :meth:`add_fallback` تنظیم می‌شود، مقداردهی اولیه می‌کند. سپس " +"اگر *fp* برابر ``None`` نباشد، ``self._parse(fp)`` را فراخوانی می‌کند." -msgid "No-op in the base class, this method takes file object *fp*, and reads the data from the file, initializing its message catalog. If you have an unsupported message catalog file format, you should override this method to parse your format." +msgid "" +"No-op in the base class, this method takes file object *fp*, and reads the " +"data from the file, initializing its message catalog. If you have an " +"unsupported message catalog file format, you should override this method to " +"parse your format." msgstr "" +"این متد در کلاس پایه عملیات بی‌اثر (No-op) است، شیء فایل *fp* را می‌گیرد و " +"داده‌ها را از فایل می‌خواند و کاتالوگ پیام آن را مقداردهی اولیه می‌کند. اگر " +"قالب فایل کاتالوگ پیام پشتیبانی‌نشده‌ای دارید، باید این متد را برای تجزیه " +"قالب خود بازنویسی کنید." -msgid "Add *fallback* as the fallback object for the current translation object. A translation object should consult the fallback if it cannot provide a translation for a given message." +msgid "" +"Add *fallback* as the fallback object for the current translation object. A " +"translation object should consult the fallback if it cannot provide a " +"translation for a given message." msgstr "" +"*fallback* را به‌عنوان شیء جایگزین (fallback) برای شیء ترجمه‌ی فعلی اضافه " +"کنید. یک شیء ترجمه باید در صورتی که نتواند ترجمه‌ای برای یک پیام داده‌شده " +"ارائه کند، به شیء جایگزین (fallback) مراجعه کند." -msgid "If a fallback has been set, forward :meth:`!gettext` to the fallback. Otherwise, return *message*. Overridden in derived classes." +msgid "" +"If a fallback has been set, forward :meth:`!gettext` to the fallback. " +"Otherwise, return *message*. Overridden in derived classes." msgstr "" +"اگر یک جایگزین (fallback) تنظیم شده باشد، :meth:`!gettext` به جایگزین ارجاع " +"داده می‌شود. در غیر این صورت، *message* برگردانده می‌شود. در کلاس‌های " +"مشتق‌شده بازنویسی می‌شود." -msgid "If a fallback has been set, forward :meth:`!ngettext` to the fallback. Otherwise, return *singular* if *n* is 1; return *plural* otherwise. Overridden in derived classes." +msgid "" +"If a fallback has been set, forward :meth:`!ngettext` to the fallback. " +"Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " +"Overridden in derived classes." msgstr "" +"اگر یک جایگزین (fallback) تنظیم شده باشد، :meth:`!ngettext` را به جایگزین " +"ارجاع می‌دهد. در غیر این صورت، اگر *n* برابر ۱ باشد، *singular* را " +"برمی‌گرداند؛ در غیر این صورت *plural* را برمی‌گرداند. در کلاس‌های مشتق‌شده " +"بازنویسی می‌شود." -msgid "If a fallback has been set, forward :meth:`pgettext` to the fallback. Otherwise, return the translated message. Overridden in derived classes." +msgid "" +"If a fallback has been set, forward :meth:`pgettext` to the fallback. " +"Otherwise, return the translated message. Overridden in derived classes." msgstr "" +"اگر یک جایگزین (fallback) تنظیم شده باشد، :meth:`pgettext` را به آن جایگزین " +"(fallback) ارجاع می‌دهد. در غیر این صورت، پیام ترجمه‌شده را برمی‌گرداند. در " +"کلاس‌های مشتق‌شده بازنویسی می‌شود." -msgid "If a fallback has been set, forward :meth:`npgettext` to the fallback. Otherwise, return the translated message. Overridden in derived classes." +msgid "" +"If a fallback has been set, forward :meth:`npgettext` to the fallback. " +"Otherwise, return the translated message. Overridden in derived classes." msgstr "" +"اگر یک جایگزین (fallback) تنظیم‌شده باشد، :meth:`npgettext` را به آن جایگزین" +" ارجاع می‌دهد. در غیر این صورت، پیام ترجمه‌شده را برمی‌گرداند. در کلاس‌های " +"مشتق‌شده بازنویسی (override) می‌شود." -msgid "Return a dictionary containing the metadata found in the message catalog file." -msgstr "" +msgid "" +"Return a dictionary containing the metadata found in the message catalog " +"file." +msgstr "یک دیکشنری شامل فراداده‌ی یافت‌شده در فایل کاتالوگ پیام برمی‌گرداند." msgid "Return the encoding of the message catalog file." -msgstr "" +msgstr "کدگذاری فایل کاتالوگ پیام را برمی‌گرداند." -msgid "This method installs :meth:`.gettext` into the built-in namespace, binding it to ``_``." +msgid "" +"This method installs :meth:`.gettext` into the built-in namespace, binding " +"it to ``_``." msgstr "" +"این متد :meth:`.gettext` را در فضای نام توکار نصب می‌کند و آن را به ``_`` " +"پیوند می‌دهد." -msgid "If the *names* parameter is given, it must be a sequence containing the names of functions you want to install in the builtins namespace in addition to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, ``'pgettext'``, and ``'npgettext'``." +msgid "" +"If the *names* parameter is given, it must be a sequence containing the " +"names of functions you want to install in the builtins namespace in addition" +" to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, and ``'npgettext'``." msgstr "" +"اگر پارامتر *names* داده شده باشد، باید دنباله‌ای حاوی نام توابعی باشد که " +"می‌خواهید علاوه بر :func:`!_` در فضای نام builtins نصب کنید. نام‌های " +"پشتیبانی‌شده ``'gettext'``، ``'ngettext'``، ``'pgettext'`` و ``'npgettext'``" +" هستند." -msgid "Note that this is only one way, albeit the most convenient way, to make the :func:`!_` function available to your application. Because it affects the entire application globally, and specifically the built-in namespace, localized modules should never install :func:`!_`. Instead, they should use this code to make :func:`!_` available to their module::" -msgstr "" +msgid "" +"Note that this is only one way, albeit the most convenient way, to make the " +":func:`!_` function available to your application. Because it affects the " +"entire application globally, and specifically the built-in namespace, " +"localized modules should never install :func:`!_`. Instead, they should use " +"this code to make :func:`!_` available to their module::" +msgstr "" +"توجه داشته باشید که این تنها یک راه، هرچند راحت‌ترین راه، برای در دسترس قرار" +" دادن تابع :func:`!_` در برنامه شما است. از آنجا که این کار بر کل برنامه " +"به‌صورت سراسری و به‌ویژه بر فضای نام توکار تأثیر می‌گذارد، ماژول‌های " +"محلی‌سازی‌شده هرگز نباید :func:`!_` را نصب کنند. در عوض، آن‌ها باید از این " +"کد استفاده کنند تا :func:`!_` را برای ماژول خود در دسترس قرار دهند::" msgid "" "import gettext\n" "t = gettext.translation('mymodule', ...)\n" "_ = t.gettext" msgstr "" +"import gettext\n" +"t = gettext.translation('mymodule', ...)\n" +"_ = t.gettext" -msgid "This puts :func:`!_` only in the module's global namespace and so only affects calls within this module." +msgid "" +"This puts :func:`!_` only in the module's global namespace and so only " +"affects calls within this module." msgstr "" +"این، :func:`!_` را فقط در فضای نام سراسری ماژول قرار می‌دهد و بنابراین فقط " +"بر فراخوانی‌های درون این ماژول تأثیر می‌گذارد." msgid "Added ``'pgettext'`` and ``'npgettext'``." -msgstr "" +msgstr "``'pgettext'`` و ``'npgettext'`` افزوده شدند." msgid "The :class:`GNUTranslations` class" -msgstr "" +msgstr "کلاس :class:`GNUTranslations`" -msgid "The :mod:`!gettext` module provides one additional class derived from :class:`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:`!_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in both big-endian and little-endian format." +msgid "" +"The :mod:`!gettext` module provides one additional class derived from " +":class:`NullTranslations`: :class:`GNUTranslations`. This class overrides " +":meth:`!_parse` to enable reading GNU :program:`gettext` format :file:`.mo` " +"files in both big-endian and little-endian format." msgstr "" +"ماژول :mod:`!gettext` یک کلاس اضافی مشتق‌شده از :class:`NullTranslations` " +"ارائه می‌دهد: :class:`GNUTranslations`. این کلاس :meth:`!_parse` را بازنویسی" +" می‌کند تا امکان خواندن فایل‌های :file:`.mo` با قالب GNU :program:`gettext` " +"در هر دو قالب بزرگ‌اندیان (big-endian) و کوچک‌اندیان (little-endian) فراهم " +"شود." -msgid ":class:`GNUTranslations` parses optional metadata out of the translation catalog. It is convention with GNU :program:`gettext` to include metadata as the translation for the empty string. This metadata is in :rfc:`822`\\ -style ``key: value`` pairs, and should contain the ``Project-Id-Version`` key. If the key ``Content-Type`` is found, then the ``charset`` property is used to initialize the \"protected\" :attr:`!_charset` instance variable, defaulting to ``None`` if not found. If the charset encoding is specified, then all message ids and message strings read from the catalog are converted to Unicode using this encoding, else ASCII is assumed." -msgstr "" +msgid "" +":class:`GNUTranslations` parses optional metadata out of the translation " +"catalog. It is convention with GNU :program:`gettext` to include metadata as" +" the translation for the empty string. This metadata is in :rfc:`822`\\ " +"-style ``key: value`` pairs, and should contain the ``Project-Id-Version`` " +"key. If the key ``Content-Type`` is found, then the ``charset`` property is" +" used to initialize the \"protected\" :attr:`!_charset` instance variable, " +"defaulting to ``None`` if not found. If the charset encoding is specified, " +"then all message ids and message strings read from the catalog are converted" +" to Unicode using this encoding, else ASCII is assumed." +msgstr "" +":class:`GNUTranslations` فراداده‌ی اختیاری را از کاتالوگ ترجمه تجزیه می‌کند. " +"در GNU :program:`gettext` مرسوم است که فراداده به‌عنوان ترجمه‌ی رشته‌ی خالی " +"گنجانده شود. این فراداده به‌صورت جفت‌های ``key: value`` به سبک :rfc:`822` " +"است و باید شامل کلید ``Project-Id-Version`` باشد. اگر کلید ``Content-Type`` " +"یافت شود، از ویژگی ``charset`` برای مقداردهی اولیه‌ی متغیر نمونه‌ی " +"«محافظت‌شده» :attr:`!_charset` استفاده می‌شود، که اگر یافت نشود مقدار " +"پیش‌فرض آن ``None`` خواهد بود. اگر کدگذاری charset مشخص شده باشد، تمام " +"شناسه‌های پیام و رشته‌های پیام خوانده‌شده از کاتالوگ با استفاده از این " +"کدگذاری به یونیکد تبدیل می‌شوند، در غیر این صورت ASCII فرض می‌شود." -msgid "Since message ids are read as Unicode strings too, all ``*gettext()`` methods will assume message ids as Unicode strings, not byte strings." +msgid "" +"Since message ids are read as Unicode strings too, all ``*gettext()`` " +"methods will assume message ids as Unicode strings, not byte strings." msgstr "" +"از آنجا که شناسه‌های پیام نیز به‌صورت رشته‌های یونیکد خوانده می‌شوند، تمام " +"متدهای ``*gettext()`` شناسه‌های پیام را به‌صورت رشته‌های یونیکد در نظر " +"می‌گیرند، نه رشته‌های بایتی." -msgid "The entire set of key/value pairs are placed into a dictionary and set as the \"protected\" :attr:`!_info` instance variable." +msgid "" +"The entire set of key/value pairs are placed into a dictionary and set as " +"the \"protected\" :attr:`!_info` instance variable." msgstr "" +"مجموعه‌ی کاملی از جفت‌های کلید/مقدار در یک دیکشنری قرار می‌گیرد و به‌عنوان " +"متغیر نمونه «محافظت‌شده» :attr:`!_info` تنظیم می‌شود." -msgid "If the :file:`.mo` file's magic number is invalid, the major version number is unexpected, or if other problems occur while reading the file, instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." +msgid "" +"If the :file:`.mo` file's magic number is invalid, the major version number " +"is unexpected, or if other problems occur while reading the file, " +"instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." msgstr "" +"اگر شماره جادویی (magic number) فایل :file:`.mo` نامعتبر باشد، شماره نسخه " +"اصلی غیرمنتظره باشد، یا مشکلات دیگری هنگام خواندن فایل رخ دهد، نمونه‌سازی از" +" کلاس :class:`GNUTranslations` ممکن است :exc:`OSError` را پرتاب کند." -msgid "The following methods are overridden from the base class implementation:" -msgstr "" +msgid "" +"The following methods are overridden from the base class implementation:" +msgstr "متدهای زیر نسبت به پیاده‌سازی کلاس پایه بازنویسی شده‌اند:" -msgid "Look up the *message* id in the catalog and return the corresponding message string, as a Unicode string. If there is no entry in the catalog for the *message* id, and a fallback has been set, the look up is forwarded to the fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the *message* id is returned." -msgstr "" +msgid "" +"Look up the *message* id in the catalog and return the corresponding message" +" string, as a Unicode string. If there is no entry in the catalog for the " +"*message* id, and a fallback has been set, the look up is forwarded to the " +"fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the " +"*message* id is returned." +msgstr "" +"شناسه‌ی *message* را در کاتالوگ جست‌وجو می‌کند و رشته‌ی پیام متناظر را " +"به‌صورت یک رشته‌ی یونیکد برمی‌گرداند. اگر ورودی‌ای برای شناسه‌ی *message* در" +" کاتالوگ وجود نداشته باشد و یک جایگزین (fallback) تنظیم شده باشد، جست‌وجو به" +" متد :meth:`~NullTranslations.gettext` مربوط به جایگزین (fallback) ارجاع " +"داده می‌شود. در غیر این صورت، شناسه‌ی *message* برگردانده می‌شود." -msgid "Do a plural-forms lookup of a message id. *singular* is used as the message id for purposes of lookup in the catalog, while *n* is used to determine which plural form to use. The returned message string is a Unicode string." +msgid "" +"Do a plural-forms lookup of a message id. *singular* is used as the message" +" id for purposes of lookup in the catalog, while *n* is used to determine " +"which plural form to use. The returned message string is a Unicode string." msgstr "" +"جست‌وجوی صورت‌های جمع یک شناسه پیام را انجام می‌دهد. *singular* به‌عنوان " +"شناسه پیام برای جست‌وجو در کاتالوگ استفاده می‌شود، در حالی که *n* برای تعیین" +" اینکه کدام صورت جمع استفاده شود به کار می‌رود. رشته پیام بازگشتی یک رشته " +"Unicode است." -msgid "If the message id is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's :meth:`~NullTranslations.ngettext` method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is returned in all other cases." +msgid "" +"If the message id is not found in the catalog, and a fallback is specified, " +"the request is forwarded to the fallback's " +":meth:`~NullTranslations.ngettext` method. Otherwise, when *n* is 1 " +"*singular* is returned, and *plural* is returned in all other cases." msgstr "" +"اگر شناسه پیام در کاتالوگ پیدا نشود و یک جایگزین (fallback) مشخص شده باشد، " +"درخواست به متد :meth:`~NullTranslations.ngettext` آن جایگزین ارجاع داده " +"می‌شود. در غیر این صورت، هنگامی که *n* برابر ۱ باشد، *singular* برگردانده " +"می‌شود و در تمام موارد دیگر *plural* برگردانده می‌شود." msgid "Here is an example::" -msgstr "" +msgstr "در اینجا یک مثال آمده است::" msgid "" "n = len(os.listdir('.'))\n" @@ -232,27 +587,67 @@ msgid "" " 'There are %(num)d files in this directory',\n" " n) % {'num': n}" msgstr "" +"n = len(os.listdir('.'))\n" +"cat = GNUTranslations(somefile)\n" +"message = cat.ngettext(\n" +" 'There is %(num)d file in this directory',\n" +" 'There are %(num)d files in this directory',\n" +" n) % {'num': n}" -msgid "Look up the *context* and *message* id in the catalog and return the corresponding message string, as a Unicode string. If there is no entry in the catalog for the *message* id and *context*, and a fallback has been set, the look up is forwarded to the fallback's :meth:`pgettext` method. Otherwise, the *message* id is returned." -msgstr "" +msgid "" +"Look up the *context* and *message* id in the catalog and return the " +"corresponding message string, as a Unicode string. If there is no entry in " +"the catalog for the *message* id and *context*, and a fallback has been set," +" the look up is forwarded to the fallback's :meth:`pgettext` method. " +"Otherwise, the *message* id is returned." +msgstr "" +"*context* و شناسه‌ی *message* را در کاتالوگ جست‌وجو می‌کند و رشته‌ی پیام " +"متناظر را به‌صورت یک رشته‌ی یونیکد برمی‌گرداند. اگر هیچ ورودی‌ای در کاتالوگ " +"برای شناسه‌ی *message* و *context* وجود نداشته باشد و یک جایگزین (fallback) " +"تنظیم شده باشد، جست‌وجو به متد :meth:`pgettext` مربوط به جایگزین (fallback) " +"ارجاع داده می‌شود. در غیر این صورت، شناسه‌ی *message* برگردانده می‌شود." -msgid "Do a plural-forms lookup of a message id. *singular* is used as the message id for purposes of lookup in the catalog, while *n* is used to determine which plural form to use." +msgid "" +"Do a plural-forms lookup of a message id. *singular* is used as the message" +" id for purposes of lookup in the catalog, while *n* is used to determine " +"which plural form to use." msgstr "" +"جست‌وجوی فرم‌های جمع برای یک شناسه پیام انجام می‌شود. *singular* به‌عنوان " +"شناسه پیام برای جست‌وجو در کاتالوگ استفاده می‌شود، در حالی که *n* برای تعیین" +" اینکه کدام فرم جمع استفاده شود به کار می‌رود." -msgid "If the message id for *context* is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's :meth:`npgettext` method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is returned in all other cases." +msgid "" +"If the message id for *context* is not found in the catalog, and a fallback " +"is specified, the request is forwarded to the fallback's :meth:`npgettext` " +"method. Otherwise, when *n* is 1 *singular* is returned, and *plural* is " +"returned in all other cases." msgstr "" +"اگر شناسه‌ی پیام برای *context* در کاتالوگ پیدا نشود، و یک جایگزین مشخص شده " +"باشد، درخواست به متد :meth:`npgettext` جایگزین ارجاع داده می‌شود. در غیر این" +" صورت، هنگامی که *n* برابر ۱ باشد، *singular* برگردانده می‌شود، و در همه‌ی " +"موارد دیگر *plural* برگردانده می‌شود." msgid "Solaris message catalog support" -msgstr "" +msgstr "پشتیبانی از فهرست پیام‌های Solaris" -msgid "The Solaris operating system defines its own binary :file:`.mo` file format, but since no documentation can be found on this format, it is not supported at this time." +msgid "" +"The Solaris operating system defines its own binary :file:`.mo` file format," +" but since no documentation can be found on this format, it is not supported" +" at this time." msgstr "" +"سیستم‌عامل Solaris قالب فایل دودویی :file:`.mo` خاص خود را تعریف می‌کند، اما" +" از آن‌جا که هیچ مستنداتی درباره این قالب یافت نمی‌شود، در حال حاضر پشتیبانی" +" نمی‌شود." msgid "The Catalog constructor" -msgstr "" +msgstr "سازنده‌ی Catalog" -msgid "GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but this version has a slightly different API. Its documented usage was::" +msgid "" +"GNOME uses a version of the :mod:`!gettext` module by James Henstridge, but " +"this version has a slightly different API. Its documented usage was::" msgstr "" +"GNOME از نسخه‌ای از ماژول :mod:`!gettext` نوشته‌ی James Henstridge استفاده " +"می‌کند، اما این نسخه دارای API کمی متفاوتی است. کاربرد مستند آن چنین بود::" msgid "" "import gettext\n" @@ -260,33 +655,73 @@ msgid "" "_ = cat.gettext\n" "print(_('hello world'))" msgstr "" +"import gettext\n" +"cat = gettext.Catalog(domain, localedir)\n" +"_ = cat.gettext\n" +"print(_('hello world'))" -msgid "For compatibility with this older module, the function :func:`!Catalog` is an alias for the :func:`translation` function described above." +msgid "" +"For compatibility with this older module, the function :func:`!Catalog` is " +"an alias for the :func:`translation` function described above." msgstr "" +"برای سازگاری با این ماژول قدیمی‌تر، تابع :func:`!Catalog` نام مستعاری برای " +"تابع :func:`translation` است که در بالا توضیح داده شد." -msgid "One difference between this module and Henstridge's: his catalog objects supported access through a mapping API, but this appears to be unused and so is not currently supported." +msgid "" +"One difference between this module and Henstridge's: his catalog objects " +"supported access through a mapping API, but this appears to be unused and so" +" is not currently supported." msgstr "" +"یکی از تفاوت‌های میان این ماژول و ماژول Henstridge: اشیای کاتالوگ او از " +"دسترسی از طریق یک API نگاشت پشتیبانی می‌کردند، اما به نظر می‌رسد این قابلیت " +"استفاده نشده است و بنابراین در حال حاضر پشتیبانی نمی‌شود." msgid "Internationalizing your programs and modules" -msgstr "" +msgstr "بین‌المللی‌سازی برنامه‌ها و ماژول‌های شما" -msgid "Internationalization (I18N) refers to the operation by which a program is made aware of multiple languages. Localization (L10N) refers to the adaptation of your program, once internationalized, to the local language and cultural habits. In order to provide multilingual messages for your Python programs, you need to take the following steps:" +msgid "" +"Internationalization (I18N) refers to the operation by which a program is " +"made aware of multiple languages. Localization (L10N) refers to the " +"adaptation of your program, once internationalized, to the local language " +"and cultural habits. In order to provide multilingual messages for your " +"Python programs, you need to take the following steps:" msgstr "" +"بین‌المللی‌سازی (I18N) به عملیاتی اشاره دارد که طی آن یک برنامه از چندین " +"زبان آگاه می‌شود. بومی‌سازی (L10N) به تطبیق برنامه شما، پس از " +"بین‌المللی‌سازی، با زبان محلی و عادات فرهنگی اشاره دارد. برای فراهم کردن " +"پیام‌های چندزبانه برای برنامه‌های پایتون خود، باید مراحل زیر را انجام دهید:" -msgid "prepare your program or module by specially marking translatable strings" +msgid "" +"prepare your program or module by specially marking translatable strings" msgstr "" +"برنامه یا ماژول خود را با نمادگذاری ویژه‌ی رشته‌های قابل‌ترجمه آماده کنید" -msgid "run a suite of tools over your marked files to generate raw messages catalogs" +msgid "" +"run a suite of tools over your marked files to generate raw messages " +"catalogs" msgstr "" +"اجرای مجموعه‌ای از ابزارها بر روی فایل‌های علامت‌گذاری‌شده‌ی شما برای تولید" +" کاتالوگ‌های خام پیام" msgid "create language-specific translations of the message catalogs" -msgstr "" +msgstr "ایجاد ترجمه‌های مختص هر زبان برای کاتالوگ‌های پیام" -msgid "use the :mod:`!gettext` module so that message strings are properly translated" +msgid "" +"use the :mod:`!gettext` module so that message strings are properly " +"translated" msgstr "" +"از ماژول :mod:`!gettext` استفاده کنید تا رشته‌های پیام به‌درستی ترجمه شوند" -msgid "In order to prepare your code for I18N, you need to look at all the strings in your files. Any string that needs to be translated should be marked by wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ `. For example::" +msgid "" +"In order to prepare your code for I18N, you need to look at all the strings " +"in your files. Any string that needs to be translated should be marked by " +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " +"`. For example::" msgstr "" +"برای آماده‌سازی کد خود برای بین‌المللی‌سازی (I18N)، باید تمام رشته‌های موجود" +" در فایل‌های خود را بررسی کنید. هر رشته‌ای که باید ترجمه شود، باید با قرار " +"دادن آن در ``_('...')`` علامت‌گذاری شود --- یعنی فراخوانی تابع :func:`_ " +"`. برای مثال::" msgid "" "filename = 'mylog.txt'\n" @@ -294,67 +729,189 @@ msgid "" "with open(filename, 'w') as fp:\n" " fp.write(message)" msgstr "" +"filename = 'mylog.txt'\n" +"message = _('writing a log message')\n" +"with open(filename, 'w') as fp:\n" +" fp.write(message)" -msgid "In this example, the string ``'writing a log message'`` is marked as a candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are not." +msgid "" +"In this example, the string ``'writing a log message'`` is marked as a " +"candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are" +" not." msgstr "" +"در این مثال، رشته ``'writing a log message'`` به‌عنوان نامزدی برای ترجمه " +"علامت‌گذاری شده است، اما رشته‌های ``'mylog.txt'`` و ``'w'`` علامت‌گذاری " +"نشده‌اند." -msgid "There are a few tools to extract the strings meant for translation. The original GNU :program:`gettext` only supported C or C++ source code but its extended version :program:`xgettext` scans code written in a number of languages, including Python, to find strings marked as translatable. `Babel `__ is a Python internationalization library that includes a :file:`pybabel` script to extract and compile message catalogs. François Pinard's program called :program:`xpot` does a similar job and is available as part of his `po-utils package `__." -msgstr "" +msgid "" +"There are a few tools to extract the strings meant for translation. The " +"original GNU :program:`gettext` only supported C or C++ source code but its " +"extended version :program:`xgettext` scans code written in a number of " +"languages, including Python, to find strings marked as translatable. `Babel" +" `__ is a Python internationalization library that" +" includes a :file:`pybabel` script to extract and compile message catalogs." +" François Pinard's program called :program:`xpot` does a similar job and is" +" available as part of his `po-utils package `__." +msgstr "" +"چند ابزار برای استخراج رشته‌های موردنظر برای ترجمه وجود دارد. نسخه اصلی GNU " +":program:`gettext` فقط از کد منبع C یا C++ پشتیبانی می‌کرد، اما نسخه " +"گسترش‌یافته آن :program:`xgettext` کد نوشته‌شده به چندین زبان، از جمله " +"Python، را پویش می‌کند تا رشته‌های علامت‌گذاری‌شده به‌عنوان قابل‌ترجمه را " +"پیدا کند. `Babel `__ یک کتابخانه بین‌المللی‌سازی " +"Python است که شامل یک اسکریپت :file:`pybabel` برای استخراج و کامپایل " +"کاتالوگ‌های پیام است. برنامه‌ای از François Pinard به نام :program:`xpot` " +"کار مشابهی انجام می‌دهد و به‌عنوان بخشی از `بسته po-utils " +"`__ او در دسترس است." -msgid "(Python also includes pure-Python versions of these programs, called :program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions will install them for you. :program:`pygettext.py` is similar to :program:`xgettext`, but only understands Python source code and cannot handle other programming languages such as C or C++. :program:`pygettext.py` supports a command-line interface similar to :program:`xgettext`; for details on its use, run ``pygettext.py --help``. :program:`msgfmt.py` is binary compatible with GNU :program:`msgfmt`. With these two programs, you may not need the GNU :program:`gettext` package to internationalize your Python applications.)" -msgstr "" +msgid "" +"(Python also includes pure-Python versions of these programs, called " +":program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " +"will install them for you. :program:`pygettext.py` is similar to " +":program:`xgettext`, but only understands Python source code and cannot " +"handle other programming languages such as C or C++. :program:`pygettext.py`" +" supports a command-line interface similar to :program:`xgettext`; for " +"details on its use, run ``pygettext.py --help``. :program:`msgfmt.py` is " +"binary compatible with GNU :program:`msgfmt`. With these two programs, you " +"may not need the GNU :program:`gettext` package to internationalize your " +"Python applications.)" +msgstr "" +"(پایتون همچنین شامل نسخه‌های پایتون خالص این برنامه‌ها نیز می‌شود که " +":program:`pygettext.py` و :program:`msgfmt.py` نامیده می‌شوند؛ برخی " +"توزیع‌های پایتون این برنامه‌ها را برای شما نصب خواهند کرد. " +":program:`pygettext.py` مشابه :program:`xgettext` است، اما فقط کد منبع " +"پایتون را می‌شناسد و نمی‌تواند زبان‌های برنامه‌نویسی دیگر مانند C یا C++ را " +"پردازش کند. :program:`pygettext.py` از یک رابط خط فرمان مشابه " +":program:`xgettext` پشتیبانی می‌کند؛ برای جزئیات استفاده از آن، " +"``pygettext.py --help`` را اجرا کنید. :program:`msgfmt.py` از نظر دودویی با " +"GNU :program:`msgfmt` سازگار است. با این دو برنامه، ممکن است برای " +"بین‌المللی‌سازی برنامه‌های پایتون خود به بسته GNU :program:`gettext` نیاز " +"نداشته باشید.)" -msgid ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:`.po` files that are message catalogs. They are structured human-readable files that contain every marked string in the source code, along with a placeholder for the translated versions of these strings." +msgid "" +":program:`xgettext`, :program:`pygettext`, and similar tools generate " +":file:`.po` files that are message catalogs. They are structured human-" +"readable files that contain every marked string in the source code, along " +"with a placeholder for the translated versions of these strings." msgstr "" +":program:`xgettext`، :program:`pygettext` و ابزارهای مشابه، فایل‌های " +":file:`.po` را تولید می‌کنند که کاتالوگ‌های پیام هستند. آن‌ها فایل‌های " +"ساختاریافته و قابل‌خواندن برای انسان هستند که هر رشته‌ی علامت‌گذاری‌شده در کد" +" منبع را به‌همراه یک جای‌نگهدار برای نسخه‌های ترجمه‌شده‌ی این رشته‌ها در بر " +"دارند." -msgid "Copies of these :file:`.po` files are then handed over to the individual human translators who write translations for every supported natural language. They send back the completed language-specific versions as a :file:`.po` file that's compiled into a machine-readable :file:`.mo` binary catalog file using the :program:`msgfmt` program. The :file:`.mo` files are used by the :mod:`!gettext` module for the actual translation processing at run-time." -msgstr "" +msgid "" +"Copies of these :file:`.po` files are then handed over to the individual " +"human translators who write translations for every supported natural " +"language. They send back the completed language-specific versions as a " +":file:`.po` file that's compiled into a machine-readable " +":file:`.mo` binary catalog file using the :program:`msgfmt` program. The " +":file:`.mo` files are used by the :mod:`!gettext` module for the actual " +"translation processing at run-time." +msgstr "" +"سپس نسخه‌هایی از این فایل‌های :file:`.po` به‌صورت انفرادی به مترجمان انسانی " +"تحویل داده می‌شوند تا ترجمه‌هایی برای هر زبان طبیعی پشتیبانی‌شده بنویسند. " +"آن‌ها نسخه‌های کامل‌شده‌ی مختص هر زبان را به‌صورت یک فایل :file:`.po` بازمی‌گردانند که با استفاده از برنامه‌ی :program:`msgfmt` به یک " +"فایل کاتالوگ دودویی :file:`.mo` قابل خواندن توسط ماشین کامپایل می‌شود. " +"فایل‌های :file:`.mo` توسط ماژول :mod:`!gettext` برای پردازش واقعی ترجمه در " +"ران‌تایم استفاده می‌شوند." -msgid "How you use the :mod:`!gettext` module in your code depends on whether you are internationalizing a single module or your entire application. The next two sections will discuss each case." +msgid "" +"How you use the :mod:`!gettext` module in your code depends on whether you " +"are internationalizing a single module or your entire application. The next " +"two sections will discuss each case." msgstr "" +"روش استفاده شما از ماژول :mod:`!gettext` در کدتان بستگی به این دارد که در " +"حال بین‌المللی‌سازی یک ماژول هستید یا کل برنامه خود. دو بخش بعدی هر یک از " +"این موارد را بررسی خواهند کرد." msgid "Localizing your module" -msgstr "" +msgstr "بومی‌سازی ماژول شما" -msgid "If you are localizing your module, you must take care not to make global changes, e.g. to the built-in namespace. You should not use the GNU :program:`gettext` API but instead the class-based API." +msgid "" +"If you are localizing your module, you must take care not to make global " +"changes, e.g. to the built-in namespace. You should not use the GNU " +":program:`gettext` API but instead the class-based API." msgstr "" +"اگر در حال بومی‌سازی ماژول خود هستید، باید مراقب باشید که تغییرات سراسری " +"ایجاد نکنید، مثلاً در فضای نام توکار. نباید از API مربوط به GNU " +":program:`gettext` استفاده کنید، بلکه باید از API مبتنی بر کلاس استفاده " +"کنید." -msgid "Let's say your module is called \"spam\" and the module's various natural language translation :file:`.mo` files reside in :file:`/usr/share/locale` in GNU :program:`gettext` format. Here's what you would put at the top of your module::" +msgid "" +"Let's say your module is called \"spam\" and the module's various natural " +"language translation :file:`.mo` files reside in :file:`/usr/share/locale` " +"in GNU :program:`gettext` format. Here's what you would put at the top of " +"your module::" msgstr "" +"فرض کنید ماژول شما \"spam\" نام دارد و فایل‌های :file:`.mo` مربوط به " +"ترجمه‌های مختلف زبان طبیعی ماژول در :file:`/usr/share/locale` با قالب GNU " +":program:`gettext` قرار دارند. آنچه باید در ابتدای ماژول خود بگذارید::" msgid "" "import gettext\n" "t = gettext.translation('spam', '/usr/share/locale')\n" "_ = t.gettext" msgstr "" +"import gettext\n" +"t = gettext.translation('spam', '/usr/share/locale')\n" +"_ = t.gettext" msgid "Localizing your application" -msgstr "" +msgstr "بومی‌سازی برنامه شما" -msgid "If you are localizing your application, you can install the :func:`!_` function globally into the built-in namespace, usually in the main driver file of your application. This will let all your application-specific files just use ``_('...')`` without having to explicitly install it in each file." +msgid "" +"If you are localizing your application, you can install the :func:`!_` " +"function globally into the built-in namespace, usually in the main driver " +"file of your application. This will let all your application-specific files" +" just use ``_('...')`` without having to explicitly install it in each file." msgstr "" +"اگر در حال بومی‌سازی برنامه خود هستید، می‌توانید تابع :func:`!_` را به‌صورت " +"سراسری در فضای نام توکار نصب کنید، معمولاً در فایل راه‌انداز اصلی برنامه " +"خود. این کار باعث می‌شود تمام فایل‌های مختص برنامه شما بتوانند فقط از " +"``_('...')`` استفاده کنند، بدون این‌که لازم باشد آن را به‌صراحت در هر فایل " +"نصب کنید." -msgid "In the simple case then, you need only add the following bit of code to the main driver file of your application::" +msgid "" +"In the simple case then, you need only add the following bit of code to the " +"main driver file of your application::" msgstr "" +"بنابراین در حالت ساده، تنها لازم است قطعه‌کد زیر را به فایل راه‌انداز اصلی " +"برنامه‌تان اضافه کنید::" msgid "" "import gettext\n" "gettext.install('myapplication')" msgstr "" +"import gettext\n" +"gettext.install('myapplication')" -msgid "If you need to set the locale directory, you can pass it into the :func:`install` function::" +msgid "" +"If you need to set the locale directory, you can pass it into the " +":func:`install` function::" msgstr "" +"اگر نیاز دارید پوشه locale را تنظیم کنید، می‌توانید آن را به تابع " +":func:`install` بفرستید::" msgid "" "import gettext\n" "gettext.install('myapplication', '/usr/share/locale')" msgstr "" +"import gettext\n" +"gettext.install('myapplication', '/usr/share/locale')" msgid "Changing languages on the fly" -msgstr "" +msgstr "تغییر زبان در لحظه" -msgid "If your program needs to support many languages at the same time, you may want to create multiple translation instances and then switch between them explicitly, like so::" +msgid "" +"If your program needs to support many languages at the same time, you may " +"want to create multiple translation instances and then switch between them " +"explicitly, like so::" msgstr "" +"اگر برنامه شما نیاز دارد همزمان از زبان‌های بسیاری پشتیبانی کند، ممکن است " +"بخواهید چندین نمونه ترجمه ایجاد کنید و سپس به‌صورت صریح بین آن‌ها جابه‌جا " +"شوید، مانند این::" msgid "" "import gettext\n" @@ -372,12 +929,32 @@ msgid "" "# ... more time goes by, user selects language 3\n" "lang3.install()" msgstr "" +"import gettext\n" +"\n" +"lang1 = gettext.translation('myapplication', languages=['en'])\n" +"lang2 = gettext.translation('myapplication', languages=['fr'])\n" +"lang3 = gettext.translation('myapplication', languages=['de'])\n" +"\n" +"# start by using language1\n" +"lang1.install()\n" +"\n" +"# ... time goes by, user selects language 2\n" +"lang2.install()\n" +"\n" +"# ... more time goes by, user selects language 3\n" +"lang3.install()" msgid "Deferred translations" -msgstr "" +msgstr "ترجمه‌های به‌تعویق‌افتاده" -msgid "In most coding situations, strings are translated where they are coded. Occasionally however, you need to mark strings for translation, but defer actual translation until later. A classic example is::" +msgid "" +"In most coding situations, strings are translated where they are coded. " +"Occasionally however, you need to mark strings for translation, but defer " +"actual translation until later. A classic example is::" msgstr "" +"در بیشتر شرایط کدنویسی، رشته‌ها در همان جایی که کد شده‌اند ترجمه می‌شوند. با" +" این حال، گاهی لازم است رشته‌ها را برای ترجمه علامت‌گذاری کنید، اما ترجمه " +"واقعی را تا بعد به تعویق بیندازید. یک مثال کلاسیک::" msgid "" "animals = ['mollusk',\n" @@ -389,12 +966,26 @@ msgid "" "for a in animals:\n" " print(a)" msgstr "" +"animals = ['mollusk',\n" +" 'albatross',\n" +" 'rat',\n" +" 'penguin',\n" +" 'python', ]\n" +"# ...\n" +"for a in animals:\n" +" print(a)" -msgid "Here, you want to mark the strings in the ``animals`` list as being translatable, but you don't actually want to translate them until they are printed." +msgid "" +"Here, you want to mark the strings in the ``animals`` list as being " +"translatable, but you don't actually want to translate them until they are " +"printed." msgstr "" +"در اینجا، شما می‌خواهید رشته‌های موجود در فهرست ``animals`` را به‌عنوان " +"قابل‌ترجمه علامت‌گذاری کنید، اما در واقع نمی‌خواهید آن‌ها را تا پیش از چاپ " +"ترجمه کنید." msgid "Here is one way you can handle this situation::" -msgstr "" +msgstr "در اینجا یک روش برای مدیریت این وضعیت آمده است::" msgid "" "def _(message): return message\n" @@ -411,15 +1002,43 @@ msgid "" "for a in animals:\n" " print(_(a))" msgstr "" +"def _(message): return message\n" +"\n" +"animals = [_('mollusk'),\n" +" _('albatross'),\n" +" _('rat'),\n" +" _('penguin'),\n" +" _('python'), ]\n" +"\n" +"del _\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" -msgid "This works because the dummy definition of :func:`!_` simply returns the string unchanged. And this dummy definition will temporarily override any definition of :func:`!_` in the built-in namespace (until the :keyword:`del` command). Take care, though if you have a previous definition of :func:`!_` in the local namespace." +msgid "" +"This works because the dummy definition of :func:`!_` simply returns the " +"string unchanged. And this dummy definition will temporarily override any " +"definition of :func:`!_` in the built-in namespace (until the :keyword:`del`" +" command). Take care, though if you have a previous definition of :func:`!_`" +" in the local namespace." msgstr "" +"این روش کار می‌کند، زیرا تعریف ساختگی :func:`!_` صرفاً رشته را بدون تغییر " +"برمی‌گرداند. و این تعریف ساختگی به‌طور موقت هر تعریفی از :func:`!_` در " +"فضای نام توکار را می‌پوشاند (تا دستور :keyword:`del`). البته اگر تعریف " +"پیشینی از :func:`!_` در فضای نام محلی دارید، مراقب باشید." -msgid "Note that the second use of :func:`!_` will not identify \"a\" as being translatable to the :program:`gettext` program, because the parameter is not a string literal." +msgid "" +"Note that the second use of :func:`!_` will not identify \"a\" as being " +"translatable to the :program:`gettext` program, because the parameter is not" +" a string literal." msgstr "" +"توجه داشته باشید که دومین استفاده از :func:`!_`، «a» را به‌عنوان قابل‌ترجمه " +"برای برنامه‌ی :program:`gettext` شناسایی نخواهد کرد، زیرا پارامتر یک رشته‌ی " +"لفظی نیست." msgid "Another way to handle this is with the following example::" -msgstr "" +msgstr "راه دیگر برای مدیریت این موضوع، استفاده از مثال زیر است::" msgid "" "def N_(message): return message\n" @@ -434,54 +1053,100 @@ msgid "" "for a in animals:\n" " print(_(a))" msgstr "" +"def N_(message): return message\n" +"\n" +"animals = [N_('mollusk'),\n" +" N_('albatross'),\n" +" N_('rat'),\n" +" N_('penguin'),\n" +" N_('python'), ]\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" -msgid "In this case, you are marking translatable strings with the function :func:`!N_`, which won't conflict with any definition of :func:`!_`. However, you will need to teach your message extraction program to look for translatable strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, ``pybabel extract``, and :program:`xpot` all support this through the use of the :option:`!-k` command-line switch. The choice of :func:`!N_` here is totally arbitrary; it could have just as easily been :func:`!MarkThisStringForTranslation`." -msgstr "" +msgid "" +"In this case, you are marking translatable strings with the function " +":func:`!N_`, which won't conflict with any definition of :func:`!_`. " +"However, you will need to teach your message extraction program to look for " +"translatable strings marked with :func:`!N_`. :program:`xgettext`, " +":program:`pygettext`, ``pybabel extract``, and :program:`xpot` all support " +"this through the use of the :option:`!-k` command-line switch. The choice of" +" :func:`!N_` here is totally arbitrary; it could have just as easily been " +":func:`!MarkThisStringForTranslation`." +msgstr "" +"در این حالت، شما رشته‌های ترجمه‌پذیر را با تابع :func:`!N_` علامت‌گذاری " +"می‌کنید، که با هیچ تعریفی از :func:`!_` تعارض نخواهد داشت. با این حال، باید " +"به برنامه استخراج پیام خود یاد بدهید که به دنبال رشته‌های ترجمه‌پذیری بگردد " +"که با :func:`!N_` علامت‌گذاری شده‌اند. :program:`xgettext`، " +":program:`pygettext`، ``pybabel extract`` و :program:`xpot` همگی این کار را " +"از طریق استفاده از سوئیچ خط فرمان :option:`!-k` پشتیبانی می‌کنند. انتخاب " +":func:`!N_` در اینجا کاملاً دلخواه است؛ می‌توانست به همین آسانی " +":func:`!MarkThisStringForTranslation` باشد." msgid "Acknowledgements" -msgstr "" +msgstr "قدردانی‌ها" -msgid "The following people contributed code, feedback, design suggestions, previous implementations, and valuable experience to the creation of this module:" +msgid "" +"The following people contributed code, feedback, design suggestions, " +"previous implementations, and valuable experience to the creation of this " +"module:" msgstr "" +"افراد زیر برای ایجاد این ماژول، کد، بازخورد، پیشنهادهای طراحی، " +"پیاده‌سازی‌های پیشین و تجربه ارزشمند ارائه کردند:" msgid "Peter Funk" -msgstr "" +msgstr "Peter Funk" msgid "James Henstridge" -msgstr "" +msgstr "James Henstridge" msgid "Juan David Ibáñez Palomar" -msgstr "" +msgstr "Juan David Ibáñez Palomar" msgid "Marc-André Lemburg" -msgstr "" +msgstr "Marc-André Lemburg" msgid "Martin von Löwis" -msgstr "" +msgstr "مارتین فون لوویس" msgid "François Pinard" -msgstr "" +msgstr "فرانسوا پینار" msgid "Barry Warsaw" -msgstr "" +msgstr "Barry Warsaw" msgid "Gustavo Niemeyer" -msgstr "" +msgstr "گوستاوو نیمایر" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "The default locale directory is system dependent; for example, on Red Hat Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`. The :mod:`!gettext` module does not try to support these system dependent defaults; instead its default is :file:`{sys.base_prefix}/share/locale` (see :data:`sys.base_prefix`). For this reason, it is always best to call :func:`bindtextdomain` with an explicit absolute path at the start of your application." -msgstr "" +msgid "" +"The default locale directory is system dependent; for example, on Red Hat " +"Linux it is :file:`/usr/share/locale`, but on Solaris it is " +":file:`/usr/lib/locale`. The :mod:`!gettext` module does not try to support " +"these system dependent defaults; instead its default is " +":file:`{sys.base_prefix}/share/locale` (see :data:`sys.base_prefix`). For " +"this reason, it is always best to call :func:`bindtextdomain` with an " +"explicit absolute path at the start of your application." +msgstr "" +"پوشه‌ی پیش‌فرض locale به سیستم وابسته است؛ برای مثال، در Red Hat Linux برابر " +":file:`/usr/share/locale` است، اما در Solaris برابر :file:`/usr/lib/locale` " +"است. ماژول :mod:`!gettext` تلاش نمی‌کند این پیش‌فرض‌های وابسته به سیستم را " +"پشتیبانی کند؛ در عوض، پیش‌فرض آن :file:`{sys.base_prefix}/share/locale` است " +"(به :data:`sys.base_prefix` مراجعه کنید). به همین دلیل، همیشه بهترین کار این" +" است که :func:`bindtextdomain` را در آغاز برنامه‌ی خود با یک مسیر مطلق صریح " +"فراخوانی کنید." msgid "See the footnote for :func:`bindtextdomain` above." -msgstr "" +msgstr "پانویس مربوط به :func:`bindtextdomain` را در بالا ببینید." msgid "_ (underscore)" -msgstr "" +msgstr "_ (زیرخط)" msgid "gettext" -msgstr "" +msgstr "gettext" msgid "GNOME" -msgstr "" +msgstr "GNOME" diff --git a/library/glob.po b/library/glob.po index 21cae6702..5f07a55b5 100644 --- a/library/glob.po +++ b/library/glob.po @@ -25,97 +25,238 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!glob` --- Unix style pathname pattern expansion" -msgstr "" +msgstr ":mod:`!glob` --- بسط الگوی مسیر به سبک یونیکس" msgid "**Source code:** :source:`Lib/glob.py`" -msgstr "" +msgstr ":source:`Lib/glob.py`" -msgid "The :mod:`!glob` module finds pathnames using pattern matching rules similar to the Unix shell. No tilde expansion is done, but ``*``, ``?``, and character ranges expressed with ``[]`` will be correctly matched. This is done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions in concert, and not by actually invoking a subshell." -msgstr "" +msgid "" +"The :mod:`!glob` module finds pathnames using pattern matching rules similar" +" to the Unix shell. No tilde expansion is done, but ``*``, ``?``, and " +"character ranges expressed with ``[]`` will be correctly matched. This is " +"done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " +"in concert, and not by actually invoking a subshell." +msgstr "" +"ماژول :mod:`!glob` نام‌مسیرها را با استفاده از قواعد تطبیق الگو مشابه پوسته‌ی" +" یونیکس پیدا می‌کند. هیچ بسط تیلدی (tilde expansion) انجام نمی‌شود، اما " +"``*``، ``?`` و بازه‌های نویسه‌ای بیان‌شده با ``[]`` به‌درستی تطبیق داده " +"می‌شوند. این کار با استفاده‌ی هماهنگ از توابع :func:`os.scandir` و " +":func:`fnmatch.fnmatch` انجام می‌شود، نه با فراخوانی واقعی یک زیرپوسته." -msgid "The pathnames are returned in no particular order. If you need a specific order, sort the results." +msgid "" +"The pathnames are returned in no particular order. If you need a specific " +"order, sort the results." msgstr "" +"مسیرها بدون ترتیب خاصی بازگردانده می‌شوند. اگر به ترتیب خاصی نیاز دارید، " +"نتایج را مرتب کنید." -msgid "By default, files beginning with a dot (``.``) can only be matched by patterns that also start with a dot, unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`. For tilde and shell variable expansion, use :func:`os.path.expanduser` and :func:`os.path.expandvars`." +msgid "" +"By default, files beginning with a dot (``.``) can only be matched by " +"patterns that also start with a dot, unlike :func:`fnmatch.fnmatch` or " +":func:`pathlib.Path.glob`. For tilde and shell variable expansion, use " +":func:`os.path.expanduser` and :func:`os.path.expandvars`." msgstr "" +"به‌طور پیش‌فرض، فایل‌هایی که با یک نقطه (``.``) شروع می‌شوند، فقط با " +"الگوهایی که آن‌ها نیز با یک نقطه شروع می‌شوند مطابقت داده می‌شوند، برخلاف " +":func:`fnmatch.fnmatch` یا :func:`pathlib.Path.glob`. برای بسط تیلدا و " +"متغیرهای پوسته، از :func:`os.path.expanduser` و :func:`os.path.expandvars` " +"استفاده کنید." -msgid "For a literal match, wrap the meta-characters in brackets. For example, ``'[?]'`` matches the character ``'?'``." +msgid "" +"For a literal match, wrap the meta-characters in brackets. For example, " +"``'[?]'`` matches the character ``'?'``." msgstr "" +"برای تطبیق به‌صورت لفظی، فرانویسه‌ها را در کروشه قرار دهید. برای مثال، " +"``'[?]'`` با نویسه‌ی ``'?'`` مطابقت می‌کند." msgid "The :mod:`!glob` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!glob` توابع زیر را تعریف می‌کند:" -msgid "Return a possibly empty list of path names that match *pathname*, which must be a string containing a path specification. *pathname* can be either absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like :file:`../../Tools/\\*/\\*.gif`), and can contain shell-style wildcards. Broken symlinks are included in the results (as in the shell). Whether or not the results are sorted depends on the file system. If a file that satisfies conditions is removed or added during the call of this function, whether a path name for that file will be included is unspecified." -msgstr "" +msgid "" +"Return a possibly empty list of path names that match *pathname*, which must" +" be a string containing a path specification. *pathname* can be either " +"absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like " +":file:`../../Tools/\\*/\\*.gif`), and can contain shell-style wildcards. " +"Broken symlinks are included in the results (as in the shell). Whether or " +"not the results are sorted depends on the file system. If a file that " +"satisfies conditions is removed or added during the call of this function, " +"whether a path name for that file will be included is unspecified." +msgstr "" +"فهرستی از نام‌های مسیر منطبق با *pathname* برمی‌گرداند که ممکن است خالی " +"باشد. *pathname* باید رشته‌ای حاوی مشخصات مسیر باشد. *pathname* می‌تواند " +"مطلق (مانند :file:`/usr/src/Python-1.5/Makefile`) یا نسبی (مانند " +":file:`../../Tools/\\*/\\*.gif`) باشد و می‌تواند حاوی وایلدکارد به سبک " +"پوسته باشد. پیوندهای نمادین شکسته در نتایج گنجانده می‌شوند (مانند پوسته). " +"مرتب بودن یا نبودن نتایج به سامانه‌ی فایل بستگی دارد. اگر فایلی که شرایط را " +"برآورده می‌کند در حین فراخوانی این تابع حذف یا اضافه شود، نامشخص است که نام " +"مسیری برای آن فایل گنجانده خواهد شد یا نه." -msgid "If *root_dir* is not ``None``, it should be a :term:`path-like object` specifying the root directory for searching. It has the same effect on :func:`!glob` as changing the current directory before calling it. If *pathname* is relative, the result will contain paths relative to *root_dir*." +msgid "" +"If *root_dir* is not ``None``, it should be a :term:`path-like object` " +"specifying the root directory for searching. It has the same effect on " +":func:`!glob` as changing the current directory before calling it. If " +"*pathname* is relative, the result will contain paths relative to " +"*root_dir*." msgstr "" +"اگر *root_dir* برابر ``None`` نباشد، باید یک :term:`path-like object` باشد " +"که پوشه ریشه را برای جست‌وجو مشخص می‌کند. تأثیر آن بر :func:`!glob` همانند " +"تغییر پوشه جاری پیش از فراخوانی آن است. اگر *pathname* نسبی باشد، نتیجه شامل" +" مسیرهایی خواهد بود که نسبت به *root_dir* نسبی هستند." -msgid "This function can support :ref:`paths relative to directory descriptors ` with the *dir_fd* parameter." +msgid "" +"This function can support :ref:`paths relative to directory descriptors " +"` with the *dir_fd* parameter." msgstr "" +"این تابع می‌تواند با پارامتر *dir_fd* از :ref:`مسیرهای نسبی نسبت به " +"توصیف‌گرهای پوشه ` پشتیبانی کند." -msgid "If *recursive* is true, the pattern \"``**``\" will match any files and zero or more directories, subdirectories and symbolic links to directories. If the pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not match." +msgid "" +"If *recursive* is true, the pattern \"``**``\" will match any files and zero" +" or more directories, subdirectories and symbolic links to directories. If " +"the pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files" +" will not match." msgstr "" +"اگر *recursive* درست باشد، الگوی «``**``» با هر فایلی و صفر یا چند پوشه، " +"زیرپوشه و پیوند نمادین به پوشه‌ها مطابقت خواهد کرد. اگر پس از الگو " +":data:`os.sep` یا :data:`os.altsep` بیاید، فایل‌ها مطابقت نخواهند کرد." -msgid "If *include_hidden* is true, wildcards can match path segments that begin with a dot (``.``)." +msgid "" +"If *include_hidden* is true, wildcards can match path segments that begin " +"with a dot (``.``)." msgstr "" +"اگر *include_hidden* درست باشد، وایلدکارد می‌توانند با بخش‌هایی از مسیر " +"که با نقطه (``.``) شروع می‌شوند، مطابقت کنند." -msgid "Raises an :ref:`auditing event ` ``glob.glob`` with arguments ``pathname``, ``recursive``." +msgid "" +"Raises an :ref:`auditing event ` ``glob.glob`` with arguments " +"``pathname``, ``recursive``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``glob.glob`` را با آرگومان‌های " +"``pathname`` و ``recursive`` پرتاب می‌کند." -msgid "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments ``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." +msgid "" +"Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " +"``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``glob.glob/2`` را با آرگومان‌های " +"``pathname``، ``recursive``، ``root_dir`` و ``dir_fd`` پرتاب می‌کند." -msgid "Using the \"``**``\" pattern in large directory trees may consume an inordinate amount of time." +msgid "" +"Using the \"``**``\" pattern in large directory trees may consume an " +"inordinate amount of time." msgstr "" +"استفاده از الگوی \"``**``\" در درخت‌های پوشه‌ای بزرگ ممکن است زمان بسیار " +"زیادی را مصرف کند." -msgid "This function may return duplicate path names if *pathname* contains multiple \"``**``\" patterns and *recursive* is true." +msgid "" +"This function may return duplicate path names if *pathname* contains " +"multiple \"``**``\" patterns and *recursive* is true." msgstr "" +"این تابع ممکن است نام مسیرهای تکراری را برگرداند، اگر *pathname* شامل چندین" +" الگوی \"``**``\" باشد و *recursive* برابر true باشد." -msgid "Any :exc:`OSError` exceptions raised from scanning the filesystem are suppressed. This includes :exc:`PermissionError` when accessing directories without read permission." +msgid "" +"Any :exc:`OSError` exceptions raised from scanning the filesystem are " +"suppressed. This includes :exc:`PermissionError` when accessing directories " +"without read permission." msgstr "" +"هر استثنای :exc:`OSError` که در اثر پویش سیستم‌فایل پرتاب شود، سرکوب می‌شود." +" این شامل :exc:`PermissionError` هنگام دسترسی به پوشه‌های بدون مجوز خواندن " +"نیز می‌شود." msgid "Support for recursive globs using \"``**``\"." -msgstr "" +msgstr "پشتیبانی از گلوب‌های بازگشتی (recursive globs) با استفاده از \"``**``\"." msgid "Added the *root_dir* and *dir_fd* parameters." -msgstr "" +msgstr "پارامترهای *root_dir* و *dir_fd* افزوده شدند." msgid "Added the *include_hidden* parameter." -msgstr "" +msgstr "پارامتر *include_hidden* اضافه شد." -msgid "Return an :term:`iterator` which yields the same values as :func:`glob` without actually storing them all simultaneously." +msgid "" +"Return an :term:`iterator` which yields the same values as :func:`glob` " +"without actually storing them all simultaneously." msgstr "" +"یک :term:`iterator` برمی‌گرداند که همان مقادیر را مانند :func:`glob` تولید " +"می‌کند، بدون آنکه همه‌ی آن‌ها را به‌طور همزمان ذخیره کند." -msgid "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful if you want to match an arbitrary literal string that may have special characters in it. Special characters in drive/UNC sharepoints are not escaped, for example on Windows ``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``." -msgstr "" +msgid "" +"Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful" +" if you want to match an arbitrary literal string that may have special " +"characters in it. Special characters in drive/UNC sharepoints are not " +"escaped, for example on Windows ``escape('//?/c:/Quo vadis?.txt')`` returns " +"``'//?/c:/Quo vadis[?].txt'``." +msgstr "" +"تمام نویسه‌های خاص (``'?'``، ``'*'`` و ``'['``) را خنثی می‌کند. این کار " +"زمانی مفید است که بخواهید یک رشته‌ی تحت‌اللفظی دلخواه را که ممکن است حاوی " +"نویسه‌های خاص باشد، تطبیق دهید. نویسه‌های خاص در نقاط اشتراک‌گذاری درایو/UNC" +" خنثی نمی‌شوند. برای مثال در ویندوز، ``escape('//?/c:/Quo vadis?.txt')`` " +"``'//?/c:/Quo vadis[?].txt'`` را برمی‌گرداند." -msgid "Convert the given path specification to a regular expression for use with :func:`re.match`. The path specification can contain shell-style wildcards." +msgid "" +"Convert the given path specification to a regular expression for use with " +":func:`re.match`. The path specification can contain shell-style wildcards." msgstr "" +"مشخصه مسیر داده‌شده را به یک عبارت باقاعده برای استفاده با :func:`re.match` " +"تبدیل می‌کند. مشخصه مسیر می‌تواند شامل وایلدکارد به‌سبک پوسته باشد." msgid "For example:" -msgstr "" +msgstr "برای مثال:" -msgid "Path separators and segments are meaningful to this function, unlike :func:`fnmatch.translate`. By default wildcards do not match path separators, and ``*`` pattern segments match precisely one path segment." +msgid "" +"Path separators and segments are meaningful to this function, unlike " +":func:`fnmatch.translate`. By default wildcards do not match path " +"separators, and ``*`` pattern segments match precisely one path segment." msgstr "" +"جداکننده‌ها و بخش‌های مسیر برای این تابع معنادار هستند، برخلاف " +":func:`fnmatch.translate`. به‌طور پیش‌فرض، وایلدکارد با جداکننده‌های " +"مسیر مطابقت نمی‌کنند، و بخش‌های الگوی ``*`` دقیقاً با یک بخش مسیر مطابقت " +"می‌کنند." -msgid "If *recursive* is true, the pattern segment \"``**``\" will match any number of path segments." +msgid "" +"If *recursive* is true, the pattern segment \"``**``\" will match any number" +" of path segments." msgstr "" +"اگر *recursive* درست باشد، بخش الگو «``**``» با هر تعداد بخش مسیر مطابقت " +"می‌کند." -msgid "If *include_hidden* is true, wildcards can match path segments that start with a dot (``.``)." +msgid "" +"If *include_hidden* is true, wildcards can match path segments that start " +"with a dot (``.``)." msgstr "" +"اگر *include_hidden* true باشد، وایلدکارد می‌توانند با بخش‌هایی از مسیر " +"که با نقطه (``.``) آغاز می‌شوند، مطابقت کنند." -msgid "A sequence of path separators may be supplied to the *seps* argument. If not given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." +msgid "" +"A sequence of path separators may be supplied to the *seps* argument. If not" +" given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." msgstr "" +"می‌توان دنباله‌ای از جداکننده‌های مسیر را به آرگومان *seps* ارائه کرد. اگر " +"داده نشود، از :data:`os.sep` و :data:`~os.altsep` (در صورت موجود بودن) " +"استفاده می‌شود." -msgid ":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, which call this function to implement pattern matching and globbing." +msgid "" +":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, " +"which call this function to implement pattern matching and globbing." msgstr "" +"متدهای :meth:`pathlib.PurePath.full_match` و :meth:`pathlib.Path.glob`، که " +"این تابع را برای پیاده‌سازی تطبیق الگو و بسط الگو (globbing) فراخوانی " +"می‌کنند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "Consider a directory containing the following files: :file:`1.gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only the file :file:`3.txt`. :func:`glob` will produce the following results. Notice how any leading components of the path are preserved. ::" +msgid "" +"Consider a directory containing the following files: :file:`1.gif`, " +":file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` which " +"contains only the file :file:`3.txt`. :func:`glob` will produce the " +"following results. Notice how any leading components of the path are " +"preserved. ::" msgstr "" +"پوشه‌ای را در نظر بگیرید که شامل فایل‌های زیر است: :file:`1.gif`، " +":file:`2.txt`، :file:`card.gif` و یک زیرپوشه :file:`sub` که فقط شامل فایل " +":file:`3.txt` است. :func:`glob` نتایج زیر را تولید خواهد کرد. توجه کنید که " +"چگونه اجزای ابتدایی مسیر حفظ می‌شوند. ::" msgid "" ">>> import glob\n" @@ -130,9 +271,26 @@ msgid "" ">>> glob.glob('./**/', recursive=True)\n" "['./', './sub/']" msgstr "" +">>> import glob\n" +">>> glob.glob('./[0-9].*')\n" +"['./1.gif', './2.txt']\n" +">>> glob.glob('*.gif')\n" +"['1.gif', 'card.gif']\n" +">>> glob.glob('?.gif')\n" +"['1.gif']\n" +">>> glob.glob('**/*.txt', recursive=True)\n" +"['2.txt', 'sub/3.txt']\n" +">>> glob.glob('./**/', recursive=True)\n" +"['./', './sub/']" -msgid "If the directory contains files starting with ``.`` they won't be matched by default. For example, consider a directory containing :file:`card.gif` and :file:`.card.gif`::" +msgid "" +"If the directory contains files starting with ``.`` they won't be matched by" +" default. For example, consider a directory containing :file:`card.gif` and " +":file:`.card.gif`::" msgstr "" +"اگر پوشه حاوی فایل‌هایی باشد که با ``.`` شروع می‌شوند، به‌طور پیش‌فرض تطبیق " +"داده نمی‌شوند. برای مثال، پوشه‌ای را در نظر بگیرید که حاوی :file:`card.gif` " +"و :file:`.card.gif` است::" msgid "" ">>> import glob\n" @@ -141,39 +299,46 @@ msgid "" ">>> glob.glob('.c*')\n" "['.card.gif']" msgstr "" +">>> import glob\n" +">>> glob.glob('*.gif')\n" +"['card.gif']\n" +">>> glob.glob('.c*')\n" +"['.card.gif']" -msgid "The :mod:`fnmatch` module offers shell-style filename (not path) expansion." +msgid "" +"The :mod:`fnmatch` module offers shell-style filename (not path) expansion." msgstr "" +"ماژول :mod:`fnmatch` بسط نام فایل (نه مسیر) به‌سبک پوسته را ارائه می‌دهد." msgid "The :mod:`pathlib` module offers high-level path objects." -msgstr "" +msgstr "ماژول :mod:`pathlib` اشیای مسیر سطح بالا را ارائه می‌دهد." msgid "filenames" -msgstr "" +msgstr "نام فایل‌ها" msgid "pathname expansion" -msgstr "" +msgstr "بسط مسیر فایل" msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" msgid "in glob-style wildcards" -msgstr "" +msgstr "در وایلدکاردهای به‌سبک glob" msgid "? (question mark)" -msgstr "" +msgstr "? (علامت پرسش)" msgid "[] (square brackets)" -msgstr "" +msgstr "[] (کروشه‌های مربع)" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" msgid "- (minus)" -msgstr "" +msgstr "- (منها)" msgid ". (dot)" -msgstr "" +msgstr ". (نقطه)" msgid "**" -msgstr "" +msgstr "**" diff --git a/library/graphlib.po b/library/graphlib.po index 1c72571f6..47dd4fa2c 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -23,38 +23,89 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -msgid ":mod:`!graphlib` --- Functionality to operate with graph-like structures" -msgstr "" +msgid "" +":mod:`!graphlib` --- Functionality to operate with graph-like structures" +msgstr ":mod:`!graphlib` --- قابلیت کار با ساختارهای گراف‌مانند" msgid "**Source code:** :source:`Lib/graphlib.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/graphlib.py`" -msgid "Provides functionality to topologically sort a graph of :term:`hashable` nodes." +msgid "" +"Provides functionality to topologically sort a graph of :term:`hashable` " +"nodes." msgstr "" +"امکان مرتب‌سازی توپولوژیک گرافی از گره‌های :term:`هش‌پذیر ` را " +"فراهم می‌کند." -msgid "A topological order is a linear ordering of the vertices in a graph such that for every directed edge u -> v from vertex u to vertex v, vertex u comes before vertex v in the ordering. For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; in this example, a topological ordering is just a valid sequence for the tasks. A complete topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph." -msgstr "" +msgid "" +"A topological order is a linear ordering of the vertices in a graph such " +"that for every directed edge u -> v from vertex u to vertex v, vertex u " +"comes before vertex v in the ordering. For instance, the vertices of the " +"graph may represent tasks to be performed, and the edges may represent " +"constraints that one task must be performed before another; in this example," +" a topological ordering is just a valid sequence for the tasks. A complete " +"topological ordering is possible if and only if the graph has no directed " +"cycles, that is, if it is a directed acyclic graph." +msgstr "" +"یک ترتیب توپولوژیک، یک ترتیب خطی از رأس‌های یک گراف است، به‌گونه‌ای که برای " +"هر یال جهت‌دار u -> v از رأس u به رأس v، رأس u در آن ترتیب پیش از رأس v " +"می‌آید. برای نمونه، رأس‌های گراف ممکن است نشان‌دهنده‌ی تسک‌هایی باشند که باید " +"انجام شوند، و یال‌ها ممکن است نشان‌دهنده‌ی قیدهایی باشند که بر اساس آن‌ها یک " +"وظیفه باید پیش از وظیفه‌ی دیگر انجام شود؛ در این مثال، یک ترتیب توپولوژیک " +"صرفاً یک دنباله‌ی معتبر برای وظایف است. یک ترتیب توپولوژیک کامل ممکن است اگر " +"و تنها اگر گراف هیچ دور جهت‌داری نداشته باشد، یعنی اگر آن گراف یک گراف " +"جهت‌دار بدون دور باشد." -msgid "If the optional *graph* argument is provided it must be a dictionary representing a directed acyclic graph where the keys are nodes and the values are iterables of all predecessors of that node in the graph (the nodes that have edges that point to the value in the key). Additional nodes can be added to the graph using the :meth:`~TopologicalSorter.add` method." -msgstr "" +msgid "" +"If the optional *graph* argument is provided it must be a dictionary " +"representing a directed acyclic graph where the keys are nodes and the " +"values are iterables of all predecessors of that node in the graph (the " +"nodes that have edges that point to the value in the key). Additional nodes " +"can be added to the graph using the :meth:`~TopologicalSorter.add` method." +msgstr "" +"اگر آرگومان اختیاری *graph* ارائه شود، باید یک دیکشنری باشد که یک گراف " +"جهت‌دار بدون دور را نشان می‌دهد؛ به‌طوری که کلیدها گره‌ها هستند و مقادیر، " +"پیمایش‌پذیرهایی از تمام پیشینیان آن گره در گراف هستند (گره‌هایی که یال‌هایی " +"دارند که به مقدار کلید اشاره می‌کنند). می‌توان گره‌های بیشتری را با استفاده " +"از متد :meth:`~TopologicalSorter.add` به گراف اضافه کرد." -msgid "In the general case, the steps required to perform the sorting of a given graph are as follows:" +msgid "" +"In the general case, the steps required to perform the sorting of a given " +"graph are as follows:" msgstr "" +"در حالت کلی، مراحل مورد نیاز برای انجام مرتب‌سازی یک گراف داده‌شده به شرح " +"زیر است:" -msgid "Create an instance of the :class:`TopologicalSorter` with an optional initial graph." +msgid "" +"Create an instance of the :class:`TopologicalSorter` with an optional " +"initial graph." msgstr "" +"یک نمونه از :class:`TopologicalSorter` با یک گراف اولیه اختیاری ایجاد کنید." msgid "Add additional nodes to the graph." -msgstr "" +msgstr "گره‌های بیشتری به گراف اضافه کنید." msgid "Call :meth:`~TopologicalSorter.prepare` on the graph." -msgstr "" +msgstr ":meth:`~TopologicalSorter.prepare` را روی گراف فراخوانی کنید." -msgid "While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. Call :meth:`~TopologicalSorter.done` on each node as it finishes processing." +msgid "" +"While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the " +"nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. " +"Call :meth:`~TopologicalSorter.done` on each node as it finishes processing." msgstr "" +"تا زمانی که :meth:`~TopologicalSorter.is_active` برابر ``True`` است، گره‌های" +" بازگردانده‌شده توسط :meth:`~TopologicalSorter.get_ready` را پیمایش کنید و " +"آن‌ها را پردازش کنید. پس از پایان پردازش هر گره، " +":meth:`~TopologicalSorter.done` را برای آن فراخوانی کنید." -msgid "In case just an immediate sorting of the nodes in the graph is required and no parallelism is involved, the convenience method :meth:`TopologicalSorter.static_order` can be used directly:" +msgid "" +"In case just an immediate sorting of the nodes in the graph is required and " +"no parallelism is involved, the convenience method " +":meth:`TopologicalSorter.static_order` can be used directly:" msgstr "" +"در صورتی که تنها مرتب‌سازی فوری گره‌های گراف لازم باشد و موازی‌سازی در کار " +"نباشد، می‌توان مستقیماً از متد کمکی :meth:`TopologicalSorter.static_order` " +"استفاده کرد:" msgid "" ">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" @@ -62,9 +113,17 @@ msgid "" ">>> tuple(ts.static_order())\n" "('A', 'C', 'B', 'D')" msgstr "" +">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" +">>> ts = TopologicalSorter(graph)\n" +">>> tuple(ts.static_order())\n" +"('A', 'C', 'B', 'D')" -msgid "The class is designed to easily support parallel processing of the nodes as they become ready. For instance::" +msgid "" +"The class is designed to easily support parallel processing of the nodes as " +"they become ready. For instance::" msgstr "" +"این کلاس به‌گونه‌ای طراحی شده است که به‌راحتی از پردازش موازی گره‌ها به‌محض " +"آماده شدن آن‌ها پشتیبانی کند. برای مثال::" msgid "" "topological_sorter = TopologicalSorter()\n" @@ -89,61 +148,181 @@ msgid "" " node = finalized_tasks_queue.get()\n" " topological_sorter.done(node)" msgstr "" +"topological_sorter = TopologicalSorter()\n" +"\n" +"# گره‌ها را به 'topological_sorter' اضافه کنید...\n" +"\n" +"topological_sorter.prepare()\n" +"while topological_sorter.is_active():\n" +" for node in topological_sorter.get_ready():\n" +" # نخ‌های کارگر یا فرآیندها گره‌ها را برای کار از صف\n" +" # 'task_queue' برمی‌دارند.\n" +" task_queue.put(node)\n" +"\n" +" # هنگامی که کار یک گره انجام شد، کارگرها گره را در\n" +" # 'finalized_tasks_queue' قرار می‌دهند تا بتوانیم گره‌های بیشتری برای کار دریافت کنیم.\n" +" # تعریف 'is_active()' تضمین می‌کند که در این نقطه، دست‌کم یک گره\n" +" # در 'task_queue' قرار گرفته باشد که هنوز به 'done()' داده نشده است،\n" +" # بنابراین این 'get()' مسدودکننده باید (سرانجام) موفق شود.\n" +" # پس از فراخوانی 'done()'، برای فراخوانی 'get_ready()' دوباره به حلقه بازمی‌گردیم،\n" +" # بنابراین گره‌های تازه آزادشده را در 'task_queue' قرار می‌دهیم،\n" +" # به‌محض این‌که از نظر منطقی ممکن باشد.\n" +" node = finalized_tasks_queue.get()\n" +" topological_sorter.done(node)" -msgid "Add a new node and its predecessors to the graph. Both the *node* and all elements in *predecessors* must be :term:`hashable`." +msgid "" +"Add a new node and its predecessors to the graph. Both the *node* and all " +"elements in *predecessors* must be :term:`hashable`." msgstr "" +"یک گره جدید و پیش‌نیازهای آن را به گراف اضافه کنید. هم *node* و هم همه‌ی " +"عناصر موجود در *predecessors* باید :term:`hashable` باشند." -msgid "If called multiple times with the same node argument, the set of dependencies will be the union of all dependencies passed in." +msgid "" +"If called multiple times with the same node argument, the set of " +"dependencies will be the union of all dependencies passed in." msgstr "" +"اگر چندین بار با همان آرگومان گره فراخوانی شود، مجموعه وابستگی‌ها اجتماع " +"تمام وابستگی‌های ارسال‌شده خواهد بود." -msgid "It is possible to add a node with no dependencies (*predecessors* is not provided) or to provide a dependency twice. If a node that has not been provided before is included among *predecessors* it will be automatically added to the graph with no predecessors of its own." +msgid "" +"It is possible to add a node with no dependencies (*predecessors* is not " +"provided) or to provide a dependency twice. If a node that has not been " +"provided before is included among *predecessors* it will be automatically " +"added to the graph with no predecessors of its own." msgstr "" +"می‌توانید گره‌ای بدون وابستگی اضافه کنید (وقتی *predecessors* ارائه نشده " +"باشد) یا یک وابستگی را دو بار ارائه کنید. اگر گره‌ای که پیش‌تر ارائه نشده " +"است جزو *predecessors* باشد، به‌طور خودکار به گراف اضافه می‌شود، بدون این‌که" +" پیش‌نیازی از خود داشته باشد." -msgid "Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`." +msgid "" +"Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`." msgstr "" +"در صورت فراخوانی پس از :meth:`~TopologicalSorter.prepare`، استثنای " +":exc:`ValueError` را پرتاب می‌کند." -msgid "Mark the graph as finished and check for cycles in the graph. If any cycle is detected, :exc:`CycleError` will be raised, but :meth:`~TopologicalSorter.get_ready` can still be used to obtain as many nodes as possible until cycles block more progress. After a call to this function, the graph cannot be modified, and therefore no more nodes can be added using :meth:`~TopologicalSorter.add`." -msgstr "" +msgid "" +"Mark the graph as finished and check for cycles in the graph. If any cycle " +"is detected, :exc:`CycleError` will be raised, but " +":meth:`~TopologicalSorter.get_ready` can still be used to obtain as many " +"nodes as possible until cycles block more progress. After a call to this " +"function, the graph cannot be modified, and therefore no more nodes can be " +"added using :meth:`~TopologicalSorter.add`." +msgstr "" +"گراف را به‌عنوان پایان‌یافته علامت‌گذاری می‌کند و وجود دورها را در گراف " +"بررسی می‌کند. اگر هرگونه دوری تشخیص داده شود، :exc:`CycleError` پرتاب خواهد " +"شد، اما همچنان می‌توان از :meth:`~TopologicalSorter.get_ready` برای دریافت " +"تا حد ممکن از گره‌ها استفاده کرد، تا زمانی که دورها مانع پیشرفت بیشتر شوند. " +"پس از فراخوانی این تابع، گراف قابل تغییر نیست و بنابراین دیگر نمی‌توان " +"گره‌های بیشتری را با استفاده از :meth:`~TopologicalSorter.add` اضافه کرد." -msgid "A :exc:`ValueError` will be raised if the sort has been started by :meth:`~.static_order` or :meth:`~.get_ready`." +msgid "" +"A :exc:`ValueError` will be raised if the sort has been started by " +":meth:`~.static_order` or :meth:`~.get_ready`." msgstr "" +"اگر مرتب‌سازی توسط :meth:`~.static_order` یا :meth:`~.get_ready` آغاز شده " +"باشد، یک :exc:`ValueError` پرتاب خواهد شد." -msgid "``prepare()`` can now be called more than once as long as the sort has not started. Previously this raised :exc:`ValueError`." +msgid "" +"``prepare()`` can now be called more than once as long as the sort has not " +"started. Previously this raised :exc:`ValueError`." msgstr "" +"اکنون تا زمانی که مرتب‌سازی آغاز نشده باشد، می‌توان ``prepare()`` را بیش از " +"یک بار فراخوانی کرد. پیش از این، این کار :exc:`ValueError` را پرتاب می‌کرد." -msgid "Returns ``True`` if more progress can be made and ``False`` otherwise. Progress can be made if cycles do not block the resolution and either there are still nodes ready that haven't yet been returned by :meth:`TopologicalSorter.get_ready` or the number of nodes marked :meth:`TopologicalSorter.done` is less than the number that have been returned by :meth:`TopologicalSorter.get_ready`." -msgstr "" +msgid "" +"Returns ``True`` if more progress can be made and ``False`` otherwise. " +"Progress can be made if cycles do not block the resolution and either there " +"are still nodes ready that haven't yet been returned by " +":meth:`TopologicalSorter.get_ready` or the number of nodes marked " +":meth:`TopologicalSorter.done` is less than the number that have been " +"returned by :meth:`TopologicalSorter.get_ready`." +msgstr "" +"در صورت امکان پیشرفت بیشتر، ``True`` و در غیر این صورت ``False`` " +"برمی‌گرداند. پیشرفت در صورتی می‌تواند انجام شود که چرخه‌ها مانع از حل نشوند " +"و یکی از دو شرط زیر برقرار باشد: هنوز گره‌های آماده‌ای وجود داشته باشند که " +":meth:`TopologicalSorter.get_ready` آن‌ها را برنگردانده است، یا تعداد " +"گره‌های علامت‌گذاری‌شده با :meth:`TopologicalSorter.done` کمتر از تعداد " +"گره‌هایی باشد که :meth:`TopologicalSorter.get_ready` آن‌ها را برگردانده است." -msgid "The :meth:`~object.__bool__` method of this class defers to this function, so instead of::" +msgid "" +"The :meth:`~object.__bool__` method of this class defers to this function, " +"so instead of::" msgstr "" +"متد :meth:`~object.__bool__` این کلاس به این تابع ارجاع می‌دهد، بنابراین " +"به‌جای::" msgid "" "if ts.is_active():\n" " ..." msgstr "" +"if ts.is_active():\n" +" ..." msgid "it is possible to simply do::" -msgstr "" +msgstr "می‌توانید به‌سادگی این کار را انجام دهید::" msgid "" "if ts:\n" " ..." msgstr "" +"if ts:\n" +" ..." -msgid "Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter.prepare` previously." +msgid "" +"Raises :exc:`ValueError` if called without calling " +":meth:`~TopologicalSorter.prepare` previously." msgstr "" +"اگر بدون فراخوانی پیشین :meth:`~TopologicalSorter.prepare` فراخوانی شود، یک " +":exc:`ValueError` پرتاب می‌کند." -msgid "Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as processed, unblocking any successor of each node in *nodes* for being returned in the future by a call to :meth:`TopologicalSorter.get_ready`." +msgid "" +"Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as " +"processed, unblocking any successor of each node in *nodes* for being " +"returned in the future by a call to :meth:`TopologicalSorter.get_ready`." msgstr "" +"مجموعه‌ای از گره‌های بازگشت‌داده‌شده از :meth:`TopologicalSorter.get_ready` " +"را به‌عنوان پردازش‌شده علامت‌گذاری می‌کند و هر جانشینی از هر گره در *nodes* " +"را برای بازگشت در آینده با فراخوانی :meth:`TopologicalSorter.get_ready` از " +"حالت مسدود خارج می‌کند." -msgid "Raises :exc:`ValueError` if any node in *nodes* has already been marked as processed by a previous call to this method or if a node was not added to the graph by using :meth:`TopologicalSorter.add`, if called without calling :meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :meth:`~TopologicalSorter.get_ready`." -msgstr "" +msgid "" +"Raises :exc:`ValueError` if any node in *nodes* has already been marked as " +"processed by a previous call to this method or if a node was not added to " +"the graph by using :meth:`TopologicalSorter.add`, if called without calling " +":meth:`~TopologicalSorter.prepare` or if node has not yet been returned by " +":meth:`~TopologicalSorter.get_ready`." +msgstr "" +"اگر هر یک از گره‌های *nodes* از پیش با فراخوانی پیشین این متد به‌عنوان " +"پردازش‌شده علامت‌گذاری شده باشد، یا اگر گره‌ای با استفاده از " +":meth:`TopologicalSorter.add` به گراف اضافه نشده باشد، یا اگر این متد بدون " +"فراخوانی :meth:`~TopologicalSorter.prepare` فراخوانی شود، یا اگر گره هنوز " +"توسط :meth:`~TopologicalSorter.get_ready` برگردانده نشده باشد، " +":exc:`ValueError` پرتاب می‌شود." -msgid "Returns a ``tuple`` with all the nodes that are ready. Initially it returns all nodes with no predecessors, and once those are marked as processed by calling :meth:`TopologicalSorter.done`, further calls will return all new nodes that have all their predecessors already processed. Once no more progress can be made, empty tuples are returned." -msgstr "" +msgid "" +"Returns a ``tuple`` with all the nodes that are ready. Initially it returns " +"all nodes with no predecessors, and once those are marked as processed by " +"calling :meth:`TopologicalSorter.done`, further calls will return all new " +"nodes that have all their predecessors already processed. Once no more " +"progress can be made, empty tuples are returned." +msgstr "" +"یک ``tuple`` شامل همه گره‌های آماده را برمی‌گرداند. در ابتدا، همه گره‌های " +"بدون پیش‌نیاز را برمی‌گرداند و پس از این‌که آن‌ها با فراخوانی " +":meth:`TopologicalSorter.done` به‌عنوان پردازش‌شده علامت‌گذاری شدند، " +"فراخوانی‌های بعدی تمام گره‌های جدیدی را برمی‌گردانند که همه پیش‌نیازهایشان " +"از قبل پردازش شده‌اند. هنگامی که دیگر پیشرفتی امکان‌پذیر نباشد، تاپل‌های " +"خالی برگردانده می‌شوند." -msgid "Returns an iterator object which will iterate over nodes in a topological order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:`~TopologicalSorter.done` should not be called. This method is equivalent to::" +msgid "" +"Returns an iterator object which will iterate over nodes in a topological " +"order. When using this method, :meth:`~TopologicalSorter.prepare` and " +":meth:`~TopologicalSorter.done` should not be called. This method is " +"equivalent to::" msgstr "" +"یک شیء پیمایش‌گر برمی‌گرداند که گره‌ها را به ترتیب توپولوژیک پیمایش می‌کند. " +"هنگام استفاده از این متد، نباید :meth:`~TopologicalSorter.prepare` و " +":meth:`~TopologicalSorter.done` فراخوانی شوند. این متد معادل است با::" msgid "" "def static_order(self):\n" @@ -153,9 +332,19 @@ msgid "" " yield from node_group\n" " self.done(*node_group)" msgstr "" +"def static_order(self):\n" +" self.prepare()\n" +" while self.is_active():\n" +" node_group = self.get_ready()\n" +" yield from node_group\n" +" self.done(*node_group)" -msgid "The particular order that is returned may depend on the specific order in which the items were inserted in the graph. For example:" +msgid "" +"The particular order that is returned may depend on the specific order in " +"which the items were inserted in the graph. For example:" msgstr "" +"ترتیب خاصی که برگردانده می‌شود، ممکن است به ترتیب خاصی که آیتم‌ها در گراف " +"درج شده‌اند بستگی داشته باشد. برای مثال:" msgid "" ">>> ts = TopologicalSorter()\n" @@ -170,21 +359,54 @@ msgid "" ">>> print([*ts2.static_order()])\n" "[0, 2, 1, 3]" msgstr "" +">>> ts = TopologicalSorter()\n" +">>> ts.add(3, 2, 1)\n" +">>> ts.add(1, 0)\n" +">>> print([*ts.static_order()])\n" +"[2, 0, 1, 3]\n" +"\n" +">>> ts2 = TopologicalSorter()\n" +">>> ts2.add(1, 0)\n" +">>> ts2.add(3, 2, 1)\n" +">>> print([*ts2.static_order()])\n" +"[0, 2, 1, 3]" -msgid "This is due to the fact that \"0\" and \"2\" are in the same level in the graph (they would have been returned in the same call to :meth:`~TopologicalSorter.get_ready`) and the order between them is determined by the order of insertion." +msgid "" +"This is due to the fact that \"0\" and \"2\" are in the same level in the " +"graph (they would have been returned in the same call to " +":meth:`~TopologicalSorter.get_ready`) and the order between them is " +"determined by the order of insertion." msgstr "" +"این به این دلیل است که \"0\" و \"2\" در سطح یکسانی از گراف قرار دارند (آن‌ها" +" در یک فراخوانی مشترک به :meth:`~TopologicalSorter.get_ready` برگردانده " +"می‌شدند) و ترتیب میان آن‌ها بر اساس ترتیب درج تعیین می‌شود." msgid "If any cycle is detected, :exc:`CycleError` will be raised." -msgstr "" +msgstr "اگر چرخه‌ای تشخیص داده شود، :exc:`CycleError` پرتاب خواهد شد." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "The :mod:`!graphlib` module defines the following exception classes:" -msgstr "" +msgstr "ماژول :mod:`!graphlib` کلاس‌های استثنای زیر را تعریف می‌کند:" -msgid "Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if cycles exist in the working graph. If multiple cycles exist, only one undefined choice among them will be reported and included in the exception." +msgid "" +"Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if" +" cycles exist in the working graph. If multiple cycles exist, only one " +"undefined choice among them will be reported and included in the exception." msgstr "" +"زیرکلاسی از :exc:`ValueError` که توسط :meth:`TopologicalSorter.prepare` در " +"صورت وجود دورها در گراف کاری پرتاب می‌شود. اگر چندین دور وجود داشته باشد، " +"تنها یک انتخاب نامعین از میان آن‌ها گزارش و در استثنا گنجانده می‌شود." -msgid "The detected cycle can be accessed via the second element in the :attr:`~BaseException.args` attribute of the exception instance and consists in a list of nodes, such that each node is, in the graph, an immediate predecessor of the next node in the list. In the reported list, the first and the last node will be the same, to make it clear that it is cyclic." -msgstr "" +msgid "" +"The detected cycle can be accessed via the second element in the " +":attr:`~BaseException.args` attribute of the exception instance and consists" +" in a list of nodes, such that each node is, in the graph, an immediate " +"predecessor of the next node in the list. In the reported list, the first " +"and the last node will be the same, to make it clear that it is cyclic." +msgstr "" +"چرخه‌ی شناسایی‌شده از طریق دومین عنصر در ویژگی :attr:`~BaseException.args` " +"در نمونه استثنا قابل دسترسی است و شامل فهرستی از گره‌ها می‌شود، به‌طوری که " +"هر گره در گراف، پیش‌نشین مستقیم گره بعدی در فهرست است. در فهرست گزارش‌شده، " +"اولین و آخرین گره یکسان خواهند بود، تا مشخص باشد که چرخه‌ای است." diff --git a/library/grp.po b/library/grp.po index f8f37161a..44bd97be1 100644 --- a/library/grp.po +++ b/library/grp.po @@ -25,82 +25,118 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!grp` --- The group database" -msgstr "" +msgstr ":mod:`!grp` --- پایگاه داده گروه" -msgid "This module provides access to the Unix group database. It is available on all Unix versions." +msgid "" +"This module provides access to the Unix group database. It is available on " +"all Unix versions." msgstr "" +"این ماژول دسترسی به پایگاه داده‌ی گروه یونیکس را فراهم می‌کند. این ماژول در " +"همه‌ی نسخه‌های یونیکس در دسترس است." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "Group database entries are reported as a tuple-like object, whose attributes correspond to the members of the ``group`` structure (Attribute field below, see ````):" +msgid "" +"Group database entries are reported as a tuple-like object, whose attributes" +" correspond to the members of the ``group`` structure (Attribute field " +"below, see ````):" msgstr "" +"ورودی‌های پایگاه داده‌ی گروه به‌صورت یک شیء تاپل‌مانند گزارش می‌شوند که " +"ویژگی‌های آن با اعضای ساختار ``group`` متناظر هستند (فیلد ویژگی در زیر، " +"```` را ببینید):" msgid "Index" -msgstr "" +msgstr "اندیس" msgid "Attribute" -msgstr "" +msgstr "ویژگی" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "0" -msgstr "" +msgstr "0" msgid "gr_name" -msgstr "" +msgstr "gr_name" msgid "the name of the group" -msgstr "" +msgstr "نام گروه" msgid "1" -msgstr "" +msgstr "1" msgid "gr_passwd" -msgstr "" +msgstr "gr_passwd" msgid "the (encrypted) group password; often empty" -msgstr "" +msgstr "گذرواژه گروه (رمزنگاری‌شده)؛ معمولاً خالی" msgid "2" -msgstr "" +msgstr "2" msgid "gr_gid" -msgstr "" +msgstr "gr_gid" msgid "the numerical group ID" -msgstr "" +msgstr "شناسه‌ی عددی گروه" msgid "3" -msgstr "" +msgstr "۳" msgid "gr_mem" -msgstr "" +msgstr "gr_mem" msgid "all the group member's user names" -msgstr "" +msgstr "تمام نام‌های کاربری عضو گروه" -msgid "The gid is an integer, name and password are strings, and the member list is a list of strings. (Note that most users are not explicitly listed as members of the group they are in according to the password database. Check both databases to get complete membership information. Also note that a ``gr_name`` that starts with a ``+`` or ``-`` is likely to be a YP/NIS reference and may not be accessible via :func:`getgrnam` or :func:`getgrgid`.)" -msgstr "" +msgid "" +"The gid is an integer, name and password are strings, and the member list is" +" a list of strings. (Note that most users are not explicitly listed as " +"members of the group they are in according to the password database. Check " +"both databases to get complete membership information. Also note that a " +"``gr_name`` that starts with a ``+`` or ``-`` is likely to be a YP/NIS " +"reference and may not be accessible via :func:`getgrnam` or " +":func:`getgrgid`.)" +msgstr "" +"gid یک عدد صحیح است، نام و گذرواژه رشته‌اند، و فهرست اعضا فهرستی از رشته‌ها " +"است. (توجه داشته باشید که بیشتر کاربران به‌صراحت به‌عنوان اعضای گروهی که بر " +"اساس پایگاه داده‌ی گذرواژه در آن قرار دارند، فهرست نشده‌اند. برای دریافت " +"اطلاعات کامل عضویت، هر دو پایگاه داده را بررسی کنید. همچنین توجه داشته باشید" +" که ``gr_name`` که با ``+`` یا ``-`` شروع می‌شود، احتمالاً یک ارجاع YP/NIS " +"است و ممکن است از طریق :func:`getgrnam` یا :func:`getgrgid` قابل دسترسی " +"نباشد.)" msgid "It defines the following items:" -msgstr "" +msgstr "آیتم‌های زیر را تعریف می‌کند:" -msgid "Return the group database entry for the given numeric group ID. :exc:`KeyError` is raised if the entry asked for cannot be found." +msgid "" +"Return the group database entry for the given numeric group ID. " +":exc:`KeyError` is raised if the entry asked for cannot be found." msgstr "" +"بازگرداندن ورودی پایگاه داده‌ی گروه برای شناسه‌ی گروه عددی داده‌شده. اگر ورودی" +" درخواست‌شده یافت نشود، :exc:`KeyError` پرتاب می‌شود." -msgid ":exc:`TypeError` is raised for non-integer arguments like floats or strings." +msgid "" +":exc:`TypeError` is raised for non-integer arguments like floats or strings." msgstr "" +"استثنای :exc:`TypeError` برای آرگومان‌هایی که عدد صحیح نیستند، مانند اعداد " +"اعشاری یا رشته‌ها پرتاب می‌شود." -msgid "Return the group database entry for the given group name. :exc:`KeyError` is raised if the entry asked for cannot be found." +msgid "" +"Return the group database entry for the given group name. :exc:`KeyError` is" +" raised if the entry asked for cannot be found." msgstr "" +"مدخل پایگاه داده‌ی گروه برای نام گروه داده‌شده را بازمی‌گرداند. اگر مدخل " +"درخواست‌شده یافت نشود، :exc:`KeyError` پرتاب می‌شود." msgid "Return a list of all available group entries, in arbitrary order." msgstr "" +"فهرستی از تمام ورودی‌های گروه موجود را، با ترتیبی دلخواه، برمی‌گرداند." msgid "Module :mod:`pwd`" -msgstr "" +msgstr "ماژول :mod:`pwd`" msgid "An interface to the user database, similar to this." -msgstr "" +msgstr "رابطی برای پایگاه داده کاربر، مشابه این." diff --git a/library/gzip.po b/library/gzip.po index 42cfb0369..ed7cdd64c 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -24,166 +24,403 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!gzip` --- Support for :program:`gzip` files" -msgstr "" +msgstr ":mod:`!gzip` --- پشتیبانی از فایل‌های :program:`gzip`" msgid "**Source code:** :source:`Lib/gzip.py`" -msgstr "" +msgstr ":source:`Lib/gzip.py`" -msgid "This module provides a simple interface to compress and decompress files just like the GNU programs :program:`gzip` and :program:`gunzip` would." +msgid "" +"This module provides a simple interface to compress and decompress files " +"just like the GNU programs :program:`gzip` and :program:`gunzip` would." msgstr "" +"این ماژول رابط ساده‌ای برای فشرده‌سازی و از حالت فشرده خارج کردن فایل‌ها " +"فراهم می‌کند، درست مانند برنامه‌های GNU :program:`gzip` و :program:`gunzip`." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر این ماژول در نسخه‌ی " +"CPython شما موجود نیست، به مستندات توزیع‌کننده خود (یعنی هر کسی که پایتون را" +" برای شما فراهم کرده است) مراجعه کنید. اگر شما توزیع‌کننده هستید، " +":ref:`optional-module-requirements` را ببینید." msgid "The data compression is provided by the :mod:`zlib` module." -msgstr "" +msgstr "فشرده‌سازی داده توسط ماژول :mod:`zlib` فراهم می‌شود." -msgid "The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as the :func:`.open`, :func:`compress` and :func:`decompress` convenience functions. The :class:`GzipFile` class reads and writes :program:`gzip`\\ -format files, automatically compressing or decompressing the data so that it looks like an ordinary :term:`file object`." -msgstr "" +msgid "" +"The :mod:`!gzip` module provides the :class:`GzipFile` class, as well as the" +" :func:`.open`, :func:`compress` and :func:`decompress` convenience " +"functions. The :class:`GzipFile` class reads and writes :program:`gzip`\\ " +"-format files, automatically compressing or decompressing the data so that " +"it looks like an ordinary :term:`file object`." +msgstr "" +"ماژول :mod:`!gzip` کلاس :class:`GzipFile` و همچنین تابع‌های سهولت‌بخش " +":func:`.open`، :func:`compress` و :func:`decompress` را فراهم می‌کند. کلاس " +":class:`GzipFile` فایل‌های با قالب :program:`gzip` را می‌خواند و می‌نویسد و " +"داده‌ها را به‌طور خودکار فشرده‌سازی یا از حالت فشرده خارج می‌کند، به‌گونه‌ای" +" که مانند یک :term:`file object` معمولی به نظر برسد." -msgid "Note that additional file formats which can be decompressed by the :program:`gzip` and :program:`gunzip` programs, such as those produced by :program:`compress` and :program:`pack`, are not supported by this module." +msgid "" +"Note that additional file formats which can be decompressed by the " +":program:`gzip` and :program:`gunzip` programs, such as those produced by " +":program:`compress` and :program:`pack`, are not supported by this module." msgstr "" +"توجه داشته باشید که قالب‌های فایل دیگری که می‌توانند توسط برنامه‌های " +":program:`gzip` و :program:`gunzip` از حالت فشرده خارج شوند، مانند آن‌هایی " +"که توسط :program:`compress` و :program:`pack` تولید می‌شوند، در این ماژول " +"پشتیبانی نمی‌شوند." msgid "The module defines the following items:" -msgstr "" +msgstr "این ماژول آیتم‌های زیر را تعریف می‌کند:" -msgid "Open a gzip-compressed file in binary or text mode, returning a :term:`file object`." +msgid "" +"Open a gzip-compressed file in binary or text mode, returning a :term:`file " +"object`." msgstr "" +"یک فایل فشرده‌شده با gzip را در حالت دودویی یا متنی باز می‌کند و یک " +":term:`file object` برمی‌گرداند." -msgid "The *filename* argument can be an actual filename (a :class:`str` or :class:`bytes` object), or an existing file object to read from or write to." +msgid "" +"The *filename* argument can be an actual filename (a :class:`str` or " +":class:`bytes` object), or an existing file object to read from or write to." msgstr "" +"آرگومان *filename* می‌تواند یک نام فایل واقعی (یک شیء :class:`str` یا " +":class:`bytes`)، یا یک شیء فایل موجود برای خواندن از آن یا نوشتن در آن باشد." -msgid "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``." +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'`` or ``'xb'`` for binary mode, or ``'rt'``, " +"``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``." msgstr "" +"آرگومان *mode* می‌تواند یکی از ``'r'``، ``'rb'``، ``'a'``، ``'ab'``، " +"``'w'``، ``'wb'``، ``'x'`` یا ``'xb'`` برای حالت دودویی، یا ``'rt'``، " +"``'at'``، ``'wt'`` یا ``'xt'`` برای حالت متنی باشد. مقدار پیش‌فرض ``'rb'`` " +"است." -msgid "The *compresslevel* argument is an integer from 0 to 9, as for the :class:`GzipFile` constructor." +msgid "" +"The *compresslevel* argument is an integer from 0 to 9, as for the " +":class:`GzipFile` constructor." msgstr "" +"آرگومان *compresslevel* یک عدد صحیح از ۰ تا ۹ است، همان‌طور که برای سازنده‌ی" +" :class:`GzipFile` وجود دارد." -msgid "For binary mode, this function is equivalent to the :class:`GzipFile` constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the *encoding*, *errors* and *newline* arguments must not be provided." +msgid "" +"For binary mode, this function is equivalent to the :class:`GzipFile` " +"constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the " +"*encoding*, *errors* and *newline* arguments must not be provided." msgstr "" +"برای حالت دودویی، این تابع معادل سازنده‌ی :class:`GzipFile` است: " +"``GzipFile(filename, mode, compresslevel)``. در این حالت، آرگومان‌های " +"*encoding*، *errors* و *newline* نباید ارائه شوند." -msgid "For text mode, a :class:`GzipFile` object is created, and wrapped in an :class:`io.TextIOWrapper` instance with the specified encoding, error handling behavior, and line ending(s)." +msgid "" +"For text mode, a :class:`GzipFile` object is created, and wrapped in an " +":class:`io.TextIOWrapper` instance with the specified encoding, error " +"handling behavior, and line ending(s)." msgstr "" +"برای حالت متنی، یک شیء :class:`GzipFile` ایجاد می‌شود و در یک نمونه از " +":class:`io.TextIOWrapper` با کدگذاری، رفتار مدیریت خطا و نویسه‌های پایان خط " +"مشخص‌شده، قرار می‌گیرد." -msgid "Added support for *filename* being a file object, support for text mode, and the *encoding*, *errors* and *newline* arguments." +msgid "" +"Added support for *filename* being a file object, support for text mode, and" +" the *encoding*, *errors* and *newline* arguments." msgstr "" +"پشتیبانی از *filename* به‌عنوان یک شیء فایل، پشتیبانی از حالت متنی، و " +"آرگومان‌های *encoding*، *errors* و *newline* افزوده شد." msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." -msgstr "" +msgstr "پشتیبانی از حالت‌های ``'x'``، ``'xb'`` و ``'xt'`` اضافه شد." msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "یک :term:`path-like object` را می‌پذیرد." -msgid "An exception raised for invalid gzip files. It inherits from :exc:`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for invalid gzip files." +msgid "" +"An exception raised for invalid gzip files. It inherits from " +":exc:`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for" +" invalid gzip files." msgstr "" +"استثنایی که برای فایل‌های gzip نامعتبر پرتاب می‌شود. این استثنا از " +":exc:`OSError` ارث‌بری می‌کند. :exc:`EOFError` و :exc:`zlib.error` نیز ممکن " +"است برای فایل‌های gzip نامعتبر پرتاب شوند." -msgid "Constructor for the :class:`GzipFile` class, which simulates most of the methods of a :term:`file object`, with the exception of the :meth:`~io.IOBase.truncate` method. At least one of *fileobj* and *filename* must be given a non-trivial value." +msgid "" +"Constructor for the :class:`GzipFile` class, which simulates most of the " +"methods of a :term:`file object`, with the exception of the " +":meth:`~io.IOBase.truncate` method. At least one of *fileobj* and " +"*filename* must be given a non-trivial value." msgstr "" +"سازنده‌ای برای کلاس :class:`GzipFile`، که بیشتر متدهای یک :term:`شیء فایل " +"` را شبیه‌سازی می‌کند، به استثنای متد " +":meth:`~io.IOBase.truncate`. حداقل یکی از *fileobj* و *filename* باید یک " +"مقدار غیربدیهی به آن داده شود." -msgid "The new class instance is based on *fileobj*, which can be a regular file, an :class:`io.BytesIO` object, or any other object which simulates a file. It defaults to ``None``, in which case *filename* is opened to provide a file object." +msgid "" +"The new class instance is based on *fileobj*, which can be a regular file, " +"an :class:`io.BytesIO` object, or any other object which simulates a file. " +"It defaults to ``None``, in which case *filename* is opened to provide a " +"file object." msgstr "" +"نمونه‌ی کلاس جدید بر پایه‌ی *fileobj* است که می‌تواند یک فایل معمولی، یک شیء" +" :class:`io.BytesIO` یا هر شیء دیگری باشد که یک فایل را شبیه‌سازی می‌کند. " +"مقدار پیش‌فرض آن ``None`` است، که در این صورت *filename* باز می‌شود تا یک " +"شیء فایل فراهم کند." -msgid "When *fileobj* is not ``None``, the *filename* argument is only used to be included in the :program:`gzip` file header, which may include the original filename of the uncompressed file. It defaults to the filename of *fileobj*, if discernible; otherwise, it defaults to the empty string, and in this case the original filename is not included in the header." -msgstr "" +msgid "" +"When *fileobj* is not ``None``, the *filename* argument is only used to be " +"included in the :program:`gzip` file header, which may include the original " +"filename of the uncompressed file. It defaults to the filename of " +"*fileobj*, if discernible; otherwise, it defaults to the empty string, and " +"in this case the original filename is not included in the header." +msgstr "" +"هنگامی که *fileobj* برابر ``None`` نباشد، آرگومان *filename* فقط برای " +"گنجانده شدن در سرآیند فایل :program:`gzip` استفاده می‌شود، که ممکن است شامل " +"نام فایل اصلیِ فایل فشرده‌نشده باشد. مقدار پیش‌فرض آن نام فایلِ *fileobj* " +"است، اگر قابل تشخیص باشد؛ در غیر این صورت، پیش‌فرض آن رشته‌ی خالی است و در " +"این حالت نام فایل اصلی در سرآیند گنجانده نمی‌شود." -msgid "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will be read or written. The default is the mode of *fileobj* if discernible; otherwise, the default is ``'rb'``. In future Python releases the mode of *fileobj* will not be used. It is better to always specify *mode* for writing." -msgstr "" +msgid "" +"The *mode* argument can be any of ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, " +"``'w'``, ``'wb'``, ``'x'``, or ``'xb'``, depending on whether the file will " +"be read or written. The default is the mode of *fileobj* if discernible; " +"otherwise, the default is ``'rb'``. In future Python releases the mode of " +"*fileobj* will not be used. It is better to always specify *mode* for " +"writing." +msgstr "" +"آرگومان *mode* می‌تواند هر یک از ``'r'``، ``'rb'``، ``'a'``، ``'ab'``، " +"``'w'``، ``'wb'``، ``'x'`` یا ``'xb'`` باشد، بسته به اینکه فایل خوانده شود " +"یا نوشته شود. مقدار پیش‌فرض، در صورت قابل تشخیص بودن، حالت *fileobj* است؛ در" +" غیر این صورت، پیش‌فرض ``'rb'`` است. در نسخه‌های آینده پایتون، حالت " +"*fileobj* استفاده نخواهد شد. بهتر است همیشه *mode* را برای نوشتن مشخص کنید." -msgid "Note that the file is always opened in binary mode. To open a compressed file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an :class:`io.TextIOWrapper`)." +msgid "" +"Note that the file is always opened in binary mode. To open a compressed " +"file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an" +" :class:`io.TextIOWrapper`)." msgstr "" +"توجه داشته باشید که فایل همیشه در حالت دودویی باز می‌شود. برای باز کردن یک " +"فایل فشرده در حالت متنی، از :func:`.open` استفاده کنید (یا :class:`GzipFile`" +" خود را با یک :class:`io.TextIOWrapper` بپیچید)." -msgid "The *compresslevel* argument is an integer from ``0`` to ``9`` controlling the level of compression; ``1`` is fastest and produces the least compression, and ``9`` is slowest and produces the most compression. ``0`` is no compression. The default is ``9``." +msgid "" +"The *compresslevel* argument is an integer from ``0`` to ``9`` controlling " +"the level of compression; ``1`` is fastest and produces the least " +"compression, and ``9`` is slowest and produces the most compression. ``0`` " +"is no compression. The default is ``9``." msgstr "" +"آرگومان *compresslevel* یک عدد صحیح از ``0`` تا ``9`` است که سطح فشرده‌سازی " +"را کنترل می‌کند؛ ``1`` سریع‌ترین است و کمترین میزان فشرده‌سازی را تولید " +"می‌کند، و ``9`` کندترین است و بیشترین میزان فشرده‌سازی را تولید می‌کند. " +"``0`` بدون فشرده‌سازی است. مقدار پیش‌فرض ``9`` است." -msgid "The optional *mtime* argument is the timestamp requested by gzip. The time is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If *mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0 to generate a compressed stream that does not depend on creation time." +msgid "" +"The optional *mtime* argument is the timestamp requested by gzip. The time " +"is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If " +"*mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0 to" +" generate a compressed stream that does not depend on creation time." msgstr "" +"آرگومان اختیاری *mtime* برچسب زمانی است که gzip درخواست می‌کند. این زمان در " +"قالب Unix است، یعنی ثانیه‌های سپری‌شده از ۰۰:۰۰:۰۰ UTC، ۱ ژانویه ۱۹۷۰. اگر " +"*mtime* حذف شود یا ``None`` باشد، از زمان جاری استفاده می‌شود. برای تولید یک" +" جریان فشرده که به زمان ایجاد وابسته نباشد، از *mtime* = 0 استفاده کنید." -msgid "See below for the :attr:`mtime` attribute that is set when decompressing." +msgid "" +"See below for the :attr:`mtime` attribute that is set when decompressing." msgstr "" +"در زیر ویژگی :attr:`mtime` را ببینید که هنگام از حالت فشرده خارج کردن تنظیم " +"می‌شود." -msgid "Calling a :class:`GzipFile` object's :meth:`!close` method does not close *fileobj*, since you might wish to append more material after the compressed data. This also allows you to pass an :class:`io.BytesIO` object opened for writing as *fileobj*, and retrieve the resulting memory buffer using the :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." -msgstr "" +msgid "" +"Calling a :class:`GzipFile` object's :meth:`!close` method does not close " +"*fileobj*, since you might wish to append more material after the compressed" +" data. This also allows you to pass an :class:`io.BytesIO` object opened " +"for writing as *fileobj*, and retrieve the resulting memory buffer using the" +" :class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." +msgstr "" +"فراخوانی متد :meth:`!close` یک شیء :class:`GzipFile`، *fileobj* را نمی‌بندد،" +" زیرا ممکن است بخواهید محتوای بیشتری را پس از داده‌های فشرده اضافه کنید. این" +" موضوع همچنین به شما امکان می‌دهد که یک شیء :class:`io.BytesIO` را که برای " +"نوشتن باز شده است به‌عنوان *fileobj* ارسال کنید و با استفاده از متد " +":meth:`~io.BytesIO.getvalue` همان شیء :class:`io.BytesIO`، بافر حافظه‌ی حاصل " +"را بازیابی کنید." -msgid ":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, including iteration and the :keyword:`with` statement. Only the :meth:`~io.IOBase.truncate` method isn't implemented." +msgid "" +":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " +"including iteration and the :keyword:`with` statement. Only the " +":meth:`~io.IOBase.truncate` method isn't implemented." msgstr "" +":class:`GzipFile` از رابط :class:`io.BufferedIOBase` پشتیبانی می‌کند، از " +"جمله تکرار و دستور :keyword:`with`. فقط متد :meth:`~io.IOBase.truncate` " +"پیاده‌سازی نشده است." msgid ":class:`GzipFile` also provides the following method and attribute:" -msgstr "" +msgstr ":class:`GzipFile` همچنین متد و ویژگی زیر را فراهم می‌کند:" -msgid "Read *n* uncompressed bytes without advancing the file position. The number of bytes returned may be more or less than requested." +msgid "" +"Read *n* uncompressed bytes without advancing the file position. The number " +"of bytes returned may be more or less than requested." msgstr "" +"خواندن *n* بایت فشرده‌نشده بدون پیش بردن موقعیت فایل. تعداد بایت‌های " +"برگردانده‌شده ممکن است بیشتر یا کمتر از تعداد درخواست‌شده باشد." -msgid "While calling :meth:`peek` does not change the file position of the :class:`GzipFile`, it may change the position of the underlying file object (e.g. if the :class:`GzipFile` was constructed with the *fileobj* parameter)." +msgid "" +"While calling :meth:`peek` does not change the file position of the " +":class:`GzipFile`, it may change the position of the underlying file object " +"(e.g. if the :class:`GzipFile` was constructed with the *fileobj* " +"parameter)." msgstr "" +"اگرچه فراخوانی :meth:`peek` موقعیت فایلِ :class:`GzipFile` را تغییر نمی‌دهد،" +" اما ممکن است موقعیت شیء فایل زیرین را تغییر دهد (مثلاً اگر " +":class:`GzipFile` با پارامتر *fileobj* ساخته شده باشد)." msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "" +msgstr "``'rb'`` برای خواندن و ``'wb'`` برای نوشتن." msgid "In previous versions it was an integer ``1`` or ``2``." -msgstr "" +msgstr "در نسخه‌های قبلی، یک عدد صحیح ``1`` یا ``2`` بود." -msgid "When decompressing, this attribute is set to the last timestamp in the most recently read header. It is an integer, holding the number of seconds since the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before reading any headers is ``None``." +msgid "" +"When decompressing, this attribute is set to the last timestamp in the most " +"recently read header. It is an integer, holding the number of seconds since" +" the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before " +"reading any headers is ``None``." msgstr "" +"هنگام فشرده‌گشایی، این ویژگی روی آخرین برچسب زمانی در آخرین سرصفحه‌ی " +"خوانده‌شده تنظیم می‌شود. این یک عدد صحیح است و تعداد ثانیه‌ها از مبدأ زمان " +"یونیکس (۰۰:۰۰:۰۰ UTC، ۱ ژانویه ۱۹۷۰) را نگه می‌دارد. مقدار اولیه پیش از " +"خواندن هر سرصفحه‌ای ``None`` است." -msgid "The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. Equivalent to the output of :func:`os.fspath` on the original input path, with no other normalization, resolution or expansion." +msgid "" +"The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " +"Equivalent to the output of :func:`os.fspath` on the original input path, " +"with no other normalization, resolution or expansion." msgstr "" +"مسیر فایل gzip روی دیسک، به‌صورت :class:`str` یا :class:`bytes`. معادل خروجی" +" :func:`os.fspath` برای مسیر ورودی اصلی، بدون هیچ‌گونه نرمال‌سازی، حل یا بسط" +" دیگری." -msgid "Support for the :keyword:`with` statement was added, along with the *mtime* constructor argument and :attr:`mtime` attribute." +msgid "" +"Support for the :keyword:`with` statement was added, along with the *mtime* " +"constructor argument and :attr:`mtime` attribute." msgstr "" +"پشتیبانی از دستور :keyword:`with`، به‌همراه آرگومان سازنده‌ی *mtime* و ویژگی" +" :attr:`mtime` افزوده شد." msgid "Support for zero-padded and unseekable files was added." msgstr "" +"پشتیبانی از فایل‌های پرشده با صفر (zero-padded) و غیرقابل مکان‌یابی " +"(unseekable) اضافه شد." msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." -msgstr "" +msgstr "متد :meth:`io.BufferedIOBase.read1` اکنون پیاده‌سازی شده است." msgid "Added support for the ``'x'`` and ``'xb'`` modes." -msgstr "" +msgstr "پشتیبانی از حالت‌های ``'x'`` و ``'xb'`` اضافه شد." -msgid "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument of ``None``." +msgid "" +"Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument" +" of ``None``." msgstr "" +"پشتیبانی از نوشتن هرگونه :term:`شیء شبه‌بایت ` افزوده " +"شد. متد :meth:`~io.BufferedIOBase.read` اکنون ``None`` را به‌عنوان آرگومان " +"می‌پذیرد." -msgid "Opening :class:`GzipFile` for writing without specifying the *mode* argument is deprecated." +msgid "" +"Opening :class:`GzipFile` for writing without specifying the *mode* argument" +" is deprecated." msgstr "" +"باز کردن :class:`GzipFile` برای نوشتن بدون تعیین آرگومان *mode* منسوخ شده " +"است." -msgid "Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute instead." +msgid "" +"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " +"instead." msgstr "" +"ویژگی ``filename`` را حذف کنید و به‌جای آن از ویژگی :attr:`~GzipFile.name` " +"استفاده کنید." -msgid "Compress the *data*, returning a :class:`bytes` object containing the compressed data. *compresslevel* and *mtime* have the same meaning as in the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for reproducible output." +msgid "" +"Compress the *data*, returning a :class:`bytes` object containing the " +"compressed data. *compresslevel* and *mtime* have the same meaning as in " +"the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for " +"reproducible output." msgstr "" +"*data* را فشرده می‌کند و یک شیء :class:`bytes` حاوی داده فشرده‌شده " +"برمی‌گرداند. *compresslevel* و *mtime* همان معنایی را دارند که در سازنده " +":class:`GzipFile` در بالا آمده است، اما مقدار پیش‌فرض *mtime* برابر ۰ است تا" +" خروجی قابل بازتولید باشد." msgid "Added the *mtime* parameter for reproducible output." -msgstr "" +msgstr "پارامتر *mtime* برای خروجی قابل‌تکرار افزوده شد." -msgid "Speed is improved by compressing all data at once instead of in a streamed fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib.compress` for better speed. In this situation the output may contain a gzip header \"OS\" byte value other than 255 \"unknown\" as supplied by the underlying zlib implementation." -msgstr "" +msgid "" +"Speed is improved by compressing all data at once instead of in a streamed " +"fashion. Calls with *mtime* set to ``0`` are delegated to " +":func:`zlib.compress` for better speed. In this situation the output may " +"contain a gzip header \"OS\" byte value other than 255 \"unknown\" as " +"supplied by the underlying zlib implementation." +msgstr "" +"سرعت با فشرده‌سازی همه داده‌ها به‌صورت یکجا به‌جای روش جریانی بهبود می‌یابد." +" فراخوانی‌هایی که *mtime* آن‌ها روی ``0`` تنظیم شده است، برای سرعت بهتر به " +":func:`zlib.compress` واگذار می‌شوند. در این شرایط، ممکن است خروجی شامل " +"مقداری برای بایت «OS» سرصفحه gzip باشد که غیر از ۲۵۵ («نامشخص») است و توسط " +"پیاده‌سازی زیربنایی zlib ارائه می‌شود." -msgid "The gzip header OS byte is guaranteed to be set to 255 when this function is used as was the case in 3.10 and earlier." +msgid "" +"The gzip header OS byte is guaranteed to be set to 255 when this function is" +" used as was the case in 3.10 and earlier." msgstr "" +"هنگام استفاده از این تابع، تضمین می‌شود که بایت OS سرآیند gzip روی 255 تنظیم" +" شود، همان‌گونه که در 3.10 و نسخه‌های پیش‌تر نیز چنین بود." -msgid "The *mtime* parameter now defaults to 0 for reproducible output. For the previous behaviour of using the current time, pass ``None`` to *mtime*." +msgid "" +"The *mtime* parameter now defaults to 0 for reproducible output. For the " +"previous behaviour of using the current time, pass ``None`` to *mtime*." msgstr "" +"پارامتر *mtime* اکنون برای خروجی قابل تولید مجدد، به‌طور پیش‌فرض مقدار ۰ را " +"دارد. برای رفتار پیشین که از زمان جاری استفاده می‌کرد، ``None`` را به " +"*mtime* بدهید." -msgid "Decompress the *data*, returning a :class:`bytes` object containing the uncompressed data. This function is capable of decompressing multi-member gzip data (multiple gzip blocks concatenated together). When the data is certain to contain only one member the :func:`zlib.decompress` function with *wbits* set to 31 is faster." +msgid "" +"Decompress the *data*, returning a :class:`bytes` object containing the " +"uncompressed data. This function is capable of decompressing multi-member " +"gzip data (multiple gzip blocks concatenated together). When the data is " +"certain to contain only one member the :func:`zlib.decompress` function with" +" *wbits* set to 31 is faster." msgstr "" +"*data* را فشرده‌گشایی می‌کند و یک شیء :class:`bytes` حاوی داده‌ی غیرفشرده را " +"برمی‌گرداند. این تابع قادر به فشرده‌گشایی داده‌ی gzip چندعضوی (چند بلوک gzip " +"که به هم الحاق شده‌اند) است. هنگامی که مطمئن هستید داده فقط شامل یک عضو است،" +" تابع :func:`zlib.decompress` با *wbits* تنظیم‌شده روی ۳۱ سریع‌تر است." -msgid "Speed is improved by decompressing members at once in memory instead of in a streamed fashion." +msgid "" +"Speed is improved by decompressing members at once in memory instead of in a" +" streamed fashion." msgstr "" +"سرعت با فشرده‌گشایی یکجای اعضا در حافظه، به‌جای انجام این کار به‌صورت " +"جریانی، بهبود می‌یابد." msgid "Examples of usage" -msgstr "" +msgstr "نمونه‌های کاربرد" msgid "Example of how to read a compressed file::" -msgstr "" +msgstr "مثالی از نحوه‌ی خواندن یک فایل فشرده::" msgid "" "import gzip\n" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" " file_content = f.read()" msgstr "" +"import gzip\n" +"with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" +" file_content = f.read()" msgid "Example of how to create a compressed GZIP file::" -msgstr "" +msgstr "مثالی از چگونگی ایجاد یک فایل GZIP فشرده::" msgid "" "import gzip\n" @@ -191,9 +428,13 @@ msgid "" "with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" " f.write(content)" msgstr "" +"import gzip\n" +"content = b\"Lots of content here\"\n" +"with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" +" f.write(content)" msgid "Example of how to GZIP compress an existing file::" -msgstr "" +msgstr "مثالی از نحوه فشرده‌سازی یک فایل موجود با GZIP::" msgid "" "import gzip\n" @@ -202,51 +443,75 @@ msgid "" " with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" " shutil.copyfileobj(f_in, f_out)" msgstr "" +"import gzip\n" +"import shutil\n" +"with open('/home/joe/file.txt', 'rb') as f_in:\n" +" with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)" msgid "Example of how to GZIP compress a binary string::" -msgstr "" +msgstr "مثالی از نحوه‌ی فشرده‌سازی GZIP یک رشته‌ی دودویی::" msgid "" "import gzip\n" "s_in = b\"Lots of content here\"\n" "s_out = gzip.compress(s_in)" msgstr "" +"import gzip\n" +"s_in = b\"Lots of content here\"\n" +"s_out = gzip.compress(s_in)" msgid "Module :mod:`zlib`" -msgstr "" +msgstr "ماژول :mod:`zlib`" -msgid "The basic data compression module needed to support the :program:`gzip` file format." +msgid "" +"The basic data compression module needed to support the :program:`gzip` file" +" format." msgstr "" +"ماژول پایه‌ی فشرده‌سازی داده که برای پشتیبانی از قالب فایل :program:`gzip` " +"مورد نیاز است." -msgid "In case gzip (de)compression is a bottleneck, the `python-isal`_ package speeds up (de)compression with a mostly compatible API." +msgid "" +"In case gzip (de)compression is a bottleneck, the `python-isal`_ package " +"speeds up (de)compression with a mostly compatible API." msgstr "" +"در صورتی که فشرده‌سازی و فشرده‌گشایی gzip گلوگاه باشد، بسته `python-isal`_ " +"سرعت فشرده‌سازی و فشرده‌گشایی را با یک API عمدتاً سازگار افزایش می‌دهد." msgid "Command-line interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "The :mod:`!gzip` module provides a simple command line interface to compress or decompress files." +msgid "" +"The :mod:`!gzip` module provides a simple command line interface to compress" +" or decompress files." msgstr "" +"ماژول :mod:`!gzip` یک رابط خط فرمان ساده برای فشرده‌سازی یا از حالت فشرده " +"خارج کردن فایل‌ها ارائه می‌دهد." msgid "Once executed the :mod:`!gzip` module keeps the input file(s)." -msgstr "" +msgstr "پس از اجرا، ماژول :mod:`!gzip` فایل(های) ورودی را نگه می‌دارد." -msgid "Add a new command line interface with a usage. By default, when you will execute the CLI, the default compression level is 6." +msgid "" +"Add a new command line interface with a usage. By default, when you will " +"execute the CLI, the default compression level is 6." msgstr "" +"یک رابط خط فرمان جدید به همراه یک کاربرد اضافه کنید. به‌طور پیش‌فرض، هنگامی " +"که CLI را اجرا کنید، سطح فشرده‌سازی پیش‌فرض ۶ است." msgid "Command-line options" -msgstr "" +msgstr "گزینه‌های خط فرمان" msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +msgstr "اگر *file* مشخص نشده باشد، از :data:`sys.stdin` خوانده می‌شود." msgid "Indicates the fastest compression method (less compression)." -msgstr "" +msgstr "نشان‌دهنده‌ی سریع‌ترین روش فشرده‌سازی (فشرده‌سازی کمتر) است." msgid "Indicates the slowest compression method (best compression)." -msgstr "" +msgstr "نشان‌دهنده‌ی کندترین روش فشرده‌سازی (بهترین فشرده‌سازی) است." msgid "Decompress the given file." -msgstr "" +msgstr "فایل داده‌شده را از حالت فشرده خارج کنید." msgid "Show the help message." -msgstr "" +msgstr "نمایش پیام راهنما." diff --git a/library/hashlib.po b/library/hashlib.po index 9b0ac8c1d..95382662d 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -17,7 +17,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"PO-Revision-Date: 2026-08-28 11:23+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -25,54 +25,149 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!hashlib` --- Secure hashes and message digests" -msgstr "" +msgstr ":mod:`!hashlib` --- هش‌های امن و چکیده‌های پیام" msgid "**Source code:** :source:`Lib/hashlib.py`" -msgstr "" +msgstr ":source:`Lib/hashlib.py`" -msgid "This module implements a common interface to many different hash algorithms. Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512, (defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the FIPS 202 standard`_) as well as the legacy algorithms SHA1 (`formerly part of FIPS`_) and the MD5 algorithm (defined in internet :rfc:`1321`)." -msgstr "" +msgid "" +"This module implements a common interface to many different hash " +"algorithms. Included are the FIPS secure hash algorithms SHA224, SHA256, " +"SHA384, SHA512, (defined in `the FIPS 180-4 standard`_), the SHA-3 series " +"(defined in `the FIPS 202 standard`_) as well as the legacy algorithms SHA1 " +"(`formerly part of FIPS`_) and the MD5 algorithm (defined in " +"internet :rfc:`1321`)." +msgstr "" +"این ماژول یک رابط مشترک را برای بسیاری از الگوریتم‌های هش متفاوت پیاده‌سازی " +"می‌کند. موارد شامل‌شده عبارت‌اند از الگوریتم‌های هش امن FIPS یعنی SHA224، " +"SHA256، SHA384، SHA512، (تعریف‌شده در `the FIPS 180-4 standard`_)، سری SHA-3 " +"(تعریف‌شده در `the FIPS 202 standard`_) و همچنین الگوریتم‌های قدیمی SHA1 " +"(`formerly part of FIPS`_) و الگوریتم MD5 (تعریف‌شده در سند " +"اینترنتی :rfc:`1321`)." -msgid "If you want the adler32 or crc32 hash functions, they are available in the :mod:`zlib` module." +msgid "" +"If you want the adler32 or crc32 hash functions, they are available in " +"the :mod:`zlib` module." msgstr "" +"اگر به توابع هش adler32 یا crc32 نیاز دارید، این توابع در ماژول :mod:`zlib` " +"در دسترس هستند." msgid "Hash algorithms" -msgstr "" +msgstr "الگوریتم‌های هش" -msgid "There is one constructor method named for each type of :dfn:`hash`. All return a hash object with the same simple interface. For example: use :func:`sha256` to create a SHA-256 hash object. You can now feed this object with :term:`bytes-like objects ` (normally :class:`bytes`) using the :meth:`update` method. At any point you can ask it for the :dfn:`digest` of the concatenation of the data fed to it so far using the :meth:`digest()` or :meth:`hexdigest()` methods." -msgstr "" +msgid "" +"There is one constructor method named for each type of :dfn:`hash`. All " +"return a hash object with the same simple interface. For example: " +"use :func:`sha256` to create a SHA-256 hash object. You can now feed this " +"object with :term:`bytes-like objects ` " +"(normally :class:`bytes`) using the :meth:`update` method. At " +"any point you can ask it for the :dfn:`digest` of the concatenation of the " +"data fed to it so far using the :meth:`digest()` " +"or :meth:`hexdigest()` methods." +msgstr "" +"برای هر نوع :dfn:`هش `، یک متد سازنده با همان نام وجود دارد. همه آن‌ها " +"یک شیء هش با رابط ساده یکسان برمی‌گردانند. برای مثال: از :func:`sha256` برای " +"ایجاد یک شیء هش SHA-256 استفاده کنید. اکنون می‌توانید با استفاده از " +"متد :meth:`update`، این شیء را با :term:`اشیاء شبه‌بایت " +"` (به‌طور معمول :class:`bytes`) تغذیه کنید. در هر زمان " +"می‌توانید با استفاده از متدهای :meth:`digest()` " +"یا :meth:`hexdigest()`، :dfn:`چکیده ` حاصل از الحاق " +"داده‌هایی که تاکنون به آن داده شده است را از آن بخواهید." -msgid "To allow multithreading, the Python :term:`GIL` is released while computing a hash supplied more than 2047 bytes of data at once in its constructor or :meth:`.update` method." +msgid "" +"To allow multithreading, the Python :term:`GIL` is released while computing " +"a hash supplied more than 2047 bytes of data at once in its constructor " +"or :meth:`.update` method." msgstr "" +"برای امکان‌پذیر کردن چندنخی، :term:`GIL` پایتون هنگام محاسبه‌ی هشی که بیش از " +"۲۰۴۷ بایت داده را به‌صورت یک‌جا در سازنده یا متد :meth:`.update` " +"خود دریافت کرده است، آزاد می‌شود." -msgid "Constructors for hash algorithms that are always present in this module are :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:`blake2s`. :func:`md5` is normally available as well, though it may be missing or blocked if you are using a rare \"FIPS compliant\" build of Python. These correspond to :data:`algorithms_guaranteed`." -msgstr "" +msgid "" +"Constructors for hash algorithms that are always present in this module " +"are :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, " +"and :func:`blake2s`. :func:`md5` is normally available as well, though it " +"may be missing or blocked if you are using a rare \"FIPS compliant\" build " +"of Python. These correspond to :data:`algorithms_guaranteed`." +msgstr "" +"سازنده‌هایی برای الگوریتم‌های هش که همیشه در این ماژول موجود هستند، عبارت‌اند " +"از :func:`sha1`، :func:`sha224`، :func:`sha256`، :func:`sha384`، :func:`sha512`، :func:`sha3_224`، :func:`sha3_256`، :func:`sha3_384`، :func:`sha3_512`، :func:`shake_128`، :func:`shake_256`، :func:`blake2b` " +"و :func:`blake2s`. :func:`md5` نیز معمولاً در دسترس است، هرچند اگر از یک " +"نسخه‌ی ساخت نادر «سازگار با FIPS» پایتون استفاده می‌کنید، ممکن است وجود " +"نداشته باشد یا مسدود شده باشد. این موارد با :data:`algorithms_guaranteed` " +"متناظر هستند." -msgid "Additional algorithms may also be available if your Python distribution's :mod:`!hashlib` was linked against a build of OpenSSL that provides others. Others *are not guaranteed available* on all installations and will only be accessible by name via :func:`new`. See :data:`algorithms_available`." -msgstr "" +msgid "" +"Additional algorithms may also be available if your Python " +"distribution's :mod:`!hashlib` was linked against a build of OpenSSL that " +"provides others. Others *are not guaranteed available* on all installations " +"and will only be accessible by name via :func:`new`. " +"See :data:`algorithms_available`." +msgstr "" +"اگر :mod:`!hashlib` توزیع پایتون شما با ساختی از OpenSSL پیوند داده شده " +"باشد که سایر الگوریتم‌ها را فراهم کند، ممکن است الگوریتم‌های اضافی دیگری نیز " +"در دسترس باشند. سایر الگوریتم‌ها *در دسترس بودنشان در همه نصب‌ها تضمین " +"نمی‌شود* و تنها با نام از طریق :func:`new` قابل دسترسی خواهند " +"بود. :data:`algorithms_available` را ببینید." -msgid "Some algorithms have known hash collision weaknesses (including MD5 and SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-seealso`_ section at the end of this document." +msgid "" +"Some algorithms have known hash collision weaknesses (including MD5 and " +"SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the " +"`hashlib-seealso`_ section at the end of this document." msgstr "" +"برخی الگوریتم‌ها دارای ضعف‌های شناخته‌شده در برخورد هش هستند (از جمله MD5 و " +"SHA1). به `Attacks on cryptographic hash algorithms`_ و بخش `hashlib-" +"seealso`_ در پایان این سند مراجعه کنید." -msgid "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were added. :func:`blake2b` and :func:`blake2s` were added." +msgid "" +"SHA3 (Keccak) and SHAKE " +"constructors :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` " +"were added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" +"سازنده‌های SHA3 (Keccak) و SHAKE " +"یعنی :func:`sha3_224`، :func:`sha3_256`، :func:`sha3_384`، :func:`sha3_512`، :func:`shake_128` " +"و :func:`shake_256` افزوده شدند. :func:`blake2b` و :func:`blake2s` افزوده " +"شدند." -msgid "All hashlib constructors take a keyword-only argument *usedforsecurity* with default value ``True``. A false value allows the use of insecure and blocked hashing algorithms in restricted environments. ``False`` indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function." -msgstr "" +msgid "" +"All hashlib constructors take a keyword-only argument *usedforsecurity* " +"with default value ``True``. A false value allows the use of insecure and " +"blocked hashing algorithms in restricted environments. ``False`` indicates " +"that the hashing algorithm is not used in a security context, e.g. as a non-" +"cryptographic one-way compression function." +msgstr "" +"تمام سازنده‌های hashlib یک آرگومان فقط کلیدواژه‌ای *usedforsecurity* با مقدار " +"پیش‌فرض ``True`` می‌پذیرند. یک مقدار نادرست اجازه می‌دهد از الگوریتم‌های هش " +"ناامن و مسدودشده در محیط‌های محدودشده استفاده شود. ``False`` نشان می‌دهد که " +"الگوریتم هش در یک زمینه‌ی امنیتی استفاده نمی‌شود، مثلاً به‌عنوان یک تابع " +"فشرده‌سازی یک‌طرفه‌ی غیررمزنگاری." msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" +"Hashlib اکنون در صورتی که OpenSSL آن‌ها را فراهم کند، از SHA3 و SHAKE از " +"OpenSSL استفاده می‌کند." -msgid "For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL does not provide we fall back to a verified implementation from the `HACL\\* project`_." +msgid "" +"For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " +"does not provide we fall back to a verified implementation from the " +"`HACL\\* project`_." msgstr "" +"برای هر یک از الگوریتم‌های MD5، SHA1، SHA2 یا SHA3 که OpenSSL پیوندداده‌شده " +"آن‌ها را فراهم نمی‌کند، به یک پیاده‌سازی تأییدشده از `HACL\\* project`_ متوسل " +"می‌شویم." msgid "Usage" -msgstr "" +msgstr "استفاده" -msgid "To obtain the digest of the byte string ``b\"Nobody inspects the spammish repetition\"``::" +msgid "" +"To obtain the digest of the byte string ``b\"Nobody inspects the spammish " +"repetition\"``::" msgstr "" +"برای به دست آوردن خلاصه‌ی رشته‌ی بایتی ``b\"Nobody inspects the spammish " +"repetition\"``::" msgid "" ">>> import hashlib\n" @@ -80,307 +175,623 @@ msgid "" ">>> m.update(b\"Nobody inspects\")\n" ">>> m.update(b\" the spammish repetition\")\n" ">>> m.digest()\n" -"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" ">>> m.hexdigest()\n" "'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" msgstr "" +">>> import hashlib\n" +">>> m = hashlib.sha256()\n" +">>> m.update(b\"Nobody inspects\")\n" +">>> m.update(b\" the spammish repetition\")\n" +">>> m.digest()\n" +"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +">>> m.hexdigest()\n" +"'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" msgid "More condensed:" -msgstr "" +msgstr "فشرده‌تر:" msgid "Constructors" -msgstr "" +msgstr "سازنده‌ها" -msgid "Is a generic constructor that takes the string *name* of the desired algorithm as its first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer." +msgid "" +"Is a generic constructor that takes the string *name* of the desired " +"algorithm as its first parameter. It also exists to allow access to the " +"above listed hashes as well as any other algorithms that your OpenSSL " +"library may offer." msgstr "" +"یک سازنده‌ی عام است که رشته‌ی *name* الگوریتم مورد نظر را به‌عنوان نخستین " +"پارامتر خود می‌گیرد. همچنین وجود دارد تا امکان دسترسی به هش‌های فهرست‌شده در " +"بالا و نیز هر الگوریتم دیگری را که کتابخانه‌ی OpenSSL شما ممکن است ارائه دهد، " +"فراهم کند." msgid "Using :func:`new` with an algorithm name:" -msgstr "" +msgstr "استفاده از :func:`new` با نام یک الگوریتم:" -msgid "Named constructors such as these are faster than passing an algorithm name to :func:`new`." +msgid "" +"Named constructors such as these are faster than passing an algorithm name " +"to :func:`new`." msgstr "" +"سازنده‌های نام‌داری مانند این‌ها سریع‌تر از ارسال نام الگوریتم به :func:`new` " +"هستند." msgid "Attributes" -msgstr "" +msgstr "ویژگی‌ها" msgid "Hashlib provides the following constant module attributes:" -msgstr "" +msgstr "Hashlib ویژگی‌های ثابت زیر را در سطح ماژول فراهم می‌کند:" -msgid "A set containing the names of the hash algorithms guaranteed to be supported by this module on all platforms. Note that 'md5' is in this list despite some upstream vendors offering an odd \"FIPS compliant\" Python build that excludes it." +msgid "" +"A set containing the names of the hash algorithms guaranteed to be " +"supported by this module on all platforms. Note that 'md5' is in this list " +"despite some upstream vendors offering an odd \"FIPS compliant\" Python " +"build that excludes it." msgstr "" +"مجموعه‌ای شامل نام‌های الگوریتم‌های هش که تضمین شده است این ماژول در همه " +"پلتفرم‌ها از آن‌ها پشتیبانی می‌کند. توجه داشته باشید که 'md5' با وجود اینکه " +"برخی فروشندگان بالادستی یک ساخت پایتون عجیب «منطبق با FIPS» ارائه می‌کنند که " +"آن را حذف می‌کند، در این فهرست قرار دارد." -msgid "A set containing the names of the hash algorithms that are available in the running Python interpreter. These names will be recognized when passed to :func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The same algorithm may appear multiple times in this set under different names (thanks to OpenSSL)." -msgstr "" +msgid "" +"A set containing the names of the hash algorithms that are available in the " +"running Python interpreter. These names will be recognized when passed " +"to :func:`new`. :attr:`algorithms_guaranteed` will always be a subset. " +"The same algorithm may appear multiple times in this set under different " +"names (thanks to OpenSSL)." +msgstr "" +"مجموعه‌ای شامل نام‌های الگوریتم‌های هش موجود در مفسر پایتونِ در حال اجرا است. " +"این نام‌ها هنگامی که به :func:`new` ارسال شوند، شناخته خواهند " +"شد. :attr:`algorithms_guaranteed` همیشه زیرمجموعه‌ای خواهد بود. ممکن است یک " +"الگوریتم یکسان چندین بار با نام‌های مختلف در این مجموعه ظاهر شود (به لطف " +"OpenSSL)." msgid "Hash Objects" -msgstr "" +msgstr "اشیاء هش" -msgid "The following values are provided as constant attributes of the hash objects returned by the constructors:" +msgid "" +"The following values are provided as constant attributes of the hash " +"objects returned by the constructors:" msgstr "" +"مقادیر زیر به‌عنوان ویژگی‌های ثابت اشیاء هش (hash) برگردانده‌شده توسط سازنده‌ها " +"ارائه می‌شوند:" msgid "The size of the resulting hash in bytes." -msgstr "" +msgstr "اندازه‌ی هش حاصل بر حسب بایت." msgid "The internal block size of the hash algorithm in bytes." -msgstr "" +msgstr "اندازه‌ی بلوک داخلی الگوریتم هش (hash) بر حسب بایت." msgid "A hash object has the following attributes:" -msgstr "" +msgstr "یک شیء هش دارای ویژگی‌های زیر است:" -msgid "The canonical name of this hash, always lowercase and always suitable as a parameter to :func:`new` to create another hash of this type." +msgid "" +"The canonical name of this hash, always lowercase and always suitable as a " +"parameter to :func:`new` to create another hash of this type." msgstr "" +"نام کانونیکال این هش، که همیشه با حروف کوچک است و همیشه به‌عنوان پارامتری " +"برای :func:`new` جهت ایجاد هش دیگری از این نوع مناسب است." -msgid "The name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms." +msgid "" +"The name attribute has been present in CPython since its inception, but " +"until Python 3.4 was not formally specified, so may not exist on some " +"platforms." msgstr "" +"ویژگی name از ابتدای پیدایش CPython وجود داشته است، اما تا Python 3.4 به‌طور " +"رسمی مشخص نشده بود، بنابراین ممکن است در برخی پلتفرم‌ها وجود نداشته باشد." msgid "A hash object has the following methods:" -msgstr "" +msgstr "یک شیء هش دارای متدهای زیر است:" -msgid "Update the hash object with the :term:`bytes-like object`. Repeated calls are equivalent to a single call with the concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." +msgid "" +"Update the hash object with the :term:`bytes-like object`. Repeated calls " +"are equivalent to a single call with the concatenation of all the " +"arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" +"شیء هش را با :term:`bytes-like object` به‌روزرسانی کنید. فراخوانی‌های مکرر " +"معادل یک فراخوانی با الحاق همه آرگومان‌ها است: ``m.update(a); m.update(b)`` " +"معادل ``m.update(a+b)`` است." -msgid "Return the digest of the data passed to the :meth:`update` method so far. This is a bytes object of size :attr:`digest_size` which may contain bytes in the whole range from 0 to 255." +msgid "" +"Return the digest of the data passed to the :meth:`update` method so far. " +"This is a bytes object of size :attr:`digest_size` which may contain bytes " +"in the whole range from 0 to 255." msgstr "" +"چکیده‌ای از داده‌هایی که تاکنون به متد :meth:`update` ارسال شده است را " +"برمی‌گرداند. این یک شیء از نوع bytes به اندازه :attr:`digest_size` است که " +"ممکن است حاوی بایت‌هایی در کل بازه از ۰ تا ۲۵۵ باشد." -msgid "Like :meth:`digest` except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments." +msgid "" +"Like :meth:`digest` except the digest is returned as a string object of " +"double length, containing only hexadecimal digits. This may be used to " +"exchange the value safely in email or other non-binary environments." msgstr "" +"مانند :meth:`digest`، با این تفاوت که چکیده (digest) به‌صورت یک شیء رشته‌ای " +"با طولی دو برابر برگردانده می‌شود که تنها شامل ارقام مبنای شانزده است. " +"می‌توان از آن برای تبادل امن مقدار در ایمیل یا سایر محیط‌های غیردودویی " +"استفاده کرد." -msgid "Return a copy (\"clone\") of the hash object. This can be used to efficiently compute the digests of data sharing a common initial substring." +msgid "" +"Return a copy (\"clone\") of the hash object. This can be used to " +"efficiently compute the digests of data sharing a common initial substring." msgstr "" +"یک کپی («clone») از شیء هش برمی‌گرداند. می‌توان از این برای محاسبه‌ی کارآمد " +"چکیده‌های داده‌هایی که یک زیررشته‌ی آغازین مشترک دارند استفاده کرد." msgid "SHAKE variable length digests" -msgstr "" +msgstr "چکیده‌های با طول متغیر SHAKE" -msgid "The :func:`shake_128` and :func:`shake_256` algorithms provide variable length digests with length_in_bits//2 up to 128 or 256 bits of security. As such, their digest methods require a length. Maximum length is not limited by the SHAKE algorithm." +msgid "" +"The :func:`shake_128` and :func:`shake_256` algorithms provide variable " +"length digests with length_in_bits//2 up to 128 or 256 bits of security. As " +"such, their digest methods require a length. Maximum length is not limited " +"by the SHAKE algorithm." msgstr "" +"الگوریتم‌های :func:`shake_128` و :func:`shake_256` چکیده‌هایی با طول متغیر " +"فراهم می‌کنند که length_in_bits//2 آن‌ها تا ۱۲۸ یا ۲۵۶ بیت امنیت دارد. به " +"همین دلیل، متدهای digest آن‌ها نیازمند یک طول هستند. حداکثر طول توسط " +"الگوریتم SHAKE محدود نشده است." -msgid "Return the digest of the data passed to the :meth:`~hash.update` method so far. This is a bytes object of size *length* which may contain bytes in the whole range from 0 to 255." +msgid "" +"Return the digest of the data passed to the :meth:`~hash.update` method so " +"far. This is a bytes object of size *length* which may contain bytes in the " +"whole range from 0 to 255." msgstr "" +"خلاصه‌ی داده‌هایی که تاکنون به متد :meth:`~hash.update` ارسال شده‌اند را " +"برمی‌گرداند. این یک شیء bytes به اندازه‌ی *length* است که ممکن است شامل " +"بایت‌هایی در کل بازه‌ی ۰ تا ۲۵۵ باشد." -msgid "Like :meth:`digest` except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value in email or other non-binary environments." +msgid "" +"Like :meth:`digest` except the digest is returned as a string object of " +"double length, containing only hexadecimal digits. This may be used to " +"exchange the value in email or other non-binary environments." msgstr "" +"مانند :meth:`digest` است، با این تفاوت که مقدار خلاصه به‌صورت یک شیء رشته‌ای " +"با طولی دو برابر برگردانده می‌شود که فقط شامل ارقام مبنای شانزده است. می‌توان " +"از آن برای تبادل مقدار در ایمیل یا سایر محیط‌های غیردودویی استفاده کرد." msgid "Example use:" -msgstr "" +msgstr "نمونه استفاده:" msgid "File hashing" -msgstr "" +msgstr "هش‌کردن فایل" -msgid "The hashlib module provides a helper function for efficient hashing of a file or file-like object." +msgid "" +"The hashlib module provides a helper function for efficient hashing of a " +"file or file-like object." msgstr "" +"ماژول hashlib یک تابع کمکی برای هش‌کردن کارآمد یک فایل یا شیء فایل‌مانند " +"فراهم می‌کند." -msgid "Return a digest object that has been updated with contents of file object." +msgid "" +"Return a digest object that has been updated with contents of file object." msgstr "" +"یک شیء digest برمی‌گرداند که با محتوای شیء فایل به‌روزرسانی شده است." -msgid "*fileobj* must be a file-like object opened for reading in binary mode. It accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` instances, SocketIO objects from :meth:`socket.socket.makefile`, and similar. *fileobj* must be opened in blocking mode, otherwise a :exc:`BlockingIOError` may be raised." -msgstr "" +msgid "" +"*fileobj* must be a file-like object opened for reading in binary mode. It " +"accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " +"instances, SocketIO objects from :meth:`socket.socket.makefile`, and " +"similar. *fileobj* must be opened in blocking mode, otherwise " +"a :exc:`BlockingIOError` may be raised." +msgstr "" +"*fileobj* باید یک شیء فایل‌مانند باشد که برای خواندن در حالت دودویی باز شده " +"باشد. اشیای فایل حاصل از تابع توکار :func:`open`، " +"نمونه‌های :class:`~io.BytesIO`، اشیای SocketIO حاصل " +"از :meth:`socket.socket.makefile` و موارد مشابه پذیرفته می‌شوند. *fileobj* " +"باید در حالت مسدودکننده باز شده باشد، در غیر این صورت ممکن " +"است :exc:`BlockingIOError` پرتاب شود." -msgid "The function may bypass Python's I/O and use the file descriptor from :meth:`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown state after this function returns or raises. It is up to the caller to close *fileobj*." +msgid "" +"The function may bypass Python's I/O and use the file descriptor " +"from :meth:`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in " +"an unknown state after this function returns or raises. It is up to the " +"caller to close *fileobj*." msgstr "" +"این تابع ممکن است ورودی/خروجی پایتون را دور بزند و به‌طور مستقیم از توصیف‌گر " +"فایلِ حاصل از :meth:`~io.IOBase.fileno` استفاده کند. باید فرض شود که " +"*fileobj* پس از بازگشت یا پرتاب استثنا توسط این تابع، در وضعیت نامعلومی " +"قرار دارد. بستن *fileobj* بر عهده‌ی فراخواننده است." -msgid "*digest* must either be a hash algorithm name as a *str*, a hash constructor, or a callable that returns a hash object." +msgid "" +"*digest* must either be a hash algorithm name as a *str*, a hash " +"constructor, or a callable that returns a hash object." msgstr "" +"*digest* باید یکی از این موارد باشد: نام یک الگوریتم هش به‌صورت *str*، یک " +"سازنده هش، یا یک شیء فراخوان‌پذیر که یک شیء هش برمی‌گرداند." msgid "Example:" -msgstr "" +msgstr "مثال:" -msgid "Now raises a :exc:`BlockingIOError` if the file is opened in non-blocking mode. Previously, spurious null bytes were added to the digest." +msgid "" +"Now raises a :exc:`BlockingIOError` if the file is opened in non-blocking " +"mode. Previously, spurious null bytes were added to the digest." msgstr "" +"اکنون اگر فایل در حالت غیرمسدودکننده باز شده باشد، :exc:`BlockingIOError` " +"پرتاب می‌شود. پیش‌تر، بایت‌های نول کاذب به خلاصه افزوده می‌شدند." msgid "Key derivation" -msgstr "" +msgstr "اشتقاق کلید" -msgid "Key derivation and key stretching algorithms are designed for secure password hashing. Naive algorithms such as ``sha1(password)`` are not resistant against brute-force attacks. A good password hashing function must be tunable, slow, and include a `salt `_." -msgstr "" +msgid "" +"Key derivation and key stretching algorithms are designed for secure " +"password hashing. Naive algorithms such as ``sha1(password)`` are not " +"resistant against brute-force attacks. A good password hashing function " +"must be tunable, slow, and include a `salt `_." +msgstr "" +"الگوریتم‌های اشتقاق کلید و کشش کلید (key derivation and key stretching) برای " +"هش کردن امن گذرواژه طراحی شده‌اند. الگوریتم‌های ساده‌ای مانند " +"``sha1(password)`` در برابر حملات جستجوی فراگیر (brute-force) مقاوم نیستند. " +"یک تابع خوب برای هش کردن گذرواژه باید قابل‌تنظیم، کند و شامل یک `نمک (salt) " +"`_ باشد." -msgid "The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function." +msgid "" +"The function provides PKCS#5 password-based key derivation function 2. It " +"uses HMAC as pseudorandom function." msgstr "" +"این تابع، تابع استخراج کلید مبتنی بر گذرواژه PKCS#5 نسخه 2 را فراهم می‌کند. " +"این تابع از HMAC به‌عنوان تابع شبه‌تصادفی استفاده می‌کند." -msgid "The string *hash_name* is the desired name of the hash digest algorithm for HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as buffers of bytes. Applications and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`." -msgstr "" +msgid "" +"The string *hash_name* is the desired name of the hash digest algorithm for " +"HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " +"buffers of bytes. Applications and libraries should limit *password* to a " +"sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a " +"proper source, e.g. :func:`os.urandom`." +msgstr "" +"رشته *hash_name* نام موردنظر الگوریتم خلاصه‌سازی هش برای HMAC است، برای مثال " +"'sha1' یا 'sha256'. *password* و *salt* به‌عنوان بافرهایی از بایت‌ها تفسیر " +"می‌شوند. برنامه‌ها و کتابخانه‌ها باید *password* را به یک طول معقول محدود کنند " +"(برای مثال ۱۰۲۴). *salt* باید حدود ۱۶ بایت یا بیشتر از یک منبع مناسب باشد، " +"برای مثال :func:`os.urandom`." -msgid "The number of *iterations* should be chosen based on the hash algorithm and computing power. As of 2022, hundreds of thousands of iterations of SHA-256 are suggested. For rationale as to why and how to choose what is best for your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on the `stackexchange pbkdf2 iterations question`_ explain in detail." -msgstr "" +msgid "" +"The number of *iterations* should be chosen based on the hash algorithm and " +"computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " +"are suggested. For rationale as to why and how to choose what is best for " +"your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on " +"the `stackexchange pbkdf2 iterations question`_ explain in detail." +msgstr "" +"تعداد *تکرارها* باید بر اساس الگوریتم هش و توان محاسباتی انتخاب شود. از سال " +"۲۰۲۲، صدها هزار تکرار از SHA-256 پیشنهاد می‌شود. برای درک دلیل و شیوه انتخاب " +"بهترین گزینه برای برنامه‌تان، *پیوست A.2.2* از NIST-SP-800-132_ را بخوانید. " +"پاسخ‌های موجود در `stackexchange pbkdf2 iterations question`_ به‌تفصیل توضیح " +"داده‌اند." -msgid "*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." +msgid "" +"*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` " +"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " +"SHA-512." msgstr "" +"*dklen* طول کلید مشتق‌شده بر حسب بایت است. اگر *dklen* برابر ``None`` باشد، " +"از اندازه‌ی چکیده‌ی الگوریتم هش *hash_name* استفاده می‌شود، مثلاً ۶۴ برای " +"SHA-512." msgid "Function only available when Python is compiled with OpenSSL." -msgstr "" +msgstr "تابع تنها زمانی در دسترس است که پایتون با OpenSSL کامپایل شده باشد." -msgid "Function now only available when Python is built with OpenSSL. The slow pure Python implementation has been removed." +msgid "" +"Function now only available when Python is built with OpenSSL. The slow " +"pure Python implementation has been removed." msgstr "" +"تابع اکنون تنها زمانی در دسترس است که پایتون با OpenSSL ساخته شده باشد. " +"پیاده‌سازی کندِ پایتون خالص حذف شده است." -msgid "The function provides scrypt password-based key derivation function as defined in :rfc:`7914`." +msgid "" +"The function provides scrypt password-based key derivation function as " +"defined in :rfc:`7914`." msgstr "" +"این تابع، تابع استخراج کلید مبتنی بر گذرواژه‌ی scrypt را همان‌گونه که " +"در :rfc:`7914` تعریف‌شده است، فراهم می‌کند." -msgid "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible length (e.g. 1024). *salt* should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`." +msgid "" +"*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " +"length (e.g. 1024). *salt* should be about 16 or more bytes from a proper " +"source, e.g. :func:`os.urandom`." msgstr "" +"*password* و *salt* باید :term:`اشیاء شبه‌بایت (bytes-like object) ` باشند. برنامه‌ها و کتابخانه‌ها باید *password* را به یک طول " +"معقول محدود کنند (برای مثال ۱۰۲۴). *salt* باید حدود ۱۶ بایت یا بیشتر از یک " +"منبع مناسب باشد، برای مثال :func:`os.urandom`." -msgid "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). *dklen* is the length of the derived key in bytes." +msgid "" +"*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " +"factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " +"*dklen* is the length of the derived key in bytes." msgstr "" +"*n* عامل هزینه‌ی CPU/حافظه است، *r* اندازه‌ی بلوک، *p* عامل موازی‌سازی و " +"*maxmem* حافظه را محدود می‌کند (مقدار پیش‌فرض در OpenSSL 1.1.0 برابر ۳۲ MiB " +"است). *dklen* طول کلید مشتق‌شده بر حسب بایت است." msgid "BLAKE2" -msgstr "" +msgstr "BLAKE2" -msgid "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes in two flavors:" +msgid "" +"BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " +"in two flavors:" msgstr "" +"BLAKE2_ یک تابع هش رمزنگاری تعریف‌شده در :rfc:`7693` است که در دو گونه ارائه " +"می‌شود:" -msgid "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes," +msgid "" +"**BLAKE2b**, optimized for 64-bit platforms and produces digests of any " +"size between 1 and 64 bytes," msgstr "" +"**BLAKE2b**، برای سکوهای ۶۴ بیتی بهینه‌سازی شده است و خلاصه‌هایی با هر " +"اندازه‌ای بین ۱ تا ۶۴ بایت تولید می‌کند،" -msgid "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of any size between 1 and 32 bytes." +msgid "" +"**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " +"any size between 1 and 32 bytes." msgstr "" +"**BLAKE2s**، برای پلتفرم‌های ۸ تا ۳۲ بیتی بهینه‌سازی شده است و خلاصه‌هایی در " +"هر اندازه‌ای بین ۱ تا ۳۲ بایت تولید می‌کند." -msgid "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), **salted hashing**, **personalization**, and **tree hashing**." +msgid "" +"BLAKE2 supports **keyed mode** (a faster and simpler replacement for " +"HMAC_), **salted hashing**, **personalization**, and **tree hashing**." msgstr "" +"BLAKE2 از **حالت کلیددار** (جایگزینی سریع‌تر و ساده‌تر برای HMAC_)، **هش " +"نمک‌دار**، **شخصی‌سازی** و **هش درختی** پشتیبانی می‌کند." -msgid "Hash objects from this module follow the API of standard library's :mod:`!hashlib` objects." +msgid "" +"Hash objects from this module follow the API of standard library's :mod:`!" +"hashlib` objects." msgstr "" +"اشیای هش این ماژول از API اشیای :mod:`!hashlib` در کتابخانه استاندارد پیروی " +"می‌کنند." msgid "Creating hash objects" -msgstr "" +msgstr "ایجاد اشیای هش" msgid "New hash objects are created by calling constructor functions:" -msgstr "" +msgstr "اشیای هش جدید با فراخوانی توابع سازنده ایجاد می‌شوند:" -msgid "These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters:" +msgid "" +"These functions return the corresponding hash objects for calculating " +"BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" +"این توابع، اشیای هش متناظر برای محاسبه‌ی BLAKE2b یا BLAKE2s را برمی‌گردانند. " +"آن‌ها به‌اختیار این پارامترهای عمومی را می‌پذیرند:" -msgid "*data*: initial chunk of data to hash, which must be :term:`bytes-like object`. It can be passed only as positional argument." +msgid "" +"*data*: initial chunk of data to hash, which must be :term:`bytes-like " +"object`. It can be passed only as positional argument." msgstr "" +"*data*: تکه‌ی اولیه‌ای از داده برای هش کردن، که باید یک :term:`bytes-like " +"object` باشد. این آرگومان فقط می‌تواند به‌عنوان آرگومان جایگاهی ارسال شود." msgid "*digest_size*: size of output digest in bytes." -msgstr "" +msgstr "*digest_size*: اندازه‌ی چکیده‌ی خروجی (digest) بر حسب بایت." -msgid "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for BLAKE2s)." +msgid "" +"*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes " +"for BLAKE2s)." msgstr "" +"*key*: کلید برای هش کلیددار (تا ۶۴ بایت برای BLAKE2b، تا ۳۲ بایت برای " +"BLAKE2s)." -msgid "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s)." +msgid "" +"*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " +"bytes for BLAKE2s)." msgstr "" +"*salt*: نمک برای هش‌سازی تصادفی (تا ۱۶ بایت برای BLAKE2b، تا ۸ بایت برای " +"BLAKE2s)." -msgid "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s)." +msgid "" +"*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " +"for BLAKE2s)." msgstr "" +"*person*: رشته‌ی شخصی‌سازی (تا ۱۶ بایت برای BLAKE2b و تا ۸ بایت برای BLAKE2s)." msgid "The following table shows limits for general parameters (in bytes):" -msgstr "" +msgstr "جدول زیر محدودیت‌های پارامترهای عمومی (بر حسب بایت) را نشان می‌دهد:" msgid "Hash" -msgstr "" +msgstr "هش" msgid "digest_size" -msgstr "" +msgstr "digest_size" msgid "len(key)" -msgstr "" +msgstr "len(key)" msgid "len(salt)" -msgstr "" +msgstr "len(salt)" msgid "len(person)" -msgstr "" +msgstr "len(person)" msgid "BLAKE2b" -msgstr "" +msgstr "BLAKE2b" msgid "64" -msgstr "" +msgstr "64" msgid "16" -msgstr "" +msgstr "16" msgid "BLAKE2s" -msgstr "" +msgstr "BLAKE2s" msgid "32" -msgstr "" +msgstr "32" msgid "8" -msgstr "" +msgstr "8" -msgid "BLAKE2 specification defines constant lengths for salt and personalization parameters, however, for convenience, this implementation accepts byte strings of any size up to the specified length. If the length of the parameter is less than specified, it is padded with zeros, thus, for example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not the case for *key*.)" -msgstr "" +msgid "" +"BLAKE2 specification defines constant lengths for salt and personalization " +"parameters, however, for convenience, this implementation accepts byte " +"strings of any size up to the specified length. If the length of the " +"parameter is less than specified, it is padded with zeros, thus, for " +"example, ``b'salt'`` and ``b'salt\\x00'`` is the same value. (This is not " +"the case for *key*.)" +msgstr "" +"مشخصات BLAKE2 طول‌های ثابتی را برای پارامترهای salt و personalization تعریف " +"می‌کند؛ با این حال، این پیاده‌سازی برای سهولت، رشته‌های بایتی با هر اندازه‌ای " +"تا طول مشخص‌شده را می‌پذیرد. اگر طول پارامتر کمتر از طول مشخص‌شده باشد، با صفر " +"پر می‌شود؛ بنابراین، برای مثال، ``b'salt'`` و ``b'salt\\x00'`` مقدار یکسانی " +"هستند. (این موضوع برای *key* صدق نمی‌کند.)" msgid "These sizes are available as module `constants`_ described below." msgstr "" +"این اندازه‌ها به‌عنوان ثابت‌های ماژول `constants`_ که در زیر توضیح داده " +"شده‌اند، در دسترس هستند." -msgid "Constructor functions also accept the following tree hashing parameters:" +msgid "" +"Constructor functions also accept the following tree hashing parameters:" msgstr "" +"توابع سازنده همچنین پارامترهای هش‌سازی درختی (tree hashing) زیر را می‌پذیرند:" msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" +"*fanout*: fanout (۰ تا ۲۵۵، ۰ در صورت نامحدود بودن، ۱ در حالت ترتیبی)." -msgid "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential mode)." +msgid "" +"*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " +"mode)." msgstr "" +"*depth*: حداکثر عمق درخت (۱ تا ۲۵۵، ۲۵۵ اگر نامحدود باشد، ۱ در حالت متوالی)." -msgid "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited or in sequential mode)." +msgid "" +"*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " +"or in sequential mode)." msgstr "" +"*leaf_size*: حداکثر طول بایتی برگ (۰ تا ``2**32-1``، ۰ اگر نامحدود یا در " +"حالت ترتیبی)." -msgid "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." +msgid "" +"*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " +"for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" +"*node_offset*: آفست گره (node offset) (۰ تا ``2**64-1`` برای BLAKE2b، ۰ تا " +"``2**48-1`` برای BLAKE2s، ۰ برای اولین برگ سمت چپ، یا در حالت ترتیبی)." -msgid "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." -msgstr "" +msgid "" +"*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." +msgstr "*node_depth*: عمق گره (۰ تا ۲۵۵، ۰ برای برگ‌ها، یا در حالت ترتیبی)." -msgid "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 in sequential mode)." +msgid "" +"*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, " +"0 in sequential mode)." msgstr "" +"*inner_size*: اندازه‌ی digest داخلی (۰ تا ۶۴ برای BLAKE2b، ۰ تا ۳۲ برای " +"BLAKE2s، ۰ در حالت ترتیبی)." -msgid "*last_node*: boolean indicating whether the processed node is the last one (``False`` for sequential mode)." +msgid "" +"*last_node*: boolean indicating whether the processed node is the last one " +"(``False`` for sequential mode)." msgstr "" +"*last_node*: بولی که نشان می‌دهد گره پردازش‌شده آخرین گره است (در حالت ترتیبی " +"``False``)." msgid "Explanation of tree mode parameters." -msgstr "" +msgstr "توضیح پارامترهای حالت درختی." -msgid "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." +msgid "" +"See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" +"برای بررسی جامع هش درختی، بخش 2.10 در `BLAKE2 specification `_ را ببینید." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" msgid "Salt length (maximum length accepted by constructors)." -msgstr "" +msgstr "طول نمک (salt) (حداکثر طول پذیرفته‌شده توسط سازنده‌ها)." -msgid "Personalization string length (maximum length accepted by constructors)." -msgstr "" +msgid "" +"Personalization string length (maximum length accepted by constructors)." +msgstr "طول رشته‌ی شخصی‌سازی (بیشینه طول پذیرفته‌شده توسط سازنده‌ها)." msgid "Maximum key size." -msgstr "" +msgstr "حداکثر اندازه کلید." msgid "Maximum digest size that the hash function can output." -msgstr "" +msgstr "حداکثر اندازه‌ی چکیده (digest) که تابع هش می‌تواند خروجی بدهد." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Simple hashing" -msgstr "" +msgstr "درهم‌سازی ساده" -msgid "To calculate hash of some data, you should first construct a hash object by calling the appropriate constructor function (:func:`blake2b` or :func:`blake2s`), then update it with the data by calling :meth:`~hash.update` on the object, and, finally, get the digest out of the object by calling :meth:`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." -msgstr "" +msgid "" +"To calculate hash of some data, you should first construct a hash object by " +"calling the appropriate constructor function (:func:`blake2b` " +"or :func:`blake2s`), then update it with the data by " +"calling :meth:`~hash.update` on the object, and, finally, get the digest " +"out of the object by calling :meth:`~hash.digest` " +"(or :meth:`~hash.hexdigest` for hex-encoded string)." +msgstr "" +"برای محاسبه‌ی هش برخی داده‌ها، باید ابتدا یک شیء هش را با فراخوانی تابع کارخانه‌ایٔ " +"مناسب (:func:`blake2b` یا :func:`blake2s`) بسازید، سپس با " +"فراخوانی :meth:`~hash.update` روی شیء، آن را با داده‌ها به‌روزرسانی کنید و در " +"نهایت، مقدار خلاصه را با فراخوانی :meth:`~hash.digest` از شیء بگیرید (یا " +"برای رشته‌ی کدگذاری‌شده به‌صورت مبنای شانزده، :meth:`~hash.hexdigest` را " +"فراخوانی کنید)." -msgid "As a shortcut, you can pass the first chunk of data to update directly to the constructor as the positional argument:" +msgid "" +"As a shortcut, you can pass the first chunk of data to update directly to " +"the constructor as the positional argument:" msgstr "" +"به‌عنوان یک میان‌بر، می‌توانید اولین تکه داده را برای به‌روزرسانی مستقیماً " +"به‌عنوان آرگومان جایگاهی به سازنده ارسال کنید:" -msgid "You can call :meth:`hash.update` as many times as you need to iteratively update the hash:" +msgid "" +"You can call :meth:`hash.update` as many times as you need to iteratively " +"update the hash:" msgstr "" +"می‌توانید :meth:`hash.update` را هر چند بار که نیاز دارید برای به‌روزرسانی " +"تدریجی هش فراخوانی کنید:" msgid "Using different digest sizes" -msgstr "" +msgstr "استفاده از اندازه‌های مختلف چکیده (digest)" -msgid "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" +msgid "" +"BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up " +"to 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " +"changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" +"BLAKE2 دارای اندازه‌ی قابل‌پیکربندی برای خلاصه‌ها است، تا ۶۴ بایت برای BLAKE2b " +"و تا ۳۲ بایت برای BLAKE2s. برای مثال، برای جایگزینی SHA-1 با BLAKE2b بدون " +"تغییر اندازه‌ی خروجی، می‌توانیم به BLAKE2b بگوییم خلاصه‌های ۲۰ بایتی تولید کند:" -msgid "Hash objects with different digest sizes have completely different outputs (shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s produce different outputs even if the output length is the same:" +msgid "" +"Hash objects with different digest sizes have completely different outputs " +"(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " +"produce different outputs even if the output length is the same:" msgstr "" +"اشیای هش با اندازه‌های چکیده (digest) متفاوت، خروجی‌های کاملاً متفاوتی دارند " +"(هش‌های کوتاه‌تر پیشوندهای هش‌های بلندتر *نیستند*)؛ BLAKE2b و BLAKE2s حتی اگر " +"طول خروجی یکسان باشد، خروجی‌های متفاوتی تولید می‌کنند:" msgid "Keyed hashing" -msgstr "" +msgstr "هش کلیددار (Keyed hashing)" -msgid "Keyed hashing can be used for authentication as a faster and simpler replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the indifferentiability property inherited from BLAKE." +msgid "" +"Keyed hashing can be used for authentication as a faster and simpler " +"replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-" +"MAC mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" +"هش کلیددار می‌تواند برای اصالت‌سنجی به‌عنوان جایگزینی سریع‌تر و ساده‌تر برای `کد " +"اصالت‌سنجی پیام مبتنی بر هش `_ (HMAC) " +"استفاده شود. BLAKE2 می‌تواند به‌لطف ویژگی تمایزناپذیری که از BLAKE به ارث " +"رسیده است، به‌صورت امن در حالت prefix-MAC استفاده شود." -msgid "This example shows how to get a (hex-encoded) 128-bit authentication code for message ``b'message data'`` with key ``b'pseudorandom key'``::" +msgid "" +"This example shows how to get a (hex-encoded) 128-bit authentication code " +"for message ``b'message data'`` with key ``b'pseudorandom key'``::" msgstr "" +"این مثال نشان می‌دهد که چگونه می‌توانید یک کد احراز هویت ۱۲۸ بیتی (کدگذاری‌شده " +"به مبنای شانزده) را برای پیام ``b'message data'`` با کلید ``b'pseudorandom " +"key'`` دریافت کنید::" msgid "" ">>> from hashlib import blake2b\n" @@ -389,9 +800,20 @@ msgid "" ">>> h.hexdigest()\n" "'3d363ff7401e02026f4a4687d4863ced'" msgstr "" +">>> from hashlib import blake2b\n" +">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" +">>> h.update(b'message data')\n" +">>> h.hexdigest()\n" +"'3d363ff7401e02026f4a4687d4863ced'" -msgid "As a practical example, a web application can symmetrically sign cookies sent to users and later verify them to make sure they weren't tampered with::" +msgid "" +"As a practical example, a web application can symmetrically sign cookies " +"sent to users and later verify them to make sure they weren't tampered " +"with::" msgstr "" +"به‌عنوان یک مثال عملی، یک برنامه کاربردی وب می‌تواند کوکی‌های ارسالی به " +"کاربران را به‌صورت متقارن امضا کند و بعداً آن‌ها را تأیید کند تا اطمینان حاصل " +"شود که دستکاری نشده‌اند::" msgid "" ">>> from hashlib import blake2b\n" @@ -420,9 +842,38 @@ msgid "" ">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" "False" msgstr "" +">>> from hashlib import blake2b\n" +">>> from hmac import compare_digest\n" +">>>\n" +">>> SECRET_KEY = b'pseudorandomly generated server secret key'\n" +">>> AUTH_SIZE = 16\n" +">>>\n" +">>> def sign(cookie):\n" +"... h = blake2b(digest_size=AUTH_SIZE, key=SECRET_KEY)\n" +"... h.update(cookie)\n" +"... return h.hexdigest().encode('utf-8')\n" +">>>\n" +">>> def verify(cookie, sig):\n" +"... good_sig = sign(cookie)\n" +"... return compare_digest(good_sig, sig)\n" +">>>\n" +">>> cookie = b'user-alice'\n" +">>> sig = sign(cookie)\n" +">>> print(\"{0},{1}\".format(cookie.decode('utf-8'), sig))\n" +"user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'\n" +">>> verify(cookie, sig)\n" +"True\n" +">>> verify(b'user-bob', sig)\n" +"False\n" +">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" +"False" -msgid "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used in HMAC construction with :mod:`hmac` module::" +msgid "" +"Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " +"used in HMAC construction with :mod:`hmac` module::" msgstr "" +"با وجود این‌که یک حالت هش کلیددار بومی وجود دارد، البته می‌توان از BLAKE2 در " +"ساختار HMAC با ماژول :mod:`hmac` استفاده کرد::" msgid "" ">>> import hmac, hashlib\n" @@ -431,39 +882,120 @@ msgid "" ">>> m.hexdigest()\n" "'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" msgstr "" +">>> import hmac, hashlib\n" +">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" +">>> m.update(b'message')\n" +">>> m.hexdigest()\n" +"'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" msgid "Randomized hashing" -msgstr "" +msgstr "درهم‌سازی تصادفی" -msgid "By setting *salt* parameter users can introduce randomization to the hash function. Randomized hashing is useful for protecting against collision attacks on the hash function used in digital signatures." +msgid "" +"By setting *salt* parameter users can introduce randomization to the hash " +"function. Randomized hashing is useful for protecting against collision " +"attacks on the hash function used in digital signatures." msgstr "" +"با تنظیم پارامتر *salt*، کاربران می‌توانند تصادفی‌سازی را در تابع هش اعمال " +"کنند. هش تصادفی‌شده برای محافظت در برابر حملات تصادم به تابع هش استفاده‌شده " +"در امضاهای دیجیتال مفید است." -msgid "Randomized hashing is designed for situations where one party, the message preparer, generates all or part of a message to be signed by a second party, the message signer. If the message preparer is able to find cryptographic hash function collisions (i.e., two messages producing the same hash value), then they might prepare meaningful versions of the message that would produce the same hash value and digital signature, but with different results (e.g., transferring $1,000,000 to an account, rather than $10). Cryptographic hash functions have been designed with collision resistance as a major goal, but the current concentration on attacking cryptographic hash functions may result in a given cryptographic hash function providing less collision resistance than expected. Randomized hashing offers the signer additional protection by reducing the likelihood that a preparer can generate two or more messages that ultimately yield the same hash value during the digital signature generation process --- even if it is practical to find collisions for the hash function. However, the use of randomized hashing may reduce the amount of security provided by a digital signature when all portions of the message are prepared by the signer." -msgstr "" +msgid "" +"Randomized hashing is designed for situations where one party, the message " +"preparer, generates all or part of a message to be signed by a second " +"party, the message signer. If the message preparer is able to find " +"cryptographic hash function collisions (i.e., two messages producing the " +"same hash value), then they might prepare meaningful versions of the " +"message that would produce the same hash value and digital signature, but " +"with different results (e.g., transferring $1,000,000 to an account, rather " +"than $10). Cryptographic hash functions have been designed with collision " +"resistance as a major goal, but the current concentration on attacking " +"cryptographic hash functions may result in a given cryptographic hash " +"function providing less collision resistance than expected. Randomized " +"hashing offers the signer additional protection by reducing the likelihood " +"that a preparer can generate two or more messages that ultimately yield the " +"same hash value during the digital signature generation process --- even if " +"it is practical to find collisions for the hash function. However, the use " +"of randomized hashing may reduce the amount of security provided by a " +"digital signature when all portions of the message are prepared by the " +"signer." +msgstr "" +"هش‌سازی تصادفی‌سازی‌شده (randomized hashing) برای موقعیت‌هایی طراحی شده است که " +"در آن‌ها یک طرف، یعنی تهیه‌کننده پیام، تمام یا بخشی از یک پیام را تولید می‌کند " +"تا توسط طرف دوم، یعنی امضاکننده پیام، امضا شود. اگر تهیه‌کننده پیام قادر به " +"یافتن برخوردهای تابع هش رمزنگاری باشد (یعنی دو پیام که مقدار هش یکسانی " +"تولید می‌کنند)، ممکن است نسخه‌های معناداری از پیام را تهیه کند که مقدار هش و " +"امضای دیجیتال یکسانی تولید می‌کنند، اما نتایج متفاوتی دارند (برای مثال، " +"انتقال ۱٬۰۰۰٬۰۰۰ دلار به یک حساب، به‌جای ۱۰ دلار). توابع هش رمزنگاری با هدف " +"اصلی مقاومت در برابر برخورد طراحی شده‌اند، اما تمرکز کنونی بر حملات به توابع " +"هش رمزنگاری ممکن است موجب شود که یک تابع هش رمزنگاری معین، مقاومت کمتری در " +"برابر برخورد از حد انتظار داشته باشد. هش‌سازی تصادفی‌سازی‌شده با کاهش احتمال " +"این‌که تهیه‌کننده بتواند دو یا چند پیام تولید کند که در نهایت در جریان فرآیند " +"تولید امضای دیجیتال مقدار هش یکسانی را به دست می‌دهند، محافظت بیشتری برای " +"امضاکننده فراهم می‌کند --- حتی اگر یافتن برخوردها برای تابع هش عملی باشد. با " +"این حال، هنگامی که تمام بخش‌های پیام توسط امضاکننده تهیه شده باشند، استفاده " +"از هش‌سازی تصادفی‌سازی‌شده ممکن است میزان امنیت فراهم‌شده توسط امضای دیجیتال را " +"کاهش دهد." -msgid "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" +msgid "" +"(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" msgstr "" +"(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" -msgid "In BLAKE2 the salt is processed as a one-time input to the hash function during initialization, rather than as an input to each compression function." +msgid "" +"In BLAKE2 the salt is processed as a one-time input to the hash function " +"during initialization, rather than as an input to each compression function." msgstr "" +"در BLAKE2، نمک (salt) به‌عنوان یک ورودی یک‌باره برای تابع هش در حین مقداردهی " +"اولیه پردازش می‌شود، نه به‌عنوان ورودی برای هر تابع فشرده‌سازی." -msgid "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose cryptographic hash function, such as SHA-256, is not suitable for hashing passwords. See `BLAKE2 FAQ `_ for more information." +msgid "" +"*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " +"cryptographic hash function, such as SHA-256, is not suitable for hashing " +"passwords. See `BLAKE2 FAQ `_ for more " +"information." msgstr "" +"*هش نمک‌دار* (یا فقط هش) با BLAKE2 یا هر تابع هش رمزنگاری عمومی دیگری، مانند " +"SHA-256، برای هش کردن گذرواژه‌ها مناسب نیست. برای اطلاعات بیشتر `BLAKE2 FAQ " +"`_ را ببینید." msgid "Personalization" -msgstr "" +msgstr "شخصی‌سازی" -msgid "Sometimes it is useful to force hash function to produce different digests for the same input for different purposes. Quoting the authors of the Skein hash function:" +msgid "" +"Sometimes it is useful to force hash function to produce different digests " +"for the same input for different purposes. Quoting the authors of the Skein " +"hash function:" msgstr "" +"گاهی مفید است که تابع هش را وادار کنیم تا برای یک ورودی یکسان، چکیده‌های " +"متفاوتی را برای اهداف مختلف تولید کند. به نقل از نویسندگان تابع هش Skein:" -msgid "We recommend that all application designers seriously consider doing this; we have seen many protocols where a hash that is computed in one part of the protocol can be used in an entirely different part because two hash computations were done on similar or related data, and the attacker can force the application to make the hash inputs the same. Personalizing each hash function used in the protocol summarily stops this type of attack." -msgstr "" +msgid "" +"We recommend that all application designers seriously consider doing this; " +"we have seen many protocols where a hash that is computed in one part of " +"the protocol can be used in an entirely different part because two hash " +"computations were done on similar or related data, and the attacker can " +"force the application to make the hash inputs the same. Personalizing each " +"hash function used in the protocol summarily stops this type of attack." +msgstr "" +"توصیه می‌کنیم همه‌ی طراحان برنامه به‌جدی انجام این کار را در نظر بگیرند؛ ما " +"پروتکل‌های زیادی دیده‌ایم که در آن‌ها هشی که در بخشی از پروتکل محاسبه می‌شود، " +"می‌تواند در بخشی کاملاً متفاوت استفاده شود، زیرا دو محاسبه‌ی هش روی داده‌های " +"مشابه یا مرتبط انجام شده است و مهاجم می‌تواند برنامه را مجبور کند ورودی‌های " +"هش را یکسان کند. شخصی‌سازی هر تابع هش استفاده‌شده در پروتکل، این نوع حمله را " +"به‌طور قاطع متوقف می‌سازد." -msgid "(`The Skein Hash Function Family `_, p. 21)" +msgid "" +"(`The Skein Hash Function Family `_, p. 21)" msgstr "" +"(`The Skein Hash Function Family `_، ص. ۲۱)" msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" -msgstr "" +msgstr "می‌توان BLAKE2 را با ارسال بایت‌ها به آرگومان *person* شخصی‌سازی کرد::" msgid "" ">>> from hashlib import blake2b\n" @@ -478,24 +1010,46 @@ msgid "" ">>> h.hexdigest()\n" "'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" msgstr "" +">>> from hashlib import blake2b\n" +">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" +">>> BLOCK_HASH_PERSON = b'MyApp Block Hash'\n" +">>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'\n" +">>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" -msgid "Personalization together with the keyed mode can also be used to derive different keys from a single one." +msgid "" +"Personalization together with the keyed mode can also be used to derive " +"different keys from a single one." msgstr "" +"شخصی‌سازی به همراه حالت کلیددار (keyed mode) همچنین می‌تواند برای استخراج " +"کلیدهای مختلف از یک کلید واحد استفاده شود." msgid "Tree mode" -msgstr "" +msgstr "حالت درختی" msgid "Here's an example of hashing a minimal tree with two leaf nodes::" -msgstr "" +msgstr "در اینجا مثالی از هش کردن یک درخت کمینه با دو گره برگ آورده شده است::" msgid "" " 10\n" " / \\\n" "00 01" msgstr "" +" 10\n" +" / \\\n" +"00 01" -msgid "This example uses 64-byte internal digests, and returns the 32-byte final digest::" +msgid "" +"This example uses 64-byte internal digests, and returns the 32-byte final " +"digest::" msgstr "" +"این مثال از خلاصه‌های داخلی ۶۴ بایتی استفاده می‌کند و خلاصه نهایی ۳۲ بایتی را " +"برمی‌گرداند::" msgid "" ">>> from hashlib import blake2b\n" @@ -524,96 +1078,175 @@ msgid "" ">>> h10.hexdigest()\n" "'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" msgstr "" +">>> from hashlib import blake2b\n" +">>>\n" +">>> FANOUT = 2\n" +">>> DEPTH = 2\n" +">>> LEAF_SIZE = 4096\n" +">>> INNER_SIZE = 64\n" +">>>\n" +">>> buf = bytearray(6000)\n" +">>>\n" +">>> # Left leaf\n" +"... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=0, last_node=False)\n" +">>> # Right leaf\n" +"... h01 = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=1, node_depth=0, last_node=True)\n" +">>> # Root node\n" +"... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=1, last_node=True)\n" +">>> h10.update(h00.digest())\n" +">>> h10.update(h01.digest())\n" +">>> h10.hexdigest()\n" +"'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" msgid "Credits" -msgstr "" +msgstr "دست‌اندرکاران" -msgid "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and *Raphael C.-W. Phan*." +msgid "" +"BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " +"Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " +"created by *Jean-Philippe Aumasson*, *Luca Henzen*, *Willi Meier*, and " +"*Raphael C.-W. Phan*." msgstr "" +"BLAKE2_ توسط *Jean-Philippe Aumasson*، *Samuel Neves*، *Zooko Wilcox-" +"O'Hearn* و *Christian Winnerlein* بر اساس BLAKE_، فینالیست SHA-3_، که توسط " +"*Jean-Philippe Aumasson*، *Luca Henzen*، *Willi Meier* و *Raphael C.-W. " +"Phan* ایجاد شده بود، طراحی شد." -msgid "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. Bernstein*." +msgid "" +"It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " +"Bernstein*." msgstr "" +"این از الگوریتم اصلی رمز ChaCha_ استفاده می‌کند که توسط *Daniel J. " +"Bernstein* طراحی شده است." -msgid "The stdlib implementation is based on pyblake2_ module. It was written by *Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." +msgid "" +"The stdlib implementation is based on pyblake2_ module. It was written by " +"*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " +"documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" +"پیاده‌سازی کتابخانه‌ی استاندارد بر اساس ماژول pyblake2_ است. این پیاده‌سازی " +"توسط *Dmitry Chestnykh* و بر اساس پیاده‌سازی C نوشته‌شده توسط *Samuel Neves* " +"نوشته شده است. مستندات از pyblake2_ کپی شده و توسط *Dmitry Chestnykh* نوشته " +"شده است." msgid "The C code was partly rewritten for Python by *Christian Heimes*." -msgstr "" +msgstr "کد C تا حدی برای پایتون توسط *Christian Heimes* بازنویسی شد." -msgid "The following public domain dedication applies for both C hash function implementation, extension code, and this documentation:" +msgid "" +"The following public domain dedication applies for both C hash function " +"implementation, extension code, and this documentation:" msgstr "" +"وقف‌نامه‌ی مالکیت عمومی زیر شامل پیاده‌سازی تابع هش C، کد توسعه، و این مستندات " +"می‌شود:" -msgid "To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty." +msgid "" +"To the extent possible under law, the author(s) have dedicated all " +"copyright and related and neighboring rights to this software to the public " +"domain worldwide. This software is distributed without any warranty." msgstr "" +"تا حد امکان طبق قانون، نویسنده(ها) تمامی حق نشر و حقوق مرتبط و همسایه مربوط " +"به این نرم‌افزار را به حوزه عمومی در سراسر جهان اختصاص داده‌اند. این نرم‌افزار " +"بدون هیچ‌گونه ضمانتی توزیع می‌شود." -msgid "You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see https://creativecommons.org/publicdomain/zero/1.0/." +msgid "" +"You should have received a copy of the CC0 Public Domain Dedication along " +"with this software. If not, see https://creativecommons.org/publicdomain/" +"zero/1.0/." msgstr "" +"شما باید نسخه‌ای از CC0 Public Domain Dedication را به‌همراه این نرم‌افزار " +"دریافت کرده باشید. در غیر این صورت، https://creativecommons.org/" +"publicdomain/zero/1.0/ را ببینید." -msgid "The following people have helped with development or contributed their changes to the project and the public domain according to the Creative Commons Public Domain Dedication 1.0 Universal:" +msgid "" +"The following people have helped with development or contributed their " +"changes to the project and the public domain according to the Creative " +"Commons Public Domain Dedication 1.0 Universal:" msgstr "" +"افراد زیر در توسعه کمک کرده‌اند یا تغییرات خود را به پروژه و مالکیت عمومی، " +"مطابق با Creative Commons Public Domain Dedication 1.0 Universal، اهدا " +"کرده‌اند:" msgid "*Alexandr Sokolovskiy*" -msgstr "" +msgstr "*Alexandr Sokolovskiy*" msgid "Module :mod:`hmac`" -msgstr "" +msgstr "ماژول :mod:`hmac`" msgid "A module to generate message authentication codes using hashes." -msgstr "" +msgstr "ماژولی برای تولید کدهای اصالت‌سنجی پیام با استفاده از هش‌ها." msgid "Module :mod:`base64`" -msgstr "" +msgstr "ماژول :mod:`base64`" msgid "Another way to encode binary hashes for non-binary environments." -msgstr "" +msgstr "راهی دیگر برای کدگذاری هش‌های دودویی برای محیط‌های غیردودویی." msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" -msgstr "" +msgstr "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" msgid "The FIPS 180-4 publication on Secure Hash Algorithms." msgstr "" +"انتشاریه FIPS 180-4 درباره الگوریتم‌های هش امن (Secure Hash Algorithms)." msgid "https://csrc.nist.gov/pubs/fips/202/final" -msgstr "" +msgstr "https://csrc.nist.gov/pubs/fips/202/final" msgid "The FIPS 202 publication on the SHA-3 Standard." -msgstr "" +msgstr "انتشاریه FIPS 202 درباره‌ی استاندارد SHA-3." msgid "https://www.blake2.net/" -msgstr "" +msgstr "https://www.blake2.net/" msgid "Official BLAKE2 website." -msgstr "" +msgstr "وب‌سایت رسمی BLAKE2." msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -msgstr "" +msgstr "https://fa.wikipedia.org/wiki/تابع_هش_رمزنگاری" -msgid "Wikipedia article with information on which algorithms have known issues and what that means regarding their use." +msgid "" +"Wikipedia article with information on which algorithms have known issues " +"and what that means regarding their use." msgstr "" +"مقاله‌ی ویکی‌پدیا حاوی اطلاعاتی درباره‌ی این‌که کدام الگوریتم‌ها مشکلات شناخته‌شده " +"دارند و این موضوع چه معنایی برای استفاده از آن‌ها دارد." msgid "https://www.ietf.org/rfc/rfc8018.txt" -msgstr "" +msgstr "https://www.ietf.org/rfc/rfc8018.txt" msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" -msgstr "" +msgstr "PKCS #5: مشخصات رمزنگاری مبتنی بر گذرواژه نسخه 2.1" -msgid "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" +msgid "" +"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/" +"nistspecialpublication800-132.pdf" msgstr "" +"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/" +"nistspecialpublication800-132.pdf" msgid "NIST Recommendation for Password-Based Key Derivation." -msgstr "" +msgstr "توصیه‌ی NIST برای اشتقاق کلید مبتنی بر گذرواژه." msgid "message digest, MD5" -msgstr "" +msgstr "چکیده‌ی پیام، MD5" -msgid "secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, Shake, Blake2" +msgid "" +"secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " +"Shake, Blake2" msgstr "" +"الگوریتم هش امن، SHA1، SHA2، SHA224، SHA256، SHA384، SHA512، SHA3، Shake، " +"Blake2" msgid "OpenSSL" -msgstr "" +msgstr "OpenSSL" msgid "(use in module hashlib)" -msgstr "" +msgstr "(استفاده در ماژول hashlib)" msgid "blake2b, blake2s" -msgstr "" +msgstr "blake2b, blake2s" diff --git a/library/heapq.po b/library/heapq.po index eaadbeb8d..c91893e44 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"PO-Revision-Date: 2026-08-28 08:00+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,120 +22,323 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!heapq` --- Heap queue algorithm" -msgstr "" +msgstr ":mod:`!heapq` --- الگوریتم صف پشته‌ای" msgid "**Source code:** :source:`Lib/heapq.py`" -msgstr "" +msgstr ":source:`Lib/heapq.py`" -msgid "This module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm." +msgid "" +"This module provides an implementation of the heap queue algorithm, also " +"known as the priority queue algorithm." msgstr "" +"این ماژول پیاده‌سازی‌ای از الگوریتم صف پشته‌ای (heap queue) ارائه می‌دهد، که " +"به‌عنوان الگوریتم صف اولویت نیز شناخته می‌شود." -msgid "Min-heaps are binary trees for which every parent node has a value less than or equal to any of its children. We refer to this condition as the heap invariant." +msgid "" +"Min-heaps are binary trees for which every parent node has a value less " +"than or equal to any of its children. We refer to this condition as the " +"heap invariant." msgstr "" +"هیپ‌های کمینه (min-heaps) درخت‌های دودویی هستند که در آن‌ها هر گره والد دارای " +"مقداری کوچک‌تر یا مساوی هر یک از فرزندان خود است. این شرط را ناوردای هیپ " +"(heap invariant) می‌نامیم." -msgid "For min-heaps, this implementation uses lists for which ``heap[k] <= heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k* for which the compared elements exist. Elements are counted from zero. The interesting property of a min-heap is that its smallest element is always the root, ``heap[0]``." -msgstr "" +msgid "" +"For min-heaps, this implementation uses lists for which ``heap[k] <= " +"heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k* for which the " +"compared elements exist. Elements are counted from zero. The interesting " +"property of a min-heap is that its smallest element is always the root, " +"``heap[0]``." +msgstr "" +"برای هیپ‌های کمینه (min-heaps)، این پیاده‌سازی از فهرست‌هایی استفاده می‌کند که در " +"آن‌ها ``heap[k] <= heap[2*k+1]`` و ``heap[k] <= heap[2*k+2]`` برای تمام " +"*k*\\هایی که عناصر مقایسه‌شده موجود باشند، برقرار است. عناصر از صفر شمارش " +"می‌شوند. ویژگی جالب هیپ کمینه (min-heap) این است که کوچک‌ترین عنصر آن همیشه " +"ریشه، ``heap[0]`` است." -msgid "Max-heaps satisfy the reverse invariant: every parent node has a value *greater* than any of its children. These are implemented as lists for which ``maxheap[2*k+1] <= maxheap[k]`` and ``maxheap[2*k+2] <= maxheap[k]`` for all *k* for which the compared elements exist. The root, ``maxheap[0]``, contains the *largest* element; ``heap.sort(reverse=True)`` maintains the max-heap invariant." -msgstr "" +msgid "" +"Max-heaps satisfy the reverse invariant: every parent node has a value " +"*greater* than any of its children. These are implemented as lists for " +"which ``maxheap[2*k+1] <= maxheap[k]`` and ``maxheap[2*k+2] <= maxheap[k]`` " +"for all *k* for which the compared elements exist. The root, " +"``maxheap[0]``, contains the *largest* element; ``heap.sort(reverse=True)`` " +"maintains the max-heap invariant." +msgstr "" +"پشته‌های بیشینه (max-heaps) ناوردا معکوس را برآورده می‌کنند: هر گره والد " +"مقداری *بزرگ‌تر* از هر یک از فرزندان خود دارد. این‌ها به‌صورت فهرست‌هایی " +"پیاده‌سازی شده‌اند که در آن‌ها ``maxheap[2*k+1] <= maxheap[k]`` و " +"``maxheap[2*k+2] <= maxheap[k]`` برای تمام *k*\\هایی که عناصر مقایسه‌شده موجود " +"باشند، برقرار است. ریشه، ``maxheap[0]``، شامل *بزرگ‌ترین* عنصر است؛ " +"``heap.sort(reverse=True)`` ناوردا پشته‌ی بیشینه را حفظ می‌کند." -msgid "The :mod:`!heapq` API differs from textbook heap algorithms in two aspects: (a) We use zero-based indexing. This makes the relationship between the index for a node and the indexes for its children slightly less obvious, but is more suitable since Python uses zero-based indexing. (b) Textbooks often focus on max-heaps, due to their suitability for in-place sorting. Our implementation favors min-heaps as they better correspond to Python :class:`lists `." -msgstr "" +msgid "" +"The :mod:`!heapq` API differs from textbook heap algorithms in two aspects: " +"(a) We use zero-based indexing. This makes the relationship between the " +"index for a node and the indexes for its children slightly less obvious, " +"but is more suitable since Python uses zero-based indexing. (b) Textbooks " +"often focus on max-heaps, due to their suitability for in-place sorting. " +"Our implementation favors min-heaps as they better correspond to " +"Python :class:`lists `." +msgstr "" +"API ماژول :mod:`!heapq` از دو جهت با الگوریتم‌های هیپدر کتاب‌های " +"درسی تفاوت دارد: (الف) ما از اندیس‌گذاری مبتنی بر صفر استفاده می‌کنیم. این " +"کار رابطه بین اندیس یک گره و اندیس‌های فرزندان آن را کمی کمتر بدیهی می‌کند، " +"اما از آن‌جا که پایتون از اندیس‌گذاری مبتنی بر صفر استفاده می‌کند، مناسب‌تر " +"است. (ب) کتاب‌های درسی اغلب به دلیل مناسب بودن هیپ‌های بیشینه برای مرتب‌سازی " +"درجا، بر آن‌ها تمرکز دارند. پیاده‌سازی ما هیپ‌های کمینه را ترجیح می‌دهد، زیرا " +"آن‌ها با :class:`lists ` پایتون تطابق بهتری دارند." -msgid "These two aspects make it possible to view the heap as a regular Python list without surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` maintains the heap invariant!" +msgid "" +"These two aspects make it possible to view the heap as a regular Python " +"list without surprises: ``heap[0]`` is the smallest item, and " +"``heap.sort()`` maintains the heap invariant!" msgstr "" +"این دو جنبه به شما امکان می‌دهد هیپ را به‌عنوان یک فهرست معمولی " +"پایتون بدون غافلگیری در نظر بگیرید: ``heap[0]`` کوچک‌ترین آیتم است، و " +"``heap.sort()`` ناوردایی هیپ را حفظ می‌کند!" -msgid "Like :meth:`list.sort`, this implementation uses only the ``<`` operator for comparisons, for both min-heaps and max-heaps." +msgid "" +"Like :meth:`list.sort`, this implementation uses only the ``<`` operator " +"for comparisons, for both min-heaps and max-heaps." msgstr "" +"مانند :meth:`list.sort`، این پیاده‌سازی برای مقایسه‌ها تنها از عملگر ``<`` " +"استفاده می‌کند، هم برای هیپ‌های کمینه (min-heaps) و هم برای پشته‌های بیشینه " +"(max-heaps)." -msgid "In the API below, and in this documentation, the unqualified term *heap* generally refers to a min-heap. The API for max-heaps is named using a ``_max`` suffix." +msgid "" +"In the API below, and in this documentation, the unqualified term *heap* " +"generally refers to a min-heap. The API for max-heaps is named using a " +"``_max`` suffix." msgstr "" +"در API زیر و در این مستندات، اصطلاح بدون قید *هیپ* معمولاً به یک هیپ کمینه " +"اشاره دارد. API برای هیپ‌های بیشینه با استفاده از پسوند ``_max`` نام‌گذاری شده " +"است." -msgid "To create a heap, use a list initialized as ``[]``, or transform an existing list into a min-heap or max-heap using the :func:`heapify` or :func:`heapify_max` functions, respectively." +msgid "" +"To create a heap, use a list initialized as ``[]``, or transform an " +"existing list into a min-heap or max-heap using the :func:`heapify` " +"or :func:`heapify_max` functions, respectively." msgstr "" +"برای ایجاد یک تپه ، از یک فهرست مقداردهی‌شده به‌صورت ``[]`` استفاده " +"کنید، یا یک فهرست موجود را با استفاده از توابع :func:`heapify` " +"و :func:`heapify_max`، به‌ترتیب به یک تپه کمینه یا تپه بیشینه تبدیل کنید." msgid "The following functions are provided for min-heaps:" -msgstr "" +msgstr "توابع زیر برای هیپ‌های کمینه فراهم شده‌اند:" msgid "Transform list *x* into a min-heap, in-place, in linear time." msgstr "" +"فهرست *x* را به‌صورت درجا و در زمان خطی به یک هیپ کمینه (min-heap) تبدیل " +"می‌کند." -msgid "Push the value *item* onto the *heap*, maintaining the min-heap invariant." +msgid "" +"Push the value *item* onto the *heap*, maintaining the min-heap invariant." msgstr "" +"مقدار *item* را روی *هیپ* قرار دهید، به‌طوری که ناوردا هیپ کمینه حفظ شود." -msgid "Pop and return the smallest item from the *heap*, maintaining the min-heap invariant. If the heap is empty, :exc:`IndexError` is raised. To access the smallest item without popping it, use ``heap[0]``." +msgid "" +"Pop and return the smallest item from the *heap*, maintaining the min-heap " +"invariant. If the heap is empty, :exc:`IndexError` is raised. To access " +"the smallest item without popping it, use ``heap[0]``." msgstr "" +"کوچک‌ترین آیتم را از *هیپ* بردارید و برگردانید، به‌طوری که ناوردا " +"(invariant) هیپ کمینه حفظ شود. اگر هیپ خالی باشد، :exc:`IndexError` پرتاب " +"می‌شود. برای دسترسی به کوچک‌ترین آیتم بدون برداشتن آن، از ``heap[0]`` استفاده " +"کنید." -msgid "Push *item* on the heap, then pop and return the smallest item from the *heap*. The combined action runs more efficiently than :func:`heappush` followed by a separate call to :func:`heappop`." +msgid "" +"Push *item* on the heap, then pop and return the smallest item from the " +"*heap*. The combined action runs more efficiently than :func:`heappush` " +"followed by a separate call to :func:`heappop`." msgstr "" +"*آیتم* را روی هیپقرار دهید، سپس کوچک‌ترین آیتم را از *هیپ* " +"بردارید و برگردانید. این عملیات ترکیبی، کارآمدتر از :func:`heappush` و به " +"دنبال آن فراخوانی جداگانه :func:`heappop` اجرا می‌شود." -msgid "Pop and return the smallest item from the *heap*, and also push the new *item*. The heap size doesn't change. If the heap is empty, :exc:`IndexError` is raised." +msgid "" +"Pop and return the smallest item from the *heap*, and also push the new " +"*item*. The heap size doesn't change. If the heap is " +"empty, :exc:`IndexError` is raised." msgstr "" +"کوچک‌ترین آیتم را از *هیپ* برمی‌دارد و برمی‌گرداند، و همچنین *آیتم* " +"جدید را نیز درج (push) می‌کند. اندازه‌ی هیپ تغییر نمی‌کند. اگر هیپ خالی " +"باشد، :exc:`IndexError` پرتاب می‌شود." -msgid "This one step operation is more efficient than a :func:`heappop` followed by :func:`heappush` and can be more appropriate when using a fixed-size heap. The pop/push combination always returns an element from the heap and replaces it with *item*." +msgid "" +"This one step operation is more efficient than a :func:`heappop` followed " +"by :func:`heappush` and can be more appropriate when using a fixed-size " +"heap. The pop/push combination always returns an element from the heap and " +"replaces it with *item*." msgstr "" +"این عملیات تک‌مرحله‌ای کارآمدتر از فراخوانی :func:`heappop` و " +"سپس :func:`heappush` است و می‌تواند هنگام استفاده از هپبا اندازه‌ی " +"ثابت مناسب‌تر باشد. ترکیب pop/push همیشه عنصری را از هپبرمی‌گرداند و " +"آن را با *item* جایگزین می‌کند." -msgid "The value returned may be larger than the *item* added. If that isn't desired, consider using :func:`heappushpop` instead. Its push/pop combination returns the smaller of the two values, leaving the larger value on the heap." +msgid "" +"The value returned may be larger than the *item* added. If that isn't " +"desired, consider using :func:`heappushpop` instead. Its push/pop " +"combination returns the smaller of the two values, leaving the larger value " +"on the heap." msgstr "" +"مقدار بازگشتی ممکن است بزرگ‌تر از *آیتم* اضافه‌شده باشد. اگر این مطلوب نیست، " +"در عوض استفاده از :func:`heappushpop` را در نظر بگیرید. ترکیب درج/حذف (push/" +"pop) آن کوچک‌تر بین دو مقدار را برمی‌گرداند و مقدار بزرگ‌تر را روی هیپ " +"باقی می‌گذارد." msgid "For max-heaps, the following functions are provided:" -msgstr "" +msgstr "برای پشته‌های بیشینه (max-heaps)، توابع زیر ارائه شده‌اند:" msgid "Transform list *x* into a max-heap, in-place, in linear time." msgstr "" +"فهرست *x* را به‌صورت درجا و در زمان خطی به یک هیپ بیشینه (max-heap) تبدیل " +"می‌کند." -msgid "Push the value *item* onto the max-heap *heap*, maintaining the max-heap invariant." +msgid "" +"Push the value *item* onto the max-heap *heap*, maintaining the max-heap " +"invariant." msgstr "" +"مقدار *item* را بر روی هپ بیشینه *heap* قرار دهید، به‌طوری که شرط هپ بیشینه " +"حفظ شود." -msgid "Pop and return the largest item from the max-heap *heap*, maintaining the max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised. To access the largest item without popping it, use ``maxheap[0]``." +msgid "" +"Pop and return the largest item from the max-heap *heap*, maintaining the " +"max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised. " +"To access the largest item without popping it, use ``maxheap[0]``." msgstr "" +"بزرگ‌ترین آیتم را از هیپ بیشینه (max-heap) *heap* بردارید و برگردانید، با " +"حفظ ناوردایی هیپ بیشینه. اگر هیپ بیشینه خالی باشد، :exc:`IndexError` " +"پرتاب می‌شود. برای دسترسی به بزرگ‌ترین آیتم بدون برداشتن آن، از " +"``maxheap[0]`` استفاده کنید." -msgid "Push *item* on the max-heap *heap*, then pop and return the largest item from *heap*. The combined action runs more efficiently than :func:`heappush_max` followed by a separate call to :func:`heappop_max`." +msgid "" +"Push *item* on the max-heap *heap*, then pop and return the largest item " +"from *heap*. The combined action runs more efficiently " +"than :func:`heappush_max` followed by a separate call " +"to :func:`heappop_max`." msgstr "" +"آیتم *item* را روی هیپ بیشینه‌ی *heap* قرار دهید، سپس بزرگ‌ترین آیتم را از " +"*heap* بردارید و برگردانید. این عملیات ترکیبی، کارآمدتر از " +"فراخوانی :func:`heappush_max` و سپس یک فراخوانی " +"جداگانه‌ی :func:`heappop_max` اجرا می‌شود." -msgid "Pop and return the largest item from the max-heap *heap* and also push the new *item*. The max-heap size doesn't change. If the max-heap is empty, :exc:`IndexError` is raised." +msgid "" +"Pop and return the largest item from the max-heap *heap* and also push the " +"new *item*. The max-heap size doesn't change. If the max-heap is " +"empty, :exc:`IndexError` is raised." msgstr "" +"بزرگ‌ترین آیتم را از هیپ بیشینه (max-heap) *heap* خارج می‌کند و برمی‌گرداند و " +"همچنین آیتم جدید *item* را وارد می‌کند. اندازه‌ی هیپ بیشینه تغییر نمی‌کند. اگر " +"هیپ بیشینه خالی باشد، :exc:`IndexError` پرتاب می‌شود." -msgid "The value returned may be smaller than the *item* added. Refer to the analogous function :func:`heapreplace` for detailed usage notes." +msgid "" +"The value returned may be smaller than the *item* added. Refer to the " +"analogous function :func:`heapreplace` for detailed usage notes." msgstr "" +"ممکن است مقدار برگردانده‌شده کوچک‌تر از *آیتم* افزوده‌شده باشد. برای نکات " +"تفصیلی کاربرد، به تابع مشابه :func:`heapreplace` مراجعه کنید." msgid "The module also offers three general purpose functions based on heaps." -msgstr "" +msgstr "این ماژول همچنین ۳ تابع همه‌منظوره مبتنی بر پشته‌ها ارائه می‌دهد." -msgid "Merge multiple sorted inputs into a single sorted output (for example, merge timestamped entries from multiple log files). Returns an :term:`iterator` over the sorted values." +msgid "" +"Merge multiple sorted inputs into a single sorted output (for example, " +"merge timestamped entries from multiple log files). Returns " +"an :term:`iterator` over the sorted values." msgstr "" +"چندین ورودی مرتب‌شده را در یک خروجی مرتب‌شده واحد ادغام می‌کند (برای مثال، " +"ورودی‌های دارای برچسب زمانی را از چندین فایل گزارش ادغام می‌کند). " +"یک :term:`iterator` روی مقادیر مرتب‌شده برمی‌گرداند." -msgid "Similar to ``sorted(itertools.chain(*iterables))`` but returns an iterable, does not pull the data into memory all at once, and assumes that each of the input streams is already sorted (smallest to largest)." +msgid "" +"Similar to ``sorted(itertools.chain(*iterables))`` but returns an iterable, " +"does not pull the data into memory all at once, and assumes that each of " +"the input streams is already sorted (smallest to largest)." msgstr "" +"مشابه ``sorted(itertools.chain(*iterables))`` است، اما یک پیمایش‌پذیر " +"برمی‌گرداند، داده‌ها را به‌صورت یک‌جا در حافظه بارگذاری نمی‌کند و فرض می‌کند که " +"هر یک از جریان‌های ورودی از قبل مرتب شده‌اند (از کوچک‌ترین به بزرگ‌ترین)." -msgid "Has two optional arguments which must be specified as keyword arguments." +msgid "" +"Has two optional arguments which must be specified as keyword arguments." msgstr "" +"دارای دو آرگومان اختیاری است که باید به‌صورت آرگومان‌های کلیدواژه‌ای مشخص شوند." -msgid "*key* specifies a :term:`key function` of one argument that is used to extract a comparison key from each input element. The default value is ``None`` (compare the elements directly)." +msgid "" +"*key* specifies a :term:`key function` of one argument that is used to " +"extract a comparison key from each input element. The default value is " +"``None`` (compare the elements directly)." msgstr "" +"*key* یک :term:`key function` با یک آرگومان را مشخص می‌کند که برای استخراج " +"کلید مقایسه از هر المان ورودی به کار می‌رود. مقدار پیش‌فرض ``None`` است " +"(المان‌ها مستقیماً مقایسه می‌شوند)." -msgid "*reverse* is a boolean value. If set to ``True``, then the input elements are merged as if each comparison were reversed. To achieve behavior similar to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables must be sorted from largest to smallest." +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the input elements " +"are merged as if each comparison were reversed. To achieve behavior similar " +"to ``sorted(itertools.chain(*iterables), reverse=True)``, all iterables " +"must be sorted from largest to smallest." msgstr "" +"*reverse* یک مقدار بولی است. اگر روی ``True`` تنظیم شود، آنگاه عناصر ورودی " +"به‌گونه‌ای ادغام می‌شوند که گویی هر مقایسه معکوس شده باشد. برای دستیابی به " +"رفتاری مشابه ``sorted(itertools.chain(*iterables), reverse=True)``، تمام " +"پیمایش‌پذیرها باید از بزرگ‌ترین به کوچک‌ترین مرتب شده باشند." msgid "Added the optional *key* and *reverse* parameters." -msgstr "" +msgstr "پارامترهای اختیاری *key* و *reverse* اضافه شدند." -msgid "Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is used to extract a comparison key from each element in *iterable* (for example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, reverse=True)[:n]``." -msgstr "" +msgid "" +"Return a list with the *n* largest elements from the dataset defined by " +"*iterable*. *key*, if provided, specifies a function of one argument that " +"is used to extract a comparison key from each element in *iterable* (for " +"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, " +"reverse=True)[:n]``." +msgstr "" +"فهرستی شامل *n* بزرگ‌ترین عنصر از مجموعه داده‌ی تعریف‌شده با *iterable* را " +"برمی‌گرداند. *key*، در صورت ارائه، تابعی با یک آرگومان را مشخص می‌کند که برای " +"استخراج کلید مقایسه از هر عنصر در *iterable* استفاده می‌شود (برای مثال، " +"``key=str.lower``). معادل است با: ``sorted(iterable, key=key, reverse=True)" +"[:n]``." -msgid "Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is used to extract a comparison key from each element in *iterable* (for example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:n]``." +msgid "" +"Return a list with the *n* smallest elements from the dataset defined by " +"*iterable*. *key*, if provided, specifies a function of one argument that " +"is used to extract a comparison key from each element in *iterable* (for " +"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)" +"[:n]``." msgstr "" +"فهرستی شامل *n* عنصر از کوچک‌ترین عناصر مجموعه‌داده تعریف‌شده توسط *iterable* " +"برمی‌گرداند. *key*، در صورت ارائه، تابعی با یک آرگومان را مشخص می‌کند که " +"برای استخراج کلید مقایسه از هر عنصر در *iterable* استفاده می‌شود (برای مثال، " +"``key=str.lower``). معادل است با: ``sorted(iterable, key=key)[:n]``." -msgid "The latter two functions perform best for smaller values of *n*. For larger values, it is more efficient to use the :func:`sorted` function. Also, when ``n==1``, it is more efficient to use the built-in :func:`min` and :func:`max` functions. If repeated usage of these functions is required, consider turning the iterable into an actual heap." -msgstr "" +msgid "" +"The latter two functions perform best for smaller values of *n*. For " +"larger values, it is more efficient to use the :func:`sorted` function. " +"Also, when ``n==1``, it is more efficient to use the built-in :func:`min` " +"and :func:`max` functions. If repeated usage of these functions is " +"required, consider turning the iterable into an actual heap." +msgstr "" +"دو تابع اخیر برای مقادیر کوچک‌تر *n* بهترین عملکرد را دارند. برای مقادیر " +"بزرگ‌تر، استفاده از تابع :func:`sorted` کارآمدتر است. همچنین، وقتی ``n==1`` " +"باشد، استفاده از توابع توکار :func:`min` و :func:`max` کارآمدتر است. اگر " +"استفاده‌ی مکرر از این توابع لازم است، تبدیل پیمایش‌پذیر به یک هیپ واقعی " +" را در نظر بگیرید." msgid "Basic Examples" -msgstr "" +msgstr "مثال‌های پایه" -msgid "A `heapsort `_ can be implemented by pushing all values onto a heap and then popping off the smallest values one at a time::" +msgid "" +"A `heapsort `_ can be implemented " +"by pushing all values onto a heap and then popping off the smallest values " +"one at a time::" msgstr "" +"می‌توان یک `مرتب‌سازی پشته‌ای `_ را با " +"قرار دادن همه مقادیر در یک هیپ و سپس برداشتن کوچک‌ترین مقادیر به‌صورت یکی‌یکی " +"پیاده‌سازی کرد::" msgid "" ">>> def heapsort(iterable):\n" @@ -147,12 +350,28 @@ msgid "" ">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" msgstr "" +">>> def heapsort(iterable):\n" +"... h = []\n" +"... for value in iterable:\n" +"... heappush(h, value)\n" +"... return [heappop(h) for i in range(len(h))]\n" +"...\n" +">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" -msgid "This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this implementation is not stable." +msgid "" +"This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this " +"implementation is not stable." msgstr "" +"این مشابه ``sorted(iterable)`` است، اما برخلاف :func:`sorted`، این " +"پیاده‌سازی پایدار نیست." -msgid "Heap elements can be tuples. This is useful for assigning comparison values (such as task priorities) alongside the main record being tracked::" +msgid "" +"Heap elements can be tuples. This is useful for assigning comparison " +"values (such as task priorities) alongside the main record being tracked::" msgstr "" +"عناصر هیپ می‌توانند تاپل باشند. این امر برای اختصاص مقادیر مقایسه‌ای (مانند " +"اولویت‌های وظیفه) در کنار رکورد اصلی در حال پیگیری مفید است::" msgid "" ">>> h = []\n" @@ -163,15 +382,43 @@ msgid "" ">>> heappop(h)\n" "(1, 'write spec')" msgstr "" +">>> h = []\n" +">>> heappush(h, (5, 'write code'))\n" +">>> heappush(h, (7, 'release product'))\n" +">>> heappush(h, (1, 'write spec'))\n" +">>> heappush(h, (3, 'create tests'))\n" +">>> heappop(h)\n" +"(1, 'write spec')" msgid "Other Applications" -msgstr "" +msgstr "سایر برنامه‌های کاربردی" -msgid "`Medians `_ are a measure of central tendency for a set of numbers. In distributions skewed by outliers, the median provides a more stable estimate than an average (arithmetic mean). A running median is an `online algorithm `_ that updates continuously as new data arrives." -msgstr "" +msgid "" +"`Medians `_ are a measure of central " +"tendency for a set of numbers. In distributions skewed by outliers, the " +"median provides a more stable estimate than an average (arithmetic mean). " +"A running median is an `online algorithm `_ that updates continuously as new data arrives." +msgstr "" +"`میانه‌ها `_ معیاری از " +"گرایش مرکزی برای مجموعه‌ای از اعداد هستند. در توزیع‌هایی که به‌دلیل داده‌های " +"پرت اریب‌شده‌اند، میانه برآورد پایدارتری نسبت به میانگین (میانگین حسابی) " +"ارائه می‌دهد. میانه جاری یک `الگوریتم برخط `_ است که با رسیدن داده‌های جدید به‌طور مداوم " +"به‌روزرسانی می‌شود." -msgid "A running median can be efficiently implemented by balancing two heaps, a max-heap for values at or below the midpoint and a min-heap for values above the midpoint. When the two heaps have the same size, the new median is the average of the tops of the two heaps; otherwise, the median is at the top of the larger heap::" -msgstr "" +msgid "" +"A running median can be efficiently implemented by balancing two heaps, a " +"max-heap for values at or below the midpoint and a min-heap for values " +"above the midpoint. When the two heaps have the same size, the new median " +"is the average of the tops of the two heaps; otherwise, the median is at " +"the top of the larger heap::" +msgstr "" +"می‌توان میانه‌ی جاری را به‌صورت کارآمد با متعادل‌سازی دو هیپ پیاده‌سازی کرد، یک " +"هیپ بیشینه برای مقادیر برابر با نقطه‌ی میانی یا کمتر از آن و یک هیپ کمینه " +"برای مقادیر بیشتر از نقطه‌ی میانی. هنگامی که دو هیپ اندازه‌ی یکسانی داشته " +"باشند، میانه‌ی جدید میانگین رأس‌های دو هیپ است؛ در غیر این صورت، میانه در رأس " +"هیپ بزرگ‌تر قرار دارد::" msgid "" "def running_median(iterable):\n" @@ -188,38 +435,89 @@ msgid "" " heappush(hi, heappushpop_max(lo, x))\n" " yield (lo[0] + hi[0]) / 2" msgstr "" +"def running_median(iterable):\n" +" \"Yields the cumulative median of values seen so far.\"\n" +"\n" +" lo = [] # max-heap\n" +" hi = [] # min-heap (same size as or one smaller than lo)\n" +"\n" +" for x in iterable:\n" +" if len(lo) == len(hi):\n" +" heappush_max(lo, heappushpop(hi, x))\n" +" yield lo[0]\n" +" else:\n" +" heappush(hi, heappushpop_max(lo, x))\n" +" yield (lo[0] + hi[0]) / 2" msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> list(running_median([5.0, 9.0, 4.0, 12.0, 8.0, 9.0]))\n" "[5.0, 7.0, 5.0, 7.0, 8.0, 8.5]" msgstr "" +">>> list(running_median([5.0, 9.0, 4.0, 12.0, 8.0, 9.0]))\n" +"[5.0, 7.0, 5.0, 7.0, 8.0, 8.5]" msgid "Priority Queue Implementation Notes" -msgstr "" +msgstr "یادداشت‌های پیاده‌سازی صف اولویت" -msgid "A `priority queue `_ is common use for a heap, and it presents several implementation challenges:" +msgid "" +"A `priority queue `_ is " +"common use for a heap, and it presents several implementation challenges:" msgstr "" +"یک `صف اولویت `_ " +"کاربرد رایجی برای هیپاست، و چندین چالش پیاده‌سازی به همراه دارد:" -msgid "Sort stability: how do you get two tasks with equal priorities to be returned in the order they were originally added?" +msgid "" +"Sort stability: how do you get two tasks with equal priorities to be " +"returned in the order they were originally added?" msgstr "" +"پایداری مرتب‌سازی: چگونه می‌توانید دو وظیفه با اولویت‌های برابر را به همان " +"ترتیبی که در ابتدا افزوده شده‌اند دریافت کنید؟" -msgid "Tuple comparison breaks for (priority, task) pairs if the priorities are equal and the tasks do not have a default comparison order." +msgid "" +"Tuple comparison breaks for (priority, task) pairs if the priorities are " +"equal and the tasks do not have a default comparison order." msgstr "" +"مقایسه‌ی تاپل برای جفت‌های (priority, task) در صورتی با شکست مواجه می‌شود که " +"اولویت‌ها برابر باشند و کارها ترتیب مقایسه‌ی پیش‌فرض نداشته باشند." -msgid "If the priority of a task changes, how do you move it to a new position in the heap?" +msgid "" +"If the priority of a task changes, how do you move it to a new position in " +"the heap?" msgstr "" +"اگر اولویت یک وظیفه تغییر کند، چگونه آن را به جایگاه جدیدی در هیپ جابه‌جا " +"می‌کنید؟" -msgid "Or if a pending task needs to be deleted, how do you find it and remove it from the queue?" +msgid "" +"Or if a pending task needs to be deleted, how do you find it and remove it " +"from the queue?" msgstr "" +"یا اگر یک وظیفه‌ی در انتظار باید حذف شود، چگونه آن را پیدا می‌کنید و از صف " +"حذف می‌کنید؟" -msgid "A solution to the first two challenges is to store entries as 3-element list including the priority, an entry count, and the task. The entry count serves as a tie-breaker so that two tasks with the same priority are returned in the order they were added. And since no two entry counts are the same, the tuple comparison will never attempt to directly compare two tasks." -msgstr "" +msgid "" +"A solution to the first two challenges is to store entries as 3-element " +"list including the priority, an entry count, and the task. The entry count " +"serves as a tie-breaker so that two tasks with the same priority are " +"returned in the order they were added. And since no two entry counts are " +"the same, the tuple comparison will never attempt to directly compare two " +"tasks." +msgstr "" +"راه‌حلی برای دو چالش نخست این است که ورودی‌ها به‌صورت فهرست‌های ۳‌عنصری شامل " +"اولویت، شماره‌ی ورودی و وظیفه ذخیره شوند. شماره‌ی ورودی به‌عنوان عامل تساوی‌شکن عمل " +"می‌کند تا دو وظیفه با اولویت یکسان به همان ترتیبی که اضافه شده‌اند برگردانده " +"شوند. و از آن‌جا که هیچ دو شماره‌ی ورودی‌ای یکسان نیستند، مقایسه‌ی تاپل هرگز تلاش " +"نمی‌کند دو وظیفه را مستقیماً مقایسه کند." -msgid "Another solution to the problem of non-comparable tasks is to create a wrapper class that ignores the task item and only compares the priority field::" +msgid "" +"Another solution to the problem of non-comparable tasks is to create a " +"wrapper class that ignores the task item and only compares the priority " +"field::" msgstr "" +"راه‌حل دیگر برای مشکل وظایف غیرقابل‌مقایسه، ایجاد یک کلاس پوششی است که آیتم " +"وظیفه را نادیده می‌گیرد و فقط فیلد اولویت را مقایسه می‌کند::" msgid "" "from dataclasses import dataclass, field\n" @@ -230,12 +528,31 @@ msgid "" " priority: int\n" " item: Any=field(compare=False)" msgstr "" +"from dataclasses import dataclass, field\n" +"from typing import Any\n" +"\n" +"@dataclass(order=True)\n" +"class PrioritizedItem:\n" +" priority: int\n" +" item: Any=field(compare=False)" -msgid "The remaining challenges revolve around finding a pending task and making changes to its priority or removing it entirely. Finding a task can be done with a dictionary pointing to an entry in the queue." +msgid "" +"The remaining challenges revolve around finding a pending task and making " +"changes to its priority or removing it entirely. Finding a task can be " +"done with a dictionary pointing to an entry in the queue." msgstr "" +"چالش‌های باقی‌مانده حول یافتن یک وظیفه‌ی در انتظار و ایجاد تغییرات در اولویت " +"آن یا حذف کامل آن می‌چرخند. یافتن یک وظیفه را می‌توان با دیکشنری‌ای که به یک " +"ورودی در صف اشاره می‌کند، انجام داد." -msgid "Removing the entry or changing its priority is more difficult because it would break the heap structure invariants. So, a possible solution is to mark the entry as removed and add a new entry with the revised priority::" +msgid "" +"Removing the entry or changing its priority is more difficult because it " +"would break the heap structure invariants. So, a possible solution is to " +"mark the entry as removed and add a new entry with the revised priority::" msgstr "" +"حذف ورودی یا تغییر اولویت آن دشوارتر است، زیرا باعث نقض ناورداهای ساختار " +"هیپمی‌شود. بنابراین، یک راه‌حل ممکن این است که ورودی را به‌عنوان " +"حذف‌شده علامت‌گذاری کنید و ورودی جدیدی با اولویت اصلاح‌شده اضافه کنید::" msgid "" "pq = [] # list of entries arranged in a heap\n" @@ -266,15 +583,54 @@ msgid "" " return task\n" " raise KeyError('pop from an empty priority queue')" msgstr "" +"pq = [] # list of entries arranged in a heap\n" +"entry_finder = {} # mapping of tasks to entries\n" +"REMOVED = '' # placeholder for a removed task\n" +"counter = itertools.count() # unique sequence count\n" +"\n" +"def add_task(task, priority=0):\n" +" 'Add a new task or update the priority of an existing task'\n" +" if task in entry_finder:\n" +" remove_task(task)\n" +" count = next(counter)\n" +" entry = [priority, count, task]\n" +" entry_finder[task] = entry\n" +" heappush(pq, entry)\n" +"\n" +"def remove_task(task):\n" +" 'Mark an existing task as REMOVED. Raise KeyError if not found.'\n" +" entry = entry_finder.pop(task)\n" +" entry[-1] = REMOVED\n" +"\n" +"def pop_task():\n" +" 'Remove and return the lowest priority task. Raise KeyError if empty.'\n" +" while pq:\n" +" priority, count, task = heappop(pq)\n" +" if task is not REMOVED:\n" +" del entry_finder[task]\n" +" return task\n" +" raise KeyError('pop from an empty priority queue')" msgid "Theory" -msgstr "" +msgstr "نظریه" -msgid "Heaps are arrays for which ``a[k] <= a[2*k+1]`` and ``a[k] <= a[2*k+2]`` for all *k*, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that ``a[0]`` is always its smallest element." +msgid "" +"Heaps are arrays for which ``a[k] <= a[2*k+1]`` and ``a[k] <= a[2*k+2]`` " +"for all *k*, counting elements from 0. For the sake of comparison, non-" +"existing elements are considered to be infinite. The interesting property " +"of a heap is that ``a[0]`` is always its smallest element." msgstr "" +"پشته‌ها آرایه‌هایی هستند که در آن‌ها برای همه‌ی *k*، ``a[k] <= a[2*k+1]`` و " +"``a[k] <= a[2*k+2]`` برقرار است، با شمارش عناصر از ۰. برای مقایسه، عناصر " +"ناموجود بی‌نهایت در نظر گرفته می‌شوند. ویژگی جالب یک هیپ این است که ``a[0]`` " +"همیشه کوچک‌ترین عنصر آن است." -msgid "The strange invariant above is meant to be an efficient memory representation for a tournament. The numbers below are *k*, not ``a[k]``::" +msgid "" +"The strange invariant above is meant to be an efficient memory " +"representation for a tournament. The numbers below are *k*, not ``a[k]``::" msgstr "" +"ناوردای عجیب بالا به‌عنوان یک بازنمایی کارآمد در حافظه برای یک تورنمنت " +"(tournament) در نظر گرفته شده است. اعداد زیر *k* هستند، نه ``a[k]``::" msgid "" " 0\n" @@ -287,30 +643,155 @@ msgid "" "\n" "15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30" msgstr "" +" 0\n" +"\n" +" 1 2\n" +"\n" +" 3 4 5 6\n" +"\n" +" 7 8 9 10 11 12 13 14\n" +"\n" +"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30" -msgid "In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a usual binary tournament we see in sports, each cell is the winner over the two cells it tops, and we can trace the winner down the tree to see all opponents s/he had. However, in many computer applications of such tournaments, we do not need to trace the history of a winner. To be more memory efficient, when a winner is promoted, we try to replace it by something else at a lower level, and the rule becomes that a cell and the two cells it tops contain three different items, but the top cell \"wins\" over the two topped cells." -msgstr "" +msgid "" +"In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " +"usual binary tournament we see in sports, each cell is the winner over the " +"two cells it tops, and we can trace the winner down the tree to see all " +"opponents s/he had. However, in many computer applications of such " +"tournaments, we do not need to trace the history of a winner. To be more " +"memory efficient, when a winner is promoted, we try to replace it by " +"something else at a lower level, and the rule becomes that a cell and the " +"two cells it tops contain three different items, but the top cell \"wins\" " +"over the two topped cells." +msgstr "" +"در درخت بالا، هر سلول *k* بر ``2*k+1`` و ``2*k+2`` قرار دارد. در یک تورنمنت " +"دودویی معمول که در ورزش‌ها می‌بینیم، هر سلول برنده‌ی دو سلولی است که بر آن‌ها " +"قرار دارد، و می‌توانیم برنده را در درخت به سمت پایین دنبال کنیم تا همه‌ی " +"حریفانی را که داشته است ببینیم. با این حال، در بسیاری از کاربردهای رایانه‌ای " +"چنین تورنمنت‌هایی، نیازی به پیگیری تاریخچه‌ی یک برنده نیست. برای کارآمدتر بودن " +"از نظر حافظه، هنگامی که یک برنده ارتقا می‌یابد، سعی می‌کنیم آن را با چیز " +"دیگری در سطحی پایین‌تر جایگزین کنیم، و قاعده این می‌شود که یک سلول و دو سلولی " +"که بر آن‌ها قرار دارد شامل سه آیتم متفاوت هستند، اما سلول بالایی بر دو سلول " +"زیرین خود «برنده می‌شود»." -msgid "If this heap invariant is protected at all time, index 0 is clearly the overall winner. The simplest algorithmic way to remove it and find the \"next\" winner is to move some loser (let's say cell 30 in the diagram above) into the 0 position, and then percolate this new 0 down the tree, exchanging values, until the invariant is re-established. This is clearly logarithmic on the total number of items in the tree. By iterating over all items, you get an *O*\\ (*n* log *n*) sort." -msgstr "" +msgid "" +"If this heap invariant is protected at all time, index 0 is clearly the " +"overall winner. The simplest algorithmic way to remove it and find the " +"\"next\" winner is to move some loser (let's say cell 30 in the diagram " +"above) into the 0 position, and then percolate this new 0 down the tree, " +"exchanging values, until the invariant is re-established. This is clearly " +"logarithmic on the total number of items in the tree. By iterating over all " +"items, you get an *O*\\ (*n* log *n*) sort." +msgstr "" +"اگر این ناوردایی هیپ همواره حفظ شود، اندیس ۰ به‌وضوح برنده‌ی کلی است. " +"ساده‌ترین روش الگوریتمی برای حذف آن و یافتن برنده‌ی «بعدی» این است که یکی از " +"بازنده‌ها (مثلاً خانه‌ی ۳۰ در شکل بالا) را به موقعیت ۰ منتقل کنیم و سپس این ۰ " +"جدید را با تبادل مقادیر، در درخت به پایین جابه‌جا کنیم تا ناوردایی دوباره برقرار " +"شود. این کار به‌وضوح بر حسب تعداد کل آیتم‌های درخت لگاریتمی است. با پیمایش " +"همه‌ی آیتم‌ها، یک مرتب‌سازی *O*\\ (*n* log *n*) به دست می‌آورید." -msgid "A nice feature of this sort is that you can efficiently insert new items while the sort is going on, provided that the inserted items are not \"better\" than the last 0'th element you extracted. This is especially useful in simulation contexts, where the tree holds all incoming events, and the \"win\" condition means the smallest scheduled time. When an event schedules other events for execution, they are scheduled into the future, so they can easily go into the heap. So, a heap is a good structure for implementing schedulers (this is what I used for my MIDI sequencer :-)." -msgstr "" +msgid "" +"A nice feature of this sort is that you can efficiently insert new items " +"while the sort is going on, provided that the inserted items are not " +"\"better\" than the last 0'th element you extracted. This is especially " +"useful in simulation contexts, where the tree holds all incoming events, " +"and the \"win\" condition means the smallest scheduled time. When an event " +"schedules other events for execution, they are scheduled into the future, " +"so they can easily go into the heap. So, a heap is a good structure for " +"implementing schedulers (this is what I used for my MIDI sequencer :-)." +msgstr "" +"ویژگی خوب این مرتب‌سازی این است که می‌توانید در حین انجام مرتب‌سازی، آیتم‌های " +"جدید را به‌طور کارآمدی درج کنید، مشروط بر اینکه آیتم‌های درج‌شده «بهتر» از " +"آخرین عنصر صفرمی که استخراج کرده‌اید نباشند. این ویژگی به‌ویژه در زمینه‌های " +"شبیه‌سازی مفید است، جایی که درخت همه‌ی رویدادهای ورودی را در خود نگه می‌دارد و " +"شرط «برد» به معنای کم‌ترین زمان زمان‌بندی‌شده است. هنگامی که رویدادی، " +"رویدادهای دیگری را برای اجرا زمان‌بندی می‌کند، آن‌ها برای آینده زمان‌بندی " +"می‌شوند، بنابراین می‌توانند به‌راحتی وارد هیپ شوند. بنابراین، هیپ ساختار " +"خوبی برای پیاده‌سازی زمان‌بندها است (این همان چیزی است که من برای سکانس‌کننده‌ی " +"MIDI خود از آن استفاده کردم :-)." -msgid "Various structures for implementing schedulers have been extensively studied, and heaps are good for this, as they are reasonably speedy, the speed is almost constant, and the worst case is not much different than the average case. However, there are other representations which are more efficient overall, yet the worst cases might be terrible." -msgstr "" +msgid "" +"Various structures for implementing schedulers have been extensively " +"studied, and heaps are good for this, as they are reasonably speedy, the " +"speed is almost constant, and the worst case is not much different than the " +"average case. However, there are other representations which are more " +"efficient overall, yet the worst cases might be terrible." +msgstr "" +"ساختارهای گوناگونی برای پیاده‌سازی زمان‌بندها به‌طور گسترده بررسی شده‌اند و " +"هیپ‌هابرای این کار مناسب هستند، زیرا نسبتاً سریع هستند، سرعت آن‌ها " +"تقریباً ثابت است و بدترین حالت تفاوت چندانی با حالت میانگین ندارد. با این " +"حال، بازنمایی‌های دیگری وجود دارند که به‌طور کلی کارآمدتر هستند، اما بدترین " +"حالت‌ها ممکن است بسیار بد باشند." -msgid "Heaps are also very useful in big disk sorts. You most probably all know that a big sort implies producing \"runs\" (which are pre-sorted sequences, whose size is usually related to the amount of CPU memory), followed by a merging passes for these runs, which merging is often very cleverly organised [#]_. It is very important that the initial sort produces the longest runs possible. Tournaments are a good way to achieve that. If, using all the memory available to hold a tournament, you replace and percolate items that happen to fit the current run, you'll produce runs which are twice the size of the memory for random input, and much better for input fuzzily ordered." -msgstr "" +msgid "" +"Heaps are also very useful in big disk sorts. You most probably all know " +"that a big sort implies producing \"runs\" (which are pre-sorted sequences, " +"whose size is usually related to the amount of CPU memory), followed by a " +"merging passes for these runs, which merging is often very cleverly " +"organised [#]_. It is very important that the initial sort produces the " +"longest runs possible. Tournaments are a good way to achieve that. If, " +"using all the memory available to hold a tournament, you replace and " +"percolate items that happen to fit the current run, you'll produce runs " +"which are twice the size of the memory for random input, and much better " +"for input fuzzily ordered." +msgstr "" +"هیپ‌ها (heaps) همچنین در مرتب‌سازی‌های بزرگ دیسکی بسیار مفید هستند. احتمالاً " +"همگی می‌دانید که یک مرتب‌سازی بزرگ مستلزم تولید «دنباله‌های مرتب‌شده» (runs) " +"است (که دنباله‌هایی از پیش مرتب‌شده هستند و اندازه‌ی آن‌ها معمولاً به مقدار " +"حافظه‌ی CPU بستگی دارد) و پس از آن، گذرهای ادغام برای این دنباله‌ها انجام " +"می‌شود؛ ادغامی که اغلب بسیار هوشمندانه سازمان‌دهی می‌شود [#]_. بسیار مهم است " +"که مرتب‌سازی اولیه طولانی‌ترین دنباله‌های مرتب‌شده‌ی ممکن را تولید کند. " +"تورنمنت‌ها (tournaments) راه خوبی برای دستیابی به آن هستند. اگر با استفاده " +"از تمام حافظه‌ی موجود برای نگه‌داری یک تورنمنت، آیتم‌هایی را که اتفاقاً با " +"دنباله‌ی جاری سازگار هستند جایگزین کنید و نفوذ دهید (percolate)، دنباله‌هایی " +"تولید خواهید کرد که برای ورودی تصادفی دو برابر اندازه‌ی حافظه هستند و برای " +"ورودی‌ای که به‌صورت تقریبی مرتب است بسیار بهتر خواهند بود." -msgid "Moreover, if you output the 0'th item on disk and get an input which may not fit in the current tournament (because the value \"wins\" over the last output value), it cannot fit in the heap, so the size of the heap decreases. The freed memory could be cleverly reused immediately for progressively building a second heap, which grows at exactly the same rate the first heap is melting. When the first heap completely vanishes, you switch heaps and start a new run. Clever and quite effective!" -msgstr "" +msgid "" +"Moreover, if you output the 0'th item on disk and get an input which may " +"not fit in the current tournament (because the value \"wins\" over the last " +"output value), it cannot fit in the heap, so the size of the heap " +"decreases. The freed memory could be cleverly reused immediately for " +"progressively building a second heap, which grows at exactly the same rate " +"the first heap is melting. When the first heap completely vanishes, you " +"switch heaps and start a new run. Clever and quite effective!" +msgstr "" +"علاوه بر این، اگر آیتم صفرم را روی دیسک خروجی دهید و ورودی‌ای دریافت کنید که " +"ممکن است در مسابقه‌ی جاری نگنجد (زیرا مقدار آن بر مقدار خروجی آخر «پیروز " +"می‌شود»)، آن ورودی در هیپ نمی‌گنجد، بنابراین اندازه‌ی هیپ کاهش می‌یابد. " +"حافظه‌ی آزادشده می‌تواند بلافاصله و به‌صورت هوشمندانه برای ساخت تدریجی یک " +"پشته‌ی دوم دوباره استفاده شود، پشته‌ای که دقیقاً با همان آهنگی که پشته‌ی اول در " +"حال آب شدن است، رشد می‌کند. هنگامی که پشته‌ی اول کاملاً ناپدید شود، پشته‌ها را " +"جابه‌جا می‌کنید و یک اجرای جدید را آغاز می‌کنید. هوشمندانه و کاملاً مؤثر!" -msgid "In a word, heaps are useful memory structures to know. I use them in a few applications, and I think it is good to keep a 'heap' module around. :-)" +msgid "" +"In a word, heaps are useful memory structures to know. I use them in a few " +"applications, and I think it is good to keep a 'heap' module around. :-)" msgstr "" +"به‌اختصار، هیپ‌ها (heaps) ساختارهای حافظه‌ی مفیدی برای آشنایی هستند. من از " +"آن‌ها در چند برنامه استفاده می‌کنم و فکر می‌کنم خوب است که یک ماژول 'heap' در " +"دسترس باشد. :-)" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "The disk balancing algorithms which are current, nowadays, are more annoying than clever, and this is a consequence of the seeking capabilities of the disks. On devices which cannot seek, like big tape drives, the story was quite different, and one had to be very clever to ensure (far in advance) that each tape movement will be the most effective possible (that is, will best participate at \"progressing\" the merge). Some tapes were even able to read backwards, and this was also used to avoid the rewinding time. Believe me, real good tape sorts were quite spectacular to watch! From all times, sorting has always been a Great Art! :-)" -msgstr "" +msgid "" +"The disk balancing algorithms which are current, nowadays, are more " +"annoying than clever, and this is a consequence of the seeking capabilities " +"of the disks. On devices which cannot seek, like big tape drives, the story " +"was quite different, and one had to be very clever to ensure (far in " +"advance) that each tape movement will be the most effective possible (that " +"is, will best participate at \"progressing\" the merge). Some tapes were " +"even able to read backwards, and this was also used to avoid the rewinding " +"time. Believe me, real good tape sorts were quite spectacular to watch! " +"From all times, sorting has always been a Great Art! :-)" +msgstr "" +"الگوریتم‌های موازنه‌ی دیسک که امروزه رایج هستند، بیش از آنکه هوشمندانه باشند، " +"آزاردهنده‌اند، و این پیامد قابلیت مکان‌یابی دیسک‌هاست. در دستگاه‌هایی که " +"نمی‌توانند جست‌وجو کنند، مانند درایوهای نواری بزرگ، داستان کاملاً متفاوت بود و " +"باید بسیار هوشمندانه عمل می‌شد تا (از مدت‌ها پیش) اطمینان حاصل شود که هر حرکت " +"نوار مؤثرترین حرکت ممکن خواهد بود (یعنی بهترین مشارکت را در «پیش‌بردن» ادغام " +"خواهد داشت). برخی نوارها حتی می‌توانستند به‌صورت معکوس خوانده شوند و از این " +"قابلیت نیز برای پرهیز از زمان بازپیچی استفاده می‌شد. باور کنید، مرتب‌سازی‌های " +"نواری واقعاً خوب برای تماشا بسیار دیدنی بودند! در تمام دوران‌ها، مرتب‌سازی " +"همیشه هنر بزرگی بوده است! :-)" diff --git a/library/hmac.po b/library/hmac.po index 3c3fbe15c..3232d6436 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -24,82 +24,191 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!hmac` --- Keyed-Hashing for Message Authentication" -msgstr "" +msgstr ":mod:`!hmac` --- هش کلیددار برای اصالت‌سنجی پیام" msgid "**Source code:** :source:`Lib/hmac.py`" -msgstr "" +msgstr ":source:`Lib/hmac.py`" -msgid "This module implements the HMAC algorithm as described by :rfc:`2104`. The interface allows to use any hash function with a *fixed* digest size. In particular, extendable output functions such as SHAKE-128 or SHAKE-256 cannot be used with HMAC." +msgid "" +"This module implements the HMAC algorithm as described by :rfc:`2104`. The " +"interface allows to use any hash function with a *fixed* digest size. In " +"particular, extendable output functions such as SHAKE-128 or SHAKE-256 " +"cannot be used with HMAC." msgstr "" +"این ماژول الگوریتم HMAC را همان‌طور که در :rfc:`2104` توصیف شده است، " +"پیاده‌سازی می‌کند. این رابط به شما اجازه می‌دهد از هر تابع هش با اندازه‌ی " +"چکیده (digest) *ثابت* استفاده کنید. به‌طور خاص، نمی‌توانید از توابع خروجی " +"توسعه‌پذیر (extendable output functions) مانند SHAKE-128 یا SHAKE-256 با " +"HMAC استفاده کنید." -msgid "Return a new hmac object. *key* is a bytes or bytearray object giving the secret key. If *msg* is present, the method call ``update(msg)`` is made. *digestmod* is the digest name, digest constructor or module for the HMAC object to use. It may be any name suitable to :func:`hashlib.new`. Despite its argument position, it is required." -msgstr "" +msgid "" +"Return a new hmac object. *key* is a bytes or bytearray object giving the " +"secret key. If *msg* is present, the method call ``update(msg)`` is made. " +"*digestmod* is the digest name, digest constructor or module for the HMAC " +"object to use. It may be any name suitable to :func:`hashlib.new`. Despite " +"its argument position, it is required." +msgstr "" +"یک شیء hmac جدید برمی‌گرداند. *key* یک شیء bytes یا bytearray حاوی کلید مخفی" +" است. اگر *msg* وجود داشته باشد، فراخوانی متد ``update(msg)`` انجام می‌شود. " +"*digestmod* نام چکیده، سازنده چکیده یا ماژولی است که شیء HMAC باید از آن " +"استفاده کند. این می‌تواند هر نامی باشد که برای :func:`hashlib.new` مناسب " +"است. با وجود جایگاه آرگومانی آن، این آرگومان الزامی است." -msgid "Parameter *key* can be a bytes or bytearray object. Parameter *msg* can be of any type supported by :mod:`hashlib`. Parameter *digestmod* can be the name of a hash algorithm." +msgid "" +"Parameter *key* can be a bytes or bytearray object. Parameter *msg* can be " +"of any type supported by :mod:`hashlib`. Parameter *digestmod* can be the " +"name of a hash algorithm." msgstr "" +"پارامتر *key* می‌تواند یک شیء bytes یا bytearray باشد. پارامتر *msg* " +"می‌تواند از هر نوعی باشد که :mod:`hashlib` از آن پشتیبانی می‌کند. پارامتر " +"*digestmod* می‌تواند نام یک الگوریتم هش باشد." -msgid "The *digestmod* argument is now required. Pass it as a keyword argument to avoid awkwardness when you do not have an initial *msg*." +msgid "" +"The *digestmod* argument is now required. Pass it as a keyword argument to " +"avoid awkwardness when you do not have an initial *msg*." msgstr "" +"آرگومان *digestmod* اکنون الزامی است. آن را به‌عنوان آرگومان کلیدواژه‌ای " +"ارسال کنید تا در صورتی که *msg* اولیه ندارید، از ناهماهنگی جلوگیری شود." -msgid "Return digest of *msg* for given secret *key* and *digest*. The function is equivalent to ``HMAC(key, msg, digest).digest()``, but uses an optimized C or inline implementation, which is faster for messages that fit into memory. The parameters *key*, *msg*, and *digest* have the same meaning as in :func:`~hmac.new`." -msgstr "" +msgid "" +"Return digest of *msg* for given secret *key* and *digest*. The function is " +"equivalent to ``HMAC(key, msg, digest).digest()``, but uses an optimized C " +"or inline implementation, which is faster for messages that fit into memory." +" The parameters *key*, *msg*, and *digest* have the same meaning as in " +":func:`~hmac.new`." +msgstr "" +"خلاصه‌ی *msg* را برای *key* محرمانه و *digest* داده‌شده برمی‌گرداند. این " +"تابع معادل ``HMAC(key, msg, digest).digest()`` است، اما از یک پیاده‌سازی " +"بهینه‌شده به زبان C یا پیاده‌سازی درون‌خطی استفاده می‌کند که برای پیام‌هایی " +"که در حافظه جا می‌شوند سریع‌تر است. پارامترهای *key*، *msg* و *digest* همان" +" معنایی را دارند که در :func:`~hmac.new` آمده است." -msgid "CPython implementation detail, the optimized C implementation is only used when *digest* is a string and name of a digest algorithm, which is supported by OpenSSL." +msgid "" +"CPython implementation detail, the optimized C implementation is only used " +"when *digest* is a string and name of a digest algorithm, which is supported" +" by OpenSSL." msgstr "" +"جزئیات پیاده‌سازی CPython: پیاده‌سازی بهینه‌ی C تنها زمانی استفاده می‌شود که" +" *digest* یک رشته و نام یک الگوریتم digest باشد که OpenSSL از آن پشتیبانی " +"می‌کند." msgid "An HMAC object has the following methods:" -msgstr "" +msgstr "یک شیء HMAC دارای متدهای زیر است:" -msgid "Update the hmac object with *msg*. Repeated calls are equivalent to a single call with the concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a + b)``." +msgid "" +"Update the hmac object with *msg*. Repeated calls are equivalent to a " +"single call with the concatenation of all the arguments: ``m.update(a); " +"m.update(b)`` is equivalent to ``m.update(a + b)``." msgstr "" +"شیء hmac را با *msg* به‌روزرسانی کنید. فراخوانی‌های مکرر معادل یک فراخوانی " +"با الحاق همه آرگومان‌ها است: ``m.update(a); m.update(b)`` معادل ``m.update(a" +" + b)`` است." msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." msgstr "" +"پارامتر *msg* می‌تواند از هر نوعی باشد که توسط :mod:`hashlib` پشتیبانی " +"می‌شود." -msgid "Return the digest of the bytes passed to the :meth:`update` method so far. This bytes object will be the same length as the *digest_size* of the digest given to the constructor. It may contain non-ASCII bytes, including NUL bytes." +msgid "" +"Return the digest of the bytes passed to the :meth:`update` method so far. " +"This bytes object will be the same length as the *digest_size* of the digest" +" given to the constructor. It may contain non-ASCII bytes, including NUL " +"bytes." msgstr "" +"خلاصه‌ی بایت‌هایی که تاکنون به متد :meth:`update` داده شده‌اند را " +"برمی‌گرداند. طول این شیء بایت برابر با *digest_size* خلاصه‌ای خواهد بود که " +"به سازنده داده شده است. ممکن است شامل بایت‌های غیر ASCII، از جمله بایت‌های " +"NUL باشد." -msgid "When comparing the output of :meth:`digest` to an externally supplied digest during a verification routine, it is recommended to use the :func:`compare_digest` function instead of the ``==`` operator to reduce the vulnerability to timing attacks." +msgid "" +"When comparing the output of :meth:`digest` to an externally supplied digest" +" during a verification routine, it is recommended to use the " +":func:`compare_digest` function instead of the ``==`` operator to reduce the" +" vulnerability to timing attacks." msgstr "" +"هنگام مقایسه‌ی خروجی :meth:`digest` با یک چکیده (digest) تأمین‌شده از خارج " +"در حین یک روال تأیید صحت، توصیه می‌شود برای کاهش آسیب‌پذیری در برابر حملات " +"زمان‌سنجی، از تابع :func:`compare_digest` به‌جای عملگر ``==`` استفاده کنید." -msgid "Like :meth:`digest` except the digest is returned as a string twice the length containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments." +msgid "" +"Like :meth:`digest` except the digest is returned as a string twice the " +"length containing only hexadecimal digits. This may be used to exchange the" +" value safely in email or other non-binary environments." msgstr "" +"مانند :meth:`digest` با این تفاوت که چکیده (digest) به‌صورت رشته‌ای با طولی " +"دو برابر برگردانده می‌شود که فقط شامل ارقام مبنای شانزده است. می‌توان از آن " +"برای تبادل امن مقدار در ایمیل یا سایر محیط‌های غیردودویی استفاده کرد." -msgid "When comparing the output of :meth:`hexdigest` to an externally supplied digest during a verification routine, it is recommended to use the :func:`compare_digest` function instead of the ``==`` operator to reduce the vulnerability to timing attacks." +msgid "" +"When comparing the output of :meth:`hexdigest` to an externally supplied " +"digest during a verification routine, it is recommended to use the " +":func:`compare_digest` function instead of the ``==`` operator to reduce the" +" vulnerability to timing attacks." msgstr "" +"هنگام مقایسه‌ی خروجی :meth:`hexdigest` با یک خلاصه‌ی ارائه‌شده از منبع خارجی" +" در یک روال راستی‌آزمایی، توصیه می‌شود برای کاهش آسیب‌پذیری در برابر حملات " +"زمان‌بندی، به‌جای عملگر ``==`` از تابع :func:`compare_digest` استفاده کنید." -msgid "Return a copy (\"clone\") of the hmac object. This can be used to efficiently compute the digests of strings that share a common initial substring." +msgid "" +"Return a copy (\"clone\") of the hmac object. This can be used to " +"efficiently compute the digests of strings that share a common initial " +"substring." msgstr "" +"یک کپی («clone») از شیء hmac برمی‌گرداند. می‌توان از آن برای محاسبه‌ی کارآمد " +"چکیده‌های رشته‌هایی که یک زیررشته‌ی آغازین مشترک دارند استفاده کرد." msgid "A hash object has the following attributes:" -msgstr "" +msgstr "یک شیء هش دارای ویژگی‌های زیر است:" msgid "The size of the resulting HMAC digest in bytes." -msgstr "" +msgstr "اندازه‌ی خلاصه‌ی HMAC حاصل بر حسب بایت." msgid "The internal block size of the hash algorithm in bytes." -msgstr "" +msgstr "اندازه‌ی بلوک داخلی الگوریتم هش بر حسب بایت." msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." -msgstr "" +msgstr "نام کانونیکال این HMAC، همیشه با حروف کوچک، مثلاً ``hmac-md5``." -msgid "Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, and ``HMAC.outer``." +msgid "" +"Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, " +"and ``HMAC.outer``." msgstr "" +"ویژگی‌های بدون مستند ``HMAC.digest_cons``، ``HMAC.inner`` و ``HMAC.outer`` " +"حذف شدند." msgid "This module also provides the following helper function:" -msgstr "" +msgstr "این ماژول همچنین تابع کمکی زیر را فراهم می‌کند:" -msgid "Return ``a == b``. This function uses an approach designed to prevent timing analysis by avoiding content-based short circuiting behaviour, making it appropriate for cryptography. *a* and *b* must both be of the same type: either :class:`str` (ASCII only, as e.g. returned by :meth:`HMAC.hexdigest`), or a :term:`bytes-like object`." -msgstr "" +msgid "" +"Return ``a == b``. This function uses an approach designed to prevent " +"timing analysis by avoiding content-based short circuiting behaviour, making" +" it appropriate for cryptography. *a* and *b* must both be of the same " +"type: either :class:`str` (ASCII only, as e.g. returned by " +":meth:`HMAC.hexdigest`), or a :term:`bytes-like object`." +msgstr "" +"``a == b`` را برمی‌گرداند. این تابع از رویکردی استفاده می‌کند که برای " +"جلوگیری از تحلیل زمانی، با اجتناب از رفتار اتصال کوتاه مبتنی بر محتوا طراحی " +"شده است و آن را برای رمزنگاری مناسب می‌سازد. *a* و *b* باید هر دو از یک نوع " +"باشند: یا :class:`str` (فقط ASCII، مانند آنچه :meth:`HMAC.hexdigest` " +"برمی‌گرداند)، یا یک :term:`bytes-like object`." -msgid "If *a* and *b* are of different lengths, or if an error occurs, a timing attack could theoretically reveal information about the types and lengths of *a* and *b*—but not their values." +msgid "" +"If *a* and *b* are of different lengths, or if an error occurs, a timing " +"attack could theoretically reveal information about the types and lengths of" +" *a* and *b*—but not their values." msgstr "" +"اگر *a* و *b* طول‌های متفاوتی داشته باشند، یا اگر خطایی رخ دهد، یک حمله " +"زمان‌بندی (timing attack) می‌تواند به‌صورت نظری اطلاعاتی را درباره نوع و طول" +" *a* و *b* آشکار کند—اما نه مقادیر آن‌ها." -msgid "The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." +msgid "" +"The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." msgstr "" +"این تابع در صورت موجود بودن، به‌صورت داخلی از ``CRYPTO_memcmp()`` در OpenSSL" +" استفاده می‌کند." msgid "Module :mod:`hashlib`" -msgstr "" +msgstr "ماژول :mod:`hashlib`" msgid "The Python module providing secure hash functions." -msgstr "" +msgstr "ماژول پایتون که توابع هش امن را فراهم می‌کند." diff --git a/library/html.entities.po b/library/html.entities.po index cf12e5c5b..d6bd95595 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -24,28 +24,54 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!html.entities` --- Definitions of HTML general entities" -msgstr "" +msgstr ":mod:`!html.entities` --- تعاریف موجودیت‌های عمومی HTML (entities)" msgid "**Source code:** :source:`Lib/html/entities.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/html/entities.py`" -msgid "This module defines four dictionaries, :data:`html5`, :data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`." +msgid "" +"This module defines four dictionaries, :data:`html5`, " +":data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`." msgstr "" +"این ماژول چهار دیکشنری را تعریف می‌کند: :data:`html5`، " +":data:`name2codepoint`، :data:`codepoint2name` و :data:`entitydefs`." -msgid "A dictionary that maps HTML5 named character references [#]_ to the equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``. Note that the trailing semicolon is included in the name (e.g. ``'gt;'``), however some of the names are accepted by the standard even without the semicolon: in this case the name is present with and without the ``';'``. See also :func:`html.unescape`." +msgid "" +"A dictionary that maps HTML5 named character references [#]_ to the " +"equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``. Note that the" +" trailing semicolon is included in the name (e.g. ``'gt;'``), however some " +"of the names are accepted by the standard even without the semicolon: in " +"this case the name is present with and without the ``';'``. See also " +":func:`html.unescape`." msgstr "" +"دیکشنری‌ای که ارجاع‌های نویسه‌ای نام‌دار HTML5 [#]_ را به نویسه(های) معادل " +"یونیکد نگاشت می‌کند، برای مثال ``html5['gt;'] == '>'``. توجه داشته باشید که " +"نقطه‌ویرگول پایانی در نام گنجانده شده است (برای مثال ``'gt;'``)، با این حال " +"برخی از نام‌ها حتی بدون نقطه‌ویرگول نیز توسط استاندارد پذیرفته می‌شوند: در " +"این حالت نام هم با ``';'`` و هم بدون آن وجود دارد. همچنین ببینید " +":func:`html.unescape`." -msgid "A dictionary mapping XHTML 1.0 entity definitions to their replacement text in ISO Latin-1." +msgid "" +"A dictionary mapping XHTML 1.0 entity definitions to their replacement text " +"in ISO Latin-1." msgstr "" +"یک دیکشنری که تعریف‌های موجودیت (entity) در XHTML 1.0 را به متن جایگزین " +"آن‌ها در ISO Latin-1 نگاشت می‌کند." msgid "A dictionary that maps HTML4 entity names to the Unicode code points." msgstr "" +"دیکشنری‌ای که نام‌های entity در HTML4 را به نقاط کد یونیکد نگاشت می‌کند." msgid "A dictionary that maps Unicode code points to HTML4 entity names." msgstr "" +"دیکشنری‌ای که نقاط کد یونیکد را به نام‌های موجودیت HTML4 نگاشت می‌دهد." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "See https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references" +msgid "" +"See https://html.spec.whatwg.org/multipage/named-characters.html#named-" +"character-references" msgstr "" +"https://html.spec.whatwg.org/multipage/named-characters.html#named-" +"character-references را ببینید" diff --git a/library/html.parser.po b/library/html.parser.po index 694d17d8e..efbd30858 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -25,43 +25,82 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!html.parser` --- Simple HTML and XHTML parser" -msgstr "" +msgstr ":mod:`!html.parser` --- پارسر ساده‌ی HTML و XHTML" msgid "**Source code:** :source:`Lib/html/parser.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/html/parser.py`" -msgid "This module defines a class :class:`HTMLParser` which serves as the basis for parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML." +msgid "" +"This module defines a class :class:`HTMLParser` which serves as the basis " +"for parsing text files formatted in HTML (HyperText Mark-up Language) and " +"XHTML." msgstr "" +"این ماژول یک کلاس :class:`HTMLParser` را تعریف می‌کند که مبنایی برای تجزیه‌ی" +" فایل‌های متنی قالب‌بندی‌شده با HTML (زبان نمادگذاری ابرمتن) و XHTML است." msgid "Create a parser instance able to parse invalid markup." msgstr "" +"یک نمونه از پارسر (parser) ایجاد کنید که قادر به تجزیه نمادگذاری " +"نامعتبر باشد." -msgid "If *convert_charrefs* is true (the default), all character references (except the ones in elements like ``script`` and ``style``) are automatically converted to the corresponding Unicode characters." +msgid "" +"If *convert_charrefs* is true (the default), all character references " +"(except the ones in elements like ``script`` and ``style``) are " +"automatically converted to the corresponding Unicode characters." msgstr "" +"اگر *convert_charrefs* برابر true باشد (پیش‌فرض)، تمام ارجاع‌های نویسه‌ای " +"(به‌جز آن‌هایی که در عنصرهایی مانند ``script`` و ``style`` قرار دارند) " +"به‌طور خودکار به نویسه‌های یونیکد متناظر تبدیل می‌شوند." -msgid "If *scripting* is false (the default), the content of the ``noscript`` element is parsed normally; if it's true, it's returned as is without being parsed." +msgid "" +"If *scripting* is false (the default), the content of the ``noscript`` " +"element is parsed normally; if it's true, it's returned as is without being " +"parsed." msgstr "" +"اگر *scripting* نادرست باشد (پیش‌فرض)، محتوای عنصر ``noscript`` به‌طور معمول" +" تجزیه می‌شود؛ اگر درست باشد، همان‌طور که هست بدون تجزیه بازگردانده می‌شود." -msgid "An :class:`.HTMLParser` instance is fed HTML data and calls handler methods when start tags, end tags, text, comments, and other markup elements are encountered. The user should subclass :class:`.HTMLParser` and override its methods to implement the desired behavior." +msgid "" +"An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " +"when start tags, end tags, text, comments, and other markup elements are " +"encountered. The user should subclass :class:`.HTMLParser` and override its" +" methods to implement the desired behavior." msgstr "" +"یک نمونه از :class:`.HTMLParser` داده‌های HTML را دریافت می‌کند و هنگامی که " +"با برچسب‌های آغازین، برچسب‌های پایانی، متن، کامنت‌ها و سایر عناصر " +"نمادگذاری مواجه می‌شود، متدهای هندلر را فراخوانی می‌کند. کاربر باید " +"یک زیرکلاس از :class:`.HTMLParser` بسازد و متدهای آن را بازنویسی کند تا " +"رفتار دلخواه پیاده‌سازی شود." -msgid "This parser does not check that end tags match start tags or call the end-tag handler for elements which are closed implicitly by closing an outer element." +msgid "" +"This parser does not check that end tags match start tags or call the end-" +"tag handler for elements which are closed implicitly by closing an outer " +"element." msgstr "" +"این پارسر مطابقت برچسب‌های پایانی با برچسب‌های آغازین را بررسی نمی‌کند و " +"هندلر برچسب پایانی را برای المان‌هایی که به‌طور ضمنی با بسته‌شدن یک " +"المان بیرونی بسته می‌شوند، فراخوانی نمی‌کند." msgid "*convert_charrefs* keyword argument added." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *convert_charrefs* اضافه شد." msgid "The default value for argument *convert_charrefs* is now ``True``." -msgstr "" +msgstr "مقدار پیش‌فرض آرگومان *convert_charrefs* اکنون ``True`` است." msgid "Added the *scripting* parameter." -msgstr "" +msgstr "پارامتر *scripting* افزوده شد." msgid "Example HTML Parser Application" -msgstr "" +msgstr "مثال برنامه پارسر HTML" -msgid "As a basic example, below is a simple HTML parser that uses the :class:`HTMLParser` class to print out start tags, end tags, and data as they are encountered:" +msgid "" +"As a basic example, below is a simple HTML parser that uses the " +":class:`HTMLParser` class to print out start tags, end tags, and data as " +"they are encountered:" msgstr "" +"به‌عنوان یک مثال پایه، در زیر یک پارسر ساده‌ی HTML آمده است که از کلاس " +":class:`HTMLParser` برای چاپ برچسب‌های شروع، برچسب‌های پایان و داده‌ها " +"به‌محض مواجهه با آن‌ها استفاده می‌کند:" msgid "" "from html.parser import HTMLParser\n" @@ -80,9 +119,24 @@ msgid "" "parser.feed('Test'\n" " '

Parse me!

')" msgstr "" +"from html.parser import HTMLParser\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Encountered a start tag:\", tag)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"Encountered an end tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Encountered some data :\", data)\n" +"\n" +"parser = MyHTMLParser()\n" +"parser.feed('Test'\n" +" '

Parse me!

')" msgid "The output will then be:" -msgstr "" +msgstr "سپس خروجی به این صورت خواهد بود:" msgid "" "Encountered a start tag: html\n" @@ -98,93 +152,251 @@ msgid "" "Encountered an end tag : body\n" "Encountered an end tag : html" msgstr "" +"با یک برچسب آغازین مواجه شد: html\n" +"با یک برچسب آغازین مواجه شد: head\n" +"با یک برچسب آغازین مواجه شد: title\n" +"با داده‌ای مواجه شد: Test\n" +"با یک برچسب پایانی مواجه شد: title\n" +"با یک برچسب پایانی مواجه شد: head\n" +"با یک برچسب آغازین مواجه شد: body\n" +"با یک برچسب آغازین مواجه شد: h1\n" +"با داده‌ای مواجه شد: Parse me!\n" +"با یک برچسب پایانی مواجه شد: h1\n" +"با یک برچسب پایانی مواجه شد: body\n" +"با یک برچسب پایانی مواجه شد: html" msgid ":class:`.HTMLParser` Methods" -msgstr "" +msgstr "متدهای :class:`.HTMLParser`" msgid ":class:`HTMLParser` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`HTMLParser` دارای متدهای زیر هستند:" -msgid "Feed some text to the parser. It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or :meth:`close` is called. *data* must be :class:`str`." +msgid "" +"Feed some text to the parser. It is processed insofar as it consists of " +"complete elements; incomplete data is buffered until more data is fed or " +":meth:`close` is called. *data* must be :class:`str`." msgstr "" +"مقداری متن به پارسر بدهید. این متن تا جایی که از عناصر کامل تشکیل شده " +"باشد، پردازش می‌شود؛ داده‌های ناقص در بافر نگهداری می‌شوند تا زمانی که داده " +"بیشتری به آن داده شود یا :meth:`close` فراخوانی شود. *data* باید " +":class:`str` باشد." -msgid "Force processing of all buffered data as if it were followed by an end-of-file mark. This method may be redefined by a derived class to define additional processing at the end of the input, but the redefined version should always call the :class:`HTMLParser` base class method :meth:`close`." +msgid "" +"Force processing of all buffered data as if it were followed by an end-of-" +"file mark. This method may be redefined by a derived class to define " +"additional processing at the end of the input, but the redefined version " +"should always call the :class:`HTMLParser` base class method :meth:`close`." msgstr "" +"پردازش تمام داده‌های بافرشده را به‌اجبار انجام می‌دهد، گویی که به دنبال " +"آن‌ها یک نشانه پایان فایل آمده باشد. این متد ممکن است توسط یک کلاس مشتق‌شده " +"بازتعریف شود تا پردازش اضافی را در پایان ورودی تعریف کند، اما نسخه " +"بازتعریف‌شده باید همیشه متد :meth:`close` کلاس پایه :class:`HTMLParser` را " +"فراخوانی کند." -msgid "Reset the instance. Loses all unprocessed data. This is called implicitly at instantiation time." +msgid "" +"Reset the instance. Loses all unprocessed data. This is called implicitly " +"at instantiation time." msgstr "" +"نمونه را بازنشانی می‌کند. تمام داده‌های پردازش‌نشده را از دست می‌دهد. این " +"متد به‌طور ضمنی در زمان نمونه‌سازی فراخوانی می‌شود." msgid "Return current line number and offset." -msgstr "" +msgstr "شماره خط و آفست (offset) فعلی را برمی‌گرداند." -msgid "Return the text of the most recently opened start tag. This should not normally be needed for structured processing, but may be useful in dealing with HTML \"as deployed\" or for re-generating input with minimal changes (whitespace between attributes can be preserved, etc.)." +msgid "" +"Return the text of the most recently opened start tag. This should not " +"normally be needed for structured processing, but may be useful in dealing " +"with HTML \"as deployed\" or for re-generating input with minimal changes " +"(whitespace between attributes can be preserved, etc.)." msgstr "" +"متن آخرین برچسب شروع بازشده را برمی‌گرداند. این مورد معمولاً برای پردازش " +"ساختارمند لازم نیست، اما ممکن است در کار با HTML «به‌صورت مستقرشده» یا برای " +"تولید مجدد ورودی با کمترین تغییرات مفید باشد (فضای سفید بین ویژگی‌ها " +"می‌تواند حفظ شود، و غیره)." -msgid "The following methods are called when data or markup elements are encountered and they are meant to be overridden in a subclass. The base class implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):" +msgid "" +"The following methods are called when data or markup elements are " +"encountered and they are meant to be overridden in a subclass. The base " +"class implementations do nothing (except for " +":meth:`~HTMLParser.handle_startendtag`):" msgstr "" +"متدهای زیر زمانی فراخوانی می‌شوند که داده یا عناصر نمادگذاری مشاهده شوند و" +" قرار است در یک زیرکلاس بازنویسی شوند. پیاده‌سازی‌های کلاس پایه کاری انجام " +"نمی‌دهند (به‌جز :meth:`~HTMLParser.handle_startendtag`):" -msgid "This method is called to handle the start tag of an element (e.g. ``
``)." +msgid "" +"This method is called to handle the start tag of an element (e.g. ``
``)." msgstr "" +"این متد برای مدیریت برچسب آغازین یک المان فراخوانی می‌شود (مثلاً ``
``)." -msgid "The *tag* argument is the name of the tag converted to lower case. The *attrs* argument is a list of ``(name, value)`` pairs containing the attributes found inside the tag's ``<>`` brackets. The *name* will be translated to lower case, and quotes in the *value* have been removed, and character and entity references have been replaced. For empty attributes, *value* is ``None``." -msgstr "" +msgid "" +"The *tag* argument is the name of the tag converted to lower case. The " +"*attrs* argument is a list of ``(name, value)`` pairs containing the " +"attributes found inside the tag's ``<>`` brackets. The *name* will be " +"translated to lower case, and quotes in the *value* have been removed, and " +"character and entity references have been replaced. For empty attributes, " +"*value* is ``None``." +msgstr "" +"آرگومان *tag* نام تگ است که به حروف کوچک تبدیل شده است. آرگومان *attrs* " +"فهرستی از جفت‌های ``(name, value)`` است که شامل ویژگی‌های یافت‌شده درون " +"براکت‌های ``<>`` تگ است. *name* به حروف کوچک تبدیل خواهد شد، علامت‌های " +"نقل‌قول در *value* حذف شده‌اند، و ارجاع‌های نویسه و موجودیت جایگزین شده‌اند." +" برای ویژگی‌های خالی، *value* برابر ``None`` است." -msgid "For instance, for the tag ````, this method would be called as ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])``." +msgid "" +"For instance, for the tag ````, this method " +"would be called as ``handle_starttag('a', [('href', " +"'https://www.cwi.nl/')])``." msgstr "" +"برای مثال، برای برچسب ````، این متد به‌صورت " +"``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` فراخوانی می‌شود." -msgid "All entity references from :mod:`html.entities` are replaced in the attribute values." +msgid "" +"All entity references from :mod:`html.entities` are replaced in the " +"attribute values." msgstr "" +"تمام ارجاع‌های موجودیت (entity references) از :mod:`html.entities` در مقادیر" +" ویژگی جایگزین می‌شوند." -msgid "This method is called to handle the end tag of an element (e.g. ``
``)." +msgid "" +"This method is called to handle the end tag of an element (e.g. ``
``)." msgstr "" +"این متد برای رسیدگی به برچسب پایانی یک المان فراخوانی می‌شود (مثلاً " +"``
``)." msgid "The *tag* argument is the name of the tag converted to lower case." -msgstr "" +msgstr "آرگومان *tag*، نام برچسبی است که به حروف کوچک تبدیل‌شده است." -msgid "Similar to :meth:`handle_starttag`, but called when the parser encounters an XHTML-style empty tag (````). This method may be overridden by subclasses which require this particular lexical information; the default implementation simply calls :meth:`handle_starttag` and :meth:`handle_endtag`." -msgstr "" +msgid "" +"Similar to :meth:`handle_starttag`, but called when the parser encounters an" +" XHTML-style empty tag (````). This method may be overridden by " +"subclasses which require this particular lexical information; the default " +"implementation simply calls :meth:`handle_starttag` and " +":meth:`handle_endtag`." +msgstr "" +"مشابه :meth:`handle_starttag`، اما زمانی فراخوانی می‌شود که پارسر با " +"یک برچسب خالی به سبک XHTML (````) مواجه شود. این متد ممکن است " +"توسط زیرکلاس‌هایی که به این اطلاعات واژگانی خاص نیاز دارند بازنویسی شود؛ " +"پیاده‌سازی پیش‌فرض به‌سادگی :meth:`handle_starttag` و :meth:`handle_endtag` " +"را فراخوانی می‌کند." -msgid "This method is called to process arbitrary data (e.g. text nodes and the content of elements like ``script`` and ``style``)." +msgid "" +"This method is called to process arbitrary data (e.g. text nodes and the " +"content of elements like ``script`` and ``style``)." msgstr "" +"این متد برای پردازش داده‌های دلخواه فراخوانی می‌شود (برای مثال، گره‌های متنی" +" و محتوای المان‌هایی مانند ``script`` و ``style``)." -msgid "This method is called to process a named character reference of the form ``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. ``'gt'``). This method is only called if *convert_charrefs* is false." +msgid "" +"This method is called to process a named character reference of the form " +"``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g." +" ``'gt'``). This method is only called if *convert_charrefs* is false." msgstr "" +"این متد برای پردازش یک ارجاع نویسه‌ی نام‌دار به شکل ``&name;`` (مثلاً " +"``>``) فراخوانی می‌شود، که در آن *name* یک ارجاع به موجودیت عمومی (مثلاً " +"``'gt'``) است. این متد فقط زمانی فراخوانی می‌شود که *convert_charrefs* " +"نادرست باشد." -msgid "This method is called to process decimal and hexadecimal numeric character references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is ``>``; in this case the method will receive ``'62'`` or ``'x3E'``. This method is only called if *convert_charrefs* is false." -msgstr "" +msgid "" +"This method is called to process decimal and hexadecimal numeric character " +"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example," +" the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal " +"is ``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " +"This method is only called if *convert_charrefs* is false." +msgstr "" +"این متد برای پردازش ارجاع‌های عددی نویسه به‌صورت دهدهی و مبنای شانزده، در " +"قالب :samp:`&#{NNN};` و :samp:`&#x{NNN};` فراخوانی می‌شود. برای مثال، معادل " +"دهدهی ``>`` برابر ``>`` است، درحالی‌که معادل مبنای شانزده آن " +"``>`` است؛ در این حالت متد ``'62'`` یا ``'x3E'`` را دریافت می‌کند. این " +"متد تنها در صورتی فراخوانی می‌شود که *convert_charrefs* نادرست باشد." -msgid "This method is called when a comment is encountered (e.g. ````)." +msgid "" +"This method is called when a comment is encountered (e.g. ````)." msgstr "" +"این متد هنگامی فراخوانی می‌شود که با یک کامنت مواجه شود (مثلاً ````)." -msgid "For example, the comment ```` will cause this method to be called with the argument ``' comment '``." +msgid "" +"For example, the comment ```` will cause this method to be " +"called with the argument ``' comment '``." msgstr "" +"برای مثال، کامنت ```` باعث می‌شود این متد با آرگومان ``' " +"comment '`` فراخوانی شود." -msgid "The content of Internet Explorer conditional comments (condcoms) will also be sent to this method, so, for ````, this method will receive ``'[if IE 9]>IE9-specific contentIE9-specific " +"content``, this method will receive ``'[if IE 9]>IE9-specific " +"contentIE9-specific content``، " +"این متد ``'[if IE 9]>IE9-specific content``)." +msgid "" +"This method is called to handle an HTML doctype declaration (e.g. " +"````)." msgstr "" +"این متد برای پردازش اعلامیه‌ی نوع سند (doctype) در HTML فراخوانی می‌شود " +"(مثلاً ````)." -msgid "The *decl* parameter will be the entire contents of the declaration inside the ```` markup (e.g. ``'DOCTYPE html'``)." +msgid "" +"The *decl* parameter will be the entire contents of the declaration inside " +"the ```` markup (e.g. ``'DOCTYPE html'``)." msgstr "" +"پارامتر *decl* تمام محتوای اعلامیه درون نمادگذاری ```` خواهد بود " +"(برای مثال ``'DOCTYPE html'``)." -msgid "Method called when a processing instruction is encountered. The *data* parameter will contain the entire processing instruction. For example, for the processing instruction ````, this method would be called as ``handle_pi(\"proc color='red'\")``. It is intended to be overridden by a derived class; the base class implementation does nothing." -msgstr "" +msgid "" +"Method called when a processing instruction is encountered. The *data* " +"parameter will contain the entire processing instruction. For example, for " +"the processing instruction ````, this method would be " +"called as ``handle_pi(\"proc color='red'\")``. It is intended to be " +"overridden by a derived class; the base class implementation does nothing." +msgstr "" +"متدی که هنگام مواجهه با یک دستورالعمل پردازشی فراخوانی می‌شود. پارامتر " +"*data* شامل کل دستورالعمل پردازشی خواهد بود. برای مثال، برای دستورالعمل " +"پردازشی ````، این متد به‌صورت ``handle_pi(\"proc " +"color='red'\")`` فراخوانی می‌شود. این متد در نظر گرفته شده است تا توسط یک " +"کلاس مشتق‌شده بازنویسی شود؛ پیاده‌سازی کلاس پایه هیچ کاری انجام نمی‌دهد." -msgid "The :class:`HTMLParser` class uses the SGML syntactic rules for processing instructions. An XHTML processing instruction using the trailing ``'?'`` will cause the ``'?'`` to be included in *data*." +msgid "" +"The :class:`HTMLParser` class uses the SGML syntactic rules for processing " +"instructions. An XHTML processing instruction using the trailing ``'?'`` " +"will cause the ``'?'`` to be included in *data*." msgstr "" +"کلاس :class:`HTMLParser` از قواعد سینتکسی SGML برای دستورالعمل‌های پردازشی " +"استفاده می‌کند. یک دستورالعمل پردازشی XHTML که از ``'?'`` پایانی استفاده " +"می‌کند، باعث می‌شود که ``'?'`` در *data* گنجانده شود." -msgid "This method is called when an unrecognized declaration is read by the parser." +msgid "" +"This method is called when an unrecognized declaration is read by the " +"parser." msgstr "" +"این متد زمانی فراخوانی می‌شود که یک اعلامیه ناشناخته توسط پارسر خوانده" +" شود." -msgid "The *data* parameter will be the entire contents of the declaration inside the ```` markup. It is sometimes useful to be overridden by a derived class. The base class implementation does nothing." +msgid "" +"The *data* parameter will be the entire contents of the declaration inside " +"the ```` markup. It is sometimes useful to be overridden by a " +"derived class. The base class implementation does nothing." msgstr "" +"پارامتر *data* تمام محتوای اعلان داخل نمادگذاری ```` خواهد بود. " +"گاهی بازنویسی آن توسط یک کلاس مشتق‌شده مفید است. پیاده‌سازی کلاس پایه هیچ " +"کاری انجام نمی‌دهد." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "The following class implements a parser that will be used to illustrate more examples:" +msgid "" +"The following class implements a parser that will be used to illustrate more" +" examples:" msgstr "" +"کلاس زیر یک پارسر (parser) را پیاده‌سازی می‌کند که برای نمایش مثال‌های" +" بیشتر استفاده خواهد شد:" msgid "" "from html.parser import HTMLParser\n" @@ -221,18 +433,54 @@ msgid "" "\n" "parser = MyHTMLParser()" msgstr "" +"from html.parser import HTMLParser\n" +"from html.entities import name2codepoint\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Start tag:\", tag)\n" +" for attr in attrs:\n" +" print(\" attr:\", attr)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"End tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Data :\", data)\n" +"\n" +" def handle_comment(self, data):\n" +" print(\"Comment :\", data)\n" +"\n" +" def handle_entityref(self, name):\n" +" c = chr(name2codepoint[name])\n" +" print(\"Named ent:\", c)\n" +"\n" +" def handle_charref(self, name):\n" +" if name.startswith('x'):\n" +" c = chr(int(name[1:], 16))\n" +" else:\n" +" c = chr(int(name))\n" +" print(\"Num ent :\", c)\n" +"\n" +" def handle_decl(self, data):\n" +" print(\"Decl :\", data)\n" +"\n" +"parser = MyHTMLParser()" msgid "Parsing a doctype:" -msgstr "" +msgstr "تجزیه‌ی doctype:" msgid "" ">>> parser.feed('')\n" "Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"" msgstr "" +">>> parser.feed('')\n" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"" msgid "Parsing an element with a few attributes and a title:" -msgstr "" +msgstr "تجزیه‌ی یک عنصر با چند ویژگی و یک عنوان:" msgid "" ">>> parser.feed('\"The')\n" @@ -245,9 +493,22 @@ msgid "" "Data : Python\n" "End tag : h1" msgstr "" +">>> parser.feed('\"The')\n" +"Start tag: img\n" +" attr: ('src', 'python-logo.png')\n" +" attr: ('alt', 'The Python logo')\n" +">>>\n" +">>> parser.feed('

Python

')\n" +"Start tag: h1\n" +"Data : Python\n" +"End tag : h1" -msgid "The content of elements like ``script`` and ``style`` is returned as is, without further parsing:" +msgid "" +"The content of elements like ``script`` and ``style`` is returned as is, " +"without further parsing:" msgstr "" +"محتوای المان‌هایی مانند ``script`` و ``style`` همان‌طور که هست، بدون تجزیه " +"بیشتر بازگردانده می‌شود:" msgid "" ">>> parser.feed('')\n" @@ -263,9 +524,27 @@ msgid "" "Data : alert(\"hello! ☺\");\n" "End tag : script" msgstr "" +">>> parser.feed('')\n" +"Start tag: style\n" +" attr: ('type', 'text/css')\n" +"Data : #python { color: green }\n" +"End tag : style\n" +"\n" +">>> parser.feed('')\n" +"Start tag: script\n" +" attr: ('type', 'text/javascript')\n" +"Data : alert(\"hello! ☺\");\n" +"End tag : script" -msgid "Attribute names are converted to lowercase, quotes from attribute values removed, and ``None`` is returned as *value* for empty attributes (such as ``checked``):" +msgid "" +"Attribute names are converted to lowercase, quotes from attribute values " +"removed, and ``None`` is returned as *value* for empty attributes (such as " +"``checked``):" msgstr "" +"نام ویژگی‌ها به حروف کوچک تبدیل می‌شود، علامت‌های نقل‌قول از مقادیر ویژگی‌ها" +" حذف می‌شود، و ``None`` به‌عنوان *مقدار* برای ویژگی‌های خالی (مانند " +"``checked``) برگردانده می‌شود:" msgid "" ">>> parser.feed(\"\")\n" @@ -275,9 +554,15 @@ msgid "" " attr: ('required', '')\n" " attr: ('disabled', 'disabled')" msgstr "" +">>> parser.feed(\"\")\n" +"Start tag: input\n" +" attr: ('type', 'checkbox')\n" +" attr: ('checked', None)\n" +" attr: ('required', '')\n" +" attr: ('disabled', 'disabled')" msgid "Parsing comments:" -msgstr "" +msgstr "تجزیه کامنت‌ها:" msgid "" ">>> parser.feed(''\n" @@ -285,9 +570,17 @@ msgid "" "Comment : a comment\n" "Comment : [if IE 9]>IE-specific content>> parser.feed(''\n" +"... '')\n" +"Comment : a comment\n" +"Comment : [if IE 9]>IE-specific content'``):" +msgid "" +"Parsing named and numeric character references and converting them to the " +"correct char (note: these 3 references are all equivalent to ``'>'``):" msgstr "" +"تجزیه‌ی ارجاع‌های نویسه‌ی نام‌دار و عددی و تبدیل آن‌ها به نویسه صحیح (توجه: " +"این ۳ ارجاع همگی معادل ``'>'`` هستند):" msgid "" ">>> parser = MyHTMLParser()\n" @@ -300,9 +593,24 @@ msgid "" "Num ent : >\n" "Num ent : >" msgstr "" +">>> parser = MyHTMLParser()\n" +">>> parser.feed('>>>')\n" +"Data : >>>\n" +"\n" +">>> parser = MyHTMLParser(convert_charrefs=False)\n" +">>> parser.feed('>>>')\n" +"Named ent: >\n" +"Num ent : >\n" +"Num ent : >" -msgid "Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but :meth:`~HTMLParser.handle_data` might be called more than once if *convert_charrefs* is false:" +msgid "" +"Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but " +":meth:`~HTMLParser.handle_data` might be called more than once if " +"*convert_charrefs* is false:" msgstr "" +"ارسال تکه‌های ناقص به :meth:`~HTMLParser.feed` کار می‌کند، اما اگر " +"*convert_charrefs* نادرست باشد، ممکن است :meth:`~HTMLParser.handle_data` بیش" +" از یک بار فراخوانی شود:" msgid "" ">>> for chunk in ['buff', 'ered', ' text']:\n" @@ -314,9 +622,19 @@ msgid "" "Data : text\n" "End tag : span" msgstr "" +">>> for chunk in ['buff', 'ered', ' text']:\n" +"... parser.feed(chunk)\n" +"...\n" +"Start tag: span\n" +"Data : buff\n" +"Data : ered\n" +"Data : text\n" +"End tag : span" msgid "Parsing invalid HTML (e.g. unquoted attributes) also works:" msgstr "" +"تجزیه‌ی HTML نامعتبر (برای مثال، ویژگی‌های بدون علامت نقل‌قول) نیز کار " +"می‌کند:" msgid "" ">>> parser.feed('

tag soup

')\n" @@ -328,9 +646,17 @@ msgid "" "End tag : p\n" "End tag : a" msgstr "" +">>> parser.feed('

tag soup

')\n" +"Start tag: p\n" +"Start tag: a\n" +" attr: ('class', 'link')\n" +" attr: ('href', '#main')\n" +"Data : tag soup\n" +"End tag : p\n" +"End tag : a" msgid "HTML" -msgstr "" +msgstr "HTML" msgid "XHTML" -msgstr "" +msgstr "XHTML" diff --git a/library/html.po b/library/html.po index 8fdbe9b7a..ea0fbbbc0 100644 --- a/library/html.po +++ b/library/html.po @@ -22,25 +22,49 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!html` --- HyperText Markup Language support" -msgstr "" +msgstr ":mod:`!html` --- پشتیبانی از زبان نمادگذاری ابرمتن" msgid "**Source code:** :source:`Lib/html/__init__.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/html/__init__.py`" msgid "This module defines utilities to manipulate HTML." -msgstr "" +msgstr "این ماژول ابزارهایی برای دستکاری HTML تعریف می‌کند." -msgid "Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. If the optional flag *quote* is true (the default), the characters (``\"``) and (``'``) are also translated; this helps for inclusion in an HTML attribute value delimited by quotes, as in ````. If *quote* is set to false, the characters (``\"``) and (``'``) are not translated." +msgid "" +"Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe " +"sequences. Use this if you need to display text that might contain such " +"characters in HTML. If the optional flag *quote* is true (the default), the" +" characters (``\"``) and (``'``) are also translated; this helps for " +"inclusion in an HTML attribute value delimited by quotes, as in ````. If *quote* is set to false, the characters (``\"``) and " +"(``'``) are not translated." msgstr "" +"نویسه‌های ``&``، ``<`` و ``>`` در رشته *s* را به دنباله‌های امن برای HTML " +"تبدیل می‌کند. اگر نیاز دارید متنی را که ممکن است حاوی چنین نویسه‌هایی باشد، " +"در HTML نمایش دهید، از این استفاده کنید. اگر پرچم اختیاری *quote* برابر true" +" باشد (پیش‌فرض)، نویسه‌های (``\"``) و (``'``) نیز تبدیل می‌شوند؛ این کار " +"برای گنجاندن در یک مقدار ویژگی HTML که با علامت‌های نقل‌قول محدود شده است، " +"مانند ```` مفید است. اگر *quote* روی false تنظیم شود، " +"نویسه‌های (``\"``) و (``'``) تبدیل نمی‌شوند." -msgid "Convert all named and numeric character references (e.g. ``>``, ``>``, ``>``) in the string *s* to the corresponding Unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the :data:`list of HTML 5 named character references `." +msgid "" +"Convert all named and numeric character references (e.g. ``>``, " +"``>``, ``>``) in the string *s* to the corresponding Unicode " +"characters. This function uses the rules defined by the HTML 5 standard for" +" both valid and invalid character references, and the :data:`list of HTML 5 " +"named character references `." msgstr "" +"تمام ارجاع‌های نویسه‌ی نام‌دار و عددی (مانند ``>``، ``>``، ``>``)" +" در رشته‌ی *s* را به نویسه‌های یونیکد متناظر تبدیل می‌کند. این تابع از قواعد" +" تعریف‌شده توسط استاندارد HTML 5 برای ارجاع‌های نویسه‌ی معتبر و نامعتبر، و از" +" :data:`فهرست ارجاع‌های نویسه‌ی نام‌دار HTML 5 ` استفاده" +" می‌کند." msgid "Submodules in the ``html`` package are:" -msgstr "" +msgstr "زیرماژول‌های موجود در بسته ``html`` عبارتند از:" msgid ":mod:`html.parser` -- HTML/XHTML parser with lenient parsing mode" -msgstr "" +msgstr ":mod:`html.parser` -- پارسر HTML/XHTML با حالت تجزیه‌ی آسان‌گیر" msgid ":mod:`html.entities` -- HTML entity definitions" -msgstr "" +msgstr ":mod:`html.entities` -- تعاریف entity در HTML" diff --git a/library/http.client.po b/library/http.client.po index 43742dabb..01c60dee8 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -25,34 +25,78 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!http.client` --- HTTP protocol client" -msgstr "" +msgstr ":mod:`!http.client` --- کارخواه پروتکل HTTP" msgid "**Source code:** :source:`Lib/http/client.py`" -msgstr "" +msgstr ":source:`Lib/http/client.py`" -msgid "This module defines classes that implement the client side of the HTTP and HTTPS protocols. It is normally not used directly --- the module :mod:`urllib.request` uses it to handle URLs that use HTTP and HTTPS." +msgid "" +"This module defines classes that implement the client side of the HTTP and " +"HTTPS protocols. It is normally not used directly --- the module " +":mod:`urllib.request` uses it to handle URLs that use HTTP and HTTPS." msgstr "" +"این ماژول کلاس‌هایی را تعریف می‌کند که سمت کلاینت پروتکل‌های HTTP و HTTPS را" +" پیاده‌سازی می‌کنند. این ماژول معمولاً به‌طور مستقیم استفاده نمی‌شود — ماژول" +" :mod:`urllib.request` از آن برای مدیریت URLهایی که از HTTP و HTTPS استفاده" +" می‌کنند، استفاده می‌کند." -msgid "The `Requests package `_ is recommended for a higher-level HTTP client interface." +msgid "" +"The `Requests package `_ is " +"recommended for a higher-level HTTP client interface." msgstr "" +"برای یک رابط کلاینت HTTP سطح بالاتر، `بسته Requests " +"`_ توصیه می‌شود." -msgid "HTTPS support is only available if Python was compiled with SSL support (through the :mod:`ssl` module)." +msgid "" +"HTTPS support is only available if Python was compiled with SSL support " +"(through the :mod:`ssl` module)." msgstr "" +"پشتیبانی از HTTPS تنها در صورتی در دسترس است که پایتون با پشتیبانی از SSL " +"کامپایل شده باشد (از طریق ماژول :mod:`ssl`)." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "The module provides the following classes:" -msgstr "" +msgstr "این ماژول کلاس‌های زیر را فراهم می‌کند:" -msgid "An :class:`HTTPConnection` instance represents one transaction with an HTTP server. It should be instantiated by passing it a host and optional port number. If no port number is passed, the port is extracted from the host string if it has the form ``host:port``, else the default HTTP port (80) is used. If the optional *timeout* parameter is given, blocking operations (like connection attempts) will timeout after that many seconds (if it is not given, the global default timeout setting is used). The optional *source_address* parameter may be a tuple of a (host, port) to use as the source address the HTTP connection is made from. The optional *blocksize* parameter sets the buffer size in bytes for sending a file-like message body." -msgstr "" +msgid "" +"An :class:`HTTPConnection` instance represents one transaction with an HTTP " +"server. It should be instantiated by passing it a host and optional port " +"number. If no port number is passed, the port is extracted from the host " +"string if it has the form ``host:port``, else the default HTTP port (80) is " +"used. If the optional *timeout* parameter is given, blocking operations " +"(like connection attempts) will timeout after that many seconds (if it is " +"not given, the global default timeout setting is used). The optional " +"*source_address* parameter may be a tuple of a (host, port) to use as the " +"source address the HTTP connection is made from. The optional *blocksize* " +"parameter sets the buffer size in bytes for sending a file-like message " +"body." +msgstr "" +"یک نمونه :class:`HTTPConnection` نشان‌دهنده یک تراکنش با یک سرور HTTP است. " +"نمونه‌سازی آن باید با دادن یک میزبان و شماره پورت اختیاری انجام شود. اگر " +"شماره پورتی داده نشود، پورت از رشته میزبان استخراج می‌شود، به شرطی که به شکل" +" ``host:port`` باشد، در غیر این صورت از پورت پیش‌فرض HTTP (۸۰) استفاده " +"می‌شود. اگر پارامتر اختیاری *timeout* داده شود، عملیات‌های مسدودکننده (مانند" +" تلاش‌های اتصال) پس از آن تعداد ثانیه منقضی می‌شوند (اگر داده نشود، از تنظیم" +" سراسری پیش‌فرض timeout استفاده می‌شود). پارامتر اختیاری *source_address* " +"می‌تواند یک تاپل (host, port) باشد که به‌عنوان آدرس مبدأ برای برقراری اتصال " +"HTTP استفاده می‌شود. پارامتر اختیاری *blocksize* اندازه بافر را بر حسب بایت " +"برای ارسال بدنه پیام شبه‌فایل تنظیم می‌کند." -msgid "For example, the following calls all create instances that connect to the server at the same host and port::" +msgid "" +"For example, the following calls all create instances that connect to the " +"server at the same host and port::" msgstr "" +"برای مثال، فراخوانی‌های زیر همگی نمونه‌هایی ایجاد می‌کنند که به سرور در همان" +" میزبان و پورت متصل می‌شوند::" msgid "" ">>> h1 = http.client.HTTPConnection('www.python.org')\n" @@ -60,129 +104,312 @@ msgid "" ">>> h3 = http.client.HTTPConnection('www.python.org', 80)\n" ">>> h4 = http.client.HTTPConnection('www.python.org', 80, timeout=10)" msgstr "" +">>> h1 = http.client.HTTPConnection('www.python.org')\n" +">>> h2 = http.client.HTTPConnection('www.python.org:80')\n" +">>> h3 = http.client.HTTPConnection('www.python.org', 80)\n" +">>> h4 = http.client.HTTPConnection('www.python.org', 80, timeout=10)" msgid "*source_address* was added." -msgstr "" +msgstr "*source_address* افزوده شد." -msgid "The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are no longer supported." +msgid "" +"The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are" +" no longer supported." msgstr "" +"پارامتر *strict* حذف شده است. «پاسخ‌های ساده» به سبک HTTP 0.9 دیگر پشتیبانی " +"نمی‌شوند." msgid "*blocksize* parameter was added." -msgstr "" +msgstr "پارامتر *blocksize* افزوده شد." -msgid "A subclass of :class:`HTTPConnection` that uses SSL for communication with secure servers. Default port is ``443``. If *context* is specified, it must be a :class:`ssl.SSLContext` instance describing the various SSL options." +msgid "" +"A subclass of :class:`HTTPConnection` that uses SSL for communication with " +"secure servers. Default port is ``443``. If *context* is specified, it " +"must be a :class:`ssl.SSLContext` instance describing the various SSL " +"options." msgstr "" +"زیرکلاسی از :class:`HTTPConnection` که از SSL برای ارتباط با سرورهای امن " +"استفاده می‌کند. پورت پیش‌فرض ``443`` است. اگر *context* مشخص شده باشد، باید " +"نمونه‌ای از :class:`ssl.SSLContext` باشد که گزینه‌های مختلف SSL را توصیف " +"می‌کند." -msgid "Please read :ref:`ssl-security` for more information on best practices." +msgid "" +"Please read :ref:`ssl-security` for more information on best practices." msgstr "" +"برای اطلاعات بیشتر درباره بهترین شیوه‌ها، لطفاً :ref:`ssl-security` را " +"بخوانید." msgid "*source_address*, *context* and *check_hostname* were added." -msgstr "" +msgstr "*source_address*، *context* و *check_hostname* افزوده شدند." -msgid "This class now supports HTTPS virtual hosts if possible (that is, if :const:`ssl.HAS_SNI` is true)." +msgid "" +"This class now supports HTTPS virtual hosts if possible (that is, if " +":const:`ssl.HAS_SNI` is true)." msgstr "" +"این کلاس اکنون در صورت امکان (یعنی اگر :const:`ssl.HAS_SNI` true باشد) از " +"میزبان‌های مجازی HTTPS پشتیبانی می‌کند." -msgid "The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are no longer supported." +msgid "" +"The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are " +"no longer supported." msgstr "" +"پارامتر *strict* حذف شد. دیگر از «پاسخ‌های ساده» به سبک HTTP 0.9 پشتیبانی " +"نمی‌شود." -msgid "This class now performs all the necessary certificate and hostname checks by default. To revert to the previous, unverified, behavior :func:`!ssl._create_unverified_context` can be passed to the *context* parameter." +msgid "" +"This class now performs all the necessary certificate and hostname checks by" +" default. To revert to the previous, unverified, behavior " +":func:`!ssl._create_unverified_context` can be passed to the *context* " +"parameter." msgstr "" +"این کلاس اکنون به‌طور پیش‌فرض تمام بررسی‌های لازم برای گواهی و نام " +"میزبان را انجام می‌دهد. برای بازگشت به رفتار قبلی و تأییدنشده، می‌توان " +":func:`!ssl._create_unverified_context` را به پارامتر *context* ارسال کرد." -msgid "This class now enables TLS 1.3 :attr:`ssl.SSLContext.post_handshake_auth` for the default *context* or when *cert_file* is passed with a custom *context*." +msgid "" +"This class now enables TLS 1.3 :attr:`ssl.SSLContext.post_handshake_auth` " +"for the default *context* or when *cert_file* is passed with a custom " +"*context*." msgstr "" +"این کلاس اکنون :attr:`ssl.SSLContext.post_handshake_auth` در TLS 1.3 را برای" +" *context* پیش‌فرض یا زمانی که *cert_file* همراه با یک *context* سفارشی " +"ارسال می‌شود، فعال می‌کند." -msgid "This class now sends an ALPN extension with protocol indicator ``http/1.1`` when no *context* is given. Custom *context* should set ALPN protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`." +msgid "" +"This class now sends an ALPN extension with protocol indicator ``http/1.1`` " +"when no *context* is given. Custom *context* should set ALPN protocols with " +":meth:`~ssl.SSLContext.set_alpn_protocols`." msgstr "" +"این کلاس اکنون هنگامی که هیچ *context* ارائه نشود، یک افزونه ALPN با نشانگر " +"پروتکل ``http/1.1`` ارسال می‌کند. در *context* سفارشی باید پروتکل‌های ALPN " +"با :meth:`~ssl.SSLContext.set_alpn_protocols` تنظیم شوند." -msgid "The deprecated *key_file*, *cert_file* and *check_hostname* parameters have been removed." +msgid "" +"The deprecated *key_file*, *cert_file* and *check_hostname* parameters have " +"been removed." msgstr "" +"پارامترهای منسوخ *key_file*، *cert_file* و *check_hostname* حذف شده‌اند." -msgid "Class whose instances are returned upon successful connection. Not instantiated directly by user." +msgid "" +"Class whose instances are returned upon successful connection. Not " +"instantiated directly by user." msgstr "" +"کلاسی که نمونه‌های آن پس از اتصال موفق برگردانده می‌شوند. این کلاس مستقیماً " +"توسط کاربر نمونه‌سازی نمی‌شود." -msgid "The *strict* parameter was removed. HTTP 0.9 style \"Simple Responses\" are no longer supported." +msgid "" +"The *strict* parameter was removed. HTTP 0.9 style \"Simple Responses\" are " +"no longer supported." msgstr "" +"پارامتر *strict* حذف شد. دیگر از «پاسخ‌های ساده» (Simple Responses) به سبک " +"HTTP 0.9 پشتیبانی نمی‌شود." msgid "This module provides the following function:" -msgstr "" +msgstr "این ماژول تابع زیر را فراهم می‌کند:" -msgid "Parse the headers from a file pointer *fp* representing a HTTP request/response. The file has to be a :class:`~io.BufferedIOBase` reader (i.e. not text) and must provide a valid :rfc:`5322` style header." +msgid "" +"Parse the headers from a file pointer *fp* representing a HTTP " +"request/response. The file has to be a :class:`~io.BufferedIOBase` reader " +"(i.e. not text) and must provide a valid :rfc:`5322` style header." msgstr "" +"سرصفحه‌ها را از یک اشاره‌گر فایل *fp* که نشان‌دهنده‌ی یک درخواست/پاسخ HTTP " +"است، تجزیه کنید. فایل باید یک خواننده‌ی :class:`~io.BufferedIOBase` باشد " +"(یعنی متنی نباشد) و باید سرصفحه‌ای معتبر به سبک :rfc:`5322` ارائه کند." -msgid "This function returns an instance of :class:`http.client.HTTPMessage` that holds the header fields, but no payload (the same as :attr:`HTTPResponse.msg` and :attr:`http.server.BaseHTTPRequestHandler.headers`). After returning, the file pointer *fp* is ready to read the HTTP body." -msgstr "" +msgid "" +"This function returns an instance of :class:`http.client.HTTPMessage` that " +"holds the header fields, but no payload (the same as " +":attr:`HTTPResponse.msg` and " +":attr:`http.server.BaseHTTPRequestHandler.headers`). After returning, the " +"file pointer *fp* is ready to read the HTTP body." +msgstr "" +"این تابع یک نمونه از :class:`http.client.HTTPMessage` را برمی‌گرداند که " +"فیلدهای سرآیند را نگه می‌دارد، اما باری (payload) ندارد (مشابه " +":attr:`HTTPResponse.msg` و " +":attr:`http.server.BaseHTTPRequestHandler.headers`). پس از بازگشت، اشاره‌گر " +"فایل *fp* آماده خواندن بدنه HTTP است." -msgid ":meth:`parse_headers` does not parse the start-line of a HTTP message; it only parses the ``Name: value`` lines. The file has to be ready to read these field lines, so the first line should already be consumed before calling the function." +msgid "" +":meth:`parse_headers` does not parse the start-line of a HTTP message; it " +"only parses the ``Name: value`` lines. The file has to be ready to read " +"these field lines, so the first line should already be consumed before " +"calling the function." msgstr "" +":meth:`parse_headers` خط شروع (start-line) یک پیام HTTP را تجزیه نمی‌کند؛ " +"فقط خطوط ``Name: value`` را تجزیه می‌کند. فایل باید برای خواندن این خطوط " +"فیلد آماده باشد، بنابراین خط اول باید پیش از فراخوانی این تابع مصرف شده " +"باشد." msgid "The following exceptions are raised as appropriate:" -msgstr "" +msgstr "استثناهای زیر در صورت لزوم پرتاب می‌شوند:" -msgid "The base class of the other exceptions in this module. It is a subclass of :exc:`Exception`." +msgid "" +"The base class of the other exceptions in this module. It is a subclass of " +":exc:`Exception`." msgstr "" +"کلاس پایه سایر استثناهای این ماژول. این یک زیرکلاس از :exc:`Exception` است." msgid "A subclass of :exc:`HTTPException`." -msgstr "" +msgstr "زیرکلاسی از :exc:`HTTPException`." -msgid "A subclass of :exc:`HTTPException`, raised if a port is given and is either non-numeric or empty." +msgid "" +"A subclass of :exc:`HTTPException`, raised if a port is given and is either " +"non-numeric or empty." msgstr "" +"زیرکلاسی از :exc:`HTTPException`، که اگر پورتی داده شود و آن پورت غیرعددی یا" +" خالی باشد، پرتاب می‌شود." msgid "A subclass of :exc:`ImproperConnectionState`." -msgstr "" +msgstr "زیرکلاسی از :exc:`ImproperConnectionState`." -msgid "A subclass of :exc:`HTTPException`. Raised if a server responds with a HTTP status code that we don't understand." +msgid "" +"A subclass of :exc:`HTTPException`. Raised if a server responds with a HTTP" +" status code that we don't understand." msgstr "" +"زیرکلاسی از :exc:`HTTPException`. زمانی پرتاب می‌شود که یک سرور با کد وضعیت " +"HTTP پاسخ دهد که ما آن را درک نمی‌کنیم." -msgid "A subclass of :exc:`HTTPException`. Raised if an excessively long line is received in the HTTP protocol from the server." +msgid "" +"A subclass of :exc:`HTTPException`. Raised if an excessively long line is " +"received in the HTTP protocol from the server." msgstr "" +"زیرکلاسی از :exc:`HTTPException`. زمانی پرتاب می‌شود که یک خط بیش از حد " +"طولانی در پروتکل HTTP از سرور دریافت شود." -msgid "A subclass of :exc:`ConnectionResetError` and :exc:`BadStatusLine`. Raised by :meth:`HTTPConnection.getresponse` when the attempt to read the response results in no data read from the connection, indicating that the remote end has closed the connection." +msgid "" +"A subclass of :exc:`ConnectionResetError` and :exc:`BadStatusLine`. Raised " +"by :meth:`HTTPConnection.getresponse` when the attempt to read the response " +"results in no data read from the connection, indicating that the remote end " +"has closed the connection." msgstr "" +"زیرکلاسی از :exc:`ConnectionResetError` و :exc:`BadStatusLine`. زمانی توسط " +":meth:`HTTPConnection.getresponse` پرتاب می‌شود که تلاش برای خواندن پاسخ " +"منجر به خوانده نشدن هیچ داده‌ای از اتصال شود؛ این موضوع نشان می‌دهد که طرف " +"مقابل، اتصال را بسته است." msgid "Previously, :exc:`BadStatusLine`\\ ``('')`` was raised." -msgstr "" +msgstr "پیش‌تر، :exc:`BadStatusLine`\\ ``('')`` پرتاب می‌شد." msgid "The constants defined in this module are:" -msgstr "" +msgstr "ثابت‌های تعریف‌شده در این ماژول عبارت‌اند از:" msgid "The default port for the HTTP protocol (always ``80``)." -msgstr "" +msgstr "پورت پیش‌فرض پروتکل HTTP (همیشه ``80``)." msgid "The default port for the HTTPS protocol (always ``443``)." -msgstr "" +msgstr "پورت پیش‌فرض برای پروتکل HTTPS (همیشه ``443``)." msgid "This dictionary maps the HTTP 1.1 status codes to the W3C names." -msgstr "" +msgstr "این دیکشنری کدهای وضعیت HTTP 1.1 را به نام‌های W3C نگاشت می‌کند." -msgid "Example: ``http.client.responses[http.client.NOT_FOUND]`` is ``'Not Found'``." +msgid "" +"Example: ``http.client.responses[http.client.NOT_FOUND]`` is ``'Not " +"Found'``." msgstr "" +"مثال: ``http.client.responses[http.client.NOT_FOUND]`` برابر با ``'Not " +"Found'`` است." -msgid "See :ref:`http-status-codes` for a list of HTTP status codes that are available in this module as constants." +msgid "" +"See :ref:`http-status-codes` for a list of HTTP status codes that are " +"available in this module as constants." msgstr "" +"برای مشاهده‌ی فهرستی از کدهای وضعیت HTTP که در این ماژول به‌صورت ثابت در " +"دسترس هستند، :ref:`http-status-codes` را ببینید." msgid "HTTPConnection Objects" -msgstr "" +msgstr "اشیای HTTPConnection" msgid ":class:`HTTPConnection` instances have the following methods:" -msgstr "" +msgstr "نمونه‌های :class:`HTTPConnection` دارای متدهای زیر هستند:" -msgid "This will send a request to the server using the HTTP request method *method* and the request URI *url*. The provided *url* must be an absolute path to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` methods)." -msgstr "" +msgid "" +"This will send a request to the server using the HTTP request method " +"*method* and the request URI *url*. The provided *url* must be an absolute " +"path to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless " +"connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` " +"methods)." +msgstr "" +"با این کار، یک درخواست با استفاده از متد درخواست HTTP *method* و URI درخواست" +" *url* به سرور ارسال می‌شود. *url* ارائه‌شده باید یک مسیر مطلق باشد تا با " +":rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` مطابقت داشته باشد (مگر در صورت " +"اتصال به یک سرور پراکسی HTTP یا استفاده از متدهای ``OPTIONS`` یا " +"``CONNECT``)." -msgid "If *body* is specified, the specified data is sent after the headers are finished. It may be a :class:`str`, a :term:`bytes-like object`, an open :term:`file object`, or an iterable of :class:`bytes`. If *body* is a string, it is encoded as ISO-8859-1, the default for HTTP. If it is a bytes-like object, the bytes are sent as is. If it is a :term:`file object`, the contents of the file is sent; this file object should support at least the ``read()`` method. If the file object is an instance of :class:`io.TextIOBase`, the data returned by the ``read()`` method will be encoded as ISO-8859-1, otherwise the data returned by ``read()`` is sent as is. If *body* is an iterable, the elements of the iterable are sent as is until the iterable is exhausted." -msgstr "" +msgid "" +"If *body* is specified, the specified data is sent after the headers are " +"finished. It may be a :class:`str`, a :term:`bytes-like object`, an open " +":term:`file object`, or an iterable of :class:`bytes`. If *body* is a " +"string, it is encoded as ISO-8859-1, the default for HTTP. If it is a " +"bytes-like object, the bytes are sent as is. If it is a :term:`file " +"object`, the contents of the file is sent; this file object should support " +"at least the ``read()`` method. If the file object is an instance of " +":class:`io.TextIOBase`, the data returned by the ``read()`` method will be " +"encoded as ISO-8859-1, otherwise the data returned by ``read()`` is sent as " +"is. If *body* is an iterable, the elements of the iterable are sent as is " +"until the iterable is exhausted." +msgstr "" +"اگر *body* مشخص شده باشد، داده‌ی مشخص‌شده پس از پایان سرآیندها ارسال می‌شود." +" ممکن است یک :class:`str`، یک :term:`bytes-like object`، یک :term:`file " +"object` باز، یا یک پیمایش‌پذیر از :class:`bytes` باشد. اگر *body* یک رشته " +"باشد، به‌صورت ISO-8859-1 کدگذاری می‌شود که پیش‌فرض HTTP است. اگر یک شیء " +"شبه‌بایت باشد، بایت‌ها همان‌طور که هستند ارسال می‌شوند. اگر یک :term:`file" +" object` باشد، محتوای فایل ارسال می‌شود؛ این شیء فایل باید دست‌کم از متد " +"``read()`` پشتیبانی کند. اگر شیء فایل نمونه‌ای از :class:`io.TextIOBase` " +"باشد، داده‌ی بازگشتی از متد ``read()`` به‌صورت ISO-8859-1 کدگذاری خواهد شد، " +"در غیر این صورت داده‌ی بازگشتی از ``read()`` همان‌طور که است ارسال می‌شود. " +"اگر *body* یک پیمایش‌پذیر باشد، عناصر پیمایش‌پذیر همان‌طور که هستند ارسال " +"می‌شوند تا زمانی که پیمایش‌پذیر به پایان برسد." -msgid "The *headers* argument should be a mapping of extra HTTP headers to send with the request. A :rfc:`Host header <2616#section-14.23>` must be provided to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` methods)." -msgstr "" +msgid "" +"The *headers* argument should be a mapping of extra HTTP headers to send " +"with the request. A :rfc:`Host header <2616#section-14.23>` must be provided" +" to conform with :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` (unless " +"connecting to an HTTP proxy server or using the ``OPTIONS`` or ``CONNECT`` " +"methods)." +msgstr "" +"آرگومان *headers* باید یک نگاشت از سرآیندهای HTTP اضافی برای ارسال همراه با " +"درخواست باشد. برای مطابقت با :rfc:`RFC 2616 §5.1.2 <2616#section-5.1.2>` " +"باید یک :rfc:`سرآیند Host <2616#section-14.23>` ارائه شود (مگر اینکه به یک " +"کارساز پراکسی HTTP متصل شوید یا از متدهای ``OPTIONS`` یا ``CONNECT`` " +"استفاده کنید)." -msgid "If *headers* contains neither Content-Length nor Transfer-Encoding, but there is a request body, one of those header fields will be added automatically. If *body* is ``None``, the Content-Length header is set to ``0`` for methods that expect a body (``PUT``, ``POST``, and ``PATCH``). If *body* is a string or a bytes-like object that is not also a :term:`file `, the Content-Length header is set to its length. Any other type of *body* (files and iterables in general) will be chunk-encoded, and the Transfer-Encoding header will automatically be set instead of Content-Length." -msgstr "" +msgid "" +"If *headers* contains neither Content-Length nor Transfer-Encoding, but " +"there is a request body, one of those header fields will be added " +"automatically. If *body* is ``None``, the Content-Length header is set to " +"``0`` for methods that expect a body (``PUT``, ``POST``, and ``PATCH``). If" +" *body* is a string or a bytes-like object that is not also a :term:`file " +"`, the Content-Length header is set to its length. Any other " +"type of *body* (files and iterables in general) will be chunk-encoded, and " +"the Transfer-Encoding header will automatically be set instead of Content-" +"Length." +msgstr "" +"اگر *headers* نه شامل Content-Length و نه شامل Transfer-Encoding باشد، اما " +"بدنه‌ای برای درخواست وجود داشته باشد، یکی از آن فیلدهای سرآیند به‌طور خودکار " +"اضافه خواهد شد. اگر *body* برابر ``None`` باشد، سرآیند Content-Length برای " +"متدهایی که انتظار بدنه دارند (``PUT``، ``POST`` و ``PATCH``) روی ``0`` تنظیم" +" خواهد شد. اگر *body* یک رشته یا یک شیء شبه‌بایت باشد که در عین حال یک " +":term:`فایل ` نیست، سرآیند Content-Length برابر طول آن تنظیم " +"خواهد شد. هر نوع دیگری از *body* (به‌طور کلی فایل‌ها و پیمایش‌پذیرها) به‌صورت " +"کدگذاری تکه‌ای (chunk-encoded) درخواهد آمد و سرآیند Transfer-Encoding به‌طور " +"خودکار به‌جای Content-Length تنظیم خواهد شد." -msgid "The *encode_chunked* argument is only relevant if Transfer-Encoding is specified in *headers*. If *encode_chunked* is ``False``, the HTTPConnection object assumes that all encoding is handled by the calling code. If it is ``True``, the body will be chunk-encoded." +msgid "" +"The *encode_chunked* argument is only relevant if Transfer-Encoding is " +"specified in *headers*. If *encode_chunked* is ``False``, the " +"HTTPConnection object assumes that all encoding is handled by the calling " +"code. If it is ``True``, the body will be chunk-encoded." msgstr "" +"آرگومان *encode_chunked* تنها زمانی مرتبط است که Transfer-Encoding در " +"*headers* مشخص شده باشد. اگر *encode_chunked* برابر ``False`` باشد، شیء " +"HTTPConnection فرض می‌کند که تمام کدگذاری‌ها توسط کد فراخوان مدیریت می‌شود. " +"اگر ``True`` باشد، بدنه به‌صورت تکه‌ای (chunk-encoded) کدگذاری می‌شود." -msgid "For example, to perform a ``GET`` request to ``https://docs.python.org/3/``::" +msgid "" +"For example, to perform a ``GET`` request to " +"``https://docs.python.org/3/``::" msgstr "" +"برای مثال، جهت انجام یک درخواست ``GET`` به ``https://docs.python.org/3/``::" msgid "" ">>> import http.client\n" @@ -193,45 +420,134 @@ msgid "" ">>> print(response.status, response.reason)\n" "200 OK" msgstr "" +">>> import http.client\n" +">>> host = \"docs.python.org\"\n" +">>> conn = http.client.HTTPSConnection(host)\n" +">>> conn.request(\"GET\", \"/3/\", headers={\"Host\": host})\n" +">>> response = conn.getresponse()\n" +">>> print(response.status, response.reason)\n" +"200 OK" -msgid "Chunked transfer encoding has been added to the HTTP protocol version 1.1. Unless the HTTP server is known to handle HTTP 1.1, the caller must either specify the Content-Length, or must pass a :class:`str` or bytes-like object that is not also a file as the body representation." +msgid "" +"Chunked transfer encoding has been added to the HTTP protocol version 1.1. " +"Unless the HTTP server is known to handle HTTP 1.1, the caller must either " +"specify the Content-Length, or must pass a :class:`str` or bytes-like object" +" that is not also a file as the body representation." msgstr "" +"کدگذاری انتقال تکه‌ای (chunked transfer encoding) به نسخه 1.1 پروتکل HTTP " +"افزوده شده است. مگر اینکه مشخص باشد سرور HTTP از HTTP 1.1 پشتیبانی می‌کند، " +"فراخواننده باید یا Content-Length را مشخص کند، یا باید یک شیء :class:`str` " +"یا شیء شبه‌بایت (bytes-like) را که همزمان فایل هم نباشد، به‌عنوان نمایش بدنه" +" ارسال کند." -msgid "Note that you must have read the whole response or call :meth:`close` if :meth:`getresponse` raised an non-:exc:`ConnectionError` exception before you can send a new request to the server." +msgid "" +"Note that you must have read the whole response or call :meth:`close` if " +":meth:`getresponse` raised an non-:exc:`ConnectionError` exception before " +"you can send a new request to the server." msgstr "" +"توجه داشته باشید که پیش از آن‌که بتوانید درخواست جدیدی را به سرور ارسال " +"کنید، باید کل پاسخ را خوانده باشید یا اگر :meth:`getresponse ` " +"استثنایی غیر از :exc:`ConnectionError` پرتاب کرده باشد، :meth:`close " +"` را فراخوانی کرده باشید." msgid "*body* can now be an iterable." -msgstr "" +msgstr "*body* اکنون می‌تواند پیمایش‌پذیر باشد." -msgid "If neither Content-Length nor Transfer-Encoding are set in *headers*, file and iterable *body* objects are now chunk-encoded. The *encode_chunked* argument was added. No attempt is made to determine the Content-Length for file objects." +msgid "" +"If neither Content-Length nor Transfer-Encoding are set in *headers*, file " +"and iterable *body* objects are now chunk-encoded. The *encode_chunked* " +"argument was added. No attempt is made to determine the Content-Length for " +"file objects." msgstr "" +"اگر هیچ‌کدام از Content-Length و Transfer-Encoding در *headers* تنظیم نشده " +"باشند، اشیاء فایل و پیمایش‌پذیر *body* اکنون کدگذاری تکه‌ای (chunk-encoded) " +"می‌شوند. آرگومان *encode_chunked* اضافه شد. هیچ تلاشی برای تعیین Content-" +"Length برای اشیاء فایل انجام نمی‌شود." -msgid "Should be called after a request is sent to get the response from the server. Returns an :class:`HTTPResponse` instance." +msgid "" +"Should be called after a request is sent to get the response from the " +"server. Returns an :class:`HTTPResponse` instance." msgstr "" +"باید پس از ارسال درخواست، برای دریافت پاسخ از سرور فراخوانی شود. یک نمونه " +":class:`HTTPResponse` برمی‌گرداند." -msgid "If a :exc:`ConnectionError` or subclass is raised, the :class:`HTTPConnection` object will be ready to reconnect when a new request is sent." +msgid "" +"If a :exc:`ConnectionError` or subclass is raised, the " +":class:`HTTPConnection` object will be ready to reconnect when a new request" +" is sent." msgstr "" +"اگر یک :exc:`ConnectionError` یا یکی از زیرکلاس‌های آن پرتاب شود، شیء " +":class:`HTTPConnection` هنگامی که درخواست جدیدی ارسال شود، برای اتصال مجدد " +"آماده خواهد بود." -msgid "Note that this does not apply to :exc:`OSError`\\s raised by the underlying socket. Instead the caller is responsible to call :meth:`close` on the existing connection." +msgid "" +"Note that this does not apply to :exc:`OSError`\\s raised by the underlying " +"socket. Instead the caller is responsible to call :meth:`close` on the " +"existing connection." msgstr "" +"توجه داشته باشید که این موضوع به استثناهای :exc:`OSError` پرتاب‌شده توسط " +"سوکت زیرین اعمال نمی‌شود. در عوض، فراخواننده مسئول فراخوانی :meth:`close` " +"روی اتصال موجود است." -msgid "Set the debugging level. The default debug level is ``0``, meaning no debugging output is printed. Any value greater than ``0`` will cause all currently defined debug output to be printed to stdout. The ``debuglevel`` is passed to any new :class:`HTTPResponse` objects that are created." +msgid "" +"Set the debugging level. The default debug level is ``0``, meaning no " +"debugging output is printed. Any value greater than ``0`` will cause all " +"currently defined debug output to be printed to stdout. The ``debuglevel`` " +"is passed to any new :class:`HTTPResponse` objects that are created." msgstr "" +"سطح اشکال‌زدایی را تنظیم کنید. سطح اشکال‌زدایی پیش‌فرض ``0`` است، به این " +"معنا که هیچ خروجی اشکال‌زدایی چاپ نمی‌شود. هر مقدار بزرگ‌تر از ``0`` باعث " +"می‌شود تمام خروجی‌های اشکال‌زدایی که در حال حاضر تعریف شده‌اند، در stdout " +"چاپ شوند. ``debuglevel`` به هر شیء جدید :class:`HTTPResponse` که ایجاد شود، " +"منتقل می‌شود." -msgid "Set the host and the port for HTTP Connect Tunnelling. This allows running the connection through a proxy server." +msgid "" +"Set the host and the port for HTTP Connect Tunnelling. This allows running " +"the connection through a proxy server." msgstr "" +"میزبان و پورت را برای تونل‌زنی HTTP Connect تنظیم کنید. این کار امکان " +"برقراری اتصال از طریق یک سرور پراکسی را فراهم می‌کند." -msgid "The *host* and *port* arguments specify the endpoint of the tunneled connection (i.e. the address included in the CONNECT request, *not* the address of the proxy server)." +msgid "" +"The *host* and *port* arguments specify the endpoint of the tunneled " +"connection (i.e. the address included in the CONNECT request, *not* the " +"address of the proxy server)." msgstr "" +"آرگومان‌های *host* و *port* پایانه‌ی اتصال تونل‌شده را مشخص می‌کنند (یعنی " +"نشانی گنجانده‌شده در درخواست CONNECT، *نه* نشانی سرور پراکسی)." -msgid "The *headers* argument should be a mapping of extra HTTP headers to send with the CONNECT request." +msgid "" +"The *headers* argument should be a mapping of extra HTTP headers to send " +"with the CONNECT request." msgstr "" +"آرگومان *headers* باید یک نگاشت از سرآیندهای HTTP اضافی برای ارسال به‌همراه " +"درخواست CONNECT باشد." -msgid "As HTTP/1.1 is used for HTTP CONNECT tunnelling request, `as per the RFC `_, a HTTP ``Host:`` header must be provided, matching the authority-form of the request target provided as the destination for the CONNECT request. If a HTTP ``Host:`` header is not provided via the headers argument, one is generated and transmitted automatically." -msgstr "" +msgid "" +"As HTTP/1.1 is used for HTTP CONNECT tunnelling request, `as per the RFC " +"`_, a HTTP " +"``Host:`` header must be provided, matching the authority-form of the " +"request target provided as the destination for the CONNECT request. If a " +"HTTP ``Host:`` header is not provided via the headers argument, one is " +"generated and transmitted automatically." +msgstr "" +"از آن‌جا که برای درخواست تونل‌سازی HTTP CONNECT از HTTP/1.1 استفاده می‌شود، " +"`طبق RFC `_، " +"باید یک سرآیند HTTP ``Host:`` ارائه شود که با قالب authority (authority-form)" +" هدف درخواستی که به‌عنوان مقصد درخواست CONNECT ارائه شده است مطابقت داشته " +"باشد. اگر سرآیند HTTP ``Host:`` از طریق آرگومان headers ارائه نشود، یک سرآیند " +"به‌طور خودکار تولید و ارسال می‌شود." -msgid "For example, to tunnel through a HTTPS proxy server running locally on port 8080, we would pass the address of the proxy to the :class:`HTTPSConnection` constructor, and the address of the host that we eventually want to reach to the :meth:`~HTTPConnection.set_tunnel` method::" +msgid "" +"For example, to tunnel through a HTTPS proxy server running locally on port " +"8080, we would pass the address of the proxy to the :class:`HTTPSConnection`" +" constructor, and the address of the host that we eventually want to reach " +"to the :meth:`~HTTPConnection.set_tunnel` method::" msgstr "" +"برای مثال، برای ایجاد تونل از طریق یک سرور پراکسی HTTPS که به‌صورت محلی روی " +"پورت ۸۰۸۰ اجرا می‌شود، نشانی پراکسی را به سازنده‌ی :class:`HTTPSConnection` " +"و نشانی میزبانی را که در نهایت می‌خواهیم به آن دسترسی پیدا کنیم، به متد " +":meth:`~HTTPConnection.set_tunnel` می‌دهیم::" msgid "" ">>> import http.client\n" @@ -239,117 +555,256 @@ msgid "" ">>> conn.set_tunnel(\"www.python.org\")\n" ">>> conn.request(\"HEAD\",\"/index.html\")" msgstr "" +">>> import http.client\n" +">>> conn = http.client.HTTPSConnection(\"localhost\", 8080)\n" +">>> conn.set_tunnel(\"www.python.org\")\n" +">>> conn.request(\"HEAD\",\"/index.html\")" -msgid "HTTP CONNECT tunnelling requests use protocol HTTP/1.1, upgraded from protocol HTTP/1.0. ``Host:`` HTTP headers are mandatory for HTTP/1.1, so one will be automatically generated and transmitted if not provided in the headers argument." +msgid "" +"HTTP CONNECT tunnelling requests use protocol HTTP/1.1, upgraded from " +"protocol HTTP/1.0. ``Host:`` HTTP headers are mandatory for HTTP/1.1, so one" +" will be automatically generated and transmitted if not provided in the " +"headers argument." msgstr "" +"درخواست‌های تونل‌زنی HTTP CONNECT از پروتکل HTTP/1.1 استفاده می‌کنند، که از " +"پروتکل HTTP/1.0 ارتقا یافته است. سرآیند HTTP ``Host:`` برای HTTP/1.1 الزامی " +"است، بنابراین اگر در آرگومان headers ارائه نشده باشد، یک سرآیند به‌طور خودکار" +" تولید و ارسال می‌شود." -msgid "Returns a dictionary with the headers of the response received from the proxy server to the CONNECT request." +msgid "" +"Returns a dictionary with the headers of the response received from the " +"proxy server to the CONNECT request." msgstr "" +"یک دیکشنری شامل سرصفحه‌های پاسخ دریافت‌شده از سرور پراکسی به درخواست CONNECT" +" برمی‌گرداند." msgid "If the CONNECT request was not sent, the method returns ``None``." -msgstr "" +msgstr "اگر درخواست CONNECT ارسال نشده باشد، متد ``None`` را برمی‌گرداند." -msgid "Connect to the server specified when the object was created. By default, this is called automatically when making a request if the client does not already have a connection." +msgid "" +"Connect to the server specified when the object was created. By default, " +"this is called automatically when making a request if the client does not " +"already have a connection." msgstr "" +"به سرور مشخص‌شده در زمان ایجاد شیء متصل می‌شود. به‌طور پیش‌فرض، اگر کلاینت " +"از قبل اتصالی نداشته باشد، این متد به‌صورت خودکار هنگام ارسال درخواست " +"فراخوانی می‌شود." -msgid "Raises an :ref:`auditing event ` ``http.client.connect`` with arguments ``self``, ``host``, ``port``." +msgid "" +"Raises an :ref:`auditing event ` ``http.client.connect`` with " +"arguments ``self``, ``host``, ``port``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``http.client.connect`` را با " +"آرگومان‌های ``self``، ``host`` و ``port`` پرتاب می‌کند." msgid "Close the connection to the server." -msgstr "" +msgstr "بستن اتصال به سرور." msgid "Buffer size in bytes for sending a file-like message body." -msgstr "" +msgstr "اندازه‌ی بافر بر حسب بایت برای ارسال بدنه‌ی پیام شبه‌فایل." -msgid "As an alternative to using the :meth:`~HTTPConnection.request` method described above, you can also send your request step by step, by using the four functions below." +msgid "" +"As an alternative to using the :meth:`~HTTPConnection.request` method " +"described above, you can also send your request step by step, by using the " +"four functions below." msgstr "" +"به‌عنوان جایگزینی برای استفاده از متد :meth:`~HTTPConnection.request` که در " +"بالا توضیح داده شد، می‌توانید با استفاده از چهار تابع زیر، درخواست خود را " +"گام‌به‌گام ارسال کنید." -msgid "This should be the first call after the connection to the server has been made. It sends a line to the server consisting of the *method* string, the *url* string, and the HTTP version (``HTTP/1.1``). To disable automatic sending of ``Host:`` or ``Accept-Encoding:`` headers (for example to accept additional content encodings), specify *skip_host* or *skip_accept_encoding* with non-False values." -msgstr "" +msgid "" +"This should be the first call after the connection to the server has been " +"made. It sends a line to the server consisting of the *method* string, the " +"*url* string, and the HTTP version (``HTTP/1.1``). To disable automatic " +"sending of ``Host:`` or ``Accept-Encoding:`` headers (for example to accept " +"additional content encodings), specify *skip_host* or *skip_accept_encoding*" +" with non-False values." +msgstr "" +"این باید اولین فراخوانی پس از برقراری اتصال به سرور باشد. این فراخوانی خطی " +"را به سرور می‌فرستد که شامل رشته‌ی *method*، رشته‌ی *url* و نسخه‌ی HTTP " +"(``HTTP/1.1``) است. برای غیرفعال‌سازی ارسال خودکار سرآیندهای ``Host:`` یا " +"``Accept-Encoding:`` (برای مثال برای پذیرش کدگذاری‌های اضافی محتوا)، " +"*skip_host* یا *skip_accept_encoding* را با مقادیری غیر از False تعیین کنید." -msgid "Send an :rfc:`822`\\ -style header to the server. It sends a line to the server consisting of the header, a colon and a space, and the first argument. If more arguments are given, continuation lines are sent, each consisting of a tab and an argument." +msgid "" +"Send an :rfc:`822`\\ -style header to the server. It sends a line to the " +"server consisting of the header, a colon and a space, and the first " +"argument. If more arguments are given, continuation lines are sent, each " +"consisting of a tab and an argument." msgstr "" +"این متد یک سرآیند به سبک :rfc:`822` را به سرور ارسال می‌کند. این متد خطی را " +"به سرور می‌فرستد که شامل سرآیند، یک دونقطه و یک فاصله، و اولین آرگومان است. " +"اگر آرگومان‌های بیشتری داده شوند، خط‌های ادامه ارسال می‌شوند که هر یک شامل " +"یک تب و یک آرگومان است." -msgid "Send a blank line to the server, signalling the end of the headers. The optional *message_body* argument can be used to pass a message body associated with the request." +msgid "" +"Send a blank line to the server, signalling the end of the headers. The " +"optional *message_body* argument can be used to pass a message body " +"associated with the request." msgstr "" +"یک خط خالی به سرور ارسال کنید تا پایان سرآیندها اعلام شود. می‌توانید از " +"آرگومان اختیاری *message_body* برای ارسال بدنه پیام مرتبط با درخواست استفاده" +" کنید." -msgid "If *encode_chunked* is ``True``, the result of each iteration of *message_body* will be chunk-encoded as specified in :rfc:`7230`, Section 3.3.1. How the data is encoded is dependent on the type of *message_body*. If *message_body* implements the :ref:`buffer interface ` the encoding will result in a single chunk. If *message_body* is a :class:`collections.abc.Iterable`, each iteration of *message_body* will result in a chunk. If *message_body* is a :term:`file object`, each call to ``.read()`` will result in a chunk. The method automatically signals the end of the chunk-encoded data immediately after *message_body*." -msgstr "" +msgid "" +"If *encode_chunked* is ``True``, the result of each iteration of " +"*message_body* will be chunk-encoded as specified in :rfc:`7230`, Section " +"3.3.1. How the data is encoded is dependent on the type of *message_body*." +" If *message_body* implements the :ref:`buffer interface ` " +"the encoding will result in a single chunk. If *message_body* is a " +":class:`collections.abc.Iterable`, each iteration of *message_body* will " +"result in a chunk. If *message_body* is a :term:`file object`, each call to" +" ``.read()`` will result in a chunk. The method automatically signals the " +"end of the chunk-encoded data immediately after *message_body*." +msgstr "" +"اگر *encode_chunked* برابر ``True`` باشد، نتیجه هر تکرار از *message_body* " +"به‌صورت تکه‌ای کدگذاری می‌شود (chunk-encoded)، همان‌طور که در :rfc:`7230`، " +"بخش 3.3.1 مشخص شده است. نحوه کدگذاری داده‌ها به نوع *message_body* وابسته " +"است. اگر *message_body* :ref:`رابط بافر ` را پیاده‌سازی کند، " +"کدگذاری منجر به یک تکه واحد (chunk) می‌شود. اگر *message_body* یک " +":class:`collections.abc.Iterable` باشد، هر تکرار از *message_body* منجر به " +"یک تکه می‌شود. اگر *message_body* یک :term:`شیء فایل ` باشد، هر" +" فراخوانی ``.read()`` منجر به یک تکه می‌شود. این متد به‌طور خودکار پایان " +"داده‌های کدگذاری‌شده به‌صورت تکه‌ای را بلافاصله پس از *message_body* اعلام " +"می‌کند." -msgid "Due to the chunked encoding specification, empty chunks yielded by an iterator body will be ignored by the chunk-encoder. This is to avoid premature termination of the read of the request by the target server due to malformed encoding." +msgid "" +"Due to the chunked encoding specification, empty chunks yielded by an " +"iterator body will be ignored by the chunk-encoder. This is to avoid " +"premature termination of the read of the request by the target server due to" +" malformed encoding." msgstr "" +"به دلیل مشخصات کدگذاری تکه‌ای (chunked encoding)، تکه‌های خالی که توسط بدنه‌ی" +" پیمایش‌گر (iterator) تولید می‌شوند، توسط کدگذار تکه‌ای (chunk-encoder) نادیده" +" گرفته می‌شوند. این برای جلوگیری از خاتمه زودهنگام خواندن درخواست توسط سرور " +"هدف به دلیل کدگذاری نادرست است." msgid "Added chunked encoding support and the *encode_chunked* parameter." msgstr "" +"پشتیبانی از کدگذاری تکه‌ای (chunked encoding) و پارامتر *encode_chunked* " +"افزوده شد." -msgid "Send data to the server. This should be used directly only after the :meth:`endheaders` method has been called and before :meth:`getresponse` is called." +msgid "" +"Send data to the server. This should be used directly only after the " +":meth:`endheaders` method has been called and before :meth:`getresponse` is " +"called." msgstr "" +"داده را به سرور ارسال می‌کند. این متد باید فقط پس از فراخوانی متد " +":meth:`endheaders` و پیش از فراخوانی :meth:`getresponse` به‌طور مستقیم " +"استفاده شود." -msgid "Raises an :ref:`auditing event ` ``http.client.send`` with arguments ``self``, ``data``." +msgid "" +"Raises an :ref:`auditing event ` ``http.client.send`` with " +"arguments ``self``, ``data``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``http.client.send`` را با آرگومان‌های " +"``self`` و ``data`` پرتاب می‌کند." msgid "HTTPResponse Objects" -msgstr "" +msgstr "اشیاء HTTPResponse" -msgid "An :class:`HTTPResponse` instance wraps the HTTP response from the server. It provides access to the request headers and the entity body. The response is an iterable object and can be used in a with statement." +msgid "" +"An :class:`HTTPResponse` instance wraps the HTTP response from the server. " +"It provides access to the request headers and the entity body. The response" +" is an iterable object and can be used in a with statement." msgstr "" +"یک نمونه از :class:`HTTPResponse` پاسخ HTTP از سرور را دربر می‌گیرد. این " +"نمونه دسترسی به سرآیندهای درخواست و بدنه‌ی موجودیت را فراهم می‌کند. پاسخ یک " +"شیء پیمایش‌پذیر است و می‌توان از آن در یک دستور with استفاده کرد." -msgid "The :class:`io.BufferedIOBase` interface is now implemented and all of its reader operations are supported." +msgid "" +"The :class:`io.BufferedIOBase` interface is now implemented and all of its " +"reader operations are supported." msgstr "" +"رابط :class:`io.BufferedIOBase` اکنون پیاده‌سازی شده است و تمام عملیات " +"خواندن آن پشتیبانی می‌شود." msgid "Reads and returns the response body, or up to the next *amt* bytes." -msgstr "" +msgstr "بدنه پاسخ یا حداکثر تا *amt* بایت بعدی را می‌خواند و برمی‌گرداند." -msgid "Reads up to the next len(b) bytes of the response body into the buffer *b*. Returns the number of bytes read." +msgid "" +"Reads up to the next len(b) bytes of the response body into the buffer *b*. " +"Returns the number of bytes read." msgstr "" +"حداکثر len(b) بایت بعدی از بدنه پاسخ را در بافر *b* می‌خواند. تعداد بایت‌های" +" خوانده‌شده را برمی‌گرداند." -msgid "Return the value of the header *name*, or *default* if there is no header matching *name*. If there is more than one header with the name *name*, return all of the values joined by ', '. If *default* is any iterable other than a single string, its elements are similarly returned joined by commas." +msgid "" +"Return the value of the header *name*, or *default* if there is no header " +"matching *name*. If there is more than one header with the name *name*, " +"return all of the values joined by ', '. If *default* is any iterable other" +" than a single string, its elements are similarly returned joined by commas." msgstr "" +"مقدار سرآیند *name* را برمی‌گرداند، یا اگر سرآیندی مطابق با *name* وجود نداشته" +" باشد، *default* را برمی‌گرداند. اگر بیش از یک سرآیند با نام *name* وجود " +"داشته باشد، تمام مقادیر را که با ', ' به هم پیوسته‌اند برمی‌گرداند. اگر " +"*default* هر پیمایش‌پذیری به‌جز یک رشته تنها باشد، عناصر آن نیز به همین ترتیب " +"با ویرگول به هم پیوسته و برگردانده می‌شوند." msgid "Return a list of (header, value) tuples." -msgstr "" +msgstr "فهرستی از تاپل‌های (سرآیند، مقدار) برمی‌گرداند." msgid "Return the ``fileno`` of the underlying socket." -msgstr "" +msgstr "``fileno`` سوکت زیرین را برمی‌گرداند." -msgid "A :class:`http.client.HTTPMessage` instance containing the response headers. :class:`http.client.HTTPMessage` is a subclass of :class:`email.message.Message`." +msgid "" +"A :class:`http.client.HTTPMessage` instance containing the response headers." +" :class:`http.client.HTTPMessage` is a subclass of " +":class:`email.message.Message`." msgstr "" +"یک نمونه :class:`http.client.HTTPMessage` که شامل سرآیندهای پاسخ است. " +":class:`http.client.HTTPMessage` زیرکلاسی از :class:`email.message.Message` " +"است." -msgid "HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1." +msgid "" +"HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1." msgstr "" +"نسخه‌ی پروتکل HTTP که سرور از آن استفاده می‌کند. 10 برای HTTP/1.0 و 11 برای " +"HTTP/1.1." -msgid "URL of the resource retrieved, commonly used to determine if a redirect was followed." +msgid "" +"URL of the resource retrieved, commonly used to determine if a redirect was " +"followed." msgstr "" +"URL منبع واکشی‌شده، معمولاً برای تشخیص اینکه آیا یک تغییرمسیر دنبال شده است " +"استفاده می‌شود." -msgid "Headers of the response in the form of an :class:`email.message.EmailMessage` instance." +msgid "" +"Headers of the response in the form of an " +":class:`email.message.EmailMessage` instance." msgstr "" +"سرآیندهای پاسخ در قالب یک نمونه از :class:`email.message.EmailMessage`." msgid "Status code returned by server." -msgstr "" +msgstr "کد وضعیت برگردانده‌شده توسط سرور." msgid "Reason phrase returned by server." -msgstr "" +msgstr "عبارت دلیل برگردانده‌شده از سوی سرور." -msgid "A debugging hook. If :attr:`debuglevel` is greater than zero, messages will be printed to stdout as the response is read and parsed." +msgid "" +"A debugging hook. If :attr:`debuglevel` is greater than zero, messages will" +" be printed to stdout as the response is read and parsed." msgstr "" +"یک قلاب اشکال‌زدایی . اگر :attr:`debuglevel` بزرگ‌تر از صفر باشد، در " +"حین خوانده و تجزیه شدن پاسخ، پیام‌ها در stdout چاپ خواهند شد." msgid "Is ``True`` if the stream is closed." -msgstr "" +msgstr "اگر جریان بسته باشد، ``True`` است." msgid "Deprecated in favor of :attr:`~HTTPResponse.url`." -msgstr "" +msgstr "منسوخ‌شده به نفع :attr:`~HTTPResponse.url`." msgid "Deprecated in favor of :attr:`~HTTPResponse.headers`." -msgstr "" +msgstr "منسوخ‌شده به نفع :attr:`~HTTPResponse.headers`." msgid "Deprecated in favor of :attr:`~HTTPResponse.status`." -msgstr "" +msgstr "منسوخ شده به نفع :attr:`~HTTPResponse.status`." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Here is an example session that uses the ``GET`` method::" -msgstr "" +msgstr "در اینجا یک نشست نمونه آمده است که از متد ``GET`` استفاده می‌کند::" msgid "" ">>> import http.client\n" @@ -375,9 +830,35 @@ msgid "" ">>> data2 = r2.read()\n" ">>> conn.close()" msgstr "" +">>> import http.client\n" +">>> conn = http.client.HTTPSConnection(\"www.python.org\")\n" +">>> conn.request(\"GET\", \"/\")\n" +">>> r1 = conn.getresponse()\n" +">>> print(r1.status, r1.reason)\n" +"200 OK\n" +">>> data1 = r1.read() # This will return entire content.\n" +">>> # The following example demonstrates reading data in chunks.\n" +">>> conn.request(\"GET\", \"/\")\n" +">>> r1 = conn.getresponse()\n" +">>> while chunk := r1.read(200):\n" +"... print(repr(chunk))\n" +"b'\\n'\n" @@ -140,9 +253,28 @@ msgid "" "-->'ham',\n" "]" msgstr "" +">>> aRepr.indent = '-->'\n" +">>> print(aRepr.repr(example))\n" +"[\n" +"-->1,\n" +"-->'spam',\n" +"-->{\n" +"-->-->'a': 2,\n" +"-->-->'b': 'spam eggs',\n" +"-->-->'c': {\n" +"-->-->-->3: 4.5,\n" +"-->-->-->6: [],\n" +"-->-->},\n" +"-->},\n" +"-->'ham',\n" +"]" -msgid "Setting :attr:`~Repr.indent` to a positive integer value behaves as if it was set to a string with that number of spaces:" +msgid "" +"Setting :attr:`~Repr.indent` to a positive integer value behaves as if it " +"was set to a string with that number of spaces:" msgstr "" +"اگر :attr:`~Repr.indent` را به یک مقدار عدد صحیح مثبت تنظیم کنید، به‌گونه‌ای" +" رفتار می‌کند که گویی به رشته‌ای با آن تعداد فاصله تنظیم شده باشد:" msgid "" ">>> aRepr.indent = 4\n" @@ -161,21 +293,70 @@ msgid "" " 'ham',\n" "]" msgstr "" +">>> aRepr.indent = 4\n" +">>> print(aRepr.repr(example))\n" +"[\n" +" 1,\n" +" 'spam',\n" +" {\n" +" 'a': 2,\n" +" 'b': 'spam eggs',\n" +" 'c': {\n" +" 3: 4.5,\n" +" 6: [],\n" +" },\n" +" },\n" +" 'ham',\n" +"]" -msgid "The equivalent to the built-in :func:`repr` that uses the formatting imposed by the instance." +msgid "" +"The equivalent to the built-in :func:`repr` that uses the formatting imposed" +" by the instance." msgstr "" +"معادل تابع توکار :func:`repr` که از قالب‌بندی اعمال‌شده توسط نمونه استفاده " +"می‌کند." -msgid "Recursive implementation used by :meth:`.repr`. This uses the type of *obj* to determine which formatting method to call, passing it *obj* and *level*. The type-specific methods should call :meth:`repr1` to perform recursive formatting, with ``level - 1`` for the value of *level* in the recursive call." -msgstr "" +msgid "" +"Recursive implementation used by :meth:`.repr`. This uses the type of *obj*" +" to determine which formatting method to call, passing it *obj* and *level*." +" The type-specific methods should call :meth:`repr1` to perform recursive " +"formatting, with ``level - 1`` for the value of *level* in the recursive " +"call." +msgstr "" +"پیاده‌سازی بازگشتی که توسط :meth:`.repr` استفاده می‌شود. این پیاده‌سازی از " +"نوع *obj* برای تعیین متد قالب‌بندی مناسب جهت فراخوانی استفاده می‌کند و *obj*" +" و *level* را به آن منتقل می‌کند. متدهای مخصوص نوع باید برای انجام قالب‌بندی" +" بازگشتی، :meth:`repr1` را فراخوانی کنند و در فراخوانی بازگشتی، ``level - " +"1`` را به‌عنوان مقدار *level* استفاده کنند." -msgid "Formatting methods for specific types are implemented as methods with a name based on the type name. In the method name, **TYPE** is replaced by ``'_'.join(type(obj).__name__.split())``. Dispatch to these methods is handled by :meth:`repr1`. Type-specific methods which need to recursively format a value should call ``self.repr1(subobj, level - 1)``." -msgstr "" +msgid "" +"Formatting methods for specific types are implemented as methods with a name" +" based on the type name. In the method name, **TYPE** is replaced by " +"``'_'.join(type(obj).__name__.split())``. Dispatch to these methods is " +"handled by :meth:`repr1`. Type-specific methods which need to recursively " +"format a value should call ``self.repr1(subobj, level - 1)``." +msgstr "" +"متدهای قالب‌بندی برای انواع خاص به‌صورت متدهایی با نامی مبتنی بر نام نوع " +"پیاده‌سازی شده‌اند. در نام متد، **TYPE** با " +"``'_'.join(type(obj).__name__.split())`` جایگزین می‌شود. اعزام (dispatch) به" +" این متدها توسط :meth:`repr1` مدیریت می‌شود. متدهای مختص به نوعی که نیاز " +"دارند یک مقدار را به‌صورت بازگشتی قالب‌بندی کنند، باید ``self.repr1(subobj, " +"level - 1)`` را فراخوانی کنند." msgid "Subclassing Repr Objects" -msgstr "" +msgstr "زیرکلاس‌سازی اشیاء Repr" -msgid "The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of :class:`Repr` to add support for additional built-in object types or to modify the handling of types already supported. This example shows how special support for file objects could be added:" +msgid "" +"The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of " +":class:`Repr` to add support for additional built-in object types or to " +"modify the handling of types already supported. This example shows how " +"special support for file objects could be added:" msgstr "" +"استفاده از اعزام پویا (dynamic dispatching) توسط :meth:`Repr.repr1` به " +"زیرکلاس‌های :class:`Repr` اجازه می‌دهد پشتیبانی از انواع بیشتری از اشیای " +"توکار را اضافه کنند یا مدیریت انواع از پیش پشتیبانی‌شده را تغییر دهند. این " +"مثال نشان می‌دهد که چگونه می‌توان پشتیبانی ویژه‌ای برای اشیای فایل اضافه " +"کرد:" msgid "" "import reprlib\n" @@ -191,12 +372,24 @@ msgid "" "aRepr = MyRepr()\n" "print(aRepr.repr(sys.stdin)) # prints ''" msgstr "" +"import reprlib\n" +"import sys\n" +"\n" +"class MyRepr(reprlib.Repr):\n" +"\n" +" def repr_TextIOWrapper(self, obj, level):\n" +" if obj.name in {'', '', ''}:\n" +" return obj.name\n" +" return repr(obj)\n" +"\n" +"aRepr = MyRepr()\n" +"print(aRepr.repr(sys.stdin)) # prints ''" msgid "" -msgstr "" +msgstr "" msgid "..." -msgstr "" +msgstr "..." msgid "placeholder" -msgstr "" +msgstr "جای‌نگهدار" diff --git a/library/resource.po b/library/resource.po index 2577a87a7..1479f1349 100644 --- a/library/resource.po +++ b/library/resource.po @@ -26,148 +26,324 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!resource` --- Resource usage information" -msgstr "" +msgstr ":mod:`!resource` --- اطلاعات مصرف منابع" -msgid "This module provides basic mechanisms for measuring and controlling system resources utilized by a program." +msgid "" +"This module provides basic mechanisms for measuring and controlling system " +"resources utilized by a program." msgstr "" +"این ماژول سازوکارهای پایه‌ای را برای اندازه‌گیری و کنترل منابع سیستمی که " +"توسط یک برنامه استفاده می‌شوند، فراهم می‌کند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "Symbolic constants are used to specify particular system resources and to request usage information about either the current process or its children." +msgid "" +"Symbolic constants are used to specify particular system resources and to " +"request usage information about either the current process or its children." msgstr "" +"ثابت‌های نمادین برای مشخص کردن منابع سیستمی خاص و درخواست اطلاعات استفاده " +"درباره‌ی فرایند جاری یا فرزندان آن استفاده می‌شوند." msgid "An :exc:`OSError` is raised on syscall failure." -msgstr "" +msgstr "در صورت شکست فراخوانی سیستمی، استثنای :exc:`OSError` پرتاب می‌شود." msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "یک نام مستعار منسوخ از :exc:`OSError`." msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." -msgstr "" +msgstr "پیرو :pep:`3151`، این کلاس به نام مستعار :exc:`OSError` تبدیل شد." msgid "Resource Limits" -msgstr "" +msgstr "محدودیت‌های منابع" -msgid "Resources usage can be limited using the :func:`setrlimit` function described below. Each resource is controlled by a pair of limits: a soft limit and a hard limit. The soft limit is the current limit, and may be lowered or raised by a process over time. The soft limit can never exceed the hard limit. The hard limit can be lowered to any value greater than the soft limit, but not raised. (Only processes with the effective UID of the super-user can raise a hard limit.)" -msgstr "" +msgid "" +"Resources usage can be limited using the :func:`setrlimit` function " +"described below. Each resource is controlled by a pair of limits: a soft " +"limit and a hard limit. The soft limit is the current limit, and may be " +"lowered or raised by a process over time. The soft limit can never exceed " +"the hard limit. The hard limit can be lowered to any value greater than the " +"soft limit, but not raised. (Only processes with the effective UID of the " +"super-user can raise a hard limit.)" +msgstr "" +"مصرف منابع می‌تواند با استفاده از تابع :func:`setrlimit` که در ادامه توضیح " +"داده شده است، محدود شود. هر منبع با یک جفت حد کنترل می‌شود: یک حد نرم و یک " +"حد سخت. حد نرم، حد فعلی است و ممکن است در طول زمان توسط یک فرایند کاهش یا " +"افزایش یابد. حد نرم هرگز نمی‌تواند از حد سخت فراتر رود. حد سخت می‌تواند به " +"هر مقداری که بزرگ‌تر از حد نرم باشد کاهش یابد، اما نمی‌تواند افزایش یابد. " +"(تنها فرایندهایی که UID مؤثر ابرکاربر را دارند، می‌توانند یک حد سخت را " +"افزایش دهند.)" -msgid "The specific resources that can be limited are system dependent. They are described in the :manpage:`getrlimit(2)` man page. The resources listed below are supported when the underlying operating system supports them; resources which cannot be checked or controlled by the operating system are not defined in this module for those platforms." -msgstr "" +msgid "" +"The specific resources that can be limited are system dependent. They are " +"described in the :manpage:`getrlimit(2)` man page. The resources listed " +"below are supported when the underlying operating system supports them; " +"resources which cannot be checked or controlled by the operating system are " +"not defined in this module for those platforms." +msgstr "" +"منابع خاصی که می‌توانند محدود شوند، به سیستم وابسته‌اند. این منابع در صفحه " +"راهنمای :manpage:`getrlimit(2)` توضیح داده شده‌اند. منابع فهرست‌شده در زیر " +"زمانی پشتیبانی می‌شوند که سیستم‌عامل زیربنایی از آن‌ها پشتیبانی کند؛ منابعی " +"که سیستم‌عامل نمی‌تواند آن‌ها را بررسی یا کنترل کند، در این ماژول برای آن " +"پلتفرم‌ها تعریف نشده‌اند." msgid "Constant used to represent the limit for an unlimited resource." -msgstr "" +msgstr "ثابتی که برای نشان دادن محدودیت یک منبع نامحدود استفاده می‌شود." -msgid "Returns a tuple ``(soft, hard)`` with the current soft and hard limits of *resource*. Raises :exc:`ValueError` if an invalid resource is specified, or :exc:`error` if the underlying system call fails unexpectedly." +msgid "" +"Returns a tuple ``(soft, hard)`` with the current soft and hard limits of " +"*resource*. Raises :exc:`ValueError` if an invalid resource is specified, or" +" :exc:`error` if the underlying system call fails unexpectedly." msgstr "" +"یک تاپل ``(soft, hard)`` شامل محدودیت‌های نرم و سخت فعلی برای *resource* " +"برمی‌گرداند. اگر منبع نامعتبری تعیین شده باشد، :exc:`ValueError` پرتاب " +"می‌کند، یا اگر فراخوانی سیستمی زیربنایی به‌طور غیرمنتظره‌ای شکست بخورد، " +":exc:`error` پرتاب می‌کند." -msgid "Sets new limits of consumption of *resource*. The *limits* argument must be a tuple ``(soft, hard)`` of two integers describing the new limits. A value of :const:`~resource.RLIM_INFINITY` can be used to request a limit that is unlimited." +msgid "" +"Sets new limits of consumption of *resource*. The *limits* argument must be " +"a tuple ``(soft, hard)`` of two integers describing the new limits. A value " +"of :const:`~resource.RLIM_INFINITY` can be used to request a limit that is " +"unlimited." msgstr "" +"محدودیت‌های جدید مصرف *resource* را تنظیم می‌کند. آرگومان *limits* باید یک " +"تاپل ``(soft, hard)`` شامل ۲ عدد صحیح باشد که محدودیت‌های جدید را توصیف " +"می‌کند. می‌توان از مقدار :const:`~resource.RLIM_INFINITY` برای درخواست " +"محدودیتی نامحدود استفاده کرد." -msgid "Raises :exc:`ValueError` if an invalid resource is specified, if the new soft limit exceeds the hard limit, or if a process tries to raise its hard limit. Specifying a limit of :const:`~resource.RLIM_INFINITY` when the hard or system limit for that resource is not unlimited will result in a :exc:`ValueError`. A process with the effective UID of super-user can request any valid limit value, including unlimited, but :exc:`ValueError` will still be raised if the requested limit exceeds the system imposed limit." -msgstr "" +msgid "" +"Raises :exc:`ValueError` if an invalid resource is specified, if the new " +"soft limit exceeds the hard limit, or if a process tries to raise its hard " +"limit. Specifying a limit of :const:`~resource.RLIM_INFINITY` when the hard " +"or system limit for that resource is not unlimited will result in a " +":exc:`ValueError`. A process with the effective UID of super-user can " +"request any valid limit value, including unlimited, but :exc:`ValueError` " +"will still be raised if the requested limit exceeds the system imposed " +"limit." +msgstr "" +"اگر منبع نامعتبری مشخص شود، اگر محدودیت نرم جدید از محدودیت سخت فراتر رود، " +"یا اگر فرایندی سعی کند محدودیت سخت خود را افزایش دهد، :exc:`ValueError` " +"پرتاب می‌شود. مشخص کردن محدودیت با مقدار :const:`~resource.RLIM_INFINITY` در" +" حالی که محدودیت سخت یا محدودیت سیستم برای آن منبع نامحدود نباشد، باعث پرتاب" +" :exc:`ValueError` می‌شود. فرایندی با UID مؤثر ابرکاربر می‌تواند هر مقدار " +"معتبری برای محدودیت، از جمله نامحدود، درخواست کند، اما اگر محدودیت درخواستی " +"از محدودیت اعمال‌شده از سوی سیستم فراتر رود، همچنان :exc:`ValueError` پرتاب " +"می‌شود." -msgid "``setrlimit`` may also raise :exc:`error` if the underlying system call fails." +msgid "" +"``setrlimit`` may also raise :exc:`error` if the underlying system call " +"fails." msgstr "" +"همچنین ممکن است ``setrlimit`` در صورت شکست خوردن فراخوانی سیستمی زیربنایی، " +":exc:`error` را پرتاب کند." msgid "VxWorks only supports setting :const:`RLIMIT_NOFILE`." -msgstr "" +msgstr "VxWorks فقط از تنظیم :const:`RLIMIT_NOFILE` پشتیبانی می‌کند." -msgid "Raises an :ref:`auditing event ` ``resource.setrlimit`` with arguments ``resource``, ``limits``." +msgid "" +"Raises an :ref:`auditing event ` ``resource.setrlimit`` with " +"arguments ``resource``, ``limits``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``resource.setrlimit`` را با آرگومان‌های" +" ``resource`` و ``limits`` پرتاب می‌کند." -msgid "Combines :func:`setrlimit` and :func:`getrlimit` in one function and supports to get and set the resources limits of an arbitrary process. If *pid* is 0, then the call applies to the current process. *resource* and *limits* have the same meaning as in :func:`setrlimit`, except that *limits* is optional." -msgstr "" +msgid "" +"Combines :func:`setrlimit` and :func:`getrlimit` in one function and " +"supports to get and set the resources limits of an arbitrary process. If " +"*pid* is 0, then the call applies to the current process. *resource* and " +"*limits* have the same meaning as in :func:`setrlimit`, except that *limits*" +" is optional." +msgstr "" +":func:`setrlimit` و :func:`getrlimit` را در یک تابع ترکیب می‌کند و امکان " +"دریافت و تنظیم محدودیت‌های منابع یک فرایند دلخواه را فراهم می‌سازد. اگر " +"*pid* برابر ۰ باشد، این فراخوانی به فرایند جاری اعمال می‌شود. *resource* و " +"*limits* همان معنایی را دارند که در :func:`setrlimit` دارند، با این تفاوت که" +" *limits* اختیاری است." -msgid "When *limits* is not given the function returns the *resource* limit of the process *pid*. When *limits* is given the *resource* limit of the process is set and the former resource limit is returned." +msgid "" +"When *limits* is not given the function returns the *resource* limit of the " +"process *pid*. When *limits* is given the *resource* limit of the process is" +" set and the former resource limit is returned." msgstr "" +"هنگامی که *limits* داده نشود، تابع محدودیت منبع فرایند *pid* را برمی‌گرداند." +" هنگامی که *limits* داده شود، محدودیت منبع فرایند تنظیم می‌شود و محدودیت " +"منبع پیشین برگردانده می‌شود." -msgid "Raises :exc:`ProcessLookupError` when *pid* can't be found and :exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for the process." +msgid "" +"Raises :exc:`ProcessLookupError` when *pid* can't be found and " +":exc:`PermissionError` when the user doesn't have ``CAP_SYS_RESOURCE`` for " +"the process." msgstr "" +":exc:`ProcessLookupError` را هنگامی که *pid* یافت نشود و " +":exc:`PermissionError` را هنگامی که کاربر ``CAP_SYS_RESOURCE`` برای فرایند " +"نداشته باشد، پرتاب می‌کند." -msgid "Raises an :ref:`auditing event ` ``resource.prlimit`` with arguments ``pid``, ``resource``, ``limits``." +msgid "" +"Raises an :ref:`auditing event ` ``resource.prlimit`` with " +"arguments ``pid``, ``resource``, ``limits``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``resource.prlimit`` را با آرگومان‌های " +"``pid``، ``resource`` و ``limits`` پرتاب می‌کند." -msgid "These symbols define resources whose consumption can be controlled using the :func:`setrlimit` and :func:`getrlimit` functions described below. The values of these symbols are exactly the constants used by C programs." +msgid "" +"These symbols define resources whose consumption can be controlled using the" +" :func:`setrlimit` and :func:`getrlimit` functions described below. The " +"values of these symbols are exactly the constants used by C programs." msgstr "" +"این نمادها منابعی را تعریف می‌کنند که مصرف آن‌ها را می‌توان با استفاده از " +"توابع :func:`setrlimit` و :func:`getrlimit` که در ادامه توضیح داده شده‌اند، " +"کنترل کرد. مقادیر این نمادها دقیقاً همان ثابت‌هایی هستند که برنامه‌های C از " +"آن‌ها استفاده می‌کنند." -msgid "The Unix man page for :manpage:`getrlimit(2)` lists the available resources. Note that not all systems use the same symbol or same value to denote the same resource. This module does not attempt to mask platform differences --- symbols not defined for a platform will not be available from this module on that platform." -msgstr "" +msgid "" +"The Unix man page for :manpage:`getrlimit(2)` lists the available resources." +" Note that not all systems use the same symbol or same value to denote the " +"same resource. This module does not attempt to mask platform differences " +"--- symbols not defined for a platform will not be available from this " +"module on that platform." +msgstr "" +"صفحه راهنمای یونیکس برای :manpage:`getrlimit(2)` منابع موجود را فهرست " +"می‌کند. توجه داشته باشید که تمام سیستم‌ها از نماد یا مقدار یکسانی برای نشان " +"دادن یک منبع یکسان استفاده نمی‌کنند. این ماژول تلاش نمی‌کند تفاوت‌های سکو " +"را بپوشاند --- نمادهایی که برای یک سکو تعریف نشده‌اند، در آن سکو از این " +"ماژول در دسترس نخواهند بود." -msgid "The maximum size (in bytes) of a core file that the current process can create. This may result in the creation of a partial core file if a larger core would be required to contain the entire process image." +msgid "" +"The maximum size (in bytes) of a core file that the current process can " +"create. This may result in the creation of a partial core file if a larger " +"core would be required to contain the entire process image." msgstr "" +"حداکثر اندازه‌ی فایل core (بر حسب بایت) که فرایند جاری می‌تواند ایجاد کند. " +"این موضوع ممکن است منجر به ایجاد یک فایل core ناقص شود، در صورتی که برای " +"دربرگرفتن کل تصویر فرایند به core بزرگ‌تری نیاز باشد." -msgid "The maximum amount of processor time (in seconds) that a process can use. If this limit is exceeded, a :const:`~signal.SIGXCPU` signal is sent to the process. (See the :mod:`signal` module documentation for information about how to catch this signal and do something useful, e.g. flush open files to disk.)" -msgstr "" +msgid "" +"The maximum amount of processor time (in seconds) that a process can use. If" +" this limit is exceeded, a :const:`~signal.SIGXCPU` signal is sent to the " +"process. (See the :mod:`signal` module documentation for information about " +"how to catch this signal and do something useful, e.g. flush open files to " +"disk.)" +msgstr "" +"حداکثر مقدار زمان پردازنده (بر حسب ثانیه) که یک فرایند می‌تواند از آن " +"استفاده کند. در صورت عبور از این محدودیت، یک سیگنال :const:`~signal.SIGXCPU`" +" به فرایند ارسال می‌شود. (برای اطلاعات در مورد نحوه‌ی دریافت این سیگنال و " +"انجام کاری مفید، مثلاً تخلیه‌ی فایل‌های باز روی دیسک، مستندات ماژول " +":mod:`signal` را ببینید.)" msgid "The maximum size of a file which the process may create." -msgstr "" +msgstr "حداکثر اندازه‌ی فایلی که فرایند می‌تواند ایجاد کند." msgid "The maximum size (in bytes) of the process's heap." -msgstr "" +msgstr "حداکثر اندازه‌ی انباشتفرایند (به بایت)" -msgid "The maximum size (in bytes) of the call stack for the current process. This only affects the stack of the main thread in a multi-threaded process." +msgid "" +"The maximum size (in bytes) of the call stack for the current process. This" +" only affects the stack of the main thread in a multi-threaded process." msgstr "" +"حداکثر اندازه‌ی پشته‌ی فراخوانی برای فرایند جاری (بر حسب بایت). این فقط بر " +"پشته‌ی نخ اصلی در یک فرایند چندنخی تأثیر می‌گذارد." -msgid "The maximum resident set size that should be made available to the process." +msgid "" +"The maximum resident set size that should be made available to the process." msgstr "" +"حداکثر اندازه‌ی مجموعه مقیم (resident set size) که باید در دسترس فرایند قرار" +" گیرد." msgid "The maximum number of processes the current process may create." -msgstr "" +msgstr "حداکثر تعداد فرایندهایی که فرایند جاری می‌تواند ایجاد کند." msgid "The maximum number of open file descriptors for the current process." -msgstr "" +msgstr "حداکثر تعداد توصیف‌گرهای فایل باز برای فرایند جاری." msgid "The BSD name for :const:`RLIMIT_NOFILE`." -msgstr "" +msgstr "نام BSD برای :const:`RLIMIT_NOFILE`." msgid "The maximum address space which may be locked in memory." -msgstr "" +msgstr "حداکثر فضای آدرسی که می‌تواند در حافظه قفل شود." -msgid "The largest area of mapped memory which the process may occupy. Usually an alias of :const:`RLIMIT_AS`." +msgid "" +"The largest area of mapped memory which the process may occupy. Usually an " +"alias of :const:`RLIMIT_AS`." msgstr "" +"بزرگ‌ترین ناحیه‌ی حافظه‌ی نگاشت‌شده که فرایند ممکن است اشغال کند. معمولاً نام " +"مستعاری از :const:`RLIMIT_AS` است." -msgid "The maximum area (in bytes) of address space which may be taken by the process." +msgid "" +"The maximum area (in bytes) of address space which may be taken by the " +"process." msgstr "" +"حداکثر ناحیه (به بایت) از فضای آدرس که ممکن است توسط فرایند اشغال شود." msgid "The number of bytes that can be allocated for POSIX message queues." -msgstr "" +msgstr "تعداد بایت‌هایی که می‌توان برای صف‌های پیام POSIX تخصیص داد." -msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." -msgstr "" +msgid "" +"The ceiling for the process's nice level (calculated as 20 - rlim_cur)." +msgstr "سقف سطح nice فرایند (که به‌صورت 20 - rlim_cur محاسبه می‌شود)." msgid "The ceiling of the real-time priority." -msgstr "" +msgstr "سقف اولویت بی‌درنگ." -msgid "The time limit (in microseconds) on CPU time that a process can spend under real-time scheduling without making a blocking syscall." +msgid "" +"The time limit (in microseconds) on CPU time that a process can spend under " +"real-time scheduling without making a blocking syscall." msgstr "" +"محدودیت زمانی (بر حسب میکروثانیه) برای زمان پردازنده‌ای که یک فرایند " +"می‌تواند تحت زمان‌بندی بلادرنگ بدون انجام یک فراخوانی سیستمی مسدودکننده صرف " +"کند." msgid "The number of signals which the process may queue." -msgstr "" +msgstr "تعداد سیگنال‌هایی که فرایند می‌تواند در صف قرار دهد." -msgid "The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of mbufs, that this user may hold at any time." +msgid "" +"The maximum size (in bytes) of socket buffer usage for this user. This " +"limits the amount of network memory, and hence the amount of mbufs, that " +"this user may hold at any time." msgstr "" +"حداکثر اندازه‌ی مصرف بافر سوکت (به بایت) برای این کاربر. این میزان حافظه " +"شبکه، و در نتیجه میزان mbufها (mbufs)، را که این کاربر ممکن است در هر زمان " +"در اختیار داشته باشد محدود می‌کند." -msgid "The maximum size (in bytes) of the swap space that may be reserved or used by all of this user id's processes. This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. Please see `tuning(7) `__ for a complete description of this sysctl." -msgstr "" +msgid "" +"The maximum size (in bytes) of the swap space that may be reserved or used " +"by all of this user id's processes. This limit is enforced only if bit 1 of " +"the vm.overcommit sysctl is set. Please see `tuning(7) " +"`__ for a " +"complete description of this sysctl." +msgstr "" +"حداکثر اندازه (به بایت) فضای مبادله‌ای که ممکن است تمام فرآیندهای این شناسه " +"کاربری آن را رزرو یا استفاده کنند. این محدودیت تنها در صورتی اعمال می‌شود که" +" بیت ۱ از sysctlِ vm.overcommit تنظیم شده باشد. لطفاً برای توضیح کامل این " +"sysctl، `tuning(7) " +"`__ را ببینید." msgid "The maximum number of pseudo-terminals created by this user id." msgstr "" +"حداکثر تعداد شبه‌پایانه‌ها (pseudo-terminals) که توسط این شناسه کاربری ایجاد" +" شده‌اند." msgid "The maximum number of kqueues this user id is allowed to create." -msgstr "" +msgstr "حداکثر تعداد kqueueهایی که این شناسه کاربری مجاز به ایجاد آن‌ها است." msgid "Resource Usage" -msgstr "" +msgstr "استفاده از منابع" msgid "These functions are used to retrieve resource usage information:" -msgstr "" +msgstr "این توابع برای بازیابی اطلاعات استفاده از منابع به کار می‌روند:" -msgid "This function returns an object that describes the resources consumed by either the current process or its children, as specified by the *who* parameter. The *who* parameter should be specified using one of the :const:`!RUSAGE_\\*` constants described below." +msgid "" +"This function returns an object that describes the resources consumed by " +"either the current process or its children, as specified by the *who* " +"parameter. The *who* parameter should be specified using one of the " +":const:`!RUSAGE_\\*` constants described below." msgstr "" +"این تابع شیءای را برمی‌گرداند که منابع مصرف‌شده توسط فرایند جاری یا فرایندهای" +" فرزند آن را توصیف می‌کند، همان‌طور که با پارامتر *who* مشخص شده است. " +"پارامتر *who* باید با استفاده از یکی از ثابت‌های :const:`!RUSAGE_\\*` که در " +"ادامه توضیح داده شده‌اند، مشخص شود." msgid "A simple example::" -msgstr "" +msgstr "یک مثال ساده::" msgid "" "from resource import *\n" @@ -182,186 +358,253 @@ msgid "" " _ = 1 + 1\n" "print(getrusage(RUSAGE_SELF))" msgstr "" +"from resource import *\n" +"import time\n" +"\n" +"# a non CPU-bound task\n" +"time.sleep(3)\n" +"print(getrusage(RUSAGE_SELF))\n" +"\n" +"# a CPU-bound task\n" +"for i in range(10 ** 8):\n" +" _ = 1 + 1\n" +"print(getrusage(RUSAGE_SELF))" -msgid "The fields of the return value each describe how a particular system resource has been used, e.g. amount of time spent running in user mode or number of times the process was swapped out of main memory. Some values are dependent on the clock tick interval, e.g. the amount of memory the process is using." -msgstr "" +msgid "" +"The fields of the return value each describe how a particular system " +"resource has been used, e.g. amount of time spent running in user mode or " +"number of times the process was swapped out of main memory. Some values are " +"dependent on the clock tick interval, e.g. the amount of memory the process " +"is using." +msgstr "" +"هر یک از فیلدهای مقدار بازگشتی، نحوه استفاده از یک منبع سیستمی خاص را توصیف " +"می‌کنند، برای مثال میزان زمانی که در حالت کاربر صرف اجرا شده یا تعداد دفعاتی" +" که فرایند از حافظه اصلی خارجشده است. برخی مقادیر به بازه تیک " +"ساعت وابسته‌اند، برای مثال میزان حافظه‌ای که فرایند در حال استفاده از آن " +"است." -msgid "For backward compatibility, the return value is also accessible as a tuple of 16 elements." +msgid "" +"For backward compatibility, the return value is also accessible as a tuple " +"of 16 elements." msgstr "" +"برای سازگاری با نسخه‌های پیشین، مقدار بازگشتی همچنین به‌صورت تاپلی از ۱۶ " +"المان قابل دسترسی است." -msgid "The fields :attr:`!ru_utime` and :attr:`!ru_stime` of the return value are floating-point values representing the amount of time spent executing in user mode and the amount of time spent executing in system mode, respectively. The remaining values are integers. Consult the :manpage:`getrusage(2)` man page for detailed information about these values. A brief summary is presented here:" -msgstr "" +msgid "" +"The fields :attr:`!ru_utime` and :attr:`!ru_stime` of the return value are " +"floating-point values representing the amount of time spent executing in " +"user mode and the amount of time spent executing in system mode, " +"respectively. The remaining values are integers. Consult the " +":manpage:`getrusage(2)` man page for detailed information about these " +"values. A brief summary is presented here:" +msgstr "" +"فیلدهای :attr:`!ru_utime` و :attr:`!ru_stime` از مقدار بازگشتی، مقادیر ممیز " +"شناور هستند که به‌ترتیب نشان‌دهنده‌ی میزان زمان صرف‌شده برای اجرا در حالت " +"کاربر و میزان زمان صرف‌شده برای اجرا در حالت سیستم هستند. مقادیر باقی‌مانده،" +" اعداد صحیح هستند. برای اطلاعات تفصیلی درباره‌ی این مقادیر به صفحه راهنمای " +":manpage:`getrusage(2)` مراجعه کنید. خلاصه‌ای کوتاه در اینجا ارائه شده است:" msgid "Index" -msgstr "" +msgstr "اندیس" msgid "Field" -msgstr "" +msgstr "فیلد" msgid "Resource" -msgstr "" +msgstr "منبع" msgid "``0``" -msgstr "" +msgstr "``0``" msgid ":attr:`!ru_utime`" -msgstr "" +msgstr ":attr:`!ru_utime`" msgid "time in user mode (float seconds)" -msgstr "" +msgstr "زمان در حالت کاربر (ثانیه‌های شناور)" msgid "``1``" -msgstr "" +msgstr "``1``" msgid ":attr:`!ru_stime`" -msgstr "" +msgstr ":attr:`!ru_stime`" msgid "time in system mode (float seconds)" -msgstr "" +msgstr "زمان در حالت سیستم (ثانیه به‌صورت float)" msgid "``2``" -msgstr "" +msgstr "``2``" msgid ":attr:`!ru_maxrss`" -msgstr "" +msgstr ":attr:`!ru_maxrss`" msgid "maximum resident set size" -msgstr "" +msgstr "حداکثر اندازه مجموعه مقیم" msgid "``3``" -msgstr "" +msgstr "``3``" msgid ":attr:`!ru_ixrss`" -msgstr "" +msgstr ":attr:`!ru_ixrss`" msgid "shared memory size" -msgstr "" +msgstr "اندازه‌ی حافظه‌ی مشترک" msgid "``4``" -msgstr "" +msgstr "``4``" msgid ":attr:`!ru_idrss`" -msgstr "" +msgstr ":attr:`!ru_idrss`" msgid "unshared memory size" -msgstr "" +msgstr "اندازه‌ی حافظه‌ی غیرمشترک" msgid "``5``" -msgstr "" +msgstr "``5``" msgid ":attr:`!ru_isrss`" -msgstr "" +msgstr ":attr:`!ru_isrss`" msgid "unshared stack size" -msgstr "" +msgstr "اندازه‌ی پشته‌ی اشتراک‌گذاری‌نشده" msgid "``6``" -msgstr "" +msgstr "``6``" msgid ":attr:`!ru_minflt`" -msgstr "" +msgstr ":attr:`!ru_minflt`" msgid "page faults not requiring I/O" -msgstr "" +msgstr "خطاهای صفحه بدون نیاز به ورودی/خروجی" msgid "``7``" -msgstr "" +msgstr "``7``" msgid ":attr:`!ru_majflt`" -msgstr "" +msgstr ":attr:`!ru_majflt`" msgid "page faults requiring I/O" -msgstr "" +msgstr "خطاهای صفحه نیازمند I/O" msgid "``8``" -msgstr "" +msgstr "``8``" msgid ":attr:`!ru_nswap`" -msgstr "" +msgstr ":attr:`!ru_nswap`" msgid "number of swap outs" -msgstr "" +msgstr "تعداد خروج‌ها " msgid "``9``" -msgstr "" +msgstr "``9``" msgid ":attr:`!ru_inblock`" -msgstr "" +msgstr ":attr:`!ru_inblock`" msgid "block input operations" -msgstr "" +msgstr "مسدود کردن عملیات ورودی" msgid "``10``" -msgstr "" +msgstr "``10``" msgid ":attr:`!ru_oublock`" -msgstr "" +msgstr ":attr:`!ru_oublock`" msgid "block output operations" -msgstr "" +msgstr "مسدود کردن عملیات‌های خروجی" msgid "``11``" -msgstr "" +msgstr "``11``" msgid ":attr:`!ru_msgsnd`" -msgstr "" +msgstr ":attr:`!ru_msgsnd`" msgid "messages sent" -msgstr "" +msgstr "پیام‌های ارسال‌شده" msgid "``12``" -msgstr "" +msgstr "``12``" msgid ":attr:`!ru_msgrcv`" -msgstr "" +msgstr ":attr:`!ru_msgrcv`" msgid "messages received" -msgstr "" +msgstr "پیام‌های دریافتی" msgid "``13``" -msgstr "" +msgstr "``13``" msgid ":attr:`!ru_nsignals`" -msgstr "" +msgstr ":attr:`!ru_nsignals`" msgid "signals received" -msgstr "" +msgstr "سیگنال‌های دریافت‌شده" msgid "``14``" -msgstr "" +msgstr "``14``" msgid ":attr:`!ru_nvcsw`" -msgstr "" +msgstr ":attr:`!ru_nvcsw`" msgid "voluntary context switches" -msgstr "" +msgstr "تعویض‌های زمینه داوطلبانه" msgid "``15``" -msgstr "" +msgstr "``15``" msgid ":attr:`!ru_nivcsw`" -msgstr "" +msgstr ":attr:`!ru_nivcsw`" msgid "involuntary context switches" -msgstr "" +msgstr "تعویض‌های غیرارادی زمینه" -msgid "This function will raise a :exc:`ValueError` if an invalid *who* parameter is specified. It may also raise :exc:`error` exception in unusual circumstances." +msgid "" +"This function will raise a :exc:`ValueError` if an invalid *who* parameter " +"is specified. It may also raise :exc:`error` exception in unusual " +"circumstances." msgstr "" +"این تابع در صورت مشخص شدن یک پارامتر *who* نامعتبر، یک :exc:`ValueError` را " +"پرتاب می‌کند. همچنین ممکن است در شرایط غیرمعمول، استثنای :exc:`error` را نیز" +" پرتاب کند." -msgid "Returns the number of bytes in a system page. (This need not be the same as the hardware page size.)" +msgid "" +"Returns the number of bytes in a system page. (This need not be the same as " +"the hardware page size.)" msgstr "" +"تعداد بایت‌های یک صفحه‌ی سیستم را برمی‌گرداند. (این مقدار لزوماً برابر با " +"اندازه‌ی صفحه‌ی سخت‌افزاری نیست.)" -msgid "The following :const:`!RUSAGE_\\*` symbols are passed to the :func:`getrusage` function to specify which processes information should be provided for." +msgid "" +"The following :const:`!RUSAGE_\\*` symbols are passed to the " +":func:`getrusage` function to specify which processes information should be " +"provided for." msgstr "" +"نمادهای :const:`!RUSAGE_\\*` زیر به تابع :func:`getrusage` داده می‌شوند تا " +"مشخص کنند اطلاعات کدام فرایندها باید ارائه شود." -msgid "Pass to :func:`getrusage` to request resources consumed by the calling process, which is the sum of resources used by all threads in the process." +msgid "" +"Pass to :func:`getrusage` to request resources consumed by the calling " +"process, which is the sum of resources used by all threads in the process." msgstr "" +"آن را به :func:`getrusage` ارسال کنید تا منابع مصرف‌شده توسط فرایند فراخوان " +"درخواست شود، که مجموع منابع استفاده‌شده توسط همه نخ‌های درون فرایند است." -msgid "Pass to :func:`getrusage` to request resources consumed by child processes of the calling process which have been terminated and waited for." +msgid "" +"Pass to :func:`getrusage` to request resources consumed by child processes " +"of the calling process which have been terminated and waited for." msgstr "" +"به :func:`getrusage` بفرستید تا منابع مصرف‌شده توسط فرایندهای فرزند فرایند " +"فراخوان، که پایان‌یافته‌اند و انتظارشان کشیده شده است، درخواست شود." -msgid "Pass to :func:`getrusage` to request resources consumed by both the current process and child processes. May not be available on all systems." +msgid "" +"Pass to :func:`getrusage` to request resources consumed by both the current " +"process and child processes. May not be available on all systems." msgstr "" +"به :func:`getrusage` ارسال کنید تا منابع مصرف‌شده توسط فرآیند فعلی و " +"فرآیندهای فرزند درخواست شود. ممکن است در همه‌ی سیستم‌ها در دسترس نباشد." -msgid "Pass to :func:`getrusage` to request resources consumed by the current thread. May not be available on all systems." +msgid "" +"Pass to :func:`getrusage` to request resources consumed by the current " +"thread. May not be available on all systems." msgstr "" +"برای درخواست منابع مصرف‌شده توسط نخ جاری، آن را به :func:`getrusage` بدهید. " +"ممکن است در همه‌ی سیستم‌ها در دسترس نباشد." diff --git a/library/rlcompleter.po b/library/rlcompleter.po index 31be62e14..11c4b800d 100644 --- a/library/rlcompleter.po +++ b/library/rlcompleter.po @@ -24,19 +24,33 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!rlcompleter` --- Completion function for GNU readline" -msgstr "" +msgstr ":mod:`!rlcompleter` --- تابع تکمیل برای GNU readline" msgid "**Source code:** :source:`Lib/rlcompleter.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/rlcompleter.py`" -msgid "The :mod:`!rlcompleter` module defines a completion function suitable to be passed to :func:`~readline.set_completer` in the :mod:`readline` module." +msgid "" +"The :mod:`!rlcompleter` module defines a completion function suitable to be " +"passed to :func:`~readline.set_completer` in the :mod:`readline` module." msgstr "" +"ماژول :mod:`!rlcompleter` یک تابع تکمیل مناسب برای ارسال به " +":func:`~readline.set_completer` در ماژول :mod:`readline` تعریف می‌کند." -msgid "When this module is imported on a Unix platform with the :mod:`readline` module available, an instance of the :class:`Completer` class is automatically created and its :meth:`~Completer.complete` method is set as the :ref:`readline completer `. The method provides completion of valid Python :ref:`identifiers and keywords `." +msgid "" +"When this module is imported on a Unix platform with the :mod:`readline` " +"module available, an instance of the :class:`Completer` class is " +"automatically created and its :meth:`~Completer.complete` method is set as " +"the :ref:`readline completer `. The method provides " +"completion of valid Python :ref:`identifiers and keywords `." msgstr "" +"هنگامی که این ماژول در یک سکوی یونیکسی که ماژول :mod:`readline` در آن در " +"دسترس باشد ایمپورت شود، نمونه‌ای از کلاس :class:`Completer` به‌طور خودکار " +"ایجاد می‌شود و متد :meth:`~Completer.complete` آن به‌عنوان :ref:`تکمیل‌کننده" +" readline ` تنظیم می‌شود. این متد امکان تکمیل " +":ref:`شناسه‌ها و کلیدواژه‌های معتبر پایتون ` را فراهم می‌کند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import rlcompleter\n" @@ -48,24 +62,69 @@ msgid "" "readline.__name__ readline.parse_and_bind(\n" ">>> readline." msgstr "" +">>> import rlcompleter\n" +">>> import readline\n" +">>> readline.parse_and_bind(\"tab: complete\")\n" +">>> readline. \n" +"readline.__doc__ readline.get_line_buffer( readline.read_init_file(\n" +"readline.__file__ readline.insert_text( readline.set_completer(\n" +"readline.__name__ readline.parse_and_bind(\n" +">>> readline." -msgid "The :mod:`!rlcompleter` module is designed for use with Python's :ref:`interactive mode `. Unless Python is run with the :option:`-S` option, the module is automatically imported and configured (see :ref:`rlcompleter-config`)." +msgid "" +"The :mod:`!rlcompleter` module is designed for use with Python's " +":ref:`interactive mode `. Unless Python is run with the " +":option:`-S` option, the module is automatically imported and configured " +"(see :ref:`rlcompleter-config`)." msgstr "" +"ماژول :mod:`!rlcompleter` برای استفاده در :ref:`حالت تعاملی ` پایتون طراحی شده است. مگر اینکه پایتون با گزینه :option:`-S` " +"اجرا شود، این ماژول به‌طور خودکار ایمپورت و پیکربندی می‌شود (به " +":ref:`rlcompleter-config` مراجعه کنید)." -msgid "On platforms without :mod:`readline`, the :class:`Completer` class defined by this module can still be used for custom purposes." +msgid "" +"On platforms without :mod:`readline`, the :class:`Completer` class defined " +"by this module can still be used for custom purposes." msgstr "" +"در سکوهای فاقد :mod:`readline`، همچنان می‌توان از کلاس :class:`Completer` " +"تعریف‌شده توسط این ماژول برای اهداف سفارشی استفاده کرد." msgid "Completer objects have the following method:" -msgstr "" +msgstr "اشیای Completer متد زیر را دارند:" msgid "Return the next possible completion for *text*." -msgstr "" +msgstr "تکمیل ممکن بعدی برای *text* را برمی‌گرداند." -msgid "When called by the :mod:`readline` module, this method is called successively with ``state == 0, 1, 2, ...`` until the method returns ``None``." +msgid "" +"When called by the :mod:`readline` module, this method is called " +"successively with ``state == 0, 1, 2, ...`` until the method returns " +"``None``." msgstr "" +"هنگامی که توسط ماژول :mod:`readline` فراخوانی می‌شود، این متد به‌صورت متوالی" +" با ``state == 0, 1, 2, ...`` فراخوانی می‌شود تا زمانی که این متد ``None`` " +"را برگرداند." -msgid "If called for *text* that doesn't include a period character (``'.'``), it will complete from names currently defined in :mod:`__main__`, :mod:`builtins` and keywords (as defined by the :mod:`keyword` module)." +msgid "" +"If called for *text* that doesn't include a period character (``'.'``), it " +"will complete from names currently defined in :mod:`__main__`, " +":mod:`builtins` and keywords (as defined by the :mod:`keyword` module)." msgstr "" +"اگر برای *text* فراخوانی شود که شامل نویسه نقطه (``'.'``) نباشد، آن را از " +"نام‌هایی که در حال حاضر در :mod:`__main__` و :mod:`builtins` تعریف شده‌اند و" +" نیز کلیدواژه‌ها (همان‌طور که توسط ماژول :mod:`keyword` تعریف شده‌اند) تکمیل" +" خواهد کرد." -msgid "If called for a dotted name, it will try to evaluate anything without obvious side-effects (functions will not be evaluated, but it can generate calls to :meth:`~object.__getattr__`) up to the last part, and find matches for the rest via the :func:`dir` function. Any exception raised during the evaluation of the expression is caught, silenced and :const:`None` is returned." +msgid "" +"If called for a dotted name, it will try to evaluate anything without " +"obvious side-effects (functions will not be evaluated, but it can generate " +"calls to :meth:`~object.__getattr__`) up to the last part, and find matches " +"for the rest via the :func:`dir` function. Any exception raised during the " +"evaluation of the expression is caught, silenced and :const:`None` is " +"returned." msgstr "" +"اگر برای یک نام نقطه‌دار فراخوانی شود، تلاش می‌کند هر چیزی را بدون عوارض " +"جانبی آشکار (توابع ارزیابی نمی‌شوند، اما ممکن است فراخوانی‌هایی به " +":meth:`~object.__getattr__` ایجاد شود) تا آخرین بخش ارزیابی کند و برای " +"باقی‌مانده، تطابق‌ها را از طریق تابع :func:`dir` بیابد. هر استثنایی که در " +"حین ارزیابی عبارت پرتاب شود، گرفته و سرکوب می‌شود و :const:`None` برگردانده " +"می‌شود." diff --git a/library/runpy.po b/library/runpy.po index 002755d8a..4adc204b3 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -23,121 +23,320 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!runpy` --- Locating and executing Python modules" -msgstr "" +msgstr ":mod:`!runpy` --- یافتن و اجرای ماژول‌های پایتون" msgid "**Source code:** :source:`Lib/runpy.py`" -msgstr "" +msgstr ":source:`Lib/runpy.py`" -msgid "The :mod:`!runpy` module is used to locate and run Python modules without importing them first. Its main use is to implement the :option:`-m` command line switch that allows scripts to be located using the Python module namespace rather than the filesystem." +msgid "" +"The :mod:`!runpy` module is used to locate and run Python modules without " +"importing them first. Its main use is to implement the :option:`-m` command " +"line switch that allows scripts to be located using the Python module " +"namespace rather than the filesystem." msgstr "" +"ماژول :mod:`!runpy` برای پیدا کردن و اجرای ماژول‌های پایتون بدون آنکه ابتدا " +"آن‌ها را ایمپورت کند استفاده می‌شود. کاربرد اصلی آن پیاده‌سازی گزینه‌ی خط " +"فرمان :option:`-m` است که امکان پیدا کردن اسکریپت‌ها را با استفاده از " +"فضای نام ماژول‌های پایتون به‌جای سیستم فایل فراهم می‌کند." -msgid "Note that this is *not* a sandbox module - all code is executed in the current process, and any side effects (such as cached imports of other modules) will remain in place after the functions have returned." +msgid "" +"Note that this is *not* a sandbox module - all code is executed in the " +"current process, and any side effects (such as cached imports of other " +"modules) will remain in place after the functions have returned." msgstr "" +"توجه داشته باشید که این یک ماژول سندباکس *نیست* — تمام کدها در " +"فرایند جاری اجرا می‌شوند و هرگونه اثر جانبی (مانند ایمپورت‌های نهانگاه‌شده‌ی " +"سایر ماژول‌ها) پس از بازگشت توابع بر جای خواهد ماند." -msgid "Furthermore, any functions and classes defined by the executed code are not guaranteed to work correctly after a :mod:`!runpy` function has returned. If that limitation is not acceptable for a given use case, :mod:`importlib` is likely to be a more suitable choice than this module." +msgid "" +"Furthermore, any functions and classes defined by the executed code are not " +"guaranteed to work correctly after a :mod:`!runpy` function has returned. If" +" that limitation is not acceptable for a given use case, :mod:`importlib` is" +" likely to be a more suitable choice than this module." msgstr "" +"علاوه بر این، تضمینی وجود ندارد که توابع و کلاس‌های تعریف‌شده توسط کد " +"اجراشده، پس از بازگشت تابعی از :mod:`!runpy` به‌درستی کار کنند. اگر این " +"محدودیت برای یک مورد استفاده خاص قابل قبول نیست، احتمالاً :mod:`importlib` " +"انتخاب مناسب‌تری نسبت به این ماژول است." msgid "The :mod:`!runpy` module provides two functions:" -msgstr "" +msgstr "ماژول :mod:`!runpy` دو تابع ارائه می‌دهد:" -msgid "Execute the code of the specified module and return the resulting module's globals dictionary. The module's code is first located using the standard import mechanism (refer to :pep:`302` for details) and then executed in a fresh module namespace." +msgid "" +"Execute the code of the specified module and return the resulting module's " +"globals dictionary. The module's code is first located using the standard " +"import mechanism (refer to :pep:`302` for details) and then executed in a " +"fresh module namespace." msgstr "" +"کد ماژول مشخص‌شده را اجرا می‌کند و دیکشنری سراسری‌های ماژول حاصل را " +"برمی‌گرداند. کد ماژول ابتدا با استفاده از سازوکار استاندارد ایمپورت یافت " +"می‌شود (برای جزئیات به :pep:`302` مراجعه کنید) و سپس در یک فضای نام تازه‌ی " +"ماژول اجرا می‌شود." -msgid "The *mod_name* argument should be an absolute module name. If the module name refers to a package rather than a normal module, then that package is imported and the :mod:`__main__` submodule within that package is then executed and the resulting module globals dictionary returned." +msgid "" +"The *mod_name* argument should be an absolute module name. If the module " +"name refers to a package rather than a normal module, then that package is " +"imported and the :mod:`__main__` submodule within that package is then " +"executed and the resulting module globals dictionary returned." msgstr "" +"آرگومان *mod_name* باید یک نام ماژول مطلق باشد. اگر نام ماژول به‌جای یک " +"ماژول معمولی به یک بسته اشاره کند، آن بسته ایمپورت می‌شود و زیرماژول " +":mod:`__main__` درون آن بسته اجرا می‌شود و دیکشنری سراسری‌های ماژول حاصل " +"برگردانده می‌شود." -msgid "The optional dictionary argument *init_globals* may be used to pre-populate the module's globals dictionary before the code is executed. *init_globals* will not be modified. If any of the special global variables below are defined in *init_globals*, those definitions are overridden by :func:`run_module`." +msgid "" +"The optional dictionary argument *init_globals* may be used to pre-populate " +"the module's globals dictionary before the code is executed. *init_globals* " +"will not be modified. If any of the special global variables below are " +"defined in *init_globals*, those definitions are overridden by " +":func:`run_module`." msgstr "" +"می‌توان از آرگومان دیکشنری اختیاری *init_globals* برای از پیش پر کردن " +"دیکشنری سراسری‌های ماژول پیش از اجرای کد استفاده کرد. *init_globals* تغییر " +"نخواهد کرد. اگر هر یک از متغیرهای سراسری خاص زیر در *init_globals* تعریف شده" +" باشند، آن تعریف‌ها توسط :func:`run_module` بازنویسی می‌شوند." -msgid "The special global variables ``__name__``, ``__spec__``, ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` are set in the globals dictionary before the module code is executed. (Note that this is a minimal set of variables - other variables may be set implicitly as an interpreter implementation detail.)" -msgstr "" +msgid "" +"The special global variables ``__name__``, ``__spec__``, ``__file__``, " +"``__cached__``, ``__loader__`` and ``__package__`` are set in the globals " +"dictionary before the module code is executed. (Note that this is a minimal " +"set of variables - other variables may be set implicitly as an interpreter " +"implementation detail.)" +msgstr "" +"متغیرهای سراسری ویژه ``__name__``، ``__spec__``، ``__file__``، " +"``__cached__``، ``__loader__`` و ``__package__`` پیش از اجرای کد ماژول، در " +"دیکشنری سراسری تنظیم می‌شوند. (توجه داشته باشید که این یک مجموعه‌ی حداقلی از" +" متغیرها است — ممکن است متغیرهای دیگری نیز به‌صورت ضمنی به‌عنوان جزئیاتی از " +"پیاده‌سازی مفسر تنظیم شوند.)" -msgid "``__name__`` is set to *run_name* if this optional argument is not :const:`None`, to ``mod_name + '.__main__'`` if the named module is a package and to the *mod_name* argument otherwise." +msgid "" +"``__name__`` is set to *run_name* if this optional argument is not " +":const:`None`, to ``mod_name + '.__main__'`` if the named module is a " +"package and to the *mod_name* argument otherwise." msgstr "" +"``__name__`` هنگامی که این آرگومان اختیاری :const:`None` نباشد، به " +"*run_name* تنظیم می‌شود؛ اگر ماژول نام‌برده یک بسته باشد، به ``mod_name + " +"'.__main__'`` و در غیر این صورت به آرگومان *mod_name* تنظیم می‌شود." -msgid "``__spec__`` will be set appropriately for the *actually* imported module (that is, ``__spec__.name`` will always be *mod_name* or ``mod_name + '.__main__'``, never *run_name*)." +msgid "" +"``__spec__`` will be set appropriately for the *actually* imported module " +"(that is, ``__spec__.name`` will always be *mod_name* or ``mod_name + " +"'.__main__'``, never *run_name*)." msgstr "" +"``__spec__`` برای ماژول *واقعاً* ایمپورت‌شده به‌طور مناسب تنظیم می‌شود (یعنی" +" ``__spec__.name`` همیشه *mod_name* یا ``mod_name + '.__main__'`` خواهد بود،" +" هرگز *run_name* نخواهد بود)." -msgid "``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` are :ref:`set as normal ` based on the module spec." +msgid "" +"``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` are " +":ref:`set as normal ` based on the module spec." msgstr "" +"``__file__``، ``__cached__``، ``__loader__`` و ``__package__`` بر اساس " +"مشخصات ماژول :ref:`به‌صورت عادی تنظیم می‌شوند `." -msgid "If the argument *alter_sys* is supplied and evaluates to :const:`True`, then ``sys.argv[0]`` is updated with the value of ``__file__`` and ``sys.modules[__name__]`` is updated with a temporary module object for the module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]`` are restored to their original values before the function returns." -msgstr "" +msgid "" +"If the argument *alter_sys* is supplied and evaluates to :const:`True`, then" +" ``sys.argv[0]`` is updated with the value of ``__file__`` and " +"``sys.modules[__name__]`` is updated with a temporary module object for the " +"module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]`` " +"are restored to their original values before the function returns." +msgstr "" +"اگر آرگومان *alter_sys* ارائه شود و به :const:`True` ارزیابی شود، " +"``sys.argv[0]`` با مقدار ``__file__`` به‌روزرسانی می‌شود و " +"``sys.modules[__name__]`` با یک شیء ماژول موقت برای ماژول در حال اجرا " +"به‌روزرسانی می‌شود. هر دو ``sys.argv[0]`` و ``sys.modules[__name__]`` پیش از" +" بازگشت تابع به مقادیر اصلی خود بازمی‌گردند." -msgid "Note that this manipulation of :mod:`sys` is not thread-safe. Other threads may see the partially initialised module, as well as the altered list of arguments. It is recommended that the ``sys`` module be left alone when invoking this function from threaded code." +msgid "" +"Note that this manipulation of :mod:`sys` is not thread-safe. Other threads " +"may see the partially initialised module, as well as the altered list of " +"arguments. It is recommended that the ``sys`` module be left alone when " +"invoking this function from threaded code." msgstr "" +"توجه داشته باشید که این دستکاری :mod:`sys` ایمن در برابر نخ نیست. سایر نخ‌ها" +" ممکن است ماژول تا حدی مقداردهی اولیه‌شده و همچنین فهرست تغییرکرده‌ی " +"آرگومان‌ها را ببینند. توصیه می‌شود هنگام فراخوانی این تابع از کد چندنخی، " +"ماژول ``sys`` دست‌نخورده باقی بماند." -msgid "The :option:`-m` option offering equivalent functionality from the command line." -msgstr "" +msgid "" +"The :option:`-m` option offering equivalent functionality from the command " +"line." +msgstr "گزینه‌ی :option:`-m` که قابلیت معادلی را از خط فرمان ارائه می‌دهد." -msgid "Added ability to execute packages by looking for a :mod:`__main__` submodule." -msgstr "" +msgid "" +"Added ability to execute packages by looking for a :mod:`__main__` " +"submodule." +msgstr "توانایی اجرای بسته‌ها با جست‌وجوی زیرماژول :mod:`__main__` اضافه شد." msgid "Added ``__cached__`` global variable (see :pep:`3147`)." -msgstr "" +msgstr "متغیر سراسری ``__cached__`` اضافه شد (به :pep:`3147` مراجعه کنید)." -msgid "Updated to take advantage of the module spec feature added by :pep:`451`. This allows ``__cached__`` to be set correctly for modules run this way, as well as ensuring the real module name is always accessible as ``__spec__.name``." +msgid "" +"Updated to take advantage of the module spec feature added by :pep:`451`. " +"This allows ``__cached__`` to be set correctly for modules run this way, as " +"well as ensuring the real module name is always accessible as " +"``__spec__.name``." msgstr "" +"به‌روزرسانی شد تا از ویژگی مشخصات ماژول (module spec) که :pep:`451` آن را " +"افزوده است بهره ببرد. این امکان را می‌دهد که ``__cached__`` برای ماژول‌هایی " +"که به این روش اجرا می‌شوند به‌درستی تنظیم شود، و همچنین اطمینان حاصل می‌کند " +"که نام واقعی ماژول همیشه به‌عنوان ``__spec__.name`` در دسترس است." -msgid "The setting of ``__cached__``, ``__loader__``, and ``__package__`` are deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +msgid "" +"The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" +"تنظیم ``__cached__``، ``__loader__`` و ``__package__`` منسوخ شده است. برای " +"جایگزین‌ها به :class:`~importlib.machinery.ModuleSpec` مراجعه کنید." -msgid "Execute the code at the named filesystem location and return the resulting module's globals dictionary. As with a script name supplied to the CPython command line, *file_path* may refer to a Python source file, a compiled bytecode file or a valid :data:`sys.path` entry containing a :mod:`__main__` module (e.g. a zipfile containing a top-level :file:`__main__.py` file)." -msgstr "" +msgid "" +"Execute the code at the named filesystem location and return the resulting " +"module's globals dictionary. As with a script name supplied to the CPython " +"command line, *file_path* may refer to a Python source file, a compiled " +"bytecode file or a valid :data:`sys.path` entry containing a :mod:`__main__`" +" module (e.g. a zipfile containing a top-level :file:`__main__.py` file)." +msgstr "" +"کد را در موقعیت فایل‌سیستمی نام‌گذاری‌شده اجرا می‌کند و دیکشنری سراسری ماژول" +" حاصل را برمی‌گرداند. همان‌طور که در مورد نام اسکریپت داده‌شده به خط فرمان " +"CPython صدق می‌کند، *file_path* ممکن است به یک فایل منبع پایتون، یک فایل " +"بایت‌کد کامپایل‌شده یا یک ورودی معتبر از :data:`sys.path` اشاره کند که حاوی " +"یک ماژول :mod:`__main__` باشد (مثلاً یک فایل زیپ حاوی یک فایل " +":file:`__main__.py` در سطح بالا)." -msgid "For a simple script, the specified code is simply executed in a fresh module namespace. For a valid :data:`sys.path` entry (typically a zipfile or directory), the entry is first added to the beginning of ``sys.path``. The function then looks for and executes a :mod:`__main__` module using the updated path. Note that there is no special protection against invoking an existing ``__main__`` entry located elsewhere on ``sys.path`` if there is no such module at the specified location." -msgstr "" +msgid "" +"For a simple script, the specified code is simply executed in a fresh module" +" namespace. For a valid :data:`sys.path` entry (typically a zipfile or " +"directory), the entry is first added to the beginning of ``sys.path``. The " +"function then looks for and executes a :mod:`__main__` module using the " +"updated path. Note that there is no special protection against invoking an " +"existing ``__main__`` entry located elsewhere on ``sys.path`` if there is no" +" such module at the specified location." +msgstr "" +"برای یک اسکریپت ساده، کد تعیین‌شده به‌سادگی در یک فضای نام ماژول تازه اجرا " +"می‌شود. برای یک ورودی معتبر :data:`sys.path` (معمولاً یک فایل zip یا پوشه)، " +"ابتدا آن ورودی به ابتدای ``sys.path`` اضافه می‌شود. سپس تابع با استفاده از " +"مسیر به‌روزشده، یک ماژول :mod:`__main__` را جست‌وجو و اجرا می‌کند. توجه " +"داشته باشید که اگر چنین ماژولی در مکان تعیین‌شده وجود نداشته باشد، هیچ " +"محافظت ویژه‌ای در برابر فراخوانی یک ورودی ``__main__`` موجود در جای دیگری از" +" ``sys.path`` وجود ندارد." -msgid "The optional dictionary argument *init_globals* may be used to pre-populate the module's globals dictionary before the code is executed. *init_globals* will not be modified. If any of the special global variables below are defined in *init_globals*, those definitions are overridden by :func:`run_path`." +msgid "" +"The optional dictionary argument *init_globals* may be used to pre-populate " +"the module's globals dictionary before the code is executed. *init_globals* " +"will not be modified. If any of the special global variables below are " +"defined in *init_globals*, those definitions are overridden by " +":func:`run_path`." msgstr "" +"می‌توان از آرگومان دیکشنری اختیاری *init_globals* برای پر کردن دیکشنری " +"سراسری‌های ماژول پیش از اجرای کد استفاده کرد. *init_globals* تغییر نخواهد " +"کرد. اگر هر یک از متغیرهای سراسری خاص زیر در *init_globals* تعریف شده باشند،" +" آن تعریف‌ها توسط :func:`run_path` بازنویسی می‌شوند." -msgid "``__name__`` is set to *run_name* if this optional argument is not :const:`None` and to ``''`` otherwise." +msgid "" +"``__name__`` is set to *run_name* if this optional argument is not " +":const:`None` and to ``''`` otherwise." msgstr "" +"اگر این آرگومان اختیاری :const:`None` نباشد، ``__name__`` به *run_name* " +"تنظیم می‌شود و در غیر این صورت به ``''`` تنظیم می‌شود." -msgid "If *file_path* directly references a script file (whether as source or as precompiled byte code), then ``__file__`` will be set to *file_path*, and ``__spec__``, ``__cached__``, ``__loader__`` and ``__package__`` will all be set to :const:`None`." +msgid "" +"If *file_path* directly references a script file (whether as source or as " +"precompiled byte code), then ``__file__`` will be set to *file_path*, and " +"``__spec__``, ``__cached__``, ``__loader__`` and ``__package__`` will all be" +" set to :const:`None`." msgstr "" +"اگر *file_path* مستقیماً به یک فایل اسکریپت اشاره کند (چه به صورت کد منبع و " +"چه به صورت بایت‌کد از پیش کامپایل‌شده)، ``__file__`` به *file_path* تنظیم " +"می‌شود، و ``__spec__``، ``__cached__``، ``__loader__`` و ``__package__`` " +"همگی به :const:`None` تنظیم می‌شوند." -msgid "If *file_path* is a reference to a valid :data:`sys.path` entry, then ``__spec__`` will be set appropriately for the imported :mod:`__main__` module (that is, ``__spec__.name`` will always be ``__main__``). ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be :ref:`set as normal ` based on the module spec." -msgstr "" +msgid "" +"If *file_path* is a reference to a valid :data:`sys.path` entry, then " +"``__spec__`` will be set appropriately for the imported :mod:`__main__` " +"module (that is, ``__spec__.name`` will always be ``__main__``). " +"``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be " +":ref:`set as normal ` based on the module spec." +msgstr "" +"اگر *file_path* ارجاعی به یک آیتم معتبر در :data:`sys.path` باشد، آنگاه " +"``__spec__`` به‌صورت مناسب برای ماژول :mod:`__main__` ایمپورت‌شده تنظیم " +"خواهد شد (یعنی ``__spec__.name`` همیشه ``__main__`` خواهد بود). " +"``__file__``، ``__cached__``، ``__loader__`` و ``__package__`` بر اساس " +"مشخصات ماژول، :ref:`به‌صورت عادی تنظیم خواهند شد `." -msgid "A number of alterations are also made to the :mod:`sys` module. Firstly, :data:`sys.path` may be altered as described above. ``sys.argv[0]`` is updated with the value of *file_path* and ``sys.modules[__name__]`` is updated with a temporary module object for the module being executed. All modifications to items in :mod:`sys` are reverted before the function returns." -msgstr "" +msgid "" +"A number of alterations are also made to the :mod:`sys` module. Firstly, " +":data:`sys.path` may be altered as described above. ``sys.argv[0]`` is " +"updated with the value of *file_path* and ``sys.modules[__name__]`` is " +"updated with a temporary module object for the module being executed. All " +"modifications to items in :mod:`sys` are reverted before the function " +"returns." +msgstr "" +"تغییراتی نیز در ماژول :mod:`sys` اعمال می‌شوند. نخست، ممکن است " +":data:`sys.path` همان‌طور که در بالا توضیح داده شد تغییر کند. " +"``sys.argv[0]`` با مقدار *file_path* به‌روزرسانی می‌شود و " +"``sys.modules[__name__]`` با یک شیء ماژول موقتی برای ماژول در حال اجرا " +"به‌روزرسانی می‌شود. پیش از بازگشت تابع، همه تغییرات در آیتم‌های :mod:`sys` " +"بازگردانده می‌شوند." -msgid "Note that, unlike :func:`run_module`, the alterations made to :mod:`sys` are not optional in this function as these adjustments are essential to allowing the execution of :data:`sys.path` entries. As the thread-safety limitations still apply, use of this function in threaded code should be either serialised with the import lock or delegated to a separate process." -msgstr "" +msgid "" +"Note that, unlike :func:`run_module`, the alterations made to :mod:`sys` are" +" not optional in this function as these adjustments are essential to " +"allowing the execution of :data:`sys.path` entries. As the thread-safety " +"limitations still apply, use of this function in threaded code should be " +"either serialised with the import lock or delegated to a separate process." +msgstr "" +"توجه داشته باشید که برخلاف :func:`run_module`، تغییرات اعمال‌شده بر " +":mod:`sys` در این تابع اختیاری نیستند، زیرا این تنظیمات برای امکان‌پذیر " +"ساختن اجرای مدخل‌های :data:`sys.path` ضروری‌اند. از آن‌جا که محدودیت‌های " +"ایمنی نخ همچنان برقرار است، استفاده از این تابع در کد چندنخی باید یا با قفل" +" ایمپورت به‌صورت متوالی انجام شود یا به یک فرایند جداگانه محول گردد." -msgid ":ref:`using-on-interface-options` for equivalent functionality on the command line (``python path/to/script``)." +msgid "" +":ref:`using-on-interface-options` for equivalent functionality on the " +"command line (``python path/to/script``)." msgstr "" +":ref:`using-on-interface-options` برای عملکرد معادل در خط فرمان (``python " +"path/to/script``)." -msgid "Updated to take advantage of the module spec feature added by :pep:`451`. This allows ``__cached__`` to be set correctly in the case where ``__main__`` is imported from a valid :data:`sys.path` entry rather than being executed directly." +msgid "" +"Updated to take advantage of the module spec feature added by :pep:`451`. " +"This allows ``__cached__`` to be set correctly in the case where " +"``__main__`` is imported from a valid :data:`sys.path` entry rather than " +"being executed directly." msgstr "" +"به‌روزرسانی شد تا از ویژگی مشخصات ماژول (module spec) که توسط :pep:`451` " +"اضافه شده است استفاده کند. این امر امکان می‌دهد که ``__cached__`` در حالتی " +"که ``__main__`` به‌جای اجرای مستقیم، از یک ورودی معتبر :data:`sys.path` " +"ایمپورت می‌شود، به‌درستی تنظیم شود." -msgid "The setting of ``__cached__``, ``__loader__``, and ``__package__`` are deprecated." -msgstr "" +msgid "" +"The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " +"deprecated." +msgstr "تنظیم ``__cached__``، ``__loader__`` و ``__package__`` منسوخ شده است." msgid ":pep:`338` -- Executing modules as scripts" -msgstr "" +msgstr ":pep:`338` -- اجرای ماژول‌ها به‌عنوان اسکریپت" msgid "PEP written and implemented by Nick Coghlan." -msgstr "" +msgstr "PEP توسط Nick Coghlan نوشته و پیاده‌سازی شده است." msgid ":pep:`366` -- Main module explicit relative imports" -msgstr "" +msgstr ":pep:`366` -- ایمپورت‌های نسبی صریح در ماژول اصلی" msgid ":pep:`451` -- A ModuleSpec Type for the Import System" -msgstr "" +msgstr ":pep:`451` -- یک نوع ModuleSpec برای سامانه‌ی ایمپورت" msgid "PEP written and implemented by Eric Snow" -msgstr "" +msgstr "PEP نوشته‌شده و پیاده‌سازی‌شده توسط اریک اسنو" msgid ":ref:`using-on-general` - CPython command line details" -msgstr "" +msgstr ":ref:`using-on-general` - جزئیات خط فرمان CPython" msgid "The :func:`importlib.import_module` function" -msgstr "" +msgstr "تابع :func:`importlib.import_module`" msgid "module" -msgstr "" +msgstr "ماژول" msgid "__main__" -msgstr "" +msgstr "__main__" diff --git a/library/sched.po b/library/sched.po index 79254d0c7..ba5ca46d7 100644 --- a/library/sched.po +++ b/library/sched.po @@ -24,25 +24,48 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!sched` --- Event scheduler" -msgstr "" +msgstr ":mod:`!sched` --- زمان‌بند رویداد" msgid "**Source code:** :source:`Lib/sched.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/sched.py`" -msgid "The :mod:`!sched` module defines a class which implements a general purpose event scheduler:" +msgid "" +"The :mod:`!sched` module defines a class which implements a general purpose " +"event scheduler:" msgstr "" +"ماژول :mod:`!sched` کلاسی را تعریف می‌کند که یک زمان‌بند رویداد همه‌منظوره " +"را پیاده‌سازی می‌کند:" -msgid "The :class:`scheduler` class defines a generic interface to scheduling events. It needs two functions to actually deal with the \"outside world\" --- *timefunc* should be callable without arguments, and return a number (the \"time\", in any units whatsoever). The *delayfunc* function should be callable with one argument, compatible with the output of *timefunc*, and should delay that many time units. *delayfunc* will also be called with the argument ``0`` after each event is run to allow other threads an opportunity to run in multi-threaded applications." -msgstr "" +msgid "" +"The :class:`scheduler` class defines a generic interface to scheduling " +"events. It needs two functions to actually deal with the \"outside world\" " +"--- *timefunc* should be callable without arguments, and return a number " +"(the \"time\", in any units whatsoever). The *delayfunc* function should be" +" callable with one argument, compatible with the output of *timefunc*, and " +"should delay that many time units. *delayfunc* will also be called with the " +"argument ``0`` after each event is run to allow other threads an opportunity" +" to run in multi-threaded applications." +msgstr "" +"کلاس :class:`scheduler` یک رابط عام برای زمان‌بندی رویدادها تعریف می‌کند. " +"این کلاس برای تعامل واقعی با «دنیای بیرون» به دو تابع نیاز دارد --- " +"*timefunc* باید بدون آرگومان قابل فراخوانی باشد و یک عدد برگرداند (عدد " +"«زمان»، در هر واحدی که باشد). تابع *delayfunc* باید با یک آرگومان قابل " +"فراخوانی باشد، با خروجی *timefunc* سازگار باشد و به همان تعداد واحد زمان " +"تأخیر ایجاد کند. *delayfunc* همچنین پس از اجرای هر رویداد با آرگومان ``0`` " +"فراخوانی می‌شود تا در برنامه‌های چندنخی، به سایر نخ‌ها فرصتی برای اجرا داده" +" شود." msgid "*timefunc* and *delayfunc* parameters are optional." -msgstr "" +msgstr "پارامترهای *timefunc* و *delayfunc* اختیاری هستند." -msgid ":class:`scheduler` class can be safely used in multi-threaded environments." +msgid "" +":class:`scheduler` class can be safely used in multi-threaded environments." msgstr "" +"می‌توان از کلاس :class:`scheduler` به‌صورت ایمن در محیط‌های چندنخی استفاده " +"کرد." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import sched, time\n" @@ -70,54 +93,144 @@ msgid "" "From print_time 1652342840.369612 default\n" "1652342840.3697174" msgstr "" +">>> import sched, time\n" +">>> s = sched.scheduler(time.time, time.sleep)\n" +">>> def print_time(a='default'):\n" +"... print(\"From print_time\", time.time(), a)\n" +"...\n" +">>> def print_some_times():\n" +"... print(time.time())\n" +"... s.enter(10, 1, print_time)\n" +"... s.enter(5, 2, print_time, argument=('positional',))\n" +"... # despite having higher priority, 'keyword' runs after 'positional' as enter() is relative\n" +"... s.enter(5, 1, print_time, kwargs={'a': 'keyword'})\n" +"... s.enterabs(1_650_000_000, 10, print_time, argument=(\"first enterabs\",))\n" +"... s.enterabs(1_650_000_000, 5, print_time, argument=(\"second enterabs\",))\n" +"... s.run()\n" +"... print(time.time())\n" +"...\n" +">>> print_some_times()\n" +"1652342830.3640375\n" +"From print_time 1652342830.3642538 second enterabs\n" +"From print_time 1652342830.3643398 first enterabs\n" +"From print_time 1652342835.3694863 positional\n" +"From print_time 1652342835.3696074 keyword\n" +"From print_time 1652342840.369612 default\n" +"1652342840.3697174" msgid "Scheduler Objects" -msgstr "" +msgstr "اشیای زمان‌بند" -msgid ":class:`scheduler` instances have the following methods and attributes:" -msgstr "" +msgid "" +":class:`scheduler` instances have the following methods and attributes:" +msgstr "نمونه‌های :class:`scheduler` دارای متدها و ویژگی‌های زیر هستند:" -msgid "Schedule a new event. The *time* argument should be a numeric type compatible with the return value of the *timefunc* function passed to the constructor. Events scheduled for the same *time* will be executed in the order of their *priority*. A lower number represents a higher priority." +msgid "" +"Schedule a new event. The *time* argument should be a numeric type " +"compatible with the return value of the *timefunc* function passed to the " +"constructor. Events scheduled for the same *time* will be executed in the " +"order of their *priority*. A lower number represents a higher priority." msgstr "" +"یک رویداد جدید را زمان‌بندی کنید. آرگومان *time* باید یک نوع عددی سازگار با " +"مقدار بازگشتی تابع *timefunc* باشد که به سازنده ارسال شده است. رویدادهای " +"زمان‌بندی‌شده برای *time* یکسان، به ترتیب *priority* آن‌ها اجرا می‌شوند. عدد" +" کوچک‌تر نشان‌دهنده اولویت بالاتر است." -msgid "Executing the event means executing ``action(*argument, **kwargs)``. *argument* is a sequence holding the positional arguments for *action*. *kwargs* is a dictionary holding the keyword arguments for *action*." +msgid "" +"Executing the event means executing ``action(*argument, **kwargs)``. " +"*argument* is a sequence holding the positional arguments for *action*. " +"*kwargs* is a dictionary holding the keyword arguments for *action*." msgstr "" +"اجرای رویداد به معنای اجرای ``action(*argument, **kwargs)`` است. *argument* " +"یک دنباله است که آرگومان‌های جایگاهی برای *action* را نگه می‌دارد. *kwargs* " +"یک دیکشنری است که آرگومان‌های کلیدواژه‌ای برای *action* را نگه می‌دارد." -msgid "Return value is an event which may be used for later cancellation of the event (see :meth:`cancel`)." +msgid "" +"Return value is an event which may be used for later cancellation of the " +"event (see :meth:`cancel`)." msgstr "" +"مقدار بازگشتی یک رویداد است که می‌توان از آن برای لغو بعدی رویداد استفاده " +"کرد (به :meth:`cancel` مراجعه کنید)." msgid "*argument* parameter is optional." -msgstr "" +msgstr "پارامتر *argument* اختیاری است." msgid "*kwargs* parameter was added." -msgstr "" +msgstr "پارامتر *kwargs* افزوده شد." -msgid "Schedule an event for *delay* more time units. Other than the relative time, the other arguments, the effect and the return value are the same as those for :meth:`enterabs`." +msgid "" +"Schedule an event for *delay* more time units. Other than the relative time," +" the other arguments, the effect and the return value are the same as those " +"for :meth:`enterabs`." msgstr "" +"رویدادی را برای *delay* واحد زمانی بیشتر زمان‌بندی می‌کند. به جز زمان نسبی، " +"سایر آرگومان‌ها، اثر و مقدار بازگشتی همانند موارد :meth:`enterabs` هستند." -msgid "Remove the event from the queue. If *event* is not an event currently in the queue, this method will raise a :exc:`ValueError`." +msgid "" +"Remove the event from the queue. If *event* is not an event currently in the" +" queue, this method will raise a :exc:`ValueError`." msgstr "" +"رویداد را از صف حذف می‌کند. اگر *event* رویدادی نباشد که در حال حاضر در صف " +"قرار دارد، این متد یک :exc:`ValueError` پرتاب می‌کند." msgid "Return ``True`` if the event queue is empty." -msgstr "" +msgstr "اگر صف رویداد خالی باشد، ``True`` را برمی‌گرداند." -msgid "Run all scheduled events. This method will wait (using the *delayfunc* function passed to the constructor) for the next event, then execute it and so on until there are no more scheduled events." +msgid "" +"Run all scheduled events. This method will wait (using the *delayfunc* " +"function passed to the constructor) for the next event, then execute it and " +"so on until there are no more scheduled events." msgstr "" +"تمام رویدادهای زمان‌بندی‌شده را اجرا می‌کند. این متد (با استفاده از تابع " +"*delayfunc* که به سازنده ارسال شده است) منتظر رویداد بعدی می‌ماند، سپس آن را" +" اجرا می‌کند و همین‌طور ادامه می‌دهد تا زمانی که دیگر هیچ رویداد " +"زمان‌بندی‌شده‌ای وجود نداشته باشد." -msgid "If *blocking* is false, immediately executes all events in the queue which have a time value less than or equal to the current *timefunc* value (if any) and returns the difference between the current *timefunc* value and the time value of the next scheduled event in the scheduler's event queue. If the queue is empty, returns ``None``." -msgstr "" +msgid "" +"If *blocking* is false, immediately executes all events in the queue which " +"have a time value less than or equal to the current *timefunc* value (if " +"any) and returns the difference between the current *timefunc* value and the" +" time value of the next scheduled event in the scheduler's event queue. If " +"the queue is empty, returns ``None``." +msgstr "" +"اگر *blocking* نادرست باشد، بلافاصله تمام رویدادهای موجود در صف را که مقدار " +"زمانی آن‌ها کمتر یا مساوی با مقدار فعلی *timefunc* است (در صورت وجود) اجرا " +"می‌کند و اختلاف بین مقدار فعلی *timefunc* و مقدار زمانی رویداد " +"زمان‌بندی‌شده‌ی بعدی در صف رویدادهای زمان‌بند را برمی‌گرداند. اگر صف خالی " +"باشد، ``None`` برمی‌گرداند." -msgid "Either *action* or *delayfunc* can raise an exception. In either case, the scheduler will maintain a consistent state and propagate the exception. If an exception is raised by *action*, the event will not be attempted in future calls to :meth:`run`." +msgid "" +"Either *action* or *delayfunc* can raise an exception. In either case, the " +"scheduler will maintain a consistent state and propagate the exception. If " +"an exception is raised by *action*, the event will not be attempted in " +"future calls to :meth:`run`." msgstr "" +"هر یک از *action* یا *delayfunc* می‌توانند یک استثنا پرتاب کنند. در هر صورت،" +" زمان‌بند وضعیت سازگار را حفظ می‌کند و استثنا را منتشر می‌کند. اگر استثنایی " +"توسط *action* پرتاب شود، برای اجرای رویداد در فراخوانی‌های آینده‌ی " +":meth:`run` تلاشی نخواهد شد." -msgid "If a sequence of events takes longer to run than the time available before the next event, the scheduler will simply fall behind. No events will be dropped; the calling code is responsible for canceling events which are no longer pertinent." +msgid "" +"If a sequence of events takes longer to run than the time available before " +"the next event, the scheduler will simply fall behind. No events will be " +"dropped; the calling code is responsible for canceling events which are no " +"longer pertinent." msgstr "" +"اگر اجرای دنباله‌ای از رویدادها بیشتر از زمان در دسترس پیش از رویداد بعدی " +"طول بکشد، زمان‌بند به‌سادگی عقب می‌افتد. هیچ رویدادی حذف نخواهد شد؛ کد " +"فراخوان مسئول لغو رویدادهایی است که دیگر مرتبط نیستند." msgid "*blocking* parameter was added." -msgstr "" +msgstr "پارامتر *blocking* افزوده شد." -msgid "Read-only attribute returning a list of upcoming events in the order they will be run. Each event is shown as a :term:`named tuple` with the following fields: time, priority, action, argument, kwargs." +msgid "" +"Read-only attribute returning a list of upcoming events in the order they " +"will be run. Each event is shown as a :term:`named tuple` with the " +"following fields: time, priority, action, argument, kwargs." msgstr "" +"ویژگی فقط‌خواندنی که فهرستی از رویدادهای پیش‌رو را به ترتیبی که اجرا خواهند " +"شد بازمی‌گرداند. هر رویداد به‌صورت یک :term:`named tuple` با فیلدهای زیر " +"نمایش داده می‌شود: time، priority، action، argument، kwargs." msgid "event scheduling" -msgstr "" +msgstr "زمان‌بندی رویداد" diff --git a/library/secrets.po b/library/secrets.po index 5e9f40d44..bf8930969 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -23,104 +23,199 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -msgid ":mod:`!secrets` --- Generate secure random numbers for managing secrets" -msgstr "" +msgid "" +":mod:`!secrets` --- Generate secure random numbers for managing secrets" +msgstr ":mod:`!secrets` --- تولید اعداد تصادفی امن برای مدیریت اسرار" msgid "**Source code:** :source:`Lib/secrets.py`" -msgstr "" +msgstr ":source:`Lib/secrets.py`" -msgid "The :mod:`!secrets` module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets." +msgid "" +"The :mod:`!secrets` module is used for generating cryptographically strong " +"random numbers suitable for managing data such as passwords, account " +"authentication, security tokens, and related secrets." msgstr "" +"ماژول :mod:`!secrets` برای تولید اعداد تصادفی قوی از نظر رمزنگاری استفاده " +"می‌شود که برای مدیریت داده‌هایی مانند گذرواژه‌ها، احراز هویت حساب، توکن‌های " +"امنیتی و رازهای مرتبط مناسب هستند." -msgid "In particular, :mod:`!secrets` should be used in preference to the default pseudo-random number generator in the :mod:`random` module, which is designed for modelling and simulation, not security or cryptography." +msgid "" +"In particular, :mod:`!secrets` should be used in preference to the default " +"pseudo-random number generator in the :mod:`random` module, which is " +"designed for modelling and simulation, not security or cryptography." msgstr "" +"به‌ویژه، باید به‌جای تولیدگر پیش‌فرض اعداد شبه‌تصادفی در ماژول :mod:`random " +"` از :mod:`!secrets ` استفاده شود؛ این تولیدگر برای " +"مدل‌سازی و شبیه‌سازی طراحی شده است، نه امنیت یا رمزنگاری." msgid ":pep:`506`" -msgstr "" +msgstr ":pep:`506`" msgid "Random numbers" -msgstr "" +msgstr "اعداد تصادفی" -msgid "The :mod:`!secrets` module provides access to the most secure source of randomness that your operating system provides." +msgid "" +"The :mod:`!secrets` module provides access to the most secure source of " +"randomness that your operating system provides." msgstr "" +"ماژول :mod:`!secrets` دسترسی به امن‌ترین منبع تصادف را که سیستم‌عامل شما " +"ارائه می‌دهد، فراهم می‌کند." -msgid "A class for generating random numbers using the highest-quality sources provided by the operating system. See :class:`random.SystemRandom` for additional details." +msgid "" +"A class for generating random numbers using the highest-quality sources " +"provided by the operating system. See :class:`random.SystemRandom` for " +"additional details." msgstr "" +"کلاسی برای تولید اعداد تصادفی با استفاده از باکیفیت‌ترین منابع ارائه‌شده " +"توسط سیستم‌عامل. برای جزئیات بیشتر، :class:`random.SystemRandom` را ببینید." msgid "Return a randomly chosen element from a non-empty sequence." -msgstr "" +msgstr "یک عنصر انتخاب‌شده به‌صورت تصادفی از یک دنباله‌ی غیرخالی برمی‌گرداند." msgid "Return a random int in the range [0, *exclusive_upper_bound*)." -msgstr "" +msgstr "یک عدد صحیح تصادفی در بازه‌ی [0, *exclusive_upper_bound*) برمی‌گرداند." msgid "Return a non-negative int with *k* random bits." -msgstr "" +msgstr "یک عدد صحیح نامنفی با *k* بیت تصادفی برمی‌گرداند." msgid "Generating tokens" -msgstr "" +msgstr "تولید توکن‌ها" -msgid "The :mod:`!secrets` module provides functions for generating secure tokens, suitable for applications such as password resets, hard-to-guess URLs, and similar." +msgid "" +"The :mod:`!secrets` module provides functions for generating secure tokens, " +"suitable for applications such as password resets, hard-to-guess URLs, and " +"similar." msgstr "" +"ماژول :mod:`!secrets` توابعی برای تولید توکن‌های امن فراهم می‌کند که برای " +"کاربردهایی مانند بازنشانی گذرواژه، URLهایی که حدس زدن آن‌ها دشوار است و " +"موارد مشابه مناسب هستند." msgid "Return a random byte string containing *nbytes* number of bytes." -msgstr "" +msgstr "یک رشته بایت تصادفی شامل تعداد *nbytes* بایت برمی‌گرداند." -msgid "If *nbytes* is not specified or ``None``, :const:`DEFAULT_ENTROPY` is used instead." +msgid "" +"If *nbytes* is not specified or ``None``, :const:`DEFAULT_ENTROPY` is used " +"instead." msgstr "" +"اگر *nbytes* مشخص نشده باشد یا ``None`` باشد، به‌جای آن از " +":const:`DEFAULT_ENTROPY` استفاده می‌شود." msgid "" ">>> token_bytes(16)\n" "b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'" msgstr "" +">>> token_bytes(16)\n" +"b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'" -msgid "Return a random text string, in hexadecimal. The string has *nbytes* random bytes, each byte converted to two hex digits." +msgid "" +"Return a random text string, in hexadecimal. The string has *nbytes* random" +" bytes, each byte converted to two hex digits." msgstr "" +"یک رشته متنی تصادفی را به‌صورت مبنای شانزده برمی‌گرداند. این رشته *nbytes* " +"بایت تصادفی دارد که هر بایت به دو رقم مبنای شانزده تبدیل می‌شود." msgid "" ">>> token_hex(16)\n" "'f9bf78b9a18ce6d46a0cd2b0b86df9da'" msgstr "" +">>> token_hex(16)\n" +"'f9bf78b9a18ce6d46a0cd2b0b86df9da'" -msgid "Return a random URL-safe text string, containing *nbytes* random bytes. The text is Base64 encoded, so on average each byte results in approximately 1.3 characters." +msgid "" +"Return a random URL-safe text string, containing *nbytes* random bytes. The" +" text is Base64 encoded, so on average each byte results in approximately " +"1.3 characters." msgstr "" +"یک رشته متنی تصادفی و امن برای URL برمی‌گرداند که شامل *nbytes* بایت تصادفی " +"است. این متن به‌صورت Base64 کدگذاری‌شده است، بنابراین به‌طور میانگین هر بایت" +" تقریباً معادل ۱٫۳ نویسه می‌شود." msgid "" ">>> token_urlsafe(16)\n" "'Drmhze6EPcv0fN_81Bj-nA'" msgstr "" +">>> token_urlsafe(16)\n" +"'Drmhze6EPcv0fN_81Bj-nA'" msgid "How many bytes should tokens use?" -msgstr "" +msgstr "توکن‌ها باید از چند بایت استفاده کنند؟" -msgid "To be secure against `brute-force attacks `_, tokens need to have sufficient randomness. Unfortunately, what is considered sufficient will necessarily increase as computers get more powerful and able to make more guesses in a shorter period. As of 2015, it is believed that 32 bytes (256 bits) of randomness is sufficient for the typical use-case expected for the :mod:`!secrets` module." -msgstr "" +msgid "" +"To be secure against `brute-force attacks " +"`_, tokens need to have " +"sufficient randomness. Unfortunately, what is considered sufficient will " +"necessarily increase as computers get more powerful and able to make more " +"guesses in a shorter period. As of 2015, it is believed that 32 bytes (256 " +"bits) of randomness is sufficient for the typical use-case expected for the " +":mod:`!secrets` module." +msgstr "" +"برای ایمن بودن در برابر `حملات جستجوی فراگیر (brute-force attacks) " +"`_، توکن‌ها باید از " +"تصادفی‌بودن کافی برخوردار باشند. متأسفانه، آنچه کافی در نظر گرفته می‌شود " +"لزوماً با قدرتمندتر شدن کامپیوترها و توانایی آن‌ها برای انجام حدس‌های بیشتر" +" در بازه‌ی زمانی کوتاه‌تر، افزایش خواهد یافت. از سال ۲۰۱۵، تصور می‌شود که ۳۲" +" بایت (۲۵۶ بیت) تصادفی‌بودن برای مورد استفاده‌ی معمولی که از ماژول " +":mod:`!secrets` انتظار می‌رود، کافی است." -msgid "For those who want to manage their own token length, you can explicitly specify how much randomness is used for tokens by giving an :class:`int` argument to the various ``token_*`` functions. That argument is taken as the number of bytes of randomness to use." +msgid "" +"For those who want to manage their own token length, you can explicitly " +"specify how much randomness is used for tokens by giving an :class:`int` " +"argument to the various ``token_*`` functions. That argument is taken as " +"the number of bytes of randomness to use." msgstr "" +"اگر می‌خواهید طول توکن‌های خود را مدیریت کنید، می‌توانید با دادن یک آرگومان " +":class:`int` به توابع مختلف ``token_*``، به‌صراحت مشخص کنید که چه میزان " +"تصادفی بودن برای توکن‌ها استفاده می‌شود. آن آرگومان به‌عنوان تعداد بایت‌های " +"تصادفی برای استفاده در نظر گرفته می‌شود." -msgid "Otherwise, if no argument is provided, or if the argument is ``None``, the ``token_*`` functions use :const:`DEFAULT_ENTROPY` instead." +msgid "" +"Otherwise, if no argument is provided, or if the argument is ``None``, the " +"``token_*`` functions use :const:`DEFAULT_ENTROPY` instead." msgstr "" +"در غیر این صورت، اگر هیچ آرگومانی ارائه نشود، یا اگر آرگومان ``None`` باشد، " +"توابع ``token_*`` به‌جای آن از :const:`DEFAULT_ENTROPY` استفاده می‌کنند." -msgid "Default number of bytes of randomness used by the ``token_*`` functions." +msgid "" +"Default number of bytes of randomness used by the ``token_*`` functions." msgstr "" +"تعداد پیش‌فرض بایت‌های تصادفی که توسط توابع ``token_*`` استفاده می‌شود." -msgid "The exact value is subject to change at any time, including during maintenance releases." +msgid "" +"The exact value is subject to change at any time, including during " +"maintenance releases." msgstr "" +"مقدار دقیق ممکن است در هر زمانی، از جمله در نسخه‌های نگهداری، تغییر کند." msgid "Other functions" -msgstr "" +msgstr "توابع دیگر" -msgid "Return ``True`` if strings or :term:`bytes-like objects ` *a* and *b* are equal, otherwise ``False``, using a \"constant-time compare\" to reduce the risk of `timing attacks `__. See :func:`hmac.compare_digest` for additional details." -msgstr "" +msgid "" +"Return ``True`` if strings or :term:`bytes-like objects `" +" *a* and *b* are equal, otherwise ``False``, using a \"constant-time " +"compare\" to reduce the risk of `timing attacks " +"`__. See :func:`hmac.compare_digest` for additional " +"details." +msgstr "" +"اگر رشته‌ها یا :term:`اشیای شبه‌بایت ` *a* و *b* " +"برابر باشند، ``True`` را برمی‌گرداند، در غیر این صورت ``False`` را " +"برمی‌گرداند و برای کاهش خطر `حملات زمان‌سنجی " +"`__ از «مقایسه با زمان ثابت» استفاده می‌کند. برای جزئیات " +"بیشتر، :func:`hmac.compare_digest` را ببینید." msgid "Recipes and best practices" -msgstr "" +msgstr "دستورعمل‌ها و بهترین روش‌ها" -msgid "This section shows recipes and best practices for using :mod:`!secrets` to manage a basic level of security." +msgid "" +"This section shows recipes and best practices for using :mod:`!secrets` to " +"manage a basic level of security." msgstr "" +"این بخش، دستور پخت‌ها و بهترین شیوه‌ها را برای استفاده از :mod:`!secrets` " +"جهت مدیریت یک سطح پایه از امنیت نشان می‌دهد." msgid "Generate an eight-character alphanumeric password:" -msgstr "" +msgstr "تولید یک گذرواژه‌ی الفبایی‌عددی هشت‌نویسه‌ای:" msgid "" "import string\n" @@ -128,12 +223,27 @@ msgid "" "alphabet = string.ascii_letters + string.digits\n" "password = ''.join(secrets.choice(alphabet) for i in range(8))" msgstr "" +"import string\n" +"import secrets\n" +"alphabet = string.ascii_letters + string.digits\n" +"password = ''.join(secrets.choice(alphabet) for i in range(8))" -msgid "Applications should not :cwe:`store passwords in a recoverable format <257>`, whether plain text or encrypted. They should be salted and hashed using a cryptographically strong one-way (irreversible) hash function." +msgid "" +"Applications should not :cwe:`store passwords in a recoverable format " +"<257>`, whether plain text or encrypted. They should be salted and hashed " +"using a cryptographically strong one-way (irreversible) hash function." msgstr "" +"برنامه‌ها نباید :cwe:`رمزهای عبور را در قالبی قابل‌بازیابی ذخیره کنند " +"<257>`، چه به‌صورت متن ساده و چه به‌صورت رمزنگاری‌شده. این رمزهای عبور باید" +" با استفاده از یک تابع هش یک‌طرفه (غیرقابل‌بازگشت) و قوی از نظر رمزنگاری، " +"نمک‌گذاری و هش‌دهی شوند." -msgid "Generate a ten-character alphanumeric password with at least one lowercase character, at least one uppercase character, and at least three digits:" +msgid "" +"Generate a ten-character alphanumeric password with at least one lowercase " +"character, at least one uppercase character, and at least three digits:" msgstr "" +"یک گذرواژه الفبایی‌عددی ۱۰ نویسه‌ای با دست‌کم ۱ نویسه کوچک، دست‌کم ۱ نویسه " +"بزرگ و دست‌کم ۳ رقم تولید کنید:" msgid "" "import string\n" @@ -146,9 +256,18 @@ msgid "" " and sum(c.isdigit() for c in password) >= 3):\n" " break" msgstr "" +"import string\n" +"import secrets\n" +"alphabet = string.ascii_letters + string.digits\n" +"while True:\n" +" password = ''.join(secrets.choice(alphabet) for i in range(10))\n" +" if (any(c.islower() for c in password)\n" +" and any(c.isupper() for c in password)\n" +" and sum(c.isdigit() for c in password) >= 3):\n" +" break" msgid "Generate an `XKCD-style passphrase `_:" -msgstr "" +msgstr "یک `عبارت عبور به سبک XKCD `_ تولید کنید:" msgid "" "import secrets\n" @@ -158,11 +277,23 @@ msgid "" " words = [word.strip() for word in f]\n" " password = ' '.join(secrets.choice(words) for i in range(4))" msgstr "" +"import secrets\n" +"# On standard Linux systems, use a convenient dictionary file.\n" +"# Other platforms may need to provide their own word-list.\n" +"with open('/usr/share/dict/words') as f:\n" +" words = [word.strip() for word in f]\n" +" password = ' '.join(secrets.choice(words) for i in range(4))" -msgid "Generate a hard-to-guess temporary URL containing a security token suitable for password recovery applications:" +msgid "" +"Generate a hard-to-guess temporary URL containing a security token suitable " +"for password recovery applications:" msgstr "" +"یک URL موقت که حدس زدن آن دشوار است و حاوی یک توکن امنیتی مناسب برای " +"برنامه‌های بازیابی گذرواژه است، تولید کنید:" msgid "" "import secrets\n" "url = 'https://example.com/reset=' + secrets.token_urlsafe()" msgstr "" +"import secrets\n" +"url = 'https://example.com/reset=' + secrets.token_urlsafe()" diff --git a/library/security_warnings.po b/library/security_warnings.po index 51116ab40..9467af527 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-08-10 13:22+0000\n" +"PO-Revision-Date: 2026-08-28 11:22+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,54 +22,107 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Security Considerations" -msgstr "" +msgstr "ملاحظات امنیتی" msgid "The following modules have specific security considerations:" -msgstr "" +msgstr "ماژول‌های زیر ملاحظات امنیتی خاصی دارند:" -msgid ":mod:`base64`: :ref:`base64 security considerations ` in :rfc:`4648`" +msgid "" +":mod:`base64`: :ref:`base64 security considerations ` " +"in :rfc:`4648`" msgstr "" +":mod:`base64`: :ref:`ملاحظات امنیتی base64 ` در :rfc:`4648`" -msgid ":mod:`hashlib`: :ref:`all constructors take a \"usedforsecurity\" keyword-only argument disabling known insecure and blocked algorithms `" +msgid "" +":mod:`hashlib`: :ref:`all constructors take a \"usedforsecurity\" keyword-" +"only argument disabling known insecure and blocked algorithms `" msgstr "" +":mod:`hashlib`: :ref:`همه‌ی سازنده‌ها یک آرگومان فقط کلیدواژه‌ای " +"\"usedforsecurity\" می‌پذیرند که الگوریتم‌های ناامن و مسدودشده‌ی شناخته‌شده را " +"غیرفعال می‌کند `" -msgid ":mod:`http.server` is not suitable for production use, only implementing basic security checks. See the :ref:`security considerations `." +msgid "" +":mod:`http.server` is not suitable for production use, only implementing " +"basic security checks. See the :ref:`security considerations `." msgstr "" +":mod:`http.server` برای استفاده در محیط عملیاتی مناسب نیست، زیرا فقط " +"بررسی‌های امنیتی پایه را پیاده‌سازی می‌کند. :ref:`ملاحظات امنیتی ` را ببینید." -msgid ":mod:`logging`: :ref:`Logging configuration uses eval() `" +msgid "" +":mod:`logging`: :ref:`Logging configuration uses eval() `" msgstr "" +":mod:`logging`: :ref:`پیکربندی گزارش‌گیری از eval() استفاده می‌کند `" -msgid ":mod:`multiprocessing`: :ref:`Connection.recv() uses pickle `" +msgid "" +":mod:`multiprocessing`: :ref:`Connection.recv() uses pickle " +"`" msgstr "" +":mod:`multiprocessing`: :ref:`Connection.recv() از pickle استفاده می‌کند " +"`" msgid ":mod:`pickle`: :ref:`Restricting globals in pickle `" -msgstr "" +msgstr ":mod:`pickle`: :ref:`محدودسازی سراسری‌ها در pickle `" -msgid ":mod:`random` shouldn't be used for security purposes, use :mod:`secrets` instead" +msgid "" +":mod:`random` shouldn't be used for security purposes, use :mod:`secrets` " +"instead" msgstr "" +"از :mod:`random` نباید برای اهداف امنیتی استفاده شود؛ در عوض " +"از :mod:`secrets` استفاده کنید" -msgid ":mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for dealing with untrusted sources `" +msgid "" +":mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for " +"dealing with untrusted sources `" msgstr "" +":mod:`shelve`: :ref:`shelve مبتنی بر pickle است و بنابراین برای کار با " +"منابع غیرقابل‌اعتماد مناسب نیست `" msgid ":mod:`ssl`: :ref:`SSL/TLS security considerations `" -msgstr "" +msgstr ":mod:`ssl`: :ref:`ملاحظات امنیتی SSL/TLS `" -msgid ":mod:`subprocess`: :ref:`Subprocess security considerations `" +msgid "" +":mod:`subprocess`: :ref:`Subprocess security considerations `" msgstr "" +":mod:`subprocess`: :ref:`ملاحظات امنیتی subprocess `" -msgid ":mod:`tempfile`: :ref:`mktemp is deprecated due to vulnerability to race conditions `" +msgid "" +":mod:`tempfile`: :ref:`mktemp is deprecated due to vulnerability to race " +"conditions `" msgstr "" +":mod:`tempfile`: :ref:`mktemp به دلیل آسیب‌پذیری در برابر شرایط رقابتی منسوخ " +"شده است `" msgid ":mod:`xml`: :ref:`XML security `" -msgstr "" +msgstr ":mod:`xml`: :ref:`امنیت XML `" -msgid ":mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume exhaustion `" +msgid "" +":mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume " +"exhaustion `" msgstr "" +":mod:`zipfile`: :ref:`فایل‌های .zip تهیه‌شده با نیت مخرب می‌توانند باعث پر شدن " +"فضای دیسک شوند `" -msgid "The :option:`-I` command line option can be used to run Python in isolated mode. When it cannot be used, the :option:`-P` option or the :envvar:`PYTHONSAFEPATH` environment variable can be used to not prepend a potentially unsafe path to :data:`sys.path` such as the current directory, the script's directory or an empty string." -msgstr "" +msgid "" +"The :option:`-I` command line option can be used to run Python in isolated " +"mode. When it cannot be used, the :option:`-P` option or " +"the :envvar:`PYTHONSAFEPATH` environment variable can be used to not " +"prepend a potentially unsafe path to :data:`sys.path` such as the current " +"directory, the script's directory or an empty string." +msgstr "" +"از گزینه خط فرمان :option:`-I` می‌توان برای اجرای پایتون در حالت ایزوله " +"(isolated mode) استفاده کرد. هنگامی که نمی‌توان از آن استفاده کرد، می‌توان از " +"گزینه :option:`-P` یا متغیر محیطی :envvar:`PYTHONSAFEPATH` استفاده کرد تا " +"مسیر بالقوه ناامنی مانند پوشه جاری، پوشه اسکریپت یا یک رشته خالی " +"به :data:`sys.path` پیش‌افزوده نشود." msgid "security considerations" -msgstr "" +msgstr "ملاحظات امنیتی" diff --git a/library/select.po b/library/select.po index 8c2752bf3..53242c625 100644 --- a/library/select.po +++ b/library/select.po @@ -24,628 +24,970 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!select` --- Waiting for I/O completion" -msgstr "" +msgstr ":mod:`!select` --- در انتظار تکمیل ورودی/خروجی" -msgid "This module provides access to the :c:func:`!select` and :c:func:`!poll` functions available in most operating systems, :c:func:`!devpoll` available on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and :c:func:`!kqueue` available on most BSD. Note that on Windows, it only works for sockets; on other operating systems, it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read." -msgstr "" +msgid "" +"This module provides access to the :c:func:`!select` and :c:func:`!poll` " +"functions available in most operating systems, :c:func:`!devpoll` available " +"on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and " +":c:func:`!kqueue` available on most BSD. Note that on Windows, it only works" +" for sockets; on other operating systems, it also works for other file types" +" (in particular, on Unix, it works on pipes). It cannot be used on regular " +"files to determine whether a file has grown since it was last read." +msgstr "" +"این ماژول دسترسی به توابع :c:func:`!select` و :c:func:`!poll` موجود در بیشتر" +" سیستم‌عامل‌ها، :c:func:`!devpoll` موجود در Solaris و مشتقات آن، " +":c:func:`!epoll` موجود در Linux 2.5+ و :c:func:`!kqueue` موجود در بیشتر " +"سیستم‌های BSD را فراهم می‌کند. توجه داشته باشید که در Windows، فقط برای " +"سوکت‌ها کار می‌کند؛ در سایر سیستم‌عامل‌ها، برای انواع دیگر فایل نیز کار " +"می‌کند (به‌ویژه در Unix، روی پایپ‌ها کار می‌کند). نمی‌توان از آن برای " +"فایل‌های معمولی استفاده کرد تا تعیین شود که آیا یک فایل از آخرین باری که " +"خوانده شده است بزرگ‌تر شده است یا خیر." -msgid "The :mod:`selectors` module allows high-level and efficient I/O multiplexing, built upon the :mod:`!select` module primitives. Users are encouraged to use the :mod:`selectors` module instead, unless they want precise control over the OS-level primitives used." +msgid "" +"The :mod:`selectors` module allows high-level and efficient I/O " +"multiplexing, built upon the :mod:`!select` module primitives. Users are " +"encouraged to use the :mod:`selectors` module instead, unless they want " +"precise control over the OS-level primitives used." msgstr "" +"ماژول :mod:`selectors` امکان تسهیم I/O سطح بالا و کارآمد را فراهم می‌کند و " +"بر پایه عناصر اولیه ماژول :mod:`!select` ساخته شده است. به کاربران توصیه " +"می‌شود به‌جای آن از ماژول :mod:`selectors` استفاده کنند، مگر اینکه بخواهند " +"کنترل دقیقی بر عناصر اولیه مورد استفاده در سطح سیستم‌عامل داشته باشند." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "The module defines the following:" -msgstr "" +msgstr "این ماژول موارد زیر را تعریف می‌کند:" msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "نام مستعار منسوخ :exc:`OSError`." msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." -msgstr "" +msgstr "پیرو :pep:`3151`، این کلاس نام مستعار :exc:`OSError` شد." -msgid "Returns a ``/dev/poll`` polling object; see section :ref:`devpoll-objects` below for the methods supported by devpoll objects." +msgid "" +"Returns a ``/dev/poll`` polling object; see section :ref:`devpoll-objects` " +"below for the methods supported by devpoll objects." msgstr "" +"یک شیء پایش (polling) برای ``/dev/poll`` برمی‌گرداند؛ برای متدهای " +"پشتیبانی‌شده توسط اشیای devpoll، بخش :ref:`devpoll-objects` در زیر را " +"ببینید." -msgid ":c:func:`!devpoll` objects are linked to the number of file descriptors allowed at the time of instantiation. If your program reduces this value, :c:func:`!devpoll` will fail. If your program increases this value, :c:func:`!devpoll` may return an incomplete list of active file descriptors." +msgid "" +":c:func:`!devpoll` objects are linked to the number of file descriptors " +"allowed at the time of instantiation. If your program reduces this value, " +":c:func:`!devpoll` will fail. If your program increases this value, " +":c:func:`!devpoll` may return an incomplete list of active file descriptors." msgstr "" +"اشیاء :c:func:`!devpoll` به تعداد مجاز توصیف‌گرهای فایل در زمان نمونه‌سازی " +"وابسته‌اند. اگر برنامه شما این مقدار را کاهش دهد، :c:func:`!devpoll` شکست " +"خواهد خورد. اگر برنامه شما این مقدار را افزایش دهد، :c:func:`!devpoll` ممکن " +"است فهرست ناقصی از توصیف‌گرهای فایل فعال را برگرداند." msgid "The new file descriptor is :ref:`non-inheritable `." -msgstr "" +msgstr "توصیف‌گر فایل جدید :ref:`غیرقابل ارث‌بری ` است." msgid "The new file descriptor is now non-inheritable." -msgstr "" +msgstr "توصیف‌گر فایل جدید اکنون غیرقابل‌ارث‌بری است." -msgid "Return an edge polling object, which can be used as Edge or Level Triggered interface for I/O events." +msgid "" +"Return an edge polling object, which can be used as Edge or Level Triggered " +"interface for I/O events." msgstr "" +"یک شیء پایش لبه‌ای (edge polling) را برمی‌گرداند، که می‌توان از آن به‌عنوان " +"رابط تحریک لبه‌ای (Edge Triggered) یا تحریک سطحی (Level Triggered) برای " +"رویدادهای ورودی/خروجی استفاده کرد." -msgid "*sizehint* informs epoll about the expected number of events to be registered. It must be positive, or ``-1`` to use the default. It is only used on older systems where :c:func:`!epoll_create1` is not available; otherwise it has no effect (though its value is still checked)." +msgid "" +"*sizehint* informs epoll about the expected number of events to be " +"registered. It must be positive, or ``-1`` to use the default. It is only " +"used on older systems where :c:func:`!epoll_create1` is not available; " +"otherwise it has no effect (though its value is still checked)." msgstr "" +"*sizehint* تعداد مورد انتظار رویدادهای ثبت‌شونده را به epoll اطلاع می‌دهد. " +"این مقدار باید مثبت باشد، یا ``-1`` باشد تا از مقدار پیش‌فرض استفاده شود. " +"این مقدار فقط در سیستم‌های قدیمی‌تری استفاده می‌شود که " +":c:func:`!epoll_create1` در آن‌ها در دسترس نیست؛ در غیر این صورت هیچ اثری " +"ندارد (هرچند مقدار آن همچنان بررسی می‌شود)." -msgid "*flags* is deprecated and completely ignored. However, when supplied, its value must be ``0`` or ``select.EPOLL_CLOEXEC``, otherwise ``OSError`` is raised." +msgid "" +"*flags* is deprecated and completely ignored. However, when supplied, its " +"value must be ``0`` or ``select.EPOLL_CLOEXEC``, otherwise ``OSError`` is " +"raised." msgstr "" +"*flags* منسوخ شده و به‌طور کامل نادیده گرفته می‌شود. با این حال، در صورتی که" +" ارائه شود، مقدار آن باید ``0`` یا ``select.EPOLL_CLOEXEC`` باشد، در غیر این" +" صورت ``OSError`` پرتاب می‌شود." -msgid "See the :ref:`epoll-objects` section below for the methods supported by epolling objects." +msgid "" +"See the :ref:`epoll-objects` section below for the methods supported by " +"epolling objects." msgstr "" +"برای متدهای پشتیبانی‌شده توسط اشیای epolling، بخش :ref:`epoll-objects` در " +"زیر را ببینید." -msgid "``epoll`` objects support the context management protocol: when used in a :keyword:`with` statement, the new file descriptor is automatically closed at the end of the block." +msgid "" +"``epoll`` objects support the context management protocol: when used in a " +":keyword:`with` statement, the new file descriptor is automatically closed " +"at the end of the block." msgstr "" +"اشیای ``epoll`` از پروتکل مدیریت زمینه پشتیبانی می‌کنند: هنگامی که در یک " +"دستور :keyword:`with` استفاده شوند، توصیف‌گر فایل جدید به‌طور خودکار در " +"پایان بلوک بسته می‌شود." msgid "Added the *flags* parameter." -msgstr "" +msgstr "پارامتر *flags* افزوده شد." -msgid "Support for the :keyword:`with` statement was added. The new file descriptor is now non-inheritable." +msgid "" +"Support for the :keyword:`with` statement was added. The new file descriptor" +" is now non-inheritable." msgstr "" +"پشتیبانی از دستور :keyword:`with` اضافه شد. توصیف‌گر فایل جدید اکنون " +"غیرقابل‌ارث‌بری است." -msgid "The *flags* parameter. ``select.EPOLL_CLOEXEC`` is used by default now. Use :func:`os.set_inheritable` to make the file descriptor inheritable." +msgid "" +"The *flags* parameter. ``select.EPOLL_CLOEXEC`` is used by default now. Use" +" :func:`os.set_inheritable` to make the file descriptor inheritable." msgstr "" +"پارامتر *flags*. اکنون از ``select.EPOLL_CLOEXEC`` به‌صورت پیش‌فرض استفاده " +"می‌شود. برای اینکه توصیف‌گر فایل قابل ارث‌بردن شود، از " +":func:`os.set_inheritable` استفاده کنید." -msgid "Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events; see section :ref:`poll-objects` below for the methods supported by polling objects." +msgid "" +"Returns a polling object, which supports registering and unregistering file " +"descriptors, and then polling them for I/O events; see section :ref:`poll-" +"objects` below for the methods supported by polling objects." msgstr "" +"یک شیء پایش (polling object) برمی‌گرداند که از ثبت و لغو ثبت توصیف‌گرهای " +"فایل و سپس پایش آن‌ها برای رویدادهای ورودی/خروجی پشتیبانی می‌کند؛ برای " +"متدهای پشتیبانی‌شده توسط اشیای پایش، بخش :ref:`poll-objects` در زیر را " +"ببینید." -msgid "Returns a kernel queue object; see section :ref:`kqueue-objects` below for the methods supported by kqueue objects." +msgid "" +"Returns a kernel queue object; see section :ref:`kqueue-objects` below for " +"the methods supported by kqueue objects." msgstr "" +"یک شیء صف هسته (kernel queue) برمی‌گرداند؛ برای متدهای پشتیبانی‌شده توسط " +"اشیای kqueue، بخش :ref:`kqueue-objects` در زیر را ببینید." -msgid "Returns a kernel event object; see section :ref:`kevent-objects` below for the methods supported by kevent objects." +msgid "" +"Returns a kernel event object; see section :ref:`kevent-objects` below for " +"the methods supported by kevent objects." msgstr "" +"یک شیء رویداد هسته برمی‌گرداند؛ برای متدهای پشتیبانی‌شده توسط اشیای kevent، " +"بخش :ref:`kevent-objects` در زیر را ببینید." -msgid "This is a straightforward interface to the Unix :c:func:`!select` system call. The first three arguments are iterables of 'waitable objects': either integers representing file descriptors or objects with a parameterless method named :meth:`~io.IOBase.fileno` returning such an integer:" +msgid "" +"This is a straightforward interface to the Unix :c:func:`!select` system " +"call. The first three arguments are iterables of 'waitable objects': either " +"integers representing file descriptors or objects with a parameterless " +"method named :meth:`~io.IOBase.fileno` returning such an integer:" msgstr "" +"این یک رابط ساده برای فراخوانی سیستمی :c:func:`!select` در یونیکس است. سه " +"آرگومان نخست، پیمایش‌پذیرهایی از «اشیاء انتظارپذیر (waitable objects)» هستند:" +" یا اعداد صحیحی که توصیف‌گرهای فایل را نشان می‌دهند، یا اشیایی با یک متد " +"بدون پارامتر به نام :meth:`~io.IOBase.fileno` که چنین عدد صحیحی را " +"برمی‌گرداند:" msgid "*rlist*: wait until ready for reading" -msgstr "" +msgstr "*rlist*: تا آماده شدن برای خواندن منتظر بمانید" msgid "*wlist*: wait until ready for writing" -msgstr "" +msgstr "*wlist*: صبر کنید تا برای نوشتن آماده شود" -msgid "*xlist*: wait for an \"exceptional condition\" (see the manual page for what your system considers such a condition)" +msgid "" +"*xlist*: wait for an \"exceptional condition\" (see the manual page for what" +" your system considers such a condition)" msgstr "" +"*xlist*: منتظر یک «وضعیت استثنایی» باشید (برای آگاهی از اینکه سیستم شما چه " +"چیزی را چنین وضعیتی می‌داند، به صفحه راهنما مراجعه کنید)" -msgid "Empty iterables are allowed, but acceptance of three empty iterables is platform-dependent. (It is known to work on Unix but not on Windows.) The optional *timeout* argument specifies a time-out as a floating-point number in seconds. When the *timeout* argument is omitted or ``None``, the function blocks until at least one file descriptor is ready. A time-out value of zero specifies a poll and never blocks." -msgstr "" +msgid "" +"Empty iterables are allowed, but acceptance of three empty iterables is " +"platform-dependent. (It is known to work on Unix but not on Windows.) The " +"optional *timeout* argument specifies a time-out as a floating-point number " +"in seconds. When the *timeout* argument is omitted or ``None``, the function" +" blocks until at least one file descriptor is ready. A time-out value of " +"zero specifies a poll and never blocks." +msgstr "" +"پیمایش‌پذیرهای خالی مجاز هستند، اما پذیرش ۳ پیمایش‌پذیر خالی به پلتفرم وابسته " +"است. (شناخته شده است که روی Unix کار می‌کند، اما روی Windows کار نمی‌کند.) " +"آرگومان اختیاری *timeout*، زمان توقف را به‌صورت عدد ممیز شناور بر حسب ثانیه " +"مشخص می‌کند. هرگاه آرگومان *timeout* حذف شود یا ``None`` باشد، تابع مسدود " +"می‌شود تا حداقل یک توصیف‌گر فایل آماده شود. مقدار زمان توقف ۰، یک پایش " +"(poll) را مشخص می‌کند و تابع هرگز مسدود نمی‌شود." -msgid "The return value is a triple of lists of objects that are ready: subsets of the first three arguments. When the time-out is reached without a file descriptor becoming ready, three empty lists are returned." +msgid "" +"The return value is a triple of lists of objects that are ready: subsets of " +"the first three arguments. When the time-out is reached without a file " +"descriptor becoming ready, three empty lists are returned." msgstr "" +"مقدار بازگشتی، یک سه‌تایی از فهرست‌هایی از اشیای آماده است: زیرمجموعه‌هایی " +"از سه آرگومان نخست. هنگامی که مهلت زمانی بدون آماده شدن توصیف‌گر فایلی به " +"پایان برسد، سه فهرست خالی برگردانده می‌شود." -msgid "Among the acceptable object types in the iterables are Python :term:`file objects ` (e.g. ``sys.stdin``, or objects returned by :func:`open` or :func:`os.popen`), socket objects returned by :func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself, as long as it has an appropriate :meth:`~io.IOBase.fileno` method (that really returns a file descriptor, not just a random integer)." -msgstr "" +msgid "" +"Among the acceptable object types in the iterables are Python :term:`file " +"objects ` (e.g. ``sys.stdin``, or objects returned by " +":func:`open` or :func:`os.popen`), socket objects returned by " +":func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself," +" as long as it has an appropriate :meth:`~io.IOBase.fileno` method (that " +"really returns a file descriptor, not just a random integer)." +msgstr "" +"از میان انواع قابل قبول شیء در پیمایش‌پذیرها می‌توان به :term:`اشیای فایل " +"` پایتون (مثلاً ``sys.stdin``، یا اشیای برگردانده‌شده توسط " +":func:`open` یا :func:`os.popen`) و اشیای سوکت برگردانده‌شده توسط " +":func:`socket.socket` اشاره کرد. همچنین می‌توانید خودتان یک کلاس :dfn:`پوششی" +" ` تعریف کنید، به شرطی که متد :meth:`~io.IOBase.fileno` مناسبی " +"داشته باشد (که واقعاً یک توصیف‌گر فایل را برمی‌گرداند، نه صرفاً یک عدد صحیح " +"تصادفی)." -msgid "File objects on Windows are not acceptable, but sockets are. On Windows, the underlying :c:func:`!select` function is provided by the WinSock library, and does not handle file descriptors that don't originate from WinSock." +msgid "" +"File objects on Windows are not acceptable, but sockets are. On Windows, " +"the underlying :c:func:`!select` function is provided by the WinSock " +"library, and does not handle file descriptors that don't originate from " +"WinSock." msgstr "" +"اشیای فایل در ویندوز قابل قبول نیستند، اما سوکت‌ها قابل قبول هستند. در " +"ویندوز، تابع زیربنایی :c:func:`!select` توسط کتابخانه WinSock ارائه می‌شود و" +" توصیف‌گرهای فایلی را که از WinSock منشأ نگرفته‌اند، مدیریت نمی‌کند." -msgid "The function is now retried with a recomputed timeout when interrupted by a signal, except if the signal handler raises an exception (see :pep:`475` for the rationale), instead of raising :exc:`InterruptedError`." +msgid "" +"The function is now retried with a recomputed timeout when interrupted by a " +"signal, except if the signal handler raises an exception (see :pep:`475` for" +" the rationale), instead of raising :exc:`InterruptedError`." msgstr "" +"این تابع اکنون هنگامی که یک سیگنال آن را قطع کند، به‌جای پرتاب " +":exc:`InterruptedError`، با یک مهلت زمانی بازمحاسبه‌شده دوباره اجرا می‌شود، " +"مگر اینکه هندلر سیگنال استثنایی پرتاب کند (برای دلیل آن، :pep:`475` " +"را ببینید)." -msgid "The minimum number of bytes which can be written without blocking to a pipe when the pipe has been reported as ready for writing by :func:`~select.select`, :func:`!poll` or another interface in this module. This doesn't apply to other kinds of file-like objects such as sockets." +msgid "" +"The minimum number of bytes which can be written without blocking to a pipe " +"when the pipe has been reported as ready for writing by " +":func:`~select.select`, :func:`!poll` or another interface in this module. " +"This doesn't apply to other kinds of file-like objects such as sockets." msgstr "" +"حداقل تعداد بایت‌هایی که می‌توان بدون مسدود شدن در یک پایپ نوشت، هنگامی که " +"پایپ توسط :func:`~select.select`، :func:`!poll` یا رابط دیگری در این ماژول " +"به‌عنوان آماده برای نوشتن گزارش شده باشد. این موضوع به انواع دیگر اشیاء " +"فایل‌مانند مانند سوکت‌ها اعمال نمی‌شود." msgid "This value is guaranteed by POSIX to be at least 512." -msgstr "" +msgstr "POSIX تضمین می‌کند که این مقدار حداقل ۵۱۲ باشد." msgid "``/dev/poll`` polling objects" -msgstr "" +msgstr "اشیای پایش ``/dev/poll``" -msgid "Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is *O*\\ (*highest file descriptor*) and :c:func:`!poll` is *O*\\ (*number of file descriptors*), ``/dev/poll`` is *O*\\ (*active file descriptors*)." +msgid "" +"Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is *O*\\" +" (*highest file descriptor*) and :c:func:`!poll` is *O*\\ (*number of file " +"descriptors*), ``/dev/poll`` is *O*\\ (*active file descriptors*)." msgstr "" +"سولاریس و مشتقات آن دارای ``/dev/poll`` هستند. در حالی که :c:func:`!select` " +"از مرتبه‌ی *O*\\ (*بالاترین توصیف‌گر فایل*) و :c:func:`!poll` از مرتبه‌ی " +"*O*\\ (*تعداد توصیف‌گرهای فایل*) است، ``/dev/poll`` از مرتبه‌ی *O*\\ " +"(*توصیف‌گرهای فایل فعال*) است." -msgid "``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` object." -msgstr "" +msgid "" +"``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` " +"object." +msgstr "رفتار ``/dev/poll`` بسیار نزدیک به شیء استاندارد :c:func:`!poll` است." msgid "Close the file descriptor of the polling object." -msgstr "" +msgstr "توصیف‌گر فایل شیء پایش (polling) را ببندید." msgid "``True`` if the polling object is closed." -msgstr "" +msgstr "``True`` اگر شیء پایش (polling) بسته باشد." msgid "Return the file descriptor number of the polling object." -msgstr "" +msgstr "شماره توصیف‌گر فایل شیء polling را برمی‌گرداند." -msgid "Register a file descriptor with the polling object. Future calls to the :meth:`poll` method will then check whether the file descriptor has any pending I/O events. *fd* can be either an integer, or an object with a :meth:`~io.IOBase.fileno` method that returns an integer. File objects implement :meth:`!fileno`, so they can also be used as the argument." -msgstr "" +msgid "" +"Register a file descriptor with the polling object. Future calls to the " +":meth:`poll` method will then check whether the file descriptor has any " +"pending I/O events. *fd* can be either an integer, or an object with a " +":meth:`~io.IOBase.fileno` method that returns an integer. File objects " +"implement :meth:`!fileno`, so they can also be used as the argument." +msgstr "" +"یک توصیف‌گر فایل را در شیء پایش (polling) ثبت کنید. فراخوانی‌های بعدی متد" +" :meth:`poll` سپس بررسی می‌کنند که آیا توصیف‌گر فایل رویدادهای ورودی/خروجی " +"در انتظار دارد یا خیر. *fd* می‌تواند یک عدد صحیح باشد، یا شیءای با متد " +":meth:`~io.IOBase.fileno` که یک عدد صحیح بازمی‌گرداند. اشیای فایل " +":meth:`!fileno` را پیاده‌سازی می‌کنند، بنابراین می‌توان از آن‌ها نیز " +"به‌عنوان آرگومان استفاده کرد." -msgid "*eventmask* is an optional bitmask describing the type of events you want to check for. The constants are the same as with :c:func:`!poll` object. The default value is a combination of the constants :const:`POLLIN`, :const:`POLLPRI`, and :const:`POLLOUT`." +msgid "" +"*eventmask* is an optional bitmask describing the type of events you want to" +" check for. The constants are the same as with :c:func:`!poll` object. The " +"default value is a combination of the constants :const:`POLLIN`, " +":const:`POLLPRI`, and :const:`POLLOUT`." msgstr "" +"*eventmask* یک نقاب بیتی اختیاری است که نوع رویدادهایی را که می‌خواهید بررسی " +"کنید توصیف می‌کند. ثابت‌ها همان ثابت‌های مورد استفاده در شیء :c:func:`!poll`" +" هستند. مقدار پیش‌فرض ترکیبی از ثابت‌های :const:`POLLIN`، :const:`POLLPRI` و" +" :const:`POLLOUT` است." -msgid "Registering a file descriptor that's already registered is not an error, but the result is undefined. The appropriate action is to unregister or modify it first. This is an important difference compared with :c:func:`!poll`." +msgid "" +"Registering a file descriptor that's already registered is not an error, but" +" the result is undefined. The appropriate action is to unregister or modify " +"it first. This is an important difference compared with :c:func:`!poll`." msgstr "" +"ثبت یک توصیف‌گر فایل که از پیش ثبت شده است، خطا نیست، اما نتیجه تعریف‌نشده " +"است. اقدام مناسب این است که ابتدا آن را از ثبت خارج کنید یا تغییر دهید. این " +"یک تفاوت مهم در مقایسه با :c:func:`!poll` است." -msgid "This method does an :meth:`unregister` followed by a :meth:`register`. It is (a bit) more efficient than doing the same explicitly." +msgid "" +"This method does an :meth:`unregister` followed by a :meth:`register`. It is" +" (a bit) more efficient than doing the same explicitly." msgstr "" +"این متد یک :meth:`unregister` و به دنبال آن یک :meth:`register` انجام " +"می‌دهد. این کار (کمی) کارآمدتر از انجام همان کار به‌صورت صریح است." -msgid "Remove a file descriptor being tracked by a polling object. Just like the :meth:`register` method, *fd* can be an integer or an object with a :meth:`~io.IOBase.fileno` method that returns an integer." +msgid "" +"Remove a file descriptor being tracked by a polling object. Just like the " +":meth:`register` method, *fd* can be an integer or an object with a " +":meth:`~io.IOBase.fileno` method that returns an integer." msgstr "" +"یک توصیف‌گر فایل را که توسط یک شیء پایش (polling) پیگیری می‌شود، حذف " +"کنید. دقیقاً مانند متد :meth:`register`، *fd* می‌تواند یک عدد صحیح یا یک شیء" +" با متد :meth:`~io.IOBase.fileno` باشد که یک عدد صحیح برمی‌گرداند." -msgid "Attempting to remove a file descriptor that was never registered is safely ignored." +msgid "" +"Attempting to remove a file descriptor that was never registered is safely " +"ignored." msgstr "" +"تلاش برای حذف توصیف‌گر پرونده‌ای که هرگز ثبت نشده است، به‌طور ایمن نادیده " +"گرفته می‌شود." -msgid "Polls the set of registered file descriptors, and returns a possibly empty list containing ``(fd, event)`` 2-tuples for the descriptors that have events or errors to report. *fd* is the file descriptor, and *event* is a bitmask with bits set for the reported events for that descriptor --- :const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the descriptor can be written to, and so forth. An empty list indicates that the call timed out and no file descriptors had any events to report. If *timeout* is given, it specifies the length of time in milliseconds which the system will wait for events before returning. If *timeout* is omitted, -1, or :const:`None`, the call will block until there is an event for this poll object." -msgstr "" +msgid "" +"Polls the set of registered file descriptors, and returns a possibly empty " +"list containing ``(fd, event)`` 2-tuples for the descriptors that have " +"events or errors to report. *fd* is the file descriptor, and *event* is a " +"bitmask with bits set for the reported events for that descriptor --- " +":const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the " +"descriptor can be written to, and so forth. An empty list indicates that the" +" call timed out and no file descriptors had any events to report. If " +"*timeout* is given, it specifies the length of time in milliseconds which " +"the system will wait for events before returning. If *timeout* is omitted, " +"-1, or :const:`None`, the call will block until there is an event for this " +"poll object." +msgstr "" +"مجموعه‌ای از توصیف‌گرهای فایل ثبت‌شده را پایش می‌کند و فهرستی را برمی‌گرداند" +" که ممکن است خالی باشد و شامل دوتایی‌های ``(fd, event)`` برای توصیف‌گرهایی " +"است که رویدادها یا خطاها برای گزارش دارند. *fd* توصیف‌گر فایل است و *event*" +" یک نقاب بیتی است که بیت‌های آن برای رویدادهای گزارش‌شده برای آن توصیف‌گر " +"تنظیم شده‌اند --- :const:`POLLIN` برای ورودی در انتظار، :const:`POLLOUT` " +"برای نشان دادن اینکه توصیف‌گر قابل نوشتن است، و غیره. فهرست خالی نشان می‌دهد " +"که زمان فراخوانی به پایان رسیده و هیچ توصیف‌گر فایلی رویدادی برای گزارش " +"نداشته است. اگر *timeout* داده شود، مدت زمانی را بر حسب میلی‌ثانیه مشخص " +"می‌کند که سیستم پیش از بازگشت برای رویدادها منتظر خواهد ماند. اگر *timeout*" +" حذف شود، -1 باشد یا :const:`None` باشد، فراخوانی تا زمانی که رویدادی برای " +"این شیء پایش وجود داشته باشد، مسدود خواهد شد." msgid "Edge and level trigger polling (epoll) objects" -msgstr "" +msgstr "اشیای پایش (polling) با محرک لبه و سطح (epoll)" msgid "https://linux.die.net/man/4/epoll" -msgstr "" +msgstr "https://linux.die.net/man/4/epoll" msgid "The *eventmask* is a bit mask using the following constants:" msgstr "" +"*eventmask* یک ماسک بیتی (bit mask) است که از ثابت‌های زیر استفاده می‌کند:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid ":const:`EPOLLIN`" -msgstr "" +msgstr ":const:`EPOLLIN`" msgid "Available for read." -msgstr "" +msgstr "برای خواندن در دسترس است." msgid ":const:`EPOLLOUT`" -msgstr "" +msgstr ":const:`EPOLLOUT`" msgid "Available for write." -msgstr "" +msgstr "برای نوشتن در دسترس است." msgid ":const:`EPOLLPRI`" -msgstr "" +msgstr ":const:`EPOLLPRI`" msgid "Urgent data for read." -msgstr "" +msgstr "داده فوری برای خواندن." msgid ":const:`EPOLLERR`" -msgstr "" +msgstr ":const:`EPOLLERR`" msgid "Error condition happened on the associated fd." -msgstr "" +msgstr "وضعیت خطا در fd مرتبط رخ داد." msgid ":const:`EPOLLHUP`" -msgstr "" +msgstr ":const:`EPOLLHUP`" msgid "Hang up happened on the associated fd." -msgstr "" +msgstr "قطع ارتباط (Hang up) برای fd مرتبط رخ داد." msgid ":const:`EPOLLET`" -msgstr "" +msgstr ":const:`EPOLLET`" msgid "Set Edge Trigger behavior, the default is Level Trigger behavior." msgstr "" +"رفتار تحریک لبه‌ای (Edge Trigger) را تنظیم می‌کند؛ پیش‌فرض، رفتار تحریک سطحی" +" (Level Trigger) است." msgid ":const:`EPOLLONESHOT`" -msgstr "" +msgstr ":const:`EPOLLONESHOT`" -msgid "Set one-shot behavior. After one event is pulled out, the fd is internally disabled." +msgid "" +"Set one-shot behavior. After one event is pulled out, the fd is internally " +"disabled." msgstr "" +"رفتار یک‌بار اجرا (one-shot) را تنظیم می‌کند. پس از دریافت یک رویداد، fd " +"به‌صورت داخلی غیرفعال می‌شود." msgid ":const:`EPOLLEXCLUSIVE`" -msgstr "" +msgstr ":const:`EPOLLEXCLUSIVE`" -msgid "Wake only one epoll object when the associated fd has an event. The default (if this flag is not set) is to wake all epoll objects polling on an fd." +msgid "" +"Wake only one epoll object when the associated fd has an event. The default " +"(if this flag is not set) is to wake all epoll objects polling on an fd." msgstr "" +"فقط یک شیء epoll را هنگامی که fd مرتبط رویدادی دارد، بیدار می‌کند. حالت " +"پیش‌فرض (اگر این پرچم تنظیم‌نشده باشد) این است که تمام اشیاء epoll که یک fd " +"را پایش می‌کنند، بیدار شوند." msgid ":const:`EPOLLRDHUP`" -msgstr "" +msgstr ":const:`EPOLLRDHUP`" -msgid "Stream socket peer closed connection or shut down writing half of connection." +msgid "" +"Stream socket peer closed connection or shut down writing half of " +"connection." msgstr "" +"همتا در سوکت جریانی (stream socket) اتصال را بست یا نیمه‌ی نوشتاری اتصال را " +"خاموش کرد." msgid ":const:`EPOLLRDNORM`" -msgstr "" +msgstr ":const:`EPOLLRDNORM`" msgid "Equivalent to :const:`EPOLLIN`" -msgstr "" +msgstr "معادل با :const:`EPOLLIN`" msgid ":const:`EPOLLRDBAND`" -msgstr "" +msgstr ":const:`EPOLLRDBAND`" msgid "Priority data band can be read." -msgstr "" +msgstr "باند داده اولویت قابل خواندن است." msgid ":const:`EPOLLWRNORM`" -msgstr "" +msgstr ":const:`EPOLLWRNORM`" msgid "Equivalent to :const:`EPOLLOUT`." -msgstr "" +msgstr "معادل :const:`EPOLLOUT`." msgid ":const:`EPOLLWRBAND`" -msgstr "" +msgstr ":const:`EPOLLWRBAND`" msgid "Priority data may be written." -msgstr "" +msgstr "ممکن است داده‌های اولویت‌دار نوشته شوند." msgid ":const:`EPOLLMSG`" -msgstr "" +msgstr ":const:`EPOLLMSG`" msgid "Ignored." -msgstr "" +msgstr "نادیده گرفته می‌شود." msgid ":const:`EPOLLWAKEUP`" -msgstr "" +msgstr ":const:`EPOLLWAKEUP`" msgid "Prevents sleep during event waiting." -msgstr "" +msgstr "از متوقف شدن در حین انتظار برای رویداد جلوگیری می‌کند." -msgid ":const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5 or later." +msgid "" +":const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5 " +"or later." msgstr "" +":const:`EPOLLEXCLUSIVE` افزوده شد. این ثابت فقط توسط هسته لینوکس 4.5 یا " +"نسخه‌های بعدی پشتیبانی می‌شود." -msgid ":const:`EPOLLWAKEUP` was added. It's only supported by Linux Kernel 3.5 or later." +msgid "" +":const:`EPOLLWAKEUP` was added. It's only supported by Linux Kernel 3.5 or " +"later." msgstr "" +":const:`EPOLLWAKEUP` اضافه شد. این مورد فقط در هسته لینوکس 3.5 یا نسخه‌های " +"بعدی پشتیبانی می‌شود." msgid "Close the control file descriptor of the epoll object." -msgstr "" +msgstr "توصیف‌گر فایل کنترلی شیء epoll را ببندید." msgid "``True`` if the epoll object is closed." -msgstr "" +msgstr "اگر شیء epoll بسته‌شده باشد، ``True`` است." msgid "Return the file descriptor number of the control fd." -msgstr "" +msgstr "شماره توصیف‌گر فایلِ fd کنترلی را برمی‌گرداند." msgid "Create an epoll object from a given file descriptor." -msgstr "" +msgstr "ایجاد یک شیء epoll از یک توصیف‌گر فایل داده‌شده." msgid "Register a file descriptor *fd* with the epoll object." -msgstr "" +msgstr "یک توصیف‌گر فایل *fd* را در شیء epoll ثبت کنید." msgid "Modify a registered file descriptor *fd*." -msgstr "" +msgstr "تغییر یک توصیف‌گر فایل ثبت‌شده *fd*." msgid "Remove a registered file descriptor from the epoll object." -msgstr "" +msgstr "یک توصیف‌گر فایل ثبت‌شده را از شیء epoll حذف کنید." msgid "The method no longer ignores the :data:`~errno.EBADF` error." -msgstr "" +msgstr "این متد دیگر خطای :data:`~errno.EBADF` را نادیده نمی‌گیرد." msgid "Wait for events. timeout in seconds (float)" -msgstr "" +msgstr "منتظر رویدادها بمانید. timeout به ثانیه (float)" msgid "Polling objects" -msgstr "" +msgstr "اشیای پایش (polling)" -msgid "The :c:func:`!poll` system call, supported on most Unix systems, provides better scalability for network servers that service many, many clients at the same time. :c:func:`!poll` scales better because the system call only requires listing the file descriptors of interest, while :c:func:`!select` builds a bitmap, turns on bits for the fds of interest, and then afterward the whole bitmap has to be linearly scanned again. :c:func:`!select` is *O*\\ (*highest file descriptor*), while :c:func:`!poll` is *O*\\ (*number of file descriptors*)." -msgstr "" +msgid "" +"The :c:func:`!poll` system call, supported on most Unix systems, provides " +"better scalability for network servers that service many, many clients at " +"the same time. :c:func:`!poll` scales better because the system call only " +"requires listing the file descriptors of interest, while :c:func:`!select` " +"builds a bitmap, turns on bits for the fds of interest, and then afterward " +"the whole bitmap has to be linearly scanned again. :c:func:`!select` is " +"*O*\\ (*highest file descriptor*), while :c:func:`!poll` is *O*\\ (*number " +"of file descriptors*)." +msgstr "" +"فراخوانی سیستمی :c:func:`!poll`، که در اکثر سیستم‌های یونیکس پشتیبانی " +"می‌شود، مقیاس‌پذیری بهتری را برای سرورهای شبکه‌ای فراهم می‌کند که به تعداد " +"بسیار زیادی کلاینت به‌طور همزمان خدمات می‌دهند. :c:func:`!poll` " +"مقیاس‌پذیرتر است، زیرا این فراخوانی سیستمی فقط به فهرست کردن توصیف‌گرهای " +"فایل مورد نظر نیاز دارد، در حالی که :c:func:`!select` یک بیت‌مپ می‌سازد، " +"بیت‌های مربوط به توصیف‌گرهای فایل مورد نظر را روشن می‌کند، و سپس بعد از آن، " +"کل بیت‌مپ باید دوباره به‌صورت خطی پیمایش شود. :c:func:`!select` *O*\\ " +"(*بالاترین توصیف‌گر فایل*) است، در حالی که :c:func:`!poll` *O*\\ (*تعداد " +"توصیف‌گرهای فایل*) است." -msgid "*eventmask* is an optional bitmask describing the type of events you want to check for, and can be a combination of the constants :const:`POLLIN`, :const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not specified, the default value used will check for all 3 types of events." +msgid "" +"*eventmask* is an optional bitmask describing the type of events you want to" +" check for, and can be a combination of the constants :const:`POLLIN`, " +":const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If " +"not specified, the default value used will check for all 3 types of events." msgstr "" +"*eventmask* یک نقاب بیتی اختیاری است که نوع رویدادهایی را که می‌خواهید بررسی " +"کنید توصیف می‌کند، و می‌تواند ترکیبی از ثابت‌های :const:`POLLIN`، " +":const:`POLLPRI` و :const:`POLLOUT` باشد که در جدول زیر توضیح داده شده‌اند. " +"اگر مشخص نشود، مقدار پیش‌فرض استفاده‌شده هر ۳ نوع رویداد را بررسی می‌کند." msgid ":const:`POLLIN`" -msgstr "" +msgstr ":const:`POLLIN`" msgid "There is data to read." -msgstr "" +msgstr "داده‌ای برای خواندن وجود دارد." msgid ":const:`POLLPRI`" -msgstr "" +msgstr ":const:`POLLPRI`" msgid "There is urgent data to read." -msgstr "" +msgstr "داده‌ای فوری برای خواندن وجود دارد." msgid ":const:`POLLOUT`" -msgstr "" +msgstr ":const:`POLLOUT`" msgid "Ready for output: writing will not block." -msgstr "" +msgstr "آماده برای خروجی: نوشتن مسدود نخواهد شد." msgid ":const:`POLLERR`" -msgstr "" +msgstr ":const:`POLLERR`" msgid "Error condition of some sort." -msgstr "" +msgstr "نوعی وضعیت خطا." msgid ":const:`POLLHUP`" -msgstr "" +msgstr ":const:`POLLHUP`" msgid "Hung up." -msgstr "" +msgstr "قطع شد." msgid ":const:`POLLRDHUP`" -msgstr "" +msgstr ":const:`POLLRDHUP`" -msgid "Stream socket peer closed connection, or shut down writing half of connection." -msgstr "" +msgid "" +"Stream socket peer closed connection, or shut down writing half of " +"connection." +msgstr "همتای سوکت جریانی اتصال را بست، یا نیمه‌ی نوشتاری اتصال را خاموش کرد." msgid ":const:`POLLNVAL`" -msgstr "" +msgstr ":const:`POLLNVAL`" msgid "Invalid request: descriptor not open." -msgstr "" +msgstr "درخواست نامعتبر: توصیف‌گر باز نیست." -msgid "Registering a file descriptor that's already registered is not an error, and has the same effect as registering the descriptor exactly once." +msgid "" +"Registering a file descriptor that's already registered is not an error, and" +" has the same effect as registering the descriptor exactly once." msgstr "" +"ثبت یک توصیف‌گر فایل که پیش‌تر ثبت شده است، خطا نیست و همان اثری را دارد که " +"توصیف‌گر دقیقاً یک بار ثبت شده باشد." -msgid "Modifies an already registered fd. This has the same effect as ``register(fd, eventmask)``. Attempting to modify a file descriptor that was never registered causes an :exc:`OSError` exception with errno :const:`ENOENT` to be raised." +msgid "" +"Modifies an already registered fd. This has the same effect as " +"``register(fd, eventmask)``. Attempting to modify a file descriptor that " +"was never registered causes an :exc:`OSError` exception with errno " +":const:`ENOENT` to be raised." msgstr "" +"یک توصیف‌گر فایل (fd) از پیش ثبت‌شده را تغییر می‌دهد. این کار همان اثر " +"``register(fd, eventmask)`` را دارد. تلاش برای تغییر توصیف‌گر فایلی که هرگز " +"ثبت‌نشده است، باعث پرتاب یک استثنای :exc:`OSError` با errno برابر " +":const:`ENOENT` می‌شود." -msgid "Attempting to remove a file descriptor that was never registered causes a :exc:`KeyError` exception to be raised." +msgid "" +"Attempting to remove a file descriptor that was never registered causes a " +":exc:`KeyError` exception to be raised." msgstr "" +"تلاش برای حذف توصیف‌گر فایلی که هرگز ثبت نشده است، باعث پرتاب استثنای " +":exc:`KeyError` می‌شود." -msgid "Polls the set of registered file descriptors, and returns a possibly empty list containing ``(fd, event)`` 2-tuples for the descriptors that have events or errors to report. *fd* is the file descriptor, and *event* is a bitmask with bits set for the reported events for that descriptor --- :const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the descriptor can be written to, and so forth. An empty list indicates that the call timed out and no file descriptors had any events to report. If *timeout* is given, it specifies the length of time in milliseconds which the system will wait for events before returning. If *timeout* is omitted, negative, or :const:`None`, the call will block until there is an event for this poll object." -msgstr "" +msgid "" +"Polls the set of registered file descriptors, and returns a possibly empty " +"list containing ``(fd, event)`` 2-tuples for the descriptors that have " +"events or errors to report. *fd* is the file descriptor, and *event* is a " +"bitmask with bits set for the reported events for that descriptor --- " +":const:`POLLIN` for waiting input, :const:`POLLOUT` to indicate that the " +"descriptor can be written to, and so forth. An empty list indicates that the" +" call timed out and no file descriptors had any events to report. If " +"*timeout* is given, it specifies the length of time in milliseconds which " +"the system will wait for events before returning. If *timeout* is omitted, " +"negative, or :const:`None`, the call will block until there is an event for " +"this poll object." +msgstr "" +"از مجموعه توصیف‌گرهای فایل ثبت‌شده پایش می‌کند و فهرستی را برمی‌گرداند که" +" ممکن است خالی باشد و شامل ۲-تایی‌های ``(fd, event)`` برای توصیف‌گرهایی است " +"که رویدادها یا خطاهایی برای گزارش دارند. *fd* توصیف‌گر فایل است، و *event* " +"یک نقاب بیتی است که بیت‌هایی در آن برای رویدادهای گزارش‌شده برای آن توصیف‌گر " +"تنظیم شده‌اند --- :const:`POLLIN` برای ورودی در انتظار، :const:`POLLOUT` " +"برای نشان دادن اینکه توصیف‌گر قابل نوشتن است، و غیره. یک فهرست خالی نشان " +"می‌دهد که مهلت فراخوانی به پایان رسیده است و هیچ توصیف‌گر فایلی رویدادی برای" +" گزارش نداشته است. اگر *timeout* داده شده باشد، مدت زمانی را بر حسب " +"میلی‌ثانیه مشخص می‌کند که سیستم برای رویدادها پیش از بازگشت منتظر خواهد " +"ماند. اگر *timeout* داده نشده باشد، منفی باشد، یا :const:`None` باشد، " +"فراخوانی تا زمانی که رویدادی برای این شیء پایش وجود داشته باشد، مسدود " +"خواهد شد." msgid "Kqueue objects" -msgstr "" +msgstr "اشیای Kqueue" msgid "Close the control file descriptor of the kqueue object." -msgstr "" +msgstr "توصیف‌گر فایل کنترلی شیء kqueue را ببندید." msgid "``True`` if the kqueue object is closed." -msgstr "" +msgstr "اگر شیء kqueue بسته باشد، ``True`` است." msgid "Create a kqueue object from a given file descriptor." -msgstr "" +msgstr "یک شیء kqueue از یک توصیف‌گر پرونده‌ی داده‌شده ایجاد کنید." msgid "Low level interface to kevent" -msgstr "" +msgstr "رابط سطح پایین برای kevent" msgid "changelist must be an iterable of kevent objects or ``None``" -msgstr "" +msgstr "changelist باید یک پیمایش‌پذیر از شیءهای kevent باشد یا ``None``" msgid "max_events must be 0 or a positive integer" -msgstr "" +msgstr "max_events باید ۰ یا یک عدد صحیح مثبت باشد" -msgid "timeout in seconds (floats possible); the default is ``None``, to wait forever" +msgid "" +"timeout in seconds (floats possible); the default is ``None``, to wait " +"forever" msgstr "" +"مهلت زمانی (timeout) به ثانیه (امکان استفاده از مقادیر شناور وجود دارد)؛ " +"پیش‌فرض ``None`` است، تا برای همیشه منتظر بماند" msgid "Kevent objects" -msgstr "" +msgstr "اشیای Kevent" msgid "https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" -msgstr "" +msgstr "https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2" -msgid "Value used to identify the event. The interpretation depends on the filter but it's usually the file descriptor. In the constructor ident can either be an int or an object with a :meth:`~io.IOBase.fileno` method. kevent stores the integer internally." +msgid "" +"Value used to identify the event. The interpretation depends on the filter " +"but it's usually the file descriptor. In the constructor ident can either be" +" an int or an object with a :meth:`~io.IOBase.fileno` method. kevent stores " +"the integer internally." msgstr "" +"مقداری که برای شناسایی رویداد استفاده می‌شود. تفسیر آن به فیلتر بستگی دارد، " +"اما این مقدار معمولاً توصیف‌گر فایل است. در سازنده، ident می‌تواند یک int یا" +" یک شیء با متد :meth:`~io.IOBase.fileno` باشد. kevent عدد صحیح را به‌صورت " +"داخلی ذخیره می‌کند." msgid "Name of the kernel filter." -msgstr "" +msgstr "نام فیلتر هسته." msgid ":const:`KQ_FILTER_READ`" -msgstr "" +msgstr ":const:`KQ_FILTER_READ`" -msgid "Takes a descriptor and returns whenever there is data available to read." +msgid "" +"Takes a descriptor and returns whenever there is data available to read." msgstr "" +"یک توصیف‌گر (descriptor) می‌گیرد و هر زمان که داده‌ای برای خواندن موجود " +"باشد، بازمی‌گردد." msgid ":const:`KQ_FILTER_WRITE`" -msgstr "" +msgstr ":const:`KQ_FILTER_WRITE`" -msgid "Takes a descriptor and returns whenever there is data available to write." +msgid "" +"Takes a descriptor and returns whenever there is data available to write." msgstr "" +"یک توصیف‌گر (descriptor) می‌گیرد و هر زمان که داده‌ای برای نوشتن در دسترس " +"باشد، برمی‌گردد." msgid ":const:`KQ_FILTER_AIO`" -msgstr "" +msgstr ":const:`KQ_FILTER_AIO`" msgid "AIO requests." -msgstr "" +msgstr "درخواست‌های AIO." msgid ":const:`KQ_FILTER_VNODE`" -msgstr "" +msgstr ":const:`KQ_FILTER_VNODE`" -msgid "Returns when one or more of the requested events watched in *fflag* occurs." +msgid "" +"Returns when one or more of the requested events watched in *fflag* occurs." msgstr "" +"هنگامی که یک یا چند مورد از رویدادهای درخواستی پایش‌شده در *fflag* رخ دهد، " +"برمی‌گردد." msgid ":const:`KQ_FILTER_PROC`" -msgstr "" +msgstr ":const:`KQ_FILTER_PROC`" msgid "Watch for events on a process ID." -msgstr "" +msgstr "رویدادهای مربوط به یک شناسه فرایند را زیر نظر بگیرید." msgid ":const:`KQ_FILTER_NETDEV`" -msgstr "" +msgstr ":const:`KQ_FILTER_NETDEV`" msgid "Watch for events on a network device (not available on macOS)." -msgstr "" +msgstr "رویدادهای یک دستگاه شبکه را زیر نظر بگیرید (در macOS در دسترس نیست)." msgid ":const:`KQ_FILTER_SIGNAL`" -msgstr "" +msgstr ":const:`KQ_FILTER_SIGNAL`" msgid "Returns whenever the watched signal is delivered to the process." -msgstr "" +msgstr "هر زمان که سیگنال تحت نظر به فرایند تحویل داده شود، بازگشت می‌کند." msgid ":const:`KQ_FILTER_TIMER`" -msgstr "" +msgstr ":const:`KQ_FILTER_TIMER`" msgid "Establishes an arbitrary timer." -msgstr "" +msgstr "یک زمان‌سنج دلخواه برقرار می‌کند." msgid "Filter action." -msgstr "" +msgstr "عملیات فیلتر." msgid ":const:`KQ_EV_ADD`" -msgstr "" +msgstr ":const:`KQ_EV_ADD`" msgid "Adds or modifies an event." -msgstr "" +msgstr "یک رویداد را اضافه یا اصلاح می‌کند." msgid ":const:`KQ_EV_DELETE`" -msgstr "" +msgstr ":const:`KQ_EV_DELETE`" msgid "Removes an event from the queue." -msgstr "" +msgstr "یک رویداد را از صف حذف می‌کند." msgid ":const:`KQ_EV_ENABLE`" -msgstr "" +msgstr ":const:`KQ_EV_ENABLE`" msgid "Permits control() to return the event." -msgstr "" +msgstr "به control() اجازه می‌دهد رویداد را برگرداند." msgid ":const:`KQ_EV_DISABLE`" -msgstr "" +msgstr ":const:`KQ_EV_DISABLE`" msgid "Disables event." -msgstr "" +msgstr "رویداد را غیرفعال می‌کند." msgid ":const:`KQ_EV_ONESHOT`" -msgstr "" +msgstr ":const:`KQ_EV_ONESHOT`" msgid "Removes event after first occurrence." -msgstr "" +msgstr "رویداد را پس از اولین رخداد حذف می‌کند." msgid ":const:`KQ_EV_CLEAR`" -msgstr "" +msgstr ":const:`KQ_EV_CLEAR`" msgid "Reset the state after an event is retrieved." -msgstr "" +msgstr "پس از بازیابی یک رویداد، وضعیت را بازنشانی کنید." msgid ":const:`KQ_EV_SYSFLAGS`" -msgstr "" +msgstr ":const:`KQ_EV_SYSFLAGS`" msgid "Internal event." -msgstr "" +msgstr "رویداد داخلی." msgid ":const:`KQ_EV_FLAG1`" -msgstr "" +msgstr ":const:`KQ_EV_FLAG1`" msgid ":const:`KQ_EV_EOF`" -msgstr "" +msgstr ":const:`KQ_EV_EOF`" msgid "Filter-specific EOF condition." -msgstr "" +msgstr "شرط EOF مختص به فیلتر." msgid ":const:`KQ_EV_ERROR`" -msgstr "" +msgstr ":const:`KQ_EV_ERROR`" msgid "See return values." -msgstr "" +msgstr "مقادیر بازگشتی را ببینید." msgid "Filter-specific flags." -msgstr "" +msgstr "پرچم‌های مختص فیلتر." msgid ":const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags:" msgstr "" +"پرچم‌های فیلتر برای :const:`KQ_FILTER_READ` و :const:`KQ_FILTER_WRITE`:" msgid ":const:`KQ_NOTE_LOWAT`" -msgstr "" +msgstr ":const:`KQ_NOTE_LOWAT`" msgid "Low water mark of a socket buffer." -msgstr "" +msgstr "آستانه پایین بافر سوکت." msgid ":const:`KQ_FILTER_VNODE` filter flags:" -msgstr "" +msgstr ":const:`KQ_FILTER_VNODE` پرچم‌های فیلتر:" msgid ":const:`KQ_NOTE_DELETE`" -msgstr "" +msgstr ":const:`KQ_NOTE_DELETE`" msgid "*unlink()* was called." -msgstr "" +msgstr "*unlink()* فراخوانی شد." msgid ":const:`KQ_NOTE_WRITE`" -msgstr "" +msgstr ":const:`KQ_NOTE_WRITE`" msgid "A write occurred." -msgstr "" +msgstr "یک نوشتن رخ داد." msgid ":const:`KQ_NOTE_EXTEND`" -msgstr "" +msgstr ":const:`KQ_NOTE_EXTEND`" msgid "The file was extended." -msgstr "" +msgstr "فایل توسعه یافت." msgid ":const:`KQ_NOTE_ATTRIB`" -msgstr "" +msgstr ":const:`KQ_NOTE_ATTRIB`" msgid "An attribute was changed." -msgstr "" +msgstr "یک ویژگی تغییر کرد." msgid ":const:`KQ_NOTE_LINK`" -msgstr "" +msgstr ":const:`KQ_NOTE_LINK`" msgid "The link count has changed." -msgstr "" +msgstr "تعداد پیوندها تغییر کرده است." msgid ":const:`KQ_NOTE_RENAME`" -msgstr "" +msgstr ":const:`KQ_NOTE_RENAME`" msgid "The file was renamed." -msgstr "" +msgstr "فایل تغییر نام داده شد." msgid ":const:`KQ_NOTE_REVOKE`" -msgstr "" +msgstr ":const:`KQ_NOTE_REVOKE`" msgid "Access to the file was revoked." -msgstr "" +msgstr "دسترسی به فایل لغو شد." msgid ":const:`KQ_FILTER_PROC` filter flags:" -msgstr "" +msgstr ":const:`KQ_FILTER_PROC` پرچم‌های فیلتر:" msgid ":const:`KQ_NOTE_EXIT`" -msgstr "" +msgstr ":const:`KQ_NOTE_EXIT`" msgid "The process has exited." -msgstr "" +msgstr "فرایند خارج شده است." msgid ":const:`KQ_NOTE_FORK`" -msgstr "" +msgstr ":const:`KQ_NOTE_FORK`" msgid "The process has called *fork()*." -msgstr "" +msgstr "فرایند *fork()* را فراخوانی کرده است." msgid ":const:`KQ_NOTE_EXEC`" -msgstr "" +msgstr ":const:`KQ_NOTE_EXEC`" msgid "The process has executed a new process." -msgstr "" +msgstr "فرایند، یک فرایند جدید را اجرا کرده است." msgid ":const:`KQ_NOTE_PCTRLMASK`" -msgstr "" +msgstr ":const:`KQ_NOTE_PCTRLMASK`" msgid "Internal filter flag." -msgstr "" +msgstr "پرچم فیلتر داخلی." msgid ":const:`KQ_NOTE_PDATAMASK`" -msgstr "" +msgstr ":const:`KQ_NOTE_PDATAMASK`" msgid ":const:`KQ_NOTE_TRACK`" -msgstr "" +msgstr ":const:`KQ_NOTE_TRACK`" msgid "Follow a process across *fork()*." -msgstr "" +msgstr "یک فرایند را در طول *fork()* پیگیری کنید." msgid ":const:`KQ_NOTE_CHILD`" -msgstr "" +msgstr ":const:`KQ_NOTE_CHILD`" msgid "Returned on the child process for *NOTE_TRACK*." -msgstr "" +msgstr "برای *NOTE_TRACK* در فرایند فرزند بازگردانده می‌شود." msgid ":const:`KQ_NOTE_TRACKERR`" -msgstr "" +msgstr ":const:`KQ_NOTE_TRACKERR`" msgid "Unable to attach to a child." -msgstr "" +msgstr "امکان اتصال به یک فرزند وجود ندارد." msgid ":const:`KQ_FILTER_NETDEV` filter flags (not available on macOS):" -msgstr "" +msgstr "پرچم‌های فیلتر :const:`KQ_FILTER_NETDEV` (در macOS در دسترس نیست):" msgid ":const:`KQ_NOTE_LINKUP`" -msgstr "" +msgstr ":const:`KQ_NOTE_LINKUP`" msgid "Link is up." -msgstr "" +msgstr "پیوند برقرار است." msgid ":const:`KQ_NOTE_LINKDOWN`" -msgstr "" +msgstr ":const:`KQ_NOTE_LINKDOWN`" msgid "Link is down." -msgstr "" +msgstr "پیوند قطع است." msgid ":const:`KQ_NOTE_LINKINV`" -msgstr "" +msgstr ":const:`KQ_NOTE_LINKINV`" msgid "Link state is invalid." -msgstr "" +msgstr "وضعیت پیوند نامعتبر است." msgid "Filter-specific data." -msgstr "" +msgstr "داده‌های مخصوص فیلتر." msgid "User-defined value." -msgstr "" +msgstr "مقدار تعریف‌شده توسط کاربر." msgid "socket() (in module socket)" -msgstr "" +msgstr "socket() (در ماژول socket)" msgid "popen() (in module os)" -msgstr "" +msgstr "popen() (در ماژول os)" msgid "WinSock" -msgstr "" +msgstr "WinSock" diff --git a/library/selectors.po b/library/selectors.po index 9f631df2f..a20b39ab3 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -25,43 +25,79 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!selectors` --- High-level I/O multiplexing" -msgstr "" +msgstr ":mod:`!selectors` --- تسهیم سطح بالای I/O (multiplexing)" msgid "**Source code:** :source:`Lib/selectors.py`" -msgstr "" +msgstr ":source:`Lib/selectors.py`" msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "This module allows high-level and efficient I/O multiplexing, built upon the :mod:`select` module primitives. Users are encouraged to use this module instead, unless they want precise control over the OS-level primitives used." +msgid "" +"This module allows high-level and efficient I/O multiplexing, built upon the" +" :mod:`select` module primitives. Users are encouraged to use this module " +"instead, unless they want precise control over the OS-level primitives used." msgstr "" +"این ماژول امکان تسهیم ورودی/خروجی (I/O multiplexing) سطح بالا و کارآمد را " +"فراهم می‌کند و بر پایه‌ی سازوکارهای اولیه‌ی ماژول :mod:`select` ساخته شده " +"است. کاربران تشویق می‌شوند به جای آن از این ماژول استفاده کنند، مگر اینکه " +"بخواهند کنترل دقیقی بر سازوکارهای اولیه‌ی سطح سیستم‌عامل استفاده‌شده داشته " +"باشند." -msgid "It defines a :class:`BaseSelector` abstract base class, along with several concrete implementations (:class:`KqueueSelector`, :class:`EpollSelector`...), that can be used to wait for I/O readiness notification on multiple file objects. In the following, \"file object\" refers to any object with a :meth:`~io.IOBase.fileno` method, or a raw file descriptor. See :term:`file object`." -msgstr "" +msgid "" +"It defines a :class:`BaseSelector` abstract base class, along with several " +"concrete implementations (:class:`KqueueSelector`, " +":class:`EpollSelector`...), that can be used to wait for I/O readiness " +"notification on multiple file objects. In the following, \"file object\" " +"refers to any object with a :meth:`~io.IOBase.fileno` method, or a raw file " +"descriptor. See :term:`file object`." +msgstr "" +"یک کلاس پایه انتزاعی :class:`BaseSelector` به همراه چند پیاده‌سازی عینی " +"(:class:`KqueueSelector`، :class:`EpollSelector`...) تعریف می‌شود که می‌توان" +" از آن‌ها برای انتظار دریافت اعلان آمادگی I/O روی چندین شیء فایل استفاده " +"کرد. در ادامه، «file object» به هر شیء دارای متد :meth:`~io.IOBase.fileno`، " +"یا یک توصیف‌گر فایل خام اشاره دارد. به :term:`file object` مراجعه کنید." -msgid ":class:`DefaultSelector` is an alias to the most efficient implementation available on the current platform: this should be the default choice for most users." +msgid "" +":class:`DefaultSelector` is an alias to the most efficient implementation " +"available on the current platform: this should be the default choice for " +"most users." msgstr "" +":class:`DefaultSelector` نام مستعاری برای کارآمدترین پیاده‌سازی در دسترس بر " +"روی سکوی فعلی است: این گزینه باید انتخاب پیش‌فرض بیشتر کاربران باشد." -msgid "The type of file objects supported depends on the platform: on Windows, sockets are supported, but not pipes, whereas on Unix, both are supported (some other types may be supported as well, such as fifos or special file devices)." +msgid "" +"The type of file objects supported depends on the platform: on Windows, " +"sockets are supported, but not pipes, whereas on Unix, both are supported " +"(some other types may be supported as well, such as fifos or special file " +"devices)." msgstr "" +"نوع اشیای فایل پشتیبانی‌شده به سکو بستگی دارد: در ویندوز، سوکت‌ها پشتیبانی " +"می‌شوند، اما پایپ‌ها پشتیبانی نمی‌شوند، در حالی که در یونیکس، هر دو پشتیبانی" +" می‌شوند (ممکن است انواع دیگری نیز پشتیبانی شوند، مانند fifos یا دستگاه‌های " +"فایل ویژه)." msgid ":mod:`select`" -msgstr "" +msgstr ":mod:`select`" msgid "Low-level I/O multiplexing module." -msgstr "" +msgstr "ماژول مالتی‌پلکسینگ (multiplexing) ورودی/خروجی سطح پایین." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." msgid "Classes" -msgstr "" +msgstr "کلاس‌ها" msgid "Classes hierarchy::" -msgstr "" +msgstr "سلسله‌مراتب کلاس‌ها::" msgid "" "BaseSelector\n" @@ -71,135 +107,280 @@ msgid "" "+-- DevpollSelector\n" "+-- KqueueSelector" msgstr "" +"BaseSelector\n" +"+-- SelectSelector\n" +"+-- PollSelector\n" +"+-- EpollSelector\n" +"+-- DevpollSelector\n" +"+-- KqueueSelector" -msgid "In the following, *events* is a bitwise mask indicating which I/O events should be waited for on a given file object. It can be a combination of the module's constants below:" +msgid "" +"In the following, *events* is a bitwise mask indicating which I/O events " +"should be waited for on a given file object. It can be a combination of the " +"module's constants below:" msgstr "" +"در ادامه، *events* یک ماسک بیتی (bitwise mask) است که نشان می‌دهد برای کدام " +"رویدادهای ورودی/خروجی باید روی یک شیء فایل داده‌شده منتظر ماند. این می‌تواند" +" ترکیبی از ثابت‌های ماژول در زیر باشد:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Available for read" -msgstr "" +msgstr "در دسترس برای خواندن" msgid "Available for write" -msgstr "" +msgstr "در دسترس برای نوشتن" -msgid "A :class:`SelectorKey` is a :class:`~collections.namedtuple` used to associate a file object to its underlying file descriptor, selected event mask and attached data. It is returned by several :class:`BaseSelector` methods." +msgid "" +"A :class:`SelectorKey` is a :class:`~collections.namedtuple` used to " +"associate a file object to its underlying file descriptor, selected event " +"mask and attached data. It is returned by several :class:`BaseSelector` " +"methods." msgstr "" +":class:`SelectorKey` یک :class:`~collections.namedtuple` است که برای مرتبط " +"کردن یک شیء فایل با توصیف‌گر فایل زیربنایی، ماسک رویداد انتخاب‌شده و داده‌ی " +"پیوست‌شده‌ی آن استفاده می‌شود. این شیء توسط چندین متد :class:`BaseSelector` " +"برگردانده می‌شود." msgid "File object registered." -msgstr "" +msgstr "شیء فایل ثبت شد." msgid "Underlying file descriptor." -msgstr "" +msgstr "توصیف‌گر فایل زیربنایی." msgid "Events that must be waited for on this file object." -msgstr "" +msgstr "رویدادهایی که باید روی این شیء فایل منتظر آن‌ها ماند." -msgid "Optional opaque data associated to this file object: for example, this could be used to store a per-client session ID." +msgid "" +"Optional opaque data associated to this file object: for example, this could" +" be used to store a per-client session ID." msgstr "" +"داده‌های غیرشفاف اختیاری مرتبط با این شیء فایل: برای مثال، می‌توان از این " +"داده‌ها برای ذخیره‌ی شناسه‌ی نشست به ازای هر کلاینت استفاده کرد." -msgid "A :class:`BaseSelector` is used to wait for I/O event readiness on multiple file objects. It supports file stream registration, unregistration, and a method to wait for I/O events on those streams, with an optional timeout. It's an abstract base class, so cannot be instantiated. Use :class:`DefaultSelector` instead, or one of :class:`SelectSelector`, :class:`KqueueSelector` etc. if you want to specifically use an implementation, and your platform supports it. :class:`BaseSelector` and its concrete implementations support the :term:`context manager` protocol." -msgstr "" +msgid "" +"A :class:`BaseSelector` is used to wait for I/O event readiness on multiple " +"file objects. It supports file stream registration, unregistration, and a " +"method to wait for I/O events on those streams, with an optional timeout. " +"It's an abstract base class, so cannot be instantiated. Use " +":class:`DefaultSelector` instead, or one of :class:`SelectSelector`, " +":class:`KqueueSelector` etc. if you want to specifically use an " +"implementation, and your platform supports it. :class:`BaseSelector` and its" +" concrete implementations support the :term:`context manager` protocol." +msgstr "" +":class:`BaseSelector` برای انتظار برای آمادگی رویدادهای I/O روی چندین شیء " +"فایل استفاده می‌شود. این کلاس از ثبت جریان‌های فایل، لغو ثبت آن‌ها و متدی " +"برای انتظار برای رویدادهای I/O روی آن جریان‌ها، با مهلت زمانی اختیاری، " +"پشتیبانی می‌کند. این کلاس یک کلاس پایه انتزاعی است، بنابراین نمی‌توان آن را " +"نمونه‌سازی کرد. به‌جای آن از :class:`DefaultSelector` استفاده کنید، یا اگر " +"می‌خواهید به‌طور خاص از یک پیاده‌سازی مشخص استفاده کنید و سکوی شما از آن " +"پشتیبانی می‌کند، از یکی از :class:`SelectSelector`، :class:`KqueueSelector` " +"و غیره استفاده کنید. :class:`BaseSelector` و پیاده‌سازی‌های عینی آن از " +"پروتکل :term:`context manager` پشتیبانی می‌کنند." msgid "Register a file object for selection, monitoring it for I/O events." msgstr "" +"یک شیء فایل را برای انتخاب ثبت کنید و آن را برای رویدادهای ورودی/خروجی پایش " +"کنید." -msgid "*fileobj* is the file object to monitor. It may either be an integer file descriptor or an object with a ``fileno()`` method. *events* is a bitwise mask of events to monitor. *data* is an opaque object." +msgid "" +"*fileobj* is the file object to monitor. It may either be an integer file " +"descriptor or an object with a ``fileno()`` method. *events* is a bitwise " +"mask of events to monitor. *data* is an opaque object." msgstr "" +"*fileobj* شیء فایلی است که باید پایش شود. این می‌تواند یک توصیف‌گر فایل " +"(file descriptor) از نوع عدد صحیح یا یک شیء دارای متد ``fileno()`` باشد. " +"*events* یک ماسک بیت‌به‌بیت (bitwise mask) از رویدادهای مورد پایش است. " +"*data* یک شیء غیرشفاف (opaque object) است." -msgid "This returns a new :class:`SelectorKey` instance, or raises a :exc:`ValueError` in case of invalid event mask or file descriptor, or :exc:`KeyError` if the file object is already registered." +msgid "" +"This returns a new :class:`SelectorKey` instance, or raises a " +":exc:`ValueError` in case of invalid event mask or file descriptor, or " +":exc:`KeyError` if the file object is already registered." msgstr "" +"این یک نمونه جدید از :class:`SelectorKey` برمی‌گرداند، یا در صورت نامعتبر " +"بودن ماسک رویداد یا توصیف‌گر فایل، یک :exc:`ValueError` پرتاب می‌کند، یا اگر" +" شیء فایل از قبل ثبت‌شده باشد، یک :exc:`KeyError` پرتاب می‌کند." -msgid "Unregister a file object from selection, removing it from monitoring. A file object shall be unregistered prior to being closed." +msgid "" +"Unregister a file object from selection, removing it from monitoring. A file" +" object shall be unregistered prior to being closed." msgstr "" +"ثبت یک شیء فایل را برای انتخاب لغو می‌کند و آن را از پایش خارج می‌کند. یک " +"شیء فایل باید پیش از بسته‌شدن، لغو ثبت شود." msgid "*fileobj* must be a file object previously registered." -msgstr "" +msgstr "*fileobj* باید یک شیء فایل باشد که پیش‌تر ثبت شده است." -msgid "This returns the associated :class:`SelectorKey` instance, or raises a :exc:`KeyError` if *fileobj* is not registered. It will raise :exc:`ValueError` if *fileobj* is invalid (e.g. it has no ``fileno()`` method or its ``fileno()`` method has an invalid return value)." +msgid "" +"This returns the associated :class:`SelectorKey` instance, or raises a " +":exc:`KeyError` if *fileobj* is not registered. It will raise " +":exc:`ValueError` if *fileobj* is invalid (e.g. it has no ``fileno()`` " +"method or its ``fileno()`` method has an invalid return value)." msgstr "" +"این، نمونه‌ی مرتبط :class:`SelectorKey` را برمی‌گرداند، یا اگر *fileobj* " +"ثبت‌نشده باشد، یک :exc:`KeyError` پرتاب می‌کند. این در صورتی که *fileobj* " +"نامعتبر باشد، یک :exc:`ValueError` پرتاب خواهد کرد (برای مثال، اگر متد " +"``fileno()`` نداشته باشد یا متد ``fileno()`` آن مقدار بازگشتی نامعتبری داشته" +" باشد)." msgid "Change a registered file object's monitored events or attached data." -msgstr "" +msgstr "تغییر رویدادهای پایش‌شده یا داده‌ی پیوست‌شده‌ی یک شیء فایل ثبت‌شده." -msgid "This is equivalent to ``BaseSelector.unregister(fileobj)`` followed by ``BaseSelector.register(fileobj, events, data)``, except that it can be implemented more efficiently." +msgid "" +"This is equivalent to ``BaseSelector.unregister(fileobj)`` followed by " +"``BaseSelector.register(fileobj, events, data)``, except that it can be " +"implemented more efficiently." msgstr "" +"این معادل ``BaseSelector.unregister(fileobj)`` و سپس " +"``BaseSelector.register(fileobj, events, data)`` است، با این تفاوت که " +"می‌تواند به‌صورت کارآمدتری پیاده‌سازی شود." -msgid "This returns a new :class:`SelectorKey` instance, or raises a :exc:`ValueError` in case of invalid event mask or file descriptor, or :exc:`KeyError` if the file object is not registered." +msgid "" +"This returns a new :class:`SelectorKey` instance, or raises a " +":exc:`ValueError` in case of invalid event mask or file descriptor, or " +":exc:`KeyError` if the file object is not registered." msgstr "" +"این یک نمونه جدید از :class:`SelectorKey` را برمی‌گرداند، یا در صورت نامعتبر" +" بودن ماسک رویداد یا توصیف‌گر فایل، :exc:`ValueError` پرتاب می‌کند، یا اگر " +"شیء فایل ثبت‌نشده باشد، :exc:`KeyError` پرتاب می‌کند." -msgid "Wait until some registered file objects become ready, or the timeout expires." +msgid "" +"Wait until some registered file objects become ready, or the timeout " +"expires." msgstr "" +"منتظر بمانید تا برخی از شیءهای فایل ثبت‌شده آماده شوند، یا مهلت به پایان " +"برسد." -msgid "If ``timeout > 0``, this specifies the maximum wait time, in seconds. If ``timeout <= 0``, the call won't block, and will report the currently ready file objects. If *timeout* is ``None``, the call will block until a monitored file object becomes ready." +msgid "" +"If ``timeout > 0``, this specifies the maximum wait time, in seconds. If " +"``timeout <= 0``, the call won't block, and will report the currently ready " +"file objects. If *timeout* is ``None``, the call will block until a " +"monitored file object becomes ready." msgstr "" +"اگر ``timeout > 0`` باشد، این حداکثر مهلت زمانی را بر حسب ثانیه مشخص " +"می‌کند. اگر ``timeout <= 0`` باشد، فراخوانی مسدود نمی‌شود و اشیای فایلی را " +"که در حال حاضر آماده‌اند گزارش می‌کند. اگر *timeout* برابر ``None`` باشد، " +"فراخوانی تا زمانی که یک شیء فایل پایش‌شده آماده شود مسدود می‌شود." -msgid "This returns a list of ``(key, events)`` tuples, one for each ready file object." +msgid "" +"This returns a list of ``(key, events)`` tuples, one for each ready file " +"object." msgstr "" +"این، فهرستی از تاپل‌های ``(key, events)`` را برمی‌گرداند، یکی برای هر شیء " +"فایل آماده." -msgid "*key* is the :class:`SelectorKey` instance corresponding to a ready file object. *events* is a bitmask of events ready on this file object." +msgid "" +"*key* is the :class:`SelectorKey` instance corresponding to a ready file " +"object. *events* is a bitmask of events ready on this file object." msgstr "" +"*key* نمونه‌ی :class:`SelectorKey` متناظر با یک شیء فایل آماده است. *events*" +" یک نقاب بیتی (bitmask) از رویدادهای آماده برای این شیء فایل است." -msgid "This method can return before any file object becomes ready or the timeout has elapsed if the current process receives a signal: in this case, an empty list will be returned." +msgid "" +"This method can return before any file object becomes ready or the timeout " +"has elapsed if the current process receives a signal: in this case, an empty" +" list will be returned." msgstr "" +"اگر فرایند جاری سیگنالی دریافت کند، این متد می‌تواند پیش از آنکه هر شیء " +"فایلی آماده شود یا مهلت سپری شود، بازگشت کند: در این حالت، یک فهرست خالی " +"بازگردانده خواهد شد." -msgid "The selector is now retried with a recomputed timeout when interrupted by a signal if the signal handler did not raise an exception (see :pep:`475` for the rationale), instead of returning an empty list of events before the timeout." +msgid "" +"The selector is now retried with a recomputed timeout when interrupted by a " +"signal if the signal handler did not raise an exception (see :pep:`475` for " +"the rationale), instead of returning an empty list of events before the " +"timeout." msgstr "" +"اکنون انتخابگر (selector) به جای برگرداندن یک فهرست خالی از رویدادها پیش از" +" پایان مهلت، هنگامی که با یک سیگنال قطع شود و هندلر سیگنال استثنایی " +"پرتاب نکرده باشد، با یک مهلت بازمحاسبه‌شده دوباره تلاش می‌شود (برای چرایی " +"این موضوع :pep:`475` را ببینید)." msgid "Close the selector." -msgstr "" +msgstr "انتخابگر (selector) را ببندید." -msgid "This must be called to make sure that any underlying resource is freed. The selector shall not be used once it has been closed." +msgid "" +"This must be called to make sure that any underlying resource is freed. The " +"selector shall not be used once it has been closed." msgstr "" +"این باید فراخوانی شود تا اطمینان حاصل شود که هر منبع زیربنایی آزاد می‌شود. " +"پس از بسته شدن انتخابگر، نباید از آن استفاده شود." msgid "Return the key associated with a registered file object." -msgstr "" +msgstr "کلید مرتبط با یک شیء فایل ثبت‌شده را برمی‌گرداند." -msgid "This returns the :class:`SelectorKey` instance associated to this file object, or raises :exc:`KeyError` if the file object is not registered." +msgid "" +"This returns the :class:`SelectorKey` instance associated to this file " +"object, or raises :exc:`KeyError` if the file object is not registered." msgstr "" +"این نمونه‌ی :class:`SelectorKey` مرتبط با این شیء فایل را برمی‌گرداند، یا در " +"صورتی که شیء فایل ثبت‌شده نباشد، :exc:`KeyError` را پرتاب می‌کند." msgid "Return a mapping of file objects to selector keys." -msgstr "" +msgstr "یک نگاشت از اشیاء فایل به کلیدهای انتخابگر را برمی‌گرداند." -msgid "This returns a :class:`~collections.abc.Mapping` instance mapping registered file objects to their associated :class:`SelectorKey` instance." +msgid "" +"This returns a :class:`~collections.abc.Mapping` instance mapping registered" +" file objects to their associated :class:`SelectorKey` instance." msgstr "" +"این یک نمونه‌ی :class:`~collections.abc.Mapping` را برمی‌گرداند که اشیای " +"فایل ثبت‌شده را به نمونه‌های :class:`SelectorKey` مرتبط با آن‌ها نگاشت " +"می‌کند." -msgid "The default selector class, using the most efficient implementation available on the current platform. This should be the default choice for most users." +msgid "" +"The default selector class, using the most efficient implementation " +"available on the current platform. This should be the default choice for " +"most users." msgstr "" +"کلاس انتخاب‌گر پیش‌فرض، که از کارآمدترین پیاده‌سازی موجود در پلتفرم فعلی " +"استفاده می‌کند. این گزینه باید انتخاب پیش‌فرض برای بیشتر کاربران باشد." msgid ":func:`select.select`-based selector." -msgstr "" +msgstr "انتخابگر مبتنی بر :func:`select.select`." msgid ":func:`select.poll`-based selector." -msgstr "" +msgstr "انتخابگر مبتنی بر :func:`select.poll`." msgid ":func:`select.epoll`-based selector." -msgstr "" +msgstr "انتخاب‌گر مبتنی بر :func:`select.epoll`." -msgid "This returns the file descriptor used by the underlying :func:`select.epoll` object." +msgid "" +"This returns the file descriptor used by the underlying :func:`select.epoll`" +" object." msgstr "" +"این، توصیف‌گر فایلی را که توسط شیء :func:`select.epoll` زیربنایی استفاده " +"می‌شود، بازمی‌گرداند." msgid ":func:`select.devpoll`-based selector." -msgstr "" +msgstr "انتخابگر مبتنی بر :func:`select.devpoll`." -msgid "This returns the file descriptor used by the underlying :func:`select.devpoll` object." +msgid "" +"This returns the file descriptor used by the underlying " +":func:`select.devpoll` object." msgstr "" +"این توصیف‌گر فایلی را برمی‌گرداند که شیء زیربنایی :func:`select.devpoll` از " +"آن استفاده می‌کند." msgid ":func:`select.kqueue`-based selector." -msgstr "" +msgstr "انتخابگر مبتنی بر :func:`select.kqueue`." -msgid "This returns the file descriptor used by the underlying :func:`select.kqueue` object." +msgid "" +"This returns the file descriptor used by the underlying " +":func:`select.kqueue` object." msgstr "" +"این، توصیف‌گر فایلی را برمی‌گرداند که توسط شیء زیربنایی " +":func:`select.kqueue` استفاده می‌شود." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Here is a simple echo server implementation::" -msgstr "" +msgstr "در اینجا پیاده‌سازی ساده‌ای از سرور پژواک (echo server) آمده است::" msgid "" "import selectors\n" @@ -235,3 +416,35 @@ msgid "" " callback = key.data\n" " callback(key.fileobj, mask)" msgstr "" +"import selectors\n" +"import socket\n" +"\n" +"sel = selectors.DefaultSelector()\n" +"\n" +"def accept(sock, mask):\n" +" conn, addr = sock.accept() # Should be ready\n" +" print('accepted', conn, 'from', addr)\n" +" conn.setblocking(False)\n" +" sel.register(conn, selectors.EVENT_READ, read)\n" +"\n" +"def read(conn, mask):\n" +" data = conn.recv(1000) # Should be ready\n" +" if data:\n" +" print('echoing', repr(data), 'to', conn)\n" +" conn.send(data) # Hope it won't block\n" +" else:\n" +" print('closing', conn)\n" +" sel.unregister(conn)\n" +" conn.close()\n" +"\n" +"sock = socket.socket()\n" +"sock.bind(('localhost', 1234))\n" +"sock.listen(100)\n" +"sock.setblocking(False)\n" +"sel.register(sock, selectors.EVENT_READ, accept)\n" +"\n" +"while True:\n" +" events = sel.select()\n" +" for key, mask in events:\n" +" callback = key.data\n" +" callback(key.fileobj, mask)" diff --git a/library/shelve.po b/library/shelve.po index 2a5cee937..633444617 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -25,99 +25,293 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!shelve` --- Python object persistence" -msgstr "" +msgstr ":mod:`!shelve` --- ماندگاری اشیاء در پایتون" msgid "**Source code:** :source:`Lib/shelve.py`" -msgstr "" +msgstr ":source:`Lib/shelve.py`" -msgid "A \"shelf\" is a persistent, dictionary-like object. The difference with \"dbm\" databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects --- anything that the :mod:`pickle` module can handle. This includes most class instances, recursive data types, and objects containing lots of shared sub-objects. The keys are ordinary strings." -msgstr "" +msgid "" +"A \"shelf\" is a persistent, dictionary-like object. The difference with " +"\"dbm\" databases is that the values (not the keys!) in a shelf can be " +"essentially arbitrary Python objects --- anything that the :mod:`pickle` " +"module can handle. This includes most class instances, recursive data types," +" and objects containing lots of shared sub-objects. The keys are ordinary " +"strings." +msgstr "" +"یک «قفسه» (shelf) شیء پایا و دیکشنری‌مانند است. تفاوت آن با پایگاه‌های " +"داده «dbm» در این است که مقادیر (نه کلیدها!) در یک قفسه می‌توانند اساساً " +"اشیاء پایتونی دلخواهی باشند — هر چیزی که ماژول :mod:`pickle` بتواند آن را " +"مدیریت کند. این شامل بیشتر نمونه‌های کلاس، انواع داده بازگشتی و اشیایی " +"می‌شود که حاوی تعداد زیادی زیرشیء مشترک هستند. کلیدها رشته‌های معمولی هستند." -msgid "Open a persistent dictionary. The filename specified is the base filename for the underlying database. As a side-effect, an extension may be added to the filename and more than one file may be created. By default, the underlying database file is opened for reading and writing. The optional *flag* parameter has the same interpretation as the *flag* parameter of :func:`dbm.open`." -msgstr "" +msgid "" +"Open a persistent dictionary. The filename specified is the base filename " +"for the underlying database. As a side-effect, an extension may be added to" +" the filename and more than one file may be created. By default, the " +"underlying database file is opened for reading and writing. The optional " +"*flag* parameter has the same interpretation as the *flag* parameter of " +":func:`dbm.open`." +msgstr "" +"یک دیکشنری پایا را باز می‌کند. نام فایل مشخص‌شده، نام فایل پایه برای " +"پایگاه داده‌ی زیربنایی است. به‌عنوان اثر جانبی، ممکن است پسوندی به نام فایل " +"اضافه شود و بیش از یک فایل ایجاد شود. به‌طور پیش‌فرض، فایل پایگاه داده‌ی " +"زیربنایی برای خواندن و نوشتن باز می‌شود. پارامتر اختیاری *flag* همان تفسیر " +"پارامتر *flag* در :func:`dbm.open` را دارد." -msgid "By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used to serialize values. The version of the pickle protocol can be specified with the *protocol* parameter." +msgid "" +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter." msgstr "" +"به‌طور پیش‌فرض، پیکل‌های ایجادشده با :const:`pickle.DEFAULT_PROTOCOL` برای " +"سریال‌سازی مقادیر استفاده می‌شوند. نسخه‌ی پروتکل پیکل را می‌توان با پارامتر " +"*protocol* مشخص کرد." -msgid "Because of Python semantics, a shelf cannot know when a mutable persistent-dictionary entry is modified. By default modified objects are written *only* when assigned to the shelf (see :ref:`shelve-example`). If the optional *writeback* parameter is set to ``True``, all entries accessed are also cached in memory, and written back on :meth:`~Shelf.sync` and :meth:`~Shelf.close`; this can make it handier to mutate mutable entries in the persistent dictionary, but, if many entries are accessed, it can consume vast amounts of memory for the cache, and it can make the close operation very slow since all accessed entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated)." -msgstr "" +msgid "" +"Because of Python semantics, a shelf cannot know when a mutable persistent-" +"dictionary entry is modified. By default modified objects are written " +"*only* when assigned to the shelf (see :ref:`shelve-example`). If the " +"optional *writeback* parameter is set to ``True``, all entries accessed are " +"also cached in memory, and written back on :meth:`~Shelf.sync` and " +":meth:`~Shelf.close`; this can make it handier to mutate mutable entries in " +"the persistent dictionary, but, if many entries are accessed, it can consume" +" vast amounts of memory for the cache, and it can make the close operation " +"very slow since all accessed entries are written back (there is no way to " +"determine which accessed entries are mutable, nor which ones were actually " +"mutated)." +msgstr "" +"به دلیل معناشناسی پایتون، یک shelf نمی‌تواند بداند چه زمانی یک آیتم " +"تغییرپذیر در دیکشنری پایا تغییر می‌کند. به‌طور پیش‌فرض، اشیای " +"تغییرکرده *فقط* زمانی نوشته می‌شوند که به shelf انتساب داده شوند (به " +":ref:`shelve-example` مراجعه کنید). اگر پارامتر اختیاری *writeback* روی " +"``True`` تنظیم شود، همه آیتم‌های دسترسی‌یافته نیز در نهانگاه حافظه ذخیره " +"می‌شوند و در :meth:`~Shelf.sync` و :meth:`~Shelf.close` بازنویسی می‌شوند؛ " +"این موضوع می‌تواند تغییر دادن آیتم‌های تغییرپذیر در دیکشنری پایا را " +"آسان‌تر کند، اما اگر به آیتم‌های زیادی دسترسی پیدا شود، می‌تواند حجم بسیار " +"زیادی از حافظه را برای نهانگاه مصرف کند و عملیات close را بسیار کند سازد، " +"زیرا همه آیتم‌های دسترسی‌یافته بازنویسی می‌شوند (هیچ راهی برای تشخیص اینکه " +"کدام آیتم‌های دسترسی‌یافته تغییرپذیرند، و نه اینکه کدام‌یک واقعاً تغییر " +"کرده‌اند، وجود ندارد)." -msgid ":const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." +msgid "" +":const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." msgstr "" +":const:`pickle.DEFAULT_PROTOCOL` اکنون به‌عنوان پروتکل پیش‌فرض pickle " +"استفاده می‌شود." msgid "Accepts :term:`path-like object` for filename." -msgstr "" +msgstr ":term:`path-like object` را برای نام فایل می‌پذیرد." -msgid "Do not rely on the shelf being closed automatically; always call :meth:`~Shelf.close` explicitly when you don't need it any more, or use :func:`shelve.open` as a context manager::" +msgid "" +"Do not rely on the shelf being closed automatically; always call " +":meth:`~Shelf.close` explicitly when you don't need it any more, or use " +":func:`shelve.open` as a context manager::" msgstr "" +"به بسته شدن خودکار قفسه (shelf) اتکا نکنید؛ همیشه وقتی دیگر به آن نیاز " +"ندارید، :meth:`~Shelf.close` را به‌صراحت فراخوانی کنید، یا از " +":func:`shelve.open` به‌عنوان مدیر زمینه استفاده کنید::" msgid "" "with shelve.open('spam') as db:\n" " db['eggs'] = 'eggs'" msgstr "" +"with shelve.open('spam') as db:\n" +" db['eggs'] = 'eggs'" -msgid "Because the :mod:`!shelve` module is backed by :mod:`pickle`, it is insecure to load a shelf from an untrusted source. Like with pickle, loading a shelf can execute arbitrary code." +msgid "" +"Because the :mod:`!shelve` module is backed by :mod:`pickle`, it is insecure" +" to load a shelf from an untrusted source. Like with pickle, loading a " +"shelf can execute arbitrary code." msgstr "" +"از آن‌جا که ماژول :mod:`!shelve` بر پایه :mod:`pickle` است، بارگذاری یک قفسه " +"(shelf) از یک منبع غیرقابل‌اعتماد امن نیست. مانند pickle، بارگذاری یک قفسه " +"(shelf) می‌تواند کد دلخواه را اجرا کند." -msgid "Shelf objects support most of the methods and operations supported by dictionaries (except copying, constructors and operators ``|`` and ``|=``). This eases the transition from dictionary based scripts to those requiring persistent storage." +msgid "" +"Shelf objects support most of the methods and operations supported by " +"dictionaries (except copying, constructors and operators ``|`` and ``|=``)." +" This eases the transition from dictionary based scripts to those requiring" +" persistent storage." msgstr "" +"اشیای Shelf از بیشتر متدها و عملیات‌هایی که دیکشنری‌ها پشتیبانی می‌کنند، " +"پشتیبانی می‌کنند (به‌جز کپی‌سازی، سازنده‌ها و عملگرهای ``|`` و ``|=``). این " +"کار گذار از اسکریپت‌های مبتنی بر دیکشنری به اسکریپت‌های نیازمند ذخیره‌سازی " +"پایا را آسان می‌کند." msgid "Two additional methods are supported:" -msgstr "" +msgstr "از دو متد اضافی پشتیبانی می‌شود:" -msgid "Write back all entries in the cache if the shelf was opened with *writeback* set to :const:`True`. Also empty the cache and synchronize the persistent dictionary on disk, if feasible. This is called automatically when the shelf is closed with :meth:`close`." +msgid "" +"Write back all entries in the cache if the shelf was opened with *writeback*" +" set to :const:`True`. Also empty the cache and synchronize the persistent " +"dictionary on disk, if feasible. This is called automatically when the " +"shelf is closed with :meth:`close`." msgstr "" +"اگر قفسه (shelf) با *writeback* برابر با :const:`True` باز شده باشد، تمام " +"ورودی‌های نهانگاه را بازنویسی می‌کند. همچنین در صورت امکان، نهانگاه را خالی " +"می‌کند و دیکشنری پایا روی دیسک را همگام‌سازی می‌کند. این متد به‌طور " +"خودکار هنگامی که قفسه (shelf) با :meth:`close` بسته می‌شود، فراخوانی می‌شود." -msgid "Synchronize and close the persistent *dict* object. Operations on a closed shelf will fail with a :exc:`ValueError`." +msgid "" +"Synchronize and close the persistent *dict* object. Operations on a closed " +"shelf will fail with a :exc:`ValueError`." msgstr "" +"همگام‌سازی و بستن شیء *dict* پایا. عملیات روی یک shelf بسته با " +":exc:`ValueError` شکست خواهد خورد." -msgid "`Persistent dictionary recipe `_ with widely supported storage formats and having the speed of native dictionaries." +msgid "" +"`Persistent dictionary recipe " +"`_ with widely supported storage formats and having " +"the speed of native dictionaries." msgstr "" +"`دستور دیکشنری پایا " +"`_ با قالب‌های ذخیره‌سازی با پشتیبانی گسترده و دارای " +"سرعت دیکشنری‌های بومی." msgid "Restrictions" -msgstr "" +msgstr "محدودیت‌ها" -msgid "The choice of which database package will be used (such as :mod:`dbm.ndbm` or :mod:`dbm.gnu`) depends on which interface is available. Therefore it is not safe to open the database directly using :mod:`dbm`. The database is also (unfortunately) subject to the limitations of :mod:`dbm`, if it is used --- this means that (the pickled representation of) the objects stored in the database should be fairly small, and in rare cases key collisions may cause the database to refuse updates." -msgstr "" +msgid "" +"The choice of which database package will be used (such as :mod:`dbm.ndbm` " +"or :mod:`dbm.gnu`) depends on which interface is available. Therefore it is" +" not safe to open the database directly using :mod:`dbm`. The database is " +"also (unfortunately) subject to the limitations of :mod:`dbm`, if it is used" +" --- this means that (the pickled representation of) the objects stored in " +"the database should be fairly small, and in rare cases key collisions may " +"cause the database to refuse updates." +msgstr "" +"انتخاب بسته‌ی پایگاه داده‌ای که استفاده خواهد شد (مانند :mod:`dbm.ndbm` یا " +":mod:`dbm.gnu`) به این بستگی دارد که کدام رابط در دسترس باشد. بنابراین باز " +"کردن پایگاه داده به‌صورت مستقیم با استفاده از :mod:`dbm` ایمن نیست. پایگاه " +"داده نیز (متأسفانه) در صورت استفاده از :mod:`dbm` مشمول محدودیت‌های آن است —" +" این بدان معناست که بازنمایی pickleشده (pickled representation) از اشیاء " +"ذخیره‌شده در پایگاه داده باید نسبتاً کوچک باشد، و در موارد نادر ممکن است " +"برخورد کلیدها باعث شود پایگاه داده از پذیرفتن به‌روزرسانی‌ها خودداری کند." -msgid "The :mod:`!shelve` module does not support *concurrent* read/write access to shelved objects. (Multiple simultaneous read accesses are safe.) When a program has a shelf open for writing, no other program should have it open for reading or writing. Unix file locking can be used to solve this, but this differs across Unix versions and requires knowledge about the database implementation used." -msgstr "" +msgid "" +"The :mod:`!shelve` module does not support *concurrent* read/write access to" +" shelved objects. (Multiple simultaneous read accesses are safe.) When a " +"program has a shelf open for writing, no other program should have it open " +"for reading or writing. Unix file locking can be used to solve this, but " +"this differs across Unix versions and requires knowledge about the database " +"implementation used." +msgstr "" +"ماژول :mod:`!shelve` از دسترسی *همزمان* خواندن/نوشتن به اشیای ذخیره‌شده در " +"shelf پشتیبانی نمی‌کند. (چندین دسترسی خواندن همزمان بی‌خطر است.) هنگامی که " +"برنامه‌ای یک shelf را برای نوشتن باز نگه داشته است، هیچ برنامه دیگری نباید " +"آن را برای خواندن یا نوشتن باز نگه دارد. می‌توان از قفل‌گذاری فایل در یونیکس" +" برای حل این مسئله استفاده کرد، اما این رفتار در نسخه‌های مختلف یونیکس " +"متفاوت است و به دانش درباره‌ی پیاده‌سازی پایگاه داده‌ی استفاده‌شده نیاز " +"دارد." -msgid "On macOS :mod:`dbm.ndbm` can silently corrupt the database file on updates, which can cause hard crashes when trying to read from the database." +msgid "" +"On macOS :mod:`dbm.ndbm` can silently corrupt the database file on updates, " +"which can cause hard crashes when trying to read from the database." msgstr "" +"در macOS، :mod:`dbm.ndbm` می‌تواند هنگام به‌روزرسانی‌ها بدون هشدار فایل " +"پایگاه داده را خراب کند، که این می‌تواند هنگام تلاش برای خواندن از پایگاه " +"داده باعث فروپاشی‌های سخت شود." -msgid "A subclass of :class:`collections.abc.MutableMapping` which stores pickled values in the *dict* object." +msgid "" +"A subclass of :class:`collections.abc.MutableMapping` which stores pickled " +"values in the *dict* object." msgstr "" +"زیرکلاسی از :class:`collections.abc.MutableMapping` که مقادیر پیکل‌شده را " +"در شیء *dict* ذخیره می‌کند." -msgid "By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used to serialize values. The version of the pickle protocol can be specified with the *protocol* parameter. See the :mod:`pickle` documentation for a discussion of the pickle protocols." +msgid "" +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter. See the :mod:`pickle` documentation for a " +"discussion of the pickle protocols." msgstr "" +"به‌طور پیش‌فرض، از پیکل‌های ایجادشده با :const:`pickle.DEFAULT_PROTOCOL` " +"برای سریال‌سازی مقادیر استفاده می‌شود. نسخه‌ی پروتکل پیکل را می‌توان با " +"پارامتر *protocol* مشخص کرد. برای بحثی درباره‌ی پروتکل‌های پیکل، مستندات " +":mod:`pickle` را ببینید." -msgid "If the *writeback* parameter is ``True``, the object will hold a cache of all entries accessed and write them back to the *dict* at sync and close times. This allows natural operations on mutable entries, but can consume much more memory and make sync and close take a long time." +msgid "" +"If the *writeback* parameter is ``True``, the object will hold a cache of " +"all entries accessed and write them back to the *dict* at sync and close " +"times. This allows natural operations on mutable entries, but can consume " +"much more memory and make sync and close take a long time." msgstr "" +"اگر پارامتر *writeback* برابر ``True`` باشد، شیء نهانگاهی از تمام آیتم‌های " +"دسترسی‌شده را نگه می‌دارد و آن‌ها را در زمان sync و close به *دیکشنری* " +"بازمی‌نویسد. این امر عملیات طبیعی روی آیتم‌های تغییرپذیر را ممکن می‌سازد، " +"اما می‌تواند حافظه بسیار بیشتری مصرف کند و باعث شود sync و close زمان زیادی " +"طول بکشند." -msgid "The *keyencoding* parameter is the encoding used to encode keys before they are used with the underlying dict." +msgid "" +"The *keyencoding* parameter is the encoding used to encode keys before they " +"are used with the underlying dict." msgstr "" +"پارامتر *keyencoding* کدگذاری‌ای است که برای کدگذاری کلیدها پیش از استفاده " +"از آن‌ها در دیکشنری زیرین به کار می‌رود." -msgid "A :class:`Shelf` object can also be used as a context manager, in which case it will be automatically closed when the :keyword:`with` block ends." +msgid "" +"A :class:`Shelf` object can also be used as a context manager, in which case" +" it will be automatically closed when the :keyword:`with` block ends." msgstr "" +"یک شیء :class:`Shelf` همچنین می‌تواند به‌عنوان مدیر زمینه استفاده شود، که در" +" این صورت با پایان یافتن بلوک :keyword:`with` به‌طور خودکار بسته می‌شود." -msgid "Added the *keyencoding* parameter; previously, keys were always encoded in UTF-8." +msgid "" +"Added the *keyencoding* parameter; previously, keys were always encoded in " +"UTF-8." msgstr "" +"پارامتر *keyencoding* افزوده شد؛ پیش‌تر، کلیدها همیشه با UTF-8 کدگذاری " +"می‌شدند." msgid "Added context manager support." -msgstr "" +msgstr "پشتیبانی از مدیر زمینه افزوده شد." -msgid "A subclass of :class:`Shelf` which exposes :meth:`!first`, :meth:`!next`, :meth:`!previous`, :meth:`!last` and :meth:`!set_location` methods. These are available in the third-party :mod:`!bsddb` module from `pybsddb `_ but not in other database modules. The *dict* object passed to the constructor must support those methods. This is generally accomplished by calling one of :func:`!bsddb.hashopen`, :func:`!bsddb.btopen` or :func:`!bsddb.rnopen`. The optional *protocol*, *writeback*, and *keyencoding* parameters have the same interpretation as for the :class:`Shelf` class." -msgstr "" +msgid "" +"A subclass of :class:`Shelf` which exposes :meth:`!first`, :meth:`!next`, " +":meth:`!previous`, :meth:`!last` and :meth:`!set_location` methods. These " +"are available in the third-party :mod:`!bsddb` module from `pybsddb " +"`_ but not in other database " +"modules. The *dict* object passed to the constructor must support those " +"methods. This is generally accomplished by calling one of " +":func:`!bsddb.hashopen`, :func:`!bsddb.btopen` or :func:`!bsddb.rnopen`. " +"The optional *protocol*, *writeback*, and *keyencoding* parameters have the " +"same interpretation as for the :class:`Shelf` class." +msgstr "" +"یک زیرکلاس از :class:`Shelf` که متدهای :meth:`!first`، :meth:`!next`، " +":meth:`!previous`، :meth:`!last` و :meth:`!set_location` را ارائه می‌دهد. " +"این متدها در ماژول شخص ثالث :mod:`!bsddb` از `pybsddb " +"`_ در دسترس هستند، اما در سایر" +" ماژول‌های پایگاه داده در دسترس نیستند. شیء *dict* که به سازنده ارسال می‌شود" +" باید از آن متدها پشتیبانی کند. این کار معمولاً با فراخوانی یکی از " +":func:`!bsddb.hashopen`، :func:`!bsddb.btopen` یا :func:`!bsddb.rnopen` " +"انجام می‌شود. پارامترهای اختیاری *protocol*، *writeback* و *keyencoding* " +"همان تفسیری را دارند که برای کلاس :class:`Shelf` دارند." -msgid "A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like object. The underlying file will be opened using :func:`dbm.open`. By default, the file will be created and opened for both read and write. The optional *flag* parameter has the same interpretation as for the :func:`.open` function. The optional *protocol* and *writeback* parameters have the same interpretation as for the :class:`Shelf` class." -msgstr "" +msgid "" +"A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-" +"like object. The underlying file will be opened using :func:`dbm.open`. By" +" default, the file will be created and opened for both read and write. The " +"optional *flag* parameter has the same interpretation as for the " +":func:`.open` function. The optional *protocol* and *writeback* parameters " +"have the same interpretation as for the :class:`Shelf` class." +msgstr "" +"زیرکلاسی از :class:`Shelf` که یک *filename* را به‌جای یک شیء دیکشنری‌مانند " +"می‌پذیرد. فایل زیربنایی با استفاده از :func:`dbm.open` باز خواهد شد. به‌طور " +"پیش‌فرض، فایل ایجاد می‌شود و برای خواندن و نوشتن باز می‌شود. پارامتر اختیاری" +" *flag* همان تفسیری را دارد که برای تابع :func:`.open` وجود دارد. پارامترهای" +" اختیاری *protocol* و *writeback* همان تفسیری را دارند که برای کلاس " +":class:`Shelf` وجود دارد." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "To summarize the interface (``key`` is a string, ``data`` is an arbitrary object)::" +msgid "" +"To summarize the interface (``key`` is a string, ``data`` is an arbitrary " +"object)::" msgstr "" +"برای جمع‌بندی رابط (``key`` یک رشته است، ``data`` یک شیء دلخواه است)::" msgid "" "import shelve\n" @@ -150,27 +344,56 @@ msgid "" "\n" "d.close() # close it" msgstr "" +"import shelve\n" +"\n" +"d = shelve.open(filename) # باز کردن -- ممکن است پسوندی از سوی کتابخانه سطح پایین به فایل\n" +" # اضافه شود\n" +"\n" +"d[key] = data # داده را در کلید ذخیره می‌کند (اگر از یک کلید موجود استفاده شود،\n" +" # داده‌های قدیمی را بازنویسی می‌کند)\n" +"data = d[key] # یک نسخه از داده را در کلید بازیابی می‌کند (اگر چنین کلیدی وجود نداشته باشد،\n" +" # KeyError پرتاب می‌شود)\n" +"del d[key] # داده‌ی ذخیره‌شده در کلید را حذف می‌کند (اگر چنین کلیدی وجود نداشته باشد،\n" +" # KeyError پرتاب می‌شود)\n" +"\n" +"flag = key in d # اگر کلید موجود باشد، درست است\n" +"klist = list(d.keys()) # فهرستی از تمام کلیدهای موجود (کند!)\n" +"\n" +"# چون d بدون writeback=True باز شده است، مراقب باشید:\n" +"d['xx'] = [0, 1, 2] # این همان‌طور که انتظار می‌رود کار می‌کند، اما...\n" +"d['xx'].append(3) # *این کار نمی‌کند!* -- d['xx'] همچنان [0, 1, 2] است!\n" +"\n" +"# چون d را بدون writeback=True باز کرده‌اید، باید با دقت کد بنویسید:\n" +"temp = d['xx'] # نسخه را استخراج می‌کند\n" +"temp.append(5) # نسخه را تغییر می‌دهد\n" +"d['xx'] = temp # نسخه را دوباره ذخیره می‌کند تا پایا شود\n" +"\n" +"# یا d=shelve.open(filename,writeback=True) به شما اجازه می‌دهد فقط\n" +"# d['xx'].append(5) را بنویسید و همان‌طور که انتظار می‌رود کار کند، اما همچنین\n" +"# حافظه بیشتری مصرف می‌کند و عملیات d.close() را کندتر می‌کند.\n" +"\n" +"d.close() # آن را می‌بندد" msgid "Module :mod:`dbm`" -msgstr "" +msgstr "ماژول :mod:`dbm`" msgid "Generic interface to ``dbm``-style databases." -msgstr "" +msgstr "رابط عام برای پایگاه‌های داده به سبک ``dbm``." msgid "Module :mod:`pickle`" -msgstr "" +msgstr "ماژول :mod:`pickle`" msgid "Object serialization used by :mod:`!shelve`." -msgstr "" +msgstr "سریال‌سازی اشیاء که :mod:`!shelve` از آن استفاده می‌کند." msgid "module" -msgstr "" +msgstr "ماژول" msgid "pickle" -msgstr "" +msgstr "pickle" msgid "dbm.ndbm" -msgstr "" +msgstr "dbm.ndbm" msgid "dbm.gnu" -msgstr "" +msgstr "dbm.gnu" diff --git a/library/shlex.po b/library/shlex.po index 912114390..a76a0b423 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -22,211 +22,585 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!shlex` --- Simple lexical analysis" -msgstr "" +msgstr ":mod:`!shlex` --- تحلیل واژگانی ساده" msgid "**Source code:** :source:`Lib/shlex.py`" -msgstr "" +msgstr ":source:`Lib/shlex.py`" -msgid "The :class:`~shlex.shlex` class makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell. This will often be useful for writing minilanguages, (for example, in run control files for Python applications) or for parsing quoted strings." +msgid "" +"The :class:`~shlex.shlex` class makes it easy to write lexical analyzers for" +" simple syntaxes resembling that of the Unix shell. This will often be " +"useful for writing minilanguages, (for example, in run control files for " +"Python applications) or for parsing quoted strings." msgstr "" +"کلاس :class:`~shlex.shlex` نوشتن تحلیل‌گرهای واژگانی برای سینتکس‌های ساده‌ای" +" که شبیه سینتکس پوسته Unix هستند را آسان می‌کند. این امر اغلب برای نوشتن " +"زبان‌های کوچک (minilanguages) (برای مثال، در فایل‌های کنترل اجرا برای " +"برنامه‌های پایتون) یا برای تجزیه رشته‌های داخل علامت نقل‌قول مفید خواهد بود." msgid "The :mod:`!shlex` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!shlex` توابع زیر را تعریف می‌کند:" -msgid "Split the string *s* using shell-like syntax. If *comments* is :const:`False` (the default), the parsing of comments in the given string will be disabled (setting the :attr:`~shlex.commenters` attribute of the :class:`~shlex.shlex` instance to the empty string). This function operates in POSIX mode by default, but uses non-POSIX mode if the *posix* argument is false." -msgstr "" +msgid "" +"Split the string *s* using shell-like syntax. If *comments* is " +":const:`False` (the default), the parsing of comments in the given string " +"will be disabled (setting the :attr:`~shlex.commenters` attribute of the " +":class:`~shlex.shlex` instance to the empty string). This function operates" +" in POSIX mode by default, but uses non-POSIX mode if the *posix* argument " +"is false." +msgstr "" +"رشته‌ی *s* را با استفاده از نحو مشابه پوسته تقسیم می‌کند. اگر *comments* " +"برابر :const:`False` باشد (پیش‌فرض)، تجزیه‌ی توضیحات در رشته‌ی داده‌شده " +"غیرفعال خواهد شد (با تنظیم ویژگی :attr:`~shlex.commenters` در نمونه‌ی " +":class:`~shlex.shlex` به رشته‌ی خالی). این تابع به‌طور پیش‌فرض در حالت POSIX" +" کار می‌کند، اما اگر آرگومان *posix* نادرست باشد، از حالت غیر POSIX استفاده " +"می‌کند." -msgid "Passing ``None`` for *s* argument now raises an exception, rather than reading :data:`sys.stdin`." +msgid "" +"Passing ``None`` for *s* argument now raises an exception, rather than " +"reading :data:`sys.stdin`." msgstr "" +"اکنون ارسال ``None`` برای آرگومان *s* به جای خواندن :data:`sys.stdin`، باعث " +"پرتاب یک استثنا می‌شود." -msgid "Concatenate the tokens of the list *split_command* and return a string. This function is the inverse of :func:`split`." +msgid "" +"Concatenate the tokens of the list *split_command* and return a string. This" +" function is the inverse of :func:`split`." msgstr "" +"توکن‌های فهرست *split_command* را به هم می‌چسباند و یک رشته برمی‌گرداند. این" +" تابع معکوس :func:`split` است." -msgid "The returned value is shell-escaped to protect against injection vulnerabilities (see :func:`quote`)." +msgid "" +"The returned value is shell-escaped to protect against injection " +"vulnerabilities (see :func:`quote`)." msgstr "" +"مقدار بازگشتی برای محافظت در برابر آسیب‌پذیری‌های تزریق، برای پوسته خنثی شده" +" است (به :func:`quote` مراجعه کنید)." -msgid "Return a shell-escaped version of the string *s*. The returned value is a string that can safely be used as one token in a shell command line, for cases where you cannot use a list." +msgid "" +"Return a shell-escaped version of the string *s*. The returned value is a " +"string that can safely be used as one token in a shell command line, for " +"cases where you cannot use a list." msgstr "" +"نسخه‌ای خنثی‌شده برای پوسته از رشته‌ی *s* برمی‌گرداند. مقدار برگردانده‌شده " +"رشته‌ای است که می‌تواند با اطمینان به‌عنوان یک توکن در خط فرمان پوسته " +"استفاده شود؛ برای مواردی که نمی‌توانید از یک فهرست استفاده کنید." msgid "The ``shlex`` module is **only designed for Unix shells**." -msgstr "" +msgstr "ماژول ``shlex`` **فقط برای پوسته‌های Unix طراحی شده است**." -msgid "The :func:`quote` function is not guaranteed to be correct on non-POSIX compliant shells or shells from other operating systems such as Windows. Executing commands quoted by this module on such shells can open up the possibility of a command injection vulnerability." +msgid "" +"The :func:`quote` function is not guaranteed to be correct on non-POSIX " +"compliant shells or shells from other operating systems such as Windows. " +"Executing commands quoted by this module on such shells can open up the " +"possibility of a command injection vulnerability." msgstr "" +"تضمین نمی‌شود که تابع :func:`quote` روی پوسته‌های غیرسازگار با POSIX یا " +"پوسته‌هایی از سیستم‌عامل‌های دیگر مانند ویندوز درست عمل کند. اجرای دستورهایی" +" که توسط این ماژول نقل‌قول شده‌اند روی چنین پوسته‌هایی می‌تواند امکان " +"آسیب‌پذیری تزریق دستور را ایجاد کند." -msgid "Consider using functions that pass command arguments with lists such as :func:`subprocess.run` with ``shell=False``." +msgid "" +"Consider using functions that pass command arguments with lists such as " +":func:`subprocess.run` with ``shell=False``." msgstr "" +"استفاده از توابعی را در نظر بگیرید که آرگومان‌های فرمان را با فهرست‌ها منتقل" +" می‌کنند، مانند :func:`subprocess.run` با ``shell=False``." msgid "This idiom would be unsafe:" -msgstr "" +msgstr "این روش ناایمن خواهد بود:" msgid ":func:`quote` lets you plug the security hole:" -msgstr "" +msgstr ":func:`quote` به شما امکان می‌دهد حفره‌ی امنیتی را ببندید:" msgid "The quoting is compatible with UNIX shells and with :func:`split`:" -msgstr "" +msgstr "نقل‌قول‌گذاری با پوسته‌های UNIX و با :func:`split` سازگار است:" msgid "The :mod:`!shlex` module defines the following class:" -msgstr "" +msgstr "ماژول :mod:`!shlex` کلاس زیر را تعریف می‌کند:" -msgid "A :class:`~shlex.shlex` instance or subclass instance is a lexical analyzer object. The initialization argument, if present, specifies where to read characters from. It must be a file-/stream-like object with :meth:`~io.TextIOBase.read` and :meth:`~io.TextIOBase.readline` methods, or a string. If no argument is given, input will be taken from ``sys.stdin``. The second optional argument is a filename string, which sets the initial value of the :attr:`~shlex.infile` attribute. If the *instream* argument is omitted or equal to ``sys.stdin``, this second argument defaults to \"stdin\". The *posix* argument defines the operational mode: when *posix* is not true (default), the :class:`~shlex.shlex` instance will operate in compatibility mode. When operating in POSIX mode, :class:`~shlex.shlex` will try to be as close as possible to the POSIX shell parsing rules. The *punctuation_chars* argument provides a way to make the behaviour even closer to how real shells parse. This can take a number of values: the default value, ``False``, preserves the behaviour seen under Python 3.5 and earlier. If set to ``True``, then parsing of the characters ``();<>|&`` is changed: any run of these characters (considered punctuation characters) is returned as a single token. If set to a non-empty string of characters, those characters will be used as the punctuation characters. Any characters in the :attr:`wordchars` attribute that appear in *punctuation_chars* will be removed from :attr:`wordchars`. See :ref:`improved-shell-compatibility` for more information. *punctuation_chars* can be set only upon :class:`~shlex.shlex` instance creation and can't be modified later." -msgstr "" +msgid "" +"A :class:`~shlex.shlex` instance or subclass instance is a lexical analyzer " +"object. The initialization argument, if present, specifies where to read " +"characters from. It must be a file-/stream-like object with " +":meth:`~io.TextIOBase.read` and :meth:`~io.TextIOBase.readline` methods, or " +"a string. If no argument is given, input will be taken from ``sys.stdin``. " +"The second optional argument is a filename string, which sets the initial " +"value of the :attr:`~shlex.infile` attribute. If the *instream* argument is" +" omitted or equal to ``sys.stdin``, this second argument defaults to " +"\"stdin\". The *posix* argument defines the operational mode: when *posix* " +"is not true (default), the :class:`~shlex.shlex` instance will operate in " +"compatibility mode. When operating in POSIX mode, :class:`~shlex.shlex` " +"will try to be as close as possible to the POSIX shell parsing rules. The " +"*punctuation_chars* argument provides a way to make the behaviour even " +"closer to how real shells parse. This can take a number of values: the " +"default value, ``False``, preserves the behaviour seen under Python 3.5 and " +"earlier. If set to ``True``, then parsing of the characters ``();<>|&`` is " +"changed: any run of these characters (considered punctuation characters) is " +"returned as a single token. If set to a non-empty string of characters, " +"those characters will be used as the punctuation characters. Any characters" +" in the :attr:`wordchars` attribute that appear in *punctuation_chars* will " +"be removed from :attr:`wordchars`. See :ref:`improved-shell-compatibility` " +"for more information. *punctuation_chars* can be set only upon " +":class:`~shlex.shlex` instance creation and can't be modified later." +msgstr "" +"یک نمونه از :class:`~shlex.shlex` یا نمونه‌ای از یک زیرکلاس، یک شیء تحلیل‌گر" +" واژگانی است. آرگومان مقداردهی اولیه، در صورت وجود، مشخص می‌کند که نویسه‌ها " +"از کجا خوانده شوند. این آرگومان باید یک شیء فایل‌مانند/جریان‌مانند با متدهای" +" :meth:`~io.TextIOBase.read` و :meth:`~io.TextIOBase.readline` یا یک رشته " +"باشد. اگر آرگومانی داده نشود، ورودی از ``sys.stdin`` گرفته خواهد شد. دومین " +"آرگومان اختیاری یک رشته‌ی نام فایل است که مقدار اولیه ویژگی " +":attr:`~shlex.infile` را تنظیم می‌کند. اگر آرگومان *instream* حذف شود یا " +"برابر ``sys.stdin`` باشد، این آرگومان دوم به‌طور پیش‌فرض \"stdin\" خواهد " +"بود. آرگومان *posix* حالت عملیاتی را تعریف می‌کند: وقتی *posix* درست نباشد " +"(پیش‌فرض)، نمونه‌ی :class:`~shlex.shlex` در حالت سازگاری عمل خواهد کرد. " +"هنگام عمل در حالت POSIX، :class:`~shlex.shlex` تلاش می‌کند تا حد ممکن به " +"قوانین تجزیه‌ی پوسته‌ی POSIX نزدیک باشد. آرگومان *punctuation_chars* راهی " +"فراهم می‌کند تا رفتار حتی به نحوه‌ی تجزیه‌ی پوسته‌های واقعی نزدیک‌تر شود. " +"این آرگومان می‌تواند مقادیر مختلفی بپذیرد: مقدار پیش‌فرض، ``False``، رفتار " +"موجود در Python 3.5 و نسخه‌های قدیمی‌تر را حفظ می‌کند. اگر روی ``True`` " +"تنظیم شود، تجزیه‌ی نویسه‌های ``();<>|&`` تغییر می‌کند: هر دنباله‌ی پیوسته‌ای" +" از این نویسه‌ها (که نویسه‌های نمادگذاری محسوب می‌شوند) به‌صورت یک توکن " +"واحد بازگردانده می‌شود. اگر روی یک رشته‌ی غیرخالی از نویسه‌ها تنظیم شود، آن " +"نویسه‌ها به‌عنوان نویسه‌های نمادگذاری استفاده خواهند شد. هر نویسه‌ای در " +"ویژگی :attr:`wordchars` که در *punctuation_chars* وجود داشته باشد، از " +":attr:`wordchars` حذف خواهد شد. برای اطلاعات بیشتر، :ref:`improved-shell-" +"compatibility` را ببینید. *punctuation_chars* فقط هنگام ایجاد نمونه‌ی " +":class:`~shlex.shlex` قابل تنظیم است و نمی‌توان آن را بعداً تغییر داد." msgid "The *punctuation_chars* parameter was added." -msgstr "" +msgstr "پارامتر *punctuation_chars* افزوده شد." msgid "Module :mod:`configparser`" -msgstr "" +msgstr "ماژول :mod:`configparser`" -msgid "Parser for configuration files similar to the Windows :file:`.ini` files." +msgid "" +"Parser for configuration files similar to the Windows :file:`.ini` files." msgstr "" +"پارسر (parser) برای فایل‌های پیکربندی مشابه فایل‌های :file:`.ini` ویندوز." msgid "shlex Objects" -msgstr "" +msgstr "اشیاء shlex" msgid "A :class:`~shlex.shlex` instance has the following methods:" -msgstr "" +msgstr "یک نمونه از :class:`~shlex.shlex` متدهای زیر را دارد:" -msgid "Return a token. If tokens have been stacked using :meth:`push_token`, pop a token off the stack. Otherwise, read one from the input stream. If reading encounters an immediate end-of-file, :attr:`eof` is returned (the empty string (``''``) in non-POSIX mode, and ``None`` in POSIX mode)." +msgid "" +"Return a token. If tokens have been stacked using :meth:`push_token`, pop a" +" token off the stack. Otherwise, read one from the input stream. If " +"reading encounters an immediate end-of-file, :attr:`eof` is returned (the " +"empty string (``''``) in non-POSIX mode, and ``None`` in POSIX mode)." msgstr "" +"یک توکن برمی‌گرداند. اگر توکن‌ها با استفاده از :meth:`push_token` در پشته " +"قرار گرفته باشند، یک توکن را از پشته خارج می‌کند. در غیر این صورت، یکی را از" +" جریان ورودی می‌خواند. اگر خواندن بلافاصله با پایان پرونده مواجه شود، " +":attr:`eof` برگردانده می‌شود (رشته خالی (``''``) در حالت غیر POSIX و " +"``None`` در حالت POSIX)." msgid "Push the argument onto the token stack." -msgstr "" +msgstr "آرگومان را روی پشته‌ی توکن (token) قرار دهید." -msgid "Read a raw token. Ignore the pushback stack, and do not interpret source requests. (This is not ordinarily a useful entry point, and is documented here only for the sake of completeness.)" +msgid "" +"Read a raw token. Ignore the pushback stack, and do not interpret source " +"requests. (This is not ordinarily a useful entry point, and is documented " +"here only for the sake of completeness.)" msgstr "" +"یک توکن خام را بخوانید. پشته‌ی پس‌زدن (pushback stack) را نادیده بگیرید و " +"درخواست‌های منبع را تفسیر نکنید. (این معمولاً نقطه‌ی ورود مفیدی نیست و تنها " +"به‌خاطر کامل بودن در اینجا مستند شده است.)" -msgid "When :class:`~shlex.shlex` detects a source request (see :attr:`source` below) this method is given the following token as argument, and expected to return a tuple consisting of a filename and an open file-like object." +msgid "" +"When :class:`~shlex.shlex` detects a source request (see :attr:`source` " +"below) this method is given the following token as argument, and expected to" +" return a tuple consisting of a filename and an open file-like object." msgstr "" +"هنگامی که :class:`~shlex.shlex` یک درخواست منبع را تشخیص می‌دهد (به " +":attr:`source` در زیر مراجعه کنید)، این متد توکن بعدی را به‌عنوان آرگومان " +"دریافت می‌کند و انتظار می‌رود یک تاپلشامل یک نام فایل و یک شیء " +"شبه‌فایل باز را برگرداند." -msgid "Normally, this method first strips any quotes off the argument. If the result is an absolute pathname, or there was no previous source request in effect, or the previous source was a stream (such as ``sys.stdin``), the result is left alone. Otherwise, if the result is a relative pathname, the directory part of the name of the file immediately before it on the source inclusion stack is prepended (this behavior is like the way the C preprocessor handles ``#include \"file.h\"``)." -msgstr "" +msgid "" +"Normally, this method first strips any quotes off the argument. If the " +"result is an absolute pathname, or there was no previous source request in " +"effect, or the previous source was a stream (such as ``sys.stdin``), the " +"result is left alone. Otherwise, if the result is a relative pathname, the " +"directory part of the name of the file immediately before it on the source " +"inclusion stack is prepended (this behavior is like the way the C " +"preprocessor handles ``#include \"file.h\"``)." +msgstr "" +"به‌طور معمول، این متد ابتدا هرگونه علامت نقل‌قول اطراف آرگومان را حذف " +"می‌کند. اگر نتیجه یک مسیر مطلق باشد، یا هیچ درخواست منبع قبلی‌ای فعال نباشد،" +" یا منبع قبلی یک جریان (مانند ``sys.stdin``) باشد، نتیجه بدون تغییر باقی " +"می‌ماند. در غیر این صورت، اگر نتیجه یک مسیر نسبی باشد، بخش پوشه از نام فایلی" +" که بلافاصله قبل از آن در پشته‌ی درج منبع قرار دارد، به ابتدای آن افزوده " +"می‌شود (این رفتار مشابه روشی است که پیش‌پردازنده‌ی C با ``#include " +"\"file.h\"`` برخورد می‌کند)." -msgid "The result of the manipulations is treated as a filename, and returned as the first component of the tuple, with :func:`open` called on it to yield the second component. (Note: this is the reverse of the order of arguments in instance initialization!)" +msgid "" +"The result of the manipulations is treated as a filename, and returned as " +"the first component of the tuple, with :func:`open` called on it to yield " +"the second component. (Note: this is the reverse of the order of arguments " +"in instance initialization!)" msgstr "" +"نتیجه‌ی دستکاری‌ها به‌عنوان یک نام فایل در نظر گرفته می‌شود و به‌عنوان اولین" +" کامپوننت تاپل برگردانده می‌شود، و :func:`open` روی آن فراخوانی می‌شود تا " +"کامپوننت دوم را به دست دهد. (توجه: این، معکوس ترتیب آرگومان‌ها در مقداردهی " +"اولیه نمونه است!)" -msgid "This hook is exposed so that you can use it to implement directory search paths, addition of file extensions, and other namespace hacks. There is no corresponding 'close' hook, but a shlex instance will call the :meth:`~io.IOBase.close` method of the sourced input stream when it returns EOF." -msgstr "" +msgid "" +"This hook is exposed so that you can use it to implement directory search " +"paths, addition of file extensions, and other namespace hacks. There is no " +"corresponding 'close' hook, but a shlex instance will call the " +":meth:`~io.IOBase.close` method of the sourced input stream when it returns " +"EOF." +msgstr "" +"این قلاب در دسترس قرار گرفته است تا بتوانید از آن برای پیاده‌سازی مسیرهای " +"جستجوی پوشه، افزودن پسوندهای فایل و سایر ترفندهای فضای نام استفاده کنید. هیچ " +"قلاب 'close' متناظری وجود ندارد، اما یک نمونه از shlex، هنگامی که جریان " +"ورودی منبع EOF را برگرداند، متد :meth:`~io.IOBase.close` آن را فراخوانی " +"می‌کند." -msgid "For more explicit control of source stacking, use the :meth:`push_source` and :meth:`pop_source` methods." +msgid "" +"For more explicit control of source stacking, use the :meth:`push_source` " +"and :meth:`pop_source` methods." msgstr "" +"برای کنترل صریح‌تر پشته‌سازی منبع، از متدهای :meth:`push_source` و " +":meth:`pop_source` استفاده کنید." -msgid "Push an input source stream onto the input stack. If the filename argument is specified it will later be available for use in error messages. This is the same method used internally by the :meth:`sourcehook` method." +msgid "" +"Push an input source stream onto the input stack. If the filename argument " +"is specified it will later be available for use in error messages. This is " +"the same method used internally by the :meth:`sourcehook` method." msgstr "" +"یک جریان منبع ورودی را روی پشته ورودی قرار می‌دهد. اگر آرگومان filename " +"تعیین شده باشد، بعداً برای استفاده در پیام‌های خطا در دسترس خواهد بود. این " +"همان متدی است که به‌صورت داخلی توسط متد :meth:`sourcehook` استفاده می‌شود." -msgid "Pop the last-pushed input source from the input stack. This is the same method used internally when the lexer reaches EOF on a stacked input stream." +msgid "" +"Pop the last-pushed input source from the input stack. This is the same " +"method used internally when the lexer reaches EOF on a stacked input stream." msgstr "" +"آخرین منبع ورودی واردشده به پشته را از پشته ورودی بردارید. این همان متدی است" +" که به‌صورت داخلی هنگامی استفاده می‌شود که تحلیل‌گر واژگانی (lexer) در یک " +"جریان ورودی پشته‌ای به EOF برسد." -msgid "This method generates an error message leader in the format of a Unix C compiler error label; the format is ``'\"%s\", line %d: '``, where the ``%s`` is replaced with the name of the current source file and the ``%d`` with the current input line number (the optional arguments can be used to override these)." +msgid "" +"This method generates an error message leader in the format of a Unix C " +"compiler error label; the format is ``'\"%s\", line %d: '``, where the " +"``%s`` is replaced with the name of the current source file and the ``%d`` " +"with the current input line number (the optional arguments can be used to " +"override these)." msgstr "" +"این متد یک سرآغاز پیام خطا در قالب برچسب خطای کامپایلر C یونیکس تولید " +"می‌کند؛ قالب به‌صورت ``'\"%s\", line %d: '`` است، که در آن ``%s`` با نام " +"فایل منبع جاری و ``%d`` با شماره خط ورودی جاری جایگزین می‌شود (می‌توان از " +"آرگومان‌های اختیاری برای بازنویسی این مقادیر استفاده کرد)." -msgid "This convenience is provided to encourage :mod:`!shlex` users to generate error messages in the standard, parseable format understood by Emacs and other Unix tools." +msgid "" +"This convenience is provided to encourage :mod:`!shlex` users to generate " +"error messages in the standard, parseable format understood by Emacs and " +"other Unix tools." msgstr "" +"این سهولت فراهم شده است تا کاربران :mod:`!shlex` تشویق شوند پیام‌های خطا را " +"در قالب استاندارد و قابل‌تجزیه‌ای تولید کنند که Emacs و سایر ابزارهای Unix " +"آن را درک می‌کنند." -msgid "Instances of :class:`~shlex.shlex` subclasses have some public instance variables which either control lexical analysis or can be used for debugging:" +msgid "" +"Instances of :class:`~shlex.shlex` subclasses have some public instance " +"variables which either control lexical analysis or can be used for " +"debugging:" msgstr "" +"نمونه‌های زیرکلاس‌های :class:`~shlex.shlex` دارای چند متغیر نمونه عمومی " +"هستند که یا تحلیل واژگانی را کنترل می‌کنند یا می‌توان از آن‌ها برای " +"اشکال‌زدایی استفاده کرد:" -msgid "The string of characters that are recognized as comment beginners. All characters from the comment beginner to end of line are ignored. Includes just ``'#'`` by default." +msgid "" +"The string of characters that are recognized as comment beginners. All " +"characters from the comment beginner to end of line are ignored. Includes " +"just ``'#'`` by default." msgstr "" +"رشته‌ای از نویسه‌ها که به‌عنوان آغازگرهای توضیح شناخته می‌شوند. تمام " +"نویسه‌ها از آغازگر توضیح تا پایان خط نادیده گرفته می‌شوند. به‌طور پیش‌فرض " +"فقط شامل ``'#'`` است." -msgid "The string of characters that will accumulate into multi-character tokens. By default, includes all ASCII alphanumerics and underscore. In POSIX mode, the accented characters in the Latin-1 set are also included. If :attr:`punctuation_chars` is not empty, the characters ``~-./*?=``, which can appear in filename specifications and command line parameters, will also be included in this attribute, and any characters which appear in ``punctuation_chars`` will be removed from ``wordchars`` if they are present there. If :attr:`whitespace_split` is set to ``True``, this will have no effect." -msgstr "" +msgid "" +"The string of characters that will accumulate into multi-character tokens. " +"By default, includes all ASCII alphanumerics and underscore. In POSIX mode," +" the accented characters in the Latin-1 set are also included. If " +":attr:`punctuation_chars` is not empty, the characters ``~-./*?=``, which " +"can appear in filename specifications and command line parameters, will also" +" be included in this attribute, and any characters which appear in " +"``punctuation_chars`` will be removed from ``wordchars`` if they are present" +" there. If :attr:`whitespace_split` is set to ``True``, this will have no " +"effect." +msgstr "" +"رشته‌ای از نویسه‌ها که برای تشکیل توکن‌های چند نویسه‌ای انباشته می‌شوند. " +"به‌طور پیش‌فرض، شامل تمام نویسه‌های الفباعددی ASCII و زیرخط می‌شود. در حالت " +"POSIX، نویسه‌های لهجه‌دار در مجموعه Latin-1 نیز گنجانده می‌شوند. اگر " +":attr:`punctuation_chars` خالی نباشد، نویسه‌های ``~-./*?=``، که می‌توانند در" +" مشخصات نام فایل و پارامترهای خط فرمان ظاهر شوند، نیز در این ویژگی گنجانده " +"می‌شوند و هر نویسه‌ای که در ``punctuation_chars`` ظاهر شود، در صورت وجود در " +"``wordchars``، از آن حذف می‌شود. اگر :attr:`whitespace_split` روی ``True`` " +"تنظیم شده باشد، این مورد بی‌اثر خواهد بود." -msgid "Characters that will be considered whitespace and skipped. Whitespace bounds tokens. By default, includes space, tab, linefeed and carriage-return." +msgid "" +"Characters that will be considered whitespace and skipped. Whitespace " +"bounds tokens. By default, includes space, tab, linefeed and carriage-" +"return." msgstr "" +"نویسه‌هایی که فضای سفید تلقی می‌شوند و از آن‌ها چشم‌پوشی می‌شود. فضای سفید، " +"مرز توکن‌ها را مشخص می‌کند. به‌طور پیش‌فرض، شامل فاصله، تب، سرخط و بازگشت " +"حامل می‌شود." -msgid "Characters that will be considered as escape. This will be only used in POSIX mode, and includes just ``'\\'`` by default." +msgid "" +"Characters that will be considered as escape. This will be only used in " +"POSIX mode, and includes just ``'\\'`` by default." msgstr "" +"نویسه‌هایی که به‌عنوان نویسه‌های خنثی‌کننده در نظر گرفته می‌شوند. این مورد " +"فقط در حالت POSIX استفاده می‌شود و به‌طور پیش‌فرض فقط شامل ``'\\'`` است." -msgid "Characters that will be considered string quotes. The token accumulates until the same quote is encountered again (thus, different quote types protect each other as in the shell.) By default, includes ASCII single and double quotes." +msgid "" +"Characters that will be considered string quotes. The token accumulates " +"until the same quote is encountered again (thus, different quote types " +"protect each other as in the shell.) By default, includes ASCII single and " +"double quotes." msgstr "" +"نویسه‌هایی که به‌عنوان علامت‌های نقل‌قول رشته در نظر گرفته می‌شوند. توکن تا " +"زمانی که دوباره همان علامت نقل‌قول مشاهده شود انباشته می‌شود (بنابراین، " +"انواع مختلف علامت‌های نقل‌قول، مانند پوسته، از یکدیگر محافظت می‌کنند). " +"به‌طور پیش‌فرض، شامل علامت‌های نقل‌قول تکی و دوتایی ASCII است." -msgid "Characters in :attr:`quotes` that will interpret escape characters defined in :attr:`escape`. This is only used in POSIX mode, and includes just ``'\"'`` by default." +msgid "" +"Characters in :attr:`quotes` that will interpret escape characters defined " +"in :attr:`escape`. This is only used in POSIX mode, and includes just " +"``'\"'`` by default." msgstr "" +"نویسه‌های موجود در :attr:`quotes` که نویسه‌های خنثی‌کننده‌ی تعریف‌شده در " +":attr:`escape` را تفسیر می‌کنند. این مورد فقط در حالت POSIX استفاده می‌شود و" +" به‌طور پیش‌فرض فقط شامل ``'\"'`` است." -msgid "If ``True``, tokens will only be split in whitespaces. This is useful, for example, for parsing command lines with :class:`~shlex.shlex`, getting tokens in a similar way to shell arguments. When used in combination with :attr:`punctuation_chars`, tokens will be split on whitespace in addition to those characters." -msgstr "" +msgid "" +"If ``True``, tokens will only be split in whitespaces. This is useful, for " +"example, for parsing command lines with :class:`~shlex.shlex`, getting " +"tokens in a similar way to shell arguments. When used in combination with " +":attr:`punctuation_chars`, tokens will be split on whitespace in addition to" +" those characters." +msgstr "" +"اگر ``True`` باشد، توکن‌ها فقط بر اساس فضای سفید جدا می‌شوند. این قابلیت " +"مفید است، برای مثال، برای تجزیه خط‌های فرمان با :class:`~shlex.shlex` و " +"دریافت توکن‌ها به شیوه‌ای مشابه آرگومان‌های پوسته. هنگامی که همراه با " +":attr:`punctuation_chars` استفاده شود، توکن‌ها علاوه بر آن نویسه‌ها، بر اساس" +" فضای سفید نیز جدا می‌شوند." -msgid "The :attr:`punctuation_chars` attribute was made compatible with the :attr:`whitespace_split` attribute." +msgid "" +"The :attr:`punctuation_chars` attribute was made compatible with the " +":attr:`whitespace_split` attribute." msgstr "" +"ویژگی :attr:`punctuation_chars` با ویژگی :attr:`whitespace_split` سازگار شد." -msgid "The name of the current input file, as initially set at class instantiation time or stacked by later source requests. It may be useful to examine this when constructing error messages." +msgid "" +"The name of the current input file, as initially set at class instantiation " +"time or stacked by later source requests. It may be useful to examine this " +"when constructing error messages." msgstr "" +"نام فایل ورودی فعلی، که در ابتدا در زمان نمونه‌سازی کلاس تنظیم شده یا توسط " +"درخواست‌های منبع بعدی روی پشته قرار گرفته است. بررسی این مقدار ممکن است " +"هنگام ساخت پیام‌های خطا مفید باشد." -msgid "The input stream from which this :class:`~shlex.shlex` instance is reading characters." +msgid "" +"The input stream from which this :class:`~shlex.shlex` instance is reading " +"characters." msgstr "" +"جریان ورودی‌ای که این نمونه‌ی :class:`~shlex.shlex` نویسه‌ها را از آن " +"می‌خواند." -msgid "This attribute is ``None`` by default. If you assign a string to it, that string will be recognized as a lexical-level inclusion request similar to the ``source`` keyword in various shells. That is, the immediately following token will be opened as a filename and input will be taken from that stream until EOF, at which point the :meth:`~io.IOBase.close` method of that stream will be called and the input source will again become the original input stream. Source requests may be stacked any number of levels deep." -msgstr "" +msgid "" +"This attribute is ``None`` by default. If you assign a string to it, that " +"string will be recognized as a lexical-level inclusion request similar to " +"the ``source`` keyword in various shells. That is, the immediately " +"following token will be opened as a filename and input will be taken from " +"that stream until EOF, at which point the :meth:`~io.IOBase.close` method of" +" that stream will be called and the input source will again become the " +"original input stream. Source requests may be stacked any number of levels " +"deep." +msgstr "" +"این ویژگی به‌طور پیش‌فرض ``None`` است. اگر یک رشته به آن انتساب دهید، آن " +"رشته به‌عنوان یک درخواست درج در سطح واژگانی مشابه کلیدواژه ``source`` در " +"پوسته‌های مختلف تشخیص داده می‌شود. یعنی توکن بلافاصله بعدی به‌عنوان نام فایل" +" باز می‌شود و ورودی تا EOF از آن جریان دریافت می‌شود؛ در آن نقطه، متد " +":meth:`~io.IOBase.close` آن جریان فراخوانی می‌شود و منبع ورودی دوباره جریان " +"ورودی اصلی خواهد شد. درخواست‌های منبع می‌توانند تا هر تعداد سطحی روی هم " +"انباشته شوند." -msgid "If this attribute is numeric and ``1`` or more, a :class:`~shlex.shlex` instance will print verbose progress output on its behavior. If you need to use this, you can read the module source code to learn the details." +msgid "" +"If this attribute is numeric and ``1`` or more, a :class:`~shlex.shlex` " +"instance will print verbose progress output on its behavior. If you need to" +" use this, you can read the module source code to learn the details." msgstr "" +"اگر این ویژگی عددی و ``1`` یا بیشتر باشد، نمونه‌ای از :class:`~shlex.shlex` " +"خروجی پیشرفت مفصلی درباره‌ی رفتار آن چاپ می‌کند. اگر نیاز به استفاده از این " +"دارید، می‌توانید کد منبع ماژول را بخوانید تا جزئیات را بیاموزید." msgid "Source line number (count of newlines seen so far plus one)." -msgstr "" +msgstr "شماره خط منبع (تعداد خط‌های جدید دیده‌شده تاکنون به‌علاوه یک)." -msgid "The token buffer. It may be useful to examine this when catching exceptions." +msgid "" +"The token buffer. It may be useful to examine this when catching " +"exceptions." msgstr "" +"بافر توکن (token buffer). ممکن است بررسی این مورد هنگام گرفتن استثناها مفید" +" باشد." -msgid "Token used to determine end of file. This will be set to the empty string (``''``), in non-POSIX mode, and to ``None`` in POSIX mode." +msgid "" +"Token used to determine end of file. This will be set to the empty string " +"(``''``), in non-POSIX mode, and to ``None`` in POSIX mode." msgstr "" +"توکنی که برای تعیین پایان فایل به کار می‌رود. این مقدار در حالت غیر POSIX به" +" رشته‌ی خالی (``''``) و در حالت POSIX به ``None`` تنظیم می‌شود." -msgid "A read-only property. Characters that will be considered punctuation. Runs of punctuation characters will be returned as a single token. However, note that no semantic validity checking will be performed: for example, '>>>' could be returned as a token, even though it may not be recognised as such by shells." -msgstr "" +msgid "" +"A read-only property. Characters that will be considered punctuation. Runs " +"of punctuation characters will be returned as a single token. However, note " +"that no semantic validity checking will be performed: for example, '>>>' " +"could be returned as a token, even though it may not be recognised as such " +"by shells." +msgstr "" +"یک ویژگی فقط‌خواندنی. نویسه‌هایی که به‌عنوان نمادگذاری تلقی می‌شوند. " +"دنباله‌های پیوسته‌ای از نویسه‌های نمادگذاری به‌عنوان یک توکن (token) واحد " +"بازگردانده خواهند شد. با این حال، توجه داشته باشید که هیچ‌گونه بررسی صحت " +"معنایی انجام نخواهد شد: برای مثال، ممکن است '>>>' به‌عنوان یک توکن " +"بازگردانده شود، حتی اگر پوسته‌ها آن را به‌عنوان چنین توکنی نشناسند." msgid "Parsing Rules" -msgstr "" +msgstr "قواعد تجزیه" -msgid "When operating in non-POSIX mode, :class:`~shlex.shlex` will try to obey the following rules." +msgid "" +"When operating in non-POSIX mode, :class:`~shlex.shlex` will try to obey the" +" following rules." msgstr "" +"هنگام کار در حالت non-POSIX، :class:`~shlex.shlex` سعی می‌کند از قوانین زیر " +"پیروی کند." -msgid "Quote characters are not recognized within words (``Do\"Not\"Separate`` is parsed as the single word ``Do\"Not\"Separate``);" +msgid "" +"Quote characters are not recognized within words (``Do\"Not\"Separate`` is " +"parsed as the single word ``Do\"Not\"Separate``);" msgstr "" +"نویسه‌های نقل‌قول درون کلمات تشخیص داده نمی‌شوند (``Do\"Not\"Separate`` " +"به‌عنوان کلمه‌ی واحد ``Do\"Not\"Separate`` تجزیه می‌شود)؛" msgid "Escape characters are not recognized;" -msgstr "" +msgstr "نویسه‌های خنثی‌سازی شناسایی نمی‌شوند؛" -msgid "Enclosing characters in quotes preserve the literal value of all characters within the quotes;" +msgid "" +"Enclosing characters in quotes preserve the literal value of all characters " +"within the quotes;" msgstr "" +"قرار دادن نویسه‌ها درون علامت‌های نقل‌قول، مقدار لفظی تمام نویسه‌های درون " +"علامت‌های نقل‌قول را حفظ می‌کند؛" -msgid "Closing quotes separate words (``\"Do\"Separate`` is parsed as ``\"Do\"`` and ``Separate``);" +msgid "" +"Closing quotes separate words (``\"Do\"Separate`` is parsed as ``\"Do\"`` " +"and ``Separate``);" msgstr "" +"علامت‌های نقل‌قول پایانی، واژه‌ها را جدا می‌کنند (``\"Do\"Separate`` به‌صورت" +" ``\"Do\"`` و ``Separate`` تجزیه می‌شود)؛" -msgid "If :attr:`~shlex.whitespace_split` is ``False``, any character not declared to be a word character, whitespace, or a quote will be returned as a single-character token. If it is ``True``, :class:`~shlex.shlex` will only split words in whitespaces;" +msgid "" +"If :attr:`~shlex.whitespace_split` is ``False``, any character not declared " +"to be a word character, whitespace, or a quote will be returned as a single-" +"character token. If it is ``True``, :class:`~shlex.shlex` will only split " +"words in whitespaces;" msgstr "" +"اگر :attr:`~shlex.whitespace_split` برابر ``False`` باشد، هر نویسه‌ای که " +"به‌عنوان نویسه کلمه‌ای، فضای سفید یا علامت نقل‌قول اعلام نشده باشد، به‌صورت " +"یک توکن تک‌نویسه‌ای برگردانده می‌شود. اگر ``True`` باشد، " +":class:`~shlex.shlex` فقط کلمات را بر اساس فضای سفید جدا می‌کند؛" msgid "EOF is signaled with an empty string (``''``);" -msgstr "" +msgstr "EOF با یک رشته خالی (``''``) اعلام می‌شود؛" msgid "It's not possible to parse empty strings, even if quoted." -msgstr "" +msgstr "تجزیه‌ی رشته‌های خالی ممکن نیست، حتی اگر داخل علامت نقل‌قول باشند." -msgid "When operating in POSIX mode, :class:`~shlex.shlex` will try to obey the following parsing rules." +msgid "" +"When operating in POSIX mode, :class:`~shlex.shlex` will try to obey the " +"following parsing rules." msgstr "" +"هنگام کار در حالت POSIX، :class:`~shlex.shlex` تلاش می‌کند از قواعد تجزیه " +"زیر پیروی کند." -msgid "Quotes are stripped out, and do not separate words (``\"Do\"Not\"Separate\"`` is parsed as the single word ``DoNotSeparate``);" +msgid "" +"Quotes are stripped out, and do not separate words " +"(``\"Do\"Not\"Separate\"`` is parsed as the single word ``DoNotSeparate``);" msgstr "" +"علامت‌های نقل‌قول حذف می‌شوند و کلمات را جدا نمی‌کنند " +"(``\"Do\"Not\"Separate\"`` به‌عنوان کلمه‌ی واحد ``DoNotSeparate`` تجزیه " +"می‌شود)؛" -msgid "Non-quoted escape characters (e.g. ``'\\'``) preserve the literal value of the next character that follows;" +msgid "" +"Non-quoted escape characters (e.g. ``'\\'``) preserve the literal value of " +"the next character that follows;" msgstr "" +"نویسه‌های خنثی‌سازی بدون علامت نقل‌قول (مثلاً ``'\\'``) مقدار تحت‌اللفظی " +"نویسه‌ای که پس از آن‌ها می‌آید را حفظ می‌کنند؛" -msgid "Enclosing characters in quotes which are not part of :attr:`~shlex.escapedquotes` (e.g. ``\"'\"``) preserve the literal value of all characters within the quotes;" +msgid "" +"Enclosing characters in quotes which are not part of " +":attr:`~shlex.escapedquotes` (e.g. ``\"'\"``) preserve the literal value of " +"all characters within the quotes;" msgstr "" +"قراردادن نویسه‌ها درون علامت‌های نقل‌قولی که بخشی از " +":attr:`~shlex.escapedquotes` نیستند (مانند ``\"'\"``) مقدار لفظی همه " +"نویسه‌های درون علامت‌های نقل‌قول را حفظ می‌کند؛" -msgid "Enclosing characters in quotes which are part of :attr:`~shlex.escapedquotes` (e.g. ``'\"'``) preserves the literal value of all characters within the quotes, with the exception of the characters mentioned in :attr:`~shlex.escape`. The escape characters retain their special meaning only when followed by the quote in use, or the escape character itself. Otherwise the escape character will be considered a normal character." -msgstr "" +msgid "" +"Enclosing characters in quotes which are part of " +":attr:`~shlex.escapedquotes` (e.g. ``'\"'``) preserves the literal value of " +"all characters within the quotes, with the exception of the characters " +"mentioned in :attr:`~shlex.escape`. The escape characters retain their " +"special meaning only when followed by the quote in use, or the escape " +"character itself. Otherwise the escape character will be considered a normal" +" character." +msgstr "" +"دربرگرفتن نویسه‌ها با علامت‌های نقل‌قولی که بخشی از " +":attr:`~shlex.escapedquotes` هستند (مثلاً ``'\"'``)، مقدار تحت‌اللفظی همه " +"نویسه‌های درون علامت‌های نقل‌قول را حفظ می‌کند، به‌جز نویسه‌های ذکرشده در " +":attr:`~shlex.escape`. نویسه‌های خنثی‌سازی معنای ویژه خود را فقط زمانی حفظ " +"می‌کنند که پس از آن‌ها علامت نقل‌قول مورد استفاده یا خود نویسه خنثی‌سازی " +"بیاید. در غیر این صورت، نویسه خنثی‌سازی یک نویسه معمولی در نظر گرفته می‌شود." msgid "EOF is signaled with a :const:`None` value;" -msgstr "" +msgstr "پایان فایل (EOF) با مقدار :const:`None` اعلام می‌شود؛" msgid "Quoted empty strings (``''``) are allowed." -msgstr "" +msgstr "رشته‌های خالی داخل علامت نقل‌قول (``''``) مجاز هستند." msgid "Improved Compatibility with Shells" -msgstr "" +msgstr "بهبود سازگاری با پوسته‌ها" -msgid "The :class:`shlex` class provides compatibility with the parsing performed by common Unix shells like ``bash``, ``dash``, and ``sh``. To take advantage of this compatibility, specify the ``punctuation_chars`` argument in the constructor. This defaults to ``False``, which preserves pre-3.6 behaviour. However, if it is set to ``True``, then parsing of the characters ``();<>|&`` is changed: any run of these characters is returned as a single token. While this is short of a full parser for shells (which would be out of scope for the standard library, given the multiplicity of shells out there), it does allow you to perform processing of command lines more easily than you could otherwise. To illustrate, you can see the difference in the following snippet:" -msgstr "" +msgid "" +"The :class:`shlex` class provides compatibility with the parsing performed " +"by common Unix shells like ``bash``, ``dash``, and ``sh``. To take " +"advantage of this compatibility, specify the ``punctuation_chars`` argument " +"in the constructor. This defaults to ``False``, which preserves pre-3.6 " +"behaviour. However, if it is set to ``True``, then parsing of the characters" +" ``();<>|&`` is changed: any run of these characters is returned as a single" +" token. While this is short of a full parser for shells (which would be out" +" of scope for the standard library, given the multiplicity of shells out " +"there), it does allow you to perform processing of command lines more easily" +" than you could otherwise. To illustrate, you can see the difference in the" +" following snippet:" +msgstr "" +"کلاس :class:`shlex` سازگاری با تجزیه‌ای را فراهم می‌کند که پوسته‌های رایج " +"یونیکس مانند ``bash``، ``dash`` و ``sh`` انجام می‌دهند. برای بهره‌مندی از " +"این سازگاری، آرگومان ``punctuation_chars`` را در سازنده مشخص کنید. مقدار " +"پیش‌فرض آن ``False`` است که رفتار پیش از 3.6 را حفظ می‌کند. با این حال، اگر " +"روی ``True`` تنظیم شود، تجزیه نویسه‌های ``();<>|&`` تغییر می‌کند: هر " +"دنباله‌ای از این نویسه‌ها به‌عنوان یک توکن واحد بازگردانده می‌شود. هرچند این" +" قابلیت به‌اندازه یک پارسر کامل برای پوسته‌ها نیست (که با توجه به تعدد " +"پوسته‌های موجود، خارج از حیطه کتابخانه استاندارد خواهد بود)، اما به شما " +"امکان می‌دهد پردازش خط‌های فرمان را آسان‌تر از آنچه در غیر این صورت ممکن بود" +" انجام دهید. برای نمایش، می‌توانید تفاوت را در قطعه کد زیر ببینید:" msgid "" ">>> import shlex\n" @@ -241,12 +615,33 @@ msgid "" "['a', '&&', 'b', ';', 'c', '&&', 'd', '||', 'e', ';', 'f', '>', 'abc', ';',\n" "'(', 'def', 'ghi', ')']" msgstr "" +">>> import shlex\n" +">>> text = \"a && b; c && d || e; f >'abc'; (def \\\"ghi\\\")\"\n" +">>> s = shlex.shlex(text, posix=True)\n" +">>> s.whitespace_split = True\n" +">>> list(s)\n" +"['a', '&&', 'b;', 'c', '&&', 'd', '||', 'e;', 'f', '>abc;', '(def', 'ghi)']\n" +">>> s = shlex.shlex(text, posix=True, punctuation_chars=True)\n" +">>> s.whitespace_split = True\n" +">>> list(s)\n" +"['a', '&&', 'b', ';', 'c', '&&', 'd', '||', 'e', ';', 'f', '>', 'abc', ';',\n" +"'(', 'def', 'ghi', ')']" -msgid "Of course, tokens will be returned which are not valid for shells, and you'll need to implement your own error checks on the returned tokens." +msgid "" +"Of course, tokens will be returned which are not valid for shells, and " +"you'll need to implement your own error checks on the returned tokens." msgstr "" +"البته، توکن‌هایی برگردانده خواهند شد که برای پوسته‌ها معتبر نیستند، و شما " +"باید بررسی‌های خطای خودتان را روی توکن‌های برگردانده‌شده پیاده‌سازی کنید." -msgid "Instead of passing ``True`` as the value for the punctuation_chars parameter, you can pass a string with specific characters, which will be used to determine which characters constitute punctuation. For example::" +msgid "" +"Instead of passing ``True`` as the value for the punctuation_chars " +"parameter, you can pass a string with specific characters, which will be " +"used to determine which characters constitute punctuation. For example::" msgstr "" +"به‌جای ارسال ``True`` به‌عنوان مقدار پارامتر punctuation_chars، می‌توانید " +"رشته‌ای با نویسه‌های مشخص را ارسال کنید که برای تعیین اینکه کدام نویسه‌ها " +"نمادگذاری محسوب می‌شوند، استفاده خواهد شد. برای مثال::" msgid "" ">>> import shlex\n" @@ -254,9 +649,21 @@ msgid "" ">>> list(s)\n" "['a', '&', '&', 'b', '||', 'c']" msgstr "" +">>> import shlex\n" +">>> s = shlex.shlex(\"a && b || c\", punctuation_chars=\"|\")\n" +">>> list(s)\n" +"['a', '&', '&', 'b', '||', 'c']" -msgid "When ``punctuation_chars`` is specified, the :attr:`~shlex.wordchars` attribute is augmented with the characters ``~-./*?=``. That is because these characters can appear in file names (including wildcards) and command-line arguments (e.g. ``--color=auto``). Hence::" +msgid "" +"When ``punctuation_chars`` is specified, the :attr:`~shlex.wordchars` " +"attribute is augmented with the characters ``~-./*?=``. That is because " +"these characters can appear in file names (including wildcards) and command-" +"line arguments (e.g. ``--color=auto``). Hence::" msgstr "" +"هنگامی که ``punctuation_chars`` مشخص شده باشد، نویسه‌های ``~-./*?=`` به " +"ویژگی :attr:`~shlex.wordchars` افزوده می‌شوند. دلیل آن این است که این " +"نویسه‌ها می‌توانند در نام فایل‌ها (از جمله وایلدکارد) و آرگومان‌های خط " +"فرمان ظاهر شوند (برای مثال ``--color=auto``). بنابراین::" msgid "" ">>> import shlex\n" @@ -265,9 +672,29 @@ msgid "" ">>> list(s)\n" "['~/a', '&&', 'b-c', '--color=auto', '||', 'd', '*.py?']" msgstr "" +">>> import shlex\n" +">>> s = shlex.shlex('~/a && b-c --color=auto || d *.py?',\n" +"... punctuation_chars=True)\n" +">>> list(s)\n" +"['~/a', '&&', 'b-c', '--color=auto', '||', 'd', '*.py?']" -msgid "However, to match the shell as closely as possible, it is recommended to always use ``posix`` and :attr:`~shlex.whitespace_split` when using :attr:`~shlex.punctuation_chars`, which will negate :attr:`~shlex.wordchars` entirely." +msgid "" +"However, to match the shell as closely as possible, it is recommended to " +"always use ``posix`` and :attr:`~shlex.whitespace_split` when using " +":attr:`~shlex.punctuation_chars`, which will negate :attr:`~shlex.wordchars`" +" entirely." msgstr "" +"با این حال، برای بیشترین تطابق ممکن با پوسته، توصیه می‌شود هنگام استفاده از " +":attr:`~shlex.punctuation_chars <~shlex.whitespace_split>` همیشه از " +"``posix`` و :attr:`~shlex.whitespace_split <~shlex.punctuation_chars>` " +"استفاده کنید، که این کار :attr:`~shlex.wordchars` را به‌طور کامل بی‌اثر " +"می‌کند." -msgid "For best effect, ``punctuation_chars`` should be set in conjunction with ``posix=True``. (Note that ``posix=False`` is the default for :class:`~shlex.shlex`.)" +msgid "" +"For best effect, ``punctuation_chars`` should be set in conjunction with " +"``posix=True``. (Note that ``posix=False`` is the default for " +":class:`~shlex.shlex`.)" msgstr "" +"برای بهترین نتیجه، ``punctuation_chars`` باید همراه با ``posix=True`` تنظیم " +"شود. (توجه داشته باشید که ``posix=False`` برای :class:`~shlex.shlex` پیش‌فرض" +" است.)" diff --git a/library/shutil.po b/library/shutil.po index 7112314f9..717d0bf3b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -23,344 +23,932 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!shutil` --- High-level file operations" -msgstr "" +msgstr ":mod:`!shutil` --- عملیات فایل سطح‌بالا" msgid "**Source code:** :source:`Lib/shutil.py`" -msgstr "" +msgstr ":source:`Lib/shutil.py`" -msgid "The :mod:`!shutil` module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal. For operations on individual files, see also the :mod:`os` module." +msgid "" +"The :mod:`!shutil` module offers a number of high-level operations on files " +"and collections of files. In particular, functions are provided which " +"support file copying and removal. For operations on individual files, see " +"also the :mod:`os` module." msgstr "" +"ماژول :mod:`!shutil` تعدادی عملیات سطح بالا روی فایل‌ها و مجموعه‌هایی از " +"فایل‌ها ارائه می‌دهد. به‌ویژه، توابعی فراهم شده‌اند که از کپی و حذف فایل " +"پشتیبانی می‌کنند. برای عملیات روی فایل‌های منفرد، ماژول :mod:`os` را نیز " +"ببینید." -msgid "Even the higher-level file copying functions (:func:`shutil.copy`, :func:`shutil.copy2`) cannot copy all file metadata." +msgid "" +"Even the higher-level file copying functions (:func:`shutil.copy`, " +":func:`shutil.copy2`) cannot copy all file metadata." msgstr "" +"حتی توابع سطح بالاتر کپی فایل (:func:`shutil.copy`، :func:`shutil.copy2`) " +"نمی‌توانند تمام فراداده‌های فایل را کپی کنند." -msgid "On POSIX platforms, this means that file owner and group are lost as well as ACLs. On Mac OS, the resource fork and other metadata are not used. This means that resources will be lost and file type and creator codes will not be correct. On Windows, file owners, ACLs and alternate data streams are not copied." -msgstr "" +msgid "" +"On POSIX platforms, this means that file owner and group are lost as well as" +" ACLs. On Mac OS, the resource fork and other metadata are not used. This " +"means that resources will be lost and file type and creator codes will not " +"be correct. On Windows, file owners, ACLs and alternate data streams are not" +" copied." +msgstr "" +"در پلتفرم‌های POSIX، این بدان معناست که مالک و گروه فایل و همچنین فهرست‌های " +"کنترل دسترسی (ACL) از دست می‌روند. در Mac OS، شاخه‌ی منبع (resource fork) و " +"سایر فراداده‌ها استفاده نمی‌شوند. این بدان معناست که منابع از دست خواهند رفت" +" و کدهای نوع فایل و ایجادکننده صحیح نخواهند بود. در Windows، مالکان فایل، " +"فهرست‌های کنترل دسترسی (ACL) و جریان‌های داده جایگزین (alternate data " +"streams) کپی نمی‌شوند." msgid "Directory and files operations" -msgstr "" +msgstr "عملیات پوشه‌ها و فایل‌ها" -msgid "Copy the contents of the :term:`file-like object ` *fsrc* to the file-like object *fdst*. The integer *length*, if given, is the buffer size. In particular, a negative *length* value means to copy the data without looping over the source data in chunks; by default the data is read in chunks to avoid uncontrolled memory consumption. Note that if the current file position of the *fsrc* object is not 0, only the contents from the current file position to the end of the file will be copied." -msgstr "" +msgid "" +"Copy the contents of the :term:`file-like object ` *fsrc* to " +"the file-like object *fdst*. The integer *length*, if given, is the buffer " +"size. In particular, a negative *length* value means to copy the data " +"without looping over the source data in chunks; by default the data is read " +"in chunks to avoid uncontrolled memory consumption. Note that if the current" +" file position of the *fsrc* object is not 0, only the contents from the " +"current file position to the end of the file will be copied." +msgstr "" +"محتویات :term:`شیء فایل‌مانند ` *fsrc* را به شیء فایل‌مانند " +"*fdst* کپی کنید. عدد صحیح *length*، اگر داده شود، اندازه‌ی بافر است. به‌ویژه،" +" مقدار منفی *length* به معنای کپی کردن داده‌ها بدون حلقه‌زدن روی داده‌های " +"منبع به‌صورت تکه‌تکه است؛ به‌طور پیش‌فرض، داده‌ها به‌صورت تکه‌تکه خوانده " +"می‌شوند تا از مصرف حافظه‌ی کنترل‌نشده جلوگیری شود. توجه داشته باشید که اگر " +"موقعیت فعلی فایل در شیء *fsrc* برابر ۰ نباشد، تنها محتویات از موقعیت فعلی " +"فایل تا پایان پرونده کپی خواهند شد." -msgid ":func:`copyfileobj` will *not* guarantee that the destination stream has been flushed on completion of the copy. If you want to read from the destination at the completion of the copy operation (for example, reading the contents of a temporary file that has been copied from a HTTP stream), you must ensure that you have called :func:`~io.IOBase.flush` or :func:`~io.IOBase.close` on the file-like object before attempting to read the destination file." -msgstr "" +msgid "" +":func:`copyfileobj` will *not* guarantee that the destination stream has " +"been flushed on completion of the copy. If you want to read from the " +"destination at the completion of the copy operation (for example, reading " +"the contents of a temporary file that has been copied from a HTTP stream), " +"you must ensure that you have called :func:`~io.IOBase.flush` or " +":func:`~io.IOBase.close` on the file-like object before attempting to read " +"the destination file." +msgstr "" +":func:`copyfileobj` ضمانت *نمی‌کند* که جریان مقصد در پایان کپی تخلیه شده " +"باشد. اگر می‌خواهید در پایان عملیات کپی از مقصد بخوانید (برای مثال، محتوای " +"یک فایل موقت را بخوانید که از یک جریان HTTP کپی شده است)، باید اطمینان حاصل " +"کنید که پیش از تلاش برای خواندن فایل مقصد، :func:`~io.IOBase.flush` یا " +":func:`~io.IOBase.close` را روی شیء فایل‌مانند فراخوانی کرده‌اید." -msgid "Copy the contents (no metadata) of the file named *src* to a file named *dst* and return *dst* in the most efficient way possible. *src* and *dst* are :term:`path-like objects ` or path names given as strings." +msgid "" +"Copy the contents (no metadata) of the file named *src* to a file named " +"*dst* and return *dst* in the most efficient way possible. *src* and *dst* " +"are :term:`path-like objects ` or path names given as " +"strings." msgstr "" +"محتوای فایلی به نام *src* (بدون فراداده) را در فایلی به نام *dst* کپی می‌کند" +" و *dst* را به کارآمدترین شکل ممکن برمی‌گرداند. *src* و *dst* یا " +":term:`اشیاء مسیرمانند (path-like objects) ` هستند یا " +"نام‌های مسیری که به‌صورت رشته داده شده‌اند." -msgid "*dst* must be the complete target file name; look at :func:`~shutil.copy` for a copy that accepts a target directory path. If *src* and *dst* specify the same file, :exc:`SameFileError` is raised." +msgid "" +"*dst* must be the complete target file name; look at :func:`~shutil.copy` " +"for a copy that accepts a target directory path. If *src* and *dst* specify" +" the same file, :exc:`SameFileError` is raised." msgstr "" +"*dst* باید نام کامل فایل مقصد باشد؛ برای کپی‌ای که مسیر پوشه مقصد را " +"می‌پذیرد، به :func:`~shutil.copy` مراجعه کنید. اگر *src* و *dst* یک فایل را " +"مشخص کنند، :exc:`SameFileError` پرتاب می‌شود." -msgid "The destination location must be writable; otherwise, an :exc:`OSError` exception will be raised. If *dst* already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this function." +msgid "" +"The destination location must be writable; otherwise, an :exc:`OSError` " +"exception will be raised. If *dst* already exists, it will be replaced. " +"Special files such as character or block devices and pipes cannot be copied " +"with this function." msgstr "" +"محل مقصد باید قابل نوشتن باشد؛ در غیر این صورت، استثنای :exc:`OSError` پرتاب" +" خواهد شد. اگر *dst* از قبل وجود داشته باشد، جایگزین خواهد شد. فایل‌های خاص " +"مانند دستگاه‌های نویسه‌ای یا بلوکی و پایپ‌ها را نمی‌توان با این تابع کپی " +"کرد." -msgid "If *follow_symlinks* is false and *src* is a symbolic link, a new symbolic link will be created instead of copying the file *src* points to." +msgid "" +"If *follow_symlinks* is false and *src* is a symbolic link, a new symbolic " +"link will be created instead of copying the file *src* points to." msgstr "" +"اگر *follow_symlinks* نادرست باشد و *src* یک پیوند نمادین باشد، به‌جای کپی " +"کردن فایلی که *src* به آن اشاره دارد، یک پیوند نمادین جدید ایجاد خواهد شد." -msgid "Raises an :ref:`auditing event ` ``shutil.copyfile`` with arguments ``src``, ``dst``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.copyfile`` with " +"arguments ``src``, ``dst``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.copyfile`` را با آرگومان‌های " +"``src`` و ``dst`` پرتاب می‌کند." -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`. Added *follow_symlinks* argument. Now returns *dst*." +msgid "" +":exc:`IOError` used to be raised instead of :exc:`OSError`. Added " +"*follow_symlinks* argument. Now returns *dst*." msgstr "" +"پیش‌تر :exc:`IOError` به جای :exc:`OSError` پرتاب می‌شد. آرگومان " +"*follow_symlinks* افزوده شد. اکنون *dst* را برمی‌گرداند." -msgid "Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is a subclass of the latter, this change is backward compatible." +msgid "" +"Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is a " +"subclass of the latter, this change is backward compatible." msgstr "" +":exc:`SameFileError` به‌جای :exc:`Error` پرتاب می‌شود. از آن‌جا که اولی " +"زیرکلاسی از دومی است، این تغییر سازگار با عقب است." -msgid "Platform-specific fast-copy syscalls may be used internally in order to copy the file more efficiently. See :ref:`shutil-platform-dependent-efficient-copy-operations` section." +msgid "" +"Platform-specific fast-copy syscalls may be used internally in order to copy" +" the file more efficiently. See :ref:`shutil-platform-dependent-efficient-" +"copy-operations` section." msgstr "" +"ممکن است از فراخوانی‌های سیستمی کپی سریع مختص پلتفرم به‌صورت داخلی استفاده " +"شود تا فایل با کارایی بیشتری کپی شود. بخش :ref:`shutil-platform-dependent-" +"efficient-copy-operations` را ببینید." -msgid "This exception is raised when :func:`copyfile` or :func:`copytree` attempt to copy a named pipe." +msgid "" +"This exception is raised when :func:`copyfile` or :func:`copytree` attempt " +"to copy a named pipe." msgstr "" +"این استثنا هنگامی پرتاب می‌شود که :func:`copyfile` یا :func:`copytree` برای " +"کپی کردن یک پایپ نام‌دار تلاش کند." -msgid "This exception is raised if source and destination in :func:`copyfile` are the same file." +msgid "" +"This exception is raised if source and destination in :func:`copyfile` are " +"the same file." msgstr "" +"این استثنا زمانی پرتاب می‌شود که مبدأ و مقصد در :func:`copyfile` یک فایل " +"باشند." -msgid "Copy the permission bits from *src* to *dst*. The file contents, owner, and group are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings. If *follow_symlinks* is false, and both *src* and *dst* are symbolic links, :func:`copymode` will attempt to modify the mode of *dst* itself (rather than the file it points to). This functionality is not available on every platform; please see :func:`copystat` for more information. If :func:`copymode` cannot modify symbolic links on the local platform, and it is asked to do so, it will do nothing and return." -msgstr "" +msgid "" +"Copy the permission bits from *src* to *dst*. The file contents, owner, and" +" group are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings. If *follow_symlinks* is false," +" and both *src* and *dst* are symbolic links, :func:`copymode` will attempt " +"to modify the mode of *dst* itself (rather than the file it points to). " +"This functionality is not available on every platform; please see " +":func:`copystat` for more information. If :func:`copymode` cannot modify " +"symbolic links on the local platform, and it is asked to do so, it will do " +"nothing and return." +msgstr "" +"بیت‌های دسترسی را از *src* به *dst* کپی می‌کند. محتوای فایل، مالک و گروه " +"بدون تغییر باقی می‌مانند. *src* و *dst* :term:`اشیای شبه‌مسیر ` یا نام‌های مسیر هستند که به‌صورت رشته داده شده‌اند. اگر " +"*follow_symlinks* نادرست باشد و هر دو *src* و *dst* پیوندهای نمادین باشند، " +":func:`copymode` تلاش می‌کند حالت خود *dst* را تغییر دهد (نه فایلی که به آن " +"اشاره می‌کند). این قابلیت در همه سکوها در دسترس نیست؛ لطفاً برای اطلاعات " +"بیشتر :func:`copystat` را ببینید. اگر :func:`copymode` نتواند پیوندهای " +"نمادین را در سکوی محلی تغییر دهد و از آن خواسته شود که این کار را انجام دهد،" +" هیچ کاری انجام نمی‌دهد و بازمی‌گردد." -msgid "Raises an :ref:`auditing event ` ``shutil.copymode`` with arguments ``src``, ``dst``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.copymode`` with " +"arguments ``src``, ``dst``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.copymode`` را با آرگومان‌های " +"``src`` و ``dst`` پرتاب می‌کند." msgid "Added *follow_symlinks* argument." -msgstr "" +msgstr "آرگومان *follow_symlinks* افزوده شد." -msgid "Copy the permission bits, last access time, last modification time, and flags from *src* to *dst*. On Linux, :func:`copystat` also copies the \"extended attributes\" where possible. The file contents, owner, and group are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings." -msgstr "" +msgid "" +"Copy the permission bits, last access time, last modification time, and " +"flags from *src* to *dst*. On Linux, :func:`copystat` also copies the " +"\"extended attributes\" where possible. The file contents, owner, and group" +" are unaffected. *src* and *dst* are :term:`path-like objects ` or path names given as strings." +msgstr "" +"بیت‌های اجازه، زمان آخرین دسترسی، زمان آخرین تغییر و پرچم‌ها را از *src* به " +"*dst* کپی می‌کند. در لینوکس، :func:`copystat` همچنین «ویژگی‌های توسعه‌یافته»" +" را در صورت امکان کپی می‌کند. محتوای فایل، مالک و گروه بدون تغییر می‌مانند. " +"*src* و *dst* :term:`اشیاء مسیرمانند ` یا نام‌های مسیر " +"داده‌شده به‌صورت رشته هستند." -msgid "If *follow_symlinks* is false, and *src* and *dst* both refer to symbolic links, :func:`copystat` will operate on the symbolic links themselves rather than the files the symbolic links refer to—reading the information from the *src* symbolic link, and writing the information to the *dst* symbolic link." +msgid "" +"If *follow_symlinks* is false, and *src* and *dst* both refer to symbolic " +"links, :func:`copystat` will operate on the symbolic links themselves rather" +" than the files the symbolic links refer to—reading the information from the" +" *src* symbolic link, and writing the information to the *dst* symbolic " +"link." msgstr "" +"اگر *follow_symlinks* نادرست باشد و *src* و *dst* هر دو به پیوندهای نمادین " +"اشاره کنند، :func:`copystat` به‌جای فایل‌هایی که پیوندهای نمادین به آن‌ها " +"اشاره می‌کنند، روی خود پیوندهای نمادین عمل می‌کند؛ اطلاعات را از پیوند " +"نمادین *src* می‌خواند و اطلاعات را در پیوند نمادین *dst* می‌نویسد." -msgid "Not all platforms provide the ability to examine and modify symbolic links. Python itself can tell you what functionality is locally available." +msgid "" +"Not all platforms provide the ability to examine and modify symbolic links." +" Python itself can tell you what functionality is locally available." msgstr "" +"همه‌ی سکوها امکان بررسی و تغییر پیوندهای نمادین را فراهم نمی‌کنند. خود " +"پایتون می‌تواند به شما بگوید چه قابلیت‌هایی به‌صورت محلی در دسترس است." -msgid "If ``os.chmod in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the permission bits of a symbolic link." +msgid "" +"If ``os.chmod in os.supports_follow_symlinks`` is ``True``, :func:`copystat`" +" can modify the permission bits of a symbolic link." msgstr "" +"اگر ``os.chmod in os.supports_follow_symlinks`` برابر ``True`` باشد، " +":func:`copystat` می‌تواند بیت‌های دسترسی یک پیوند نمادین را تغییر دهد." -msgid "If ``os.utime in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the last access and modification times of a symbolic link." +msgid "" +"If ``os.utime in os.supports_follow_symlinks`` is ``True``, :func:`copystat`" +" can modify the last access and modification times of a symbolic link." msgstr "" +"اگر ``os.utime in os.supports_follow_symlinks`` برابر ``True`` باشد، " +":func:`copystat` می‌تواند زمان‌های آخرین دسترسی و تغییر یک پیوند نمادین را " +"تغییر دهد." -msgid "If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not available on all platforms.)" +msgid "" +"If ``os.chflags in os.supports_follow_symlinks`` is ``True``, " +":func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` " +"is not available on all platforms.)" msgstr "" +"اگر ``os.chflags in os.supports_follow_symlinks`` برابر ``True`` باشد، " +":func:`copystat` می‌تواند پرچم‌های یک پیوند نمادین را تغییر دهد. " +"(``os.chflags`` در همه‌ی سکوها در دسترس نیست.)" -msgid "On platforms where some or all of this functionality is unavailable, when asked to modify a symbolic link, :func:`copystat` will copy everything it can. :func:`copystat` never returns failure." +msgid "" +"On platforms where some or all of this functionality is unavailable, when " +"asked to modify a symbolic link, :func:`copystat` will copy everything it " +"can. :func:`copystat` never returns failure." msgstr "" +"در سکوهایی که برخی یا همه‌ی این قابلیت‌ها در دسترس نیستند، هنگامی که از آن " +"خواسته شود یک پیوند نمادین را تغییر دهد، :func:`copystat` هر آنچه را که " +"بتواند کپی می‌کند. :func:`copystat` هرگز شکست برنمی‌گرداند." msgid "Please see :data:`os.supports_follow_symlinks` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، :data:`os.supports_follow_symlinks` را ببینید." -msgid "Raises an :ref:`auditing event ` ``shutil.copystat`` with arguments ``src``, ``dst``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.copystat`` with " +"arguments ``src``, ``dst``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.copystat`` را با آرگومان‌های " +"``src``، ``dst`` پرتاب می‌کند." -msgid "Added *follow_symlinks* argument and support for Linux extended attributes." +msgid "" +"Added *follow_symlinks* argument and support for Linux extended attributes." msgstr "" +"آرگومان *follow_symlinks* و پشتیبانی از ویژگی‌های گسترده‌ی لینوکس افزوده شد." -msgid "Copies the file *src* to the file or directory *dst*. *src* and *dst* should be :term:`path-like objects ` or strings. If *dst* specifies a directory, the file will be copied into *dst* using the base filename from *src*. If *dst* specifies a file that already exists, it will be replaced. Returns the path to the newly created file." -msgstr "" +msgid "" +"Copies the file *src* to the file or directory *dst*. *src* and *dst* " +"should be :term:`path-like objects ` or strings. If *dst*" +" specifies a directory, the file will be copied into *dst* using the base " +"filename from *src*. If *dst* specifies a file that already exists, it will " +"be replaced. Returns the path to the newly created file." +msgstr "" +"فایل *src* را به فایل یا پوشه‌ی *dst* کپی می‌کند. *src* و *dst* باید " +":term:`اشیای مسیرمانند (path-like object) ` یا رشته‌ها " +"باشند. اگر *dst* یک پوشه را مشخص کند، فایل با استفاده از نام پایه‌ی فایل " +"*src* در *dst* کپی خواهد شد. اگر *dst* فایلی را مشخص کند که از قبل وجود " +"دارد، آن فایل جایگزین خواهد شد. مسیر فایل تازه ایجادشده را برمی‌گرداند." -msgid "If *follow_symlinks* is false, and *src* is a symbolic link, *dst* will be created as a symbolic link. If *follow_symlinks* is true and *src* is a symbolic link, *dst* will be a copy of the file *src* refers to." +msgid "" +"If *follow_symlinks* is false, and *src* is a symbolic link, *dst* will be " +"created as a symbolic link. If *follow_symlinks* is true and *src* is a " +"symbolic link, *dst* will be a copy of the file *src* refers to." msgstr "" +"اگر *follow_symlinks* نادرست باشد و *src* یک پیوند نمادین باشد، *dst* " +"به‌صورت یک پیوند نمادین ایجاد می‌شود. اگر *follow_symlinks* درست باشد و " +"*src* یک پیوند نمادین باشد، *dst* یک کپی از فایلی خواهد بود که *src* به آن " +"ارجاع می‌دهد." -msgid ":func:`~shutil.copy` copies the file data and the file's permission mode (see :func:`os.chmod`). Other metadata, like the file's creation and modification times, is not preserved. To preserve all file metadata from the original, use :func:`~shutil.copy2` instead." +msgid "" +":func:`~shutil.copy` copies the file data and the file's permission mode " +"(see :func:`os.chmod`). Other metadata, like the file's creation and " +"modification times, is not preserved. To preserve all file metadata from the" +" original, use :func:`~shutil.copy2` instead." msgstr "" +":func:`~shutil.copy` داده‌های فایل و حالت دسترسی فایل (نگاه کنید به " +":func:`os.chmod`) را کپی می‌کند. سایر فراداده‌ها، مانند زمان‌های ایجاد و " +"تغییر فایل، حفظ نمی‌شوند. برای حفظ تمام فراداده‌های فایل اصلی، به‌جای آن از " +":func:`~shutil.copy2` استفاده کنید." -msgid "Added *follow_symlinks* argument. Now returns path to the newly created file." +msgid "" +"Added *follow_symlinks* argument. Now returns path to the newly created " +"file." msgstr "" +"آرگومان *follow_symlinks* اضافه شد. اکنون مسیر فایل تازه ایجادشده را " +"برمی‌گرداند." -msgid "Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to preserve file metadata." +msgid "" +"Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to" +" preserve file metadata." msgstr "" +"مشابه :func:`~shutil.copy` است، با این تفاوت که :func:`copy2` همچنین تلاش " +"می‌کند فراداده فایل را حفظ کند." -msgid "When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2` attempts to copy all metadata from the *src* symbolic link to the newly created *dst* symbolic link. However, this functionality is not available on all platforms. On platforms where some or all of this functionality is unavailable, :func:`copy2` will preserve all the metadata it can; :func:`copy2` never raises an exception because it cannot preserve file metadata." -msgstr "" +msgid "" +"When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2`" +" attempts to copy all metadata from the *src* symbolic link to the newly " +"created *dst* symbolic link. However, this functionality is not available on" +" all platforms. On platforms where some or all of this functionality is " +"unavailable, :func:`copy2` will preserve all the metadata it can; " +":func:`copy2` never raises an exception because it cannot preserve file " +"metadata." +msgstr "" +"هنگامی که *follow_symlinks* false باشد و *src* یک پیوند نمادین باشد، " +":func:`copy2` تلاش می‌کند همه‌ی فراداده‌ها را از پیوند نمادین *src* به پیوند " +"نمادین تازه‌ایجادشده‌ی *dst* کپی کند. با این حال، این قابلیت در همه‌ی سکوها " +"در دسترس نیست. در سکوهایی که بخشی یا همه‌ی این قابلیت در دسترس نیست، " +":func:`copy2` همه‌ی فراداده‌ای را که بتواند حفظ می‌کند؛ :func:`copy2` هرگز به" +" این دلیل که نمی‌تواند فراداده‌ی فایل را حفظ کند، استثنایی پرتاب نمی‌کند." -msgid ":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see :func:`copystat` for more information about platform support for modifying symbolic link metadata." +msgid "" +":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see " +":func:`copystat` for more information about platform support for modifying " +"symbolic link metadata." msgstr "" +":func:`copy2` از :func:`copystat` برای کپی فراداده فایل استفاده می‌کند. " +"لطفاً برای اطلاعات بیشتر درباره پشتیبانی پلتفرم از تغییر فراداده پیوند " +"نمادین، :func:`copystat` را ببینید." -msgid "Added *follow_symlinks* argument, try to copy extended file system attributes too (currently Linux only). Now returns path to the newly created file." +msgid "" +"Added *follow_symlinks* argument, try to copy extended file system " +"attributes too (currently Linux only). Now returns path to the newly created" +" file." msgstr "" +"آرگومان *follow_symlinks* افزوده شد، سعی می‌کند ویژگی‌های گسترش‌یافته‌ی " +"سیستم‌فایل را نیز کپی کند (در حال حاضر فقط در لینوکس). اکنون مسیر فایل " +"تازه‌ایجادشده را برمی‌گرداند." -msgid "This factory function creates a function that can be used as a callable for :func:`copytree`\\'s *ignore* argument, ignoring files and directories that match one of the glob-style *patterns* provided. See the example below." +msgid "" +"This factory function creates a function that can be used as a callable for " +":func:`copytree`\\'s *ignore* argument, ignoring files and directories that " +"match one of the glob-style *patterns* provided. See the example below." msgstr "" +"این تابع کارخانه‌ای، تابعی ایجاد می‌کند که می‌توان از آن به‌عنوان یک شیء " +"فراخوانی‌پذیر برای آرگومان *ignore* تابع :func:`copytree` استفاده کرد؛ این " +"تابع، فایل‌ها و پوشه‌هایی را که با یکی از الگوهای به‌سبک glob ارائه‌شده در " +"*patterns* مطابقت دارند، نادیده می‌گیرد. مثال زیر را ببینید." -msgid "Recursively copy an entire directory tree rooted at *src* to a directory named *dst* and return the destination directory. All intermediate directories needed to contain *dst* will also be created by default." +msgid "" +"Recursively copy an entire directory tree rooted at *src* to a directory " +"named *dst* and return the destination directory. All intermediate " +"directories needed to contain *dst* will also be created by default." msgstr "" +"به‌صورت بازگشتی کل درخت پوشه‌ای را که ریشه در *src* دارد، به پوشه‌ای به نام " +"*dst* کپی کنید و پوشه مقصد را برگردانید. تمام پوشه‌های میانی لازم برای " +"دربرگرفتن *dst* نیز به‌طور پیش‌فرض ایجاد خواهند شد." -msgid "Permissions and times of directories are copied with :func:`copystat`, individual files are copied using :func:`~shutil.copy2`." +msgid "" +"Permissions and times of directories are copied with :func:`copystat`, " +"individual files are copied using :func:`~shutil.copy2`." msgstr "" +"مجوزها و زمان‌های پوشه‌ها با :func:`copystat` کپی می‌شوند، فایل‌های جداگانه " +"با استفاده از :func:`~shutil.copy2` کپی می‌شوند." -msgid "If *symlinks* is true, symbolic links in the source tree are represented as symbolic links in the new tree and the metadata of the original links will be copied as far as the platform allows; if false or omitted, the contents and metadata of the linked files are copied to the new tree." +msgid "" +"If *symlinks* is true, symbolic links in the source tree are represented as " +"symbolic links in the new tree and the metadata of the original links will " +"be copied as far as the platform allows; if false or omitted, the contents " +"and metadata of the linked files are copied to the new tree." msgstr "" +"اگر *symlinks* درست باشد، پیوندهای نمادین در درخت منبع به‌صورت پیوندهای " +"نمادین در درخت جدید نمایش داده می‌شوند و فراداده‌ی پیوندهای اصلی تا جایی که " +"سکو اجازه می‌دهد کپی خواهد شد؛ اگر نادرست باشد یا ذکر نشود، محتوا و " +"فراداده‌ی فایل‌های پیوندشده به درخت جدید کپی می‌شوند." -msgid "When *symlinks* is false, if the file pointed to by the symlink doesn't exist, an exception will be added in the list of errors raised in an :exc:`Error` exception at the end of the copy process. You can set the optional *ignore_dangling_symlinks* flag to true if you want to silence this exception. Notice that this option has no effect on platforms that don't support :func:`os.symlink`." -msgstr "" +msgid "" +"When *symlinks* is false, if the file pointed to by the symlink doesn't " +"exist, an exception will be added in the list of errors raised in an " +":exc:`Error` exception at the end of the copy process. You can set the " +"optional *ignore_dangling_symlinks* flag to true if you want to silence this" +" exception. Notice that this option has no effect on platforms that don't " +"support :func:`os.symlink`." +msgstr "" +"هنگامی که *symlinks* نادرست باشد، اگر فایلی که پیوند نمادین به آن اشاره " +"می‌کند وجود نداشته باشد، استثنایی به فهرست خطاهایی که در پایان فرآیند کپی " +"در یک استثنای :exc:`Error` پرتاب می‌شود، افزوده خواهد شد. اگر می‌خواهید این " +"استثنا را نادیده بگیرید، می‌توانید پرچم اختیاری *ignore_dangling_symlinks* " +"را روی درست تنظیم کنید. توجه داشته باشید که این گزینه روی پلتفرم‌هایی که از " +":func:`os.symlink` پشتیبانی نمی‌کنند، تأثیری ندارد." -msgid "If *ignore* is given, it must be a callable that will receive as its arguments the directory being visited by :func:`copytree`, and a list of its contents, as returned by :func:`os.listdir`. Since :func:`copytree` is called recursively, the *ignore* callable will be called once for each directory that is copied. The callable must return a sequence of directory and file names relative to the current directory (i.e. a subset of the items in its second argument); these names will then be ignored in the copy process. :func:`ignore_patterns` can be used to create such a callable that ignores names based on glob-style patterns." -msgstr "" +msgid "" +"If *ignore* is given, it must be a callable that will receive as its " +"arguments the directory being visited by :func:`copytree`, and a list of its" +" contents, as returned by :func:`os.listdir`. Since :func:`copytree` is " +"called recursively, the *ignore* callable will be called once for each " +"directory that is copied. The callable must return a sequence of directory " +"and file names relative to the current directory (i.e. a subset of the items" +" in its second argument); these names will then be ignored in the copy " +"process. :func:`ignore_patterns` can be used to create such a callable that" +" ignores names based on glob-style patterns." +msgstr "" +"اگر *ignore* داده شود، باید یک شیء فراخوان‌پذیر باشد که به‌عنوان آرگومان‌های" +" خود، پوشه‌ای را که :func:`copytree` از آن بازدید می‌کند و فهرستی از محتویات" +" آن را، همان‌طور که :func:`os.listdir` برمی‌گرداند، دریافت می‌کند. از آن‌جا " +"که :func:`copytree` به‌صورت بازگشتی فراخوانی می‌شود، شیء فراخوان‌پذیر " +"*ignore* به‌ازای هر پوشه‌ای که کپی می‌شود، یک بار فراخوانی خواهد شد. این شیء" +" فراخوان‌پذیر باید دنباله‌ای از نام پوشه‌ها و فایل‌ها را نسبت به پوشه جاری " +"برگرداند (یعنی زیرمجموعه‌ای از آیتم‌های آرگومان دوم خود)؛ سپس این نام‌ها در " +"فرایند کپی نادیده گرفته خواهند شد. می‌توان از :func:`ignore_patterns` برای " +"ایجاد چنین شیء فراخوان‌پذیری استفاده کرد که نام‌ها را بر اساس الگوهای به‌سبک" +" glob نادیده می‌گیرد." -msgid "If exception(s) occur, an :exc:`Error` is raised with a list of reasons." +msgid "" +"If exception(s) occur, an :exc:`Error` is raised with a list of reasons." msgstr "" +"اگر استثنا(هایی) رخ دهد، یک :exc:`Error` همراه با فهرستی از دلایل پرتاب " +"می‌شود." -msgid "If *copy_function* is given, it must be a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, :func:`~shutil.copy2` is used, but any function that supports the same signature (like :func:`~shutil.copy`) can be used." +msgid "" +"If *copy_function* is given, it must be a callable that will be used to copy" +" each file. It will be called with the source path and the destination path " +"as arguments. By default, :func:`~shutil.copy2` is used, but any function " +"that supports the same signature (like :func:`~shutil.copy`) can be used." msgstr "" +"اگر *copy_function* ارائه شود، باید یک شیء قابل فراخوانی باشد که برای کپی " +"کردن هر فایل از آن استفاده می‌شود. این شیء با مسیر مبدأ و مسیر مقصد به‌عنوان" +" آرگومان‌ها فراخوانی می‌شود. به‌طور پیش‌فرض، :func:`~shutil.copy2` استفاده " +"می‌شود، اما هر تابعی که از همان امضا پشتیبانی کند (مانند " +":func:`~shutil.copy`) می‌تواند استفاده شود." -msgid "If *dirs_exist_ok* is false (the default) and *dst* already exists, a :exc:`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying operation will continue if it encounters existing directories, and files within the *dst* tree will be overwritten by corresponding files from the *src* tree." +msgid "" +"If *dirs_exist_ok* is false (the default) and *dst* already exists, a " +":exc:`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " +"operation will continue if it encounters existing directories, and files " +"within the *dst* tree will be overwritten by corresponding files from the " +"*src* tree." msgstr "" +"اگر *dirs_exist_ok* نادرست (پیش‌فرض) باشد و *dst* از قبل وجود داشته باشد، " +"استثنای :exc:`FileExistsError` پرتاب می‌شود. اگر *dirs_exist_ok* درست باشد، " +"عملیات کپی در صورت مواجهه با پوشه‌های موجود ادامه می‌یابد و فایل‌های درون " +"درخت *dst* توسط فایل‌های متناظر از درخت *src* بازنویسی می‌شوند." -msgid "Raises an :ref:`auditing event ` ``shutil.copytree`` with arguments ``src``, ``dst``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.copytree`` with " +"arguments ``src``, ``dst``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.copytree`` را با آرگومان‌های " +"``src`` و ``dst`` پرتاب می‌کند." -msgid "Added the *copy_function* argument to be able to provide a custom copy function. Added the *ignore_dangling_symlinks* argument to silence dangling symlinks errors when *symlinks* is false." +msgid "" +"Added the *copy_function* argument to be able to provide a custom copy " +"function. Added the *ignore_dangling_symlinks* argument to silence dangling " +"symlinks errors when *symlinks* is false." msgstr "" +"آرگومان *copy_function* افزوده شد تا بتوانید یک تابع کپی سفارشی ارائه دهید. " +"آرگومان *ignore_dangling_symlinks* افزوده شد تا خطاهای پیوندهای نمادین معلق " +"را هنگامی که *symlinks* برابر با false است، ساکت کند." msgid "Copy metadata when *symlinks* is false. Now returns *dst*." msgstr "" +"هنگامی که *symlinks* نادرست باشد، فراداده کپی می‌شود. اکنون *dst* را " +"برمی‌گرداند." msgid "Added the *dirs_exist_ok* parameter." -msgstr "" +msgstr "پارامتر *dirs_exist_ok* افزوده شد." -msgid "Delete an entire directory tree; *path* must point to a directory (but not a symbolic link to a directory). If *ignore_errors* is true, errors resulting from failed removals will be ignored; if false or omitted, such errors are handled by calling a handler specified by *onexc* or *onerror* or, if both are omitted, exceptions are propagated to the caller." -msgstr "" +msgid "" +"Delete an entire directory tree; *path* must point to a directory (but not a" +" symbolic link to a directory). If *ignore_errors* is true, errors " +"resulting from failed removals will be ignored; if false or omitted, such " +"errors are handled by calling a handler specified by *onexc* or *onerror* " +"or, if both are omitted, exceptions are propagated to the caller." +msgstr "" +"حذف یک درخت پوشه‌ی کامل؛ *path* باید به یک پوشه اشاره کند (اما نه به یک پیوند" +" نمادین به پوشه). اگر *ignore_errors* درست باشد، خطاهای ناشی از حذف‌های " +"ناموفق نادیده گرفته می‌شوند؛ اگر نادرست یا مشخص‌نشده باشد، چنین خطاهایی با " +"فراخوانی هندلرای که توسط *onexc* یا *onerror* مشخص‌شده است رسیدگی " +"می‌شوند یا اگر هر دو مشخص‌نشده باشند، استثناها به فراخواننده انتشار " +"می‌یابند." -msgid "This function can support :ref:`paths relative to directory descriptors `." +msgid "" +"This function can support :ref:`paths relative to directory descriptors " +"`." msgstr "" +"این تابع می‌تواند از :ref:`مسیرهای نسبی نسبت به توصیف‌گرهای پوشه ` " +"پشتیبانی کند." -msgid "On platforms that support the necessary fd-based functions a symlink attack resistant version of :func:`rmtree` is used by default. On other platforms, the :func:`rmtree` implementation is susceptible to a symlink attack: given proper timing and circumstances, attackers can manipulate symlinks on the filesystem to delete files they wouldn't be able to access otherwise. Applications can use the :data:`rmtree.avoids_symlink_attacks` function attribute to determine which case applies." -msgstr "" +msgid "" +"On platforms that support the necessary fd-based functions a symlink attack " +"resistant version of :func:`rmtree` is used by default. On other platforms," +" the :func:`rmtree` implementation is susceptible to a symlink attack: given" +" proper timing and circumstances, attackers can manipulate symlinks on the " +"filesystem to delete files they wouldn't be able to access otherwise. " +"Applications can use the :data:`rmtree.avoids_symlink_attacks` function " +"attribute to determine which case applies." +msgstr "" +"در پلتفرم‌هایی که تابع‌های مبتنی بر fd لازم را پشتیبانی می‌کنند، به‌طور " +"پیش‌فرض از نسخه‌ای از :func:`rmtree` استفاده می‌شود که در برابر حمله‌ی پیوند" +" نمادین مقاوم است. در سایر پلتفرم‌ها، پیاده‌سازی :func:`rmtree` در برابر " +"حمله‌ی پیوند نمادین آسیب‌پذیر است: با زمان‌بندی و شرایط مناسب، مهاجمان " +"می‌توانند پیوندهای نمادین روی سیستم‌فایل را دستکاری کنند تا فایل‌هایی را حذف" +" کنند که در غیر این صورت قادر به دسترسی به آن‌ها نخواهند بود. برنامه‌ها " +"می‌توانند از ویژگی تابع :data:`rmtree.avoids_symlink_attacks` برای تعیین " +"این‌که کدام حالت صدق می‌کند استفاده کنند." -msgid "If *onexc* is provided, it must be a callable that accepts three parameters: *function*, *path*, and *excinfo*." +msgid "" +"If *onexc* is provided, it must be a callable that accepts three parameters:" +" *function*, *path*, and *excinfo*." msgstr "" +"اگر *onexc* ارائه‌شده باشد، باید یک شیء قابل فراخوانی (callable) باشد که سه " +"پارامتر را می‌پذیرد: *function*، *path* و *excinfo*." -msgid "The first parameter, *function*, is the function which raised the exception; it depends on the platform and implementation. The second parameter, *path*, will be the path name passed to *function*. The third parameter, *excinfo*, is the exception that was raised. Exceptions raised by *onexc* will not be caught." +msgid "" +"The first parameter, *function*, is the function which raised the exception;" +" it depends on the platform and implementation. The second parameter, " +"*path*, will be the path name passed to *function*. The third parameter, " +"*excinfo*, is the exception that was raised. Exceptions raised by *onexc* " +"will not be caught." msgstr "" +"نخستین پارامتر، *function*، تابعی است که استثنا را پرتاب کرده است؛ این تابع " +"به پلتفرم و پیاده‌سازی بستگی دارد. دومین پارامتر، *path*، نام مسیر داده‌شده " +"به *function* خواهد بود. سومین پارامتر، *excinfo*، استثنایی است که پرتاب شده" +" است. استثناهای پرتاب‌شده از سوی *onexc* گرفته نخواهند شد." -msgid "The deprecated *onerror* is similar to *onexc*, except that the third parameter it receives is the tuple returned from :func:`sys.exc_info`." +msgid "" +"The deprecated *onerror* is similar to *onexc*, except that the third " +"parameter it receives is the tuple returned from :func:`sys.exc_info`." msgstr "" +"*onerror* منسوخ‌شده مشابه *onexc* است، با این تفاوت که سومین پارامتری که " +"دریافت می‌کند، تاپل برگردانده‌شده از :func:`sys.exc_info` است." -msgid ":ref:`shutil-rmtree-example` for an example of handling the removal of a directory tree that contains read-only files." +msgid "" +":ref:`shutil-rmtree-example` for an example of handling the removal of a " +"directory tree that contains read-only files." msgstr "" +":ref:`shutil-rmtree-example` برای نمونه‌ای از مدیریت حذف درخت پوشه‌ای که " +"شامل فایل‌های فقط‌خواندنی است." -msgid "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments ``path``, ``dir_fd``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " +"``path``, ``dir_fd``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.rmtree`` را با آرگومان‌های " +"``path`` و ``dir_fd`` پرتاب می‌کند." -msgid "Added a symlink attack resistant version that is used automatically if platform supports fd-based functions." +msgid "" +"Added a symlink attack resistant version that is used automatically if " +"platform supports fd-based functions." msgstr "" +"نسخه‌ای مقاوم در برابر حمله‌ی پیوند نمادینافزوده شد که در صورت " +"پشتیبانی سکو از توابع مبتنی بر fd، به‌طور خودکار استفاده می‌شود." -msgid "On Windows, will no longer delete the contents of a directory junction before removing the junction." +msgid "" +"On Windows, will no longer delete the contents of a directory junction " +"before removing the junction." msgstr "" +"در ویندوز، دیگر محتویات یک اتصالِ پوشه (directory junction) را پیش از حذف " +"اتصال حذف نخواهد کرد." msgid "Added the *dir_fd* parameter." -msgstr "" +msgstr "پارامتر *dir_fd* اضافه شد." msgid "Added the *onexc* parameter, deprecated *onerror*." -msgstr "" +msgstr "پارامتر *onexc* افزوده شد، *onerror* منسوخ شد." -msgid ":func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all but the top-level path. Exceptions other than :exc:`OSError` and subclasses of :exc:`!OSError` are now always propagated to the caller." +msgid "" +":func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all but " +"the top-level path. Exceptions other than :exc:`OSError` and subclasses of " +":exc:`!OSError` are now always propagated to the caller." msgstr "" +":func:`!rmtree` اکنون استثناهای :exc:`FileNotFoundError` را برای همه موارد " +"به‌جز مسیر سطح بالا نادیده می‌گیرد. استثناهایی غیر از :exc:`OSError` و " +"زیرکلاس‌های :exc:`!OSError` اکنون همیشه به فراخواننده منتقل می‌شوند." -msgid "Indicates whether the current platform and implementation provides a symlink attack resistant version of :func:`rmtree`. Currently this is only true for platforms supporting fd-based directory access functions." +msgid "" +"Indicates whether the current platform and implementation provides a symlink" +" attack resistant version of :func:`rmtree`. Currently this is only true " +"for platforms supporting fd-based directory access functions." msgstr "" +"نشان می‌دهد که آیا سکو و پیاده‌سازی فعلی، نسخه‌ای مقاوم در برابر حمله‌ی پیوند" +" نمادین از :func:`rmtree` ارائه می‌دهند یا خیر. در حال حاضر، این موضوع فقط " +"برای سکوهای پشتیبانی‌کننده از توابع دسترسی به پوشه مبتنی بر fd صادق است." -msgid "Recursively move a file or directory (*src*) to another location and return the destination." +msgid "" +"Recursively move a file or directory (*src*) to another location and return " +"the destination." msgstr "" +"به‌صورت بازگشتی یک فایل یا پوشه (*src*) را به مکان دیگری منتقل می‌کند و مقصد" +" را برمی‌گرداند." -msgid "If *dst* is an existing directory or a symlink to a directory, then *src* is moved inside that directory. The destination path in that directory must not already exist." +msgid "" +"If *dst* is an existing directory or a symlink to a directory, then *src* is" +" moved inside that directory. The destination path in that directory must " +"not already exist." msgstr "" +"اگر *dst* یک پوشه موجود یا پیوند نمادین به یک پوشه باشد، آنگاه *src* به داخل" +" آن پوشه منتقل می‌شود. مسیر مقصد در آن پوشه نباید از قبل وجود داشته باشد." -msgid "If *dst* already exists but is not a directory, it may be overwritten depending on :func:`os.rename` semantics." +msgid "" +"If *dst* already exists but is not a directory, it may be overwritten " +"depending on :func:`os.rename` semantics." msgstr "" +"اگر *dst* از قبل وجود داشته باشد اما پوشه نباشد، ممکن است بسته به رفتار " +":func:`os.rename` بازنویسی شود." -msgid ":func:`os.rename` is preferably used internally when *src* and the destination are on the same filesystem. In case :func:`os.rename` fails due to :exc:`OSError` (e.g. the user has write permission to the destination file but not to its parent directory), this method falls back to using *copy_function*, in which case *src* is copied to the destination using *copy_function* and then removed." -msgstr "" +msgid "" +":func:`os.rename` is preferably used internally when *src* and the " +"destination are on the same filesystem. In case :func:`os.rename` fails due " +"to :exc:`OSError` (e.g. the user has write permission to the destination " +"file but not to its parent directory), this method falls back to using " +"*copy_function*, in which case *src* is copied to the destination using " +"*copy_function* and then removed." +msgstr "" +":func:`os.rename` ترجیحاً به‌صورت داخلی زمانی استفاده می‌شود که *src* و مقصد" +" روی فایل‌سیستم یکسانی باشند. در صورتی که :func:`os.rename` به‌دلیل " +":exc:`OSError` با شکست مواجه شود (مثلاً کاربر اجازه‌ی نوشتن روی فایل مقصد را " +"دارد اما اجازه‌ی نوشتن در پوشه‌ی والد آن را ندارد)، این متد به استفاده از " +"*copy_function* روی می‌آورد؛ در این حالت *src* با استفاده از *copy_function*" +" به مقصد کپی می‌شود و سپس حذف می‌گردد." -msgid "In case of symlinks, a new symlink pointing to the target of *src* will be created in or as the destination, and *src* will be removed." +msgid "" +"In case of symlinks, a new symlink pointing to the target of *src* will be " +"created in or as the destination, and *src* will be removed." msgstr "" +"در مورد پیوندهای نمادین ، یک پیوند نمادین جدید که به هدف *src* " +"اشاره می‌کند، در مقصد یا به‌عنوان مقصد ایجاد خواهد شد و *src* حذف خواهد شد." -msgid "If *copy_function* is given, it must be a callable that takes two arguments, *src* and the destination, and will be used to copy *src* to the destination if :func:`os.rename` cannot be used. If the source is a directory, :func:`copytree` is called, passing it the *copy_function*. The default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the *copy_function* allows the move to succeed when it is not possible to also copy the metadata, at the expense of not copying any of the metadata." -msgstr "" +msgid "" +"If *copy_function* is given, it must be a callable that takes two arguments," +" *src* and the destination, and will be used to copy *src* to the " +"destination if :func:`os.rename` cannot be used. If the source is a " +"directory, :func:`copytree` is called, passing it the *copy_function*. The " +"default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the" +" *copy_function* allows the move to succeed when it is not possible to also " +"copy the metadata, at the expense of not copying any of the metadata." +msgstr "" +"اگر *copy_function* داده شده باشد، باید یک شیء قابل فراخوانی باشد که ۲ " +"آرگومان *src* و مقصد را می‌گیرد و در صورتی که نتوان از :func:`os.rename` " +"استفاده کرد، برای کپی *src* به مقصد از آن استفاده خواهد شد. اگر مبدأ یک پوشه" +" باشد، :func:`copytree` فراخوانی می‌شود و *copy_function* به آن ارسال " +"می‌شود. *copy_function* پیش‌فرض، :func:`copy2` است. استفاده از " +":func:`~shutil.copy` به‌عنوان *copy_function* اجازه می‌دهد جابه‌جایی در " +"مواردی که کپی فراداده نیز ممکن نیست با موفقیت انجام شود، به بهای آنکه " +"هیچ‌گونه فراداده‌ای کپی نمی‌شود." -msgid "Raises an :ref:`auditing event ` ``shutil.move`` with arguments ``src``, ``dst``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.move`` with arguments " +"``src``, ``dst``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.move`` را با آرگومان‌های " +"``src`` و ``dst`` پرتاب می‌کند." -msgid "Added explicit symlink handling for foreign filesystems, thus adapting it to the behavior of GNU's :program:`mv`. Now returns *dst*." +msgid "" +"Added explicit symlink handling for foreign filesystems, thus adapting it to" +" the behavior of GNU's :program:`mv`. Now returns *dst*." msgstr "" +"مدیریت صریح پیوندهای نمادین برای فایل‌سیستم‌های خارجی اضافه شد، بدین ترتیب " +"آن با رفتار :program:`mv` در GNU تطبیق داده شد. اکنون *dst* را برمی‌گرداند." msgid "Added the *copy_function* keyword argument." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *copy_function* افزوده شد." msgid "Accepts a :term:`path-like object` for both *src* and *dst*." -msgstr "" +msgstr "یک :term:`path-like object` را برای هر دو *src* و *dst* می‌پذیرد." -msgid "Return disk usage statistics about the given path as a :term:`named tuple` with the attributes *total*, *used* and *free*, which are the amount of total, used and free space, in bytes. *path* may be a file or a directory." +msgid "" +"Return disk usage statistics about the given path as a :term:`named tuple` " +"with the attributes *total*, *used* and *free*, which are the amount of " +"total, used and free space, in bytes. *path* may be a file or a directory." msgstr "" +"آمار استفاده از دیسک برای مسیر داده‌شده را به‌صورت یک :term:`named tuple` با" +" ویژگی‌های *total*، *used* و *free* برمی‌گرداند که مقدار فضای کل، " +"استفاده‌شده و آزاد را بر حسب بایت نشان می‌دهند. *path* می‌تواند یک فایل یا " +"یک پوشه باشد." -msgid "On Unix filesystems, *path* must point to a path within a **mounted** filesystem partition. On those platforms, CPython doesn't attempt to retrieve disk usage information from non-mounted filesystems." +msgid "" +"On Unix filesystems, *path* must point to a path within a **mounted** " +"filesystem partition. On those platforms, CPython doesn't attempt to " +"retrieve disk usage information from non-mounted filesystems." msgstr "" +"در فایل‌سیستم‌های یونیکس، *path* باید به مسیری درون یک افراز از فایل‌سیستم " +"**سوارشده** اشاره کند. در آن سکوها، CPython تلاشی برای دریافت اطلاعات " +"استفاده از دیسک از فایل‌سیستم‌های سوارنشده نمی‌کند." msgid "On Windows, *path* can now be a file or directory." -msgstr "" +msgstr "در ویندوز، *path* اکنون می‌تواند یک فایل یا پوشه باشد." msgid "Availability" -msgstr "" +msgstr "دسترسی" msgid "Change owner *user* and/or *group* of the given *path*." -msgstr "" +msgstr "مالکیت *کاربر* و/یا *گروه* مسیر داده‌شده *path* را تغییر می‌دهد." -msgid "*user* can be a system user name or a uid; the same applies to *group*. At least one argument is required." +msgid "" +"*user* can be a system user name or a uid; the same applies to *group*. At " +"least one argument is required." msgstr "" +"*user* می‌تواند نام کاربری سیستم یا uid باشد؛ همین موضوع برای *group* نیز " +"صدق می‌کند. حداقل ۱ آرگومان لازم است." msgid "See also :func:`os.chown`, the underlying function." -msgstr "" +msgstr "همچنین ببینید :func:`os.chown`، تابع زیربنایی." -msgid "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments ``path``, ``user``, ``group``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " +"``path``, ``user``, ``group``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.chown`` را با آرگومان‌های " +"``path``، ``user`` و ``group`` پرتاب می‌کند." msgid "Added *dir_fd* and *follow_symlinks* parameters." -msgstr "" +msgstr "پارامترهای *dir_fd* و *follow_symlinks* افزوده شدند." -msgid "Return the path to an executable which would be run if the given *cmd* was called. If no *cmd* would be called, return ``None``." +msgid "" +"Return the path to an executable which would be run if the given *cmd* was " +"called. If no *cmd* would be called, return ``None``." msgstr "" +"مسیر یک فایل اجرایی را برمی‌گرداند که اگر *cmd* داده‌شده فراخوانی شود، اجرا " +"می‌شود. اگر هیچ *cmd* فراخوانی نشود، ``None`` برمی‌گرداند." -msgid "*mode* is a permission mask passed to :func:`os.access`, by default determining if the file exists and is executable." +msgid "" +"*mode* is a permission mask passed to :func:`os.access`, by default " +"determining if the file exists and is executable." msgstr "" +"*mode* یک ماسک مجوز (permission mask) است که به :func:`os.access` ارسال " +"می‌شود و به‌طور پیش‌فرض تعیین می‌کند که آیا فایل وجود دارد و قابل اجرا است " +"یا خیر." -msgid "*path* is a \"``PATH`` string\" specifying the directories to look in, delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:`PATH` environment variable is read from :data:`os.environ`, falling back to :data:`os.defpath` if it is not set." +msgid "" +"*path* is a \"``PATH`` string\" specifying the directories to look in, " +"delimited by :data:`os.pathsep`. When no *path* is specified, the " +":envvar:`PATH` environment variable is read from :data:`os.environ`, falling" +" back to :data:`os.defpath` if it is not set." msgstr "" +"*path* یک «رشته ``PATH``» است که پوشه‌هایی را که باید در آن‌ها جستجو شود، " +"مشخص می‌کند و با :data:`os.pathsep` جدا می‌شود. هنگامی که *path* مشخص‌نشده " +"باشد، متغیر محیطی :envvar:`PATH` از :data:`os.environ` خوانده می‌شود و در " +"صورت تنظیم‌نشدن آن، به :data:`os.defpath` بازمی‌گردد." -msgid "If *cmd* contains a directory component, :func:`!which` only checks the specified path directly and does not search the directories listed in *path* or in the system's :envvar:`PATH` environment variable." +msgid "" +"If *cmd* contains a directory component, :func:`!which` only checks the " +"specified path directly and does not search the directories listed in *path*" +" or in the system's :envvar:`PATH` environment variable." msgstr "" +"اگر *cmd* شامل یک جزء پوشه باشد، :func:`!which` فقط مسیر مشخص‌شده را به‌طور " +"مستقیم بررسی می‌کند و پوشه‌های فهرست‌شده در *path* یا در متغیر محیطی " +":envvar:`PATH` سیستم را جست‌وجو نمی‌کند." -msgid "On Windows, the current directory is prepended to the *path* if *mode* does not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to determine if the current directory should be prepended to *path*. To avoid consulting the current working directory for executables: set the environment variable ``NoDefaultCurrentDirectoryInExePath``." -msgstr "" +msgid "" +"On Windows, the current directory is prepended to the *path* if *mode* does " +"not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " +"Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to " +"determine if the current directory should be prepended to *path*. To avoid " +"consulting the current working directory for executables: set the " +"environment variable ``NoDefaultCurrentDirectoryInExePath``." +msgstr "" +"در ویندوز، اگر *mode* شامل ``os.X_OK`` نباشد، پوشه فعلی به ابتدای *path* " +"افزوده می‌شود. هنگامی که *mode* شامل ``os.X_OK`` باشد، از API ویندوز " +"``NeedCurrentDirectoryForExePathW`` برای تعیین اینکه آیا پوشه فعلی باید به " +"ابتدای *path* افزوده شود استفاده می‌شود. برای اجتناب از بررسی پوشه کاری فعلی" +" برای فایل‌های اجرایی: متغیر محیطی ``NoDefaultCurrentDirectoryInExePath`` را" +" تنظیم کنید." -msgid "Also on Windows, the :envvar:`PATHEXT` environment variable is used to resolve commands that may not already include an extension. For example, if you call ``shutil.which(\"python\")``, :func:`which` will search ``PATHEXT`` to know that it should look for ``python.exe`` within the *path* directories. For example, on Windows::" -msgstr "" +msgid "" +"Also on Windows, the :envvar:`PATHEXT` environment variable is used to " +"resolve commands that may not already include an extension. For example, if " +"you call ``shutil.which(\"python\")``, :func:`which` will search ``PATHEXT``" +" to know that it should look for ``python.exe`` within the *path* " +"directories. For example, on Windows::" +msgstr "" +"همچنین در ویندوز، از متغیر محیطی :envvar:`PATHEXT` برای یافتن دستورهایی " +"استفاده می‌شود که ممکن است از قبل شامل پسوند نباشند. برای مثال، اگر " +"``shutil.which(\"python\")`` را فراخوانی کنید، :func:`which` در ``PATHEXT`` " +"جستجو می‌کند تا بداند که باید به دنبال ``python.exe`` در پوشه‌های *path* " +"بگردد. برای مثال، در ویندوز::" msgid "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" +">>> shutil.which(\"python\")\n" +"'C:\\\\Python33\\\\python.EXE'" -msgid "This is also applied when *cmd* is a path that contains a directory component::" +msgid "" +"This is also applied when *cmd* is a path that contains a directory " +"component::" msgstr "" +"این مورد همچنین زمانی اعمال می‌شود که *cmd* مسیری باشد که شامل یک کامپوننت " +"پوشه باشد::" msgid "" ">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" +">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" +"'C:\\\\Python33\\\\python.EXE'" -msgid "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, the result type is also :class:`bytes`." +msgid "" +"The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " +"the result type is also :class:`bytes`." msgstr "" +"نوع :class:`bytes` اکنون پذیرفته می‌شود. اگر نوع *cmd* از نوع :class:`bytes`" +" باشد، نوع نتیجه نیز :class:`bytes` خواهد بود." -msgid "On Windows, the current directory is no longer prepended to the search path if *mode* includes ``os.X_OK`` and WinAPI ``NeedCurrentDirectoryForExePathW(cmd)`` is false, else the current directory is prepended even if it is already in the search path; ``PATHEXT`` is used now even when *cmd* includes a directory component or ends with an extension that is in ``PATHEXT``; and filenames that have no extension can now be found." -msgstr "" +msgid "" +"On Windows, the current directory is no longer prepended to the search path " +"if *mode* includes ``os.X_OK`` and WinAPI " +"``NeedCurrentDirectoryForExePathW(cmd)`` is false, else the current " +"directory is prepended even if it is already in the search path; ``PATHEXT``" +" is used now even when *cmd* includes a directory component or ends with an " +"extension that is in ``PATHEXT``; and filenames that have no extension can " +"now be found." +msgstr "" +"در ویندوز، اگر *mode* شامل ``os.X_OK`` باشد و WinAPI " +"``NeedCurrentDirectoryForExePathW(cmd)`` نادرست باشد، پوشه جاری دیگر به " +"ابتدای مسیر جستجو افزوده نمی‌شود؛ در غیر این صورت، پوشه جاری حتی اگر از قبل " +"در مسیر جستجو باشد، به ابتدای آن افزوده می‌شود؛ اکنون از ``PATHEXT`` استفاده" +" می‌شود، حتی وقتی *cmd* شامل یک کامپوننت پوشه باشد یا با پسوندی موجود در " +"``PATHEXT`` تمام شود؛ و اکنون می‌توان نام فایل‌هایی که پسوند ندارند را پیدا " +"کرد." -msgid "This exception collects exceptions that are raised during a multi-file operation. For :func:`copytree`, the exception argument is a list of 3-tuples (*srcname*, *dstname*, *exception*)." +msgid "" +"This exception collects exceptions that are raised during a multi-file " +"operation. For :func:`copytree`, the exception argument is a list of " +"3-tuples (*srcname*, *dstname*, *exception*)." msgstr "" +"این استثنا، استثناهایی را که در حین یک عملیات چندپرونده‌ای پرتاب می‌شوند، " +"جمع‌آوری می‌کند. برای :func:`copytree`، آرگومان استثنا فهرستی از تاپل‌های " +"۳-تایی (*srcname*, *dstname*, *exception*) است." msgid "Platform-dependent efficient copy operations" -msgstr "" +msgstr "عملیات کپی کارآمد وابسته به سکو" -msgid "Starting from Python 3.8, all functions involving a file copy (:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:`move`) may use platform-specific \"fast-copy\" syscalls in order to copy the file more efficiently (see :issue:`33671`). \"fast-copy\" means that the copying operation occurs within the kernel, avoiding the use of userspace buffers in Python as in \"``outfd.write(infd.read())``\"." -msgstr "" +msgid "" +"Starting from Python 3.8, all functions involving a file copy " +"(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, " +"and :func:`move`) may use platform-specific \"fast-copy\" syscalls in order " +"to copy the file more efficiently (see :issue:`33671`). \"fast-copy\" means " +"that the copying operation occurs within the kernel, avoiding the use of " +"userspace buffers in Python as in \"``outfd.write(infd.read())``\"." +msgstr "" +"از پایتون 3.8 به بعد، همه‌ی توابع مربوط به کپی فایل (:func:`copyfile`، " +":func:`~shutil.copy`، :func:`copy2`، :func:`copytree` و :func:`move`) ممکن " +"است از فراخوانی‌های سیستمی «کپی سریع» (fast-copy) ویژه‌ی سکو استفاده کنند تا " +"فایل را کارآمدتر کپی کنند (به :issue:`33671` مراجعه کنید). «کپی سریع» به این" +" معنا است که عملیات کپی درون کرنل انجام می‌شود و از استفاده از بافرهای فضای " +"کاربر در پایتون، مانند ``outfd.write(infd.read())``، اجتناب می‌شود." msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" +"در macOS، از `fcopyfile`_ برای کپی کردن محتوای فایل (نه فراداده) استفاده " +"می‌شود." msgid "On Linux :func:`os.copy_file_range` or :func:`os.sendfile` is used." msgstr "" +"در لینوکس از :func:`os.copy_file_range` یا :func:`os.sendfile` استفاده " +"می‌شود." msgid "On Solaris :func:`os.sendfile` is used." -msgstr "" +msgstr "در سولاریس، از :func:`os.sendfile` استفاده می‌شود." -msgid "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil.copyfileobj` is used." +msgid "" +"On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " +"instead of 64 KiB) and a :func:`memoryview`-based variant of " +":func:`shutil.copyfileobj` is used." msgstr "" +"در ویندوز، :func:`shutil.copyfile` از اندازه پیش‌فرض بافر بزرگ‌تری (۱ MiB به" +" جای ۶۴ KiB) استفاده می‌کند و از یک گونه مبتنی بر :func:`memoryview` برای " +":func:`shutil.copyfileobj` استفاده می‌شود." -msgid "If the fast-copy operation fails and no data was written in the destination file then shutil will silently fall back to less efficient :func:`copyfileobj` function internally." +msgid "" +"If the fast-copy operation fails and no data was written in the destination " +"file then shutil will silently fall back to less efficient " +":func:`copyfileobj` function internally." msgstr "" +"اگر عملیات کپی سریع (fast-copy) ناموفق باشد و هیچ داده‌ای در فایل مقصد نوشته" +" نشده باشد، shutil به‌صورت داخلی و بی‌صدا به تابع کم‌بازده‌تر " +":func:`copyfileobj` بازمی‌گردد." msgid "Solaris now uses :func:`os.sendfile`." -msgstr "" +msgstr "Solaris اکنون از :func:`os.sendfile` استفاده می‌کند." -msgid "Copy-on-write or server-side copy may be used internally via :func:`os.copy_file_range` on supported Linux filesystems." +msgid "" +"Copy-on-write or server-side copy may be used internally via " +":func:`os.copy_file_range` on supported Linux filesystems." msgstr "" +"ممکن است کپی در زمان نوشتن (Copy-on-write) یا کپی سمت سرور به‌صورت داخلی از " +"طریق :func:`os.copy_file_range` در فایل‌سیستم‌های لینوکسی پشتیبانی‌شده " +"استفاده شود." msgid "copytree example" -msgstr "" +msgstr "مثال copytree" msgid "An example that uses the :func:`ignore_patterns` helper::" -msgstr "" +msgstr "مثالی که از تابع کمکی :func:`ignore_patterns` استفاده می‌کند::" msgid "" "from shutil import copytree, ignore_patterns\n" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" msgstr "" +"from shutil import copytree, ignore_patterns\n" +"\n" +"copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -msgid "This will copy everything except ``.pyc`` files and files or directories whose name starts with ``tmp``." +msgid "" +"This will copy everything except ``.pyc`` files and files or directories " +"whose name starts with ``tmp``." msgstr "" +"این کار همه‌چیز را به جز فایل‌های ``.pyc`` و فایل‌ها یا پوشه‌هایی که نام " +"آن‌ها با ``tmp`` شروع می‌شود، کپی می‌کند." -msgid "Another example that uses the *ignore* argument to add a logging call::" +msgid "" +"Another example that uses the *ignore* argument to add a logging call::" msgstr "" +"مثالی دیگر که از آرگومان *ignore* برای افزودن یک فراخوانی گزارش استفاده " +"می‌کند::" msgid "" "from shutil import copytree\n" @@ -372,12 +960,28 @@ msgid "" "\n" "copytree(source, destination, ignore=_logpath)" msgstr "" +"from shutil import copytree\n" +"import logging\n" +"\n" +"def _logpath(path, names):\n" +" logging.info('Working in %s', path)\n" +" return [] # nothing will be ignored\n" +"\n" +"copytree(source, destination, ignore=_logpath)" msgid "rmtree example" -msgstr "" +msgstr "مثال rmtree" -msgid "This example shows how to remove a directory tree on Windows where some of the files have their read-only bit set. It uses the onexc callback to clear the readonly bit and reattempt the remove. Any subsequent failure will propagate. ::" +msgid "" +"This example shows how to remove a directory tree on Windows where some of " +"the files have their read-only bit set. It uses the onexc callback to clear " +"the readonly bit and reattempt the remove. Any subsequent failure will " +"propagate. ::" msgstr "" +"این مثال نشان می‌دهد که چگونه می‌توان یک درخت پوشه را در ویندوز حذف کرد، در " +"حالتی که بیت فقط‌خواندنی برخی از فایل‌ها تنظیم شده است. این مثال از کال‌بک " +"onexc برای پاک کردن بیت فقط‌خواندنی و تلاش دوباره برای حذف استفاده می‌کند. " +"هر شکست بعدی منتشر خواهد شد. ::" msgid "" "import os, stat\n" @@ -390,174 +994,389 @@ msgid "" "\n" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" +"import os, stat\n" +"import shutil\n" +"\n" +"def remove_readonly(func, path, _):\n" +" \"Clear the readonly bit and reattempt the removal\"\n" +" os.chmod(path, stat.S_IWRITE)\n" +" func(path)\n" +"\n" +"shutil.rmtree(directory, onexc=remove_readonly)" msgid "Archiving operations" -msgstr "" +msgstr "عملیات بایگانی" msgid "Added support for the *xztar* format." -msgstr "" +msgstr "پشتیبانی از قالب *xztar* اضافه شد." -msgid "High-level utilities to create and read compressed and archived files are also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." +msgid "" +"High-level utilities to create and read compressed and archived files are " +"also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" +"ابزارهای سطح بالا برای ایجاد و خواندن فایل‌های فشرده و بایگانی‌شده نیز ارائه" +" شده‌اند. این ابزارها به ماژول‌های :mod:`zipfile` و :mod:`tarfile` متکی " +"هستند." msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" +"یک فایل آرشیو (مانند zip یا tar) ایجاد می‌کند و نام آن را برمی‌گرداند." -msgid "*base_name* is the name of the file to create, including the path, minus any format-specific extension." +msgid "" +"*base_name* is the name of the file to create, including the path, minus any" +" format-specific extension." msgstr "" +"*base_name* نام فایلی است که ایجاد می‌شود، شامل مسیر، بدون هیچ پسوند مخصوص " +"قالب." -msgid "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), \"bztar\" (if the :mod:`bz2` module is available), \"xztar\" (if the :mod:`lzma` module is available), or \"zstdtar\" (if the :mod:`compression.zstd` module is available)." -msgstr "" +msgid "" +"*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is" +" available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " +"\"bztar\" (if the :mod:`bz2` module is available), \"xztar\" (if the " +":mod:`lzma` module is available), or \"zstdtar\" (if the " +":mod:`compression.zstd` module is available)." +msgstr "" +"*format* قالب بایگانی است: یکی از \"zip\" (اگر ماژول :mod:`zlib` در دسترس " +"باشد)، \"tar\"، \"gztar\" (اگر ماژول :mod:`zlib` در دسترس باشد)، \"bztar\" " +"(اگر ماژول :mod:`bz2` در دسترس باشد)، \"xztar\" (اگر ماژول :mod:`lzma` در " +"دسترس باشد)، یا \"zstdtar\" (اگر ماژول :mod:`compression.zstd` در دسترس " +"باشد)." -msgid "*root_dir* is a directory that will be the root directory of the archive, all paths in the archive will be relative to it; for example, we typically chdir into *root_dir* before creating the archive." +msgid "" +"*root_dir* is a directory that will be the root directory of the archive, " +"all paths in the archive will be relative to it; for example, we typically " +"chdir into *root_dir* before creating the archive." msgstr "" +"*root_dir* پوشه‌ای است که پوشه‌ی ریشه‌ی بایگانی خواهد بود؛ همه‌ی مسیرهای " +"داخل بایگانی نسبت به آن نسبی خواهند بود؛ برای مثال، معمولاً پیش از ایجاد " +"بایگانی، با chdir وارد *root_dir* می‌شویم." -msgid "*base_dir* is the directory where we start archiving from; i.e. *base_dir* will be the common prefix of all files and directories in the archive. *base_dir* must be given relative to *root_dir*. See :ref:`shutil-archiving-example-with-basedir` for how to use *base_dir* and *root_dir* together." -msgstr "" +msgid "" +"*base_dir* is the directory where we start archiving from; i.e. *base_dir* " +"will be the common prefix of all files and directories in the archive. " +"*base_dir* must be given relative to *root_dir*. See :ref:`shutil-" +"archiving-example-with-basedir` for how to use *base_dir* and *root_dir* " +"together." +msgstr "" +"*base_dir* پوشه‌ای است که بایگانی را از آن آغاز می‌کنیم؛ یعنی *base_dir* " +"پیشوند مشترک همه‌ی فایل‌ها و پوشه‌های درون بایگانی خواهد بود. *base_dir* " +"باید نسبت به *root_dir* داده شود. برای چگونگی استفاده از *base_dir* و " +"*root_dir* با یکدیگر، به :ref:`shutil-archiving-example-with-basedir` مراجعه" +" کنید." msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" +"*root_dir* و *base_dir* هر دو به‌طور پیش‌فرض برابر با پوشه جاری هستند." -msgid "If *dry_run* is true, no archive is created, but the operations that would be executed are logged to *logger*." +msgid "" +"If *dry_run* is true, no archive is created, but the operations that would " +"be executed are logged to *logger*." msgstr "" +"اگر *dry_run* درست باشد، هیچ بایگانی‌ای ایجاد نمی‌شود، اما عملیاتی که اجرا " +"می‌شدند، در *logger* ثبت می‌شوند." -msgid "*owner* and *group* are used when creating a tar archive. By default, uses the current owner and group." +msgid "" +"*owner* and *group* are used when creating a tar archive. By default, uses " +"the current owner and group." msgstr "" +"*owner* و *group* هنگام ایجاد یک آرشیو tar استفاده می‌شوند. به‌طور پیش‌فرض، " +"از مالک و گروه فعلی استفاده می‌شود." -msgid "*logger* must be an object compatible with :pep:`282`, usually an instance of :class:`logging.Logger`." +msgid "" +"*logger* must be an object compatible with :pep:`282`, usually an instance " +"of :class:`logging.Logger`." msgstr "" +"*logger* باید یک شیء سازگار با :pep:`282` باشد، معمولاً یک نمونه از " +":class:`logging.Logger`." msgid "The *verbose* argument is unused and deprecated." -msgstr "" +msgstr "آرگومان *verbose* استفاده نمی‌شود و منسوخ است." -msgid "Raises an :ref:`auditing event ` ``shutil.make_archive`` with arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.make_archive`` with " +"arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.make_archive`` را با " +"آرگومان‌های ``base_name``، ``format``، ``root_dir``، ``base_dir`` پرتاب " +"می‌کند." -msgid "This function is not thread-safe when custom archivers registered with :func:`register_archive_format` do not support the *root_dir* argument. In this case it temporarily changes the current working directory of the process to *root_dir* to perform archiving." +msgid "" +"This function is not thread-safe when custom archivers registered with " +":func:`register_archive_format` do not support the *root_dir* argument. In " +"this case it temporarily changes the current working directory of the " +"process to *root_dir* to perform archiving." msgstr "" +"این تابع زمانی که بایگانی‌کننده‌های سفارشی ثبت‌شده با " +":func:`register_archive_format` از آرگومان *root_dir* پشتیبانی نمی‌کنند، " +"ایمنی نخی ندارد. در این حالت، پوشه کاری فعلی فرایند را به‌طور موقت به " +"*root_dir* تغییر می‌دهد تا بایگانی انجام شود." -msgid "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU format for archives created with ``format=\"tar\"``." +msgid "" +"The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " +"format for archives created with ``format=\"tar\"``." msgstr "" +"قالب مدرن pax (POSIX.1-2001) اکنون به‌جای قالب قدیمی GNU برای بایگانی‌های " +"ایجادشده با ``format=\"tar\"`` استفاده می‌شود." -msgid "This function is now made thread-safe during creation of standard ``.zip`` and tar archives." +msgid "" +"This function is now made thread-safe during creation of standard ``.zip`` " +"and tar archives." msgstr "" +"این تابع اکنون هنگام ایجاد بایگانی‌های استاندارد ``.zip`` و tar، ایمن از نظر" +" نخی (thread-safe) شده است." -msgid "Return a list of supported formats for archiving. Each element of the returned sequence is a tuple ``(name, description)``." +msgid "" +"Return a list of supported formats for archiving. Each element of the " +"returned sequence is a tuple ``(name, description)``." msgstr "" +"فهرستی از قالب‌های پشتیبانی‌شده برای بایگانی برمی‌گرداند. هر عنصر از دنباله‌ی" +" برگردانده‌شده یک تاپل ``(name, description)`` است." msgid "By default :mod:`!shutil` provides these formats:" -msgstr "" +msgstr "به‌طور پیش‌فرض :mod:`!shutil` این قالب‌ها را فراهم می‌کند:" msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." -msgstr "" +msgstr "*zip*: فایل ZIP (اگر ماژول :mod:`zlib` در دسترس باشد)." -msgid "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." +msgid "" +"*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" +"*tar*: فایل tar فشرده‌نشده. برای بایگانی‌های جدید از قالب POSIX.1-2001 pax " +"استفاده می‌کند." msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" +"*gztar*: فایل tar فشرده‌شده با gzip (اگر ماژول :mod:`zlib` در دسترس باشد)." msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" +"*bztar*: فایل tar فشرده‌شده با bzip2 (اگر ماژول :mod:`bz2` در دسترس باشد)." msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" +"*xztar*: فایل tar فشرده‌شده با xz (اگر ماژول :mod:`lzma` در دسترس باشد)." -msgid "*zstdtar*: Zstandard compressed tar-file (if the :mod:`compression.zstd` module is available)." +msgid "" +"*zstdtar*: Zstandard compressed tar-file (if the :mod:`compression.zstd` " +"module is available)." msgstr "" +"*zstdtar*: فایل tar فشرده‌شده با Zstandard (اگر ماژول " +":mod:`compression.zstd` در دسترس باشد)." -msgid "You can register new formats or provide your own archiver for any existing formats, by using :func:`register_archive_format`." +msgid "" +"You can register new formats or provide your own archiver for any existing " +"formats, by using :func:`register_archive_format`." msgstr "" +"با استفاده از :func:`register_archive_format` می‌توانید قالب‌های جدید را ثبت" +" کنید یا بایگانی‌کننده (archiver) خودتان را برای هر یک از قالب‌های موجود " +"ارائه دهید." msgid "Register an archiver for the format *name*." -msgstr "" +msgstr "یک بایگانی‌کننده برای قالب *name* ثبت کنید." -msgid "*function* is the callable that will be used to create archives. The callable will receive the *base_name* of the file to create, followed by the *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. Further arguments are passed as keyword arguments: *owner*, *group*, *dry_run* and *logger* (as passed in :func:`make_archive`)." -msgstr "" +msgid "" +"*function* is the callable that will be used to create archives. The " +"callable will receive the *base_name* of the file to create, followed by the" +" *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. " +"Further arguments are passed as keyword arguments: *owner*, *group*, " +"*dry_run* and *logger* (as passed in :func:`make_archive`)." +msgstr "" +"*function* یک شیء قابل فراخوانی است که برای ایجاد بایگانی‌ها استفاده خواهد " +"شد. این شیء قابل فراخوانی، *base_name* فایلی که ایجاد می‌شود و سپس " +"*base_dir* را (که پیش‌فرض آن :data:`os.curdir` است) دریافت می‌کند تا بایگانی" +" از آن آغاز شود. آرگومان‌های بیشتر به‌صورت آرگومان‌های کلیدواژه‌ای ارسال " +"می‌شوند: *owner*، *group*، *dry_run* و *logger* (همان‌طور که در " +":func:`make_archive` ارسال می‌شوند)." -msgid "If *function* has the custom attribute ``function.supports_root_dir`` set to ``True``, the *root_dir* argument is passed as a keyword argument. Otherwise the current working directory of the process is temporarily changed to *root_dir* before calling *function*. In this case :func:`make_archive` is not thread-safe." -msgstr "" +msgid "" +"If *function* has the custom attribute ``function.supports_root_dir`` set to" +" ``True``, the *root_dir* argument is passed as a keyword argument. " +"Otherwise the current working directory of the process is temporarily " +"changed to *root_dir* before calling *function*. In this case " +":func:`make_archive` is not thread-safe." +msgstr "" +"اگر ویژگی سفارشی ``function.supports_root_dir`` برای *function* روی ``True``" +" تنظیم شده باشد، آرگومان *root_dir* به‌عنوان یک آرگومان کلیدواژه‌ای ارسال " +"می‌شود. در غیر این صورت، پوشه کاری جاری فرایند پیش از فراخوانی *function* " +"به‌طور موقت به *root_dir* تغییر می‌یابد. در این حالت :func:`make_archive` " +"ایمن در برابر نخ نیست." -msgid "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be used as extra keywords arguments when the archiver callable is used." +msgid "" +"If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be" +" used as extra keywords arguments when the archiver callable is used." msgstr "" +"در صورت ارائه، *extra_args* دنباله‌ای از جفت‌های ``(name, value)`` است که " +"هنگام استفاده از شیء فراخوان‌پذیر آرشیوکننده، به‌عنوان آرگومان‌های " +"کلیدواژه‌ای اضافی استفاده می‌شوند." -msgid "*description* is used by :func:`get_archive_formats` which returns the list of archivers. Defaults to an empty string." +msgid "" +"*description* is used by :func:`get_archive_formats` which returns the list " +"of archivers. Defaults to an empty string." msgstr "" +"*description* توسط :func:`get_archive_formats` استفاده می‌شود، که فهرست " +"بایگانی‌کننده‌ها را برمی‌گرداند. مقدار پیش‌فرض آن یک رشته خالی است." msgid "Added support for functions supporting the *root_dir* argument." msgstr "" +"پشتیبانی از توابعی که از آرگومان *root_dir* پشتیبانی می‌کنند، افزوده شد." msgid "Remove the archive format *name* from the list of supported formats." -msgstr "" +msgstr "قالب بایگانی *name* را از فهرست قالب‌های پشتیبانی‌شده حذف می‌کند." msgid "Unpack an archive. *filename* is the full path of the archive." -msgstr "" +msgstr "یک بایگانی را واگشایی کنید. *filename* مسیر کامل بایگانی است." -msgid "*extract_dir* is the name of the target directory where the archive is unpacked. If not provided, the current working directory is used." +msgid "" +"*extract_dir* is the name of the target directory where the archive is " +"unpacked. If not provided, the current working directory is used." msgstr "" +"*extract_dir* نام پوشه هدفی است که آرشیو در آن واگشایی می‌شود. اگر ارائه " +"نشود، از پوشه کاری جاری استفاده می‌شود." -msgid "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", \"bztar\", \"xztar\", or \"zstdtar\". Or any other format registered with :func:`register_unpack_format`. If not provided, :func:`unpack_archive` will use the archive file name extension and see if an unpacker was registered for that extension. In case none is found, a :exc:`ValueError` is raised." -msgstr "" +msgid "" +"*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " +"\"bztar\", \"xztar\", or \"zstdtar\". Or any other format registered with " +":func:`register_unpack_format`. If not provided, :func:`unpack_archive` " +"will use the archive file name extension and see if an unpacker was " +"registered for that extension. In case none is found, a :exc:`ValueError` " +"is raised." +msgstr "" +"*format* قالب بایگانی است: یکی از \"zip\"، \"tar\"، \"gztar\"، \"bztar\"، " +"\"xztar\" یا \"zstdtar\". یا هر قالب دیگری که با " +":func:`register_unpack_format` ثبت‌شده باشد. اگر ارائه نشود، " +":func:`unpack_archive` از پسوند نام فایل بایگانی استفاده می‌کند و بررسی " +"می‌کند که آیا واگشاینده‌ای برای آن پسوند ثبت‌شده است یا خیر. در صورتی که هیچ" +" موردی یافت نشود، یک :exc:`ValueError` پرتاب می‌شود." -msgid "The keyword-only *filter* argument is passed to the underlying unpacking function. For zip files, *filter* is not accepted. For tar files, it is recommended to use ``'data'`` (default since Python 3.14), unless using features specific to tar and UNIX-like filesystems. (See :ref:`tarfile-extraction-filter` for details.)" -msgstr "" +msgid "" +"The keyword-only *filter* argument is passed to the underlying unpacking " +"function. For zip files, *filter* is not accepted. For tar files, it is " +"recommended to use ``'data'`` (default since Python 3.14), unless using " +"features specific to tar and UNIX-like filesystems. (See :ref:`tarfile-" +"extraction-filter` for details.)" +msgstr "" +"آرگومان *filter* که فقط کلیدواژه‌ای است، به تابع واگشایی زیربنایی ارسال " +"می‌شود. برای فایل‌های zip، *filter* پذیرفته نمی‌شود. برای فایل‌های tar، " +"توصیه می‌شود از ``'data'`` استفاده کنید (از Python 3.14 پیش‌فرض است)، مگر " +"اینکه از ویژگی‌های خاص tar و فایل‌سیستم‌های شبهUNIX استفاده کنید. (برای " +"جزئیات، :ref:`tarfile-extraction-filter` را ببینید.)" -msgid "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with arguments ``filename``, ``extract_dir``, ``format``." +msgid "" +"Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " +"arguments ``filename``, ``extract_dir``, ``format``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``shutil.unpack_archive`` را با " +"آرگومان‌های ``filename``، ``extract_dir`` و ``format`` پرتاب می‌کند." -msgid "Never extract archives from untrusted sources without prior inspection. It is possible that files are created outside of the path specified in the *extract_dir* argument, for example, members that have absolute filenames or filenames with \"..\" components." +msgid "" +"Never extract archives from untrusted sources without prior inspection. It " +"is possible that files are created outside of the path specified in the " +"*extract_dir* argument, for example, members that have absolute filenames or" +" filenames with \"..\" components." msgstr "" +"هرگز بایگانی‌ها را از منابع غیرقابل‌اعتماد بدون بررسی پیشین استخراج نکنید. " +"ممکن است فایل‌ها خارج از مسیر مشخص‌شده در آرگومان *extract_dir* ایجاد شوند، " +"برای مثال اعضایی که نام‌فایل‌های مطلق یا نام‌فایل‌هایی دارای اجزای \"..\" " +"دارند." -msgid "Since Python 3.14, the defaults for both built-in formats (zip and tar files) will prevent the most dangerous of such security issues, but will not prevent *all* unintended behavior. Read the :ref:`tarfile-further-verification` section for tar-specific details." +msgid "" +"Since Python 3.14, the defaults for both built-in formats (zip and tar " +"files) will prevent the most dangerous of such security issues, but will not" +" prevent *all* unintended behavior. Read the :ref:`tarfile-further-" +"verification` section for tar-specific details." msgstr "" +"از پایتون 3.14، پیش‌فرض‌های هر دو قالب توکار (فایل‌های zip و tar) از " +"خطرناک‌ترینِ این مشکلات امنیتی جلوگیری خواهند کرد، اما از *تمام* رفتارهای " +"ناخواسته جلوگیری نخواهند کرد. برای جزئیات مختص tar، بخش :ref:`tarfile-" +"further-verification` را مطالعه کنید." msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" +"یک :term:`path-like object` را برای *filename* و *extract_dir* می‌پذیرد." msgid "Added the *filter* argument." -msgstr "" +msgstr "آرگومان *filter* اضافه شد." -msgid "Registers an unpack format. *name* is the name of the format and *extensions* is a list of extensions corresponding to the format, like ``.zip`` for Zip files." +msgid "" +"Registers an unpack format. *name* is the name of the format and " +"*extensions* is a list of extensions corresponding to the format, like " +"``.zip`` for Zip files." msgstr "" +"یک قالب واگشایی را ثبت می‌کند. *name* نام قالب است و *extensions* فهرستی از " +"پسوندهای متناظر با قالب است، مانند ``.zip`` برای فایل‌های Zip." -msgid "*function* is the callable that will be used to unpack archives. The callable will receive:" +msgid "" +"*function* is the callable that will be used to unpack archives. The " +"callable will receive:" msgstr "" +"*function* فراخوان‌پذیری است که برای واگشایی آرشیوها استفاده خواهد شد. این " +"فراخوان‌پذیر دریافت خواهد کرد:" msgid "the path of the archive, as a positional argument;" -msgstr "" +msgstr "مسیر بایگانی، به‌عنوان یک آرگومان جایگاهی؛" -msgid "the directory the archive must be extracted to, as a positional argument;" +msgid "" +"the directory the archive must be extracted to, as a positional argument;" msgstr "" +"پوشه‌ای که بایگانی باید در آن استخراج شود، به‌عنوان یک آرگومان جایگاهی؛" -msgid "possibly a *filter* keyword argument, if it was given to :func:`unpack_archive`;" +msgid "" +"possibly a *filter* keyword argument, if it was given to " +":func:`unpack_archive`;" msgstr "" +"احتمالاً یک آرگومان کلیدواژه‌ای *filter*، اگر به :func:`unpack_archive` داده" +" شده باشد؛" -msgid "additional keyword arguments, specified by *extra_args* as a sequence of ``(name, value)`` tuples." +msgid "" +"additional keyword arguments, specified by *extra_args* as a sequence of " +"``(name, value)`` tuples." msgstr "" +"آرگومان‌های کلیدواژه‌ای اضافی، که توسط *extra_args* به‌صورت دنباله‌ای از " +"تاپل‌های ``(name, value)`` مشخص‌شده‌اند." -msgid "*description* can be provided to describe the format, and will be returned by the :func:`get_unpack_formats` function." +msgid "" +"*description* can be provided to describe the format, and will be returned " +"by the :func:`get_unpack_formats` function." msgstr "" +"می‌توان *description* را برای توصیف قالب ارائه کرد، و توسط تابع " +":func:`get_unpack_formats` بازگردانده می‌شود." msgid "Unregister an unpack format. *name* is the name of the format." -msgstr "" +msgstr "ثبت یک قالب واگشایی را لغو می‌کند. *name* نام قالب است." -msgid "Return a list of all registered formats for unpacking. Each element of the returned sequence is a tuple ``(name, extensions, description)``." +msgid "" +"Return a list of all registered formats for unpacking. Each element of the " +"returned sequence is a tuple ``(name, extensions, description)``." msgstr "" +"فهرستی از تمام قالب‌های ثبت‌شده برای واگشایی را برمی‌گرداند. هر عنصر از " +"دنباله‌ی برگردانده‌شده یک تاپل ``(name, extensions, description)`` است." -msgid "*zip*: ZIP file (unpacking compressed files works only if the corresponding module is available)." +msgid "" +"*zip*: ZIP file (unpacking compressed files works only if the corresponding " +"module is available)." msgstr "" +"*zip*: فایل ZIP (واگشایی فایل‌های فشرده فقط زمانی کار می‌کند که ماژول مربوطه" +" در دسترس باشد)." msgid "*tar*: uncompressed tar file." -msgstr "" +msgstr "*tar*: فایل tar فشرده‌نشده." -msgid "You can register new formats or provide your own unpacker for any existing formats, by using :func:`register_unpack_format`." +msgid "" +"You can register new formats or provide your own unpacker for any existing " +"formats, by using :func:`register_unpack_format`." msgstr "" +"با استفاده از :func:`register_unpack_format`، می‌توانید قالب‌های جدید را ثبت" +" کنید یا واگشای (unpacker) خودتان را برای هر قالب موجود فراهم کنید." msgid "Archiving example" -msgstr "" +msgstr "مثال بایگانی" -msgid "In this example, we create a gzip'ed tar-file archive containing all files found in the :file:`.ssh` directory of the user::" +msgid "" +"In this example, we create a gzip'ed tar-file archive containing all files " +"found in the :file:`.ssh` directory of the user::" msgstr "" +"در این مثال، یک بایگانی tar فشرده‌شده با gzip ایجاد می‌کنیم که شامل همه‌ی " +"فایل‌های موجود در پوشه‌ی :file:`.ssh` کاربر است::" msgid "" ">>> from shutil import make_archive\n" @@ -567,9 +1386,15 @@ msgid "" ">>> make_archive(archive_name, 'gztar', root_dir)\n" "'/Users/tarek/myarchive.tar.gz'" msgstr "" +">>> from shutil import make_archive\n" +">>> import os\n" +">>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))\n" +">>> root_dir = os.path.expanduser(os.path.join('~', '.ssh'))\n" +">>> make_archive(archive_name, 'gztar', root_dir)\n" +"'/Users/tarek/myarchive.tar.gz'" msgid "The resulting archive contains:" -msgstr "" +msgstr "بایگانی حاصل شامل:" msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" @@ -582,12 +1407,27 @@ msgid "" "-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" msgstr "" +"$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" +"drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" +"-rw-r--r-- tarek/staff 609 2008-06-09 13:26:54 ./authorized_keys\n" +"-rwxr-xr-x tarek/staff 65 2008-06-09 13:26:54 ./config\n" +"-rwx------ tarek/staff 668 2008-06-09 13:26:54 ./id_dsa\n" +"-rwxr-xr-x tarek/staff 609 2008-06-09 13:26:54 ./id_dsa.pub\n" +"-rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa\n" +"-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" +"-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" msgid "Archiving example with *base_dir*" -msgstr "" +msgstr "مثال بایگانی با *base_dir*" -msgid "In this example, similar to the `one above `_, we show how to use :func:`make_archive`, but this time with the usage of *base_dir*. We now have the following directory structure:" +msgid "" +"In this example, similar to the `one above `_, we" +" show how to use :func:`make_archive`, but this time with the usage of " +"*base_dir*. We now have the following directory structure:" msgstr "" +"در این مثال، مشابه `مثال بالا `_، نحوه استفاده از" +" :func:`make_archive` را نشان می‌دهیم، اما این بار با استفاده از *base_dir*." +" اکنون ساختار پوشه زیر را داریم:" msgid "" "$ tree tmp\n" @@ -598,9 +1438,21 @@ msgid "" " └── please_add.txt\n" " └── do_not_add.txt" msgstr "" +"$ tree tmp\n" +"tmp\n" +"└── root\n" +" └── structure\n" +" ├── content\n" +" └── please_add.txt\n" +" └── do_not_add.txt" -msgid "In the final archive, :file:`please_add.txt` should be included, but :file:`do_not_add.txt` should not. Therefore we use the following::" +msgid "" +"In the final archive, :file:`please_add.txt` should be included, but " +":file:`do_not_add.txt` should not. Therefore we use the following::" msgstr "" +"در بایگانی نهایی، :file:`please_add.txt` باید گنجانده شود، اما " +":file:`do_not_add.txt` نباید گنجانده شود. بنابراین از دستور زیر استفاده " +"می‌کنیم::" msgid "" ">>> from shutil import make_archive\n" @@ -614,51 +1466,96 @@ msgid "" "... )\n" "'/Users/tarek/myarchive.tar'" msgstr "" +">>> from shutil import make_archive\n" +">>> import os\n" +">>> archive_name = os.path.expanduser(os.path.join('~', 'myarchive'))\n" +">>> make_archive(\n" +"... archive_name,\n" +"... 'tar',\n" +"... root_dir='tmp/root',\n" +"... base_dir='structure/content',\n" +"... )\n" +"'/Users/tarek/myarchive.tar'" msgid "Listing the files in the resulting archive gives us:" -msgstr "" +msgstr "فهرست فایل‌های موجود در آرشیو حاصل به این صورت است:" msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" "structure/content/please_add.txt" msgstr "" +"$ python -m tarfile -l /Users/tarek/myarchive.tar\n" +"structure/content/\n" +"structure/content/please_add.txt" msgid "Querying the size of the output terminal" -msgstr "" +msgstr "پرس‌وجوی اندازه‌ی پایانه‌ی خروجی" msgid "Get the size of the terminal window." -msgstr "" +msgstr "اندازه‌ی پنجره‌ی پایانه را بگیرید." -msgid "For each of the two dimensions, the environment variable, ``COLUMNS`` and ``LINES`` respectively, is checked. If the variable is defined and the value is a positive integer, it is used." +msgid "" +"For each of the two dimensions, the environment variable, ``COLUMNS`` and " +"``LINES`` respectively, is checked. If the variable is defined and the value" +" is a positive integer, it is used." msgstr "" +"برای هر یک از دو بُعد، متغیر محیطی مربوطه، به‌ترتیب ``COLUMNS`` و ``LINES``،" +" بررسی می‌شود. اگر متغیر تعریف شده باشد و مقدار آن یک عدد صحیح مثبت باشد، از" +" آن استفاده می‌شود." -msgid "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the terminal connected to :data:`sys.__stdout__` is queried by invoking :func:`os.get_terminal_size`." +msgid "" +"When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " +"terminal connected to :data:`sys.__stdout__` is queried by invoking " +":func:`os.get_terminal_size`." msgstr "" +"هنگامی که ``COLUMNS`` یا ``LINES`` تعریف نشده باشد، که حالت رایج است، از " +"پایانه‌ی متصل به :data:`sys.__stdout__` با فراخوانی " +":func:`os.get_terminal_size` پرس‌وجو می‌شود." -msgid "If the terminal size cannot be successfully queried, either because the system doesn't support querying, or because we are not connected to a terminal, the value given in ``fallback`` parameter is used. ``fallback`` defaults to ``(80, 24)`` which is the default size used by many terminal emulators." -msgstr "" +msgid "" +"If the terminal size cannot be successfully queried, either because the " +"system doesn't support querying, or because we are not connected to a " +"terminal, the value given in ``fallback`` parameter is used. ``fallback`` " +"defaults to ``(80, 24)`` which is the default size used by many terminal " +"emulators." +msgstr "" +"اگر نتوان اندازه پایانه را با موفقیت پرس‌وجو کرد، چه به این دلیل که سیستم از" +" پرس‌وجو پشتیبانی نمی‌کند و چه به این دلیل که به یک پایانه متصل نباشیم، از " +"مقدار داده‌شده به پارامتر ``fallback`` استفاده می‌شود. مقدار پیش‌فرض " +"``fallback`` برابر ``(80, 24)`` است که اندازه پیش‌فرض مورد استفاده بسیاری از" +" شبیه‌سازهای پایانه است." msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" +"مقدار بازگشتی یک چندگانه‌ی نام‌دار (named tuple) از نوع " +":class:`os.terminal_size` است." -msgid "See also: The Single UNIX Specification, Version 2, `Other Environment Variables`_." +msgid "" +"See also: The Single UNIX Specification, Version 2, `Other Environment " +"Variables`_." msgstr "" +"همچنین ببینید: The Single UNIX Specification, Version 2، `Other Environment " +"Variables`_." -msgid "The ``fallback`` values are also used if :func:`os.get_terminal_size` returns zeroes." +msgid "" +"The ``fallback`` values are also used if :func:`os.get_terminal_size` " +"returns zeroes." msgstr "" +"در صورتی که :func:`os.get_terminal_size` صفرها را برگرداند، از مقدارهای " +"``fallback`` نیز استفاده می‌شود." msgid "file" -msgstr "" +msgstr "فایل" msgid "copying" -msgstr "" +msgstr "کپی" msgid "copying files" -msgstr "" +msgstr "کپی فایل‌ها" msgid "directory" -msgstr "" +msgstr "پوشه" msgid "deleting" -msgstr "" +msgstr "حذف" diff --git a/library/signal.po b/library/signal.po index 339477b9b..9c669c631 100644 --- a/library/signal.po +++ b/library/signal.po @@ -25,400 +25,923 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!signal` --- Set handlers for asynchronous events" -msgstr "" +msgstr ":mod:`!signal` --- تنظیم هندلرها برای رویدادهای ناهمگام" msgid "**Source code:** :source:`Lib/signal.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/signal.py`" msgid "This module provides mechanisms to use signal handlers in Python." msgstr "" +"این ماژول سازوکارهایی را برای استفاده از هندلرهای سیگنال (signal handlers) در" +" پایتون فراهم می‌کند." msgid "General rules" -msgstr "" +msgstr "قواعد عمومی" -msgid "The :func:`signal.signal` function allows defining custom handlers to be executed when a signal is received. A small number of default handlers are installed: :const:`SIGPIPE` is ignored (so write errors on pipes and sockets can be reported as ordinary Python exceptions) and :const:`SIGINT` is translated into a :exc:`KeyboardInterrupt` exception if the parent process has not changed it." -msgstr "" +msgid "" +"The :func:`signal.signal` function allows defining custom handlers to be " +"executed when a signal is received. A small number of default handlers are " +"installed: :const:`SIGPIPE` is ignored (so write errors on pipes and sockets" +" can be reported as ordinary Python exceptions) and :const:`SIGINT` is " +"translated into a :exc:`KeyboardInterrupt` exception if the parent process " +"has not changed it." +msgstr "" +"تابع :func:`signal.signal` به شما اجازه می‌دهد هندلرهای سفارشی را تعریف" +" کنید تا هنگام دریافت یک سیگنال اجرا شوند. تعداد اندکی از هندلرهای " +"پیش‌فرض نصب شده‌اند: :const:`SIGPIPE` نادیده گرفته می‌شود (تا خطاهای نوشتن " +"روی پایپ‌ها و سوکت‌ها بتوانند به‌عنوان استثناهای معمول پایتون گزارش شوند) و " +":const:`SIGINT` در صورتی که فرایند والد آن را تغییر نداده باشد، به استثنای " +":exc:`KeyboardInterrupt` تبدیل می‌شود." -msgid "A handler for a particular signal, once set, remains installed until it is explicitly reset (Python emulates the BSD style interface regardless of the underlying implementation), with the exception of the handler for :const:`SIGCHLD`, which follows the underlying implementation." +msgid "" +"A handler for a particular signal, once set, remains installed until it is " +"explicitly reset (Python emulates the BSD style interface regardless of the " +"underlying implementation), with the exception of the handler for " +":const:`SIGCHLD`, which follows the underlying implementation." msgstr "" +"یک مدیر برای یک سیگنال خاص، پس از تنظیم شدن، تا زمانی که به‌صراحت بازنشانی " +"نشود، نصب‌شده باقی می‌ماند (پایتون صرف‌نظر از پیاده‌سازی زیربنایی، رابط به " +"سبک BSD را شبیه‌سازی می‌کند)، به استثنای مدیر برای :const:`SIGCHLD` که از " +"پیاده‌سازی زیربنایی پیروی می‌کند." -msgid "On WebAssembly platforms, signals are emulated and therefore behave differently. Several functions and signals are not available on these platforms." +msgid "" +"On WebAssembly platforms, signals are emulated and therefore behave " +"differently. Several functions and signals are not available on these " +"platforms." msgstr "" +"در پلتفرم‌های WebAssembly، سیگنال‌ها شبیه‌سازی می‌شوند و بنابراین رفتار " +"متفاوتی دارند. چندین تابع و سیگنال در این پلتفرم‌ها در دسترس نیستند." msgid "Execution of Python signal handlers" -msgstr "" +msgstr "اجرای هندلرهای سیگنال پایتون" -msgid "A Python signal handler does not get executed inside the low-level (C) signal handler. Instead, the low-level signal handler sets a flag which tells the :term:`virtual machine` to execute the corresponding Python signal handler at a later point (for example, at the next :term:`bytecode` instruction). This has consequences:" +msgid "" +"A Python signal handler does not get executed inside the low-level (C) " +"signal handler. Instead, the low-level signal handler sets a flag which " +"tells the :term:`virtual machine` to execute the corresponding Python signal" +" handler at a later point (for example, at the next :term:`bytecode` " +"instruction). This has consequences:" msgstr "" +"مدیر سیگنال پایتون درون مدیر سیگنال سطح پایین (C) اجرا نمی‌شود. در عوض، مدیر" +" سیگنال سطح پایین پرچمی را تنظیم می‌کند که به :term:`virtual machine` " +"می‌گوید مدیر سیگنال پایتون متناظر را در نقطه‌ای بعدی (برای مثال، در دستور " +":term:`bytecode` بعدی) اجرا کند. این موضوع پیامدهایی دارد:" -msgid "It makes little sense to catch synchronous errors like :const:`SIGFPE` or :const:`SIGSEGV` that are caused by an invalid operation in C code. Python will return from the signal handler to the C code, which is likely to raise the same signal again, causing Python to apparently hang. From Python 3.3 onwards, you can use the :mod:`faulthandler` module to report on synchronous errors." -msgstr "" +msgid "" +"It makes little sense to catch synchronous errors like :const:`SIGFPE` or " +":const:`SIGSEGV` that are caused by an invalid operation in C code. Python " +"will return from the signal handler to the C code, which is likely to raise " +"the same signal again, causing Python to apparently hang. From Python 3.3 " +"onwards, you can use the :mod:`faulthandler` module to report on synchronous" +" errors." +msgstr "" +"گرفتن خطاهای همگام مانند :const:`SIGFPE` یا :const:`SIGSEGV` که در اثر یک " +"عملیات نامعتبر در کد C ایجاد می‌شوند، چندان منطقی نیست. پایتون از " +"هندلر سیگنال به کد C بازمی‌گردد، که احتمال دارد همان سیگنال را دوباره " +"پرتاب کند و باعث شود پایتون ظاهراً هنگ کند. از پایتون 3.3 به بعد، می‌توانید " +"از ماژول :mod:`faulthandler` برای گزارش خطاهای همگام استفاده کنید." -msgid "A long-running calculation implemented purely in C (such as regular expression matching on a large body of text) may run uninterrupted for an arbitrary amount of time, regardless of any signals received. The Python signal handlers will be called when the calculation finishes." +msgid "" +"A long-running calculation implemented purely in C (such as regular " +"expression matching on a large body of text) may run uninterrupted for an " +"arbitrary amount of time, regardless of any signals received. The Python " +"signal handlers will be called when the calculation finishes." msgstr "" +"محاسبه‌ای طولانی‌مدت که به‌طور کامل در C پیاده‌سازی شده باشد (مانند تطبیق " +"عبارت باقاعده روی حجم بزرگی از متن) ممکن است صرف‌نظر از هر سیگنال دریافتی، برای" +" مدت زمانی دلخواه بدون وقفه اجرا شود. هندلرهای سیگنال پایتون هنگامی " +"که محاسبه به پایان برسد فراخوانی خواهند شد." -msgid "If the handler raises an exception, it will be raised \"out of thin air\" in the main thread. See the :ref:`note below ` for a discussion." +msgid "" +"If the handler raises an exception, it will be raised \"out of thin air\" in" +" the main thread. See the :ref:`note below ` for a " +"discussion." msgstr "" +"اگر هندلر (handler) استثنایی را پرتاب کند، آن استثنا «به‌صورت ناگهانی»" +" در نخ اصلی پرتاب خواهد شد. برای توضیحات بیشتر، :ref:`یادداشت زیر ` را ببینید." msgid "Signals and threads" -msgstr "" +msgstr "سیگنال‌ها و نخ‌ها" -msgid "Python signal handlers are always executed in the main Python thread of the main interpreter, even if the signal was received in another thread. This means that signals can't be used as a means of inter-thread communication. You can use the synchronization primitives from the :mod:`threading` module instead." -msgstr "" +msgid "" +"Python signal handlers are always executed in the main Python thread of the " +"main interpreter, even if the signal was received in another thread. This " +"means that signals can't be used as a means of inter-thread communication. " +"You can use the synchronization primitives from the :mod:`threading` module " +"instead." +msgstr "" +"هندلرهای سیگنال پایتون همیشه در نخ اصلی پایتون در مفسر اصلی اجرا " +"می‌شوند، حتی اگر سیگنال در نخ دیگری دریافت شده باشد. این بدان معناست که " +"نمی‌توان از سیگنال‌ها به‌عنوان وسیله‌ای برای ارتباط بین نخ‌ها استفاده کرد. " +"در عوض، می‌توانید از اولیه‌های همگام‌سازی ماژول :mod:`threading` استفاده " +"کنید." -msgid "Besides, only the main thread of the main interpreter is allowed to set a new signal handler." +msgid "" +"Besides, only the main thread of the main interpreter is allowed to set a " +"new signal handler." msgstr "" +"علاوه بر این، فقط نخ اصلی مفسر اصلی مجاز به تنظیم یک مدیر سیگنال (signal " +"handler) جدید است." -msgid "Synchronization primitives such as :class:`threading.Lock` should not be used within signal handlers. Doing so can lead to unexpected deadlocks." +msgid "" +"Synchronization primitives such as :class:`threading.Lock` should not be " +"used within signal handlers. Doing so can lead to unexpected deadlocks." msgstr "" +"نباید از اولیه‌های همگام‌سازی مانند :class:`threading.Lock` در " +"هندلرهای سیگنال استفاده شود. این کار می‌تواند به بن‌بست‌های غیرمنتظره" +" منجر شود." msgid "Module contents" -msgstr "" +msgstr "محتویات ماژول" -msgid "signal (SIG*), handler (:const:`SIG_DFL`, :const:`SIG_IGN`) and sigmask (:const:`SIG_BLOCK`, :const:`SIG_UNBLOCK`, :const:`SIG_SETMASK`) related constants listed below were turned into :class:`enums ` (:class:`Signals`, :class:`Handlers` and :class:`Sigmasks` respectively). :func:`getsignal`, :func:`pthread_sigmask`, :func:`sigpending` and :func:`sigwait` functions return human-readable :class:`enums ` as :class:`Signals` objects." -msgstr "" +msgid "" +"signal (SIG*), handler (:const:`SIG_DFL`, :const:`SIG_IGN`) and sigmask " +"(:const:`SIG_BLOCK`, :const:`SIG_UNBLOCK`, :const:`SIG_SETMASK`) related " +"constants listed below were turned into :class:`enums ` " +"(:class:`Signals`, :class:`Handlers` and :class:`Sigmasks` respectively). " +":func:`getsignal`, :func:`pthread_sigmask`, :func:`sigpending` and " +":func:`sigwait` functions return human-readable :class:`enums " +"` as :class:`Signals` objects." +msgstr "" +"ثابت‌های مرتبط با سیگنال (SIG*)، مدیر (:const:`SIG_DFL`، :const:`SIG_IGN`) و" +" ماسک سیگنال (:const:`SIG_BLOCK`، :const:`SIG_UNBLOCK`، " +":const:`SIG_SETMASK`) که در زیر فهرست شده‌اند، به :class:`enums " +"` تبدیل شده‌اند (به‌ترتیب :class:`Signals`، :class:`Handlers` " +"و :class:`Sigmasks`). توابع :func:`getsignal`، :func:`pthread_sigmask`، " +":func:`sigpending` و :func:`sigwait`، :class:`enums ` " +"قابل‌خواندن برای انسان را به‌صورت اشیای :class:`Signals` بازمی‌گردانند." msgid "The signal module defines three enums:" -msgstr "" +msgstr "ماژول signal سه enum تعریف می‌کند:" -msgid ":class:`enum.IntEnum` collection of SIG* constants and the CTRL_* constants." -msgstr "" +msgid "" +":class:`enum.IntEnum` collection of SIG* constants and the CTRL_* constants." +msgstr ":class:`enum.IntEnum` مجموعه‌ای از ثابت‌های SIG* و ثابت‌های CTRL_*." -msgid ":class:`enum.IntEnum` collection of the constants :const:`SIG_DFL` and :const:`SIG_IGN`." +msgid "" +":class:`enum.IntEnum` collection of the constants :const:`SIG_DFL` and " +":const:`SIG_IGN`." msgstr "" +":class:`enum.IntEnum` مجموعه‌ای از ثابت‌های :const:`SIG_DFL` و " +":const:`SIG_IGN`." -msgid ":class:`enum.IntEnum` collection of the constants :const:`SIG_BLOCK`, :const:`SIG_UNBLOCK` and :const:`SIG_SETMASK`." +msgid "" +":class:`enum.IntEnum` collection of the constants :const:`SIG_BLOCK`, " +":const:`SIG_UNBLOCK` and :const:`SIG_SETMASK`." msgstr "" +"مجموعه‌ی :class:`enum.IntEnum` از ثابت‌های :const:`SIG_BLOCK`، " +":const:`SIG_UNBLOCK` و :const:`SIG_SETMASK`." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "See the man page :manpage:`sigprocmask(2)` and :manpage:`pthread_sigmask(3)` for further information." +msgid "" +"See the man page :manpage:`sigprocmask(2)` and :manpage:`pthread_sigmask(3)`" +" for further information." msgstr "" +"برای اطلاعات بیشتر، صفحه‌های راهنمای :manpage:`sigprocmask(2)` و " +":manpage:`pthread_sigmask(3)` را ببینید." msgid "The variables defined in the :mod:`!signal` module are:" -msgstr "" +msgstr "متغیرهای تعریف‌شده در ماژول :mod:`!signal` عبارتند از:" -msgid "This is one of two standard signal handling options; it will simply perform the default function for the signal. For example, on most systems the default action for :const:`SIGQUIT` is to dump core and exit, while the default action for :const:`SIGCHLD` is to simply ignore it." +msgid "" +"This is one of two standard signal handling options; it will simply perform " +"the default function for the signal. For example, on most systems the " +"default action for :const:`SIGQUIT` is to dump core and exit, while the " +"default action for :const:`SIGCHLD` is to simply ignore it." msgstr "" +"این یکی از دو گزینه‌ی استاندارد مدیریت سیگنال است؛ این گزینه صرفاً رفتار " +"پیش‌فرض سیگنال را اعمال می‌کند. برای مثال، در بیشتر سیستم‌ها رفتار پیش‌فرض " +"برای :const:`SIGQUIT` تخلیه‌ی core (dump core) و خروج است، در حالی که رفتار " +"پیش‌فرض برای :const:`SIGCHLD` صرفاً نادیده گرفتن آن است." -msgid "This is another standard signal handler, which will simply ignore the given signal." +msgid "" +"This is another standard signal handler, which will simply ignore the given " +"signal." msgstr "" +"این یک مدیر سیگنال استاندارد دیگر است که به‌سادگی سیگنال داده‌شده را نادیده " +"می‌گیرد." msgid "Abort signal from :manpage:`abort(3)`." -msgstr "" +msgstr "سیگنال خاتمه (Abort) از :manpage:`abort(3)`." msgid "Timer signal from :manpage:`alarm(2)`." -msgstr "" +msgstr "سیگنال زمان‌سنج از :manpage:`alarm(2)`." msgid "Interrupt from keyboard (CTRL + BREAK)." -msgstr "" +msgstr "وقفه از صفحه‌کلید (CTRL + BREAK)." msgid "Bus error (bad memory access)." -msgstr "" +msgstr "خطای گذرگاه (دسترسی نامعتبر به حافظه)." msgid "Child process stopped or terminated." -msgstr "" +msgstr "فرایند فرزند متوقف شد یا خاتمه یافت." msgid "Alias to :data:`SIGCHLD`." -msgstr "" +msgstr "نام مستعار برای :data:`SIGCHLD`." msgid "Continue the process if it is currently stopped" -msgstr "" +msgstr "اگر فرآیند در حال حاضر متوقف است، آن را ادامه دهید" msgid "Floating-point exception. For example, division by zero." -msgstr "" +msgstr "استثنای ممیز شناور. برای مثال، تقسیم بر صفر." -msgid ":exc:`ZeroDivisionError` is raised when the second argument of a division or modulo operation is zero." +msgid "" +":exc:`ZeroDivisionError` is raised when the second argument of a division or" +" modulo operation is zero." msgstr "" +":exc:`ZeroDivisionError` زمانی پرتاب می‌شود که دومین آرگومان یک عملیات تقسیم" +" یا باقی‌مانده صفر باشد." -msgid "Hangup detected on controlling terminal or death of controlling process." +msgid "" +"Hangup detected on controlling terminal or death of controlling process." msgstr "" +"قطع ارتباط (Hangup) در پایانه هندلر یا مرگ فرایند هندلر شناسایی " +"شد." msgid "Illegal instruction." -msgstr "" +msgstr "دستورالعمل غیرمجاز." msgid "Interrupt from keyboard (CTRL + C)." -msgstr "" +msgstr "وقفه از صفحه‌کلید (CTRL + C)." msgid "Default action is to raise :exc:`KeyboardInterrupt`." -msgstr "" +msgstr "اقدام پیش‌فرض، پرتاب :exc:`KeyboardInterrupt` است." msgid "Kill signal." -msgstr "" +msgstr "سیگنال کشتن (Kill signal)." msgid "It cannot be caught, blocked, or ignored." -msgstr "" +msgstr "نمی‌توان آن را گرفت، مسدود کرد یا نادیده گرفت." msgid "Broken pipe: write to pipe with no readers." -msgstr "" +msgstr "پایپ‌ی شکسته: نوشتن در پایپ‌ای بدون خواننده." msgid "Default action is to ignore the signal." -msgstr "" +msgstr "اقدام پیش‌فرض، نادیده گرفتن سیگنال است." msgid "Profiling timer expired." -msgstr "" +msgstr "زمان‌سنج پروفایل‌سازی منقضی شد." msgid "Terminal quit signal." -msgstr "" +msgstr "سیگنال خروج پایانه." msgid "Segmentation fault: invalid memory reference." -msgstr "" +msgstr "خطای قطعه‌بندی: ارجاع نامعتبر به حافظه." msgid "Stop executing (cannot be caught or ignored)." -msgstr "" +msgstr "توقف اجرا (قابل دریافت یا نادیده‌گرفتن نیست)." -msgid "Stack fault on coprocessor. The Linux kernel does not raise this signal: it can only be raised in user space." +msgid "" +"Stack fault on coprocessor. The Linux kernel does not raise this signal: it " +"can only be raised in user space." msgstr "" +"خطای پشته در هم‌پردازنده. هسته‌ی لینوکس این سیگنال را پرتاب نمی‌کند: فقط " +"می‌تواند در فضای کاربر پرتاب شود." -msgid "On architectures where the signal is available. See the man page :manpage:`signal(7)` for further information." +msgid "" +"On architectures where the signal is available. See the man page " +":manpage:`signal(7)` for further information." msgstr "" +"در معماری‌هایی که سیگنال در دسترس است. برای اطلاعات بیشتر، صفحه‌ی man " +":manpage:`signal(7)` را ببینید." msgid "Termination signal." -msgstr "" +msgstr "سیگنال خاتمه." msgid "User-defined signal 1." -msgstr "" +msgstr "سیگنال ۱ تعریف‌شده توسط کاربر." msgid "User-defined signal 2." -msgstr "" +msgstr "سیگنال ۲ تعریف‌شده توسط کاربر." msgid "Virtual timer expired." -msgstr "" +msgstr "زمان‌سنج مجازی منقضی شد." msgid "Window resize signal." -msgstr "" +msgstr "سیگنال تغییر اندازه‌ی پنجره." msgid "CPU time limit exceeded." -msgstr "" +msgstr "از محدودیت زمان CPU فراتر رفت." -msgid "All the signal numbers are defined symbolically. For example, the hangup signal is defined as :const:`signal.SIGHUP`; the variable names are identical to the names used in C programs, as found in ````. The Unix man page for '``signal``' lists the existing signals (on some systems this is :manpage:`signal(2)`, on others the list is in :manpage:`signal(7)`). Note that not all systems define the same set of signal names; only those names defined by the system are defined by this module." -msgstr "" +msgid "" +"All the signal numbers are defined symbolically. For example, the hangup " +"signal is defined as :const:`signal.SIGHUP`; the variable names are " +"identical to the names used in C programs, as found in ````. The " +"Unix man page for '``signal``' lists the existing signals (on some systems " +"this is :manpage:`signal(2)`, on others the list is in " +":manpage:`signal(7)`). Note that not all systems define the same set of " +"signal names; only those names defined by the system are defined by this " +"module." +msgstr "" +"همه شماره‌های سیگنال به‌صورت نمادین تعریف شده‌اند. برای مثال، سیگنال قطع " +"ارتباط به‌صورت :const:`signal.SIGHUP` تعریف شده است؛ نام متغیرها دقیقاً همان" +" نام‌هایی هستند که در برنامه‌های C استفاده می‌شوند، همان‌طور که در " +"```` آمده است. صفحه راهنمای یونیکس برای «``signal``» سیگنال‌های " +"موجود را فهرست می‌کند (در برخی سیستم‌ها این :manpage:`signal(2)` است، در " +"برخی دیگر فهرست در :manpage:`signal(7)` قرار دارد). توجه داشته باشید که همه " +"سیستم‌ها مجموعه یکسانی از نام‌های سیگنال را تعریف نمی‌کنند؛ این ماژول تنها " +"نام‌هایی را تعریف می‌کند که سیستم آن‌ها را تعریف کرده است." -msgid "The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal can only be used with :func:`os.kill`." +msgid "" +"The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal " +"can only be used with :func:`os.kill`." msgstr "" +"سیگنال متناظر با رویداد فشردن کلید :kbd:`Ctrl+C`. این سیگنال را فقط می‌توان " +"با :func:`os.kill` استفاده کرد." -msgid "The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This signal can only be used with :func:`os.kill`." +msgid "" +"The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This " +"signal can only be used with :func:`os.kill`." msgstr "" +"سیگنال متناظر با رویداد فشردن کلید :kbd:`Ctrl+Break`. این سیگنال فقط " +"می‌تواند با :func:`os.kill` استفاده شود." -msgid "One more than the number of the highest signal number. Use :func:`valid_signals` to get valid signal numbers." +msgid "" +"One more than the number of the highest signal number. Use " +":func:`valid_signals` to get valid signal numbers." msgstr "" +"یک بیشتر از بالاترین شماره‌ی سیگنال. برای دریافت شماره‌های سیگنال معتبر از " +":func:`valid_signals` استفاده کنید." -msgid "Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration." +msgid "" +"Decrements interval timer in real time, and delivers :const:`SIGALRM` upon " +"expiration." msgstr "" +"زمان‌سنج بازه‌ای را در زمان واقعی کاهش می‌دهد و پس از انقضا، " +":const:`SIGALRM` را ارسال می‌کند." -msgid "Decrements interval timer only when the process is executing, and delivers SIGVTALRM upon expiration." +msgid "" +"Decrements interval timer only when the process is executing, and delivers " +"SIGVTALRM upon expiration." msgstr "" +"زمان‌سنج فاصله‌ای را تنها زمانی که فرایند در حال اجرا است کاهش می‌دهد و پس " +"از انقضا، SIGVTALRM را ارسال می‌کند." -msgid "Decrements interval timer both when the process executes and when the system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, this timer is usually used to profile the time spent by the application in user and kernel space. SIGPROF is delivered upon expiration." +msgid "" +"Decrements interval timer both when the process executes and when the system" +" is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, this " +"timer is usually used to profile the time spent by the application in user " +"and kernel space. SIGPROF is delivered upon expiration." msgstr "" +"زمان‌سنج بازه‌ای را هم زمانی که فرایند اجرا می‌شود و هم زمانی که سیستم به " +"نمایندگی از فرایند در حال اجرا است، کاهش می‌دهد. این زمان‌سنج معمولاً همراه " +"با ITIMER_VIRTUAL برای پروفایل‌گیری زمانی که برنامه در فضای کاربر و فضای " +"هسته صرف می‌کند، استفاده می‌شود. SIGPROF پس از انقضا ارسال می‌شود." -msgid "A possible value for the *how* parameter to :func:`pthread_sigmask` indicating that signals are to be blocked." +msgid "" +"A possible value for the *how* parameter to :func:`pthread_sigmask` " +"indicating that signals are to be blocked." msgstr "" +"یک مقدار ممکن برای پارامتر *how* در :func:`pthread_sigmask` که نشان می‌دهد " +"سیگنال‌ها باید مسدود شوند." -msgid "A possible value for the *how* parameter to :func:`pthread_sigmask` indicating that signals are to be unblocked." +msgid "" +"A possible value for the *how* parameter to :func:`pthread_sigmask` " +"indicating that signals are to be unblocked." msgstr "" +"یک مقدار ممکن برای پارامتر *how* در :func:`pthread_sigmask` که نشان می‌دهد " +"سیگنال‌ها باید رفع مسدود شوند." -msgid "A possible value for the *how* parameter to :func:`pthread_sigmask` indicating that the signal mask is to be replaced." +msgid "" +"A possible value for the *how* parameter to :func:`pthread_sigmask` " +"indicating that the signal mask is to be replaced." msgstr "" +"یک مقدار ممکن برای پارامتر *how* در :func:`pthread_sigmask` که نشان می‌دهد " +"ماسک سیگنال (signal mask) باید جایگزین شود." msgid "The :mod:`!signal` module defines one exception:" -msgstr "" +msgstr "ماژول :mod:`!signal` یک استثنا تعریف می‌کند:" -msgid "Raised to signal an error from the underlying :func:`setitimer` or :func:`getitimer` implementation. Expect this error if an invalid interval timer or a negative time is passed to :func:`setitimer`. This error is a subtype of :exc:`OSError`." +msgid "" +"Raised to signal an error from the underlying :func:`setitimer` or " +":func:`getitimer` implementation. Expect this error if an invalid interval " +"timer or a negative time is passed to :func:`setitimer`. This error is a " +"subtype of :exc:`OSError`." msgstr "" +"برای اعلام یک خطا از پیاده‌سازی زیرین :func:`setitimer` یا :func:`getitimer`" +" پرتاب می‌شود. در صورتی که زمان‌سنج بازه‌ای نامعتبر یا زمان منفی به " +":func:`setitimer` داده شود، این خطا مورد انتظار است. این خطا زیرنوعی از " +":exc:`OSError` است." -msgid "This error used to be a subtype of :exc:`IOError`, which is now an alias of :exc:`OSError`." +msgid "" +"This error used to be a subtype of :exc:`IOError`, which is now an alias of " +":exc:`OSError`." msgstr "" +"این خطا پیش‌تر زیرنوعی از :exc:`IOError` بود که اکنون نام مستعار " +":exc:`OSError` است." msgid "The :mod:`!signal` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!signal` توابع زیر را تعریف می‌کند:" -msgid "If *time* is non-zero, this function requests that a :const:`SIGALRM` signal be sent to the process in *time* seconds. Any previously scheduled alarm is canceled (only one alarm can be scheduled at any time). The returned value is then the number of seconds before any previously set alarm was to have been delivered. If *time* is zero, no alarm is scheduled, and any scheduled alarm is canceled. If the return value is zero, no alarm is currently scheduled." -msgstr "" +msgid "" +"If *time* is non-zero, this function requests that a :const:`SIGALRM` signal" +" be sent to the process in *time* seconds. Any previously scheduled alarm is" +" canceled (only one alarm can be scheduled at any time). The returned value" +" is then the number of seconds before any previously set alarm was to have " +"been delivered. If *time* is zero, no alarm is scheduled, and any scheduled " +"alarm is canceled. If the return value is zero, no alarm is currently " +"scheduled." +msgstr "" +"اگر *time* غیرصفر باشد، این تابع درخواست می‌کند که یک سیگنال " +":const:`SIGALRM` پس از *time* ثانیه به فرایند ارسال شود. هر هشدار از پیش " +"زمان‌بندی‌شده لغو می‌شود (در هر زمان فقط یک هشدار می‌تواند زمان‌بندی شود). " +"در این صورت، مقدار بازگشتی تعداد ثانیه‌های باقی‌مانده تا زمانی است که هر " +"هشدار از پیش تنظیم‌شده قرار بود تحویل داده شود. اگر *time* صفر باشد، هشداری " +"زمان‌بندی نمی‌شود و هر هشدار زمان‌بندی‌شده لغو می‌شود. اگر مقدار بازگشتی صفر" +" باشد، در حال حاضر هشداری زمان‌بندی نشده است." msgid "See the man page :manpage:`alarm(2)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه‌ی man :manpage:`alarm(2)` را ببینید." -msgid "Return the current signal handler for the signal *signalnum*. The returned value may be a callable Python object, or one of the special values :const:`signal.SIG_IGN`, :const:`signal.SIG_DFL` or :const:`None`. Here, :const:`signal.SIG_IGN` means that the signal was previously ignored, :const:`signal.SIG_DFL` means that the default way of handling the signal was previously in use, and ``None`` means that the previous signal handler was not installed from Python." -msgstr "" +msgid "" +"Return the current signal handler for the signal *signalnum*. The returned " +"value may be a callable Python object, or one of the special values " +":const:`signal.SIG_IGN`, :const:`signal.SIG_DFL` or :const:`None`. Here, " +":const:`signal.SIG_IGN` means that the signal was previously ignored, " +":const:`signal.SIG_DFL` means that the default way of handling the signal " +"was previously in use, and ``None`` means that the previous signal handler " +"was not installed from Python." +msgstr "" +"مدیر سیگنال فعلی برای سیگنال *signalnum* را برمی‌گرداند. مقدار برگردانده‌شده" +" ممکن است یک شیء پایتونی قابل فراخوانی باشد، یا یکی از مقادیر خاص " +":const:`signal.SIG_IGN`، :const:`signal.SIG_DFL` یا :const:`None`. در اینجا،" +" :const:`signal.SIG_IGN` به این معناست که سیگنال پیش‌تر نادیده گرفته شده " +"است، :const:`signal.SIG_DFL` به این معناست که روش پیش‌فرض رسیدگی به سیگنال " +"پیش‌تر در حال استفاده بوده است، و ``None`` به این معناست که مدیر سیگنال " +"پیشین از پایتون نصب نشده است." -msgid "Returns the description of signal *signalnum*, such as \"Interrupt\" for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. Raises :exc:`ValueError` if *signalnum* is invalid." +msgid "" +"Returns the description of signal *signalnum*, such as \"Interrupt\" for " +":const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. " +"Raises :exc:`ValueError` if *signalnum* is invalid." msgstr "" +"توضیح سیگنال *signalnum* را بازمی‌گرداند، مانند «Interrupt» برای " +":const:`SIGINT`. اگر *signalnum* توضیحی نداشته باشد، :const:`None` را " +"بازمی‌گرداند. اگر *signalnum* نامعتبر باشد، :exc:`ValueError` را پرتاب " +"می‌کند." -msgid "Return the set of valid signal numbers on this platform. This can be less than ``range(1, NSIG)`` if some signals are reserved by the system for internal use." +msgid "" +"Return the set of valid signal numbers on this platform. This can be less " +"than ``range(1, NSIG)`` if some signals are reserved by the system for " +"internal use." msgstr "" +"مجموعه‌ای از شماره‌های سیگنال معتبر در این پلتفرم را برمی‌گرداند. اگر برخی " +"سیگنال‌ها برای استفاده‌ی داخلی توسط سیستم رزرو شده باشند، این مجموعه می‌تواند" +" کمتر از ``range(1, NSIG)`` باشد." -msgid "Cause the process to sleep until a signal is received; the appropriate handler will then be called. Returns nothing." +msgid "" +"Cause the process to sleep until a signal is received; the appropriate " +"handler will then be called. Returns nothing." msgstr "" +"باعث می‌شود فرآیند تا دریافت یک سیگنال متوقف شود؛ سپس هندلر مناسب " +"فراخوانی خواهد شد. چیزی برنمی‌گرداند." msgid "See the man page :manpage:`signal(2)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه راهنمای :manpage:`signal(2)` را ببینید." -msgid "See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` and :func:`sigpending`." +msgid "" +"See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` and " +":func:`sigpending`." msgstr "" +"همچنین :func:`sigwait`، :func:`sigwaitinfo`، :func:`sigtimedwait` و " +":func:`sigpending` را ببینید." msgid "Sends a signal to the calling process. Returns nothing." -msgstr "" +msgstr "یک سیگنال به فرایند فراخوان ارسال می‌کند. چیزی برنمی‌گرداند." -msgid "Send signal *sig* to the process referred to by file descriptor *pidfd*. Python does not currently support the *siginfo* parameter; it must be ``None``. The *flags* argument is provided for future extensions; no flag values are currently defined." +msgid "" +"Send signal *sig* to the process referred to by file descriptor *pidfd*. " +"Python does not currently support the *siginfo* parameter; it must be " +"``None``. The *flags* argument is provided for future extensions; no flag " +"values are currently defined." msgstr "" +"سیگنال *sig* را به فرایندی که با توصیف‌گر فایل *pidfd* به آن اشاره شده است " +"ارسال کنید. پایتون در حال حاضر از پارامتر *siginfo* پشتیبانی نمی‌کند؛ این " +"پارامتر باید ``None`` باشد. آرگومان *flags* برای توسعه‌های آینده در نظر " +"گرفته شده است؛ در حال حاضر هیچ مقدار پرچمی تعریف نشده است." msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "" +"برای اطلاعات بیشتر، به صفحه راهنمای :manpage:`pidfd_send_signal(2)` مراجعه " +"کنید." -msgid "Send the signal *signalnum* to the thread *thread_id*, another thread in the same process as the caller. The target thread can be executing any code (Python or not). However, if the target thread is executing the Python interpreter, the Python signal handlers will be :ref:`executed by the main thread of the main interpreter `. Therefore, the only point of sending a signal to a particular Python thread would be to force a running system call to fail with :exc:`InterruptedError`." -msgstr "" +msgid "" +"Send the signal *signalnum* to the thread *thread_id*, another thread in the" +" same process as the caller. The target thread can be executing any code " +"(Python or not). However, if the target thread is executing the Python " +"interpreter, the Python signal handlers will be :ref:`executed by the main " +"thread of the main interpreter `. Therefore, the only " +"point of sending a signal to a particular Python thread would be to force a " +"running system call to fail with :exc:`InterruptedError`." +msgstr "" +"سیگنال *signalnum* را به نخ *thread_id*، نخ دیگری در همان فرایند فراخواننده،" +" ارسال کنید. نخ هدف می‌تواند در حال اجرای هر کدی (پایتون یا غیرپایتون) باشد." +" با این حال، اگر نخ هدف در حال اجرای مفسر پایتون باشد، هندلرهای " +"سیگنال پایتون :ref:`توسط نخ اصلی مفسر اصلی اجرا خواهند شد `. بنابراین، تنها هدف از ارسال سیگنال به یک نخ پایتونی مشخص این است " +"که یک فراخوانی سیستمی در حال اجرا را وادار کند تا با :exc:`InterruptedError`" +" شکست بخورد." -msgid "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` attribute of :class:`threading.Thread` objects to get a suitable value for *thread_id*." +msgid "" +"Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " +"attribute of :class:`threading.Thread` objects to get a suitable value for " +"*thread_id*." msgstr "" +"برای دریافت یک مقدار مناسب برای *thread_id*، از :func:`threading.get_ident` " +"یا ویژگی :attr:`~threading.Thread.ident` اشیای :class:`threading.Thread` " +"استفاده کنید." -msgid "If *signalnum* is 0, then no signal is sent, but error checking is still performed; this can be used to check if the target thread is still running." +msgid "" +"If *signalnum* is 0, then no signal is sent, but error checking is still " +"performed; this can be used to check if the target thread is still running." msgstr "" +"اگر *signalnum* برابر ۰ باشد، هیچ سیگنالی ارسال نمی‌شود، اما بررسی خطا " +"همچنان انجام می‌شود؛ از این می‌توان برای بررسی این‌که نخ هدف هنوز در حال " +"اجرا است یا خیر استفاده کرد." -msgid "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with arguments ``thread_id``, ``signalnum``." +msgid "" +"Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " +"arguments ``thread_id``, ``signalnum``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``signal.pthread_kill`` را با " +"آرگومان‌های ``thread_id`` و ``signalnum`` پرتاب می‌کند." msgid "See the man page :manpage:`pthread_kill(3)` for further information." msgstr "" +"برای اطلاعات بیشتر، صفحه man مربوط به :manpage:`pthread_kill(3)` را ببینید." msgid "See also :func:`os.kill`." -msgstr "" +msgstr "همچنین ببینید :func:`os.kill`." -msgid "Fetch and/or change the signal mask of the calling thread. The signal mask is the set of signals whose delivery is currently blocked for the caller. Return the old signal mask as a set of signals." +msgid "" +"Fetch and/or change the signal mask of the calling thread. The signal mask " +"is the set of signals whose delivery is currently blocked for the caller. " +"Return the old signal mask as a set of signals." msgstr "" +"ماسک سیگنال نخ فراخوان را واکشی و/یا تغییر می‌دهد. ماسک سیگنال مجموعه‌ای از " +"سیگنال‌ها است که تحویل آن‌ها در حال حاضر برای فراخوان مسدود است. ماسک سیگنال" +" قبلی را به‌عنوان مجموعه‌ای از سیگنال‌ها برمی‌گرداند." -msgid "The behavior of the call is dependent on the value of *how*, as follows." -msgstr "" +msgid "" +"The behavior of the call is dependent on the value of *how*, as follows." +msgstr "رفتار فراخوانی، بسته به مقدار *how*، به شرح زیر است." -msgid ":data:`SIG_BLOCK`: The set of blocked signals is the union of the current set and the *mask* argument." +msgid "" +":data:`SIG_BLOCK`: The set of blocked signals is the union of the current " +"set and the *mask* argument." msgstr "" +":data:`SIG_BLOCK`: مجموعه سیگنال‌های مسدودشده، اجتماع مجموعه فعلی و آرگومان " +"*mask* است." -msgid ":data:`SIG_UNBLOCK`: The signals in *mask* are removed from the current set of blocked signals. It is permissible to attempt to unblock a signal which is not blocked." +msgid "" +":data:`SIG_UNBLOCK`: The signals in *mask* are removed from the current set " +"of blocked signals. It is permissible to attempt to unblock a signal which " +"is not blocked." msgstr "" +":data:`SIG_UNBLOCK`: سیگنال‌های موجود در *mask* از مجموعه‌ی فعلی سیگنال‌های " +"مسدودشده حذف می‌شوند. تلاش برای رفع انسداد سیگنالی که مسدود نیست، مجاز است." -msgid ":data:`SIG_SETMASK`: The set of blocked signals is set to the *mask* argument." +msgid "" +":data:`SIG_SETMASK`: The set of blocked signals is set to the *mask* " +"argument." msgstr "" +":data:`SIG_SETMASK`: مجموعه سیگنال‌های مسدودشده به آرگومان *mask* تنظیم " +"می‌شود." -msgid "*mask* is a set of signal numbers (e.g. {:const:`signal.SIGINT`, :const:`signal.SIGTERM`}). Use :func:`~signal.valid_signals` for a full mask including all signals." +msgid "" +"*mask* is a set of signal numbers (e.g. {:const:`signal.SIGINT`, " +":const:`signal.SIGTERM`}). Use :func:`~signal.valid_signals` for a full mask" +" including all signals." msgstr "" +"*mask* مجموعه‌ای از شماره‌های سیگنال است (مانند {:const:`signal.SIGINT`, " +":const:`signal.SIGTERM`}). برای یک ماسک کامل شامل تمام سیگنال‌ها، از " +":func:`~signal.valid_signals` استفاده کنید." -msgid "For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the signal mask of the calling thread." +msgid "" +"For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the " +"signal mask of the calling thread." msgstr "" +"برای مثال، ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` ماسک سیگنال نخ " +"فراخواننده را می‌خواند." msgid ":data:`SIGKILL` and :data:`SIGSTOP` cannot be blocked." -msgstr "" +msgstr ":data:`SIGKILL` و :data:`SIGSTOP` نمی‌توانند مسدود شوند." msgid "See also :func:`pause`, :func:`sigpending` and :func:`sigwait`." -msgstr "" +msgstr "همچنین :func:`pause`، :func:`sigpending` و :func:`sigwait` را ببینید." -msgid "Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified by *which* to fire after *seconds* (float is accepted, different from :func:`alarm`) and after that every *interval* seconds (if *interval* is non-zero). The interval timer specified by *which* can be cleared by setting *seconds* to zero." -msgstr "" +msgid "" +"Sets given interval timer (one of :const:`signal.ITIMER_REAL`, " +":const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified by " +"*which* to fire after *seconds* (float is accepted, different from " +":func:`alarm`) and after that every *interval* seconds (if *interval* is " +"non-zero). The interval timer specified by *which* can be cleared by setting" +" *seconds* to zero." +msgstr "" +"تایمر بینابینی مشخص‌شده توسط *which* (یکی از :const:`signal.ITIMER_REAL`، " +":const:`signal.ITIMER_VIRTUAL` یا :const:`signal.ITIMER_PROF`) را تنظیم " +"می‌کند تا پس از *seconds* ثانیه فعال شود (float پذیرفته می‌شود، برخلاف " +":func:`alarm`) و پس از آن هر *interval* ثانیه فعال شود (اگر *interval* " +"غیرصفر باشد). تایمر بینابینی مشخص‌شده توسط *which* را می‌توان با تنظیم " +"*seconds* روی صفر پاک کرد." -msgid "When an interval timer fires, a signal is sent to the process. The signal sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`." -msgstr "" +msgid "" +"When an interval timer fires, a signal is sent to the process. The signal " +"sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will " +"deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends " +":const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver " +":const:`SIGPROF`." +msgstr "" +"وقتی یک زمان‌سنج بازه‌ای فعال می‌شود، یک سیگنال به فرایند ارسال می‌شود. " +"سیگنال ارسالی به زمان‌سنج مورد استفاده بستگی دارد؛ " +":const:`signal.ITIMER_REAL` سیگنال :const:`SIGALRM` را ارسال می‌کند، " +":const:`signal.ITIMER_VIRTUAL` سیگنال :const:`SIGVTALRM` را ارسال می‌کند، و " +":const:`signal.ITIMER_PROF` سیگنال :const:`SIGPROF` را ارسال می‌کند." msgid "The old values are returned as a tuple: (delay, interval)." msgstr "" +"مقادیر قدیمی به‌صورت یک تاپلبازگردانده می‌شوند: (delay, interval)." -msgid "Attempting to pass an invalid interval timer will cause an :exc:`ItimerError`." +msgid "" +"Attempting to pass an invalid interval timer will cause an " +":exc:`ItimerError`." msgstr "" +"تلاش برای ارسال یک زمان‌سنج بازه‌ای (interval timer) نامعتبر باعث بروز " +":exc:`ItimerError` می‌شود." msgid "Returns current value of a given interval timer specified by *which*." -msgstr "" +msgstr "مقدار فعلی زمان‌سنج بازه‌ای مشخص‌شده توسط *which* را برمی‌گرداند." -msgid "Set the wakeup file descriptor to *fd*. When a signal your program has registered a signal handler for is received, the signal number is written as a single byte into the fd. If you haven't registered a signal handler for the signals you care about, then nothing will be written to the wakeup fd. This can be used by a library to wakeup a poll or select call, allowing the signal to be fully processed." -msgstr "" +msgid "" +"Set the wakeup file descriptor to *fd*. When a signal your program has " +"registered a signal handler for is received, the signal number is written as" +" a single byte into the fd. If you haven't registered a signal handler for " +"the signals you care about, then nothing will be written to the wakeup fd. " +"This can be used by a library to wakeup a poll or select call, allowing the " +"signal to be fully processed." +msgstr "" +"توصیف‌گر فایل بیدارباش را روی *fd* تنظیم کنید. هرگاه سیگنالی دریافت شود که " +"برنامه‌ی شما برای آن مدیر سیگنال ثبت کرده است، شماره سیگنال به‌صورت یک بایت " +"در آن توصیف‌گر فایل نوشته می‌شود. اگر برای سیگنال‌های موردنظرتان مدیر سیگنال" +" ثبت نکرده باشید، هیچ چیزی در توصیف‌گر فایل بیدارباش نوشته نخواهد شد. یک " +"کتابخانه می‌تواند از این قابلیت برای بیدار کردن یک فراخوانی poll یا select " +"استفاده کند تا سیگنال به‌طور کامل پردازش شود." -msgid "The old wakeup fd is returned (or -1 if file descriptor wakeup was not enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, *fd* must be non-blocking. It is up to the library to remove any bytes from *fd* before calling poll or select again." +msgid "" +"The old wakeup fd is returned (or -1 if file descriptor wakeup was not " +"enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, " +"*fd* must be non-blocking. It is up to the library to remove any bytes from" +" *fd* before calling poll or select again." msgstr "" +"توصیف‌گر فایل بیدارباش قبلی بازگردانده می‌شود (یا -1 اگر بیدارباش توصیف‌گر " +"فایل فعال نشده باشد). اگر *fd* برابر -1 باشد، بیدارباش توصیف‌گر فایل غیرفعال " +"می‌شود. اگر -1 نباشد، *fd* باید غیرمسدود باشد. بر عهده کتابخانه است که پیش " +"از فراخوانی دوباره poll یا select، هر بایتی را از *fd* حذف کند." -msgid "When threads are enabled, this function can only be called from :ref:`the main thread of the main interpreter `; attempting to call it from other threads will cause a :exc:`ValueError` exception to be raised." +msgid "" +"When threads are enabled, this function can only be called from :ref:`the " +"main thread of the main interpreter `; attempting to " +"call it from other threads will cause a :exc:`ValueError` exception to be " +"raised." msgstr "" +"هنگامی که نخ‌ها فعال باشند، این تابع فقط می‌تواند از :ref:`نخ اصلی مفسر اصلی" +" ` فراخوانی شود؛ تلاش برای فراخوانی آن از سایر نخ‌ها " +"باعث پرتاب استثنای :exc:`ValueError` می‌شود." -msgid "There are two common ways to use this function. In both approaches, you use the fd to wake up when a signal arrives, but then they differ in how they determine *which* signal or signals have arrived." +msgid "" +"There are two common ways to use this function. In both approaches, you use " +"the fd to wake up when a signal arrives, but then they differ in how they " +"determine *which* signal or signals have arrived." msgstr "" +"دو روش رایج برای استفاده از این تابع وجود دارد. در هر دو روش، از fd برای " +"بیدار شدن هنگام رسیدن یک سیگنال استفاده می‌کنید، اما این دو در نحوه‌ی تعیین " +"این‌که *کدام* سیگنال یا سیگنال‌ها رسیده‌اند، تفاوت دارند." -msgid "In the first approach, we read the data out of the fd's buffer, and the byte values give you the signal numbers. This is simple, but in rare cases it can run into a problem: generally the fd will have a limited amount of buffer space, and if too many signals arrive too quickly, then the buffer may become full, and some signals may be lost. If you use this approach, then you should set ``warn_on_full_buffer=True``, which will at least cause a warning to be printed to stderr when signals are lost." -msgstr "" +msgid "" +"In the first approach, we read the data out of the fd's buffer, and the byte" +" values give you the signal numbers. This is simple, but in rare cases it " +"can run into a problem: generally the fd will have a limited amount of " +"buffer space, and if too many signals arrive too quickly, then the buffer " +"may become full, and some signals may be lost. If you use this approach, " +"then you should set ``warn_on_full_buffer=True``, which will at least cause " +"a warning to be printed to stderr when signals are lost." +msgstr "" +"در رویکرد اول، داده‌ها را از بافر fd می‌خوانیم، و مقادیر بایت، شماره‌های " +"سیگنال را به شما می‌دهند. این روش ساده است، اما در موارد نادر ممکن است با " +"مشکلی مواجه شود: معمولاً fd مقدار محدودی فضای بافر دارد، و اگر سیگنال‌های " +"زیادی خیلی سریع برسند، ممکن است بافر پر شود و برخی سیگنال‌ها از دست بروند. " +"اگر از این رویکرد استفاده می‌کنید، باید ``warn_on_full_buffer=True`` را " +"تنظیم کنید، که حداقل باعث می‌شود هنگام از دست رفتن سیگنال‌ها، هشداری در " +"stderr چاپ شود." -msgid "In the second approach, we use the wakeup fd *only* for wakeups, and ignore the actual byte values. In this case, all we care about is whether the fd's buffer is empty or non-empty; a full buffer doesn't indicate a problem at all. If you use this approach, then you should set ``warn_on_full_buffer=False``, so that your users are not confused by spurious warning messages." -msgstr "" +msgid "" +"In the second approach, we use the wakeup fd *only* for wakeups, and ignore " +"the actual byte values. In this case, all we care about is whether the fd's " +"buffer is empty or non-empty; a full buffer doesn't indicate a problem at " +"all. If you use this approach, then you should set " +"``warn_on_full_buffer=False``, so that your users are not confused by " +"spurious warning messages." +msgstr "" +"در رویکرد دوم، از fd بیدارباش (wakeup fd) *فقط* برای بیدارباش‌ها استفاده " +"می‌کنیم و مقادیر واقعی بایت‌ها را نادیده می‌گیریم. در این حالت، تنها چیزی که" +" اهمیت دارد این است که بافر fd خالی است یا غیرخالی؛ پر بودن بافر به‌هیچ‌وجه " +"نشان‌دهنده‌ی مشکل نیست. اگر از این رویکرد استفاده می‌کنید، باید " +"``warn_on_full_buffer=False`` را تنظیم کنید تا کاربران شما با پیام‌های هشدار" +" کاذب دچار سردرگمی نشوند." msgid "On Windows, the function now also supports socket handles." -msgstr "" +msgstr "در ویندوز، این تابع اکنون از دسته‌های سوکت نیز پشتیبانی می‌کند." msgid "Added ``warn_on_full_buffer`` parameter." -msgstr "" +msgstr "پارامتر ``warn_on_full_buffer`` افزوده شد." -msgid "Change system call restart behaviour: if *flag* is :const:`False`, system calls will be restarted when interrupted by signal *signalnum*, otherwise system calls will be interrupted. Returns nothing." +msgid "" +"Change system call restart behaviour: if *flag* is :const:`False`, system " +"calls will be restarted when interrupted by signal *signalnum*, otherwise " +"system calls will be interrupted. Returns nothing." msgstr "" +"رفتار راه‌اندازی مجدد فراخوانی سیستم را تغییر می‌دهد: اگر *flag* برابر " +":const:`False` باشد، فراخوانی‌های سیستم هنگامی که با سیگنال *signalnum* قطع " +"شوند دوباره راه‌اندازی می‌شوند، در غیر این صورت فراخوانی‌های سیستم قطع " +"می‌شوند. چیزی برنمی‌گرداند." msgid "See the man page :manpage:`siginterrupt(3)` for further information." msgstr "" +"برای اطلاعات بیشتر، صفحه راهنمای :manpage:`siginterrupt(3)` را ببینید." -msgid "Note that installing a signal handler with :func:`signal` will reset the restart behaviour to interruptible by implicitly calling :c:func:`!siginterrupt` with a true *flag* value for the given signal." +msgid "" +"Note that installing a signal handler with :func:`signal` will reset the " +"restart behaviour to interruptible by implicitly calling " +":c:func:`!siginterrupt` with a true *flag* value for the given signal." msgstr "" +"توجه داشته باشید که نصب یک هندلر سیگنال با :func:`signal`، رفتار شروع" +" مجدد را از طریق فراخوانی ضمنی :c:func:`!siginterrupt` با مقدار درست برای " +"*flag* مربوط به سیگنال مورد نظر، به حالت قابل‌قطع بازنشانی می‌کند." -msgid "Set the handler for signal *signalnum* to the function *handler*. *handler* can be a callable Python object taking two arguments (see below), or one of the special values :const:`signal.SIG_IGN` or :const:`signal.SIG_DFL`. The previous signal handler will be returned (see the description of :func:`getsignal` above). (See the Unix man page :manpage:`signal(2)` for further information.)" -msgstr "" +msgid "" +"Set the handler for signal *signalnum* to the function *handler*. *handler*" +" can be a callable Python object taking two arguments (see below), or one of" +" the special values :const:`signal.SIG_IGN` or :const:`signal.SIG_DFL`. The" +" previous signal handler will be returned (see the description of " +":func:`getsignal` above). (See the Unix man page :manpage:`signal(2)` for " +"further information.)" +msgstr "" +"مدیر سیگنال *signalnum* را روی تابع *handler* تنظیم کنید. *handler* می‌تواند" +" یک شیء پایتونی فراخوان‌پذیر باشد که دو آرگومان می‌پذیرد (در زیر ببینید)، یا" +" یکی از مقادیر ویژه :const:`signal.SIG_IGN` یا :const:`signal.SIG_DFL`. مدیر" +" سیگنال پیشین برگردانده خواهد شد (به توضیح :func:`getsignal` در بالا مراجعه " +"کنید). (برای اطلاعات بیشتر، صفحه‌ی man یونیکس :manpage:`signal(2)` را " +"ببینید.)" -msgid "The *handler* is called with two arguments: the signal number and the current stack frame (``None`` or a frame object; for a description of frame objects, see the :ref:`description in the type hierarchy ` or see the attribute descriptions in the :mod:`inspect` module)." +msgid "" +"The *handler* is called with two arguments: the signal number and the " +"current stack frame (``None`` or a frame object; for a description of frame " +"objects, see the :ref:`description in the type hierarchy ` or" +" see the attribute descriptions in the :mod:`inspect` module)." msgstr "" +"*هندلر* (handler) با دو آرگومان فراخوانی می‌شود: شماره‌ی سیگنال و فریم" +" پشته‌ی جاری (``None`` یا یک شیء فریم؛ برای توضیح اشیای فریم، :ref:`توضیح در" +" سلسله‌مراتب نوع ` یا توضیحات ویژگی‌ها در ماژول " +":mod:`inspect` را ببینید)." -msgid "On Windows, :func:`signal` can only be called with :const:`SIGABRT`, :const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:`SIGTERM`, or :const:`SIGBREAK`. A :exc:`ValueError` will be raised in any other case. Note that not all systems define the same set of signal names; an :exc:`AttributeError` will be raised if a signal name is not defined as ``SIG*`` module level constant." -msgstr "" +msgid "" +"On Windows, :func:`signal` can only be called with :const:`SIGABRT`, " +":const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, " +":const:`SIGTERM`, or :const:`SIGBREAK`. A :exc:`ValueError` will be raised " +"in any other case. Note that not all systems define the same set of signal " +"names; an :exc:`AttributeError` will be raised if a signal name is not " +"defined as ``SIG*`` module level constant." +msgstr "" +"در ویندوز، :func:`signal` را فقط می‌توان با :const:`SIGABRT`، " +":const:`SIGFPE`، :const:`SIGILL`، :const:`SIGINT`، :const:`SIGSEGV`، " +":const:`SIGTERM` یا :const:`SIGBREAK` فراخوانی کرد. در هر حالت دیگر، یک " +":exc:`ValueError` پرتاب خواهد شد. توجه داشته باشید که همه‌ی سیستم‌ها مجموعه‌ی " +"یکسانی از نام‌های سیگنال را تعریف نمی‌کنند؛ اگر یک نام سیگنال به‌عنوان ثابت " +"سطح ماژول ``SIG*`` تعریف نشده باشد، یک :exc:`AttributeError` پرتاب خواهد شد." -msgid "Examine the set of signals that are pending for delivery to the calling thread (i.e., the signals which have been raised while blocked). Return the set of the pending signals." +msgid "" +"Examine the set of signals that are pending for delivery to the calling " +"thread (i.e., the signals which have been raised while blocked). Return the" +" set of the pending signals." msgstr "" +"مجموعه سیگنال‌هایی را که در انتظار تحویل به نخ فراخوان هستند (یعنی " +"سیگنال‌هایی که در حین مسدود بودن پرتاب شده‌اند) بررسی کنید. مجموعه " +"سیگنال‌های در انتظار را برگردانید." msgid "See the man page :manpage:`sigpending(2)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه‌ی man :manpage:`sigpending(2)` را ببینید." msgid "See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`." msgstr "" +"همچنین ببینید :func:`pause`، :func:`pthread_sigmask` و :func:`sigwait`." -msgid "Suspend execution of the calling thread until the delivery of one of the signals specified in the signal set *sigset*. The function accepts the signal (removes it from the pending list of signals), and returns the signal number." +msgid "" +"Suspend execution of the calling thread until the delivery of one of the " +"signals specified in the signal set *sigset*. The function accepts the " +"signal (removes it from the pending list of signals), and returns the signal" +" number." msgstr "" +"اجرای نخ فراخوان را تا تحویل یکی از سیگنال‌های مشخص‌شده در مجموعه سیگنال " +"*sigset* معلق می‌کند. این تابع سیگنال را می‌پذیرد (آن را از فهرست سیگنال‌های" +" در انتظار حذف می‌کند) و شماره سیگنال را برمی‌گرداند." msgid "See the man page :manpage:`sigwait(3)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه‌ی man :manpage:`sigwait(3)` را ببینید." -msgid "See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:`sigwaitinfo` and :func:`sigtimedwait`." +msgid "" +"See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, " +":func:`sigwaitinfo` and :func:`sigtimedwait`." msgstr "" +"همچنین ببینید :func:`pause`، :func:`pthread_sigmask`، :func:`sigpending`، " +":func:`sigwaitinfo` و :func:`sigtimedwait`." -msgid "Suspend execution of the calling thread until the delivery of one of the signals specified in the signal set *sigset*. The function accepts the signal and removes it from the pending list of signals. If one of the signals in *sigset* is already pending for the calling thread, the function will return immediately with information about that signal. The signal handler is not called for the delivered signal. The function raises an :exc:`InterruptedError` if it is interrupted by a signal that is not in *sigset*." -msgstr "" +msgid "" +"Suspend execution of the calling thread until the delivery of one of the " +"signals specified in the signal set *sigset*. The function accepts the " +"signal and removes it from the pending list of signals. If one of the " +"signals in *sigset* is already pending for the calling thread, the function " +"will return immediately with information about that signal. The signal " +"handler is not called for the delivered signal. The function raises an " +":exc:`InterruptedError` if it is interrupted by a signal that is not in " +"*sigset*." +msgstr "" +"اجرای نخ فراخوان را تا تحویل یکی از سیگنال‌های مشخص‌شده در مجموعه سیگنال " +"*sigset* معلق می‌کند. تابع سیگنال را می‌پذیرد و آن را از فهرست سیگنال‌های در" +" انتظار حذف می‌کند. اگر یکی از سیگنال‌های درون *sigset* از قبل برای نخ " +"فراخوان در انتظار باشد، تابع بلافاصله همراه با اطلاعاتی درباره آن سیگنال " +"بازگشت می‌کند. هندلر سیگنال برای سیگنال تحویل‌شده فراخوانی نمی‌شود. " +"اگر تابع توسط سیگنالی که در *sigset* نیست قطع شود، یک " +":exc:`InterruptedError` را پرتاب می‌کند." -msgid "The return value is an object representing the data contained in the ``siginfo_t`` structure, namely: ``si_signo``, ``si_code``, ``si_errno``, ``si_pid``, ``si_uid``, ``si_status``, ``si_band``." +msgid "" +"The return value is an object representing the data contained in the " +"``siginfo_t`` structure, namely: ``si_signo``, ``si_code``, ``si_errno``, " +"``si_pid``, ``si_uid``, ``si_status``, ``si_band``." msgstr "" +"مقدار بازگشتی یک شیء است که داده‌های موجود در ساختار ``siginfo_t`` را نشان " +"می‌دهد، یعنی: ``si_signo``، ``si_code``، ``si_errno``، ``si_pid``، " +"``si_uid``، ``si_status``، ``si_band``." msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه‌ی man :manpage:`sigwaitinfo(2)` را ببینید." msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`." -msgstr "" +msgstr "همچنین ببینید :func:`pause`، :func:`sigwait` و :func:`sigtimedwait`." -msgid "The function is now retried if interrupted by a signal not in *sigset* and the signal handler does not raise an exception (see :pep:`475` for the rationale)." +msgid "" +"The function is now retried if interrupted by a signal not in *sigset* and " +"the signal handler does not raise an exception (see :pep:`475` for the " +"rationale)." msgstr "" +"این تابع اکنون در صورتی که توسط سیگنالی که در *sigset* نیست قطع شود و " +"هندلر سیگنال استثنایی پرتاب نکند، دوباره اجرا می‌شود (برای دلیل این " +"موضوع :pep:`475` را ببینید)." -msgid "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument specifying a timeout. If *timeout* is specified as ``0``, a poll is performed. Returns :const:`None` if a timeout occurs." +msgid "" +"Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " +"specifying a timeout. If *timeout* is specified as ``0``, a poll is " +"performed. Returns :const:`None` if a timeout occurs." msgstr "" +"مانند :func:`sigwaitinfo`، اما یک آرگومان *timeout* اضافی برای تعیین " +"مهلت زمانی می‌گیرد. اگر *timeout* به‌صورت ``0`` تعیین شود، یک پایش (poll) " +"انجام می‌شود. در صورت رخ دادن مهلت زمانی، :const:`None` را برمی‌گرداند." msgid "See the man page :manpage:`sigtimedwait(2)` for further information." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه‌ی man :manpage:`sigtimedwait(2)` را ببینید." msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`." -msgstr "" +msgstr "همچنین ببینید :func:`pause`، :func:`sigwait` و :func:`sigwaitinfo`." -msgid "The function is now retried with the recomputed *timeout* if interrupted by a signal not in *sigset* and the signal handler does not raise an exception (see :pep:`475` for the rationale)." +msgid "" +"The function is now retried with the recomputed *timeout* if interrupted by " +"a signal not in *sigset* and the signal handler does not raise an exception " +"(see :pep:`475` for the rationale)." msgstr "" +"این تابع اکنون در صورتی که با سیگنالی خارج از *sigset* قطع شود و هندلر" +" سیگنال استثنایی پرتاب نکند، با *timeout* دوباره محاسبه‌شده مجدداً اجرا " +"می‌شود (برای دلیل، :pep:`475` را ببینید)." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "Here is a minimal example program. It uses the :func:`alarm` function to limit the time spent waiting to open a file; this is useful if the file is for a serial device that may not be turned on, which would normally cause the :func:`os.open` to hang indefinitely. The solution is to set a 5-second alarm before opening the file; if the operation takes too long, the alarm signal will be sent, and the handler raises an exception. ::" -msgstr "" +msgid "" +"Here is a minimal example program. It uses the :func:`alarm` function to " +"limit the time spent waiting to open a file; this is useful if the file is " +"for a serial device that may not be turned on, which would normally cause " +"the :func:`os.open` to hang indefinitely. The solution is to set a 5-second" +" alarm before opening the file; if the operation takes too long, the alarm " +"signal will be sent, and the handler raises an exception. ::" +msgstr "" +"در اینجا یک برنامه نمونه حداقلی آمده است. این برنامه از تابع :func:`alarm` " +"برای محدود کردن زمان انتظار برای باز کردن یک فایل استفاده می‌کند؛ این کار " +"زمانی مفید است که فایل مربوط به یک دستگاه سریال باشد که ممکن است روشن نباشد،" +" وضعیتی که در حالت عادی باعث می‌شود :func:`os.open` به‌طور نامحدود معلق " +"بماند. راه‌حل، تنظیم یک زنگ ۵ ثانیه‌ای پیش از باز کردن فایل است؛ اگر عملیات " +"بیش از حد طول بکشد، سیگنال زنگ ارسال خواهد شد و مدیر استثنایی را پرتاب " +"می‌کند. ::" msgid "" "import signal, os\n" @@ -437,12 +960,37 @@ msgid "" "\n" "signal.alarm(0) # Disable the alarm" msgstr "" +"import signal, os\n" +"\n" +"def handler(signum, frame):\n" +" signame = signal.Signals(signum).name\n" +" print(f'Signal handler called with signal {signame} ({signum})')\n" +" raise OSError(\"Couldn't open device!\")\n" +"\n" +"# Set the signal handler and a 5-second alarm\n" +"signal.signal(signal.SIGALRM, handler)\n" +"signal.alarm(5)\n" +"\n" +"# This open() may hang indefinitely\n" +"fd = os.open('/dev/ttyS0', os.O_RDWR)\n" +"\n" +"signal.alarm(0) # Disable the alarm" msgid "Note on SIGPIPE" -msgstr "" +msgstr "یادداشتی درباره SIGPIPE" -msgid "Piping output of your program to tools like :manpage:`head(1)` will cause a :const:`SIGPIPE` signal to be sent to your process when the receiver of its standard output closes early. This results in an exception like :code:`BrokenPipeError: [Errno 32] Broken pipe`. To handle this case, wrap your entry point to catch this exception as follows::" -msgstr "" +msgid "" +"Piping output of your program to tools like :manpage:`head(1)` will cause a " +":const:`SIGPIPE` signal to be sent to your process when the receiver of its " +"standard output closes early. This results in an exception like " +":code:`BrokenPipeError: [Errno 32] Broken pipe`. To handle this case, wrap " +"your entry point to catch this exception as follows::" +msgstr "" +"هدایت خروجی برنامه‌تان به ابزارهایی مانند :manpage:`head(1)` باعث می‌شود " +"هنگامی که دریابندهی خروجی استاندارد آن زودتر بسته شود، یک سیگنال " +":const:`SIGPIPE` به فرایند شما ارسال شود. این امر به استثنایی مانند " +":code:`BrokenPipeError: [Errno 32] Broken pipe` منجر می‌شود. برای مدیریت این" +" حالت، نقطه ورود خود را به‌شکل زیر بپوشانید تا این استثنا را بگیرد::" msgid "" "import os\n" @@ -466,18 +1014,60 @@ msgid "" "if __name__ == '__main__':\n" " main()" msgstr "" +"import os\n" +"import sys\n" +"\n" +"def main():\n" +" try:\n" +" # شبیه‌سازی خروجی بزرگ (کد شما جایگزین این حلقه می‌شود)\n" +" for x in range(10000):\n" +" print(\"y\")\n" +" # خروجی را در اینجا تخلیه کنید تا SIGPIPE در داخل این بلوک try\n" +" # فعال شود.\n" +" sys.stdout.flush()\n" +" except BrokenPipeError:\n" +" # پایتون در هنگام خروج، جریان‌های استاندارد را تخلیه می‌کند؛ خروجی باقی‌مانده را\n" +" # به devnull هدایت کنید تا از BrokenPipeError دیگر در هنگام خروج جلوگیری شود\n" +" devnull = os.open(os.devnull, os.O_WRONLY)\n" +" os.dup2(devnull, sys.stdout.fileno())\n" +" sys.exit(1) # پایتون هنگام EPIPE با کد خطای 1 خارج می‌شود\n" +"\n" +"if __name__ == '__main__':\n" +" main()" -msgid "Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit unexpectedly whenever any socket connection is interrupted while your program is still writing to it." +msgid "" +"Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to " +"avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit " +"unexpectedly whenever any socket connection is interrupted while your " +"program is still writing to it." msgstr "" +"برای اجتناب از :exc:`BrokenPipeError`، رفتار :const:`SIGPIPE` را روی " +":const:`SIG_DFL` تنظیم نکنید. این کار باعث می‌شود برنامه شما هرگاه اتصال " +"سوکتی در حالی که برنامه هنوز در حال نوشتن روی آن است قطع شود، به‌طور " +"غیرمنتظره‌ای خارج شود." msgid "Note on Signal Handlers and Exceptions" -msgstr "" +msgstr "یادداشتی درباره‌ی مدیران سیگنال و استثناها" -msgid "If a signal handler raises an exception, the exception will be propagated to the main thread and may be raised after any :term:`bytecode` instruction. Most notably, a :exc:`KeyboardInterrupt` may appear at any point during execution. Most Python code, including the standard library, cannot be made robust against this, and so a :exc:`KeyboardInterrupt` (or any other exception resulting from a signal handler) may on rare occasions put the program in an unexpected state." -msgstr "" +msgid "" +"If a signal handler raises an exception, the exception will be propagated to" +" the main thread and may be raised after any :term:`bytecode` instruction. " +"Most notably, a :exc:`KeyboardInterrupt` may appear at any point during " +"execution. Most Python code, including the standard library, cannot be made " +"robust against this, and so a :exc:`KeyboardInterrupt` (or any other " +"exception resulting from a signal handler) may on rare occasions put the " +"program in an unexpected state." +msgstr "" +"اگر یک مدیر سیگنال استثنایی را پرتاب کند، آن استثنا به نخ اصلی منتقل می‌شود " +"و ممکن است پس از هر دستور :term:`bytecode` پرتاب شود. به‌ویژه، ممکن است " +":exc:`KeyboardInterrupt` در هر نقطه‌ای از اجرا رخ دهد. نمی‌توان بیشتر کدهای " +"پایتون، از جمله کتابخانه استاندارد، را در برابر این حالت مقاوم کرد، و " +"بنابراین یک :exc:`KeyboardInterrupt` (یا هر استثنای دیگری که از یک مدیر " +"سیگنال ناشی می‌شود) ممکن است در موارد نادر برنامه را در وضعیت غیرمنتظره‌ای " +"قرار دهد." msgid "To illustrate this issue, consider the following code::" -msgstr "" +msgstr "برای روشن‌کردن این مسئله، کد زیر را در نظر بگیرید::" msgid "" "class SpamContext:\n" @@ -495,9 +1085,37 @@ msgid "" " ...\n" " self.lock.release()" msgstr "" +"class SpamContext:\n" +" def __init__(self):\n" +" self.lock = threading.Lock()\n" +"\n" +" def __enter__(self):\n" +" # اگر KeyboardInterrupt در اینجا رخ دهد، همه‌چیز درست است\n" +" self.lock.acquire()\n" +" # اگر KeyboardInterrupt در اینجا رخ دهد، __exit__ فراخوانی نخواهد شد\n" +" ...\n" +" # KeyboardInterrupt ممکن است درست پیش از بازگشت تابع رخ دهد\n" +"\n" +" def __exit__(self, exc_type, exc_val, exc_tb):\n" +" ...\n" +" self.lock.release()" -msgid "For many programs, especially those that merely want to exit on :exc:`KeyboardInterrupt`, this is not a problem, but applications that are complex or require high reliability should avoid raising exceptions from signal handlers. They should also avoid catching :exc:`KeyboardInterrupt` as a means of gracefully shutting down. Instead, they should install their own :const:`SIGINT` handler. Below is an example of an HTTP server that avoids :exc:`KeyboardInterrupt`::" -msgstr "" +msgid "" +"For many programs, especially those that merely want to exit on " +":exc:`KeyboardInterrupt`, this is not a problem, but applications that are " +"complex or require high reliability should avoid raising exceptions from " +"signal handlers. They should also avoid catching :exc:`KeyboardInterrupt` as" +" a means of gracefully shutting down. Instead, they should install their " +"own :const:`SIGINT` handler. Below is an example of an HTTP server that " +"avoids :exc:`KeyboardInterrupt`::" +msgstr "" +"برای بسیاری از برنامه‌ها، به‌ویژه آن‌هایی که صرفاً می‌خواهند در صورت بروز " +":exc:`KeyboardInterrupt` خارج شوند، این یک مشکل نیست، اما برنامه‌های کاربردی" +" پیچیده یا نیازمند قابلیت اطمینان بالا باید از پرتاب استثنا از درون هندلرهای " +"سیگنال خودداری کنند. آن‌ها همچنین باید از گرفتن :exc:`KeyboardInterrupt` " +"به‌عنوان وسیله‌ای برای خاموش شدن ایمن خودداری کنند. در عوض، باید مدیر " +":const:`SIGINT` اختصاصی خود را نصب کنند. در زیر مثالی از یک کارساز HTTP آمده" +" است که از :exc:`KeyboardInterrupt` اجتناب می‌کند::" msgid "" "import signal\n" @@ -530,3 +1148,32 @@ msgid "" "serve_forever(httpd)\n" "print(\"Shutdown...\")" msgstr "" +"import signal\n" +"import socket\n" +"from selectors import DefaultSelector, EVENT_READ\n" +"from http.server import HTTPServer, SimpleHTTPRequestHandler\n" +"\n" +"interrupt_read, interrupt_write = socket.socketpair()\n" +"\n" +"def handler(signum, frame):\n" +" print('Signal handler called with signal', signum)\n" +" interrupt_write.send(b'\\0')\n" +"signal.signal(signal.SIGINT, handler)\n" +"\n" +"def serve_forever(httpd):\n" +" sel = DefaultSelector()\n" +" sel.register(interrupt_read, EVENT_READ)\n" +" sel.register(httpd, EVENT_READ)\n" +"\n" +" while True:\n" +" for key, _ in sel.select():\n" +" if key.fileobj == interrupt_read:\n" +" interrupt_read.recv(1)\n" +" return\n" +" if key.fileobj == httpd:\n" +" httpd.handle_request()\n" +"\n" +"print(\"Serving on port 8000\")\n" +"httpd = HTTPServer(('', 8000), SimpleHTTPRequestHandler)\n" +"serve_forever(httpd)\n" +"print(\"Shutdown...\")" diff --git a/library/site.po b/library/site.po index 90b72acbd..cce0fdc61 100644 --- a/library/site.po +++ b/library/site.po @@ -25,46 +25,166 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!site` --- Site-specific configuration hook" -msgstr "" +msgstr ":mod:`!site` --- قلاب پیکربندی مختص سایت" msgid "**Source code:** :source:`Lib/site.py`" -msgstr "" +msgstr ":source:`Lib/site.py`" -msgid "**This module is automatically imported during initialization.** The automatic import can be suppressed using the interpreter's :option:`-S` option." +msgid "" +"**This module is automatically imported during initialization.** The " +"automatic import can be suppressed using the interpreter's :option:`-S` " +"option." msgstr "" +"این ماژول در حین راه‌اندازی به‌طور خودکار ایمپورت می‌شود. می‌توان با استفاده" +" از گزینه‌ی :option:`-S` مفسر، از ایمپورت خودکار جلوگیری کرد." -msgid "Importing this module normally appends site-specific paths to the module search path and adds :ref:`callables `, including :func:`help` to the built-in namespace. However, Python startup option :option:`-S` blocks this and this module can be safely imported with no automatic modifications to the module search path or additions to the builtins. To explicitly trigger the usual site-specific additions, call the :func:`main` function." -msgstr "" +msgid "" +"Importing this module normally appends site-specific paths to the module " +"search path and adds :ref:`callables `, including :func:`help` " +"to the built-in namespace. However, Python startup option :option:`-S` " +"blocks this and this module can be safely imported with no automatic " +"modifications to the module search path or additions to the builtins. To " +"explicitly trigger the usual site-specific additions, call the :func:`main` " +"function." +msgstr "" +"ایمپورت این ماژول معمولاً مسیرهای مختص سایت را به مسیر جستجوی ماژول اضافه " +"می‌کند و :ref:`callables `، از جمله :func:`help`، را به " +"فضای نام توکار می‌افزاید. با این حال، گزینه‌ی راه‌اندازی پایتون :option:`-S`" +" این را مسدود می‌کند و می‌توان این ماژول را به‌صورت امن، بدون هیچ‌گونه تغییر" +" خودکار در مسیر جستجوی ماژول یا افزودن موارد به توکارها، ایمپورت کرد. برای " +"فعال‌سازی صریح افزودن‌های معمول مختص سایت، تابع :func:`main` را فراخوانی " +"کنید." -msgid "Importing the module used to trigger paths manipulation even when using :option:`-S`." +msgid "" +"Importing the module used to trigger paths manipulation even when using " +":option:`-S`." msgstr "" +"ایمپورت کردن ماژول، پیش‌تر حتی در صورت استفاده از :option:`-S` نیز باعث " +"دست‌کاری مسیرها می‌شد." -msgid "It starts by constructing up to four directories from a head and a tail part. For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; empty heads are skipped. For the tail part, it uses the empty string and then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y[t]}/site-packages` (on Unix and macOS). (The optional suffix \"t\" indicates the :term:`free-threaded build`, and is appended if ``\"t\"`` is present in the :data:`sys.abiflags` constant.) For each of the distinct head-tail combinations, it sees if it refers to an existing directory, and if so, adds it to ``sys.path`` and also inspects the newly added path for configuration files." -msgstr "" +msgid "" +"It starts by constructing up to four directories from a head and a tail " +"part. For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; " +"empty heads are skipped. For the tail part, it uses the empty string and " +"then :file:`lib/site-packages` (on Windows) or " +":file:`lib/python{X.Y[t]}/site-packages` (on Unix and macOS). (The optional " +"suffix \"t\" indicates the :term:`free-threaded build`, and is appended if " +"``\"t\"`` is present in the :data:`sys.abiflags` constant.) For each of the " +"distinct head-tail combinations, it sees if it refers to an existing " +"directory, and if so, adds it to ``sys.path`` and also inspects the newly " +"added path for configuration files." +msgstr "" +"این کار با ساختن حداکثر چهار پوشه از یک بخش سر و یک بخش دم آغاز می‌شود. برای" +" بخش سر، از ``sys.prefix`` و ``sys.exec_prefix`` استفاده می‌کند؛ بخش‌های سر " +"خالی نادیده گرفته می‌شوند. برای بخش دم، از رشته خالی و سپس :file:`lib/site-" +"packages` (در ویندوز) یا :file:`lib/python{X.Y[t]}/site-packages` (در یونیکس" +" و macOS) استفاده می‌کند. (پسوند اختیاری \"t\" نشان‌دهنده‌ی :term:`free-" +"threaded build` است و در صورتی اضافه می‌شود که ``\"t\"`` در ثابت " +":data:`sys.abiflags` وجود داشته باشد.) برای هر یک از ترکیب‌های متمایز سر و " +"دم، بررسی می‌کند که آیا آن ترکیب به یک پوشه موجود اشاره دارد یا خیر، و در " +"این صورت، آن را به ``sys.path`` اضافه می‌کند و همچنین مسیر تازه اضافه‌شده را" +" برای فایل‌های پیکربندی بررسی می‌کند." msgid "Support for the \"site-python\" directory has been removed." -msgstr "" +msgstr "پشتیبانی از پوشه‌ی «site-python» حذف شده است." -msgid "On Unix, :term:`Free threading ` Python installations are identified by the \"t\" suffix in the version-specific directory name, such as :file:`lib/python3.13t/`." +msgid "" +"On Unix, :term:`Free threading ` Python installations are " +"identified by the \"t\" suffix in the version-specific directory name, such " +"as :file:`lib/python3.13t/`." msgstr "" +"در یونیکس، نصب‌های پایتون :term:`نخ‌آزاد ` با پسوند «t» در " +"نام پوشه‌ی مختص نسخه شناسایی می‌شوند، مانند :file:`lib/python3.13t/`." -msgid ":mod:`!site` is no longer responsible for updating :data:`sys.prefix` and :data:`sys.exec_prefix` on :ref:`sys-path-init-virtual-environments`. This is now done during the :ref:`path initialization `. As a result, under :ref:`sys-path-init-virtual-environments`, :data:`sys.prefix` and :data:`sys.exec_prefix` no longer depend on the :mod:`!site` initialization, and are therefore unaffected by :option:`-S`." -msgstr "" +msgid "" +":mod:`!site` is no longer responsible for updating :data:`sys.prefix` and " +":data:`sys.exec_prefix` on :ref:`sys-path-init-virtual-environments`. This " +"is now done during the :ref:`path initialization `. As a " +"result, under :ref:`sys-path-init-virtual-environments`, :data:`sys.prefix` " +"and :data:`sys.exec_prefix` no longer depend on the :mod:`!site` " +"initialization, and are therefore unaffected by :option:`-S`." +msgstr "" +":mod:`!site` دیگر مسئول به‌روزرسانی :data:`sys.prefix` و " +":data:`sys.exec_prefix` در :ref:`sys-path-init-virtual-environments` نیست. " +"این کار اکنون در حین :ref:`مقداردهی اولیه مسیر ` انجام " +"می‌شود. در نتیجه، در :ref:`sys-path-init-virtual-environments`، " +":data:`sys.prefix` و :data:`sys.exec_prefix` دیگر به مقداردهی اولیه " +":mod:`!site` وابسته نیستند و بنابراین تحت تأثیر :option:`-S` قرار نمی‌گیرند." -msgid "When running under a :ref:`virtual environment `, the ``pyvenv.cfg`` file in :data:`sys.prefix` is checked for site-specific configurations. If the ``include-system-site-packages`` key exists and is set to ``true`` (case-insensitive), the system-level prefixes will be searched for site-packages, otherwise they won't." -msgstr "" +msgid "" +"When running under a :ref:`virtual environment `, the ``pyvenv.cfg`` file in :data:`sys.prefix` is checked for" +" site-specific configurations. If the ``include-system-site-packages`` key " +"exists and is set to ``true`` (case-insensitive), the system-level prefixes " +"will be searched for site-packages, otherwise they won't." +msgstr "" +"هنگام اجرا در یک :ref:`محیط مجازی `، " +"فایل ``pyvenv.cfg`` در :data:`sys.prefix` از نظر پیکربندی‌های خاص سایت بررسی" +" می‌شود. اگر کلید ``include-system-site-packages`` وجود داشته باشد و روی " +"``true`` تنظیم شده باشد (بدون حساسیت به بزرگی و کوچکی حروف)، پیشوندهای سطح " +"سیستم برای site-packages جستجو خواهند شد، در غیر این صورت جستجو نخواهند شد." -msgid "A path configuration file is a file whose name has the form :file:`{name}.pth` and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to ``sys.path``. Non-existing items are never added to ``sys.path``, and no check is made that the item refers to a directory rather than a file. No item is added to ``sys.path`` more than once. Blank lines and lines beginning with ``#`` are skipped. Lines starting with ``import`` (followed by space or tab) are executed." -msgstr "" +msgid "" +"A path configuration file is a file whose name has the form " +":file:`{name}.pth` and exists in one of the four directories mentioned " +"above; its contents are additional items (one per line) to be added to " +"``sys.path``. Non-existing items are never added to ``sys.path``, and no " +"check is made that the item refers to a directory rather than a file. No " +"item is added to ``sys.path`` more than once. Blank lines and lines " +"beginning with ``#`` are skipped. Lines starting with ``import`` (followed " +"by space or tab) are executed." +msgstr "" +"فایل پیکربندی مسیر فایلی است که نام آن به شکل :file:`{name}.pth` است و در " +"یکی از چهار پوشه‌ی ذکرشده در بالا وجود دارد؛ محتویات آن شامل آیتم‌های اضافی " +"(هر کدام در یک خط) برای اضافه شدن به ``sys.path`` است. آیتم‌های ناموجود هرگز" +" به ``sys.path`` اضافه نمی‌شوند و هیچ بررسی‌ای انجام نمی‌شود که آیتم به یک " +"پوشه اشاره می‌کند، نه یک فایل. هیچ آیتمی بیش از یک بار به ``sys.path`` اضافه" +" نمی‌شود. خطوط خالی و خطوطی که با ``#`` شروع می‌شوند، نادیده گرفته می‌شوند. " +"خطوطی که با ``import`` شروع می‌شوند (و پس از آن یک فاصله یا tab آمده باشد) " +"اجرا می‌شوند." -msgid "An executable line in a :file:`.pth` file is run at every Python startup, regardless of whether a particular module is actually going to be used. Its impact should thus be kept to a minimum. The primary intended purpose of executable lines is to make the corresponding module(s) importable (load 3rd-party import hooks, adjust :envvar:`PATH` etc). Any other initialization is supposed to be done upon a module's actual import, if and when it happens. Limiting a code chunk to a single line is a deliberate measure to discourage putting anything more complex here." -msgstr "" +msgid "" +"An executable line in a :file:`.pth` file is run at every Python startup, " +"regardless of whether a particular module is actually going to be used. Its " +"impact should thus be kept to a minimum. The primary intended purpose of " +"executable lines is to make the corresponding module(s) importable (load " +"3rd-party import hooks, adjust :envvar:`PATH` etc). Any other initialization" +" is supposed to be done upon a module's actual import, if and when it " +"happens. Limiting a code chunk to a single line is a deliberate measure to " +"discourage putting anything more complex here." +msgstr "" +"یک خط قابل اجرا در فایل :file:`.pth` در هر بار راه‌اندازی پایتون اجرا " +"می‌شود، صرف‌نظر از اینکه آیا ماژول خاصی واقعاً استفاده خواهد شد یا خیر. " +"بنابراین باید تأثیر آن در حداقل نگه‌داشته شود. هدف اصلی مورد نظر برای خطوط " +"قابل اجرا، قابل ایمپورت کردن ماژول(های) مربوطه است (بارگذاری قلاب‌های " +"ایمپورت شخص ثالث، تنظیم :envvar:`PATH` و غیره). هرگونه مقداردهی اولیه دیگر " +"باید هنگام ایمپورت واقعی ماژول انجام شود، اگر و هرگاه رخ دهد. محدود کردن یک " +"قطعه کد به یک خط، تدبیری عمدی برای منصرف کردن از قرار دادن هر چیز پیچیده‌تر " +"در اینجا است." -msgid "The :file:`.pth` files are now decoded by UTF-8 at first and then by the :term:`locale encoding` if it fails." +msgid "" +"The :file:`.pth` files are now decoded by UTF-8 at first and then by the " +":term:`locale encoding` if it fails." msgstr "" +"فایل‌های :file:`.pth` اکنون ابتدا با UTF-8 کدگشایی می‌شوند و در صورت شکست، " +"با :term:`locale encoding` کدگشایی می‌شوند." -msgid "For example, suppose ``sys.prefix`` and ``sys.exec_prefix`` are set to :file:`/usr/local`. The Python X.Y library is then installed in :file:`/usr/local/lib/python{X.Y}`. Suppose this has a subdirectory :file:`/usr/local/lib/python{X.Y}/site-packages` with three subsubdirectories, :file:`foo`, :file:`bar` and :file:`spam`, and two path configuration files, :file:`foo.pth` and :file:`bar.pth`. Assume :file:`foo.pth` contains the following::" -msgstr "" +msgid "" +"For example, suppose ``sys.prefix`` and ``sys.exec_prefix`` are set to " +":file:`/usr/local`. The Python X.Y library is then installed in " +":file:`/usr/local/lib/python{X.Y}`. Suppose this has a subdirectory " +":file:`/usr/local/lib/python{X.Y}/site-packages` with three " +"subsubdirectories, :file:`foo`, :file:`bar` and :file:`spam`, and two path " +"configuration files, :file:`foo.pth` and :file:`bar.pth`. Assume " +":file:`foo.pth` contains the following::" +msgstr "" +"برای مثال، فرض کنید ``sys.prefix`` و ``sys.exec_prefix`` روی " +":file:`/usr/local` تنظیم شده‌اند. در این صورت کتابخانه‌ی پایتون X.Y در " +":file:`/usr/local/lib/python{X.Y}` نصب می‌شود. فرض کنید این پوشه یک زیرپوشه " +"به نشانی :file:`/usr/local/lib/python{X.Y}/site-packages` دارد که خود دارای " +"سه زیرپوشه به نام‌های :file:`foo`، :file:`bar` و :file:`spam` و دو فایل " +"پیکربندی مسیر به نام‌های :file:`foo.pth` و :file:`bar.pth` است. فرض کنید " +":file:`foo.pth` شامل موارد زیر است::" msgid "" "# foo package configuration\n" @@ -73,148 +193,327 @@ msgid "" "bar\n" "bletch" msgstr "" +"# foo package configuration\n" +"\n" +"foo\n" +"bar\n" +"bletch" msgid "and :file:`bar.pth` contains::" -msgstr "" +msgstr "و :file:`bar.pth` شامل موارد زیر است::" msgid "" "# bar package configuration\n" "\n" "bar" msgstr "" +"# پیکربندی بسته bar\n" +"\n" +"bar" -msgid "Then the following version-specific directories are added to ``sys.path``, in this order::" +msgid "" +"Then the following version-specific directories are added to ``sys.path``, " +"in this order::" msgstr "" +"سپس پوشه‌های مختص نسخه زیر به ``sys.path`` اضافه می‌شوند، به این ترتیب::" msgid "" "/usr/local/lib/pythonX.Y/site-packages/bar\n" "/usr/local/lib/pythonX.Y/site-packages/foo" msgstr "" +"/usr/local/lib/pythonX.Y/site-packages/bar\n" +"/usr/local/lib/pythonX.Y/site-packages/foo" -msgid "Note that :file:`bletch` is omitted because it doesn't exist; the :file:`bar` directory precedes the :file:`foo` directory because :file:`bar.pth` comes alphabetically before :file:`foo.pth`; and :file:`spam` is omitted because it is not mentioned in either path configuration file." -msgstr "" +msgid "" +"Note that :file:`bletch` is omitted because it doesn't exist; the " +":file:`bar` directory precedes the :file:`foo` directory because " +":file:`bar.pth` comes alphabetically before :file:`foo.pth`; and " +":file:`spam` is omitted because it is not mentioned in either path " +"configuration file." +msgstr "" +"توجه داشته باشید که :file:`bletch` کنار گذاشته شده است، زیرا وجود ندارد؛ " +"پوشه‌ی :file:`bar` پیش از پوشه‌ی :file:`foo` قرار می‌گیرد، زیرا " +":file:`bar.pth` از نظر الفبایی پیش از :file:`foo.pth` می‌آید؛ و :file:`spam`" +" کنار گذاشته شده است، زیرا در هیچ‌کدام از پرونده‌های پیکربندی مسیر ذکر نشده " +"است." msgid ":mod:`!sitecustomize`" -msgstr "" +msgstr ":mod:`!sitecustomize`" -msgid "After these path manipulations, an attempt is made to import a module named :mod:`!sitecustomize`, which can perform arbitrary site-specific customizations. It is typically created by a system administrator in the site-packages directory. If this import fails with an :exc:`ImportError` or its subclass exception, and the exception's :attr:`~ImportError.name` attribute equals ``'sitecustomize'``, it is silently ignored. If Python is started without output streams available, as with :file:`pythonw.exe` on Windows (which is used by default to start IDLE), attempted output from :mod:`!sitecustomize` is ignored. Any other exception causes a silent and perhaps mysterious failure of the process." -msgstr "" +msgid "" +"After these path manipulations, an attempt is made to import a module named " +":mod:`!sitecustomize`, which can perform arbitrary site-specific " +"customizations. It is typically created by a system administrator in the " +"site-packages directory. If this import fails with an :exc:`ImportError` or" +" its subclass exception, and the exception's :attr:`~ImportError.name` " +"attribute equals ``'sitecustomize'``, it is silently ignored. If Python is " +"started without output streams available, as with :file:`pythonw.exe` on " +"Windows (which is used by default to start IDLE), attempted output from " +":mod:`!sitecustomize` is ignored. Any other exception causes a silent and " +"perhaps mysterious failure of the process." +msgstr "" +"پس از این دستکاری‌های مسیر، تلاش می‌شود ماژولی به نام :mod:`!sitecustomize` " +"ایمپورت شود که می‌تواند سفارشی‌سازی‌های دلخواه و مختص سایت را انجام دهد. این" +" ماژول معمولاً توسط مدیر سیستم در پوشه‌ی site-packages ایجاد می‌شود. اگر این " +"ایمپورت با :exc:`ImportError` یا استثنایی از زیرکلاس‌های آن ناموفق باشد و " +"ویژگی :attr:`~ImportError.name` آن استثنا برابر ``'sitecustomize'`` باشد، " +"به‌صورت خاموش نادیده گرفته می‌شود. اگر پایتون بدون در دسترس بودن جریان‌های " +"خروجی شروع شود، مانند :file:`pythonw.exe` در ویندوز (که به‌طور پیش‌فرض برای " +"راه‌اندازی IDLE استفاده می‌شود)، هرگونه تلاش برای خروجی از " +":mod:`!sitecustomize` نادیده گرفته می‌شود. هر استثنای دیگری باعث شکستی خاموش" +" و شاید مرموز در فرایند می‌شود." msgid ":mod:`!usercustomize`" -msgstr "" +msgstr ":mod:`!usercustomize`" -msgid "After this, an attempt is made to import a module named :mod:`!usercustomize`, which can perform arbitrary user-specific customizations, if :data:`~site.ENABLE_USER_SITE` is true. This file is intended to be created in the user site-packages directory (see below), which is part of ``sys.path`` unless disabled by :option:`-s`. If this import fails with an :exc:`ImportError` or its subclass exception, and the exception's :attr:`~ImportError.name` attribute equals ``'usercustomize'``, it is silently ignored." -msgstr "" +msgid "" +"After this, an attempt is made to import a module named " +":mod:`!usercustomize`, which can perform arbitrary user-specific " +"customizations, if :data:`~site.ENABLE_USER_SITE` is true. This file is " +"intended to be created in the user site-packages directory (see below), " +"which is part of ``sys.path`` unless disabled by :option:`-s`. If this " +"import fails with an :exc:`ImportError` or its subclass exception, and the " +"exception's :attr:`~ImportError.name` attribute equals ``'usercustomize'``, " +"it is silently ignored." +msgstr "" +"پس از این، اگر :data:`~site.ENABLE_USER_SITE` درست باشد، تلاش می‌شود ماژولی " +"به نام :mod:`!usercustomize`، که می‌تواند سفارشی‌سازی‌های دلخواه و مختص " +"کاربر را انجام دهد، ایمپورت شود. این فایل قرار است در پوشه‌ی site-packages " +"کاربر (در زیر ببینید) ایجاد شود؛ این پوشه بخشی از ``sys.path`` است، مگر آنکه" +" با :option:`-s` غیرفعال شده باشد. اگر این ایمپورت با استثنای " +":exc:`ImportError` یا استثنایی از زیرکلاس آن شکست بخورد و ویژگی " +":attr:`~ImportError.name` آن استثنا برابر ``'usercustomize'`` باشد، به‌صورت " +"خاموش نادیده گرفته می‌شود." -msgid "Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` are empty, and the path manipulations are skipped; however the import of :mod:`sitecustomize` and :mod:`!usercustomize` is still attempted." +msgid "" +"Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` " +"are empty, and the path manipulations are skipped; however the import of " +":mod:`sitecustomize` and :mod:`!usercustomize` is still attempted." msgstr "" +"توجه داشته باشید که در برخی سیستم‌های غیر Unix، ``sys.prefix`` و " +"``sys.exec_prefix`` خالی هستند و دستکاری‌های مسیر نادیده گرفته می‌شوند؛ با " +"این حال، همچنان تلاش برای ایمپورت :mod:`sitecustomize` و " +":mod:`!usercustomize` انجام می‌شود." msgid "Readline configuration" -msgstr "" +msgstr "پیکربندی Readline" -msgid "On systems that support :mod:`readline`, this module will also import and configure the :mod:`rlcompleter` module, if Python is started in :ref:`interactive mode ` and without the :option:`-S` option. The default behavior is to enable tab completion and to use :file:`~/.python_history` as the history save file. To disable it, delete (or override) the :data:`sys.__interactivehook__` attribute in your :mod:`sitecustomize` or :mod:`usercustomize` module or your :envvar:`PYTHONSTARTUP` file." -msgstr "" +msgid "" +"On systems that support :mod:`readline`, this module will also import and " +"configure the :mod:`rlcompleter` module, if Python is started in " +":ref:`interactive mode ` and without the :option:`-S` " +"option. The default behavior is to enable tab completion and to use " +":file:`~/.python_history` as the history save file. To disable it, delete " +"(or override) the :data:`sys.__interactivehook__` attribute in your " +":mod:`sitecustomize` or :mod:`usercustomize` module or your " +":envvar:`PYTHONSTARTUP` file." +msgstr "" +"در سیستم‌هایی که از :mod:`readline` پشتیبانی می‌کنند، اگر پایتون در " +":ref:`حالت تعاملی ` و بدون گزینه :option:`-S` شروع شده " +"باشد، این ماژول همچنین ماژول :mod:`rlcompleter` را نیز ایمپورت و پیکربندی " +"می‌کند. رفتار پیش‌فرض، فعال‌سازی تکمیل با کلید Tab و استفاده از " +":file:`~/.python_history` به‌عنوان فایل ذخیره تاریخچه است. برای غیرفعال‌سازی" +" آن، ویژگی :data:`sys.__interactivehook__` را در ماژول :mod:`sitecustomize` " +"یا :mod:`usercustomize` خود یا فایل :envvar:`PYTHONSTARTUP` خود حذف (یا " +"بازنویسی) کنید." msgid "Activation of rlcompleter and history was made automatic." -msgstr "" +msgstr "فعال‌سازی rlcompleter و تاریخچه به‌صورت خودکار انجام شد." msgid "Module contents" -msgstr "" +msgstr "محتویات ماژول" msgid "A list of prefixes for site-packages directories." -msgstr "" +msgstr "فهرستی از پیشوندها برای پوشه‌های site-packages." -msgid "Flag showing the status of the user site-packages directory. ``True`` means that it is enabled and was added to ``sys.path``. ``False`` means that it was disabled by user request (with :option:`-s` or :envvar:`PYTHONNOUSERSITE`). ``None`` means it was disabled for security reasons (mismatch between user or group id and effective id) or by an administrator." -msgstr "" +msgid "" +"Flag showing the status of the user site-packages directory. ``True`` means" +" that it is enabled and was added to ``sys.path``. ``False`` means that it " +"was disabled by user request (with :option:`-s` or " +":envvar:`PYTHONNOUSERSITE`). ``None`` means it was disabled for security " +"reasons (mismatch between user or group id and effective id) or by an " +"administrator." +msgstr "" +"پرچمی که وضعیت پوشه‌ی site-packages کاربر را نشان می‌دهد. ``True`` یعنی این " +"پوشه فعال است و به ``sys.path`` افزوده شده است. ``False`` یعنی به درخواست " +"کاربر (با :option:`-s` یا :envvar:`PYTHONNOUSERSITE`) غیرفعال شده است. " +"``None`` یعنی به دلایل امنیتی (عدم تطابق شناسه‌ی کاربر یا گروه با شناسه‌ی " +"مؤثر) یا توسط مدیر غیرفعال شده است." -msgid "Path to the user site-packages for the running Python. Can be ``None`` if :func:`getusersitepackages` hasn't been called yet. Default value is :file:`~/.local/lib/python{X.Y}[t]/site-packages` for UNIX and non-framework macOS builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python\\\\Python{XY}\\\\site-packages` on Windows. The optional \"t\" indicates the free-threaded build. This directory is a site directory, which means that :file:`.pth` files in it will be processed." -msgstr "" +msgid "" +"Path to the user site-packages for the running Python. Can be ``None`` if " +":func:`getusersitepackages` hasn't been called yet. Default value is " +":file:`~/.local/lib/python{X.Y}[t]/site-packages` for UNIX and non-framework" +" macOS builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for " +"macOS framework builds, and " +":file:`{%APPDATA%}\\\\Python\\\\Python{XY}\\\\site-packages` on Windows. " +"The optional \"t\" indicates the free-threaded build. This directory is a " +"site directory, which means that :file:`.pth` files in it will be processed." +msgstr "" +"مسیر site-packages کاربر برای پایتون در حال اجرا. اگر " +":func:`getusersitepackages` هنوز فراخوانی نشده باشد، ممکن است ``None`` باشد." +" مقدار پیش‌فرض برای UNIX و ساخت‌های غیرفریم‌ورک macOS برابر با " +":file:`~/.local/lib/python{X.Y}[t]/site-packages`، برای ساخت‌های فریم‌ورک " +"macOS برابر با :file:`~/Library/Python/{X.Y}/lib/python/site-packages`، و در" +" ویندوز :file:`{%APPDATA%}\\\\Python\\\\Python{XY}\\\\site-packages` است. " +"نویسه اختیاری «t» نشان‌دهنده ساخت نخ‌آزاداست. این پوشه یک " +"پوشه سایت (site directory) است، به این معنا که فایل‌های :file:`.pth` درون آن" +" پردازش خواهند شد." -msgid "Path to the base directory for the user site-packages. Can be ``None`` if :func:`getuserbase` hasn't been called yet. Default value is :file:`~/.local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for Windows. This value is used to compute the installation directories for scripts, data files, Python modules, etc. for the :ref:`user installation scheme `. See also :envvar:`PYTHONUSERBASE`." -msgstr "" +msgid "" +"Path to the base directory for the user site-packages. Can be ``None`` if " +":func:`getuserbase` hasn't been called yet. Default value is " +":file:`~/.local` for UNIX and macOS non-framework builds, " +":file:`~/Library/Python/{X.Y}` for macOS framework builds, and " +":file:`{%APPDATA%}\\\\Python` for Windows. This value is used to compute " +"the installation directories for scripts, data files, Python modules, etc. " +"for the :ref:`user installation scheme `. See also " +":envvar:`PYTHONUSERBASE`." +msgstr "" +"مسیر پوشه‌ی پایه برای site-packages کاربر. اگر :func:`getuserbase` هنوز " +"فراخوانی نشده باشد، ممکن است ``None`` باشد. مقدار پیش‌فرض برای ساخت‌های " +"غیرچارچوبی در UNIX و macOS برابر :file:`~/.local`، برای ساخت‌های چارچوبی در " +"macOS برابر :file:`~/Library/Python/{X.Y}`، و برای Windows برابر " +":file:`{%APPDATA%}\\\\Python` است. این مقدار برای محاسبه‌ی پوشه‌های نصب " +"اسکریپت‌ها، فایل‌های داده، ماژول‌های پایتون و غیره برای :ref:`طرح‌واره نصب کاربر " +"` استفاده می‌شود. همچنین :envvar:`PYTHONUSERBASE` را " +"ببینید." -msgid "Adds all the standard site-specific directories to the module search path. This function is called automatically when this module is imported, unless the Python interpreter was started with the :option:`-S` flag." +msgid "" +"Adds all the standard site-specific directories to the module search path. " +"This function is called automatically when this module is imported, unless " +"the Python interpreter was started with the :option:`-S` flag." msgstr "" +"همه‌ی پوشه‌های استانداردِ خاصِ سایت را به مسیر جستجوی ماژول اضافه می‌کند. این" +" تابع به‌صورت خودکار هنگامی که این ماژول ایمپورت می‌شود فراخوانی می‌شود، مگر" +" اینکه مفسر پایتون با پرچم :option:`-S` راه‌اندازی شده باشد." msgid "This function used to be called unconditionally." -msgstr "" +msgstr "این تابع پیش‌تر به‌طور غیرشرطی فراخوانی می‌شد." -msgid "Add a directory to sys.path and process its :file:`.pth` files. Typically used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." +msgid "" +"Add a directory to sys.path and process its :file:`.pth` files. Typically " +"used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." msgstr "" +"یک پوشه را به sys.path اضافه می‌کند و فایل‌های :file:`.pth` آن را پردازش " +"می‌کند. معمولاً در :mod:`sitecustomize` یا :mod:`usercustomize` استفاده " +"می‌شود (بالا را ببینید)." msgid "Return a list containing all global site-packages directories." -msgstr "" +msgstr "فهرستی شامل تمام پوشه‌های site-packages سراسری را برمی‌گرداند." -msgid "Return the path of the user base directory, :data:`USER_BASE`. If it is not initialized yet, this function will also set it, respecting :envvar:`PYTHONUSERBASE`." +msgid "" +"Return the path of the user base directory, :data:`USER_BASE`. If it is not" +" initialized yet, this function will also set it, respecting " +":envvar:`PYTHONUSERBASE`." msgstr "" +"مسیر پوشه‌ی پایه‌ی کاربر، :data:`USER_BASE` را برمی‌گرداند. اگر هنوز مقداردهی " +"اولیه نشده باشد، این تابع آن را نیز با رعایت :envvar:`PYTHONUSERBASE` تنظیم " +"می‌کند." -msgid "Return the path of the user-specific site-packages directory, :data:`USER_SITE`. If it is not initialized yet, this function will also set it, respecting :data:`USER_BASE`. To determine if the user-specific site-packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." -msgstr "" +msgid "" +"Return the path of the user-specific site-packages directory, " +":data:`USER_SITE`. If it is not initialized yet, this function will also " +"set it, respecting :data:`USER_BASE`. To determine if the user-specific " +"site-packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be " +"used." +msgstr "" +"مسیر پوشه‌ی site-packages اختصاصی کاربر، :data:`USER_SITE` را برمی‌گرداند. " +"اگر هنوز مقداردهی اولیه نشده باشد، این تابع آن را نیز با رعایت " +":data:`USER_BASE` تنظیم می‌کند. برای تشخیص اینکه آیا site-packages اختصاصی " +"کاربر به ``sys.path`` اضافه شده است یا خیر، باید از :data:`ENABLE_USER_SITE`" +" استفاده شود." msgid "Command-line interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "The :mod:`!site` module also provides a way to get the user directories from the command line:" +msgid "" +"The :mod:`!site` module also provides a way to get the user directories from" +" the command line:" msgstr "" +"ماژول :mod:`!site` همچنین راهی برای دریافت پوشه‌های کاربر از خط فرمان فراهم " +"می‌کند:" msgid "" "$ python -m site --user-site\n" "/home/user/.local/lib/python3.11/site-packages" msgstr "" +"$ python -m site --user-site\n" +"/home/user/.local/lib/python3.11/site-packages" -msgid "If it is called without arguments, it will print the contents of :data:`sys.path` on the standard output, followed by the value of :data:`USER_BASE` and whether the directory exists, then the same thing for :data:`USER_SITE`, and finally the value of :data:`ENABLE_USER_SITE`." +msgid "" +"If it is called without arguments, it will print the contents of " +":data:`sys.path` on the standard output, followed by the value of " +":data:`USER_BASE` and whether the directory exists, then the same thing for " +":data:`USER_SITE`, and finally the value of :data:`ENABLE_USER_SITE`." msgstr "" +"اگر بدون آرگومان فراخوانی شود، محتوای :data:`sys.path` را در خروجی استاندارد" +" چاپ می‌کند، پس از آن مقدار :data:`USER_BASE` و اینکه آیا آن پوشه وجود دارد " +"یا خیر، سپس همین مورد برای :data:`USER_SITE`، و در نهایت مقدار " +":data:`ENABLE_USER_SITE` را چاپ می‌کند." msgid "Print the path to the user base directory." -msgstr "" +msgstr "مسیر پوشه‌ی پایه‌ی کاربر را چاپ می‌کند." msgid "Print the path to the user site-packages directory." -msgstr "" +msgstr "مسیر پوشه‌ی site-packages کاربر را چاپ می‌کند." -msgid "If both options are given, user base and user site will be printed (always in this order), separated by :data:`os.pathsep`." +msgid "" +"If both options are given, user base and user site will be printed (always " +"in this order), separated by :data:`os.pathsep`." msgstr "" +"اگر هر دو گزینه داده شده باشد، پایه کاربر (user base) و سایت کاربر (user " +"site)، همیشه با همین ترتیب، چاپ می‌شوند و با :data:`os.pathsep` جدا می‌شوند." -msgid "If any option is given, the script will exit with one of these values: ``0`` if the user site-packages directory is enabled, ``1`` if it was disabled by the user, ``2`` if it is disabled for security reasons or by an administrator, and a value greater than 2 if there is an error." +msgid "" +"If any option is given, the script will exit with one of these values: ``0``" +" if the user site-packages directory is enabled, ``1`` if it was disabled by" +" the user, ``2`` if it is disabled for security reasons or by an " +"administrator, and a value greater than 2 if there is an error." msgstr "" +"اگر گزینه‌ای داده شود، اسکریپت با یکی از این مقدارها خارج می‌شود: ``0`` اگر " +"پوشه site-packages کاربر فعال باشد، ``1`` اگر توسط کاربر غیرفعال شده باشد، " +"``2`` اگر به دلایل امنیتی یا توسط مدیر غیرفعال شده باشد، و مقداری بزرگ‌تر از" +" ۲ اگر خطایی وجود داشته باشد." msgid ":pep:`370` -- Per user site-packages directory" -msgstr "" +msgstr ":pep:`370` -- پوشه site-packages برای هر کاربر" msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." -msgstr "" +msgstr ":ref:`sys-path-init` -- مقداردهی اولیه‌ی :data:`sys.path`." msgid "module" -msgstr "" +msgstr "ماژول" msgid "search" -msgstr "" +msgstr "جستجو" msgid "path" -msgstr "" +msgstr "مسیر" msgid "site-packages" -msgstr "" +msgstr "site-packages" msgid "directory" -msgstr "" +msgstr "پوشه" msgid "# (hash)" -msgstr "" +msgstr "# (هش)" msgid "comment" -msgstr "" +msgstr "کامنت" msgid "statement" -msgstr "" +msgstr "دستور" msgid "import" -msgstr "" +msgstr "ایمپورت" msgid "package" -msgstr "" +msgstr "بسته" msgid "configuration" -msgstr "" +msgstr "پیکربندی" msgid "file" -msgstr "" +msgstr "فایل" diff --git a/library/smtpd.po b/library/smtpd.po index 2d1ac727b..1a0a3a40f 100644 --- a/library/smtpd.po +++ b/library/smtpd.po @@ -22,13 +22,27 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!smtpd` --- SMTP Server" -msgstr "" +msgstr ":mod:`!smtpd` --- سرور SMTP" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.12 ` after being deprecated in Python 3.6. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.12 ` after being deprecated " +"in Python 3.6. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از آن‌که" +" در پایتون 3.6 منسوخ شد، :ref:`در پایتون 3.12 حذف شد `." +" تصمیم برای حذف آن در :pep:`594` گرفته شد." -msgid "A possible replacement is the third-party :pypi:`aiosmtpd` library. This library is not maintained or supported by the Python core team." +msgid "" +"A possible replacement is the third-party :pypi:`aiosmtpd` library. This " +"library is not maintained or supported by the Python core team." msgstr "" +"یک جایگزین ممکن، کتابخانه‌ی شخص ثالث :pypi:`aiosmtpd` است. این کتابخانه توسط" +" تیم اصلی پایتون نگهداری یا پشتیبانی نمی‌شود." -msgid "The last version of Python that provided the :mod:`!smtpd` module was `Python 3.11 `_." +msgid "" +"The last version of Python that provided the :mod:`!smtpd` module was " +"`Python 3.11 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!smtpd` را فراهم می‌کرد، `Python 3.11 " +"`_ بود." diff --git a/library/smtplib.po b/library/smtplib.po index 06a2ac1cf..7618aad7f 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" +"PO-Revision-Date: 2026-08-28 10:10+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,30 +23,88 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!smtplib` --- SMTP protocol client" -msgstr "" +msgstr ":mod:`!smtplib` --- کارخواه پروتکل SMTP" msgid "**Source code:** :source:`Lib/smtplib.py`" -msgstr "" +msgstr ":source:`Lib/smtplib.py`" -msgid "The :mod:`!smtplib` module defines an SMTP client session object that can be used to send mail to any internet machine with an SMTP or ESMTP listener daemon. For details of SMTP and ESMTP operation, consult :rfc:`821` (Simple Mail Transfer Protocol) and :rfc:`1869` (SMTP Service Extensions)." +msgid "" +"The :mod:`!smtplib` module defines an SMTP client session object that can " +"be used to send mail to any internet machine with an SMTP or ESMTP listener " +"daemon. For details of SMTP and ESMTP operation, consult :rfc:`821` " +"(Simple Mail Transfer Protocol) and :rfc:`1869` (SMTP Service Extensions)." msgstr "" +"ماژول :mod:`!smtplib` یک شیء نشست کلاینت SMTP را تعریف می‌کند که می‌توان از " +"آن برای ارسال ایمیل به هر ماشین اینترنتی با دیمن شنونده SMTP یا ESMTP " +"استفاده کرد. برای جزئیات عملکرد SMTP و ESMTP، به :rfc:`821` (پروتکل انتقال " +"ساده‌ی ایمیل) و :rfc:`1869` (افزونه‌های سرویس SMTP) مراجعه کنید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. " +"See :ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات " +"بیشتر :ref:`wasm-availability` را ببینید." -msgid "An :class:`SMTP` instance encapsulates an SMTP connection. It has methods that support a full repertoire of SMTP and ESMTP operations. If the optional *host* and *port* parameters are given, the SMTP :meth:`connect` method is called with those parameters during initialization. If specified, *local_hostname* is used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the local hostname is found using :func:`socket.getfqdn`. If the :meth:`connect` call returns anything other than a success code, an :exc:`SMTPConnectError` is raised. The optional *timeout* parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). If the timeout expires, :exc:`TimeoutError` is raised. The optional *source_address* parameter allows binding to some specific source address in a machine with multiple network interfaces, and/or to some specific source TCP port. It takes a 2-tuple ``(host, port)``, for the socket to bind to as its source address before connecting. If omitted (or if *host* or *port* are ``''`` and/or ``0`` respectively) the OS default behavior will be used." -msgstr "" +msgid "" +"An :class:`SMTP` instance encapsulates an SMTP connection. It has methods " +"that support a full repertoire of SMTP and ESMTP operations. If the " +"optional *host* and *port* parameters are given, the SMTP :meth:`connect` " +"method is called with those parameters during initialization. If " +"specified, *local_hostname* is used as the FQDN of the local host in the " +"HELO/EHLO command. Otherwise, the local hostname is found " +"using :func:`socket.getfqdn`. If the :meth:`connect` call returns anything " +"other than a success code, an :exc:`SMTPConnectError` is raised. The " +"optional *timeout* parameter specifies a timeout in seconds for blocking " +"operations like the connection attempt (if not specified, the global " +"default timeout setting will be used). If the timeout " +"expires, :exc:`TimeoutError` is raised. The optional *source_address* " +"parameter allows binding to some specific source address in a machine with " +"multiple network interfaces, and/or to some specific source TCP port. It " +"takes a 2-tuple ``(host, port)``, for the socket to bind to as its source " +"address before connecting. If omitted (or if *host* or *port* are ``''`` " +"and/or ``0`` respectively) the OS default behavior will be used." +msgstr "" +"یک نمونه از :class:`SMTP` یک اتصال SMTP را در بر می‌گیرد. این کلاس متدهایی " +"دارد که از مجموعه کاملی از عملیات SMTP و ESMTP پشتیبانی می‌کنند. اگر " +"پارامترهای اختیاری *host* و *port* داده شوند، متد :meth:`connect` SMTP در " +"حین مقداردهی اولیه با آن پارامترها فراخوانی می‌شود. در صورت مشخص بودن، از " +"*local_hostname* به‌عنوان FQDN میزبان محلی در دستور HELO/EHLO استفاده می‌شود. " +"در غیر این صورت، نام میزبان محلی با استفاده از :func:`socket.getfqdn` یافت " +"می‌شود. اگر فراخوانی :meth:`connect` هر مقداری غیر از یک کد موفقیت برگرداند، " +"استثنای :exc:`SMTPConnectError` پرتاب می‌شود. پارامتر اختیاری *timeout* " +"مهلتی به ثانیه برای عملیات‌های مسدودکننده مانند تلاش برای اتصال مشخص می‌کند " +"(اگر مشخص نشود، از تنظیم پیش‌فرض سراسری مهلت استفاده خواهد شد). اگر مهلت " +"منقضی شود، استثنای :exc:`TimeoutError` پرتاب می‌شود. پارامتر اختیاری " +"*source_address* امکان مقیدسازی (binding) به یک نشانی مبدأ خاص در ماشینی با " +"چندین رابط شبکه و/یا به یک پورت TCP مبدأ خاص را فراهم می‌کند. این پارامتر یک " +"تاپل دوتایی ``(host, port)`` را می‌گیرد تا سوکت پیش از اتصال، به‌عنوان نشانی " +"مبدأ خود به آن مقید شود. در صورت حذف این پارامتر (یا اگر *host* یا *port* " +"به ترتیب ``''`` و/یا ``0`` باشند) از رفتار پیش‌فرض سیستم‌عامل استفاده خواهد " +"شد." -msgid "For normal use, you should only require the initialization/connect, :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is included below." +msgid "" +"For normal use, you should only require the initialization/" +"connect, :meth:`sendmail`, and :meth:`SMTP.quit` methods. An example is " +"included below." msgstr "" +"برای استفاده‌ی عادی، تنها باید به متدهای راه‌اندازی/اتصال، :meth:`sendmail` " +"و :meth:`SMTP.quit` نیاز داشته باشید. یک نمونه در زیر آمده است." -msgid "The :class:`SMTP` class supports the :keyword:`with` statement. When used like this, the SMTP ``QUIT`` command is issued automatically when the :keyword:`!with` statement exits. E.g.::" +msgid "" +"The :class:`SMTP` class supports the :keyword:`with` statement. When used " +"like this, the SMTP ``QUIT`` command is issued automatically when " +"the :keyword:`!with` statement exits. E.g.::" msgstr "" +"کلاس :class:`SMTP` از دستور :keyword:`with` پشتیبانی می‌کند. هنگامی که به " +"این شکل استفاده شود، فرمان ``QUIT`` SMTP به‌طور خودکار در زمان خروج از " +"دستور :keyword:`!with` صادر می‌شود. برای مثال::" msgid "" ">>> from smtplib import SMTP\n" @@ -56,336 +114,820 @@ msgid "" "(250, b'Ok')\n" ">>>" msgstr "" +">>> from smtplib import SMTP\n" +">>> with SMTP(\"domain.org\") as smtp:\n" +"... smtp.noop()\n" +"...\n" +"(250, b'Ok')\n" +">>>" -msgid "All commands will raise an :ref:`auditing event ` ``smtplib.SMTP.send`` with arguments ``self`` and ``data``, where ``data`` is the bytes about to be sent to the remote host." +msgid "" +"All commands will raise an :ref:`auditing event ` " +"``smtplib.SMTP.send`` with arguments ``self`` and ``data``, where ``data`` " +"is the bytes about to be sent to the remote host." msgstr "" +"تمام دستورات یک :ref:`رویداد حسابرسی ` ``smtplib.SMTP.send`` را " +"با آرگومان‌های ``self`` و ``data`` پرتاب می‌کنند، که ``data`` بایت‌هایی است که " +"قرار است به میزبان راه دور ارسال شوند." msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "پشتیبانی از دستور :keyword:`with` افزوده شد." msgid "*source_address* argument was added." -msgstr "" +msgstr "آرگومان *source_address* اضافه شد." msgid "The SMTPUTF8 extension (:rfc:`6531`) is now supported." -msgstr "" +msgstr "افزونه‌ی SMTPUTF8 (:rfc:`6531`) اکنون پشتیبانی می‌شود." -msgid "If the *timeout* parameter is set to be zero, it will raise a :class:`ValueError` to prevent the creation of a non-blocking socket." +msgid "" +"If the *timeout* parameter is set to be zero, it will raise " +"a :class:`ValueError` to prevent the creation of a non-blocking socket." msgstr "" +"اگر پارامتر *timeout* روی صفر تنظیم شود، یک :class:`ValueError` پرتاب می‌شود " +"تا از ایجاد یک سوکت غیرمسدودکننده جلوگیری شود." -msgid "An :class:`SMTP_SSL` instance behaves exactly the same as instances of :class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is required from the beginning of the connection and using :meth:`~SMTP.starttls` is not appropriate. If *host* is not specified, the local host is used. If *port* is zero, the standard SMTP-over-SSL port (465) is used. The optional arguments *local_hostname*, *timeout* and *source_address* have the same meaning as they do in the :class:`SMTP` class. *context*, also optional, can contain a :class:`~ssl.SSLContext` and allows configuring various aspects of the secure connection. Please read :ref:`ssl-security` for best practices." -msgstr "" +msgid "" +"An :class:`SMTP_SSL` instance behaves exactly the same as instances " +"of :class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL " +"is required from the beginning of the connection and " +"using :meth:`~SMTP.starttls` is not appropriate. If *host* is not " +"specified, the local host is used. If *port* is zero, the standard SMTP-" +"over-SSL port (465) is used. The optional arguments *local_hostname*, " +"*timeout* and *source_address* have the same meaning as they do in " +"the :class:`SMTP` class. *context*, also optional, can contain " +"a :class:`~ssl.SSLContext` and allows configuring various aspects of the " +"secure connection. Please read :ref:`ssl-security` for best practices." +msgstr "" +"یک نمونه از :class:`SMTP_SSL` دقیقاً مانند نمونه‌های :class:`SMTP` رفتار " +"می‌کند. :class:`SMTP_SSL` باید برای موقعیت‌هایی استفاده شود که SSL از ابتدای " +"اتصال مورد نیاز باشد و استفاده از :meth:`~SMTP.starttls` مناسب نباشد. اگر " +"*host* مشخص نشده باشد، از میزبان محلی استفاده می‌شود. اگر *port* صفر باشد، " +"از درگاه استاندارد SMTP-over-SSL (۴۶۵) استفاده می‌شود. آرگومان‌های اختیاری " +"*local_hostname*، *timeout* و *source_address* همان معنایی را دارند که در " +"کلاس :class:`SMTP` دارند. *context*، که آن هم اختیاری است، می‌تواند شامل " +"یک :class:`~ssl.SSLContext` باشد و به شما امکان می‌دهد که جنبه‌های مختلف " +"اتصال امن را پیکربندی کنید. لطفاً برای بهترین شیوه‌ها، :ref:`ssl-security` را " +"بخوانید." msgid "*context* was added." -msgstr "" +msgstr "*context* اضافه شد." msgid "The *source_address* argument was added." -msgstr "" +msgstr "آرگومان *source_address* افزوده شد." -msgid "The class now supports hostname check with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgid "" +"The class now supports hostname check " +"with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indication* " +"(see :const:`ssl.HAS_SNI`)." msgstr "" +"این کلاس اکنون از بررسی نام میزبان با :attr:`ssl.SSLContext.check_hostname` " +"و *نشان‌دهی نام سرور* (Server Name Indication) پشتیبانی می‌کند " +"(:const:`ssl.HAS_SNI` را ببینید)." -msgid "If the *timeout* parameter is set to be zero, it will raise a :class:`ValueError` to prevent the creation of a non-blocking socket" +msgid "" +"If the *timeout* parameter is set to be zero, it will raise " +"a :class:`ValueError` to prevent the creation of a non-blocking socket" msgstr "" +"اگر پارامتر *timeout* برابر با صفر تنظیم شود، یک :class:`ValueError` پرتاب " +"می‌شود تا از ایجاد یک سوکت غیرمسدودکننده جلوگیری شود" msgid "The deprecated *keyfile* and *certfile* parameters have been removed." -msgstr "" +msgstr "پارامترهای منسوخ *keyfile* و *certfile* حذف شده‌اند." -msgid "The LMTP protocol, which is very similar to ESMTP, is heavily based on the standard SMTP client. It's common to use Unix sockets for LMTP, so our :meth:`~SMTP.connect` method must support that as well as a regular host:port server. The optional arguments *local_hostname* and *source_address* have the same meaning as they do in the :class:`SMTP` class. To specify a Unix socket, you must use an absolute path for *host*, starting with a '/'." -msgstr "" +msgid "" +"The LMTP protocol, which is very similar to ESMTP, is heavily based on the " +"standard SMTP client. It's common to use Unix sockets for LMTP, so " +"our :meth:`~SMTP.connect` method must support that as well as a regular " +"host:port server. The optional arguments *local_hostname* and " +"*source_address* have the same meaning as they do in the :class:`SMTP` " +"class. To specify a Unix socket, you must use an absolute path for *host*, " +"starting with a '/'." +msgstr "" +"پروتکل LMTP، که بسیار شبیه به ESMTP است، تا حد زیادی مبتنی بر کلاینت SMTP " +"استاندارد است. استفاده از سوکت‌های یونیکس برای LMTP رایج است، بنابراین " +"متد :meth:`~SMTP.connect` ما باید هم از آن و هم از یک سرور معمولی host:port " +"پشتیبانی کند. آرگومان‌های اختیاری *local_hostname* و *source_address* همان " +"معنایی را دارند که در کلاس :class:`SMTP` دارند. برای مشخص کردن یک سوکت " +"یونیکس، باید برای *host* از یک مسیر مطلق استفاده کنید که با '/' شروع می‌شود." -msgid "Authentication is supported, using the regular SMTP mechanism. When using a Unix socket, LMTP generally don't support or require any authentication, but your mileage might vary." +msgid "" +"Authentication is supported, using the regular SMTP mechanism. When using a " +"Unix socket, LMTP generally don't support or require any authentication, " +"but your mileage might vary." msgstr "" +"احراز هویت با استفاده از سازوکار معمول SMTP پشتیبانی می‌شود. هنگام استفاده " +"از یک سوکت یونیکس، LMTP معمولاً از هیچ احراز هویتی پشتیبانی نمی‌کند یا به آن " +"نیازی ندارد، اما ممکن است شرایط شما متفاوت باشد." msgid "The optional *timeout* parameter was added." -msgstr "" +msgstr "پارامتر اختیاری *timeout* افزوده شد." msgid "A nice selection of exceptions is defined as well:" -msgstr "" +msgstr "همچنین مجموعه‌ی مناسبی از استثناها تعریف شده است:" -msgid "Subclass of :exc:`OSError` that is the base exception class for all the other exceptions provided by this module." +msgid "" +"Subclass of :exc:`OSError` that is the base exception class for all the " +"other exceptions provided by this module." msgstr "" +"زیرکلاسی از :exc:`OSError` که کلاس پایه‌ی استثنا برای تمام استثناهای دیگری " +"است که توسط این ماژول ارائه می‌شوند." msgid "SMTPException became subclass of :exc:`OSError`" -msgstr "" +msgstr "SMTPException به زیرکلاسی از :exc:`OSError` تبدیل شد" -msgid "This exception is raised when the server unexpectedly disconnects, or when an attempt is made to use the :class:`SMTP` instance before connecting it to a server." +msgid "" +"This exception is raised when the server unexpectedly disconnects, or when " +"an attempt is made to use the :class:`SMTP` instance before connecting it " +"to a server." msgstr "" +"این استثنا زمانی پرتاب می‌شود که سرور به‌طور غیرمنتظره‌ای قطع ارتباط کند، یا " +"زمانی که تلاشی برای استفاده از نمونه‌ی :class:`SMTP` پیش از اتصال آن به سرور " +"صورت گیرد." -msgid "Base class for all exceptions that include an SMTP error code. These exceptions are generated in some instances when the SMTP server returns an error code." +msgid "" +"Base class for all exceptions that include an SMTP error code. These " +"exceptions are generated in some instances when the SMTP server returns an " +"error code." msgstr "" +"کلاس پایه برای همه استثناهایی که شامل یک کد خطای SMTP هستند. این استثناها " +"در برخی موارد زمانی تولید می‌شوند که سرور SMTP یک کد خطا برمی‌گرداند." msgid "The error code." -msgstr "" +msgstr "کد خطا." msgid "The error message." -msgstr "" +msgstr "پیام خطا." -msgid "Sender address refused. In addition to the attributes set by on all :exc:`SMTPResponseException` exceptions, this sets 'sender' to the string that the SMTP server refused." +msgid "" +"Sender address refused. In addition to the attributes set by on " +"all :exc:`SMTPResponseException` exceptions, this sets 'sender' to the " +"string that the SMTP server refused." msgstr "" +"نشانی فرستنده رد شد. علاوه بر ویژگی‌هایی که روی همه‌ی " +"استثناهای :exc:`SMTPResponseException` تنظیم شده‌اند، این استثنا 'sender' را " +"برابر با رشته‌ای قرار می‌دهد که کارساز SMTP آن را رد کرده است." msgid "All recipient addresses refused." -msgstr "" +msgstr "تمام نشانی‌های گیرنده رد شدند." -msgid "A dictionary of exactly the same sort as returned by :meth:`SMTP.sendmail` containing the errors for each recipient." +msgid "" +"A dictionary of exactly the same sort as returned by :meth:`SMTP.sendmail` " +"containing the errors for each recipient." msgstr "" +"دیکشنری دقیقاً از همان نوعی که :meth:`SMTP.sendmail` بازمی‌گرداند، شامل " +"خطاهای هر گیرنده است." msgid "The SMTP server refused to accept the message data." -msgstr "" +msgstr "سرور SMTP از پذیرش داده‌های پیام خودداری کرد." msgid "Error occurred during establishment of a connection with the server." -msgstr "" +msgstr "خطایی در هنگام برقراری اتصال با سرور رخ داد." msgid "The server refused our ``HELO`` message." -msgstr "" +msgstr "سرور پیام ``HELO`` ما را رد کرد." msgid "The command or option attempted is not supported by the server." -msgstr "" +msgstr "فرمان یا گزینه‌ی تلاش‌شده توسط سرور پشتیبانی نمی‌شود." -msgid "SMTP authentication went wrong. Most probably the server didn't accept the username/password combination provided." +msgid "" +"SMTP authentication went wrong. Most probably the server didn't accept the " +"username/password combination provided." msgstr "" +"احراز هویت SMTP با مشکل مواجه شد. به احتمال زیاد سرور ترکیب نام کاربری/" +"گذرواژه‌ی ارائه‌شده را نپذیرفت." msgid ":rfc:`821` - Simple Mail Transfer Protocol" -msgstr "" +msgstr ":rfc:`821` - پروتکل انتقال نامه‌ی ساده (Simple Mail Transfer Protocol)" -msgid "Protocol definition for SMTP. This document covers the model, operating procedure, and protocol details for SMTP." +msgid "" +"Protocol definition for SMTP. This document covers the model, operating " +"procedure, and protocol details for SMTP." msgstr "" +"تعریف پروتکل SMTP. این سند مدل، رویه عملیاتی و جزئیات پروتکل SMTP را پوشش " +"می‌دهد." msgid ":rfc:`1869` - SMTP Service Extensions" -msgstr "" +msgstr ":rfc:`1869` - افزونه‌های سرویس SMTP" -msgid "Definition of the ESMTP extensions for SMTP. This describes a framework for extending SMTP with new commands, supporting dynamic discovery of the commands provided by the server, and defines a few additional commands." +msgid "" +"Definition of the ESMTP extensions for SMTP. This describes a framework " +"for extending SMTP with new commands, supporting dynamic discovery of the " +"commands provided by the server, and defines a few additional commands." msgstr "" +"تعریف افزونه‌های ESMTP برای SMTP. این متن چارچوبی را برای گسترش SMTP با " +"دستورهای جدید توصیف می‌کند، از کشف پویای دستورهای ارائه‌شده توسط سرور " +"پشتیبانی می‌کند و چند دستور اضافی را تعریف می‌کند." msgid "SMTP Objects" -msgstr "" +msgstr "اشیای SMTP" msgid "An :class:`SMTP` instance has the following methods:" -msgstr "" +msgstr "نمونه‌ای از :class:`SMTP` دارای متدهای زیر است:" -msgid "Set the debug output level. A value of 1 or ``True`` for *level* results in debug messages for connection and for all messages sent to and received from the server. A value of 2 for *level* results in these messages being timestamped." +msgid "" +"Set the debug output level. A value of 1 or ``True`` for *level* results " +"in debug messages for connection and for all messages sent to and received " +"from the server. A value of 2 for *level* results in these messages being " +"timestamped." msgstr "" +"سطح خروجی اشکال‌زدایی را تنظیم کنید. مقدار ۱ یا ``True`` برای *level* منجر " +"به پیام‌های اشکال‌زدایی برای اتصال و برای تمام پیام‌های ارسالی به سرور و " +"دریافتی از سرور می‌شود. مقدار ۲ برای *level* باعث می‌شود این پیام‌ها دارای مهر " +"زمانی شوند." msgid "Added debuglevel 2." -msgstr "" +msgstr "debuglevel ۲ افزوده شد." -msgid "Send a command *cmd* to the server. The optional argument *args* is simply concatenated to the command, separated by a space." +msgid "" +"Send a command *cmd* to the server. The optional argument *args* is simply " +"concatenated to the command, separated by a space." msgstr "" +"فرمان *cmd* را به سرور ارسال کنید. آرگومان اختیاری *args* به‌سادگی با یک " +"فاصله به فرمان الحاق می‌شود." -msgid "This returns a 2-tuple composed of a numeric response code and the actual response line (multiline responses are joined into one long line.)" +msgid "" +"This returns a 2-tuple composed of a numeric response code and the actual " +"response line (multiline responses are joined into one long line.)" msgstr "" +"این یک تاپل ۲تایی متشکل از یک کد پاسخ عددی و خط پاسخ واقعی را برمی‌گرداند " +"(پاسخ‌های چندخطی به یک خط طولانی تبدیل می‌شوند)." -msgid "In normal operation it should not be necessary to call this method explicitly. It is used to implement other methods and may be useful for testing private extensions." +msgid "" +"In normal operation it should not be necessary to call this method " +"explicitly. It is used to implement other methods and may be useful for " +"testing private extensions." msgstr "" +"در حالت عادی، نیازی به فراخوانی صریح این متد نیست. این متد برای پیاده‌سازی " +"سایر متدها استفاده می‌شود و ممکن است برای آزمون افزونه‌های خصوصی مفید باشد." -msgid "If the connection to the server is lost while waiting for the reply, :exc:`SMTPServerDisconnected` will be raised." +msgid "" +"If the connection to the server is lost while waiting for the " +"reply, :exc:`SMTPServerDisconnected` will be raised." msgstr "" +"اگر اتصال به سرور در حین انتظار برای پاسخ قطع " +"شود، :exc:`SMTPServerDisconnected` پرتاب خواهد شد." -msgid "Connect to a host on a given port. The defaults are to connect to the local host at the standard SMTP port (25). If the hostname ends with a colon (``':'``) followed by a number, that suffix will be stripped off and the number interpreted as the port number to use. This method is automatically invoked by the constructor if a host is specified during instantiation. Returns a 2-tuple of the response code and message sent by the server in its connection response." -msgstr "" +msgid "" +"Connect to a host on a given port. The defaults are to connect to the " +"local host at the standard SMTP port (25). If the hostname ends with a " +"colon (``':'``) followed by a number, that suffix will be stripped off and " +"the number interpreted as the port number to use. This method is " +"automatically invoked by the constructor if a host is specified during " +"instantiation. Returns a 2-tuple of the response code and message sent by " +"the server in its connection response." +msgstr "" +"به یک میزبان در یک پورت مشخص متصل می‌شود. پیش‌فرض این است که به میزبان محلی " +"در پورت استاندارد SMTP (۲۵) متصل شود. اگر نام میزبان با یک دونقطه (``':'``) " +"و به دنبال آن یک عدد پایان یابد، آن پسوند حذف می‌شود و عدد به‌عنوان شماره " +"پورتی که باید استفاده شود تفسیر می‌شود. اگر در هنگام نمونه‌سازی یک میزبان " +"مشخص شده باشد، این متد به‌طور خودکار توسط سازنده فراخوانی می‌شود. یک تاپل " +"۲تایی شامل کد پاسخ و پیامی که سرور در پاسخ اتصال خود ارسال کرده است " +"برمی‌گرداند." -msgid "Raises an :ref:`auditing event ` ``smtplib.connect`` with arguments ``self``, ``host``, ``port``." +msgid "" +"Raises an :ref:`auditing event ` ``smtplib.connect`` with " +"arguments ``self``, ``host``, ``port``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``smtplib.connect`` را با آرگومان‌های " +"``self``، ``host``، ``port`` پرتاب می‌کند." -msgid "Identify yourself to the SMTP server using ``HELO``. The hostname argument defaults to the fully qualified domain name of the local host. The message returned by the server is stored as the :attr:`helo_resp` attribute of the object." +msgid "" +"Identify yourself to the SMTP server using ``HELO``. The hostname argument " +"defaults to the fully qualified domain name of the local host. The message " +"returned by the server is stored as the :attr:`helo_resp` attribute of the " +"object." msgstr "" +"با استفاده از ``HELO`` خود را به سرور SMTP معرفی کنید. آرگومان hostname " +"به‌طور پیش‌فرض برابر با نام دامنه‌ی کامل میزبان محلی است. پیام " +"برگردانده‌شده از سوی سرور، به‌عنوان ویژگی :attr:`helo_resp` شیء ذخیره می‌شود." -msgid "In normal operation it should not be necessary to call this method explicitly. It will be implicitly called by the :meth:`sendmail` when necessary." +msgid "" +"In normal operation it should not be necessary to call this method " +"explicitly. It will be implicitly called by the :meth:`sendmail` when " +"necessary." msgstr "" +"در عملکرد عادی، لازم نیست این متد را به‌طور صریح فراخوانی کنید. در صورت " +"لزوم، این متد به‌طور ضمنی توسط :meth:`sendmail` فراخوانی می‌شود." -msgid "Identify yourself to an ESMTP server using ``EHLO``. The hostname argument defaults to the fully qualified domain name of the local host. Examine the response for ESMTP option and store them for use by :meth:`has_extn`. Also sets several informational attributes: the message returned by the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to ``True`` or ``False`` depending on whether the server supports ESMTP, and :attr:`esmtp_features` will be a dictionary containing the names of the SMTP service extensions this server supports, and their parameters (if any)." -msgstr "" +msgid "" +"Identify yourself to an ESMTP server using ``EHLO``. The hostname argument " +"defaults to the fully qualified domain name of the local host. Examine the " +"response for ESMTP option and store them for use by :meth:`has_extn`. Also " +"sets several informational attributes: the message returned by the server " +"is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` is set to " +"``True`` or ``False`` depending on whether the server supports ESMTP, " +"and :attr:`esmtp_features` will be a dictionary containing the names of the " +"SMTP service extensions this server supports, and their parameters (if any)." +msgstr "" +"با استفاده از ``EHLO``، خود را به یک کارساز ESMTP معرفی کنید. آرگومان " +"hostname به‌طور پیش‌فرض برابر با نام دامنه‌ی کامل میزبان محلی " +"(fully qualified domain name) است. پاسخ را از نظر گزینه‌های ESMTP بررسی کنید " +"و آن‌ها را ذخیره کنید تا :meth:`has_extn` از آن‌ها استفاده کند. همچنین چند " +"ویژگی اطلاعاتی را تنظیم می‌کند: پیام برگردانده‌شده از کارساز به‌عنوان " +"ویژگی :attr:`ehlo_resp` ذخیره می‌شود، :attr:`does_esmtp` بسته به اینکه " +"کارساز از ESMTP پشتیبانی کند یا نه، روی ``True`` یا ``False`` تنظیم می‌شود، " +"و :attr:`esmtp_features` یک دیکشنری حاوی نام افزونه‌های سرویس SMTP " +"پشتیبانی‌شده توسط این کارساز و پارامترهای آن‌ها (در صورت وجود) خواهد بود." -msgid "Unless you wish to use :meth:`has_extn` before sending mail, it should not be necessary to call this method explicitly. It will be implicitly called by :meth:`sendmail` when necessary." +msgid "" +"Unless you wish to use :meth:`has_extn` before sending mail, it should not " +"be necessary to call this method explicitly. It will be implicitly called " +"by :meth:`sendmail` when necessary." msgstr "" +"مگر اینکه بخواهید پیش از ارسال ایمیل از :meth:`has_extn` استفاده کنید، " +"نیازی به فراخوانی صریح این متد نیست. این متد در صورت لزوم به‌طور ضمنی " +"توسط :meth:`sendmail` فراخوانی می‌شود." -msgid "This method calls :meth:`ehlo` and/or :meth:`helo` if there has been no previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` first." +msgid "" +"This method calls :meth:`ehlo` and/or :meth:`helo` if there has been no " +"previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP " +"``EHLO`` first." msgstr "" +"این متد، :meth:`ehlo` و/یا :meth:`helo` را در صورتی فراخوانی می‌کند که پیش‌تر " +"در این نشست دستور ``EHLO`` یا ``HELO`` وجود نداشته باشد. ابتدا ESMTP " +"``EHLO`` را امتحان می‌کند." msgid ":exc:`SMTPHeloError`" -msgstr "" +msgstr ":exc:`SMTPHeloError`" msgid "The server didn't reply properly to the ``HELO`` greeting." -msgstr "" +msgstr "سرور به‌درستی به سلام ``HELO`` پاسخ نداد." -msgid "Return :const:`True` if *name* is in the set of SMTP service extensions returned by the server, :const:`False` otherwise. Case is ignored." +msgid "" +"Return :const:`True` if *name* is in the set of SMTP service extensions " +"returned by the server, :const:`False` otherwise. Case is ignored." msgstr "" +"اگر *name* در مجموعه‌ی افزونه‌های سرویس SMTP برگردانده‌شده توسط سرور وجود " +"داشته باشد، :const:`True` و در غیر این صورت :const:`False` برمی‌گرداند. " +"بزرگی و کوچکی حروف نادیده گرفته می‌شود." -msgid "Check the validity of an address on this server using SMTP ``VRFY``. Returns a tuple consisting of code 250 and a full :rfc:`822` address (including human name) if the user address is valid. Otherwise returns an SMTP error code of 400 or greater and an error string." +msgid "" +"Check the validity of an address on this server using SMTP ``VRFY``. " +"Returns a tuple consisting of code 250 and a full :rfc:`822` address " +"(including human name) if the user address is valid. Otherwise returns an " +"SMTP error code of 400 or greater and an error string." msgstr "" +"صحت یک نشانی در این سرور را با استفاده از ``VRFY`` در SMTP بررسی می‌کند. اگر " +"نشانی کاربر معتبر باشد، تاپلی شامل کد ۲۵۰ و یک نشانی کامل :rfc:`822` (شامل " +"نام شخص) بازمی‌گرداند. در غیر این صورت، یک کد خطای SMTP با مقدار ۴۰۰ یا " +"بیشتر و یک رشته خطا بازمی‌گرداند." msgid "Many sites disable SMTP ``VRFY`` in order to foil spammers." msgstr "" +"بسیاری از وب‌سایت‌ها SMTP ``VRFY`` را غیرفعال می‌کنند تا جلوی هرزنامه‌فرستندگان " +"را بگیرند." -msgid "Log in on an SMTP server that requires authentication. The arguments are the username and the password to authenticate with. If there has been no previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP ``EHLO`` first. This method will return normally if the authentication was successful, or may raise the following exceptions:" -msgstr "" +msgid "" +"Log in on an SMTP server that requires authentication. The arguments are " +"the username and the password to authenticate with. If there has been no " +"previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP " +"``EHLO`` first. This method will return normally if the authentication was " +"successful, or may raise the following exceptions:" +msgstr "" +"به یک سرور SMTP که نیازمند احراز هویت است، وارد شوید. آرگومان‌ها، نام کاربری " +"و گذرواژه‌ای هستند که برای احراز هویت استفاده می‌شوند. اگر در این نشست هیچ " +"دستور ``EHLO`` یا ``HELO`` پیشینی وجود نداشته باشد، این متد ابتدا ESMTP " +"``EHLO`` را امتحان می‌کند. این متد در صورت موفقیت‌آمیز بودن احراز هویت، " +"به‌صورت عادی برمی‌گردد، یا ممکن است استثناهای زیر را پرتاب کند:" msgid ":exc:`SMTPAuthenticationError`" -msgstr "" +msgstr ":exc:`SMTPAuthenticationError`" msgid "The server didn't accept the username/password combination." -msgstr "" +msgstr "سرور ترکیب نام‌کاربری/گذرواژه را نپذیرفت." msgid ":exc:`SMTPNotSupportedError`" -msgstr "" +msgstr ":exc:`SMTPNotSupportedError`" msgid "The ``AUTH`` command is not supported by the server." -msgstr "" +msgstr "سرور از فرمان ``AUTH`` پشتیبانی نمی‌کند." msgid ":exc:`SMTPException`" -msgstr "" +msgstr ":exc:`SMTPException`" msgid "No suitable authentication method was found." -msgstr "" +msgstr "هیچ متد احراز هویت مناسبی یافت نشد." -msgid "Each of the authentication methods supported by :mod:`!smtplib` are tried in turn if they are advertised as supported by the server. See :meth:`auth` for a list of supported authentication methods. *initial_response_ok* is passed through to :meth:`auth`." +msgid "" +"Each of the authentication methods supported by :mod:`!smtplib` are tried " +"in turn if they are advertised as supported by the server. " +"See :meth:`auth` for a list of supported authentication methods. " +"*initial_response_ok* is passed through to :meth:`auth`." msgstr "" +"هر یک از روش‌های احراز هویت پشتیبانی‌شده توسط :mod:`!smtplib`، در صورتی که " +"پشتیبانی از آن‌ها توسط سرور اعلام شده باشد، به‌ترتیب امتحان می‌شوند. برای " +"مشاهده فهرستی از روش‌های احراز هویت پشتیبانی‌شده، :meth:`auth` را ببینید. " +"*initial_response_ok* به :meth:`auth` منتقل می‌شود." -msgid "Optional keyword argument *initial_response_ok* specifies whether, for authentication methods that support it, an \"initial response\" as specified in :rfc:`4954` can be sent along with the ``AUTH`` command, rather than requiring a challenge/response." +msgid "" +"Optional keyword argument *initial_response_ok* specifies whether, for " +"authentication methods that support it, an \"initial response\" as " +"specified in :rfc:`4954` can be sent along with the ``AUTH`` command, " +"rather than requiring a challenge/response." msgstr "" +"آرگومان کلیدواژه‌ای اختیاری *initial_response_ok* مشخص می‌کند که آیا، برای " +"روش‌های احراز هویتی که از آن پشتیبانی می‌کنند، می‌توان یک «پاسخ اولیه» " +"مطابق :rfc:`4954` را همراه با دستور ``AUTH`` ارسال کرد، به جای آنکه به چالش/" +"پاسخ نیاز باشد." -msgid ":exc:`SMTPNotSupportedError` may be raised, and the *initial_response_ok* parameter was added." +msgid "" +":exc:`SMTPNotSupportedError` may be raised, and the *initial_response_ok* " +"parameter was added." msgstr "" +"ممکن است :exc:`SMTPNotSupportedError` پرتاب شود، و پارامتر " +"*initial_response_ok* افزوده شده است." -msgid "Issue an ``SMTP`` ``AUTH`` command for the specified authentication *mechanism*, and handle the challenge response via *authobject*." +msgid "" +"Issue an ``SMTP`` ``AUTH`` command for the specified authentication " +"*mechanism*, and handle the challenge response via *authobject*." msgstr "" +"دستور ``SMTP`` ``AUTH`` را برای *mechanism* احراز هویت مشخص‌شده صادر کنید و " +"پاسخ چالش را از طریق *authobject* مدیریت کنید." -msgid "*mechanism* specifies which authentication mechanism is to be used as argument to the ``AUTH`` command; the valid values are those listed in the ``auth`` element of :attr:`esmtp_features`." +msgid "" +"*mechanism* specifies which authentication mechanism is to be used as " +"argument to the ``AUTH`` command; the valid values are those listed in the " +"``auth`` element of :attr:`esmtp_features`." msgstr "" +"*mechanism* مشخص می‌کند که کدام سازوکار احراز هویت باید به‌عنوان آرگومان " +"فرمان ``AUTH`` استفاده شود؛ مقادیر معتبر، آن‌هایی هستند که در عنصر ``auth`` " +"از :attr:`esmtp_features` فهرست شده‌اند." -msgid "*authobject* must be a callable object taking an optional single argument::" +msgid "" +"*authobject* must be a callable object taking an optional single argument::" msgstr "" +"*authobject* باید یک شیء قابل فراخوانی باشد که یک آرگومان اختیاری می‌پذیرد::" msgid "data = authobject(challenge=None)" -msgstr "" +msgstr "data = authobject(challenge=None)" -msgid "If optional keyword argument *initial_response_ok* is true, ``authobject()`` will be called first with no argument. It can return the :rfc:`4954` \"initial response\" ASCII ``str`` which will be encoded and sent with the ``AUTH`` command as below. If the ``authobject()`` does not support an initial response (e.g. because it requires a challenge), it should return ``None`` when called with ``challenge=None``. If *initial_response_ok* is false, then ``authobject()`` will not be called first with ``None``." -msgstr "" +msgid "" +"If optional keyword argument *initial_response_ok* is true, " +"``authobject()`` will be called first with no argument. It can return " +"the :rfc:`4954` \"initial response\" ASCII ``str`` which will be encoded " +"and sent with the ``AUTH`` command as below. If the ``authobject()`` does " +"not support an initial response (e.g. because it requires a challenge), it " +"should return ``None`` when called with ``challenge=None``. If " +"*initial_response_ok* is false, then ``authobject()`` will not be called " +"first with ``None``." +msgstr "" +"اگر آرگومان کلیدواژه‌ای اختیاری *initial_response_ok* درست باشد، " +"``authobject()`` ابتدا بدون آرگومان فراخوانی می‌شود. این تابع می‌تواند یک " +"``str`` ASCII «پاسخ اولیه» طبق :rfc:`4954` را برگرداند که کدگذاری شده و " +"به‌صورت زیر همراه با دستور ``AUTH`` ارسال می‌شود. اگر ``authobject()`` از " +"پاسخ اولیه پشتیبانی نمی‌کند (مثلاً به این دلیل که به یک چالش نیاز دارد)، باید " +"هنگام فراخوانی با ``challenge=None`` مقدار ``None`` را برگرداند. اگر " +"*initial_response_ok* نادرست باشد، آنگاه ``authobject()`` ابتدا با ``None`` " +"فراخوانی نمی‌شود." -msgid "If the initial response check returns ``None``, or if *initial_response_ok* is false, ``authobject()`` will be called to process the server's challenge response; the *challenge* argument it is passed will be a ``bytes``. It should return ASCII ``str`` *data* that will be base64 encoded and sent to the server." -msgstr "" +msgid "" +"If the initial response check returns ``None``, or if *initial_response_ok* " +"is false, ``authobject()`` will be called to process the server's challenge " +"response; the *challenge* argument it is passed will be a ``bytes``. It " +"should return ASCII ``str`` *data* that will be base64 encoded and sent to " +"the server." +msgstr "" +"اگر بررسی پاسخ اولیه ``None`` برگرداند، یا اگر *initial_response_ok* نادرست " +"باشد، ``authobject()`` فراخوانی خواهد شد تا پاسخ چالش سرور را پردازش کند؛ " +"آرگومان *challenge* که به آن داده می‌شود یک ``bytes`` خواهد بود. باید *data* " +"از نوع ``str`` ASCII را بازگرداند که کدگذاری base64 می‌شود و به سرور ارسال " +"می‌شود." -msgid "The ``SMTP`` class provides ``authobjects`` for the ``CRAM-MD5``, ``PLAIN``, and ``LOGIN`` mechanisms; they are named ``SMTP.auth_cram_md5``, ``SMTP.auth_plain``, and ``SMTP.auth_login`` respectively. They all require that the ``user`` and ``password`` properties of the ``SMTP`` instance are set to appropriate values." -msgstr "" +msgid "" +"The ``SMTP`` class provides ``authobjects`` for the ``CRAM-MD5``, " +"``PLAIN``, and ``LOGIN`` mechanisms; they are named ``SMTP.auth_cram_md5``, " +"``SMTP.auth_plain``, and ``SMTP.auth_login`` respectively. They all " +"require that the ``user`` and ``password`` properties of the ``SMTP`` " +"instance are set to appropriate values." +msgstr "" +"کلاس ``SMTP``، ``authobjects`` را برای سازوکارهای ``CRAM-MD5``، ``PLAIN`` و " +"``LOGIN`` فراهم می‌کند؛ این موارد به‌ترتیب ``SMTP.auth_cram_md5``، " +"``SMTP.auth_plain`` و ``SMTP.auth_login`` نام‌گذاری شده‌اند. همه‌ی آن‌ها نیاز " +"دارند که ویژگی‌های ``user`` و ``password`` از نمونه‌ی ``SMTP`` روی مقادیر " +"مناسب تنظیم شده باشند." -msgid "User code does not normally need to call ``auth`` directly, but can instead call the :meth:`login` method, which will try each of the above mechanisms in turn, in the order listed. ``auth`` is exposed to facilitate the implementation of authentication methods not (or not yet) supported directly by :mod:`!smtplib`." -msgstr "" +msgid "" +"User code does not normally need to call ``auth`` directly, but can instead " +"call the :meth:`login` method, which will try each of the above mechanisms " +"in turn, in the order listed. ``auth`` is exposed to facilitate the " +"implementation of authentication methods not (or not yet) supported " +"directly by :mod:`!smtplib`." +msgstr "" +"کد کاربر معمولاً نیازی ندارد ``auth`` را مستقیماً فراخوانی کند، بلکه می‌تواند " +"در عوض متد :meth:`login` را فراخوانی کند، که هر یک از سازوکارهای بالا را " +"به‌نوبت و به ترتیب ذکرشده امتحان می‌کند. ``auth`` برای تسهیل پیاده‌سازی روش‌های " +"احراز هویت که مستقیماً در :mod:`!smtplib` پشتیبانی نمی‌شوند (یا هنوز پشتیبانی " +"نمی‌شوند) در دسترس قرار گرفته است." -msgid "Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP commands that follow will be encrypted. You should then call :meth:`ehlo` again." +msgid "" +"Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP " +"commands that follow will be encrypted. You should then call :meth:`ehlo` " +"again." msgstr "" +"اتصال SMTP را در حالت TLS (امنیت لایه‌ی انتقال) قرار دهید. تمام دستورات SMTP " +"که در ادامه می‌آیند رمزگذاری خواهند شد. سپس باید :meth:`ehlo` را دوباره " +"فراخوانی کنید." -msgid "If *keyfile* and *certfile* are provided, they are used to create an :class:`ssl.SSLContext`." +msgid "" +"If *keyfile* and *certfile* are provided, they are used to create " +"an :class:`ssl.SSLContext`." msgstr "" +"اگر *keyfile* و *certfile* ارائه شده باشند، از آن‌ها برای ایجاد " +"یک :class:`ssl.SSLContext` استفاده می‌شود." -msgid "Optional *context* parameter is an :class:`ssl.SSLContext` object; This is an alternative to using a keyfile and a certfile and if specified both *keyfile* and *certfile* should be ``None``." +msgid "" +"Optional *context* parameter is an :class:`ssl.SSLContext` object; This is " +"an alternative to using a keyfile and a certfile and if specified both " +"*keyfile* and *certfile* should be ``None``." msgstr "" +"پارامتر اختیاری *context* یک شیء :class:`ssl.SSLContext` است؛ این یک " +"جایگزین برای استفاده از *keyfile* و *certfile* است و در صورت مشخص شدن، هر " +"دو *keyfile* و *certfile* باید ``None`` باشند." -msgid "If there has been no previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP ``EHLO`` first." +msgid "" +"If there has been no previous ``EHLO`` or ``HELO`` command this session, " +"this method tries ESMTP ``EHLO`` first." msgstr "" +"اگر در این نشست هیچ دستور پیشین ``EHLO`` یا ``HELO`` وجود نداشته باشد، این " +"متد ابتدا ESMTP ``EHLO`` را امتحان می‌کند." msgid "The server does not support the STARTTLS extension." -msgstr "" +msgstr "سرور از افزونه STARTTLS پشتیبانی نمی‌کند." msgid ":exc:`RuntimeError`" -msgstr "" +msgstr ":exc:`RuntimeError`" msgid "SSL/TLS support is not available to your Python interpreter." -msgstr "" +msgstr "پشتیبانی از SSL/TLS در مفسر پایتون شما در دسترس نیست." -msgid "The method now supports hostname check with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indicator* (see :const:`~ssl.HAS_SNI`)." +msgid "" +"The method now supports hostname check " +"with :attr:`ssl.SSLContext.check_hostname` and *Server Name Indicator* " +"(see :const:`~ssl.HAS_SNI`)." msgstr "" +"این متد اکنون از بررسی نام میزبان با :attr:`ssl.SSLContext.check_hostname` " +"و *نشانگر نام سرور* (Server Name Indicator) پشتیبانی می‌کند (نگاه کنید " +"به :const:`~ssl.HAS_SNI`)." -msgid "The error raised for lack of STARTTLS support is now the :exc:`SMTPNotSupportedError` subclass instead of the base :exc:`SMTPException`." +msgid "" +"The error raised for lack of STARTTLS support is now " +"the :exc:`SMTPNotSupportedError` subclass instead of the " +"base :exc:`SMTPException`." msgstr "" +"خطایی که به دلیل فقدان پشتیبانی از STARTTLS پرتاب می‌شود، اکنون به جای کلاس " +"پایه‌ی :exc:`SMTPException `، از " +"زیرکلاس :exc:`SMTPNotSupportedError ` است." -msgid "Send mail. The required arguments are an :rfc:`822` from-address string, a list of :rfc:`822` to-address strings (a bare string will be treated as a list with 1 address), and a message string. The caller may pass a list of ESMTP options (such as ``\"8bitmime\"``) to be used in ``MAIL FROM`` commands as *mail_options*. ESMTP options (such as ``DSN`` commands) that should be used with all ``RCPT`` commands can be passed as *rcpt_options*. Each option should be passed as a string containing the full text of the option, including any potential key (for instance, ``\"NOTIFY=SUCCESS,FAILURE\"``). (If you need to use different ESMTP options to different recipients you have to use the low-level methods such as :meth:`!mail`, :meth:`!rcpt` and :meth:`!data` to send the message.)" -msgstr "" +msgid "" +"Send mail. The required arguments are an :rfc:`822` from-address string, a " +"list of :rfc:`822` to-address strings (a bare string will be treated as a " +"list with 1 address), and a message string. The caller may pass a list of " +"ESMTP options (such as ``\"8bitmime\"``) to be used in ``MAIL FROM`` " +"commands as *mail_options*. ESMTP options (such as ``DSN`` commands) that " +"should be used with all ``RCPT`` commands can be passed as *rcpt_options*. " +"Each option should be passed as a string containing the full text of the " +"option, including any potential key (for instance, " +"``\"NOTIFY=SUCCESS,FAILURE\"``). (If you need to use different ESMTP " +"options to different recipients you have to use the low-level methods such " +"as :meth:`!mail`, :meth:`!rcpt` and :meth:`!data` to send the message.)" +msgstr "" +"ارسال ایمیل. آرگومان‌های الزامی عبارت‌اند از: یک رشته‌ی آدرس فرستنده " +"مطابق :rfc:`822`، فهرستی از رشته‌های آدرس گیرنده مطابق :rfc:`822` (یک رشته‌ی " +"ساده به‌عنوان فهرستی حاوی ۱ آدرس در نظر گرفته می‌شود)، و یک رشته‌ی پیام. " +"فراخواننده می‌تواند فهرستی از گزینه‌های ESMTP (مانند ``\"8bitmime\"``) را " +"برای استفاده در دستورات ``MAIL FROM`` به‌عنوان *mail_options* ارسال کند. " +"گزینه‌های ESMTP (مانند دستورات ``DSN``) را که باید با تمام دستورات ``RCPT`` " +"استفاده شوند، می‌توان به‌عنوان *rcpt_options* ارسال کرد. هر گزینه باید به‌صورت " +"رشته‌ای ارسال شود که حاوی متن کامل گزینه باشد، از جمله هر کلید احتمالی (برای " +"مثال، ``\"NOTIFY=SUCCESS,FAILURE\"``). (اگر نیاز دارید برای گیرندگان مختلف " +"از گزینه‌های ESMTP متفاوت استفاده کنید، باید از متدهای سطح پایین " +"مانند :meth:`!mail`، :meth:`!rcpt` و :meth:`!data` برای ارسال پیام استفاده " +"کنید.)" -msgid "The *from_addr* and *to_addrs* parameters are used to construct the message envelope used by the transport agents. ``sendmail`` does not modify the message headers in any way." +msgid "" +"The *from_addr* and *to_addrs* parameters are used to construct the message " +"envelope used by the transport agents. ``sendmail`` does not modify the " +"message headers in any way." msgstr "" +"پارامترهای *from_addr* و *to_addrs* برای ساخت پاکت پیام (message envelope) " +"مورد استفاده‌ی عوامل انتقال به کار می‌روند. ``sendmail`` به هیچ وجه سرآیندهای " +"پیام را تغییر نمی‌دهد." -msgid "*msg* may be a string containing characters in the ASCII range, or a byte string. A string is encoded to bytes using the ascii codec, and lone ``\\r`` and ``\\n`` characters are converted to ``\\r\\n`` characters. A byte string is not modified." +msgid "" +"*msg* may be a string containing characters in the ASCII range, or a byte " +"string. A string is encoded to bytes using the ascii codec, and lone " +"``\\r`` and ``\\n`` characters are converted to ``\\r\\n`` characters. A " +"byte string is not modified." msgstr "" +"*msg* ممکن است یک رشته حاوی نویسه‌های محدوده ASCII یا یک رشته بایتی باشد. یک " +"رشته با استفاده از کدک ascii به بایت کدگذاری می‌شود و نویسه‌های منفرد ``\\r`` " +"و ``\\n`` به نویسه‌های ``\\r\\n`` تبدیل می‌شوند. یک رشته بایتی تغییر نمی‌کند." -msgid "If there has been no previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP ``EHLO`` first. If the server does ESMTP, message size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If ``EHLO`` fails, ``HELO`` will be tried and ESMTP options suppressed." -msgstr "" +msgid "" +"If there has been no previous ``EHLO`` or ``HELO`` command this session, " +"this method tries ESMTP ``EHLO`` first. If the server does ESMTP, message " +"size and each of the specified options will be passed to it (if the option " +"is in the feature set the server advertises). If ``EHLO`` fails, ``HELO`` " +"will be tried and ESMTP options suppressed." +msgstr "" +"اگر در این نشست پیش‌تر دستور ``EHLO`` یا ``HELO`` ارسال نشده باشد، این متد " +"ابتدا ``EHLO`` ESMTP را امتحان می‌کند. اگر سرور ESMTP را پشتیبانی کند، " +"اندازه پیام و هر یک از گزینه‌های مشخص‌شده به آن ارسال می‌شوند (اگر گزینه در " +"مجموعه قابلیت‌هایی باشد که سرور اعلام می‌کند). اگر ``EHLO`` ناموفق باشد، " +"``HELO`` امتحان می‌شود و گزینه‌های ESMTP حذف می‌شوند." -msgid "This method will return normally if the mail is accepted for at least one recipient. Otherwise it will raise an exception. That is, if this method does not raise an exception, then someone should get your mail. If this method does not raise an exception, it returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server." -msgstr "" +msgid "" +"This method will return normally if the mail is accepted for at least one " +"recipient. Otherwise it will raise an exception. That is, if this method " +"does not raise an exception, then someone should get your mail. If this " +"method does not raise an exception, it returns a dictionary, with one entry " +"for each recipient that was refused. Each entry contains a tuple of the " +"SMTP error code and the accompanying error message sent by the server." +msgstr "" +"این متد در صورت پذیرفته شدن ایمیل برای حداقل یک گیرنده، به‌طور عادی " +"برمی‌گردد. در غیر این صورت استثنایی پرتاب خواهد کرد. یعنی اگر این متد " +"استثنایی پرتاب نکند، ایمیل شما باید به دست کسی برسد. اگر این متد استثنایی " +"پرتاب نکند، یک دیکشنری برمی‌گرداند که برای هر گیرنده‌ای که رد شده باشد، یک " +"آیتم دارد. هر آیتم شامل یک تاپلاز کد خطای SMTP و پیام خطای همراه " +"ارسال‌شده از سوی سرور است." -msgid "If ``SMTPUTF8`` is included in *mail_options*, and the server supports it, *from_addr* and *to_addrs* may contain non-ASCII characters." +msgid "" +"If ``SMTPUTF8`` is included in *mail_options*, and the server supports it, " +"*from_addr* and *to_addrs* may contain non-ASCII characters." msgstr "" +"اگر ``SMTPUTF8`` در *mail_options* گنجانده شده باشد و سرور از آن پشتیبانی " +"کند، *from_addr* و *to_addrs* می‌توانند شامل نویسه‌های غیر ASCII باشند." msgid "This method may raise the following exceptions:" -msgstr "" +msgstr "این متد ممکن است استثناهای زیر را پرتاب کند:" msgid ":exc:`SMTPRecipientsRefused`" -msgstr "" +msgstr ":exc:`SMTPRecipientsRefused`" msgid "All recipients were refused. Nobody got the mail." -msgstr "" +msgstr "همه‌ی گیرنده‌ها رد شدند. هیچ‌کس ایمیل را دریافت نکرد." msgid ":exc:`SMTPSenderRefused`" -msgstr "" +msgstr ":exc:`SMTPSenderRefused`" msgid "The server didn't accept the *from_addr*." -msgstr "" +msgstr "سرور *from_addr* را نپذیرفت." msgid ":exc:`SMTPDataError`" -msgstr "" +msgstr ":exc:`SMTPDataError`" -msgid "The server replied with an unexpected error code (other than a refusal of a recipient)." -msgstr "" +msgid "" +"The server replied with an unexpected error code (other than a refusal of a " +"recipient)." +msgstr "سرور با کد خطای غیرمنتظره‌ای پاسخ داد (غیر از رد یک گیرنده)." -msgid "``SMTPUTF8`` was given in the *mail_options* but is not supported by the server." +msgid "" +"``SMTPUTF8`` was given in the *mail_options* but is not supported by the " +"server." msgstr "" +"``SMTPUTF8`` در *mail_options* داده شده است، اما سرور از آن پشتیبانی نمی‌کند." -msgid "Unless otherwise noted, the connection will be open even after an exception is raised." +msgid "" +"Unless otherwise noted, the connection will be open even after an exception " +"is raised." msgstr "" +"مگر اینکه خلاف آن ذکر شده باشد، اتصال حتی پس از پرتاب شدن یک استثنا باز " +"خواهد بود." msgid "*msg* may be a byte string." -msgstr "" +msgstr "ممکن است *msg* یک رشته بایتی باشد." -msgid "``SMTPUTF8`` support added, and :exc:`SMTPNotSupportedError` may be raised if ``SMTPUTF8`` is specified but the server does not support it." +msgid "" +"``SMTPUTF8`` support added, and :exc:`SMTPNotSupportedError` may be raised " +"if ``SMTPUTF8`` is specified but the server does not support it." msgstr "" +"پشتیبانی از ``SMTPUTF8`` اضافه شد، و اگر ``SMTPUTF8`` تعیین شده باشد اما " +"سرور از آن پشتیبانی نکند، ممکن است :exc:`SMTPNotSupportedError` پرتاب شود." -msgid "This is a convenience method for calling :meth:`sendmail` with the message represented by an :class:`email.message.Message` object. The arguments have the same meaning as for :meth:`sendmail`, except that *msg* is a ``Message`` object." +msgid "" +"This is a convenience method for calling :meth:`sendmail` with the message " +"represented by an :class:`email.message.Message` object. The arguments " +"have the same meaning as for :meth:`sendmail`, except that *msg* is a " +"``Message`` object." msgstr "" +"این یک متد سهولت‌بخش برای فراخوانی :meth:`sendmail` با پیامی است که توسط یک " +"شیء :class:`email.message.Message` بازنمایی می‌شود. آرگومان‌ها همان معنای خود " +"در :meth:`sendmail` را دارند، به‌جز اینکه *msg* یک شیء ``Message`` است." -msgid "If *from_addr* is ``None`` or *to_addrs* is ``None``, ``send_message`` fills those arguments with addresses extracted from the headers of *msg* as specified in :rfc:`5322`\\: *from_addr* is set to the :mailheader:`Sender` field if it is present, and otherwise to the :mailheader:`From` field. *to_addrs* combines the values (if any) of the :mailheader:`To`, :mailheader:`Cc`, and :mailheader:`Bcc` fields from *msg*. If exactly one set of :mailheader:`Resent-*` headers appear in the message, the regular headers are ignored and the :mailheader:`Resent-*` headers are used instead. If the message contains more than one set of :mailheader:`Resent-*` headers, a :exc:`ValueError` is raised, since there is no way to unambiguously detect the most recent set of :mailheader:`Resent-` headers." -msgstr "" +msgid "" +"If *from_addr* is ``None`` or *to_addrs* is ``None``, ``send_message`` " +"fills those arguments with addresses extracted from the headers of *msg* as " +"specified in :rfc:`5322`\\: *from_addr* is set to the :mailheader:`Sender` " +"field if it is present, and otherwise to the :mailheader:`From` field. " +"*to_addrs* combines the values (if any) of " +"the :mailheader:`To`, :mailheader:`Cc`, and :mailheader:`Bcc` fields from " +"*msg*. If exactly one set of :mailheader:`Resent-*` headers appear in the " +"message, the regular headers are ignored and the :mailheader:`Resent-*` " +"headers are used instead. If the message contains more than one set " +"of :mailheader:`Resent-*` headers, a :exc:`ValueError` is raised, since " +"there is no way to unambiguously detect the most recent set " +"of :mailheader:`Resent-` headers." +msgstr "" +"اگر *from_addr* برابر ``None`` یا *to_addrs* برابر ``None`` باشد، " +"``send_message`` آن آرگومان‌ها را با نشانی‌های استخراج‌شده از سرآیندهای *msg* " +"پر می‌کند، همان‌طور که در :rfc:`5322`\\: مشخص شده است، *from_addr* در صورت " +"وجود به فیلد :mailheader:`Sender` و در غیر این صورت به " +"فیلد :mailheader:`From` تنظیم می‌شود. *to_addrs* مقدارهای " +"فیلدهای :mailheader:`To`، :mailheader:`Cc` و :mailheader:`Bcc` را (در صورت " +"وجود) از *msg* با هم ترکیب می‌کند. اگر دقیقاً یک مجموعه از " +"سرآیندهای :mailheader:`Resent-*` در پیام وجود داشته باشد، سرآیندهای معمولی " +"نادیده گرفته می‌شوند و در عوض از سرآیندهای :mailheader:`Resent-*` استفاده " +"می‌شود. اگر پیام شامل بیش از یک مجموعه از سرآیندهای :mailheader:`Resent-*` " +"باشد، یک :exc:`ValueError` پرتاب می‌شود، زیرا هیچ راهی برای تشخیص بدون ابهام " +"آخرین مجموعه از سرآیندهای :mailheader:`Resent-` وجود ندارد." -msgid "``send_message`` serializes *msg* using :class:`~email.generator.BytesGenerator` with ``\\r\\n`` as the *linesep*, and calls :meth:`sendmail` to transmit the resulting message. Regardless of the values of *from_addr* and *to_addrs*, ``send_message`` does not transmit any :mailheader:`Bcc` or :mailheader:`Resent-Bcc` headers that may appear in *msg*. If any of the addresses in *from_addr* and *to_addrs* contain non-ASCII characters and the server does not advertise ``SMTPUTF8`` support, an :exc:`SMTPNotSupportedError` is raised. Otherwise the ``Message`` is serialized with a clone of its :mod:`~email.policy` with the :attr:`~email.policy.EmailPolicy.utf8` attribute set to ``True``, and ``SMTPUTF8`` and ``BODY=8BITMIME`` are added to *mail_options*." -msgstr "" +msgid "" +"``send_message`` serializes *msg* " +"using :class:`~email.generator.BytesGenerator` with ``\\r\\n`` as the " +"*linesep*, and calls :meth:`sendmail` to transmit the resulting message. " +"Regardless of the values of *from_addr* and *to_addrs*, ``send_message`` " +"does not transmit any :mailheader:`Bcc` or :mailheader:`Resent-Bcc` headers " +"that may appear in *msg*. If any of the addresses in *from_addr* and " +"*to_addrs* contain non-ASCII characters and the server does not advertise " +"``SMTPUTF8`` support, an :exc:`SMTPNotSupportedError` is raised. Otherwise " +"the ``Message`` is serialized with a clone of its :mod:`~email.policy` with " +"the :attr:`~email.policy.EmailPolicy.utf8` attribute set to ``True``, and " +"``SMTPUTF8`` and ``BODY=8BITMIME`` are added to *mail_options*." +msgstr "" +"``send_message`` *msg* را با استفاده " +"از :class:`~email.generator.BytesGenerator` با ``\\r\\n`` به‌عنوان *linesep* " +"سریال‌سازی می‌کند و :meth:`sendmail` را فراخوانی می‌کند تا پیام حاصل ارسال " +"شود. صرف‌نظر از مقادیر *from_addr* و *to_addrs*، ``send_message`` هیچ‌یک از " +"سرصفحه‌های :mailheader:`Bcc` یا :mailheader:`Resent-Bcc` را که ممکن است در " +"*msg* وجود داشته باشند، ارسال نمی‌کند. اگر هر یک از نشانی‌های موجود در " +"*from_addr* و *to_addrs* حاوی نویسه‌های غیر ASCII باشد و سرور پشتیبانی از " +"``SMTPUTF8`` را اعلام نکند، استثنای :exc:`SMTPNotSupportedError` پرتاب " +"می‌شود. در غیر این صورت، ``Message`` با یک نسخه‌ی مشابه " +"از :mod:`~email.policy` خود سریال‌سازی می‌شود که در آن " +"ویژگی :attr:`~email.policy.EmailPolicy.utf8` روی ``True`` تنظیم شده است، و " +"``SMTPUTF8`` و ``BODY=8BITMIME`` به *mail_options* افزوده می‌شوند." msgid "Support for internationalized addresses (``SMTPUTF8``)." -msgstr "" +msgstr "پشتیبانی از نشانی‌های بین‌المللی‌شده (``SMTPUTF8``)." -msgid "Terminate the SMTP session and close the connection. Return the result of the SMTP ``QUIT`` command." +msgid "" +"Terminate the SMTP session and close the connection. Return the result of " +"the SMTP ``QUIT`` command." msgstr "" +"نشست SMTP را پایان می‌دهد و اتصال را می‌بندد. نتیجه‌ی دستور ``QUIT`` SMTP را " +"برمی‌گرداند." -msgid "Low-level methods corresponding to the standard SMTP/ESMTP commands ``HELP``, ``RSET``, ``NOOP``, ``MAIL``, ``RCPT``, and ``DATA`` are also supported. Normally these do not need to be called directly, so they are not documented here. For details, consult the module code." +msgid "" +"Low-level methods corresponding to the standard SMTP/ESMTP commands " +"``HELP``, ``RSET``, ``NOOP``, ``MAIL``, ``RCPT``, and ``DATA`` are also " +"supported. Normally these do not need to be called directly, so they are " +"not documented here. For details, consult the module code." msgstr "" +"متدهای سطح پایینی که متناظر با فرمان‌های استاندارد SMTP/ESMTP یعنی ``HELP``، " +"``RSET``، ``NOOP``، ``MAIL``، ``RCPT`` و ``DATA`` هستند نیز پشتیبانی " +"می‌شوند. معمولاً نیازی به فراخوانی مستقیم آن‌ها نیست، بنابراین در اینجا مستند " +"نشده‌اند. برای جزئیات، به کد ماژول مراجعه کنید." msgid "Additionally, an SMTP instance has the following attributes:" -msgstr "" +msgstr "علاوه بر این، یک نمونه SMTP دارای ویژگی‌های زیر است:" msgid "The response to the ``HELO`` command, see :meth:`helo`." -msgstr "" +msgstr "پاسخ به فرمان ``HELO``، :meth:`helo` را ببینید." msgid "The response to the ``EHLO`` command, see :meth:`ehlo`." -msgstr "" +msgstr "پاسخ به دستور ``EHLO``، :meth:`ehlo` را ببینید." -msgid "A boolean value indicating whether the server supports ESMTP, see :meth:`ehlo`." +msgid "" +"A boolean value indicating whether the server supports ESMTP, " +"see :meth:`ehlo`." msgstr "" +"مقدار بولی که نشان می‌دهد آیا سرور از ESMTP پشتیبانی می‌کند یا " +"خیر؛ :meth:`ehlo` را ببینید." -msgid "A dictionary of the names of SMTP service extensions supported by the server, see :meth:`ehlo`." +msgid "" +"A dictionary of the names of SMTP service extensions supported by the " +"server, see :meth:`ehlo`." msgstr "" +"دیکشنری‌ای از نام‌های افزونه‌های سرویس SMTP پشتیبانی‌شده توسط " +"سرور، :meth:`ehlo` را ببینید." msgid "SMTP Example" -msgstr "" +msgstr "مثال SMTP" -msgid "This example prompts the user for addresses needed in the message envelope ('To' and 'From' addresses), and the message to be delivered. Note that the headers to be included with the message must be included in the message as entered; this example doesn't do any processing of the :rfc:`822` headers. In particular, the 'To' and 'From' addresses must be included in the message headers explicitly::" -msgstr "" +msgid "" +"This example prompts the user for addresses needed in the message envelope " +"('To' and 'From' addresses), and the message to be delivered. Note that " +"the headers to be included with the message must be included in the message " +"as entered; this example doesn't do any processing of the :rfc:`822` " +"headers. In particular, the 'To' and 'From' addresses must be included in " +"the message headers explicitly::" +msgstr "" +"این مثال از کاربر می‌خواهد که نشانی‌های مورد نیاز در پاکت پیام (نشانی‌های 'To' " +"و 'From') و پیامی را که باید تحویل داده شود وارد کند. توجه داشته باشید که " +"سرآیندهایی که باید همراه پیام باشند، باید به همان شکلی که وارد شده‌اند در " +"پیام گنجانده شوند؛ این مثال هیچ پردازشی روی سرآیندهای :rfc:`822` انجام " +"نمی‌دهد. به‌ویژه، نشانی‌های 'To' و 'From' باید به‌صراحت در سرآیندهای پیام " +"گنجانده شوند::" msgid "" "import smtplib\n" @@ -415,15 +957,48 @@ msgid "" "server.sendmail(from_addr, to_addrs, msg)\n" "server.quit()" msgstr "" +"import smtplib\n" +"\n" +"def prompt(title):\n" +" return input(title).strip()\n" +"\n" +"from_addr = prompt(\"From: \")\n" +"to_addrs = prompt(\"To: \").split()\n" +"print(\"Enter message, end with ^D (Unix) or ^Z (Windows):\")\n" +"\n" +"# Add the From: and To: headers at the start!\n" +"lines = [f\"From: {from_addr}\", f\"To: {', '.join(to_addrs)}\", \"\"]\n" +"while True:\n" +" try:\n" +" line = input()\n" +" except EOFError:\n" +" break\n" +" else:\n" +" lines.append(line)\n" +"\n" +"msg = \"\\r\\n\".join(lines)\n" +"print(\"Message length is\", len(msg))\n" +"\n" +"server = smtplib.SMTP(\"localhost\")\n" +"server.set_debuglevel(1)\n" +"server.sendmail(from_addr, to_addrs, msg)\n" +"server.quit()" -msgid "In general, you will want to use the :mod:`email` package's features to construct an email message, which you can then send via :meth:`~smtplib.SMTP.send_message`; see :ref:`email-examples`." +msgid "" +"In general, you will want to use the :mod:`email` package's features to " +"construct an email message, which you can then send " +"via :meth:`~smtplib.SMTP.send_message`; see :ref:`email-examples`." msgstr "" +"به‌طور کلی، شما می‌خواهید از قابلیت‌های بسته‌ی :mod:`email` برای ساخت یک پیام " +"ایمیل استفاده کنید، که سپس می‌توانید آن را از " +"طریق :meth:`~smtplib.SMTP.send_message` ارسال کنید؛ :ref:`email-examples` " +"را ببینید." msgid "SMTP" -msgstr "" +msgstr "SMTP" msgid "protocol" -msgstr "" +msgstr "پروتکل" msgid "Simple Mail Transfer Protocol" -msgstr "" +msgstr "پروتکل انتقال نامه‌ی ساده" diff --git a/library/sndhdr.po b/library/sndhdr.po index e9ec9333d..42176338f 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -22,13 +22,29 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!sndhdr` --- Determine type of sound file" -msgstr "" +msgstr ":mod:`!sndhdr` --- تعیین نوع فایل صوتی" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. " +"تصمیم برای حذف آن در :pep:`594` گرفته شد." -msgid "Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or maintained by the Python core team." +msgid "" +"Possible replacements are third-party modules from PyPI: :pypi:`filetype`, " +":pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or " +"maintained by the Python core team." msgstr "" +"جایگزین‌های ممکن، ماژول‌های شخص ثالث از PyPI هستند: :pypi:`filetype`، " +":pypi:`puremagic` یا :pypi:`python-magic`. این ماژول‌ها توسط تیم اصلی پایتون" +" پشتیبانی یا نگهداری نمی‌شوند." -msgid "The last version of Python that provided the :mod:`!sndhdr` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!sndhdr` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه از پایتون که ماژول :mod:`!sndhdr` را ارائه می‌کرد، `Python 3.12 " +"`_ بود." diff --git a/library/socket.po b/library/socket.po index 54150107c..48f5640cd 100644 --- a/library/socket.po +++ b/library/socket.po @@ -26,496 +26,1185 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!socket` --- Low-level networking interface" -msgstr "" +msgstr ":mod:`!socket` --- رابط شبکه‌ای سطح پایین" msgid "**Source code:** :source:`Lib/socket.py`" -msgstr "" +msgstr ":source:`Lib/socket.py`" -msgid "This module provides access to the BSD *socket* interface. It is available on all modern Unix systems, Windows, MacOS, and probably additional platforms." +msgid "" +"This module provides access to the BSD *socket* interface. It is available " +"on all modern Unix systems, Windows, MacOS, and probably additional " +"platforms." msgstr "" +"این ماژول دسترسی به رابط *سوکت* BSD را فراهم می‌کند. این ماژول در تمام " +"سیستم‌های یونیکس مدرن، ویندوز، مک‌اواس و احتمالاً پلتفرم‌های دیگر در دسترس " +"است." -msgid "Some behavior may be platform dependent, since calls are made to the operating system socket APIs." +msgid "" +"Some behavior may be platform dependent, since calls are made to the " +"operating system socket APIs." msgstr "" +"برخی رفتارها ممکن است وابسته به پلتفرم باشند، زیرا APIهای سوکت سیستم‌عامل " +"فراخوانی می‌شوند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر " +":ref:`wasm-availability` را ببینید." -msgid "The Python interface is a straightforward transliteration of the Unix system call and library interface for sockets to Python's object-oriented style: the :func:`~socket.socket` function returns a :dfn:`socket object` whose methods implement the various socket system calls. Parameter types are somewhat higher-level than in the C interface: as with :meth:`read` and :meth:`write` operations on Python files, buffer allocation on receive operations is automatic, and buffer length is implicit on send operations." -msgstr "" +msgid "" +"The Python interface is a straightforward transliteration of the Unix system" +" call and library interface for sockets to Python's object-oriented style: " +"the :func:`~socket.socket` function returns a :dfn:`socket object` whose " +"methods implement the various socket system calls. Parameter types are " +"somewhat higher-level than in the C interface: as with :meth:`read` and " +":meth:`write` operations on Python files, buffer allocation on receive " +"operations is automatic, and buffer length is implicit on send operations." +msgstr "" +"رابط پایتون، بازنویسی مستقیمی از رابط فراخوانی سیستمی و کتابخانه‌ای یونیکس " +"برای سوکت‌ها به سبک شیءگرای پایتون است: تابع :func:`~socket.socket` یک " +":dfn:`شیء سوکت ` برمی‌گرداند که متدهای آن فراخوانی‌های " +"سیستمی مختلف سوکت را پیاده‌سازی می‌کنند. انواع پارامترها تا حدودی سطح " +"بالاتری نسبت به رابط C دارند: همان‌طور که در عملیات :meth:`read` و " +":meth:`write` بر فایل‌های پایتون وجود دارد، تخصیص بافر در عملیات دریافت " +"خودکار است و طول بافر در عملیات ارسال ضمنی است." msgid "Module :mod:`socketserver`" -msgstr "" +msgstr "ماژول :mod:`socketserver`" msgid "Classes that simplify writing network servers." -msgstr "" +msgstr "کلاس‌هایی که نوشتن سرورهای شبکه را ساده‌تر می‌کنند." msgid "Module :mod:`ssl`" -msgstr "" +msgstr "ماژول :mod:`ssl`" msgid "A TLS/SSL wrapper for socket objects." -msgstr "" +msgstr "پوششی TLS/SSL برای اشیای سوکت." msgid "Socket families" -msgstr "" +msgstr "خانواده‌های سوکت" -msgid "Depending on the system and the build options, various socket families are supported by this module." +msgid "" +"Depending on the system and the build options, various socket families are " +"supported by this module." msgstr "" +"بسته به سیستم و گزینه‌های ساخت، این ماژول از خانواده‌های مختلف سوکت پشتیبانی" +" می‌کند." -msgid "The address format required by a particular socket object is automatically selected based on the address family specified when the socket object was created. Socket addresses are represented as follows:" +msgid "" +"The address format required by a particular socket object is automatically " +"selected based on the address family specified when the socket object was " +"created. Socket addresses are represented as follows:" msgstr "" +"قالب نشانی مورد نیاز یک شیء سوکت خاص، به‌طور خودکار بر اساس خانواده نشانی " +"مشخص‌شده در زمان ایجاد شیء سوکت انتخاب می‌شود. نشانی‌های سوکت به صورت زیر " +"نمایش داده می‌شوند:" -msgid "The address of an :const:`AF_UNIX` socket bound to a file system node is represented as a string, using the file system encoding and the ``'surrogateescape'`` error handler (see :pep:`383`). An address in Linux's abstract namespace is returned as a :term:`bytes-like object` with an initial null byte; note that sockets in this namespace can communicate with normal file system sockets, so programs intended to run on Linux may need to deal with both types of address. A string or bytes-like object can be used for either type of address when passing it as an argument." -msgstr "" +msgid "" +"The address of an :const:`AF_UNIX` socket bound to a file system node is " +"represented as a string, using the file system encoding and the " +"``'surrogateescape'`` error handler (see :pep:`383`). An address in Linux's" +" abstract namespace is returned as a :term:`bytes-like object` with an " +"initial null byte; note that sockets in this namespace can communicate with " +"normal file system sockets, so programs intended to run on Linux may need to" +" deal with both types of address. A string or bytes-like object can be used" +" for either type of address when passing it as an argument." +msgstr "" +"نشانی یک سوکت :const:`AF_UNIX` که به یک گره فایل‌سیستم مقید شده است، با " +"استفاده از کدگذاری فایل‌سیستم و هندلر خطای ``'surrogateescape'`` " +"به‌صورت یک رشته بازنمایی می‌شود (به :pep:`383` مراجعه کنید). نشانی در " +"فضای نام انتزاعی لینوکس به‌صورت یک :term:`شیء شبیه بایت ` " +"با یک بایت null در ابتدا برگردانده می‌شود؛ توجه داشته باشید که سوکت‌ها در " +"این فضای نام می‌توانند با سوکت‌های معمولی فایل‌سیستم ارتباط برقرار کنند، " +"بنابراین برنامه‌هایی که برای اجرا روی لینوکس در نظر گرفته شده‌اند، ممکن است " +"نیاز داشته باشند با هر دو نوع نشانی سروکار داشته باشند. هنگامی که نشانی را " +"به‌عنوان آرگومان ارسال می‌کنید، می‌توانید برای هر یک از دو نوع نشانی از یک " +"رشته یا شیء شبیه بایت (bytes-like object) استفاده کنید." -msgid "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." +msgid "" +"Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 " +"encoding." msgstr "" +"پیش‌تر، فرض می‌شد که مسیرهای سوکت :const:`AF_UNIX` از کدگذاری UTF-8 استفاده " +"می‌کنند." msgid "Writable :term:`bytes-like object` is now accepted." -msgstr "" +msgstr "اکنون :term:`bytes-like object` قابل نوشتن پذیرفته می‌شود." -msgid "A pair ``(host, port)`` is used for the :const:`AF_INET` address family, where *host* is a string representing either a hostname in internet domain notation like ``'daring.cwi.nl'`` or an IPv4 address like ``'100.50.200.5'``, and *port* is an integer." +msgid "" +"A pair ``(host, port)`` is used for the :const:`AF_INET` address family, " +"where *host* is a string representing either a hostname in internet domain " +"notation like ``'daring.cwi.nl'`` or an IPv4 address like " +"``'100.50.200.5'``, and *port* is an integer." msgstr "" +"از یک جفت ``(host, port)`` برای خانواده‌ی نشانی :const:`AF_INET` استفاده " +"می‌شود، که در آن *host* رشته‌ای است که یا یک نام میزبان با نمادگذاری " +"دامنه‌ی اینترنتی مانند ``'daring.cwi.nl'`` یا یک نشانی IPv4 مانند " +"``'100.50.200.5'`` را نشان می‌دهد، و *port* یک عدد صحیح است." -msgid "For IPv4 addresses, two special forms are accepted instead of a host address: ``''`` represents :const:`INADDR_ANY`, which is used to bind to all interfaces, and the string ``''`` represents :const:`INADDR_BROADCAST`. This behavior is not compatible with IPv6, therefore, you may want to avoid these if you intend to support IPv6 with your Python programs." -msgstr "" +msgid "" +"For IPv4 addresses, two special forms are accepted instead of a host " +"address: ``''`` represents :const:`INADDR_ANY`, which is used to bind to all" +" interfaces, and the string ``''`` represents " +":const:`INADDR_BROADCAST`. This behavior is not compatible with IPv6, " +"therefore, you may want to avoid these if you intend to support IPv6 with " +"your Python programs." +msgstr "" +"برای آدرس‌های IPv4، به جای آدرس میزبان، دو شکل خاص پذیرفته می‌شوند: ``''`` " +"نشان‌دهنده :const:`INADDR_ANY` است که برای اتصال به همه رابط‌ها استفاده " +"می‌شود، و رشته ``''`` نشان‌دهنده :const:`INADDR_BROADCAST` است. " +"این رفتار با IPv6 ناسازگار است، بنابراین، اگر قصد دارید در برنامه‌های پایتون" +" خود از IPv6 پشتیبانی کنید، ممکن است بخواهید از این موارد اجتناب کنید." -msgid "For :const:`AF_INET6` address family, a four-tuple ``(host, port, flowinfo, scope_id)`` is used, where *flowinfo* and *scope_id* represent the ``sin6_flowinfo`` and ``sin6_scope_id`` members in :const:`struct sockaddr_in6` in C. For :mod:`!socket` module methods, *flowinfo* and *scope_id* can be omitted just for backward compatibility. Note, however, omission of *scope_id* can cause problems in manipulating scoped IPv6 addresses." -msgstr "" +msgid "" +"For :const:`AF_INET6` address family, a four-tuple ``(host, port, flowinfo, " +"scope_id)`` is used, where *flowinfo* and *scope_id* represent the " +"``sin6_flowinfo`` and ``sin6_scope_id`` members in :const:`struct " +"sockaddr_in6` in C. For :mod:`!socket` module methods, *flowinfo* and " +"*scope_id* can be omitted just for backward compatibility. Note, however, " +"omission of *scope_id* can cause problems in manipulating scoped IPv6 " +"addresses." +msgstr "" +"برای خانواده‌ی آدرس :const:`AF_INET6`، از یک چهارتایی ``(host, port, " +"flowinfo, scope_id)`` استفاده می‌شود، که در آن *flowinfo* و *scope_id* " +"نشان‌دهنده‌ی اعضای ``sin6_flowinfo`` و ``sin6_scope_id`` در :const:`struct " +"sockaddr_in6` در C هستند. برای متدهای ماژول :mod:`!socket`، می‌توان " +"*flowinfo* و *scope_id* را فقط برای سازگاری با نسخه‌های پیشین حذف کرد. با " +"این حال توجه داشته باشید که حذف *scope_id* می‌تواند در کار با آدرس‌های IPv6 " +"محدوده‌دار مشکل‌ساز شود." -msgid "For multicast addresses (with *scope_id* meaningful) *address* may not contain ``%scope_id`` (or ``zone id``) part. This information is superfluous and may be safely omitted (recommended)." +msgid "" +"For multicast addresses (with *scope_id* meaningful) *address* may not " +"contain ``%scope_id`` (or ``zone id``) part. This information is superfluous" +" and may be safely omitted (recommended)." msgstr "" +"برای آدرس‌های چندپخشی (multicast)، که در آن‌ها *scope_id* معنادار است، لازم " +"نیست *address* شامل بخش ``%scope_id`` (یا ``zone id``) باشد. این اطلاعات " +"اضافی است و می‌توان با اطمینان آن را حذف کرد (توصیه می‌شود)." -msgid ":const:`AF_NETLINK` sockets are represented as pairs ``(pid, groups)``." +msgid "" +":const:`AF_NETLINK` sockets are represented as pairs ``(pid, groups)``." msgstr "" +"سوکت‌های :const:`AF_NETLINK` به‌صورت جفت‌های ``(pid, groups)`` نمایش داده " +"می‌شوند." -msgid "Linux-only support for TIPC is available using the :const:`AF_TIPC` address family. TIPC is an open, non-IP based networked protocol designed for use in clustered computer environments. Addresses are represented by a tuple, and the fields depend on the address type. The general tuple form is ``(addr_type, v1, v2, v3 [, scope])``, where:" -msgstr "" +msgid "" +"Linux-only support for TIPC is available using the :const:`AF_TIPC` address " +"family. TIPC is an open, non-IP based networked protocol designed for use " +"in clustered computer environments. Addresses are represented by a tuple, " +"and the fields depend on the address type. The general tuple form is " +"``(addr_type, v1, v2, v3 [, scope])``, where:" +msgstr "" +"پشتیبانی از TIPC فقط در لینوکس، با استفاده از خانواده‌ی نشانی " +":const:`AF_TIPC` در دسترس است. TIPC یک پروتکل شبکه‌ای باز و غیرمبتنی بر IP " +"است که برای استفاده در محیط‌های رایانه‌ای خوشه‌ای طراحی شده است. نشانی‌ها " +"به‌صورت یک تاپل نمایش داده می‌شوند و فیلدها به نوع نشانی بستگی دارند. قالب " +"کلی تاپل به‌صورت ``(addr_type, v1, v2, v3 [, scope])`` است، که در آن:" -msgid "*addr_type* is one of :const:`TIPC_ADDR_NAMESEQ`, :const:`TIPC_ADDR_NAME`, or :const:`TIPC_ADDR_ID`." +msgid "" +"*addr_type* is one of :const:`TIPC_ADDR_NAMESEQ`, :const:`TIPC_ADDR_NAME`, " +"or :const:`TIPC_ADDR_ID`." msgstr "" +"*addr_type* یکی از :const:`TIPC_ADDR_NAMESEQ`، :const:`TIPC_ADDR_NAME` یا " +":const:`TIPC_ADDR_ID` است." -msgid "*scope* is one of :const:`TIPC_ZONE_SCOPE`, :const:`TIPC_CLUSTER_SCOPE`, and :const:`TIPC_NODE_SCOPE`." +msgid "" +"*scope* is one of :const:`TIPC_ZONE_SCOPE`, :const:`TIPC_CLUSTER_SCOPE`, and" +" :const:`TIPC_NODE_SCOPE`." msgstr "" +"*محدوده* یکی از :const:`TIPC_ZONE_SCOPE`، :const:`TIPC_CLUSTER_SCOPE` و " +":const:`TIPC_NODE_SCOPE` است." -msgid "If *addr_type* is :const:`TIPC_ADDR_NAME`, then *v1* is the server type, *v2* is the port identifier, and *v3* should be 0." +msgid "" +"If *addr_type* is :const:`TIPC_ADDR_NAME`, then *v1* is the server type, " +"*v2* is the port identifier, and *v3* should be 0." msgstr "" +"اگر *addr_type* برابر :const:`TIPC_ADDR_NAME` باشد، آنگاه *v1* نوع سرور است،" +" *v2* شناسه درگاه است و *v3* باید ۰ باشد." -msgid "If *addr_type* is :const:`TIPC_ADDR_NAMESEQ`, then *v1* is the server type, *v2* is the lower port number, and *v3* is the upper port number." +msgid "" +"If *addr_type* is :const:`TIPC_ADDR_NAMESEQ`, then *v1* is the server type, " +"*v2* is the lower port number, and *v3* is the upper port number." msgstr "" +"اگر *addr_type* برابر با :const:`TIPC_ADDR_NAMESEQ` باشد، آنگاه *v1* نوع " +"سرور، *v2* شماره پورت پایینی و *v3* شماره پورت بالایی است." -msgid "If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the reference, and *v3* should be set to 0." +msgid "" +"If *addr_type* is :const:`TIPC_ADDR_ID`, then *v1* is the node, *v2* is the " +"reference, and *v3* should be set to 0." msgstr "" +"اگر *addr_type* برابر :const:`TIPC_ADDR_ID` باشد، آنگاه *v1* گره است، *v2* " +"مرجع است و *v3* باید روی ۰ تنظیم شود." -msgid "A tuple ``(interface, )`` is used for the :const:`AF_CAN` address family, where *interface* is a string representing a network interface name like ``'can0'``. The network interface name ``''`` can be used to receive packets from all network interfaces of this family." +msgid "" +"A tuple ``(interface, )`` is used for the :const:`AF_CAN` address family, " +"where *interface* is a string representing a network interface name like " +"``'can0'``. The network interface name ``''`` can be used to receive packets" +" from all network interfaces of this family." msgstr "" +"از یک تاپل ``(interface, )`` برای خانواده آدرس :const:`AF_CAN` استفاده " +"می‌شود، که در آن *interface* رشته‌ای است که نام یک رابط شبکه مانند " +"``'can0'`` را نشان می‌دهد. می‌توان از نام رابط شبکه ``''`` برای دریافت " +"بسته‌ها از تمام رابط‌های شبکه این خانواده استفاده کرد." -msgid ":const:`CAN_ISOTP` protocol requires a tuple ``(interface, rx_addr, tx_addr)`` where both additional parameters are unsigned long integer that represent a CAN identifier (standard or extended)." +msgid "" +":const:`CAN_ISOTP` protocol requires a tuple ``(interface, rx_addr, " +"tx_addr)`` where both additional parameters are unsigned long integer that " +"represent a CAN identifier (standard or extended)." msgstr "" +"پروتکل :const:`CAN_ISOTP` به یک تاپلبه صورت ``(interface, rx_addr, " +"tx_addr)`` نیاز دارد، که در آن هر دو پارامتر اضافی، عدد صحیح بلند بدون علامت" +" هستند و یک شناسه CAN (استاندارد یا گسترده) را نشان می‌دهند." -msgid ":const:`CAN_J1939` protocol requires a tuple ``(interface, name, pgn, addr)`` where additional parameters are 64-bit unsigned integer representing the ECU name, a 32-bit unsigned integer representing the Parameter Group Number (PGN), and an 8-bit integer representing the address." +msgid "" +":const:`CAN_J1939` protocol requires a tuple ``(interface, name, pgn, " +"addr)`` where additional parameters are 64-bit unsigned integer representing" +" the ECU name, a 32-bit unsigned integer representing the Parameter Group " +"Number (PGN), and an 8-bit integer representing the address." msgstr "" +"پروتکل :const:`CAN_J1939` به یک تاپل ``(interface, name, pgn, addr)`` نیاز " +"دارد، که پارامترهای اضافی آن عبارت‌اند از یک عدد صحیح بدون علامت ۶۴ بیتی " +"نشان‌دهنده‌ی نام ECU، یک عدد صحیح بدون علامت ۳۲ بیتی نشان‌دهنده‌ی شماره گروه " +"پارامتر (PGN)، و یک عدد صحیح ۸ بیتی نشان‌دهنده‌ی آدرس." -msgid "A string or a tuple ``(id, unit)`` is used for the :const:`SYSPROTO_CONTROL` protocol of the :const:`PF_SYSTEM` family. The string is the name of a kernel control using a dynamically assigned ID. The tuple can be used if ID and unit number of the kernel control are known or if a registered ID is used." -msgstr "" +msgid "" +"A string or a tuple ``(id, unit)`` is used for the :const:`SYSPROTO_CONTROL`" +" protocol of the :const:`PF_SYSTEM` family. The string is the name of a " +"kernel control using a dynamically assigned ID. The tuple can be used if ID " +"and unit number of the kernel control are known or if a registered ID is " +"used." +msgstr "" +"برای پروتکل :const:`SYSPROTO_CONTROL` از خانواده‌ی :const:`PF_SYSTEM`، از یک" +" رشته یا تاپل ``(id, unit)`` استفاده می‌شود. رشته نام یک کنترل هسته است که " +"از یک شناسه‌ی اختصاص‌داده‌شده به‌صورت پویا استفاده می‌کند. اگر شناسه و " +"شماره‌ی واحدِ کنترل هسته مشخص باشند یا از یک شناسه‌ی ثبت‌شده استفاده شود، " +"می‌توان از تاپل استفاده کرد." -msgid ":const:`AF_BLUETOOTH` supports the following protocols and address formats:" +msgid "" +":const:`AF_BLUETOOTH` supports the following protocols and address formats:" msgstr "" +":const:`AF_BLUETOOTH` از پروتکل‌ها و قالب‌های نشانی زیر پشتیبانی می‌کند:" -msgid ":const:`BTPROTO_L2CAP` accepts a tuple ``(bdaddr, psm[, cid[, bdaddr_type]])`` where:" +msgid "" +":const:`BTPROTO_L2CAP` accepts a tuple ``(bdaddr, psm[, cid[, " +"bdaddr_type]])`` where:" msgstr "" +":const:`BTPROTO_L2CAP` یک تاپلبا قالب ``(bdaddr, psm[, cid[, " +"bdaddr_type]])`` را می‌پذیرد که در آن:" msgid "``bdaddr`` is a string specifying the Bluetooth address." -msgstr "" +msgstr "``bdaddr`` یک رشته است که نشانی بلوتوث را مشخص می‌کند." msgid "``psm`` is an integer specifying the Protocol/Service Multiplexer." msgstr "" +"``psm`` یک عدد صحیح است که تسهیم‌کننده پروتکل/سرویس (Protocol/Service " +"Multiplexer) را مشخص می‌کند." -msgid "``cid`` is an optional integer specifying the Channel Identifier. If not given, defaults to zero." +msgid "" +"``cid`` is an optional integer specifying the Channel Identifier. If not " +"given, defaults to zero." msgstr "" +"``cid`` یک عدد صحیح اختیاری است که شناسه کانال (Channel Identifier) را مشخص " +"می‌کند. اگر داده نشود، مقدار پیش‌فرض آن صفر است." -msgid "``bdaddr_type`` is an optional integer specifying the address type; one of :const:`BDADDR_BREDR` (default), :const:`BDADDR_LE_PUBLIC`, :const:`BDADDR_LE_RANDOM`." +msgid "" +"``bdaddr_type`` is an optional integer specifying the address type; one of " +":const:`BDADDR_BREDR` (default), :const:`BDADDR_LE_PUBLIC`, " +":const:`BDADDR_LE_RANDOM`." msgstr "" +"``bdaddr_type`` یک عدد صحیح اختیاری است که نوع نشانی را مشخص می‌کند؛ یکی از " +":const:`BDADDR_BREDR` (پیش‌فرض)، :const:`BDADDR_LE_PUBLIC`، " +":const:`BDADDR_LE_RANDOM`." msgid "Added ``cid`` and ``bdaddr_type`` fields." -msgstr "" +msgstr "فیلدهای ``cid`` و ``bdaddr_type`` افزوده شدند." -msgid ":const:`BTPROTO_RFCOMM` accepts ``(bdaddr, channel)`` where ``bdaddr`` is the Bluetooth address as a string and ``channel`` is an integer." +msgid "" +":const:`BTPROTO_RFCOMM` accepts ``(bdaddr, channel)`` where ``bdaddr`` is " +"the Bluetooth address as a string and ``channel`` is an integer." msgstr "" +":const:`BTPROTO_RFCOMM` مقدار ``(bdaddr, channel)`` را می‌پذیرد، که در آن " +"``bdaddr`` نشانی بلوتوث به‌صورت یک رشته و ``channel`` یک عدد صحیح است." msgid ":const:`BTPROTO_HCI` accepts a format that depends on your OS." msgstr "" +":const:`BTPROTO_HCI` قالبی را می‌پذیرد که به سیستم‌عامل شما بستگی دارد." -msgid "On Linux it accepts an integer ``device_id`` or a tuple ``(device_id, [channel])`` where ``device_id`` specifies the number of the Bluetooth device, and ``channel`` is an optional integer specifying the HCI channel (:const:`HCI_CHANNEL_RAW` by default)." +msgid "" +"On Linux it accepts an integer ``device_id`` or a tuple ``(device_id, " +"[channel])`` where ``device_id`` specifies the number of the Bluetooth " +"device, and ``channel`` is an optional integer specifying the HCI channel " +"(:const:`HCI_CHANNEL_RAW` by default)." msgstr "" +"در لینوکس، یک عدد صحیح ``device_id`` یا یک تاپل ``(device_id, [channel])`` " +"پذیرفته می‌شود، که در آن ``device_id`` شماره‌ی دستگاه بلوتوث را مشخص می‌کند " +"و ``channel`` یک عدد صحیح اختیاری است که کانال HCI را مشخص می‌کند " +"(:const:`HCI_CHANNEL_RAW` به‌طور پیش‌فرض)." -msgid "On FreeBSD, NetBSD and DragonFly BSD it accepts ``bdaddr`` where ``bdaddr`` is the Bluetooth address as a string." +msgid "" +"On FreeBSD, NetBSD and DragonFly BSD it accepts ``bdaddr`` where ``bdaddr`` " +"is the Bluetooth address as a string." msgstr "" +"در FreeBSD، NetBSD و DragonFly BSD، ``bdaddr`` را می‌پذیرد، که ``bdaddr`` " +"نشانی بلوتوث به‌صورت یک رشته است." msgid "NetBSD and DragonFlyBSD support added." -msgstr "" +msgstr "پشتیبانی از NetBSD و DragonFlyBSD اضافه شد." msgid "FreeBSD support added." -msgstr "" +msgstr "پشتیبانی از FreeBSD افزوده شد." -msgid "Added ``channel`` field. ``device_id`` not packed in a tuple is now accepted." +msgid "" +"Added ``channel`` field. ``device_id`` not packed in a tuple is now " +"accepted." msgstr "" +"فیلد ``channel`` افزوده شد. ``device_id`` که در یک تاپل قرار نگرفته باشد، " +"اکنون پذیرفته می‌شود." -msgid ":const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is the Bluetooth address as a string or a :class:`bytes` object. (ex. ``'12:23:34:45:56:67'`` or ``b'12:23:34:45:56:67'``)" +msgid "" +":const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is the Bluetooth " +"address as a string or a :class:`bytes` object. (ex. ``'12:23:34:45:56:67'``" +" or ``b'12:23:34:45:56:67'``)" msgstr "" +":const:`BTPROTO_SCO` ``bdaddr`` را می‌پذیرد، که در آن ``bdaddr`` آدرس بلوتوث" +" به‌صورت یک رشته یا یک شیء :class:`bytes` است. (برای مثال " +"``'12:23:34:45:56:67'`` یا ``b'12:23:34:45:56:67'``)" -msgid ":const:`AF_ALG` is a Linux-only socket based interface to Kernel cryptography. An algorithm socket is configured with a tuple of two to four elements ``(type, name [, feat [, mask]])``, where:" +msgid "" +":const:`AF_ALG` is a Linux-only socket based interface to Kernel " +"cryptography. An algorithm socket is configured with a tuple of two to four " +"elements ``(type, name [, feat [, mask]])``, where:" msgstr "" +":const:`AF_ALG` یک رابط مبتنی بر سوکت و فقط مخصوص لینوکس برای رمزنگاری هسته " +"است. یک سوکت الگوریتم با یک چندتاییشامل دو تا چهار المان ``(type, " +"name [, feat [, mask]])`` پیکربندی می‌شود، که در آن:" -msgid "*type* is the algorithm type as string, e.g. ``aead``, ``hash``, ``skcipher`` or ``rng``." +msgid "" +"*type* is the algorithm type as string, e.g. ``aead``, ``hash``, " +"``skcipher`` or ``rng``." msgstr "" +"*type* نوع الگوریتم به‌صورت رشته است، مثلاً ``aead``، ``hash``، ``skcipher``" +" یا ``rng``." -msgid "*name* is the algorithm name and operation mode as string, e.g. ``sha256``, ``hmac(sha256)``, ``cbc(aes)`` or ``drbg_nopr_ctr_aes256``." +msgid "" +"*name* is the algorithm name and operation mode as string, e.g. ``sha256``, " +"``hmac(sha256)``, ``cbc(aes)`` or ``drbg_nopr_ctr_aes256``." msgstr "" +"*name* نام الگوریتم و حالت عملکرد به‌صورت رشته است، برای مثال ``sha256``، " +"``hmac(sha256)``، ``cbc(aes)`` یا ``drbg_nopr_ctr_aes256``." msgid "*feat* and *mask* are unsigned 32bit integers." -msgstr "" +msgstr "*feat* و *mask* اعداد صحیح ۳۲ بیتی بدون علامت هستند." msgid "Some algorithm types require more recent Kernels." -msgstr "" +msgstr "برخی از انواع الگوریتم به هسته‌های جدیدتر نیاز دارند." -msgid ":const:`AF_VSOCK` allows communication between virtual machines and their hosts. The sockets are represented as a ``(CID, port)`` tuple where the context ID or CID and port are integers." +msgid "" +":const:`AF_VSOCK` allows communication between virtual machines and their " +"hosts. The sockets are represented as a ``(CID, port)`` tuple where the " +"context ID or CID and port are integers." msgstr "" +":const:`AF_VSOCK` امکان ارتباط بین ماشین‌های مجازی و میزبان‌هایشان را فراهم " +"می‌کند. سوکت‌ها به‌صورت یک تاپل ``(CID, port)`` نمایش داده می‌شوند که در آن " +"شناسه زمینه یا CID و پورت، اعداد صحیح هستند." msgid "See :manpage:`vsock(7)`" -msgstr "" +msgstr ":manpage:`vsock(7)` را ببینید" -msgid ":const:`AF_PACKET` is a low-level interface directly to network devices. The addresses are represented by the tuple ``(ifname, proto[, pkttype[, hatype[, addr]]])`` where:" +msgid "" +":const:`AF_PACKET` is a low-level interface directly to network devices. The" +" addresses are represented by the tuple ``(ifname, proto[, pkttype[, " +"hatype[, addr]]])`` where:" msgstr "" +":const:`AF_PACKET` یک رابط سطح پایین برای دسترسی مستقیم به دستگاه‌های شبکه " +"است. نشانی‌ها به‌صورت تاپل ``(ifname, proto[, pkttype[, hatype[, addr]]])`` " +"نمایش داده می‌شوند که در آن:" msgid "*ifname* - String specifying the device name." -msgstr "" +msgstr "*ifname* - رشته‌ای که نام دستگاه را مشخص می‌کند." -msgid "*proto* - The Ethernet protocol number. May be :data:`ETH_P_ALL` to capture all protocols, one of the :ref:`ETHERTYPE_* constants ` or any other Ethernet protocol number." +msgid "" +"*proto* - The Ethernet protocol number. May be :data:`ETH_P_ALL` to capture " +"all protocols, one of the :ref:`ETHERTYPE_* constants ` or any other Ethernet protocol number." msgstr "" +"*proto* - شماره‌ی پروتکل اترنت. می‌تواند :data:`ETH_P_ALL` برای ضبط تمام " +"پروتکل‌ها، یکی از :ref:`ثابت‌های ETHERTYPE_* ` یا هر " +"شماره‌ی پروتکل اترنت دیگری باشد." msgid "*pkttype* - Optional integer specifying the packet type:" -msgstr "" +msgstr "*pkttype* - عدد صحیح اختیاری برای مشخص کردن نوع بسته:" msgid "``PACKET_HOST`` (the default) - Packet addressed to the local host." -msgstr "" +msgstr "``PACKET_HOST`` (پیش‌فرض) - بسته‌ای که مقصد آن میزبان محلی است." msgid "``PACKET_BROADCAST`` - Physical-layer broadcast packet." -msgstr "" +msgstr "``PACKET_BROADCAST`` - بسته‌ی پخش در لایه‌ی فیزیکی." -msgid "``PACKET_MULTICAST`` - Packet sent to a physical-layer multicast address." +msgid "" +"``PACKET_MULTICAST`` - Packet sent to a physical-layer multicast address." msgstr "" +"``PACKET_MULTICAST`` - بسته‌ی ارسالی به یک نشانی چندپخشی در لایه‌ی فیزیکی." -msgid "``PACKET_OTHERHOST`` - Packet to some other host that has been caught by a device driver in promiscuous mode." +msgid "" +"``PACKET_OTHERHOST`` - Packet to some other host that has been caught by a " +"device driver in promiscuous mode." msgstr "" +"``PACKET_OTHERHOST`` - بسته‌ای برای میزبان دیگری که توسط یک راه‌انداز دستگاه" +" در حالت promiscuous گرفته شده است." -msgid "``PACKET_OUTGOING`` - Packet originating from the local host that is looped back to a packet socket." +msgid "" +"``PACKET_OUTGOING`` - Packet originating from the local host that is looped " +"back to a packet socket." msgstr "" +"``PACKET_OUTGOING`` - بسته‌ای که از میزبان محلی سرچشمه می‌گیرد و به یک سوکت " +"بسته (packet socket) حلقه می‌شود." msgid "*hatype* - Optional integer specifying the ARP hardware address type." -msgstr "" +msgstr "*hatype* - عدد صحیح اختیاری برای مشخص کردن نوع نشانی سخت‌افزاری ARP." -msgid "*addr* - Optional bytes-like object specifying the hardware physical address, whose interpretation depends on the device." +msgid "" +"*addr* - Optional bytes-like object specifying the hardware physical " +"address, whose interpretation depends on the device." msgstr "" +"*addr* - شیء اختیاری ماننده بایت (bytes-like object) که آدرس فیزیکی " +"سخت‌افزار را مشخص می‌کند و تفسیر آن به دستگاه بستگی دارد." -msgid ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating with services running on co-processors in Qualcomm platforms. The address family is represented as a ``(node, port)`` tuple where the *node* and *port* are non-negative integers." +msgid "" +":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating" +" with services running on co-processors in Qualcomm platforms. The address " +"family is represented as a ``(node, port)`` tuple where the *node* and " +"*port* are non-negative integers." msgstr "" +":const:`AF_QIPCRTR` یک رابط مبتنی بر سوکت، فقط مخصوص لینوکس، برای ارتباط با " +"سرویس‌هایی است که روی پردازنده‌های کمکی در پلتفرم‌های Qualcomm اجرا می‌شوند." +" این خانواده آدرس به‌صورت یک تاپل ``(node, port)`` نمایش داده می‌شود که در " +"آن *node* و *port* اعداد صحیح نامنفی هستند." -msgid ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify what portion of a packet is covered with the checksum. It adds two socket options that you can change. ``self.setsockopt(IPPROTO_UDPLITE, UDPLITE_SEND_CSCOV, length)`` will change what portion of outgoing packets are covered by the checksum and ``self.setsockopt(IPPROTO_UDPLITE, UDPLITE_RECV_CSCOV, length)`` will filter out packets which cover too little of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." -msgstr "" +msgid "" +":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " +"what portion of a packet is covered with the checksum. It adds two socket " +"options that you can change. ``self.setsockopt(IPPROTO_UDPLITE, " +"UDPLITE_SEND_CSCOV, length)`` will change what portion of outgoing packets " +"are covered by the checksum and ``self.setsockopt(IPPROTO_UDPLITE, " +"UDPLITE_RECV_CSCOV, length)`` will filter out packets which cover too little" +" of their data. In both cases ``length`` should be in ``range(8, 2**16, " +"8)``." +msgstr "" +":const:`IPPROTO_UDPLITE` گونه‌ای از UDP است که به شما اجازه می‌دهد مشخص کنید" +" چه بخشی از یک بسته تحت پوشش جمع‌آزما (checksum) قرار می‌گیرد. این پروتکل دو " +"گزینه‌ی سوکت اضافه می‌کند که می‌توانید آن‌ها را تغییر دهید. " +"``self.setsockopt(IPPROTO_UDPLITE, UDPLITE_SEND_CSCOV, length)`` میزان پوشش " +"جمع‌آزما برای بسته‌های خروجی را تغییر می‌دهد و " +"``self.setsockopt(IPPROTO_UDPLITE, UDPLITE_RECV_CSCOV, length)`` بسته‌هایی " +"را که بخش خیلی کمی از داده‌هایشان تحت پوشش جمع‌آزما قرار می‌گیرد فیلتر می‌کند." +" در هر دو حالت ``length`` باید در ``range(8, 2**16, 8)`` باشد." -msgid "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE)`` for IPv6." +msgid "" +"Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " +"IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " +"IPPROTO_UDPLITE)`` for IPv6." msgstr "" +"چنین سوکتی باید برای IPv4 با ``socket(AF_INET, SOCK_DGRAM, " +"IPPROTO_UDPLITE)`` یا برای IPv6 با ``socket(AF_INET6, SOCK_DGRAM, " +"IPPROTO_UDPLITE)`` ایجاد شود." -msgid ":const:`AF_HYPERV` is a Windows-only socket based interface for communicating with Hyper-V hosts and guests. The address family is represented as a ``(vm_id, service_id)`` tuple where the ``vm_id`` and ``service_id`` are UUID strings." +msgid "" +":const:`AF_HYPERV` is a Windows-only socket based interface for " +"communicating with Hyper-V hosts and guests. The address family is " +"represented as a ``(vm_id, service_id)`` tuple where the ``vm_id`` and " +"``service_id`` are UUID strings." msgstr "" +":const:`AF_HYPERV` یک رابط مختص ویندوز و مبتنی بر سوکت برای ارتباط با " +"میزبان‌ها و مهمان‌های Hyper-V است. خانواده آدرس به‌صورت یک چندتایی " +"به شکل ``(vm_id, service_id)`` نمایش داده می‌شود که در آن ``vm_id`` و " +"``service_id`` رشته‌های UUID هستند." -msgid "The ``vm_id`` is the virtual machine identifier or a set of known VMID values if the target is not a specific virtual machine. Known VMID constants defined on ``socket`` are:" +msgid "" +"The ``vm_id`` is the virtual machine identifier or a set of known VMID " +"values if the target is not a specific virtual machine. Known VMID constants" +" defined on ``socket`` are:" msgstr "" +"``vm_id`` شناسه‌ی ماشین مجازی یا، اگر هدف یک ماشین مجازی مشخص نباشد، " +"مجموعه‌ای از مقادیر VMID شناخته‌شده است. ثابت‌های VMID شناخته‌شده که در " +"``socket`` تعریف شده‌اند، عبارتند از:" msgid "``HV_GUID_ZERO``" -msgstr "" +msgstr "``HV_GUID_ZERO``" msgid "``HV_GUID_BROADCAST``" -msgstr "" +msgstr "``HV_GUID_BROADCAST``" -msgid "``HV_GUID_WILDCARD`` - Used to bind on itself and accept connections from all partitions." +msgid "" +"``HV_GUID_WILDCARD`` - Used to bind on itself and accept connections from " +"all partitions." msgstr "" +"``HV_GUID_WILDCARD`` - برای مقید کردن به خودش و پذیرش اتصال‌ها از همه " +"پارتیشن‌ها استفاده می‌شود." -msgid "``HV_GUID_CHILDREN`` - Used to bind on itself and accept connection from child partitions." +msgid "" +"``HV_GUID_CHILDREN`` - Used to bind on itself and accept connection from " +"child partitions." msgstr "" +"``HV_GUID_CHILDREN`` - برای مقیدسازی (bind) روی خودش و پذیرفتن اتصال از " +"پارتیشن‌های فرزند استفاده می‌شود." msgid "``HV_GUID_LOOPBACK`` - Used as a target to itself." -msgstr "" +msgstr "``HV_GUID_LOOPBACK`` - به‌عنوان هدفی برای خودش استفاده می‌شود." -msgid "``HV_GUID_PARENT`` - When used as a bind accepts connection from the parent partition. When used as an address target it will connect to the parent partition." +msgid "" +"``HV_GUID_PARENT`` - When used as a bind accepts connection from the parent " +"partition. When used as an address target it will connect to the parent " +"partition." msgstr "" +"``HV_GUID_PARENT`` - وقتی به‌عنوان مقید کردن استفاده شود، اتصال از " +"پارتیشن والد را می‌پذیرد. وقتی به‌عنوان نشانی هدف استفاده شود، به پارتیشن " +"والد متصل می‌شود." -msgid "The ``service_id`` is the service identifier of the registered service." -msgstr "" +msgid "" +"The ``service_id`` is the service identifier of the registered service." +msgstr "``service_id`` شناسه‌ی سرویس ثبت‌شده است." -msgid "If you use a hostname in the *host* portion of IPv4/v6 socket address, the program may show a nondeterministic behavior, as Python uses the first address returned from the DNS resolution. The socket address will be resolved differently into an actual IPv4/v6 address, depending on the results from DNS resolution and/or the host configuration. For deterministic behavior use a numeric address in *host* portion." -msgstr "" +msgid "" +"If you use a hostname in the *host* portion of IPv4/v6 socket address, the " +"program may show a nondeterministic behavior, as Python uses the first " +"address returned from the DNS resolution. The socket address will be " +"resolved differently into an actual IPv4/v6 address, depending on the " +"results from DNS resolution and/or the host configuration. For " +"deterministic behavior use a numeric address in *host* portion." +msgstr "" +"اگر در بخش *host* نشانی سوکت IPv4/v6 از یک نام میزبان استفاده کنید، ممکن است" +" برنامه رفتاری غیرقطعی نشان دهد، زیرا پایتون از اولین نشانی بازگشتی از وضوح " +"DNS استفاده می‌کند. نشانی سوکت بسته به نتایج وضوح DNS و/یا پیکربندی میزبان، " +"به‌شکل متفاوتی به یک نشانی IPv4/v6 واقعی حل می‌شود. برای رفتار قطعی، از یک " +"نشانی عددی در بخش *host* استفاده کنید." -msgid "All errors raise exceptions. The normal exceptions for invalid argument types and out-of-memory conditions can be raised. Errors related to socket or address semantics raise :exc:`OSError` or one of its subclasses." +msgid "" +"All errors raise exceptions. The normal exceptions for invalid argument " +"types and out-of-memory conditions can be raised. Errors related to socket " +"or address semantics raise :exc:`OSError` or one of its subclasses." msgstr "" +"همه‌ی خطاها استثنا پرتاب می‌کنند. استثناهای معمول برای انواع نامعتبر آرگومان " +"و شرایط کمبود حافظه ممکن است پرتاب شوند. خطاهای مربوط به معنای سوکت یا آدرس،" +" :exc:`OSError` یا یکی از زیرکلاس‌های آن را پرتاب می‌کنند." -msgid "Non-blocking mode is supported through :meth:`~socket.setblocking`. A generalization of this based on timeouts is supported through :meth:`~socket.settimeout`." +msgid "" +"Non-blocking mode is supported through :meth:`~socket.setblocking`. A " +"generalization of this based on timeouts is supported through " +":meth:`~socket.settimeout`." msgstr "" +"حالت غیرمسدود از طریق :meth:`~socket.setblocking` پشتیبانی می‌شود. تعمیمی از" +" این حالت بر اساس مهلت‌های زمانی از طریق :meth:`~socket.settimeout` پشتیبانی " +"می‌شود." msgid "Module contents" -msgstr "" +msgstr "محتویات ماژول" msgid "The module :mod:`!socket` exports the following elements." -msgstr "" +msgstr "ماژول :mod:`!socket` عناصر زیر را صادر می‌کند." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "نام مستعار منسوخی از :exc:`OSError`." msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." -msgstr "" +msgstr "پیرو :pep:`3151`، این کلاس به نام مستعار :exc:`OSError` تبدیل شد." -msgid "A subclass of :exc:`OSError`, this exception is raised for address-related errors, i.e. for functions that use *h_errno* in the POSIX C API, including :func:`gethostbyname_ex` and :func:`gethostbyaddr`. The accompanying value is a pair ``(h_errno, string)`` representing an error returned by a library call. *h_errno* is a numeric value, while *string* represents the description of *h_errno*, as returned by the :c:func:`hstrerror` C function." -msgstr "" +msgid "" +"A subclass of :exc:`OSError`, this exception is raised for address-related " +"errors, i.e. for functions that use *h_errno* in the POSIX C API, including " +":func:`gethostbyname_ex` and :func:`gethostbyaddr`. The accompanying value " +"is a pair ``(h_errno, string)`` representing an error returned by a library " +"call. *h_errno* is a numeric value, while *string* represents the " +"description of *h_errno*, as returned by the :c:func:`hstrerror` C function." +msgstr "" +"این استثنا که زیرکلاسی از :exc:`OSError` است، برای خطاهای مرتبط با نشانی " +"پرتاب می‌شود، یعنی برای توابعی که از *h_errno* در API C POSIX استفاده " +"می‌کنند، از جمله :func:`gethostbyname_ex` و :func:`gethostbyaddr`. مقدار " +"همراه، یک جفت ``(h_errno, string)`` است که نشان‌دهنده‌ی خطایی است که توسط یک " +"فراخوانی کتابخانه برگردانده شده است. *h_errno* یک مقدار عددی است، در حالی که" +" *string* بیانگر توضیح *h_errno* است، همان‌طور که توسط تابع C " +":c:func:`hstrerror` برگردانده می‌شود." msgid "This class was made a subclass of :exc:`OSError`." -msgstr "" +msgstr "این کلاس به زیرکلاسی از :exc:`OSError` تبدیل شد." -msgid "A subclass of :exc:`OSError`, this exception is raised for address-related errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying value is a pair ``(error, string)`` representing an error returned by a library call. *string* represents the description of *error*, as returned by the :c:func:`gai_strerror` C function. The numeric *error* value will match one of the :const:`!EAI_\\*` constants defined in this module." -msgstr "" +msgid "" +"A subclass of :exc:`OSError`, this exception is raised for address-related " +"errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " +"value is a pair ``(error, string)`` representing an error returned by a " +"library call. *string* represents the description of *error*, as returned " +"by the :c:func:`gai_strerror` C function. The numeric *error* value will " +"match one of the :const:`!EAI_\\*` constants defined in this module." +msgstr "" +"این استثنا زیرکلاسی از :exc:`OSError` است و برای خطاهای مرتبط با نشانی توسط " +":func:`getaddrinfo` و :func:`getnameinfo` پرتاب می‌شود. مقدار همراه آن یک " +"جفت ``(error, string)`` است که نشان‌دهنده‌ی خطایی است که از یک فراخوانی " +"کتابخانه برگردانده شده است. *string* شرح *error* را نشان می‌دهد، همان‌طور که" +" توسط تابع C :c:func:`gai_strerror` برگردانده شده است. مقدار عددی *error* با" +" یکی از ثابت‌های :const:`!EAI_\\*` تعریف‌شده در این ماژول مطابقت خواهد داشت." msgid "A deprecated alias of :exc:`TimeoutError`." -msgstr "" +msgstr "یک نام مستعار منسوخ برای :exc:`TimeoutError`." -msgid "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs on a socket which has had timeouts enabled via a prior call to :meth:`~socket.settimeout` (or implicitly through :func:`~socket.setdefaulttimeout`). The accompanying value is a string whose value is currently always \"timed out\"." -msgstr "" +msgid "" +"A subclass of :exc:`OSError`, this exception is raised when a timeout occurs" +" on a socket which has had timeouts enabled via a prior call to " +":meth:`~socket.settimeout` (or implicitly through " +":func:`~socket.setdefaulttimeout`). The accompanying value is a string " +"whose value is currently always \"timed out\"." +msgstr "" +"این استثنا زیرکلاسی از :exc:`OSError` است و زمانی پرتاب می‌شود که یک " +"مهلت زمانی (timeout) در سوکتی رخ دهد که مهلت زمانی برای آن از طریق فراخوانی " +"پیشین :meth:`~socket.settimeout` (یا به‌طور ضمنی از طریق " +":func:`~socket.setdefaulttimeout`) فعال شده است. مقدار همراه، رشته‌ای است که" +" مقدار آن در حال حاضر همیشه \"timed out\" است." msgid "This class was made an alias of :exc:`TimeoutError`." -msgstr "" +msgstr "این کلاس به‌عنوان نام مستعاری از :exc:`TimeoutError` درآمده است." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" -msgid "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:`SocketKind` :class:`.IntEnum` collections." +msgid "" +"The AF_* and SOCK_* constants are now :class:`AddressFamily` and " +":class:`SocketKind` :class:`.IntEnum` collections." msgstr "" +"ثابت‌های AF_* و SOCK_* اکنون مجموعه‌های :class:`AddressFamily` و " +":class:`SocketKind` از نوع :class:`.IntEnum` هستند." -msgid "These constants represent the address (and protocol) families, used for the first argument to :func:`~socket.socket`. If the :const:`AF_UNIX` constant is not defined then this protocol is unsupported. More constants may be available depending on the system." +msgid "" +"These constants represent the address (and protocol) families, used for the " +"first argument to :func:`~socket.socket`. If the :const:`AF_UNIX` constant " +"is not defined then this protocol is unsupported. More constants may be " +"available depending on the system." msgstr "" +"این ثابت‌ها نشان‌دهنده‌ی خانواده‌های آدرس (و پروتکل) هستند و برای اولین " +"آرگومان :func:`~socket.socket` استفاده می‌شوند. اگر ثابت :const:`AF_UNIX` " +"تعریف نشده باشد، این پروتکل پشتیبانی نمی‌شود. بسته به سیستم، ممکن است " +"ثابت‌های بیشتری در دسترس باشند." -msgid ":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket addresses for any address family (either IPv4, IPv6, or any other) that can be used." +msgid "" +":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " +"addresses for any address family (either IPv4, IPv6, or any other) that can " +"be used." msgstr "" +":const:`AF_UNSPEC` به این معنا است که :func:`getaddrinfo` باید آدرس‌های سوکت" +" را برای هر خانواده آدرسی (IPv4، IPv6 یا هر خانواده دیگری) که قابل استفاده " +"باشد، برگرداند." -msgid "These constants represent the socket types, used for the second argument to :func:`~socket.socket`. More constants may be available depending on the system. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be generally useful.)" +msgid "" +"These constants represent the socket types, used for the second argument to " +":func:`~socket.socket`. More constants may be available depending on the " +"system. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be " +"generally useful.)" msgstr "" +"این ثابت‌ها انواع سوکت را نشان می‌دهند و برای آرگومان دوم " +":func:`~socket.socket` استفاده می‌شوند. بسته به سامانه، ممکن است ثابت‌های " +"بیشتری در دسترس باشند. (به نظر می‌رسد تنها :const:`SOCK_STREAM` و " +":const:`SOCK_DGRAM` به‌طور کلی مفید هستند.)" -msgid "These two constants, if defined, can be combined with the socket types and allow you to set some flags atomically (thus avoiding possible race conditions and the need for separate calls)." +msgid "" +"These two constants, if defined, can be combined with the socket types and " +"allow you to set some flags atomically (thus avoiding possible race " +"conditions and the need for separate calls)." msgstr "" +"این دو ثابت، در صورت تعریف‌شدن، می‌توانند با انواع سوکت ترکیب شوند و به شما " +"اجازه می‌دهند برخی پرچم‌ها را به‌صورت اتمی تنظیم کنید (بنابراین از شرایط " +"رقابتی احتمالی و نیاز به فراخوانی‌های جداگانه جلوگیری می‌شود)." -msgid "`Secure File Descriptor Handling `_ for a more thorough explanation." +msgid "" +"`Secure File Descriptor Handling " +"`_ for a more thorough " +"explanation." msgstr "" +"برای توضیح کامل‌تر، `Secure File Descriptor Handling " +"`_." -msgid "Many constants of these forms, documented in the Unix documentation on sockets and/or the IP protocol, are also defined in the socket module. They are generally used in arguments to the :meth:`~socket.setsockopt` and :meth:`~socket.getsockopt` methods of socket objects. In most cases, only those symbols that are defined in the Unix header files are defined; for a few symbols, default values are provided." -msgstr "" +msgid "" +"Many constants of these forms, documented in the Unix documentation on " +"sockets and/or the IP protocol, are also defined in the socket module. They " +"are generally used in arguments to the :meth:`~socket.setsockopt` and " +":meth:`~socket.getsockopt` methods of socket objects. In most cases, only " +"those symbols that are defined in the Unix header files are defined; for a " +"few symbols, default values are provided." +msgstr "" +"بسیاری از ثابت‌های این قالب‌ها، که در مستندات یونیکس در مورد سوکت‌ها و/یا " +"پروتکل IP مستند شده‌اند، در ماژول socket نیز تعریف شده‌اند. آن‌ها عموماً " +"به‌عنوان آرگومان‌هایی برای متدهای :meth:`~socket.setsockopt` و " +":meth:`~socket.getsockopt` اشیای سوکت استفاده می‌شوند. در بیشتر موارد، تنها " +"نمادهایی تعریف شده‌اند که در فایل‌های سرآیند یونیکس تعریف شده باشند؛ برای " +"تعداد کمی از نمادها، مقادیر پیش‌فرض ارائه شده‌اند." -msgid "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, ``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." +msgid "" +"``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " +"``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" +"``SO_DOMAIN``، ``SO_PROTOCOL``، ``SO_PEERSEC``، ``SO_PASSSEC``، " +"``TCP_USER_TIMEOUT`` و ``TCP_CONGESTION`` افزوده شدند." -msgid "Added support for ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` on Windows platforms when available." +msgid "" +"Added support for ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` on Windows platforms " +"when available." msgstr "" +"پشتیبانی از ``TCP_FASTOPEN`` و ``TCP_KEEPCNT`` در پلتفرم‌های ویندوزی در صورت" +" موجود بودن افزوده شد." msgid "``TCP_NOTSENT_LOWAT`` was added." -msgstr "" +msgstr "``TCP_NOTSENT_LOWAT`` اضافه شد." -msgid "Added support for ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` on Windows platforms when available." +msgid "" +"Added support for ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` on Windows platforms " +"when available." msgstr "" +"پشتیبانی از ``TCP_KEEPIDLE`` و ``TCP_KEEPINTVL`` در سکوهای ویندوزی، در صورت " +"در دسترس بودن، افزوده شد." -msgid "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." +msgid "" +"``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " +"can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" +"``IP_RECVTOS`` افزوده شد. ``TCP_KEEPALIVE`` افزوده شد. در MacOS، این ثابت را" +" می‌توان به همان شیوه‌ای که ``TCP_KEEPIDLE`` در لینوکس استفاده می‌شود، به " +"کار برد." -msgid "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the same way that ``TCP_INFO`` is used on Linux and BSD." +msgid "" +"Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " +"same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" +"``TCP_CONNECTION_INFO`` افزوده شد. در MacOS می‌توان از این ثابت به همان " +"شیوه‌ای که از ``TCP_INFO`` در لینوکس و BSD استفاده می‌شود، استفاده کرد." -msgid "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD respectively those constants can be used in the same way that ``SO_MARK`` is used on Linux. Also added missing TCP socket options from Linux: ``TCP_MD5SIG``, ``TCP_THIN_LINEAR_TIMEOUTS``, ``TCP_THIN_DUPACK``, ``TCP_REPAIR``, ``TCP_REPAIR_QUEUE``, ``TCP_QUEUE_SEQ``, ``TCP_REPAIR_OPTIONS``, ``TCP_TIMESTAMP``, ``TCP_CC_INFO``, ``TCP_SAVE_SYN``, ``TCP_SAVED_SYN``, ``TCP_REPAIR_WINDOW``, ``TCP_FASTOPEN_CONNECT``, ``TCP_ULP``, ``TCP_MD5SIG_EXT``, ``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``, ``TCP_ZEROCOPY_RECEIVE``, ``TCP_INQ``, ``TCP_TX_DELAY``. Added ``IP_PKTINFO``, ``IP_UNBLOCK_SOURCE``, ``IP_BLOCK_SOURCE``, ``IP_ADD_SOURCE_MEMBERSHIP``, ``IP_DROP_SOURCE_MEMBERSHIP``." -msgstr "" +msgid "" +"Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " +"respectively those constants can be used in the same way that ``SO_MARK`` is" +" used on Linux. Also added missing TCP socket options from Linux: " +"``TCP_MD5SIG``, ``TCP_THIN_LINEAR_TIMEOUTS``, ``TCP_THIN_DUPACK``, " +"``TCP_REPAIR``, ``TCP_REPAIR_QUEUE``, ``TCP_QUEUE_SEQ``, " +"``TCP_REPAIR_OPTIONS``, ``TCP_TIMESTAMP``, ``TCP_CC_INFO``, " +"``TCP_SAVE_SYN``, ``TCP_SAVED_SYN``, ``TCP_REPAIR_WINDOW``, " +"``TCP_FASTOPEN_CONNECT``, ``TCP_ULP``, ``TCP_MD5SIG_EXT``, " +"``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``, ``TCP_ZEROCOPY_RECEIVE``, " +"``TCP_INQ``, ``TCP_TX_DELAY``. Added ``IP_PKTINFO``, ``IP_UNBLOCK_SOURCE``, " +"``IP_BLOCK_SOURCE``, ``IP_ADD_SOURCE_MEMBERSHIP``, " +"``IP_DROP_SOURCE_MEMBERSHIP``." +msgstr "" +"``SO_RTABLE`` و ``SO_USER_COOKIE`` افزوده شدند. در OpenBSD و FreeBSD " +"به‌ترتیب می‌توان از این ثابت‌ها به همان شیوه‌ای استفاده کرد که ``SO_MARK`` " +"در لینوکس استفاده می‌شود. همچنین گزینه‌های سوکت TCP لینوکس که وجود نداشتند " +"افزوده شدند: ``TCP_MD5SIG``، ``TCP_THIN_LINEAR_TIMEOUTS``، " +"``TCP_THIN_DUPACK``، ``TCP_REPAIR``، ``TCP_REPAIR_QUEUE``، " +"``TCP_QUEUE_SEQ``، ``TCP_REPAIR_OPTIONS``، ``TCP_TIMESTAMP``، " +"``TCP_CC_INFO``، ``TCP_SAVE_SYN``، ``TCP_SAVED_SYN``، ``TCP_REPAIR_WINDOW``،" +" ``TCP_FASTOPEN_CONNECT``، ``TCP_ULP``، ``TCP_MD5SIG_EXT``، " +"``TCP_FASTOPEN_KEY``، ``TCP_FASTOPEN_NO_COOKIE``، ``TCP_ZEROCOPY_RECEIVE``، " +"``TCP_INQ``، ``TCP_TX_DELAY``. ``IP_PKTINFO``، ``IP_UNBLOCK_SOURCE``، " +"``IP_BLOCK_SOURCE``، ``IP_ADD_SOURCE_MEMBERSHIP``، " +"``IP_DROP_SOURCE_MEMBERSHIP`` افزوده شدند." -msgid "Added ``SO_BINDTOIFINDEX``. On Linux this constant can be used in the same way that ``SO_BINDTODEVICE`` is used, but with the index of a network interface instead of its name." +msgid "" +"Added ``SO_BINDTOIFINDEX``. On Linux this constant can be used in the same " +"way that ``SO_BINDTODEVICE`` is used, but with the index of a network " +"interface instead of its name." msgstr "" +"``SO_BINDTOIFINDEX`` افزوده شد. در لینوکس، می‌توان از این ثابت به همان " +"شیوه‌ای که از ``SO_BINDTODEVICE`` استفاده می‌شود، اما با اندیس یک رابط شبکه " +"به جای نام آن استفاده کرد." -msgid "Added missing ``IP_FREEBIND``, ``IP_RECVERR``, ``IPV6_RECVERR``, ``IP_RECVTTL``, and ``IP_RECVORIGDSTADDR`` on Linux." +msgid "" +"Added missing ``IP_FREEBIND``, ``IP_RECVERR``, ``IPV6_RECVERR``, " +"``IP_RECVTTL``, and ``IP_RECVORIGDSTADDR`` on Linux." msgstr "" +"``IP_FREEBIND``، ``IP_RECVERR``، ``IPV6_RECVERR``، ``IP_RECVTTL`` و " +"``IP_RECVORIGDSTADDR`` که در لینوکس وجود نداشتند، اضافه شدند." -msgid "Added support for ``TCP_QUICKACK`` on Windows platforms when available." +msgid "" +"Added support for ``TCP_QUICKACK`` on Windows platforms when available." msgstr "" +"پشتیبانی از ``TCP_QUICKACK`` در سکوهای ویندوزی در صورت در دسترس بودن افزوده" +" شد." -msgid "Many constants of these forms, documented in the Linux documentation, are also defined in the socket module." +msgid "" +"Many constants of these forms, documented in the Linux documentation, are " +"also defined in the socket module." msgstr "" +"بسیاری از ثابت‌های این قالب‌ها، که در مستندات لینوکس مستند شده‌اند، در ماژول" +" socket نیز تعریف شده‌اند." msgid "NetBSD support was added." -msgstr "" +msgstr "پشتیبانی از NetBSD اضافه شد." msgid "Restored missing ``CAN_RAW_ERR_FILTER`` on Linux." -msgstr "" +msgstr "``CAN_RAW_ERR_FILTER`` ازقلم‌افتاده در لینوکس بازگردانده شد." -msgid "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) protocol. Broadcast manager constants, documented in the Linux documentation, are also defined in the socket module." +msgid "" +"CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " +"protocol. Broadcast manager constants, documented in the Linux " +"documentation, are also defined in the socket module." msgstr "" +"CAN_BCM، در خانواده پروتکل CAN، پروتکل مدیر پخش (BCM) است. ثابت‌های مدیر " +"پخش، که در مستندات لینوکس توضیح داده شده‌اند، نیز در ماژول socket تعریف " +"شده‌اند." -msgid "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." +msgid "" +"The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" +"پرچم :data:`CAN_BCM_CAN_FD_FRAME` فقط در لینوکس 4.8 به بالا در دسترس است." -msgid "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. This allows your application to send both CAN and CAN FD frames; however, you must accept both CAN and CAN FD frames when reading from the socket." +msgid "" +"Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " +"This allows your application to send both CAN and CAN FD frames; however, " +"you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" +"پشتیبانی از CAN FD را در یک سوکت CAN_RAW فعال می‌کند. این قابلیت به‌طور " +"پیش‌فرض غیرفعال است. این قابلیت به برنامه شما اجازه می‌دهد هر دو فریم CAN و " +"CAN FD را ارسال کند؛ با این حال، هنگام خواندن از سوکت باید هر دو فریم CAN و " +"CAN FD را بپذیرید." msgid "This constant is documented in the Linux documentation." -msgstr "" +msgstr "این ثابت در مستندات لینوکس مستند شده است." -msgid "Joins the applied CAN filters such that only CAN frames that match all given CAN filters are passed to user space." +msgid "" +"Joins the applied CAN filters such that only CAN frames that match all given" +" CAN filters are passed to user space." msgstr "" +"فیلترهای CAN اعمال‌شده را به‌گونه‌ای ترکیب می‌کند که تنها فریم‌های CAN مطابق" +" با همه فیلترهای CAN داده‌شده، به فضای کاربر (user space) منتقل شوند." -msgid "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. ISO-TP constants, documented in the Linux documentation." +msgid "" +"CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol." +" ISO-TP constants, documented in the Linux documentation." msgstr "" +"CAN_ISOTP، در خانواده‌ی پروتکل CAN، پروتکل ISO-TP (ISO 15765-2) است. ثابت‌های" +" ISO-TP، مستندشده در مستندات لینوکس." -msgid "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 constants, documented in the Linux documentation." +msgid "" +"CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " +"constants, documented in the Linux documentation." msgstr "" +"CAN_J1939، در خانواده‌ی پروتکل CAN، پروتکل SAE J1939 است. ثابت‌های J1939، " +"مستندشده در مستندات لینوکس." -msgid "These two constants, documented in the FreeBSD divert(4) manual page, are also defined in the socket module." +msgid "" +"These two constants, documented in the FreeBSD divert(4) manual page, are " +"also defined in the socket module." msgstr "" +"این دو ثابت، که در صفحه‌ی راهنمای FreeBSD divert(4) مستند شده‌اند، در ماژول " +"socket نیز تعریف شده‌اند." -msgid ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as *proto* for the :const:`AF_PACKET` family in order to capture every packet, regardless of protocol." +msgid "" +":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as" +" *proto* for the :const:`AF_PACKET` family in order to capture every packet," +" regardless of protocol." msgstr "" +"می‌توانید از :data:`!ETH_P_ALL` در سازنده‌ی :class:`~socket.socket` به‌عنوان" +" *proto* برای خانواده‌ی :const:`AF_PACKET` استفاده کنید تا هر بسته را، " +"صرف‌نظر از پروتکل، ضبط کنید." msgid "For more information, see the :manpage:`packet(7)` manpage." -msgstr "" +msgstr "برای اطلاعات بیشتر، صفحه راهنمای :manpage:`packet(7)` را ببینید." -msgid "Constants for Windows' WSAIoctl(). The constants are used as arguments to the :meth:`~socket.socket.ioctl` method of socket objects." +msgid "" +"Constants for Windows' WSAIoctl(). The constants are used as arguments to " +"the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" +"ثابت‌های مربوط به WSAIoctl() ویندوز. این ثابت‌ها به‌عنوان آرگومان‌هایی برای " +"متد :meth:`~socket.socket.ioctl` اشیای سوکت استفاده می‌شوند." msgid "``SIO_LOOPBACK_FAST_PATH`` was added." -msgstr "" +msgstr "``SIO_LOOPBACK_FAST_PATH`` افزوده شد." -msgid "TIPC related constants, matching the ones exported by the C socket API. See the TIPC documentation for more information." +msgid "" +"TIPC related constants, matching the ones exported by the C socket API. See " +"the TIPC documentation for more information." msgstr "" +"ثابت‌های مرتبط با TIPC، مطابق با آن‌هایی که توسط API سوکت C صادر شده‌اند. " +"برای اطلاعات بیشتر، مستندات TIPC را ببینید." msgid "Constants for Linux Kernel cryptography." -msgstr "" +msgstr "ثابت‌های رمزنگاری هسته لینوکس." msgid "Constants for Linux host/guest communication." -msgstr "" +msgstr "ثابت‌های ارتباط میزبان/مهمان در لینوکس." -msgid "This constant contains a boolean value which indicates if IPv6 is supported on this platform." +msgid "" +"This constant contains a boolean value which indicates if IPv6 is supported " +"on this platform." msgstr "" +"این ثابت حاوی یک مقدار بولی است که نشان می‌دهد آیا IPv6 در این پلتفرم " +"پشتیبانی می‌شود." msgid "Integer constants for use with Bluetooth addresses." -msgstr "" +msgstr "ثابت‌های عدد صحیح برای استفاده با آدرس‌های بلوتوث." -msgid "These are string constants containing Bluetooth addresses with special meanings. For example, :const:`BDADDR_ANY` can be used to indicate any address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." +msgid "" +"These are string constants containing Bluetooth addresses with special " +"meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " +"address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" +"این‌ها ثابت‌های رشته‌ای حاوی آدرس‌های بلوتوث با معانی ویژه هستند. برای مثال،" +" می‌توان از :const:`BDADDR_ANY` برای نشان دادن هر آدرسی هنگام مشخص کردن سوکت" +" اتصال با :const:`BTPROTO_RFCOMM` استفاده کرد." -msgid "These constants describe the Bluetooth address type when binding or connecting a :const:`BTPROTO_L2CAP` socket." +msgid "" +"These constants describe the Bluetooth address type when binding or " +"connecting a :const:`BTPROTO_L2CAP` socket." msgstr "" +"این ثابت‌ها نوع نشانی بلوتوث را هنگام پیوند دادن یا اتصال دادن یک سوکت " +":const:`BTPROTO_L2CAP` توصیف می‌کنند." -msgid "Used in the level argument to the :meth:`~socket.setsockopt` and :meth:`~socket.getsockopt` methods of Bluetooth socket objects." +msgid "" +"Used in the level argument to the :meth:`~socket.setsockopt` and " +":meth:`~socket.getsockopt` methods of Bluetooth socket objects." msgstr "" +"در آرگومان level متدهای :meth:`~socket.setsockopt` و " +":meth:`~socket.getsockopt` اشیای سوکت بلوتوث استفاده می‌شود." -msgid ":const:`SOL_BLUETOOTH` is only available on Linux. Other constants are available if the corresponding protocol is supported." +msgid "" +":const:`SOL_BLUETOOTH` is only available on Linux. Other constants are " +"available if the corresponding protocol is supported." msgstr "" +":const:`SOL_BLUETOOTH` تنها در لینوکس در دسترس است. ثابت‌های دیگر در صورتی " +"در دسترس هستند که پروتکل متناظر پشتیبانی شود." -msgid "Used in the option name and value argument to the :meth:`~socket.setsockopt` and :meth:`~socket.getsockopt` methods of Bluetooth socket objects." +msgid "" +"Used in the option name and value argument to the :meth:`~socket.setsockopt`" +" and :meth:`~socket.getsockopt` methods of Bluetooth socket objects." msgstr "" +"در آرگومان‌های نام گزینه و مقدار برای متدهای :meth:`~socket.setsockopt` و " +":meth:`~socket.getsockopt` اشیاء سوکت بلوتوث استفاده می‌شود." -msgid ":const:`!BT_*` and :const:`L2CAP_LM` are only available on Linux. :const:`!SO_BTH_*` are only available on Windows. Other constants may be available on Linux and various BSD platforms." +msgid "" +":const:`!BT_*` and :const:`L2CAP_LM` are only available on Linux. " +":const:`!SO_BTH_*` are only available on Windows. Other constants may be " +"available on Linux and various BSD platforms." msgstr "" +":const:`!BT_*` و :const:`L2CAP_LM` تنها در لینوکس در دسترس هستند. " +":const:`!SO_BTH_*` تنها در ویندوز در دسترس هستند. سایر ثابت‌ها ممکن است در " +"لینوکس و پلتفرم‌های مختلف BSD در دسترس باشند." -msgid "Option names for use with :const:`BTPROTO_HCI`. Availability and format of the option values depend on platform." +msgid "" +"Option names for use with :const:`BTPROTO_HCI`. Availability and format of " +"the option values depend on platform." msgstr "" +"نام گزینه‌ها برای استفاده با :const:`BTPROTO_HCI`. دسترس‌پذیری و قالب " +"مقادیر گزینه‌ها به پلتفرم بستگی دارد." -msgid "Added :const:`!SO_HCI_EVT_FILTER` and :const:`!SO_HCI_PKT_FILTER` on NetBSD and DragonFly BSD. Added :const:`!HCI_DATA_DIR` on FreeBSD, NetBSD and DragonFly BSD." +msgid "" +"Added :const:`!SO_HCI_EVT_FILTER` and :const:`!SO_HCI_PKT_FILTER` on NetBSD " +"and DragonFly BSD. Added :const:`!HCI_DATA_DIR` on FreeBSD, NetBSD and " +"DragonFly BSD." msgstr "" +":const:`!SO_HCI_EVT_FILTER` و :const:`!SO_HCI_PKT_FILTER` در NetBSD و " +"DragonFly BSD افزوده شدند. :const:`!HCI_DATA_DIR` در FreeBSD، NetBSD و " +"DragonFly BSD افزوده شد." -msgid "The ``device_id`` value used to create an HCI socket that isn't specific to a single Bluetooth adapter." +msgid "" +"The ``device_id`` value used to create an HCI socket that isn't specific to " +"a single Bluetooth adapter." msgstr "" +"مقدار ``device_id`` استفاده‌شده برای ایجاد یک سوکت HCI که به یک آداپتور " +"بلوتوث واحد اختصاص ندارد." -msgid "Possible values for ``channel`` field in the :const:`BTPROTO_HCI` address." -msgstr "" +msgid "" +"Possible values for ``channel`` field in the :const:`BTPROTO_HCI` address." +msgstr "مقادیر ممکن برای فیلد ``channel`` در نشانی :const:`BTPROTO_HCI`." -msgid "Constant for Qualcomm's IPC router protocol, used to communicate with service providing remote processors." +msgid "" +"Constant for Qualcomm's IPC router protocol, used to communicate with " +"service providing remote processors." msgstr "" +"ثابت برای پروتکل مسیریاب IPC شرکت Qualcomm، که برای ارتباط با پردازنده‌های " +"راه دور ارائه‌دهنده سرویس استفاده می‌شود." -msgid "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while LOCAL_CREDS sends the credentials at first read, LOCAL_CREDS_PERSISTENT sends for each read, SCM_CREDS2 must be then used for the latter for the message type." -msgstr "" +msgid "" +"LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " +"SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " +"LOCAL_CREDS sends the credentials at first read, LOCAL_CREDS_PERSISTENT " +"sends for each read, SCM_CREDS2 must be then used for the latter for the " +"message type." +msgstr "" +"LOCAL_CREDS و LOCAL_CREDS_PERSISTENT را می‌توان با سوکت‌های SOCK_DGRAM و " +"SOCK_STREAM استفاده کرد؛ این دو معادل SO_PASSCRED در Linux/DragonFlyBSD " +"هستند. در حالی که LOCAL_CREDS مشخصات اعتباری را در نخستین خوانش ارسال " +"می‌کند، LOCAL_CREDS_PERSISTENT مشخصات اعتباری را برای هر خوانش ارسال می‌کند؛" +" بنابراین برای دومی باید از SCM_CREDS2 به‌عنوان نوع پیام استفاده شود." -msgid "Constant to optimize CPU locality, to be used in conjunction with :data:`SO_REUSEPORT`." +msgid "" +"Constant to optimize CPU locality, to be used in conjunction with " +":data:`SO_REUSEPORT`." msgstr "" +"ثابتی برای بهینه‌سازی محلی بودن پردازنده، که باید همراه با " +":data:`SO_REUSEPORT` استفاده شود." -msgid "Constant to enable duplicate address and port bindings with load balancing." -msgstr "" +msgid "" +"Constant to enable duplicate address and port bindings with load balancing." +msgstr "ثابت برای فعال‌سازی اتصال‌های تکراری نشانی و پورت با موازنه بار." msgid "Constants for Windows Hyper-V sockets for host/guest communications." -msgstr "" +msgstr "ثابت‌های سوکت‌های Hyper-V ویندوز برای ارتباطات میزبان/مهمان." -msgid "`IEEE 802.3 protocol number `_. constants." +msgid "" +"`IEEE 802.3 protocol number " +"`_. " +"constants." msgstr "" +"`شماره پروتکل IEEE 802.3 " +"`_. " +"ثابت‌ها." -msgid "These constants are used by the :meth:`~socket.socket.shutdown` method of socket objects." +msgid "" +"These constants are used by the :meth:`~socket.socket.shutdown` method of " +"socket objects." msgstr "" +"این ثابت‌ها توسط متد :meth:`~socket.socket.shutdown` اشیای سوکت استفاده " +"می‌شوند." msgid "Functions" -msgstr "" +msgstr "توابع" msgid "Creating sockets" -msgstr "" +msgstr "ایجاد سوکت‌ها" -msgid "The following functions all create :ref:`socket objects `." -msgstr "" +msgid "" +"The following functions all create :ref:`socket objects `." +msgstr "توابع زیر همگی :ref:`اشیای سوکت ` را ایجاد می‌کنند." -msgid "The :class:`socket ` class constructor creates a new socket directly; see :ref:`socket-objects` for its parameters and full description." +msgid "" +"The :class:`socket ` class constructor creates a new socket " +"directly; see :ref:`socket-objects` for its parameters and full description." msgstr "" +"سازنده‌ی کلاس :class:`socket ` مستقیماً یک سوکت جدید ایجاد " +"می‌کند؛ برای پارامترها و توضیح کامل آن، :ref:`socket-objects` را ببینید." -msgid "Build a pair of connected socket objects using the given address family, socket type, and protocol number. Address family, socket type, and protocol number are as for the :func:`~socket.socket` function. The default family is :const:`AF_UNIX` if defined on the platform; otherwise, the default is :const:`AF_INET`." +msgid "" +"Build a pair of connected socket objects using the given address family, " +"socket type, and protocol number. Address family, socket type, and protocol" +" number are as for the :func:`~socket.socket` function. The default family " +"is :const:`AF_UNIX` if defined on the platform; otherwise, the default is " +":const:`AF_INET`." msgstr "" +"با استفاده از خانواده آدرس، نوع سوکت و شماره پروتکل داده‌شده، یک جفت شیء " +"سوکت متصل به هم بسازید. خانواده آدرس، نوع سوکت و شماره پروتکل همانند تابع " +":func:`~socket.socket` هستند. خانواده پیش‌فرض :const:`AF_UNIX` است، اگر روی " +"سکو تعریف‌شده باشد؛ در غیر این صورت، پیش‌فرض :const:`AF_INET` است." msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" +"سوکت‌های به‌تازگی ایجادشده :ref:`غیرقابل ارث‌بری ` هستند." -msgid "The returned socket objects now support the whole socket API, rather than a subset." +msgid "" +"The returned socket objects now support the whole socket API, rather than a " +"subset." msgstr "" +"اشیای سوکت برگردانده‌شده اکنون به جای یک زیرمجموعه، از کل API سوکت پشتیبانی " +"می‌کنند." msgid "The returned sockets are now non-inheritable." -msgstr "" +msgstr "سوکت‌های برگردانده‌شده اکنون غیرقابل ارث‌بری هستند." msgid "Windows support added." -msgstr "" +msgstr "پشتیبانی از ویندوز اضافه شد." -msgid "Connect to a TCP service listening on the internet *address* (a 2-tuple ``(host, port)``), and return the socket object. This is a higher-level function than :meth:`socket.connect`: if *host* is a non-numeric hostname, it will try to resolve it for both :data:`AF_INET` and :data:`AF_INET6`, and then try to connect to all possible addresses in turn until a connection succeeds. This makes it easy to write clients that are compatible to both IPv4 and IPv6." -msgstr "" +msgid "" +"Connect to a TCP service listening on the internet *address* (a 2-tuple " +"``(host, port)``), and return the socket object. This is a higher-level " +"function than :meth:`socket.connect`: if *host* is a non-numeric hostname, " +"it will try to resolve it for both :data:`AF_INET` and :data:`AF_INET6`, and" +" then try to connect to all possible addresses in turn until a connection " +"succeeds. This makes it easy to write clients that are compatible to both " +"IPv4 and IPv6." +msgstr "" +"به یک سرویس TCP که به *نشانی* اینترنتی (یک دوتایی (2-tuple) به شکل ``(host, " +"port)``) گوش می‌دهد متصل می‌شود و شیء سوکت را برمی‌گرداند. این تابع سطح " +"بالاتری نسبت به :meth:`socket.connect` است: اگر *host* یک نام میزبان غیرعددی" +" باشد، تلاش می‌کند آن را برای هر دو :data:`AF_INET` و :data:`AF_INET6` حل " +"کند و سپس تلاش می‌کند به‌ترتیب به تمام نشانی‌های ممکن متصل شود تا اتصالی با " +"موفقیت برقرار شود. این کار نوشتن کلاینت‌هایی را که با هر دو IPv4 و IPv6 " +"سازگار باشند، آسان می‌کند." -msgid "Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used." +msgid "" +"Passing the optional *timeout* parameter will set the timeout on the socket " +"instance before attempting to connect. If no *timeout* is supplied, the " +"global default timeout setting returned by :func:`getdefaulttimeout` is " +"used." msgstr "" +"با ارسال پارامتر اختیاری *timeout*، مهلت روی نمونه سوکت پیش از تلاش برای " +"اتصال تنظیم می‌شود. اگر *timeout* ارائه نشود، از تنظیم مهلت پیش‌فرض سراسری " +"که توسط :func:`getdefaulttimeout` برگردانده می‌شود، استفاده خواهد شد." -msgid "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the socket to bind to as its source address before connecting. If host or port are '' or 0 respectively the OS default behavior will be used." +msgid "" +"If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " +"socket to bind to as its source address before connecting. If host or port " +"are '' or 0 respectively the OS default behavior will be used." msgstr "" +"اگر ارائه شود، *source_address* باید یک تاپل دوتایی (2-tuple) به‌صورت " +"``(host, port)`` باشد تا سوکت پیش از اتصال، آن را به‌عنوان نشانی مبدأ خود " +"مقید کند (bind). اگر host یا port به‌ترتیب '' یا 0 باشند، رفتار پیش‌فرض " +"سیستم‌عامل استفاده خواهد شد." -msgid "When a connection cannot be created, an exception is raised. By default, it is the exception from the last address in the list. If *all_errors* is ``True``, it is an :exc:`ExceptionGroup` containing the errors of all attempts." +msgid "" +"When a connection cannot be created, an exception is raised. By default, it " +"is the exception from the last address in the list. If *all_errors* is " +"``True``, it is an :exc:`ExceptionGroup` containing the errors of all " +"attempts." msgstr "" +"هنگامی که ایجاد یک اتصال ممکن نباشد، یک استثنا پرتاب می‌شود. به‌طور پیش‌فرض،" +" این استثنا مربوط به آخرین نشانی در فهرست است. اگر *all_errors* برابر " +"``True`` باشد، یک :exc:`ExceptionGroup` حاوی خطاهای تمام تلاش‌ها خواهد بود." msgid "*source_address* was added." -msgstr "" +msgstr "*source_address* اضافه شد." msgid "*all_errors* was added." -msgstr "" +msgstr "*all_errors* افزوده شد." -msgid "Convenience function which creates a TCP socket bound to *address* (a 2-tuple ``(host, port)``) and returns the socket object." +msgid "" +"Convenience function which creates a TCP socket bound to *address* (a " +"2-tuple ``(host, port)``) and returns the socket object." msgstr "" +"تابع سهولت‌بخشی که یک سوکت TCP مقید به *address* (یک ۲-تایی ``(host, " +"port)``) را ایجاد می‌کند و شیء سوکت را برمی‌گرداند." -msgid "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is the queue size passed to :meth:`socket.listen`; if not specified , a default reasonable value is chosen. *reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option." +msgid "" +"*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " +"the queue size passed to :meth:`socket.listen`; if not specified , a default" +" reasonable value is chosen. *reuse_port* dictates whether to set the " +":data:`SO_REUSEPORT` socket option." msgstr "" +"*family* باید یکی از :data:`AF_INET` یا :data:`AF_INET6` باشد. *backlog* " +"اندازه صفی است که به :meth:`socket.listen` داده می‌شود؛ اگر مشخص نشده باشد، " +"یک مقدار پیش‌فرض مناسب انتخاب می‌شود. *reuse_port* تعیین می‌کند که آیا گزینه" +" سوکت :data:`SO_REUSEPORT` تنظیم شود یا خیر." -msgid "If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform supports it the socket will be able to accept both IPv4 and IPv6 connections, else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are supposed to support this functionality. When this functionality is enabled the address returned by :meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6 address represented as an IPv4-mapped IPv6 address. If *dualstack_ipv6* is false it will explicitly disable this functionality on platforms that enable it by default (e.g. Linux). This parameter can be used in conjunction with :func:`has_dualstack_ipv6`:" -msgstr "" +msgid "" +"If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform " +"supports it the socket will be able to accept both IPv4 and IPv6 " +"connections, else it will raise :exc:`ValueError`. Most POSIX platforms and " +"Windows are supposed to support this functionality. When this functionality " +"is enabled the address returned by :meth:`socket.getpeername` when an IPv4 " +"connection occurs will be an IPv6 address represented as an IPv4-mapped IPv6" +" address. If *dualstack_ipv6* is false it will explicitly disable this " +"functionality on platforms that enable it by default (e.g. Linux). This " +"parameter can be used in conjunction with :func:`has_dualstack_ipv6`:" +msgstr "" +"اگر *dualstack_ipv6* درست باشد، *family* برابر با :data:`AF_INET6` باشد و " +"سکو از آن پشتیبانی کند، سوکت می‌تواند هر دو اتصال IPv4 و IPv6 را بپذیرد؛ در " +"غیر این صورت، استثنای :exc:`ValueError` پرتاب می‌شود. انتظار می‌رود بیشتر " +"سکوهای POSIX و ویندوز از این قابلیت پشتیبانی کنند. هنگامی که این قابلیت " +"فعال باشد، آدرس برگردانده‌شده توسط :meth:`socket.getpeername` در صورت وقوع " +"یک اتصال IPv4، یک آدرس IPv6 خواهد بود که به‌صورت آدرس IPv6 نگاشت‌شده به IPv4" +" (IPv4-mapped IPv6 address) نمایش داده می‌شود. اگر *dualstack_ipv6* نادرست " +"باشد، این قابلیت در سکوهای که آن را به‌طور پیش‌فرض فعال می‌کنند (مانند " +"لینوکس) به‌صراحت غیرفعال می‌شود. این پارامتر می‌تواند همراه با " +":func:`has_dualstack_ipv6` استفاده شود:" msgid "" "import socket\n" @@ -526,72 +1215,209 @@ msgid "" "else:\n" " s = socket.create_server(addr)" msgstr "" +"import socket\n" +"\n" +"addr = (\"\", 8080) # all interfaces, port 8080\n" +"if socket.has_dualstack_ipv6():\n" +" s = socket.create_server(addr, family=socket.AF_INET6, dualstack_ipv6=True)\n" +"else:\n" +" s = socket.create_server(addr)" -msgid "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to immediately reuse previous sockets which were bound on the same *address* and remained in TIME_WAIT state." +msgid "" +"On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to" +" immediately reuse previous sockets which were bound on the same *address* " +"and remained in TIME_WAIT state." msgstr "" +"در پلتفرم‌های POSIX، گزینه‌ی سوکت :data:`SO_REUSEADDR` تنظیم می‌شود تا امکان " +"استفاده‌ی فوری از سوکت‌های پیشینی که به همان *آدرس* پیوند داده شده‌اند و در " +"وضعیت TIME_WAIT باقی مانده‌اند، فراهم شود." -msgid "Return ``True`` if the platform supports creating a TCP socket which can handle both IPv4 and IPv6 connections." +msgid "" +"Return ``True`` if the platform supports creating a TCP socket which can " +"handle both IPv4 and IPv6 connections." msgstr "" +"اگر سکو از ایجاد یک سوکت TCP که بتواند هر دو اتصال IPv4 و IPv6 را مدیریت کند" +" پشتیبانی کند، ``True`` را برمی‌گرداند." -msgid "Duplicate the file descriptor *fd* (an integer as returned by a file object's :meth:`~io.IOBase.fileno` method) and build a socket object from the result. Address family, socket type and protocol number are as for the :func:`~socket.socket` function. The file descriptor should refer to a socket, but this is not checked --- subsequent operations on the object may fail if the file descriptor is invalid. This function is rarely needed, but can be used to get or set socket options on a socket passed to a program as standard input or output (such as a server started by the Unix inet daemon). The socket is assumed to be in blocking mode." -msgstr "" +msgid "" +"Duplicate the file descriptor *fd* (an integer as returned by a file " +"object's :meth:`~io.IOBase.fileno` method) and build a socket object from " +"the result. Address family, socket type and protocol number are as for the " +":func:`~socket.socket` function. The file descriptor should refer to a " +"socket, but this is not checked --- subsequent operations on the object may " +"fail if the file descriptor is invalid. This function is rarely needed, but " +"can be used to get or set socket options on a socket passed to a program as " +"standard input or output (such as a server started by the Unix inet daemon)." +" The socket is assumed to be in blocking mode." +msgstr "" +"توصیف‌گر فایل *fd* (یک عدد صحیح که توسط متد :meth:`~io.IOBase.fileno` یک شیء" +" فایل برگردانده می‌شود) تکثیر می‌شود و از نتیجه، یک شیء سوکت ساخته می‌شود. " +"خانواده آدرس، نوع سوکت و شماره پروتکل همانند تابع :func:`~socket.socket` " +"هستند. توصیف‌گر فایل باید به یک سوکت ارجاع دهد، اما این موضوع بررسی نمی‌شود " +"--- عملیات‌های بعدی روی شیء ممکن است در صورت نامعتبر بودن توصیف‌گر فایل با " +"شکست مواجه شوند. این تابع به‌ندرت مورد نیاز است، اما می‌توان از آن برای " +"دریافت یا تنظیم گزینه‌های سوکت روی سوکتی که به‌عنوان ورودی یا خروجی " +"استاندارد به برنامه داده شده است استفاده کرد (مانند سروری که توسط دیمن inet " +"در یونیکس راه‌اندازی شده است). فرض می‌شود سوکت در حالت مسدودکننده قرار " +"دارد." msgid "The newly created socket is :ref:`non-inheritable `." -msgstr "" +msgstr "سوکت تازه‌ایجادشده :ref:`غیرقابل ارث‌بری ` است." msgid "The returned socket is now non-inheritable." -msgstr "" +msgstr "سوکت برگردانده‌شده اکنون غیرقابل ارث‌بردن است." -msgid "Instantiate a socket from data obtained from the :meth:`socket.share` method. The socket is assumed to be in blocking mode." +msgid "" +"Instantiate a socket from data obtained from the :meth:`socket.share` " +"method. The socket is assumed to be in blocking mode." msgstr "" +"نمونه‌سازی یک سوکت از داده‌های به‌دست‌آمده از متد :meth:`socket.share`. فرض " +"می‌شود که سوکت در حالت مسدودکننده (blocking) باشد." msgid "Other functions" -msgstr "" +msgstr "توابع دیگر" -msgid "The :mod:`!socket` module also offers various network-related services:" +msgid "" +"The :mod:`!socket` module also offers various network-related services:" msgstr "" +"ماژول :mod:`!socket` همچنین خدمات مختلف مرتبط با شبکه را ارائه می‌دهد:" -msgid "Close a socket file descriptor. This is like :func:`os.close`, but for sockets. On some platforms (most notably Windows) :func:`os.close` does not work for socket file descriptors." +msgid "" +"Close a socket file descriptor. This is like :func:`os.close`, but for " +"sockets. On some platforms (most notably Windows) :func:`os.close` does not " +"work for socket file descriptors." msgstr "" +"بستن توصیف‌گر فایل سوکت. این مانند :func:`os.close` است، اما برای سوکت‌ها. " +"در برخی سکوها (به‌ویژه ویندوز) :func:`os.close` برای توصیف‌گرهای فایل سوکت " +"کار نمی‌کند." -msgid "This function wraps the C function ``getaddrinfo`` of the underlying system." -msgstr "" +msgid "" +"This function wraps the C function ``getaddrinfo`` of the underlying system." +msgstr "این تابع، پوششی برای تابع ``getaddrinfo`` زبان C در سیستم زیرین است." -msgid "Translate the *host*/*port* argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. *host* is a domain name, a string representation of an IPv4/v6 address or ``None``. *port* is a string service name such as ``'http'``, a numeric port number or ``None``. By passing ``None`` as the value of *host* and *port*, you can pass ``NULL`` to the underlying C API." -msgstr "" +msgid "" +"Translate the *host*/*port* argument into a sequence of 5-tuples that " +"contain all the necessary arguments for creating a socket connected to that " +"service. *host* is a domain name, a string representation of an IPv4/v6 " +"address or ``None``. *port* is a string service name such as ``'http'``, a " +"numeric port number or ``None``. By passing ``None`` as the value of *host*" +" and *port*, you can pass ``NULL`` to the underlying C API." +msgstr "" +"آرگومان *host*/*port* را به دنباله‌ای از تاپل‌های ۵تایی تبدیل می‌کند که شامل" +" همه آرگومان‌های لازم برای ایجاد سوکتی متصل به آن سرویس است. *host* یک نام " +"دامنه، نمایش رشته‌ای از یک آدرس IPv4/v6 یا ``None`` است. *port* یک نام سرویس" +" رشته‌ای مانند ``'http'``، یک شماره پورت عددی یا ``None`` است. با ارسال " +"``None`` به‌عنوان مقدار *host* و *port*، می‌توانید ``NULL`` را به API " +"زیربنایی C ارسال کنید." -msgid "The *family*, *type* and *proto* arguments can be optionally specified in order to provide options and limit the list of addresses returned. Pass their default values (:data:`AF_UNSPEC`, 0, and 0, respectively) to not limit the results. See the note below for details." +msgid "" +"The *family*, *type* and *proto* arguments can be optionally specified in " +"order to provide options and limit the list of addresses returned. Pass " +"their default values (:data:`AF_UNSPEC`, 0, and 0, respectively) to not " +"limit the results. See the note below for details." msgstr "" +"آرگومان‌های *family*، *type* و *proto* را می‌توان به‌صورت اختیاری مشخص کرد " +"تا گزینه‌ها فراهم شوند و فهرست نشانی‌های بازگردانده‌شده محدود شود. برای " +"اینکه نتایج محدود نشوند، مقادیر پیش‌فرض آن‌ها (به‌ترتیب :data:`AF_UNSPEC`، 0" +" و 0) را ارسال کنید. برای جزئیات، یادداشت زیر را ببینید." -msgid "The *flags* argument can be one or several of the ``AI_*`` constants, and will influence how results are computed and returned. For example, :const:`AI_NUMERICHOST` will disable domain name resolution and will raise an error if *host* is a domain name." +msgid "" +"The *flags* argument can be one or several of the ``AI_*`` constants, and " +"will influence how results are computed and returned. For example, " +":const:`AI_NUMERICHOST` will disable domain name resolution and will raise " +"an error if *host* is a domain name." msgstr "" +"آرگومان *flags* می‌تواند یک یا چند مورد از ثابت‌های ``AI_*`` باشد و بر " +"چگونگی محاسبه و برگرداندن نتایج تأثیر می‌گذارد. برای مثال، " +":const:`AI_NUMERICHOST` وضوح نام دامنه را غیرفعال می‌کند و اگر *host* یک نام" +" دامنه باشد، خطایی پرتاب می‌کند." msgid "The function returns a list of 5-tuples with the following structure:" -msgstr "" +msgstr "این تابع فهرستی از ۵-تاپل‌ها با ساختار زیر برمی‌گرداند:" msgid "``(family, type, proto, canonname, sockaddr)``" -msgstr "" +msgstr "``(family, type, proto, canonname, sockaddr)``" -msgid "In these tuples, *family*, *type*, *proto* are all integers and are meant to be passed to the :func:`~socket.socket` function. *canonname* will be a string representing the canonical name of the *host* if :const:`AI_CANONNAME` is part of the *flags* argument; else *canonname* will be empty. *sockaddr* is a tuple describing a socket address, whose format depends on the returned *family* (a ``(address, port)`` 2-tuple for :const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." -msgstr "" +msgid "" +"In these tuples, *family*, *type*, *proto* are all integers and are meant to" +" be passed to the :func:`~socket.socket` function. *canonname* will be a " +"string representing the canonical name of the *host* if " +":const:`AI_CANONNAME` is part of the *flags* argument; else *canonname* will" +" be empty. *sockaddr* is a tuple describing a socket address, whose format " +"depends on the returned *family* (a ``(address, port)`` 2-tuple for " +":const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for " +":const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` " +"method." +msgstr "" +"در این تاپل‌ها، *family*، *type* و *proto* همگی اعداد صحیح هستند و باید به " +"تابع :func:`~socket.socket` فرستاده شوند. اگر :const:`AI_CANONNAME` بخشی از" +" آرگومان *flags* باشد، *canonname* رشته‌ای خواهد بود که نام متعارف *host* را" +" نشان می‌دهد؛ در غیر این صورت *canonname* خالی خواهد بود. *sockaddr* تاپلی " +"است که نشانی سوکت را توصیف می‌کند و قالب آن به *family* برگردانده‌شده بستگی " +"دارد (یک تاپل ۲تایی ``(address, port)`` برای :const:`AF_INET`، یک تاپل ۴تایی" +" ``(address, port, flowinfo, scope_id)`` برای :const:`AF_INET6`) و باید به " +"متد :meth:`socket.connect` فرستاده شود." -msgid "If you intend to use results from :func:`!getaddrinfo` to create a socket (rather than, for example, retrieve *canonname*), consider limiting the results by *type* (e.g. :data:`SOCK_STREAM` or :data:`SOCK_DGRAM`) and/or *proto* (e.g. :data:`IPPROTO_TCP` or :data:`IPPROTO_UDP`) that your application can handle." -msgstr "" +msgid "" +"If you intend to use results from :func:`!getaddrinfo` to create a socket " +"(rather than, for example, retrieve *canonname*), consider limiting the " +"results by *type* (e.g. :data:`SOCK_STREAM` or :data:`SOCK_DGRAM`) and/or " +"*proto* (e.g. :data:`IPPROTO_TCP` or :data:`IPPROTO_UDP`) that your " +"application can handle." +msgstr "" +"اگر قصد دارید از نتایج :func:`!getaddrinfo` برای ایجاد یک سوکت استفاده کنید " +"(نه مثلاً برای بازیابی *canonname*)، در نظر بگیرید که نتایج را بر اساس " +"*type* (مثلاً :data:`SOCK_STREAM` یا :data:`SOCK_DGRAM`) و/یا *proto* (مثلاً" +" :data:`IPPROTO_TCP` یا :data:`IPPROTO_UDP`) که برنامه شما می‌تواند از آن‌ها" +" پشتیبانی کند، محدود کنید." -msgid "The behavior with default values of *family*, *type*, *proto* and *flags* is system-specific." +msgid "" +"The behavior with default values of *family*, *type*, *proto* and *flags* is" +" system-specific." msgstr "" +"رفتار با مقادیر پیش‌فرض *family*، *type*، *proto* و *flags* وابسته به سیستم " +"است." -msgid "Many systems (for example, most Linux configurations) will return a sorted list of all matching addresses. These addresses should generally be tried in order until a connection succeeds (possibly tried in parallel, for example, using a `Happy Eyeballs`_ algorithm). In these cases, limiting the *type* and/or *proto* can help eliminate unsuccessful or unusable connection attempts." -msgstr "" +msgid "" +"Many systems (for example, most Linux configurations) will return a sorted " +"list of all matching addresses. These addresses should generally be tried in" +" order until a connection succeeds (possibly tried in parallel, for example," +" using a `Happy Eyeballs`_ algorithm). In these cases, limiting the *type* " +"and/or *proto* can help eliminate unsuccessful or unusable connection " +"attempts." +msgstr "" +"بسیاری از سیستم‌ها (برای مثال، بیشتر پیکربندی‌های لینوکس) فهرست مرتب‌شده‌ای " +"از همه‌ی نشانی‌های منطبق برمی‌گردانند. این نشانی‌ها معمولاً باید به‌ترتیب " +"امتحان شوند تا اتصال با موفقیت برقرار شود (ممکن است به‌صورت موازی نیز امتحان" +" شوند، برای مثال با استفاده از یک الگوریتم `Happy Eyeballs`_). در این موارد،" +" محدود کردن *type* و/یا *proto* می‌تواند به حذف تلاش‌های اتصال بی‌نتیجه یا " +"غیرقابل‌استفاده کمک کند." -msgid "Some systems will, however, only return a single address. (For example, this was reported on Solaris and AIX configurations.) On these systems, limiting the *type* and/or *proto* helps ensure that this address is usable." +msgid "" +"Some systems will, however, only return a single address. (For example, this" +" was reported on Solaris and AIX configurations.) On these systems, limiting" +" the *type* and/or *proto* helps ensure that this address is usable." msgstr "" +"با این حال، برخی سیستم‌ها تنها یک نشانی را برمی‌گردانند. (برای مثال، این " +"مورد در پیکربندی‌های Solaris و AIX گزارش شده است.) در این سیستم‌ها، محدود " +"کردن *type* و/یا *proto* کمک می‌کند اطمینان حاصل شود که این نشانی قابل " +"استفاده باشد." -msgid "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " +"arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.getaddrinfo`` را با آرگومان‌های" +" ``host``، ``port``، ``family``، ``type`` و ``protocol`` پرتاب می‌کند." -msgid "The following example fetches address information for a hypothetical TCP connection to ``example.org`` on port 80 (results may differ on your system if IPv6 isn't enabled)::" +msgid "" +"The following example fetches address information for a hypothetical TCP " +"connection to ``example.org`` on port 80 (results may differ on your system " +"if IPv6 isn't enabled)::" msgstr "" +"مثال زیر اطلاعات نشانی را برای یک اتصال TCP فرضی به ``example.org`` در پورت " +"۸۰ واکشی می‌کند (اگر IPv6 فعال نباشد، ممکن است نتایج در سیستم شما متفاوت " +"باشند)::" msgid "" ">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" @@ -600,360 +1426,1080 @@ msgid "" " (socket.AF_INET, socket.SOCK_STREAM,\n" " 6, '', ('93.184.216.34', 80))]" msgstr "" +">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" +"[(socket.AF_INET6, socket.SOCK_STREAM,\n" +" 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)),\n" +" (socket.AF_INET, socket.SOCK_STREAM,\n" +" 6, '', ('93.184.216.34', 80))]" msgid "parameters can now be passed using keyword arguments." msgstr "" +"اکنون می‌توان پارامترها را با استفاده از آرگومان‌های کلیدواژه‌ای ارسال کرد." -msgid "for IPv6 multicast addresses, string representing an address will not contain ``%scope_id`` part." +msgid "" +"for IPv6 multicast addresses, string representing an address will not " +"contain ``%scope_id`` part." msgstr "" +"برای نشانی‌های چندپخشی (multicast) در IPv6، رشته‌ی نشان‌دهنده‌ی یک نشانی " +"حاوی بخش ``%scope_id`` نخواهد بود." -msgid "Return a fully qualified domain name for *name*. If *name* is omitted or empty, it is interpreted as the local host. To find the fully qualified name, the hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the host, if available. The first name which includes a period is selected. In case no fully qualified domain name is available and *name* was provided, it is returned unchanged. If *name* was empty or equal to ``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." -msgstr "" +msgid "" +"Return a fully qualified domain name for *name*. If *name* is omitted or " +"empty, it is interpreted as the local host. To find the fully qualified " +"name, the hostname returned by :func:`gethostbyaddr` is checked, followed by" +" aliases for the host, if available. The first name which includes a period" +" is selected. In case no fully qualified domain name is available and " +"*name* was provided, it is returned unchanged. If *name* was empty or equal" +" to ``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." +msgstr "" +"یک نام دامنه کامل (fully qualified domain name) برای *name* " +"برمی‌گرداند. اگر *name* حذف‌شده یا خالی باشد، به‌عنوان میزبان محلی در نظر " +"گرفته می‌شود. برای یافتن نام کامل، نام میزبان برگردانده‌شده " +"توسط :func:`gethostbyaddr` بررسی می‌شود و سپس نام‌های مستعار میزبان، در صورت" +" موجود بودن، بررسی می‌شوند. اولین نامی که شامل یک نقطه باشد انتخاب می‌شود. " +"در صورتی که هیچ نام دامنه کاملی در دسترس نباشد و *name* ارائه " +"شده باشد، بدون تغییر برگردانده می‌شود. اگر *name* خالی یا برابر با " +"``'0.0.0.0'`` باشد، نام میزبان حاصل از :func:`gethostname` برگردانده می‌شود." -msgid "Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 address itself it is returned unchanged. See :func:`gethostbyname_ex` for a more complete interface. :func:`gethostbyname` does not support IPv6 name resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual stack support." -msgstr "" +msgid "" +"Translate a host name to IPv4 address format. The IPv4 address is returned " +"as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " +"address itself it is returned unchanged. See :func:`gethostbyname_ex` for a" +" more complete interface. :func:`gethostbyname` does not support IPv6 name " +"resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual " +"stack support." +msgstr "" +"نام میزبان را به قالب نشانی IPv4 ترجمه می‌کند. نشانی IPv4 به‌صورت یک رشته " +"برگردانده می‌شود، مانند ``'100.50.200.5'``. اگر نام میزبان خودش یک نشانی " +"IPv4 باشد، بدون تغییر برگردانده می‌شود. برای یک رابط کامل‌تر " +":func:`gethostbyname_ex` را ببینید. :func:`gethostbyname` از حل نام IPv6 " +"پشتیبانی نمی‌کند، و برای پشتیبانی از پشته دوگانه IPv4/v6 باید به‌جای آن از " +":func:`getaddrinfo` استفاده شود." -msgid "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with argument ``hostname``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " +"argument ``hostname``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.gethostbyname`` را با آرگومان " +"``hostname`` پرتاب می‌کند." -msgid "Translate a host name to IPv4 address format, extended interface. Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's primary host name, *aliaslist* is a (possibly empty) list of alternative host names for the same address, and *ipaddrlist* is a list of IPv4 addresses for the same interface on the same host (often but not always a single address). :func:`gethostbyname_ex` does not support IPv6 name resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual stack support." -msgstr "" +msgid "" +"Translate a host name to IPv4 address format, extended interface. Return a " +"3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's" +" primary host name, *aliaslist* is a (possibly empty) list of alternative " +"host names for the same address, and *ipaddrlist* is a list of IPv4 " +"addresses for the same interface on the same host (often but not always a " +"single address). :func:`gethostbyname_ex` does not support IPv6 name " +"resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual " +"stack support." +msgstr "" +"یک نام میزبان را به قالب نشانی IPv4 ترجمه می‌کند؛ رابط گسترش‌یافته. یک " +"۳‌تایی ``(hostname, aliaslist, ipaddrlist)`` برمی‌گرداند که در آن *hostname*" +" نام میزبان اصلی آن میزبان است، *aliaslist* فهرستی (احتمالاً خالی) از " +"نام‌های میزبان جایگزین برای همان نشانی است، و *ipaddrlist* فهرستی از " +"نشانی‌های IPv4 برای همان رابط در همان میزبان است (اغلب، اما نه همیشه، یک " +"نشانی واحد). :func:`gethostbyname_ex` از حل نام IPv6 پشتیبانی نمی‌کند، و " +"برای پشتیبانی از پشته دوگانه‌ی IPv4/v6 باید به‌جای آن از :func:`getaddrinfo`" +" استفاده شود." -msgid "Return a string containing the hostname of the machine where the Python interpreter is currently executing." +msgid "" +"Return a string containing the hostname of the machine where the Python " +"interpreter is currently executing." msgstr "" +"رشته‌ای را برمی‌گرداند که حاوی نام میزبان ماشینی است که مفسر پایتون در حال " +"حاضر روی آن اجرا می‌شود." -msgid "Raises an :ref:`auditing event ` ``socket.gethostname`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``socket.gethostname`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.gethostname`` را بدون هیچ " +"آرگومانی پرتاب می‌کند." -msgid "Note: :func:`gethostname` doesn't always return the fully qualified domain name; use :func:`getfqdn` for that." +msgid "" +"Note: :func:`gethostname` doesn't always return the fully qualified domain " +"name; use :func:`getfqdn` for that." msgstr "" +"توجه: :func:`gethostname` همیشه نام دامنه‌ی کاملاً مشخص (fully qualified " +"domain name) را برنمی‌گرداند؛ برای این کار از :func:`getfqdn` استفاده کنید." -msgid "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the primary host name responding to the given *ip_address*, *aliaslist* is a (possibly empty) list of alternative host names for the same address, and *ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the same host (most likely containing only a single address). To find the fully qualified domain name, use the function :func:`getfqdn`. :func:`gethostbyaddr` supports both IPv4 and IPv6." -msgstr "" +msgid "" +"Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " +"the primary host name responding to the given *ip_address*, *aliaslist* is a" +" (possibly empty) list of alternative host names for the same address, and " +"*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " +"same host (most likely containing only a single address). To find the fully " +"qualified domain name, use the function :func:`getfqdn`. " +":func:`gethostbyaddr` supports both IPv4 and IPv6." +msgstr "" +"یک تاپل ۳-تایی ``(hostname, aliaslist, ipaddrlist)`` برمی‌گرداند که در آن " +"*hostname* نام میزبان اصلی پاسخ‌دهنده به *ip_address* داده‌شده است، " +"*aliaslist* فهرستی (احتمالاً خالی) از نام‌های میزبان جایگزین برای همان نشانی" +" است، و *ipaddrlist* فهرستی از نشانی‌های IPv4/v6 برای همان رابط در همان " +"میزبان است (که به احتمال زیاد فقط شامل یک نشانی می‌شود). برای یافتن نام " +"دامنه‌ی کامل، از تابع :func:`getfqdn` استفاده کنید. " +":func:`gethostbyaddr` از هر دو IPv4 و IPv6 پشتیبانی می‌کند." -msgid "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with argument ``ip_address``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " +"argument ``ip_address``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.gethostbyaddr`` را با آرگومان " +"``ip_address`` پرتاب می‌کند." -msgid "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. Depending on the settings of *flags*, the result can contain a fully qualified domain name or numeric address representation in *host*. Similarly, *port* can contain a string port name or a numeric port number." +msgid "" +"Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " +"Depending on the settings of *flags*, the result can contain a fully " +"qualified domain name or numeric address representation in *host*. " +"Similarly, *port* can contain a string port name or a numeric port number." msgstr "" +"نشانی سوکت *sockaddr* را به یک تاپل دوتایی ``(host, port)`` تبدیل می‌کند. " +"بسته به تنظیمات *flags*، نتیجه می‌تواند شامل یک نام دامنه‌ی کامل" +" یا نمایش عددی نشانی در *host* باشد. به‌طور مشابه، *port* می‌تواند شامل یک " +"نام پورت به‌صورت رشته یا یک شماره پورت عددی باشد." -msgid "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* contains meaningful *scope_id*. Usually this happens for multicast addresses." +msgid "" +"For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr*" +" contains meaningful *scope_id*. Usually this happens for multicast " +"addresses." msgstr "" +"برای آدرس‌های IPv6، اگر *sockaddr* شامل *scope_id* معناداری باشد، " +"``%scope_id`` به بخش میزبان افزوده می‌شود. معمولاً این حالت برای آدرس‌های " +"چندپخشی (multicast) رخ می‌دهد." -msgid "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." +msgid "" +"For more information about *flags* you can consult " +":manpage:`getnameinfo(3)`." msgstr "" +"برای اطلاعات بیشتر درباره‌ی *پرچم‌ها* می‌توانید به :manpage:`getnameinfo(3)` " +"مراجعه کنید." -msgid "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with argument ``sockaddr``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " +"argument ``sockaddr``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.getnameinfo`` را با آرگومان " +"``sockaddr`` پرتاب می‌کند." -msgid "Translate an internet protocol name (for example, ``'icmp'``) to a constant suitable for passing as the (optional) third argument to the :func:`~socket.socket` function. This is usually only needed for sockets opened in \"raw\" mode (:const:`SOCK_RAW`); for the normal socket modes, the correct protocol is chosen automatically if the protocol is omitted or zero." -msgstr "" +msgid "" +"Translate an internet protocol name (for example, ``'icmp'``) to a constant " +"suitable for passing as the (optional) third argument to the " +":func:`~socket.socket` function. This is usually only needed for sockets " +"opened in \"raw\" mode (:const:`SOCK_RAW`); for the normal socket modes, the" +" correct protocol is chosen automatically if the protocol is omitted or " +"zero." +msgstr "" +"نام پروتکل اینترنتی (برای مثال، ``'icmp'``) را به ثابتی تبدیل می‌کند که برای" +" ارسال به‌عنوان آرگومان سوم (اختیاری) به تابع :func:`~socket.socket` مناسب " +"است. این معمولاً فقط برای سوکت‌هایی که در حالت خام (raw) باز شده‌اند " +"(:const:`SOCK_RAW`) لازم است؛ برای حالت‌های عادی سوکت، اگر پروتکل ذکر نشود " +"یا صفر باشد، پروتکل صحیح به‌طور خودکار انتخاب می‌شود." -msgid "Translate an internet service name and protocol name to a port number for that service. The optional protocol name, if given, should be ``'tcp'`` or ``'udp'``, otherwise any protocol will match." +msgid "" +"Translate an internet service name and protocol name to a port number for " +"that service. The optional protocol name, if given, should be ``'tcp'`` or " +"``'udp'``, otherwise any protocol will match." msgstr "" +"نام یک سرویس اینترنتی و نام پروتکل را به شماره پورت آن سرویس ترجمه می‌کند. " +"نام پروتکل اختیاری، در صورت ارائه، باید ``'tcp'`` یا ``'udp'`` باشد، در غیر " +"این صورت هر پروتکلی مطابقت خواهد داشت." -msgid "Raises an :ref:`auditing event ` ``socket.getservbyname`` with arguments ``servicename``, ``protocolname``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.getservbyname`` with " +"arguments ``servicename``, ``protocolname``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.getservbyname`` را با " +"آرگومان‌های ``servicename`` و ``protocolname`` پرتاب می‌کند." -msgid "Translate an internet port number and protocol name to a service name for that service. The optional protocol name, if given, should be ``'tcp'`` or ``'udp'``, otherwise any protocol will match." +msgid "" +"Translate an internet port number and protocol name to a service name for " +"that service. The optional protocol name, if given, should be ``'tcp'`` or " +"``'udp'``, otherwise any protocol will match." msgstr "" +"شماره پورت اینترنتی و نام پروتکل را به نام سرویس برای آن سرویس ترجمه می‌کند." +" نام پروتکل اختیاری، در صورت ارائه، باید ``'tcp'`` یا ``'udp'`` باشد، در غیر" +" این صورت هر پروتکلی مطابقت خواهد داشت." -msgid "Raises an :ref:`auditing event ` ``socket.getservbyport`` with arguments ``port``, ``protocolname``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.getservbyport`` with " +"arguments ``port``, ``protocolname``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.getservbyport`` را با " +"آرگومان‌های ``port`` و ``protocolname`` پرتاب می‌کند." -msgid "Convert 32-bit positive integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation." +msgid "" +"Convert 32-bit positive integers from network to host byte order. On " +"machines where the host byte order is the same as network byte order, this " +"is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" +"تبدیل اعداد صحیح مثبت ۳۲ بیتی از ترتیب بایت‌های شبکه به ترتیب بایت‌های " +"میزبان. در ماشین‌هایی که ترتیب بایت‌های میزبان همان ترتیب بایت‌های شبکه است،" +"این یک عملیات بی‌اثر (no-op) است؛ در غیر این صورت، یک عملیات جابه‌جایی ۴ " +"بایتی انجام می‌شود." -msgid "Convert 16-bit positive integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation." +msgid "" +"Convert 16-bit positive integers from network to host byte order. On " +"machines where the host byte order is the same as network byte order, this " +"is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" +"اعداد صحیح مثبت ۱۶ بیتی را از ترتیب بایت شبکه به ترتیب بایت میزبان تبدیل " +"می‌کند. در ماشین‌هایی که ترتیب بایت میزبان همان ترتیب بایت شبکه است، این " +"عملیات بی‌اثر (no-op) است؛ در غیر این صورت، یک عملیات جابه‌جایی ۲ بایتی " +"انجام می‌دهد." -msgid "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." +msgid "" +"Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned " +"integer." msgstr "" +"اگر *x* در یک عدد صحیح بدون علامت ۱۶‌بیتی نگنجد، :exc:`OverflowError` را " +"پرتاب می‌کند." -msgid "Convert 32-bit positive integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation." +msgid "" +"Convert 32-bit positive integers from host to network byte order. On " +"machines where the host byte order is the same as network byte order, this " +"is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" +"اعداد صحیح مثبت ۳۲ بیتی را از ترتیب بایت میزبان به ترتیب بایت شبکه تبدیل " +"می‌کند. در ماشین‌هایی که ترتیب بایت میزبان با ترتیب بایت شبکه یکسان است، این" +"یک عملیات بی‌اثر (no-op) است؛ در غیر این صورت، یک عملیات جابجایی ۴ بایتی را " +"انجام می‌دهد." -msgid "Convert 16-bit positive integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation." +msgid "" +"Convert 16-bit positive integers from host to network byte order. On " +"machines where the host byte order is the same as network byte order, this " +"is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" +"اعداد صحیح مثبت ۱۶‌بیتی را از ترتیب بایت میزبان به ترتیب بایت شبکه تبدیل " +"می‌کند. در ماشین‌هایی که ترتیب بایت میزبان همان ترتیب بایت شبکه است، این یک " +"عملیات بدون اثر (no-op) است؛ در غیر این صورت، یک عملیات جابه‌جایی ۲‌بایتی " +"انجام می‌دهد." -msgid "Convert an IPv4 address from dotted-quad string format (for example, '123.45.67.89') to 32-bit packed binary format, as a bytes object four characters in length. This is useful when conversing with a program that uses the standard C library and needs objects of type :c:struct:`in_addr`, which is the C type for the 32-bit packed binary this function returns." -msgstr "" +msgid "" +"Convert an IPv4 address from dotted-quad string format (for example, " +"'123.45.67.89') to 32-bit packed binary format, as a bytes object four " +"characters in length. This is useful when conversing with a program that " +"uses the standard C library and needs objects of type :c:struct:`in_addr`, " +"which is the C type for the 32-bit packed binary this function returns." +msgstr "" +"نشانی IPv4 را از قالب رشته‌ای چهاربخشی نقطه‌دار (برای مثال، '123.45.67.89')" +" به قالب دودویی فشرده‌ی ۳۲ بیتی تبدیل می‌کند، به‌صورت یک شیء bytes به طول ۴ " +"نویسه. این کار هنگام ارتباط با برنامه‌ای که از کتابخانه‌ی استاندارد C " +"استفاده می‌کند و به اشیایی از نوع :c:struct:`in_addr`، نوع C برای داده‌ی " +"دودویی فشرده‌ی ۳۲ بیتی که این تابع برمی‌گرداند، نیاز دارد، مفید است." -msgid ":func:`inet_aton` also accepts strings with less than three dots; see the Unix manual page :manpage:`inet(3)` for details." +msgid "" +":func:`inet_aton` also accepts strings with less than three dots; see the " +"Unix manual page :manpage:`inet(3)` for details." msgstr "" +":func:`inet_aton` همچنین رشته‌هایی با کمتر از ۳ نقطه را می‌پذیرد؛ برای " +"جزئیات، صفحه راهنمای یونیکس :manpage:`inet(3)` را ببینید." -msgid "If the IPv4 address string passed to this function is invalid, :exc:`OSError` will be raised. Note that exactly what is valid depends on the underlying C implementation of :c:func:`inet_aton`." +msgid "" +"If the IPv4 address string passed to this function is invalid, " +":exc:`OSError` will be raised. Note that exactly what is valid depends on " +"the underlying C implementation of :c:func:`inet_aton`." msgstr "" +"اگر رشته‌ی نشانی IPv4 داده‌شده به این تابع نامعتبر باشد، :exc:`OSError` پرتاب" +" خواهد شد. توجه داشته باشید که دقیقاً این‌که چه چیزی معتبر است، به " +"پیاده‌سازی C زیرینِ :c:func:`inet_aton` بستگی دارد." -msgid ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be used instead for IPv4/v6 dual stack support." +msgid "" +":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " +"used instead for IPv4/v6 dual stack support." msgstr "" +":func:`inet_aton` از IPv6 پشتیبانی نمی‌کند و برای پشتیبانی از پشته‌ی دوگانه " +"IPv4/v6 باید به‌جای آن از :func:`inet_pton` استفاده شود." -msgid "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes in length) to its standard dotted-quad string representation (for example, '123.45.67.89'). This is useful when conversing with a program that uses the standard C library and needs objects of type :c:struct:`in_addr`, which is the C type for the 32-bit packed binary data this function takes as an argument." -msgstr "" +msgid "" +"Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes" +" in length) to its standard dotted-quad string representation (for example, " +"'123.45.67.89'). This is useful when conversing with a program that uses " +"the standard C library and needs objects of type :c:struct:`in_addr`, which " +"is the C type for the 32-bit packed binary data this function takes as an " +"argument." +msgstr "" +"یک نشانی IPv4 بسته‌بندی‌شده‌ی ۳۲ بیتی (یک :term:`شیء شبه‌بایت ` به طول ۴ بایت) را به نمایش رشته‌ای استاندارد به‌صورت چهارتایی " +"نقطه‌دار (برای مثال، '123.45.67.89') تبدیل می‌کند. این کار هنگام ارتباط با " +"برنامه‌ای که از کتابخانه‌ی استاندارد C استفاده می‌کند و به اشیایی از نوع " +":c:struct:`in_addr` نیاز دارد، مفید است. این، نوع C برای داده‌ی دودویی " +"بسته‌بندی‌شده‌ی ۳۲ بیتی است که این تابع آن را به‌عنوان آرگومان دریافت می‌کند." -msgid "If the byte sequence passed to this function is not exactly 4 bytes in length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support IPv6, and :func:`inet_ntop` should be used instead for IPv4/v6 dual stack support." +msgid "" +"If the byte sequence passed to this function is not exactly 4 bytes in " +"length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " +"IPv6, and :func:`inet_ntop` should be used instead for IPv4/v6 dual stack " +"support." msgstr "" +"اگر طول دنباله بایت داده‌شده به این تابع دقیقاً ۴ بایت نباشد، :exc:`OSError`" +" پرتاب خواهد شد. :func:`inet_ntoa` از IPv6 پشتیبانی نمی‌کند و برای پشتیبانی " +"از پشته دوگانه IPv4/v6 باید به‌جای آن از :func:`inet_ntop` استفاده شود." -msgid "Convert an IP address from its family-specific string format to a packed, binary format. :func:`inet_pton` is useful when a library or network protocol calls for an object of type :c:struct:`in_addr` (similar to :func:`inet_aton`) or :c:struct:`in6_addr`." +msgid "" +"Convert an IP address from its family-specific string format to a packed, " +"binary format. :func:`inet_pton` is useful when a library or network " +"protocol calls for an object of type :c:struct:`in_addr` (similar to " +":func:`inet_aton`) or :c:struct:`in6_addr`." msgstr "" +"یک نشانی IP را از قالب رشته‌ای مختص خانواده‌اش به قالب دودویی فشرده تبدیل " +"می‌کند. :func:`inet_pton` زمانی مفید است که یک کتابخانه یا پروتکل شبکه به یک" +" شیء از نوع :c:struct:`in_addr` (مشابه :func:`inet_aton`) یا " +":c:struct:`in6_addr` نیاز داشته باشد." -msgid "Supported values for *address_family* are currently :const:`AF_INET` and :const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:`OSError` will be raised. Note that exactly what is valid depends on both the value of *address_family* and the underlying implementation of :c:func:`inet_pton`." -msgstr "" +msgid "" +"Supported values for *address_family* are currently :const:`AF_INET` and " +":const:`AF_INET6`. If the IP address string *ip_string* is invalid, " +":exc:`OSError` will be raised. Note that exactly what is valid depends on " +"both the value of *address_family* and the underlying implementation of " +":c:func:`inet_pton`." +msgstr "" +"مقادیر پشتیبانی‌شده برای *address_family* در حال حاضر :const:`AF_INET` و " +":const:`AF_INET6` هستند. اگر رشته‌ی نشانی IP *ip_string* نامعتبر باشد، " +":exc:`OSError` پرتاب می‌شود. توجه داشته باشید که دقیقاً آنچه معتبر است، هم " +"به مقدار *address_family* و هم به پیاده‌سازی زیربنایی :c:func:`inet_pton` " +"بستگی دارد." msgid "Windows support added" -msgstr "" +msgstr "پشتیبانی از ویندوز افزوده شد" -msgid "Convert a packed IP address (a :term:`bytes-like object` of some number of bytes) to its standard, family-specific string representation (for example, ``'7.10.0.5'`` or ``'5aef:2b::8'``). :func:`inet_ntop` is useful when a library or network protocol returns an object of type :c:struct:`in_addr` (similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." -msgstr "" +msgid "" +"Convert a packed IP address (a :term:`bytes-like object` of some number of " +"bytes) to its standard, family-specific string representation (for example, " +"``'7.10.0.5'`` or ``'5aef:2b::8'``). :func:`inet_ntop` is useful when a " +"library or network protocol returns an object of type :c:struct:`in_addr` " +"(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." +msgstr "" +"یک نشانی IP فشرده (یک :term:`شیء شبه‌بایت ` با تعدادی " +"بایت) را به نمایش رشته‌ای استاندارد و مختص خانواده‌ی آن (برای مثال، " +"``'7.10.0.5'`` یا ``'5aef:2b::8'``) تبدیل می‌کند. :func:`inet_ntop` هنگامی " +"مفید است که یک کتابخانه یا پروتکل شبکه شیءای از نوع :c:struct:`in_addr` " +"(مشابه :func:`inet_ntoa`) یا :c:struct:`in6_addr` برمی‌گرداند." -msgid "Supported values for *address_family* are currently :const:`AF_INET` and :const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length for the specified address family, :exc:`ValueError` will be raised. :exc:`OSError` is raised for errors from the call to :func:`inet_ntop`." +msgid "" +"Supported values for *address_family* are currently :const:`AF_INET` and " +":const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length" +" for the specified address family, :exc:`ValueError` will be raised. " +":exc:`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" +"مقادیر پشتیبانی‌شده برای *address_family* در حال حاضر :const:`AF_INET` و " +":const:`AF_INET6` هستند. اگر طول شیء bytes *packed_ip* برای خانواده‌ی نشانی " +"مشخص‌شده صحیح نباشد، :exc:`ValueError` پرتاب خواهد شد. :exc:`OSError` برای " +"خطاهای ناشی از فراخوانی :func:`inet_ntop` پرتاب می‌شود." -msgid "Return the total length, without trailing padding, of an ancillary data item with associated data of the given *length*. This value can often be used as the buffer size for :meth:`~socket.recvmsg` to receive a single item of ancillary data, but :rfc:`3542` requires portable applications to use :func:`CMSG_SPACE` and thus include space for padding, even when the item will be the last in the buffer. Raises :exc:`OverflowError` if *length* is outside the permissible range of values." -msgstr "" +msgid "" +"Return the total length, without trailing padding, of an ancillary data item" +" with associated data of the given *length*. This value can often be used " +"as the buffer size for :meth:`~socket.recvmsg` to receive a single item of " +"ancillary data, but :rfc:`3542` requires portable applications to use " +":func:`CMSG_SPACE` and thus include space for padding, even when the item " +"will be the last in the buffer. Raises :exc:`OverflowError` if *length* is " +"outside the permissible range of values." +msgstr "" +"طول کل یک آیتم داده‌ی جانبی با داده‌ی مرتبط به طول *length* داده‌شده را، " +"بدون پرکننده‌ی انتهایی (padding)، برمی‌گرداند. این مقدار اغلب می‌تواند " +"به‌عنوان اندازه‌ی بافربرای دریافت یک آیتم داده‌ی جانبی از طریق " +":meth:`~socket.recvmsg` استفاده شود، اما :rfc:`3542` برنامه‌های قابل‌حمل را " +"ملزم می‌کند که از :func:`CMSG_SPACE` استفاده کنند و بنابراین فضایی برای " +"پرکننده (padding) در نظر بگیرند، حتی وقتی آیتم آخرین آیتم در بافر باشد. اگر " +"*length* خارج از محدوده‌ی مجاز مقادیر باشد، :exc:`OverflowError` پرتاب " +"می‌شود." msgid "Most Unix platforms." -msgstr "" +msgstr "بیشتر پلتفرم‌های یونیکس." -msgid "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an ancillary data item with associated data of the given *length*, along with any trailing padding. The buffer space needed to receive multiple items is the sum of the :func:`CMSG_SPACE` values for their associated data lengths. Raises :exc:`OverflowError` if *length* is outside the permissible range of values." -msgstr "" +msgid "" +"Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " +"ancillary data item with associated data of the given *length*, along with " +"any trailing padding. The buffer space needed to receive multiple items is " +"the sum of the :func:`CMSG_SPACE` values for their associated data lengths." +" Raises :exc:`OverflowError` if *length* is outside the permissible range " +"of values." +msgstr "" +"اندازه‌ی بافر موردنیاز برای :meth:`~socket.recvmsg` را برمی‌گرداند تا یک آیتم" +" داده‌ی جانبی با داده‌ی مرتبط به طول *length* داده‌شده، به‌همراه هرگونه " +"پرکننده‌ی انتهایی (padding) دریافت شود. فضای بافر موردنیاز برای دریافت چند " +"آیتم، مجموع مقادیر :func:`CMSG_SPACE` برای طول‌های داده‌ی مرتبط آن‌ها است. " +"اگر *length* خارج از محدوده‌ی مجاز مقادیر باشد، :exc:`OverflowError` پرتاب " +"می‌شود." -msgid "Note that some systems might support ancillary data without providing this function. Also note that setting the buffer size using the results of this function may not precisely limit the amount of ancillary data that can be received, since additional data may be able to fit into the padding area." +msgid "" +"Note that some systems might support ancillary data without providing this " +"function. Also note that setting the buffer size using the results of this " +"function may not precisely limit the amount of ancillary data that can be " +"received, since additional data may be able to fit into the padding area." msgstr "" +"توجه داشته باشید که برخی سیستم‌ها ممکن است بدون ارائه‌ی این تابع، از داده‌های" +" جانبی پشتیبانی کنند. همچنین توجه داشته باشید که تنظیم اندازه‌ی بافر " +" با استفاده از نتایج این تابع ممکن است دقیقاً میزان داده‌های جانبی قابل " +"دریافت را محدود نکند، زیرا ممکن است داده‌های اضافی بتوانند در ناحیه‌ی پدینگ " +"(padding) جای گیرند." msgid "most Unix platforms." -msgstr "" +msgstr "بیشتر پلتفرم‌های یونیکسی." -msgid "Return the default timeout in seconds (float) for new socket objects. A value of ``None`` indicates that new socket objects have no timeout. When the socket module is first imported, the default is ``None``." +msgid "" +"Return the default timeout in seconds (float) for new socket objects. A " +"value of ``None`` indicates that new socket objects have no timeout. When " +"the socket module is first imported, the default is ``None``." msgstr "" +"بازگرداندن مهلت پیش‌فرض بر حسب ثانیه (float) برای اشیاء سوکت جدید. مقدار " +"``None`` نشان می‌دهد که اشیاء سوکت جدید بدون مهلت هستند. هنگامی که ماژول " +"socket برای نخستین بار ایمپورت می‌شود، مقدار پیش‌فرض ``None`` است." -msgid "Set the default timeout in seconds (float) for new socket objects. When the socket module is first imported, the default is ``None``. See :meth:`~socket.settimeout` for possible values and their respective meanings." +msgid "" +"Set the default timeout in seconds (float) for new socket objects. When the" +" socket module is first imported, the default is ``None``. See " +":meth:`~socket.settimeout` for possible values and their respective " +"meanings." msgstr "" +"مهلت پیش‌فرض را بر حسب ثانیه (float) برای اشیای جدید سوکت تنظیم کنید. هنگامی" +" که ماژول socket برای اولین بار ایمپورت می‌شود، مقدار پیش‌فرض ``None`` است. " +"برای مقادیر ممکن و معانی مربوط به آن‌ها :meth:`~socket.settimeout` را " +"ببینید." -msgid "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if you don't have enough rights." +msgid "" +"Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " +"you don't have enough rights." msgstr "" +"نام میزبان ماشین را روی *name* تنظیم می‌کند. اگر دسترسی کافی نداشته باشید، " +"این کار یک :exc:`OSError` را پرتاب می‌کند." -msgid "Raises an :ref:`auditing event ` ``socket.sethostname`` with argument ``name``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.sethostname`` with " +"argument ``name``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.sethostname`` را با آرگومان " +"``name`` پرتاب می‌کند." -msgid "Return a list of network interface information (index int, name string) tuples. :exc:`OSError` if the system call fails." +msgid "" +"Return a list of network interface information (index int, name string) " +"tuples. :exc:`OSError` if the system call fails." msgstr "" +"فهرستی از تاپل‌های اطلاعات رابط شبکه (index int، name string) را " +"برمی‌گرداند. در صورت شکست فراخوانی سیستمی، :exc:`OSError`." msgid "Windows support was added." -msgstr "" +msgstr "پشتیبانی از ویندوز افزوده شد." -msgid "On Windows network interfaces have different names in different contexts (all names are examples):" +msgid "" +"On Windows network interfaces have different names in different contexts " +"(all names are examples):" msgstr "" +"در ویندوز، رابط‌های شبکه نام‌های متفاوتی در زمینه‌های مختلف دارند (همه‌ی " +"نام‌ها مثال هستند):" msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -msgstr "" +msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgid "name: ``ethernet_32770``" -msgstr "" +msgstr "نام: ``ethernet_32770``" msgid "friendly name: ``vEthernet (nat)``" -msgstr "" +msgstr "نام دوستانه: ``vEthernet (nat)``" msgid "description: ``Hyper-V Virtual Ethernet Adapter``" -msgstr "" +msgstr "توضیح: ``Hyper-V Virtual Ethernet Adapter``" -msgid "This function returns names of the second form from the list, ``ethernet_32770`` in this example case." +msgid "" +"This function returns names of the second form from the list, " +"``ethernet_32770`` in this example case." msgstr "" +"این تابع نام‌های صورت دوم را از فهرست برمی‌گرداند؛ در این مثال، " +"``ethernet_32770`` برگردانده می‌شود." -msgid "Return a network interface index number corresponding to an interface name. :exc:`OSError` if no interface with the given name exists." +msgid "" +"Return a network interface index number corresponding to an interface name. " +":exc:`OSError` if no interface with the given name exists." msgstr "" +"شماره‌ی اندیس رابط شبکه متناظر با نام رابط را برمی‌گرداند. اگر رابطی با نام " +"داده‌شده وجود نداشته باشد، :exc:`OSError` پرتاب می‌شود." msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" +"«نام رابط» یک نام است، همان‌طور که در :func:`if_nameindex` مستند شده است." -msgid "Return a network interface name corresponding to an interface index number. :exc:`OSError` if no interface with the given index exists." +msgid "" +"Return a network interface name corresponding to an interface index number. " +":exc:`OSError` if no interface with the given index exists." msgstr "" +"نام رابط شبکه متناظر با شماره اندیس رابط را برمی‌گرداند. اگر رابطی با اندیس " +"داده‌شده وجود نداشته باشد، :exc:`OSError` رخ می‌دهد." -msgid "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket *sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:`~socket.sendmsg` for the documentation of these parameters." +msgid "" +"Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " +"*sock*. The *fds* parameter is a sequence of file descriptors. Consult " +":meth:`~socket.sendmsg` for the documentation of these parameters." msgstr "" +"فهرست توصیف‌گرهای فایل *fds* را از طریق یک سوکت :const:`AF_UNIX` با نام " +"*sock* ارسال کنید. پارامتر *fds* یک دنباله از توصیف‌گرهای فایل است. برای " +"مستندات این پارامترها به :meth:`~socket.sendmsg` مراجعه کنید." -msgid "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism." +msgid "" +"Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " +"mechanism." msgstr "" +"سکوهای یونیکسی که از :meth:`~socket.sendmsg` و سازوکار :const:`SCM_RIGHTS` " +"پشتیبانی می‌کنند." -msgid "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket *sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket.recvmsg` for the documentation of these parameters." +msgid "" +"Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " +"*sock*. Return ``(msg, list(fds), flags, addr)``. Consult " +":meth:`~socket.recvmsg` for the documentation of these parameters." msgstr "" +"حداکثر *maxfds* توصیف‌گر فایل را از یک سوکت :const:`AF_UNIX` به نام *sock* " +"دریافت می‌کند. مقدار ``(msg, list(fds), flags, addr)`` را برمی‌گرداند. برای " +"مستندات این پارامترها به :meth:`~socket.recvmsg` مراجعه کنید." -msgid "Unix platforms supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` mechanism." +msgid "" +"Unix platforms supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` " +"mechanism." msgstr "" +"سکوهای یونیکسی که از :meth:`~socket.recvmsg` و سازوکار :const:`SCM_RIGHTS` " +"پشتیبانی می‌کنند." msgid "Any truncated integers at the end of the list of file descriptors." -msgstr "" +msgstr "هرگونه عدد صحیح بریده‌شده در انتهای فهرست توصیف‌گرهای فایل." msgid "Socket Objects" -msgstr "" +msgstr "اشیای سوکت" -msgid "Create a new socket using the given address family, socket type and protocol number. The address family should be :const:`AF_INET` (the default), :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or :const:`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the default), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` constants. The protocol number is usually zero and may be omitted or in the case where the address family is :const:`AF_CAN` the protocol should be one of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or :const:`CAN_J1939`." -msgstr "" +msgid "" +"Create a new socket using the given address family, socket type and protocol" +" number. The address family should be :const:`AF_INET` (the default), " +":const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or" +" :const:`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the " +"default), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other" +" ``SOCK_`` constants. The protocol number is usually zero and may be omitted" +" or in the case where the address family is :const:`AF_CAN` the protocol " +"should be one of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or " +":const:`CAN_J1939`." +msgstr "" +"با استفاده از خانواده آدرس، نوع سوکت و شماره پروتکل داده‌شده، یک سوکت جدید " +"ایجاد کنید. خانواده آدرس باید :const:`AF_INET` (پیش‌فرض)، :const:`AF_INET6`،" +" :const:`AF_UNIX`، :const:`AF_CAN`، :const:`AF_PACKET` یا :const:`AF_RDS` " +"باشد. نوع سوکت باید :const:`SOCK_STREAM` (پیش‌فرض)، :const:`SOCK_DGRAM`، " +":const:`SOCK_RAW` یا شاید یکی از سایر ثابت‌های ``SOCK_`` باشد. شماره پروتکل " +"معمولاً صفر است و می‌تواند حذف شود، یا در صورتی که خانواده آدرس " +":const:`AF_CAN` باشد، پروتکل باید یکی از :const:`CAN_RAW`، :const:`CAN_BCM`،" +" :const:`CAN_ISOTP` یا :const:`CAN_J1939` باشد." -msgid "If *fileno* is specified, the values for *family*, *type*, and *proto* are auto-detected from the specified file descriptor. Auto-detection can be overruled by calling the function with explicit *family*, *type*, or *proto* arguments. This only affects how Python represents e.g. the return value of :meth:`socket.getpeername` but not the actual OS resource. Unlike :func:`socket.fromfd`, *fileno* will return the same socket and not a duplicate. This may help close a detached socket using :meth:`socket.close`." -msgstr "" +msgid "" +"If *fileno* is specified, the values for *family*, *type*, and *proto* are " +"auto-detected from the specified file descriptor. Auto-detection can be " +"overruled by calling the function with explicit *family*, *type*, or *proto*" +" arguments. This only affects how Python represents e.g. the return value " +"of :meth:`socket.getpeername` but not the actual OS resource. Unlike " +":func:`socket.fromfd`, *fileno* will return the same socket and not a " +"duplicate. This may help close a detached socket using :meth:`socket.close`." +msgstr "" +"اگر *fileno* مشخص شده باشد، مقادیر *family*، *type* و *proto* به‌صورت خودکار" +" از توصیف‌گر فایل مشخص‌شده تشخیص داده می‌شوند. می‌توان با فراخوانی تابع با " +"آرگومان‌های صریح *family*، *type* یا *proto*، تشخیص خودکار را لغو کرد. این " +"موضوع فقط بر نحوه‌ی بازنمایی پایتون، برای مثال مقدار بازگشتی " +":meth:`socket.getpeername`، تأثیر می‌گذارد، نه بر منبع واقعی سیستم‌عامل. " +"برخلاف :func:`socket.fromfd`، *fileno* همان سوکت را برمی‌گرداند، نه یک سوکت " +"تکراری. این ممکن است به بستن یک سوکت جداشده با استفاده از " +":meth:`socket.close` کمک کند." -msgid "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments ``self``, ``family``, ``type``, ``protocol``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.__new__`` with arguments" +" ``self``, ``family``, ``type``, ``protocol``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.__new__`` را با آرگومان‌های " +"``self``، ``family``، ``type``، ``protocol`` پرتاب می‌کند." msgid "The AF_CAN family was added. The AF_RDS family was added." -msgstr "" +msgstr "خانواده AF_CAN افزوده شد. خانواده AF_RDS افزوده شد." msgid "The CAN_BCM protocol was added." -msgstr "" +msgstr "پروتکل CAN_BCM افزوده شد." msgid "The CAN_ISOTP protocol was added." -msgstr "" +msgstr "پروتکل CAN_ISOTP افزوده شد." -msgid "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied to *type* they are cleared, and :attr:`socket.type` will not reflect them. They are still passed to the underlying system ``socket()`` call. Therefore," +msgid "" +"When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " +"to *type* they are cleared, and :attr:`socket.type` will not reflect them. " +"They are still passed to the underlying system ``socket()`` call. " +"Therefore," msgstr "" +"هنگامی که پرچم‌های بیتی :const:`SOCK_NONBLOCK` یا :const:`SOCK_CLOEXEC` به " +"*type* اعمال شوند، این پرچم‌ها پاک می‌شوند و :attr:`socket.type` آن‌ها را " +"بازتاب نخواهد داد. آن‌ها همچنان به فراخوانی سیستمی زیربنایی ``socket()`` " +"ارسال می‌شوند. بنابراین،" msgid "" "sock = socket.socket(\n" " socket.AF_INET,\n" " socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" msgstr "" +"sock = socket.socket(\n" +" socket.AF_INET,\n" +" socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" -msgid "will still create a non-blocking socket on OSes that support ``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." +msgid "" +"will still create a non-blocking socket on OSes that support " +"``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" +"همچنان در سیستم‌عامل‌هایی که از ``SOCK_NONBLOCK`` پشتیبانی می‌کنند، یک سوکت " +"غیرمسدودکننده ایجاد خواهد کرد، اما ``sock.type`` روی ``socket.SOCK_STREAM`` " +"تنظیم خواهد شد." msgid "The CAN_J1939 protocol was added." -msgstr "" +msgstr "پروتکل CAN_J1939 افزوده شد." msgid "The IPPROTO_MPTCP protocol was added." -msgstr "" +msgstr "پروتکل IPPROTO_MPTCP افزوده شد." -msgid "Socket objects have the following methods. Except for :meth:`~socket.makefile`, these correspond to Unix system calls applicable to sockets." +msgid "" +"Socket objects have the following methods. Except for " +":meth:`~socket.makefile`, these correspond to Unix system calls applicable " +"to sockets." msgstr "" +"اشیای سوکت متدهای زیر را دارند. به‌جز :meth:`~socket.makefile`، این متدها " +"معادل فراخوانی‌های سیستمی یونیکس هستند که برای سوکت‌ها کاربرد دارند." -msgid "Support for the :term:`context manager` protocol was added. Exiting the context manager is equivalent to calling :meth:`~socket.close`." +msgid "" +"Support for the :term:`context manager` protocol was added. Exiting the " +"context manager is equivalent to calling :meth:`~socket.close`." msgstr "" +"پشتیبانی از پروتکل :term:`context manager` افزوده شد. خروج از مدیر زمینه " +"معادل فراخوانی :meth:`~socket.close` است." -msgid "Accept a connection. The socket must be bound to an address and listening for connections. The return value is a pair ``(conn, address)`` where *conn* is a *new* socket object usable to send and receive data on the connection, and *address* is the address bound to the socket on the other end of the connection." +msgid "" +"Accept a connection. The socket must be bound to an address and listening " +"for connections. The return value is a pair ``(conn, address)`` where *conn*" +" is a *new* socket object usable to send and receive data on the connection," +" and *address* is the address bound to the socket on the other end of the " +"connection." msgstr "" +"پذیرش یک اتصال. سوکت باید به یک آدرس مقید شده و در حال گوش‌دادن به اتصال‌ها " +"باشد. مقدار بازگشتی یک جفت ``(conn, address)`` است که در آن *conn* یک شیء " +"سوکت *جدید* است که می‌توان از آن برای ارسال و دریافت داده روی اتصال استفاده " +"کرد، و *address* آدرسی است که به سوکت در سمت دیگر اتصال مقید شده است." msgid "The socket is now non-inheritable." -msgstr "" +msgstr "سوکت اکنون غیرقابل ارث‌بری است." -msgid "If the system call is interrupted and the signal handler does not raise an exception, the method now retries the system call instead of raising an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +msgid "" +"If the system call is interrupted and the signal handler does not raise an " +"exception, the method now retries the system call instead of raising an " +":exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" +"اگر فراخوانی سیستمی قطع شود و مدیر سیگنال استثنایی پرتاب نکند، متد اکنون " +"به‌جای پرتاب استثنای :exc:`InterruptedError`، فراخوانی سیستمی را دوباره تلاش" +" می‌کند (برای دلیل آن :pep:`475` را ببینید)." -msgid "Bind the socket to *address*. The socket must not already be bound. The format of *address* depends on the address family --- see :ref:`socket-addresses`." +msgid "" +"Bind the socket to *address*. The socket must not already be bound. The " +"format of *address* depends on the address family --- see :ref:`socket-" +"addresses`." msgstr "" +"سوکت را به *address* متصل کنید. سوکت نباید از قبل متصل شده باشد. قالب " +"*address* به خانواده آدرس بستگی دارد — :ref:`socket-addresses` را ببینید." -msgid "Raises an :ref:`auditing event ` ``socket.bind`` with arguments ``self``, ``address``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.bind`` with arguments " +"``self``, ``address``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.bind`` را با آرگومان‌های " +"``self`` و ``address`` پرتاب می‌کند." -msgid "Mark the socket closed. The underlying system resource (e.g. a file descriptor) is also closed when all file objects from :meth:`makefile` are closed. Once that happens, all future operations on the socket object will fail. The remote end will receive no more data (after queued data is flushed)." -msgstr "" +msgid "" +"Mark the socket closed. The underlying system resource (e.g. a file " +"descriptor) is also closed when all file objects from :meth:`makefile` are " +"closed. Once that happens, all future operations on the socket object will " +"fail. The remote end will receive no more data (after queued data is " +"flushed)." +msgstr "" +"سوکت را به‌عنوان بسته‌شده علامت‌گذاری می‌کند. منبع سیستمی زیربنایی (مانند یک" +" توصیف‌گر فایل) نیز زمانی بسته می‌شود که همه‌ی اشیای فایل حاصل از " +":meth:`makefile` بسته شوند. پس از وقوع آن، همه‌ی عملیات‌های آینده روی شیء " +"سوکت با شکست مواجه خواهند شد. سمت راه دور دیگر داده‌ای دریافت نخواهد کرد (پس" +" از تخلیه‌ی داده‌های در صف)." -msgid "Sockets are automatically closed when they are garbage-collected, but it is recommended to :meth:`close` them explicitly, or to use a :keyword:`with` statement around them." +msgid "" +"Sockets are automatically closed when they are garbage-collected, but it is " +"recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " +"statement around them." msgstr "" +"سوکت‌ها هنگامی که زباله‌روبی می‌شوند، به‌طور خودکار بسته می‌شوند، اما توصیه " +"می‌شود آن‌ها را به‌صراحت با :meth:`close` ببندید، یا از یک دستور " +":keyword:`with` در اطراف آن‌ها استفاده کنید." -msgid ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:`!close` call is made." +msgid "" +":exc:`OSError` is now raised if an error occurs when the underlying " +":c:func:`!close` call is made." msgstr "" +":exc:`OSError` اکنون در صورتی پرتاب می‌شود که خطایی هنگام فراخوانی زیربنایی " +":c:func:`!close` رخ دهد." -msgid ":meth:`close` releases the resource associated with a connection but does not necessarily close the connection immediately. If you want to close the connection in a timely fashion, call :meth:`shutdown` before :meth:`close`." +msgid "" +":meth:`close` releases the resource associated with a connection but does " +"not necessarily close the connection immediately. If you want to close the " +"connection in a timely fashion, call :meth:`shutdown` before :meth:`close`." msgstr "" +":meth:`close` منبع مرتبط با یک اتصال را آزاد می‌کند، اما لزوماً اتصال را " +"بلافاصله نمی‌بندد. اگر می‌خواهید اتصال را به‌موقع ببندید، پیش از " +":meth:`close`، :meth:`shutdown` را فراخوانی کنید." -msgid "Connect to a remote socket at *address*. The format of *address* depends on the address family --- see :ref:`socket-addresses`." +msgid "" +"Connect to a remote socket at *address*. The format of *address* depends on " +"the address family --- see :ref:`socket-addresses`." msgstr "" +"به یک سوکتدوردست در *address* متصل شوید. قالب *address* به " +"خانواده‌ی نشانی (address family) وابسته است — :ref:`socket-addresses` را " +"ببینید." -msgid "If the connection is interrupted by a signal, the method waits until the connection completes, or raises a :exc:`TimeoutError` on timeout, if the signal handler doesn't raise an exception and the socket is blocking or has a timeout. For non-blocking sockets, the method raises an :exc:`InterruptedError` exception if the connection is interrupted by a signal (or the exception raised by the signal handler)." -msgstr "" +msgid "" +"If the connection is interrupted by a signal, the method waits until the " +"connection completes, or raises a :exc:`TimeoutError` on timeout, if the " +"signal handler doesn't raise an exception and the socket is blocking or has " +"a timeout. For non-blocking sockets, the method raises an " +":exc:`InterruptedError` exception if the connection is interrupted by a " +"signal (or the exception raised by the signal handler)." +msgstr "" +"اگر یک سیگنال اتصال را قطع کند، در صورتی که مدیر سیگنال استثنایی پرتاب نکند " +"و سوکت مسدودکننده یا دارای مهلت زمانی باشد، متد تا کامل شدن اتصال صبر می‌کند " +"یا در صورت مهلت زمانی، :exc:`TimeoutError` پرتاب می‌کند. برای سوکت‌های " +"غیرمسدودکننده، اگر یک سیگنال اتصال را قطع کند، متد استثنای " +":exc:`InterruptedError` (یا استثنای پرتاب‌شده توسط مدیر سیگنال) را پرتاب " +"می‌کند." -msgid "Raises an :ref:`auditing event ` ``socket.connect`` with arguments ``self``, ``address``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.connect`` with arguments" +" ``self``, ``address``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.connect`` را با آرگومان‌های " +"``self``، ``address`` پرتاب می‌کند." -msgid "The method now waits until the connection completes instead of raising an :exc:`InterruptedError` exception if the connection is interrupted by a signal, the signal handler doesn't raise an exception and the socket is blocking or has a timeout (see the :pep:`475` for the rationale)." +msgid "" +"The method now waits until the connection completes instead of raising an " +":exc:`InterruptedError` exception if the connection is interrupted by a " +"signal, the signal handler doesn't raise an exception and the socket is " +"blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" +"این متد اکنون به‌جای پرتاب استثنای :exc:`InterruptedError`، تا تکمیل شدن " +"اتصال منتظر می‌ماند؛ مشروط بر اینکه اتصال با یک سیگنال قطع شده باشد، " +"هندلر سیگنال استثنایی پرتاب نکند و سوکت مسدودکننده (blocking) باشد یا " +"مهلت زمانی (timeout) داشته باشد (برای علت آن :pep:`475` را ببینید)." -msgid "Like ``connect(address)``, but return an error indicator instead of raising an exception for errors returned by the C-level :c:func:`!connect` call (other problems, such as \"host not found,\" can still raise exceptions). The error indicator is ``0`` if the operation succeeded, otherwise the value of the :c:data:`errno` variable. This is useful to support, for example, asynchronous connects." -msgstr "" +msgid "" +"Like ``connect(address)``, but return an error indicator instead of raising " +"an exception for errors returned by the C-level :c:func:`!connect` call " +"(other problems, such as \"host not found,\" can still raise exceptions). " +"The error indicator is ``0`` if the operation succeeded, otherwise the value" +" of the :c:data:`errno` variable. This is useful to support, for example, " +"asynchronous connects." +msgstr "" +"مانند ``connect(address)`` است، اما به جای پرتاب استثنا برای خطاهای " +"برگردانده‌شده از فراخوانی :c:func:`!connect` در سطح C، یک نشانگر خطا " +"برمی‌گرداند (مشکلات دیگر، مانند «میزبان یافت نشد»، همچنان می‌توانند استثنا " +"پرتاب کنند). اگر عملیات موفق باشد، نشانگر خطا ``0`` است، در غیر این صورت " +"مقدار متغیر :c:data:`errno` است. این برای پشتیبانی از اتصال‌های ناهمگام، " +"برای مثال، مفید است." -msgid "Put the socket object into closed state without actually closing the underlying file descriptor. The file descriptor is returned, and can be reused for other purposes." +msgid "" +"Put the socket object into closed state without actually closing the " +"underlying file descriptor. The file descriptor is returned, and can be " +"reused for other purposes." msgstr "" +"شیء سوکت را در وضعیت بسته قرار می‌دهد، بدون آنکه توصیف‌گر فایل زیرین را " +"واقعاً ببندد. توصیف‌گر فایل بازگردانده می‌شود و می‌تواند برای اهداف دیگر " +"دوباره استفاده شود." msgid "Duplicate the socket." -msgstr "" +msgstr "سوکت را تکثیر کنید." -msgid "Return the socket's file descriptor (a small integer), or -1 on failure. This is useful with :func:`select.select`." +msgid "" +"Return the socket's file descriptor (a small integer), or -1 on failure. " +"This is useful with :func:`select.select`." msgstr "" +"توصیف‌گر فایل سوکت (یک عدد صحیح کوچک) را برمی‌گرداند، یا در صورت شکست -1 را. " +"این همراه با :func:`select.select` مفید است." -msgid "Under Windows the small integer returned by this method cannot be used where a file descriptor can be used (such as :func:`os.fdopen`). Unix does not have this limitation." +msgid "" +"Under Windows the small integer returned by this method cannot be used where" +" a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " +"have this limitation." msgstr "" +"در ویندوز، عدد صحیح کوچکی که این متد بازمی‌گرداند نمی‌تواند در مواردی که یک " +"توصیف‌گر فایل قابل استفاده است (مانند :func:`os.fdopen`) به کار رود. یونیکس " +"این محدودیت را ندارد." -msgid "Get the :ref:`inheritable flag ` of the socket's file descriptor or socket's handle: ``True`` if the socket can be inherited in child processes, ``False`` if it cannot." +msgid "" +"Get the :ref:`inheritable flag ` of the socket's file " +"descriptor or socket's handle: ``True`` if the socket can be inherited in " +"child processes, ``False`` if it cannot." msgstr "" +":ref:`پرچم ارث‌پذیری ` توصیف‌گر فایل سوکت یا دسته‌ی سوکت را " +"دریافت کنید: اگر سوکت بتواند در فرآیندهای فرزند به ارث برده شود، ``True`` و " +"اگر نتواند، ``False``." -msgid "Return the remote address to which the socket is connected. This is useful to find out the port number of a remote IPv4/v6 socket, for instance. The format of the address returned depends on the address family --- see :ref:`socket-addresses`. On some systems this function is not supported." +msgid "" +"Return the remote address to which the socket is connected. This is useful " +"to find out the port number of a remote IPv4/v6 socket, for instance. The " +"format of the address returned depends on the address family --- see " +":ref:`socket-addresses`. On some systems this function is not supported." msgstr "" +"نشانی راه دوری را که سوکت به آن متصل است برمی‌گرداند. برای مثال، این موضوع " +"برای پیدا کردن شماره‌ی پورت یک سوکت راه دور IPv4/v6 مفید است. قالب نشانی " +"برگردانده‌شده به خانواده‌ی نشانی بستگی دارد --- :ref:`socket-addresses` را " +"ببینید. در برخی سیستم‌ها این تابع پشتیبانی نمی‌شود." -msgid "Return the socket's own address. This is useful to find out the port number of an IPv4/v6 socket, for instance. The format of the address returned depends on the address family --- see :ref:`socket-addresses`." +msgid "" +"Return the socket's own address. This is useful to find out the port number" +" of an IPv4/v6 socket, for instance. The format of the address returned " +"depends on the address family --- see :ref:`socket-addresses`." msgstr "" +"نشانی خود سوکت را برمی‌گرداند. این کار برای مثال برای یافتن شماره پورت یک " +"سوکت IPv4/v6 مفید است. قالب نشانی برگردانده‌شده به خانواده نشانی بستگی دارد " +"--- :ref:`socket-addresses` را ببینید." -msgid "Return the value of the given socket option (see the Unix man page :manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `) are defined in this module. If *buflen* is absent, an integer option is assumed and its integer value is returned by the function. If *buflen* is present, it specifies the maximum length of the buffer used to receive the option in, and this buffer is returned as a bytes object. It is up to the caller to decode the contents of the buffer (see the optional built-in module :mod:`struct` for a way to decode C structures encoded as byte strings)." -msgstr "" +msgid "" +"Return the value of the given socket option (see the Unix man page " +":manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc." +" `) are defined in this module. If *buflen* is " +"absent, an integer option is assumed and its integer value is returned by " +"the function. If *buflen* is present, it specifies the maximum length of " +"the buffer used to receive the option in, and this buffer is returned as a " +"bytes object. It is up to the caller to decode the contents of the buffer " +"(see the optional built-in module :mod:`struct` for a way to decode C " +"structures encoded as byte strings)." +msgstr "" +"مقدار گزینه‌ی سوکت داده‌شده را برمی‌گرداند (به صفحه‌ی man یونیکس " +":manpage:`getsockopt(2)` مراجعه کنید). ثابت‌های نمادین مورد نیاز " +"(:ref:`SO_\\* etc. `) در این ماژول تعریف شده‌اند. اگر" +" *buflen* وجود نداشته باشد، یک گزینه از نوع عدد صحیح فرض می‌شود و مقدار عدد " +"صحیح آن توسط تابع بازگردانده می‌شود. اگر *buflen* وجود داشته باشد، حداکثر " +"طول بافری را که برای دریافت گزینه استفاده می‌شود، مشخص می‌کند و این بافر " +"به‌عنوان یک شیء bytes بازگردانده می‌شود. کدگشایی محتویات بافر بر عهده‌ی " +"فراخواننده است (برای آشنایی با روشی برای کدگشایی ساختارهای C کدگذاری‌شده " +"به‌صورت رشته‌های بایتی، ماژول توکار اختیاری :mod:`struct` را ببینید)." -msgid "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." +msgid "" +"Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" +"اگر سوکت در حالت مسدودکننده باشد، ``True`` و اگر در حالت غیرمسدودکننده باشد،" +" ``False`` بازمی‌گرداند." msgid "This is equivalent to checking ``socket.gettimeout() != 0``." -msgstr "" +msgstr "این معادل بررسی ``socket.gettimeout() != 0`` است." -msgid "Return the timeout in seconds (float) associated with socket operations, or ``None`` if no timeout is set. This reflects the last call to :meth:`setblocking` or :meth:`settimeout`." +msgid "" +"Return the timeout in seconds (float) associated with socket operations, or " +"``None`` if no timeout is set. This reflects the last call to " +":meth:`setblocking` or :meth:`settimeout`." msgstr "" +"مهلت زمانی (timeout) مرتبط با عملیات سوکت را به ثانیه (float) برمی‌گرداند، " +"یا در صورتی که هیچ مهلت زمانی‌ای تنظیم‌نشده باشد، ``None`` را برمی‌گرداند. " +"این مقدار نشان‌دهنده‌ی آخرین فراخوانی :meth:`setblocking` یا " +":meth:`settimeout` است." -msgid "The :meth:`ioctl` method is a limited interface to the WSAIoctl system interface. Please refer to the `Win32 documentation `_ for more information." +msgid "" +"The :meth:`ioctl` method is a limited interface to the WSAIoctl system " +"interface. Please refer to the `Win32 documentation " +"`_ for " +"more information." msgstr "" +"متد :meth:`ioctl` رابط محدودی برای رابط سیستمی WSAIoctl است. برای اطلاعات " +"بیشتر، به `مستندات Win32 `_ مراجعه کنید." -msgid "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` functions may be used; they accept a socket object as their first argument." +msgid "" +"On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " +"functions may be used; they accept a socket object as their first argument." msgstr "" +"در سکوهای دیگر، می‌توان از توابع عام :func:`fcntl.fcntl` و " +":func:`fcntl.ioctl` استفاده کرد؛ آن‌ها یک شیء سوکت را به‌عنوان اولین آرگومان" +" خود می‌پذیرند." -msgid "Currently only the following control codes are supported: ``SIO_RCVALL``, ``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." +msgid "" +"Currently only the following control codes are supported: ``SIO_RCVALL``, " +"``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" +"در حال حاضر فقط کدهای کنترلی زیر پشتیبانی می‌شوند: ``SIO_RCVALL``، " +"``SIO_KEEPALIVE_VALS`` و ``SIO_LOOPBACK_FAST_PATH``." -msgid "Enable a server to accept connections. If *backlog* is specified, it must be at least 0 (if it is lower, it is set to 0); it specifies the number of unaccepted connections that the system will allow before refusing new connections. If not specified, a default reasonable value is chosen." +msgid "" +"Enable a server to accept connections. If *backlog* is specified, it must " +"be at least 0 (if it is lower, it is set to 0); it specifies the number of " +"unaccepted connections that the system will allow before refusing new " +"connections. If not specified, a default reasonable value is chosen." msgstr "" +"یک سرور را برای پذیرش اتصال‌ها فعال می‌کند. اگر *backlog* مشخص شده باشد، " +"باید حداقل ۰ باشد (اگر کمتر باشد، روی ۰ تنظیم می‌شود)؛ این مقدار تعداد " +"اتصال‌های پذیرفته‌نشده‌ای را مشخص می‌کند که سیستم پیش از رد کردن اتصال‌های " +"جدید مجاز می‌داند. اگر مشخص نشده باشد، یک مقدار پیش‌فرض معقول انتخاب می‌شود." msgid "The *backlog* parameter is now optional." -msgstr "" +msgstr "پارامتر *backlog* اکنون اختیاری است." -msgid "Return a :term:`file object` associated with the socket. The exact returned type depends on the arguments given to :meth:`makefile`. These arguments are interpreted the same way as by the built-in :func:`open` function, except the only supported *mode* values are ``'r'`` (default), ``'w'``, ``'b'``, or a combination of those." -msgstr "" +msgid "" +"Return a :term:`file object` associated with the socket. The exact returned" +" type depends on the arguments given to :meth:`makefile`. These arguments " +"are interpreted the same way as by the built-in :func:`open` function, " +"except the only supported *mode* values are ``'r'`` (default), ``'w'``, " +"``'b'``, or a combination of those." +msgstr "" +"یک :term:`file object` مرتبط با سوکت را برمی‌گرداند. نوع دقیق بازگشتی به " +"آرگومان‌های داده‌شده به :meth:`makefile` بستگی دارد. این آرگومان‌ها به همان " +"شیوه‌ای که تابع توکار :func:`open` آن‌ها را تفسیر می‌کند، تفسیر می‌شوند، با " +"این تفاوت که تنها مقادیر پشتیبانی‌شده برای *mode*، ``'r'`` (پیش‌فرض)، " +"``'w'``، ``'b'`` یا ترکیبی از آن‌ها هستند." -msgid "The socket must be in blocking mode; it can have a timeout, but the file object's internal buffer may end up in an inconsistent state if a timeout occurs." +msgid "" +"The socket must be in blocking mode; it can have a timeout, but the file " +"object's internal buffer may end up in an inconsistent state if a timeout " +"occurs." msgstr "" +"سوکت باید در حالت مسدودکننده باشد؛ می‌تواند مهلت زمانی داشته باشد، اما اگر " +"مهلت زمانی رخ دهد، بافر داخلی شیء فایل ممکن است در وضعیت ناسازگار قرار گیرد." -msgid "Closing the file object returned by :meth:`makefile` won't close the original socket unless all other file objects have been closed and :meth:`socket.close` has been called on the socket object." +msgid "" +"Closing the file object returned by :meth:`makefile` won't close the " +"original socket unless all other file objects have been closed and " +":meth:`socket.close` has been called on the socket object." msgstr "" +"بستن شیء فایلی که توسط :meth:`makefile` برگردانده می‌شود، سوکت اصلی را " +"نمی‌بندد، مگر آنکه همه‌ی اشیاء فایل دیگر بسته شده باشند و " +":meth:`socket.close` روی شیء سوکت فراخوانی شده باشد." -msgid "On Windows, the file-like object created by :meth:`makefile` cannot be used where a file object with a file descriptor is expected, such as the stream arguments of :meth:`subprocess.Popen`." +msgid "" +"On Windows, the file-like object created by :meth:`makefile` cannot be used " +"where a file object with a file descriptor is expected, such as the stream " +"arguments of :meth:`subprocess.Popen`." msgstr "" +"در ویندوز، نمی‌توان از شیء فایل‌مانند ایجادشده توسط :meth:`makefile` در " +"مواردی که یک شیء فایل دارای توصیف‌گر فایل انتظار می‌رود استفاده کرد، مانند " +"آرگومان‌های جریان :meth:`subprocess.Popen`." -msgid "Receive data from the socket. The return value is a bytes object representing the data received. The maximum amount of data to be received at once is specified by *bufsize*. A returned empty bytes object indicates that the client has disconnected. See the Unix manual page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults to zero." -msgstr "" +msgid "" +"Receive data from the socket. The return value is a bytes object " +"representing the data received. The maximum amount of data to be received " +"at once is specified by *bufsize*. A returned empty bytes object indicates " +"that the client has disconnected. See the Unix manual page " +":manpage:`recv(2)` for the meaning of the optional argument *flags*; it " +"defaults to zero." +msgstr "" +"داده‌ها را از سوکت دریافت می‌کند. مقدار بازگشتی یک شیء bytes است که داده‌های" +" دریافت‌شده را نشان می‌دهد. حداکثر مقدار داده‌ای که یکجا دریافت می‌شود، با " +"*bufsize* مشخص می‌شود. بازگشت یک شیء bytes خالی نشان می‌دهد که سرویس‌گیرنده " +"قطع شده است. برای معنای آرگومان اختیاری *flags*، صفحه راهنمای Unix " +":manpage:`recv(2)` را ببینید؛ مقدار پیش‌فرض آن صفر است." -msgid "Receive data from the socket. The return value is a pair ``(bytes, address)`` where *bytes* is a bytes object representing the data received and *address* is the address of the socket sending the data. See the Unix manual page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults to zero. The format of *address* depends on the address family --- see :ref:`socket-addresses`." -msgstr "" +msgid "" +"Receive data from the socket. The return value is a pair ``(bytes, " +"address)`` where *bytes* is a bytes object representing the data received " +"and *address* is the address of the socket sending the data. See the Unix " +"manual page :manpage:`recv(2)` for the meaning of the optional argument " +"*flags*; it defaults to zero. The format of *address* depends on the address" +" family --- see :ref:`socket-addresses`." +msgstr "" +"داده‌ها را از سوکت دریافت می‌کند. مقدار بازگشتی یک جفت ``(bytes, address)`` " +"است که در آن *bytes* یک شیء bytes است که داده‌های دریافتی را نشان می‌دهد و " +"*address* نشانی سوکت ارسال‌کننده‌ی داده‌ها است. برای معنای آرگومان اختیاری " +"*flags*، صفحه‌ی راهنمای Unix :manpage:`recv(2)` را ببینید؛ مقدار پیش‌فرض آن ۰" +" است. قالب *address* به خانواده‌ی نشانی بستگی دارد --- :ref:`socket-" +"addresses` را ببینید." -msgid "For multicast IPv6 address, first item of *address* does not contain ``%scope_id`` part anymore. In order to get full IPv6 address use :func:`getnameinfo`." +msgid "" +"For multicast IPv6 address, first item of *address* does not contain " +"``%scope_id`` part anymore. In order to get full IPv6 address use " +":func:`getnameinfo`." msgstr "" +"برای نشانی چندپخشی IPv6، اولین آیتم *address* دیگر شامل بخش ``%scope_id`` " +"نمی‌شود. برای دریافت نشانی کامل IPv6 از :func:`getnameinfo` استفاده کنید." -msgid "Receive normal data (up to *bufsize* bytes) and ancillary data from the socket. The *ancbufsize* argument sets the size in bytes of the internal buffer used to receive the ancillary data; it defaults to 0, meaning that no ancillary data will be received. Appropriate buffer sizes for ancillary data can be calculated using :func:`CMSG_SPACE` or :func:`CMSG_LEN`, and items which do not fit into the buffer might be truncated or discarded. The *flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." -msgstr "" +msgid "" +"Receive normal data (up to *bufsize* bytes) and ancillary data from the " +"socket. The *ancbufsize* argument sets the size in bytes of the internal " +"buffer used to receive the ancillary data; it defaults to 0, meaning that no" +" ancillary data will be received. Appropriate buffer sizes for ancillary " +"data can be calculated using :func:`CMSG_SPACE` or :func:`CMSG_LEN`, and " +"items which do not fit into the buffer might be truncated or discarded. The" +" *flags* argument defaults to 0 and has the same meaning as for " +":meth:`recv`." +msgstr "" +"داده‌های عادی (تا *bufsize* بایت) و داده‌های کمکی را از سوکت دریافت می‌کند. " +"آرگومان *ancbufsize* اندازه‌ی بافر داخلی را بر حسب بایت برای دریافت داده‌های" +" کمکی تعیین می‌کند؛ مقدار پیش‌فرض آن ۰ است، به این معنا که هیچ داده‌ی کمکی " +"دریافت نخواهد شد. اندازه‌های مناسب بافر برای داده‌های کمکی را می‌توان با " +"استفاده از :func:`CMSG_SPACE` یا :func:`CMSG_LEN` محاسبه کرد، و آیتم‌هایی که" +" در بافر نمی‌گنجند ممکن است بریده یا دور ریخته شوند. آرگومان *flags* به‌طور " +"پیش‌فرض مقدار ۰ دارد و همان معنایی را دارد که برای :meth:`recv` دارد." -msgid "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The *data* item is a :class:`bytes` object holding the non-ancillary data received. The *ancdata* item is a list of zero or more tuples ``(cmsg_level, cmsg_type, cmsg_data)`` representing the ancillary data (control messages) received: *cmsg_level* and *cmsg_type* are integers specifying the protocol level and protocol-specific type respectively, and *cmsg_data* is a :class:`bytes` object holding the associated data. The *msg_flags* item is the bitwise OR of various flags indicating conditions on the received message; see your system documentation for details. If the receiving socket is unconnected, *address* is the address of the sending socket, if available; otherwise, its value is unspecified." -msgstr "" +msgid "" +"The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The" +" *data* item is a :class:`bytes` object holding the non-ancillary data " +"received. The *ancdata* item is a list of zero or more tuples " +"``(cmsg_level, cmsg_type, cmsg_data)`` representing the ancillary data " +"(control messages) received: *cmsg_level* and *cmsg_type* are integers " +"specifying the protocol level and protocol-specific type respectively, and " +"*cmsg_data* is a :class:`bytes` object holding the associated data. The " +"*msg_flags* item is the bitwise OR of various flags indicating conditions on" +" the received message; see your system documentation for details. If the " +"receiving socket is unconnected, *address* is the address of the sending " +"socket, if available; otherwise, its value is unspecified." +msgstr "" +"مقدار بازگشتی یک تاپل ۴تایی است: ``(data, ancdata, msg_flags, address)``. " +"آیتم *data* یک شیء :class:`bytes` حاوی داده‌های غیرجانبی دریافت‌شده است. " +"آیتم *ancdata* فهرستی از صفر یا چند تاپل ``(cmsg_level, cmsg_type, " +"cmsg_data)`` است که داده‌های جانبی (پیام‌های کنترلی) دریافت‌شده را نشان " +"می‌دهد: *cmsg_level* و *cmsg_type* اعداد صحیحی هستند که به ترتیب سطح پروتکل " +"و نوع مختص پروتکل را مشخص می‌کنند، و *cmsg_data* یک شیء :class:`bytes` حاوی " +"داده مرتبط است. آیتم *msg_flags* حاصل یا بیتی (bitwise OR) پرچم‌های مختلفی " +"است که شرایط پیام دریافتی را نشان می‌دهند؛ برای جزئیات، مستندات سیستم خود را" +" ببینید. اگر سوکت دریافت‌کننده متصل نباشد، *address* نشانی سوکت فرستنده است،" +" در صورتی که در دسترس باشد؛ در غیر این صورت، مقدار آن نامشخص است." -msgid "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass file descriptors between processes over an :const:`AF_UNIX` socket. When this facility is used (it is often restricted to :const:`SOCK_STREAM` sockets), :meth:`recvmsg` will return, in its ancillary data, items of the form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is a :class:`bytes` object representing the new file descriptors as a binary array of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an exception after the system call returns, it will first attempt to close any file descriptors received via this mechanism." -msgstr "" +msgid "" +"On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " +"file descriptors between processes over an :const:`AF_UNIX` socket. When " +"this facility is used (it is often restricted to :const:`SOCK_STREAM` " +"sockets), :meth:`recvmsg` will return, in its ancillary data, items of the " +"form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is a " +":class:`bytes` object representing the new file descriptors as a binary " +"array of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an " +"exception after the system call returns, it will first attempt to close any " +"file descriptors received via this mechanism." +msgstr "" +"در برخی از سیستم‌ها، می‌توان از :meth:`sendmsg` و :meth:`recvmsg` برای " +"انتقال توصیف‌گرهای فایل بین فرآیندها از طریق یک سوکت :const:`AF_UNIX` " +"استفاده کرد. هنگامی که از این قابلیت استفاده شود (که اغلب به سوکت‌های " +":const:`SOCK_STREAM` محدود است)، :meth:`recvmsg` در داده‌های جانبی خود، " +"آیتم‌هایی را به شکل ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)`` " +"برمی‌گرداند، که در آن *fds* یک شیء :class:`bytes` است که توصیف‌گرهای فایل " +"جدید را به‌صورت یک آرایه دودویی از نوع بومی :c:expr:`int` در C نشان می‌دهد. " +"اگر :meth:`recvmsg` پس از بازگشت فراخوانی سیستم، استثنایی پرتاب کند، ابتدا " +"تلاش می‌کند هر توصیف‌گر فایل دریافت‌شده از طریق این سازوکار را ببندد." -msgid "Some systems do not indicate the truncated length of ancillary data items which have been only partially received. If an item appears to extend beyond the end of the buffer, :meth:`recvmsg` will issue a :exc:`RuntimeWarning`, and will return the part of it which is inside the buffer provided it has not been truncated before the start of its associated data." -msgstr "" +msgid "" +"Some systems do not indicate the truncated length of ancillary data items " +"which have been only partially received. If an item appears to extend " +"beyond the end of the buffer, :meth:`recvmsg` will issue a " +":exc:`RuntimeWarning`, and will return the part of it which is inside the " +"buffer provided it has not been truncated before the start of its associated" +" data." +msgstr "" +"برخی سیستم‌ها طول بریده‌شده‌ی آیتم‌های داده‌ی جانبی را که تنها به‌طور ناقص " +"دریافت شده‌اند، نشان نمی‌دهند. اگر به نظر برسد آیتمی از انتهای بافر فراتر " +"می‌رود، :meth:`recvmsg` یک :exc:`RuntimeWarning` صادر می‌کند و بخشی از آن را" +" که درون بافر است برمی‌گرداند، به شرطی که پیش از شروع داده‌ی مرتبط آن بریده " +"نشده باشد." -msgid "On systems which support the :const:`!SCM_RIGHTS` mechanism, the following function will receive up to *maxfds* file descriptors, returning the message data and a list containing the descriptors (while ignoring unexpected conditions such as unrelated control messages being received). See also :meth:`sendmsg`. ::" -msgstr "" +msgid "" +"On systems which support the :const:`!SCM_RIGHTS` mechanism, the following " +"function will receive up to *maxfds* file descriptors, returning the message" +" data and a list containing the descriptors (while ignoring unexpected " +"conditions such as unrelated control messages being received). See also " +":meth:`sendmsg`. ::" +msgstr "" +"در سیستم‌هایی که از سازوکار :const:`!SCM_RIGHTS` پشتیبانی می‌کنند، تابع زیر " +"حداکثر *maxfds* توصیف‌گر فایل را دریافت می‌کند و داده پیام و فهرستی حاوی " +"توصیف‌گرها را برمی‌گرداند (در حالی که شرایط غیرمنتظره‌ای مانند دریافت " +"پیام‌های کنترلی نامرتبط را نادیده می‌گیرد). همچنین :meth:`sendmsg` را " +"ببینید. ::" msgid "" "import socket, array\n" @@ -967,15 +2513,51 @@ msgid "" " fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])\n" " return msg, list(fds)" msgstr "" +"import socket, array\n" +"\n" +"def recv_fds(sock, msglen, maxfds):\n" +" fds = array.array(\"i\") # Array of ints\n" +" msg, ancdata, flags, addr = sock.recvmsg(msglen, socket.CMSG_LEN(maxfds * fds.itemsize))\n" +" for cmsg_level, cmsg_type, cmsg_data in ancdata:\n" +" if cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS:\n" +" # Append data, ignoring any truncated integers at the end.\n" +" fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])\n" +" return msg, list(fds)" -msgid "Receive normal data and ancillary data from the socket, behaving as :meth:`recvmsg` would, but scatter the non-ancillary data into a series of buffers instead of returning a new bytes object. The *buffers* argument must be an iterable of objects that export writable buffers (e.g. :class:`bytearray` objects); these will be filled with successive chunks of the non-ancillary data until it has all been written or there are no more buffers. The operating system may set a limit (:func:`~os.sysconf` value ``SC_IOV_MAX``) on the number of buffers that can be used. The *ancbufsize* and *flags* arguments have the same meaning as for :meth:`recvmsg`." -msgstr "" +msgid "" +"Receive normal data and ancillary data from the socket, behaving as " +":meth:`recvmsg` would, but scatter the non-ancillary data into a series of " +"buffers instead of returning a new bytes object. The *buffers* argument " +"must be an iterable of objects that export writable buffers (e.g. " +":class:`bytearray` objects); these will be filled with successive chunks of " +"the non-ancillary data until it has all been written or there are no more " +"buffers. The operating system may set a limit (:func:`~os.sysconf` value " +"``SC_IOV_MAX``) on the number of buffers that can be used. The *ancbufsize*" +" and *flags* arguments have the same meaning as for :meth:`recvmsg`." +msgstr "" +"داده‌های عادی و داده‌های جانبی را از سوکت دریافت می‌کند، همان‌گونه که " +":meth:`recvmsg` عمل می‌کند، اما داده‌های غیرجانبی را به‌جای برگرداندن یک شیء" +" bytes جدید، در مجموعه‌ای از بافرها پخش می‌کند. آرگومان *buffers* باید یک " +"پیمایش‌پذیر از اشیایی باشد که بافرهای قابل‌نوشتن را در دسترس قرار می‌دهند " +"(مانند اشیاء :class:`bytearray`)؛ این بافرها با تکه‌های متوالی از داده‌های " +"غیرجانبی پر می‌شوند تا همه آن داده‌ها نوشته شوند یا دیگر بافری باقی نمانده " +"باشد. ممکن است سیستم‌عامل محدودیتی (مقدار :func:`~os.sysconf` یعنی " +"``SC_IOV_MAX``) برای تعداد بافرهایی که می‌توان از آن‌ها استفاده کرد تعیین " +"کند. آرگومان‌های *ancbufsize* و *flags* همان معنایی را دارند که برای " +":meth:`recvmsg` دارند." -msgid "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, where *nbytes* is the total number of bytes of non-ancillary data written into the buffers, and *ancdata*, *msg_flags* and *address* are the same as for :meth:`recvmsg`." +msgid "" +"The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " +"where *nbytes* is the total number of bytes of non-ancillary data written " +"into the buffers, and *ancdata*, *msg_flags* and *address* are the same as " +"for :meth:`recvmsg`." msgstr "" +"مقدار بازگشتی یک تاپل ۴تایی است: ``(nbytes, ancdata, msg_flags, address)``، " +"که در آن *nbytes* تعداد کل بایت‌های داده غیرجانبی نوشته‌شده در بافرها است، " +"و *ancdata*، *msg_flags* و *address* همانند :meth:`recvmsg` هستند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import socket\n" @@ -990,33 +2572,149 @@ msgid "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" msgstr "" +">>> import socket\n" +">>> s1, s2 = socket.socketpair()\n" +">>> b1 = bytearray(b'----')\n" +">>> b2 = bytearray(b'0123456789')\n" +">>> b3 = bytearray(b'--------------')\n" +">>> s1.send(b'Mary had a little lamb')\n" +"22\n" +">>> s2.recvmsg_into([b1, memoryview(b2)[2:9], b3])\n" +"(22, [], 0, None)\n" +">>> [b1, b2, b3]\n" +"[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -msgid "Receive data from the socket, writing it into *buffer* instead of creating a new bytestring. The return value is a pair ``(nbytes, address)`` where *nbytes* is the number of bytes received and *address* is the address of the socket sending the data. See the Unix manual page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults to zero. The format of *address* depends on the address family --- see :ref:`socket-addresses`." -msgstr "" +msgid "" +"Receive data from the socket, writing it into *buffer* instead of creating a" +" new bytestring. The return value is a pair ``(nbytes, address)`` where " +"*nbytes* is the number of bytes received and *address* is the address of the" +" socket sending the data. See the Unix manual page :manpage:`recv(2)` for " +"the meaning of the optional argument *flags*; it defaults to zero. The " +"format of *address* depends on the address family --- see :ref:`socket-" +"addresses`." +msgstr "" +"داده‌ها را از سوکت دریافت می‌کند و به‌جای ایجاد یک رشته بایتی جدید، آن‌ها را" +" در *buffer* می‌نویسد. مقدار بازگشتی یک جفت ``(nbytes, address)`` است که در " +"آن *nbytes* تعداد بایت‌های دریافت‌شده و *address* نشانی سوکت ارسال‌کننده " +"داده‌ها است. برای آگاهی از معنای آرگومان اختیاری *flags*، به صفحه راهنمای " +"Unix :manpage:`recv(2)` مراجعه کنید؛ مقدار پیش‌فرض آن صفر است. قالب " +"*address* به خانواده نشانی بستگی دارد — به :ref:`socket-addresses` مراجعه " +"کنید." -msgid "Receive up to *nbytes* bytes from the socket, storing the data into a buffer rather than creating a new bytestring. If *nbytes* is not specified (or 0), receive up to the size available in the given buffer. Returns the number of bytes received. See the Unix manual page :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults to zero." -msgstr "" +msgid "" +"Receive up to *nbytes* bytes from the socket, storing the data into a buffer" +" rather than creating a new bytestring. If *nbytes* is not specified (or " +"0), receive up to the size available in the given buffer. Returns the " +"number of bytes received. See the Unix manual page :manpage:`recv(2)` for " +"the meaning of the optional argument *flags*; it defaults to zero." +msgstr "" +"حداکثر *nbytes* بایت را از سوکت دریافت می‌کند و داده‌ها را به جای ایجاد یک " +"رشته بایتی جدید، در یک بافر ذخیره می‌کند. اگر *nbytes* مشخص نشده باشد (یا " +"۰)، حداکثر به اندازه فضای موجود در بافر داده‌شده دریافت می‌شود. تعداد " +"بایت‌های دریافت‌شده را برمی‌گرداند. برای معنای آرگومان اختیاری *flags*، به " +"صفحه راهنمای یونیکس :manpage:`recv(2)` مراجعه کنید؛ مقدار پیش‌فرض آن صفر " +"است." -msgid "Send data to the socket. The socket must be connected to a remote socket. The optional *flags* argument has the same meaning as for :meth:`recv`. Returns the number of bytes sent. Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the application needs to attempt delivery of the remaining data. For further information on this topic, consult the :ref:`socket-howto`." -msgstr "" +msgid "" +"Send data to the socket. The socket must be connected to a remote socket. " +"The optional *flags* argument has the same meaning as for :meth:`recv`. " +"Returns the number of bytes sent. Applications are responsible for checking " +"that all data has been sent; if only some of the data was transmitted, the " +"application needs to attempt delivery of the remaining data. For further " +"information on this topic, consult the :ref:`socket-howto`." +msgstr "" +"داده‌ها را به سوکت ارسال کنید. سوکت باید به یک سوکت راه‌دور متصل باشد. " +"آرگومان اختیاری *flags* همان معنای مورد استفاده در :meth:`recv` را دارد. " +"تعداد بایت‌های ارسال‌شده را برمی‌گرداند. برنامه‌ها مسئول بررسی این هستند که " +"همه داده‌ها ارسال شده‌اند؛ اگر تنها بخشی از داده‌ها منتقل شد، برنامه باید " +"برای ارسال داده‌های باقی‌مانده تلاش کند. برای اطلاعات بیشتر درباره این " +"موضوع، به :ref:`socket-howto` مراجعه کنید." -msgid "Send data to the socket. The socket must be connected to a remote socket. The optional *flags* argument has the same meaning as for :meth:`recv`. Unlike :meth:`send`, this method continues to send data from *bytes* until either all data has been sent or an error occurs. ``None`` is returned on success. On error, an exception is raised, and there is no way to determine how much data, if any, was successfully sent." -msgstr "" +msgid "" +"Send data to the socket. The socket must be connected to a remote socket. " +"The optional *flags* argument has the same meaning as for :meth:`recv`. " +"Unlike :meth:`send`, this method continues to send data from *bytes* until " +"either all data has been sent or an error occurs. ``None`` is returned on " +"success. On error, an exception is raised, and there is no way to determine" +" how much data, if any, was successfully sent." +msgstr "" +"داده‌ها را به سوکت ارسال می‌کند. سوکت باید به یک سوکت راه دور متصل باشد. " +"آرگومان اختیاری *flags* همان معنایی را دارد که برای :meth:`recv` دارد. " +"برخلاف :meth:`send`، این متد به ارسال داده از *bytes* ادامه می‌دهد تا اینکه " +"یا همه داده‌ها ارسال شوند یا خطایی رخ دهد. در صورت موفقیت، ``None`` " +"برگردانده می‌شود. در صورت خطا، استثنایی پرتاب می‌شود و هیچ راهی برای تعیین " +"اینکه چه مقدار داده، در صورت وجود، با موفقیت ارسال شده است، وجود ندارد." -msgid "The socket timeout is no longer reset each time data is sent successfully. The socket timeout is now the maximum total duration to send all data." +msgid "" +"The socket timeout is no longer reset each time data is sent successfully. " +"The socket timeout is now the maximum total duration to send all data." msgstr "" +"مهلت زمانی سوکت دیگر هر بار که داده با موفقیت ارسال می‌شود، بازنشانی نمی‌شود. " +"مهلت زمانی سوکت اکنون حداکثر مدت‌زمان کل برای ارسال تمام داده‌ها است." -msgid "Send data to the socket. The socket should not be connected to a remote socket, since the destination socket is specified by *address*. The optional *flags* argument has the same meaning as for :meth:`recv`. Return the number of bytes sent. The format of *address* depends on the address family --- see :ref:`socket-addresses`." -msgstr "" +msgid "" +"Send data to the socket. The socket should not be connected to a remote " +"socket, since the destination socket is specified by *address*. The " +"optional *flags* argument has the same meaning as for :meth:`recv`. Return " +"the number of bytes sent. The format of *address* depends on the address " +"family --- see :ref:`socket-addresses`." +msgstr "" +"داده را به سوکت ارسال می‌کند. سوکت نباید به یک سوکت دوردست متصل باشد، زیرا " +"سوکت مقصد توسط *address* مشخص می‌شود. آرگومان اختیاری *flags* همان معنایی را" +" دارد که برای :meth:`recv` دارد. تعداد بایت‌های ارسال‌شده را برمی‌گرداند. " +"قالب *address* به خانواده‌ی نشانی بستگی دارد — :ref:`socket-addresses` را " +"ببینید." -msgid "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments ``self``, ``address``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " +"``self``, ``address``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.sendto`` را با آرگومان‌های " +"``self`` و ``address`` پرتاب می‌کند." -msgid "Send normal and ancillary data to the socket, gathering the non-ancillary data from a series of buffers and concatenating it into a single message. The *buffers* argument specifies the non-ancillary data as an iterable of :term:`bytes-like objects ` (e.g. :class:`bytes` objects); the operating system may set a limit (:func:`~os.sysconf` value ``SC_IOV_MAX``) on the number of buffers that can be used. The *ancdata* argument specifies the ancillary data (control messages) as an iterable of zero or more tuples ``(cmsg_level, cmsg_type, cmsg_data)``, where *cmsg_level* and *cmsg_type* are integers specifying the protocol level and protocol-specific type respectively, and *cmsg_data* is a bytes-like object holding the associated data. Note that some systems (in particular, systems without :func:`CMSG_SPACE`) might support sending only one control message per call. The *flags* argument defaults to 0 and has the same meaning as for :meth:`send`. If *address* is supplied and not ``None``, it sets a destination address for the message. The return value is the number of bytes of non-ancillary data sent." -msgstr "" +msgid "" +"Send normal and ancillary data to the socket, gathering the non-ancillary " +"data from a series of buffers and concatenating it into a single message. " +"The *buffers* argument specifies the non-ancillary data as an iterable of " +":term:`bytes-like objects ` (e.g. :class:`bytes` " +"objects); the operating system may set a limit (:func:`~os.sysconf` value " +"``SC_IOV_MAX``) on the number of buffers that can be used. The *ancdata* " +"argument specifies the ancillary data (control messages) as an iterable of " +"zero or more tuples ``(cmsg_level, cmsg_type, cmsg_data)``, where " +"*cmsg_level* and *cmsg_type* are integers specifying the protocol level and " +"protocol-specific type respectively, and *cmsg_data* is a bytes-like object " +"holding the associated data. Note that some systems (in particular, systems" +" without :func:`CMSG_SPACE`) might support sending only one control message " +"per call. The *flags* argument defaults to 0 and has the same meaning as " +"for :meth:`send`. If *address* is supplied and not ``None``, it sets a " +"destination address for the message. The return value is the number of " +"bytes of non-ancillary data sent." +msgstr "" +"داده‌های عادی و جانبی را به سوکت ارسال می‌کند؛ داده‌های غیرجانبی را از " +"مجموعه‌ای از بافرها گردآوری کرده و در یک پیام واحد به هم می‌چسباند. آرگومان" +" *buffers* داده‌های غیرجانبی را به‌صورت یک پیمایش‌پذیر از :term:`اشیاء " +"شبه‌بایت ` مشخص می‌کند (برای مثال اشیاء " +":class:`bytes`)؛ سیستم‌عامل ممکن است محدودیتی (مقدار ``SC_IOV_MAX`` از " +":func:`~os.sysconf`) بر تعداد بافرهای قابل استفاده تعیین کند. آرگومان " +"*ancdata* داده‌های جانبی (پیام‌های کنترلی) را به‌صورت یک پیمایش‌پذیر از صفر یا" +" چند تاپل ``(cmsg_level, cmsg_type, cmsg_data)`` مشخص می‌کند، که در آن " +"*cmsg_level* و *cmsg_type* اعداد صحیحی هستند که به‌ترتیب سطح پروتکل و نوع " +"خاص پروتکل را مشخص می‌کنند، و *cmsg_data* یک شیء شبه‌بایت حاوی داده مرتبط " +"است. توجه داشته باشید که برخی سیستم‌ها (به‌ویژه سیستم‌های بدون " +":func:`CMSG_SPACE`) ممکن است تنها از ارسال یک پیام کنترلی در هر فراخوانی " +"پشتیبانی کنند. آرگومان *flags* به‌طور پیش‌فرض ۰ است و همان معنای " +":meth:`send` را دارد. اگر *address* ارائه شود و ``None`` نباشد، آدرس مقصدی " +"برای پیام تنظیم می‌کند. مقدار بازگشتی تعداد بایت‌های داده غیرجانبی " +"ارسال‌شده است." -msgid "The following function sends the list of file descriptors *fds* over an :const:`AF_UNIX` socket, on systems which support the :const:`!SCM_RIGHTS` mechanism. See also :meth:`recvmsg`. ::" +msgid "" +"The following function sends the list of file descriptors *fds* over an " +":const:`AF_UNIX` socket, on systems which support the :const:`!SCM_RIGHTS` " +"mechanism. See also :meth:`recvmsg`. ::" msgstr "" +"تابع زیر فهرست توصیف‌گرهای پرونده *fds* را از طریق یک سوکت :const:`AF_UNIX` " +"در سیستم‌هایی که از سازوکار :const:`!SCM_RIGHTS` پشتیبانی می‌کنند، ارسال " +"می‌کند. همچنین :meth:`recvmsg` را ببینید. ::" msgid "" "import socket, array\n" @@ -1024,117 +2722,332 @@ msgid "" "def send_fds(sock, msg, fds):\n" " return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array(\"i\", fds))])" msgstr "" +"import socket, array\n" +"\n" +"def send_fds(sock, msg, fds):\n" +" return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array(\"i\", fds))])" -msgid "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments ``self``, ``address``." +msgid "" +"Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments" +" ``self``, ``address``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``socket.sendmsg`` را با آرگومان‌های " +"``self`` و ``address`` پرتاب می‌کند." -msgid "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` socket." +msgid "" +"Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " +"Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " +"socket." msgstr "" +"نسخه‌ی تخصصی :meth:`~socket.sendmsg` برای سوکت :const:`AF_ALG` است. حالت، IV،" +" طول داده‌های مرتبط با AEAD و پرچم‌ها را برای سوکت :const:`AF_ALG` تنظیم " +"می‌کند." -msgid "Send a file until EOF is reached by using high-performance :mod:`os.sendfile` and return the total number of bytes which were sent. *file* must be a regular file object opened in binary mode. If :mod:`os.sendfile` is not available (e.g. Windows) or *file* is not a regular file :meth:`send` will be used instead. *offset* tells from where to start reading the file. If specified, *count* is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is updated on return or also in case of error in which case :meth:`file.tell() ` can be used to figure out the number of bytes which were sent. The socket must be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." -msgstr "" +msgid "" +"Send a file until EOF is reached by using high-performance " +":mod:`os.sendfile` and return the total number of bytes which were sent. " +"*file* must be a regular file object opened in binary mode. If " +":mod:`os.sendfile` is not available (e.g. Windows) or *file* is not a " +"regular file :meth:`send` will be used instead. *offset* tells from where to" +" start reading the file. If specified, *count* is the total number of bytes " +"to transmit as opposed to sending the file until EOF is reached. File " +"position is updated on return or also in case of error in which case " +":meth:`file.tell() ` can be used to figure out the number of" +" bytes which were sent. The socket must be of :const:`SOCK_STREAM` type. " +"Non-blocking sockets are not supported." +msgstr "" +"یک فایل را تا رسیدن به EOF با استفاده از :mod:`os.sendfile` با کارایی بالا " +"ارسال می‌کند و تعداد کل بایت‌های ارسال‌شده را برمی‌گرداند. *file* باید یک " +"شیء فایل معمولی باشد که در حالت دودویی باز شده است. اگر :mod:`os.sendfile` " +"در دسترس نباشد (برای مثال ویندوز) یا *file* یک فایل معمولی نباشد، به‌جای آن " +"از :meth:`send` استفاده خواهد شد. *offset* مشخص می‌کند که خواندن فایل از کجا" +" آغاز شود. در صورت تعیین شدن، *count* تعداد کل بایت‌هایی است که باید منتقل " +"شوند، برخلاف ارسال فایل تا رسیدن به EOF. موقعیت فایل هنگام بازگشت و همچنین " +"در صورت بروز خطا به‌روزرسانی می‌شود؛ در این صورت می‌توان از " +":meth:`file.tell() ` برای تشخیص تعداد بایت‌های ارسال‌شده " +"استفاده کرد. سوکت باید از نوع :const:`SOCK_STREAM` باشد. سوکت‌های " +"غیرمسدودکننده پشتیبانی نمی‌شوند." -msgid "Set the :ref:`inheritable flag ` of the socket's file descriptor or socket's handle." +msgid "" +"Set the :ref:`inheritable flag ` of the socket's file " +"descriptor or socket's handle." msgstr "" +":ref:`پرچم ارث‌پذیری ` توصیف‌گر فایل سوکت یا دسته‌ی سوکت را " +"تنظیم کنید." -msgid "Set blocking or non-blocking mode of the socket: if *flag* is false, the socket is set to non-blocking, else to blocking mode." +msgid "" +"Set blocking or non-blocking mode of the socket: if *flag* is false, the " +"socket is set to non-blocking, else to blocking mode." msgstr "" +"حالت مسدودکننده یا غیرمسدودکننده‌ی سوکت را تنظیم می‌کند: اگر *flag* نادرست " +"باشد، سوکت در حالت غیرمسدودکننده تنظیم می‌شود، در غیر این صورت در حالت " +"مسدودکننده تنظیم می‌شود." -msgid "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" +msgid "" +"This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" +"این متد میان‌بری برای برخی فراخوانی‌های :meth:`~socket.settimeout` است:" msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" -msgstr "" +msgstr "``sock.setblocking(True)`` معادل ``sock.settimeout(None)`` است" msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" -msgstr "" +msgstr "``sock.setblocking(False)`` معادل ``sock.settimeout(0.0)`` است" -msgid "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket.type`." +msgid "" +"The method no longer applies :const:`SOCK_NONBLOCK` flag on " +":attr:`socket.type`." msgstr "" +"این متد دیگر پرچم :const:`SOCK_NONBLOCK` را روی :attr:`socket.type` اعمال " +"نمی‌کند." -msgid "Set a timeout on blocking socket operations. The *value* argument can be a nonnegative real number expressing seconds, or ``None``. If a non-zero value is given, subsequent socket operations will raise a :exc:`timeout` exception if the timeout period *value* has elapsed before the operation has completed. If zero is given, the socket is put in non-blocking mode. If ``None`` is given, the socket is put in blocking mode." -msgstr "" +msgid "" +"Set a timeout on blocking socket operations. The *value* argument can be a " +"nonnegative real number expressing seconds, or ``None``. If a non-zero value" +" is given, subsequent socket operations will raise a :exc:`timeout` " +"exception if the timeout period *value* has elapsed before the operation has" +" completed. If zero is given, the socket is put in non-blocking mode. If " +"``None`` is given, the socket is put in blocking mode." +msgstr "" +"برای عملیات‌های مسدودکننده سوکت یک مهلت (timeout) تنظیم کنید. آرگومان " +"*value* می‌تواند یک عدد حقیقی نامنفی بیان‌کننده ثانیه‌ها، یا ``None`` باشد." +" اگر مقدار غیرصفر داده شود، در عملیات‌های بعدی سوکت، چنانچه دوره مهلت " +"*value* پیش از تکمیل عملیات سپری شده باشد، استثنای :exc:`timeout` پرتاب " +"خواهد شد. اگر ۰ داده شود، سوکت در حالت غیرمسدودکننده قرار می‌گیرد. اگر " +"``None`` داده شود، سوکت در حالت مسدودکننده قرار می‌گیرد." -msgid "For further information, please consult the :ref:`notes on socket timeouts `." +msgid "" +"For further information, please consult the :ref:`notes on socket timeouts " +"`." msgstr "" +"برای اطلاعات بیشتر، لطفاً :ref:`یادداشت‌های مربوط به مهلت‌های زمانی سوکت " +"` را مطالعه کنید." -msgid "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket.type`." +msgid "" +"The method no longer toggles :const:`SOCK_NONBLOCK` flag on " +":attr:`socket.type`." msgstr "" +"این متد دیگر پرچم :const:`SOCK_NONBLOCK` را روی :attr:`socket.type` تغییر " +"وضعیت نمی‌دهد." -msgid "Set the value of the given socket option (see the Unix manual page :manpage:`setsockopt(2)`). The needed symbolic constants are defined in this module (:ref:`!SO_\\* etc. `). The value can be an integer, ``None`` or a :term:`bytes-like object` representing a buffer. In the latter case it is up to the caller to ensure that the bytestring contains the proper bits (see the optional built-in module :mod:`struct` for a way to encode C structures as bytestrings). When *value* is set to ``None``, *optlen* argument is required. It's equivalent to calling :c:func:`!setsockopt` C function with ``optval=NULL`` and ``optlen=optlen``." -msgstr "" +msgid "" +"Set the value of the given socket option (see the Unix manual page " +":manpage:`setsockopt(2)`). The needed symbolic constants are defined in " +"this module (:ref:`!SO_\\* etc. `). The value can be" +" an integer, ``None`` or a :term:`bytes-like object` representing a buffer. " +"In the latter case it is up to the caller to ensure that the bytestring " +"contains the proper bits (see the optional built-in module :mod:`struct` for" +" a way to encode C structures as bytestrings). When *value* is set to " +"``None``, *optlen* argument is required. It's equivalent to calling " +":c:func:`!setsockopt` C function with ``optval=NULL`` and ``optlen=optlen``." +msgstr "" +"مقدار گزینه‌ی سوکت داده‌شده را تنظیم می‌کند (صفحه‌ی راهنمای یونیکس " +":manpage:`setsockopt(2)` را ببینید). ثابت‌های نمادین مورد نیاز در این ماژول " +"تعریف شده‌اند (:ref:`!SO_\\* etc. `). مقدار می‌تواند " +"یک عدد صحیح، ``None`` یا یک :term:`bytes-like object` باشد که نشان‌دهنده‌ی یک" +" بافر است. در حالت آخر، این بر عهده‌ی فراخواننده است که اطمینان حاصل کند " +"رشته‌بایت حاوی بیت‌های مناسب است (برای راهی جهت کدگذاری ساختارهای C به‌صورت " +"رشته‌بایت‌ها، ماژول توکار اختیاری :mod:`struct` را ببینید). هنگامی که " +"*value* روی ``None`` تنظیم شود، آرگومان *optlen* الزامی است. این معادل " +"فراخوانی تابع C :c:func:`!setsockopt` با ``optval=NULL`` و ``optlen=optlen``" +" است." msgid "setsockopt(level, optname, None, optlen: int) form added." -msgstr "" +msgstr "شکل setsockopt(level, optname, None, optlen: int) اضافه شد." -msgid "Shut down one or both halves of the connection. If *how* is :const:`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, further sends are disallowed. If *how* is :const:`SHUT_RDWR`, further sends and receives are disallowed." +msgid "" +"Shut down one or both halves of the connection. If *how* is " +":const:`SHUT_RD`, further receives are disallowed. If *how* is " +":const:`SHUT_WR`, further sends are disallowed. If *how* is " +":const:`SHUT_RDWR`, further sends and receives are disallowed." msgstr "" +"یک یا هر دو نیمه‌ی اتصال را خاموش کنید. اگر *how* برابر :const:`SHUT_RD` " +"باشد، دریافت‌های بعدی مجاز نیستند. اگر *how* برابر :const:`SHUT_WR` باشد، " +"ارسال‌های بعدی مجاز نیستند. اگر *how* برابر :const:`SHUT_RDWR` باشد، " +"ارسال‌ها و دریافت‌های بعدی مجاز نیستند." -msgid "Duplicate a socket and prepare it for sharing with a target process. The target process must be provided with *process_id*. The resulting bytes object can then be passed to the target process using some form of interprocess communication and the socket can be recreated there using :func:`fromshare`. Once this method has been called, it is safe to close the socket since the operating system has already duplicated it for the target process." -msgstr "" +msgid "" +"Duplicate a socket and prepare it for sharing with a target process. The " +"target process must be provided with *process_id*. The resulting bytes " +"object can then be passed to the target process using some form of " +"interprocess communication and the socket can be recreated there using " +":func:`fromshare`. Once this method has been called, it is safe to close the" +" socket since the operating system has already duplicated it for the target " +"process." +msgstr "" +"سوکت را تکثیر می‌کند و آن را برای اشتراک‌گذاری با یک فرایند هدف آماده " +"می‌کند. فرایند هدف باید با *process_id* مشخص شود. سپس می‌توان شیء bytes حاصل" +" را با استفاده از نوعی ارتباط بین‌فرایندی به فرایند هدف منتقل کرد و سوکت را " +"در آن‌جا با استفاده از :func:`fromshare` دوباره ایجاد کرد. پس از فراخوانی " +"این متد، بستن سوکت بی‌خطر است، زیرا سیستم‌عامل پیش‌تر آن را برای فرایند هدف " +"تکثیر کرده است." -msgid "Note that there are no methods :meth:`!read` or :meth:`!write`; use :meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." +msgid "" +"Note that there are no methods :meth:`!read` or :meth:`!write`; use " +":meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument " +"instead." msgstr "" +"توجه داشته باشید که متدهای :meth:`!read` یا :meth:`!write` وجود ندارند؛ در " +"عوض از :meth:`~socket.recv` و :meth:`~socket.send` بدون آرگومان *flags* " +"استفاده کنید." -msgid "Socket objects also have these (read-only) attributes that correspond to the values given to the :class:`~socket.socket` constructor." +msgid "" +"Socket objects also have these (read-only) attributes that correspond to the" +" values given to the :class:`~socket.socket` constructor." msgstr "" +"اشیای سوکت همچنین دارای این ویژگی‌های (فقط‌خواندنی) هستند که با مقادیر " +"داده‌شده به سازنده‌ی :class:`~socket.socket` مطابقت دارند." msgid "The socket family." -msgstr "" +msgstr "خانواده سوکت." msgid "The socket type." -msgstr "" +msgstr "نوع سوکت." msgid "The socket protocol." -msgstr "" +msgstr "پروتکل سوکت." -msgid "The base class of the :class:`~socket.socket` type, re-exported from :mod:`!_socket`. An instance check such as ``isinstance(socket(...), SocketType)`` is true, but ``SocketType`` is not the same as ``type(socket(...))``, which is :class:`~socket.socket` itself." +msgid "" +"The base class of the :class:`~socket.socket` type, re-exported from " +":mod:`!_socket`. An instance check such as ``isinstance(socket(...), " +"SocketType)`` is true, but ``SocketType`` is not the same as " +"``type(socket(...))``, which is :class:`~socket.socket` itself." msgstr "" +"کلاس پایه‌ی نوع :class:`~socket.socket`، دوباره اکسپورت‌شده (re-exported) از" +" :mod:`!_socket`. یک بررسی نمونه مانند ``isinstance(socket(...), " +"SocketType)`` صحیح است، اما ``SocketType`` با ``type(socket(...))`` یکسان " +"نیست، که خودِ :class:`~socket.socket` است." msgid "Notes on socket timeouts" -msgstr "" +msgstr "نکاتی درباره مهلت‌های زمانی سوکت" -msgid "A socket object can be in one of three modes: blocking, non-blocking, or timeout. Sockets are by default always created in blocking mode, but this can be changed by calling :func:`setdefaulttimeout`." +msgid "" +"A socket object can be in one of three modes: blocking, non-blocking, or " +"timeout. Sockets are by default always created in blocking mode, but this " +"can be changed by calling :func:`setdefaulttimeout`." msgstr "" +"یک شیء سوکت می‌تواند در یکی از سه حالت باشد: مسدودکننده، غیرمسدودکننده، یا " +"مهلت زمانی (timeout). سوکت‌ها به‌طور پیش‌فرض همیشه در حالت مسدودکننده ایجاد " +"می‌شوند، اما می‌توان این حالت را با فراخوانی :func:`setdefaulttimeout` تغییر" +" داد." -msgid "In *blocking mode*, operations block until complete or the system returns an error (such as connection timed out)." +msgid "" +"In *blocking mode*, operations block until complete or the system returns an" +" error (such as connection timed out)." msgstr "" +"در *حالت مسدودکننده*، عملیات‌ها تا زمانی که کامل شوند یا سیستم خطایی " +"برگرداند، مسدود می‌شوند (مانند اتمام مهلت اتصال)." -msgid "In *non-blocking mode*, operations fail (with an error that is unfortunately system-dependent) if they cannot be completed immediately: functions from the :mod:`select` module can be used to know when and whether a socket is available for reading or writing." +msgid "" +"In *non-blocking mode*, operations fail (with an error that is unfortunately" +" system-dependent) if they cannot be completed immediately: functions from " +"the :mod:`select` module can be used to know when and whether a socket is " +"available for reading or writing." msgstr "" +"در *حالت غیرمسدود*، عملیات‌ها در صورتی شکست می‌خورند که نتوانند بلافاصله " +"کامل شوند (با خطایی که متأسفانه به سیستم وابسته است): برای تشخیص اینکه چه " +"زمانی و آیا یک سوکت برای خواندن یا نوشتن در دسترس است، می‌توان از توابع " +"ماژول :mod:`select` استفاده کرد." -msgid "In *timeout mode*, operations fail if they cannot be completed within the timeout specified for the socket (they raise a :exc:`timeout` exception) or if the system returns an error." +msgid "" +"In *timeout mode*, operations fail if they cannot be completed within the " +"timeout specified for the socket (they raise a :exc:`timeout` exception) or " +"if the system returns an error." msgstr "" +"در *حالت مهلت (timeout)*، عملیات‌ها ناموفق می‌شوند اگر نتوانند در مهلت " +"تعیین‌شده برای سوکت تکمیل شوند (آن‌ها استثانای :exc:`timeout` را پرتاب " +"می‌کنند) یا اگر سیستم خطایی برگرداند." -msgid "At the operating system level, sockets in *timeout mode* are internally set in non-blocking mode. Also, the blocking and timeout modes are shared between file descriptors and socket objects that refer to the same network endpoint. This implementation detail can have visible consequences if e.g. you decide to use the :meth:`~socket.fileno` of a socket." -msgstr "" +msgid "" +"At the operating system level, sockets in *timeout mode* are internally set " +"in non-blocking mode. Also, the blocking and timeout modes are shared " +"between file descriptors and socket objects that refer to the same network " +"endpoint. This implementation detail can have visible consequences if e.g. " +"you decide to use the :meth:`~socket.fileno` of a socket." +msgstr "" +"در سطح سیستم‌عامل، سوکت‌هایی که در *حالت مهلت زمانی* هستند، به‌صورت داخلی در " +"حالت غیرمسدودکننده تنظیم می‌شوند. همچنین حالت‌های مسدودکننده و مهلت زمانی بین " +"توصیف‌گرهای فایل و اشیای سوکتی که به یک پایانه شبکه یکسان اشاره می‌کنند، " +"مشترک هستند. این جزئیات پیاده‌سازی می‌تواند پیامدهای قابل‌مشاهده‌ای داشته " +"باشد، برای مثال اگر تصمیم بگیرید از :meth:`~socket.fileno` یک سوکت استفاده " +"کنید." msgid "Timeouts and the ``connect`` method" -msgstr "" +msgstr "مهلت‌ها و متد ``connect``" -msgid "The :meth:`~socket.connect` operation is also subject to the timeout setting, and in general it is recommended to call :meth:`~socket.settimeout` before calling :meth:`~socket.connect` or pass a timeout parameter to :meth:`create_connection`. However, the system network stack may also return a connection timeout error of its own regardless of any Python socket timeout setting." -msgstr "" +msgid "" +"The :meth:`~socket.connect` operation is also subject to the timeout " +"setting, and in general it is recommended to call :meth:`~socket.settimeout`" +" before calling :meth:`~socket.connect` or pass a timeout parameter to " +":meth:`create_connection`. However, the system network stack may also " +"return a connection timeout error of its own regardless of any Python socket" +" timeout setting." +msgstr "" +"عملیات :meth:`~socket.connect` نیز تابع تنظیم مهلت زمانی (timeout) است، و " +"به‌طور کلی توصیه می‌شود پیش از فراخوانی :meth:`~socket.connect`، " +":meth:`~socket.settimeout` را فراخوانی کنید یا یک پارامتر timeout به " +":meth:`create_connection` بدهید. با این حال، پشته شبکه سیستم ممکن است " +"صرف‌نظر از هرگونه تنظیم مهلت زمانی سوکت پایتون، خطای مهلت زمانی اتصال خاص " +"خود را نیز برگرداند." msgid "Timeouts and the ``accept`` method" -msgstr "" +msgstr "مهلت‌های زمانی و متد ``accept``" -msgid "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour depends on settings of the listening socket:" +msgid "" +"If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the " +":meth:`~socket.accept` method inherit that timeout. Otherwise, the " +"behaviour depends on settings of the listening socket:" msgstr "" +"اگر :func:`getdefaulttimeout` برابر :const:`None` نباشد، سوکت‌های " +"برگردانده‌شده توسط متد :meth:`~socket.accept` آن مهلت زمانی را به ارث می‌برند." +" در غیر این صورت، رفتار به تنظیمات سوکت گوش‌دهنده بستگی دارد:" -msgid "if the listening socket is in *blocking mode* or in *timeout mode*, the socket returned by :meth:`~socket.accept` is in *blocking mode*;" +msgid "" +"if the listening socket is in *blocking mode* or in *timeout mode*, the " +"socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" +"اگر سوکت گوش‌کننده در *حالت مسدودکننده* یا در *حالت timeout* باشد، سوکت " +"برگردانده‌شده توسط :meth:`~socket.accept` در *حالت مسدودکننده* است؛" -msgid "if the listening socket is in *non-blocking mode*, whether the socket returned by :meth:`~socket.accept` is in blocking or non-blocking mode is operating system-dependent. If you want to ensure cross-platform behaviour, it is recommended you manually override this setting." +msgid "" +"if the listening socket is in *non-blocking mode*, whether the socket " +"returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " +"operating system-dependent. If you want to ensure cross-platform behaviour," +" it is recommended you manually override this setting." msgstr "" +"اگر سوکت شنونده در *حالت غیرمسدود* باشد، مسدود یا غیرمسدود بودن سوکتی که " +":meth:`~socket.accept` برمی‌گرداند، به سیستم‌عامل وابسته است. اگر می‌خواهید " +"رفتار بین‌سکویی را تضمین کنید، توصیه می‌شود این تنظیم را به‌صورت دستی " +"بازنویسی کنید." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "Here are four minimal example programs using the TCP/IP protocol: a server that echoes all data that it receives back (servicing only one client), and a client using it. Note that a server must perform the sequence :func:`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, :meth:`~socket.accept` (possibly repeating the :meth:`~socket.accept` to service more than one client), while a client only needs the sequence :func:`~socket.socket`, :meth:`~socket.connect`. Also note that the server does not :meth:`~socket.sendall`/:meth:`~socket.recv` on the socket it is listening on but on the new socket returned by :meth:`~socket.accept`." -msgstr "" +msgid "" +"Here are four minimal example programs using the TCP/IP protocol: a server " +"that echoes all data that it receives back (servicing only one client), and " +"a client using it. Note that a server must perform the sequence " +":func:`~socket.socket`, :meth:`~socket.bind`, :meth:`~socket.listen`, " +":meth:`~socket.accept` (possibly repeating the :meth:`~socket.accept` to " +"service more than one client), while a client only needs the sequence " +":func:`~socket.socket`, :meth:`~socket.connect`. Also note that the server " +"does not :meth:`~socket.sendall`/:meth:`~socket.recv` on the socket it is " +"listening on but on the new socket returned by :meth:`~socket.accept`." +msgstr "" +"در اینجا چهار برنامه‌ی نمونه‌ی کمینه با استفاده از پروتکل TCP/IP آمده است: " +"سروری که تمام داده‌هایی را که دریافت می‌کند، بازپس می‌فرستد (فقط به یک " +"کلاینت سرویس می‌دهد)، و کلاینتی که از آن استفاده می‌کند. توجه داشته باشید که" +" یک سرور باید دنباله‌ی :func:`~socket.socket`، :meth:`~socket.bind`، " +":meth:`~socket.listen`، :meth:`~socket.accept` را اجرا کند (احتمالاً با " +"تکرار :meth:`~socket.accept` برای سرویس‌دهی به بیش از یک کلاینت)، در حالی که" +" یک کلاینت فقط به دنباله‌ی :func:`~socket.socket`، :meth:`~socket.connect` " +"نیاز دارد. همچنین توجه داشته باشید که سرور " +":meth:`~socket.sendall`/:meth:`~socket.recv` را روی سوکتی که روی آن گوش " +"می‌دهد فراخوانی نمی‌کند، بلکه آن‌ها را روی سوکت جدیدی فراخوانی می‌کند که " +"توسط :meth:`~socket.accept` برگردانده شده است." msgid "The first two examples support IPv4 only. ::" -msgstr "" +msgstr "دو مثال اول فقط از IPv4 پشتیبانی می‌کنند. ::" msgid "" "# Echo server program\n" @@ -1153,6 +3066,21 @@ msgid "" " if not data: break\n" " conn.sendall(data)" msgstr "" +"# Echo server program\n" +"import socket\n" +"\n" +"HOST = '' # Symbolic name meaning all available interfaces\n" +"PORT = 50007 # Arbitrary non-privileged port\n" +"with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n" +" s.bind((HOST, PORT))\n" +" s.listen(1)\n" +" conn, addr = s.accept()\n" +" with conn:\n" +" print('Connected by', addr)\n" +" while True:\n" +" data = conn.recv(1024)\n" +" if not data: break\n" +" conn.sendall(data)" msgid "" "# Echo client program\n" @@ -1166,9 +3094,31 @@ msgid "" " data = s.recv(1024)\n" "print('Received', repr(data))" msgstr "" +"# Echo client program\n" +"import socket\n" +"\n" +"HOST = 'daring.cwi.nl' # The remote host\n" +"PORT = 50007 # The same port as used by the server\n" +"with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n" +" s.connect((HOST, PORT))\n" +" s.sendall(b'Hello, world')\n" +" data = s.recv(1024)\n" +"print('Received', repr(data))" -msgid "The next two examples are identical to the above two, but support both IPv4 and IPv6. The server side will listen to the first address family available (it should listen to both instead). On most of IPv6-ready systems, IPv6 will take precedence and the server may not accept IPv4 traffic. The client side will try to connect to all the addresses returned as a result of the name resolution, and sends traffic to the first one connected successfully. ::" -msgstr "" +msgid "" +"The next two examples are identical to the above two, but support both IPv4 " +"and IPv6. The server side will listen to the first address family available " +"(it should listen to both instead). On most of IPv6-ready systems, IPv6 will" +" take precedence and the server may not accept IPv4 traffic. The client side" +" will try to connect to all the addresses returned as a result of the name " +"resolution, and sends traffic to the first one connected successfully. ::" +msgstr "" +"دو مثال بعدی مشابه دو مثال بالا هستند، اما از هر دو IPv4 و IPv6 پشتیبانی " +"می‌کنند. سمت سرور به اولین خانواده آدرس در دسترس گوش می‌دهد (در عوض باید به " +"هر دو گوش دهد). در بیشتر سیستم‌های آماده‌ی IPv6، IPv6 اولویت دارد و ممکن است" +" سرور ترافیک IPv4 را نپذیرد. سمت کلاینت تلاش می‌کند به تمام آدرس‌های " +"برگردانده‌شده در نتیجه‌ی وضوح نام متصل شود و ترافیک را به اولین آدرسی که با " +"موفقیت به آن متصل شد ارسال می‌کند. ::" msgid "" "# Echo server program\n" @@ -1205,6 +3155,39 @@ msgid "" " if not data: break\n" " conn.send(data)" msgstr "" +"# Echo server program\n" +"import socket\n" +"import sys\n" +"\n" +"HOST = None # Symbolic name meaning all available interfaces\n" +"PORT = 50007 # Arbitrary non-privileged port\n" +"s = None\n" +"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC,\n" +" socket.SOCK_STREAM, 0, socket.AI_PASSIVE):\n" +" af, socktype, proto, canonname, sa = res\n" +" try:\n" +" s = socket.socket(af, socktype, proto)\n" +" except OSError as msg:\n" +" s = None\n" +" continue\n" +" try:\n" +" s.bind(sa)\n" +" s.listen(1)\n" +" except OSError as msg:\n" +" s.close()\n" +" s = None\n" +" continue\n" +" break\n" +"if s is None:\n" +" print('could not open socket')\n" +" sys.exit(1)\n" +"conn, addr = s.accept()\n" +"with conn:\n" +" print('Connected by', addr)\n" +" while True:\n" +" data = conn.recv(1024)\n" +" if not data: break\n" +" conn.send(data)" msgid "" "# Echo client program\n" @@ -1236,9 +3219,43 @@ msgid "" " data = s.recv(1024)\n" "print('Received', repr(data))" msgstr "" +"# Echo client program\n" +"import socket\n" +"import sys\n" +"\n" +"HOST = 'daring.cwi.nl' # The remote host\n" +"PORT = 50007 # The same port as used by the server\n" +"s = None\n" +"for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):\n" +" af, socktype, proto, canonname, sa = res\n" +" try:\n" +" s = socket.socket(af, socktype, proto)\n" +" except OSError as msg:\n" +" s = None\n" +" continue\n" +" try:\n" +" s.connect(sa)\n" +" except OSError as msg:\n" +" s.close()\n" +" s = None\n" +" continue\n" +" break\n" +"if s is None:\n" +" print('could not open socket')\n" +" sys.exit(1)\n" +"with s:\n" +" s.sendall(b'Hello, world')\n" +" data = s.recv(1024)\n" +"print('Received', repr(data))" -msgid "The next example shows how to write a very simple network sniffer with raw sockets on Windows. The example requires administrator privileges to modify the interface::" +msgid "" +"The next example shows how to write a very simple network sniffer with raw " +"sockets on Windows. The example requires administrator privileges to modify " +"the interface::" msgstr "" +"مثال بعدی نشان می‌دهد که چگونه می‌توان یک شنودگر شبکه (network sniffer) " +"بسیار ساده را با سوکت‌های خام (raw sockets) در ویندوز نوشت. این مثال برای " +"تغییر رابط به اختیارات مدیر نیاز دارد::" msgid "" "import socket\n" @@ -1262,18 +3279,50 @@ msgid "" "# disabled promiscuous mode\n" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" +"import socket\n" +"\n" +"# the public network interface\n" +"HOST = socket.gethostbyname(socket.gethostname())\n" +"\n" +"# create a raw socket and bind it to the public interface\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)\n" +"s.bind((HOST, 0))\n" +"\n" +"# Include IP headers\n" +"s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)\n" +"\n" +"# receive all packets\n" +"s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)\n" +"\n" +"# receive a packet\n" +"print(s.recvfrom(65565))\n" +"\n" +"# disabled promiscuous mode\n" +"s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" -msgid "The next example shows how to use the socket interface to communicate to a CAN network using the raw socket protocol. To use CAN with the broadcast manager protocol instead, open a socket with::" +msgid "" +"The next example shows how to use the socket interface to communicate to a " +"CAN network using the raw socket protocol. To use CAN with the broadcast " +"manager protocol instead, open a socket with::" msgstr "" +"مثال بعدی نشان می‌دهد که چگونه از رابط سوکت برای ارتباط با شبکه CAN با " +"استفاده از پروتکل سوکت خام استفاده کنید. در عوض، برای استفاده از CAN با " +"پروتکل مدیر پخش (broadcast manager)، یک سوکت با ... باز کنید::" msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -msgstr "" +msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -msgid "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the socket, you can use the :meth:`socket.send` and :meth:`socket.recv` operations (and their counterparts) on the socket object as usual." +msgid "" +"After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " +"socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " +"operations (and their counterparts) on the socket object as usual." msgstr "" +"پس از مقید کردن سوکت (:const:`CAN_RAW`) یا متصل کردن سوکت " +"(:const:`CAN_BCM`)، می‌توانید مانند معمول از عملیات :meth:`socket.send` و " +":meth:`socket.recv` (و همتاهای آن‌ها) روی شیء سوکت استفاده کنید." msgid "This last example might require special privileges::" -msgstr "" +msgstr "این آخرین مثال ممکن است به دسترسی‌های ویژه‌ای نیاز داشته باشد::" msgid "" "import socket\n" @@ -1314,54 +3363,131 @@ msgid "" " except OSError:\n" " print('Error sending CAN frame')" msgstr "" +"import socket\n" +"import struct\n" +"\n" +"\n" +"# CAN frame packing/unpacking (see 'struct can_frame' in )\n" +"\n" +"can_frame_fmt = \"=IB3x8s\"\n" +"can_frame_size = struct.calcsize(can_frame_fmt)\n" +"\n" +"def build_can_frame(can_id, data):\n" +" can_dlc = len(data)\n" +" data = data.ljust(8, b'\\x00')\n" +" return struct.pack(can_frame_fmt, can_id, can_dlc, data)\n" +"\n" +"def dissect_can_frame(frame):\n" +" can_id, can_dlc, data = struct.unpack(can_frame_fmt, frame)\n" +" return (can_id, can_dlc, data[:can_dlc])\n" +"\n" +"\n" +"# create a raw socket and bind it to the 'vcan0' interface\n" +"s = socket.socket(socket.AF_CAN, socket.SOCK_RAW, socket.CAN_RAW)\n" +"s.bind(('vcan0',))\n" +"\n" +"while True:\n" +" cf, addr = s.recvfrom(can_frame_size)\n" +"\n" +" print('Received: can_id=%x, can_dlc=%x, data=%s' % dissect_can_frame(cf))\n" +"\n" +" try:\n" +" s.send(cf)\n" +" except OSError:\n" +" print('Error sending CAN frame')\n" +"\n" +" try:\n" +" s.send(build_can_frame(0x01, b'\\x01\\x02\\x03'))\n" +" except OSError:\n" +" print('Error sending CAN frame')" -msgid "Running an example several times with too small delay between executions, could lead to this error::" +msgid "" +"Running an example several times with too small delay between executions, " +"could lead to this error::" msgstr "" +"اجرای یک مثال چندین بار با تأخیر بسیار کوتاه میان اجراها، ممکن است منجر به " +"این خطا شود::" msgid "OSError: [Errno 98] Address already in use" -msgstr "" +msgstr "OSError: [Errno 98] نشانی از قبل در حال استفاده است" -msgid "This is because the previous execution has left the socket in a ``TIME_WAIT`` state, and can't be immediately reused." +msgid "" +"This is because the previous execution has left the socket in a " +"``TIME_WAIT`` state, and can't be immediately reused." msgstr "" +"دلیل این امر آن است که اجرای قبلی، سوکت را در وضعیت ``TIME_WAIT`` باقی " +"گذاشته است و نمی‌توان بلافاصله دوباره از آن استفاده کرد." -msgid "There is a :mod:`!socket` flag to set, in order to prevent this, :const:`socket.SO_REUSEADDR`::" +msgid "" +"There is a :mod:`!socket` flag to set, in order to prevent this, " +":const:`socket.SO_REUSEADDR`::" msgstr "" +"برای جلوگیری از این موضوع، یک پرچم :mod:`!socket` برای تنظیم وجود دارد: " +":const:`socket.SO_REUSEADDR`::" msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" msgstr "" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" +"s.bind((HOST, PORT))" -msgid "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in ``TIME_WAIT`` state, without waiting for its natural timeout to expire." +msgid "" +"the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " +"``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" +"پرچم :data:`SO_REUSEADDR` به هسته می‌گوید که از یک سوکت محلی در وضعیت " +"``TIME_WAIT`` دوباره استفاده کند، بدون آنکه منتظر بماند مهلت زمانی طبیعی آن " +"منقضی شود." -msgid "For an introduction to socket programming (in C), see the following papers:" +msgid "" +"For an introduction to socket programming (in C), see the following papers:" msgstr "" +"برای آشنایی با برنامه‌نویسی سوکت (به زبان C)، مقاله‌های زیر را ببینید:" -msgid "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart Sechrest" -msgstr "" +msgid "" +"*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " +"Sechrest" +msgstr "*آموزش مقدماتی ارتباط بین‌فرایندی 4.3BSD*، اثر Stuart Sechrest" -msgid "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. Leffler et al," +msgid "" +"*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " +"Leffler et al," msgstr "" +"*آموزش پیشرفته ارتباط بین‌فرایندی 4.3BSD*، اثر Samuel J. Leffler و دیگران،" -msgid "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections PS1:7 and PS1:8). The platform-specific reference material for the various socket-related system calls are also a valuable source of information on the details of socket semantics. For Unix, refer to the manual pages; for Windows, see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers may want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv6." -msgstr "" +msgid "" +"both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " +"PS1:7 and PS1:8). The platform-specific reference material for the various " +"socket-related system calls are also a valuable source of information on the" +" details of socket semantics. For Unix, refer to the manual pages; for " +"Windows, see the WinSock (or Winsock 2) specification. For IPv6-ready APIs," +" readers may want to refer to :rfc:`3493` titled Basic Socket Interface " +"Extensions for IPv6." +msgstr "" +"هر دو در UNIX Programmer's Manual، Supplementary Documents 1 (بخش‌های PS1:7 " +"و PS1:8). مستندات مرجع مختص هر سکو برای فراخوانی‌های سیستمی مختلف مرتبط با " +"سوکت نیز منبع ارزشمندی برای اطلاعات درباره‌ی جزئیات معناشناسی سوکت است. برای " +"Unix، به صفحات راهنما مراجعه کنید؛ برای Windows، مشخصات WinSock (یا Winsock " +"2) را ببینید. برای APIهای آماده برای IPv6، خوانندگان ممکن است بخواهند به " +":rfc:`3493` با عنوان Basic Socket Interface Extensions for IPv6 مراجعه کنند." msgid "object" -msgstr "" +msgstr "شیء" msgid "socket" -msgstr "" +msgstr "سوکت" msgid "I/O control" -msgstr "" +msgstr "کنترل ورودی/خروجی" msgid "buffering" -msgstr "" +msgstr "بافرینگ" msgid "module" -msgstr "" +msgstr "ماژول" msgid "struct" -msgstr "" +msgstr "struct" diff --git a/library/socketserver.po b/library/socketserver.po index 1714ed9dd..d5d3be137 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" +"PO-Revision-Date: 2026-08-28 11:35+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,51 +23,140 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!socketserver` --- A framework for network servers" -msgstr "" +msgstr ":mod:`!socketserver` --- چارچوبی برای کارسازهای شبکه" msgid "**Source code:** :source:`Lib/socketserver.py`" -msgstr "" +msgstr ":source:`Lib/socketserver.py`" -msgid "The :mod:`!socketserver` module simplifies the task of writing network servers." -msgstr "" +msgid "" +"The :mod:`!socketserver` module simplifies the task of writing network " +"servers." +msgstr "ماژول :mod:`!socketserver` کار نوشتن سرورهای شبکه را ساده‌تر می‌کند." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. " +"See :ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات " +"بیشتر :ref:`wasm-availability` را ببینید." msgid "There are four basic concrete server classes:" -msgstr "" +msgstr "چهار کلاس سرور عینی پایه وجود دارد:" -msgid "This uses the internet TCP protocol, which provides for continuous streams of data between the client and server. If *bind_and_activate* is true, the constructor automatically attempts to invoke :meth:`~BaseServer.server_bind` and :meth:`~BaseServer.server_activate`. The other parameters are passed to the :class:`BaseServer` base class." -msgstr "" +msgid "" +"This uses the internet TCP protocol, which provides for continuous streams " +"of data between the client and server. If *bind_and_activate* is true, the " +"constructor automatically attempts to " +"invoke :meth:`~BaseServer.server_bind` " +"and :meth:`~BaseServer.server_activate`. The other parameters are passed " +"to the :class:`BaseServer` base class." +msgstr "" +"این از پروتکل TCP اینترنتی استفاده می‌کند، که جریان‌های پیوسته‌ای از داده‌ها را " +"بین کلاینت و سرور فراهم می‌کند. اگر *bind_and_activate* مقدار true داشته " +"باشد، سازنده به‌طور خودکار تلاش می‌کند :meth:`~BaseServer.server_bind` " +"و :meth:`~BaseServer.server_activate` را فراخوانی کند. سایر پارامترها به " +"کلاس پایه‌ی :class:`BaseServer` ارسال می‌شوند." -msgid "This uses datagrams, which are discrete packets of information that may arrive out of order or be lost while in transit. The parameters are the same as for :class:`TCPServer`." +msgid "" +"This uses datagrams, which are discrete packets of information that may " +"arrive out of order or be lost while in transit. The parameters are the " +"same as for :class:`TCPServer`." msgstr "" +"این از دیتاگرام‌ها استفاده می‌کند، که بسته‌های گسسته‌ای از اطلاعات هستند که " +"ممکن است خارج از ترتیب برسند یا در حین انتقال گم شوند. پارامترها همان " +"پارامترهای :class:`TCPServer` هستند." -msgid "These more infrequently used classes are similar to the TCP and UDP classes, but use Unix domain sockets; they're not available on non-Unix platforms. The parameters are the same as for :class:`TCPServer`." +msgid "" +"These more infrequently used classes are similar to the TCP and UDP " +"classes, but use Unix domain sockets; they're not available on non-Unix " +"platforms. The parameters are the same as for :class:`TCPServer`." msgstr "" +"این کلاس‌ها که کمتر استفاده می‌شوند، مشابه کلاس‌های TCP و UDP هستند، اما از " +"سوکت‌های دامنه Unix استفاده می‌کنند؛ آن‌ها در پلتفرم‌های غیر Unix در دسترس " +"نیستند. پارامترها همان پارامترهای :class:`TCPServer` هستند." -msgid "These four classes process requests :dfn:`synchronously`; each request must be completed before the next request can be started. This isn't suitable if each request takes a long time to complete, because it requires a lot of computation, or because it returns a lot of data which the client is slow to process. The solution is to create a separate process or thread to handle each request; the :class:`ForkingMixIn` and :class:`ThreadingMixIn` mix-in classes can be used to support asynchronous behaviour." -msgstr "" +msgid "" +"These four classes process requests :dfn:`synchronously`; each request must " +"be completed before the next request can be started. This isn't suitable " +"if each request takes a long time to complete, because it requires a lot of " +"computation, or because it returns a lot of data which the client is slow " +"to process. The solution is to create a separate process or thread to " +"handle each request; the :class:`ForkingMixIn` and :class:`ThreadingMixIn` " +"mix-in classes can be used to support asynchronous behaviour." +msgstr "" +"این چهار کلاس درخواست‌ها را به‌صورت :dfn:`همگام ` پردازش " +"می‌کنند؛ هر درخواست باید پیش از آنکه درخواست بعدی بتواند آغاز شود، کامل شود. " +"اگر کامل شدن هر درخواست زمان زیادی طول بکشد، این مناسب نیست؛ خواه به این " +"دلیل که به محاسبات زیادی نیاز دارد، خواه به این دلیل که داده‌های زیادی " +"برمی‌گرداند که کلاینت در پردازش آن‌ها کند است. راه‌حل، ایجاد یک فرایند یا نخ " +"جداگانه برای مدیریت هر درخواست است؛ می‌توان از کلاس‌های میکس‌این (mix-" +"in) :class:`ForkingMixIn` و :class:`ThreadingMixIn` برای پشتیبانی از رفتار " +"ناهمگام استفاده کرد." -msgid "Creating a server requires several steps. First, you must create a request handler class by subclassing the :class:`BaseRequestHandler` class and overriding its :meth:`~BaseRequestHandler.handle` method; this method will process incoming requests. Second, you must instantiate one of the server classes, passing it the server's address and the request handler class. It is recommended to use the server in a :keyword:`with` statement. Then call the :meth:`~BaseServer.handle_request` or :meth:`~BaseServer.serve_forever` method of the server object to process one or many requests. Finally, call :meth:`~BaseServer.server_close` to close the socket (unless you used a :keyword:`!with` statement)." -msgstr "" +msgid "" +"Creating a server requires several steps. First, you must create a request " +"handler class by subclassing the :class:`BaseRequestHandler` class and " +"overriding its :meth:`~BaseRequestHandler.handle` method; this method will " +"process incoming requests. Second, you must instantiate one of the server " +"classes, passing it the server's address and the request handler class. It " +"is recommended to use the server in a :keyword:`with` statement. Then call " +"the :meth:`~BaseServer.handle_request` or :meth:`~BaseServer.serve_forever` " +"method of the server object to process one or many requests. Finally, " +"call :meth:`~BaseServer.server_close` to close the socket (unless you used " +"a :keyword:`!with` statement)." +msgstr "" +"ایجاد یک سرور به چند مرحله نیاز دارد. ابتدا، شما باید با زیرکلاس‌سازی از " +"کلاس :class:`BaseRequestHandler` و بازنویسی " +"متد :meth:`~BaseRequestHandler.handle` آن، یک کلاس رسیدگی به درخواست ایجاد " +"کنید؛ این متد درخواست‌های ورودی را پردازش می‌کند. در مرحله دوم، شما باید یکی " +"از کلاس‌های سرور را نمونه‌سازی کنید و آدرس سرور و کلاس رسیدگی به درخواست را " +"به آن بدهید. توصیه می‌شود از سرور در یک دستور :keyword:`with` استفاده کنید. " +"سپس متد :meth:`~BaseServer.handle_request` " +"یا :meth:`~BaseServer.serve_forever` شیء سرور را برای پردازش یک یا چند " +"درخواست فراخوانی کنید. در نهایت، برای بستن " +"سوکت، :meth:`~BaseServer.server_close` را فراخوانی کنید (مگر اینکه از یک " +"دستور :keyword:`!with` استفاده کرده باشید)." -msgid "When inheriting from :class:`ThreadingMixIn` for threaded connection behavior, you should explicitly declare how you want your threads to behave on an abrupt shutdown. The :class:`ThreadingMixIn` class defines an attribute *daemon_threads*, which indicates whether or not the server should wait for thread termination. You should set the flag explicitly if you would like threads to behave autonomously; the default is :const:`False`, meaning that Python will not exit until all threads created by :class:`ThreadingMixIn` have exited." -msgstr "" +msgid "" +"When inheriting from :class:`ThreadingMixIn` for threaded connection " +"behavior, you should explicitly declare how you want your threads to behave " +"on an abrupt shutdown. The :class:`ThreadingMixIn` class defines an " +"attribute *daemon_threads*, which indicates whether or not the server " +"should wait for thread termination. You should set the flag explicitly if " +"you would like threads to behave autonomously; the default " +"is :const:`False`, meaning that Python will not exit until all threads " +"created by :class:`ThreadingMixIn` have exited." +msgstr "" +"هنگام ارث‌بری از :class:`ThreadingMixIn` برای رفتار اتصال نخی، باید به‌صراحت " +"مشخص کنید که می‌خواهید نخ‌های شما در زمان خاموش شدن ناگهانی چگونه رفتار کنند. " +"کلاس :class:`ThreadingMixIn` ویژگی *daemon_threads* را تعریف می‌کند، که نشان " +"می‌دهد آیا سرور باید منتظر پایان نخ‌ها بماند یا خیر. اگر می‌خواهید نخ‌ها مستقل " +"رفتار کنند، باید این پرچم را به‌صراحت تنظیم کنید؛ مقدار " +"پیش‌فرض :const:`False` است، به این معنا که پایتون خارج نخواهد شد، مگر آنکه " +"همه‌ی نخ‌های ایجادشده توسط :class:`ThreadingMixIn` خارج شده باشند." -msgid "Server classes have the same external methods and attributes, no matter what network protocol they use." +msgid "" +"Server classes have the same external methods and attributes, no matter " +"what network protocol they use." msgstr "" +"کلاس‌های سرور، صرف‌نظر از پروتکل شبکه‌ای که استفاده می‌کنند، متدها و ویژگی‌های " +"بیرونی یکسانی دارند." msgid "Server Creation Notes" -msgstr "" +msgstr "نکات ایجاد سرور" -msgid "There are five classes in an inheritance diagram, four of which represent synchronous servers of four types::" +msgid "" +"There are five classes in an inheritance diagram, four of which represent " +"synchronous servers of four types::" msgstr "" +"در یک نمودار وراثت، پنج کلاس وجود دارد که چهار مورد از آن‌ها نشان‌دهنده‌ی " +"سرورهای همگام از چهار نوع هستند::" msgid "" "+------------+\n" @@ -84,194 +173,561 @@ msgid "" "| UDPServer |------->| UnixDatagramServer |\n" "+-----------+ +--------------------+" msgstr "" +"+------------+\n" +"| BaseServer |\n" +"+------------+\n" +" |\n" +" v\n" +"+-----------+ +------------------+\n" +"| TCPServer |------->| UnixStreamServer |\n" +"+-----------+ +------------------+\n" +" |\n" +" v\n" +"+-----------+ +--------------------+\n" +"| UDPServer |------->| UnixDatagramServer |\n" +"+-----------+ +--------------------+" -msgid "Note that :class:`UnixDatagramServer` derives from :class:`UDPServer`, not from :class:`UnixStreamServer` --- the only difference between an IP and a Unix server is the address family." +msgid "" +"Note that :class:`UnixDatagramServer` derives from :class:`UDPServer`, not " +"from :class:`UnixStreamServer` --- the only difference between an IP and a " +"Unix server is the address family." msgstr "" +"توجه داشته باشید که :class:`UnixDatagramServer` از :class:`UDPServer` مشتق " +"شده است، نه از :class:`UnixStreamServer` --- تنها تفاوت بین یک سرور IP و یک " +"سرور Unix، خانواده نشانی است." -msgid "Forking and threading versions of each type of server can be created using these mix-in classes. For instance, :class:`ThreadingUDPServer` is created as follows::" +msgid "" +"Forking and threading versions of each type of server can be created using " +"these mix-in classes. For instance, :class:`ThreadingUDPServer` is created " +"as follows::" msgstr "" +"نسخه‌های forking و threading هر نوع سرور را می‌توان با استفاده از این کلاس‌های " +"میکس‌اینایجاد کرد. برای مثال، :class:`ThreadingUDPServer` به صورت " +"زیر ایجاد می‌شود::" msgid "" "class ThreadingUDPServer(ThreadingMixIn, UDPServer):\n" " pass" msgstr "" +"class ThreadingUDPServer(ThreadingMixIn, UDPServer):\n" +" pass" -msgid "The mix-in class comes first, since it overrides a method defined in :class:`UDPServer`. Setting the various attributes also changes the behavior of the underlying server mechanism." +msgid "" +"The mix-in class comes first, since it overrides a method defined " +"in :class:`UDPServer`. Setting the various attributes also changes the " +"behavior of the underlying server mechanism." msgstr "" +"کلاس میکس‌اینابتدا قرار می‌گیرد، زیرا متدی را که " +"در :class:`UDPServer` تعریف‌شده است، بازنویسی می‌کند. تنظیم ویژگی‌های مختلف " +"نیز رفتار سازوکار زیربنایی سرور را تغییر می‌دهد." -msgid ":class:`ForkingMixIn` and the Forking classes mentioned below are only available on POSIX platforms that support :func:`~os.fork`." +msgid "" +":class:`ForkingMixIn` and the Forking classes mentioned below are only " +"available on POSIX platforms that support :func:`~os.fork`." msgstr "" +":class:`ForkingMixIn` و کلاس‌های Forking ذکرشده در زیر، فقط در پلتفرم‌های " +"POSIX که از :func:`~os.fork` پشتیبانی می‌کنند، در دسترس هستند." -msgid ":meth:`ForkingMixIn.server_close ` waits until all child processes complete, except if :attr:`block_on_close` attribute is ``False``." +msgid "" +":meth:`ForkingMixIn.server_close ` waits until all " +"child processes complete, except if :attr:`block_on_close` attribute is " +"``False``." msgstr "" +":meth:`ForkingMixIn.server_close ` منتظر می‌ماند تا " +"همه فرایندهای فرزند به پایان برسند، مگر اینکه ویژگی :attr:`block_on_close` " +"برابر ``False`` باشد." -msgid ":meth:`ThreadingMixIn.server_close ` waits until all non-daemon threads complete, except if :attr:`block_on_close` attribute is ``False``." +msgid "" +":meth:`ThreadingMixIn.server_close ` waits until " +"all non-daemon threads complete, except if :attr:`block_on_close` attribute " +"is ``False``." msgstr "" +":meth:`ThreadingMixIn.server_close ` منتظر می‌ماند " +"تا تمام نخ‌های غیردیمن به پایان برسند، مگر اینکه " +"ویژگی :attr:`block_on_close` برابر ``False`` باشد." -msgid "Specify how many child processes will exist to handle requests at a time for :class:`ForkingMixIn`. If the limit is reached, new requests will wait until one child process has finished." +msgid "" +"Specify how many child processes will exist to handle requests at a time " +"for :class:`ForkingMixIn`. If the limit is reached, new requests will wait " +"until one child process has finished." msgstr "" +"تعیین کنید که در :class:`ForkingMixIn` چند فرایند فرزند برای رسیدگی همزمان " +"به درخواست‌ها وجود خواهند داشت. اگر به محدودیت رسیده شود، درخواست‌های جدید " +"منتظر می‌مانند تا یک فرایند فرزند به پایان برسد." -msgid "For :class:`ThreadingMixIn` use daemonic threads by setting :data:`ThreadingMixIn.daemon_threads ` to ``True`` to not wait until threads complete." +msgid "" +"For :class:`ThreadingMixIn` use daemonic threads by " +"setting :data:`ThreadingMixIn.daemon_threads ` to ``True`` " +"to not wait until threads complete." msgstr "" +"برای :class:`ThreadingMixIn`، با تنظیم :data:`ThreadingMixIn.daemon_threads " +"` روی ``True`` از نخ‌های daemon استفاده کنید تا منتظر تکمیل " +"شدن نخ‌ها نمانید." -msgid ":meth:`ForkingMixIn.server_close ` and :meth:`ThreadingMixIn.server_close ` now waits until all child processes and non-daemonic threads complete. Add a new :attr:`ForkingMixIn.block_on_close ` class attribute to opt-in for the pre-3.7 behaviour." -msgstr "" +msgid "" +":meth:`ForkingMixIn.server_close ` " +"and :meth:`ThreadingMixIn.server_close ` now waits " +"until all child processes and non-daemonic threads complete. Add a " +"new :attr:`ForkingMixIn.block_on_close ` class attribute to " +"opt-in for the pre-3.7 behaviour." +msgstr "" +":meth:`ForkingMixIn.server_close ` " +"و :meth:`ThreadingMixIn.server_close ` اکنون تا " +"زمانی که تمام فرآیندهای فرزند و نخ‌های غیر daemon به پایان برسند، صبر " +"می‌کنند. یک ویژگی کلاس جدید :attr:`ForkingMixIn.block_on_close " +"` برای فعال‌سازی رفتار پیش از 3.7 افزوده شده است." msgid "These classes are pre-defined using the mix-in classes." -msgstr "" +msgstr "این کلاس‌ها از پیش با استفاده از کلاس‌های میکس‌این تعریف‌شده‌اند." -msgid "The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes were added." +msgid "" +"The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes " +"were added." msgstr "" +"کلاس‌های ``ForkingUnixStreamServer`` و ``ForkingUnixDatagramServer`` افزوده " +"شدند." -msgid "To implement a service, you must derive a class from :class:`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` method. You can then run various versions of the service by combining one of the server classes with your request handler class. The request handler class must be different for datagram or stream services. This can be hidden by using the handler subclasses :class:`StreamRequestHandler` or :class:`DatagramRequestHandler`." -msgstr "" +msgid "" +"To implement a service, you must derive a class " +"from :class:`BaseRequestHandler` and redefine " +"its :meth:`~BaseRequestHandler.handle` method. You can then run various " +"versions of the service by combining one of the server classes with your " +"request handler class. The request handler class must be different for " +"datagram or stream services. This can be hidden by using the handler " +"subclasses :class:`StreamRequestHandler` or :class:`DatagramRequestHandler`." +msgstr "" +"برای پیاده‌سازی یک سرویس، باید کلاسی را از :class:`BaseRequestHandler` مشتق " +"کنید و متد :meth:`~BaseRequestHandler.handle` آن را بازتعریف کنید. سپس " +"می‌توانید نسخه‌های گوناگونی از سرویس را با ترکیب یکی از کلاس‌های سرور با کلاس " +"هندلر درخواست خود اجرا کنید. کلاس هندلر درخواست باید برای سرویس‌های " +"دیتاگرامی یا جریانی متفاوت باشد. این موضوع را می‌توان با استفاده از " +"زیرکلاس‌های هندلر :class:`StreamRequestHandler` " +"یا :class:`DatagramRequestHandler` پنهان کرد." -msgid "Of course, you still have to use your head! For instance, it makes no sense to use a forking server if the service contains state in memory that can be modified by different requests, since the modifications in the child process would never reach the initial state kept in the parent process and passed to each child. In this case, you can use a threading server, but you will probably have to use locks to protect the integrity of the shared data." -msgstr "" +msgid "" +"Of course, you still have to use your head! For instance, it makes no " +"sense to use a forking server if the service contains state in memory that " +"can be modified by different requests, since the modifications in the child " +"process would never reach the initial state kept in the parent process and " +"passed to each child. In this case, you can use a threading server, but " +"you will probably have to use locks to protect the integrity of the shared " +"data." +msgstr "" +"البته، همچنان باید عقل خود را به کار ببرید! برای مثال، اگر سرویس دارای " +"وضعیتی در حافظه باشد که با درخواست‌های مختلف قابل تغییر باشد، استفاده از یک " +"سرور فورک‌کننده (forking server) منطقی نیست، زیرا تغییرات ایجادشده در فرایند " +"فرزند هرگز به وضعیت اولیه‌ای که در فرایند والد نگهداری می‌شود و به هر فرایند " +"فرزند منتقل می‌شود، نمی‌رسند. در این حالت، می‌توانید از یک سرور نخی (threading " +"server) استفاده کنید، اما احتمالاً مجبور خواهید بود برای محافظت از یکپارچگی " +"داده‌های مشترک از قفل‌ها استفاده کنید." -msgid "On the other hand, if you are building an HTTP server where all data is stored externally (for instance, in the file system), a synchronous class will essentially render the service \"deaf\" while one request is being handled -- which may be for a very long time if a client is slow to receive all the data it has requested. Here a threading or forking server is appropriate." -msgstr "" +msgid "" +"On the other hand, if you are building an HTTP server where all data is " +"stored externally (for instance, in the file system), a synchronous class " +"will essentially render the service \"deaf\" while one request is being " +"handled -- which may be for a very long time if a client is slow to receive " +"all the data it has requested. Here a threading or forking server is " +"appropriate." +msgstr "" +"از سوی دیگر، اگر در حال ساخت یک سرور HTTP هستید که تمام داده‌ها به‌صورت خارجی " +"ذخیره می‌شوند (برای نمونه، در فایل‌سیستم)، یک کلاس همگام عملاً سرویس را در حین " +"رسیدگی به یک درخواست «کر» می‌کند — که اگر کلاینت در دریافت تمام داده‌هایی که " +"درخواست کرده است کند باشد، ممکن است بسیار طول بکشد. در اینجا یک سرور نخ‌بندی " +"(threading) یا فورک‌کننده (forking) مناسب است." -msgid "In some cases, it may be appropriate to process part of a request synchronously, but to finish processing in a forked child depending on the request data. This can be implemented by using a synchronous server and doing an explicit fork in the request handler class :meth:`~BaseRequestHandler.handle` method." +msgid "" +"In some cases, it may be appropriate to process part of a request " +"synchronously, but to finish processing in a forked child depending on the " +"request data. This can be implemented by using a synchronous server and " +"doing an explicit fork in the request handler " +"class :meth:`~BaseRequestHandler.handle` method." msgstr "" +"در برخی موارد، ممکن است مناسب باشد بخشی از یک درخواست به‌صورت همگام پردازش " +"شود، اما تکمیل پردازش در یک فرزند forkشده، بسته به داده‌های درخواست، انجام " +"شود. این کار را می‌توان با استفاده از یک سرور همگام و انجام یک fork صریح در " +"متد :meth:`~BaseRequestHandler.handle` کلاس مدیریت درخواست پیاده‌سازی کرد." -msgid "Another approach to handling multiple simultaneous requests in an environment that supports neither threads nor :func:`~os.fork` (or where these are too expensive or inappropriate for the service) is to maintain an explicit table of partially finished requests and to use :mod:`selectors` to decide which request to work on next (or whether to handle a new incoming request). This is particularly important for stream services where each client can potentially be connected for a long time (if threads or subprocesses cannot be used)." -msgstr "" +msgid "" +"Another approach to handling multiple simultaneous requests in an " +"environment that supports neither threads nor :func:`~os.fork` (or where " +"these are too expensive or inappropriate for the service) is to maintain an " +"explicit table of partially finished requests and to use :mod:`selectors` " +"to decide which request to work on next (or whether to handle a new " +"incoming request). This is particularly important for stream services " +"where each client can potentially be connected for a long time (if threads " +"or subprocesses cannot be used)." +msgstr "" +"رویکردی دیگر برای رسیدگی به چندین درخواست همزمان در محیطی که از هیچ‌کدام از " +"نخ‌ها و :func:`~os.fork` پشتیبانی نمی‌کند (یا در شرایطی که این موارد بیش از " +"حد پرهزینه یا برای سرویس نامناسب باشند)، نگه‌داری از یک جدول آشکار از " +"درخواست‌های نیمه‌تمام و استفاده از :mod:`selectors` برای تصمیم‌گیری درباره‌ی " +"این‌که بعداً روی کدام درخواست کار شود (یا این‌که آیا باید به یک درخواست ورودی " +"جدید رسیدگی کرد) است. این موضوع به‌ویژه برای سرویس‌های جریانی اهمیت دارد که " +"در آن‌ها هر کلاینت می‌تواند به‌طور بالقوه برای مدت طولانی متصل بماند (اگر " +"نتوان از نخ‌ها یا زیرفرآیندها استفاده کرد)." msgid "Server Objects" -msgstr "" +msgstr "اشیای سرور" -msgid "This is the superclass of all Server objects in the module. It defines the interface, given below, but does not implement most of the methods, which is done in subclasses. The two parameters are stored in the respective :attr:`server_address` and :attr:`RequestHandlerClass` attributes." +msgid "" +"This is the superclass of all Server objects in the module. It defines the " +"interface, given below, but does not implement most of the methods, which " +"is done in subclasses. The two parameters are stored in the " +"respective :attr:`server_address` and :attr:`RequestHandlerClass` " +"attributes." msgstr "" +"این ابرکلاس تمام اشیای Server در ماژول است. این کلاس رابطی را که در ادامه " +"آمده است تعریف می‌کند، اما بیشتر متدها را پیاده‌سازی نمی‌کند؛ این کار در " +"زیرکلاس‌ها انجام می‌شود. دو پارامتر به‌ترتیب در " +"ویژگی‌های :attr:`server_address` و :attr:`RequestHandlerClass` ذخیره می‌شوند." -msgid "Return an integer file descriptor for the socket on which the server is listening. This function is most commonly passed to :mod:`selectors`, to allow monitoring multiple servers in the same process." +msgid "" +"Return an integer file descriptor for the socket on which the server is " +"listening. This function is most commonly passed to :mod:`selectors`, to " +"allow monitoring multiple servers in the same process." msgstr "" +"یک توصیف‌گر فایل (file descriptor) از نوع عدد صحیح برای سوکتی که سرور به آن " +"گوش می‌دهد، برمی‌گرداند. این تابع معمولاً به :mod:`selectors` داده می‌شود تا " +"امکان پایش چندین سرور در یک فرایند فراهم شود." -msgid "Process a single request. This function calls the following methods in order: :meth:`get_request`, :meth:`verify_request`, and :meth:`process_request`. If the user-provided :meth:`~BaseRequestHandler.handle` method of the handler class raises an exception, the server's :meth:`handle_error` method will be called. If no request is received within :attr:`timeout` seconds, :meth:`handle_timeout` will be called and :meth:`handle_request` will return." -msgstr "" +msgid "" +"Process a single request. This function calls the following methods in " +"order: :meth:`get_request`, :meth:`verify_request`, " +"and :meth:`process_request`. If the user-" +"provided :meth:`~BaseRequestHandler.handle` method of the handler class " +"raises an exception, the server's :meth:`handle_error` method will be " +"called. If no request is received within :attr:`timeout` " +"seconds, :meth:`handle_timeout` will be called and :meth:`handle_request` " +"will return." +msgstr "" +"یک درخواست واحد را پردازش می‌کند. این تابع متدهای زیر را به‌ترتیب فراخوانی " +"می‌کند: :meth:`get_request`، :meth:`verify_request` " +"و :meth:`process_request`. اگر متد :meth:`~BaseRequestHandler.handle` " +"ارائه‌شده توسط کاربر در کلاس هندلر (handler) استثنایی پرتاب کند، " +"متد :meth:`handle_error` سرور فراخوانی خواهد شد. اگر هیچ درخواستی " +"ظرف :attr:`timeout` ثانیه دریافت نشود، :meth:`handle_timeout` فراخوانی " +"خواهد شد و :meth:`handle_request` بازگشت خواهد کرد." -msgid "Handle requests until an explicit :meth:`shutdown` request. Poll for shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` attribute. It also calls :meth:`service_actions`, which may be used by a subclass or mixin to provide actions specific to a given service. For example, the :class:`ForkingMixIn` class uses :meth:`service_actions` to clean up zombie child processes." -msgstr "" +msgid "" +"Handle requests until an explicit :meth:`shutdown` request. Poll for " +"shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " +"attribute. It also calls :meth:`service_actions`, which may be used by a " +"subclass or mixin to provide actions specific to a given service. For " +"example, the :class:`ForkingMixIn` class uses :meth:`service_actions` to " +"clean up zombie child processes." +msgstr "" +"درخواست‌ها را تا دریافت یک درخواست صریح :meth:`shutdown` رسیدگی می‌کند. هر " +"*poll_interval* ثانیه، وضعیت خاموش شدن را پایش می‌کند. ویژگی :attr:`timeout` " +"را نادیده می‌گیرد. همچنین :meth:`service_actions` را فراخوانی می‌کند، که ممکن " +"است توسط یک زیرکلاس یا میکسینبرای ارائه اقدامات خاص یک سرویس مشخص " +"استفاده شود. برای مثال، کلاس :class:`ForkingMixIn` " +"از :meth:`service_actions` برای پاک‌سازی فرآیندهای فرزند زامبی استفاده می‌کند." msgid "Added ``service_actions`` call to the ``serve_forever`` method." -msgstr "" +msgstr "فراخوانی ``service_actions`` به متد ``serve_forever`` افزوده شد." -msgid "This is called in the :meth:`serve_forever` loop. This method can be overridden by subclasses or mixin classes to perform actions specific to a given service, such as cleanup actions." +msgid "" +"This is called in the :meth:`serve_forever` loop. This method can be " +"overridden by subclasses or mixin classes to perform actions specific to a " +"given service, such as cleanup actions." msgstr "" +"این متد در حلقه‌ی :meth:`serve_forever` فراخوانی می‌شود. زیرکلاس‌ها یا کلاس‌های " +"mixin می‌توانند این متد را برای انجام اقدامات خاص یک سرویس مشخص، مانند " +"اقدامات پاک‌سازی، بازنویسی کنند." -msgid "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:`shutdown` must be called while :meth:`serve_forever` is running in a different thread otherwise it will deadlock." +msgid "" +"Tell the :meth:`serve_forever` loop to stop and wait until it " +"does. :meth:`shutdown` must be called while :meth:`serve_forever` is " +"running in a different thread otherwise it will deadlock." msgstr "" +"به حلقه‌ی :meth:`serve_forever` دستور توقف بدهید و صبر کنید تا متوقف " +"شود. :meth:`shutdown` باید در حالی فراخوانی شود که :meth:`serve_forever` در " +"یک نخ دیگر در حال اجرا باشد؛ در غیر این صورت بن‌بست رخ خواهد داد." msgid "Clean up the server. May be overridden." -msgstr "" +msgstr "سرور را پاک‌سازی می‌کند. ممکن است بازنویسی شود." -msgid "The family of protocols to which the server's socket belongs. Common examples are :const:`socket.AF_INET`, :const:`socket.AF_INET6`, and :const:`socket.AF_UNIX`. Subclass the TCP or UDP server classes in this module with class attribute ``address_family = AF_INET6`` set if you want IPv6 server classes." -msgstr "" +msgid "" +"The family of protocols to which the server's socket belongs. Common " +"examples are :const:`socket.AF_INET`, :const:`socket.AF_INET6`, " +"and :const:`socket.AF_UNIX`. Subclass the TCP or UDP server classes in " +"this module with class attribute ``address_family = AF_INET6`` set if you " +"want IPv6 server classes." +msgstr "" +"خانواده پروتکل‌هایی که سوکت سرور به آن تعلق دارد. نمونه‌های رایج عبارت‌اند " +"از :const:`socket.AF_INET`، :const:`socket.AF_INET6` " +"و :const:`socket.AF_UNIX`. اگر کلاس‌های سرور IPv6 می‌خواهید، در این ماژول از " +"کلاس‌های سرور TCP یا UDP با تنظیم ویژگی کلاس ``address_family = AF_INET6`` " +"زیرکلاس بسازید." -msgid "The user-provided request handler class; an instance of this class is created for each request." +msgid "" +"The user-provided request handler class; an instance of this class is " +"created for each request." msgstr "" +"کلاس مدیریت درخواست ارائه‌شده توسط کاربر؛ برای هر درخواست، یک نمونه از این " +"کلاس ایجاد می‌شود." -msgid "The address on which the server is listening. The format of addresses varies depending on the protocol family; see the documentation for the :mod:`socket` module for details. For internet protocols, this is a tuple containing a string giving the address, and an integer port number: ``('127.0.0.1', 80)``, for example." +msgid "" +"The address on which the server is listening. The format of addresses " +"varies depending on the protocol family; see the documentation for " +"the :mod:`socket` module for details. For internet protocols, this is a " +"tuple containing a string giving the address, and an integer port number: " +"``('127.0.0.1', 80)``, for example." msgstr "" +"نشانی‌ای که سرور روی آن گوش می‌دهد. قالب نشانی‌ها بسته به خانواده پروتکل " +"متفاوت است؛ برای جزئیات، مستندات ماژول :mod:`socket` را ببینید. برای " +"پروتکل‌های اینترنتی، این یک تاپل حاوی یک رشته برای نشانی و یک عدد صحیح برای " +"شماره پورت است: برای مثال ``('127.0.0.1', 80)``." -msgid "The socket object on which the server will listen for incoming requests." -msgstr "" +msgid "" +"The socket object on which the server will listen for incoming requests." +msgstr "شیء سوکتی که سرور روی آن به درخواست‌های ورودی گوش خواهد داد." msgid "The server classes support the following class variables:" -msgstr "" +msgstr "کلاس‌های سرور از متغیرهای کلاس زیر پشتیبانی می‌کنند:" -msgid "Whether the server will allow the reuse of an address. This defaults to :const:`False`, and can be set in subclasses to change the policy." +msgid "" +"Whether the server will allow the reuse of an address. This defaults " +"to :const:`False`, and can be set in subclasses to change the policy." msgstr "" +"این‌که سرور اجازه استفاده‌ی مجدد از یک آدرس را می‌دهد یا خیر. مقدار پیش‌فرض " +"آن :const:`False` است و می‌توان آن را در زیرکلاس‌ها برای تغییر این سیاست " +"تنظیم کرد." -msgid "The size of the request queue. If it takes a long time to process a single request, any requests that arrive while the server is busy are placed into a queue, up to :attr:`request_queue_size` requests. Once the queue is full, further requests from clients will get a \"Connection denied\" error. The default value is usually 5, but this can be overridden by subclasses." -msgstr "" +msgid "" +"The size of the request queue. If it takes a long time to process a single " +"request, any requests that arrive while the server is busy are placed into " +"a queue, up to :attr:`request_queue_size` requests. Once the queue is " +"full, further requests from clients will get a \"Connection denied\" " +"error. The default value is usually 5, but this can be overridden by " +"subclasses." +msgstr "" +"اندازه‌ی صف درخواست. اگر پردازش یک درخواست زمان زیادی طول بکشد، درخواست‌هایی " +"که در حین مشغول بودن سرور می‌رسند، در یک صف قرار می‌گیرند؛ تا " +"سقف :attr:`request_queue_size` درخواست. هنگامی که صف پر شد، درخواست‌های بعدی " +"از سمت کلاینت‌ها با خطای «Connection denied» مواجه می‌شوند. مقدار پیش‌فرض " +"معمولاً ۵ است، اما زیرکلاس‌ها می‌توانند این مقدار را بازنویسی کنند." -msgid "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :const:`socket.SOCK_DGRAM` are two common values." +msgid "" +"The type of socket used by the server; :const:`socket.SOCK_STREAM` " +"and :const:`socket.SOCK_DGRAM` are two common values." msgstr "" +"نوع سوکتی که سرور از آن استفاده می‌کند؛ :const:`socket.SOCK_STREAM` " +"و :const:`socket.SOCK_DGRAM` دو مقدار رایج هستند." -msgid "Timeout duration, measured in seconds, or :const:`None` if no timeout is desired. If :meth:`handle_request` receives no incoming requests within the timeout period, the :meth:`handle_timeout` method is called." +msgid "" +"Timeout duration, measured in seconds, or :const:`None` if no timeout is " +"desired. If :meth:`handle_request` receives no incoming requests within " +"the timeout period, the :meth:`handle_timeout` method is called." msgstr "" +"مدت‌زمان مهلت، که بر حسب ثانیه اندازه‌گیری می‌شود، یا :const:`None` اگر هیچ " +"مهلتی مدنظر نباشد. اگر :meth:`handle_request` در بازه‌ی مهلت هیچ درخواست " +"ورودی‌ای دریافت نکند، متد :meth:`handle_timeout` فراخوانی می‌شود." -msgid "There are various server methods that can be overridden by subclasses of base server classes like :class:`TCPServer`; these methods aren't useful to external users of the server object." +msgid "" +"There are various server methods that can be overridden by subclasses of " +"base server classes like :class:`TCPServer`; these methods aren't useful to " +"external users of the server object." msgstr "" +"متدهای سرور گوناگونی وجود دارند که زیرکلاس‌های کلاس‌های پایه‌ی سرور " +"مانند :class:`TCPServer` می‌توانند آن‌ها را بازنویسی کنند؛ این متدها برای " +"کاربران خارجی شیء سرور مفید نیستند." -msgid "Actually processes the request by instantiating :attr:`RequestHandlerClass` and calling its :meth:`~BaseRequestHandler.handle` method." +msgid "" +"Actually processes the request by instantiating :attr:`RequestHandlerClass` " +"and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" +"در واقع درخواست را با نمونه‌سازی از :attr:`RequestHandlerClass` و فراخوانی " +"متد :meth:`~BaseRequestHandler.handle` آن پردازش می‌کند." -msgid "Must accept a request from the socket, and return a 2-tuple containing the *new* socket object to be used to communicate with the client, and the client's address." +msgid "" +"Must accept a request from the socket, and return a 2-tuple containing the " +"*new* socket object to be used to communicate with the client, and the " +"client's address." msgstr "" +"باید یک درخواست را از سوکت بپذیرد و یک تاپل دوتایی شامل شیء سوکت *جدید* " +"برای برقراری ارتباط با کلاینت و نشانی کلاینت را برگرداند." -msgid "This function is called if the :meth:`~BaseRequestHandler.handle` method of a :attr:`RequestHandlerClass` instance raises an exception. The default action is to print the traceback to standard error and continue handling further requests." +msgid "" +"This function is called if the :meth:`~BaseRequestHandler.handle` method of " +"a :attr:`RequestHandlerClass` instance raises an exception. The default " +"action is to print the traceback to standard error and continue handling " +"further requests." msgstr "" +"این تابع در صورتی فراخوانی می‌شود که متد :meth:`~BaseRequestHandler.handle` " +"از نمونه‌ای از :attr:`RequestHandlerClass` استثنایی را پرتاب کند. رفتار " +"پیش‌فرض این است که ردگیری پشته در خطای استاندارد چاپ شود و رسیدگی به " +"درخواست‌های بعدی ادامه یابد." -msgid "Now only called for exceptions derived from the :exc:`Exception` class." +msgid "" +"Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" +"اکنون فقط برای استثناهای مشتق‌شده از کلاس :exc:`Exception` فراخوانی می‌شود." -msgid "This function is called when the :attr:`timeout` attribute has been set to a value other than :const:`None` and the timeout period has passed with no requests being received. The default action for forking servers is to collect the status of any child processes that have exited, while in threading servers this method does nothing." -msgstr "" +msgid "" +"This function is called when the :attr:`timeout` attribute has been set to " +"a value other than :const:`None` and the timeout period has passed with no " +"requests being received. The default action for forking servers is to " +"collect the status of any child processes that have exited, while in " +"threading servers this method does nothing." +msgstr "" +"این تابع زمانی فراخوانی می‌شود که ویژگی :attr:`timeout` به مقداری غیر " +"از :const:`None` تنظیم شده باشد و مدت مهلت بدون دریافت هیچ درخواستی سپری " +"شده باشد. اقدام پیش‌فرض برای سرورهای فورک‌کننده (forking servers) جمع‌آوری " +"وضعیت فرایندهای فرزندی است که خارج شده‌اند، در حالی که در سرورهای نخی " +"(threading servers) این متد هیچ کاری انجام نمی‌دهد." -msgid "Calls :meth:`finish_request` to create an instance of the :attr:`RequestHandlerClass`. If desired, this function can create a new process or thread to handle the request; the :class:`ForkingMixIn` and :class:`ThreadingMixIn` classes do this." +msgid "" +"Calls :meth:`finish_request` to create an instance of " +"the :attr:`RequestHandlerClass`. If desired, this function can create a " +"new process or thread to handle the request; the :class:`ForkingMixIn` " +"and :class:`ThreadingMixIn` classes do this." msgstr "" +":meth:`finish_request` را فراخوانی می‌کند تا نمونه‌ای " +"از :attr:`RequestHandlerClass` ایجاد کند. در صورت تمایل، این تابع می‌تواند " +"یک فرایند یا نخ جدید برای رسیدگی به درخواست ایجاد کند؛ " +"کلاس‌های :class:`ForkingMixIn` و :class:`ThreadingMixIn` این کار را انجام " +"می‌دهند." -msgid "Called by the server's constructor to activate the server. The default behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the server's socket. May be overridden." +msgid "" +"Called by the server's constructor to activate the server. The default " +"behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " +"server's socket. May be overridden." msgstr "" +"توسط سازنده‌ی سرور فراخوانی می‌شود تا سرور را فعال کند. رفتار پیش‌فرض برای یک " +"سرور TCP، تنها :meth:`~socket.socket.listen` را روی سوکت سرور فراخوانی " +"می‌کند. ممکن است بازنویسی شود." -msgid "Called by the server's constructor to bind the socket to the desired address. May be overridden." +msgid "" +"Called by the server's constructor to bind the socket to the desired " +"address. May be overridden." msgstr "" +"توسط سازنده‌ی سرور فراخوانی می‌شود تا سوکت را به نشانی دلخواه مقید کند. ممکن " +"است بازنویسی شود." -msgid "Must return a Boolean value; if the value is :const:`True`, the request will be processed, and if it's :const:`False`, the request will be denied. This function can be overridden to implement access controls for a server. The default implementation always returns :const:`True`." +msgid "" +"Must return a Boolean value; if the value is :const:`True`, the request " +"will be processed, and if it's :const:`False`, the request will be denied. " +"This function can be overridden to implement access controls for a server. " +"The default implementation always returns :const:`True`." msgstr "" +"باید یک مقدار بولی برگرداند؛ اگر مقدار :const:`True` باشد، درخواست پردازش " +"خواهد شد، و اگر :const:`False` باشد، درخواست رد خواهد شد. می‌توان این تابع " +"را بازنویسی کرد تا کنترل‌های دسترسی برای یک سرور پیاده‌سازی شود. پیاده‌سازی " +"پیش‌فرض همیشه :const:`True` را برمی‌گرداند." -msgid "Support for the :term:`context manager` protocol was added. Exiting the context manager is equivalent to calling :meth:`server_close`." +msgid "" +"Support for the :term:`context manager` protocol was added. Exiting the " +"context manager is equivalent to calling :meth:`server_close`." msgstr "" +"پشتیبانی از پروتکل :term:`context manager` افزوده شد. خروج از مدیر زمینه " +"معادل فراخوانی :meth:`server_close` است." msgid "Request Handler Objects" -msgstr "" +msgstr "اشیای هندلر درخواست" -msgid "This is the superclass of all request handler objects. It defines the interface, given below. A concrete request handler subclass must define a new :meth:`handle` method, and can override any of the other methods. A new instance of the subclass is created for each request." +msgid "" +"This is the superclass of all request handler objects. It defines the " +"interface, given below. A concrete request handler subclass must define a " +"new :meth:`handle` method, and can override any of the other methods. A " +"new instance of the subclass is created for each request." msgstr "" +"این ابرکلاس تمام اشیای هندلر درخواست است. این کلاس رابطی را که در " +"ادامه آمده است تعریف می‌کند. یک زیرکلاس عینی از هندلر درخواست باید یک " +"متد :meth:`handle` جدید تعریف کند و می‌تواند هر یک از متدهای دیگر را " +"بازنویسی کند. برای هر درخواست، یک نمونه جدید از زیرکلاس ایجاد می‌شود." -msgid "Called before the :meth:`handle` method to perform any initialization actions required. The default implementation does nothing." +msgid "" +"Called before the :meth:`handle` method to perform any initialization " +"actions required. The default implementation does nothing." msgstr "" +"پیش از متد :meth:`handle` فراخوانی می‌شود تا هرگونه عملیات مقداردهی اولیه " +"مورد نیاز را انجام دهد. پیاده‌سازی پیش‌فرض هیچ کاری انجام نمی‌دهد." -msgid "This function must do all the work required to service a request. The default implementation does nothing. Several instance attributes are available to it; the request is available as :attr:`request`; the client address as :attr:`client_address`; and the server instance as :attr:`server`, in case it needs access to per-server information." -msgstr "" +msgid "" +"This function must do all the work required to service a request. The " +"default implementation does nothing. Several instance attributes are " +"available to it; the request is available as :attr:`request`; the client " +"address as :attr:`client_address`; and the server instance " +"as :attr:`server`, in case it needs access to per-server information." +msgstr "" +"این تابع باید تمام کارهای مورد نیاز برای رسیدگی به یک درخواست را انجام دهد. " +"پیاده‌سازی پیش‌فرض هیچ کاری انجام نمی‌دهد. چندین ویژگی نمونه در دسترس آن است؛ " +"درخواست به‌صورت :attr:`request`، نشانی سرویس‌گیرنده " +"به‌صورت :attr:`client_address` و نمونه سرور به‌صورت :attr:`server` در دسترس " +"است، در صورتی که به اطلاعات به‌ازای هر سرور نیاز داشته باشد." -msgid "The type of :attr:`request` is different for datagram or stream services. For stream services, :attr:`request` is a socket object; for datagram services, :attr:`request` is a pair of string and socket." +msgid "" +"The type of :attr:`request` is different for datagram or stream services. " +"For stream services, :attr:`request` is a socket object; for datagram " +"services, :attr:`request` is a pair of string and socket." msgstr "" +"نوع :attr:`request` برای سرویس‌های دیتاگرام یا جریانی متفاوت است. برای " +"سرویس‌های جریانی، :attr:`request` یک شیء سوکت است؛ برای سرویس‌های " +"دیتاگرام، :attr:`request` جفتی متشکل از یک رشته و یک سوکت است." -msgid "Called after the :meth:`handle` method to perform any clean-up actions required. The default implementation does nothing. If :meth:`setup` raises an exception, this function will not be called." +msgid "" +"Called after the :meth:`handle` method to perform any clean-up actions " +"required. The default implementation does nothing. If :meth:`setup` " +"raises an exception, this function will not be called." msgstr "" +"پس از متد :meth:`handle` فراخوانی می‌شود تا هرگونه عملیات پاک‌سازی لازم را " +"انجام دهد. پیاده‌سازی پیش‌فرض هیچ کاری انجام نمی‌دهد. اگر :meth:`setup` " +"استثنایی پرتاب کند، این تابع فراخوانی نخواهد شد." -msgid "The *new* :class:`socket.socket` object to be used to communicate with the client." +msgid "" +"The *new* :class:`socket.socket` object to be used to communicate with the " +"client." msgstr "" +"شیء *جدید* :class:`socket.socket` که برای برقراری ارتباط با کارخواه استفاده " +"می‌شود." msgid "Client address returned by :meth:`BaseServer.get_request`." -msgstr "" +msgstr "نشانی کلاینت برگردانده‌شده توسط :meth:`BaseServer.get_request`." msgid ":class:`BaseServer` object used for handling the request." -msgstr "" +msgstr "شیء :class:`BaseServer` که برای رسیدگی به درخواست به کار می‌رود." -msgid "These :class:`BaseRequestHandler` subclasses override the :meth:`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, and provide :attr:`rfile` and :attr:`wfile` attributes." +msgid "" +"These :class:`BaseRequestHandler` subclasses override " +"the :meth:`~BaseRequestHandler.setup` " +"and :meth:`~BaseRequestHandler.finish` methods, and provide :attr:`rfile` " +"and :attr:`wfile` attributes." msgstr "" +"این زیرکلاس‌های :class:`BaseRequestHandler`، " +"متدهای :meth:`~BaseRequestHandler.setup` " +"و :meth:`~BaseRequestHandler.finish` را بازنویسی می‌کنند و " +"ویژگی‌های :attr:`rfile` و :attr:`wfile` را فراهم می‌کنند." -msgid "A file object from which receives the request is read. Support the :class:`io.BufferedIOBase` readable interface." +msgid "" +"A file object from which receives the request is read. Support " +"the :class:`io.BufferedIOBase` readable interface." msgstr "" +"یک شیء فایل که درخواست از آن خوانده می‌شود. از رابط " +"خواندنی :class:`io.BufferedIOBase` پشتیبانی می‌کند." -msgid "A file object to which the reply is written. Support the :class:`io.BufferedIOBase` writable interface" +msgid "" +"A file object to which the reply is written. Support " +"the :class:`io.BufferedIOBase` writable interface" msgstr "" +"یک شیء فایل که پاسخ در آن نوشته می‌شود. از رابط " +"قابل‌نوشتن :class:`io.BufferedIOBase` پشتیبانی می‌کند" -msgid ":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable interface." +msgid "" +":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable " +"interface." msgstr "" +":attr:`wfile` همچنین از رابط نوشتنی :class:`io.BufferedIOBase` پشتیبانی " +"می‌کند." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid ":class:`socketserver.TCPServer` Example" -msgstr "" +msgstr "مثال :class:`socketserver.TCPServer`" msgid "This is the server side::" -msgstr "" +msgstr "این سمت سرور است::" msgid "" "import socketserver\n" @@ -308,9 +764,47 @@ msgid "" " # interrupt the program with Ctrl-C\n" " server.serve_forever()" msgstr "" +"import socketserver\n" +"\n" +"class MyTCPHandler(socketserver.BaseRequestHandler):\n" +" \"\"\"\n" +" The request handler class for our server.\n" +"\n" +" It is instantiated once per connection to the server, and must\n" +" override the handle() method to implement communication to the\n" +" client.\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" # self.request is the TCP socket connected to the client\n" +" pieces = [b'']\n" +" total = 0\n" +" while b'\\n' not in pieces[-1] and total < 10_000:\n" +" pieces.append(self.request.recv(2000))\n" +" total += len(pieces[-1])\n" +" self.data = b''.join(pieces)\n" +" print(f\"Received from {self.client_address[0]}:\")\n" +" print(self.data.decode(\"utf-8\"))\n" +" # just send back the same data, but upper-cased\n" +" self.request.sendall(self.data.upper())\n" +" # after we return, the socket will be closed.\n" +"\n" +"if __name__ == \"__main__\":\n" +" HOST, PORT = \"localhost\", 9999\n" +"\n" +" # Create the server, binding to localhost on port 9999\n" +" with socketserver.TCPServer((HOST, PORT), MyTCPHandler) as server:\n" +" # Activate the server; this will keep running until you\n" +" # interrupt the program with Ctrl-C\n" +" server.serve_forever()" -msgid "An alternative request handler class that makes use of streams (file-like objects that simplify communication by providing the standard file interface)::" +msgid "" +"An alternative request handler class that makes use of streams (file-like " +"objects that simplify communication by providing the standard file " +"interface)::" msgstr "" +"یک کلاس جایگزین برای مدیریت درخواست که از جریان‌ها (streams) استفاده می‌کند " +"(اشیاء فایل‌ماندی که با ارائه رابط فایل استاندارد، ارتباط را ساده‌تر می‌کنند)::" msgid "" "class MyTCPHandler(socketserver.StreamRequestHandler):\n" @@ -326,12 +820,43 @@ msgid "" " # to the client\n" " self.wfile.write(self.data.upper())" msgstr "" +"class MyTCPHandler(socketserver.StreamRequestHandler):\n" +"\n" +" def handle(self):\n" +" # self.rfile یک شیء فایل‌مانند است که توسط handler ایجادشده است.\n" +" # اکنون می‌توانیم به‌جای فراخوانی‌های خام recv()، برای مثال از " +"readline() استفاده کنیم.\n" +" # خود را به ۱۰۰۰۰ بایت محدود می‌کنیم تا از سوءاستفاده از سوی فرستنده " +"جلوگیری شود.\n" +" self.data = self.rfile.readline(10000).rstrip()\n" +" print(f\"{self.client_address[0]} wrote:\")\n" +" print(self.data.decode(\"utf-8\"))\n" +" # به‌همین‌ترتیب، self.wfile یک شیء فایل‌مانند است که برای نوشتن\n" +" # پاسخ به کلاینت استفاده می‌شود\n" +" self.wfile.write(self.data.upper())" -msgid "The difference is that the ``readline()`` call in the second handler will call ``recv()`` multiple times until it encounters a newline character, while the first handler had to use a ``recv()`` loop to accumulate data until a newline itself. If it had just used a single ``recv()`` without the loop it would just have returned what has been received so far from the client. TCP is stream based: data arrives in the order it was sent, but there is no correlation between client ``send()`` or ``sendall()`` calls and the number of ``recv()`` calls on the server required to receive it." -msgstr "" +msgid "" +"The difference is that the ``readline()`` call in the second handler will " +"call ``recv()`` multiple times until it encounters a newline character, " +"while the first handler had to use a ``recv()`` loop to accumulate data " +"until a newline itself. If it had just used a single ``recv()`` without " +"the loop it would just have returned what has been received so far from the " +"client. TCP is stream based: data arrives in the order it was sent, but " +"there is no correlation between client ``send()`` or ``sendall()`` calls " +"and the number of ``recv()`` calls on the server required to receive it." +msgstr "" +"تفاوت این است که فراخوانی ``readline()`` در هندلری دوم، ``recv()`` را " +"چندین بار فراخوانی می‌کند تا به یک نویسه‌ی خط جدید برسد، در حالی که هندلری " +"اول مجبور بود برای انباشت داده‌ها تا رسیدن خودش به یک نویسه‌ی خط جدید از یک " +"حلقه‌ی ``recv()`` استفاده کند. اگر فقط از یک فراخوانی ``recv()`` بدون حلقه " +"استفاده می‌کرد، تنها آنچه را که تا آن لحظه از کلاینت دریافت شده بود " +"بازمی‌گرداند. TCP مبتنی بر جریان است: داده‌ها به همان ترتیبی که ارسال شده‌اند " +"می‌رسند، اما هیچ همبستگی بین فراخوانی‌های ``send()`` یا ``sendall()`` کلاینت " +"و تعداد فراخوانی‌های ``recv()`` مورد نیاز در سرور برای دریافت آن‌ها وجود " +"ندارد." msgid "This is the client side::" -msgstr "" +msgstr "این سمت کلاینت است::" msgid "" "import socket\n" @@ -353,12 +878,30 @@ msgid "" "print(\"Sent: \", data)\n" "print(\"Received:\", received)" msgstr "" +"import socket\n" +"import sys\n" +"\n" +"HOST, PORT = \"localhost\", 9999\n" +"data = \" \".join(sys.argv[1:])\n" +"\n" +"# Create a socket (SOCK_STREAM means a TCP socket)\n" +"with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:\n" +" # Connect to server and send data\n" +" sock.connect((HOST, PORT))\n" +" sock.sendall(bytes(data, \"utf-8\"))\n" +" sock.sendall(b\"\\n\")\n" +"\n" +" # Receive data from the server and shut down\n" +" received = str(sock.recv(1024), \"utf-8\")\n" +"\n" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" msgid "The output of the example should look something like this:" -msgstr "" +msgstr "خروجی مثال باید چیزی شبیه به این باشد:" msgid "Server:" -msgstr "" +msgstr "سرور:" msgid "" "$ python TCPServer.py\n" @@ -367,9 +910,14 @@ msgid "" "127.0.0.1 wrote:\n" "b'python is nice'" msgstr "" +"$ python TCPServer.py\n" +"127.0.0.1 wrote:\n" +"b'hello world with TCP'\n" +"127.0.0.1 wrote:\n" +"b'python is nice'" msgid "Client:" -msgstr "" +msgstr "کلاینت:" msgid "" "$ python TCPClient.py hello world with TCP\n" @@ -379,9 +927,15 @@ msgid "" "Sent: python is nice\n" "Received: PYTHON IS NICE" msgstr "" +"$ python TCPClient.py hello world with TCP\n" +"Sent: hello world with TCP\n" +"Received: HELLO WORLD WITH TCP\n" +"$ python TCPClient.py python is nice\n" +"Sent: python is nice\n" +"Received: PYTHON IS NICE" msgid ":class:`socketserver.UDPServer` Example" -msgstr "" +msgstr "مثال :class:`socketserver.UDPServer`" msgid "" "import socketserver\n" @@ -406,6 +960,27 @@ msgid "" " with socketserver.UDPServer((HOST, PORT), MyUDPHandler) as server:\n" " server.serve_forever()" msgstr "" +"import socketserver\n" +"\n" +"class MyUDPHandler(socketserver.BaseRequestHandler):\n" +" \"\"\"\n" +" This class works similar to the TCP handler class, except that\n" +" self.request consists of a pair of data and client socket, and since\n" +" there is no connection the client address must be given explicitly\n" +" when sending data back via sendto().\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" data = self.request[0].strip()\n" +" socket = self.request[1]\n" +" print(f\"{self.client_address[0]} wrote:\")\n" +" print(data)\n" +" socket.sendto(data.upper(), self.client_address)\n" +"\n" +"if __name__ == \"__main__\":\n" +" HOST, PORT = \"localhost\", 9999\n" +" with socketserver.UDPServer((HOST, PORT), MyUDPHandler) as server:\n" +" server.serve_forever()" msgid "" "import socket\n" @@ -425,18 +1000,40 @@ msgid "" "print(\"Sent: \", data)\n" "print(\"Received:\", received)" msgstr "" +"import socket\n" +"import sys\n" +"\n" +"HOST, PORT = \"localhost\", 9999\n" +"data = \" \".join(sys.argv[1:])\n" +"\n" +"# SOCK_DGRAM is the socket type to use for UDP sockets\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n" +"\n" +"# As you can see, there is no connect() call; UDP has no connections.\n" +"# Instead, data is directly sent to the recipient via sendto().\n" +"sock.sendto(bytes(data + \"\\n\", \"utf-8\"), (HOST, PORT))\n" +"received = str(sock.recv(1024), \"utf-8\")\n" +"\n" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" -msgid "The output of the example should look exactly like for the TCP server example." -msgstr "" +msgid "" +"The output of the example should look exactly like for the TCP server " +"example." +msgstr "خروجی مثال باید دقیقاً مانند مثال کارساز TCP باشد." msgid "Asynchronous Mixins" -msgstr "" +msgstr "میکسین‌های ناهمگام (Mixins)" -msgid "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:`ForkingMixIn` classes." +msgid "" +"To build asynchronous handlers, use the :class:`ThreadingMixIn` " +"and :class:`ForkingMixIn` classes." msgstr "" +"برای ساخت مدیرهای ناهمگام، از کلاس‌های :class:`ThreadingMixIn` " +"و :class:`ForkingMixIn` استفاده کنید." msgid "An example for the :class:`ThreadingMixIn` class::" -msgstr "" +msgstr "مثالی برای کلاس :class:`ThreadingMixIn`::" msgid "" "import socket\n" @@ -448,10 +1045,12 @@ msgid "" " def handle(self):\n" " data = str(self.request.recv(1024), 'ascii')\n" " cur_thread = threading.current_thread()\n" -" response = bytes(\"{}: {}\".format(cur_thread.name, data), 'ascii')\n" +" response = bytes(\"{}: {}\".format(cur_thread.name, data), " +"'ascii')\n" " self.request.sendall(response)\n" "\n" -"class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):\n" +"class ThreadedTCPServer(socketserver.ThreadingMixIn, " +"socketserver.TCPServer):\n" " pass\n" "\n" "def client(ip, port, message):\n" @@ -469,7 +1068,8 @@ msgid "" " with server:\n" " ip, port = server.server_address\n" "\n" -" # Start a thread with the server -- that thread will then start one\n" +" # Start a thread with the server -- that thread will then start " +"one\n" " # more thread for each request\n" " server_thread = threading.Thread(target=server.serve_forever)\n" " # Exit the server thread when the main thread terminates\n" @@ -483,6 +1083,52 @@ msgid "" "\n" " server.shutdown()" msgstr "" +"import socket\n" +"import threading\n" +"import socketserver\n" +"\n" +"class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):\n" +"\n" +" def handle(self):\n" +" data = str(self.request.recv(1024), 'ascii')\n" +" cur_thread = threading.current_thread()\n" +" response = bytes(\"{}: {}\".format(cur_thread.name, data), " +"'ascii')\n" +" self.request.sendall(response)\n" +"\n" +"class ThreadedTCPServer(socketserver.ThreadingMixIn, " +"socketserver.TCPServer):\n" +" pass\n" +"\n" +"def client(ip, port, message):\n" +" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:\n" +" sock.connect((ip, port))\n" +" sock.sendall(bytes(message, 'ascii'))\n" +" response = str(sock.recv(1024), 'ascii')\n" +" print(\"Received: {}\".format(response))\n" +"\n" +"if __name__ == \"__main__\":\n" +" # Port 0 means to select an arbitrary unused port\n" +" HOST, PORT = \"localhost\", 0\n" +"\n" +" server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)\n" +" with server:\n" +" ip, port = server.server_address\n" +"\n" +" # Start a thread with the server -- that thread will then start " +"one\n" +" # more thread for each request\n" +" server_thread = threading.Thread(target=server.serve_forever)\n" +" # Exit the server thread when the main thread terminates\n" +" server_thread.daemon = True\n" +" server_thread.start()\n" +" print(\"Server loop running in thread:\", server_thread.name)\n" +"\n" +" client(ip, port, \"Hello World 1\")\n" +" client(ip, port, \"Hello World 2\")\n" +" client(ip, port, \"Hello World 3\")\n" +"\n" +" server.shutdown()" msgid "" "$ python ThreadedTCPServer.py\n" @@ -491,6 +1137,17 @@ msgid "" "Received: Thread-3: Hello World 2\n" "Received: Thread-4: Hello World 3" msgstr "" +"$ python ThreadedTCPServer.py\n" +"Server loop running in thread: Thread-1\n" +"Received: Thread-2: Hello World 1\n" +"Received: Thread-3: Hello World 2\n" +"Received: Thread-4: Hello World 3" -msgid "The :class:`ForkingMixIn` class is used in the same way, except that the server will spawn a new process for each request. Available only on POSIX platforms that support :func:`~os.fork`." +msgid "" +"The :class:`ForkingMixIn` class is used in the same way, except that the " +"server will spawn a new process for each request. Available only on POSIX " +"platforms that support :func:`~os.fork`." msgstr "" +"کلاس :class:`ForkingMixIn` به همان روش استفاده می‌شود، با این تفاوت که سرور " +"برای هر درخواست یک فرایند جدید ایجاد می‌کند. فقط در پلتفرم‌های POSIX که " +"از :func:`~os.fork` پشتیبانی می‌کنند، در دسترس است." diff --git a/library/spwd.po b/library/spwd.po index 004392c7c..50c994fcd 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -22,13 +22,27 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!spwd` --- The shadow password database" -msgstr "" +msgstr ":mod:`!spwd` --- پایگاه داده‌ی گذرواژه‌ی سایه" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. حذف " +"آن در :pep:`594` تصمیم‌گیری شد." -msgid "A possible replacement is the third-party library :pypi:`python-pam`. This library is not supported or maintained by the Python core team." +msgid "" +"A possible replacement is the third-party library :pypi:`python-pam`. This " +"library is not supported or maintained by the Python core team." msgstr "" +"یک جایگزین ممکن، کتابخانه‌ی شخص ثالث :pypi:`python-pam` است. این کتابخانه " +"توسط تیم اصلی پایتون پشتیبانی یا نگهداری نمی‌شود." -msgid "The last version of Python that provided the :mod:`!spwd` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!spwd` module was `Python" +" 3.12 `_." msgstr "" +"آخرین نسخه پایتون که ماژول :mod:`!spwd` را فراهم می‌کرد، `Python 3.12 " +"`_ بود." diff --git a/library/sqlite3.po b/library/sqlite3.po index 9e84d977a..203a6e935 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" +"PO-Revision-Date: 2026-08-28 11:21+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,104 +23,202 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!sqlite3` --- DB-API 2.0 interface for SQLite databases" -msgstr "" +msgstr ":mod:`!sqlite3` --- رابط DB-API 2.0 برای پایگاه‌های داده SQLite" msgid "**Source code:** :source:`Lib/sqlite3/`" -msgstr "" +msgstr ":source:`Lib/sqlite3/`" -msgid "SQLite is a C library that provides a lightweight disk-based database that doesn't require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language. Some applications can use SQLite for internal data storage. It's also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle." -msgstr "" +msgid "" +"SQLite is a C library that provides a lightweight disk-based database that doesn't " +"require a separate server process and allows accessing the database using a " +"nonstandard variant of the SQL query language. Some applications can use SQLite " +"for internal data storage. It's also possible to prototype an application using " +"SQLite and then port the code to a larger database such as PostgreSQL or Oracle." +msgstr "" +"SQLite کتابخانه‌ای به زبان C است که پایگاه داده‌ای سبک و مبتنی بر دیسک فراهم می‌کند " +"که به فرایند سرور جداگانه‌ای نیاز ندارد و امکان دسترسی به پایگاه داده را با استفاده " +"از گونه‌ای غیراستاندارد از زبان پرس‌وجوی SQL می‌دهد. برخی برنامه‌ها می‌توانند از SQLite " +"برای ذخیره‌سازی داخلی داده‌ها استفاده کنند. همچنین می‌توان پیش‌نمونه‌ای از یک برنامه را " +"با استفاده از SQLite ساخت و سپس کد را به پایگاه داده‌ی بزرگ‌تری مانند PostgreSQL یا " +"Oracle منتقل کرد." -msgid "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`, and requires the third-party `SQLite `_ library." +msgid "" +"The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL " +"interface compliant with the DB-API 2.0 specification described by :pep:`249`, and " +"requires the third-party `SQLite `_ library." msgstr "" +"ماژول :mod:`!sqlite3` توسط Gerhard Häring نوشته شده است. این ماژول یک رابط SQL " +"سازگار با مشخصات DB-API 2.0 ارائه می‌کند که در :pep:`249` توصیف شده است، و به " +"کتابخانه‌ی شخص ثالث `SQLite `_ نیاز دارد." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of CPython, " +"look for documentation from your distributor (that is, whoever provided Python to " +"you). If you are the distributor, see :ref:`optional-module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر در نسخه CPython شما وجود " +"ندارد، برای مستندات به توزیع‌کننده خود مراجعه کنید (یعنی هر کسی که پایتون را در " +"اختیار شما قرار داده است). اگر شما توزیع‌کننده هستید، :ref:`optional-module-" +"requirements` را ببینید." msgid "This document includes four main sections:" -msgstr "" +msgstr "این سند شامل چهار بخش اصلی است:" msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." msgstr "" +":ref:`sqlite3-tutorial` چگونگی استفاده از ماژول :mod:`!sqlite3` را آموزش می‌دهد." -msgid ":ref:`sqlite3-reference` describes the classes and functions this module defines." +msgid "" +":ref:`sqlite3-reference` describes the classes and functions this module defines." msgstr "" +":ref:`sqlite3-reference` کلاس‌ها و توابعی را که این ماژول تعریف می‌کند، شرح می‌دهد." msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." -msgstr "" +msgstr ":ref:`sqlite3-howtos` جزئیات چگونگی انجام وظایف خاص را شرح می‌دهد." -msgid ":ref:`sqlite3-explanation` provides in-depth background on transaction control." -msgstr "" +msgid "" +":ref:`sqlite3-explanation` provides in-depth background on transaction control." +msgstr ":ref:`sqlite3-explanation` پیش‌زمینه‌ای عمیق درباره‌ی کنترل تراکنش ارائه می‌دهد." msgid "https://www.sqlite.org" -msgstr "" +msgstr "https://www.sqlite.org" -msgid "The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect." +msgid "" +"The SQLite web page; the documentation describes the syntax and the available data " +"types for the supported SQL dialect." msgstr "" +"صفحه‌ی وب SQLite؛ مستندات، نحو و انواع داده‌های موجود برای گویش SQL پشتیبانی‌شده را " +"توضیح می‌دهد." msgid "https://www.w3schools.com/sql/" -msgstr "" +msgstr "https://www.w3schools.com/sql/" msgid "Tutorial, reference and examples for learning SQL syntax." -msgstr "" +msgstr "آموزش، مرجع و مثال‌هایی برای یادگیری سینتکس SQL." msgid ":pep:`249` - Database API Specification 2.0" -msgstr "" +msgstr ":pep:`249` - مشخصات API پایگاه داده 2.0" msgid "PEP written by Marc-André Lemburg." -msgstr "" +msgstr "PEP نوشته‌شده توسط Marc-André Lemburg." msgid "Tutorial" -msgstr "" +msgstr "آموزش" -msgid "In this tutorial, you will create a database of Monty Python movies using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts, including `cursors`_ and `transactions`_." +msgid "" +"In this tutorial, you will create a database of Monty Python movies using " +"basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of " +"database concepts, including `cursors`_ and `transactions`_." msgstr "" +"در این آموزش، شما پایگاه داده‌ای از فیلم‌های مانتی پایتون را با استفاده از قابلیت‌های " +"پایه :mod:`!sqlite3` ایجاد خواهید کرد. این آموزش فرض می‌کند که شما درک بنیادی از " +"مفاهیم پایگاه داده، از جمله `cursors`_ و `transactions`_ دارید." -msgid "First, we need to create a new database and open a database connection to allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to create a connection to the database :file:`tutorial.db` in the current working directory, implicitly creating it if it does not exist:" +msgid "" +"First, we need to create a new database and open a database connection to " +"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to create a " +"connection to the database :file:`tutorial.db` in the current working directory, " +"implicitly creating it if it does not exist:" msgstr "" +"نخست، باید یک پایگاه داده جدید ایجاد کنیم و یک اتصال به پایگاه داده باز کنیم " +"تا :mod:`!sqlite3` بتواند با آن کار کند. برای ایجاد اتصال به پایگاه " +"داده‌ی :file:`tutorial.db` در پوشه کاری فعلی، :func:`sqlite3.connect` را فراخوانی " +"کنید؛ اگر این پایگاه داده وجود نداشته باشد، به‌طور ضمنی ایجاد می‌شود:" msgid "" "import sqlite3\n" "con = sqlite3.connect(\"tutorial.db\")" msgstr "" +"import sqlite3\n" +"con = sqlite3.connect(\"tutorial.db\")" -msgid "The returned :class:`Connection` object ``con`` represents the connection to the on-disk database." +msgid "" +"The returned :class:`Connection` object ``con`` represents the connection to the " +"on-disk database." msgstr "" +"شیء :class:`Connection` بازگردانده‌شده ``con``، نشان‌دهنده‌ی اتصال به پایگاه داده‌ی روی " +"دیسک است." -msgid "In order to execute SQL statements and fetch results from SQL queries, we will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" +msgid "" +"In order to execute SQL statements and fetch results from SQL queries, we will " +"need to use a database cursor. Call :meth:`con.cursor() ` to " +"create the :class:`Cursor`:" msgstr "" +"برای اجرای دستورات SQL و واکشی نتایج از پرس‌وجوهای SQL، باید از یک مکان‌نمای پایگاه " +"داده استفاده کنیم. برای ایجاد :class:`Cursor`، :meth:`con.cursor() " +"` را فراخوانی کنید:" msgid "cur = con.cursor()" -msgstr "" +msgstr "cur = con.cursor()" -msgid "Now that we've got a database connection and a cursor, we can create a database table ``movie`` with columns for title, release year, and review score. For simplicity, we can just use column names in the table declaration -- thanks to the `flexible typing`_ feature of SQLite, specifying the data types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:`cur.execute(...) `:" -msgstr "" +msgid "" +"Now that we've got a database connection and a cursor, we can create a database " +"table ``movie`` with columns for title, release year, and review score. For " +"simplicity, we can just use column names in the table declaration -- thanks to the " +"`flexible typing`_ feature of SQLite, specifying the data types is optional. " +"Execute the ``CREATE TABLE`` statement by calling :meth:`cur.execute(...) " +"`:" +msgstr "" +"اکنون که یک اتصال به پایگاه داده و یک نشانگر داریم، می‌توانیم یک جدول پایگاه داده " +"به نام ``movie`` با ستون‌هایی برای عنوان، سال انتشار و امتیاز نقد ایجاد کنیم. برای " +"سادگی، می‌توانیم فقط از نام ستون‌ها در تعریف جدول استفاده کنیم — به‌لطف قابلیت " +"`flexible typing`_ در SQLite، تعیین نوع‌های داده اختیاری است. دستور ``CREATE " +"TABLE`` را با فراخوانی :meth:`cur.execute(...) ` اجرا کنید:" msgid "cur.execute(\"CREATE TABLE movie(title, year, score)\")" -msgstr "" +msgstr "cur.execute(\"CREATE TABLE movie(title, year, score)\")" -msgid "We can verify that the new table has been created by querying the ``sqlite_master`` table built-in to SQLite, which should now contain an entry for the ``movie`` table definition (see `The Schema Table`_ for details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() ` to fetch the resulting row:" -msgstr "" +msgid "" +"We can verify that the new table has been created by querying the " +"``sqlite_master`` table built-in to SQLite, which should now contain an entry for " +"the ``movie`` table definition (see `The Schema Table`_ for details). Execute that " +"query by calling :meth:`cur.execute(...) `, assign the result to " +"``res``, and call :meth:`res.fetchone() ` to fetch the resulting " +"row:" +msgstr "" +"می‌توانیم با پرس‌وجوی جدول ``sqlite_master`` توکار در SQLite، تأیید کنیم که جدول " +"جدید ایجاد شده است؛ این جدول اکنون باید شامل ورودی‌ای برای تعریف جدول ``movie`` " +"باشد (برای جزئیات `The Schema Table`_ را ببینید). آن پرس‌وجو را با " +"فراخوانی :meth:`cur.execute(...) ` اجرا کنید، نتیجه را به ``res`` " +"اختصاص دهید و برای واکشی ردیف حاصل :meth:`res.fetchone() ` را " +"فراخوانی کنید:" msgid "" ">>> res = cur.execute(\"SELECT name FROM sqlite_master\")\n" ">>> res.fetchone()\n" "('movie',)" msgstr "" +">>> res = cur.execute(\"SELECT name FROM sqlite_master\")\n" +">>> res.fetchone()\n" +"('movie',)" -msgid "We can see that the table has been created, as the query returns a :class:`tuple` containing the table's name. If we query ``sqlite_master`` for a non-existent table ``spam``, :meth:`!res.fetchone` will return ``None``:" +msgid "" +"We can see that the table has been created, as the query returns a :class:`tuple` " +"containing the table's name. If we query ``sqlite_master`` for a non-existent " +"table ``spam``, :meth:`!res.fetchone` will return ``None``:" msgstr "" +"می‌توانیم ببینیم که جدول ایجاد شده است، زیرا پرس‌وجو یک :class:`tuple` برمی‌گرداند که " +"شامل نام جدول است. اگر ``sqlite_master`` را برای جدولی به نام ``spam`` که وجود " +"ندارد پرس‌وجو کنیم، :meth:`!res.fetchone` ``None`` را برمی‌گرداند:" msgid "" ">>> res = cur.execute(\"SELECT name FROM sqlite_master WHERE name='spam'\")\n" ">>> res.fetchone() is None\n" "True" msgstr "" +">>> res = cur.execute(\"SELECT name FROM sqlite_master WHERE name='spam'\")\n" +">>> res.fetchone() is None\n" +"True" -msgid "Now, add two rows of data supplied as SQL literals by executing an ``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" +msgid "" +"Now, add two rows of data supplied as SQL literals by executing an ``INSERT`` " +"statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" +"اکنون، با اجرای یک دستور ``INSERT``، دو ردیف داده را که به‌صورت مقادیر لفظی SQL ارائه " +"شده‌اند، بار دیگر با فراخوانی :meth:`cur.execute(...) ` اضافه کنید:" msgid "" "cur.execute(\"\"\"\n" @@ -129,27 +227,59 @@ msgid "" " ('And Now for Something Completely Different', 1971, 7.5)\n" "\"\"\")" msgstr "" +"cur.execute(\"\"\"\n" +" INSERT INTO movie VALUES\n" +" ('Monty Python and the Holy Grail', 1975, 8.2),\n" +" ('And Now for Something Completely Different', 1971, 7.5)\n" +"\"\"\")" -msgid "The ``INSERT`` statement implicitly opens a transaction, which needs to be committed before changes are saved in the database (see :ref:`sqlite3-controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" +msgid "" +"The ``INSERT`` statement implicitly opens a transaction, which needs to be " +"committed before changes are saved in the database (see :ref:`sqlite3-controlling-" +"transactions` for details). Call :meth:`con.commit() ` on the " +"connection object to commit the transaction:" msgstr "" +"دستور ``INSERT`` به‌طور ضمنی یک تراکنش را باز می‌کند، که باید پیش از ذخیره شدن " +"تغییرات در پایگاه داده، ثبت (commit) شود (برای جزئیات :ref:`sqlite3-controlling-" +"transactions` را ببینید). برای ثبت تراکنش، :meth:`con.commit() " +"` را روی شیء اتصال فراخوانی کنید:" msgid "con.commit()" -msgstr "" +msgstr "con.commit()" -msgid "We can verify that the data was inserted correctly by executing a ``SELECT`` query. Use the now-familiar :meth:`cur.execute(...) ` to assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" +msgid "" +"We can verify that the data was inserted correctly by executing a ``SELECT`` " +"query. Use the now-familiar :meth:`cur.execute(...) ` to assign " +"the result to ``res``, and call :meth:`res.fetchall() ` to return " +"all resulting rows:" msgstr "" +"می‌توانیم با اجرای یک پرس‌وجوی ``SELECT`` تأیید کنیم که داده‌ها به‌درستی درج شده‌اند. " +"از :meth:`cur.execute(...) ` که اکنون برایتان آشناست، برای اختصاص " +"نتیجه به ``res`` استفاده کنید و :meth:`res.fetchall() ` را " +"فراخوانی کنید تا تمام ردیف‌های حاصل را برگرداند:" msgid "" ">>> res = cur.execute(\"SELECT score FROM movie\")\n" ">>> res.fetchall()\n" "[(8.2,), (7.5,)]" msgstr "" +">>> res = cur.execute(\"SELECT score FROM movie\")\n" +">>> res.fetchall()\n" +"[(8.2,), (7.5,)]" -msgid "The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each containing that row's ``score`` value." +msgid "" +"The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each " +"containing that row's ``score`` value." msgstr "" +"نتیجه یک :class:`list` شامل دو :class:`!tuple` است، یکی به‌ازای هر ردیف، که هر یک " +"حاوی مقدار ``score`` آن ردیف است." -msgid "Now, insert three more rows by calling :meth:`cur.executemany(...) `:" +msgid "" +"Now, insert three more rows by calling :meth:`cur.executemany(...) " +"`:" msgstr "" +"اکنون، ۳ ردیف دیگر را با فراخوانی :meth:`cur.executemany(...) " +"` درج کنید:" msgid "" "data = [\n" @@ -160,12 +290,32 @@ msgid "" "cur.executemany(\"INSERT INTO movie VALUES(?, ?, ?)\", data)\n" "con.commit() # Remember to commit the transaction after executing INSERT." msgstr "" +"data = [\n" +" (\"Monty Python Live at the Hollywood Bowl\", 1982, 7.9),\n" +" (\"Monty Python's The Meaning of Life\", 1983, 7.5),\n" +" (\"Monty Python's Life of Brian\", 1979, 8.0),\n" +"]\n" +"cur.executemany(\"INSERT INTO movie VALUES(?, ?, ?)\", data)\n" +"con.commit() # Remember to commit the transaction after executing INSERT." -msgid "Notice that ``?`` placeholders are used to bind ``data`` to the query. Always use placeholders instead of :ref:`string formatting ` to bind Python values to SQL statements, to avoid `SQL injection attacks`_ (see :ref:`sqlite3-placeholders` for more details)." +msgid "" +"Notice that ``?`` placeholders are used to bind ``data`` to the query. Always use " +"placeholders instead of :ref:`string formatting ` to bind Python " +"values to SQL statements, to avoid `SQL injection attacks`_ (see :ref:`sqlite3-" +"placeholders` for more details)." msgstr "" +"توجه داشته باشید که از جای‌نگهدارهای ``?`` برای مقید کردن ``data`` به پرس‌وجو " +"استفاده می‌شود. همیشه برای مقید کردن مقادیر پایتون به دستورهای SQL، " +"به‌جای :ref:`قالب‌بندی رشته ` از جای‌نگهدارها استفاده کنید تا از `SQL " +"injection attacks`_ جلوگیری شود (برای جزئیات بیشتر :ref:`sqlite3-placeholders` را " +"ببینید)." -msgid "We can verify that the new rows were inserted by executing a ``SELECT`` query, this time iterating over the results of the query:" +msgid "" +"We can verify that the new rows were inserted by executing a ``SELECT`` query, " +"this time iterating over the results of the query:" msgstr "" +"می‌توانیم با اجرای یک پرس‌وجوی ``SELECT`` تأیید کنیم که ردیف‌های جدید درج شده‌اند؛ این " +"بار با پیمایش روی نتایج پرس‌وجو:" msgid "" ">>> for row in cur.execute(\"SELECT year, title FROM movie ORDER BY year\"):\n" @@ -176,12 +326,29 @@ msgid "" "(1982, 'Monty Python Live at the Hollywood Bowl')\n" "(1983, \"Monty Python's The Meaning of Life\")" msgstr "" +">>> for row in cur.execute(\"SELECT year, title FROM movie ORDER BY year\"):\n" +"... print(row)\n" +"(1971, 'And Now for Something Completely Different')\n" +"(1975, 'Monty Python and the Holy Grail')\n" +"(1979, \"Monty Python's Life of Brian\")\n" +"(1982, 'Monty Python Live at the Hollywood Bowl')\n" +"(1983, \"Monty Python's The Meaning of Life\")" -msgid "Each row is a two-item :class:`tuple` of ``(year, title)``, matching the columns selected in the query." +msgid "" +"Each row is a two-item :class:`tuple` of ``(year, title)``, matching the columns " +"selected in the query." msgstr "" +"هر ردیف یک :class:`tuple` دو آیتمی از ``(year, title)`` است که با ستون‌های انتخاب‌شده " +"در پرس‌وجو مطابقت دارد." -msgid "Finally, verify that the database has been written to disk by calling :meth:`con.close() ` to close the existing connection, opening a new one, creating a new cursor, then querying the database:" +msgid "" +"Finally, verify that the database has been written to disk by " +"calling :meth:`con.close() ` to close the existing connection, " +"opening a new one, creating a new cursor, then querying the database:" msgstr "" +"در نهایت، با فراخوانی :meth:`con.close() ` برای بستن اتصال " +"موجود، باز کردن یک اتصال جدید، ایجاد یک مکان‌نمای جدید و سپس پرس‌وجو از پایگاه داده، " +"تأیید کنید که پایگاه داده روی دیسک نوشته شده است:" msgid "" ">>> con.close()\n" @@ -189,103 +356,217 @@ msgid "" ">>> new_cur = new_con.cursor()\n" ">>> res = new_cur.execute(\"SELECT title, year FROM movie ORDER BY score DESC\")\n" ">>> title, year = res.fetchone()\n" -">>> print(f'The highest scoring Monty Python movie is {title!r}, released in {year}')\n" -"The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', released in 1975\n" +">>> print(f'The highest scoring Monty Python movie is {title!r}, released in " +"{year}')\n" +"The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', " +"released in 1975\n" ">>> new_con.close()" msgstr "" +">>> con.close()\n" +">>> new_con = sqlite3.connect(\"tutorial.db\")\n" +">>> new_cur = new_con.cursor()\n" +">>> res = new_cur.execute(\"SELECT title, year FROM movie ORDER BY score DESC\")\n" +">>> title, year = res.fetchone()\n" +">>> print(f'The highest scoring Monty Python movie is {title!r}, released in " +"{year}')\n" +"The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', " +"released in 1975\n" +">>> new_con.close()" -msgid "You've now created an SQLite database using the :mod:`!sqlite3` module, inserted data and retrieved values from it in multiple ways." +msgid "" +"You've now created an SQLite database using the :mod:`!sqlite3` module, inserted " +"data and retrieved values from it in multiple ways." msgstr "" +"اکنون با استفاده از ماژول :mod:`!sqlite3` یک پایگاه داده SQLite ایجاد کرده‌اید، " +"داده‌ها را درج کرده‌اید و مقادیر را به روش‌های متعدد از آن بازیابی کرده‌اید." msgid ":ref:`sqlite3-howtos` for further reading:" -msgstr "" +msgstr ":ref:`sqlite3-howtos` برای مطالعه بیشتر:" msgid ":ref:`sqlite3-placeholders`" -msgstr "" +msgstr ":ref:`sqlite3-placeholders`" msgid ":ref:`sqlite3-adapters`" -msgstr "" +msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" -msgstr "" +msgstr ":ref:`sqlite3-converters`" msgid ":ref:`sqlite3-connection-context-manager`" -msgstr "" +msgstr ":ref:`sqlite3-connection-context-manager`" msgid ":ref:`sqlite3-howto-row-factory`" -msgstr "" +msgstr ":ref:`sqlite3-howto-row-factory`" msgid ":ref:`sqlite3-explanation` for in-depth background on transaction control." -msgstr "" +msgstr ":ref:`sqlite3-explanation` برای پیش‌زمینه‌ی تفصیلی درباره‌ی کنترل تراکنش." msgid "Reference" -msgstr "" +msgstr "مرجع" msgid "Module functions" -msgstr "" +msgstr "توابع ماژول" msgid "Open a connection to an SQLite database." -msgstr "" +msgstr "باز کردن اتصال به یک پایگاه داده‌ی SQLite." msgid "Parameters" -msgstr "" +msgstr "پارامترها" -msgid "The path to the database file to be opened. You can pass ``\":memory:\"`` to create an `SQLite database existing only in memory `_, and open a connection to it." +msgid "" +"The path to the database file to be opened. You can pass ``\":memory:\"`` to " +"create an `SQLite database existing only in memory `_, and open a connection to it." msgstr "" +"مسیر فایل پایگاه داده‌ای که باید باز شود. می‌توانید ``\":memory:\"`` را برای ایجاد " +"یک `پایگاه داده SQLite که فقط در حافظه وجود دارد `_ و باز کردن اتصالی به آن ارسال کنید." -msgid "How many seconds the connection should wait before raising an :exc:`OperationalError` when a table is locked. If another connection opens a transaction to modify a table, that table will be locked until the transaction is committed. Default five seconds." +msgid "" +"How many seconds the connection should wait before raising " +"an :exc:`OperationalError` when a table is locked. If another connection opens a " +"transaction to modify a table, that table will be locked until the transaction is " +"committed. Default five seconds." msgstr "" +"تعداد ثانیه‌هایی که اتصال باید هنگام قفل بودن یک جدول، پیش از " +"پرتاب :exc:`OperationalError` منتظر بماند. اگر اتصال دیگری تراکنشی را برای تغییر " +"یک جدول آغاز کند، آن جدول تا زمانی که تراکنش ثبت نهایی (commit) شود، قفل خواهد بود. " +"پیش‌فرض پنج ثانیه است." -msgid "Control whether and how data types not :ref:`natively supported by SQLite ` are looked up to be converted to Python types, using the converters registered with :func:`register_converter`. Set it to any combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to enable this. Column names take precedence over declared types if both flags are set. By default (``0``), type detection is disabled." -msgstr "" +msgid "" +"Control whether and how data types not :ref:`natively supported by SQLite ` are looked up to be converted to Python types, using the converters " +"registered with :func:`register_converter`. Set it to any combination (using ``|" +"``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to enable " +"this. Column names take precedence over declared types if both flags are set. By " +"default (``0``), type detection is disabled." +msgstr "" +"کنترل کنید که آیا و چگونه انواع داده‌ای که :ref:`به‌صورت بومی توسط SQLite پشتیبانی " +"نمی‌شوند `، جستجو می‌شوند تا با استفاده از مبدل‌های ثبت‌شده " +"با :func:`register_converter` به نوع‌های پایتون تبدیل شوند. برای فعال‌سازی این مورد، " +"آن را روی هر ترکیبی از :const:`PARSE_DECLTYPES` و :const:`PARSE_COLNAMES` (با " +"استفاده از ``|``، یا بیتی) تنظیم کنید. اگر هر دو پرچم تنظیم شده باشند، نام ستون‌ها " +"بر نوع‌های اعلام‌شده اولویت دارند. به‌طور پیش‌فرض (``0``)، تشخیص نوع غیرفعال است." -msgid "Control legacy transaction handling behaviour. See :attr:`Connection.isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. Has no effect unless :attr:`Connection.autocommit` is set to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." -msgstr "" +msgid "" +"Control legacy transaction handling behaviour. " +"See :attr:`Connection.isolation_level` and :ref:`sqlite3-transaction-control-" +"isolation-level` for more information. Can be ``\"DEFERRED\"`` (default), " +"``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable opening " +"transactions implicitly. Has no effect unless :attr:`Connection.autocommit` is set " +"to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." +msgstr "" +"رفتار مدیریت تراکنش‌ها به روش قدیمی را کنترل می‌کند. برای اطلاعات " +"بیشتر :attr:`Connection.isolation_level` و :ref:`sqlite3-transaction-control-" +"isolation-level` را ببینید. می‌تواند ``\"DEFERRED\"`` (پیش‌فرض)، ``\"EXCLUSIVE\"`` " +"یا ``\"IMMEDIATE\"`` باشد؛ یا برای غیرفعال کردن باز شدن تراکنش‌ها به‌صورت ضمنی، " +"``None`` باشد. هیچ تأثیری ندارد مگر اینکه :attr:`Connection.autocommit` " +"روی :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (پیش‌فرض) تنظیم شده باشد." -msgid "If ``True`` (default), :exc:`ProgrammingError` will be raised if the database connection is used by a thread other than the one that created it. If ``False``, the connection may be accessed in multiple threads; write operations may need to be serialized by the user to avoid data corruption. See :attr:`threadsafety` for more information." -msgstr "" +msgid "" +"If ``True`` (default), :exc:`ProgrammingError` will be raised if the database " +"connection is used by a thread other than the one that created it. If ``False``, " +"the connection may be accessed in multiple threads; write operations may need to " +"be serialized by the user to avoid data corruption. See :attr:`threadsafety` for " +"more information." +msgstr "" +"اگر ``True`` (پیش‌فرض) باشد، در صورتی که از اتصال پایگاه داده در نخی غیر از نخی که " +"آن را ایجاد کرده است استفاده شود، :exc:`ProgrammingError` پرتاب می‌شود. اگر " +"``False`` باشد، ممکن است اتصال در چندین نخ مورد دسترسی قرار گیرد؛ ممکن است لازم " +"باشد کاربر برای جلوگیری از خرابی داده‌ها، عملیات نوشتن را به‌صورت متوالی اجرا کند. " +"برای اطلاعات بیشتر :attr:`threadsafety` را ببینید." -msgid "A custom subclass of :class:`Connection` to create the connection with, if not the default :class:`Connection` class." +msgid "" +"A custom subclass of :class:`Connection` to create the connection with, if not the " +"default :class:`Connection` class." msgstr "" +"یک زیرکلاس سفارشی از :class:`Connection` برای ایجاد اتصال با آن، اگر کلاس " +"پیش‌فرض :class:`Connection` نباشد." -msgid "The number of statements that :mod:`!sqlite3` should internally cache for this connection, to avoid parsing overhead. By default, 128 statements." +msgid "" +"The number of statements that :mod:`!sqlite3` should internally cache for this " +"connection, to avoid parsing overhead. By default, 128 statements." msgstr "" +"تعداد دستورهایی که :mod:`!sqlite3` باید برای این اتصال به‌صورت داخلی در نهانگاه " +"ذخیره کند، تا از سربار تجزیه جلوگیری شود. به‌طور پیش‌فرض، ۱۲۸ دستور." -msgid "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform Resource Identifier)` with a file path and an optional query string. The scheme part *must* be ``\"file:\"``, and the path can be relative or absolute. The query string allows passing parameters to SQLite, enabling various :ref:`sqlite3-uri-tricks`." +msgid "" +"If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform Resource " +"Identifier)` with a file path and an optional query string. The scheme part *must* " +"be ``\"file:\"``, and the path can be relative or absolute. The query string " +"allows passing parameters to SQLite, enabling various :ref:`sqlite3-uri-tricks`." msgstr "" +"اگر روی ``True`` تنظیم شود، *database* به‌عنوان یک :abbr:`URI (Uniform Resource " +"Identifier)` با یک مسیر فایل و یک رشته‌ی پرس‌وجوی اختیاری تفسیر می‌شود. بخش طرح‌واره " +"(scheme) *باید* ``\"file:\"`` باشد، و مسیر می‌تواند نسبی یا مطلق باشد. رشته‌ی پرس‌وجو " +"امکان ارسال پارامترها به SQLite را فراهم می‌کند و ترفندهای گوناگون :ref:`sqlite3-" +"uri-tricks` را ممکن می‌سازد." -msgid "Control :pep:`249` transaction handling behaviour. See :attr:`Connection.autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more information. *autocommit* currently defaults to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a future Python release." -msgstr "" +msgid "" +"Control :pep:`249` transaction handling behaviour. " +"See :attr:`Connection.autocommit` and :ref:`sqlite3-transaction-control-" +"autocommit` for more information. *autocommit* currently defaults " +"to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`. The default will change to " +"``False`` in a future Python release." +msgstr "" +"رفتار مدیریت تراکنش :pep:`249` را کنترل می‌کند. برای اطلاعات " +"بیشتر، :attr:`Connection.autocommit` و :ref:`sqlite3-transaction-control-" +"autocommit` را ببینید. مقدار پیش‌فرض *autocommit* در حال " +"حاضر :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` است. این مقدار پیش‌فرض در یکی از " +"نسخه‌های آینده پایتون به ``False`` تغییر خواهد کرد." msgid "Return type" -msgstr "" +msgstr "نوع بازگشتی" -msgid "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument ``database``." +msgid "" +"Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " +"``database``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sqlite3.connect`` را با آرگومان ``database`` " +"پرتاب می‌کند." -msgid "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with argument ``connection_handle``." +msgid "" +"Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " +"argument ``connection_handle``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sqlite3.connect/handle`` را با آرگومان " +"``connection_handle`` پرتاب می‌کند." msgid "Added the *uri* parameter." -msgstr "" +msgstr "پارامتر *uri* اضافه شد." msgid "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" +"*database* اکنون می‌تواند یک :term:`path-like object` نیز باشد، نه فقط یک رشته." msgid "Added the ``sqlite3.connect/handle`` auditing event." -msgstr "" +msgstr "رویداد حسابرسی ``sqlite3.connect/handle`` افزوده شد." msgid "Added the *autocommit* parameter." -msgstr "" +msgstr "پارامتر *autocommit* افزوده شد." -msgid "Positional use of the parameters *timeout*, *detect_types*, *isolation_level*, *check_same_thread*, *factory*, *cached_statements*, and *uri* is deprecated. They will become keyword-only parameters in Python 3.15." +msgid "" +"Positional use of the parameters *timeout*, *detect_types*, *isolation_level*, " +"*check_same_thread*, *factory*, *cached_statements*, and *uri* is deprecated. They " +"will become keyword-only parameters in Python 3.15." msgstr "" +"استفاده‌ی جایگاهی از پارامترهای *timeout*، *detect_types*، *isolation_level*، " +"*check_same_thread*، *factory*، *cached_statements* و *uri* منسوخ شده است. این " +"پارامترها در پایتون 3.15 به پارامترهای فقط کلیدواژه‌ای تبدیل خواهند شد." -msgid "Return ``True`` if the string *statement* appears to contain one or more complete SQL statements. No syntactic verification or parsing of any kind is performed, other than checking that there are no unclosed string literals and the statement is terminated by a semicolon." +msgid "" +"Return ``True`` if the string *statement* appears to contain one or more complete " +"SQL statements. No syntactic verification or parsing of any kind is performed, " +"other than checking that there are no unclosed string literals and the statement " +"is terminated by a semicolon." msgstr "" +"اگر به نظر برسد که رشته‌ی *statement* حاوی یک یا چند دستور کامل SQL باشد، ``True`` " +"را برمی‌گرداند. هیچ‌گونه صحت‌سنجی سینتکسی یا تجزیه‌ای از هیچ نوع انجام نمی‌شود، به‌جز " +"بررسی اینکه هیچ لفظی رشته‌ای بسته‌نشده‌ای وجود نداشته باشد و دستور با نقطه‌ویرگول " +"پایان یافته باشد." msgid "For example:" -msgstr "" +msgstr "برای مثال:" msgid "" ">>> sqlite3.complete_statement(\"SELECT foo FROM bar;\")\n" @@ -293,36 +574,104 @@ msgid "" ">>> sqlite3.complete_statement(\"SELECT foo\")\n" "False" msgstr "" +">>> sqlite3.complete_statement(\"SELECT foo FROM bar;\")\n" +"True\n" +">>> sqlite3.complete_statement(\"SELECT foo\")\n" +"False" -msgid "This function may be useful during command-line input to determine if the entered text seems to form a complete SQL statement, or if additional input is needed before calling :meth:`~Cursor.execute`." +msgid "" +"This function may be useful during command-line input to determine if the entered " +"text seems to form a complete SQL statement, or if additional input is needed " +"before calling :meth:`~Cursor.execute`." msgstr "" +"این تابع ممکن است در حین ورودی از خط فرمان برای تشخیص این‌که آیا به نظر می‌رسد متن " +"واردشده یک دستور SQL کامل را تشکیل می‌دهد، یا پیش از " +"فراخوانی :meth:`~Cursor.execute` به ورودی بیشتری نیاز است، مفید باشد." -msgid "See :func:`!runsource` in :source:`Lib/sqlite3/__main__.py` for real-world use." +msgid "" +"See :func:`!runsource` in :source:`Lib/sqlite3/__main__.py` for real-world use." msgstr "" +"برای استفاده در دنیای واقعی، :func:`!runsource` را در :source:`Lib/sqlite3/" +"__main__.py` ببینید." -msgid "Enable or disable callback tracebacks. By default you will not get any tracebacks in user-defined functions, aggregates, converters, authorizer callbacks etc. If you want to debug them, you can call this function with *flag* set to ``True``. Afterwards, you will get tracebacks from callbacks on :data:`sys.stderr`. Use ``False`` to disable the feature again." -msgstr "" +msgid "" +"Enable or disable callback tracebacks. By default you will not get any tracebacks " +"in user-defined functions, aggregates, converters, authorizer callbacks etc. If " +"you want to debug them, you can call this function with *flag* set to ``True``. " +"Afterwards, you will get tracebacks from callbacks on :data:`sys.stderr`. Use " +"``False`` to disable the feature again." +msgstr "" +"فعال یا غیرفعال کردن ردگیری‌های پشته‌ی کال‌بک‌ها. به‌طور پیش‌فرض، هیچ ردگیری پشته‌ای در " +"توابع تعریف‌شده توسط کاربر، تجمیع‌ها، مبدل‌ها، کال‌بک‌های مجوزدهنده و غیره دریافت " +"نخواهید کرد. اگر می‌خواهید آن‌ها را اشکال‌زدایی کنید، می‌توانید این تابع را با *flag* " +"برابر ``True`` فراخوانی کنید. پس از آن، ردگیری‌های پشته‌ی کال‌بک‌ها را " +"در :data:`sys.stderr` دریافت خواهید کرد. برای غیرفعال کردن مجدد این قابلیت، از " +"``False`` استفاده کنید." -msgid "Errors in user-defined function callbacks are logged as unraisable exceptions. Use an :func:`unraisable hook handler ` for introspection of the failed callback." +msgid "" +"Errors in user-defined function callbacks are logged as unraisable exceptions. Use " +"an :func:`unraisable hook handler ` for introspection of the " +"failed callback." msgstr "" +"خطاهای کال‌بک‌های تابعی تعریف‌شده توسط کاربر به‌عنوان استثناهای غیرقابل‌پرتاب ثبت " +"می‌شوند. برای درون‌نگری کال‌بک ناموفق، از یک :func:`unraisable hook handler " +"` استفاده کنید." -msgid "Register an *adapter* :term:`callable` to adapt the Python type *type* into an SQLite type. The adapter is called with a Python object of type *type* as its sole argument, and must return a value of a :ref:`type that SQLite natively understands `." +msgid "" +"Register an *adapter* :term:`callable` to adapt the Python type *type* into an " +"SQLite type. The adapter is called with a Python object of type *type* as its sole " +"argument, and must return a value of a :ref:`type that SQLite natively understands " +"`." msgstr "" +"یک *adapter* :term:`callable` برای تبدیل نوع پایتون *type* به یک نوع SQLite ثبت " +"کنید. این آداپتور با یک شیء پایتون از نوع *type* به‌عنوان تنها آرگومان خود فراخوانی " +"می‌شود و باید مقداری از :ref:`نوعی که SQLite به‌صورت بومی آن را می‌شناسد ` برگرداند." -msgid "Register the *converter* :term:`callable` to convert SQLite objects of type *typename* into a Python object of a specific type. The converter is invoked for all SQLite values of type *typename*; it is passed a :class:`bytes` object and should return an object of the desired Python type. Consult the parameter *detect_types* of :func:`connect` for information regarding how type detection works." -msgstr "" +msgid "" +"Register the *converter* :term:`callable` to convert SQLite objects of type " +"*typename* into a Python object of a specific type. The converter is invoked for " +"all SQLite values of type *typename*; it is passed a :class:`bytes` object and " +"should return an object of the desired Python type. Consult the parameter " +"*detect_types* of :func:`connect` for information regarding how type detection " +"works." +msgstr "" +"برای تبدیل اشیای SQLite از نوع *typename* به یک شیء پایتون از نوع مشخص، " +"*converter* :term:`callable` را ثبت کنید. مبدل برای همه مقادیر SQLite از نوع " +"*typename* فراخوانی می‌شود؛ یک شیء :class:`bytes` به آن داده می‌شود و باید یک شیء از " +"نوع پایتون دلخواه را برگرداند. برای آگاهی از چگونگی کارکرد تشخیص نوع، به پارامتر " +"*detect_types* در :func:`connect` مراجعه کنید." -msgid "Note: *typename* and the name of the type in your query are matched case-insensitively." +msgid "" +"Note: *typename* and the name of the type in your query are matched case-" +"insensitively." msgstr "" +"توجه: *typename* و نام نوع در پرس‌وجوی شما، بدون حساسیت به بزرگی و کوچکی حروف تطبیق " +"داده می‌شوند." msgid "Module constants" -msgstr "" +msgstr "ثابت‌های ماژول" -msgid "Set :attr:`~Connection.autocommit` to this constant to select old style (pre-Python 3.12) transaction control behaviour. See :ref:`sqlite3-transaction-control-isolation-level` for more information." +msgid "" +"Set :attr:`~Connection.autocommit` to this constant to select old style (pre-" +"Python 3.12) transaction control behaviour. See :ref:`sqlite3-transaction-control-" +"isolation-level` for more information." msgstr "" +"برای انتخاب رفتار کنترل تراکنش به سبک قدیمی (پیش از Python " +"3.12)، :attr:`~Connection.autocommit` را روی این ثابت تنظیم کنید. برای اطلاعات " +"بیشتر :ref:`sqlite3-transaction-control-isolation-level` را ببینید." -msgid "Pass this flag value to the *detect_types* parameter of :func:`connect` to look up a converter function using the declared types for each column. The types are declared when the database table is created. :mod:`!sqlite3` will look up a converter function using the first word of the declared type as the converter dictionary key. For example:" +msgid "" +"Pass this flag value to the *detect_types* parameter of :func:`connect` to look up " +"a converter function using the declared types for each column. The types are " +"declared when the database table is created. :mod:`!sqlite3` will look up a " +"converter function using the first word of the declared type as the converter " +"dictionary key. For example:" msgstr "" +"مقدار این پرچم را به پارامتر *detect_types* در :func:`connect` بدهید تا با استفاده " +"از انواع اعلام‌شده برای هر ستون، یک تابع تبدیل‌کننده جست‌وجو شود. این انواع هنگام ایجاد " +"جدول پایگاه داده اعلام می‌شوند. :mod:`!sqlite3` یک تابع تبدیل‌کننده را با استفاده از " +"نخستین واژه‌ی نوع اعلام‌شده به‌عنوان کلید دیکشنری مبدل جست‌وجو می‌کند. برای مثال:" msgid "" "CREATE TABLE test(\n" @@ -331,207 +680,365 @@ msgid "" " n number(10) ! will look up a converter named \"number\"\n" " )" msgstr "" +"CREATE TABLE test(\n" +" i integer primary key, ! به دنبال مبدلی به نام \"integer\" می‌گردد\n" +" p point, ! به دنبال مبدلی به نام \"point\" می‌گردد\n" +" n number(10) ! به دنبال مبدلی به نام \"number\" می‌گردد\n" +" )" -msgid "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` (bitwise or) operator." +msgid "" +"This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` (bitwise " +"or) operator." msgstr "" +"این پرچم را می‌توان با استفاده از عملگر ``|`` (یا بیت‌به‌بیت) " +"با :const:`PARSE_COLNAMES` ترکیب کرد." -msgid "Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :const:`!PARSE_COLNAMES` to enforce types for such queries." +msgid "" +"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. " +"Use :const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" +"فیلدهای تولیدشده (برای مثال ``MAX(p)``) به‌صورت :class:`str` برگردانده می‌شوند. برای " +"اعمال نوع‌ها در چنین پرس‌وجوهایی از :const:`!PARSE_COLNAMES` استفاده کنید." -msgid "Pass this flag value to the *detect_types* parameter of :func:`connect` to look up a converter function by using the type name, parsed from the query column name, as the converter dictionary key. The query column name must be wrapped in double quotes (``\"``) and the type name must be wrapped in square brackets (``[]``)." +msgid "" +"Pass this flag value to the *detect_types* parameter of :func:`connect` to look up " +"a converter function by using the type name, parsed from the query column name, as " +"the converter dictionary key. The query column name must be wrapped in double " +"quotes (``\"``) and the type name must be wrapped in square brackets (``[]``)." msgstr "" +"این مقدار پرچم را به پارامتر *detect_types* از :func:`connect` بدهید تا با استفاده " +"از نام نوع، که از نام ستون پرس‌وجو تجزیه می‌شود، به‌عنوان کلید دیکشنری مبدل، یک تابع " +"مبدل را جستجو کنید. نام ستون پرس‌وجو باید داخل علامت نقل‌قول دوتایی (``\"``) و نام " +"نوع باید داخل کروشه (``[]``) قرار گیرد." msgid "SELECT MAX(p) as \"p [point]\" FROM test; ! will look up converter \"point\"" msgstr "" +"SELECT MAX(p) as \"p [point]\" FROM test; ! مبدل (converter) \"point\" را جست‌وجو " +"خواهد کرد" -msgid "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` (bitwise or) operator." +msgid "" +"This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` (bitwise " +"or) operator." msgstr "" +"می‌توان این پرچم را با :const:`PARSE_DECLTYPES` با استفاده از عملگر ``|`` (یا بیتی) " +"ترکیب کرد." -msgid "Flags that should be returned by the *authorizer_callback* :term:`callable` passed to :meth:`Connection.set_authorizer`, to indicate whether:" +msgid "" +"Flags that should be returned by the *authorizer_callback* :term:`callable` passed " +"to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" +"پرچم‌هایی که باید توسط *authorizer_callback* :term:`callable` ارسال‌شده " +"به :meth:`Connection.set_authorizer` بازگردانده شوند، تا نشان دهند که آیا:" msgid "Access is allowed (:const:`!SQLITE_OK`)," -msgstr "" +msgstr "دسترسی مجاز است (:const:`!SQLITE_OK`)،" msgid "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" -msgstr "" +msgstr "دستور SQL باید با یک خطا متوقف شود (:const:`!SQLITE_DENY`)" msgid "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" +"این ستون باید به‌عنوان یک مقدار ``NULL`` در نظر گرفته شود (:const:`!SQLITE_IGNORE`)" -msgid "String constant stating the supported DB-API level. Required by the DB-API. Hard-coded to ``\"2.0\"``." +msgid "" +"String constant stating the supported DB-API level. Required by the DB-API. Hard-" +"coded to ``\"2.0\"``." msgstr "" +"ثابت رشته‌ای که سطح DB-API پشتیبانی‌شده را اعلام می‌کند. مورد نیاز DB-API است. به‌صورت " +"سخت‌کد (hard-coded) برابر با ``\"2.0\"`` است." -msgid "String constant stating the type of parameter marker formatting expected by the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to ``\"qmark\"``." +msgid "" +"String constant stating the type of parameter marker formatting expected by " +"the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to ``\"qmark\"``." msgstr "" +"ثابت رشته‌ای که نوع قالب‌بندی نشانگر پارامتر مورد انتظار ماژول :mod:`!sqlite3` را " +"مشخص می‌کند. این ثابت توسط DB-API الزامی شده و به‌صورت سخت‌کد به ``\"qmark\"`` تنظیم " +"شده است." msgid "The ``named`` DB-API parameter style is also supported." -msgstr "" +msgstr "سبک پارامتر ``named`` در DB-API نیز پشتیبانی می‌شود." msgid "Version number of the runtime SQLite library as a :class:`string `." -msgstr "" +msgstr "شماره‌ی نسخه‌ی کتابخانه‌ی SQLite ران‌تایم به‌صورت یک :class:`string `." -msgid "Version number of the runtime SQLite library as a :class:`tuple` of :class:`integers `." +msgid "" +"Version number of the runtime SQLite library as a :class:`tuple` " +"of :class:`integers `." msgstr "" +"شماره نسخه کتابخانه SQLite در ران‌تایم به‌صورت یک :class:`tuple` از :class:`اعداد " +"صحیح `." -msgid "Integer constant required by the DB-API 2.0, stating the level of thread safety the :mod:`!sqlite3` module supports. This attribute is set based on the default `threading mode `_ the underlying SQLite library is compiled with. The SQLite threading modes are:" +msgid "" +"Integer constant required by the DB-API 2.0, stating the level of thread safety " +"the :mod:`!sqlite3` module supports. This attribute is set based on the default " +"`threading mode `_ the underlying SQLite " +"library is compiled with. The SQLite threading modes are:" msgstr "" +"ثابت عدد صحیح مورد نیاز DB-API 2.0، که سطح ایمنی نخی را که ماژول :mod:`!sqlite3` " +"پشتیبانی می‌کند، مشخص می‌کند. این ویژگی بر اساس `حالت نخی (threading mode) `_ پیش‌فرضی تنظیم می‌شود که کتابخانه زیربنایی SQLite با " +"آن کامپایل شده است. حالت‌های نخی SQLite عبارتند از:" -msgid "**Single-thread**: In this mode, all mutexes are disabled and SQLite is unsafe to use in more than a single thread at once." +msgid "" +"**Single-thread**: In this mode, all mutexes are disabled and SQLite is unsafe to " +"use in more than a single thread at once." msgstr "" +"**تک‌نخی**: در این حالت، همه قفل‌های متقابل غیرفعال هستند و استفاده از SQLite در بیش از " +"یک نخ به‌طور همزمان ایمن نیست." -msgid "**Multi-thread**: In this mode, SQLite can be safely used by multiple threads provided that no single database connection is used simultaneously in two or more threads." +msgid "" +"**Multi-thread**: In this mode, SQLite can be safely used by multiple threads " +"provided that no single database connection is used simultaneously in two or more " +"threads." msgstr "" +"**چندنخی**: در این حالت، می‌توان از SQLite به‌طور امن در چندین نخ استفاده کرد، مشروط " +"بر اینکه هیچ اتصال پایگاه داده‌ای به‌طور همزمان در دو یا چند نخ استفاده نشود." -msgid "**Serialized**: In serialized mode, SQLite can be safely used by multiple threads with no restriction." +msgid "" +"**Serialized**: In serialized mode, SQLite can be safely used by multiple threads " +"with no restriction." msgstr "" +"**سریال‌شده**: در حالت سریال‌شده، می‌توان از SQLite به‌صورت ایمن توسط چندین نخ بدون " +"هیچ‌گونه محدودیتی استفاده کرد." -msgid "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels are as follows:" -msgstr "" +msgid "" +"The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels are as " +"follows:" +msgstr "نگاشت حالت‌های نخی SQLite به سطوح ایمنی نخی DB-API 2.0 به شرح زیر است:" msgid "SQLite threading mode" -msgstr "" +msgstr "حالت نخ‌بندی SQLite" msgid ":pep:`threadsafety <0249#threadsafety>`" -msgstr "" +msgstr ":pep:`threadsafety <0249#threadsafety>`" msgid "`SQLITE_THREADSAFE`_" -msgstr "" +msgstr "`SQLITE_THREADSAFE`_" msgid "DB-API 2.0 meaning" -msgstr "" +msgstr "معنای DB-API 2.0" msgid "single-thread" -msgstr "" +msgstr "تک‌نخی" msgid "0" -msgstr "" +msgstr "0" msgid "Threads may not share the module" -msgstr "" +msgstr "نخ‌ها نمی‌توانند ماژول را به اشتراک بگذارند" msgid "multi-thread" -msgstr "" +msgstr "چندنخی" msgid "1" -msgstr "" +msgstr "1" msgid "2" -msgstr "" +msgstr "۲" msgid "Threads may share the module, but not connections" -msgstr "" +msgstr "نخ‌ها می‌توانند ماژول را به اشتراک بگذارند، اما اتصال‌ها را نه" msgid "serialized" -msgstr "" +msgstr "سریال‌شده" msgid "3" -msgstr "" +msgstr "۳" msgid "Threads may share the module, connections and cursors" -msgstr "" +msgstr "نخ‌ها می‌توانند ماژول، اتصال‌ها و مکان‌نماها را به اشتراک بگذارند" msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." -msgstr "" +msgstr "به‌جای سخت‌کد کردن آن روی ``1``، *threadsafety* را به‌صورت پویا تنظیم کنید." -msgid "These constants are used for the :meth:`Connection.setconfig` and :meth:`~Connection.getconfig` methods." +msgid "" +"These constants are used for the :meth:`Connection.setconfig` " +"and :meth:`~Connection.getconfig` methods." msgstr "" +"این ثابت‌ها برای متدهای :meth:`Connection.setconfig` " +"و :meth:`~Connection.getconfig` استفاده می‌شوند." -msgid "The availability of these constants varies depending on the version of SQLite Python was compiled with." +msgid "" +"The availability of these constants varies depending on the version of SQLite " +"Python was compiled with." msgstr "" +"دسترس‌پذیری این ثابت‌ها بسته به نسخه‌ی SQLite که پایتون با آن کامپایل شده است، " +"متفاوت است." msgid "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" -msgstr "" +msgstr "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" msgid "SQLite docs: Database Connection Configuration Options" -msgstr "" +msgstr "مستندات SQLite: گزینه‌های پیکربندی اتصال پایگاه داده" msgid "The :data:`!version` and :data:`!version_info` constants." -msgstr "" +msgstr "ثابت‌های :data:`!version` و :data:`!version_info`." msgid "Connection objects" -msgstr "" +msgstr "اشیای اتصال" -msgid "Each open SQLite database is represented by a ``Connection`` object, which is created using :func:`sqlite3.connect`. Their main purpose is creating :class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." +msgid "" +"Each open SQLite database is represented by a ``Connection`` object, which is " +"created using :func:`sqlite3.connect`. Their main purpose is " +"creating :class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" +"هر پایگاه داده‌ی باز SQLite با یک شیء ``Connection`` نمایش داده می‌شود، که با استفاده " +"از :func:`sqlite3.connect` ایجاد می‌شود. هدف اصلی آن‌ها ایجاد اشیای :class:`Cursor` " +"و :ref:`sqlite3-controlling-transactions` است." msgid ":ref:`sqlite3-connection-shortcuts`" -msgstr "" +msgstr ":ref:`sqlite3-connection-shortcuts`" -msgid "A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :class:`!Connection` object is deleted." +msgid "" +"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before " +"a :class:`!Connection` object is deleted." msgstr "" +"اگر :meth:`close` پیش از حذف یک شیء :class:`!Connection` فراخوانی نشود، " +"یک :exc:`ResourceWarning` صادر می‌شود." msgid "An SQLite database connection has the following attributes and methods:" -msgstr "" +msgstr "اتصال پایگاه داده‌ی SQLite دارای ویژگی‌ها و متدهای زیر است:" -msgid "Create and return a :class:`Cursor` object. The cursor method accepts a single optional parameter *factory*. If supplied, this must be a :term:`callable` returning an instance of :class:`Cursor` or its subclasses." +msgid "" +"Create and return a :class:`Cursor` object. The cursor method accepts a single " +"optional parameter *factory*. If supplied, this must be a :term:`callable` " +"returning an instance of :class:`Cursor` or its subclasses." msgstr "" +"یک شیء :class:`Cursor` را ایجاد کرده و برمی‌گرداند. متد cursor یک پارامتر اختیاری " +"واحد به نام *factory* می‌پذیرد. در صورت ارائه، این باید یک :term:`callable` باشد که " +"نمونه‌ای از :class:`Cursor` یا زیرکلاس‌های آن را برمی‌گرداند." -msgid "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large OBject)`." +msgid "" +"Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large OBject)`." msgstr "" +"یک دسته‌ی :class:`Blob` به یک :abbr:`BLOB (Binary Large OBject)` موجود باز کنید." msgid "The name of the table where the blob is located." -msgstr "" +msgstr "نام جدولی که blob در آن قرار دارد." msgid "The name of the column where the blob is located." -msgstr "" +msgstr "نام ستونی که blob در آن قرار دارد." msgid "The row id where the blob is located." -msgstr "" +msgstr "شناسه‌ی ردیفی که blob در آن قرار دارد." -msgid "Set to ``True`` if the blob should be opened without write permissions. Defaults to ``False``." +msgid "" +"Set to ``True`` if the blob should be opened without write permissions. Defaults " +"to ``False``." msgstr "" +"اگر قرار باشد blob بدون اجازه‌های نوشتن باز شود، روی ``True`` تنظیم شود. پیش‌فرض آن " +"``False`` است." msgid "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" +"نام پایگاه داده‌ای که بلاب (blob) در آن قرار دارد. به‌طور پیش‌فرض ``\"main\"`` است." msgid "Raises" -msgstr "" +msgstr "پرتاب می‌کند" msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." -msgstr "" +msgstr "هنگام تلاش برای باز کردن یک بلاب (blob) در جدول ``WITHOUT ROWID``." -msgid "The blob size cannot be changed using the :class:`Blob` class. Use the SQL function ``zeroblob`` to create a blob with a fixed size." +msgid "" +"The blob size cannot be changed using the :class:`Blob` class. Use the SQL " +"function ``zeroblob`` to create a blob with a fixed size." msgstr "" +"اندازه‌ی blob را نمی‌توان با استفاده از کلاس :class:`Blob` تغییر داد. برای ایجاد یک " +"blob با اندازه‌ی ثابت، از تابع SQL ``zeroblob`` استفاده کنید." -msgid "Commit any pending transaction to the database. If :attr:`autocommit` is ``True``, or there is no open transaction, this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a pending transaction was committed by this method." +msgid "" +"Commit any pending transaction to the database. If :attr:`autocommit` is ``True``, " +"or there is no open transaction, this method does nothing. If :attr:`!autocommit` " +"is ``False``, a new transaction is implicitly opened if a pending transaction was " +"committed by this method." msgstr "" +"هر تراکنش در انتظار را در پایگاه داده ثبت می‌کند. اگر :attr:`autocommit` برابر " +"``True`` باشد، یا هیچ تراکنش بازی وجود نداشته باشد، این متد هیچ کاری انجام نمی‌دهد. " +"اگر :attr:`!autocommit` برابر ``False`` باشد، چنانچه تراکنش در انتظاری توسط این " +"متد ثبت شود، تراکنش جدیدی به‌طور ضمنی باز می‌شود." -msgid "Roll back to the start of any pending transaction. If :attr:`autocommit` is ``True``, or there is no open transaction, this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a pending transaction was rolled back by this method." +msgid "" +"Roll back to the start of any pending transaction. If :attr:`autocommit` is " +"``True``, or there is no open transaction, this method does nothing. If :attr:`!" +"autocommit` is ``False``, a new transaction is implicitly opened if a pending " +"transaction was rolled back by this method." msgstr "" +"به آغاز هر تراکنش در حال انتظار عقب‌گرد می‌کند. اگر :attr:`autocommit` برابر " +"``True`` باشد، یا هیچ تراکنش بازی وجود نداشته باشد، این متد هیچ کاری انجام نمی‌دهد. " +"اگر :attr:`!autocommit` برابر ``False`` باشد، در صورتی که یک تراکنش در حال انتظار " +"توسط این متد عقب‌گرد شده باشد، تراکنش جدیدی به‌طور ضمنی باز می‌شود." -msgid "Close the database connection. If :attr:`autocommit` is ``False``, any pending transaction is implicitly rolled back. If :attr:`!autocommit` is ``True`` or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction control is executed. Make sure to :meth:`commit` before closing to avoid losing pending changes." -msgstr "" +msgid "" +"Close the database connection. If :attr:`autocommit` is ``False``, any pending " +"transaction is implicitly rolled back. If :attr:`!autocommit` is ``True`` " +"or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction control is " +"executed. Make sure to :meth:`commit` before closing to avoid losing pending " +"changes." +msgstr "" +"اتصال به پایگاه داده را ببندید. اگر :attr:`autocommit` برابر ``False`` باشد، هر " +"تراکنش در انتظاری به‌صورت ضمنی بازگردانده می‌شود. اگر :attr:`!autocommit` برابر " +"``True`` یا :data:`LEGACY_TRANSACTION_CONTROL` باشد، هیچ کنترل تراکنشی به‌صورت ضمنی " +"اعمال نمی‌شود. برای جلوگیری از دست رفتن تغییرات در انتظار، اطمینان حاصل کنید که پیش " +"از بستن، :meth:`commit` را فراخوانی کنید." -msgid "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it with the given *sql* and *parameters*. Return the new cursor object." +msgid "" +"Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it with " +"the given *sql* and *parameters*. Return the new cursor object." msgstr "" +"یک شیء :class:`Cursor` جدید ایجاد می‌کند و :meth:`~Cursor.execute` را با *sql* و " +"*parameters* داده‌شده روی آن فراخوانی می‌کند. شیء کرسر جدید را برمی‌گرداند." -msgid "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on it with the given *sql* and *parameters*. Return the new cursor object." +msgid "" +"Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on it " +"with the given *sql* and *parameters*. Return the new cursor object." msgstr "" +"یک شیء :class:`Cursor` جدید ایجاد کنید و :meth:`~Cursor.executemany` را با *sql* و " +"*parameters* داده‌شده روی آن فراخوانی کنید. شیء نشانگر جدید را برگردانید." -msgid "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` on it with the given *sql_script*. Return the new cursor object." +msgid "" +"Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` on it " +"with the given *sql_script*. Return the new cursor object." msgstr "" +"یک شیء :class:`Cursor` جدید ایجاد می‌کند و :meth:`~Cursor.executescript` را با " +"*sql_script* داده‌شده روی آن فراخوانی می‌کند. شیء نشانگر (cursor) جدید را برمی‌گرداند." msgid "Create or remove a user-defined SQL function." -msgstr "" +msgstr "ایجاد یا حذف یک تابع SQL تعریف‌شده توسط کاربر." msgid "The name of the SQL function." -msgstr "" +msgstr "نام تابع SQL." -msgid "The number of arguments the SQL function can accept. If ``-1``, it may take any number of arguments." +msgid "" +"The number of arguments the SQL function can accept. If ``-1``, it may take any " +"number of arguments." msgstr "" +"تعداد آرگومان‌هایی که تابع SQL می‌تواند بپذیرد. اگر ``-1`` باشد، می‌تواند هر تعداد " +"آرگومان بگیرد." -msgid "A :term:`callable` that is called when the SQL function is invoked. The callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." +msgid "" +"A :term:`callable` that is called when the SQL function is invoked. The callable " +"must return :ref:`a type natively supported by SQLite `. Set to " +"``None`` to remove an existing SQL function." msgstr "" +"یک :term:`فراخوان‌پذیر ` است که هنگام فراخوانی تابع SQL فراخوانده می‌شود. " +"این فراخوان‌پذیر باید :ref:`نوعی که SQLite به‌صورت بومی از آن پشتیبانی می‌کند " +"` را برگرداند. برای حذف یک تابع SQL موجود، آن را روی ``None`` تنظیم " +"کنید." -msgid "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional optimizations." +msgid "" +"If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " +"optimizations." msgstr "" +"اگر ``True`` باشد، تابع SQL ایجادشده به‌عنوان `قطعی (deterministic) `_ علامت‌گذاری می‌شود، که به SQLite امکان می‌دهد " +"بهینه‌سازی‌های بیشتری انجام دهد." msgid "Added the *deterministic* parameter." -msgstr "" +msgstr "پارامتر *deterministic* افزوده شد." msgid "Example:" -msgstr "" +msgstr "مثال:" msgid "" ">>> import hashlib\n" @@ -544,36 +1051,69 @@ msgid "" "('acbd18db4cc2f85cedef654fccc4a4d8',)\n" ">>> con.close()" msgstr "" +">>> import hashlib\n" +">>> def md5sum(t):\n" +"... return hashlib.md5(t).hexdigest()\n" +">>> con = sqlite3.connect(\":memory:\")\n" +">>> con.create_function(\"md5\", 1, md5sum)\n" +">>> for row in con.execute(\"SELECT md5(?)\", (b\"foo\",)):\n" +"... print(row)\n" +"('acbd18db4cc2f85cedef654fccc4a4d8',)\n" +">>> con.close()" -msgid "Passing *name*, *narg*, and *func* as keyword arguments is deprecated. These parameters will become positional-only in Python 3.15." +msgid "" +"Passing *name*, *narg*, and *func* as keyword arguments is deprecated. These " +"parameters will become positional-only in Python 3.15." msgstr "" +"ارسال *name*، *narg* و *func* به‌صورت آرگومان‌های کلیدواژه‌ای منسوخ شده است. این " +"پارامترها در پایتون 3.15 فقط جایگاهی خواهند شد." msgid "Create or remove a user-defined SQL aggregate function." -msgstr "" +msgstr "ایجاد یا حذف یک تابع تجمیعی SQL تعریف‌شده توسط کاربر." msgid "The name of the SQL aggregate function." -msgstr "" +msgstr "نام تابع تجمعی SQL." -msgid "The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments." +msgid "" +"The number of arguments the SQL aggregate function can accept. If ``-1``, it may " +"take any number of arguments." msgstr "" +"تعداد آرگومان‌هایی که تابع تجمیعی SQL می‌تواند بپذیرد. اگر ``-1`` باشد، ممکن است هر " +"تعداد آرگومان را بپذیرد." -msgid "A class must implement the following methods: * ``step()``: Add a row to the aggregate. * ``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite `. The number of arguments that the ``step()`` method must accept is controlled by *n_arg*. Set to ``None`` to remove an existing SQL aggregate function." -msgstr "" +msgid "" +"A class must implement the following methods: * ``step()``: Add a row to the " +"aggregate. * ``finalize()``: Return the final result of the aggregate as :ref:`a " +"type natively supported by SQLite `. The number of arguments that " +"the ``step()`` method must accept is controlled by *n_arg*. Set to ``None`` to " +"remove an existing SQL aggregate function." +msgstr "" +"یک کلاس باید متدهای زیر را پیاده‌سازی کند: * ``step()``: یک ردیف را به تجمیع اضافه " +"می‌کند. * ``finalize()``: نتیجه نهایی تجمیع را به‌عنوان :ref:`نوعی که به‌صورت بومی " +"توسط SQLite پشتیبانی می‌شود ` برمی‌گرداند. تعداد آرگومان‌هایی که متد " +"``step()`` باید بپذیرد، با *n_arg* کنترل می‌شود. برای حذف یک تابع تجمیعی SQL " +"موجود، آن را روی ``None`` تنظیم کنید." msgid "A class must implement the following methods:" -msgstr "" +msgstr "یک کلاس باید متدهای زیر را پیاده‌سازی کند:" msgid "``step()``: Add a row to the aggregate." -msgstr "" +msgstr "``step()``: یک ردیف به تجمیع اضافه می‌کند." -msgid "``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite `." +msgid "" +"``finalize()``: Return the final result of the aggregate as :ref:`a type natively " +"supported by SQLite `." msgstr "" +"``finalize()``: نتیجه نهایی تجمیع را به‌عنوان :ref:`نوعی که به‌صورت بومی توسط SQLite " +"پشتیبانی می‌شود ` برمی‌گرداند." -msgid "The number of arguments that the ``step()`` method must accept is controlled by *n_arg*." -msgstr "" +msgid "" +"The number of arguments that the ``step()`` method must accept is controlled by " +"*n_arg*." +msgstr "تعداد آرگومان‌هایی که متد ``step()`` باید بپذیرد، توسط *n_arg* کنترل می‌شود." msgid "Set to ``None`` to remove an existing SQL aggregate function." -msgstr "" +msgstr "برای حذف یک تابع تجمیعی SQL موجود، آن را روی ``None`` تنظیم کنید." msgid "" "class MySum:\n" @@ -596,42 +1136,90 @@ msgid "" "\n" "con.close()" msgstr "" +"class MySum:\n" +" def __init__(self):\n" +" self.count = 0\n" +"\n" +" def step(self, value):\n" +" self.count += value\n" +"\n" +" def finalize(self):\n" +" return self.count\n" +"\n" +"con = sqlite3.connect(\":memory:\")\n" +"con.create_aggregate(\"mysum\", 1, MySum)\n" +"cur = con.execute(\"CREATE TABLE test(i)\")\n" +"cur.execute(\"INSERT INTO test(i) VALUES(1)\")\n" +"cur.execute(\"INSERT INTO test(i) VALUES(2)\")\n" +"cur.execute(\"SELECT mysum(i) FROM test\")\n" +"print(cur.fetchone()[0])\n" +"\n" +"con.close()" -msgid "Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is deprecated. These parameters will become positional-only in Python 3.15." +msgid "" +"Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is deprecated. " +"These parameters will become positional-only in Python 3.15." msgstr "" +"ارسال *name*، *n_arg* و *aggregate_class* به‌صورت آرگومان‌های کلیدواژه‌ای منسوخ شده " +"است. این پارامترها در پایتون 3.15 فقط جایگاهی خواهند شد." msgid "Create or remove a user-defined aggregate window function." -msgstr "" +msgstr "ایجاد یا حذف یک تابع پنجره‌ای تجمیعی تعریف‌شده توسط کاربر." msgid "The name of the SQL aggregate window function to create or remove." -msgstr "" +msgstr "نام تابع پنجره‌ای تجمیعی SQL برای ایجاد یا حذف." -msgid "The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments." +msgid "" +"The number of arguments the SQL aggregate window function can accept. If ``-1``, " +"it may take any number of arguments." msgstr "" +"تعداد آرگومان‌هایی که تابع تجمیعی پنجره‌ای SQL می‌تواند بپذیرد. اگر ``-1`` باشد، " +"می‌تواند هر تعداد آرگومان بگیرد." -msgid "A class that must implement the following methods: * ``step()``: Add a row to the current window. * ``value()``: Return the current value of the aggregate. * ``inverse()``: Remove a row from the current window. * ``finalize()``: Return the final result of the aggregate as :ref:`a type natively supported by SQLite `. The number of arguments that the ``step()`` and ``value()`` methods must accept is controlled by *num_params*. Set to ``None`` to remove an existing SQL aggregate window function." -msgstr "" +msgid "" +"A class that must implement the following methods: * ``step()``: Add a row to the " +"current window. * ``value()``: Return the current value of the aggregate. * " +"``inverse()``: Remove a row from the current window. * ``finalize()``: Return the " +"final result of the aggregate as :ref:`a type natively supported by SQLite " +"`. The number of arguments that the ``step()`` and ``value()`` " +"methods must accept is controlled by *num_params*. Set to ``None`` to remove an " +"existing SQL aggregate window function." +msgstr "" +"کلاسی که باید متدهای زیر را پیاده‌سازی کند: * ``step()``: افزودن یک ردیف به پنجره " +"جاری. * ``value()``: برگرداندن مقدار فعلی تجمیع. * ``inverse()``: حذف یک ردیف از " +"پنجره جاری. * ``finalize()``: برگرداندن نتیجه نهایی تجمیع به‌عنوان :ref:`نوعی که " +"SQLite به‌صورت بومی از آن پشتیبانی می‌کند `. تعداد آرگومان‌هایی که " +"متدهای ``step()`` و ``value()`` باید بپذیرند، با *num_params* کنترل می‌شود. برای " +"حذف یک تابع پنجره‌ای تجمیعی SQL موجود، آن را روی ``None`` تنظیم کنید." msgid "A class that must implement the following methods:" -msgstr "" +msgstr "کلاسی که باید متدهای زیر را پیاده‌سازی کند:" msgid "``step()``: Add a row to the current window." -msgstr "" +msgstr "``step()``: یک ردیف به پنجره‌ی جاری اضافه می‌کند." msgid "``value()``: Return the current value of the aggregate." -msgstr "" +msgstr "``value()``: مقدار جاری تجمعی (aggregate) را برمی‌گرداند." msgid "``inverse()``: Remove a row from the current window." -msgstr "" +msgstr "``inverse()``: یک ردیف را از پنجره‌ی جاری حذف می‌کند." -msgid "The number of arguments that the ``step()`` and ``value()`` methods must accept is controlled by *num_params*." +msgid "" +"The number of arguments that the ``step()`` and ``value()`` methods must accept is " +"controlled by *num_params*." msgstr "" +"تعداد آرگومان‌هایی که متدهای ``step()`` و ``value()`` باید بپذیرند، توسط " +"*num_params* کنترل می‌شود." msgid "Set to ``None`` to remove an existing SQL aggregate window function." -msgstr "" +msgstr "برای حذف یک تابع پنجره‌ای تجمیعی SQL موجود، آن را روی ``None`` تنظیم کنید." -msgid "If used with a version of SQLite older than 3.25.0, which does not support aggregate window functions." +msgid "" +"If used with a version of SQLite older than 3.25.0, which does not support " +"aggregate window functions." msgstr "" +"اگر با نسخه‌ای از SQLite قدیمی‌تر از 3.25.0 استفاده شود، که از توابع پنجره‌ای تجمیعی " +"پشتیبانی نمی‌کند." msgid "" "# Example taken from https://www.sqlite.org/windowfunctions.html#udfwinfunc\n" @@ -679,21 +1267,71 @@ msgid "" "print(cur.fetchall())\n" "con.close()" msgstr "" - -msgid "Create a collation named *name* using the collating function *callable*. *callable* is passed two :class:`string ` arguments, and it should return an :class:`integer `:" -msgstr "" - -msgid "``1`` if the first is ordered higher than the second" -msgstr "" - -msgid "``-1`` if the first is ordered lower than the second" -msgstr "" - -msgid "``0`` if they are ordered equal" +"# Example taken from https://www.sqlite.org/windowfunctions.html#udfwinfunc\n" +"class WindowSumInt:\n" +" def __init__(self):\n" +" self.count = 0\n" +"\n" +" def step(self, value):\n" +" \"\"\"Add a row to the current window.\"\"\"\n" +" self.count += value\n" +"\n" +" def value(self):\n" +" \"\"\"Return the current value of the aggregate.\"\"\"\n" +" return self.count\n" +"\n" +" def inverse(self, value):\n" +" \"\"\"Remove a row from the current window.\"\"\"\n" +" self.count -= value\n" +"\n" +" def finalize(self):\n" +" \"\"\"Return the final value of the aggregate.\n" +"\n" +" Any clean-up actions should be placed here.\n" +" \"\"\"\n" +" return self.count\n" +"\n" +"\n" +"con = sqlite3.connect(\":memory:\")\n" +"cur = con.execute(\"CREATE TABLE test(x, y)\")\n" +"values = [\n" +" (\"a\", 4),\n" +" (\"b\", 5),\n" +" (\"c\", 3),\n" +" (\"d\", 8),\n" +" (\"e\", 1),\n" +"]\n" +"cur.executemany(\"INSERT INTO test VALUES(?, ?)\", values)\n" +"con.create_window_function(\"sumint\", 1, WindowSumInt)\n" +"cur.execute(\"\"\"\n" +" SELECT x, sumint(y) OVER (\n" +" ORDER BY x ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING\n" +" ) AS sum_y\n" +" FROM test ORDER BY x\n" +"\"\"\")\n" +"print(cur.fetchall())\n" +"con.close()" + +msgid "" +"Create a collation named *name* using the collating function *callable*. " +"*callable* is passed two :class:`string ` arguments, and it should return " +"an :class:`integer `:" msgstr "" +"یک ترتیب‌گذاری (collation) به نام *name* با استفاده از تابع مقایسه‌کننده *callable* " +"ایجاد کنید. *callable* دو آرگومان از نوع :class:`رشته ` دریافت می‌کند و باید " +"یک :class:`عدد صحیح ` برگرداند:" + +msgid "``1`` if the first is ordered higher than the second" +msgstr "``1`` اگر مورد اول بالاتر از مورد دوم مرتب شده باشد" + +msgid "``-1`` if the first is ordered lower than the second" +msgstr "``-1`` اگر اولی از نظر ترتیب، پایین‌تر از دومی باشد" + +msgid "``0`` if they are ordered equal" +msgstr "``0`` اگر از نظر ترتیب برابر باشند" msgid "The following example shows a reverse sorting collation:" -msgstr "" +msgstr "مثال زیر یک ترتیب‌گذاری (collation) مرتب‌سازی معکوس را نشان می‌دهد:" msgid "" "def collate_reverse(string1, string2):\n" @@ -714,72 +1352,195 @@ msgid "" " print(row)\n" "con.close()" msgstr "" +"def collate_reverse(string1, string2):\n" +" if string1 == string2:\n" +" return 0\n" +" elif string1 < string2:\n" +" return 1\n" +" else:\n" +" return -1\n" +"\n" +"con = sqlite3.connect(\":memory:\")\n" +"con.create_collation(\"reverse\", collate_reverse)\n" +"\n" +"cur = con.execute(\"CREATE TABLE test(x)\")\n" +"cur.executemany(\"INSERT INTO test(x) VALUES(?)\", [(\"a\",), (\"b\",)])\n" +"cur.execute(\"SELECT x FROM test ORDER BY x COLLATE reverse\")\n" +"for row in cur:\n" +" print(row)\n" +"con.close()" msgid "Remove a collation function by setting *callable* to ``None``." -msgstr "" +msgstr "برای حذف یک تابع ترتیب‌گذاری (collation)، *callable* را روی ``None`` تنظیم کنید." -msgid "The collation name can contain any Unicode character. Earlier, only ASCII characters were allowed." +msgid "" +"The collation name can contain any Unicode character. Earlier, only ASCII " +"characters were allowed." msgstr "" +"نام ترتیب‌گذاری (collation) می‌تواند شامل هر نویسه‌ای از Unicode باشد. پیش‌تر، فقط " +"نویسه‌های ASCII مجاز بودند." -msgid "Call this method from a different thread to abort any queries that might be executing on the connection. Aborted queries will raise an :exc:`OperationalError`." +msgid "" +"Call this method from a different thread to abort any queries that might be " +"executing on the connection. Aborted queries will raise an :exc:`OperationalError`." msgstr "" +"این متد را از یک نخ دیگر فراخوانی کنید تا هر پرس‌وجویی که ممکن است روی اتصال در حال " +"اجرا باشد، لغو شود. پرس‌وجوهای لغوشده یک :exc:`OperationalError` پرتاب خواهند کرد." -msgid "Register :term:`callable` *authorizer_callback* to be invoked for each attempt to access a column of a table in the database. The callback should return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to signal how access to the column should be handled by the underlying SQLite library." +msgid "" +"Register :term:`callable` *authorizer_callback* to be invoked for each attempt to " +"access a column of a table in the database. The callback should return one " +"of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to signal " +"how access to the column should be handled by the underlying SQLite library." msgstr "" +"*authorizer_callback*، یک :term:`قابل فراخوانی `، را ثبت کنید تا برای هر " +"تلاش برای دسترسی به یک ستون از یک جدول در پایگاه داده فراخوانی شود. این کال‌بک باید " +"یکی از :const:`SQLITE_OK`، :const:`SQLITE_DENY` یا :const:`SQLITE_IGNORE` را " +"برگرداند تا مشخص کند دسترسی به ستون باید توسط کتابخانه زیربنایی SQLite چگونه " +"مدیریت شود." -msgid "The first argument to the callback signifies what kind of operation is to be authorized. The second and third argument will be arguments or ``None`` depending on the first argument. The 4th argument is the name of the database (\"main\", \"temp\", etc.) if applicable. The 5th argument is the name of the inner-most trigger or view that is responsible for the access attempt or ``None`` if this access attempt is directly from input SQL code." -msgstr "" +msgid "" +"The first argument to the callback signifies what kind of operation is to be " +"authorized. The second and third argument will be arguments or ``None`` depending " +"on the first argument. The 4th argument is the name of the database (\"main\", " +"\"temp\", etc.) if applicable. The 5th argument is the name of the inner-most " +"trigger or view that is responsible for the access attempt or ``None`` if this " +"access attempt is directly from input SQL code." +msgstr "" +"نخستین آرگومان کال‌بک نشان می‌دهد که چه نوع عملیاتی باید مجاز شود. آرگومان دوم و " +"سوم، بسته به آرگومان نخست، یا آرگومان‌هایی خواهند بود یا ``None``. آرگومان چهارم در " +"صورت لزوم، نام پایگاه داده (\"main\"، \"temp\" و غیره) است. آرگومان پنجم نام " +"درونی‌ترین تریگر یا ویویی است که مسئول تلاش برای دسترسی است، یا ``None`` اگر این " +"تلاش برای دسترسی مستقیماً از کد SQL ورودی باشد." -msgid "Please consult the SQLite documentation about the possible values for the first argument and the meaning of the second and third argument depending on the first one. All necessary constants are available in the :mod:`!sqlite3` module." +msgid "" +"Please consult the SQLite documentation about the possible values for the first " +"argument and the meaning of the second and third argument depending on the first " +"one. All necessary constants are available in the :mod:`!sqlite3` module." msgstr "" +"لطفاً مستندات SQLite را درباره‌ی مقادیر ممکن برای آرگومان اول و معنی آرگومان دوم و " +"سوم، بسته به آرگومان اول، ببینید. همه‌ی ثابت‌های مورد نیاز در ماژول :mod:`!sqlite3` " +"در دسترس هستند." msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" +"با ارسال ``None`` به‌عنوان *authorizer_callback*، تأییدکننده‌ی دسترسی غیرفعال می‌شود." msgid "Added support for disabling the authorizer using ``None``." msgstr "" +"پشتیبانی از غیرفعال‌سازی مجوزدهنده (authorizer) با استفاده از ``None`` افزوده شد." -msgid "Passing *authorizer_callback* as a keyword argument is deprecated. The parameter will become positional-only in Python 3.15." +msgid "" +"Passing *authorizer_callback* as a keyword argument is deprecated. The parameter " +"will become positional-only in Python 3.15." msgstr "" +"ارسال *authorizer_callback* به‌عنوان آرگومان کلیدواژه‌ای منسوخ شده است. این پارامتر " +"در پایتون 3.15 فقط جایگاهی خواهد شد." -msgid "Register :term:`callable` *progress_handler* to be invoked for every *n* instructions of the SQLite virtual machine. This is useful if you want to get called from SQLite during long-running operations, for example to update a GUI." +msgid "" +"Register :term:`callable` *progress_handler* to be invoked for every *n* " +"instructions of the SQLite virtual machine. This is useful if you want to get " +"called from SQLite during long-running operations, for example to update a GUI." msgstr "" +":term:`callable` *progress_handler* را ثبت کنید تا به ازای هر *n* دستورالعملِ ماشین " +"مجازی SQLite فراخوانی شود. این قابلیت زمانی مفید است که بخواهید در حین عملیات‌های " +"طولانی‌مدت از SQLite فراخوانی شوید، برای مثال برای به‌روزرسانی رابط کاربری گرافیکی " +"(GUI)." -msgid "If you want to clear any previously installed progress handler, call the method with ``None`` for *progress_handler*." +msgid "" +"If you want to clear any previously installed progress handler, call the method " +"with ``None`` for *progress_handler*." msgstr "" +"اگر می‌خواهید هر مدیر پیشرفت (progress handler) نصب‌شده‌ی قبلی را پاک کنید، متد را با " +"``None`` برای *progress_handler* فراخوانی کنید." -msgid "Returning a non-zero value from the handler function will terminate the currently executing query and cause it to raise a :exc:`DatabaseError` exception." +msgid "" +"Returning a non-zero value from the handler function will terminate the currently " +"executing query and cause it to raise a :exc:`DatabaseError` exception." msgstr "" +"بازگرداندن یک مقدار غیرصفر از تابع هندلر، پرس‌وجوی در حال اجرا را خاتمه می‌دهد " +"و باعث می‌شود که یک استثنا :exc:`DatabaseError` پرتاب شود." -msgid "Passing *progress_handler* as a keyword argument is deprecated. The parameter will become positional-only in Python 3.15." +msgid "" +"Passing *progress_handler* as a keyword argument is deprecated. The parameter will " +"become positional-only in Python 3.15." msgstr "" +"ارسال *progress_handler* به‌عنوان آرگومان کلیدواژه‌ای منسوخ شده است. این پارامتر در " +"Python 3.15 فقط جایگاهی خواهد شد." -msgid "Register :term:`callable` *trace_callback* to be invoked for each SQL statement that is actually executed by the SQLite backend." +msgid "" +"Register :term:`callable` *trace_callback* to be invoked for each SQL statement " +"that is actually executed by the SQLite backend." msgstr "" +"یک :term:`callable` به نام *trace_callback* را ثبت کنید تا برای هر دستور SQL که " +"به‌طور واقعی توسط بک‌اند SQLite اجرا می‌شود، فراخوانی شود." -msgid "The only argument passed to the callback is the statement (as :class:`str`) that is being executed. The return value of the callback is ignored. Note that the backend does not only run statements passed to the :meth:`Cursor.execute` methods. Other sources include the :ref:`transaction management ` of the :mod:`!sqlite3` module and the execution of triggers defined in the current database." -msgstr "" +msgid "" +"The only argument passed to the callback is the statement (as :class:`str`) that " +"is being executed. The return value of the callback is ignored. Note that the " +"backend does not only run statements passed to the :meth:`Cursor.execute` " +"methods. Other sources include the :ref:`transaction management ` of the :mod:`!sqlite3` module and the execution of " +"triggers defined in the current database." +msgstr "" +"تنها آرگومانی که به کال‌بک داده می‌شود، دستور در حال اجرا (به‌صورت :class:`str`) است. " +"مقدار بازگشتی کال‌بک نادیده گرفته می‌شود. توجه داشته باشید که بک‌اند (backend) تنها " +"دستورهایی را که به متدهای :meth:`Cursor.execute` داده‌شده‌اند، اجرا نمی‌کند. منابع " +"دیگر شامل :ref:`مدیریت تراکنش ` ماژول :mod:`!" +"sqlite3` و اجرای ماشه‌های تعریف‌شده در پایگاه داده‌ی جاری هستند." msgid "Passing ``None`` as *trace_callback* will disable the trace callback." -msgstr "" +msgstr "با ارسال ``None`` به‌عنوان *trace_callback*، کال‌بک ردگیری غیرفعال می‌شود." -msgid "Exceptions raised in the trace callback are not propagated. As a development and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable printing tracebacks from exceptions raised in the trace callback." +msgid "" +"Exceptions raised in the trace callback are not propagated. As a development and " +"debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable printing " +"tracebacks from exceptions raised in the trace callback." msgstr "" +"استثناهای پرتاب‌شده در کال‌بک ردگیری منتشر نمی‌شوند. به‌عنوان کمکی برای توسعه و " +"اشکال‌زدایی، از :meth:`~sqlite3.enable_callback_tracebacks` برای فعال کردن چاپ " +"ردگیری‌های پشته‌ی استثناهای پرتاب‌شده در کال‌بک ردگیری استفاده کنید." -msgid "Passing *trace_callback* as a keyword argument is deprecated. The parameter will become positional-only in Python 3.15." +msgid "" +"Passing *trace_callback* as a keyword argument is deprecated. The parameter will " +"become positional-only in Python 3.15." msgstr "" +"ارسال *trace_callback* به‌عنوان آرگومان کلیدواژه‌ای منسوخ شده است. این پارامتر در " +"پایتون 3.15 فقط جایگاهی خواهد شد." -msgid "Enable the SQLite engine to load SQLite extensions from shared libraries if *enabled* is ``True``; else, disallow loading SQLite extensions. SQLite extensions can define new functions, aggregates or whole new virtual table implementations. One well-known extension is the fulltext-search extension distributed with SQLite." +msgid "" +"Enable the SQLite engine to load SQLite extensions from shared libraries if " +"*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite extensions " +"can define new functions, aggregates or whole new virtual table implementations. " +"One well-known extension is the fulltext-search extension distributed with SQLite." msgstr "" +"اگر *enabled* برابر ``True`` باشد، به موتور SQLite اجازه می‌دهد تا افزونه‌های SQLite " +"را از کتابخانه‌های مشترک بارگذاری کند؛ در غیر این صورت، بارگذاری افزونه‌های SQLite " +"را مجاز نمی‌داند. افزونه‌های SQLite می‌توانند توابع جدید، تجمیع‌ها یا پیاده‌سازی‌های " +"کاملاً جدید جدول مجازی را تعریف کنند. یکی از افزونه‌های شناخته‌شده، افزونه جستجوی " +"تمام‌متنی (fulltext-search) است که همراه SQLite توزیع شده است." -msgid "The :mod:`!sqlite3` module is not built with loadable extension support by default, because some platforms (notably macOS) have SQLite libraries which are compiled without this feature. To get loadable extension support, you must pass the :option:`--enable-loadable-sqlite-extensions` option to :program:`configure`." +msgid "" +"The :mod:`!sqlite3` module is not built with loadable extension support by " +"default, because some platforms (notably macOS) have SQLite libraries which are " +"compiled without this feature. To get loadable extension support, you must pass " +"the :option:`--enable-loadable-sqlite-extensions` option to :program:`configure`." msgstr "" +"ماژول :mod:`!sqlite3` به‌طور پیش‌فرض با پشتیبانی از افزونه‌های قابل بارگذاری ساخته " +"نمی‌شود، زیرا برخی سکوها (به‌ویژه macOS) کتابخانه‌های SQLite دارند که بدون این قابلیت " +"کامپایل شده‌اند. برای بهره‌مندی از پشتیبانی از افزونه‌های قابل بارگذاری، باید " +"گزینه‌ی :option:`--enable-loadable-sqlite-extensions` را به :program:`configure` " +"بدهید." -msgid "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` with arguments ``connection``, ``enabled``." +msgid "" +"Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` with " +"arguments ``connection``, ``enabled``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sqlite3.enable_load_extension`` را با " +"آرگومان‌های ``connection`` و ``enabled`` پرتاب می‌کند." msgid "Added the ``sqlite3.enable_load_extension`` auditing event." -msgstr "" +msgstr "رویداد حسابرسی ``sqlite3.enable_load_extension`` اضافه شد." msgid "" "con.enable_load_extension(True)\n" @@ -796,38 +1557,93 @@ msgid "" "# example from SQLite wiki\n" "con.execute(\"CREATE VIRTUAL TABLE recipe USING fts3(name, ingredients)\")\n" "con.executescript(\"\"\"\n" -" INSERT INTO recipe (name, ingredients) VALUES('broccoli stew', 'broccoli peppers cheese tomatoes');\n" -" INSERT INTO recipe (name, ingredients) VALUES('pumpkin stew', 'pumpkin onions garlic celery');\n" -" INSERT INTO recipe (name, ingredients) VALUES('broccoli pie', 'broccoli cheese onions flour');\n" -" INSERT INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar flour butter');\n" +" INSERT INTO recipe (name, ingredients) VALUES('broccoli stew', 'broccoli " +"peppers cheese tomatoes');\n" +" INSERT INTO recipe (name, ingredients) VALUES('pumpkin stew', 'pumpkin onions " +"garlic celery');\n" +" INSERT INTO recipe (name, ingredients) VALUES('broccoli pie', 'broccoli cheese " +"onions flour');\n" +" INSERT INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar " +"flour butter');\n" " \"\"\")\n" -"for row in con.execute(\"SELECT rowid, name, ingredients FROM recipe WHERE name MATCH 'pie'\"):\n" +"for row in con.execute(\"SELECT rowid, name, ingredients FROM recipe WHERE name " +"MATCH 'pie'\"):\n" " print(row)" msgstr "" +"con.enable_load_extension(True)\n" +"\n" +"# بارگذاری افزونه جستجوی تمام‌متنی\n" +"con.execute(\"select load_extension('./fts3.so')\")\n" +"\n" +"# به‌عنوان جایگزین، می‌توانید افزونه را با استفاده از یک فراخوانی API بارگذاری " +"کنید:\n" +"# con.load_extension(\"./fts3.so\")\n" +"\n" +"# بارگذاری افزونه را دوباره غیرفعال کنید\n" +"con.enable_load_extension(False)\n" +"\n" +"# مثالی از ویکی SQLite\n" +"con.execute(\"CREATE VIRTUAL TABLE recipe USING fts3(name, ingredients)\")\n" +"con.executescript(\"\"\"\n" +" INSERT INTO recipe (name, ingredients) VALUES('broccoli stew', 'broccoli " +"peppers cheese tomatoes');\n" +" INSERT INTO recipe (name, ingredients) VALUES('pumpkin stew', 'pumpkin onions " +"garlic celery');\n" +" INSERT INTO recipe (name, ingredients) VALUES('broccoli pie', 'broccoli cheese " +"onions flour');\n" +" INSERT INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar " +"flour butter');\n" +" \"\"\")\n" +"for row in con.execute(\"SELECT rowid, name, ingredients FROM recipe WHERE name " +"MATCH 'pie'\"):\n" +" print(row)" -msgid "Load an SQLite extension from a shared library. Enable extension loading with :meth:`enable_load_extension` before calling this method." +msgid "" +"Load an SQLite extension from a shared library. Enable extension loading " +"with :meth:`enable_load_extension` before calling this method." msgstr "" +"یک افزونه‌ی SQLite را از یک کتابخانه مشترک بارگذاری کنید. پیش از فراخوانی این متد، " +"بارگذاری افزونه را با :meth:`enable_load_extension` فعال کنید." msgid "The path to the SQLite extension." -msgstr "" +msgstr "مسیر افزونه‌ی SQLite." -msgid "Entry point name. If ``None`` (the default), SQLite will come up with an entry point name of its own; see the SQLite docs `Loading an Extension`_ for details." +msgid "" +"Entry point name. If ``None`` (the default), SQLite will come up with an entry " +"point name of its own; see the SQLite docs `Loading an Extension`_ for details." msgstr "" +"نام نقطه ورود. اگر ``None`` (پیش‌فرض) باشد، SQLite نام نقطه ورود خاص خود را انتخاب " +"می‌کند؛ برای جزئیات، مستندات SQLite با عنوان `Loading an Extension`_ را ببینید." -msgid "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with arguments ``connection``, ``path``." +msgid "" +"Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " +"arguments ``connection``, ``path``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sqlite3.load_extension`` را با آرگومان‌های " +"``connection`` و ``path`` پرتاب می‌کند." msgid "Added the ``sqlite3.load_extension`` auditing event." -msgstr "" +msgstr "رویداد حسابرسی ``sqlite3.load_extension`` افزوده شد." msgid "Added the *entrypoint* parameter." -msgstr "" +msgstr "پارامتر *entrypoint* اضافه شد." -msgid "Return an :term:`iterator` to dump the database as SQL source code. Useful when saving an in-memory database for later restoration. Similar to the ``.dump`` command in the :program:`sqlite3` shell." +msgid "" +"Return an :term:`iterator` to dump the database as SQL source code. Useful when " +"saving an in-memory database for later restoration. Similar to the ``.dump`` " +"command in the :program:`sqlite3` shell." msgstr "" +"یک :term:`iterator` برای برون‌ریزی پایگاه داده به‌صورت کد منبع SQL برمی‌گرداند. هنگام " +"ذخیره‌ی یک پایگاه داده‌ی درون‌حافظه‌ای برای بازیابی بعدی مفید است. مشابه دستور ``.dump`` " +"در پوسته‌ی :program:`sqlite3` است." -msgid "An optional ``LIKE`` pattern for database objects to dump, e.g. ``prefix_%``. If ``None`` (the default), all database objects will be included." +msgid "" +"An optional ``LIKE`` pattern for database objects to dump, e.g. ``prefix_%``. If " +"``None`` (the default), all database objects will be included." msgstr "" +"یک الگوی ``LIKE`` اختیاری برای اشیای پایگاه داده‌ای که باید برون‌ریزی (dump) شوند، " +"به‌عنوان مثال ``prefix_%``. اگر ``None`` (پیش‌فرض) باشد، تمام اشیای پایگاه داده " +"گنجانده می‌شوند." msgid "" "# Convert file example.db to SQL dump file dump.sql\n" @@ -837,36 +1653,64 @@ msgid "" " f.write('%s\\n' % line)\n" "con.close()" msgstr "" +"# Convert file example.db to SQL dump file dump.sql\n" +"con = sqlite3.connect('example.db')\n" +"with open('dump.sql', 'w') as f:\n" +" for line in con.iterdump():\n" +" f.write('%s\\n' % line)\n" +"con.close()" msgid ":ref:`sqlite3-howto-encoding`" -msgstr "" +msgstr ":ref:`sqlite3-howto-encoding`" msgid "Added the *filter* parameter." -msgstr "" +msgstr "پارامتر *filter* اضافه شد." msgid "Create a backup of an SQLite database." -msgstr "" +msgstr "یک نسخه پشتیبان از پایگاه‌داده SQLite ایجاد کنید." -msgid "Works even if the database is being accessed by other clients or concurrently by the same connection." +msgid "" +"Works even if the database is being accessed by other clients or concurrently by " +"the same connection." msgstr "" +"حتی اگر پایگاه داده توسط کارخواه‌های دیگر یا به‌صورت همزمان توسط همان اتصال در حال " +"دسترسی باشد، باز هم کار می‌کند." msgid "The database connection to save the backup to." -msgstr "" +msgstr "اتصال پایگاه داده‌ای که نسخه پشتیبان در آن ذخیره می‌شود." -msgid "The number of pages to copy at a time. If equal to or less than ``0``, the entire database is copied in a single step. Defaults to ``-1``." +msgid "" +"The number of pages to copy at a time. If equal to or less than ``0``, the entire " +"database is copied in a single step. Defaults to ``-1``." msgstr "" +"تعداد صفحه‌هایی که در هر نوبت کپی می‌شوند. اگر برابر یا کمتر از ``0`` باشد، کل " +"پایگاه داده در یک مرحله کپی می‌شود. مقدار پیش‌فرض آن ``-1`` است." -msgid "If set to a :term:`callable`, it is invoked with three integer arguments for every backup iteration: the *status* of the last iteration, the *remaining* number of pages still to be copied, and the *total* number of pages. Defaults to ``None``." +msgid "" +"If set to a :term:`callable`, it is invoked with three integer arguments for every " +"backup iteration: the *status* of the last iteration, the *remaining* number of " +"pages still to be copied, and the *total* number of pages. Defaults to ``None``." msgstr "" +"اگر به یک :term:`callable` تنظیم شود، در هر تکرار پشتیبان‌گیری با سه آرگومان عدد " +"صحیحی فراخوانی می‌شود: *وضعیت* آخرین تکرار، تعداد صفحات *باقی‌مانده* که هنوز باید " +"کپی شوند و تعداد *کل* صفحات. مقدار پیش‌فرض آن ``None`` است." -msgid "The name of the database to back up. Either ``\"main\"`` (the default) for the main database, ``\"temp\"`` for the temporary database, or the name of a custom database as attached using the ``ATTACH DATABASE`` SQL statement." +msgid "" +"The name of the database to back up. Either ``\"main\"`` (the default) for the " +"main database, ``\"temp\"`` for the temporary database, or the name of a custom " +"database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" +"نام پایگاه داده‌ای که از آن پشتیبان‌گیری می‌شود. یا ``\"main\"`` (پیش‌فرض) برای پایگاه " +"داده اصلی، ``\"temp\"`` برای پایگاه داده موقت، یا نام یک پایگاه داده سفارشی که با " +"دستور SQL ``ATTACH DATABASE`` متصل شده است." -msgid "The number of seconds to sleep between successive attempts to back up remaining pages." -msgstr "" +msgid "" +"The number of seconds to sleep between successive attempts to back up remaining " +"pages." +msgstr "تعداد ثانیه‌های توقف بین تلاش‌های متوالی برای پشتیبان‌گیری صفحه‌های باقی‌مانده." msgid "Example 1, copy an existing database into another:" -msgstr "" +msgstr "مثال ۱، کپی کردن یک پایگاه داده‌ی موجود به پایگاه داده‌ای دیگر:" msgid "" "def progress(status, remaining, total):\n" @@ -879,9 +1723,18 @@ msgid "" "dst.close()\n" "src.close()" msgstr "" +"def progress(status, remaining, total):\n" +" print(f'Copied {total-remaining} of {total} pages...')\n" +"\n" +"src = sqlite3.connect('example.db')\n" +"dst = sqlite3.connect('backup.db')\n" +"with dst:\n" +" src.backup(dst, pages=1, progress=progress)\n" +"dst.close()\n" +"src.close()" msgid "Example 2, copy an existing database into a transient copy:" -msgstr "" +msgstr "مثال ۲، کپی یک پایگاه داده‌ی موجود به یک کپی گذرا:" msgid "" "src = sqlite3.connect('example.db')\n" @@ -890,35 +1743,56 @@ msgid "" "dst.close()\n" "src.close()" msgstr "" +"src = sqlite3.connect('example.db')\n" +"dst = sqlite3.connect(':memory:')\n" +"src.backup(dst)\n" +"dst.close()\n" +"src.close()" msgid "Get a connection runtime limit." -msgstr "" +msgstr "محدودیت ران‌تایم یک اتصال را دریافت کنید." msgid "The `SQLite limit category`_ to be queried." -msgstr "" +msgstr "`SQLite limit category`_ که باید پرس‌وجو شود." msgid "If *category* is not recognised by the underlying SQLite library." -msgstr "" +msgstr "اگر *category* توسط کتابخانه SQLite زیربنایی شناسایی نشود." -msgid "Example, query the maximum length of an SQL statement for :class:`Connection` ``con`` (the default is 1000000000):" +msgid "" +"Example, query the maximum length of an SQL statement for :class:`Connection` " +"``con`` (the default is 1000000000):" msgstr "" +"مثال، حداکثر طول یک دستور SQL را برای :class:`Connection` ``con`` پرس‌وجو کنید " +"(مقدار پیش‌فرض ۱۰۰۰۰۰۰۰۰۰ است):" msgid "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" msgstr "" +">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" +"1000000000" -msgid "Set a connection runtime limit. Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned." +msgid "" +"Set a connection runtime limit. Attempts to increase a limit above its hard upper " +"bound are silently truncated to the hard upper bound. Regardless of whether or not " +"the limit was changed, the prior value of the limit is returned." msgstr "" +"یک محدودیت ران‌تایم اتصال را تنظیم می‌کند. اگر تلاش شود محدودیتی به بالاتر از کران " +"بالایی سخت خود افزایش یابد، بدون هیچ پیامی به کران بالایی سخت تقلیل می‌یابد. صرف‌نظر " +"از اینکه محدودیت تغییر کرده باشد یا خیر، مقدار پیشین محدودیت برگردانده می‌شود." msgid "The `SQLite limit category`_ to be set." -msgstr "" +msgstr "`SQLite limit category`_ که باید تنظیم شود." msgid "The value of the new limit. If negative, the current limit is unchanged." -msgstr "" +msgstr "مقدار محدودیت جدید. اگر منفی باشد، محدودیت فعلی بدون تغییر می‌ماند." -msgid "Example, limit the number of attached databases to 1 for :class:`Connection` ``con`` (the default limit is 10):" +msgid "" +"Example, limit the number of attached databases to 1 for :class:`Connection` " +"``con`` (the default limit is 10):" msgstr "" +"مثال، تعداد پایگاه‌های داده‌ی پیوست‌شده را برای :class:`Connection` ``con`` به ۱ محدود " +"کنید (محدودیت پیش‌فرض ۱۰ است):" msgid "" ">>> con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)\n" @@ -926,164 +1800,337 @@ msgid "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_ATTACHED)\n" "1" msgstr "" +">>> con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)\n" +"10\n" +">>> con.getlimit(sqlite3.SQLITE_LIMIT_ATTACHED)\n" +"1" msgid "Query a boolean connection configuration option." -msgstr "" +msgstr "یک گزینه‌ی پیکربندی اتصال بولی را پرس‌وجو کنید." msgid "A :ref:`SQLITE_DBCONFIG code `." -msgstr "" +msgstr "یک :ref:`کد SQLITE_DBCONFIG `." msgid "Set a boolean connection configuration option." -msgstr "" +msgstr "یک گزینه‌ی پیکربندی اتصال از نوع بولی را تنظیم کنید." -msgid "``True`` if the configuration option should be enabled (default); ``False`` if it should be disabled." +msgid "" +"``True`` if the configuration option should be enabled (default); ``False`` if it " +"should be disabled." msgstr "" +"``True`` اگر گزینه‌ی پیکربندی باید فعال باشد (پیش‌فرض)؛ ``False`` اگر باید غیرفعال " +"باشد." -msgid "Serialize a database into a :class:`bytes` object. For an ordinary on-disk database file, the serialization is just a copy of the disk file. For an in-memory database or a \"temp\" database, the serialization is the same sequence of bytes which would be written to disk if that database were backed up to disk." +msgid "" +"Serialize a database into a :class:`bytes` object. For an ordinary on-disk " +"database file, the serialization is just a copy of the disk file. For an in-" +"memory database or a \"temp\" database, the serialization is the same sequence of " +"bytes which would be written to disk if that database were backed up to disk." msgstr "" +"یک پایگاه داده را به یک شیء :class:`bytes` سریال‌سازی می‌کند. برای یک فایل پایگاه " +"داده‌ی معمولی روی دیسک، سریال‌سازی صرفاً رونوشتی از فایل دیسک است. برای یک پایگاه " +"داده‌ی درون‌حافظه‌ای یا یک پایگاه داده‌ی \"temp\"، سریال‌سازی همان دنباله‌ای از بایت‌ها " +"است که اگر آن پایگاه داده روی دیسک پشتیبان‌گیری می‌شد، روی دیسک نوشته می‌شد." msgid "The database name to be serialized. Defaults to ``\"main\"``." -msgstr "" +msgstr "نام پایگاه داده‌ای که باید سریال‌سازی شود. پیش‌فرض ``\"main\"`` است." -msgid "This method is only available if the underlying SQLite library has the serialize API." +msgid "" +"This method is only available if the underlying SQLite library has the serialize " +"API." msgstr "" +"این متد فقط در صورتی در دسترس است که کتابخانه SQLite زیرین، دارای API سریال‌سازی " +"(serialize) باشد." -msgid "Deserialize a :meth:`serialized ` database into a :class:`Connection`. This method causes the database connection to disconnect from database *name*, and reopen *name* as an in-memory database based on the serialization contained in *data*." +msgid "" +"Deserialize a :meth:`serialized ` database into a :class:`Connection`. " +"This method causes the database connection to disconnect from database *name*, and " +"reopen *name* as an in-memory database based on the serialization contained in " +"*data*." msgstr "" +"یک پایگاه داده‌ی :meth:`سریال‌سازی‌شده ` را به یک :class:`Connection` از " +"سریال‌سازی خارج کنید. این متد موجب می‌شود اتصال پایگاه داده از پایگاه داده‌ی *name* " +"قطع شود و *name* به‌عنوان یک پایگاه داده‌ی درون‌حافظه‌ای بر اساس سریال‌سازی موجود در " +"*data* بازگشایی شود." msgid "A serialized database." -msgstr "" +msgstr "یک پایگاه داده سریال‌سازی‌شده." msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" +"نام پایگاه داده مقصد برای سریال‌زدایی کردن (deserialize). پیش‌فرض آن ``\"main\"`` است." -msgid "If the database connection is currently involved in a read transaction or a backup operation." +msgid "" +"If the database connection is currently involved in a read transaction or a backup " +"operation." msgstr "" +"اگر اتصال پایگاه داده در حال حاضر درگیر یک تراکنش خواندن یا یک عملیات پشتیبان‌گیری " +"باشد." msgid "If *data* does not contain a valid SQLite database." -msgstr "" +msgstr "اگر *data* شامل یک پایگاه داده SQLite معتبر نباشد." msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." -msgstr "" +msgstr "اگر :func:`len(data) ` بزرگ‌تر از ``2**63 - 1`` باشد." -msgid "This method is only available if the underlying SQLite library has the deserialize API." +msgid "" +"This method is only available if the underlying SQLite library has the deserialize " +"API." msgstr "" +"این متد تنها در صورتی در دسترس است که کتابخانه SQLite زیرین دارای API سریال‌زدایی کردن " +"(deserialize) باشد." -msgid "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!autocommit` has three allowed values:" +msgid "" +"This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" +"autocommit` has three allowed values:" msgstr "" +"این ویژگی رفتار تراکنش مطابق با :pep:`249` را کنترل می‌کند. :attr:`!autocommit` سه " +"مقدار مجاز دارد:" -msgid "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :meth:`rollback` to close transactions." +msgid "" +"``False``: Select :pep:`249`-compliant transaction behaviour, implying that :mod:`!" +"sqlite3` ensures a transaction is always open. Use :meth:`commit` " +"and :meth:`rollback` to close transactions." msgstr "" +"``False``: رفتار تراکنشی مطابق :pep:`249` را انتخاب می‌کند، به این معنا که :mod:`!" +"sqlite3` تضمین می‌کند یک تراکنش همیشه باز است. برای بستن تراکنش‌ها از :meth:`commit` " +"و :meth:`rollback` استفاده کنید." msgid "This is the recommended value of :attr:`!autocommit`." -msgstr "" +msgstr "این مقدار توصیه‌شده برای :attr:`!autocommit` است." -msgid "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:`rollback` have no effect in this mode." +msgid "" +"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:`rollback` " +"have no effect in this mode." msgstr "" +"``True``: از `autocommit mode`_ SQLite استفاده کنید. در این " +"حالت، :meth:`commit` و :meth:`rollback` هیچ تأثیری ندارند." -msgid ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-compliant) transaction control. See :attr:`isolation_level` for more details." +msgid "" +":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-compliant) " +"transaction control. See :attr:`isolation_level` for more details." msgstr "" +":data:`LEGACY_TRANSACTION_CONTROL`: کنترل تراکنش پیش از پایتون 3.12 (ناسازگار " +"با :pep:`249`). برای جزئیات بیشتر :attr:`isolation_level` را ببینید." msgid "This is currently the default value of :attr:`!autocommit`." -msgstr "" +msgstr "این در حال حاضر مقدار پیش‌فرض :attr:`!autocommit` است." -msgid "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and changing it to ``True`` will commit any pending transaction." +msgid "" +"Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " +"changing it to ``True`` will commit any pending transaction." msgstr "" +"تغییر :attr:`!autocommit` به ``False`` یک تراکنش جدید را باز می‌کند، و تغییر آن به " +"``True`` هر تراکنش در انتظار را ثبت (commit) می‌کند." msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." msgstr "" +"برای جزئیات بیشتر به :ref:`sqlite3-transaction-control-autocommit` مراجعه کنید." -msgid "The :attr:`isolation_level` attribute has no effect unless :attr:`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." +msgid "" +"The :attr:`isolation_level` attribute has no effect unless :attr:`autocommit` " +"is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" +"ویژگی :attr:`isolation_level` تأثیری ندارد، مگر اینکه :attr:`autocommit` " +"برابر :data:`LEGACY_TRANSACTION_CONTROL` باشد." -msgid "This read-only attribute corresponds to the low-level SQLite `autocommit mode`_." +msgid "" +"This read-only attribute corresponds to the low-level SQLite `autocommit mode`_." msgstr "" +"این ویژگی فقط‌خواندنی، متناظر با حالت `autocommit mode`_ سطح پایین در SQLite است." -msgid "``True`` if a transaction is active (there are uncommitted changes), ``False`` otherwise." +msgid "" +"``True`` if a transaction is active (there are uncommitted changes), ``False`` " +"otherwise." msgstr "" +"اگر یک تراکنش فعال باشد (تغییرات ثبت‌نشده‌ای وجود داشته باشد)، ``True`` و در غیر این " +"صورت ``False`` است." -msgid "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, ``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying `SQLite transaction behaviour`_, :ref:`implicit transaction management ` is performed." -msgstr "" +msgid "" +"Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, transactions are never " +"implicitly opened. If set to one of ``\"DEFERRED\"``, ``\"IMMEDIATE\"``, or " +"``\"EXCLUSIVE\"``, corresponding to the underlying `SQLite transaction " +"behaviour`_, :ref:`implicit transaction management ` is performed." +msgstr "" +":ref:`حالت مدیریت تراکنش قدیمی ` " +"در :mod:`!sqlite3` را کنترل می‌کند. اگر روی ``None`` تنظیم شود، تراکنش‌ها هرگز " +"به‌صورت ضمنی باز نمی‌شوند. اگر روی یکی از ``\"DEFERRED\"``، ``\"IMMEDIATE\"`` یا " +"``\"EXCLUSIVE\"`` تنظیم شود، مطابق با `SQLite transaction behaviour`_ " +"زیربنایی، :ref:`مدیریت ضمنی تراکنش ` " +"انجام می‌شود." -msgid "If not overridden by the *isolation_level* parameter of :func:`connect`, the default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." +msgid "" +"If not overridden by the *isolation_level* parameter of :func:`connect`, the " +"default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" +"اگر پارامتر *isolation_level* در :func:`connect` آن را بازنویسی نکند، مقدار پیش‌فرض " +"``\"\"`` است که نام مستعاری برای ``\"DEFERRED\"`` محسوب می‌شود." -msgid "Using :attr:`autocommit` to control transaction handling is recommended over using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect unless :attr:`autocommit` is set to :data:`LEGACY_TRANSACTION_CONTROL` (the default)." +msgid "" +"Using :attr:`autocommit` to control transaction handling is recommended over " +"using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " +"unless :attr:`autocommit` is set to :data:`LEGACY_TRANSACTION_CONTROL` (the " +"default)." msgstr "" +"استفاده از :attr:`autocommit` برای کنترل مدیریت تراکنش، به‌جای استفاده از :attr:`!" +"isolation_level` توصیه می‌شود. :attr:`!isolation_level` هیچ تأثیری ندارد، مگر " +"اینکه :attr:`autocommit` روی :data:`LEGACY_TRANSACTION_CONTROL` (پیش‌فرض) تنظیم شده " +"باشد." -msgid "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created from this connection. Assigning to this attribute does not affect the :attr:`!row_factory` of existing cursors belonging to this connection, only new ones. Is ``None`` by default, meaning each row is returned as a :class:`tuple`." +msgid "" +"The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created from " +"this connection. Assigning to this attribute does not affect the :attr:`!" +"row_factory` of existing cursors belonging to this connection, only new ones. Is " +"``None`` by default, meaning each row is returned as a :class:`tuple`." msgstr "" +":attr:`~Cursor.row_factory` اولیه برای اشیای :class:`Cursor` ایجادشده از این " +"اتصال. انتساب به این ویژگی بر :attr:`!row_factory` نشانگرهای موجود متعلق به این " +"اتصال تأثیری نمی‌گذارد و فقط نشانگرهای جدید را تحت تأثیر قرار می‌دهد. به‌طور پیش‌فرض " +"``None`` است، به این معنا که هر ردیف به‌صورت یک :class:`tuple` بازگردانده می‌شود." msgid "See :ref:`sqlite3-howto-row-factory` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر :ref:`sqlite3-howto-row-factory` را ببینید." msgid "Deleting the ``row_factory`` attribute is no longer allowed." -msgstr "" +msgstr "حذف ویژگی ``row_factory`` دیگر مجاز نیست." -msgid "A :term:`callable` that accepts a :class:`bytes` parameter and returns a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`." +msgid "" +"A :term:`callable` that accepts a :class:`bytes` parameter and returns a text " +"representation of it. The callable is invoked for SQLite values with the ``TEXT`` " +"data type. By default, this attribute is set to :class:`str`." msgstr "" +"یک :term:`callable` که یک پارامتر از نوع :class:`bytes` را می‌پذیرد و یک نمایش متنی " +"از آن را برمی‌گرداند. این callable برای مقادیر SQLite با نوع داده ``TEXT`` فراخوانی " +"می‌شود. به‌طور پیش‌فرض، این ویژگی روی :class:`str` تنظیم شده است." msgid "See :ref:`sqlite3-howto-encoding` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر :ref:`sqlite3-howto-encoding` را ببینید." msgid "Deleting the ``text_factory`` attribute is no longer allowed." -msgstr "" +msgstr "حذف ویژگی ``text_factory`` دیگر مجاز نیست." -msgid "Return the total number of database rows that have been modified, inserted, or deleted since the database connection was opened." +msgid "" +"Return the total number of database rows that have been modified, inserted, or " +"deleted since the database connection was opened." msgstr "" +"تعداد کل ردیف‌های پایگاه داده را که از زمان باز شدن اتصال پایگاه داده تغییریافته، " +"درج‌شده یا حذف‌شده‌اند، برمی‌گرداند." msgid "Cursor objects" -msgstr "" +msgstr "اشیای نشانگر (Cursor)" -msgid "A ``Cursor`` object represents a `database cursor`_ which is used to execute SQL statements, and manage the context of a fetch operation. Cursors are created using :meth:`Connection.cursor`, or by using any of the :ref:`connection shortcut methods `." +msgid "" +"A ``Cursor`` object represents a `database cursor`_ which is used to execute SQL " +"statements, and manage the context of a fetch operation. Cursors are created " +"using :meth:`Connection.cursor`, or by using any of the :ref:`connection shortcut " +"methods `." msgstr "" +"یک شیء ``Cursor`` نشان‌دهنده‌ی یک `database cursor`_ است که برای اجرای دستورات SQL و " +"مدیریت زمینه‌ی یک عملیات واکشی استفاده می‌شود. نشانگرها با استفاده " +"از :meth:`Connection.cursor`، یا با استفاده از هر یک از :ref:`متدهای میان‌بر اتصال " +"` ایجاد می‌شوند." -msgid "Cursor objects are :term:`iterators `, meaning that if you :meth:`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor to fetch the resulting rows:" +msgid "" +"Cursor objects are :term:`iterators `, meaning that if " +"you :meth:`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the " +"cursor to fetch the resulting rows:" msgstr "" +"اشیاء Cursor از نوع :term:`پیمایش‌گر ` هستند، به این معنا که اگر یک " +"پرس‌وجوی ``SELECT`` را :meth:`~Cursor.execute` کنید، می‌توانید برای واکشی ردیف‌های " +"حاصل، به‌سادگی روی نشانگر پیمایش کنید:" msgid "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" msgstr "" +"for row in cur.execute(\"SELECT t FROM data\"):\n" +" print(row)" msgid "A :class:`Cursor` instance has the following attributes and methods." -msgstr "" +msgstr "یک نمونه :class:`Cursor` دارای ویژگی‌ها و متدهای زیر است." -msgid "Execute a single SQL statement, optionally binding Python values using :ref:`placeholders `." +msgid "" +"Execute a single SQL statement, optionally binding Python values " +"using :ref:`placeholders `." msgstr "" +"یک دستور SQL واحد را اجرا کنید و به‌صورت اختیاری مقادیر پایتون را با استفاده " +"از :ref:`جای‌نگهدارها ` مقید کنید." msgid "A single SQL statement." -msgstr "" +msgstr "یک دستور SQL واحد." -msgid "Python values to bind to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`." +msgid "" +"Python values to bind to placeholders in *sql*. A :class:`!dict` if named " +"placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " +"See :ref:`sqlite3-placeholders`." msgstr "" +"مقادیر پایتون برای مقیدسازی به جای‌نگهدارها در *sql*. در صورت استفاده از جای‌نگهدارهای " +"نام‌دار، یک :class:`!dict`. در صورت استفاده از جای‌نگهدارهای بی‌نام، یک :term:`!" +"sequence`. :ref:`sqlite3-placeholders` را ببینید." -msgid "When *sql* contains more than one SQL statement. When :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:`dict`." +msgid "" +"When *sql* contains more than one SQL statement. When :ref:`named placeholders " +"` are used and *parameters* is a sequence instead of " +"a :class:`dict`." msgstr "" +"هنگامی که *sql* شامل بیش از یک دستور SQL باشد. هنگامی که از :ref:`جای‌نگهدارهای " +"نام‌گذاری‌شده ` استفاده می‌شود و *parameters* به‌جای " +"یک :class:`dict` یک دنباله باشد." -msgid "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open transaction, a transaction is implicitly opened before executing *sql*." +msgid "" +"If :attr:`~Connection.autocommit` " +"is :data:`LEGACY_TRANSACTION_CONTROL`, :attr:`~Connection.isolation_level` is not " +"``None``, *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` " +"statement, and there is no open transaction, a transaction is implicitly opened " +"before executing *sql*." msgstr "" +"اگر :attr:`~Connection.autocommit` برابر :data:`LEGACY_TRANSACTION_CONTROL` " +"باشد، :attr:`~Connection.isolation_level` برابر ``None`` نباشد، *sql* یک دستور " +"``INSERT``، ``UPDATE``، ``DELETE`` یا ``REPLACE`` باشد و هیچ تراکنش بازی وجود " +"نداشته باشد، پیش از اجرای *sql*، یک تراکنش به‌طور ضمنی باز می‌شود." -msgid ":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:`dict`." +msgid "" +":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:`dict`." msgstr "" +":exc:`ProgrammingError` پرتاب می‌شود، اگر از :ref:`جای‌نگهدارهای نام‌دار ` استفاده شود و *parameters* به‌جای یک :class:`dict` یک دنباله باشد." msgid "Use :meth:`executescript` to execute multiple SQL statements." -msgstr "" +msgstr "برای اجرای چندین دستور SQL از :meth:`executescript` استفاده کنید." -msgid "For every item in *parameters*, repeatedly execute the :ref:`parameterized ` :abbr:`DML (Data Manipulation Language)` SQL statement *sql*." +msgid "" +"For every item in *parameters*, repeatedly execute the :ref:`parameterized " +"` :abbr:`DML (Data Manipulation Language)` SQL statement " +"*sql*." msgstr "" +"به ازای هر آیتم در *parameters*، دستور SQL :abbr:`DML (زبان دست‌کاری داده‌ها) ` :ref:`پارامتریزه ` *sql* را " +"به‌طور مکرر اجرا کنید." msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." -msgstr "" +msgstr "از همان مدیریت تراکنش ضمنیِ :meth:`~Cursor.execute` استفاده می‌کند." msgid "A single SQL DML statement." -msgstr "" +msgstr "یک دستور SQL DML." -msgid "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. See :ref:`sqlite3-placeholders`." +msgid "" +"An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " +"See :ref:`sqlite3-placeholders`." msgstr "" +"یک :term:`!iterable` از پارامترها برای مقیدسازی با جای‌نگهدارها در *sql*. :ref:`sqlite3-" +"placeholders` را ببینید." -msgid "When *sql* contains more than one SQL statement or is not a DML statement, When :ref:`named placeholders ` are used and the items in *parameters* are sequences instead of :class:`dict`\\s." +msgid "" +"When *sql* contains more than one SQL statement or is not a DML statement, " +"When :ref:`named placeholders ` are used and the items in " +"*parameters* are sequences instead of :class:`dict`\\s." msgstr "" +"هنگامی که *sql* شامل بیش از یک دستور SQL باشد یا یک دستور DML نباشد، هنگامی که " +"از :ref:`جای‌نگهدارهای نام‌گذاری‌شده ` استفاده شود و آیتم‌های " +"*parameters* به جای :class:`dict`\\s دنباله باشند." msgid "" "rows = [\n" @@ -1093,18 +2140,41 @@ msgid "" "# cur is an sqlite3.Cursor object\n" "cur.executemany(\"INSERT INTO data VALUES(?)\", rows)" msgstr "" +"rows = [\n" +" (\"row1\",),\n" +" (\"row2\",),\n" +"]\n" +"# cur is an sqlite3.Cursor object\n" +"cur.executemany(\"INSERT INTO data VALUES(?)\", rows)" -msgid "Any resulting rows are discarded, including DML statements with `RETURNING clauses`_." +msgid "" +"Any resulting rows are discarded, including DML statements with `RETURNING " +"clauses`_." msgstr "" +"هر ردیف حاصل دور ریخته می‌شود، از جمله در دستورات DML با `RETURNING clauses`_." -msgid ":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead of :class:`dict`\\s." +msgid "" +":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " +"of :class:`dict`\\s." msgstr "" +"اگر از :ref:`جای‌نگهدارهای نام‌دار ` استفاده شود و آیتم‌های درون " +"*parameters* به‌جای :class:`dict`\\s دنباله باشند، :exc:`ProgrammingError` پرتاب " +"می‌شود." -msgid "Execute the SQL statements in *sql_script*. If the :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending transaction, an implicit ``COMMIT`` statement is executed first. No other implicit transaction control is performed; any transaction control must be added to *sql_script*." +msgid "" +"Execute the SQL statements in *sql_script*. If the :attr:`~Connection.autocommit` " +"is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending transaction, an " +"implicit ``COMMIT`` statement is executed first. No other implicit transaction " +"control is performed; any transaction control must be added to *sql_script*." msgstr "" +"دستورات SQL موجود در *sql_script* را اجرا کنید. اگر :attr:`~Connection.autocommit` " +"برابر :data:`LEGACY_TRANSACTION_CONTROL` باشد و یک تراکنش در انتظار وجود داشته " +"باشد، ابتدا یک دستور ``COMMIT`` ضمنی اجرا می‌شود. هیچ‌گونه کنترل تراکنش ضمنی دیگری " +"انجام نمی‌شود؛ هرگونه کنترل تراکنش باید به *sql_script* اضافه شود." msgid "*sql_script* must be a :class:`string `." -msgstr "" +msgstr "*sql_script* باید یک :class:`رشته ` باشد." msgid "" "# cur is an sqlite3.Cursor object\n" @@ -1116,42 +2186,99 @@ msgid "" " COMMIT;\n" "\"\"\")" msgstr "" +"# cur is an sqlite3.Cursor object\n" +"cur.executescript(\"\"\"\n" +" BEGIN;\n" +" CREATE TABLE person(firstname, lastname, age);\n" +" CREATE TABLE book(title, author, published);\n" +" CREATE TABLE publisher(name, address);\n" +" COMMIT;\n" +"\"\"\")" -msgid "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result set as a :class:`tuple`. Else, pass it to the row factory and return its result. Return ``None`` if no more data is available." +msgid "" +"If :attr:`~Cursor.row_factory` is ``None``, return the next row query result set " +"as a :class:`tuple`. Else, pass it to the row factory and return its result. " +"Return ``None`` if no more data is available." msgstr "" +"اگر :attr:`~Cursor.row_factory` ``None`` باشد، ردیف بعدی از مجموعه‌ی نتایج پرس‌وجو را " +"به‌صورت یک :class:`tuple` برمی‌گرداند. در غیر این صورت، آن را به کارخانه‌ی ردیف (row " +"factory) می‌دهد و نتیجه‌ی آن را برمی‌گرداند. اگر داده‌ی بیشتری در دسترس نباشد، ``None`` " +"را برمی‌گرداند." -msgid "Return the next set of rows of a query result as a :class:`list`. Return an empty list if no more rows are available." +msgid "" +"Return the next set of rows of a query result as a :class:`list`. Return an empty " +"list if no more rows are available." msgstr "" +"برگرداندن دسته‌ی بعدی از ردیف‌های نتیجه‌ی یک پرس‌وجو به‌عنوان یک :class:`list`. اگر " +"دیگر ردیفی در دسترس نباشد، یک فهرست خالی برمی‌گرداند." -msgid "The number of rows to fetch per call is specified by the *size* parameter. If *size* is not given, :attr:`arraysize` determines the number of rows to be fetched. If fewer than *size* rows are available, as many rows as are available are returned." +msgid "" +"The number of rows to fetch per call is specified by the *size* parameter. If " +"*size* is not given, :attr:`arraysize` determines the number of rows to be " +"fetched. If fewer than *size* rows are available, as many rows as are available " +"are returned." msgstr "" +"تعداد ردیفهایی که در هر فراخوانی واکشی می‌شوند، با پارامتر *size* مشخص می‌شود. اگر " +"*size* داده نشود، :attr:`arraysize` تعداد ردیفهای واکشی‌شده را تعیین می‌کند. اگر کمتر " +"از *size* ردیف در دسترس باشد، هر تعداد ردیفی که در دسترس باشد بازگردانده می‌شود." -msgid "Note there are performance considerations involved with the *size* parameter. For optimal performance, it is usually best to use the arraysize attribute. If the *size* parameter is used, then it is best for it to retain the same value from one :meth:`fetchmany` call to the next." +msgid "" +"Note there are performance considerations involved with the *size* parameter. For " +"optimal performance, it is usually best to use the arraysize attribute. If the " +"*size* parameter is used, then it is best for it to retain the same value from " +"one :meth:`fetchmany` call to the next." msgstr "" +"توجه داشته باشید که ملاحظات عملکردی مرتبط با پارامتر *size* وجود دارد. برای عملکرد " +"بهینه، معمولاً بهتر است از ویژگی arraysize استفاده کنید. اگر از پارامتر *size* " +"استفاده می‌شود، بهتر است مقدار آن از یک فراخوانی :meth:`fetchmany` تا فراخوانی بعدی " +"ثابت بماند." msgid "Negative *size* values are rejected by raising :exc:`ValueError`." -msgstr "" +msgstr "مقادیر منفی *اندازه* با پرتاب :exc:`ValueError` رد می‌شوند." -msgid "Return all (remaining) rows of a query result as a :class:`list`. Return an empty list if no rows are available. Note that the :attr:`arraysize` attribute can affect the performance of this operation." +msgid "" +"Return all (remaining) rows of a query result as a :class:`list`. Return an empty " +"list if no rows are available. Note that the :attr:`arraysize` attribute can " +"affect the performance of this operation." msgstr "" +"تمام ردیف‌های (باقی‌مانده) نتیجه‌ی پرس‌وجو را به‌صورت یک :class:`list` برمی‌گرداند. اگر " +"هیچ ردیفی موجود نباشد، یک فهرست خالی برمی‌گرداند. توجه داشته باشید که " +"ویژگی :attr:`arraysize` می‌تواند بر عملکرد این عملیات تأثیر بگذارد." msgid "Close the cursor now (rather than whenever ``__del__`` is called)." -msgstr "" +msgstr "اکنون مکان‌نما را ببندید (نه هر زمان که ``__del__`` فراخوانی می‌شود)." -msgid "The cursor will be unusable from this point forward; a :exc:`ProgrammingError` exception will be raised if any operation is attempted with the cursor." +msgid "" +"The cursor will be unusable from this point forward; a :exc:`ProgrammingError` " +"exception will be raised if any operation is attempted with the cursor." msgstr "" +"از این نقطه به بعد، مکان‌نما (cursor) غیرقابل استفاده خواهد بود؛ در صورت تلاش برای " +"انجام هر عملیاتی با مکان‌نما، استثنای :exc:`ProgrammingError` پرتاب خواهد شد." msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." -msgstr "" +msgstr "مورد نیاز DB-API است. در :mod:`!sqlite3` هیچ کاری انجام نمی‌دهد." -msgid "Read/write attribute that controls the number of rows returned by :meth:`fetchmany`. The default value is 1 which means a single row would be fetched per call." +msgid "" +"Read/write attribute that controls the number of rows returned " +"by :meth:`fetchmany`. The default value is 1 which means a single row would be " +"fetched per call." msgstr "" +"ویژگی خواندنی/نوشتنی که تعداد ردیف‌های بازگردانده‌شده توسط :meth:`fetchmany` را " +"کنترل می‌کند. مقدار پیش‌فرض ۱ است، یعنی در هر فراخوانی یک ردیف واکشی می‌شود." msgid "Negative values are rejected by raising :exc:`ValueError`." -msgstr "" +msgstr "مقادیر منفی با پرتاب :exc:`ValueError` رد می‌شوند." -msgid "Read-only attribute that provides the SQLite database :class:`Connection` belonging to the cursor. A :class:`Cursor` object created by calling :meth:`con.cursor() ` will have a :attr:`connection` attribute that refers to *con*:" +msgid "" +"Read-only attribute that provides the SQLite database :class:`Connection` " +"belonging to the cursor. A :class:`Cursor` object created by " +"calling :meth:`con.cursor() ` will have a :attr:`connection` " +"attribute that refers to *con*:" msgstr "" +"ویژگی فقط‌خواندنی که :class:`Connection` پایگاه داده‌ی SQLite متعلق به مکان‌نما را " +"فراهم می‌کند. یک شیء :class:`Cursor` که با فراخوانی :meth:`con.cursor() " +"` ایجاد شده باشد، ویژگی :attr:`connection` خواهد داشت که به " +"*con* ارجاع می‌دهد:" msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" @@ -1160,54 +2287,131 @@ msgid "" "True\n" ">>> con.close()" msgstr "" +">>> con = sqlite3.connect(\":memory:\")\n" +">>> cur = con.cursor()\n" +">>> cur.connection == con\n" +"True\n" +">>> con.close()" -msgid "Read-only attribute that provides the column names of the last query. To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``." +msgid "" +"Read-only attribute that provides the column names of the last query. To remain " +"compatible with the Python DB API, it returns a 7-tuple for each column where the " +"last six items of each tuple are ``None``." msgstr "" +"ویژگی فقط‌خواندنی که نام ستون‌های آخرین پرس‌وجو را ارائه می‌دهد. برای حفظ سازگاری با " +"Python DB API، برای هر ستون یک تاپل ۷تایی بازمی‌گرداند که شش آیتم پایانی هر تاپل " +"``None`` هستند." msgid "It is set for ``SELECT`` statements without any matching rows as well." -msgstr "" +msgstr "این ویژگی برای دستورهای ``SELECT`` که هیچ ردیف منطبقی ندارند نیز تنظیم می‌شود." -msgid "Read-only attribute that provides the row id of the last inserted row. It is only updated after successful ``INSERT`` or ``REPLACE`` statements using the :meth:`execute` method. For other statements, after :meth:`executemany` or :meth:`executescript`, or if the insertion failed, the value of ``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is ``None``." -msgstr "" +msgid "" +"Read-only attribute that provides the row id of the last inserted row. It is only " +"updated after successful ``INSERT`` or ``REPLACE`` statements using " +"the :meth:`execute` method. For other statements, after :meth:`executemany` " +"or :meth:`executescript`, or if the insertion failed, the value of ``lastrowid`` " +"is left unchanged. The initial value of ``lastrowid`` is ``None``." +msgstr "" +"ویژگی فقط‌خواندنی که شناسه‌ی آخرین ردیف درج‌شده را فراهم می‌کند. این ویژگی فقط پس از " +"دستورهای موفق ``INSERT`` یا ``REPLACE`` با استفاده از متد :meth:`execute` " +"به‌روزرسانی می‌شود. برای دستورهای دیگر، پس از :meth:`executemany` " +"یا :meth:`executescript`، یا اگر درج ناموفق باشد، مقدار ``lastrowid`` بدون تغییر " +"باقی می‌ماند. مقدار اولیه‌ی ``lastrowid`` برابر ``None`` است." msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." -msgstr "" +msgstr "درج‌ها در جدول‌های ``WITHOUT ROWID`` ثبت نمی‌شوند." msgid "Added support for the ``REPLACE`` statement." -msgstr "" +msgstr "پشتیبانی از دستور ``REPLACE`` افزوده شد." -msgid "Read-only attribute that provides the number of modified rows for ``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` for other statements, including :abbr:`CTE (Common Table Expression)` queries. It is only updated by the :meth:`execute` and :meth:`executemany` methods, after the statement has run to completion. This means that any resulting rows must be fetched in order for :attr:`!rowcount` to be updated." -msgstr "" +msgid "" +"Read-only attribute that provides the number of modified rows for ``INSERT``, " +"``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` for other " +"statements, including :abbr:`CTE (Common Table Expression)` queries. It is only " +"updated by the :meth:`execute` and :meth:`executemany` methods, after the " +"statement has run to completion. This means that any resulting rows must be " +"fetched in order for :attr:`!rowcount` to be updated." +msgstr "" +"ویژگی فقط‌خواندنی که تعداد ردیفهای تغییرکرده توسط دستورهای ``INSERT``، ``UPDATE``، " +"``DELETE`` و ``REPLACE`` را ارائه می‌دهد؛ برای سایر دستورها، از جمله " +"پرس‌وجوهای :abbr:`CTE (Common Table Expression)`، ``-1`` است. این ویژگی فقط توسط " +"متدهای :meth:`execute` و :meth:`executemany`، پس از اجرای کامل دستور به‌روزرسانی " +"می‌شود. این بدان معناست که برای به‌روزرسانی :attr:`!rowcount` باید همه ردیفهای حاصل " +"واکشی شوند." -msgid "Control how a row fetched from this :class:`!Cursor` is represented. If ``None``, a row is represented as a :class:`tuple`. Can be set to the included :class:`sqlite3.Row`; or a :term:`callable` that accepts two arguments, a :class:`Cursor` object and the :class:`!tuple` of row values, and returns a custom object representing an SQLite row." -msgstr "" +msgid "" +"Control how a row fetched from this :class:`!Cursor` is represented. If ``None``, " +"a row is represented as a :class:`tuple`. Can be set to the " +"included :class:`sqlite3.Row`; or a :term:`callable` that accepts two arguments, " +"a :class:`Cursor` object and the :class:`!tuple` of row values, and returns a " +"custom object representing an SQLite row." +msgstr "" +"چگونگی بازنمایی ردیفی را که از این :class:`!Cursor` واکشی می‌شود، کنترل می‌کند. اگر " +"``None`` باشد، یک ردیف به‌صورت یک :class:`tuple` بازنمایی می‌شود. می‌توان آن را " +"روی :class:`sqlite3.Row` ارائه‌شده تنظیم کرد؛ یا روی یک :term:`callable` که دو " +"آرگومان می‌پذیرد، یک شیء :class:`Cursor` و :class:`!tuple` مقدارهای ردیف، و یک شیء " +"سفارشی را بازمی‌گرداند که یک ردیف SQLite را بازنمایی می‌کند." -msgid "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!Cursor` was created. Assigning to this attribute does not affect :attr:`Connection.row_factory` of the parent connection." +msgid "" +"Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" +"Cursor` was created. Assigning to this attribute does not " +"affect :attr:`Connection.row_factory` of the parent connection." msgstr "" +"به‌طور پیش‌فرض برابر مقداری است که :attr:`Connection.row_factory` هنگام " +"ایجاد :class:`!Cursor` روی آن تنظیم شده است. انتساب به این ویژگی " +"بر :attr:`Connection.row_factory` اتصال والد تأثیری نمی‌گذارد." msgid "Row objects" -msgstr "" +msgstr "اشیای Row" -msgid "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. It supports iteration, equality testing, :func:`len`, and :term:`mapping` access by column name and index." +msgid "" +"A :class:`!Row` instance serves as a highly " +"optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. It " +"supports iteration, equality testing, :func:`len`, and :term:`mapping` access by " +"column name and index." msgstr "" +"نمونه‌ای از :class:`!Row` به‌عنوان یک :attr:`~Connection.row_factory` بسیار بهینه‌شده " +"برای اشیای :class:`Connection` عمل می‌کند. این نمونه از تکرار، آزمون " +"برابری، :func:`len` و دسترسی به‌صورت :term:`mapping` از طریق نام و اندیس ستون " +"پشتیبانی می‌کند." -msgid "Two :class:`!Row` objects compare equal if they have identical column names and values." +msgid "" +"Two :class:`!Row` objects compare equal if they have identical column names and " +"values." msgstr "" +"دو شیء :class:`!Row` زمانی برابر مقایسه می‌شوند که نام‌ها و مقادیر ستون‌های یکسانی " +"داشته باشند." -msgid "Return a :class:`list` of column names as :class:`strings `. Immediately after a query, it is the first member of each tuple in :attr:`Cursor.description`." +msgid "" +"Return a :class:`list` of column names as :class:`strings `. Immediately " +"after a query, it is the first member of each tuple in :attr:`Cursor.description`." msgstr "" +"یک :class:`list` از نام ستون‌ها به‌صورت :class:`strings ` برمی‌گرداند. بلافاصله " +"پس از یک پرس‌وجو، اولین عضو هر تاپل در :attr:`Cursor.description` است." msgid "Added support of slicing." -msgstr "" +msgstr "پشتیبانی از برش (slicing) افزوده شد." msgid "Blob objects" -msgstr "" +msgstr "اشیای Blob" -msgid "A :class:`Blob` instance is a :term:`file-like object` that can read and write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:`len(blob) ` to get the size (number of bytes) of the blob. Use indices and :term:`slices ` for direct access to the blob data." +msgid "" +"A :class:`Blob` instance is a :term:`file-like object` that can read and write " +"data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:`len(blob) ` " +"to get the size (number of bytes) of the blob. Use indices and :term:`slices " +"` for direct access to the blob data." msgstr "" +"یک نمونه از :class:`Blob` یک :term:`شیء شبه‌فایل ` است که می‌تواند " +"داده‌ها را در یک :abbr:`BLOB (Binary Large OBject)` در SQLite بخواند و بنویسد. برای " +"دریافت اندازه‌ی blob (تعداد بایت‌ها)، :func:`len(blob) ` را فراخوانی کنید. برای " +"دسترسی مستقیم به داده‌های blob، از اندیس‌ها و :term:`برش‌ها ` استفاده کنید." -msgid "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob handle is closed after use." +msgid "" +"Use the :class:`Blob` as a :term:`context manager` to ensure that the blob handle " +"is closed after use." msgstr "" +"از :class:`Blob` به‌عنوان یک :term:`context manager` استفاده کنید تا اطمینان حاصل " +"شود که دسته‌ی blob پس از استفاده بسته می‌شود." msgid "" "con = sqlite3.connect(\":memory:\")\n" @@ -1229,180 +2433,362 @@ msgid "" "print(greeting) # outputs \"b'Hello, world!'\"\n" "con.close()" msgstr "" +"con = sqlite3.connect(\":memory:\")\n" +"con.execute(\"CREATE TABLE test(blob_col blob)\")\n" +"con.execute(\"INSERT INTO test(blob_col) VALUES(zeroblob(13))\")\n" +"\n" +"# Write to our blob, using two write operations:\n" +"with con.blobopen(\"test\", \"blob_col\", 1) as blob:\n" +" blob.write(b\"hello, \")\n" +" blob.write(b\"world.\")\n" +" # Modify the first and last bytes of our blob\n" +" blob[0] = ord(\"H\")\n" +" blob[-1] = ord(\"!\")\n" +"\n" +"# Read the contents of our blob\n" +"with con.blobopen(\"test\", \"blob_col\", 1) as blob:\n" +" greeting = blob.read()\n" +"\n" +"print(greeting) # outputs \"b'Hello, world!'\"\n" +"con.close()" msgid "Close the blob." -msgstr "" +msgstr "بلاب (blob) را ببندید." -msgid "The blob will be unusable from this point onward. An :class:`~sqlite3.Error` (or subclass) exception will be raised if any further operation is attempted with the blob." +msgid "" +"The blob will be unusable from this point onward. An :class:`~sqlite3.Error` (or " +"subclass) exception will be raised if any further operation is attempted with the " +"blob." msgstr "" +"این blob از این نقطه به بعد غیرقابل استفاده خواهد بود. در صورت تلاش برای انجام هر " +"عملیات دیگری با blob، یک استثنای :class:`~sqlite3.Error` (یا زیرکلاس آن) پرتاب " +"خواهد شد." -msgid "Read *length* bytes of data from the blob at the current offset position. If the end of the blob is reached, the data up to :abbr:`EOF (End of File)` will be returned. When *length* is not specified, or is negative, :meth:`~Blob.read` will read until the end of the blob." +msgid "" +"Read *length* bytes of data from the blob at the current offset position. If the " +"end of the blob is reached, the data up to :abbr:`EOF (End of File)` will be " +"returned. When *length* is not specified, or is negative, :meth:`~Blob.read` will " +"read until the end of the blob." msgstr "" +"*length* بایت داده از بلاب (blob) در موقعیت فعلی آفست (offset) خوانده می‌شود. اگر " +"به انتهای بلاب رسیده شود، داده تا :abbr:`EOF (End of File)` بازگردانده می‌شود. " +"هنگامی که *length* مشخص نشده باشد یا منفی باشد، :meth:`~Blob.read` تا انتهای بلاب " +"می‌خواند." -msgid "Write *data* to the blob at the current offset. This function cannot change the blob length. Writing beyond the end of the blob will raise :exc:`ValueError`." +msgid "" +"Write *data* to the blob at the current offset. This function cannot change the " +"blob length. Writing beyond the end of the blob will raise :exc:`ValueError`." msgstr "" +"*data* را در آفست فعلی بلاب (blob) بنویسید. این تابع نمی‌تواند طول بلاب را تغییر " +"دهد. نوشتن فراتر از انتهای بلاب باعث پرتاب :exc:`ValueError` می‌شود." msgid "Return the current access position of the blob." -msgstr "" +msgstr "موقعیت دسترسی جاری بلاب (blob) را برمی‌گرداند." -msgid "Set the current access position of the blob to *offset*. The *origin* argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other values for *origin* are :const:`os.SEEK_CUR` (seek relative to the current position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." +msgid "" +"Set the current access position of the blob to *offset*. The *origin* argument " +"defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other values for " +"*origin* are :const:`os.SEEK_CUR` (seek relative to the current position) " +"and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" +"موقعیت دسترسی فعلی بلاب (blob) را روی *offset* تنظیم می‌کند. آرگومان *origin* به‌طور " +"پیش‌فرض :const:`os.SEEK_SET` (موقعیت‌دهی مطلق بلاب) است. مقادیر دیگر برای *origin* " +"عبارت‌اند از :const:`os.SEEK_CUR` (جابه‌جایی نسبت به موقعیت فعلی) " +"و :const:`os.SEEK_END` (جابه‌جایی نسبت به انتهای بلاب)." msgid "PrepareProtocol objects" -msgstr "" +msgstr "اشیای PrepareProtocol" -msgid "The PrepareProtocol type's single purpose is to act as a :pep:`246` style adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." +msgid "" +"The PrepareProtocol type's single purpose is to act as a :pep:`246` style adaption " +"protocol for objects that can :ref:`adapt themselves ` " +"to :ref:`native SQLite types `." msgstr "" +"تنها هدف نوع PrepareProtocol این است که به‌عنوان یک پروتکل تطبیق به سبک :pep:`246` " +"برای اشیایی عمل کند که می‌توانند :ref:`خود را وفق دهند ` " +"به :ref:`انواع ذاتی SQLite `." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." -msgstr "" +msgstr "سلسله‌مراتب استثنا توسط DB-API 2.0 تعریف شده است (:pep:`249`)." -msgid "This exception is not currently raised by the :mod:`!sqlite3` module, but may be raised by applications using :mod:`!sqlite3`, for example if a user-defined function truncates data while inserting. ``Warning`` is a subclass of :exc:`Exception`." +msgid "" +"This exception is not currently raised by the :mod:`!sqlite3` module, but may be " +"raised by applications using :mod:`!sqlite3`, for example if a user-defined " +"function truncates data while inserting. ``Warning`` is a subclass " +"of :exc:`Exception`." msgstr "" +"این استثنا در حال حاضر توسط ماژول :mod:`!sqlite3` پرتاب نمی‌شود، اما ممکن است توسط " +"برنامه‌هایی که از :mod:`!sqlite3` استفاده می‌کنند پرتاب شود، برای مثال اگر یک تابع " +"تعریف‌شده توسط کاربر هنگام درج، داده‌ها را کوتاه کند. ``Warning`` زیرکلاسی " +"از :exc:`Exception` است." -msgid "The base class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`." +msgid "" +"The base class of the other exceptions in this module. Use this to catch all " +"errors with one single :keyword:`except` statement. ``Error`` is a subclass " +"of :exc:`Exception`." msgstr "" +"کلاس پایه‌ی سایر استثناهای این ماژول. از این برای گرفتن همه‌ی خطاها با یک " +"دستور :keyword:`except` واحد استفاده کنید. ``Error`` یک زیرکلاس " +"از :exc:`Exception` است." -msgid "If the exception originated from within the SQLite library, the following two attributes are added to the exception:" +msgid "" +"If the exception originated from within the SQLite library, the following two " +"attributes are added to the exception:" msgstr "" +"اگر استثنا از درون کتابخانه SQLite سرچشمه گرفته باشد، دو ویژگی زیر به استثنا اضافه " +"می‌شوند:" -msgid "The numeric error code from the `SQLite API `_" -msgstr "" +msgid "" +"The numeric error code from the `SQLite API `_" +msgstr "کد خطای عددی از `SQLite API `_" -msgid "The symbolic name of the numeric error code from the `SQLite API `_" -msgstr "" +msgid "" +"The symbolic name of the numeric error code from the `SQLite API `_" +msgstr "نام نمادینِ کد خطای عددی از `SQLite API `_" -msgid "Exception raised for misuse of the low-level SQLite C API. In other words, if this exception is raised, it probably indicates a bug in the :mod:`!sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." +msgid "" +"Exception raised for misuse of the low-level SQLite C API. In other words, if this " +"exception is raised, it probably indicates a bug in the :mod:`!sqlite3` module. " +"``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" +"استثنایی که برای استفاده‌ی نادرست از API سطح پایین C در SQLite پرتاب می‌شود. به عبارت " +"دیگر، اگر این استثنا پرتاب شد، احتمالاً نشان‌دهنده‌ی یک خطا در ماژول :mod:`!sqlite3` " +"است. ``InterfaceError`` زیرکلاسی از :exc:`Error` است." -msgid "Exception raised for errors that are related to the database. This serves as the base exception for several types of database errors. It is only raised implicitly through the specialised subclasses. ``DatabaseError`` is a subclass of :exc:`Error`." +msgid "" +"Exception raised for errors that are related to the database. This serves as the " +"base exception for several types of database errors. It is only raised implicitly " +"through the specialised subclasses. ``DatabaseError`` is a subclass " +"of :exc:`Error`." msgstr "" +"استثنایی که برای خطاهای مرتبط با پایگاه داده پرتاب می‌شود. این استثنا به‌عنوان " +"استثنای پایه برای چندین نوع از خطاهای پایگاه داده عمل می‌کند. این استثنا تنها به‌طور " +"ضمنی از طریق زیرکلاس‌های تخصصی پرتاب می‌شود. ``DatabaseError`` یک زیرکلاس " +"از :exc:`Error` است." -msgid "Exception raised for errors caused by problems with the processed data, like numeric values out of range, and strings which are too long. ``DataError`` is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised for errors caused by problems with the processed data, like " +"numeric values out of range, and strings which are too long. ``DataError`` is a " +"subclass of :exc:`DatabaseError`." msgstr "" +"استثنایی که برای خطاهای ناشی از مشکلات در داده‌های پردازش‌شده، مانند مقادیر عددی " +"خارج از محدوده و رشته‌هایی که بیش از حد طولانی هستند، پرتاب می‌شود. ``DataError`` " +"زیرکلاسی از :exc:`DatabaseError` است." -msgid "Exception raised for errors that are related to the database's operation, and not necessarily under the control of the programmer. For example, the database path is not found, or a transaction could not be processed. ``OperationalError`` is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised for errors that are related to the database's operation, and not " +"necessarily under the control of the programmer. For example, the database path is " +"not found, or a transaction could not be processed. ``OperationalError`` is a " +"subclass of :exc:`DatabaseError`." msgstr "" +"استثنایی که برای خطاهایی پرتاب می‌شود که به عملیات پایگاه داده مرتبط هستند و لزوماً " +"تحت کنترل برنامه‌نویس نیستند. برای مثال، مسیر پایگاه داده پیدا نشود یا تراکنشی قابل " +"پردازش نباشد. ``OperationalError`` زیرکلاسی از :exc:`DatabaseError` است." -msgid "Exception raised when the relational integrity of the database is affected, e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised when the relational integrity of the database is affected, e.g. a " +"foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" +"استثنایی که هنگامی پرتاب می‌شود که یکپارچگی رابطه‌ای پایگاه داده تحت تأثیر قرار " +"بگیرد، برای مثال وقتی بررسی کلید خارجی ناموفق باشد. این استثنا یک زیرکلاس " +"از :exc:`DatabaseError` است." -msgid "Exception raised when SQLite encounters an internal error. If this is raised, it may indicate that there is a problem with the runtime SQLite library. ``InternalError`` is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised when SQLite encounters an internal error. If this is raised, it " +"may indicate that there is a problem with the runtime SQLite library. " +"``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" +"استثنایی که هنگام بروز خطای داخلی در SQLite پرتاب می‌شود. اگر این استثنا پرتاب شود، " +"ممکن است نشان‌دهنده‌ی وجود مشکل در کتابخانه‌ی ران‌تایم SQLite باشد. ``InternalError`` " +"زیرکلاسی از :exc:`DatabaseError` است." -msgid "Exception raised for :mod:`!sqlite3` API programming errors, for example supplying the wrong number of bindings to a query, or trying to operate on a closed :class:`Connection`. ``ProgrammingError`` is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised for :mod:`!sqlite3` API programming errors, for example supplying " +"the wrong number of bindings to a query, or trying to operate on a " +"closed :class:`Connection`. ``ProgrammingError`` is a subclass " +"of :exc:`DatabaseError`." msgstr "" +"استثنایی که برای خطاهای برنامه‌نویسی در API :mod:`!sqlite3` پرتاب می‌شود، برای مثال " +"ارائه تعداد نادرست اتصال‌ها (bindings) به یک کوئری، یا تلاش برای انجام عملیات روی " +"یک :class:`Connection` بسته. ``ProgrammingError`` زیرکلاسی از :exc:`DatabaseError` " +"است." -msgid "Exception raised in case a method or database API is not supported by the underlying SQLite library. For example, setting *deterministic* to ``True`` in :meth:`~Connection.create_function`, if the underlying SQLite library does not support deterministic functions. ``NotSupportedError`` is a subclass of :exc:`DatabaseError`." +msgid "" +"Exception raised in case a method or database API is not supported by the " +"underlying SQLite library. For example, setting *deterministic* to ``True`` " +"in :meth:`~Connection.create_function`, if the underlying SQLite library does not " +"support deterministic functions. ``NotSupportedError`` is a subclass " +"of :exc:`DatabaseError`." msgstr "" +"استثنایی که در صورتی پرتاب می‌شود که یک متد یا API پایگاه داده توسط کتابخانه SQLite " +"زیرین پشتیبانی نشود. برای مثال، تنظیم *deterministic* روی ``True`` " +"در :meth:`~Connection.create_function`، در صورتی که کتابخانه SQLite زیرین از توابع " +"قطعی پشتیبانی نکند. ``NotSupportedError`` زیرکلاسی از :exc:`DatabaseError` است." msgid "SQLite and Python types" -msgstr "" +msgstr "نوع‌های SQLite و پایتون" -msgid "SQLite natively supports the following types: ``NULL``, ``INTEGER``, ``REAL``, ``TEXT``, ``BLOB``." +msgid "" +"SQLite natively supports the following types: ``NULL``, ``INTEGER``, ``REAL``, " +"``TEXT``, ``BLOB``." msgstr "" +"SQLite به‌صورت بومی از انواع زیر پشتیبانی می‌کند: ``NULL``، ``INTEGER``، ``REAL``، " +"``TEXT``، ``BLOB``." msgid "The following Python types can thus be sent to SQLite without any problem:" -msgstr "" +msgstr "بنابراین می‌توان انواع پایتون زیر را بدون هیچ مشکلی به SQLite ارسال کرد:" msgid "Python type" -msgstr "" +msgstr "نوع پایتون" msgid "SQLite type" -msgstr "" +msgstr "نوع SQLite" msgid "``None``" -msgstr "" +msgstr "``None``" msgid "``NULL``" -msgstr "" +msgstr "``NULL``" msgid ":class:`int`" -msgstr "" +msgstr ":class:`int`" msgid "``INTEGER``" -msgstr "" +msgstr "``INTEGER``" msgid ":class:`float`" -msgstr "" +msgstr ":class:`float`" msgid "``REAL``" -msgstr "" +msgstr "``REAL``" msgid ":class:`str`" -msgstr "" +msgstr ":class:`str`" msgid "``TEXT``" -msgstr "" +msgstr "``TEXT``" msgid ":class:`bytes`" -msgstr "" +msgstr ":class:`bytes`" msgid "``BLOB``" -msgstr "" +msgstr "``BLOB``" msgid "This is how SQLite types are converted to Python types by default:" -msgstr "" +msgstr "انواع SQLite به‌صورت پیش‌فرض این‌گونه به انواع پایتون تبدیل می‌شوند:" msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" -msgstr "" +msgstr "به :attr:`~Connection.text_factory` بستگی دارد، به‌طور پیش‌فرض :class:`str`" -msgid "The type system of the :mod:`!sqlite3` module is extensible in two ways: you can store additional Python types in an SQLite database via :ref:`object adapters `, and you can let the :mod:`!sqlite3` module convert SQLite types to Python types via :ref:`converters `." +msgid "" +"The type system of the :mod:`!sqlite3` module is extensible in two ways: you can " +"store additional Python types in an SQLite database via :ref:`object adapters " +"`, and you can let the :mod:`!sqlite3` module convert SQLite " +"types to Python types via :ref:`converters `." msgstr "" +"سیستم نوع ماژول :mod:`!sqlite3` به ۲ روش قابل‌گسترش است: شما می‌توانید انواع اضافی " +"پایتون را از طریق :ref:`آداپتورهای شیء (object adapters) ` در یک " +"پایگاه‌داده‌ی SQLite ذخیره کنید، و می‌توانید به ماژول :mod:`!sqlite3` اجازه دهید تا " +"انواع SQLite را از طریق :ref:`مبدل‌ها (converters) ` به انواع " +"پایتون تبدیل کند." msgid "Default adapters and converters (deprecated)" -msgstr "" +msgstr "سازگارکننده‌ها و مبدل‌های پیش‌فرض (منسوخ)" -msgid "The default adapters and converters are deprecated as of Python 3.12. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to your needs." +msgid "" +"The default adapters and converters are deprecated as of Python 3.12. Instead, use " +"the :ref:`sqlite3-adapter-converter-recipes` and tailor them to your needs." msgstr "" +"آداپتورها و مبدل‌های پیش‌فرض از پایتون 3.12 منسوخ شده‌اند. در عوض، از :ref:`sqlite3-" +"adapter-converter-recipes` استفاده کنید و آن‌ها را متناسب با نیازهای خود تنظیم کنید." msgid "The deprecated default adapters and converters consist of:" -msgstr "" +msgstr "آداپتورها و مبدل‌های پیش‌فرض منسوخ‌شده عبارت‌اند از:" -msgid "An adapter for :class:`datetime.date` objects to :class:`strings ` in `ISO 8601`_ format." +msgid "" +"An adapter for :class:`datetime.date` objects to :class:`strings ` in `ISO " +"8601`_ format." msgstr "" +"آداپتوری برای تبدیل اشیای :class:`datetime.date` به :class:`strings ` در قالب " +"`ISO 8601`_." -msgid "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 format." +msgid "" +"An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 format." msgstr "" +"یک آداپتور (adapter) برای تبدیل اشیای :class:`datetime.datetime` به رشته‌هایی در " +"قالب ISO 8601." -msgid "A converter for :ref:`declared ` \"date\" types to :class:`datetime.date` objects." +msgid "" +"A converter for :ref:`declared ` \"date\" types " +"to :class:`datetime.date` objects." msgstr "" +"مبدلی برای تبدیل انواع \"date\" :ref:`اعلام‌شده ` به " +"اشیای :class:`datetime.date`." -msgid "A converter for declared \"timestamp\" types to :class:`datetime.datetime` objects. Fractional parts will be truncated to 6 digits (microsecond precision)." +msgid "" +"A converter for declared \"timestamp\" types to :class:`datetime.datetime` " +"objects. Fractional parts will be truncated to 6 digits (microsecond precision)." msgstr "" +"مبدلی برای تبدیل انواع «timestamp» اعلام‌شده به اشیای :class:`datetime.datetime`. " +"بخش‌های کسری به ۶ رقم کوتاه می‌شوند (دقت میکروثانیه)." -msgid "The default \"timestamp\" converter ignores UTC offsets in the database and always returns a naive :class:`datetime.datetime` object. To preserve UTC offsets in timestamps, either leave converters disabled, or register an offset-aware converter with :func:`register_converter`." +msgid "" +"The default \"timestamp\" converter ignores UTC offsets in the database and always " +"returns a naive :class:`datetime.datetime` object. To preserve UTC offsets in " +"timestamps, either leave converters disabled, or register an offset-aware " +"converter with :func:`register_converter`." msgstr "" +"مبدل پیش‌فرض \"timestamp\" انحراف‌های UTC را در پایگاه داده نادیده می‌گیرد و همیشه یک " +"شیء :class:`datetime.datetime` ساده برمی‌گرداند. برای حفظ انحراف‌های UTC در " +"timestampها، یا مبدل‌ها را غیرفعال نگه دارید، یا یک مبدل آگاه از انحراف را " +"با :func:`register_converter` ثبت کنید." msgid "Command-line interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "The :mod:`!sqlite3` module can be invoked as a script, using the interpreter's :option:`-m` switch, in order to provide a simple SQLite shell. The argument signature is as follows::" +msgid "" +"The :mod:`!sqlite3` module can be invoked as a script, using the " +"interpreter's :option:`-m` switch, in order to provide a simple SQLite shell. The " +"argument signature is as follows::" msgstr "" +"می‌توان ماژول :mod:`!sqlite3` را به‌عنوان یک اسکریپت، با استفاده از سوییچ :option:`-" +"m` مفسر، فراخوانی کرد تا یک پوسته ساده SQLite فراهم شود. امضای آرگومان به صورت زیر " +"است::" msgid "python -m sqlite3 [-h] [-v] [filename] [sql]" -msgstr "" +msgstr "python -m sqlite3 [-h] [-v] [filename] [sql]" msgid "Type ``.quit`` or CTRL-D to exit the shell." -msgstr "" +msgstr "برای خروج از پوسته، ``.quit`` یا CTRL-D را وارد کنید." msgid "Print CLI help." -msgstr "" +msgstr "چاپ راهنمای CLI." msgid "Print underlying SQLite library version." -msgstr "" +msgstr "نسخه‌ی کتابخانه‌ی SQLite زیرین را چاپ می‌کند." msgid "How-to guides" -msgstr "" +msgstr "راهنماهای چگونگی" msgid "How to use placeholders to bind values in SQL queries" msgstr "" +"چگونه از جای‌نگهدارها (placeholders) برای مقیدسازی مقادیر در پرس‌وجوهای SQL " +"استفاده کنیم" -msgid "SQL operations usually need to use values from Python variables. However, beware of using Python's string operations to assemble queries, as they are vulnerable to `SQL injection attacks`_. For example, an attacker can simply close the single quote and inject ``OR TRUE`` to select all rows::" +msgid "" +"SQL operations usually need to use values from Python variables. However, beware " +"of using Python's string operations to assemble queries, as they are vulnerable to " +"`SQL injection attacks`_. For example, an attacker can simply close the single " +"quote and inject ``OR TRUE`` to select all rows::" msgstr "" +"عملیات‌های SQL معمولاً به استفاده از مقادیر متغیرهای پایتون نیاز دارند. با این حال، " +"از استفاده از عملیات رشته‌ای پایتون برای ساخت پرس‌وجوها برحذر باشید، زیرا در برابر " +"`حملات تزریق SQL`_ آسیب‌پذیرند. برای مثال، یک مهاجم می‌تواند به‌سادگی علامت نقل‌قول " +"تکی را ببندد و ``OR TRUE`` را تزریق کند تا تمام ردیف‌ها انتخاب شوند::" msgid "" ">>> # Never do this -- insecure!\n" @@ -1413,12 +2799,40 @@ msgid "" "SELECT * FROM stocks WHERE symbol = '' OR TRUE; --'\n" ">>> cur.execute(sql)" msgstr "" +">>> # Never do this -- insecure!\n" +">>> symbol = input()\n" +"' OR TRUE; --\n" +">>> sql = \"SELECT * FROM stocks WHERE symbol = '%s'\" % symbol\n" +">>> print(sql)\n" +"SELECT * FROM stocks WHERE symbol = '' OR TRUE; --'\n" +">>> cur.execute(sql)" -msgid "Instead, use the DB-API's parameter substitution. To insert a variable into a query string, use a placeholder in the string, and substitute the actual values into the query by providing them as a :class:`tuple` of values to the second argument of the cursor's :meth:`~Cursor.execute` method." +msgid "" +"Instead, use the DB-API's parameter substitution. To insert a variable into a " +"query string, use a placeholder in the string, and substitute the actual values " +"into the query by providing them as a :class:`tuple` of values to the second " +"argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" +"در عوض، از جای‌گزینی پارامترِ DB-API استفاده کنید. برای درج یک متغیر در رشته‌ی پرس‌وجو، " +"از یک جای‌نگهدار (placeholder) در رشته استفاده کنید و مقادیر واقعی را با ارائه آن‌ها " +"به‌صورت یک :class:`tuple` از مقادیر به آرگومان دوم متد :meth:`~Cursor.execute` " +"نشانگر (cursor)، در پرس‌وجو جای‌گزین کنید." -msgid "An SQL statement may use one of two kinds of placeholders: question marks (qmark style) or named placeholders (named style). For the qmark style, *parameters* must be a :term:`sequence` whose length must match the number of placeholders, or a :exc:`ProgrammingError` is raised. For the named style, *parameters* must be an instance of a :class:`dict` (or a subclass), which must contain keys for all named parameters; any extra items are ignored. Here's an example of both styles:" -msgstr "" +msgid "" +"An SQL statement may use one of two kinds of placeholders: question marks (qmark " +"style) or named placeholders (named style). For the qmark style, *parameters* must " +"be a :term:`sequence` whose length must match the number of placeholders, or " +"a :exc:`ProgrammingError` is raised. For the named style, *parameters* must be an " +"instance of a :class:`dict` (or a subclass), which must contain keys for all named " +"parameters; any extra items are ignored. Here's an example of both styles:" +msgstr "" +"یک دستور SQL ممکن است از یکی از دو نوع جای‌نگهدار استفاده کند: علامت‌های سؤال (سبک " +"qmark) یا جای‌نگهدارهای نام‌دار (سبک named). برای سبک qmark، *parameters* باید " +"یک :term:`sequence` باشد که طول آن باید با تعداد جای‌نگهدارها برابر باشد، در غیر " +"این صورت یک :exc:`ProgrammingError` پرتاب می‌شود. برای سبک named، *parameters* باید " +"نمونه‌ای از :class:`dict` (یا یک زیرکلاس) باشد که باید شامل کلیدهایی برای همه‌ی " +"پارامترهای نام‌دار باشد؛ هر آیتم اضافی نادیده گرفته می‌شود. در ادامه مثالی از هر دو " +"سبک آمده است:" msgid "" "con = sqlite3.connect(\":memory:\")\n" @@ -1439,26 +2853,91 @@ msgid "" "print(cur.fetchall())\n" "con.close()" msgstr "" +"con = sqlite3.connect(\":memory:\")\n" +"cur = con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" +"\n" +"# این، سبک نام‌دار (named style) است که با executemany() استفاده می‌شود:\n" +"data = (\n" +" {\"name\": \"C\", \"year\": 1972},\n" +" {\"name\": \"Fortran\", \"year\": 1957},\n" +" {\"name\": \"Python\", \"year\": 1991},\n" +" {\"name\": \"Go\", \"year\": 2009},\n" +")\n" +"cur.executemany(\"INSERT INTO lang VALUES(:name, :year)\", data)\n" +"\n" +"# این، سبک علامت سؤال (qmark style) است که در یک پرس‌وجوی SELECT استفاده می‌شود:\n" +"params = (1972,)\n" +"cur.execute(\"SELECT * FROM lang WHERE first_appeared = ?\", params)\n" +"print(cur.fetchall())\n" +"con.close()" -msgid ":pep:`249` numeric placeholders are *not* supported. If used, they will be interpreted as named placeholders." +msgid "" +":pep:`249` numeric placeholders are *not* supported. If used, they will be " +"interpreted as named placeholders." msgstr "" +"از جای‌نگه‌دارهای عددی :pep:`249` پشتیبانی *نمی‌شود*. در صورت استفاده، به‌عنوان " +"جای‌نگه‌دارهای نام‌دار تفسیر خواهند شد." msgid "How to adapt custom Python types to SQLite values" -msgstr "" +msgstr "چگونگی تطبیق انواع سفارشی پایتون با مقادیر SQLite" -msgid "SQLite supports only a limited set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the :ref:`Python types SQLite natively understands `." +msgid "" +"SQLite supports only a limited set of data types natively. To store custom Python " +"types in SQLite databases, *adapt* them to one of the :ref:`Python types SQLite " +"natively understands `." msgstr "" +"SQLite تنها از مجموعه‌ای محدود از انواع داده به‌صورت بومی پشتیبانی می‌کند. برای ذخیره‌ی " +"انواع پایتونی سفارشی در پایگاه‌های داده‌ی SQLite، آن‌ها را با یکی از :ref:`انواع " +"پایتونی که SQLite به‌صورت بومی می‌شناسد ` *سازگار* کنید." -msgid "There are two ways to adapt Python objects to SQLite types: letting your object adapt itself, or using an *adapter callable*. The latter will take precedence above the former. For a library that exports a custom type, it may make sense to enable that type to adapt itself. As an application developer, it may make more sense to take direct control by registering custom adapter functions." -msgstr "" +msgid "" +"There are two ways to adapt Python objects to SQLite types: letting your object " +"adapt itself, or using an *adapter callable*. The latter will take precedence " +"above the former. For a library that exports a custom type, it may make sense to " +"enable that type to adapt itself. As an application developer, it may make more " +"sense to take direct control by registering custom adapter functions." +msgstr "" +"دو روش برای تطبیق اشیای پایتون با انواع SQLite وجود دارد: اینکه بگذارید شیء شما " +"خودش را تطبیق دهد، یا استفاده از یک *فراخوان‌پذیر تطبیق‌دهنده (adapter callable)*. " +"دومی بر اولی تقدم خواهد داشت. برای کتابخانه‌ای که یک نوع سفارشی صادر می‌کند، ممکن " +"است منطقی باشد که آن نوع بتواند خودش را تطبیق دهد. به‌عنوان توسعه‌دهنده‌ی برنامه‌ی " +"کاربردی، ممکن است منطقی‌تر باشد که با ثبت توابع تطبیق‌دهنده‌ی سفارشی، کنترل مستقیم را " +"در دست بگیرید." msgid "How to write adaptable objects" -msgstr "" +msgstr "چگونه اشیای سازگارپذیر بنویسیم" + +msgid "" +"Suppose we have a :class:`!Point` class that represents a pair of coordinates, " +"``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will be " +"stored as a text string in the database, using a semicolon to separate the " +"coordinates. This can be implemented by adding a ``__conform__(self, protocol)`` " +"method which returns the adapted value. The object passed to *protocol* will be of " +"type :class:`PrepareProtocol`." +msgstr "" +"فرض کنید یک کلاس :class:`!Point` داریم که یک جفت مختصات، ``x`` و ``y``، را در یک " +"دستگاه مختصات دکارتی نشان می‌دهد. جفت مختصات به‌صورت یک رشته متنی در پایگاه داده " +"ذخیره خواهد شد و برای جداسازی مختصات از نقطه‌ویرگول استفاده می‌شود. این کار را " +"می‌توان با افزودن یک متد ``__conform__(self, protocol)`` پیاده‌سازی کرد که مقدار " +"تطبیق‌یافته را برمی‌گرداند. شیء منتقل‌شده به *protocol* از " +"نوع :class:`PrepareProtocol` خواهد بود." -msgid "Suppose we have a :class:`!Point` class that represents a pair of coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will be stored as a text string in the database, using a semicolon to separate the coordinates. This can be implemented by adding a ``__conform__(self, protocol)`` method which returns the adapted value. The object passed to *protocol* will be of type :class:`PrepareProtocol`." +msgid "" +"class Point:\n" +" def __init__(self, x, y):\n" +" self.x, self.y = x, y\n" +"\n" +" def __conform__(self, protocol):\n" +" if protocol is sqlite3.PrepareProtocol:\n" +" return f\"{self.x};{self.y}\"\n" +"\n" +"con = sqlite3.connect(\":memory:\")\n" +"cur = con.cursor()\n" +"\n" +"cur.execute(\"SELECT ?\", (Point(4.0, -3.2),))\n" +"print(cur.fetchone()[0])\n" +"con.close()" msgstr "" - -msgid "" "class Point:\n" " def __init__(self, x, y):\n" " self.x, self.y = x, y\n" @@ -1473,13 +2952,17 @@ msgid "" "cur.execute(\"SELECT ?\", (Point(4.0, -3.2),))\n" "print(cur.fetchone()[0])\n" "con.close()" -msgstr "" msgid "How to register adapter callables" -msgstr "" +msgstr "چگونه موارد فراخوانی‌پذیر آداپتور را ثبت کنید" -msgid "The other possibility is to create a function that converts the Python object to an SQLite-compatible type. This function can then be registered using :func:`register_adapter`." +msgid "" +"The other possibility is to create a function that converts the Python object to " +"an SQLite-compatible type. This function can then be registered " +"using :func:`register_adapter`." msgstr "" +"امکان دیگر، ساخت تابعی است که شیء پایتون را به نوعی سازگار با SQLite تبدیل می‌کند. " +"سپس می‌توانید این تابع را با استفاده از :func:`register_adapter` ثبت کنید." msgid "" "class Point:\n" @@ -1498,42 +2981,88 @@ msgid "" "print(cur.fetchone()[0])\n" "con.close()" msgstr "" +"class Point:\n" +" def __init__(self, x, y):\n" +" self.x, self.y = x, y\n" +"\n" +"def adapt_point(point):\n" +" return f\"{point.x};{point.y}\"\n" +"\n" +"sqlite3.register_adapter(Point, adapt_point)\n" +"\n" +"con = sqlite3.connect(\":memory:\")\n" +"cur = con.cursor()\n" +"\n" +"cur.execute(\"SELECT ?\", (Point(1.0, 2.5),))\n" +"print(cur.fetchone()[0])\n" +"con.close()" msgid "How to convert SQLite values to custom Python types" -msgstr "" +msgstr "چگونه مقادیر SQLite را به انواع سفارشی پایتون تبدیل کنیم" -msgid "Writing an adapter lets you convert *from* custom Python types *to* SQLite values. To be able to convert *from* SQLite values *to* custom Python types, we use *converters*." +msgid "" +"Writing an adapter lets you convert *from* custom Python types *to* SQLite values. " +"To be able to convert *from* SQLite values *to* custom Python types, we use " +"*converters*." msgstr "" +"نوشتن یک آداپتور امکان تبدیل *از* انواع سفارشی پایتون *به* مقادیر SQLite را به شما " +"می‌دهد. برای توانایی تبدیل *از* مقادیر SQLite *به* انواع سفارشی پایتون، از *مبدل‌ها* " +"استفاده می‌کنیم." -msgid "Let's go back to the :class:`!Point` class. We stored the x and y coordinates separated via semicolons as strings in SQLite." +msgid "" +"Let's go back to the :class:`!Point` class. We stored the x and y coordinates " +"separated via semicolons as strings in SQLite." msgstr "" +"بیایید به کلاس :class:`!Point` بازگردیم. ما مختصات x و y را به‌صورت رشته‌هایی که با " +"نقطه‌ویرگول از یکدیگر جدا شده‌اند، در SQLite ذخیره کردیم." -msgid "First, we'll define a converter function that accepts the string as a parameter and constructs a :class:`!Point` object from it." +msgid "" +"First, we'll define a converter function that accepts the string as a parameter " +"and constructs a :class:`!Point` object from it." msgstr "" +"ابتدا، یک تابع تبدیل‌کننده تعریف می‌کنیم که رشته را به‌عنوان پارامتر می‌پذیرد و از روی " +"آن یک شیء :class:`!Point` می‌سازد." -msgid "Converter functions are **always** passed a :class:`bytes` object, no matter the underlying SQLite data type." +msgid "" +"Converter functions are **always** passed a :class:`bytes` object, no matter the " +"underlying SQLite data type." msgstr "" +"توابع مبدل **همیشه** یک شیء :class:`bytes` دریافت می‌کنند، صرف‌نظر از نوع داده‌ی " +"زیرین SQLite." msgid "" "def convert_point(s):\n" " x, y = map(float, s.split(b\";\"))\n" " return Point(x, y)" msgstr "" +"def convert_point(s):\n" +" x, y = map(float, s.split(b\";\"))\n" +" return Point(x, y)" -msgid "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite value. This is done when connecting to a database, using the *detect_types* parameter of :func:`connect`. There are three options:" +msgid "" +"We now need to tell :mod:`!sqlite3` when it should convert a given SQLite value. " +"This is done when connecting to a database, using the *detect_types* parameter " +"of :func:`connect`. There are three options:" msgstr "" +"اکنون باید به :mod:`!sqlite3` بگوییم که چه زمانی باید یک مقدار SQLite مشخص را " +"تبدیل کند. این کار هنگام اتصال به یک پایگاه داده، با استفاده از پارامتر " +"*detect_types* تابع :func:`connect` انجام می‌شود. سه گزینه وجود دارد:" msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" -msgstr "" +msgstr "ضمنی: *detect_types* را روی :const:`PARSE_DECLTYPES` تنظیم کنید" msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" -msgstr "" +msgstr "صریح: *detect_types* را روی :const:`PARSE_COLNAMES` تنظیم کنید" -msgid "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES``. Column names take precedence over declared types." +msgid "" +"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES``. " +"Column names take precedence over declared types." msgstr "" +"هر دو: *detect_types* را روی ``sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES`` " +"تنظیم کنید. نام ستون‌ها بر انواع اعلام‌شده اولویت دارند." msgid "The following example illustrates the implicit and explicit approaches:" -msgstr "" +msgstr "مثال زیر رویکردهای ضمنی و صریح را نشان می‌دهد:" msgid "" "class Point:\n" @@ -1575,12 +3104,50 @@ msgid "" "cur.close()\n" "con.close()" msgstr "" +"class Point:\n" +" def __init__(self, x, y):\n" +" self.x, self.y = x, y\n" +"\n" +" def __repr__(self):\n" +" return f\"Point({self.x}, {self.y})\"\n" +"\n" +"def adapt_point(point):\n" +" return f\"{point.x};{point.y}\"\n" +"\n" +"def convert_point(s):\n" +" x, y = list(map(float, s.split(b\";\")))\n" +" return Point(x, y)\n" +"\n" +"# Register the adapter and converter\n" +"sqlite3.register_adapter(Point, adapt_point)\n" +"sqlite3.register_converter(\"point\", convert_point)\n" +"\n" +"# 1) Parse using declared types\n" +"p = Point(4.0, -3.2)\n" +"con = sqlite3.connect(\":memory:\", detect_types=sqlite3.PARSE_DECLTYPES)\n" +"cur = con.execute(\"CREATE TABLE test(p point)\")\n" +"\n" +"cur.execute(\"INSERT INTO test(p) VALUES(?)\", (p,))\n" +"cur.execute(\"SELECT p FROM test\")\n" +"print(\"with declared types:\", cur.fetchone()[0])\n" +"cur.close()\n" +"con.close()\n" +"\n" +"# 2) Parse using column names\n" +"con = sqlite3.connect(\":memory:\", detect_types=sqlite3.PARSE_COLNAMES)\n" +"cur = con.execute(\"CREATE TABLE test(p)\")\n" +"\n" +"cur.execute(\"INSERT INTO test(p) VALUES(?)\", (p,))\n" +"cur.execute('SELECT p AS \"p [point]\" FROM test')\n" +"print(\"with column names:\", cur.fetchone()[0])\n" +"cur.close()\n" +"con.close()" msgid "Adapter and converter recipes" -msgstr "" +msgstr "دستورپخت‌های آداپتور و مبدل" msgid "This section shows recipes for common adapters and converters." -msgstr "" +msgstr "این بخش دستورالعمل‌هایی برای آداپتورها و مبدل‌های رایج ارائه می‌دهد." msgid "" "import datetime as dt\n" @@ -1618,12 +3185,61 @@ msgid "" "sqlite3.register_converter(\"datetime\", convert_datetime)\n" "sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgstr "" +"import datetime as dt\n" +"import sqlite3\n" +"\n" +"def adapt_date_iso(val):\n" +" \"\"\"Adapt datetime.date to ISO 8601 date.\"\"\"\n" +" return val.isoformat()\n" +"\n" +"def adapt_datetime_iso(val):\n" +" \"\"\"Adapt datetime.datetime to timezone-naive ISO 8601 date.\"\"\"\n" +" return val.replace(tzinfo=None).isoformat()\n" +"\n" +"def adapt_datetime_epoch(val):\n" +" \"\"\"Adapt datetime.datetime to Unix timestamp.\"\"\"\n" +" return int(val.timestamp())\n" +"\n" +"sqlite3.register_adapter(dt.date, adapt_date_iso)\n" +"sqlite3.register_adapter(dt.datetime, adapt_datetime_iso)\n" +"sqlite3.register_adapter(dt.datetime, adapt_datetime_epoch)\n" +"\n" +"def convert_date(val):\n" +" \"\"\"Convert ISO 8601 date to datetime.date object.\"\"\"\n" +" return dt.date.fromisoformat(val.decode())\n" +"\n" +"def convert_datetime(val):\n" +" \"\"\"Convert ISO 8601 datetime to datetime.datetime object.\"\"\"\n" +" return dt.datetime.fromisoformat(val.decode())\n" +"\n" +"def convert_timestamp(val):\n" +" \"\"\"Convert Unix epoch timestamp to datetime.datetime object.\"\"\"\n" +" return dt.datetime.fromtimestamp(int(val))\n" +"\n" +"sqlite3.register_converter(\"date\", convert_date)\n" +"sqlite3.register_converter(\"datetime\", convert_datetime)\n" +"sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgid "How to use connection shortcut methods" -msgstr "" +msgstr "نحوه استفاده از متدهای میان‌بر اتصال" -msgid "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :meth:`~Connection.executescript` methods of the :class:`Connection` class, your code can be written more concisely because you don't have to create the (often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:`Cursor` objects are created implicitly and these shortcut methods return the cursor objects. This way, you can execute a ``SELECT`` statement and iterate over it directly using only a single call on the :class:`Connection` object." -msgstr "" +msgid "" +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, " +"and :meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, " +"the :class:`Cursor` objects are created implicitly and these shortcut methods " +"return the cursor objects. This way, you can execute a ``SELECT`` statement and " +"iterate over it directly using only a single call on the :class:`Connection` " +"object." +msgstr "" +"با استفاده از متدهای :meth:`~Connection.execute`، :meth:`~Connection.executemany` " +"و :meth:`~Connection.executescript` کلاس :class:`Connection`، می‌توانید کد خود را " +"مختصرتر بنویسید، زیرا نیازی نیست اشیای :class:`Cursor` را (که اغلب غیرضروری هستند) " +"به‌صورت صریح ایجاد کنید. در عوض، اشیای :class:`Cursor` به‌صورت ضمنی ایجاد می‌شوند و " +"این متدهای میان‌بر اشیای cursor را برمی‌گردانند. به این ترتیب، می‌توانید یک دستور " +"``SELECT`` را اجرا کرده و تنها با یک فراخوانی روی شیء :class:`Connection`، مستقیماً " +"آن را پیمایش کنید." msgid "" "# Create and fill the table.\n" @@ -1645,18 +3261,60 @@ msgid "" "# the connection object should be closed manually\n" "con.close()" msgstr "" +"# Create and fill the table.\n" +"con = sqlite3.connect(\":memory:\")\n" +"con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" +"data = [\n" +" (\"C++\", 1985),\n" +" (\"Objective-C\", 1984),\n" +"]\n" +"con.executemany(\"INSERT INTO lang(name, first_appeared) VALUES(?, ?)\", data)\n" +"\n" +"# Print the table contents\n" +"for row in con.execute(\"SELECT name, first_appeared FROM lang\"):\n" +" print(row)\n" +"\n" +"print(\"I just deleted\", con.execute(\"DELETE FROM lang\").rowcount, \"rows\")\n" +"\n" +"# close() is not a shortcut method and it's not called automatically;\n" +"# the connection object should be closed manually\n" +"con.close()" msgid "How to use the connection context manager" -msgstr "" +msgstr "نحوه استفاده از مدیر زمینه اتصال" -msgid "A :class:`Connection` object can be used as a context manager that automatically commits or rolls back open transactions when leaving the body of the context manager. If the body of the :keyword:`with` statement finishes without exceptions, the transaction is committed. If this commit fails, or if the body of the ``with`` statement raises an uncaught exception, the transaction is rolled back. If :attr:`~Connection.autocommit` is ``False``, a new transaction is implicitly opened after committing or rolling back." -msgstr "" +msgid "" +"A :class:`Connection` object can be used as a context manager that automatically " +"commits or rolls back open transactions when leaving the body of the context " +"manager. If the body of the :keyword:`with` statement finishes without exceptions, " +"the transaction is committed. If this commit fails, or if the body of the ``with`` " +"statement raises an uncaught exception, the transaction is rolled back. " +"If :attr:`~Connection.autocommit` is ``False``, a new transaction is implicitly " +"opened after committing or rolling back." +msgstr "" +"یک شیء :class:`Connection` می‌تواند به‌عنوان یک مدیر زمینه استفاده شود که هنگام خروج " +"از بدنه‌ی مدیر زمینه، تراکنش‌های باز را به‌طور خودکار ثبت یا بازگردانی می‌کند. اگر بدنه‌ی " +"دستور :keyword:`with` بدون استثنا به پایان برسد، تراکنش ثبت می‌شود. اگر این ثبت " +"ناموفق باشد، یا اگر بدنه‌ی دستور ``with`` یک استثنای گرفته‌نشده پرتاب کند، تراکنش " +"بازگردانی می‌شود. اگر :attr:`~Connection.autocommit` برابر ``False`` باشد، پس از " +"ثبت یا بازگردانی، یک تراکنش جدید به‌طور ضمنی باز می‌شود." -msgid "If there is no open transaction upon leaving the body of the ``with`` statement, or if :attr:`~Connection.autocommit` is ``True``, the context manager does nothing." +msgid "" +"If there is no open transaction upon leaving the body of the ``with`` statement, " +"or if :attr:`~Connection.autocommit` is ``True``, the context manager does nothing." msgstr "" +"اگر هنگام خروج از بدنه‌ی دستور ``with`` هیچ تراکنش بازی وجود نداشته باشد، یا " +"اگر :attr:`~Connection.autocommit` برابر ``True`` باشد، مدیر زمینه هیچ کاری انجام " +"نمی‌دهد." -msgid "The context manager neither implicitly opens a new transaction nor closes the connection. If you need a closing context manager, consider using :meth:`contextlib.closing`." +msgid "" +"The context manager neither implicitly opens a new transaction nor closes the " +"connection. If you need a closing context manager, consider " +"using :meth:`contextlib.closing`." msgstr "" +"این مدیر زمینه نه به‌طور ضمنی تراکنش جدیدی را باز می‌کند و نه اتصال را می‌بندد. اگر " +"به یک مدیر زمینه برای بستن نیاز دارید، استفاده از :meth:`contextlib.closing` را در " +"نظر بگیرید." msgid "" "con = sqlite3.connect(\":memory:\")\n" @@ -1674,19 +3332,39 @@ msgid "" "except sqlite3.IntegrityError:\n" " print(\"couldn't add Python twice\")\n" "\n" -"# Connection object used as context manager only commits or rollbacks transactions,\n" +"# Connection object used as context manager only commits or rollbacks " +"transactions,\n" "# so the connection object should be closed manually\n" "con.close()" msgstr "" +"con = sqlite3.connect(\":memory:\")\n" +"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)\")\n" +"\n" +"# در صورت موفقیت، con.commit() پس از آن به‌صورت خودکار فراخوانی می‌شود\n" +"with con:\n" +" con.execute(\"INSERT INTO lang(name) VALUES(?)\", (\"Python\",))\n" +"\n" +"# con.rollback() پس از آنکه بلوک with با یک استثنا به پایان می‌رسد فراخوانی می‌شود،\n" +"# استثنا همچنان پرتاب می‌شود و باید گرفته شود\n" +"try:\n" +" with con:\n" +" con.execute(\"INSERT INTO lang(name) VALUES(?)\", (\"Python\",))\n" +"except sqlite3.IntegrityError:\n" +" print(\"couldn't add Python twice\")\n" +"\n" +"# شیء اتصال وقتی به‌عنوان مدیر زمینه استفاده می‌شود، فقط تراکنش‌ها را commit یا " +"rollback می‌کند،\n" +"# بنابراین شیء اتصال باید به‌صورت دستی بسته شود\n" +"con.close()" msgid "How to work with SQLite URIs" -msgstr "" +msgstr "نحوه کار با URIهای SQLite" msgid "Some useful URI tricks include:" -msgstr "" +msgstr "برخی ترفندهای مفید URI عبارتند از:" msgid "Open a database in read-only mode:" -msgstr "" +msgstr "باز کردن یک پایگاه داده در حالت فقط‌خواندنی:" msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" @@ -1695,18 +3373,31 @@ msgid "" "OperationalError: attempt to write a readonly database\n" ">>> con.close()" msgstr "" +">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" +">>> con.execute(\"CREATE TABLE readonly(data)\")\n" +"Traceback (most recent call last):\n" +"OperationalError: attempt to write a readonly database\n" +">>> con.close()" -msgid "Do not implicitly create a new database file if it does not already exist; will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" +msgid "" +"Do not implicitly create a new database file if it does not already exist; will " +"raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" +"اگر فایل پایگاه داده جدید از قبل وجود نداشته باشد، به‌طور ضمنی یک فایل پایگاه داده " +"جدید ایجاد نمی‌شود؛ اگر امکان ایجاد فایل جدید وجود نداشته " +"باشد، :exc:`~sqlite3.OperationalError` پرتاب می‌شود:" msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" msgstr "" +">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" +"Traceback (most recent call last):\n" +"OperationalError: unable to open database file" msgid "Create a shared named in-memory database:" -msgstr "" +msgstr "ایجاد یک پایگاه داده‌ی درون‌حافظه‌ای نام‌دار مشترک:" msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" @@ -1721,29 +3412,67 @@ msgid "" "con1.close()\n" "con2.close()" msgstr "" +"db = \"file:mem1?mode=memory&cache=shared\"\n" +"con1 = sqlite3.connect(db, uri=True)\n" +"con2 = sqlite3.connect(db, uri=True)\n" +"with con1:\n" +" con1.execute(\"CREATE TABLE shared(data)\")\n" +" con1.execute(\"INSERT INTO shared VALUES(28)\")\n" +"res = con2.execute(\"SELECT data FROM shared\")\n" +"assert res.fetchone() == (28,)\n" +"\n" +"con1.close()\n" +"con2.close()" -msgid "More information about this feature, including a list of parameters, can be found in the `SQLite URI documentation`_." +msgid "" +"More information about this feature, including a list of parameters, can be found " +"in the `SQLite URI documentation`_." msgstr "" +"اطلاعات بیشتر درباره این قابلیت، از جمله فهرستی از پارامترها، در `SQLite URI " +"documentation`_ یافت می‌شود." msgid "How to create and use row factories" -msgstr "" +msgstr "نحوه‌ی ایجاد و استفاده از کارخانه‌های ردیف (row factories)" -msgid "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :class:`!tuple` does not suit your needs, you can use the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`." +msgid "" +"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :class:`!" +"tuple` does not suit your needs, you can use the :class:`sqlite3.Row` class or a " +"custom :attr:`~Cursor.row_factory`." msgstr "" +"به‌طور پیش‌فرض، :mod:`!sqlite3` هر ردیف را به‌صورت یک :class:`tuple` نمایش می‌دهد. اگر " +"یک :class:`!tuple` نیاز شما را برآورده نمی‌کند، می‌توانید از " +"کلاس :class:`sqlite3.Row` یا یک :attr:`~Cursor.row_factory` سفارشی استفاده کنید." -msgid "While :attr:`!row_factory` exists as an attribute both on the :class:`Cursor` and the :class:`Connection`, it is recommended to set :class:`Connection.row_factory`, so all cursors created from the connection will use the same row factory." +msgid "" +"While :attr:`!row_factory` exists as an attribute both on the :class:`Cursor` and " +"the :class:`Connection`, it is recommended to set :class:`Connection.row_factory`, " +"so all cursors created from the connection will use the same row factory." msgstr "" +"اگرچه :attr:`!row_factory` به‌عنوان یک ویژگی هم در :class:`Cursor` و هم " +"در :class:`Connection` وجود دارد، توصیه می‌شود :class:`Connection.row_factory` را " +"تنظیم کنید تا تمام نشانگرهایی که از اتصال ایجاد می‌شوند از همان کارخانه‌ی ردیف (row " +"factory) استفاده کنند." -msgid ":class:`!Row` provides indexed and case-insensitive named access to columns, with minimal memory overhead and performance impact over a :class:`!tuple`. To use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` attribute:" +msgid "" +":class:`!Row` provides indexed and case-insensitive named access to columns, with " +"minimal memory overhead and performance impact over a :class:`!tuple`. To " +"use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` " +"attribute:" msgstr "" +":class:`!Row` دسترسی اندیسی و دسترسی نامی بدون حساسیت به بزرگی و کوچکی حروف به " +"ستون‌ها را با حداقل سربار حافظه و تأثیر بر عملکرد نسبت به یک :class:`!tuple` فراهم " +"می‌کند. برای استفاده از :class:`!Row` به‌عنوان کارخانه‌ی ردیف (row factory)، آن را به " +"ویژگی :attr:`!row_factory` انتساب دهید:" msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" msgstr "" +">>> con = sqlite3.connect(\":memory:\")\n" +">>> con.row_factory = sqlite3.Row" msgid "Queries now return :class:`!Row` objects:" -msgstr "" +msgstr "پرس‌وجوها اکنون اشیای :class:`!Row` را برمی‌گردانند:" msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" @@ -1758,21 +3487,47 @@ msgid "" "6378\n" ">>> con.close()" msgstr "" +">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" +">>> row = res.fetchone()\n" +">>> row.keys()\n" +"['name', 'radius']\n" +">>> row[0] # Access by index.\n" +"'Earth'\n" +">>> row[\"name\"] # Access by name.\n" +"'Earth'\n" +">>> row[\"RADIUS\"] # Column names are case-insensitive.\n" +"6378\n" +">>> con.close()" -msgid "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``." +msgid "" +"The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the above " +"example. In such cases, SQLite returns a single row with columns defined by " +"expressions, e.g. literals, with the given aliases ``expr AS alias``." msgstr "" +"می‌توان بند ``FROM`` را در دستور ``SELECT`` حذف کرد، همان‌طور که در مثال بالا آمده " +"است. در این موارد، SQLite یک ردیف واحد با ستون‌های تعریف‌شده توسط عبارت‌ها، برای مثال " +"مقادیر لفظی، با نام‌های مستعار داده‌شده به صورت ``expr AS alias`` برمی‌گرداند." -msgid "You can create a custom :attr:`~Cursor.row_factory` that returns each row as a :class:`dict`, with column names mapped to values:" +msgid "" +"You can create a custom :attr:`~Cursor.row_factory` that returns each row as " +"a :class:`dict`, with column names mapped to values:" msgstr "" +"شما می‌توانید یک :attr:`~Cursor.row_factory` سفارشی ایجاد کنید که هر ردیف را به‌صورت " +"یک :class:`dict` برمی‌گرداند، به‌طوری که نام ستون‌ها به مقادیر نگاشته شده‌اند:" msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" msgstr "" +"def dict_factory(cursor, row):\n" +" fields = [column[0] for column in cursor.description]\n" +" return {key: value for key, value in zip(fields, row)}" msgid "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" +"با استفاده از آن، پرس‌وجوها اکنون یک :class:`!dict` به‌جای یک :class:`!tuple` " +"برمی‌گردانند:" msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" @@ -1782,9 +3537,15 @@ msgid "" "{'a': 1, 'b': 2}\n" ">>> con.close()" msgstr "" +">>> con = sqlite3.connect(\":memory:\")\n" +">>> con.row_factory = dict_factory\n" +">>> for row in con.execute(\"SELECT 1 AS a, 2 AS b\"):\n" +"... print(row)\n" +"{'a': 1, 'b': 2}\n" +">>> con.close()" msgid "The following row factory returns a :term:`named tuple`:" -msgstr "" +msgstr "کارخانه ردیف (row factory) زیر یک :term:`named tuple` برمی‌گرداند:" msgid "" "from collections import namedtuple\n" @@ -1794,9 +3555,15 @@ msgid "" " cls = namedtuple(\"Row\", fields)\n" " return cls._make(row)" msgstr "" +"from collections import namedtuple\n" +"\n" +"def namedtuple_factory(cursor, row):\n" +" fields = [column[0] for column in cursor.description]\n" +" cls = namedtuple(\"Row\", fields)\n" +" return cls._make(row)" msgid ":func:`!namedtuple_factory` can be used as follows:" -msgstr "" +msgstr "می‌توان از :func:`!namedtuple_factory` به‌صورت زیر استفاده کرد:" msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" @@ -1811,99 +3578,248 @@ msgid "" "2\n" ">>> con.close()" msgstr "" +">>> con = sqlite3.connect(\":memory:\")\n" +">>> con.row_factory = namedtuple_factory\n" +">>> cur = con.execute(\"SELECT 1 AS a, 2 AS b\")\n" +">>> row = cur.fetchone()\n" +">>> row\n" +"Row(a=1, b=2)\n" +">>> row[0] # Indexed access.\n" +"1\n" +">>> row.b # Attribute access.\n" +"2\n" +">>> con.close()" -msgid "With some adjustments, the above recipe can be adapted to use a :class:`~dataclasses.dataclass`, or any other custom class, instead of a :class:`~collections.namedtuple`." +msgid "" +"With some adjustments, the above recipe can be adapted to use " +"a :class:`~dataclasses.dataclass`, or any other custom class, instead of " +"a :class:`~collections.namedtuple`." msgstr "" +"با برخی تنظیمات، می‌توان دستور بالا را برای استفاده از " +"یک :class:`~dataclasses.dataclass` یا هر کلاس سفارشی دیگری، به‌جای " +"یک :class:`~collections.namedtuple` تطبیق داد." msgid "How to handle non-UTF-8 text encodings" -msgstr "" +msgstr "نحوه‌ی مدیریت کدگذاری‌های متن غیر UTF-8" -msgid "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might fail for other encodings and invalid UTF-8. You can use a custom :attr:`~Connection.text_factory` to handle such cases." +msgid "" +"By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with the " +"``TEXT`` data type. This works well for UTF-8 encoded text, but it might fail for " +"other encodings and invalid UTF-8. You can use a " +"custom :attr:`~Connection.text_factory` to handle such cases." msgstr "" +"به‌طور پیش‌فرض، :mod:`!sqlite3` از :class:`str` برای تطبیق مقادیر SQLite با نوع داده " +"``TEXT`` استفاده می‌کند. این روش برای متن‌های کدگذاری‌شده با UTF-8 به‌خوبی کار می‌کند، " +"اما ممکن است برای کدگذاری‌های دیگر و UTF-8 نامعتبر شکست بخورد. می‌توانید از " +"یک :attr:`~Connection.text_factory` سفارشی برای رسیدگی به چنین مواردی استفاده کنید." -msgid "Because of SQLite's `flexible typing`_, it is not uncommon to encounter table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or even arbitrary data. To demonstrate, let's assume we have a database with ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English dictionary entries. Assuming we now have a :class:`Connection` instance :py:data:`!con` connected to this database, we can decode the Latin-2 encoded text using this :attr:`~Connection.text_factory`:" -msgstr "" +msgid "" +"Because of SQLite's `flexible typing`_, it is not uncommon to encounter table " +"columns with the ``TEXT`` data type containing non-UTF-8 encodings, or even " +"arbitrary data. To demonstrate, let's assume we have a database with ISO-8859-2 " +"(Latin-2) encoded text, for example a table of Czech-English dictionary entries. " +"Assuming we now have a :class:`Connection` instance :py:data:`!con` connected to " +"this database, we can decode the Latin-2 encoded text using " +"this :attr:`~Connection.text_factory`:" +msgstr "" +"به دلیل `flexible typing`_ در SQLite، مواجه شدن با ستون‌های جدول با نوع داده " +"``TEXT`` که شامل کدگذاری‌های غیر UTF-8 یا حتی داده‌های دلخواه هستند، چندان غیرمعمول " +"نیست. برای نمایش، فرض کنیم پایگاه داده‌ای با متن کدگذاری‌شده به‌صورت ISO-8859-2 " +"(Latin-2) داریم، برای مثال جدولی از ورودی‌های فرهنگ لغت چکی-انگلیسی. با فرض اینکه " +"اکنون یک نمونه :class:`Connection` به نام :py:data:`!con` داریم که به این پایگاه " +"داده متصل است، می‌توانیم متن کدگذاری‌شده با Latin-2 را با استفاده از " +"این :attr:`~Connection.text_factory` کدگشایی کنیم:" msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -msgstr "" +msgstr "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -msgid "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you can use the following technique, borrowed from the :ref:`unicode-howto`:" +msgid "" +"For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you can " +"use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" +"برای UTF-8 نامعتبر یا داده‌های دلخواه ذخیره‌شده در ستون‌های جدول ``TEXT``، می‌توانید " +"از روش زیر استفاده کنید، که از :ref:`unicode-howto` وام گرفته شده است:" msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -msgstr "" +msgstr "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -msgid "The :mod:`!sqlite3` module API does not support strings containing surrogates." +msgid "" +"The :mod:`!sqlite3` module API does not support strings containing surrogates." msgstr "" +"API ماژول :mod:`!sqlite3` از رشته‌های حاوی نویسه‌های جانشین (surrogates) پشتیبانی " +"نمی‌کند." msgid ":ref:`unicode-howto`" -msgstr "" +msgstr ":ref:`unicode-howto`" msgid "Explanation" -msgstr "" +msgstr "توضیح" msgid "Transaction control" -msgstr "" +msgstr "کنترل تراکنش" -msgid ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how database transactions are opened and closed. :ref:`sqlite3-transaction-control-autocommit` is recommended, while :ref:`sqlite3-transaction-control-isolation-level` retains the pre-Python 3.12 behaviour." +msgid "" +":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " +"database transactions are opened and closed. :ref:`sqlite3-transaction-control-" +"autocommit` is recommended, while :ref:`sqlite3-transaction-control-isolation-" +"level` retains the pre-Python 3.12 behaviour." msgstr "" +":mod:`!sqlite3` روش‌های متعددی برای کنترل این‌که آیا، چه زمانی و چگونه تراکنش‌های " +"پایگاه داده باز و بسته می‌شوند، ارائه می‌دهد. :ref:`sqlite3-transaction-control-" +"autocommit` توصیه می‌شود، در حالی که :ref:`sqlite3-transaction-control-isolation-" +"level` رفتار پیش از Python 3.12 را حفظ می‌کند." msgid "Transaction control via the ``autocommit`` attribute" -msgstr "" +msgstr "کنترل تراکنش از طریق ویژگی ``autocommit``" -msgid "The recommended way of controlling transaction behaviour is through the :attr:`Connection.autocommit` attribute, which should preferably be set using the *autocommit* parameter of :func:`connect`." +msgid "" +"The recommended way of controlling transaction behaviour is through " +"the :attr:`Connection.autocommit` attribute, which should preferably be set using " +"the *autocommit* parameter of :func:`connect`." msgstr "" +"روش توصیه‌شده برای کنترل رفتار تراکنش، از طریق ویژگی :attr:`Connection.autocommit` " +"است که بهتر است با پارامتر *autocommit* در :func:`connect` تنظیم شود." -msgid "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-compliant transaction control. This means:" +msgid "" +"It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" +"compliant transaction control. This means:" msgstr "" +"پیشنهاد می‌شود *autocommit* را روی ``False`` تنظیم کنید، که به معنای کنترل تراکنش " +"مطابق :pep:`249` است. این یعنی:" -msgid ":mod:`!sqlite3` ensures that a transaction is always open, so :func:`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will implicitly open a new transaction (immediately after closing the pending one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements when opening transactions." -msgstr "" +msgid "" +":mod:`!sqlite3` ensures that a transaction is always open, " +"so :func:`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` " +"will implicitly open a new transaction (immediately after closing the pending one, " +"for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements when " +"opening transactions." +msgstr "" +":mod:`!sqlite3` تضمین می‌کند که یک تراکنش همیشه باز است، " +"بنابراین :func:`connect`، :meth:`Connection.commit` و :meth:`Connection.rollback` " +"به‌طور ضمنی یک تراکنش جدید باز می‌کنند (بلافاصله پس از بستن تراکنش در انتظار، برای " +"دو مورد آخر). :mod:`!sqlite3` هنگام باز کردن تراکنش‌ها از دستورات ``BEGIN " +"DEFERRED`` استفاده می‌کند." msgid "Transactions should be committed explicitly using :meth:`!commit`." -msgstr "" +msgstr "تراکنش‌ها باید به‌صورت صریح با استفاده از :meth:`!commit` کامیت شوند." msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." -msgstr "" +msgstr "تراکنش‌ها باید به‌صراحت با استفاده از :meth:`!rollback` بازگردانی شوند." -msgid "An implicit rollback is performed if the database is :meth:`~Connection.close`-ed with pending changes." +msgid "" +"An implicit rollback is performed if the database is :meth:`~Connection.close`-ed " +"with pending changes." msgstr "" +"اگر پایگاه داده در حالی که تغییرات در انتظار دارد با :meth:`~Connection.close` " +"بسته شود، یک بازگردانی (rollback) ضمنی انجام می‌شود." -msgid "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection.in_transaction` to query the low-level SQLite autocommit mode." -msgstr "" +msgid "" +"Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " +"mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no effect. " +"Note that SQLite's autocommit mode is distinct from the :pep:`249`-" +"compliant :attr:`Connection.autocommit` attribute; " +"use :attr:`Connection.in_transaction` to query the low-level SQLite autocommit " +"mode." +msgstr "" +"برای فعال‌سازی `autocommit mode`_ در SQLite، *autocommit* را روی ``True`` تنظیم " +"کنید. در این حالت، :meth:`Connection.commit` و :meth:`Connection.rollback` هیچ " +"اثری ندارند. توجه داشته باشید که حالت autocommit در SQLite از " +"ویژگی :attr:`Connection.autocommit` سازگار با :pep:`249` متمایز است؛ برای پرس‌وجوی " +"حالت autocommit سطح پایین SQLite از :attr:`Connection.in_transaction` استفاده کنید." -msgid "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction control behaviour to the :attr:`Connection.isolation_level` attribute. See :ref:`sqlite3-transaction-control-isolation-level` for more information." +msgid "" +"Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " +"control behaviour to the :attr:`Connection.isolation_level` attribute. " +"See :ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" +"برای اینکه رفتار کنترل تراکنش به ویژگی :attr:`Connection.isolation_level` واگذار " +"شود، *autocommit* را روی :data:`LEGACY_TRANSACTION_CONTROL` تنظیم کنید. برای " +"اطلاعات بیشتر :ref:`sqlite3-transaction-control-isolation-level` را ببینید." msgid "Transaction control via the ``isolation_level`` attribute" -msgstr "" +msgstr "کنترل تراکنش از طریق ویژگی ``isolation_level``" -msgid "The recommended way of controlling transactions is via the :attr:`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-autocommit`." +msgid "" +"The recommended way of controlling transactions is via " +"the :attr:`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-" +"control-autocommit`." msgstr "" +"روش توصیه‌شده برای کنترل تراکنش‌ها، استفاده از ویژگی :attr:`~Connection.autocommit` " +"است. :ref:`sqlite3-transaction-control-autocommit` را ببینید." -msgid "If :attr:`Connection.autocommit` is set to :data:`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is controlled using the :attr:`Connection.isolation_level` attribute. Otherwise, :attr:`!isolation_level` has no effect." +msgid "" +"If :attr:`Connection.autocommit` is set to :data:`LEGACY_TRANSACTION_CONTROL` (the " +"default), transaction behaviour is controlled using " +"the :attr:`Connection.isolation_level` attribute. Otherwise, :attr:`!" +"isolation_level` has no effect." msgstr "" +"اگر :attr:`Connection.autocommit` روی :data:`LEGACY_TRANSACTION_CONTROL` (پیش‌فرض) " +"تنظیم شده باشد، رفتار تراکنش با استفاده از " +"ویژگی :attr:`Connection.isolation_level` کنترل می‌شود. در غیر این صورت، :attr:`!" +"isolation_level` اثری ندارد." -msgid "If the connection attribute :attr:`~Connection.isolation_level` is not ``None``, new transactions are implicitly opened before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements; for other statements, no implicit transaction handling is performed. Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to respectively commit and roll back pending transactions. You can choose the underlying `SQLite transaction behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` attribute." -msgstr "" +msgid "" +"If the connection attribute :attr:`~Connection.isolation_level` is not ``None``, " +"new transactions are implicitly opened before :meth:`~Cursor.execute` " +"and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, ``DELETE``, or " +"``REPLACE`` statements; for other statements, no implicit transaction handling is " +"performed. Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` " +"methods to respectively commit and roll back pending transactions. You can choose " +"the underlying `SQLite transaction behaviour`_ — that is, whether and what type of " +"``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via " +"the :attr:`~Connection.isolation_level` attribute." +msgstr "" +"اگر ویژگی اتصال :attr:`~Connection.isolation_level` برابر ``None`` نباشد، پیش از " +"اجرای دستورات ``INSERT``، ``UPDATE``، ``DELETE`` یا ``REPLACE`` " +"توسط :meth:`~Cursor.execute` و :meth:`~Cursor.executemany`، تراکنش‌های جدید به‌طور " +"ضمنی باز می‌شوند؛ برای سایر دستورات، هیچ مدیریت تراکنش ضمنی‌ای انجام نمی‌شود. از " +"متدهای :meth:`~Connection.commit` و :meth:`~Connection.rollback` به‌ترتیب برای ثبت " +"(commit) و بازگرداندن (rollback) تراکنش‌های در انتظار استفاده کنید. شما می‌توانید " +"رفتار زیربنایی `SQLite transaction behaviour`_ — یعنی اینکه آیا و چه نوع دستورات " +"``BEGIN`` توسط :mod:`!sqlite3` به‌طور ضمنی اجرا می‌شوند – را از طریق " +"ویژگی :attr:`~Connection.isolation_level` انتخاب کنید." -msgid "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions are implicitly opened at all. This leaves the underlying SQLite library in `autocommit mode`_, but also allows the user to perform their own transaction handling using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the :attr:`~Connection.in_transaction` attribute." -msgstr "" +msgid "" +"If :attr:`~Connection.isolation_level` is set to ``None``, no transactions are " +"implicitly opened at all. This leaves the underlying SQLite library in `autocommit " +"mode`_, but also allows the user to perform their own transaction handling using " +"explicit SQL statements. The underlying SQLite library autocommit mode can be " +"queried using the :attr:`~Connection.in_transaction` attribute." +msgstr "" +"اگر :attr:`~Connection.isolation_level` روی ``None`` تنظیم شده باشد، اصلاً هیچ " +"تراکنشی به‌طور ضمنی باز نمی‌شود. این امر باعث می‌شود کتابخانه SQLite زیرین در " +"`autocommit mode`_ باقی بماند، اما همچنین به کاربر اجازه می‌دهد مدیریت تراکنش خود " +"را با استفاده از دستورات صریح SQL انجام دهد. حالت کامیت خودکار کتابخانه SQLite " +"زیرین را می‌توان از طریق ویژگی :attr:`~Connection.in_transaction` پرس‌وجو کرد." -msgid "The :meth:`~Cursor.executescript` method implicitly commits any pending transaction before execution of the given SQL script, regardless of the value of :attr:`~Connection.isolation_level`." +msgid "" +"The :meth:`~Cursor.executescript` method implicitly commits any pending " +"transaction before execution of the given SQL script, regardless of the value " +"of :attr:`~Connection.isolation_level`." msgstr "" +"متد :meth:`~Cursor.executescript` به‌طور ضمنی هر تراکنش در حال انتظاری را پیش از " +"اجرای اسکریپت SQL داده‌شده، صرف‌نظر از مقدار :attr:`~Connection.isolation_level`، " +"ثبت (commit) می‌کند." -msgid ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer the case." +msgid "" +":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " +"statements. This is no longer the case." msgstr "" +":mod:`!sqlite3` پیش‌تر یک تراکنش باز را پیش از دستورات DDL به‌صورت ضمنی ثبت (commit) " +"می‌کرد. این موضوع دیگر صدق نمی‌کند." -msgid "The recommended way of controlling transactions is now via the :attr:`~Connection.autocommit` attribute." +msgid "" +"The recommended way of controlling transactions is now via " +"the :attr:`~Connection.autocommit` attribute." msgstr "" +"روش توصیه‌شده برای کنترل تراکنش‌ها اکنون از طریق " +"ویژگی :attr:`~Connection.autocommit` است." msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" msgid "in SQL statements" -msgstr "" +msgstr "در دستورات SQL" msgid ": (colon)" -msgstr "" +msgstr ": (دونقطه)" diff --git a/library/ssl.po b/library/ssl.po index d393fdb6a..d063b78c6 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" +"PO-Revision-Date: 2026-08-28 11:34+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -24,63 +24,141 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!ssl` --- TLS/SSL wrapper for socket objects" -msgstr "" +msgstr ":mod:`!ssl` --- پوششی TLS/SSL برای اشیای سوکت" msgid "**Source code:** :source:`Lib/ssl.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/ssl.py`" -msgid "This module provides access to Transport Layer Security (often known as \"Secure Sockets Layer\") encryption and peer authentication facilities for network sockets, both client-side and server-side. This module uses the OpenSSL library." +msgid "" +"This module provides access to Transport Layer Security (often known as " +"\"Secure Sockets Layer\") encryption and peer authentication facilities for " +"network sockets, both client-side and server-side. This module uses the " +"OpenSSL library." msgstr "" +"این ماژول دسترسی به امکانات رمزنگاری و احراز هویت همتا در امنیت لایه انتقال " +"(Transport Layer Security، که اغلب با نام «Secure Sockets Layer» شناخته " +"می‌شود) را برای سوکت‌های شبکه، چه در سمت کلاینت و چه در سمت سرور، فراهم " +"می‌کند. این ماژول از کتابخانه OpenSSL استفاده می‌کند." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of " +"CPython, look for documentation from your distributor (that is, whoever " +"provided Python to you). If you are the distributor, see :ref:`optional-" +"module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر در نسخه CPython شما " +"وجود ندارد، به مستندات توزیع‌کننده خود (یعنی کسی که پایتون را در اختیار شما " +"قرار داده است) مراجعه کنید. اگر شما توزیع‌کننده هستید، :ref:`optional-module-" +"requirements` را ببینید." -msgid "Some behavior may be platform dependent, since calls are made to the operating system socket APIs. The installed version of OpenSSL may also cause variations in behavior. For example, TLSv1.3 comes with OpenSSL version 1.1.1." +msgid "" +"Some behavior may be platform dependent, since calls are made to the " +"operating system socket APIs. The installed version of OpenSSL may also " +"cause variations in behavior. For example, TLSv1.3 comes with OpenSSL " +"version 1.1.1." msgstr "" +"برخی رفتارها ممکن است وابسته به پلتفرم باشند، زیرا فراخوانی‌هایی به APIهای " +"سوکت سیستم‌عامل انجام می‌شود. نسخه نصب‌شده OpenSSL نیز ممکن است باعث تغییراتی " +"در رفتار شود. برای مثال، TLSv1.3 همراه با نسخه 1.1.1 از OpenSSL ارائه می‌شود." -msgid "Don't use this module without reading the :ref:`ssl-security`. Doing so may lead to a false sense of security, as the default settings of the ssl module are not necessarily appropriate for your application." +msgid "" +"Don't use this module without reading the :ref:`ssl-security`. Doing so " +"may lead to a false sense of security, as the default settings of the ssl " +"module are not necessarily appropriate for your application." msgstr "" +"از این ماژول بدون خواندن :ref:`ssl-security` استفاده نکنید. این کار ممکن " +"است باعث ایجاد احساس امنیت کاذب شود، زیرا تنظیمات پیش‌فرض ماژول ssl لزوماً " +"مناسب برنامه شما نیستند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. " +"See :ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات " +"بیشتر :ref:`wasm-availability` را ببینید." -msgid "This section documents the objects and functions in the ``ssl`` module; for more general information about TLS, SSL, and certificates, the reader is referred to the documents in the \"See Also\" section at the bottom." +msgid "" +"This section documents the objects and functions in the ``ssl`` module; for " +"more general information about TLS, SSL, and certificates, the reader is " +"referred to the documents in the \"See Also\" section at the bottom." msgstr "" +"این بخش، اشیاء و توابع ماژول ``ssl`` را مستند می‌کند؛ برای اطلاعات کلی‌تر " +"درباره TLS، SSL و گواهی‌ها، خواننده به اسناد بخش «See Also» در پایین " +"ارجاع داده می‌شود." -msgid "This module provides a class, :class:`ssl.SSLSocket`, which is derived from the :class:`socket.socket` type, and provides a socket-like wrapper that also encrypts and decrypts the data going over the socket with SSL. It supports additional methods such as :meth:`getpeercert`, which retrieves the certificate of the other side of the connection, :meth:`cipher`, which retrieves the cipher being used for the secure connection or :meth:`get_verified_chain`, :meth:`get_unverified_chain` which retrieves certificate chain." -msgstr "" +msgid "" +"This module provides a class, :class:`ssl.SSLSocket`, which is derived from " +"the :class:`socket.socket` type, and provides a socket-like wrapper that " +"also encrypts and decrypts the data going over the socket with SSL. It " +"supports additional methods such as :meth:`getpeercert`, which retrieves " +"the certificate of the other side of the connection, :meth:`cipher`, which " +"retrieves the cipher being used for the secure connection " +"or :meth:`get_verified_chain`, :meth:`get_unverified_chain` which retrieves " +"certificate chain." +msgstr "" +"این ماژول یک کلاس، :class:`ssl.SSLSocket`، ارائه می‌دهد که از " +"نوع :class:`socket.socket` مشتق شده است و پوششی شبیه به سوکت فراهم می‌کند که " +"همچنین داده‌های عبوری از سوکت را با SSL رمزگذاری و رمزگشایی می‌کند. این کلاس " +"از متدهای اضافی نیز پشتیبانی می‌کند، مانند :meth:`getpeercert` که گواهی‌ی " +"طرف دیگر اتصال را بازیابی می‌کند، :meth:`cipher` که رمز مورد استفاده برای " +"اتصال امن را بازیابی می‌کند، یا :meth:`get_verified_chain` " +"و :meth:`get_unverified_chain` که زنجیره‌ی گواهی را بازیابی می‌کنند." -msgid "For more sophisticated applications, the :class:`ssl.SSLContext` class helps manage settings and certificates, which can then be inherited by SSL sockets created through the :meth:`SSLContext.wrap_socket` method." +msgid "" +"For more sophisticated applications, the :class:`ssl.SSLContext` class " +"helps manage settings and certificates, which can then be inherited by SSL " +"sockets created through the :meth:`SSLContext.wrap_socket` method." msgstr "" +"برای برنامه‌های کاربردی پیشرفته‌تر، کلاس :class:`ssl.SSLContext` به مدیریت " +"تنظیمات و گواهی‌نامه‌ها کمک می‌کند، که سپس می‌توانند توسط سوکت‌های SSL ایجادشده " +"از طریق متد :meth:`SSLContext.wrap_socket` به ارث برده شوند." msgid "Updated to support linking with OpenSSL 1.1.0" -msgstr "" +msgstr "به‌روزرسانی شد تا از پیوند دادن با OpenSSL 1.1.0 پشتیبانی کند" -msgid "OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In the future the ssl module will require at least OpenSSL 1.0.2 or 1.1.0." +msgid "" +"OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In " +"the future the ssl module will require at least OpenSSL 1.0.2 or 1.1.0." msgstr "" +"OpenSSL 0.9.8، 1.0.0 و 1.0.1 منسوخ شده‌اند و دیگر پشتیبانی نمی‌شوند. در " +"آینده، ماژول ssl حداقل به OpenSSL 1.0.2 یا 1.1.0 نیاز خواهد داشت." -msgid ":pep:`644` has been implemented. The ssl module requires OpenSSL 1.1.1 or newer." +msgid "" +":pep:`644` has been implemented. The ssl module requires OpenSSL 1.1.1 or " +"newer." msgstr "" +":pep:`644` پیاده‌سازی شده است. ماژول ssl به OpenSSL 1.1.1 یا جدیدتر نیاز " +"دارد." -msgid "Use of deprecated constants and functions result in deprecation warnings." -msgstr "" +msgid "" +"Use of deprecated constants and functions result in deprecation warnings." +msgstr "استفاده از ثابت‌ها و توابع منسوخ‌شده منجر به هشدارهای منسوخ‌شدن می‌شود." msgid "Functions, constants, and exceptions" -msgstr "" +msgstr "توابع، ثابت‌ها و استثناها" msgid "Socket creation" -msgstr "" +msgstr "ایجاد سوکت" -msgid "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext.wrap_socket` method. The helper function :func:`create_default_context` returns a new context with secure default settings." +msgid "" +"Instances of :class:`SSLSocket` must be created using " +"the :meth:`SSLContext.wrap_socket` method. The helper " +"function :func:`create_default_context` returns a new context with secure " +"default settings." msgstr "" +"نمونه‌های :class:`SSLSocket` باید با استفاده از " +"متد :meth:`SSLContext.wrap_socket` ایجاد شوند. تابع " +"کمکی :func:`create_default_context` زمینه‌ای جدید با تنظیمات پیش‌فرض امن " +"برمی‌گرداند." msgid "Client socket example with default context and IPv4/IPv6 dual stack::" -msgstr "" +msgstr "مثال سوکت کلاینت با زمینه پیش‌فرض و پشته دوگانه IPv4/IPv6::" msgid "" "import socket\n" @@ -93,9 +171,18 @@ msgid "" " with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n" " print(ssock.version())" msgstr "" +"import socket\n" +"import ssl\n" +"\n" +"hostname = 'www.python.org'\n" +"context = ssl.create_default_context()\n" +"\n" +"with socket.create_connection((hostname, 443)) as sock:\n" +" with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n" +" print(ssock.version())" msgid "Client socket example with custom context and IPv4::" -msgstr "" +msgstr "مثال سوکت کلاینت با زمینه سفارشی و IPv4::" msgid "" "hostname = 'www.python.org'\n" @@ -107,9 +194,17 @@ msgid "" " with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n" " print(ssock.version())" msgstr "" +"hostname = 'www.python.org'\n" +"# PROTOCOL_TLS_CLIENT requires valid cert chain and hostname\n" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" +"context.load_verify_locations('path/to/cabundle.pem')\n" +"\n" +"with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock:\n" +" with context.wrap_socket(sock, server_hostname=hostname) as ssock:\n" +" print(ssock.version())" msgid "Server socket example listening on localhost IPv4::" -msgstr "" +msgstr "مثال سوکت سرور در حال گوش‌دادن به localhost IPv4::" msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" @@ -122,142 +217,352 @@ msgid "" " conn, addr = ssock.accept()\n" " ..." msgstr "" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" +"context.load_cert_chain('/path/to/certchain.pem', '/path/to/private.key')\n" +"\n" +"with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock:\n" +" sock.bind(('127.0.0.1', 8443))\n" +" sock.listen(5)\n" +" with context.wrap_socket(sock, server_side=True) as ssock:\n" +" conn, addr = ssock.accept()\n" +" ..." msgid "Context creation" -msgstr "" +msgstr "ایجاد زمینه" -msgid "A convenience function helps create :class:`SSLContext` objects for common purposes." +msgid "" +"A convenience function helps create :class:`SSLContext` objects for common " +"purposes." msgstr "" +"یک تابع راحتی به ایجاد اشیاء :class:`SSLContext` برای اهداف رایج کمک می‌کند." -msgid "Return a new :class:`SSLContext` object with default settings for the given *purpose*. The settings are chosen by the :mod:`!ssl` module, and usually represent a higher security level than when calling the :class:`SSLContext` constructor directly." +msgid "" +"Return a new :class:`SSLContext` object with default settings for the given " +"*purpose*. The settings are chosen by the :mod:`!ssl` module, and usually " +"represent a higher security level than when calling the :class:`SSLContext` " +"constructor directly." msgstr "" +"یک شیء :class:`SSLContext` جدید با تنظیمات پیش‌فرض برای *منظور* داده‌شده " +"برمی‌گرداند. این تنظیمات توسط ماژول :mod:`!ssl` انتخاب می‌شوند و معمولاً " +"نشان‌دهنده‌ی سطح امنیتی بالاتری نسبت به فراخوانی مستقیم " +"سازنده‌ی :class:`SSLContext` هستند." -msgid "*cafile*, *capath*, *cadata* represent optional CA certificates to trust for certificate verification, as in :meth:`SSLContext.load_verify_locations`. If all three are :const:`None`, this function can choose to trust the system's default CA certificates instead." -msgstr "" +msgid "" +"*cafile*, *capath*, *cadata* represent optional CA certificates to trust " +"for certificate verification, as " +"in :meth:`SSLContext.load_verify_locations`. If all three " +"are :const:`None`, this function can choose to trust the system's default " +"CA certificates instead." +msgstr "" +"*cafile*، *capath* و *cadata* گواهی‌های CA اختیاری قابل اعتماد برای تأیید " +"گواهی را نشان می‌دهند، همان‌طور که " +"در :meth:`SSLContext.load_verify_locations` آمده است. اگر هر " +"سه :const:`None` باشند، این تابع می‌تواند به‌جای آن، اعتماد به گواهی‌های CA " +"پیش‌فرض سیستم را انتخاب کند." -msgid "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with high encryption cipher suites without RC4 and without unauthenticated cipher suites. Passing :const:`~Purpose.SERVER_AUTH` as *purpose* sets :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA certificates (when at least one of *cafile*, *capath* or *cadata* is given) or uses :meth:`SSLContext.load_default_certs` to load default CA certificates." -msgstr "" +msgid "" +"The settings are: :data:`PROTOCOL_TLS_CLIENT` " +"or :data:`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, " +"and :data:`OP_NO_SSLv3` with high encryption cipher suites without RC4 and " +"without unauthenticated cipher suites. " +"Passing :const:`~Purpose.SERVER_AUTH` as *purpose* " +"sets :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either " +"loads CA certificates (when at least one of *cafile*, *capath* or *cadata* " +"is given) or uses :meth:`SSLContext.load_default_certs` to load default CA " +"certificates." +msgstr "" +"تنظیمات عبارتند از: :data:`PROTOCOL_TLS_CLIENT` " +"یا :data:`PROTOCOL_TLS_SERVER`، :data:`OP_NO_SSLv2` و :data:`OP_NO_SSLv3` " +"به همراه مجموعه‌های رمزارزی با رمزنگاری قوی، بدون RC4 و بدون مجموعه‌های " +"رمزارزی بدون احراز هویت. ارسال :const:`~Purpose.SERVER_AUTH` به‌عنوان " +"*purpose*، مقدار :data:`~SSLContext.verify_mode` را " +"روی :data:`CERT_REQUIRED` تنظیم می‌کند و یا گواهی‌های CA را بارگذاری می‌کند " +"(هنگامی که حداقل یکی از *cafile*، *capath* یا *cadata* داده شود) یا " +"از :meth:`SSLContext.load_default_certs` برای بارگذاری گواهی‌های CA پیش‌فرض " +"استفاده می‌کند." -msgid "When :attr:`~SSLContext.keylog_filename` is supported and the environment variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` enables key logging." +msgid "" +"When :attr:`~SSLContext.keylog_filename` is supported and the environment " +"variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " +"enables key logging." msgstr "" +"هرگاه از :attr:`~SSLContext.keylog_filename` پشتیبانی شود و متغیر " +"محیطی :envvar:`SSLKEYLOGFILE` تنظیم‌شده باشد، :func:`create_default_context` " +"ثبت کلید (key logging) را فعال می‌کند." -msgid "The default settings for this context include :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. These make the underlying OpenSSL implementation behave more like a conforming implementation of :rfc:`5280`, in exchange for a small amount of incompatibility with older X.509 certificates." +msgid "" +"The default settings for this context " +"include :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. " +"These make the underlying OpenSSL implementation behave more like a " +"conforming implementation of :rfc:`5280`, in exchange for a small amount of " +"incompatibility with older X.509 certificates." msgstr "" +"تنظیمات پیش‌فرض برای این زمینه شامل :data:`VERIFY_X509_PARTIAL_CHAIN` " +"و :data:`VERIFY_X509_STRICT` است. این تنظیمات باعث می‌شود پیاده‌سازی زیربنایی " +"OpenSSL رفتاری بیشتر شبیه به یک پیاده‌سازی مطابق با :rfc:`5280` داشته باشد، " +"در ازای مقدار کمی ناسازگاری با گواهی‌های قدیمی‌تر X.509." -msgid "The protocol, options, cipher and other settings may change to more restrictive values anytime without prior deprecation. The values represent a fair balance between compatibility and security." +msgid "" +"The protocol, options, cipher and other settings may change to more " +"restrictive values anytime without prior deprecation. The values represent " +"a fair balance between compatibility and security." msgstr "" +"ممکن است پروتکل، گزینه‌ها، رمز (cipher) و سایر تنظیمات در هر زمان بدون از " +"رده خارج شدن پیشین به مقادیر سخت‌گیرانه‌تر تغییر یابند. این مقادیر بیانگر " +"تعادل منصفانه‌ای بین سازگاری و امنیت هستند." -msgid "If your application needs specific settings, you should create a :class:`SSLContext` and apply the settings yourself." +msgid "" +"If your application needs specific settings, you should create " +"a :class:`SSLContext` and apply the settings yourself." msgstr "" +"اگر برنامه شما به تنظیمات خاصی نیاز دارد، باید یک :class:`SSLContext` ایجاد " +"کنید و خودتان تنظیمات را اعمال کنید." -msgid "If you find that when certain older clients or servers attempt to connect with a :class:`SSLContext` created by this function that they get an error stating \"Protocol or cipher suite mismatch\", it may be that they only support SSL3.0 which this function excludes using the :data:`OP_NO_SSLv3`. SSL3.0 is widely considered to be `completely broken `_. If you still wish to continue to use this function but still allow SSL 3.0 connections you can re-enable them using::" -msgstr "" +msgid "" +"If you find that when certain older clients or servers attempt to connect " +"with a :class:`SSLContext` created by this function that they get an error " +"stating \"Protocol or cipher suite mismatch\", it may be that they only " +"support SSL3.0 which this function excludes using the :data:`OP_NO_SSLv3`. " +"SSL3.0 is widely considered to be `completely broken `_. If you still wish to continue to use this " +"function but still allow SSL 3.0 connections you can re-enable them using::" +msgstr "" +"اگر متوجه شدید که هنگام تلاش برخی کلاینت‌ها یا سرورهای قدیمی برای اتصال با " +"یک :class:`SSLContext` ایجادشده توسط این تابع، آن‌ها خطایی با مضمون " +"«Protocol or cipher suite mismatch» دریافت می‌کنند، ممکن است فقط از SSL3.0 " +"پشتیبانی کنند، که این تابع با استفاده از :data:`OP_NO_SSLv3` آن را غیرفعال " +"می‌کند. SSL3.0 به‌طور گسترده‌ای `کاملاً ناامن `_ تلقی می‌شود. اگر همچنان می‌خواهید به استفاده از این تابع ادامه دهید " +"و در عین حال اتصال‌های SSL 3.0 را مجاز بدانید، می‌توانید آن‌ها را دوباره فعال " +"کنید، با استفاده از::" msgid "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" msgstr "" +"ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" +"ctx.options &= ~ssl.OP_NO_SSLv3" -msgid "This context enables :data:`VERIFY_X509_STRICT` by default, which may reject pre-:rfc:`5280` or malformed certificates that the underlying OpenSSL implementation otherwise would accept. While disabling this is not recommended, you can do so using::" +msgid "" +"This context enables :data:`VERIFY_X509_STRICT` by default, which may " +"reject pre-:rfc:`5280` or malformed certificates that the underlying " +"OpenSSL implementation otherwise would accept. While disabling this is not " +"recommended, you can do so using::" msgstr "" +"این زمینه به‌طور پیش‌فرض :data:`VERIFY_X509_STRICT` را فعال می‌کند، که ممکن " +"است گواهی‌های پیش از :rfc:`5280` یا بدشکل را، که پیاده‌سازی OpenSSL زیرین " +"در غیر این صورت آن‌ها را می‌پذیرفت، رد کند. اگرچه غیرفعال کردن این گزینه " +"توصیه نمی‌شود، می‌توانید این کار را با استفاده از روش زیر انجام دهید::" msgid "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgstr "" +"ctx = ssl.create_default_context()\n" +"ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgid "RC4 was dropped from the default cipher string." -msgstr "" +msgstr "RC4 از رشته‌ی cipher پیش‌فرض حذف شد." msgid "ChaCha20/Poly1305 was added to the default cipher string." msgstr "" +"ChaCha20/Poly1305 به رشته‌ی رمزارز پیش‌فرض (default cipher string) افزوده شد." msgid "3DES was dropped from the default cipher string." -msgstr "" +msgstr "3DES از رشته‌ی cipher پیش‌فرض حذف شد." msgid "Support for key logging to :envvar:`SSLKEYLOGFILE` was added." msgstr "" +"پشتیبانی از گزارش‌برداری کلید (key logging) در :envvar:`SSLKEYLOGFILE` اضافه " +"شد." -msgid "The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." +msgid "" +"The context now uses :data:`PROTOCOL_TLS_CLIENT` " +"or :data:`PROTOCOL_TLS_SERVER` protocol instead of " +"generic :data:`PROTOCOL_TLS`." msgstr "" +"زمینه اکنون از پروتکل :data:`PROTOCOL_TLS_CLIENT` " +"یا :data:`PROTOCOL_TLS_SERVER` به‌جای پروتکل عام :data:`PROTOCOL_TLS` " +"استفاده می‌کند." -msgid "The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT` in its default verify flags." +msgid "" +"The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` " +"and :data:`VERIFY_X509_STRICT` in its default verify flags." msgstr "" +"این زمینه اکنون از :data:`VERIFY_X509_PARTIAL_CHAIN` " +"و :data:`VERIFY_X509_STRICT` در پرچم‌های تأیید پیش‌فرض خود استفاده می‌کند." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "Raised to signal an error from the underlying SSL implementation (currently provided by the OpenSSL library). This signifies some problem in the higher-level encryption and authentication layer that's superimposed on the underlying network connection. This error is a subtype of :exc:`OSError`. The error code and message of :exc:`SSLError` instances are provided by the OpenSSL library." -msgstr "" +msgid "" +"Raised to signal an error from the underlying SSL implementation (currently " +"provided by the OpenSSL library). This signifies some problem in the " +"higher-level encryption and authentication layer that's superimposed on the " +"underlying network connection. This error is a subtype of :exc:`OSError`. " +"The error code and message of :exc:`SSLError` instances are provided by the " +"OpenSSL library." +msgstr "" +"برای اعلام خطایی از پیاده‌سازی SSL زیربنایی (که در حال حاضر توسط کتابخانه‌ی " +"OpenSSL ارائه می‌شود) پرتاب می‌شود. این نشان‌دهنده‌ی مشکلی در لایه‌ی رمزنگاری و " +"احراز هویت سطح بالاتر است که بر اتصال شبکه‌ی زیربنایی سوار شده است. این خطا " +"زیرنوعی از :exc:`OSError` است. کد خطا و پیام نمونه‌های :exc:`SSLError` توسط " +"کتابخانه‌ی OpenSSL ارائه می‌شوند." msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." -msgstr "" +msgstr ":exc:`SSLError` پیش‌تر زیرنوعی از :exc:`socket.error` بود." -msgid "A string mnemonic designating the OpenSSL submodule in which the error occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible values depends on the OpenSSL version." +msgid "" +"A string mnemonic designating the OpenSSL submodule in which the error " +"occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible " +"values depends on the OpenSSL version." msgstr "" +"یک رشته‌ی یادآور (mnemonic) برای مشخص‌کردن زیرماژول OpenSSL که خطا در آن رخ " +"داده است، مانند ``SSL``، ``PEM`` یا ``X509``. بازه‌ی مقادیر ممکن به نسخه‌ی " +"OpenSSL بستگی دارد." -msgid "A string mnemonic designating the reason this error occurred, for example ``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the OpenSSL version." +msgid "" +"A string mnemonic designating the reason this error occurred, for example " +"``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the " +"OpenSSL version." msgstr "" +"یک رشته‌ی یادآور که دلیل وقوع این خطا را مشخص می‌کند، برای مثال " +"``CERTIFICATE_VERIFY_FAILED``. بازه‌ی مقادیر ممکن به نسخه‌ی OpenSSL بستگی " +"دارد." -msgid "A subclass of :exc:`SSLError` raised when trying to read or write and the SSL connection has been closed cleanly. Note that this doesn't mean that the underlying transport (read TCP) has been closed." +msgid "" +"A subclass of :exc:`SSLError` raised when trying to read or write and the " +"SSL connection has been closed cleanly. Note that this doesn't mean that " +"the underlying transport (read TCP) has been closed." msgstr "" +"زیرکلاسی از :exc:`SSLError` که هنگام تلاش برای خواندن یا نوشتن، در حالی که " +"اتصال SSL به‌صورت تمیز بسته شده است، پرتاب می‌شود. توجه داشته باشید که این به " +"آن معنا نیست که انتقال زیرین (یعنی TCP) بسته شده است." -msgid "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be received on the underlying TCP transport before the request can be fulfilled." +msgid "" +"A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket " +"` when trying to read or write data, but more data needs " +"to be received on the underlying TCP transport before the request can be " +"fulfilled." msgstr "" +"زیرکلاسی از :exc:`SSLError` که توسط یک :ref:`سوکت SSL غیرمسدود ` هنگام تلاش برای خواندن یا نوشتن داده پرتاب می‌شود، اما پیش از " +"برآورده شدن درخواست، داده‌های بیشتری باید از طریق انتقال TCP زیرین دریافت " +"شود." -msgid "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be sent on the underlying TCP transport before the request can be fulfilled." +msgid "" +"A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket " +"` when trying to read or write data, but more data needs " +"to be sent on the underlying TCP transport before the request can be " +"fulfilled." msgstr "" +"زیرکلاسی از :exc:`SSLError` که توسط یک :ref:`سوکت SSL غیرمسدود ` هنگام تلاش برای خواندن یا نوشتن داده پرتاب می‌شود، اما پیش از " +"برآورده شدن درخواست، باید داده‌های بیشتری روی انتقال TCP زیرین ارسال شود." -msgid "A subclass of :exc:`SSLError` raised when a system error was encountered while trying to fulfill an operation on a SSL socket. Unfortunately, there is no easy way to inspect the original errno number." +msgid "" +"A subclass of :exc:`SSLError` raised when a system error was encountered " +"while trying to fulfill an operation on a SSL socket. Unfortunately, there " +"is no easy way to inspect the original errno number." msgstr "" +"زیرکلاسی از :exc:`SSLError` که هنگام مواجهه با یک خطای سیستمی در تلاش برای " +"انجام یک عملیات روی یک سوکت SSL پرتاب می‌شود. متأسفانه، راه آسانی برای بررسی " +"شماره errno اصلی وجود ندارد." -msgid "A subclass of :exc:`SSLError` raised when the SSL connection has been terminated abruptly. Generally, you shouldn't try to reuse the underlying transport when this error is encountered." +msgid "" +"A subclass of :exc:`SSLError` raised when the SSL connection has been " +"terminated abruptly. Generally, you shouldn't try to reuse the underlying " +"transport when this error is encountered." msgstr "" +"زیرکلاسی از :exc:`SSLError` که هنگامی که اتصال SSL به‌طور ناگهانی قطع شده " +"باشد، پرتاب می‌شود. به‌طور کلی، هنگام مواجهه با این خطا نباید سعی کنید از " +"انتقال زیریندوباره استفاده کنید." -msgid "A subclass of :exc:`SSLError` raised when certificate validation has failed." +msgid "" +"A subclass of :exc:`SSLError` raised when certificate validation has failed." msgstr "" +"زیرکلاسی از :exc:`SSLError` که هنگام شکست اعتبارسنجی گواهی پرتاب می‌شود." msgid "A numeric error number that denotes the verification error." -msgstr "" +msgstr "یک شماره خطای عددی که خطای تأیید را نشان می‌دهد." msgid "A human readable string of the verification error." -msgstr "" +msgstr "رشته‌ای قابل‌خواندن برای انسان از خطای صحت‌سنجی." msgid "An alias for :exc:`SSLCertVerificationError`." -msgstr "" +msgstr "نام مستعاری برای :exc:`SSLCertVerificationError`." msgid "The exception is now an alias for :exc:`SSLCertVerificationError`." msgstr "" +"این استثنا اکنون نام مستعاری برای :exc:`SSLCertVerificationError` است." msgid "Random generation" -msgstr "" +msgstr "تولید تصادفی" -msgid "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:`SSLError` if the PRNG has not been seeded with enough data or if the operation is not supported by the current RAND method. :func:`RAND_status` can be used to check the status of the PRNG and :func:`RAND_add` can be used to seed the PRNG." +msgid "" +"Return *num* cryptographically strong pseudo-random bytes. Raises " +"an :class:`SSLError` if the PRNG has not been seeded with enough data or if " +"the operation is not supported by the current RAND " +"method. :func:`RAND_status` can be used to check the status of the PRNG " +"and :func:`RAND_add` can be used to seed the PRNG." msgstr "" +"*num* بایت شبه‌تصادفی قوی از نظر رمزنگاری را برمی‌گرداند. اگر PRNG با داده " +"کافی بذردهی نشده باشد یا روش RAND فعلی از عملیات پشتیبانی نکند، " +"یک :class:`SSLError` پرتاب می‌کند. می‌توان از :func:`RAND_status` برای بررسی " +"وضعیت PRNG و از :func:`RAND_add` برای بذردهی PRNG استفاده کرد." msgid "For almost all applications :func:`os.urandom` is preferable." -msgstr "" +msgstr "برای تقریباً همه‌ی کاربردها، :func:`os.urandom` ترجیح داده می‌شود." -msgid "Read the Wikipedia article, `Cryptographically secure pseudorandom number generator (CSPRNG) `_, to get the requirements of a cryptographically strong generator." +msgid "" +"Read the Wikipedia article, `Cryptographically secure pseudorandom number " +"generator (CSPRNG) `_, to get the " +"requirements of a cryptographically strong generator." msgstr "" +"برای به دست آوردن الزامات یک تولیدگر قوی از نظر رمزنگاری، مقاله‌ی ویکی‌پدیا، " +"`Cryptographically secure pseudorandom number generator (CSPRNG) `_ را بخوانید." -msgid "Return ``True`` if the SSL pseudo-random number generator has been seeded with 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random number generator." +msgid "" +"Return ``True`` if the SSL pseudo-random number generator has been seeded " +"with 'enough' randomness, and ``False`` otherwise. You can " +"use :func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the " +"randomness of the pseudo-random number generator." msgstr "" +"اگر تولیدگر اعداد شبه‌تصادفی SSL با میزان «کافی» تصادفی‌بودن بذرگذاری شده " +"باشد، ``True`` را برمی‌گرداند و در غیر این صورت ``False`` را برمی‌گرداند. " +"می‌توانید از :func:`ssl.RAND_egd` و :func:`ssl.RAND_add` برای افزایش " +"تصادفی‌بودن تولیدگر اعداد شبه‌تصادفی استفاده کنید." -msgid "Mix the given *bytes* into the SSL pseudo-random number generator. The parameter *entropy* (a float) is a lower bound on the entropy contained in string (so you can always use ``0.0``). See :rfc:`1750` for more information on sources of entropy." +msgid "" +"Mix the given *bytes* into the SSL pseudo-random number generator. The " +"parameter *entropy* (a float) is a lower bound on the entropy contained in " +"string (so you can always use ``0.0``). See :rfc:`1750` for more " +"information on sources of entropy." msgstr "" +"*bytes* داده‌شده را در مولد اعداد شبه‌تصادفی SSL مخلوط کنید. پارامتر " +"*entropy* (یک عدد اعشاری) کران پایینی برای آنتروپی موجود در رشته است " +"(بنابراین همیشه می‌توانید از ``0.0`` استفاده کنید). برای اطلاعات بیشتر " +"درباره منابع آنتروپی، :rfc:`1750` را ببینید." msgid "Writable :term:`bytes-like object` is now accepted." -msgstr "" +msgstr "اکنون :term:`bytes-like object` قابل‌نوشتن پذیرفته می‌شود." msgid "Certificate handling" -msgstr "" +msgstr "مدیریت گواهی" -msgid "Return the time in seconds since the epoch, given the ``cert_time`` string representing the \"notBefore\" or \"notAfter\" date from a certificate in ``\"%b %d %H:%M:%S %Y %Z\"`` strptime format (C locale)." +msgid "" +"Return the time in seconds since the epoch, given the ``cert_time`` string " +"representing the \"notBefore\" or \"notAfter\" date from a certificate in " +"``\"%b %d %H:%M:%S %Y %Z\"`` strptime format (C locale)." msgstr "" +"با دریافت رشته‌ی ``cert_time`` که نشان‌دهنده‌ی تاریخ \"notBefore\" یا " +"\"notAfter\" از یک گواهی در قالب ``\"%b %d %H:%M:%S %Y %Z\"`` برای strptime " +"(با تنظیمات locale C) است، زمان بر حسب ثانیه از مبدأ (epoch) را برمی‌گرداند." msgid "Here's an example:" -msgstr "" +msgstr "در اینجا یک مثال آمده است:" msgid "" ">>> import ssl\n" @@ -268,313 +573,723 @@ msgid "" ">>> print(dt.datetime.fromtimestamp(timestamp, dt.UTC))\n" "2018-01-05 09:34:43+00:00" msgstr "" +">>> import ssl\n" +">>> import datetime as dt\n" +">>> timestamp = ssl.cert_time_to_seconds(\"Jan 5 09:34:43 2018 GMT\")\n" +">>> timestamp\n" +"1515144883\n" +">>> print(dt.datetime.fromtimestamp(timestamp, dt.UTC))\n" +"2018-01-05 09:34:43+00:00" msgid "\"notBefore\" or \"notAfter\" dates must use GMT (:rfc:`5280`)." msgstr "" +"برای تاریخ‌های «notBefore» یا «notAfter» باید از GMT استفاده شود " +"(:rfc:`5280`)." -msgid "Interpret the input time as a time in UTC as specified by 'GMT' timezone in the input string. Local timezone was used previously. Return an integer (no fractions of a second in the input format)" +msgid "" +"Interpret the input time as a time in UTC as specified by 'GMT' timezone in " +"the input string. Local timezone was used previously. Return an integer (no " +"fractions of a second in the input format)" msgstr "" +"زمان ورودی به‌عنوان زمانی در UTC تفسیر می‌شود، همان‌طور که با منطقه زمانی " +"'GMT' در رشته ورودی مشخص شده است. پیش‌تر از منطقه زمانی محلی استفاده می‌شد. " +"یک عدد صحیح برگردانده می‌شود (در قالب ورودی کسری از ثانیه وجود ندارد)." -msgid "Given the address ``addr`` of an SSL-protected server, as a (*hostname*, *port-number*) pair, fetches the server's certificate, and returns it as a PEM-encoded string. If ``ssl_version`` is specified, uses that version of the SSL protocol to attempt to connect to the server. If *ca_certs* is specified, it should be a file containing a list of root certificates, the same format as used for the *cafile* parameter in :meth:`SSLContext.load_verify_locations`. The call will attempt to validate the server certificate against that set of root certificates, and will fail if the validation attempt fails. A timeout can be specified with the ``timeout`` parameter." -msgstr "" +msgid "" +"Given the address ``addr`` of an SSL-protected server, as a (*hostname*, " +"*port-number*) pair, fetches the server's certificate, and returns it as a " +"PEM-encoded string. If ``ssl_version`` is specified, uses that version of " +"the SSL protocol to attempt to connect to the server. If *ca_certs* is " +"specified, it should be a file containing a list of root certificates, the " +"same format as used for the *cafile* parameter " +"in :meth:`SSLContext.load_verify_locations`. The call will attempt to " +"validate the server certificate against that set of root certificates, and " +"will fail if the validation attempt fails. A timeout can be specified with " +"the ``timeout`` parameter." +msgstr "" +"با ارائه‌ی آدرس ``addr`` یک سرور محافظت‌شده با SSL، به‌صورت یک جفت (*نام " +"میزبان*، *شماره پورت*)، گواهی سرور را دریافت می‌کند و آن را به‌صورت یک رشته‌ی " +"کدگذاری‌شده با PEM برمی‌گرداند. اگر ``ssl_version`` مشخص شده باشد، از آن نسخه " +"از پروتکل SSL برای تلاش جهت اتصال به سرور استفاده می‌کند. اگر *ca_certs* " +"مشخص شده باشد، باید یک فایل حاوی فهرستی از گواهی‌های ریشه باشد، با همان " +"قالبی که برای پارامتر *cafile* در :meth:`SSLContext.load_verify_locations` " +"استفاده می‌شود. این فراخوانی تلاش می‌کند گواهی سرور را در برابر آن مجموعه از " +"گواهی‌های ریشه اعتبارسنجی کند، و اگر اعتبارسنجی ناموفق باشد، شکست می‌خورد. " +"می‌توان یک مهلت زمانی (timeout) را با پارامتر ``timeout`` مشخص کرد." msgid "This function is now IPv6-compatible." -msgstr "" +msgstr "این تابع اکنون با IPv6 سازگار است." -msgid "The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to :data:`PROTOCOL_TLS` for maximum compatibility with modern servers." +msgid "" +"The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` " +"to :data:`PROTOCOL_TLS` for maximum compatibility with modern servers." msgstr "" +"مقدار پیش‌فرض *ssl_version* برای بیشترین سازگاری با سرورهای مدرن، " +"از :data:`PROTOCOL_SSLv3` به :data:`PROTOCOL_TLS` تغییر کرده است." msgid "The *timeout* parameter was added." -msgstr "" +msgstr "پارامتر *timeout* افزوده شد." -msgid "Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded string version of the same certificate." +msgid "" +"Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded " +"string version of the same certificate." msgstr "" +"با دریافت یک گواهی به‌صورت هیپ‌ای (blob) از بایت‌های کدگذاری‌شده با DER، نسخه‌ی " +"رشته‌ای کدگذاری‌شده با PEM از همان گواهی را برمی‌گرداند." -msgid "Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of bytes for that same certificate." +msgid "" +"Given a certificate as an ASCII PEM string, returns a DER-encoded sequence " +"of bytes for that same certificate." msgstr "" +"با داشتن یک گواهی به‌صورت رشته‌ی ASCII PEM، دنباله‌ای از بایت‌های کدگذاری‌شده با " +"DER برای همان گواهی بازمی‌گرداند." -msgid "Returns a named tuple with paths to OpenSSL's default cafile and capath. The paths are the same as used by :meth:`SSLContext.set_default_verify_paths`. The return value is a :term:`named tuple` ``DefaultVerifyPaths``:" +msgid "" +"Returns a named tuple with paths to OpenSSL's default cafile and capath. " +"The paths are the same as used " +"by :meth:`SSLContext.set_default_verify_paths`. The return value is " +"a :term:`named tuple` ``DefaultVerifyPaths``:" msgstr "" +"یک تاپل نام‌دار حاوی مسیرهای cafile و capath پیش‌فرض OpenSSL برمی‌گرداند. این " +"مسیرها همان مسیرهایی هستند که " +"توسط :meth:`SSLContext.set_default_verify_paths` استفاده می‌شوند. مقدار " +"بازگشتی یک :term:`named tuple` از نوع ``DefaultVerifyPaths`` است:" -msgid ":attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't exist," +msgid "" +":attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't " +"exist," msgstr "" +":attr:`cafile` - مسیر حل‌شده برای cafile یا ``None`` اگر فایل وجود نداشته " +"باشد،" -msgid ":attr:`capath` - resolved path to capath or ``None`` if the directory doesn't exist," +msgid "" +":attr:`capath` - resolved path to capath or ``None`` if the directory " +"doesn't exist," msgstr "" +":attr:`capath` - مسیر حل‌شده به capath یا ``None`` اگر پوشه وجود نداشته باشد،" -msgid ":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a cafile," +msgid "" +":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a " +"cafile," msgstr "" +":attr:`openssl_cafile_env` - کلید محیطی OpenSSL که به یک cafile اشاره می‌کند،" msgid ":attr:`openssl_cafile` - hard coded path to a cafile," -msgstr "" +msgstr ":attr:`openssl_cafile` - مسیر سخت‌کدشده به یک cafile،" -msgid ":attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath," +msgid "" +":attr:`openssl_capath_env` - OpenSSL's environment key that points to a " +"capath," msgstr "" +":attr:`openssl_capath_env` - کلید محیطی OpenSSL که به یک capath اشاره می‌کند،" msgid ":attr:`openssl_capath` - hard coded path to a capath directory" -msgstr "" +msgstr ":attr:`openssl_capath` - مسیر سخت‌کدشده به یک پوشه‌ی capath" -msgid "Retrieve certificates from Windows' system cert store. *store_name* may be one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." +msgid "" +"Retrieve certificates from Windows' system cert store. *store_name* may be " +"one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert " +"stores, too." msgstr "" +"گواهی‌ها را از مخزن گواهی سیستم ویندوز بازیابی می‌کند. *store_name* می‌تواند " +"یکی از ``CA``، ``ROOT`` یا ``MY`` باشد. ویندوز ممکن است مخازن گواهی بیشتری " +"نیز ارائه دهد." -msgid "The function returns a list of (cert_bytes, encoding_type, trust) tuples. The encoding_type specifies the encoding of cert_bytes. It is either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set of OIDS or exactly ``True`` if the certificate is trustworthy for all purposes." -msgstr "" +msgid "" +"The function returns a list of (cert_bytes, encoding_type, trust) tuples. " +"The encoding_type specifies the encoding of cert_bytes. It is " +"either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for " +"PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set " +"of OIDS or exactly ``True`` if the certificate is trustworthy for all " +"purposes." +msgstr "" +"این تابع فهرستی از تاپل‌های (cert_bytes, encoding_type, trust) را " +"برمی‌گرداند. encoding_type کدگذاری cert_bytes را مشخص می‌کند. این مقدار " +"یا :const:`x509_asn` برای داده‌های X.509 ASN.1 است یا :const:`pkcs_7_asn` " +"برای داده‌های PKCS#7 ASN.1. trust هدف گواهی را به‌صورت مجموعه‌ای از OIDS یا، " +"اگر گواهی برای تمام اهداف قابل اعتماد باشد، دقیقاً به‌صورت ``True`` مشخص " +"می‌کند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> ssl.enum_certificates(\"CA\")\n" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" msgstr "" +">>> ssl.enum_certificates(\"CA\")\n" +"[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" +" (b'data...', 'x509_asn', True)]" -msgid "Retrieve CRLs from Windows' system cert store. *store_name* may be one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." +msgid "" +"Retrieve CRLs from Windows' system cert store. *store_name* may be one of " +"``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." msgstr "" +"بازیابی CRLها از فروشگاه گواهی سیستمی ویندوز (cert store). *store_name* " +"می‌تواند یکی از ``CA``، ``ROOT`` یا ``MY`` باشد. ویندوز ممکن است فروشگاه‌های " +"گواهی دیگری نیز ارائه دهد." -msgid "The function returns a list of (cert_bytes, encoding_type, trust) tuples. The encoding_type specifies the encoding of cert_bytes. It is either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data." +msgid "" +"The function returns a list of (cert_bytes, encoding_type, trust) tuples. " +"The encoding_type specifies the encoding of cert_bytes. It is " +"either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for " +"PKCS#7 ASN.1 data." msgstr "" +"این تابع فهرستی از تاپل‌های (cert_bytes, encoding_type, trust) را " +"برمی‌گرداند. encoding_type کدگذاری cert_bytes را مشخص می‌کند. این مقدار " +"می‌تواند :const:`x509_asn` برای داده‌های X.509 ASN.1 یا :const:`pkcs_7_asn` " +"برای داده‌های PKCS#7 ASN.1 باشد." msgid "Constants" -msgstr "" +msgstr "ثابت‌ها" -msgid "All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` collections." +msgid "" +"All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` " +"collections." msgstr "" +"همه‌ی ثابت‌ها اکنون مجموعه‌های :class:`enum.IntEnum` یا :class:`enum.IntFlag` " +"هستند." -msgid "Possible value for :attr:`SSLContext.verify_mode`. Except for :const:`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, just about any cert is accepted. Validation errors, such as untrusted or expired cert, are ignored and do not abort the TLS/SSL handshake." -msgstr "" +msgid "" +"Possible value for :attr:`SSLContext.verify_mode`. Except " +"for :const:`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side " +"sockets, just about any cert is accepted. Validation errors, such as " +"untrusted or expired cert, are ignored and do not abort the TLS/SSL " +"handshake." +msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_mode`. " +"به‌جز :const:`PROTOCOL_TLS_CLIENT`، این حالت پیش‌فرض است. در سوکت‌های سمت " +"کلاینت، تقریباً هر گواهی‌ای پذیرفته می‌شود. خطاهای اعتبارسنجی، مانند گواهی " +"غیرقابل‌اعتماد یا منقضی‌شده، نادیده گرفته می‌شوند و باعث لغو دست‌دهی TLS/SSL " +"نمی‌شوند." -msgid "In server mode, no certificate is requested from the client, so the client does not send any for client cert authentication." +msgid "" +"In server mode, no certificate is requested from the client, so the client " +"does not send any for client cert authentication." msgstr "" +"در حالت سرور، هیچ گواهی‌ای از کلاینت درخواست نمی‌شود، بنابراین کلاینت " +"گواهی‌ای برای احراز هویت با گواهی کلاینت ارسال نمی‌کند." msgid "See the discussion of :ref:`ssl-security` below." -msgstr "" +msgstr "بحث :ref:`ssl-security` را در زیر ببینید." -msgid "Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is recommended to use :const:`CERT_REQUIRED` for client-side sockets instead." +msgid "" +"Possible value for :attr:`SSLContext.verify_mode`. In client " +"mode, :const:`CERT_OPTIONAL` has the same meaning " +"as :const:`CERT_REQUIRED`. It is recommended to use :const:`CERT_REQUIRED` " +"for client-side sockets instead." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_mode`. در حالت " +"کلاینت، :const:`CERT_OPTIONAL` همان معنای :const:`CERT_REQUIRED` را دارد. " +"توصیه می‌شود به‌جای آن از :const:`CERT_REQUIRED` برای سوکت‌های سمت کلاینت " +"استفاده کنید." -msgid "In server mode, a client certificate request is sent to the client. The client may either ignore the request or send a certificate in order perform TLS client cert authentication. If the client chooses to send a certificate, it is verified. Any verification error immediately aborts the TLS handshake." +msgid "" +"In server mode, a client certificate request is sent to the client. The " +"client may either ignore the request or send a certificate in order perform " +"TLS client cert authentication. If the client chooses to send a " +"certificate, it is verified. Any verification error immediately aborts the " +"TLS handshake." msgstr "" +"در حالت سرور، یک درخواست برای گواهی کلاینت به کلاینت ارسال می‌شود. کلاینت " +"می‌تواند یا این درخواست را نادیده بگیرد یا برای انجام احراز هویت گواهی " +"کلاینت TLS، یک گواهی ارسال کند. اگر کلاینت تصمیم بگیرد گواهی ارسال کند، آن " +"گواهی اعتبارسنجی می‌شود. هر خطای اعتبارسنجی، فوراً باعث لغو دست‌دهی TLS می‌شود." -msgid "Use of this setting requires a valid set of CA certificates to be passed to :meth:`SSLContext.load_verify_locations`." +msgid "" +"Use of this setting requires a valid set of CA certificates to be passed " +"to :meth:`SSLContext.load_verify_locations`." msgstr "" +"استفاده از این تنظیم نیاز دارد که یک مجموعه معتبر از گواهی‌های CA " +"به :meth:`SSLContext.load_verify_locations` ارسال شود." -msgid "Possible value for :attr:`SSLContext.verify_mode`. In this mode, certificates are required from the other side of the socket connection; an :class:`SSLError` will be raised if no certificate is provided, or if its validation fails. This mode is **not** sufficient to verify a certificate in client mode as it does not match hostnames. :attr:`~SSLContext.check_hostname` must be enabled as well to verify the authenticity of a cert. :const:`PROTOCOL_TLS_CLIENT` uses :const:`CERT_REQUIRED` and enables :attr:`~SSLContext.check_hostname` by default." -msgstr "" +msgid "" +"Possible value for :attr:`SSLContext.verify_mode`. In this mode, " +"certificates are required from the other side of the socket connection; " +"an :class:`SSLError` will be raised if no certificate is provided, or if " +"its validation fails. This mode is **not** sufficient to verify a " +"certificate in client mode as it does not match " +"hostnames. :attr:`~SSLContext.check_hostname` must be enabled as well to " +"verify the authenticity of a cert. :const:`PROTOCOL_TLS_CLIENT` " +"uses :const:`CERT_REQUIRED` and enables :attr:`~SSLContext.check_hostname` " +"by default." +msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_mode`. در این حالت، ارائه گواهی از " +"طرف دیگر اتصال سوکت الزامی است؛ اگر گواهی ارائه نشود یا اعتبارسنجی آن " +"ناموفق باشد، یک :class:`SSLError` پرتاب می‌شود. این حالت برای تأیید صحت " +"گواهی در حالت کلاینت کافی **نیست**، زیرا نام‌های میزبان را تطبیق نمی‌دهد. " +"برای تأیید اصالت یک گواهی، :attr:`~SSLContext.check_hostname` نیز باید فعال " +"باشد. :const:`PROTOCOL_TLS_CLIENT` از :const:`CERT_REQUIRED` استفاده می‌کند " +"و :attr:`~SSLContext.check_hostname` را به‌طور پیش‌فرض فعال می‌کند." -msgid "With server socket, this mode provides mandatory TLS client cert authentication. A client certificate request is sent to the client and the client must provide a valid and trusted certificate." +msgid "" +"With server socket, this mode provides mandatory TLS client cert " +"authentication. A client certificate request is sent to the client and the " +"client must provide a valid and trusted certificate." msgstr "" +"با سوکت سرور، این حالت احراز هویت گواهی کلاینت TLS را به‌صورت الزامی فراهم " +"می‌کند. یک درخواست گواهی کلاینت به کلاینت ارسال می‌شود و کلاینت باید یک گواهی " +"معتبر و مورد اعتماد ارائه دهد." msgid ":class:`enum.IntEnum` collection of CERT_* constants." -msgstr "" +msgstr "مجموعه‌ی :class:`enum.IntEnum` از ثابت‌های CERT_*." -msgid "Possible value for :attr:`SSLContext.verify_flags`. In this mode, certificate revocation lists (CRLs) are not checked. By default OpenSSL does neither require nor verify CRLs." +msgid "" +"Possible value for :attr:`SSLContext.verify_flags`. In this mode, " +"certificate revocation lists (CRLs) are not checked. By default OpenSSL " +"does neither require nor verify CRLs." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags`. در این حالت، فهرست‌های " +"ابطال گواهی (CRLs) بررسی نمی‌شوند. به‌طور پیش‌فرض، OpenSSL نه به CRLها " +"نیاز دارد و نه آن‌ها را تأیید می‌کند." -msgid "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the peer cert is checked but none of the intermediate CA certificates. The mode requires a valid CRL that is signed by the peer cert's issuer (its direct ancestor CA). If no proper CRL has been loaded with :attr:`SSLContext.load_verify_locations`, validation will fail." -msgstr "" +msgid "" +"Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " +"peer cert is checked but none of the intermediate CA certificates. The mode " +"requires a valid CRL that is signed by the peer cert's issuer (its direct " +"ancestor CA). If no proper CRL has been loaded " +"with :attr:`SSLContext.load_verify_locations`, validation will fail." +msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags`. در این حالت، تنها گواهی " +"همتا بررسی می‌شود، اما هیچ‌یک از گواهی‌های CA میانی بررسی نمی‌شود. این حالت به " +"یک فهرست لغو گواهی (CRL) معتبر نیاز دارد که توسط صادرکننده گواهی همتا (CA " +"بالادستی مستقیم آن) امضا شده باشد. اگر هیچ CRL مناسبی " +"با :attr:`SSLContext.load_verify_locations` بارگذاری نشده باشد، اعتبارسنجی " +"شکست خواهد خورد." -msgid "Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of all certificates in the peer cert chain are checked." +msgid "" +"Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of " +"all certificates in the peer cert chain are checked." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags`. در این حالت، فهرست‌های لغو " +"گواهی (CRLs) مربوط به تمام گواهی‌های موجود در زنجیره گواهی همتا بررسی می‌شوند." -msgid "Possible value for :attr:`SSLContext.verify_flags` to disable workarounds for broken X.509 certificates." +msgid "" +"Possible value for :attr:`SSLContext.verify_flags` to disable workarounds " +"for broken X.509 certificates." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags` جهت غیرفعال کردن راه‌حل‌های " +"موقت برای گواهی‌های X.509 معیوب." -msgid "Possible value for :attr:`SSLContext.verify_flags` to enables proxy certificate verification." +msgid "" +"Possible value for :attr:`SSLContext.verify_flags` to enables proxy " +"certificate verification." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags` جهت فعال‌سازی تأیید گواهی " +"پراکسی." -msgid "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to prefer trusted certificates when building the trust chain to validate a certificate. This flag is enabled by default." +msgid "" +"Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " +"prefer trusted certificates when building the trust chain to validate a " +"certificate. This flag is enabled by default." msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags`. این پرچم به OpenSSL دستور " +"می‌دهد که هنگام ساخت زنجیره‌ی اعتماد برای اعتبارسنجی یک گواهی، گواهی‌های مورد " +"اعتماد را ترجیح دهد. این پرچم به‌طور پیش‌فرض فعال است." -msgid "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to accept intermediate CAs in the trust store to be treated as trust-anchors, in the same way as the self-signed root CA certificates. This makes it possible to trust certificates issued by an intermediate CA without having to trust its ancestor root CA." -msgstr "" +msgid "" +"Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " +"accept intermediate CAs in the trust store to be treated as trust-anchors, " +"in the same way as the self-signed root CA certificates. This makes it " +"possible to trust certificates issued by an intermediate CA without having " +"to trust its ancestor root CA." +msgstr "" +"مقدار ممکن برای :attr:`SSLContext.verify_flags`. این مقدار به OpenSSL دستور " +"می‌دهد که CAهای میانی موجود در مخزن اعتماد (trust store) را به‌عنوان لنگرهای " +"اعتماد (trust-anchors) بپذیرد، به همان شیوه‌ای که گواهی‌های CA ریشه‌ی خودامضا " +"پذیرفته می‌شوند. این کار امکان اعتماد به گواهی‌های صادرشده توسط یک CA میانی " +"را بدون نیاز به اعتماد به CA ریشه‌ی والد آن فراهم می‌کند." msgid ":class:`enum.IntFlag` collection of VERIFY_* constants." -msgstr "" +msgstr ":class:`enum.IntFlag` مجموعه‌ای از ثابت‌های VERIFY_*." -msgid "Selects the highest protocol version that both the client and server support. Despite the name, this option can select both \"SSL\" and \"TLS\" protocols." +msgid "" +"Selects the highest protocol version that both the client and server " +"support. Despite the name, this option can select both \"SSL\" and \"TLS\" " +"protocols." msgstr "" +"بالاترین نسخه‌ی پروتکل را که هر دو کلاینت و سرور از آن پشتیبانی می‌کنند، " +"انتخاب می‌کند. با وجود نام، این گزینه می‌تواند هر دو پروتکل «SSL» و «TLS» را " +"انتخاب کند." -msgid "TLS clients and servers require different default settings for secure communication. The generic TLS protocol constant is deprecated in favor of :data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." +msgid "" +"TLS clients and servers require different default settings for secure " +"communication. The generic TLS protocol constant is deprecated in favor " +"of :data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." msgstr "" +"کلاینت‌ها و سرورهای TLS برای ارتباط امن به تنظیمات پیش‌فرض متفاوتی نیاز " +"دارند. ثابت عام پروتکل TLS منسوخ شده است و به جای " +"آن :data:`PROTOCOL_TLS_CLIENT` و :data:`PROTOCOL_TLS_SERVER` توصیه می‌شود." -msgid "Auto-negotiate the highest protocol version that both the client and server support, and configure the context client-side connections. The protocol enables :data:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` by default." +msgid "" +"Auto-negotiate the highest protocol version that both the client and server " +"support, and configure the context client-side connections. The protocol " +"enables :data:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` by " +"default." msgstr "" +"به‌صورت خودکار بر سر بالاترین نسخه‌ی پروتکل که هم کارخواه و هم کارساز " +"پشتیبانی می‌کنند، مذاکره می‌کند و زمینه را برای اتصال‌های سمت کارخواه پیکربندی " +"می‌کند. این پروتکل به‌طور پیش‌فرض :data:`CERT_REQUIRED` " +"و :attr:`~SSLContext.check_hostname` را فعال می‌کند." -msgid "Auto-negotiate the highest protocol version that both the client and server support, and configure the context server-side connections." +msgid "" +"Auto-negotiate the highest protocol version that both the client and server " +"support, and configure the context server-side connections." msgstr "" +"به‌صورت خودکار از طریق مذاکره، بالاترین نسخه‌ی پروتکل را که هر دو کلاینت و " +"سرور از آن پشتیبانی می‌کنند، تعیین می‌کند و زمینه را برای اتصال‌های سمت سرور " +"پیکربندی می‌کند." msgid "Alias for :data:`PROTOCOL_TLS`." -msgstr "" +msgstr "نام مستعاری برای :data:`PROTOCOL_TLS`." msgid "Use :data:`PROTOCOL_TLS` instead." -msgstr "" +msgstr "به‌جای آن از :data:`PROTOCOL_TLS` استفاده کنید." msgid "Selects SSL version 3 as the channel encryption protocol." -msgstr "" +msgstr "نسخه‌ی 3 SSL را به‌عنوان پروتکل رمزنگاری کانال انتخاب می‌کند." -msgid "This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` option." +msgid "" +"This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " +"option." msgstr "" +"اگر OpenSSL با گزینه ``no-ssl3`` کامپایل شده باشد، این پروتکل در دسترس نیست." msgid "SSL version 3 is insecure. Its use is highly discouraged." -msgstr "" +msgstr "نسخه‌ی 3 SSL ناامن است. استفاده از آن به‌شدت توصیه نمی‌شود." -msgid "OpenSSL has deprecated all version specific protocols. Use the default protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :attr:`SSLContext.minimum_version` and :attr:`SSLContext.maximum_version` instead." +msgid "" +"OpenSSL has deprecated all version specific protocols. Use the default " +"protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` " +"with :attr:`SSLContext.minimum_version` " +"and :attr:`SSLContext.maximum_version` instead." msgstr "" +"OpenSSL تمام پروتکل‌های خاص نسخه را منسوخ کرده است. به‌جای آن‌ها از پروتکل " +"پیش‌فرض :data:`PROTOCOL_TLS_SERVER` یا :data:`PROTOCOL_TLS_CLIENT` همراه " +"با :attr:`SSLContext.minimum_version` و :attr:`SSLContext.maximum_version` " +"استفاده کنید." msgid "Selects TLS version 1.0 as the channel encryption protocol." -msgstr "" +msgstr "TLS نسخه 1.0 را به‌عنوان پروتکل رمزنگاری کانال انتخاب می‌کند." msgid "OpenSSL has deprecated all version specific protocols." -msgstr "" +msgstr "OpenSSL تمام پروتکل‌های مختص نسخه را منسوخ کرده است." -msgid "Selects TLS version 1.1 as the channel encryption protocol. Available only with openssl version 1.0.1+." +msgid "" +"Selects TLS version 1.1 as the channel encryption protocol. Available only " +"with openssl version 1.0.1+." msgstr "" +"نسخه‌ی TLS 1.1 را به‌عنوان پروتکل رمزنگاری کانال انتخاب می‌کند. فقط با openssl " +"نسخه‌ی 1.0.1+ در دسترس است." -msgid "Selects TLS version 1.2 as the channel encryption protocol. Available only with openssl version 1.0.1+." +msgid "" +"Selects TLS version 1.2 as the channel encryption protocol. Available only " +"with openssl version 1.0.1+." msgstr "" +"نسخه 1.2 TLS را به‌عنوان پروتکل رمزنگاری کانال انتخاب می‌کند. فقط با openssl " +"نسخه 1.0.1+ در دسترس است." -msgid "Enables workarounds for various bugs present in other SSL implementations. This option is set by default. It does not necessarily set the same flags as OpenSSL's ``SSL_OP_ALL`` constant." +msgid "" +"Enables workarounds for various bugs present in other SSL implementations. " +"This option is set by default. It does not necessarily set the same flags " +"as OpenSSL's ``SSL_OP_ALL`` constant." msgstr "" +"راه‌حل‌های جایگزین را برای اشکالات مختلف موجود در سایر پیاده‌سازی‌های SSL فعال " +"می‌کند. این گزینه به‌طور پیش‌فرض تنظیم شده است. این گزینه لزوماً همان پرچم‌های " +"ثابت ``SSL_OP_ALL`` در OpenSSL را تنظیم نمی‌کند." -msgid "Prevents an SSLv2 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv2 as the protocol version." +msgid "" +"Prevents an SSLv2 connection. This option is only applicable in " +"conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from " +"choosing SSLv2 as the protocol version." msgstr "" +"از اتصال SSLv2 جلوگیری می‌کند. این گزینه فقط همراه با :const:`PROTOCOL_TLS` " +"قابل اعمال است. این گزینه از انتخاب SSLv2 به‌عنوان نسخه‌ی پروتکل توسط همتایان " +"جلوگیری می‌کند." msgid "SSLv2 is deprecated" -msgstr "" +msgstr "SSLv2 منسوخ شده است" -msgid "Prevents an SSLv3 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv3 as the protocol version." +msgid "" +"Prevents an SSLv3 connection. This option is only applicable in " +"conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from " +"choosing SSLv3 as the protocol version." msgstr "" +"از یک اتصال SSLv3 جلوگیری می‌کند. این گزینه تنها در ترکیب " +"با :const:`PROTOCOL_TLS` قابل استفاده است. این گزینه از انتخاب SSLv3 " +"به‌عنوان نسخه‌ی پروتکل توسط همتایان جلوگیری می‌کند." msgid "SSLv3 is deprecated" -msgstr "" +msgstr "SSLv3 منسوخ شده است" -msgid "Prevents a TLSv1 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as the protocol version." +msgid "" +"Prevents a TLSv1 connection. This option is only applicable in conjunction " +"with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as " +"the protocol version." msgstr "" +"از اتصال TLSv1 جلوگیری می‌کند. این گزینه تنها در همراهی " +"با :const:`PROTOCOL_TLS` قابل اعمال است. این گزینه از انتخاب TLSv1 به‌عنوان " +"نسخه‌ی پروتکل توسط طرفین جلوگیری می‌کند." -msgid "The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext.minimum_version` and :attr:`SSLContext.maximum_version` instead." +msgid "" +"The option is deprecated since OpenSSL 1.1.0, use the " +"new :attr:`SSLContext.minimum_version` " +"and :attr:`SSLContext.maximum_version` instead." msgstr "" +"این گزینه از OpenSSL 1.1.0 منسوخ شده است، به‌جای آن " +"از :attr:`SSLContext.minimum_version` و :attr:`SSLContext.maximum_version` " +"جدید استفاده کنید." -msgid "Prevents a TLSv1.1 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as the protocol version. Available only with openssl version 1.0.1+." +msgid "" +"Prevents a TLSv1.1 connection. This option is only applicable in " +"conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing " +"TLSv1.1 as the protocol version. Available only with openssl version 1.0.1+." msgstr "" +"از اتصال TLSv1.1 جلوگیری می‌کند. این گزینه تنها " +"به‌همراه :const:`PROTOCOL_TLS` قابل استفاده است. این گزینه مانع از انتخاب " +"TLSv1.1 به‌عنوان نسخه‌ی پروتکل توسط همتایان می‌شود. فقط در openssl نسخه‌ی " +"1.0.1+ در دسترس است." msgid "The option is deprecated since OpenSSL 1.1.0." -msgstr "" +msgstr "این گزینه از OpenSSL 1.1.0 منسوخ شده است." -msgid "Prevents a TLSv1.2 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as the protocol version. Available only with openssl version 1.0.1+." +msgid "" +"Prevents a TLSv1.2 connection. This option is only applicable in " +"conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing " +"TLSv1.2 as the protocol version. Available only with openssl version 1.0.1+." msgstr "" +"از اتصال TLSv1.2 جلوگیری می‌کند. این گزینه فقط در ترکیب " +"با :const:`PROTOCOL_TLS` قابل اعمال است. این گزینه از انتخاب TLSv1.2 " +"به‌عنوان نسخه پروتکل توسط طرفین جلوگیری می‌کند. فقط با openssl نسخه 1.0.1+ در " +"دسترس است." -msgid "Prevents a TLSv1.3 connection. This option is only applicable in conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as the protocol version. TLS 1.3 is available with OpenSSL 1.1.1 or later. When Python has been compiled against an older version of OpenSSL, the flag defaults to *0*." -msgstr "" +msgid "" +"Prevents a TLSv1.3 connection. This option is only applicable in " +"conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from choosing " +"TLSv1.3 as the protocol version. TLS 1.3 is available with OpenSSL 1.1.1 or " +"later. When Python has been compiled against an older version of OpenSSL, " +"the flag defaults to *0*." +msgstr "" +"از اتصال TLSv1.3 جلوگیری می‌کند. این گزینه فقط همراه " +"با :const:`PROTOCOL_TLS` قابل اعمال است. این گزینه مانع از انتخاب TLSv1.3 " +"به‌عنوان نسخه‌ی پروتکل توسط همتایان می‌شود. TLS 1.3 با OpenSSL 1.1.1 یا جدیدتر " +"در دسترس است. هنگامی که پایتون با یک نسخه‌ی قدیمی‌تر از OpenSSL کامپایل شده " +"باشد، مقدار پیش‌فرض این پرچم *0* است." -msgid "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and 3.6.3 for backwards compatibility with OpenSSL 1.0.2." +msgid "" +"The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " +"3.6.3 for backwards compatibility with OpenSSL 1.0.2." msgstr "" +"این گزینه از OpenSSL 1.1.0 منسوخ شده است. این گزینه برای سازگاری رو به عقب " +"با OpenSSL 1.0.2 به نسخه‌های 2.7.15 و 3.6.3 اضافه شد." -msgid "Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest messages, and ignore renegotiation requests via ClientHello." +msgid "" +"Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest " +"messages, and ignore renegotiation requests via ClientHello." msgstr "" +"هرگونه مذاکره مجدد را در TLSv1.2 و نسخه‌های پیش از آن غیرفعال کنید. پیام‌های " +"HelloRequest را ارسال نکنید و درخواست‌های مذاکره مجدد از طریق ClientHello را " +"نادیده بگیرید." msgid "This option is only available with OpenSSL 1.1.0h and later." -msgstr "" +msgstr "این گزینه تنها با OpenSSL 1.1.0h و نسخه‌های بعد از آن در دسترس است." -msgid "Use the server's cipher ordering preference, rather than the client's. This option has no effect on client sockets and SSLv2 server sockets." +msgid "" +"Use the server's cipher ordering preference, rather than the client's. This " +"option has no effect on client sockets and SSLv2 server sockets." msgstr "" +"به‌جای اولویت کلاینت، از اولویت سرور در ترتیب رمزها (cipher) استفاده کنید. " +"این گزینه بر سوکت‌های کلاینت و سوکت‌های سرور SSLv2 تأثیری ندارد." -msgid "Prevents reuse of the same DH key for distinct SSL sessions. This improves forward secrecy but requires more computational resources. This option only applies to server sockets." +msgid "" +"Prevents reuse of the same DH key for distinct SSL sessions. This improves " +"forward secrecy but requires more computational resources. This option only " +"applies to server sockets." msgstr "" +"از استفاده مجدد از کلید DH یکسان برای نشست‌های SSL متفاوت جلوگیری می‌کند. این " +"کار رازداری رو به جلو را بهبود می‌بخشد، اما به منابع محاسباتی بیشتری نیاز " +"دارد. این گزینه فقط به سوکت‌های سرور اعمال می‌شود." -msgid "Prevents reuse of the same ECDH key for distinct SSL sessions. This improves forward secrecy but requires more computational resources. This option only applies to server sockets." +msgid "" +"Prevents reuse of the same ECDH key for distinct SSL sessions. This " +"improves forward secrecy but requires more computational resources. This " +"option only applies to server sockets." msgstr "" +"از استفاده‌ی مجدد از همان کلید ECDH برای نشست‌های SSL متفاوت جلوگیری می‌کند. " +"این کار رازداری پیش‌رو (forward secrecy) را بهبود می‌بخشد، اما به منابع " +"محاسباتی بیشتری نیاز دارد. این گزینه فقط به سوکت‌های سرور اعمال می‌شود." -msgid "Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a TLS 1.3 connection look more like a TLS 1.2 connection." +msgid "" +"Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a " +"TLS 1.3 connection look more like a TLS 1.2 connection." msgstr "" +"ارسال پیام‌های Change Cipher Spec (CCS) ساختگی در دست‌دهی TLS 1.3 برای اینکه " +"اتصال TLS 1.3 بیشتر شبیه اتصال TLS 1.2 به نظر برسد." msgid "This option is only available with OpenSSL 1.1.1 and later." -msgstr "" +msgstr "این گزینه تنها با OpenSSL 1.1.1 و نسخه‌های بعدی در دسترس است." -msgid "Disable compression on the SSL channel. This is useful if the application protocol supports its own compression scheme." +msgid "" +"Disable compression on the SSL channel. This is useful if the application " +"protocol supports its own compression scheme." msgstr "" +"فشرده‌سازی را در کانال SSL غیرفعال کنید. این زمانی مفید است که پروتکل " +"کاربردی از روش فشرده‌سازی خود پشتیبانی کند." msgid ":class:`enum.IntFlag` collection of OP_* constants." -msgstr "" +msgstr ":class:`enum.IntFlag` مجموعه‌ای از ثابت‌های OP_*." msgid "Prevent client side from requesting a session ticket." -msgstr "" +msgstr "جلوگیری از درخواست بلیت نشست (session ticket) توسط سمت کلاینت." msgid "Ignore unexpected shutdown of TLS connections." -msgstr "" +msgstr "نادیده گرفتن خاموش شدن غیرمنتظره‌ی اتصال‌های TLS." msgid "This option is only available with OpenSSL 3.0.0 and later." -msgstr "" +msgstr "این گزینه فقط با OpenSSL 3.0.0 و نسخه‌های بعدی در دسترس است." -msgid "Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must have been compiled with support for it, and the negotiated cipher suites and extensions must be supported by it (a list of supported ones may vary by platform and kernel version)." +msgid "" +"Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must " +"have been compiled with support for it, and the negotiated cipher suites " +"and extensions must be supported by it (a list of supported ones may vary " +"by platform and kernel version)." msgstr "" +"فعال‌سازی استفاده از TLS هسته (kernel TLS). برای بهره‌مندی از این قابلیت، " +"OpenSSL باید با پشتیبانی از آن کامپایل شده باشد و مجموعه‌های رمزنگاری و " +"افزونه‌های توافق‌شده باید توسط آن پشتیبانی شوند (فهرست موارد پشتیبانی‌شده ممکن " +"است بسته به پلتفرم و نسخه هسته متفاوت باشد)." -msgid "Note that with enabled kernel TLS some cryptographic operations are performed by the kernel directly and not via any available OpenSSL Providers. This might be undesirable if, for example, the application requires all cryptographic operations to be performed by the FIPS provider." +msgid "" +"Note that with enabled kernel TLS some cryptographic operations are " +"performed by the kernel directly and not via any available OpenSSL " +"Providers. This might be undesirable if, for example, the application " +"requires all cryptographic operations to be performed by the FIPS provider." msgstr "" +"توجه داشته باشید که با فعال بودن TLS هسته، برخی از عملیات رمزنگاری مستقیماً " +"توسط هسته انجام می‌شوند، نه از طریق هیچ‌یک از ارائه‌دهنده‌های OpenSSL موجود. " +"این ممکن است نامطلوب باشد؛ برای مثال، اگر برنامه نیاز داشته باشد تمام " +"عملیات رمزنگاری توسط ارائه‌دهنده FIPS انجام شود." -msgid "Allow legacy insecure renegotiation between OpenSSL and unpatched servers only." +msgid "" +"Allow legacy insecure renegotiation between OpenSSL and unpatched servers " +"only." msgstr "" +"فقط اجازه‌ی مذاکره‌ی مجدد ناامن قدیمی بین OpenSSL و سرورهای وصله‌نشده را می‌دهد." -msgid "Whether the OpenSSL library has built-in support for the *Application-Layer Protocol Negotiation* TLS extension as described in :rfc:`7301`." +msgid "" +"Whether the OpenSSL library has built-in support for the *Application-Layer " +"Protocol Negotiation* TLS extension as described in :rfc:`7301`." msgstr "" +"اینکه کتابخانه OpenSSL پشتیبانی توکار از افزونه TLS با نام *Application-" +"Layer Protocol Negotiation*، همان‌طور که در :rfc:`7301` توضیح داده شده است، " +"دارد یا خیر." -msgid "Whether the OpenSSL library has built-in support not checking subject common name and :attr:`SSLContext.hostname_checks_common_name` is writeable." +msgid "" +"Whether the OpenSSL library has built-in support not checking subject " +"common name and :attr:`SSLContext.hostname_checks_common_name` is writeable." msgstr "" +"اینکه کتابخانه‌ی OpenSSL پشتیبانی توکار برای بررسی نکردن نام مشترک موضوع دارد " +"و :attr:`SSLContext.hostname_checks_common_name` قابل نوشتن است." -msgid "Whether the OpenSSL library has built-in support for the Elliptic Curve-based Diffie-Hellman key exchange. This should be true unless the feature was explicitly disabled by the distributor." +msgid "" +"Whether the OpenSSL library has built-in support for the Elliptic Curve-" +"based Diffie-Hellman key exchange. This should be true unless the feature " +"was explicitly disabled by the distributor." msgstr "" +"اینکه کتابخانه OpenSSL از تبادل کلید دیفی-هلمن مبتنی بر منحنی بیضوی " +"(Elliptic Curve-based Diffie-Hellman key exchange) پشتیبانی توکار دارد. این " +"باید true باشد، مگر اینکه این قابلیت به‌صراحت توسط توزیع‌کننده غیرفعال شده " +"باشد." -msgid "Whether the OpenSSL library has built-in support for the *Server Name Indication* extension (as defined in :rfc:`6066`)." +msgid "" +"Whether the OpenSSL library has built-in support for the *Server Name " +"Indication* extension (as defined in :rfc:`6066`)." msgstr "" +"اینکه آیا کتابخانه‌ی OpenSSL پشتیبانی توکار از افزونه‌ی *Server Name " +"Indication* دارد (همان‌طور که در :rfc:`6066` تعریف شده است)." -msgid "Whether the OpenSSL library has built-in support for the *Next Protocol Negotiation* as described in the `Application Layer Protocol Negotiation `_. When true, you can use the :meth:`SSLContext.set_npn_protocols` method to advertise which protocols you want to support." -msgstr "" +msgid "" +"Whether the OpenSSL library has built-in support for the *Next Protocol " +"Negotiation* as described in the `Application Layer Protocol Negotiation " +"`_. " +"When true, you can use the :meth:`SSLContext.set_npn_protocols` method to " +"advertise which protocols you want to support." +msgstr "" +"اینکه آیا کتابخانه OpenSSL پشتیبانی توکار از *Next Protocol Negotiation* را " +"دارد یا خیر، همان‌طور که در `Application Layer Protocol Negotiation `_ توضیح داده " +"شده است. هنگامی که true باشد، می‌توانید از " +"متد :meth:`SSLContext.set_npn_protocols` برای اعلام پروتکل‌هایی که می‌خواهید " +"پشتیبانی کنید، استفاده کنید." -msgid "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." +msgid "" +"Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "" +"این‌که آیا کتابخانه OpenSSL پشتیبانی توکار از پروتکل SSL 2.0 دارد یا خیر." -msgid "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." -msgstr "" +msgid "" +"Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." +msgstr "این‌که آیا کتابخانه OpenSSL پشتیبانی توکار از پروتکل SSL 3.0 دارد." -msgid "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." +msgid "" +"Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "" +"اینکه کتابخانه OpenSSL پشتیبانی توکار برای پروتکل TLS 1.0 دارد یا خیر." -msgid "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." +msgid "" +"Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "" +"اینکه آیا کتابخانه‌ی OpenSSL از پروتکل TLS 1.1 پشتیبانی توکار دارد یا خیر." -msgid "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." -msgstr "" +msgid "" +"Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." +msgstr "اینکه آیا کتابخانه OpenSSL از پروتکل TLS 1.2 پشتیبانی توکار دارد." -msgid "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." -msgstr "" +msgid "" +"Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." +msgstr "اینکه کتابخانه OpenSSL از پروتکل TLS 1.3 به‌صورت توکار پشتیبانی می‌کند." msgid "Whether the OpenSSL library has built-in support for TLS-PSK." -msgstr "" +msgstr "اینکه آیا کتابخانه‌ی OpenSSL پشتیبانی توکار از TLS-PSK دارد یا خیر." msgid "Whether the OpenSSL library has built-in support for TLS-PHA." -msgstr "" +msgstr "اینکه کتابخانه OpenSSL پشتیبانی توکار از TLS-PHA دارد یا خیر." -msgid "List of supported TLS channel binding types. Strings in this list can be used as arguments to :meth:`SSLSocket.get_channel_binding`." +msgid "" +"List of supported TLS channel binding types. Strings in this list can be " +"used as arguments to :meth:`SSLSocket.get_channel_binding`." msgstr "" +"فهرست انواع پشتیبانی‌شده‌ی اتصال کانال TLS (channel binding). رشته‌های موجود در " +"این فهرست می‌توانند به‌عنوان آرگومان " +"برای :meth:`SSLSocket.get_channel_binding` استفاده شوند." msgid "The version string of the OpenSSL library loaded by the interpreter::" -msgstr "" +msgstr "رشته‌ی نسخه‌ی کتابخانه‌ی OpenSSL بارگذاری‌شده توسط مفسر::" msgid "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" msgstr "" +">>> ssl.OPENSSL_VERSION\n" +"'OpenSSL 1.0.2k 26 Jan 2017'" -msgid "A tuple of five integers representing version information about the OpenSSL library::" +msgid "" +"A tuple of five integers representing version information about the OpenSSL " +"library::" msgstr "" +"یک تاپل از پنج عدد صحیح که اطلاعات نسخه درباره کتابخانه OpenSSL را نشان " +"می‌دهد::" msgid "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" msgstr "" +">>> ssl.OPENSSL_VERSION_INFO\n" +"(1, 0, 2, 11, 15)" msgid "The raw version number of the OpenSSL library, as a single integer::" -msgstr "" +msgstr "شماره نسخه‌ی خام کتابخانه‌ی OpenSSL، به‌عنوان یک عدد صحیح::" msgid "" ">>> ssl.OPENSSL_VERSION_NUMBER\n" @@ -582,171 +1297,374 @@ msgid "" ">>> hex(ssl.OPENSSL_VERSION_NUMBER)\n" "'0x100020bf'" msgstr "" +">>> ssl.OPENSSL_VERSION_NUMBER\n" +"268443839\n" +">>> hex(ssl.OPENSSL_VERSION_NUMBER)\n" +"'0x100020bf'" -msgid "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry `_ contains this list and references to the RFCs where their meaning is defined." +msgid "" +"Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert " +"Registry `_ contains this list and references to the " +"RFCs where their meaning is defined." msgstr "" +"توضیحات هشدارها از :rfc:`5246` و سایر موارد. `IANA TLS Alert Registry " +"`_ شامل این فهرست و ارجاع‌ها به RFCهایی است که معنای آن‌ها در " +"آن‌ها تعریف شده است." -msgid "Used as the return value of the callback function in :meth:`SSLContext.set_servername_callback`." +msgid "" +"Used as the return value of the callback function " +"in :meth:`SSLContext.set_servername_callback`." msgstr "" +"به‌عنوان مقدار بازگشتی تابع کال‌بک " +"در :meth:`SSLContext.set_servername_callback` استفاده می‌شود." msgid ":class:`enum.IntEnum` collection of ALERT_DESCRIPTION_* constants." msgstr "" +"مجموعه‌ای از ثابت‌های ALERT_DESCRIPTION_* از کلاس :class:`enum.IntEnum`." -msgid "Option for :func:`create_default_context` and :meth:`SSLContext.load_default_certs`. This value indicates that the context may be used to authenticate web servers (therefore, it will be used to create client-side sockets)." +msgid "" +"Option for :func:`create_default_context` " +"and :meth:`SSLContext.load_default_certs`. This value indicates that the " +"context may be used to authenticate web servers (therefore, it will be used " +"to create client-side sockets)." msgstr "" +"گزینه‌ای برای :func:`create_default_context` " +"و :meth:`SSLContext.load_default_certs`. این مقدار نشان می‌دهد که زمینه ممکن " +"است برای احراز هویت سرورهای وب استفاده شود (بنابراین، برای ایجاد سوکت‌های " +"سمت کلاینت استفاده خواهد شد)." -msgid "Option for :func:`create_default_context` and :meth:`SSLContext.load_default_certs`. This value indicates that the context may be used to authenticate web clients (therefore, it will be used to create server-side sockets)." +msgid "" +"Option for :func:`create_default_context` " +"and :meth:`SSLContext.load_default_certs`. This value indicates that the " +"context may be used to authenticate web clients (therefore, it will be used " +"to create server-side sockets)." msgstr "" +"گزینه‌ای برای :func:`create_default_context` " +"و :meth:`SSLContext.load_default_certs`. این مقدار نشان می‌دهد که ممکن است " +"از زمینه برای احراز هویت کلاینت‌های وب استفاده شود (بنابراین، برای ایجاد " +"سوکت‌های سمت سرور استفاده خواهد شد)." msgid ":class:`enum.IntEnum` collection of SSL_ERROR_* constants." -msgstr "" +msgstr ":class:`enum.IntEnum` مجموعه‌ای از ثابت‌های SSL_ERROR_*." -msgid ":class:`enum.IntEnum` collection of SSL and TLS versions for :attr:`SSLContext.maximum_version` and :attr:`SSLContext.minimum_version`." +msgid "" +":class:`enum.IntEnum` collection of SSL and TLS versions " +"for :attr:`SSLContext.maximum_version` " +"and :attr:`SSLContext.minimum_version`." msgstr "" +":class:`enum.IntEnum` مجموعه‌ای از نسخه‌های SSL و TLS " +"برای :attr:`SSLContext.maximum_version` " +"و :attr:`SSLContext.minimum_version`." -msgid "The minimum or maximum supported SSL or TLS version. These are magic constants. Their values don't reflect the lowest and highest available TLS/SSL versions." +msgid "" +"The minimum or maximum supported SSL or TLS version. These are magic " +"constants. Their values don't reflect the lowest and highest available TLS/" +"SSL versions." msgstr "" +"حداقل یا حداکثر نسخه‌ی پشتیبانی‌شده‌ی SSL یا TLS. این‌ها ثابت‌های جادویی هستند. " +"مقدارهای آن‌ها پایین‌ترین و بالاترین نسخه‌های در دسترس TLS/SSL را نشان نمی‌دهند." msgid "SSL 3.0 to TLS 1.3." -msgstr "" +msgstr "SSL 3.0 تا TLS 1.3." -msgid "All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` and :attr:`TLSVersion.TLSv1_3` are deprecated." +msgid "" +"All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` " +"and :attr:`TLSVersion.TLSv1_3` are deprecated." msgstr "" +"همه‌ی اعضای :class:`TLSVersion` به‌جز :attr:`TLSVersion.TLSv1_2` " +"و :attr:`TLSVersion.TLSv1_3` منسوخ شده‌اند." msgid "SSL sockets" -msgstr "" +msgstr "سوکت‌های SSL" msgid "SSL sockets provide the following methods of :ref:`socket-objects`:" -msgstr "" +msgstr "سوکت‌های SSL، متدهای زیر از :ref:`socket-objects` را ارائه می‌دهند:" msgid ":meth:`~socket.socket.accept`" -msgstr "" +msgstr ":meth:`~socket.socket.accept`" msgid ":meth:`~socket.socket.bind`" -msgstr "" +msgstr ":meth:`~socket.socket.bind`" msgid ":meth:`~socket.socket.close`" -msgstr "" +msgstr ":meth:`~socket.socket.close`" msgid ":meth:`~socket.socket.connect`" -msgstr "" +msgstr ":meth:`~socket.socket.connect`" msgid ":meth:`~socket.socket.detach`" -msgstr "" +msgstr ":meth:`~socket.socket.detach`" msgid ":meth:`~socket.socket.fileno`" -msgstr "" +msgstr ":meth:`~socket.socket.fileno`" msgid ":meth:`~socket.socket.getpeername`, :meth:`~socket.socket.getsockname`" -msgstr "" +msgstr ":meth:`~socket.socket.getpeername`, :meth:`~socket.socket.getsockname`" msgid ":meth:`~socket.socket.getsockopt`, :meth:`~socket.socket.setsockopt`" -msgstr "" +msgstr ":meth:`~socket.socket.getsockopt`, :meth:`~socket.socket.setsockopt`" msgid ":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:`~socket.socket.setblocking`" -msgstr "" +msgstr ":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:`~socket.socket.setblocking`" msgid ":meth:`~socket.socket.listen`" -msgstr "" +msgstr ":meth:`~socket.socket.listen`" msgid ":meth:`~socket.socket.makefile`" -msgstr "" +msgstr ":meth:`~socket.socket.makefile`" -msgid ":meth:`~socket.socket.recv`, :meth:`~socket.socket.recv_into` (but passing a non-zero ``flags`` argument is not allowed)" +msgid "" +":meth:`~socket.socket.recv`, :meth:`~socket.socket.recv_into` (but passing " +"a non-zero ``flags`` argument is not allowed)" msgstr "" +":meth:`~socket.socket.recv`، :meth:`~socket.socket.recv_into` (اما ارسال " +"مقدار غیرصفر برای آرگومان ``flags`` مجاز نیست)" -msgid ":meth:`~socket.socket.send`, :meth:`~socket.socket.sendall` (with the same limitation)" +msgid "" +":meth:`~socket.socket.send`, :meth:`~socket.socket.sendall` (with the same " +"limitation)" msgstr "" +":meth:`~socket.socket.send`، :meth:`~socket.socket.sendall` (با همان " +"محدودیت)" -msgid ":meth:`~socket.socket.sendfile` (but :mod:`os.sendfile` will be used for plain-text sockets only, else :meth:`~socket.socket.send` will be used)" +msgid "" +":meth:`~socket.socket.sendfile` (but :mod:`os.sendfile` will be used for " +"plain-text sockets only, else :meth:`~socket.socket.send` will be used)" msgstr "" +":meth:`~socket.socket.sendfile` (اما :mod:`os.sendfile` فقط برای سوکت‌های " +"متن ساده استفاده خواهد شد، در غیر این صورت :meth:`~socket.socket.send` " +"استفاده خواهد شد)" msgid ":meth:`~socket.socket.shutdown`" -msgstr "" +msgstr ":meth:`~socket.socket.shutdown`" -msgid "However, since the SSL (and TLS) protocol has its own framing atop of TCP, the SSL sockets abstraction can, in certain respects, diverge from the specification of normal, OS-level sockets. See especially the :ref:`notes on non-blocking sockets `." +msgid "" +"However, since the SSL (and TLS) protocol has its own framing atop of TCP, " +"the SSL sockets abstraction can, in certain respects, diverge from the " +"specification of normal, OS-level sockets. See especially the :ref:`notes " +"on non-blocking sockets `." msgstr "" +"با این حال، از آن‌جا که پروتکل SSL (و TLS) قاب‌بندی خاص خود را بر فراز TCP " +"دارد، انتزاع سوکت‌های SSL می‌تواند از برخی جهات با مشخصات سوکت‌های عادی در سطح " +"سیستم‌عامل متفاوت باشد. به‌ویژه :ref:`یادداشت‌ها درباره سوکت‌های غیرمسدودکننده " +"` را ببینید." -msgid "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext.wrap_socket` method." +msgid "" +"Instances of :class:`SSLSocket` must be created using " +"the :meth:`SSLContext.wrap_socket` method." msgstr "" +"نمونه‌های :class:`SSLSocket` باید با استفاده از " +"متد :meth:`SSLContext.wrap_socket` ایجاد شوند." msgid "The :meth:`sendfile` method was added." -msgstr "" +msgstr "متد :meth:`sendfile` افزوده شد." -msgid "The :meth:`shutdown` does not reset the socket timeout each time bytes are received or sent. The socket timeout is now the maximum total duration of the shutdown." +msgid "" +"The :meth:`shutdown` does not reset the socket timeout each time bytes are " +"received or sent. The socket timeout is now the maximum total duration of " +"the shutdown." msgstr "" +":meth:`shutdown` هر بار که بایت‌هایی دریافت یا ارسال می‌شوند، مهلت زمانی سوکت را " +"بازنشانی نمی‌کند. مهلت زمانی سوکت اکنون حداکثر مدت‌زمان کل خاموش‌سازی است." -msgid "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:`SSLContext.wrap_socket` to wrap a socket." +msgid "" +"It is deprecated to create a :class:`SSLSocket` instance directly, " +"use :meth:`SSLContext.wrap_socket` to wrap a socket." msgstr "" +"ایجاد مستقیم یک نمونه‌ی :class:`SSLSocket` منسوخ شده است؛ برای پیچیدن (wrap) " +"یک سوکت از :meth:`SSLContext.wrap_socket` استفاده کنید." -msgid ":class:`SSLSocket` instances must be created with :meth:`~SSLContext.wrap_socket`. In earlier versions, it was possible to create instances directly. This was never documented or officially supported." +msgid "" +":class:`SSLSocket` instances must be created " +"with :meth:`~SSLContext.wrap_socket`. In earlier versions, it was possible " +"to create instances directly. This was never documented or officially " +"supported." msgstr "" +"نمونه‌های :class:`SSLSocket` باید با :meth:`~SSLContext.wrap_socket` ایجاد " +"شوند. در نسخه‌های پیشین، امکان ایجاد مستقیم نمونه‌ها وجود داشت. این مورد هرگز " +"مستند نشده بود یا به‌صورت رسمی پشتیبانی نمی‌شد." -msgid "Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The functions support reading and writing of data larger than 2 GB. Writing zero-length data no longer fails with a protocol violation error." +msgid "" +"Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The " +"functions support reading and writing of data larger than 2 GB. Writing " +"zero-length data no longer fails with a protocol violation error." msgstr "" +"پایتون اکنون به‌صورت داخلی از ``SSL_read_ex`` و ``SSL_write_ex`` استفاده " +"می‌کند. این توابع از خواندن و نوشتن داده‌های بزرگ‌تر از ۲ GB پشتیبانی می‌کنند. " +"نوشتن داده با طول صفر دیگر با خطای نقض پروتکل شکست نمی‌خورد." msgid "SSL sockets also have the following additional methods and attributes:" -msgstr "" +msgstr "سوکت‌های SSL همچنین دارای متدها و ویژگی‌های اضافی زیر هستند:" -msgid "Read up to *len* bytes of data from the SSL socket and return the result as a ``bytes`` instance. If *buffer* is specified, then read into the buffer instead, and return the number of bytes read." +msgid "" +"Read up to *len* bytes of data from the SSL socket and return the result as " +"a ``bytes`` instance. If *buffer* is specified, then read into the buffer " +"instead, and return the number of bytes read." msgstr "" +"حداکثر تا *len* بایت داده را از سوکت SSL می‌خواند و نتیجه را به‌صورت یک نمونه " +"``bytes`` برمی‌گرداند. اگر *buffer* مشخص شده باشد، در عوض داده‌ها را در بافر " +"می‌خواند و تعداد بایت‌های خوانده‌شده را برمی‌گرداند." -msgid "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :ref:`non-blocking ` and the read would block." +msgid "" +"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket " +"is :ref:`non-blocking ` and the read would block." msgstr "" +"اگر سوکت :ref:`غیرمسدودکننده ` باشد و خواندن مسدود " +"شود، :exc:`SSLWantReadError` یا :exc:`SSLWantWriteError` را پرتاب می‌کند." -msgid "As at any time a re-negotiation is possible, a call to :meth:`read` can also cause write operations." +msgid "" +"As at any time a re-negotiation is possible, a call to :meth:`read` can " +"also cause write operations." msgstr "" +"از آن‌جا که در هر زمان امکان مذاکره‌ی مجدد وجود دارد، فراخوانی :meth:`read` " +"می‌تواند باعث انجام عملیات نوشتن نیز شود." -msgid "The socket timeout is no longer reset each time bytes are received or sent. The socket timeout is now the maximum total duration to read up to *len* bytes." +msgid "" +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration to read up to *len* " +"bytes." msgstr "" +"مهلت سوکت دیگر هر بار که بایت‌هایی دریافت یا ارسال می‌شوند بازنشانی نمی‌شود. " +"مهلت سوکت اکنون حداکثر مدت‌زمان کل برای خواندن تا *len* بایت است." msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "" +"به‌جای :meth:`~SSLSocket.read <~SSLSocket.recv>` از :meth:`~SSLSocket.recv " +"<~SSLSocket.read>` استفاده کنید." -msgid "Write *data* to the SSL socket and return the number of bytes written. The *data* argument must be an object supporting the buffer interface." +msgid "" +"Write *data* to the SSL socket and return the number of bytes written. The " +"*data* argument must be an object supporting the buffer interface." msgstr "" +"*data* را روی سوکت SSL می‌نویسد و تعداد بایت‌های نوشته‌شده را برمی‌گرداند. " +"آرگومان *data* باید شیءای باشد که رابط بافر (buffer interface) را پشتیبانی " +"می‌کند." -msgid "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :ref:`non-blocking ` and the write would block." +msgid "" +"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket " +"is :ref:`non-blocking ` and the write would block." msgstr "" +"اگر سوکت :ref:`غیرمسدودکننده ` باشد و نوشتن باعث مسدود شدن " +"شود، :exc:`SSLWantReadError` یا :exc:`SSLWantWriteError` پرتاب می‌شود." -msgid "As at any time a re-negotiation is possible, a call to :meth:`write` can also cause read operations." +msgid "" +"As at any time a re-negotiation is possible, a call to :meth:`write` can " +"also cause read operations." msgstr "" +"از آن‌جا که در هر زمان امکان مذاکره‌ی مجدد وجود دارد، فراخوانی :meth:`write` " +"نیز می‌تواند باعث انجام عملیات خواندن شود." -msgid "The socket timeout is no longer reset each time bytes are received or sent. The socket timeout is now the maximum total duration to write *data*." +msgid "" +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration to write *data*." msgstr "" +"مهلت سوکت دیگر هر بار که بایت‌هایی دریافت یا ارسال می‌شوند، بازنشانی نمی‌شود. " +"مهلت سوکت اکنون حداکثر مدت‌زمان کل برای نوشتن *data* است." msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "" +"از :meth:`~SSLSocket.send` به جای :meth:`~SSLSocket.write` استفاده کنید." -msgid "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-level methods that read and write unencrypted, application-level data and decrypt/encrypt it to encrypted, wire-level data. These methods require an active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket.unwrap` was not called." -msgstr "" +msgid "" +"The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the " +"low-level methods that read and write unencrypted, application-level data " +"and decrypt/encrypt it to encrypted, wire-level data. These methods require " +"an active SSL connection, i.e. the handshake was completed " +"and :meth:`SSLSocket.unwrap` was not called." +msgstr "" +"متدهای :meth:`~SSLSocket.read` و :meth:`~SSLSocket.write` متدهای سطح پایینی " +"هستند که داده‌های رمزنگاری‌نشده در سطح کاربرد را می‌خوانند و می‌نویسند و آن‌ها " +"را به داده‌های رمزنگاری‌شده در سطح سیم رمزگشایی/رمزنگاری می‌کنند. این متدها به " +"یک اتصال SSL فعال نیاز دارند، یعنی دست‌دهی کامل شده باشد " +"و :meth:`SSLSocket.unwrap` فراخوانی نشده باشد." -msgid "Normally you should use the socket API methods like :meth:`~socket.socket.recv` and :meth:`~socket.socket.send` instead of these methods." +msgid "" +"Normally you should use the socket API methods " +"like :meth:`~socket.socket.recv` and :meth:`~socket.socket.send` instead of " +"these methods." msgstr "" +"معمولاً باید به‌جای این متدها از متدهای API سوکت " +"مانند :meth:`~socket.socket.recv` و :meth:`~socket.socket.send` استفاده " +"کنید." msgid "Perform the SSL setup handshake." -msgstr "" +msgstr "دست‌دهی (handshake) راه‌اندازی SSL را انجام دهید." -msgid "If *block* is true and the timeout obtained by :meth:`~socket.socket.gettimeout` is zero, the socket is set in blocking mode until the handshake is performed." +msgid "" +"If *block* is true and the timeout obtained " +"by :meth:`~socket.socket.gettimeout` is zero, the socket is set in blocking " +"mode until the handshake is performed." msgstr "" +"اگر *block* صحیح باشد و مهلت زمانی دریافت‌شده " +"از :meth:`~socket.socket.gettimeout` صفر باشد، سوکت تا انجام دست‌دهی در " +"حالت مسدودکننده تنظیم می‌شود." -msgid "The handshake method also performs :func:`!match_hostname` when the :attr:`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket.context` is true." +msgid "" +"The handshake method also performs :func:`!match_hostname` when " +"the :attr:`~SSLContext.check_hostname` attribute of the " +"socket's :attr:`~SSLSocket.context` is true." msgstr "" +"متد دست‌دهی (handshake) همچنین هنگامی که " +"ویژگی :attr:`~SSLContext.check_hostname` در :attr:`~SSLSocket.context` سوکت " +"true باشد، :func:`!match_hostname` را اجرا می‌کند." -msgid "The socket timeout is no longer reset each time bytes are received or sent. The socket timeout is now the maximum total duration of the handshake." +msgid "" +"The socket timeout is no longer reset each time bytes are received or sent. " +"The socket timeout is now the maximum total duration of the handshake." msgstr "" +"مهلت زمانی سوکت دیگر هر بار که بایت‌ها دریافت یا ارسال می‌شوند، بازنشانی " +"نمی‌شود. مهلت زمانی سوکت اکنون حداکثر مدت‌زمان کل دست‌دهی است." -msgid "Hostname or IP address is matched by OpenSSL during handshake. The function :func:`!match_hostname` is no longer used. In case OpenSSL refuses a hostname or IP address, the handshake is aborted early and a TLS alert message is sent to the peer." +msgid "" +"Hostname or IP address is matched by OpenSSL during handshake. The " +"function :func:`!match_hostname` is no longer used. In case OpenSSL refuses " +"a hostname or IP address, the handshake is aborted early and a TLS alert " +"message is sent to the peer." msgstr "" +"نام میزبان یا نشانی IP در طول دست‌دهی (handshake) توسط OpenSSL تطبیق داده " +"می‌شود. دیگر از تابع :func:`!match_hostname` استفاده نمی‌شود. در صورتی که " +"OpenSSL یک نام میزبان یا نشانی IP را رد کند، دست‌دهی در مراحل اولیه قطع " +"می‌شود و یک پیام هشدار TLS به طرف مقابل ارسال می‌شود." -msgid "If there is no certificate for the peer on the other end of the connection, return ``None``. If the SSL handshake hasn't been done yet, raise :exc:`ValueError`." +msgid "" +"If there is no certificate for the peer on the other end of the connection, " +"return ``None``. If the SSL handshake hasn't been done yet, " +"raise :exc:`ValueError`." msgstr "" +"اگر گواهی برای همتای سمت دیگر اتصال وجود نداشته باشد، ``None`` را " +"برمی‌گرداند. اگر دست‌دهی SSL هنوز انجام نشده باشد، :exc:`ValueError` را پرتاب " +"می‌کند." -msgid "If the ``binary_form`` parameter is :const:`False`, and a certificate was received from the peer, this method returns a :class:`dict` instance. If the certificate was not validated, the dict is empty. If the certificate was validated, it returns a dict with several keys, amongst them ``subject`` (the principal for which the certificate was issued) and ``issuer`` (the principal issuing the certificate). If a certificate contains an instance of the *Subject Alternative Name* extension (see :rfc:`3280`), there will also be a ``subjectAltName`` key in the dictionary." -msgstr "" +msgid "" +"If the ``binary_form`` parameter is :const:`False`, and a certificate was " +"received from the peer, this method returns a :class:`dict` instance. If " +"the certificate was not validated, the dict is empty. If the certificate " +"was validated, it returns a dict with several keys, amongst them " +"``subject`` (the principal for which the certificate was issued) and " +"``issuer`` (the principal issuing the certificate). If a certificate " +"contains an instance of the *Subject Alternative Name* extension " +"(see :rfc:`3280`), there will also be a ``subjectAltName`` key in the " +"dictionary." +msgstr "" +"اگر پارامتر ``binary_form`` برابر :const:`False` باشد و گواهی از طرف مقابل " +"دریافت شده باشد، این متد نمونه‌ای از :class:`dict` را برمی‌گرداند. اگر گواهی " +"اعتبارسنجی نشده باشد، دیکشنری خالی است. اگر گواهی اعتبارسنجی شده باشد، یک " +"دیکشنری با چندین کلید برمی‌گرداند، از جمله ``subject`` (هویتی که گواهی برای " +"آن صادر شده است) و ``issuer`` (هویتی که گواهی را صادر کرده است). اگر گواهی " +"شامل نمونه‌ای از افزونه *Subject Alternative Name* باشد (به :rfc:`3280` " +"مراجعه کنید)، کلید ``subjectAltName`` نیز در دیکشنری وجود خواهد داشت." -msgid "The ``subject`` and ``issuer`` fields are tuples containing the sequence of relative distinguished names (RDNs) given in the certificate's data structure for the respective fields, and each RDN is a sequence of name-value pairs. Here is a real-world example::" +msgid "" +"The ``subject`` and ``issuer`` fields are tuples containing the sequence of " +"relative distinguished names (RDNs) given in the certificate's data " +"structure for the respective fields, and each RDN is a sequence of name-" +"value pairs. Here is a real-world example::" msgstr "" +"فیلدهای ``subject`` و ``issuer`` تاپل‌هایی شامل دنباله‌ای از نام‌های متمایز " +"نسبی (RDNs) هستند که در ساختار داده‌ی گواهی برای فیلدهای مربوطه آمده‌اند، و هر " +"RDN دنباله‌ای از جفت‌های نام-مقدار است. در اینجا یک مثال واقعی آمده است::" msgid "" "{'issuer': ((('countryName', 'IL'),),\n" @@ -762,257 +1680,656 @@ msgid "" " (('countryName', 'US'),),\n" " (('stateOrProvinceName', 'California'),),\n" " (('localityName', 'San Francisco'),),\n" -" (('organizationName', 'Electronic Frontier Foundation, Inc.'),),\n" +" (('organizationName', 'Electronic Frontier Foundation, " +"Inc.'),),\n" " (('commonName', '*.eff.org'),),\n" " (('emailAddress', 'hostmaster@eff.org'),)),\n" " 'subjectAltName': (('DNS', '*.eff.org'), ('DNS', 'eff.org')),\n" " 'version': 3}" msgstr "" +"{'issuer': ((('countryName', 'IL'),),\n" +" (('organizationName', 'StartCom Ltd.'),),\n" +" (('organizationalUnitName',\n" +" 'Secure Digital Certificate Signing'),),\n" +" (('commonName',\n" +" 'StartCom Class 2 Primary Intermediate Server CA'),)),\n" +" 'notAfter': 'Nov 22 08:15:19 2013 GMT',\n" +" 'notBefore': 'Nov 21 03:09:52 2011 GMT',\n" +" 'serialNumber': '95F0',\n" +" 'subject': ((('description', '571208-SLe257oHY9fVQ07Z'),),\n" +" (('countryName', 'US'),),\n" +" (('stateOrProvinceName', 'California'),),\n" +" (('localityName', 'San Francisco'),),\n" +" (('organizationName', 'Electronic Frontier Foundation, " +"Inc.'),),\n" +" (('commonName', '*.eff.org'),),\n" +" (('emailAddress', 'hostmaster@eff.org'),)),\n" +" 'subjectAltName': (('DNS', '*.eff.org'), ('DNS', 'eff.org')),\n" +" 'version': 3}" -msgid "If the ``binary_form`` parameter is :const:`True`, and a certificate was provided, this method returns the DER-encoded form of the entire certificate as a sequence of bytes, or :const:`None` if the peer did not provide a certificate. Whether the peer provides a certificate depends on the SSL socket's role:" -msgstr "" +msgid "" +"If the ``binary_form`` parameter is :const:`True`, and a certificate was " +"provided, this method returns the DER-encoded form of the entire " +"certificate as a sequence of bytes, or :const:`None` if the peer did not " +"provide a certificate. Whether the peer provides a certificate depends on " +"the SSL socket's role:" +msgstr "" +"اگر پارامتر ``binary_form`` برابر :const:`True` باشد و گواهی‌ای ارائه " +"شده باشد، این متد قالب کدگذاری‌شده با DER کل گواهی را به‌صورت دنباله‌ای از " +"بایت‌ها بازمی‌گرداند، یا اگر همتا گواهی‌ای ارائه نکرده باشد، :const:`None` " +"بازمی‌گرداند. اینکه همتا گواهی‌ای ارائه می‌کند یا نه، به نقش سوکت SSL " +"بستگی دارد:" -msgid "for a client SSL socket, the server will always provide a certificate, regardless of whether validation was required;" +msgid "" +"for a client SSL socket, the server will always provide a certificate, " +"regardless of whether validation was required;" msgstr "" +"برای یک سوکت SSL کلاینت، سرور همیشه یک گواهی ارائه می‌دهد، صرف‌نظر از " +"اینکه اعتبارسنجی الزامی بوده باشد یا خیر؛" -msgid "for a server SSL socket, the client will only provide a certificate when requested by the server; therefore :meth:`getpeercert` will return :const:`None` if you used :const:`CERT_NONE` (rather than :const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`)." +msgid "" +"for a server SSL socket, the client will only provide a certificate when " +"requested by the server; therefore :meth:`getpeercert` will " +"return :const:`None` if you used :const:`CERT_NONE` (rather " +"than :const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`)." msgstr "" +"برای یک سوکت SSL سمت سرور، کلاینت تنها زمانی گواهی ارائه می‌دهد که سرور آن " +"را درخواست کند؛ بنابراین اگر از :const:`CERT_NONE ` " +"(به‌جای :const:`CERT_OPTIONAL ` یا :const:`CERT_REQUIRED " +"`) استفاده کرده باشید، :meth:`getpeercert` " +"مقدار :const:`None ` را برمی‌گرداند." msgid "See also :attr:`SSLContext.check_hostname`." -msgstr "" +msgstr "همچنین :attr:`SSLContext.check_hostname` را ببینید." -msgid "The returned dictionary includes additional items such as ``issuer`` and ``notBefore``." +msgid "" +"The returned dictionary includes additional items such as ``issuer`` and " +"``notBefore``." msgstr "" +"دیکشنری برگردانده‌شده شامل آیتم‌های اضافی مانند ``issuer`` و ``notBefore`` " +"می‌شود." -msgid ":exc:`ValueError` is raised when the handshake isn't done. The returned dictionary includes additional X509v3 extension items such as ``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." +msgid "" +":exc:`ValueError` is raised when the handshake isn't done. The returned " +"dictionary includes additional X509v3 extension items such as " +"``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" +"هنگامی که دست‌دهی انجام نشده باشد، :exc:`ValueError` پرتاب می‌شود. دیکشنری " +"برگردانده‌شده شامل آیتم‌های اضافی افزونه‌ی X509v3 مانند " +"``crlDistributionPoints``، ``caIssuers`` و URIهای ``OCSP`` است." msgid "IPv6 address strings no longer have a trailing new line." -msgstr "" +msgstr "رشته‌های نشانی IPv6 دیگر دارای خط جدید در انتها نیستند." -msgid "Returns verified certificate chain provided by the other end of the SSL channel as a list of DER-encoded bytes. If certificate verification was disabled method acts the same as :meth:`~SSLSocket.get_unverified_chain`." +msgid "" +"Returns verified certificate chain provided by the other end of the SSL " +"channel as a list of DER-encoded bytes. If certificate verification was " +"disabled method acts the same as :meth:`~SSLSocket.get_unverified_chain`." msgstr "" +"زنجیره‌ی گواهی تأییدشده‌ای که از سوی طرف مقابل کانال SSL ارائه شده است را " +"به‌صورت فهرستی از بایت‌های کدگذاری‌شده با DER برمی‌گرداند. اگر تأیید گواهی " +"غیرفعال شده باشد، این متد همانند :meth:`~SSLSocket.get_unverified_chain` " +"عمل می‌کند." -msgid "Returns raw certificate chain provided by the other end of the SSL channel as a list of DER-encoded bytes." +msgid "" +"Returns raw certificate chain provided by the other end of the SSL channel " +"as a list of DER-encoded bytes." msgstr "" +"زنجیره‌ی گواهی خام ارائه‌شده توسط طرف مقابل کانال SSL را به‌صورت فهرستی از " +"بایت‌های کدگذاری‌شده با DER بازمی‌گرداند." -msgid "Returns a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used. If no connection has been established, returns ``None``." +msgid "" +"Returns a three-value tuple containing the name of the cipher being used, " +"the version of the SSL protocol that defines its use, and the number of " +"secret bits being used. If no connection has been established, returns " +"``None``." msgstr "" +"یک تاپل سه‌مقداری شامل نام رمزنگار استفاده‌شده، نسخه پروتکل SSL که استفاده از " +"آن را تعریف می‌کند، و تعداد بیت‌های محرمانه استفاده‌شده را برمی‌گرداند. اگر هیچ " +"اتصالی برقرار نشده باشد، ``None`` را برمی‌گرداند." -msgid "Return the list of ciphers available in both the client and server. Each entry of the returned list is a three-value tuple containing the name of the cipher, the version of the SSL protocol that defines its use, and the number of secret bits the cipher uses. :meth:`~SSLSocket.shared_ciphers` returns ``None`` if no connection has been established or the socket is a client socket." -msgstr "" +msgid "" +"Return the list of ciphers available in both the client and server. Each " +"entry of the returned list is a three-value tuple containing the name of " +"the cipher, the version of the SSL protocol that defines its use, and the " +"number of secret bits the cipher uses. :meth:`~SSLSocket.shared_ciphers` " +"returns ``None`` if no connection has been established or the socket is a " +"client socket." +msgstr "" +"فهرست رمزنگارهای (cipher) موجود در هر دو کلاینت (client) و سرور (server) را " +"برمی‌گرداند. هر آیتم از فهرست برگردانده‌شده، یک تاپلسه‌مقداری است که " +"شامل نام رمزنگار، نسخه‌ی پروتکل SSL که استفاده از آن را تعریف می‌کند، و تعداد " +"بیت‌های محرمانه‌ای است که رمزنگار از آن‌ها استفاده " +"می‌کند. :meth:`~SSLSocket.shared_ciphers` در صورتی که هیچ اتصالی برقرار نشده " +"باشد یا سوکتاز نوع کلاینت باشد، ``None`` را برمی‌گرداند." -msgid "Return the compression algorithm being used as a string, or ``None`` if the connection isn't compressed." +msgid "" +"Return the compression algorithm being used as a string, or ``None`` if the " +"connection isn't compressed." msgstr "" +"الگوریتم فشرده‌سازی مورد استفاده را به‌صورت یک رشته برمی‌گرداند، یا اگر اتصال " +"فشرده‌نشده باشد ``None`` برمی‌گرداند." -msgid "If the higher-level protocol supports its own compression mechanism, you can use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." +msgid "" +"If the higher-level protocol supports its own compression mechanism, you " +"can use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" +"اگر پروتکل سطح بالاتر از سازوکار فشرده‌سازی خود پشتیبانی کند، می‌توانید " +"از :data:`OP_NO_COMPRESSION` برای غیرفعال کردن فشرده‌سازی سطح SSL استفاده " +"کنید." -msgid "Get channel binding data for current connection, as a bytes object. Returns ``None`` if not connected or the handshake has not been completed." +msgid "" +"Get channel binding data for current connection, as a bytes object. " +"Returns ``None`` if not connected or the handshake has not been completed." msgstr "" +"داده‌های پیوند کانال (channel binding) را برای اتصال جاری، به‌صورت یک شیء " +"بایتی (bytes) دریافت می‌کند. اگر اتصال برقرار نباشد یا دست‌دهی کامل نشده " +"باشد، ``None`` برمی‌گرداند." -msgid "The *cb_type* parameter allow selection of the desired channel binding type. Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` list. Currently only the 'tls-unique' channel binding, defined by :rfc:`5929`, is supported. :exc:`ValueError` will be raised if an unsupported channel binding type is requested." -msgstr "" +msgid "" +"The *cb_type* parameter allow selection of the desired channel binding " +"type. Valid channel binding types are listed in " +"the :data:`CHANNEL_BINDING_TYPES` list. Currently only the 'tls-unique' " +"channel binding, defined by :rfc:`5929`, is supported. :exc:`ValueError` " +"will be raised if an unsupported channel binding type is requested." +msgstr "" +"پارامتر *cb_type* امکان انتخاب نوع اتصال کانال (channel binding) دلخواه را " +"فراهم می‌کند. انواع معتبر اتصال کانال (channel binding) در " +"فهرست :data:`CHANNEL_BINDING_TYPES` آمده‌اند. در حال حاضر تنها اتصال کانال " +"(channel binding) 'tls-unique'، که در :rfc:`5929` تعریف شده است، پشتیبانی " +"می‌شود. اگر یک نوع اتصال کانال (channel binding) پشتیبانی‌نشده درخواست " +"شود، :exc:`ValueError` پرتاب می‌شود." -msgid "Return the protocol that was selected during the TLS handshake. If :meth:`SSLContext.set_alpn_protocols` was not called, if the other party does not support ALPN, if this socket does not support any of the client's proposed protocols, or if the handshake has not happened yet, ``None`` is returned." -msgstr "" +msgid "" +"Return the protocol that was selected during the TLS handshake. " +"If :meth:`SSLContext.set_alpn_protocols` was not called, if the other party " +"does not support ALPN, if this socket does not support any of the client's " +"proposed protocols, or if the handshake has not happened yet, ``None`` is " +"returned." +msgstr "" +"پروتکل انتخاب‌شده در جریان دست‌دهی TLS را برمی‌گرداند. " +"اگر :meth:`SSLContext.set_alpn_protocols` فراخوانی نشده باشد، اگر طرف مقابل " +"از ALPN پشتیبانی نکند، اگر این سوکت از هیچ‌یک از پروتکل‌های پیشنهادی کارخواه " +"پشتیبانی نکند، یا اگر دست‌دهی هنوز انجام نشده باشد، ``None`` برگردانده " +"می‌شود." -msgid "Return the higher-level protocol that was selected during the TLS/SSL handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the other party does not support NPN, or if the handshake has not yet happened, this will return ``None``." +msgid "" +"Return the higher-level protocol that was selected during the TLS/SSL " +"handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if " +"the other party does not support NPN, or if the handshake has not yet " +"happened, this will return ``None``." msgstr "" +"پروتکل سطح بالاتری را که در جریان دست‌دهی TLS/SSL انتخاب شده است، " +"برمی‌گرداند. اگر :meth:`SSLContext.set_npn_protocols` فراخوانی نشده باشد، یا " +"طرف مقابل از NPN پشتیبانی نکند، یا دست‌دهی هنوز انجام نشده باشد، ``None`` " +"برمی‌گرداند." msgid "NPN has been superseded by ALPN" -msgstr "" +msgstr "NPN با ALPN جایگزین شده است" -msgid "Performs the SSL shutdown handshake, which removes the TLS layer from the underlying socket, and returns the underlying socket object. This can be used to go from encrypted operation over a connection to unencrypted. The returned socket should always be used for further communication with the other side of the connection, rather than the original socket." -msgstr "" +msgid "" +"Performs the SSL shutdown handshake, which removes the TLS layer from the " +"underlying socket, and returns the underlying socket object. This can be " +"used to go from encrypted operation over a connection to unencrypted. The " +"returned socket should always be used for further communication with the " +"other side of the connection, rather than the original socket." +msgstr "" +"دست‌دهی خاموش‌سازی SSL را انجام می‌دهد، که لایه TLS را از سوکت زیرین برمی‌دارد " +"و شیء سوکت زیرین را برمی‌گرداند. می‌توان از آن برای گذار از عملیات " +"رمزگذاری‌شده بر بستر یک اتصال به عملیات رمزگذاری‌نشده استفاده کرد. همیشه باید " +"برای ارتباط بیشتر با طرف دیگر اتصال، به‌جای سوکت اصلی از سوکت برگردانده‌شده " +"استفاده شود." -msgid "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can only be initiated for a TLS 1.3 connection from a server-side socket, after the initial TLS handshake and with PHA enabled on both sides, see :attr:`SSLContext.post_handshake_auth`." +msgid "" +"Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " +"only be initiated for a TLS 1.3 connection from a server-side socket, after " +"the initial TLS handshake and with PHA enabled on both sides, " +"see :attr:`SSLContext.post_handshake_auth`." msgstr "" +"احراز هویت پس از دست‌دهی (PHA) را از یک کلاینت TLS 1.3 درخواست می‌کند. PHA " +"فقط می‌تواند از یک سوکت سمت سرور برای یک اتصال TLS 1.3، پس از دست‌دهی اولیه‌ی " +"TLS و با فعال بودن PHA در هر دو طرف آغاز " +"شود؛ :attr:`SSLContext.post_handshake_auth` را ببینید." -msgid "The method does not perform a cert exchange immediately. The server-side sends a CertificateRequest during the next write event and expects the client to respond with a certificate on the next read event." +msgid "" +"The method does not perform a cert exchange immediately. The server-side " +"sends a CertificateRequest during the next write event and expects the " +"client to respond with a certificate on the next read event." msgstr "" +"این متد تبادل گواهی را بلافاصله انجام نمی‌دهد. سمت سرور یک " +"CertificateRequest را در رویداد نوشتن بعدی ارسال می‌کند و انتظار دارد کلاینت " +"در رویداد خواندن بعدی با یک گواهی پاسخ دهد." -msgid "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:`SSLError` is raised." +msgid "" +"If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), " +"an :exc:`SSLError` is raised." msgstr "" +"اگر یکی از پیش‌شرط‌ها برآورده نشود (مثلاً TLS 1.3 نباشد یا PHA فعال نباشد)، " +"یک :exc:`SSLError` پرتاب می‌شود." -msgid "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 support, the method raises :exc:`NotImplementedError`." +msgid "" +"Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " +"support, the method raises :exc:`NotImplementedError`." msgstr "" +"فقط زمانی در دسترس است که OpenSSL 1.1.1 و TLS 1.3 فعال باشند. بدون پشتیبانی " +"از TLS 1.3، این متد استثنای :exc:`NotImplementedError` را پرتاب می‌کند." -msgid "Return the actual SSL protocol version negotiated by the connection as a string, or ``None`` if no secure connection is established. As of this writing, possible return values include ``\"SSLv2\"``, ``\"SSLv3\"``, ``\"TLSv1\"``, ``\"TLSv1.1\"`` and ``\"TLSv1.2\"``. Recent OpenSSL versions may define more return values." -msgstr "" +msgid "" +"Return the actual SSL protocol version negotiated by the connection as a " +"string, or ``None`` if no secure connection is established. As of this " +"writing, possible return values include ``\"SSLv2\"``, ``\"SSLv3\"``, " +"``\"TLSv1\"``, ``\"TLSv1.1\"`` and ``\"TLSv1.2\"``. Recent OpenSSL versions " +"may define more return values." +msgstr "" +"نسخه‌ی واقعی پروتکل SSL را که در اتصال توافق‌شده است، به‌صورت یک رشته " +"برمی‌گرداند، یا اگر هیچ اتصال امنی برقرار نباشد، ``None`` برمی‌گرداند. در " +"زمان نگارش این متن، مقادیر بازگشتی ممکن شامل ``\"SSLv2\"``، ``\"SSLv3\"``، " +"``\"TLSv1\"``، ``\"TLSv1.1\"`` و ``\"TLSv1.2\"`` هستند. نسخه‌های جدید " +"OpenSSL ممکن است مقادیر بازگشتی بیشتری تعریف کنند." -msgid "Returns the number of already decrypted bytes available for read, pending on the connection." +msgid "" +"Returns the number of already decrypted bytes available for read, pending " +"on the connection." msgstr "" +"تعداد بایت‌های از پیش رمزگشایی‌شده‌ی موجود برای خواندن را که روی اتصال در " +"انتظار هستند بازمی‌گرداند." msgid "The :class:`SSLContext` object this SSL socket is tied to." -msgstr "" +msgstr "شیء :class:`SSLContext` که این سوکت SSL به آن وابسته است." -msgid "A boolean which is ``True`` for server-side sockets and ``False`` for client-side sockets." +msgid "" +"A boolean which is ``True`` for server-side sockets and ``False`` for " +"client-side sockets." msgstr "" +"یک بولی که برای سوکت‌های سمت سرور ``True`` و برای سوکت‌های سمت کلاینت " +"``False`` است." -msgid "Hostname of the server: :class:`str` type, or ``None`` for server-side socket or if the hostname was not specified in the constructor." +msgid "" +"Hostname of the server: :class:`str` type, or ``None`` for server-side " +"socket or if the hostname was not specified in the constructor." msgstr "" +"نام میزبان سرور: از نوع :class:`str`، یا ``None`` برای سوکت سمت سرور یا اگر " +"نام میزبان در سازنده مشخص نشده باشد." -msgid "The attribute is now always ASCII text. When ``server_hostname`` is an internationalized domain name (IDN), this attribute now stores the A-label form (``\"xn--pythn-mua.org\"``), rather than the U-label form (``\"pythön.org\"``)." +msgid "" +"The attribute is now always ASCII text. When ``server_hostname`` is an " +"internationalized domain name (IDN), this attribute now stores the A-label " +"form (``\"xn--pythn-mua.org\"``), rather than the U-label form " +"(``\"pythön.org\"``)." msgstr "" +"این ویژگی اکنون همیشه متن ASCII است. هنگامی که ``server_hostname`` یک نام " +"دامنه بین‌المللی‌شده (IDN) باشد، این ویژگی اکنون قالب A-label را ذخیره می‌کند " +"(``\"xn--pythn-mua.org\"``)، نه قالب U-label را (``\"pythön.org\"``)." -msgid "The :class:`SSLSession` for this SSL connection. The session is available for client and server side sockets after the TLS handshake has been performed. For client sockets the session can be set before :meth:`~SSLSocket.do_handshake` has been called to reuse a session." +msgid "" +"The :class:`SSLSession` for this SSL connection. The session is available " +"for client and server side sockets after the TLS handshake has been " +"performed. For client sockets the session can be set " +"before :meth:`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" +":class:`SSLSession` برای این اتصال SSL. این نشست پس از انجام دست‌دهی TLS " +"برای سوکت‌های سمت کلاینت و سرور در دسترس است. برای سوکت‌های کلاینت، می‌توان " +"نشست را پیش از فراخوانی :meth:`~SSLSocket.do_handshake` برای استفاده مجدد " +"از یک نشست تنظیم کرد." msgid "SSL contexts" -msgstr "" +msgstr "زمینه‌های SSL" -msgid "An SSL context holds various data longer-lived than single SSL connections, such as SSL configuration options, certificate(s) and private key(s). It also manages a cache of SSL sessions for server-side sockets, in order to speed up repeated connections from the same clients." +msgid "" +"An SSL context holds various data longer-lived than single SSL connections, " +"such as SSL configuration options, certificate(s) and private key(s). It " +"also manages a cache of SSL sessions for server-side sockets, in order to " +"speed up repeated connections from the same clients." msgstr "" +"یک زمینه SSL داده‌های مختلفی را با طول عمر بیشتر از یک اتصال SSL واحد نگه " +"می‌دارد، مانند گزینه‌های پیکربندی SSL، گواهی‌ها و کلیدهای خصوصی. همچنین یک " +"نهانگاه از نشست‌های SSL را برای سوکت‌های سمت سرور مدیریت می‌کند تا سرعت " +"اتصال‌های مکرر از همان کلاینت‌ها را افزایش دهد." -msgid "Create a new SSL context. You may pass *protocol* which must be one of the ``PROTOCOL_*`` constants defined in this module. The parameter specifies which version of the SSL protocol to use. Typically, the server chooses a particular protocol version, and the client must adapt to the server's choice. Most of the versions are not interoperable with the other versions. If not specified, the default is :data:`PROTOCOL_TLS`; it provides the most compatibility with other versions." -msgstr "" +msgid "" +"Create a new SSL context. You may pass *protocol* which must be one of the " +"``PROTOCOL_*`` constants defined in this module. The parameter specifies " +"which version of the SSL protocol to use. Typically, the server chooses a " +"particular protocol version, and the client must adapt to the server's " +"choice. Most of the versions are not interoperable with the other " +"versions. If not specified, the default is :data:`PROTOCOL_TLS`; it " +"provides the most compatibility with other versions." +msgstr "" +"یک زمینه SSL جدید ایجاد کنید. می‌توانید *protocol* را ارسال کنید که باید یکی " +"از ثابت‌های ``PROTOCOL_*`` تعریف‌شده در این ماژول باشد. این پارامتر مشخص " +"می‌کند که از کدام نسخه از پروتکل SSL استفاده شود. معمولاً، سرور یک نسخه خاص " +"از پروتکل را انتخاب می‌کند و کلاینت باید خود را با انتخاب سرور سازگار کند. " +"بیشتر نسخه‌ها با سایر نسخه‌ها تعامل‌پذیر نیستند. اگر مشخص نشده باشد، مقدار " +"پیش‌فرض :data:`PROTOCOL_TLS` است؛ این مقدار بیشترین سازگاری را با سایر " +"نسخه‌ها فراهم می‌کند." -msgid "Here's a table showing which versions in a client (down the side) can connect to which versions in a server (along the top):" +msgid "" +"Here's a table showing which versions in a client (down the side) can " +"connect to which versions in a server (along the top):" msgstr "" +"در اینجا جدولی آمده است که نشان می‌دهد کدام نسخه‌ها در یک کلاینت (در ستون " +"کناری) می‌توانند به کدام نسخه‌ها در یک سرور (در ردیف بالایی) متصل شوند:" msgid "*client* / **server**" -msgstr "" +msgstr "*کارخواه* / **کارساز**" msgid "**SSLv2**" -msgstr "" +msgstr "SSLv2" msgid "**SSLv3**" -msgstr "" +msgstr "SSLv3" msgid "**TLS** [3]_" -msgstr "" +msgstr "**TLS** [3]_" msgid "**TLSv1**" -msgstr "" +msgstr "TLSv1" msgid "**TLSv1.1**" -msgstr "" +msgstr "**TLSv1.1**" msgid "**TLSv1.2**" -msgstr "" +msgstr "TLSv1.2" msgid "*SSLv2*" -msgstr "" +msgstr "*SSLv2*" msgid "yes" -msgstr "" +msgstr "بله" msgid "no" -msgstr "" +msgstr "خیر" msgid "no [1]_" -msgstr "" +msgstr "خیر [1]_" msgid "*SSLv3*" -msgstr "" +msgstr "*SSLv3*" msgid "no [2]_" -msgstr "" +msgstr "خیر [2]_" msgid "*TLS* (*SSLv23*) [3]_" -msgstr "" +msgstr "*TLS* (*SSLv23*) [3]_" msgid "*TLSv1*" -msgstr "" +msgstr "*TLSv1*" msgid "*TLSv1.1*" -msgstr "" +msgstr "*TLSv1.1*" msgid "*TLSv1.2*" -msgstr "" +msgstr "*TLSv1.2*" msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." +msgid "" +":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr "" +":class:`SSLContext` به‌طور پیش‌فرض SSLv2 را با :data:`OP_NO_SSLv2` غیرفعال " +"می‌کند." -msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." +msgid "" +":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr "" +":class:`SSLContext` به‌طور پیش‌فرض SSLv3 را با :data:`OP_NO_SSLv3` غیرفعال " +"می‌کند." -msgid "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= 1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." +msgid "" +"TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " +"1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" +"پروتکل TLS 1.3 با :data:`PROTOCOL_TLS` در OpenSSL >= 1.1.1 در دسترس خواهد " +"بود. ثابت PROTOCOL اختصاصی‌ای فقط برای TLS 1.3 وجود ندارد." -msgid ":func:`create_default_context` lets the :mod:`!ssl` module choose security settings for a given purpose." +msgid "" +":func:`create_default_context` lets the :mod:`!ssl` module choose security " +"settings for a given purpose." msgstr "" +":func:`create_default_context` به ماژول :mod:`!ssl` اجازه می‌دهد تنظیمات " +"امنیتی را برای منظوری مشخص انتخاب کند." -msgid "The context is created with secure default values. The options :data:`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are set by default. The initial cipher suite list contains only ``HIGH`` ciphers, no ``NULL`` ciphers and no ``MD5`` ciphers." -msgstr "" +msgid "" +"The context is created with secure default values. The " +"options :data:`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2`, " +"and :data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are set by " +"default. The initial cipher suite list contains only ``HIGH`` ciphers, no " +"``NULL`` ciphers and no ``MD5`` ciphers." +msgstr "" +"زمینه با مقادیر پیش‌فرض امن ایجاد می‌شود. " +"گزینه‌های :data:`OP_NO_COMPRESSION`، :data:`OP_CIPHER_SERVER_PREFERENCE`، :data:`OP_SINGLE_DH_USE`، :data:`OP_SINGLE_ECDH_USE`، :data:`OP_NO_SSLv2` " +"و :data:`OP_NO_SSLv3` (به‌جز :data:`PROTOCOL_SSLv3`) به‌طور پیش‌فرض تنظیم " +"شده‌اند. فهرست اولیه‌ی مجموعه‌رمزها فقط شامل رمزهای ``HIGH`` است و هیچ رمز " +"``NULL`` و هیچ رمز ``MD5`` ندارد." -msgid ":class:`SSLContext` without protocol argument is deprecated. The context class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:`PROTOCOL_TLS_SERVER` protocol in the future." +msgid "" +":class:`SSLContext` without protocol argument is deprecated. The context " +"class will either require :data:`PROTOCOL_TLS_CLIENT` " +"or :data:`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" +":class:`SSLContext` بدون آرگومان پروتکل منسوخ شده است. کلاس زمینه در آینده " +"به پروتکل :data:`PROTOCOL_TLS_CLIENT` یا :data:`PROTOCOL_TLS_SERVER` نیاز " +"خواهد داشت." -msgid "The default cipher suites now include only secure AES and ChaCha20 ciphers with forward secrecy and security level 2. RSA and DH keys with less than 2048 bits and ECC keys with less than 224 bits are prohibited. :data:`PROTOCOL_TLS`, :data:`PROTOCOL_TLS_CLIENT`, and :data:`PROTOCOL_TLS_SERVER` use TLS 1.2 as minimum TLS version." -msgstr "" +msgid "" +"The default cipher suites now include only secure AES and ChaCha20 ciphers " +"with forward secrecy and security level 2. RSA and DH keys with less than " +"2048 bits and ECC keys with less than 224 bits are " +"prohibited. :data:`PROTOCOL_TLS`, :data:`PROTOCOL_TLS_CLIENT`, " +"and :data:`PROTOCOL_TLS_SERVER` use TLS 1.2 as minimum TLS version." +msgstr "" +"مجموعه‌های رمزنگاری پیش‌فرض اکنون فقط شامل رمزهای امن AES و ChaCha20 با " +"رازداری پیش‌رو (forward secrecy) و سطح امنیت ۲ هستند. کلیدهای RSA و DH با " +"کمتر از ۲۰۴۸ بیت و کلیدهای ECC با کمتر از ۲۲۴ بیت ممنوع " +"هستند. :data:`PROTOCOL_TLS`، :data:`PROTOCOL_TLS_CLIENT` " +"و :data:`PROTOCOL_TLS_SERVER` از TLS 1.2 به‌عنوان حداقل نسخه‌ی TLS استفاده " +"می‌کنند." -msgid ":class:`SSLContext` only supports limited mutation once it has been used by a connection. Adding new certificates to the internal trust store is allowed, but changing ciphers, verification settings, or mTLS certificates may result in surprising behavior." +msgid "" +":class:`SSLContext` only supports limited mutation once it has been used by " +"a connection. Adding new certificates to the internal trust store is " +"allowed, but changing ciphers, verification settings, or mTLS certificates " +"may result in surprising behavior." msgstr "" +":class:`SSLContext` پس از آنکه توسط یک اتصال استفاده شد، تنها تغییر محدودی " +"را می‌پذیرد. افزودن گواهی‌های جدید به مخزن اعتماد داخلی مجاز است، اما " +"تغییر رمزها، تنظیمات صحت‌سنجی، یا گواهی‌های mTLS ممکن است منجر به رفتار " +"غیرمنتظره شود." -msgid ":class:`SSLContext` is designed to be shared and used by multiple connections. Thus, it is thread-safe as long as it is not reconfigured after being used by a connection." +msgid "" +":class:`SSLContext` is designed to be shared and used by multiple " +"connections. Thus, it is thread-safe as long as it is not reconfigured " +"after being used by a connection." msgstr "" +":class:`SSLContext` برای اشتراک‌گذاری و استفاده توسط چندین اتصال طراحی شده " +"است. بنابراین، تا زمانی که پس از استفاده توسط یک اتصال پیکربندی مجدد نشود، " +"ایمن از نظر نخی است." msgid ":class:`SSLContext` objects have the following methods and attributes:" -msgstr "" +msgstr "اشیای :class:`SSLContext` دارای متدها و ویژگی‌های زیر هستند:" -msgid "Get statistics about quantities of loaded X.509 certificates, count of X.509 certificates flagged as CA certificates and certificate revocation lists as dictionary." +msgid "" +"Get statistics about quantities of loaded X.509 certificates, count of " +"X.509 certificates flagged as CA certificates and certificate revocation " +"lists as dictionary." msgstr "" +"آمار مربوط به تعداد گواهی‌های X.509 بارگذاری‌شده، تعداد گواهی‌های X.509 " +"علامت‌گذاری‌شده به‌عنوان گواهی CA و فهرست‌های ابطال گواهی را به‌صورت دیکشنری " +"دریافت کنید." msgid "Example for a context with one CA cert and one other cert::" -msgstr "" +msgstr "مثالی برای یک زمینه با یک گواهی CA و یک گواهی دیگر::" msgid "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" msgstr "" +">>> context.cert_store_stats()\n" +"{'crl': 0, 'x509_ca': 1, 'x509': 2}" -msgid "Load a private key and the corresponding certificate. The *certfile* string must be the path to a single file in PEM format containing the certificate as well as any number of CA certificates needed to establish the certificate's authenticity. The *keyfile* string, if present, must point to a file containing the private key. Otherwise the private key will be taken from *certfile* as well. See the discussion of :ref:`ssl-certificates` for more information on how the certificate is stored in the *certfile*." -msgstr "" +msgid "" +"Load a private key and the corresponding certificate. The *certfile* " +"string must be the path to a single file in PEM format containing the " +"certificate as well as any number of CA certificates needed to establish " +"the certificate's authenticity. The *keyfile* string, if present, must " +"point to a file containing the private key. Otherwise the private key will " +"be taken from *certfile* as well. See the discussion of :ref:`ssl-" +"certificates` for more information on how the certificate is stored in the " +"*certfile*." +msgstr "" +"یک کلید خصوصی و گواهی مربوطه را بارگذاری می‌کند. رشته‌ی *certfile* باید مسیر " +"یک فایل واحد در قالب PEM حاوی گواهی و همچنین هر تعداد گواهی CA مورد نیاز " +"برای احراز اصالت گواهی باشد. رشته‌ی *keyfile*، در صورت وجود، باید به فایلی " +"حاوی کلید خصوصی اشاره کند. در غیر این صورت، کلید خصوصی نیز از *certfile* " +"گرفته می‌شود. برای اطلاعات بیشتر درباره‌ی نحوه‌ی ذخیره‌ی گواهی در *certfile*، " +"مبحث :ref:`ssl-certificates` را ببینید." -msgid "The *password* argument may be a function to call to get the password for decrypting the private key. It will only be called if the private key is encrypted and a password is necessary. It will be called with no arguments, and it should return a string, bytes, or bytearray. If the return value is a string it will be encoded as UTF-8 before using it to decrypt the key. Alternatively a string, bytes, or bytearray value may be supplied directly as the *password* argument. It will be ignored if the private key is not encrypted and no password is needed." -msgstr "" +msgid "" +"The *password* argument may be a function to call to get the password for " +"decrypting the private key. It will only be called if the private key is " +"encrypted and a password is necessary. It will be called with no " +"arguments, and it should return a string, bytes, or bytearray. If the " +"return value is a string it will be encoded as UTF-8 before using it to " +"decrypt the key. Alternatively a string, bytes, or bytearray value may be " +"supplied directly as the *password* argument. It will be ignored if the " +"private key is not encrypted and no password is needed." +msgstr "" +"آرگومان *password* می‌تواند تابعی باشد که برای دریافت گذرواژه جهت رمزگشایی " +"کلید خصوصی فراخوانی می‌شود. این تابع فقط در صورتی فراخوانی خواهد شد که کلید " +"خصوصی رمزنگاری‌شده باشد و به یک گذرواژه نیاز باشد. این تابع بدون آرگومان " +"فراخوانی می‌شود و باید یک رشته، bytes یا bytearray برگرداند. اگر مقدار " +"بازگشتی یک رشته باشد، پیش از استفاده از آن برای رمزگشایی کلید، به‌صورت UTF-8 " +"کدگذاری خواهد شد. به‌عنوان جایگزین، می‌توان یک مقدار رشته، bytes یا bytearray " +"را مستقیماً به‌عنوان آرگومان *password* ارائه کرد. اگر کلید خصوصی " +"رمزنگاری‌نشده باشد و نیازی به گذرواژه نباشد، این مقدار نادیده گرفته خواهد شد." -msgid "If the *password* argument is not specified and a password is required, OpenSSL's built-in password prompting mechanism will be used to interactively prompt the user for a password." +msgid "" +"If the *password* argument is not specified and a password is required, " +"OpenSSL's built-in password prompting mechanism will be used to " +"interactively prompt the user for a password." msgstr "" +"اگر آرگومان *password* تعیین نشده باشد و به یک گذرواژه نیاز باشد، از " +"سازوکار توکار درخواست گذرواژه در OpenSSL برای درخواست تعاملی گذرواژه از " +"کاربر استفاده می‌شود." -msgid "An :class:`SSLError` is raised if the private key doesn't match with the certificate." +msgid "" +"An :class:`SSLError` is raised if the private key doesn't match with the " +"certificate." msgstr "" +"اگر کلید خصوصی با گواهی مطابقت نداشته باشد، یک :class:`SSLError` پرتاب " +"می‌شود." msgid "New optional argument *password*." -msgstr "" +msgstr "آرگومان اختیاری جدید *password*." -msgid "Load a set of default \"certification authority\" (CA) certificates from default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` system stores. On all systems it calls :meth:`SSLContext.set_default_verify_paths`. In the future the method may load CA certificates from other locations, too." -msgstr "" +msgid "" +"Load a set of default \"certification authority\" (CA) certificates from " +"default locations. On Windows it loads CA certs from the ``CA`` and " +"``ROOT`` system stores. On all systems it " +"calls :meth:`SSLContext.set_default_verify_paths`. In the future the method " +"may load CA certificates from other locations, too." +msgstr "" +"بارگذاری مجموعه‌ای از گواهی‌های پیش‌فرض «مرجع صدور گواهی» (CA) از " +"مکان‌های پیش‌فرض. در ویندوز، گواهی‌های CA را از مخزن‌های سیستمی ``CA`` و " +"``ROOT`` بارگذاری می‌کند. در تمام " +"سیستم‌ها، :meth:`SSLContext.set_default_verify_paths` را فراخوانی می‌کند. در " +"آینده، این متد ممکن است گواهی‌های CA را از مکان‌های دیگر نیز بارگذاری کند." -msgid "The *purpose* flag specifies what kind of CA certificates are loaded. The default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are flagged and trusted for TLS web server authentication (client side sockets). :const:`Purpose.CLIENT_AUTH` loads CA certificates for client certificate verification on the server side." -msgstr "" +msgid "" +"The *purpose* flag specifies what kind of CA certificates are loaded. The " +"default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " +"flagged and trusted for TLS web server authentication (client side " +"sockets). :const:`Purpose.CLIENT_AUTH` loads CA certificates for client " +"certificate verification on the server side." +msgstr "" +"پرچم *purpose* مشخص می‌کند که چه نوع گواهی‌های CA بارگذاری شوند. تنظیم " +"پیش‌فرض :const:`Purpose.SERVER_AUTH` گواهی‌هایی را بارگذاری می‌کند که برای " +"احراز هویت سرور وب TLS (سوکت‌های سمت کلاینت) علامت‌گذاری شده‌اند و مورد اعتماد " +"هستند. :const:`Purpose.CLIENT_AUTH` گواهی‌های CA را برای تأیید گواهی کلاینت " +"در سمت سرور بارگذاری می‌کند." -msgid "Load a set of \"certification authority\" (CA) certificates used to validate other peers' certificates when :data:`verify_mode` is other than :data:`CERT_NONE`. At least one of *cafile* or *capath* must be specified." +msgid "" +"Load a set of \"certification authority\" (CA) certificates used to " +"validate other peers' certificates when :data:`verify_mode` is other " +"than :data:`CERT_NONE`. At least one of *cafile* or *capath* must be " +"specified." msgstr "" +"مجموعه‌ای از گواهی‌های «مرجع صدور گواهی» (CA) را بارگذاری می‌کند که برای " +"اعتبارسنجی گواهی‌های سایر همتایان، هنگامی که :data:`verify_mode` مقداری غیر " +"از :data:`CERT_NONE` باشد، استفاده می‌شوند. حداقل یکی از *cafile* یا " +"*capath* باید مشخص شود." -msgid "This method can also load certification revocation lists (CRLs) in PEM or DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` must be configured properly." +msgid "" +"This method can also load certification revocation lists (CRLs) in PEM or " +"DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " +"must be configured properly." msgstr "" +"این متد همچنین می‌تواند فهرست‌های لغو گواهی (CRL) را در قالب PEM یا DER " +"بارگذاری کند. برای استفاده از CRLها، باید :attr:`SSLContext.verify_flags` " +"به‌درستی پیکربندی شود." -msgid "The *cafile* string, if present, is the path to a file of concatenated CA certificates in PEM format. See the discussion of :ref:`ssl-certificates` for more information about how to arrange the certificates in this file." +msgid "" +"The *cafile* string, if present, is the path to a file of concatenated CA " +"certificates in PEM format. See the discussion of :ref:`ssl-certificates` " +"for more information about how to arrange the certificates in this file." msgstr "" +"رشته‌ی *cafile*، در صورت وجود، مسیر یک فایل حاوی گواهی‌های CA به‌هم‌پیوسته " +"در قالب PEM است. برای اطلاعات بیشتر درباره‌ی نحوه‌ی چیدمان گواهی‌ها در این " +"فایل، بحث :ref:`ssl-certificates` را ببینید." -msgid "The *capath* string, if present, is the path to a directory containing several CA certificates in PEM format, following an `OpenSSL specific layout `_." +msgid "" +"The *capath* string, if present, is the path to a directory containing " +"several CA certificates in PEM format, following an `OpenSSL specific " +"layout `_." msgstr "" +"رشته‌ی *capath*، در صورت وجود، مسیر پوشه‌ای است که شامل چندین گواهی CA در " +"قالب PEM است و از `چیدمان خاص OpenSSL `_ پیروی می‌کند." -msgid "The *cadata* object, if present, is either an ASCII string of one or more PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded certificates. Like with *capath* extra lines around PEM-encoded certificates are ignored but at least one certificate must be present." +msgid "" +"The *cadata* object, if present, is either an ASCII string of one or more " +"PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " +"certificates. Like with *capath* extra lines around PEM-encoded " +"certificates are ignored but at least one certificate must be present." msgstr "" +"شیء *cadata*، در صورت وجود، یا یک رشته‌ی ASCII از یک یا چند گواهی کدگذاری‌شده " +"با PEM است یا یک :term:`bytes-like object` از گواهی‌های کدگذاری‌شده با DER. " +"مانند *capath*، خطوط اضافی اطراف گواهی‌های کدگذاری‌شده با PEM نادیده گرفته " +"می‌شوند، اما حداقل یک گواهی باید موجود باشد." msgid "New optional argument *cadata*" -msgstr "" +msgstr "آرگومان اختیاری جدید *cadata*" -msgid "Get a list of loaded \"certification authority\" (CA) certificates. If the ``binary_form`` parameter is :const:`False` each list entry is a dict like the output of :meth:`SSLSocket.getpeercert`. Otherwise the method returns a list of DER-encoded certificates. The returned list does not contain certificates from *capath* unless a certificate was requested and loaded by a SSL connection." -msgstr "" +msgid "" +"Get a list of loaded \"certification authority\" (CA) certificates. If the " +"``binary_form`` parameter is :const:`False` each list entry is a dict like " +"the output of :meth:`SSLSocket.getpeercert`. Otherwise the method returns a " +"list of DER-encoded certificates. The returned list does not contain " +"certificates from *capath* unless a certificate was requested and loaded by " +"a SSL connection." +msgstr "" +"فهرستی از گواهی‌های بارگذاری‌شده‌ی «مرجع صدور گواهی» (CA) را دریافت کنید. اگر " +"پارامتر ``binary_form`` برابر :const:`False` باشد، هر آیتم فهرست یک دیکشنری " +"مانند خروجی :meth:`SSLSocket.getpeercert` است. در غیر این صورت، متد فهرستی " +"از گواهی‌های کدگذاری‌شده با DER را برمی‌گرداند. فهرست برگردانده‌شده شامل " +"گواهی‌های *capath* نمی‌شود، مگر اینکه گواهی‌ای توسط یک اتصال SSL درخواست و " +"بارگذاری شده باشد." -msgid "Certificates in a capath directory aren't loaded unless they have been used at least once." +msgid "" +"Certificates in a capath directory aren't loaded unless they have been used " +"at least once." msgstr "" +"گواهی‌نامه‌های موجود در یک پوشه capath بارگذاری نمی‌شوند، مگر اینکه حداقل یک " +"بار استفاده شده باشند." -msgid "Get a list of enabled ciphers. The list is in order of cipher priority. See :meth:`SSLContext.set_ciphers`." +msgid "" +"Get a list of enabled ciphers. The list is in order of cipher priority. " +"See :meth:`SSLContext.set_ciphers`." msgstr "" +"فهرستی از رمزنگارهای فعال را دریافت کنید. این فهرست به ترتیب اولویت " +"رمزنگارها مرتب شده است. :meth:`SSLContext.set_ciphers` را ببینید." msgid "" ">>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n" @@ -1021,7 +2338,8 @@ msgid "" "[{'aead': True,\n" " 'alg_bits': 256,\n" " 'auth': 'auth-rsa',\n" -" 'description': 'ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA '\n" +" 'description': 'ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA " +"'\n" " 'Enc=AESGCM(256) Mac=AEAD',\n" " 'digest': None,\n" " 'id': 50380848,\n" @@ -1033,7 +2351,8 @@ msgid "" " {'aead': True,\n" " 'alg_bits': 128,\n" " 'auth': 'auth-rsa',\n" -" 'description': 'ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA '\n" +" 'description': 'ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA " +"'\n" " 'Enc=AESGCM(128) Mac=AEAD',\n" " 'digest': None,\n" " 'id': 50380847,\n" @@ -1043,141 +2362,482 @@ msgid "" " 'strength_bits': 128,\n" " 'symmetric': 'aes-128-gcm'}]" msgstr "" +">>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n" +">>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA')\n" +">>> ctx.get_ciphers()\n" +"[{'aead': True,\n" +" 'alg_bits': 256,\n" +" 'auth': 'auth-rsa',\n" +" 'description': 'ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA " +"'\n" +" 'Enc=AESGCM(256) Mac=AEAD',\n" +" 'digest': None,\n" +" 'id': 50380848,\n" +" 'kea': 'kx-ecdhe',\n" +" 'name': 'ECDHE-RSA-AES256-GCM-SHA384',\n" +" 'protocol': 'TLSv1.2',\n" +" 'strength_bits': 256,\n" +" 'symmetric': 'aes-256-gcm'},\n" +" {'aead': True,\n" +" 'alg_bits': 128,\n" +" 'auth': 'auth-rsa',\n" +" 'description': 'ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA " +"'\n" +" 'Enc=AESGCM(128) Mac=AEAD',\n" +" 'digest': None,\n" +" 'id': 50380847,\n" +" 'kea': 'kx-ecdhe',\n" +" 'name': 'ECDHE-RSA-AES128-GCM-SHA256',\n" +" 'protocol': 'TLSv1.2',\n" +" 'strength_bits': 128,\n" +" 'symmetric': 'aes-128-gcm'}]" -msgid "Load a set of default \"certification authority\" (CA) certificates from a filesystem path defined when building the OpenSSL library. Unfortunately, there's no easy way to know whether this method succeeds: no error is returned if no certificates are to be found. When the OpenSSL library is provided as part of the operating system, though, it is likely to be configured properly." -msgstr "" +msgid "" +"Load a set of default \"certification authority\" (CA) certificates from a " +"filesystem path defined when building the OpenSSL library. Unfortunately, " +"there's no easy way to know whether this method succeeds: no error is " +"returned if no certificates are to be found. When the OpenSSL library is " +"provided as part of the operating system, though, it is likely to be " +"configured properly." +msgstr "" +"بارگذاری مجموعه‌ای از گواهی‌های پیش‌فرض «مرجع صدور گواهی» (CA) از یک مسیر " +"سیستم‌فایل که هنگام ساخت کتابخانه OpenSSL تعریف شده است. متأسفانه، راه آسانی " +"برای اطلاع از موفقیت این متد وجود ندارد: اگر هیچ گواهی‌ای یافت نشود، هیچ " +"خطایی بازگردانده نمی‌شود. با این حال، وقتی کتابخانه OpenSSL به‌عنوان بخشی از " +"سیستم‌عامل ارائه شده باشد، احتمالاً به‌درستی پیکربندی شده است." -msgid "Set the available ciphers for sockets created with this context. It should be a string in the `OpenSSL cipher list format `_. If no cipher can be selected (because compile-time options or other configuration forbids use of all the specified ciphers), an :class:`SSLError` will be raised." -msgstr "" +msgid "" +"Set the available ciphers for sockets created with this context. It should " +"be a string in the `OpenSSL cipher list format `_. If no cipher can be selected (because compile-time " +"options or other configuration forbids use of all the specified ciphers), " +"an :class:`SSLError` will be raised." +msgstr "" +"رمزهای در دسترس را برای سوکت‌های ایجادشده با این زمینه تنظیم می‌کند. این باید " +"رشته‌ای در `قالب فهرست رمزها در OpenSSL `_ باشد. اگر هیچ رمزی قابل انتخاب نباشد (زیرا گزینه‌های زمان " +"کامپایل یا پیکربندی دیگر استفاده از همه رمزهای مشخص‌شده را ممنوع می‌کند)، " +"یک :class:`SSLError` پرتاب خواهد شد." -msgid "when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will give the currently selected cipher." +msgid "" +"when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will " +"give the currently selected cipher." msgstr "" +"پس از اتصال، متد :meth:`SSLSocket.cipher` در سوکت‌های SSL، رمزنگار انتخاب‌شده‌ی " +"کنونی را برمی‌گرداند." -msgid "TLS 1.3 cipher suites cannot be disabled with :meth:`~SSLContext.set_ciphers`." +msgid "" +"TLS 1.3 cipher suites cannot be disabled " +"with :meth:`~SSLContext.set_ciphers`." msgstr "" +"مجموعه‌رمزهای TLS 1.3 را نمی‌توان با :meth:`~SSLContext.set_ciphers` غیرفعال " +"کرد." -msgid "Specify which protocols the socket should advertise during the SSL/TLS handshake. It should be a list of ASCII strings, like ``['http/1.1', 'spdy/2']``, ordered by preference. The selection of a protocol will happen during the handshake, and will play out according to :rfc:`7301`. After a successful handshake, the :meth:`SSLSocket.selected_alpn_protocol` method will return the agreed-upon protocol." -msgstr "" +msgid "" +"Specify which protocols the socket should advertise during the SSL/TLS " +"handshake. It should be a list of ASCII strings, like ``['http/1.1', 'spdy/" +"2']``, ordered by preference. The selection of a protocol will happen " +"during the handshake, and will play out according to :rfc:`7301`. After a " +"successful handshake, the :meth:`SSLSocket.selected_alpn_protocol` method " +"will return the agreed-upon protocol." +msgstr "" +"مشخص کنید که سوکت باید در طول دست‌دهی SSL/TLS کدام پروتکل‌ها را اعلام کند. " +"این باید فهرستی از رشته‌های ASCII، مانند ``['http/1.1', 'spdy/2']``، مرتب‌شده " +"بر اساس ترجیح باشد. انتخاب یک پروتکل در طول دست‌دهی انجام خواهد شد و " +"مطابق :rfc:`7301` صورت خواهد گرفت. پس از یک دست‌دهی موفق، " +"متد :meth:`SSLSocket.selected_alpn_protocol` پروتکل توافق‌شده را برمی‌گرداند." -msgid "This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is ``False``." +msgid "" +"This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is " +"``False``." msgstr "" +"اگر :data:`HAS_ALPN` برابر ``False`` باشد، این " +"متد :exc:`NotImplementedError` را پرتاب خواهد کرد." -msgid "Specify which protocols the socket should advertise during the SSL/TLS handshake. It should be a list of strings, like ``['http/1.1', 'spdy/2']``, ordered by preference. The selection of a protocol will happen during the handshake, and will play out according to the `Application Layer Protocol Negotiation `_. After a successful handshake, the :meth:`SSLSocket.selected_npn_protocol` method will return the agreed-upon protocol." -msgstr "" +msgid "" +"Specify which protocols the socket should advertise during the SSL/TLS " +"handshake. It should be a list of strings, like ``['http/1.1', 'spdy/2']``, " +"ordered by preference. The selection of a protocol will happen during the " +"handshake, and will play out according to the `Application Layer Protocol " +"Negotiation `_. After a successful handshake, " +"the :meth:`SSLSocket.selected_npn_protocol` method will return the agreed-" +"upon protocol." +msgstr "" +"مشخص کنید که سوکت باید در حین دست‌دهی SSL/TLS کدام پروتکل‌ها را اعلام کند. " +"این باید فهرستی از رشته‌ها باشد، مانند ``['http/1.1', 'spdy/2']``، که به " +"ترتیب اولویت مرتب‌شده است. انتخاب یک پروتکل در حین دست‌دهی انجام خواهد شد و " +"مطابق `Application Layer Protocol Negotiation `_ صورت خواهد گرفت. پس از یک " +"دست‌دهی موفق، متد :meth:`SSLSocket.selected_npn_protocol` پروتکل توافق‌شده " +"را برمی‌گرداند." -msgid "This method will raise :exc:`NotImplementedError` if :data:`HAS_NPN` is ``False``." +msgid "" +"This method will raise :exc:`NotImplementedError` if :data:`HAS_NPN` is " +"``False``." msgstr "" +"اگر :data:`HAS_NPN` برابر ``False`` باشد، این " +"متد :exc:`NotImplementedError` را پرتاب می‌کند." -msgid "Register a callback function that will be called after the TLS Client Hello handshake message has been received by the SSL/TLS server when the TLS client specifies a server name indication. The server name indication mechanism is specified in :rfc:`6066` section 3 - Server Name Indication." +msgid "" +"Register a callback function that will be called after the TLS Client Hello " +"handshake message has been received by the SSL/TLS server when the TLS " +"client specifies a server name indication. The server name indication " +"mechanism is specified in :rfc:`6066` section 3 - Server Name Indication." msgstr "" +"یک تابع کال‌بک را ثبت کنید که پس از دریافت پیام دست‌دهی TLS Client Hello " +"توسط سرور SSL/TLS، هنگامی که کلاینت TLS نشانگر نام سرور (Server Name " +"Indication) را مشخص کرده باشد، فراخوانی می‌شود. سازوکار نشانگر نام سرور در " +"بخش ۳ از :rfc:`6066` با عنوان Server Name Indication مشخص شده است." -msgid "Only one callback can be set per ``SSLContext``. If *sni_callback* is set to ``None`` then the callback is disabled. Calling this function a subsequent time will disable the previously registered callback." +msgid "" +"Only one callback can be set per ``SSLContext``. If *sni_callback* is set " +"to ``None`` then the callback is disabled. Calling this function a " +"subsequent time will disable the previously registered callback." msgstr "" +"برای هر ``SSLContext`` تنها می‌توان یک کال‌بک تنظیم کرد. اگر *sni_callback* " +"روی ``None`` تنظیم شود، کال‌بک غیرفعال می‌شود. فراخوانی مجدد این تابع، کال‌بک " +"ثبت‌شده‌ی پیشین را غیرفعال خواهد کرد." -msgid "The callback function will be called with three arguments; the first being the :class:`ssl.SSLSocket`, the second is a string that represents the server name that the client is intending to communicate (or :const:`None` if the TLS Client Hello does not contain a server name) and the third argument is the original :class:`SSLContext`. The server name argument is text. For internationalized domain name, the server name is an IDN A-label (``\"xn--pythn-mua.org\"``)." -msgstr "" +msgid "" +"The callback function will be called with three arguments; the first being " +"the :class:`ssl.SSLSocket`, the second is a string that represents the " +"server name that the client is intending to communicate (or :const:`None` " +"if the TLS Client Hello does not contain a server name) and the third " +"argument is the original :class:`SSLContext`. The server name argument is " +"text. For internationalized domain name, the server name is an IDN A-label " +"(``\"xn--pythn-mua.org\"``)." +msgstr "" +"تابع کال‌بک با ۳ آرگومان فراخوانی می‌شود؛ اولی :class:`ssl.SSLSocket` است، " +"دومی رشته‌ای است که نام سرور مورد نظر کلاینت برای برقراری ارتباط را نشان " +"می‌دهد (یا اگر TLS Client Hello حاوی نام سرور نباشد، :const:`None`) و " +"آرگومان سوم :class:`SSLContext` اصلی است. آرگومان نام سرور متن است. برای " +"IDN، نام سرور یک IDN A-label است (``\"xn--pythn-" +"mua.org\"``)." -msgid "A typical use of this callback is to change the :class:`ssl.SSLSocket`'s :attr:`SSLSocket.context` attribute to a new object of type :class:`SSLContext` representing a certificate chain that matches the server name." +msgid "" +"A typical use of this callback is to change " +"the :class:`ssl.SSLSocket`'s :attr:`SSLSocket.context` attribute to a new " +"object of type :class:`SSLContext` representing a certificate chain that " +"matches the server name." msgstr "" +"یک کاربرد رایج این کال‌بک، تغییر ویژگی :attr:`SSLSocket.context` مربوط " +"به :class:`ssl.SSLSocket` به شیء جدیدی از نوع :class:`SSLContext` است که " +"نشان‌دهنده‌ی زنجیره‌ی گواهی‌ای است که با نام سرور مطابقت دارد." -msgid "Due to the early negotiation phase of the TLS connection, only limited methods and attributes are usable like :meth:`SSLSocket.selected_alpn_protocol` and :attr:`SSLSocket.context`. The :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.get_verified_chain`, :meth:`SSLSocket.get_unverified_chain` :meth:`SSLSocket.cipher` and :meth:`SSLSocket.compression` methods require that the TLS connection has progressed beyond the TLS Client Hello and therefore will not return meaningful values nor can they be called safely." -msgstr "" +msgid "" +"Due to the early negotiation phase of the TLS connection, only limited " +"methods and attributes are usable " +"like :meth:`SSLSocket.selected_alpn_protocol` " +"and :attr:`SSLSocket.context`. " +"The :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.get_verified_chain`, :meth:`SSLSocket.get_unverified_chain` :meth:`SSLSocket.cipher` " +"and :meth:`SSLSocket.compression` methods require that the TLS connection " +"has progressed beyond the TLS Client Hello and therefore will not return " +"meaningful values nor can they be called safely." +msgstr "" +"به دلیل مرحله‌ی اولیه‌ی مذاکره‌ی اتصال TLS، تنها متدها و ویژگی‌های محدودی قابل " +"استفاده هستند، مانند :meth:`SSLSocket.selected_alpn_protocol` " +"و :attr:`SSLSocket.context`. " +"متدهای :meth:`SSLSocket.getpeercert`، :meth:`SSLSocket.get_verified_chain`، :meth:`SSLSocket.get_unverified_chain`، :meth:`SSLSocket.cipher` " +"و :meth:`SSLSocket.compression` نیاز دارند که اتصال TLS از TLS Client Hello " +"فراتر رفته باشد؛ بنابراین نه مقادیر معناداری برمی‌گردانند و نه می‌توان آن‌ها " +"را به‌طور امن فراخوانی کرد." -msgid "The *sni_callback* function must return ``None`` to allow the TLS negotiation to continue. If a TLS failure is required, a constant :const:`ALERT_DESCRIPTION_* ` can be returned. Other return values will result in a TLS fatal error with :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`." +msgid "" +"The *sni_callback* function must return ``None`` to allow the TLS " +"negotiation to continue. If a TLS failure is required, a " +"constant :const:`ALERT_DESCRIPTION_* ` " +"can be returned. Other return values will result in a TLS fatal error " +"with :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`." msgstr "" +"تابع *sni_callback* باید ``None`` را برگرداند تا اجازه دهد مذاکره TLS ادامه " +"یابد. اگر نیاز به شکست TLS باشد، می‌توان یک ثابت :const:`ALERT_DESCRIPTION_* " +"` را برگرداند. مقادیر بازگشتی دیگر باعث " +"خطای مهلک TLS با :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` خواهند شد." -msgid "If an exception is raised from the *sni_callback* function the TLS connection will terminate with a fatal TLS alert message :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`." +msgid "" +"If an exception is raised from the *sni_callback* function the TLS " +"connection will terminate with a fatal TLS alert " +"message :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`." msgstr "" +"اگر استثنایی از تابع *sni_callback* پرتاب شود، اتصال TLS با یک پیام هشدار " +"وخیم TLS :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE` خاتمه می‌یابد." -msgid "This method will raise :exc:`NotImplementedError` if the OpenSSL library had OPENSSL_NO_TLSEXT defined when it was built." +msgid "" +"This method will raise :exc:`NotImplementedError` if the OpenSSL library " +"had OPENSSL_NO_TLSEXT defined when it was built." msgstr "" +"اگر OPENSSL_NO_TLSEXT هنگام ساخت کتابخانه OpenSSL تعریف‌شده باشد، این " +"متد :exc:`NotImplementedError` را پرتاب خواهد کرد." -msgid "This is a legacy API retained for backwards compatibility. When possible, you should use :attr:`sni_callback` instead. The given *server_name_callback* is similar to *sni_callback*, except that when the server hostname is an IDN-encoded internationalized domain name, the *server_name_callback* receives a decoded U-label (``\"pythön.org\"``)." -msgstr "" +msgid "" +"This is a legacy API retained for backwards compatibility. When possible, " +"you should use :attr:`sni_callback` instead. The given " +"*server_name_callback* is similar to *sni_callback*, except that when the " +"server hostname is an IDN-encoded internationalized domain name, the " +"*server_name_callback* receives a decoded U-label (``\"pythön.org\"``)." +msgstr "" +"این یک API قدیمی است که برای سازگاری با نسخه‌های قبلی حفظ شده است. در صورت " +"امکان، باید به‌جای آن از :attr:`sni_callback` استفاده کنید. " +"*server_name_callback* داده‌شده مشابه *sni_callback* است، با این تفاوت که " +"وقتی نام میزبان سرور یک IDN کدگذاری‌شده با IDN باشد، " +"*server_name_callback* یک U-label کدگشایی‌شده را دریافت می‌کند " +"(``\"pythön.org\"``)." -msgid "If there is a decoding error on the server name, the TLS connection will terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS alert message to the client." +msgid "" +"If there is a decoding error on the server name, the TLS connection will " +"terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS alert " +"message to the client." msgstr "" +"اگر در کدگشایی نام سرور خطایی رخ دهد، اتصال TLS با یک پیام هشدار مهلک " +"TLS :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` به کلاینت خاتمه خواهد یافت." -msgid "Load the key generation parameters for Diffie-Hellman (DH) key exchange. Using DH key exchange improves forward secrecy at the expense of computational resources (both on the server and on the client). The *dhfile* parameter should be the path to a file containing DH parameters in PEM format." +msgid "" +"Load the key generation parameters for Diffie-Hellman (DH) key exchange. " +"Using DH key exchange improves forward secrecy at the expense of " +"computational resources (both on the server and on the client). The " +"*dhfile* parameter should be the path to a file containing DH parameters in " +"PEM format." msgstr "" +"پارامترهای تولید کلید برای تبادل کلید Diffie-Hellman (DH) را بارگذاری کنید. " +"استفاده از تبادل کلید DH، رازداری پیش‌رو (forward secrecy) را به بهای مصرف " +"منابع محاسباتی (هم در سمت سرور و هم در سمت کلاینت) بهبود می‌بخشد. پارامتر " +"*dhfile* باید مسیر فایلی حاوی پارامترهای DH در قالب PEM باشد." -msgid "This setting doesn't apply to client sockets. You can also use the :data:`OP_SINGLE_DH_USE` option to further improve security." +msgid "" +"This setting doesn't apply to client sockets. You can also use " +"the :data:`OP_SINGLE_DH_USE` option to further improve security." msgstr "" +"این تنظیم به سوکت‌های کلاینت اعمال نمی‌شود. همچنین می‌توانید از " +"گزینه :data:`OP_SINGLE_DH_USE` برای بهبود بیشتر امنیت استفاده کنید." -msgid "Set the curve name for Elliptic Curve-based Diffie-Hellman (ECDH) key exchange. ECDH is significantly faster than regular DH while arguably as secure. The *curve_name* parameter should be a string describing a well-known elliptic curve, for example ``prime256v1`` for a widely supported curve." -msgstr "" +msgid "" +"Set the curve name for Elliptic Curve-based Diffie-Hellman (ECDH) key " +"exchange. ECDH is significantly faster than regular DH while arguably as " +"secure. The *curve_name* parameter should be a string describing a well-" +"known elliptic curve, for example ``prime256v1`` for a widely supported " +"curve." +msgstr "" +"نام منحنی را برای تبادل کلید دیفی-هلمن مبتنی بر منحنی بیضوی (ECDH) تنظیم " +"کنید. ECDH به‌طور قابل‌توجهی سریع‌تر از DH معمولی است، در حالی که می‌توان گفت " +"به همان اندازه امن است. پارامتر *curve_name* باید رشته‌ای باشد که یک منحنی " +"بیضوی شناخته‌شده را توصیف می‌کند، برای مثال ``prime256v1`` برای منحنی‌ای که " +"به‌طور گسترده پشتیبانی می‌شود." -msgid "This setting doesn't apply to client sockets. You can also use the :data:`OP_SINGLE_ECDH_USE` option to further improve security." +msgid "" +"This setting doesn't apply to client sockets. You can also use " +"the :data:`OP_SINGLE_ECDH_USE` option to further improve security." msgstr "" +"این تنظیم برای سوکت‌های کلاینت اعمال نمی‌شود. همچنین می‌توانید از " +"گزینه :data:`OP_SINGLE_ECDH_USE` برای بهبود بیشتر امنیت استفاده کنید." msgid "This method is not available if :data:`HAS_ECDH` is ``False``." -msgstr "" +msgstr "اگر :data:`HAS_ECDH` برابر ``False`` باشد، این متد در دسترس نیست." -msgid "`SSL/TLS & Perfect Forward Secrecy `_" +msgid "" +"`SSL/TLS & Perfect Forward Secrecy `_" msgstr "" +"`SSL/TLS و رازداری کامل رو به جلو `_" msgid "Vincent Bernat." -msgstr "" +msgstr "Vincent Bernat." -msgid "Wrap an existing Python socket *sock* and return an instance of :attr:`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL socket is tied to the context, its settings and certificates. *sock* must be a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." -msgstr "" +msgid "" +"Wrap an existing Python socket *sock* and return an instance " +"of :attr:`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The " +"returned SSL socket is tied to the context, its settings and certificates. " +"*sock* must be a :const:`~socket.SOCK_STREAM` socket; other socket types " +"are unsupported." +msgstr "" +"سوکت پایتون موجود *sock* را می‌پیچد و نمونه‌ای " +"از :attr:`SSLContext.sslsocket_class` (پیش‌فرض :class:`SSLSocket`) را " +"برمی‌گرداند. سوکت SSL برگردانده‌شده به زمینه، تنظیمات و گواهی‌های آن " +"وابسته است. *sock* باید یک سوکت :const:`~socket.SOCK_STREAM` باشد؛ سایر " +"انواع سوکت پشتیبانی نمی‌شوند." -msgid "The parameter ``server_side`` is a boolean which identifies whether server-side or client-side behavior is desired from this socket." +msgid "" +"The parameter ``server_side`` is a boolean which identifies whether server-" +"side or client-side behavior is desired from this socket." msgstr "" +"پارامتر ``server_side`` یک بولی است که مشخص می‌کند آیا رفتار سمت سرور یا " +"رفتار سمت کلاینت از این سوکت مورد انتظار است." -msgid "For client-side sockets, the context construction is lazy; if the underlying socket isn't connected yet, the context construction will be performed after :meth:`connect` is called on the socket. For server-side sockets, if the socket has no remote peer, it is assumed to be a listening socket, and the server-side SSL wrapping is automatically performed on client connections accepted via the :meth:`accept` method. The method may raise :exc:`SSLError`." -msgstr "" +msgid "" +"For client-side sockets, the context construction is lazy; if the " +"underlying socket isn't connected yet, the context construction will be " +"performed after :meth:`connect` is called on the socket. For server-side " +"sockets, if the socket has no remote peer, it is assumed to be a listening " +"socket, and the server-side SSL wrapping is automatically performed on " +"client connections accepted via the :meth:`accept` method. The method may " +"raise :exc:`SSLError`." +msgstr "" +"برای سوکت‌های سمت کلاینت، ساخت زمینه با تأخیر انجام می‌شود؛ اگر سوکت زیرین " +"هنوز متصل نشده باشد، ساخت زمینه پس از فراخوانی :meth:`connect` روی سوکت " +"انجام خواهد شد. برای سوکت‌های سمت سرور، اگر سوکت همتای راه دوری نداشته " +"باشد، فرض می‌شود که یک سوکت شنود است، و پیچیدن SSL در سمت سرور به‌طور خودکار " +"روی اتصال‌های کلاینت پذیرفته‌شده از طریق متد :meth:`accept` انجام می‌شود. این " +"متد ممکن است :exc:`SSLError` را پرتاب کند." -msgid "On client connections, the optional parameter *server_hostname* specifies the hostname of the service which we are connecting to. This allows a single server to host multiple SSL-based services with distinct certificates, quite similarly to HTTP virtual hosts. Specifying *server_hostname* will raise a :exc:`ValueError` if *server_side* is true." -msgstr "" +msgid "" +"On client connections, the optional parameter *server_hostname* specifies " +"the hostname of the service which we are connecting to. This allows a " +"single server to host multiple SSL-based services with distinct " +"certificates, quite similarly to HTTP virtual hosts. Specifying " +"*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." +msgstr "" +"در اتصال‌های کلاینت، پارامتر اختیاری *server_hostname* نام میزبان سرویسی را " +"که به آن متصل می‌شویم مشخص می‌کند. این به یک سرور واحد امکان می‌دهد تا چندین " +"سرویس مبتنی بر SSL با گواهی‌های متمایز را میزبانی کند، بسیار مشابه " +"میزبان‌های مجازی HTTP. مشخص کردن *server_hostname* در صورتی که *server_side* " +"برابر true باشد، باعث پرتاب :exc:`ValueError` می‌شود." -msgid "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL handshake automatically after doing a :meth:`socket.connect`, or whether the application program will call it explicitly, by invoking the :meth:`SSLSocket.do_handshake` method. Calling :meth:`SSLSocket.do_handshake` explicitly gives the program control over the blocking behavior of the socket I/O involved in the handshake." -msgstr "" +msgid "" +"The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " +"handshake automatically after doing a :meth:`socket.connect`, or whether " +"the application program will call it explicitly, by invoking " +"the :meth:`SSLSocket.do_handshake` method. " +"Calling :meth:`SSLSocket.do_handshake` explicitly gives the program control " +"over the blocking behavior of the socket I/O involved in the handshake." +msgstr "" +"پارامتر ``do_handshake_on_connect`` مشخص می‌کند که آیا دست‌دهی SSL (SSL " +"handshake) به‌طور خودکار پس از انجام :meth:`socket.connect` انجام شود، یا " +"اینکه برنامه کاربردی آن را به‌صورت صریح با فراخوانی " +"متد :meth:`SSLSocket.do_handshake` فراخوانی خواهد کرد. فراخوانی " +"صریح :meth:`SSLSocket.do_handshake` کنترل رفتار مسدودسازی ورودی/خروجی سوکت " +"درگیر در دست‌دهی را به برنامه می‌دهد." -msgid "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket.recv` method should signal unexpected EOF from the other end of the connection. If specified as :const:`True` (the default), it returns a normal EOF (an empty bytes object) in response to unexpected EOF errors raised from the underlying socket; if :const:`False`, it will raise the exceptions back to the caller." -msgstr "" +msgid "" +"The parameter ``suppress_ragged_eofs`` specifies how " +"the :meth:`SSLSocket.recv` method should signal unexpected EOF from the " +"other end of the connection. If specified as :const:`True` (the default), " +"it returns a normal EOF (an empty bytes object) in response to unexpected " +"EOF errors raised from the underlying socket; if :const:`False`, it will " +"raise the exceptions back to the caller." +msgstr "" +"پارامتر ``suppress_ragged_eofs`` مشخص می‌کند که متد :meth:`SSLSocket.recv` " +"باید EOF غیرمنتظره از سوی دیگر اتصال را چگونه اعلام کند. اگر " +"به‌صورت :const:`True` (پیش‌فرض) مشخص شده باشد، در پاسخ به خطاهای EOF " +"غیرمنتظره که از سوکت زیرین پرتاب می‌شوند، یک EOF معمولی (یک شیء bytes خالی) " +"را برمی‌گرداند؛ اگر :const:`False` باشد، استثناها را به فراخواننده پرتاب " +"خواهد کرد." msgid "*session*, see :attr:`~SSLSocket.session`." -msgstr "" +msgstr "*session*، :attr:`~SSLSocket.session` را ببینید." -msgid "To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:`SSLContext.wrap_bio`." +msgid "" +"To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, " +"use :meth:`SSLContext.wrap_bio`." msgstr "" +"برای دربرگرفتن یک :class:`SSLSocket` در یک :class:`SSLSocket` دیگر، " +"از :meth:`SSLContext.wrap_bio` استفاده کنید." -msgid "Always allow a server_hostname to be passed, even if OpenSSL does not have SNI." +msgid "" +"Always allow a server_hostname to be passed, even if OpenSSL does not have " +"SNI." msgstr "" +"همیشه اجازه دهید server_hostname ارسال شود، حتی اگر OpenSSL فاقد SNI باشد." msgid "*session* argument was added." -msgstr "" +msgstr "آرگومان *session* افزوده شد." -msgid "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead of hard-coded :class:`SSLSocket`." +msgid "" +"The method returns an instance of :attr:`SSLContext.sslsocket_class` " +"instead of hard-coded :class:`SSLSocket`." msgstr "" +"این متد به‌جای :class:`SSLSocket` سخت‌کدشده، نمونه‌ای " +"از :attr:`SSLContext.sslsocket_class` را برمی‌گرداند." -msgid "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:`SSLSocket`. The attribute can be assigned to on instances of :class:`SSLContext` in order to return a custom subclass of :class:`SSLSocket`." +msgid "" +"The return type of :meth:`SSLContext.wrap_socket`, defaults " +"to :class:`SSLSocket`. The attribute can be assigned to on instances " +"of :class:`SSLContext` in order to return a custom subclass " +"of :class:`SSLSocket`." msgstr "" +"نوع بازگشتی :meth:`SSLContext.wrap_socket`، به‌طور پیش‌فرض :class:`SSLSocket` " +"است. می‌توان این ویژگی را در نمونه‌های :class:`SSLContext` مقداردهی کرد تا یک " +"زیرکلاس سفارشی از :class:`SSLSocket` بازگردانده شود." -msgid "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL routines will read input data from the incoming BIO and write data to the outgoing BIO." +msgid "" +"Wrap the BIO objects *incoming* and *outgoing* and return an instance " +"of :attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " +"routines will read input data from the incoming BIO and write data to the " +"outgoing BIO." msgstr "" +"اشیای BIO *incoming* و *outgoing* را دربرمی‌گیرد و نمونه‌ای " +"از :attr:`SSLContext.sslobject_class` (پیش‌فرض :class:`SSLObject`) " +"برمی‌گرداند. روال‌های SSL داده‌های ورودی را از BIO ورودی می‌خوانند و داده‌ها را " +"در BIO خروجی می‌نویسند." -msgid "The *server_side*, *server_hostname* and *session* parameters have the same meaning as in :meth:`SSLContext.wrap_socket`." +msgid "" +"The *server_side*, *server_hostname* and *session* parameters have the same " +"meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" +"پارامترهای *server_side*، *server_hostname* و *session* همان معنایی را " +"دارند که در :meth:`SSLContext.wrap_socket` آمده است." -msgid "The method returns an instance of :attr:`SSLContext.sslobject_class` instead of hard-coded :class:`SSLObject`." +msgid "" +"The method returns an instance of :attr:`SSLContext.sslobject_class` " +"instead of hard-coded :class:`SSLObject`." msgstr "" +"این متد به‌جای :class:`SSLObject` سخت‌کد، نمونه‌ای " +"از :attr:`SSLContext.sslobject_class` را برمی‌گرداند." -msgid "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:`SSLObject`. The attribute can be overridden on instance of class in order to return a custom subclass of :class:`SSLObject`." +msgid "" +"The return type of :meth:`SSLContext.wrap_bio`, defaults " +"to :class:`SSLObject`. The attribute can be overridden on instance of class " +"in order to return a custom subclass of :class:`SSLObject`." msgstr "" +"نوع بازگشتی :meth:`SSLContext.wrap_bio`، به‌طور پیش‌فرض :class:`SSLObject` " +"است. می‌توان این ویژگی را در نمونه‌ای از کلاس بازنویسی کرد تا یک زیرکلاس " +"سفارشی از :class:`SSLObject` بازگردانده شود." -msgid "Get statistics about the SSL sessions created or managed by this context. A dictionary is returned which maps the names of each `piece of information `_ to their numeric values. For example, here is the total number of hits and misses in the session cache since the context was created::" -msgstr "" +msgid "" +"Get statistics about the SSL sessions created or managed by this context. A " +"dictionary is returned which maps the names of each `piece of information " +"`_ to their " +"numeric values. For example, here is the total number of hits and misses " +"in the session cache since the context was created::" +msgstr "" +"آمار نشست‌های SSL ایجادشده یا مدیریت‌شده توسط این زمینه را دریافت کنید. یک " +"دیکشنری بازگردانده می‌شود که نام هر `قطعه‌ای از اطلاعات `_ را به مقدار عددی آن " +"نگاشت می‌کند. برای مثال، در اینجا تعداد کل برخوردها و عدم‌برخوردها در نهانگاه " +"نشست از زمان ایجاد زمینه آمده است::" msgid "" ">>> stats = context.session_stats()\n" ">>> stats['hits'], stats['misses']\n" "(0, 0)" msgstr "" +">>> stats = context.session_stats()\n" +">>> stats['hits'], stats['misses']\n" +"(0, 0)" -msgid "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass *server_hostname* to :meth:`~SSLContext.wrap_socket` in order to match the hostname. Enabling hostname checking automatically sets :attr:`~SSLContext.verify_mode` from :data:`CERT_NONE` to :data:`CERT_REQUIRED`. It cannot be set back to :data:`CERT_NONE` as long as hostname checking is enabled. The :data:`PROTOCOL_TLS_CLIENT` protocol enables hostname checking by default. With other protocols, hostname checking must be enabled explicitly." -msgstr "" +msgid "" +"Whether to match the peer cert's hostname " +"in :meth:`SSLSocket.do_handshake`. The " +"context's :attr:`~SSLContext.verify_mode` must be set " +"to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass " +"*server_hostname* to :meth:`~SSLContext.wrap_socket` in order to match the " +"hostname. Enabling hostname checking automatically " +"sets :attr:`~SSLContext.verify_mode` from :data:`CERT_NONE` " +"to :data:`CERT_REQUIRED`. It cannot be set back to :data:`CERT_NONE` as " +"long as hostname checking is enabled. The :data:`PROTOCOL_TLS_CLIENT` " +"protocol enables hostname checking by default. With other protocols, " +"hostname checking must be enabled explicitly." +msgstr "" +"اینکه آیا باید نام میزبان گواهی همتا در :meth:`SSLSocket.do_handshake` " +"تطبیق داده شود یا خیر. :attr:`~SSLContext.verify_mode` زمینه باید " +"روی :data:`CERT_OPTIONAL` یا :data:`CERT_REQUIRED` تنظیم شده باشد و شما " +"باید برای تطبیق نام میزبان، *server_hostname* را " +"به :meth:`~SSLContext.wrap_socket` ارسال کنید. فعال‌سازی بررسی نام " +"میزبان، :attr:`~SSLContext.verify_mode` را به‌طور خودکار " +"از :data:`CERT_NONE` به :data:`CERT_REQUIRED` تنظیم می‌کند. تا زمانی که " +"بررسی نام میزبان فعال است، نمی‌توان آن را دوباره روی :data:`CERT_NONE` تنظیم " +"کرد. پروتکل :data:`PROTOCOL_TLS_CLIENT` بررسی نام میزبان را به‌صورت پیش‌فرض " +"فعال می‌کند. در پروتکل‌های دیگر، بررسی نام میزبان باید به‌صورت صریح فعال شود." msgid "" "import socket, ssl\n" @@ -1191,90 +2851,243 @@ msgid "" "ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')\n" "ssl_sock.connect(('www.verisign.com', 443))" msgstr "" +"import socket, ssl\n" +"\n" +"context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)\n" +"context.verify_mode = ssl.CERT_REQUIRED\n" +"context.check_hostname = True\n" +"context.load_default_certs()\n" +"\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')\n" +"ssl_sock.connect(('www.verisign.com', 443))" -msgid ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext.verify_mode` is :data:`CERT_NONE`. Previously the same operation would have failed with a :exc:`ValueError`." +msgid "" +":attr:`~SSLContext.verify_mode` is now automatically changed " +"to :data:`CERT_REQUIRED` when hostname checking is enabled " +"and :attr:`~SSLContext.verify_mode` is :data:`CERT_NONE`. Previously the " +"same operation would have failed with a :exc:`ValueError`." msgstr "" +":attr:`~SSLContext.verify_mode` اکنون هنگامی که بررسی نام میزبان فعال باشد " +"و :attr:`~SSLContext.verify_mode` برابر :data:`CERT_NONE ` " +"باشد، به‌طور خودکار به :data:`CERT_REQUIRED ` تغییر می‌یابد. پیش " +"از این، همین عملیات با :exc:`ValueError` شکست می‌خورد." -msgid "Write TLS keys to a keylog file, whenever key material is generated or received. The keylog file is designed for debugging purposes only. The file format is specified by NSS and used by many traffic analyzers such as Wireshark. The log file is opened in append-only mode. Writes are synchronized between threads, but not between processes." -msgstr "" +msgid "" +"Write TLS keys to a keylog file, whenever key material is generated or " +"received. The keylog file is designed for debugging purposes only. The file " +"format is specified by NSS and used by many traffic analyzers such as " +"Wireshark. The log file is opened in append-only mode. Writes are " +"synchronized between threads, but not between processes." +msgstr "" +"کلیدهای TLS را هر زمان که ماده‌ی کلید (key material) تولید یا دریافت شود، در " +"یک فایل گزارش کلید (keylog file) می‌نویسد. فایل گزارش کلید فقط برای اهداف " +"اشکال‌زدایی طراحی شده است. قالب فایل توسط NSS مشخص شده است و توسط بسیاری از " +"تحلیل‌گرهای ترافیک مانند Wireshark استفاده می‌شود. فایل گزارش در حالت فقط-" +"افزودنی (append-only) باز می‌شود. نوشتن‌ها بین نخ‌ها همگام‌سازی می‌شوند، اما بین " +"فرآیندها همگام‌سازی نمی‌شوند." -msgid "A :class:`TLSVersion` enum member representing the highest supported TLS version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The attribute is read-only for protocols other than :const:`PROTOCOL_TLS`, :const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." -msgstr "" +msgid "" +"A :class:`TLSVersion` enum member representing the highest supported TLS " +"version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " +"attribute is read-only for protocols other " +"than :const:`PROTOCOL_TLS`, :const:`PROTOCOL_TLS_CLIENT`, " +"and :const:`PROTOCOL_TLS_SERVER`." +msgstr "" +"یک عضو enum از :class:`TLSVersion` که نشان‌دهنده‌ی بالاترین نسخه‌ی پشتیبانی‌شده‌ی " +"TLS است. مقدار آن به‌طور پیش‌فرض برابر " +"با :attr:`TLSVersion.MAXIMUM_SUPPORTED` است. این ویژگی برای پروتکل‌هایی غیر " +"از :const:`PROTOCOL_TLS`، :const:`PROTOCOL_TLS_CLIENT` " +"و :const:`PROTOCOL_TLS_SERVER` فقط‌خواندنی است." -msgid "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext.minimum_version` and :attr:`SSLContext.options` all affect the supported SSL and TLS versions of the context. The implementation does not prevent invalid combinations. For example a context with :attr:`OP_NO_TLSv1_2` in :attr:`~SSLContext.options` and :attr:`~SSLContext.maximum_version` set to :attr:`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." -msgstr "" +msgid "" +"The " +"attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext.minimum_version` " +"and :attr:`SSLContext.options` all affect the supported SSL and TLS " +"versions of the context. The implementation does not prevent invalid " +"combinations. For example a context with :attr:`OP_NO_TLSv1_2` " +"in :attr:`~SSLContext.options` and :attr:`~SSLContext.maximum_version` set " +"to :attr:`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 " +"connection." +msgstr "" +"ویژگی‌های :attr:`~SSLContext.maximum_version`، :attr:`~SSLContext.minimum_version` " +"و :attr:`SSLContext.options` همگی بر نسخه‌های پشتیبانی‌شده‌ی SSL و TLS زمینه " +"اثر می‌گذارند. پیاده‌سازی از ترکیب‌های نامعتبر جلوگیری نمی‌کند. برای مثال، " +"زمینه‌ای که در :attr:`~SSLContext.options` آن :attr:`OP_NO_TLSv1_2` وجود " +"دارد و :attr:`~SSLContext.maximum_version` آن " +"روی :attr:`TLSVersion.TLSv1_2` تنظیم شده است، نمی‌تواند یک اتصال TLS 1.2 " +"برقرار کند." -msgid "Like :attr:`SSLContext.maximum_version` except it is the lowest supported version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." +msgid "" +"Like :attr:`SSLContext.maximum_version` except it is the lowest supported " +"version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" +"مانند :attr:`SSLContext.maximum_version` است، با این تفاوت که پایین‌ترین " +"نسخه پشتیبانی‌شده یا :attr:`TLSVersion.MINIMUM_SUPPORTED` است." -msgid "Control the number of TLS 1.3 session tickets of a :const:`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 connections." +msgid "" +"Control the number of TLS 1.3 session tickets of " +"a :const:`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS " +"1.0 to 1.2 connections." msgstr "" +"تعداد بلیت‌های نشست (session tickets) TLS 1.3 برای یک " +"زمینه :const:`PROTOCOL_TLS_SERVER` را کنترل کنید. این تنظیم تأثیری بر " +"اتصالات TLS 1.0 تا 1.2 ندارد." -msgid "An integer representing the set of SSL options enabled on this context. The default value is :data:`OP_ALL`, but you can specify other options such as :data:`OP_NO_SSLv2` by ORing them together." +msgid "" +"An integer representing the set of SSL options enabled on this context. The " +"default value is :data:`OP_ALL`, but you can specify other options such " +"as :data:`OP_NO_SSLv2` by ORing them together." msgstr "" +"عدد صحیحی که مجموعه‌ی گزینه‌های SSL فعال در این زمینه را نشان می‌دهد. مقدار " +"پیش‌فرض :data:`OP_ALL` است، اما می‌توانید گزینه‌های دیگری " +"مانند :data:`OP_NO_SSLv2` را با OR کردن آن‌ها با یکدیگر مشخص کنید." msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" -msgstr "" +msgstr ":attr:`SSLContext.options` پرچم‌های :class:`Options` را برمی‌گرداند:" -msgid "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext.maximum_version` instead." +msgid "" +"All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " +"Python 3.7. Use :attr:`SSLContext.minimum_version` " +"and :attr:`SSLContext.maximum_version` instead." msgstr "" +"همه‌ی گزینه‌های ``OP_NO_SSL*`` و ``OP_NO_TLS*`` از پایتون 3.7 منسوخ شده‌اند. " +"در عوض از :attr:`SSLContext.minimum_version` " +"و :attr:`SSLContext.maximum_version` استفاده کنید." -msgid "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is disabled by default and a server can only request a TLS client certificate during the initial handshake. When enabled, a server may request a TLS client certificate at any time after the handshake." +msgid "" +"Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " +"disabled by default and a server can only request a TLS client certificate " +"during the initial handshake. When enabled, a server may request a TLS " +"client certificate at any time after the handshake." msgstr "" +"احراز هویت کلاینت پس از دست‌دهی (post-handshake) در TLS 1.3 را فعال کنید. " +"احراز هویت پس از دست‌دهی به‌طور پیش‌فرض غیرفعال است و یک سرور تنها می‌تواند در " +"حین دست‌دهی اولیه، یک گواهی کلاینت TLS را درخواست کند. هنگامی که فعال " +"باشد، یک سرور می‌تواند در هر زمانی پس از دست‌دهی، یک گواهی کلاینت TLS را " +"درخواست کند." -msgid "When enabled on client-side sockets, the client signals the server that it supports post-handshake authentication." +msgid "" +"When enabled on client-side sockets, the client signals the server that it " +"supports post-handshake authentication." msgstr "" +"هنگامی که روی سوکت‌های سمت کلاینت فعال شود، کلاینت به سرور علامت می‌دهد که از " +"احراز هویت پس از دست‌دهی (post-handshake authentication) پشتیبانی می‌کند." -msgid "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual client cert exchange is delayed until :meth:`SSLSocket.verify_client_post_handshake` is called and some I/O is performed." -msgstr "" +msgid "" +"When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " +"set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " +"client cert exchange is delayed " +"until :meth:`SSLSocket.verify_client_post_handshake` is called and some I/O " +"is performed." +msgstr "" +"هنگامی که در سوکت‌های سمت سرور فعال باشد، :attr:`SSLContext.verify_mode` نیز " +"باید روی :data:`CERT_OPTIONAL` یا :data:`CERT_REQUIRED` تنظیم شود. تبادل " +"واقعی گواهی کلاینت تا زمانی " +"که :meth:`SSLSocket.verify_client_post_handshake` فراخوانی شود و مقداری " +"ورودی/خروجی انجام شود، به تعویق می‌افتد." -msgid "The protocol version chosen when constructing the context. This attribute is read-only." -msgstr "" +msgid "" +"The protocol version chosen when constructing the context. This attribute " +"is read-only." +msgstr "نسخه‌ی پروتکل انتخاب‌شده هنگام ساخت زمینه. این ویژگی فقط‌خواندنی است." -msgid "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's subject common name in the absence of a subject alternative name extension (default: true)." +msgid "" +"Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " +"subject common name in the absence of a subject alternative name extension " +"(default: true)." msgstr "" +"اینکه آیا :attr:`~SSLContext.check_hostname` در نبود افزونه‌ی نام جایگزین " +"موضوع، برای تأیید نام مشترک موضوع گواهی به‌عنوان حالت جایگزین عمل می‌کند یا " +"خیر (پیش‌فرض: true)." -msgid "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, 3.9.3, and 3.10 include workarounds for previous versions." +msgid "" +"The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " +"3.9.3, and 3.10 include workarounds for previous versions." msgstr "" +"این پرچم در OpenSSL پیش از نسخه 1.1.1l تاثیری نداشت. پایتون 3.8.9، 3.9.3 و " +"3.10 شامل راه‌حل‌های موقتی برای نسخه‌های پیشین هستند." -msgid "An integer representing the `security level `_ for the context. This attribute is read-only." +msgid "" +"An integer representing the `security level `_ for the context. This attribute " +"is read-only." msgstr "" +"یک عدد صحیح که `سطح امنیت `_ زمینه را نشان می‌دهد. این ویژگی فقط‌خواندنی " +"است." -msgid "The flags for certificate verification operations. You can set flags like :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does neither require nor verify certificate revocation lists (CRLs)." +msgid "" +"The flags for certificate verification operations. You can set flags " +"like :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default " +"OpenSSL does neither require nor verify certificate revocation lists (CRLs)." msgstr "" +"پرچم‌ها برای عملیات تأیید صحت گواهی. می‌توانید پرچم‌هایی " +"مانند :data:`VERIFY_CRL_CHECK_LEAF` را با OR کردن آن‌ها با یکدیگر تنظیم " +"کنید. به‌طور پیش‌فرض، OpenSSL نه به فهرست‌های ابطال گواهی (CRLs) نیاز دارد " +"و نه آن‌ها را تأیید صحت می‌کند." msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr "" +":attr:`SSLContext.verify_flags` پرچم‌های :class:`VerifyFlags` را برمی‌گرداند:" -msgid "Whether to try to verify other peers' certificates and how to behave if verification fails. This attribute must be one of :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." +msgid "" +"Whether to try to verify other peers' certificates and how to behave if " +"verification fails. This attribute must be one " +"of :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" +"اینکه آیا باید برای تأیید گواهی‌های سایر همتایان تلاش شود و در صورت شکست " +"تأیید، چگونه رفتار شود. این ویژگی باید یکی " +"از :data:`CERT_NONE`، :data:`CERT_OPTIONAL` یا :data:`CERT_REQUIRED` باشد." msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr "" +":attr:`SSLContext.verify_mode` یک enum از :class:`VerifyMode` برمی‌گرداند:" -msgid "Enables TLS-PSK (pre-shared key) authentication on a client-side connection." +msgid "" +"Enables TLS-PSK (pre-shared key) authentication on a client-side connection." msgstr "" +"احراز هویت TLS-PSK (کلید از پیش اشتراک‌گذاشته‌شده) را روی یک اتصال سمت کلاینت " +"فعال می‌کند." -msgid "In general, certificate based authentication should be preferred over this method." -msgstr "" +msgid "" +"In general, certificate based authentication should be preferred over this " +"method." +msgstr "به‌طور کلی، احراز هویت مبتنی بر گواهی باید بر این روش ترجیح داده شود." -msgid "The parameter ``callback`` is a callable object with the signature: ``def callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` parameter is an optional identity hint sent by the server. The return value is a tuple in the form (client-identity, psk). Client-identity is an optional string which may be used by the server to select a corresponding PSK for the client. The string must be less than or equal to ``256`` octets when UTF-8 encoded. PSK is a :term:`bytes-like object` representing the pre-shared key. Return a zero length PSK to reject the connection." -msgstr "" +msgid "" +"The parameter ``callback`` is a callable object with the signature: ``def " +"callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` " +"parameter is an optional identity hint sent by the server. The return value " +"is a tuple in the form (client-identity, psk). Client-identity is an " +"optional string which may be used by the server to select a corresponding " +"PSK for the client. The string must be less than or equal to ``256`` octets " +"when UTF-8 encoded. PSK is a :term:`bytes-like object` representing the pre-" +"shared key. Return a zero length PSK to reject the connection." +msgstr "" +"پارامتر ``callback`` یک شیء فراخوان‌پذیر با امضای زیر است: ``def " +"callback(hint: str | None) -> tuple[str | None, bytes]``. پارامتر ``hint`` " +"یک راهنمای هویت اختیاری است که توسط سرور ارسال می‌شود. مقدار بازگشتی یک تاپل " +"به‌شکل (client-identity, psk) است. client-identity یک رشته اختیاری است که " +"ممکن است سرور از آن برای انتخاب یک PSK متناظر برای کلاینت استفاده کند. این " +"رشته باید هنگام کدگذاری با UTF-8 کمتر یا مساوی ``256`` هشت‌بیتی باشد. PSK " +"یک :term:`bytes-like object` است که کلید از پیش اشتراک‌گذاری‌شده را نشان " +"می‌دهد. برای رد کردن اتصال، یک PSK با طول صفر برگردانید." msgid "Setting ``callback`` to :const:`None` removes any existing callback." -msgstr "" +msgstr "با تنظیم ``callback`` به :const:`None`، هر کال‌بک موجود حذف می‌شود." msgid "When using TLS 1.3:" -msgstr "" +msgstr "هنگام استفاده از TLS 1.3:" msgid "the ``hint`` parameter is always :const:`None`." -msgstr "" +msgstr "پارامتر ``hint`` همیشه :const:`None` است." msgid "client-identity must be a non-empty string." -msgstr "" +msgstr "client-identity باید یک رشته غیرخالی باشد." msgid "Example usage::" -msgstr "" +msgstr "نمونه استفاده::" msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" @@ -1295,21 +3108,65 @@ msgid "" " return 'ClientId_1', psk_table.get(hint, b'')\n" "context.set_psk_client_callback(callback)" msgstr "" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" +"context.check_hostname = False\n" +"context.verify_mode = ssl.CERT_NONE\n" +"context.maximum_version = ssl.TLSVersion.TLSv1_2\n" +"context.set_ciphers('PSK')\n" +"\n" +"# یک لامبدا (lambda) ساده:\n" +"psk = bytes.fromhex('c0ffee')\n" +"context.set_psk_client_callback(lambda hint: (None, psk))\n" +"\n" +"# یک جدول با استفاده از راهنما (hint) از سرور:\n" +"psk_table = { 'ServerId_1': bytes.fromhex('c0ffee'),\n" +" 'ServerId_2': bytes.fromhex('facade')\n" +"}\n" +"def callback(hint):\n" +" return 'ClientId_1', psk_table.get(hint, b'')\n" +"context.set_psk_client_callback(callback)" -msgid "This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is ``False``." +msgid "" +"This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is " +"``False``." msgstr "" +"این متد در صورتی که :data:`HAS_PSK` برابر ``False`` " +"باشد، :exc:`NotImplementedError` را پرتاب خواهد کرد." -msgid "Enables TLS-PSK (pre-shared key) authentication on a server-side connection." +msgid "" +"Enables TLS-PSK (pre-shared key) authentication on a server-side connection." msgstr "" +"احراز هویت TLS-PSK (کلید از پیش اشتراک‌گذاشته‌شده) را در یک اتصال سمت سرور " +"فعال می‌کند." -msgid "The parameter ``callback`` is a callable object with the signature: ``def callback(identity: str | None) -> bytes``. The ``identity`` parameter is an optional identity sent by the client which can be used to select a corresponding PSK. The return value is a :term:`bytes-like object` representing the pre-shared key. Return a zero length PSK to reject the connection." -msgstr "" +msgid "" +"The parameter ``callback`` is a callable object with the signature: ``def " +"callback(identity: str | None) -> bytes``. The ``identity`` parameter is an " +"optional identity sent by the client which can be used to select a " +"corresponding PSK. The return value is a :term:`bytes-like object` " +"representing the pre-shared key. Return a zero length PSK to reject the " +"connection." +msgstr "" +"پارامتر ``callback`` یک شیء فراخوان‌پذیر با امضای ``def callback(identity: " +"str | None) -> bytes`` است. پارامتر ``identity`` یک هویت اختیاری ارسال‌شده " +"از سوی کلاینت است که می‌توان از آن برای انتخاب یک PSK متناظر استفاده کرد. " +"مقدار بازگشتی یک :term:`bytes-like object` است که کلید از پیش به اشتراک " +"گذاشته‌شده را نشان می‌دهد. برای رد کردن اتصال، یک PSK با طول صفر برگردانید." -msgid "The parameter ``identity_hint`` is an optional identity hint string sent to the client. The string must be less than or equal to ``256`` octets when UTF-8 encoded." +msgid "" +"The parameter ``identity_hint`` is an optional identity hint string sent to " +"the client. The string must be less than or equal to ``256`` octets when " +"UTF-8 encoded." msgstr "" +"پارامتر ``identity_hint`` یک رشته‌ی راهنمای هویت اختیاری است که به کارخواه " +"ارسال می‌شود. این رشته باید هنگام کدگذاری با UTF-8 کمتر یا مساوی ``256`` " +"هشت‌بیتی باشد." -msgid "When using TLS 1.3 the ``identity_hint`` parameter is not sent to the client." +msgid "" +"When using TLS 1.3 the ``identity_hint`` parameter is not sent to the " +"client." msgstr "" +"هنگام استفاده از TLS 1.3، پارامتر ``identity_hint`` به کلاینت ارسال نمی‌شود." msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" @@ -1328,33 +3185,129 @@ msgid "" " return psk_table.get(identity, b'')\n" "context.set_psk_server_callback(callback, 'ServerId_1')" msgstr "" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" +"context.maximum_version = ssl.TLSVersion.TLSv1_2\n" +"context.set_ciphers('PSK')\n" +"\n" +"# یک لامبدای ساده (lambda):\n" +"psk = bytes.fromhex('c0ffee')\n" +"context.set_psk_server_callback(lambda identity: psk)\n" +"\n" +"# یک جدول با استفاده از هویت سرویس‌گیرنده (client):\n" +"psk_table = { 'ClientId_1': bytes.fromhex('c0ffee'),\n" +" 'ClientId_2': bytes.fromhex('facade')\n" +"}\n" +"def callback(identity):\n" +" return psk_table.get(identity, b'')\n" +"context.set_psk_server_callback(callback, 'ServerId_1')" msgid "Certificates" -msgstr "" +msgstr "گواهی‌ها" -msgid "Certificates in general are part of a public-key / private-key system. In this system, each *principal*, (which may be a machine, or a person, or an organization) is assigned a unique two-part encryption key. One part of the key is public, and is called the *public key*; the other part is kept secret, and is called the *private key*. The two parts are related, in that if you encrypt a message with one of the parts, you can decrypt it with the other part, and **only** with the other part." -msgstr "" +msgid "" +"Certificates in general are part of a public-key / private-key system. In " +"this system, each *principal*, (which may be a machine, or a person, or an " +"organization) is assigned a unique two-part encryption key. One part of " +"the key is public, and is called the *public key*; the other part is kept " +"secret, and is called the *private key*. The two parts are related, in " +"that if you encrypt a message with one of the parts, you can decrypt it " +"with the other part, and **only** with the other part." +msgstr "" +"گواهی‌ها به‌طور کلی بخشی از یک سیستم کلید عمومی / کلید خصوصی هستند. در این " +"سیستم، به هر *اصل* (principal) (که ممکن است یک ماشین، یک شخص، یا یک سازمان " +"باشد) یک کلید رمزنگاری دوبخشی یکتا اختصاص داده می‌شود. یک بخش از کلید عمومی " +"است و *کلید عمومی* نامیده می‌شود؛ بخش دیگر مخفی نگه داشته می‌شود و *کلید " +"خصوصی* نامیده می‌شود. این دو بخش با هم مرتبط هستند، به این معنا که اگر پیامی " +"را با یکی از بخش‌ها رمزنگاری کنید، می‌توانید آن را با بخش دیگر رمزگشایی کنید، " +"و **فقط** با بخش دیگر." -msgid "A certificate contains information about two principals. It contains the name of a *subject*, and the subject's public key. It also contains a statement by a second principal, the *issuer*, that the subject is who they claim to be, and that this is indeed the subject's public key. The issuer's statement is signed with the issuer's private key, which only the issuer knows. However, anyone can verify the issuer's statement by finding the issuer's public key, decrypting the statement with it, and comparing it to the other information in the certificate. The certificate also contains information about the time period over which it is valid. This is expressed as two fields, called \"notBefore\" and \"notAfter\"." -msgstr "" +msgid "" +"A certificate contains information about two principals. It contains the " +"name of a *subject*, and the subject's public key. It also contains a " +"statement by a second principal, the *issuer*, that the subject is who they " +"claim to be, and that this is indeed the subject's public key. The " +"issuer's statement is signed with the issuer's private key, which only the " +"issuer knows. However, anyone can verify the issuer's statement by finding " +"the issuer's public key, decrypting the statement with it, and comparing it " +"to the other information in the certificate. The certificate also contains " +"information about the time period over which it is valid. This is " +"expressed as two fields, called \"notBefore\" and \"notAfter\"." +msgstr "" +"یک گواهی حاوی اطلاعاتی درباره دو طرف (principal) است. این گواهی حاوی نام یک " +"*موضوع* و کلید عمومی آن موضوع است. همچنین حاوی اظهار طرف دوم، یعنی " +"*صادرکننده*، است مبنی بر اینکه موضوع همان هویتی است که ادعا می‌کند، و اینکه " +"این کلید واقعاً کلید عمومی موضوع است. اظهار صادرکننده با کلید خصوصی " +"صادرکننده امضا شده است، که تنها صادرکننده آن را می‌داند. با این حال، هر کسی " +"می‌تواند با یافتن کلید عمومی صادرکننده، رمزگشایی اظهار با آن کلید، و مقایسه " +"آن با سایر اطلاعات موجود در گواهی، صحت اظهار صادرکننده را تأیید کند. گواهی " +"همچنین حاوی اطلاعاتی درباره بازه زمانی اعتبار آن است. این موضوع به‌صورت دو " +"فیلد با نام‌های \"notBefore\" و \"notAfter\" بیان می‌شود." -msgid "In the Python use of certificates, a client or server can use a certificate to prove who they are. The other side of a network connection can also be required to produce a certificate, and that certificate can be validated to the satisfaction of the client or server that requires such validation. The connection attempt can be set to raise an exception if the validation fails. Validation is done automatically, by the underlying OpenSSL framework; the application need not concern itself with its mechanics. But the application does usually need to provide sets of certificates to allow this process to take place." -msgstr "" +msgid "" +"In the Python use of certificates, a client or server can use a certificate " +"to prove who they are. The other side of a network connection can also be " +"required to produce a certificate, and that certificate can be validated to " +"the satisfaction of the client or server that requires such validation. " +"The connection attempt can be set to raise an exception if the validation " +"fails. Validation is done automatically, by the underlying OpenSSL " +"framework; the application need not concern itself with its mechanics. But " +"the application does usually need to provide sets of certificates to allow " +"this process to take place." +msgstr "" +"در کاربرد گواهی‌ها در پایتون، یک کلاینت یا سرور می‌تواند از یک گواهی برای " +"اثبات هویت خود استفاده کند. همچنین می‌توان از طرف دیگر یک اتصال شبکه خواست " +"که گواهی‌ای ارائه دهد، و آن گواهی می‌تواند تا حد رضایت کلاینت یا سروری که " +"چنین اعتبارسنجی‌ای را لازم می‌داند، اعتبارسنجی شود. می‌توان تلاش اتصال را طوری " +"تنظیم کرد که در صورت ناموفق بودن اعتبارسنجی، استثنایی پرتاب کند. اعتبارسنجی " +"به‌طور خودکار توسط چارچوب OpenSSL زیرین انجام می‌شود؛ برنامه نیازی ندارد " +"نگران سازوکار آن باشد. اما برنامه معمولاً نیاز دارد مجموعه‌هایی از گواهی‌ها را " +"فراهم کند تا این فرایند انجام شود." -msgid "Python uses files to contain certificates. They should be formatted as \"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a header line and a footer line::" +msgid "" +"Python uses files to contain certificates. They should be formatted as " +"\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " +"header line and a footer line::" msgstr "" +"پایتون از فایل‌ها برای نگهداری گواهی‌نامه‌ها استفاده می‌کند. آن‌ها باید با قالب " +"«PEM» باشند (به :rfc:`1422` مراجعه کنید)، که یک قالب کدگذاری‌شده به base-64 " +"است و با یک خط سرآیند و یک خط پایانی احاطه شده است::" msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" msgstr "" +"-----BEGIN CERTIFICATE-----\n" +"... (certificate in base64 PEM encoding) ...\n" +"-----END CERTIFICATE-----" msgid "Certificate chains" -msgstr "" +msgstr "زنجیره‌های گواهی" -msgid "The Python files which contain certificates can contain a sequence of certificates, sometimes called a *certificate chain*. This chain should start with the specific certificate for the principal who \"is\" the client or server, and then the certificate for the issuer of that certificate, and then the certificate for the issuer of *that* certificate, and so on up the chain till you get to a certificate which is *self-signed*, that is, a certificate which has the same subject and issuer, sometimes called a *root certificate*. The certificates should just be concatenated together in the certificate file. For example, suppose we had a three certificate chain, from our server certificate to the certificate of the certification authority that signed our server certificate, to the root certificate of the agency which issued the certification authority's certificate::" -msgstr "" +msgid "" +"The Python files which contain certificates can contain a sequence of " +"certificates, sometimes called a *certificate chain*. This chain should " +"start with the specific certificate for the principal who \"is\" the client " +"or server, and then the certificate for the issuer of that certificate, and " +"then the certificate for the issuer of *that* certificate, and so on up the " +"chain till you get to a certificate which is *self-signed*, that is, a " +"certificate which has the same subject and issuer, sometimes called a *root " +"certificate*. The certificates should just be concatenated together in the " +"certificate file. For example, suppose we had a three certificate chain, " +"from our server certificate to the certificate of the certification " +"authority that signed our server certificate, to the root certificate of " +"the agency which issued the certification authority's certificate::" +msgstr "" +"فایل‌های پایتون که حاوی گواهی‌ها هستند، می‌توانند حاوی دنباله‌ای از گواهی‌ها " +"باشند که گاهی به آن *زنجیره گواهی* می‌گویند. این زنجیره باید با گواهی مشخص " +"برای هویتی که کارخواه یا سرور «است» آغاز شود، سپس با گواهی برای صادرکننده " +"آن گواهی، و سپس با گواهی برای صادرکننده *آن* گواهی، و به همین ترتیب تا " +"بالای زنجیره ادامه یابد تا به گواهی‌ای برسید که *خودامضا* است، یعنی گواهی‌ای " +"که موضوع و صادرکننده یکسانی دارد و گاهی به آن *گواهی ریشه* می‌گویند. گواهی‌ها " +"باید فقط در فایل گواهی به یکدیگر الحاق شوند. برای مثال، فرض کنید یک زنجیره " +"سه‌گواهی داشتیم، از گواهی سرور ما تا گواهی مرجع صدور گواهی که گواهی سرور ما " +"را امضا کرده است، تا گواهی ریشه سازمانی که گواهی مرجع صدور گواهی را صادر " +"کرده است::" msgid "" "-----BEGIN CERTIFICATE-----\n" @@ -1367,18 +3320,52 @@ msgid "" "... (the root certificate for the CA's issuer)...\n" "-----END CERTIFICATE-----" msgstr "" +"-----BEGIN CERTIFICATE-----\n" +"... (گواهی برای سرور شما)...\n" +"-----END CERTIFICATE-----\n" +"-----BEGIN CERTIFICATE-----\n" +"... (گواهی برای CA)...\n" +"-----END CERTIFICATE-----\n" +"-----BEGIN CERTIFICATE-----\n" +"... (گواهی ریشه برای صادرکننده‌ی CA)...\n" +"-----END CERTIFICATE-----" msgid "CA certificates" -msgstr "" +msgstr "گواهی‌های CA" -msgid "If you are going to require validation of the other side of the connection's certificate, you need to provide a \"CA certs\" file, filled with the certificate chains for each issuer you are willing to trust. Again, this file just contains these chains concatenated together. For validation, Python will use the first chain it finds in the file which matches. The platform's certificates file can be used by calling :meth:`SSLContext.load_default_certs`, this is done automatically with :func:`.create_default_context`." -msgstr "" +msgid "" +"If you are going to require validation of the other side of the " +"connection's certificate, you need to provide a \"CA certs\" file, filled " +"with the certificate chains for each issuer you are willing to trust. " +"Again, this file just contains these chains concatenated together. For " +"validation, Python will use the first chain it finds in the file which " +"matches. The platform's certificates file can be used by " +"calling :meth:`SSLContext.load_default_certs`, this is done automatically " +"with :func:`.create_default_context`." +msgstr "" +"اگر می‌خواهید اعتبارسنجی گواهی طرف دیگر اتصال را الزامی کنید، باید یک فایل " +"«گواهی‌های CA» فراهم کنید که حاوی زنجیره‌های گواهی برای هر صادرکننده‌ای باشد " +"که مایل به اعتماد به آن هستید. باز هم، این فایل فقط شامل این زنجیره‌ها است " +"که به‌هم‌پیوسته شده‌اند. برای اعتبارسنجی، پایتون از اولین زنجیره‌ای استفاده " +"می‌کند که در فایل یافت شود و مطابقت داشته باشد. می‌توان با " +"فراخوانی :meth:`SSLContext.load_default_certs` از فایل گواهی‌های پلتفرم " +"استفاده کرد؛ این کار به‌صورت خودکار با :func:`.create_default_context` انجام " +"می‌شود." msgid "Combined key and certificate" -msgstr "" +msgstr "کلید و گواهی‌ی ترکیبی" -msgid "Often the private key is stored in the same file as the certificate; in this case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` needs to be passed. If the private key is stored with the certificate, it should come before the first certificate in the certificate chain::" +msgid "" +"Often the private key is stored in the same file as the certificate; in " +"this case, only the ``certfile`` parameter " +"to :meth:`SSLContext.load_cert_chain` needs to be passed. If the private " +"key is stored with the certificate, it should come before the first " +"certificate in the certificate chain::" msgstr "" +"اغلب کلید خصوصی در همان فایل گواهی ذخیره می‌شود؛ در این صورت، فقط باید " +"پارامتر ``certfile`` را به :meth:`SSLContext.load_cert_chain` ارسال کنید. " +"اگر کلید خصوصی همراه گواهی ذخیره شده باشد، باید قبل از اولین گواهی در " +"زنجیره گواهی قرار گیرد::" msgid "" "-----BEGIN RSA PRIVATE KEY-----\n" @@ -1388,14 +3375,55 @@ msgid "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" msgstr "" +"-----BEGIN RSA PRIVATE KEY-----\n" +"... (کلید خصوصی با کدگذاری base64) ...\n" +"-----END RSA PRIVATE KEY-----\n" +"-----BEGIN CERTIFICATE-----\n" +"... (گواهی با کدگذاری base64 PEM) ...\n" +"-----END CERTIFICATE-----" msgid "Self-signed certificates" -msgstr "" +msgstr "گواهی‌های خودامضا" + +msgid "" +"If you are going to create a server that provides SSL-encrypted connection " +"services, you will need to acquire a certificate for that service. There " +"are many ways of acquiring appropriate certificates, such as buying one " +"from a certification authority. Another common practice is to generate a " +"self-signed certificate. The simplest way to do this is with the OpenSSL " +"package, using something like the following::" +msgstr "" +"اگر می‌خواهید سروری بسازید که خدمات اتصال رمزگذاری‌شده با SSL را ارائه دهد، " +"باید برای آن خدمت یک گواهی تهیه کنید. روش‌های زیادی برای تهیه " +"گواهی‌های مناسب وجود دارد، مانند خرید یک گواهی از یک مرجع صدور " +"گواهی. یک روش رایج دیگر، تولید یک گواهی خودامضا است. ساده‌ترین راه " +"برای انجام این کار، استفاده از بسته OpenSSL، با موردی مانند زیر است::" -msgid "If you are going to create a server that provides SSL-encrypted connection services, you will need to acquire a certificate for that service. There are many ways of acquiring appropriate certificates, such as buying one from a certification authority. Another common practice is to generate a self-signed certificate. The simplest way to do this is with the OpenSSL package, using something like the following::" +msgid "" +"% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" +"Generating a 1024 bit RSA private key\n" +".......++++++\n" +".............................++++++\n" +"writing new private key to 'cert.pem'\n" +"-----\n" +"You are about to be asked to enter information that will be incorporated\n" +"into your certificate request.\n" +"What you are about to enter is what is called a Distinguished Name or a " +"DN.\n" +"There are quite a few fields but you can leave some blank\n" +"For some fields there will be a default value,\n" +"If you enter '.', the field will be left blank.\n" +"-----\n" +"Country Name (2 letter code) [AU]:US\n" +"State or Province Name (full name) [Some-State]:MyState\n" +"Locality Name (eg, city) []:Some City\n" +"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, " +"Inc.\n" +"Organizational Unit Name (eg, section) []:My Group\n" +"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com\n" +"Email Address []:ops@myserver.mygroup.myorganization.com\n" +"%" msgstr "" - -msgid "" "% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" "Generating a 1024 bit RSA private key\n" ".......++++++\n" @@ -1404,7 +3432,8 @@ msgid "" "-----\n" "You are about to be asked to enter information that will be incorporated\n" "into your certificate request.\n" -"What you are about to enter is what is called a Distinguished Name or a DN.\n" +"What you are about to enter is what is called a Distinguished Name or a " +"DN.\n" "There are quite a few fields but you can leave some blank\n" "For some fields there will be a default value,\n" "If you enter '.', the field will be left blank.\n" @@ -1412,24 +3441,34 @@ msgid "" "Country Name (2 letter code) [AU]:US\n" "State or Province Name (full name) [Some-State]:MyState\n" "Locality Name (eg, city) []:Some City\n" -"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc.\n" +"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, " +"Inc.\n" "Organizational Unit Name (eg, section) []:My Group\n" "Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com\n" "Email Address []:ops@myserver.mygroup.myorganization.com\n" "%" -msgstr "" -msgid "The disadvantage of a self-signed certificate is that it is its own root certificate, and no one else will have it in their cache of known (and trusted) root certificates." +msgid "" +"The disadvantage of a self-signed certificate is that it is its own root " +"certificate, and no one else will have it in their cache of known (and " +"trusted) root certificates." msgstr "" +"عیب یک گواهی خودامضا این است که خودش گواهی ریشه‌ی خود محسوب می‌شود و هیچ‌کس " +"دیگری آن را در نهانگاه گواهی‌های ریشه‌ی شناخته‌شده (و مورد اعتماد) خود نخواهد " +"داشت." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Testing for SSL support" -msgstr "" +msgstr "آزمون پشتیبانی از SSL" -msgid "To test for the presence of SSL support in a Python installation, user code should use the following idiom::" +msgid "" +"To test for the presence of SSL support in a Python installation, user code " +"should use the following idiom::" msgstr "" +"برای بررسی وجود پشتیبانی SSL در یک نصب پایتون، کد کاربر باید از الگوی زیر " +"استفاده کند::" msgid "" "try:\n" @@ -1439,58 +3478,112 @@ msgid "" "else:\n" " ... # do something that requires SSL support" msgstr "" +"try:\n" +" import ssl\n" +"except ImportError:\n" +" pass\n" +"else:\n" +" ... # do something that requires SSL support" msgid "Client-side operation" -msgstr "" +msgstr "عملیات سمت کلاینت" -msgid "This example creates a SSL context with the recommended security settings for client sockets, including automatic certificate verification::" +msgid "" +"This example creates a SSL context with the recommended security settings " +"for client sockets, including automatic certificate verification::" msgstr "" +"این مثال یک زمینه‌ی SSL (SSL context) با تنظیمات امنیتی توصیه‌شده برای سوکت‌های " +"کلاینت، از جمله تأیید خودکار گواهی، ایجاد می‌کند::" msgid ">>> context = ssl.create_default_context()" -msgstr "" +msgstr ">>> context = ssl.create_default_context()" -msgid "If you prefer to tune security settings yourself, you might create a context from scratch (but beware that you might not get the settings right)::" +msgid "" +"If you prefer to tune security settings yourself, you might create a " +"context from scratch (but beware that you might not get the settings " +"right)::" msgstr "" +"اگر ترجیح می‌دهید تنظیمات امنیتی را خودتان تنظیم کنید، می‌توانید یک زمینه را " +"از پایه ایجاد کنید (اما مراقب باشید که ممکن است تنظیمات را به‌درستی انجام " +"ندهید)::" msgid "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" msgstr "" +">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" +">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" -msgid "(this snippet assumes your operating system places a bundle of all CA certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an error and have to adjust the location)" +msgid "" +"(this snippet assumes your operating system places a bundle of all CA " +"certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " +"error and have to adjust the location)" msgstr "" +"(این قطعه‌کد فرض می‌کند که سیستم‌عامل شما بسته‌ای از تمام گواهی‌نامه‌های CA را در " +"``/etc/ssl/certs/ca-bundle.crt`` قرار می‌دهد؛ در غیر این صورت، با خطا مواجه " +"می‌شوید و باید محل را تنظیم کنید)" -msgid "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert validation and hostname verification. :attr:`~SSLContext.verify_mode` is set to :data:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` is set to ``True``. All other protocols create SSL contexts with insecure defaults." +msgid "" +"The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " +"validation and hostname verification. :attr:`~SSLContext.verify_mode` is " +"set to :data:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` is set " +"to ``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" +"پروتکل :data:`PROTOCOL_TLS_CLIENT` زمینه را برای اعتبارسنجی گواهی و تأیید " +"نام میزبان پیکربندی می‌کند. :attr:`~SSLContext.verify_mode` " +"به :data:`CERT_REQUIRED` تنظیم شده است و :attr:`~SSLContext.check_hostname` " +"به ``True`` تنظیم شده است. همه‌ی پروتکل‌های دیگر زمینه‌های SSL را با پیش‌فرض‌های " +"ناامن ایجاد می‌کنند." -msgid "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :attr:`~SSLContext.check_hostname` validate the server certificate: it ensures that the server certificate was signed with one of the CA certificates, checks the signature for correctness, and verifies other properties like validity and identity of the hostname::" -msgstr "" +msgid "" +"When you use the context to connect to a server, :const:`CERT_REQUIRED` " +"and :attr:`~SSLContext.check_hostname` validate the server certificate: it " +"ensures that the server certificate was signed with one of the CA " +"certificates, checks the signature for correctness, and verifies other " +"properties like validity and identity of the hostname::" +msgstr "" +"وقتی از زمینه برای اتصال به یک سرور استفاده می‌کنید، :const:`CERT_REQUIRED` " +"و :attr:`~SSLContext.check_hostname` گواهی سرور را اعتبارسنجی می‌کنند: " +"این اعتبارسنجی تضمین می‌کند که گواهی سرور با یکی از گواهی‌های CA امضا " +"شده باشد، صحت امضا را بررسی می‌کند و سایر ویژگی‌ها مانند اعتبار و هویت نام " +"میزبان را تأیید می‌کند::" msgid "" ">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" "... server_hostname=\"www.python.org\")\n" ">>> conn.connect((\"www.python.org\", 443))" msgstr "" +">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" +"... server_hostname=\"www.python.org\")\n" +">>> conn.connect((\"www.python.org\", 443))" msgid "You may then fetch the certificate::" -msgstr "" +msgstr "سپس می‌توانید گواهی را دریافت کنید::" msgid ">>> cert = conn.getpeercert()" -msgstr "" +msgstr ">>> cert = conn.getpeercert()" -msgid "Visual inspection shows that the certificate does identify the desired service (that is, the HTTPS host ``www.python.org``)::" +msgid "" +"Visual inspection shows that the certificate does identify the desired " +"service (that is, the HTTPS host ``www.python.org``)::" msgstr "" +"بازرسی دیداری نشان می‌دهد که گواهی، سرویس موردنظر (یعنی میزبان HTTPS " +"``www.python.org``) را شناسایی می‌کند::" msgid "" ">>> pprint.pprint(cert)\n" "{'OCSP': ('http://ocsp.digicert.com',),\n" -" 'caIssuers': ('http://cacerts.digicert.com/DigiCertSHA2ExtendedValidationServerCA.crt',),\n" -" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-g1.crl',\n" -" 'http://crl4.digicert.com/sha2-ev-server-g1.crl'),\n" +" 'caIssuers': ('http://cacerts.digicert.com/" +"DigiCertSHA2ExtendedValidationServerCA.crt',),\n" +" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-" +"g1.crl',\n" +" 'http://crl4.digicert.com/sha2-ev-server-" +"g1.crl'),\n" " 'issuer': ((('countryName', 'US'),),\n" " (('organizationName', 'DigiCert Inc'),),\n" " (('organizationalUnitName', 'www.digicert.com'),),\n" -" (('commonName', 'DigiCert SHA2 Extended Validation Server CA'),)),\n" +" (('commonName', 'DigiCert SHA2 Extended Validation Server " +"CA'),)),\n" " 'notAfter': 'Sep 9 12:00:00 2016 GMT',\n" " 'notBefore': 'Sep 5 00:00:00 2014 GMT',\n" " 'serialNumber': '01BB6F00122B177F36CAB49CEA8B6B26',\n" @@ -1522,9 +3615,56 @@ msgid "" " ('DNS', 'id.python.org')),\n" " 'version': 3}" msgstr "" +">>> pprint.pprint(cert)\n" +"{'OCSP': ('http://ocsp.digicert.com',),\n" +" 'caIssuers': ('http://cacerts.digicert.com/" +"DigiCertSHA2ExtendedValidationServerCA.crt',),\n" +" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-" +"g1.crl',\n" +" 'http://crl4.digicert.com/sha2-ev-server-" +"g1.crl'),\n" +" 'issuer': ((('countryName', 'US'),),\n" +" (('organizationName', 'DigiCert Inc'),),\n" +" (('organizationalUnitName', 'www.digicert.com'),),\n" +" (('commonName', 'DigiCert SHA2 Extended Validation Server " +"CA'),)),\n" +" 'notAfter': 'Sep 9 12:00:00 2016 GMT',\n" +" 'notBefore': 'Sep 5 00:00:00 2014 GMT',\n" +" 'serialNumber': '01BB6F00122B177F36CAB49CEA8B6B26',\n" +" 'subject': ((('businessCategory', 'Private Organization'),),\n" +" (('1.3.6.1.4.1.311.60.2.1.3', 'US'),),\n" +" (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),\n" +" (('serialNumber', '3359300'),),\n" +" (('streetAddress', '16 Allen Rd'),),\n" +" (('postalCode', '03894-4801'),),\n" +" (('countryName', 'US'),),\n" +" (('stateOrProvinceName', 'NH'),),\n" +" (('localityName', 'Wolfeboro'),),\n" +" (('organizationName', 'Python Software Foundation'),),\n" +" (('commonName', 'www.python.org'),)),\n" +" 'subjectAltName': (('DNS', 'www.python.org'),\n" +" ('DNS', 'python.org'),\n" +" ('DNS', 'pypi.org'),\n" +" ('DNS', 'docs.python.org'),\n" +" ('DNS', 'testpypi.org'),\n" +" ('DNS', 'bugs.python.org'),\n" +" ('DNS', 'wiki.python.org'),\n" +" ('DNS', 'hg.python.org'),\n" +" ('DNS', 'mail.python.org'),\n" +" ('DNS', 'packaging.python.org'),\n" +" ('DNS', 'pythonhosted.org'),\n" +" ('DNS', 'www.pythonhosted.org'),\n" +" ('DNS', 'test.pythonhosted.org'),\n" +" ('DNS', 'us.pycon.org'),\n" +" ('DNS', 'id.python.org')),\n" +" 'version': 3}" -msgid "Now the SSL channel is established and the certificate verified, you can proceed to talk with the server::" +msgid "" +"Now the SSL channel is established and the certificate verified, you can " +"proceed to talk with the server::" msgstr "" +"اکنون که کانال SSL برقرار شد و گواهی تأیید شد، می‌توانید ارتباط با سرور را " +"آغاز کنید::" msgid "" ">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" @@ -1547,12 +3687,41 @@ msgid "" " b'',\n" " b'']" msgstr "" +">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" +">>> pprint.pprint(conn.recv(1024).split(b\"\\r\\n\"))\n" +"[b'HTTP/1.1 200 OK',\n" +" b'Date: Sat, 18 Oct 2014 18:27:20 GMT',\n" +" b'Server: nginx',\n" +" b'Content-Type: text/html; charset=utf-8',\n" +" b'X-Frame-Options: SAMEORIGIN',\n" +" b'Content-Length: 45679',\n" +" b'Accept-Ranges: bytes',\n" +" b'Via: 1.1 varnish',\n" +" b'Age: 2188',\n" +" b'X-Served-By: cache-lcy1134-LCY',\n" +" b'X-Cache: HIT',\n" +" b'X-Cache-Hits: 11',\n" +" b'Vary: Cookie',\n" +" b'Strict-Transport-Security: max-age=63072000; includeSubDomains',\n" +" b'Connection: close',\n" +" b'',\n" +" b'']" msgid "Server-side operation" -msgstr "" +msgstr "عملیات سمت سرور" -msgid "For server operation, typically you'll need to have a server certificate, and private key, each in a file. You'll first create a context holding the key and the certificate, so that clients can check your authenticity. Then you'll open a socket, bind it to a port, call :meth:`listen` on it, and start waiting for clients to connect::" -msgstr "" +msgid "" +"For server operation, typically you'll need to have a server certificate, " +"and private key, each in a file. You'll first create a context holding the " +"key and the certificate, so that clients can check your authenticity. Then " +"you'll open a socket, bind it to a port, call :meth:`listen` on it, and " +"start waiting for clients to connect::" +msgstr "" +"برای راه‌اندازی سرور، معمولاً باید یک گواهی سرور و یک کلید خصوصی داشته " +"باشید، که هر کدام در یک فایل قرار دارند. ابتدا یک زمینه حاوی کلید و " +"گواهی ایجاد می‌کنید، تا کلاینت‌ها بتوانند اصالت شما را بررسی کنند. سپس یک " +"سوکت باز می‌کنید، آن را به یک پورت پیوند می‌دهید، متد :meth:`listen` را روی " +"آن فراخوانی می‌کنید و منتظر اتصال کلاینت‌ها می‌مانید::" msgid "" "import socket, ssl\n" @@ -1564,9 +3733,25 @@ msgid "" "bindsocket.bind(('myaddr.example.com', 10023))\n" "bindsocket.listen(5)" msgstr "" +"import socket, ssl\n" +"\n" +"context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)\n" +"context.load_cert_chain(certfile=\"mycertfile\", keyfile=\"mykeyfile\")\n" +"\n" +"bindsocket = socket.socket()\n" +"bindsocket.bind(('myaddr.example.com', 10023))\n" +"bindsocket.listen(5)" -msgid "When a client connects, you'll call :meth:`accept` on the socket to get the new socket from the other end, and use the context's :meth:`SSLContext.wrap_socket` method to create a server-side SSL socket for the connection::" +msgid "" +"When a client connects, you'll call :meth:`accept` on the socket to get the " +"new socket from the other end, and use the " +"context's :meth:`SSLContext.wrap_socket` method to create a server-side SSL " +"socket for the connection::" msgstr "" +"هنگامی که یک کلاینت متصل شد، :meth:`accept` را روی سوکت فراخوانی کنید تا " +"سوکت جدید را از طرف مقابل دریافت کنید و از " +"متد :meth:`SSLContext.wrap_socket` زمینه برای ایجاد یک سوکت SSL در سمت سرور " +"برای اتصال استفاده کنید::" msgid "" "while True:\n" @@ -1578,9 +3763,22 @@ msgid "" " connstream.shutdown(socket.SHUT_RDWR)\n" " connstream.close()" msgstr "" +"while True:\n" +" newsocket, fromaddr = bindsocket.accept()\n" +" connstream = context.wrap_socket(newsocket, server_side=True)\n" +" try:\n" +" deal_with_client(connstream)\n" +" finally:\n" +" connstream.shutdown(socket.SHUT_RDWR)\n" +" connstream.close()" -msgid "Then you'll read data from the ``connstream`` and do something with it till you are finished with the client (or the client is finished with you)::" +msgid "" +"Then you'll read data from the ``connstream`` and do something with it till " +"you are finished with the client (or the client is finished with you)::" msgstr "" +"سپس داده‌ها را از ``connstream`` می‌خوانید و تا زمانی که کار شما با کلاینت " +"تمام نشده است (یا کار کلاینت با شما تمام نشده است)، با آن‌ها کاری انجام " +"می‌دهید::" msgid "" "def deal_with_client(connstream):\n" @@ -1594,33 +3792,113 @@ msgid "" " data = connstream.recv(1024)\n" " # finished with client" msgstr "" +"def deal_with_client(connstream):\n" +" data = connstream.recv(1024)\n" +" # empty data means the client is finished with us\n" +" while data:\n" +" if not do_something(connstream, data):\n" +" # we'll assume do_something returns False\n" +" # when we're finished with client\n" +" break\n" +" data = connstream.recv(1024)\n" +" # finished with client" -msgid "And go back to listening for new client connections (of course, a real server would probably handle each client connection in a separate thread, or put the sockets in :ref:`non-blocking mode ` and use an event loop)." +msgid "" +"And go back to listening for new client connections (of course, a real " +"server would probably handle each client connection in a separate thread, " +"or put the sockets in :ref:`non-blocking mode ` and use an " +"event loop)." msgstr "" +"و به گوش‌دادن برای اتصال‌های جدید کلاینت بازگردید (البته، یک سرور واقعی " +"احتمالاً هر اتصال کلاینت را در یک نخ جداگانه مدیریت می‌کند، یا سوکت‌ها را " +"در :ref:`حالت غیرمسدودکننده ` قرار می‌دهد و از یک حلقه " +"رویداد استفاده می‌کند)." msgid "Notes on non-blocking sockets" -msgstr "" +msgstr "نکاتی درباره سوکت‌های غیرمسدود" -msgid "SSL sockets behave slightly different than regular sockets in non-blocking mode. When working with non-blocking sockets, there are thus several things you need to be aware of:" +msgid "" +"SSL sockets behave slightly different than regular sockets in non-blocking " +"mode. When working with non-blocking sockets, there are thus several things " +"you need to be aware of:" msgstr "" +"سوکت‌های SSL در حالت غیرمسدودکننده (non-blocking) کمی متفاوت از سوکت‌های " +"معمولی رفتار می‌کنند. بنابراین، هنگام کار با سوکت‌های غیرمسدودکننده، باید به " +"چند نکته توجه داشته باشید:" -msgid "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O operation would block. :exc:`SSLWantReadError` will be raised if a read operation on the underlying socket is necessary, and :exc:`SSLWantWriteError` for a write operation on the underlying socket. Note that attempts to *write* to an SSL socket may require *reading* from the underlying socket first, and attempts to *read* from the SSL socket may require a prior *write* to the underlying socket." -msgstr "" +msgid "" +"Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " +"or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " +"operation would block. :exc:`SSLWantReadError` will be raised if a read " +"operation on the underlying socket is necessary, " +"and :exc:`SSLWantWriteError` for a write operation on the underlying " +"socket. Note that attempts to *write* to an SSL socket may require " +"*reading* from the underlying socket first, and attempts to *read* from the " +"SSL socket may require a prior *write* to the underlying socket." +msgstr "" +"بیشتر متدهای :class:`SSLSocket` در صورتی که یک عملیات ورودی/خروجی باعث " +"مسدود شدن شود، به‌جای :exc:`BlockingIOError`، یا :exc:`SSLWantWriteError` " +"یا :exc:`SSLWantReadError` را پرتاب می‌کنند. اگر یک عملیات خواندن روی سوکت " +"زیرین لازم باشد، :exc:`SSLWantReadError` پرتاب می‌شود، و برای یک عملیات " +"نوشتن روی سوکت زیرین، :exc:`SSLWantWriteError` پرتاب می‌شود. توجه داشته " +"باشید که تلاش برای *نوشتن* در یک سوکت SSL ممکن است ابتدا به *خواندن* از " +"سوکت زیرین نیاز داشته باشد، و تلاش برای *خواندن* از سوکت SSL ممکن است به یک " +"*نوشتن* قبلی روی سوکت زیرین نیاز داشته باشد." -msgid "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." +msgid "" +"In earlier Python versions, the :meth:`!SSLSocket.send` method returned " +"zero instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" +"در نسخه‌های پیشین پایتون، متد :meth:`!SSLSocket.send` به‌جای پرتاب " +"کردن :exc:`SSLWantWriteError` یا :exc:`SSLWantReadError`، صفر را برمی‌گرداند." -msgid "Calling :func:`~select.select` tells you that the OS-level socket can be read from (or written to), but it does not imply that there is sufficient data at the upper SSL layer. For example, only part of an SSL frame might have arrived. Therefore, you must be ready to handle :meth:`SSLSocket.recv` and :meth:`SSLSocket.send` failures, and retry after another call to :func:`~select.select`." -msgstr "" +msgid "" +"Calling :func:`~select.select` tells you that the OS-level socket can be " +"read from (or written to), but it does not imply that there is sufficient " +"data at the upper SSL layer. For example, only part of an SSL frame might " +"have arrived. Therefore, you must be ready to " +"handle :meth:`SSLSocket.recv` and :meth:`SSLSocket.send` failures, and " +"retry after another call to :func:`~select.select`." +msgstr "" +"فراخوانی :func:`~select.select` به شما می‌گوید که سوکت در سطح سیستم‌عامل قابل " +"خواندن (یا نوشتن) است، اما این به آن معنا نیست که داده کافی در لایه‌ی بالایی " +"SSL وجود دارد. برای مثال، ممکن است تنها بخشی از یک فریم SSL رسیده باشد. " +"بنابراین، باید آماده باشید تا شکست‌های :meth:`SSLSocket.recv` " +"و :meth:`SSLSocket.send` را مدیریت کنید و پس از فراخوانی دیگری " +"از :func:`~select.select` دوباره تلاش کنید." -msgid "Conversely, since the SSL layer has its own framing, a SSL socket may still have data available for reading without :func:`~select.select` being aware of it. Therefore, you should first call :meth:`SSLSocket.recv` to drain any potentially available data, and then only block on a :func:`~select.select` call if still necessary." -msgstr "" +msgid "" +"Conversely, since the SSL layer has its own framing, a SSL socket may still " +"have data available for reading without :func:`~select.select` being aware " +"of it. Therefore, you should first call :meth:`SSLSocket.recv` to drain " +"any potentially available data, and then only block on " +"a :func:`~select.select` call if still necessary." +msgstr "" +"در مقابل، از آن‌جا که لایه SSL چارچوب‌بندی خاص خود را دارد، ممکن است یک سوکت " +"SSL هنوز داده‌ای برای خواندن در دسترس داشته باشد، بدون " +"آنکه :func:`~select.select` از آن آگاه باشد. بنابراین، ابتدا " +"باید :meth:`SSLSocket.recv` را فراخوانی کنید تا هر داده‌ای که ممکن است در " +"دسترس باشد تخلیه شود، و سپس تنها در صورت لزوم، در یک " +"فراخوانی :func:`~select.select` مسدود شوید." -msgid "(of course, similar provisions apply when using other primitives such as :func:`~select.poll`, or those in the :mod:`selectors` module)" +msgid "" +"(of course, similar provisions apply when using other primitives such " +"as :func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" +"(البته، ملاحظات مشابهی هنگام استفاده از سایر اولیه‌ها " +"مانند :func:`~select.poll` یا موارد موجود در ماژول :mod:`selectors` اعمال " +"می‌شود)" -msgid "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket.do_handshake` method has to be retried until it returns successfully. Here is a synopsis using :func:`~select.select` to wait for the socket's readiness::" +msgid "" +"The SSL handshake itself will be non-blocking: " +"the :meth:`SSLSocket.do_handshake` method has to be retried until it " +"returns successfully. Here is a synopsis using :func:`~select.select` to " +"wait for the socket's readiness::" msgstr "" +"خود دست‌دهی SSL (SSL handshake) غیرمسدودکننده خواهد بود: " +"متد :meth:`SSLSocket.do_handshake` باید تا زمانی که با موفقیت بازگشت کند، " +"دوباره فراخوانی شود. در اینجا خلاصه‌ای با استفاده از :func:`~select.select` " +"برای منتظر ماندن تا آماده شدن سوکت آمده است::" msgid "" "while True:\n" @@ -1632,171 +3910,340 @@ msgid "" " except ssl.SSLWantWriteError:\n" " select.select([], [sock], [])" msgstr "" +"while True:\n" +" try:\n" +" sock.do_handshake()\n" +" break\n" +" except ssl.SSLWantReadError:\n" +" select.select([sock], [], [])\n" +" except ssl.SSLWantWriteError:\n" +" select.select([], [sock], [])" -msgid "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. It polls for events using the :mod:`selectors` module and handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` and :exc:`BlockingIOError` exceptions. It runs the SSL handshake asynchronously as well." -msgstr "" +msgid "" +"The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. It polls for events using the :mod:`selectors` module and " +"handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` " +"and :exc:`BlockingIOError` exceptions. It runs the SSL handshake " +"asynchronously as well." +msgstr "" +"ماژول :mod:`asyncio` از :ref:`سوکت‌های SSL غیرمسدود ` " +"پشتیبانی می‌کند و :ref:`API جریان‌ها ` سطح بالاتری را فراهم " +"می‌کند. این ماژول رویدادها را با استفاده از ماژول :mod:`selectors` پایش " +"می‌کند و استثناهای :exc:`SSLWantWriteError`، :exc:`SSLWantReadError` " +"و :exc:`BlockingIOError` را مدیریت می‌کند. همچنین دست‌دهی SSL را به‌صورت " +"ناهمگام اجرا می‌کند." msgid "Memory BIO support" -msgstr "" +msgstr "پشتیبانی از Memory BIO" -msgid "Ever since the SSL module was introduced in Python 2.6, the :class:`SSLSocket` class has provided two related but distinct areas of functionality:" +msgid "" +"Ever since the SSL module was introduced in Python 2.6, " +"the :class:`SSLSocket` class has provided two related but distinct areas of " +"functionality:" msgstr "" +"از زمان معرفی ماژول SSL در Python 2.6، کلاس :class:`SSLSocket` دو حوزه‌ی " +"عملکردی مرتبط اما متمایز را ارائه کرده است:" msgid "SSL protocol handling" -msgstr "" +msgstr "مدیریت پروتکل SSL" msgid "Network IO" -msgstr "" +msgstr "ورودی/خروجی شبکه" -msgid "The network IO API is identical to that provided by :class:`socket.socket`, from which :class:`SSLSocket` also inherits. This allows an SSL socket to be used as a drop-in replacement for a regular socket, making it very easy to add SSL support to an existing application." +msgid "" +"The network IO API is identical to that provided by :class:`socket.socket`, " +"from which :class:`SSLSocket` also inherits. This allows an SSL socket to " +"be used as a drop-in replacement for a regular socket, making it very easy " +"to add SSL support to an existing application." msgstr "" +"API ورودی/خروجی شبکه دقیقاً مشابه API ارائه‌شده توسط :class:`socket.socket` " +"است که :class:`SSLSocket` نیز از آن ارث‌بری می‌کند. این موضوع امکان استفاده " +"از یک سوکت SSL به‌عنوان جایگزین مستقیم (drop-in replacement) برای یک سوکت " +"معمولی را فراهم می‌کند و افزودن پشتیبانی SSL به یک برنامه موجود را بسیار " +"آسان می‌سازد." -msgid "Combining SSL protocol handling and network IO usually works well, but there are some cases where it doesn't. An example is async IO frameworks that want to use a different IO multiplexing model than the \"select/poll on a file descriptor\" (readiness based) model that is assumed by :class:`socket.socket` and by the internal OpenSSL socket IO routines. This is mostly relevant for platforms like Windows where this model is not efficient. For this purpose, a reduced scope variant of :class:`SSLSocket` called :class:`SSLObject` is provided." -msgstr "" +msgid "" +"Combining SSL protocol handling and network IO usually works well, but " +"there are some cases where it doesn't. An example is async IO frameworks " +"that want to use a different IO multiplexing model than the \"select/poll " +"on a file descriptor\" (readiness based) model that is assumed " +"by :class:`socket.socket` and by the internal OpenSSL socket IO routines. " +"This is mostly relevant for platforms like Windows where this model is not " +"efficient. For this purpose, a reduced scope variant of :class:`SSLSocket` " +"called :class:`SSLObject` is provided." +msgstr "" +"ترکیب مدیریت پروتکل SSL و ورودی/خروجی شبکه معمولاً به‌خوبی کار می‌کند، اما در " +"برخی موارد این‌طور نیست. یک نمونه، چارچوب‌های ورودی/خروجی ناهمگام هستند که " +"می‌خواهند از مدل متفاوتی برای تسهیم ورودی/خروجی (IO multiplexing) نسبت به " +"مدل «select/poll روی توصیف‌گر فایل» (مبتنی بر آمادگی) استفاده کنند؛ مدلی که " +"توسط :class:`socket.socket` و روال‌های داخلی ورودی/خروجی سوکت OpenSSL فرض " +"می‌شود. این موضوع بیشتر برای سکوهایی مانند ویندوز مرتبط است که این مدل در " +"آن‌ها کارآمد نیست. برای این منظور، گونه‌ای از :class:`SSLSocket` با محدوده‌ای " +"محدودتر به نام :class:`SSLObject` ارائه شده است." -msgid "A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol instance that does not contain any network IO methods. This class is typically used by framework authors that want to implement asynchronous IO for SSL through memory buffers." +msgid "" +"A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol " +"instance that does not contain any network IO methods. This class is " +"typically used by framework authors that want to implement asynchronous IO " +"for SSL through memory buffers." msgstr "" +"یک نسخه با محدوده‌ی کاهش‌یافته از :class:`SSLSocket` که نشان‌دهنده‌ی یک نمونه از " +"پروتکل SSL است و فاقد هرگونه متد ورودی/خروجی شبکه است. این کلاس معمولاً توسط " +"نویسندگان چارچوب‌هایی استفاده می‌شود که می‌خواهند ورودی/خروجی ناهمگام برای SSL " +"را از طریق بافرهای حافظه پیاده‌سازی کنند." -msgid "This class implements an interface on top of a low-level SSL object as implemented by OpenSSL. This object captures the state of an SSL connection but does not provide any network IO itself. IO needs to be performed through separate \"BIO\" objects which are OpenSSL's IO abstraction layer." +msgid "" +"This class implements an interface on top of a low-level SSL object as " +"implemented by OpenSSL. This object captures the state of an SSL connection " +"but does not provide any network IO itself. IO needs to be performed " +"through separate \"BIO\" objects which are OpenSSL's IO abstraction layer." msgstr "" +"این کلاس یک رابط را بر فراز یک شیء SSL سطح پایین، که OpenSSL آن را " +"پیاده‌سازی کرده است، پیاده‌سازی می‌کند. این شیء وضعیت یک اتصال SSL را ثبت " +"می‌کند، اما خود هیچ‌گونه ورودی/خروجی (IO) شبکه‌ای فراهم نمی‌کند. ورودی/خروجی " +"باید از طریق اشیای \"BIO\" جداگانه انجام شود که لایه‌ی انتزاعی ورودی/خروجی " +"OpenSSL هستند." -msgid "This class has no public constructor. An :class:`SSLObject` instance must be created using the :meth:`~SSLContext.wrap_bio` method. This method will create the :class:`SSLObject` instance and bind it to a pair of BIOs. The *incoming* BIO is used to pass data from Python to the SSL protocol instance, while the *outgoing* BIO is used to pass data the other way around." -msgstr "" +msgid "" +"This class has no public constructor. An :class:`SSLObject` instance must " +"be created using the :meth:`~SSLContext.wrap_bio` method. This method will " +"create the :class:`SSLObject` instance and bind it to a pair of BIOs. The " +"*incoming* BIO is used to pass data from Python to the SSL protocol " +"instance, while the *outgoing* BIO is used to pass data the other way " +"around." +msgstr "" +"این کلاس سازنده‌ی عمومی ندارد. یک نمونه‌ی :class:`SSLObject` باید با استفاده " +"از متد :meth:`~SSLContext.wrap_bio` ایجاد شود. این متد " +"نمونه‌ی :class:`SSLObject` را ایجاد می‌کند و آن را به یک جفت BIO متصل می‌کند. " +"BIO *ورودی* برای انتقال داده از پایتون به نمونه‌ی پروتکل SSL استفاده می‌شود، " +"در حالی که BIO *خروجی* برای انتقال داده در جهت معکوس استفاده می‌شود." msgid "The following methods are available:" -msgstr "" +msgstr "متدهای زیر در دسترس هستند:" msgid ":attr:`~SSLSocket.context`" -msgstr "" +msgstr ":attr:`~SSLSocket.context`" msgid ":attr:`~SSLSocket.server_side`" -msgstr "" +msgstr ":attr:`~SSLSocket.server_side`" msgid ":attr:`~SSLSocket.server_hostname`" -msgstr "" +msgstr ":attr:`~SSLSocket.server_hostname`" msgid ":attr:`~SSLSocket.session`" -msgstr "" +msgstr ":attr:`~SSLSocket.session`" msgid ":attr:`~SSLSocket.session_reused`" -msgstr "" +msgstr ":attr:`~SSLSocket.session_reused`" msgid ":meth:`~SSLSocket.read`" -msgstr "" +msgstr ":meth:`~SSLSocket.read`" msgid ":meth:`~SSLSocket.write`" -msgstr "" +msgstr ":meth:`~SSLSocket.write`" msgid ":meth:`~SSLSocket.getpeercert`" -msgstr "" +msgstr ":meth:`~SSLSocket.getpeercert`" msgid ":meth:`~SSLSocket.get_verified_chain`" -msgstr "" +msgstr ":meth:`~SSLSocket.get_verified_chain`" msgid ":meth:`~SSLSocket.get_unverified_chain`" -msgstr "" +msgstr ":meth:`~SSLSocket.get_unverified_chain`" msgid ":meth:`~SSLSocket.selected_alpn_protocol`" -msgstr "" +msgstr ":meth:`~SSLSocket.selected_alpn_protocol`" msgid ":meth:`~SSLSocket.selected_npn_protocol`" -msgstr "" +msgstr ":meth:`~SSLSocket.selected_npn_protocol`" msgid ":meth:`~SSLSocket.cipher`" -msgstr "" +msgstr ":meth:`~SSLSocket.cipher`" msgid ":meth:`~SSLSocket.shared_ciphers`" -msgstr "" +msgstr ":meth:`~SSLSocket.shared_ciphers`" msgid ":meth:`~SSLSocket.compression`" -msgstr "" +msgstr ":meth:`~SSLSocket.compression`" msgid ":meth:`~SSLSocket.pending`" -msgstr "" +msgstr ":meth:`~SSLSocket.pending`" msgid ":meth:`~SSLSocket.do_handshake`" -msgstr "" +msgstr ":meth:`~SSLSocket.do_handshake`" msgid ":meth:`~SSLSocket.verify_client_post_handshake`" -msgstr "" +msgstr ":meth:`~SSLSocket.verify_client_post_handshake`" msgid ":meth:`~SSLSocket.unwrap`" -msgstr "" +msgstr ":meth:`~SSLSocket.unwrap`" msgid ":meth:`~SSLSocket.get_channel_binding`" -msgstr "" +msgstr ":meth:`~SSLSocket.get_channel_binding`" msgid ":meth:`~SSLSocket.version`" -msgstr "" +msgstr ":meth:`~SSLSocket.version`" -msgid "When compared to :class:`SSLSocket`, this object lacks the following features:" -msgstr "" +msgid "" +"When compared to :class:`SSLSocket`, this object lacks the following " +"features:" +msgstr "در مقایسه با :class:`SSLSocket`، این شیء فاقد ویژگی‌های زیر است:" -msgid "Any form of network IO; ``recv()`` and ``send()`` read and write only to the underlying :class:`MemoryBIO` buffers." +msgid "" +"Any form of network IO; ``recv()`` and ``send()`` read and write only to " +"the underlying :class:`MemoryBIO` buffers." msgstr "" +"هر شکلی از ورودی/خروجی شبکه؛ ``recv()`` و ``send()`` فقط از بافرهای " +"زیربنایی :class:`MemoryBIO` می‌خوانند و در آن‌ها می‌نویسند." -msgid "There is no *do_handshake_on_connect* machinery. You must always manually call :meth:`~SSLSocket.do_handshake` to start the handshake." +msgid "" +"There is no *do_handshake_on_connect* machinery. You must always manually " +"call :meth:`~SSLSocket.do_handshake` to start the handshake." msgstr "" +"هیچ سازوکاری برای *do_handshake_on_connect* وجود ندارد. شما باید " +"همیشه :meth:`~SSLSocket.do_handshake` را به‌صورت دستی فراخوانی کنید تا " +"دست‌دهی (handshake) آغاز شود." -msgid "There is no handling of *suppress_ragged_eofs*. All end-of-file conditions that are in violation of the protocol are reported via the :exc:`SSLEOFError` exception." +msgid "" +"There is no handling of *suppress_ragged_eofs*. All end-of-file conditions " +"that are in violation of the protocol are reported via " +"the :exc:`SSLEOFError` exception." msgstr "" +"هیچ مدیریتی برای *suppress_ragged_eofs* وجود ندارد. تمام شرایط پایان فایل " +"که پروتکل را نقض می‌کنند، از طریق استثنا :exc:`SSLEOFError` گزارش می‌شوند." -msgid "The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike for an SSL socket where it returns the underlying socket." +msgid "" +"The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike " +"for an SSL socket where it returns the underlying socket." msgstr "" +"فراخوانی متد :meth:`~SSLSocket.unwrap` چیزی برنمی‌گرداند، برخلاف یک سوکت SSL " +"که در آن سوکت زیرین را برمی‌گرداند." -msgid "The *server_name_callback* callback passed to :meth:`SSLContext.set_servername_callback` will get an :class:`SSLObject` instance instead of a :class:`SSLSocket` instance as its first parameter." +msgid "" +"The *server_name_callback* callback passed " +"to :meth:`SSLContext.set_servername_callback` will get " +"an :class:`SSLObject` instance instead of a :class:`SSLSocket` instance as " +"its first parameter." msgstr "" +"کال‌بک *server_name_callback* که " +"به :meth:`SSLContext.set_servername_callback` ارسال می‌شود، به‌عنوان اولین " +"پارامتر خود، یک نمونه :class:`SSLObject` را به‌جای یک " +"نمونه :class:`SSLSocket` دریافت خواهد کرد." msgid "Some notes related to the use of :class:`SSLObject`:" -msgstr "" +msgstr "چند نکته مرتبط با استفاده از :class:`SSLObject`:" -msgid "All IO on an :class:`SSLObject` is :ref:`non-blocking `. This means that for example :meth:`~SSLSocket.read` will raise an :exc:`SSLWantReadError` if it needs more data than the incoming BIO has available." +msgid "" +"All IO on an :class:`SSLObject` is :ref:`non-blocking `. " +"This means that for example :meth:`~SSLSocket.read` will raise " +"an :exc:`SSLWantReadError` if it needs more data than the incoming BIO has " +"available." msgstr "" +"تمام عملیات ورودی/خروجی روی یک :class:`SSLObject` به صورت :ref:`غیرمسدود " +"` است. این بدان معناست که برای " +"مثال :meth:`~SSLSocket.read` در صورتی استثنای :exc:`SSLWantReadError` را " +"پرتاب می‌کند که به داده بیشتری نسبت به آنچه BIO ورودی در دسترس دارد نیاز " +"داشته باشد." -msgid ":class:`SSLObject` instances must be created with :meth:`~SSLContext.wrap_bio`. In earlier versions, it was possible to create instances directly. This was never documented or officially supported." +msgid "" +":class:`SSLObject` instances must be created " +"with :meth:`~SSLContext.wrap_bio`. In earlier versions, it was possible to " +"create instances directly. This was never documented or officially " +"supported." msgstr "" +"نمونه‌های :class:`SSLObject` باید با :meth:`~SSLContext.wrap_bio` ایجاد " +"شوند. در نسخه‌های پیشین، امکان ایجاد مستقیم نمونه‌ها وجود داشت. این کار هرگز " +"مستند نشده بود و به‌طور رسمی پشتیبانی نمی‌شد." -msgid "An SSLObject communicates with the outside world using memory buffers. The class :class:`MemoryBIO` provides a memory buffer that can be used for this purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" +msgid "" +"An SSLObject communicates with the outside world using memory buffers. The " +"class :class:`MemoryBIO` provides a memory buffer that can be used for this " +"purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" +"یک SSLObject با استفاده از بافرهای حافظه با دنیای بیرون ارتباط برقرار " +"می‌کند. کلاس :class:`MemoryBIO` یک بافر حافظه فراهم می‌کند که می‌تواند برای " +"این منظور استفاده شود. این کلاس یک شیء BIO حافظه‌ی OpenSSL (ورودی/خروجی " +"پایه) را پوشش می‌دهد:" -msgid "A memory buffer that can be used to pass data between Python and an SSL protocol instance." +msgid "" +"A memory buffer that can be used to pass data between Python and an SSL " +"protocol instance." msgstr "" +"یک بافر حافظه (memory buffer) که می‌توان از آن برای انتقال داده بین پایتون و " +"یک نمونه از پروتکل SSL استفاده کرد." msgid "Return the number of bytes currently in the memory buffer." -msgstr "" +msgstr "تعداد بایت‌های موجود در بافر حافظه را در حال حاضر برمی‌گرداند." -msgid "A boolean indicating whether the memory BIO is current at the end-of-file position." +msgid "" +"A boolean indicating whether the memory BIO is current at the end-of-file " +"position." msgstr "" +"یک بولی که نشان می‌دهد آیا BIO حافظه‌ای (memory BIO) در موقعیت پایان پرونده " +"قرار دارد یا خیر." -msgid "Read up to *n* bytes from the memory buffer. If *n* is not specified or negative, all bytes are returned." +msgid "" +"Read up to *n* bytes from the memory buffer. If *n* is not specified or " +"negative, all bytes are returned." msgstr "" +"حداکثر *n* بایت از بافر حافظه بخوانید. اگر *n* مشخص نشده باشد یا منفی باشد، " +"تمام بایت‌ها برگردانده می‌شوند." -msgid "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an object supporting the buffer protocol." +msgid "" +"Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " +"object supporting the buffer protocol." msgstr "" +"بایت‌های *buf* را در BIO حافظه‌ای (memory BIO) بنویسید. آرگومان *buf* باید " +"شیء‌ای باشد که از پروتکل بافر (buffer protocol) پشتیبانی می‌کند." -msgid "The return value is the number of bytes written, which is always equal to the length of *buf*." +msgid "" +"The return value is the number of bytes written, which is always equal to " +"the length of *buf*." msgstr "" +"مقدار بازگشتی تعداد بایت‌های نوشته‌شده است، که همیشه برابر با طول *buf* است." -msgid "Write an EOF marker to the memory BIO. After this method has been called, it is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will become true after all data currently in the buffer has been read." +msgid "" +"Write an EOF marker to the memory BIO. After this method has been called, " +"it is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` " +"will become true after all data currently in the buffer has been read." msgstr "" +"یک نشانگر EOF را در BIO حافظه (memory BIO) می‌نویسد. پس از فراخوانی این متد، " +"فراخوانی :meth:`~MemoryBIO.write` غیرمجاز است. ویژگی :attr:`eof` پس از " +"خوانده شدن تمام داده‌های موجود در بافر، درست می‌شود." msgid "SSL session" -msgstr "" +msgstr "نشست SSL" msgid "Session object used by :attr:`~SSLSocket.session`." -msgstr "" +msgstr "شیء نشست که توسط :attr:`~SSLSocket.session` استفاده می‌شود." msgid "Security considerations" -msgstr "" +msgstr "ملاحظات امنیتی" msgid "Best defaults" -msgstr "" +msgstr "بهترین پیش‌فرض‌ها" -msgid "For **client use**, if you don't have any special requirements for your security policy, it is highly recommended that you use the :func:`create_default_context` function to create your SSL context. It will load the system's trusted CA certificates, enable certificate validation and hostname checking, and try to choose reasonably secure protocol and cipher settings." -msgstr "" +msgid "" +"For **client use**, if you don't have any special requirements for your " +"security policy, it is highly recommended that you use " +"the :func:`create_default_context` function to create your SSL context. It " +"will load the system's trusted CA certificates, enable certificate " +"validation and hostname checking, and try to choose reasonably secure " +"protocol and cipher settings." +msgstr "" +"برای **استفاده سمت کلاینت**، اگر الزامات خاصی برای سیاست امنیتی خود ندارید، " +"اکیداً توصیه می‌شود که از تابع :func:`create_default_context` برای ایجاد " +"زمینه‌ی SSL خود استفاده کنید. این تابع گواهی‌های CA مورد اعتماد سیستم را " +"بارگذاری می‌کند، اعتبارسنجی گواهی و بررسی نام میزبان را فعال می‌کند و تلاش " +"می‌کند تنظیمات پروتکل و رمز (cipher) نسبتاً امن را انتخاب کند." -msgid "For example, here is how you would use the :class:`smtplib.SMTP` class to create a trusted, secure connection to a SMTP server::" +msgid "" +"For example, here is how you would use the :class:`smtplib.SMTP` class to " +"create a trusted, secure connection to a SMTP server::" msgstr "" +"برای مثال، به این صورت می‌توانید از کلاس :class:`smtplib.SMTP` برای ایجاد یک " +"اتصال مورد اعتماد و امن به یک سرور SMTP استفاده کنید::" msgid "" ">>> import ssl, smtplib\n" @@ -1805,153 +4252,314 @@ msgid "" ">>> smtp.starttls(context=context)\n" "(220, b'2.0.0 Ready to start TLS')" msgstr "" +">>> import ssl, smtplib\n" +">>> smtp = smtplib.SMTP(\"mail.python.org\", port=587)\n" +">>> context = ssl.create_default_context()\n" +">>> smtp.starttls(context=context)\n" +"(220, b'2.0.0 Ready to start TLS')" -msgid "If a client certificate is needed for the connection, it can be added with :meth:`SSLContext.load_cert_chain`." +msgid "" +"If a client certificate is needed for the connection, it can be added " +"with :meth:`SSLContext.load_cert_chain`." msgstr "" +"اگر برای اتصال به یک گواهی کلاینت نیاز باشد، می‌توان آن را " +"با :meth:`SSLContext.load_cert_chain` افزود." -msgid "By contrast, if you create the SSL context by calling the :class:`SSLContext` constructor yourself, it will not have certificate validation nor hostname checking enabled by default. If you do so, please read the paragraphs below to achieve a good security level." +msgid "" +"By contrast, if you create the SSL context by calling " +"the :class:`SSLContext` constructor yourself, it will not have certificate " +"validation nor hostname checking enabled by default. If you do so, please " +"read the paragraphs below to achieve a good security level." msgstr "" +"در مقابل، اگر خودتان زمینه‌ی SSL را با فراخوانی سازنده‌ی :class:`SSLContext` " +"ایجاد کنید، نه اعتبارسنجی گواهی و نه بررسی نام میزبان به‌طور پیش‌فرض فعال " +"نخواهند بود. اگر این کار را انجام می‌دهید، لطفاً برای دستیابی به سطح امنیت " +"مناسب، پاراگراف‌های زیر را بخوانید." msgid "Manual settings" -msgstr "" +msgstr "تنظیمات دستی" msgid "Verifying certificates" -msgstr "" +msgstr "اعتبارسنجی گواهی‌ها" -msgid "When calling the :class:`SSLContext` constructor directly, :const:`CERT_NONE` is the default. Since it does not authenticate the other peer, it can be insecure, especially in client mode where most of the time you would like to ensure the authenticity of the server you're talking to. Therefore, when in client mode, it is highly recommended to use :const:`CERT_REQUIRED`. However, it is in itself not sufficient; you also have to check that the server certificate, which can be obtained by calling :meth:`SSLSocket.getpeercert`, matches the desired service. For many protocols and applications, the service can be identified by the hostname. This common check is automatically performed when :attr:`SSLContext.check_hostname` is enabled." -msgstr "" +msgid "" +"When calling the :class:`SSLContext` constructor " +"directly, :const:`CERT_NONE` is the default. Since it does not " +"authenticate the other peer, it can be insecure, especially in client mode " +"where most of the time you would like to ensure the authenticity of the " +"server you're talking to. Therefore, when in client mode, it is highly " +"recommended to use :const:`CERT_REQUIRED`. However, it is in itself not " +"sufficient; you also have to check that the server certificate, which can " +"be obtained by calling :meth:`SSLSocket.getpeercert`, matches the desired " +"service. For many protocols and applications, the service can be " +"identified by the hostname. This common check is automatically performed " +"when :attr:`SSLContext.check_hostname` is enabled." +msgstr "" +"هنگام فراخوانی مستقیم سازنده‌ی :class:`SSLContext`، :const:`CERT_NONE` " +"پیش‌فرض است. از آن‌جا که این حالت طرف مقابل را احراز هویت نمی‌کند، می‌تواند " +"ناامن باشد، به‌ویژه در حالت کلاینت که در بیشتر موارد می‌خواهید از اصالت سروری " +"که با آن در ارتباط هستید اطمینان حاصل کنید. بنابراین، در حالت کلاینت، به‌شدت " +"توصیه می‌شود از :const:`CERT_REQUIRED` استفاده کنید. با این حال، این مورد " +"به‌تنهایی کافی نیست؛ همچنین باید بررسی کنید که گواهی‌ی سرور، که می‌توان آن " +"را با فراخوانی :meth:`SSLSocket.getpeercert` دریافت کرد، با سرویس موردنظر " +"مطابقت دارد. در بسیاری از پروتکل‌ها و کاربردها، سرویس را می‌توان با نام " +"میزبان شناسایی کرد. این بررسی رایج، هنگامی " +"که :attr:`SSLContext.check_hostname` فعال باشد، به‌صورت خودکار انجام می‌شود." -msgid "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:`!match_hostname`." +msgid "" +"Hostname matchings is now performed by OpenSSL. Python no longer " +"uses :func:`!match_hostname`." msgstr "" +"تطبیق نام میزبان اکنون توسط OpenSSL انجام می‌شود. پایتون دیگر از :func:`!" +"match_hostname` استفاده نمی‌کند." -msgid "In server mode, if you want to authenticate your clients using the SSL layer (rather than using a higher-level authentication mechanism), you'll also have to specify :const:`CERT_REQUIRED` and similarly check the client certificate." +msgid "" +"In server mode, if you want to authenticate your clients using the SSL " +"layer (rather than using a higher-level authentication mechanism), you'll " +"also have to specify :const:`CERT_REQUIRED` and similarly check the client " +"certificate." msgstr "" +"در حالت سرور، اگر می‌خواهید کلاینت‌های خود را با استفاده از لایه SSL احراز " +"هویت کنید (به‌جای استفاده از یک مکانیزم احراز هویت سطح بالاتر)، همچنین " +"باید :const:`CERT_REQUIRED` را تعیین کنید و به‌طور مشابه گواهی کلاینت را " +"بررسی نمایید." msgid "Protocol versions" -msgstr "" +msgstr "نسخه‌های پروتکل" -msgid "SSL versions 2 and 3 are considered insecure and are therefore dangerous to use. If you want maximum compatibility between clients and servers, it is recommended to use :const:`PROTOCOL_TLS_CLIENT` or :const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are disabled by default." +msgid "" +"SSL versions 2 and 3 are considered insecure and are therefore dangerous to " +"use. If you want maximum compatibility between clients and servers, it is " +"recommended to use :const:`PROTOCOL_TLS_CLIENT` " +"or :const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 " +"are disabled by default." msgstr "" +"نسخه‌های 2 و 3 SSL ناامن تلقی می‌شوند و بنابراین استفاده از آن‌ها خطرناک است. " +"اگر می‌خواهید حداکثر سازگاری میان کلاینت‌ها و سرورها برقرار باشد، توصیه می‌شود " +"از :const:`PROTOCOL_TLS_CLIENT` یا :const:`PROTOCOL_TLS_SERVER` به‌عنوان " +"نسخه‌ی پروتکل استفاده کنید. SSLv2 و SSLv3 به‌طور پیش‌فرض غیرفعال هستند." msgid "" ">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2\n" ">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" msgstr "" +">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" +">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2\n" +">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" -msgid "The SSL client context created above will only allow TLSv1.2 and TLSv1.3 (if supported by your system) connections to a server. :const:`PROTOCOL_TLS_CLIENT` implies certificate validation and hostname checks by default. You have to load certificates into the context." +msgid "" +"The SSL client context created above will only allow TLSv1.2 and TLSv1.3 " +"(if supported by your system) connections to a " +"server. :const:`PROTOCOL_TLS_CLIENT` implies certificate validation and " +"hostname checks by default. You have to load certificates into the context." msgstr "" +"زمینه کلاینت SSL ایجادشده در بالا، فقط اتصال‌های TLSv1.2 و TLSv1.3 (اگر توسط " +"سیستم شما پشتیبانی شود) به یک سرور را مجاز " +"می‌کند. :const:`PROTOCOL_TLS_CLIENT` به‌طور پیش‌فرض شامل اعتبارسنجی گواهی و " +"بررسی‌های نام میزبان می‌شود. شما باید گواهی‌ها را در زمینه بارگذاری کنید." msgid "Cipher selection" -msgstr "" +msgstr "انتخاب رمز" -msgid "If you have advanced security requirements, fine-tuning of the ciphers enabled when negotiating a SSL session is possible through the :meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the ssl module disables certain weak ciphers by default, but you may want to further restrict the cipher choice. Be sure to read OpenSSL's documentation about the `cipher list format `_. If you want to check which ciphers are enabled by a given cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl ciphers`` command on your system." -msgstr "" +msgid "" +"If you have advanced security requirements, fine-tuning of the ciphers " +"enabled when negotiating a SSL session is possible through " +"the :meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the " +"ssl module disables certain weak ciphers by default, but you may want to " +"further restrict the cipher choice. Be sure to read OpenSSL's documentation " +"about the `cipher list format `_. If you want to check which ciphers are enabled by a " +"given cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl " +"ciphers`` command on your system." +msgstr "" +"اگر الزامات امنیتی پیشرفته دارید، تنظیم دقیق رمزهایی که هنگام مذاکره‌ی یک " +"نشست SSL فعال می‌شوند از طریق متد :meth:`SSLContext.set_ciphers` امکان‌پذیر " +"است. از Python 3.2.3 به بعد، ماژول ssl برخی از رمزهای ضعیف را به‌طور پیش‌فرض " +"غیرفعال می‌کند، اما ممکن است بخواهید انتخاب رمز را بیش‌تر محدود کنید. حتماً " +"مستندات OpenSSL را درباره‌ی `قالب فهرست رمز `_ بخوانید. اگر می‌خواهید بررسی کنید کدام " +"رمزها با یک فهرست رمز مشخص فعال می‌شوند، از :meth:`SSLContext.get_ciphers` " +"یا دستور ``openssl ciphers`` روی سیستم خود استفاده کنید." msgid "Multi-processing" -msgstr "" +msgstr "چندپردازشی" -msgid "If using this module as part of a multi-processed application (using, for example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be aware that OpenSSL's internal random number generator does not properly handle forked processes. Applications must change the PRNG state of the parent process if they use any SSL feature with :func:`os.fork`. Any successful call of :func:`~ssl.RAND_add` or :func:`~ssl.RAND_bytes` is sufficient." -msgstr "" +msgid "" +"If using this module as part of a multi-processed application (using, for " +"example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), " +"be aware that OpenSSL's internal random number generator does not properly " +"handle forked processes. Applications must change the PRNG state of the " +"parent process if they use any SSL feature with :func:`os.fork`. Any " +"successful call of :func:`~ssl.RAND_add` or :func:`~ssl.RAND_bytes` is " +"sufficient." +msgstr "" +"اگر از این ماژول به‌عنوان بخشی از یک برنامه چندفرایندی استفاده می‌کنید (برای " +"نمونه، با استفاده از ماژول‌های :mod:`multiprocessing` " +"یا :mod:`concurrent.futures`)، توجه داشته باشید که مولد اعداد تصادفی درونی " +"OpenSSL فرایندهای forkشده را به‌درستی مدیریت نمی‌کند. اگر برنامه‌ها از هر " +"قابلیت SSL همراه با :func:`os.fork` استفاده کنند، باید وضعیت PRNG فرایند " +"والد را تغییر دهند. هر فراخوانی موفق :func:`~ssl.RAND_add` " +"یا :func:`~ssl.RAND_bytes` کافی است." msgid "TLS 1.3" -msgstr "" +msgstr "TLS 1.3" -msgid "The TLS 1.3 protocol behaves slightly differently than previous version of TLS/SSL. Some new TLS 1.3 features are not yet available." +msgid "" +"The TLS 1.3 protocol behaves slightly differently than previous version of " +"TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" +"پروتکل TLS 1.3 نسبت به نسخه‌ی قبلی TLS/SSL کمی متفاوت عمل می‌کند. برخی " +"ویژگی‌های جدید TLS 1.3 هنوز در دسترس نیستند." -msgid "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 cipher suites are enabled by default. The method :meth:`SSLContext.set_ciphers` cannot enable or disable any TLS 1.3 ciphers yet, but :meth:`SSLContext.get_ciphers` returns them." +msgid "" +"TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " +"cipher suites are enabled by default. The " +"method :meth:`SSLContext.set_ciphers` cannot enable or disable any TLS 1.3 " +"ciphers yet, but :meth:`SSLContext.get_ciphers` returns them." msgstr "" +"TLS 1.3 از مجموعه‌ای مجزا از مجموعه‌های رمزنگاری (cipher suites) استفاده " +"می‌کند. همه‌ی مجموعه‌های رمزنگاری AES-GCM و ChaCha20 به‌طور پیش‌فرض فعال هستند. " +"متد :meth:`SSLContext.set_ciphers` هنوز نمی‌تواند هیچ‌کدام از رمزهای TLS 1.3 " +"را فعال یا غیرفعال کند، اما :meth:`SSLContext.get_ciphers` آن‌ها را " +"برمی‌گرداند." -msgid "Session tickets are no longer sent as part of the initial handshake and are handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are not compatible with TLS 1.3." +msgid "" +"Session tickets are no longer sent as part of the initial handshake and are " +"handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " +"not compatible with TLS 1.3." msgstr "" +"تیکت‌های نشست (session tickets) دیگر به‌عنوان بخشی از دست‌دهی اولیه ارسال " +"نمی‌شوند و به‌شکل متفاوتی مدیریت می‌شوند. :attr:`SSLSocket.session` " +"و :class:`SSLSession` با TLS 1.3 سازگار نیستند." -msgid "Client-side certificates are also no longer verified during the initial handshake. A server can request a certificate at any time. Clients process certificate requests while they send or receive application data from the server." +msgid "" +"Client-side certificates are also no longer verified during the initial " +"handshake. A server can request a certificate at any time. Clients " +"process certificate requests while they send or receive application data " +"from the server." msgstr "" +"گواهی‌های سمت کلاینت نیز دیگر در حین دست‌دهی اولیه تأیید نمی‌شوند. یک سرور " +"می‌تواند در هر زمان یک گواهی درخواست کند. کلاینت‌ها درخواست‌های گواهی را " +"هنگامی که داده‌های کاربردی را ارسال می‌کنند یا از سرور دریافت می‌کنند، پردازش " +"می‌کنند." -msgid "TLS 1.3 features like early data, deferred TLS client cert request, signature algorithm configuration, and rekeying are not supported yet." +msgid "" +"TLS 1.3 features like early data, deferred TLS client cert request, " +"signature algorithm configuration, and rekeying are not supported yet." msgstr "" +"قابلیت‌های TLS 1.3 مانند داده‌های زودهنگام (early data)، درخواست " +"به‌تعویق‌افتاده‌ی گواهی کلاینت TLS (deferred TLS client cert request)، پیکربندی " +"الگوریتم امضا و تولید مجدد کلید (rekeying) هنوز پشتیبانی نمی‌شوند." msgid "Class :class:`socket.socket`" -msgstr "" +msgstr "کلاس :class:`socket.socket`" msgid "Documentation of underlying :mod:`socket` class" -msgstr "" +msgstr "مستندات کلاس زیربنایی :mod:`socket`" -msgid "`SSL/TLS Strong Encryption: An Introduction `_" +msgid "" +"`SSL/TLS Strong Encryption: An Introduction `_" msgstr "" +"رمزنگاری قوی SSL/TLS: `مقدمه‌ای `_" msgid "Intro from the Apache HTTP Server documentation" -msgstr "" +msgstr "مقدمه‌ای از مستندات Apache HTTP Server" -msgid ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: Certificate-Based Key Management <1422>`" +msgid "" +":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " +"Certificate-Based Key Management <1422>`" msgstr "" +":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " +"Certificate-Based Key Management <1422>`" msgid "Steve Kent" -msgstr "" +msgstr "استیو کنت" msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -msgstr "" +msgstr ":rfc:`RFC 4086: الزامات تصادفی بودن برای امنیت <4086>`" msgid "Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker" -msgstr "" +msgstr "Donald E. Eastlake, Jeffrey I. Schiller, Steve Crocker" -msgid ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile <5280>`" +msgid "" +":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " +"Certificate Revocation List (CRL) Profile <5280>`" msgstr "" +":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " +"Certificate Revocation List (CRL) Profile <5280>`" msgid "David Cooper et al." -msgstr "" +msgstr "دیوید کوپر و دیگران" -msgid ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 <5246>`" +msgid "" +":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " +"<5246>`" msgstr "" +":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " +"<5246>`" msgid "Tim Dierks and Eric Rescorla." -msgstr "" +msgstr "تیم دیرکس و اریک رسکورلا." msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -msgstr "" +msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgid "Donald E. Eastlake" -msgstr "" +msgstr "Donald E. Eastlake" -msgid "`IANA TLS: Transport Layer Security (TLS) Parameters `_" +msgid "" +"`IANA TLS: Transport Layer Security (TLS) Parameters `_" msgstr "" +"`IANA TLS: پارامترهای امنیت لایه انتقال (TLS) `_" msgid "IANA" -msgstr "" +msgstr "IANA" -msgid ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) <7525>`" +msgid "" +":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " +"(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" msgstr "" +":rfc:`RFC 7525: توصیه‌هایی برای استفاده امن از Transport Layer Security " +"(TLS) و Datagram Transport Layer Security (DTLS) <7525>`" msgid "IETF" -msgstr "" +msgstr "IETF" -msgid "`Mozilla's Server Side TLS recommendations `_" +msgid "" +"`Mozilla's Server Side TLS recommendations `_" msgstr "" +"`توصیه‌های موزیلا برای TLS سمت سرور `_" msgid "Mozilla" -msgstr "" +msgstr "Mozilla" msgid "OpenSSL" -msgstr "" +msgstr "OpenSSL" msgid "(use in module ssl)" -msgstr "" +msgstr "(استفاده در ماژول ssl)" msgid "TLS" -msgstr "" +msgstr "TLS" msgid "SSL" -msgstr "" +msgstr "SSL" msgid "Transport Layer Security" -msgstr "" +msgstr "امنیت لایه انتقال (Transport Layer Security)" msgid "Secure Sockets Layer" -msgstr "" +msgstr "لایه‌ی سوکت‌های امن (Secure Sockets Layer)" msgid "certificates" -msgstr "" +msgstr "گواهی‌ها" msgid "X509 certificate" -msgstr "" +msgstr "گواهی X509" diff --git a/library/stat.po b/library/stat.po index d3bac9e2b..73b5ded00 100644 --- a/library/stat.po +++ b/library/stat.po @@ -24,64 +24,101 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!stat` --- Interpreting :func:`~os.stat` results" -msgstr "" +msgstr ":mod:`!stat` --- تفسیر نتایج :func:`~os.stat`" msgid "**Source code:** :source:`Lib/stat.py`" -msgstr "" +msgstr ":source:`Lib/stat.py`" -msgid "The :mod:`!stat` module defines constants and functions for interpreting the results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they exist). For complete details about the :c:func:`stat`, :c:func:`!fstat` and :c:func:`!lstat` calls, consult the documentation for your system." +msgid "" +"The :mod:`!stat` module defines constants and functions for interpreting the" +" results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they " +"exist). For complete details about the :c:func:`stat`, :c:func:`!fstat` and" +" :c:func:`!lstat` calls, consult the documentation for your system." msgstr "" +"ماژول :mod:`!stat` ثابت‌ها و توابعی را برای تفسیر نتایج :func:`os.stat`، " +":func:`os.fstat` و :func:`os.lstat` (در صورت وجود) تعریف می‌کند. برای جزئیات" +" کامل درباره‌ی فراخوانی‌های :c:func:`stat`، :c:func:`!fstat` و " +":c:func:`!lstat`، به مستندات سیستم خود مراجعه کنید." msgid "The stat module is backed by a C implementation." -msgstr "" +msgstr "ماژول stat بر پایه‌ی یک پیاده‌سازی C است." -msgid "The :mod:`!stat` module defines the following functions to test for specific file types:" +msgid "" +"The :mod:`!stat` module defines the following functions to test for specific" +" file types:" msgstr "" +"ماژول :mod:`!stat` توابع زیر را برای بررسی انواع خاصی از فایل تعریف می‌کند:" msgid "Return non-zero if the mode is from a directory." -msgstr "" +msgstr "اگر حالت (mode) مربوط به یک پوشه باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a character special device file." msgstr "" +"اگر حالت از یک فایل دستگاهی خاص از نوع نویسه‌ای باشد، مقدار غیرصفر " +"برمی‌گرداند." msgid "Return non-zero if the mode is from a block special device file." -msgstr "" +msgstr "اگر حالت از یک فایل دستگاه ویژه بلوکی باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a regular file." -msgstr "" +msgstr "اگر حالت مربوط به یک فایل معمولی باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a FIFO (named pipe)." -msgstr "" +msgstr "اگر حالت از یک FIFO (پایپ نام‌دار) باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a symbolic link." -msgstr "" +msgstr "اگر حالت از یک پیوند نمادین باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a socket." -msgstr "" +msgstr "اگر حالت از یک سوکت باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a door." -msgstr "" +msgstr "اگر حالت (mode) از یک در (door) باشد، مقدار غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from an event port." -msgstr "" +msgstr "اگر حالت از یک پورت رویداد (event port) باشد، غیرصفر برمی‌گرداند." msgid "Return non-zero if the mode is from a whiteout." -msgstr "" +msgstr "اگر حالت از یک whiteout باشد، غیرصفر برمی‌گرداند." -msgid "Two additional functions are defined for more general manipulation of the file's mode:" -msgstr "" +msgid "" +"Two additional functions are defined for more general manipulation of the " +"file's mode:" +msgstr "دو تابع اضافی برای دستکاری عمومی‌تر حالت فایل تعریف شده‌اند:" -msgid "Return the portion of the file's mode that can be set by :func:`os.chmod`\\ ---that is, the file's permission bits, plus the sticky bit, set-group-id, and set-user-id bits (on systems that support them)." +msgid "" +"Return the portion of the file's mode that can be set by :func:`os.chmod`\\ " +"---that is, the file's permission bits, plus the sticky bit, set-group-id, " +"and set-user-id bits (on systems that support them)." msgstr "" +"برگرداندن بخشی از حالت فایل قابل تنظیم با :func:`os.chmod`\\ ---یعنی، " +"بیت‌های دسترسی فایل، به‌همراه بیت چسبنده (sticky bit)، بیت‌های set-group-id " +"و set-user-id (در سیستم‌هایی که از آن‌ها پشتیبانی می‌کنند)." -msgid "Return the portion of the file's mode that describes the file type (used by the :func:`!S_IS\\*` functions above)." +msgid "" +"Return the portion of the file's mode that describes the file type (used by " +"the :func:`!S_IS\\*` functions above)." msgstr "" +"بخشی از حالت فایل را که نوع فایل را توصیف می‌کند، برمی‌گرداند (که توابع " +":func:`!S_IS\\*` بالا از آن استفاده می‌کنند)." -msgid "Normally, you would use the :func:`!os.path.is\\*` functions for testing the type of a file; the functions here are useful when you are doing multiple tests of the same file and wish to avoid the overhead of the :c:func:`stat` system call for each test. These are also useful when checking for information about a file that isn't handled by :mod:`os.path`, like the tests for block and character devices." -msgstr "" +msgid "" +"Normally, you would use the :func:`!os.path.is\\*` functions for testing the" +" type of a file; the functions here are useful when you are doing multiple " +"tests of the same file and wish to avoid the overhead of the :c:func:`stat` " +"system call for each test. These are also useful when checking for " +"information about a file that isn't handled by :mod:`os.path`, like the " +"tests for block and character devices." +msgstr "" +"معمولاً برای آزمایش نوع یک فایل از توابع :func:`!os.path.is\\*` استفاده " +"می‌کنید؛ توابع این بخش زمانی مفید هستند که چندین آزمایش روی یک فایل انجام " +"می‌دهید و می‌خواهید از سربار فراخوانی سیستمی :c:func:`stat` برای هر آزمایش " +"اجتناب کنید. این توابع همچنین هنگام بررسی اطلاعات مربوط به یک فایل که توسط " +":mod:`os.path` پشتیبانی نمی‌شود، مانند آزمایش‌های مربوط به دستگاه‌های بلوکی " +"و نویسه‌ای، مفید هستند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "import os, sys\n" @@ -110,216 +147,349 @@ msgid "" "if __name__ == '__main__':\n" " walktree(sys.argv[1], visitfile)" msgstr "" +"import os, sys\n" +"from stat import *\n" +"\n" +"def walktree(top, callback):\n" +" '''recursively descend the directory tree rooted at top,\n" +" calling the callback function for each regular file'''\n" +"\n" +" for f in os.listdir(top):\n" +" pathname = os.path.join(top, f)\n" +" mode = os.lstat(pathname).st_mode\n" +" if S_ISDIR(mode):\n" +" # It's a directory, recurse into it\n" +" walktree(pathname, callback)\n" +" elif S_ISREG(mode):\n" +" # It's a file, call the callback function\n" +" callback(pathname)\n" +" else:\n" +" # Unknown file type, print a message\n" +" print('Skipping %s' % pathname)\n" +"\n" +"def visitfile(file):\n" +" print('visiting', file)\n" +"\n" +"if __name__ == '__main__':\n" +" walktree(sys.argv[1], visitfile)" -msgid "An additional utility function is provided to convert a file's mode in a human readable string:" +msgid "" +"An additional utility function is provided to convert a file's mode in a " +"human readable string:" msgstr "" +"یک تابع کمکی اضافی برای تبدیل حالت فایل به رشته‌ای قابل‌خواندن برای انسان " +"ارائه شده است:" msgid "Convert a file's mode to a string of the form '-rwxrwxrwx'." -msgstr "" +msgstr "حالت یک فایل را به رشته‌ای به قالب '-rwxrwxrwx' تبدیل می‌کند." -msgid "The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and :data:`S_IFWHT`." +msgid "" +"The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and " +":data:`S_IFWHT`." msgstr "" +"این تابع از :data:`S_IFDOOR`، :data:`S_IFPORT` و :data:`S_IFWHT` پشتیبانی " +"می‌کند." -msgid "All the variables below are simply symbolic indexes into the 10-tuple returned by :func:`os.stat`, :func:`os.fstat` or :func:`os.lstat`." +msgid "" +"All the variables below are simply symbolic indexes into the 10-tuple " +"returned by :func:`os.stat`, :func:`os.fstat` or :func:`os.lstat`." msgstr "" +"همه‌ی متغیرهای زیر صرفاً اندیس‌های نمادینی به تاپل ۱۰تایی هستند که توسط " +":func:`os.stat`، :func:`os.fstat` یا :func:`os.lstat` بازگردانده می‌شود." msgid "Inode protection mode." -msgstr "" +msgstr "حالت محافظت آی‌نود (inode)." msgid "Inode number." -msgstr "" +msgstr "شماره‌ی آی‌نود (inode)." msgid "Device inode resides on." -msgstr "" +msgstr "دستگاهی که آی‌نود (inode) روی آن قرار دارد." msgid "Number of links to the inode." -msgstr "" +msgstr "تعداد پیوندها به آی‌نود (inode)." msgid "User id of the owner." -msgstr "" +msgstr "شناسه کاربری مالک." msgid "Group id of the owner." -msgstr "" +msgstr "شناسه‌ی گروه مالک." -msgid "Size in bytes of a plain file; amount of data waiting on some special files." +msgid "" +"Size in bytes of a plain file; amount of data waiting on some special files." msgstr "" +"اندازه‌ی یک فایل ساده بر حسب بایت؛ مقدار داده‌ای که در برخی فایل‌های خاص در " +"انتظار است." msgid "Time of last access." -msgstr "" +msgstr "زمان آخرین دسترسی." msgid "Time of last modification." -msgstr "" +msgstr "زمان آخرین تغییر." -msgid "The \"ctime\" as reported by the operating system. On some systems (like Unix) is the time of the last metadata change, and, on others (like Windows), is the creation time (see platform documentation for details)." +msgid "" +"The \"ctime\" as reported by the operating system. On some systems (like " +"Unix) is the time of the last metadata change, and, on others (like " +"Windows), is the creation time (see platform documentation for details)." msgstr "" +"\"ctime\" همان‌طور که توسط سیستم‌عامل گزارش می‌شود. در برخی سیستم‌ها (مانند " +"Unix)، زمان آخرین تغییر فراداده است و در برخی دیگر (مانند Windows)، زمان " +"ایجاد است (برای جزئیات، مستندات پلتفرم را ببینید)." -msgid "The interpretation of \"file size\" changes according to the file type. For plain files this is the size of the file in bytes. For FIFOs and sockets under most flavors of Unix (including Linux in particular), the \"size\" is the number of bytes waiting to be read at the time of the call to :func:`os.stat`, :func:`os.fstat`, or :func:`os.lstat`; this can sometimes be useful, especially for polling one of these special files after a non-blocking open. The meaning of the size field for other character and block devices varies more, depending on the implementation of the underlying system call." -msgstr "" +msgid "" +"The interpretation of \"file size\" changes according to the file type. For" +" plain files this is the size of the file in bytes. For FIFOs and sockets " +"under most flavors of Unix (including Linux in particular), the \"size\" is " +"the number of bytes waiting to be read at the time of the call to " +":func:`os.stat`, :func:`os.fstat`, or :func:`os.lstat`; this can sometimes " +"be useful, especially for polling one of these special files after a non-" +"blocking open. The meaning of the size field for other character and block " +"devices varies more, depending on the implementation of the underlying " +"system call." +msgstr "" +"تفسیر «اندازه‌ی فایل» بسته به نوع فایل تغییر می‌کند. برای فایل‌های معمولی، " +"این مقدار اندازه‌ی فایل بر حسب بایت است. برای FIFOها و سوکت‌ها در بیشتر " +"انواع یونیکس (از جمله، به‌طور خاص، لینوکس)، «اندازه» تعداد بایت‌هایی است که " +"در زمان فراخوانی :func:`os.stat`، :func:`os.fstat` یا :func:`os.lstat` در " +"انتظار خوانده شدن هستند؛ این موضوع گاهی می‌تواند مفید باشد، به‌ویژه برای " +"پایش یکی از این فایل‌های خاص پس از باز کردن به‌صورت غیرمسدودکننده. معنای " +"فیلد اندازه برای سایر دستگاه‌های نویسه‌ای و بلوکی، بسته به پیاده‌سازی " +"فراخوانی سیستمی زیربنایی، بیشتر متفاوت است." -msgid "The variables below define the flags used in the :data:`ST_MODE` field." +msgid "" +"The variables below define the flags used in the :data:`ST_MODE` field." msgstr "" +"متغیرهای زیر، پرچم‌های استفاده‌شده در فیلد :data:`ST_MODE` را تعریف می‌کنند." -msgid "Use of the functions above is more portable than use of the first set of flags:" +msgid "" +"Use of the functions above is more portable than use of the first set of " +"flags:" msgstr "" +"استفاده از توابع بالا نسبت به استفاده از مجموعه‌ی نخست پرچم‌ها، قابل‌حمل‌تر " +"است:" msgid "Socket." -msgstr "" +msgstr "سوکت." msgid "Symbolic link." -msgstr "" +msgstr "پیوند نمادین." msgid "Regular file." -msgstr "" +msgstr "فایل معمولی." msgid "Block device." -msgstr "" +msgstr "دستگاه بلوکی." msgid "Directory." -msgstr "" +msgstr "پوشه." msgid "Character device." -msgstr "" +msgstr "دستگاه نویسه‌ای." msgid "FIFO." -msgstr "" +msgstr "FIFO." msgid "Door." -msgstr "" +msgstr "در." msgid "Event port." -msgstr "" +msgstr "پورت رویداد." msgid "Whiteout." -msgstr "" +msgstr "سفیدی مطلق (Whiteout)." -msgid ":data:`S_IFDOOR`, :data:`S_IFPORT` or :data:`S_IFWHT` are defined as 0 when the platform does not have support for the file types." +msgid "" +":data:`S_IFDOOR`, :data:`S_IFPORT` or :data:`S_IFWHT` are defined as 0 when " +"the platform does not have support for the file types." msgstr "" +":data:`S_IFDOOR`، :data:`S_IFPORT` یا :data:`S_IFWHT` زمانی که پلتفرم از " +"انواع فایل پشتیبانی نمی‌کند، به‌صورت ۰ تعریف شده‌اند." -msgid "The following flags can also be used in the *mode* argument of :func:`os.chmod`:" +msgid "" +"The following flags can also be used in the *mode* argument of " +":func:`os.chmod`:" msgstr "" +"پرچم‌های زیر همچنین می‌توانند در آرگومان *mode* تابع :func:`os.chmod` " +"استفاده شوند:" msgid "Set UID bit." -msgstr "" +msgstr "تنظیم بیت UID." -msgid "Set-group-ID bit. This bit has several special uses. For a directory it indicates that BSD semantics is to be used for that directory: files created there inherit their group ID from the directory, not from the effective group ID of the creating process, and directories created there will also get the :data:`S_ISGID` bit set. For a file that does not have the group execution bit (:data:`S_IXGRP`) set, the set-group-ID bit indicates mandatory file/record locking (see also :data:`S_ENFMT`)." -msgstr "" +msgid "" +"Set-group-ID bit. This bit has several special uses. For a directory it " +"indicates that BSD semantics is to be used for that directory: files created" +" there inherit their group ID from the directory, not from the effective " +"group ID of the creating process, and directories created there will also " +"get the :data:`S_ISGID` bit set. For a file that does not have the group " +"execution bit (:data:`S_IXGRP`) set, the set-group-ID bit indicates " +"mandatory file/record locking (see also :data:`S_ENFMT`)." +msgstr "" +"بیت Set-group-ID. این بیت چندین کاربرد خاص دارد. برای یک پوشه، نشان می‌دهد " +"که باید از رفتار BSD برای آن پوشه استفاده شود: فایل‌های ایجادشده در آن، " +"شناسه‌ی گروه خود را از پوشه به ارث می‌برند، نه از شناسه‌ی گروه مؤثر فرایند " +"ایجادکننده، و بیت :data:`S_ISGID` نیز برای پوشه‌های ایجادشده در آن تنظیم " +"خواهد شد. برای فایلی که بیت اجرای گروهی (:data:`S_IXGRP`) روی آن تنظیم نشده " +"باشد، بیت Set-group-ID نشان‌دهنده‌ی قفل اجباری فایل/رکورد است (همچنین " +":data:`S_ENFMT` را ببینید)." -msgid "Sticky bit. When this bit is set on a directory it means that a file in that directory can be renamed or deleted only by the owner of the file, by the owner of the directory, or by a privileged process." +msgid "" +"Sticky bit. When this bit is set on a directory it means that a file in " +"that directory can be renamed or deleted only by the owner of the file, by " +"the owner of the directory, or by a privileged process." msgstr "" +"بیت چسبنده (Sticky bit). هنگامی که این بیت برای یک پوشه تنظیم شده باشد، به " +"این معناست که یک فایل در آن پوشه فقط توسط مالک فایل، مالک پوشه، یا یک فرایند" +" دارای امتیاز می‌تواند تغییر نام داده یا حذف شود." msgid "Mask for file owner permissions." -msgstr "" +msgstr "ماسک دسترسی‌های مالک پرونده." msgid "Owner has read permission." -msgstr "" +msgstr "مالک دارای اجازه‌ی خواندن است." msgid "Owner has write permission." -msgstr "" +msgstr "مالک اجازه‌ی نوشتن دارد." msgid "Owner has execute permission." -msgstr "" +msgstr "مالک اجازه‌ی اجرا دارد." msgid "Mask for group permissions." -msgstr "" +msgstr "ماسک دسترسی‌های گروه." msgid "Group has read permission." -msgstr "" +msgstr "گروه اجازه‌ی خواندن دارد." msgid "Group has write permission." -msgstr "" +msgstr "گروه اجازه‌ی نوشتن دارد." msgid "Group has execute permission." -msgstr "" +msgstr "گروه اجازه‌ی اجرا دارد." msgid "Mask for permissions for others (not in group)." -msgstr "" +msgstr "ماسک (mask) دسترسی‌های دیگران (خارج از گروه)." msgid "Others have read permission." -msgstr "" +msgstr "دیگران اجازه‌ی خواندن دارند." msgid "Others have write permission." -msgstr "" +msgstr "دیگران دسترسی نوشتن دارند." msgid "Others have execute permission." -msgstr "" +msgstr "دیگران اجازه‌ی اجرا دارند." -msgid "System V file locking enforcement. This flag is shared with :data:`S_ISGID`: file/record locking is enforced on files that do not have the group execution bit (:data:`S_IXGRP`) set." +msgid "" +"System V file locking enforcement. This flag is shared with " +":data:`S_ISGID`: file/record locking is enforced on files that do not have " +"the group execution bit (:data:`S_IXGRP`) set." msgstr "" +"اعمال قفل فایل System V. این پرچم با :data:`S_ISGID` مشترک است: قفل " +"فایل/رکورد بر روی فایل‌هایی که بیت اجرای گروهی (:data:`S_IXGRP`) در آن‌ها " +"فعال نیست، اعمال می‌شود." msgid "Unix V7 synonym for :data:`S_IRUSR`." -msgstr "" +msgstr "مترادف :data:`S_IRUSR` در Unix V7." msgid "Unix V7 synonym for :data:`S_IWUSR`." -msgstr "" +msgstr "مترادف Unix V7 برای :data:`S_IWUSR`." msgid "Unix V7 synonym for :data:`S_IXUSR`." -msgstr "" +msgstr "مترادف Unix V7 برای :data:`S_IXUSR`." -msgid "The following flags can be used in the *flags* argument of :func:`os.chflags`:" +msgid "" +"The following flags can be used in the *flags* argument of " +":func:`os.chflags`:" msgstr "" +"می‌توان از پرچم‌های زیر در آرگومان *flags* تابع :func:`os.chflags` استفاده " +"کرد:" msgid "All user settable flags." -msgstr "" +msgstr "تمام پرچم‌های قابل‌تنظیم توسط کاربر." msgid "Do not dump the file." -msgstr "" +msgstr "فایل را برون‌ریزی نکنید." msgid "The file may not be changed." -msgstr "" +msgstr "ممکن است فایل تغییر نکرده باشد." msgid "The file may only be appended to." -msgstr "" +msgstr "فقط می‌توان به فایل الحاق کرد." msgid "The directory is opaque when viewed through a union stack." msgstr "" +"پوشه هنگامی که از طریق یک پشته‌ی اجتماع (union stack) مشاهده می‌شود، غیرشفاف " +"است." msgid "The file may not be renamed or deleted." -msgstr "" +msgstr "پرونده را نمی‌توان تغییر نام داد یا حذف کرد." msgid "The file is stored compressed (macOS 10.6+)." -msgstr "" +msgstr "این فایل به‌صورت فشرده ذخیره می‌شود (macOS 10.6+)." msgid "Used for handling document IDs (macOS)" -msgstr "" +msgstr "برای مدیریت شناسه‌های سند (macOS) استفاده می‌شود" msgid "The file needs an entitlement for reading or writing (macOS 10.13+)" msgstr "" +"این فایل برای خواندن یا نوشتن به یک حق دسترسی (entitlement) نیاز دارد (macOS" +" 10.13+)" msgid "The file should not be displayed in a GUI (macOS 10.5+)." msgstr "" +"این فایل نباید در یک رابط کاربری گرافیکی (GUI) نمایش داده شود (macOS 10.5+)." msgid "All super-user changeable flags" -msgstr "" +msgstr "همه‌ی پرچم‌های قابل‌تغییر توسط ابرکاربر" msgid "All super-user supported flags" -msgstr "" +msgstr "همه‌ی پرچم‌های پشتیبانی‌شده‌ی ابرکاربر" msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" msgid "All super-user read-only synthetic flags" -msgstr "" +msgstr "همه‌ی پرچم‌های مصنوعی فقط‌خواندنی برای ابرکاربر" msgid "The file may be archived." -msgstr "" +msgstr "ممکن است فایل بایگانی‌شده باشد." msgid "The file needs an entitlement to write to (macOS 10.13+)" msgstr "" +"این فایل برای نوشتن در آن به یک حق دسترسی (entitlement) نیاز دارد (macOS 10.13+)" msgid "The file is a snapshot file." -msgstr "" +msgstr "این فایل یک فایل تصویر لحظه‌ای است." msgid "The file is a firmlink (macOS 10.15+)" -msgstr "" +msgstr "این فایل یک فیرملینک (firmlink) است (macOS 10.15+)" msgid "The file is a dataless object (macOS 10.15+)" -msgstr "" +msgstr "این فایل یک شیء بدون داده است (macOS 10.15+)" -msgid "See the \\*BSD or macOS systems man page :manpage:`chflags(2)` for more information." +msgid "" +"See the \\*BSD or macOS systems man page :manpage:`chflags(2)` for more " +"information." msgstr "" +"برای اطلاعات بیشتر، صفحه man سیستم‌های \\*BSD یا macOS با عنوان " +":manpage:`chflags(2)` را ببینید." -msgid "On Windows, the following file attribute constants are available for use when testing bits in the ``st_file_attributes`` member returned by :func:`os.stat`. See the `Windows API documentation `_ for more detail on the meaning of these constants." -msgstr "" +msgid "" +"On Windows, the following file attribute constants are available for use " +"when testing bits in the ``st_file_attributes`` member returned by " +":func:`os.stat`. See the `Windows API documentation " +"`_ " +"for more detail on the meaning of these constants." +msgstr "" +"در ویندوز، ثابت‌های ویژگی فایل زیر برای استفاده هنگام بررسی بیت‌های عضو " +"``st_file_attributes`` برگردانده‌شده از :func:`os.stat` در دسترس هستند. برای" +" جزئیات بیشتر درباره معنای این ثابت‌ها، `مستندات Windows API " +"`_ " +"را ببینید." -msgid "On Windows, the following constants are available for comparing against the ``st_reparse_tag`` member returned by :func:`os.lstat`. These are well-known constants, but are not an exhaustive list." +msgid "" +"On Windows, the following constants are available for comparing against the " +"``st_reparse_tag`` member returned by :func:`os.lstat`. These are well-known" +" constants, but are not an exhaustive list." msgstr "" +"در ویندوز، ثابت‌های زیر برای مقایسه با عضو ``st_reparse_tag`` برگردانده‌شده " +"توسط :func:`os.lstat` در دسترس هستند. این‌ها ثابت‌های شناخته‌شده‌ای هستند، " +"اما فهرستی جامع نیستند." diff --git a/library/statistics.po b/library/statistics.po index 8b850b450..ba7d98e90 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -24,22 +24,64 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!statistics` --- Mathematical statistics functions" -msgstr "" +msgstr ":mod:`!statistics` --- توابع آمار ریاضی" msgid "**Source code:** :source:`Lib/statistics.py`" -msgstr "" +msgstr ":source:`Lib/statistics.py`" -msgid "This module provides functions for calculating mathematical statistics of numeric (:class:`~numbers.Real`-valued) data." +msgid "" +"This module provides functions for calculating mathematical statistics of " +"numeric (:class:`~numbers.Real`-valued) data." msgstr "" +"این ماژول توابعی برای محاسبه‌ی آمار ریاضی داده‌های عددی (با مقدار " +":class:`~numbers.Real`) فراهم می‌کند." -msgid "The module is not intended to be a competitor to third-party libraries such as `NumPy `_, `SciPy `_, or proprietary full-featured statistics packages aimed at professional statisticians such as Minitab, SAS and Matlab. It is aimed at the level of graphing and scientific calculators." -msgstr "" +msgid "" +"The module is not intended to be a competitor to third-party libraries such " +"as `NumPy `_, `SciPy `_, or " +"proprietary full-featured statistics packages aimed at professional " +"statisticians such as Minitab, SAS and Matlab. It is aimed at the level of " +"graphing and scientific calculators." +msgstr "" +"این ماژول به‌عنوان رقیبی برای کتابخانه‌های شخص ثالثی مانند `NumPy " +"`_، `SciPy `_، یا بسته‌های آماری " +"مالکیتی و تمام‌امکاناتی مانند Minitab، SAS و Matlab که برای آماردانان " +"حرفه‌ای طراحی شده‌اند، در نظر گرفته نشده است. هدف آن در سطح ماشین‌حساب‌های " +"نموداری و علمی است." -msgid "Unless explicitly noted, these functions support :class:`int`, :class:`float`, :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. Behaviour with other types (whether in the numeric tower or not) is currently unsupported. Collections with a mix of types are also undefined and implementation-dependent. If your input data consists of mixed types, you may be able to use :func:`map` to ensure a consistent result, for example: ``map(float, input_data)``." -msgstr "" +msgid "" +"Unless explicitly noted, these functions support :class:`int`, " +":class:`float`, :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. " +"Behaviour with other types (whether in the numeric tower or not) is " +"currently unsupported. Collections with a mix of types are also undefined " +"and implementation-dependent. If your input data consists of mixed types, " +"you may be able to use :func:`map` to ensure a consistent result, for " +"example: ``map(float, input_data)``." +msgstr "" +"مگر آن‌که به‌صراحت ذکر شده باشد، این توابع از :class:`int`، :class:`float`، " +":class:`~decimal.Decimal` و :class:`~fractions.Fraction` پشتیبانی می‌کنند. " +"رفتار آن‌ها با انواع دیگر (چه در سلسله‌مراتب عددی (numeric tower) باشند و چه" +" نباشند) در حال حاضر پشتیبانی نمی‌شود. رفتار با مجموعه‌های دارای ترکیبی از " +"انواع نیز تعریف‌نشده و وابسته به پیاده‌سازی است. اگر داده‌های ورودی شما از " +"انواع مختلط تشکیل شده باشد، ممکن است بتوانید برای اطمینان از نتیجه‌ای سازگار" +" از :func:`map` استفاده کنید، برای مثال: ``map(float, input_data)``." -msgid "Some datasets use ``NaN`` (not a number) values to represent missing data. Since NaNs have unusual comparison semantics, they cause surprising or undefined behaviors in the statistics functions that sort data or that count occurrences. The functions affected are ``median()``, ``median_low()``, ``median_high()``, ``median_grouped()``, ``mode()``, ``multimode()``, and ``quantiles()``. The ``NaN`` values should be stripped before calling these functions::" -msgstr "" +msgid "" +"Some datasets use ``NaN`` (not a number) values to represent missing data. " +"Since NaNs have unusual comparison semantics, they cause surprising or " +"undefined behaviors in the statistics functions that sort data or that count" +" occurrences. The functions affected are ``median()``, ``median_low()``, " +"``median_high()``, ``median_grouped()``, ``mode()``, ``multimode()``, and " +"``quantiles()``. The ``NaN`` values should be stripped before calling these" +" functions::" +msgstr "" +"برخی از مجموعه‌داده‌ها از مقادیر ``NaN`` (عدد نیست) برای نمایش داده‌های " +"مفقود استفاده می‌کنند. از آنجا که مقادیر NaN رفتار مقایسه‌ای غیرمعمولی " +"دارند، در توابع آماری که داده‌ها را مرتب می‌کنند یا رخدادها را می‌شمارند، " +"باعث رفتارهای غافلگیرکننده یا تعریف‌نشده می‌شوند. توابع تحت‌تأثیر عبارت‌اند " +"از ``median()``، ``median_low()``، ``median_high()``، ``median_grouped()``، " +"``mode()``، ``multimode()`` و ``quantiles()``. مقادیر ``NaN`` باید پیش از " +"فراخوانی این توابع حذف شوند::" msgid "" ">>> from statistics import median\n" @@ -62,162 +104,206 @@ msgid "" ">>> median(clean) # This result is now well defined\n" "18.75" msgstr "" +">>> from statistics import median\n" +">>> from math import isnan\n" +">>> from itertools import filterfalse\n" +"\n" +">>> data = [20.7, float('NaN'),19.2, 18.3, float('NaN'), 14.4]\n" +">>> sorted(data) # This has surprising behavior\n" +"[20.7, nan, 14.4, 18.3, 19.2, nan]\n" +">>> median(data) # This result is unexpected\n" +"16.35\n" +"\n" +">>> sum(map(isnan, data)) # Number of missing values\n" +"2\n" +">>> clean = list(filterfalse(isnan, data)) # Strip NaN values\n" +">>> clean\n" +"[20.7, 19.2, 18.3, 14.4]\n" +">>> sorted(clean) # Sorting now works as expected\n" +"[14.4, 18.3, 19.2, 20.7]\n" +">>> median(clean) # This result is now well defined\n" +"18.75" msgid "Averages and measures of central location" -msgstr "" +msgstr "میانگین‌ها و معیارهای مکان مرکزی" -msgid "These functions calculate an average or typical value from a population or sample." +msgid "" +"These functions calculate an average or typical value from a population or " +"sample." msgstr "" +"این توابع یک مقدار میانگین یا معمول را از یک جامعه یا نمونه محاسبه می‌کنند." msgid ":func:`mean`" -msgstr "" +msgstr ":func:`mean`" msgid "Arithmetic mean (\"average\") of data." -msgstr "" +msgstr "میانگین حسابی («میانگین») داده‌ها." msgid ":func:`fmean`" -msgstr "" +msgstr ":func:`fmean`" msgid "Fast, floating-point arithmetic mean, with optional weighting." -msgstr "" +msgstr "میانگین حسابی ممیز شناور و سریع، با وزن‌دهی اختیاری." msgid ":func:`geometric_mean`" -msgstr "" +msgstr ":func:`geometric_mean`" msgid "Geometric mean of data." -msgstr "" +msgstr "میانگین هندسی داده‌ها." msgid ":func:`harmonic_mean`" -msgstr "" +msgstr ":func:`harmonic_mean`" msgid "Harmonic mean of data." -msgstr "" +msgstr "میانگین هارمونیک داده‌ها." msgid ":func:`kde`" -msgstr "" +msgstr ":func:`kde`" msgid "Estimate the probability density distribution of the data." -msgstr "" +msgstr "توزیع چگالی احتمال داده‌ها را برآورد کنید." msgid ":func:`kde_random`" -msgstr "" +msgstr ":func:`kde_random`" msgid "Random sampling from the PDF generated by kde()." -msgstr "" +msgstr "نمونه‌گیری تصادفی از PDF تولیدشده توسط kde()." msgid ":func:`median`" -msgstr "" +msgstr ":func:`median`" msgid "Median (middle value) of data." -msgstr "" +msgstr "میانه (مقدار میانی) داده‌ها." msgid ":func:`median_low`" -msgstr "" +msgstr ":func:`median_low`" msgid "Low median of data." -msgstr "" +msgstr "میانه‌ی پایین داده‌ها." msgid ":func:`median_high`" -msgstr "" +msgstr ":func:`median_high`" msgid "High median of data." -msgstr "" +msgstr "میانه‌ی بالای داده‌ها." msgid ":func:`median_grouped`" -msgstr "" +msgstr ":func:`median_grouped`" msgid "Median (50th percentile) of grouped data." -msgstr "" +msgstr "میانه (صدک ۵۰م) داده‌های گروه‌بندی‌شده." msgid ":func:`mode`" -msgstr "" +msgstr ":func:`mode`" msgid "Single mode (most common value) of discrete or nominal data." -msgstr "" +msgstr "مد تکی (رایج‌ترین مقدار) داده‌های گسسته یا اسمی." msgid ":func:`multimode`" -msgstr "" +msgstr ":func:`multimode`" msgid "List of modes (most common values) of discrete or nominal data." -msgstr "" +msgstr "فهرست مدها (رایج‌ترین مقادیر) داده‌های گسسته یا اسمی." msgid ":func:`quantiles`" -msgstr "" +msgstr ":func:`quantiles`" msgid "Divide data into intervals with equal probability." -msgstr "" +msgstr "داده‌ها را به بازه‌هایی با احتمال برابر تقسیم کنید." msgid "Measures of spread" -msgstr "" +msgstr "معیارهای پراکندگی" -msgid "These functions calculate a measure of how much the population or sample tends to deviate from the typical or average values." +msgid "" +"These functions calculate a measure of how much the population or sample " +"tends to deviate from the typical or average values." msgstr "" +"این توابع سنجه‌ای از میزان انحراف جمعیت یا نمونه از مقادیر معمول یا میانگین " +"را محاسبه می‌کنند." msgid ":func:`pstdev`" -msgstr "" +msgstr ":func:`pstdev`" msgid "Population standard deviation of data." -msgstr "" +msgstr "انحراف معیار جامعه‌ی داده‌ها." msgid ":func:`pvariance`" -msgstr "" +msgstr ":func:`pvariance`" msgid "Population variance of data." -msgstr "" +msgstr "واریانس جامعه‌ی داده‌ها." msgid ":func:`stdev`" -msgstr "" +msgstr ":func:`stdev`" msgid "Sample standard deviation of data." -msgstr "" +msgstr "انحراف معیار نمونه از داده‌ها." msgid ":func:`variance`" -msgstr "" +msgstr ":func:`variance`" msgid "Sample variance of data." -msgstr "" +msgstr "واریانس نمونه‌ی داده‌ها." msgid "Statistics for relations between two inputs" -msgstr "" +msgstr "آمار روابط بین دو ورودی" -msgid "These functions calculate statistics regarding relations between two inputs." -msgstr "" +msgid "" +"These functions calculate statistics regarding relations between two inputs." +msgstr "این توابع آمار مربوط به روابط بین دو ورودی را محاسبه می‌کنند." msgid ":func:`covariance`" -msgstr "" +msgstr ":func:`covariance`" msgid "Sample covariance for two variables." -msgstr "" +msgstr "کوواریانس نمونه برای دو متغیر." msgid ":func:`correlation`" -msgstr "" +msgstr ":func:`correlation`" msgid "Pearson and Spearman's correlation coefficients." -msgstr "" +msgstr "ضرایب هم‌بستگی پیرسون و اسپیرمن." msgid ":func:`linear_regression`" -msgstr "" +msgstr ":func:`linear_regression`" msgid "Slope and intercept for simple linear regression." -msgstr "" +msgstr "شیب و عرض از مبدأ برای رگرسیون خطی ساده." msgid "Function details" -msgstr "" +msgstr "جزئیات تابع" -msgid "Note: The functions do not require the data given to them to be sorted. However, for reading convenience, most of the examples show sorted sequences." +msgid "" +"Note: The functions do not require the data given to them to be sorted. " +"However, for reading convenience, most of the examples show sorted " +"sequences." msgstr "" +"نکته: این توابع نیازی ندارند که داده‌های داده‌شده به آن‌ها مرتب‌شده باشند. " +"با این حال، برای سهولت خواندن، بیشتر مثال‌ها دنباله‌های مرتب‌شده را نشان " +"می‌دهند." -msgid "Return the sample arithmetic mean of *data* which can be a sequence or iterable." +msgid "" +"Return the sample arithmetic mean of *data* which can be a sequence or " +"iterable." msgstr "" +"میانگین حسابی نمونه‌ای از *data* را برمی‌گرداند، که می‌تواند یک دنباله یا " +"پیمایش‌پذیر باشد." -msgid "The arithmetic mean is the sum of the data divided by the number of data points. It is commonly called \"the average\", although it is only one of many different mathematical averages. It is a measure of the central location of the data." +msgid "" +"The arithmetic mean is the sum of the data divided by the number of data " +"points. It is commonly called \"the average\", although it is only one of " +"many different mathematical averages. It is a measure of the central " +"location of the data." msgstr "" +"میانگین حسابی، مجموع داده‌ها تقسیم بر تعداد نقاط داده است. این مقدار معمولاً" +" «میانگین» نامیده می‌شود، هرچند تنها یکی از میانگین‌های ریاضی گوناگون است. " +"این سنجه‌ای از موقعیت مرکزی داده‌ها است." msgid "If *data* is empty, :exc:`StatisticsError` will be raised." -msgstr "" +msgstr "اگر *data* خالی باشد، :exc:`StatisticsError` پرتاب خواهد شد." msgid "Some examples of use:" -msgstr "" +msgstr "چند نمونه از کاربرد:" msgid "" ">>> mean([1, 2, 3, 4, 4])\n" @@ -233,26 +319,71 @@ msgid "" ">>> mean([D(\"0.5\"), D(\"0.75\"), D(\"0.625\"), D(\"0.375\")])\n" "Decimal('0.5625')" msgstr "" +">>> mean([1, 2, 3, 4, 4])\n" +"2.8\n" +">>> mean([-1.0, 2.5, 3.25, 5.75])\n" +"2.625\n" +"\n" +">>> from fractions import Fraction as F\n" +">>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])\n" +"Fraction(13, 21)\n" +"\n" +">>> from decimal import Decimal as D\n" +">>> mean([D(\"0.5\"), D(\"0.75\"), D(\"0.625\"), D(\"0.375\")])\n" +"Decimal('0.5625')" -msgid "The mean is strongly affected by `outliers `_ and is not necessarily a typical example of the data points. For a more robust, although less efficient, measure of `central tendency `_, see :func:`median`." -msgstr "" +msgid "" +"The mean is strongly affected by `outliers " +"`_ and is not necessarily a typical " +"example of the data points. For a more robust, although less efficient, " +"measure of `central tendency " +"`_, see :func:`median`." +msgstr "" +"میانگین به‌شدت تحت تأثیر `داده‌های پرت " +"`_ است و لزوماً نمونه‌ای معمولی از " +"نقاط داده نیست. برای سنجه‌ای مقاوم‌تر، هرچند کم‌بازده‌تر، از `گرایش مرکزی " +"`_، :func:`median` را " +"ببینید." -msgid "The sample mean gives an unbiased estimate of the true population mean, so that when taken on average over all the possible samples, ``mean(sample)`` converges on the true mean of the entire population. If *data* represents the entire population rather than a sample, then ``mean(data)`` is equivalent to calculating the true population mean μ." +msgid "" +"The sample mean gives an unbiased estimate of the true population mean, so " +"that when taken on average over all the possible samples, ``mean(sample)`` " +"converges on the true mean of the entire population. If *data* represents " +"the entire population rather than a sample, then ``mean(data)`` is " +"equivalent to calculating the true population mean μ." msgstr "" +"میانگین نمونه، برآوردی بدون تورش از میانگین واقعی جامعه ارائه می‌دهد، " +"به‌طوری‌که اگر روی تمام نمونه‌های ممکن میانگین گرفته شود، ``mean(sample)`` " +"به میانگین واقعی کل جامعه همگرا می‌شود. اگر *data* به‌جای نمونه، کل جامعه را" +" نشان دهد، آنگاه ``mean(data)`` معادل محاسبه‌ی میانگین واقعی جامعه μ است." msgid "Convert *data* to floats and compute the arithmetic mean." -msgstr "" +msgstr "*data* را به اعداد اعشاری تبدیل کنید و میانگین حسابی را محاسبه کنید." -msgid "This runs faster than the :func:`mean` function and it always returns a :class:`float`. The *data* may be a sequence or iterable. If the input dataset is empty, raises a :exc:`StatisticsError`." +msgid "" +"This runs faster than the :func:`mean` function and it always returns a " +":class:`float`. The *data* may be a sequence or iterable. If the input " +"dataset is empty, raises a :exc:`StatisticsError`." msgstr "" +"این سریع‌تر از تابع :func:`mean` اجرا می‌شود و همیشه یک :class:`float` " +"برمی‌گرداند. *data* می‌تواند دنباله یا پیمایش‌پذیر باشد. اگر داده‌های ورودی " +"خالی باشند، یک :exc:`StatisticsError` پرتاب می‌کند." msgid "" ">>> fmean([3.5, 4.0, 5.25])\n" "4.25" msgstr "" +">>> fmean([3.5, 4.0, 5.25])\n" +"4.25" -msgid "Optional weighting is supported. For example, a professor assigns a grade for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at 30%, and a final exam at 30%:" +msgid "" +"Optional weighting is supported. For example, a professor assigns a grade " +"for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at" +" 30%, and a final exam at 30%:" msgstr "" +"وزن‌دهی اختیاری پشتیبانی می‌شود. برای مثال، یک استاد با اختصاص وزن ۲۰٪ به " +"آزمون‌ها، ۲۰٪ به تکالیف، ۳۰٪ به امتحان میان‌ترم و ۳۰٪ به امتحان پایان‌ترم، " +"نمره‌ای برای یک درس تعیین می‌کند:" msgid "" ">>> grades = [85, 92, 83, 91]\n" @@ -260,87 +391,202 @@ msgid "" ">>> fmean(grades, weights)\n" "87.6" msgstr "" +">>> grades = [85, 92, 83, 91]\n" +">>> weights = [0.20, 0.20, 0.30, 0.30]\n" +">>> fmean(grades, weights)\n" +"87.6" -msgid "If *weights* is supplied, it must be the same length as the *data* or a :exc:`ValueError` will be raised." +msgid "" +"If *weights* is supplied, it must be the same length as the *data* or a " +":exc:`ValueError` will be raised." msgstr "" +"اگر *weights* ارائه شود، باید هم‌طول با *data* باشد، در غیر این صورت " +":exc:`ValueError` پرتاب می‌شود." msgid "Added support for *weights*." -msgstr "" +msgstr "پشتیبانی از *weights* افزوده شد." msgid "Convert *data* to floats and compute the geometric mean." -msgstr "" +msgstr "*data* را به اعداد اعشاری تبدیل کنید و میانگین هندسی را محاسبه کنید." -msgid "The geometric mean indicates the central tendency or typical value of the *data* using the product of the values (as opposed to the arithmetic mean which uses their sum)." +msgid "" +"The geometric mean indicates the central tendency or typical value of the " +"*data* using the product of the values (as opposed to the arithmetic mean " +"which uses their sum)." msgstr "" +"میانگین هندسی با استفاده از حاصل‌ضرب مقادیر، گرایش مرکزی یا مقدار معمول " +"*داده‌ها* را نشان می‌دهد (برخلاف میانگین حسابی که از مجموع آن‌ها استفاده " +"می‌کند)." -msgid "Raises a :exc:`StatisticsError` if the input dataset is empty, if it contains a zero, or if it contains a negative value. The *data* may be a sequence or iterable." +msgid "" +"Raises a :exc:`StatisticsError` if the input dataset is empty, if it " +"contains a zero, or if it contains a negative value. The *data* may be a " +"sequence or iterable." msgstr "" +"در صورتی که مجموعه‌داده ورودی خالی باشد، شامل صفر باشد، یا شامل مقدار منفی " +"باشد، یک :exc:`StatisticsError` پرتاب می‌کند. *data* می‌تواند یک دنباله یا " +"پیمایش‌پذیر باشد." -msgid "No special efforts are made to achieve exact results. (However, this may change in the future.)" +msgid "" +"No special efforts are made to achieve exact results. (However, this may " +"change in the future.)" msgstr "" +"تلاش خاصی برای دستیابی به نتایج دقیق انجام نمی‌شود. (البته ممکن است این " +"موضوع در آینده تغییر کند.)" msgid "" ">>> round(geometric_mean([54, 24, 36]), 1)\n" "36.0" msgstr "" +">>> round(geometric_mean([54, 24, 36]), 1)\n" +"36.0" -msgid "Return the harmonic mean of *data*, a sequence or iterable of real-valued numbers. If *weights* is omitted or ``None``, then equal weighting is assumed." +msgid "" +"Return the harmonic mean of *data*, a sequence or iterable of real-valued " +"numbers. If *weights* is omitted or ``None``, then equal weighting is " +"assumed." msgstr "" +"میانگین همساز *data* را برمی‌گرداند؛ *data* دنباله یا پیمایش‌پذیری از اعداد با" +" مقدار حقیقی است. اگر *weights* حذف شده باشد یا ``None`` باشد، وزن‌دهی یکسان" +" فرض می‌شود." -msgid "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the reciprocals of the data. For example, the harmonic mean of three values *a*, *b* and *c* will be equivalent to ``3/(1/a + 1/b + 1/c)``. If one of the values is zero, the result will be zero." +msgid "" +"The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " +"reciprocals of the data. For example, the harmonic mean of three values *a*," +" *b* and *c* will be equivalent to ``3/(1/a + 1/b + 1/c)``. If one of the " +"values is zero, the result will be zero." msgstr "" +"میانگین هارمونیک، معکوس میانگین حسابی :func:`mean` از معکوس‌های داده‌ها است." +" برای مثال، میانگین هارمونیک سه مقدار *a*، *b* و *c* معادل ``3/(1/a + 1/b + " +"1/c)`` خواهد بود. اگر یکی از مقادیر صفر باشد، نتیجه صفر خواهد بود." -msgid "The harmonic mean is a type of average, a measure of the central location of the data. It is often appropriate when averaging ratios or rates, for example speeds." +msgid "" +"The harmonic mean is a type of average, a measure of the central location of" +" the data. It is often appropriate when averaging ratios or rates, for " +"example speeds." msgstr "" +"میانگین هارمونیک نوعی میانگین است، معیاری از موقعیت مرکزی داده‌ها. این " +"میانگین اغلب هنگام میانگین‌گیری از نسبت‌ها یا نرخ‌ها، برای مثال سرعت‌ها، " +"مناسب است." -msgid "Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. What is the average speed?" +msgid "" +"Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. " +"What is the average speed?" msgstr "" +"فرض کنید خودرویی ۱۰ کیلومتر را با سرعت ۴۰ کیلومتر بر ساعت، سپس ۱۰ کیلومتر " +"دیگر را با سرعت ۶۰ کیلومتر بر ساعت طی می‌کند. سرعت متوسط چقدر است؟" msgid "" ">>> harmonic_mean([40, 60])\n" "48.0" msgstr "" +">>> harmonic_mean([40, 60])\n" +"48.0" -msgid "Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up to 60 km/hr for the remaining 30 km of the journey. What is the average speed?" +msgid "" +"Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up " +"to 60 km/hr for the remaining 30 km of the journey. What is the average " +"speed?" msgstr "" +"فرض کنید یک خودرو مسافت ۵ کیلومتر را با سرعت ۴۰ کیلومتر بر ساعت طی می‌کند و " +"هنگامی که ترافیک روان می‌شود، برای ۳۰ کیلومتر باقی‌مانده از سفر، سرعت خود را" +" به ۶۰ کیلومتر بر ساعت افزایش می‌دهد. سرعت متوسط چقدر است؟" msgid "" ">>> harmonic_mean([40, 60], weights=[5, 30])\n" "56.0" msgstr "" +">>> harmonic_mean([40, 60], weights=[5, 30])\n" +"56.0" -msgid ":exc:`StatisticsError` is raised if *data* is empty, any element is less than zero, or if the weighted sum isn't positive." +msgid "" +":exc:`StatisticsError` is raised if *data* is empty, any element is less " +"than zero, or if the weighted sum isn't positive." msgstr "" +"اگر *data* خالی باشد، هر یک از عناصر کمتر از صفر باشد، یا مجموع وزن‌دار مثبت" +" نباشد، استثنای :exc:`StatisticsError` پرتاب می‌شود." -msgid "The current algorithm has an early-out when it encounters a zero in the input. This means that the subsequent inputs are not tested for validity. (This behavior may change in the future.)" +msgid "" +"The current algorithm has an early-out when it encounters a zero in the " +"input. This means that the subsequent inputs are not tested for validity. " +"(This behavior may change in the future.)" msgstr "" +"الگوریتم فعلی هنگامی که با یک صفر در ورودی مواجه شود، یک خروج زودهنگام " +"(early-out) دارد. این بدان معناست که ورودی‌های بعدی از نظر اعتبار بررسی " +"نمی‌شوند. (این رفتار ممکن است در آینده تغییر کند.)" -msgid "`Kernel Density Estimation (KDE) `_: Create a continuous probability density function or cumulative distribution function from discrete samples." +msgid "" +"`Kernel Density Estimation (KDE) `_: " +"Create a continuous probability density function or cumulative distribution " +"function from discrete samples." msgstr "" +"`برآورد چگالی هسته‌ای (KDE) `_: " +"ایجاد یک تابع چگالی احتمال پیوسته یا تابع توزیع تجمعی از نمونه‌های گسسته." -msgid "The basic idea is to smooth the data using `a kernel function `_. to help draw inferences about a population from a sample." +msgid "" +"The basic idea is to smooth the data using `a kernel function " +"`_. to help draw " +"inferences about a population from a sample." msgstr "" +"ایده‌ی اصلی، هموارسازی داده‌ها با استفاده از `یک تابع هسته " +"`_ است تا به استنتاج " +"درباره‌ی یک جامعه از روی یک نمونه کمک کند." -msgid "The degree of smoothing is controlled by the scaling parameter *h* which is called the bandwidth. Smaller values emphasize local features while larger values give smoother results." +msgid "" +"The degree of smoothing is controlled by the scaling parameter *h* which is " +"called the bandwidth. Smaller values emphasize local features while larger " +"values give smoother results." msgstr "" +"میزان هموارسازی با پارامتر مقیاس‌دهی *h* کنترل می‌شود که پهنای باند نامیده " +"می‌شود. مقادیر کوچک‌تر ویژگی‌های محلی را برجسته می‌کنند، در حالی که مقادیر " +"بزرگ‌تر نتایج هموارتری می‌دهند." -msgid "The *kernel* determines the relative weights of the sample data points. Generally, the choice of kernel shape does not matter as much as the more influential bandwidth smoothing parameter." +msgid "" +"The *kernel* determines the relative weights of the sample data points. " +"Generally, the choice of kernel shape does not matter as much as the more " +"influential bandwidth smoothing parameter." msgstr "" +"*هسته* وزن‌های نسبی نقاط داده‌های نمونه را تعیین می‌کند. به‌طور کلی، انتخاب " +"شکل هسته به اندازه‌ی پارامتر هموارسازی پهنای باند، که تأثیرگذارتر است، اهمیت " +"ندارد." -msgid "Kernels that give some weight to every sample point include *normal* (*gauss*), *logistic*, and *sigmoid*." +msgid "" +"Kernels that give some weight to every sample point include *normal* " +"(*gauss*), *logistic*, and *sigmoid*." msgstr "" +"هسته‌هایی که به هر نقطه نمونه مقداری وزن می‌دهند، شامل *normal* (*gauss*)، " +"*logistic* و *sigmoid* هستند." -msgid "Kernels that only give weight to sample points within the bandwidth include *rectangular* (*uniform*), *triangular*, *parabolic* (*epanechnikov*), *quartic* (*biweight*), *triweight*, and *cosine*." +msgid "" +"Kernels that only give weight to sample points within the bandwidth include " +"*rectangular* (*uniform*), *triangular*, *parabolic* (*epanechnikov*), " +"*quartic* (*biweight*), *triweight*, and *cosine*." msgstr "" +"هسته‌هایی که فقط به نقاط نمونه درون پهنای باند وزن می‌دهند، شامل *مستطیلی* " +"(*یکنواخت*)، *مثلثی*، *سهمی* (*epanechnikov*)، *درجه چهارم* (*biweight*)، " +"*triweight* و *کسینوسی* هستند." -msgid "If *cumulative* is true, will return a cumulative distribution function." -msgstr "" +msgid "" +"If *cumulative* is true, will return a cumulative distribution function." +msgstr "اگر *cumulative* درست باشد، یک تابع توزیع تجمعی برمی‌گرداند." -msgid "A :exc:`StatisticsError` will be raised if the *data* sequence is empty." +msgid "" +"A :exc:`StatisticsError` will be raised if the *data* sequence is empty." msgstr "" +"اگر دنباله‌ی *data* خالی باشد، یک :exc:`StatisticsError` پرتاب می‌شود." -msgid "`Wikipedia has an example `_ where we can use :func:`kde` to generate and plot a probability density function estimated from a small sample:" +msgid "" +"`Wikipedia has an example " +"`_ where we" +" can use :func:`kde` to generate and plot a probability density function " +"estimated from a small sample:" msgstr "" +"`ویکی‌پدیا مثالی دارد " +"`_ که در آن" +" می‌توانیم از :func:`kde` برای تولید و رسم تابع چگالی احتمال برآوردشده از یک" +" نمونه کوچک استفاده کنیم:" msgid "" ">>> sample = [-2.1, -1.3, -0.4, 1.9, 5.1, 6.2]\n" @@ -348,52 +594,113 @@ msgid "" ">>> xarr = [i/100 for i in range(-750, 1100)]\n" ">>> yarr = [f_hat(x) for x in xarr]" msgstr "" +">>> sample = [-2.1, -1.3, -0.4, 1.9, 5.1, 6.2]\n" +">>> f_hat = kde(sample, h=1.5)\n" +">>> xarr = [i/100 for i in range(-750, 1100)]\n" +">>> yarr = [f_hat(x) for x in xarr]" msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" -msgstr "" +msgstr "می‌توان از نقاط ``xarr`` و ``yarr`` برای رسم نمودار PDF استفاده کرد:" msgid "Scatter plot of the estimated probability density function." -msgstr "" +msgstr "نمودار پراکندگی تابع چگالی احتمال تخمینی." -msgid "Return a function that makes a random selection from the estimated probability density function produced by ``kde(data, h, kernel)``." +msgid "" +"Return a function that makes a random selection from the estimated " +"probability density function produced by ``kde(data, h, kernel)``." msgstr "" +"تابعی را برمی‌گرداند که یک انتخاب تصادفی از تابع چگالی احتمال برآوردی که " +"توسط ``kde(data, h, kernel)`` تولید شده است، انجام می‌دهد." -msgid "Providing a *seed* allows reproducible selections. In the future, the values may change slightly as more accurate kernel inverse CDF estimates are implemented. The seed may be an integer, float, str, or bytes." +msgid "" +"Providing a *seed* allows reproducible selections. In the future, the values" +" may change slightly as more accurate kernel inverse CDF estimates are " +"implemented. The seed may be an integer, float, str, or bytes." msgstr "" +"ارائه یک *بذر* (seed) امکان انتخاب‌های قابل‌بازتولید را فراهم می‌کند. در " +"آینده، ممکن است مقادیر کمی تغییر کنند، زیرا برآردهای دقیق‌تر CDF معکوس هسته " +"(kernel inverse CDF) پیاده‌سازی می‌شوند. بذر می‌تواند یک عدد صحیح، float، " +"str یا bytes باشد." -msgid "Continuing the example for :func:`kde`, we can use :func:`kde_random` to generate new random selections from an estimated probability density function:" +msgid "" +"Continuing the example for :func:`kde`, we can use :func:`kde_random` to " +"generate new random selections from an estimated probability density " +"function:" msgstr "" +"در ادامه‌ی مثال برای :func:`kde`، می‌توانیم از :func:`kde_random` برای تولید " +"انتخاب‌های تصادفی جدید از یک تابع چگالی احتمال برآوردشده استفاده کنیم:" -msgid "Return the median (middle value) of numeric data, using the common \"mean of middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised. *data* can be a sequence or iterable." +msgid "" +"Return the median (middle value) of numeric data, using the common \"mean of" +" middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised." +" *data* can be a sequence or iterable." msgstr "" +"میانه (مقدار میانی) داده‌های عددی را با استفاده از روش رایج «میانگین دو " +"مقدار میانی» برمی‌گرداند. اگر *data* خالی باشد، :exc:`StatisticsError` پرتاب" +" می‌شود. *data* می‌تواند یک دنباله یا پیمایش‌پذیر باشد." -msgid "The median is a robust measure of central location and is less affected by the presence of outliers. When the number of data points is odd, the middle data point is returned:" +msgid "" +"The median is a robust measure of central location and is less affected by " +"the presence of outliers. When the number of data points is odd, the middle" +" data point is returned:" msgstr "" +"میانه یک معیار مقاوم برای موقعیت مرکزی است و کمتر تحت تأثیر وجود داده‌های " +"پرت قرار می‌گیرد. هنگامی که تعداد نقاط داده فرد باشد، نقطه داده میانی " +"برگردانده می‌شود:" msgid "" ">>> median([1, 3, 5])\n" "3" msgstr "" +">>> median([1, 3, 5])\n" +"3" -msgid "When the number of data points is even, the median is interpolated by taking the average of the two middle values:" +msgid "" +"When the number of data points is even, the median is interpolated by taking" +" the average of the two middle values:" msgstr "" +"هنگامی که تعداد نقاط داده زوج باشد، میانه با گرفتن میانگین دو مقدار میانی " +"درون‌یابی می‌شود:" msgid "" ">>> median([1, 3, 5, 7])\n" "4.0" msgstr "" +">>> median([1, 3, 5, 7])\n" +"4.0" -msgid "This is suited for when your data is discrete, and you don't mind that the median may not be an actual data point." +msgid "" +"This is suited for when your data is discrete, and you don't mind that the " +"median may not be an actual data point." msgstr "" +"این برای زمانی مناسب است که داده‌های شما گسسته باشند و برای شما مهم نباشد که" +" میانه ممکن است یک نقطه داده واقعی نباشد." -msgid "If the data is ordinal (supports order operations) but not numeric (doesn't support addition), consider using :func:`median_low` or :func:`median_high` instead." +msgid "" +"If the data is ordinal (supports order operations) but not numeric (doesn't " +"support addition), consider using :func:`median_low` or :func:`median_high` " +"instead." msgstr "" +"اگر داده‌ها ترتیبی باشند (از عملیات ترتیب پشتیبانی می‌کنند) اما عددی نباشند " +"(از جمع پشتیبانی نمی‌کنند)، در عوض استفاده از :func:`median_low` یا " +":func:`median_high` را در نظر بگیرید." -msgid "Return the low median of numeric data. If *data* is empty, :exc:`StatisticsError` is raised. *data* can be a sequence or iterable." +msgid "" +"Return the low median of numeric data. If *data* is empty, " +":exc:`StatisticsError` is raised. *data* can be a sequence or iterable." msgstr "" +"میانه‌ی پایین داده‌های عددی را برمی‌گرداند. اگر *data* خالی باشد، " +":exc:`StatisticsError` پرتاب می‌شود. *data* می‌تواند یک دنباله یا پیمایش‌پذیر " +"باشد." -msgid "The low median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the smaller of the two middle values is returned." +msgid "" +"The low median is always a member of the data set. When the number of data " +"points is odd, the middle value is returned. When it is even, the smaller " +"of the two middle values is returned." msgstr "" +"میانه‌ی پایین همیشه عضوی از مجموعه‌ی داده است. هرگاه تعداد نقاط داده فرد " +"باشد، مقدار میانی برگردانده می‌شود. هرگاه زوج باشد، کوچک‌تر از میان دو مقدار" +" میانی برگردانده می‌شود." msgid "" ">>> median_low([1, 3, 5])\n" @@ -401,15 +708,34 @@ msgid "" ">>> median_low([1, 3, 5, 7])\n" "3" msgstr "" +">>> median_low([1, 3, 5])\n" +"3\n" +">>> median_low([1, 3, 5, 7])\n" +"3" -msgid "Use the low median when your data are discrete and you prefer the median to be an actual data point rather than interpolated." +msgid "" +"Use the low median when your data are discrete and you prefer the median to " +"be an actual data point rather than interpolated." msgstr "" +"زمانی که داده‌های شما گسسته هستند و ترجیح می‌دهید میانه یک نقطه داده واقعی " +"باشد، نه درون‌یابی‌شده، از میانه پایین استفاده کنید." -msgid "Return the high median of data. If *data* is empty, :exc:`StatisticsError` is raised. *data* can be a sequence or iterable." +msgid "" +"Return the high median of data. If *data* is empty, :exc:`StatisticsError` " +"is raised. *data* can be a sequence or iterable." msgstr "" +"میانه بالایی داده را برمی‌گرداند. اگر *data* خالی باشد، " +":exc:`StatisticsError` پرتاب می‌شود. *data* می‌تواند یک دنباله یا پیمایش‌پذیر " +"باشد." -msgid "The high median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the larger of the two middle values is returned." +msgid "" +"The high median is always a member of the data set. When the number of data" +" points is odd, the middle value is returned. When it is even, the larger " +"of the two middle values is returned." msgstr "" +"میانه‌ی بالا همواره عضوی از مجموعه‌ی داده است. هنگامی که تعداد نقاط داده فرد" +" باشد، مقدار میانی بازگردانده می‌شود. هنگامی که زوج باشد، بزرگ‌تر از میان دو" +" مقدار میانی بازگردانده می‌شود." msgid "" ">>> median_high([1, 3, 5])\n" @@ -417,21 +743,44 @@ msgid "" ">>> median_high([1, 3, 5, 7])\n" "5" msgstr "" +">>> median_high([1, 3, 5])\n" +"3\n" +">>> median_high([1, 3, 5, 7])\n" +"5" -msgid "Use the high median when your data are discrete and you prefer the median to be an actual data point rather than interpolated." +msgid "" +"Use the high median when your data are discrete and you prefer the median to" +" be an actual data point rather than interpolated." msgstr "" +"از میانه‌ی بالا زمانی استفاده کنید که داده‌های شما گسسته هستند و ترجیح " +"می‌دهید میانه یک نقطه داده واقعی باشد، نه درون‌یابی‌شده." -msgid "Estimates the median for numeric data that has been `grouped or binned `_ around the midpoints of consecutive, fixed-width intervals." +msgid "" +"Estimates the median for numeric data that has been `grouped or binned " +"`_ around the midpoints of " +"consecutive, fixed-width intervals." msgstr "" +"میانه را برای داده‌های عددی که حول نقاط میانی بازه‌های متوالی با عرض ثابت " +"`گروه‌بندی یا سطل‌بندی (binning) " +"`_ شده‌اند، برآورد می‌کند." -msgid "The *data* can be any iterable of numeric data with each value being exactly the midpoint of a bin. At least one value must be present." +msgid "" +"The *data* can be any iterable of numeric data with each value being exactly" +" the midpoint of a bin. At least one value must be present." msgstr "" +"*data* می‌تواند هر پیمایش‌پذیری از داده‌های عددی باشد، به‌طوری‌که هر مقدار " +"دقیقاً نقطه‌ی میانی یک بازه (bin) باشد. حداقل باید یک مقدار وجود داشته باشد." msgid "The *interval* is the width of each bin." -msgstr "" +msgstr "*بازه* عرض هر سطل (bin) است." -msgid "For example, demographic information may have been summarized into consecutive ten-year age groups with each group being represented by the 5-year midpoints of the intervals:" +msgid "" +"For example, demographic information may have been summarized into " +"consecutive ten-year age groups with each group being represented by the " +"5-year midpoints of the intervals:" msgstr "" +"برای مثال، ممکن است اطلاعات جمعیت‌شناختی به گروه‌های سنی ۱۰ ساله‌ی متوالی " +"خلاصه شده باشد که هر گروه با نقاط میانی ۵ ساله‌ی بازه‌ها نمایش داده می‌شود:" msgid "" ">>> from collections import Counter\n" @@ -444,12 +793,33 @@ msgid "" "... })\n" "..." msgstr "" +">>> from collections import Counter\n" +">>> demographics = Counter({\n" +"... 25: 172, # 20 to 30 years old\n" +"... 35: 484, # 30 to 40 years old\n" +"... 45: 387, # 40 to 50 years old\n" +"... 55: 22, # 50 to 60 years old\n" +"... 65: 6, # 60 to 70 years old\n" +"... })\n" +"..." -msgid "The 50th percentile (median) is the 536th person out of the 1071 member cohort. That person is in the 30 to 40 year old age group." +msgid "" +"The 50th percentile (median) is the 536th person out of the 1071 member " +"cohort. That person is in the 30 to 40 year old age group." msgstr "" +"صدک پنجاهم (میانه) ۵۳۶امین نفر از گروه ۱۰۷۱ نفری اعضا است. آن فرد در گروه " +"سنی ۳۰ تا ۴۰ سال قرار دارد." -msgid "The regular :func:`median` function would assume that everyone in the tricenarian age group was exactly 35 years old. A more tenable assumption is that the 484 members of that age group are evenly distributed between 30 and 40. For that, we use :func:`median_grouped`:" +msgid "" +"The regular :func:`median` function would assume that everyone in the " +"tricenarian age group was exactly 35 years old. A more tenable assumption " +"is that the 484 members of that age group are evenly distributed between 30 " +"and 40. For that, we use :func:`median_grouped`:" msgstr "" +"تابع معمولی :func:`median` فرض می‌کند که همه‌ی اعضای گروه سنی دهه‌ی سی " +"دقیقاً ۳۵ سال دارند. فرض معقول‌تر این است که ۴۸۴ عضو آن گروه سنی به‌طور " +"یکنواخت بین ۳۰ و ۴۰ سال توزیع شده‌اند. برای این منظور، از " +":func:`median_grouped` استفاده می‌کنیم:" msgid "" ">>> data = list(demographics.elements())\n" @@ -458,43 +828,106 @@ msgid "" ">>> round(median_grouped(data, interval=10), 1)\n" "37.5" msgstr "" +">>> data = list(demographics.elements())\n" +">>> median(data)\n" +"35\n" +">>> round(median_grouped(data, interval=10), 1)\n" +"37.5" -msgid "The caller is responsible for making sure the data points are separated by exact multiples of *interval*. This is essential for getting a correct result. The function does not check this precondition." +msgid "" +"The caller is responsible for making sure the data points are separated by " +"exact multiples of *interval*. This is essential for getting a correct " +"result. The function does not check this precondition." msgstr "" +"فراخواننده مسئول اطمینان از این است که نقاط داده با مضارب دقیقی از " +"*interval* از هم جدا شده باشند. این امر برای به دست آوردن نتیجه‌ی صحیح ضروری " +"است. تابع این پیش‌شرایط را بررسی نمی‌کند." -msgid "Inputs may be any numeric type that can be coerced to a float during the interpolation step." +msgid "" +"Inputs may be any numeric type that can be coerced to a float during the " +"interpolation step." msgstr "" +"ورودی‌ها می‌توانند از هر نوع عددی باشند که بتوان آن را در مرحله‌ی درون‌یابی " +"به float تبدیل کرد." -msgid "Return the single most common data point from discrete or nominal *data*. The mode (when it exists) is the most typical value and serves as a measure of central location." +msgid "" +"Return the single most common data point from discrete or nominal *data*. " +"The mode (when it exists) is the most typical value and serves as a measure " +"of central location." msgstr "" +"رایج‌ترین داده‌ی منفرد را از *داده‌های* گسسته یا اسمی برمی‌گرداند. مد (در " +"صورت وجود) معمول‌ترین مقدار است و به‌عنوان معیاری برای مکان مرکزی به کار " +"می‌رود." -msgid "If there are multiple modes with the same frequency, returns the first one encountered in the *data*. If the smallest or largest of those is desired instead, use ``min(multimode(data))`` or ``max(multimode(data))``. If the input *data* is empty, :exc:`StatisticsError` is raised." +msgid "" +"If there are multiple modes with the same frequency, returns the first one " +"encountered in the *data*. If the smallest or largest of those is desired " +"instead, use ``min(multimode(data))`` or ``max(multimode(data))``. If the " +"input *data* is empty, :exc:`StatisticsError` is raised." msgstr "" +"اگر چندین مد با فراوانی یکسان وجود داشته باشد، اولین مورد مشاهده‌شده در " +"*data* را برمی‌گرداند. اگر به‌جای آن، کوچک‌ترین یا بزرگ‌ترین آن‌ها مطلوب " +"باشد، از ``min(multimode(data))`` یا ``max(multimode(data))`` استفاده کنید. " +"اگر *data* ورودی خالی باشد، :exc:`StatisticsError` پرتاب می‌شود." -msgid "``mode`` assumes discrete data and returns a single value. This is the standard treatment of the mode as commonly taught in schools:" +msgid "" +"``mode`` assumes discrete data and returns a single value. This is the " +"standard treatment of the mode as commonly taught in schools:" msgstr "" +"``mode`` فرض می‌کند که داده‌ها گسسته‌اند و یک مقدار واحد را بازمی‌گرداند. " +"این روش استاندارد برای مُد است که معمولاً در مدارس آموزش داده می‌شود:" msgid "" ">>> mode([1, 1, 2, 3, 3, 3, 3, 4])\n" "3" msgstr "" +">>> mode([1, 1, 2, 3, 3, 3, 3, 4])\n" +"3" -msgid "The mode is unique in that it is the only statistic in this package that also applies to nominal (non-numeric) data:" +msgid "" +"The mode is unique in that it is the only statistic in this package that " +"also applies to nominal (non-numeric) data:" msgstr "" +"مُد از این جهت منحصربه‌فرد است که تنها آماره‌ی این بسته است که بر داده‌های " +"اسمی (غیرعددی) نیز اعمال می‌شود:" msgid "" ">>> mode([\"red\", \"blue\", \"blue\", \"red\", \"green\", \"red\", \"red\"])\n" "'red'" msgstr "" +">>> mode([\"red\", \"blue\", \"blue\", \"red\", \"green\", \"red\", \"red\"])\n" +"'red'" -msgid "Only hashable inputs are supported. To handle type :class:`set`, consider casting to :class:`frozenset`. To handle type :class:`list`, consider casting to :class:`tuple`. For mixed or nested inputs, consider using this slower quadratic algorithm that only depends on equality tests: ``max(data, key=data.count)``." -msgstr "" +msgid "" +"Only hashable inputs are supported. To handle type :class:`set`, consider " +"casting to :class:`frozenset`. To handle type :class:`list`, consider " +"casting to :class:`tuple`. For mixed or nested inputs, consider using this " +"slower quadratic algorithm that only depends on equality tests: ``max(data, " +"key=data.count)``." +msgstr "" +"فقط ورودی‌های هش‌پذیر پشتیبانی می‌شوند. برای مدیریت نوع :class:`set`، تبدیل " +"آن به :class:`frozenset` را در نظر بگیرید. برای مدیریت نوع :class:`list`، " +"تبدیل آن به :class:`tuple` را در نظر بگیرید. برای ورودی‌های ترکیبی یا " +"تودرتو، استفاده از این الگوریتم درجه‌دوی کندتر را در نظر بگیرید که فقط به " +"آزمون‌های برابری وابسته است: ``max(data, key=data.count)``." -msgid "Now handles multimodal datasets by returning the first mode encountered. Formerly, it raised :exc:`StatisticsError` when more than one mode was found." +msgid "" +"Now handles multimodal datasets by returning the first mode encountered. " +"Formerly, it raised :exc:`StatisticsError` when more than one mode was " +"found." msgstr "" +"اکنون مجموعه‌داده‌های چندمدی را با برگرداندن نخستین مد مشاهده‌شده مدیریت " +"می‌کند. پیش‌تر، هنگامی که بیش از یک مد یافت می‌شد، :exc:`StatisticsError` را" +" پرتاب می‌کرد." -msgid "Return a list of the most frequently occurring values in the order they were first encountered in the *data*. Will return more than one result if there are multiple modes or an empty list if the *data* is empty:" +msgid "" +"Return a list of the most frequently occurring values in the order they were" +" first encountered in the *data*. Will return more than one result if there" +" are multiple modes or an empty list if the *data* is empty:" msgstr "" +"فهرستی از پرتکرارترین مقادیر را به ترتیبی که برای اولین بار در *data* دیده " +"شده‌اند برمی‌گرداند. اگر چند مد وجود داشته باشد، بیش از یک نتیجه و اگر " +"*data* خالی باشد، یک فهرست خالی برمی‌گرداند:" msgid "" ">>> multimode('aabbbbccddddeeffffgg')\n" @@ -502,47 +935,90 @@ msgid "" ">>> multimode('')\n" "[]" msgstr "" +">>> multimode('aabbbbccddddeeffffgg')\n" +"['b', 'd', 'f']\n" +">>> multimode('')\n" +"[]" -msgid "Return the population standard deviation (the square root of the population variance). See :func:`pvariance` for arguments and other details." +msgid "" +"Return the population standard deviation (the square root of the population " +"variance). See :func:`pvariance` for arguments and other details." msgstr "" +"انحراف معیار جامعه را برمی‌گرداند (ریشه دوم واریانس جامعه). برای آرگومان‌ها " +"و سایر جزئیات، :func:`pvariance` را ببینید." msgid "" ">>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" "0.986893273527251" msgstr "" +">>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" +"0.986893273527251" -msgid "Return the population variance of *data*, a non-empty sequence or iterable of real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates it is clustered closely around the mean." -msgstr "" +msgid "" +"Return the population variance of *data*, a non-empty sequence or iterable " +"of real-valued numbers. Variance, or second moment about the mean, is a " +"measure of the variability (spread or dispersion) of data. A large variance" +" indicates that the data is spread out; a small variance indicates it is " +"clustered closely around the mean." +msgstr "" +"واریانس جامعه‌ی *data*، یک دنباله یا پیمایش‌پذیر غیرخالی از اعداد با مقدار " +"حقیقی، را برمی‌گرداند. واریانس، یا گشتاور دوم حول میانگین، معیاری از " +"تغییرپذیری (گستردگی یا پراکندگی) داده‌ها است. واریانس بزرگ نشان می‌دهد که " +"داده‌ها پراکنده‌اند؛ واریانس کوچک نشان می‌دهد که داده‌ها به‌صورت فشرده‌ای " +"حول میانگین جمع شده‌اند." -msgid "If the optional second argument *mu* is given, it should be the *population* mean of the *data*. It can also be used to compute the second moment around a point that is not the mean. If it is missing or ``None`` (the default), the arithmetic mean is automatically calculated." +msgid "" +"If the optional second argument *mu* is given, it should be the *population*" +" mean of the *data*. It can also be used to compute the second moment " +"around a point that is not the mean. If it is missing or ``None`` (the " +"default), the arithmetic mean is automatically calculated." msgstr "" +"اگر آرگومان اختیاری دوم *mu* داده شود، باید میانگین *جامعه* برای *data* " +"باشد. همچنین می‌توان از آن برای محاسبه‌ی گشتاور دوم حول نقطه‌ای که میانگین " +"نیست استفاده کرد. اگر این آرگومان موجود نباشد یا ``None`` (پیش‌فرض) باشد، " +"میانگین حسابی به‌طور خودکار محاسبه می‌شود." -msgid "Use this function to calculate the variance from the entire population. To estimate the variance from a sample, the :func:`variance` function is usually a better choice." +msgid "" +"Use this function to calculate the variance from the entire population. To " +"estimate the variance from a sample, the :func:`variance` function is " +"usually a better choice." msgstr "" +"برای محاسبه‌ی واریانس کل جامعه، از این تابع استفاده کنید. برای برآورد واریانس" +" از یک نمونه، معمولاً تابع :func:`variance` انتخاب بهتری است." msgid "Raises :exc:`StatisticsError` if *data* is empty." -msgstr "" +msgstr "اگر *data* خالی باشد، :exc:`StatisticsError` پرتاب می‌شود." msgid "Examples:" -msgstr "" +msgstr "مثال‌ها:" msgid "" ">>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]\n" ">>> pvariance(data)\n" "1.25" msgstr "" +">>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]\n" +">>> pvariance(data)\n" +"1.25" -msgid "If you have already calculated the mean of your data, you can pass it as the optional second argument *mu* to avoid recalculation:" +msgid "" +"If you have already calculated the mean of your data, you can pass it as the" +" optional second argument *mu* to avoid recalculation:" msgstr "" +"اگر میانگین داده‌های خود را از پیش محاسبه کرده‌اید، می‌توانید آن را به‌عنوان" +" آرگومان اختیاری دوم *mu* ارسال کنید تا از محاسبه مجدد جلوگیری شود:" msgid "" ">>> mu = mean(data)\n" ">>> pvariance(data, mu)\n" "1.25" msgstr "" +">>> mu = mean(data)\n" +">>> pvariance(data, mu)\n" +"1.25" msgid "Decimals and Fractions are supported:" -msgstr "" +msgstr "از دسیمال‌ها و کسرها پشتیبانی می‌شود:" msgid "" ">>> from decimal import Decimal as D\n" @@ -553,53 +1029,119 @@ msgid "" ">>> pvariance([F(1, 4), F(5, 4), F(1, 2)])\n" "Fraction(13, 72)" msgstr "" +">>> from decimal import Decimal as D\n" +">>> pvariance([D(\"27.5\"), D(\"30.25\"), D(\"30.25\"), D(\"34.5\"), D(\"41.75\")])\n" +"Decimal('24.815')\n" +"\n" +">>> from fractions import Fraction as F\n" +">>> pvariance([F(1, 4), F(5, 4), F(1, 2)])\n" +"Fraction(13, 72)" -msgid "When called with the entire population, this gives the population variance σ². When called on a sample instead, this is the biased sample variance s², also known as variance with N degrees of freedom." +msgid "" +"When called with the entire population, this gives the population variance " +"σ². When called on a sample instead, this is the biased sample variance s²," +" also known as variance with N degrees of freedom." msgstr "" +"هنگامی که با کل جامعه فراخوانی شود، واریانس جامعه σ² را می‌دهد. هنگامی که " +"به‌جای آن روی یک نمونه فراخوانی شود، این واریانس نمونه‌ای سوگیردار s² است، " +"که به‌عنوان واریانس با N درجه آزادی نیز شناخته می‌شود." -msgid "If you somehow know the true population mean μ, you may use this function to calculate the variance of a sample, giving the known population mean as the second argument. Provided the data points are a random sample of the population, the result will be an unbiased estimate of the population variance." +msgid "" +"If you somehow know the true population mean μ, you may use this function to" +" calculate the variance of a sample, giving the known population mean as the" +" second argument. Provided the data points are a random sample of the " +"population, the result will be an unbiased estimate of the population " +"variance." msgstr "" +"اگر به‌نحوی میانگین واقعی جامعه μ را می‌دانید، می‌توانید از این تابع برای " +"محاسبه واریانس یک نمونه استفاده کنید و میانگین معلوم جامعه را به‌عنوان " +"آرگومان دوم بدهید. مشروط بر اینکه نقاط داده نمونه‌ای تصادفی از جامعه باشند، " +"نتیجه برآوردی بدون تورش از واریانس جامعه خواهد بود." -msgid "Return the sample standard deviation (the square root of the sample variance). See :func:`variance` for arguments and other details." +msgid "" +"Return the sample standard deviation (the square root of the sample " +"variance). See :func:`variance` for arguments and other details." msgstr "" +"بازگرداندن انحراف معیار نمونه (جذر واریانس نمونه). برای آرگومان‌ها و سایر " +"جزئیات، :func:`variance` را ببینید." msgid "" ">>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" "1.0810874155219827" msgstr "" +">>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" +"1.0810874155219827" -msgid "Return the sample variance of *data*, an iterable of at least two real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates it is clustered closely around the mean." -msgstr "" +msgid "" +"Return the sample variance of *data*, an iterable of at least two real-" +"valued numbers. Variance, or second moment about the mean, is a measure of " +"the variability (spread or dispersion) of data. A large variance indicates " +"that the data is spread out; a small variance indicates it is clustered " +"closely around the mean." +msgstr "" +"واریانس نمونه‌ی *data*، پیمایش‌پذیری از حداقل دو عدد با مقدار حقیقی، را " +"برمی‌گرداند. واریانس، یا گشتاور دوم حول میانگین، معیاری برای تغییرپذیری " +"(گستردگی یا پراکندگی) داده‌ها است. واریانس بزرگ نشان می‌دهد که داده‌ها " +"پراکنده‌اند؛ واریانس کوچک نشان می‌دهد که داده‌ها به‌طور فشرده‌ای حول میانگین" +" متمرکز شده‌اند." -msgid "If the optional second argument *xbar* is given, it should be the *sample* mean of *data*. If it is missing or ``None`` (the default), the mean is automatically calculated." +msgid "" +"If the optional second argument *xbar* is given, it should be the *sample* " +"mean of *data*. If it is missing or ``None`` (the default), the mean is " +"automatically calculated." msgstr "" +"اگر آرگومان اختیاری دوم *xbar* داده شود، باید میانگین *نمونه* از *data* " +"باشد. اگر این آرگومان داده نشود یا ``None`` باشد (پیش‌فرض)، میانگین به‌طور " +"خودکار محاسبه می‌شود." -msgid "Use this function when your data is a sample from a population. To calculate the variance from the entire population, see :func:`pvariance`." +msgid "" +"Use this function when your data is a sample from a population. To calculate" +" the variance from the entire population, see :func:`pvariance`." msgstr "" +"هرگاه داده‌های شما نمونه‌ای از یک جامعه باشند، از این تابع استفاده کنید. " +"برای محاسبه واریانس کل جامعه، :func:`pvariance` را ببینید." msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." msgstr "" +"اگر *data* کمتر از ۲ مقدار داشته باشد، :exc:`StatisticsError` پرتاب می‌شود." msgid "" ">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" ">>> variance(data)\n" "1.3720238095238095" msgstr "" +">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" +">>> variance(data)\n" +"1.3720238095238095" -msgid "If you have already calculated the sample mean of your data, you can pass it as the optional second argument *xbar* to avoid recalculation:" +msgid "" +"If you have already calculated the sample mean of your data, you can pass it" +" as the optional second argument *xbar* to avoid recalculation:" msgstr "" +"اگر میانگین نمونه داده‌های خود را از قبل محاسبه کرده‌اید، می‌توانید آن را " +"به‌عنوان آرگومان دوم اختیاری *xbar* ارسال کنید تا از محاسبه مجدد جلوگیری " +"شود:" msgid "" ">>> m = mean(data)\n" ">>> variance(data, m)\n" "1.3720238095238095" msgstr "" +">>> m = mean(data)\n" +">>> variance(data, m)\n" +"1.3720238095238095" -msgid "This function does not attempt to verify that you have passed the actual mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or impossible results." +msgid "" +"This function does not attempt to verify that you have passed the actual " +"mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or " +"impossible results." msgstr "" +"این تابع برای تأیید اینکه شما میانگین واقعی را به‌عنوان *xbar* ارسال " +"کرده‌اید، تلاشی نمی‌کند. استفاده از مقادیر دلخواه برای *xbar* می‌تواند به " +"نتایج نامعتبر یا غیرممکن منجر شود." msgid "Decimal and Fraction values are supported:" -msgstr "" +msgstr "مقادیر Decimal و Fraction پشتیبانی می‌شوند:" msgid "" ">>> from decimal import Decimal as D\n" @@ -610,33 +1152,108 @@ msgid "" ">>> variance([F(1, 6), F(1, 2), F(5, 3)])\n" "Fraction(67, 108)" msgstr "" +">>> from decimal import Decimal as D\n" +">>> variance([D(\"27.5\"), D(\"30.25\"), D(\"30.25\"), D(\"34.5\"), D(\"41.75\")])\n" +"Decimal('31.01875')\n" +"\n" +">>> from fractions import Fraction as F\n" +">>> variance([F(1, 6), F(1, 2), F(5, 3)])\n" +"Fraction(67, 108)" -msgid "This is the sample variance s² with Bessel's correction, also known as variance with N-1 degrees of freedom. Provided that the data points are representative (e.g. independent and identically distributed), the result should be an unbiased estimate of the true population variance." +msgid "" +"This is the sample variance s² with Bessel's correction, also known as " +"variance with N-1 degrees of freedom. Provided that the data points are " +"representative (e.g. independent and identically distributed), the result " +"should be an unbiased estimate of the true population variance." msgstr "" +"این واریانس نمونه‌ی s² با تصحیح بسل است که به‌عنوان واریانس با N-1 درجه آزادی" +" نیز شناخته می‌شود. مشروط بر اینکه نقاط داده معرف باشند (مثلاً مستقل و " +"هم‌توزیع)، نتیجه باید یک برآورد بدون تورش از واریانس واقعی جامعه باشد." -msgid "If you somehow know the actual population mean μ you should pass it to the :func:`pvariance` function as the *mu* parameter to get the variance of a sample." +msgid "" +"If you somehow know the actual population mean μ you should pass it to the " +":func:`pvariance` function as the *mu* parameter to get the variance of a " +"sample." msgstr "" +"اگر به‌نحوی میانگین واقعی جامعه μ را می‌دانید، باید آن را به‌عنوان پارامتر " +"*mu* به تابع :func:`pvariance` بدهید تا واریانس یک نمونه به دست آید." -msgid "Divide *data* into *n* continuous intervals with equal probability. Returns a list of ``n - 1`` cut points separating the intervals." +msgid "" +"Divide *data* into *n* continuous intervals with equal probability. Returns " +"a list of ``n - 1`` cut points separating the intervals." msgstr "" +"*data* را به *n* بازه‌ی پیوسته با احتمال برابر تقسیم می‌کند. فهرستی از ``n -" +" 1`` نقطه‌ی برش برمی‌گرداند که بازه‌ها را از هم جدا می‌کنند." -msgid "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set *n* to 100 for percentiles which gives the 99 cuts points that separate *data* into 100 equal sized groups. Raises :exc:`StatisticsError` if *n* is not least 1." +msgid "" +"Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " +"*n* to 100 for percentiles which gives the 99 cuts points that separate " +"*data* into 100 equal sized groups. Raises :exc:`StatisticsError` if *n* is" +" not least 1." msgstr "" +"*n* را برای چارک‌ها روی ۴ تنظیم کنید (پیش‌فرض). *n* را برای دهک‌ها روی ۱۰ " +"تنظیم کنید. *n* را برای صدک‌ها روی ۱۰۰ تنظیم کنید تا ۹۹ نقطه برش به دست " +"بیاید که *data* را به ۱۰۰ گروه هم‌اندازه تقسیم می‌کنند. اگر *n* حداقل ۱ " +"نباشد، :exc:`StatisticsError` پرتاب می‌شود." -msgid "The *data* can be any iterable containing sample data. For meaningful results, the number of data points in *data* should be larger than *n*. Raises :exc:`StatisticsError` if there is not at least one data point." +msgid "" +"The *data* can be any iterable containing sample data. For meaningful " +"results, the number of data points in *data* should be larger than *n*. " +"Raises :exc:`StatisticsError` if there is not at least one data point." msgstr "" +"*data* می‌تواند هر پیمایش‌پذیری شامل داده‌های نمونه باشد. برای نتایج معنادار، " +"تعداد نقاط داده در *data* باید از *n* بیشتر باشد. اگر حداقل یک نقطه داده " +"وجود نداشته باشد، :exc:`StatisticsError` پرتاب می‌شود." -msgid "The cut points are linearly interpolated from the two nearest data points. For example, if a cut point falls one-third of the distance between two sample values, ``100`` and ``112``, the cut-point will evaluate to ``104``." +msgid "" +"The cut points are linearly interpolated from the two nearest data points. " +"For example, if a cut point falls one-third of the distance between two " +"sample values, ``100`` and ``112``, the cut-point will evaluate to ``104``." msgstr "" +"نقاط برش (cut points) به‌صورت خطی از دو نقطه داده نزدیک درون‌یابی می‌شوند. " +"برای مثال، اگر یک نقطه برش در یک‌سوم فاصله بین دو مقدار نمونه ``100`` و " +"``112`` قرار بگیرد، نقطه برش به مقدار ``104`` ارزیابی می‌شود." -msgid "The *method* for computing quantiles can be varied depending on whether the *data* includes or excludes the lowest and highest possible values from the population." +msgid "" +"The *method* for computing quantiles can be varied depending on whether the " +"*data* includes or excludes the lowest and highest possible values from the " +"population." msgstr "" +"*متد* محاسبه‌ی چندک‌ها می‌تواند بسته به اینکه *داده* کمترین و بیشترین مقادیر " +"ممکن از جامعه را شامل شود یا آن‌ها را خارج کند، متفاوت باشد." -msgid "The default *method* is \"exclusive\" and is used for data sampled from a population that can have more extreme values than found in the samples. The portion of the population falling below the *i-th* of *m* sorted data points is computed as ``i / (m + 1)``. Given nine sample values, the method sorts them and assigns the following percentiles: 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%." -msgstr "" +msgid "" +"The default *method* is \"exclusive\" and is used for data sampled from a " +"population that can have more extreme values than found in the samples. The" +" portion of the population falling below the *i-th* of *m* sorted data " +"points is computed as ``i / (m + 1)``. Given nine sample values, the method" +" sorts them and assigns the following percentiles: 10%, 20%, 30%, 40%, 50%, " +"60%, 70%, 80%, 90%." +msgstr "" +"*متد* پیش‌فرض \"exclusive\" است و برای داده‌های نمونه‌گیری‌شده از یک جامعه " +"آماری استفاده می‌شود که می‌تواند مقادیری حدی‌تر از آنچه در نمونه‌ها یافت " +"می‌شود، داشته باشد. نسبت بخشی از جامعه آماری که پایین‌تر از *i-امین* نقطه از" +" *m* نقطه داده مرتب‌شده قرار می‌گیرد، به‌صورت ``i / (m + 1)`` محاسبه می‌شود." +" با داشتن نه مقدار نمونه، این متد آن‌ها را مرتب می‌کند و صدک‌های زیر را " +"اختصاص می‌دهد: ۱۰٪، ۲۰٪، ۳۰٪، ۴۰٪، ۵۰٪، ۶۰٪، ۷۰٪، ۸۰٪، ۹۰٪." -msgid "Setting the *method* to \"inclusive\" is used for describing population data or for samples that are known to include the most extreme values from the population. The minimum value in *data* is treated as the 0th percentile and the maximum value is treated as the 100th percentile. The portion of the population falling below the *i-th* of *m* sorted data points is computed as ``(i - 1) / (m - 1)``. Given 11 sample values, the method sorts them and assigns the following percentiles: 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%." -msgstr "" +msgid "" +"Setting the *method* to \"inclusive\" is used for describing population data" +" or for samples that are known to include the most extreme values from the " +"population. The minimum value in *data* is treated as the 0th percentile " +"and the maximum value is treated as the 100th percentile. The portion of the" +" population falling below the *i-th* of *m* sorted data points is computed " +"as ``(i - 1) / (m - 1)``. Given 11 sample values, the method sorts them and" +" assigns the following percentiles: 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, " +"80%, 90%, 100%." +msgstr "" +"تنظیم *method* روی \"inclusive\" برای توصیف داده‌های جامعه یا برای " +"نمونه‌هایی استفاده می‌شود که معلوم است شامل افراطی‌ترین مقادیر جامعه هستند. " +"کمترین مقدار در *data* به‌عنوان صفرمین صدک و بیشترین مقدار به‌عنوان صدمین " +"صدک در نظر گرفته می‌شود. نسبتی از جامعه که پایین‌تر از *i*-امین نقطه از *m* " +"نقطه داده مرتب‌شده قرار دارد، به‌صورت ``(i - 1) / (m - 1)`` محاسبه می‌شود. " +"با داشتن ۱۱ مقدار نمونه، این متد آن‌ها را مرتب می‌کند و صدک‌های زیر را " +"اختصاص می‌دهد: ۰٪، ۱۰٪، ۲۰٪، ۳۰٪، ۴۰٪، ۵۰٪، ۶۰٪، ۷۰٪، ۸۰٪، ۹۰٪، ۱۰۰٪." msgid "" "# Decile cut points for empirically sampled data\n" @@ -648,15 +1265,37 @@ msgid "" ">>> [round(q, 1) for q in quantiles(data, n=10)]\n" "[81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]" msgstr "" +"# Decile cut points for empirically sampled data\n" +">>> data = [105, 129, 87, 86, 111, 111, 89, 81, 108, 92, 110,\n" +"... 100, 75, 105, 103, 109, 76, 119, 99, 91, 103, 129,\n" +"... 106, 101, 84, 111, 74, 87, 86, 103, 103, 106, 86,\n" +"... 111, 75, 87, 102, 121, 111, 88, 89, 101, 106, 95,\n" +"... 103, 107, 101, 81, 109, 104]\n" +">>> [round(q, 1) for q in quantiles(data, n=10)]\n" +"[81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]" -msgid "No longer raises an exception for an input with only a single data point. This allows quantile estimates to be built up one sample point at a time becoming gradually more refined with each new data point." +msgid "" +"No longer raises an exception for an input with only a single data point. " +"This allows quantile estimates to be built up one sample point at a time " +"becoming gradually more refined with each new data point." msgstr "" +"دیگر برای ورودی‌ای با تنها یک نقطه داده، استثنایی پرتاب نمی‌کند. این امکان " +"را فراهم می‌کند که برآوردهای چندک (quantile) هر بار با یک نقطه نمونه ساخته " +"شوند و با هر نقطه داده جدید به‌تدریج دقیق‌تر شوند." -msgid "Return the sample covariance of two inputs *x* and *y*. Covariance is a measure of the joint variability of two inputs." +msgid "" +"Return the sample covariance of two inputs *x* and *y*. Covariance is a " +"measure of the joint variability of two inputs." msgstr "" +"کوواریانس نمونه دو ورودی *x* و *y* را برمی‌گرداند. کوواریانس معیاری از " +"تغییرپذیری مشترک دو ورودی است." -msgid "Both inputs must be of the same length (no less than two), otherwise :exc:`StatisticsError` is raised." +msgid "" +"Both inputs must be of the same length (no less than two), otherwise " +":exc:`StatisticsError` is raised." msgstr "" +"هر دو ورودی باید طول یکسانی داشته باشند (طولشان کمتر از ۲ نباشد)، در غیر این" +" صورت :exc:`StatisticsError` پرتاب می‌شود." msgid "" ">>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n" @@ -669,21 +1308,61 @@ msgid "" ">>> covariance(z, x)\n" "-7.5" msgstr "" +">>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> y = [1, 2, 3, 1, 2, 3, 1, 2, 3]\n" +">>> covariance(x, y)\n" +"0.75\n" +">>> z = [9, 8, 7, 6, 5, 4, 3, 2, 1]\n" +">>> covariance(x, z)\n" +"-7.5\n" +">>> covariance(z, x)\n" +"-7.5" -msgid "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation coefficient *r* takes values between -1 and +1. It measures the strength and direction of a linear relationship." +msgid "" +"Return the `Pearson's correlation coefficient " +"`_ for two " +"inputs. Pearson's correlation coefficient *r* takes values between -1 and " +"+1. It measures the strength and direction of a linear relationship." msgstr "" +"`ضریب همبستگی پیرسون " +"`_ را برای دو" +" ورودی برمی‌گرداند. ضریب همبستگی پیرسون *r* مقادیری بین -۱ و +۱ می‌گیرد. این" +" ضریب، شدت و جهت یک رابطه خطی را اندازه‌گیری می‌کند." -msgid "If *method* is \"ranked\", computes `Spearman's rank correlation coefficient `_ for two inputs. The data is replaced by ranks. Ties are averaged so that equal values receive the same rank. The resulting coefficient measures the strength of a monotonic relationship." -msgstr "" +msgid "" +"If *method* is \"ranked\", computes `Spearman's rank correlation coefficient" +" `_" +" for two inputs. The data is replaced by ranks. Ties are averaged so that " +"equal values receive the same rank. The resulting coefficient measures the " +"strength of a monotonic relationship." +msgstr "" +"اگر *method* برابر با \"ranked\" باشد، `ضریب همبستگی رتبه‌ای اسپیرمن " +"`_ " +"را برای دو ورودی محاسبه می‌کند. داده‌ها با رتبه‌ها جایگزین می‌شوند. برای " +"مقادیر برابر، میانگین رتبه‌ها گرفته می‌شود تا مقادیر مساوی رتبه یکسانی " +"دریافت کنند. ضریب حاصل، شدت رابطه‌ی یکنواخت را می‌سنجد." -msgid "Spearman's correlation coefficient is appropriate for ordinal data or for continuous data that doesn't meet the linear proportion requirement for Pearson's correlation coefficient." +msgid "" +"Spearman's correlation coefficient is appropriate for ordinal data or for " +"continuous data that doesn't meet the linear proportion requirement for " +"Pearson's correlation coefficient." msgstr "" +"ضریب همبستگی اسپیرمن برای داده‌های رتبه‌ای یا داده‌های پیوسته‌ای که شرط " +"تناسب خطی برای ضریب همبستگی پیرسون را برآورده نمی‌کنند، مناسب است." -msgid "Both inputs must be of the same length (no less than two), and need not to be constant, otherwise :exc:`StatisticsError` is raised." +msgid "" +"Both inputs must be of the same length (no less than two), and need not to " +"be constant, otherwise :exc:`StatisticsError` is raised." msgstr "" +"هر دو ورودی باید هم‌طول باشند (طولشان کمتر از ۲ نباشد) و نباید ثابت باشند؛ " +"در غیر این صورت :exc:`StatisticsError` پرتاب می‌شود." -msgid "Example with `Kepler's laws of planetary motion `_:" +msgid "" +"Example with `Kepler's laws of planetary motion " +"`_:" msgstr "" +"مثالی با `قوانین کپلر در حرکت سیارات " +"`_:" msgid "" ">>> # Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune\n" @@ -706,24 +1385,73 @@ msgid "" ">>> round(correlation(period_squared, dist_cubed), 4)\n" "1.0" msgstr "" +">>> # Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune\n" +">>> orbital_period = [88, 225, 365, 687, 4331, 10_756, 30_687, 60_190] # days\n" +">>> dist_from_sun = [58, 108, 150, 228, 778, 1_400, 2_900, 4_500] # million km\n" +"\n" +">>> # Show that a perfect monotonic relationship exists\n" +">>> correlation(orbital_period, dist_from_sun, method='ranked')\n" +"1.0\n" +"\n" +">>> # Observe that a linear relationship is imperfect\n" +">>> round(correlation(orbital_period, dist_from_sun), 4)\n" +"0.9882\n" +"\n" +">>> # Demonstrate Kepler's third law: There is a linear correlation\n" +">>> # between the square of the orbital period and the cube of the\n" +">>> # distance from the sun.\n" +">>> period_squared = [p * p for p in orbital_period]\n" +">>> dist_cubed = [d * d * d for d in dist_from_sun]\n" +">>> round(correlation(period_squared, dist_cubed), 4)\n" +"1.0" msgid "Added support for Spearman's rank correlation coefficient." -msgstr "" +msgstr "پشتیبانی از ضریب همبستگی رتبه‌ای اسپیرمن افزوده شد." -msgid "Return the slope and intercept of `simple linear regression `_ parameters estimated using ordinary least squares. Simple linear regression describes the relationship between an independent variable *x* and a dependent variable *y* in terms of this linear function:" +msgid "" +"Return the slope and intercept of `simple linear regression " +"`_ parameters " +"estimated using ordinary least squares. Simple linear regression describes " +"the relationship between an independent variable *x* and a dependent " +"variable *y* in terms of this linear function:" msgstr "" +"شیب و عرض از مبدأ پارامترهای `رگرسیون خطی ساده " +"`_ برآوردشده با روش" +" کمترین مربعات معمولی را برمی‌گرداند. رگرسیون خطی ساده رابطه بین یک متغیر " +"مستقل *x* و یک متغیر وابسته *y* را در قالب این تابع خطی توصیف می‌کند:" msgid "*y = slope \\* x + intercept + noise*" -msgstr "" +msgstr "*y = slope \\* x + intercept + noise*" -msgid "where ``slope`` and ``intercept`` are the regression parameters that are estimated, and ``noise`` represents the variability of the data that was not explained by the linear regression (it is equal to the difference between predicted and actual values of the dependent variable)." +msgid "" +"where ``slope`` and ``intercept`` are the regression parameters that are " +"estimated, and ``noise`` represents the variability of the data that was not" +" explained by the linear regression (it is equal to the difference between " +"predicted and actual values of the dependent variable)." msgstr "" +"که در آن ``slope`` و ``intercept`` پارامترهای رگرسیون هستند که برآورد " +"می‌شوند، و ``noise`` تغییرپذیری داده‌ها را که توسط رگرسیون خطی تبیین نشده " +"است نشان می‌دهد (این مقدار برابر با تفاوت بین مقادیر پیش‌بینی‌شده و واقعی " +"متغیر وابسته است)." -msgid "Both inputs must be of the same length (no less than two), and the independent variable *x* cannot be constant; otherwise a :exc:`StatisticsError` is raised." +msgid "" +"Both inputs must be of the same length (no less than two), and the " +"independent variable *x* cannot be constant; otherwise a " +":exc:`StatisticsError` is raised." msgstr "" +"هر دو ورودی باید طول یکسانی داشته باشند (حداقل ۲)، و متغیر مستقل *x* " +"نمی‌تواند ثابت باشد؛ در غیر این صورت :exc:`StatisticsError` پرتاب می‌شود." -msgid "For example, we can use the `release dates of the Monty Python films `_ to predict the cumulative number of Monty Python films that would have been produced by 2019 assuming that they had kept the pace." +msgid "" +"For example, we can use the `release dates of the Monty Python films " +"`_ to predict the " +"cumulative number of Monty Python films that would have been produced by " +"2019 assuming that they had kept the pace." msgstr "" +"برای مثال، می‌توانیم از `تاریخ‌های انتشار فیلم‌های مانتی پایتون " +"`_ برای پیش‌بینی تعداد " +"تجمعی فیلم‌های مانتی پایتون که با فرض حفظ آهنگ تولید، تا سال ۲۰۱۹ تولید شده " +"بودند، استفاده کنیم." msgid "" ">>> year = [1971, 1975, 1979, 1982, 1983]\n" @@ -732,15 +1460,34 @@ msgid "" ">>> round(slope * 2019 + intercept)\n" "16" msgstr "" +">>> year = [1971, 1975, 1979, 1982, 1983]\n" +">>> films_total = [1, 2, 3, 4, 5]\n" +">>> slope, intercept = linear_regression(year, films_total)\n" +">>> round(slope * 2019 + intercept)\n" +"16" -msgid "If *proportional* is true, the independent variable *x* and the dependent variable *y* are assumed to be directly proportional. The data is fit to a line passing through the origin. Since the *intercept* will always be 0.0, the underlying linear function simplifies to:" +msgid "" +"If *proportional* is true, the independent variable *x* and the dependent " +"variable *y* are assumed to be directly proportional. The data is fit to a " +"line passing through the origin. Since the *intercept* will always be 0.0, " +"the underlying linear function simplifies to:" msgstr "" +"اگر *proportional* درست باشد، فرض می‌شود که متغیر مستقل *x* و متغیر وابسته " +"*y* با یکدیگر نسبت مستقیم دارند. داده‌ها به خطی که از مبدأ می‌گذرد برازش " +"داده می‌شوند. از آن‌جا که *intercept* همواره برابر 0.0 خواهد بود، تابع خطی " +"زیربنایی به‌صورت زیر ساده می‌شود:" msgid "*y = slope \\* x + noise*" -msgstr "" +msgstr "*y = شیب \\* x + نویز*" -msgid "Continuing the example from :func:`correlation`, we look to see how well a model based on major planets can predict the orbital distances for dwarf planets:" +msgid "" +"Continuing the example from :func:`correlation`, we look to see how well a " +"model based on major planets can predict the orbital distances for dwarf " +"planets:" msgstr "" +"در ادامه‌ی مثال :func:`correlation`، بررسی می‌کنیم که مدلی مبتنی بر " +"سیاره‌های بزرگ تا چه اندازه می‌تواند فاصله‌های مداری سیاره‌های کوتوله را " +"پیش‌بینی کند:" msgid "" ">>> model = linear_regression(period_squared, dist_cubed, proportional=True)\n" @@ -755,105 +1502,273 @@ msgid "" ">>> [5_906, 10_152, 6_796, 6_450, 414] # actual distance in million km\n" "[5906, 10152, 6796, 6450, 414]" msgstr "" +">>> model = linear_regression(period_squared, dist_cubed, proportional=True)\n" +">>> slope = model.slope\n" +"\n" +">>> # Dwarf planets: Pluto, Eris, Makemake, Haumea, Ceres\n" +">>> orbital_periods = [90_560, 204_199, 111_845, 103_410, 1_680] # days\n" +">>> predicted_dist = [math.cbrt(slope * (p * p)) for p in orbital_periods]\n" +">>> list(map(round, predicted_dist))\n" +"[5912, 10166, 6806, 6459, 414]\n" +"\n" +">>> [5_906, 10_152, 6_796, 6_450, 414] # actual distance in million km\n" +"[5906, 10152, 6796, 6450, 414]" msgid "Added support for *proportional*." -msgstr "" +msgstr "پشتیبانی از *proportional* افزوده شد." msgid "Exceptions" -msgstr "" +msgstr "استثناها" msgid "A single exception is defined:" -msgstr "" +msgstr "تنها یک استثنا تعریف شده است:" msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." -msgstr "" +msgstr "زیرکلاسی از :exc:`ValueError` برای استثناهای مرتبط با آمار." msgid ":class:`NormalDist` objects" -msgstr "" +msgstr "اشیای :class:`NormalDist`" -msgid ":class:`NormalDist` is a tool for creating and manipulating normal distributions of a `random variable `_. It is a class that treats the mean and standard deviation of data measurements as a single entity." +msgid "" +":class:`NormalDist` is a tool for creating and manipulating normal " +"distributions of a `random variable " +"`_. It is a class " +"that treats the mean and standard deviation of data measurements as a single" +" entity." msgstr "" +":class:`NormalDist` ابزاری برای ایجاد و دستکاری توزیع‌های نرمال یک `متغیر " +"تصادفی `_ است. این" +" یک کلاس است که میانگین و انحراف معیار اندازه‌گیری‌های داده را به‌عنوان یک " +"موجودیت واحد در نظر می‌گیرد." -msgid "Normal distributions arise from the `Central Limit Theorem `_ and have a wide range of applications in statistics." +msgid "" +"Normal distributions arise from the `Central Limit Theorem " +"`_ and have a wide " +"range of applications in statistics." msgstr "" +"توزیع‌های نرمال از `قضیه حد مرکزی " +"`_ ناشی می‌شوند و " +"کاربردهای گسترده‌ای در آمار دارند." -msgid "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean `_ and *sigma* represents the `standard deviation `_." +msgid "" +"Returns a new *NormalDist* object where *mu* represents the `arithmetic mean" +" `_ and *sigma* represents " +"the `standard deviation " +"`_." msgstr "" +"یک شیء *NormalDist* جدید برمی‌گرداند که در آن *mu* نشان‌دهنده‌ی `میانگین " +"حسابی `_ و *sigma* " +"نشان‌دهنده‌ی `انحراف معیار " +"`_ است." msgid "If *sigma* is negative, raises :exc:`StatisticsError`." -msgstr "" +msgstr "اگر *sigma* منفی باشد، :exc:`StatisticsError` پرتاب می‌شود." -msgid "A read-only property for the `arithmetic mean `_ of a normal distribution." +msgid "" +"A read-only property for the `arithmetic mean " +"`_ of a normal distribution." msgstr "" +"یک ویژگی فقط‌خواندنی برای `میانگین حسابی " +"`_ یک توزیع نرمال." -msgid "A read-only property for the `median `_ of a normal distribution." +msgid "" +"A read-only property for the `median " +"`_ of a normal distribution." msgstr "" +"یک پراپرتی فقط‌خواندنی برای `میانه `_ " +"در یک توزیع نرمال." -msgid "A read-only property for the `mode `_ of a normal distribution." +msgid "" +"A read-only property for the `mode " +"`_ of a normal " +"distribution." msgstr "" +"یک ویژگی فقط‌خواندنی برای `مد " +"`_ توزیع نرمال." -msgid "A read-only property for the `standard deviation `_ of a normal distribution." +msgid "" +"A read-only property for the `standard deviation " +"`_ of a normal " +"distribution." msgstr "" +"ویژگی فقط‌خواندنی برای `انحراف معیار " +"`_ توزیع نرمال." -msgid "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard deviation." +msgid "" +"A read-only property for the `variance " +"`_ of a normal distribution. Equal " +"to the square of the standard deviation." msgstr "" +"ویژگی فقط‌خواندنی برای `واریانس `_ " +"یک توزیع نرمال. برابر با مربع انحراف معیار است." -msgid "Makes a normal distribution instance with *mu* and *sigma* parameters estimated from the *data* using :func:`fmean` and :func:`stdev`." +msgid "" +"Makes a normal distribution instance with *mu* and *sigma* parameters " +"estimated from the *data* using :func:`fmean` and :func:`stdev`." msgstr "" +"یک نمونه توزیع نرمال می‌سازد که پارامترهای *mu* و *sigma* آن از *data* با " +"استفاده از :func:`fmean` و :func:`stdev` برآورد شده‌اند." -msgid "The *data* can be any :term:`iterable` and should consist of values that can be converted to type :class:`float`. If *data* does not contain at least two elements, raises :exc:`StatisticsError` because it takes at least one point to estimate a central value and at least two points to estimate dispersion." +msgid "" +"The *data* can be any :term:`iterable` and should consist of values that can" +" be converted to type :class:`float`. If *data* does not contain at least " +"two elements, raises :exc:`StatisticsError` because it takes at least one " +"point to estimate a central value and at least two points to estimate " +"dispersion." msgstr "" +"*data* می‌تواند هر :term:`پیمایش‌پذیر ` باشد و باید شامل مقادیری باشد که بتوان آن‌ها را به نوع :class:`float` تبدیل کرد. اگر *data* شامل حداقل دو عنصر نباشد، :exc:`StatisticsError` پرتاب می‌شود؛ زیرا برای برآورد مقدار مرکزی حداقل به یک نقطه و برای برآورد پراکندگی حداقل به دو نقطه نیاز است." -msgid "Generates *n* random samples for a given mean and standard deviation. Returns a :class:`list` of :class:`float` values." +msgid "" +"Generates *n* random samples for a given mean and standard deviation. " +"Returns a :class:`list` of :class:`float` values." msgstr "" +"*n* نمونه تصادفی برای میانگین و انحراف معیار داده‌شده تولید می‌کند. یک " +":class:`list` از مقادیر :class:`float` را برمی‌گرداند." -msgid "If *seed* is given, creates a new instance of the underlying random number generator. This is useful for creating reproducible results, even in a multi-threading context." +msgid "" +"If *seed* is given, creates a new instance of the underlying random number " +"generator. This is useful for creating reproducible results, even in a " +"multi-threading context." msgstr "" +"اگر *seed* داده شود، نمونه‌ای جدید از تولیدگر اعداد تصادفی زیربنایی ایجاد " +"می‌شود. این برای ایجاد نتایج قابل بازتولید، حتی در یک زمینه‌ی چندنخی، مفید " +"است." -msgid "Switched to a faster algorithm. To reproduce samples from previous versions, use :func:`random.seed` and :func:`random.gauss`." +msgid "" +"Switched to a faster algorithm. To reproduce samples from previous " +"versions, use :func:`random.seed` and :func:`random.gauss`." msgstr "" +"به یک الگوریتم سریع‌تر تغییر یافت. برای تولید مجدد نمونه‌ها از نسخه‌های " +"پیشین، از :func:`random.seed` و :func:`random.gauss` استفاده کنید." -msgid "Using a `probability density function (pdf) `_, compute the relative likelihood that a random variable *X* will be near the given value *x*. Mathematically, it is the limit of the ratio ``P(x <= X < x+dx) / dx`` as *dx* approaches zero." -msgstr "" +msgid "" +"Using a `probability density function (pdf) " +"`_, compute the " +"relative likelihood that a random variable *X* will be near the given value " +"*x*. Mathematically, it is the limit of the ratio ``P(x <= X < x+dx) / dx``" +" as *dx* approaches zero." +msgstr "" +"با استفاده از `تابع چگالی احتمال (pdf) " +"`_، احتمال نسبی " +"اینکه یک متغیر تصادفی *X* در نزدیکی مقدار داده‌شده *x* باشد را محاسبه کنید. " +"از نظر ریاضی، این حد نسبت ``P(x <= X < x+dx) / dx`` است، وقتی که *dx* به صفر" +" میل می‌کند." -msgid "The relative likelihood is computed as the probability of a sample occurring in a narrow range divided by the width of the range (hence the word \"density\"). Since the likelihood is relative to other points, its value can be greater than ``1.0``." +msgid "" +"The relative likelihood is computed as the probability of a sample occurring" +" in a narrow range divided by the width of the range (hence the word " +"\"density\"). Since the likelihood is relative to other points, its value " +"can be greater than ``1.0``." msgstr "" +"درست‌نمایی نسبی به‌صورت احتمال وقوع یک نمونه در یک بازه‌ی باریک تقسیم بر " +"پهنای آن بازه محاسبه می‌شود (از این رو واژه‌ی «چگالی»). از آنجا که درست‌نمایی" +" نسبت به سایر نقاط نسبی است، مقدار آن می‌تواند بزرگ‌تر از ``1.0`` باشد." -msgid "Using a `cumulative distribution function (cdf) `_, compute the probability that a random variable *X* will be less than or equal to *x*. Mathematically, it is written ``P(X <= x)``." +msgid "" +"Using a `cumulative distribution function (cdf) " +"`_, compute " +"the probability that a random variable *X* will be less than or equal to " +"*x*. Mathematically, it is written ``P(X <= x)``." msgstr "" +"با استفاده از `تابع توزیع تجمعی (cdf) " +"`_، احتمال " +"اینکه متغیر تصادفی *X* کوچک‌تر یا مساوی *x* باشد را محاسبه کنید. از نظر " +"ریاضی، به‌صورت ``P(X <= x)`` نوشته می‌شود." -msgid "Compute the inverse cumulative distribution function, also known as the `quantile function `_ or the `percent-point `_ function. Mathematically, it is written ``x : P(X <= x) = p``." -msgstr "" +msgid "" +"Compute the inverse cumulative distribution function, also known as the " +"`quantile function `_ or " +"the `percent-point " +"`_ function. Mathematically, it is written ``x : P(X" +" <= x) = p``." +msgstr "" +"محاسبه‌ی تابع توزیع تجمعی معکوس، که به‌عنوان `تابع چارک " +"`_ یا `تابع نقطه‌درصدی " +"`_ نیز شناخته می‌شود. از نظر ریاضی، به‌صورت ``x : P(X" +" <= x) = p`` نوشته می‌شود." -msgid "Finds the value *x* of the random variable *X* such that the probability of the variable being less than or equal to that value equals the given probability *p*." +msgid "" +"Finds the value *x* of the random variable *X* such that the probability of " +"the variable being less than or equal to that value equals the given " +"probability *p*." msgstr "" +"مقدار *x* از متغیر تصادفی *X* را می‌یابد، به‌طوری که احتمال اینکه متغیر " +"کوچک‌تر یا مساوی آن مقدار باشد، برابر با احتمال داده‌شده *p* است." -msgid "Measures the agreement between two normal probability distributions. Returns a value between 0.0 and 1.0 giving `the overlapping area for the two probability density functions `_." +msgid "" +"Measures the agreement between two normal probability distributions. Returns" +" a value between 0.0 and 1.0 giving `the overlapping area for the two " +"probability density functions `_." msgstr "" +"میزان انطباق بین دو توزیع احتمال نرمال را اندازه‌گیری می‌کند. مقداری بین ۰٫۰" +" و ۱٫۰ برمی‌گرداند که `مساحت هم‌پوشانی دو تابع چگالی احتمال " +"`_ را نشان می‌دهد." -msgid "Divide the normal distribution into *n* continuous intervals with equal probability. Returns a list of (n - 1) cut points separating the intervals." +msgid "" +"Divide the normal distribution into *n* continuous intervals with equal " +"probability. Returns a list of (n - 1) cut points separating the intervals." msgstr "" +"توزیع نرمال را به *n* بازه‌ی پیوسته با احتمال برابر تقسیم می‌کند. فهرستی از " +"(n - 1) نقطه‌ی برش را برمی‌گرداند که بازه‌ها را از هم جدا می‌کنند." -msgid "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set *n* to 100 for percentiles which gives the 99 cuts points that separate the normal distribution into 100 equal sized groups." +msgid "" +"Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " +"*n* to 100 for percentiles which gives the 99 cuts points that separate the " +"normal distribution into 100 equal sized groups." msgstr "" +"*n* را برای چارک‌ها روی ۴ تنظیم کنید (پیش‌فرض). *n* را برای دهک‌ها روی ۱۰ " +"تنظیم کنید. *n* را برای صدک‌ها روی ۱۰۰ تنظیم کنید تا ۹۹ نقطه برش به دست آید " +"که توزیع نرمال را به ۱۰۰ گروه هم‌اندازه تقسیم می‌کنند." -msgid "Compute the `Standard Score `_ describing *x* in terms of the number of standard deviations above or below the mean of the normal distribution: ``(x - mean) / stdev``." +msgid "" +"Compute the `Standard Score `_ describing *x* in terms of the number of standard" +" deviations above or below the mean of the normal distribution: ``(x - mean)" +" / stdev``." msgstr "" +"`نمره استاندارد `_ را که *x* را بر حسب تعداد انحراف‌های معیار بالاتر یا " +"پایین‌تر از میانگین توزیع نرمال توصیف می‌کند، محاسبه کنید: ``(x - mean) / " +"stdev``." -msgid "Instances of :class:`NormalDist` support addition, subtraction, multiplication and division by a constant. These operations are used for translation and scaling. For example:" +msgid "" +"Instances of :class:`NormalDist` support addition, subtraction, " +"multiplication and division by a constant. These operations are used for " +"translation and scaling. For example:" msgstr "" +"نمونه‌های :class:`NormalDist` از جمع، تفریق، ضرب و تقسیم بر یک ثابت پشتیبانی" +" می‌کنند. این عملیات برای انتقال و مقیاس‌دهی استفاده می‌شوند. برای مثال:" msgid "" ">>> temperature_february = NormalDist(5, 2.5) # Celsius\n" ">>> temperature_february * (9/5) + 32 # Fahrenheit\n" "NormalDist(mu=41.0, sigma=4.5)" msgstr "" +">>> temperature_february = NormalDist(5, 2.5) # Celsius\n" +">>> temperature_february * (9/5) + 32 # Fahrenheit\n" +"NormalDist(mu=41.0, sigma=4.5)" -msgid "Dividing a constant by an instance of :class:`NormalDist` is not supported because the result wouldn't be normally distributed." +msgid "" +"Dividing a constant by an instance of :class:`NormalDist` is not supported " +"because the result wouldn't be normally distributed." msgstr "" +"تقسیم یک ثابت بر نمونه‌ای از :class:`NormalDist` پشتیبانی نمی‌شود، زیرا " +"نتیجه توزیع نرمال نخواهد داشت." -msgid "Since normal distributions arise from additive effects of independent variables, it is possible to `add and subtract two independent normally distributed random variables `_ represented as instances of :class:`NormalDist`. For example:" -msgstr "" +msgid "" +"Since normal distributions arise from additive effects of independent " +"variables, it is possible to `add and subtract two independent normally " +"distributed random variables " +"`_" +" represented as instances of :class:`NormalDist`. For example:" +msgstr "" +"از آنجا که توزیع‌های نرمال از اثرات افزایشی متغیرهای مستقل ناشی می‌شوند، " +"می‌توان `جمع و تفریق دو متغیر تصادفی مستقل با توزیع نرمال " +"`_" +" را که به‌صورت نمونه‌هایی از :class:`NormalDist` نمایش داده شده‌اند، انجام " +"داد. برای مثال:" msgid "" ">>> birth_weights = NormalDist.from_samples([2.5, 3.1, 2.1, 2.4, 2.7, 3.5])\n" @@ -864,18 +1779,35 @@ msgid "" ">>> round(combined.stdev, 1)\n" "0.5" msgstr "" +">>> birth_weights = NormalDist.from_samples([2.5, 3.1, 2.1, 2.4, 2.7, 3.5])\n" +">>> drug_effects = NormalDist(0.4, 0.15)\n" +">>> combined = birth_weights + drug_effects\n" +">>> round(combined.mean, 1)\n" +"3.1\n" +">>> round(combined.stdev, 1)\n" +"0.5" msgid "Examples and Recipes" -msgstr "" +msgstr "مثال‌ها و دستور پخت‌ها" msgid "Classic probability problems" -msgstr "" +msgstr "مسائل کلاسیک احتمال" msgid ":class:`NormalDist` readily solves classic probability problems." -msgstr "" +msgstr ":class:`NormalDist` به‌سادگی مسائل کلاسیک احتمال را حل می‌کند." -msgid "For example, given `historical data for SAT exams `_ showing that scores are normally distributed with a mean of 1060 and a standard deviation of 195, determine the percentage of students with test scores between 1100 and 1200, after rounding to the nearest whole number:" -msgstr "" +msgid "" +"For example, given `historical data for SAT exams " +"`_ showing " +"that scores are normally distributed with a mean of 1060 and a standard " +"deviation of 195, determine the percentage of students with test scores " +"between 1100 and 1200, after rounding to the nearest whole number:" +msgstr "" +"برای مثال، با توجه به `داده‌های تاریخی آزمون‌های SAT " +"`_ که نشان " +"می‌دهد نمرات به‌طور نرمال با میانگین ۱۰۶۰ و انحراف معیار ۱۹۵ توزیع شده‌اند، " +"درصد دانش‌آموزانی را که نمره‌ی آزمون آن‌ها بین ۱۱۰۰ و ۱۲۰۰ است، پس از گرد " +"کردن به نزدیک‌ترین عدد صحیح تعیین کنید:" msgid "" ">>> sat = NormalDist(1060, 195)\n" @@ -883,9 +1815,17 @@ msgid "" ">>> round(fraction * 100.0, 1)\n" "18.4" msgstr "" +">>> sat = NormalDist(1060, 195)\n" +">>> fraction = sat.cdf(1200 + 0.5) - sat.cdf(1100 - 0.5)\n" +">>> round(fraction * 100.0, 1)\n" +"18.4" -msgid "Find the `quartiles `_ and `deciles `_ for the SAT scores:" +msgid "" +"Find the `quartiles `_ and `deciles " +"`_ for the SAT scores:" msgstr "" +"`چارک‌ها `_ و `دهک‌ها " +"`_ را برای نمرات SAT بیابید:" msgid "" ">>> list(map(round, sat.quantiles()))\n" @@ -893,12 +1833,22 @@ msgid "" ">>> list(map(round, sat.quantiles(n=10)))\n" "[810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310]" msgstr "" +">>> list(map(round, sat.quantiles()))\n" +"[928, 1060, 1192]\n" +">>> list(map(round, sat.quantiles(n=10)))\n" +"[810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310]" msgid "Monte Carlo inputs for simulations" -msgstr "" +msgstr "ورودی‌های مونت‌کارلو برای شبیه‌سازی‌ها" -msgid "To estimate the distribution for a model that isn't easy to solve analytically, :class:`NormalDist` can generate input samples for a `Monte Carlo simulation `_:" +msgid "" +"To estimate the distribution for a model that isn't easy to solve " +"analytically, :class:`NormalDist` can generate input samples for a `Monte " +"Carlo simulation `_:" msgstr "" +"برای برآورد توزیع مدلی که حل آن به‌صورت تحلیلی آسان نیست، " +":class:`NormalDist` می‌تواند نمونه‌های ورودی برای یک `شبیه‌سازی مونت‌کارلو " +"`_ تولید کند:" msgid "" ">>> def model(x, y, z):\n" @@ -911,15 +1861,40 @@ msgid "" ">>> quantiles(map(model, X, Y, Z))\n" "[1.4591308524824727, 1.8035946855390597, 2.175091447274739]" msgstr "" +">>> def model(x, y, z):\n" +"... return (3*x + 7*x*y - 5*y) / (11 * z)\n" +"...\n" +">>> n = 100_000\n" +">>> X = NormalDist(10, 2.5).samples(n, seed=3652260728)\n" +">>> Y = NormalDist(15, 1.75).samples(n, seed=4582495471)\n" +">>> Z = NormalDist(50, 1.25).samples(n, seed=6582483453)\n" +">>> quantiles(map(model, X, Y, Z))\n" +"[1.4591308524824727, 1.8035946855390597, 2.175091447274739]" msgid "Approximating binomial distributions" -msgstr "" +msgstr "تقریب توزیع‌های دوجمله‌ای" -msgid "Normal distributions can be used to approximate `Binomial distributions `_ when the sample size is large and when the probability of a successful trial is near 50%." +msgid "" +"Normal distributions can be used to approximate `Binomial distributions " +"`_ when the sample " +"size is large and when the probability of a successful trial is near 50%." msgstr "" +"وقتی اندازه نمونه بزرگ باشد و احتمال موفقیت یک آزمایش نزدیک به ۵۰٪ باشد، " +"می‌توان از توزیع‌های نرمال برای تقریب `توزیع‌های دوجمله‌ای " +"`_ استفاده کرد." -msgid "For example, an open source conference has 750 attendees and two rooms with a 500 person capacity. There is a talk about Python and another about Ruby. In previous conferences, 65% of the attendees preferred to listen to Python talks. Assuming the population preferences haven't changed, what is the probability that the Python room will stay within its capacity limits?" -msgstr "" +msgid "" +"For example, an open source conference has 750 attendees and two rooms with " +"a 500 person capacity. There is a talk about Python and another about Ruby." +" In previous conferences, 65% of the attendees preferred to listen to Python" +" talks. Assuming the population preferences haven't changed, what is the " +"probability that the Python room will stay within its capacity limits?" +msgstr "" +"برای مثال، یک همایش متن‌باز ۷۵۰ شرکت‌کننده و دو اتاق با ظرفیت ۵۰۰ نفری دارد." +" یک سخنرانی درباره پایتون و یک سخنرانی دیگر درباره روبی وجود دارد. در " +"همایش‌های قبلی، ۶۵٪ شرکت‌کنندگان ترجیح می‌دادند به سخنرانی‌های پایتون گوش " +"دهند. با فرض اینکه ترجیحات جامعه تغییر نکرده باشد، احتمال اینکه اتاق پایتون " +"در محدوده ظرفیت خود باقی بماند، چقدر است؟" msgid "" ">>> n = 750 # Sample size\n" @@ -943,18 +1918,52 @@ msgid "" ">>> mean(binomialvariate(n, p) <= k for i in range(10_000))\n" "0.8406" msgstr "" +">>> n = 750 # Sample size\n" +">>> p = 0.65 # Preference for Python\n" +">>> q = 1.0 - p # Preference for Ruby\n" +">>> k = 500 # Room capacity\n" +"\n" +">>> # Approximation using the cumulative normal distribution\n" +">>> from math import sqrt\n" +">>> round(NormalDist(mu=n*p, sigma=sqrt(n*p*q)).cdf(k + 0.5), 4)\n" +"0.8402\n" +"\n" +">>> # Exact solution using the cumulative binomial distribution\n" +">>> from math import comb, fsum\n" +">>> round(fsum(comb(n, r) * p**r * q**(n-r) for r in range(k+1)), 4)\n" +"0.8402\n" +"\n" +">>> # Approximation using a simulation\n" +">>> from random import seed, binomialvariate\n" +">>> seed(8675309)\n" +">>> mean(binomialvariate(n, p) <= k for i in range(10_000))\n" +"0.8406" msgid "Naive bayesian classifier" -msgstr "" +msgstr "طبقه‌بند بیزی ساده" msgid "Normal distributions commonly arise in machine learning problems." -msgstr "" +msgstr "توزیع‌های نرمال معمولاً در مسائل یادگیری ماشین پدید می‌آیند." -msgid "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The challenge is to predict a person's gender from measurements of normally distributed features including height, weight, and foot size." +msgid "" +"Wikipedia has a `nice example of a Naive Bayesian Classifier " +"`_." +" The challenge is to predict a person's gender from measurements of normally" +" distributed features including height, weight, and foot size." msgstr "" +"ویکی‌پدیا `مثال خوبی از یک دسته‌بند بیزی ساده " +"`_" +" دارد. چالش این است که جنسیت یک فرد از روی اندازه‌گیری‌های ویژگی‌هایی با " +"توزیع نرمال، شامل قد، وزن و اندازه‌ی پا، پیش‌بینی شود." -msgid "We're given a training dataset with measurements for eight people. The measurements are assumed to be normally distributed, so we summarize the data with :class:`NormalDist`:" +msgid "" +"We're given a training dataset with measurements for eight people. The " +"measurements are assumed to be normally distributed, so we summarize the " +"data with :class:`NormalDist`:" msgstr "" +"یک مجموعه‌داده آموزشی شامل اندازه‌گیری‌های ۸ نفر به ما داده شده است. فرض " +"می‌شود که اندازه‌گیری‌ها دارای توزیع نرمال باشند، بنابراین داده‌ها را با " +":class:`NormalDist` خلاصه می‌کنیم:" msgid "" ">>> height_male = NormalDist.from_samples([6, 5.92, 5.58, 5.92])\n" @@ -964,18 +1973,38 @@ msgid "" ">>> foot_size_male = NormalDist.from_samples([12, 11, 12, 10])\n" ">>> foot_size_female = NormalDist.from_samples([6, 8, 7, 9])" msgstr "" +">>> height_male = NormalDist.from_samples([6, 5.92, 5.58, 5.92])\n" +">>> height_female = NormalDist.from_samples([5, 5.5, 5.42, 5.75])\n" +">>> weight_male = NormalDist.from_samples([180, 190, 170, 165])\n" +">>> weight_female = NormalDist.from_samples([100, 150, 130, 150])\n" +">>> foot_size_male = NormalDist.from_samples([12, 11, 12, 10])\n" +">>> foot_size_female = NormalDist.from_samples([6, 8, 7, 9])" -msgid "Next, we encounter a new person whose feature measurements are known but whose gender is unknown:" +msgid "" +"Next, we encounter a new person whose feature measurements are known but " +"whose gender is unknown:" msgstr "" +"سپس، با فرد جدیدی مواجه می‌شویم که اندازه‌گیری‌های ویژگی او معلوم است، اما " +"جنسیت او نامعلوم است:" msgid "" ">>> ht = 6.0 # height\n" ">>> wt = 130 # weight\n" ">>> fs = 8 # foot size" msgstr "" +">>> ht = 6.0 # height\n" +">>> wt = 130 # weight\n" +">>> fs = 8 # foot size" -msgid "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as the prior times the product of likelihoods for the feature measurements given the gender:" +msgid "" +"Starting with a 50% `prior probability " +"`_ of being male or female," +" we compute the posterior as the prior times the product of likelihoods for " +"the feature measurements given the gender:" msgstr "" +"با شروع از `احتمال پیشین `_" +" ۵۰٪ برای مرد یا زن بودن، احتمال پسین را به‌صورت احتمال پیشین ضرب‌در " +"حاصل‌ضرب درست‌نمایی‌های اندازه‌گیری‌های ویژگی به شرط جنسیت محاسبه می‌کنیم:" msgid "" ">>> prior_male = 0.5\n" @@ -986,11 +2015,27 @@ msgid "" ">>> posterior_female = (prior_female * height_female.pdf(ht) *\n" "... weight_female.pdf(wt) * foot_size_female.pdf(fs))" msgstr "" +">>> prior_male = 0.5\n" +">>> prior_female = 0.5\n" +">>> posterior_male = (prior_male * height_male.pdf(ht) *\n" +"... weight_male.pdf(wt) * foot_size_male.pdf(fs))\n" +"\n" +">>> posterior_female = (prior_female * height_female.pdf(ht) *\n" +"... weight_female.pdf(wt) * foot_size_female.pdf(fs))" -msgid "The final prediction goes to the largest posterior. This is known as the `maximum a posteriori `_ or MAP:" +msgid "" +"The final prediction goes to the largest posterior. This is known as the " +"`maximum a posteriori " +"`_ or MAP:" msgstr "" +"پیش‌بینی نهایی به بیشترین احتمال پسین اختصاص می‌یابد. این به‌عنوان `بیشینه " +"احتمال پسین " +"`_ یا MAP " +"شناخته می‌شود:" msgid "" ">>> 'male' if posterior_male > posterior_female else 'female'\n" "'female'" msgstr "" +">>> 'male' if posterior_male > posterior_female else 'female'\n" +"'female'" diff --git a/library/stdtypes.po b/library/stdtypes.po index 1ef7c0494..fa1c2e3e5 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" +"PO-Revision-Date: 2026-08-28 11:22+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,467 +22,699 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid "Built-in Types" -msgstr "" +msgstr "انواع توکار" -msgid "The following sections describe the standard types that are built into the interpreter." -msgstr "" +msgid "" +"The following sections describe the standard types that are built into the interpreter." +msgstr "بخش‌های زیر انواع استانداردی را که به‌صورت توکار در مفسر وجود دارند، توصیف می‌کنند." -msgid "The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions." +msgid "" +"The principal built-in types are numerics, sequences, mappings, classes, instances and " +"exceptions." msgstr "" +"انواع توکار اصلی عبارت‌اند از: اعداد، دنباله‌ها، نگاشت‌ها، کلاس‌ها، نمونه‌ها و استثناها." -msgid "Some collection classes are mutable. The methods that add, subtract, or rearrange their members in place, and don't return a specific item, never return the collection instance itself but ``None``." +msgid "" +"Some collection classes are mutable. The methods that add, subtract, or rearrange " +"their members in place, and don't return a specific item, never return the collection " +"instance itself but ``None``." msgstr "" +"برخی از کلاس‌های مجموعه تغییرپذیر هستند. متدهایی که اعضای آن‌ها را درجا اضافه، حذف یا " +"بازآرایی می‌کنند و آیتم مشخصی را برنمی‌گردانند، هرگز خودِ نمونه‌ی مجموعه را برنمی‌گردانند، " +"بلکه ``None`` را برمی‌گردانند." -msgid "Some operations are supported by several object types; in particular, practically all objects can be compared for equality, tested for truth value, and converted to a string (with the :func:`repr` function or the slightly different :func:`str` function). The latter function is implicitly used when an object is written by the :func:`print` function." +msgid "" +"Some operations are supported by several object types; in particular, practically all " +"objects can be compared for equality, tested for truth value, and converted to a " +"string (with the :func:`repr` function or the slightly different :func:`str` " +"function). The latter function is implicitly used when an object is written by " +"the :func:`print` function." msgstr "" +"برخی عملیات توسط چندین نوع شیء پشتیبانی می‌شوند؛ به‌طور خاص، تقریباً همه‌ی اشیاء را می‌توان " +"از نظر برابری مقایسه کرد، مقدار درستی آن‌ها را بررسی کرد و به یک رشته تبدیل کرد (با " +"تابع :func:`repr` یا تابع :func:`str` که اندکی متفاوت است). تابع دوم به‌طور ضمنی زمانی " +"استفاده می‌شود که شیءای توسط تابع :func:`print` نوشته می‌شود." msgid "Truth Value Testing" -msgstr "" +msgstr "آزمودن ارزش درستی" -msgid "Any object can be tested for truth value, for use in an :keyword:`if` or :keyword:`while` condition or as operand of the Boolean operations below." +msgid "" +"Any object can be tested for truth value, for use in an :keyword:`if` " +"or :keyword:`while` condition or as operand of the Boolean operations below." msgstr "" +"هر شیء را می‌توان از نظر مقدار درستی آزمود، برای استفاده در شرط :keyword:`if` " +"یا :keyword:`while` یا به‌عنوان عملوند عملیات‌های بولی زیر." -msgid "By default, an object is considered true unless its class defines either a :meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object.__len__` method that returns zero, when called with the object. [1]_ If one of the methods raises an exception when called, the exception is propagated and the object does not have a truth value (for example, :data:`NotImplemented`). Here are most of the built-in objects considered false:" +msgid "" +"By default, an object is considered true unless its class defines either " +"a :meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object.__len__` " +"method that returns zero, when called with the object. [1]_ If one of the methods " +"raises an exception when called, the exception is propagated and the object does not " +"have a truth value (for example, :data:`NotImplemented`). Here are most of the built-" +"in objects considered false:" msgstr "" +"به‌طور پیش‌فرض، یک شیء درست در نظر گرفته می‌شود مگر اینکه کلاس آن متدی از " +"نوع :meth:`~object.__bool__` تعریف کرده باشد که هنگام فراخوانی با آن شیء ``False`` " +"برگرداند، یا متدی از نوع :meth:`~object.__len__` که صفر برگرداند. [1]_ اگر یکی از این " +"متدها هنگام فراخوانی استثنایی را پرتاب کند، آن استثنا منتشر می‌شود و شیء مقدار صحتی " +"نخواهد داشت (برای مثال، :data:`NotImplemented`). در ادامه بیشتر اشیای توکاری که نادرست " +"در نظر گرفته می‌شوند آمده‌اند:" msgid "constants defined to be false: ``None`` and ``False``" -msgstr "" +msgstr "ثابت‌هایی که نادرست تعریف شده‌اند: ``None`` و ``False``" -msgid "zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, ``Fraction(0, 1)``" -msgstr "" +msgid "" +"zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, ``Fraction(0, 1)``" +msgstr "صفر از هر نوع عددی: ``0``، ``0.0``، ``0j``، ``Decimal(0)``، ``Fraction(0, 1)``" -msgid "empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, ``range(0)``" +msgid "" +"empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, " +"``range(0)``" msgstr "" +"دنباله‌ها و مجموعه‌های خالی: ``''``, ``()``, ``[]``, ``{}``, ``set()``, ``range(0)``" -msgid "Operations and built-in functions that have a Boolean result always return ``0`` or ``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. (Important exception: the Boolean operations ``or`` and ``and`` always return one of their operands.)" +msgid "" +"Operations and built-in functions that have a Boolean result always return ``0`` or " +"``False`` for false and ``1`` or ``True`` for true, unless otherwise stated. " +"(Important exception: the Boolean operations ``or`` and ``and`` always return one of " +"their operands.)" msgstr "" +"عملیات‌ها و توابع توکاری که نتیجه بولی دارند، همیشه برای نادرست ``0`` یا ``False`` و " +"برای درست ``1`` یا ``True`` برمی‌گردانند، مگر اینکه خلاف آن ذکر شده باشد. (استثنای مهم: " +"عملیات بولی ``or`` و ``and`` همیشه یکی از عملوندهای خود را برمی‌گردانند.)" msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -msgstr "" +msgstr "عملیات بولی --- :keyword:`!and`، :keyword:`!or`، :keyword:`!not`" msgid "These are the Boolean operations, ordered by ascending priority:" -msgstr "" +msgstr "این‌ها عملیات‌های بولی هستند که به ترتیب اولویت صعودی مرتب شده‌اند:" msgid "Operation" -msgstr "" +msgstr "عملیات" msgid "Result" -msgstr "" +msgstr "نتیجه" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "``x or y``" -msgstr "" +msgstr "``x or y``" msgid "if *x* is true, then *x*, else *y*" -msgstr "" +msgstr "اگر *x* درست باشد، آنگاه *x*، وگرنه *y*" msgid "\\(1)" -msgstr "" +msgstr "\\(1)" msgid "``x and y``" -msgstr "" +msgstr "``x and y``" msgid "if *x* is false, then *x*, else *y*" -msgstr "" +msgstr "اگر *x* نادرست باشد، آنگاه *x*، وگرنه *y*" msgid "\\(2)" -msgstr "" +msgstr "\\(2)" msgid "``not x``" -msgstr "" +msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" -msgstr "" +msgstr "اگر *x* نادرست باشد، آنگاه ``True``، در غیر این صورت ``False``" msgid "\\(3)" -msgstr "" +msgstr "\\(3)" msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" -msgid "This is a short-circuit operator, so it only evaluates the second argument if the first one is false." +msgid "" +"This is a short-circuit operator, so it only evaluates the second argument if the " +"first one is false." msgstr "" +"این یک عملگر اتصال کوتاه است؛ بنابراین تنها در صورتی آرگومان دوم را ارزیابی می‌کند که " +"آرگومان اول نادرست باشد." -msgid "This is a short-circuit operator, so it only evaluates the second argument if the first one is true." +msgid "" +"This is a short-circuit operator, so it only evaluates the second argument if the " +"first one is true." msgstr "" +"این یک عملگر اتصال کوتاه است، بنابراین تنها در صورتی آرگومان دوم را ارزیابی می‌کند که " +"آرگومان اول درست باشد." -msgid "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." +msgid "" +"``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is " +"interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." msgstr "" +"``not`` اولویت کمتری نسبت به عملگرهای غیربولی دارد، بنابراین ``not a == b`` به صورت " +"``not (a == b)`` تفسیر می‌شود و ``a == not b`` یک خطای سینتکس است." msgid "Comparisons" -msgstr "" +msgstr "مقایسه‌ها" -msgid "There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained arbitrarily; for example, ``x < y <= z`` is equivalent to ``x < y and y <= z``, except that *y* is evaluated only once (but in both cases *z* is not evaluated at all when ``x < y`` is found to be false)." +msgid "" +"There are eight comparison operations in Python. They all have the same priority " +"(which is higher than that of the Boolean operations). Comparisons can be chained " +"arbitrarily; for example, ``x < y <= z`` is equivalent to ``x < y and y <= z``, except " +"that *y* is evaluated only once (but in both cases *z* is not evaluated at all when " +"``x < y`` is found to be false)." msgstr "" +"در پایتون هشت عملیات مقایسه وجود دارد. همگی آن‌ها اولویت یکسانی دارند (که بالاتر از " +"اولویت عملیات بولی است). مقایسه‌ها را می‌توان به‌طور دلخواه زنجیره‌ای کرد؛ برای مثال، ``x " +"< y <= z`` معادل ``x < y and y <= z`` است، با این تفاوت که *y* فقط یک بار ارزیابی " +"می‌شود (اما در هر دو حالت، وقتی مشخص شود که ``x < y`` نادرست است، *z* اصلاً ارزیابی " +"نمی‌شود)." msgid "This table summarizes the comparison operations:" -msgstr "" +msgstr "این جدول عملیات مقایسه را خلاصه می‌کند:" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``<``" -msgstr "" +msgstr "``<``" msgid "strictly less than" -msgstr "" +msgstr "کاملاً کمتر از" msgid "``<=``" -msgstr "" +msgstr "``<=``" msgid "less than or equal" -msgstr "" +msgstr "کوچک‌تر یا مساوی" msgid "``>``" -msgstr "" +msgstr "``>``" msgid "strictly greater than" -msgstr "" +msgstr "اکیداً بزرگ‌تر از" msgid "``>=``" -msgstr "" +msgstr "``>=``" msgid "greater than or equal" -msgstr "" +msgstr "بزرگ‌تر یا مساوی" msgid "``==``" -msgstr "" +msgstr "``==``" msgid "equal" -msgstr "" +msgstr "برابر" msgid "``!=``" -msgstr "" +msgstr "``!=``" msgid "not equal" -msgstr "" +msgstr "نامساوی" msgid "``is``" -msgstr "" +msgstr "``is``" msgid "object identity" -msgstr "" +msgstr "هویت شیء" msgid "``is not``" -msgstr "" +msgstr "``is not``" msgid "negated object identity" -msgstr "" +msgstr "نقیض هویت شیء" -msgid "Unless stated otherwise, objects of different types never compare equal. The ``==`` operator is always defined but for some object types (for example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where they make sense; for example, they raise a :exc:`TypeError` exception when one of the arguments is a complex number." +msgid "" +"Unless stated otherwise, objects of different types never compare equal. The ``==`` " +"operator is always defined but for some object types (for example, class objects) is " +"equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only " +"defined where they make sense; for example, they raise a :exc:`TypeError` exception " +"when one of the arguments is a complex number." msgstr "" +"مگر اینکه خلاف آن ذکر شده باشد، اشیاء از انواع مختلف هرگز برابر مقایسه نمی‌شوند. عملگر " +"``==`` همیشه تعریف شده است اما برای برخی انواع شیء (برای مثال، اشیاء کلاس) " +"معادل :keyword:`is` است. عملگرهای ``<``، ``<=``، ``>`` و ``>=`` فقط در مواردی تعریف " +"شده‌اند که معنا داشته باشند؛ برای مثال، وقتی یکی از آرگومان‌ها یک عدد مختلط باشد، " +"استثنای :exc:`TypeError` را پرتاب می‌کنند." -msgid "Non-identical instances of a class normally compare as non-equal unless the class defines the :meth:`~object.__eq__` method." +msgid "" +"Non-identical instances of a class normally compare as non-equal unless the class " +"defines the :meth:`~object.__eq__` method." msgstr "" +"نمونه‌های غیریکسان یک کلاس معمولاً به‌صورت نابرابر مقایسه می‌شوند، مگر اینکه کلاس " +"متد :meth:`~object.__eq__` را تعریف کرده باشد." -msgid "Instances of a class cannot be ordered with respect to other instances of the same class, or other types of object, unless the class defines enough of the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` and :meth:`~object.__eq__` are sufficient, if you want the conventional meanings of the comparison operators)." +msgid "" +"Instances of a class cannot be ordered with respect to other instances of the same " +"class, or other types of object, unless the class defines enough of the " +"methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " +"and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` " +"and :meth:`~object.__eq__` are sufficient, if you want the conventional meanings of " +"the comparison operators)." msgstr "" +"نمونه‌های یک کلاس را نمی‌توان نسبت به سایر نمونه‌های همان کلاس یا انواع دیگری از اشیاء " +"مرتب کرد، مگر اینکه کلاس تعداد کافی از " +"متدهای :meth:`~object.__lt__`، :meth:`~object.__le__`، :meth:`~object.__gt__` " +"و :meth:`~object.__ge__` را تعریف کند (به طور کلی، اگر معانی مرسوم عملگرهای مقایسه را " +"می‌خواهید، :meth:`~object.__lt__` و :meth:`~object.__eq__` کافی هستند)." -msgid "The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be customized; also they can be applied to any two objects and never raise an exception." +msgid "" +"The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be " +"customized; also they can be applied to any two objects and never raise an exception." msgstr "" +"رفتار عملگرهای :keyword:`is` و :keyword:`is not` قابل سفارشی‌سازی نیست؛ همچنین می‌توان " +"این عملگرها را روی هر دو شیء دلخواه اعمال کرد و هرگز استثنایی پرتاب نمی‌کنند." -msgid "Two more operations with the same syntactic priority, :keyword:`in` and :keyword:`not in`, are supported by types that are :term:`iterable` or implement the :meth:`~object.__contains__` method." +msgid "" +"Two more operations with the same syntactic priority, :keyword:`in` and :keyword:`not " +"in`, are supported by types that are :term:`iterable` or implement " +"the :meth:`~object.__contains__` method." msgstr "" +"دو عملیات دیگر با اولویت نحوی یکسان، :keyword:`in` و :keyword:`not in`، توسط نوع‌هایی " +"پشتیبانی می‌شوند که :term:`پیمایش‌پذیر ` هستند یا " +"متد :meth:`~object.__contains__` را پیاده‌سازی می‌کنند." msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" -msgstr "" - -msgid "There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of integers. Integers have unlimited precision. Floating-point numbers are usually implemented using :c:expr:`double` in C; information about the precision and internal representation of floating-point numbers for the machine on which your program is running is available in :data:`sys.float_info`. Complex numbers have a real and imaginary part, which are each a floating-point number. To extract these parts from a complex number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the additional numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)" -msgstr "" - -msgid "Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including hex, octal and binary numbers) yield integers. Numeric literals containing a decimal point or an exponent sign yield floating-point numbers. Appending ``'j'`` or ``'J'`` to a numeric literal yields an imaginary number (a complex number with a zero real part) which you can add to an integer or float to get a complex number with real and imaginary parts." -msgstr "" - -msgid "The constructors :func:`int`, :func:`float`, and :func:`complex` can be used to produce numbers of a specific type." -msgstr "" - -msgid "Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different built-in numeric types, the operand with the \"narrower\" type is widened to that of the other:" -msgstr "" +msgstr "انواع عددی --- :class:`int`، :class:`float`، :class:`complex`" + +msgid "" +"There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-point " +"numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of " +"integers. Integers have unlimited precision. Floating-point numbers are usually " +"implemented using :c:expr:`double` in C; information about the precision and internal " +"representation of floating-point numbers for the machine on which your program is " +"running is available in :data:`sys.float_info`. Complex numbers have a real and " +"imaginary part, which are each a floating-point number. To extract these parts from a " +"complex number *z*, use ``z.real`` and ``z.imag``. (The standard library includes the " +"additional numeric types :mod:`fractions.Fraction`, for rationals, " +"and :mod:`decimal.Decimal`, for floating-point numbers with user-definable precision.)" +msgstr "" +"سه نوع عددی متمایز وجود دارد: :dfn:`عددهای صحیح `، :dfn:`عددهای ممیز شناور " +"` و :dfn:`عددهای مختلط `. علاوه بر این، " +"بولی‌ها زیرنوعی از عددهای صحیح هستند. عددهای صحیح دقتی نامحدود دارند. عددهای ممیز شناور " +"معمولاً با استفاده از :c:expr:`double` در C پیاده‌سازی می‌شوند؛ اطلاعات مربوط به دقت و " +"نمایش درونی عددهای ممیز شناور برای ماشینی که برنامه شما روی آن اجرا می‌شود، " +"در :data:`sys.float_info` موجود است. عددهای مختلط دارای بخش حقیقی و بخش موهومی هستند " +"که هر یک از آن‌ها یک عدد ممیز شناور است. برای استخراج این بخش‌ها از یک عدد مختلط *z*، از " +"``z.real`` و ``z.imag`` استفاده کنید. (کتابخانه استاندارد همچنین شامل نوع‌های عددی " +"دیگری است: :mod:`fractions.Fraction` برای اعداد گویا و :mod:`decimal.Decimal` برای " +"عددهای ممیز شناور با دقت قابل تعریف توسط کاربر.)" + +msgid "" +"Numbers are created by numeric literals or as the result of built-in functions and " +"operators. Unadorned integer literals (including hex, octal and binary numbers) yield " +"integers. Numeric literals containing a decimal point or an exponent sign yield " +"floating-point numbers. Appending ``'j'`` or ``'J'`` to a numeric literal yields an " +"imaginary number (a complex number with a zero real part) which you can add to an " +"integer or float to get a complex number with real and imaginary parts." +msgstr "" +"اعداد با مقادیر لفظی عددی یا به‌عنوان نتیجه‌ی توابع توکار و عملگرها ساخته می‌شوند. مقادیر لفظی " +"عدد صحیح ساده (از جمله اعداد مبنای شانزده، مبنای هشت و مبنای دو) اعداد صحیح تولید " +"می‌کنند. مقادیر لفظی عددی حاوی ممیز اعشار یا علامت توان، اعداد ممیز شناور تولید می‌کنند. " +"افزودن ``'j'`` یا ``'J'`` به انتهای یک لفظی عددی، یک عدد موهومی (یک عدد مختلط با بخش " +"حقیقی صفر) ایجاد می‌کند که می‌توانید آن را به یک عدد صحیح یا ممیز شناور اضافه کنید تا " +"عدد مختلطی با بخش‌های حقیقی و موهومی به دست آورید." + +msgid "" +"The constructors :func:`int`, :func:`float`, and :func:`complex` can be used to " +"produce numbers of a specific type." +msgstr "" +"سازنده‌های :func:`int`، :func:`float` و :func:`complex` می‌توانند برای تولید اعدادی از " +"یک نوع مشخص به کار روند." + +msgid "" +"Python fully supports mixed arithmetic: when a binary arithmetic operator has operands " +"of different built-in numeric types, the operand with the \"narrower\" type is widened " +"to that of the other:" +msgstr "" +"پایتون به‌طور کامل از حساب ترکیبی پشتیبانی می‌کند: هنگامی که یک عملگر حسابی دودویی " +"عملوندهایی از انواع عددی توکار متفاوت داشته باشد، عملوندی که نوع «باریک‌تری» دارد به " +"نوع عملوند دیگر گسترش می‌یابد:" msgid "If both arguments are complex numbers, no conversion is performed;" -msgstr "" +msgstr "اگر هر دو آرگومان عدد مختلط باشند، هیچ تبدیلی انجام نمی‌شود؛" -msgid "if either argument is a complex or a floating-point number, the other is converted to a floating-point number;" +msgid "" +"if either argument is a complex or a floating-point number, the other is converted to " +"a floating-point number;" msgstr "" +"اگر هر یک از آرگومان‌ها عددی مختلط یا ممیز شناور باشد، دیگری به عدد ممیز شناور تبدیل " +"می‌شود؛" msgid "otherwise, both must be integers and no conversion is necessary." -msgstr "" +msgstr "در غیر این صورت، هر دو باید عدد صحیح باشند و هیچ تبدیلی لازم نیست." -msgid "Arithmetic with complex and real operands is defined by the usual mathematical formula, for example::" +msgid "" +"Arithmetic with complex and real operands is defined by the usual mathematical " +"formula, for example::" msgstr "" +"محاسبات با عملوندهای مختلط و حقیقی بر اساس فرمول ریاضی معمول تعریف می‌شود، برای مثال::" msgid "" "x + complex(u, v) = complex(x + u, v)\n" "x * complex(u, v) = complex(x * u, x * v)" msgstr "" +"x + complex(u, v) = complex(x + u, v)\n" +"x * complex(u, v) = complex(x * u, x * v)" -msgid "A comparison between numbers of different types behaves as though the exact values of those numbers were being compared. [2]_" +msgid "" +"A comparison between numbers of different types behaves as though the exact values of " +"those numbers were being compared. [2]_" msgstr "" +"مقایسه میان اعداد از انواع مختلف چنان رفتار می‌کند که گویی مقادیر دقیق آن اعداد در حال " +"مقایسه هستند. [2]_" -msgid "All numeric types (except complex) support the following operations (for priorities of the operations, see :ref:`operator-summary`):" +msgid "" +"All numeric types (except complex) support the following operations (for priorities of " +"the operations, see :ref:`operator-summary`):" msgstr "" +"همه انواع عددی (به جز مختلط) از عملیات زیر پشتیبانی می‌کنند (برای اولویت‌های این عملیات، " +"به :ref:`operator-summary` مراجعه کنید):" msgid "Full documentation" -msgstr "" +msgstr "مستندات کامل" msgid "``x + y``" -msgstr "" +msgstr "``x + y``" msgid "sum of *x* and *y*" -msgstr "" +msgstr "مجموع *x* و *y*" msgid "``x - y``" -msgstr "" +msgstr "``x - y``" msgid "difference of *x* and *y*" -msgstr "" +msgstr "تفاضل *x* و *y*" msgid "``x * y``" -msgstr "" +msgstr "``x * y``" msgid "product of *x* and *y*" -msgstr "" +msgstr "حاصل‌ضرب *x* و *y*" msgid "``x / y``" -msgstr "" +msgstr "``x / y``" msgid "quotient of *x* and *y*" -msgstr "" +msgstr "خارج قسمت *x* و *y*" msgid "``x // y``" -msgstr "" +msgstr "``x // y``" msgid "floored quotient of *x* and *y*" -msgstr "" +msgstr "خارج‌قسمت کف‌شده‌ی *x* و *y*" msgid "\\(1)\\(2)" -msgstr "" +msgstr "\\(1)\\(2)" msgid "``x % y``" -msgstr "" +msgstr "``x % y``" msgid "remainder of ``x / y``" -msgstr "" +msgstr "باقیمانده‌ی ``x / y``" msgid "``-x``" -msgstr "" +msgstr "``-x``" msgid "*x* negated" -msgstr "" +msgstr "*x* منفی‌شده" msgid "``+x``" -msgstr "" +msgstr "``+x``" msgid "*x* unchanged" -msgstr "" +msgstr "*x* بدون تغییر" msgid "``abs(x)``" -msgstr "" +msgstr "``abs(x)``" msgid "absolute value or magnitude of *x*" -msgstr "" +msgstr "قدر مطلق یا اندازه‌ی *x*" msgid ":func:`abs`" -msgstr "" +msgstr ":func:`abs`" msgid "``int(x)``" -msgstr "" +msgstr "``int(x)``" msgid "*x* converted to integer" -msgstr "" +msgstr "*x* تبدیل‌شده به عدد صحیح" msgid "\\(3)\\(6)" -msgstr "" +msgstr "\\(3)\\(6)" msgid ":func:`int`" -msgstr "" +msgstr ":func:`int`" msgid "``float(x)``" -msgstr "" +msgstr "``float(x)``" msgid "*x* converted to floating point" -msgstr "" +msgstr "*x* تبدیل‌شده به ممیز شناور" msgid "\\(4)\\(6)" -msgstr "" +msgstr "\\(4)\\(6)" msgid ":func:`float`" -msgstr "" +msgstr ":func:`float`" msgid "``complex(re, im)``" -msgstr "" +msgstr "``complex(re, im)``" msgid "a complex number with real part *re*, imaginary part *im*. *im* defaults to zero." -msgstr "" +msgstr "عدد مختلطی با بخش حقیقی *re* و بخش موهومی *im*. مقدار پیش‌فرض *im* صفر است." msgid "\\(6)" -msgstr "" +msgstr "\\(6)" msgid ":func:`complex`" -msgstr "" +msgstr ":func:`complex`" msgid "``c.conjugate()``" -msgstr "" +msgstr "``c.conjugate()``" msgid "conjugate of the complex number *c*" -msgstr "" +msgstr "مزدوج عدد مختلط *c*" msgid "``divmod(x, y)``" -msgstr "" +msgstr "``divmod(x, y)``" msgid "the pair ``(x // y, x % y)``" -msgstr "" +msgstr "جفت ``(x // y, x % y)``" msgid ":func:`divmod`" -msgstr "" +msgstr ":func:`divmod`" msgid "``pow(x, y)``" -msgstr "" +msgstr "``pow(x, y)``" msgid "*x* to the power *y*" -msgstr "" +msgstr "*x* به توان *y*" msgid "\\(5)" -msgstr "" +msgstr "\\(5)" msgid ":func:`pow`" -msgstr "" +msgstr ":func:`pow`" msgid "``x ** y``" -msgstr "" +msgstr "``x ** y``" -msgid "Also referred to as integer division. For operands of type :class:`int`, the result has type :class:`int`. For operands of type :class:`float`, the result has type :class:`float`. In general, the result is a whole integer, though the result's type is not necessarily :class:`int`. The result is always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." +msgid "" +"Also referred to as integer division. For operands of type :class:`int`, the result " +"has type :class:`int`. For operands of type :class:`float`, the result has " +"type :class:`float`. In general, the result is a whole integer, though the result's " +"type is not necessarily :class:`int`. The result is always rounded towards minus " +"infinity: ``1//2`` is ``0``, ``(-1)//2`` is ``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//" +"(-2)`` is ``0``." msgstr "" +"همچنین به آن تقسیم عدد صحیح نیز گفته می‌شود. برای عملوندهایی از نوع :class:`int`، " +"نتیجه از نوع :class:`int` است. برای عملوندهایی از نوع :class:`float`، نتیجه از " +"نوع :class:`float` است. در حالت کلی، نتیجه یک عدد صحیح کامل است، هرچند نوع نتیجه " +"لزوماً :class:`int` نیست. نتیجه همیشه به سمت منفی بی‌نهایت گرد می‌شود: ``1//2`` برابر با " +"``0`` است، ``(-1)//2`` برابر با ``-1`` است، ``1//(-2)`` برابر با ``-1`` است و ``(-1)//" +"(-2)`` برابر با ``0`` است." -msgid "Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate." +msgid "" +"Not for complex numbers. Instead convert to floats using :func:`abs` if appropriate." msgstr "" +"برای اعداد مختلط کاربرد ندارد. در عوض، در صورت مناسب بودن، با استفاده از :func:`abs` " +"آن‌ها را به اعداد اعشاری تبدیل کنید." -msgid "Conversion from :class:`float` to :class:`int` truncates, discarding the fractional part. See functions :func:`math.floor` and :func:`math.ceil` for alternative conversions." +msgid "" +"Conversion from :class:`float` to :class:`int` truncates, discarding the fractional " +"part. See functions :func:`math.floor` and :func:`math.ceil` for alternative " +"conversions." msgstr "" +"تبدیل از :class:`float` به :class:`int` به روش قطع انجام می‌شود و بخش اعشاری را حذف " +"می‌کند. برای تبدیل‌های جایگزین، توابع :func:`math.floor` و :func:`math.ceil` را ببینید." -msgid "float also accepts the strings \"nan\" and \"inf\" with an optional prefix \"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." +msgid "" +"float also accepts the strings \"nan\" and \"inf\" with an optional prefix \"+\" or \"-" +"\" for Not a Number (NaN) and positive or negative infinity." msgstr "" +"float همچنین رشته‌های \"nan\" و \"inf\" را با پیشوند اختیاری \"+\" یا \"-\" برای عدد " +"نیست (NaN) و بی‌نهایت مثبت یا منفی می‌پذیرد." -msgid "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming languages." +msgid "" +"Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for programming " +"languages." msgstr "" +"پایتون ``pow(0, 0)`` و ``0 ** 0`` را برابر با ``1`` تعریف می‌کند، همان‌گونه که در " +"زبان‌های برنامه‌نویسی رایج است." -msgid "The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode equivalent (code points with the ``Nd`` property)." +msgid "" +"The numeric literals accepted include the digits ``0`` to ``9`` or any Unicode " +"equivalent (code points with the ``Nd`` property)." msgstr "" +"مقادیر لفظی عددی (numeric literals) پذیرفته‌شده شامل رقم‌های ``0`` تا ``9`` یا هر معادل " +"یونیکدی آن‌ها هستند (نقطه‌های کد (code points) دارای ویژگی ``Nd``)." -msgid "See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` property." +msgid "" +"See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` property." msgstr "" +"برای فهرست کامل نقطه‌های کد دارای ویژگی ``Nd`` به `استاندارد یونیکد `_ مراجعه کنید." -msgid "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations:" +msgid "" +"All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the " +"following operations:" msgstr "" +"همه‌ی انواع :class:`numbers.Real` (:class:`int` و :class:`float`) همچنین عملیات زیر را " +"نیز شامل می‌شوند:" msgid ":func:`math.trunc(\\ x) `" -msgstr "" +msgstr ":func:`math.trunc(\\ x) `" msgid "*x* truncated to :class:`~numbers.Integral`" -msgstr "" +msgstr "*x* قطع‌شده به :class:`~numbers.Integral`" msgid ":func:`round(x[, n]) `" -msgstr "" +msgstr ":func:`round(x[, n]) `" -msgid "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it defaults to 0." +msgid "" +"*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it defaults to 0." msgstr "" +"*x* گرد شده به *n* رقم، با گرد کردن نیم به زوج. اگر *n* حذف شود، به طور پیش‌فرض ۰ است." msgid ":func:`math.floor(\\ x) `" -msgstr "" +msgstr ":func:`math.floor(\\ x) `" msgid "the greatest :class:`~numbers.Integral` <= *x*" -msgstr "" +msgstr "بزرگ‌ترین :class:`~numbers.Integral` <= *x*" msgid ":func:`math.ceil(x) `" -msgstr "" +msgstr ":func:`math.ceil(x) `" msgid "the least :class:`~numbers.Integral` >= *x*" -msgstr "" +msgstr "کوچک‌ترین :class:`~numbers.Integral` بزرگ‌تر یا مساوی *x*" msgid "For additional numeric operations see the :mod:`math` and :mod:`cmath` modules." -msgstr "" +msgstr "برای عملیات عددی بیشتر، ماژول‌های :mod:`math` و :mod:`cmath` را ببینید." msgid "Bitwise Operations on Integer Types" -msgstr "" +msgstr "عملیات بیتی روی نوع‌های عدد صحیح" -msgid "Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an infinite number of sign bits." +msgid "" +"Bitwise operations only make sense for integers. The result of bitwise operations is " +"calculated as though carried out in two's complement with an infinite number of sign " +"bits." msgstr "" +"عملیات بیتی تنها برای اعداد صحیح معنا دارند. نتیجه‌ی عملیات بیتی چنان محاسبه می‌شود که " +"گویی در مکمل دو و با تعداد نامتناهی بیت علامت انجام شده است." -msgid "The priorities of the binary bitwise operations are all lower than the numeric operations and higher than the comparisons; the unary operation ``~`` has the same priority as the other unary numeric operations (``+`` and ``-``)." +msgid "" +"The priorities of the binary bitwise operations are all lower than the numeric " +"operations and higher than the comparisons; the unary operation ``~`` has the same " +"priority as the other unary numeric operations (``+`` and ``-``)." msgstr "" +"اولویت تمام عملگرهای بیتی دودویی از عملیات عددی پایین‌تر و از مقایسه‌ها بالاتر است؛ " +"عملگر یکانی ``~`` اولویتی برابر با سایر عملگرهای عددی یکانی (``+`` و ``-``) دارد." msgid "This table lists the bitwise operations sorted in ascending priority:" -msgstr "" +msgstr "این جدول عملیات بیتی را به ترتیب اولویت صعودی فهرست می‌کند:" msgid "``x | y``" -msgstr "" +msgstr "``x | y``" msgid "bitwise :dfn:`or` of *x* and *y*" -msgstr "" +msgstr ":dfn:`یا ` بیتیِ *x* و *y*" msgid "\\(4)" -msgstr "" +msgstr "\\(4)" msgid "``x ^ y``" -msgstr "" +msgstr "``x ^ y``" msgid "bitwise :dfn:`exclusive or` of *x* and *y*" -msgstr "" +msgstr ":dfn:`یای انحصاری بیتی ` *x* و *y*" msgid "``x & y``" -msgstr "" +msgstr "``x & y``" msgid "bitwise :dfn:`and` of *x* and *y*" -msgstr "" +msgstr ":dfn:`و ` بیتیِ *x* و *y*" msgid "``x << n``" -msgstr "" +msgstr "``x << n``" msgid "*x* shifted left by *n* bits" -msgstr "" +msgstr "*x* به اندازه‌ی *n* بیت به چپ منتقل شده است" msgid "(1)(2)" -msgstr "" +msgstr "(1)(2)" msgid "``x >> n``" -msgstr "" +msgstr "``x >> n``" msgid "*x* shifted right by *n* bits" -msgstr "" +msgstr "*x* به اندازه‌ی *n* بیت به سمت راست منتقل شده" msgid "(1)(3)" -msgstr "" +msgstr "(1)(3)" msgid "``~x``" -msgstr "" +msgstr "``~x``" msgid "the bits of *x* inverted" -msgstr "" +msgstr "بیت‌های *x* وارونه‌شده" msgid "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." msgstr "" +"شمارش‌های انتقال (shift) منفی غیرمجاز هستند و باعث می‌شوند که یک :exc:`ValueError` پرتاب " +"شود." msgid "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." -msgstr "" +msgstr "انتقال به چپ به اندازه‌ی *n* بیت معادل ضرب در ``pow(2, n)`` است." msgid "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." -msgstr "" +msgstr "یک انتقال به راست به اندازه‌ی *n* بیت معادل تقسیم کف بر ``pow(2, n)`` است." -msgid "Performing these calculations with at least one extra sign extension bit in a finite two's complement representation (a working bit-width of ``1 + max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same result as if there were an infinite number of sign bits." +msgid "" +"Performing these calculations with at least one extra sign extension bit in a finite " +"two's complement representation (a working bit-width of ``1 + max(x.bit_length(), " +"y.bit_length())`` or more) is sufficient to get the same result as if there were an " +"infinite number of sign bits." msgstr "" +"انجام این محاسبات با دست‌کم یک بیت اضافی برای بسط علامت در یک نمایش متناهی مکمل دو " +"(پهنای بیت کاری ``1 + max(x.bit_length(), y.bit_length())`` یا بیشتر) برای به‌دست‌آوردن " +"همان نتیجه‌ای که گویی تعداد بی‌نهایتی بیت علامت وجود دارد، کافی است." msgid "Additional Methods on Integer Types" -msgstr "" +msgstr "متدهای اضافی روی انواع عدد صحیح" -msgid "The int type implements the :class:`numbers.Integral` :term:`abstract base class`. In addition, it provides a few more methods:" +msgid "" +"The int type implements the :class:`numbers.Integral` :term:`abstract base class`. In " +"addition, it provides a few more methods:" msgstr "" +"نوع int :class:`numbers.Integral`، یعنی :term:`کلاس پایه انتزاعی `، را پیاده‌سازی می‌کند. علاوه بر این، چند متد دیگر نیز ارائه می‌دهد:" -msgid "Return the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros::" +msgid "" +"Return the number of bits necessary to represent an integer in binary, excluding the " +"sign and leading zeros::" msgstr "" +"بازگرداندن تعداد بیت‌های لازم برای نمایش یک عدد صحیح در مبنای دو، بدون احتساب علامت و " +"صفرهای ابتدایی::" msgid "" ">>> n = -37\n" @@ -491,12 +723,25 @@ msgid "" ">>> n.bit_length()\n" "6" msgstr "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" -msgid "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` is small enough to have a correctly rounded logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x.bit_length()`` returns ``0``." +msgid "" +"More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique positive " +"integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. Equivalently, when ``abs(x)`` " +"is small enough to have a correctly rounded logarithm, then ``k = 1 + int(log(abs(x), " +"2))``. If ``x`` is zero, then ``x.bit_length()`` returns ``0``." msgstr "" +"دقیق‌تر بگوییم، اگر ``x`` ناصفر باشد، آنگاه ``x.bit_length()`` تنها عدد صحیح مثبت ``k`` " +"است که ``2**(k-1) <= abs(x) < 2**k``. به بیان معادل، وقتی ``abs(x)`` به اندازه کافی " +"کوچک باشد که لگاریتم آن به‌درستی گرد شود، آنگاه ``k = 1 + int(log(abs(x), 2))``. اگر " +"``x`` صفر باشد، آنگاه ``x.bit_length()`` مقدار ``0`` را برمی‌گرداند." msgid "Equivalent to::" -msgstr "" +msgstr "معادل است با::" msgid "" "def bit_length(self):\n" @@ -504,9 +749,17 @@ msgid "" " s = s.lstrip('-0b') # remove leading zeros and minus sign\n" " return len(s) # len('100101') --> 6" msgstr "" +"def bit_length(self):\n" +" s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # remove leading zeros and minus sign\n" +" return len(s) # len('100101') --> 6" -msgid "Return the number of ones in the binary representation of the absolute value of the integer. This is also known as the population count. Example::" +msgid "" +"Return the number of ones in the binary representation of the absolute value of the " +"integer. This is also known as the population count. Example::" msgstr "" +"تعداد یک‌ها در نمایش دودویی قدر مطلق عدد صحیح را بازمی‌گرداند. این عمل با نام شمارش " +"جمعیت (population count) نیز شناخته می‌شود. مثال::" msgid "" ">>> n = 19\n" @@ -517,34 +770,73 @@ msgid "" ">>> (-n).bit_count()\n" "3" msgstr "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" msgid "" "def bit_count(self):\n" " return bin(self).count(\"1\")" msgstr "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" msgid "Return an array of bytes representing an integer." -msgstr "" +msgstr "آرایه‌ای از بایت‌ها را برمی‌گرداند که یک عدد صحیح را نمایش می‌دهد." -msgid "The integer is represented using *length* bytes, and defaults to 1. An :exc:`OverflowError` is raised if the integer is not representable with the given number of bytes." +msgid "" +"The integer is represented using *length* bytes, and defaults to 1. " +"An :exc:`OverflowError` is raised if the integer is not representable with the given " +"number of bytes." msgstr "" +"عدد صحیح با استفاده از *length* بایت نمایش داده می‌شود و پیش‌فرض آن ۱ است. اگر عدد صحیح " +"با تعداد بایت‌های داده‌شده قابل نمایش نباشد، یک :exc:`OverflowError` پرتاب می‌شود." -msgid "The *byteorder* argument determines the byte order used to represent the integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most significant byte is at the end of the byte array." +msgid "" +"The *byteorder* argument determines the byte order used to represent the integer, and " +"defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is " +"at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most " +"significant byte is at the end of the byte array." msgstr "" +"آرگومان *byteorder* ترتیب بایت مورد استفاده برای نمایش عدد صحیح را تعیین می‌کند و " +"پیش‌فرض آن ``\"big\"`` است. اگر *byteorder* برابر با ``\"big\"`` باشد، پرارزش‌ترین بایت " +"در ابتدای آرایه بایتی قرار می‌گیرد. اگر *byteorder* برابر با ``\"little\"`` باشد، " +"پرارزش‌ترین بایت در انتهای آرایه بایتی قرار می‌گیرد." -msgid "The *signed* argument determines whether two's complement is used to represent the integer. If *signed* is ``False`` and a negative integer is given, an :exc:`OverflowError` is raised. The default value for *signed* is ``False``." +msgid "" +"The *signed* argument determines whether two's complement is used to represent the " +"integer. If *signed* is ``False`` and a negative integer is given, " +"an :exc:`OverflowError` is raised. The default value for *signed* is ``False``." msgstr "" +"آرگومان *signed* تعیین می‌کند که آیا از مکمل دو برای نمایش عدد صحیح استفاده می‌شود یا " +"خیر. اگر *signed* برابر با ``False`` باشد و یک عدد صحیح منفی داده شود، " +"استثنای :exc:`OverflowError` پرتاب می‌شود. مقدار پیش‌فرض برای *signed* برابر با " +"``False`` است." -msgid "The default values can be used to conveniently turn an integer into a single byte object::" +msgid "" +"The default values can be used to conveniently turn an integer into a single byte " +"object::" msgstr "" +"می‌توان از مقادیر پیش‌فرض برای تبدیل راحتِ یک عدد صحیح به یک شیء بایت تک‌بایتی استفاده " +"کرد::" msgid "" ">>> (65).to_bytes()\n" "b'A'" msgstr "" +">>> (65).to_bytes()\n" +"b'A'" -msgid "However, when using the default arguments, don't try to convert a value greater than 255 or you'll get an :exc:`OverflowError`." +msgid "" +"However, when using the default arguments, don't try to convert a value greater than " +"255 or you'll get an :exc:`OverflowError`." msgstr "" +"با این حال، هنگام استفاده از آرگومان‌های پیش‌فرض، سعی نکنید مقداری بزرگ‌تر از ۲۵۵ را " +"تبدیل کنید، در غیر این صورت یک :exc:`OverflowError` دریافت می‌کنید." msgid "" "def to_bytes(n, length=1, byteorder='big', signed=False):\n" @@ -557,21 +849,47 @@ msgid "" "\n" " return bytes((n >> i*8) & 0xff for i in order)" msgstr "" +"def to_bytes(n, length=1, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" order = range(length)\n" +" elif byteorder == 'big':\n" +" order = reversed(range(length))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" return bytes((n >> i*8) & 0xff for i in order)" msgid "Added default argument values for ``length`` and ``byteorder``." -msgstr "" +msgstr "مقادیر پیش‌فرض برای آرگومان‌های ``length`` و ``byteorder`` افزوده شد." msgid "Return the integer represented by the given array of bytes." -msgstr "" +msgstr "عدد صحیح نمایش‌داده‌شده توسط آرایه‌ای از بایت‌های داده‌شده را بازمی‌گرداند." -msgid "The argument *bytes* must either be a :term:`bytes-like object` or an iterable producing bytes." +msgid "" +"The argument *bytes* must either be a :term:`bytes-like object` or an iterable " +"producing bytes." msgstr "" +"آرگومان *bytes* باید یا یک :term:`bytes-like object` باشد یا یک پیمایش‌پذیر که بایت " +"تولید می‌کند." -msgid "The *byteorder* argument determines the byte order used to represent the integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use :data:`sys.byteorder` as the byte order value." +msgid "" +"The *byteorder* argument determines the byte order used to represent the integer, and " +"defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the most significant byte is " +"at the beginning of the byte array. If *byteorder* is ``\"little\"``, the most " +"significant byte is at the end of the byte array. To request the native byte order of " +"the host system, use :data:`sys.byteorder` as the byte order value." msgstr "" +"آرگومان *byteorder* ترتیب بایتی را که برای نمایش عدد صحیح به کار می‌رود تعیین می‌کند و " +"پیش‌فرض آن ``\"big\"`` است. اگر *byteorder* برابر با ``\"big\"`` باشد، بایت بااهمیت‌ترین " +"در ابتدای آرایه بایت قرار می‌گیرد. اگر *byteorder* برابر با ``\"little\"`` باشد، بایت " +"بااهمیت‌ترین در انتهای آرایه بایت قرار می‌گیرد. برای درخواست ترتیب بایت بومی سیستم " +"میزبان، از :data:`sys.byteorder` به‌عنوان مقدار ترتیب بایت استفاده کنید." -msgid "The *signed* argument indicates whether two's complement is used to represent the integer." +msgid "" +"The *signed* argument indicates whether two's complement is used to represent the " +"integer." msgstr "" +"آرگومان *signed* نشان می‌دهد که آیا از مکمل دو برای نمایش عدد صحیح استفاده می‌شود یا خیر." msgid "" "def from_bytes(bytes, byteorder='big', signed=False):\n" @@ -588,36 +906,85 @@ msgid "" "\n" " return n" msgstr "" +"def from_bytes(bytes, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" little_ordered = list(bytes)\n" +" elif byteorder == 'big':\n" +" little_ordered = list(reversed(bytes))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" n = sum(b << i*8 for i, b in enumerate(little_ordered))\n" +" if signed and little_ordered and (little_ordered[-1] & 0x80):\n" +" n -= 1 << 8*len(little_ordered)\n" +"\n" +" return n" msgid "Added default argument value for ``byteorder``." -msgstr "" +msgstr "مقدار پیش‌فرض برای آرگومان ``byteorder`` اضافه شد." -msgid "Return a pair of integers whose ratio is equal to the original integer and has a positive denominator. The integer ratio of integers (whole numbers) is always the integer as the numerator and ``1`` as the denominator." +msgid "" +"Return a pair of integers whose ratio is equal to the original integer and has a " +"positive denominator. The integer ratio of integers (whole numbers) is always the " +"integer as the numerator and ``1`` as the denominator." msgstr "" +"جفتی از اعداد صحیح را بازمی‌گرداند که نسبت آن با عدد صحیح اصلی برابر است و مخرجی مثبت " +"دارد. نسبت صحیحِ اعداد صحیح (اعداد کامل) همیشه خودِ عدد صحیح به‌عنوان صورت کسر و ``1`` " +"به‌عنوان مخرج است." -msgid "Returns ``True``. Exists for duck type compatibility with :meth:`float.is_integer`." +msgid "" +"Returns ``True``. Exists for duck type compatibility with :meth:`float.is_integer`." msgstr "" +"``True`` را برمی‌گرداند. برای سازگاری نوع‌دهی اردکی با :meth:`float.is_integer` وجود " +"دارد." msgid "Additional Methods on Float" -msgstr "" +msgstr "متدهای اضافی روی Float" -msgid "The float type implements the :class:`numbers.Real` :term:`abstract base class`. float also has the following additional methods." +msgid "" +"The float type implements the :class:`numbers.Real` :term:`abstract base class`. float " +"also has the following additional methods." msgstr "" +"نوع float، :term:`کلاس پایه انتزاعی ` :class:`numbers.Real` را " +"پیاده‌سازی می‌کند. float همچنین متدهای اضافی زیر را دارد." msgid "Class method to return a floating-point number constructed from a number *x*." -msgstr "" +msgstr "متد کلاس برای برگرداندن یک عدد ممیز شناور که از یک عدد *x* ساخته شده است." -msgid "If the argument is an integer or a floating-point number, a floating-point number with the same value (within Python's floating-point precision) is returned. If the argument is outside the range of a Python float, an :exc:`OverflowError` will be raised." +msgid "" +"If the argument is an integer or a floating-point number, a floating-point number with " +"the same value (within Python's floating-point precision) is returned. If the " +"argument is outside the range of a Python float, an :exc:`OverflowError` will be " +"raised." msgstr "" +"اگر آرگومان یک عدد صحیح یا یک عدد ممیز شناور باشد، عددی ممیز شناور با همان مقدار (در " +"حد دقت ممیز شناور پایتون) بازگردانده می‌شود. اگر آرگومان خارج از محدوده یک float پایتون " +"باشد، استثنای :exc:`OverflowError` پرتاب می‌شود." -msgid "For a general Python object ``x``, ``float.from_number(x)`` delegates to ``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls back to :meth:`~object.__index__`." +msgid "" +"For a general Python object ``x``, ``float.from_number(x)`` delegates to " +"``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls back " +"to :meth:`~object.__index__`." msgstr "" +"برای یک شیء عمومی پایتون ``x``، ``float.from_number(x)`` کار را به ``x.__float__()`` " +"واگذار می‌کند. اگر :meth:`~object.__float__` تعریف نشده باشد، آنگاه " +"به :meth:`~object.__index__` رجوع می‌کند." -msgid "Return a pair of integers whose ratio is exactly equal to the original float. The ratio is in lowest terms and has a positive denominator. Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." +msgid "" +"Return a pair of integers whose ratio is exactly equal to the original float. The " +"ratio is in lowest terms and has a positive denominator. Raises :exc:`OverflowError` " +"on infinities and a :exc:`ValueError` on NaNs." msgstr "" +"جفتی از اعداد صحیح برمی‌گرداند که نسبت آن‌ها دقیقاً برابر با عدد اعشاری (float) اصلی است. " +"این نسبت ساده‌شده است و مخرج آن مثبت است. برای بی‌نهایت‌ها استثنای :exc:`OverflowError` و " +"برای NaNها استثنای :exc:`ValueError` پرتاب می‌کند." -msgid "Return ``True`` if the float instance is finite with integral value, and ``False`` otherwise::" +msgid "" +"Return ``True`` if the float instance is finite with integral value, and ``False`` " +"otherwise::" msgstr "" +"اگر نمونه‌ی اعشاری (float) متناهی باشد و مقدار صحیح داشته باشد، ``True`` و در غیر این " +"صورت ``False`` برمی‌گرداند::" msgid "" ">>> (-2.0).is_integer()\n" @@ -625,85 +992,223 @@ msgid "" ">>> (3.2).is_integer()\n" "False" msgstr "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" -msgid "Two methods support conversion to and from hexadecimal strings. Since Python's floats are stored internally as binary numbers, converting a float to or from a *decimal* string usually involves a small rounding error. In contrast, hexadecimal strings allow exact representation and specification of floating-point numbers. This can be useful when debugging, and in numerical work." +msgid "" +"Two methods support conversion to and from hexadecimal strings. Since Python's floats " +"are stored internally as binary numbers, converting a float to or from a *decimal* " +"string usually involves a small rounding error. In contrast, hexadecimal strings " +"allow exact representation and specification of floating-point numbers. This can be " +"useful when debugging, and in numerical work." msgstr "" +"دو متد از تبدیل به و از رشته‌های مبنای شانزده پشتیبانی می‌کنند. چون مقادیر float پایتون " +"به‌صورت داخلی به شکل اعداد دودویی ذخیره می‌شوند، تبدیل یک float به یک رشته‌ی *دهدهی* یا " +"برعکس معمولاً با یک خطای کوچک گرد کردن همراه است. در مقابل، رشته‌های مبنای شانزده امکان " +"نمایش و تعیین دقیق اعداد ممیز شناور را فراهم می‌کنند. این موضوع می‌تواند هنگام " +"اشکال‌زدایی و در کارهای عددی مفید باشد." -msgid "Return a representation of a floating-point number as a hexadecimal string. For finite floating-point numbers, this representation will always include a leading ``0x`` and a trailing ``p`` and exponent." +msgid "" +"Return a representation of a floating-point number as a hexadecimal string. For " +"finite floating-point numbers, this representation will always include a leading " +"``0x`` and a trailing ``p`` and exponent." msgstr "" +"نمایشی از یک عدد ممیز شناور را به‌صورت رشته‌ای در مبنای شانزده بازمی‌گرداند. برای اعداد " +"ممیز شناور متناهی، این نمایش همیشه شامل یک ``0x`` در ابتدا و یک ``p`` و توان در انتها " +"خواهد بود." -msgid "Class method to return the float represented by a hexadecimal string *s*. The string *s* may have leading and trailing whitespace." +msgid "" +"Class method to return the float represented by a hexadecimal string *s*. The string " +"*s* may have leading and trailing whitespace." msgstr "" +"متد کلاس برای بازگرداندن عدد اعشاری (float) که با رشته‌ی مبنای شانزده *s* نمایش داده " +"می‌شود. رشته‌ی *s* می‌تواند فاصله‌های خالی در ابتدا و انتها داشته باشد." -msgid "Note that :meth:`float.hex` is an instance method, while :meth:`float.fromhex` is a class method." +msgid "" +"Note that :meth:`float.hex` is an instance method, while :meth:`float.fromhex` is a " +"class method." msgstr "" +"توجه داشته باشید که :meth:`float.hex` یک متد نمونه است، در حالی " +"که :meth:`float.fromhex` یک متد کلاس است." msgid "A hexadecimal string takes the form::" -msgstr "" +msgstr "یک رشته مبنای شانزده به شکل زیر است::" msgid "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" -msgstr "" +msgstr "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" -msgid "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and ``fraction`` are strings of hexadecimal digits, and ``exponent`` is a decimal integer with an optional leading sign. Case is not significant, and there must be at least one hexadecimal digit in either the integer or the fraction. This syntax is similar to the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax used in Java 1.5 onwards. In particular, the output of :meth:`float.hex` is usable as a hexadecimal floating-point literal in C or Java code, and hexadecimal strings produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted by :meth:`float.fromhex`." +msgid "" +"where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and ``fraction`` " +"are strings of hexadecimal digits, and ``exponent`` is a decimal integer with an " +"optional leading sign. Case is not significant, and there must be at least one " +"hexadecimal digit in either the integer or the fraction. This syntax is similar to " +"the syntax specified in section 6.4.4.2 of the C99 standard, and also to the syntax " +"used in Java 1.5 onwards. In particular, the output of :meth:`float.hex` is usable as " +"a hexadecimal floating-point literal in C or Java code, and hexadecimal strings " +"produced by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted " +"by :meth:`float.fromhex`." msgstr "" +"که در آن ``sign`` اختیاری می‌تواند ``+`` یا ``-`` باشد، ``integer`` و ``fraction`` " +"رشته‌هایی از ارقام مبنای شانزده هستند، و ``exponent`` یک عدد صحیح دهدهی با علامت " +"ابتدایی اختیاری است. بزرگی و کوچکی حروف اهمیتی ندارد و باید دست‌کم یک رقم مبنای شانزده " +"در بخش صحیح یا بخش اعشاری وجود داشته باشد. این سینتکس مشابه سینتکس تعیین‌شده در بخش " +"6.4.4.2 استاندارد C99 و نیز مشابه سینتکسی است که از Java 1.5 به بعد استفاده شده است. " +"به‌طور خاص، خروجی :meth:`float.hex` را می‌توان به‌عنوان یک لفظ اعشاری مبنای شانزده در کد " +"C یا Java به کار برد، و رشته‌های مبنای شانزده‌ای که توسط نویسه قالب ``%a`` در C یا " +"``Double.toHexString`` در Java تولید می‌شوند، توسط :meth:`float.fromhex` پذیرفته می‌شوند." -msgid "Note that the exponent is written in decimal rather than hexadecimal, and that it gives the power of 2 by which to multiply the coefficient. For example, the hexadecimal string ``0x3.a7p10`` represents the floating-point number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" +msgid "" +"Note that the exponent is written in decimal rather than hexadecimal, and that it " +"gives the power of 2 by which to multiply the coefficient. For example, the " +"hexadecimal string ``0x3.a7p10`` represents the floating-point number ``(3 + 10./16 + " +"7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" +"توجه داشته باشید که توان به‌صورت مبنای ده و نه مبنای شانزده نوشته می‌شود، و اینکه این " +"توان، توانی از ۲ را مشخص می‌کند که در آن ضریب ضرب می‌شود. برای مثال، رشته‌ی مبنای شانزده " +"``0x3.a7p10`` عدد ممیز شناور ``(3 + 10./16 + 7./16**2) * 2.0**10`` یا همان ``3740.0`` " +"را بازنمایی می‌کند::" msgid "" ">>> float.fromhex('0x3.a7p10')\n" "3740.0" msgstr "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" -msgid "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal string representing the same number::" +msgid "" +"Applying the reverse conversion to ``3740.0`` gives a different hexadecimal string " +"representing the same number::" msgstr "" +"اعمال تبدیل معکوس روی ``3740.0`` رشته‌ای دیگر با مبنای شانزده به دست می‌دهد که همان عدد " +"را نمایش می‌دهد::" msgid "" ">>> float.hex(3740.0)\n" "'0x1.d380000000000p+11'" msgstr "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" msgid "Additional Methods on Complex" -msgstr "" +msgstr "متدهای اضافی روی اعداد مختلط" -msgid "The :class:`!complex` type implements the :class:`numbers.Complex` :term:`abstract base class`. :class:`!complex` also has the following additional methods." +msgid "" +"The :class:`!complex` type implements the :class:`numbers.Complex` :term:`abstract " +"base class`. :class:`!complex` also has the following additional methods." msgstr "" +"نوع :class:`!complex` :term:`کلاس پایه انتزاعی ` :class:`numbers.Complex` را پیاده‌سازی می‌کند. :class:`!complex` همچنین متدهای " +"اضافی زیر را نیز دارد." msgid "Class method to convert a number to a complex number." -msgstr "" +msgstr "متد کلاس برای تبدیل یک عدد به یک عدد مختلط." -msgid "For a general Python object ``x``, ``complex.from_number(x)`` delegates to ``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back to :meth:`~object.__index__`." +msgid "" +"For a general Python object ``x``, ``complex.from_number(x)`` delegates to " +"``x.__complex__()``. If :meth:`~object.__complex__` is not defined then it falls back " +"to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it falls back " +"to :meth:`~object.__index__`." msgstr "" +"برای یک شیء عمومی پایتون ``x``، ``complex.from_number(x)`` به ``x.__complex__()`` " +"واگذاری می‌کند. اگر :meth:`~object.__complex__` تعریف نشده باشد، آنگاه " +"به :meth:`~object.__float__` روی می‌آورد. اگر :meth:`!__float__` تعریف نشده باشد، " +"آنگاه به :meth:`~object.__index__` روی می‌آورد." msgid "Hashing of numeric types" -msgstr "" +msgstr "درهم‌سازی انواع عددی" + +msgid "" +"For numbers ``x`` and ``y``, possibly of different types, it's a requirement that " +"``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object.__hash__` method " +"documentation for more details). For ease of implementation and efficiency across a " +"variety of numeric types " +"(including :class:`int`, :class:`float`, :class:`decimal.Decimal` " +"and :class:`fractions.Fraction`) Python's hash for numeric types is based on a single " +"mathematical function that's defined for any rational number, and hence applies to all " +"instances of :class:`int` and :class:`fractions.Fraction`, and all finite instances " +"of :class:`float` and :class:`decimal.Decimal`. Essentially, this function is given " +"by reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made " +"available to Python as the :attr:`~sys.hash_info.modulus` attribute " +"of :data:`sys.hash_info`." +msgstr "" +"برای اعداد ``x`` و ``y`` که ممکن است از نوع‌های مختلف باشند، الزامی وجود دارد مبنی بر " +"اینکه هرگاه ``x == y`` باشد، ``hash(x) == hash(y)`` نیز برقرار باشد (برای جزئیات " +"بیشتر، مستندات متد :meth:`~object.__hash__` را ببینید). برای سهولت پیاده‌سازی و کارایی " +"در میان نوع‌های عددی گوناگون (از " +"جمله :class:`int`، :class:`float`، :class:`decimal.Decimal` " +"و :class:`fractions.Fraction`) هش پایتون برای نوع‌های عددی بر پایه یک تابع ریاضی واحد " +"استوار است که برای هر عدد گویا تعریف شده و بنابراین بر همه نمونه‌های :class:`int` " +"و :class:`fractions.Fraction` و همه نمونه‌های متناهی :class:`float` " +"و :class:`decimal.Decimal` اعمال می‌شود. در اصل، این تابع به‌صورت کاهش به پیمانه‌ی ``P`` " +"برای یک عدد اول ثابت ``P`` داده می‌شود. مقدار ``P`` به‌عنوان " +"ویژگی :attr:`~sys.hash_info.modulus` از :data:`sys.hash_info` در اختیار پایتون قرار " +"می‌گیرد." + +msgid "" +"Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C longs and ``P " +"= 2**61 - 1`` on machines with 64-bit C longs." +msgstr "" +"در حال حاضر، عدد اول استفاده‌شده روی ماشین‌هایی که نوع long زبان C آن‌ها ۳۲ بیتی است، ``P " +"= 2**31 - 1`` و روی ماشین‌هایی که نوع long زبان C آن‌ها ۶۴ بیتی است، ``P = 2**61 - 1`` " +"می‌باشد." -msgid "For numbers ``x`` and ``y``, possibly of different types, it's a requirement that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object.__hash__` method documentation for more details). For ease of implementation and efficiency across a variety of numeric types (including :class:`int`, :class:`float`, :class:`decimal.Decimal` and :class:`fractions.Fraction`) Python's hash for numeric types is based on a single mathematical function that's defined for any rational number, and hence applies to all instances of :class:`int` and :class:`fractions.Fraction`, and all finite instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this function is given by reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made available to Python as the :attr:`~sys.hash_info.modulus` attribute of :data:`sys.hash_info`." -msgstr "" +msgid "Here are the rules in detail:" +msgstr "در اینجا قواعد به تفصیل آمده است:" -msgid "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." +msgid "" +"If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible by ``P``, " +"define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the " +"inverse of ``n`` modulo ``P``." msgstr "" +"اگر ``x = m / n`` یک عدد گویای نامنفی باشد و ``n`` بر ``P`` بخش‌پذیر نباشد، ``hash(x)`` " +"را به صورت ``m * invmod(n, P) % P`` تعریف کنید، که در آن ``invmod(n, P)`` وارون ``n`` " +"به پیمانه ``P`` را می‌دهد." -msgid "Here are the rules in detail:" +msgid "" +"If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by ``P`` (but " +"``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; " +"in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``." msgstr "" +"اگر ``x = m / n`` یک عدد گویای نامنفی باشد و ``n`` بر ``P`` بخش‌پذیر باشد (اما ``m`` " +"چنین نباشد)، آنگاه ``n`` وارونی به پیمانه ``P`` ندارد و قاعده‌ی بالا اعمال نمی‌شود؛ در " +"این حالت ``hash(x)`` را برابر مقدار ثابت ``sys.hash_info.inf`` تعریف کنید." -msgid "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, P)`` gives the inverse of ``n`` modulo ``P``." +msgid "" +"If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-hash(-x)``. " +"If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" +"اگر ``x = m / n`` یک عدد گویای منفی باشد، ``hash(x)`` را به‌صورت ``-hash(-x)`` تعریف " +"کنید. اگر هش حاصل ``-1`` باشد، آن را با ``-2`` جایگزین کنید." -msgid "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by ``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule above doesn't apply; in this case define ``hash(x)`` to be the constant value ``sys.hash_info.inf``." +msgid "" +"The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as " +"hash values for positive infinity or negative infinity (respectively)." msgstr "" +"مقادیر خاص ``sys.hash_info.inf`` و ``-sys.hash_info.inf`` به‌ترتیب به‌عنوان مقادیر هش " +"برای بی‌نهایت مثبت یا بی‌نهایت منفی استفاده می‌شوند." -msgid "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." +msgid "" +"For a :class:`complex` number ``z``, the hash values of the real and imaginary parts " +"are combined by computing ``hash(z.real) + sys.hash_info.imag * hash(z.imag)``, " +"reduced modulo ``2**sys.hash_info.width`` so that it lies in " +"``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the " +"result is ``-1``, it's replaced with ``-2``." msgstr "" +"برای یک عدد :class:`complex` مانند ``z``، مقادیر هش بخش حقیقی و بخش موهومی با محاسبه‌ی " +"``hash(z.real) + sys.hash_info.imag * hash(z.imag)`` ترکیب می‌شوند و نتیجه به پیمانه‌ی " +"``2**sys.hash_info.width`` کاهش می‌یابد تا در ``range(-2**(sys.hash_info.width - 1), " +"2**(sys.hash_info.width - 1))`` قرار گیرد. باز هم، اگر نتیجه ``-1`` باشد، با ``-2`` " +"جایگزین می‌شود." -msgid "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are used as hash values for positive infinity or negative infinity (respectively)." -msgstr "" - -msgid "For a :class:`complex` number ``z``, the hash values of the real and imaginary parts are combined by computing ``hash(z.real) + sys.hash_info.imag * hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. Again, if the result is ``-1``, it's replaced with ``-2``." -msgstr "" - -msgid "To clarify the above rules, here's some example Python code, equivalent to the built-in hash, for computing the hash of a rational number, :class:`float`, or :class:`complex`::" +msgid "" +"To clarify the above rules, here's some example Python code, equivalent to the built-" +"in hash, for computing the hash of a rational number, :class:`float`, " +"or :class:`complex`::" msgstr "" +"برای روشن شدن قواعد بالا، در اینجا نمونه‌ای از کد پایتون آمده است که معادل hash توکار " +"بوده و برای محاسبه‌ی هش یک عدد گویا، :class:`float` یا :class:`complex` به کار می‌رود::" msgid "" "import sys, math\n" @@ -753,167 +1258,359 @@ msgid "" " hash_value = -2\n" " return hash_value" msgstr "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"Compute the hash of a rational number m / n.\n" +"\n" +" Assumes m and n are integers, with n positive.\n" +" Equivalent to hash(fractions.Fraction(m, n)).\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # Remove common factors of P. (Unnecessary if m and n already coprime.)\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # Fermat's Little Theorem: pow(n, P-1, P) is 1, so\n" +" # pow(n, P-2, P) gives the inverse of n modulo P.\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"Compute the hash of a float x.\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"Compute the hash of a complex number z.\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)\n" +" # do a signed reduction modulo 2**sys.hash_info.width\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" msgid "Boolean Type - :class:`bool`" -msgstr "" +msgstr "نوع بولی - :class:`bool`" -msgid "Booleans represent truth values. The :class:`bool` type has exactly two constant instances: ``True`` and ``False``." +msgid "" +"Booleans represent truth values. The :class:`bool` type has exactly two constant " +"instances: ``True`` and ``False``." msgstr "" +"بولی‌ها مقادیر درستی را نشان می‌دهند. نوع :class:`bool` دقیقاً دو نمونه‌ی ثابت دارد: " +"``True`` و ``False``." -msgid "The built-in function :func:`bool` converts any value to a boolean, if the value can be interpreted as a truth value (see section :ref:`truth` above)." +msgid "" +"The built-in function :func:`bool` converts any value to a boolean, if the value can " +"be interpreted as a truth value (see section :ref:`truth` above)." msgstr "" +"تابع توکار :func:`bool` هر مقداری را به یک مقدار بولی تبدیل می‌کند، اگر بتوان آن مقدار را به‌عنوان یک مقدار درستی تفسیر کرد (بخش :ref:`صدق ` در بالا را ببینید)." -msgid "For logical operations, use the :ref:`boolean operators ` ``and``, ``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, they return a bool equivalent to the logical operations \"and\", \"or\", \"xor\". However, the logical operators ``and``, ``or`` and ``!=`` should be preferred over ``&``, ``|`` and ``^``." +msgid "" +"For logical operations, use the :ref:`boolean operators ` ``and``, ``or`` and " +"``not``. When applying the bitwise operators ``&``, ``|``, ``^`` to two booleans, they " +"return a bool equivalent to the logical operations \"and\", \"or\", \"xor\". However, " +"the logical operators ``and``, ``or`` and ``!=`` should be preferred over ``&``, ``|`` " +"and ``^``." msgstr "" +"برای عملیات منطقی، از :ref:`عملگرهای بولی ` ``and``، ``or`` و ``not`` استفاده " +"کنید. هنگامی که عملگرهای بیتی ``&``، ``|`` و ``^`` را روی دو مقدار بولی اعمال می‌کنید، " +"آن‌ها یک bool معادل عملیات منطقی «and»، «or» و «xor» برمی‌گردانند. با این حال، بهتر است " +"عملگرهای منطقی ``and``، ``or`` و ``!=`` را به ``&``، ``|`` و ``^`` ترجیح دهید." -msgid "The use of the bitwise inversion operator ``~`` is deprecated and will raise an error in Python 3.16." +msgid "" +"The use of the bitwise inversion operator ``~`` is deprecated and will raise an error " +"in Python 3.16." msgstr "" +"استفاده از عملگر وارون‌سازی بیتی ``~`` منسوخ شده است و در Python 3.16 خطایی پرتاب خواهد " +"کرد." -msgid ":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In many numeric contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. However, relying on this is discouraged; explicitly convert using :func:`int` instead." +msgid "" +":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In many numeric " +"contexts, ``False`` and ``True`` behave like the integers 0 and 1, respectively. " +"However, relying on this is discouraged; explicitly convert using :func:`int` instead." msgstr "" +":class:`bool` زیرکلاسی از :class:`int` است (به :ref:`typesnumeric` مراجعه کنید). در " +"بسیاری از زمینه‌های عددی، ``False`` و ``True`` مانند اعداد صحیح ۰ و ۱ رفتار می‌کنند. با " +"این حال، تکیه بر این موضوع توصیه نمی‌شود؛ به جای آن، صریحاً با استفاده از :func:`int` " +"تبدیل کنید." msgid "Iterator Types" -msgstr "" +msgstr "انواع پیمایش‌گر" -msgid "Python supports a concept of iteration over containers. This is implemented using two distinct methods; these are used to allow user-defined classes to support iteration. Sequences, described below in more detail, always support the iteration methods." +msgid "" +"Python supports a concept of iteration over containers. This is implemented using two " +"distinct methods; these are used to allow user-defined classes to support iteration. " +"Sequences, described below in more detail, always support the iteration methods." msgstr "" +"پایتون از مفهومی به نام تکرار روی ظرف‌ها (containers) پشتیبانی می‌کند. این مفهوم با " +"استفاده از دو متد متمایز پیاده‌سازی می‌شود؛ از این متدها استفاده می‌شود تا کلاس‌های " +"تعریف‌شده توسط کاربر بتوانند از تکرار پشتیبانی کنند. دنباله‌ها، که در ادامه با جزئیات " +"بیشتری توضیح داده می‌شوند، همواره از متدهای تکرار پشتیبانی می‌کنند." -msgid "One method needs to be defined for container objects to provide :term:`iterable` support:" +msgid "" +"One method needs to be defined for container objects to provide :term:`iterable` " +"support:" msgstr "" +"برای آنکه اشیاء ظرف بتوانند پشتیبانی از :term:`پیمایش‌پذیر ` را فراهم کنند، باید یک متد تعریف شود:" -msgid "Return an :term:`iterator` object. The object is required to support the iterator protocol described below. If a container supports different types of iteration, additional methods can be provided to specifically request iterators for those iteration types. (An example of an object supporting multiple forms of iteration would be a tree structure which supports both breadth-first and depth-first traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API." +msgid "" +"Return an :term:`iterator` object. The object is required to support the iterator " +"protocol described below. If a container supports different types of iteration, " +"additional methods can be provided to specifically request iterators for those " +"iteration types. (An example of an object supporting multiple forms of iteration " +"would be a tree structure which supports both breadth-first and depth-first " +"traversal.) This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of " +"the type structure for Python objects in the Python/C API." msgstr "" +"یک شیء :term:`پیمایش‌گر ` بازمی‌گرداند. این شیء موظف است از پروتکل پیمایش‌گری که " +"در ادامه شرح داده شده است پشتیبانی کند. اگر یک ظرف (container) از انواع مختلف تکرار " +"پشتیبانی می‌کند، می‌توان متدهای اضافی‌ای ارائه داد که به‌طور خاص برای آن انواع تکرار، " +"پیمایش‌گر درخواست کنند. (نمونه‌ای از شیءای که از چند شکل تکرار پشتیبانی می‌کند، ساختاری " +"درختی است که هم پیمایش عرضی (breadth-first) و هم پیمایش عمقی (depth-first) را پشتیبانی " +"می‌کند.) این متد متناظر با جایگاه (slot) :c:member:`~PyTypeObject.tp_iter` در ساختار نوع " +"اشیاء پایتون در Python/C API است." -msgid "The iterator objects themselves are required to support the following two methods, which together form the :dfn:`iterator protocol`:" +msgid "" +"The iterator objects themselves are required to support the following two methods, " +"which together form the :dfn:`iterator protocol`:" msgstr "" +"خود اشیاء پیمایش‌گر ملزم به پشتیبانی از دو متد زیر هستند که در مجموع :dfn:`پروتکل " +"پیمایش‌گر ` را تشکیل می‌دهند:" -msgid "Return the :term:`iterator` object itself. This is required to allow both containers and iterators to be used with the :keyword:`for` and :keyword:`in` statements. This method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects in the Python/C API." +msgid "" +"Return the :term:`iterator` object itself. This is required to allow both containers " +"and iterators to be used with the :keyword:`for` and :keyword:`in` statements. This " +"method corresponds to the :c:member:`~PyTypeObject.tp_iter` slot of the type structure " +"for Python objects in the Python/C API." msgstr "" +"خودِ شیء :term:`پیمایش‌گر ` را بازمی‌گرداند. این امر برای آن ضروری است که بتوان " +"هم از ظرف‌ها و هم از پیمایش‌گرها همراه با دستورهای :keyword:`for` و :keyword:`in` استفاده " +"کرد. این متد متناظر با جایگاه :c:member:`~PyTypeObject.tp_iter` از ساختار نوع اشیاء " +"پایتون در Python/C API است." -msgid "Return the next item from the :term:`iterator`. If there are no further items, raise the :exc:`StopIteration` exception. This method corresponds to the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python objects in the Python/C API." +msgid "" +"Return the next item from the :term:`iterator`. If there are no further items, raise " +"the :exc:`StopIteration` exception. This method corresponds to " +"the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for Python " +"objects in the Python/C API." msgstr "" +"آیتم بعدی را از :term:`پیمایش‌گر ` برگردانید. اگر آیتم‌های بیشتری وجود نداشته باشند، استثنای :exc:`StopIteration` را پرتاب کنید. این متد متناظر با جایگاه :c:member:`~PyTypeObject.tp_iternext` در ساختار نوع اشیاء پایتون در API پایتون/C است." -msgid "Python defines several iterator objects to support iteration over general and specific sequence types, dictionaries, and other more specialized forms. The specific types are not important beyond their implementation of the iterator protocol." +msgid "" +"Python defines several iterator objects to support iteration over general and specific " +"sequence types, dictionaries, and other more specialized forms. The specific types " +"are not important beyond their implementation of the iterator protocol." msgstr "" +"پایتون چندین شیء پیمایش‌گر تعریف می‌کند تا از تکرار روی انواع دنباله‌های عمومی و خاص، " +"دیکشنری‌ها و سایر شکل‌های تخصصی‌تر پشتیبانی کند. انواع خاص، صرف‌نظر از پیاده‌سازی پروتکل " +"پیمایش‌گر در آن‌ها، اهمیتی ندارند." -msgid "Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken." +msgid "" +"Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it " +"must continue to do so on subsequent calls. Implementations that do not obey this " +"property are deemed broken." msgstr "" +"به‌محض اینکه متد :meth:`~iterator.__next__` یک پیمایش‌گر استثنای :exc:`StopIteration` را " +"پرتاب کند، باید به انجام همین کار در فراخوانی‌های بعدی ادامه دهد. پیاده‌سازی‌هایی که از " +"این ویژگی پیروی نمی‌کنند، معیوب تلقی می‌شوند." msgid "Generator Types" -msgstr "" +msgstr "انواع تولیدگر" -msgid "Python's :term:`generator`\\s provide a convenient way to implement the iterator protocol. If a container object's :meth:`~object.__iter__` method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` methods. More information about generators can be found in :ref:`the documentation for the yield expression `." +msgid "" +"Python's :term:`generator`\\s provide a convenient way to implement the iterator " +"protocol. If a container object's :meth:`~object.__iter__` method is implemented as a " +"generator, it will automatically return an iterator object (technically, a generator " +"object) supplying the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` " +"methods. More information about generators can be found in :ref:`the documentation for " +"the yield expression `." msgstr "" +":term:`تولیدگرهای ` پایتون راهی مناسب برای پیاده‌سازی پروتکل پیمایش‌گر فراهم " +"می‌کنند. اگر متد :meth:`~object.__iter__` یک شیء ظرف به‌صورت یک تولیدگر پیاده‌سازی شود، " +"به‌طور خودکار یک شیء پیمایش‌گر (از نظر فنی، یک شیء تولیدگر) بازمی‌گرداند که " +"متدهای :meth:`~iterator.__iter__` و :meth:`~generator.__next__` را فراهم می‌کند. " +"اطلاعات بیشتری درباره تولیدگرها می‌توانید در :ref:`مستندات عبارت yield ` " +"بیابید." msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" -msgstr "" +msgstr "انواع دنباله --- :class:`list`، :class:`tuple`، :class:`range`" -msgid "There are three basic sequence types: lists, tuples, and range objects. Additional sequence types tailored for processing of :ref:`binary data ` and :ref:`text strings ` are described in dedicated sections." +msgid "" +"There are three basic sequence types: lists, tuples, and range objects. Additional " +"sequence types tailored for processing of :ref:`binary data ` " +"and :ref:`text strings ` are described in dedicated sections." msgstr "" +"سه نوع دنباله‌ی پایه وجود دارد: فهرست‌ها، تاپل‌ها و اشیای range. انواع دنباله‌ی دیگری که " +"برای پردازش :ref:`داده‌های دودویی ` و :ref:`رشته‌های متنی ` طراحی " +"شده‌اند، در بخش‌های اختصاصی توضیح داده شده‌اند." msgid "Common Sequence Operations" -msgstr "" +msgstr "عملیات‌های رایج دنباله‌ها" -msgid "The operations in the following table are supported by most sequence types, both mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types." +msgid "" +"The operations in the following table are supported by most sequence types, both " +"mutable and immutable. The :class:`collections.abc.Sequence` ABC is provided to make " +"it easier to correctly implement these operations on custom sequence types." msgstr "" +"عملیات‌های جدول زیر توسط بیشتر نوع‌های دنباله، هم تغییرپذیر و هم تغییرناپذیر، پشتیبانی " +"می‌شوند. کلاس پایه انتزاعی (ABC) :class:`collections.abc.Sequence` فراهم شده است تا " +"پیاده‌سازی صحیح این عملیات‌ها روی نوع‌های دنباله سفارشی آسان‌تر شود." -msgid "This table lists the sequence operations sorted in ascending priority. In the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are integers and *x* is an arbitrary object that meets any type and value restrictions imposed by *s*." +msgid "" +"This table lists the sequence operations sorted in ascending priority. In the table, " +"*s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* are integers and *x* " +"is an arbitrary object that meets any type and value restrictions imposed by *s*." msgstr "" +"این جدول عملیات دنباله را به ترتیب صعودی اولویت فهرست می‌کند. در این جدول، *s* و *t* " +"دنباله‌هایی از یک نوع هستند، *n*، *i*، *j* و *k* اعداد صحیح هستند و *x* شیء دلخواهی است " +"که هر محدودیت نوع و مقدار اعمال‌شده توسط *s* را برآورده می‌کند." -msgid "The ``in`` and ``not in`` operations have the same priorities as the comparison operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same priority as the corresponding numeric operations. [3]_" +msgid "" +"The ``in`` and ``not in`` operations have the same priorities as the comparison " +"operations. The ``+`` (concatenation) and ``*`` (repetition) operations have the same " +"priority as the corresponding numeric operations. [3]_" msgstr "" +"عملیات‌های ``in`` و ``not in`` همان اولویت عملیات مقایسه را دارند. عملیات‌های ``+`` " +"(الحاق) و ``*`` (تکرار) همان اولویت عملیات عددی متناظر را دارند. [3]_" msgid "``x in s``" -msgstr "" +msgstr "``x in s``" msgid "``True`` if an item of *s* is equal to *x*, else ``False``" -msgstr "" +msgstr "اگر یکی از آیتم‌های *s* برابر با *x* باشد، ``True``؛ در غیر این صورت ``False``" msgid "``x not in s``" -msgstr "" +msgstr "``x not in s``" msgid "``False`` if an item of *s* is equal to *x*, else ``True``" -msgstr "" +msgstr "اگر یکی از آیتم‌های *s* با *x* برابر باشد، ``False``؛ در غیر این صورت ``True``" msgid "``s + t``" -msgstr "" +msgstr "``s + t``" msgid "the concatenation of *s* and *t*" -msgstr "" +msgstr "الحاق *s* و *t*" msgid "(6)(7)" -msgstr "" +msgstr "(6)(7)" msgid "``s * n`` or ``n * s``" -msgstr "" +msgstr "``s * n`` یا ``n * s``" msgid "equivalent to adding *s* to itself *n* times" -msgstr "" +msgstr "معادل افزودن *s* به خودش *n* بار است" msgid "(2)(7)" -msgstr "" +msgstr "(2)(7)" msgid "``s[i]``" -msgstr "" +msgstr "``s[i]``" msgid "*i*\\ th item of *s*, origin 0" -msgstr "" +msgstr "*i*\\ امین آیتم *s*، مبدأ ۰" msgid "(3)(8)" -msgstr "" +msgstr "(3)(8)" msgid "``s[i:j]``" -msgstr "" +msgstr "``s[i:j]``" msgid "slice of *s* from *i* to *j*" -msgstr "" +msgstr "برشی از *s* از *i* تا *j*" msgid "(3)(4)" -msgstr "" +msgstr "(3)(4)" msgid "``s[i:j:k]``" -msgstr "" +msgstr "``s[i:j:k]``" msgid "slice of *s* from *i* to *j* with step *k*" -msgstr "" +msgstr "برشی از *s* از *i* تا *j* با گام *k*" msgid "(3)(5)" -msgstr "" +msgstr "(3)(5)" msgid "``len(s)``" -msgstr "" +msgstr "``len(s)``" msgid "length of *s*" -msgstr "" +msgstr "طول *s*" msgid "``min(s)``" -msgstr "" +msgstr "``min(s)``" msgid "smallest item of *s*" -msgstr "" +msgstr "کوچک‌ترین آیتم *s*" msgid "``max(s)``" -msgstr "" +msgstr "``max(s)``" msgid "largest item of *s*" -msgstr "" +msgstr "بزرگ‌ترین آیتم *s*" -msgid "Sequences of the same type also support comparisons. In particular, tuples and lists are compared lexicographically by comparing corresponding elements. This means that to compare equal, every element must compare equal and the two sequences must be of the same type and have the same length. (For full details see :ref:`comparisons` in the language reference.)" +msgid "" +"Sequences of the same type also support comparisons. In particular, tuples and lists " +"are compared lexicographically by comparing corresponding elements. This means that to " +"compare equal, every element must compare equal and the two sequences must be of the " +"same type and have the same length. (For full details see :ref:`comparisons` in the " +"language reference.)" msgstr "" +"دنباله‌هایی از یک نوع نیز از مقایسه پشتیبانی می‌کنند. به‌طور خاص، تاپل‌ها (tuples) و فهرست‌ها با مقایسه‌ی المان‌های متناظر، به‌صورت لغت‌نامه‌ای مقایسه می‌شوند. این بدان معناست که برای برابر بودن در مقایسه، هر المان باید در مقایسه برابر باشد و دو دنباله باید از یک نوع بوده و طول یکسانی داشته باشند. (برای جزئیات کامل به :ref:`مقایسه‌ها ` در مرجع زبان رجوع کنید.)" -msgid "Forward and reversed iterators over mutable sequences access values using an index. That index will continue to march forward (or backward) even if the underlying sequence is mutated. The iterator terminates only when an :exc:`IndexError` or a :exc:`StopIteration` is encountered (or when the index drops below zero)." +msgid "" +"Forward and reversed iterators over mutable sequences access values using an index. " +"That index will continue to march forward (or backward) even if the underlying " +"sequence is mutated. The iterator terminates only when an :exc:`IndexError` or " +"a :exc:`StopIteration` is encountered (or when the index drops below zero)." msgstr "" +"پیمایش‌گرها (iterators) رو به جلو و معکوس روی دنباله‌های تغییرپذیر، با استفاده از یک " +"اندیس به مقادیر دسترسی پیدا می‌کنند. این اندیس حتی اگر دنباله زیرین تغییر کند، همچنان " +"به پیشروی رو به جلو (یا رو به عقب) ادامه می‌دهد. پیمایش‌گر تنها زمانی خاتمه می‌یابد که با " +"یک :exc:`IndexError` یا یک :exc:`StopIteration` مواجه شود (یا هنگامی که اندیس به زیر " +"صفر کاهش یابد)." -msgid "While the ``in`` and ``not in`` operations are used only for simple containment testing in the general case, some specialised sequences (such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use them for subsequence testing::" +msgid "" +"While the ``in`` and ``not in`` operations are used only for simple containment " +"testing in the general case, some specialised sequences (such " +"as :class:`str`, :class:`bytes` and :class:`bytearray`) also use them for subsequence " +"testing::" msgstr "" +"در حالی که عملیات ``in`` و ``not in`` در حالت عمومی تنها برای آزمون ساده‌ی شمول به کار " +"می‌روند، برخی دنباله‌های تخصصی (مانند :class:`str`، :class:`bytes` و :class:`bytearray`) " +"همچنین از آن‌ها برای آزمون زیردنباله استفاده می‌کنند::" msgid "" ">>> \"gg\" in \"eggs\"\n" "True" msgstr "" +">>> \"gg\" in \"eggs\"\n" +"True" -msgid "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty sequence of the same type as *s*). Note that items in the sequence *s* are not copied; they are referenced multiple times. This often haunts new Python programmers; consider::" +msgid "" +"Values of *n* less than ``0`` are treated as ``0`` (which yields an empty sequence of " +"the same type as *s*). Note that items in the sequence *s* are not copied; they are " +"referenced multiple times. This often haunts new Python programmers; consider::" msgstr "" +"مقادیر *n* کوچک‌تر از ``0`` مانند ``0`` رفتار می‌شوند (که دنباله‌ای خالی از همان نوع *s* " +"تولید می‌کند). توجه داشته باشید که آیتم‌های موجود در دنباله *s* کپی نمی‌شوند؛ بلکه چندین " +"بار به آن‌ها ارجاع داده می‌شود. این موضوع اغلب برنامه‌نویسان تازه‌کار پایتون را گرفتار " +"می‌کند؛ به مثال زیر توجه کنید::" msgid "" ">>> lists = [[]] * 3\n" @@ -923,9 +1620,23 @@ msgid "" ">>> lists\n" "[[3], [3], [3]]" msgstr "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" -msgid "What has happened is that ``[[]]`` is a one-element list containing an empty list, so all three elements of ``[[]] * 3`` are references to this single empty list. Modifying any of the elements of ``lists`` modifies this single list. You can create a list of different lists this way::" +msgid "" +"What has happened is that ``[[]]`` is a one-element list containing an empty list, so " +"all three elements of ``[[]] * 3`` are references to this single empty list. " +"Modifying any of the elements of ``lists`` modifies this single list. You can create a " +"list of different lists this way::" msgstr "" +"آنچه رخ داده این است که ``[[]]`` فهرستی تک‌المانی شامل یک فهرست خالی است؛ بنابراین هر " +"سه المانِ ``[[]] * 3`` ارجاعی به همین یک فهرست خالی هستند. تغییر دادن هر یک از المان‌های " +"``lists`` همین یک فهرست را تغییر می‌دهد. می‌توانید به این ترتیب فهرستی از فهرست‌های مختلف " +"ایجاد کنید::" msgid "" ">>> lists = [[] for i in range(3)]\n" @@ -935,306 +1646,584 @@ msgid "" ">>> lists\n" "[[3], [5], [7]]" msgstr "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" -msgid "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`." -msgstr "" +msgid "" +"Further explanation is available in the FAQ entry :ref:`faq-multidimensional-list`." +msgstr "توضیحات بیشتر در مدخل پرسش‌های متداول :ref:`faq-multidimensional-list` موجود است." -msgid "If *i* or *j* is negative, the index is relative to the end of sequence *s*: ``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is still ``0``." +msgid "" +"If *i* or *j* is negative, the index is relative to the end of sequence *s*: ``len(s) " +"+ i`` or ``len(s) + j`` is substituted. But note that ``-0`` is still ``0``." msgstr "" +"اگر *i* یا *j* منفی باشد، اندیس نسبت به انتهای دنباله‌ی *s* در نظر گرفته می‌شود: ``len(s) " +"+ i`` یا ``len(s) + j`` جایگزین می‌شود. اما توجه داشته باشید که ``-0`` همچنان ``0`` است." -msgid "The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* such that ``i <= k < j``." +msgid "" +"The slice of *s* from *i* to *j* is defined as the sequence of items with index *k* " +"such that ``i <= k < j``." msgstr "" +"برش *s* از *i* تا *j* به‌عنوان دنباله‌ای از آیتم‌های دارای اندیس *k* تعریف می‌شود، به‌طوری " +"که ``i <= k < j``." msgid "If *i* is omitted or ``None``, use ``0``." -msgstr "" +msgstr "اگر *i* ذکر نشده باشد یا ``None`` باشد، از ``0`` استفاده کنید." msgid "If *j* is omitted or ``None``, use ``len(s)``." -msgstr "" +msgstr "اگر *j* ذکر نشده یا ``None`` باشد، از ``len(s)`` استفاده می‌شود." msgid "If *i* or *j* is less than ``-len(s)``, use ``0``." -msgstr "" +msgstr "اگر *i* یا *j* کمتر از ``-len(s)`` باشد، از ``0`` استفاده کنید." msgid "If *i* or *j* is greater than ``len(s)``, use ``len(s)``." -msgstr "" +msgstr "اگر *i* یا *j* بزرگ‌تر از ``len(s)`` باشند، از ``len(s)`` استفاده کنید." msgid "If *i* is greater than or equal to *j*, the slice is empty." -msgstr "" +msgstr "اگر *i* بزرگ‌تر یا مساوی *j* باشد، برش خالی است." -msgid "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words, the indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but never including *j*). When *k* is positive, *i* and *j* are reduced to ``len(s)`` if they are greater. When *k* is negative, *i* and *j* are reduced to ``len(s) - 1`` if they are greater. If *i* or *j* are omitted or ``None``, they become \"end\" values (which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is ``None``, it is treated like ``1``." +msgid "" +"The slice of *s* from *i* to *j* with step *k* is defined as the sequence of items " +"with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other words, the " +"indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is " +"reached (but never including *j*). When *k* is positive, *i* and *j* are reduced to " +"``len(s)`` if they are greater. When *k* is negative, *i* and *j* are reduced to " +"``len(s) - 1`` if they are greater. If *i* or *j* are omitted or ``None``, they " +"become \"end\" values (which end depends on the sign of *k*). Note, *k* cannot be " +"zero. If *k* is ``None``, it is treated like ``1``." msgstr "" +"برش *s* از *i* تا *j* با گام *k* به‌صورت دنباله‌ای از آیتم‌ها با اندیس ``x = i + n*k`` " +"تعریف می‌شود که در آن ``0 <= n < (j-i)/k``. به عبارت دیگر، اندیس‌ها ``i``، ``i+k``، " +"``i+2*k``، ``i+3*k`` و به همین ترتیب هستند و با رسیدن به *j* متوقف می‌شوند (اما هرگز " +"*j* را شامل نمی‌شوند). وقتی *k* مثبت است، *i* و *j* در صورت بزرگ‌تر بودن به ``len(s)`` " +"کاهش می‌یابند. وقتی *k* منفی است، *i* و *j* در صورت بزرگ‌تر بودن به ``len(s) - 1`` کاهش " +"می‌یابند. اگر *i* یا *j* ذکر نشده باشند یا ``None`` باشند، به مقادیر «انتها» تبدیل " +"می‌شوند (اینکه کدام انتها باشد به علامت *k* بستگی دارد). توجه کنید که *k* نمی‌تواند صفر " +"باشد. اگر *k* برابر ``None`` باشد، مانند ``1`` در نظر گرفته می‌شود." -msgid "Concatenating immutable sequences always results in a new object. This means that building up a sequence by repeated concatenation will have a quadratic runtime cost in the total sequence length. To get a linear runtime cost, you must switch to one of the alternatives below:" +msgid "" +"Concatenating immutable sequences always results in a new object. This means that " +"building up a sequence by repeated concatenation will have a quadratic runtime cost in " +"the total sequence length. To get a linear runtime cost, you must switch to one of " +"the alternatives below:" msgstr "" +"الحاق دنباله‌های تغییرناپذیر همیشه به یک شیء جدید منجر می‌شود. این بدان معناست که ساخت " +"یک دنباله از طریق الحاق‌های مکرر، هزینه ران‌تایمی درجه دوم نسبت به طول کل دنباله خواهد " +"داشت. برای دستیابی به هزینه ران‌تایم خطی، باید به یکی از جایگزین‌های زیر روی آورید:" -msgid "if concatenating :class:`str` objects, you can build a list and use :meth:`str.join` at the end or else write to an :class:`io.StringIO` instance and retrieve its value when complete" +msgid "" +"if concatenating :class:`str` objects, you can build a list and use :meth:`str.join` " +"at the end or else write to an :class:`io.StringIO` instance and retrieve its value " +"when complete" msgstr "" +"اگر در حال الحاق شیءهای :class:`str` هستید، می‌توانید یک فهرست بسازید و در پایان " +"از :meth:`str.join` استفاده کنید، یا در غیر این صورت در یک نمونه " +"از :class:`io.StringIO` بنویسید و پس از اتمام، مقدار آن را بازیابی کنید" -msgid "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` object. :class:`bytearray` objects are mutable and have an efficient overallocation mechanism" +msgid "" +"if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes.join` " +"or :class:`io.BytesIO`, or you can do in-place concatenation with a :class:`bytearray` " +"object. :class:`bytearray` objects are mutable and have an efficient overallocation " +"mechanism" msgstr "" +"اگر در حال الحاق اشیاء :class:`bytes` هستید، می‌توانید به همین ترتیب " +"از :meth:`bytes.join` یا :class:`io.BytesIO` استفاده کنید، یا می‌توانید الحاق درجا را " +"با یک شیء :class:`bytearray` انجام دهید. اشیاء :class:`bytearray` تغییرپذیر هستند و " +"دارای یک سازوکار کارآمد تخصیص بیش از حد هستند" msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" -msgstr "" +msgstr "اگر اشیاء :class:`tuple` را الحاق می‌کنید، در عوض یک :class:`list` را گسترش دهید" msgid "for other types, investigate the relevant class documentation" -msgstr "" +msgstr "برای سایر انواع، مستندات کلاس مربوطه را بررسی کنید" -msgid "Some sequence types (such as :class:`range`) only support item sequences that follow specific patterns, and hence don't support sequence concatenation or repetition." +msgid "" +"Some sequence types (such as :class:`range`) only support item sequences that follow " +"specific patterns, and hence don't support sequence concatenation or repetition." msgstr "" +"برخی از انواع دنباله (مانند :class:`range`) تنها از دنباله‌هایی از آیتم‌ها که از الگوهای " +"خاصی پیروی می‌کنند پشتیبانی می‌کنند و در نتیجه از الحاق یا تکرار دنباله پشتیبانی نمی‌کنند." msgid "An :exc:`IndexError` is raised if *i* is outside the sequence range." -msgstr "" +msgstr "اگر *i* خارج از بازه‌ی دنباله باشد، یک :exc:`IndexError` پرتاب می‌شود." msgid "Sequence Methods" -msgstr "" +msgstr "متدهای دنباله" msgid "Sequence types also support the following methods:" -msgstr "" +msgstr "انواع دنباله همچنین از متدهای زیر پشتیبانی می‌کنند:" msgid "Return the total number of occurrences of *value* in *sequence*." -msgstr "" +msgstr "تعداد کل تکرارهای *value* در *sequence* را بازمی‌گرداند." msgid "Return the index of the first occurrence of *value* in *sequence*." -msgstr "" +msgstr "اندیس اولین وقوع *value* در *sequence* را برمی‌گرداند." msgid "Raises :exc:`ValueError` if *value* is not found in *sequence*." -msgstr "" +msgstr "اگر *مقدار* در *دنباله* یافت نشود، :exc:`ValueError` پرتاب می‌شود." -msgid "The *start* or *stop* arguments allow for efficient searching of subsections of the sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to ``start + sequence[start:stop].index(value)``, only without copying any data." +msgid "" +"The *start* or *stop* arguments allow for efficient searching of subsections of the " +"sequence, beginning at *start* and ending at *stop*. This is roughly equivalent to " +"``start + sequence[start:stop].index(value)``, only without copying any data." msgstr "" +"آرگومان‌های *start* یا *stop* امکان جستجوی کارآمد در زیربخش‌هایی از دنباله را فراهم " +"می‌کنند؛ جستجو از *start* آغاز شده و در *stop* پایان می‌یابد. این عمل تقریباً معادل " +"``start + sequence[start:stop].index(value)`` است، فقط بدون آنکه هیچ داده‌ای کپی شود." msgid "Not all sequence types support passing the *start* and *stop* arguments." -msgstr "" +msgstr "همه انواع دنباله از ارسال آرگومان‌های *start* و *stop* پشتیبانی نمی‌کنند." msgid "Immutable Sequence Types" -msgstr "" +msgstr "انواع دنباله‌های تغییرناپذیر" -msgid "The only operation that immutable sequence types generally implement that is not also implemented by mutable sequence types is support for the :func:`hash` built-in." +msgid "" +"The only operation that immutable sequence types generally implement that is not also " +"implemented by mutable sequence types is support for the :func:`hash` built-in." msgstr "" +"تنها عملیاتی که انواع دنباله‌ی تغییرناپذیر به‌طور کلی پیاده‌سازی می‌کنند و توسط انواع " +"دنباله‌ی تغییرپذیر نیز پیاده‌سازی نمی‌شود، پشتیبانی از تابع توکار :func:`hash` است." -msgid "This support allows immutable sequences, such as :class:`tuple` instances, to be used as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances." +msgid "" +"This support allows immutable sequences, such as :class:`tuple` instances, to be used " +"as :class:`dict` keys and stored in :class:`set` and :class:`frozenset` instances." msgstr "" +"این پشتیبانی اجازه می‌دهد دنباله‌های تغییرناپذیر، مانند نمونه‌های :class:`tuple`، به‌عنوان " +"کلیدهای :class:`dict` استفاده شوند و در نمونه‌های :class:`set` و :class:`frozenset` " +"ذخیره شوند." -msgid "Attempting to hash an immutable sequence that contains unhashable values will result in :exc:`TypeError`." +msgid "" +"Attempting to hash an immutable sequence that contains unhashable values will result " +"in :exc:`TypeError`." msgstr "" +"تلاش برای هش کردن یک دنباله‌ی تغییرناپذیر که حاوی مقادیر هش‌ناپذیر باشد، منجر " +"به :exc:`TypeError` خواهد شد." msgid "Mutable Sequence Types" -msgstr "" +msgstr "انواع دنباله‌های تغییرپذیر" -msgid "The operations in the following table are defined on mutable sequence types. The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to correctly implement these operations on custom sequence types." +msgid "" +"The operations in the following table are defined on mutable sequence types. " +"The :class:`collections.abc.MutableSequence` ABC is provided to make it easier to " +"correctly implement these operations on custom sequence types." msgstr "" +"عملیات‌های جدول زیر بر روی انواع دنباله تغییرپذیر تعریف شده‌اند. برای آسان‌تر شدن " +"پیاده‌سازی صحیح این عملیات‌ها بر روی انواع دنباله سفارشی، کلاس پایه انتزاعی " +"(ABC) :class:`collections.abc.MutableSequence` فراهم شده است." -msgid "In the table *s* is an instance of a mutable sequence type, *t* is any iterable object and *x* is an arbitrary object that meets any type and value restrictions imposed by *s* (for example, :class:`bytearray` only accepts integers that meet the value restriction ``0 <= x <= 255``)." +msgid "" +"In the table *s* is an instance of a mutable sequence type, *t* is any iterable object " +"and *x* is an arbitrary object that meets any type and value restrictions imposed by " +"*s* (for example, :class:`bytearray` only accepts integers that meet the value " +"restriction ``0 <= x <= 255``)." msgstr "" +"در جدول، *s* نمونه‌ای از یک نوع دنباله‌ی تغییرپذیر است، *t* هر شیء پیمایش‌پذیری است و *x* " +"شیءی دلخواه است که تمام محدودیت‌های نوع و مقدار اعمال‌شده توسط *s* را برآورده می‌کند " +"(برای مثال، :class:`bytearray` تنها اعداد صحیحی را می‌پذیرد که محدودیت مقدار ``0 <= x " +"<= 255`` را برآورده کنند)." msgid "``s[i] = x``" -msgstr "" +msgstr "``s[i] = x``" msgid "item *i* of *s* is replaced by *x*" -msgstr "" +msgstr "آیتم *i* از *s* با *x* جایگزین می‌شود" msgid "``del s[i]``" -msgstr "" +msgstr "``del s[i]``" msgid "removes item *i* of *s*" -msgstr "" +msgstr "آیتم *i* از *s* را حذف می‌کند" msgid "``s[i:j] = t``" -msgstr "" +msgstr "``s[i:j] = t``" msgid "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" -msgstr "" +msgstr "برشی از *s* از *i* تا *j* با محتوای پیمایش‌پذیر *t* جایگزین می‌شود" msgid "``del s[i:j]``" -msgstr "" +msgstr "``del s[i:j]``" msgid "removes the elements of ``s[i:j]`` from the list (same as ``s[i:j] = []``)" -msgstr "" +msgstr "المان‌های ``s[i:j]`` را از فهرست حذف می‌کند (همانند ``s[i:j] = []``)" msgid "``s[i:j:k] = t``" -msgstr "" +msgstr "``s[i:j:k] = t``" msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" -msgstr "" +msgstr "المان‌های ``s[i:j:k]`` با المان‌های *t* جایگزین می‌شوند" msgid "``del s[i:j:k]``" -msgstr "" +msgstr "``del s[i:j:k]``" msgid "removes the elements of ``s[i:j:k]`` from the list" -msgstr "" +msgstr "المان‌های ``s[i:j:k]`` را از فهرست حذف می‌کند" msgid "``s += t``" -msgstr "" +msgstr "``s += t``" -msgid "extends *s* with the contents of *t* (for the most part the same as ``s[len(s):len(s)] = t``)" -msgstr "" +msgid "" +"extends *s* with the contents of *t* (for the most part the same as ``s[len(s):len(s)] " +"= t``)" +msgstr "*s* را با محتویات *t* گسترش می‌دهد (عمدتاً همانند ``s[len(s):len(s)] = t``)" msgid "``s *= n``" -msgstr "" +msgstr "``s *= n``" msgid "updates *s* with its contents repeated *n* times" -msgstr "" +msgstr "*s* را با محتوای خود که *n* بار تکرار شده است به‌روزرسانی می‌کند" -msgid "If *k* is not equal to ``1``, *t* must have the same length as the slice it is replacing." +msgid "" +"If *k* is not equal to ``1``, *t* must have the same length as the slice it is " +"replacing." msgstr "" +"اگر *k* برابر با ``1`` نباشد، *t* باید همان طول برشی را داشته باشد که جایگزین آن می‌شود." -msgid "The value *n* is an integer, or an object implementing :meth:`~object.__index__`. Zero and negative values of *n* clear the sequence. Items in the sequence are not copied; they are referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-common`." +msgid "" +"The value *n* is an integer, or an object implementing :meth:`~object.__index__`. " +"Zero and negative values of *n* clear the sequence. Items in the sequence are not " +"copied; they are referenced multiple times, as explained for ``s * n`` " +"under :ref:`typesseq-common`." msgstr "" +"مقدار *n* یک عدد صحیح است، یا شیءای که :meth:`~object.__index__` را پیاده‌سازی می‌کند. " +"مقادیر صفر و منفیِ *n* دنباله را خالی می‌کنند. آیتم‌های موجود در دنباله کپی نمی‌شوند؛ " +"بلکه چندین بار به آن‌ها ارجاع داده می‌شود، همان‌طور که برای ``s * n`` در :ref:`typesseq-" +"common` توضیح داده شده است." msgid "Mutable Sequence Methods" -msgstr "" +msgstr "متدهای دنباله‌های تغییرپذیر" msgid "Mutable sequence types also support the following methods:" -msgstr "" +msgstr "انواع دنباله‌های تغییرپذیر همچنین از متدهای زیر پشتیبانی می‌کنند:" -msgid "Append *value* to the end of the sequence. This is equivalent to writing ``seq[len(seq):len(seq)] = [value]``." +msgid "" +"Append *value* to the end of the sequence. This is equivalent to writing " +"``seq[len(seq):len(seq)] = [value]``." msgstr "" +"*value* را به انتهای دنباله اضافه می‌کند. این معادل نوشتن ``seq[len(seq):len(seq)] = " +"[value]`` است." -msgid "Remove all items from *sequence*. This is equivalent to writing ``del sequence[:]``." -msgstr "" +msgid "" +"Remove all items from *sequence*. This is equivalent to writing ``del sequence[:]``." +msgstr "همه آیتم‌های *دنباله* را حذف می‌کند. این کار معادل نوشتن ``del sequence[:]`` است." -msgid "Create a shallow copy of *sequence*. This is equivalent to writing ``sequence[:]``." -msgstr "" +msgid "" +"Create a shallow copy of *sequence*. This is equivalent to writing ``sequence[:]``." +msgstr "یک کپی سطحی از *دنباله* بسازید. این معادل نوشتن ``sequence[:]`` است." -msgid "The :meth:`!copy` method is not part of the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types provide it." +msgid "" +"The :meth:`!copy` method is not part of " +"the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most concrete " +"mutable sequence types provide it." msgstr "" +"متد :meth:`!copy` بخشی از :class:`~collections.abc.MutableSequence` :class:`~abc.ABC` " +"نیست، اما بیشتر انواع عینی توالی‌های تغییرپذیر آن را فراهم می‌کنند." -msgid "Extend *sequence* with the contents of *iterable*. For the most part, this is the same as writing ``seq[len(seq):len(seq)] = iterable``." +msgid "" +"Extend *sequence* with the contents of *iterable*. For the most part, this is the same " +"as writing ``seq[len(seq):len(seq)] = iterable``." msgstr "" +"*sequence* را با محتوای *iterable* گسترش می‌دهد. در بیشتر موارد، این همانند نوشتن " +"``seq[len(seq):len(seq)] = iterable`` است." -msgid "Insert *value* into *sequence* at the given *index*. This is equivalent to writing ``sequence[index:index] = [value]``." +msgid "" +"Insert *value* into *sequence* at the given *index*. This is equivalent to writing " +"``sequence[index:index] = [value]``." msgstr "" +"*مقدار* را در *دنباله* در اندیس داده‌شده درج می‌کند. این معادل نوشتنِ " +"``sequence[index:index] = [value]`` است." -msgid "Retrieve the item at *index* and also removes it from *sequence*. By default, the last item in *sequence* is removed and returned." +msgid "" +"Retrieve the item at *index* and also removes it from *sequence*. By default, the last " +"item in *sequence* is removed and returned." msgstr "" +"آیتم واقع در *index* را بازیابی می‌کند و همچنین آن را از *sequence* حذف می‌کند. به‌طور " +"پیش‌فرض، آخرین آیتم در *sequence* حذف و بازگردانده می‌شود." msgid "Remove the first item from *sequence* where ``sequence[i] == value``." -msgstr "" +msgstr "اولین آیتمی از *دنباله* را که در آن ``sequence[i] == value`` است، حذف کنید." -msgid "Reverse the items of *sequence* in place. This method maintains economy of space when reversing a large sequence. To remind users that it operates by side-effect, it returns ``None``." +msgid "" +"Reverse the items of *sequence* in place. This method maintains economy of space when " +"reversing a large sequence. To remind users that it operates by side-effect, it " +"returns ``None``." msgstr "" +"آیتم‌های *دنباله* را درجا وارونه می‌کند. این متد هنگام وارونه‌کردن یک دنباله بزرگ، " +"صرفه‌جویی در فضا را حفظ می‌کند. برای یادآوری به کاربران اینکه این متد از طریق اثر جانبی " +"عمل می‌کند، مقدار ``None`` را بازمی‌گرداند." msgid "Lists" -msgstr "" +msgstr "فهرست‌ها" -msgid "Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application)." +msgid "" +"Lists are mutable sequences, typically used to store collections of homogeneous items " +"(where the precise degree of similarity will vary by application)." msgstr "" +"فهرست‌ها دنباله‌های تغییرپذیری هستند که معمولاً برای ذخیره مجموعه‌هایی از آیتم‌های همگن " +"استفاده می‌شوند (که میزان دقیق شباهت آن‌ها بسته به کاربرد متفاوت خواهد بود)." msgid "Lists may be constructed in several ways:" -msgstr "" +msgstr "فهرست‌ها را می‌توان به چند روش ساخت:" msgid "Using a pair of square brackets to denote the empty list: ``[]``" -msgstr "" +msgstr "استفاده از یک جفت براکت مربع برای نشان دادن فهرست خالی: ``[]``" msgid "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" -msgstr "" +msgstr "با استفاده از کروشه‌ها و جدا کردن آیتم‌ها با کاما: ``[a]``، ``[a, b, c]``" msgid "Using a list comprehension: ``[x for x in iterable]``" -msgstr "" +msgstr "با استفاده از یک درک فهرستی: ``[x for x in iterable]``" msgid "Using the type constructor: ``list()`` or ``list(iterable)``" -msgstr "" +msgstr "با استفاده از سازنده‌ی نوع: ``list()`` یا ``list(iterable)``" -msgid "The constructor builds a list whose items are the same and in the same order as *iterable*'s items. *iterable* may be either a sequence, a container that supports iteration, or an iterator object. If *iterable* is already a list, a copy is made and returned, similar to ``iterable[:]``. For example, ``list('abc')`` returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, the constructor creates a new empty list, ``[]``." +msgid "" +"The constructor builds a list whose items are the same and in the same order as " +"*iterable*'s items. *iterable* may be either a sequence, a container that supports " +"iteration, or an iterator object. If *iterable* is already a list, a copy is made and " +"returned, similar to ``iterable[:]``. For example, ``list('abc')`` returns ``['a', " +"'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If no argument is given, " +"the constructor creates a new empty list, ``[]``." msgstr "" +"سازنده فهرستی می‌سازد که آیتم‌های آن همان آیتم‌های *iterable* و در همان ترتیبِ آن‌ها هستند. " +"*iterable* می‌تواند یک دنباله، ظرفی که از تکرار پشتیبانی می‌کند، یا یک شیء پیمایش‌گر باشد. " +"اگر *iterable* از قبل یک فهرست باشد، نسخه‌ای از آن ساخته شده و بازگردانده می‌شود؛ مشابه " +"``iterable[:]``. برای مثال، ``list('abc')`` مقدار ``['a', 'b', 'c']`` را برمی‌گرداند و " +"``list( (1, 2, 3) )`` مقدار ``[1, 2, 3]`` را برمی‌گرداند. اگر هیچ آرگومانی داده نشود، " +"سازنده یک فهرست خالی جدید، یعنی ``[]``، ایجاد می‌کند." msgid "Many other operations also produce lists, including the :func:`sorted` built-in." -msgstr "" +msgstr "بسیاری از عملیات دیگر نیز فهرست تولید می‌کنند، از جمله تابع توکار :func:`sorted`." msgid "Lists are :ref:`generic ` over the types of their items." -msgstr "" +msgstr "فهرست‌ها نسبت به نوع آیتم‌های خود :ref:`عام ` هستند." -msgid "Lists implement all of the :ref:`common ` and :ref:`mutable ` sequence operations. Lists also provide the following additional method:" +msgid "" +"Lists implement all of the :ref:`common ` and :ref:`mutable ` sequence operations. Lists also provide the following additional method:" msgstr "" +"فهرست‌ها همه‌ی عملیات دنباله‌ی :ref:`مشترک ` و :ref:`تغییرپذیر ` را پیاده‌سازی می‌کنند. فهرست‌ها همچنین متد اضافی زیر را فراهم می‌کنند:" -msgid "This method sorts the list in place, using only ``<`` comparisons between items. Exceptions are not suppressed - if any comparison operations fail, the entire sort operation will fail (and the list will likely be left in a partially modified state)." +msgid "" +"This method sorts the list in place, using only ``<`` comparisons between items. " +"Exceptions are not suppressed - if any comparison operations fail, the entire sort " +"operation will fail (and the list will likely be left in a partially modified state)." msgstr "" +"این متد فهرست را درجا مرتب می‌کند و تنها از مقایسه‌های ``<`` میان آیتم‌ها استفاده می‌کند. " +"استثناها سرکوب نمی‌شوند - اگر هر یک از عملیات مقایسه شکست بخورد، تمام عملیات مرتب‌سازی " +"با شکست مواجه خواهد شد (و به احتمال زیاد فهرست در حالتی تا حدی تغییر یافته باقی خواهد " +"ماند)." -msgid ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:`keyword-only arguments `):" +msgid "" +":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:`keyword-" +"only arguments `):" msgstr "" +":meth:`sort` دو آرگومان می‌پذیرد که تنها می‌توان آن‌ها را به صورت کلیدواژه‌ای پاس داد " +"(:ref:`آرگومان‌های فقط-کلیدواژه‌ای `):" -msgid "*key* specifies a function of one argument that is used to extract a comparison key from each list element (for example, ``key=str.lower``). The key corresponding to each item in the list is calculated once and then used for the entire sorting process. The default value of ``None`` means that list items are sorted directly without calculating a separate key value." +msgid "" +"*key* specifies a function of one argument that is used to extract a comparison key " +"from each list element (for example, ``key=str.lower``). The key corresponding to each " +"item in the list is calculated once and then used for the entire sorting process. The " +"default value of ``None`` means that list items are sorted directly without " +"calculating a separate key value." msgstr "" +"*key* تابعی با یک آرگومان را مشخص می‌کند که برای استخراج کلید مقایسه از هر المان فهرست " +"به کار می‌رود (برای مثال، ``key=str.lower``). کلید متناظر با هر آیتم در فهرست فقط یک " +"بار محاسبه می‌شود و سپس در تمام فرایند مرتب‌سازی از آن استفاده می‌شود. مقدار پیش‌فرض " +"``None`` بدین معناست که آیتم‌های فهرست مستقیماً و بدون محاسبه مقدار کلید جداگانه مرتب " +"می‌شوند." -msgid "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style *cmp* function to a *key* function." +msgid "" +"The :func:`functools.cmp_to_key` utility is available to convert a 2.x style *cmp* " +"function to a *key* function." msgstr "" +"ابزار :func:`functools.cmp_to_key` برای تبدیل یک تابع *cmp* به سبک 2.x به یک تابع " +"*key* در دسترس است." -msgid "*reverse* is a boolean value. If set to ``True``, then the list elements are sorted as if each comparison were reversed." +msgid "" +"*reverse* is a boolean value. If set to ``True``, then the list elements are sorted " +"as if each comparison were reversed." msgstr "" +"*reverse* یک مقدار بولی است. اگر روی ``True`` تنظیم شود، المان‌های فهرست به‌گونه‌ای مرتب " +"می‌شوند که انگار هر مقایسه معکوس شده باشد." -msgid "This method modifies the sequence in place for economy of space when sorting a large sequence. To remind users that it operates by side effect, it does not return the sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance)." +msgid "" +"This method modifies the sequence in place for economy of space when sorting a large " +"sequence. To remind users that it operates by side effect, it does not return the " +"sorted sequence (use :func:`sorted` to explicitly request a new sorted list instance)." msgstr "" +"این متد برای صرفه‌جویی در فضا هنگام مرتب‌سازی یک دنباله‌ی بزرگ، دنباله را درجا تغییر " +"می‌دهد. برای یادآوری این نکته به کاربران که این متد با اثر جانبی عمل می‌کند، دنباله‌ی " +"مرتب‌شده را برنمی‌گرداند (برای درخواست صریح یک نمونه‌ی جدید از فهرست مرتب‌شده " +"از :func:`sorted` استفاده کنید)." -msgid "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by department, then by salary grade)." +msgid "" +"The :meth:`sort` method is guaranteed to be stable. A sort is stable if it guarantees " +"not to change the relative order of elements that compare equal --- this is helpful " +"for sorting in multiple passes (for example, sort by department, then by salary grade)." msgstr "" +"تضمین می‌شود که متد :meth:`sort` پایدار باشد. یک مرتب‌سازی زمانی پایدار است که تضمین کند " +"ترتیب نسبی عناصری را که در مقایسه برابرند تغییر ندهد --- این برای مرتب‌سازی در چند گذر " +"مفید است (برای مثال، مرتب‌سازی بر اساس دپارتمان و سپس بر اساس رتبه حقوقی)." msgid "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" +"برای مثال‌های مرتب‌سازی و یک آموزش مختصر مرتب‌سازی، به :ref:`sortinghowto` مراجعه کنید." -msgid "While a list is being sorted, the effect of attempting to mutate, or even inspect, the list is undefined. The C implementation of Python makes the list appear empty for the duration, and raises :exc:`ValueError` if it can detect that the list has been mutated during a sort." +msgid "" +"While a list is being sorted, the effect of attempting to mutate, or even inspect, the " +"list is undefined. The C implementation of Python makes the list appear empty for the " +"duration, and raises :exc:`ValueError` if it can detect that the list has been mutated " +"during a sort." msgstr "" +"در حالی که یک فهرست در حال مرتب‌سازی است، اثر تلاش برای تغییر دادن یا حتی بازرسی کردن " +"آن تعریف‌نشده است. پیاده‌سازی C پایتون در تمام این مدت فهرست را خالی نشان می‌دهد و اگر " +"بتواند تشخیص دهد که فهرست در حین مرتب‌سازی تغییر داده شده است، :exc:`ValueError` را " +"پرتاب می‌کند." -msgid "For detailed information on thread-safety guarantees for :class:`list` objects, see :ref:`thread-safety-list`." +msgid "" +"For detailed information on thread-safety guarantees for :class:`list` objects, " +"see :ref:`thread-safety-list`." msgstr "" +"برای اطلاعات مفصل درباره تضمین‌های ایمنی نخ برای اشیاء :class:`list`، به :ref:`thread-" +"safety-list` مراجعه کنید." msgid "Tuples" -msgstr "" +msgstr "تاپل‌ها" -msgid "Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a :class:`set` or :class:`dict` instance)." +msgid "" +"Tuples are immutable sequences, typically used to store collections of heterogeneous " +"data (such as the 2-tuples produced by the :func:`enumerate` built-in). Tuples are " +"also used for cases where an immutable sequence of homogeneous data is needed (such as " +"allowing storage in a :class:`set` or :class:`dict` instance)." msgstr "" +"تاپل‌هادنباله‌های تغییرناپذیری هستند که معمولاً برای ذخیره مجموعه‌هایی از داده‌های " +"ناهمگون (مانند تاپل‌های ۲تایی تولیدشده توسط تابع توکار :func:`enumerate`) به کار " +"می‌روند. از تاپل‌ها همچنین در مواردی استفاده می‌شود که به یک دنباله‌ی تغییرناپذیر از " +"داده‌های همگون نیاز باشد (مانند امکان ذخیره شدن در یک نمونه از :class:`set` " +"یا :class:`dict`)." msgid "Tuples may be constructed in a number of ways:" -msgstr "" +msgstr "تاپل‌ها را می‌توان به روش‌های گوناگونی ساخت:" msgid "Using a pair of parentheses to denote the empty tuple: ``()``" -msgstr "" +msgstr "استفاده از یک جفت پرانتز برای نشان دادن تاپلخالی: ``()``" msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" +"استفاده از یک ویرگول انتهایی برای یک تاپل تک‌عضوی (singleton tuple): ``a,`` یا ``(a,)``" msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" -msgstr "" +msgstr "جدا کردن آیتم‌ها با ویرگول: ``a, b, c`` یا ``(a, b, c)``" msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" -msgstr "" +msgstr "با استفاده از تابع توکار :func:`tuple`: ``tuple()`` یا ``tuple(iterable)``" -msgid "The constructor builds a tuple whose items are the same and in the same order as *iterable*'s items. *iterable* may be either a sequence, a container that supports iteration, or an iterator object. If *iterable* is already a tuple, it is returned unchanged. For example, ``tuple('abc')`` returns ``('a', 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a new empty tuple, ``()``." +msgid "" +"The constructor builds a tuple whose items are the same and in the same order as " +"*iterable*'s items. *iterable* may be either a sequence, a container that supports " +"iteration, or an iterator object. If *iterable* is already a tuple, it is returned " +"unchanged. For example, ``tuple('abc')`` returns ``('a', 'b', 'c')`` and ``tuple( [1, " +"2, 3] )`` returns ``(1, 2, 3)``. If no argument is given, the constructor creates a " +"new empty tuple, ``()``." msgstr "" +"سازنده تاپلی می‌سازد که آیتم‌هایش با آیتم‌های *iterable* یکسان و به همان ترتیب هستند. " +"*iterable* می‌تواند یک دنباله، یک ظرف که از تکرار پشتیبانی می‌کند، یا یک شیء پیمایش‌گر " +"(iterator) باشد. اگر *iterable* از قبل خودش یک تاپل باشد، بدون تغییر بازگردانده می‌شود. " +"برای مثال، ``tuple('abc')`` مقدار ``('a', 'b', 'c')`` را برمی‌گرداند و ``tuple( [1, 2, " +"3] )`` مقدار ``(1, 2, 3)`` را برمی‌گرداند. اگر آرگومانی داده نشود، سازنده یک تاپل خالی " +"جدید، یعنی ``()``، ایجاد می‌کند." -msgid "Note that it is actually the comma which makes a tuple, not the parentheses. The parentheses are optional, except in the empty tuple case, or when they are needed to avoid syntactic ambiguity. For example, ``f(a, b, c)`` is a function call with three arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole argument." +msgid "" +"Note that it is actually the comma which makes a tuple, not the parentheses. The " +"parentheses are optional, except in the empty tuple case, or when they are needed to " +"avoid syntactic ambiguity. For example, ``f(a, b, c)`` is a function call with three " +"arguments, while ``f((a, b, c))`` is a function call with a 3-tuple as the sole " +"argument." msgstr "" +"توجه داشته باشید که در واقع ویرگول است که تاپلرا می‌سازد، نه پرانتزها. " +"پرانتزها اختیاری هستند، مگر در حالت تاپل خالی، یا زمانی که برای پرهیز از ابهام نحوی " +"ضروری باشند. برای مثال، ``f(a, b, c)`` فراخوانی تابعی با سه آرگومان است، در حالی که " +"``f((a, b, c))`` فراخوانی تابعی با یک تاپل سه‌تایی به‌عنوان تنها آرگومان آن است." msgid "Tuples implement all of the :ref:`common ` sequence operations." msgstr "" +"تاپل‌ها (tuples) همه‌ی عملیات :ref:`مشترک ` دنباله‌ها را پیاده‌سازی می‌کنند." -msgid "Tuples are :ref:`generic ` over the types of their contents. For more information, refer to :ref:`the typing documentation on annotating tuples `." +msgid "" +"Tuples are :ref:`generic ` over the types of their contents. For more " +"information, refer to :ref:`the typing documentation on annotating tuples `." msgstr "" +"تاپل‌ها نسبت به نوع‌های محتوای خود :ref:`عام ` هستند. برای اطلاعات بیشتر، " +"به :ref:`مستندات typing درباره حاشیه‌نویسی تاپل‌ها ` مراجعه کنید." -msgid "For heterogeneous collections of data where access by name is clearer than access by index, :func:`collections.namedtuple` may be a more appropriate choice than a simple tuple object." +msgid "" +"For heterogeneous collections of data where access by name is clearer than access by " +"index, :func:`collections.namedtuple` may be a more appropriate choice than a simple " +"tuple object." msgstr "" +"برای مجموعه‌های داده‌ی ناهمگونی که در آن‌ها دسترسی با نام روشن‌تر از دسترسی با اندیس است، " +"ممکن است :func:`collections.namedtuple` انتخاب مناسب‌تری نسبت به یک شیء تاپل ساده باشد." msgid "Ranges" -msgstr "" +msgstr "بازه‌ها" -msgid "The :class:`range` type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in :keyword:`for` loops." +msgid "" +"The :class:`range` type represents an immutable sequence of numbers and is commonly " +"used for looping a specific number of times in :keyword:`for` loops." msgstr "" +"نوع :class:`range` دنباله‌ای تغییرناپذیر از اعداد را نشان می‌دهد و معمولاً برای تکرار به " +"تعداد مشخصی در حلقه‌های :keyword:`for` استفاده می‌شود." -msgid "The arguments to the range constructor must be integers (either built-in :class:`int` or any object that implements the :meth:`~object.__index__` special method). If the *step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised." +msgid "" +"The arguments to the range constructor must be integers (either built-in :class:`int` " +"or any object that implements the :meth:`~object.__index__` special method). If the " +"*step* argument is omitted, it defaults to ``1``. If the *start* argument is omitted, " +"it defaults to ``0``. If *step* is zero, :exc:`ValueError` is raised." msgstr "" +"آرگومان‌های سازنده‌ی range باید اعداد صحیح باشند (یا :class:`int` توکار، یا هر شیءای که " +"متد ویژه‌ی :meth:`~object.__index__` را پیاده‌سازی کند). اگر آرگومان *step* ذکر نشده " +"باشد، مقدار پیش‌فرض آن ``1`` است. اگر آرگومان *start* ذکر نشده باشد، مقدار پیش‌فرض آن " +"``0`` است. اگر *step* صفر باشد، استثنای :exc:`ValueError` پرتاب می‌شود." -msgid "For a positive *step*, the contents of a range ``r`` are determined by the formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." +msgid "" +"For a positive *step*, the contents of a range ``r`` are determined by the formula " +"``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" +"برای یک *گام* مثبت، محتویات یک بازه (range) به نام ``r`` بر اساس فرمول ``r[i] = start " +"+ step*i`` تعیین می‌شود که در آن ``i >= 0`` و ``r[i] < stop`` است." -msgid "For a negative *step*, the contents of the range are still determined by the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``." +msgid "" +"For a negative *step*, the contents of the range are still determined by the formula " +"``r[i] = start + step*i``, but the constraints are ``i >= 0`` and ``r[i] > stop``." msgstr "" +"برای یک *گام* منفی، محتوای بازه همچنان با فرمول ``r[i] = start + step*i`` تعیین می‌شود، " +"اما محدودیت‌ها ``i >= 0`` و ``r[i] > stop`` هستند." -msgid "A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do support negative indices, but these are interpreted as indexing from the end of the sequence determined by the positive indices." +msgid "" +"A range object will be empty if ``r[0]`` does not meet the value constraint. Ranges do " +"support negative indices, but these are interpreted as indexing from the end of the " +"sequence determined by the positive indices." msgstr "" +"اگر ``r[0]`` محدودیت مقدار را برآورده نکند، شیء range خالی خواهد بود. اشیاء range از " +"اندیس‌های منفی پشتیبانی می‌کنند، اما این اندیس‌ها به‌صورت اندیس‌گذاری از انتهای دنباله‌ای که " +"توسط اندیس‌های مثبت تعیین شده است تفسیر می‌شوند." -msgid "Ranges containing absolute values larger than :data:`sys.maxsize` are permitted but some features (such as :func:`len`) may raise :exc:`OverflowError`." +msgid "" +"Ranges containing absolute values larger than :data:`sys.maxsize` are permitted but " +"some features (such as :func:`len`) may raise :exc:`OverflowError`." msgstr "" +"بازه‌هایی که حاوی مقادیر مطلقی بزرگ‌تر از :data:`sys.maxsize` هستند مجازند، اما برخی " +"قابلیت‌ها (مانند :func:`len`) ممکن است :exc:`OverflowError` را پرتاب کنند." msgid "Range examples::" -msgstr "" +msgstr "مثال‌های بازه::" msgid "" ">>> list(range(10))\n" @@ -1252,413 +2241,606 @@ msgid "" ">>> list(range(1, 0))\n" "[]" msgstr "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" -msgid "Ranges implement all of the :ref:`common ` sequence operations except concatenation and repetition (due to the fact that range objects can only represent sequences that follow a strict pattern and repetition and concatenation will usually violate that pattern)." +msgid "" +"Ranges implement all of the :ref:`common ` sequence operations except " +"concatenation and repetition (due to the fact that range objects can only represent " +"sequences that follow a strict pattern and repetition and concatenation will usually " +"violate that pattern)." msgstr "" +"بازه‌ها همه‌ی عملیات دنباله‌ی :ref:`مشترک ` را به‌جز الحاق و تکرار " +"پیاده‌سازی می‌کنند (به این دلیل که اشیای بازه تنها می‌توانند دنباله‌هایی را نمایندگی کنند " +"که از یک الگوی سخت‌گیرانه پیروی می‌کنند و تکرار و الحاق معمولاً آن الگو را نقض می‌کنند)." msgid "The value of the *start* parameter (or ``0`` if the parameter was not supplied)" -msgstr "" +msgstr "مقدار پارامتر *start* (یا ``0`` اگر پارامتر داده نشده باشد)" msgid "The value of the *stop* parameter" -msgstr "" +msgstr "مقدار پارامتر *stop*" msgid "The value of the *step* parameter (or ``1`` if the parameter was not supplied)" -msgstr "" +msgstr "مقدار پارامتر *step* (یا ``1`` اگر این پارامتر ارائه نشده باشد)" -msgid "The advantage of the :class:`range` type over a regular :class:`list` or :class:`tuple` is that a :class:`range` object will always take the same (small) amount of memory, no matter the size of the range it represents (as it only stores the ``start``, ``stop`` and ``step`` values, calculating individual items and subranges as needed)." +msgid "" +"The advantage of the :class:`range` type over a regular :class:`list` " +"or :class:`tuple` is that a :class:`range` object will always take the same (small) " +"amount of memory, no matter the size of the range it represents (as it only stores the " +"``start``, ``stop`` and ``step`` values, calculating individual items and subranges as " +"needed)." msgstr "" +"مزیت نوع :class:`range` نسبت به یک :class:`list` یا :class:`tuple` معمولی این است که " +"شیء :class:`range` همیشه مقدار یکسانی (کم) از حافظه را مصرف می‌کند، بدون توجه به اندازه " +"بازه‌ای که نمایش می‌دهد (چراکه تنها مقادیر ``start``، ``stop`` و ``step`` را ذخیره می‌کند " +"و آیتم‌های منفرد و زیربازه‌ها را در صورت نیاز محاسبه می‌کند)." -msgid "Range objects implement the :class:`collections.abc.Sequence` ABC, and provide features such as containment tests, element index lookup, slicing and support for negative indices (see :ref:`typesseq`):" +msgid "" +"Range objects implement the :class:`collections.abc.Sequence` ABC, and provide " +"features such as containment tests, element index lookup, slicing and support for " +"negative indices (see :ref:`typesseq`):" msgstr "" +"اشیای بازه کلاس پایه انتزاعی :class:`collections.abc.Sequence` را پیاده‌سازی می‌کنند و " +"ویژگی‌هایی مانند آزمون‌های عضویت، یافتن اندیس المان، برش و پشتیبانی از اندیس‌های منفی را " +"فراهم می‌کنند (به :ref:`typesseq` مراجعه کنید):" -msgid "Testing range objects for equality with ``==`` and ``!=`` compares them as sequences. That is, two range objects are considered equal if they represent the same sequence of values. (Note that two range objects that compare equal might have different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" +msgid "" +"Testing range objects for equality with ``==`` and ``!=`` compares them as sequences. " +"That is, two range objects are considered equal if they represent the same sequence of " +"values. (Note that two range objects that compare equal might have " +"different :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " +"attributes, for example ``range(0) == range(2, 1, 3)`` or ``range(0, 3, 2) == range(0, " +"4, 2)``.)" msgstr "" +"آزمودن اشیاء range برای برابری با ``==`` و ``!=`` آن‌ها را به‌عنوان دنباله مقایسه می‌کند. " +"یعنی دو شیء range برابر در نظر گرفته می‌شوند اگر دنباله یکسانی از مقادیر را نمایندگی " +"کنند. (توجه داشته باشید که ممکن است دو شیء range که با هم برابر مقایسه می‌شوند، " +"ویژگی‌های :attr:`~range.start`، :attr:`~range.stop` و :attr:`~range.step` متفاوتی داشته " +"باشند؛ برای مثال ``range(0) == range(2, 1, 3)`` یا ``range(0, 3, 2) == range(0, 4, " +"2)``.)" -msgid "Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` objects for membership in constant time instead of iterating through all items." +msgid "" +"Implement the Sequence ABC. Support slicing and negative indices. Test :class:`int` " +"objects for membership in constant time instead of iterating through all items." msgstr "" +"کلاس پایه انتزاعی (ABC) دنباله را پیاده‌سازی می‌کند. از برش و اندیس‌های منفی پشتیبانی " +"می‌کند. به جای پیمایش تمام آیتم‌ها، بررسی عضویت اشیاء :class:`int` را در زمان ثابت انجام " +"می‌دهد." -msgid "Define '==' and '!=' to compare range objects based on the sequence of values they define (instead of comparing based on object identity)." +msgid "" +"Define '==' and '!=' to compare range objects based on the sequence of values they " +"define (instead of comparing based on object identity)." msgstr "" +"'==' و '!=' طوری تعریف شده‌اند که اشیای range را بر اساس دنباله‌ی مقادیری که تعریف می‌کنند " +"مقایسه کنند (به جای مقایسه بر اساس هویت شیء)." -msgid "Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes." +msgid "" +"Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` attributes." msgstr "" +"ویژگی‌های :attr:`~range.start`، :attr:`~range.stop` و :attr:`~range.step` افزوده شدند." -msgid "The `linspace recipe `_ shows how to implement a lazy version of range suitable for floating-point applications." +msgid "" +"The `linspace recipe `_ shows how to implement a lazy version of range suitable for " +"floating-point applications." msgstr "" +"`دستورالعمل linspace `_ نشان می‌دهد چگونه می‌توان نسخه‌ای تنبل از range مناسب برای کاربردهای " +"ممیز شناور پیاده‌سازی کرد." msgid "Text and Binary Sequence Type Methods Summary" -msgstr "" +msgstr "خلاصه‌ی متدهای نوع دنباله‌ی متنی و دودویی" -msgid "The following table summarizes the text and binary sequence types methods by category." -msgstr "" +msgid "" +"The following table summarizes the text and binary sequence types methods by category." +msgstr "جدول زیر متدهای انواع توالی متنی و دودویی را بر اساس دسته‌بندی خلاصه می‌کند." msgid "Category" -msgstr "" +msgstr "دسته" msgid ":class:`str` methods" -msgstr "" +msgstr ":class:`str` متدها" msgid ":class:`bytes` and :class:`bytearray` methods" -msgstr "" +msgstr "متدهای :class:`bytes` و :class:`bytearray`" msgid "Formatting" -msgstr "" +msgstr "قالب‌بندی" msgid ":meth:`str.format`" -msgstr "" +msgstr ":meth:`str.format`" msgid ":meth:`str.format_map`" -msgstr "" +msgstr ":meth:`str.format_map`" msgid ":ref:`f-strings`" -msgstr "" +msgstr ":ref:`اف‌استرینگ‌ها `" msgid ":ref:`old-string-formatting`" -msgstr "" +msgstr ":ref:`old-string-formatting`" msgid ":ref:`bytes-formatting`" -msgstr "" +msgstr ":ref:`bytes-formatting`" msgid "Searching and Replacing" -msgstr "" +msgstr "جست‌وجو و جایگزینی" msgid ":meth:`str.find`" -msgstr "" +msgstr ":meth:`str.find`" msgid ":meth:`str.rfind`" -msgstr "" +msgstr ":meth:`str.rfind`" msgid ":meth:`bytes.find`" -msgstr "" +msgstr ":meth:`bytes.find`" msgid ":meth:`bytes.rfind`" -msgstr "" +msgstr ":meth:`bytes.rfind`" msgid ":meth:`str.index`" -msgstr "" +msgstr ":meth:`str.index`" msgid ":meth:`str.rindex`" -msgstr "" +msgstr ":meth:`str.rindex`" msgid ":meth:`bytes.index`" -msgstr "" +msgstr ":meth:`bytes.index`" msgid ":meth:`bytes.rindex`" -msgstr "" +msgstr ":meth:`bytes.rindex`" msgid ":meth:`str.startswith`" -msgstr "" +msgstr ":meth:`str.startswith`" msgid ":meth:`bytes.startswith`" -msgstr "" +msgstr ":meth:`bytes.startswith`" msgid ":meth:`str.endswith`" -msgstr "" +msgstr ":meth:`str.endswith`" msgid ":meth:`bytes.endswith`" -msgstr "" +msgstr ":meth:`bytes.endswith`" msgid ":meth:`str.count`" -msgstr "" +msgstr ":meth:`str.count`" msgid ":meth:`bytes.count`" -msgstr "" +msgstr ":meth:`bytes.count`" msgid ":meth:`str.replace`" -msgstr "" +msgstr ":meth:`str.replace`" msgid ":meth:`bytes.replace`" -msgstr "" +msgstr ":meth:`bytes.replace`" msgid "Splitting and Joining" -msgstr "" +msgstr "تقسیم و الحاق" msgid ":meth:`str.split`" -msgstr "" +msgstr ":meth:`str.split`" msgid ":meth:`str.rsplit`" -msgstr "" +msgstr ":meth:`str.rsplit`" msgid ":meth:`bytes.split`" -msgstr "" +msgstr ":meth:`bytes.split`" msgid ":meth:`bytes.rsplit`" -msgstr "" +msgstr ":meth:`bytes.rsplit`" msgid ":meth:`str.splitlines`" -msgstr "" +msgstr ":meth:`str.splitlines`" msgid ":meth:`bytes.splitlines`" -msgstr "" +msgstr ":meth:`bytes.splitlines`" msgid ":meth:`str.partition`" -msgstr "" +msgstr ":meth:`str.partition`" msgid ":meth:`bytes.partition`" -msgstr "" +msgstr ":meth:`bytes.partition`" msgid ":meth:`str.rpartition`" -msgstr "" +msgstr ":meth:`str.rpartition`" msgid ":meth:`bytes.rpartition`" -msgstr "" +msgstr ":meth:`bytes.rpartition`" msgid ":meth:`str.join`" -msgstr "" +msgstr ":meth:`str.join`" msgid ":meth:`bytes.join`" -msgstr "" +msgstr ":meth:`bytes.join`" msgid "String Classification" -msgstr "" +msgstr "دسته‌بندی رشته" msgid ":meth:`str.isalpha`" -msgstr "" +msgstr ":meth:`str.isalpha`" msgid ":meth:`bytes.isalpha`" -msgstr "" +msgstr ":meth:`bytes.isalpha`" msgid ":meth:`str.isdecimal`" -msgstr "" +msgstr ":meth:`str.isdecimal`" msgid ":meth:`str.isdigit`" -msgstr "" +msgstr ":meth:`str.isdigit`" msgid ":meth:`bytes.isdigit`" -msgstr "" +msgstr ":meth:`bytes.isdigit`" msgid ":meth:`str.isnumeric`" -msgstr "" +msgstr ":meth:`str.isnumeric`" msgid ":meth:`str.isalnum`" -msgstr "" +msgstr ":meth:`str.isalnum`" msgid ":meth:`bytes.isalnum`" -msgstr "" +msgstr ":meth:`bytes.isalnum`" msgid ":meth:`str.isidentifier`" -msgstr "" +msgstr ":meth:`str.isidentifier`" msgid ":meth:`str.islower`" -msgstr "" +msgstr ":meth:`str.islower`" msgid ":meth:`bytes.islower`" -msgstr "" +msgstr ":meth:`bytes.islower`" msgid ":meth:`str.isupper`" -msgstr "" +msgstr ":meth:`str.isupper`" msgid ":meth:`bytes.isupper`" -msgstr "" +msgstr ":meth:`bytes.isupper`" msgid ":meth:`str.istitle`" -msgstr "" +msgstr ":meth:`str.istitle`" msgid ":meth:`bytes.istitle`" -msgstr "" +msgstr ":meth:`bytes.istitle`" msgid ":meth:`str.isspace`" -msgstr "" +msgstr ":meth:`str.isspace`" msgid ":meth:`bytes.isspace`" -msgstr "" +msgstr ":meth:`bytes.isspace`" msgid ":meth:`str.isprintable`" -msgstr "" +msgstr ":meth:`str.isprintable`" msgid "Case Manipulation" -msgstr "" +msgstr "تغییر حالت حروف" msgid ":meth:`str.lower`" -msgstr "" +msgstr ":meth:`str.lower`" msgid ":meth:`bytes.lower`" -msgstr "" +msgstr ":meth:`bytes.lower`" msgid ":meth:`str.upper`" -msgstr "" +msgstr ":meth:`str.upper`" msgid ":meth:`bytes.upper`" -msgstr "" +msgstr ":meth:`bytes.upper`" msgid ":meth:`str.casefold`" -msgstr "" +msgstr ":meth:`str.casefold`" msgid ":meth:`str.capitalize`" -msgstr "" +msgstr ":meth:`str.capitalize`" msgid ":meth:`bytes.capitalize`" -msgstr "" +msgstr ":meth:`bytes.capitalize`" msgid ":meth:`str.title`" -msgstr "" +msgstr ":meth:`str.title`" msgid ":meth:`bytes.title`" -msgstr "" +msgstr ":meth:`bytes.title`" msgid ":meth:`str.swapcase`" -msgstr "" +msgstr ":meth:`str.swapcase`" msgid ":meth:`bytes.swapcase`" -msgstr "" +msgstr ":meth:`bytes.swapcase`" msgid "Padding and Stripping" -msgstr "" +msgstr "پرکردن و بریدن" msgid ":meth:`str.ljust`" -msgstr "" +msgstr ":meth:`str.ljust`" msgid ":meth:`str.rjust`" -msgstr "" +msgstr ":meth:`str.rjust`" msgid ":meth:`bytes.ljust`" -msgstr "" +msgstr ":meth:`bytes.ljust`" msgid ":meth:`bytes.rjust`" -msgstr "" +msgstr ":meth:`bytes.rjust`" msgid ":meth:`str.center`" -msgstr "" +msgstr ":meth:`str.center`" msgid ":meth:`bytes.center`" -msgstr "" +msgstr ":meth:`bytes.center`" msgid ":meth:`str.expandtabs`" -msgstr "" +msgstr ":meth:`str.expandtabs`" msgid ":meth:`bytes.expandtabs`" -msgstr "" +msgstr ":meth:`bytes.expandtabs`" msgid ":meth:`str.strip`" -msgstr "" +msgstr ":meth:`str.strip`" msgid ":meth:`bytes.strip`" -msgstr "" +msgstr ":meth:`bytes.strip`" msgid ":meth:`str.lstrip`" -msgstr "" +msgstr ":meth:`str.lstrip`" msgid ":meth:`str.rstrip`" -msgstr "" +msgstr ":meth:`str.rstrip`" msgid ":meth:`bytes.lstrip`" -msgstr "" +msgstr ":meth:`bytes.lstrip`" msgid ":meth:`bytes.rstrip`" -msgstr "" +msgstr ":meth:`bytes.rstrip`" msgid ":meth:`str.removeprefix`" -msgstr "" +msgstr ":meth:`str.removeprefix`" msgid ":meth:`bytes.removeprefix`" -msgstr "" +msgstr ":meth:`bytes.removeprefix`" msgid ":meth:`str.removesuffix`" -msgstr "" +msgstr ":meth:`str.removesuffix`" msgid ":meth:`bytes.removesuffix`" -msgstr "" +msgstr ":meth:`bytes.removesuffix`" msgid "Translation and Encoding" -msgstr "" +msgstr "ترجمه و کدگذاری" msgid ":meth:`str.translate`" -msgstr "" +msgstr ":meth:`str.translate`" msgid ":meth:`bytes.translate`" -msgstr "" +msgstr ":meth:`bytes.translate`" msgid ":meth:`str.maketrans`" -msgstr "" +msgstr ":meth:`str.maketrans`" msgid ":meth:`bytes.maketrans`" -msgstr "" +msgstr ":meth:`bytes.maketrans`" msgid ":meth:`str.encode`" -msgstr "" +msgstr ":meth:`str.encode`" msgid ":meth:`bytes.decode`" -msgstr "" +msgstr ":meth:`bytes.decode`" msgid "Text Sequence Type --- :class:`str`" -msgstr "" +msgstr "نوع دنباله‌ی متنی --- :class:`str`" -msgid "Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. Strings are immutable :ref:`sequences ` of Unicode code points. String literals are written in a variety of ways:" +msgid "" +"Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`. " +"Strings are immutable :ref:`sequences ` of Unicode code points. String " +"literals are written in a variety of ways:" msgstr "" +"داده‌های متنی در پایتون با اشیاء :class:`str` یا :dfn:`رشته‌ها ` مدیریت می‌شوند. " +"رشته‌ها :ref:`دنباله‌هایی ` تغییرناپذیر از نقاط کد یونیکد هستند. رشته‌های " +"لفظیی به روش‌های گوناگونی نوشته می‌شوند:" msgid "Single quotes: ``'allows embedded \"double\" quotes'``" -msgstr "" +msgstr "علامت نقل‌قول تکی: ``'allows embedded \"double\" quotes'``" msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" -msgstr "" +msgstr "علامت نقل‌قول دوتایی: ``\"allows embedded 'single' quotes\"``" msgid "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double quotes\"\"\"``" msgstr "" +"سه‌گانه نقل‌قول‌شده: ``'''Three single quotes'''``، ``\"\"\"Three double quotes\"\"\"``" -msgid "Triple quoted strings may span multiple lines - all associated whitespace will be included in the string literal." +msgid "" +"Triple quoted strings may span multiple lines - all associated whitespace will be " +"included in the string literal." msgstr "" +"رشته‌های محصور در سه علامت نقل‌قول می‌توانند چندین خط را در بر بگیرند؛ تمام فاصله‌های خالی " +"مرتبط در رشته‌ی تحت‌اللفظی گنجانده خواهند شد." -msgid "String literals that are part of a single expression and have only whitespace between them will be implicitly converted to a single string literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." +msgid "" +"String literals that are part of a single expression and have only whitespace between " +"them will be implicitly converted to a single string literal. That is, ``(\"spam \" " +"\"eggs\") == \"spam eggs\"``." msgstr "" +"مقادیر لفظی رشته‌ای (string literals) که بخشی از یک عبارت واحد هستند و تنها فاصله‌های خالی " +"میان آن‌ها قرار دارد، به‌طور ضمنی به یک لفظی رشته‌ای واحد تبدیل می‌شوند. یعنی ``(\"spam " +"\" \"eggs\") == \"spam eggs\"``." -msgid "See :ref:`strings` for more about the various forms of string literal, including supported :ref:`escape sequences `, and the ``r`` (\"raw\") prefix that disables most escape sequence processing." +msgid "" +"See :ref:`strings` for more about the various forms of string literal, including " +"supported :ref:`escape sequences `, and the ``r`` (\"raw\") prefix " +"that disables most escape sequence processing." msgstr "" +"برای اطلاعات بیشتر درباره‌ی شکل‌های گوناگون رشته‌های تحت‌اللفظی، از جمله :ref:`دنباله‌های " +"خنثی‌سازی ` پشتیبانی‌شده و پیشوند ``r`` («خام») که بیشترِ پردازش " +"دنباله‌های خنثی‌سازی را غیرفعال می‌کند، به :ref:`strings` مراجعه کنید." -msgid "Strings may also be created from other objects using the :class:`str` constructor." +msgid "" +"Strings may also be created from other objects using the :class:`str` constructor." msgstr "" +"رشته‌ها همچنین می‌توانند با استفاده از سازنده‌ی :class:`str` از اشیای دیگر ساخته شوند." -msgid "Since there is no separate \"character\" type, indexing a string produces strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." +msgid "" +"Since there is no separate \"character\" type, indexing a string produces strings of " +"length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" +"چون نوع جداگانه‌ای برای «نویسه» وجود ندارد، اندیس‌گذاری یک رشته، رشته‌هایی به طول ۱ تولید " +"می‌کند. یعنی برای یک رشته‌ی غیرتهی *s*، ``s[0] == s[0:1]`` است." -msgid "There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can be used to efficiently construct strings from multiple fragments." +msgid "" +"There is also no mutable string type, but :meth:`str.join` or :class:`io.StringIO` can " +"be used to efficiently construct strings from multiple fragments." msgstr "" +"نوعی رشته تغییرپذیر نیز وجود ندارد، اما می‌توان از :meth:`str.join` " +"یا :class:`io.StringIO` برای ساخت کارآمد رشته‌ها از چندین تکه استفاده کرد." -msgid "For backwards compatibility with the Python 2 series, the ``u`` prefix is once again permitted on string literals. It has no effect on the meaning of string literals and cannot be combined with the ``r`` prefix." +msgid "" +"For backwards compatibility with the Python 2 series, the ``u`` prefix is once again " +"permitted on string literals. It has no effect on the meaning of string literals and " +"cannot be combined with the ``r`` prefix." msgstr "" +"برای سازگاری رو به عقب با سری Python 2، پیشوند ``u`` بار دیگر بر روی رشته‌های تحت‌اللفظی " +"مجاز شمرده می‌شود. این پیشوند هیچ تأثیری بر معنای رشته‌های تحت‌اللفظی ندارد و نمی‌توان آن " +"را با پیشوند ``r`` ترکیب کرد." -msgid "Return a :ref:`string ` version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of ``str()`` depends on whether *encoding* or *errors* is given, as follows." +msgid "" +"Return a :ref:`string ` version of *object*. If *object* is not provided, " +"returns the empty string. Otherwise, the behavior of ``str()`` depends on whether " +"*encoding* or *errors* is given, as follows." msgstr "" +"نسخه‌ای :ref:`رشته ` از *object* را بازمی‌گرداند. اگر *object* داده نشده باشد، " +"رشته‌ی خالی را بازمی‌گرداند. در غیر این صورت، رفتار ``str()`` بستگی به این دارد که آیا " +"*encoding* یا *errors* داده شده باشند یا نه، به شرح زیر است." -msgid "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:`type(object).__str__(object) `, which is the \"informal\" or nicely printable string representation of *object*. For string objects, this is the string itself. If *object* does not have a :meth:`~object.__str__` method, then :func:`str` falls back to returning :func:`repr(object) `." +msgid "" +"If neither *encoding* nor *errors* is given, ``str(object)`` " +"returns :meth:`type(object).__str__(object) `, which is the " +"\"informal\" or nicely printable string representation of *object*. For string " +"objects, this is the string itself. If *object* does not have " +"a :meth:`~object.__str__` method, then :func:`str` falls back to " +"returning :func:`repr(object) `." msgstr "" +"اگر نه *encoding* و نه *errors* داده شده باشند، ``str(object)`` " +"مقدار :meth:`type(object).__str__(object) ` را بازمی‌گرداند که نمایش " +"رشته‌ای «غیررسمی» یا به‌خوبی چاپ‌شدنیِ *object* است. برای اشیای رشته‌ای، این خودِ رشته است. " +"اگر *object* متد :meth:`~object.__str__` را نداشته باشد، آنگاه :func:`str` به " +"بازگرداندن :func:`repr(object) ` روی می‌آورد." -msgid "If at least one of *encoding* or *errors* is given, *object* should be a :term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, then ``str(bytes, encoding, errors)`` is equivalent to :meth:`bytes.decode(encoding, errors) `. Otherwise, the bytes object underlying the buffer object is obtained before calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on buffer objects." +msgid "" +"If at least one of *encoding* or *errors* is given, *object* should be a :term:`bytes-" +"like object` (e.g. :class:`bytes` or :class:`bytearray`). In this case, if *object* " +"is a :class:`bytes` (or :class:`bytearray`) object, then ``str(bytes, encoding, " +"errors)`` is equivalent to :meth:`bytes.decode(encoding, errors) `. " +"Otherwise, the bytes object underlying the buffer object is obtained before " +"calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for " +"information on buffer objects." msgstr "" +"اگر حداقل یکی از *encoding* یا *errors* داده شده باشد، *object* باید یک :term:`شیء " +"bytes مانند ` باشد (مثلاً :class:`bytes` یا :class:`bytearray`). در " +"این حالت، اگر *object* یک شیء از نوع :class:`bytes` (یا :class:`bytearray`) باشد، " +"آنگاه ``str(bytes, encoding, errors)`` معادل :meth:`bytes.decode(encoding, errors) " +"` است. در غیر این صورت، شیء bytes زیرین شیء بافر، پیش از " +"فراخوانی :meth:`bytes.decode` به دست می‌آید. برای اطلاعات مربوط به اشیاء " +"بافر، :ref:`binaryseq` و :ref:`bufferobjects` را ببینید." -msgid "Passing a :class:`bytes` object to :func:`str` without the *encoding* or *errors* arguments falls under the first case of returning the informal string representation (see also the :option:`-b` command-line option to Python). For example::" +msgid "" +"Passing a :class:`bytes` object to :func:`str` without the *encoding* or *errors* " +"arguments falls under the first case of returning the informal string representation " +"(see also the :option:`-b` command-line option to Python). For example::" msgstr "" +"دادن یک شیء :class:`bytes` به :func:`str` بدون آرگومان‌های *encoding* یا *errors* جزو " +"حالت نخستِ بازگرداندن بازنمایی رشته‌ای غیررسمی محسوب می‌شود (همچنین به گزینه‌ی خط " +"فرمان :option:`-b` پایتون مراجعه کنید). برای مثال::" msgid "" ">>> str(b'Zoot!')\n" "\"b'Zoot!'\"" msgstr "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" -msgid "For more information on the ``str`` class and its methods, see :ref:`textseq` and the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In addition, see the :ref:`stringservices` section." +msgid "" +"For more information on the ``str`` class and its methods, see :ref:`textseq` and " +"the :ref:`string-methods` section below. To output formatted strings, see the :ref:`f-" +"strings` and :ref:`formatstrings` sections. In addition, see " +"the :ref:`stringservices` section." msgstr "" +"برای اطلاعات بیشتر درباره کلاس ``str`` و متدهای آن، به :ref:`textseq` و بخش :ref:`string-methods` در زیر مراجعه کنید. برای خروجی دادن رشته‌های قالب‌بندی‌شده، به بخش‌های :ref:`اف‌استرینگ‌ها ` و :ref:`formatstrings` مراجعه کنید. علاوه بر این، به بخش :ref:`stringservices` نیز مراجعه کنید." msgid "String Methods" -msgstr "" +msgstr "متدهای رشته" -msgid "Strings implement all of the :ref:`common ` sequence operations, along with the additional methods described below." +msgid "" +"Strings implement all of the :ref:`common ` sequence operations, " +"along with the additional methods described below." msgstr "" +"رشته‌ها تمامی عملیات‌های دنباله‌ی :ref:`مشترک ` را پیاده‌سازی می‌کنند، به " +"همراه متدهای اضافی که در زیر شرح داده شده‌اند." -msgid "Strings also support two styles of string formatting, one providing a large degree of flexibility and customization (see :meth:`str.format`, :ref:`formatstrings` and :ref:`string-formatting`) and the other based on C ``printf`` style formatting that handles a narrower range of types and is slightly harder to use correctly, but is often faster for the cases it can handle (:ref:`old-string-formatting`)." +msgid "" +"Strings also support two styles of string formatting, one providing a large degree of " +"flexibility and customization (see :meth:`str.format`, :ref:`formatstrings` " +"and :ref:`string-formatting`) and the other based on C ``printf`` style formatting " +"that handles a narrower range of types and is slightly harder to use correctly, but is " +"often faster for the cases it can handle (:ref:`old-string-formatting`)." msgstr "" +"رشته‌ها همچنین از دو سبک قالب‌بندی رشته پشتیبانی می‌کنند؛ یکی درجه بالایی از انعطاف‌پذیری " +"و سفارشی‌سازی را فراهم می‌کند (به :meth:`str.format`، :ref:`formatstrings` " +"و :ref:`string-formatting` مراجعه کنید) و دیگری بر پایه قالب‌بندی به سبک ``printf`` " +"زبان C است که دامنه محدودتری از انواع را پوشش می‌دهد و استفاده صحیح از آن اندکی دشوارتر " +"است، اما برای مواردی که می‌تواند مدیریت کند اغلب سریع‌تر است (:ref:`old-string-" +"formatting`)." -msgid "The :ref:`textservices` section of the standard library covers a number of other modules that provide various text related utilities (including regular expression support in the :mod:`re` module)." +msgid "" +"The :ref:`textservices` section of the standard library covers a number of other " +"modules that provide various text related utilities (including regular expression " +"support in the :mod:`re` module)." msgstr "" +"بخش :ref:`textservices` کتابخانه استاندارد، تعدادی ماژول دیگر را پوشش می‌دهد که " +"ابزارهای گوناگون مرتبط با متن را فراهم می‌کنند (از جمله پشتیبانی از عبارت‌های باقاعده در " +"ماژول :mod:`re`)." -msgid "Return a copy of the string with its first character capitalized and the rest lowercased." +msgid "" +"Return a copy of the string with its first character capitalized and the rest " +"lowercased." msgstr "" +"یک نسخه از رشته را برمی‌گرداند که در آن نویسه نخست به حرف بزرگ و بقیه نویسه‌ها به حروف " +"کوچک تبدیل شده‌اند." -msgid "The first character is now put into titlecase rather than uppercase. This means that characters like digraphs will only have their first letter capitalized, instead of the full character." +msgid "" +"The first character is now put into titlecase rather than uppercase. This means that " +"characters like digraphs will only have their first letter capitalized, instead of the " +"full character." msgstr "" +"اکنون نویسه‌ی نخست به‌جای حالت بزرگ (uppercase)، در حالت نگارش عنوان‌نویسی (titlecase) قرار می‌گیرد. " +"این بدان معناست که نویسه‌هایی مانند دیگراف‌ها (digraphs) تنها حرف نخست آن‌ها بزرگ‌نویسی " +"می‌شود، نه تمام نویسه." -msgid "Return a casefolded copy of the string. Casefolded strings may be used for caseless matching." +msgid "" +"Return a casefolded copy of the string. Casefolded strings may be used for caseless " +"matching." msgstr "" +"یک نسخه‌ی کیس‌فولدشده (casefolded) از رشته را برمی‌گرداند. می‌توان از رشته‌های کیس‌فولدشده " +"برای تطبیق بدون در نظر گرفتن بزرگی و کوچکی حروف (caseless matching) استفاده کرد." -msgid "Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold` converts it to ``\"ss\"``. For example:" +msgid "" +"Casefolding is similar to lowercasing but more aggressive because it is intended to " +"remove all case distinctions in a string. For example, the German lowercase letter " +"``'ß'`` is equivalent to ``\"ss\"``. Since it is already lowercase, :meth:`lower` " +"would do nothing to ``'ß'``; :meth:`casefold` converts it to ``\"ss\"``. For example:" msgstr "" +"یکدست‌سازی حروف (casefolding) مشابه کوچک‌سازی حروف است اما تهاجمی‌تر است، زیرا هدف آن حذف " +"تمام تمایزهای میان حروف بزرگ و کوچک در یک رشته است. برای مثال، نویسه کوچک آلمانی " +"``'ß'`` معادل ``\"ss\"`` است. از آنجا که این نویسه از قبل کوچک است، :meth:`lower` هیچ " +"کاری با ``'ß'`` انجام نمی‌دهد؛ :meth:`casefold` آن را به ``\"ss\"`` تبدیل می‌کند. برای " +"مثال:" msgid "" ">>> 'straße'.lower()\n" @@ -1666,12 +2848,28 @@ msgid "" ">>> 'straße'.casefold()\n" "'strasse'" msgstr "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" -msgid "The casefolding algorithm is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +msgid "" +"The casefolding algorithm is `described in section 3.13 'Default Case Folding' of the " +"Unicode Standard `__." msgstr "" +"الگوریتم تاشدن حروف (casefolding) `در بخش ۳٫۱۳ با عنوان 'تاشدن پیش‌فرض' از استاندارد " +"یونیکد توصیف شده است `__." -msgid "Return centered in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``. For example::" +msgid "" +"Return centered in a string of length *width*. Padding is done using the specified " +"*fillchar* (default is an ASCII space). The original string is returned if *width* is " +"less than or equal to ``len(s)``. For example::" msgstr "" +"رشته‌ای به طول *width* را برمی‌گرداند که رشته‌ی اصلی در وسط آن قرار دارد. پرکردن با " +"استفاده از *fillchar* مشخص‌شده انجام می‌شود (پیش‌فرض یک فاصله‌ی ASCII است). اگر *width* " +"کوچک‌تر یا مساوی ``len(s)`` باشد، رشته‌ی اصلی برگردانده می‌شود. برای مثال::" msgid "" ">>> 'Python'.center(10)\n" @@ -1681,12 +2879,27 @@ msgid "" ">>> 'Python'.center(4)\n" "'Python'" msgstr "" +">>> 'Python'.center(10)\n" +"' Python '\n" +">>> 'Python'.center(10, '-')\n" +"'--Python--'\n" +">>> 'Python'.center(4)\n" +"'Python'" -msgid "Return the number of non-overlapping occurrences of substring *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation." +msgid "" +"Return the number of non-overlapping occurrences of substring *sub* in the range " +"[*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice " +"notation." msgstr "" +"تعداد رخدادهای غیرهمپوشان زیررشته‌ی *sub* در بازه [*start*, *end*] را برمی‌گرداند. " +"آرگومان‌های اختیاری *start* و *end* مانند نماد برش تفسیر می‌شوند." -msgid "If *sub* is empty, returns the number of empty strings between characters which is the length of the string plus one. For example::" +msgid "" +"If *sub* is empty, returns the number of empty strings between characters which is the " +"length of the string plus one. For example::" msgstr "" +"اگر *sub* خالی باشد، تعداد رشته‌های خالی بین نویسه‌ها را برمی‌گرداند که همان طول رشته " +"به‌علاوه‌ی یک است. برای مثال::" msgid "" ">>> 'spam, spam, spam'.count('spam')\n" @@ -1700,18 +2913,46 @@ msgid "" ">>> 'spam, spam, spam'.count('')\n" "17" msgstr "" +">>> 'spam, spam, spam'.count('spam')\n" +"3\n" +">>> 'spam, spam, spam'.count('spam', 5)\n" +"2\n" +">>> 'spam, spam, spam'.count('spam', 5, 10)\n" +"1\n" +">>> 'spam, spam, spam'.count('eggs')\n" +"0\n" +">>> 'spam, spam, spam'.count('')\n" +"17" msgid "Return the string encoded to :class:`bytes`." -msgstr "" +msgstr "رشته را به صورت کدگذاری‌شده به :class:`bytes` بازمی‌گرداند." -msgid "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values." +msgid "" +"*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for possible values." msgstr "" +"*encoding* به‌طور پیش‌فرض ``'utf-8'`` است؛ برای مقادیر ممکن به :ref:`standard-encodings` " +"مراجعه کنید." -msgid "*errors* controls how encoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details." +msgid "" +"*errors* controls how encoding errors are handled. If ``'strict'`` (the default), " +"a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, " +"``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and any other name " +"registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" +"*errors* نحوه‌ی رسیدگی به خطاهای کدگذاری را کنترل می‌کند. اگر ``'strict'`` باشد (پیش‌فرض)، " +"یک استثنای :exc:`UnicodeError` پرتاب می‌شود. سایر مقادیر ممکن عبارتند از ``'ignore'``، " +"``'replace'``، ``'xmlcharrefreplace'``، ``'backslashreplace'`` و هر نام دیگری که از " +"طریق :func:`codecs.register_error` ثبت شده باشد. برای جزئیات بیشتر به :ref:`error-" +"handlers` مراجعه کنید." -msgid "For performance reasons, the value of *errors* is not checked for validity unless an encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build ` is used. For example::" +msgid "" +"For performance reasons, the value of *errors* is not checked for validity unless an " +"encoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build " +"` is used. For example::" msgstr "" +"به دلایل کارایی، مقدار *errors* از نظر اعتبار بررسی نمی‌شود، مگر آنکه خطای کدگذاری " +"واقعاً رخ دهد، :ref:`devmode` فعال شده باشد یا از :ref:`ساخت اشکال‌زدایی ` " +"استفاده شود. برای مثال::" msgid "" ">>> encoded_str_to_bytes = 'Python'.encode()\n" @@ -1720,15 +2961,34 @@ msgid "" ">>> encoded_str_to_bytes\n" "b'Python'" msgstr "" +">>> encoded_str_to_bytes = 'Python'.encode()\n" +">>> type(encoded_str_to_bytes)\n" +"\n" +">>> encoded_str_to_bytes\n" +"b'Python'" msgid "Added support for keyword arguments." -msgstr "" +msgstr "پشتیبانی از آرگومان‌های کلیدواژه‌ای اضافه شد." -msgid "The value of the *errors* argument is now checked in :ref:`devmode` and in :ref:`debug mode `." +msgid "" +"The value of the *errors* argument is now checked in :ref:`devmode` and in :ref:`debug " +"mode `." msgstr "" +"مقدار آرگومان *errors* اکنون در :ref:`حالت توسعه ` و در :ref:`حالت اشکال‌زدایی " +"` بررسی می‌شود." -msgid "Return ``True`` if the string ends with the specified *suffix*, otherwise return ``False``. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position. Using *start* and *end* is equivalent to ``str[start:end].endswith(suffix)``. For example::" +msgid "" +"Return ``True`` if the string ends with the specified *suffix*, otherwise return " +"``False``. *suffix* can also be a tuple of suffixes to look for. With optional " +"*start*, test beginning at that position. With optional *end*, stop comparing at that " +"position. Using *start* and *end* is equivalent to " +"``str[start:end].endswith(suffix)``. For example::" msgstr "" +"اگر رشته با *suffix* مشخص‌شده پایان یابد، ``True`` بازگردانده می‌شود؛ در غیر این صورت " +"``False`` بازگردانده می‌شود. *suffix* همچنین می‌تواند تاپلی از پسوندها برای جستجو باشد. " +"با *start* اختیاری، آزمایش از آن موقعیت آغاز می‌شود. با *end* اختیاری، مقایسه در آن " +"موقعیت متوقف می‌شود. استفاده از *start* و *end* معادل " +"``str[start:end].endswith(suffix)`` است. برای مثال::" msgid "" ">>> 'Python'.endswith('on')\n" @@ -1740,12 +3000,39 @@ msgid "" ">>> 'Python is amazing'.endswith('is', 0, 9)\n" "True" msgstr "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" msgid "See also :meth:`startswith` and :meth:`removesuffix`." -msgstr "" - -msgid "Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the string, the current column is set to zero and the string is examined character by character. If the character is a tab (``\\t``), one or more space characters are inserted in the result until the current column is equal to the next tab position. (The tab character itself is not copied.) If the character is a newline (``\\n``) or return (``\\r``), it is copied and the current column is reset to zero. Any other character is copied unchanged and the current column is incremented by one regardless of how the character is represented when printed. For example::" -msgstr "" +msgstr "همچنین :meth:`startswith` و :meth:`removesuffix` را ببینید." + +msgid "" +"Return a copy of the string where all tab characters are replaced by one or more " +"spaces, depending on the current column and the given tab size. Tab positions occur " +"every *tabsize* characters (default is 8, giving tab positions at columns 0, 8, 16 and " +"so on). To expand the string, the current column is set to zero and the string is " +"examined character by character. If the character is a tab (``\\t``), one or more " +"space characters are inserted in the result until the current column is equal to the " +"next tab position. (The tab character itself is not copied.) If the character is a " +"newline (``\\n``) or return (``\\r``), it is copied and the current column is reset to " +"zero. Any other character is copied unchanged and the current column is incremented " +"by one regardless of how the character is represented when printed. For example::" +msgstr "" +"رونوشتی از رشته را برمی‌گرداند که در آن همه نویسه‌های تب با یک یا چند فاصله جایگزین " +"شده‌اند؛ بسته به ستون جاری و اندازه تب داده‌شده. موقعیت‌های تب هر *tabsize* نویسه یک بار " +"رخ می‌دهند (پیش‌فرض ۸ است که موقعیت‌های تب را در ستون‌های ۰، ۸، ۱۶ و به همین ترتیب ایجاد " +"می‌کند). برای گسترش رشته، ستون جاری صفر قرار داده می‌شود و رشته نویسه به نویسه بررسی " +"می‌شود. اگر نویسه یک تب (``\\t``) باشد، یک یا چند نویسه فاصله در نتیجه درج می‌شوند تا " +"زمانی که ستون جاری با موقعیت تب بعدی برابر شود. (خود نویسه تب کپی نمی‌شود.) اگر نویسه " +"یک خط جدید (``\\n``) یا بازگشت (``\\r``) باشد، کپی می‌شود و ستون جاری به صفر بازنشانی " +"می‌شود. هر نویسه دیگری بدون تغییر کپی می‌شود و ستون جاری صرف‌نظر از اینکه آن نویسه هنگام " +"چاپ چگونه نمایش داده می‌شود، یکی افزایش می‌یابد. برای مثال::" msgid "" ">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" @@ -1756,9 +3043,22 @@ msgid "" "01 012\n" "0123 01234" msgstr "" +">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" +"'01 012 0123 01234'\n" +">>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"'01 012 0123 01234'\n" +">>> print('01\\t012\\n0123\\t01234'.expandtabs(4))\n" +"01 012\n" +"0123 01234" -msgid "Return the lowest index in the string where substring *sub* is found within the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found. For example::" +msgid "" +"Return the lowest index in the string where substring *sub* is found within the slice " +"``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice " +"notation. Return ``-1`` if *sub* is not found. For example::" msgstr "" +"کمترین اندیسی از رشته را بازمی‌گرداند که زیررشته *sub* درون برش ``s[start:end]`` در آن " +"یافت می‌شود. آرگومان‌های اختیاری *start* و *end* مانند نمادگذاری برش تفسیر می‌شوند. اگر " +"*sub* یافت نشود، ``-1`` بازگردانده می‌شود. برای مثال::" msgid "" ">>> 'spam, spam, spam'.find('sp')\n" @@ -1766,20 +3066,40 @@ msgid "" ">>> 'spam, spam, spam'.find('sp', 5)\n" "6" msgstr "" +">>> 'spam, spam, spam'.find('sp')\n" +"0\n" +">>> 'spam, spam, spam'.find('sp', 5)\n" +"6" msgid "See also :meth:`rfind` and :meth:`index`." -msgstr "" +msgstr "همچنین ببینید :meth:`rfind` و :meth:`index`." -msgid "The :meth:`~str.find` method should be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" +msgid "" +"The :meth:`~str.find` method should be used only if you need to know the position of " +"*sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" msgstr "" +"متد :meth:`~str.find` تنها در صورتی باید استفاده شود که نیاز به دانستن موقعیت *sub* " +"دارید. برای بررسی اینکه *sub* زیررشته است یا خیر، از عملگر :keyword:`in` استفاده کنید::" msgid "" ">>> 'Py' in 'Python'\n" "True" msgstr "" +">>> 'Py' in 'Python'\n" +"True" -msgid "Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields delimited by braces ``{}``. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of the corresponding argument. For example:" +msgid "" +"Perform a string formatting operation. The string on which this method is called can " +"contain literal text or replacement fields delimited by braces ``{}``. Each " +"replacement field contains either the numeric index of a positional argument, or the " +"name of a keyword argument. Returns a copy of the string where each replacement field " +"is replaced with the string value of the corresponding argument. For example:" msgstr "" +"عملیات قالب‌بندی رشته را انجام می‌دهد. رشته‌ای که این متد روی آن فراخوانی می‌شود می‌تواند " +"شامل متن تحت‌اللفظی یا فیلدهای جایگزینی باشد که با آکولادها ``{}`` محصور شده‌اند. هر " +"فیلد جایگزینی یا شامل اندیس عددی یک آرگومان جایگاهی است، یا نام یک آرگومان کلیدواژه‌ای. " +"نسخه‌ای از رشته را بازمی‌گرداند که در آن هر فیلد جایگزینی با مقدار رشته‌ای آرگومان متناظر " +"جایگزین شده است. برای مثال:" msgid "" ">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" @@ -1789,21 +3109,59 @@ msgid "" ">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" "'Nobody expects the Spanish Inquisition!'" msgstr "" +">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"The sum of {a} + {b} is {answer}\".format(answer=1+2, a=1, b=2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" +"'Nobody expects the Spanish Inquisition!'" -msgid "See :ref:`formatstrings` for a description of the various formatting options that can be specified in format strings." +msgid "" +"See :ref:`formatstrings` for a description of the various formatting options that can " +"be specified in format strings." msgstr "" +"برای توضیح گزینه‌های گوناگون قالب‌بندی که می‌توانید در رشته‌های قالب‌بندی مشخص کنید، " +"به :ref:`formatstrings` مراجعه کنید." -msgid "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode ``decimal_point`` and ``thousands_sep`` fields of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This temporary change affects other threads." +msgid "" +"When formatting a number " +"(:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` and " +"subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the function " +"temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode " +"``decimal_point`` and ``thousands_sep`` fields of :c:func:`localeconv` if they are non-" +"ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the " +"``LC_CTYPE`` locale. This temporary change affects other threads." msgstr "" +"هنگام قالب‌بندی یک عدد " +"(:class:`int`، :class:`float`، :class:`complex`، :class:`decimal.Decimal` و زیرکلاس‌ها) " +"با نوع ``n`` (مثال: ``'{:n}'.format(1234)``)، تابع به‌طور موقت locale (locale) " +"``LC_CTYPE`` را به locale ``LC_NUMERIC`` تنظیم می‌کند تا فیلدهای ``decimal_point`` و " +"``thousands_sep`` در :c:func:`localeconv` را کدگشایی کند اگر آن‌ها غیر ASCII یا " +"طولانی‌تر از ۱ بایت باشند، و locale ``LC_NUMERIC`` با locale ``LC_CTYPE`` متفاوت باشد. این " +"تغییر موقت بر نخ‌های دیگر تأثیر می‌گذارد." -msgid "When formatting a number with the ``n`` type, the function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." +msgid "" +"When formatting a number with the ``n`` type, the function sets temporarily the " +"``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" +"هنگام قالب‌بندی یک عدد با نوع ``n``، تابع در برخی موارد localeی ``LC_CTYPE`` را به‌طور " +"موقت به localeی ``LC_NUMERIC`` تنظیم می‌کند." -msgid "Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict subclass:" +msgid "" +"Similar to ``str.format(**mapping)``, except that ``mapping`` is used directly and not " +"copied to a :class:`dict`. This is useful if for example ``mapping`` is a dict " +"subclass:" msgstr "" +"مشابه ``str.format(**mapping)``، با این تفاوت که ``mapping`` مستقیماً استفاده می‌شود و " +"در یک :class:`dict` کپی نمی‌شود. این کار اگر برای مثال ``mapping`` یک زیرکلاس دیکشنری " +"باشد، مفید است:" -msgid "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is not found. For example:" +msgid "" +"Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is not found. " +"For example:" msgstr "" +"مانند :meth:`~str.find`، اما هنگامی که زیررشته یافت نشود، :exc:`ValueError` را پرتاب " +"می‌کند. برای مثال:" msgid "" ">>> 'spam, spam, spam'.index('spam')\n" @@ -1815,12 +3173,28 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" msgid "See also :meth:`rindex`." -msgstr "" +msgstr "همچنین ببینید :meth:`rindex`." -msgid "Return ``True`` if all characters in the string are alphanumeric and there is at least one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:" +msgid "" +"Return ``True`` if all characters in the string are alphanumeric and there is at least " +"one character, ``False`` otherwise. A character ``c`` is alphanumeric if one of the " +"following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``, ``c.isdigit()``, or " +"``c.isnumeric()``. For example:" msgstr "" +"اگر همه‌ی نویسه‌های رشته الفبایی‌عددی باشند و دست‌کم یک نویسه در آن وجود داشته باشد، " +"``True`` بازگردانده می‌شود؛ در غیر این صورت ``False``. یک نویسه‌ی ``c`` الفبایی‌عددی است " +"اگر یکی از موارد زیر ``True`` برگرداند: ``c.isalpha()``، ``c.isdecimal()``، " +"``c.isdigit()`` یا ``c.isnumeric()``. برای مثال:" msgid "" ">>> 'abc123'.isalnum()\n" @@ -1832,9 +3206,31 @@ msgid "" ">>> ' '.isalnum()\n" "False" msgstr "" +">>> 'abc123'.isalnum()\n" +"True\n" +">>> 'abc123!@#'.isalnum()\n" +"False\n" +">>> ''.isalnum()\n" +"False\n" +">>> ' '.isalnum()\n" +"False" -msgid "Return ``True`` if all characters in the string are alphabetic and there is at least one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as \"Letter\", i.e., those with general category property being one of \"Lm\", \"Lt\", \"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' of the Unicode Standard `_. For example:" +msgid "" +"Return ``True`` if all characters in the string are alphabetic and there is at least " +"one character, ``False`` otherwise. Alphabetic characters are those characters " +"defined in the Unicode character database as \"Letter\", i.e., those with general " +"category property being one of \"Lm\", \"Lt\", \"Lu\", \"Ll\", or \"Lo\". Note that " +"this is different from the `Alphabetic property defined in the section 4.10 'Letters, " +"Alphabetic, and Ideographic' of the Unicode Standard `_. For example:" msgstr "" +"اگر همه‌ی نویسه‌های رشته الفبایی باشند و حداقل یک نویسه وجود داشته باشد، ``True`` را " +"برمی‌گرداند؛ در غیر این صورت ``False``. نویسه‌های الفبایی نویسه‌هایی هستند که در پایگاه " +"داده‌ی نویسه‌های یونیکد به عنوان \"Letter\" تعریف شده‌اند؛ یعنی نویسه‌هایی که ویژگی دسته " +"عمومی آن‌ها یکی از \"Lm\"، \"Lt\"، \"Lu\"، \"Ll\" یا \"Lo\" باشد. توجه داشته باشید که " +"این با `ویژگی الفبایی (Alphabetic) تعریف‌شده در بخش 4.10 «Letters, Alphabetic, and " +"Ideographic» استاندارد یونیکد `_ متفاوت است. برای مثال:" msgid "" ">>> 'Letters and spaces'.isalpha()\n" @@ -1844,12 +3240,24 @@ msgid "" ">>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too\n" "True" msgstr "" +">>> 'Letters and spaces'.isalpha()\n" +"False\n" +">>> 'LettersOnly'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too\n" +"True" msgid "See :ref:`unicode-properties`." -msgstr "" +msgstr ":ref:`unicode-properties` را ببینید." -msgid "Return ``True`` if the string is empty or all characters in the string are ASCII, ``False`` otherwise. ASCII characters have code points in the range U+0000-U+007F. For example:" +msgid "" +"Return ``True`` if the string is empty or all characters in the string are ASCII, " +"``False`` otherwise. ASCII characters have code points in the range U+0000-U+007F. For " +"example:" msgstr "" +"اگر رشته خالی باشد یا تمام نویسه‌های آن ASCII باشند، ``True`` و در غیر این صورت " +"``False`` را برمی‌گرداند. نویسه‌های ASCII دارای نقطه‌های کد در بازه‌ی U+0000-U+007F هستند. " +"برای مثال:" msgid "" ">>> 'ASCII characters'.isascii()\n" @@ -1857,9 +3265,22 @@ msgid "" ">>> 'µ'.isascii()\n" "False" msgstr "" +">>> 'ASCII characters'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" -msgid "Return ``True`` if all characters in the string are decimal characters and there is at least one character, ``False`` otherwise. Decimal characters are those that can be used to form numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Category \"Nd\". For example:" +msgid "" +"Return ``True`` if all characters in the string are decimal characters and there is at " +"least one character, ``False`` otherwise. Decimal characters are those that can be " +"used to form numbers in base 10, such as U+0660, ARABIC-INDIC DIGIT ZERO. Formally a " +"decimal character is a character in the Unicode General Category \"Nd\". For example:" msgstr "" +"اگر همه‌ی نویسه‌های رشته نویسه‌های دهدهی باشند و دست‌کم یک نویسه وجود داشته باشد، ``True`` " +"برمی‌گرداند؛ در غیر این صورت ``False``. نویسه‌های دهدهی نویسه‌هایی هستند که می‌توان از " +"آن‌ها برای تشکیل اعداد در مبنای ۱۰ استفاده کرد، مانند U+0660، ARABIC-INDIC DIGIT ZERO. " +"به طور رسمی، یک نویسه‌ی دهدهی نویسه‌ای است که در دسته‌بندی عمومی «Nd» یونیکد قرار دارد. " +"برای مثال:" msgid "" ">>> '0123456789'.isdecimal()\n" @@ -1869,12 +3290,30 @@ msgid "" ">>> 'alphabetic'.isdecimal()\n" "False" msgstr "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> 'alphabetic'.isdecimal()\n" +"False" -msgid "Return ``True`` if all characters in the string are digits and there is at least one character, ``False`` otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the `Kharosthi numbers `__. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal." +msgid "" +"Return ``True`` if all characters in the string are digits and there is at least one " +"character, ``False`` otherwise. Digits include decimal characters and digits that " +"need special handling, such as the compatibility superscript digits. This covers " +"digits which cannot be used to form numbers in base 10, like the `Kharosthi numbers " +"`__. Formally, a digit is a " +"character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" +"اگر همه‌ی نویسه‌های رشته رقم باشند و دست‌کم یک نویسه وجود داشته باشد، ``True`` برمی‌گرداند؛ " +"در غیر این صورت ``False``. ارقام شامل نویسه‌های اعشاری و ارقامی هستند که نیازمند رسیدگی " +"ویژه‌اند، مانند ارقام بالانویس سازگاری. این موضوع ارقامی را نیز پوشش می‌دهد که نمی‌توان " +"از آن‌ها برای تشکیل اعداد در مبنای ۱۰ استفاده کرد، مانند `اعداد خروشتی `__. به‌طور رسمی، رقم نویسه‌ای است که دارای " +"مقدار ویژگی Numeric_Type=Digit یا Numeric_Type=Decimal باشد." msgid "For example:" -msgstr "" +msgstr "برای مثال:" msgid "" ">>> '0123456789'.isdigit()\n" @@ -1886,18 +3325,34 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> '⅕'.isdigit() # Vulgar fraction one fifth\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" msgid "See also :meth:`isdecimal` and :meth:`isnumeric`." -msgstr "" +msgstr "همچنین :meth:`isdecimal` و :meth:`isnumeric` را ببینید." -msgid "Return ``True`` if the string is a valid identifier according to the language definition, section :ref:`identifiers`." +msgid "" +"Return ``True`` if the string is a valid identifier according to the language " +"definition, section :ref:`identifiers`." msgstr "" +"اگر رشته یک شناسه‌ی معتبر مطابق با تعریف زبان در بخش :ref:`identifiers` باشد، ``True`` " +"را بازمی‌گرداند." -msgid ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved identifier, such as :keyword:`def` and :keyword:`class`." +msgid "" +":func:`keyword.iskeyword` can be used to test whether string ``s`` is a reserved " +"identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" +"می‌توان از :func:`keyword.iskeyword` برای آزمودن اینکه آیا رشته‌ی ``s`` یک شناسه‌ی رزروشده " +"است، مانند :keyword:`def` و :keyword:`class`، استفاده کرد." msgid "Example: ::" -msgstr "" +msgstr "مثال: ::" msgid "" ">>> from keyword import iskeyword\n" @@ -1907,12 +3362,33 @@ msgid "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" msgstr "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'hello'.isidentifier(), iskeyword('hello')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" -msgid "Return ``True`` if all cased characters [4]_ in the string are lowercase and there is at least one cased character, ``False`` otherwise." +msgid "" +"Return ``True`` if all cased characters [4]_ in the string are lowercase and there is " +"at least one cased character, ``False`` otherwise." msgstr "" +"اگر همه‌ی نویسه‌های دارای حالت [4]_ درون رشته کوچک باشند و دست‌کم یک نویسه‌ی دارای حالت وجود " +"داشته باشد، ``True`` بازگردانده می‌شود؛ در غیر این صورت ``False``." -msgid "Return ``True`` if all characters in the string are numeric characters, and there is at least one character, ``False`` otherwise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" +msgid "" +"Return ``True`` if all characters in the string are numeric characters, and there is " +"at least one character, ``False`` otherwise. Numeric characters include digit " +"characters, and all characters that have the Unicode numeric value property, e.g. " +"U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the " +"property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric. For " +"example:" msgstr "" +"اگر همه‌ی نویسه‌های رشته نویسه‌های عددی باشند و حداقل یک نویسه وجود داشته باشد، ``True`` و " +"در غیر این صورت ``False`` بازگردانده می‌شود. نویسه‌های عددی شامل نویسه‌های رقم و همه‌ی " +"نویسه‌هایی هستند که ویژگی مقدار عددی یونیکد را دارند، مانند U+2155، VULGAR FRACTION ONE " +"FIFTH. به‌طور رسمی، نویسه‌های عددی نویسه‌هایی هستند که مقدار ویژگی آن‌ها " +"Numeric_Type=Digit، Numeric_Type=Decimal یا Numeric_Type=Numeric باشد. برای مثال:" msgid "" ">>> '0123456789'.isnumeric()\n" @@ -1924,18 +3400,46 @@ msgid "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" msgstr "" +">>> '0123456789'.isnumeric()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> '⅕'.isnumeric() # Vulgar fraction one fifth\n" +"True\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" msgid "See also :meth:`isdecimal` and :meth:`isdigit`." -msgstr "" +msgstr "همچنین ببینید :meth:`isdecimal` و :meth:`isdigit`." -msgid "Return ``True`` if all characters in the string are printable, ``False`` if it contains at least one non-printable character." +msgid "" +"Return ``True`` if all characters in the string are printable, ``False`` if it " +"contains at least one non-printable character." msgstr "" +"اگر همه‌ی نویسه‌های رشته قابل چاپ باشند، ``True`` را برمی‌گرداند؛ اگر حداقل یک نویسه‌ی " +"غیرقابل چاپ داشته باشد، ``False`` را برمی‌گرداند." -msgid "Here \"printable\" means the character is suitable for :func:`repr` to use in its output; \"non-printable\" means that :func:`repr` on built-in types will hex-escape the character. It has no bearing on the handling of strings written to :data:`sys.stdout` or :data:`sys.stderr`." +msgid "" +"Here \"printable\" means the character is suitable for :func:`repr` to use in its " +"output; \"non-printable\" means that :func:`repr` on built-in types will hex-escape " +"the character. It has no bearing on the handling of strings written " +"to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" +"در اینجا «قابل چاپ» به این معناست که نویسه برای آنکه :func:`repr` در خروجی خود از آن " +"استفاده کند مناسب است؛ «غیرقابل چاپ» یعنی :func:`repr` روی انواع توکار، نویسه را با " +"مبنای شانزده خنثی می‌کند (hex-escape). این موضوع تأثیری بر نحوه مدیریت رشته‌هایی که " +"به :data:`sys.stdout` یا :data:`sys.stderr` نوشته می‌شوند ندارد." -msgid "The printable characters are those which in the Unicode character database (see :mod:`unicodedata`) have a general category in group Letter, Mark, Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space 0x20. Nonprintable characters are those in group Separator or Other (Z or C), except the ASCII space." +msgid "" +"The printable characters are those which in the Unicode character database " +"(see :mod:`unicodedata`) have a general category in group Letter, Mark, Number, " +"Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space 0x20. Nonprintable " +"characters are those in group Separator or Other (Z or C), except the ASCII space." msgstr "" +"نویسه‌های چاپ‌پذیر آن‌هایی هستند که در پایگاه داده نویسه یونیکد (به :mod:`unicodedata` " +"مراجعه کنید) دارای دسته عمومی در گروه حرف، نشانه، عدد، نمادگذاری یا نماد (L, M, N, P, " +"or S) هستند؛ به علاوه فاصله ASCII 0x20. نویسه‌های غیرچاپ‌پذیر آن‌هایی هستند که در گروه " +"جداکننده یا سایر (Z or C) قرار دارند، به جز فاصله ASCII." msgid "" ">>> ''.isprintable(), ' '.isprintable()\n" @@ -1943,12 +3447,20 @@ msgid "" ">>> '\\t'.isprintable(), '\\n'.isprintable()\n" "(False, False)" msgstr "" +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" msgid "See also :meth:`isspace`." -msgstr "" +msgstr "همچنین ببینید :meth:`isspace`." -msgid "Return ``True`` if there are only whitespace characters in the string and there is at least one character, ``False`` otherwise." +msgid "" +"Return ``True`` if there are only whitespace characters in the string and there is at " +"least one character, ``False`` otherwise." msgstr "" +"اگر رشته فقط شامل نویسه‌های فضای خالی باشد و حداقل یک نویسه داشته باشد، ``True`` و در " +"غیر این صورت ``False`` را برمی‌گرداند." msgid "" ">>> ''.isspace()\n" @@ -1960,15 +3472,36 @@ msgid "" ">>> '\\u3000'.isspace() # IDEOGRAPHIC SPACE\n" "True" msgstr "" +">>> ''.isspace()\n" +"False\n" +">>> ' '.isspace()\n" +"True\n" +">>> '\\t\\n'.isspace() # TAB and BREAK LINE\n" +"True\n" +">>> '\\u3000'.isspace() # IDEOGRAPHIC SPACE\n" +"True" -msgid "A character is *whitespace* if in the Unicode character database (see :mod:`unicodedata`), either its general category is ``Zs`` (\"Separator, space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." +msgid "" +"A character is *whitespace* if in the Unicode character database " +"(see :mod:`unicodedata`), either its general category is ``Zs`` (\"Separator, " +"space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" +"یک نویسه در صورتی *فاصله سفید* است که در پایگاه داده نویسه‌های یونیکد " +"(به :mod:`unicodedata` مراجعه کنید)، یا دسته عمومی آن ``Zs`` («جداکننده، فاصله») باشد، " +"یا کلاس دوجهته آن یکی از ``WS``، ``B`` یا ``S`` باشد." msgid "See also :meth:`isprintable`." -msgstr "" +msgstr "همچنین ببینید :meth:`isprintable`." -msgid "Return ``True`` if the string is a titlecased string and there is at least one character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return ``False`` otherwise." +msgid "" +"Return ``True`` if the string is a titlecased string and there is at least one " +"character, for example uppercase characters may only follow uncased characters and " +"lowercase characters only cased ones. Return ``False`` otherwise." msgstr "" +"اگر رشته، رشته‌ای با حالت نگارش عنوان‌نویسی (titlecased) باشد و دست‌کم یک نویسه داشته باشد، ``True`` " +"بازگردانده می‌شود؛ برای مثال، نویسه‌های بزرگ تنها می‌توانند پس از نویسه‌های بدون حالت " +"(uncased) بیایند و نویسه‌های کوچک تنها پس از نویسه‌های دارای حالت (cased). در غیر این " +"صورت، ``False`` بازگردانده می‌شود." msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" @@ -1978,15 +3511,33 @@ msgid "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" msgstr "" +">>> 'Spam, Spam, Spam'.istitle()\n" +"True\n" +">>> 'spam, spam, spam'.istitle()\n" +"False\n" +">>> 'SPAM, SPAM, SPAM'.istitle()\n" +"False" msgid "See also :meth:`title`." -msgstr "" +msgstr "همچنین ببینید :meth:`title`." -msgid "Return ``True`` if all cased characters [4]_ in the string are uppercase and there is at least one cased character, ``False`` otherwise." +msgid "" +"Return ``True`` if all cased characters [4]_ in the string are uppercase and there is " +"at least one cased character, ``False`` otherwise." msgstr "" +"اگر همه‌ی نویسه‌های دارای حالت (cased) [4]_ درون رشته به شکل حروف بزرگ باشند و دست‌کم یک " +"نویسه‌ی دارای حالت وجود داشته باشد، ``True`` و در غیر این صورت ``False`` برمی‌گرداند." -msgid "Return a string which is the concatenation of the strings in *iterable*. A :exc:`TypeError` will be raised if there are any non-string values in *iterable*, including :class:`bytes` objects. The separator between elements is the string providing this method. For example:" +msgid "" +"Return a string which is the concatenation of the strings in *iterable*. " +"A :exc:`TypeError` will be raised if there are any non-string values in *iterable*, " +"including :class:`bytes` objects. The separator between elements is the string " +"providing this method. For example:" msgstr "" +"رشته‌ای را بازمی‌گرداند که حاصل الحاق رشته‌های موجود در *iterable* است. اگر در *iterable* " +"مقدارهای غیر رشته‌ای وجود داشته باشد، از جمله شیءهای :class:`bytes`، " +"استثنای :exc:`TypeError` پرتاب می‌شود. جداکننده‌ی میان المان‌ها، رشته‌ای است که این متد را " +"فراهم می‌کند. برای مثال:" msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" @@ -1994,12 +3545,22 @@ msgid "" ">>> '-'.join('Python')\n" "'P-y-t-h-o-n'" msgstr "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" msgid "See also :meth:`split`." -msgstr "" +msgstr "همچنین ببینید :meth:`split`." -msgid "Return the string left justified in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return the string left justified in a string of length *width*. Padding is done using " +"the specified *fillchar* (default is an ASCII space). The original string is returned " +"if *width* is less than or equal to ``len(s)``." msgstr "" +"رشته را در رشته‌ای به طول *width* به‌صورت چپ‌چین بازمی‌گرداند. پرکردن با استفاده از " +"*fillchar* مشخص‌شده انجام می‌شود (پیش‌فرض یک فاصله‌ی ASCII است). اگر *width* کوچک‌تر یا " +"مساوی ``len(s)`` باشد، رشته‌ی اصلی برگردانده می‌شود." msgid "" ">>> 'Python'.ljust(10)\n" @@ -2009,23 +3570,49 @@ msgid "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.ljust(10)\n" +"'Python '\n" +">>> 'Python'.ljust(10, '.')\n" +"'Python....'\n" +">>> 'Monty Python'.ljust(10, '.')\n" +"'Monty Python'" msgid "See also :meth:`rjust`." -msgstr "" +msgstr "همچنین ببینید :meth:`rjust`." -msgid "Return a copy of the string with all the cased characters [4]_ converted to lowercase. For example:" +msgid "" +"Return a copy of the string with all the cased characters [4]_ converted to lowercase. " +"For example:" msgstr "" +"یک نسخه از رشته را برمی‌گرداند که تمام نویسه‌های دارای حالت (cased) [4]_ آن به حروف کوچک " +"تبدیل شده‌اند. برای مثال:" msgid "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" msgstr "" +">>> 'Lower Method Example'.lower()\n" +"'lower method example'" -msgid "The lowercasing algorithm used is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +msgid "" +"The lowercasing algorithm used is `described in section 3.13 'Default Case Folding' of " +"the Unicode Standard `__." msgstr "" +"الگوریتم حروف‌کوچک‌سازی استفاده‌شده، `در بخش ۳٫۱۳ با عنوان «تاشدگی پیش‌فرض» (Default Case " +"Folding) از استاندارد یونیکد توصیف شده است `__." -msgid "Return a copy of the string with leading characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped::" +msgid "" +"Return a copy of the string with leading characters removed. The *chars* argument is " +"a string specifying the set of characters to be removed. If omitted or ``None``, the " +"*chars* argument defaults to removing whitespace. The *chars* argument is not a " +"prefix; rather, all combinations of its values are stripped::" msgstr "" +"کپی‌ای از رشته را با حذف نویسه‌های ابتدایی برمی‌گرداند. آرگومان *chars* رشته‌ای است که " +"مجموعه نویسه‌هایی را که باید حذف شوند مشخص می‌کند. اگر ذکر نشود یا ``None`` باشد، " +"آرگومان *chars* به‌طور پیش‌فرض فاصله‌های خالی را حذف می‌کند. آرگومان *chars* یک پیشوند " +"نیست؛ بلکه تمام ترکیب‌های مقادیر آن حذف می‌شوند::" msgid "" ">>> ' spacious '.lstrip()\n" @@ -2033,9 +3620,17 @@ msgid "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" msgstr "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" -msgid "See :meth:`str.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::" +msgid "" +"See :meth:`str.removeprefix` for a method that will remove a single prefix string " +"rather than all of a set of characters. For example::" msgstr "" +"برای متدی که یک رشته‌ی پیشوند منفرد را حذف می‌کند، نه همه‌ی نویسه‌های یک مجموعه را، " +"به :meth:`str.removeprefix` مراجعه کنید. برای مثال::" msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" @@ -2043,18 +3638,45 @@ msgid "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" msgstr "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" msgid "This static method returns a translation table usable for :meth:`str.translate`." msgstr "" +"این متد ایستا جدول ترجمه‌ای را برمی‌گرداند که برای :meth:`str.translate` قابل استفاده " +"است." -msgid "If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals." +msgid "" +"If there is only one argument, it must be a dictionary mapping Unicode ordinals " +"(integers) or characters (strings of length 1) to Unicode ordinals, strings (of " +"arbitrary lengths) or ``None``. Character keys will then be converted to ordinals." msgstr "" +"اگر تنها یک آرگومان وجود داشته باشد، باید یک دیکشنری باشد که اعداد ترتیبی یونیکد " +"(عددهای صحیح) یا نویسه‌ها (رشته‌هایی با طول ۱) را به اعداد ترتیبی یونیکد، رشته‌ها (با " +"طول‌های دلخواه) یا ``None`` نگاشت می‌کند. سپس کلیدهای نویسه‌ای به اعداد ترتیبی تبدیل " +"می‌شوند." -msgid "If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in *from* will be mapped to the character at the same position in *to*. If there is a third argument, it must be a string, whose characters will be mapped to ``None`` in the result." +msgid "" +"If there are two arguments, they must be strings of equal length, and in the resulting " +"dictionary, each character in *from* will be mapped to the character at the same " +"position in *to*. If there is a third argument, it must be a string, whose characters " +"will be mapped to ``None`` in the result." msgstr "" +"اگر دو آرگومان وجود داشته باشند، باید رشته‌هایی با طول برابر باشند و در دیکشنری حاصل، " +"هر نویسه در *from* به نویسه‌ای در همان جایگاه در *to* نگاشت می‌شود. اگر آرگومان سومی " +"وجود داشته باشد، باید یک رشته باشد که نویسه‌های آن در نتیجه به ``None`` نگاشت می‌شوند." -msgid "Split the string at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing the string itself, followed by two empty strings." +msgid "" +"Split the string at the first occurrence of *sep*, and return a 3-tuple containing the " +"part before the separator, the separator itself, and the part after the separator. If " +"the separator is not found, return a 3-tuple containing the string itself, followed by " +"two empty strings." msgstr "" +"رشته را در نخستین رخداد *sep* تفکیک می‌کند و یک تاپل سه‌عضوی شامل بخش پیش از جداکننده، " +"خودِ جداکننده و بخش پس از جداکننده را برمی‌گرداند. اگر جداکننده یافت نشود، تاپلی سه‌عضوی " +"شامل خودِ رشته و سپس دو رشته‌ی خالی را برمی‌گرداند." msgid "" ">>> 'Monty Python'.partition(' ')\n" @@ -2064,12 +3686,22 @@ msgid "" ">>> 'Monty Python'.partition('-')\n" "('Monty Python', '', '')" msgstr "" +">>> 'Monty Python'.partition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".partition(' ')\n" +"('Monty', ' ', \"Python's Flying Circus\")\n" +">>> 'Monty Python'.partition('-')\n" +"('Monty Python', '', '')" msgid "See also :meth:`rpartition`." -msgstr "" +msgstr "همچنین ببینید :meth:`rpartition`." -msgid "If the string starts with the *prefix* string, return ``string[len(prefix):]``. Otherwise, return a copy of the original string:" +msgid "" +"If the string starts with the *prefix* string, return ``string[len(prefix):]``. " +"Otherwise, return a copy of the original string:" msgstr "" +"اگر رشته با رشته‌ی *prefix* شروع شود، ``string[len(prefix):]`` را برمی‌گرداند. در غیر " +"این صورت، نسخه‌ای از رشته اصلی را برمی‌گرداند:" msgid "" ">>> 'TestHook'.removeprefix('Test')\n" @@ -2077,12 +3709,20 @@ msgid "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" msgstr "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" msgid "See also :meth:`removesuffix` and :meth:`startswith`." -msgstr "" +msgstr "همچنین ببینید :meth:`removesuffix` و :meth:`startswith`." -msgid "If the string ends with the *suffix* string and that *suffix* is not empty, return ``string[:-len(suffix)]``. Otherwise, return a copy of the original string:" +msgid "" +"If the string ends with the *suffix* string and that *suffix* is not empty, return " +"``string[:-len(suffix)]``. Otherwise, return a copy of the original string:" msgstr "" +"اگر رشته با رشته‌ی *پسوند* پایان یابد و آن *پسوند* خالی نباشد، ``string[:-" +"len(suffix)]`` را بازگردانید. در غیر این صورت، نسخه‌ای از رشته اصلی را بازگردانید:" msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" @@ -2090,12 +3730,22 @@ msgid "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" msgstr "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" msgid "See also :meth:`removeprefix` and :meth:`endswith`." -msgstr "" +msgstr "همچنین ببینید :meth:`removeprefix` و :meth:`endswith`." -msgid "Return a copy of the string with all occurrences of substring *old* replaced by *new*. If *count* is given, only the first *count* occurrences are replaced. If *count* is not specified or ``-1``, then all occurrences are replaced. For example:" +msgid "" +"Return a copy of the string with all occurrences of substring *old* replaced by " +"*new*. If *count* is given, only the first *count* occurrences are replaced. If " +"*count* is not specified or ``-1``, then all occurrences are replaced. For example:" msgstr "" +"یک نسخه از رشته را برمی‌گرداند که در آن تمام موارد زیررشته‌ی *old* با *new* جایگزین " +"شده‌اند. اگر *count* داده شود، تنها *count* مورد نخست جایگزین می‌شوند. اگر *count* مشخص " +"نشده باشد یا ``-1`` باشد، تمام موارد جایگزین می‌شوند. برای مثال:" msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" @@ -2103,12 +3753,22 @@ msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" "'eggs, spam, spam'" msgstr "" +">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" +"'eggs, eggs, eggs'\n" +">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" +"'eggs, spam, spam'" msgid "*count* is now supported as a keyword argument." -msgstr "" +msgstr "*count* اکنون به‌عنوان یک آرگومان کلیدواژه‌ای پشتیبانی می‌شود." -msgid "Return the highest index in the string where substring *sub* is found, such that *sub* is contained within ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` on failure. For example:" +msgid "" +"Return the highest index in the string where substring *sub* is found, such that *sub* " +"is contained within ``s[start:end]``. Optional arguments *start* and *end* are " +"interpreted as in slice notation. Return ``-1`` on failure. For example:" msgstr "" +"بالاترین اندیسی از رشته را که زیررشته‌ی *sub* در آن یافت می‌شود بازمی‌گرداند، به‌طوری که " +"*sub* درون ``s[start:end]`` قرار داشته باشد. آرگومان‌های اختیاری *start* و *end* مانند " +"نماد برش تفسیر می‌شوند. در صورت شکست، ``-1`` بازگردانده می‌شود. برای مثال:" msgid "" ">>> 'spam, spam, spam'.rfind('sp')\n" @@ -2116,12 +3776,20 @@ msgid "" ">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" "6" msgstr "" +">>> 'spam, spam, spam'.rfind('sp')\n" +"12\n" +">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" +"6" msgid "See also :meth:`find` and :meth:`rindex`." -msgstr "" +msgstr "همچنین :meth:`find` و :meth:`rindex` را ببینید." -msgid "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is not found. For example:" +msgid "" +"Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is not found. " +"For example:" msgstr "" +"مانند :meth:`rfind` است، اما هرگاه زیررشته‌ی *sub* پیدا نشود، :exc:`ValueError` را " +"پرتاب می‌کند. برای مثال:" msgid "" ">>> 'spam, spam, spam'.rindex('spam')\n" @@ -2133,12 +3801,26 @@ msgid "" " ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" msgstr "" +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" msgid "See also :meth:`index` and :meth:`find`." -msgstr "" +msgstr "همچنین ببینید :meth:`index` و :meth:`find`." -msgid "Return the string right justified in a string of length *width*. Padding is done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return the string right justified in a string of length *width*. Padding is done using " +"the specified *fillchar* (default is an ASCII space). The original string is returned " +"if *width* is less than or equal to ``len(s)``." msgstr "" +"رشته را در رشته‌ای به طول *width* راست‌چین بازمی‌گرداند. پرکردن با استفاده از *fillchar* " +"مشخص‌شده انجام می‌شود (پیش‌فرض یک فاصله ASCII است). اگر *width* کمتر یا مساوی ``len(s)`` " +"باشد، رشته اصلی برگردانده می‌شود." msgid "" ">>> 'Python'.rjust(10)\n" @@ -2148,12 +3830,25 @@ msgid "" ">>> 'Monty Python'.rjust(10, '.')\n" "'Monty Python'" msgstr "" +">>> 'Python'.rjust(10)\n" +"' Python'\n" +">>> 'Python'.rjust(10, '.')\n" +"'....Python'\n" +">>> 'Monty Python'.rjust(10, '.')\n" +"'Monty Python'" msgid "See also :meth:`ljust` and :meth:`zfill`." -msgstr "" +msgstr "همچنین ببینید :meth:`ljust` و :meth:`zfill`." -msgid "Split the string at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself." +msgid "" +"Split the string at the last occurrence of *sep*, and return a 3-tuple containing the " +"part before the separator, the separator itself, and the part after the separator. If " +"the separator is not found, return a 3-tuple containing two empty strings, followed by " +"the string itself." msgstr "" +"رشته را در آخرین وقوع *sep* می‌جایگاهد و یک تاپل سه‌عضوی شامل بخش قبل از جداکننده، خودِ " +"جداکننده و بخش بعد از جداکننده را بازمی‌گرداند. اگر جداکننده یافت نشود، یک تاپل سه‌عضوی " +"شامل دو رشته‌ی خالی و سپس خودِ رشته را بازمی‌گرداند." msgid "" ">>> 'Monty Python'.rpartition(' ')\n" @@ -2163,15 +3858,39 @@ msgid "" ">>> 'Monty Python'.rpartition('-')\n" "('', '', 'Monty Python')" msgstr "" +">>> 'Monty Python'.rpartition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".rpartition(' ')\n" +"(\"Monty Python's Flying\", ' ', 'Circus')\n" +">>> 'Monty Python'.rpartition('-')\n" +"('', '', 'Monty Python')" msgid "See also :meth:`partition`." -msgstr "" +msgstr "همچنین ببینید :meth:`partition`." -msgid "Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any whitespace string is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below." +msgid "" +"Return a list of the words in the string, using *sep* as the delimiter string. If " +"*maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If " +"*sep* is not specified or ``None``, any whitespace string is a separator. Except for " +"splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described " +"in detail below." msgstr "" +"فهرستی از واژه‌های موجود در رشته را بازمی‌گرداند، با استفاده از *sep* به‌عنوان رشته‌ی " +"جداکننده. اگر *maxsplit* داده شود، حداکثر *maxsplit* تقسیم انجام می‌شود، آن هم روی " +"موارد *راست‌ترین*. اگر *sep* مشخص نشده باشد یا ``None`` باشد، هر رشته‌ای از نویسه‌های " +"فضای خالی جداکننده محسوب می‌شود. به‌جز تقسیم از سمت راست، متد :meth:`rsplit` " +"مانند :meth:`split` رفتار می‌کند که در ادامه به تفصیل شرح داده شده است." -msgid "Return a copy of the string with trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a suffix; rather, all combinations of its values are stripped. For example:" +msgid "" +"Return a copy of the string with trailing characters removed. The *chars* argument is " +"a string specifying the set of characters to be removed. If omitted or ``None``, the " +"*chars* argument defaults to removing whitespace. The *chars* argument is not a " +"suffix; rather, all combinations of its values are stripped. For example:" msgstr "" +"یک نسخه از رشته را با حذف نویسه‌های پایانی برمی‌گرداند. آرگومان *chars* رشته‌ای است که " +"مجموعه‌ای از نویسه‌ها را برای حذف مشخص می‌کند. اگر حذف شود یا ``None`` باشد، آرگومان " +"*chars* به‌طور پیش‌فرض فضای سفید را حذف می‌کند. آرگومان *chars* یک پسوند نیست؛ بلکه همه‌ی " +"ترکیب‌های مقادیر آن حذف می‌شوند. برای مثال:" msgid "" ">>> ' spacious '.rstrip()\n" @@ -2179,9 +3898,17 @@ msgid "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" msgstr "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" -msgid "See :meth:`removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::" +msgid "" +"See :meth:`removesuffix` for a method that will remove a single suffix string rather " +"than all of a set of characters. For example::" msgstr "" +"برای متدی که به‌جای همه‌ی نویسه‌های یک مجموعه، یک رشته پسوند واحد را حذف " +"می‌کند، :meth:`removesuffix` را ببینید. برای مثال::" msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" @@ -2189,15 +3916,38 @@ msgid "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" msgstr "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" msgid "See also :meth:`strip`." -msgstr "" +msgstr "همچنین ببینید :meth:`strip`." -msgid "Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there is no limit on the number of splits (all possible splits are made)." +msgid "" +"Return a list of the words in the string, using *sep* as the delimiter string. If " +"*maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at " +"most ``maxsplit+1`` elements). If *maxsplit* is not specified or ``-1``, then there " +"is no limit on the number of splits (all possible splits are made)." msgstr "" +"فهرستی از واژه‌های موجود در رشته را با استفاده از *sep* به‌عنوان رشته‌ی جداکننده " +"بازمی‌گرداند. اگر *maxsplit* داده شود، حداکثر *maxsplit* جداسازی انجام می‌شود (بدین " +"ترتیب، فهرست حداکثر ``maxsplit+1`` المان خواهد داشت). اگر *maxsplit* مشخص نشده باشد یا " +"``-1`` باشد، هیچ محدودیتی بر تعداد جداسازی‌ها وجود ندارد (تمام جداسازی‌های ممکن انجام " +"می‌شوند)." -msgid "If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns ``['1', '', '2']``). The *sep* argument may consist of multiple characters as a single delimiter (to split with multiple delimiters, use :func:`re.split`). Splitting an empty string with a specified separator returns ``['']``." +msgid "" +"If *sep* is given, consecutive delimiters are not grouped together and are deemed to " +"delimit empty strings (for example, ``'1,,2'.split(',')`` returns ``['1', '', " +"'2']``). The *sep* argument may consist of multiple characters as a single delimiter " +"(to split with multiple delimiters, use :func:`re.split`). Splitting an empty string " +"with a specified separator returns ``['']``." msgstr "" +"اگر *sep* داده شود، جداکننده‌های متوالی با هم گروه‌بندی نمی‌شوند و به عنوان محدودکننده‌ی " +"رشته‌های خالی در نظر گرفته می‌شوند (برای مثال، ``'1,,2'.split(',')`` مقدار ``['1', '', " +"'2']`` را برمی‌گرداند). آرگومان *sep* می‌تواند شامل چندین نویسه به عنوان یک جداکننده‌ی " +"واحد باشد (برای جداسازی با چندین جداکننده، از :func:`re.split` استفاده کنید). جداسازی " +"یک رشته‌ی خالی با یک جداکننده‌ی مشخص، ``['']`` را برمی‌گرداند." msgid "" ">>> '1,2,3'.split(',')\n" @@ -2209,9 +3959,27 @@ msgid "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" msgstr "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" -msgid "If *sep* is not specified or is ``None``, a different splitting algorithm is applied: runs of consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the string has leading or trailing whitespace. Consequently, splitting an empty string or a string consisting of just whitespace with a ``None`` separator returns ``[]``." +msgid "" +"If *sep* is not specified or is ``None``, a different splitting algorithm is applied: " +"runs of consecutive whitespace are regarded as a single separator, and the result will " +"contain no empty strings at the start or end if the string has leading or trailing " +"whitespace. Consequently, splitting an empty string or a string consisting of just " +"whitespace with a ``None`` separator returns ``[]``." msgstr "" +"اگر *sep* مشخص نشده باشد یا ``None`` باشد، الگوریتم جداسازی متفاوتی اعمال می‌شود: " +"دنباله‌های متوالی از فضای خالی به‌عنوان یک جداکننده در نظر گرفته می‌شوند، و اگر رشته " +"دارای فضای خالی ابتدایی یا انتهایی باشد، نتیجه شامل هیچ رشته‌ی خالی در ابتدا یا انتها " +"نخواهد بود. در نتیجه، جداسازی یک رشته‌ی خالی یا رشته‌ای که فقط از فضای خالی تشکیل شده " +"است با جداکننده‌ی ``None`` مقدار ``[]`` را برمی‌گرداند." msgid "" ">>> '1 2 3'.split()\n" @@ -2221,9 +3989,19 @@ msgid "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" msgstr "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" -msgid "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only leading runs of consecutive whitespace are considered." +msgid "" +"If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only leading runs " +"of consecutive whitespace are considered." msgstr "" +"اگر *sep* مشخص نشده باشد یا ``None`` باشد و *maxsplit* برابر با ``0`` باشد، فقط " +"دنباله‌های متوالی فاصله‌های خالی ابتدایی در نظر گرفته می‌شوند." msgid "" ">>> \"\".split(None, 0)\n" @@ -2233,93 +4011,106 @@ msgid "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" msgstr "" +">>> \"\".split(None, 0)\n" +"[]\n" +">>> \" \".split(None, 0)\n" +"[]\n" +">>> \" foo \".split(maxsplit=0)\n" +"['foo ']" msgid "See also :meth:`join` and :meth:`rsplit`." -msgstr "" +msgstr "همچنین ببینید :meth:`join` و :meth:`rsplit`." -msgid "Return a list of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true." +msgid "" +"Return a list of the lines in the string, breaking at line boundaries. Line breaks " +"are not included in the resulting list unless *keepends* is given and true." msgstr "" +"فهرستی از خط‌های رشته را با شکستن در مرزهای خط برمی‌گرداند. شکستگی‌های خط در فهرست حاصل " +"گنجانده نمی‌شوند، مگر اینکه *keepends* داده شده و true باشد." -msgid "This method splits on the following line boundaries. In particular, the boundaries are a superset of :term:`universal newlines`." +msgid "" +"This method splits on the following line boundaries. In particular, the boundaries " +"are a superset of :term:`universal newlines`." msgstr "" +"این متد بر اساس مرزهای خطی زیر تفکیک می‌شود. به‌ویژه، این مرزها ابرمجموعه‌ای از :term:`خط‌های جدید همگانی (universal newlines) ` هستند." msgid "Representation" -msgstr "" +msgstr "بازنمایی" msgid "Description" -msgstr "" +msgstr "توضیح" msgid "``\\n``" -msgstr "" +msgstr "``\\n``" msgid "Line Feed" -msgstr "" +msgstr "تغذیه‌ی سطر (Line Feed)" msgid "``\\r``" -msgstr "" +msgstr "``\\r``" msgid "Carriage Return" -msgstr "" +msgstr "بازگشت به ابتدای سطر" msgid "``\\r\\n``" -msgstr "" +msgstr "``\\r\\n``" msgid "Carriage Return + Line Feed" -msgstr "" +msgstr "بازگشت به ابتدای سطر + تغذیه‌ی سطر" msgid "``\\v`` or ``\\x0b``" -msgstr "" +msgstr "``\\v`` یا ``\\x0b``" msgid "Line Tabulation" -msgstr "" +msgstr "جدول‌بندی خطی (Line Tabulation)" msgid "``\\f`` or ``\\x0c``" -msgstr "" +msgstr "``\\f`` یا ``\\x0c``" msgid "Form Feed" -msgstr "" +msgstr "تغذیه‌ی صفحه" msgid "``\\x1c``" -msgstr "" +msgstr "``\\x1c``" msgid "File Separator" -msgstr "" +msgstr "جداکننده فایل" msgid "``\\x1d``" -msgstr "" +msgstr "``\\x1d``" msgid "Group Separator" -msgstr "" +msgstr "جداکننده گروه" msgid "``\\x1e``" -msgstr "" +msgstr "``\\x1e``" msgid "Record Separator" -msgstr "" +msgstr "جداکننده‌ی رکورد" msgid "``\\x85``" -msgstr "" +msgstr "``\\x85``" msgid "Next Line (C1 Control Code)" -msgstr "" +msgstr "خط بعدی (کد کنترلی C1)" msgid "``\\u2028``" -msgstr "" +msgstr "``\\u2028``" msgid "Line Separator" -msgstr "" +msgstr "جداکننده‌ی خط" msgid "``\\u2029``" -msgstr "" +msgstr "``\\u2029``" msgid "Paragraph Separator" -msgstr "" +msgstr "جداکننده‌ی پاراگراف" msgid "``\\v`` and ``\\f`` added to list of line boundaries." -msgstr "" +msgstr "``\\v`` و ``\\f`` به فهرست مرزهای خط اضافه شدند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" @@ -2327,9 +4118,19 @@ msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" msgstr "" +">>> 'ab c\n" +"\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -msgid "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::" +msgid "" +"Unlike :meth:`~str.split` when a delimiter string *sep* is given, this method returns " +"an empty list for the empty string, and a terminal line break does not result in an " +"extra line::" msgstr "" +"برخلاف :meth:`~str.split` وقتی که رشته جداکننده *sep* داده شده باشد، این متد برای رشته " +"خالی یک فهرست خالی برمی‌گرداند و شکست خط انتهایی به یک خط اضافی منجر نمی‌شود::" msgid "" ">>> \"\".splitlines()\n" @@ -2337,9 +4138,13 @@ msgid "" ">>> \"One line\\n\".splitlines()\n" "['One line']" msgstr "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"One line\\n\".splitlines()\n" +"['One line']" msgid "For comparison, ``split('\\n')`` gives::" -msgstr "" +msgstr "برای مقایسه، ``split('\\n')`` نتیجه‌ی زیر را می‌دهد::" msgid "" ">>> ''.split('\\n')\n" @@ -2347,9 +4152,22 @@ msgid "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" msgstr "" +">>> ''.split('\n" +"')\n" +"['']\n" +">>> 'Two lines\\n'.split('\\n')\n" +"['Two lines', '']" -msgid "Return ``True`` if string starts with the *prefix*, otherwise return ``False``. *prefix* can also be a tuple of prefixes to look for. With optional *start*, test string beginning at that position. With optional *end*, stop comparing string at that position." +msgid "" +"Return ``True`` if string starts with the *prefix*, otherwise return ``False``. " +"*prefix* can also be a tuple of prefixes to look for. With optional *start*, test " +"string beginning at that position. With optional *end*, stop comparing string at that " +"position." msgstr "" +"اگر رشته با *prefix* آغاز شود، ``True`` را برمی‌گرداند، در غیر این صورت ``False`` را " +"برمی‌گرداند. *prefix* همچنین می‌تواند تاپلی از پیشوندها برای جست‌وجو باشد. با *start* " +"اختیاری، رشته از آن موقعیت آزمایش می‌شود. با *end* اختیاری، مقایسه رشته در آن موقعیت " +"متوقف می‌شود." msgid "" ">>> 'Python'.startswith('Py')\n" @@ -2359,15 +4177,30 @@ msgid "" ">>> 'Python is amazing'.startswith('is', 7)\n" "True" msgstr "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'a tuple of prefixes'.startswith(('at', 'a'))\n" +"True\n" +">>> 'Python is amazing'.startswith('is', 7)\n" +"True" msgid "See also :meth:`endswith` and :meth:`removeprefix`." -msgstr "" +msgstr "همچنین :meth:`endswith` و :meth:`removeprefix` را نیز ببینید." -msgid "Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped." +msgid "" +"Return a copy of the string with the leading and trailing characters removed. The " +"*chars* argument is a string specifying the set of characters to be removed. If " +"omitted or ``None``, the *chars* argument defaults to removing whitespace. The *chars* " +"argument is not a prefix or suffix; rather, all combinations of its values are " +"stripped." msgstr "" +"یک نسخه از رشته را با حذف نویسه‌های ابتدایی و انتهایی برمی‌گرداند. آرگومان *chars* " +"رشته‌ای است که مجموعه‌ای از نویسه‌ها را برای حذف مشخص می‌کند. اگر حذف شود یا ``None`` " +"باشد، آرگومان *chars* به‌طور پیش‌فرض نویسه‌های فضای خالی را حذف می‌کند. آرگومان *chars* یک " +"پیشوند یا پسوند نیست؛ بلکه تمام ترکیب‌های مقادیر آن حذف می‌شوند." msgid "Whitespace characters are defined by :meth:`str.isspace`." -msgstr "" +msgstr "نویسه‌های فضای خالی توسط :meth:`str.isspace` تعریف می‌شوند." msgid "" ">>> ' spacious '.strip()\n" @@ -2375,59 +4208,107 @@ msgid "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" msgstr "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" -msgid "The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A similar action takes place on the trailing end." +msgid "" +"The outermost leading and trailing *chars* argument values are stripped from the " +"string. Characters are removed from the leading end until reaching a string character " +"that is not contained in the set of characters in *chars*. A similar action takes " +"place on the trailing end." msgstr "" +"بیرونی‌ترین مقادیر آرگومان *chars* در ابتدا و انتهای رشته حذف می‌شوند. نویسه‌ها از سمت " +"ابتدا حذف می‌شوند تا به نویسه‌ای از رشته برسند که در مجموعه نویسه‌های *chars* وجود ندارد. " +"عمل مشابهی در سمت انتها انجام می‌شود." msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" msgstr "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" msgid "See also :meth:`rstrip`." -msgstr "" +msgstr "همچنین :meth:`rstrip` را ببینید." -msgid "Return a copy of the string with uppercase characters converted to lowercase and vice versa. For example:" +msgid "" +"Return a copy of the string with uppercase characters converted to lowercase and vice " +"versa. For example:" msgstr "" +"نسخه‌ای از رشته را برمی‌گرداند که در آن نویسه‌های بزرگ به کوچک و نویسه‌های کوچک به بزرگ " +"تبدیل شده‌اند. برای مثال:" msgid "" ">>> 'Hello World'.swapcase()\n" "'hELLO wORLD'" msgstr "" +">>> 'Hello World'.swapcase()\n" +"'hELLO wORLD'" -msgid "Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. For example:" +msgid "" +"Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. For " +"example:" msgstr "" +"توجه داشته باشید که لزوماً درست نیست که ``s.swapcase().swapcase() == s``. برای مثال:" msgid "" ">>> 'straße'.swapcase().swapcase()\n" "'strasse'" msgstr "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" msgid "See also :meth:`str.lower` and :meth:`str.upper`." -msgstr "" +msgstr "همچنین :meth:`str.lower` و :meth:`str.upper` را ببینید." -msgid "Return a titlecased version of the string where words start with an uppercase character and the remaining characters are lowercase." +msgid "" +"Return a titlecased version of the string where words start with an uppercase " +"character and the remaining characters are lowercase." msgstr "" +"نسخه‌ای عنوان‌نویسی‌شده (titlecased) از رشته را برمی‌گرداند که در آن واژه‌ها با یک نویسه بزرگ " +"آغاز می‌شوند و نویسه‌های باقی‌مانده کوچک هستند." msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" msgstr "" +">>> 'Hello world'.title()\n" +"'Hello World'" -msgid "The algorithm uses a simple language-independent definition of a word as groups of consecutive letters. The definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries, which may not be the desired result::" +msgid "" +"The algorithm uses a simple language-independent definition of a word as groups of " +"consecutive letters. The definition works in many contexts but it means that " +"apostrophes in contractions and possessives form word boundaries, which may not be the " +"desired result::" msgstr "" +"الگوریتم از تعریفی ساده و مستقل از زبان برای واژه استفاده می‌کند که بر اساس آن، واژه به " +"صورت گروه‌هایی از حروف پیاپی است. این تعریف در بسیاری از زمینه‌ها کار می‌کند، اما به این " +"معناست که آپاستروف‌ها در انقباض‌ها و صیغه‌های ملکی، مرز واژه تشکیل می‌دهند که ممکن است " +"نتیجه مطلوب نباشد::" msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> \"they're bill's friends from the UK\".title()\n" +"\"They'Re Bill'S Friends From The Uk\"" -msgid "The :func:`string.capwords` function does not have this problem, as it splits words on spaces only." +msgid "" +"The :func:`string.capwords` function does not have this problem, as it splits words on " +"spaces only." msgstr "" +"تابع :func:`string.capwords` این مشکل را ندارد، زیرا واژه‌ها را تنها بر اساس فاصله‌ها " +"جدا می‌کند." -msgid "Alternatively, a workaround for apostrophes can be constructed using regular expressions::" +msgid "" +"Alternatively, a workaround for apostrophes can be constructed using regular " +"expressions::" msgstr "" +"به‌عنوان جایگزین، می‌توان راه‌حلی برای آپوستروف‌ها با استفاده از عبارات باقاعده ساخت::" msgid "" ">>> import re\n" @@ -2439,27 +4320,79 @@ msgid "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"they're bill's friends.\")\n" +"\"They're Bill's Friends.\"" msgid "See also :meth:`istitle`." -msgstr "" +msgstr "همچنین ببینید :meth:`istitle`." -msgid "Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or :term:`sequence`. When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return ``None``, to delete the character from the return string; or raise a :exc:`LookupError` exception, to map the character to itself." +msgid "" +"Return a copy of the string in which each character has been mapped through the given " +"translation table. The table must be an object that implements indexing " +"via :meth:`~object.__getitem__`, typically a :term:`mapping` or :term:`sequence`. " +"When indexed by a Unicode ordinal (an integer), the table object can do any of the " +"following: return a Unicode ordinal or a string, to map the character to one or more " +"other characters; return ``None``, to delete the character from the return string; or " +"raise a :exc:`LookupError` exception, to map the character to itself." msgstr "" +"نسخه‌ای از رشته را برمی‌گرداند که در آن هر نویسه از طریق جدول ترجمه‌ی داده‌شده نگاشت شده " +"است. جدول باید یک شیء باشد که اندیس‌دهی از طریق :meth:`~object.__getitem__` را " +"پیاده‌سازی می‌کند، معمولاً یک :term:`نگاشت ` یا :term:`دنباله `. " +"هنگامی که شیء جدول با یک عدد ترتیبی یونیکد (یک عدد صحیح) اندیس‌دهی شود، می‌تواند هر یک " +"از کارهای زیر را انجام دهد: برگرداندن یک عدد ترتیبی یونیکد یا یک رشته، برای نگاشت " +"نویسه به یک یا چند نویسه دیگر؛ برگرداندن ``None``، برای حذف نویسه از رشته برگشتی؛ یا " +"پرتاب استثنای :exc:`LookupError`، برای نگاشت نویسه به خودش." -msgid "You can use :meth:`str.maketrans` to create a translation map from character-to-character mappings in different formats." +msgid "" +"You can use :meth:`str.maketrans` to create a translation map from character-to-" +"character mappings in different formats." msgstr "" +"می‌توانید از :meth:`str.maketrans` برای ایجاد یک نگاشت ترجمه از نگاشت‌های نویسه‌به‌نویسه " +"در قالب‌های مختلف استفاده کنید." -msgid "See also the :mod:`codecs` module for a more flexible approach to custom character mappings." +msgid "" +"See also the :mod:`codecs` module for a more flexible approach to custom character " +"mappings." msgstr "" +"برای رویکردی انعطاف‌پذیرتر به نگاشت‌های سفارشی نویسه‌ها، ماژول :mod:`codecs` را نیز " +"ببینید." -msgid "Return a copy of the string with all the cased characters [4]_ converted to uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` contains uncased characters or if the Unicode category of the resulting character(s) is not \"Lu\" (Letter, uppercase), but e.g. \"Lt\" (Letter, titlecase)." +msgid "" +"Return a copy of the string with all the cased characters [4]_ converted to " +"uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` contains " +"uncased characters or if the Unicode category of the resulting character(s) is not " +"\"Lu\" (Letter, uppercase), but e.g. \"Lt\" (Letter, titlecase)." msgstr "" +"یک کپی از رشته را برمی‌گرداند که در آن تمام نویسه‌های دارای حالت [4]_ به حروف بزرگ تبدیل " +"شده‌اند. توجه داشته باشید که ``s.upper().isupper()`` ممکن است ``False`` باشد اگر ``s`` " +"حاوی نویسه‌های بدون حالت باشد یا اگر دسته یونیکد نویسه‌های حاصل \"Lu\" (حرف، بزرگ) " +"نباشد، بلکه برای مثال \"Lt\" (حرف، حالت عنوان) باشد." -msgid "The uppercasing algorithm used is `described in section 3.13 'Default Case Folding' of the Unicode Standard `__." +msgid "" +"The uppercasing algorithm used is `described in section 3.13 'Default Case Folding' of " +"the Unicode Standard `__." msgstr "" +"الگوریتم تبدیل به حروف بزرگ استفاده‌شده `در بخش ۳.۱۳ «Default Case Folding» از " +"استاندارد یونیکد توضیح داده شده است `__." -msgid "Return a copy of the string left filled with ASCII ``'0'`` digits to make a string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled by inserting the padding *after* the sign character rather than before. The original string is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return a copy of the string left filled with ASCII ``'0'`` digits to make a string of " +"length *width*. A leading sign prefix (``'+'``/``'-'``) is handled by inserting the " +"padding *after* the sign character rather than before. The original string is returned " +"if *width* is less than or equal to ``len(s)``." msgstr "" +"یک کپی از رشته را برمی‌گرداند که از سمت چپ با ارقام ``'0'`` ASCII پر شده است تا رشته‌ای " +"به طول *width* بسازد. پیشوند علامت ابتدایی (``'+'``/``'-'``) به‌گونه‌ای مدیریت می‌شود که " +"پرکننده *بعد از* نویسه علامت درج می‌شود، نه قبل از آن. اگر *width* کمتر یا مساوی با " +"``len(s)`` باشد، رشته اصلی برگردانده می‌شود." msgid "" ">>> \"42\".zfill(5)\n" @@ -2467,59 +4400,103 @@ msgid "" ">>> \"-42\".zfill(5)\n" "'-0042'" msgstr "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" msgid "Formatted String Literals (f-strings)" -msgstr "" +msgstr "مقادیر لفظی رشته‌ای قالب‌بندی‌شده (اف‌استرینگ)" -msgid "The :keyword:`await` and :keyword:`async for` can be used in expressions within f-strings." +msgid "" +"The :keyword:`await` and :keyword:`async for` can be used in expressions within f-" +"strings." msgstr "" +"می‌توان از :keyword:`await` و :keyword:`async for` در عبارت‌های درون اف‌استرینگ‌ها استفاده " +"کرد." msgid "Added the debug specifier (``=``)" -msgstr "" +msgstr "افزودن مشخص‌کننده اشکال‌زدایی (``=``)" -msgid "Many restrictions on expressions within f-strings have been removed. Notably, nested strings, comments, and backslashes are now permitted." +msgid "" +"Many restrictions on expressions within f-strings have been removed. Notably, nested " +"strings, comments, and backslashes are now permitted." msgstr "" +"بسیاری از محدودیت‌های مربوط به عبارت‌های درون اف‌استرینگ‌ها برداشته شده‌اند. به‌ویژه، " +"رشته‌های تودرتو، کامنت‌ها و بک‌اسلش‌ها اکنون مجاز هستند." -msgid "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string literal that is prefixed with ``f`` or ``F``. This type of string literal allows embedding the results of arbitrary Python expressions within *replacement fields*, which are delimited by curly brackets (``{}``). Each replacement field must contain an expression, optionally followed by:" +msgid "" +"An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string literal " +"that is prefixed with ``f`` or ``F``. This type of string literal allows embedding the " +"results of arbitrary Python expressions within *replacement fields*, which are " +"delimited by curly brackets (``{}``). Each replacement field must contain an " +"expression, optionally followed by:" msgstr "" +"یک :dfn:`اف‌استرینگ ` (به‌طور رسمی یک :dfn:`رشته‌ی لفظی قالب‌بندی‌شده `) یک رشته‌ی لفظی است که پیشوند ``f`` یا ``F`` دارد. این نوع از رشته‌ی لفظی " +"امکان جاسازی نتایج عبارت‌های دلخواه پایتون را درون *فیلدهای جایگزینی* فراهم می‌کند، که " +"با آکولادها (``{}``) محدود شده‌اند. هر فیلد جایگزینی باید شامل یک عبارت باشد، و به‌صورت " +"اختیاری به دنبال آن:" msgid "a *debug specifier* -- an equal sign (``=``);" -msgstr "" +msgstr "یک *مشخص‌کننده اشکال‌زدایی* — یک علامت مساوی (``=``)؛" msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" -msgstr "" +msgstr "یک *مشخص‌کننده تبدیل* -- ``!s``، ``!r`` یا ``!a``؛ و/یا" msgid "a *format specifier* prefixed with a colon (``:``)." -msgstr "" +msgstr "یک *مشخص‌کننده قالب* با پیشوند دونقطه (``:``)." -msgid "See the :ref:`Lexical Analysis section on f-strings ` for details on the syntax of these fields." +msgid "" +"See the :ref:`Lexical Analysis section on f-strings ` for details on the " +"syntax of these fields." msgstr "" +"برای جزئیات نحو این فیلدها، به :ref:`بخش تحلیل واژگانی مربوط به اف‌استرینگ‌ها ` مراجعه کنید." msgid "Debug specifier" -msgstr "" +msgstr "مشخص‌کننده اشکال‌زدایی" -msgid "If a debug specifier -- an equal sign (``=``) -- appears after the replacement field expression, the resulting f-string will contain the expression's source, the equal sign, and the value of the expression. This is often useful for debugging::" +msgid "" +"If a debug specifier -- an equal sign (``=``) -- appears after the replacement field " +"expression, the resulting f-string will contain the expression's source, the equal " +"sign, and the value of the expression. This is often useful for debugging::" msgstr "" +"اگر یک مشخص‌کننده اشکال‌زدایی (debug specifier) — یعنی یک علامت مساوی (``=``) — پس از " +"عبارت فیلد جایگزینی ظاهر شود، اف‌استرینگ حاصل شامل متن منبع عبارت، علامت مساوی و مقدار " +"عبارت خواهد بود. این موضوع اغلب برای اشکال‌زدایی مفید است::" msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" "'number=14.3'" msgstr "" +">>> number = 14.3\n" +">>> f'{number=}'\n" +"'number=14.3'" -msgid "Whitespace before, inside and after the expression, as well as whitespace after the equal sign, is significant --- it is retained in the result::" +msgid "" +"Whitespace before, inside and after the expression, as well as whitespace after the " +"equal sign, is significant --- it is retained in the result::" msgstr "" +"فضای خالی پیش از عبارت، درون آن و پس از آن، و همچنین فضای خالی پس از علامت مساوی، " +"معنادار است --- در نتیجه حفظ می‌شود::" msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" msgstr "" +">>> f'{ number - 4 = }'\n" +"' number - 4 = 10.3'" msgid "Conversion specifier" -msgstr "" +msgstr "مشخص‌کننده تبدیل" -msgid "By default, the value of a replacement field expression is converted to a string using :func:`str`::" +msgid "" +"By default, the value of a replacement field expression is converted to a string " +"using :func:`str`::" msgstr "" +"به‌طور پیش‌فرض، مقدار عبارت فیلد جایگزینی با استفاده از :func:`str` به رشته تبدیل می‌شود::" msgid "" ">>> from fractions import Fraction\n" @@ -2527,26 +4504,36 @@ msgid "" ">>> f'{one_third}'\n" "'1/3'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third}'\n" +"'1/3'" -msgid "When a debug specifier but no format specifier is used, the default conversion instead uses :func:`repr`::" +msgid "" +"When a debug specifier but no format specifier is used, the default conversion instead " +"uses :func:`repr`::" msgstr "" +"هنگامی که از مشخص‌کننده اشکال‌زدایی استفاده شود ولی از مشخص‌کننده قالب استفاده نشود، " +"تبدیل پیش‌فرض در عوض از :func:`repr` استفاده می‌کند::" msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" msgstr "" +">>> f'{one_third = }'\n" +"'one_third = Fraction(1, 3)'" msgid "The conversion can be specified explicitly using one of these specifiers:" -msgstr "" +msgstr "تبدیل را می‌توان به‌صراحت با استفاده از یکی از این مشخص‌کننده‌ها مشخص کرد:" msgid "``!s`` for :func:`str`" -msgstr "" +msgstr "``!s`` برای :func:`str`" msgid "``!r`` for :func:`repr`" -msgstr "" +msgstr "``!r`` برای :func:`repr`" msgid "``!a`` for :func:`ascii`" -msgstr "" +msgstr "``!a`` برای :func:`ascii`" msgid "" ">>> str(one_third)\n" @@ -2564,12 +4551,36 @@ msgid "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" msgstr "" +">>> str(one_third)\n" +"'1/3'\n" +">>> repr(one_third)\n" +"'Fraction(1, 3)'\n" +"\n" +">>> f'{one_third!s} is {one_third!r}'\n" +"'1/3 is Fraction(1, 3)'\n" +"\n" +">>> string = \"¡kočka 😸!\"\n" +">>> ascii(string)\n" +"\"'\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"\n" +"\n" +">>> f'{string = !a}'\n" +"\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" msgid "Format specifier" -msgstr "" +msgstr "مشخص‌کننده قالب" -msgid "After the expression has been evaluated, and possibly converted using an explicit conversion specifier, it is formatted using the :func:`format` function. If the replacement field includes a *format specifier* introduced by a colon (``:``), the specifier is passed to :func:`!format` as the second argument. The result of :func:`!format` is then used as the final value for the replacement field. For example::" +msgid "" +"After the expression has been evaluated, and possibly converted using an explicit " +"conversion specifier, it is formatted using the :func:`format` function. If the " +"replacement field includes a *format specifier* introduced by a colon (``:``), the " +"specifier is passed to :func:`!format` as the second argument. The result of :func:`!" +"format` is then used as the final value for the replacement field. For example::" msgstr "" +"پس از اینکه عبارت ارزیابی شد و احتمالاً با استفاده از یک مشخص‌کننده تبدیل صریح تبدیل " +"گردید، با استفاده از تابع :func:`format` قالب‌بندی می‌شود. اگر فیلد جایگزینی شامل یک " +"*مشخص‌کننده قالب* باشد که با علامت دونقطه (``:``) معرفی شده باشد، آن مشخص‌کننده به‌عنوان " +"آرگومان دوم به :func:`!format` ارسال می‌شود. سپس نتیجه :func:`!format` به‌عنوان مقدار " +"نهایی فیلد جایگزینی استفاده می‌شود. برای مثال::" msgid "" ">>> from fractions import Fraction\n" @@ -2583,447 +4594,844 @@ msgid "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" msgstr "" +">>> from fractions import Fraction\n" +">>> one_third = Fraction(1, 3)\n" +">>> f'{one_third:.6f}'\n" +"'0.333333'\n" +">>> f'{one_third:_^+10}'\n" +"'___+1/3___'\n" +">>> >>> f'{one_third!r:_^20}'\n" +"'___Fraction(1, 3)___'\n" +">>> f'{one_third = :~>10}~'\n" +"'one_third = ~~~~~~~1/3~'" msgid "Template String Literals (t-strings)" -msgstr "" +msgstr "مقادیر لفظی رشته‌ی قالبی (t-strings)" -msgid "An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string literal that is prefixed with ``t`` or ``T``." +msgid "" +"An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string literal " +"that is prefixed with ``t`` or ``T``." msgstr "" +"یک :dfn:`t-string` (به‌طور رسمی یک :dfn:`template string literal`) یک لفظی رشته است " +"که پیشوند آن ``t`` یا ``T`` است." -msgid "These strings follow the same syntax and evaluation rules as :ref:`formatted string literals `, with for the following differences:" +msgid "" +"These strings follow the same syntax and evaluation rules as :ref:`formatted string " +"literals `, with for the following differences:" msgstr "" +"این رشته‌ها از همان نحو و قواعد ارزیابی :ref:`formatted string literals ` پیروی می‌کنند، با تفاوت‌های زیر:" -msgid "Rather than evaluating to a ``str`` object, template string literals evaluate to a :class:`string.templatelib.Template` object." +msgid "" +"Rather than evaluating to a ``str`` object, template string literals evaluate to " +"a :class:`string.templatelib.Template` object." msgstr "" +"به جای ارزیابی شدن به یک شیء ``str``، مقادیر لفظی رشته‌ای قالب به یک " +"شیء :class:`string.templatelib.Template` ارزیابی می‌شوند." -msgid "The :func:`format` protocol is not used. Instead, the format specifier and conversions (if any) are passed to a new :class:`~string.templatelib.Interpolation` object that is created for each evaluated expression. It is up to code that processes the resulting :class:`~string.templatelib.Template` object to decide how to handle format specifiers and conversions." +msgid "" +"The :func:`format` protocol is not used. Instead, the format specifier and conversions " +"(if any) are passed to a new :class:`~string.templatelib.Interpolation` object that is " +"created for each evaluated expression. It is up to code that processes the " +"resulting :class:`~string.templatelib.Template` object to decide how to handle format " +"specifiers and conversions." msgstr "" +"از پروتکل :func:`format` استفاده نمی‌شود. در عوض، مشخص‌کننده‌ی قالب و تبدیل‌ها (در صورت " +"وجود) به یک شیء جدید :class:`~string.templatelib.Interpolation` منتقل می‌شوند که برای " +"هر عبارت ارزیابی‌شده ایجاد می‌شود. تصمیم درباره‌ی نحوه‌ی مدیریت مشخص‌کننده‌های قالب و " +"تبدیل‌ها بر عهده‌ی کدی است که شیء :class:`~string.templatelib.Template` حاصل را پردازش " +"می‌کند." -msgid "Format specifiers containing nested replacement fields are evaluated eagerly, prior to being passed to the :class:`~string.templatelib.Interpolation` object. For instance, an interpolation of the form ``{amount:.{precision}f}`` will evaluate the inner expression ``{precision}`` to determine the value of the ``format_spec`` attribute. If ``precision`` were to be ``2``, the resulting format specifier would be ``'.2f'``." +msgid "" +"Format specifiers containing nested replacement fields are evaluated eagerly, prior to " +"being passed to the :class:`~string.templatelib.Interpolation` object. For instance, " +"an interpolation of the form ``{amount:.{precision}f}`` will evaluate the inner " +"expression ``{precision}`` to determine the value of the ``format_spec`` attribute. If " +"``precision`` were to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" +"مشخص‌کننده‌های قالب حاوی فیلدهای جایگزینی تودرتو، پیش از آنکه به " +"شیء :class:`~string.templatelib.Interpolation` منتقل شوند، به‌صورت فوری ارزیابی می‌شوند. " +"برای مثال، یک درون‌یابی به شکل ``{amount:.{precision}f}``، عبارت درونی ``{precision}`` " +"را ارزیابی می‌کند تا مقدار ویژگی ``format_spec`` تعیین شود. اگر ``precision`` برابر با " +"``2`` باشد، مشخص‌کننده قالب حاصل ``'.2f'`` خواهد بود." -msgid "When the equals sign ``'='`` is provided in an interpolation expression, the text of the expression is appended to the literal string that precedes the relevant interpolation. This includes the equals sign and any surrounding whitespace. The :class:`!Interpolation` instance for the expression will be created as normal, except that :attr:`~string.templatelib.Interpolation.conversion` will be set to '``r``' (:func:`repr`) by default. If an explicit conversion or format specifier are provided, this will override the default behaviour." +msgid "" +"When the equals sign ``'='`` is provided in an interpolation expression, the text of " +"the expression is appended to the literal string that precedes the relevant " +"interpolation. This includes the equals sign and any surrounding whitespace. " +"The :class:`!Interpolation` instance for the expression will be created as normal, " +"except that :attr:`~string.templatelib.Interpolation.conversion` will be set to " +"'``r``' (:func:`repr`) by default. If an explicit conversion or format specifier are " +"provided, this will override the default behaviour." msgstr "" +"هنگامی که علامت تساوی ``'='`` در یک عبارت درون‌یابی (interpolation) ارائه شود، متن " +"عبارت به رشته‌ی تحت‌اللفظی که پیش از درون‌یابی مربوطه قرار دارد افزوده می‌شود. این شامل " +"علامت تساوی و هرگونه فضای سفید اطراف آن نیز می‌شود. نمونه‌ی :class:`!Interpolation` برای " +"عبارت به‌صورت عادی ایجاد می‌شود، با این تفاوت " +"که :attr:`~string.templatelib.Interpolation.conversion` به‌طور پیش‌فرض روی '``r``' " +"(:func:`repr`) تنظیم می‌شود. اگر تبدیل یا مشخص‌کننده‌ی قالب صریحی ارائه شود، این رفتار " +"پیش‌فرض را لغو می‌کند." msgid "``printf``-style String Formatting" -msgstr "" +msgstr "قالب‌بندی رشته به‌سبک ``printf``" -msgid "The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly)." +msgid "" +"The formatting operations described here exhibit a variety of quirks that lead to a " +"number of common errors (such as failing to display tuples and dictionaries correctly)." msgstr "" +"عملیات قالب‌بندی توصیف‌شده در اینجا دارای رفتارهای عجیب گوناگونی است که به تعدادی از " +"خطاهای رایج منجر می‌شوند (مانند عدم نمایش صحیح تاپل‌ها و دیکشنری‌ها)." -msgid "Using :ref:`formatted string literals `, the :meth:`str.format` interface, or :class:`string.Template` may help avoid these errors. Each of these alternatives provides their own trade-offs and benefits of simplicity, flexibility, and/or extensibility." +msgid "" +"Using :ref:`formatted string literals `, the :meth:`str.format` interface, " +"or :class:`string.Template` may help avoid these errors. Each of these alternatives " +"provides their own trade-offs and benefits of simplicity, flexibility, and/or " +"extensibility." msgstr "" +"استفاده از :ref:`مقادیر لفظی رشته‌ای قالب‌بندی‌شده `، رابط :meth:`str.format`، " +"یا :class:`string.Template` می‌تواند به جلوگیری از این خطاها کمک کند. هر یک از این " +"جایگزین‌ها، مصالحه‌ها و مزایای خاص خود را از نظر سادگی، انعطاف‌پذیری و/یا توسعه‌پذیری " +"دارند." -msgid "String objects have one unique built-in operation: the ``%`` operator (modulo). This is also known as the string *formatting* or *interpolation* operator. Given ``format % values`` (where *format* is a string), ``%`` conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` function in the C language. For example:" +msgid "" +"String objects have one unique built-in operation: the ``%`` operator (modulo). This " +"is also known as the string *formatting* or *interpolation* operator. Given ``format % " +"values`` (where *format* is a string), ``%`` conversion specifications in *format* are " +"replaced with zero or more elements of *values*. The effect is similar to using " +"the :c:func:`sprintf` function in the C language. For example:" msgstr "" +"اشیای رشته یک عملیات توکار منحصربه‌فرد دارند: عملگر ``%`` (پیمانه). این عملگر به‌عنوان " +"عملگر *قالب‌بندی* یا *درون‌یابی* رشته نیز شناخته می‌شود. با فرض ``format % values`` (که " +"در آن *format* یک رشته است)، مشخصات تبدیل ``%`` در *format* با صفر یا چند عنصر از " +"*values* جایگزین می‌شوند. اثر آن مشابه استفاده از تابع :c:func:`sprintf` در زبان C است. " +"برای مثال:" msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." -msgid "If *format* requires a single argument, *values* may be a single non-tuple object. [5]_ Otherwise, *values* must be a tuple with exactly the number of items specified by the format string, or a single mapping object (for example, a dictionary)." +msgid "" +"If *format* requires a single argument, *values* may be a single non-tuple object. " +"[5]_ Otherwise, *values* must be a tuple with exactly the number of items specified " +"by the format string, or a single mapping object (for example, a dictionary)." msgstr "" +"اگر *format* به یک آرگومان واحد نیاز داشته باشد، *values* می‌تواند یک شیء واحد باشد که " +"تاپل نیست. [5]_ در غیر این صورت، *values* باید یک تاپل با دقیقاً همان تعداد آیتمی باشد " +"که رشته قالب مشخص می‌کند، یا یک شیء نگاشت واحد (برای مثال، یک دیکشنری)." -msgid "A conversion specifier contains two or more characters and has the following components, which must occur in this order:" +msgid "" +"A conversion specifier contains two or more characters and has the following " +"components, which must occur in this order:" msgstr "" +"یک مشخص‌کننده تبدیل شامل دو یا چند نویسه است و دارای اجزای زیر است، که باید به همین " +"ترتیب ظاهر شوند:" msgid "The ``'%'`` character, which marks the start of the specifier." -msgstr "" +msgstr "نویسه‌ی ``'%'``، که آغاز مشخص‌کننده را علامت‌گذاری می‌کند." -msgid "Mapping key (optional), consisting of a parenthesised sequence of characters (for example, ``(somename)``)." +msgid "" +"Mapping key (optional), consisting of a parenthesised sequence of characters (for " +"example, ``(somename)``)." msgstr "" +"کلید نگاشت (اختیاری)، شامل دنباله‌ای از نویسه‌های داخل پرانتز (برای مثال، " +"``(somename)``)." msgid "Conversion flags (optional), which affect the result of some conversion types." -msgstr "" +msgstr "پرچم‌های تبدیل (اختیاری)، که بر نتیجه‌ی برخی از انواع تبدیل تأثیر می‌گذارند." -msgid "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual width is read from the next element of the tuple in *values*, and the object to convert comes after the minimum field width and optional precision." +msgid "" +"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the actual " +"width is read from the next element of the tuple in *values*, and the object to " +"convert comes after the minimum field width and optional precision." msgstr "" +"حداقل عرض فیلد (اختیاری). اگر به‌صورت ``'*'`` (ستاره) مشخص شده باشد، عرض واقعی از المان " +"بعدی تاپل در *values* خوانده می‌شود و شیء موردنظر برای تبدیل، پس از حداقل عرض فیلد و " +"دقت اختیاری می‌آید." -msgid "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If specified as ``'*'`` (an asterisk), the actual precision is read from the next element of the tuple in *values*, and the value to convert comes after the precision." +msgid "" +"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " +"specified as ``'*'`` (an asterisk), the actual precision is read from the next element " +"of the tuple in *values*, and the value to convert comes after the precision." msgstr "" +"دقت (اختیاری)، به صورت یک ``'.'`` (نقطه) و سپس مقدار دقت داده می‌شود. اگر به صورت " +"``'*'`` (ستاره) مشخص شده باشد، دقت واقعی از آیتم بعدی تاپل در *values* خوانده می‌شود و " +"مقداری که باید تبدیل شود، پس از دقت می‌آید." msgid "Length modifier (optional)." -msgstr "" +msgstr "اصلاح‌کننده طول (اختیاری)." msgid "Conversion type." -msgstr "" +msgstr "نوع تبدیل." -msgid "When the right argument is a dictionary (or other mapping type), then the formats in the string *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:" +msgid "" +"When the right argument is a dictionary (or other mapping type), then the formats in " +"the string *must* include a parenthesised mapping key into that dictionary inserted " +"immediately after the ``'%'`` character. The mapping key selects the value to be " +"formatted from the mapping. For example:" msgstr "" +"وقتی آرگومان سمت راست یک دیکشنری (یا نوع نگاشتی دیگری) باشد، قالب‌های درون رشته *باید* " +"شامل یک کلید نگاشت داخل پرانتز برای آن دیکشنری باشند که بلافاصله پس از نویسه ``'%'`` " +"قرار می‌گیرد. کلید نگاشت، مقداری را که باید قالب‌بندی شود از نگاشت انتخاب می‌کند. برای " +"مثال:" -msgid "In this case no ``*`` specifiers may occur in a format (since they require a sequential parameter list)." +msgid "" +"In this case no ``*`` specifiers may occur in a format (since they require a " +"sequential parameter list)." msgstr "" +"در این حالت، هیچ مشخص‌کننده‌ی ``*`` نمی‌تواند در قالب ظاهر شود (زیرا این مشخص‌کننده‌ها به " +"یک فهرست پارامتر ترتیبی نیاز دارند)." msgid "The conversion flag characters are:" -msgstr "" +msgstr "نویسه‌های پرچم تبدیل عبارتند از:" msgid "Flag" -msgstr "" +msgstr "پرچم" msgid "``'#'``" -msgstr "" +msgstr "``'#'``" msgid "The value conversion will use the \"alternate form\" (where defined below)." -msgstr "" +msgstr "تبدیل مقدار از «قالب جایگزین» استفاده خواهد کرد (که در زیر تعریف شده است)." msgid "``'0'``" -msgstr "" +msgstr "``'0'``" msgid "The conversion will be zero padded for numeric values." -msgstr "" +msgstr "برای مقادیر عددی، تبدیل با صفر پر می‌شود." msgid "``'-'``" -msgstr "" +msgstr "``'-'``" -msgid "The converted value is left adjusted (overrides the ``'0'`` conversion if both are given)." +msgid "" +"The converted value is left adjusted (overrides the ``'0'`` conversion if both are " +"given)." msgstr "" +"مقدار تبدیل‌شده چپ‌چین می‌شود (اگر هر دو داده شوند، تبدیل ``'0'`` را نادیده می‌گیرد)." msgid "``' '``" -msgstr "" +msgstr "``' '``" -msgid "(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion." +msgid "" +"(a space) A blank should be left before a positive number (or empty string) produced " +"by a signed conversion." msgstr "" +"(یک فاصله) باید پیش از یک عدد مثبت (یا رشته‌ی خالی) که از یک تبدیل علامت‌دار حاصل می‌شود، " +"یک فاصله گذاشته شود." msgid "``'+'``" -msgstr "" +msgstr "``'+'``" -msgid "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides a \"space\" flag)." +msgid "" +"A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides a " +"\"space\" flag)." msgstr "" +"یک نویسه‌ی علامت (``'+'`` یا ``'-'``) پیش از تبدیل قرار می‌گیرد (پرچم «space» را نادیده " +"می‌گیرد)." -msgid "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." +msgid "" +"A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as it is not " +"necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" +"یک تغییردهنده طول (``h``، ``l`` یا ``L``) ممکن است وجود داشته باشد، اما نادیده گرفته " +"می‌شود زیرا برای پایتون ضروری نیست — بنابراین مثلاً ``%ld`` معادل ``%d`` است." msgid "The conversion types are:" -msgstr "" +msgstr "انواع تبدیل عبارتند از:" msgid "Conversion" -msgstr "" +msgstr "تبدیل" msgid "``'d'``" -msgstr "" +msgstr "``'d'``" msgid "Signed integer decimal." -msgstr "" +msgstr "عدد صحیح ده‌دهی علامت‌دار." msgid "``'i'``" -msgstr "" +msgstr "``'i'``" msgid "``'o'``" -msgstr "" +msgstr "``'o'``" msgid "Signed octal value." -msgstr "" +msgstr "مقدار مبنای هشت علامت‌دار." msgid "``'u'``" -msgstr "" +msgstr "``'u'``" msgid "Obsolete type -- it is identical to ``'d'``." -msgstr "" +msgstr "نوع منسوخ — این نوع با ``'d'`` یکسان است." msgid "``'x'``" -msgstr "" +msgstr "``'x'``" msgid "Signed hexadecimal (lowercase)." -msgstr "" +msgstr "مبنای شانزده علامت‌دار (حروف کوچک)." msgid "``'X'``" -msgstr "" +msgstr "``'X'``" msgid "Signed hexadecimal (uppercase)." -msgstr "" +msgstr "مبنای شانزده علامت‌دار (حروف بزرگ)." msgid "``'e'``" -msgstr "" +msgstr "``'e'``" msgid "Floating-point exponential format (lowercase)." -msgstr "" +msgstr "قالب نمایی ممیز شناور (حروف کوچک)." msgid "``'E'``" -msgstr "" +msgstr "``'E'``" msgid "Floating-point exponential format (uppercase)." -msgstr "" +msgstr "قالب نمایی عدد ممیز شناور (حروف بزرگ)." msgid "``'f'``" -msgstr "" +msgstr "``'f'``" msgid "Floating-point decimal format." -msgstr "" +msgstr "قالب دهدهی ممیز شناور." msgid "``'F'``" -msgstr "" +msgstr "``'F'``" msgid "``'g'``" -msgstr "" +msgstr "``'g'``" -msgid "Floating-point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise." +msgid "" +"Floating-point format. Uses lowercase exponential format if exponent is less than -4 " +"or not less than precision, decimal format otherwise." msgstr "" +"قالب ممیز شناور. اگر توان کمتر از منفی ۴ باشد یا از دقت کمتر نباشد، از قالب نمایی با " +"حروف کوچک استفاده می‌شود؛ در غیر این صورت قالب اعشاری استفاده می‌شود." msgid "``'G'``" -msgstr "" +msgstr "``'G'``" -msgid "Floating-point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise." +msgid "" +"Floating-point format. Uses uppercase exponential format if exponent is less than -4 " +"or not less than precision, decimal format otherwise." msgstr "" +"قالب ممیز شناور. اگر توان کمتر از -۴ باشد یا از دقت کمتر نباشد، از قالب نمایی با حروف " +"بزرگ استفاده می‌شود؛ در غیر این صورت قالب دهدهی به کار می‌رود." msgid "``'c'``" -msgstr "" +msgstr "``'c'``" msgid "Single character (accepts integer or single character string)." -msgstr "" +msgstr "نویسه‌ی منفرد (عدد صحیح یا رشته‌ی تک‌نویسه‌ای را می‌پذیرد)." msgid "``'r'``" -msgstr "" +msgstr "``'r'``" msgid "String (converts any Python object using :func:`repr`)." -msgstr "" +msgstr "رشته (هر شیء پایتون را با استفاده از :func:`repr` تبدیل می‌کند)." msgid "``'s'``" -msgstr "" +msgstr "``'s'``" msgid "String (converts any Python object using :func:`str`)." -msgstr "" +msgstr "رشته (هر شیء پایتون را با استفاده از :func:`str` تبدیل می‌کند)." msgid "``'a'``" -msgstr "" +msgstr "``'a'``" msgid "String (converts any Python object using :func:`ascii`)." -msgstr "" +msgstr "رشته (هر شیء پایتون را با استفاده از :func:`ascii` تبدیل می‌کند)." msgid "``'%'``" -msgstr "" +msgstr "``'%'``" msgid "No argument is converted, results in a ``'%'`` character in the result." -msgstr "" +msgstr "هیچ آرگومانی تبدیل نمی‌شود و یک نویسه ``'%'`` در نتیجه ایجاد می‌شود." -msgid "For floating-point formats, the result should be correctly rounded to a given precision ``p`` of digits after the decimal point. The rounding mode matches that of the :func:`round` builtin." +msgid "" +"For floating-point formats, the result should be correctly rounded to a given " +"precision ``p`` of digits after the decimal point. The rounding mode matches that of " +"the :func:`round` builtin." msgstr "" +"برای قالب‌های ممیز شناور، نتیجه باید به‌درستی تا دقت ``p`` رقم پس از نقطه اعشار گرد شود. " +"حالت گرد کردن مطابق با تابع توکار :func:`round` است." -msgid "The alternate form causes a leading octal specifier (``'0o'``) to be inserted before the first digit." +msgid "" +"The alternate form causes a leading octal specifier (``'0o'``) to be inserted before " +"the first digit." msgstr "" +"حالت جایگزین باعث می‌شود یک مشخص‌کننده‌ی مبنای هشت (``'0o'``) پیش از نخستین رقم درج شود." -msgid "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit." +msgid "" +"The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether the " +"``'x'`` or ``'X'`` format was used) to be inserted before the first digit." msgstr "" +"حالت جایگزین باعث می‌شود یک پیشوند ``'0x'`` یا ``'0X'`` (بسته به اینکه قالب ``'x'`` یا " +"``'X'`` استفاده شده باشد) پیش از نخستین رقم درج شود." -msgid "The alternate form causes the result to always contain a decimal point, even if no digits follow it." +msgid "" +"The alternate form causes the result to always contain a decimal point, even if no " +"digits follow it." msgstr "" +"حالت جایگزین باعث می‌شود نتیجه همیشه حاوی یک نقطه اعشار باشد، حتی اگر هیچ رقمی پس از آن " +"نیاید." -msgid "The precision determines the number of digits after the decimal point and defaults to 6." -msgstr "" +msgid "" +"The precision determines the number of digits after the decimal point and defaults to " +"6." +msgstr "دقت، تعداد ارقام پس از نقطه اعشار را تعیین می‌کند و مقدار پیش‌فرض آن ۶ است." -msgid "The alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be." +msgid "" +"The alternate form causes the result to always contain a decimal point, and trailing " +"zeroes are not removed as they would otherwise be." msgstr "" +"حالت جایگزین موجب می‌شود که نتیجه همیشه حاوی یک نقطه اعشار باشد و صفرهای پایانی حذف " +"نشوند، در حالی که در غیر این صورت حذف می‌شدند." -msgid "The precision determines the number of significant digits before and after the decimal point and defaults to 6." +msgid "" +"The precision determines the number of significant digits before and after the decimal " +"point and defaults to 6." msgstr "" +"دقت، تعداد ارقام معنادار پیش از نقطه اعشار و پس از آن را تعیین می‌کند و پیش‌فرض آن ۶ است." msgid "If precision is ``N``, the output is truncated to ``N`` characters." -msgstr "" +msgstr "اگر دقت ``N`` باشد، خروجی به ``N`` نویسه بریده می‌شود." msgid "See :pep:`237`." -msgstr "" +msgstr ":pep:`237` را ببینید." -msgid "Since Python strings have an explicit length, ``%s`` conversions do not assume that ``'\\0'`` is the end of the string." +msgid "" +"Since Python strings have an explicit length, ``%s`` conversions do not assume that " +"``'\\0'`` is the end of the string." msgstr "" +"از آنجا که رشته‌های پایتون طول صریحی دارند، تبدیلات ``%s`` فرض نمی‌کنند که ``'\\0'`` " +"پایان رشته باشد." -msgid "``%f`` conversions for numbers whose absolute value is over 1e50 are no longer replaced by ``%g`` conversions." +msgid "" +"``%f`` conversions for numbers whose absolute value is over 1e50 are no longer " +"replaced by ``%g`` conversions." msgstr "" +"تبدیل‌های ``%f`` برای اعدادی که قدر مطلق آن‌ها بیش از 1e50 است، دیگر با تبدیل‌های ``%g`` " +"جایگزین نمی‌شوند." msgid "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview`" msgstr "" +"انواع دنباله‌ای دودویی --- :class:`bytes`، :class:`bytearray`، :class:`memoryview`" -msgid "The core built-in types for manipulating binary data are :class:`bytes` and :class:`bytearray`. They are supported by :class:`memoryview` which uses the :ref:`buffer protocol ` to access the memory of other binary objects without needing to make a copy." +msgid "" +"The core built-in types for manipulating binary data are :class:`bytes` " +"and :class:`bytearray`. They are supported by :class:`memoryview` which uses " +"the :ref:`buffer protocol ` to access the memory of other binary " +"objects without needing to make a copy." msgstr "" +"انواع توکار اصلی برای دستکاری داده‌های دودویی، :class:`bytes` و :class:`bytearray` " +"هستند. :class:`memoryview` از این انواع پشتیبانی می‌کند و از :ref:`buffer protocol " +"` برای دسترسی به حافظه‌ی سایر اشیای دودویی بدون نیاز به ایجاد کپی " +"استفاده می‌کند." -msgid "The :mod:`array` module supports efficient storage of basic data types like 32-bit integers and IEEE754 double-precision floating values." +msgid "" +"The :mod:`array` module supports efficient storage of basic data types like 32-bit " +"integers and IEEE754 double-precision floating values." msgstr "" +"ماژول :mod:`array` از ذخیره‌سازی کارآمد انواع داده پایه مانند اعداد صحیح ۳۲ بیتی و " +"مقادیر شناور با دقت مضاعف IEEE754 پشتیبانی می‌کند." msgid "Bytes Objects" -msgstr "" +msgstr "اشیای بایت" -msgid "Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other ways." +msgid "" +"Bytes objects are immutable sequences of single bytes. Since many major binary " +"protocols are based on the ASCII text encoding, bytes objects offer several methods " +"that are only valid when working with ASCII compatible data and are closely related to " +"string objects in a variety of other ways." msgstr "" +"اشیای bytes، دنباله‌های تغییرناپذیری از بایت‌های تکی هستند. از آنجا که بسیاری از " +"پروتکل‌های دودویی اصلی بر پایه‌ی کدگذاری متن ASCII هستند، اشیای bytes چندین متد ارائه " +"می‌دهند که فقط هنگام کار با داده‌های سازگار با ASCII معتبر هستند؛ همچنین این اشیاء به " +"روش‌های گوناگون دیگری نیز ارتباط نزدیکی با اشیای رشته دارند." -msgid "Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a ``b`` prefix is added:" +msgid "" +"Firstly, the syntax for bytes literals is largely the same as that for string " +"literals, except that a ``b`` prefix is added:" msgstr "" +"نخست، نحو مقادیر لفظی bytes تا حد زیادی همانند نحو مقادیر لفظی رشته است، به‌جز اینکه یک " +"پیشوند ``b`` افزوده می‌شود:" msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" -msgstr "" +msgstr "نقل‌قول‌های تکی: ``b'still allows embedded \"double\" quotes'``" msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" -msgstr "" +msgstr "علامت‌های نقل‌قول دوتایی: ``b\"still allows embedded 'single' quotes\"``" msgid "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" -msgstr "" +msgstr "سه‌نقل‌قولی: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" -msgid "Only ASCII characters are permitted in bytes literals (regardless of the declared source code encoding). Any binary values over 127 must be entered into bytes literals using the appropriate escape sequence." +msgid "" +"Only ASCII characters are permitted in bytes literals (regardless of the declared " +"source code encoding). Any binary values over 127 must be entered into bytes literals " +"using the appropriate escape sequence." msgstr "" +"تنها نویسه‌های ASCII در مقادیر لفظی bytes مجاز هستند (صرف‌نظر از کدگذاری اعلام‌شده‌ی کد " +"منبع). هر مقدار دودویی بیش از ۱۲۷ باید با استفاده از دنباله‌ی خنثی‌سازی مناسب در " +"مقادیر لفظی bytes وارد شود." -msgid "As with string literals, bytes literals may also use a ``r`` prefix to disable processing of escape sequences. See :ref:`strings` for more about the various forms of bytes literal, including supported escape sequences." +msgid "" +"As with string literals, bytes literals may also use a ``r`` prefix to disable " +"processing of escape sequences. See :ref:`strings` for more about the various forms of " +"bytes literal, including supported escape sequences." msgstr "" +"همانند مقادیر لفظی رشته، مقادیر لفظی بایت نیز می‌توانند از پیشوند ``r`` برای غیرفعال کردن " +"پردازش دنباله‌های گریز استفاده کنند. برای اطلاعات بیشتر درباره‌ی صورت‌های مختلف لفظی " +"بایت، از جمله دنباله‌های گریز پشتیبانی‌شده، :ref:`strings` را ببینید." -msgid "While bytes literals and representations are based on ASCII text, bytes objects actually behave like immutable sequences of integers, with each value in the sequence restricted such that ``0 <= x < 256`` (attempts to violate this restriction will trigger :exc:`ValueError`). This is done deliberately to emphasise that while many binary formats include ASCII based elements and can be usefully manipulated with some text-oriented algorithms, this is not generally the case for arbitrary binary data (blindly applying text processing algorithms to binary data formats that are not ASCII compatible will usually lead to data corruption)." +msgid "" +"While bytes literals and representations are based on ASCII text, bytes objects " +"actually behave like immutable sequences of integers, with each value in the sequence " +"restricted such that ``0 <= x < 256`` (attempts to violate this restriction will " +"trigger :exc:`ValueError`). This is done deliberately to emphasise that while many " +"binary formats include ASCII based elements and can be usefully manipulated with some " +"text-oriented algorithms, this is not generally the case for arbitrary binary data " +"(blindly applying text processing algorithms to binary data formats that are not ASCII " +"compatible will usually lead to data corruption)." msgstr "" +"در حالی که مقادیر لفظی و بازنمایی‌های bytes بر پایه‌ی متن ASCII هستند، اشیای bytes در واقع " +"مانند دنباله‌های تغییرناپذیر از اعداد صحیح رفتار می‌کنند، به‌طوری که هر مقدار در دنباله " +"باید ``0 <= x < 256`` باشد (تلاش برای نقض این محدودیت باعث پرتاب :exc:`ValueError` " +"می‌شود). این کار عمداً انجام شده است تا تأکید شود که اگرچه بسیاری از قالب‌های دودویی شامل " +"عناصر مبتنی بر ASCII هستند و می‌توانند با برخی الگوریتم‌های متن‌محور به‌طور مفید پردازش " +"شوند، این موضوع به‌طور کلی برای داده‌های دودویی دلخواه صادق نیست (اعمال کورکورانه‌ی " +"الگوریتم‌های پردازش متن بر قالب‌های داده دودویی که با ASCII سازگار نیستند، معمولاً منجر " +"به خرابی داده‌ها می‌شود)." -msgid "In addition to the literal forms, bytes objects can be created in a number of other ways:" -msgstr "" +msgid "" +"In addition to the literal forms, bytes objects can be created in a number of other " +"ways:" +msgstr "علاوه بر قالب‌های لفظی، می‌توان اشیای bytes را به روش‌های دیگری نیز ایجاد کرد:" msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" -msgstr "" +msgstr "یک شیء بایت با طول مشخص که با صفر پر شده است: ``bytes(10)``" msgid "From an iterable of integers: ``bytes(range(20))``" -msgstr "" +msgstr "از یک پیمایش‌پذیر از اعداد صحیح: ``bytes(range(20))``" msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" -msgstr "" +msgstr "کپی داده‌های دودویی موجود از طریق پروتکل بافر (buffer protocol): ``bytes(obj)``" msgid "Also see the :ref:`bytes ` built-in." -msgstr "" +msgstr "همچنین :ref:`bytes ` توکار را ببینید." -msgid "Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers are a commonly used format for describing binary data. Accordingly, the bytes type has an additional class method to read data in that format:" +msgid "" +"Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers " +"are a commonly used format for describing binary data. Accordingly, the bytes type has " +"an additional class method to read data in that format:" msgstr "" +"از آنجا که ۲ رقم مبنای شانزده دقیقاً متناظر با یک بایت هستند، اعداد مبنای شانزده قالبی " +"رایج برای توصیف داده‌های دودویی هستند. بر همین اساس، نوع bytes یک متد کلاسی اضافی برای " +"خواندن داده‌ها در آن قالب دارد:" -msgid "This :class:`bytes` class method returns a bytes object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored." +msgid "" +"This :class:`bytes` class method returns a bytes object, decoding the given string " +"object. The string must contain two hexadecimal digits per byte, with ASCII " +"whitespace being ignored." msgstr "" +"این متد کلاس :class:`bytes`، با کدگشایی شیء رشته‌ی داده‌شده، یک شیء bytes برمی‌گرداند. " +"این رشته باید به ازای هر بایت دو رقم مبنای شانزده داشته باشد؛ نویسه‌های فضای خالی ASCII " +"نادیده گرفته می‌شوند." -msgid ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces." +msgid "" +":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just spaces." msgstr "" +":meth:`bytes.fromhex` اکنون تمام نویسه‌های فضای سفید ASCII در رشته را نادیده می‌گیرد، نه " +"فقط فاصله‌ها." -msgid ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like objects ` as input." +msgid "" +":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like objects " +"` as input." msgstr "" +":meth:`bytes.fromhex` اکنون :class:`bytes` ASCII و :term:`اشیاء شبه‌بایت ` را به‌عنوان ورودی می‌پذیرد." -msgid "A reverse conversion function exists to transform a bytes object into its hexadecimal representation." +msgid "" +"A reverse conversion function exists to transform a bytes object into its hexadecimal " +"representation." msgstr "" +"یک تابع تبدیل معکوس وجود دارد که شیء bytes را به نمایش مبنای شانزده‌ی آن تبدیل می‌کند." -msgid "Return a string object containing two hexadecimal digits for each byte in the instance." -msgstr "" +msgid "" +"Return a string object containing two hexadecimal digits for each byte in the instance." +msgstr "یک شیء رشته برمی‌گرداند که حاوی دو رقم مبنای شانزده برای هر بایت در نمونه است." -msgid "If you want to make the hex string easier to read, you can specify a single character separator *sep* parameter to include in the output. By default, this separator will be included between each byte. A second optional *bytes_per_sep* parameter controls the spacing. Positive values calculate the separator position from the right, negative values from the left." +msgid "" +"If you want to make the hex string easier to read, you can specify a single character " +"separator *sep* parameter to include in the output. By default, this separator will be " +"included between each byte. A second optional *bytes_per_sep* parameter controls the " +"spacing. Positive values calculate the separator position from the right, negative " +"values from the left." msgstr "" +"اگر می‌خواهید رشته‌ی مبنای شانزده را خوانا کنید، می‌توانید با استفاده از پارامتر *sep* یک " +"جداکننده‌ی تک‌نویسه‌ای را مشخص کنید تا در خروجی گنجانده شود. به‌طور پیش‌فرض، این جداکننده " +"بین هر بایت قرار می‌گیرد. پارامتر اختیاری دوم *bytes_per_sep* فاصله‌گذاری را کنترل " +"می‌کند. مقادیر مثبت موقعیت جداکننده را از راست محاسبه می‌کنند و مقادیر منفی آن را از چپ " +"محاسبه می‌کنند." -msgid ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +msgid "" +":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert " +"separators between bytes in the hex output." msgstr "" +":meth:`bytes.hex` اکنون از پارامترهای اختیاری *sep* و *bytes_per_sep* برای درج " +"جداکننده‌ها بین بایت‌ها در خروجی مبنای شانزده پشتیبانی می‌کند." -msgid "Since bytes objects are sequences of integers (akin to a tuple), for a bytes object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1)" +msgid "" +"Since bytes objects are sequences of integers (akin to a tuple), for a bytes object " +"*b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes object of length " +"1. (This contrasts with text strings, where both indexing and slicing will produce a " +"string of length 1)" msgstr "" +"از آنجا که اشیای بایتی (bytes) دنباله‌هایی از اعداد صحیح هستند (شبیه به یک تاپل)، برای " +"یک شیء بایتی (bytes) با نام *b*، عبارت ``b[0]`` یک عدد صحیح خواهد بود، در حالی که " +"``b[0:1]`` یک شیء بایتی (bytes) به طول ۱ خواهد بود. (این موضوع با رشته‌های متنی در تضاد " +"است، که در آن‌ها هم اندیس‌دهی و هم برش، یک رشته به طول ۱ تولید می‌کنند)" -msgid "The representation of bytes objects uses the literal format (``b'...'``) since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes object into a list of integers using ``list(b)``." +msgid "" +"The representation of bytes objects uses the literal format (``b'...'``) since it is " +"often more useful than e.g. ``bytes([46, 46, 46])``. You can always convert a bytes " +"object into a list of integers using ``list(b)``." msgstr "" +"نمایش اشیای bytes از قالب لفظی (``b'...'``) استفاده می‌کند، زیرا اغلب از مثلاً " +"``bytes([46, 46, 46])`` مفیدتر است. شما همیشه می‌توانید یک شیء bytes را با استفاده از " +"``list(b)`` به فهرستی از اعداد صحیح تبدیل کنید." msgid "Bytearray Objects" -msgstr "" +msgstr "اشیای Bytearray" msgid ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` objects." -msgstr "" +msgstr "اشیای :class:`bytearray` همتای تغییرپذیر اشیای :class:`bytes` هستند." -msgid "There is no dedicated literal syntax for bytearray objects, instead they are always created by calling the constructor:" +msgid "" +"There is no dedicated literal syntax for bytearray objects, instead they are always " +"created by calling the constructor:" msgstr "" +"هیچ نحو لفظی اختصاصی برای اشیاء bytearray وجود ندارد، بلکه آن‌ها همیشه با فراخوانی " +"سازنده ایجاد می‌شوند:" msgid "Creating an empty instance: ``bytearray()``" -msgstr "" +msgstr "ایجاد یک نمونه خالی: ``bytearray()``" msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" -msgstr "" +msgstr "ایجاد یک نمونه‌ی پرشده با صفر با طول مشخص: ``bytearray(10)``" msgid "From an iterable of integers: ``bytearray(range(20))``" -msgstr "" +msgstr "از یک پیمایش‌پذیر از اعداد صحیح: ``bytearray(range(20))``" msgid "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" +"کپی داده‌های دودویی موجود از طریق پروتکل بافر (buffer protocol): ``bytearray(b'Hi!')``" -msgid "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray operations described in :ref:`bytes-methods`." +msgid "" +"As bytearray objects are mutable, they support the :ref:`mutable ` " +"sequence operations in addition to the common bytes and bytearray operations described " +"in :ref:`bytes-methods`." msgstr "" +"از آن‌جا که اشیای bytearray تغییرپذیر هستند، علاوه بر عملیات رایج bytes و bytearray که " +"در :ref:`bytes-methods` توصیف شده‌اند، از عملیات دنباله‌های :ref:`تغییرپذیر ` نیز پشتیبانی می‌کنند." msgid "Also see the :ref:`bytearray ` built-in." -msgstr "" +msgstr "همچنین :ref:`bytearray ` توکار را ببینید." -msgid "Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers are a commonly used format for describing binary data. Accordingly, the bytearray type has an additional class method to read data in that format:" +msgid "" +"Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal numbers " +"are a commonly used format for describing binary data. Accordingly, the bytearray type " +"has an additional class method to read data in that format:" msgstr "" +"از آنجا که ۲ رقم مبنای شانزده دقیقاً متناظر با یک بایت است، اعداد مبنای شانزده قالبی " +"رایج برای توصیف داده‌های دودویی هستند. بر همین اساس، نوع bytearray یک متد کلاسی اضافی " +"برای خواندن داده‌ها در آن قالب دارد:" -msgid "This :class:`bytearray` class method returns bytearray object, decoding the given string object. The string must contain two hexadecimal digits per byte, with ASCII whitespace being ignored." +msgid "" +"This :class:`bytearray` class method returns bytearray object, decoding the given " +"string object. The string must contain two hexadecimal digits per byte, with ASCII " +"whitespace being ignored." msgstr "" +"این متد کلاس :class:`bytearray`، با کدگشایی شیء رشته‌ی داده‌شده، یک شیء bytearray " +"برمی‌گرداند. رشته باید به ازای هر بایت شامل دو رقم مبنای شانزده باشد و فضای سفید ASCII " +"نادیده گرفته می‌شود." -msgid ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not just spaces." +msgid "" +":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not just " +"spaces." msgstr "" +":meth:`bytearray.fromhex` اکنون تمام فضای سفید ASCII در رشته را نادیده می‌گیرد، نه فقط " +"فاصله‌ها را." -msgid ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like objects ` as input." +msgid "" +":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " +"objects ` as input." msgstr "" +":meth:`bytearray.fromhex` اکنون :class:`bytes` ASCII و :term:`اشیاء شبه‌بایت (bytes-" +"like objects) ` را به‌عنوان ورودی می‌پذیرد." -msgid "A reverse conversion function exists to transform a bytearray object into its hexadecimal representation." +msgid "" +"A reverse conversion function exists to transform a bytearray object into its " +"hexadecimal representation." msgstr "" +"تابع تبدیل معکوسی برای تبدیل یک شیء bytearray به بازنمایی مبنای شانزده آن وجود دارد." -msgid "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +msgid "" +"Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional *sep* and " +"*bytes_per_sep* parameters to insert separators between bytes in the hex output." msgstr "" +"مشابه :meth:`bytes.hex`، :meth:`bytearray.hex` اکنون از پارامترهای اختیاری *sep* و " +"*bytes_per_sep* برای درج جداکننده‌ها بین بایت‌ها در خروجی مبنای شانزده پشتیبانی می‌کند." -msgid "Resize the :class:`bytearray` to contain *size* bytes. *size* must be greater than or equal to 0." +msgid "" +"Resize the :class:`bytearray` to contain *size* bytes. *size* must be greater than or " +"equal to 0." msgstr "" +"اندازه‌ی :class:`bytearray` را تغییر دهید تا حاوی *size* بایت باشد. *size* باید بزرگ‌تر " +"یا مساوی ۰ باشد." msgid "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" +"اگر :class:`bytearray` نیاز به کوچک‌شدن داشته باشد، بایت‌های فراتر از *size* بریده " +"می‌شوند." -msgid "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, will be set to null bytes." +msgid "" +"If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, will be " +"set to null bytes." msgstr "" +"اگر نیاز باشد :class:`bytearray` بزرگ‌تر شود، تمام بایت‌های جدید، یعنی آن‌هایی که فراتر " +"از *size* هستند، به بایت‌های null تنظیم خواهند شد." msgid "This is equivalent to:" -msgstr "" +msgstr "این معادل است با:" msgid "Examples:" -msgstr "" +msgstr "مثال‌ها:" -msgid "Since bytearray objects are sequences of integers (akin to a list), for a bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytearray object of length 1. (This contrasts with text strings, where both indexing and slicing will produce a string of length 1)" +msgid "" +"Since bytearray objects are sequences of integers (akin to a list), for a bytearray " +"object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytearray object " +"of length 1. (This contrasts with text strings, where both indexing and slicing will " +"produce a string of length 1)" msgstr "" +"از آن‌جا که اشیای bytearray دنباله‌هایی از اعداد صحیح هستند (شبیه به یک فهرست)، برای یک " +"شیء bytearray با نام *b*، ``b[0]`` یک عدد صحیح خواهد بود، در حالی که ``b[0:1]`` یک شیء " +"bytearray به طول ۱ خواهد بود. (این موضوع با رشته‌های متنی تفاوت دارد، که در آن‌ها هم " +"اندیس‌دهی و هم برش، یک رشته به طول ۱ تولید می‌کنند)" -msgid "The representation of bytearray objects uses the bytes literal format (``bytearray(b'...')``) since it is often more useful than e.g. ``bytearray([46, 46, 46])``. You can always convert a bytearray object into a list of integers using ``list(b)``." +msgid "" +"The representation of bytearray objects uses the bytes literal format " +"(``bytearray(b'...')``) since it is often more useful than e.g. ``bytearray([46, 46, " +"46])``. You can always convert a bytearray object into a list of integers using " +"``list(b)``." msgstr "" +"نمایش اشیای bytearray از قالب لفظی bytes استفاده می‌کند (``bytearray(b'...')``)، زیرا " +"اغلب مفیدتر از مثلاً ``bytearray([46, 46, 46])`` است. شما همیشه می‌توانید یک شیء " +"bytearray را با استفاده از ``list(b)`` به فهرستی از اعداد صحیح تبدیل کنید." -msgid "For detailed information on thread-safety guarantees for :class:`bytearray` objects, see :ref:`thread-safety-bytearray`." +msgid "" +"For detailed information on thread-safety guarantees for :class:`bytearray` objects, " +"see :ref:`thread-safety-bytearray`." msgstr "" +"برای اطلاعات دقیق در مورد تضمین‌های ایمنی نخ برای اشیاء :class:`bytearray`، " +"به :ref:`thread-safety-bytearray` مراجعه کنید." msgid "Bytes and Bytearray Operations" -msgstr "" +msgstr "عملیات bytes و bytearray" -msgid "Both bytes and bytearray objects support the :ref:`common ` sequence operations. They interoperate not just with operands of the same type, but with any :term:`bytes-like object`. Due to this flexibility, they can be freely mixed in operations without causing errors. However, the return type of the result may depend on the order of operands." +msgid "" +"Both bytes and bytearray objects support the :ref:`common ` sequence " +"operations. They interoperate not just with operands of the same type, but with " +"any :term:`bytes-like object`. Due to this flexibility, they can be freely mixed in " +"operations without causing errors. However, the return type of the result may depend " +"on the order of operands." msgstr "" +"اشیاء bytes و bytearray هر دو از عملیات دنباله‌ای :ref:`common ` " +"پشتیبانی می‌کنند. آن‌ها نه‌تنها با عملوندهایی از همان نوع، بلکه با هر :term:`bytes-like " +"object` تعامل دارند. به دلیل همین انعطاف‌پذیری، می‌توان آن‌ها را آزادانه در عملیات ترکیب " +"کرد، بدون اینکه خطایی رخ دهد. با این حال، نوع بازگشتی نتیجه ممکن است به ترتیب عملوندها " +"بستگی داشته باشد." -msgid "The methods on bytes and bytearray objects don't accept strings as their arguments, just as the methods on strings don't accept bytes as their arguments. For example, you have to write::" +msgid "" +"The methods on bytes and bytearray objects don't accept strings as their arguments, " +"just as the methods on strings don't accept bytes as their arguments. For example, " +"you have to write::" msgstr "" +"متدهای اشیای bytes و bytearray، رشته‌ها را به‌عنوان آرگومان‌های خود نمی‌پذیرند، همان‌طور " +"که متدهای رشته‌ها نیز bytes را به‌عنوان آرگومان‌های خود نمی‌پذیرند. برای مثال، باید " +"این‌گونه بنویسید::" msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" msgstr "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" msgid "and::" -msgstr "" +msgstr "و::" msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" msgstr "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" -msgid "Some bytes and bytearray operations assume the use of ASCII compatible binary formats, and hence should be avoided when working with arbitrary binary data. These restrictions are covered below." +msgid "" +"Some bytes and bytearray operations assume the use of ASCII compatible binary formats, " +"and hence should be avoided when working with arbitrary binary data. These " +"restrictions are covered below." msgstr "" +"برخی از عملیات bytes و bytearray استفاده از قالب‌های دودویی سازگار با ASCII را فرض " +"می‌کنند، و بنابراین باید هنگام کار با داده‌های دودویی دلخواه از آن‌ها اجتناب شود. این " +"محدودیت‌ها در زیر توضیح داده شده‌اند." -msgid "Using these ASCII based operations to manipulate binary data that is not stored in an ASCII based format may lead to data corruption." +msgid "" +"Using these ASCII based operations to manipulate binary data that is not stored in an " +"ASCII based format may lead to data corruption." msgstr "" +"استفاده از این عملیات مبتنی بر ASCII برای دستکاری داده‌های دودویی که در قالب مبتنی بر " +"ASCII ذخیره‌نشده‌اند، ممکن است منجر به خرابی داده‌ها شود." -msgid "The following methods on bytes and bytearray objects can be used with arbitrary binary data." +msgid "" +"The following methods on bytes and bytearray objects can be used with arbitrary binary " +"data." msgstr "" +"متدهای زیر بر روی اشیاء bytes و bytearray برای داده‌های دودویی دلخواه قابل استفاده‌اند." -msgid "Return the number of non-overlapping occurrences of subsequence *sub* in the range [*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice notation." +msgid "" +"Return the number of non-overlapping occurrences of subsequence *sub* in the range " +"[*start*, *end*]. Optional arguments *start* and *end* are interpreted as in slice " +"notation." msgstr "" +"تعداد رخدادهای غیرهم‌پوشان زیردنباله‌ی *sub* در بازه‌ی [*start*، *end*] را برمی‌گرداند. " +"آرگومان‌های اختیاری *start* و *end* مانند نمادگذاری برش تفسیر می‌شوند." -msgid "The subsequence to search for may be any :term:`bytes-like object` or an integer in the range 0 to 255." +msgid "" +"The subsequence to search for may be any :term:`bytes-like object` or an integer in " +"the range 0 to 255." msgstr "" +"زیردنباله‌ی مورد جستجو می‌تواند هر :term:`bytes-like object` یا عدد صحیحی در بازه‌ی ۰ تا " +"۲۵۵ باشد." -msgid "If *sub* is empty, returns the number of empty slices between characters which is the length of the bytes object plus one." +msgid "" +"If *sub* is empty, returns the number of empty slices between characters which is the " +"length of the bytes object plus one." msgstr "" +"اگر *sub* خالی باشد، تعداد برش‌های خالی بین نویسه‌ها را برمی‌گرداند که برابر با طول شیء " +"بایت‌ها به‌علاوه‌ی ۱ است." msgid "Also accept an integer in the range 0 to 255 as the subsequence." -msgstr "" +msgstr "همچنین یک عدد صحیح در بازه‌ی ۰ تا ۲۵۵ به‌عنوان زیردنباله پذیرفته می‌شود." -msgid "If the binary data starts with the *prefix* string, return ``bytes[len(prefix):]``. Otherwise, return a copy of the original binary data::" +msgid "" +"If the binary data starts with the *prefix* string, return ``bytes[len(prefix):]``. " +"Otherwise, return a copy of the original binary data::" msgstr "" +"اگر داده‌های دودویی با رشته‌ی *prefix* شروع شوند، ``bytes[len(prefix):]`` را برگردانید. " +"در غیر این صورت، یک کپی از داده‌های دودویی اصلی را برگردانید::" msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" @@ -3031,15 +5439,29 @@ msgid "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" msgstr "" +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" msgid "The *prefix* may be any :term:`bytes-like object`." -msgstr "" +msgstr "*prefix* می‌تواند هر :term:`bytes-like object` باشد." -msgid "The bytearray version of this method does *not* operate in place - it always produces a new object, even if no changes were made." +msgid "" +"The bytearray version of this method does *not* operate in place - it always produces " +"a new object, even if no changes were made." msgstr "" +"نسخه‌ی bytearray این متد به‌صورت درجا عمل *نمی‌کند*؛ همیشه یک شیء جدید تولید می‌کند، حتی " +"اگر هیچ تغییری اعمال نشده باشد." -msgid "If the binary data ends with the *suffix* string and that *suffix* is not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary data::" +msgid "" +"If the binary data ends with the *suffix* string and that *suffix* is not empty, " +"return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the original binary " +"data::" msgstr "" +"اگر داده‌های دودویی به رشته‌ی *suffix* ختم شود و آن *suffix* خالی نباشد، ``bytes[:-" +"len(suffix)]`` را برمی‌گرداند. در غیر این صورت، یک کپی از داده‌های دودویی اصلی را " +"برمی‌گرداند::" msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" @@ -3047,103 +5469,254 @@ msgid "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" msgstr "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" msgid "The *suffix* may be any :term:`bytes-like object`." -msgstr "" +msgstr "*suffix* می‌تواند هر :term:`شیء شبه‌بایت ` باشد." msgid "Return the bytes decoded to a :class:`str`." -msgstr "" +msgstr "بایت‌های کدگشایی‌شده به یک :class:`str` را برمی‌گرداند." -msgid "*errors* controls how decoding errors are handled. If ``'strict'`` (the default), a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, ``'replace'``, and any other name registered via :func:`codecs.register_error`. See :ref:`error-handlers` for details." +msgid "" +"*errors* controls how decoding errors are handled. If ``'strict'`` (the default), " +"a :exc:`UnicodeError` exception is raised. Other possible values are ``'ignore'``, " +"``'replace'``, and any other name registered via :func:`codecs.register_error`. " +"See :ref:`error-handlers` for details." msgstr "" +"*errors* نحوه مدیریت خطاهای کدگشایی را کنترل می‌کند. اگر ``'strict'`` (پیش‌فرض) باشد، " +"استثنای :exc:`UnicodeError` پرتاب می‌شود. سایر مقدارهای ممکن عبارتند از ``'ignore'``، " +"``'replace'`` و هر نام دیگری که از طریق :func:`codecs.register_error` ثبت‌شده باشد. " +"برای جزئیات، :ref:`error-handlers` را ببینید." -msgid "For performance reasons, the value of *errors* is not checked for validity unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build ` is used." +msgid "" +"For performance reasons, the value of *errors* is not checked for validity unless a " +"decoding error actually occurs, :ref:`devmode` is enabled or a :ref:`debug build " +"` is used." msgstr "" +"به دلایل کارایی، مقدار *errors* از نظر اعتبار بررسی نمی‌شود، مگر اینکه واقعاً یک خطای " +"کدگشایی رخ دهد، :ref:`devmode` فعال باشد یا از یک :ref:`ساخت اشکال‌زدایی ` " +"استفاده شود." -msgid "Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like object` directly, without needing to make a temporary :class:`!bytes` or :class:`!bytearray` object." +msgid "" +"Passing the *encoding* argument to :class:`str` allows decoding any :term:`bytes-like " +"object` directly, without needing to make a temporary :class:`!bytes` or :class:`!" +"bytearray` object." msgstr "" +"با ارسال آرگومان *encoding* به :class:`str`، می‌توان هر :term:`bytes-like object` را " +"به‌طور مستقیم کدگشایی کرد، بدون این‌که نیازی به ایجاد یک شیء موقت :class:`!bytes` " +"یا :class:`!bytearray` باشد." -msgid "Return ``True`` if the binary data ends with the specified *suffix*, otherwise return ``False``. *suffix* can also be a tuple of suffixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position." +msgid "" +"Return ``True`` if the binary data ends with the specified *suffix*, otherwise return " +"``False``. *suffix* can also be a tuple of suffixes to look for. With optional " +"*start*, test beginning at that position. With optional *end*, stop comparing at that " +"position." msgstr "" +"اگر داده‌ی دودویی به *suffix* مشخص‌شده ختم شود، ``True`` را برمی‌گرداند، در غیر این صورت " +"``False`` را برمی‌گرداند. *suffix* همچنین می‌تواند تاپلی از پسوندها برای جست‌وجو باشد. با " +"*start* اختیاری، آزمون از آن موقعیت آغاز می‌شود. با *end* اختیاری، مقایسه در آن موقعیت " +"متوقف می‌شود." msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" +"پسوند(ها)ی مورد جست‌وجو می‌توانند هر :term:`شیء شبه‌بایت ` باشند." -msgid "Return the lowest index in the data where the subsequence *sub* is found, such that *sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found." +msgid "" +"Return the lowest index in the data where the subsequence *sub* is found, such that " +"*sub* is contained in the slice ``s[start:end]``. Optional arguments *start* and " +"*end* are interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" +"کمترین اندیس در داده را برمی‌گرداند که زیردنباله *sub* در آن یافت می‌شود، به‌طوری که " +"*sub* در برش ``s[start:end]`` قرار داشته باشد. آرگومان‌های اختیاری *start* و *end* " +"مانند نماد برش تفسیر می‌شوند. اگر *sub* یافت نشود، ``-1`` برگردانده می‌شود." -msgid "The :meth:`~bytes.find` method should be used only if you need to know the position of *sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" +msgid "" +"The :meth:`~bytes.find` method should be used only if you need to know the position of " +"*sub*. To check if *sub* is a substring or not, use the :keyword:`in` operator::" msgstr "" +"از متد :meth:`~bytes.find` فقط زمانی باید استفاده کنید که نیاز دارید جایگاه *sub* را " +"بدانید. برای بررسی اینکه آیا *sub* یک زیررشته است یا خیر، از عملگر :keyword:`in` " +"استفاده کنید::" msgid "" ">>> b'Py' in b'Python'\n" "True" msgstr "" +">>> b'Py' in b'Python'\n" +"True" -msgid "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence is not found." +msgid "" +"Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence is not " +"found." msgstr "" +"مانند :meth:`~bytes.find`، اما اگر زیردنباله یافت نشد، :exc:`ValueError` را پرتاب " +"می‌کند." -msgid "Return a bytes or bytearray object which is the concatenation of the binary data sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in *iterable* that are not :term:`bytes-like objects `, including :class:`str` objects. The separator between elements is the contents of the bytes or bytearray object providing this method." +msgid "" +"Return a bytes or bytearray object which is the concatenation of the binary data " +"sequences in *iterable*. A :exc:`TypeError` will be raised if there are any values in " +"*iterable* that are not :term:`bytes-like objects `, " +"including :class:`str` objects. The separator between elements is the contents of the " +"bytes or bytearray object providing this method." msgstr "" +"یک شیء bytes یا bytearray برمی‌گرداند که حاصل الحاق دنباله‌های داده دودویی در *iterable* " +"است. اگر در *iterable* مقادیری، از جمله اشیاء :class:`str`، وجود داشته باشند " +"که :term:`اشیاء شبه‌بایت ` نباشند، یک :exc:`TypeError` پرتاب خواهد " +"شد. جداکننده میان عناصر، محتوای شیء bytes یا bytearray ای است که این متد را ارائه " +"می‌دهد." -msgid "This static method returns a translation table usable for :meth:`bytes.translate` that will map each character in *from* into the character at the same position in *to*; *from* and *to* must both be :term:`bytes-like objects ` and have the same length." +msgid "" +"This static method returns a translation table usable for :meth:`bytes.translate` that " +"will map each character in *from* into the character at the same position in *to*; " +"*from* and *to* must both be :term:`bytes-like objects ` and have " +"the same length." msgstr "" +"این متد ایستا یک جدول ترجمه قابل‌استفاده برای :meth:`bytes.translate` برمی‌گرداند که هر " +"نویسه در *from* را به نویسه‌ای در همان جایگاه در *to* نگاشت می‌کند؛ *from* و *to* هر دو " +"باید :term:`bytes-like objects ` باشند و طول یکسانی داشته باشند." -msgid "Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects." +msgid "" +"Split the sequence at the first occurrence of *sep*, and return a 3-tuple containing " +"the part before the separator, the separator itself or its bytearray copy, and the " +"part after the separator. If the separator is not found, return a 3-tuple containing a " +"copy of the original sequence, followed by two empty bytes or bytearray objects." msgstr "" +"دنباله را در نخستین رخداد *sep* جدا می‌کند و یک ۳-تایی حاوی بخش پیش از جداکننده، خود " +"جداکننده یا کپی bytearray آن، و بخش پس از جداکننده برمی‌گرداند. اگر جداکننده پیدا نشود، " +"یک ۳-تایی حاوی یک کپی از دنباله اصلی و سپس دو شیء خالی bytes یا bytearray برمی‌گرداند." msgid "The separator to search for may be any :term:`bytes-like object`." -msgstr "" +msgstr "جداکننده‌ی مورد جستجو می‌تواند هر :term:`شیء شبه‌بایت ` باشد." -msgid "Return a copy of the sequence with all occurrences of subsequence *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced." +msgid "" +"Return a copy of the sequence with all occurrences of subsequence *old* replaced by " +"*new*. If the optional argument *count* is given, only the first *count* occurrences " +"are replaced." msgstr "" +"یک کپی از دنباله را برمی‌گرداند که در آن تمام رخدادهای زیردنباله‌ی *old* با *new* جایگزین " +"شده‌اند. اگر آرگومان اختیاری *count* داده شود، فقط *count* رخداد نخست جایگزین می‌شوند." -msgid "The subsequence to search for and its replacement may be any :term:`bytes-like object`." +msgid "" +"The subsequence to search for and its replacement may be any :term:`bytes-like object`." msgstr "" +"زیردنباله‌ای که باید جستجو شود و جایگزین آن می‌توانند هر :term:`bytes-like object` باشند." -msgid "Return the highest index in the sequence where the subsequence *sub* is found, such that *sub* is contained within ``s[start:end]``. Optional arguments *start* and *end* are interpreted as in slice notation. Return ``-1`` on failure." +msgid "" +"Return the highest index in the sequence where the subsequence *sub* is found, such " +"that *sub* is contained within ``s[start:end]``. Optional arguments *start* and *end* " +"are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" +"بزرگ‌ترین اندیسی در دنباله را برمی‌گرداند که زیردنباله‌ی *sub* در آن یافت می‌شود، به‌طوری‌که " +"*sub* در ``s[start:end]`` قرار داشته باشد. آرگومان‌های اختیاری *start* و *end* مانند " +"نماد برش تفسیر می‌شوند. در صورت شکست، ``-1`` برمی‌گرداند." -msgid "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is not found." +msgid "" +"Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence *sub* is " +"not found." msgstr "" +"مانند :meth:`~bytes.rfind` است، اما اگر زیردنباله‌ی *sub* یافت نشد، " +"استثنای :exc:`ValueError` را پرتاب می‌کند." -msgid "Split the sequence at the last occurrence of *sep*, and return a 3-tuple containing the part before the separator, the separator itself or its bytearray copy, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty bytes or bytearray objects, followed by a copy of the original sequence." +msgid "" +"Split the sequence at the last occurrence of *sep*, and return a 3-tuple containing " +"the part before the separator, the separator itself or its bytearray copy, and the " +"part after the separator. If the separator is not found, return a 3-tuple containing " +"two empty bytes or bytearray objects, followed by a copy of the original sequence." msgstr "" +"دنباله را در آخرین رخداد *sep* می‌شکند و یک تاپل سه‌تایی برمی‌گرداند که شامل بخش پیش از " +"جداکننده، خود جداکننده یا نسخه‌ی bytearray آن، و بخش پس از جداکننده است. اگر جداکننده " +"پیدا نشود، یک تاپل سه‌تایی شامل دو شیء خالی از نوع bytes یا bytearray، و به دنبال آن یک " +"نسخه از دنباله‌ی اصلی برمی‌گرداند." -msgid "Return ``True`` if the binary data starts with the specified *prefix*, otherwise return ``False``. *prefix* can also be a tuple of prefixes to look for. With optional *start*, test beginning at that position. With optional *end*, stop comparing at that position." +msgid "" +"Return ``True`` if the binary data starts with the specified *prefix*, otherwise " +"return ``False``. *prefix* can also be a tuple of prefixes to look for. With " +"optional *start*, test beginning at that position. With optional *end*, stop " +"comparing at that position." msgstr "" +"اگر داده‌ی دودویی با *prefix* مشخص‌شده آغاز شود، ``True`` و در غیر این صورت ``False`` " +"برمی‌گرداند. *prefix* همچنین می‌تواند یک تاپل از پیشوندها برای جستجو باشد. با *start* " +"اختیاری، بررسی از آن موقعیت آغاز می‌شود. با *end* اختیاری، مقایسه در آن موقعیت متوقف " +"می‌شود." msgid "The prefix(es) to search for may be any :term:`bytes-like object`." -msgstr "" +msgstr "پیشوند(ها)ی مورد جستجو می‌توانند هر :term:`bytes-like object` باشند." -msgid "Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been mapped through the given translation table, which must be a bytes object of length 256." +msgid "" +"Return a copy of the bytes or bytearray object where all bytes occurring in the " +"optional argument *delete* are removed, and the remaining bytes have been mapped " +"through the given translation table, which must be a bytes object of length 256." msgstr "" +"نسخه‌ای از شیء bytes یا bytearray برمی‌گرداند که در آن تمام بایت‌های موجود در آرگومان " +"اختیاری *delete* حذف شده‌اند و بایت‌های باقی‌مانده از طریق جدول ترجمه‌ی داده‌شده، که باید یک " +"شیء bytes به طول ۲۵۶ باشد، نگاشت شده‌اند." msgid "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" +"شما می‌توانید از متد :func:`bytes.maketrans` برای ایجاد یک جدول ترجمه استفاده کنید." -msgid "Set the *table* argument to ``None`` for translations that only delete characters::" +msgid "" +"Set the *table* argument to ``None`` for translations that only delete characters::" msgstr "" +"برای ترجمه‌هایی که فقط نویسه‌ها را حذف می‌کنند، آرگومان *table* را روی ``None`` تنظیم " +"کنید::" msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" msgstr "" +">>> b'read this short text'.translate(None, b'aeiou')\n" +"b'rd ths shrt txt'" msgid "*delete* is now supported as a keyword argument." -msgstr "" +msgstr "اکنون از *delete* به‌عنوان آرگومان کلیدواژه‌ای پشتیبانی می‌شود." -msgid "The following methods on bytes and bytearray objects have default behaviours that assume the use of ASCII compatible binary formats, but can still be used with arbitrary binary data by passing appropriate arguments. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects." +msgid "" +"The following methods on bytes and bytearray objects have default behaviours that " +"assume the use of ASCII compatible binary formats, but can still be used with " +"arbitrary binary data by passing appropriate arguments. Note that all of the bytearray " +"methods in this section do *not* operate in place, and instead produce new objects." msgstr "" +"متدهای زیر برای اشیای bytes و bytearray، رفتارهای پیش‌فرضی دارند که استفاده از قالب‌های " +"دودویی سازگار با ASCII را فرض می‌کنند، اما همچنان می‌توان با پاس دادن آرگومان‌های مناسب، " +"از آن‌ها برای داده‌های دودویی دلخواه استفاده کرد. توجه داشته باشید که تمام متدهای " +"bytearray در این بخش به‌صورت درجا عمل *نمی‌کنند*، بلکه اشیای جدیدی تولید می‌کنند." -msgid "Return a copy of the object centered in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return a copy of the object centered in a sequence of length *width*. Padding is done " +"using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` " +"objects, the original sequence is returned if *width* is less than or equal to " +"``len(s)``." msgstr "" +"نسخه‌ای از شیء را برمی‌گرداند که در وسط دنباله‌ای به طول *width* قرار گرفته است. پر کردن " +"با استفاده از *fillbyte* مشخص‌شده انجام می‌شود (پیش‌فرض، یک نویسه فاصله ASCII است). برای " +"اشیای :class:`bytes`، اگر *width* کوچک‌تر یا مساوی ``len(s)`` باشد، دنباله اصلی " +"برگردانده می‌شود." -msgid "Return a copy of the object left justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return a copy of the object left justified in a sequence of length *width*. Padding is " +"done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` " +"objects, the original sequence is returned if *width* is less than or equal to " +"``len(s)``." msgstr "" +"یک کپی از شیء برمی‌گرداند که در دنباله‌ای به طول *width* چپ‌تراز شده است. پر کردن با " +"استفاده از *fillbyte* مشخص‌شده انجام می‌شود (پیش‌فرض یک فاصله ASCII است). برای " +"اشیای :class:`bytes`، اگر *width* کوچک‌تر یا مساوی ``len(s)`` باشد، دنباله اصلی " +"برگردانده می‌شود." -msgid "Return a copy of the sequence with specified leading bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix; rather, all combinations of its values are stripped::" +msgid "" +"Return a copy of the sequence with specified leading bytes removed. The *bytes* " +"argument is a binary sequence specifying the set of byte values to be removed. If " +"omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The " +"*bytes* argument is not a prefix; rather, all combinations of its values are stripped::" msgstr "" +"یک رونوشت از دنباله با حذف بایت‌های آغازین مشخص‌شده برمی‌گرداند. آرگومان *bytes* یک " +"دنباله دودویی است که مجموعه‌ای از مقادیر بایت برای حذف را مشخص می‌کند. اگر ذکر نشود یا " +"``None`` باشد، آرگومان *bytes* به‌طور پیش‌فرض فضای سفید ASCII را حذف می‌کند. آرگومان " +"*bytes* یک پیشوند نیست؛ بلکه تمام ترکیب‌های مقادیر آن حذف می‌شوند::" msgid "" ">>> b' spacious '.lstrip()\n" @@ -3151,9 +5724,19 @@ msgid "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" msgstr "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`. See :meth:`~bytes.removeprefix` for a method that will remove a single prefix string rather than all of a set of characters. For example::" +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like object`. " +"See :meth:`~bytes.removeprefix` for a method that will remove a single prefix string " +"rather than all of a set of characters. For example::" msgstr "" +"دنباله‌ی دودویی مقادیر بایت برای حذف، می‌تواند هر :term:`bytes-like object` باشد. برای " +"متدی که یک رشته‌ی پیشوند واحد را به جای همه‌ی نویسه‌های یک مجموعه حذف " +"می‌کند، :meth:`~bytes.removeprefix` را ببینید. برای مثال::" msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" @@ -3161,15 +5744,46 @@ msgid "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" msgstr "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" -msgid "Return a copy of the object right justified in a sequence of length *width*. Padding is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(s)``." +msgid "" +"Return a copy of the object right justified in a sequence of length *width*. Padding " +"is done using the specified *fillbyte* (default is an ASCII space). For :class:`bytes` " +"objects, the original sequence is returned if *width* is less than or equal to " +"``len(s)``." msgstr "" +"نسخه‌ای از شیء را برمی‌گرداند که در دنباله‌ای به طول *width* راست‌تراز شده است. پر کردن با " +"استفاده از *fillbyte* مشخص‌شده انجام می‌شود (پیش‌فرض یک نویسه فاصله ASCII است). برای " +"اشیای :class:`bytes`، اگر *width* کوچک‌تر یا مساوی ``len(s)`` باشد، دنباله اصلی " +"برگردانده می‌شود." -msgid "Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the *rightmost* ones. If *sep* is not specified or ``None``, any subsequence consisting solely of ASCII whitespace is a separator. Except for splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below." +msgid "" +"Split the binary sequence into subsequences of the same type, using *sep* as the " +"delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done, the " +"*rightmost* ones. If *sep* is not specified or ``None``, any subsequence consisting " +"solely of ASCII whitespace is a separator. Except for splitting from the " +"right, :meth:`rsplit` behaves like :meth:`split` which is described in detail below." msgstr "" +"دنباله‌ی دودویی را با استفاده از *sep* به‌عنوان رشته‌ی جداکننده، به زیردنباله‌هایی از همان " +"نوع تقسیم می‌کند. اگر *maxsplit* داده شود، حداکثر *maxsplit* جداسازی انجام می‌شود، " +"*راست‌ترین‌ها*. اگر *sep* مشخص نشده باشد یا ``None`` باشد، هر زیردنباله‌ای که صرفاً از " +"فضای سفید ASCII تشکیل شده باشد، جداکننده محسوب می‌شود. به‌جز جداسازی از سمت " +"راست، :meth:`rsplit` مانند :meth:`split` رفتار می‌کند که در ادامه با جزئیات توضیح داده " +"شده است." -msgid "Return a copy of the sequence with specified trailing bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a suffix; rather, all combinations of its values are stripped::" +msgid "" +"Return a copy of the sequence with specified trailing bytes removed. The *bytes* " +"argument is a binary sequence specifying the set of byte values to be removed. If " +"omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The " +"*bytes* argument is not a suffix; rather, all combinations of its values are stripped::" msgstr "" +"یک کپی از دنباله برمی‌گرداند که بایت‌های پایانی تعیین‌شده از آن حذف شده‌اند. آرگومان " +"*bytes* یک دنباله دودویی است که مجموعه‌ای از مقادیر بایت را برای حذف مشخص می‌کند. اگر " +"حذف شود یا ``None`` باشد، آرگومان *bytes* به‌طور پیش‌فرض فضای خالی ASCII را حذف می‌کند. " +"آرگومان *bytes* یک پسوند نیست؛ بلکه تمام ترکیب‌های مقادیر آن حذف می‌شوند::" msgid "" ">>> b' spacious '.rstrip()\n" @@ -3177,9 +5791,19 @@ msgid "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" msgstr "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method that will remove a single suffix string rather than all of a set of characters. For example::" +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like object`. " +"See :meth:`~bytes.removesuffix` for a method that will remove a single suffix string " +"rather than all of a set of characters. For example::" msgstr "" +"دنباله‌ی دودویی از مقادیر بایتی که باید حذف شوند، می‌تواند هر :term:`bytes-like object` " +"باشد. برای دیدن متدی که یک رشته‌ی پسوند واحد را حذف می‌کند، نه همه‌ی یک مجموعه از " +"نویسه‌ها، :meth:`~bytes.removesuffix` را ببینید. برای مثال::" msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" @@ -3187,12 +5811,38 @@ msgid "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" msgstr "" - -msgid "Split the binary sequence into subsequences of the same type, using *sep* as the delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not specified or is ``-1``, then there is no limit on the number of splits (all possible splits are made)." -msgstr "" - -msgid "If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` returns ``[b'1', b'', b'2']``). The *sep* argument may consist of a multibyte sequence as a single delimiter. Splitting an empty sequence with a specified separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on the type of object being split. The *sep* argument may be any :term:`bytes-like object`." +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" + +msgid "" +"Split the binary sequence into subsequences of the same type, using *sep* as the " +"delimiter string. If *maxsplit* is given and non-negative, at most *maxsplit* splits " +"are done (thus, the list will have at most ``maxsplit+1`` elements). If *maxsplit* is " +"not specified or is ``-1``, then there is no limit on the number of splits (all " +"possible splits are made)." msgstr "" +"دنباله دودویی را با استفاده از *sep* به‌عنوان رشته جداکننده، به زیردنباله‌هایی از همان " +"نوع تقسیم می‌کند. اگر *maxsplit* داده شده باشد و نامنفی باشد، حداکثر *maxsplit* جداسازی " +"انجام می‌شود (بنابراین، فهرست حداکثر ``maxsplit+1`` المان خواهد داشت). اگر *maxsplit* " +"مشخص نشده باشد یا ``-1`` باشد، محدودیتی برای تعداد جداسازی‌ها وجود ندارد (تمام " +"جداسازی‌های ممکن انجام می‌شوند)." + +msgid "" +"If *sep* is given, consecutive delimiters are not grouped together and are deemed to " +"delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` returns ``[b'1', b'', " +"b'2']``). The *sep* argument may consist of a multibyte sequence as a single " +"delimiter. Splitting an empty sequence with a specified separator returns ``[b'']`` or " +"``[bytearray(b'')]`` depending on the type of object being split. The *sep* argument " +"may be any :term:`bytes-like object`." +msgstr "" +"اگر *sep* داده شود، جداکننده‌های متوالی با هم گروه‌بندی نمی‌شوند و به‌عنوان جداکننده‌ی " +"زیردنباله‌های خالی در نظر گرفته می‌شوند (برای مثال، ``b'1,,2'.split(b',')`` مقدار " +"``[b'1', b'', b'2']`` را برمی‌گرداند). آرگومان *sep* می‌تواند از یک دنباله‌ی چندبایتی " +"به‌عنوان یک جداکننده تشکیل شود. تقسیم یک دنباله‌ی خالی با یک جداکننده‌ی مشخص، بسته به نوع " +"شیء مورد تقسیم، ``[b'']`` یا ``[bytearray(b'')]`` را برمی‌گرداند. آرگومان *sep* می‌تواند " +"هر شیء شبه‌بایت (:term:`bytes-like object`) باشد." msgid "" ">>> b'1,2,3'.split(b',')\n" @@ -3204,9 +5854,27 @@ msgid "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" msgstr "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" -msgid "If *sep* is not specified or is ``None``, a different splitting algorithm is applied: runs of consecutive ASCII whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the sequence has leading or trailing whitespace. Consequently, splitting an empty sequence or a sequence consisting solely of ASCII whitespace without a specified separator returns ``[]``." +msgid "" +"If *sep* is not specified or is ``None``, a different splitting algorithm is applied: " +"runs of consecutive ASCII whitespace are regarded as a single separator, and the " +"result will contain no empty strings at the start or end if the sequence has leading " +"or trailing whitespace. Consequently, splitting an empty sequence or a sequence " +"consisting solely of ASCII whitespace without a specified separator returns ``[]``." msgstr "" +"اگر *sep* مشخص نشده باشد یا ``None`` باشد، الگوریتم جداسازی متفاوتی اعمال می‌شود: " +"دنباله‌های پیوسته از نویسه‌های فضای خالی ASCII به‌عنوان یک جداکننده در نظر گرفته می‌شوند، " +"و اگر دنباله دارای نویسه‌های فضای خالی در ابتدا یا انتها باشد، نتیجه شامل هیچ رشته‌ی خالی " +"در ابتدا یا انتها نخواهد بود. در نتیجه، جداسازی یک دنباله‌ی خالی یا دنباله‌ای که تنها از " +"نویسه‌های فضای خالی ASCII تشکیل شده است، بدون تعیین جداکننده، ``[]`` را برمی‌گرداند." msgid "" ">>> b'1 2 3'.split()\n" @@ -3216,9 +5884,25 @@ msgid "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" msgstr "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" -msgid "Return a copy of the sequence with specified leading and trailing bytes removed. The *bytes* argument is a binary sequence specifying the set of byte values to be removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII whitespace. The *bytes* argument is not a prefix or suffix; rather, all combinations of its values are stripped::" +msgid "" +"Return a copy of the sequence with specified leading and trailing bytes removed. The " +"*bytes* argument is a binary sequence specifying the set of byte values to be " +"removed. If omitted or ``None``, the *bytes* argument defaults to removing ASCII " +"whitespace. The *bytes* argument is not a prefix or suffix; rather, all combinations " +"of its values are stripped::" msgstr "" +"نسخه‌ای از دنباله را برمی‌گرداند که بایت‌های آغازی و پایانی مشخص‌شده در آن حذف شده‌اند. " +"آرگومان *bytes* یک دنباله دودویی است که مجموعه‌ای از مقادیر بایت برای حذف را مشخص " +"می‌کند. اگر حذف شود یا ``None`` باشد، آرگومان *bytes* به‌طور پیش‌فرض فضای سفید ASCII را " +"حذف می‌کند. آرگومان *bytes* یک پیشوند یا پسوند نیست؛ بلکه تمام ترکیب‌های مقادیر آن حذف " +"می‌شوند::" msgid "" ">>> b' spacious '.strip()\n" @@ -3226,18 +5910,59 @@ msgid "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" msgstr "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" -msgid "The binary sequence of byte values to remove may be any :term:`bytes-like object`." +msgid "" +"The binary sequence of byte values to remove may be any :term:`bytes-like object`." msgstr "" +"دنباله‌ی دودویی از مقادیر بایت برای حذف می‌تواند هر :term:`bytes-like object` باشد." -msgid "The following methods on bytes and bytearray objects assume the use of ASCII compatible binary formats and should not be applied to arbitrary binary data. Note that all of the bytearray methods in this section do *not* operate in place, and instead produce new objects." +msgid "" +"The following methods on bytes and bytearray objects assume the use of ASCII " +"compatible binary formats and should not be applied to arbitrary binary data. Note " +"that all of the bytearray methods in this section do *not* operate in place, and " +"instead produce new objects." msgstr "" +"متدهای زیر روی اشیای bytes و bytearray فرض می‌کنند که از قالب‌های دودویی سازگار با " +"ASCII استفاده می‌شود و نباید روی داده‌های دودویی دلخواه اعمال شوند. توجه داشته باشید که " +"همه متدهای bytearray در این بخش به‌صورت درجا عمل *نمی‌کنند* و در عوض اشیای جدید تولید " +"می‌کنند." -msgid "Return a copy of the sequence with each byte interpreted as an ASCII character, and the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed through unchanged." +msgid "" +"Return a copy of the sequence with each byte interpreted as an ASCII character, and " +"the first byte capitalized and the rest lowercased. Non-ASCII byte values are passed " +"through unchanged." msgstr "" +"نسخه‌ای از دنباله را برمی‌گرداند که در آن هر بایت به‌عنوان یک نویسه ASCII تفسیر می‌شود و " +"بایت اول به حرف بزرگ و بقیه به حروف کوچک تبدیل می‌شوند. مقادیر بایت غیر ASCII بدون " +"تغییر باقی می‌مانند." -msgid "Return a copy of the sequence where all ASCII tab characters are replaced by one or more ASCII spaces, depending on the current column and the given tab size. Tab positions occur every *tabsize* bytes (default is 8, giving tab positions at columns 0, 8, 16 and so on). To expand the sequence, the current column is set to zero and the sequence is examined byte by byte. If the byte is an ASCII tab character (``b'\\t'``), one or more space characters are inserted in the result until the current column is equal to the next tab position. (The tab character itself is not copied.) If the current byte is an ASCII newline (``b'\\n'``) or carriage return (``b'\\r'``), it is copied and the current column is reset to zero. Any other byte value is copied unchanged and the current column is incremented by one regardless of how the byte value is represented when printed::" +msgid "" +"Return a copy of the sequence where all ASCII tab characters are replaced by one or " +"more ASCII spaces, depending on the current column and the given tab size. Tab " +"positions occur every *tabsize* bytes (default is 8, giving tab positions at columns " +"0, 8, 16 and so on). To expand the sequence, the current column is set to zero and " +"the sequence is examined byte by byte. If the byte is an ASCII tab character " +"(``b'\\t'``), one or more space characters are inserted in the result until the " +"current column is equal to the next tab position. (The tab character itself is not " +"copied.) If the current byte is an ASCII newline (``b'\\n'``) or carriage return " +"(``b'\\r'``), it is copied and the current column is reset to zero. Any other byte " +"value is copied unchanged and the current column is incremented by one regardless of " +"how the byte value is represented when printed::" msgstr "" +"یک کپی از دنباله برمی‌گرداند که در آن همه‌ی نویسه‌های Tab ASCII با یک یا چند فاصله‌ی ASCII " +"جایگزین می‌شوند؛ این جایگزینی به ستون جاری و اندازه‌ی Tab داده‌شده بستگی دارد. جایگاه‌های " +"Tab هر *tabsize* بایت یک‌بار رخ می‌دهند (پیش‌فرض ۸ است و جایگاه‌های Tab در ستون‌های ۰، ۸، " +"۱۶ و به همین ترتیب قرار می‌گیرند). برای بسط دنباله، ستون جاری روی صفر تنظیم می‌شود و " +"دنباله بایت به بایت بررسی می‌شود. اگر بایت یک نویسه‌ی Tab ASCII (``b'\\t'``) باشد، یک یا " +"چند نویسه‌ی فاصله در نتیجه درج می‌شوند تا ستون جاری برابر با جایگاه Tab بعدی شود. (خود " +"نویسه‌ی Tab کپی نمی‌شود.) اگر بایت جاری یک خط جدید ASCII (``b'\\n'``) یا بازگشت به ابتدای سطر " +"(``b'\\r'``) باشد، کپی می‌شود و ستون جاری به صفر بازنشانی می‌شود. هر مقدار بایت دیگری " +"بدون تغییر کپی می‌شود و ستون جاری یک واحد افزایش می‌یابد، صرف‌نظر از این‌که مقدار بایت " +"هنگام چاپ چگونه نمایش داده می‌شود::" msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" @@ -3245,9 +5970,23 @@ msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" msgstr "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" -msgid "Return ``True`` if all bytes in the sequence are alphabetical ASCII characters or ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``." +msgid "" +"Return ``True`` if all bytes in the sequence are alphabetical ASCII characters or " +"ASCII decimal digits and the sequence is not empty, ``False`` otherwise. Alphabetic " +"ASCII characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal digits are " +"those byte values in the sequence ``b'0123456789'``." msgstr "" +"اگر همه‌ی بایت‌های موجود در دنباله، نویسه‌های الفبایی ASCII یا ارقام اعشاری ASCII باشند و " +"دنباله خالی نباشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند. " +"نویسه‌های الفبایی ASCII آن مقادیر بایتی هستند که در دنباله " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` قرار دارند. ارقام اعشاری " +"ASCII آن مقادیر بایتی هستند که در دنباله ``b'0123456789'`` قرار دارند." msgid "" ">>> b'ABCabc1'.isalnum()\n" @@ -3255,9 +5994,21 @@ msgid "" ">>> b'ABC abc1'.isalnum()\n" "False" msgstr "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" -msgid "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." +msgid "" +"Return ``True`` if all bytes in the sequence are alphabetic ASCII characters and the " +"sequence is not empty, ``False`` otherwise. Alphabetic ASCII characters are those " +"byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" +"اگر همه بایت‌های موجود در دنباله، نویسه‌های الفبایی ASCII باشند و دنباله خالی نباشد، " +"``True`` برگردانده می‌شود؛ در غیر این صورت ``False`` برگردانده می‌شود. نویسه‌های الفبایی " +"ASCII، مقدارهای بایت موجود در دنباله " +"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` هستند." msgid "" ">>> b'ABCabc'.isalpha()\n" @@ -3265,12 +6016,26 @@ msgid "" ">>> b'ABCabc1'.isalpha()\n" "False" msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" -msgid "Return ``True`` if the sequence is empty or all bytes in the sequence are ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." +msgid "" +"Return ``True`` if the sequence is empty or all bytes in the sequence are ASCII, " +"``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" +"اگر دنباله خالی باشد یا همه‌ی بایت‌های دنباله ASCII باشند، ``True`` و در غیر این صورت " +"``False`` برمی‌گرداند. بایت‌های ASCII در بازه‌ی 0-0x7F قرار دارند." -msgid "Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the sequence ``b'0123456789'``." +msgid "" +"Return ``True`` if all bytes in the sequence are ASCII decimal digits and the sequence " +"is not empty, ``False`` otherwise. ASCII decimal digits are those byte values in the " +"sequence ``b'0123456789'``." msgstr "" +"اگر همه‌ی بایت‌های دنباله ارقام دهدهی ASCII باشند و دنباله خالی نباشد، ``True`` " +"برمی‌گرداند؛ در غیر این صورت ``False`` برمی‌گرداند. ارقام دهدهی ASCII همان مقادیر بایتی " +"موجود در دنباله ``b'0123456789'`` هستند." msgid "" ">>> b'1234'.isdigit()\n" @@ -3278,9 +6043,17 @@ msgid "" ">>> b'1.23'.isdigit()\n" "False" msgstr "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" -msgid "Return ``True`` if there is at least one lowercase ASCII character in the sequence and no uppercase ASCII characters, ``False`` otherwise." +msgid "" +"Return ``True`` if there is at least one lowercase ASCII character in the sequence and " +"no uppercase ASCII characters, ``False`` otherwise." msgstr "" +"اگر حداقل یک نویسه‌ی ASCII کوچک در دنباله وجود داشته باشد و هیچ نویسه‌ی ASCII بزرگی وجود " +"نداشته باشد، ``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند." msgid "" ">>> b'hello world'.islower()\n" @@ -3288,15 +6061,39 @@ msgid "" ">>> b'Hello world'.islower()\n" "False" msgstr "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" -msgid "Lowercase ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." +msgid "" +"Lowercase ASCII characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in " +"the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" +"نویسه‌های ASCII کوچک آن مقادیر بایتی هستند که در دنباله " +"``b'abcdefghijklmnopqrstuvwxyz'`` قرار دارند. نویسه‌های ASCII بزرگ آن مقادیر بایتی " +"هستند که در دنباله ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`` قرار دارند." -msgid "Return ``True`` if all bytes in the sequence are ASCII whitespace and the sequence is not empty, ``False`` otherwise. ASCII whitespace characters are those byte values in the sequence ``b' \\t\\n\\r\\x0b\\f'`` (space, tab, newline, carriage return, vertical tab, form feed)." +msgid "" +"Return ``True`` if all bytes in the sequence are ASCII whitespace and the sequence is " +"not empty, ``False`` otherwise. ASCII whitespace characters are those byte values in " +"the sequence ``b' \\t\\n\\r\\x0b\\f'`` (space, tab, newline, carriage return, vertical " +"tab, form feed)." msgstr "" +"اگر تمام بایت‌های موجود در دنباله، نویسه‌های فضای سفید ASCII باشند و دنباله خالی نباشد، " +"``True`` را برمی‌گرداند؛ در غیر این صورت ``False`` را برمی‌گرداند. نویسه‌های فضای سفید " +"ASCII، همان مقادیر بایتی موجود در دنباله ``b' \\t\\n\\r\\x0b\\f'`` هستند (فاصله، تب، " +"خط جدید، بازگشت به ابتدای سطر، تب عمودی، تغذیه فرم)." -msgid "Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the definition of \"titlecase\"." +msgid "" +"Return ``True`` if the sequence is ASCII titlecase and the sequence is not empty, " +"``False`` otherwise. See :meth:`bytes.title` for more details on the definition of " +"\"titlecase\"." msgstr "" +"اگر دنباله ASCII و به حالت عنوانی (titlecase) باشد و خالی نباشد، ``True`` و در غیر این " +"صورت ``False`` برمی‌گرداند. برای جزئیات بیشتر درباره‌ی تعریف " +"«titlecase»، :meth:`bytes.title` را ببینید." msgid "" ">>> b'Hello World'.istitle()\n" @@ -3304,9 +6101,17 @@ msgid "" ">>> b'Hello world'.istitle()\n" "False" msgstr "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" -msgid "Return ``True`` if there is at least one uppercase alphabetic ASCII character in the sequence and no lowercase ASCII characters, ``False`` otherwise." +msgid "" +"Return ``True`` if there is at least one uppercase alphabetic ASCII character in the " +"sequence and no lowercase ASCII characters, ``False`` otherwise." msgstr "" +"اگر حداقل یک نویسه‌ی الفبایی ASCII بزرگ در دنباله وجود داشته باشد و هیچ نویسه‌ی ASCII " +"کوچکی وجود نداشته باشد، ``True`` برمی‌گرداند، در غیر این صورت ``False``." msgid "" ">>> b'HELLO WORLD'.isupper()\n" @@ -3314,17 +6119,31 @@ msgid "" ">>> b'Hello world'.isupper()\n" "False" msgstr "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" -msgid "Return a copy of the sequence with all the uppercase ASCII characters converted to their corresponding lowercase counterpart." +msgid "" +"Return a copy of the sequence with all the uppercase ASCII characters converted to " +"their corresponding lowercase counterpart." msgstr "" +"نسخه‌ای از دنباله را برمی‌گرداند که در آن همه‌ی نویسه‌های ASCII بزرگ به معادل کوچک متناظر " +"خود تبدیل شده‌اند." msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" msgstr "" +">>> b'Hello World'.lower()\n" +"b'hello world'" -msgid "Return a list of the lines in the binary sequence, breaking at ASCII line boundaries. This method uses the :term:`universal newlines` approach to splitting lines. Line breaks are not included in the resulting list unless *keepends* is given and true." +msgid "" +"Return a list of the lines in the binary sequence, breaking at ASCII line boundaries. " +"This method uses the :term:`universal newlines` approach to splitting lines. Line " +"breaks are not included in the resulting list unless *keepends* is given and true." msgstr "" +"فهرستی از خط‌های موجود در دنباله‌ی دودویی را برمی‌گرداند و خط‌ها را در مرزهای خط ASCII می‌شکند. این متد از رویکرد :term:`خط‌های جدید همگانی (universal newlines) ` برای تقسیم خط‌ها استفاده می‌کند. نویسه‌های خط جدید در فهرست حاصل گنجانده نمی‌شوند، مگر اینکه *keepends* داده شود و true باشد." msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" @@ -3332,9 +6151,18 @@ msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" msgstr "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -msgid "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this method returns an empty list for the empty string, and a terminal line break does not result in an extra line::" +msgid "" +"Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this method " +"returns an empty list for the empty string, and a terminal line break does not result " +"in an extra line::" msgstr "" +"برخلاف :meth:`~bytes.split`، وقتی یک رشته‌ی جداکننده *sep* داده شود، این متد برای رشته‌ی " +"خالی یک فهرست خالی برمی‌گرداند و یک شکست خط پایانی باعث ایجاد خط اضافی نمی‌شود::" msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" @@ -3342,36 +6170,69 @@ msgid "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" msgstr "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" -msgid "Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart and vice-versa." +msgid "" +"Return a copy of the sequence with all the lowercase ASCII characters converted to " +"their corresponding uppercase counterpart and vice-versa." msgstr "" +"نسخه‌ای از دنباله را برمی‌گرداند که در آن تمام نویسه‌های ASCII کوچک به نویسه‌ی بزرگ " +"متناظرشان و برعکس تبدیل شده‌اند." msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" -msgid "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase().swapcase() == bin`` for the binary versions. Case conversions are symmetrical in ASCII, even though that is not generally true for arbitrary Unicode code points." +msgid "" +"Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase().swapcase() == " +"bin`` for the binary versions. Case conversions are symmetrical in ASCII, even though " +"that is not generally true for arbitrary Unicode code points." msgstr "" +"برخلاف :func:`str.swapcase`، در نسخه‌های دودویی همیشه ``bin.swapcase().swapcase() == " +"bin`` برقرار است. تبدیل‌های حالت در ASCII متقارن هستند، اگرچه این موضوع به‌طور کلی برای " +"نقاط کد یونیکد دلخواه صادق نیست." -msgid "Return a titlecased version of the binary sequence where words start with an uppercase ASCII character and the remaining characters are lowercase. Uncased byte values are left unmodified." +msgid "" +"Return a titlecased version of the binary sequence where words start with an uppercase " +"ASCII character and the remaining characters are lowercase. Uncased byte values are " +"left unmodified." msgstr "" +"یک نسخه‌ی عنوانی‌شده از دنباله‌ی دودویی برمی‌گرداند که در آن کلمات با یک نویسه‌ی ASCII بزرگ " +"آغاز می‌شوند و باقی نویسه‌ها کوچک هستند. مقادیر بایت بدون حالت حروف، بدون تغییر باقی " +"می‌مانند." msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" msgstr "" +">>> b'Hello world'.title()\n" +"b'Hello World'" -msgid "Lowercase ASCII characters are those byte values in the sequence ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased." +msgid "" +"Lowercase ASCII characters are those byte values in the sequence " +"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte values in " +"the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte values are uncased." msgstr "" +"نویسه‌های ASCII کوچک، آن مقادیر بایتی هستند که در دنباله " +"``b'abcdefghijklmnopqrstuvwxyz'`` قرار دارند. نویسه‌های ASCII بزرگ، آن مقادیر بایتی " +"هستند که در دنباله ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`` قرار دارند. تمام مقادیر بایت " +"دیگر، بدون حالت هستند." msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" msgstr "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" msgid "A workaround for apostrophes can be constructed using regular expressions::" -msgstr "" +msgstr "می‌توان راه‌حلی موقت برای آپوستروف‌ها با استفاده از عبارت‌های باقاعده ساخت::" msgid "" ">>> import re\n" @@ -3384,17 +6245,42 @@ msgid "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" -msgid "Return a copy of the sequence with all the lowercase ASCII characters converted to their corresponding uppercase counterpart." +msgid "" +"Return a copy of the sequence with all the lowercase ASCII characters converted to " +"their corresponding uppercase counterpart." msgstr "" +"نسخه‌ای از دنباله برمی‌گرداند که همه نویسه‌های ASCII کوچک به همتای بزرگ متناظرشان تبدیل " +"شده‌اند." msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" msgstr "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" -msgid "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is handled by inserting the padding *after* the sign character rather than before. For :class:`bytes` objects, the original sequence is returned if *width* is less than or equal to ``len(seq)``." +msgid "" +"Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make a " +"sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is handled by " +"inserting the padding *after* the sign character rather than before. " +"For :class:`bytes` objects, the original sequence is returned if *width* is less than " +"or equal to ``len(seq)``." msgstr "" +"یک کپی از دنباله برمی‌گرداند که از سمت چپ با ارقام ASCII ``b'0'`` پر شده است تا " +"دنباله‌ای به طول *width* بسازد. پیشوند علامت در ابتدا (``b'+'``/ ``b'-'``) به این صورت " +"مدیریت می‌شود که نویسه‌های پرکننده *بعد* از نویسه علامت درج می‌شوند، نه قبل از آن. برای " +"اشیاء :class:`bytes`، اگر *width* کوچک‌تر یا مساوی ``len(seq)`` باشد، دنباله اصلی " +"برگردانده می‌شود." msgid "" ">>> b\"42\".zfill(5)\n" @@ -3402,81 +6288,165 @@ msgid "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" msgstr "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" msgid "``printf``-style Bytes Formatting" -msgstr "" +msgstr "قالب‌بندی بایت‌ها به‌سبک ``printf``" -msgid "The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). If the value being printed may be a tuple or dictionary, wrap it in a tuple." +msgid "" +"The formatting operations described here exhibit a variety of quirks that lead to a " +"number of common errors (such as failing to display tuples and dictionaries " +"correctly). If the value being printed may be a tuple or dictionary, wrap it in a " +"tuple." msgstr "" +"عملیات قالب‌بندی توصیف‌شده در اینجا، دارای انواعی از رفتارهای عجیب هستند که به تعدادی از " +"خطاهای رایج منجر می‌شوند (مانند عدم نمایش صحیح تاپل‌ها و دیکشنری‌ها). اگر مقداری که چاپ " +"می‌شود ممکن است یک تاپل یا دیکشنری باشد، آن را در یک تاپل قرار دهید." -msgid "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: the ``%`` operator (modulo). This is also known as the bytes *formatting* or *interpolation* operator. Given ``format % values`` (where *format* is a bytes object), ``%`` conversion specifications in *format* are replaced with zero or more elements of *values*. The effect is similar to using the :c:func:`sprintf` in the C language." +msgid "" +"Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: the ``%`` " +"operator (modulo). This is also known as the bytes *formatting* or *interpolation* " +"operator. Given ``format % values`` (where *format* is a bytes object), ``%`` " +"conversion specifications in *format* are replaced with zero or more elements of " +"*values*. The effect is similar to using the :c:func:`sprintf` in the C language." msgstr "" +"اشیای bytes (``bytes``/``bytearray``) یک عملیات توکار منحصربه‌فرد دارند: عملگر ``%`` " +"(باقی‌مانده). این عملگر همچنین به‌عنوان عملگر *قالب‌بندی* یا *درون‌یابی* bytes شناخته " +"می‌شود. با داشتن ``format % values`` (که در آن *format* یک شیء bytes است)، مشخصات تبدیل " +"``%`` در *format* با صفر یا چند عنصر از *values* جایگزین می‌شوند. اثر آن مشابه استفاده " +"از :c:func:`sprintf` در زبان C است." -msgid "If *format* requires a single argument, *values* may be a single non-tuple object. [5]_ Otherwise, *values* must be a tuple with exactly the number of items specified by the format bytes object, or a single mapping object (for example, a dictionary)." +msgid "" +"If *format* requires a single argument, *values* may be a single non-tuple object. " +"[5]_ Otherwise, *values* must be a tuple with exactly the number of items specified " +"by the format bytes object, or a single mapping object (for example, a dictionary)." msgstr "" +"اگر *format* به یک آرگومان واحد نیاز داشته باشد، *values* ممکن است یک شیء واحد باشد که " +"تاپل نیست. [5]_ در غیر این صورت، *values* باید یک تاپل با دقیقاً تعداد آیتم‌های مشخص‌شده " +"توسط شیء بایتی قالب باشد، یا یک شیء نگاشت واحد (برای مثال، یک دیکشنری)." -msgid "When the right argument is a dictionary (or other mapping type), then the formats in the bytes object *must* include a parenthesised mapping key into that dictionary inserted immediately after the ``'%'`` character. The mapping key selects the value to be formatted from the mapping. For example:" +msgid "" +"When the right argument is a dictionary (or other mapping type), then the formats in " +"the bytes object *must* include a parenthesised mapping key into that dictionary " +"inserted immediately after the ``'%'`` character. The mapping key selects the value to " +"be formatted from the mapping. For example:" msgstr "" +"هنگامی که آرگومان سمت راست یک دیکشنری (یا نوع نگاشت (mapping) دیگری) باشد، قالب‌های " +"درون شیء bytes *باید* شامل یک کلید نگاشت داخل پرانتز برای آن دیکشنری باشند که بلافاصله " +"پس از نویسه ``'%'`` درج شده باشد. کلید نگاشت، مقداری از نگاشت را که باید قالب‌بندی شود " +"انتخاب می‌کند. برای مثال:" msgid "\\(8)" -msgstr "" +msgstr "\\(8)" msgid "Single byte (accepts integer or single byte objects)." -msgstr "" +msgstr "تک‌بایت (عدد صحیح یا اشیای تک‌بایتی را می‌پذیرد)." msgid "``'b'``" -msgstr "" +msgstr "``'b'``" -msgid "Bytes (any object that follows the :ref:`buffer protocol ` or has :meth:`~object.__bytes__`)." +msgid "" +"Bytes (any object that follows the :ref:`buffer protocol ` or " +"has :meth:`~object.__bytes__`)." msgstr "" +"بایت‌ها (هر شیءای که از :ref:`buffer protocol ` پیروی کند یا " +"دارای :meth:`~object.__bytes__` باشد)." msgid "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code bases." msgstr "" +"``'s'`` یک نام مستعار برای ``'b'`` است و باید فقط برای پایگاه‌های کد Python2/3 استفاده " +"شود." -msgid "Bytes (converts any Python object using ``repr(obj).encode('ascii', 'backslashreplace')``)." +msgid "" +"Bytes (converts any Python object using ``repr(obj).encode('ascii', " +"'backslashreplace')``)." msgstr "" +"بایت‌ها (هر شیء پایتون را با استفاده از ``repr(obj).encode('ascii', " +"'backslashreplace')`` تبدیل می‌کند)." msgid "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code bases." msgstr "" +"``'r'`` نام مستعاری برای ``'a'`` است و باید تنها برای پایگاه‌های کد Python2/3 استفاده " +"شود." msgid "\\(7)" -msgstr "" +msgstr "\\(7)" msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." -msgstr "" +msgstr "``b'%s'`` منسوخ شده است، اما در طول سری 3.x حذف نخواهد شد." msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." -msgstr "" +msgstr "``b'%r'`` منسوخ شده است، اما در طول سری 3.x حذف نخواهد شد." msgid ":pep:`461` - Adding % formatting to bytes and bytearray" -msgstr "" +msgstr ":pep:`461` - افزودن قالب‌بندی % به bytes و bytearray" msgid "Memory Views" -msgstr "" +msgstr "نماهای حافظه" -msgid ":class:`memoryview` objects allow Python code to access the internal data of an object that supports the :ref:`buffer protocol ` without copying." +msgid "" +":class:`memoryview` objects allow Python code to access the internal data of an object " +"that supports the :ref:`buffer protocol ` without copying." msgstr "" +"اشیای :class:`memoryview` به کد پایتون اجازه می‌دهند تا بدون کپی کردن، به داده‌های داخلی " +"شیء‌ای که از :ref:`buffer protocol ` پشتیبانی می‌کند، دسترسی داشته باشد." -msgid "Create a :class:`memoryview` that references *object*. *object* must support the buffer protocol. Built-in objects that support the buffer protocol include :class:`bytes` and :class:`bytearray`." +msgid "" +"Create a :class:`memoryview` that references *object*. *object* must support the " +"buffer protocol. Built-in objects that support the buffer protocol " +"include :class:`bytes` and :class:`bytearray`." msgstr "" +"یک :class:`memoryview` ایجاد کنید که به *object* ارجاع دارد. *object* باید از پروتکل " +"بافر (buffer protocol) پشتیبانی کند. اشیاء توکاری که از پروتکل بافر (buffer protocol) " +"پشتیبانی می‌کنند، شامل :class:`bytes` و :class:`bytearray` هستند." -msgid "A :class:`memoryview` has the notion of an *element*, which is the atomic memory unit handled by the originating *object*. For many simple types such as :class:`bytes` and :class:`bytearray`, an element is a single byte, but other types such as :class:`array.array` may have bigger elements." +msgid "" +"A :class:`memoryview` has the notion of an *element*, which is the atomic memory unit " +"handled by the originating *object*. For many simple types such as :class:`bytes` " +"and :class:`bytearray`, an element is a single byte, but other types such " +"as :class:`array.array` may have bigger elements." msgstr "" +"یک :class:`memoryview` دارای مفهوم *المان* است، که واحد اتمی حافظه‌ای است که توسط *شیء* " +"مبدأ مدیریت می‌شود. برای بسیاری از انواع ساده مانند :class:`bytes` " +"و :class:`bytearray`، یک المان یک بایت واحد است، اما انواع دیگر " +"مانند :class:`array.array` ممکن است المان‌های بزرگ‌تری داشته باشند." -msgid ":class:`!memoryview`\\s are :ref:`generic ` over the type of their underlying data." +msgid "" +":class:`!memoryview`\\s are :ref:`generic ` over the type of their " +"underlying data." msgstr "" +"نمونه‌های :class:`!memoryview` نسبت به نوع داده‌ی زیربنایی خود :ref:`عام ` " +"هستند." -msgid "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which is the nested list representation of the view. If ``view.ndim = 1``, this is equal to the number of elements in the view." +msgid "" +"``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which is the " +"nested list representation of the view. If ``view.ndim = 1``, this is equal to the " +"number of elements in the view." msgstr "" +"``len(view)`` برابر با طول :class:`~memoryview.tolist` است، که بازنمایی فهرست تودرتوی " +"نما است. اگر ``view.ndim = 1`` باشد، این برابر با تعداد عناصر نما است." -msgid "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning 1." +msgid "" +"If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of returning " +"1." msgstr "" +"اگر ``view.ndim == 0`` باشد، ``len(view)`` اکنون به جای برگرداندن ۱، :exc:`TypeError` " +"پرتاب می‌کند." -msgid "The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a single element." -msgstr "" +msgid "" +"The :class:`~memoryview.itemsize` attribute will give you the number of bytes in a " +"single element." +msgstr "ویژگی :class:`~memoryview.itemsize` تعداد بایت‌های یک عنصر را به شما می‌دهد." -msgid "A :class:`memoryview` supports slicing and indexing to expose its data. One-dimensional slicing will result in a subview::" +msgid "" +"A :class:`memoryview` supports slicing and indexing to expose its data. One-" +"dimensional slicing will result in a subview::" msgstr "" +"یک :class:`memoryview` از برش‌دهی و اندیس‌دهی برای آشکار کردن داده‌های خود پشتیبانی " +"می‌کند. برش یک‌بعدی منجر به یک زیرنما می‌شود::" msgid "" ">>> v = memoryview(b'abcefg')\n" @@ -3489,12 +6459,34 @@ msgid "" ">>> bytes(v[1:4])\n" "b'bce'" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"\n" +">>> bytes(v[1:4])\n" +"b'bce'" -msgid "If :class:`~memoryview.format` is one of the native format specifiers from the :mod:`struct` module, indexing with an integer or a tuple of integers is also supported and returns a single *element* with the correct type. One-dimensional memoryviews can be indexed with an integer or a one-integer tuple. Multi-dimensional memoryviews can be indexed with tuples of exactly *ndim* integers where *ndim* is the number of dimensions. Zero-dimensional memoryviews can be indexed with the empty tuple." +msgid "" +"If :class:`~memoryview.format` is one of the native format specifiers from " +"the :mod:`struct` module, indexing with an integer or a tuple of integers is also " +"supported and returns a single *element* with the correct type. One-dimensional " +"memoryviews can be indexed with an integer or a one-integer tuple. Multi-dimensional " +"memoryviews can be indexed with tuples of exactly *ndim* integers where *ndim* is the " +"number of dimensions. Zero-dimensional memoryviews can be indexed with the empty " +"tuple." msgstr "" +"اگر :class:`~memoryview.format` یکی از مشخص‌کننده‌های قالب بومی ماژول :mod:`struct` " +"باشد، اندیس‌دهی با یک عدد صحیح یا تاپلی از اعداد صحیح نیز پشتیبانی می‌شود و یک *المان* " +"واحد با نوع صحیح را برمی‌گرداند. memoryviewهای یک‌بعدی را می‌توان با یک عدد صحیح یا تاپلی " +"شامل یک عدد صحیح اندیس‌دهی کرد. memoryviewهای چندبُعدی را می‌توان با تاپل‌هایی شامل دقیقاً " +"*ndim* عدد صحیح اندیس‌دهی کرد، که *ndim* تعداد ابعاد است. memoryviewهای صفربعدی را " +"می‌توان با تاپل خالی اندیس‌دهی کرد." msgid "Here is an example with a non-byte format::" -msgstr "" +msgstr "در اینجا مثالی با یک قالب غیربایتی آمده است::" msgid "" ">>> import array\n" @@ -3507,9 +6499,22 @@ msgid "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" msgstr "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" -msgid "If the underlying object is writable, the memoryview supports one-dimensional slice assignment. Resizing is not allowed::" +msgid "" +"If the underlying object is writable, the memoryview supports one-dimensional slice " +"assignment. Resizing is not allowed::" msgstr "" +"اگر شیء زیرین قابل نوشتن باشد، memoryview از انتساب برش یک‌بعدی پشتیبانی می‌کند. تغییر " +"اندازه مجاز نیست::" msgid "" ">>> data = bytearray(b'abcefg')\n" @@ -3530,9 +6535,30 @@ msgid "" ">>> data\n" "bytearray(b'z1spam')" msgstr "" +">>> data = bytearray(b'abcefg')\n" +">>> v = memoryview(data)\n" +">>> v.readonly\n" +"False\n" +">>> v[0] = ord(b'z')\n" +">>> data\n" +"bytearray(b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> data\n" +"bytearray(b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: memoryview assignment: lvalue and rvalue have different structures\n" +">>> v[2:6] = b'spam'\n" +">>> data\n" +"bytearray(b'z1spam')" -msgid "One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``::" +msgid "" +"One-dimensional memoryviews of :term:`hashable` (read-only) types with formats 'B', " +"'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``::" msgstr "" +"memoryviewهای یک‌بعدی از انواع :term:`hashable` (فقط‌خواندنی) با قالب‌های 'B'، 'b' یا 'c' " +"نیز هش‌پذیر هستند. هش به‌صورت ``hash(m) == hash(m.tobytes())`` تعریف شده است::" msgid "" ">>> v = memoryview(b'abcefg')\n" @@ -3543,27 +6569,48 @@ msgid "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" -msgid "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with formats 'B', 'b' or 'c' are now :term:`hashable`." +msgid "" +"One-dimensional memoryviews can now be sliced. One-dimensional memoryviews with " +"formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" +"اکنون می‌توان memoryviewهای یک‌بعدی را برش داد. memoryviewهای یک‌بعدی با قالب‌های 'B'، 'b' " +"یا 'c' اکنون :term:`hashable` هستند." msgid "memoryview is now registered automatically with :class:`collections.abc.Sequence`" -msgstr "" +msgstr "memoryview اکنون به‌طور خودکار در :class:`collections.abc.Sequence` ثبت شده است" msgid "memoryviews can now be indexed with tuple of integers." -msgstr "" +msgstr "اکنون می‌توان memoryviewها را با تاپلی از اعداد صحیح اندیس‌گذاری کرد." msgid "memoryview is now a :term:`generic type`." -msgstr "" +msgstr "memoryview اکنون یک :term:`نوع عام ` است." msgid ":class:`memoryview` has several methods:" -msgstr "" +msgstr ":class:`memoryview` چندین متد دارد:" -msgid "A memoryview and a :pep:`3118` exporter are equal if their shapes are equivalent and if all corresponding values are equal when the operands' respective format codes are interpreted using :mod:`struct` syntax." +msgid "" +"A memoryview and a :pep:`3118` exporter are equal if their shapes are equivalent and " +"if all corresponding values are equal when the operands' respective format codes are " +"interpreted using :mod:`struct` syntax." msgstr "" +"یک memoryview و یک صادرکننده (exporter) :pep:`3118` برابر هستند اگر شکل‌های آن‌ها معادل " +"باشد و اگر تمام مقادیر متناظر، هنگامی که کدهای قالب مربوط به هر یک از عملوندها با " +"استفاده از سینتکس :mod:`struct` تفسیر شوند، برابر باشند." -msgid "For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" +msgid "" +"For the subset of :mod:`struct` format strings currently supported by :meth:`tolist`, " +"``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" +"برای زیرمجموعه‌ای از رشته‌های قالب :mod:`struct` که در حال حاضر توسط :meth:`tolist` " +"پشتیبانی می‌شوند، ``v`` و ``w`` زمانی برابرند که ``v.tolist() == w.tolist()``::" msgid "" ">>> import array\n" @@ -3582,9 +6629,29 @@ msgid "" ">>> z.tolist() == c.tolist()\n" "True" msgstr "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" -msgid "If either format string is not supported by the :mod:`struct` module, then the objects will always compare as unequal (even if the format strings and buffer contents are identical)::" +msgid "" +"If either format string is not supported by the :mod:`struct` module, then the objects " +"will always compare as unequal (even if the format strings and buffer contents are " +"identical)::" msgstr "" +"اگر ماژول :mod:`struct` از هر یک از رشته‌های قالب پشتیبانی نکند، آنگاه اشیاء همیشه در " +"مقایسه نابرابر خواهند بود (حتی اگر رشته‌های قالب و محتوای بافر یکسان باشند)::" msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" @@ -3599,15 +6666,37 @@ msgid "" ">>> a == b\n" "False" msgstr "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" -msgid "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for memoryview objects." +msgid "" +"Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v == w`` for " +"memoryview objects." msgstr "" +"توجه داشته باشید که همانند اعداد ممیز شناور، ``v is w`` برای اشیای memoryview به معنای " +"``v == w`` *نیست*." -msgid "Previous versions compared the raw memory disregarding the item format and the logical array structure." +msgid "" +"Previous versions compared the raw memory disregarding the item format and the logical " +"array structure." msgstr "" +"نسخه‌های پیشین، حافظه خام را بدون توجه به قالب آیتم و ساختار منطقی آرایه مقایسه می‌کردند." -msgid "Return the data in the buffer as a bytestring. This is equivalent to calling the :class:`bytes` constructor on the memoryview. ::" +msgid "" +"Return the data in the buffer as a bytestring. This is equivalent to calling " +"the :class:`bytes` constructor on the memoryview. ::" msgstr "" +"داده‌های درون بافر را به‌صورت یک رشته بایتی بازمی‌گرداند. این معادل فراخوانی " +"سازنده‌ی :class:`bytes` روی memoryview است. ::" msgid "" ">>> m = memoryview(b\"abc\")\n" @@ -3616,27 +6705,56 @@ msgid "" ">>> bytes(m)\n" "b'abc'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" -msgid "For non-contiguous arrays the result is equal to the flattened list representation with all elements converted to bytes. :meth:`tobytes` supports all format strings, including those that are not in :mod:`struct` module syntax." +msgid "" +"For non-contiguous arrays the result is equal to the flattened list representation " +"with all elements converted to bytes. :meth:`tobytes` supports all format strings, " +"including those that are not in :mod:`struct` module syntax." msgstr "" +"برای آرایه‌های غیرپیوسته، نتیجه برابر با بازنمایی فهرست مسطح‌شده است که همه‌ی عناصر آن به " +"بایت تبدیل‌شده‌اند. :meth:`tobytes` از همه‌ی رشته‌های قالب پشتیبانی می‌کند، از جمله آن‌هایی " +"که در نحو ماژول :mod:`struct` نیستند." -msgid "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the original array is converted to C or Fortran order. For contiguous views, 'A' returns an exact copy of the physical memory. In particular, in-memory Fortran order is preserved. For non-contiguous views, the data is converted to C first. *order=None* is the same as *order='C'*." +msgid "" +"*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the original " +"array is converted to C or Fortran order. For contiguous views, 'A' returns an exact " +"copy of the physical memory. In particular, in-memory Fortran order is preserved. For " +"non-contiguous views, the data is converted to C first. *order=None* is the same as " +"*order='C'*." msgstr "" +"*order* می‌تواند {'C', 'F', 'A'} باشد. وقتی *order* برابر 'C' یا 'F' باشد، داده‌های " +"آرایه اصلی به ترتیب C یا Fortran تبدیل می‌شوند. برای نماهای پیوسته، 'A' یک کپی دقیق از " +"حافظه فیزیکی برمی‌گرداند. به‌طور خاص، ترتیب Fortran در حافظه حفظ می‌شود. برای نماهای " +"ناپیوسته، داده‌ها ابتدا به C تبدیل می‌شوند. *order=None* همان *order='C'* است." -msgid "Return a string object containing two hexadecimal digits for each byte in the buffer. ::" -msgstr "" +msgid "" +"Return a string object containing two hexadecimal digits for each byte in the " +"buffer. ::" +msgstr "یک شیء رشته برمی‌گرداند که شامل دو رقم مبنای شانزده برای هر بایت در بافر است. ::" msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" "'616263'" msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" -msgid "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional *sep* and *bytes_per_sep* parameters to insert separators between bytes in the hex output." +msgid "" +"Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional *sep* and " +"*bytes_per_sep* parameters to insert separators between bytes in the hex output." msgstr "" +"مشابه :meth:`bytes.hex`، :meth:`memoryview.hex` اکنون از پارامترهای اختیاری *sep* و " +"*bytes_per_sep* برای درج جداکننده‌ها بین بایت‌ها در خروجی مبنای شانزده پشتیبانی می‌کند." msgid "Return the data in the buffer as a list of elements. ::" -msgstr "" +msgstr "داده‌های درون بافر را به‌عنوان فهرستی از المان‌ها برمی‌گرداند. ::" msgid "" ">>> memoryview(b'abc').tolist()\n" @@ -3647,12 +6765,27 @@ msgid "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" msgstr "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" -msgid ":meth:`tolist` now supports all single character native formats in :mod:`struct` module syntax as well as multi-dimensional representations." +msgid "" +":meth:`tolist` now supports all single character native formats in :mod:`struct` " +"module syntax as well as multi-dimensional representations." msgstr "" +":meth:`tolist` اکنون از تمام قالب‌های بومی تک‌نویسه‌ای در نحو ماژول :mod:`struct` و " +"همچنین بازنمایی‌های چندبعدی پشتیبانی می‌کند." -msgid "Return a readonly version of the memoryview object. The original memoryview object is unchanged. ::" +msgid "" +"Return a readonly version of the memoryview object. The original memoryview object is " +"unchanged. ::" msgstr "" +"یک نسخه فقط‌خواندنی از شیء memoryview برمی‌گرداند. شیء memoryview اصلی بدون تغییر " +"می‌ماند. ::" msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" @@ -3667,12 +6800,37 @@ msgid "" ">>> mm.tolist()\n" "[43, 98, 99]" msgstr "" +">>> m = memoryview(bytearray(b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> mm[0] = 42\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot modify read-only memory\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" -msgid "Release the underlying buffer exposed by the memoryview object. Many objects take special actions when a view is held on them (for example, a :class:`bytearray` would temporarily forbid resizing); therefore, calling release() is handy to remove these restrictions (and free any dangling resources) as soon as possible." +msgid "" +"Release the underlying buffer exposed by the memoryview object. Many objects take " +"special actions when a view is held on them (for example, a :class:`bytearray` would " +"temporarily forbid resizing); therefore, calling release() is handy to remove these " +"restrictions (and free any dangling resources) as soon as possible." msgstr "" +"بافر زیرینی را که توسط شیء memoryview در معرض قرار گرفته است، آزاد کنید. بسیاری از " +"شیء‌ها هنگامی که یک نما روی آن‌ها نگه‌داری می‌شود، اقدامات ویژه‌ای انجام می‌دهند (برای مثال، " +"یک :class:`bytearray` به‌طور موقت تغییر اندازه را ممنوع می‌کند)؛ بنابراین، فراخوانی " +"release() برای برطرف کردن این محدودیت‌ها (و آزاد کردن هرگونه منبع معلق) در سریع‌ترین " +"زمان ممکن مفید است." -msgid "After this method has been called, any further operation on the view raises a :class:`ValueError` (except :meth:`release` itself which can be called multiple times)::" +msgid "" +"After this method has been called, any further operation on the view raises " +"a :class:`ValueError` (except :meth:`release` itself which can be called multiple " +"times)::" msgstr "" +"پس از فراخوانی این متد، هرگونه عملیات بعدی بر روی نما یک :class:`ValueError` پرتاب " +"می‌کند (به‌جز خود :meth:`release` که می‌تواند چندین بار فراخوانی شود)::" msgid "" ">>> m = memoryview(b'abc')\n" @@ -3682,9 +6840,19 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> m = memoryview(b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" -msgid "The context management protocol can be used for a similar effect, using the ``with`` statement::" +msgid "" +"The context management protocol can be used for a similar effect, using the ``with`` " +"statement::" msgstr "" +"می‌توان از پروتکل مدیریت زمینه برای نتیجه‌ای مشابه، با استفاده از دستور ``with`` استفاده " +"کرد::" msgid "" ">>> with memoryview(b'abc') as m:\n" @@ -3696,15 +6864,38 @@ msgid "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" msgstr "" +">>> with memoryview(b'abc') as m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" -msgid "Cast a memoryview to a new format or shape. *shape* defaults to ``[byte_length//new_itemsize]``, which means that the result view will be one-dimensional. The return value is a new memoryview, but the buffer itself is not copied. Supported casts are 1D -> C-:term:`contiguous` and C-contiguous -> 1D." +msgid "" +"Cast a memoryview to a new format or shape. *shape* defaults to ``[byte_length//" +"new_itemsize]``, which means that the result view will be one-dimensional. The return " +"value is a new memoryview, but the buffer itself is not copied. Supported casts are 1D " +"-> C-:term:`contiguous` and C-contiguous -> 1D." msgstr "" +"یک memoryview را به قالب یا شکل جدیدی تبدیل می‌کند. مقدار پیش‌فرض *shape* برابر " +"``[byte_length//new_itemsize]`` است، که به این معناست که نمای حاصل یک‌بعدی خواهد بود. " +"مقدار بازگشتی یک memoryview جدید است، اما خود بافر کپی نمی‌شود. تبدیل‌های نوعی پشتیبانی‌شده " +"عبارتند از 1D -> C-:term:`contiguous` و C-contiguous -> 1D." -msgid "The destination format is restricted to a single element native format in :mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or 'c'). The byte length of the result must be the same as the original length. Note that all byte lengths may depend on the operating system." +msgid "" +"The destination format is restricted to a single element native format " +"in :mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or 'c'). " +"The byte length of the result must be the same as the original length. Note that all " +"byte lengths may depend on the operating system." msgstr "" +"قالب مقصد به یک قالب بومی تک‌عنصری در سینتکس :mod:`struct` محدود است. یکی از قالب‌ها " +"باید یک قالب بایت ('B'، 'b' یا 'c') باشد. طول بایتی نتیجه باید با طول اصلی یکسان باشد. " +"توجه داشته باشید که همه‌ی طول‌های بایتی ممکن است به سیستم‌عامل وابسته باشند." msgid "Cast 1D/long to 1D/unsigned bytes::" -msgstr "" +msgstr "تبدیل 1D/long به 1D/unsigned bytes::" msgid "" ">>> import array\n" @@ -3728,9 +6919,29 @@ msgid "" ">>> y.nbytes\n" "24" msgstr "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" msgid "Cast 1D/unsigned bytes to 1D/char::" -msgstr "" +msgstr "تبدیل بایت‌های یک‌بعدی/بدون علامت به یک‌بعدی/char::" msgid "" ">>> b = bytearray(b'zyz')\n" @@ -3744,11 +6955,45 @@ msgid "" ">>> b\n" "bytearray(b'ayz')" msgstr "" +">>> b = bytearray(b'zyz')\n" +">>> x = memoryview(b)\n" +">>> x[0] = b'a'\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: memoryview: invalid type for format 'B'\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> b\n" +"bytearray(b'ayz')" msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" +msgstr "تبدیل 1D/bytes به 3D/ints و سپس به 1D/signed char::" + +msgid "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" msgstr "" - -msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" ">>> x = memoryview(buf)\n" @@ -3772,10 +7017,9 @@ msgid "" "48\n" ">>> z.nbytes\n" "48" -msgstr "" msgid "Cast 1D/unsigned long to 2D/unsigned long::" -msgstr "" +msgstr "تبدیل 1D/unsigned long به 2D/unsigned long::" msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" @@ -3788,24 +7032,37 @@ msgid "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" msgstr "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" msgid "The source format is no longer restricted when casting to a byte view." -msgstr "" +msgstr "قالب منبع دیگر هنگام تبدیل (casting) به یک نمای بایتی (byte view) محدود نیست." msgid "Count the number of occurrences of *value*." -msgstr "" +msgstr "تعداد رخدادهای *value* را می‌شمارد." -msgid "Return the index of the first occurrence of *value* (at or after index *start* and before index *stop*)." +msgid "" +"Return the index of the first occurrence of *value* (at or after index *start* and " +"before index *stop*)." msgstr "" +"اندیس نخستین رخداد *value* را برمی‌گرداند (در اندیس *start* یا پس از آن و پیش از اندیس " +"*stop*)." msgid "Raises a :exc:`ValueError` if *value* cannot be found." -msgstr "" +msgstr "اگر *value* یافت نشود، یک :exc:`ValueError` پرتاب می‌شود." msgid "There are also several readonly attributes available:" -msgstr "" +msgstr "همچنین چند ویژگی فقط‌خواندنی در دسترس است:" msgid "The underlying object of the memoryview::" -msgstr "" +msgstr "شیء زیرین memoryview::" msgid "" ">>> b = bytearray(b'xyz')\n" @@ -3813,9 +7070,19 @@ msgid "" ">>> m.obj is b\n" "True" msgstr "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" -msgid "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of space in bytes that the array would use in a contiguous representation. It is not necessarily equal to ``len(m)``::" +msgid "" +"``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the amount of " +"space in bytes that the array would use in a contiguous representation. It is not " +"necessarily equal to ``len(m)``::" msgstr "" +"``nbytes == product(shape) * itemsize == len(m.tobytes())``. این مقدار، میزان فضایی بر " +"حسب بایت است که آرایه در یک نمایش پیوسته اشغال می‌کند. این مقدار لزوماً برابر با " +"``len(m)`` نیست::" msgid "" ">>> import array\n" @@ -3833,9 +7100,23 @@ msgid "" ">>> len(y.tobytes())\n" "12" msgstr "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" msgid "Multi-dimensional arrays::" -msgstr "" +msgstr "آرایه‌های چندبُعدی::" msgid "" ">>> import struct\n" @@ -3849,18 +7130,38 @@ msgid "" ">>> y.nbytes\n" "96" msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" msgid "A bool indicating whether the memory is read only." -msgstr "" +msgstr "یک بولی که نشان می‌دهد حافظه فقط‌خواندنی است." -msgid "A string containing the format (in :mod:`struct` module style) for each element in the view. A memoryview can be created from exporters with arbitrary format strings, but some methods (e.g. :meth:`tolist`) are restricted to native single element formats." +msgid "" +"A string containing the format (in :mod:`struct` module style) for each element in the " +"view. A memoryview can be created from exporters with arbitrary format strings, but " +"some methods (e.g. :meth:`tolist`) are restricted to native single element formats." msgstr "" +"رشته‌ای حاوی قالب (به سبک ماژول :mod:`struct`) برای هر المان در نما. می‌توان یک " +"memoryview را از صادرکننده‌هایی با رشته‌های قالب دلخواه ایجاد کرد، اما برخی متدها " +"(مانند :meth:`tolist`) به قالب‌های بومی برای یک المان محدود هستند." -msgid "format ``'B'`` is now handled according to the struct module syntax. This means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." +msgid "" +"format ``'B'`` is now handled according to the struct module syntax. This means that " +"``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" +"قالب ``'B'`` اکنون مطابق سینتکس ماژول struct پردازش می‌شود. این بدان معناست که " +"``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgid "The size in bytes of each element of the memoryview::" -msgstr "" +msgstr "اندازه‌ی هر عنصر از memoryview بر حسب بایت::" msgid "" ">>> import array, struct\n" @@ -3872,204 +7173,428 @@ msgid "" ">>> struct.calcsize('H') == m.itemsize\n" "True" msgstr "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" -msgid "An integer indicating how many dimensions of a multi-dimensional array the memory represents." -msgstr "" +msgid "" +"An integer indicating how many dimensions of a multi-dimensional array the memory " +"represents." +msgstr "عدد صحیحی که نشان می‌دهد حافظه نشان‌دهنده چند بُعد از یک آرایه چندبُعدی است." -msgid "A tuple of integers the length of :attr:`ndim` giving the shape of the memory as an N-dimensional array." +msgid "" +"A tuple of integers the length of :attr:`ndim` giving the shape of the memory as an N-" +"dimensional array." msgstr "" +"تاپلی از اعداد صحیح به طول :attr:`ndim` که شکل حافظه را به‌عنوان یک آرایه N-بعدی مشخص " +"می‌کند." msgid "An empty tuple instead of ``None`` when ndim = 0." -msgstr "" +msgstr "یک تاپل خالی به‌جای ``None`` هنگامی که ndim = 0 است." -msgid "A tuple of integers the length of :attr:`ndim` giving the size in bytes to access each element for each dimension of the array." +msgid "" +"A tuple of integers the length of :attr:`ndim` giving the size in bytes to access each " +"element for each dimension of the array." msgstr "" +"یک تاپل از اعداد صحیح به طول :attr:`ndim` که اندازه‌ی لازم بر حسب بایت برای دسترسی به " +"هر عنصر در هر بُعد از آرایه را مشخص می‌کند." msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" +"به‌صورت داخلی برای آرایه‌های به‌سبک PIL استفاده می‌شود. این مقدار فقط جنبه اطلاع‌رسانی دارد." msgid "A bool indicating whether the memory is C-:term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می‌دهد آیا حافظه C-:term:`contiguous` است یا خیر." msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می‌دهد آیا حافظه به‌صورت Fortran :term:`contiguous` است یا خیر." msgid "A bool indicating whether the memory is :term:`contiguous`." -msgstr "" +msgstr "یک بولی که نشان می‌دهد حافظه :term:`contiguous` است یا خیر." -msgid "For information on the thread safety of :class:`memoryview` objects in the :term:`free-threaded build`, see :ref:`thread-safety-memoryview`." +msgid "" +"For information on the thread safety of :class:`memoryview` objects in the :term:`free-" +"threaded build`, see :ref:`thread-safety-memoryview`." msgstr "" +"برای اطلاعات درباره ایمنی نخی اشیای :class:`memoryview` در :term:`free-threaded " +"build`، به :ref:`thread-safety-memoryview` مراجعه کنید." msgid "Set Types --- :class:`set`, :class:`frozenset`" -msgstr "" +msgstr "انواع مجموعه‌ای --- :class:`set`، :class:`frozenset`" -msgid "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` objects. Common uses include membership testing, removing duplicates from a sequence, and computing mathematical operations such as intersection, union, difference, and symmetric difference. (For other containers see the built-in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the :mod:`collections` module.)" +msgid "" +"A :dfn:`set` object is an unordered collection of distinct :term:`hashable` objects. " +"Common uses include membership testing, removing duplicates from a sequence, and " +"computing mathematical operations such as intersection, union, difference, and " +"symmetric difference. (For other containers see the built-" +"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and " +"the :mod:`collections` module.)" msgstr "" +"یک شیء :dfn:`set`، مجموعه‌ای بدون ترتیب از اشیای :term:`hashable` متمایز است. " +"استفاده‌های رایج شامل بررسی عضویت، حذف تکراری‌ها از یک دنباله، و محاسبه‌ی عملیات ریاضی " +"مانند اشتراک، اجتماع، تفاضل، و تفاضل متقارن است. (برای سایر ظرف‌ها، کلاس‌های " +"توکار :class:`dict`، :class:`list` و :class:`tuple` و ماژول :mod:`collections` را " +"ببینید.)" -msgid "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x in set``. Being an unordered collection, sets do not record element position or order of insertion. Accordingly, sets do not support indexing, slicing, or other sequence-like behavior." +msgid "" +"Like other collections, sets support ``x in set``, ``len(set)``, and ``for x in " +"set``. Being an unordered collection, sets do not record element position or order of " +"insertion. Accordingly, sets do not support indexing, slicing, or other sequence-like " +"behavior." msgstr "" +"مانند سایر مجموعه‌ها، مجموعه‌ها از ``x in set``، ``len(set)`` و ``for x in set`` " +"پشتیبانی می‌کنند. از آن‌جا که مجموعه‌ها بدون ترتیب هستند، موقعیت عنصر یا ترتیب درج را ثبت " +"نمی‌کنند. بنابراین، مجموعه‌ها از اندیس‌دهی، برش یا سایر رفتارهای مشابه دنباله پشتیبانی " +"نمی‌کنند." -msgid "There are currently two built-in set types, :class:`set` and :class:`frozenset`. The :class:`set` type is mutable --- the contents can be changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since it is mutable, it has no hash value and cannot be used as either a dictionary key or as an element of another set. The :class:`frozenset` type is immutable and :term:`hashable` --- its contents cannot be altered after it is created; it can therefore be used as a dictionary key or as an element of another set." +msgid "" +"There are currently two built-in set types, :class:`set` and :class:`frozenset`. " +"The :class:`set` type is mutable --- the contents can be changed using methods " +"like :meth:`~set.add` and :meth:`~set.remove`. Since it is mutable, it has no hash " +"value and cannot be used as either a dictionary key or as an element of another set. " +"The :class:`frozenset` type is immutable and :term:`hashable` --- its contents cannot " +"be altered after it is created; it can therefore be used as a dictionary key or as an " +"element of another set." msgstr "" +"در حال حاضر دو نوع مجموعه‌ی توکار وجود دارد: :class:`set` و :class:`frozenset`. " +"نوع :class:`set` تغییرپذیر است --- محتوا را می‌توان با متدهایی مانند :meth:`~set.add` " +"و :meth:`~set.remove` تغییر داد. از آن‌جا که این نوع تغییرپذیر است، مقدار هش ندارد و " +"نمی‌توان از آن به‌عنوان کلید دیکشنری یا عنصری از مجموعه‌ای دیگر استفاده کرد. " +"نوع :class:`frozenset` تغییرناپذیر و :term:`hashable` است --- محتوای آن پس از ایجاد " +"تغییر نمی‌کند؛ بنابراین می‌توان از آن به‌عنوان کلید دیکشنری یا عنصری از مجموعه‌ای دیگر " +"استفاده کرد." -msgid "Non-empty sets (not frozensets) can be created by placing a comma-separated list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to the :class:`set` constructor." +msgid "" +"Non-empty sets (not frozensets) can be created by placing a comma-separated list of " +"elements within braces, for example: ``{'jack', 'sjoerd'}``, in addition to " +"the :class:`set` constructor." msgstr "" +"مجموعه‌های غیرخالی (نه frozensetها) را می‌توان با قرار دادن فهرستی از عناصر که با کاما " +"از هم جدا شده‌اند درون آکولاد ایجاد کرد، برای مثال: ``{'jack', 'sjoerd'}``، علاوه بر " +"سازنده‌ی :class:`set`." msgid "The constructors for both classes work the same:" -msgstr "" +msgstr "سازنده‌های هر دو کلاس به یک شکل کار می‌کنند:" -msgid "Return a new set or frozenset object whose elements are taken from *iterable*. The elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set is returned." +msgid "" +"Return a new set or frozenset object whose elements are taken from *iterable*. The " +"elements of a set must be :term:`hashable`. To represent sets of sets, the inner sets " +"must be :class:`frozenset` objects. If *iterable* is not specified, a new empty set " +"is returned." msgstr "" +"یک شیء جدید از نوع set یا frozenset برمی‌گرداند که عناصر آن از *iterable* گرفته شده‌اند. " +"عناصر یک مجموعه باید :term:`hashable` باشند. برای نمایش مجموعه‌هایی از مجموعه‌ها، " +"مجموعه‌های درونی باید اشیای :class:`frozenset` باشند. اگر *iterable* مشخص نشده باشد، یک " +"مجموعه خالی جدید برگردانده می‌شود." msgid "Sets can be created by several means:" -msgstr "" +msgstr "مجموعه‌ها را می‌توان به چند روش ایجاد کرد:" msgid "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" +"از فهرستی از عناصر جداشده با کاما درون آکولاد استفاده کنید: ``{'jack', 'sjoerd'}``" msgid "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" +"از یک درک مجموعه‌ای استفاده کنید: ``{c for c in 'abracadabra' if c not in 'abc'}``" -msgid "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``" +msgid "" +"Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', 'foo'])``" msgstr "" +"از سازنده‌ی نوع استفاده کنید: ``set()``، ``set('foobar')``، ``set(['a', 'b', 'foo'])``" -msgid "Instances of :class:`set` and :class:`frozenset` provide the following operations:" -msgstr "" +msgid "" +"Instances of :class:`set` and :class:`frozenset` provide the following operations:" +msgstr "نمونه‌های :class:`set` و :class:`frozenset` عملیات زیر را فراهم می‌کنند:" msgid "Return the number of elements in set *s* (cardinality of *s*)." -msgstr "" +msgstr "تعداد عناصر مجموعه *s* را برمی‌گرداند (کاردینالیته *s*)." msgid "Test *x* for membership in *s*." -msgstr "" +msgstr "عضویت *x* در *s* را می‌آزماید." msgid "Test *x* for non-membership in *s*." -msgstr "" +msgstr "عضویت نداشتن *x* در *s* را آزمایش می‌کند." -msgid "Return ``True`` if the set has no elements in common with *other*. Sets are disjoint if and only if their intersection is the empty set." +msgid "" +"Return ``True`` if the set has no elements in common with *other*. Sets are disjoint " +"if and only if their intersection is the empty set." msgstr "" +"اگر مجموعه هیچ عنصر مشترکی با *other* نداشته باشد، ``True`` برمی‌گرداند. مجموعه‌ها مجزا " +"هستند اگر و تنها اگر اشتراک آن‌ها مجموعه تهی باشد." msgid "Test whether every element in the set is in *other*." -msgstr "" +msgstr "آزمایش می‌کند که آیا همه‌ی عناصر مجموعه در *other* هستند." -msgid "Test whether the set is a proper subset of *other*, that is, ``set <= other and set != other``." +msgid "" +"Test whether the set is a proper subset of *other*, that is, ``set <= other and set != " +"other``." msgstr "" +"آزمایش می‌کند که آیا مجموعه زیرمجموعه‌ی سره‌ی *other* است، یعنی ``set <= other and set != " +"other``." msgid "Test whether every element in *other* is in the set." -msgstr "" +msgstr "آزمایش می‌کند که آیا همه عناصر *other* در مجموعه وجود دارند یا خیر." -msgid "Test whether the set is a proper superset of *other*, that is, ``set >= other and set != other``." +msgid "" +"Test whether the set is a proper superset of *other*, that is, ``set >= other and set !" +"= other``." msgstr "" +"بررسی می‌کند که آیا مجموعه ابرمجموعه سره‌ای از *other* است یا خیر، یعنی ``set >= other " +"and set != other``." msgid "Return a new set with elements from the set and all others." -msgstr "" +msgstr "یک مجموعه جدید شامل عناصری از مجموعه و همه‌ی سایر موارد برمی‌گرداند." msgid "Return a new set with elements common to the set and all others." msgstr "" +"یک مجموعه جدید برمی‌گرداند که شامل عناصر مشترک بین مجموعه و همه سایر مجموعه‌ها است." msgid "Return a new set with elements in the set that are not in the others." -msgstr "" +msgstr "یک مجموعه جدید شامل عناصری از مجموعه که در سایر موارد نیستند برمی‌گرداند." msgid "Return a new set with elements in either the set or *other* but not both." msgstr "" +"یک مجموعه جدید با عناصری که در مجموعه یا *other* هستند، اما نه در هر دو، برمی‌گرداند." msgid "Return a shallow copy of the set." -msgstr "" +msgstr "یک کپی سطحی از مجموعه برمی‌گرداند." -msgid "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset.symmetric_difference`, :meth:`~frozenset.issubset`, and :meth:`~frozenset.issuperset` methods will accept any iterable as an argument. In contrast, their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more readable ``set('abc').intersection('cbs')``." +msgid "" +"Note, the non-operator versions " +"of :meth:`~frozenset.union`, :meth:`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset.symmetric_difference`, :meth:`~frozenset.issubset`, " +"and :meth:`~frozenset.issuperset` methods will accept any iterable as an argument. In " +"contrast, their operator based counterparts require their arguments to be sets. This " +"precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of the more " +"readable ``set('abc').intersection('cbs')``." msgstr "" +"توجه داشته باشید که نسخه‌های غیرعملگری " +"متدهای :meth:`~frozenset.union`، :meth:`~frozenset.intersection`، :meth:`~frozenset.difference`، :meth:`~frozenset.symmetric_difference`، :meth:`~frozenset.issubset` " +"و :meth:`~frozenset.issuperset` هر پیمایش‌پذیری را به‌عنوان آرگومان می‌پذیرند. در مقابل، " +"نسخه‌های متناظر مبتنی بر عملگر آن‌ها نیاز دارند که آرگومان‌هایشان مجموعه باشند. این امر " +"از عبارت‌های مستعد خطا مانند ``set('abc') & 'cbs'`` جلوگیری می‌کند و شکل خواناتر " +"``set('abc').intersection('cbs')`` را ترجیح می‌دهد." -msgid "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal)." +msgid "" +"Both :class:`set` and :class:`frozenset` support set to set comparisons. Two sets are " +"equal if and only if every element of each set is contained in the other (each is a " +"subset of the other). A set is less than another set if and only if the first set is a " +"proper subset of the second set (is a subset, but is not equal). A set is greater than " +"another set if and only if the first set is a proper superset of the second set (is a " +"superset, but is not equal)." msgstr "" +"هر دو :class:`set` و :class:`frozenset` از مقایسه‌های مجموعه با مجموعه پشتیبانی می‌کنند. " +"دو مجموعه برابرند اگر و فقط اگر هر عنصر هر مجموعه در مجموعه دیگر وجود داشته باشد (هر " +"یک زیرمجموعه‌ای از دیگری باشد). یک مجموعه کوچک‌تر از مجموعه‌ای دیگر است اگر و فقط اگر " +"مجموعه اول زیرمجموعه‌ای سره از مجموعه دوم باشد (زیرمجموعه است، ولی برابر نیست). یک " +"مجموعه بزرگ‌تر از مجموعه‌ای دیگر است اگر و فقط اگر مجموعه اول ابرمجموعه‌ای سره از مجموعه " +"دوم باشد (ابرمجموعه است، ولی برابر نیست)." -msgid "Instances of :class:`set` are compared to instances of :class:`frozenset` based on their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." +msgid "" +"Instances of :class:`set` are compared to instances of :class:`frozenset` based on " +"their members. For example, ``set('abc') == frozenset('abc')`` returns ``True`` and " +"so does ``set('abc') in set([frozenset('abc')])``." msgstr "" +"نمونه‌های :class:`set` با نمونه‌های :class:`frozenset` بر اساس اعضای آن‌ها مقایسه می‌شوند. " +"برای مثال، ``set('abc') == frozenset('abc')`` مقدار ``True`` را برمی‌گرداند و " +"``set('abc') in set([frozenset('abc')])`` نیز همین مقدار را برمی‌گرداند." -msgid "The subset and equality comparisons do not generalize to a total ordering function. For example, any two nonempty disjoint sets are not equal and are not subsets of each other, so *all* of the following return ``False``: ``ab``." +msgid "" +"The subset and equality comparisons do not generalize to a total ordering function. " +"For example, any two nonempty disjoint sets are not equal and are not subsets of each " +"other, so *all* of the following return ``False``: ``ab``." msgstr "" +"مقایسه‌های زیرمجموعه و برابری به یک تابع مرتب‌سازی کامل تعمیم نمی‌یابند. برای مثال، هر دو " +"مجموعه‌ی ناتهی و جدا از هم، برابر نیستند و زیرمجموعه‌ی یکدیگر نیستند، بنابراین *همه‌ی* " +"موارد زیر ``False`` برمی‌گردانند: ``ab``." -msgid "Since sets only define partial ordering (subset relationships), the output of the :meth:`list.sort` method is undefined for lists of sets." +msgid "" +"Since sets only define partial ordering (subset relationships), the output of " +"the :meth:`list.sort` method is undefined for lists of sets." msgstr "" +"از آن‌جا که مجموعه‌ها فقط ترتیب جزئی (روابط زیرمجموعه) را تعریف می‌کنند، خروجی " +"متد :meth:`list.sort` برای فهرست‌هایی از مجموعه‌ها تعریف‌نشده است." msgid "Set elements, like dictionary keys, must be :term:`hashable`." -msgstr "" +msgstr "عناصر مجموعه، مانند کلیدهای دیکشنری، باید :term:`hashable` باشند." -msgid "Binary operations that mix :class:`set` instances with :class:`frozenset` return the type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an instance of :class:`frozenset`." +msgid "" +"Binary operations that mix :class:`set` instances with :class:`frozenset` return the " +"type of the first operand. For example: ``frozenset('ab') | set('bc')`` returns an " +"instance of :class:`frozenset`." msgstr "" +"عملیات دودویی که نمونه‌های :class:`set` را با :class:`frozenset` ترکیب می‌کنند، نوع " +"اولین عملوند را برمی‌گردانند. برای مثال: ``frozenset('ab') | set('bc')`` یک نمونه " +"از :class:`frozenset` برمی‌گرداند." -msgid "The following table lists operations available for :class:`set` that do not apply to immutable instances of :class:`frozenset`:" +msgid "" +"The following table lists operations available for :class:`set` that do not apply to " +"immutable instances of :class:`frozenset`:" msgstr "" +"جدول زیر عملیات در دسترس برای :class:`set` را که بر نمونه‌های " +"تغییرناپذیر :class:`frozenset` اعمال نمی‌شوند، فهرست می‌کند:" msgid "Update the set, adding elements from all others." -msgstr "" +msgstr "مجموعه را به‌روزرسانی می‌کند و عناصر همه‌ی موارد دیگر را اضافه می‌کند." msgid "Update the set, keeping only elements found in it and all others." msgstr "" +"مجموعه را به‌روزرسانی کنید و فقط عناصری را نگه دارید که در آن و در همه‌ی مجموعه‌های دیگر " +"یافت می‌شوند." msgid "Update the set, removing elements found in others." -msgstr "" +msgstr "مجموعه را به‌روزرسانی کنید و عناصری را که در دیگر مجموعه‌ها یافت می‌شوند، حذف کنید." msgid "Update the set, keeping only elements found in either set, but not in both." msgstr "" +"مجموعه را به‌روزرسانی می‌کند و فقط عناصری را نگه می‌دارد که در یکی از دو مجموعه وجود " +"دارند، اما نه در هر دو." msgid "Add element *elem* to the set." -msgstr "" +msgstr "عنصر *elem* را به مجموعه اضافه کنید." -msgid "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not contained in the set." +msgid "" +"Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not contained " +"in the set." msgstr "" +"المان *elem* را از مجموعه حذف می‌کند. اگر *elem* در مجموعه وجود نداشته " +"باشد، :exc:`KeyError` پرتاب می‌شود." msgid "Remove element *elem* from the set if it is present." -msgstr "" +msgstr "در صورت وجود، المان *elem* را از مجموعه حذف کنید." -msgid "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` if the set is empty." +msgid "" +"Remove and return an arbitrary element from the set. Raises :exc:`KeyError` if the " +"set is empty." msgstr "" +"یک عنصر دلخواه را از مجموعه حذف و برمی‌گرداند. اگر مجموعه خالی باشد، :exc:`KeyError` " +"پرتاب می‌شود." msgid "Remove all elements from the set." -msgstr "" +msgstr "تمام عناصر را از مجموعه حذف می‌کند." -msgid "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set.intersection_update`, :meth:`~set.difference_update`, and :meth:`~set.symmetric_difference_update` methods will accept any iterable as an argument." +msgid "" +"Note, the non-operator versions of " +"the :meth:`~set.update`, :meth:`~set.intersection_update`, :meth:`~set.difference_update`, " +"and :meth:`~set.symmetric_difference_update` methods will accept any iterable as an " +"argument." msgstr "" +"توجه داشته باشید که نسخه‌های غیرعملگری " +"متدهای :meth:`~set.update`، :meth:`~set.intersection_update`، :meth:`~set.difference_update` " +"و :meth:`~set.symmetric_difference_update` هر پیمایش‌پذیری را به‌عنوان آرگومان می‌پذیرند." -msgid "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set.remove`, and :meth:`~set.discard` methods may be a set. To support searching for an equivalent frozenset, a temporary one is created from *elem*." +msgid "" +"Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set.remove`, " +"and :meth:`~set.discard` methods may be a set. To support searching for an equivalent " +"frozenset, a temporary one is created from *elem*." msgstr "" +"توجه داشته باشید که آرگومان *elem* در " +"متدهای :meth:`~object.__contains__`، :meth:`~set.remove` و :meth:`~set.discard` " +"می‌تواند یک مجموعه باشد. برای پشتیبانی از جست‌وجوی یک frozenset معادل، یک frozenset موقت " +"از *elem* ایجاد می‌شود." -msgid "For detailed information on thread-safety guarantees for :class:`set` objects, see :ref:`thread-safety-set`." +msgid "" +"For detailed information on thread-safety guarantees for :class:`set` objects, " +"see :ref:`thread-safety-set`." msgstr "" +"برای اطلاعات دقیق درباره تضمین‌های ایمنی نخی برای اشیای :class:`set`، :ref:`thread-" +"safety-set` را ببینید." -msgid "Sets and frozensets are :ref:`generic ` over the type of their elements." +msgid "" +"Sets and frozensets are :ref:`generic ` over the type of their elements." msgstr "" +"مجموعه‌ها و مجموعه‌های فریزشده (frozenset) نسبت به نوع عناصرشان :ref:`عام ` " +"هستند." msgid "Mapping Types --- :class:`dict`" -msgstr "" +msgstr "انواع نگاشت --- :class:`dict`" -msgid "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. Mappings are mutable objects. There is currently only one standard mapping type, the :dfn:`dictionary`. (For other containers see the built-in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` module.)" +msgid "" +"A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. Mappings " +"are mutable objects. There is currently only one standard mapping type, " +"the :dfn:`dictionary`. (For other containers see the built-" +"in :class:`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` " +"module.)" msgstr "" +"یک شیء نگاشت (:term:`نگاشت `)، مقادیر هش‌پذیر (:term:`hashable`) را به اشیاء دلخواه نگاشت می‌کند. نگاشت‌ها اشیاء تغییرپذیر هستند. در حال حاضر تنها یک نوع نگاشت استاندارد وجود دارد: :dfn:`دیکشنری `. (برای سایر ظرف‌ها، کلاس‌های توکار :class:`list`، :class:`set` و :class:`tuple` و ماژول :mod:`collections` را ببینید.)" -msgid "A dictionary's keys are *almost* arbitrary values. Values that are not :term:`hashable`, that is, values containing lists, dictionaries or other mutable types (that are compared by value rather than by object identity) may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, and ``True``) can be used interchangeably to index the same dictionary entry." +msgid "" +"A dictionary's keys are *almost* arbitrary values. Values that are " +"not :term:`hashable`, that is, values containing lists, dictionaries or other mutable " +"types (that are compared by value rather than by object identity) may not be used as " +"keys. Values that compare equal (such as ``1``, ``1.0``, and ``True``) can be used " +"interchangeably to index the same dictionary entry." msgstr "" +"کلیدهای یک دیکشنری *تقریباً* مقادیر دلخواه هستند. مقادیری که :term:`هش‌پذیر ` " +"نیستند، یعنی مقادیری که شامل فهرست‌ها، دیکشنری‌ها یا سایر انواع تغییرپذیر هستند (که بر " +"اساس مقدار مقایسه می‌شوند، نه بر اساس هویت شیء) نمی‌توانند به‌عنوان کلید استفاده شوند. " +"مقادیری که برابر یکدیگر مقایسه می‌شوند (مانند ``1``، ``1.0`` و ``True``) می‌توانند به‌جای " +"یکدیگر برای اندیس‌دهی به یک آیتم دیکشنری استفاده شوند." -msgid "Return a new dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments." +msgid "" +"Return a new dictionary initialized from an optional positional argument and a " +"possibly empty set of keyword arguments." msgstr "" +"یک دیکشنری جدید را برمی‌گرداند که از یک آرگومان جایگاهی اختیاری و مجموعه‌ای از " +"آرگومان‌های کلیدواژه‌ای که ممکن است خالی باشد، مقداردهی اولیه شده است." msgid "Dictionaries can be created by several means:" -msgstr "" +msgstr "دیکشنری‌ها را می‌توان به چند روش ایجاد کرد:" -msgid "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" +msgid "" +"Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': 4098, " +"'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" +"از یک فهرست جداشده با کاما از جفت‌های ``key: value`` درون آکولاد استفاده کنید: " +"``{'jack': 4098, 'sjoerd': 4127}`` یا ``{4098: 'jack', 4127: 'sjoerd'}``" msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" -msgstr "" +msgstr "از یک درک دیکشنری استفاده کنید: ``{}``، ``{x: x ** 2 for x in range(10)}``" -msgid "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', 200)])``, ``dict(foo=100, bar=200)``" +msgid "" +"Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', 200)])``, " +"``dict(foo=100, bar=200)``" msgstr "" +"از سازنده‌ی نوع استفاده کنید: ``dict()``، ``dict([('foo', 100), ('bar', 200)])``، " +"``dict(foo=100, bar=200)``" -msgid "If no positional argument is given, an empty dictionary is created. If a positional argument is given and it defines a ``keys()`` method, a dictionary is created by calling :meth:`~object.__getitem__` on the argument with each returned key from the method. Otherwise, the positional argument must be an :term:`iterable` object. Each item in the iterable must itself be an iterable with exactly two elements. The first element of each item becomes a key in the new dictionary, and the second element the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary." +msgid "" +"If no positional argument is given, an empty dictionary is created. If a positional " +"argument is given and it defines a ``keys()`` method, a dictionary is created by " +"calling :meth:`~object.__getitem__` on the argument with each returned key from the " +"method. Otherwise, the positional argument must be an :term:`iterable` object. Each " +"item in the iterable must itself be an iterable with exactly two elements. The first " +"element of each item becomes a key in the new dictionary, and the second element the " +"corresponding value. If a key occurs more than once, the last value for that key " +"becomes the corresponding value in the new dictionary." msgstr "" +"اگر هیچ آرگومان جایگاهی داده نشود، یک دیکشنری خالی ایجاد می‌شود. اگر یک آرگومان جایگاهی داده شود و آن آرگومان یک متد ``keys()`` را تعریف کرده باشد، یک دیکشنری با فراخوانی :meth:`~object.__getitem__` روی آن آرگومان به‌ازای هر کلید بازگردانده‌شده از آن متد ایجاد می‌شود. در غیر این صورت، آرگومان جایگاهی باید یک شیء :term:`پیمایش‌پذیر ` باشد. هر آیتم در آن پیمایش‌پذیر باید خود یک پیمایش‌پذیر با دقیقاً دو عنصر باشد. عنصر اول هر آیتم به یک کلید در دیکشنری جدید تبدیل می‌شود و عنصر دوم به مقدار متناظر آن تبدیل می‌شود. اگر یک کلید بیش از یک بار تکرار شود، آخرین مقدار برای آن کلید به مقدار متناظر در دیکشنری جدید تبدیل می‌شود." -msgid "If keyword arguments are given, the keyword arguments and their values are added to the dictionary created from the positional argument. If a key being added is already present, the value from the keyword argument replaces the value from the positional argument." +msgid "" +"If keyword arguments are given, the keyword arguments and their values are added to " +"the dictionary created from the positional argument. If a key being added is already " +"present, the value from the keyword argument replaces the value from the positional " +"argument." msgstr "" +"اگر آرگومان‌های کلیدواژه‌ای داده شوند، آرگومان‌های کلیدواژه‌ای و مقدارهای آن‌ها به دیکشنری " +"ایجادشده از آرگومان جایگاهی اضافه می‌شوند. اگر کلیدی که اضافه می‌شود از قبل موجود باشد، " +"مقدار آرگومان کلیدواژه‌ای جایگزین مقدار آرگومان جایگاهی می‌شود." -msgid "Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise :exc:`TypeError`. To illustrate dictionary creation and equality, the following examples all return a dictionary equal to ``{\"one\": 1, \"two\": 2, \"three\": 3}``::" +msgid "" +"Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs " +"(regardless of ordering). Order comparisons ('<', '<=', '>=', '>') " +"raise :exc:`TypeError`. To illustrate dictionary creation and equality, the following " +"examples all return a dictionary equal to ``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" +"دیکشنری‌ها اگر و فقط اگر جفت‌های ``(key, value)`` یکسانی داشته باشند (صرف‌نظر از ترتیب)، " +"در مقایسه برابرند. مقایسه‌های ترتیبی ('<', '<=', '>=', '>') استثنای :exc:`TypeError` را " +"پرتاب می‌کنند. برای نشان دادن ایجاد دیکشنری و برابری، همه‌ی مثال‌های زیر یک دیکشنری برابر " +"با ``{\"one\": 1, \"two\": 2, \"three\": 3}`` برمی‌گردانند::" msgid "" ">>> a = dict(one=1, two=2, three=3)\n" @@ -4081,12 +7606,28 @@ msgid "" ">>> a == b == c == d == e == f\n" "True" msgstr "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" -msgid "Providing keyword arguments as in the first example only works for keys that are valid Python identifiers. Otherwise, any valid keys can be used." +msgid "" +"Providing keyword arguments as in the first example only works for keys that are valid " +"Python identifiers. Otherwise, any valid keys can be used." msgstr "" +"ارائه‌ی آرگومان‌های کلیدواژه‌ای مانند مثال اول، تنها برای کلیدهایی کار می‌کند که شناسه‌های " +"معتبر پایتون باشند. در غیر این صورت، می‌توان از هر کلید معتبری استفاده کرد." -msgid "Dictionaries preserve insertion order. Note that updating a key does not affect the order. Keys added after deletion are inserted at the end. ::" +msgid "" +"Dictionaries preserve insertion order. Note that updating a key does not affect the " +"order. Keys added after deletion are inserted at the end. ::" msgstr "" +"دیکشنری‌ها ترتیب درج را حفظ می‌کنند. توجه داشته باشید که به‌روزرسانی یک کلید بر ترتیب " +"تأثیر نمی‌گذارد. کلیدهایی که پس از حذف اضافه می‌شوند، در انتها درج می‌شوند. ::" msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" @@ -4104,27 +7645,71 @@ msgid "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(d)\n" +"['one', 'two', 'three', 'four']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"one\"] = 42\n" +">>> d\n" +"{'one': 42, 'two': 2, 'three': 3, 'four': 4}\n" +">>> del d[\"two\"]\n" +">>> d[\"two\"] = None\n" +">>> d\n" +"{'one': 42, 'three': 3, 'four': 4, 'two': None}" -msgid "Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6." +msgid "" +"Dictionary order is guaranteed to be insertion order. This behavior was an " +"implementation detail of CPython from 3.6." msgstr "" +"تضمین می‌شود که ترتیب دیکشنری، ترتیب درج باشد. این رفتار از نسخه 3.6، جزئیاتی از " +"پیاده‌سازی CPython بود." -msgid "Dictionaries are :ref:`generic ` over two types, signifying (respectively) the types of the dictionary's keys and values." +msgid "" +"Dictionaries are :ref:`generic ` over two types, signifying (respectively) " +"the types of the dictionary's keys and values." msgstr "" +"دیکشنری‌ها نسبت به دو نوع :ref:`generic ` هستند، که (به‌ترتیب) نشان‌دهنده‌ی انواع " +"کلیدها و مقادیر دیکشنری‌اند." -msgid "These are the operations that dictionaries support (and therefore, custom mapping types should support too):" +msgid "" +"These are the operations that dictionaries support (and therefore, custom mapping " +"types should support too):" msgstr "" +"این‌ها عملیاتی هستند که دیکشنری‌ها از آن‌ها پشتیبانی می‌کنند (و بنابراین، انواع نگاشت " +"سفارشی نیز باید از آن‌ها پشتیبانی کنند):" msgid "Return a list of all the keys used in the dictionary *d*." -msgstr "" +msgstr "فهرستی از تمام کلیدهای استفاده‌شده در دیکشنری *d.* را برمی‌گرداند." msgid "Return the number of items in the dictionary *d*." -msgstr "" +msgstr "تعداد آیتم‌های دیکشنری *d* را برمی‌گرداند." -msgid "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in the map." +msgid "" +"Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is not in " +"the map." msgstr "" +"آیتم *d* با کلید *key* را برمی‌گرداند. اگر *key* در نگاشت نباشد، :exc:`KeyError` را " +"پرتاب می‌کند." -msgid "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* is not present, the ``d[key]`` operation calls that method with the key *key* as argument. The ``d[key]`` operation then returns or raises whatever is returned or raised by the ``__missing__(key)`` call. No other operations or methods invoke :meth:`~object.__missing__`. If :meth:`~object.__missing__` is not defined, :exc:`KeyError` is raised. :meth:`~object.__missing__` must be a method; it cannot be an instance variable::" +msgid "" +"If a subclass of dict defines a method :meth:`~object.__missing__` and *key* is not " +"present, the ``d[key]`` operation calls that method with the key *key* as argument. " +"The ``d[key]`` operation then returns or raises whatever is returned or raised by the " +"``__missing__(key)`` call. No other operations or methods " +"invoke :meth:`~object.__missing__`. If :meth:`~object.__missing__` is not " +"defined, :exc:`KeyError` is raised. :meth:`~object.__missing__` must be a method; it " +"cannot be an instance variable::" msgstr "" +"اگر یک زیرکلاس از dict متد :meth:`~object.__missing__` را تعریف کند و *key* وجود " +"نداشته باشد، عملیات ``d[key]`` آن متد را با کلید *key* به‌عنوان آرگومان فراخوانی می‌کند. " +"سپس عملیات ``d[key]`` هر چیزی را که فراخوانی ``__missing__(key)`` بازگشت می‌دهد یا " +"پرتاب می‌کند، بازگشت می‌دهد یا پرتاب می‌کند. هیچ عملیات یا متد " +"دیگری :meth:`~object.__missing__` را فراخوانی نمی‌کند. اگر :meth:`~object.__missing__` " +"تعریف‌نشده باشد، :exc:`KeyError` پرتاب می‌شود. :meth:`~object.__missing__` باید یک متد " +"باشد؛ نمی‌تواند یک متغیر نمونه باشد::" msgid "" ">>> class Counter(dict):\n" @@ -4138,90 +7723,196 @@ msgid "" ">>> c['red']\n" "1" msgstr "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" -msgid "The example above shows part of the implementation of :class:`collections.Counter`. A different :meth:`!__missing__` method is used by :class:`collections.defaultdict`." +msgid "" +"The example above shows part of the implementation of :class:`collections.Counter`. A " +"different :meth:`!__missing__` method is used by :class:`collections.defaultdict`." msgstr "" +"مثال بالا بخشی از پیاده‌سازی :class:`collections.Counter` را نشان می‌دهد. از یک " +"متد :meth:`!__missing__` متفاوت در :class:`collections.defaultdict` استفاده می‌شود." msgid "Set ``d[key]`` to *value*." -msgstr "" +msgstr "``d[key]`` را برابر *مقدار* قرار دهید." msgid "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the map." msgstr "" +"``d[key]`` را از *d* حذف می‌کند. اگر *key* در نگاشت نباشد، یک :exc:`KeyError` پرتاب " +"می‌شود." msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" +"اگر *d* کلید *key* را داشته باشد، ``True`` برمی‌گرداند، در غیر این صورت ``False``." msgid "Equivalent to ``not key in d``." -msgstr "" +msgstr "معادل ``not key in d`` است." -msgid "Return an iterator over the keys of the dictionary. This is a shortcut for ``iter(d.keys())``." +msgid "" +"Return an iterator over the keys of the dictionary. This is a shortcut for " +"``iter(d.keys())``." msgstr "" +"یک پیمایش‌گر روی کلیدهای دیکشنری برمی‌گرداند. این میان‌بری برای ``iter(d.keys())`` است." msgid "Remove all items from the dictionary." -msgstr "" +msgstr "تمام آیتم‌ها را از دیکشنری حذف می‌کند." msgid "Return a shallow copy of the dictionary." -msgstr "" +msgstr "یک کپی کم‌عمق از دیکشنری برمی‌گرداند." msgid "Create a new dictionary with keys from *iterable* and values set to *value*." -msgstr "" +msgstr "یک دیکشنری جدید با کلیدهایی از *iterable* و مقادیر برابر با *value* ایجاد کنید." -msgid ":meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to ``None``. All of the values refer to just a single instance, so it generally doesn't make sense for *value* to be a mutable object such as an empty list. To get distinct values, use a :ref:`dict comprehension ` instead." +msgid "" +":meth:`fromkeys` is a class method that returns a new dictionary. *value* defaults to " +"``None``. All of the values refer to just a single instance, so it generally doesn't " +"make sense for *value* to be a mutable object such as an empty list. To get distinct " +"values, use a :ref:`dict comprehension ` instead." msgstr "" +":meth:`fromkeys` یک متد کلاس است که یک دیکشنری جدید برمی‌گرداند. *value* به‌طور پیش‌فرض " +"``None`` است. همه‌ی مقدارها فقط به یک نمونه واحد ارجاع می‌دهند، بنابراین معمولاً منطقی " +"ندارد که *value* یک شیء تغییرپذیر مانند یک فهرست خالی باشد. برای به دست آوردن مقدارهای " +"متمایز، به‌جای آن از یک :ref:`درک دیکشنری ` استفاده کنید." -msgid "Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method never raises a :exc:`KeyError`." +msgid "" +"Return the value for *key* if *key* is in the dictionary, else *default*. If *default* " +"is not given, it defaults to ``None``, so that this method never raises " +"a :exc:`KeyError`." msgstr "" +"اگر *key* در دیکشنری وجود داشته باشد، مقدار *key* را برمی‌گرداند؛ در غیر این صورت " +"*default* را برمی‌گرداند. اگر *default* داده نشده باشد، مقدار پیش‌فرض آن ``None`` است، " +"بنابراین این متد هرگز :exc:`KeyError` پرتاب نمی‌کند." -msgid "Return a new view of the dictionary's items (``(key, value)`` pairs). See the :ref:`documentation of view objects `." +msgid "" +"Return a new view of the dictionary's items (``(key, value)`` pairs). See " +"the :ref:`documentation of view objects `." msgstr "" +"یک نمای جدید از آیتم‌های دیکشنری (جفت‌های ``(key, value)``) برمی‌گرداند. به :ref:`مستندات " +"اشیای نما ` مراجعه کنید." -msgid "Return a new view of the dictionary's keys. See the :ref:`documentation of view objects `." +msgid "" +"Return a new view of the dictionary's keys. See the :ref:`documentation of view " +"objects `." msgstr "" +"یک نمای جدید از کلیدهای دیکشنری برمی‌گرداند. :ref:`مستندات اشیای نما ` را " +"ببینید." -msgid "If *key* is in the dictionary, remove it and return its value, else return *default*. If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is raised." +msgid "" +"If *key* is in the dictionary, remove it and return its value, else return *default*. " +"If *default* is not given and *key* is not in the dictionary, a :exc:`KeyError` is " +"raised." msgstr "" +"اگر *key* در دیکشنری باشد، آن را حذف می‌کند و مقدار آن را برمی‌گرداند، در غیر این صورت " +"*default* را برمی‌گرداند. اگر *default* داده نشده باشد و *key* در دیکشنری نباشد، " +"یک :exc:`KeyError` پرتاب می‌شود." -msgid "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned in :abbr:`LIFO (last-in, first-out)` order." +msgid "" +"Remove and return a ``(key, value)`` pair from the dictionary. Pairs are returned " +"in :abbr:`LIFO (last-in, first-out)` order." msgstr "" +"یک جفت ``(key, value)`` را از دیکشنری حذف می‌کند و برمی‌گرداند. جفت‌ها به " +"ترتیب :abbr:`LIFO (last-in, first-out)` برگردانده می‌شوند." -msgid ":meth:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :meth:`popitem` raises a :exc:`KeyError`." +msgid "" +":meth:`popitem` is useful to destructively iterate over a dictionary, as often used in " +"set algorithms. If the dictionary is empty, calling :meth:`popitem` raises " +"a :exc:`KeyError`." msgstr "" +":meth:`popitem` برای پیمایش مخرب یک دیکشنری مفید است، همان‌طور که اغلب در الگوریتم‌های " +"مجموعه استفاده می‌شود. اگر دیکشنری خالی باشد، فراخوانی :meth:`popitem` موجب " +"پرتاب :exc:`KeyError` می‌شود." -msgid "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an arbitrary key/value pair." +msgid "" +"LIFO order is now guaranteed. In prior versions, :meth:`popitem` would return an " +"arbitrary key/value pair." msgstr "" +"ترتیب LIFO اکنون تضمین می‌شود. در نسخه‌های پیشین، :meth:`popitem` یک جفت کلید/مقدار " +"دلخواه را برمی‌گرداند." -msgid "Return a reverse iterator over the keys of the dictionary. This is a shortcut for ``reversed(d.keys())``." +msgid "" +"Return a reverse iterator over the keys of the dictionary. This is a shortcut for " +"``reversed(d.keys())``." msgstr "" +"یک پیمایشگر معکوس روی کلیدهای دیکشنری برمی‌گرداند. این یک میان‌بر برای " +"``reversed(d.keys())`` است." -msgid "If *key* is in the dictionary, return its value. If not, insert *key* with a value of *default* and return *default*. *default* defaults to ``None``." +msgid "" +"If *key* is in the dictionary, return its value. If not, insert *key* with a value of " +"*default* and return *default*. *default* defaults to ``None``." msgstr "" +"اگر *key* در دیکشنری وجود داشته باشد، مقدار آن را برمی‌گرداند. در غیر این صورت، *key* " +"را با مقدار *default* درج می‌کند و *default* را برمی‌گرداند. *default* به‌طور پیش‌فرض " +"``None`` است." -msgid "Update the dictionary with the key/value pairs from *mapping* or *iterable* and *kwargs*, overwriting existing keys. Return ``None``." +msgid "" +"Update the dictionary with the key/value pairs from *mapping* or *iterable* and " +"*kwargs*, overwriting existing keys. Return ``None``." msgstr "" +"دیکشنری را با جفت‌های کلید/مقدار از *نگاشت* یا *پیمایش‌پذیر* و *kwargs* به‌روزرسانی می‌کند " +"و کلیدهای موجود را بازنویسی می‌کند. ``None`` را برمی‌گرداند." -msgid ":meth:`update` accepts either another object with a ``keys()`` method (in which case :meth:`~object.__getitem__` is called with every key returned from the method) or an iterable of key/value pairs (as tuples or other iterables of length two). If keyword arguments are specified, the dictionary is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." +msgid "" +":meth:`update` accepts either another object with a ``keys()`` method (in which " +"case :meth:`~object.__getitem__` is called with every key returned from the method) or " +"an iterable of key/value pairs (as tuples or other iterables of length two). If " +"keyword arguments are specified, the dictionary is then updated with those key/value " +"pairs: ``d.update(red=1, blue=2)``." msgstr "" +":meth:`update` یا شیء دیگری با متد ``keys()`` را می‌پذیرد (که در این " +"صورت :meth:`~object.__getitem__` با هر کلید برگردانده‌شده از آن متد فراخوانی می‌شود) یا " +"یک پیمایش‌پذیر از جفت‌های کلید/مقدار (به‌صورت تاپل‌ها یا پیمایش‌پذیرهای دیگر با طول ۲). اگر " +"آرگومان‌های کلیدواژه‌ای مشخص شده باشند، سپس دیکشنری با آن جفت‌های کلید/مقدار به‌روزرسانی " +"می‌شود: ``d.update(red=1, blue=2)``." -msgid "Return a new view of the dictionary's values. See the :ref:`documentation of view objects `." +msgid "" +"Return a new view of the dictionary's values. See the :ref:`documentation of view " +"objects `." msgstr "" +"یک نمای جدید (view) از مقادیر دیکشنری برمی‌گرداند. به :ref:`مستندات اشیای view ` مراجعه کنید." -msgid "An equality comparison between one ``dict.values()`` view and another will always return ``False``. This also applies when comparing ``dict.values()`` to itself::" +msgid "" +"An equality comparison between one ``dict.values()`` view and another will always " +"return ``False``. This also applies when comparing ``dict.values()`` to itself::" msgstr "" +"مقایسه‌ی برابری میان یک نمای ``dict.values()`` و نمای دیگر، همیشه ``False`` را " +"برمی‌گرداند. این موضوع هنگام مقایسه‌ی ``dict.values()`` با خودش نیز صدق می‌کند::" msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" "False" msgstr "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" -msgid "Create a new dictionary with the merged keys and values of *d* and *other*, which must both be dictionaries. The values of *other* take priority when *d* and *other* share keys." +msgid "" +"Create a new dictionary with the merged keys and values of *d* and *other*, which must " +"both be dictionaries. The values of *other* take priority when *d* and *other* share " +"keys." msgstr "" +"یک دیکشنری جدید با کلیدها و مقدارهای ادغام‌شده‌ی *d* و *other* ایجاد کنید، که هر دو باید " +"دیکشنری باشند. در صورتی که *d* و *other* کلیدهای مشترک داشته باشند، مقدارهای *other* " +"اولویت دارند." -msgid "Update the dictionary *d* with keys and values from *other*, which may be either a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* take priority when *d* and *other* share keys." +msgid "" +"Update the dictionary *d* with keys and values from *other*, which may be either " +"a :term:`mapping` or an :term:`iterable` of key/value pairs. The values of *other* " +"take priority when *d* and *other* share keys." msgstr "" +"دیکشنری *d* را با کلیدها و مقدارهای *other* به‌روزرسانی کنید؛ *other* ممکن است یک :term:`نگاشت ` یا یک :term:`پیمایش‌پذیر ` از جفت‌های کلید/مقدار باشد. هنگامی که *d* و *other* کلیدهای مشترک دارند، مقدارهای *other* اولویت دارند." msgid "Dictionaries and dictionary views are reversible. ::" -msgstr "" +msgstr "دیکشنری‌ها و نماهای دیکشنری معکوس‌پذیر هستند. ::" msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" @@ -4234,57 +7925,127 @@ msgid "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" msgstr "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(reversed(d))\n" +"['four', 'three', 'two', 'one']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" msgid "Dictionaries are now reversible." -msgstr "" +msgstr "دیکشنری‌ها اکنون برگشت‌پذیر هستند." -msgid ":class:`types.MappingProxyType` can be used to create a read-only view of a :class:`dict`." +msgid "" +":class:`types.MappingProxyType` can be used to create a read-only view of " +"a :class:`dict`." msgstr "" +"می‌توان از :class:`types.MappingProxyType` برای ایجاد یک نمای فقط‌خواندنی از " +"یک :class:`dict` استفاده کرد." -msgid "For detailed information on thread-safety guarantees for :class:`dict` objects, see :ref:`thread-safety-dict`." +msgid "" +"For detailed information on thread-safety guarantees for :class:`dict` objects, " +"see :ref:`thread-safety-dict`." msgstr "" +"برای اطلاعات دقیق درباره‌ی تضمین‌های ایمنی نخ برای اشیاء :class:`dict`، به :ref:`thread-" +"safety-dict` مراجعه کنید." msgid "Dictionary view objects" -msgstr "" +msgstr "اشیای نمای دیکشنری" -msgid "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict.items` are *view objects*. They provide a dynamic view on the dictionary's entries, which means that when the dictionary changes, the view reflects these changes." +msgid "" +"The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict.items` " +"are *view objects*. They provide a dynamic view on the dictionary's entries, which " +"means that when the dictionary changes, the view reflects these changes." msgstr "" +"اشیای بازگردانده‌شده توسط :meth:`dict.keys`، :meth:`dict.values` و :meth:`dict.items`، " +"*اشیای نمایشی (view objects)* هستند. این اشیاء یک نمای پویا از ورودی‌های دیکشنری ارائه " +"می‌دهند، به این معنا که وقتی دیکشنری تغییر می‌کند، نما این تغییرات را بازتاب می‌دهد." -msgid "Dictionary views can be iterated over to yield their respective data, and support membership tests:" +msgid "" +"Dictionary views can be iterated over to yield their respective data, and support " +"membership tests:" msgstr "" +"نماهای دیکشنری قابل پیمایش هستند تا داده‌های مربوط به خود را تولید کنند و از آزمون‌های " +"عضویت پشتیبانی می‌کنند:" msgid "Return the number of entries in the dictionary." -msgstr "" +msgstr "تعداد آیتم‌های دیکشنری را برمی‌گرداند." -msgid "Return an iterator over the keys, values or items (represented as tuples of ``(key, value)``) in the dictionary." +msgid "" +"Return an iterator over the keys, values or items (represented as tuples of ``(key, " +"value)``) in the dictionary." msgstr "" +"پیمایش‌گری بر روی کلیدها، مقدارها یا آیتم‌های دیکشنری (که به‌صورت تاپل‌هایی از ``(key, " +"value)`` نمایش داده شده‌اند) برمی‌گرداند." -msgid "Keys and values are iterated over in insertion order. This allows the creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d.values(), d.keys())``. Another way to create the same list is ``pairs = [(v, k) for (k, v) in d.items()]``." +msgid "" +"Keys and values are iterated over in insertion order. This allows the creation of " +"``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d.values(), d.keys())``. " +"Another way to create the same list is ``pairs = [(v, k) for (k, v) in d.items()]``." msgstr "" +"کلیدها و مقادیر به ترتیب درج پیمایش می‌شوند. این امکان، ساخت جفت‌های ``(value, key)`` را " +"با استفاده از :func:`zip` فراهم می‌کند: ``pairs = zip(d.values(), d.keys())``. راه دیگر " +"برای ایجاد همان فهرست، ``pairs = [(v, k) for (k, v) in d.items()]`` است." -msgid "Iterating views while adding or deleting entries in the dictionary may raise a :exc:`RuntimeError` or fail to iterate over all entries." +msgid "" +"Iterating views while adding or deleting entries in the dictionary may raise " +"a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" +"پیمایش نماها هنگام افزودن یا حذف آیتم‌ها در دیکشنری ممکن است :exc:`RuntimeError` پرتاب " +"کند یا موفق به پیمایش همه‌ی آیتم‌ها نشود." msgid "Dictionary order is guaranteed to be insertion order." -msgstr "" +msgstr "ترتیب دیکشنری تضمین می‌شود که ترتیب درج باشد." -msgid "Return ``True`` if *x* is in the underlying dictionary's keys, values or items (in the latter case, *x* should be a ``(key, value)`` tuple)." +msgid "" +"Return ``True`` if *x* is in the underlying dictionary's keys, values or items (in the " +"latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" +"اگر *x* در کلیدها، مقادیر یا آیتم‌های دیکشنری زیربنایی وجود داشته باشد، ``True`` " +"برمی‌گرداند (در مورد اخیر، *x* باید یک تاپل ``(key, value)`` باشد)." -msgid "Return a reverse iterator over the keys, values or items of the dictionary. The view will be iterated in reverse order of the insertion." +msgid "" +"Return a reverse iterator over the keys, values or items of the dictionary. The view " +"will be iterated in reverse order of the insertion." msgstr "" +"یک پیمایش‌گر معکوس روی کلیدها، مقدارها یا آیتم‌های دیکشنری برمی‌گرداند. این نما به ترتیب " +"معکوسِ درج پیمایش می‌شود." msgid "Dictionary views are now reversible." -msgstr "" +msgstr "نماهای دیکشنری اکنون معکوس‌پذیر هستند." -msgid "Return a :class:`types.MappingProxyType` that wraps the original dictionary to which the view refers." +msgid "" +"Return a :class:`types.MappingProxyType` that wraps the original dictionary to which " +"the view refers." msgstr "" +"یک :class:`types.MappingProxyType` برمی‌گرداند که دیکشنری اصلی‌ای را که نما (view) به آن " +"ارجاع می‌دهد، می‌پوشاند." -msgid "Keys views are set-like since their entries are unique and :term:`hashable`. Items views also have set-like operations since the (key, value) pairs are unique and the keys are hashable. If all values in an items view are hashable as well, then the items view can interoperate with other sets. (Values views are not treated as set-like since the entries are generally not unique.) For set-like views, all of the operations defined for the abstract base class :class:`collections.abc.Set` are available (for example, ``==``, ``<``, or ``^``). While using set operators, set-like views accept any iterable as the other operand, unlike sets which only accept sets as the input." +msgid "" +"Keys views are set-like since their entries are unique and :term:`hashable`. Items " +"views also have set-like operations since the (key, value) pairs are unique and the " +"keys are hashable. If all values in an items view are hashable as well, then the items " +"view can interoperate with other sets. (Values views are not treated as set-like since " +"the entries are generally not unique.) For set-like views, all of the operations " +"defined for the abstract base class :class:`collections.abc.Set` are available (for " +"example, ``==``, ``<``, or ``^``). While using set operators, set-like views accept " +"any iterable as the other operand, unlike sets which only accept sets as the input." msgstr "" +"نماهای کلیدها مجموعه‌مانند هستند، زیرا ورودی‌های آن‌ها یکتا و :term:`hashable` هستند. " +"نماهای آیتم‌ها نیز عملیات مجموعه‌مانند دارند، زیرا جفت‌های (کلید، مقدار) یکتا هستند و " +"کلیدها هش‌پذیر هستند. اگر همه مقادیر در یک نمای آیتم‌ها نیز هش‌پذیر باشند، آنگاه نمای " +"آیتم‌ها می‌تواند با سایر مجموعه‌ها تعامل داشته باشد. (نماهای مقادیر به‌عنوان مجموعه‌مانند " +"در نظر گرفته نمی‌شوند، زیرا ورودی‌ها عموماً یکتا نیستند.) برای نماهای مجموعه‌مانند، تمام " +"عملیات تعریف‌شده برای کلاس پایه انتزاعی :class:`collections.abc.Set` در دسترس هستند " +"(برای مثال، ``==``، ``<`` یا ``^``). هنگامی که از عملگرهای مجموعه استفاده می‌کنید، " +"نماهای مجموعه‌مانند هر پیمایش‌پذیری را به‌عنوان عملوند دیگر می‌پذیرند، برخلاف مجموعه‌ها که " +"فقط مجموعه‌ها را به‌عنوان ورودی می‌پذیرند." msgid "An example of dictionary view usage::" -msgstr "" +msgstr "مثالی از استفاده از نمای دیکشنری::" msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" @@ -4325,94 +8086,305 @@ msgid "" ">>> values.mapping['spam']\n" "500" msgstr "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # iteration\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # keys and values are iterated over in the same order (insertion order)\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # view objects are dynamic and reflect dict changes\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # set operations\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # get back a read-only proxy for the original dictionary\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" msgid "Context Manager Types" -msgstr "" +msgstr "انواع مدیر زمینه" -msgid "Python's :keyword:`with` statement supports the concept of a runtime context defined by a context manager. This is implemented using a pair of methods that allow user-defined classes to define a runtime context that is entered before the statement body is executed and exited when the statement ends:" +msgid "" +"Python's :keyword:`with` statement supports the concept of a runtime context defined " +"by a context manager. This is implemented using a pair of methods that allow user-" +"defined classes to define a runtime context that is entered before the statement body " +"is executed and exited when the statement ends:" msgstr "" +"دستور :keyword:`with` پایتون از مفهوم زمینه‌ی ران‌تایم که توسط یک مدیر زمینه تعریف می‌شود، " +"پشتیبانی می‌کند. این امر با استفاده از یک جفت متد پیاده‌سازی شده است که به کلاس‌های " +"تعریف‌شده توسط کاربر اجازه می‌دهند زمینه‌ی ران‌تایمی را تعریف کنند که پیش از اجرای بدنه‌ی " +"دستور وارد آن می‌شود و هنگام پایان دستور از آن خارج می‌شود:" -msgid "Enter the runtime context and return either this object or another object related to the runtime context. The value returned by this method is bound to the identifier in the :keyword:`!as` clause of :keyword:`with` statements using this context manager." +msgid "" +"Enter the runtime context and return either this object or another object related to " +"the runtime context. The value returned by this method is bound to the identifier in " +"the :keyword:`!as` clause of :keyword:`with` statements using this context manager." msgstr "" +"وارد زمینه ران‌تایم می‌شود و این شیء یا شیء دیگری مرتبط با زمینه ران‌تایم را برمی‌گرداند. " +"مقدار برگردانده‌شده توسط این متد، به شناسه‌ی موجود در بند :keyword:`!as` " +"دستورات :keyword:`with` که از این مدیر زمینه استفاده می‌کنند، اختصاص می‌یابد." -msgid "An example of a context manager that returns itself is a :term:`file object`. File objects return themselves from __enter__() to allow :func:`open` to be used as the context expression in a :keyword:`with` statement." +msgid "" +"An example of a context manager that returns itself is a :term:`file object`. File " +"objects return themselves from __enter__() to allow :func:`open` to be used as the " +"context expression in a :keyword:`with` statement." msgstr "" +"نمونه‌ای از یک مدیر زمینه که خود را برمی‌گرداند، یک :term:`file object` است. اشیای فایل " +"خود را از __enter__() برمی‌گردانند تا امکان استفاده از :func:`open` به‌عنوان عبارت زمینه " +"در یک دستور :keyword:`with` فراهم شود." -msgid "An example of a context manager that returns a related object is the one returned by :func:`decimal.localcontext`. These managers set the active decimal context to a copy of the original decimal context and then return the copy. This allows changes to be made to the current decimal context in the body of the :keyword:`with` statement without affecting code outside the :keyword:`!with` statement." +msgid "" +"An example of a context manager that returns a related object is the one returned " +"by :func:`decimal.localcontext`. These managers set the active decimal context to a " +"copy of the original decimal context and then return the copy. This allows changes to " +"be made to the current decimal context in the body of the :keyword:`with` statement " +"without affecting code outside the :keyword:`!with` statement." msgstr "" +"یک نمونه از مدیر زمینه که شیء مرتبطی را برمی‌گرداند، مدیری است که " +"توسط :func:`decimal.localcontext` برگردانده می‌شود. این مدیرهای زمینه، زمینه‌ی decimal " +"فعال را به یک رونوشت از زمینه‌ی decimal اصلی تنظیم می‌کنند و سپس آن رونوشت را " +"برمی‌گردانند. این امر امکان می‌دهد که تغییراتی در زمینه‌ی decimal جاری در بدنه‌ی " +"دستور :keyword:`with` اعمال شود، بدون آنکه کد خارج از دستور :keyword:`!with` تحت تأثیر " +"قرار گیرد." -msgid "Exit the runtime context and return a Boolean flag indicating if any exception that occurred should be suppressed. If an exception occurred while executing the body of the :keyword:`with` statement, the arguments contain the exception type, value and traceback information. Otherwise, all three arguments are ``None``." +msgid "" +"Exit the runtime context and return a Boolean flag indicating if any exception that " +"occurred should be suppressed. If an exception occurred while executing the body of " +"the :keyword:`with` statement, the arguments contain the exception type, value and " +"traceback information. Otherwise, all three arguments are ``None``." msgstr "" +"از زمینه ران‌تایم خارج شوید و یک پرچم بولی برگردانید که نشان دهد آیا هر استثنایی که رخ " +"داده است باید سرکوب شود. اگر هنگام اجرای بدنه دستور :keyword:`with` استثنایی رخ داده " +"باشد، آرگومان‌ها حاوی نوع استثنا، مقدار و اطلاعات ردگیری پشته هستند. در غیر این صورت، " +"هر سه آرگومان ``None`` هستند." -msgid "Returning a true value from this method will cause the :keyword:`with` statement to suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing." +msgid "" +"Returning a true value from this method will cause the :keyword:`with` statement to " +"suppress the exception and continue execution with the statement immediately following " +"the :keyword:`!with` statement. Otherwise the exception continues propagating after " +"this method has finished executing." msgstr "" +"بازگرداندن یک مقدار درست از این متد باعث می‌شود دستور :keyword:`with` استثنا را مهار " +"کند و اجرا را با دستورِ بلافاصله پس از دستور :keyword:`!with` ادامه دهد. در غیر این " +"صورت، پس از پایان اجرای این متد، استثنا به انتشار خود ادامه می‌دهد." -msgid "If this method raises an exception while handling an earlier exception from the :keyword:`with` block, the new exception is raised, and the original exception is stored in its :attr:`~BaseException.__context__` attribute." +msgid "" +"If this method raises an exception while handling an earlier exception from " +"the :keyword:`with` block, the new exception is raised, and the original exception is " +"stored in its :attr:`~BaseException.__context__` attribute." msgstr "" +"اگر این متد هنگام رسیدگی به یک استثنای پیشین از بلوک :keyword:`with`، استثنایی پرتاب " +"کند، استثنای جدید پرتاب می‌شود و استثنای اصلی در " +"ویژگی :attr:`~BaseException.__context__` آن ذخیره می‌شود." -msgid "The exception passed in should never be reraised explicitly - instead, this method should return a false value to indicate that the method completed successfully and does not want to suppress the raised exception. This allows context management code to easily detect whether or not an :meth:`~object.__exit__` method has actually failed." +msgid "" +"The exception passed in should never be reraised explicitly - instead, this method " +"should return a false value to indicate that the method completed successfully and " +"does not want to suppress the raised exception. This allows context management code to " +"easily detect whether or not an :meth:`~object.__exit__` method has actually failed." msgstr "" +"استثنای ورودی هرگز نباید به‌صراحت دوباره پرتاب شود؛ در عوض، این متد باید یک مقدار " +"نادرست برگرداند تا نشان دهد که متد با موفقیت کامل شده است و قصد مهار استثنای پرتاب‌شده " +"را ندارد. این امر به کد مدیریت زمینه اجازه می‌دهد تا به‌راحتی تشخیص دهد که آیا یک " +"متد :meth:`~object.__exit__` واقعاً شکست خورده است یا خیر." -msgid "Python defines several context managers to support easy thread synchronisation, prompt closure of files or other objects, and simpler manipulation of the active decimal arithmetic context. The specific types are not treated specially beyond their implementation of the context management protocol. See the :mod:`contextlib` module for some examples." +msgid "" +"Python defines several context managers to support easy thread synchronisation, prompt " +"closure of files or other objects, and simpler manipulation of the active decimal " +"arithmetic context. The specific types are not treated specially beyond their " +"implementation of the context management protocol. See the :mod:`contextlib` module " +"for some examples." msgstr "" +"پایتون چندین مدیر زمینه را برای پشتیبانی از همگام‌سازی آسان نخ‌ها، بستن به‌موقع فایل‌ها یا " +"اشیاء دیگر، و دستکاری ساده‌تر زمینه‌ی محاسبات اعشاری فعال تعریف می‌کند. این نوع‌های خاص، " +"جدا از پیاده‌سازی پروتکل مدیریت زمینه، رفتار ویژه‌ای ندارند. برای مشاهده‌ی چند نمونه، " +"ماژول :mod:`contextlib` را ببینید." -msgid "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` decorator provide a convenient way to implement these protocols. If a generator function is decorated with the :class:`contextlib.contextmanager` decorator, it will return a context manager implementing the necessary :meth:`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an undecorated generator function." +msgid "" +"Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` decorator " +"provide a convenient way to implement these protocols. If a generator function is " +"decorated with the :class:`contextlib.contextmanager` decorator, it will return a " +"context manager implementing the necessary :meth:`~contextmanager.__enter__` " +"and :meth:`~contextmanager.__exit__` methods, rather than the iterator produced by an " +"undecorated generator function." msgstr "" +"تولیدگرهای پایتون (:term:`تولیدگر `) و دکوراتور :class:`contextlib.contextmanager` راهی مناسب برای پیاده‌سازی این پروتکل‌ها فراهم می‌کنند. اگر یک تابع تولیدگر با دکوراتور :class:`contextlib.contextmanager` آراسته شود، به‌جای پیمایش‌گری که توسط یک تابع تولیدگر آراسته‌نشده تولید می‌شود، مدیر زمینه‌ای برمی‌گرداند که متدهای ضروری :meth:`~contextmanager.__enter__` و :meth:`~contextmanager.__exit__` را پیاده‌سازی می‌کند." -msgid "Note that there is no specific slot for any of these methods in the type structure for Python objects in the Python/C API. Extension types wanting to define these methods must provide them as a normal Python accessible method. Compared to the overhead of setting up the runtime context, the overhead of a single class dictionary lookup is negligible." +msgid "" +"Note that there is no specific slot for any of these methods in the type structure for " +"Python objects in the Python/C API. Extension types wanting to define these methods " +"must provide them as a normal Python accessible method. Compared to the overhead of " +"setting up the runtime context, the overhead of a single class dictionary lookup is " +"negligible." msgstr "" +"توجه داشته باشید که هیچ جایگاه مشخصی برای هیچ‌کدام از این متدها در ساختار نوع اشیاء " +"پایتون در Python/C API وجود ندارد. انواع توسعه‌ای که می‌خواهند این متدها را تعریف کنند، " +"باید آن‌ها را به‌عنوان متدهای معمولی قابل دسترسی از پایتون فراهم کنند. در مقایسه با " +"سربار راه‌اندازی زمینه‌ی ران‌تایم، سربار یک جست‌وجوی تکی در دیکشنری کلاس ناچیز است." -msgid "Type Annotation Types --- :ref:`Generic Alias `, :ref:`Union `" +msgid "" +"Type Annotation Types --- :ref:`Generic Alias `, :ref:`Union " +"`" msgstr "" +"انواع حاشیه‌نویسی نوع --- :ref:`Generic Alias `، :ref:`Union `" -msgid "The core built-in types for :term:`type annotations ` are :ref:`Generic Alias ` and :ref:`Union `." +msgid "" +"The core built-in types for :term:`type annotations ` are :ref:`Generic " +"Alias ` and :ref:`Union `." msgstr "" +"انواع توکار اصلی برای :term:`حاشیه‌نویسی‌های نوع ` عبارتند از :ref:`Generic " +"Alias ` و :ref:`Union `." msgid "Generic Alias Type" -msgstr "" +msgstr "نوع نام مستعار عام" -msgid "``GenericAlias`` objects are generally created by :ref:`subscripting ` a class. They are most often used with :ref:`container classes `, such as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` object created by subscripting the ``list`` class with the argument :class:`int`. ``GenericAlias`` objects are intended primarily for use with :term:`type annotations `." +msgid "" +"``GenericAlias`` objects are generally created by :ref:`subscripting ` " +"a class. They are most often used with :ref:`container classes `, such " +"as :class:`list` or :class:`dict`. For example, ``list[int]`` is a ``GenericAlias`` " +"object created by subscripting the ``list`` class with the argument :class:`int`. " +"``GenericAlias`` objects are intended primarily for use with :term:`type annotations " +"`." msgstr "" +"اشیاء ``GenericAlias`` معمولاً با :ref:`زیرنویسی ` یک کلاس ایجاد " +"می‌شوند. آن‌ها اغلب با :ref:`کلاس‌های محفظه‌ای `، مانند " +":class:`list` یا :class:`dict` استفاده می‌شوند. برای مثال، ``list[int]`` یک شیء " +"``GenericAlias`` است که با زیرنویسی کلاس ``list`` با آرگومان :class:`int` ایجاد " +"می‌شود. اشیاء ``GenericAlias`` عمدتاً برای استفاده با :term:`حاشیه‌نویسی‌های نوع " +"` در نظر گرفته شده‌اند." -msgid "It is generally only possible to subscript a class if the class implements the special method :meth:`~object.__class_getitem__`." +msgid "" +"It is generally only possible to subscript a class if the class implements the special " +"method :meth:`~object.__class_getitem__`." msgstr "" +"به‌طور معمول، تنها در صورتی می‌توان عملیات اندیس‌دهی (subscript) را روی یک کلاس انجام داد " +"که آن کلاس متد ویژه‌ی :meth:`~object.__class_getitem__` را پیاده‌سازی کرده باشد." -msgid "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing *parameterized generics*." +msgid "" +"A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, implementing " +"*parameterized generics*." msgstr "" +"یک شیء ``GenericAlias`` به‌عنوان یک پراکسی برای یک :term:`نوع عام ` عمل " +"می‌کند و *انواع عام پارامتریزه‌شده* را پیاده‌سازی می‌کند." -msgid "For a container class, the argument(s) supplied to a :ref:`subscription ` of the class may indicate the type(s) of the elements an object contains. For example, ``set[bytes]`` can be used in type annotations to signify a :class:`set` in which all the elements are of type :class:`bytes`." +msgid "" +"For a container class, the argument(s) supplied to a :ref:`subscription " +"` of the class may indicate the type(s) of the elements an object " +"contains. For example, ``set[bytes]`` can be used in type annotations to signify " +"a :class:`set` in which all the elements are of type :class:`bytes`." msgstr "" +"برای یک کلاس ظرف (container)، آرگومان(های) ارائه‌شده به :ref:`زیرنویسی ` " +"کلاس ممکن است نوع یا انواع عناصری را که یک شیء شامل می‌شود نشان دهند. برای مثال، می‌توان " +"از ``set[bytes]`` در حاشیه‌نویسی‌های نوع (type annotations) برای نشان دادن " +"یک :class:`set` که تمام عناصر آن از نوع :class:`bytes` هستند استفاده کرد." -msgid "For a class which defines :meth:`~object.__class_getitem__` but is not a container, the argument(s) supplied to a subscription of the class will often indicate the return type(s) of one or more methods defined on an object. For example, :mod:`regular expressions ` can be used on both the :class:`str` data type and the :class:`bytes` data type:" +msgid "" +"For a class which defines :meth:`~object.__class_getitem__` but is not a container, " +"the argument(s) supplied to a subscription of the class will often indicate the return " +"type(s) of one or more methods defined on an object. For example, :mod:`regular " +"expressions ` can be used on both the :class:`str` data type and " +"the :class:`bytes` data type:" msgstr "" +"برای کلاسی که :meth:`~object.__class_getitem__` را تعریف می‌کند اما یک " +"محفظه نیست، آرگومان‌های ارائه‌شده برای زیرنویسی آن کلاس، اغلب نوع یا " +"انواع بازگشتی یک یا چند متد تعریف‌شده برای یک شیء را مشخص می‌کنند. برای " +"مثال، :mod:`عبارت‌های منظم ` را می‌توان هم برای نوع داده‌ی " +":class:`str` و هم برای نوع داده‌ی :class:`bytes` استفاده کرد:" -msgid "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will both be of type :class:`str`. We can represent this kind of object in type annotations with the ``GenericAlias`` ``re.Match[str]``." +msgid "" +"If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` " +"object where the return values of ``x.group(0)`` and ``x[0]`` will both be of " +"type :class:`str`. We can represent this kind of object in type annotations with the " +"``GenericAlias`` ``re.Match[str]``." msgstr "" +"اگر ``x = re.search('foo', 'foo')``، ``x`` یک شیء :ref:`re.Match ` " +"خواهد بود که مقادیر بازگشتی ``x.group(0)`` و ``x[0]`` هر دو از نوع :class:`str` خواهند " +"بود. می‌توانید این نوع شیء را در یادداشت‌های نوع با ``GenericAlias`` ``re.Match[str]`` " +"نشان دهید." -msgid "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), ``y`` will also be an instance of ``re.Match``, but the return values of ``y.group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type annotations, we would represent this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." +msgid "" +"If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), ``y`` will " +"also be an instance of ``re.Match``, but the return values of ``y.group(0)`` and " +"``y[0]`` will both be of type :class:`bytes`. In type annotations, we would represent " +"this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." msgstr "" +"اگر ``y = re.search(b'bar', b'bar')`` (به ``b`` برای :class:`bytes` توجه کنید)، ``y`` " +"نیز نمونه‌ای از ``re.Match`` خواهد بود، اما مقادیر بازگشتی ``y.group(0)`` و ``y[0]`` هر " +"دو از نوع :class:`bytes` خواهند بود. در حاشیه‌نویسی‌های نوع، این تنوع از " +"اشیای :ref:`re.Match ` را با ``re.Match[bytes]`` نمایش می‌دهیم." -msgid "``GenericAlias`` objects are instances of the class :class:`types.GenericAlias`, which can also be used to create ``GenericAlias`` objects directly. Specializations of user-defined :ref:`generic classes ` may not be instances of :class:`types.GenericAlias`, but they provide similar functionality." +msgid "" +"``GenericAlias`` objects are instances of the class :class:`types.GenericAlias`, which " +"can also be used to create ``GenericAlias`` objects directly. Specializations of user-" +"defined :ref:`generic classes ` may not be instances " +"of :class:`types.GenericAlias`, but they provide similar functionality." msgstr "" +"اشیای ``GenericAlias`` نمونه‌هایی از کلاس :class:`types.GenericAlias` هستند که می‌توان " +"از آن برای ساخت اشیای ``GenericAlias`` به‌طور مستقیم نیز استفاده کرد. نسخه‌های " +"تخصصی‌شده‌ی :ref:`کلاس‌های عام ` تعریف‌شده توسط کاربر ممکن است نمونه‌هایی " +"از :class:`types.GenericAlias` نباشند، اما عملکرد مشابهی ارائه می‌دهند." -msgid "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, and more depending on the ``T`` used. For example, a function expecting a :class:`list` containing :class:`float` elements::" +msgid "" +"Creates a ``GenericAlias`` representing a type ``T`` parameterized by types *X*, *Y*, " +"and more depending on the ``T`` used. For example, a function expecting " +"a :class:`list` containing :class:`float` elements::" msgstr "" +"یک ``GenericAlias`` ایجاد می‌کند که نشان‌دهنده‌ی یک نوع ``T`` پارامتریزه‌شده با انواع *X*، " +"*Y* و موارد دیگر، بسته به ``T`` مورد استفاده، است. برای مثال، تابعی که انتظار " +"یک :class:`list` شامل عناصر :class:`float` را دارد::" msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" msgstr "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" -msgid "Another example for :term:`mapping` objects, using a :class:`dict`, which is a generic type expecting two type parameters representing the key type and the value type. In this example, the function expects a ``dict`` with keys of type :class:`str` and values of type :class:`int`::" +msgid "" +"Another example for :term:`mapping` objects, using a :class:`dict`, which is a generic " +"type expecting two type parameters representing the key type and the value type. In " +"this example, the function expects a ``dict`` with keys of type :class:`str` and " +"values of type :class:`int`::" msgstr "" +"مثالی دیگر برای اشیاء :term:`نگاشت `، با استفاده از یک :class:`dict`، که یک نوع عام است و دو پارامتر نوع دارد؛ این پارامترها نوع کلید و نوع مقدار را نشان می‌دهند. در این مثال، تابع یک ``dict`` را با کلیدهایی از نوع :class:`str` و مقادیری از نوع :class:`int` انتظار دارد::" msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." msgstr "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." -msgid "The builtin functions :func:`isinstance` and :func:`issubclass` do not accept ``GenericAlias`` types for their second argument::" +msgid "" +"The builtin functions :func:`isinstance` and :func:`issubclass` do not accept " +"``GenericAlias`` types for their second argument::" msgstr "" +"توابع توکار :func:`isinstance` و :func:`issubclass` انواع ``GenericAlias`` را برای " +"آرگومان دوم خود نمی‌پذیرند::" msgid "" ">>> isinstance([1, 2], list[str])\n" @@ -4420,18 +8392,32 @@ msgid "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance([1, 2], list[str])\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" -msgid "The Python runtime does not enforce :term:`type annotations `. This extends to generic types and their type parameters. When creating a container object from a ``GenericAlias``, the elements in the container are not checked against their type. For example, the following code is discouraged, but will run without errors::" +msgid "" +"The Python runtime does not enforce :term:`type annotations `. This " +"extends to generic types and their type parameters. When creating a container object " +"from a ``GenericAlias``, the elements in the container are not checked against their " +"type. For example, the following code is discouraged, but will run without errors::" msgstr "" +"ران‌تایم پایتون :term:`حاشیه‌نویسی ` را اعمال نمی‌کند. این موضوع شامل انواع عام و پارامترهای نوع آن‌ها نیز می‌شود. هنگام ایجاد یک شیء ظرف از روی یک ``GenericAlias``، عناصر درون ظرف با نوعشان تطبیق داده نمی‌شوند. برای مثال، کد زیر توصیه نمی‌شود، اما بدون خطا اجرا می‌شود::" msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" "[1, 2, 3]" msgstr "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" -msgid "Furthermore, parameterized generics erase type parameters during object creation::" +msgid "" +"Furthermore, parameterized generics erase type parameters during object creation::" msgstr "" +"علاوه بر این، انواع عام پارامتردار، پارامترهای نوع را هنگام ایجاد شیء حذف می‌کنند::" msgid "" ">>> t = list[str]\n" @@ -4442,21 +8428,38 @@ msgid "" ">>> type(l)\n" "" msgstr "" +">>> t = list[str]\n" +">>> type(t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> type(l)\n" +"" -msgid "Instances of ``GenericAlias`` are not classes at runtime, even though they behave like classes (they can be instantiated and subclassed)::" +msgid "" +"Instances of ``GenericAlias`` are not classes at runtime, even though they behave like " +"classes (they can be instantiated and subclassed)::" msgstr "" +"نمونه‌های ``GenericAlias`` در ران‌تایم کلاس نیستند، اگرچه مانند کلاس‌ها رفتار می‌کنند " +"(می‌توان آن‌ها را نمونه‌سازی کرد و از آن‌ها زیرکلاس ساخت)::" msgid "" ">>> import inspect\n" ">>> inspect.isclass(list[int])\n" "False" msgstr "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" msgid "This is true for :ref:`user-defined generics ` also." msgstr "" +"این موضوع برای :ref:`ژنریک‌های تعریف‌شده توسط کاربر ` نیز صادق " +"است." msgid "Calling :func:`repr` or :func:`str` on a generic shows the parameterized type::" msgstr "" +"فراخوانی :func:`repr` یا :func:`str` روی یک نوع عام، نوع پارامتری‌شده را نشان می‌دهد::" msgid "" ">>> repr(list[int])\n" @@ -4465,9 +8468,18 @@ msgid "" ">>> str(list[int])\n" "'list[int]'" msgstr "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" -msgid "The :meth:`~object.__getitem__` method of generic containers will raise an exception to disallow mistakes like ``dict[str][str]``::" +msgid "" +"The :meth:`~object.__getitem__` method of generic containers will raise an exception " +"to disallow mistakes like ``dict[str][str]``::" msgstr "" +"متد :meth:`~object.__getitem__` در ظروف عام، استثنایی پرتاب می‌کند تا از اشتباهاتی " +"مانند ``dict[str][str]`` جلوگیری کند::" msgid "" ">>> dict[str][str]\n" @@ -4475,9 +8487,19 @@ msgid "" " ...\n" "TypeError: dict[str] is not a generic class" msgstr "" +">>> dict[str][str]\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: dict[str] is not a generic class" -msgid "However, such expressions are valid when :ref:`type variables ` are used. The index must have as many elements as there are type variable items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" +msgid "" +"However, such expressions are valid when :ref:`type variables ` are used. " +"The index must have as many elements as there are type variable items in the " +"``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" +"با این حال، چنین عباراتی زمانی معتبر هستند که از :ref:`متغیرهای نوع ` " +"استفاده شود. اندیس باید به تعداد آیتم‌های متغیر نوع موجود " +"در :attr:`~genericalias.__args__` شیء ``GenericAlias``، المان داشته باشد. ::" msgid "" ">>> from typing import TypeVar\n" @@ -4485,205 +8507,225 @@ msgid "" ">>> dict[str, Y][int]\n" "dict[str, int]" msgstr "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" msgid "Standard Generic Classes" -msgstr "" +msgstr "کلاس‌های عام استاندارد" -msgid "The following standard library classes support parameterized generics. This list is non-exhaustive." +msgid "" +"The following standard library classes support parameterized generics. This list is " +"non-exhaustive." msgstr "" +"کلاس‌های کتابخانه‌ی استاندارد زیر از ژنریک‌های پارامتریزه پشتیبانی می‌کنند. این فهرست جامع " +"نیست." msgid ":class:`tuple`" -msgstr "" +msgstr ":class:`tuple`" msgid ":class:`list`" -msgstr "" +msgstr ":class:`list`" msgid ":class:`dict`" -msgstr "" +msgstr ":class:`dict`" msgid ":class:`set`" -msgstr "" +msgstr ":class:`set`" msgid ":class:`frozenset`" -msgstr "" +msgstr ":class:`frozenset`" msgid ":class:`type`" -msgstr "" +msgstr ":class:`type`" msgid ":class:`asyncio.Future`" -msgstr "" +msgstr ":class:`asyncio.Future`" msgid ":class:`asyncio.Task`" -msgstr "" +msgstr ":class:`asyncio.Task`" msgid ":class:`collections.deque`" -msgstr "" +msgstr ":class:`collections.deque`" msgid ":class:`collections.defaultdict`" -msgstr "" +msgstr ":class:`collections.defaultdict`" msgid ":class:`collections.OrderedDict`" -msgstr "" +msgstr ":class:`collections.OrderedDict`" msgid ":class:`collections.Counter`" -msgstr "" +msgstr ":class:`collections.Counter`" msgid ":class:`collections.ChainMap`" -msgstr "" +msgstr ":class:`collections.ChainMap`" msgid ":class:`collections.abc.Awaitable`" -msgstr "" +msgstr ":class:`collections.abc.Awaitable`" msgid ":class:`collections.abc.Coroutine`" -msgstr "" +msgstr ":class:`collections.abc.Coroutine`" msgid ":class:`collections.abc.AsyncIterable`" -msgstr "" +msgstr ":class:`collections.abc.AsyncIterable`" msgid ":class:`collections.abc.AsyncIterator`" -msgstr "" +msgstr ":class:`collections.abc.AsyncIterator`" msgid ":class:`collections.abc.AsyncGenerator`" -msgstr "" +msgstr ":class:`collections.abc.AsyncGenerator`" msgid ":class:`collections.abc.Iterable`" -msgstr "" +msgstr ":class:`collections.abc.Iterable`" msgid ":class:`collections.abc.Iterator`" -msgstr "" +msgstr ":class:`collections.abc.Iterator`" msgid ":class:`collections.abc.Generator`" -msgstr "" +msgstr ":class:`collections.abc.Generator`" msgid ":class:`collections.abc.Reversible`" -msgstr "" +msgstr ":class:`collections.abc.Reversible`" msgid ":class:`collections.abc.Container`" -msgstr "" +msgstr ":class:`collections.abc.Container`" msgid ":class:`collections.abc.Collection`" -msgstr "" +msgstr ":class:`collections.abc.Collection`" msgid ":class:`collections.abc.Callable`" -msgstr "" +msgstr ":class:`collections.abc.Callable`" msgid ":class:`collections.abc.Set`" -msgstr "" +msgstr ":class:`collections.abc.Set`" msgid ":class:`collections.abc.MutableSet`" -msgstr "" +msgstr ":class:`collections.abc.MutableSet`" msgid ":class:`collections.abc.Mapping`" -msgstr "" +msgstr ":class:`collections.abc.Mapping`" msgid ":class:`collections.abc.MutableMapping`" -msgstr "" +msgstr ":class:`collections.abc.MutableMapping`" msgid ":class:`collections.abc.Sequence`" -msgstr "" +msgstr ":class:`collections.abc.Sequence`" msgid ":class:`collections.abc.MutableSequence`" -msgstr "" +msgstr ":class:`collections.abc.MutableSequence`" msgid ":class:`collections.abc.ByteString`" -msgstr "" +msgstr ":class:`collections.abc.ByteString`" msgid ":class:`collections.abc.MappingView`" -msgstr "" +msgstr ":class:`collections.abc.MappingView`" msgid ":class:`collections.abc.KeysView`" -msgstr "" +msgstr ":class:`collections.abc.KeysView`" msgid ":class:`collections.abc.ItemsView`" -msgstr "" +msgstr ":class:`collections.abc.ItemsView`" msgid ":class:`collections.abc.ValuesView`" -msgstr "" +msgstr ":class:`collections.abc.ValuesView`" msgid ":class:`contextlib.AbstractContextManager`" -msgstr "" +msgstr ":class:`contextlib.AbstractContextManager`" msgid ":class:`contextlib.AbstractAsyncContextManager`" -msgstr "" +msgstr ":class:`contextlib.AbstractAsyncContextManager`" msgid ":class:`dataclasses.Field`" -msgstr "" +msgstr ":class:`dataclasses.Field`" msgid ":class:`functools.cached_property`" -msgstr "" +msgstr ":class:`functools.cached_property`" msgid ":class:`functools.partialmethod`" -msgstr "" +msgstr ":class:`functools.partialmethod`" msgid ":class:`os.PathLike`" -msgstr "" +msgstr ":class:`os.PathLike`" msgid ":class:`queue.LifoQueue`" -msgstr "" +msgstr ":class:`queue.LifoQueue`" msgid ":class:`queue.Queue`" -msgstr "" +msgstr ":class:`queue.Queue`" msgid ":class:`queue.PriorityQueue`" -msgstr "" +msgstr ":class:`queue.PriorityQueue`" msgid ":class:`queue.SimpleQueue`" -msgstr "" +msgstr ":class:`queue.SimpleQueue`" msgid ":ref:`re.Pattern `" -msgstr "" +msgstr ":ref:`re.Pattern `" msgid ":ref:`re.Match `" -msgstr "" +msgstr ":ref:`re.Match `" msgid ":class:`shelve.BsdDbShelf`" -msgstr "" +msgstr ":class:`shelve.BsdDbShelf`" msgid ":class:`shelve.DbfilenameShelf`" -msgstr "" +msgstr ":class:`shelve.DbfilenameShelf`" msgid ":class:`shelve.Shelf`" -msgstr "" +msgstr ":class:`shelve.Shelf`" msgid ":class:`types.MappingProxyType`" -msgstr "" +msgstr ":class:`types.MappingProxyType`" msgid ":class:`weakref.WeakKeyDictionary`" -msgstr "" +msgstr ":class:`weakref.WeakKeyDictionary`" msgid ":class:`weakref.WeakMethod`" -msgstr "" +msgstr ":class:`weakref.WeakMethod`" msgid ":class:`weakref.WeakSet`" -msgstr "" +msgstr ":class:`weakref.WeakSet`" msgid ":class:`weakref.WeakValueDictionary`" -msgstr "" +msgstr ":class:`weakref.WeakValueDictionary`" msgid "Special Attributes of ``GenericAlias`` objects" -msgstr "" +msgstr "ویژگی‌های خاص اشیاء ``GenericAlias``" msgid "All parameterized generics implement special read-only attributes." -msgstr "" +msgstr "تمام ژنریک‌های پارامتریزه‌شده، ویژگی‌های فقط‌خواندنی خاصی را پیاده‌سازی می‌کنند." msgid "This attribute points at the non-parameterized generic class::" -msgstr "" +msgstr "این ویژگی به کلاس عام پارامتردهی‌نشده اشاره می‌کند::" msgid "" ">>> list[int].__origin__\n" "" msgstr "" +">>> list[int].__origin__\n" +"" -msgid "This attribute is a :class:`tuple` (possibly of length 1) of generic types passed to the original :meth:`~object.__class_getitem__` of the generic class::" +msgid "" +"This attribute is a :class:`tuple` (possibly of length 1) of generic types passed to " +"the original :meth:`~object.__class_getitem__` of the generic class::" msgstr "" +"این ویژگی یک :class:`tuple` (احتمالاً به طول ۱) از انواع عام است که " +"به :meth:`~object.__class_getitem__` اصلی کلاس عام ارسال شده است::" msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" msgstr "" +">>> dict[str, list[int]].__args__\n" +"(, list[int])" -msgid "This attribute is a lazily computed tuple (possibly empty) of unique type variables found in ``__args__``::" +msgid "" +"This attribute is a lazily computed tuple (possibly empty) of unique type variables " +"found in ``__args__``::" msgstr "" +"این ویژگی یک تاپل محاسبه‌شده به‌صورت تنبل (احتمالاً خالی) از متغیرهای نوع یکتای موجود در " +"``__args__`` است::" msgid "" ">>> from typing import TypeVar\n" @@ -4692,93 +8734,158 @@ msgid "" ">>> list[T].__parameters__\n" "(~T,)" msgstr "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" -msgid "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not have correct ``__parameters__`` after substitution because :class:`typing.ParamSpec` is intended primarily for static type checking." +msgid "" +"A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not have " +"correct ``__parameters__`` after substitution because :class:`typing.ParamSpec` is " +"intended primarily for static type checking." msgstr "" +"یک شیء ``GenericAlias`` با پارامترهای :class:`typing.ParamSpec` ممکن است پس از " +"جایگزینی، ``__parameters__`` صحیحی نداشته باشد، زیرا :class:`typing.ParamSpec` عمدتاً " +"برای بررسی ایستای نوع در نظر گرفته شده است." -msgid "A boolean that is true if the alias has been unpacked using the ``*`` operator (see :data:`~typing.TypeVarTuple`)." +msgid "" +"A boolean that is true if the alias has been unpacked using the ``*`` operator " +"(see :data:`~typing.TypeVarTuple`)." msgstr "" +"یک مقدار بولی که اگر نام مستعار با استفاده از عملگر ``*`` واگشایی شده باشد، True است " +"(به :data:`~typing.TypeVarTuple` مراجعه کنید)." msgid ":pep:`484` - Type Hints" -msgstr "" +msgstr ":pep:`484` - نکات نوع" msgid "Introducing Python's framework for type annotations." -msgstr "" +msgstr "معرفی چارچوب پایتون برای حاشیه‌نویسی‌های نوع (type annotations)." msgid ":pep:`585` - Type Hinting Generics In Standard Collections" -msgstr "" +msgstr ":pep:`585` - راهنمایی نوع برای نوع‌های عام (Generics) در مجموعه‌های استاندارد" -msgid "Introducing the ability to natively parameterize standard-library classes, provided they implement the special class method :meth:`~object.__class_getitem__`." +msgid "" +"Introducing the ability to natively parameterize standard-library classes, provided " +"they implement the special class method :meth:`~object.__class_getitem__`." msgstr "" +"معرفی توانایی پارامتری‌سازی کلاس‌های کتابخانه استاندارد به‌صورت بومی، مشروط بر اینکه متد " +"کلاس ویژه :meth:`~object.__class_getitem__` را پیاده‌سازی کنند." -msgid ":ref:`Generics`, :ref:`user-defined generics ` and :class:`typing.Generic`" +msgid "" +":ref:`Generics`, :ref:`user-defined generics ` " +"and :class:`typing.Generic`" msgstr "" +":ref:`نوع‌های عام `، :ref:`نوع‌های عامِ تعریف‌شده توسط کاربر " +"` و :class:`typing.Generic`" -msgid "Documentation on how to implement generic classes that can be parameterized at runtime and understood by static type-checkers." +msgid "" +"Documentation on how to implement generic classes that can be parameterized at runtime " +"and understood by static type-checkers." msgstr "" +"مستنداتی درباره‌ی نحوه‌ی پیاده‌سازی کلاس‌های عام که می‌توانند در ران‌تایم پارامتریزه شوند و " +"برای بررسی‌کننده‌های نوع ایستا قابل‌درک باشند." msgid "Union Type" -msgstr "" +msgstr "نوع اتحادی (Union Type)" -msgid "A union object holds the value of the ``|`` (bitwise or) operation on multiple :ref:`type objects `. These types are intended primarily for :term:`type annotations `. The union type expression enables cleaner type hinting syntax compared to subscripting :class:`typing.Union`." +msgid "" +"A union object holds the value of the ``|`` (bitwise or) operation on " +"multiple :ref:`type objects `. These types are intended primarily " +"for :term:`type annotations `. The union type expression enables cleaner " +"type hinting syntax compared to subscripting :class:`typing.Union`." msgstr "" +"یک شیء اجتماعی (union)، مقدار حاصل از عملیات ``|`` (یا بیتی) روی چندین :ref:`شیء نوع " +"` را در خود نگه می‌دارد. این نوع‌ها عمدتاً برای :term:`یادداشت‌های " +"نوع ` در نظر گرفته شده‌اند. عبارت نوع اجتماعی (union)، سینتکس تمیزتری برای " +"راهنمایی نوع در مقایسه با اشتراک‌دهی (subscripting) روی :class:`typing.Union` فراهم " +"می‌کند." -msgid "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following function expects an argument of type :class:`int` or :class:`float`::" +msgid "" +"Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` means " +"either X or Y. It is equivalent to ``typing.Union[X, Y]``. For example, the following " +"function expects an argument of type :class:`int` or :class:`float`::" msgstr "" +"یک شیء union تعریف می‌کند که شامل انواع *X*، *Y* و غیره است. ``X | Y`` به معنای X یا Y " +"است. این معادل ``typing.Union[X, Y]`` است. برای مثال، تابع زیر آرگومانی از " +"نوع :class:`int` یا :class:`float` انتظار دارد::" msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" -msgid "The ``|`` operand cannot be used at runtime to define unions where one or more members is a forward reference. For example, ``int | \"Foo\"``, where ``\"Foo\"`` is a reference to a class not yet defined, will fail at runtime. For unions which include forward references, present the whole expression as a string, e.g. ``\"int | Foo\"``." +msgid "" +"The ``|`` operand cannot be used at runtime to define unions where one or more members " +"is a forward reference. For example, ``int | \"Foo\"``, where ``\"Foo\"`` is a " +"reference to a class not yet defined, will fail at runtime. For unions which include " +"forward references, present the whole expression as a string, e.g. ``\"int | Foo\"``." msgstr "" +"نمی‌توان از عملگر ``|`` در ران‌تایم برای تعریف اجتماع‌هایی (unions) که یک یا چند عضو آن‌ها " +"ارجاع به جلو (forward reference) باشد استفاده کرد. برای مثال، ``int | \"Foo\"``، که در " +"آن ``\"Foo\"`` ارجاعی به کلاسی است که هنوز تعریف نشده است، در ران‌تایم با شکست مواجه " +"خواهد شد. برای اجتماع‌هایی که شامل ارجاع‌های به جلو هستند، کل عبارت را به‌صورت یک رشته " +"ارائه دهید، مثلاً ``\"int | Foo\"``." msgid "Union objects can be tested for equality with other union objects. Details:" -msgstr "" +msgstr "می‌توان اشیاء Union را از نظر برابری با سایر اشیاء Union آزمایش کرد. جزئیات:" msgid "Unions of unions are flattened::" -msgstr "" +msgstr "اجتماع‌هایی از اجتماع‌ها مسطح می‌شوند::" msgid "(int | str) | float == int | str | float" -msgstr "" +msgstr "(int | str) | float == int | str | float" msgid "Redundant types are removed::" -msgstr "" +msgstr "نوع‌های اضافی حذف می‌شوند::" msgid "int | str | int == int | str" -msgstr "" +msgstr "int | str | int == int | str" msgid "When comparing unions, the order is ignored::" -msgstr "" +msgstr "هنگام مقایسه‌ی اجتماع‌ها، ترتیب نادیده گرفته می‌شود::" msgid "int | str == str | int" -msgstr "" +msgstr "int | str == str | int" msgid "It creates instances of :class:`typing.Union`::" -msgstr "" +msgstr "این نمونه‌هایی از :class:`typing.Union` ایجاد می‌کند::" msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" msgstr "" +"int | str == typing.Union[int, str]\n" +"type(int | str) is typing.Union" msgid "Optional types can be spelled as a union with ``None``::" -msgstr "" +msgstr "انواع اختیاری را می‌توان به‌صورت یک اجتماع با ``None`` نوشت::" msgid "str | None == typing.Optional[str]" -msgstr "" +msgstr "str | None == typing.Optional[str]" -msgid "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a union object::" +msgid "" +"Calls to :func:`isinstance` and :func:`issubclass` are also supported with a union " +"object::" msgstr "" +"فراخوانی‌های :func:`isinstance` و :func:`issubclass` نیز با یک شیء union پشتیبانی " +"می‌شوند::" msgid "" ">>> isinstance(\"\", int | str)\n" "True" msgstr "" +">>> isinstance(\"\", int | str)\n" +"True" -msgid "However, :ref:`parameterized generics ` in union objects cannot be checked::" +msgid "" +"However, :ref:`parameterized generics ` in union objects cannot be " +"checked::" msgstr "" +"با این حال، :ref:`parameterized generics ` در اشیای union قابل " +"بررسی نیستند::" msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" @@ -4788,9 +8895,19 @@ msgid "" " ...\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" +">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" +"True\n" +">>> isinstance([1], int | list[int])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" -msgid "The user-exposed type for the union object can be accessed from :class:`typing.Union` and used for :func:`isinstance` checks::" +msgid "" +"The user-exposed type for the union object can be accessed from :class:`typing.Union` " +"and used for :func:`isinstance` checks::" msgstr "" +"نوع در معرض دید کاربر برای شیء union، از :class:`typing.Union` قابل دسترسی است و " +"می‌توان از آن برای بررسی‌های :func:`isinstance` استفاده کرد::" msgid "" ">>> import typing\n" @@ -4801,9 +8918,20 @@ msgid "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" msgstr "" +">>> import typing\n" +">>> isinstance(int | str, typing.Union)\n" +"True\n" +">>> typing.Union()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot create 'typing.Union' instances" -msgid "The :meth:`!__or__` method for type objects was added to support the syntax ``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may override it:" +msgid "" +"The :meth:`!__or__` method for type objects was added to support the syntax ``X | " +"Y``. If a metaclass implements :meth:`!__or__`, the Union may override it:" msgstr "" +"متد :meth:`!__or__` برای اشیای نوع افزوده شد تا از سینتکس ``X | Y`` پشتیبانی کند. اگر " +"یک فراکلاس :meth:`!__or__` را پیاده‌سازی کند، ممکن است Union آن را بازنویسی کند:" msgid "" ">>> class M(type):\n" @@ -4818,60 +8946,153 @@ msgid "" ">>> int | C\n" "int | C" msgstr "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." -msgstr "" +msgstr ":pep:`604` -- PEP پیشنهادکننده‌ی نحو ``X | Y`` و نوع Union." -msgid "Union objects are now instances of :class:`typing.Union`. Previously, they were instances of :class:`types.UnionType`, which remains an alias for :class:`typing.Union`." +msgid "" +"Union objects are now instances of :class:`typing.Union`. Previously, they were " +"instances of :class:`types.UnionType`, which remains an alias " +"for :class:`typing.Union`." msgstr "" +"اشیای Union اکنون نمونه‌هایی از :class:`typing.Union` هستند. پیش‌تر، آن‌ها نمونه‌هایی " +"از :class:`types.UnionType` بودند که همچنان نام مستعاری برای :class:`typing.Union` است." msgid "Other Built-in Types" -msgstr "" +msgstr "انواع توکار دیگر" -msgid "The interpreter supports several other kinds of objects. Most of these support only one or two operations." +msgid "" +"The interpreter supports several other kinds of objects. Most of these support only " +"one or two operations." msgstr "" +"مفسر از چندین نوع دیگر از اشیاء پشتیبانی می‌کند. بیشتر این اشیاء فقط از ۱ یا ۲ عملیات " +"پشتیبانی می‌کنند." msgid "Modules" -msgstr "" +msgstr "ماژول‌ها" -msgid "The only special operation on a module is attribute access: ``m.name``, where *m* is a module and *name* accesses a name defined in *m*'s symbol table. Module attributes can be assigned to. (Note that the :keyword:`import` statement is not, strictly speaking, an operation on a module object; ``import foo`` does not require a module object named *foo* to exist, rather it requires an (external) *definition* for a module named *foo* somewhere.)" +msgid "" +"The only special operation on a module is attribute access: ``m.name``, where *m* is a " +"module and *name* accesses a name defined in *m*'s symbol table. Module attributes can " +"be assigned to. (Note that the :keyword:`import` statement is not, strictly speaking, " +"an operation on a module object; ``import foo`` does not require a module object named " +"*foo* to exist, rather it requires an (external) *definition* for a module named *foo* " +"somewhere.)" msgstr "" +"تنها عملیات ویژه بر روی یک ماژول، دسترسی به ویژگی است: ``m.name``، که در آن *m* یک " +"ماژول است و *name* به نامی تعریف‌شده در جدول نمادهای *m* دسترسی می‌یابد. می‌توان به " +"ویژگی‌های ماژول انتساب داد. (توجه داشته باشید که دستور :keyword:`import`، به‌معنای دقیق، " +"یک عملیات بر روی شیء ماژول نیست؛ ``import foo`` نیازی به وجود یک شیء ماژول با نام " +"*foo* ندارد، بلکه به یک *تعریف* (خارجی) برای ماژولی با نام *foo* در جایی نیاز دارد.)" -msgid "A special attribute of every module is :attr:`~object.__dict__`. This is the dictionary containing the module's symbol table. Modifying this dictionary will actually change the module's symbol table, but direct assignment to the :attr:`~object.__dict__` attribute is not possible (you can write ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write ``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not recommended." +msgid "" +"A special attribute of every module is :attr:`~object.__dict__`. This is the " +"dictionary containing the module's symbol table. Modifying this dictionary will " +"actually change the module's symbol table, but direct assignment to " +"the :attr:`~object.__dict__` attribute is not possible (you can write " +"``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write " +"``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not recommended." msgstr "" +"یک ویژگی خاص هر ماژول، :attr:`~object.__dict__` است. این دیکشنری حاوی جدول نمادهای " +"ماژول است. تغییر این دیکشنری در واقع جدول نمادهای ماژول را تغییر می‌دهد، اما انتساب " +"مستقیم به ویژگی :attr:`~object.__dict__` امکان‌پذیر نیست (می‌توانید ``m.__dict__['a'] = " +"1`` را بنویسید، که ``m.a`` را با مقدار ``1`` تعریف می‌کند، اما نمی‌توانید ``m.__dict__ = " +"{}`` را بنویسید). تغییر مستقیم :attr:`~object.__dict__` توصیه نمی‌شود." -msgid "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +msgid "" +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" +"ماژول‌هایی که در مفسر توکار هستند، به این شکل نوشته می‌شوند: ````. اگر از یک فایل بارگذاری شوند، به این شکل نوشته می‌شوند: ````." msgid "Classes and Class Instances" -msgstr "" +msgstr "کلاس‌ها و نمونه‌های کلاس" msgid "See :ref:`objects` and :ref:`class` for these." -msgstr "" +msgstr "برای این موارد، به :ref:`اشیاء ` و :ref:`کلاس ` مراجعه کنید." msgid "Functions" -msgstr "" +msgstr "توابع" -msgid "Function objects are created by function definitions. The only operation on a function object is to call it: ``func(argument-list)``." +msgid "" +"Function objects are created by function definitions. The only operation on a " +"function object is to call it: ``func(argument-list)``." msgstr "" +"اشیای تابع با تعریف تابع ایجاد می‌شوند. تنها عملیات روی یک شیء تابع، فراخوانی آن است: " +"``func(argument-list)``." -msgid "There are really two flavors of function objects: built-in functions and user-defined functions. Both support the same operation (to call the function), but the implementation is different, hence the different object types." +msgid "" +"There are really two flavors of function objects: built-in functions and user-defined " +"functions. Both support the same operation (to call the function), but the " +"implementation is different, hence the different object types." msgstr "" +"در واقع دو گونه از اشیای تابعی وجود دارد: توابع توکار و توابع تعریف‌شده توسط کاربر. هر " +"دو از عملیات یکسانی پشتیبانی می‌کنند (فراخوانی تابع)، اما پیاده‌سازی متفاوت است، از این " +"رو انواع شیء متفاوتی دارند." msgid "See :ref:`function` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر به :ref:`تابع ` مراجعه کنید." msgid "Methods" -msgstr "" +msgstr "متدها" -msgid "Methods are functions that are called using the attribute notation. There are two flavors: :ref:`built-in methods ` (such as :meth:`~list.append` on lists) and :ref:`class instance method `. Built-in methods are described with the types that support them." +msgid "" +"Methods are functions that are called using the attribute notation. There are two " +"flavors: :ref:`built-in methods ` (such as :meth:`~list.append` on " +"lists) and :ref:`class instance method `. Built-in methods are " +"described with the types that support them." msgstr "" +"متدها توابعی هستند که با استفاده از نمادگذاری ویژگی فراخوانی می‌شوند. دو گونه وجود " +"دارد: :ref:`متدهای توکار ` (مانند :meth:`~list.append` در فهرست‌ها) " +"و :ref:`متد نمونه‌ی کلاس `. متدهای توکار همراه با انواعی که از آن‌ها " +"پشتیبانی می‌کنند، توصیف شده‌اند." -msgid "If you access a method (a function defined in a class namespace) through an instance, you get a special object: a :dfn:`bound method` (also called :ref:`instance method `) object. When called, it will add the ``self`` argument to the argument list. Bound methods have two special read-only attributes: :attr:`m.__self__ ` is the object on which the method operates, and :attr:`m.__func__ ` is the function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." +msgid "" +"If you access a method (a function defined in a class namespace) through an instance, " +"you get a special object: a :dfn:`bound method` (also called :ref:`instance method " +"`) object. When called, it will add the ``self`` argument to the " +"argument list. Bound methods have two special read-only attributes: :attr:`m.__self__ " +"` is the object on which the method operates, and :attr:`m.__func__ " +"` is the function implementing the method. Calling ``m(arg-1, " +"arg-2, ..., arg-n)`` is completely equivalent to calling ``m.__func__(m.__self__, " +"arg-1, arg-2, ..., arg-n)``." msgstr "" +"اگر از طریق یک نمونه به یک متد (تابعی که در فضای نام یک کلاس تعریف شده است) دسترسی " +"پیدا کنید، یک شیء خاص دریافت می‌کنید: یک شیء :dfn:`متد مقید ` (bound " +"method) که به آن :ref:`متد نمونه ` نیز گفته می‌شود. هنگام فراخوانی، " +"آرگومان ``self`` را به فهرست آرگومان‌ها اضافه می‌کند. متدهای مقید دو ویژگی فقط‌خواندنی " +"خاص دارند: :attr:`m.__self__ ` شیءای است که متد روی آن عمل می‌کند، " +"و :attr:`m.__func__ ` تابعی است که متد را پیاده‌سازی می‌کند. فراخوانی " +"``m(arg-1, arg-2, ..., arg-n)`` کاملاً معادل فراخوانی ``m.__func__(m.__self__, arg-1, " +"arg-2, ..., arg-n)`` است." -msgid "Like :ref:`function objects `, bound method objects support getting arbitrary attributes. However, since method attributes are actually stored on the underlying function object (:attr:`method.__func__`), setting method attributes on bound methods is disallowed. Attempting to set an attribute on a method results in an :exc:`AttributeError` being raised. In order to set a method attribute, you need to explicitly set it on the underlying function object:" +msgid "" +"Like :ref:`function objects `, bound method objects support " +"getting arbitrary attributes. However, since method attributes are actually stored on " +"the underlying function object (:attr:`method.__func__`), setting method attributes on " +"bound methods is disallowed. Attempting to set an attribute on a method results in " +"an :exc:`AttributeError` being raised. In order to set a method attribute, you need " +"to explicitly set it on the underlying function object:" msgstr "" +"مانند :ref:`اشیای تابع `، اشیای متد مقید از دریافت ویژگی‌های دلخواه " +"پشتیبانی می‌کنند. با این حال، از آنجا که ویژگی‌های متد در واقع روی شیء تابع زیربنایی " +"ذخیره شده‌اند (:attr:`method.__func__`)، تنظیم ویژگی‌های متد روی متدهای مقید مجاز نیست. " +"تلاش برای تنظیم یک ویژگی روی یک متد منجر به پرتاب :exc:`AttributeError` می‌شود. برای " +"تنظیم یک ویژگی متد، باید آن را به‌صراحت روی شیء تابع زیربنایی تنظیم کنید:" msgid "" ">>> class C:\n" @@ -4887,129 +9108,247 @@ msgid "" ">>> c.method.whoami\n" "'my name is method'" msgstr "" +">>> class C:\n" +"... def method(self):\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'my name is method' # can't set on the method\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: 'method' object has no attribute 'whoami'\n" +">>> c.method.__func__.whoami = 'my name is method'\n" +">>> c.method.whoami\n" +"'my name is method'" msgid "See :ref:`instance-methods` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر، :ref:`instance-methods` را ببینید." msgid "Code Objects" -msgstr "" +msgstr "اشیای کد" -msgid "Code objects are used by the implementation to represent \"pseudo-compiled\" executable Python code such as a function body. They differ from function objects because they don't contain a reference to their global execution environment. Code objects are returned by the built-in :func:`compile` function and can be extracted from function objects through their :attr:`~function.__code__` attribute. See also the :mod:`code` module." +msgid "" +"Code objects are used by the implementation to represent \"pseudo-compiled\" " +"executable Python code such as a function body. They differ from function objects " +"because they don't contain a reference to their global execution environment. Code " +"objects are returned by the built-in :func:`compile` function and can be extracted " +"from function objects through their :attr:`~function.__code__` attribute. See also " +"the :mod:`code` module." msgstr "" +"اشیای کد در پیاده‌سازی برای بازنمایی کد پایتون قابل‌اجرای «شبه‌کامپایل‌شده» مانند بدنه‌ی " +"تابع استفاده می‌شوند. آن‌ها با اشیای تابع متفاوت هستند، زیرا ارجاعی به محیط اجرای سراسری " +"خود ندارند. اشیای کد توسط تابع توکار :func:`compile` برگردانده می‌شوند و می‌توان آن‌ها را " +"از اشیای تابع از طریق ویژگی :attr:`~function.__code__` آن‌ها استخراج کرد. همچنین " +"ماژول :mod:`code` را ببینید." -msgid "Accessing :attr:`~function.__code__` raises an :ref:`auditing event ` ``object.__getattr__`` with arguments ``obj`` and ``\"__code__\"``." +msgid "" +"Accessing :attr:`~function.__code__` raises an :ref:`auditing event ` " +"``object.__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" +"دسترسی به :attr:`~function.__code__` یک :ref:`رویداد حسابرسی (auditing event) " +"` ``object.__getattr__`` را با آرگومان‌های ``obj`` و ``\"__code__\"`` پرتاب " +"می‌کند." -msgid "A code object can be executed or evaluated by passing it (instead of a source string) to the :func:`exec` or :func:`eval` built-in functions." +msgid "" +"A code object can be executed or evaluated by passing it (instead of a source string) " +"to the :func:`exec` or :func:`eval` built-in functions." msgstr "" +"می‌توان یک شیء کد را با ارسال آن (به‌جای یک رشته منبع) به توابع توکار :func:`exec` " +"یا :func:`eval` اجرا یا ارزیابی کرد." msgid "See :ref:`types` for more information." -msgstr "" +msgstr "برای اطلاعات بیشتر :ref:`انواع ` را ببینید." msgid "Type Objects" -msgstr "" +msgstr "اشیای نوع" -msgid "Type objects represent the various object types. An object's type is accessed by the built-in function :func:`type`. There are no special operations on types. The standard module :mod:`types` defines names for all standard built-in types." +msgid "" +"Type objects represent the various object types. An object's type is accessed by the " +"built-in function :func:`type`. There are no special operations on types. The " +"standard module :mod:`types` defines names for all standard built-in types." msgstr "" +"اشیاء نوع، انواع مختلف شیء را نشان می‌دهند. نوع یک شیء از طریق تابع توکار :func:`type` " +"قابل دسترسی است. هیچ عملیات خاصی بر انواع وجود ندارد. ماژول استاندارد :mod:`types` " +"نام‌هایی را برای همه انواع توکار استاندارد تعریف می‌کند." msgid "Types are written like this: ````." -msgstr "" +msgstr "نوع‌ها به این شکل نوشته می‌شوند: ````." msgid "The Null Object" -msgstr "" +msgstr "شیء تهی" -msgid "This object is returned by functions that don't explicitly return a value. It supports no special operations. There is exactly one null object, named ``None`` (a built-in name). ``type(None)()`` produces the same singleton." +msgid "" +"This object is returned by functions that don't explicitly return a value. It " +"supports no special operations. There is exactly one null object, named ``None`` (a " +"built-in name). ``type(None)()`` produces the same singleton." msgstr "" +"این شیء توسط تابع‌هایی برگردانده می‌شود که به‌صراحت مقداری را برنمی‌گردانند. این شیء از " +"هیچ عملیات خاصی پشتیبانی نمی‌کند. دقیقاً یک شیء تهی (null) وجود دارد که ``None`` (نامی " +"توکار) نام دارد. ``type(None)()`` همان تک‌نمونه (singleton) را تولید می‌کند." msgid "It is written as ``None``." -msgstr "" +msgstr "به صورت ``None`` نوشته می‌شود." msgid "The Ellipsis Object" -msgstr "" +msgstr "شیء Ellipsis" -msgid "This object is commonly used to indicate that something is omitted. It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton." +msgid "" +"This object is commonly used to indicate that something is omitted. It supports no " +"special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a " +"built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton." msgstr "" +"این شیء معمولاً برای نشان دادن اینکه چیزی حذف شده است، به کار می‌رود. این شیء از هیچ " +"عملیات خاصی پشتیبانی نمی‌کند. دقیقاً یک شیء Ellipsis وجود دارد، به نام :const:`Ellipsis` " +"(یک نام توکار). ``type(Ellipsis)()`` تک‌نمونه‌ی :const:`Ellipsis` را تولید می‌کند." msgid "It is written as ``Ellipsis`` or ``...``." -msgstr "" +msgstr "این به‌صورت ``Ellipsis`` یا ``...`` نوشته می‌شود." -msgid "In typical use, ``...`` as the ``Ellipsis`` object appears in a few different places, for instance:" +msgid "" +"In typical use, ``...`` as the ``Ellipsis`` object appears in a few different places, " +"for instance:" msgstr "" +"در استفاده‌ی معمول، ``...`` به‌عنوان شیء ``Ellipsis`` در چند جای مختلف ظاهر می‌شود، برای " +"مثال:" -msgid "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." +msgid "" +"In type annotations, such as :ref:`callable arguments ` " +"or :ref:`tuple elements `." msgstr "" +"در حاشیه‌نویسی‌های نوع، مانند :ref:`آرگومان‌های فراخوانی‌پذیر ` " +"یا :ref:`عناصر تاپل `." msgid "As the body of a function instead of a :ref:`pass statement `." -msgstr "" +msgstr "به‌عنوان بدنه یک تابع به‌جای :ref:`دستور pass `." -msgid "In third-party libraries, such as `Numpy's slicing and striding `_." +msgid "" +"In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" +"در کتابخانه‌های شخص ثالث، مانند `Numpy's slicing and striding `_." -msgid "Python also uses three dots in ways that are not ``Ellipsis`` objects, for instance:" +msgid "" +"Python also uses three dots in ways that are not ``Ellipsis`` objects, for instance:" msgstr "" +"پایتون همچنین از سه‌نقطه به‌شکل‌هایی استفاده می‌کند که شیء ``Ellipsis`` نیستند، برای مثال:" msgid "Doctest's :const:`ELLIPSIS `, as a pattern for missing content." msgstr "" +":const:`ELLIPSIS ` در Doctest، به‌عنوان الگویی برای محتوای جاافتاده." -msgid "The default Python prompt of the :term:`interactive` shell when partial input is incomplete." +msgid "" +"The default Python prompt of the :term:`interactive` shell when partial input is " +"incomplete." msgstr "" +"اعلان پیش‌فرض پایتون در پوسته‌ی :term:`interactive` هنگامی که ورودی جزئی کامل نیست." -msgid "Lastly, the Python documentation often uses three dots in conventional English usage to mean omitted content, even in code examples that also use them as the ``Ellipsis``." +msgid "" +"Lastly, the Python documentation often uses three dots in conventional English usage " +"to mean omitted content, even in code examples that also use them as the ``Ellipsis``." msgstr "" +"در نهایت، مستندات پایتون اغلب در کاربرد رایج انگلیسی از سه‌نقطه برای نشان دادن محتوای " +"حذف‌شده استفاده می‌کند، حتی در مثال‌های کدی که از آن‌ها به‌عنوان ``Ellipsis`` نیز استفاده " +"می‌شود." msgid "The NotImplemented Object" -msgstr "" +msgstr "شیء NotImplemented" -msgid "This object is returned from comparisons and binary operations when they are asked to operate on types they don't support. See :ref:`comparisons` for more information. There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` produces the singleton instance." +msgid "" +"This object is returned from comparisons and binary operations when they are asked to " +"operate on types they don't support. See :ref:`comparisons` for more information. " +"There is exactly one :data:`NotImplemented` object. :code:`type(NotImplemented)()` " +"produces the singleton instance." msgstr "" +"این شیء از مقایسه‌ها و عملیات دودویی بازگردانده می‌شود، وقتی از آن‌ها خواسته می‌شود روی انواعی که پشتیبانی نمی‌کنند عمل کنند. برای اطلاعات بیشتر :ref:`مقایسه‌ها ` را ببینید. دقیقاً یک شیء :data:`NotImplemented` وجود دارد. :code:`type(NotImplemented)()` تک‌نمونه (singleton) را تولید می‌کند." msgid "It is written as :code:`NotImplemented`." -msgstr "" +msgstr "این به‌صورت :code:`NotImplemented` نوشته می‌شود." msgid "Internal Objects" -msgstr "" +msgstr "اشیاء داخلی" -msgid "See :ref:`types` for this information. It describes :ref:`stack frame objects `, :ref:`traceback objects `, and slice objects." +msgid "" +"See :ref:`types` for this information. It describes :ref:`stack frame objects `, :ref:`traceback objects `, and slice objects." msgstr "" +"برای این اطلاعات :ref:`انواع ` را ببینید. این بخش :ref:`اشیای فریم پشته (stack frame) `، :ref:`اشیای ردگیری پشته ` و اشیای برش (slice) را توصیف می‌کند." msgid "Special Attributes" -msgstr "" +msgstr "ویژگی‌های خاص" -msgid "The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported by the :func:`dir` built-in function." +msgid "" +"The implementation adds a few special read-only attributes to several object types, " +"where they are relevant. Some of these are not reported by the :func:`dir` built-in " +"function." msgstr "" +"پیاده‌سازی، در موارد مرتبط، چند ویژگی خاص فقط‌خواندنی را به چندین نوع شیء اضافه می‌کند. " +"برخی از این موارد توسط تابع توکار :func:`dir` گزارش نمی‌شوند." msgid "The name of the class, function, method, descriptor, or generator instance." -msgstr "" +msgstr "نام کلاس، تابع، متد، توصیف‌گر (descriptor) یا نمونه‌ی تولیدگر." -msgid "The :term:`qualified name` of the class, function, method, descriptor, or generator instance." -msgstr "" +msgid "" +"The :term:`qualified name` of the class, function, method, descriptor, or generator " +"instance." +msgstr ":term:`qualified name` کلاس، تابع، متد، توصیف‌گر یا نمونه‌ی تولیدگر." msgid "The name of the module in which a class or function was defined." -msgstr "" +msgstr "نام ماژولی که کلاس یا تابعی در آن تعریف شده است." msgid "The documentation string of a class or function, or ``None`` if undefined." -msgstr "" +msgstr "رشته‌ی مستندسازی یک کلاس یا تابع، یا ``None`` در صورت تعریف‌نشده بودن." -msgid "The :ref:`type parameters ` of generic classes, functions, and :ref:`type aliases `. For classes and functions that are not generic, this will be an empty tuple." +msgid "" +"The :ref:`type parameters ` of generic classes, functions, and :ref:`type " +"aliases `. For classes and functions that are not generic, this will be " +"an empty tuple." msgstr "" +":ref:`پارامترهای نوع ` کلاس‌ها، توابع و :ref:`نام‌مستعارهای نوع ` عام. برای کلاس‌ها و توابعی که عام نیستند، این یک تاپل خالی خواهد بود." msgid "Integer string conversion length limitation" -msgstr "" +msgstr "محدودیت طول تبدیل عدد صحیح به رشته" -msgid "CPython has a global limit for converting between :class:`int` and :class:`str` to mitigate denial of service attacks. This limit *only* applies to decimal or other non-power-of-two number bases. Hexadecimal, octal, and binary conversions are unlimited. The limit can be configured." +msgid "" +"CPython has a global limit for converting between :class:`int` and :class:`str` to " +"mitigate denial of service attacks. This limit *only* applies to decimal or other non-" +"power-of-two number bases. Hexadecimal, octal, and binary conversions are unlimited. " +"The limit can be configured." msgstr "" +"CPython یک محدودیت سراسری برای تبدیل بین :class:`int` و :class:`str` برای کاهش اثر " +"حملات منع سرویس دارد. این محدودیت *فقط* در مورد مبنای ده یا سایر مبناهای عددی غیر از " +"توان ۲ اعمال می‌شود. تبدیل‌های مبنای شانزده، مبنای هشت و مبنای دو نامحدود هستند. این " +"محدودیت قابل پیکربندی است." -msgid "The :class:`int` type in CPython is an arbitrary length number stored in binary form (commonly known as a \"bignum\"). There exists no algorithm that can convert a string to a binary integer or a binary integer to a string in linear time, *unless* the base is a power of 2. Even the best known algorithms for base 10 have sub-quadratic complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." +msgid "" +"The :class:`int` type in CPython is an arbitrary length number stored in binary form " +"(commonly known as a \"bignum\"). There exists no algorithm that can convert a string " +"to a binary integer or a binary integer to a string in linear time, *unless* the base " +"is a power of 2. Even the best known algorithms for base 10 have sub-quadratic " +"complexity. Converting a large value such as ``int('1' * 500_000)`` can take over a " +"second on a fast CPU." msgstr "" +"نوع :class:`int` در CPython عددی با طول دلخواه است که به صورت دودویی ذخیره می‌شود (و " +"معمولاً با نام «bignum» شناخته می‌شود). هیچ الگوریتمی وجود ندارد که بتواند یک رشته را به " +"یک عدد صحیح دودویی یا یک عدد صحیح دودویی را به یک رشته در زمان خطی تبدیل کند، *مگر " +"اینکه* پایه توانی از ۲ باشد. حتی بهترین الگوریتم‌های شناخته‌شده برای پایه‌ی ۱۰ نیز " +"پیچیدگی کمتر از درجه‌ی دو دارند. تبدیل یک مقدار بزرگ مانند ``int('1' * 500_000)`` " +"می‌تواند بیش از یک ثانیه روی یک پردازنده سریع زمان ببرد." msgid "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." -msgstr "" +msgstr "محدود کردن اندازه‌ی تبدیل، راهی عملی برای اجتناب از :cve:`2020-10735` فراهم می‌کند." -msgid "The limit is applied to the number of digit characters in the input or output string when a non-linear conversion algorithm would be involved. Underscores and the sign are not counted towards the limit." +msgid "" +"The limit is applied to the number of digit characters in the input or output string " +"when a non-linear conversion algorithm would be involved. Underscores and the sign " +"are not counted towards the limit." msgstr "" +"این محدودیت زمانی به تعداد نویسه‌های رقمی در رشته ورودی یا خروجی اعمال می‌شود که یک " +"الگوریتم تبدیل غیرخطی دخیل باشد. زیرخط‌ها و علامت، در این محدودیت به‌حساب نمی‌آیند." msgid "When an operation would exceed the limit, a :exc:`ValueError` is raised:" -msgstr "" +msgstr "هنگامی که یک عملیات از حد مجاز فراتر رود، :exc:`ValueError` پرتاب می‌شود:" msgid "" ">>> import sys\n" @@ -5017,7 +9356,8 @@ msgid "" ">>> _ = int('2' * 5432)\n" "Traceback (most recent call last):\n" "...\n" -"ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has " +"5432 digits; use sys.set_int_max_str_digits() to increase the limit\n" ">>> i = int('2' * 4300)\n" ">>> len(str(i))\n" "4300\n" @@ -5025,17 +9365,45 @@ msgid "" ">>> len(str(i_squared))\n" "Traceback (most recent call last):\n" "...\n" -"ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; use " +"sys.set_int_max_str_digits() to increase the limit\n" ">>> len(hex(i_squared))\n" "7144\n" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" +">>> import sys\n" +">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has " +"5432 digits; use sys.set_int_max_str_digits() to increase the limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; use " +"sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." -msgid "The default limit is 4300 digits as provided in :data:`sys.int_info.default_max_str_digits `. The lowest limit that can be configured is 640 digits as provided in :data:`sys.int_info.str_digits_check_threshold `." +msgid "" +"The default limit is 4300 digits as provided " +"in :data:`sys.int_info.default_max_str_digits `. The lowest limit that " +"can be configured is 640 digits as provided " +"in :data:`sys.int_info.str_digits_check_threshold `." msgstr "" +"محدودیت پیش‌فرض ۴۳۰۰ رقم است، همان‌طور که در :data:`sys.int_info.default_max_str_digits " +"` ارائه شده است. کمترین محدودیتی که می‌توان آن را پیکربندی کرد، ۶۴۰ رقم " +"است، همان‌طور که در :data:`sys.int_info.str_digits_check_threshold ` " +"ارائه شده است." msgid "Verification:" -msgstr "" +msgstr "تأیید:" msgid "" ">>> import sys\n" @@ -5046,93 +9414,175 @@ msgid "" "... '571186405732').to_bytes(53, 'big')\n" "..." msgstr "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." msgid "Affected APIs" -msgstr "" +msgstr "APIهای تحت‌تأثیر" -msgid "The limitation only applies to potentially slow conversions between :class:`int` and :class:`str` or :class:`bytes`:" +msgid "" +"The limitation only applies to potentially slow conversions between :class:`int` " +"and :class:`str` or :class:`bytes`:" msgstr "" +"این محدودیت فقط به تبدیل‌های بالقوه کند بین :class:`int` و :class:`str` " +"یا :class:`bytes` اعمال می‌شود:" msgid "``int(string)`` with default base 10." -msgstr "" +msgstr "``int(string)`` با مبنای پیش‌فرض ۱۰." msgid "``int(string, base)`` for all bases that are not a power of 2." -msgstr "" +msgstr "``int(string, base)`` برای همه مبناهایی که توانی از ۲ نیستند." msgid "``str(integer)``." -msgstr "" +msgstr "``str(integer)``." msgid "``repr(integer)``." -msgstr "" +msgstr "``repr(integer)``." -msgid "any other string conversion to base 10, for example ``f\"{integer}\"``, ``\"{}\".format(integer)``, or ``b\"%d\" % integer``." +msgid "" +"any other string conversion to base 10, for example ``f\"{integer}\"``, ``\"{}" +"\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" +"هر تبدیل دیگری به رشته در مبنای ۱۰، برای مثال ``f\"{integer}\"``، ``\"{}" +"\".format(integer)`` یا ``b\"%d\" % integer``." msgid "The limitations do not apply to functions with a linear algorithm:" -msgstr "" +msgstr "این محدودیت‌ها شامل توابعی با الگوریتم خطی نمی‌شوند:" msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." -msgstr "" +msgstr "``int(string, base)`` با مبنای ۲، ۴، ۸، ۱۶ یا ۳۲." msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." -msgstr "" +msgstr ":func:`int.from_bytes` و :func:`int.to_bytes`." msgid ":func:`hex`, :func:`oct`, :func:`bin`." -msgstr "" +msgstr ":func:`hex`, :func:`oct`, :func:`bin`." msgid ":ref:`formatspec` for hex, octal, and binary numbers." -msgstr "" +msgstr ":ref:`formatspec` برای اعداد مبنای شانزده، مبنای هشت و مبنای دو." msgid ":class:`str` to :class:`float`." -msgstr "" +msgstr ":class:`str` به :class:`float`." msgid ":class:`str` to :class:`decimal.Decimal`." -msgstr "" +msgstr ":class:`str` به :class:`decimal.Decimal`." msgid "Configuring the limit" -msgstr "" +msgstr "پیکربندی محدودیت" -msgid "Before Python starts up you can use an environment variable or an interpreter command line flag to configure the limit:" +msgid "" +"Before Python starts up you can use an environment variable or an interpreter command " +"line flag to configure the limit:" msgstr "" +"پیش از راه‌اندازی پایتون می‌توانید از یک متغیر محیطی یا پرچم خط فرمان مفسر برای پیکربندی " +"محدودیت استفاده کنید:" -msgid ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation." +msgid "" +":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the " +"limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation." msgstr "" +":envvar:`PYTHONINTMAXSTRDIGITS`، برای مثال ``PYTHONINTMAXSTRDIGITS=640 python3`` برای " +"تنظیم حد روی ۶۴۰ یا ``PYTHONINTMAXSTRDIGITS=0 python3`` برای غیرفعال کردن محدودیت." msgid ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X int_max_str_digits=640``" msgstr "" +":option:`-X int_max_str_digits <-X>`، برای مثال ``python3 -X int_max_str_digits=640``" -msgid ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the env var and the ``-X`` option are set, the ``-X`` option takes precedence. A value of *-1* indicates that both were unset, thus a value of :data:`sys.int_info.default_max_str_digits` was used during initialization." +msgid "" +":data:`sys.flags.int_max_str_digits` contains the value " +"of :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both " +"the env var and the ``-X`` option are set, the ``-X`` option takes precedence. A value " +"of *-1* indicates that both were unset, thus a value " +"of :data:`sys.int_info.default_max_str_digits` was used during initialization." msgstr "" +":data:`sys.flags.int_max_str_digits` شامل مقدار :envvar:`PYTHONINTMAXSTRDIGITS` " +"یا :option:`-X int_max_str_digits <-X>` است. اگر هر دو متغیر محیطی و گزینه ``-X`` " +"تنظیم شده باشند، گزینه ``-X`` اولویت دارد. مقدار *-1* نشان می‌دهد که هر دو تنظیم‌نشده " +"بودند، بنابراین مقدار :data:`sys.int_info.default_max_str_digits` در هنگام مقداردهی " +"اولیه استفاده شده است." -msgid "From code, you can inspect the current limit and set a new one using these :mod:`sys` APIs:" +msgid "" +"From code, you can inspect the current limit and set a new one using these :mod:`sys` " +"APIs:" msgstr "" +"از طریق کد، می‌توانید محدودیت فعلی را بررسی کنید و با استفاده از این APIهای :mod:`sys` " +"محدودیت جدیدی تنظیم کنید:" -msgid ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` are a getter and setter for the interpreter-wide limit. Subinterpreters have their own limit." +msgid "" +":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` are a getter " +"and setter for the interpreter-wide limit. Subinterpreters have their own limit." msgstr "" +":func:`sys.get_int_max_str_digits` و :func:`sys.set_int_max_str_digits` دریافت‌کننده " +"(getter) و تنظیم‌کننده (setter) برای محدودیت سراسری مفسر هستند. زیرمفسرها محدودیت " +"خودشان را دارند." msgid "Information about the default and minimum can be found in :data:`sys.int_info`:" -msgstr "" +msgstr "اطلاعات درباره مقدار پیش‌فرض و کمینه را می‌توان در :data:`sys.int_info` یافت:" -msgid ":data:`sys.int_info.default_max_str_digits ` is the compiled-in default limit." +msgid "" +":data:`sys.int_info.default_max_str_digits ` is the compiled-in default " +"limit." msgstr "" +":data:`sys.int_info.default_max_str_digits ` محدودیت پیش‌فرض درون‌ساخته " +"(compiled-in) است." -msgid ":data:`sys.int_info.str_digits_check_threshold ` is the lowest accepted value for the limit (other than 0 which disables it)." +msgid "" +":data:`sys.int_info.str_digits_check_threshold ` is the lowest accepted " +"value for the limit (other than 0 which disables it)." msgstr "" +":data:`sys.int_info.str_digits_check_threshold ` کمترین مقدار پذیرفته‌شده " +"برای محدودیت است (به‌جز ۰ که آن را غیرفعال می‌کند)." -msgid "Setting a low limit *can* lead to problems. While rare, code exists that contains integer constants in decimal in their source that exceed the minimum threshold. A consequence of setting the limit is that Python source code containing decimal integer literals longer than the limit will encounter an error during parsing, usually at startup time or import time or even at installation time - anytime an up to date ``.pyc`` does not already exist for the code. A workaround for source that contains such large constants is to convert them to ``0x`` hexadecimal form as it has no limit." +msgid "" +"Setting a low limit *can* lead to problems. While rare, code exists that contains " +"integer constants in decimal in their source that exceed the minimum threshold. A " +"consequence of setting the limit is that Python source code containing decimal integer " +"literals longer than the limit will encounter an error during parsing, usually at " +"startup time or import time or even at installation time - anytime an up to date " +"``.pyc`` does not already exist for the code. A workaround for source that contains " +"such large constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" +"تنظیم یک حد پایین *می‌تواند* منجر به مشکلاتی شود. اگرچه نادر است، اما کدهایی وجود دارند " +"که در کد منبع خود ثابت‌های عدد صحیح به مبنای ده دارند که از حداقل آستانه بیشترند. پیامد " +"تنظیم این حد آن است که کد منبع پایتون حاوی مقادیر لفظی عدد صحیح مبنای ده طولانی‌تر از حد، " +"هنگام تجزیه با خطایی مواجه می‌شود؛ معمولاً در زمان راه‌اندازی، زمان ایمپورت یا حتی زمان " +"نصب — هر زمان که یک ``.pyc`` به‌روز برای آن کد از قبل وجود نداشته باشد. راه‌حلی برای کد " +"منبعی که شامل چنین ثابت‌های بزرگی است، تبدیل آن‌ها به قالب ``0x`` مبنای شانزده است، زیرا " +"این قالب حدی ندارد." -msgid "Test your application thoroughly if you use a low limit. Ensure your tests run with the limit set early via the environment or flag so that it applies during startup and even during any installation step that may invoke Python to precompile ``.py`` sources to ``.pyc`` files." +msgid "" +"Test your application thoroughly if you use a low limit. Ensure your tests run with " +"the limit set early via the environment or flag so that it applies during startup and " +"even during any installation step that may invoke Python to precompile ``.py`` sources " +"to ``.pyc`` files." msgstr "" +"اگر از یک محدودیت پایین استفاده می‌کنید، برنامه‌تان را به‌طور کامل آزمایش کنید. اطمینان " +"حاصل کنید که آزمون‌های شما با محدودیتی اجرا می‌شوند که از طریق محیط یا پرچم از پیش تنظیم " +"شده است، تا این محدودیت در هنگام راه‌اندازی و حتی در هر مرحله‌ی نصبی که ممکن است پایتون " +"را برای پیش‌کامپایل کردن فایل‌های منبع ``.py`` به فایل‌های ``.pyc`` فراخوانی کند، اعمال " +"شود." msgid "Recommended configuration" -msgstr "" +msgstr "پیکربندی توصیه‌شده" -msgid "The default :data:`sys.int_info.default_max_str_digits` is expected to be reasonable for most applications. If your application requires a different limit, set it from your main entry point using Python version agnostic code as these APIs were added in security patch releases in versions before 3.12." +msgid "" +"The default :data:`sys.int_info.default_max_str_digits` is expected to be reasonable " +"for most applications. If your application requires a different limit, set it from " +"your main entry point using Python version agnostic code as these APIs were added in " +"security patch releases in versions before 3.12." msgstr "" +"انتظار می‌رود مقدار پیش‌فرض :data:`sys.int_info.default_max_str_digits` برای بیشتر " +"برنامه‌ها معقول باشد. اگر برنامه شما به محدودیت متفاوتی نیاز دارد، آن را از نقطه ورود " +"اصلی خود با استفاده از کد مستقل از نسخه پایتون تنظیم کنید، زیرا این APIها در انتشارهای " +"وصله امنیتی در نسخه‌های پیش از 3.12 اضافه شده‌اند." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> import sys\n" @@ -5145,564 +9595,589 @@ msgid "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" msgid "If you need to disable it entirely, set it to ``0``." -msgstr "" +msgstr "اگر لازم است آن را به‌طور کامل غیرفعال کنید، آن را روی ``0`` تنظیم کنید." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "Additional information on these special methods may be found in the Python Reference Manual (:ref:`customization`)." +msgid "" +"Additional information on these special methods may be found in the Python Reference " +"Manual (:ref:`customization`)." msgstr "" +"اطلاعات بیشتر درباره این متدهای ویژه را می‌توانید در راهنمای مرجع پایتون " +"(:ref:`customization`) بیابید." -msgid "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and similarly for tuples." +msgid "" +"As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, and " +"similarly for tuples." msgstr "" +"در نتیجه، فهرست ``[1, 2]`` برابر با ``[1.0, 2.0]`` در نظر گرفته می‌شود، و به‌طور مشابه " +"برای تاپل‌ها (tuples)." msgid "They must have since the parser can't tell the type of the operands." -msgstr "" +msgstr "آن‌ها باید داشته باشند، زیرا پارسر نمی‌تواند نوع عملوندها را تشخیص دهد." -msgid "Cased characters are those with general category property being one of \"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, titlecase)." +msgid "" +"Cased characters are those with general category property being one of \"Lu\" (Letter, " +"uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, titlecase)." msgstr "" +"نویسه‌های دارای حالت حروف، آن‌هایی هستند که ویژگی دسته‌بندی عمومی آن‌ها یکی از \"Lu\" " +"(حرف، بزرگ)، \"Ll\" (حرف، کوچک) یا \"Lt\" (حرف، نگارش عنوان‌نویسی) است." -msgid "To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted." +msgid "" +"To format only a tuple you should therefore provide a singleton tuple whose only " +"element is the tuple to be formatted." msgstr "" +"بنابراین، برای این‌که فقط یک تاپل را قالب‌بندی کنید، باید یک تاپل تک‌عضوی ارائه دهید که " +"تنها عنصر آن، تاپلی است که باید قالب‌بندی شود." msgid "built-in" -msgstr "" +msgstr "توکار" msgid "types" -msgstr "" +msgstr "انواع" msgid "statement" -msgstr "" +msgstr "دستور" msgid "if" -msgstr "" +msgstr "if" msgid "while" -msgstr "" +msgstr "while" msgid "truth" -msgstr "" +msgstr "صدق" msgid "value" -msgstr "" +msgstr "مقدار" msgid "Boolean" -msgstr "" +msgstr "بولی" msgid "operations" -msgstr "" +msgstr "عملیات" msgid "false" -msgstr "" +msgstr "نادرست" msgid "true" -msgstr "" +msgstr "درست" msgid "None (Built-in object)" -msgstr "" +msgstr "None (شیء توکار)" msgid "False (Built-in object)" -msgstr "" +msgstr "False (شیء توکار)" msgid "operator" -msgstr "" +msgstr "عملگر" msgid "or" -msgstr "" +msgstr "یا" msgid "and" -msgstr "" +msgstr "و" msgid "False" -msgstr "" +msgstr "False" msgid "True" -msgstr "" +msgstr "True" msgid "not" -msgstr "" +msgstr "نه" msgid "chaining" -msgstr "" +msgstr "زنجیره‌سازی" msgid "comparisons" -msgstr "" +msgstr "مقایسه‌ها" msgid "comparison" -msgstr "" +msgstr "مقایسه" msgid "==" -msgstr "" +msgstr "==" msgid "< (less)" -msgstr "" +msgstr "< (کمتر)" msgid "<=" -msgstr "" +msgstr "<=" msgid "> (greater)" -msgstr "" +msgstr "(بزرگ‌تر)" msgid ">=" -msgstr "" +msgstr ">=" msgid "!=" -msgstr "" +msgstr "!=" msgid "is" -msgstr "" +msgstr "است" msgid "is not" -msgstr "" +msgstr "نیست" msgid "object" -msgstr "" +msgstr "شیء" msgid "numeric" -msgstr "" +msgstr "عددی" msgid "objects" -msgstr "" +msgstr "اشیاء" msgid "comparing" -msgstr "" +msgstr "مقایسه" msgid "__eq__() (instance method)" -msgstr "" +msgstr "__eq__() (متد نمونه)" msgid "__ne__() (instance method)" -msgstr "" +msgstr "__ne__() (متد نمونه)" msgid "__lt__() (instance method)" -msgstr "" +msgstr "__lt__() (متد نمونه)" msgid "__le__() (instance method)" -msgstr "" +msgstr "__le__() (متد نمونه)" msgid "__gt__() (instance method)" -msgstr "" +msgstr "__gt__() (متد نمونه)" msgid "__ge__() (instance method)" -msgstr "" +msgstr "__ge__() (متد نمونه)" msgid "in" -msgstr "" +msgstr "در" msgid "not in" -msgstr "" +msgstr "not in" msgid "integer" -msgstr "" +msgstr "عدد صحیح" msgid "floating-point" -msgstr "" +msgstr "ممیز شناور" msgid "complex number" -msgstr "" +msgstr "عدد مختلط" msgid "C" -msgstr "" +msgstr "C" msgid "language" -msgstr "" +msgstr "زبان" msgid "literals" -msgstr "" +msgstr "مقادیر لفظی (literals)" msgid "hexadecimal" -msgstr "" +msgstr "مبنای شانزده" msgid "octal" -msgstr "" +msgstr "مبنای هشت" msgid "binary" -msgstr "" +msgstr "دودویی" msgid "arithmetic" -msgstr "" +msgstr "حساب" msgid "built-in function" -msgstr "" +msgstr "تابع توکار" msgid "int" -msgstr "" +msgstr "int" msgid "float" -msgstr "" +msgstr "float" msgid "complex" -msgstr "" +msgstr "عدد مختلط" msgid "+ (plus)" -msgstr "" +msgstr "+ (مثبت)" msgid "unary operator" -msgstr "" +msgstr "عملگر یک‌عملوندی" msgid "binary operator" -msgstr "" +msgstr "عملگر دودویی" msgid "- (minus)" -msgstr "" +msgstr "- (منها)" msgid "* (asterisk)" -msgstr "" +msgstr "* (ستاره)" msgid "/ (slash)" -msgstr "" +msgstr "/ (اسلش)" msgid "//" -msgstr "" +msgstr "//" msgid "% (percent)" -msgstr "" +msgstr "% (درصد)" msgid "**" -msgstr "" +msgstr "**" msgid "operations on" -msgstr "" +msgstr "عملیات روی" msgid "conjugate() (complex number method)" -msgstr "" +msgstr "conjugate() (متد عدد مختلط)" msgid "module" -msgstr "" +msgstr "ماژول" msgid "math" -msgstr "" +msgstr "math" msgid "floor() (in module math)" -msgstr "" +msgstr "floor() (در ماژول math)" msgid "ceil() (in module math)" -msgstr "" +msgstr "ceil() (در ماژول math)" msgid "trunc() (in module math)" -msgstr "" +msgstr "trunc() (در ماژول math)" msgid "conversions" -msgstr "" +msgstr "تبدیل‌ها" msgid "bitwise" -msgstr "" +msgstr "بیتی" msgid "shifting" -msgstr "" +msgstr "شیفت" msgid "masking" -msgstr "" +msgstr "پوشاندن (masking)" msgid "| (vertical bar)" -msgstr "" +msgstr "| (خط عمودی)" msgid "^ (caret)" -msgstr "" +msgstr "^ (کارت)" msgid "& (ampersand)" -msgstr "" +msgstr "& (امپرسند)" msgid "<<" -msgstr "" +msgstr "<<" msgid ">>" -msgstr "" +msgstr ">>" msgid "~ (tilde)" -msgstr "" +msgstr "~ (تیلدا)" msgid "values" -msgstr "" +msgstr "مقادیر" msgid "iterator protocol" -msgstr "" +msgstr "پروتکل تکرار (iterator protocol)" msgid "protocol" -msgstr "" +msgstr "پروتکل" msgid "iterator" -msgstr "" +msgstr "پیمایش‌گر" msgid "sequence" -msgstr "" +msgstr "دنباله" msgid "iteration" -msgstr "" +msgstr "تکرار" msgid "container" -msgstr "" +msgstr "ظرف" msgid "iteration over" -msgstr "" +msgstr "پیمایش روی" msgid "len" -msgstr "" +msgstr "len" msgid "min" -msgstr "" +msgstr "کمینه" msgid "max" -msgstr "" +msgstr "بیشینه" msgid "concatenation" -msgstr "" +msgstr "الحاق" msgid "operation" -msgstr "" +msgstr "عملیات" msgid "repetition" -msgstr "" +msgstr "تکرار" msgid "subscript" -msgstr "" +msgstr "زیرنویس" msgid "slice" -msgstr "" +msgstr "برش" msgid "loop" -msgstr "" +msgstr "حلقه" msgid "over mutable sequence" -msgstr "" +msgstr "بر روی دنباله تغییرپذیر" msgid "mutable sequence" -msgstr "" +msgstr "دنباله تغییرپذیر" msgid "loop over" -msgstr "" +msgstr "حلقه‌زدن بر روی" msgid "immutable" -msgstr "" +msgstr "تغییرناپذیر" msgid "tuple" -msgstr "" +msgstr "تاپل" msgid "hash" -msgstr "" +msgstr "هش" msgid "mutable" -msgstr "" +msgstr "تغییرپذیر" msgid "list" -msgstr "" +msgstr "فهرست" msgid "bytearray" -msgstr "" +msgstr "bytearray" msgid "type" -msgstr "" +msgstr "نوع" msgid "assignment" -msgstr "" +msgstr "انتساب" msgid "del" -msgstr "" +msgstr "del" msgid "range" -msgstr "" +msgstr "بازه" msgid "string" -msgstr "" +msgstr "رشته" msgid "text sequence type" -msgstr "" +msgstr "نوع دنباله متنی" msgid "str (built-in class)" -msgstr "" +msgstr "str (کلاس توکار)" msgid "(see also string)" -msgstr "" +msgstr "(همچنین رشته را ببینید)" msgid "io.StringIO" -msgstr "" +msgstr "io.StringIO" msgid "buffer protocol" -msgstr "" +msgstr "پروتکل بافر (buffer protocol)" msgid "bytes" -msgstr "" +msgstr "بایت‌ها" msgid "methods" -msgstr "" +msgstr "متدها" msgid "re" -msgstr "" +msgstr "re" msgid "universal newlines" -msgstr "" +msgstr "خط‌های جدید همگانی (universal newlines)" msgid "str.splitlines method" -msgstr "" +msgstr "متد str.splitlines" msgid "! formatted string literal" -msgstr "" +msgstr "! رشته‌ی قالب‌بندی‌شده" msgid "formatted string literals" -msgstr "" +msgstr "رشته‌های تحت‌اللفظی قالب‌بندی‌شده" msgid "! f-string" -msgstr "" +msgstr "! اف‌استرینگ" msgid "f-strings" -msgstr "" +msgstr "اف‌استرینگ‌ها" msgid "fstring" -msgstr "" +msgstr "اف‌استرینگ" msgid "interpolated string literal" -msgstr "" +msgstr "رشته لفظی درون‌یابی‌شده (interpolated string literal)" msgid "formatted literal" -msgstr "" +msgstr "لفظی قالب‌بندی‌شده (formatted literal)" msgid "interpolated literal" -msgstr "" +msgstr "لفظی درون‌یابی‌شده (interpolated literal)" msgid "{} (curly brackets)" -msgstr "" +msgstr "{} (آکولاد)" msgid "in formatted string literal" -msgstr "" +msgstr "در اف‌استرینگ" msgid "! (exclamation mark)" -msgstr "" +msgstr "! (علامت تعجب)" msgid ": (colon)" -msgstr "" +msgstr ": (دونقطه)" msgid "= (equals)" -msgstr "" +msgstr "= (مساوی)" msgid "for help in debugging using string literals" -msgstr "" +msgstr "برای کمک در اشکال‌زدایی با استفاده از مقادیر لفظی رشته‌ای" msgid "formatting, string (%)" -msgstr "" +msgstr "قالب‌بندی، رشته (%)" msgid "interpolation, string (%)" -msgstr "" +msgstr "درون‌یابی، رشته (%)" msgid "formatting, printf" -msgstr "" +msgstr "قالب‌بندی، printf" msgid "interpolation, printf" -msgstr "" +msgstr "درون‌یابی، printf" msgid "printf-style formatting" -msgstr "" +msgstr "قالب‌بندی به‌سبک printf" msgid "sprintf-style formatting" -msgstr "" +msgstr "قالب‌بندی به‌سبک sprintf" msgid "() (parentheses)" -msgstr "" +msgstr "() (پرانتز)" msgid "in printf-style formatting" -msgstr "" +msgstr "در قالب‌بندی به‌سبک printf" msgid ". (dot)" -msgstr "" +msgstr ". (نقطه)" msgid "# (hash)" -msgstr "" +msgstr "# (هش)" msgid "space" -msgstr "" +msgstr "فاصله" msgid "binary sequence types" -msgstr "" +msgstr "انواع دنباله‌ای دودویی" msgid "memoryview" -msgstr "" +msgstr "memoryview" msgid "array" -msgstr "" +msgstr "آرایه" msgid "bytes.splitlines method" -msgstr "" +msgstr "متد bytes.splitlines" msgid "bytearray.splitlines method" -msgstr "" +msgstr "متد bytearray.splitlines" msgid "formatting" -msgstr "" +msgstr "قالب‌بندی" msgid "bytes (%)" -msgstr "" +msgstr "بایت‌ها (%)" msgid "bytearray (%)" -msgstr "" +msgstr "bytearray (%)" msgid "interpolation" -msgstr "" +msgstr "درون‌یابی" msgid "set" -msgstr "" +msgstr "مجموعه" msgid "mapping" -msgstr "" +msgstr "نگاشت" msgid "dictionary" -msgstr "" +msgstr "دیکشنری" msgid "__missing__()" -msgstr "" +msgstr "__missing__()" msgid "context manager" -msgstr "" +msgstr "مدیر زمینه" msgid "context management protocol" -msgstr "" +msgstr "پروتکل مدیریت زمینه" msgid "context management" -msgstr "" +msgstr "مدیریت زمینه" msgid "annotation" -msgstr "" +msgstr "حاشیه‌نویسی " msgid "type annotation; type hint" -msgstr "" +msgstr "حاشیه‌نویسی نوع؛ راهنمای نوع" msgid "GenericAlias" -msgstr "" +msgstr "GenericAlias" msgid "Generic" -msgstr "" +msgstr "عام" msgid "Alias" -msgstr "" +msgstr "نام‌مستعار" msgid "Union" -msgstr "" +msgstr "Union" msgid "union" -msgstr "" +msgstr "اجتماع" msgid "method" -msgstr "" +msgstr "متد" msgid "code" -msgstr "" +msgstr "کد" msgid "code object" -msgstr "" +msgstr "شیء کد" msgid "compile" -msgstr "" +msgstr "کامپایل" msgid "__code__ (function object attribute)" -msgstr "" +msgstr "__code__ (ویژگی شیء تابع)" msgid "exec" -msgstr "" +msgstr "exec" msgid "eval" -msgstr "" +msgstr "eval" msgid "..." -msgstr "" +msgstr "..." msgid "ellipsis literal" -msgstr "" +msgstr "لفظی سه‌نقطه" diff --git a/library/string.po b/library/string.po index ac7142cf5..045b08b17 100644 --- a/library/string.po +++ b/library/string.po @@ -25,136 +25,364 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!string` --- Common string operations" -msgstr "" +msgstr ":mod:`!string` --- عملیات رایج رشته‌ها" msgid "**Source code:** :source:`Lib/string/__init__.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/string/__init__.py`" msgid ":ref:`textseq`" -msgstr "" +msgstr ":ref:`textseq`" msgid ":ref:`string-methods`" -msgstr "" +msgstr ":ref:`string-methods`" msgid "String constants" -msgstr "" +msgstr "ثابت‌های رشته‌ای" msgid "The constants defined in this module are:" -msgstr "" +msgstr "ثابت‌های تعریف‌شده در این ماژول عبارتند از:" -msgid "The concatenation of the :const:`ascii_lowercase` and :const:`ascii_uppercase` constants described below. This value is not locale-dependent." +msgid "" +"The concatenation of the :const:`ascii_lowercase` and " +":const:`ascii_uppercase` constants described below. This value is not " +"locale-dependent." msgstr "" +"الحاق ثابت‌های :const:`ascii_lowercase` و :const:`ascii_uppercase` که در " +"ادامه شرح داده شده‌اند. این مقدار به locale وابسته نیست." -msgid "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not locale-dependent and will not change." +msgid "" +"The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " +"locale-dependent and will not change." msgstr "" +"حروف کوچک ``'abcdefghijklmnopqrstuvwxyz'``. این مقدار وابسته به locale نیست " +"و تغییر نخواهد کرد." -msgid "The uppercase letters ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. This value is not locale-dependent and will not change." +msgid "" +"The uppercase letters ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. This value is not " +"locale-dependent and will not change." msgstr "" +"حروف بزرگ ``'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. این مقدار به locale وابسته نیست " +"و تغییر نخواهد کرد." msgid "The string ``'0123456789'``." -msgstr "" +msgstr "رشته ``'0123456789'``." msgid "The string ``'0123456789abcdefABCDEF'``." -msgstr "" +msgstr "رشته ``'0123456789abcdefABCDEF'``." msgid "The string ``'01234567'``." -msgstr "" +msgstr "رشته ``'01234567'``." -msgid "String of ASCII characters which are considered punctuation characters in the ``C`` locale: ``!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``." +msgid "" +"String of ASCII characters which are considered punctuation characters in " +"the ``C`` locale: ``!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``." msgstr "" +"رشته‌ای از نویسه‌های ASCII که در منطقه‌ی ``C`` نویسه‌های نمادگذاری محسوب " +"می‌شوند: ``!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``." -msgid "String of ASCII characters which are considered printable by Python. This is a combination of :const:`digits`, :const:`ascii_letters`, :const:`punctuation`, and :const:`whitespace`." +msgid "" +"String of ASCII characters which are considered printable by Python. This is" +" a combination of :const:`digits`, :const:`ascii_letters`, " +":const:`punctuation`, and :const:`whitespace`." msgstr "" +"رشته‌ای از نویسه‌های ASCII که از نظر پایتون قابل‌چاپ محسوب می‌شوند. این، " +"ترکیبی از :const:`digits`، :const:`ascii_letters`، :const:`punctuation` و " +":const:`whitespace` است." -msgid "By design, :meth:`string.printable.isprintable() ` returns :const:`False`. In particular, ``string.printable`` is not printable in the POSIX sense (see :manpage:`LC_CTYPE `)." +msgid "" +"By design, :meth:`string.printable.isprintable() ` returns " +":const:`False`. In particular, ``string.printable`` is not printable in the " +"POSIX sense (see :manpage:`LC_CTYPE `)." msgstr "" +"بر اساس طراحی، :meth:`string.printable.isprintable() ` " +":const:`False` را برمی‌گرداند. به‌ویژه، ``string.printable`` در معنای POSIX " +"قابل چاپ نیست (به :manpage:`LC_CTYPE ` مراجعه کنید)." -msgid "A string containing all ASCII characters that are considered whitespace. This includes the characters space, tab, linefeed, return, formfeed, and vertical tab." +msgid "" +"A string containing all ASCII characters that are considered whitespace. " +"This includes the characters space, tab, linefeed, return, formfeed, and " +"vertical tab." msgstr "" +"رشته‌ای شامل تمام نویسه‌های ASCII که فضای خالی محسوب می‌شوند. این شامل " +"نویسه‌های فاصله، تب، تغذیه‌ی سطر (linefeed)، بازگشت (return)، تغذیه‌ی صفحه (formfeed)" +" و تب عمودی (vertical tab) است." msgid "Custom string formatting" -msgstr "" +msgstr "قالب‌بندی سفارشی رشته" -msgid "The built-in string class provides the ability to do complex variable substitutions and value formatting via the :meth:`~str.format` method described in :pep:`3101`. The :class:`Formatter` class in the :mod:`!string` module allows you to create and customize your own string formatting behaviors using the same implementation as the built-in :meth:`~str.format` method." -msgstr "" +msgid "" +"The built-in string class provides the ability to do complex variable " +"substitutions and value formatting via the :meth:`~str.format` method " +"described in :pep:`3101`. The :class:`Formatter` class in the " +":mod:`!string` module allows you to create and customize your own string " +"formatting behaviors using the same implementation as the built-in " +":meth:`~str.format` method." +msgstr "" +"کلاس رشته‌ی توکار امکان انجام جایگزینی‌های پیچیده‌ی متغیرها و قالب‌بندی " +"مقدار را از طریق متد :meth:`~str.format` که در :pep:`3101` توضیح داده شده " +"است، فراهم می‌کند. کلاس :class:`Formatter` در ماژول :mod:`!string` به شما " +"امکان می‌دهد رفتارهای قالب‌بندی رشته‌ی خودتان را با استفاده از همان " +"پیاده‌سازی متد توکار :meth:`~str.format` ایجاد و سفارشی‌سازی کنید." msgid "The :class:`Formatter` class has the following public methods:" -msgstr "" +msgstr "کلاس :class:`Formatter` دارای متدهای عمومی زیر است:" -msgid "The primary API method. It takes a format string and an arbitrary set of positional and keyword arguments. It is just a wrapper that calls :meth:`vformat`." +msgid "" +"The primary API method. It takes a format string and an arbitrary set of " +"positional and keyword arguments. It is just a wrapper that calls " +":meth:`vformat`." msgstr "" +"متد اصلی API. این متد یک رشته‌ی قالب و مجموعه‌ای دلخواه از آرگومان‌های " +"جایگاهی و کلیدواژه‌ای را دریافت می‌کند. این متد صرفاً یک دربرگیرنده است که " +":meth:`vformat` را فراخوانی می‌کند." -msgid "A format string argument is now :ref:`positional-only `." +msgid "" +"A format string argument is now :ref:`positional-only `." msgstr "" +"آرگومان رشته‌ی قالب اکنون :ref:`فقط جایگاهی ` است." -msgid "This function does the actual work of formatting. It is exposed as a separate function for cases where you want to pass in a predefined dictionary of arguments, rather than unpacking and repacking the dictionary as individual arguments using the ``*args`` and ``**kwargs`` syntax. :meth:`vformat` does the work of breaking up the format string into character data and replacement fields. It calls the various methods described below." -msgstr "" +msgid "" +"This function does the actual work of formatting. It is exposed as a " +"separate function for cases where you want to pass in a predefined " +"dictionary of arguments, rather than unpacking and repacking the dictionary " +"as individual arguments using the ``*args`` and ``**kwargs`` syntax. " +":meth:`vformat` does the work of breaking up the format string into " +"character data and replacement fields. It calls the various methods " +"described below." +msgstr "" +"این تابع کار اصلی قالب‌بندی را انجام می‌دهد. این تابع به‌عنوان یک تابع " +"جداگانه در دسترس قرار داده شده است برای حالت‌هایی که می‌خواهید یک دیکشنری از" +" پیش تعریف‌شده از آرگومان‌ها را ارسال کنید، به‌جای آنکه دیکشنری را با " +"استفاده از سینتکس ``*args`` و ``**kwargs`` به آرگومان‌های جداگانه واگشایی و " +"بسته‌بندی مجدد کنید. :meth:`vformat` کار شکستن رشته قالب به داده‌های " +"نویسه‌ای و فیلدهای جایگزینی را انجام می‌دهد. این تابع متدهای مختلفی را که در" +" ادامه توضیح داده شده‌اند فراخوانی می‌کند." -msgid "In addition, the :class:`Formatter` defines a number of methods that are intended to be replaced by subclasses:" +msgid "" +"In addition, the :class:`Formatter` defines a number of methods that are " +"intended to be replaced by subclasses:" msgstr "" +"علاوه بر این، :class:`Formatter` تعدادی متد را تعریف می‌کند که در نظر گرفته " +"شده‌اند تا توسط زیرکلاس‌ها جایگزین شوند:" -msgid "Loop over the format_string and return an iterable of tuples (*literal_text*, *field_name*, *format_spec*, *conversion*). This is used by :meth:`vformat` to break the string into either literal text, or replacement fields." +msgid "" +"Loop over the format_string and return an iterable of tuples " +"(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used " +"by :meth:`vformat` to break the string into either literal text, or " +"replacement fields." msgstr "" +"format_string را با حلقه پیمایش می‌کند و یک پیمایش‌پذیر از تاپل‌های " +"(*literal_text*، *field_name*، *format_spec*، *conversion*) برمی‌گرداند. این" +" مورد توسط :meth:`vformat` برای تفکیک رشته به متن ثابت یا فیلدهای جایگزینی " +"استفاده می‌شود." -msgid "The values in the tuple conceptually represent a span of literal text followed by a single replacement field. If there is no literal text (which can happen if two replacement fields occur consecutively), then *literal_text* will be a zero-length string. If there is no replacement field, then the values of *field_name*, *format_spec* and *conversion* will be ``None``. The value of *field_name* is unmodified and auto-numbering of non-numbered positional fields is done by :meth:`vformat`." -msgstr "" +msgid "" +"The values in the tuple conceptually represent a span of literal text " +"followed by a single replacement field. If there is no literal text (which " +"can happen if two replacement fields occur consecutively), then " +"*literal_text* will be a zero-length string. If there is no replacement " +"field, then the values of *field_name*, *format_spec* and *conversion* will " +"be ``None``. The value of *field_name* is unmodified and auto-numbering of " +"non-numbered positional fields is done by :meth:`vformat`." +msgstr "" +"مقادیر موجود در تاپل از نظر مفهومی یک قطعه متن لفظی و به دنبال آن یک فیلد " +"جایگزینی را نشان می‌دهند. اگر متن لفظی وجود نداشته باشد (که ممکن است در " +"صورتی رخ دهد که دو فیلد جایگزینی به‌صورت متوالی ظاهر شوند)، *literal_text* " +"رشته‌ای با طول صفر خواهد بود. اگر فیلد جایگزینی وجود نداشته باشد، مقادیر " +"*field_name*، *format_spec* و *conversion* برابر ``None`` خواهند بود. مقدار " +"*field_name* بدون تغییر باقی می‌ماند و شماره‌گذاری خودکار فیلدهای جایگاهی " +"بدون شماره توسط :meth:`vformat` انجام می‌شود." -msgid "Given *field_name*, convert it to an object to be formatted. Auto-numbering of *field_name* returned from :meth:`parse` is done by :meth:`vformat` before calling this method. Returns a tuple (obj, used_key). The default version takes strings of the form defined in :pep:`3101`, such as \"0[name]\" or \"label.title\". *args* and *kwargs* are as passed in to :meth:`vformat`. The return value *used_key* has the same meaning as the *key* parameter to :meth:`get_value`." -msgstr "" +msgid "" +"Given *field_name*, convert it to an object to be formatted. Auto-numbering " +"of *field_name* returned from :meth:`parse` is done by :meth:`vformat` " +"before calling this method. Returns a tuple (obj, used_key). The default " +"version takes strings of the form defined in :pep:`3101`, such as " +"\"0[name]\" or \"label.title\". *args* and *kwargs* are as passed in to " +":meth:`vformat`. The return value *used_key* has the same meaning as the " +"*key* parameter to :meth:`get_value`." +msgstr "" +"با داشتن *field_name*، آن را به شیءای برای قالب‌بندی تبدیل می‌کند. " +"شماره‌گذاری خودکار *field_name* بازگشتی از :meth:`parse` توسط " +":meth:`vformat` پیش از فراخوانی این متد انجام می‌شود. یک تاپل (obj, " +"used_key) برمی‌گرداند. نسخه پیش‌فرض رشته‌هایی با قالب تعریف‌شده در " +":pep:`3101` را می‌پذیرد، مانند \"0[name]\" یا \"label.title\". *args* و " +"*kwargs* همان مقادیری هستند که به :meth:`vformat` داده شده‌اند. مقدار " +"بازگشتی *used_key* همان معنای پارامتر *key* در :meth:`get_value` را دارد." -msgid "Retrieve a given field value. The *key* argument will be either an integer or a string. If it is an integer, it represents the index of the positional argument in *args*; if it is a string, then it represents a named argument in *kwargs*." +msgid "" +"Retrieve a given field value. The *key* argument will be either an integer " +"or a string. If it is an integer, it represents the index of the positional" +" argument in *args*; if it is a string, then it represents a named argument " +"in *kwargs*." msgstr "" +"مقدار یک فیلد مشخص را بازیابی می‌کند. آرگومان *key* یا یک عدد صحیح است یا یک" +" رشته. اگر عدد صحیح باشد، بیانگر اندیس آرگومان جایگاهی در *args* است؛ اگر " +"رشته باشد، بیانگر یک آرگومان نام‌دار در *kwargs* است." -msgid "The *args* parameter is set to the list of positional arguments to :meth:`vformat`, and the *kwargs* parameter is set to the dictionary of keyword arguments." +msgid "" +"The *args* parameter is set to the list of positional arguments to " +":meth:`vformat`, and the *kwargs* parameter is set to the dictionary of " +"keyword arguments." msgstr "" +"پارامتر *args* به فهرست آرگومان‌های جایگاهی :meth:`vformat` تنظیم می‌شود، و " +"پارامتر *kwargs* به دیکشنری آرگومان‌های کلیدواژه‌ای تنظیم می‌شود." -msgid "For compound field names, these functions are only called for the first component of the field name; subsequent components are handled through normal attribute and indexing operations." +msgid "" +"For compound field names, these functions are only called for the first " +"component of the field name; subsequent components are handled through " +"normal attribute and indexing operations." msgstr "" +"برای نام‌های فیلد ترکیبی، این توابع فقط برای اولین کامپوننت نام فیلد " +"فراخوانی می‌شوند؛ کامپوننت‌های بعدی از طریق عملیات عادی ویژگی و اندیس‌گذاری " +"مدیریت می‌شوند." -msgid "So for example, the field expression '0.name' would cause :meth:`get_value` to be called with a *key* argument of 0. The ``name`` attribute will be looked up after :meth:`get_value` returns by calling the built-in :func:`getattr` function." +msgid "" +"So for example, the field expression '0.name' would cause :meth:`get_value` " +"to be called with a *key* argument of 0. The ``name`` attribute will be " +"looked up after :meth:`get_value` returns by calling the built-in " +":func:`getattr` function." msgstr "" +"بنابراین برای مثال، عبارت فیلد '0.name' باعث می‌شود :meth:`get_value` با " +"آرگومان *key* برابر ۰ فراخوانی شود. ویژگی ``name`` پس از بازگشت " +":meth:`get_value` با فراخوانی تابع توکار :func:`getattr` جستجو می‌شود." -msgid "If the index or keyword refers to an item that does not exist, then an :exc:`IndexError` or :exc:`KeyError` should be raised." +msgid "" +"If the index or keyword refers to an item that does not exist, then an " +":exc:`IndexError` or :exc:`KeyError` should be raised." msgstr "" +"اگر اندیس یا کلیدواژه به آیتمی که وجود ندارد اشاره کند، باید یک " +":exc:`IndexError` یا :exc:`KeyError` پرتاب شود." -msgid "Implement checking for unused arguments if desired. The arguments to this function is the set of all argument keys that were actually referred to in the format string (integers for positional arguments, and strings for named arguments), and a reference to the *args* and *kwargs* that was passed to vformat. The set of unused args can be calculated from these parameters. :meth:`check_unused_args` is assumed to raise an exception if the check fails." -msgstr "" +msgid "" +"Implement checking for unused arguments if desired. The arguments to this " +"function is the set of all argument keys that were actually referred to in " +"the format string (integers for positional arguments, and strings for named " +"arguments), and a reference to the *args* and *kwargs* that was passed to " +"vformat. The set of unused args can be calculated from these parameters. " +":meth:`check_unused_args` is assumed to raise an exception if the check " +"fails." +msgstr "" +"در صورت تمایل، بررسی آرگومان‌های استفاده‌نشده را پیاده‌سازی کنید. " +"آرگومان‌های این تابع مجموعه‌ای از همه کلیدهای آرگومان است که واقعاً در رشته " +"قالب به آن‌ها ارجاع شده است (اعداد صحیح برای آرگومان‌های جایگاهی، و رشته‌ها " +"برای آرگومان‌های نام‌دار)، به‌همراه ارجاعی به *args* و *kwargs* که به " +"vformat ارسال شده است. مجموعه آرگومان‌های استفاده‌نشده را می‌توان از این " +"پارامترها محاسبه کرد. فرض می‌شود :meth:`check_unused_args` در صورت ناموفق " +"بودن بررسی، یک استثنا پرتاب می‌کند." -msgid ":meth:`format_field` simply calls the global :func:`format` built-in. The method is provided so that subclasses can override it." +msgid "" +":meth:`format_field` simply calls the global :func:`format` built-in. The " +"method is provided so that subclasses can override it." msgstr "" +":meth:`format_field` به‌سادگی تابع توکار سراسری :func:`format` را فراخوانی " +"می‌کند. این متد ارائه شده است تا زیرکلاس‌ها بتوانند آن را بازنویسی کنند." -msgid "Converts the value (returned by :meth:`get_field`) given a conversion type (as in the tuple returned by the :meth:`parse` method). The default version understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types." +msgid "" +"Converts the value (returned by :meth:`get_field`) given a conversion type " +"(as in the tuple returned by the :meth:`parse` method). The default version" +" understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types." msgstr "" +"مقدار (بازگشت‌داده‌شده توسط :meth:`get_field`) را با توجه به نوع تبدیل " +"(مانند تاپل بازگشت‌داده‌شده توسط متد :meth:`parse`) تبدیل می‌کند. نسخه " +"پیش‌فرض انواع تبدیل 's' (str)، 'r' (repr) و 'a' (ascii) را می‌شناسد." msgid "Format string syntax" -msgstr "" +msgstr "سینتکس رشته قالب" -msgid "The :meth:`str.format` method and the :class:`Formatter` class share the same syntax for format strings (although in the case of :class:`Formatter`, subclasses can define their own format string syntax). The syntax is related to that of :ref:`formatted string literals ` and :ref:`template string literals `, but it is less sophisticated and, in particular, does not support arbitrary expressions in interpolations." -msgstr "" +msgid "" +"The :meth:`str.format` method and the :class:`Formatter` class share the " +"same syntax for format strings (although in the case of :class:`Formatter`, " +"subclasses can define their own format string syntax). The syntax is " +"related to that of :ref:`formatted string literals ` and " +":ref:`template string literals `, but it is less sophisticated " +"and, in particular, does not support arbitrary expressions in " +"interpolations." +msgstr "" +"متد :meth:`str.format` و کلاس :class:`Formatter` نحو یکسانی برای رشته‌های " +"قالب دارند (اگرچه در مورد :class:`Formatter`، زیرکلاس‌ها می‌توانند نحو " +"رشته‌های قالب خود را تعریف کنند). این نحو با نحو :ref:`مقادیر لفظی رشته‌ای " +"قالب‌بندی‌شده ` و :ref:`مقادیر لفظی رشته‌ای الگویی ` " +"مرتبط است، اما کمتر پیشرفته است و به‌ویژه از عبارت‌های دلخواه در " +"درون‌یابی‌ها پشتیبانی نمی‌کند." -msgid "Format strings contain \"replacement fields\" surrounded by curly braces ``{}``. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the literal text, it can be escaped by doubling: ``{{`` and ``}}``." +msgid "" +"Format strings contain \"replacement fields\" surrounded by curly braces " +"``{}``. Anything that is not contained in braces is considered literal text," +" which is copied unchanged to the output. If you need to include a brace " +"character in the literal text, it can be escaped by doubling: ``{{`` and " +"``}}``." msgstr "" +"رشته‌های قالب حاوی «فیلدهای جایگزینی» هستند که با آکولادها ``{}`` احاطه " +"شده‌اند. هر چیزی که داخل آکولادها نباشد، متن لفظی در نظر گرفته می‌شود و " +"بدون تغییر به خروجی رونوشت می‌شود. اگر نیاز دارید یک نویسه آکولاد را در متن " +"لفظی بگنجانید، می‌توانید آن را با دو بار نوشتن خنثی کنید: ``{{`` و ``}}``." msgid "The grammar for a replacement field is as follows:" -msgstr "" +msgstr "دستور زبان یک فیلد جایگزینی به‌صورت زیر است:" -msgid "In less formal terms, the replacement field can start with a *field_name* that specifies the object whose value is to be formatted and inserted into the output instead of the replacement field. The *field_name* is optionally followed by a *conversion* field, which is preceded by an exclamation point ``'!'``, and a *format_spec*, which is preceded by a colon ``':'``. These specify a non-default format for the replacement value." -msgstr "" +msgid "" +"In less formal terms, the replacement field can start with a *field_name* " +"that specifies the object whose value is to be formatted and inserted into " +"the output instead of the replacement field. The *field_name* is optionally " +"followed by a *conversion* field, which is preceded by an exclamation point" +" ``'!'``, and a *format_spec*, which is preceded by a colon ``':'``. These " +"specify a non-default format for the replacement value." +msgstr "" +"به بیان غیررسمی‌تر، فیلد جایگزینی می‌تواند با یک *field_name* آغاز شود که " +"شیءای را مشخص می‌کند که مقدار آن باید قالب‌بندی شود و به جای فیلد جایگزینی، " +"در خروجی درج شود. پس از *field_name*، به‌اختیار یک فیلد *conversion* می‌آید " +"که پیش از آن علامت تعجب ``'!'`` قرار دارد، و یک *format_spec* که پیش از آن " +"دونقطه ``':'`` قرار دارد. این موارد قالبی غیرپیش‌فرض برای مقدار جایگزینی " +"مشخص می‌کنند." msgid "See also the :ref:`formatspec` section." -msgstr "" +msgstr "همچنین بخش :ref:`formatspec` را ببینید." -msgid "The *field_name* itself begins with an *arg_name* that is either a number or a keyword. If it's a number, it refers to a positional argument, and if it's a keyword, it refers to a named keyword argument. An *arg_name* is treated as a number if a call to :meth:`str.isdecimal` on the string would return true. If the numerical arg_names in a format string are 0, 1, 2, ... in sequence, they can all be omitted (not just some) and the numbers 0, 1, 2, ... will be automatically inserted in that order. Because *arg_name* is not quote-delimited, it is not possible to specify arbitrary dictionary keys (e.g., the strings ``'10'`` or ``':-]'``) within a format string. The *arg_name* can be followed by any number of index or attribute expressions. An expression of the form ``'.name'`` selects the named attribute using :func:`getattr`, while an expression of the form ``'[index]'`` does an index lookup using :meth:`~object.__getitem__`." -msgstr "" +msgid "" +"The *field_name* itself begins with an *arg_name* that is either a number or" +" a keyword. If it's a number, it refers to a positional argument, and if " +"it's a keyword, it refers to a named keyword argument. An *arg_name* is " +"treated as a number if a call to :meth:`str.isdecimal` on the string would " +"return true. If the numerical arg_names in a format string are 0, 1, 2, ... " +"in sequence, they can all be omitted (not just some) and the numbers 0, 1, " +"2, ... will be automatically inserted in that order. Because *arg_name* is " +"not quote-delimited, it is not possible to specify arbitrary dictionary keys" +" (e.g., the strings ``'10'`` or ``':-]'``) within a format string. The " +"*arg_name* can be followed by any number of index or attribute expressions. " +"An expression of the form ``'.name'`` selects the named attribute using " +":func:`getattr`, while an expression of the form ``'[index]'`` does an index" +" lookup using :meth:`~object.__getitem__`." +msgstr "" +"خود *field_name* با یک *arg_name* آغاز می‌شود که یا یک عدد است یا یک " +"کلیدواژه. اگر عدد باشد، به یک آرگومان جایگاهی اشاره می‌کند، و اگر کلیدواژه " +"باشد، به یک آرگومان کلیدواژه‌ای نام‌دار اشاره می‌کند. اگر فراخوانی " +":meth:`str.isdecimal` روی رشته مقدار true را برگرداند، *arg_name* یک عدد در " +"نظر گرفته می‌شود. اگر arg_nameهای عددی در یک رشته‌ی قالب به‌ترتیب ۰، ۱، ۲، " +"... باشند، می‌توان همه‌ی آن‌ها را حذف کرد (نه فقط برخی) و اعداد ۰، ۱، ۲، ... " +"به‌همین ترتیب به‌صورت خودکار درج می‌شوند. از آن‌جا که *arg_name* با علامت " +"نقل‌قول محدود نمی‌شود، نمی‌توان کلیدهای دلخواه دیکشنری (برای مثال، رشته‌های " +"``'10'`` یا ``':-]'``) را در یک رشته‌ی قالب مشخص کرد. پس از *arg_name* " +"می‌تواند هر تعداد عبارت اندیس یا ویژگی بیاید. عبارتی به‌شکل ``'.name'`` " +"ویژگی نام‌برده را با استفاده از :func:`getattr` انتخاب می‌کند، در حالی که " +"عبارتی به‌شکل ``'[index]'`` جست‌وجوی اندیس را با استفاده از " +":meth:`~object.__getitem__` انجام می‌دهد." -msgid "The positional argument specifiers can be omitted for :meth:`str.format`, so ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``." +msgid "" +"The positional argument specifiers can be omitted for :meth:`str.format`, so" +" ``'{} {}'.format(a, b)`` is equivalent to ``'{0} {1}'.format(a, b)``." msgstr "" +"مشخص‌کننده‌های آرگومان جایگاهی را می‌توان برای :meth:`str.format` حذف کرد، " +"بنابراین ``'{} {}'.format(a, b)`` معادل ``'{0} {1}'.format(a, b)`` است." -msgid "The positional argument specifiers can be omitted for :class:`Formatter`." +msgid "" +"The positional argument specifiers can be omitted for :class:`Formatter`." msgstr "" +"می‌توان مشخص‌کننده‌های آرگومان جایگاهی را برای :class:`Formatter` حذف کرد." msgid "Some simple format string examples::" -msgstr "" +msgstr "چند نمونه‌ی ساده از رشته‌های قالب::" msgid "" "\"First, thou shalt count to {0}\" # References first positional argument\n" @@ -164,318 +392,715 @@ msgid "" "\"Weight in tons {0.weight}\" # 'weight' attribute of first positional arg\n" "\"Units destroyed: {players[0]}\" # First element of keyword argument 'players'." msgstr "" +"\"First, thou shalt count to {0}\" # به اولین آرگومان جایگاهی ارجاع می‌دهد\n" +"\"Bring me a {}\" # به‌طور ضمنی به اولین آرگومان جایگاهی ارجاع می‌دهد\n" +"\"From {} to {}\" # مشابه \"From {0} to {1}\"\n" +"\"My quest is {name}\" # به آرگومان کلیدواژه‌ای 'name' ارجاع می‌دهد\n" +"\"Weight in tons {0.weight}\" # ویژگی 'weight' از اولین آرگومان جایگاهی\n" +"\"Units destroyed: {players[0]}\" # اولین عنصر از آرگومان کلیدواژه‌ای 'players'." -msgid "The *conversion* field causes a type coercion before formatting. Normally, the job of formatting a value is done by the :meth:`~object.__format__` method of the value itself. However, in some cases it is desirable to force a type to be formatted as a string, overriding its own definition of formatting. By converting the value to a string before calling :meth:`~object.__format__`, the normal formatting logic is bypassed." -msgstr "" +msgid "" +"The *conversion* field causes a type coercion before formatting. Normally, " +"the job of formatting a value is done by the :meth:`~object.__format__` " +"method of the value itself. However, in some cases it is desirable to force" +" a type to be formatted as a string, overriding its own definition of " +"formatting. By converting the value to a string before calling " +":meth:`~object.__format__`, the normal formatting logic is bypassed." +msgstr "" +"فیلد *تبدیل* باعث تبدیل نوع اجباری پیش از قالب‌بندی می‌شود. به‌طور معمول، " +"کار قالب‌بندی یک مقدار توسط متد :meth:`~object.__format__` خود مقدار انجام " +"می‌شود. با این حال، در برخی موارد مطلوب است که یک نوع وادار به قالب‌بندی " +"به‌صورت رشته شود، به‌طوری که تعریف قالب‌بندی خود آن نادیده گرفته شود. با " +"تبدیل مقدار به رشته پیش از فراخوانی :meth:`~object.__format__`، منطق " +"قالب‌بندی معمولی دور زده می‌شود." -msgid "Three conversion flags are currently supported: ``'!s'`` which calls :func:`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which calls :func:`ascii`." +msgid "" +"Three conversion flags are currently supported: ``'!s'`` which calls " +":func:`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` " +"which calls :func:`ascii`." msgstr "" +"در حال حاضر از ۳ پرچم تبدیل پشتیبانی می‌شود: ``'!s'`` که :func:`str` را بر " +"روی مقدار فراخوانی می‌کند، ``'!r'`` که :func:`repr` را فراخوانی می‌کند و " +"``'!a'`` که :func:`ascii` را فراخوانی می‌کند." msgid "Some examples::" -msgstr "" +msgstr "برخی مثال‌ها::" msgid "" "\"Harold's a clever {0!s}\" # Calls str() on the argument first\n" "\"Bring out the holy {name!r}\" # Calls repr() on the argument first\n" "\"More {!a}\" # Calls ascii() on the argument first" msgstr "" +"\"Harold's a clever {0!s}\" # ابتدا str() روی آرگومان فراخوانی می‌شود\n" +"\"Bring out the holy {name!r}\" # ابتدا repr() روی آرگومان فراخوانی می‌شود\n" +"\"More {!a}\" # ابتدا ascii() روی آرگومان فراخوانی می‌شود" -msgid "The *format_spec* field contains a specification of how the value should be presented, including such details as field width, alignment, padding, decimal precision and so on. Each value type can define its own \"formatting mini-language\" or interpretation of the *format_spec*." +msgid "" +"The *format_spec* field contains a specification of how the value should be " +"presented, including such details as field width, alignment, padding, " +"decimal precision and so on. Each value type can define its own " +"\"formatting mini-language\" or interpretation of the *format_spec*." msgstr "" +"فیلد *format_spec* شامل مشخصاتی است که چگونگی نمایش مقدار را تعیین می‌کند، " +"از جمله جزئیاتی مانند عرض فیلد، تراز، پرکننده، دقت اعشاری و غیره. هر نوع " +"مقدار می‌تواند «زبان کوچک قالب‌بندی» یا تفسیر خاص خود از *format_spec* را " +"تعریف کند." -msgid "Most built-in types support a common formatting mini-language, which is described in the next section." +msgid "" +"Most built-in types support a common formatting mini-language, which is " +"described in the next section." msgstr "" +"بیشتر انواع توکار از یک زبان کوچک قالب‌بندی مشترک پشتیبانی می‌کنند، که در " +"بخش بعدی شرح داده شده است." -msgid "A *format_spec* field can also include nested replacement fields within it. These nested replacement fields may contain a field name, conversion flag and format specification, but deeper nesting is not allowed. The replacement fields within the format_spec are substituted before the *format_spec* string is interpreted. This allows the formatting of a value to be dynamically specified." -msgstr "" +msgid "" +"A *format_spec* field can also include nested replacement fields within it. " +"These nested replacement fields may contain a field name, conversion flag " +"and format specification, but deeper nesting is not allowed. The " +"replacement fields within the format_spec are substituted before the " +"*format_spec* string is interpreted. This allows the formatting of a value " +"to be dynamically specified." +msgstr "" +"یک فیلد *format_spec* همچنین می‌تواند شامل فیلدهای جایگزینی تودرتو درون خود " +"باشد. این فیلدهای جایگزینی تودرتو ممکن است شامل نام فیلد، پرچم تبدیل و " +"مشخصات قالب باشند، اما تودرتوسازی عمیق‌تر مجاز نیست. فیلدهای جایگزینی درون " +"format_spec پیش از تفسیر رشته‌ی *format_spec* جایگزین می‌شوند. این امکان باعث" +" می‌شود قالب‌بندی یک مقدار به‌صورت پویا مشخص شود." msgid "See the :ref:`formatexamples` section for some examples." -msgstr "" +msgstr "برای چند مثال، بخش :ref:`formatexamples` را ببینید." msgid "Format specification mini-language" -msgstr "" +msgstr "زبان کوچک مشخصات قالب‌بندی" -msgid "\"Format specifications\" are used within replacement fields contained within a format string to define how individual values are presented (see :ref:`formatstrings`, :ref:`f-strings`, and :ref:`t-strings`). They can also be passed directly to the built-in :func:`format` function. Each formattable type may define how the format specification is to be interpreted." -msgstr "" +msgid "" +"\"Format specifications\" are used within replacement fields contained " +"within a format string to define how individual values are presented (see " +":ref:`formatstrings`, :ref:`f-strings`, and :ref:`t-strings`). They can also" +" be passed directly to the built-in :func:`format` function. Each " +"formattable type may define how the format specification is to be " +"interpreted." +msgstr "" +"«مشخصات قالب‌بندی» درون فیلدهای جایگزینی که در یک رشته قالب قرار دارند، " +"استفاده می‌شوند تا چگونگی ارائه مقادیر منفرد را تعریف کنند (به " +":ref:`formatstrings`، :ref:`f-strings` و :ref:`t-strings` مراجعه کنید). " +"همچنین می‌توان آن‌ها را مستقیماً به تابع توکار :func:`format` ارسال کرد. هر " +"نوع قابل قالب‌بندی ممکن است تعریف کند که مشخصات قالب‌بندی چگونه تفسیر " +"می‌شود." -msgid "Most built-in types implement the following options for format specifications, although some of the formatting options are only supported by the numeric types." +msgid "" +"Most built-in types implement the following options for format " +"specifications, although some of the formatting options are only supported " +"by the numeric types." msgstr "" +"بیشتر انواع توکار گزینه‌های زیر را برای مشخصات قالب‌بندی پیاده‌سازی می‌کنند،" +" اگرچه برخی از گزینه‌های قالب‌بندی تنها توسط انواع عددی پشتیبانی می‌شوند." -msgid "A general convention is that an empty format specification produces the same result as if you had called :func:`str` on the value. A non-empty format specification typically modifies the result." +msgid "" +"A general convention is that an empty format specification produces the same" +" result as if you had called :func:`str` on the value. A non-empty format " +"specification typically modifies the result." msgstr "" +"قرارداد عمومی این است که مشخصات قالب‌بندی خالی، همان نتیجه‌ای را تولید " +"می‌کند که گویی :func:`str` را روی مقدار فراخوانی کرده‌اید. مشخصات قالب‌بندی " +"غیرخالی معمولاً نتیجه را تغییر می‌دهد." msgid "The general form of a *standard format specifier* is:" -msgstr "" +msgstr "شکل کلی یک *مشخص‌کننده قالب استاندارد* به این صورت است:" -msgid "If a valid *align* value is specified, it can be preceded by a *fill* character that can be any character and defaults to a space if omitted. It is not possible to use a literal curly brace (\"``{``\" or \"``}``\") as the *fill* character in a :ref:`formatted string literal ` or when using the :meth:`str.format` method. However, it is possible to insert a curly brace with a nested replacement field. This limitation doesn't affect the :func:`format` function." -msgstr "" +msgid "" +"If a valid *align* value is specified, it can be preceded by a *fill* " +"character that can be any character and defaults to a space if omitted. It " +"is not possible to use a literal curly brace (\"``{``\" or \"``}``\") as the" +" *fill* character in a :ref:`formatted string literal ` or when " +"using the :meth:`str.format` method. However, it is possible to insert a " +"curly brace with a nested replacement field. This limitation doesn't affect" +" the :func:`format` function." +msgstr "" +"اگر یک مقدار معتبر برای *align* مشخص شود، می‌توان پیش از آن یک نویسه *fill* " +"قرار داد که می‌تواند هر نویسه‌ای باشد و در صورت حذف، پیش‌فرض آن نویسه فاصله " +"است. استفاده از یک آکولاد به‌صورت لفظی (\"``{``\" یا \"``}``\") به‌عنوان " +"نویسه *fill* در یک :ref:`اف‌استرینگ ` یا هنگام استفاده از متد " +":meth:`str.format` ممکن نیست. با این حال، می‌توان یک آکولاد را با یک فیلد " +"جایگزینی تودرتو درج کرد. این محدودیت بر تابع :func:`format` تأثیری ندارد." msgid "The meaning of the various alignment options is as follows:" -msgstr "" +msgstr "معنای گزینه‌های مختلف ترازبندی به شرح زیر است:" msgid "Option" -msgstr "" +msgstr "گزینه" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``'<'``" -msgstr "" +msgstr "``'<'``" -msgid "Forces the field to be left-aligned within the available space (this is the default for most objects)." +msgid "" +"Forces the field to be left-aligned within the available space (this is the " +"default for most objects)." msgstr "" +"فیلد را وادار می‌کند که در فضای موجود چپ‌تراز باشد (این حالت برای بیشتر " +"اشیاء پیش‌فرض است)." msgid "``'>'``" -msgstr "" +msgstr "``'>'``" -msgid "Forces the field to be right-aligned within the available space (this is the default for numbers)." +msgid "" +"Forces the field to be right-aligned within the available space (this is the" +" default for numbers)." msgstr "" +"فیلد را مجبور می‌کند که در فضای موجود راست‌چین باشد (این حالت برای اعداد " +"پیش‌فرض است)." msgid "``'='``" -msgstr "" +msgstr "``'='``" -msgid "Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form '+000000120'. This alignment option is only valid for numeric types, excluding :class:`complex`. It becomes the default for numbers when '0' immediately precedes the field width." -msgstr "" +msgid "" +"Forces the padding to be placed after the sign (if any) but before the " +"digits. This is used for printing fields in the form '+000000120'. This " +"alignment option is only valid for numeric types, excluding " +":class:`complex`. It becomes the default for numbers when '0' immediately " +"precedes the field width." +msgstr "" +"قرار گرفتن پرکننده (padding) پس از علامت (در صورت وجود) و پیش از ارقام را " +"اجباری می‌کند. این گزینه برای چاپ فیلدها در قالب '+000000120' به کار می‌رود." +" این گزینه‌ی تراز فقط برای انواع عددی معتبر است، به‌جز :class:`complex`. " +"برای اعداد، هرگاه '0' بلافاصله پیش از عرض فیلد بیاید، این گزینه به‌صورت " +"پیش‌فرض اعمال می‌شود." msgid "``'^'``" -msgstr "" +msgstr "``'^'``" msgid "Forces the field to be centered within the available space." -msgstr "" +msgstr "فیلد را وادار می‌کند که در فضای موجود وسط‌چین شود." -msgid "Note that unless a minimum field width is defined, the field width will always be the same size as the data to fill it, so that the alignment option has no meaning in this case." +msgid "" +"Note that unless a minimum field width is defined, the field width will " +"always be the same size as the data to fill it, so that the alignment option" +" has no meaning in this case." msgstr "" +"توجه داشته باشید که اگر حداقل عرض فیلد تعریف نشده باشد، عرض فیلد همیشه " +"هم‌اندازه‌ی داده‌ای خواهد بود که آن را پر می‌کند؛ بنابراین گزینه‌ی تراز در این" +" حالت معنایی ندارد." -msgid "The *sign* option is only valid for number types, and can be one of the following:" +msgid "" +"The *sign* option is only valid for number types, and can be one of the " +"following:" msgstr "" +"گزینه‌ی *sign* فقط برای انواع عددی معتبر است و می‌تواند یکی از موارد زیر " +"باشد:" msgid "``'+'``" -msgstr "" +msgstr "``'+'``" -msgid "Indicates that a sign should be used for both positive as well as negative numbers." +msgid "" +"Indicates that a sign should be used for both positive as well as negative " +"numbers." msgstr "" +"نشان می‌دهد که باید برای اعداد مثبت و همچنین منفی از علامت استفاده شود." msgid "``'-'``" -msgstr "" +msgstr "``'-'``" -msgid "Indicates that a sign should be used only for negative numbers (this is the default behavior)." +msgid "" +"Indicates that a sign should be used only for negative numbers (this is the " +"default behavior)." msgstr "" +"نشان می‌دهد که علامت باید فقط برای اعداد منفی استفاده شود (این رفتار پیش‌فرض" +" است)." msgid "space" -msgstr "" +msgstr "فاصله" -msgid "Indicates that a leading space should be used on positive numbers, and a minus sign on negative numbers." +msgid "" +"Indicates that a leading space should be used on positive numbers, and a " +"minus sign on negative numbers." msgstr "" +"نشان می‌دهد که برای اعداد مثبت باید از یک فاصله در ابتدا و برای اعداد منفی " +"از علامت منفی استفاده شود." -msgid "The ``'z'`` option coerces negative zero floating-point values to positive zero after rounding to the format precision. This option is only valid for floating-point presentation types." +msgid "" +"The ``'z'`` option coerces negative zero floating-point values to positive " +"zero after rounding to the format precision. This option is only valid for " +"floating-point presentation types." msgstr "" +"گزینه ``'z'`` مقادیر صفر منفی ممیز شناور را پس از گرد شدن به دقت قالب، به " +"صفر مثبت تبدیل می‌کند. این گزینه فقط برای انواع نمایش ممیز شناور معتبر است." msgid "Added the ``'z'`` option (see also :pep:`682`)." -msgstr "" +msgstr "گزینه ``'z'`` افزوده شد (همچنین :pep:`682` را ببینید)." -msgid "The ``'#'`` option causes the \"alternate form\" to be used for the conversion. The alternate form is defined differently for different types. This option is only valid for integer, float and complex types. For integers, when binary, octal, or hexadecimal output is used, this option adds the respective prefix ``'0b'``, ``'0o'``, ``'0x'``, or ``'0X'`` to the output value. For float and complex the alternate form causes the result of the conversion to always contain a decimal-point character, even if no digits follow it. Normally, a decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for ``'g'`` and ``'G'`` conversions, trailing zeros are not removed from the result." -msgstr "" +msgid "" +"The ``'#'`` option causes the \"alternate form\" to be used for the " +"conversion. The alternate form is defined differently for different types." +" This option is only valid for integer, float and complex types. For " +"integers, when binary, octal, or hexadecimal output is used, this option " +"adds the respective prefix ``'0b'``, ``'0o'``, ``'0x'``, or ``'0X'`` to the " +"output value. For float and complex the alternate form causes the result of " +"the conversion to always contain a decimal-point character, even if no " +"digits follow it. Normally, a decimal-point character appears in the result " +"of these conversions only if a digit follows it. In addition, for ``'g'`` " +"and ``'G'`` conversions, trailing zeros are not removed from the result." +msgstr "" +"گزینه‌ی ``'#'`` باعث می‌شود که «شکل جایگزین» برای تبدیل استفاده شود. شکل " +"جایگزین برای انواع مختلف به‌طور متفاوتی تعریف می‌شود. این گزینه تنها برای " +"انواع عدد صحیح، شناور و مختلط معتبر است. برای اعداد صحیح، هنگامی که خروجی " +"به‌صورت مبنای دو، مبنای هشت یا مبنای شانزده باشد، این گزینه پیشوند مربوطه " +"یعنی ``'0b'``، ``'0o'``، ``'0x'`` یا ``'0X'`` را به مقدار خروجی اضافه " +"می‌کند. برای شناور و مختلط، شکل جایگزین باعث می‌شود که نتیجه‌ی تبدیل همیشه " +"شامل یک نویسه‌ی نقطه‌ی اعشار باشد، حتی اگر هیچ رقمی پس از آن نیاید. به‌طور " +"معمول، یک نویسه‌ی نقطه‌ی اعشار در نتیجه‌ی این تبدیل‌ها فقط در صورتی ظاهر می‌شود" +" که رقمی پس از آن بیاید. علاوه بر این، برای تبدیل‌های ``'g'`` و ``'G'``، " +"صفرهای پایانی از نتیجه حذف نمی‌شوند." -msgid "The *width* is a decimal integer defining the minimum total field width, including any prefixes, separators, and other formatting characters. If not specified, then the field width will be determined by the content." +msgid "" +"The *width* is a decimal integer defining the minimum total field width, " +"including any prefixes, separators, and other formatting characters. If not " +"specified, then the field width will be determined by the content." msgstr "" +"*width* یک عدد صحیح دهدهی است که حداقل عرض کل فیلد را تعریف می‌کند، شامل " +"هرگونه پیشوند، جداکننده و سایر نویسه‌های قالب‌بندی. اگر مشخص نشده باشد، عرض " +"فیلد توسط محتوا تعیین می‌شود." -msgid "When no explicit alignment is given, preceding the *width* field by a zero (``'0'``) character enables sign-aware zero-padding for numeric types, excluding :class:`complex`. This is equivalent to a *fill* character of ``'0'`` with an *alignment* type of ``'='``." +msgid "" +"When no explicit alignment is given, preceding the *width* field by a zero " +"(``'0'``) character enables sign-aware zero-padding for numeric types, " +"excluding :class:`complex`. This is equivalent to a *fill* character of " +"``'0'`` with an *alignment* type of ``'='``." msgstr "" +"هنگامی که تراز صریحی داده نشده باشد، قرار دادن نویسه‌ی صفر (``'0'``) پیش از " +"فیلد *width*، پدینگ صفر با در نظر گرفتن علامت را برای انواع عددی، به‌جز" +" :class:`complex`، فعال می‌کند. این معادل نویسه‌ی *fill* برابر ``'0'`` و نوع" +" *alignment* برابر ``'='`` است." -msgid "Preceding the *width* field by ``'0'`` no longer affects the default alignment for strings." +msgid "" +"Preceding the *width* field by ``'0'`` no longer affects the default " +"alignment for strings." msgstr "" +"قرار دادن ``'0'`` پیش از فیلد *width* دیگر بر هم‌ترازی پیش‌فرض رشته‌ها " +"تأثیری نمی‌گذارد." -msgid "The *precision* is a decimal integer indicating how many digits should be displayed after the decimal point for presentation types ``'f'`` and ``'F'``, or before and after the decimal point for presentation types ``'g'`` or ``'G'``. For string presentation types the field indicates the maximum field size - in other words, how many characters will be used from the field content. The *precision* is not allowed for integer presentation types." -msgstr "" +msgid "" +"The *precision* is a decimal integer indicating how many digits should be " +"displayed after the decimal point for presentation types ``'f'`` and " +"``'F'``, or before and after the decimal point for presentation types " +"``'g'`` or ``'G'``. For string presentation types the field indicates the " +"maximum field size - in other words, how many characters will be used from " +"the field content. The *precision* is not allowed for integer presentation " +"types." +msgstr "" +"*precision* یک عدد صحیح مبنای ده است که نشان می‌دهد برای انواع نمایش ``'f'``" +" و ``'F'`` چند رقم باید بعد از نقطه اعشار نمایش داده شوند، یا برای انواع " +"نمایش ``'g'`` یا ``'G'`` چند رقم باید پیش و پس از نقطه اعشار نمایش داده " +"شوند. برای انواع نمایش رشته، این فیلد حداکثر اندازه فیلد را نشان می‌دهد — به" +" عبارت دیگر، نشان می‌دهد که چند نویسه از محتوای فیلد استفاده خواهد شد. " +"استفاده از *precision* برای انواع نمایش عدد صحیح مجاز نیست." -msgid "The *grouping* option after *width* and *precision* fields specifies a digit group separator for the integral and fractional parts of a number respectively. It can be one of the following:" +msgid "" +"The *grouping* option after *width* and *precision* fields specifies a digit" +" group separator for the integral and fractional parts of a number " +"respectively. It can be one of the following:" msgstr "" +"گزینه‌ی *grouping* پس از فیلدهای *width* و *precision*، جداکننده‌ی گروه " +"ارقام را برای بخش‌های صحیح و کسری یک عدد به‌ترتیب مشخص می‌کند. این گزینه " +"می‌تواند یکی از موارد زیر باشد:" msgid "``','``" -msgstr "" +msgstr "``','``" -msgid "Inserts a comma every 3 digits for integer presentation type ``'d'`` and floating-point presentation types, excluding ``'n'``. For other presentation types, this option is not supported." +msgid "" +"Inserts a comma every 3 digits for integer presentation type ``'d'`` and " +"floating-point presentation types, excluding ``'n'``. For other presentation" +" types, this option is not supported." msgstr "" +"برای نوع نمایش عدد صحیح ``'d'`` و انواع نمایش ممیز شناور، به‌جز ``'n'``، هر " +"۳ رقم یک ویرگول درج می‌کند. برای سایر انواع نمایش، این گزینه پشتیبانی " +"نمی‌شود." msgid "``'_'``" -msgstr "" +msgstr "``'_'``" -msgid "Inserts an underscore every 3 digits for integer presentation type ``'d'`` and floating-point presentation types, excluding ``'n'``. For integer presentation types ``'b'``, ``'o'``, ``'x'``, and ``'X'``, underscores are inserted every 4 digits. For other presentation types, this option is not supported." +msgid "" +"Inserts an underscore every 3 digits for integer presentation type ``'d'`` " +"and floating-point presentation types, excluding ``'n'``. For integer " +"presentation types ``'b'``, ``'o'``, ``'x'``, and ``'X'``, underscores are " +"inserted every 4 digits. For other presentation types, this option is not " +"supported." msgstr "" +"برای نوع نمایش عدد صحیح ``'d'`` و انواع نمایش ممیز شناور، به‌جز ``'n'``، " +"به‌ازای هر ۳ رقم یک زیرخط درج می‌کند. برای انواع نمایش عدد صحیح ``'b'``، " +"``'o'``، ``'x'`` و ``'X'``، به‌ازای هر ۴ رقم یک زیرخط درج می‌شود. برای سایر" +" انواع نمایش، این گزینه پشتیبانی نمی‌شود." -msgid "For a locale-aware separator, use the ``'n'`` :ref:`float presentation type ` or :ref:`integer presentation type ` instead." +msgid "" +"For a locale-aware separator, use the ``'n'`` :ref:`float presentation type " +"` or :ref:`integer presentation type ` " +"instead." msgstr "" +"برای جداکننده‌ی آگاه از locale، به‌جای آن از ``'n'`` :ref:`نوع نمایش عدد " +"شناور ` یا :ref:`نوع نمایش عدد صحیح ` " +"استفاده کنید." msgid "Added the ``','`` option (see also :pep:`378`)." -msgstr "" +msgstr "گزینه ``','`` افزوده شد (همچنین :pep:`378` را ببینید)." msgid "Added the ``'_'`` option (see also :pep:`515`)." -msgstr "" +msgstr "گزینه‌ی ``'_'`` اضافه شد (همچنین :pep:`515` را ببینید)." msgid "Support the *grouping* option for the fractional part." -msgstr "" +msgstr "پشتیبانی از گزینه‌ی *گروه‌بندی* برای بخش کسری." msgid "Finally, the *type* determines how the data should be presented." -msgstr "" +msgstr "در نهایت، *نوع* تعیین می‌کند که داده‌ها چگونه باید ارائه شوند." msgid "The available string presentation types are:" -msgstr "" +msgstr "انواع ارائه‌ی در دسترس برای رشته عبارتند از:" msgid "Type" -msgstr "" +msgstr "نوع" msgid "``'s'``" -msgstr "" +msgstr "``'s'``" -msgid "String format. This is the default type for strings and may be omitted." -msgstr "" +msgid "" +"String format. This is the default type for strings and may be omitted." +msgstr "قالب رشته. این نوع پیش‌فرض برای رشته‌ها است و می‌توان آن را حذف کرد." msgid "None" -msgstr "" +msgstr "None" msgid "The same as ``'s'``." -msgstr "" +msgstr "همان ``'s'``." msgid "The available integer presentation types are:" -msgstr "" +msgstr "انواع ارائه‌ی عدد صحیح موجود عبارتند از:" msgid "``'b'``" -msgstr "" +msgstr "``'b'``" msgid "Binary format. Outputs the number in base 2." -msgstr "" +msgstr "قالب دودویی. عدد را در مبنای ۲ خروجی می‌دهد." msgid "``'c'``" -msgstr "" +msgstr "``'c'``" -msgid "Character. Converts the integer to the corresponding unicode character before printing." -msgstr "" +msgid "" +"Character. Converts the integer to the corresponding unicode character " +"before printing." +msgstr "نویسه. عدد صحیح را پیش از چاپ به نویسه‌ی یونیکد متناظر تبدیل می‌کند." msgid "``'d'``" -msgstr "" +msgstr "``'d'``" msgid "Decimal Integer. Outputs the number in base 10." -msgstr "" +msgstr "عدد صحیح دهدهی. عدد را در مبنای ۱۰ خروجی می‌دهد." msgid "``'o'``" -msgstr "" +msgstr "``'o'``" msgid "Octal format. Outputs the number in base 8." -msgstr "" +msgstr "قالب مبنای هشت. عدد را در مبنای ۸ خروجی می‌دهد." msgid "``'x'``" -msgstr "" +msgstr "``'x'``" -msgid "Hex format. Outputs the number in base 16, using lower-case letters for the digits above 9." +msgid "" +"Hex format. Outputs the number in base 16, using lower-case letters for the " +"digits above 9." msgstr "" +"قالب مبنای شانزده. عدد را در مبنای ۱۶ خروجی می‌دهد و برای ارقام بزرگ‌تر از ۹" +" از حروف کوچک استفاده می‌کند." msgid "``'X'``" -msgstr "" +msgstr "``'X'``" -msgid "Hex format. Outputs the number in base 16, using upper-case letters for the digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be upper-cased to ``'0X'`` as well." +msgid "" +"Hex format. Outputs the number in base 16, using upper-case letters for the " +"digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " +"upper-cased to ``'0X'`` as well." msgstr "" +"قالب مبنای شانزده. عدد را در مبنای ۱۶ خروجی می‌دهد و برای ارقام بزرگ‌تر از ۹" +" از حروف بزرگ استفاده می‌کند. در صورتی که ``'#'`` مشخص شده باشد، پیشوند " +"``'0x'`` نیز به ``'0X'`` تبدیل به حروف بزرگ می‌شود." msgid "``'n'``" -msgstr "" +msgstr "``'n'``" -msgid "Number. This is the same as ``'d'``, except that it uses the current locale setting to insert the appropriate digit group separators. Note that the default locale is not the system locale. Depending on your use case, you may wish to set :const:`~locale.LC_NUMERIC` with :func:`locale.setlocale` before using ``'n'``." -msgstr "" +msgid "" +"Number. This is the same as ``'d'``, except that it uses the current locale " +"setting to insert the appropriate digit group separators. Note that the " +"default locale is not the system locale. Depending on your use case, you may" +" wish to set :const:`~locale.LC_NUMERIC` with :func:`locale.setlocale` " +"before using ``'n'``." +msgstr "" +"عدد. این همان ``'d'`` است، با این تفاوت که از تنظیمات locale (locale) " +"برای درج جداکننده‌های مناسب گروه ارقام استفاده می‌کند. توجه داشته باشید که " +"locale پیش‌فرض، locale سیستم نیست. بسته به مورد استفاده خود، ممکن است " +"بخواهید پیش از استفاده از ``'n'``، :const:`~locale.LC_NUMERIC` را با " +":func:`locale.setlocale` تنظیم کنید." msgid "The same as ``'d'``." -msgstr "" +msgstr "همانند ``'d'``." -msgid "In addition to the above presentation types, integers can be formatted with the floating-point presentation types listed below (except ``'n'`` and ``None``). When doing so, :func:`float` is used to convert the integer to a floating-point number before formatting." +msgid "" +"In addition to the above presentation types, integers can be formatted with " +"the floating-point presentation types listed below (except ``'n'`` and " +"``None``). When doing so, :func:`float` is used to convert the integer to a " +"floating-point number before formatting." msgstr "" +"علاوه بر انواع نمایش بالا، می‌توان اعداد صحیح را با انواع نمایش ممیز شناور " +"که در زیر فهرست شده‌اند نیز قالب‌بندی کرد (به‌جز ``'n'`` و ``None``). هنگام " +"این کار، برای تبدیل عدد صحیح به عدد ممیز شناور پیش از قالب‌بندی از " +":func:`float` استفاده می‌شود." -msgid "The available presentation types for :class:`float` and :class:`~decimal.Decimal` values are:" +msgid "" +"The available presentation types for :class:`float` and " +":class:`~decimal.Decimal` values are:" msgstr "" +"انواع نمایش موجود برای مقادیر :class:`float` و :class:`~decimal.Decimal` " +"عبارتند از:" msgid "``'e'``" -msgstr "" +msgstr "``'e'``" -msgid "Scientific notation. For a given precision ``p``, formats the number in scientific notation with the letter 'e' separating the coefficient from the exponent. The coefficient has one digit before and ``p`` digits after the decimal point, for a total of ``p + 1`` significant digits. With no precision given, uses a precision of ``6`` digits after the decimal point for :class:`float`, and shows all coefficient digits for :class:`~decimal.Decimal`. If ``p=0``, the decimal point is omitted unless the ``#`` option is used." -msgstr "" +msgid "" +"Scientific notation. For a given precision ``p``, formats the number in " +"scientific notation with the letter 'e' separating the coefficient from the " +"exponent. The coefficient has one digit before and ``p`` digits after the " +"decimal point, for a total of ``p + 1`` significant digits. With no " +"precision given, uses a precision of ``6`` digits after the decimal point " +"for :class:`float`, and shows all coefficient digits for " +":class:`~decimal.Decimal`. If ``p=0``, the decimal point is omitted unless " +"the ``#`` option is used." +msgstr "" +"نماد علمی. برای دقت داده‌شده ``p``، عدد را در نماد علمی با حرف 'e' که ضریب " +"را از توان جدا می‌کند، قالب‌بندی می‌کند. ضریب یک رقم پیش از نقطه اعشار و " +"``p`` رقم پس از آن دارد، که در مجموع ``p + 1`` رقم معنادار می‌شود. وقتی دقتی" +" داده نشده باشد، از دقت ``6`` رقم پس از نقطه اعشار برای :class:`float` " +"استفاده می‌کند و تمام ارقام ضریب را برای :class:`~decimal.Decimal` نمایش " +"می‌دهد. اگر ``p=0`` باشد، نقطه اعشار حذف می‌شود مگر اینکه گزینه ``#`` " +"استفاده شده باشد." -msgid "For :class:`float`, the exponent always contains at least two digits, and is zero if the value is zero." +msgid "" +"For :class:`float`, the exponent always contains at least two digits, and is" +" zero if the value is zero." msgstr "" +"برای :class:`float`، توان همیشه حداقل شامل دو رقم است و اگر مقدار صفر باشد، " +"صفر خواهد بود." msgid "``'E'``" -msgstr "" +msgstr "``'E'``" -msgid "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the separator character." +msgid "" +"Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the" +" separator character." msgstr "" +"نماد علمی. مانند ``'e'`` است، با این تفاوت که از 'E' بزرگ به‌عنوان نویسه‌ی " +"جداکننده استفاده می‌کند." msgid "``'f'``" -msgstr "" +msgstr "``'f'``" -msgid "Fixed-point notation. For a given precision ``p``, formats the number as a decimal number with exactly ``p`` digits following the decimal point. With no precision given, uses a precision of ``6`` digits after the decimal point for :class:`float`, and uses a precision large enough to show all coefficient digits for :class:`~decimal.Decimal`. If ``p=0``, the decimal point is omitted unless the ``#`` option is used." -msgstr "" +msgid "" +"Fixed-point notation. For a given precision ``p``, formats the number as a " +"decimal number with exactly ``p`` digits following the decimal point. With " +"no precision given, uses a precision of ``6`` digits after the decimal point" +" for :class:`float`, and uses a precision large enough to show all " +"coefficient digits for :class:`~decimal.Decimal`. If ``p=0``, the decimal " +"point is omitted unless the ``#`` option is used." +msgstr "" +"نماد نقطه‌ثابت. برای دقت داده‌شده ``p``، عدد را به‌صورت یک عدد اعشاری با " +"دقیقاً ``p`` رقم پس از نقطه اعشار قالب‌بندی می‌کند. اگر دقتی داده نشده باشد،" +" برای :class:`float` از دقت ``6`` رقم پس از نقطه اعشار استفاده می‌کند، و " +"برای :class:`~decimal.Decimal` از دقتی به‌اندازه کافی زیاد برای نمایش تمام " +"ارقام ضریب استفاده می‌کند. اگر ``p=0`` باشد، نقطه اعشار حذف می‌شود، مگر " +"اینکه از گزینه ``#`` استفاده شده باشد." msgid "``'F'``" -msgstr "" +msgstr "``'F'``" -msgid "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and ``inf`` to ``INF``." +msgid "" +"Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " +"``inf`` to ``INF``." msgstr "" +"نماد نقطه‌ثابت. مانند ``'f'``، اما ``nan`` را به ``NAN`` و ``inf`` را به " +"``INF`` تبدیل می‌کند." msgid "``'g'``" -msgstr "" +msgstr "``'g'``" -msgid "General format. For a given precision ``p >= 1``, this rounds the number to ``p`` significant digits and then formats the result in either fixed-point format or in scientific notation, depending on its magnitude. A precision of ``0`` is treated as equivalent to a precision of ``1``." +msgid "" +"General format. For a given precision ``p >= 1``, this rounds the number to" +" ``p`` significant digits and then formats the result in either fixed-point " +"format or in scientific notation, depending on its magnitude. A precision of" +" ``0`` is treated as equivalent to a precision of ``1``." msgstr "" +"قالب عمومی. برای دقت داده‌شده ``p >= 1``، عدد به ``p`` رقم بامعنا گرد می‌شود" +" و سپس نتیجه بسته به بزرگی آن، در قالب ممیز ثابت یا نماد علمی قالب‌بندی " +"می‌شود. دقت ``0`` معادل دقت ``1`` در نظر گرفته می‌شود." -msgid "The precise rules are as follows: suppose that the result formatted with presentation type ``'e'`` and precision ``p-1`` would have exponent ``exp``. Then, if ``m <= exp < p``, where ``m`` is -4 for floats and -6 for :class:`Decimals `, the number is formatted with presentation type ``'f'`` and precision ``p-1-exp``. Otherwise, the number is formatted with presentation type ``'e'`` and precision ``p-1``. In both cases insignificant trailing zeros are removed from the significand, and the decimal point is also removed if there are no remaining digits following it, unless the ``'#'`` option is used." -msgstr "" +msgid "" +"The precise rules are as follows: suppose that the result formatted with " +"presentation type ``'e'`` and precision ``p-1`` would have exponent ``exp``." +" Then, if ``m <= exp < p``, where ``m`` is -4 for floats and -6 for " +":class:`Decimals `, the number is formatted with " +"presentation type ``'f'`` and precision ``p-1-exp``. Otherwise, the number " +"is formatted with presentation type ``'e'`` and precision ``p-1``. In both " +"cases insignificant trailing zeros are removed from the significand, and the" +" decimal point is also removed if there are no remaining digits following " +"it, unless the ``'#'`` option is used." +msgstr "" +"قواعد دقیق به شرح زیر است: فرض کنید نتیجه‌ای که با نوع نمایش ``'e'`` و دقت " +"``p-1`` قالب‌بندی شده باشد، توان ``exp`` داشته باشد. سپس، اگر ``m <= exp < " +"p`` باشد، که در آن ``m`` برای floatها برابر با -۴ و برای :class:`Decimals " +"` برابر با -۶ است، عدد با نوع نمایش ``'f'`` و دقت " +"``p-1-exp`` قالب‌بندی می‌شود. در غیر این صورت، عدد با نوع نمایش ``'e'`` و " +"دقت ``p-1`` قالب‌بندی می‌شود. در هر دو حالت، صفرهای انتهایی بی‌اهمیت از بخش " +"معنادار (significand) حذف می‌شوند، و اگر هیچ رقمی پس از آن باقی نمانده باشد،" +" نقطه‌ی اعشار نیز حذف می‌شود، مگر آنکه از گزینه‌ی ``'#'`` استفاده شده باشد." -msgid "With no precision given, uses a precision of ``6`` significant digits for :class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result is formed from the coefficient digits of the value; scientific notation is used for values smaller than ``1e-6`` in absolute value and values where the place value of the least significant digit is larger than 1, and fixed-point notation is used otherwise." -msgstr "" +msgid "" +"With no precision given, uses a precision of ``6`` significant digits for " +":class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result" +" is formed from the coefficient digits of the value; scientific notation is " +"used for values smaller than ``1e-6`` in absolute value and values where the" +" place value of the least significant digit is larger than 1, and fixed-" +"point notation is used otherwise." +msgstr "" +"در صورتی که دقتی مشخص نشده باشد، برای :class:`float` از دقت ``6`` رقم " +"معنادار استفاده می‌شود. برای :class:`~decimal.Decimal`، ضریب نتیجه از ارقام " +"ضریب مقدار تشکیل می‌شود؛ برای مقادیری که از نظر قدر مطلق کوچک‌تر از ``1e-6``" +" هستند و برای مقادیری که ارزش مکانی کم‌اهمیت‌ترین رقم آن‌ها بزرگ‌تر از ۱ " +"است، از نماد علمی استفاده می‌شود و در غیر این صورت از نماد نقطه‌ثابت استفاده" +" می‌شود." -msgid "Positive and negative infinity, positive and negative zero, and nans, are formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, regardless of the precision." +msgid "" +"Positive and negative infinity, positive and negative zero, and nans, are " +"formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " +"regardless of the precision." msgstr "" +"بی‌نهایت مثبت و منفی، صفر مثبت و منفی و مقادیر NaN، صرف‌نظر از دقت، به‌ترتیب" +" به‌صورت ``inf``، ``-inf``، ``0``، ``-0`` و ``nan`` قالب‌بندی می‌شوند." msgid "``'G'``" -msgstr "" +msgstr "``'G'``" -msgid "General format. Same as ``'g'`` except switches to ``'E'`` if the number gets too large. The representations of infinity and NaN are uppercased, too." +msgid "" +"General format. Same as ``'g'`` except switches to ``'E'`` if the number " +"gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" +"قالب عمومی. همانند ``'g'`` است، با این تفاوت که اگر عدد بیش از حد بزرگ شود، " +"به ``'E'`` تغییر می‌کند. نمایش بی‌نهایت و NaN نیز با حروف بزرگ است." -msgid "Number. This is the same as ``'g'``, except that it uses the current locale setting to insert the appropriate digit group separators for the integral part of a number. Note that the default locale is not the system locale. Depending on your use case, you may wish to set :const:`~locale.LC_NUMERIC` with :func:`locale.setlocale` before using ``'n'``." -msgstr "" +msgid "" +"Number. This is the same as ``'g'``, except that it uses the current locale " +"setting to insert the appropriate digit group separators for the integral " +"part of a number. Note that the default locale is not the system locale. " +"Depending on your use case, you may wish to set :const:`~locale.LC_NUMERIC` " +"with :func:`locale.setlocale` before using ``'n'``." +msgstr "" +"عدد. این همان ``'g'`` است، با این تفاوت که از تنظیمات locale (locale) فعلی " +"برای درج جداکننده‌های مناسب گروه‌بندی ارقام در بخش صحیح یک عدد استفاده " +"می‌کند. توجه داشته باشید که تنظیمات locale پیش‌فرض، تنظیمات locale سیستم نیست. " +"بسته به مورد استفاده شما، ممکن است بخواهید پیش از استفاده از ``'n'``، " +":const:`~locale.LC_NUMERIC` را با :func:`locale.setlocale` تنظیم کنید." msgid "``'%'``" -msgstr "" +msgstr "``'%'``" -msgid "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) format, followed by a percent sign." +msgid "" +"Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " +"format, followed by a percent sign." msgstr "" +"درصد. عدد را در ۱۰۰ ضرب می‌کند و آن را در قالب ثابت (``'f'``) نمایش می‌دهد و" +" به دنبال آن علامت درصد قرار می‌گیرد." -msgid "For :class:`float` this is like the ``'g'`` type, except that when fixed-point notation is used to format the result, it always includes at least one digit past the decimal point, and switches to the scientific notation when ``exp >= p - 1``. When the precision is not specified, the latter will be as large as needed to represent the given value faithfully." -msgstr "" +msgid "" +"For :class:`float` this is like the ``'g'`` type, except that when fixed-" +"point notation is used to format the result, it always includes at least one" +" digit past the decimal point, and switches to the scientific notation when " +"``exp >= p - 1``. When the precision is not specified, the latter will be " +"as large as needed to represent the given value faithfully." +msgstr "" +"برای :class:`float`، این مانند نوع ``'g'`` است، با این تفاوت که هنگامی که " +"برای قالب‌بندی نتیجه از نماد نقطه‌ثابت استفاده می‌شود، همیشه حداقل یک رقم پس" +" از نقطه اعشار را شامل می‌شود و هرگاه ``exp >= p - 1`` باشد، به نماد علمی " +"تغییر می‌کند. وقتی دقت مشخص نشده باشد، دقت به‌اندازه‌ای خواهد بود که برای " +"نمایش وفادارانه‌ی مقدار داده‌شده لازم است." -msgid "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` depending on the value of ``context.capitals`` for the current decimal context." +msgid "" +"For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'``" +" depending on the value of ``context.capitals`` for the current decimal " +"context." msgstr "" +"برای :class:`~decimal.Decimal`، این معادل ``'g'`` یا ``'G'`` است، بسته به " +"مقدار ``context.capitals`` در زمینه‌ی اعشاری جاری." -msgid "The overall effect is to match the output of :func:`str` as altered by the other format modifiers." +msgid "" +"The overall effect is to match the output of :func:`str` as altered by the " +"other format modifiers." msgstr "" +"اثر کلی، مطابقت با خروجی :func:`str` است، همان‌گونه که توسط سایر " +"اصلاح‌کننده‌های قالب تغییر یافته است." -msgid "The result should be correctly rounded to a given precision ``p`` of digits after the decimal point. The rounding mode for :class:`float` matches that of the :func:`round` builtin. For :class:`~decimal.Decimal`, the rounding mode of the current :ref:`context ` will be used." +msgid "" +"The result should be correctly rounded to a given precision ``p`` of digits " +"after the decimal point. The rounding mode for :class:`float` matches that " +"of the :func:`round` builtin. For :class:`~decimal.Decimal`, the rounding " +"mode of the current :ref:`context ` will be used." msgstr "" +"نتیجه باید به‌درستی تا دقت مشخص ``p`` رقم پس از نقطه‌ی اعشار گرد شود. حالت " +"گرد کردن برای :class:`float` با حالت تابع توکار :func:`round` مطابقت دارد. " +"برای :class:`~decimal.Decimal`، از حالت گرد کردن :ref:`زمینه ` جاری استفاده می‌شود." -msgid "The available presentation types for :class:`complex` are the same as those for :class:`float` (``'%'`` is not allowed). Both the real and imaginary components of a complex number are formatted as floating-point numbers, according to the specified presentation type. They are separated by the mandatory sign of the imaginary part, the latter being terminated by a ``j`` suffix. If the presentation type is missing, the result will match the output of :func:`str` (complex numbers with a non-zero real part are also surrounded by parentheses), possibly altered by other format modifiers." -msgstr "" +msgid "" +"The available presentation types for :class:`complex` are the same as those " +"for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " +"components of a complex number are formatted as floating-point numbers, " +"according to the specified presentation type. They are separated by the " +"mandatory sign of the imaginary part, the latter being terminated by a ``j``" +" suffix. If the presentation type is missing, the result will match the " +"output of :func:`str` (complex numbers with a non-zero real part are also " +"surrounded by parentheses), possibly altered by other format modifiers." +msgstr "" +"انواع نمایش موجود برای :class:`complex` همان انواع موجود برای :class:`float`" +" هستند (``'%'`` مجاز نیست). هر دو بخش حقیقی و موهومی یک عدد مختلط، مطابق نوع" +" نمایش مشخص‌شده، به‌صورت اعداد ممیز شناور قالب‌بندی می‌شوند. این دو با علامت" +" اجباری بخش موهومی از هم جدا می‌شوند و این بخش با یک پسوند ``j`` پایان " +"می‌یابد. اگر نوع نمایش وجود نداشته باشد، نتیجه با خروجی :func:`str` مطابقت " +"خواهد داشت (اعداد مختلط با بخش حقیقی غیرصفر نیز در پرانتز قرار می‌گیرند)، که" +" ممکن است توسط سایر اصلاح‌کننده‌های قالب تغییر کند." msgid "Format examples" -msgstr "" +msgstr "نمونه‌های قالب‌بندی" -msgid "This section contains examples of the :meth:`str.format` syntax and comparison with the old ``%``-formatting." +msgid "" +"This section contains examples of the :meth:`str.format` syntax and " +"comparison with the old ``%``-formatting." msgstr "" +"این بخش شامل مثال‌هایی از نحو :meth:`str.format` و مقایسه‌ای با قالب‌بندی " +"قدیمی ``%`` است." -msgid "In most of the cases the syntax is similar to the old ``%``-formatting, with the addition of the ``{}`` and with ``:`` used instead of ``%``. For example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``." +msgid "" +"In most of the cases the syntax is similar to the old ``%``-formatting, with" +" the addition of the ``{}`` and with ``:`` used instead of ``%``. For " +"example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``." msgstr "" +"در بیشتر موارد، نحو شبیه به قالب‌بندی قدیمی ``%`` است، با اضافه شدن ``{}`` و" +" استفاده از ``:`` به‌جای ``%``. برای مثال، ``'%03.2f'`` را می‌توان به " +"``'{:03.2f}'`` تبدیل کرد." -msgid "The new format syntax also supports new and different options, shown in the following examples." +msgid "" +"The new format syntax also supports new and different options, shown in the " +"following examples." msgstr "" +"نحو جدید قالب‌بندی همچنین از گزینه‌های جدید و متفاوتی پشتیبانی می‌کند که در " +"مثال‌های زیر نشان داده شده‌اند." msgid "Accessing arguments by position::" -msgstr "" +msgstr "دسترسی به آرگومان‌ها بر اساس جایگاه::" msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" @@ -489,9 +1114,19 @@ msgid "" ">>> '{0}{1}{0}'.format('abra', 'cad') # arguments' indices can be repeated\n" "'abracadabra'" msgstr "" +">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" +"'a, b, c'\n" +">>> '{}, {}, {}'.format('a', 'b', 'c') # 3.1+ only\n" +"'a, b, c'\n" +">>> '{2}, {1}, {0}'.format('a', 'b', 'c')\n" +"'c, b, a'\n" +">>> '{2}, {1}, {0}'.format(*'abc') # unpacking argument sequence\n" +"'c, b, a'\n" +">>> '{0}{1}{0}'.format('abra', 'cad') # arguments' indices can be repeated\n" +"'abracadabra'" msgid "Accessing arguments by name::" -msgstr "" +msgstr "دسترسی به آرگومان‌ها با نام::" msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')\n" @@ -500,9 +1135,14 @@ msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(**coord)\n" "'Coordinates: 37.24N, -115.81W'" msgstr "" +">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')\n" +"'Coordinates: 37.24N, -115.81W'\n" +">>> coord = {'latitude': '37.24N', 'longitude': '-115.81W'}\n" +">>> 'Coordinates: {latitude}, {longitude}'.format(**coord)\n" +"'Coordinates: 37.24N, -115.81W'" msgid "Accessing arguments' attributes::" -msgstr "" +msgstr "دسترسی به ویژگی‌های آرگومان‌ها::" msgid "" ">>> c = 3-5j\n" @@ -518,26 +1158,43 @@ msgid "" ">>> str(Point(4, 2))\n" "'Point(4, 2)'" msgstr "" +">>> c = 3-5j\n" +">>> ('The complex number {0} is formed from the real part {0.real} '\n" +"... 'and the imaginary part {0.imag}.').format(c)\n" +"'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.'\n" +">>> class Point:\n" +"... def __init__(self, x, y):\n" +"... self.x, self.y = x, y\n" +"... def __str__(self):\n" +"... return 'Point({self.x}, {self.y})'.format(self=self)\n" +"...\n" +">>> str(Point(4, 2))\n" +"'Point(4, 2)'" msgid "Accessing arguments' items::" -msgstr "" +msgstr "دسترسی به آیتم‌های آرگومان‌ها::" msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" +">>> coord = (3, 5)\n" +">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" +"'X: 3; Y: 5'" msgid "Replacing ``%s`` and ``%r``::" -msgstr "" +msgstr "جایگزینی ``%s`` و ``%r``::" msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', 'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" msgstr "" +">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', 'test2')\n" +"\"repr() shows quotes: 'test1'; str() doesn't: test2\"" msgid "Aligning the text and specifying a width::" -msgstr "" +msgstr "تراز کردن متن و تعیین عرض::" msgid "" ">>> '{:<30}'.format('left aligned')\n" @@ -549,9 +1206,17 @@ msgid "" ">>> '{:*^30}'.format('centered') # use '*' as a fill char\n" "'***********centered***********'" msgstr "" +">>> '{:<30}'.format('left aligned')\n" +"'left aligned '\n" +">>> '{:>30}'.format('right aligned')\n" +"' right aligned'\n" +">>> '{:^30}'.format('centered')\n" +"' centered '\n" +">>> '{:*^30}'.format('centered') # use '*' as a fill char\n" +"'***********centered***********'" msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" -msgstr "" +msgstr "جایگزینی ``%+f``، ``%-f`` و ``% f`` و تعیین علامت::" msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" @@ -561,9 +1226,16 @@ msgid "" ">>> '{:-f}; {:-f}'.format(3.14, -3.14) # show only the minus -- same as '{:f}; {:f}'\n" "'3.140000; -3.140000'" msgstr "" +">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" +"'+3.140000; -3.140000'\n" +">>> '{: f}; {: f}'.format(3.14, -3.14) # show a space for positive numbers\n" +"' 3.140000; -3.140000'\n" +">>> '{:-f}; {:-f}'.format(3.14, -3.14) # show only the minus -- same as '{:f}; {:f}'\n" +"'3.140000; -3.140000'" -msgid "Replacing ``%x`` and ``%o`` and converting the value to different bases::" -msgstr "" +msgid "" +"Replacing ``%x`` and ``%o`` and converting the value to different bases::" +msgstr "جایگزینی ``%x`` و ``%o`` و تبدیل مقدار به مبناهای مختلف::" msgid "" ">>> # format also supports binary numbers\n" @@ -573,9 +1245,15 @@ msgid "" ">>> \"int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}\".format(42)\n" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" +">>> # format also supports binary numbers\n" +">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" +"'int: 42; hex: 2a; oct: 52; bin: 101010'\n" +">>> # with 0x, 0o, or 0b as prefix:\n" +">>> \"int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}\".format(42)\n" +"'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgid "Using the comma or the underscore as a digit group separator::" -msgstr "" +msgstr "استفاده از ویرگول یا زیرخط به‌عنوان جداکننده گروه ارقام::" msgid "" ">>> '{:,}'.format(1234567890)\n" @@ -593,9 +1271,23 @@ msgid "" ">>> '{:,._}'.format(123456789.123456789)\n" "'123,456,789.123_456_79'" msgstr "" +">>> '{:,}'.format(1234567890)\n" +"'1,234,567,890'\n" +">>> '{:_}'.format(1234567890)\n" +"'1_234_567_890'\n" +">>> '{:_b}'.format(1234567890)\n" +"'100_1001_1001_0110_0000_0010_1101_0010'\n" +">>> '{:_x}'.format(1234567890)\n" +"'4996_02d2'\n" +">>> '{:_}'.format(123456789.123456789)\n" +"'123_456_789.12345679'\n" +">>> '{:.,}'.format(123456789.123456789)\n" +"'123456789.123,456,79'\n" +">>> '{:,._}'.format(123456789.123456789)\n" +"'123,456,789.123_456_79'" msgid "Expressing a percentage::" -msgstr "" +msgstr "بیان یک درصد::" msgid "" ">>> points = 19\n" @@ -603,9 +1295,13 @@ msgid "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" msgstr "" +">>> points = 19\n" +">>> total = 22\n" +">>> 'Correct answers: {:.2%}'.format(points/total)\n" +"'Correct answers: 86.36%'" msgid "Using type-specific formatting::" -msgstr "" +msgstr "استفاده از قالب‌بندی مختص نوع::" msgid "" ">>> import datetime as dt\n" @@ -613,9 +1309,13 @@ msgid "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" msgstr "" +">>> import datetime as dt\n" +">>> d = dt.datetime(2010, 7, 4, 12, 15, 58)\n" +">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" +"'2010-07-04 12:15:58'" msgid "Nesting arguments and more complex examples::" -msgstr "" +msgstr "آرگومان‌های تودرتو و نمونه‌های پیچیده‌تر::" msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" @@ -645,63 +1345,191 @@ msgid "" " 10 A 12 1010\n" " 11 B 13 1011" msgstr "" +">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" +"... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" +"...\n" +"'left<<<<<<<<<<<<'\n" +"'^^^^^center^^^^^'\n" +"'>>>>>>>>>>>right'\n" +">>>\n" +">>> octets = [192, 168, 0, 1]\n" +">>> '{:02X}{:02X}{:02X}{:02X}'.format(*octets)\n" +"'C0A80001'\n" +">>> int(_, 16)\n" +"3232235521\n" +">>>\n" +">>> width = 5\n" +">>> for num in range(5,12):\n" +"... for base in 'dXob':\n" +"... print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')\n" +"... print()\n" +"...\n" +" 5 5 5 101\n" +" 6 6 6 110\n" +" 7 7 7 111\n" +" 8 8 10 1000\n" +" 9 9 11 1001\n" +" 10 A 12 1010\n" +" 11 B 13 1011" msgid "Template strings ($-strings)" -msgstr "" +msgstr "رشته‌های قالب ($-strings)" -msgid "The feature described here was introduced in Python 2.4; a simple templating method based upon regular expressions. It predates :meth:`str.format`, :ref:`formatted string literals `, and :ref:`template string literals `." +msgid "" +"The feature described here was introduced in Python 2.4; a simple templating" +" method based upon regular expressions. It predates :meth:`str.format`, " +":ref:`formatted string literals `, and :ref:`template string " +"literals `." msgstr "" +"این قابلیت که در اینجا توضیح داده شده است، در پایتون 2.4 معرفی شد؛ یک روش " +"قالب‌بندی ساده مبتنی بر عبارت‌های باقاعده. این قابلیت پیش از " +":meth:`str.format`، :ref:`formatted string literals ` و " +":ref:`template string literals ` وجود داشته است." -msgid "It is unrelated to template string literals (t-strings), which were introduced in Python 3.14. These evaluate to :class:`string.templatelib.Template` objects, found in the :mod:`string.templatelib` module." +msgid "" +"It is unrelated to template string literals (t-strings), which were " +"introduced in Python 3.14. These evaluate to " +":class:`string.templatelib.Template` objects, found in the " +":mod:`string.templatelib` module." msgstr "" +"این مورد به مقادیر لفظی رشته قالبی (t-strings)، که در پایتون 3.14 معرفی " +"شده‌اند، مربوط نمی‌شود. حاصل ارزیابی این موارد، اشیای " +":class:`string.templatelib.Template` است که در ماژول " +":mod:`string.templatelib` قرار دارند." -msgid "Template strings provide simpler string substitutions as described in :pep:`292`. A primary use case for template strings is for internationalization (i18n) since in that context, the simpler syntax and functionality makes it easier to translate than other built-in string formatting facilities in Python. As an example of a library built on template strings for i18n, see the `flufl.i18n `_ package." -msgstr "" +msgid "" +"Template strings provide simpler string substitutions as described in " +":pep:`292`. A primary use case for template strings is for " +"internationalization (i18n) since in that context, the simpler syntax and " +"functionality makes it easier to translate than other built-in string " +"formatting facilities in Python. As an example of a library built on " +"template strings for i18n, see the `flufl.i18n " +"`_ package." +msgstr "" +"رشته‌های الگو جایگزینی‌های رشته‌ای ساده‌تری را فراهم می‌کنند، همان‌طور که در" +" :pep:`292` توضیح داده شده است. یکی از کاربردهای اصلی رشته‌های الگو، " +"بین‌المللی‌سازی (i18n) است، زیرا در آن زمینه، نحو و قابلیت ساده‌تر، ترجمه‌ی " +"آن‌ها را نسبت به سایر امکانات توکار قالب‌بندی رشته در پایتون آسان‌تر " +"می‌سازد. به‌عنوان نمونه‌ای از یک کتابخانه‌ی ساخته‌شده بر پایه‌ی رشته‌های " +"الگو برای i18n، بسته‌ی `flufl.i18n " +"`_ را ببینید." -msgid "Template strings support ``$``-based substitutions, using the following rules:" +msgid "" +"Template strings support ``$``-based substitutions, using the following " +"rules:" msgstr "" +"رشته‌های قالب از جایگزینی‌های مبتنی بر ``$`` با استفاده از قوانین زیر " +"پشتیبانی می‌کنند:" msgid "``$$`` is an escape; it is replaced with a single ``$``." -msgstr "" +msgstr "``$$`` یک خنثی‌سازی است؛ با یک ``$`` جایگزین می‌شود." -msgid "``$identifier`` names a substitution placeholder matching a mapping key of ``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any case-insensitive ASCII alphanumeric string (including underscores) that starts with an underscore or ASCII letter. The first non-identifier character after the ``$`` character terminates this placeholder specification." -msgstr "" +msgid "" +"``$identifier`` names a substitution placeholder matching a mapping key of " +"``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " +"case-insensitive ASCII alphanumeric string (including underscores) that " +"starts with an underscore or ASCII letter. The first non-identifier " +"character after the ``$`` character terminates this placeholder " +"specification." +msgstr "" +"``$identifier`` نشان‌دهنده‌ی یک جای‌نگهدار جایگزینی (placeholder) است که با کلید" +" نگاشت ``\"identifier\"`` مطابقت دارد. به‌طور پیش‌فرض، ``\"identifier\"`` به" +" هر رشته‌ی الفباعددی ASCII بدون حساسیت به بزرگی و کوچکی حروف (شامل زیرخط‌ها) " +"که با زیرخط یا حرف ASCII آغاز شود، محدود است. نخستین نویسه‌ی غیرشناسه پس از " +"نویسه‌ی ``$``، مشخصات این جای‌نگهدار را پایان می‌دهد." -msgid "``${identifier}`` is equivalent to ``$identifier``. It is required when valid identifier characters follow the placeholder but are not part of the placeholder, such as ``\"${noun}ification\"``." +msgid "" +"``${identifier}`` is equivalent to ``$identifier``. It is required when " +"valid identifier characters follow the placeholder but are not part of the " +"placeholder, such as ``\"${noun}ification\"``." msgstr "" +"``${identifier}`` معادل ``$identifier`` است. هنگامی که نویسه‌های معتبر شناسه" +" پس از جای‌نگهدار (placeholder) بیایند اما بخشی از آن نباشند، استفاده از این " +"قالب الزامی است، مانند ``\"${noun}ification\"``." -msgid "Any other appearance of ``$`` in the string will result in a :exc:`ValueError` being raised." -msgstr "" +msgid "" +"Any other appearance of ``$`` in the string will result in a " +":exc:`ValueError` being raised." +msgstr "هر ظهور دیگر ``$`` در رشته، منجر به پرتاب :exc:`ValueError` خواهد شد." -msgid "The :mod:`!string` module provides a :class:`Template` class that implements these rules. The methods of :class:`Template` are:" +msgid "" +"The :mod:`!string` module provides a :class:`Template` class that implements" +" these rules. The methods of :class:`Template` are:" msgstr "" +"ماژول :mod:`!string` یک کلاس :class:`Template` ارائه می‌دهد که این قوانین را" +" پیاده‌سازی می‌کند. متدهای :class:`Template` عبارتند از:" msgid "The constructor takes a single argument which is the template string." -msgstr "" +msgstr "سازنده یک آرگومان دریافت می‌کند که رشته‌ی الگو است." -msgid "Performs the template substitution, returning a new string. *mapping* is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the keywords are the placeholders. When both *mapping* and *kwds* are given and there are duplicates, the placeholders from *kwds* take precedence." -msgstr "" +msgid "" +"Performs the template substitution, returning a new string. *mapping* is " +"any dictionary-like object with keys that match the placeholders in the " +"template. Alternatively, you can provide keyword arguments, where the " +"keywords are the placeholders. When both *mapping* and *kwds* are given and" +" there are duplicates, the placeholders from *kwds* take precedence." +msgstr "" +"جایگذاری قالب را انجام می‌دهد و یک رشته جدید برمی‌گرداند. *mapping* هر شیء " +"دیکشنری‌مانندی است که کلیدهای آن با جای‌نگهدارهای قالب مطابقت دارند. " +"به‌عنوان جایگزین، می‌توانید آرگومان‌های کلیدواژه‌ای ارائه دهید، که در آن‌ها " +"کلیدواژه‌ها همان جای‌نگهدارها هستند. وقتی هر دو *mapping* و *kwds* داده شده" +" باشند و جای‌نگهدارهای تکراری وجود داشته باشد، جای‌نگهدارهای *kwds* اولویت" +" دارند." -msgid "Like :meth:`substitute`, except that if placeholders are missing from *mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the original placeholder will appear in the resulting string intact. Also, unlike with :meth:`substitute`, any other appearances of the ``$`` will simply return ``$`` instead of raising :exc:`ValueError`." -msgstr "" +msgid "" +"Like :meth:`substitute`, except that if placeholders are missing from " +"*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " +"original placeholder will appear in the resulting string intact. Also, " +"unlike with :meth:`substitute`, any other appearances of the ``$`` will " +"simply return ``$`` instead of raising :exc:`ValueError`." +msgstr "" +"مانند :meth:`substitute`، با این تفاوت که اگر جای‌نگهدارها در *mapping* و " +"*kwds* موجود نباشند، به‌جای پرتاب یک استثنای :exc:`KeyError`، جای‌نگهدار اصلی " +"به‌صورت دست‌نخورده در رشته‌ی حاصل ظاهر خواهد شد. همچنین، برخلاف " +":meth:`substitute`، هر ظهور دیگرِ ``$`` صرفاً ``$`` را برمی‌گرداند، به‌جای " +"پرتاب :exc:`ValueError`." -msgid "While other exceptions may still occur, this method is called \"safe\" because it always tries to return a usable string instead of raising an exception. In another sense, :meth:`safe_substitute` may be anything other than safe, since it will silently ignore malformed templates containing dangling delimiters, unmatched braces, or placeholders that are not valid Python identifiers." -msgstr "" +msgid "" +"While other exceptions may still occur, this method is called \"safe\" " +"because it always tries to return a usable string instead of raising an " +"exception. In another sense, :meth:`safe_substitute` may be anything other " +"than safe, since it will silently ignore malformed templates containing " +"dangling delimiters, unmatched braces, or placeholders that are not valid " +"Python identifiers." +msgstr "" +"اگرچه ممکن است همچنان استثناهای دیگری رخ دهند، این متد «امن» نامیده می‌شود، " +"زیرا همیشه تلاش می‌کند به جای پرتاب استثنا، رشته‌ای قابل استفاده برگرداند. " +"از معنایی دیگر، :meth:`safe_substitute` ممکن است هر چیزی باشد جز امن، زیرا " +"قالب‌های نادرست حاوی جداکننده‌های معلق، آکولادهای ناهم‌خوان، یا جای‌نگهدارهایی " +"که شناسه‌های معتبر پایتون نیستند را بی‌سرصدا نادیده می‌گیرد." -msgid "Returns ``False`` if the template has invalid placeholders that will cause :meth:`substitute` to raise :exc:`ValueError`." +msgid "" +"Returns ``False`` if the template has invalid placeholders that will cause " +":meth:`substitute` to raise :exc:`ValueError`." msgstr "" +"اگر قالب دارای جای‌نگهدارنده‌های نامعتبری باشد که باعث شود " +":meth:`substitute` یک :exc:`ValueError` پرتاب کند، ``False`` را برمی‌گرداند." -msgid "Returns a list of the valid identifiers in the template, in the order they first appear, ignoring any invalid identifiers." +msgid "" +"Returns a list of the valid identifiers in the template, in the order they " +"first appear, ignoring any invalid identifiers." msgstr "" +"فهرستی از شناسه‌های معتبر موجود در قالب را به ترتیبی که برای نخستین بار ظاهر" +" می‌شوند برمی‌گرداند و از هر شناسه نامعتبری چشم‌پوشی می‌کند." msgid ":class:`Template` instances also provide one public data attribute:" msgstr "" +"نمونه‌های :class:`Template` همچنین یک ویژگی داده‌ای عمومی ارائه می‌دهند:" -msgid "This is the object passed to the constructor's *template* argument. In general, you shouldn't change it, but read-only access is not enforced." +msgid "" +"This is the object passed to the constructor's *template* argument. In " +"general, you shouldn't change it, but read-only access is not enforced." msgstr "" +"این همان شیءای است که به آرگومان *template* سازنده داده می‌شود. به‌طور کلی، " +"نباید آن را تغییر دهید، اما دسترسی فقط‌خواندنی اجباری نیست." msgid "Here is an example of how to use a Template::" -msgstr "" +msgstr "در اینجا مثالی از چگونگی استفاده از یک Template آورده شده است::" msgid "" ">>> from string import Template\n" @@ -720,102 +1548,218 @@ msgid "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" msgstr "" +">>> from string import Template\n" +">>> s = Template('$who likes $what')\n" +">>> s.substitute(who='tim', what='kung pao')\n" +"'tim likes kung pao'\n" +">>> d = dict(who='tim')\n" +">>> Template('Give $who $100').substitute(d)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Invalid placeholder in string: line 1, col 11\n" +">>> Template('$who likes $what').substitute(d)\n" +"Traceback (most recent call last):\n" +"...\n" +"KeyError: 'what'\n" +">>> Template('$who likes $what').safe_substitute(d)\n" +"'tim likes $what'" -msgid "Advanced usage: you can derive subclasses of :class:`Template` to customize the placeholder syntax, delimiter character, or the entire regular expression used to parse template strings. To do this, you can override these class attributes:" +msgid "" +"Advanced usage: you can derive subclasses of :class:`Template` to customize " +"the placeholder syntax, delimiter character, or the entire regular " +"expression used to parse template strings. To do this, you can override " +"these class attributes:" msgstr "" +"استفاده پیشرفته: شما می‌توانید با مشتق کردن زیرکلاس‌هایی از " +":class:`Template`، سینتکس جای‌نگدار، نویسه‌ی جداکننده، یا کل عبارت باقاعده‌ی " +"مورد استفاده برای تجزیه‌ی رشته‌های قالب را سفارشی کنید. برای این کار، " +"می‌توانید این ویژگی‌های کلاس را بازنویسی کنید:" -msgid "*delimiter* -- This is the literal string describing a placeholder introducing delimiter. The default value is ``$``. Note that this should *not* be a regular expression, as the implementation will call :meth:`re.escape` on this string as needed. Note further that you cannot change the delimiter after class creation (i.e. a different delimiter must be set in the subclass's class namespace)." -msgstr "" +msgid "" +"*delimiter* -- This is the literal string describing a placeholder " +"introducing delimiter. The default value is ``$``. Note that this should " +"*not* be a regular expression, as the implementation will call " +":meth:`re.escape` on this string as needed. Note further that you cannot " +"change the delimiter after class creation (i.e. a different delimiter must " +"be set in the subclass's class namespace)." +msgstr "" +"*delimiter* -- این رشته‌ی تحت‌اللفظی، جداکننده‌ی معرف جای‌نگهدار را توصیف می‌کند." +" مقدار پیش‌فرض ``$`` است. توجه داشته باشید که این *نباید* یک عبارت باقاعده " +"باشد، زیرا پیاده‌سازی در صورت نیاز :meth:`re.escape` را روی این رشته " +"فراخوانی می‌کند. همچنین توجه داشته باشید که نمی‌توانید جداکننده را پس از " +"ایجاد کلاس تغییر دهید (یعنی یک جداکننده‌ی متفاوت باید در فضای نام کلاسِ " +"زیرکلاس تنظیم شود)." -msgid "*idpattern* -- This is the regular expression describing the pattern for non-braced placeholders. The default value is the regular expression ``(?a:[_a-z][_a-z0-9]*)``. If this is given and *braceidpattern* is ``None`` this pattern will also apply to braced placeholders." +msgid "" +"*idpattern* -- This is the regular expression describing the pattern for " +"non-braced placeholders. The default value is the regular expression " +"``(?a:[_a-z][_a-z0-9]*)``. If this is given and *braceidpattern* is " +"``None`` this pattern will also apply to braced placeholders." msgstr "" +"*idpattern* -- این عبارت باقاعدهی است که الگوی جای‌نگهدارهای بدون آکولاد را توصیف" +" می‌کند. مقدار پیش‌فرض، عبارت باقاعده ``(?a:[_a-z][_a-z0-9]*)`` است. اگر این " +"مقدار داده شده باشد و *braceidpattern* برابر ``None`` باشد، این الگو برای " +"جای‌نگهدارهای دارای آکولاد نیز اعمال خواهد شد." -msgid "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with some non-ASCII characters. That's why we use the local ``a`` flag here." +msgid "" +"Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with" +" some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" +"از آن‌جا که *flags* پیش‌فرض ``re.IGNORECASE`` است، الگوی ``[a-z]`` می‌تواند " +"با برخی نویسه‌های غیر ASCII تطابق داشته باشد. به همین دلیل، ما در اینجا از " +"پرچم محلی ``a`` استفاده می‌کنیم." -msgid "*braceidpattern* can be used to define separate patterns used inside and outside the braces." +msgid "" +"*braceidpattern* can be used to define separate patterns used inside and " +"outside the braces." msgstr "" +"می‌توان از *braceidpattern* برای تعریف الگوهای جداگانه‌ای که در داخل و خارج" +" از آکولادها استفاده می‌شوند، استفاده کرد." -msgid "*braceidpattern* -- This is like *idpattern* but describes the pattern for braced placeholders. Defaults to ``None`` which means to fall back to *idpattern* (i.e. the same pattern is used both inside and outside braces). If given, this allows you to define different patterns for braced and unbraced placeholders." -msgstr "" +msgid "" +"*braceidpattern* -- This is like *idpattern* but describes the pattern for " +"braced placeholders. Defaults to ``None`` which means to fall back to " +"*idpattern* (i.e. the same pattern is used both inside and outside braces). " +"If given, this allows you to define different patterns for braced and " +"unbraced placeholders." +msgstr "" +"*braceidpattern* — این مانند *idpattern* است، اما الگوی جای‌نگهدارهای دارای " +"آکولاد را توصیف می‌کند. پیش‌فرض آن ``None`` است که به معنای بازگشت به " +"*idpattern* است (یعنی هم داخل آکولادها و هم خارج از آن‌ها از یک الگو استفاده" +" می‌شود). اگر داده شود، این به شما امکان می‌دهد الگوهای متفاوتی برای " +"جای‌نگهدارهای دارای آکولاد و بدون آکولاد تعریف کنید." -msgid "*flags* -- The regular expression flags that will be applied when compiling the regular expression used for recognizing substitutions. The default value is ``re.IGNORECASE``. Note that ``re.VERBOSE`` will always be added to the flags, so custom *idpattern*\\ s must follow conventions for verbose regular expressions." -msgstr "" +msgid "" +"*flags* -- The regular expression flags that will be applied when compiling " +"the regular expression used for recognizing substitutions. The default " +"value is ``re.IGNORECASE``. Note that ``re.VERBOSE`` will always be added " +"to the flags, so custom *idpattern*\\ s must follow conventions for verbose " +"regular expressions." +msgstr "" +"*flags* -- پرچم‌های عبارت باقاعده که هنگام کامپایل عبارت باقاعده‌ی مورد " +"استفاده برای تشخیص جایگزینی‌ها اعمال خواهند شد. مقدار پیش‌فرض " +"``re.IGNORECASE`` است. توجه داشته باشید که ``re.VERBOSE`` همواره به پرچم‌ها " +"اضافه خواهد شد، بنابراین *idpattern*\\ s سفارشی باید از قراردادهای عبارت‌های" +" باقاعده پرجزئیات (verbose) پیروی کنند." -msgid "Alternatively, you can provide the entire regular expression pattern by overriding the class attribute *pattern*. If you do this, the value must be a regular expression pattern string, or a compiled regular expression object, with four named capturing groups. The capturing groups correspond to the rules given above, along with the invalid placeholder rule:" -msgstr "" +msgid "" +"Alternatively, you can provide the entire regular expression pattern by " +"overriding the class attribute *pattern*. If you do this, the value must be" +" a regular expression pattern string, or a compiled regular expression " +"object, with four named capturing groups. The capturing groups correspond " +"to the rules given above, along with the invalid placeholder rule:" +msgstr "" +"به‌عنوان جایگزین، می‌توانید کل الگوی عبارت باقاعده را با بازنویسی ویژگی کلاس" +" *pattern* فراهم کنید. اگر این کار را انجام دهید، مقدار باید یک رشته‌ی الگوی" +" عبارت باقاعده یا یک شیء عبارت باقاعده‌ی کامپایل‌شده، با چهار گروه ثبت‌کننده" +" نام‌دار باشد. گروه‌های ثبت‌کننده با قوانین بیان‌شده در بالا، به‌همراه قانون" +" جای‌نگهدار نامعتبر، مطابقت دارند:" -msgid "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the default pattern." +msgid "" +"*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " +"default pattern." msgstr "" +"*escaped* -- این گروه با دنباله خنثی‌سازی، برای مثال ``$$``، در الگوی " +"پیش‌فرض مطابقت دارد." -msgid "*named* -- This group matches the unbraced placeholder name; it should not include the delimiter in capturing group." +msgid "" +"*named* -- This group matches the unbraced placeholder name; it should not " +"include the delimiter in capturing group." msgstr "" +"*named* -- این گروه با نام جای‌نگهدار بدون آکولاد مطابقت دارد؛ نباید جداکننده " +"را در گروه گیرانداز بگنجاند." -msgid "*braced* -- This group matches the brace enclosed placeholder name; it should not include either the delimiter or braces in the capturing group." +msgid "" +"*braced* -- This group matches the brace enclosed placeholder name; it " +"should not include either the delimiter or braces in the capturing group." msgstr "" +"*braced* -- این گروه با نام جای‌نگهدار (placeholder) محصور در آکولاد مطابقت " +"دارد؛ نباید در گروه ثبت‌کننده (capturing group) شامل جداکننده یا آکولادها باشد." -msgid "*invalid* -- This group matches any other delimiter pattern (usually a single delimiter), and it should appear last in the regular expression." +msgid "" +"*invalid* -- This group matches any other delimiter pattern (usually a " +"single delimiter), and it should appear last in the regular expression." msgstr "" +"*invalid* -- این گروه با هر الگوی جداکننده دیگری (معمولاً یک جداکننده) " +"مطابقت دارد و باید در انتهای عبارت باقاعده قرار گیرد." -msgid "The methods on this class will raise :exc:`ValueError` if the pattern matches the template without one of these named groups matching." +msgid "" +"The methods on this class will raise :exc:`ValueError` if the pattern " +"matches the template without one of these named groups matching." msgstr "" +"متدهای این کلاس در صورتی استثنای :exc:`ValueError` را پرتاب می‌کنند که الگو " +"با قالب تطبیق داشته باشد، بدون این‌که یکی از این گروه‌های نام‌دار تطبیق " +"یافته باشد." msgid "Helper functions" -msgstr "" +msgstr "توابع کمکی" -msgid "Split the argument into words using :meth:`str.split`, capitalize each word using :meth:`str.capitalize`, and join the capitalized words using :meth:`str.join`. If the optional second argument *sep* is absent or ``None``, runs of whitespace characters are replaced by a single space and leading and trailing whitespace are removed, otherwise *sep* is used to split and join the words." -msgstr "" +msgid "" +"Split the argument into words using :meth:`str.split`, capitalize each word " +"using :meth:`str.capitalize`, and join the capitalized words using " +":meth:`str.join`. If the optional second argument *sep* is absent or " +"``None``, runs of whitespace characters are replaced by a single space and " +"leading and trailing whitespace are removed, otherwise *sep* is used to " +"split and join the words." +msgstr "" +"آرگومان را با استفاده از :meth:`str.split` به کلمات تقسیم کنید، هر کلمه را " +"با استفاده از :meth:`str.capitalize` حرف اول بزرگ کنید، و کلمات با حرف اول " +"بزرگ را با استفاده از :meth:`str.join` به‌هم بپیوندید. اگر آرگومان دوم " +"اختیاری *sep* وجود نداشته باشد یا ``None`` باشد، دنباله‌هایی از نویسه‌های " +"فضای خالی با یک فاصله جایگزین می‌شوند و فضاهای خالی ابتدا و انتها حذف " +"می‌شوند، در غیر این صورت از *sep* برای تقسیم و به‌هم پیوستن کلمات استفاده " +"می‌شود." msgid "{} (curly brackets)" -msgstr "" +msgstr "{} (آکولاد)" msgid "in string formatting" -msgstr "" +msgstr "در قالب‌بندی رشته" msgid ". (dot)" -msgstr "" +msgstr ". (نقطه)" msgid "[] (square brackets)" -msgstr "" +msgstr "[] (کروشه)" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" msgid ": (colon)" -msgstr "" +msgstr ": (دونقطه)" msgid "< (less)" -msgstr "" +msgstr "< (کمتر)" msgid "> (greater)" -msgstr "" +msgstr "> (بزرگ‌تر)" msgid "= (equals)" -msgstr "" +msgstr "= (برابر)" msgid "^ (caret)" -msgstr "" +msgstr "^ (caret)" msgid "+ (plus)" -msgstr "" +msgstr "+ (به‌علاوه)" msgid "- (minus)" -msgstr "" +msgstr "- (منها)" msgid "z" -msgstr "" +msgstr "z" msgid "# (hash)" -msgstr "" +msgstr "# (هش)" msgid ", (comma)" -msgstr "" +msgstr ", (کاما)" msgid "_ (underscore)" -msgstr "" +msgstr "_ (زیرخط)" msgid "$ (dollar)" -msgstr "" +msgstr "$ (دلار)" msgid "in template strings" -msgstr "" +msgstr "در رشته‌های قالبی" diff --git a/library/string.templatelib.po b/library/string.templatelib.po index 0eb507394..5146b56b4 100644 --- a/library/string.templatelib.po +++ b/library/string.templatelib.po @@ -20,28 +20,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid ":mod:`!string.templatelib` --- Support for template string literals" -msgstr "" +msgstr ":mod:`!string.templatelib` --- پشتیبانی از رشته‌قالب‌های تحت‌اللفظی" msgid "**Source code:** :source:`Lib/string/templatelib.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/string/templatelib.py`" msgid ":ref:`Format strings `" -msgstr "" +msgstr ":ref:`رشته‌های قالب‌بندی `" msgid ":ref:`Template string literal (t-string) syntax `" -msgstr "" +msgstr ":ref:`سینتکس رشته‌ی الگویی (t-string) `" msgid ":pep:`750`" -msgstr "" +msgstr ":pep:`750`" msgid "Template strings" -msgstr "" +msgstr "رشته‌های قالب" -msgid "Template strings are a mechanism for custom string processing. They have the full flexibility of Python's :ref:`f-strings`, but return a :class:`Template` instance that gives access to the static and interpolated (in curly brackets) parts of a string *before* they are combined." +msgid "" +"Template strings are a mechanism for custom string processing. They have the" +" full flexibility of Python's :ref:`f-strings`, but return a " +":class:`Template` instance that gives access to the static and interpolated " +"(in curly brackets) parts of a string *before* they are combined." msgstr "" +"رشته‌های الگویی سازوکاری برای پردازش سفارشی رشته‌ها هستند. آن‌ها " +"انعطاف‌پذیری کامل :ref:`f-strings` پایتون را دارند، اما یک نمونه " +":class:`Template` برمی‌گردانند که امکان دسترسی به بخش‌های ایستا و " +"درون‌یابی‌شده (داخل آکولادها) از یک رشته را *پیش از* ترکیب شدن آن‌ها می‌دهد." -msgid "To write a t-string, use a ``'t'`` prefix instead of an ``'f'``, like so:" +msgid "" +"To write a t-string, use a ``'t'`` prefix instead of an ``'f'``, like so:" msgstr "" +"برای نوشتن یک تی‌استرینگ (t-string)، به‌جای پیشوند ``'f'`` از پیشوند ``'t'``" +" استفاده کنید، به این صورت:" msgid "" ">>> pi = 3.14\n" @@ -51,146 +62,301 @@ msgid "" " interpolations=(Interpolation(3.14, 'pi', 's', ''),)\n" ")" msgstr "" +">>> pi = 3.14\n" +">>> t't-strings are new in Python {pi!s}!'\n" +"Template(\n" +" strings=('t-strings are new in Python ', '!'),\n" +" interpolations=(Interpolation(3.14, 'pi', 's', ''),)\n" +")" msgid "Types" -msgstr "" +msgstr "انواع" -msgid "The :class:`!Template` class describes the contents of a template string. It is immutable, meaning that attributes of a template cannot be reassigned." +msgid "" +"The :class:`!Template` class describes the contents of a template string. It" +" is immutable, meaning that attributes of a template cannot be reassigned." msgstr "" +"کلاس :class:`!Template` محتوای یک رشته‌ی قالب را توصیف می‌کند. این کلاس " +"تغییرناپذیر است، به این معنا که ویژگی‌های یک قالب قابل انتساب مجدد نیستند." -msgid "The most common way to create a :class:`!Template` instance is to use the :ref:`template string literal syntax `. This syntax is identical to that of :ref:`f-strings `, except that it uses a ``t`` prefix in place of an ``f``:" +msgid "" +"The most common way to create a :class:`!Template` instance is to use the " +":ref:`template string literal syntax `. This syntax is identical " +"to that of :ref:`f-strings `, except that it uses a ``t`` prefix " +"in place of an ``f``:" msgstr "" +"رایج‌ترین روش برای ایجاد نمونه‌ای از :class:`!Template`، استفاده از " +":ref:`نحو لفظی رشته‌ی الگو ` است. این نحو دقیقاً مشابه نحو " +":ref:`اف‌استرینگ‌ها ` است، با این تفاوت که از پیشوند ``t`` به‌جای" +" ``f`` استفاده می‌کند:" -msgid "Templates are stored as sequences of literal :attr:`~Template.strings` and dynamic :attr:`~Template.interpolations`. A :attr:`~Template.values` attribute holds the values of the interpolations:" +msgid "" +"Templates are stored as sequences of literal :attr:`~Template.strings` and " +"dynamic :attr:`~Template.interpolations`. A :attr:`~Template.values` " +"attribute holds the values of the interpolations:" msgstr "" +"قالب‌ها به‌صورت دنباله‌هایی از :attr:`~Template.strings` تحت‌اللفظی و " +":attr:`~Template.interpolations` پویا ذخیره می‌شوند. یک ویژگی " +":attr:`~Template.values` مقادیر درون‌یابی‌ها را نگه می‌دارد:" -msgid "The :attr:`!strings` tuple has one more element than :attr:`!interpolations` and :attr:`!values`; the interpolations “belong” between the strings. This may be easier to understand when tuples are aligned" +msgid "" +"The :attr:`!strings` tuple has one more element than :attr:`!interpolations`" +" and :attr:`!values`; the interpolations “belong” between the strings. This " +"may be easier to understand when tuples are aligned" msgstr "" +"تاپل :attr:`!strings` یک عنصر بیشتر از :attr:`!interpolations` و " +":attr:`!values` دارد؛ درون‌یابی‌ها (interpolations) بین رشته‌ها قرار " +"می‌گیرند. درک این موضوع هنگامی که تاپل‌ها هم‌تراز باشند آسان‌تر است" msgid "" "template.strings: ('Ah! We do have ', '.')\n" "template.values: ( 'Camembert', )" msgstr "" +"template.strings: ('Ah! We do have ', '.')\n" +"template.values: ( 'Camembert', )" msgid "Attributes" -msgstr "" +msgstr "ویژگی‌ها" msgid "A :class:`tuple` of the static strings in the template." -msgstr "" +msgstr "یک :class:`tuple` از رشته‌های ثابت در الگو." msgid "Empty strings *are* included in the tuple:" -msgstr "" +msgstr "رشته‌های خالی در تاپل *گنجانده شده‌اند*:" -msgid "The ``strings`` tuple is never empty, and always contains one more string than the ``interpolations`` and ``values`` tuples:" +msgid "" +"The ``strings`` tuple is never empty, and always contains one more string " +"than the ``interpolations`` and ``values`` tuples:" msgstr "" +"تاپل ``strings`` هرگز خالی نیست و همیشه شامل یک رشته بیشتر از تاپل‌های " +"``interpolations`` و ``values`` است:" msgid "A :class:`tuple` of the interpolations in the template." -msgstr "" +msgstr "یک :class:`tuple` از درون‌یابی‌ها (interpolations) در قالب." -msgid "The ``interpolations`` tuple may be empty and always contains one fewer values than the ``strings`` tuple:" +msgid "" +"The ``interpolations`` tuple may be empty and always contains one fewer " +"values than the ``strings`` tuple:" msgstr "" +"تاپل ``interpolations`` ممکن است خالی باشد و همواره یک مقدار کمتر از تاپل " +"``strings`` دارد:" msgid "A tuple of all interpolated values in the template." -msgstr "" +msgstr "تاپلی از تمام مقادیر درون‌یابی‌شده در قالب." -msgid "The ``values`` tuple always has the same length as the ``interpolations`` tuple. It is always equivalent to ``tuple(i.value for i in template.interpolations)``." +msgid "" +"The ``values`` tuple always has the same length as the ``interpolations`` " +"tuple. It is always equivalent to ``tuple(i.value for i in " +"template.interpolations)``." msgstr "" +"تاپل ``values`` همیشه طولی برابر با تاپل ``interpolations`` دارد. این تاپل " +"همیشه معادل ``tuple(i.value for i in template.interpolations)`` است." msgid "Methods" -msgstr "" +msgstr "متدها" -msgid "While literal syntax is the most common way to create a :class:`!Template`, it is also possible to create them directly using the constructor:" +msgid "" +"While literal syntax is the most common way to create a :class:`!Template`, " +"it is also possible to create them directly using the constructor:" msgstr "" +"هرچند سینتکس لفظی رایج‌ترین روش برای ایجاد یک :class:`!Template` است، اما " +"می‌توان آن‌ها را مستقیماً با استفاده از سازنده نیز ایجاد کرد:" -msgid "If multiple strings are passed consecutively, they will be concatenated into a single value in the :attr:`~Template.strings` attribute. For example, the following code creates a :class:`Template` with a single final string:" +msgid "" +"If multiple strings are passed consecutively, they will be concatenated into" +" a single value in the :attr:`~Template.strings` attribute. For example, the" +" following code creates a :class:`Template` with a single final string:" msgstr "" +"اگر چندین رشته به‌صورت متوالی ارسال شوند، به یک مقدار واحد در ویژگی " +":attr:`~Template.strings` الحاق می‌شوند. برای مثال، کد زیر یک " +":class:`Template` با یک رشته نهایی واحد ایجاد می‌کند:" -msgid "If multiple interpolations are passed consecutively, they will be treated as separate interpolations and an empty string will be inserted between them. For example, the following code creates a template with empty placeholders in the :attr:`~Template.strings` attribute:" +msgid "" +"If multiple interpolations are passed consecutively, they will be treated as" +" separate interpolations and an empty string will be inserted between them. " +"For example, the following code creates a template with empty placeholders " +"in the :attr:`~Template.strings` attribute:" msgstr "" +"اگر چند درون‌یابی (interpolation) به‌صورت متوالی ارسال شوند، به‌عنوان " +"درون‌یابی‌های جداگانه در نظر گرفته می‌شوند و یک رشته خالی بین آن‌ها درج " +"می‌شود. برای مثال، کد زیر یک قالب با جای‌نگهدارهای خالی در ویژگی " +":attr:`~Template.strings` ایجاد می‌کند:" -msgid "Iterate over the template, yielding each non-empty string and :class:`Interpolation` in the correct order:" +msgid "" +"Iterate over the template, yielding each non-empty string and " +":class:`Interpolation` in the correct order:" msgstr "" +"قالب را پیمایش می‌کند و هر رشته غیرخالی و :class:`Interpolation` را به ترتیب" +" صحیح برمی‌گرداند:" msgid "Empty strings are **not** included in the iteration:" -msgstr "" +msgstr "رشته‌های خالی در تکرار **گنجانده نمی‌شوند**:" -msgid "Concatenate this template with another, returning a new :class:`!Template` instance:" +msgid "" +"Concatenate this template with another, returning a new :class:`!Template` " +"instance:" msgstr "" +"این قالب را با دیگری الحاق می‌کند و یک نمونه‌ی جدید از :class:`!Template` " +"برمی‌گرداند:" -msgid "Concatenating a :class:`!Template` and a ``str`` is **not** supported. This is because it is unclear whether the string should be treated as a static string or an interpolation. If you want to concatenate a :class:`!Template` with a string, you should either wrap the string directly in a :class:`!Template` (to treat it as a static string) or use an :class:`!Interpolation` (to treat it as dynamic):" -msgstr "" +msgid "" +"Concatenating a :class:`!Template` and a ``str`` is **not** supported. This " +"is because it is unclear whether the string should be treated as a static " +"string or an interpolation. If you want to concatenate a :class:`!Template` " +"with a string, you should either wrap the string directly in a " +":class:`!Template` (to treat it as a static string) or use an " +":class:`!Interpolation` (to treat it as dynamic):" +msgstr "" +"الحاق یک :class:`!Template` و یک ``str`` پشتیبانی **نمی‌شود**. این به این " +"دلیل است که مشخص نیست آیا باید با رشته به‌عنوان یک رشته ایستا رفتار شود یا " +"به‌عنوان یک درون‌یابی (interpolation). اگر بخواهید یک :class:`!Template` را " +"با یک رشته الحاق کنید، باید یا رشته را مستقیماً در یک :class:`!Template` " +"قرار دهید (تا به‌عنوان یک رشته ایستا با آن رفتار شود) یا از یک " +":class:`!Interpolation` استفاده کنید (تا به‌عنوان پویا با آن رفتار شود):" -msgid "The :class:`!Interpolation` type represents an expression inside a template string. It is immutable, meaning that attributes of an interpolation cannot be reassigned." +msgid "" +"The :class:`!Interpolation` type represents an expression inside a template " +"string. It is immutable, meaning that attributes of an interpolation cannot " +"be reassigned." msgstr "" +"نوع :class:`!Interpolation` نشان‌دهنده‌ی یک عبارت درون یک رشته‌ی قالب است. این" +" نوع تغییرناپذیر است، به این معنا که ویژگی‌های یک درون‌یابی (interpolation) " +"را نمی‌توان مجدداً مقداردهی کرد." -msgid "Interpolations support pattern matching, allowing you to match against their attributes with the :ref:`match statement `:" +msgid "" +"Interpolations support pattern matching, allowing you to match against their" +" attributes with the :ref:`match statement `:" msgstr "" +"درون‌یابی‌ها (interpolations) از تطبیق الگو پشتیبانی می‌کنند و به شما امکان" +" می‌دهند با استفاده از :ref:`دستور match `، آن‌ها را بر اساس " +"ویژگی‌هایشان تطبیق دهید:" -msgid "Interpolations are :ref:`generic ` over the types of their values." -msgstr "" +msgid "" +"Interpolations are :ref:`generic ` over the types of their values." +msgstr "درون‌یابی‌ها نسبت به انواع مقدارهایشان :ref:`عام ` هستند." msgid "The evaluated value of the interpolation." -msgstr "" +msgstr "مقدار ارزیابی‌شده‌ی درون‌یابی." -msgid "For interpolations created by t-string literals, :attr:`!expression` is the expression text found inside the curly brackets (``{`` & ``}``), including any whitespace, excluding the curly brackets themselves, and ending before the first ``!``, ``:``, or ``=`` if any is present. For manually created interpolations, :attr:`!expression` is the arbitrary string provided when constructing the interpolation instance." -msgstr "" +msgid "" +"For interpolations created by t-string literals, :attr:`!expression` is the " +"expression text found inside the curly brackets (``{`` & ``}``), including " +"any whitespace, excluding the curly brackets themselves, and ending before " +"the first ``!``, ``:``, or ``=`` if any is present. For manually created " +"interpolations, :attr:`!expression` is the arbitrary string provided when " +"constructing the interpolation instance." +msgstr "" +"برای درون‌یابی‌های ایجادشده با مقادیر لفظی t-string، :attr:`!expression` متن" +" عبارتی است که درون آکولادها (``{`` و ``}``) یافت می‌شود؛ این متن شامل " +"هرگونه فضای خالی است، خود آکولادها را شامل نمی‌شود و در صورت وجود هرکدام، " +"پیش از نخستین ``!``، ``:`` یا ``=`` پایان می‌یابد. برای درون‌یابی‌های " +"ایجادشده به‌صورت دستی، :attr:`!expression` رشته‌ی دلخواهی است که هنگام ساخت " +"نمونه‌ی درون‌یابی ارائه می‌شود." -msgid "We recommend using valid Python expressions or the empty string for the ``expression`` field of manually created :class:`!Interpolation` instances, although this is not enforced at runtime." +msgid "" +"We recommend using valid Python expressions or the empty string for the " +"``expression`` field of manually created :class:`!Interpolation` instances, " +"although this is not enforced at runtime." msgstr "" +"توصیه می‌کنیم از عبارات معتبر پایتون یا رشته خالی برای فیلد ``expression`` " +"نمونه‌های :class:`!Interpolation` که به‌صورت دستی ایجاد شده‌اند استفاده " +"کنید، اگرچه این موضوع در ران‌تایم اعمال نمی‌شود." msgid "The conversion to apply to the value, or ``None``." -msgstr "" +msgstr "تبدیلی که باید روی مقدار اعمال شود، یا ``None``." -msgid "The :attr:`!conversion` is the optional conversion to apply to the value:" -msgstr "" +msgid "" +"The :attr:`!conversion` is the optional conversion to apply to the value:" +msgstr ":attr:`!conversion` تبدیل اختیاری برای اعمال روی مقدار است:" -msgid "Unlike f-strings, where conversions are applied automatically, the expected behavior with t-strings is that code that *processes* the :class:`!Template` will decide how to interpret and whether to apply the :attr:`!conversion`. For convenience, the :func:`convert` function can be used to mimic f-string conversion semantics." -msgstr "" +msgid "" +"Unlike f-strings, where conversions are applied automatically, the expected " +"behavior with t-strings is that code that *processes* the :class:`!Template`" +" will decide how to interpret and whether to apply the :attr:`!conversion`. " +"For convenience, the :func:`convert` function can be used to mimic f-string " +"conversion semantics." +msgstr "" +"برخلاف اف‌استرینگ‌ها، که در آن‌ها تبدیل‌ها به‌صورت خودکار اعمال می‌شوند، " +"رفتار مورد انتظار در تی‌استرینگ‌ها (t-strings) این است که کدی که " +":class:`!Template` را *پردازش می‌کند*، تصمیم بگیرد که :attr:`!conversion` را" +" چگونه تفسیر کند و آیا آن را اعمال کند یا خیر. برای سهولت، می‌توان از تابع " +":func:`convert` برای تقلید از رفتار تبدیل‌ها در اف‌استرینگ‌ها استفاده کرد." msgid "The format specification to apply to the value." -msgstr "" +msgstr "مشخصات قالب‌بندی برای اعمال روی مقدار." -msgid "The :attr:`!format_spec` is an optional, arbitrary string used as the format specification to present the value:" +msgid "" +"The :attr:`!format_spec` is an optional, arbitrary string used as the format" +" specification to present the value:" msgstr "" +":attr:`!format_spec` یک رشته‌ی اختیاری و دلخواه است که به‌عنوان مشخصه قالب " +"برای نمایش مقدار استفاده می‌شود:" -msgid "Unlike f-strings, where format specifications are applied automatically via the :func:`format` protocol, the expected behavior with t-strings is that code that *processes* the interpolation will decide how to interpret and whether to apply the format specification. As a result, :attr:`!format_spec` values in interpolations can be arbitrary strings, including those that do not conform to the :func:`format` protocol." -msgstr "" +msgid "" +"Unlike f-strings, where format specifications are applied automatically via " +"the :func:`format` protocol, the expected behavior with t-strings is that " +"code that *processes* the interpolation will decide how to interpret and " +"whether to apply the format specification. As a result, :attr:`!format_spec`" +" values in interpolations can be arbitrary strings, including those that do " +"not conform to the :func:`format` protocol." +msgstr "" +"برخلاف اف‌استرینگ‌ها، که در آن‌ها مشخصات قالب‌بندی به‌طور خودکار از طریق " +"پروتکل :func:`format` اعمال می‌شوند، رفتار مورد انتظار در تی‌استرینگ‌ها " +"(t-strings) این است که کدی که درون‌یابی را *پردازش می‌کند*، تصمیم بگیرد که " +"چگونه مشخصات قالب‌بندی را تفسیر کند و آیا آن را اعمال کند یا خیر. در نتیجه، " +"مقادیر :attr:`!format_spec` در درون‌یابی‌ها می‌توانند رشته‌های دلخواه باشند،" +" از جمله آن‌هایی که با پروتکل :func:`format` مطابقت ندارند." msgid "Create a new :class:`!Interpolation` object from component parts." msgstr "" +"یک شیء :class:`!Interpolation` جدید را از اجزای تشکیل‌دهنده ایجاد کنید." msgid "Parameters" -msgstr "" +msgstr "پارامترها" msgid "The evaluated, in-scope result of the interpolation." -msgstr "" +msgstr "نتیجه‌ی ارزیابی‌شده و در محدوده‌ی درون‌یابی." msgid "The text of a valid Python expression, or an empty string." -msgstr "" +msgstr "متن یک عبارت معتبر پایتون، یا یک رشته خالی." -msgid "The :ref:`conversion ` to be used, one of ``None``, ``'a'``, ``'r'``, or ``'s'``." +msgid "" +"The :ref:`conversion ` to be used, one of ``None``, ``'a'``, " +"``'r'``, or ``'s'``." msgstr "" +":ref:`تبدیل ` مورد استفاده، یکی از ``None``، ``'a'``، ``'r'``" +" یا ``'s'`` است." -msgid "An optional, arbitrary string used as the :ref:`format specification ` to present the value." +msgid "" +"An optional, arbitrary string used as the :ref:`format specification " +"` to present the value." msgstr "" +"رشته‌ای اختیاری و دلخواه که به‌عنوان :ref:`مشخصه قالب ` برای " +"نمایش مقدار استفاده می‌شود." msgid "Helper functions" -msgstr "" +msgstr "توابع کمکی" -msgid "Applies formatted string literal :ref:`conversion ` semantics to the given object *obj*. This is frequently useful for custom template string processing logic." +msgid "" +"Applies formatted string literal :ref:`conversion ` semantics to the given object *obj*. This is frequently useful " +"for custom template string processing logic." msgstr "" +"معنای :ref:`تبدیل ` در لفظی رشته‌ی قالب‌بندی‌شده" +" را بر شیء داده‌شده *obj* اعمال می‌کند. این کار اغلب برای منطق سفارشی پردازش" +" رشته‌ی قالب مفید است." msgid "Three conversion flags are currently supported:" -msgstr "" +msgstr "در حال حاضر از سه پرچم تبدیل پشتیبانی می‌شود:" msgid "``'s'`` which calls :func:`str` on the value (like ``!s``)," -msgstr "" +msgstr "``'s'`` که :func:`str` را روی مقدار فراخوانی می‌کند (مانند ``!s``)،" msgid "``'r'`` which calls :func:`repr` (like ``!r``), and" -msgstr "" +msgstr "``'r'`` که :func:`repr` را فراخوانی می‌کند (مانند ``!r``)، و" msgid "``'a'`` which calls :func:`ascii` (like ``!a``)." -msgstr "" +msgstr "``'a'`` که :func:`ascii` را فراخوانی می‌کند (مانند ``!a``)." msgid "If the conversion flag is ``None``, *obj* is returned unchanged." -msgstr "" +msgstr "اگر پرچم تبدیل ``None`` باشد، *obj* بدون تغییر بازگردانده می‌شود." diff --git a/library/stringprep.po b/library/stringprep.po index 398e2a95a..a98c72675 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -22,76 +22,177 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!stringprep` --- Internet String Preparation" -msgstr "" +msgstr ":mod:`!stringprep` --- آماده‌سازی رشته‌های اینترنتی" msgid "**Source code:** :source:`Lib/stringprep.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/stringprep.py`" -msgid "When identifying things (such as host names) in the internet, it is often necessary to compare such identifications for \"equality\". Exactly how this comparison is executed may depend on the application domain, e.g. whether it should be case-insensitive or not. It may be also necessary to restrict the possible identifications, to allow only identifications consisting of \"printable\" characters." -msgstr "" +msgid "" +"When identifying things (such as host names) in the internet, it is often " +"necessary to compare such identifications for \"equality\". Exactly how this" +" comparison is executed may depend on the application domain, e.g. whether " +"it should be case-insensitive or not. It may be also necessary to restrict " +"the possible identifications, to allow only identifications consisting of " +"\"printable\" characters." +msgstr "" +"هنگام شناسایی چیزها (مانند نام‌های میزبان) در اینترنت، اغلب لازم است چنین " +"شناسه‌هایی را از نظر «برابری» مقایسه کنید. این‌که دقیقاً این مقایسه چگونه " +"اجرا می‌شود، ممکن است به حوزه کاربرد بستگی داشته باشد؛ مثلاً این‌که باید " +"بدون حساسیت به حروف کوچک و بزرگ باشد یا نه. همچنین ممکن است لازم باشد " +"شناسه‌های ممکن را محدود کنید تا فقط شناسه‌هایی که از نویسه‌های «چاپ‌پذیر» " +"تشکیل شده‌اند مجاز باشند." -msgid ":rfc:`3454` defines a procedure for \"preparing\" Unicode strings in internet protocols. Before passing strings onto the wire, they are processed with the preparation procedure, after which they have a certain normalized form. The RFC defines a set of tables, which can be combined into profiles. Each profile must define which tables it uses, and what other optional parts of the ``stringprep`` procedure are part of the profile. One example of a ``stringprep`` profile is ``nameprep``, which is used for internationalized domain names." -msgstr "" +msgid "" +":rfc:`3454` defines a procedure for \"preparing\" Unicode strings in " +"internet protocols. Before passing strings onto the wire, they are processed" +" with the preparation procedure, after which they have a certain normalized " +"form. The RFC defines a set of tables, which can be combined into profiles. " +"Each profile must define which tables it uses, and what other optional parts" +" of the ``stringprep`` procedure are part of the profile. One example of a " +"``stringprep`` profile is ``nameprep``, which is used for internationalized " +"domain names." +msgstr "" +":rfc:`3454` یک رویه برای «آماده‌سازی» رشته‌های یونیکد در پروتکل‌های اینترنتی" +" تعریف می‌کند. پیش از ارسال رشته‌ها روی سیم، آن‌ها با رویه آماده‌سازی پردازش" +" می‌شوند و پس از آن دارای شکل هنجارشده معینی هستند. این RFC مجموعه‌ای از " +"جدول‌ها را تعریف می‌کند که می‌توان آن‌ها را در قالب پروفایل‌ها ترکیب کرد. هر" +" پروفایل باید مشخص کند که از کدام جدول‌ها استفاده می‌کند و چه بخش‌های " +"اختیاری دیگری از رویه ``stringprep`` جزئی از آن پروفایل هستند. یکی از " +"پروفایل‌های ``stringprep``، ``nameprep`` است که برای نام‌های دامنه " +"بین‌المللی استفاده می‌شود." -msgid "The module :mod:`!stringprep` only exposes the tables from :rfc:`3454`. As 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." +msgid "" +"The module :mod:`!stringprep` only exposes the tables from :rfc:`3454`. As " +"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 "" +"ماژول :mod:`!stringprep` فقط جدول‌های :rfc:`3454` را ارائه می‌دهد. از آنجا " +"که بازنمایی این جدول‌ها به‌صورت دیکشنری یا فهرست بسیار حجیم خواهد بود، این " +"ماژول به‌صورت داخلی از پایگاه داده نویسه‌های یونیکد استفاده می‌کند. خود کد " +"منبع ماژول با استفاده از ابزار ``mkstringprep.py`` تولید شده است." -msgid "As a result, these tables are exposed as functions, not as data structures. There are two kinds of tables in the RFC: sets and mappings. For a set, :mod:`!stringprep` provides the \"characteristic function\", i.e. a function that returns ``True`` if the parameter is part of the set. For mappings, it provides the mapping function: given the key, it returns the associated value. Below is a list of all functions available in the module." -msgstr "" +msgid "" +"As a result, these tables are exposed as functions, not as data structures. " +"There are two kinds of tables in the RFC: sets and mappings. For a set, " +":mod:`!stringprep` provides the \"characteristic function\", i.e. a function" +" that returns ``True`` if the parameter is part of the set. For mappings, it" +" provides the mapping function: given the key, it returns the associated " +"value. Below is a list of all functions available in the module." +msgstr "" +"در نتیجه، این جداول به‌عنوان توابع ارائه می‌شوند، نه به‌عنوان ساختارهای " +"داده. دو نوع جدول در RFC وجود دارد: مجموعه‌ها و نگاشت‌ها. برای یک مجموعه، " +":mod:`!stringprep` «تابع مشخصه» را فراهم می‌کند، یعنی تابعی که اگر پارامتر " +"عضوی از مجموعه باشد، ``True`` را برمی‌گرداند. برای نگاشت‌ها، تابع نگاشت را " +"فراهم می‌کند: با دریافت کلید، مقدار مرتبط را برمی‌گرداند. در زیر فهرستی از " +"همه توابع موجود در این ماژول آمده است." -msgid "Determine whether *code* is in tableA.1 (Unassigned code points in Unicode 3.2)." +msgid "" +"Determine whether *code* is in tableA.1 (Unassigned code points in Unicode " +"3.2)." msgstr "" +"تعیین کنید که آیا *code* در tableA.1 (نقاط کد تخصیص‌نیافته در Unicode 3.2) " +"قرار دارد یا خیر." msgid "Determine whether *code* is in tableB.1 (Commonly mapped to nothing)." msgstr "" +"تعیین می‌کند که آیا *code* در tableB.1 وجود دارد (معمولاً به هیچ‌چیز نگاشت " +"می‌شود)." -msgid "Return the mapped value for *code* according to tableB.2 (Mapping for case-folding used with NFKC)." +msgid "" +"Return the mapped value for *code* according to tableB.2 (Mapping for case-" +"folding used with NFKC)." msgstr "" +"مقدار نگاشت‌شده برای *code* را طبق tableB.2 (نگاشت برای case-folding مورد " +"استفاده با NFKC) برمی‌گرداند." -msgid "Return the mapped value for *code* according to tableB.3 (Mapping for case-folding used with no normalization)." +msgid "" +"Return the mapped value for *code* according to tableB.3 (Mapping for case-" +"folding used with no normalization)." msgstr "" +"مقدار نگاشته‌شده برای *code* را بر اساس tableB.3 (نگاشت برای case-folding که" +" بدون نرمال‌سازی استفاده می‌شود) برمی‌گرداند." msgid "Determine whether *code* is in tableC.1.1 (ASCII space characters)." msgstr "" +"تعیین کنید که آیا *code* در tableC.1.1 (نویسه‌های فاصله ASCII) قرار دارد یا" +" خیر." -msgid "Determine whether *code* is in tableC.1.2 (Non-ASCII space characters)." +msgid "" +"Determine whether *code* is in tableC.1.2 (Non-ASCII space characters)." msgstr "" +"تعیین کنید که آیا *code* در tableC.1.2 (نویسه‌های فاصله غیر ASCII) قرار دارد" +" یا خیر." -msgid "Determine whether *code* is in tableC.1 (Space characters, union of C.1.1 and C.1.2)." +msgid "" +"Determine whether *code* is in tableC.1 (Space characters, union of C.1.1 " +"and C.1.2)." msgstr "" +"تعیین کنید که آیا *code* در tableC.1 قرار دارد یا خیر (نویسه‌های فاصله، " +"اجتماع C.1.1 و C.1.2)." msgid "Determine whether *code* is in tableC.2.1 (ASCII control characters)." msgstr "" +"تعیین می‌کند که آیا *code* در tableC.2.1 (نویسه‌های کنترلی ASCII) قرار دارد " +"یا خیر." -msgid "Determine whether *code* is in tableC.2.2 (Non-ASCII control characters)." +msgid "" +"Determine whether *code* is in tableC.2.2 (Non-ASCII control characters)." msgstr "" +"تعیین کنید که *code* در tableC.2.2 (نویسه‌های کنترلی غیر ASCII) قرار دارد." -msgid "Determine whether *code* is in tableC.2 (Control characters, union of C.2.1 and C.2.2)." +msgid "" +"Determine whether *code* is in tableC.2 (Control characters, union of C.2.1" +" and C.2.2)." msgstr "" +"تعیین کنید که آیا *code* در جدول C.2 قرار دارد یا خیر (نویسه‌های کنترلی، " +"اجتماع C.2.1 و C.2.2)." msgid "Determine whether *code* is in tableC.3 (Private use)." msgstr "" +"تعیین کنید که آیا *code* در tableC.3 (استفاده‌ی خصوصی) قرار دارد یا خیر." msgid "Determine whether *code* is in tableC.4 (Non-character code points)." msgstr "" +"تعیین کنید که آیا *code* در tableC.4 (نقاط کد غیرنویسه‌ای) قرار دارد یا خیر." msgid "Determine whether *code* is in tableC.5 (Surrogate codes)." -msgstr "" +msgstr "تعیین کنید که آیا *code* در tableC.5 (کدهای جانشین) قرار دارد." -msgid "Determine whether *code* is in tableC.6 (Inappropriate for plain text)." +msgid "" +"Determine whether *code* is in tableC.6 (Inappropriate for plain text)." msgstr "" +"تعیین کنید که آیا *code* در tableC.6 قرار دارد (برای متن ساده نامناسب است)." -msgid "Determine whether *code* is in tableC.7 (Inappropriate for canonical representation)." +msgid "" +"Determine whether *code* is in tableC.7 (Inappropriate for canonical " +"representation)." msgstr "" +"تعیین کنید که آیا *code* در جدول C.7 قرار دارد (نامناسب برای بازنمایی " +"کانونیکال)." -msgid "Determine whether *code* is in tableC.8 (Change display properties or are deprecated)." +msgid "" +"Determine whether *code* is in tableC.8 (Change display properties or are " +"deprecated)." msgstr "" +"تعیین می‌کند که آیا *code* در tableC.8 قرار دارد (ویژگی‌های نمایشی را تغییر " +"می‌دهند یا منسوخ شده‌اند)." msgid "Determine whether *code* is in tableC.9 (Tagging characters)." msgstr "" +"تعیین کنید که آیا *code* در tableC.9 (نویسه‌های برچسب‌گذاری) قرار دارد یا " +"خیر." -msgid "Determine whether *code* is in tableD.1 (Characters with bidirectional property \"R\" or \"AL\")." +msgid "" +"Determine whether *code* is in tableD.1 (Characters with bidirectional " +"property \"R\" or \"AL\")." msgstr "" +"تعیین کنید که آیا *code* در tableD.1 قرار دارد (نویسه‌هایی با ویژگی دوجهته " +"\"R\" یا \"AL\")." -msgid "Determine whether *code* is in tableD.2 (Characters with bidirectional property \"L\")." +msgid "" +"Determine whether *code* is in tableD.2 (Characters with bidirectional " +"property \"L\")." msgstr "" +"تعیین کنید که آیا *code* در tableD.2 قرار دارد (نویسه‌هایی با ویژگی دوجهته " +"\"L\")." diff --git a/library/struct.po b/library/struct.po index 62c998aea..5bbe60468 100644 --- a/library/struct.po +++ b/library/struct.po @@ -27,444 +27,792 @@ msgstr "" msgid ":mod:`!struct` --- Interpret bytes as packed binary data" msgstr "" +":mod:`!struct` --- تفسیر بایت‌ها به‌عنوان داده‌های دودویی بسته‌بندی‌شده" msgid "**Source code:** :source:`Lib/struct.py`" -msgstr "" +msgstr ":source:`Lib/struct.py`" -msgid "This module converts between Python values and C structs represented as Python :class:`bytes` objects. Compact :ref:`format strings ` describe the intended conversions to/from Python values. The module's functions and objects can be used for two largely distinct applications, data exchange with external sources (files or network connections), or data transfer between the Python application and the C layer." -msgstr "" +msgid "" +"This module converts between Python values and C structs represented as " +"Python :class:`bytes` objects. Compact :ref:`format strings ` describe the intended conversions to/from Python values. The " +"module's functions and objects can be used for two largely distinct " +"applications, data exchange with external sources (files or network " +"connections), or data transfer between the Python application and the C " +"layer." +msgstr "" +"این ماژول بین مقادیر پایتون و ساختارهای C که به‌صورت اشیای :class:`bytes` " +"پایتون نمایش داده می‌شوند، تبدیل انجام می‌دهد. :ref:`رشته‌های قالب ` فشرده، تبدیل‌های موردنظر به/از مقادیر پایتون را توصیف " +"می‌کنند. توابع و اشیای این ماژول می‌توانند برای دو کاربرد تا حد زیادی متمایز" +" استفاده شوند: تبادل داده با منابع خارجی (فایل‌ها یا اتصال‌های شبکه)، یا " +"انتقال داده بین برنامه‌ی پایتون و لایه‌ی C." -msgid "When no prefix character is given, native mode is the default. It packs or unpacks data based on the platform and compiler on which the Python interpreter was built. The result of packing a given C struct includes pad bytes which maintain proper alignment for the C types involved; similarly, alignment is taken into account when unpacking. In contrast, when communicating data between external sources, the programmer is responsible for defining byte ordering and padding between elements. See :ref:`struct-alignment` for details." -msgstr "" +msgid "" +"When no prefix character is given, native mode is the default. It packs or " +"unpacks data based on the platform and compiler on which the Python " +"interpreter was built. The result of packing a given C struct includes pad " +"bytes which maintain proper alignment for the C types involved; similarly, " +"alignment is taken into account when unpacking. In contrast, when " +"communicating data between external sources, the programmer is responsible " +"for defining byte ordering and padding between elements. See :ref:`struct-" +"alignment` for details." +msgstr "" +"هنگامی که هیچ نویسه‌ی پیشوندی داده نشود، حالت بومی پیش‌فرض است. این حالت " +"داده‌ها را بر اساس سکو و کامپایلری که مفسر پایتون بر پایه‌ی آن‌ها ساخته شده " +"است، بسته‌بندی یا واگشایی می‌کند. نتیجه‌ی بسته‌بندی یک ساختار C مشخص، شامل " +"بایت‌های پرکننده‌ای است که تراز مناسب را برای انواع C مربوط حفظ می‌کنند؛ " +"به‌طور مشابه، هنگام واگشایی نیز تراز در نظر گرفته می‌شود. در مقابل، هنگام " +"تبادل داده بین منابع خارجی، برنامه‌نویس مسئول تعیین ترتیب بایت‌ها و بایت‌های" +" پرکننده بین المان‌ها است. برای جزئیات، :ref:`struct-alignment` را ببینید." -msgid "Several :mod:`!struct` functions (and methods of :class:`Struct`) take a *buffer* argument. This refers to objects that implement the :ref:`bufferobjects` and provide either a readable or read-writable buffer. The most common types used for that purpose are :class:`bytes` and :class:`bytearray`, but many other types that can be viewed as an array of bytes implement the buffer protocol, so that they can be read/filled without additional copying from a :class:`bytes` object." -msgstr "" +msgid "" +"Several :mod:`!struct` functions (and methods of :class:`Struct`) take a " +"*buffer* argument. This refers to objects that implement the " +":ref:`bufferobjects` and provide either a readable or read-writable buffer." +" The most common types used for that purpose are :class:`bytes` and " +":class:`bytearray`, but many other types that can be viewed as an array of " +"bytes implement the buffer protocol, so that they can be read/filled without" +" additional copying from a :class:`bytes` object." +msgstr "" +"چندین تابع :mod:`!struct` (و متدهای :class:`Struct`) یک آرگومان *بافر* " +" دریافت می‌کنند. این به اشیایی اشاره دارد که :ref:`bufferobjects` را" +" پیاده‌سازی می‌کنند و یک بافر قابل خواندن یا قابل خواندن و نوشتن فراهم " +"می‌کنند. رایج‌ترین انواعی که برای این منظور استفاده می‌شوند، :class:`bytes` " +"و :class:`bytearray` هستند، اما بسیاری از انواع دیگر که می‌توان آن‌ها را " +"به‌عنوان آرایه‌ای از بایت‌ها در نظر گرفت، پروتکل بافر (buffer protocol) را " +"پیاده‌سازی می‌کنند، به‌طوری که بتوان آن‌ها را بدون کپی اضافی از یک شیء " +":class:`bytes` خواند/پر کرد." msgid "Functions and Exceptions" -msgstr "" +msgstr "تابع‌ها و استثناها" msgid "The module defines the following exception and functions:" -msgstr "" +msgstr "این ماژول استثنا و توابع زیر را تعریف می‌کند:" -msgid "Exception raised on various occasions; argument is a string describing what is wrong." +msgid "" +"Exception raised on various occasions; argument is a string describing what " +"is wrong." msgstr "" +"استثنایی که در موارد مختلف پرتاب می‌شود؛ آرگومان آن رشته‌ای است که توضیح " +"می‌دهد چه چیزی اشتباه است." -msgid "Return a bytes object containing the values *v1*, *v2*, ... packed according to the format string *format*. The arguments must match the values required by the format exactly." +msgid "" +"Return a bytes object containing the values *v1*, *v2*, ... packed according" +" to the format string *format*. The arguments must match the values " +"required by the format exactly." msgstr "" +"یک شیء bytes حاوی مقادیر *v1*، *v2*، ... برمی‌گرداند که بر اساس رشته قالب " +"*format* بسته‌بندی شده‌اند. آرگومان‌ها باید دقیقاً با مقادیر مورد نیاز قالب " +"مطابقت داشته باشند." -msgid "Pack the values *v1*, *v2*, ... according to the format string *format* and write the packed bytes into the writable buffer *buffer* starting at position *offset*. Note that *offset* is a required argument. A negative *offset* counts from the end of *buffer*." +msgid "" +"Pack the values *v1*, *v2*, ... according to the format string *format* and " +"write the packed bytes into the writable buffer *buffer* starting at " +"position *offset*. Note that *offset* is a required argument. A negative " +"*offset* counts from the end of *buffer*." msgstr "" +"مقادیر *v1*، *v2*، ... را مطابق رشته‌ی قالب *format* بسته‌بندی کنید و " +"بایت‌های بسته‌بندی‌شده را در بافر قابل‌نوشتن *buffer* از موقعیت *offset* " +"بنویسید. توجه داشته باشید که *offset* یک آرگومان الزامی است. *offset* منفی " +"از انتهای *buffer* شمارش می‌شود." -msgid "Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``) according to the format string *format*. The result is a tuple even if it contains exactly one item. The buffer's size in bytes must match the size required by the format, as reflected by :func:`calcsize`." +msgid "" +"Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``)" +" according to the format string *format*. The result is a tuple even if it " +"contains exactly one item. The buffer's size in bytes must match the size " +"required by the format, as reflected by :func:`calcsize`." msgstr "" +"از بافر *buffer* (که احتمالاً با ``pack(format, ...)`` بسته‌بندی شده است) بر" +" اساس رشته‌ی قالب *format* واگشایی می‌کند. نتیجه یک تاپل است، حتی اگر دقیقاً " +"شامل یک آیتم باشد. اندازه‌ی بافر بر حسب بایت باید با اندازه‌ی مورد نیاز قالب " +"مطابقت داشته باشد، همان‌طور که :func:`calcsize` نشان می‌دهد." -msgid "Unpack from *buffer* starting at position *offset*, according to the format string *format*. The result is a tuple even if it contains exactly one item. The buffer's size in bytes, starting at position *offset*, must be at least the size required by the format, as reflected by :func:`calcsize`. A negative *offset* counts from the end of *buffer*." -msgstr "" +msgid "" +"Unpack from *buffer* starting at position *offset*, according to the format " +"string *format*. The result is a tuple even if it contains exactly one " +"item. The buffer's size in bytes, starting at position *offset*, must be at" +" least the size required by the format, as reflected by :func:`calcsize`. A " +"negative *offset* counts from the end of *buffer*." +msgstr "" +"از *buffer* با شروع از موقعیت *offset*، بر اساس رشته‌ی قالب *format* واگشایی" +" کنید. نتیجه حتی اگر دقیقاً شامل یک آیتم باشد، یک تاپل است. اندازه‌ی بافر بر" +" حسب بایت، با شروع از موقعیت *offset*، باید حداقل برابر با اندازه‌ی موردنیاز" +" قالب باشد، همان‌طور که :func:`calcsize` نشان می‌دهد. یک *offset* منفی از " +"انتهای *buffer* شمارش می‌شود." -msgid "Iteratively unpack from the buffer *buffer* according to the format string *format*. This function returns an iterator which will read equally sized chunks from the buffer until all its contents have been consumed. The buffer's size in bytes must be a multiple of the size required by the format, as reflected by :func:`calcsize`." -msgstr "" +msgid "" +"Iteratively unpack from the buffer *buffer* according to the format string " +"*format*. This function returns an iterator which will read equally sized " +"chunks from the buffer until all its contents have been consumed. The " +"buffer's size in bytes must be a multiple of the size required by the " +"format, as reflected by :func:`calcsize`." +msgstr "" +"به‌صورت تکراری از بافر *buffer* بر اساس رشته‌ی قالب *format* واگشایی می‌شود. " +"این تابع یک پیمایش‌گر برمی‌گرداند که تکه‌هایی با اندازه‌ی یکسان از بافر " +"می‌خواند تا زمانی که تمام محتوای آن مصرف شود. اندازه‌ی بافر بر حسب بایت باید " +"مضربی از اندازه‌ی مورد نیاز قالب باشد، همان‌طور که :func:`calcsize` نشان " +"می‌دهد." msgid "Each iteration yields a tuple as specified by the format string." -msgstr "" +msgstr "هر تکرار، یک تاپل را مطابق آنچه رشته‌ی قالب مشخص می‌کند برمی‌گرداند." -msgid "Return the size of the struct (and hence of the bytes object produced by ``pack(format, ...)``) corresponding to the format string *format*." +msgid "" +"Return the size of the struct (and hence of the bytes object produced by " +"``pack(format, ...)``) corresponding to the format string *format*." msgstr "" +"اندازه‌ی ساختار (و بنابراین اندازه‌ی شیء bytes تولیدشده توسط ``pack(format, " +"...)``) متناظر با رشته‌ی قالب *format* را برمی‌گرداند." msgid "Format Strings" -msgstr "" +msgstr "رشته‌های قالب" -msgid "Format strings describe the data layout when packing and unpacking data. They are built up from :ref:`format characters`, which specify the type of data being packed/unpacked. In addition, special characters control the :ref:`byte order, size and alignment`. Each format string consists of an optional prefix character which describes the overall properties of the data and one or more format characters which describe the actual data values and padding." -msgstr "" +msgid "" +"Format strings describe the data layout when packing and unpacking data. " +"They are built up from :ref:`format characters `, which " +"specify the type of data being packed/unpacked. In addition, special " +"characters control the :ref:`byte order, size and alignment `. Each format string consists of an optional prefix character " +"which describes the overall properties of the data and one or more format " +"characters which describe the actual data values and padding." +msgstr "" +"رشته‌های قالب، چیدمان داده‌ها را هنگام بسته‌بندی و واگشایی داده توصیف " +"می‌کنند. آن‌ها از :ref:`نویسه‌های قالب ` تشکیل شده‌اند " +"که نوع داده‌های در حال بسته‌بندی/واگشایی را مشخص می‌کنند. افزون بر این، " +"نویسه‌های ویژه :ref:`ترتیب بایت، اندازه و ترازبندی ` را " +"کنترل می‌کنند. هر رشته قالب شامل یک نویسه پیشوند اختیاری است که ویژگی‌های " +"کلی داده‌ها را توصیف می‌کند و یک یا چند نویسه قالب که مقادیر واقعی داده و " +"فضای پرکننده را توصیف می‌کنند." msgid "Byte Order, Size, and Alignment" -msgstr "" +msgstr "ترتیب بایت، اندازه و هم‌ترازی" -msgid "By default, C types are represented in the machine's native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler). This behavior is chosen so that the bytes of a packed struct correspond exactly to the memory layout of the corresponding C struct. Whether to use native byte ordering and padding or standard formats depends on the application." -msgstr "" +msgid "" +"By default, C types are represented in the machine's native format and byte " +"order, and properly aligned by skipping pad bytes if necessary (according to" +" the rules used by the C compiler). This behavior is chosen so that the " +"bytes of a packed struct correspond exactly to the memory layout of the " +"corresponding C struct. Whether to use native byte ordering and padding or " +"standard formats depends on the application." +msgstr "" +"به‌طور پیش‌فرض، انواع C در قالب و ترتیب بایت بومی ماشین نمایش داده می‌شوند و" +" در صورت لزوم با پرش از بایت‌های پرکننده (طبق قواعد استفاده‌شده توسط " +"کامپایلر C) به‌درستی هم‌تراز می‌شوند. این رفتار انتخاب شده است تا بایت‌های " +"یک ساختار فشرده دقیقاً با چیدمان حافظه‌ی ساختار C متناظر مطابقت داشته باشند." +" این‌که از ترتیب بایت و پرکنندگی بومی استفاده شود یا از قالب‌های استاندارد، " +"به کاربرد بستگی دارد." -msgid "Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:" +msgid "" +"Alternatively, the first character of the format string can be used to " +"indicate the byte order, size and alignment of the packed data, according to" +" the following table:" msgstr "" +"به‌عنوان جایگزین، می‌توان از اولین نویسه‌ی رشته‌ی قالب برای نشان دادن ترتیب " +"بایت‌ها، اندازه و هم‌ترازی داده‌های بسته‌بندی‌شده، مطابق جدول زیر استفاده " +"کرد:" msgid "Character" -msgstr "" +msgstr "نویسه" msgid "Byte order" -msgstr "" +msgstr "ترتیب بایت" msgid "Size" -msgstr "" +msgstr "اندازه" msgid "Alignment" -msgstr "" +msgstr "تراز" msgid "``@``" -msgstr "" +msgstr "``@``" msgid "native" -msgstr "" +msgstr "بومی" msgid "``=``" -msgstr "" +msgstr "``=``" msgid "standard" -msgstr "" +msgstr "استاندارد" msgid "none" -msgstr "" +msgstr "هیچ" msgid "``<``" -msgstr "" +msgstr "``<``" msgid "little-endian" -msgstr "" +msgstr "کوچک‌اندیان (little-endian)" msgid "``>``" -msgstr "" +msgstr "``>``" msgid "big-endian" -msgstr "" +msgstr "بزرگ‌اندیان" msgid "``!``" -msgstr "" +msgstr "``!``" msgid "network (= big-endian)" -msgstr "" +msgstr "شبکه (= بزرگ‌اندیان)" msgid "If the first character is not one of these, ``'@'`` is assumed." -msgstr "" +msgstr "اگر اولین نویسه یکی از این‌ها نباشد، ``'@'`` فرض می‌شود." -msgid "The number 1023 (``0x3ff`` in hexadecimal) has the following byte representations:" -msgstr "" +msgid "" +"The number 1023 (``0x3ff`` in hexadecimal) has the following byte " +"representations:" +msgstr "عدد ۱۰۲۳ (``0x3ff`` در مبنای شانزده) بازنمایی‌های بایتی زیر را دارد:" msgid "``03 ff`` in big-endian (``>``)" -msgstr "" +msgstr "``03 ff`` در بزرگ‌اندیان (``>``)" msgid "``ff 03`` in little-endian (``<``)" -msgstr "" +msgstr "``ff 03`` به‌صورت کوچک‌اندیان (little-endian) (``<``)" msgid "Python example:" -msgstr "" +msgstr "مثال پایتون:" -msgid "Native byte order is big-endian or little-endian, depending on the host system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-endian; IBM z and many legacy architectures are big-endian. Use :data:`sys.byteorder` to check the endianness of your system." +msgid "" +"Native byte order is big-endian or little-endian, depending on the host " +"system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-" +"endian; IBM z and many legacy architectures are big-endian. Use " +":data:`sys.byteorder` to check the endianness of your system." msgstr "" +"ترتیب بایت بومی، بسته به سیستم میزبان، بزرگ‌اندیان (big-endian) یا کوچک‌اندیان" +" (little-endian) است. برای مثال، Intel x86، AMD64 (x86-64) و Apple M1 " +"کوچک‌اندیان هستند؛ IBM z و بسیاری از معماری‌های قدیمی بزرگ‌اندیان هستند. برای " +"بررسی ترتیب بایت (endianness) سیستم خود از :data:`sys.byteorder` استفاده " +"کنید." -msgid "Native size and alignment are determined using the C compiler's ``sizeof`` expression. This is always combined with native byte order." +msgid "" +"Native size and alignment are determined using the C compiler's ``sizeof`` " +"expression. This is always combined with native byte order." msgstr "" +"اندازه و هم‌ترازی بومی با استفاده از عبارت ``sizeof`` کامپایلر C تعیین " +"می‌شود. این همیشه با ترتیب بایت بومی ترکیب می‌شود." -msgid "Standard size depends only on the format character; see the table in the :ref:`format-characters` section." +msgid "" +"Standard size depends only on the format character; see the table in the " +":ref:`format-characters` section." msgstr "" +"اندازه‌ی استاندارد فقط به نویسه‌ی قالب بستگی دارد؛ جدول موجود در بخش " +":ref:`format-characters` را ببینید." -msgid "Note the difference between ``'@'`` and ``'='``: both use native byte order, but the size and alignment of the latter is standardized." +msgid "" +"Note the difference between ``'@'`` and ``'='``: both use native byte order," +" but the size and alignment of the latter is standardized." msgstr "" +"به تفاوت بین ``'@'`` و ``'='`` توجه کنید: هر دو از ترتیب بایت‌های بومی " +"استفاده می‌کنند، اما اندازه و هم‌ترازی مورد دوم استاندارد شده است." -msgid "The form ``'!'`` represents the network byte order which is always big-endian as defined in `IETF RFC 1700 `_." +msgid "" +"The form ``'!'`` represents the network byte order which is always big-" +"endian as defined in `IETF RFC 1700 `_." msgstr "" +"قالب ``'!'`` نمایانگر ترتیب بایت‌های شبکه است که مطابق تعریف `IETF RFC 1700 " +"`_، همیشه به‌صورت بزرگ‌اندیان (big-endian) است." -msgid "There is no way to indicate non-native byte order (force byte-swapping); use the appropriate choice of ``'<'`` or ``'>'``." +msgid "" +"There is no way to indicate non-native byte order (force byte-swapping); use" +" the appropriate choice of ``'<'`` or ``'>'``." msgstr "" +"راهی برای مشخص کردن ترتیب بایت غیربومی (اجبار به جابجایی بایت‌ها) وجود " +"ندارد؛ از انتخاب مناسب ``'<'`` یا ``'>'`` استفاده کنید." msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" -msgid "Padding is only automatically added between successive structure members. No padding is added at the beginning or the end of the encoded struct." +msgid "" +"Padding is only automatically added between successive structure members. No" +" padding is added at the beginning or the end of the encoded struct." msgstr "" +"فضای پرکننده (padding) فقط به‌صورت خودکار بین اعضای متوالی ساختار اضافه " +"می‌شود. هیچ فضای پرکننده‌ای در ابتدا یا انتهای ساختار کدگذاری‌شده اضافه " +"نمی‌شود." -msgid "No padding is added when using non-native size and alignment, e.g. with '<', '>', '=', and '!'." +msgid "" +"No padding is added when using non-native size and alignment, e.g. with '<'," +" '>', '=', and '!'." msgstr "" +"هنگام استفاده از اندازه و ترازبندی غیربومی، هیچ پرکننده‌ای (padding) اضافه " +"نمی‌شود، برای مثال با '<'، '>'، '=' و '!'." -msgid "To align the end of a structure to the alignment requirement of a particular type, end the format with the code for that type with a repeat count of zero. See :ref:`struct-examples`." +msgid "" +"To align the end of a structure to the alignment requirement of a particular" +" type, end the format with the code for that type with a repeat count of " +"zero. See :ref:`struct-examples`." msgstr "" +"برای هم‌تراز کردن انتهای یک ساختار با الزام هم‌ترازی یک نوع خاص، قالب را با " +"کد آن نوع و تعداد تکرار صفر به پایان ببرید. :ref:`struct-examples` را " +"ببینید." msgid "Format Characters" -msgstr "" +msgstr "نویسه‌های قالب‌بندی" -msgid "Format characters have the following meaning; the conversion between C and Python values should be obvious given their types. The 'Standard size' column refers to the size of the packed value in bytes when using standard size; that is, when the format string starts with one of ``'<'``, ``'>'``, ``'!'`` or ``'='``. When using native size, the size of the packed value is platform-dependent." -msgstr "" +msgid "" +"Format characters have the following meaning; the conversion between C and " +"Python values should be obvious given their types. The 'Standard size' " +"column refers to the size of the packed value in bytes when using standard " +"size; that is, when the format string starts with one of ``'<'``, ``'>'``, " +"``'!'`` or ``'='``. When using native size, the size of the packed value is" +" platform-dependent." +msgstr "" +"نویسه‌های قالب معنای زیر را دارند؛ با توجه به نوع آن‌ها، تبدیل بین مقادیر C " +"و پایتون باید بدیهی باشد. ستون «اندازه استاندارد» به اندازه‌ی مقدار " +"بسته‌بندی‌شده بر حسب بایت هنگام استفاده از اندازه استاندارد اشاره دارد؛ یعنی" +" زمانی که رشته‌ی قالب با یکی از ``'<'``، ``'>'``، ``'!'`` یا ``'='`` شروع " +"شود. هنگام استفاده از اندازه بومی، اندازه‌ی مقدار بسته‌بندی‌شده وابسته به سکو" +" است." msgid "Format" -msgstr "" +msgstr "قالب" msgid "C Type" -msgstr "" +msgstr "نوع C" msgid "Python type" -msgstr "" +msgstr "نوع پایتون" msgid "Standard size" -msgstr "" +msgstr "اندازه استاندارد" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "``x``" -msgstr "" +msgstr "``x``" msgid "pad byte" -msgstr "" +msgstr "بایت پرکننده" msgid "no value" -msgstr "" +msgstr "بدون مقدار" msgid "\\(7)" -msgstr "" +msgstr "\\(7)" msgid "``c``" -msgstr "" +msgstr "``c``" msgid ":c:expr:`char`" -msgstr "" +msgstr ":c:expr:`char`" msgid "bytes of length 1" -msgstr "" +msgstr "بایت‌هایی با طول ۱" msgid "1" -msgstr "" +msgstr "1" msgid "``b``" -msgstr "" +msgstr "``b``" msgid ":c:expr:`signed char`" -msgstr "" +msgstr ":c:expr:`signed char`" msgid "int" -msgstr "" +msgstr "int" msgid "\\(2)" -msgstr "" +msgstr "\\(2)" msgid "``B``" -msgstr "" +msgstr "``B``" msgid ":c:expr:`unsigned char`" -msgstr "" +msgstr ":c:expr:`unsigned char`" msgid "``?``" -msgstr "" +msgstr "``?``" msgid ":c:expr:`_Bool`" -msgstr "" +msgstr ":c:expr:`_Bool`" msgid "bool" -msgstr "" +msgstr "بولی" msgid "\\(1)" -msgstr "" +msgstr "\\(1)" msgid "``h``" -msgstr "" +msgstr "``h``" msgid ":c:expr:`short`" -msgstr "" +msgstr ":c:expr:`short`" msgid "2" -msgstr "" +msgstr "2" msgid "``H``" -msgstr "" +msgstr "``H``" msgid ":c:expr:`unsigned short`" -msgstr "" +msgstr ":c:expr:`unsigned short`" msgid "``i``" -msgstr "" +msgstr "``i``" msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" msgid "4" -msgstr "" +msgstr "4" msgid "``I``" -msgstr "" +msgstr "``I``" msgid ":c:expr:`unsigned int`" -msgstr "" +msgstr ":c:expr:`unsigned int`" msgid "``l``" -msgstr "" +msgstr "``l``" msgid ":c:expr:`long`" -msgstr "" +msgstr ":c:expr:`long`" msgid "``L``" -msgstr "" +msgstr "``L``" msgid ":c:expr:`unsigned long`" -msgstr "" +msgstr ":c:expr:`unsigned long`" msgid "``q``" -msgstr "" +msgstr "``q``" msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" msgid "8" -msgstr "" +msgstr "۸" msgid "``Q``" -msgstr "" +msgstr "``Q``" msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" msgid "``n``" -msgstr "" +msgstr "``n``" msgid ":c:type:`ssize_t`" -msgstr "" +msgstr ":c:type:`ssize_t`" msgid "\\(2), \\(3)" -msgstr "" +msgstr "\\(2), \\(3)" msgid "``N``" -msgstr "" +msgstr "``N``" msgid ":c:type:`size_t`" -msgstr "" +msgstr ":c:type:`size_t`" msgid "``e``" -msgstr "" +msgstr "``e``" msgid ":c:expr:`_Float16`" -msgstr "" +msgstr ":c:expr:`_Float16`" msgid "float" -msgstr "" +msgstr "float" msgid "\\(4), \\(6)" -msgstr "" +msgstr "\\(4), \\(6)" msgid "``f``" -msgstr "" +msgstr "``f``" msgid ":c:expr:`float`" -msgstr "" +msgstr ":c:expr:`float`" msgid "\\(4)" -msgstr "" +msgstr "\\(4)" msgid "``d``" -msgstr "" +msgstr "``d``" msgid ":c:expr:`double`" -msgstr "" +msgstr ":c:expr:`double`" msgid "``F``" -msgstr "" +msgstr "``F``" msgid ":c:expr:`float complex`" -msgstr "" +msgstr ":c:expr:`float complex`" msgid "complex" -msgstr "" +msgstr "مختلط" msgid "\\(10)" -msgstr "" +msgstr "\\(10)" msgid "``D``" -msgstr "" +msgstr "``D``" msgid ":c:expr:`double complex`" -msgstr "" +msgstr ":c:expr:`double complex`" msgid "16" -msgstr "" +msgstr "16" msgid "``s``" -msgstr "" +msgstr "``s``" msgid ":c:expr:`char[]`" -msgstr "" +msgstr ":c:expr:`char[]`" msgid "bytes" -msgstr "" +msgstr "بایت‌ها" msgid "\\(9)" -msgstr "" +msgstr "\\(9)" msgid "``p``" -msgstr "" +msgstr "``p``" msgid "\\(8)" -msgstr "" +msgstr "\\(8)" msgid "``P``" -msgstr "" +msgstr "``P``" msgid ":c:expr:`void \\*`" -msgstr "" +msgstr ":c:expr:`void \\*`" msgid "\\(2), \\(5)" -msgstr "" +msgstr "\\(2), \\(5)" msgid "Added support for the ``'n'`` and ``'N'`` formats." -msgstr "" +msgstr "پشتیبانی از قالب‌های ``'n'`` و ``'N'`` اضافه شد." msgid "Added support for the ``'e'`` format." -msgstr "" +msgstr "پشتیبانی از قالب ``'e'`` اضافه شد." msgid "Added support for the ``'F'`` and ``'D'`` formats." -msgstr "" +msgstr "پشتیبانی از قالب‌های ``'F'`` و ``'D'`` اضافه شد." -msgid "The :mod:`array` and :ref:`ctypes ` modules, as well as third-party modules like `numpy `__, use similar -- but slightly different -- type codes." +msgid "" +"The :mod:`array` and :ref:`ctypes ` modules, " +"as well as third-party modules like `numpy " +"`__," +" use similar -- but slightly different -- type codes." msgstr "" +"ماژول‌های :mod:`array` و :ref:`ctypes `، و " +"همچنین ماژول‌های شخص ثالث مانند `numpy " +"`__،" +" از کدهای نوع مشابه، اما کمی متفاوت، استفاده می‌کنند." -msgid "The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined by C standards since C99. In standard mode, it is represented by one byte." +msgid "" +"The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined " +"by C standards since C99. In standard mode, it is represented by one byte." msgstr "" +"کد تبدیل ``'?'`` متناظر با نوع :c:expr:`_Bool` است که از C99 در استانداردهای" +" C تعریف شده است. در حالت استاندارد، این نوع با یک بایت بازنمایی می‌شود." -msgid "When attempting to pack a non-integer using any of the integer conversion codes, if the non-integer has a :meth:`~object.__index__` method then that method is called to convert the argument to an integer before packing." +msgid "" +"When attempting to pack a non-integer using any of the integer conversion " +"codes, if the non-integer has a :meth:`~object.__index__` method then that " +"method is called to convert the argument to an integer before packing." msgstr "" +"هنگام تلاش برای بسته‌بندی مقداری که عدد صحیح نیست با استفاده از هر یک از " +"کدهای تبدیل مربوط به عدد صحیح، اگر آن مقدار دارای متد " +":meth:`~object.__index__` باشد، آن متد برای تبدیل آرگومان به عدد صحیح پیش از" +" بسته‌بندی فراخوانی می‌شود." msgid "Added use of the :meth:`~object.__index__` method for non-integers." -msgstr "" +msgstr "استفاده از متد :meth:`~object.__index__` برای غیرصحیح‌ها افزوده شد." -msgid "The ``'n'`` and ``'N'`` conversion codes are only available for the native size (selected as the default or with the ``'@'`` byte order character). For the standard size, you can use whichever of the other integer formats fits your application." +msgid "" +"The ``'n'`` and ``'N'`` conversion codes are only available for the native " +"size (selected as the default or with the ``'@'`` byte order character). For" +" the standard size, you can use whichever of the other integer formats fits " +"your application." msgstr "" +"کدهای تبدیل ``'n'`` و ``'N'`` فقط برای اندازه بومی (انتخاب‌شده به‌عنوان " +"پیش‌فرض یا با نویسه ترتیب بایت ``'@'``) در دسترس هستند. برای اندازه " +"استاندارد، می‌توانید از هر یک از قالب‌های دیگر عدد صحیح که مناسب برنامه " +"شماست استفاده کنید." -msgid "For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed representation uses the IEEE 754 binary32, binary64 or binary16 format (for ``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point format used by the platform." +msgid "" +"For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed " +"representation uses the IEEE 754 binary32, binary64 or binary16 format (for " +"``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point " +"format used by the platform." msgstr "" +"برای کدهای تبدیل ``'f'``، ``'d'`` و ``'e'``، بازنمایی فشرده از قالب " +"binary32، binary64 یا binary16 IEEE 754 (به‌ترتیب برای ``'f'``، ``'d'`` یا " +"``'e'``) استفاده می‌کند، صرف‌نظر از قالب ممیز شناور استفاده‌شده توسط سکو." -msgid "The ``'P'`` format character is only available for the native byte ordering (selected as the default or with the ``'@'`` byte order character). The byte order character ``'='`` chooses to use little- or big-endian ordering based on the host system. The struct module does not interpret this as native ordering, so the ``'P'`` format is not available." -msgstr "" +msgid "" +"The ``'P'`` format character is only available for the native byte ordering " +"(selected as the default or with the ``'@'`` byte order character). The byte" +" order character ``'='`` chooses to use little- or big-endian ordering based" +" on the host system. The struct module does not interpret this as native " +"ordering, so the ``'P'`` format is not available." +msgstr "" +"نویسه‌ی قالب ``'P'`` فقط برای ترتیب بایت بومی در دسترس است (که به‌عنوان " +"پیش‌فرض یا با نویسه‌ی ترتیب بایت ``'@'`` انتخاب می‌شود). نویسه‌ی ترتیب بایت " +"``'='`` استفاده از ترتیب کوچک‌اندیان (little-endian) یا بزرگ‌اندیان (big-endian) را " +"بر اساس سیستم میزبان انتخاب می‌کند. ماژول struct این را به‌عنوان ترتیب بومی " +"تفسیر نمی‌کند، بنابراین قالب ``'P'`` در دسترس نیست." -msgid "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 revision of the `IEEE 754 standard `_. It has a sign bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored), and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04`` at full precision. This type is not widely supported by C compilers: it's available as :c:expr:`_Float16` type, if the compiler supports the Annex H of the C23 standard. On a typical machine, an unsigned short can be used for storage, but not for math operations. See the Wikipedia page on the `half-precision floating-point format `_ for more information." -msgstr "" +msgid "" +"The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 " +"revision of the `IEEE 754 standard `_. It has a sign " +"bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored)," +" and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04``" +" at full precision. This type is not widely supported by C compilers: it's " +"available as :c:expr:`_Float16` type, if the compiler supports the Annex H " +"of the C23 standard. On a typical machine, an unsigned short can be used " +"for storage, but not for math operations. See the Wikipedia page on the " +"`half-precision floating-point format `_ for more " +"information." +msgstr "" +"نوع binary16 «دقت نصفه» (half precision) در IEEE 754، در بازنگری سال ۲۰۰۸ " +"`استاندارد IEEE 754 `_ معرفی شد. این نوع دارای یک بیت " +"علامت، توان ۵ بیتی و دقت ۱۱ بیتی است (با ۱۰ بیت که به‌صورت صریح ذخیره " +"می‌شوند) و می‌تواند اعدادی بین تقریباً ``6.1e-05`` و ``6.5e+04`` را با دقت " +"کامل نمایش دهد. این نوع به‌طور گسترده توسط کامپایلرهای C پشتیبانی نمی‌شود: " +"اگر کامپایلر از پیوست H استاندارد C23 پشتیبانی کند، به‌عنوان نوع " +":c:expr:`_Float16` در دسترس است. در یک ماشین معمول، می‌توان از unsigned " +"short برای ذخیره‌سازی استفاده کرد، اما نه برای عملیات ریاضی. برای اطلاعات " +"بیشتر، صفحه‌ی ویکی‌پدیا درباره‌ی `قالب ممیز شناور با دقت نصفه `_ را ببینید." msgid "When packing, ``'x'`` inserts one NUL byte." -msgstr "" +msgstr "هنگام بسته‌بندی، ``'x'`` یک بایت NUL درج می‌کند." -msgid "The ``'p'`` format character encodes a \"Pascal string\", meaning a short variable-length string stored in a *fixed number of bytes*, given by the count. The first byte stored is the length of the string, or 255, whichever is smaller. The bytes of the string follow. If the byte string passed in to :func:`pack` is too long (longer than the count minus 1), only the leading ``count-1`` bytes of the string are stored. If the byte string is shorter than ``count-1``, it is padded with null bytes so that exactly count bytes in all are used. Note that for :func:`unpack`, the ``'p'`` format character consumes ``count`` bytes, but that the :class:`!bytes` object returned can never contain more than 255 bytes. When packing, arguments of types :class:`bytes` and :class:`bytearray` are accepted." -msgstr "" +msgid "" +"The ``'p'`` format character encodes a \"Pascal string\", meaning a short " +"variable-length string stored in a *fixed number of bytes*, given by the " +"count. The first byte stored is the length of the string, or 255, whichever " +"is smaller. The bytes of the string follow. If the byte string passed in " +"to :func:`pack` is too long (longer than the count minus 1), only the " +"leading ``count-1`` bytes of the string are stored. If the byte string is " +"shorter than ``count-1``, it is padded with null bytes so that exactly count" +" bytes in all are used. Note that for :func:`unpack`, the ``'p'`` format " +"character consumes ``count`` bytes, but that the :class:`!bytes` object " +"returned can never contain more than 255 bytes. When packing, arguments of " +"types :class:`bytes` and :class:`bytearray` are accepted." +msgstr "" +"نویسه قالب ``'p'`` یک «رشته پاسکالی» را کدگذاری می‌کند، یعنی رشته‌ای کوتاه " +"با طول متغیر که در *تعداد ثابتی از بایت‌ها* ذخیره می‌شود و با تعداد (count) " +"مشخص می‌گردد. نخستین بایت ذخیره‌شده، طول رشته یا ۲۵۵ است، هرکدام که کوچک‌تر " +"باشد. بایت‌های رشته در ادامه می‌آیند. اگر رشته بایت داده‌شده به :func:`pack`" +" بیش از حد طولانی باشد (طولانی‌تر از count منهای ۱)، تنها ``count-1`` بایت " +"ابتدایی رشته ذخیره می‌شود. اگر رشته بایت کوتاه‌تر از ``count-1`` باشد، با " +"بایت‌های null پر می‌شود تا دقیقاً در مجموع count بایت استفاده شود. توجه " +"داشته باشید که برای :func:`unpack`، نویسه قالب ``'p'`` ``count`` بایت مصرف " +"می‌کند، اما شیء :class:`!bytes` برگشتی هرگز نمی‌تواند بیش از ۲۵۵ بایت داشته " +"باشد. هنگام pack کردن، آرگومان‌هایی از انواع :class:`bytes` و " +":class:`bytearray` پذیرفته می‌شوند." -msgid "For the ``'s'`` format character, the count is interpreted as the length of the byte string, not a repeat count like for the other format characters; for example, ``'10s'`` means a single 10-byte string mapping to or from a single Python byte string, while ``'10c'`` means 10 separate one byte character elements (e.g., ``cccccccccc``) mapping to or from ten different Python byte objects. (See :ref:`struct-examples` for a concrete demonstration of the difference.) If a count is not given, it defaults to 1. For packing, the byte string is truncated or padded with null bytes as appropriate to make it fit. For unpacking, the resulting :class:`!bytes` object always has exactly the specified number of bytes. As a special case, ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 characters). When packing, arguments of types :class:`bytes` and :class:`bytearray` are accepted." -msgstr "" +msgid "" +"For the ``'s'`` format character, the count is interpreted as the length of " +"the byte string, not a repeat count like for the other format characters; " +"for example, ``'10s'`` means a single 10-byte string mapping to or from a " +"single Python byte string, while ``'10c'`` means 10 separate one byte " +"character elements (e.g., ``cccccccccc``) mapping to or from ten different " +"Python byte objects. (See :ref:`struct-examples` for a concrete " +"demonstration of the difference.) If a count is not given, it defaults to 1." +" For packing, the byte string is truncated or padded with null bytes as " +"appropriate to make it fit. For unpacking, the resulting :class:`!bytes` " +"object always has exactly the specified number of bytes. As a special case," +" ``'0s'`` means a single, empty byte string (while ``'0c'`` means 0 " +"characters). When packing, arguments of types :class:`bytes` and " +":class:`bytearray` are accepted." +msgstr "" +"برای نویسه‌ی قالب ``'s'``، تعداد به‌عنوان طول رشته‌ی بایتی تفسیر می‌شود، نه " +"به‌عنوان تعداد تکرار مانند دیگر نویسه‌های قالب؛ برای مثال، ``'10s'`` " +"به‌معنای یک رشته‌ی ۱۰ بایتی واحد است که به یک رشته‌ی بایتی پایتون یا از آن " +"نگاشت می‌شود، در حالی که ``'10c'`` به‌معنای ۱۰ المان نویسه‌ای یک‌بایتی " +"جداگانه (مانند ``cccccccccc``) است که به ۱۰ شیء بایتی متفاوت پایتون یا از " +"آن‌ها نگاشت می‌شوند. (برای نمایش ملموس این تفاوت، :ref:`struct-examples` را " +"ببینید.) اگر تعدادی داده نشود، مقدار پیش‌فرض ۱ است. در بسته‌بندی، رشته‌ی " +"بایتی در صورت لزوم بریده می‌شود یا با بایت‌های تهی پر می‌شود تا در قالب جای " +"گیرد. در واگشایی، شیء :class:`!bytes` حاصل همیشه دقیقاً دارای تعداد بایت " +"مشخص‌شده است. به‌عنوان یک حالت خاص، ``'0s'`` به‌معنای یک رشته‌ی بایتی خالی " +"واحد است (در حالی که ``'0c'`` به‌معنای ۰ نویسه است). هنگام بسته‌بندی، " +"آرگومان‌هایی از انواع :class:`bytes` و :class:`bytearray` پذیرفته می‌شوند." -msgid "For the ``'F'`` and ``'D'`` format characters, the packed representation uses the IEEE 754 binary32 and binary64 format for components of the complex number, regardless of the floating-point format used by the platform. Note that complex types (``F`` and ``D``) are available unconditionally, despite complex types being an optional feature in C. As specified in the C11 standard, each complex type is represented by a two-element C array containing, respectively, the real and imaginary parts." -msgstr "" +msgid "" +"For the ``'F'`` and ``'D'`` format characters, the packed representation " +"uses the IEEE 754 binary32 and binary64 format for components of the complex" +" number, regardless of the floating-point format used by the platform. Note " +"that complex types (``F`` and ``D``) are available unconditionally, despite " +"complex types being an optional feature in C. As specified in the C11 " +"standard, each complex type is represented by a two-element C array " +"containing, respectively, the real and imaginary parts." +msgstr "" +"برای نویسه‌های قالب ``'F'`` و ``'D'``، نمایش فشرده از قالب IEEE 754 binary32" +" و binary64 برای کامپوننت‌های عدد مختلط استفاده می‌کند، صرف‌نظر از قالب ممیز " +"شناور استفاده‌شده توسط سکو. توجه داشته باشید که انواع مختلط (``F`` و ``D``) " +"به‌طور غیرمشروط در دسترس هستند، با وجود اینکه انواع مختلط یک ویژگی اختیاری " +"در C هستند. همان‌طور که در استاندارد C11 مشخص شده است، هر نوع مختلط به‌صورت " +"یک آرایه C دو عنصری نمایش داده می‌شود که به‌ترتیب شامل بخش حقیقی و بخش " +"موهومی است." -msgid "A format character may be preceded by an integral repeat count. For example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." +msgid "" +"A format character may be preceded by an integral repeat count. For " +"example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." msgstr "" +"می‌توان پیش از یک نویسه قالب، یک تعداد تکرار صحیح قرار داد. برای مثال، رشته " +"قالب ``'4h'`` دقیقاً همان معنای ``'hhhh'`` را دارد." -msgid "Whitespace characters between formats are ignored; a count and its format must not contain whitespace though." +msgid "" +"Whitespace characters between formats are ignored; a count and its format " +"must not contain whitespace though." msgstr "" +"نویسه‌های فضای سفید بین قالب‌ها نادیده گرفته می‌شوند؛ هرچند یک تعداد و قالب " +"آن نباید شامل فضای سفید باشند." -msgid "When packing a value ``x`` using one of the integer formats (``'b'``, ``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, ``'Q'``), if ``x`` is outside the valid range for that format then :exc:`struct.error` is raised." +msgid "" +"When packing a value ``x`` using one of the integer formats (``'b'``, " +"``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, " +"``'Q'``), if ``x`` is outside the valid range for that format then " +":exc:`struct.error` is raised." msgstr "" +"هنگام بسته‌بندی (packing) یک مقدار ``x`` با استفاده از یکی از قالب‌های عدد " +"صحیح (``'b'``، ``'B'``، ``'h'``، ``'H'``، ``'i'``، ``'I'``، ``'l'``، " +"``'L'``، ``'q'``، ``'Q'``)، اگر ``x`` خارج از محدوده معتبر برای آن قالب " +"باشد، :exc:`struct.error` پرتاب می‌شود." -msgid "Previously, some of the integer formats wrapped out-of-range values and raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." +msgid "" +"Previously, some of the integer formats wrapped out-of-range values and " +"raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" +"پیش از این، برخی از قالب‌های عدد صحیح، مقادیر خارج از محدوده را wrap " +"می‌کردند و به‌جای :exc:`struct.error `، " +":exc:`DeprecationWarning ` را پرتاب می‌کردند." -msgid "For the ``'?'`` format character, the return value is either :const:`True` or :const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be ``True`` when unpacking." +msgid "" +"For the ``'?'`` format character, the return value is either :const:`True` " +"or :const:`False`. When packing, the truth value of the argument object is " +"used. Either 0 or 1 in the native or standard bool representation will be " +"packed, and any non-zero value will be ``True`` when unpacking." msgstr "" +"برای نویسه‌ی قالب ``'?'``، مقدار بازگشتی یا :const:`True` است یا " +":const:`False`. هنگام بسته‌بندی، از مقدار درستی شیء آرگومان استفاده می‌شود. " +"یکی از مقادیر ۰ یا ۱ در نمایش بولی بومی یا استاندارد بسته‌بندی می‌شود، و هر " +"مقدار غیرصفر هنگام واگشایی ``True`` خواهد بود." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "Native byte order examples (designated by the ``'@'`` format prefix or lack of any prefix character) may not match what the reader's machine produces as that depends on the platform and compiler." +msgid "" +"Native byte order examples (designated by the ``'@'`` format prefix or lack " +"of any prefix character) may not match what the reader's machine produces as" +" that depends on the platform and compiler." msgstr "" +"مثال‌های ترتیب بایت‌های بومی (native byte order) (که با پیشوند قالب ``'@'`` " +"یا فقدان هر نویسه‌ی پیشوند مشخص می‌شوند) ممکن است با آنچه دستگاه خواننده " +"تولید می‌کند مطابقت نداشته باشند، زیرا این امر به سکو و کامپایلر بستگی دارد." -msgid "Pack and unpack integers of three different sizes, using big endian ordering::" +msgid "" +"Pack and unpack integers of three different sizes, using big endian " +"ordering::" msgstr "" +"بسته‌بندی و واگشایی اعداد صحیح در سه اندازه‌ی مختلف، با استفاده از ترتیب " +"بایت‌بزرگ (big endian)::" msgid "" ">>> from struct import *\n" @@ -475,9 +823,18 @@ msgid "" ">>> calcsize('>bhl')\n" "7" msgstr "" +">>> from struct import *\n" +">>> pack(\">bhl\", 1, 2, 3)\n" +"b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03'\n" +">>> unpack('>bhl', b'\\x01\\x00\\x02\\x00\\x00\\x00\\x03')\n" +"(1, 2, 3)\n" +">>> calcsize('>bhl')\n" +"7" msgid "Attempt to pack an integer which is too large for the defined field::" msgstr "" +"تلاش برای بسته‌بندی (pack) یک عدد صحیح که برای فیلد تعریف‌شده بیش از حد بزرگ" +" است::" msgid "" ">>> pack(\">h\", 99999)\n" @@ -485,9 +842,14 @@ msgid "" " File \"\", line 1, in \n" "struct.error: 'h' format requires -32768 <= number <= 32767" msgstr "" +">>> pack(\">h\", 99999)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"struct.error: 'h' format requires -32768 <= number <= 32767" -msgid "Demonstrate the difference between ``'s'`` and ``'c'`` format characters::" -msgstr "" +msgid "" +"Demonstrate the difference between ``'s'`` and ``'c'`` format characters::" +msgstr "نمایش تفاوت بین نویسه‌های قالب‌بندی ``'s'`` و ``'c'``::" msgid "" ">>> pack(\"@ccc\", b'1', b'2', b'3')\n" @@ -495,9 +857,17 @@ msgid "" ">>> pack(\"@3s\", b'123')\n" "b'123'" msgstr "" +">>> pack(\"@ccc\", b'1', b'2', b'3')\n" +"b'123'\n" +">>> pack(\"@3s\", b'123')\n" +"b'123'" -msgid "Unpacked fields can be named by assigning them to variables or by wrapping the result in a named tuple::" +msgid "" +"Unpacked fields can be named by assigning them to variables or by wrapping " +"the result in a named tuple::" msgstr "" +"می‌توان فیلدهای واگشایی‌شده را با انتساب آن‌ها به متغیرها یا با قرار دادن " +"نتیجه در یک تاپل نام‌دار (named tuple) نام‌گذاری کرد::" msgid "" ">>> record = b'raymond \\x32\\x12\\x08\\x01\\x08'\n" @@ -508,9 +878,28 @@ msgid "" ">>> Student._make(unpack('<10sHHb', record))\n" "Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)" msgstr "" +">>> record = b'raymond \\x32\\x12\\x08\\x01\\x08'\n" +">>> name, serialnum, school, gradelevel = unpack('<10sHHb', record)\n" +"\n" +">>> from collections import namedtuple\n" +">>> Student = namedtuple('Student', 'name serialnum school gradelevel')\n" +">>> Student._make(unpack('<10sHHb', record))\n" +"Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)" -msgid "The ordering of format characters may have an impact on size in native mode since padding is implicit. In standard mode, the user is responsible for inserting any desired padding. Note in the first ``pack`` call below that three NUL bytes were added after the packed ``'#'`` to align the following integer on a four-byte boundary. In this example, the output was produced on a little endian machine::" -msgstr "" +msgid "" +"The ordering of format characters may have an impact on size in native mode " +"since padding is implicit. In standard mode, the user is responsible for " +"inserting any desired padding. Note in the first ``pack`` call below that " +"three NUL bytes were added after the packed ``'#'`` to align the following " +"integer on a four-byte boundary. In this example, the output was produced on" +" a little endian machine::" +msgstr "" +"ترتیب نویسه‌های قالب ممکن است در حالت بومی بر اندازه تأثیر بگذارد، زیرا " +"پرکننده (padding) ضمنی است. در حالت استاندارد، کاربر مسئول درج هرگونه " +"پرکننده دلخواه است. توجه داشته باشید که در اولین فراخوانی ``pack`` در زیر، ۳" +" بایت NUL پس از ``'#'`` بسته‌بندی‌شده اضافه شدند تا عدد صحیح بعدی روی مرز ۴ " +"بایتی تراز شود. در این مثال، خروجی روی یک ماشین با ترتیب بایت کم‌ارزش در " +"ابتدا (little endian) تولید شده است::" msgid "" ">>> pack('@ci', b'#', 0x12131415)\n" @@ -522,47 +911,88 @@ msgid "" ">>> calcsize('@ic')\n" "5" msgstr "" +">>> pack('@ci', b'#', 0x12131415)\n" +"b'#\\x00\\x00\\x00\\x15\\x14\\x13\\x12'\n" +">>> pack('@ic', 0x12131415, b'#')\n" +"b'\\x15\\x14\\x13\\x12#'\n" +">>> calcsize('@ci')\n" +"8\n" +">>> calcsize('@ic')\n" +"5" -msgid "The following format ``'llh0l'`` results in two pad bytes being added at the end, assuming the platform's longs are aligned on 4-byte boundaries::" +msgid "" +"The following format ``'llh0l'`` results in two pad bytes being added at the" +" end, assuming the platform's longs are aligned on 4-byte boundaries::" msgstr "" +"قالب زیر ``'llh0l'`` منجر به افزوده شدن دو بایت پرکننده (pad bytes) در انتها" +" می‌شود، با فرض تراز بودن نوع long پلتفرم روی مرزهای ۴ بایتی::" msgid "" ">>> pack('@llh0l', 1, 2, 3)\n" "b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'" msgstr "" +">>> pack('@llh0l', 1, 2, 3)\n" +"b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'" msgid "Module :mod:`array`" -msgstr "" +msgstr "ماژول :mod:`array`" msgid "Packed binary storage of homogeneous data." -msgstr "" +msgstr "ذخیره‌سازی دودویی فشرده از داده‌های همگن." msgid "Module :mod:`json`" -msgstr "" +msgstr "ماژول :mod:`json`" msgid "JSON encoder and decoder." -msgstr "" +msgstr "کدگذار و کدگشای JSON." msgid "Module :mod:`pickle`" -msgstr "" +msgstr "ماژول :mod:`pickle`" msgid "Python object serialization." -msgstr "" +msgstr "سریال‌سازی شیء پایتون." msgid "Applications" -msgstr "" +msgstr "برنامه‌های کاربردی" -msgid "Two main applications for the :mod:`!struct` module exist, data interchange between Python and C code within an application or another application compiled using the same compiler (:ref:`native formats`), and data interchange between applications using agreed upon data layout (:ref:`standard formats`). Generally speaking, the format strings constructed for these two domains are distinct." -msgstr "" +msgid "" +"Two main applications for the :mod:`!struct` module exist, data interchange " +"between Python and C code within an application or another application " +"compiled using the same compiler (:ref:`native formats `), and data interchange between applications using agreed upon data" +" layout (:ref:`standard formats `). Generally " +"speaking, the format strings constructed for these two domains are distinct." +msgstr "" +"دو کاربرد اصلی برای ماژول :mod:`!struct` وجود دارد: تبادل داده بین کد پایتون " +"و C درون یک برنامه یا برنامه‌ای دیگر که با همان کامپایلر کامپایل شده است " +"(:ref:`قالب‌های بومی `)، و تبادل داده بین برنامه‌هایی " +"که از چیدمان داده‌ی توافق‌شده استفاده می‌کنند (:ref:`قالب‌های استاندارد " +"`). به‌طور کلی، رشته‌های قالب ساخته‌شده برای این " +"دو حوزه از هم متمایز هستند." msgid "Native Formats" -msgstr "" +msgstr "قالب‌های بومی" -msgid "When constructing format strings which mimic native layouts, the compiler and machine architecture determine byte ordering and padding. In such cases, the ``@`` format character should be used to specify native byte ordering and data sizes. Internal pad bytes are normally inserted automatically. It is possible that a zero-repeat format code will be needed at the end of a format string to round up to the correct byte boundary for proper alignment of consecutive chunks of data." -msgstr "" +msgid "" +"When constructing format strings which mimic native layouts, the compiler " +"and machine architecture determine byte ordering and padding. In such cases," +" the ``@`` format character should be used to specify native byte ordering " +"and data sizes. Internal pad bytes are normally inserted automatically. It" +" is possible that a zero-repeat format code will be needed at the end of a " +"format string to round up to the correct byte boundary for proper alignment " +"of consecutive chunks of data." +msgstr "" +"هنگام ساخت رشته‌های قالب که چیدمان‌های بومی را تقلید می‌کنند، کامپایلر و " +"معماری ماشین ترتیب بایت‌ها و پرکننده‌گذاری را تعیین می‌کنند. در چنین مواردی،" +" باید از نویسه‌ی قالب ``@`` برای مشخص کردن ترتیب بایت بومی و اندازه‌های داده " +"استفاده شود. بایت‌های پرکننده داخلی معمولاً به‌طور خودکار درج می‌شوند. ممکن " +"است در انتهای یک رشته قالب به یک کد پیش‌ساخته با تکرار صفر نیاز باشد تا به مرز " +"بایت صحیح گرد شود و تراز مناسب تکه‌های متوالی داده فراهم گردد." -msgid "Consider these two simple examples (on a 64-bit, little-endian machine)::" +msgid "" +"Consider these two simple examples (on a 64-bit, little-endian machine)::" msgstr "" +"این دو مثال ساده را در نظر بگیرید (روی یک ماشین ۶۴بیتی، کوچک‌اندیان)::" msgid "" ">>> calcsize('@lhl')\n" @@ -570,26 +1000,66 @@ msgid "" ">>> calcsize('@llh')\n" "18" msgstr "" +">>> calcsize('@lhl')\n" +"24\n" +">>> calcsize('@llh')\n" +"18" -msgid "Data is not padded to an 8-byte boundary at the end of the second format string without the use of extra padding. A zero-repeat format code solves that problem::" +msgid "" +"Data is not padded to an 8-byte boundary at the end of the second format " +"string without the use of extra padding. A zero-repeat format code solves " +"that problem::" msgstr "" +"بدون استفاده از پد (padding) اضافی، داده‌ها در انتهای دومین رشته‌ی قالب تا یک" +" مرز ۸ بایتی پد نمی‌شوند. یک کد پیش‌ساخته با تکرار صفر این مشکل را حل می‌کند::" msgid "" ">>> calcsize('@llh0l')\n" "24" msgstr "" +">>> calcsize('@llh0l')\n" +"24" -msgid "The ``'x'`` format code can be used to specify the repeat, but for native formats it is better to use a zero-repeat format like ``'0l'``." +msgid "" +"The ``'x'`` format code can be used to specify the repeat, but for native " +"formats it is better to use a zero-repeat format like ``'0l'``." msgstr "" +"می‌توانید از کد پیش‌ساخته ``'x'`` برای مشخص کردن تعداد تکرار استفاده کنید، اما " +"برای قالب‌های بومی بهتر است از یک قالب با تکرار صفر مانند ``'0l'`` استفاده " +"کنید." -msgid "By default, native byte ordering and alignment is used, but it is better to be explicit and use the ``'@'`` prefix character." +msgid "" +"By default, native byte ordering and alignment is used, but it is better to " +"be explicit and use the ``'@'`` prefix character." msgstr "" +"به‌طور پیش‌فرض، از ترتیب بایت‌ها و ترازبندی بومی استفاده می‌شود، اما بهتر " +"است صریح باشید و از نویسه‌ی پیشوند ``'@'`` استفاده کنید." msgid "Standard Formats" -msgstr "" +msgstr "قالب‌های استاندارد" -msgid "When exchanging data beyond your process such as networking or storage, be precise. Specify the exact byte order, size, and alignment. Do not assume they match the native order of a particular machine. For example, network byte order is big-endian, while many popular CPUs are little-endian. By defining this explicitly, the user need not care about the specifics of the platform their code is running on. The first character should typically be ``<`` or ``>`` (or ``!``). Padding is the responsibility of the programmer. The zero-repeat format character won't work. Instead, the user must explicitly add ``'x'`` pad bytes where needed. Revisiting the examples from the previous section, we have::" -msgstr "" +msgid "" +"When exchanging data beyond your process such as networking or storage, be " +"precise. Specify the exact byte order, size, and alignment. Do not assume " +"they match the native order of a particular machine. For example, network " +"byte order is big-endian, while many popular CPUs are little-endian. By " +"defining this explicitly, the user need not care about the specifics of the " +"platform their code is running on. The first character should typically be " +"``<`` or ``>`` (or ``!``). Padding is the responsibility of the programmer." +" The zero-repeat format character won't work. Instead, the user must " +"explicitly add ``'x'`` pad bytes where needed. Revisiting the examples from" +" the previous section, we have::" +msgstr "" +"هنگام تبادل داده فراتر از فرایند خود، مانند شبکه یا ذخیره‌سازی، دقیق باشید. " +"ترتیب بایت، اندازه و ترازبندی را دقیقاً مشخص کنید. فرض نکنید که آن‌ها با " +"ترتیب بومی یک ماشین خاص مطابقت دارند. برای مثال، ترتیب بایت شبکه بزرگ‌اندیان" +" (big-endian) است، در حالی که بسیاری از پردازنده‌های رایج کوچک‌اندیان " +"(little-endian) هستند. با تعریف صریح این موارد، نیازی نیست کاربر به جزئیات " +"سکویی که کدش روی آن اجرا می‌شود توجه کند. اولین نویسه معمولاً باید ``<`` یا " +"``>`` (یا ``!``) باشد. مسئولیت پر کردن (padding) بر عهده‌ی برنامه‌نویس است. " +"نویسه‌ی قالب با تکرار صفر کار نمی‌کند. در عوض، کاربر باید به‌صراحت بایت‌های " +"پرکننده‌ی ``'x'`` را در صورت نیاز اضافه کند. با مرور مثال‌های بخش پیشین، " +"داریم::" msgid "" ">>> calcsize('>> pack('@llh0l', 1, 2, 3) == pack('>> calcsize('>> pack('>> calcsize('@llh')\n" +"18\n" +">>> pack('@llh', 1, 2, 3) == pack('>> calcsize('>> calcsize('@llh0l')\n" +"24\n" +">>> pack('@llh0l', 1, 2, 3) == pack('>> calcsize('>> pack('@llh0l', 1, 2, 3) == pack('>> calcsize('>> calcsize('@llh0l')\n" +"12\n" +">>> pack('@llh0l', 1, 2, 3) == pack(' (greater)" -msgstr "" +msgstr "> (بزرگ‌تر)" msgid "! (exclamation)" -msgstr "" +msgstr "! (علامت تعجب)" msgid "? (question mark)" -msgstr "" +msgstr "? (علامت سؤال)" diff --git a/library/subprocess.po b/library/subprocess.po index c18476367..59534e338 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:14+0000\n" +"PO-Revision-Date: 2026-08-28 11:35+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -22,65 +22,170 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!subprocess` --- Subprocess management" -msgstr "" +msgstr ":mod:`!subprocess` --- مدیریت زیرفرایند" msgid "**Source code:** :source:`Lib/subprocess.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/subprocess.py`" -msgid "The :mod:`!subprocess` module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several older modules and functions::" +msgid "" +"The :mod:`!subprocess` module allows you to spawn new processes, connect to " +"their input/output/error pipes, and obtain their return codes. This module " +"intends to replace several older modules and functions::" msgstr "" +"ماژول :mod:`!subprocess` به شما امکان می‌دهد فرایندهای جدید ایجاد کنید، به " +"پایپ‌های ورودی/خروجی/خطای آن‌ها متصل شوید و کدهای بازگشت آن‌ها را دریافت کنید. " +"این ماژول قصد دارد جایگزین چندین ماژول و تابع قدیمی‌تر شود::" msgid "" "os.system\n" "os.spawn*" msgstr "" +"os.system\n" +"os.spawn*" -msgid "Information about how the :mod:`!subprocess` module can be used to replace these modules and functions can be found in the following sections." +msgid "" +"Information about how the :mod:`!subprocess` module can be used to replace " +"these modules and functions can be found in the following sections." msgstr "" +"اطلاعات مربوط به چگونگی استفاده از ماژول :mod:`!subprocess` برای جایگزینی این " +"ماژول‌ها و توابع را می‌توان در بخش‌های زیر یافت." msgid ":pep:`324` -- PEP proposing the subprocess module" -msgstr "" +msgstr ":pep:`324` -- PEP پیشنهادی برای ماژول subprocess" msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgid "" +"This module is not supported on :ref:`mobile platforms ` " +"or :ref:`WebAssembly platforms `." msgstr "" +"این ماژول در :ref:`پلتفرم‌های موبایل ` یا :ref:`پلتفرم‌های " +"WebAssembly ` پشتیبانی نمی‌شود." msgid "Using the :mod:`!subprocess` Module" -msgstr "" +msgstr "استفاده از ماژول :mod:`!subprocess`" -msgid "The recommended approach to invoking subprocesses is to use the :func:`run` function for all use cases it can handle. For more advanced use cases, the underlying :class:`Popen` interface can be used directly." +msgid "" +"The recommended approach to invoking subprocesses is to use the :func:`run` " +"function for all use cases it can handle. For more advanced use cases, the " +"underlying :class:`Popen` interface can be used directly." msgstr "" +"رویکرد توصیه‌شده برای فراخوانی زیرفرایندها، استفاده از تابع :func:`run` برای " +"تمام موارد استفاده‌ای است که می‌تواند از عهده‌ی آن‌ها برآید. برای موارد استفاده‌ی " +"پیشرفته‌تر، می‌توانید مستقیماً از رابط زیربنایی :class:`Popen` استفاده کنید." -msgid "Run the command described by *args*. Wait for command to complete, then return a :class:`CompletedProcess` instance." +msgid "" +"Run the command described by *args*. Wait for command to complete, then " +"return a :class:`CompletedProcess` instance." msgstr "" +"فرمان توصیف‌شده توسط *args* را اجرا کنید. منتظر بمانید تا فرمان کامل شود، سپس " +"نمونه‌ای از :class:`CompletedProcess` را برگردانید." -msgid "The arguments shown above are merely the most common ones, described below in :ref:`frequently-used-arguments` (hence the use of keyword-only notation in the abbreviated signature). The full function signature is largely the same as that of the :class:`Popen` constructor - most of the arguments to this function are passed through to that interface. (*timeout*, *input*, *check*, and *capture_output* are not.)" -msgstr "" +msgid "" +"The arguments shown above are merely the most common ones, described below " +"in :ref:`frequently-used-arguments` (hence the use of keyword-only notation " +"in the abbreviated signature). The full function signature is largely the " +"same as that of the :class:`Popen` constructor - most of the arguments to " +"this function are passed through to that interface. (*timeout*, *input*, " +"*check*, and *capture_output* are not.)" +msgstr "" +"آرگومان‌های نشان‌داده‌شده در بالا صرفاً رایج‌ترین آرگومان‌ها هستند که در ادامه " +"در :ref:`frequently-used-arguments` توضیح داده شده‌اند (به همین دلیل از " +"نمادگذاری فقط‌کلیدواژه‌ای در امضای مختصر استفاده شده است). امضای کامل تابع تا " +"حد زیادی همان امضای سازنده‌ی :class:`Popen` است — بیشتر آرگومان‌های این تابع به " +"آن رابط منتقل می‌شوند. (*timeout*، *input*، *check* و *capture_output* منتقل " +"نمی‌شوند.)" -msgid "If *capture_output* is true, stdout and stderr will be captured. When used, the internal :class:`Popen` object is automatically created with *stdout* and *stderr* both set to :data:`~subprocess.PIPE`. The *stdout* and *stderr* arguments may not be supplied at the same time as *capture_output*. If you wish to capture and combine both streams into one, set *stdout* to :data:`~subprocess.PIPE` and *stderr* to :data:`~subprocess.STDOUT`, instead of using *capture_output*." -msgstr "" +msgid "" +"If *capture_output* is true, stdout and stderr will be captured. When used, " +"the internal :class:`Popen` object is automatically created with *stdout* and " +"*stderr* both set to :data:`~subprocess.PIPE`. The *stdout* and *stderr* " +"arguments may not be supplied at the same time as *capture_output*. If you " +"wish to capture and combine both streams into one, set *stdout* " +"to :data:`~subprocess.PIPE` and *stderr* to :data:`~subprocess.STDOUT`, " +"instead of using *capture_output*." +msgstr "" +"اگر *capture_output* مقدار true داشته باشد، stdout و stderr گرفته می‌شوند. در " +"صورت استفاده، شیء داخلی :class:`Popen` به‌طور خودکار در حالی ایجاد می‌شود که " +"*stdout* و *stderr* هر دو روی :data:`~subprocess.PIPE` تنظیم شده‌اند. " +"آرگومان‌های *stdout* و *stderr* نمی‌توانند همزمان با *capture_output* ارائه " +"شوند. اگر می‌خواهید هر دو جریان را بگیرید و در یک جریان ادغام کنید، به‌جای " +"استفاده از *capture_output*، *stdout* را روی :data:`~subprocess.PIPE` و " +"*stderr* را روی :data:`~subprocess.STDOUT` تنظیم کنید." -msgid "A *timeout* may be specified in seconds, it is internally passed on to :meth:`Popen.communicate`. If the timeout expires, the child process will be killed and waited for. The :exc:`TimeoutExpired` exception will be re-raised after the child process has terminated. The initial process creation itself cannot be interrupted on many platform APIs so you are not guaranteed to see a timeout exception until at least after however long process creation takes." -msgstr "" +msgid "" +"A *timeout* may be specified in seconds, it is internally passed on " +"to :meth:`Popen.communicate`. If the timeout expires, the child process will " +"be killed and waited for. The :exc:`TimeoutExpired` exception will be re-" +"raised after the child process has terminated. The initial process creation " +"itself cannot be interrupted on many platform APIs so you are not guaranteed " +"to see a timeout exception until at least after however long process creation " +"takes." +msgstr "" +"ممکن است یک *مهلت* (timeout) بر حسب ثانیه مشخص شود، این مقدار به‌صورت داخلی " +"به :meth:`Popen.communicate` ارسال می‌شود. اگر مهلت منقضی شود، فرایند فرزند " +"کشته خواهد شد و برای آن انتظار کشیده خواهد شد. استثنای :exc:`TimeoutExpired` " +"پس از خاتمه فرایند فرزند دوباره پرتاب خواهد شد. خودِ ایجاد اولیه‌ی فرایند در " +"بسیاری از APIهای پلتفرم قابل وقفه نیست، بنابراین تضمینی وجود ندارد که استثنای " +"مهلت را حداقل تا پس از پایان ایجاد فرایند، هر چقدر هم که طول بکشد، مشاهده " +"کنید." -msgid "The *input* argument is passed to :meth:`Popen.communicate` and thus to the subprocess's stdin. If used it must be a byte sequence, or a string if *encoding* or *errors* is specified or *text* is true. When used, the internal :class:`Popen` object is automatically created with *stdin* set to :data:`~subprocess.PIPE`, and the *stdin* argument may not be used as well." -msgstr "" +msgid "" +"The *input* argument is passed to :meth:`Popen.communicate` and thus to the " +"subprocess's stdin. If used it must be a byte sequence, or a string if " +"*encoding* or *errors* is specified or *text* is true. When used, the " +"internal :class:`Popen` object is automatically created with *stdin* set " +"to :data:`~subprocess.PIPE`, and the *stdin* argument may not be used as well." +msgstr "" +"آرگومان *input* به :meth:`Popen.communicate` و در نتیجه به stdin زیرفرایند " +"ارسال می‌شود. در صورت استفاده، باید دنباله‌ای از بایت‌ها باشد، یا اگر *encoding* " +"یا *errors* مشخص شده باشد یا *text* درست باشد، یک رشته باشد. هنگام استفاده، " +"شیء :class:`Popen` داخلی به‌طور خودکار با *stdin* تنظیم‌شده " +"روی :data:`~subprocess.PIPE` ایجاد می‌شود، و نمی‌توان همزمان از آرگومان *stdin* " +"نیز استفاده کرد." -msgid "If *check* is true, and the process exits with a non-zero exit code, a :exc:`CalledProcessError` exception will be raised. Attributes of that exception hold the arguments, the exit code, and stdout and stderr if they were captured." +msgid "" +"If *check* is true, and the process exits with a non-zero exit code, " +"a :exc:`CalledProcessError` exception will be raised. Attributes of that " +"exception hold the arguments, the exit code, and stdout and stderr if they " +"were captured." msgstr "" +"اگر *check* درست باشد و فرایند با کد خروجی غیرصفر خارج شود، " +"استثنای :exc:`CalledProcessError` پرتاب خواهد شد. ویژگی‌های آن استثنا شامل " +"آرگومان‌ها، کد خروجی، و stdout و stderr هستند، اگر این‌ها گرفته‌شده باشند." -msgid "If *encoding* or *errors* are specified, or *text* is true, file objects for stdin, stdout and stderr are opened in text mode using the specified *encoding* and *errors* or the :class:`io.TextIOWrapper` default. The *universal_newlines* argument is equivalent to *text* and is provided for backwards compatibility. By default, file objects are opened in binary mode." -msgstr "" +msgid "" +"If *encoding* or *errors* are specified, or *text* is true, file objects for " +"stdin, stdout and stderr are opened in text mode using the specified " +"*encoding* and *errors* or the :class:`io.TextIOWrapper` default. The " +"*universal_newlines* argument is equivalent to *text* and is provided for " +"backwards compatibility. By default, file objects are opened in binary mode." +msgstr "" +"اگر *encoding* یا *errors* مشخص شده باشند، یا مقدار *text* درست باشد، اشیای " +"فایل برای stdin، stdout و stderr در حالت متنی با استفاده از *encoding* و " +"*errors* مشخص‌شده یا پیش‌فرض :class:`io.TextIOWrapper` باز می‌شوند. آرگومان " +"*universal_newlines* معادل *text* است و برای سازگاری با نسخه‌های پیشین ارائه " +"شده است. به‌طور پیش‌فرض، اشیای فایل در حالت دودویی باز می‌شوند." -msgid "If *env* is not ``None``, it must be a mapping that defines the environment variables for the new process; these are used instead of the default behavior of inheriting the current process' environment. It is passed directly to :class:`Popen`. This mapping can be str to str on any platform or bytes to bytes on POSIX platforms much like :data:`os.environ` or :data:`os.environb`." -msgstr "" +msgid "" +"If *env* is not ``None``, it must be a mapping that defines the environment " +"variables for the new process; these are used instead of the default behavior " +"of inheriting the current process' environment. It is passed directly " +"to :class:`Popen`. This mapping can be str to str on any platform or bytes to " +"bytes on POSIX platforms much like :data:`os.environ` or :data:`os.environb`." +msgstr "" +"اگر *env* ``None`` نباشد، باید نگاشتی باشد که متغیرهای محیطی فرایند جدید را " +"تعریف می‌کند؛ این متغیرها به جای رفتار پیش‌فرضِ به ارث بردن محیط فرایند جاری " +"استفاده می‌شوند. این نگاشت مستقیماً به :class:`Popen` داده می‌شود. این نگاشت " +"می‌تواند در هر پلتفرمی از str به str یا در پلتفرم‌های POSIX از bytes به bytes " +"باشد، درست مانند :data:`os.environ` یا :data:`os.environb`." msgid "Examples::" -msgstr "" +msgstr "مثال‌ها::" msgid "" ">>> subprocess.run([\"ls\", \"-l\"]) # doesn't capture output\n" @@ -89,456 +194,1198 @@ msgid "" ">>> subprocess.run(\"exit 1\", shell=True, check=True)\n" "Traceback (most recent call last):\n" " ...\n" -"subprocess.CalledProcessError: Command 'exit 1' returned non-zero exit status 1\n" +"subprocess.CalledProcessError: Command 'exit 1' returned non-zero exit status " +"1\n" "\n" ">>> subprocess.run([\"ls\", \"-l\", \"/dev/null\"], capture_output=True)\n" "CompletedProcess(args=['ls', '-l', '/dev/null'], returncode=0,\n" "stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\\n', stderr=b'')" msgstr "" +">>> subprocess.run([\"ls\", \"-l\"]) # doesn't capture output\n" +"CompletedProcess(args=['ls', '-l'], returncode=0)\n" +"\n" +">>> subprocess.run(\"exit 1\", shell=True, check=True)\n" +"Traceback (most recent call last):\n" +" ...\n" +"subprocess.CalledProcessError: Command 'exit 1' returned non-zero exit status " +"1\n" +"\n" +">>> subprocess.run([\"ls\", \"-l\", \"/dev/null\"], capture_output=True)\n" +"CompletedProcess(args=['ls', '-l', '/dev/null'], returncode=0,\n" +"stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\\n', stderr=b'')" msgid "Added *encoding* and *errors* parameters" -msgstr "" +msgstr "پارامترهای *encoding* و *errors* افزوده شدند" -msgid "Added the *text* parameter, as a more understandable alias of *universal_newlines*. Added the *capture_output* parameter." +msgid "" +"Added the *text* parameter, as a more understandable alias of " +"*universal_newlines*. Added the *capture_output* parameter." msgstr "" +"پارامتر *text*، به‌عنوان نام مستعار قابل‌فهم‌تر برای *universal_newlines*، " +"افزوده شد. پارامتر *capture_output* افزوده شد." -msgid "Changed Windows shell search order for ``shell=True``. The current directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%\\System32\\cmd.exe``. As a result, dropping a malicious program named ``cmd.exe`` into a current directory no longer works." +msgid "" +"Changed Windows shell search order for ``shell=True``. The current directory " +"and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" +"\\System32\\cmd.exe``. As a result, dropping a malicious program named " +"``cmd.exe`` into a current directory no longer works." msgstr "" +"ترتیب جستجوی پوسته‌ی ویندوز برای ``shell=True`` تغییر کرد. پوشه‌ی جاری و " +"``%PATH%`` با ``%COMSPEC%`` و ``%SystemRoot%\\System32\\cmd.exe`` جایگزین " +"شده‌اند. در نتیجه، قرار دادن یک برنامه‌ی مخرب با نام ``cmd.exe`` در پوشه‌ی جاری " +"دیگر کار نمی‌کند." -msgid "The return value from :func:`run`, representing a process that has finished." +msgid "" +"The return value from :func:`run`, representing a process that has finished." msgstr "" +"مقدار بازگشتی از :func:`run`، که نشان‌دهنده‌ی فرایندی است که به پایان رسیده است." -msgid "The arguments used to launch the process. This may be a list or a string." +msgid "" +"The arguments used to launch the process. This may be a list or a string." msgstr "" +"آرگومان‌های استفاده‌شده برای راه‌اندازی فرایند. این ممکن است یک فهرست یا یک رشته " +"باشد." -msgid "Exit status of the child process. Typically, an exit status of 0 indicates that it ran successfully." +msgid "" +"Exit status of the child process. Typically, an exit status of 0 indicates " +"that it ran successfully." msgstr "" +"وضعیت خروج فرایند فرزند. معمولاً وضعیت خروج ۰ نشان می‌دهد که با موفقیت اجرا شده " +"است." -msgid "A negative value ``-N`` indicates that the child was terminated by signal ``N`` (POSIX only)." +msgid "" +"A negative value ``-N`` indicates that the child was terminated by signal " +"``N`` (POSIX only)." msgstr "" +"یک مقدار منفی ``-N`` نشان می‌دهد که فرزند با سیگنال ``N`` خاتمه یافته است (فقط " +"POSIX)." -msgid "Captured stdout from the child process. A bytes sequence, or a string if :func:`run` was called with an encoding, errors, or text=True. ``None`` if stdout was not captured." +msgid "" +"Captured stdout from the child process. A bytes sequence, or a string " +"if :func:`run` was called with an encoding, errors, or text=True. ``None`` if " +"stdout was not captured." msgstr "" +"stdout گرفته‌شده از فرایند فرزند. دنباله‌ای از بایت‌ها، یا رشته‌ای " +"اگر :func:`run` با encoding، errors یا text=True فراخوانی شده باشد. اگر " +"stdout گرفته نشده باشد، ``None`` است." -msgid "If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr will be combined in this attribute, and :attr:`stderr` will be ``None``." +msgid "" +"If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr " +"will be combined in this attribute, and :attr:`stderr` will be ``None``." msgstr "" +"اگر فرایند را با ``stderr=subprocess.STDOUT`` اجرا کرده باشید، stdout و " +"stderr در این ویژگی ترکیب می‌شوند و :attr:`stderr` برابر ``None`` خواهد بود." -msgid "Captured stderr from the child process. A bytes sequence, or a string if :func:`run` was called with an encoding, errors, or text=True. ``None`` if stderr was not captured." +msgid "" +"Captured stderr from the child process. A bytes sequence, or a string " +"if :func:`run` was called with an encoding, errors, or text=True. ``None`` if " +"stderr was not captured." msgstr "" +"stderr گرفته‌شده از فرایند فرزند. دنباله‌ای از بایت‌ها، یا در صورتی " +"که :func:`run` با encoding، errors یا text=True فراخوانی شده باشد، یک رشته " +"است. اگر stderr گرفته نشده باشد، ``None`` است." msgid "If :attr:`returncode` is non-zero, raise a :exc:`CalledProcessError`." msgstr "" +"اگر :attr:`returncode` غیرصفر باشد، یک :exc:`CalledProcessError` پرتاب می‌شود." -msgid "Special value that can be used as the *stdin*, *stdout* or *stderr* argument to :class:`Popen` and indicates that the special file :data:`os.devnull` will be used." +msgid "" +"Special value that can be used as the *stdin*, *stdout* or *stderr* argument " +"to :class:`Popen` and indicates that the special file :data:`os.devnull` will " +"be used." msgstr "" +"مقدار ویژه‌ای که می‌تواند به‌عنوان آرگومان *stdin*، *stdout* یا *stderr* " +"برای :class:`Popen` استفاده شود و نشان می‌دهد که فایل ویژه‌ی :data:`os.devnull` " +"استفاده خواهد شد." -msgid "Special value that can be used as the *stdin*, *stdout* or *stderr* argument to :class:`Popen` and indicates that a pipe to the standard stream should be opened. Most useful with :meth:`Popen.communicate`." +msgid "" +"Special value that can be used as the *stdin*, *stdout* or *stderr* argument " +"to :class:`Popen` and indicates that a pipe to the standard stream should be " +"opened. Most useful with :meth:`Popen.communicate`." msgstr "" +"مقدار ویژه‌ای که می‌تواند به‌عنوان آرگومان *stdin*، *stdout* یا *stderr* " +"برای :class:`Popen` استفاده شود و نشان می‌دهد که باید یک پایپبه جریان " +"استاندارد باز شود. بیشترین کاربرد را با :meth:`Popen.communicate` دارد." -msgid "Special value that can be used as the *stderr* argument to :class:`Popen` and indicates that standard error should go into the same handle as standard output." +msgid "" +"Special value that can be used as the *stderr* argument to :class:`Popen` and " +"indicates that standard error should go into the same handle as standard " +"output." msgstr "" +"مقدار ویژه‌ای که می‌توان از آن به‌عنوان آرگومان *stderr* برای :class:`Popen` " +"استفاده کرد و نشان می‌دهد که خطای استاندارد باید به همان دسته خروجی " +"استاندارد برود." msgid "Base class for all other exceptions from this module." -msgstr "" +msgstr "کلاس پایه برای همه‌ی استثناهای دیگر این ماژول." -msgid "Subclass of :exc:`SubprocessError`, raised when a timeout expires while waiting for a child process." +msgid "" +"Subclass of :exc:`SubprocessError`, raised when a timeout expires while " +"waiting for a child process." msgstr "" +"زیرکلاسی از :exc:`SubprocessError`، زمانی پرتاب می‌شود که مهلت در حین انتظار " +"برای یک فرایند فرزند منقضی شود." msgid "Command that was used to spawn the child process." -msgstr "" +msgstr "فرمانی که برای ایجاد فرآیند فرزند استفاده شده است." msgid "Timeout in seconds." -msgstr "" +msgstr "مهلت زمانی به ثانیه." -msgid "Output of the child process if it was captured by :func:`run` or :func:`check_output`. Otherwise, ``None``. This is always :class:`bytes` when any output was captured regardless of the ``text=True`` setting. It may remain ``None`` instead of ``b''`` when no output was observed." +msgid "" +"Output of the child process if it was captured by :func:`run` " +"or :func:`check_output`. Otherwise, ``None``. This is always :class:`bytes` " +"when any output was captured regardless of the ``text=True`` setting. It may " +"remain ``None`` instead of ``b''`` when no output was observed." msgstr "" +"خروجی فرایند فرزند در صورتی که توسط :func:`run` یا :func:`check_output` ضبط " +"شده باشد. در غیر این صورت، ``None``. این مقدار هرگاه خروجی‌ای ضبط شده باشد، " +"صرف‌نظر از تنظیم ``text=True``، همیشه :class:`bytes` است. ممکن است در صورتی که " +"هیچ خروجی مشاهده نشود، به‌جای ``b''`` همان ``None`` باقی بماند." msgid "Alias for output, for symmetry with :attr:`stderr`." -msgstr "" +msgstr "نام مستعار برای خروجی، برای تقارن با :attr:`stderr`." -msgid "Stderr output of the child process if it was captured by :func:`run`. Otherwise, ``None``. This is always :class:`bytes` when stderr output was captured regardless of the ``text=True`` setting. It may remain ``None`` instead of ``b''`` when no stderr output was observed." +msgid "" +"Stderr output of the child process if it was captured by :func:`run`. " +"Otherwise, ``None``. This is always :class:`bytes` when stderr output was " +"captured regardless of the ``text=True`` setting. It may remain ``None`` " +"instead of ``b''`` when no stderr output was observed." msgstr "" +"خروجی stderr فرایند فرزند، در صورتی که توسط :func:`run` گرفته شده باشد. در " +"غیر این صورت، ``None``. این مقدار هر زمان که خروجی stderr گرفته شده باشد، " +"صرف‌نظر از تنظیم ``text=True``، همیشه :class:`bytes` است. در صورتی که هیچ " +"خروجی stderr مشاهده نشود، ممکن است به‌جای ``b''`` همان ``None`` باقی بماند." msgid "*stdout* and *stderr* attributes added" -msgstr "" +msgstr "ویژگی‌های *stdout* و *stderr* افزوده شدند" -msgid "Subclass of :exc:`SubprocessError`, raised when a process run by :func:`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) returns a non-zero exit status." +msgid "" +"Subclass of :exc:`SubprocessError`, raised when a process run " +"by :func:`check_call`, :func:`check_output`, or :func:`run` (with " +"``check=True``) returns a non-zero exit status." msgstr "" +"زیرکلاسی از :exc:`SubprocessError`، زمانی پرتاب می‌شود که فرایند اجراشده " +"به‌وسیله‌ی :func:`check_call`، :func:`check_output` یا :func:`run` (با " +"``check=True``) وضعیت خروجی غیرصفر برگرداند." -msgid "Exit status of the child process. If the process exited due to a signal, this will be the negative signal number." +msgid "" +"Exit status of the child process. If the process exited due to a signal, " +"this will be the negative signal number." msgstr "" +"وضعیت خروج فرآیند فرزند. اگر فرآیند به دلیل یک سیگنال خارج شده باشد، این " +"مقدار شماره سیگنال منفی خواهد بود." -msgid "Output of the child process if it was captured by :func:`run` or :func:`check_output`. Otherwise, ``None``." +msgid "" +"Output of the child process if it was captured by :func:`run` " +"or :func:`check_output`. Otherwise, ``None``." msgstr "" +"خروجی فرآیند فرزند، اگر توسط :func:`run` یا :func:`check_output` گرفته شده " +"باشد. در غیر این صورت، ``None``." -msgid "Stderr output of the child process if it was captured by :func:`run`. Otherwise, ``None``." +msgid "" +"Stderr output of the child process if it was captured by :func:`run`. " +"Otherwise, ``None``." msgstr "" +"خروجی stderr فرایند فرزند، اگر توسط :func:`run` گرفته شده باشد. در غیر این " +"صورت، ``None``." msgid "Frequently Used Arguments" -msgstr "" +msgstr "آرگومان‌های پرکاربرد" -msgid "To support a wide variety of use cases, the :class:`Popen` constructor (and the convenience functions) accept a large number of optional arguments. For most typical use cases, many of these arguments can be safely left at their default values. The arguments that are most commonly needed are:" +msgid "" +"To support a wide variety of use cases, the :class:`Popen` constructor (and " +"the convenience functions) accept a large number of optional arguments. For " +"most typical use cases, many of these arguments can be safely left at their " +"default values. The arguments that are most commonly needed are:" msgstr "" +"برای پشتیبانی از طیف گسترده‌ای از موارد استفاده، سازنده‌ی :class:`Popen` (و " +"توابع کمکی) تعداد زیادی آرگومان اختیاری می‌پذیرند. در بیشتر موارد استفاده‌ی " +"معمول، می‌توان بسیاری از این آرگومان‌ها را با اطمینان روی مقادیر پیش‌فرض خود " +"باقی گذاشت. آرگومان‌هایی که معمولاً بیش از همه مورد نیاز هستند:" -msgid "*args* is required for all calls and should be a string, or a sequence of program arguments. Providing a sequence of arguments is generally preferred, as it allows the module to take care of any required escaping and quoting of arguments (e.g. to permit spaces in file names). If passing a single string, either *shell* must be :const:`True` (see below) or else the string must simply name the program to be executed without specifying any arguments." -msgstr "" +msgid "" +"*args* is required for all calls and should be a string, or a sequence of " +"program arguments. Providing a sequence of arguments is generally preferred, " +"as it allows the module to take care of any required escaping and quoting of " +"arguments (e.g. to permit spaces in file names). If passing a single string, " +"either *shell* must be :const:`True` (see below) or else the string must " +"simply name the program to be executed without specifying any arguments." +msgstr "" +"*args* برای همه فراخوانی‌ها لازم است و باید یک رشته یا دنباله‌ای از آرگومان‌های " +"برنامه باشد. ارائه یک دنباله از آرگومان‌ها عموماً ترجیح داده می‌شود، زیرا به " +"ماژول اجازه می‌دهد هرگونه خنثی‌سازی و قرار دادن علامت نقل‌قول لازم برای " +"آرگومان‌ها را انجام دهد (برای مثال، برای مجاز بودن فاصله‌ها در نام فایل‌ها). اگر " +"یک رشته واحد ارسال می‌کنید، یا *shell* باید :const:`True` باشد (در زیر ببینید) " +"یا در غیر این صورت رشته باید صرفاً نام برنامه‌ای را که باید اجرا شود بدون مشخص " +"کردن هیچ آرگومانی بیان کند." -msgid "*stdin*, *stdout* and *stderr* specify the executed program's standard input, standard output and standard error file handles, respectively. Valid values are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a positive integer), and an existing :term:`file object` with a valid file descriptor. With the default settings of ``None``, no redirection will occur. :data:`PIPE` indicates that a new pipe to the child should be created. :data:`DEVNULL` indicates that the special file :data:`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, which indicates that the stderr data from the child process should be captured into the same file handle as for *stdout*." -msgstr "" +msgid "" +"*stdin*, *stdout* and *stderr* specify the executed program's standard input, " +"standard output and standard error file handles, respectively. Valid values " +"are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a " +"positive integer), and an existing :term:`file object` with a valid file " +"descriptor. With the default settings of ``None``, no redirection will " +"occur. :data:`PIPE` indicates that a new pipe to the child should be " +"created. :data:`DEVNULL` indicates that the special file :data:`os.devnull` " +"will be used. Additionally, *stderr* can be :data:`STDOUT`, which indicates " +"that the stderr data from the child process should be captured into the same " +"file handle as for *stdout*." +msgstr "" +"*stdin*، *stdout* و *stderr* به‌ترتیب دسته‌های فایل ورودی استاندارد، خروجی " +"استاندارد و خطای استاندارد برنامه‌ی اجراشده را مشخص می‌کنند. مقادیر معتبر " +"عبارتند از ``None``، :data:`PIPE`، :data:`DEVNULL`، یک توصیف‌گر فایل موجود (یک " +"عدد صحیح مثبت) و یک :term:`file object` موجود با یک توصیف‌گر فایل معتبر. با " +"تنظیمات پیش‌فرض ``None``، هیچ تغییر مسیری رخ نخواهد داد. :data:`PIPE` نشان " +"می‌دهد که باید یک پایپ جدید برای فرآیند فرزند ایجاد شود. :data:`DEVNULL` نشان " +"می‌دهد که از فایل ویژه‌ی :data:`os.devnull` استفاده خواهد شد. علاوه بر این، " +"*stderr* می‌تواند :data:`STDOUT` باشد، که نشان می‌دهد داده‌های stderr از فرآیند " +"فرزند باید در همان دسته فایل مربوط به *stdout* دریافت شوند." -msgid "If *encoding* or *errors* are specified, or *text* (also known as *universal_newlines*) is true, the file objects *stdin*, *stdout* and *stderr* will be opened in text mode using the *encoding* and *errors* specified in the call or the defaults for :class:`io.TextIOWrapper`." +msgid "" +"If *encoding* or *errors* are specified, or *text* (also known as " +"*universal_newlines*) is true, the file objects *stdin*, *stdout* and " +"*stderr* will be opened in text mode using the *encoding* and *errors* " +"specified in the call or the defaults for :class:`io.TextIOWrapper`." msgstr "" +"اگر *encoding* یا *errors* مشخص شده باشند، یا *text* (که با نام " +"*universal_newlines* نیز شناخته می‌شود) درست باشد، اشیای فایل *stdin*، " +"*stdout* و *stderr* در حالت متنی با استفاده از *encoding* و *errors* مشخص‌شده " +"در فراخوان یا پیش‌فرض‌های :class:`io.TextIOWrapper` باز خواهند شد." -msgid "For *stdin*, line ending characters ``'\\n'`` in the input will be converted to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, all line endings in the output will be converted to ``'\\n'``. For more information see the documentation of the :class:`io.TextIOWrapper` class when the *newline* argument to its constructor is ``None``." -msgstr "" +msgid "" +"For *stdin*, line ending characters ``'\\n'`` in the input will be converted " +"to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, " +"all line endings in the output will be converted to ``'\\n'``. For more " +"information see the documentation of the :class:`io.TextIOWrapper` class when " +"the *newline* argument to its constructor is ``None``." +msgstr "" +"برای *stdin*، نویسه‌های پایان خط ``'\\n'`` در ورودی به جداکننده‌ی خط " +"پیش‌فرض :data:`os.linesep` تبدیل می‌شوند. برای *stdout* و *stderr*، تمام " +"پایان‌های خط در خروجی به ``'\\n'`` تبدیل می‌شوند. برای اطلاعات بیشتر، مستندات " +"کلاس :class:`io.TextIOWrapper` را برای حالتی که آرگومان *newline* سازنده‌ی آن " +"``None`` است، ببینید." -msgid "If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as binary streams. No encoding or line ending conversion is performed." +msgid "" +"If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as " +"binary streams. No encoding or line ending conversion is performed." msgstr "" +"اگر از حالت متنی استفاده نشود، *stdin*، *stdout* و *stderr* به‌عنوان جریان‌های " +"دودویی باز خواهند شد. هیچ‌گونه کدگذاری یا تبدیل پایان خط انجام نمی‌شود." msgid "Added the *encoding* and *errors* parameters." -msgstr "" +msgstr "پارامترهای *encoding* و *errors* افزوده شدند." msgid "Added the *text* parameter as an alias for *universal_newlines*." -msgstr "" +msgstr "پارامتر *text* به‌عنوان نام مستعار برای *universal_newlines* اضافه شد." -msgid "The newlines attribute of the file objects :attr:`Popen.stdin`, :attr:`Popen.stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen.communicate` method." +msgid "" +"The newlines attribute of the file " +"objects :attr:`Popen.stdin`, :attr:`Popen.stdout` and :attr:`Popen.stderr` " +"are not updated by the :meth:`Popen.communicate` method." msgstr "" +"ویژگی newlines اشیای فایل :attr:`Popen.stdin`، :attr:`Popen.stdout` " +"و :attr:`Popen.stderr` توسط متد :meth:`Popen.communicate` به‌روزرسانی نمی‌شود." -msgid "If *shell* is ``True``, the specified command will be executed through the shell. This can be useful if you are using Python primarily for the enhanced control flow it offers over most system shells and still want convenient access to other shell features such as shell pipes, filename wildcards, environment variable expansion, and expansion of ``~`` to a user's home directory. However, note that Python itself offers implementations of many shell-like features (in particular, :mod:`glob`, :mod:`fnmatch`, :func:`os.walk`, :func:`os.path.expandvars`, :func:`os.path.expanduser`, and :mod:`shutil`)." -msgstr "" +msgid "" +"If *shell* is ``True``, the specified command will be executed through the " +"shell. This can be useful if you are using Python primarily for the enhanced " +"control flow it offers over most system shells and still want convenient " +"access to other shell features such as shell pipes, filename wildcards, " +"environment variable expansion, and expansion of ``~`` to a user's home " +"directory. However, note that Python itself offers implementations of many " +"shell-like features (in " +"particular, :mod:`glob`, :mod:`fnmatch`, :func:`os.walk`, :func:`os.path.expandvars`, :func:`os.path.expanduser`, " +"and :mod:`shutil`)." +msgstr "" +"اگر *shell* برابر ``True`` باشد، فرمان مشخص‌شده از طریق پوسته اجرا می‌شود. این " +"موضوع می‌تواند مفید باشد اگر شما از پایتون عمدتاً به دلیل جریان کنترل " +"پیشرفته‌تری که نسبت به بیشتر پوسته‌های سیستم ارائه می‌دهد استفاده می‌کنید و " +"همچنان می‌خواهید دسترسی آسانی به سایر امکانات پوسته داشته باشید، مانند پایپ‌های " +"پوسته، وایلدکارد نام فایل، بسط متغیرهای محیطی، و بسط ``~`` به پوشه‌ی خانه‌ی " +"کاربر. با این حال، توجه داشته باشید که خود پایتون پیاده‌سازی‌هایی از بسیاری از " +"امکانات شبه‌پوسته ارائه می‌دهد " +"(به‌ویژه :mod:`glob`، :mod:`fnmatch`، :func:`os.walk`، :func:`os.path.expandvars`، :func:`os.path.expanduser` " +"و :mod:`shutil`)." -msgid "When *universal_newlines* is ``True``, the class uses the encoding :func:`locale.getpreferredencoding(False) ` instead of ``locale.getpreferredencoding()``. See the :class:`io.TextIOWrapper` class for more information on this change." +msgid "" +"When *universal_newlines* is ``True``, the class uses the " +"encoding :func:`locale.getpreferredencoding(False) " +"` instead of ``locale.getpreferredencoding()``. " +"See the :class:`io.TextIOWrapper` class for more information on this change." msgstr "" +"هنگامی که *universal_newlines* برابر ``True`` باشد، این کلاس به‌جای " +"``locale.getpreferredencoding()`` از " +"کدگذاری :func:`locale.getpreferredencoding(False) " +"` استفاده می‌کند. برای اطلاعات بیشتر درباره این " +"تغییر، کلاس :class:`io.TextIOWrapper` را ببینید." msgid "Read the `Security Considerations`_ section before using ``shell=True``." msgstr "" +"پیش از استفاده از ``shell=True``، بخش `Security Considerations`_ را بخوانید." -msgid "These options, along with all of the other options, are described in more detail in the :class:`Popen` constructor documentation." +msgid "" +"These options, along with all of the other options, are described in more " +"detail in the :class:`Popen` constructor documentation." msgstr "" +"این گزینه‌ها، به همراه تمام گزینه‌های دیگر، با جزئیات بیشتر در مستندات " +"سازنده‌ی :class:`Popen` توضیح داده شده‌اند." msgid "Popen Constructor" -msgstr "" +msgstr "سازنده Popen" -msgid "The underlying process creation and management in this module is handled by the :class:`Popen` class. It offers a lot of flexibility so that developers are able to handle the less common cases not covered by the convenience functions." +msgid "" +"The underlying process creation and management in this module is handled by " +"the :class:`Popen` class. It offers a lot of flexibility so that developers " +"are able to handle the less common cases not covered by the convenience " +"functions." msgstr "" +"ایجاد و مدیریت فرآیندها در سطح زیربنایی این ماژول بر عهده‌ی کلاس :class:`Popen` " +"است. این کلاس انعطاف‌پذیری زیادی فراهم می‌کند تا توسعه‌دهندگان بتوانند موارد " +"کمتر رایجی را که توابع آسان‌کننده پوشش نمی‌دهند، مدیریت کنند." -msgid "Execute a child program in a new process. On POSIX, the class uses :meth:`os.execvpe`-like behavior to execute the child program. On Windows, the class uses the Windows ``CreateProcess()`` function. The arguments to :class:`Popen` are as follows." +msgid "" +"Execute a child program in a new process. On POSIX, the class " +"uses :meth:`os.execvpe`-like behavior to execute the child program. On " +"Windows, the class uses the Windows ``CreateProcess()`` function. The " +"arguments to :class:`Popen` are as follows." msgstr "" +"یک برنامه فرزند را در یک فرایند جدید اجرا می‌کند. در POSIX، این کلاس از رفتاری " +"مشابه :meth:`os.execvpe` برای اجرای برنامه فرزند استفاده می‌کند. در ویندوز، " +"این کلاس از تابع ``CreateProcess()`` ویندوز استفاده می‌کند. " +"آرگومان‌های :class:`Popen` به شرح زیر است." -msgid "*args* should be a sequence of program arguments or else a single string or :term:`path-like object`. By default, the program to execute is the first item in *args* if *args* is a sequence. If *args* is a string, the interpretation is platform-dependent and described below. See the *shell* and *executable* arguments for additional differences from the default behavior. Unless otherwise stated, it is recommended to pass *args* as a sequence." -msgstr "" +msgid "" +"*args* should be a sequence of program arguments or else a single string " +"or :term:`path-like object`. By default, the program to execute is the first " +"item in *args* if *args* is a sequence. If *args* is a string, the " +"interpretation is platform-dependent and described below. See the *shell* " +"and *executable* arguments for additional differences from the default " +"behavior. Unless otherwise stated, it is recommended to pass *args* as a " +"sequence." +msgstr "" +"*args* باید یک دنباله از آرگومان‌های برنامه باشد یا در غیر این صورت، یک رشته " +"یا :term:`شیء شبه‌مسیر ` باشد. به‌طور پیش‌فرض، اگر *args* یک " +"دنباله باشد، برنامه‌ای که اجرا می‌شود اولین آیتم در *args* است. اگر *args* یک " +"رشته باشد، تفسیر آن وابسته به پلتفرم است و در زیر توضیح داده شده است. برای " +"تفاوت‌های بیشتر با رفتار پیش‌فرض، آرگومان‌های *shell* و *executable* را ببینید. " +"مگر اینکه خلاف آن ذکر شده باشد، توصیه می‌شود *args* را به‌عنوان یک دنباله ارسال " +"کنید." -msgid "For maximum reliability, use a fully qualified path for the executable. To search for an unqualified name on :envvar:`PATH`, use :meth:`shutil.which`. On all platforms, passing :data:`sys.executable` is the recommended way to launch the current Python interpreter again, and use the ``-m`` command-line format to launch an installed module." -msgstr "" +msgid "" +"For maximum reliability, use a fully qualified path for the executable. To " +"search for an unqualified name on :envvar:`PATH`, use :meth:`shutil.which`. " +"On all platforms, passing :data:`sys.executable` is the recommended way to " +"launch the current Python interpreter again, and use the ``-m`` command-line " +"format to launch an installed module." +msgstr "" +"برای حداکثر قابلیت اطمینان، از یک مسیر کاملاً مشخص برای فایل اجرایی استفاده " +"کنید. برای جست‌وجوی یک نام بدون مسیر در :envvar:`PATH`، " +"از :meth:`shutil.which` استفاده کنید. در همه‌ی سکوها، توصیه می‌شود برای اجرای " +"مجدد مفسر پایتون جاری، :data:`sys.executable` را ارسال کنید و برای اجرای یک " +"ماژول نصب‌شده از قالب خط فرمان ``-m`` استفاده کنید." -msgid "Resolving the path of *executable* (or the first item of *args*) is platform dependent. For POSIX, see :meth:`os.execvpe`, and note that when resolving or searching for the executable path, *cwd* overrides the current working directory and *env* can override the ``PATH`` environment variable. For Windows, see the documentation of the ``lpApplicationName`` and ``lpCommandLine`` parameters of WinAPI ``CreateProcess``, and note that when resolving or searching for the executable path with ``shell=False``, *cwd* does not override the current working directory and *env* cannot override the ``PATH`` environment variable. Using a full path avoids all of these variations." -msgstr "" +msgid "" +"Resolving the path of *executable* (or the first item of *args*) is platform " +"dependent. For POSIX, see :meth:`os.execvpe`, and note that when resolving or " +"searching for the executable path, *cwd* overrides the current working " +"directory and *env* can override the ``PATH`` environment variable. For " +"Windows, see the documentation of the ``lpApplicationName`` and " +"``lpCommandLine`` parameters of WinAPI ``CreateProcess``, and note that when " +"resolving or searching for the executable path with ``shell=False``, *cwd* " +"does not override the current working directory and *env* cannot override the " +"``PATH`` environment variable. Using a full path avoids all of these " +"variations." +msgstr "" +"تعیین مسیر *executable* (یا اولین آیتم *args*) وابسته به پلتفرم است. برای " +"POSIX، :meth:`os.execvpe` را ببینید، و توجه داشته باشید که هنگام تعیین یا " +"جست‌وجوی مسیر اجرایی، *cwd* پوشه کاری فعلی را نادیده می‌گیرد و *env* می‌تواند " +"متغیر محیطی ``PATH`` را نادیده بگیرد. برای ویندوز، مستندات پارامترهای " +"``lpApplicationName`` و ``lpCommandLine`` در WinAPI ``CreateProcess`` را " +"ببینید، و توجه داشته باشید که هنگام تعیین یا جست‌وجوی مسیر اجرایی با " +"``shell=False``، *cwd* پوشه کاری فعلی را نادیده نمی‌گیرد و *env* نمی‌تواند " +"متغیر محیطی ``PATH`` را نادیده بگیرد. استفاده از یک مسیر کامل از تمام این " +"تفاوت‌ها جلوگیری می‌کند." -msgid "An example of passing some arguments to an external program as a sequence is::" -msgstr "" +msgid "" +"An example of passing some arguments to an external program as a sequence is::" +msgstr "مثالی از ارسال چند آرگومان به یک برنامه خارجی به‌صورت یک دنباله::" msgid "Popen([\"/usr/bin/git\", \"commit\", \"-m\", \"Fixes a bug.\"])" -msgstr "" +msgstr "Popen([\"/usr/bin/git\", \"commit\", \"-m\", \"Fixes a bug.\"])" -msgid "On POSIX, if *args* is a string, the string is interpreted as the name or path of the program to execute. However, this can only be done if not passing arguments to the program." +msgid "" +"On POSIX, if *args* is a string, the string is interpreted as the name or " +"path of the program to execute. However, this can only be done if not " +"passing arguments to the program." msgstr "" +"در POSIX، اگر *args* یک رشته باشد، رشته به‌عنوان نام یا مسیر برنامه برای اجرا " +"تفسیر می‌شود. با این حال، این کار تنها در صورتی می‌تواند انجام شود که آرگومانی " +"به برنامه ارسال نشود." -msgid "It may not be obvious how to break a shell command into a sequence of arguments, especially in complex cases. :meth:`shlex.split` can illustrate how to determine the correct tokenization for *args*::" +msgid "" +"It may not be obvious how to break a shell command into a sequence of " +"arguments, especially in complex cases. :meth:`shlex.split` can illustrate " +"how to determine the correct tokenization for *args*::" msgstr "" +"ممکن است واضح نباشد که چگونه باید یک فرمان پوسته را به دنباله‌ای از آرگومان‌ها " +"تجزیه کرد، به‌ویژه در موارد پیچیده. :meth:`shlex.split` می‌تواند چگونگی تعیین " +"توکن‌بندی (tokenization) صحیح برای *args* را نشان دهد::" msgid "" ">>> import shlex, subprocess\n" ">>> command_line = input()\n" -"/bin/vikings -input eggs.txt -output \"spam spam.txt\" -cmd \"echo '$MONEY'\"\n" +"/bin/vikings -input eggs.txt -output \"spam spam.txt\" -cmd \"echo " +"'$MONEY'\"\n" ">>> args = shlex.split(command_line)\n" ">>> print(args)\n" -"['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', \"echo '$MONEY'\"]\n" +"['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', " +"\"echo '$MONEY'\"]\n" ">>> p = subprocess.Popen(args) # Success!" msgstr "" +">>> import shlex, subprocess\n" +">>> command_line = input()\n" +"/bin/vikings -input eggs.txt -output \"spam spam.txt\" -cmd \"echo " +"'$MONEY'\"\n" +">>> args = shlex.split(command_line)\n" +">>> print(args)\n" +"['/bin/vikings', '-input', 'eggs.txt', '-output', 'spam spam.txt', '-cmd', " +"\"echo '$MONEY'\"]\n" +">>> p = subprocess.Popen(args) # Success!" -msgid "Note in particular that options (such as *-input*) and arguments (such as *eggs.txt*) that are separated by whitespace in the shell go in separate list elements, while arguments that need quoting or backslash escaping when used in the shell (such as filenames containing spaces or the *echo* command shown above) are single list elements." -msgstr "" +msgid "" +"Note in particular that options (such as *-input*) and arguments (such as " +"*eggs.txt*) that are separated by whitespace in the shell go in separate list " +"elements, while arguments that need quoting or backslash escaping when used " +"in the shell (such as filenames containing spaces or the *echo* command shown " +"above) are single list elements." +msgstr "" +"به‌طور خاص توجه داشته باشید که گزینه‌ها (مانند *-input*) و آرگومان‌ها (مانند " +"*eggs.txt*) که در پوسته با فضای خالی از هم جدا شده‌اند، در عناصر جداگانه‌ای از " +"فهرست قرار می‌گیرند، در حالی که آرگومان‌هایی که هنگام استفاده در پوسته به " +"قرارگیری در علامت نقل‌قول یا خنثی‌کردن با بک‌اسلش نیاز دارند (مانند نام فایل‌های " +"حاوی فاصله یا فرمان *echo* که در بالا نشان داده شد)، هرکدام یک عنصر واحد از " +"فهرست هستند." -msgid "On Windows, if *args* is a sequence, it will be converted to a string in a manner described in :ref:`converting-argument-sequence`. This is because the underlying ``CreateProcess()`` operates on strings." +msgid "" +"On Windows, if *args* is a sequence, it will be converted to a string in a " +"manner described in :ref:`converting-argument-sequence`. This is because the " +"underlying ``CreateProcess()`` operates on strings." msgstr "" +"در ویندوز، اگر *args* یک دنباله باشد، به شیوه‌ای که در :ref:`converting-" +"argument-sequence` توضیح داده شده است، به یک رشته تبدیل می‌شود. این به این " +"دلیل است که ``CreateProcess()`` زیربنایی روی رشته‌ها عمل می‌کند." -msgid "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` and a sequence containing path-like objects on POSIX." +msgid "" +"*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " +"and a sequence containing path-like objects on POSIX." msgstr "" +"پارامتر *args* یک :term:`path-like object` را در صورتی می‌پذیرد که *shell* " +"``False`` باشد، و در POSIX دنباله‌ای حاوی اشیای مسیرمانند (path-like objects) " +"را می‌پذیرد." -msgid "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` and a sequence containing bytes and path-like objects on Windows." +msgid "" +"*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " +"and a sequence containing bytes and path-like objects on Windows." msgstr "" +"پارامتر *args* یک :term:`path-like object` را می‌پذیرد، اگر *shell* ``False`` " +"باشد، و در ویندوز یک دنباله شامل بایت‌ها و اشیاء مسیر-مانند را می‌پذیرد." -msgid "The *shell* argument (which defaults to ``False``) specifies whether to use the shell as the program to execute. If *shell* is ``True``, it is recommended to pass *args* as a string rather than as a sequence." +msgid "" +"The *shell* argument (which defaults to ``False``) specifies whether to use " +"the shell as the program to execute. If *shell* is ``True``, it is " +"recommended to pass *args* as a string rather than as a sequence." msgstr "" +"آرگومان *shell* (که پیش‌فرض آن ``False`` است) مشخص می‌کند که آیا از پوسته " +"به‌عنوان برنامه برای اجرا استفاده شود یا خیر. اگر *shell* برابر ``True`` باشد، " +"توصیه می‌شود *args* را به‌صورت یک رشته ارسال کنید، نه به‌صورت یک دنباله." -msgid "On POSIX with ``shell=True``, the shell defaults to :file:`/bin/sh`. If *args* is a string, the string specifies the command to execute through the shell. This means that the string must be formatted exactly as it would be when typed at the shell prompt. This includes, for example, quoting or backslash escaping filenames with spaces in them. If *args* is a sequence, the first item specifies the command string, and any additional items will be treated as additional arguments to the shell itself. That is to say, :class:`Popen` does the equivalent of::" -msgstr "" +msgid "" +"On POSIX with ``shell=True``, the shell defaults to :file:`/bin/sh`. If " +"*args* is a string, the string specifies the command to execute through the " +"shell. This means that the string must be formatted exactly as it would be " +"when typed at the shell prompt. This includes, for example, quoting or " +"backslash escaping filenames with spaces in them. If *args* is a sequence, " +"the first item specifies the command string, and any additional items will be " +"treated as additional arguments to the shell itself. That is to " +"say, :class:`Popen` does the equivalent of::" +msgstr "" +"در POSIX با ``shell=True``، پوسته به‌طور پیش‌فرض :file:`/bin/sh` است. اگر " +"*args* یک رشته باشد، رشته فرمانی را که باید از طریق پوسته اجرا شود مشخص " +"می‌کند. این بدان معناست که رشته باید دقیقاً به همان شکلی قالب‌بندی شود که در " +"اعلان پوسته تایپ می‌شود. این شامل، برای مثال، در علامت نقل‌قول گذاشتن یا " +"خنثی‌سازی با بک‌اسلش نام فایل‌هایی است که فاصله دارند. اگر *args* یک دنباله " +"باشد، اولین آیتم رشته فرمان را مشخص می‌کند و آیتم‌های اضافی به‌عنوان آرگومان‌های " +"اضافی برای خود پوسته در نظر گرفته خواهند شد. یعنی :class:`Popen` معادل این " +"کار را انجام می‌دهد::" msgid "Popen(['/bin/sh', '-c', args[0], args[1], ...])" -msgstr "" +msgstr "Popen(['/bin/sh', '-c', args[0], args[1], ...])" -msgid "On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable specifies the default shell. The only time you need to specify ``shell=True`` on Windows is when the command you wish to execute is built into the shell (e.g. :command:`dir` or :command:`copy`). You do not need ``shell=True`` to run a batch file or console-based executable." -msgstr "" +msgid "" +"On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable " +"specifies the default shell. The only time you need to specify " +"``shell=True`` on Windows is when the command you wish to execute is built " +"into the shell (e.g. :command:`dir` or :command:`copy`). You do not need " +"``shell=True`` to run a batch file or console-based executable." +msgstr "" +"در ویندوز با ``shell=True``، متغیر محیطی :envvar:`COMSPEC` پوسته پیش‌فرض را " +"مشخص می‌کند. تنها زمانی نیاز است ``shell=True`` را در ویندوز مشخص کنید که " +"فرمانی که می‌خواهید اجرا کنید در پوسته توکار باشد (مانند :command:`dir` " +"یا :command:`copy`). برای اجرای یک فایل batch یا فایل اجرایی مبتنی بر کنسول " +"نیازی به ``shell=True`` ندارید." -msgid "*bufsize* will be supplied as the corresponding argument to the :func:`open` function when creating the stdin/stdout/stderr pipe file objects:" +msgid "" +"*bufsize* will be supplied as the corresponding argument to the :func:`open` " +"function when creating the stdin/stdout/stderr pipe file objects:" msgstr "" +"هنگام ایجاد اشیاء فایل پایپ stdin/stdout/stderr، *bufsize* به‌عنوان آرگومان " +"متناظر به تابع :func:`open` داده می‌شود:" -msgid "``0`` means unbuffered (read and write are one system call and can return short)" +msgid "" +"``0`` means unbuffered (read and write are one system call and can return " +"short)" msgstr "" +"``0`` به معنای بدون بافر است (خواندن و نوشتن هرکدام یک فراخوانی سیستمی هستند " +"و ممکن است مقدار کمتری برگردانند)" -msgid "``1`` means line buffered (only usable if ``text=True`` or ``universal_newlines=True``)" +msgid "" +"``1`` means line buffered (only usable if ``text=True`` or " +"``universal_newlines=True``)" msgstr "" +"``1`` به‌معنای بافر خطی (line buffered) است (فقط در صورتی قابل‌استفاده است که " +"``text=True`` یا ``universal_newlines=True`` باشد)." msgid "any other positive value means use a buffer of approximately that size" msgstr "" +"هر مقدار مثبت دیگر به معنای استفاده از بافری با اندازه‌ای تقریباً برابر با آن " +"مقدار است" -msgid "negative bufsize (the default) means the system default of io.DEFAULT_BUFFER_SIZE will be used." +msgid "" +"negative bufsize (the default) means the system default of " +"io.DEFAULT_BUFFER_SIZE will be used." msgstr "" +"منفی بودن bufsize (حالت پیش‌فرض) به این معناست که پیش‌فرض سیستم، یعنی " +"io.DEFAULT_BUFFER_SIZE، استفاده خواهد شد." -msgid "*bufsize* now defaults to -1 to enable buffering by default to match the behavior that most code expects. In versions prior to Python 3.2.4 and 3.3.1 it incorrectly defaulted to ``0`` which was unbuffered and allowed short reads. This was unintentional and did not match the behavior of Python 2 as most code expected." -msgstr "" +msgid "" +"*bufsize* now defaults to -1 to enable buffering by default to match the " +"behavior that most code expects. In versions prior to Python 3.2.4 and 3.3.1 " +"it incorrectly defaulted to ``0`` which was unbuffered and allowed short " +"reads. This was unintentional and did not match the behavior of Python 2 as " +"most code expected." +msgstr "" +"مقدار پیش‌فرض *bufsize* اکنون -1 است تا بافرینگ (buffering) به‌صورت پیش‌فرض فعال " +"شود و با رفتاری که بیشتر کدها انتظار دارند مطابقت داشته باشد. در نسخه‌های پیش " +"از پایتون 3.2.4 و 3.3.1، مقدار پیش‌فرض آن به‌اشتباه ``0`` بود که بدون بافرینگ " +"بود و امکان خواندن‌های کوتاه (short reads) را فراهم می‌کرد. این موضوع غیرعمدی " +"بود و با رفتار پایتون 2، آن‌گونه که بیشتر کدها انتظار داشتند، مطابقت نداشت." -msgid "The *executable* argument specifies a replacement program to execute. It is very seldom needed. When ``shell=False``, *executable* replaces the program to execute specified by *args*. However, the original *args* is still passed to the program. Most programs treat the program specified by *args* as the command name, which can then be different from the program actually executed. On POSIX, the *args* name becomes the display name for the executable in utilities such as :program:`ps`. If ``shell=True``, on POSIX the *executable* argument specifies a replacement shell for the default :file:`/bin/sh`." -msgstr "" +msgid "" +"The *executable* argument specifies a replacement program to execute. It is " +"very seldom needed. When ``shell=False``, *executable* replaces the program " +"to execute specified by *args*. However, the original *args* is still passed " +"to the program. Most programs treat the program specified by *args* as the " +"command name, which can then be different from the program actually " +"executed. On POSIX, the *args* name becomes the display name for the " +"executable in utilities such as :program:`ps`. If ``shell=True``, on POSIX " +"the *executable* argument specifies a replacement shell for the " +"default :file:`/bin/sh`." +msgstr "" +"آرگومان *executable* برنامه جایگزینی را برای اجرا مشخص می‌کند. به‌ندرت به آن " +"نیاز است. هنگامی که ``shell=False`` باشد، *executable* جایگزین برنامه‌ای می‌شود " +"که توسط *args* برای اجرا مشخص شده است. با این حال، *args* اصلی همچنان به " +"برنامه ارسال می‌شود. بیشتر برنامه‌ها برنامه مشخص‌شده توسط *args* را به‌عنوان نام " +"فرمان تلقی می‌کنند، که در این صورت می‌تواند با برنامه‌ای که واقعاً اجرا می‌شود " +"متفاوت باشد. در POSIX، نام *args* به نام نمایشی برنامه اجرایی در ابزارهایی " +"مانند :program:`ps` تبدیل می‌شود. اگر ``shell=True`` باشد، در POSIX آرگومان " +"*executable* پوسته جایگزینی را به‌جای پوسته پیش‌فرض :file:`/bin/sh` مشخص می‌کند." msgid "*executable* parameter accepts a :term:`path-like object` on POSIX." -msgstr "" +msgstr "در POSIX، پارامتر *executable* یک :term:`path-like object` را می‌پذیرد." -msgid "*executable* parameter accepts a bytes and :term:`path-like object` on Windows." +msgid "" +"*executable* parameter accepts a bytes and :term:`path-like object` on " +"Windows." msgstr "" +"در ویندوز، پارامتر *executable* یک bytes و یک :term:`path-like object` را " +"می‌پذیرد." -msgid "*stdin*, *stdout* and *stderr* specify the executed program's standard input, standard output and standard error file handles, respectively. Valid values are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a positive integer), and an existing :term:`file object` with a valid file descriptor. With the default settings of ``None``, no redirection will occur. :data:`PIPE` indicates that a new pipe to the child should be created. :data:`DEVNULL` indicates that the special file :data:`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, which indicates that the stderr data from the applications should be captured into the same file handle as for *stdout*." -msgstr "" +msgid "" +"*stdin*, *stdout* and *stderr* specify the executed program's standard input, " +"standard output and standard error file handles, respectively. Valid values " +"are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a " +"positive integer), and an existing :term:`file object` with a valid file " +"descriptor. With the default settings of ``None``, no redirection will " +"occur. :data:`PIPE` indicates that a new pipe to the child should be " +"created. :data:`DEVNULL` indicates that the special file :data:`os.devnull` " +"will be used. Additionally, *stderr* can be :data:`STDOUT`, which indicates " +"that the stderr data from the applications should be captured into the same " +"file handle as for *stdout*." +msgstr "" +"*stdin*، *stdout* و *stderr* به‌ترتیب دسته‌های فایل ورودی استاندارد، خروجی " +"استاندارد و خطای استاندارد برنامه‌ی اجراشده را تعیین می‌کنند. مقادیر معتبر " +"عبارت‌اند از ``None``، :data:`PIPE`، :data:`DEVNULL`، یک توصیف‌گر فایل موجود " +"(یک عدد صحیح مثبت)، و یک :term:`file object` موجود با یک توصیف‌گر فایل معتبر. " +"با تنظیمات پیش‌فرض ``None``، هیچ تغییر مسیری رخ نخواهد داد. :data:`PIPE` نشان " +"می‌دهد که باید یک پایپ جدید به فرزند ایجاد شود. :data:`DEVNULL` نشان می‌دهد که " +"از فایل ویژه‌ی :data:`os.devnull` استفاده خواهد شد. علاوه بر این، *stderr* " +"می‌تواند :data:`STDOUT` باشد، که نشان می‌دهد داده‌های stderr برنامه‌ها باید در " +"همان دسته فایل مربوط به *stdout* دریافت شوند." -msgid "If *preexec_fn* is set to a callable object, this object will be called in the child process just before the child is executed. (POSIX only)" +msgid "" +"If *preexec_fn* is set to a callable object, this object will be called in " +"the child process just before the child is executed. (POSIX only)" msgstr "" +"اگر *preexec_fn* به یک شیء قابل فراخوانی تنظیم شود، این شیء در فرآیند فرزند " +"درست پیش از اجرای فرزند فراخوانی می‌شود. (فقط POSIX)" -msgid "The *preexec_fn* parameter is NOT SAFE to use in the presence of threads in your application. The child process could deadlock before exec is called." +msgid "" +"The *preexec_fn* parameter is NOT SAFE to use in the presence of threads in " +"your application. The child process could deadlock before exec is called." msgstr "" +"استفاده از پارامتر *preexec_fn* در حضور نخ‌ها در برنامه شما ایمن نیست. فرآیند " +"فرزند ممکن است پیش از فراخوانی exec دچار بن‌بست شود." -msgid "If you need to modify the environment for the child use the *env* parameter rather than doing it in a *preexec_fn*. The *start_new_session* and *process_group* parameters should take the place of code using *preexec_fn* to call :func:`os.setsid` or :func:`os.setpgid` in the child." +msgid "" +"If you need to modify the environment for the child use the *env* parameter " +"rather than doing it in a *preexec_fn*. The *start_new_session* and " +"*process_group* parameters should take the place of code using *preexec_fn* " +"to call :func:`os.setsid` or :func:`os.setpgid` in the child." msgstr "" +"اگر نیاز دارید محیط فرزند را تغییر دهید، به‌جای انجام این کار در *preexec_fn* " +"از پارامتر *env* استفاده کنید. پارامترهای *start_new_session* و " +"*process_group* باید جایگزین کدی شوند که از *preexec_fn* برای " +"فراخوانی :func:`os.setsid` یا :func:`os.setpgid` در فرزند استفاده می‌کند." -msgid "The *preexec_fn* parameter is no longer supported in subinterpreters. The use of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new restriction may affect applications that are deployed in mod_wsgi, uWSGI, and other embedded environments." +msgid "" +"The *preexec_fn* parameter is no longer supported in subinterpreters. The use " +"of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new " +"restriction may affect applications that are deployed in mod_wsgi, uWSGI, and " +"other embedded environments." msgstr "" +"پارامتر *preexec_fn* دیگر در زیرمفسرها پشتیبانی نمی‌شود. استفاده از این " +"پارامتر در یک زیرمفسر باعث پرتاب :exc:`RuntimeError` می‌شود. این محدودیت جدید " +"ممکن است بر برنامه‌هایی که در mod_wsgi، uWSGI و سایر محیط‌های جاسازی‌شده مستقر " +"شده‌اند تأثیر بگذارد." -msgid "If *close_fds* is true, all file descriptors except ``0``, ``1`` and ``2`` will be closed before the child process is executed. Otherwise when *close_fds* is false, file descriptors obey their inheritable flag as described in :ref:`fd_inheritance`." +msgid "" +"If *close_fds* is true, all file descriptors except ``0``, ``1`` and ``2`` " +"will be closed before the child process is executed. Otherwise when " +"*close_fds* is false, file descriptors obey their inheritable flag as " +"described in :ref:`fd_inheritance`." msgstr "" +"اگر *close_fds* درست باشد، تمام توصیف‌گرهای فایل به جز ``0``، ``1`` و ``2`` " +"پیش از اجرای فرایند فرزند بسته می‌شوند. در غیر این صورت، هنگامی که *close_fds* " +"نادرست باشد، توصیف‌گرهای فایل مطابق پرچم ارثی خود رفتار می‌کنند، همان‌طور که " +"در :ref:`fd_inheritance` توضیح داده شده است." -msgid "On Windows, if *close_fds* is true then no handles will be inherited by the child process unless explicitly passed in the ``handle_list`` element of :attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." +msgid "" +"On Windows, if *close_fds* is true then no handles will be inherited by the " +"child process unless explicitly passed in the ``handle_list`` element " +"of :attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." msgstr "" +"در ویندوز، اگر *close_fds* درست باشد، هیچ دسته‌ای (handle) توسط فرایند " +"فرزند به ارث برده نمی‌شود، مگر آنکه به‌صراحت در عنصر ``handle_list`` " +"از :attr:`STARTUPINFO.lpAttributeList` یا از طریق هدایت مجدد دسته " +"استاندارد منتقل شده باشد." -msgid "The default for *close_fds* was changed from :const:`False` to what is described above." +msgid "" +"The default for *close_fds* was changed from :const:`False` to what is " +"described above." msgstr "" +"مقدار پیش‌فرض برای *close_fds* از :const:`False` به آنچه در بالا توضیح داده شد " +"تغییر کرده است." -msgid "On Windows the default for *close_fds* was changed from :const:`False` to :const:`True` when redirecting the standard handles. It's now possible to set *close_fds* to :const:`True` when redirecting the standard handles." +msgid "" +"On Windows the default for *close_fds* was changed from :const:`False` " +"to :const:`True` when redirecting the standard handles. It's now possible to " +"set *close_fds* to :const:`True` when redirecting the standard handles." msgstr "" +"در ویندوز، مقدار پیش‌فرض برای *close_fds* هنگام تغییر مسیر دسته‌های استاندارد " +"(standard handles) از :const:`False` به :const:`True` تغییر کرد. اکنون " +"می‌توانید *close_fds* را هنگام تغییر مسیر دسته‌های استاندارد (standard handles) " +"روی :const:`True` تنظیم کنید." -msgid "*pass_fds* is an optional sequence of file descriptors to keep open between the parent and child. Providing any *pass_fds* forces *close_fds* to be :const:`True`. (POSIX only)" +msgid "" +"*pass_fds* is an optional sequence of file descriptors to keep open between " +"the parent and child. Providing any *pass_fds* forces *close_fds* to " +"be :const:`True`. (POSIX only)" msgstr "" +"*pass_fds* دنباله‌ای اختیاری از توصیف‌گرهای فایل است که باید بین والد و فرزند " +"باز نگه داشته شوند. ارائه هر *pass_fds*، *close_fds* را مجبور می‌کند " +"که :const:`True` باشد. (فقط POSIX)" msgid "The *pass_fds* parameter was added." -msgstr "" +msgstr "پارامتر *pass_fds* اضافه شد." -msgid "If *cwd* is not ``None``, the function changes the working directory to *cwd* before executing the child. *cwd* can be a string, bytes or :term:`path-like ` object. On POSIX, the function looks for *executable* (or for the first item in *args*) relative to *cwd* if the executable path is a relative path." +msgid "" +"If *cwd* is not ``None``, the function changes the working directory to *cwd* " +"before executing the child. *cwd* can be a string, bytes or :term:`path-like " +"` object. On POSIX, the function looks for *executable* " +"(or for the first item in *args*) relative to *cwd* if the executable path is " +"a relative path." msgstr "" +"اگر *cwd* برابر ``None`` نباشد، تابع پیش از اجرای فرزند، پوشه کاری را به " +"*cwd* تغییر می‌دهد. *cwd* می‌تواند یک رشته، bytes یا شیء :term:`path-like ` باشد. در POSIX، اگر مسیر اجرایی یک مسیر نسبی باشد، تابع " +"*executable* (یا اولین آیتم در *args*) را نسبت به *cwd* جست‌وجو می‌کند." msgid "*cwd* parameter accepts a :term:`path-like object` on POSIX." -msgstr "" +msgstr "پارامتر *cwd* در POSIX یک :term:`path-like object` را می‌پذیرد." msgid "*cwd* parameter accepts a :term:`path-like object` on Windows." -msgstr "" +msgstr "در ویندوز، پارامتر *cwd* یک :term:`path-like object` را می‌پذیرد." msgid "*cwd* parameter accepts a bytes object on Windows." -msgstr "" +msgstr "پارامتر *cwd* در ویندوز یک شیء bytes را می‌پذیرد." -msgid "If *restore_signals* is true (the default) all signals that Python has set to SIG_IGN are restored to SIG_DFL in the child process before the exec. Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" +msgid "" +"If *restore_signals* is true (the default) all signals that Python has set to " +"SIG_IGN are restored to SIG_DFL in the child process before the exec. " +"Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" msgstr "" +"اگر *restore_signals* صحیح باشد (پیش‌فرض)، همه سیگنال‌هایی که پایتون آن‌ها را " +"روی SIG_IGN تنظیم کرده است، در فرایند فرزند پیش از exec به SIG_DFL بازنشانی " +"می‌شوند. در حال حاضر این شامل سیگنال‌های SIGPIPE، SIGXFZ و SIGXFSZ می‌شود. (فقط " +"POSIX)" msgid "*restore_signals* was added." -msgstr "" +msgstr "*restore_signals* افزوده شد." -msgid "If *start_new_session* is true the ``setsid()`` system call will be made in the child process prior to the execution of the subprocess." +msgid "" +"If *start_new_session* is true the ``setsid()`` system call will be made in " +"the child process prior to the execution of the subprocess." msgstr "" +"اگر *start_new_session* مقدار true داشته باشد، فراخوانی سیستمی ``setsid()`` " +"در فرایند فرزند پیش از اجرای زیرفرایند انجام می‌شود." msgid "*start_new_session* was added." -msgstr "" +msgstr "*start_new_session* افزوده شد." -msgid "If *process_group* is a non-negative integer, the ``setpgid(0, value)`` system call will be made in the child process prior to the execution of the subprocess." +msgid "" +"If *process_group* is a non-negative integer, the ``setpgid(0, value)`` " +"system call will be made in the child process prior to the execution of the " +"subprocess." msgstr "" +"اگر *process_group* یک عدد صحیح غیرمنفی باشد، فراخوانی سیستمی ``setpgid(0, " +"value)`` در فرایند فرزند پیش از اجرای زیرفرایند انجام خواهد شد." msgid "*process_group* was added." -msgstr "" +msgstr "*process_group* اضافه شد." -msgid "If *group* is not ``None``, the setregid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via :func:`grp.getgrnam` and the value in ``gr_gid`` will be used. If the value is an integer, it will be passed verbatim. (POSIX only)" +msgid "" +"If *group* is not ``None``, the setregid() system call will be made in the " +"child process prior to the execution of the subprocess. If the provided value " +"is a string, it will be looked up via :func:`grp.getgrnam` and the value in " +"``gr_gid`` will be used. If the value is an integer, it will be passed " +"verbatim. (POSIX only)" msgstr "" +"اگر *group* برابر ``None`` نباشد، فراخوانی سیستمی setregid() در فرایند فرزند " +"پیش از اجرای زیرفرایند انجام خواهد شد. اگر مقدار ارائه‌شده یک رشته باشد، از " +"طریق :func:`grp.getgrnam` جستجو خواهد شد و از مقدار موجود در ``gr_gid`` " +"استفاده خواهد شد. اگر مقدار یک عدد صحیح باشد، عیناً ارسال خواهد شد. (فقط POSIX)" -msgid "If *extra_groups* is not ``None``, the setgroups() system call will be made in the child process prior to the execution of the subprocess. Strings provided in *extra_groups* will be looked up via :func:`grp.getgrnam` and the values in ``gr_gid`` will be used. Integer values will be passed verbatim. (POSIX only)" -msgstr "" +msgid "" +"If *extra_groups* is not ``None``, the setgroups() system call will be made " +"in the child process prior to the execution of the subprocess. Strings " +"provided in *extra_groups* will be looked up via :func:`grp.getgrnam` and the " +"values in ``gr_gid`` will be used. Integer values will be passed verbatim. " +"(POSIX only)" +msgstr "" +"اگر *extra_groups* برابر ``None`` نباشد، فراخوانی سیستمی setgroups() پیش از " +"اجرای زیرفرآیند در فرآیند فرزند انجام خواهد شد. رشته‌های ارائه‌شده در " +"*extra_groups* با استفاده از :func:`grp.getgrnam` جستجو خواهند شد و مقادیر " +"موجود در ``gr_gid`` به کار خواهند رفت. مقادیر عدد صحیح عیناً ارسال خواهند شد. " +"(فقط POSIX)" -msgid "If *user* is not ``None``, the setreuid() system call will be made in the child process prior to the execution of the subprocess. If the provided value is a string, it will be looked up via :func:`pwd.getpwnam` and the value in ``pw_uid`` will be used. If the value is an integer, it will be passed verbatim. (POSIX only)" +msgid "" +"If *user* is not ``None``, the setreuid() system call will be made in the " +"child process prior to the execution of the subprocess. If the provided value " +"is a string, it will be looked up via :func:`pwd.getpwnam` and the value in " +"``pw_uid`` will be used. If the value is an integer, it will be passed " +"verbatim. (POSIX only)" msgstr "" +"اگر *user* برابر ``None`` نباشد، فراخوانی سیستمی setreuid() در فرایند فرزند " +"پیش از اجرای زیرفرایند انجام می‌شود. اگر مقدار ارائه‌شده یک رشته باشد، از " +"طریق :func:`pwd.getpwnam` جستجو می‌شود و از مقدار ``pw_uid`` استفاده می‌شود. " +"اگر مقدار یک عدد صحیح باشد، عیناً ارسال می‌شود. (فقط POSIX)" -msgid "Specifying *user* will not drop existing supplementary group memberships! The caller must also pass ``extra_groups=()`` to reduce the group membership of the child process for security purposes." +msgid "" +"Specifying *user* will not drop existing supplementary group memberships! The " +"caller must also pass ``extra_groups=()`` to reduce the group membership of " +"the child process for security purposes." msgstr "" +"تعیین *user*، عضویت‌های گروه تکمیلی موجود را حذف نمی‌کند! فراخواننده همچنین " +"باید ``extra_groups=()`` را ارسال کند تا عضویت گروه فرایند فرزند را برای " +"اهداف امنیتی کاهش دهد." -msgid "If *umask* is not negative, the umask() system call will be made in the child process prior to the execution of the subprocess." +msgid "" +"If *umask* is not negative, the umask() system call will be made in the child " +"process prior to the execution of the subprocess." msgstr "" +"اگر *umask* منفی نباشد، فراخوانی سیستمی umask() پیش از اجرای زیرفرایند، در " +"فرایند فرزند انجام می‌شود." -msgid "If *env* is not ``None``, it must be a mapping that defines the environment variables for the new process; these are used instead of the default behavior of inheriting the current process' environment. This mapping can be str to str on any platform or bytes to bytes on POSIX platforms much like :data:`os.environ` or :data:`os.environb`." -msgstr "" +msgid "" +"If *env* is not ``None``, it must be a mapping that defines the environment " +"variables for the new process; these are used instead of the default behavior " +"of inheriting the current process' environment. This mapping can be str to " +"str on any platform or bytes to bytes on POSIX platforms much " +"like :data:`os.environ` or :data:`os.environb`." +msgstr "" +"اگر *env* برابر ``None`` نباشد، باید یک نگاشت باشد که متغیرهای محیطی فرایند " +"جدید را تعریف می‌کند؛ این متغیرها به جای رفتار پیش‌فرضِ به ارث بردن محیط فرایند " +"جاری استفاده می‌شوند. این نگاشت می‌تواند در هر پلتفرمی از str به str یا در " +"پلتفرم‌های POSIX از bytes به bytes باشد، درست مانند :data:`os.environ` " +"یا :data:`os.environb`." -msgid "If specified, *env* must provide any variables required for the program to execute. On Windows, in order to run a `side-by-side assembly`_ the specified *env* **must** include a valid ``%SystemRoot%``." +msgid "" +"If specified, *env* must provide any variables required for the program to " +"execute. On Windows, in order to run a `side-by-side assembly`_ the " +"specified *env* **must** include a valid ``%SystemRoot%``." msgstr "" +"اگر مشخص شده باشد، *env* باید هر متغیر مورد نیاز برای اجرای برنامه را فراهم " +"کند. در ویندوز، برای اجرای یک `side-by-side assembly`_، *env* مشخص‌شده " +"**باید** شامل یک ``%SystemRoot%`` معتبر باشد." -msgid "If *encoding* or *errors* are specified, or *text* is true, the file objects *stdin*, *stdout* and *stderr* are opened in text mode with the specified *encoding* and *errors*, as described above in :ref:`frequently-used-arguments`. The *universal_newlines* argument is equivalent to *text* and is provided for backwards compatibility. By default, file objects are opened in binary mode." -msgstr "" +msgid "" +"If *encoding* or *errors* are specified, or *text* is true, the file objects " +"*stdin*, *stdout* and *stderr* are opened in text mode with the specified " +"*encoding* and *errors*, as described above in :ref:`frequently-used-" +"arguments`. The *universal_newlines* argument is equivalent to *text* and is " +"provided for backwards compatibility. By default, file objects are opened in " +"binary mode." +msgstr "" +"اگر *encoding* یا *errors* مشخص شده باشند، یا *text* true باشد، اشیای فایل " +"*stdin*، *stdout* و *stderr* در حالت متنی با *encoding* و *errors* مشخص‌شده " +"باز می‌شوند، همان‌طور که در بالا در :ref:`frequently-used-arguments` توضیح داده " +"شده است. آرگومان *universal_newlines* معادل *text* است و برای سازگاری با " +"نسخه‌های پیشین ارائه شده است. به‌طور پیش‌فرض، اشیای فایل در حالت دودویی باز " +"می‌شوند." msgid "*encoding* and *errors* were added." -msgstr "" +msgstr "*encoding* و *errors* اضافه شدند." msgid "*text* was added as a more readable alias for *universal_newlines*." -msgstr "" +msgstr "*text* به‌عنوان نام مستعاری خواناتر برای *universal_newlines* افزوده شد." -msgid "If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is passed to the underlying ``CreateProcess`` function." +msgid "" +"If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is " +"passed to the underlying ``CreateProcess`` function." msgstr "" +"در صورت داده شدن، *startupinfo* یک شیء :class:`STARTUPINFO` خواهد بود که به " +"تابع زیرساختی ``CreateProcess`` ارسال می‌شود." msgid "If given, *creationflags*, can be one or more of the following flags:" msgstr "" +"در صورت ارائه شدن، *creationflags* می‌تواند یک یا چند مورد از پرچم‌های زیر باشد:" msgid ":data:`CREATE_NEW_CONSOLE`" -msgstr "" +msgstr ":data:`CREATE_NEW_CONSOLE`" msgid ":data:`CREATE_NEW_PROCESS_GROUP`" -msgstr "" +msgstr ":data:`CREATE_NEW_PROCESS_GROUP`" msgid ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" msgid ":data:`BELOW_NORMAL_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`BELOW_NORMAL_PRIORITY_CLASS`" msgid ":data:`HIGH_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`HIGH_PRIORITY_CLASS`" msgid ":data:`IDLE_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`IDLE_PRIORITY_CLASS`" msgid ":data:`NORMAL_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`NORMAL_PRIORITY_CLASS`" msgid ":data:`REALTIME_PRIORITY_CLASS`" -msgstr "" +msgstr ":data:`REALTIME_PRIORITY_CLASS`" msgid ":data:`CREATE_NO_WINDOW`" -msgstr "" +msgstr ":data:`CREATE_NO_WINDOW`" msgid ":data:`DETACHED_PROCESS`" -msgstr "" +msgstr ":data:`DETACHED_PROCESS`" msgid ":data:`CREATE_DEFAULT_ERROR_MODE`" -msgstr "" +msgstr ":data:`CREATE_DEFAULT_ERROR_MODE`" msgid ":data:`CREATE_BREAKAWAY_FROM_JOB`" -msgstr "" +msgstr ":data:`CREATE_BREAKAWAY_FROM_JOB`" -msgid "*pipesize* can be used to change the size of the pipe when :data:`PIPE` is used for *stdin*, *stdout* or *stderr*. The size of the pipe is only changed on platforms that support this (only Linux at this time of writing). Other platforms will ignore this parameter." +msgid "" +"*pipesize* can be used to change the size of the pipe when :data:`PIPE` is " +"used for *stdin*, *stdout* or *stderr*. The size of the pipe is only changed " +"on platforms that support this (only Linux at this time of writing). Other " +"platforms will ignore this parameter." msgstr "" +"می‌توان از *pipesize* برای تغییر اندازه‌ی پایپهنگامی که از :data:`PIPE` " +"برای *stdin*، *stdout* یا *stderr* استفاده می‌شود، استفاده کرد. اندازه‌ی پایپ " +"فقط در سکوهایی که از این قابلیت پشتیبانی می‌کنند تغییر می‌کند (در زمان نگارش " +"این متن، فقط لینوکس). سایر سکوها این پارامتر را نادیده می‌گیرند." msgid "Added the *pipesize* parameter." -msgstr "" +msgstr "پارامتر *pipesize* افزوده شد." -msgid "Popen objects are supported as context managers via the :keyword:`with` statement: on exit, standard file descriptors are closed, and the process is waited for. ::" +msgid "" +"Popen objects are supported as context managers via the :keyword:`with` " +"statement: on exit, standard file descriptors are closed, and the process is " +"waited for. ::" msgstr "" +"اشیاء Popen به‌عنوان مدیر زمینه از طریق دستور :keyword:`with` پشتیبانی می‌شوند: " +"در هنگام خروج، توصیف‌گرهای فایل استاندارد بسته می‌شوند و برای فرایند انتظار " +"کشیده می‌شود. ::" msgid "" "with Popen([\"ifconfig\"], stdout=PIPE) as proc:\n" " log.write(proc.stdout.read())" msgstr "" +"with Popen([\"ifconfig\"], stdout=PIPE) as proc:\n" +" log.write(proc.stdout.read())" -msgid "Popen and the other functions in this module that use it raise an :ref:`auditing event ` ``subprocess.Popen`` with arguments ``executable``, ``args``, ``cwd``, and ``env``. The value for ``args`` may be a single string or a list of strings, depending on platform." +msgid "" +"Popen and the other functions in this module that use it raise " +"an :ref:`auditing event ` ``subprocess.Popen`` with arguments " +"``executable``, ``args``, ``cwd``, and ``env``. The value for ``args`` may be " +"a single string or a list of strings, depending on platform." msgstr "" +"Popen و سایر توابع این ماژول که از آن استفاده می‌کنند، یک :ref:`رویداد حسابرسی " +"` ``subprocess.Popen`` را با آرگومان‌های ``executable``، ``args``، " +"``cwd`` و ``env`` پرتاب می‌کنند. بسته به سکو، مقدار ``args`` ممکن است یک رشته " +"منفرد یا فهرستی از رشته‌ها باشد." msgid "Added context manager support." -msgstr "" +msgstr "پشتیبانی از مدیر زمینه اضافه شد." -msgid "Popen destructor now emits a :exc:`ResourceWarning` warning if the child process is still running." +msgid "" +"Popen destructor now emits a :exc:`ResourceWarning` warning if the child " +"process is still running." msgstr "" +"تخریب‌کننده‌ی Popen اکنون در صورتی که فرایند فرزند هنوز در حال اجرا باشد، یک " +"هشدار :exc:`ResourceWarning` صادر می‌کند." -msgid "Popen can use :func:`os.posix_spawn` in some cases for better performance. On Windows Subsystem for Linux and QEMU User Emulation, Popen constructor using :func:`os.posix_spawn` no longer raise an exception on errors like missing program, but the child process fails with a non-zero :attr:`~Popen.returncode`." -msgstr "" +msgid "" +"Popen can use :func:`os.posix_spawn` in some cases for better performance. On " +"Windows Subsystem for Linux and QEMU User Emulation, Popen constructor " +"using :func:`os.posix_spawn` no longer raise an exception on errors like " +"missing program, but the child process fails with a non-" +"zero :attr:`~Popen.returncode`." +msgstr "" +"Popen می‌تواند در برخی موارد برای عملکرد بهتر از :func:`os.posix_spawn` " +"استفاده کند. در Windows Subsystem for Linux و QEMU User Emulation، سازنده‌ی " +"Popen هنگام استفاده از :func:`os.posix_spawn` دیگر در صورت بروز خطاهایی مانند " +"نبود برنامه استثنا پرتاب نمی‌کند، اما فرآیند فرزند " +"با :attr:`~Popen.returncode` غیرصفر شکست می‌خورد." msgid "Exceptions" -msgstr "" +msgstr "استثناها" -msgid "Exceptions raised in the child process, before the new program has started to execute, will be re-raised in the parent." +msgid "" +"Exceptions raised in the child process, before the new program has started to " +"execute, will be re-raised in the parent." msgstr "" +"استثناهای پرتاب‌شده در فرایند فرزند، پیش از شروع اجرای برنامه جدید، در فرایند " +"والد دوباره پرتاب خواهند شد." -msgid "The most common exception raised is :exc:`OSError`. This occurs, for example, when trying to execute a non-existent file. Applications should prepare for :exc:`OSError` exceptions. Note that, when ``shell=True``, :exc:`OSError` will be raised by the child only if the selected shell itself was not found. To determine if the shell failed to find the requested application, it is necessary to check the return code or output from the subprocess." -msgstr "" +msgid "" +"The most common exception raised is :exc:`OSError`. This occurs, for " +"example, when trying to execute a non-existent file. Applications should " +"prepare for :exc:`OSError` exceptions. Note that, when " +"``shell=True``, :exc:`OSError` will be raised by the child only if the " +"selected shell itself was not found. To determine if the shell failed to find " +"the requested application, it is necessary to check the return code or output " +"from the subprocess." +msgstr "" +"رایج‌ترین استثنایی که پرتاب می‌شود، :exc:`OSError` است. این استثنا، برای مثال، " +"هنگام تلاش برای اجرای فایلی ناموجود رخ می‌دهد. برنامه‌ها باید برای " +"استثناهای :exc:`OSError` آماده باشند. توجه داشته باشید که وقتی ``shell=True`` " +"باشد، :exc:`OSError` تنها در صورتی توسط فرایند فرزند پرتاب خواهد شد که خود " +"پوسته انتخاب‌شده یافت نشود. برای تشخیص اینکه پوسته در پیدا کردن برنامه " +"درخواست‌شده ناموفق بوده است، لازم است کد بازگشتی یا خروجی زیرفرایند بررسی شود." -msgid "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid arguments." +msgid "" +"A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " +"arguments." msgstr "" +"اگر :class:`Popen` با آرگومان‌های نامعتبر فراخوانی شود، " +"استثنای :exc:`ValueError` پرتاب می‌شود." -msgid ":func:`check_call` and :func:`check_output` will raise :exc:`CalledProcessError` if the called process returns a non-zero return code." +msgid "" +":func:`check_call` and :func:`check_output` will " +"raise :exc:`CalledProcessError` if the called process returns a non-zero " +"return code." msgstr "" +":func:`check_call` و :func:`check_output` در صورتی که فرایند فراخوانی‌شده یک " +"کد بازگشت غیرصفر برگرداند، :exc:`CalledProcessError` را پرتاب می‌کنند." -msgid "All of the functions and methods that accept a *timeout* parameter, such as :func:`run` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` if the timeout expires before the process exits." +msgid "" +"All of the functions and methods that accept a *timeout* parameter, such " +"as :func:`run` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` " +"if the timeout expires before the process exits." msgstr "" +"تمام توابع و متدهایی که پارامتر *timeout* را می‌پذیرند، مانند :func:`run` " +"و :meth:`Popen.communicate`، اگر مهلت زمانی پیش از خروج فرایند منقضی شود، " +"استثنای :exc:`TimeoutExpired` را پرتاب می‌کنند." -msgid "Exceptions defined in this module all inherit from :exc:`SubprocessError`." +msgid "" +"Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" +"تمام استثناهای تعریف‌شده در این ماژول از :exc:`SubprocessError` ارث می‌برند." msgid "The :exc:`SubprocessError` base class was added." -msgstr "" +msgstr "کلاس پایه :exc:`SubprocessError` افزوده شد." msgid "Security Considerations" -msgstr "" +msgstr "ملاحظات امنیتی" -msgid "Unlike some other popen functions, this library will not implicitly choose to call a system shell. This means that all characters, including shell metacharacters, can safely be passed to child processes. If the shell is invoked explicitly, via ``shell=True``, it is the application's responsibility to ensure that all whitespace and metacharacters are quoted appropriately to avoid `shell injection `_ vulnerabilities. On :ref:`some platforms `, it is possible to use :func:`shlex.quote` for this escaping." -msgstr "" +msgid "" +"Unlike some other popen functions, this library will not implicitly choose to " +"call a system shell. This means that all characters, including shell " +"metacharacters, can safely be passed to child processes. If the shell is " +"invoked explicitly, via ``shell=True``, it is the application's " +"responsibility to ensure that all whitespace and metacharacters are quoted " +"appropriately to avoid `shell injection `_ vulnerabilities. On :ref:`some platforms " +"`, it is possible to use :func:`shlex.quote` for this " +"escaping." +msgstr "" +"برخلاف برخی دیگر از توابع popen، این کتابخانه به‌طور ضمنی انتخاب نمی‌کند که یک " +"پوسته‌ی سیستم را فراخوانی کند. این بدان معناست که همه‌ی نویسه‌ها، از جمله " +"فرانویسه‌های پوسته، می‌توانند به‌صورت امن به فرآیندهای فرزند ارسال شوند. اگر " +"پوسته به‌طور صریح از طریق ``shell=True`` فراخوانی شود، بر عهده‌ی برنامه است که " +"اطمینان حاصل کند همه‌ی نویسه‌های فاصله و فرانویسه‌ها به‌شکل مناسب داخل علامت " +"نقل‌قول قرار گرفته‌اند تا از آسیب‌پذیری‌های `تزریق پوسته `_ جلوگیری شود. در :ref:`برخی سکوها `، می‌توان برای این خنثی‌سازی از :func:`shlex.quote` استفاده کرد." -msgid "On Windows, batch files (:file:`*.bat` or :file:`*.cmd`) may be launched by the operating system in a system shell regardless of the arguments passed to this library. This could result in arguments being parsed according to shell rules, but without any escaping added by Python. If you are intentionally launching a batch file with arguments from untrusted sources, consider passing ``shell=True`` to allow Python to escape special characters. See :gh:`114539` for additional discussion." -msgstr "" +msgid "" +"On Windows, batch files (:file:`*.bat` or :file:`*.cmd`) may be launched by " +"the operating system in a system shell regardless of the arguments passed to " +"this library. This could result in arguments being parsed according to shell " +"rules, but without any escaping added by Python. If you are intentionally " +"launching a batch file with arguments from untrusted sources, consider " +"passing ``shell=True`` to allow Python to escape special characters. " +"See :gh:`114539` for additional discussion." +msgstr "" +"در ویندوز، فایل‌های دسته‌ای (:file:`*.bat` یا :file:`*.cmd`) ممکن است توسط " +"سیستم‌عامل در پوسته‌ی سیستم اجرا شوند، صرف‌نظر از آرگومان‌های داده‌شده به این " +"کتابخانه. این می‌تواند باعث شود که آرگومان‌ها بر اساس قوانین پوسته تجزیه شوند، " +"اما بدون این‌که پایتون هیچ‌گونه خنثی‌سازی‌ای اضافه کرده باشد. اگر عمداً در حال " +"اجرای یک فایل دسته‌ای با آرگومان‌هایی از منابع نامطمئن هستید، پاس دادن " +"``shell=True`` را در نظر داشته باشید تا پایتون بتواند نویسه‌های خاص را خنثی " +"کند. برای بحث بیشتر :gh:`114539` را ببینید." msgid "Popen Objects" -msgstr "" +msgstr "اشیای Popen" msgid "Instances of the :class:`Popen` class have the following methods:" -msgstr "" +msgstr "نمونه‌های کلاس :class:`Popen` دارای متدهای زیر هستند:" -msgid "Check if child process has terminated. Set and return :attr:`~Popen.returncode` attribute. Otherwise, returns ``None``." +msgid "" +"Check if child process has terminated. Set and " +"return :attr:`~Popen.returncode` attribute. Otherwise, returns ``None``." msgstr "" +"بررسی می‌کند که آیا فرایند فرزند خاتمه یافته است. " +"ویژگی :attr:`~Popen.returncode` را تنظیم می‌کند و برمی‌گرداند. در غیر این صورت، " +"``None`` را برمی‌گرداند." -msgid "Wait for child process to terminate. Set and return :attr:`~Popen.returncode` attribute." +msgid "" +"Wait for child process to terminate. Set and " +"return :attr:`~Popen.returncode` attribute." msgstr "" +"منتظر می‌ماند تا فرایند فرزند خاتمه یابد. ویژگی :attr:`~Popen.returncode` را " +"تنظیم و برمی‌گرداند." -msgid "If the process does not terminate after *timeout* seconds, raise a :exc:`TimeoutExpired` exception. It is safe to catch this exception and retry the wait." +msgid "" +"If the process does not terminate after *timeout* seconds, raise " +"a :exc:`TimeoutExpired` exception. It is safe to catch this exception and " +"retry the wait." msgstr "" +"اگر فرایند پس از *timeout* ثانیه به پایان نرسد، استثنای :exc:`TimeoutExpired` " +"پرتاب می‌شود. گرفتن این استثنا و تلاش مجدد برای انتظار ایمن است." -msgid "This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use :meth:`Popen.communicate` when using pipes to avoid that." +msgid "" +"This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the " +"child process generates enough output to a pipe such that it blocks waiting " +"for the OS pipe buffer to accept more data. Use :meth:`Popen.communicate` " +"when using pipes to avoid that." msgstr "" +"هنگام استفاده از ``stdout=PIPE`` یا ``stderr=PIPE``، اگر فرایند فرزند آن‌قدر " +"خروجی به یک پایپ تولید کند که در انتظار پذیرش داده‌های بیشتر توسط بافر پایپ " +"سیستم‌عامل مسدود شود، بن‌بست رخ خواهد داد. برای جلوگیری از این حالت، هنگام " +"استفاده از پایپ‌ها از :meth:`Popen.communicate` استفاده کنید." -msgid "When the ``timeout`` parameter is not ``None``, then (on POSIX) the function is implemented using a busy loop (non-blocking call and short sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see :class:`asyncio.create_subprocess_exec`." +msgid "" +"When the ``timeout`` parameter is not ``None``, then (on POSIX) the function " +"is implemented using a busy loop (non-blocking call and short sleeps). Use " +"the :mod:`asyncio` module for an asynchronous wait: " +"see :class:`asyncio.create_subprocess_exec`." msgstr "" +"هنگامی که پارامتر ``timeout`` برابر ``None`` نباشد، در این صورت (در POSIX) " +"این تابع با استفاده از یک حلقه‌ی مشغول (busy loop) پیاده‌سازی می‌شود (فراخوانی " +"غیرمسدودکننده و توقف‌های کوتاه). برای انتظار ناهمگام، از ماژول :mod:`asyncio` " +"استفاده کنید: :class:`asyncio.create_subprocess_exec` را ببینید." msgid "*timeout* was added." -msgstr "" +msgstr "*timeout* افزوده شد." -msgid "Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate and set the :attr:`~Popen.returncode` attribute. The optional *input* argument should be data to be sent to the child process, or ``None``, if no data should be sent to the child. If streams were opened in text mode, *input* must be a string. Otherwise, it must be bytes." -msgstr "" +msgid "" +"Interact with process: Send data to stdin. Read data from stdout and stderr, " +"until end-of-file is reached. Wait for process to terminate and set " +"the :attr:`~Popen.returncode` attribute. The optional *input* argument " +"should be data to be sent to the child process, or ``None``, if no data " +"should be sent to the child. If streams were opened in text mode, *input* " +"must be a string. Otherwise, it must be bytes." +msgstr "" +"با فرایند تعامل می‌کند: داده‌ها را به stdin ارسال می‌کند. داده‌ها را از stdout و " +"stderr می‌خواند، تا به پایان پرونده برسد. منتظر می‌ماند تا فرایند خاتمه یابد و " +"ویژگی :attr:`~Popen.returncode` را تنظیم می‌کند. آرگومان اختیاری *input* باید " +"داده‌ای برای ارسال به فرایند فرزند باشد، یا ``None``، اگر نباید هیچ داده‌ای به " +"فرایند فرزند ارسال شود. اگر جریان‌ها در حالت متنی باز شده باشند، *input* باید " +"یک رشته باشد. در غیر این صورت، باید bytes باشد." -msgid ":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data will be strings if streams were opened in text mode; otherwise, bytes." +msgid "" +":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data " +"will be strings if streams were opened in text mode; otherwise, bytes." msgstr "" +":meth:`communicate` یک تاپل ``(stdout_data, stderr_data)`` را برمی‌گرداند. اگر " +"جریان‌ها در حالت متنی باز شده باشند، داده‌ها رشته خواهند بود؛ در غیر این صورت، " +"بایت خواهند بود." -msgid "Note that if you want to send data to the process's stdin, you need to create the Popen object with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, you need to give ``stdout=PIPE`` and/or ``stderr=PIPE`` too." +msgid "" +"Note that if you want to send data to the process's stdin, you need to create " +"the Popen object with ``stdin=PIPE``. Similarly, to get anything other than " +"``None`` in the result tuple, you need to give ``stdout=PIPE`` and/or " +"``stderr=PIPE`` too." msgstr "" +"توجه داشته باشید که اگر می‌خواهید داده‌ای را به stdin فرایند ارسال کنید، باید " +"شیء Popen را با ``stdin=PIPE`` ایجاد کنید. به‌طور مشابه، برای دریافت هر مقداری " +"غیر از ``None`` در تاپل نتیجه، باید ``stdout=PIPE`` و/یا ``stderr=PIPE`` را " +"نیز مشخص کنید." -msgid "If the process does not terminate after *timeout* seconds, a :exc:`TimeoutExpired` exception will be raised. Catching this exception and retrying communication will not lose any output. Supplying *input* to a subsequent post-timeout :meth:`communicate` call is in undefined behavior and may become an error in the future." +msgid "" +"If the process does not terminate after *timeout* seconds, " +"a :exc:`TimeoutExpired` exception will be raised. Catching this exception " +"and retrying communication will not lose any output. Supplying *input* to a " +"subsequent post-timeout :meth:`communicate` call is in undefined behavior and " +"may become an error in the future." msgstr "" +"اگر فرآیند پس از *timeout* ثانیه خاتمه نیابد، استثنای :exc:`TimeoutExpired` " +"پرتاب خواهد شد. گرفتن این استثنا و تلاش مجدد برای ارتباط، باعث از دست رفتن " +"هیچ خروجی نخواهد شد. ارائه *input* به یک فراخوانی :meth:`communicate` بعدی پس " +"از انقضای مهلت، رفتار تعریف‌نشده‌ای دارد و ممکن است در آینده به خطا تبدیل شود." -msgid "The child process is not killed if the timeout expires, so in order to cleanup properly a well-behaved application should kill the child process and finish communication::" +msgid "" +"The child process is not killed if the timeout expires, so in order to " +"cleanup properly a well-behaved application should kill the child process and " +"finish communication::" msgstr "" +"اگر مهلت به پایان برسد، فرایند فرزند کشته نمی‌شود، بنابراین برای پاک‌سازی صحیح، " +"برنامه‌ای که رفتار درستی دارد باید فرایند فرزند را بکشد و ارتباط را پایان دهد::" msgid "" "proc = subprocess.Popen(...)\n" @@ -548,236 +1395,586 @@ msgid "" " proc.kill()\n" " outs, errs = proc.communicate()" msgstr "" +"proc = subprocess.Popen(...)\n" +"try:\n" +" outs, errs = proc.communicate(timeout=15)\n" +"except TimeoutExpired:\n" +" proc.kill()\n" +" outs, errs = proc.communicate()" -msgid "After a call to :meth:`~Popen.communicate` raises :exc:`TimeoutExpired`, do not call :meth:`~Popen.wait`. Use an additional :meth:`~Popen.communicate` call to finish handling pipes and populate the :attr:`~Popen.returncode` attribute." +msgid "" +"After a call to :meth:`~Popen.communicate` raises :exc:`TimeoutExpired`, do " +"not call :meth:`~Popen.wait`. Use an additional :meth:`~Popen.communicate` " +"call to finish handling pipes and populate the :attr:`~Popen.returncode` " +"attribute." msgstr "" +"پس از آنکه فراخوانی :meth:`~Popen.communicate` منجر به " +"پرتاب :exc:`TimeoutExpired` شد، :meth:`~Popen.wait` را فراخوانی نکنید. برای " +"به پایان رساندن پردازش پایپ‌ها و مقداردهی ویژگی :attr:`~Popen.returncode`، یک " +"فراخوانی اضافی از :meth:`~Popen.communicate` انجام دهید." -msgid "The data read is buffered in memory, so do not use this method if the data size is large or unlimited." +msgid "" +"The data read is buffered in memory, so do not use this method if the data " +"size is large or unlimited." msgstr "" +"داده‌ی خوانده‌شده در حافظه بافر می‌شود، بنابراین اگر اندازه‌ی داده زیاد یا نامحدود " +"است، از این متد استفاده نکنید." msgid "Sends the signal *signal* to the child." -msgstr "" +msgstr "سیگنال *signal* را به فرزند ارسال می‌کند." msgid "Do nothing if the process completed." -msgstr "" +msgstr "اگر فرایند تکمیل شد، هیچ کاری انجام ندهید." -msgid "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." +msgid "" +"On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " +"CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " +"parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" +"در ویندوز، SIGTERM نام مستعاری برای :meth:`terminate` است. می‌توان " +"CTRL_C_EVENT و CTRL_BREAK_EVENT را به فرایندهایی که با پارامتر " +"*creationflags* شامل ``CREATE_NEW_PROCESS_GROUP`` آغاز شده‌اند، ارسال کرد." -msgid "Stop the child. On POSIX OSs the method sends :py:const:`~signal.SIGTERM` to the child. On Windows the Win32 API function :c:func:`!TerminateProcess` is called to stop the child." +msgid "" +"Stop the child. On POSIX OSs the method sends :py:const:`~signal.SIGTERM` to " +"the child. On Windows the Win32 API function :c:func:`!TerminateProcess` is " +"called to stop the child." msgstr "" +"فرزند را متوقف می‌کند. در سیستم‌عامل‌های POSIX، این " +"متد :py:const:`~signal.SIGTERM` را به فرزند ارسال می‌کند. در ویندوز، " +"تابع :c:func:`!TerminateProcess` از API Win32 برای توقف فرزند فراخوانی می‌شود." -msgid "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On Windows :meth:`kill` is an alias for :meth:`terminate`." +msgid "" +"Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " +"Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" +"فرزند را می‌کشد. در سیستم‌عامل‌های POSIX، این تابع SIGKILL را به فرزند ارسال " +"می‌کند. در ویندوز، :meth:`kill` نام مستعاری برای :meth:`terminate` است." -msgid "The following attributes are also set by the class for you to access. Reassigning them to new values is unsupported:" +msgid "" +"The following attributes are also set by the class for you to access. " +"Reassigning them to new values is unsupported:" msgstr "" +"ویژگی‌های زیر نیز توسط کلاس تنظیم می‌شوند تا شما به آن‌ها دسترسی داشته باشید. " +"انتساب مجدد آن‌ها به مقادیر جدید پشتیبانی نمی‌شود:" -msgid "The *args* argument as it was passed to :class:`Popen` -- a sequence of program arguments or else a single string." +msgid "" +"The *args* argument as it was passed to :class:`Popen` -- a sequence of " +"program arguments or else a single string." msgstr "" +"آرگومان *args* همان‌گونه که به :class:`Popen` فرستاده شده است -- دنباله‌ای از " +"آرگومان‌های برنامه یا یک رشته." -msgid "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable stream object as returned by :func:`open`. If the *encoding* or *errors* arguments were specified or the *text* or *universal_newlines* argument was ``True``, the stream is a text stream, otherwise it is a byte stream. If the *stdin* argument was not :data:`PIPE`, this attribute is ``None``." -msgstr "" +msgid "" +"If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " +"stream object as returned by :func:`open`. If the *encoding* or *errors* " +"arguments were specified or the *text* or *universal_newlines* argument was " +"``True``, the stream is a text stream, otherwise it is a byte stream. If the " +"*stdin* argument was not :data:`PIPE`, this attribute is ``None``." +msgstr "" +"اگر آرگومان *stdin* برابر :data:`PIPE` بود، این ویژگی یک شیء جریان قابل‌نوشتن " +"است، همانند شیء برگردانده‌شده توسط :func:`open`. اگر آرگومان‌های *encoding* یا " +"*errors* مشخص شده باشند یا آرگومان *text* یا آرگومان *universal_newlines* " +"برابر ``True`` باشد، جریان یک جریان متنی است، در غیر این صورت یک جریان بایتی " +"است. اگر آرگومان *stdin* برابر :data:`PIPE` نبود، این ویژگی ``None`` است." -msgid "If the *stdout* argument was :data:`PIPE`, this attribute is a readable stream object as returned by :func:`open`. Reading from the stream provides output from the child process. If the *encoding* or *errors* arguments were specified or the *text* or *universal_newlines* argument was ``True``, the stream is a text stream, otherwise it is a byte stream. If the *stdout* argument was not :data:`PIPE`, this attribute is ``None``." -msgstr "" +msgid "" +"If the *stdout* argument was :data:`PIPE`, this attribute is a readable " +"stream object as returned by :func:`open`. Reading from the stream provides " +"output from the child process. If the *encoding* or *errors* arguments were " +"specified or the *text* or *universal_newlines* argument was ``True``, the " +"stream is a text stream, otherwise it is a byte stream. If the *stdout* " +"argument was not :data:`PIPE`, this attribute is ``None``." +msgstr "" +"اگر آرگومان *stdout* برابر :data:`PIPE` بود، این ویژگی یک شیء جریان خواندنی " +"است، مانند شیء بازگردانده‌شده توسط :func:`open`. خواندن از جریان، خروجی فرایند " +"فرزند را فراهم می‌کند. اگر آرگومان‌های *encoding* یا *errors* مشخص شده باشند یا " +"آرگومان *text* یا *universal_newlines* برابر ``True`` باشد، جریان یک جریان " +"متنی است، در غیر این صورت یک جریان بایتی است. اگر آرگومان *stdout* " +"برابر :data:`PIPE` نبود، این ویژگی ``None`` است." -msgid "If the *stderr* argument was :data:`PIPE`, this attribute is a readable stream object as returned by :func:`open`. Reading from the stream provides error output from the child process. If the *encoding* or *errors* arguments were specified or the *text* or *universal_newlines* argument was ``True``, the stream is a text stream, otherwise it is a byte stream. If the *stderr* argument was not :data:`PIPE`, this attribute is ``None``." -msgstr "" +msgid "" +"If the *stderr* argument was :data:`PIPE`, this attribute is a readable " +"stream object as returned by :func:`open`. Reading from the stream provides " +"error output from the child process. If the *encoding* or *errors* arguments " +"were specified or the *text* or *universal_newlines* argument was ``True``, " +"the stream is a text stream, otherwise it is a byte stream. If the *stderr* " +"argument was not :data:`PIPE`, this attribute is ``None``." +msgstr "" +"اگر آرگومان *stderr* برابر :data:`PIPE` باشد، این ویژگی یک شیء جریان خواندنی " +"است، مانند شیءای که :func:`open` بازمی‌گرداند. خواندن از جریان، خروجی خطای " +"فرایند فرزند را فراهم می‌کند. اگر آرگومان‌های *encoding* یا *errors* تعیین‌شده " +"باشند یا آرگومان *text* یا *universal_newlines* برابر ``True`` باشد، جریان یک " +"جریان متنی است، در غیر این صورت یک جریان بایتی است. اگر آرگومان *stderr* " +"برابر :data:`PIPE` نباشد، این ویژگی ``None`` است." -msgid "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read ` to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process." +msgid "" +"Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write " +"`, :attr:`.stdout.read ` or :attr:`.stderr.read " +"` to avoid deadlocks due to any of the other OS pipe buffers " +"filling up and blocking the child process." msgstr "" +"برای جلوگیری از بن‌بست‌های ناشی از پر شدن هر یک از سایر بافرهای پایپ سیستم‌عامل " +"و مسدود شدن فرایند فرزند، از :meth:`~Popen.communicate` به " +"جای :attr:`.stdin.write `، :attr:`.stdout.read ` " +"یا :attr:`.stderr.read ` استفاده کنید." msgid "The process ID of the child process." -msgstr "" +msgstr "شناسه فرایند فرزند." -msgid "Note that if you set the *shell* argument to ``True``, this is the process ID of the spawned shell." +msgid "" +"Note that if you set the *shell* argument to ``True``, this is the process ID " +"of the spawned shell." msgstr "" +"توجه داشته باشید که اگر آرگومان *shell* را روی ``True`` تنظیم کنید، این شناسه " +"فرایند پوسته ایجادشده است." -msgid "The child return code. Initially ``None``, :attr:`returncode` is set by a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods if they detect that the process has terminated." +msgid "" +"The child return code. Initially ``None``, :attr:`returncode` is set by a " +"call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods if " +"they detect that the process has terminated." msgstr "" +"کد بازگشت فرزند. :attr:`returncode` که در ابتدا ``None`` است، در صورتی با " +"فراخوانی متدهای :meth:`poll`، :meth:`wait` یا :meth:`communicate` تنظیم می‌شود " +"که این متدها تشخیص دهند فرایند خاتمه یافته است." -msgid "A ``None`` value indicates that the process hadn't yet terminated at the time of the last method call." +msgid "" +"A ``None`` value indicates that the process hadn't yet terminated at the time " +"of the last method call." msgstr "" +"مقدار ``None`` نشان می‌دهد که فرایند در زمان آخرین فراخوانی متد هنوز خاتمه " +"نیافته بود." -msgid "When ``shell=True``, the return code reflects the exit status of the shell itself (e.g. ``/bin/sh``), which may map signals to codes such as ``128+N``. See the documentation of the shell (for example, the Bash manual's Exit Status) for details." +msgid "" +"When ``shell=True``, the return code reflects the exit status of the shell " +"itself (e.g. ``/bin/sh``), which may map signals to codes such as ``128+N``. " +"See the documentation of the shell (for example, the Bash manual's Exit " +"Status) for details." msgstr "" +"هنگامی که ``shell=True`` باشد، کد بازگشتی وضعیت خروج خود پوسته (برای مثال ``/" +"bin/sh``) را منعکس می‌کند، که ممکن است سیگنال‌ها را به کدهایی مانند ``128+N`` " +"نگاشت کند. برای جزئیات، مستندات پوسته (برای مثال، بخش Exit Status راهنمای " +"Bash) را ببینید." msgid "Windows Popen Helpers" -msgstr "" +msgstr "کمکی‌های Popen در ویندوز" -msgid "The :class:`STARTUPINFO` class and following constants are only available on Windows." -msgstr "" +msgid "" +"The :class:`STARTUPINFO` class and following constants are only available on " +"Windows." +msgstr "کلاس :class:`STARTUPINFO` و ثابت‌های زیر فقط در ویندوز در دسترس هستند." -msgid "Partial support of the Windows `STARTUPINFO `__ structure is used for :class:`Popen` creation. The following attributes can be set by passing them as keyword-only arguments." +msgid "" +"Partial support of the Windows `STARTUPINFO `__ structure is used for :class:`Popen` " +"creation. The following attributes can be set by passing them as keyword-" +"only arguments." msgstr "" +"پشتیبانی جزئی از ساختار `STARTUPINFO `__ ویندوز برای ایجاد :class:`Popen` استفاده " +"می‌شود. ویژگی‌های زیر را می‌توان با ارسال آن‌ها به‌عنوان آرگومان‌های فقط کلیدواژه‌ای " +"تنظیم کرد." msgid "Keyword-only argument support was added." -msgstr "" +msgstr "پشتیبانی از آرگومان‌های فقط کلیدواژه‌ای افزوده شد." -msgid "A bit field that determines whether certain :class:`STARTUPINFO` attributes are used when the process creates a window. ::" +msgid "" +"A bit field that determines whether certain :class:`STARTUPINFO` attributes " +"are used when the process creates a window. ::" msgstr "" +"یک میدان بیتی (bit field) که تعیین می‌کند آیا برخی " +"ویژگی‌های :class:`STARTUPINFO` هنگام ایجاد پنجره توسط فرایند استفاده می‌شوند یا " +"خیر. ::" msgid "" "si = subprocess.STARTUPINFO()\n" "si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW" msgstr "" +"si = subprocess.STARTUPINFO()\n" +"si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess.STARTF_USESHOWWINDOW" -msgid "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` is not specified, the default for standard input is the keyboard buffer." +msgid "" +"If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " +"the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` is " +"not specified, the default for standard input is the keyboard buffer." msgstr "" +"اگر :attr:`dwFlags` :data:`STARTF_USESTDHANDLES` را مشخص کند، این ویژگی، " +"دسته ورودی استاندارد فرایند است. اگر :data:`STARTF_USESTDHANDLES` مشخص " +"نشده باشد، پیش‌فرض ورودی استاندارد، بافر صفحه‌کلید است." -msgid "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is the standard output handle for the process. Otherwise, this attribute is ignored and the default for standard output is the console window's buffer." +msgid "" +"If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " +"the standard output handle for the process. Otherwise, this attribute is " +"ignored and the default for standard output is the console window's buffer." msgstr "" +"اگر :attr:`dwFlags` مقدار :data:`STARTF_USESTDHANDLES` را مشخص کند، این " +"ویژگی، دسته خروجی استاندارد فرایند است. در غیر این صورت، این ویژگی نادیده " +"گرفته می‌شود و پیش‌فرض خروجی استاندارد، میان‌گیر پنجره‌ی کنسول است." -msgid "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is the standard error handle for the process. Otherwise, this attribute is ignored and the default for standard error is the console window's buffer." +msgid "" +"If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " +"the standard error handle for the process. Otherwise, this attribute is " +"ignored and the default for standard error is the console window's buffer." msgstr "" +"اگر :attr:`dwFlags` مقدار :data:`STARTF_USESTDHANDLES` را تعیین کند، این " +"ویژگی، دسته خطای استاندارد برای فرایند است. در غیر این صورت، این ویژگی نادیده " +"گرفته می‌شود و پیش‌فرض برای خطای استاندارد، بافر پنجره‌ی کنسول است." -msgid "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute can be any of the values that can be specified in the ``nCmdShow`` parameter for the `ShowWindow `__ function, except for ``SW_SHOWDEFAULT``. Otherwise, this attribute is ignored." -msgstr "" +msgid "" +"If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute can " +"be any of the values that can be specified in the ``nCmdShow`` parameter for " +"the `ShowWindow `__ function, except for ``SW_SHOWDEFAULT``. " +"Otherwise, this attribute is ignored." +msgstr "" +"اگر :attr:`dwFlags` مقدار :data:`STARTF_USESHOWWINDOW` را مشخص کند، این ویژگی " +"می‌تواند هر یک از مقدارهایی باشد که می‌توان در پارامتر ``nCmdShow`` برای تابع " +"`ShowWindow `__ مشخص کرد، به‌جز ``SW_SHOWDEFAULT``. در غیر این " +"صورت، این ویژگی نادیده گرفته می‌شود." -msgid ":data:`SW_HIDE` is provided for this attribute. It is used when :class:`Popen` is called with ``shell=True``." +msgid "" +":data:`SW_HIDE` is provided for this attribute. It is used " +"when :class:`Popen` is called with ``shell=True``." msgstr "" +":data:`SW_HIDE` برای این ویژگی در نظر گرفته شده است. این مقدار زمانی استفاده " +"می‌شود که :class:`Popen` با ``shell=True`` فراخوانی شود." -msgid "A dictionary of additional attributes for process creation as given in ``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." +msgid "" +"A dictionary of additional attributes for process creation as given in " +"``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" +"یک دیکشنری از ویژگی‌های اضافی برای ایجاد فرایند، همان‌طور که در " +"``STARTUPINFOEX`` آمده است؛ `UpdateProcThreadAttribute `__ " +"را ببینید." msgid "Supported attributes:" -msgstr "" +msgstr "ویژگی‌های پشتیبانی‌شده:" msgid "**handle_list**" -msgstr "" +msgstr "handle_list" -msgid "Sequence of handles that will be inherited. *close_fds* must be true if non-empty." +msgid "" +"Sequence of handles that will be inherited. *close_fds* must be true if non-" +"empty." msgstr "" +"دنباله‌ای از دسته‌ها (handle) که به ارث برده خواهند شد. *close_fds* باید در " +"صورت غیرخالی بودن، true باشد." -msgid "The handles must be temporarily made inheritable by :func:`os.set_handle_inheritable` when passed to the :class:`Popen` constructor, else :class:`OSError` will be raised with Windows error ``ERROR_INVALID_PARAMETER`` (87)." +msgid "" +"The handles must be temporarily made inheritable " +"by :func:`os.set_handle_inheritable` when passed to the :class:`Popen` " +"constructor, else :class:`OSError` will be raised with Windows error " +"``ERROR_INVALID_PARAMETER`` (87)." msgstr "" +"دسته‌ها باید هنگام ارسال به سازنده‌ی :class:`Popen`، به‌طور موقت با استفاده " +"از :func:`os.set_handle_inheritable` قابل‌ارث‌بردن شوند، در غیر این " +"صورت :class:`OSError` با خطای ویندوز ``ERROR_INVALID_PARAMETER`` (87) پرتاب " +"خواهد شد." -msgid "In a multithreaded process, use caution to avoid leaking handles that are marked inheritable when combining this feature with concurrent calls to other process creation functions that inherit all handles such as :func:`os.system`. This also applies to standard handle redirection, which temporarily creates inheritable handles." -msgstr "" +msgid "" +"In a multithreaded process, use caution to avoid leaking handles that are " +"marked inheritable when combining this feature with concurrent calls to other " +"process creation functions that inherit all handles such " +"as :func:`os.system`. This also applies to standard handle redirection, " +"which temporarily creates inheritable handles." +msgstr "" +"در یک فرایند چندنخی، هنگام ترکیب این قابلیت با فراخوانی‌های همزمان به دیگر " +"توابع ایجاد فرایند، مانند :func:`os.system`، که همه‌ی دسته‌ها (handles) را به " +"ارث می‌برند، احتیاط کنید تا از نشت دسته‌هایی که به‌عنوان قابل ارث‌بری علامت‌گذاری " +"شده‌اند جلوگیری شود. این موضوع در مورد تغییر مسیر دسته‌های استاندارد نیز صدق " +"می‌کند، که به‌طور موقت دسته‌های قابل ارث‌بری ایجاد می‌کند." msgid "Windows Constants" -msgstr "" +msgstr "ثابت‌های ویندوز" msgid "The :mod:`!subprocess` module exposes the following constants." -msgstr "" +msgstr "ماژول :mod:`!subprocess` ثابت‌های زیر را ارائه می‌دهد." -msgid "The standard input device. Initially, this is the console input buffer, ``CONIN$``." -msgstr "" +msgid "" +"The standard input device. Initially, this is the console input buffer, " +"``CONIN$``." +msgstr "دستگاه ورودی استاندارد. در ابتدا، این بافر ورودی کنسول، ``CONIN$`` است." -msgid "The standard output device. Initially, this is the active console screen buffer, ``CONOUT$``." +msgid "" +"The standard output device. Initially, this is the active console screen " +"buffer, ``CONOUT$``." msgstr "" +"دستگاه خروجی استاندارد. در ابتدا، این بافر صفحه‌ی کنسول فعال، ``CONOUT$`` است." -msgid "The standard error device. Initially, this is the active console screen buffer, ``CONOUT$``." +msgid "" +"The standard error device. Initially, this is the active console screen " +"buffer, ``CONOUT$``." msgstr "" +"دستگاه خطای استاندارد. در ابتدا، این بافر صفحه‌ی کنسول فعال است، ``CONOUT$``." msgid "Hides the window. Another window will be activated." -msgstr "" +msgstr "پنجره را پنهان می‌کند. پنجره‌ای دیگر فعال خواهد شد." -msgid "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO.hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional information." +msgid "" +"Specifies that " +"the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO.hStdOutput`, " +"and :attr:`STARTUPINFO.hStdError` attributes contain additional information." msgstr "" +"مشخص می‌کند که " +"ویژگی‌های :attr:`STARTUPINFO.hStdInput`، :attr:`STARTUPINFO.hStdOutput` " +"و :attr:`STARTUPINFO.hStdError` حاوی اطلاعات اضافی هستند." -msgid "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains additional information." +msgid "" +"Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " +"additional information." msgstr "" +"مشخص می‌کند که ویژگی :attr:`STARTUPINFO.wShowWindow` شامل اطلاعات اضافی است." -msgid "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the *Working in Background* mouse cursor will be displayed while a process is launching. This is the default behavior for GUI processes." +msgid "" +"A :attr:`STARTUPINFO.dwFlags` parameter to specify that the *Working in " +"Background* mouse cursor will be displayed while a process is launching. This " +"is the default behavior for GUI processes." msgstr "" +"پارامتری برای :attr:`STARTUPINFO.dwFlags` جهت تعیین اینکه نشانگر ماوس *در حال " +"کار در پس‌زمینه* در حین راه‌اندازی یک فرآیند نمایش داده خواهد شد. این رفتار " +"پیش‌فرض برای فرآیندهای GUI است." -msgid "A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse cursor will not be changed when launching a process." +msgid "" +"A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse cursor will " +"not be changed when launching a process." msgstr "" +"یک پارامتر :attr:`STARTUPINFO.dwFlags` برای مشخص کردن اینکه نشانگر ماوس هنگام " +"راه‌اندازی یک فرایند تغییر نخواهد کرد." -msgid "The new process has a new console, instead of inheriting its parent's console (the default)." +msgid "" +"The new process has a new console, instead of inheriting its parent's console " +"(the default)." msgstr "" +"فرایند جدید، به‌جای به ارث بردن کنسول فرایند والد خود (حالت پیش‌فرض)، یک کنسول " +"جدید دارد." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process group will be created. This flag is necessary for using :func:`os.kill` on the subprocess." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"group will be created. This flag is necessary for using :func:`os.kill` on " +"the subprocess." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک گروه " +"فرایند جدید ایجاد می‌شود. این پرچم برای استفاده از :func:`os.kill` روی " +"زیرفرایند ضروری است." msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" +"اگر :data:`CREATE_NEW_CONSOLE` مشخص شده باشد، این پرچم نادیده گرفته می‌شود." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have an above average priority." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have an above average priority." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه فرایند " +"جدید اولویتی بالاتر از میانگین خواهد داشت." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have a below average priority." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have a below average priority." msgstr "" +"پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک فرایند " +"جدید اولویتی کمتر از میانگین خواهد داشت." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have a high priority." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have a high priority." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک " +"فرایند جدید اولویت بالایی خواهد داشت." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have an idle (lowest) priority." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have an idle (lowest) priority." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک " +"فرایند جدید اولویت بیکار (کمترین) را خواهد داشت." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have a normal priority. (default)" +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have a normal priority. (default)" msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک " +"فرایند جدید اولویت عادی خواهد داشت. (پیش‌فرض)" -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will have realtime priority. You should almost never use REALTIME_PRIORITY_CLASS, because this interrupts system threads that manage mouse input, keyboard input, and background disk flushing. This class can be appropriate for applications that \"talk\" directly to hardware or that perform brief tasks that should have limited interruptions." -msgstr "" +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will have realtime priority. You should almost never use " +"REALTIME_PRIORITY_CLASS, because this interrupts system threads that manage " +"mouse input, keyboard input, and background disk flushing. This class can be " +"appropriate for applications that \"talk\" directly to hardware or that " +"perform brief tasks that should have limited interruptions." +msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک " +"فرایند جدید اولویت بلادرنگ خواهد داشت. شما تقریباً هرگز نباید از " +"REALTIME_PRIORITY_CLASS استفاده کنید، زیرا این کار در نخ‌های سیستمی که ورودی " +"ماوس، ورودی صفحه‌کلید و تخلیه دیسک در پس‌زمینه را مدیریت می‌کنند وقفه می‌اندازد. " +"این کلاس می‌تواند برای برنامه‌هایی که مستقیماً با سخت‌افزار «صحبت» می‌کنند یا " +"وظایف کوتاه‌مدتی را انجام می‌دهند که باید وقفه‌های محدودی داشته باشند، مناسب " +"باشد." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will not create a window." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will not create a window." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` جهت مشخص کردن اینکه یک " +"فرایند جدید پنجره‌ای ایجاد نمی‌کند." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process will not inherit its parent's console. This value cannot be used with CREATE_NEW_CONSOLE." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"will not inherit its parent's console. This value cannot be used with " +"CREATE_NEW_CONSOLE." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` که مشخص می‌کند فرایند جدید، " +"کنسول والد خود را به ارث نخواهد برد. این مقدار نمی‌تواند همراه با " +"CREATE_NEW_CONSOLE استفاده شود." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process does not inherit the error mode of the calling process. Instead, the new process gets the default error mode. This feature is particularly useful for multithreaded shell applications that run with hard errors disabled." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process " +"does not inherit the error mode of the calling process. Instead, the new " +"process gets the default error mode. This feature is particularly useful for " +"multithreaded shell applications that run with hard errors disabled." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` تا مشخص کند که فرایند جدید، " +"حالت خطای فرایند فراخواننده را به ارث نمی‌برد. در عوض، فرایند جدید حالت خطای " +"پیش‌فرض را دریافت می‌کند. این قابلیت به‌ویژه برای برنامه‌های پوسته‌ای چندنخی مفید " +"است که با خطاهای سخت غیرفعال اجرا می‌شوند." -msgid "A :class:`Popen` ``creationflags`` parameter to specify that a new process is not associated with the job." +msgid "" +"A :class:`Popen` ``creationflags`` parameter to specify that a new process is " +"not associated with the job." msgstr "" +"یک پارامتر ``creationflags`` برای :class:`Popen` که مشخص می‌کند یک فرآیند جدید " +"با کار (job) مرتبط نیست." msgid "Older high-level API" -msgstr "" +msgstr "API سطح بالای قدیمی‌تر" -msgid "Prior to Python 3.5, these three functions comprised the high level API to subprocess. You can now use :func:`run` in many cases, but lots of existing code calls these functions." +msgid "" +"Prior to Python 3.5, these three functions comprised the high level API to " +"subprocess. You can now use :func:`run` in many cases, but lots of existing " +"code calls these functions." msgstr "" +"پیش از پایتون 3.5، این سه تابع API سطح‌بالا برای subprocess را تشکیل می‌دادند. " +"اکنون می‌توانید در بسیاری از موارد از :func:`run` استفاده کنید، اما بسیاری از " +"کدهای موجود این توابع را فراخوانی می‌کنند." -msgid "Run the command described by *args*. Wait for command to complete, then return the :attr:`~Popen.returncode` attribute." +msgid "" +"Run the command described by *args*. Wait for command to complete, then " +"return the :attr:`~Popen.returncode` attribute." msgstr "" +"فرمان مشخص‌شده با *args* را اجرا کنید. منتظر بمانید تا فرمان کامل شود، سپس " +"ویژگی :attr:`~Popen.returncode` را برگردانید." -msgid "Code needing to capture stdout or stderr should use :func:`run` instead::" +msgid "" +"Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" +"کدی که نیاز به گرفتن stdout یا stderr دارد، باید به‌جای آن از :func:`run` " +"استفاده کند::" msgid "run(...).returncode" -msgstr "" +msgstr "run(...).returncode" msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." -msgstr "" +msgstr "برای سرکوب stdout یا stderr، مقدار :data:`DEVNULL` را ارائه دهید." -msgid "The arguments shown above are merely some common ones. The full function signature is the same as that of the :class:`Popen` constructor - this function passes all supplied arguments other than *timeout* directly through to that interface." +msgid "" +"The arguments shown above are merely some common ones. The full function " +"signature is the same as that of the :class:`Popen` constructor - this " +"function passes all supplied arguments other than *timeout* directly through " +"to that interface." msgstr "" +"آرگومان‌های نشان‌داده‌شده در بالا تنها چند مورد رایج هستند. امضای کامل تابع " +"همانند امضای سازنده‌ی :class:`Popen` است؛ این تابع تمام آرگومان‌های ارائه‌شده " +"به‌جز *timeout* را مستقیماً به آن رابط منتقل می‌کند." -msgid "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child process will block if it generates enough output to a pipe to fill up the OS pipe buffer as the pipes are not being read from." +msgid "" +"Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " +"process will block if it generates enough output to a pipe to fill up the OS " +"pipe buffer as the pipes are not being read from." msgstr "" +"از ``stdout=PIPE`` یا ``stderr=PIPE`` با این تابع استفاده نکنید. اگر فرایند " +"فرزند به اندازه‌ای خروجی به یک پایپتولید کند که بافر پایپ سیستم‌عامل " +"(OS pipe buffer) را پر کند، مسدود خواهد شد، زیرا پایپ‌ها خوانده نمی‌شوند." -msgid "Run command with arguments. Wait for command to complete. If the return code was zero then return, otherwise raise :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute. If :func:`check_call` was unable to start the process it will propagate the exception that was raised." -msgstr "" +msgid "" +"Run command with arguments. Wait for command to complete. If the return code " +"was zero then return, otherwise raise :exc:`CalledProcessError`. " +"The :exc:`CalledProcessError` object will have the return code in " +"the :attr:`~CalledProcessError.returncode` attribute. If :func:`check_call` " +"was unable to start the process it will propagate the exception that was " +"raised." +msgstr "" +"فرمان را با آرگومان‌ها اجرا می‌کند. منتظر می‌ماند تا فرمان کامل شود. اگر کد " +"بازگشت صفر بود، بازمی‌گردد؛ در غیر این صورت :exc:`CalledProcessError` را پرتاب " +"می‌کند. شیء :exc:`CalledProcessError` کد بازگشت را در " +"ویژگی :attr:`~CalledProcessError.returncode` خواهد داشت. " +"اگر :func:`check_call` نتوانست فرایند را آغاز کند، استثنای پرتاب‌شده را منتشر " +"می‌کند." msgid "run(..., check=True)" -msgstr "" +msgstr "run(..., check=True)" msgid "Run command with arguments and return its output." -msgstr "" +msgstr "فرمان را با آرگومان‌ها اجرا می‌کند و خروجی آن را برمی‌گرداند." -msgid "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute and any output in the :attr:`~CalledProcessError.output` attribute." +msgid "" +"If the return code was non-zero it raises a :exc:`CalledProcessError`. " +"The :exc:`CalledProcessError` object will have the return code in " +"the :attr:`~CalledProcessError.returncode` attribute and any output in " +"the :attr:`~CalledProcessError.output` attribute." msgstr "" +"اگر کد بازگشتی غیرصفر باشد، یک :exc:`CalledProcessError` پرتاب می‌شود. " +"شیء :exc:`CalledProcessError` کد بازگشتی را در " +"ویژگی :attr:`~CalledProcessError.returncode` و هرگونه خروجی را در " +"ویژگی :attr:`~CalledProcessError.output` خواهد داشت." msgid "This is equivalent to::" -msgstr "" +msgstr "این معادل است با::" msgid "run(..., check=True, stdout=PIPE).stdout" -msgstr "" +msgstr "run(..., check=True, stdout=PIPE).stdout" -msgid "The arguments shown above are merely some common ones. The full function signature is largely the same as that of :func:`run` - most arguments are passed directly through to that interface. One API deviation from :func:`run` behavior exists: passing ``input=None`` will behave the same as ``input=b''`` (or ``input=''``, depending on other arguments) rather than using the parent's standard input file handle." -msgstr "" +msgid "" +"The arguments shown above are merely some common ones. The full function " +"signature is largely the same as that of :func:`run` - most arguments are " +"passed directly through to that interface. One API deviation from :func:`run` " +"behavior exists: passing ``input=None`` will behave the same as ``input=b''`` " +"(or ``input=''``, depending on other arguments) rather than using the " +"parent's standard input file handle." +msgstr "" +"آرگومان‌های نشان‌داده‌شده در بالا تنها برخی از آرگومان‌های رایج هستند. امضای کامل " +"تابع تا حد زیادی مشابه :func:`run` است - بیشتر آرگومان‌ها مستقیماً به آن رابط " +"منتقل می‌شوند. یک تفاوت API نسبت به رفتار :func:`run` وجود دارد: ارسال " +"``input=None`` مانند ``input=b''`` (یا ``input=''``، بسته به آرگومان‌های دیگر) " +"رفتار می‌کند، به‌جای اینکه از دسته فایل ورودی استاندارد والد استفاده کند." -msgid "By default, this function will return the data as encoded bytes. The actual encoding of the output data may depend on the command being invoked, so the decoding to text will often need to be handled at the application level." +msgid "" +"By default, this function will return the data as encoded bytes. The actual " +"encoding of the output data may depend on the command being invoked, so the " +"decoding to text will often need to be handled at the application level." msgstr "" +"به‌طور پیش‌فرض، این تابع داده را به‌صورت بایت‌های کدگذاری‌شده برمی‌گرداند. کدگذاری " +"واقعی داده خروجی ممکن است به فرمان فراخوانی‌شده بستگی داشته باشد، بنابراین " +"کدگشایی به متن اغلب باید در سطح کاربرد مدیریت شود." -msgid "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or *universal_newlines* to ``True`` as described in :ref:`frequently-used-arguments` and :func:`run`." +msgid "" +"This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " +"*universal_newlines* to ``True`` as described in :ref:`frequently-used-" +"arguments` and :func:`run`." msgstr "" +"این رفتار را می‌توان با تنظیم *text*، *encoding*، *errors* یا " +"*universal_newlines* روی ``True``، همان‌طور که در :ref:`frequently-used-" +"arguments` و :func:`run` توضیح داده شده است، تغییر داد." -msgid "To also capture standard error in the result, use ``stderr=subprocess.STDOUT``::" +msgid "" +"To also capture standard error in the result, use " +"``stderr=subprocess.STDOUT``::" msgstr "" +"برای اینکه خطای استاندارد نیز در نتیجه گرفته شود، از " +"``stderr=subprocess.STDOUT`` استفاده کنید::" msgid "" ">>> subprocess.check_output(\n" @@ -786,45 +1983,72 @@ msgid "" "... shell=True)\n" "'ls: non_existent_file: No such file or directory\\n'" msgstr "" +">>> subprocess.check_output(\n" +"... \"ls non_existent_file; exit 0\",\n" +"... stderr=subprocess.STDOUT,\n" +"... shell=True)\n" +"'ls: non_existent_file: No such file or directory\\n'" msgid "Support for the *input* keyword argument was added." -msgstr "" +msgstr "پشتیبانی از آرگومان کلیدواژه‌ای *input* افزوده شد." msgid "*encoding* and *errors* were added. See :func:`run` for details." -msgstr "" +msgstr "*encoding* و *errors* افزوده شدند. برای جزئیات، :func:`run` را ببینید." msgid "Replacing Older Functions with the :mod:`!subprocess` Module" -msgstr "" +msgstr "جایگزینی توابع قدیمی با ماژول :mod:`!subprocess`" -msgid "In this section, \"a becomes b\" means that b can be used as a replacement for a." +msgid "" +"In this section, \"a becomes b\" means that b can be used as a replacement " +"for a." msgstr "" +"در این بخش، «a به b تبدیل می‌شود» به این معناست که b می‌تواند به‌عنوان جایگزینی " +"برای a استفاده شود." -msgid "All \"a\" functions in this section fail (more or less) silently if the executed program cannot be found; the \"b\" replacements raise :exc:`OSError` instead." +msgid "" +"All \"a\" functions in this section fail (more or less) silently if the " +"executed program cannot be found; the \"b\" replacements raise :exc:`OSError` " +"instead." msgstr "" +"تمام توابع «a» در این بخش در صورتی که برنامه‌ی اجراشده یافت نشود، (کم‌وبیش) " +"به‌صورت خاموش شکست می‌خورند؛ جایگزین‌های «b» در عوض :exc:`OSError` را پرتاب " +"می‌کنند." -msgid "In addition, the replacements using :func:`check_output` will fail with a :exc:`CalledProcessError` if the requested operation produces a non-zero return code. The output is still available as the :attr:`~CalledProcessError.output` attribute of the raised exception." +msgid "" +"In addition, the replacements using :func:`check_output` will fail with " +"a :exc:`CalledProcessError` if the requested operation produces a non-zero " +"return code. The output is still available as " +"the :attr:`~CalledProcessError.output` attribute of the raised exception." msgstr "" +"علاوه بر این، جایگزین‌هایی که از :func:`check_output` استفاده می‌کنند، اگر " +"عملیات درخواستی کد بازگشت غیرصفری تولید کند، با :exc:`CalledProcessError` " +"شکست خواهند خورد. خروجی همچنان به‌عنوان " +"ویژگی :attr:`~CalledProcessError.output` استثنای پرتاب‌شده در دسترس است." -msgid "In the following examples, we assume that the relevant functions have already been imported from the :mod:`!subprocess` module." +msgid "" +"In the following examples, we assume that the relevant functions have already " +"been imported from the :mod:`!subprocess` module." msgstr "" +"در مثال‌های زیر، فرض می‌کنیم که تابع‌های مربوطه پیش‌تر از ماژول :mod:`!" +"subprocess` ایمپورت شده‌اند." msgid "Replacing :program:`/bin/sh` shell command substitution" -msgstr "" +msgstr "جایگزین کردن جایگزینی دستور پوسته :program:`/bin/sh`" msgid "output=$(mycmd myarg)" -msgstr "" +msgstr "output=$(mycmd myarg)" msgid "becomes::" -msgstr "" +msgstr "به‌صورت زیر درمی‌آید::" msgid "output = check_output([\"mycmd\", \"myarg\"])" -msgstr "" +msgstr "output = check_output([\"mycmd\", \"myarg\"])" msgid "Replacing shell pipeline" -msgstr "" +msgstr "جایگزینی خط پایپ پوسته" msgid "output=$(dmesg | grep hda)" -msgstr "" +msgstr "output=$(dmesg | grep hda)" msgid "" "p1 = Popen([\"dmesg\"], stdout=PIPE)\n" @@ -832,39 +2056,64 @@ msgid "" "p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.\n" "output = p2.communicate()[0]" msgstr "" +"p1 = Popen([\"dmesg\"], stdout=PIPE)\n" +"p2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\n" +"p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.\n" +"output = p2.communicate()[0]" -msgid "The ``p1.stdout.close()`` call after starting the p2 is important in order for p1 to receive a SIGPIPE if p2 exits before p1." +msgid "" +"The ``p1.stdout.close()`` call after starting the p2 is important in order " +"for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" +"فراخوانی ``p1.stdout.close()`` پس از شروع p2 مهم است تا در صورتی که p2 پیش از " +"p1 خارج شود، p1 یک SIGPIPE دریافت کند." -msgid "Alternatively, for trusted input, the shell's own pipeline support may still be used directly:" +msgid "" +"Alternatively, for trusted input, the shell's own pipeline support may still " +"be used directly:" msgstr "" +"به‌عنوان جایگزین، برای ورودی قابل‌اعتماد، پشتیبانی خط پایپ خود پوسته " +"همچنان می‌تواند به‌صورت مستقیم استفاده شود:" msgid "output = check_output(\"dmesg | grep hda\", shell=True)" -msgstr "" +msgstr "output = check_output(\"dmesg | grep hda\", shell=True)" msgid "Replacing :func:`os.system`" -msgstr "" +msgstr "جایگزینی :func:`os.system`" msgid "" "sts = os.system(\"mycmd\" + \" myarg\")\n" "# becomes\n" "retcode = call(\"mycmd\" + \" myarg\", shell=True)" msgstr "" +"sts = os.system(\"mycmd\" + \" myarg\")\n" +"# becomes\n" +"retcode = call(\"mycmd\" + \" myarg\", shell=True)" msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" msgid "Calling the program through the shell is usually not required." -msgstr "" +msgstr "معمولاً نیازی به فراخوانی برنامه از طریق پوسته نیست." -msgid "The :func:`call` return value is encoded differently to that of :func:`os.system`." +msgid "" +"The :func:`call` return value is encoded differently to that " +"of :func:`os.system`." msgstr "" +"مقدار بازگشتی :func:`call` به شکل متفاوتی نسبت به مقدار " +"بازگشتی :func:`os.system` کدگذاری می‌شود." -msgid "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the command is running, but the caller must do this separately when using the :mod:`!subprocess` module." +msgid "" +"The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " +"command is running, but the caller must do this separately when using " +"the :mod:`!subprocess` module." msgstr "" +"تابع :func:`os.system` در حین اجرای دستور، سیگنال‌های SIGINT و SIGQUIT را " +"نادیده می‌گیرد، اما فراخواننده باید هنگام استفاده از ماژول :mod:`!subprocess` " +"این کار را به‌طور جداگانه انجام دهد." msgid "A more realistic example would look like this::" -msgstr "" +msgstr "یک مثال واقعی‌تر به این شکل خواهد بود::" msgid "" "try:\n" @@ -876,51 +2125,71 @@ msgid "" "except OSError as e:\n" " print(\"Execution failed:\", e, file=sys.stderr)" msgstr "" +"try:\n" +" retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" +" if retcode < 0:\n" +" print(\"Child was terminated by signal\", -retcode, file=sys.stderr)\n" +" else:\n" +" print(\"Child returned\", retcode, file=sys.stderr)\n" +"except OSError as e:\n" +" print(\"Execution failed:\", e, file=sys.stderr)" msgid "Replacing the :func:`os.spawn ` family" -msgstr "" +msgstr "جایگزینی خانواده‌ی :func:`os.spawn `" msgid "P_NOWAIT example::" -msgstr "" +msgstr "مثال P_NOWAIT::" msgid "" "pid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" "pid = Popen([\"/bin/mycmd\", \"myarg\"]).pid" msgstr "" +"pid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" +"==>\n" +"pid = Popen([\"/bin/mycmd\", \"myarg\"]).pid" msgid "P_WAIT example::" -msgstr "" +msgstr "مثال P_WAIT::" msgid "" "retcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" "retcode = call([\"/bin/mycmd\", \"myarg\"])" msgstr "" +"retcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" +"==>\n" +"retcode = call([\"/bin/mycmd\", \"myarg\"])" msgid "Vector example::" -msgstr "" +msgstr "مثال بردار::" msgid "" "os.spawnvp(os.P_NOWAIT, path, args)\n" "==>\n" "Popen([path] + args[1:])" msgstr "" +"os.spawnvp(os.P_NOWAIT, path, args)\n" +"==>\n" +"Popen([path] + args[1:])" msgid "Environment example::" -msgstr "" +msgstr "مثال محیط::" msgid "" "os.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n" "==>\n" "Popen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})" msgstr "" +"os.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n" +"==>\n" +"Popen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})" msgid "Replacing :func:`os.popen`" -msgstr "" +msgstr "جایگزینی :func:`os.popen`" msgid "Return code handling translates as follows::" -msgstr "" +msgstr "مدیریت کد بازگشت به‌صورت زیر ترجمه می‌شود::" msgid "" "pipe = os.popen(cmd, 'w')\n" @@ -935,21 +2204,51 @@ msgid "" "if process.wait() != 0:\n" " print(\"There were some errors\")" msgstr "" +"pipe = os.popen(cmd, 'w')\n" +"...\n" +"rc = pipe.close()\n" +"if rc is not None and rc >> 8:\n" +" print(\"There were some errors\")\n" +"==>\n" +"process = Popen(cmd, stdin=PIPE)\n" +"...\n" +"process.stdin.close()\n" +"if process.wait() != 0:\n" +" print(\"There were some errors\")" msgid "Legacy Shell Invocation Functions" -msgstr "" +msgstr "توابع فراخوانی پوسته‌ی قدیمی" -msgid "This module also provides the following legacy functions from the 2.x ``commands`` module. These operations implicitly invoke the system shell and none of the guarantees described above regarding security and exception handling consistency are valid for these functions." +msgid "" +"This module also provides the following legacy functions from the 2.x " +"``commands`` module. These operations implicitly invoke the system shell and " +"none of the guarantees described above regarding security and exception " +"handling consistency are valid for these functions." msgstr "" +"این ماژول همچنین توابع قدیمی زیر را از ماژول ``commands`` در نسخه‌های 2.x " +"ارائه می‌دهد. این عملیات‌ها به‌طور ضمنی پوسته‌ی سیستم را فراخوانی می‌کنند و " +"هیچ‌کدام از تضمین‌های توصیف‌شده در بالا در مورد امنیت و سازگاری مدیریت استثنا " +"برای این توابع معتبر نیستند." msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." -msgstr "" +msgstr "``(exitcode, output)`` حاصل از اجرای *cmd* در یک پوسته را برمی‌گرداند." -msgid "Execute the string *cmd* in a shell with :func:`check_output` and return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to decode output; see the notes on :ref:`frequently-used-arguments` for more details." +msgid "" +"Execute the string *cmd* in a shell with :func:`check_output` and return a 2-" +"tuple ``(exitcode, output)``. *encoding* and *errors* are used to decode " +"output; see the notes on :ref:`frequently-used-arguments` for more details." msgstr "" +"رشته‌ی *cmd* را در پوسته با :func:`check_output` اجرا می‌کند و یک تاپل دوتایی " +"``(exitcode, output)`` برمی‌گرداند. *encoding* و *errors* برای کدگشایی خروجی " +"استفاده می‌شوند؛ برای جزئیات بیشتر، یادداشت‌های مربوط به :ref:`frequently-used-" +"arguments` را ببینید." -msgid "A trailing newline is stripped from the output. The exit code for the command can be interpreted as the return code of subprocess. Example::" +msgid "" +"A trailing newline is stripped from the output. The exit code for the command " +"can be interpreted as the return code of subprocess. Example::" msgstr "" +"یک خط جدید انتهایی از خروجی حذف می‌شود. کد خروجی فرمان را می‌توان به‌عنوان کد " +"بازگشتی subprocess تفسیر کرد. مثال::" msgid "" ">>> subprocess.getstatusoutput('ls /bin/ls')\n" @@ -961,89 +2260,181 @@ msgid "" ">>> subprocess.getstatusoutput('/bin/kill $$')\n" "(-15, '')" msgstr "" +">>> subprocess.getstatusoutput('ls /bin/ls')\n" +"(0, '/bin/ls')\n" +">>> subprocess.getstatusoutput('cat /bin/junk')\n" +"(1, 'cat: /bin/junk: No such file or directory')\n" +">>> subprocess.getstatusoutput('/bin/junk')\n" +"(127, 'sh: /bin/junk: not found')\n" +">>> subprocess.getstatusoutput('/bin/kill $$')\n" +"(-15, '')" msgid "Windows support was added." -msgstr "" +msgstr "پشتیبانی از ویندوز اضافه شد." -msgid "The function now returns (exitcode, output) instead of (status, output) as it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:`~Popen.returncode`." +msgid "" +"The function now returns (exitcode, output) instead of (status, output) as it " +"did in Python 3.3.3 and earlier. exitcode has the same value " +"as :attr:`~Popen.returncode`." msgstr "" +"این تابع اکنون به جای (status, output) که در پایتون 3.3.3 و نسخه‌های پیش‌تر " +"برمی‌گرداند، (exitcode, output) را برمی‌گرداند. exitcode همان " +"مقدار :attr:`~Popen.returncode` را دارد." msgid "Return output (stdout and stderr) of executing *cmd* in a shell." -msgstr "" +msgstr "خروجی (stdout و stderr) اجرای *cmd* در یک پوسته را برمی‌گرداند." -msgid "Like :func:`getstatusoutput`, except the exit code is ignored and the return value is a string containing the command's output. Example::" +msgid "" +"Like :func:`getstatusoutput`, except the exit code is ignored and the return " +"value is a string containing the command's output. Example::" msgstr "" +"مانند :func:`getstatusoutput`، با این تفاوت که کد خروجی نادیده گرفته می‌شود و " +"مقدار بازگشتی، رشته‌ای حاوی خروجی فرمان است. مثال::" msgid "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" msgstr "" +">>> subprocess.getoutput('ls /bin/ls')\n" +"'/bin/ls'" msgid "Windows support added" -msgstr "" +msgstr "پشتیبانی از ویندوز اضافه شد" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "Timeout Behavior" -msgstr "" +msgstr "رفتار مهلت" -msgid "When using the ``timeout`` parameter in functions like :func:`run`, :meth:`Popen.wait`, or :meth:`Popen.communicate`, users should be aware of the following behaviors:" +msgid "" +"When using the ``timeout`` parameter in functions " +"like :func:`run`, :meth:`Popen.wait`, or :meth:`Popen.communicate`, users " +"should be aware of the following behaviors:" msgstr "" +"هنگام استفاده از پارامتر ``timeout`` در توابعی " +"مانند :func:`run`، :meth:`Popen.wait` یا :meth:`Popen.communicate`، کاربران " +"باید از رفتارهای زیر آگاه باشند:" -msgid "**Process Creation Delay**: The initial process creation itself cannot be interrupted on many platform APIs. This means that even when specifying a timeout, you are not guaranteed to see a timeout exception until at least after however long process creation takes." +msgid "" +"**Process Creation Delay**: The initial process creation itself cannot be " +"interrupted on many platform APIs. This means that even when specifying a " +"timeout, you are not guaranteed to see a timeout exception until at least " +"after however long process creation takes." msgstr "" +"**تأخیر در ایجاد فرایند**: خودِ ایجاد اولیه فرایند در بسیاری از APIهای پلتفرم " +"نمی‌تواند قطع شود. این بدان معناست که حتی هنگام تعیین مهلت زمانی، تضمین نمی‌شود " +"که استثنای مهلت زمانی را دست‌کم تا پس از پایان ایجاد فرایند، هر چقدر هم که طول " +"بکشد، مشاهده کنید." -msgid "**Extremely Small Timeout Values**: Setting very small timeout values (such as a few milliseconds) may result in almost immediate :exc:`TimeoutExpired` exceptions because process creation and system scheduling inherently require time." +msgid "" +"**Extremely Small Timeout Values**: Setting very small timeout values (such " +"as a few milliseconds) may result in almost immediate :exc:`TimeoutExpired` " +"exceptions because process creation and system scheduling inherently require " +"time." msgstr "" +"**مقادیر بسیار کوچک مهلت زمانی**: تنظیم مقادیر بسیار کوچک مهلت زمانی (مانند " +"چند میلی‌ثانیه) ممکن است تقریباً بلافاصله منجر به " +"استثناهای :exc:`TimeoutExpired` شود، زیرا ایجاد فرآیند و زمان‌بندی سیستم ذاتاً " +"به زمان نیاز دارند." msgid "Converting an argument sequence to a string on Windows" -msgstr "" +msgstr "تبدیل دنباله‌ای از آرگومان‌ها به رشته در ویندوز" -msgid "On Windows, an *args* sequence is converted to a string that can be parsed using the following rules (which correspond to the rules used by the MS C runtime):" +msgid "" +"On Windows, an *args* sequence is converted to a string that can be parsed " +"using the following rules (which correspond to the rules used by the MS C " +"runtime):" msgstr "" +"در ویندوز، دنباله‌ی *args* به رشته‌ای تبدیل می‌شود که می‌توان آن را با استفاده از " +"قوانین زیر تجزیه کرد (که این قوانین با قوانین مورد استفاده در ران‌تایم C " +"مایکروسافت مطابقت دارند):" -msgid "Arguments are delimited by white space, which is either a space or a tab." -msgstr "" +msgid "" +"Arguments are delimited by white space, which is either a space or a tab." +msgstr "آرگومان‌ها با فضای سفید جدا می‌شوند، که یا فاصله است یا تب." -msgid "A string surrounded by double quotation marks is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument." +msgid "" +"A string surrounded by double quotation marks is interpreted as a single " +"argument, regardless of white space contained within. A quoted string can be " +"embedded in an argument." msgstr "" +"یک رشته که با علامت‌های نقل‌قول دوتایی احاطه شده باشد، به‌عنوان یک آرگومان واحد " +"تفسیر می‌شود، صرف‌نظر از فضای خالی موجود در آن. می‌توان یک رشته داخل علامت " +"نقل‌قول را در یک آرگومان جاسازی کرد." -msgid "A double quotation mark preceded by a backslash is interpreted as a literal double quotation mark." +msgid "" +"A double quotation mark preceded by a backslash is interpreted as a literal " +"double quotation mark." msgstr "" +"علامت نقل‌قول دوتایی که پیش از آن یک بک‌اسلش آمده باشد، به‌عنوان علامت نقل‌قول " +"دوتایی تحت‌اللفظی تفسیر می‌شود." -msgid "Backslashes are interpreted literally, unless they immediately precede a double quotation mark." +msgid "" +"Backslashes are interpreted literally, unless they immediately precede a " +"double quotation mark." msgstr "" +"بک‌اسلش‌ها به‌صورت تحت‌اللفظی تفسیر می‌شوند، مگر اینکه بلافاصله پیش از یک علامت " +"نقل‌قول دوتایی قرار بگیرند." -msgid "If backslashes immediately precede a double quotation mark, every pair of backslashes is interpreted as a literal backslash. If the number of backslashes is odd, the last backslash escapes the next double quotation mark as described in rule 3." +msgid "" +"If backslashes immediately precede a double quotation mark, every pair of " +"backslashes is interpreted as a literal backslash. If the number of " +"backslashes is odd, the last backslash escapes the next double quotation mark " +"as described in rule 3." msgstr "" +"اگر بک‌اسلش‌ها بلافاصله پیش از یک علامت نقل‌قول دوتایی بیایند، هر جفت از " +"بک‌اسلش‌ها به‌عنوان یک بک‌اسلش واقعی تفسیر می‌شود. اگر تعداد بک‌اسلش‌ها فرد باشد، " +"آخرین بک‌اسلش، علامت نقل‌قول دوتایی بعدی را همان‌طور که در قاعده‌ی ۳ توضیح داده " +"شده است، خنثی می‌کند." msgid ":mod:`shlex`" -msgstr "" +msgstr ":mod:`shlex`" msgid "Module which provides function to parse and escape command lines." -msgstr "" +msgstr "ماژولی که تابعی برای تجزیه و خنثی‌سازی خطوط فرمان ارائه می‌کند." msgid "Disable use of ``posix_spawn()``" -msgstr "" +msgstr "غیرفعال‌سازی استفاده از ``posix_spawn()``" -msgid "On Linux, :mod:`!subprocess` defaults to using the ``vfork()`` system call internally when it is safe to do so rather than ``fork()``. This greatly improves performance." +msgid "" +"On Linux, :mod:`!subprocess` defaults to using the ``vfork()`` system call " +"internally when it is safe to do so rather than ``fork()``. This greatly " +"improves performance." msgstr "" +"در لینوکس، :mod:`!subprocess` به‌طور پیش‌فرض هر زمان که این کار امن باشد، به‌جای " +"``fork()`` به‌صورت داخلی از فراخوانی سیستمی ``vfork()`` استفاده می‌کند. این کار " +"عملکرد را به‌طور قابل‌توجهی بهبود می‌بخشد." msgid "subprocess._USE_POSIX_SPAWN = False # See CPython issue gh-NNNNNN." -msgstr "" +msgstr "subprocess._USE_POSIX_SPAWN = False # See CPython issue gh-NNNNNN." -msgid "It is safe to set this to false on any Python version. It will have no effect on older or newer versions where unsupported. Do not assume the attribute is available to read. Despite the name, a true value does not indicate the corresponding function will be used, only that it may be." +msgid "" +"It is safe to set this to false on any Python version. It will have no effect " +"on older or newer versions where unsupported. Do not assume the attribute is " +"available to read. Despite the name, a true value does not indicate the " +"corresponding function will be used, only that it may be." msgstr "" +"تنظیم این مورد روی false در هر نسخه‌ای از پایتون بی‌خطر است. این کار در نسخه‌های " +"قدیمی‌تر یا جدیدتری که از آن پشتیبانی نمی‌شود، هیچ تأثیری نخواهد داشت. فرض " +"نکنید این ویژگی برای خواندن در دسترس است. با وجود این نام، مقدار true نشان " +"نمی‌دهد که تابع مربوطه استفاده خواهد شد، بلکه تنها نشان می‌دهد که ممکن است " +"استفاده شود." -msgid "Please file issues any time you have to use these private knobs with a way to reproduce the issue you were seeing. Link to that issue from a comment in your code." +msgid "" +"Please file issues any time you have to use these private knobs with a way to " +"reproduce the issue you were seeing. Link to that issue from a comment in " +"your code." msgstr "" +"لطفاً هر زمان که مجبور شدید از این گزینه‌های خصوصی (private knobs) استفاده " +"کنید، مسئله‌هایی (issues) را همراه با روشی برای بازتولید مشکلی که مشاهده " +"می‌کردید ثبت کنید. از یک کامنت (comment) در کد خود به آن مسئله پیوند دهید." msgid "``_USE_POSIX_SPAWN``" -msgstr "" +msgstr "``_USE_POSIX_SPAWN``" msgid "universal newlines" -msgstr "" +msgstr "سطرهای جدید همگانی" msgid "subprocess module" -msgstr "" +msgstr "ماژول subprocess" diff --git a/library/sunau.po b/library/sunau.po index c857affe3..4113e243a 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!sunau` --- Read and write Sun AU files" -msgstr "" +msgstr ":mod:`!sunau` --- خواندن و نوشتن پرونده‌های Sun AU" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه‌ی استاندارد پایتون نیست. این ماژول پس از " +"منسوخ شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `." +" تصمیم برای حذف آن در :pep:`594` گرفته شد." -msgid "The last version of Python that provided the :mod:`!sunau` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!sunau` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!sunau` را فراهم می‌کرد، `Python 3.12 " +"`_ بود." diff --git a/library/superseded.po b/library/superseded.po index 49b505707..ad2a9c6c8 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -22,13 +22,40 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Superseded Modules" -msgstr "" +msgstr "ماژول‌های جایگزین‌شده" -msgid "The modules described in this chapter have been superseded by other modules for most use cases, and are retained primarily to preserve backwards compatibility." +msgid "" +"The modules described in this chapter have been superseded by other modules " +"for most use cases, and are retained primarily to preserve backwards " +"compatibility." msgstr "" +"ماژول‌های توصیف‌شده در این فصل برای بیشتر موارد استفاده با ماژول‌های دیگر " +"جایگزین شده‌اند و عمدتاً برای حفظ سازگاری با نسخه‌های قبلی نگه‌داری می‌شوند." -msgid "Modules may appear in this chapter because they only cover a limited subset of a problem space, and a more generally applicable solution is available elsewhere in the standard library (for example, :mod:`getopt` covers the very specific task of \"mimic the C :c:func:`!getopt` API in Python\", rather than the broader command line option parsing and argument parsing capabilities offered by :mod:`optparse` and :mod:`argparse`)." +msgid "" +"Modules may appear in this chapter because they only cover a limited subset " +"of a problem space, and a more generally applicable solution is available " +"elsewhere in the standard library (for example, :mod:`getopt` covers the " +"very specific task of \"mimic the C :c:func:`!getopt` API in Python\", " +"rather than the broader command line option parsing and argument parsing " +"capabilities offered by :mod:`optparse` and :mod:`argparse`)." msgstr "" +"ممکن است ماژول‌هایی در این فصل دیده شوند، زیرا تنها زیرمجموعه‌ی محدودی از یک " +"فضای مسئله را پوشش می‌دهند و راه‌حلی با کاربرد عمومی‌تر در جای دیگری از " +"کتابخانه‌ی استاندارد در دسترس است (برای مثال، :mod:`getopt` وظیفه‌ی بسیار خاصی" +" یعنی «شبیه‌سازی API تابع :c:func:`!getopt` زبان C در پایتون» را پوشش " +"می‌دهد، نه قابلیت‌های گسترده‌تر تجزیه‌ی گزینه‌ها و آرگومان‌های خط فرمان را که" +" توسط :mod:`optparse` و :mod:`argparse` ارائه می‌شوند)." -msgid "Alternatively, modules may appear in this chapter because they are deprecated outright, and awaiting removal in a future release, or they are :term:`soft deprecated` and their use is actively discouraged in new projects. With the removal of various obsolete modules through :pep:`594`, there are currently no modules in this latter category." +msgid "" +"Alternatively, modules may appear in this chapter because they are " +"deprecated outright, and awaiting removal in a future release, or they are " +":term:`soft deprecated` and their use is actively discouraged in new " +"projects. With the removal of various obsolete modules through :pep:`594`, " +"there are currently no modules in this latter category." msgstr "" +"یا ممکن است ماژول‌ها در این فصل آمده باشند، زیرا به‌طور کامل منسوخ شده‌اند و" +" در انتظار حذف در یک نسخه آینده هستند، یا :term:`soft deprecated` هستند و " +"استفاده از آن‌ها در پروژه‌های جدید به‌شدت نهی می‌شود. با حذف ماژول‌های منسوخ" +" مختلف از طریق :pep:`594`، در حال حاضر هیچ ماژولی در این دسته دوم وجود " +"ندارد." diff --git a/library/symtable.po b/library/symtable.po index 9bd18ce4e..273e22356 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -24,127 +24,221 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!symtable` --- Access to the compiler's symbol tables" -msgstr "" +msgstr ":mod:`!symtable` --- دسترسی به جدول‌های نماد کامپایلر" msgid "**Source code:** :source:`Lib/symtable.py`" -msgstr "" +msgstr "**کد منبع:** :source:`Lib/symtable.py`" -msgid "Symbol tables are generated by the compiler from AST just before bytecode is generated. The symbol table is responsible for calculating the scope of every identifier in the code. :mod:`!symtable` provides an interface to examine these tables." +msgid "" +"Symbol tables are generated by the compiler from AST just before bytecode is" +" generated. The symbol table is responsible for calculating the scope of " +"every identifier in the code. :mod:`!symtable` provides an interface to " +"examine these tables." msgstr "" +"جدول‌های نماد توسط کامپایلر از روی AST، درست پیش از تولید بایت‌کد، تولید " +"می‌شوند. جدول نمادها وظیفه‌ی محاسبه‌ی محدوده‌ی هر شناسه در کد را دارد. " +":mod:`!symtable` رابطی برای بررسی این جدول‌ها فراهم می‌کند." msgid "Generating Symbol Tables" -msgstr "" +msgstr "تولید جدول‌های نماد" -msgid "Return the toplevel :class:`SymbolTable` for the Python source *code*. *filename* is the name of the file containing the code. *compile_type* is like the *mode* argument to :func:`compile`." +msgid "" +"Return the toplevel :class:`SymbolTable` for the Python source *code*. " +"*filename* is the name of the file containing the code. *compile_type* is " +"like the *mode* argument to :func:`compile`." msgstr "" +":class:`SymbolTable` سطح بالا را برای کد منبع پایتون *code* برمی‌گرداند. " +"*filename* نام پرونده‌ای است که حاوی کد است. *compile_type* مانند آرگومان " +"*mode* برای :func:`compile` است." msgid "Examining Symbol Tables" -msgstr "" +msgstr "بررسی جدول‌های نماد" msgid "An enumeration indicating the type of a :class:`SymbolTable` object." -msgstr "" +msgstr "شمارشی که نوع یک شیء :class:`SymbolTable` را نشان می‌دهد." msgid "Used for the symbol table of a module." -msgstr "" +msgstr "برای جدول نمادهای یک ماژول استفاده می‌شود." msgid "Used for the symbol table of a function." -msgstr "" +msgstr "برای جدول نمادهای یک تابع استفاده می‌شود." msgid "Used for the symbol table of a class." -msgstr "" +msgstr "برای جدول نمادهای یک کلاس استفاده می‌شود." -msgid "The following members refer to different flavors of :ref:`annotation scopes `." +msgid "" +"The following members refer to different flavors of :ref:`annotation scopes " +"`." msgstr "" +"اعضای زیر به انواع مختلفی از :ref:`annotation scopes ` " +"اشاره دارند." -msgid "Used for annotations if ``from __future__ import annotations`` is active." +msgid "" +"Used for annotations if ``from __future__ import annotations`` is active." msgstr "" +"اگر ``from __future__ import annotations`` فعال باشد، برای حاشیه‌نویسی‌ها " +"استفاده می‌شود." msgid "Used for the symbol table of :keyword:`type` constructions." -msgstr "" +msgstr "برای جدول نمادها در ساختارهای :keyword:`type` استفاده می‌شود." -msgid "Used for the symbol table of :ref:`generic functions ` or :ref:`generic classes `." +msgid "" +"Used for the symbol table of :ref:`generic functions ` or" +" :ref:`generic classes `." msgstr "" +"برای جدول نمادهای :ref:`توابع عام ` یا :ref:`کلاس‌های عام" +" ` استفاده می‌شود." -msgid "Used for the symbol table of the bound, the constraint tuple or the default value of a single type variable in the formal sense, i.e., a TypeVar, a TypeVarTuple or a ParamSpec object (the latter two do not support a bound or a constraint tuple)." +msgid "" +"Used for the symbol table of the bound, the constraint tuple or the default " +"value of a single type variable in the formal sense, i.e., a TypeVar, a " +"TypeVarTuple or a ParamSpec object (the latter two do not support a bound or" +" a constraint tuple)." msgstr "" +"برای جدول نمادهای کران، تاپل محدودیت یا مقدار پیش‌فرض یک متغیر نوع واحد به " +"معنای رسمی، یعنی یک شیء TypeVar، TypeVarTuple یا ParamSpec استفاده می‌شود " +"(دو مورد آخر از کران یا تاپل محدودیت پشتیبانی نمی‌کنند)." msgid "A namespace table for a block. The constructor is not public." -msgstr "" +msgstr "جدول فضای نام برای یک بلوک. سازنده عمومی نیست." -msgid "Return the type of the symbol table. Possible values are members of the :class:`SymbolTableType` enumeration." +msgid "" +"Return the type of the symbol table. Possible values are members of the " +":class:`SymbolTableType` enumeration." msgstr "" +"نوع جدول نمادها را برمی‌گرداند. مقادیر ممکن، اعضای شمارش " +":class:`SymbolTableType` هستند." -msgid "Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type parameter'`` as possible return values." +msgid "" +"Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type " +"parameter'`` as possible return values." msgstr "" +"``'annotation'``، ``'TypeVar bound'``، ``'type alias'`` و ``'type " +"parameter'`` به‌عنوان مقادیر بازگشتی ممکن اضافه شدند." msgid "Return values are members of the :class:`SymbolTableType` enumeration." -msgstr "" +msgstr "مقادیر بازگشتی، اعضای شمارش :class:`SymbolTableType` هستند." -msgid "The exact values of the returned string may change in the future, and thus, it is recommended to use :class:`SymbolTableType` members instead of hard-coded strings." +msgid "" +"The exact values of the returned string may change in the future, and thus, " +"it is recommended to use :class:`SymbolTableType` members instead of hard-" +"coded strings." msgstr "" +"مقادیر دقیق رشته‌ی برگردانده‌شده ممکن است در آینده تغییر کنند، بنابراین توصیه" +" می‌شود به جای رشته‌های سخت‌کدشده از اعضای :class:`SymbolTableType` استفاده " +"کنید." msgid "Return the table's identifier." -msgstr "" +msgstr "شناسه‌ی جدول را برمی‌گرداند." -msgid "Return the table's name. This is the name of the class if the table is for a class, the name of the function if the table is for a function, or ``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). For type parameter scopes (which are used for generic classes, functions, and type aliases), it is the name of the underlying class, function, or type alias. For type alias scopes, it is the name of the type alias. For :class:`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." -msgstr "" +msgid "" +"Return the table's name. This is the name of the class if the table is for " +"a class, the name of the function if the table is for a function, or " +"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). " +"For type parameter scopes (which are used for generic classes, functions, " +"and type aliases), it is the name of the underlying class, function, or type" +" alias. For type alias scopes, it is the name of the type alias. For " +":class:`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." +msgstr "" +"نام جدول را برمی‌گرداند. اگر جدول برای یک کلاس باشد، این نام، نام کلاس است؛ " +"اگر جدول برای یک تابع باشد، نام تابع است؛ یا اگر جدول سراسری باشد، ``'top'``" +" است (:meth:`get_type` مقدار ``'module'`` را برمی‌گرداند). برای محدوده‌های " +"پارامتر نوع (که برای کلاس‌های عام، توابع عام و نام‌های مستعار نوع عام " +"استفاده می‌شوند)، این نام، نام کلاس، تابع یا نام مستعار نوع زیربنایی است. " +"برای محدوده‌های نام مستعار نوع، این نام، نامِ نام مستعار نوع است. برای " +"محدوده‌های کران :class:`~typing.TypeVar`، این نام، نام ``TypeVar`` است." -msgid "Return the number of the first line in the block this table represents." +msgid "" +"Return the number of the first line in the block this table represents." msgstr "" +"شماره‌ی نخستین خط در بلوکی که این جدول آن را نشان می‌دهد را برمی‌گرداند." msgid "Return ``True`` if the locals in this table can be optimized." msgstr "" +"اگر متغیرهای محلی در این جدول قابل بهینه‌سازی باشند، ``True`` برمی‌گرداند." msgid "Return ``True`` if the block is a nested class or function." -msgstr "" +msgstr "اگر بلوک یک کلاس یا تابع تودرتو باشد، ``True`` را برمی‌گرداند." -msgid "Return ``True`` if the block has nested namespaces within it. These can be obtained with :meth:`get_children`." +msgid "" +"Return ``True`` if the block has nested namespaces within it. These can be " +"obtained with :meth:`get_children`." msgstr "" +"اگر بلوک دارای فضای نام های تودرتو درون خود باشد، ``True`` را برمی‌گرداند. این" +" فضای نامها را می‌توان با :meth:`get_children` به دست آورد." -msgid "Return a view object containing the names of symbols in the table. See the :ref:`documentation of view objects `." +msgid "" +"Return a view object containing the names of symbols in the table. See the " +":ref:`documentation of view objects `." msgstr "" +"یک شیء نما (view object) را برمی‌گرداند که شامل نام‌های نمادهای جدول است. " +":ref:`documentation of view objects ` را ببینید." msgid "Lookup *name* in the table and return a :class:`Symbol` instance." -msgstr "" +msgstr "جستجوی *name* در جدول و بازگرداندن یک نمونه از :class:`Symbol`." msgid "Return a list of :class:`Symbol` instances for names in the table." msgstr "" +"فهرستی از نمونه‌های :class:`Symbol` را برای نام‌های موجود در جدول " +"برمی‌گرداند." msgid "Return a list of the nested symbol tables." -msgstr "" +msgstr "فهرستی از جدول‌های نماد تودرتو را برمی‌گرداند." -msgid "A namespace for a function or method. This class inherits from :class:`SymbolTable`." +msgid "" +"A namespace for a function or method. This class inherits from " +":class:`SymbolTable`." msgstr "" +"یک فضای نام برای یک تابع یا متد. این کلاس از :class:`SymbolTable` ارث می‌برد." msgid "Return a tuple containing names of parameters to this function." -msgstr "" +msgstr "یک تاپل شامل نام‌های پارامترهای این تابع را برمی‌گرداند." msgid "Return a tuple containing names of locals in this function." -msgstr "" +msgstr "یک تاپل شامل نام‌های متغیرهای محلی این تابع برمی‌گرداند." msgid "Return a tuple containing names of globals in this function." -msgstr "" +msgstr "یک تاپلشامل نام‌های متغیرهای سراسری در این تابع برمی‌گرداند." -msgid "Return a tuple containing names of explicitly declared nonlocals in this function." +msgid "" +"Return a tuple containing names of explicitly declared nonlocals in this " +"function." msgstr "" +"یک تاپل شامل نام‌های nonlocal اعلام‌شده به‌صورت صریح در این تابع " +"برمی‌گرداند." -msgid "Return a tuple containing names of :term:`free (closure) variables ` in this function." +msgid "" +"Return a tuple containing names of :term:`free (closure) variables ` in this function." msgstr "" +"یک تاپل شامل نام‌های :term:`متغیرهای آزاد (بستار) ` در " +"این تابع بازمی‌گرداند." -msgid "A namespace of a class. This class inherits from :class:`SymbolTable`." -msgstr "" +msgid "" +"A namespace of a class. This class inherits from :class:`SymbolTable`." +msgstr "فضای نام یک کلاس. این کلاس از :class:`SymbolTable` ارث می‌برد." -msgid "Return a tuple containing the names of method-like functions declared in the class." -msgstr "" +msgid "" +"Return a tuple containing the names of method-like functions declared in the" +" class." +msgstr "یک تاپل شامل نام‌های توابع شبه‌متد تعریف‌شده در کلاس را برمی‌گرداند." -msgid "Here, the term 'method' designates *any* function defined in the class body via :keyword:`def` or :keyword:`async def`." +msgid "" +"Here, the term 'method' designates *any* function defined in the class body " +"via :keyword:`def` or :keyword:`async def`." msgstr "" +"در اینجا، اصطلاح «متد» به *هر* تابعی اشاره دارد که در بدنه کلاس با " +":keyword:`def` یا :keyword:`async def` تعریف شده باشد." -msgid "Functions defined in a deeper scope (e.g., in an inner class) are not picked up by :meth:`get_methods`." +msgid "" +"Functions defined in a deeper scope (e.g., in an inner class) are not picked" +" up by :meth:`get_methods`." msgstr "" +"توابع تعریف‌شده در محدوده‌ای عمیق‌تر (مثلاً در یک کلاس داخلی) توسط " +":meth:`get_methods` شناسایی نمی‌شوند." msgid "For example:" -msgstr "" +msgstr "برای مثال:" msgid "" ">>> import symtable\n" @@ -167,51 +261,88 @@ msgid "" ">>> class_A.get_methods()\n" "('f', 'g', 'h')" msgstr "" +">>> import symtable\n" +">>> st = symtable.symtable('''\n" +"... def outer(): pass\n" +"...\n" +"... class A:\n" +"... def f():\n" +"... def w(): pass\n" +"...\n" +"... def g(self): pass\n" +"...\n" +"... @classmethod\n" +"... async def h(cls): pass\n" +"...\n" +"... global outer\n" +"... def outer(self): pass\n" +"... ''', 'test', 'exec')\n" +">>> class_A = st.get_children()[2]\n" +">>> class_A.get_methods()\n" +"('f', 'g', 'h')" -msgid "Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still considered as a method-like function." +msgid "" +"Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still " +"considered as a method-like function." msgstr "" +"اگرچه ``A().f()`` در ران‌تایم :exc:`TypeError` را پرتاب می‌کند، ``A.f`` " +"همچنان به‌عنوان یک تابع شبیه به متد در نظر گرفته می‌شود." -msgid "An entry in a :class:`SymbolTable` corresponding to an identifier in the source. The constructor is not public." +msgid "" +"An entry in a :class:`SymbolTable` corresponding to an identifier in the " +"source. The constructor is not public." msgstr "" +"یک مدخل در :class:`SymbolTable` که با یک شناسه در کد منبع متناظر است. " +"سازنده‌ی آن عمومی نیست." msgid "Return the symbol's name." -msgstr "" +msgstr "نام نماد را برمی‌گرداند." msgid "Return ``True`` if the symbol is used in its block." -msgstr "" +msgstr "اگر نماد در بلوک خود استفاده شده باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is created from an import statement." -msgstr "" +msgstr "اگر نماد از یک دستور ایمپورت ایجاد شده باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is a parameter." -msgstr "" +msgstr "اگر نماد یک پارامتر باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is a type parameter." -msgstr "" +msgstr "اگر نماد یک پارامتر نوع باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is global." -msgstr "" +msgstr "اگر نماد سراسری باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is nonlocal." -msgstr "" +msgstr "اگر نماد غیرمحلی باشد، ``True`` را برمی‌گرداند." -msgid "Return ``True`` if the symbol is declared global with a global statement." +msgid "" +"Return ``True`` if the symbol is declared global with a global statement." msgstr "" +"اگر نماد با یک دستور global به‌عنوان سراسری اعلام شده باشد، ``True`` را " +"برمی‌گرداند." msgid "Return ``True`` if the symbol is local to its block." -msgstr "" +msgstr "اگر نماد نسبت به بلوک خود محلی باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is annotated." -msgstr "" +msgstr "اگر نماد حاشیه‌نویسی‌شده باشد، ``True`` را برمی‌گرداند." -msgid "Return ``True`` if the symbol is referenced in its block, but not assigned to." +msgid "" +"Return ``True`` if the symbol is referenced in its block, but not assigned " +"to." msgstr "" +"اگر نماد در بلوک خود ارجاع داده شده باشد، اما به آن انتساب داده نشده باشد، " +"``True`` برمی‌گرداند." -msgid "Return *True* if a class-scoped symbol is free from the perspective of a method." +msgid "" +"Return *True* if a class-scoped symbol is free from the perspective of a " +"method." msgstr "" +"اگر یک نماد با محدوده کلاس از دید یک متد آزاد باشد، *True* را برمی‌گرداند." msgid "Consider the following example::" -msgstr "" +msgstr "مثال زیر را در نظر بگیرید::" msgid "" "def f():\n" @@ -221,51 +352,93 @@ msgid "" " def method(self):\n" " return x" msgstr "" +"def f():\n" +" x = 1 # function-scoped\n" +" class C:\n" +" x = 2 # class-scoped\n" +" def method(self):\n" +" return x" -msgid "In this example, the class-scoped symbol ``x`` is considered to be free from the perspective of ``C.method``, thereby allowing the latter to return *1* at runtime and not *2*." +msgid "" +"In this example, the class-scoped symbol ``x`` is considered to be free from" +" the perspective of ``C.method``, thereby allowing the latter to return *1* " +"at runtime and not *2*." msgstr "" +"در این مثال، نماد ``x`` با محدوده‌ی کلاس، از دید ``C.method`` آزاد محسوب " +"می‌شود؛ بدین ترتیب به آن اجازه می‌دهد در ران‌تایم *1* را برگرداند و نه *2* " +"را." msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "" +"اگر در بلوک خود به نماد انتساب داده شده باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is a comprehension iteration variable." -msgstr "" +msgstr "اگر نماد یک متغیر تکرار در یک درک باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if the symbol is a cell in an inlined comprehension." msgstr "" +"اگر نماد یک سلول (cell) در یک درک درون‌خطی باشد، ``True`` را برمی‌گرداند." msgid "Return ``True`` if name binding introduces new namespace." msgstr "" +"اگر پیوند نام (name binding) یک فضای نام جدید ایجاد کند، ``True`` را " +"برمی‌گرداند." -msgid "If the name is used as the target of a function or class statement, this will be true." +msgid "" +"If the name is used as the target of a function or class statement, this " +"will be true." msgstr "" +"اگر از نام به‌عنوان هدف یک دستور تابع یا کلاس استفاده شود، این درست خواهد " +"بود." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" ">>> table = symtable.symtable(\"def some_func(): pass\", \"string\", \"exec\")\n" ">>> table.lookup(\"some_func\").is_namespace()\n" "True" msgstr "" +">>> table = symtable.symtable(\"def some_func(): pass\", \"string\", \"exec\")\n" +">>> table.lookup(\"some_func\").is_namespace()\n" +"True" -msgid "Note that a single name can be bound to multiple objects. If the result is ``True``, the name may also be bound to other objects, like an int or list, that does not introduce a new namespace." +msgid "" +"Note that a single name can be bound to multiple objects. If the result is " +"``True``, the name may also be bound to other objects, like an int or list, " +"that does not introduce a new namespace." msgstr "" +"توجه داشته باشید که یک نام واحد می‌تواند به چند شیء مقید شود. اگر نتیجه " +"``True`` باشد، آن نام ممکن است به اشیای دیگری نیز مقید شود، مانند یک عدد " +"صحیح یا فهرست، که این موضوع فضای نام جدیدی را معرفی نمی‌کند." msgid "Return a list of namespaces bound to this name." -msgstr "" +msgstr "فهرستی از فضای نام های متصل به این نام را برمی‌گرداند." -msgid "Return the namespace bound to this name. If more than one or no namespace is bound to this name, a :exc:`ValueError` is raised." +msgid "" +"Return the namespace bound to this name. If more than one or no namespace is" +" bound to this name, a :exc:`ValueError` is raised." msgstr "" +"فضای نام متصل به این نام را برمی‌گرداند. اگر بیش از یک فضای نام به این نام " +"متصل باشد یا هیچ فضای نامی به این نام متصل نباشد، یک :exc:`ValueError` پرتاب" +" می‌شود." msgid "Command-Line Usage" -msgstr "" +msgstr "استفاده از خط فرمان" -msgid "The :mod:`!symtable` module can be executed as a script from the command line." +msgid "" +"The :mod:`!symtable` module can be executed as a script from the command " +"line." msgstr "" +"ماژول :mod:`!symtable` را می‌توان به‌عنوان یک اسکریپت از خط فرمان اجرا کرد." msgid "python -m symtable [infile...]" -msgstr "" +msgstr "python -m symtable [infile...]" -msgid "Symbol tables are generated for the specified Python source files and dumped to stdout. If no input file is specified, the content is read from stdin." +msgid "" +"Symbol tables are generated for the specified Python source files and dumped" +" to stdout. If no input file is specified, the content is read from stdin." msgstr "" +"جدول‌های نماد برای فایل‌های منبع پایتون مشخص‌شده تولید می‌شوند و در stdout " +"ریخته می‌شوند. اگر هیچ فایل ورودی مشخص نشده باشد، محتوا از stdin خوانده " +"می‌شود." diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 5555feccf..428f3d6d6 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -13,64 +13,116 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2023-09-08 14:16+0000\n" +"PO-Revision-Date: 2026-08-28 11:12+0330\n" +"Last-Translator: \n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!sys.monitoring` --- Execution event monitoring" -msgstr "" +msgstr ":mod:`!sys.monitoring` --- پایش رویدادهای اجرا" -msgid ":mod:`!sys.monitoring` is a namespace within the :mod:`sys` module, not an independent module, and ``import sys.monitoring`` would fail with a :exc:`ModuleNotFoundError`. Instead, simply ``import sys`` and then use ``sys.monitoring``." +msgid "" +":mod:`!sys.monitoring` is a namespace within the :mod:`sys` module, not an " +"independent module, and ``import sys.monitoring`` would fail with " +"a :exc:`ModuleNotFoundError`. Instead, simply ``import sys`` and then use " +"``sys.monitoring``." msgstr "" +":mod:`!sys.monitoring` یک فضای نام درون ماژول :mod:`sys` است، نه یک ماژول " +"مستقل، و ``import sys.monitoring`` با یک :exc:`ModuleNotFoundError` شکست " +"خواهد خورد. در عوض، به‌سادگی ``import sys`` را انجام دهید و سپس از " +"``sys.monitoring`` استفاده کنید." -msgid "This namespace provides access to the functions and constants necessary to activate and control event monitoring." +msgid "" +"This namespace provides access to the functions and constants necessary to " +"activate and control event monitoring." msgstr "" +"این فضای نام دسترسی به توابع و ثابت‌های لازم برای فعال‌سازی و کنترل پایش " +"رویدادها را فراهم می‌کند." -msgid "As programs execute, events occur that might be of interest to tools that monitor execution. The :mod:`!sys.monitoring` namespace provides means to receive callbacks when events of interest occur." +msgid "" +"As programs execute, events occur that might be of interest to tools that " +"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"receive callbacks when events of interest occur." msgstr "" +"هنگامی که برنامه‌ها اجرا می‌شوند، رویدادهایی رخ می‌دهند که ممکن است برای " +"ابزارهایی که اجرا را پایش می‌کنند جالب توجه باشند. فضای نام :mod:`!" +"sys.monitoring` امکاناتی را برای دریافت کال‌بک‌ها هنگام رخ دادن رویدادهای " +"مورد نظر فراهم می‌کند." msgid "The monitoring API consists of three components:" -msgstr "" +msgstr "API پایش از سه کامپوننت تشکیل می‌شود:" msgid "`Tool identifiers`_" -msgstr "" +msgstr "`شناسه‌های ابزار`_" msgid "`Events`_" -msgstr "" +msgstr "`Events`_" msgid ":ref:`Callbacks `" -msgstr "" +msgstr ":ref:`کال‌بک‌ها `" msgid "Tool identifiers" -msgstr "" +msgstr "شناسه‌های ابزار" -msgid "A tool identifier is an integer and the associated name. Tool identifiers are used to discourage tools from interfering with each other and to allow multiple tools to operate at the same time. Currently tools are completely independent and cannot be used to monitor each other. This restriction may be lifted in the future." +msgid "" +"A tool identifier is an integer and the associated name. Tool identifiers " +"are used to discourage tools from interfering with each other and to allow " +"multiple tools to operate at the same time. Currently tools are completely " +"independent and cannot be used to monitor each other. This restriction may " +"be lifted in the future." msgstr "" +"شناسه ابزار یک عدد صحیح و نام مرتبط است. شناسه‌های ابزار برای جلوگیری از " +"تداخل ابزارها با یکدیگر و امکان فعالیت همزمان چندین ابزار به کار می‌روند. در " +"حال حاضر ابزارها کاملاً مستقل هستند و نمی‌توان از آن‌ها برای پایش یکدیگر " +"استفاده کرد. این محدودیت ممکن است در آینده برداشته شود." -msgid "Before registering or activating events, a tool should choose an identifier. Identifiers are integers in the range 0 to 5 inclusive." +msgid "" +"Before registering or activating events, a tool should choose an " +"identifier. Identifiers are integers in the range 0 to 5 inclusive." msgstr "" +"پیش از ثبت یا فعال‌سازی رویدادها، یک ابزار باید شناسه‌ای انتخاب کند. شناسه‌ها " +"اعداد صحیحی در بازه‌ی ۰ تا ۵ (شامل ۰ و ۵) هستند." msgid "Registering and using tools" -msgstr "" +msgstr "ثبت و استفاده از ابزارها" -msgid "Must be called before *tool_id* can be used. *tool_id* must be in the range 0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use." +msgid "" +"Must be called before *tool_id* can be used. *tool_id* must be in the range " +"0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use." msgstr "" +"باید پیش از آنکه بتوان از *tool_id* استفاده کرد، فراخوانی شود. *tool_id* " +"باید در بازه‌ی ۰ تا ۵ باشد (شامل ۰ و ۵). اگر *tool_id* در حال استفاده باشد، " +"یک :exc:`ValueError` پرتاب می‌شود." -msgid "Unregister all events and callback functions associated with *tool_id*." -msgstr "" +msgid "" +"Unregister all events and callback functions associated with *tool_id*." +msgstr "ثبت تمام رویدادها و توابع کال‌بک مرتبط با *tool_id* را لغو می‌کند." -msgid "Should be called once a tool no longer requires *tool_id*. Will call :func:`clear_tool_id` before releasing *tool_id*." +msgid "" +"Should be called once a tool no longer requires *tool_id*. Will " +"call :func:`clear_tool_id` before releasing *tool_id*." msgstr "" +"باید هنگامی فراخوانی شود که یک ابزار دیگر به *tool_id* نیازی ندارد. پیش از " +"آزادسازی *tool_id*، :func:`clear_tool_id` را فراخوانی می‌کند." -msgid "Returns the name of the tool if *tool_id* is in use, otherwise it returns ``None``. *tool_id* must be in the range 0 to 5 inclusive." +msgid "" +"Returns the name of the tool if *tool_id* is in use, otherwise it returns " +"``None``. *tool_id* must be in the range 0 to 5 inclusive." msgstr "" +"اگر *tool_id* در حال استفاده باشد، نام ابزار را برمی‌گرداند؛ در غیر این صورت " +"``None`` را برمی‌گرداند. *tool_id* باید در بازه‌ی ۰ تا ۵ (شامل هر دو) باشد." -msgid "All IDs are treated the same by the VM with regard to events, but the following IDs are pre-defined to make co-operation of tools easier::" +msgid "" +"All IDs are treated the same by the VM with regard to events, but the " +"following IDs are pre-defined to make co-operation of tools easier::" msgstr "" +"ماشین مجازی (VM) همه‌ی شناسه‌ها را از نظر رویدادها یکسان در نظر می‌گیرد، اما " +"شناسه‌های زیر از پیش تعریف‌شده‌اند تا همکاری ابزارها آسان‌تر شود::" msgid "" "sys.monitoring.DEBUGGER_ID = 0\n" @@ -78,308 +130,575 @@ msgid "" "sys.monitoring.PROFILER_ID = 2\n" "sys.monitoring.OPTIMIZER_ID = 5" msgstr "" +"sys.monitoring.DEBUGGER_ID = 0\n" +"sys.monitoring.COVERAGE_ID = 1\n" +"sys.monitoring.PROFILER_ID = 2\n" +"sys.monitoring.OPTIMIZER_ID = 5" msgid "Events" -msgstr "" +msgstr "رویدادها" msgid "The following events are supported:" -msgstr "" +msgstr "رویدادهای زیر پشتیبانی می‌شوند:" msgid "A conditional branch goes left." -msgstr "" +msgstr "یک شاخه‌ی شرطی به چپ می‌رود." -msgid "It is up to the tool to determine how to present \"left\" and \"right\" branches. There is no guarantee which branch is \"left\" and which is \"right\", except that it will be consistent for the duration of the program." +msgid "" +"It is up to the tool to determine how to present \"left\" and \"right\" " +"branches. There is no guarantee which branch is \"left\" and which is " +"\"right\", except that it will be consistent for the duration of the " +"program." msgstr "" +"تعیین نحوه‌ی نمایش شاخه‌های «چپ» و «راست» بر عهده ابزار است. تضمینی وجود ندارد " +"که کدام شاخه «چپ» و کدام «راست» باشد، به‌جز این که در طول عمر برنامه ثابت " +"خواهد بود." msgid "A conditional branch goes right." -msgstr "" +msgstr "یک شاخه شرطی به سمت راست می‌رود." msgid "A call in Python code (event occurs before the call)." -msgstr "" +msgstr "یک فراخوانی در کد پایتون (رویداد پیش از فراخوانی رخ می‌دهد)." -msgid "An exception raised from any callable, except for Python functions (event occurs after the exit)." +msgid "" +"An exception raised from any callable, except for Python functions (event " +"occurs after the exit)." msgstr "" +"استثنایی که از هر فراخوان‌پذیر (callable)، به جز توابع پایتون، پرتاب می‌شود " +"(رویداد پس از خروج رخ می‌دهد)." -msgid "Return from any callable, except for Python functions (event occurs after the return)." +msgid "" +"Return from any callable, except for Python functions (event occurs after " +"the return)." msgstr "" +"بازگشت از هر فراخوان‌پذیر، به‌جز توابع پایتون (رویداد پس از بازگشت رخ می‌دهد)." msgid "An exception is handled." -msgstr "" +msgstr "استثنایی مدیریت می‌شود." msgid "A VM instruction is about to be executed." -msgstr "" +msgstr "یک دستور ماشین مجازی در شرف اجرا شدن است." msgid "An unconditional jump in the control flow graph is made." -msgstr "" +msgstr "یک پرش غیرشرطی در گراف جریان کنترل انجام می‌شود." -msgid "An instruction is about to be executed that has a different line number from the preceding instruction." +msgid "" +"An instruction is about to be executed that has a different line number " +"from the preceding instruction." msgstr "" +"دستوری که شماره‌ی خط متفاوتی از دستور پیشین دارد، در آستانه‌ی اجرا شدن است." -msgid "Resumption of a Python function (for generator and coroutine functions), except for ``throw()`` calls." +msgid "" +"Resumption of a Python function (for generator and coroutine functions), " +"except for ``throw()`` calls." msgstr "" +"ازسرگیری یک تابع پایتون (برای توابع تولیدگر و هم‌روال)، به‌استثنای " +"فراخوانی‌های ``throw()``." -msgid "Return from a Python function (occurs immediately before the return, the callee's frame will be on the stack)." +msgid "" +"Return from a Python function (occurs immediately before the return, the " +"callee's frame will be on the stack)." msgstr "" +"بازگشت از یک تابع پایتون (درست پیش از بازگشت رخ می‌دهد؛ فریم تابع فراخوانی‌شده " +"روی پشته خواهد بود)." -msgid "Start of a Python function (occurs immediately after the call, the callee's frame will be on the stack)" +msgid "" +"Start of a Python function (occurs immediately after the call, the callee's " +"frame will be on the stack)" msgstr "" +"آغاز یک تابع پایتون (بلافاصله پس از فراخوانی رخ می‌دهد، فریم تابع فراخوانی‌شده " +"روی پشته خواهد بود)" msgid "A Python function is resumed by a ``throw()`` call." -msgstr "" +msgstr "یک تابع پایتون با فراخوانی ``throw()`` از سر گرفته می‌شود." -msgid "Exit from a Python function during exception unwinding. This includes exceptions raised directly within the function and that are allowed to continue to propagate." +msgid "" +"Exit from a Python function during exception unwinding. This includes " +"exceptions raised directly within the function and that are allowed to " +"continue to propagate." msgstr "" +"خروج از یک تابع پایتون در حین باز شدن استثنا (exception unwinding). این " +"شامل استثناهایی می‌شود که مستقیماً درون تابع پرتاب شده‌اند و اجازه داده می‌شود " +"به انتشار ادامه دهند." -msgid "Yield from a Python function (occurs immediately before the yield, the callee's frame will be on the stack)." +msgid "" +"Yield from a Python function (occurs immediately before the yield, the " +"callee's frame will be on the stack)." msgstr "" +"Yield از یک تابع پایتون (درست پیش از yield رخ می‌دهد، فریم فراخوانی‌شونده روی " +"پشته خواهد بود)." -msgid "An exception is raised, except those that cause a :monitoring-event:`STOP_ITERATION` event." +msgid "" +"An exception is raised, except those that cause a :monitoring-" +"event:`STOP_ITERATION` event." msgstr "" +"استثنایی پرتاب می‌شود، به‌جز آن‌هایی که رویداد :monitoring-" +"event:`STOP_ITERATION` را ایجاد می‌کنند." -msgid "An exception is re-raised, for example at the end of a :keyword:`finally` block." +msgid "" +"An exception is re-raised, for example at the end of a :keyword:`finally` " +"block." msgstr "" +"یک استثنا دوباره پرتاب می‌شود، برای مثال در پایان یک بلوک :keyword:`finally`." -msgid "An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION event`_." +msgid "" +"An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " +"event`_." msgstr "" +"یک :exc:`StopIteration` مصنوعی پرتاب می‌شود؛ `the STOP_ITERATION event`_ را " +"ببینید." msgid "More events may be added in the future." -msgstr "" +msgstr "ممکن است رویدادهای بیشتری در آینده افزوده شوند." -msgid "These events are attributes of the :mod:`!sys.monitoring.events` namespace. Each event is represented as a power-of-2 integer constant. To define a set of events, simply bitwise OR the individual events together. For example, to specify both :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_START` events, use the expression ``PY_RETURN | PY_START``." -msgstr "" +msgid "" +"These events are attributes of the :mod:`!sys.monitoring.events` namespace. " +"Each event is represented as a power-of-2 integer constant. To define a set " +"of events, simply bitwise OR the individual events together. For example, " +"to specify both :monitoring-event:`PY_RETURN` and :monitoring-" +"event:`PY_START` events, use the expression ``PY_RETURN | PY_START``." +msgstr "" +"این رویدادها ویژگی‌های فضای نام :mod:`!sys.monitoring.events` هستند. هر " +"رویداد به‌صورت یک ثابت عدد صحیح با مقدار توانی از ۲ نمایش داده می‌شود. برای " +"تعریف مجموعه‌ای از رویدادها، کافی است رویدادهای جداگانه را با OR بیتی با هم " +"ترکیب کنید. برای مثال، برای مشخص کردن هر دو رویداد :monitoring-" +"event:`PY_RETURN` و :monitoring-event:`PY_START`، از عبارت ``PY_RETURN | " +"PY_START`` استفاده کنید." msgid "An alias for ``0`` so users can do explicit comparisons like::" msgstr "" +"نام مستعاری برای ``0`` تا کاربران بتوانند مقایسه‌های صریحی مانند این انجام " +"دهند::" msgid "" "if get_events(DEBUGGER_ID) == NO_EVENTS:\n" " ..." msgstr "" +"if get_events(DEBUGGER_ID) == NO_EVENTS:\n" +" ..." msgid "Setting this event deactivates all events." -msgstr "" +msgstr "تنظیم این رویداد، همه رویدادها را غیرفعال می‌کند." msgid "Local events" -msgstr "" +msgstr "رویدادهای محلی" -msgid "Local events are associated with normal execution of the program and happen at clearly defined locations. All local events can be disabled. The local events are:" +msgid "" +"Local events are associated with normal execution of the program and happen " +"at clearly defined locations. All local events can be disabled. The local " +"events are:" msgstr "" +"رویدادهای محلی با اجرای عادی برنامه مرتبط هستند و در مکان‌های به‌وضوح " +"تعریف‌شده رخ می‌دهند. می‌توان تمام رویدادهای محلی را غیرفعال کرد. رویدادهای " +"محلی عبارتند از:" msgid ":monitoring-event:`PY_START`" -msgstr "" +msgstr ":monitoring-event:`PY_START`" msgid ":monitoring-event:`PY_RESUME`" -msgstr "" +msgstr ":monitoring-event:`PY_RESUME`" msgid ":monitoring-event:`PY_RETURN`" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN`" msgid ":monitoring-event:`PY_YIELD`" -msgstr "" +msgstr ":monitoring-event:`PY_YIELD`" msgid ":monitoring-event:`CALL`" -msgstr "" +msgstr ":monitoring-event:`CALL`" msgid ":monitoring-event:`LINE`" -msgstr "" +msgstr ":monitoring-event:`LINE`" msgid ":monitoring-event:`INSTRUCTION`" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`" msgid ":monitoring-event:`JUMP`" -msgstr "" +msgstr ":monitoring-event:`JUMP`" msgid ":monitoring-event:`BRANCH_LEFT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_LEFT`" msgid ":monitoring-event:`BRANCH_RIGHT`" -msgstr "" +msgstr ":monitoring-event:`BRANCH_RIGHT`" msgid ":monitoring-event:`STOP_ITERATION`" -msgstr "" +msgstr ":monitoring-event:`STOP_ITERATION`" msgid "Deprecated event" -msgstr "" +msgstr "رویداد منسوخ" msgid "``BRANCH``" -msgstr "" +msgstr "``BRANCH``" -msgid "The ``BRANCH`` event is deprecated in 3.14. Using :monitoring-event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events will give much better performance as they can be disabled independently." +msgid "" +"The ``BRANCH`` event is deprecated in 3.14. Using :monitoring-" +"event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events will give " +"much better performance as they can be disabled independently." msgstr "" +"رویداد ``BRANCH`` در 3.14 منسوخ شده است. استفاده از رویدادهای :monitoring-" +"event:`BRANCH_LEFT` و :monitoring-event:`BRANCH_RIGHT` عملکرد بسیار بهتری " +"خواهد داشت، زیرا می‌توان آن‌ها را به‌طور مستقل غیرفعال کرد." msgid "Ancillary events" -msgstr "" +msgstr "رویدادهای جانبی" -msgid "Ancillary events can be monitored like other events, but are controlled by another event:" +msgid "" +"Ancillary events can be monitored like other events, but are controlled by " +"another event:" msgstr "" +"رویدادهای کمکی را می‌توان مانند سایر رویدادها پایش کرد، اما توسط رویداد " +"دیگری کنترل می‌شوند:" msgid ":monitoring-event:`C_RAISE`" -msgstr "" +msgstr ":monitoring-event:`C_RAISE`" msgid ":monitoring-event:`C_RETURN`" -msgstr "" +msgstr ":monitoring-event:`C_RETURN`" -msgid "The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are controlled by the :monitoring-event:`CALL` event. :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events will only be seen if the corresponding :monitoring-event:`CALL` event is being monitored." +msgid "" +"The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " +"controlled by the :monitoring-event:`CALL` event. :monitoring-" +"event:`C_RETURN` and :monitoring-event:`C_RAISE` events will only be seen " +"if the corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" +"رویدادهای :monitoring-event:`C_RETURN` و :monitoring-event:`C_RAISE` توسط " +"رویداد :monitoring-event:`CALL` کنترل می‌شوند. رویدادهای :monitoring-" +"event:`C_RETURN` و :monitoring-event:`C_RAISE` تنها در صورتی مشاهده می‌شوند " +"که رویداد :monitoring-event:`CALL` متناظر پایش شود." msgid "Other events" -msgstr "" +msgstr "رویدادهای دیگر" -msgid "Other events are not necessarily tied to a specific location in the program and cannot be individually disabled via :data:`DISABLE`." +msgid "" +"Other events are not necessarily tied to a specific location in the program " +"and cannot be individually disabled via :data:`DISABLE`." msgstr "" +"سایر رویدادها لزوماً به مکان مشخصی در برنامه وابسته نیستند و نمی‌توان آن‌ها را " +"به‌صورت جداگانه از طریق :data:`DISABLE` غیرفعال کرد." msgid "The other events that can be monitored are:" -msgstr "" +msgstr "رویدادهای دیگری که می‌توان آن‌ها را پایش کرد عبارتند از:" msgid ":monitoring-event:`PY_THROW`" -msgstr "" +msgstr ":monitoring-event:`PY_THROW`" msgid ":monitoring-event:`PY_UNWIND`" -msgstr "" +msgstr ":monitoring-event:`PY_UNWIND`" msgid ":monitoring-event:`RAISE`" -msgstr "" +msgstr ":monitoring-event:`RAISE`" msgid ":monitoring-event:`EXCEPTION_HANDLED`" -msgstr "" +msgstr ":monitoring-event:`EXCEPTION_HANDLED`" msgid "The STOP_ITERATION event" -msgstr "" +msgstr "رویداد STOP_ITERATION" -msgid ":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :exc:`StopIteration` exception is raised when returning a value from a generator or coroutine. However, this is a very inefficient way to return a value, so some Python implementations, notably CPython 3.12+, do not raise an exception unless it would be visible to other code." -msgstr "" +msgid "" +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that " +"a :exc:`StopIteration` exception is raised when returning a value from a " +"generator or coroutine. However, this is a very inefficient way to return a " +"value, so some Python implementations, notably CPython 3.12+, do not raise " +"an exception unless it would be visible to other code." +msgstr "" +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` مشخص می‌کند که " +"هنگام برگرداندن یک مقدار از یک تولیدگر یا هم‌روال، " +"استثنای :exc:`StopIteration` پرتاب می‌شود. با این حال، این روش بسیار " +"ناکارآمدی برای برگرداندن یک مقدار است، بنابراین برخی از پیاده‌سازی‌های " +"پایتون، به‌ویژه CPython 3.12+، استثنایی پرتاب نمی‌کنند مگر اینکه برای کد دیگر " +"قابل مشاهده باشد." -msgid "To allow tools to monitor for real exceptions without slowing down generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided. :monitoring-event:`STOP_ITERATION` can be locally disabled, unlike :monitoring-event:`RAISE`." +msgid "" +"To allow tools to monitor for real exceptions without slowing down " +"generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " +"provided. :monitoring-event:`STOP_ITERATION` can be locally disabled, " +"unlike :monitoring-event:`RAISE`." msgstr "" +"برای اینکه ابزارها بتوانند استثناهای واقعی را بدون کُند کردن تولیدگرها و " +"هم‌روال‌ها پایش کنند، رویداد :monitoring-event:`STOP_ITERATION` فراهم شده " +"است. :monitoring-event:`STOP_ITERATION` را می‌توان به‌صورت محلی غیرفعال کرد، " +"برخلاف :monitoring-event:`RAISE`." -msgid "Note that the :monitoring-event:`STOP_ITERATION` event and the :monitoring-event:`RAISE` event for a :exc:`StopIteration` exception are equivalent, and are treated as interchangeable when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`." -msgstr "" +msgid "" +"Note that the :monitoring-event:`STOP_ITERATION` event and the :monitoring-" +"event:`RAISE` event for a :exc:`StopIteration` exception are equivalent, " +"and are treated as interchangeable when generating events. Implementations " +"will favor :monitoring-event:`STOP_ITERATION` for performance reasons, but " +"may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`." +msgstr "" +"توجه داشته باشید که رویداد :monitoring-event:`STOP_ITERATION` و " +"رویداد :monitoring-event:`RAISE` برای استثنای :exc:`StopIteration` معادل " +"هستند و هنگام تولید رویدادها، به‌عنوان قابل تعویض در نظر گرفته می‌شوند. " +"پیاده‌سازی‌ها به دلایل کارایی، :monitoring-event:`STOP_ITERATION` را ترجیح " +"می‌دهند، اما ممکن است یک رویداد :monitoring-event:`RAISE` همراه با " +"یک :exc:`StopIteration` تولید کنند." msgid "Turning events on and off" -msgstr "" +msgstr "فعال و غیرفعال کردن رویدادها" -msgid "In order to monitor an event, it must be turned on and a corresponding callback must be registered. Events can be turned on or off by setting the events either globally and/or for a particular code object. An event will trigger only once, even if it is turned on both globally and locally." +msgid "" +"In order to monitor an event, it must be turned on and a corresponding " +"callback must be registered. Events can be turned on or off by setting the " +"events either globally and/or for a particular code object. An event will " +"trigger only once, even if it is turned on both globally and locally." msgstr "" +"برای پایش یک رویداد، باید آن را روشن کرد و یک کال‌بک متناظر باید ثبت شود. " +"رویدادها را می‌توان با تنظیم آن‌ها به‌صورت سراسری و/یا برای یک شیء کد (code " +"object) خاص، روشن یا خاموش کرد. یک رویداد تنها یک‌بار فعال می‌شود، حتی اگر هم " +"به‌صورت سراسری و هم به‌صورت محلی روشن شده باشد." msgid "Setting events globally" -msgstr "" +msgstr "تنظیم رویدادها به‌صورت سراسری" -msgid "Events can be controlled globally by modifying the set of events being monitored." +msgid "" +"Events can be controlled globally by modifying the set of events being " +"monitored." msgstr "" +"رویدادها را می‌توان با تغییر مجموعه رویدادهای در حال پایش، به‌صورت سراسری " +"کنترل کرد." msgid "Returns the ``int`` representing all the active events." -msgstr "" +msgstr "یک ``int`` بازمی‌گرداند که همه رویدادهای فعال را نشان می‌دهد." -msgid "Activates all events which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not in use." +msgid "" +"Activates all events which are set in *event_set*. Raises " +"a :exc:`ValueError` if *tool_id* is not in use." msgstr "" +"تمام رویدادهایی را که در *event_set* تنظیم شده‌اند، فعال می‌کند. اگر " +"*tool_id* در حال استفاده نباشد، یک :exc:`ValueError` پرتاب می‌کند." msgid "No events are active by default." -msgstr "" +msgstr "هیچ رویدادی به‌طور پیش‌فرض فعال نیست." msgid "Per code object events" -msgstr "" +msgstr "رویدادها به‌ازای هر شیء کد" -msgid "Events can also be controlled on a per code object basis. The functions defined below which accept a :class:`types.CodeType` should be prepared to accept a look-alike object from functions which are not defined in Python (see :ref:`c-api-monitoring`)." +msgid "" +"Events can also be controlled on a per code object basis. The functions " +"defined below which accept a :class:`types.CodeType` should be prepared to " +"accept a look-alike object from functions which are not defined in Python " +"(see :ref:`c-api-monitoring`)." msgstr "" +"رویدادها را همچنین می‌توان بر اساس هر شیء کد کنترل کرد. توابع تعریف‌شده در " +"زیر که یک :class:`types.CodeType` را می‌پذیرند، باید آماده باشند تا یک شیء " +"مشابه را از توابعی که در پایتون تعریف نشده‌اند بپذیرند (به :ref:`c-api-" +"monitoring` مراجعه کنید)." -msgid "Returns all the :ref:`local events ` for *code*" +msgid "" +"Returns all the :ref:`local events ` for *code*" msgstr "" +"تمام :ref:`رویدادهای محلی ` برای *code* را " +"برمی‌گرداند" -msgid "Activates all the :ref:`local events ` for *code* which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is not in use." +msgid "" +"Activates all the :ref:`local events ` for *code* " +"which are set in *event_set*. Raises a :exc:`ValueError` if *tool_id* is " +"not in use." msgstr "" +"تمام :ref:`رویدادهای محلی ` برای *code* را که در " +"*event_set* تنظیم شده‌اند، فعال می‌کند. اگر *tool_id* در حال استفاده نباشد، " +"یک :exc:`ValueError` پرتاب می‌کند." msgid "Disabling events" -msgstr "" +msgstr "غیرفعال‌سازی رویدادها" -msgid "A special value that can be returned from a callback function to disable events for the current code location." +msgid "" +"A special value that can be returned from a callback function to disable " +"events for the current code location." msgstr "" +"مقدار خاصی که می‌توان آن را از یک تابع کال‌بک بازگرداند تا رویدادها را برای " +"موقعیت فعلی کد غیرفعال کند." -msgid ":ref:`Local events ` can be disabled for a specific code location by returning :data:`sys.monitoring.DISABLE` from a callback function. This does not change which events are set, or any other code locations for the same event." +msgid "" +":ref:`Local events ` can be disabled for a specific " +"code location by returning :data:`sys.monitoring.DISABLE` from a callback " +"function. This does not change which events are set, or any other code " +"locations for the same event." msgstr "" +":ref:`رویدادهای محلی ` را می‌توان برای یک موقعیت کد " +"مشخص با برگرداندن :data:`sys.monitoring.DISABLE` از یک تابع کال‌بک غیرفعال " +"کرد. این کار، رویدادهای تنظیم‌شده یا سایر موقعیت‌های کد برای همان رویداد را " +"تغییر نمی‌دهد." -msgid "Disabling events for specific locations is very important for high performance monitoring. For example, a program can be run under a debugger with no overhead if the debugger disables all monitoring except for a few breakpoints." +msgid "" +"Disabling events for specific locations is very important for high " +"performance monitoring. For example, a program can be run under a debugger " +"with no overhead if the debugger disables all monitoring except for a few " +"breakpoints." msgstr "" +"غیرفعال کردن رویدادها برای محل‌های مشخص، برای پایش با کارایی بالا بسیار مهم " +"است. برای مثال، اگر اشکال‌زدا همه پایش را به جز چند نقطه شکست غیرفعال کند، " +"می‌توان یک برنامه را بدون سربار تحت یک اشکال‌زدا اجرا کرد." -msgid "If :data:`DISABLE` is returned by a callback for a :ref:`global event `, :exc:`ValueError` will be raised by the interpreter in a non-specific location (that is, no traceback will be provided)." +msgid "" +"If :data:`DISABLE` is returned by a callback for a :ref:`global event " +"`, :exc:`ValueError` will be raised by the " +"interpreter in a non-specific location (that is, no traceback will be " +"provided)." msgstr "" +"اگر :data:`DISABLE` توسط یک کال‌بک برای یک :ref:`رویداد سراسری ` برگردانده شود، :exc:`ValueError` توسط مفسر در مکانی نامشخص " +"پرتاب خواهد شد (یعنی هیچ ردگیری پشته‌ای ارائه نخواهد شد)." -msgid "Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` for all tools." +msgid "" +"Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " +"for all tools." msgstr "" +"تمام رویدادهایی را که توسط :data:`sys.monitoring.DISABLE` غیرفعال‌شده بودند، " +"برای همه ابزارها فعال کنید." msgid "Registering callback functions" -msgstr "" +msgstr "ثبت توابع کال‌بک" msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" +"شیء قابل فراخوانی *func* را برای *event* با *tool_id* داده‌شده ثبت می‌کند" -msgid "If another callback was registered for the given *tool_id* and *event*, it is unregistered and returned. Otherwise :func:`register_callback` returns ``None``." +msgid "" +"If another callback was registered for the given *tool_id* and *event*, it " +"is unregistered and returned. Otherwise :func:`register_callback` returns " +"``None``." msgstr "" +"اگر کال‌بک دیگری برای *tool_id* و *event* داده‌شده ثبت شده باشد، آن کال‌بک از " +"ثبت خارج شده و بازگردانده می‌شود. در غیر این صورت :func:`register_callback` " +"مقدار ``None`` را برمی‌گرداند." -msgid "Raises an :ref:`auditing event ` ``sys.monitoring.register_callback`` with argument ``func``." +msgid "" +"Raises an :ref:`auditing event ` " +"``sys.monitoring.register_callback`` with argument ``func``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys.monitoring.register_callback`` را " +"با آرگومان ``func`` پرتاب می‌کند." -msgid "Functions can be unregistered by calling ``sys.monitoring.register_callback(tool_id, event, None)``." +msgid "" +"Functions can be unregistered by calling " +"``sys.monitoring.register_callback(tool_id, event, None)``." msgstr "" +"می‌توان توابع را با فراخوانی ``sys.monitoring.register_callback(tool_id, " +"event, None)`` از ثبت خارج کرد." msgid "Callback functions can be registered and unregistered at any time." -msgstr "" +msgstr "توابع کال‌بک را می‌توان در هر زمان ثبت و لغو ثبت کرد." -msgid "Callbacks are called only once regardless if the event is turned on both globally and locally. As such, if an event could be turned on for both global and local events by your code then the callback needs to be written to handle either trigger." +msgid "" +"Callbacks are called only once regardless if the event is turned on both " +"globally and locally. As such, if an event could be turned on for both " +"global and local events by your code then the callback needs to be written " +"to handle either trigger." msgstr "" +"کال‌بک‌ها تنها یک بار فراخوانی می‌شوند، صرف‌نظر از اینکه رویداد هم به‌صورت " +"سراسری و هم به‌صورت محلی فعال شده باشد. بنابراین، اگر ممکن است رویدادی توسط " +"کد شما برای هر دو رویداد سراسری و محلی فعال شود، کال‌بک باید به‌گونه‌ای نوشته " +"شود که هر یک از محرک‌ها را مدیریت کند." msgid "Callback function arguments" -msgstr "" +msgstr "آرگومان‌های تابع کال‌بک" -msgid "A special value that is passed to a callback function to indicate that there are no arguments to the call." +msgid "" +"A special value that is passed to a callback function to indicate that " +"there are no arguments to the call." msgstr "" +"مقدار ویژه‌ای که به یک تابع کال‌بک ارسال می‌شود تا نشان دهد که آرگومانی برای " +"فراخوانی وجود ندارد." -msgid "When an active event occurs, the registered callback function is called. Callback functions returning an object other than :data:`DISABLE` will have no effect. Different events will provide the callback function with different arguments, as follows:" +msgid "" +"When an active event occurs, the registered callback function is called. " +"Callback functions returning an object other than :data:`DISABLE` will have " +"no effect. Different events will provide the callback function with " +"different arguments, as follows:" msgstr "" +"هنگامی که یک رویداد فعال رخ می‌دهد، تابع کال‌بک ثبت‌شده فراخوانی می‌شود. توابع " +"کال‌بکی که شیئی غیر از :data:`DISABLE` برمی‌گردانند، بی‌اثر خواهند بود. " +"رویدادهای مختلف، آرگومان‌های مختلفی را در اختیار تابع کال‌بک قرار می‌دهند، به " +"شرح زیر:" msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" -msgstr "" +msgstr ":monitoring-event:`PY_START` و :monitoring-event:`PY_RESUME`::" msgid "func(code: CodeType, instruction_offset: int) -> object" -msgstr "" +msgstr "func(code: CodeType, instruction_offset: int) -> object" msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" -msgstr "" +msgstr ":monitoring-event:`PY_RETURN` و :monitoring-event:`PY_YIELD`::" -msgid "func(code: CodeType, instruction_offset: int, retval: object) -> object" +msgid "" +"func(code: CodeType, instruction_offset: int, retval: object) -> object" msgstr "" +"func(code: CodeType, instruction_offset: int, retval: object) -> object" -msgid ":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:`C_RETURN` (*arg0* can be :data:`MISSING` specifically)::" +msgid "" +":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-" +"event:`C_RETURN` (*arg0* can be :data:`MISSING` specifically)::" msgstr "" +":monitoring-event:`CALL`، :monitoring-event:`C_RAISE` و :monitoring-" +"event:`C_RETURN` (*arg0* می‌تواند به‌طور خاص :data:`MISSING` باشد)::" -msgid "func(code: CodeType, instruction_offset: int, callable: object, arg0: object) -> object" +msgid "" +"func(code: CodeType, instruction_offset: int, callable: object, arg0: " +"object) -> object" msgstr "" +"func(code: CodeType, instruction_offset: int, callable: object, arg0: " +"object) -> object" -msgid "*code* represents the code object where the call is being made, while *callable* is the object that is about to be called (and thus triggered the event). If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." +msgid "" +"*code* represents the code object where the call is being made, while " +"*callable* is the object that is about to be called (and thus triggered the " +"event). If there are no arguments, *arg0* is set " +"to :data:`sys.monitoring.MISSING`." msgstr "" +"*code* نمایانگر شیء کدی است که فراخوانی در آن انجام می‌شود، در حالی که " +"*callable* شیئی است که قرار است فراخوانی شود (و در نتیجه رویداد را فعال " +"کرده است). اگر آرگومانی وجود نداشته باشد، *arg0* برابر " +"با :data:`sys.monitoring.MISSING` تنظیم می‌شود." -msgid "For instance methods, *callable* will be the function object as found on the class with *arg0* set to the instance (i.e. the ``self`` argument to the method)." +msgid "" +"For instance methods, *callable* will be the function object as found on " +"the class with *arg0* set to the instance (i.e. the ``self`` argument to " +"the method)." msgstr "" +"برای متدهای نمونه، *callable* شیء تابعی خواهد بود که در کلاس یافت می‌شود، با " +"*arg0* تنظیم‌شده به نمونه (یعنی آرگومان ``self`` متد)." -msgid ":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" +msgid "" +":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-" +"event:`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-" +"event:`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" +":monitoring-event:`RAISE`، :monitoring-event:`RERAISE`، :monitoring-" +"event:`EXCEPTION_HANDLED`، :monitoring-event:`PY_UNWIND`، :monitoring-" +"event:`PY_THROW` و :monitoring-event:`STOP_ITERATION`::" -msgid "func(code: CodeType, instruction_offset: int, exception: BaseException) -> object" +msgid "" +"func(code: CodeType, instruction_offset: int, exception: BaseException) -> " +"object" msgstr "" +"func(code: CodeType, instruction_offset: int, exception: BaseException) -> " +"object" msgid ":monitoring-event:`LINE`::" -msgstr "" +msgstr ":monitoring-event:`LINE`::" msgid "func(code: CodeType, line_number: int) -> object" -msgstr "" +msgstr "func(code: CodeType, line_number: int) -> object" -msgid ":monitoring-event:`BRANCH_LEFT`, :monitoring-event:`BRANCH_RIGHT` and :monitoring-event:`JUMP`::" +msgid "" +":monitoring-event:`BRANCH_LEFT`, :monitoring-event:`BRANCH_RIGHT` " +"and :monitoring-event:`JUMP`::" msgstr "" +":monitoring-event:`BRANCH_LEFT`، :monitoring-event:`BRANCH_RIGHT` " +"و :monitoring-event:`JUMP`::" -msgid "func(code: CodeType, instruction_offset: int, destination_offset: int) -> object" +msgid "" +"func(code: CodeType, instruction_offset: int, destination_offset: int) -> " +"object" msgstr "" +"func(code: CodeType, instruction_offset: int, destination_offset: int) -> " +"object" -msgid "Note that the *destination_offset* is where the code will next execute." -msgstr "" +msgid "" +"Note that the *destination_offset* is where the code will next execute." +msgstr "توجه داشته باشید که *destination_offset* محل اجرای بعدی کد است." msgid ":monitoring-event:`INSTRUCTION`::" -msgstr "" +msgstr ":monitoring-event:`INSTRUCTION`::" diff --git a/library/sys.po b/library/sys.po index 97a6097d5..5c93b7b6d 100644 --- a/library/sys.po +++ b/library/sys.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:14+0000\n" +"PO-Revision-Date: 2026-08-28 11:24+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,171 +23,490 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!sys` --- System-specific parameters and functions" -msgstr "" +msgstr ":mod:`!sys` --- پارامترها و توابع مختص سیستم" -msgid "This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. Unless explicitly noted otherwise, all variables are read-only." +msgid "" +"This module provides access to some variables used or maintained by the " +"interpreter and to functions that interact strongly with the interpreter. " +"It is always available. Unless explicitly noted otherwise, all variables " +"are read-only." msgstr "" +"این ماژول دسترسی به برخی متغیرهایی که توسط مفسر استفاده یا نگهداری می‌شوند و " +"به توابعی که تعامل قوی با مفسر دارند را فراهم می‌کند. این ماژول همیشه در " +"دسترس است. مگر آن‌که به‌صراحت خلاف آن ذکر شده باشد، همه متغیرها فقط‌خواندنی " +"هستند." -msgid "On POSIX systems where Python was built with the standard ``configure`` script, this contains the ABI flags as specified by :pep:`3149`." +msgid "" +"On POSIX systems where Python was built with the standard ``configure`` " +"script, this contains the ABI flags as specified by :pep:`3149`." msgstr "" +"در سیستم‌های POSIX که پایتون با اسکریپت استاندارد ``configure`` ساخته شده " +"است، این شامل پرچم‌های ABI می‌شود، همان‌طور که در :pep:`3149` مشخص شده است." -msgid "Default flags became an empty string (``m`` flag for pymalloc has been removed)." +msgid "" +"Default flags became an empty string (``m`` flag for pymalloc has been " +"removed)." msgstr "" +"پرچم‌های پیش‌فرض به یک رشته خالی تبدیل شدند (پرچم ``m`` برای pymalloc حذف شده " +"است)." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "Append the callable *hook* to the list of active auditing hooks for the current (sub)interpreter." +msgid "" +"Append the callable *hook* to the list of active auditing hooks for the " +"current (sub)interpreter." msgstr "" +"*hook* قابل فراخوانی را به فهرست قلاب‌های حسابرسی فعال برای (زیر)مفسر جاری " +"می‌افزاید." -msgid "When an auditing event is raised through the :func:`sys.audit` function, each hook will be called in the order it was added with the event name and the tuple of arguments. Native hooks added by :c:func:`PySys_AddAuditHook` are called first, followed by hooks added in the current (sub)interpreter. Hooks can then log the event, raise an exception to abort the operation, or terminate the process entirely." -msgstr "" +msgid "" +"When an auditing event is raised through the :func:`sys.audit` function, " +"each hook will be called in the order it was added with the event name and " +"the tuple of arguments. Native hooks added by :c:func:`PySys_AddAuditHook` " +"are called first, followed by hooks added in the current (sub)interpreter. " +"Hooks can then log the event, raise an exception to abort the operation, or " +"terminate the process entirely." +msgstr "" +"هنگامی که یک رویداد حسابرسی از طریق تابع :func:`sys.audit` پرتاب می‌شود، هر " +"قلاب به ترتیبی که اضافه‌شده است، با نام رویداد و تاپل آرگومان‌ها فراخوانی " +"می‌شود. قلاب‌های بومی اضافه‌شده توسط :c:func:`PySys_AddAuditHook` ابتدا " +"فراخوانی می‌شوند و پس از آن‌ها، قلاب‌های اضافه‌شده در (زیر)مفسر جاری فراخوانی " +"می‌شوند. سپس قلاب‌ها می‌توانند رویداد را ثبت کنند، استثنایی را برای لغو عملیات " +"پرتاب کنند، یا فرایند را به‌طور کامل خاتمه دهند." -msgid "Note that audit hooks are primarily for collecting information about internal or otherwise unobservable actions, whether by Python or libraries written in Python. They are not suitable for implementing a \"sandbox\". In particular, malicious code can trivially disable or bypass hooks added using this function. At a minimum, any security-sensitive hooks must be added using the C API :c:func:`PySys_AddAuditHook` before initialising the runtime, and any modules allowing arbitrary memory modification (such as :mod:`ctypes`) should be completely removed or closely monitored." -msgstr "" +msgid "" +"Note that audit hooks are primarily for collecting information about " +"internal or otherwise unobservable actions, whether by Python or libraries " +"written in Python. They are not suitable for implementing a \"sandbox\". In " +"particular, malicious code can trivially disable or bypass hooks added " +"using this function. At a minimum, any security-sensitive hooks must be " +"added using the C API :c:func:`PySys_AddAuditHook` before initialising the " +"runtime, and any modules allowing arbitrary memory modification (such " +"as :mod:`ctypes`) should be completely removed or closely monitored." +msgstr "" +"توجه داشته باشید که قلاب‌های حسابرسی (audit hooks) عمدتاً برای جمع‌آوری اطلاعات " +"درباره اعمال داخلی یا اعمالی که به‌طریق دیگر قابل مشاهده نیستند، چه از سوی " +"پایتون و چه از سوی کتابخانه‌های نوشته‌شده با پایتون، به کار می‌روند. آن‌ها برای " +"پیاده‌سازی یک «سندباکس» مناسب نیستند. به‌ویژه، کد مخرب می‌تواند " +"به‌سادگی قلاب‌های اضافه‌شده با این تابع را غیرفعال یا دور بزند. دست‌کم، هر قلاب " +"حساس از نظر امنیتی باید پیش از مقداردهی اولیه ران‌تایم با استفاده از C API " +"یعنی :c:func:`PySys_AddAuditHook` اضافه شود، و هر ماژولی که امکان تغییر " +"دلخواه حافظه را فراهم می‌کند (مانند :mod:`ctypes`) باید به‌طور کامل حذف شود " +"یا به‌دقت پایش شود." -msgid "Calling :func:`sys.addaudithook` will itself raise an auditing event named ``sys.addaudithook`` with no arguments. If any existing hooks raise an exception derived from :class:`RuntimeError`, the new hook will not be added and the exception suppressed. As a result, callers cannot assume that their hook has been added unless they control all existing hooks." -msgstr "" +msgid "" +"Calling :func:`sys.addaudithook` will itself raise an auditing event named " +"``sys.addaudithook`` with no arguments. If any existing hooks raise an " +"exception derived from :class:`RuntimeError`, the new hook will not be " +"added and the exception suppressed. As a result, callers cannot assume that " +"their hook has been added unless they control all existing hooks." +msgstr "" +"فراخوانی :func:`sys.addaudithook` به‌خودی‌خود یک رویداد حسابرسی به نام " +"``sys.addaudithook`` را بدون آرگومان پرتاب می‌کند. اگر هر یک از قلاب‌های " +"موجود استثنایی مشتق‌شده از :class:`RuntimeError` را پرتاب کنند، قلاب جدید " +"اضافه نخواهد شد و استثنا مهار خواهد شد. در نتیجه، فراخوانندگان نمی‌توانند " +"فرض کنند که قلاب آن‌ها اضافه شده است، مگر اینکه همه قلاب‌های موجود را کنترل " +"کنند." -msgid "See the :ref:`audit events table ` for all events raised by CPython, and :pep:`578` for the original design discussion." +msgid "" +"See the :ref:`audit events table ` for all events raised by " +"CPython, and :pep:`578` for the original design discussion." msgstr "" +"برای همه‌ی رویدادهای پرتاب‌شده از سوی CPython، :ref:`جدول رویدادهای حسابرسی " +"` و برای بحث طراحی اصلی، :pep:`578` را ببینید." -msgid "Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are no longer suppressed." +msgid "" +"Exceptions derived from :class:`Exception` but not :class:`RuntimeError` " +"are no longer suppressed." msgstr "" +"استثناهایی که از :class:`Exception` مشتق شده‌اند، اما " +"از :class:`RuntimeError` مشتق نشده‌اند، دیگر سرکوب نمی‌شوند." -msgid "When tracing is enabled (see :func:`settrace`), Python hooks are only traced if the callable has a ``__cantrace__`` member that is set to a true value. Otherwise, trace functions will skip the hook." +msgid "" +"When tracing is enabled (see :func:`settrace`), Python hooks are only " +"traced if the callable has a ``__cantrace__`` member that is set to a true " +"value. Otherwise, trace functions will skip the hook." msgstr "" +"هنگامی که ردگیری فعال شده باشد (به :func:`settrace` مراجعه کنید)، هوک‌های " +"پایتون (Python hooks) تنها در صورتی ردگیری می‌شوند که شیء فراخوان‌پذیر دارای " +"یک عضو ``__cantrace__`` باشد که روی یک مقدار درست تنظیم شده باشد. در غیر " +"این صورت، توابع ردگیری از هوک می‌گذرند." -msgid "The list of command line arguments passed to a Python script. ``argv[0]`` is the script name (it is operating system dependent whether this is a full pathname or not). If the command was executed using the :option:`-c` command line option to the interpreter, ``argv[0]`` is set to the string ``'-c'``. If no script name was passed to the Python interpreter, ``argv[0]`` is the empty string." -msgstr "" +msgid "" +"The list of command line arguments passed to a Python script. ``argv[0]`` " +"is the script name (it is operating system dependent whether this is a full " +"pathname or not). If the command was executed using the :option:`-c` " +"command line option to the interpreter, ``argv[0]`` is set to the string " +"``'-c'``. If no script name was passed to the Python interpreter, " +"``argv[0]`` is the empty string." +msgstr "" +"فهرست آرگومان‌های خط فرمانی که به یک اسکریپت پایتون داده شده‌اند. ``argv[0]`` " +"نام اسکریپت است (این‌که این مقدار مسیر کامل باشد یا نه، به سیستم‌عامل وابسته " +"است). اگر فرمان با استفاده از گزینه‌ی خط فرمان :option:`-c` برای مفسر اجرا " +"شده باشد، ``argv[0]`` به رشته‌ی ``'-c'`` تنظیم می‌شود. اگر هیچ نام اسکریپتی به " +"مفسر پایتون داده نشده باشد، ``argv[0]`` رشته‌ی خالی است." -msgid "To loop over the standard input, or the list of files given on the command line, see the :mod:`fileinput` module." +msgid "" +"To loop over the standard input, or the list of files given on the command " +"line, see the :mod:`fileinput` module." msgstr "" +"برای حلقه زدن روی ورودی استاندارد، یا فهرست فایل‌های داده‌شده در خط فرمان، " +"ماژول :mod:`fileinput` را ببینید." msgid "See also :data:`sys.orig_argv`." -msgstr "" +msgstr "همچنین :data:`sys.orig_argv` را ببینید." -msgid "On Unix, command line arguments are passed by bytes from OS. Python decodes them with filesystem encoding and \"surrogateescape\" error handler. When you need original bytes, you can get it by ``[os.fsencode(arg) for arg in sys.argv]``." +msgid "" +"On Unix, command line arguments are passed by bytes from OS. Python " +"decodes them with filesystem encoding and \"surrogateescape\" error " +"handler. When you need original bytes, you can get it by " +"``[os.fsencode(arg) for arg in sys.argv]``." msgstr "" +"در یونیکس، آرگومان‌های خط فرمان به‌صورت بایت از سوی سیستم‌عامل منتقل می‌شوند. " +"پایتون آن‌ها را با کدگذاری سیستم‌فایل و مدیر خطای \"surrogateescape\" کدگشایی " +"می‌کند. وقتی به بایت‌های اصلی نیاز دارید، می‌توانید آن‌ها را با " +"``[os.fsencode(arg) for arg in sys.argv]`` دریافت کنید." -msgid "Raise an auditing event and trigger any active auditing hooks. *event* is a string identifying the event, and *args* may contain optional arguments with more information about the event. The number and types of arguments for a given event are considered a public and stable API and should not be modified between releases." -msgstr "" +msgid "" +"Raise an auditing event and trigger any active auditing hooks. *event* is a " +"string identifying the event, and *args* may contain optional arguments " +"with more information about the event. The number and types of arguments " +"for a given event are considered a public and stable API and should not be " +"modified between releases." +msgstr "" +"یک رویداد حسابرسی را پرتاب می‌کند و هر یک از قلاب‌های حسابرسی فعال را به کار " +"می‌اندازد. *event* یک رشته است که رویداد را مشخص می‌کند، و *args* ممکن است " +"شامل آرگومان‌های اختیاری با اطلاعات بیشتر درباره رویداد باشد. تعداد و انواع " +"آرگومان‌های یک رویداد معین، یک API عمومی و پایدار محسوب می‌شود و نباید بین " +"انتشارها تغییر کند." -msgid "For example, one auditing event is named ``os.chdir``. This event has one argument called *path* that will contain the requested new working directory." +msgid "" +"For example, one auditing event is named ``os.chdir``. This event has one " +"argument called *path* that will contain the requested new working " +"directory." msgstr "" +"برای مثال، یک رویداد حسابرسی ``os.chdir`` نام دارد. این رویداد یک آرگومان " +"به نام *path* دارد که شامل پوشه کاری جدید درخواست‌شده خواهد بود." -msgid ":func:`sys.audit` will call the existing auditing hooks, passing the event name and arguments, and will re-raise the first exception from any hook. In general, if an exception is raised, it should not be handled and the process should be terminated as quickly as possible. This allows hook implementations to decide how to respond to particular events: they can merely log the event or abort the operation by raising an exception." -msgstr "" +msgid "" +":func:`sys.audit` will call the existing auditing hooks, passing the event " +"name and arguments, and will re-raise the first exception from any hook. In " +"general, if an exception is raised, it should not be handled and the " +"process should be terminated as quickly as possible. This allows hook " +"implementations to decide how to respond to particular events: they can " +"merely log the event or abort the operation by raising an exception." +msgstr "" +":func:`sys.audit` هوک‌های حسابرسی موجود را فراخوانی می‌کند، نام رویداد و " +"آرگومان‌ها را به آن‌ها منتقل می‌کند و نخستین استثنای پرتاب‌شده از سوی هر یک از " +"هوک‌ها را دوباره پرتاب می‌کند. به‌طور کلی، اگر استثنایی پرتاب شد، نباید آن را " +"مدیریت کرد و فرایند باید تا حد ممکن به‌سرعت خاتمه یابد. این امکان را به " +"پیاده‌سازی‌های هوک می‌دهد تا تصمیم بگیرند چگونه به رویدادهای خاص پاسخ دهند: " +"آن‌ها می‌توانند صرفاً رویداد را ثبت کنند یا عملیات را با پرتاب یک استثنا متوقف " +"کنند." -msgid "Hooks are added using the :func:`sys.addaudithook` or :c:func:`PySys_AddAuditHook` functions." +msgid "" +"Hooks are added using the :func:`sys.addaudithook` " +"or :c:func:`PySys_AddAuditHook` functions." msgstr "" +"قلاب‌ها (hooks) با استفاده از توابع :func:`sys.addaudithook` " +"یا :c:func:`PySys_AddAuditHook` افزوده می‌شوند." -msgid "The native equivalent of this function is :c:func:`PySys_Audit`. Using the native function is preferred when possible." +msgid "" +"The native equivalent of this function is :c:func:`PySys_Audit`. Using the " +"native function is preferred when possible." msgstr "" +"معادل بومی این تابع :c:func:`PySys_Audit` است. در صورت امکان، استفاده از " +"تابع بومی ترجیح دارد." -msgid "See the :ref:`audit events table ` for all events raised by CPython." +msgid "" +"See the :ref:`audit events table ` for all events raised by " +"CPython." msgstr "" +"برای مشاهده همه رویدادهای پرتاب‌شده توسط CPython، به :ref:`جدول رویدادهای " +"حسابرسی ` مراجعه کنید." -msgid "Equivalent to :data:`exec_prefix`, but referring to the base Python installation." -msgstr "" +msgid "" +"Equivalent to :data:`exec_prefix`, but referring to the base Python " +"installation." +msgstr "معادل :data:`exec_prefix` است، اما به نصب پایه‌ی پایتون اشاره دارد." -msgid "When running under :ref:`sys-path-init-virtual-environments`, :data:`exec_prefix` gets overwritten to the virtual environment prefix. :data:`base_exec_prefix`, conversely, does not change, and always points to the base Python installation. Refer to :ref:`sys-path-init-virtual-environments` for more information." -msgstr "" +msgid "" +"When running under :ref:`sys-path-init-virtual-" +"environments`, :data:`exec_prefix` gets overwritten to the virtual " +"environment prefix. :data:`base_exec_prefix`, conversely, does not change, " +"and always points to the base Python installation. Refer to :ref:`sys-path-" +"init-virtual-environments` for more information." +msgstr "" +"هنگام اجرا تحت :ref:`sys-path-init-virtual-environments`، " +"مقدار :data:`exec_prefix` به پیشوند محیط مجازی بازنویسی می‌شود. در " +"مقابل، :data:`base_exec_prefix` تغییر نمی‌کند و همیشه به نصب پایه پایتون " +"اشاره دارد. برای اطلاعات بیشتر به :ref:`sys-path-init-virtual-environments` " +"مراجعه کنید." -msgid "Equivalent to :data:`prefix`, but referring to the base Python installation." -msgstr "" +msgid "" +"Equivalent to :data:`prefix`, but referring to the base Python installation." +msgstr "معادل :data:`prefix` است، اما به نصب پایه‌ی پایتون اشاره می‌کند." -msgid "When running under :ref:`virtual environment `, :data:`prefix` gets overwritten to the virtual environment prefix. :data:`base_prefix`, conversely, does not change, and always points to the base Python installation. Refer to :ref:`sys-path-init-virtual-environments` for more information." +msgid "" +"When running under :ref:`virtual environment `, :data:`prefix` " +"gets overwritten to the virtual environment prefix. :data:`base_prefix`, " +"conversely, does not change, and always points to the base Python " +"installation. Refer to :ref:`sys-path-init-virtual-environments` for more " +"information." msgstr "" +"هنگام اجرا در :ref:`محیط مجازی `، :data:`prefix` با پیشوند محیط " +"مجازی بازنویسی می‌شود. در مقابل، :data:`base_prefix` تغییر نمی‌کند و همیشه به " +"نصب پایه‌ی پایتون اشاره می‌کند. برای اطلاعات بیشتر به :ref:`sys-path-init-" +"virtual-environments` مراجعه کنید." -msgid "An indicator of the native byte order. This will have the value ``'big'`` on big-endian (most-significant byte first) platforms, and ``'little'`` on little-endian (least-significant byte first) platforms." +msgid "" +"An indicator of the native byte order. This will have the value ``'big'`` " +"on big-endian (most-significant byte first) platforms, and ``'little'`` on " +"little-endian (least-significant byte first) platforms." msgstr "" +"نشانگری از ترتیب بایت بومی. این نشانگر در سکوهای بزرگ‌اندیان (big-endian، " +"بایت با بیشترین اهمیت در ابتدا) دارای مقدار ``'big'`` و در سکوهای " +"کوچک‌اندیان (little-endian، بایت با کمترین اهمیت در ابتدا) دارای مقدار " +"``'little'`` خواهد بود." -msgid "A tuple of strings containing the names of all modules that are compiled into this Python interpreter. (This information is not available in any other way --- ``modules.keys()`` only lists the imported modules.)" +msgid "" +"A tuple of strings containing the names of all modules that are compiled " +"into this Python interpreter. (This information is not available in any " +"other way --- ``modules.keys()`` only lists the imported modules.)" msgstr "" +"تاپلی از رشته‌ها که شامل نام تمام ماژول‌های کامپایل‌شده در این مفسر پایتون " +"است. (این اطلاعات به هیچ روش دیگری در دسترس نیست --- ``modules.keys()`` فقط " +"ماژول‌های ایمپورت‌شده را فهرست می‌کند.)" msgid "See also the :data:`sys.stdlib_module_names` list." -msgstr "" +msgstr "همچنین فهرست :data:`sys.stdlib_module_names` را ببینید." -msgid "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, and restored afterwards. This is intended to be called from a debugger from a checkpoint, to recursively debug or profile some other code." +msgid "" +"Call ``func(*args)``, while tracing is enabled. The tracing state is " +"saved, and restored afterwards. This is intended to be called from a " +"debugger from a checkpoint, to recursively debug or profile some other code." msgstr "" +"``func(*args)`` را، در حالی که ردگیری فعال است، فراخوانی می‌کند. وضعیت " +"ردگیری ذخیره می‌شود و پس از آن بازیابی می‌شود. این برای فراخوانی از یک " +"اشکال‌زدا (debugger) از یک نقطه بازرسی (checkpoint) در نظر گرفته شده است، تا " +"بتوان کد دیگری را به‌صورت بازگشتی اشکال‌زدایی یا پروفایل (profile) کرد." -msgid "Tracing is suspended while calling a tracing function set by :func:`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!call_tracing` enables explicit recursion of the tracing function." +msgid "" +"Tracing is suspended while calling a tracing function set " +"by :func:`settrace` or :func:`setprofile` to avoid infinite " +"recursion. :func:`!call_tracing` enables explicit recursion of the tracing " +"function." msgstr "" +"ردگیری هنگام فراخوانی تابع ردگیری تنظیم‌شده توسط :func:`settrace` " +"یا :func:`setprofile`، معلق می‌شود تا از بازگشت بی‌نهایت جلوگیری شود. :func:`!" +"call_tracing` بازگشت صریح تابع ردگیری را فعال می‌کند." -msgid "A string containing the copyright pertaining to the Python interpreter." -msgstr "" +msgid "" +"A string containing the copyright pertaining to the Python interpreter." +msgstr "رشته‌ای شامل حق نشر مربوط به مفسر پایتون." -msgid "Clear the internal type cache. The type cache is used to speed up attribute and method lookups. Use the function *only* to drop unnecessary references during reference leak debugging." +msgid "" +"Clear the internal type cache. The type cache is used to speed up attribute " +"and method lookups. Use the function *only* to drop unnecessary references " +"during reference leak debugging." msgstr "" +"نهانگاه نوع داخلی را پاک کنید. نهانگاه نوع برای تسریع جست‌وجوی ویژگی‌ها و " +"متدها استفاده می‌شود. از این تابع *فقط* برای حذف ارجاع‌های غیرضروری در حین " +"اشکال‌زدایی نشت ارجاع استفاده کنید." -msgid "This function should be used for internal and specialized purposes only." -msgstr "" +msgid "" +"This function should be used for internal and specialized purposes only." +msgstr "این تابع باید تنها برای اهداف داخلی و تخصصی استفاده شود." msgid "Use the more general :func:`_clear_internal_caches` function instead." -msgstr "" +msgstr "به‌جای آن از تابع عمومی‌تر :func:`_clear_internal_caches` استفاده کنید." -msgid "Clear all internal performance-related caches. Use this function *only* to release unnecessary references and memory blocks when hunting for leaks." +msgid "" +"Clear all internal performance-related caches. Use this function *only* to " +"release unnecessary references and memory blocks when hunting for leaks." msgstr "" +"تمام نهانگاه‌های داخلی مرتبط با کارایی را پاک‌سازی کنید. از این تابع *فقط* " +"برای آزادسازی ارجاع‌ها و بلوک‌های حافظه غیرضروری هنگام جست‌وجو برای نشت‌ها " +"استفاده کنید." -msgid "Return a dictionary mapping each thread's identifier to the topmost stack frame currently active in that thread at the time the function is called. Note that functions in the :mod:`traceback` module can build the call stack given such a frame." +msgid "" +"Return a dictionary mapping each thread's identifier to the topmost stack " +"frame currently active in that thread at the time the function is called. " +"Note that functions in the :mod:`traceback` module can build the call stack " +"given such a frame." msgstr "" +"دیکشنری‌ای برمی‌گرداند که شناسه‌ی هر نخ را به بالاترین فریم پشته‌ی فعال در آن نخ " +"در زمان فراخوانی تابع نگاشت می‌کند. توجه داشته باشید که توابع موجود در " +"ماژول :mod:`traceback` می‌توانند با داشتن چنین فریمی، پشته فراخوانی را بسازند." -msgid "This is most useful for debugging deadlock: this function does not require the deadlocked threads' cooperation, and such threads' call stacks are frozen for as long as they remain deadlocked. The frame returned for a non-deadlocked thread may bear no relationship to that thread's current activity by the time calling code examines the frame." -msgstr "" +msgid "" +"This is most useful for debugging deadlock: this function does not require " +"the deadlocked threads' cooperation, and such threads' call stacks are " +"frozen for as long as they remain deadlocked. The frame returned for a non-" +"deadlocked thread may bear no relationship to that thread's current " +"activity by the time calling code examines the frame." +msgstr "" +"این برای اشکال‌زدایی بن‌بست بسیار مفید است: این تابع به همکاری نخ‌های دچار " +"بن‌بست نیازی ندارد، و پشته‌های فراخوانی چنین نخ‌هایی تا زمانی که در بن‌بست باقی " +"بمانند، ثابت می‌مانند. فریم برگردانده‌شده برای نخی که در بن‌بست نیست ممکن است " +"هنگامی که کد فراخوانی‌کننده فریم را بررسی می‌کند، هیچ ارتباطی با فعالیت کنونی " +"آن نخ نداشته باشد." -msgid "Raises an :ref:`auditing event ` ``sys._current_frames`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``sys._current_frames`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys._current_frames`` را بدون آرگومان " +"پرتاب می‌کند." -msgid "Return a dictionary mapping each thread's identifier to the topmost exception currently active in that thread at the time the function is called. If a thread is not currently handling an exception, it is not included in the result dictionary." +msgid "" +"Return a dictionary mapping each thread's identifier to the topmost " +"exception currently active in that thread at the time the function is " +"called. If a thread is not currently handling an exception, it is not " +"included in the result dictionary." msgstr "" +"یک دیکشنری برمی‌گرداند که شناسه‌ی هر نخ را به بالاترین استثنای فعال در آن نخ " +"در زمان فراخوانی تابع نگاشت می‌کند. اگر نخی در حال حاضر در حال مدیریت یک " +"استثنا نباشد، در دیکشنری نتیجه گنجانده نمی‌شود." msgid "This is most useful for statistical profiling." -msgstr "" +msgstr "این بیشترین کاربرد را در پروفایل‌گیری آماری دارد." -msgid "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " +"no arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys._current_exceptions`` را بدون " +"آرگومان پرتاب می‌کند." -msgid "Each value in the dictionary is now a single exception instance, rather than a 3-tuple as returned from ``sys.exc_info()``." +msgid "" +"Each value in the dictionary is now a single exception instance, rather " +"than a 3-tuple as returned from ``sys.exc_info()``." msgstr "" +"هر مقدار در دیکشنری اکنون یک نمونه استثنای واحد است، نه یک ۳-تایی (3-tuple) " +"مانند آنچه از ``sys.exc_info()`` برگردانده می‌شود." -msgid "This hook function is called by built-in :func:`breakpoint`. By default, it drops you into the :mod:`pdb` debugger, but it can be set to any other function so that you can choose which debugger gets used." +msgid "" +"This hook function is called by built-in :func:`breakpoint`. By default, " +"it drops you into the :mod:`pdb` debugger, but it can be set to any other " +"function so that you can choose which debugger gets used." msgstr "" +"این تابع قلابتوسط :func:`breakpoint` توکار فراخوانی می‌شود. به‌طور " +"پیش‌فرض، شما را در اشکال‌زدا :mod:`pdb` قرار می‌دهد، اما می‌توان آن را روی هر " +"تابع دیگری تنظیم کرد تا بتوانید انتخاب کنید کدام اشکال‌زدا استفاده می‌شود." -msgid "The signature of this function is dependent on what it calls. For example, the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you might bind it to a function that expects additional arguments (positional and/or keyword). The built-in ``breakpoint()`` function passes its ``*args`` and ``**kws`` straight through. Whatever ``breakpointhooks()`` returns is returned from ``breakpoint()``." -msgstr "" +msgid "" +"The signature of this function is dependent on what it calls. For example, " +"the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but " +"you might bind it to a function that expects additional arguments " +"(positional and/or keyword). The built-in ``breakpoint()`` function passes " +"its ``*args`` and ``**kws`` straight through. Whatever " +"``breakpointhooks()`` returns is returned from ``breakpoint()``." +msgstr "" +"امضای این تابع به آنچه فراخوانی می‌کند وابسته است. برای مثال، اتصال پیش‌فرض " +"(مثلاً ``pdb.set_trace()``) هیچ آرگومانی نمی‌پذیرد، اما ممکن است آن را به " +"تابعی مقید کنید که آرگومان‌های اضافی (جایگاهی و/یا کلیدواژه‌ای) می‌پذیرد. تابع " +"توکار ``breakpoint()``، ``*args`` و ``**kws`` خود را مستقیماً منتقل می‌کند. " +"هر چه ``breakpointhooks()`` برگرداند، از ``breakpoint()`` برگردانده می‌شود." -msgid "The default implementation first consults the environment variable :envvar:`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns immediately; i.e. it is a no-op. If the environment variable is not set, or is set to the empty string, ``pdb.set_trace()`` is called. Otherwise this variable should name a function to run, using Python's dotted-import nomenclature, e.g. ``package.subpackage.module.function``. In this case, ``package.subpackage.module`` would be imported and the resulting module must have a callable named ``function()``. This is run, passing in ``*args`` and ``**kws``, and whatever ``function()`` returns, ``sys.breakpointhook()`` returns to the built-in :func:`breakpoint` function." -msgstr "" +msgid "" +"The default implementation first consults the environment " +"variable :envvar:`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this " +"function returns immediately; i.e. it is a no-op. If the environment " +"variable is not set, or is set to the empty string, ``pdb.set_trace()`` is " +"called. Otherwise this variable should name a function to run, using " +"Python's dotted-import nomenclature, e.g. " +"``package.subpackage.module.function``. In this case, " +"``package.subpackage.module`` would be imported and the resulting module " +"must have a callable named ``function()``. This is run, passing in " +"``*args`` and ``**kws``, and whatever ``function()`` returns, " +"``sys.breakpointhook()`` returns to the built-in :func:`breakpoint` " +"function." +msgstr "" +"پیاده‌سازی پیش‌فرض ابتدا متغیر محیطی :envvar:`PYTHONBREAKPOINT` را بررسی " +"می‌کند. اگر این متغیر روی ``\"0\"`` تنظیم شده باشد، این تابع بلافاصله " +"برمی‌گردد؛ یعنی یک عملیات بی‌اثر (no-op) است. اگر متغیر محیطی تنظیم نشده " +"باشد، یا روی رشته خالی تنظیم شده باشد، ``pdb.set_trace()`` فراخوانی می‌شود. " +"در غیر این صورت، این متغیر باید با استفاده از نام‌گذاری ایمپورت نقطه‌دار " +"پایتون، نام تابعی را برای اجرا مشخص کند؛ برای مثال " +"``package.subpackage.module.function``. در این حالت، " +"``package.subpackage.module`` ایمپورت می‌شود و ماژول حاصل باید یک شیء قابل " +"فراخوانی (callable) به نام ``function()`` داشته باشد. این تابع اجرا می‌شود، " +"در حالی که ``*args`` و ``**kws`` به آن ارسال می‌شوند، و هر چه ``function()`` " +"برگرداند، ``sys.breakpointhook()`` همان را به تابع توکار :func:`breakpoint` " +"برمی‌گرداند." -msgid "Note that if anything goes wrong while importing the callable named by :envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the breakpoint is ignored." +msgid "" +"Note that if anything goes wrong while importing the callable named " +"by :envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " +"breakpoint is ignored." msgstr "" +"توجه داشته باشید که اگر هنگام ایمپورت شیء قابل فراخوانی مشخص‌شده " +"توسط :envvar:`PYTHONBREAKPOINT` مشکلی پیش بیاید، یک :exc:`RuntimeWarning` " +"گزارش داده می‌شود و نقطه توقف نادیده گرفته می‌شود." -msgid "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :envvar:`PYTHONBREAKPOINT` is *not* consulted." +msgid "" +"Also note that if ``sys.breakpointhook()`` is overridden " +"programmatically, :envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" +"همچنین توجه داشته باشید که اگر ``sys.breakpointhook()`` به‌صورت برنامه‌ای " +"بازنویسی شود، به :envvar:`PYTHONBREAKPOINT` مراجعه *نمی‌شود*." -msgid "Print low-level information to stderr about the state of CPython's memory allocator." +msgid "" +"Print low-level information to stderr about the state of CPython's memory " +"allocator." msgstr "" +"اطلاعات سطح پایین را درباره وضعیت تخصیص‌دهنده حافظه CPython در stderr چاپ " +"می‌کند." -msgid "If Python is :ref:`built in debug mode ` (:option:`configure --with-pydebug option <--with-pydebug>`), it also performs some expensive internal consistency checks." +msgid "" +"If Python is :ref:`built in debug mode ` (:option:`configure --" +"with-pydebug option <--with-pydebug>`), it also performs some expensive " +"internal consistency checks." msgstr "" +"اگر پایتون :ref:`در حالت اشکال‌زدایی ساخته‌شده باشد ` " +"(:option:`configure --with-pydebug option <--with-pydebug>`)، همچنین برخی " +"بررسی‌های پرهزینه‌ی سازگاری درونی را نیز انجام می‌دهد." -msgid "This function is specific to CPython. The exact output format is not defined here, and may change." +msgid "" +"This function is specific to CPython. The exact output format is not " +"defined here, and may change." msgstr "" +"این تابع مختص CPython است. قالب دقیق خروجی در اینجا تعریف نشده است و ممکن " +"است تغییر کند." msgid "Integer specifying the handle of the Python DLL." -msgstr "" +msgstr "عدد صحیحی که دسته (handle) DLL پایتون را مشخص می‌کند." -msgid "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys.stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error handler (which is probably ``'strict'``), encode it to ``sys.stdout.encoding`` with ``'backslashreplace'`` error handler." -msgstr "" +msgid "" +"If *value* is not ``None``, this function prints ``repr(value)`` to " +"``sys.stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is " +"not encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error " +"handler (which is probably ``'strict'``), encode it to " +"``sys.stdout.encoding`` with ``'backslashreplace'`` error handler." +msgstr "" +"اگر *value* ``None`` نباشد، این تابع ``repr(value)`` را در ``sys.stdout`` " +"چاپ می‌کند و *value* را در ``builtins._`` ذخیره می‌کند. اگر ``repr(value)`` " +"با مدیر خطای ``sys.stdout.errors`` (که احتمالاً ``'strict'`` است) به " +"``sys.stdout.encoding`` قابل کدگذاری نباشد، آن را با مدیر خطای " +"``'backslashreplace'`` به ``sys.stdout.encoding`` کدگذاری می‌کند." -msgid "``sys.displayhook`` is called on the result of evaluating an :term:`expression` entered in an interactive Python session. The display of these values can be customized by assigning another one-argument function to ``sys.displayhook``." +msgid "" +"``sys.displayhook`` is called on the result of evaluating " +"an :term:`expression` entered in an interactive Python session. The " +"display of these values can be customized by assigning another one-argument " +"function to ``sys.displayhook``." msgstr "" +"``sys.displayhook`` برای نتیجه‌ی ارزیابی یک :term:`عبارت ` " +"واردشده در یک نشست تعاملی پایتون فراخوانی می‌شود. نمایش این مقادیر را می‌توان " +"با انتساب تابع یک‌آرگومانی دیگری به ``sys.displayhook`` سفارشی کرد." msgid "Pseudo-code::" -msgstr "" +msgstr "شبه‌کد::" msgid "" "def displayhook(value):\n" @@ -208,300 +527,611 @@ msgid "" " sys.stdout.write(\"\\n\")\n" " builtins._ = value" msgstr "" +"def displayhook(value):\n" +" if value is None:\n" +" return\n" +" # Set '_' to None to avoid recursion\n" +" builtins._ = None\n" +" text = repr(value)\n" +" try:\n" +" sys.stdout.write(text)\n" +" except UnicodeEncodeError:\n" +" bytes = text.encode(sys.stdout.encoding, 'backslashreplace')\n" +" if hasattr(sys.stdout, 'buffer'):\n" +" sys.stdout.buffer.write(bytes)\n" +" else:\n" +" text = bytes.decode(sys.stdout.encoding, 'strict')\n" +" sys.stdout.write(text)\n" +" sys.stdout.write(\"\\n\")\n" +" builtins._ = value" msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" +"برای :exc:`UnicodeEncodeError` از مدیر خطای ``'backslashreplace'`` استفاده " +"کنید." -msgid "If this is true, Python won't try to write ``.pyc`` files on the import of source modules. This value is initially set to ``True`` or ``False`` depending on the :option:`-B` command line option and the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable, but you can set it yourself to control bytecode file generation." -msgstr "" +msgid "" +"If this is true, Python won't try to write ``.pyc`` files on the import of " +"source modules. This value is initially set to ``True`` or ``False`` " +"depending on the :option:`-B` command line option and " +"the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable, but you can set " +"it yourself to control bytecode file generation." +msgstr "" +"اگر این مقدار درست باشد، پایتون تلاشی برای نوشتن فایل‌های ``.pyc`` هنگام " +"ایمپورت ماژول‌های منبع نمی‌کند. این مقدار در ابتدا بسته به گزینه خط " +"فرمان :option:`-B` و متغیر محیطی :envvar:`PYTHONDONTWRITEBYTECODE` روی " +"``True`` یا ``False`` تنظیم می‌شود، اما می‌توانید خودتان آن را برای کنترل " +"تولید فایل‌های بایت‌کد تنظیم کنید." -msgid "A :term:`named tuple` holding information about the environment on the *wasm32-emscripten* platform. The named tuple is provisional and may change in the future." +msgid "" +"A :term:`named tuple` holding information about the environment on the " +"*wasm32-emscripten* platform. The named tuple is provisional and may change " +"in the future." msgstr "" +"یک :term:`named tuple` حاوی اطلاعات درباره محیط سکوی *wasm32-emscripten*. " +"این named tuple موقتی است و ممکن است در آینده تغییر کند." -msgid "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, 8)``." +msgid "" +"Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " +"8)``." msgstr "" +"نسخه Emscripten به‌صورت تاپلی از اعداد صحیح (اصلی، فرعی، میکرو)، برای مثال " +"``(3, 1, 8)``." -msgid "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or ``'UNKNOWN'``." +msgid "" +"Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " +"``'UNKNOWN'``." msgstr "" +"رشته‌ی ران‌تایم، مثلاً عامل کاربری مرورگر، ``'Node.js v14.18.2'``، یا " +"``'UNKNOWN'``." msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" +"``True`` اگر پایتون با پشتیبانی از pthreads در Emscripten کامپایل‌شده باشد." msgid "``True`` if Python is compiled with shared memory support." -msgstr "" +msgstr "``True`` اگر پایتون با پشتیبانی از حافظه‌ی مشترک کامپایل شده باشد." -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 directory, rather than from ``__pycache__`` directories in the source code tree. Any ``__pycache__`` directories in the source code tree will be ignored and new ``.pyc`` files written within the pycache prefix. Thus if you use :mod:`compileall` as a pre-build step, you must ensure you run it with the same pycache prefix (if any) that you will use at runtime." -msgstr "" +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 " +"directory, rather than from ``__pycache__`` directories in the source code " +"tree. Any ``__pycache__`` directories in the source code tree will be " +"ignored and new ``.pyc`` files written within the pycache prefix. Thus if " +"you use :mod:`compileall` as a pre-build step, you must ensure you run it " +"with the same pycache prefix (if any) that you will use at runtime." +msgstr "" +"اگر این مقدار تنظیم شده باشد (``None`` نباشد)، پایتون فایل‌های ``.pyc`` " +"نهانگاه بایت‌کد را در یک درخت پوشه‌ای موازی که ریشه‌ی آن این پوشه است می‌نویسد " +"(و آن‌ها را از همان می‌خواند)، نه از پوشه‌های ``__pycache__`` در درخت کد منبع. " +"هر پوشه‌ی ``__pycache__`` در درخت کد منبع نادیده گرفته خواهد شد و فایل‌های " +"``.pyc`` جدید درون پیشوند pycache نوشته می‌شوند. بنابراین اگر " +"از :mod:`compileall` به‌عنوان یک مرحله‌ی پیش از ساخت استفاده می‌کنید، باید " +"اطمینان حاصل کنید که آن را با همان پیشوند pycache (در صورت وجود) اجرا " +"می‌کنید که در ران‌تایم استفاده خواهید کرد." -msgid "A relative path is interpreted relative to the current working directory." -msgstr "" +msgid "" +"A relative path is interpreted relative to the current working directory." +msgstr "مسیر نسبی نسبت به پوشه کاری جاری تفسیر می‌شود." -msgid "This value is initially set based on the value of the :option:`-X` ``pycache_prefix=PATH`` command-line option or the :envvar:`PYTHONPYCACHEPREFIX` environment variable (command-line takes precedence). If neither are set, it is ``None``." +msgid "" +"This value is initially set based on the value of the :option:`-X` " +"``pycache_prefix=PATH`` command-line option or " +"the :envvar:`PYTHONPYCACHEPREFIX` environment variable (command-line takes " +"precedence). If neither are set, it is ``None``." msgstr "" +"این مقدار در ابتدا بر اساس مقدار گزینه خط فرمان :option:`-X` " +"``pycache_prefix=PATH`` یا متغیر محیطی :envvar:`PYTHONPYCACHEPREFIX` تنظیم " +"می‌شود (خط فرمان اولویت دارد). اگر هیچ‌کدام تنظیم نشده باشند، ``None`` است." -msgid "This function prints out a given traceback and exception to ``sys.stderr``." +msgid "" +"This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" +"این تابع یک ردگیری پشته و استثنای داده‌شده را در ``sys.stderr`` چاپ می‌کند." -msgid "When an exception other than :exc:`SystemExit` is raised and uncaught, the interpreter calls ``sys.excepthook`` with three arguments, the exception class, exception instance, and a traceback object. In an interactive session this happens just before control is returned to the prompt; in a Python program this happens just before the program exits. The handling of such top-level exceptions can be customized by assigning another three-argument function to ``sys.excepthook``." -msgstr "" +msgid "" +"When an exception other than :exc:`SystemExit` is raised and uncaught, the " +"interpreter calls ``sys.excepthook`` with three arguments, the exception " +"class, exception instance, and a traceback object. In an interactive " +"session this happens just before control is returned to the prompt; in a " +"Python program this happens just before the program exits. The handling of " +"such top-level exceptions can be customized by assigning another three-" +"argument function to ``sys.excepthook``." +msgstr "" +"هنگامی که استثنایی غیر از :exc:`SystemExit` پرتاب شود و گرفته نشود، مفسر " +"``sys.excepthook`` را با سه آرگومان فراخوانی می‌کند: کلاس استثنا، نمونه " +"استثنا، و یک شیء ردگیری پشته. در یک نشست تعاملی، این اتفاق درست پیش از " +"بازگشت کنترل به نشانگر خط فرمان رخ می‌دهد؛ در یک برنامه پایتون، این اتفاق " +"درست پیش از خروج برنامه رخ می‌دهد. مدیریت چنین استثناهای سطح‌بالایی را می‌توان " +"با انتساب تابع دیگری با سه آرگومان به ``sys.excepthook`` سفارشی‌سازی کرد." -msgid "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, ``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no hook has been set, ``hook`` may be ``None``. If any hook raises an exception derived from :class:`RuntimeError` the call to the hook will be suppressed. Otherwise, the audit hook exception will be reported as unraisable and ``sys.excepthook`` will be called." -msgstr "" +msgid "" +"Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " +"``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " +"hook has been set, ``hook`` may be ``None``. If any hook raises an " +"exception derived from :class:`RuntimeError` the call to the hook will be " +"suppressed. Otherwise, the audit hook exception will be reported as " +"unraisable and ``sys.excepthook`` will be called." +msgstr "" +"هنگامی که استثنای گرفته‌نشده‌ای رخ دهد، یک رویداد حسابرسی ``sys.excepthook`` با " +"آرگومان‌های ``hook``، ``type``، ``value``، ``traceback`` پرتاب می‌شود. اگر " +"هیچ هوکی تنظیم نشده باشد، ممکن است ``hook`` برابر ``None`` باشد. اگر هر " +"هوکی استثنایی مشتق‌شده از :class:`RuntimeError` پرتاب کند، فراخوانی آن هوک " +"سرکوب خواهد شد. در غیر این صورت، استثنای هوک حسابرسی به‌عنوان غیرقابل‌پرتاب " +"گزارش خواهد شد و ``sys.excepthook`` فراخوانی خواهد شد." -msgid "The :func:`sys.unraisablehook` function handles unraisable exceptions and the :func:`threading.excepthook` function handles exception raised by :func:`threading.Thread.run`." +msgid "" +"The :func:`sys.unraisablehook` function handles unraisable exceptions and " +"the :func:`threading.excepthook` function handles exception raised " +"by :func:`threading.Thread.run`." msgstr "" +"تابع :func:`sys.unraisablehook` استثناهای غیرقابل‌پرتاب را مدیریت می‌کند و " +"تابع :func:`threading.excepthook` استثنای پرتاب‌شده " +"توسط :func:`threading.Thread.run` را مدیریت می‌کند." -msgid "These objects contain the original values of ``breakpointhook``, ``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the program. They are saved so that ``breakpointhook``, ``displayhook`` and ``excepthook``, ``unraisablehook`` can be restored in case they happen to get replaced with broken or alternative objects." -msgstr "" +msgid "" +"These objects contain the original values of ``breakpointhook``, " +"``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " +"program. They are saved so that ``breakpointhook``, ``displayhook`` and " +"``excepthook``, ``unraisablehook`` can be restored in case they happen to " +"get replaced with broken or alternative objects." +msgstr "" +"این اشیاء شامل مقادیر اصلی ``breakpointhook``، ``displayhook``، " +"``excepthook`` و ``unraisablehook`` در آغاز برنامه هستند. آن‌ها ذخیره می‌شوند " +"تا ``breakpointhook``، ``displayhook``، ``excepthook`` و ``unraisablehook`` " +"در صورتی که احیاناً با اشیای خراب یا جایگزین جایگزین شده باشند، بازگردانی " +"شوند." msgid "__breakpointhook__" -msgstr "" +msgstr "__breakpointhook__" msgid "__unraisablehook__" -msgstr "" +msgstr "__unraisablehook__" -msgid "This function, when called while an exception handler is executing (such as an ``except`` or ``except*`` clause), returns the exception instance that was caught by this handler. When exception handlers are nested within one another, only the exception handled by the innermost handler is accessible." +msgid "" +"This function, when called while an exception handler is executing (such as " +"an ``except`` or ``except*`` clause), returns the exception instance that " +"was caught by this handler. When exception handlers are nested within one " +"another, only the exception handled by the innermost handler is accessible." msgstr "" +"این تابع، هنگامی که در حین اجرای یک مدیر استثنا فراخوانی شود (مانند یک بند " +"``except`` یا ``except*``)، نمونه‌ی استثنای گرفته‌شده توسط این مدیر را " +"برمی‌گرداند. هنگامی که هندلرهای استثنا در یکدیگر تودرتو شده باشند، تنها " +"استثنای مدیریت‌شده توسط داخلی‌ترین مدیر قابل دسترسی است." msgid "If no exception handler is executing, this function returns ``None``." msgstr "" +"اگر هیچ هندلر استثنایی در حال اجرا نباشد، این تابع ``None`` را " +"بازمی‌گرداند." -msgid "This function returns the old-style representation of the handled exception. If an exception ``e`` is currently handled (so :func:`exception` would return ``e``), :func:`exc_info` returns the tuple ``(type(e), e, e.__traceback__)``. That is, a tuple containing the type of the exception (a subclass of :exc:`BaseException`), the exception itself, and a :ref:`traceback object ` which typically encapsulates the call stack at the point where the exception last occurred." -msgstr "" +msgid "" +"This function returns the old-style representation of the handled " +"exception. If an exception ``e`` is currently handled (so :func:`exception` " +"would return ``e``), :func:`exc_info` returns the tuple ``(type(e), e, " +"e.__traceback__)``. That is, a tuple containing the type of the exception " +"(a subclass of :exc:`BaseException`), the exception itself, and " +"a :ref:`traceback object ` which typically encapsulates " +"the call stack at the point where the exception last occurred." +msgstr "" +"این تابع بازنمایی به سبک قدیمی استثنای مدیریت‌شده را برمی‌گرداند. اگر یک " +"استثنا ``e`` در حال حاضر مدیریت شده باشد (به‌طوری که :func:`exception` مقدار " +"``e`` را برمی‌گرداند)، :func:`exc_info` تاپل ``(type(e), e, " +"e.__traceback__)`` را برمی‌گرداند. یعنی تاپلی شامل نوع استثنا (یک زیرکلاس " +"از :exc:`BaseException`)، خود استثنا، و یک :ref:`شیء ردگیری پشته ` که معمولاً پشته فراخوانی را در نقطه‌ای که استثنا آخرین بار در آن رخ " +"داده است در بر می‌گیرد." -msgid "If no exception is being handled anywhere on the stack, this function return a tuple containing three ``None`` values." +msgid "" +"If no exception is being handled anywhere on the stack, this function " +"return a tuple containing three ``None`` values." msgstr "" +"اگر هیچ استثنایی در هیچ نقطه‌ای از پشته مدیریت نشود، این تابع یک تاپل شامل " +"سه مقدار ``None`` برمی‌گرداند." -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 handled, the changes are reflected in the results of subsequent calls to :func:`exc_info`." +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 handled, the changes are reflected in the results of subsequent calls " +"to :func:`exc_info`." msgstr "" +"فیلدهای ``type`` و ``traceback`` اکنون از ``value`` (نمونه استثنا) به دست " +"می‌آیند، بنابراین هنگامی که یک استثنا در حین مدیریت تغییر داده می‌شود، " +"تغییرات در نتایج فراخوانی‌های بعدی :func:`exc_info` منعکس می‌شوند." -msgid "A string giving the site-specific directory prefix where the platform-dependent Python files are installed; by default, this is also ``'/usr/local'``. This can be set at build time with the ``--exec-prefix`` argument to the :program:`configure` script. Specifically, all configuration files (e.g. the :file:`pyconfig.h` header file) are installed in the directory :file:`{exec_prefix}/lib/python{X.Y}/config`, and shared library modules are installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload`, where *X.Y* is the version number of Python, for example ``3.2``." -msgstr "" +msgid "" +"A string giving the site-specific directory prefix where the platform-" +"dependent Python files are installed; by default, this is also ``'/usr/" +"local'``. This can be set at build time with the ``--exec-prefix`` " +"argument to the :program:`configure` script. Specifically, all " +"configuration files (e.g. the :file:`pyconfig.h` header file) are installed " +"in the directory :file:`{exec_prefix}/lib/python{X.Y}/config`, and shared " +"library modules are installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-" +"dynload`, where *X.Y* is the version number of Python, for example ``3.2``." +msgstr "" +"رشته‌ای که پیشوند پوشه‌ی مختص سایت را مشخص می‌کند؛ جایی که فایل‌های پایتون " +"وابسته به پلتفرم در آن نصب می‌شوند؛ به‌طور پیش‌فرض، این مقدار نیز ``'/usr/" +"local'`` است. این مقدار را می‌توان در زمان ساخت با آرگومان ``--exec-prefix`` " +"اسکریپت :program:`configure` تنظیم کرد. به‌طور مشخص، همه‌ی فایل‌های پیکربندی " +"(مانند فایل سرآیند :file:`pyconfig.h`) در پوشه‌ی :file:`{exec_prefix}/lib/" +"python{X.Y}/config` نصب می‌شوند و ماژول‌های کتابخانه‌ی اشتراکی " +"در :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload` نصب می‌شوند، که در آن " +"*X.Y* شماره‌ی نسخه‌ی پایتون است، برای مثال ``3.2``." -msgid "If a :ref:`virtual environment ` is in effect, this :data:`exec_prefix` will point to the virtual environment. The value for the Python installation will still be available, via :data:`base_exec_prefix`. Refer to :ref:`sys-path-init-virtual-environments` for more information." +msgid "" +"If a :ref:`virtual environment ` is in effect, " +"this :data:`exec_prefix` will point to the virtual environment. The value " +"for the Python installation will still be available, " +"via :data:`base_exec_prefix`. Refer to :ref:`sys-path-init-virtual-" +"environments` for more information." msgstr "" +"اگر یک :ref:`محیط مجازی ` فعال باشد، این :data:`exec_prefix` به " +"محیط مجازی اشاره خواهد کرد. مقدار مربوط به نصب پایتون همچنان از " +"طریق :data:`base_exec_prefix` در دسترس خواهد بود. برای اطلاعات بیشتر " +"به :ref:`sys-path-init-virtual-environments` مراجعه کنید." -msgid "When running under a :ref:`virtual environment `, :data:`prefix` and :data:`exec_prefix` are now set to the virtual environment prefix by the :ref:`path initialization `, instead of :mod:`site`. This means that :data:`prefix` and :data:`exec_prefix` always point to the virtual environment, even when :mod:`site` is disabled (:option:`-S`)." -msgstr "" +msgid "" +"When running under a :ref:`virtual environment `, :data:`prefix` " +"and :data:`exec_prefix` are now set to the virtual environment prefix by " +"the :ref:`path initialization `, instead of :mod:`site`. " +"This means that :data:`prefix` and :data:`exec_prefix` always point to the " +"virtual environment, even when :mod:`site` is disabled (:option:`-S`)." +msgstr "" +"هنگام اجرا در یک :ref:`محیط مجازی `، :data:`prefix` " +"و :data:`exec_prefix` اکنون به‌جای :mod:`site` توسط :ref:`راه‌اندازی مسیر " +"` به پیشوند محیط مجازی تنظیم می‌شوند. این بدان معناست " +"که :data:`prefix` و :data:`exec_prefix` همیشه به محیط مجازی اشاره می‌کنند، " +"حتی زمانی که :mod:`site` غیرفعال باشد (:option:`-S`)." -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 retrieve the real path to its executable, :data:`sys.executable` will be an empty string or ``None``." +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 " +"retrieve the real path to its executable, :data:`sys.executable` will be an " +"empty string or ``None``." msgstr "" +"رشته‌ای که مسیر مطلق دودویی اجرایی مفسر پایتون را در سیستم‌هایی که این موضوع " +"در آن‌ها معنا دارد، نشان می‌دهد. اگر پایتون قادر به دریافت مسیر واقعی فایل " +"اجرایی خود نباشد، :data:`sys.executable` یک رشته خالی یا ``None`` خواهد بود." -msgid "Raise a :exc:`SystemExit` exception, signaling an intention to exit the interpreter." +msgid "" +"Raise a :exc:`SystemExit` exception, signaling an intention to exit the " +"interpreter." msgstr "" +"یک استثنای :exc:`SystemExit` را پرتاب می‌کند، که قصد خروج از مفسر را نشان " +"می‌دهد." -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 is considered \"successful termination\" and any nonzero value is considered \"abnormal termination\" by shells and the like. Most systems require it to be in the range 0--127, and produce undefined results otherwise. Some systems have a convention for assigning specific meanings to specific exit codes, but these are generally underdeveloped; Unix programs generally use 2 for command line syntax errors and 1 for all other kinds of errors. If another type of object is passed, ``None`` is equivalent to passing zero, and any other object is printed to :data:`stderr` and results in an exit code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick way to exit a program when an error occurs." -msgstr "" +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 " +"is considered \"successful termination\" and any nonzero value is " +"considered \"abnormal termination\" by shells and the like. Most systems " +"require it to be in the range 0--127, and produce undefined results " +"otherwise. Some systems have a convention for assigning specific meanings " +"to specific exit codes, but these are generally underdeveloped; Unix " +"programs generally use 2 for command line syntax errors and 1 for all other " +"kinds of errors. If another type of object is passed, ``None`` is " +"equivalent to passing zero, and any other object is printed " +"to :data:`stderr` and results in an exit code of 1. In particular, " +"``sys.exit(\"some error message\")`` is a quick way to exit a program when " +"an error occurs." +msgstr "" +"آرگومان اختیاری *arg* می‌تواند یک عدد صحیح باشد که وضعیت خروج را مشخص می‌کند " +"(پیش‌فرض آن صفر است)، یا شیءای از نوع دیگر. اگر عدد صحیح باشد، صفر از سوی " +"پوسته‌ها و امثال آن «خاتمه‌ی موفق» و هر مقدار ناصفر «خاتمه‌ی غیرعادی» تلقی " +"می‌شود. در بیشتر سیستم‌ها، این مقدار باید در محدوده‌ی ۰ تا ۱۲۷ باشد؛ در غیر این " +"صورت نتایج تعریف‌نشده‌ای تولید می‌شود. برخی سیستم‌ها برای اختصاص معانی خاص به " +"کدهای خروج خاص قراردادی دارند، اما این قراردادها عموماً چندان توسعه‌یافته " +"نیستند؛ برنامه‌های یونیکس معمولاً از ۲ برای خطاهای سینتکس خط فرمان و از ۱ " +"برای تمام انواع دیگر خطاها استفاده می‌کنند. اگر شیءای از نوع دیگر ارسال شود، " +"``None`` معادل ارسال صفر است و هر شیء دیگری در :data:`stderr` چاپ می‌شود و " +"به کد خروج ۱ منجر می‌شود. به‌ویژه، ``sys.exit(\"some error message\")`` راهی " +"سریع برای خروج از برنامه هنگام وقوع خطا است." -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 intercepted. Cleanup actions specified by finally clauses of :keyword:`try` statements are honored, and it is possible to intercept the exit attempt at an outer level." +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 " +"intercepted. Cleanup actions specified by finally clauses of :keyword:`try` " +"statements are honored, and it is possible to intercept the exit attempt at " +"an outer level." msgstr "" +"از آنجا که :func:`exit` در نهایت «فقط» یک استثنا پرتاب می‌کند، تنها زمانی " +"فرایند را خاتمه می‌دهد که از نخ اصلی فراخوانی شود و استثنا رهگیری نشده باشد. " +"اقدامات پاک‌سازی مشخص‌شده توسط بندهای finally در دستورات :keyword:`try` اجرا " +"می‌شوند و می‌توان تلاش برای خروج را در سطحی بیرونی رهگیری کرد." -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." +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 "" +"اگر در پاک‌سازی، پس از آنکه مفسر پایتون :exc:`SystemExit` را گرفته باشد، " +"خطایی رخ دهد (مانند خطا در تخلیه‌ی داده‌های بافری‌شده در جریان‌های استاندارد)، " +"وضعیت خروج به ۱۲۰ تغییر می‌یابد." -msgid "The :term:`named tuple` *flags* exposes the status of command line flags. Flags should only be accessed only by name and not by index. The attributes are read only." +msgid "" +"The :term:`named tuple` *flags* exposes the status of command line flags. " +"Flags should only be accessed only by name and not by index. The " +"attributes are read only." msgstr "" +":term:`named tuple` *flags* وضعیت پرچم‌های خط فرمان را نشان می‌دهد. پرچم‌ها " +"باید تنها با نام و نه با اندیس مورد دسترسی قرار گیرند. ویژگی‌ها فقط‌خواندنی " +"هستند." msgid ":option:`-d`" -msgstr "" +msgstr ":option:`-d`" msgid ":option:`-i`" -msgstr "" +msgstr ":option:`-i`" msgid ":option:`-I`" -msgstr "" +msgstr ":option:`-I`" msgid ":option:`-O` or :option:`-OO`" -msgstr "" +msgstr ":option:`-O` یا :option:`-OO`" msgid ":option:`-B`" -msgstr "" +msgstr ":option:`-B`" msgid ":option:`-s`" -msgstr "" +msgstr ":option:`-s`" msgid ":option:`-S`" -msgstr "" +msgstr ":option:`-S`" msgid ":option:`-E`" -msgstr "" +msgstr ":option:`-E`" msgid ":option:`-v`" -msgstr "" +msgstr ":option:`-v`" msgid ":option:`-b`" -msgstr "" +msgstr ":option:`-b`" msgid ":option:`-q`" -msgstr "" +msgstr ":option:`-q`" msgid ":option:`-R`" -msgstr "" +msgstr ":option:`-R`" msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" -msgstr "" +msgstr ":option:`-X dev <-X>` (:ref:`حالت توسعه پایتون `)" msgid ":option:`-X utf8 <-X>`" -msgstr "" +msgstr ":option:`-X utf8 <-X>`" msgid ":option:`-P`" -msgstr "" +msgstr ":option:`-P`" -msgid ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length limitation `)" +msgid "" +":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion " +"length limitation `)" msgstr "" +":option:`-X int_max_str_digits <-X>` (:ref:`محدودیت طول تبدیل عدد صحیح به " +"رشته `)" msgid ":option:`-X warn_default_encoding <-X>`" -msgstr "" +msgstr ":option:`-X warn_default_encoding <-X>`" msgid ":option:`-X gil <-X>` and :envvar:`PYTHON_GIL`" -msgstr "" +msgstr ":option:`-X gil <-X>` و :envvar:`PYTHON_GIL`" -msgid ":option:`-X thread_inherit_context <-X>` and :envvar:`PYTHON_THREAD_INHERIT_CONTEXT`" +msgid "" +":option:`-X thread_inherit_context <-X>` " +"and :envvar:`PYTHON_THREAD_INHERIT_CONTEXT`" msgstr "" +":option:`-X thread_inherit_context <-X>` " +"و :envvar:`PYTHON_THREAD_INHERIT_CONTEXT`" -msgid ":option:`-X context_aware_warnings <-X>` and :envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`" +msgid "" +":option:`-X context_aware_warnings <-X>` " +"and :envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`" msgstr "" +":option:`-X context_aware_warnings <-X>` " +"و :envvar:`PYTHON_CONTEXT_AWARE_WARNINGS`" msgid "Added ``quiet`` attribute for the new :option:`-q` flag." -msgstr "" +msgstr "ویژگی ``quiet`` برای پرچم جدید :option:`-q` افزوده شد." msgid "The ``hash_randomization`` attribute." -msgstr "" +msgstr "ویژگی ``hash_randomization``." msgid "Removed obsolete ``division_warning`` attribute." -msgstr "" +msgstr "ویژگی منسوخ ``division_warning`` حذف شد." msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." -msgstr "" +msgstr "ویژگی ``isolated`` برای پرچم ``isolated`` در :option:`-I` افزوده شد." -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." +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 "" +"ویژگی ``dev_mode`` برای :ref:`حالت توسعه پایتون ` جدید و ویژگی " +"``utf8_mode`` برای پرچم ``utf8`` جدید :option:`-X` افزوده شدند." -msgid "Added ``warn_default_encoding`` attribute for :option:`-X` ``warn_default_encoding`` flag." +msgid "" +"Added ``warn_default_encoding`` attribute for :option:`-X` " +"``warn_default_encoding`` flag." msgstr "" +"ویژگی ``warn_default_encoding`` برای پرچم :option:`-X` " +"``warn_default_encoding`` افزوده شد." msgid "Added the ``safe_path`` attribute for :option:`-P` option." -msgstr "" +msgstr "ویژگی ``safe_path`` برای گزینه‌ی :option:`-P` افزوده شد." msgid "Added the ``int_max_str_digits`` attribute." -msgstr "" +msgstr "ویژگی ``int_max_str_digits`` اضافه شد." msgid "Added the ``gil`` attribute." -msgstr "" +msgstr "ویژگی ``gil`` افزوده شد." msgid "Added the ``thread_inherit_context`` attribute." -msgstr "" +msgstr "ویژگی ``thread_inherit_context`` افزوده شد." msgid "Added the ``context_aware_warnings`` attribute." -msgstr "" +msgstr "ویژگی ``context_aware_warnings`` افزوده شد." -msgid "A :term:`named tuple` holding information about the float type. It contains low level information about the precision and internal representation. The values correspond to the various floating-point constants defined in the standard header file :file:`float.h` for the 'C' programming language; see section 5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics of floating types', for details." -msgstr "" +msgid "" +"A :term:`named tuple` holding information about the float type. It contains " +"low level information about the precision and internal representation. The " +"values correspond to the various floating-point constants defined in the " +"standard header file :file:`float.h` for the 'C' programming language; see " +"section 5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics " +"of floating types', for details." +msgstr "" +"یک تاپل نام‌دار (:term:`named tuple`) حاوی اطلاعاتی درباره نوع float است. " +"این شامل اطلاعات سطح پایین درباره دقت و نمایش داخلی است. مقادیر با ثابت‌های " +"مختلف ممیز شناور تعریف‌شده در فایل سرآیند استاندارد :file:`float.h` برای زبان " +"برنامه‌نویسی C مطابقت دارند؛ برای جزئیات، بخش ۵.۲.۴.۲.۲ از استاندارد ISO/IEC " +"C سال ۱۹۹۹ [C99]_، «مشخصات انواع ممیز شناور» را ببینید." msgid "Attributes of the :data:`!float_info` :term:`named tuple`" -msgstr "" +msgstr "ویژگی‌های :term:`named tuple` :data:`!float_info`" msgid "attribute" -msgstr "" +msgstr "ویژگی" msgid "float.h macro" -msgstr "" +msgstr "ماکروی float.h" msgid "explanation" -msgstr "" +msgstr "توضیح" msgid ":c:macro:`!DBL_EPSILON`" -msgstr "" +msgstr ":c:macro:`!DBL_EPSILON`" -msgid "difference between 1.0 and the least value greater than 1.0 that is representable as a float." +msgid "" +"difference between 1.0 and the least value greater than 1.0 that is " +"representable as a float." msgstr "" +"تفاوت میان 1.0 و کمترین مقدار بزرگ‌تر از 1.0 که به‌صورت یک عدد اعشاری " +"قابل‌نمایش است." msgid "See also :func:`math.ulp`." -msgstr "" +msgstr "همچنین ببینید :func:`math.ulp`." msgid ":c:macro:`!DBL_DIG`" -msgstr "" +msgstr ":c:macro:`!DBL_DIG`" -msgid "The maximum number of decimal digits that can be faithfully represented in a float; see below." +msgid "" +"The maximum number of decimal digits that can be faithfully represented in " +"a float; see below." msgstr "" +"حداکثر تعداد ارقام اعشاری که می‌توانند به‌صورت امانت‌دارانه در یک شناور " +"(float) بازنمایی شوند؛ در ادامه ببینید." msgid ":c:macro:`!DBL_MANT_DIG`" -msgstr "" +msgstr ":c:macro:`!DBL_MANT_DIG`" -msgid "Float precision: the number of base-``radix`` digits in the significand of a float." +msgid "" +"Float precision: the number of base-``radix`` digits in the significand of " +"a float." msgstr "" +"دقت عدد اعشاری: تعداد ارقام مبنای ``radix`` در بخش معنادار (significand) یک " +"عدد اعشاری." msgid ":c:macro:`!DBL_MAX`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX`" msgid "The maximum representable positive finite float." -msgstr "" +msgstr "بیشترین عدد اعشاری مثبت متناهی قابل نمایش." msgid ":c:macro:`!DBL_MAX_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX_EXP`" -msgid "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite float." +msgid "" +"The maximum integer *e* such that ``radix**(e-1)`` is a representable " +"finite float." msgstr "" +"بزرگ‌ترین عدد صحیح *e* به‌طوری که ``radix**(e-1)`` یک عدد اعشاری متناهی " +"قابل‌نمایش باشد." msgid ":c:macro:`!DBL_MAX_10_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX_10_EXP`" -msgid "The maximum integer *e* such that ``10**e`` is in the range of representable finite floats." +msgid "" +"The maximum integer *e* such that ``10**e`` is in the range of " +"representable finite floats." msgstr "" +"بزرگ‌ترین عدد صحیح *e* که ``10**e`` در بازه‌ی اعداد اعشاری متناهی قابل‌نمایش " +"باشد." msgid ":c:macro:`!DBL_MIN`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN`" msgid "The minimum representable positive *normalized* float." -msgstr "" +msgstr "کمینه عدد اعشاری مثبت *نرمال‌شده* قابل بازنمایی." -msgid "Use :func:`math.ulp(0.0) ` to get the smallest positive *denormalized* representable float." +msgid "" +"Use :func:`math.ulp(0.0) ` to get the smallest positive " +"*denormalized* representable float." msgstr "" +"برای به دست آوردن کوچک‌ترین شناور مثبت *غیرنرمال (denormalized)* قابل نمایش " +"از :func:`math.ulp(0.0) ` استفاده کنید." msgid ":c:macro:`!DBL_MIN_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN_EXP`" -msgid "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." -msgstr "" +msgid "" +"The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." +msgstr "کمترین عدد صحیح *e* به‌طوری‌که ``radix**(e-1)`` یک شناور نرمال‌شده باشد." msgid ":c:macro:`!DBL_MIN_10_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN_10_EXP`" msgid "The minimum integer *e* such that ``10**e`` is a normalized float." -msgstr "" +msgstr "کمترین عدد صحیح *e* به‌طوری که ``10**e`` یک شناور نرمال‌شده باشد." msgid ":c:macro:`!FLT_RADIX`" -msgstr "" +msgstr ":c:macro:`!FLT_RADIX`" msgid "The radix of exponent representation." -msgstr "" +msgstr "مبنای نمایش توان." msgid ":c:macro:`!FLT_ROUNDS`" -msgstr "" +msgstr ":c:macro:`!FLT_ROUNDS`" -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:" +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 "" +"عدد صحیحی که حالت گرد کردن برای محاسبات ممیز شناور را نشان می‌دهد. این " +"مقدار، مقدار ماکروی سیستمی :c:macro:`!FLT_ROUNDS` را در زمان راه‌اندازی مفسر " +"منعکس می‌کند:" msgid "``-1``: indeterminable" -msgstr "" +msgstr "``-1``: غیرقابل تعیین" msgid "``0``: toward zero" -msgstr "" +msgstr "``0``: به سمت صفر" msgid "``1``: to nearest" -msgstr "" +msgstr "``1``: به نزدیک‌ترین" msgid "``2``: toward positive infinity" -msgstr "" +msgstr "``2``: به سمت بی‌نهایت مثبت" msgid "``3``: toward negative infinity" -msgstr "" +msgstr "``3``: به سمت بی‌نهایت منفی" -msgid "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-defined rounding behavior." +msgid "" +"All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" +"defined rounding behavior." msgstr "" +"همه‌ی مقادیر دیگر :c:macro:`!FLT_ROUNDS` نشان‌دهنده‌ی رفتار گرد کردن تعریف‌شده " +"توسط پیاده‌سازی هستند." -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.float_info.dig` significant digits, then converting ``s`` to a float and back again will recover a string representing the same decimal value::" +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.float_info.dig` significant digits, then converting ``s`` to a float " +"and back again will recover a string representing the same decimal value::" msgstr "" +"ویژگی :attr:`sys.float_info.dig` به توضیح بیشتری نیاز دارد. اگر ``s`` هر " +"رشته‌ای باشد که یک عدد اعشاری را با حداکثر :attr:`!sys.float_info.dig` رقم " +"معنادار نشان می‌دهد، آنگاه تبدیل ``s`` به یک عدد اعشاری (float) و سپس تبدیل " +"دوباره‌ی آن به رشته، رشته‌ای را بازیابی خواهد کرد که همان مقدار اعشاری را " +"نشان می‌دهد::" msgid "" ">>> import sys\n" @@ -511,234 +1141,551 @@ msgid "" ">>> format(float(s), '.15g') # convert to float and back -> same value\n" "'3.14159265358979'" msgstr "" +">>> import sys\n" +">>> sys.float_info.dig\n" +"15\n" +">>> s = '3.14159265358979' # decimal string with 15 significant digits\n" +">>> format(float(s), '.15g') # convert to float and back -> same value\n" +"'3.14159265358979'" -msgid "But for strings with more than :attr:`sys.float_info.dig` significant digits, this isn't always true::" +msgid "" +"But for strings with more than :attr:`sys.float_info.dig` significant " +"digits, this isn't always true::" msgstr "" +"اما برای رشته‌هایی که بیش از :attr:`sys.float_info.dig` رقم معنادار دارند، " +"این همیشه درست نیست::" msgid "" ">>> s = '9876543211234567' # 16 significant digits is too many!\n" ">>> format(float(s), '.16g') # conversion changes value\n" "'9876543211234568'" msgstr "" +">>> s = '9876543211234567' # 16 significant digits is too many!\n" +">>> format(float(s), '.16g') # conversion changes value\n" +"'9876543211234568'" -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)`` aims to produce a short string with the property that ``float(repr(x)) == x``. This is the usual behaviour in Python 3.1 and later. Otherwise, ``float_repr_style`` has value ``'legacy'`` and ``repr(x)`` behaves in the same way as it did in versions of Python prior to 3.1." -msgstr "" +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)`` " +"aims to produce a short string with the property that ``float(repr(x)) == " +"x``. This is the usual behaviour in Python 3.1 and later. Otherwise, " +"``float_repr_style`` has value ``'legacy'`` and ``repr(x)`` behaves in the " +"same way as it did in versions of Python prior to 3.1." +msgstr "" +"رشته‌ای که نشان می‌دهد تابع :func:`repr` برای اعداد اعشاری چگونه رفتار می‌کند. " +"اگر رشته مقدار ``'short'`` داشته باشد، آنگاه برای یک عدد اعشاری متناهی " +"``x``، ``repr(x)`` تلاش می‌کند رشته‌ای کوتاه با این ویژگی تولید کند که " +"``float(repr(x)) == x``. این رفتار معمول در پایتون 3.1 و نسخه‌های بعدی است. " +"در غیر این صورت، ``float_repr_style`` مقدار ``'legacy'`` دارد و ``repr(x)`` " +"همان‌گونه رفتار می‌کند که در نسخه‌های پایتون پیش از 3.1 رفتار می‌کرد." -msgid "Return the number of memory blocks currently allocated by the interpreter, regardless of their size. This function is mainly useful for tracking and debugging memory leaks. Because of the interpreter's internal caches, the result can vary from call to call; you may have to call :func:`_clear_internal_caches` and :func:`gc.collect` to get more predictable results." -msgstr "" +msgid "" +"Return the number of memory blocks currently allocated by the interpreter, " +"regardless of their size. This function is mainly useful for tracking and " +"debugging memory leaks. Because of the interpreter's internal caches, the " +"result can vary from call to call; you may have to " +"call :func:`_clear_internal_caches` and :func:`gc.collect` to get more " +"predictable results." +msgstr "" +"تعداد بلوک‌های حافظه‌ای را که در حال حاضر توسط مفسر تخصیص داده شده‌اند، صرف‌نظر " +"از اندازه‌شان، برمی‌گرداند. این تابع عمدتاً برای پیگیری و اشکال‌زدایی نشت حافظه " +"مفید است. به دلیل نهانگاه‌های داخلی مفسر، نتیجه می‌تواند از یک فراخوانی به " +"فراخوانی دیگر متفاوت باشد؛ ممکن است لازم " +"باشد :func:`_clear_internal_caches` و :func:`gc.collect` را فراخوانی کنید " +"تا نتایج قابل‌پیش‌بینی‌تری به دست آورید." -msgid "If a Python build or implementation cannot reasonably compute this information, :func:`getallocatedblocks` is allowed to return 0 instead." +msgid "" +"If a Python build or implementation cannot reasonably compute this " +"information, :func:`getallocatedblocks` is allowed to return 0 instead." msgstr "" +"اگر یک ساخت یا پیاده‌سازی پایتون نتواند به‌طور معقول این اطلاعات را محاسبه " +"کند، :func:`getallocatedblocks` مجاز است در عوض 0 برگرداند." msgid "Return the number of unicode objects that have been interned." -msgstr "" +msgstr "تعداد اشیای یونیکدی را که اینترن‌شده (interned) هستند برمی‌گرداند." -msgid "Return the build-time API level of Android as an integer. This represents the minimum version of Android this build of Python can run on. For runtime version information, see :func:`platform.android_ver`." +msgid "" +"Return the build-time API level of Android as an integer. This represents " +"the minimum version of Android this build of Python can run on. For runtime " +"version information, see :func:`platform.android_ver`." msgstr "" +"سطح API زمان ساخت اندروید را به‌عنوان یک عدد صحیح برمی‌گرداند. این مقدار " +"نشان‌دهنده‌ی حداقل نسخه‌ی اندرویدی است که این ساخت پایتون می‌تواند روی آن اجرا " +"شود. برای اطلاعات نسخه‌ی ران‌تایم، :func:`platform.android_ver` را ببینید." -msgid "Return ``'utf-8'``. This is the name of the default string encoding, used in methods like :meth:`str.encode`." +msgid "" +"Return ``'utf-8'``. This is the name of the default string encoding, used " +"in methods like :meth:`str.encode`." msgstr "" +"``'utf-8'`` را برمی‌گرداند. این نام کدگذاری پیش‌فرض رشته است که در متدهایی " +"مانند :meth:`str.encode` استفاده می‌شود." -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 (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." +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 (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" +"مقدار فعلی پرچم‌های استفاده‌شده برای فراخوانی‌های :c:func:`dlopen` را " +"برمی‌گرداند. نام‌های نمادین مقادیر پرچم‌ها را می‌توان در ماژول :mod:`os` یافت " +"(ثابت‌های :samp:`RTLD_{xxx}`، مثلاً :const:`os.RTLD_LAZY`)." -msgid "Get the :term:`filesystem encoding `: the encoding used with the :term:`filesystem error handler ` to convert between Unicode filenames and bytes filenames. The filesystem error handler is returned from :func:`getfilesystemencodeerrors`." -msgstr "" +msgid "" +"Get the :term:`filesystem encoding `: the encoding used with the :term:`filesystem error handler " +"` to convert between Unicode " +"filenames and bytes filenames. The filesystem error handler is returned " +"from :func:`getfilesystemencodeerrors`." +msgstr "" +":term:`کدگذاری سیستم‌فایل ` را دریافت " +"کنید: کدگذاری‌ای که همراه با :term:`مدیر خطای سیستم‌فایل ` برای تبدیل بین نام فایل‌های یونیکدی و نام فایل‌های بایتی " +"استفاده می‌شود. مدیر خطای سیستم‌فایل از :func:`getfilesystemencodeerrors` " +"بازگردانده می‌شود." -msgid "For best compatibility, str should be used for filenames in all cases, although representing filenames as bytes is also supported. Functions accepting or returning filenames should support either str or bytes and internally convert to the system's preferred representation." +msgid "" +"For best compatibility, str should be used for filenames in all cases, " +"although representing filenames as bytes is also supported. Functions " +"accepting or returning filenames should support either str or bytes and " +"internally convert to the system's preferred representation." msgstr "" +"برای بیشترین سازگاری، باید در همه موارد برای نام فایل‌ها از str استفاده شود، " +"هرچند نمایش نام فایل‌ها به‌صورت bytes نیز پشتیبانی می‌شود. توابعی که نام " +"فایل‌ها را می‌پذیرند یا بازمی‌گردانند باید از str یا bytes پشتیبانی کنند و " +"آن‌ها را به‌صورت داخلی به نمایش ترجیحی سیستم تبدیل کنند." -msgid ":func:`os.fsencode` and :func:`os.fsdecode` should be used to ensure that the correct encoding and errors mode are used." +msgid "" +":func:`os.fsencode` and :func:`os.fsdecode` should be used to ensure that " +"the correct encoding and errors mode are used." msgstr "" +"باید از :func:`os.fsencode` و :func:`os.fsdecode` استفاده شود تا اطمینان " +"حاصل شود که کدگذاری و حالت خطاهای صحیح به کار می‌روند." -msgid "The :term:`filesystem encoding and error handler` are configured at Python startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +msgid "" +"The :term:`filesystem encoding and error handler` are configured at Python " +"startup by the :c:func:`PyConfig_Read` function: " +"see :c:member:`~PyConfig.filesystem_encoding` " +"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" +":term:`کدگذاری و مدیر خطای سیستم‌فایل ` در هنگام راه‌اندازی پایتون توسط تابع :c:func:`PyConfig_Read` " +"پیکربندی می‌شوند: اعضای :c:member:`~PyConfig.filesystem_encoding` " +"و :c:member:`~PyConfig.filesystem_errors` از :c:type:`PyConfig` را ببینید." msgid ":func:`getfilesystemencoding` result cannot be ``None`` anymore." -msgstr "" +msgstr "نتیجه‌ی :func:`getfilesystemencoding` دیگر نمی‌تواند ``None`` باشد." -msgid "Windows is no longer guaranteed to return ``'mbcs'``. See :pep:`529` and :func:`_enablelegacywindowsfsencoding` for more information." +msgid "" +"Windows is no longer guaranteed to return ``'mbcs'``. See :pep:`529` " +"and :func:`_enablelegacywindowsfsencoding` for more information." msgstr "" +"دیگر تضمین نمی‌شود که ویندوز ``'mbcs'`` را برگرداند. برای اطلاعات " +"بیشتر :pep:`529` و :func:`_enablelegacywindowsfsencoding` را ببینید." -msgid "Return ``'utf-8'`` if the :ref:`Python UTF-8 Mode ` is enabled." +msgid "" +"Return ``'utf-8'`` if the :ref:`Python UTF-8 Mode ` is enabled." msgstr "" +"اگر :ref:`حالت UTF-8 پایتون ` فعال باشد، ``'utf-8'`` را " +"برمی‌گرداند." -msgid "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding ` to convert between Unicode filenames and bytes filenames. The filesystem encoding is returned from :func:`getfilesystemencoding`." -msgstr "" +msgid "" +"Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " +"` to convert between Unicode " +"filenames and bytes filenames. The filesystem encoding is returned " +"from :func:`getfilesystemencoding`." +msgstr "" +"دریافت :term:`مدیر خطای سیستم‌فایل `: " +"مدیر خطایی که همراه با :term:`کدگذاری سیستم‌فایل ` برای تبدیل بین نام فایل‌های یونیکدی و نام فایل‌های بایتی " +"استفاده می‌شود. کدگذاری سیستم‌فایل از :func:`getfilesystemencoding` " +"بازگردانده می‌شود." -msgid "Returns the current value for the :ref:`integer string conversion length limitation `. See also :func:`set_int_max_str_digits`." +msgid "" +"Returns the current value for the :ref:`integer string conversion length " +"limitation `. See also :func:`set_int_max_str_digits`." msgstr "" +"مقدار فعلی :ref:`محدودیت طول تبدیل عدد صحیح به رشته ` " +"را برمی‌گرداند. همچنین :func:`set_int_max_str_digits` را ببینید." -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`." +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 "" +"تعداد ارجاع به *object* را برمی‌گرداند. تعداد برگردانده‌شده معمولاً یکی بیشتر " +"از مقداری است که ممکن است انتظار داشته باشید، زیرا ارجاع (موقت) به‌عنوان " +"آرگومان به :func:`getrefcount` را شامل می‌شود." -msgid "Note that the returned value may not actually reflect how many references to the object are actually held. For example, some objects are :term:`immortal` and have a very high refcount that does not reflect the actual number of references. Consequently, do not rely on the returned value to be accurate, other than a value of 0 or 1." -msgstr "" +msgid "" +"Note that the returned value may not actually reflect how many references " +"to the object are actually held. For example, some objects " +"are :term:`immortal` and have a very high refcount that does not reflect " +"the actual number of references. Consequently, do not rely on the returned " +"value to be accurate, other than a value of 0 or 1." +msgstr "" +"توجه داشته باشید که مقدار برگردانده‌شده ممکن است در عمل تعداد ارجاع‌های " +"نگهداری‌شده به شیء را نشان ندهد. برای مثال، برخی از شیء‌ها :term:`نامیرا " +"` هستند و شمارش ارجاع‌ها (refcount) بسیار بالایی دارند که تعداد " +"واقعی ارجاع‌ها را نشان نمی‌دهد. در نتیجه، به دقیق بودن مقدار برگردانده‌شده، " +"مگر برای مقدار ۰ یا ۱، اتکا نکنید." -msgid ":term:`Immortal ` objects with a large reference count can be identified via :func:`_is_immortal`." +msgid "" +":term:`Immortal ` objects with a large reference count can be " +"identified via :func:`_is_immortal`." msgstr "" +"اشیاء :term:`نامیرا ` با تعداد ارجاع زیاد را می‌توان از " +"طریق :func:`_is_immortal` شناسایی کرد." -msgid "Immortal objects have very large refcounts that do not match the actual number of references to the object." +msgid "" +"Immortal objects have very large refcounts that do not match the actual " +"number of references to the object." msgstr "" +"اشیاء نامیرا دارای شمارش ارجاع (refcount) بسیار بزرگی هستند که با تعداد " +"واقعی ارجاع‌ها به شیء مطابقت ندارد." -msgid "Return the current value of the recursion limit, the maximum depth of the Python interpreter stack. This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python. It can be set by :func:`setrecursionlimit`." +msgid "" +"Return the current value of the recursion limit, the maximum depth of the " +"Python interpreter stack. This limit prevents infinite recursion from " +"causing an overflow of the C stack and crashing Python. It can be set " +"by :func:`setrecursionlimit`." msgstr "" +"مقدار فعلی محدودیت بازگشت، یعنی حداکثر عمق پشته مفسر پایتون را برمی‌گرداند. " +"این محدودیت از سرریز پشته C و از کار افتادن پایتون در اثر بازگشت بی‌پایان " +"جلوگیری می‌کند. می‌توان آن را با :func:`setrecursionlimit` تنظیم کرد." -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." +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 "" +"اندازه‌ی یک شیء را بر حسب بایت برمی‌گرداند. شیء می‌تواند از هر نوعی باشد. همه‌ی " +"اشیای توکار نتایج درست را برمی‌گردانند، اما این موضوع لزوماً برای افزونه‌های " +"شخص ثالث صادق نیست، زیرا به پیاده‌سازی خاص وابسته است." -msgid "Only the memory consumption directly attributed to the object is accounted for, not the memory consumption of objects it refers to." +msgid "" +"Only the memory consumption directly attributed to the object is accounted " +"for, not the memory consumption of objects it refers to." msgstr "" +"تنها مصرف حافظه‌ای که مستقیماً به شیء نسبت داده می‌شود، محاسبه می‌شود، نه مصرف " +"حافظه‌ی اشیایی که به آن‌ها ارجاع می‌دهد." -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." +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 "" +"اگر داده شود، چنانچه شیء وسیله‌ای برای بازیابی اندازه فراهم نکند، *default* " +"برگردانده می‌شود. در غیر این صورت یک :exc:`TypeError` پرتاب می‌شود." -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." +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 "" +":func:`getsizeof` متد ``__sizeof__`` شیء را فراخوانی می‌کند و اگر شیء توسط " +"زباله‌رو مدیریت شود، سربار اضافی زباله‌رو را اضافه می‌کند." -msgid "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size of containers and all their contents." +msgid "" +"See `recursive sizeof recipe `_ for an example of " +"using :func:`getsizeof` recursively to find the size of containers and all " +"their contents." msgstr "" +"برای دیدن نمونه‌ای از استفاده‌ی بازگشتی از :func:`getsizeof` جهت یافتن اندازه‌ی " +"ظرف‌ها و تمام محتوای آن‌ها، `recursive sizeof recipe `_ را ببینید." -msgid "Return the interpreter's \"thread switch interval\" in seconds; see :func:`setswitchinterval`." +msgid "" +"Return the interpreter's \"thread switch interval\" in seconds; " +"see :func:`setswitchinterval`." msgstr "" +"بازه‌ی تعویض نخ مفسر را بر حسب ثانیه برمی‌گرداند؛ :func:`setswitchinterval` " +"را ببینید." -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. If that is deeper than the call stack, :exc:`ValueError` is raised. The default for *depth* is zero, returning the frame at the top of the call stack." -msgstr "" +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. " +"If that is deeper than the call stack, :exc:`ValueError` is raised. The " +"default for *depth* is zero, returning the frame at the top of the call " +"stack." +msgstr "" +"یک شیء فریم (frame object) از پشته فراخوانی برمی‌گرداند. اگر عدد صحیح " +"اختیاری *depth* داده شود، شیء فریمی را برمی‌گرداند که به آن تعداد فراخوانی " +"پایین‌تر از بالای پشته قرار دارد. اگر این مقدار از پشته فراخوانی عمیق‌تر " +"باشد، :exc:`ValueError` پرتاب می‌شود. مقدار پیش‌فرض برای *depth* صفر است و " +"فریم بالای پشته فراخوانی را برمی‌گرداند." -msgid "Raises an :ref:`auditing event ` ``sys._getframe`` with argument ``frame``." +msgid "" +"Raises an :ref:`auditing event ` ``sys._getframe`` with argument " +"``frame``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys._getframe`` را با آرگومان " +"``frame`` پرتاب می‌کند." -msgid "This function should be used for internal and specialized purposes only. It is not guaranteed to exist in all implementations of Python." +msgid "" +"This function should be used for internal and specialized purposes only. It " +"is not guaranteed to exist in all implementations of Python." msgstr "" +"این تابع باید تنها برای اهداف داخلی و تخصصی استفاده شود. وجود آن در تمام " +"پیاده‌سازی‌های پایتون تضمین نمی‌شود." -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 stack. If that is deeper than the call stack, or if the module is unidentifiable, ``None`` is returned. The default for *depth* is zero, returning the module at the top of the call stack." -msgstr "" +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 " +"stack. If that is deeper than the call stack, or if the module is " +"unidentifiable, ``None`` is returned. The default for *depth* is zero, " +"returning the module at the top of the call stack." +msgstr "" +"نام یک ماژول را از پشته فراخوانی برمی‌گرداند. اگر عدد صحیح اختیاری *depth* " +"داده شود، ماژولی را برمی‌گرداند که به همان تعداد فراخوانی از بالای پشته " +"پایین‌تر است. اگر آن عمیق‌تر از پشته فراخوانی باشد، یا اگر ماژول قابل شناسایی " +"نباشد، ``None`` برگردانده می‌شود. مقدار پیش‌فرض برای *depth* صفر است و ماژول " +"بالای پشته فراخوانی را برمی‌گرداند." -msgid "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with argument ``depth``." +msgid "" +"Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " +"argument ``depth``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys._getframemodulename`` را با آرگومان " +"``depth`` پرتاب می‌کند." -msgid "This function only exists if CPython was built using the specialized configure option :option:`--with-trace-refs`. It is intended only for debugging garbage-collection issues." +msgid "" +"This function only exists if CPython was built using the specialized " +"configure option :option:`--with-trace-refs`. It is intended only for " +"debugging garbage-collection issues." msgstr "" +"این تابع تنها در صورتی وجود دارد که CPython با استفاده از گزینه‌ی تخصصی " +"configure :option:`--with-trace-refs` ساخته شده باشد. این تابع فقط برای " +"اشکال‌زدایی مسائل مربوط به زباله‌روبی در نظر گرفته شده است." -msgid "Return a list of up to *limit* dynamically allocated Python objects. If *type* is given, only objects of that exact type (not subtypes) are included." +msgid "" +"Return a list of up to *limit* dynamically allocated Python objects. If " +"*type* is given, only objects of that exact type (not subtypes) are " +"included." msgstr "" +"فهرستی از حداکثر *limit* شیء پایتون با تخصیص پویا برمی‌گرداند. اگر *type* " +"داده شده باشد، فقط اشیای همان نوع دقیق (نه زیرنوع‌ها) گنجانده می‌شوند." -msgid "Objects from the list are not safe to use. Specifically, the result will include objects from all interpreters that share their object allocator state (that is, ones created with :c:member:`PyInterpreterConfig.use_main_obmalloc` set to 1 or using :c:func:`Py_NewInterpreter`, and the :ref:`main interpreter `). Mixing objects from different interpreters may lead to crashes or other unexpected behavior." -msgstr "" +msgid "" +"Objects from the list are not safe to use. Specifically, the result will " +"include objects from all interpreters that share their object allocator " +"state (that is, ones created " +"with :c:member:`PyInterpreterConfig.use_main_obmalloc` set to 1 or " +"using :c:func:`Py_NewInterpreter`, and the :ref:`main interpreter `). Mixing objects from different interpreters may lead " +"to crashes or other unexpected behavior." +msgstr "" +"استفاده از اشیای موجود در فهرست ایمن نیست. به‌طور مشخص، نتیجه شامل اشیای " +"تمام مفسرهایی خواهد بود که وضعیت تخصیص‌دهنده‌ی اشیای خود را به اشتراک می‌گذارند " +"(یعنی مفسرهایی که با :c:member:`PyInterpreterConfig.use_main_obmalloc` " +"تنظیم‌شده روی ۱ یا با استفاده از :c:func:`Py_NewInterpreter` ایجادشده‌اند، و " +"نیز :ref:`مفسر اصلی `). ترکیب اشیای مفسرهای مختلف " +"ممکن است منجر به فروپاشی یا سایر رفتارهای غیرمنتظره شود." -msgid "This function should be used for specialized purposes only. It is not guaranteed to exist in all implementations of Python." +msgid "" +"This function should be used for specialized purposes only. It is not " +"guaranteed to exist in all implementations of Python." msgstr "" +"این تابع باید تنها برای اهداف تخصصی استفاده شود. وجود آن در تمام " +"پیاده‌سازی‌های پایتون تضمین نمی‌شود." msgid "The result may include objects from other interpreters." -msgstr "" +msgstr "نتیجه ممکن است شامل اشیایی از مفسرهای دیگر باشد." msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" +"تابع پروفایلر (profiler) تنظیم‌شده توسط :func:`setprofile` را دریافت کنید." msgid "Get the trace function as set by :func:`settrace`." -msgstr "" +msgstr "تابع ردگیری تنظیم‌شده توسط :func:`settrace` را دریافت کنید." -msgid "The :func:`gettrace` function is intended only for implementing debuggers, profilers, coverage tools and the like. Its behavior is part of the implementation platform, rather than part of the language definition, and thus may not be available in all Python implementations." +msgid "" +"The :func:`gettrace` function is intended only for implementing debuggers, " +"profilers, coverage tools and the like. Its behavior is part of the " +"implementation platform, rather than part of the language definition, and " +"thus may not be available in all Python implementations." msgstr "" +"تابع :func:`gettrace` فقط برای پیاده‌سازی اشکال‌زداها، پروفایل‌گیرها، ابزارهای " +"پوشش و موارد مشابه در نظر گرفته شده است. رفتار آن بخشی از سکوی پیاده‌سازی " +"است، نه بخشی از تعریف زبان، و بنابراین ممکن است در تمام پیاده‌سازی‌های پایتون " +"در دسترس نباشد." -msgid "Return a named tuple describing the Windows version currently running. The named elements are *major*, *minor*, *build*, *platform*, *service_pack*, *service_pack_minor*, *service_pack_major*, *suite_mask*, *product_type* and *platform_version*. *service_pack* contains a string, *platform_version* a 3-tuple and all other values are integers. The components can also be accessed by name, so ``sys.getwindowsversion()[0]`` is equivalent to ``sys.getwindowsversion().major``. For compatibility with prior versions, only the first 5 elements are retrievable by indexing." -msgstr "" +msgid "" +"Return a named tuple describing the Windows version currently running. The " +"named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " +"*service_pack_minor*, *service_pack_major*, *suite_mask*, *product_type* " +"and *platform_version*. *service_pack* contains a string, " +"*platform_version* a 3-tuple and all other values are integers. The " +"components can also be accessed by name, so ``sys.getwindowsversion()[0]`` " +"is equivalent to ``sys.getwindowsversion().major``. For compatibility with " +"prior versions, only the first 5 elements are retrievable by indexing." +msgstr "" +"یک تاپل نام‌دار (named tuple) را برمی‌گرداند که نسخه ویندوز در حال اجرا را " +"توصیف می‌کند. عناصر نام‌دار عبارت‌اند از *major*، *minor*، *build*، " +"*platform*، *service_pack*، *service_pack_minor*، *service_pack_major*، " +"*suite_mask*، *product_type* و *platform_version*. *service_pack* شامل یک " +"رشته است، *platform_version* یک تاپل ۳-تایی است و همه‌ی مقادیر دیگر عدد صحیح " +"هستند. کامپوننت‌ها را نیز می‌توان از طریق نام دسترسی داشت، بنابراین " +"``sys.getwindowsversion()[0]`` معادل ``sys.getwindowsversion().major`` است. " +"برای سازگاری با نسخه‌های پیشین، تنها ۵ عنصر نخست از طریق اندیس‌دهی قابل " +"بازیابی هستند." msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." -msgstr "" +msgstr "*platform* برابر با ``2`` (VER_PLATFORM_WIN32_NT) خواهد بود." msgid "*product_type* may be one of the following values:" -msgstr "" +msgstr "*product_type* می‌تواند یکی از مقادیر زیر باشد:" msgid "Constant" -msgstr "" +msgstr "ثابت" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "``1`` (VER_NT_WORKSTATION)" -msgstr "" +msgstr "``1`` (VER_NT_WORKSTATION)" msgid "The system is a workstation." -msgstr "" +msgstr "این سیستم یک ایستگاه کاری است." msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" -msgstr "" +msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgid "The system is a domain controller." -msgstr "" +msgstr "این سیستم یک کنترل‌کننده دامنه است." msgid "``3`` (VER_NT_SERVER)" -msgstr "" +msgstr "``3`` (VER_NT_SERVER)" msgid "The system is a server, but not a domain controller." -msgstr "" +msgstr "این سیستم یک سرور است، اما کنترل‌کننده دامنه نیست." -msgid "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information about these fields." +msgid "" +"This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " +"Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " +"about these fields." msgstr "" +"این تابع، پوششی برای تابع Win32 :c:func:`!GetVersionEx` است؛ برای اطلاعات " +"بیشتر درباره این فیلدها، به مستندات مایکروسافت درباره :c:func:`!" +"OSVERSIONINFOEX` مراجعه کنید." -msgid "*platform_version* returns the major version, minor version and build number of the current operating system, rather than the version that is being emulated for the process. It is intended for use in logging rather than for feature detection." +msgid "" +"*platform_version* returns the major version, minor version and build " +"number of the current operating system, rather than the version that is " +"being emulated for the process. It is intended for use in logging rather " +"than for feature detection." msgstr "" +"*platform_version* نسخه‌ی اصلی، نسخه‌ی فرعی و شماره‌ی ساخت سیستم‌عامل جاری را " +"برمی‌گرداند، نه نسخه‌ای که برای فرایند شبیه‌سازی می‌شود. این برای استفاده در " +"گزارش‌گیری (logging) در نظر گرفته شده است، نه برای تشخیص قابلیت‌ها." -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." +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 "" +"*platform_version* نسخه را از kernel32.dll استخراج می‌کند که ممکن است نسخه‌ای " +"متفاوت از نسخه سیستم‌عامل داشته باشد. لطفاً برای به‌دست آوردن نسخه دقیق " +"سیستم‌عامل از ماژول :mod:`platform` استفاده کنید." -msgid "Changed to a named tuple and added *service_pack_minor*, *service_pack_major*, *suite_mask*, and *product_type*." +msgid "" +"Changed to a named tuple and added *service_pack_minor*, " +"*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" +"به یک تاپل نام‌دار (named tuple) تغییر یافت و *service_pack_minor*، " +"*service_pack_major*، *suite_mask* و *product_type* به آن افزوده شدند." msgid "Added *platform_version*" -msgstr "" +msgstr "*platform_version* اضافه شد" -msgid "Returns an *asyncgen_hooks* object, which is similar to a :class:`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where *firstiter* and *finalizer* are expected to be either ``None`` or functions which take an :term:`asynchronous generator iterator` as an argument, and are used to schedule finalization of an asynchronous generator by an event loop." -msgstr "" +msgid "" +"Returns an *asyncgen_hooks* object, which is similar to " +"a :class:`~collections.namedtuple` of the form ``(firstiter, finalizer)``, " +"where *firstiter* and *finalizer* are expected to be either ``None`` or " +"functions which take an :term:`asynchronous generator iterator` as an " +"argument, and are used to schedule finalization of an asynchronous " +"generator by an event loop." +msgstr "" +"یک شیء *asyncgen_hooks* برمی‌گرداند، که شبیه به " +"یک :class:`~collections.namedtuple` به شکل ``(firstiter, finalizer)`` است و " +"در آن *firstiter* و *finalizer* انتظار می‌رود یا ``None`` باشند یا توابعی که " +"یک :term:`asynchronous generator iterator` را به‌عنوان آرگومان می‌پذیرند و " +"برای زمان‌بندی نهایی‌سازی یک تولیدگر ناهمگام توسط یک حلقه رویداد استفاده " +"می‌شوند." msgid "See :pep:`525` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر :pep:`525` را ببینید." -msgid "This function has been added on a provisional basis (see :pep:`411` for details.)" +msgid "" +"This function has been added on a provisional basis (see :pep:`411` for " +"details.)" msgstr "" +"این تابع به‌صورت آزمایشی افزوده شده است (برای جزئیات، :pep:`411` را ببینید.)" -msgid "Get the current coroutine origin tracking depth, as set by :func:`set_coroutine_origin_tracking_depth`." +msgid "" +"Get the current coroutine origin tracking depth, as set " +"by :func:`set_coroutine_origin_tracking_depth`." msgstr "" +"عمق فعلی پیگیری مبدأ هم‌روال را، که " +"توسط :func:`set_coroutine_origin_tracking_depth` تنظیم شده است، دریافت کنید." -msgid "This function has been added on a provisional basis (see :pep:`411` for details.) Use it only for debugging purposes." +msgid "" +"This function has been added on a provisional basis (see :pep:`411` for " +"details.) Use it only for debugging purposes." msgstr "" +"این تابع به‌صورت موقت افزوده شده است (برای جزئیات :pep:`411` را ببینید). از " +"آن فقط برای اهداف اشکال‌زدایی استفاده کنید." -msgid "A :term:`named tuple` giving parameters of the numeric hash implementation. For more details about hashing of numeric types, see :ref:`numeric-hash`." +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 "" +"یک :term:`named tuple` که پارامترهای پیاده‌سازی هش عددی را ارائه می‌دهد. برای " +"جزئیات بیشتر درباره‌ی هش انواع عددی، :ref:`numeric-hash` را ببینید." msgid "The width in bits used for hash values" -msgstr "" +msgstr "عرض بر حسب بیت برای مقادیر هش" msgid "The prime modulus P used for numeric hash scheme" -msgstr "" +msgstr "پیمانه اول P که برای طرح‌واره هش عددی استفاده می‌شود" msgid "The hash value returned for a positive infinity" -msgstr "" +msgstr "مقدار هش بازگشت‌داده‌شده برای بی‌نهایت مثبت" msgid "(This attribute is no longer used)" -msgstr "" +msgstr "(این ویژگی دیگر استفاده نمی‌شود)" msgid "The multiplier used for the imaginary part of a complex number" -msgstr "" +msgstr "ضریب استفاده‌شده برای بخش موهومی یک عدد مختلط" msgid "The name of the algorithm for hashing of str, bytes, and memoryview" -msgstr "" +msgstr "نام الگوریتم هش برای str، bytes و memoryview" msgid "The internal output size of the hash algorithm" -msgstr "" +msgstr "اندازه‌ی خروجی داخلی الگوریتم هش" msgid "The size of the seed key of the hash algorithm" -msgstr "" +msgstr "اندازه‌ی کلید دانه (seed key) الگوریتم هش" msgid "Cutoff for small string DJBX33A optimization in range ``[1, cutoff)``." msgstr "" +"آستانه برای بهینه‌سازی DJBX33A برای رشته‌های کوچک در بازه‌ی ``[1, cutoff)``." msgid "Added *algorithm*, *hash_bits*, *seed_bits*, and *cutoff*." -msgstr "" +msgstr "*algorithm*، *hash_bits*، *seed_bits* و *cutoff* افزوده شدند." -msgid "The version number encoded as a single integer. This is guaranteed to increase with each version, including proper support for non-production releases. For example, to test that the Python interpreter is at least version 1.5.2, use::" +msgid "" +"The version number encoded as a single integer. This is guaranteed to " +"increase with each version, including proper support for non-production " +"releases. For example, to test that the Python interpreter is at least " +"version 1.5.2, use::" msgstr "" +"شماره‌ی نسخه به‌صورت یک عدد صحیح واحد کدگذاری‌شده است. تضمین می‌شود که این " +"شماره با هر نسخه افزایش یابد، از جمله با پشتیبانی مناسب از نسخه‌های " +"غیرنهایی. برای مثال، برای بررسی اینکه مفسر پایتون دست‌کم نسخه‌ی 1.5.2 باشد، " +"به این ترتیب عمل کنید::" msgid "" "if sys.hexversion >= 0x010502F0:\n" @@ -748,105 +1695,292 @@ msgid "" " # use an alternative implementation or warn the user\n" " ..." msgstr "" +"if sys.hexversion >= 0x010502F0:\n" +" # use some advanced feature\n" +" ...\n" +"else:\n" +" # use an alternative implementation or warn the user\n" +" ..." -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. The :term:`named tuple` :data:`sys.version_info` may be used for a more human-friendly encoding of the same information." +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. " +"The :term:`named tuple` :data:`sys.version_info` may be used for a more " +"human-friendly encoding of the same information." msgstr "" +"این ``hexversion`` نامیده می‌شود، زیرا تنها زمانی واقعاً معنادار به نظر می‌رسد " +"که به‌عنوان نتیجه‌ی ارسال آن به تابع توکار :func:`hex` مشاهده شود. برای " +"کدگذاری انسان‌پسندترِ همین اطلاعات می‌توان از :term:`named " +"tuple` :data:`sys.version_info` استفاده کرد." msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" +"جزئیات بیشتر در مورد ``hexversion`` را می‌توان در :ref:`apiabiversion` یافت." -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." +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 "" +"شیء حاوی اطلاعات درباره‌ی پیاده‌سازی مفسر پایتون در حال اجرا. ویژگی‌های زیر " +"باید در تمام پیاده‌سازی‌های پایتون وجود داشته باشند." -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." +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 "" +"*name* شناسه‌ی پیاده‌سازی است، برای مثال ``'cpython'``. رشته‌ی واقعی توسط " +"پیاده‌سازی پایتون تعریف می‌شود، اما تضمین می‌شود که با حروف کوچک باشد." -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 distinct meaning from the specific version of the Python *language* to which the currently running interpreter conforms, which ``sys.version_info`` represents. For example, for PyPy 1.8 ``sys.implementation.version`` might be ``sys.version_info(1, 8, 0, 'final', 0)``, whereas ``sys.version_info`` would be ``sys.version_info(2, 7, 2, 'final', 0)``. For CPython they are the same value, since it is the reference implementation." -msgstr "" +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 distinct meaning from the specific version of " +"the Python *language* to which the currently running interpreter conforms, " +"which ``sys.version_info`` represents. For example, for PyPy 1.8 " +"``sys.implementation.version`` might be ``sys.version_info(1, 8, 0, " +"'final', 0)``, whereas ``sys.version_info`` would be ``sys.version_info(2, " +"7, 2, 'final', 0)``. For CPython they are the same value, since it is the " +"reference implementation." +msgstr "" +"*version* یک تاپل نام‌دار (named tuple) است، با همان " +"قالب :data:`sys.version_info`. این، نسخه‌ی *پیاده‌سازی* پایتون را نشان می‌دهد. " +"این معنایی متمایز از نسخه‌ی مشخص *زبان* پایتون دارد که مفسر در حال اجرا با " +"آن مطابقت دارد و ``sys.version_info`` آن را نشان می‌دهد. برای مثال، برای " +"PyPy 1.8 ممکن است ``sys.implementation.version`` برابر " +"``sys.version_info(1, 8, 0, 'final', 0)`` باشد، در حالی که " +"``sys.version_info`` برابر ``sys.version_info(2, 7, 2, 'final', 0)`` خواهد " +"بود. برای CPython، این دو مقدار یکسانی دارند، زیرا این پیاده‌سازی مرجع است." -msgid "*hexversion* is the implementation version in hexadecimal format, like :data:`sys.hexversion`." +msgid "" +"*hexversion* is the implementation version in hexadecimal format, " +"like :data:`sys.hexversion`." msgstr "" +"*hexversion* نسخه‌ی پیاده‌سازی در قالب مبنای شانزده است، " +"مانند :data:`sys.hexversion`." -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 implementation's name and version, like ``'cpython-33'``. However, a Python implementation may use some other value if appropriate. If ``cache_tag`` is set to ``None``, it indicates that module caching should be disabled." -msgstr "" +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 " +"implementation's name and version, like ``'cpython-33'``. However, a " +"Python implementation may use some other value if appropriate. If " +"``cache_tag`` is set to ``None``, it indicates that module caching should " +"be disabled." +msgstr "" +"*cache_tag* برچسبی است که سازوکار ایمپورت آن را در نام فایل‌های ماژول‌های " +"نهان‌شده به کار می‌برد. طبق قرارداد، این برچسب ترکیبی از نام و نسخه پیاده‌سازی " +"است، مانند ``'cpython-33'``. با این حال، یک پیاده‌سازی پایتون ممکن است در " +"صورت مناسب بودن از مقدار دیگری استفاده کند. اگر ``cache_tag`` روی ``None`` " +"تنظیم شود، نشان می‌دهد که نهان‌سازی ماژول باید غیرفعال شود." -msgid "*supports_isolated_interpreters* is a boolean value, whether this implementation supports multiple isolated interpreters. It is ``True`` for CPython on most platforms. Platforms with this support implement the low-level :mod:`!_interpreters` module." +msgid "" +"*supports_isolated_interpreters* is a boolean value, whether this " +"implementation supports multiple isolated interpreters. It is ``True`` for " +"CPython on most platforms. Platforms with this support implement the low-" +"level :mod:`!_interpreters` module." msgstr "" +"*supports_isolated_interpreters* یک مقدار بولی است که نشان می‌دهد آیا این " +"پیاده‌سازی از چندین مفسر جداشده پشتیبانی می‌کند یا خیر. این مقدار برای " +"CPython در بیشتر سکوها ``True`` است. سکوهای دارای این پشتیبانی، ماژول سطح " +"پایین :mod:`!_interpreters` را پیاده‌سازی می‌کنند." msgid ":pep:`684`, :pep:`734`, and :mod:`concurrent.interpreters`." -msgstr "" +msgstr ":pep:`684`، :pep:`734` و :mod:`concurrent.interpreters`." -msgid ":data:`sys.implementation` may contain additional attributes specific to the Python implementation. These non-standard attributes must start with an underscore, and are not described here. Regardless of its contents, :data:`sys.implementation` will not change during a run of the interpreter, nor between implementation versions. (It may change between Python language versions, however.) See :pep:`421` for more information." -msgstr "" +msgid "" +":data:`sys.implementation` may contain additional attributes specific to " +"the Python implementation. These non-standard attributes must start with " +"an underscore, and are not described here. Regardless of its " +"contents, :data:`sys.implementation` will not change during a run of the " +"interpreter, nor between implementation versions. (It may change between " +"Python language versions, however.) See :pep:`421` for more information." +msgstr "" +":data:`sys.implementation` ممکن است شامل ویژگی‌های اضافی مختص پیاده‌سازی " +"پایتون باشد. این ویژگی‌های غیراستاندارد باید با یک زیرخط شروع شوند و در " +"اینجا توصیف نشده‌اند. صرف‌نظر از محتوای آن، :data:`sys.implementation` در طول " +"اجرای مفسر، و نه بین نسخه‌های پیاده‌سازی، تغییر نخواهد کرد. (البته ممکن است " +"بین نسخه‌های زبان پایتون تغییر کند.) برای اطلاعات بیشتر :pep:`421` را ببینید." msgid "Added ``supports_isolated_interpreters`` field." -msgstr "" +msgstr "فیلد ``supports_isolated_interpreters`` افزوده شد." -msgid "The addition of new required attributes must go through the normal PEP process. See :pep:`421` for more information." +msgid "" +"The addition of new required attributes must go through the normal PEP " +"process. See :pep:`421` for more information." msgstr "" +"افزودن ویژگی‌های الزامی جدید باید از طریق فرایند عادی PEP انجام شود. برای " +"اطلاعات بیشتر :pep:`421` را ببینید." -msgid "A :term:`named tuple` that holds information about Python's internal representation of integers. The attributes are read only." +msgid "" +"A :term:`named tuple` that holds information about Python's internal " +"representation of integers. The attributes are read only." msgstr "" +"یک :term:`named tuple` که حاوی اطلاعاتی درباره بازنمایی داخلی پایتون از " +"اعداد صحیح است. ویژگی‌ها فقط‌خواندنی هستند." -msgid "The number of bits held in each digit. Python integers are stored internally in base ``2**int_info.bits_per_digit``." +msgid "" +"The number of bits held in each digit. Python integers are stored " +"internally in base ``2**int_info.bits_per_digit``." msgstr "" +"تعداد بیت‌هایی که در هر رقم نگه داشته می‌شود. اعداد صحیح پایتون به‌صورت داخلی " +"در مبنای ``2**int_info.bits_per_digit`` ذخیره می‌شوند." msgid "The size in bytes of the C type used to represent a digit." -msgstr "" +msgstr "اندازه‌ی نوع C استفاده‌شده برای نمایش یک رقم، بر حسب بایت." -msgid "The default value for :func:`sys.get_int_max_str_digits` when it is not otherwise explicitly configured." +msgid "" +"The default value for :func:`sys.get_int_max_str_digits` when it is not " +"otherwise explicitly configured." msgstr "" +"مقدار پیش‌فرض برای :func:`sys.get_int_max_str_digits` هنگامی که به‌گونه‌ای " +"دیگر به‌صورت صریح پیکربندی نشده باشد." -msgid "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." +msgid "" +"The minimum non-zero value " +"for :func:`sys.set_int_max_str_digits`, :envvar:`PYTHONINTMAXSTRDIGITS`, " +"or :option:`-X int_max_str_digits <-X>`." msgstr "" +"کمترین مقدار غیرصفر " +"برای :func:`sys.set_int_max_str_digits`، :envvar:`PYTHONINTMAXSTRDIGITS`، " +"یا :option:`-X int_max_str_digits <-X>`." -msgid "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info.str_digits_check_threshold`." +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` افزوده شدند." -msgid "When this attribute exists, its value is automatically called (with no arguments) when the interpreter is launched in :ref:`interactive mode `. This is done after the :envvar:`PYTHONSTARTUP` file is read, so that you can set this hook there. The :mod:`site` module :ref:`sets this `." -msgstr "" +msgid "" +"When this attribute exists, its value is automatically called (with no " +"arguments) when the interpreter is launched in :ref:`interactive mode `. This is done after the :envvar:`PYTHONSTARTUP` file is " +"read, so that you can set this hook there. The :mod:`site` " +"module :ref:`sets this `." +msgstr "" +"هنگامی که این ویژگی وجود داشته باشد، مقدار آن به‌طور خودکار (بدون آرگومان) " +"در زمان راه‌اندازی مفسر در :ref:`حالت تعاملی ` فراخوانی " +"می‌شود. این کار پس از خوانده شدن فایل :envvar:`PYTHONSTARTUP` انجام می‌شود، " +"تا بتوانید این قلاب را آنجا تنظیم کنید. ماژول :mod:`site` :ref:`این را " +"تنظیم می‌کند `." -msgid "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` with the hook object as the argument when the hook is called on startup." +msgid "" +"Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " +"with the hook object as the argument when the hook is called on startup." msgstr "" +"هنگامی که قلابدر راه‌اندازی فراخوانی می‌شود، یک :ref:`رویداد حسابرسی " +"` ``cpython.run_interactivehook`` را با شیء قلاب به‌عنوان آرگومان " +"پرتاب می‌کند." -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 gain a little performance on dictionary lookup -- if the keys in a dictionary are interned, and the lookup key is interned, the key comparisons (after hashing) can be done by a pointer compare instead of a string compare. Normally, the names used in Python programs are automatically interned, and the dictionaries used to hold module, class or instance attributes have interned keys." -msgstr "" +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 gain a little performance on dictionary lookup -- if the keys in a " +"dictionary are interned, and the lookup key is interned, the key " +"comparisons (after hashing) can be done by a pointer compare instead of a " +"string compare. Normally, the names used in Python programs are " +"automatically interned, and the dictionaries used to hold module, class or " +"instance attributes have interned keys." +msgstr "" +"*string* را در جدول رشته‌های «اینترن‌شده» (interned) وارد می‌کند و رشته‌ی " +"اینترن‌شده را برمی‌گرداند — که خود *string* یا یک کپی از آن است. اینترن‌کردن " +"رشته‌ها برای افزایش اندک کارایی در جستجوی دیکشنری مفید است — اگر کلیدهای یک " +"دیکشنری اینترن‌شده باشند و کلید مورد جستجو نیز اینترن‌شده باشد، مقایسه‌های " +"کلید (پس از هش‌شدن) می‌توانند به‌جای مقایسه‌ی رشته‌ای، با مقایسه‌ی اشاره‌گر انجام " +"شوند. به‌طور معمول، نام‌های استفاده‌شده در برنامه‌های پایتون به‌طور خودکار " +"اینترن می‌شوند و دیکشنری‌های مورد استفاده برای نگه‌داری ویژگی‌های ماژول، کلاس " +"یا نمونه، کلیدهای اینترن‌شده دارند." -msgid "Interned strings are not :term:`immortal`; you must keep a reference to the return value of :func:`intern` around to benefit from it." +msgid "" +"Interned strings are not :term:`immortal`; you must keep a reference to the " +"return value of :func:`intern` around to benefit from it." msgstr "" +"رشته‌های internشده :term:`نامیرا ` نیستند؛ برای بهره‌مندی از آن، " +"باید ارجاعی به مقدار بازگشتی :func:`intern` را نگه‌دارید." -msgid "Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it is disabled." +msgid "" +"Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it " +"is disabled." msgstr "" +"اگر :term:`GIL` فعال باشد، :const:`True` و اگر غیرفعال باشد، :const:`False` " +"را برمی‌گرداند." msgid "It is not guaranteed to exist in all implementations of Python." -msgstr "" +msgstr "تضمینی برای وجود آن در همه پیاده‌سازی‌های پایتون وجود ندارد." -msgid "Return :const:`True` if the main Python interpreter is :term:`shutting down `. Return :const:`False` otherwise." +msgid "" +"Return :const:`True` if the main Python interpreter is :term:`shutting down " +"`. Return :const:`False` otherwise." msgstr "" +"اگر مفسر اصلی پایتون :term:`در حال خاموش شدن ` " +"باشد، :const:`True` را برمی‌گرداند. در غیر این صورت :const:`False` را " +"برمی‌گرداند." msgid "See also the :exc:`PythonFinalizationError` exception." -msgstr "" +msgstr "همچنین استثنا :exc:`PythonFinalizationError` را ببینید." msgid "Utilities for observing just-in-time compilation." -msgstr "" +msgstr "ابزارهایی برای مشاهده‌ی کامپایل در لحظه (just-in-time compilation)." -msgid "JIT compilation is an *experimental implementation detail* of CPython. ``sys._jit`` is not guaranteed to exist or behave the same way in all Python implementations, versions, or build configurations." +msgid "" +"JIT compilation is an *experimental implementation detail* of CPython. " +"``sys._jit`` is not guaranteed to exist or behave the same way in all " +"Python implementations, versions, or build configurations." msgstr "" +"کامپایل JIT (JIT compilation) یک *جزئیات پیاده‌سازی آزمایشی* در CPython است. " +"تضمینی وجود ندارد که ``sys._jit`` در تمام پیاده‌سازی‌ها، نسخه‌ها یا " +"پیکربندی‌های ساخت پایتون وجود داشته باشد یا رفتار یکسانی داشته باشد." -msgid "Return ``True`` if the current Python executable supports JIT compilation, and ``False`` otherwise. This can be controlled by building CPython with the ``--experimental-jit`` option on Windows, and the :option:`--enable-experimental-jit` option on all other platforms." +msgid "" +"Return ``True`` if the current Python executable supports JIT compilation, " +"and ``False`` otherwise. This can be controlled by building CPython with " +"the ``--experimental-jit`` option on Windows, and the :option:`--enable-" +"experimental-jit` option on all other platforms." msgstr "" +"اگر فایل اجرایی پایتون جاری از کامپایل JIT پشتیبانی کند، ``True`` را " +"برمی‌گرداند و در غیر این صورت ``False`` را برمی‌گرداند. این موضوع را می‌توان " +"با ساخت CPython با گزینه‌ی ``--experimental-jit`` در ویندوز و " +"گزینه‌ی :option:`--enable-experimental-jit` در همه‌ی پلتفرم‌های دیگر کنترل کرد." -msgid "Return ``True`` if JIT compilation is enabled for the current Python process (implies :func:`sys._jit.is_available`), and ``False`` otherwise. If JIT compilation is available, this can be controlled by setting the :envvar:`PYTHON_JIT` environment variable to ``0`` (disabled) or ``1`` (enabled) at interpreter startup." -msgstr "" +msgid "" +"Return ``True`` if JIT compilation is enabled for the current Python " +"process (implies :func:`sys._jit.is_available`), and ``False`` otherwise. " +"If JIT compilation is available, this can be controlled by setting " +"the :envvar:`PYTHON_JIT` environment variable to ``0`` (disabled) or ``1`` " +"(enabled) at interpreter startup." +msgstr "" +"اگر کامپایل JIT برای فرآیند پایتون جاری فعال باشد، ``True`` را برمی‌گرداند " +"(که مستلزم برقراری :func:`sys._jit.is_available` است) و در غیر این صورت " +"``False`` را برمی‌گرداند. اگر کامپایل JIT در دسترس باشد، می‌توان این وضعیت را " +"با تنظیم متغیر محیطی :envvar:`PYTHON_JIT` بر روی ``0`` (غیرفعال) یا ``1`` " +"(فعال) در زمان راه‌اندازی مفسر کنترل کرد." -msgid "Return ``True`` if the topmost Python frame is currently executing JIT code (implies :func:`sys._jit.is_enabled`), and ``False`` otherwise." +msgid "" +"Return ``True`` if the topmost Python frame is currently executing JIT code " +"(implies :func:`sys._jit.is_enabled`), and ``False`` otherwise." msgstr "" +"اگر بالاترین فریمپایتون هم‌اکنون در حال اجرای کد JIT باشد، ``True`` " +"برمی‌گرداند (به این معنا که :func:`sys._jit.is_enabled` نیز برقرار است) و در " +"غیر این صورت ``False`` برمی‌گرداند." -msgid "This function is intended for testing and debugging the JIT itself. It should be avoided for any other purpose." +msgid "" +"This function is intended for testing and debugging the JIT itself. It " +"should be avoided for any other purpose." msgstr "" +"این تابع برای آزمون و اشکال‌زدایی خود JIT در نظر گرفته شده است. باید از " +"استفاده از آن برای هر هدف دیگری پرهیز شود." -msgid "Due to the nature of tracing JIT compilers, repeated calls to this function may give surprising results. For example, branching on its return value will likely lead to unexpected behavior (if doing so causes JIT code to be entered or exited):" +msgid "" +"Due to the nature of tracing JIT compilers, repeated calls to this function " +"may give surprising results. For example, branching on its return value " +"will likely lead to unexpected behavior (if doing so causes JIT code to be " +"entered or exited):" msgstr "" +"به دلیل ماهیت کامپایلرهای JIT مبتنی بر ردگیری (tracing JIT compilers)، " +"فراخوانی‌های مکرر این تابع ممکن است نتایج غافلگیرکننده‌ای بدهند. برای مثال، " +"انشعاب بر اساس مقدار بازگشتی آن احتمالاً به رفتار غیرمنتظره‌ای منجر می‌شود " +"(اگر این کار باعث ورود به کد JIT یا خروج از آن شود):" msgid "" ">>> for warmup in range(BIG_NUMBER):\n" @@ -861,651 +1995,1524 @@ msgid "" " ~~~~~~~~~~~~~~~~~~^^\n" "AssertionError" msgstr "" +">>> for warmup in range(BIG_NUMBER):\n" +"... # This line is \"hot\", and is eventually JIT-compiled:\n" +"... if sys._jit.is_active():\n" +"... # This line is \"cold\", and is run in the interpreter:\n" +"... assert sys._jit.is_active()\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 5, in \n" +" assert sys._jit.is_active()\n" +" ~~~~~~~~~~~~~~~~~~^^\n" +"AssertionError" -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 and a stack traceback. Its intended use is to allow an interactive user to import a debugger module and engage in post-mortem debugging without having to re-execute the command that caused the error. (Typical use is ``import pdb; pdb.pm()`` to enter the post-mortem debugger; see :mod:`pdb` module for more information.)" -msgstr "" +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 and a stack traceback. Its intended use is to allow an interactive " +"user to import a debugger module and engage in post-mortem debugging " +"without having to re-execute the command that caused the error. (Typical " +"use is ``import pdb; pdb.pm()`` to enter the post-mortem debugger; " +"see :mod:`pdb` module for more information.)" +msgstr "" +"این متغیر همیشه تعریف‌شده نیست؛ هنگامی که یک استثنا مدیریت نشود و مفسر یک " +"پیام خطا و ردگیری پشته چاپ کند، این متغیر به نمونه استثنا تنظیم می‌شود. هدف " +"از آن این است که یک کاربر تعاملی بتواند یک ماژول اشکال‌زدا را ایمپورت کند و " +"بدون نیاز به اجرای دوباره دستوری که باعث خطا شده است، به اشکال‌زدایی پس از " +"خطا (post-mortem debugging) بپردازد. (استفاده معمول ``import pdb; " +"pdb.pm()`` برای ورود به اشکال‌زدای پس از خطا (post-mortem debugger) است؛ " +"برای اطلاعات بیشتر ماژول :mod:`pdb` را ببینید.)" -msgid "Return :const:`True` if the given object is :term:`immortal`, :const:`False` otherwise." +msgid "" +"Return :const:`True` if the given object " +"is :term:`immortal`, :const:`False` otherwise." msgstr "" +"اگر شیء داده‌شده :term:`نامیرا ` باشد، :const:`True` را " +"برمی‌گرداند، در غیر این صورت :const:`False` را برمی‌گرداند." -msgid "Objects that are immortal (and thus return ``True`` upon being passed to this function) are not guaranteed to be immortal in future versions, and vice versa for mortal objects." +msgid "" +"Objects that are immortal (and thus return ``True`` upon being passed to " +"this function) are not guaranteed to be immortal in future versions, and " +"vice versa for mortal objects." msgstr "" +"تضمین نمی‌شود که اشیایی که نامیرا هستند (و بنابراین هنگامی که به این تابع " +"پاس داده می‌شوند ``True`` را برمی‌گردانند) در نسخه‌های آینده نیز نامیرا باشند، " +"و برعکس برای اشیای فانی." -msgid "Return :const:`True` if the given string is \"interned\", :const:`False` otherwise." +msgid "" +"Return :const:`True` if the given string is \"interned\", :const:`False` " +"otherwise." msgstr "" +"اگر رشته‌ی داده‌شده «اینترن‌شده» (interned) باشد، :const:`True` و در غیر این " +"صورت :const:`False` برمی‌گرداند." -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." +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 "" +"این سه متغیر منسوخ شده‌اند؛ به‌جای آن‌ها از :data:`sys.last_exc` استفاده کنید. " +"آن‌ها نمایش قدیمی ``sys.last_exc`` را نگه می‌دارند، همان‌طور که " +"از :func:`exc_info` در بالا برگردانده شده است." -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." +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 "" +"یک عدد صحیح که بیشینه مقداری را که یک متغیر از نوع :c:type:`Py_ssize_t` " +"می‌تواند بگیرد، مشخص می‌کند. این مقدار معمولاً در پلتفرم ۳۲ بیتی ``2**31 - 1`` " +"و در پلتفرم ۶۴ بیتی ``2**63 - 1`` است." -msgid "An integer giving the value of the largest Unicode code point, i.e. ``1114111`` (``0x10FFFF`` in hexadecimal)." +msgid "" +"An integer giving the value of the largest Unicode code point, i.e. " +"``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" +"یک عدد صحیح که مقدار بزرگ‌ترین نقطه کد یونیکد را می‌دهد، یعنی ``1114111`` " +"(``0x10FFFF`` در مبنای شانزده)." -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." +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 "" +"پیش از :pep:`393`، ``sys.maxunicode`` بسته به گزینه‌ی پیکربندی‌ای که مشخص " +"می‌کرد نویسه‌های یونیکد به‌صورت UCS-2 ذخیره می‌شوند یا UCS-4، یا ``0xFFFF`` بود " +"یا ``0x10FFFF``." -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 can find the module to be imported. By default, it holds entries that implement Python's default import semantics. The :meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with at least the absolute name of the module being imported. If the module to be imported is contained in a package, then the parent package's :attr:`~module.__path__` attribute is passed in as a second argument. The method returns a :term:`module spec`, or ``None`` if the module cannot be found." -msgstr "" +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 can find the module to be imported. By default, it " +"holds entries that implement Python's default import semantics. " +"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method is called with " +"at least the absolute name of the module being imported. If the module to " +"be imported is contained in a package, then the parent " +"package's :attr:`~module.__path__` attribute is passed in as a second " +"argument. The method returns a :term:`module spec`, or ``None`` if the " +"module cannot be found." +msgstr "" +"فهرستی از اشیای :term:`meta path finder` که " +"متدهای :meth:`~importlib.abc.MetaPathFinder.find_spec` آن‌ها فراخوانی می‌شوند " +"تا بررسی شود که آیا یکی از اشیاء می‌تواند ماژول موردنظر برای ایمپورت را پیدا " +"کند. به‌طور پیش‌فرض، این فهرست شامل ورودی‌هایی است که معنای پیش‌فرض ایمپورت " +"پایتون را پیاده‌سازی می‌کنند. " +"متد :meth:`~importlib.abc.MetaPathFinder.find_spec` حداقل با نام مطلق ماژول " +"در حال ایمپورت فراخوانی می‌شود. اگر ماژول موردنظر برای ایمپورت در یک بسته " +"قرار داشته باشد، در این صورت ویژگی :attr:`~module.__path__` بسته والد " +"به‌عنوان آرگومان دوم ارسال می‌شود. این متد یک :term:`module spec` برمی‌گرداند، " +"یا اگر ماژول یافت نشود، ``None`` برمی‌گرداند." msgid ":class:`importlib.abc.MetaPathFinder`" -msgstr "" +msgstr ":class:`importlib.abc.MetaPathFinder`" -msgid "The abstract base class defining the interface of finder objects on :data:`meta_path`." +msgid "" +"The abstract base class defining the interface of finder objects " +"on :data:`meta_path`." msgstr "" +"کلاس پایه انتزاعی که رابط اشیای یابنده (finder) را در :data:`meta_path` " +"تعریف می‌کند." msgid ":class:`importlib.machinery.ModuleSpec`" -msgstr "" +msgstr ":class:`importlib.machinery.ModuleSpec`" -msgid "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` should return instances of." +msgid "" +"The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " +"should return instances of." msgstr "" +"کلاس مشخصی که :meth:`~importlib.abc.MetaPathFinder.find_spec` باید " +"نمونه‌هایی از آن را برگرداند." -msgid ":term:`Module specs ` were introduced in Python 3.4, by :pep:`451`." +msgid "" +":term:`Module specs ` were introduced in Python 3.4, " +"by :pep:`451`." msgstr "" +":term:`مشخصات ماژول ` در پایتون 3.4 توسط :pep:`451` معرفی شدند." -msgid "Removed the fallback that looked for a :meth:`!find_module` method if a :data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." +msgid "" +"Removed the fallback that looked for a :meth:`!find_module` method if " +"a :data:`meta_path` entry didn't have " +"a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" +"مکانیزم جایگزینی که اگر یک آیتم از :data:`meta_path` " +"متد :meth:`~importlib.abc.MetaPathFinder.find_spec ` را " +"نداشت، به دنبال متد :meth:`!find_module " +"<~importlib.abc.MetaPathFinder.find_spec>` می‌گشت، حذف شد." -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 other tricks. However, replacing the dictionary will not necessarily work as expected and deleting essential items from the dictionary may cause Python to fail. If you want to iterate over this global dictionary always use ``sys.modules.copy()`` or ``tuple(sys.modules)`` to avoid exceptions as its size may change during iteration as a side effect of code or activity in other threads." -msgstr "" +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 " +"other tricks. However, replacing the dictionary will not necessarily work " +"as expected and deleting essential items from the dictionary may cause " +"Python to fail. If you want to iterate over this global dictionary always " +"use ``sys.modules.copy()`` or ``tuple(sys.modules)`` to avoid exceptions as " +"its size may change during iteration as a side effect of code or activity " +"in other threads." +msgstr "" +"این یک دیکشنری است که نام ماژول‌ها را به ماژول‌هایی که از قبل بارگذاری شده‌اند " +"نگاشت می‌کند. می‌توان این دیکشنری را برای اجبار به بارگذاری مجدد ماژول‌ها و " +"ترفندهای دیگر دستکاری کرد. با این حال، جایگزینی دیکشنری لزوماً آن‌طور که " +"انتظار می‌رود کار نمی‌کند و حذف آیتم‌های ضروری از دیکشنری ممکن است باعث شکست " +"پایتون شود. اگر می‌خواهید این دیکشنری سراسری را پیمایش کنید، همیشه از " +"``sys.modules.copy()`` یا ``tuple(sys.modules)`` استفاده کنید تا از بروز " +"استثناها جلوگیری شود، زیرا اندازه آن ممکن است در حین پیمایش به‌عنوان عارضه " +"جانبی کد یا فعالیت در نخ‌های دیگر تغییر کند." -msgid "The list of the original command line arguments passed to the Python executable." +msgid "" +"The list of the original command line arguments passed to the Python " +"executable." msgstr "" +"فهرست آرگومان‌های اولیه‌ی خط فرمان که به فایل اجرایی پایتون داده شده‌اند." -msgid "The elements of :data:`sys.orig_argv` are the arguments to the Python interpreter, while the elements of :data:`sys.argv` are the arguments to the user's program. Arguments consumed by the interpreter itself will be present in :data:`sys.orig_argv` and missing from :data:`sys.argv`." +msgid "" +"The elements of :data:`sys.orig_argv` are the arguments to the Python " +"interpreter, while the elements of :data:`sys.argv` are the arguments to " +"the user's program. Arguments consumed by the interpreter itself will be " +"present in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" +"عناصر :data:`sys.orig_argv` آرگومان‌های مفسر پایتون هستند، در حالی که " +"عناصر :data:`sys.argv` آرگومان‌های برنامه‌ی کاربر هستند. آرگومان‌هایی که خود " +"مفسر آن‌ها را مصرف می‌کند، در :data:`sys.orig_argv` وجود خواهند داشت و " +"در :data:`sys.argv` وجود نخواهند داشت." -msgid "A list of strings that specifies the search path for modules. Initialized from the environment variable :envvar:`PYTHONPATH`, plus an installation-dependent default." +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 "" +"فهرستی از رشته‌ها که مسیر جست‌وجوی ماژول‌ها را مشخص می‌کند. از متغیر " +"محیطی :envvar:`PYTHONPATH` به‌اضافه‌ی یک پیش‌فرض وابسته به نصب مقداردهی اولیه " +"شده است." -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`):" +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 "" +"به‌طور پیش‌فرض، در مقداردهی اولیه‌ی انجام‌شده در راه‌اندازی برنامه، یک مسیر " +"بالقوه ناامن به ابتدای :data:`sys.path` افزوده می‌شود (*پیش از* مدخل‌هایی که " +"در نتیجه‌ی :envvar:`PYTHONPATH` درج شده‌اند):" -msgid "``python -m module`` command line: prepend the current working directory." -msgstr "" +msgid "" +"``python -m module`` command line: prepend the current working directory." +msgstr "خط فرمان ``python -m module``: پوشه کاری فعلی را در ابتدا قرار می‌دهد." -msgid "``python script.py`` command line: prepend the script's directory. If it's a symbolic link, resolve symbolic links." +msgid "" +"``python script.py`` command line: prepend the script's directory. If it's " +"a symbolic link, resolve symbolic links." msgstr "" +"خط فرمان ``python script.py``: پوشه‌ی اسکریپت به ابتدا اضافه می‌شود. اگر " +"پیوند نمادین باشد، پیوندهای نمادین حل می‌شوند." -msgid "``python -c code`` and ``python`` (REPL) command lines: prepend an empty string, which means the current working directory." +msgid "" +"``python -c code`` and ``python`` (REPL) command lines: prepend an empty " +"string, which means the current working directory." msgstr "" +"خط‌های فرمان ``python -c code`` و ``python`` (REPL): یک رشته خالی به ابتدای " +"آن‌ها اضافه می‌شود که به معنای پوشه کاری فعلی است." -msgid "To not prepend this potentially unsafe path, use the :option:`-P` command line option or the :envvar:`PYTHONSAFEPATH` environment variable." +msgid "" +"To not prepend this potentially unsafe path, use the :option:`-P` command " +"line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" +"برای این‌که این مسیر بالقوه ناامن پیش‌افزوده نشود، از گزینه خط " +"فرمان :option:`-P` یا متغیر محیطی :envvar:`PYTHONSAFEPATH` استفاده کنید." -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." +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 "" +"یک برنامه آزاد است این فهرست را برای اهداف خود تغییر دهد. فقط رشته‌ها باید " +"به :data:`sys.path` اضافه شوند؛ تمام انواع داده دیگر در حین ایمپورت نادیده " +"گرفته می‌شوند." -msgid "Module :mod:`site` This describes how to use .pth files to extend :data:`sys.path`." +msgid "" +"Module :mod:`site` This describes how to use .pth files to " +"extend :data:`sys.path`." msgstr "" +"ماژول :mod:`site` این بخش نحوه‌ی استفاده از فایل‌های .pth برای " +"گسترش :data:`sys.path` را توضیح می‌دهد." -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`." +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 "" +"فهرستی از اشیای قابل فراخوانی که یک آرگومان مسیر می‌گیرند تا سعی کنند برای " +"مسیر یک :term:`finder` ایجاد کنند. اگر بتوان یک finder ایجاد کرد، باید توسط " +"آن شیء قابل فراخوانی برگردانده شود، در غیر این صورت آن شیء قابل فراخوانی " +"باید :exc:`ImportError` را پرتاب کند." msgid "Originally specified in :pep:`302`." -msgstr "" +msgstr "در ابتدا در :pep:`302` مشخص شده است." -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 finders that are found. If a path is a valid file system path but no finder is found on :data:`sys.path_hooks` then ``None`` is stored." +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 finders that are found. If a path is a valid file system path but no " +"finder is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" +"یک دیکشنری که به‌عنوان نهانگاه برای اشیای :term:`finder` عمل می‌کند. کلیدها " +"مسیرهایی هستند که به :data:`sys.path_hooks` ارسال شده‌اند و مقادیر، " +"یابنده‌هایی هستند که پیدا می‌شوند. اگر یک مسیر، مسیر معتبر فایل سیستمی باشد " +"اما هیچ یابنده‌ای در :data:`sys.path_hooks` پیدا نشود، ``None`` ذخیره می‌شود." msgid "A string containing a platform identifier. Known values are:" -msgstr "" +msgstr "رشته‌ای حاوی یک شناسه پلتفرم. مقادیر شناخته‌شده عبارتند از:" msgid "System" -msgstr "" +msgstr "سیستم" msgid "``platform`` value" -msgstr "" +msgstr "مقدار ``platform``" msgid "AIX" -msgstr "" +msgstr "AIX" msgid "``'aix'``" -msgstr "" +msgstr "``'aix'``" msgid "Android" -msgstr "" +msgstr "اندروید" msgid "``'android'``" -msgstr "" +msgstr "``'android'``" msgid "Emscripten" -msgstr "" +msgstr "Emscripten" msgid "``'emscripten'``" -msgstr "" +msgstr "``'emscripten'``" msgid "FreeBSD" -msgstr "" +msgstr "FreeBSD" msgid "``'freebsd'``" -msgstr "" +msgstr "``'freebsd'``" msgid "iOS" -msgstr "" +msgstr "iOS" msgid "``'ios'``" -msgstr "" +msgstr "``'ios'``" msgid "Linux" -msgstr "" +msgstr "لینوکس" msgid "``'linux'``" -msgstr "" +msgstr "``'linux'``" msgid "macOS" -msgstr "" +msgstr "macOS" msgid "``'darwin'``" -msgstr "" +msgstr "``'darwin'``" msgid "Windows" -msgstr "" +msgstr "ویندوز" msgid "``'win32'``" -msgstr "" +msgstr "``'win32'``" msgid "Windows/Cygwin" -msgstr "" +msgstr "Windows/Cygwin" msgid "``'cygwin'``" -msgstr "" +msgstr "``'cygwin'``" msgid "WASI" -msgstr "" +msgstr "WASI" msgid "``'wasi'``" -msgstr "" +msgstr "``'wasi'``" -msgid "On Unix systems not listed in the table, the value is the lowercased OS name as returned by ``uname -s``, with the first part of the version as returned by ``uname -r`` appended, e.g. ``'sunos5'``, *at the time when Python was built*. Unless you want to test for a specific system version, it is therefore recommended to use the following idiom::" -msgstr "" +msgid "" +"On Unix systems not listed in the table, the value is the lowercased OS " +"name as returned by ``uname -s``, with the first part of the version as " +"returned by ``uname -r`` appended, e.g. ``'sunos5'``, *at the time when " +"Python was built*. Unless you want to test for a specific system version, " +"it is therefore recommended to use the following idiom::" +msgstr "" +"در سیستم‌های یونیکسی که در جدول فهرست نشده‌اند، مقدار، نام سیستم‌عامل با حروف " +"کوچک است که توسط ``uname -s`` برگردانده می‌شود و بخش نخست نسخه که توسط " +"``uname -r`` برگردانده می‌شود، به آن افزوده شده است؛ برای مثال ``'sunos5'``، " +"*در زمان ساخت پایتون*. بنابراین، مگر اینکه بخواهید نسخه خاصی از سیستم را " +"بررسی کنید، توصیه می‌شود از اصطلاح زیر استفاده کنید::" msgid "" "if sys.platform.startswith('sunos'):\n" " # SunOS-specific code here..." msgstr "" +"if sys.platform.startswith('sunos'):\n" +" # SunOS-specific code here..." -msgid "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." +msgid "" +"On Linux, :data:`sys.platform` doesn't contain the major version anymore. " +"It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" +"در لینوکس، :data:`sys.platform` دیگر شامل نسخه‌ی اصلی نمی‌شود. این مقدار همیشه " +"``'linux'`` است، به‌جای ``'linux2'`` یا ``'linux3'``." -msgid "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." +msgid "" +"On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " +"is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" +"در AIX، :data:`sys.platform` دیگر شامل نسخه‌ی اصلی نمی‌شود. این مقدار به‌جای " +"``'aix5'`` یا ``'aix7'``، همیشه ``'aix'`` است." -msgid "On Android, :data:`sys.platform` now returns ``'android'`` rather than ``'linux'``." +msgid "" +"On Android, :data:`sys.platform` now returns ``'android'`` rather than " +"``'linux'``." msgstr "" +"در اندروید، :data:`sys.platform` اکنون به‌جای ``'linux'`` مقدار " +"``'android'`` را برمی‌گرداند." -msgid "On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore. It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``." +msgid "" +"On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore. " +"It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``." msgstr "" +"در FreeBSD، :data:`sys.platform` دیگر شامل نسخه‌ی اصلی نمی‌شود. همیشه " +"``'freebsd'`` است، به جای ``'freebsd13'`` یا ``'freebsd14'``." -msgid ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-dependent version information." +msgid "" +":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" +"dependent version information." msgstr "" +":data:`os.name` دانه‌بندی درشت‌تری دارد. :func:`os.uname` اطلاعات نسخه‌ی " +"وابسته به سیستم را ارائه می‌دهد." -msgid "The :mod:`platform` module provides detailed checks for the system's identity." -msgstr "" +msgid "" +"The :mod:`platform` module provides detailed checks for the system's " +"identity." +msgstr "ماژول :mod:`platform` بررسی‌های دقیقی برای هویت سیستم فراهم می‌کند." -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." +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 "" +"نام پوشه‌ی کتابخانه‌ی مختص پلتفرم. از آن برای ساخت مسیر کتابخانه‌ی استاندارد و " +"مسیرهای ماژول‌های افزونه‌ی نصب‌شده استفاده می‌شود." -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):" +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 "" +"این مقدار در بیشتر سکوها برابر با ``\"lib\"`` است. در Fedora و SuSE، این " +"مقدار در سکوهای ۶۴ بیتی برابر با ``\"lib64\"`` است که مسیرهای ``sys.path`` " +"زیر را به دست می‌دهد (که در آن ``X.Y`` نسخه‌ی ``major.minor`` پایتون است):" -msgid "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` module)" +msgid "" +"``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of " +"the :mod:`os` module)" msgstr "" +"``/usr/lib64/pythonX.Y/``: کتابخانه استاندارد (مانند ``os.py`` از " +"ماژول :mod:`os`)" -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)" +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 "" +"``/usr/lib64/pythonX.Y/lib-dynload/``: ماژول‌های افزونه C از کتابخانه " +"استاندارد (مانند ماژول :mod:`errno`، نام دقیق فایل وابسته به پلتفرم است)" -msgid "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys.platlibdir`): Third-party modules" +msgid "" +"``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, " +"not :data:`sys.platlibdir`): Third-party modules" msgstr "" +"``/usr/lib/pythonX.Y/site-packages/`` (همیشه از ``lib`` استفاده کنید، " +"نه :data:`sys.platlibdir`): ماژول‌های شخص ثالث" -msgid "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party packages" +msgid "" +"``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " +"packages" msgstr "" +"``/usr/lib64/pythonX.Y/site-packages/``: ماژول‌های افزونه C از بسته‌های شخص " +"ثالث" -msgid "A string giving the site-specific directory prefix where the platform independent Python files are installed; on Unix, the default is :file:`/usr/local`. This can be set at build time with the :option:`--prefix` argument to the :program:`configure` script. See :ref:`installation_paths` for derived paths." -msgstr "" +msgid "" +"A string giving the site-specific directory prefix where the platform " +"independent Python files are installed; on Unix, the default is :file:`/usr/" +"local`. This can be set at build time with the :option:`--prefix` argument " +"to the :program:`configure` script. See :ref:`installation_paths` for " +"derived paths." +msgstr "" +"رشته‌ای که پیشوند پوشه‌ی ویژه‌ی سایت را مشخص می‌کند، جایی که فایل‌های پایتون " +"مستقل از سکو در آن نصب می‌شوند؛ در یونیکس، مقدار پیش‌فرض :file:`/usr/local` " +"است. این مقدار را می‌توان در زمان ساخت با آرگومان :option:`--prefix` به " +"اسکریپت :program:`configure` تنظیم کرد. برای مسیرهای " +"مشتق‌شده :ref:`installation_paths` را ببینید." -msgid "If a :ref:`virtual environment ` is in effect, this :data:`prefix` will point to the virtual environment. The value for the Python installation will still be available, via :data:`base_prefix`. Refer to :ref:`sys-path-init-virtual-environments` for more information." +msgid "" +"If a :ref:`virtual environment ` is in effect, " +"this :data:`prefix` will point to the virtual environment. The value for " +"the Python installation will still be available, via :data:`base_prefix`. " +"Refer to :ref:`sys-path-init-virtual-environments` for more information." msgstr "" +"اگر یک :ref:`محیط مجازی ` فعال باشد، این :data:`prefix` به محیط " +"مجازی اشاره خواهد کرد. مقدار مربوط به نصب پایتون همچنان از " +"طریق :data:`base_prefix` در دسترس خواهد بود. برای اطلاعات بیشتر " +"به :ref:`sys-path-init-virtual-environments` مراجعه کنید." -msgid "Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is in interactive mode. Their initial values in this case are ``'>>> '`` and ``'... '``. If a non-string object is assigned to either variable, its :func:`str` is re-evaluated each time the interpreter prepares to read a new interactive command; this can be used to implement a dynamic prompt." -msgstr "" +msgid "" +"Strings specifying the primary and secondary prompt of the interpreter. " +"These are only defined if the interpreter is in interactive mode. Their " +"initial values in this case are ``'>>> '`` and ``'... '``. If a non-string " +"object is assigned to either variable, its :func:`str` is re-evaluated each " +"time the interpreter prepares to read a new interactive command; this can " +"be used to implement a dynamic prompt." +msgstr "" +"رشته‌هایی که اعلان اصلی و ثانویه مفسر را مشخص می‌کنند. این‌ها تنها در صورتی " +"تعریف می‌شوند که مفسر در حالت تعاملی باشد. مقادیر اولیه آن‌ها در این حالت " +"``'>>> '`` و ``'... '`` هستند. اگر یک شیء غیررشته‌ای به یکی از این متغیرها " +"اختصاص داده شود، :func:`str` آن هر بار که مفسر برای خواندن یک دستور تعاملی " +"جدید آماده می‌شود، دوباره ارزیابی می‌شود؛ این می‌تواند برای پیاده‌سازی یک اعلان " +"پویا استفاده شود." -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 enable a lazy resolving of symbols when importing a module, if called as ``sys.setdlopenflags(0)``. To share symbols across extension modules, call as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." -msgstr "" +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 enable a lazy resolving of symbols when importing a module, if called " +"as ``sys.setdlopenflags(0)``. To share symbols across extension modules, " +"call as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the " +"flag values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` " +"constants, e.g. :const:`os.RTLD_LAZY`)." +msgstr "" +"پرچم‌هایی را که مفسر برای فراخوانی‌های :c:func:`dlopen` به کار می‌برد، تنظیم " +"کنید، مانند زمانی که مفسر ماژول‌های توسعه‌ای را بارگذاری می‌کند. از جمله، اگر " +"به‌صورت ``sys.setdlopenflags(0)`` فراخوانی شود، این کار حل با تأخیر نمادها " +"را هنگام ایمپورت یک ماژول فعال می‌کند. برای اشتراک‌گذاری نمادها میان ماژول‌های " +"توسعه‌ای، به‌صورت ``sys.setdlopenflags(os.RTLD_GLOBAL)`` فراخوانی کنید. " +"نام‌های نمادین برای مقادیر پرچم را می‌توان در ماژول :mod:`os` یافت " +"(ثابت‌های :samp:`RTLD_{xxx}`، برای مثال :const:`os.RTLD_LAZY`)." -msgid "Set the :ref:`integer string conversion length limitation ` used by this interpreter. See also :func:`get_int_max_str_digits`." +msgid "" +"Set the :ref:`integer string conversion length limitation " +"` used by this interpreter. See " +"also :func:`get_int_max_str_digits`." msgstr "" +":ref:`محدودیت طول تبدیل عدد صحیح به رشته ` را که این " +"مفسر از آن استفاده می‌کند، تنظیم کنید. همچنین :func:`get_int_max_str_digits` " +"را ببینید." -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 information on the Python profiler. The system's profile function is called similarly to the system's trace function (see :func:`settrace`), but it is called with different events, for example it isn't called for each executed line of code (only on call and return, but the return event is reported even when an exception has been set). The function is thread-specific, but there is no way for the profiler to know about context switches between threads, so it does not make sense to use this in the presence of multiple threads. Also, its return value is not used, so it can simply return ``None``. Error in the profile function will cause itself unset." -msgstr "" +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 " +"information on the Python profiler. The system's profile function is " +"called similarly to the system's trace function (see :func:`settrace`), but " +"it is called with different events, for example it isn't called for each " +"executed line of code (only on call and return, but the return event is " +"reported even when an exception has been set). The function is thread-" +"specific, but there is no way for the profiler to know about context " +"switches between threads, so it does not make sense to use this in the " +"presence of multiple threads. Also, its return value is not used, so it can " +"simply return ``None``. Error in the profile function will cause itself " +"unset." +msgstr "" +"تابع پروفایل (profile) سیستم را تنظیم کنید، که به شما امکان می‌دهد یک " +"پروفایلر (profiler) برای کد منبع پایتون را در پایتون پیاده‌سازی کنید. برای " +"اطلاعات بیشتر درباره پروفایلر پایتون، فصل :ref:`profile` را ببینید. تابع " +"پروفایل سیستم مشابه تابع ردگیری (trace) سیستم فراخوانی می‌شود " +"(به :func:`settrace` مراجعه کنید)، اما با رویدادهای متفاوتی فراخوانی می‌شود؛ " +"برای مثال، به‌ازای هر خط کدی که اجرا می‌شود فراخوانی نمی‌شود (فقط در فراخوانی " +"و بازگشت فراخوانی می‌شود، اما رویداد بازگشت حتی زمانی که استثنایی تنظیم شده " +"باشد گزارش می‌شود). این تابع مختص نخ است، اما راهی برای آگاهی پروفایلر از " +"تعویض‌های زمینه بین نخ‌ها وجود ندارد، بنابراین استفاده از آن در حضور چند نخ " +"معنادار نیست. همچنین، از مقدار بازگشتی آن استفاده نمی‌شود، بنابراین می‌تواند " +"به‌سادگی ``None`` را برگرداند. خطا در تابع پروفایل باعث می‌شود که این تابع " +"برداشته شود." -msgid "The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`. To trace calls with :func:`!setprofile` inside a tracing function (e.g. in a debugger breakpoint), see :func:`call_tracing`." +msgid "" +"The same tracing mechanism is used for :func:`!setprofile` " +"as :func:`settrace`. To trace calls with :func:`!setprofile` inside a " +"tracing function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" +"برای :func:`!setprofile` از همان سازوکار ردگیری‌ای استفاده می‌شود که " +"برای :func:`settrace` به کار می‌رود. برای ردگیری فراخوانی‌ها با :func:`!" +"setprofile` درون یک تابع ردگیری (مثلاً در یک نقطه‌ی توقف " +"اشکال‌زدا)، :func:`call_tracing` را ببینید." -msgid "Profile functions should have three arguments: *frame*, *event*, and *arg*. *frame* is the current stack frame. *event* is a string: ``'call'``, ``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* depends on the event type." +msgid "" +"Profile functions should have three arguments: *frame*, *event*, and *arg*. " +"*frame* is the current stack frame. *event* is a string: ``'call'``, " +"``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* " +"depends on the event type." msgstr "" +"توابع پروفایل‌گیری (profile) باید سه آرگومان داشته باشند: *frame*، *event* و " +"*arg*. *frame* فریم پشته‌ی فعلی است. *event* یک رشته است: ``'call'``، " +"``'return'``، ``'c_call'``، ``'c_return'`` یا ``'c_exception'``. *arg* به " +"نوع رویداد بستگی دارد." msgid "The events have the following meaning:" -msgstr "" +msgstr "رویدادها معانی زیر را دارند:" msgid "``'call'``" -msgstr "" +msgstr "``'call'``" -msgid "A function is called (or some other code block entered). The profile function is called; *arg* is ``None``." +msgid "" +"A function is called (or some other code block entered). The profile " +"function is called; *arg* is ``None``." msgstr "" +"یک تابع فراخوانی می‌شود (یا وارد بلوک کد دیگری می‌شوید). تابع پروفایل " +"فراخوانی می‌شود؛ *arg* برابر ``None`` است." msgid "``'return'``" -msgstr "" +msgstr "``'return'``" -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." +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 "" +"یک تابع (یا بلوک کد دیگر) در آستانه بازگشت است. تابع پروفایل فراخوانی " +"می‌شود؛ *arg* مقداری است که بازگردانده خواهد شد، یا اگر رویداد به دلیل پرتاب " +"شدن یک استثنا رخ داده باشد، ``None`` است." msgid "``'c_call'``" -msgstr "" +msgstr "``'c_call'``" -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." +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 "" +"یک تابع C در آستانه فراخوانی است. این ممکن است یک تابع افزونه‌ای یا توکار " +"باشد. *arg* شیء تابع C است." msgid "``'c_return'``" -msgstr "" +msgstr "``'c_return'``" msgid "A C function has returned. *arg* is the C function object." -msgstr "" +msgstr "یک تابع C بازگشت کرده است. *arg* شیء تابع C است." msgid "``'c_exception'``" -msgstr "" +msgstr "``'c_exception'``" msgid "A C function has raised an exception. *arg* is the C function object." -msgstr "" +msgstr "یک تابع C استثناای را پرتاب کرده است. *arg* شیء تابع C است." -msgid "Raises an :ref:`auditing event ` ``sys.setprofile`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys.setprofile`` را بدون آرگومان " +"پرتاب می‌کند." -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." +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 "" +"حداکثر عمق پشته مفسر پایتون را روی *limit* تنظیم می‌کند. این محدودیت مانع از " +"آن می‌شود که بازگشت بی‌نهایت باعث سرریز پشته C و از کار افتادن پایتون شود." -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 platform that supports a higher limit. This should be done with care, because a too-high limit can lead to a crash." +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 platform that supports a higher limit. This should be done with care, " +"because a too-high limit can lead to a crash." msgstr "" +"بالاترین حد ممکن به سکو وابسته است. ممکن است کاربر نیاز داشته باشد حد را " +"بالاتر تنظیم کند، هنگامی که برنامه‌ای داشته باشد که به بازگشت عمیق نیاز دارد " +"و سکویی داشته باشد که از حد بالاتری پشتیبانی کند. این کار باید با احتیاط " +"انجام شود، زیرا حد بیش از حد بالا می‌تواند منجر به فروپاشی شود." -msgid "If the new limit is too low at the current recursion depth, a :exc:`RecursionError` exception is raised." +msgid "" +"If the new limit is too low at the current recursion depth, " +"a :exc:`RecursionError` exception is raised." msgstr "" +"اگر حد جدید در عمق بازگشت فعلی بیش از حد کم باشد، " +"استثنای :exc:`RecursionError` پرتاب می‌شود." -msgid "A :exc:`RecursionError` exception is now raised if the new limit is too low at the current recursion depth." +msgid "" +"A :exc:`RecursionError` exception is now raised if the new limit is too low " +"at the current recursion depth." msgstr "" +"اکنون اگر حد جدید در عمق بازگشت فعلی بیش از حد کم باشد، " +"استثنای :exc:`RecursionError` پرتاب می‌شود." -msgid "Set the interpreter's thread switch interval (in seconds). This floating-point value determines the ideal duration of the \"timeslices\" allocated to concurrently running Python threads. Please note that the actual value can be higher, especially if long-running internal functions or methods are used. Also, which thread becomes scheduled at the end of the interval is the operating system's decision. The interpreter doesn't have its own scheduler." -msgstr "" +msgid "" +"Set the interpreter's thread switch interval (in seconds). This floating-" +"point value determines the ideal duration of the \"timeslices\" allocated " +"to concurrently running Python threads. Please note that the actual value " +"can be higher, especially if long-running internal functions or methods are " +"used. Also, which thread becomes scheduled at the end of the interval is " +"the operating system's decision. The interpreter doesn't have its own " +"scheduler." +msgstr "" +"بازه‌ی تعویض نخ مفسر (به ثانیه) را تنظیم می‌کند. این مقدار ممیز شناور، مدت " +"ایده‌آل «برش‌های زمانی» (timeslices) اختصاص‌داده‌شده به نخ‌های پایتونی که به‌طور " +"همزمان اجرا می‌شوند را تعیین می‌کند. لطفاً توجه داشته باشید که مقدار واقعی " +"می‌تواند بیشتر باشد، به‌ویژه اگر از توابع یا متدهای درونی با اجرای طولانی " +"استفاده شود. هم‌چنین، این‌که در پایان بازه کدام نخ برای اجرا زمان‌بندی شود، " +"تصمیم سیستم‌عامل است. مفسر زمان‌بند اختصاصی خود را ندارد." -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 debugger to support multiple threads, it must register a trace function using :func:`settrace` for each thread being debugged or use :func:`threading.settrace`." -msgstr "" +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 " +"debugger to support multiple threads, it must register a trace function " +"using :func:`settrace` for each thread being debugged or " +"use :func:`threading.settrace`." +msgstr "" +"تابع ردگیری سیستم را تنظیم کنید، که به شما امکان می‌دهد یک اشکال‌زدای کد منبع " +"پایتون را در پایتون پیاده‌سازی کنید. این تابع مختص هر نخ است؛ برای اینکه یک " +"اشکال‌زدا از چندین نخ پشتیبانی کند، باید برای هر نخی که اشکال‌زدایی می‌شود با " +"استفاده از :func:`settrace` یک تابع ردگیری ثبت کند یا " +"از :func:`threading.settrace` استفاده کند." -msgid "Trace functions should have three arguments: *frame*, *event*, and *arg*. *frame* is the :ref:`current stack frame `. *event* is a string: ``'call'``, ``'line'``, ``'return'``, ``'exception'`` or ``'opcode'``. *arg* depends on the event type." +msgid "" +"Trace functions should have three arguments: *frame*, *event*, and *arg*. " +"*frame* is the :ref:`current stack frame `. *event* is a " +"string: ``'call'``, ``'line'``, ``'return'``, ``'exception'`` or " +"``'opcode'``. *arg* depends on the event type." msgstr "" +"توابع ردگیری باید ۳ آرگومان داشته باشند: *frame*، *event* و *arg*. " +"*frame* :ref:`فریم پشته جاری ` است. *event* یک رشته است: " +"``'call'``، ``'line'``، ``'return'``، ``'exception'`` یا ``'opcode'``. " +"*arg* به نوع رویداد بستگی دارد." -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 function to be used for the new scope, or ``None`` if the scope shouldn't be traced." +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 " +"function to be used for the new scope, or ``None`` if the scope shouldn't " +"be traced." msgstr "" +"تابع ردگیری هر زمان که وارد یک محدوده محلی جدید شود (با *event* تنظیم‌شده " +"روی ``'call'``) فراخوانی می‌شود؛ این تابع باید ارجاعی به یک تابع ردگیری محلی " +"برای استفاده در محدوده جدید برگرداند، یا ``None`` اگر محدوده نباید ردگیری " +"شود." -msgid "The local trace function should return a reference to itself, or to another function which would then be used as the local trace function for the scope." +msgid "" +"The local trace function should return a reference to itself, or to another " +"function which would then be used as the local trace function for the scope." msgstr "" +"تابع ردگیری محلی باید ارجاعی به خودش یا به تابع دیگری بازگرداند که سپس " +"به‌عنوان تابع ردگیری محلی برای محدوده استفاده خواهد شد." -msgid "If there is any error occurred in the trace function, it will be unset, just like ``settrace(None)`` is called." +msgid "" +"If there is any error occurred in the trace function, it will be unset, " +"just like ``settrace(None)`` is called." msgstr "" +"اگر خطایی در تابع ردگیری رخ دهد، آن لغو می‌شود، درست مانند این که " +"``settrace(None)`` فراخوانی شده باشد." -msgid "Tracing is disabled while calling the trace function (e.g. a function set by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." +msgid "" +"Tracing is disabled while calling the trace function (e.g. a function set " +"by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" +"ردگیری هنگام فراخوانی تابع ردگیری غیرفعال می‌شود (برای مثال تابعی که " +"توسط :func:`!settrace` تنظیم شده است). برای ردگیری " +"بازگشتی، :func:`call_tracing` را ببینید." -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." +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 "" +"یک تابع فراخوانی می‌شود (یا وارد بلوک کد دیگری می‌شوید). تابع ردگیری سراسری " +"فراخوانی می‌شود؛ *arg* برابر ``None`` است؛ مقدار بازگشتی، تابع ردگیری محلی " +"را مشخص می‌کند." msgid "``'line'``" -msgstr "" +msgstr "``'line'``" -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:`~frame.f_trace_lines` to :const:`False` on that :ref:`frame `." -msgstr "" +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:`~frame.f_trace_lines` to :const:`False` on that :ref:`frame " +"`." +msgstr "" +"مفسر در شرف اجرای یک خط جدید از کد یا اجرای مجدد شرط یک حلقه است. تابع " +"ردگیری محلی فراخوانی می‌شود؛ *arg* برابر ``None`` است؛ مقدار بازگشتی، تابع " +"ردگیری محلی جدید را تعیین می‌کند. برای توضیح مفصل چگونگی کار این " +"سازوکار، :file:`Objects/lnotab_notes.txt` را ببینید. رویدادهای هر خط را " +"می‌توان برای یک فریم با تنظیم :attr:`~frame.f_trace_lines` " +"روی :const:`False` در آن :ref:`فریم ` غیرفعال کرد." -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 the event is caused by an exception being raised. The trace function's return value is ignored." +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 the event is caused by an exception being raised. The trace function's " +"return value is ignored." msgstr "" +"یک تابع (یا بلوک کد دیگر) در شرف بازگشت است. تابع ردگیری محلی فراخوانی " +"می‌شود؛ *arg* مقداری است که برگردانده خواهد شد، یا اگر رویداد ناشی از پرتاب " +"شدن یک استثنا باشد ``None`` است. مقدار بازگشتی تابع ردگیری نادیده گرفته " +"می‌شود." msgid "``'exception'``" -msgstr "" +msgstr "``'exception'``" -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." +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 "" +"استثنایی رخ داده است. تابع ردگیری محلی فراخوانی می‌شود؛ *arg* یک تاپل " +"``(exception, value, traceback)`` است؛ مقدار بازگشتی، تابع ردگیری محلی جدید " +"را مشخص می‌کند." msgid "``'opcode'``" -msgstr "" +msgstr "``'opcode'``" -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:`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame `." -msgstr "" +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:`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame " +"`." +msgstr "" +"مفسر در آستانه اجرای یک کد دستوری جدید (opcode) است (برای جزئیات کد دستوری " +"به :mod:`dis` مراجعه کنید). تابع ردگیری محلی فراخوانی می‌شود؛ *arg* برابر " +"``None`` است؛ مقدار بازگشتی، تابع ردگیری محلی جدید را مشخص می‌کند. به‌طور " +"پیش‌فرض، رویدادهای به‌ازای هر کد دستوری منتشر نمی‌شوند: این رویدادها باید " +"به‌صراحت با تنظیم :attr:`~frame.f_trace_opcodes` روی :const:`True` " +"در :ref:`فریم ` درخواست شوند." -msgid "Note that as an exception is propagated down the chain of callers, an ``'exception'`` event is generated at each level." +msgid "" +"Note that as an exception is propagated down the chain of callers, an " +"``'exception'`` event is generated at each level." msgstr "" +"توجه داشته باشید که هنگامی که یک استثنا در زنجیره‌ی فراخواننده‌ها به پایین " +"منتشر می‌شود، یک رویداد ``'exception'`` در هر سطح تولید می‌شود." -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 it being set indirectly via the return value from an already installed trace function. This is also required for activating the trace function on the current frame, which :func:`settrace` doesn't do. Note that in order for this to work, a global tracing function must have been installed with :func:`settrace` in order to enable the runtime tracing machinery, but it doesn't need to be the same tracing function (e.g. it could be a low overhead tracing function that simply returns ``None`` to disable itself immediately on each frame)." -msgstr "" +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 " +"it being set indirectly via the return value from an already installed " +"trace function. This is also required for activating the trace function on " +"the current frame, which :func:`settrace` doesn't do. Note that in order " +"for this to work, a global tracing function must have been installed " +"with :func:`settrace` in order to enable the runtime tracing machinery, but " +"it doesn't need to be the same tracing function (e.g. it could be a low " +"overhead tracing function that simply returns ``None`` to disable itself " +"immediately on each frame)." +msgstr "" +"برای استفاده‌ی دقیق‌تر، می‌توانید با انتساب صریح ``frame.f_trace = tracefunc`` " +"یک تابع ردگیری را تنظیم کنید، به جای آنکه به تنظیم غیرمستقیم آن از طریق " +"مقدار بازگشتی یک تابع ردگیری از پیش نصب‌شده تکیه کنید. این کار همچنین برای " +"فعال‌سازی تابع ردگیری در فریمجاری لازم است، که :func:`settrace` آن " +"را انجام نمی‌دهد. توجه داشته باشید که برای اینکه این کار کند، باید یک تابع " +"ردگیری سراسری با :func:`settrace` نصب شده باشد تا سازوکار ردگیری ران‌تایم " +"فعال شود، اما لازم نیست همان تابع ردگیری باشد (برای مثال، می‌تواند یک تابع " +"ردگیری کم‌سربار باشد که صرفاً ``None`` را برمی‌گرداند تا خود را بلافاصله در هر " +"فریم غیرفعال کند)." msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" +"برای اطلاعات بیشتر درباره اشیای کد و فریم، به :ref:`types` مراجعه کنید." -msgid "Raises an :ref:`auditing event ` ``sys.settrace`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``sys.settrace`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys.settrace`` را بدون آرگومان پرتاب " +"می‌کند." -msgid "The :func:`settrace` function is intended only for implementing debuggers, profilers, coverage tools and the like. Its behavior is part of the implementation platform, rather than part of the language definition, and thus may not be available in all Python implementations." +msgid "" +"The :func:`settrace` function is intended only for implementing debuggers, " +"profilers, coverage tools and the like. Its behavior is part of the " +"implementation platform, rather than part of the language definition, and " +"thus may not be available in all Python implementations." msgstr "" +"تابع :func:`settrace` فقط برای پیاده‌سازی اشکال‌زداها، پروفایل‌گیرها " +"(profilers)، ابزارهای پوشش (coverage) و موارد مشابه در نظر گرفته شده است. " +"رفتار آن بخشی از سکوی پیاده‌سازی است، نه بخشی از تعریف زبان، و بنابراین ممکن " +"است در تمام پیاده‌سازی‌های پایتون در دسترس نباشد." -msgid "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:`~frame.f_trace_opcodes` attributes added to frames" +msgid "" +"``'opcode'`` event type added; :attr:`~frame.f_trace_lines` " +"and :attr:`~frame.f_trace_opcodes` attributes added to frames" msgstr "" +"نوع رویداد ``'opcode'`` افزوده شد؛ ویژگی‌های :attr:`~frame.f_trace_lines` " +"و :attr:`~frame.f_trace_opcodes` به فریم‌ها افزوده شدند" -msgid "Accepts two optional keyword arguments which are callables that accept an :term:`asynchronous generator iterator` as an argument. The *firstiter* callable will be called when an asynchronous generator is iterated for the first time. The *finalizer* will be called when an asynchronous generator is about to be garbage collected." -msgstr "" +msgid "" +"Accepts two optional keyword arguments which are callables that accept " +"an :term:`asynchronous generator iterator` as an argument. The *firstiter* " +"callable will be called when an asynchronous generator is iterated for the " +"first time. The *finalizer* will be called when an asynchronous generator " +"is about to be garbage collected." +msgstr "" +"دو آرگومان کلیدواژه‌ای اختیاری می‌پذیرد که فراخوانی‌پذیر هستند و " +"یک :term:`asynchronous generator iterator` را به‌عنوان آرگومان می‌پذیرند. " +"فراخوانی‌پذیر *firstiter* هنگامی فراخوانی خواهد شد که یک تولیدگر ناهمگام " +"برای اولین بار پیمایش شود. *finalizer* هنگامی فراخوانی خواهد شد که یک " +"تولیدگر ناهمگام در آستانه زباله‌روبی شدن باشد." -msgid "Raises an :ref:`auditing event ` ``sys.set_asyncgen_hooks_firstiter`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` " +"``sys.set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys.set_asyncgen_hooks_firstiter`` را " +"بدون آرگومان پرتاب می‌کند." -msgid "Raises an :ref:`auditing event ` ``sys.set_asyncgen_hooks_finalizer`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` " +"``sys.set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``sys.set_asyncgen_hooks_finalizer`` را " +"بدون آرگومان پرتاب می‌کند." -msgid "Two auditing events are raised because the underlying API consists of two calls, each of which must raise its own event." +msgid "" +"Two auditing events are raised because the underlying API consists of two " +"calls, each of which must raise its own event." msgstr "" +"دو رویداد حسابرسی پرتاب می‌شوند، زیرا API زیربنایی از دو فراخوانی تشکیل شده " +"است که هر یک باید رویداد خود را پرتاب کند." -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`" +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 "" +"برای جزئیات بیشتر :pep:`525` را ببینید، و برای یک مثال مرجع از متد " +"*نهایی‌ساز* (finalizer)، پیاده‌سازی ``asyncio.Loop.shutdown_asyncgens`` " +"در :source:`Lib/asyncio/base_events.py` را ببینید" -msgid "Allows enabling or disabling coroutine origin tracking. When enabled, the ``cr_origin`` attribute on coroutine objects will contain a tuple of (filename, line number, function name) tuples describing the traceback where the coroutine object was created, with the most recent call first. When disabled, ``cr_origin`` will be ``None``." -msgstr "" +msgid "" +"Allows enabling or disabling coroutine origin tracking. When enabled, the " +"``cr_origin`` attribute on coroutine objects will contain a tuple of " +"(filename, line number, function name) tuples describing the traceback " +"where the coroutine object was created, with the most recent call first. " +"When disabled, ``cr_origin`` will be ``None``." +msgstr "" +"امکان فعال یا غیرفعال کردن پیگیری مبدأ هم‌روال را فراهم می‌کند. هنگامی که " +"فعال باشد، ویژگی ``cr_origin`` در اشیای هم‌روال شامل تاپلی از تاپل‌های (نام " +"فایل، شماره‌ی خط، نام تابع) خواهد بود که ردگیری پشته‌ی محل ایجاد شیء هم‌روال را " +"توصیف می‌کند، به‌طوری که جدیدترین فراخوانی در ابتدا قرار دارد. هنگامی که " +"غیرفعال باشد، ``cr_origin`` برابر ``None`` خواهد بود." -msgid "To enable, pass a *depth* value greater than zero; this sets the number of frames whose information will be captured. To disable, set *depth* to zero." +msgid "" +"To enable, pass a *depth* value greater than zero; this sets the number of " +"frames whose information will be captured. To disable, set *depth* to zero." msgstr "" +"برای فعال‌سازی، مقداری برای *depth* بزرگ‌تر از ۰ ارسال کنید؛ این کار تعداد " +"فریم‌هایی را که اطلاعات آن‌ها ضبط خواهد شد تنظیم می‌کند. برای غیرفعال‌سازی، " +"*depth* را روی ۰ تنظیم کنید." msgid "This setting is thread-specific." -msgstr "" +msgstr "این تنظیم مختص نخ است." -msgid "Activate the stack profiler trampoline *backend*. The only supported backend is ``\"perf\"``." +msgid "" +"Activate the stack profiler trampoline *backend*. The only supported " +"backend is ``\"perf\"``." msgstr "" +"*بک‌اند* (backend) ترامپولین (trampoline) پروفایلر پشته را فعال کنید. تنها " +"بک‌اند پشتیبانی‌شده ``\"perf\"`` است." msgid "Stack trampolines cannot be activated if the JIT is active." msgstr "" +"اگر JIT فعال باشد، ترمپولین‌های پشته (Stack trampolines) نمی‌توانند فعال شوند." msgid ":ref:`perf_profiling`" -msgstr "" +msgstr ":ref:`perf_profiling`" msgid "https://perf.wiki.kernel.org" -msgstr "" +msgstr "https://perf.wiki.kernel.org" msgid "Deactivate the current stack profiler trampoline backend." msgstr "" +"غیرفعال کردن بک‌اند (backend) فعلی ترامپولین (trampoline) پروفایلر " +"(profiler) پشته." msgid "If no stack profiler is activated, this function has no effect." msgstr "" +"اگر هیچ پروفایلر پشته‌ای (stack profiler) فعال نشده باشد، این تابع هیچ " +"تأثیری ندارد." msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" +"اگر ترامپولین پروفایل‌کننده‌ی پشته (stack profiler trampoline) فعال باشد، " +"``True`` را برمی‌گرداند." -msgid "Executes *script*, a file containing Python code in the remote process with the given *pid*." +msgid "" +"Executes *script*, a file containing Python code in the remote process with " +"the given *pid*." msgstr "" +"*script*، فایلی حاوی کد پایتون، را در فرایند راه دور با *pid* داده‌شده اجرا " +"می‌کند." -msgid "This function returns immediately, and the code will be executed by the target process's main thread at the next available opportunity, similarly to how signals are handled. There is no interface to determine when the code has been executed. The caller is responsible for making sure that the file still exists whenever the remote process tries to read it and that it hasn't been overwritten." -msgstr "" +msgid "" +"This function returns immediately, and the code will be executed by the " +"target process's main thread at the next available opportunity, similarly " +"to how signals are handled. There is no interface to determine when the " +"code has been executed. The caller is responsible for making sure that the " +"file still exists whenever the remote process tries to read it and that it " +"hasn't been overwritten." +msgstr "" +"این تابع بلافاصله بازمی‌گردد و کد در اولین فرصت ممکن توسط نخ اصلی فرایند هدف " +"اجرا خواهد شد، مشابه نحوه مدیریت سیگنال‌ها. هیچ رابطی برای تعیین زمان اجرای " +"کد وجود ندارد. فراخواننده مسئول است اطمینان حاصل کند که فایل هر زمان که " +"فرایند راه‌دور سعی می‌کند آن را بخواند، هنوز وجود دارد و بازنویسی‌نشده است." -msgid "The remote process must be running a CPython interpreter of the same major and minor version as the local process. If either the local or remote interpreter is pre-release (alpha, beta, or release candidate) then the local and remote interpreters must be the same exact version." +msgid "" +"The remote process must be running a CPython interpreter of the same major " +"and minor version as the local process. If either the local or remote " +"interpreter is pre-release (alpha, beta, or release candidate) then the " +"local and remote interpreters must be the same exact version." msgstr "" +"فرایند راه دور باید در حال اجرای یک مفسر CPython با همان نسخه‌ی اصلی و فرعی " +"فرایند محلی باشد. اگر مفسر محلی یا راه دور پیش‌انتشار (آلفا، بتا یا نامزد " +"انتشار) باشد، مفسرهای محلی و راه دور باید دقیقاً نسخه‌ی یکسانی داشته باشند." -msgid "See :ref:`remote-debugging` for more information about the remote debugging mechanism." +msgid "" +"See :ref:`remote-debugging` for more information about the remote debugging " +"mechanism." msgstr "" +"برای اطلاعات بیشتر درباره سازوکار اشکال‌زدایی راه‌دور، :ref:`remote-" +"debugging` را ببینید." -msgid "When the code is executed in the remote process, an :ref:`auditing event ` ``sys.remote_exec`` is raised with the *pid* and the path to the script file. This event is raised in the process that called :func:`sys.remote_exec`." +msgid "" +"When the code is executed in the remote process, an :ref:`auditing event " +"` ``sys.remote_exec`` is raised with the *pid* and the path to " +"the script file. This event is raised in the process that " +"called :func:`sys.remote_exec`." msgstr "" +"هنگامی که کد در فرایند راه‌دور اجرا می‌شود، یک :ref:`رویداد حسابرسی ` " +"``sys.remote_exec`` با *pid* و مسیر فایل اسکریپت پرتاب می‌شود. این رویداد در " +"فرایندی که :func:`sys.remote_exec` را فراخوانی کرده است، پرتاب می‌شود." -msgid "When the script is executed in the remote process, an :ref:`auditing event ` ``cpython.remote_debugger_script`` is raised with the path in the remote process. This event is raised in the remote process, not the one that called :func:`sys.remote_exec`." +msgid "" +"When the script is executed in the remote process, an :ref:`auditing event " +"` ``cpython.remote_debugger_script`` is raised with the path in " +"the remote process. This event is raised in the remote process, not the one " +"that called :func:`sys.remote_exec`." msgstr "" +"هنگامی که اسکریپت در فرایند راه‌دور اجرا می‌شود، یک :ref:`رویداد حسابرسی " +"` ``cpython.remote_debugger_script`` به‌همراه مسیر درون فرایند " +"راه‌دور پرتاب می‌شود. این رویداد در فرایند راه‌دور پرتاب می‌شود، نه در فرایندی " +"که :func:`sys.remote_exec` را فراخوانی کرده است." msgid "See :pep:`768` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر، :pep:`768` را ببینید." -msgid "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and 'replace' respectively, for consistency with versions of Python prior to 3.6." +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 "" +"برای سازگاری با نسخه‌های پایتون پیش از 3.6، :term:`کدگذاری و مدیریت خطای " +"سیستم‌فایل ` را به‌ترتیب به 'mbcs' و " +"'replace' تغییر می‌دهد." -msgid "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable before launching Python." +msgid "" +"This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable before launching Python." msgstr "" +"این معادل تعریف متغیر محیطی :envvar:`PYTHONLEGACYWINDOWSFSENCODING` پیش از " +"اجرای پایتون است." -msgid "See also :func:`sys.getfilesystemencoding` and :func:`sys.getfilesystemencodeerrors`." +msgid "" +"See also :func:`sys.getfilesystemencoding` " +"and :func:`sys.getfilesystemencodeerrors`." msgstr "" +"همچنین :func:`sys.getfilesystemencoding` " +"و :func:`sys.getfilesystemencodeerrors` را ببینید." -msgid "Changing the filesystem encoding after Python startup is risky because the old fsencoding or paths encoded by the old fsencoding may be cached somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." +msgid "" +"Changing the filesystem encoding after Python startup is risky because the " +"old fsencoding or paths encoded by the old fsencoding may be cached " +"somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" +"تغییر کدگذاری فایل‌سیستم پس از راه‌اندازی پایتون خطرناک است، زیرا ممکن است " +"fsencoding قدیمی یا مسیرهای کدگذاری‌شده با fsencoding قدیمی در جایی در " +"نهانگاه ذخیره شده باشند. به‌جای آن " +"از :envvar:`PYTHONLEGACYWINDOWSFSENCODING` استفاده کنید." msgid "See :pep:`529` for more details." -msgstr "" +msgstr "برای جزئیات بیشتر :pep:`529` را ببینید." msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." -msgstr "" +msgstr "به‌جای آن از :envvar:`PYTHONLEGACYWINDOWSFSENCODING` استفاده کنید." -msgid ":term:`File objects ` used by the interpreter for standard input, output and errors:" +msgid "" +":term:`File objects ` used by the interpreter for standard " +"input, output and errors:" msgstr "" +":term:`اشیای فایل ` که توسط مفسر برای ورودی، خروجی و خطاهای " +"استاندارد استفاده می‌شوند:" -msgid "``stdin`` is used for all interactive input (including calls to :func:`input`);" +msgid "" +"``stdin`` is used for all interactive input (including calls " +"to :func:`input`);" msgstr "" +"از ``stdin`` برای تمام ورودی‌های تعاملی (از جمله فراخوانی‌های :func:`input`) " +"استفاده می‌شود؛" -msgid "``stdout`` is used for the output of :func:`print` and :term:`expression` statements and for the prompts of :func:`input`;" +msgid "" +"``stdout`` is used for the output of :func:`print` and :term:`expression` " +"statements and for the prompts of :func:`input`;" msgstr "" +"``stdout`` برای خروجی :func:`print` و دستورهای :term:`عبارت ` و " +"برای اعلان‌های :func:`input` استفاده می‌شود؛" msgid "The interpreter's own prompts and its error messages go to ``stderr``." -msgstr "" +msgstr "اعلان‌های خود مفسر و پیام‌های خطای آن به ``stderr`` فرستاده می‌شوند." -msgid "These streams are regular :term:`text files ` like those returned by the :func:`open` function. Their parameters are chosen as follows:" +msgid "" +"These streams are regular :term:`text files ` like those " +"returned by the :func:`open` function. Their parameters are chosen as " +"follows:" msgstr "" +"این جریان‌ها، :term:`پرونده‌های متنی ` عادی هستند، مانند آن‌هایی که " +"تابع :func:`open` برمی‌گرداند. پارامترهای آن‌ها به‌صورت زیر انتخاب شده‌اند:" -msgid "The encoding and error handling are initialized from :c:member:`PyConfig.stdio_encoding` and :c:member:`PyConfig.stdio_errors`." +msgid "" +"The encoding and error handling are initialized " +"from :c:member:`PyConfig.stdio_encoding` " +"and :c:member:`PyConfig.stdio_errors`." msgstr "" +"کدگذاری و مدیریت خطا از :c:member:`PyConfig.stdio_encoding` " +"و :c:member:`PyConfig.stdio_errors` مقداردهی اولیه می‌شوند." -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 codepage). Non-console character devices such as NUL (i.e. where ``isatty()`` returns ``True``) use the value of the console input and output codepages at startup, respectively for stdin and stdout/stderr. This defaults to the system :term:`locale encoding` if the process is not initially attached to a console." -msgstr "" +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 " +"codepage). Non-console character devices such as NUL (i.e. where " +"``isatty()`` returns ``True``) use the value of the console input and " +"output codepages at startup, respectively for stdin and stdout/stderr. This " +"defaults to the system :term:`locale encoding` if the process is not " +"initially attached to a console." +msgstr "" +"در ویندوز، برای دستگاه کنسول از UTF-8 استفاده می‌شود. دستگاه‌های غیرنویسه‌ای " +"مانند فایل‌های دیسک و پایپ‌ها از کدگذاری زبان locale سیستم (یعنی کدپیج ANSI) " +"استفاده می‌کنند. دستگاه‌های نویسه‌ای غیرکنسولی مانند NUL (یعنی مواردی که " +"``isatty()`` مقدار ``True`` برمی‌گرداند) در هنگام راه‌اندازی از مقدار " +"کدپیج‌های ورودی و خروجی کنسول استفاده می‌کنند، به‌ترتیب برای stdin و stdout/" +"stderr. اگر فرایند در ابتدا به یک کنسول متصل نباشد، این مقدار به‌طور " +"پیش‌فرض :term:`locale encoding` سیستم است." -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." +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 "" +"می‌توان رفتار ویژه‌ی کنسول را با تنظیم متغیر محیطی PYTHONLEGACYWINDOWSSTDIO " +"پیش از آغاز پایتون لغو کرد. در این صورت، صفحه‌کدهای کنسول مانند هر دستگاه " +"نویسه‌ای دیگری استفاده می‌شوند." -msgid "Under all platforms, you can override the character encoding by setting the :envvar:`PYTHONIOENCODING` environment variable before starting Python or by using the new :option:`-X` ``utf8`` command line option and :envvar:`PYTHONUTF8` environment variable. However, for the Windows console, this only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." -msgstr "" +msgid "" +"Under all platforms, you can override the character encoding by setting " +"the :envvar:`PYTHONIOENCODING` environment variable before starting Python " +"or by using the new :option:`-X` ``utf8`` command line option " +"and :envvar:`PYTHONUTF8` environment variable. However, for the Windows " +"console, this only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also " +"set." +msgstr "" +"در همه‌ی سکوها، می‌توانید کدگذاری نویسه‌ها را با تنظیم متغیر " +"محیطی :envvar:`PYTHONIOENCODING` پیش از شروع پایتون یا با استفاده از گزینه‌ی " +"جدید خط فرمان :option:`-X` ``utf8`` و متغیر محیطی :envvar:`PYTHONUTF8` " +"بازنویسی کنید. با این حال، برای کنسول ویندوز، این فقط زمانی اعمال می‌شود " +"که :envvar:`PYTHONLEGACYWINDOWSSTDIO` نیز تنظیم شده باشد." -msgid "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is block-buffered like regular text files. The ``stderr`` stream is line-buffered in both cases. You can make both streams unbuffered by passing the :option:`-u` command-line option or setting the :envvar:`PYTHONUNBUFFERED` environment variable." -msgstr "" +msgid "" +"When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " +"block-buffered like regular text files. The ``stderr`` stream is line-" +"buffered in both cases. You can make both streams unbuffered by passing " +"the :option:`-u` command-line option or setting " +"the :envvar:`PYTHONUNBUFFERED` environment variable." +msgstr "" +"در حالت تعاملی، جریان ``stdout`` به‌صورت خطی بافر می‌شود. در غیر این صورت، " +"مانند فایل‌های متنی معمولی به‌صورت بلوکی بافر می‌شود. جریان ``stderr`` در هر " +"دو حالت به‌صورت خطی بافر می‌شود. شما می‌توانید با استفاده از گزینه‌ی خط " +"فرمان :option:`-u` یا تنظیم متغیر محیطی :envvar:`PYTHONUNBUFFERED`، هر دو " +"جریان را بدون بافر کنید." -msgid "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." -msgstr "" +msgid "" +"Non-interactive ``stderr`` is now line-buffered instead of fully buffered." +msgstr "``stderr`` غیرتعاملی اکنون به‌جای بافر کامل، به‌صورت خطی بافر می‌شود." -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')``." +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 "" +"برای نوشتن یا خواندن داده‌های دودویی به/از جریان‌های استاندارد، از شیء دودویی " +"زیرین :data:`~io.TextIOBase.buffer` استفاده کنید. برای مثال، برای نوشتن " +"بایت‌ها به :data:`stdout`، از ``sys.stdout.buffer.write(b'abc')`` استفاده " +"کنید." -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:`!buffer` attribute." +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:`!buffer` attribute." msgstr "" +"با این حال، اگر در حال نوشتن یک کتابخانه هستید (و کنترلی بر اینکه کد آن در " +"چه زمینه‌ای اجرا می‌شود ندارید)، توجه داشته باشید که جریان‌های استاندارد ممکن " +"است با اشیای شبه‌فایل مانند :class:`io.StringIO` جایگزین شوند که از " +"ویژگی :attr:`!buffer` پشتیبانی نمی‌کنند." -msgid "These objects contain the original values of ``stdin``, ``stderr`` and ``stdout`` at the start of the program. They are used during finalization, and could be useful to print to the actual standard stream no matter if the ``sys.std*`` object has been redirected." +msgid "" +"These objects contain the original values of ``stdin``, ``stderr`` and " +"``stdout`` at the start of the program. They are used during finalization, " +"and could be useful to print to the actual standard stream no matter if the " +"``sys.std*`` object has been redirected." msgstr "" +"این اشیاء حاوی مقادیر اصلی ``stdin``، ``stderr`` و ``stdout`` در آغاز " +"برنامه هستند. آن‌ها در طول نهایی‌سازی استفاده می‌شوند و می‌توانند برای چاپ در " +"جریان استاندارد واقعی مفید باشند، صرف‌نظر از اینکه شیء ``sys.std*`` تغییر " +"مسیر داده شده باشد." -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, the preferred way to do this is to explicitly save the previous stream before replacing it, and restore the saved object." +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, " +"the preferred way to do this is to explicitly save the previous stream " +"before replacing it, and restore the saved object." msgstr "" +"همچنین می‌توان از آن برای بازگرداندن فایل‌های واقعی به اشیای فایل سالمِ " +"شناخته‌شده استفاده کرد، در صورتی که آن‌ها با یک شیء خراب بازنویسی شده باشند. " +"با این حال، روش ترجیحی برای انجام این کار آن است که پیش از جایگزینی، جریان " +"قبلی را به‌صراحت ذخیره کنید و شیء ذخیره‌شده را بازگردانید." -msgid "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be ``None``. It is usually the case for Windows GUI apps that aren't connected to a console and Python apps started with :program:`pythonw`." +msgid "" +"Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " +"original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " +"``None``. It is usually the case for Windows GUI apps that aren't connected " +"to a console and Python apps started with :program:`pythonw`." msgstr "" +"در برخی شرایط، ``stdin``، ``stdout`` و ``stderr`` و همچنین مقادیر اصلی " +"``__stdin__``، ``__stdout__`` و ``__stderr__`` ممکن است ``None`` باشند. این " +"حالت معمولاً برای برنامه‌های GUI ویندوز که به کنسول متصل نیستند و برنامه‌های " +"پایتون که با :program:`pythonw` اجرا می‌شوند، رخ می‌دهد." -msgid "A frozenset of strings containing the names of standard library modules." +msgid "" +"A frozenset of strings containing the names of standard library modules." msgstr "" +"یک مجموعه تغییرناپذیر (frozenset) از رشته‌ها که شامل نام ماژول‌های کتابخانه‌ی " +"استاندارد است." -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 kinds are listed: pure Python, built-in, frozen and extension modules. Test modules are excluded." +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 " +"kinds are listed: pure Python, built-in, frozen and extension modules. Test " +"modules are excluded." msgstr "" +"در همه‌ی سکوها یکسان است. ماژول‌هایی که در برخی سکوها در دسترس نیستند و " +"ماژول‌هایی که هنگام ساخت پایتون غیرفعال شده‌اند نیز فهرست شده‌اند. همه‌ی انواع " +"ماژول فهرست شده‌اند: ماژول‌های پایتون خالص، توکار، فریز و الحاقی. ماژول‌های " +"آزمون مستثنی شده‌اند." -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 ``email.mime`` sub-package and the ``email.message`` sub-module are not listed." +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 " +"``email.mime`` sub-package and the ``email.message`` sub-module are not " +"listed." msgstr "" +"برای بسته‌ها، فقط بسته‌ی اصلی فهرست می‌شود: زیربسته‌ها و زیرماژول‌ها فهرست " +"نمی‌شوند. برای مثال، بسته‌ی ``email`` فهرست شده است، اما زیربسته‌ی " +"``email.mime`` و زیرماژول ``email.message`` فهرست نشده‌اند." msgid "See also the :data:`sys.builtin_module_names` list." -msgstr "" +msgstr "همچنین فهرست :data:`sys.builtin_module_names` را ببینید." -msgid "A :term:`named tuple` holding information about the thread implementation." -msgstr "" +msgid "" +"A :term:`named tuple` holding information about the thread implementation." +msgstr "یک :term:`named tuple` حاوی اطلاعاتی درباره‌ی پیاده‌سازی نخ." msgid "The name of the thread implementation:" -msgstr "" +msgstr "نام پیاده‌سازی نخ:" msgid "``\"nt\"``: Windows threads" -msgstr "" +msgstr "``\"nt\"``: نخ‌های ویندوز" msgid "``\"pthread\"``: POSIX threads" -msgstr "" +msgstr "``\"pthread\"``: نخ‌های POSIX" -msgid "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without threading support)" +msgid "" +"``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " +"threading support)" msgstr "" +"``\"pthread-stubs\"``: نخ‌های POSIX به‌صورت stub (در سکوهای WebAssembly بدون " +"پشتیبانی از نخ‌ها)" msgid "``\"solaris\"``: Solaris threads" -msgstr "" +msgstr "``\"solaris\"``: نخ‌های Solaris" msgid "The name of the lock implementation:" -msgstr "" +msgstr "نام پیاده‌سازی قفل:" msgid "``\"semaphore\"``: a lock uses a semaphore" -msgstr "" +msgstr "``\"semaphore\"``: یک قفل از یک سمافور استفاده می‌کند" msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" +"``\"mutex+cond\"``: یک قفل از یک قفل متقابل (mutex) و یک متغیر شرط (condition " +"variable) استفاده می‌کند" msgid "``None`` if this information is unknown" -msgstr "" +msgstr "``None`` اگر این اطلاعات شناخته‌نشده باشد" -msgid "The name and version of the thread library. It is a string, or ``None`` if this information is unknown." +msgid "" +"The name and version of the thread library. It is a string, or ``None`` if " +"this information is unknown." msgstr "" +"نام و نسخه‌ی کتابخانه‌ی نخ. این یک رشته است، یا اگر این اطلاعات نامشخص باشد " +"``None`` خواهد بود." -msgid "When this variable is set to an integer value, it determines the maximum number of levels of traceback information printed when an unhandled exception occurs. The default is ``1000``. When set to ``0`` or less, all traceback information is suppressed and only the exception type and value are printed." -msgstr "" +msgid "" +"When this variable is set to an integer value, it determines the maximum " +"number of levels of traceback information printed when an unhandled " +"exception occurs. The default is ``1000``. When set to ``0`` or less, all " +"traceback information is suppressed and only the exception type and value " +"are printed." +msgstr "" +"هنگامی که این متغیر روی یک مقدار عدد صحیح تنظیم شود، حداکثر تعداد سطوح " +"اطلاعات ردگیری پشته را که در هنگام رخ دادن یک استثنای مدیریت‌نشده چاپ می‌شود " +"تعیین می‌کند. مقدار پیش‌فرض ``1000`` است. هنگامی که روی ``0`` یا کمتر تنظیم " +"شود، تمام اطلاعات ردگیری پشته مهار می‌شود و تنها نوع و مقدار استثنا چاپ " +"می‌شوند." msgid "Handle an unraisable exception." -msgstr "" +msgstr "یک استثنای غیرقابل پرتاب را مدیریت کنید." -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`)." +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 "" +"هنگامی فراخوانی می‌شود که استثنایی رخ داده باشد اما پایتون هیچ راهی برای " +"مدیریت آن نداشته باشد. برای مثال، زمانی که یک تخریب‌کننده استثنایی را پرتاب " +"می‌کند یا در حین زباله‌روبی (:func:`gc.collect`)." msgid "The *unraisable* argument has the following attributes:" -msgstr "" +msgstr "آرگومان *unraisable* دارای ویژگی‌های زیر است:" msgid ":attr:`!exc_type`: Exception type." -msgstr "" +msgstr ":attr:`!exc_type`: نوع استثنا." msgid ":attr:`!exc_value`: Exception value, can be ``None``." -msgstr "" +msgstr ":attr:`!exc_value`: مقدار استثنا، می‌تواند ``None`` باشد." msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." -msgstr "" +msgstr ":attr:`!exc_traceback`: ردگیری پشته‌ی استثنا، می‌تواند ``None`` باشد." msgid ":attr:`!err_msg`: Error message, can be ``None``." -msgstr "" +msgstr ":attr:`!err_msg`: پیام خطا، می‌تواند ``None`` باشد." msgid ":attr:`!object`: Object causing the exception, can be ``None``." -msgstr "" +msgstr ":attr:`!object`: شیء ایجادکننده‌ی استثنا، می‌تواند ``None`` باشد." -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``." +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 "" +"قلاب پیش‌فرض، :attr:`!err_msg` و :attr:`!object` را به‌صورت ``f'{err_msg}: " +"{object!r}'`` قالب‌بندی می‌کند؛ اگر :attr:`!err_msg` برابر ``None`` باشد، از " +"پیام خطای \"Exception ignored in\" استفاده می‌کند." -msgid ":func:`sys.unraisablehook` can be overridden to control how unraisable exceptions are handled." +msgid "" +":func:`sys.unraisablehook` can be overridden to control how unraisable " +"exceptions are handled." msgstr "" +"می‌توان :func:`sys.unraisablehook` را بازنویسی کرد تا چگونگی مدیریت " +"استثناهای غیرقابل‌پرتاب کنترل شود." msgid ":func:`excepthook` which handles uncaught exceptions." -msgstr "" +msgstr ":func:`excepthook` که استثناهای گرفته‌نشده را مدیریت می‌کند." -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." +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 "" +"ذخیره‌ی :attr:`!exc_value` با استفاده از یک قلاب سفارشیمی‌تواند یک " +"چرخه‌ی ارجاع ایجاد کند. هنگامی که دیگر نیازی به استثنا نیست، باید به‌صورت " +"صریح پاک شود تا چرخه‌ی ارجاع شکسته شود." -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." +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 "" +"ذخیره‌سازی :attr:`!object` با استفاده از یک هوک سفارشی (custom hook) می‌تواند " +"باعث زنده‌سازی مجدد آن شود، اگر به شیءای تنظیم شده باشد که در حال نهایی‌سازی " +"است. برای جلوگیری از زنده‌سازی مجدد اشیاء، پس از تکمیل هوک سفارشی (custom " +"hook) از ذخیره‌سازی :attr:`!object` خودداری کنید." -msgid "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, *unraisable* when an exception that cannot be handled occurs. The *unraisable* object is the same as what will be passed to the hook. If no hook has been set, *hook* may be ``None``." +msgid "" +"Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " +"*unraisable* when an exception that cannot be handled occurs. The " +"*unraisable* object is the same as what will be passed to the hook. If no " +"hook has been set, *hook* may be ``None``." msgstr "" +"هنگامی که استثنایی غیرقابل‌مدیریت رخ می‌دهد، یک رویداد حسابرسی " +"``sys.unraisablehook`` را با آرگومان‌های *hook* و *unraisable* پرتاب می‌کند. " +"شیء *unraisable* همان چیزی است که به هوکارسال خواهد شد. اگر هیچ " +"هوکی تنظیم نشده باشد، *hook* ممکن است ``None`` باشد." -msgid "A string containing the version number of the Python interpreter plus additional information on the build number and compiler used. This string is displayed when the interactive interpreter is started. Do not extract version information out of it, rather, use :data:`version_info` and the functions provided by the :mod:`platform` module." +msgid "" +"A string containing the version number of the Python interpreter plus " +"additional information on the build number and compiler used. This string " +"is displayed when the interactive interpreter is started. Do not extract " +"version information out of it, rather, use :data:`version_info` and the " +"functions provided by the :mod:`platform` module." msgstr "" +"رشته‌ای شامل شماره‌ی نسخه‌ی مفسر پایتون به‌همراه اطلاعات تکمیلی درباره‌ی شماره‌ی " +"ساخت و کامپایلر استفاده‌شده. این رشته هنگام راه‌اندازی مفسر تعاملی نمایش داده " +"می‌شود. اطلاعات نسخه را از آن استخراج نکنید، بلکه از :data:`version_info` و " +"توابع ارائه‌شده توسط ماژول :mod:`platform` استفاده کنید." -msgid "The C API version, equivalent to the C macro :c:macro:`PYTHON_API_VERSION`. Defined for backwards compatibility." +msgid "" +"The C API version, equivalent to the C macro :c:macro:`PYTHON_API_VERSION`. " +"Defined for backwards compatibility." msgstr "" +"نسخه‌ی C API، معادل ماکروی C :c:macro:`PYTHON_API_VERSION`. برای سازگاری با " +"نسخه‌های پیشین تعریف شده است." -msgid "Currently, this constant is not updated in new Python versions, and is not useful for versioning. This may change in the future." +msgid "" +"Currently, this constant is not updated in new Python versions, and is not " +"useful for versioning. This may change in the future." msgstr "" +"در حال حاضر، این ثابت در نسخه‌های جدید پایتون به‌روزرسانی نمی‌شود و برای " +"نسخه‌بندی مفید نیست. این ممکن است در آینده تغییر کند." -msgid "A tuple containing the five components of the version number: *major*, *minor*, *micro*, *releaselevel*, and *serial*. All values except *releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, ``'candidate'``, or ``'final'``. The ``version_info`` value corresponding to the Python version 2.0 is ``(2, 0, 0, 'final', 0)``. The components can also be accessed by name, so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major`` and so on." -msgstr "" +msgid "" +"A tuple containing the five components of the version number: *major*, " +"*minor*, *micro*, *releaselevel*, and *serial*. All values except " +"*releaselevel* are integers; the release level is ``'alpha'``, ``'beta'``, " +"``'candidate'``, or ``'final'``. The ``version_info`` value corresponding " +"to the Python version 2.0 is ``(2, 0, 0, 'final', 0)``. The components can " +"also be accessed by name, so ``sys.version_info[0]`` is equivalent to " +"``sys.version_info.major`` and so on." +msgstr "" +"یک تاپل شامل پنج کامپوننت از شماره نسخه: *major*، *minor*، *micro*، " +"*releaselevel* و *serial*. همه مقادیر به‌جز *releaselevel* عدد صحیح هستند؛ " +"سطح انتشار یکی از ``'alpha'``، ``'beta'``، ``'candidate'`` یا ``'final'`` " +"است. مقدار ``version_info`` متناظر با نسخه 2.0 پایتون برابر با ``(2, 0, 0, " +"'final', 0)`` است. این کامپوننت‌ها با نام نیز قابل دسترسی هستند، بنابراین " +"``sys.version_info[0]`` معادل ``sys.version_info.major`` است و به همین " +"ترتیب." msgid "Added named component attributes." -msgstr "" +msgstr "ویژگی‌های کامپوننت نام‌دار افزوده شد." -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." +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 "" +"این جزئیاتی از پیاده‌سازی چارچوب هشدارها است؛ این مقدار را تغییر ندهید. برای " +"اطلاعات بیشتر درباره چارچوب هشدارها به ماژول :mod:`warnings` مراجعه کنید." -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 major and minor versions of the running Python interpreter. It is provided in the :mod:`!sys` module for informational purposes; modifying this value has no effect on the registry keys used by Python." -msgstr "" +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 major and minor versions of the running Python interpreter. It is " +"provided in the :mod:`!sys` module for informational purposes; modifying " +"this value has no effect on the registry keys used by Python." +msgstr "" +"شماره نسخه‌ای که برای تشکیل کلیدهای رجیستری در سکوهای ویندوزی به کار می‌رود. " +"این مقدار به‌عنوان منبع رشته 1000 در DLL پایتون ذخیره شده است. این مقدار " +"معمولاً نسخه‌های اصلی و فرعی مفسر پایتون در حال اجرا است. این مقدار در " +"ماژول :mod:`!sys` برای اهداف اطلاع‌رسانی ارائه شده است؛ تغییر این مقدار " +"تأثیری بر کلیدهای رجیستری مورد استفاده پایتون ندارد." -msgid "Namespace containing functions and constants for register callbacks and controlling monitoring events. See :mod:`sys.monitoring` for details." +msgid "" +"Namespace containing functions and constants for register callbacks and " +"controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" +"فضای نامی شامل تابع‌ها و ثابت‌ها برای ثبت کال‌بک‌ها و کنترل رویدادهای پایش. " +"برای جزئیات، :mod:`sys.monitoring` را ببینید." -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:" +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 "" +"یک دیکشنری از پرچم‌های مختلف خاصِ پیاده‌سازی که از طریق گزینه‌ی خط " +"فرمان :option:`-X` منتقل می‌شوند. نام گزینه‌ها یا در صورت داده شدن به‌صورت " +"صریح به مقدارهای خود نگاشت می‌شوند، یا به :const:`True`. مثال:" msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" "[GCC 4.4.3] on linux2\n" -"Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" ">>> import sys\n" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" msgstr "" +"$ ./python -Xa=b -Xc\n" +"Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" +"[GCC 4.4.3] on linux2\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>> import sys\n" +">>> sys._xoptions\n" +"{'a': 'b', 'c': True}" -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." +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 "" +"این یک روش مخصوص CPython برای دسترسی به گزینه‌های ارسال‌شده از طریق :option:`-" +"X` است. سایر پیاده‌سازی‌ها ممکن است آن‌ها را از روش‌های دیگری صادر کنند، یا " +"اصلاً صادر نکنند." msgid "Citations" -msgstr "" +msgstr "ارجاعات" -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/n1256.pdf\\ ." +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/" +"n1256.pdf\\ ." msgstr "" +"ISO/IEC 9899:1999. «زبان‌های برنامه‌نویسی -- C.» پیش‌نویس عمومی از این " +"استاندارد در دسترس است: https://www.open-std.org/jtc1/sc22/wg14/www/docs/" +"n1256.pdf\\ ." msgid "auditing" -msgstr "" +msgstr "حسابرسی" msgid "object" -msgstr "" +msgstr "شیء" msgid "traceback" -msgstr "" +msgstr "ردگیری" msgid "profile function" -msgstr "" +msgstr "تابع پروفایل" msgid "profiler" -msgstr "" +msgstr "پروفایلر (profiler)" msgid "trace function" -msgstr "" +msgstr "تابع ردگیری" msgid "debugger" -msgstr "" +msgstr "اشکال‌زدا" msgid "module" -msgstr "" +msgstr "ماژول" msgid "search" -msgstr "" +msgstr "جستجو" msgid "path" -msgstr "" +msgstr "مسیر" msgid "interpreter prompts" -msgstr "" +msgstr "اعلان‌های مفسر" msgid "prompts, interpreter" -msgstr "" +msgstr "اعلان‌ها، مفسر" msgid ">>>" -msgstr "" +msgstr ">>>" msgid "interpreter prompt" -msgstr "" +msgstr "اعلان مفسر" msgid "..." -msgstr "" +msgstr "..." diff --git a/library/sys_path_init.po b/library/sys_path_init.po index 7b34d7113..e3b3519f5 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -22,82 +22,265 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "The initialization of the :data:`sys.path` module search path" -msgstr "" +msgstr "مقداردهی اولیه‌ی مسیر جستجوی ماژول :data:`sys.path`" -msgid "A module search path is initialized when Python starts. This module search path may be accessed at :data:`sys.path`." +msgid "" +"A module search path is initialized when Python starts. This module search " +"path may be accessed at :data:`sys.path`." msgstr "" +"مسیر جستجوی ماژول هنگام شروع پایتون مقداردهی اولیه می‌شود. این مسیر جستجوی " +"ماژول در :data:`sys.path` قابل دسترسی است." -msgid "The first entry in the module search path is the directory that contains the input script, if there is one. Otherwise, the first entry is the current directory, which is the case when executing the interactive shell, a :option:`-c` command, or :option:`-m` module." +msgid "" +"The first entry in the module search path is the directory that contains the" +" input script, if there is one. Otherwise, the first entry is the current " +"directory, which is the case when executing the interactive shell, a " +":option:`-c` command, or :option:`-m` module." msgstr "" +"اولین ورودی در مسیر جستجوی ماژول، پوشه حاوی اسکریپت ورودی است، اگر چنین " +"اسکریپتی وجود داشته باشد. در غیر این صورت، اولین ورودی پوشه جاری است؛ این " +"حالت هنگام اجرای پوسته تعاملی، یک فرمان :option:`-c` یا ماژول :option:`-m` " +"رخ می‌دهد." -msgid "The :envvar:`PYTHONPATH` environment variable is often used to add directories to the search path. If this environment variable is found then the contents are added to the module search path." +msgid "" +"The :envvar:`PYTHONPATH` environment variable is often used to add " +"directories to the search path. If this environment variable is found then " +"the contents are added to the module search path." msgstr "" +"متغیر محیطی :envvar:`PYTHONPATH` اغلب برای افزودن پوشه‌ها به مسیر جستجو " +"استفاده می‌شود. اگر این متغیر محیطی یافت شود، محتویات آن به مسیر جستجوی " +"ماژول افزوده می‌شوند." -msgid ":envvar:`PYTHONPATH` will affect all installed Python versions/environments. Be wary of setting this in your shell profile or global environment variables. The :mod:`site` module offers more nuanced techniques as mentioned below." +msgid "" +":envvar:`PYTHONPATH` will affect all installed Python versions/environments." +" Be wary of setting this in your shell profile or global environment " +"variables. The :mod:`site` module offers more nuanced techniques as " +"mentioned below." msgstr "" +":envvar:`PYTHONPATH` بر تمام نسخه‌ها/محیط‌های نصب‌شده‌ی پایتون تأثیر خواهد " +"گذاشت. در تنظیم این متغیر در پروفایل پوسته یا متغیرهای محیطی سراسری احتیاط " +"کنید. ماژول :mod:`site` همان‌طور که در ادامه ذکر شده است، روش‌های ظریف‌تری " +"ارائه می‌دهد." -msgid "The next items added are the directories containing standard Python modules as well as any :term:`extension module`\\s that these modules depend on. Extension modules are ``.pyd`` files on Windows and ``.so`` files on other platforms. The directory with the platform-independent Python modules is called ``prefix``. The directory with the extension modules is called ``exec_prefix``." +msgid "" +"The next items added are the directories containing standard Python modules " +"as well as any :term:`extension module`\\s that these modules depend on. " +"Extension modules are ``.pyd`` files on Windows and ``.so`` files on other " +"platforms. The directory with the platform-independent Python modules is " +"called ``prefix``. The directory with the extension modules is called " +"``exec_prefix``." msgstr "" +"آیتم‌های بعدی که اضافه می‌شوند، پوشه‌هایی هستند که ماژول‌های استاندارد " +"پایتون و همچنین هر ماژول افزونه‌ای (:term:`extension module`\\s) را که این " +"ماژول‌ها به آن وابسته‌اند، شامل می‌شوند. ماژول‌های افزونه‌ای، فایل‌های " +"``.pyd`` در ویندوز و فایل‌های ``.so`` در سایر سکوها هستند. پوشه‌ی حاوی " +"ماژول‌های پایتون مستقل از سکو، ``prefix`` نامیده می‌شود. پوشه‌ی حاوی " +"ماژول‌های افزونه‌ای، ``exec_prefix`` نامیده می‌شود." -msgid "The :envvar:`PYTHONHOME` environment variable may be used to set the ``prefix`` and ``exec_prefix`` locations. Otherwise these directories are found by using the Python executable as a starting point and then looking for various 'landmark' files and directories. Note that any symbolic links are followed so the real Python executable location is used as the search starting point. The Python executable location is called ``home``." +msgid "" +"The :envvar:`PYTHONHOME` environment variable may be used to set the " +"``prefix`` and ``exec_prefix`` locations. Otherwise these directories are " +"found by using the Python executable as a starting point and then looking " +"for various 'landmark' files and directories. Note that any symbolic links " +"are followed so the real Python executable location is used as the search " +"starting point. The Python executable location is called ``home``." msgstr "" +"از متغیر محیطی :envvar:`PYTHONHOME` می‌شود برای تنظیم محل‌های ``prefix`` و " +"``exec_prefix`` استفاده کرد. در غیر این صورت، این پوشه‌ها با استفاده از فایل" +" اجرایی پایتون به‌عنوان نقطه آغاز و سپس با جست‌وجوی فایل‌ها و پوشه‌های " +"«نشانه» مختلف پیدا می‌شوند. توجه داشته باشید که هرگونه پیوند نمادینی دنبال " +"می‌شود، بنابراین مکان واقعی فایل اجرایی پایتون به‌عنوان نقطه آغاز جست‌وجو " +"استفاده می‌شود. مکان فایل اجرایی پایتون ``home`` نامیده می‌شود." -msgid "Once ``home`` is determined, the ``prefix`` directory is found by first looking for :file:`python{majorversion}{minorversion}.zip` (``python311.zip``). On Windows the zip archive is searched for in ``home`` and on Unix the archive is expected to be in :file:`lib`. Note that the expected zip archive location is added to the module search path even if the archive does not exist. If no archive was found, Python on Windows will continue the search for ``prefix`` by looking for :file:`Lib\\\\os.py`. Python on Unix will look for :file:`lib/python{majorversion}.{minorversion}/os.py` (``lib/python3.11/os.py``). On Windows ``prefix`` and ``exec_prefix`` are the same, however on other platforms :file:`lib/python{majorversion}.{minorversion}/lib-dynload` (``lib/python3.11/lib-dynload``) is searched for and used as an anchor for ``exec_prefix``. On some platforms :file:`lib` may be :file:`lib64` or another value, see :data:`sys.platlibdir` and :envvar:`PYTHONPLATLIBDIR`." +msgid "" +"Once ``home`` is determined, the ``prefix`` directory is found by first " +"looking for :file:`python{majorversion}{minorversion}.zip` " +"(``python311.zip``). On Windows the zip archive is searched for in ``home`` " +"and on Unix the archive is expected to be in :file:`lib`. Note that the " +"expected zip archive location is added to the module search path even if the" +" archive does not exist. If no archive was found, Python on Windows will " +"continue the search for ``prefix`` by looking for :file:`Lib\\\\os.py`. " +"Python on Unix will look for " +":file:`lib/python{majorversion}.{minorversion}/os.py` " +"(``lib/python3.11/os.py``). On Windows ``prefix`` and ``exec_prefix`` are " +"the same, however on other platforms " +":file:`lib/python{majorversion}.{minorversion}/lib-dynload` " +"(``lib/python3.11/lib-dynload``) is searched for and used as an anchor for " +"``exec_prefix``. On some platforms :file:`lib` may be :file:`lib64` or " +"another value, see :data:`sys.platlibdir` and :envvar:`PYTHONPLATLIBDIR`." msgstr "" +"پس از تعیین ``home``، پوشه‌ی ``prefix`` ابتدا با جستجو برای " +":file:`python{majorversion}{minorversion}.zip` (``python311.zip``) یافت " +"می‌شود. در ویندوز، بایگانی zip در ``home`` جستجو می‌شود و در یونیکس انتظار " +"می‌رود بایگانی در :file:`lib` قرار داشته باشد. توجه داشته باشید که محل مورد " +"انتظار برای بایگانی zip حتی اگر بایگانی وجود نداشته باشد، به مسیر جستجوی " +"ماژول افزوده می‌شود. اگر هیچ بایگانی‌ای یافت نشد، پایتون در ویندوز جستجو " +"برای یافتن ``prefix`` را با جستجوی :file:`Lib\\\\os.py` ادامه می‌دهد. پایتون" +" در یونیکس به دنبال :file:`lib/python{majorversion}.{minorversion}/os.py` " +"(``lib/python3.11/os.py``) می‌گردد. در ویندوز ``prefix`` و ``exec_prefix`` " +"یکسان هستند، اما در سایر پلتفرم‌ها " +":file:`lib/python{majorversion}.{minorversion}/lib-dynload` " +"(``lib/python3.11/lib-dynload``) جستجو می‌شود و به‌عنوان مبنایی برای " +"``exec_prefix`` استفاده می‌شود. در برخی پلتفرم‌ها ممکن است :file:`lib` برابر" +" با :file:`lib64` یا مقدار دیگری باشد؛ :data:`sys.platlibdir` و " +":envvar:`PYTHONPLATLIBDIR` را ببینید." -msgid "Once found, ``prefix`` and ``exec_prefix`` are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix` respectively." +msgid "" +"Once found, ``prefix`` and ``exec_prefix`` are available at " +":data:`sys.base_prefix` and :data:`sys.base_exec_prefix` respectively." msgstr "" +"پس از یافت شدن، ``prefix`` و ``exec_prefix`` به‌ترتیب در " +":data:`sys.base_prefix` و :data:`sys.base_exec_prefix` در دسترس هستند." -msgid "If :envvar:`PYTHONHOME` is not set, and a ``pyvenv.cfg`` file is found alongside the main executable, or in its parent directory, :data:`sys.prefix` and :data:`sys.exec_prefix` get set to the directory containing ``pyvenv.cfg``, otherwise they are set to the same value as :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`, respectively. This is used by :ref:`sys-path-init-virtual-environments`." +msgid "" +"If :envvar:`PYTHONHOME` is not set, and a ``pyvenv.cfg`` file is found " +"alongside the main executable, or in its parent directory, " +":data:`sys.prefix` and :data:`sys.exec_prefix` get set to the directory " +"containing ``pyvenv.cfg``, otherwise they are set to the same value as " +":data:`sys.base_prefix` and :data:`sys.base_exec_prefix`, respectively. This" +" is used by :ref:`sys-path-init-virtual-environments`." msgstr "" +"اگر :envvar:`PYTHONHOME` تنظیم‌نشده باشد و یک فایل ``pyvenv.cfg`` در کنار " +"فایل اجرایی اصلی یا در پوشه‌ی والد آن پیدا شود، :data:`sys.prefix` و " +":data:`sys.exec_prefix` به پوشه‌ی حاوی ``pyvenv.cfg`` تنظیم می‌شوند؛ در غیر " +"این صورت، آن‌ها به‌ترتیب به همان مقدار :data:`sys.base_prefix` و " +":data:`sys.base_exec_prefix` تنظیم می‌شوند. این توسط :ref:`sys-path-init-" +"virtual-environments` استفاده می‌شود." -msgid "Finally, the :mod:`site` module is processed and :file:`site-packages` directories are added to the module search path. A common way to customize the search path is to create :mod:`sitecustomize` or :mod:`usercustomize` modules as described in the :mod:`site` module documentation." +msgid "" +"Finally, the :mod:`site` module is processed and :file:`site-packages` " +"directories are added to the module search path. A common way to customize " +"the search path is to create :mod:`sitecustomize` or :mod:`usercustomize` " +"modules as described in the :mod:`site` module documentation." msgstr "" +"در نهایت، ماژول :mod:`site` پردازش می‌شود و پوشه‌های :file:`site-packages` " +"به مسیر جستجوی ماژول افزوده می‌شوند. یک روش رایج برای سفارشی‌سازی مسیر " +"جستجو، ایجاد ماژول‌های :mod:`sitecustomize` یا :mod:`usercustomize` است، " +"همان‌طور که در مستندات ماژول :mod:`site` توضیح داده شده است." -msgid "Certain command line options may further affect path calculations. See :option:`-E`, :option:`-I`, :option:`-s` and :option:`-S` for further details." +msgid "" +"Certain command line options may further affect path calculations. See " +":option:`-E`, :option:`-I`, :option:`-s` and :option:`-S` for further " +"details." msgstr "" +"برخی گزینه‌های خط فرمان ممکن است بر محاسبات مسیر تأثیر بیشتری بگذارند. برای " +"جزئیات بیشتر، :option:`-E`، :option:`-I`، :option:`-s` و :option:`-S` را " +"ببینید." -msgid ":data:`sys.prefix` and :data:`sys.exec_prefix` are now set to the ``pyvenv.cfg`` directory during the path initialization. This was previously done by :mod:`site`, therefore affected by :option:`-S`." +msgid "" +":data:`sys.prefix` and :data:`sys.exec_prefix` are now set to the " +"``pyvenv.cfg`` directory during the path initialization. This was previously" +" done by :mod:`site`, therefore affected by :option:`-S`." msgstr "" +":data:`sys.prefix` و :data:`sys.exec_prefix` اکنون در حین مقداردهی اولیه‌ی " +"مسیر به پوشه‌ی حاوی ``pyvenv.cfg`` تنظیم می‌شوند. این کار پیش‌تر توسط " +":mod:`site` انجام می‌شد، بنابراین تحت تأثیر :option:`-S` قرار می‌گرفت." msgid "Virtual Environments" -msgstr "" +msgstr "محیط‌های مجازی" -msgid "Virtual environments place a ``pyvenv.cfg`` file in their prefix, which causes :data:`sys.prefix` and :data:`sys.exec_prefix` to point to them, instead of the base installation." +msgid "" +"Virtual environments place a ``pyvenv.cfg`` file in their prefix, which " +"causes :data:`sys.prefix` and :data:`sys.exec_prefix` to point to them, " +"instead of the base installation." msgstr "" +"محیط‌های مجازی یک فایل ``pyvenv.cfg`` را در پیشوند (prefix) خود قرار " +"می‌دهند، که باعث می‌شود :data:`sys.prefix` و :data:`sys.exec_prefix` به جای " +"نصب پایه، به آن‌ها اشاره کنند." -msgid "The ``prefix`` and ``exec_prefix`` values of the base installation are available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`." +msgid "" +"The ``prefix`` and ``exec_prefix`` values of the base installation are " +"available at :data:`sys.base_prefix` and :data:`sys.base_exec_prefix`." msgstr "" +"مقادیر ``prefix`` و ``exec_prefix`` مربوط به نصب پایه، در " +":data:`sys.base_prefix` و :data:`sys.base_exec_prefix` در دسترس هستند." -msgid "As well as being used as a marker to identify virtual environments, ``pyvenv.cfg`` may also be used to configure the :mod:`site` initialization. Please refer to :mod:`site`'s :ref:`virtual environments documentation `." +msgid "" +"As well as being used as a marker to identify virtual environments, " +"``pyvenv.cfg`` may also be used to configure the :mod:`site` initialization." +" Please refer to :mod:`site`'s :ref:`virtual environments documentation " +"`." msgstr "" +"علاوه بر استفاده به‌عنوان نشانگری برای شناسایی محیط‌های مجازی، می‌توان از " +"``pyvenv.cfg`` همچنین برای پیکربندی مقداردهی اولیه :mod:`site` استفاده کرد. " +"لطفاً به :ref:`مستندات محیط‌های مجازی ` مربوط به :mod:`site` مراجعه کنید." msgid ":envvar:`PYTHONHOME` overrides the ``pyvenv.cfg`` detection." -msgstr "" +msgstr ":envvar:`PYTHONHOME` بر شناسایی ``pyvenv.cfg`` مقدم است." -msgid "There are other ways how \"virtual environments\" could be implemented, this documentation refers implementations based on the ``pyvenv.cfg`` mechanism, such as :mod:`venv`. Most virtual environment implementations follow the model set by :mod:`venv`, but there may be exotic implementations that diverge from it." +msgid "" +"There are other ways how \"virtual environments\" could be implemented, this" +" documentation refers implementations based on the ``pyvenv.cfg`` mechanism," +" such as :mod:`venv`. Most virtual environment implementations follow the " +"model set by :mod:`venv`, but there may be exotic implementations that " +"diverge from it." msgstr "" +"روش‌های دیگری نیز برای پیاده‌سازی «محیط‌های مجازی» وجود دارد؛ این مستندات به" +" پیاده‌سازی‌هایی اشاره می‌کند که بر پایه‌ی سازوکار ``pyvenv.cfg`` هستند، " +"مانند :mod:`venv`. بیشتر پیاده‌سازی‌های محیط مجازی از مدلی پیروی می‌کنند که " +":mod:`venv` تعیین کرده است، اما ممکن است پیاده‌سازی‌های غیرمتعارفی وجود " +"داشته باشند که از آن منحرف شوند." msgid "_pth files" -msgstr "" +msgstr "پرونده‌های _pth" -msgid "To completely override :data:`sys.path` create a ``._pth`` file with the same name as the shared library or executable (``python._pth`` or ``python311._pth``). The shared library path is always known on Windows, however it may not be available on other platforms. In the ``._pth`` file specify one line for each path to add to :data:`sys.path`. The file based on the shared library name overrides the one based on the executable, which allows paths to be restricted for any program loading the runtime if desired." +msgid "" +"To completely override :data:`sys.path` create a ``._pth`` file with the " +"same name as the shared library or executable (``python._pth`` or " +"``python311._pth``). The shared library path is always known on Windows, " +"however it may not be available on other platforms. In the ``._pth`` file " +"specify one line for each path to add to :data:`sys.path`. The file based on" +" the shared library name overrides the one based on the executable, which " +"allows paths to be restricted for any program loading the runtime if " +"desired." msgstr "" +"برای لغو کامل :data:`sys.path`، یک فایل ``._pth`` با همان نام کتابخانه‌ی " +"اشتراکی یا فایل اجرایی (``python._pth`` یا ``python311._pth``) ایجاد کنید. " +"مسیر کتابخانه‌ی اشتراکی همیشه در ویندوز شناخته‌شده است، اما ممکن است در سایر" +" پلتفرم‌ها در دسترس نباشد. در فایل ``._pth``، یک خط برای هر مسیر جهت افزودن " +"به :data:`sys.path` مشخص کنید. فایل مبتنی بر نام کتابخانه‌ی اشتراکی، فایل " +"مبتنی بر فایل اجرایی را لغو می‌کند، که این امکان را فراهم می‌کند تا در صورت " +"تمایل، مسیرها برای هر برنامه‌ای که ران‌تایم را بارگذاری می‌کند محدود شوند." -msgid "When the file exists, all registry and environment variables are ignored, isolated mode is enabled, and :mod:`site` is not imported unless one line in the file specifies ``import site``. Blank paths and lines starting with ``#`` are ignored. Each path may be absolute or relative to the location of the file. Import statements other than to ``site`` are not permitted, and arbitrary code cannot be specified." +msgid "" +"When the file exists, all registry and environment variables are ignored, " +"isolated mode is enabled, and :mod:`site` is not imported unless one line in" +" the file specifies ``import site``. Blank paths and lines starting with " +"``#`` are ignored. Each path may be absolute or relative to the location of " +"the file. Import statements other than to ``site`` are not permitted, and " +"arbitrary code cannot be specified." msgstr "" +"هنگامی که فایل وجود دارد، تمام متغیرهای رجیستری و محیطی نادیده گرفته " +"می‌شوند، حالت ایزوله فعال می‌شود، و :mod:`site` ایمپورت نمی‌شود مگر اینکه یک" +" خط در فایل ``import site`` را مشخص کند. مسیرهای خالی و خطوطی که با ``#`` " +"شروع می‌شوند نادیده گرفته می‌شوند. هر مسیر می‌تواند مطلق یا نسبی نسبت به محل" +" فایل باشد. دستورهای ایمپورت به‌جز برای ``site`` مجاز نیستند، و نمی‌توان کد " +"دلخواهی را مشخص کرد." -msgid "Note that ``.pth`` files (without leading underscore) will be processed normally by the :mod:`site` module when ``import site`` has been specified." +msgid "" +"Note that ``.pth`` files (without leading underscore) will be processed " +"normally by the :mod:`site` module when ``import site`` has been specified." msgstr "" +"توجه داشته باشید که فایل‌های ``.pth`` (بدون زیرخط آغازین) زمانی به‌طور عادی " +"توسط ماژول :mod:`site` پردازش می‌شوند که ``import site`` مشخص شده باشد." msgid "Embedded Python" -msgstr "" +msgstr "پایتون نهفته" -msgid "If Python is embedded within another application :c:func:`Py_InitializeFromConfig` and the :c:type:`PyConfig` structure can be used to initialize Python. The path specific details are described at :ref:`init-path-config`." +msgid "" +"If Python is embedded within another application " +":c:func:`Py_InitializeFromConfig` and the :c:type:`PyConfig` structure can " +"be used to initialize Python. The path specific details are described at " +":ref:`init-path-config`." msgstr "" +"اگر پایتون درون یک برنامه کاربردی دیگر نهفته باشد، می‌توان از " +":c:func:`Py_InitializeFromConfig` و ساختار :c:type:`PyConfig` برای " +"راه‌اندازی پایتون استفاده کرد. جزئیات مربوط به مسیر در :ref:`init-path-" +"config` شرح داده شده‌اند." msgid ":ref:`windows_finding_modules` for detailed Windows notes." -msgstr "" +msgstr ":ref:`windows_finding_modules` برای یادداشت‌های تفصیلی ویندوز." msgid ":ref:`using-on-unix` for Unix details." -msgstr "" +msgstr ":ref:`using-on-unix` برای جزئیات یونیکس." diff --git a/library/sysconfig.po b/library/sysconfig.po index 2b9263680..fba98788e 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -23,44 +23,75 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -msgid ":mod:`!sysconfig` --- Provide access to Python's configuration information" +msgid "" +":mod:`!sysconfig` --- Provide access to Python's configuration information" msgstr "" +":mod:`!sysconfig` --- دسترسی به اطلاعات پیکربندی پایتون را فراهم می‌کند" msgid "**Source code:** :source:`Lib/sysconfig`" -msgstr "" +msgstr ":source:`Lib/sysconfig`" -msgid "The :mod:`!sysconfig` module provides access to Python's configuration information like the list of installation paths and the configuration variables relevant for the current platform." +msgid "" +"The :mod:`!sysconfig` module provides access to Python's configuration " +"information like the list of installation paths and the configuration " +"variables relevant for the current platform." msgstr "" +"ماژول :mod:`!sysconfig` دسترسی به اطلاعات پیکربندی پایتون، مانند فهرست " +"مسیرهای نصب و متغیرهای پیکربندی مرتبط با پلتفرم فعلی را فراهم می‌کند." msgid "Configuration variables" -msgstr "" +msgstr "متغیرهای پیکربندی" -msgid "A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` header file that are necessary to build both the Python binary itself and third-party C extensions compiled using ``setuptools``." +msgid "" +"A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` " +"header file that are necessary to build both the Python binary itself and " +"third-party C extensions compiled using ``setuptools``." msgstr "" +"یک توزیع پایتون شامل یک :file:`Makefile` و یک فایل سرآیند :file:`pyconfig.h`" +" است که برای ساخت خود فایل دودویی پایتون و نیز افزونه‌های C شخص ثالث که با " +"استفاده از ``setuptools`` کامپایل می‌شوند، ضروری هستند." -msgid ":mod:`!sysconfig` puts all variables found in these files in a dictionary that can be accessed using :func:`get_config_vars` or :func:`get_config_var`." +msgid "" +":mod:`!sysconfig` puts all variables found in these files in a dictionary " +"that can be accessed using :func:`get_config_vars` or " +":func:`get_config_var`." msgstr "" +":mod:`!sysconfig` تمام متغیرهای موجود در این فایل‌ها را در یک دیکشنری قرار " +"می‌دهد که می‌توان با استفاده از :func:`get_config_vars` یا " +":func:`get_config_var` به آن دسترسی داشت." msgid "Notice that on Windows, it's a much smaller set." -msgstr "" +msgstr "توجه داشته باشید که در ویندوز، این مجموعه بسیار کوچک‌تر است." -msgid "With no arguments, return a dictionary of all configuration variables relevant for the current platform." +msgid "" +"With no arguments, return a dictionary of all configuration variables " +"relevant for the current platform." msgstr "" +"بدون آرگومان، یک دیکشنری از تمام متغیرهای پیکربندی مرتبط با پلتفرم جاری را " +"برمی‌گرداند." -msgid "With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary." +msgid "" +"With arguments, return a list of values that result from looking up each " +"argument in the configuration variable dictionary." msgstr "" +"با آرگومان‌ها، فهرستی از مقادیر حاصل از جست‌وجوی هر آرگومان در دیکشنری " +"متغیرهای پیکربندی را برمی‌گرداند." msgid "For each argument, if the value is not found, return ``None``." -msgstr "" +msgstr "برای هر آرگومان، اگر مقدار یافت نشود، ``None`` برگردانده می‌شود." -msgid "Return the value of a single variable *name*. Equivalent to ``get_config_vars().get(name)``." +msgid "" +"Return the value of a single variable *name*. Equivalent to " +"``get_config_vars().get(name)``." msgstr "" +"مقدار یک متغیر واحد *name* را برمی‌گرداند. معادل " +"``get_config_vars().get(name)`` است." msgid "If *name* is not found, return ``None``." -msgstr "" +msgstr "اگر *name* پیدا نشد، ``None`` برگردانده می‌شود." msgid "Example of usage::" -msgstr "" +msgstr "نمونه‌ای از کاربرد::" msgid "" ">>> import sysconfig\n" @@ -71,363 +102,625 @@ msgid "" ">>> sysconfig.get_config_vars('AR', 'CXX')\n" "['ar', 'g++']" msgstr "" +">>> import sysconfig\n" +">>> sysconfig.get_config_var('Py_ENABLE_SHARED')\n" +"0\n" +">>> sysconfig.get_config_var('LIBDIR')\n" +"'/usr/local/lib'\n" +">>> sysconfig.get_config_vars('AR', 'CXX')\n" +"['ar', 'g++']" msgid "Installation paths" -msgstr "" +msgstr "مسیرهای نصب" -msgid "Python uses an installation scheme that differs depending on the platform and on the installation options. These schemes are stored in :mod:`!sysconfig` under unique identifiers based on the value returned by :const:`os.name`. The schemes are used by package installers to determine where to copy files to." +msgid "" +"Python uses an installation scheme that differs depending on the platform " +"and on the installation options. These schemes are stored in " +":mod:`!sysconfig` under unique identifiers based on the value returned by " +":const:`os.name`. The schemes are used by package installers to determine " +"where to copy files to." msgstr "" +"پایتون از یک طرح‌واره نصب استفاده می‌کند که بسته به سکو و گزینه‌های نصب متفاوت " +"است. این طرح‌ها در :mod:`!sysconfig` با شناسه‌های یکتا بر اساس مقدار " +"برگردانده‌شده توسط :const:`os.name` ذخیره شده‌اند. نصب‌کننده‌های بسته از این" +" طرح‌ها برای تعیین محل کپی فایل‌ها استفاده می‌کنند." msgid "Python currently supports nine schemes:" -msgstr "" +msgstr "پایتون در حال حاضر از ۹ روش پشتیبانی می‌کند:" -msgid "*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the default scheme used when Python or a component is installed." +msgid "" +"*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the" +" default scheme used when Python or a component is installed." msgstr "" +"*posix_prefix*: طرحی برای سکوهای POSIX مانند Linux یا macOS. این طرح‌واره " +"پیش‌فرضی است که هنگام نصب Python یا یک کامپوننت استفاده می‌شود." -msgid "*posix_home*: scheme for POSIX platforms, when the *home* option is used. This scheme defines paths located under a specific home prefix." +msgid "" +"*posix_home*: scheme for POSIX platforms, when the *home* option is used. " +"This scheme defines paths located under a specific home prefix." msgstr "" +"*posix_home*: طرحی برای پلتفرم‌های POSIX، هنگامی که از گزینه *home* استفاده " +"می‌شود. این طرح‌واره مسیرهایی را تعریف می‌کند که زیر یک پیشوند *home* مشخص قرار " +"دارند." -msgid "*posix_user*: scheme for POSIX platforms, when the *user* option is used. This scheme defines paths located under the user's home directory (:const:`site.USER_BASE`)." +msgid "" +"*posix_user*: scheme for POSIX platforms, when the *user* option is used. " +"This scheme defines paths located under the user's home directory " +"(:const:`site.USER_BASE`)." msgstr "" +"*posix_user*: طرحی برای سکوهای POSIX، هنگامی که از گزینه‌ی *user* استفاده " +"می‌شود. این طرح‌واره مسیرهای واقع‌شده زیر پوشه‌ی خانگی کاربر را تعریف می‌کند " +"(:const:`site.USER_BASE`)." -msgid "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX platforms; by default it is the same as *posix_prefix*." +msgid "" +"*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " +"platforms; by default it is the same as *posix_prefix*." msgstr "" +"*posix_venv*: طرح‌واره برای :mod:`محیط‌های مجازی پایتون ` در سکوهای POSIX؛ " +"به‌طور پیش‌فرض همان *posix_prefix* است." -msgid "*nt*: scheme for Windows. This is the default scheme used when Python or a component is installed." +msgid "" +"*nt*: scheme for Windows. This is the default scheme used when Python or a " +"component is installed." msgstr "" +"*nt*: طرح‌واره (scheme) برای ویندوز. این طرح‌واره پیش‌فرضی است که هنگام نصب پایتون یا " +"یک کامپوننت استفاده می‌شود." msgid "*nt_user*: scheme for Windows, when the *user* option is used." msgstr "" +"*nt_user*: طرح‌واره (scheme) برای ویندوز، هنگامی که از گزینه *user* استفاده " +"می‌شود." -msgid "*nt_venv*: scheme for :mod:`Python virtual environments ` on Windows; by default it is the same as *nt*." +msgid "" +"*nt_venv*: scheme for :mod:`Python virtual environments ` on Windows; " +"by default it is the same as *nt*." msgstr "" +"*nt_venv*: طرح‌واره‌ای برای :mod:`محیط‌های مجازی پایتون ` در ویندوز؛ به‌طور " +"پیش‌فرض همان *nt* است." -msgid "*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending on the platform Python runs on." +msgid "" +"*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending" +" on the platform Python runs on." msgstr "" +"*venv*: طرح‌واره‌ای با مقادیری از *posix_venv* یا *nt_venv*، بسته به پلتفرمی " +"که پایتون روی آن اجرا می‌شود." -msgid "*osx_framework_user*: scheme for macOS, when the *user* option is used." +msgid "" +"*osx_framework_user*: scheme for macOS, when the *user* option is used." msgstr "" +"*osx_framework_user*: طرح‌واره (scheme) برای macOS، هنگامی که گزینه‌ی *user* " +"استفاده می‌شود." -msgid "Each scheme is itself composed of a series of paths and each path has a unique identifier. Python currently uses eight paths:" +msgid "" +"Each scheme is itself composed of a series of paths and each path has a " +"unique identifier. Python currently uses eight paths:" msgstr "" +"هر طرح‌واره خود از مجموعه‌ای از مسیرها تشکیل شده است و هر مسیر یک شناسه یکتا " +"دارد. پایتون در حال حاضر از هشت مسیر استفاده می‌کند:" -msgid "*stdlib*: directory containing the standard Python library files that are not platform-specific." +msgid "" +"*stdlib*: directory containing the standard Python library files that are " +"not platform-specific." msgstr "" +"*stdlib*: پوشه‌ای شامل فایل‌های کتابخانه استاندارد پایتون که وابسته به " +"پلتفرم خاصی نیستند." -msgid "*platstdlib*: directory containing the standard Python library files that are platform-specific." +msgid "" +"*platstdlib*: directory containing the standard Python library files that " +"are platform-specific." msgstr "" +"*platstdlib*: پوشه‌ای شامل فایل‌های کتابخانه استاندارد پایتون که مختص پلتفرم" +" هستند." msgid "*platlib*: directory for site-specific, platform-specific files." -msgstr "" +msgstr "*platlib*: پوشه‌ای برای فایل‌های مختص سایت و مختص پلتفرم." -msgid "*purelib*: directory for site-specific, non-platform-specific files ('pure' Python)." +msgid "" +"*purelib*: directory for site-specific, non-platform-specific files ('pure' " +"Python)." msgstr "" +"*purelib*: پوشه‌ای برای فایل‌های ویژه‌ی سایت و غیرمختص به سکو (پایتون " +"«خالص»)." -msgid "*include*: directory for non-platform-specific header files for the Python C-API." -msgstr "" +msgid "" +"*include*: directory for non-platform-specific header files for the Python " +"C-API." +msgstr "*include*: پوشه‌ی فایل‌های سرآیند غیرمختص به سکو برای Python C-API." -msgid "*platinclude*: directory for platform-specific header files for the Python C-API." +msgid "" +"*platinclude*: directory for platform-specific header files for the Python " +"C-API." msgstr "" +"*platinclude*: پوشه‌ای برای فایل‌های سرآیند وابسته به پلتفرم برای C-API پایتون." msgid "*scripts*: directory for script files." -msgstr "" +msgstr "*scripts*: پوشه‌ای برای فایل‌های اسکریپت." msgid "*data*: directory for data files." -msgstr "" +msgstr "*data*: پوشه‌ای برای فایل‌های داده." msgid "User scheme" -msgstr "" +msgstr "طرح‌واره کاربر" -msgid "This scheme is designed to be the most convenient solution for users that don't have write permission to the global site-packages directory or don't want to install into it." +msgid "" +"This scheme is designed to be the most convenient solution for users that " +"don't have write permission to the global site-packages directory or don't " +"want to install into it." msgstr "" +"این طرح‌واره به‌عنوان راحت‌ترین راه‌حل برای کاربرانی طراحی شده است که دسترسی " +"نوشتن به پوشه‌ی سراسری site-packages را ندارند یا مایل به نصب در آن نیستند." -msgid "Files will be installed into subdirectories of :const:`site.USER_BASE` (written as :file:`{userbase}` hereafter). This scheme installs pure Python modules and extension modules in the same location (also known as :const:`site.USER_SITE`)." +msgid "" +"Files will be installed into subdirectories of :const:`site.USER_BASE` " +"(written as :file:`{userbase}` hereafter). This scheme installs pure Python" +" modules and extension modules in the same location (also known as " +":const:`site.USER_SITE`)." msgstr "" +"فایل‌ها در زیرپوشه‌هایی از :const:`site.USER_BASE` نصب خواهند شد (که از این " +"پس :file:`{userbase}` نوشته می‌شود). این طرح‌واره، ماژول‌های پایتون خالص و " +"ماژول‌های توسعه را در یک مکان نصب می‌کند (که به‌عنوان " +":const:`site.USER_SITE` نیز شناخته می‌شود)." msgid "``posix_user``" -msgstr "" +msgstr "``posix_user``" msgid "Path" -msgstr "" +msgstr "مسیر" msgid "Installation directory" -msgstr "" +msgstr "پوشه نصب" msgid "*stdlib*" -msgstr "" +msgstr "*کتابخانه استاندارد*" msgid ":file:`{userbase}/lib/python{X.Y}`" -msgstr "" +msgstr ":file:`{userbase}/lib/python{X.Y}`" msgid "*platstdlib*" -msgstr "" +msgstr "*platstdlib*" msgid "*platlib*" -msgstr "" +msgstr "*platlib*" msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" -msgstr "" +msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" msgid "*purelib*" -msgstr "" +msgstr "*purelib*" msgid "*include*" -msgstr "" +msgstr "*شامل*" msgid ":file:`{userbase}/include/python{X.Y}`" -msgstr "" +msgstr ":file:`{userbase}/include/python{X.Y}`" msgid "*scripts*" -msgstr "" +msgstr "*اسکریپت‌ها*" msgid ":file:`{userbase}/bin`" -msgstr "" +msgstr ":file:`{userbase}/bin`" msgid "*data*" -msgstr "" +msgstr "*داده*" msgid ":file:`{userbase}`" -msgstr "" +msgstr ":file:`{userbase}`" msgid "``nt_user``" -msgstr "" +msgstr "``nt_user``" msgid ":file:`{userbase}\\\\Python{XY}`" -msgstr "" +msgstr ":file:`{userbase}\\\\Python{XY}`" msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" -msgstr "" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" msgid ":file:`{userbase}\\\\Python{XY}\\\\Include`" -msgstr "" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include`" msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" -msgstr "" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" msgid "``osx_framework_user``" -msgstr "" +msgstr "``osx_framework_user``" msgid ":file:`{userbase}/lib/python`" -msgstr "" +msgstr ":file:`{userbase}/lib/python`" msgid ":file:`{userbase}/lib/python/site-packages`" -msgstr "" +msgstr ":file:`{userbase}/lib/python/site-packages`" msgid "Home scheme" -msgstr "" +msgstr "طرح‌واره خانه" -msgid "The idea behind the \"home scheme\" is that you build and maintain a personal stash of Python modules. This scheme's name is derived from the idea of a \"home\" directory on Unix, since it's not unusual for a Unix user to make their home directory have a layout similar to :file:`/usr/` or :file:`/usr/local/`. This scheme can be used by anyone, regardless of the operating system they are installing for." -msgstr "" +msgid "" +"The idea behind the \"home scheme\" is that you build and maintain a " +"personal stash of Python modules. This scheme's name is derived from the " +"idea of a \"home\" directory on Unix, since it's not unusual for a Unix user" +" to make their home directory have a layout similar to :file:`/usr/` or " +":file:`/usr/local/`. This scheme can be used by anyone, regardless of the " +"operating system they are installing for." +msgstr "" +"ایده‌ی پشت «طرح‌واره home (home scheme)» این است که شما یک مجموعه‌ی شخصی از " +"ماژول‌های Python می‌سازید و نگهداری می‌کنید. نام این طرح‌واره از ایده‌ی پوشه‌ی " +"«home» در Unix گرفته شده است، زیرا غیرمعمول نیست که یک کاربر Unix کاری کند " +"که پوشه‌ی «home» او چیدمانی مشابه :file:`/usr/` یا :file:`/usr/local/` داشته" +" باشد. هر کسی می‌تواند از این طرح‌واره استفاده کند، صرف‌نظر از سیستم‌عاملی که " +"برای آن نصب می‌کند." msgid "``posix_home``" -msgstr "" +msgstr "``posix_home``" msgid ":file:`{home}/lib/python`" -msgstr "" +msgstr ":file:`{home}/lib/python`" msgid ":file:`{home}/include/python`" -msgstr "" +msgstr ":file:`{home}/include/python`" msgid "*platinclude*" -msgstr "" +msgstr "*platinclude*" msgid ":file:`{home}/bin`" -msgstr "" +msgstr ":file:`{home}/bin`" msgid ":file:`{home}`" -msgstr "" +msgstr ":file:`{home}`" msgid "Prefix scheme" -msgstr "" +msgstr "طرح‌واره پیشوند" -msgid "The \"prefix scheme\" is useful when you wish to use one Python installation to perform the build/install (i.e., to run the setup script), but install modules into the third-party module directory of a different Python installation (or something that looks like a different Python installation). If this sounds a trifle unusual, it is---that's why the user and home schemes come before. However, there are at least two known cases where the prefix scheme will be useful." -msgstr "" +msgid "" +"The \"prefix scheme\" is useful when you wish to use one Python installation" +" to perform the build/install (i.e., to run the setup script), but install " +"modules into the third-party module directory of a different Python " +"installation (or something that looks like a different Python installation)." +" If this sounds a trifle unusual, it is---that's why the user and home " +"schemes come before. However, there are at least two known cases where the " +"prefix scheme will be useful." +msgstr "" +"«طرح‌واره prefix» (prefix scheme) زمانی مفید است که بخواهید از یک نصب پایتون برای" +" انجام ساخت/نصب (یعنی اجرای اسکریپت setup) استفاده کنید، اما ماژول‌ها را در " +"پوشه‌ی ماژول‌های شخص ثالث یک نصب پایتون دیگر (یا چیزی که شبیه یک نصب پایتون " +"دیگر به نظر می‌رسد) نصب کنید. اگر این موضوع کمی غیرعادی به نظر می‌رسد، " +"واقعاً همین‌طور است—به همین دلیل طرح‌های user و home پیش‌تر آمده‌اند. با این" +" حال، حداقل دو مورد شناخته‌شده وجود دارد که طرح‌واره prefix در آن‌ها مفید خواهد " +"بود." -msgid "First, consider that many Linux distributions put Python in :file:`/usr`, rather than the more traditional :file:`/usr/local`. This is entirely appropriate, since in those cases Python is part of \"the system\" rather than a local add-on. However, if you are installing Python modules from source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` rather than :file:`/usr/lib/python2.{X}`." -msgstr "" +msgid "" +"First, consider that many Linux distributions put Python in :file:`/usr`, " +"rather than the more traditional :file:`/usr/local`. This is entirely " +"appropriate, since in those cases Python is part of \"the system\" rather " +"than a local add-on. However, if you are installing Python modules from " +"source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` " +"rather than :file:`/usr/lib/python2.{X}`." +msgstr "" +"ابتدا در نظر بگیرید که بسیاری از توزیع‌های لینوکس، پایتون را در :file:`/usr`" +" قرار می‌دهند، نه در :file:`/usr/local` که سنتی‌تر است. این کاملاً مناسب " +"است، زیرا در آن موارد، پایتون بخشی از «سیستم» است، نه یک افزونه محلی. با این" +" حال، اگر در حال نصب ماژول‌های پایتون از منبع هستید، احتمالاً می‌خواهید " +"آن‌ها در :file:`/usr/local/lib/python2.{X}` قرار بگیرند، نه در " +":file:`/usr/lib/python2.{X}`." -msgid "Another possibility is a network filesystem where the name used to write to a remote directory is different from the name used to read it: for example, the Python interpreter accessed as :file:`/usr/local/bin/python` might search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules would have to be installed to, say, :file:`/mnt/{@server}/export/lib/python2.{X}`." -msgstr "" +msgid "" +"Another possibility is a network filesystem where the name used to write to " +"a remote directory is different from the name used to read it: for example, " +"the Python interpreter accessed as :file:`/usr/local/bin/python` might " +"search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules " +"would have to be installed to, say, " +":file:`/mnt/{@server}/export/lib/python2.{X}`." +msgstr "" +"احتمال دیگر، یک فایل‌سیستم شبکه‌ای است که در آن نامی که برای نوشتن در یک " +"پوشه‌ی دوردست به‌کار می‌رود با نامی که برای خواندن آن به‌کار می‌رود متفاوت " +"است: برای مثال، ممکن است مفسر پایتون که به‌صورت " +":file:`/usr/local/bin/python` در دسترس است، ماژول‌ها را در " +":file:`/usr/local/lib/python2.{X}` جستجو کند، اما آن ماژول‌ها باید مثلاً در " +":file:`/mnt/{@server}/export/lib/python2.{X}` نصب شوند." msgid "``posix_prefix``" -msgstr "" +msgstr "``posix_prefix``" msgid ":file:`{prefix}/lib/python{X.Y}`" -msgstr "" +msgstr ":file:`{prefix}/lib/python{X.Y}`" msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" -msgstr "" +msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" msgid ":file:`{prefix}/include/python{X.Y}`" -msgstr "" +msgstr ":file:`{prefix}/include/python{X.Y}`" msgid ":file:`{prefix}/bin`" -msgstr "" +msgstr ":file:`{prefix}/bin`" msgid ":file:`{prefix}`" -msgstr "" +msgstr ":file:`{prefix}`" msgid "``nt``" -msgstr "" +msgstr "``nt``" msgid ":file:`{prefix}\\\\Lib`" -msgstr "" +msgstr ":file:`{prefix}\\\\Lib`" msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" -msgstr "" +msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" msgid ":file:`{prefix}\\\\Include`" -msgstr "" +msgstr ":file:`{prefix}\\\\Include`" msgid ":file:`{prefix}\\\\Scripts`" -msgstr "" +msgstr ":file:`{prefix}\\\\Scripts`" msgid "Installation path functions" -msgstr "" +msgstr "توابع مسیر نصب" -msgid ":mod:`!sysconfig` provides some functions to determine these installation paths." -msgstr "" +msgid "" +":mod:`!sysconfig` provides some functions to determine these installation " +"paths." +msgstr ":mod:`!sysconfig` چند تابع برای تعیین این مسیرهای نصب فراهم می‌کند." -msgid "Return a tuple containing all schemes currently supported in :mod:`!sysconfig`." +msgid "" +"Return a tuple containing all schemes currently supported in " +":mod:`!sysconfig`." msgstr "" +"یک تاپل حاوی تمام طرح‌هایی که در حال حاضر در :mod:`!sysconfig` پشتیبانی " +"می‌شوند، برمی‌گرداند." msgid "Return the default scheme name for the current platform." -msgstr "" +msgstr "نام طرح‌واره پیش‌فرض برای سکوی فعلی را برمی‌گرداند." -msgid "This function was previously named ``_get_default_scheme()`` and considered an implementation detail." +msgid "" +"This function was previously named ``_get_default_scheme()`` and considered " +"an implementation detail." msgstr "" +"این تابع پیش‌تر ``_get_default_scheme()`` نام داشت و به‌عنوان جزئیات " +"پیاده‌سازی در نظر گرفته می‌شد." -msgid "When Python runs from a virtual environment, the *venv* scheme is returned." +msgid "" +"When Python runs from a virtual environment, the *venv* scheme is returned." msgstr "" +"هنگامی که پایتون از یک محیط مجازی اجرا می‌شود، طرح‌واره (scheme) *venv* برگردانده" +" می‌شود." -msgid "Return a preferred scheme name for an installation layout specified by *key*." -msgstr "" +msgid "" +"Return a preferred scheme name for an installation layout specified by " +"*key*." +msgstr "یک نام طرح‌واره ترجیحی برای چیدمان نصب مشخص‌شده با *key* را برمی‌گرداند." msgid "*key* must be either ``\"prefix\"``, ``\"home\"``, or ``\"user\"``." -msgstr "" +msgstr "*key* باید یکی از ``\"prefix\"``، ``\"home\"`` یا ``\"user\"`` باشد." -msgid "The return value is a scheme name listed in :func:`get_scheme_names`. It can be passed to :mod:`!sysconfig` functions that take a *scheme* argument, such as :func:`get_paths`." +msgid "" +"The return value is a scheme name listed in :func:`get_scheme_names`. It can" +" be passed to :mod:`!sysconfig` functions that take a *scheme* argument, " +"such as :func:`get_paths`." msgstr "" +"مقدار بازگشتی یک نام طرح‌واره (scheme) است که در :func:`get_scheme_names` " +"فهرست‌شده است. می‌توان آن را به توابع :mod:`!sysconfig` که آرگومان *scheme* " +"می‌گیرند، مانند :func:`get_paths` ارسال کرد." -msgid "When Python runs from a virtual environment and ``key=\"prefix\"``, the *venv* scheme is returned." +msgid "" +"When Python runs from a virtual environment and ``key=\"prefix\"``, the " +"*venv* scheme is returned." msgstr "" +"هنگامی که پایتون از یک محیط مجازی اجرا می‌شود و ``key=\"prefix\"`` باشد، طرح‌واره" +" *venv* برگردانده می‌شود." -msgid "Return a dict containing preferred scheme names on the current platform. Python implementers and redistributors may add their preferred schemes to the ``_INSTALL_SCHEMES`` module-level global value, and modify this function to return those scheme names, to e.g. provide different schemes for system and language package managers to use, so packages installed by either do not mix with those by the other." -msgstr "" +msgid "" +"Return a dict containing preferred scheme names on the current platform. " +"Python implementers and redistributors may add their preferred schemes to " +"the ``_INSTALL_SCHEMES`` module-level global value, and modify this function" +" to return those scheme names, to e.g. provide different schemes for system " +"and language package managers to use, so packages installed by either do not" +" mix with those by the other." +msgstr "" +"یک دیکشنری حاوی نام طرح‌واره‌های ترجیحی در سکوی فعلی برمی‌گرداند. پیاده‌سازان و " +"بازتوزیع‌کنندگان پایتون می‌توانند طرح‌واره‌های ترجیحی خود را به مقدار سراسری در " +"سطح ماژول ``_INSTALL_SCHEMES`` اضافه کنند و این تابع را اصلاح کنند تا آن نام" +" طرح‌ها را برگرداند و برای مثال طرح‌واره‌های متفاوتی را برای استفاده مدیران بسته " +"سیستم و زبان فراهم کنند، به‌طوری که بسته‌های نصب‌شده توسط هر یک با بسته‌های " +"نصب‌شده توسط دیگری مخلوط نشوند." -msgid "End users should not use this function, but :func:`get_default_scheme` and :func:`get_preferred_scheme` instead." +msgid "" +"End users should not use this function, but :func:`get_default_scheme` and " +":func:`get_preferred_scheme` instead." msgstr "" +"کاربران نهایی نباید از این تابع استفاده کنند، بلکه باید به‌جای آن از " +":func:`get_default_scheme` و :func:`get_preferred_scheme` استفاده کنند." -msgid "Return a tuple containing all path names currently supported in :mod:`!sysconfig`." +msgid "" +"Return a tuple containing all path names currently supported in " +":mod:`!sysconfig`." msgstr "" +"یک تاپل شامل تمام نام‌های مسیری که در حال حاضر در :mod:`!sysconfig` پشتیبانی" +" می‌شوند را برمی‌گرداند." -msgid "Return an installation path corresponding to the path *name*, from the install scheme named *scheme*." +msgid "" +"Return an installation path corresponding to the path *name*, from the " +"install scheme named *scheme*." msgstr "" +"مسیر نصب متناظر با نام مسیر *name* را از طرح‌واره نصب با نام *scheme* " +"برمی‌گرداند." -msgid "*name* has to be a value from the list returned by :func:`get_path_names`." +msgid "" +"*name* has to be a value from the list returned by :func:`get_path_names`." msgstr "" +"*name* باید مقداری از فهرستی باشد که :func:`get_path_names` برمی‌گرداند." -msgid ":mod:`!sysconfig` stores installation paths corresponding to each path name, for each platform, with variables to be expanded. For instance the *stdlib* path for the *nt* scheme is: ``{base}/Lib``." +msgid "" +":mod:`!sysconfig` stores installation paths corresponding to each path name," +" for each platform, with variables to be expanded. For instance the " +"*stdlib* path for the *nt* scheme is: ``{base}/Lib``." msgstr "" +":mod:`!sysconfig` مسیرهای نصب متناظر با هر نام مسیر را برای هر سکو، با " +"متغیرهایی که باید بسط داده شوند، ذخیره می‌کند. برای مثال، مسیر *stdlib* " +"برای طرح‌واره *nt* برابر است با: ``{base}/Lib``." -msgid ":func:`get_path` will use the variables returned by :func:`get_config_vars` to expand the path. All variables have default values for each platform so one may call this function and get the default value." +msgid "" +":func:`get_path` will use the variables returned by :func:`get_config_vars` " +"to expand the path. All variables have default values for each platform so " +"one may call this function and get the default value." msgstr "" +":func:`get_path` از متغیرهای برگردانده‌شده توسط :func:`get_config_vars` برای" +" بسط مسیر استفاده خواهد کرد. همه متغیرها برای هر سکو مقادیر پیش‌فرض دارند، " +"بنابراین می‌توانید این تابع را فراخوانی کنید و مقدار پیش‌فرض را دریافت کنید." -msgid "If *scheme* is provided, it must be a value from the list returned by :func:`get_scheme_names`. Otherwise, the default scheme for the current platform is used." +msgid "" +"If *scheme* is provided, it must be a value from the list returned by " +":func:`get_scheme_names`. Otherwise, the default scheme for the current " +"platform is used." msgstr "" +"اگر *scheme* داده شده باشد، باید مقداری از فهرستی باشد که توسط " +":func:`get_scheme_names` برگردانده می‌شود. در غیر این صورت، از طرح‌واره پیش‌فرض " +"برای سکّوی فعلی استفاده می‌شود." -msgid "If *vars* is provided, it must be a dictionary of variables that will update the dictionary returned by :func:`get_config_vars`." +msgid "" +"If *vars* is provided, it must be a dictionary of variables that will update" +" the dictionary returned by :func:`get_config_vars`." msgstr "" +"اگر *vars* ارائه شده باشد، باید یک دیکشنری از متغیرها باشد که دیکشنری " +"بازگشت‌داده‌شده توسط :func:`get_config_vars` را به‌روزرسانی می‌کند." -msgid "If *expand* is set to ``False``, the path will not be expanded using the variables." +msgid "" +"If *expand* is set to ``False``, the path will not be expanded using the " +"variables." msgstr "" +"اگر *expand* روی ``False`` تنظیم شده باشد، مسیر با استفاده از متغیرها بسط " +"داده نخواهد شد." msgid "If *name* is not found, raise a :exc:`KeyError`." -msgstr "" +msgstr "اگر *name* پیدا نشد، یک :exc:`KeyError` پرتاب می‌شود." -msgid "Return a dictionary containing all installation paths corresponding to an installation scheme. See :func:`get_path` for more information." +msgid "" +"Return a dictionary containing all installation paths corresponding to an " +"installation scheme. See :func:`get_path` for more information." msgstr "" +"یک دیکشنری شامل تمام مسیرهای نصب متناظر با یک طرح‌واره نصب برمی‌گرداند. برای " +"اطلاعات بیشتر :func:`get_path` را ببینید." -msgid "If *scheme* is not provided, will use the default scheme for the current platform." +msgid "" +"If *scheme* is not provided, will use the default scheme for the current " +"platform." msgstr "" +"اگر *scheme* ارائه نشده باشد، از طرح‌واره‌ی پیش‌فرض (scheme) برای پلتفرم فعلی " +"استفاده می‌شود." -msgid "If *vars* is provided, it must be a dictionary of variables that will update the dictionary used to expand the paths." +msgid "" +"If *vars* is provided, it must be a dictionary of variables that will update" +" the dictionary used to expand the paths." msgstr "" +"اگر *vars* ارائه شده باشد، باید یک دیکشنری از متغیرها باشد که دیکشنری مورد " +"استفاده برای گسترش مسیرها را به‌روزرسانی می‌کند." msgid "If *expand* is set to false, the paths will not be expanded." -msgstr "" +msgstr "اگر *expand* روی false تنظیم شود، مسیرها گسترش نمی‌یابند." -msgid "If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:`KeyError`." +msgid "" +"If *scheme* is not an existing scheme, :func:`get_paths` will raise a " +":exc:`KeyError`." msgstr "" +"اگر *scheme* یک طرح‌واره (scheme) موجود نباشد، :func:`get_paths` یک " +":exc:`KeyError` پرتاب خواهد کرد." msgid "Other functions" -msgstr "" +msgstr "توابع دیگر" -msgid "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to ``'%d.%d' % sys.version_info[:2]``." +msgid "" +"Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " +"``'%d.%d' % sys.version_info[:2]``." msgstr "" +"شماره‌ی نسخه‌ی پایتون به‌صورت ``MAJOR.MINOR`` را به‌عنوان یک رشته برمی‌گرداند." +" مشابه ``'%d.%d' % sys.version_info[:2]``." msgid "Return a string that identifies the current platform." -msgstr "" +msgstr "رشته‌ای را برمی‌گرداند که سکوی کنونی را مشخص می‌کند." -msgid "This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by :func:`os.uname`), although the exact information included depends on the OS; e.g., on Linux, the kernel version isn't particularly important." -msgstr "" +msgid "" +"This is used mainly to distinguish platform-specific build directories and " +"platform-specific built distributions. Typically includes the OS name and " +"version and the architecture (as supplied by :func:`os.uname`), although the" +" exact information included depends on the OS; e.g., on Linux, the kernel " +"version isn't particularly important." +msgstr "" +"این عمدتاً برای تمایز پوشه‌های ساخت وابسته به پلتفرم و توزیع‌های ساخته‌شده " +"وابسته به پلتفرم استفاده می‌شود. معمولاً شامل نام و نسخه سیستم‌عامل و معماری" +" است (همان‌طور که توسط :func:`os.uname` ارائه می‌شود)، اگرچه اطلاعات دقیق " +"گنجانده‌شده به سیستم‌عامل بستگی دارد؛ برای مثال، در لینوکس، نسخه کرنل اهمیت " +"چندانی ندارد." msgid "Examples of returned values:" -msgstr "" +msgstr "نمونه‌هایی از مقادیر برگردانده‌شده:" msgid "Windows:" -msgstr "" +msgstr "ویندوز:" msgid "win-amd64 (64-bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" +"win-amd64 (ویندوز ۶۴ بیتی روی AMD64، معروف به x86_64، Intel64 و EM64T)" msgid "win-arm64 (64-bit Windows on ARM64, aka AArch64)" -msgstr "" +msgstr "win-arm64 (ویندوز ۶۴ بیتی روی ARM64، معروف به AArch64)" msgid "win32 (all others - specifically, sys.platform is returned)" -msgstr "" +msgstr "win32 (همه‌ی موارد دیگر - به‌طور مشخص، sys.platform برگردانده می‌شود)" msgid "POSIX based OS:" -msgstr "" +msgstr "سیستم‌عامل مبتنی بر POSIX:" msgid "linux-x86_64" -msgstr "" +msgstr "linux-x86_64" msgid "macosx-15.5-arm64" -msgstr "" +msgstr "macosx-15.5-arm64" msgid "macosx-26.0-universal2 (macOS on Apple Silicon or Intel)" -msgstr "" +msgstr "macosx-26.0-universal2 (macOS روی Apple Silicon یا Intel)" msgid "android-24-arm64_v8a" -msgstr "" +msgstr "android-24-arm64_v8a" -msgid "For other non-POSIX platforms, currently just returns :data:`sys.platform`." +msgid "" +"For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" +"برای سایر سکوهای غیر POSIX، در حال حاضر فقط :data:`sys.platform` را " +"برمی‌گرداند." -msgid "Return ``True`` if the running Python interpreter was built from source and is being run from its built location, and not from a location resulting from e.g. running ``make install`` or installing via a binary installer." +msgid "" +"Return ``True`` if the running Python interpreter was built from source and " +"is being run from its built location, and not from a location resulting from" +" e.g. running ``make install`` or installing via a binary installer." msgstr "" +"اگر مفسر پایتونِ در حال اجرا از کد منبع ساخته‌شده باشد و از محل ساخت خود " +"اجرا شود، نه از محلی که در اثر مثلاً اجرای ``make install`` یا نصب از طریق " +"یک نصب‌کننده‌ی دودویی به وجود آمده است، ``True`` برمی‌گرداند." msgid "Parse a :file:`config.h`\\-style file." -msgstr "" +msgstr "یک فایل به سبک :file:`config.h` را تجزیه می‌کند." msgid "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" +"*fp* یک شیء شبه‌فایل است که به فایلی شبیه :file:`config.h` اشاره می‌کند." -msgid "A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary, and updated with the values read in the file." +msgid "" +"A dictionary containing name/value pairs is returned. If an optional " +"dictionary is passed in as the second argument, it is used instead of a new " +"dictionary, and updated with the values read in the file." msgstr "" +"یک دیکشنری شامل جفت‌های نام/مقدار برگردانده می‌شود. اگر یک دیکشنری اختیاری " +"به‌عنوان آرگومان دوم ارسال شود، به‌جای یک دیکشنری جدید از آن استفاده می‌شود " +"و با مقادیر خوانده‌شده از فایل به‌روزرسانی می‌شود." msgid "Return the path of :file:`pyconfig.h`." -msgstr "" +msgstr "مسیر :file:`pyconfig.h` را برمی‌گرداند." msgid "Return the path of :file:`Makefile`." -msgstr "" +msgstr "مسیر :file:`Makefile` را برمی‌گرداند." msgid "Command-line usage" -msgstr "" +msgstr "استفاده از خط فرمان" msgid "You can use :mod:`!sysconfig` as a script with Python's *-m* option:" msgstr "" +"می‌توانید از :mod:`!sysconfig` به‌عنوان یک اسکریپت با گزینه‌ی *-m* پایتون " +"استفاده کنید:" msgid "" "$ python -m sysconfig\n" @@ -452,9 +745,36 @@ msgid "" " ARFLAGS = \"rc\"\n" " ..." msgstr "" +"$ python -m sysconfig\n" +"Platform: \"macosx-10.4-i386\"\n" +"Python version: \"3.2\"\n" +"Current installation scheme: \"posix_prefix\"\n" +"\n" +"Paths:\n" +" data = \"/usr/local\"\n" +" include = \"/Users/tarek/Dev/svn.python.org/py3k/Include\"\n" +" platinclude = \".\"\n" +" platlib = \"/usr/local/lib/python3.2/site-packages\"\n" +" platstdlib = \"/usr/local/lib/python3.2\"\n" +" purelib = \"/usr/local/lib/python3.2/site-packages\"\n" +" scripts = \"/usr/local/bin\"\n" +" stdlib = \"/usr/local/lib/python3.2\"\n" +"\n" +"Variables:\n" +" AC_APPLE_UNIVERSAL_BUILD = \"0\"\n" +" AIX_GENUINE_CPLUSPLUS = \"0\"\n" +" AR = \"ar\"\n" +" ARFLAGS = \"rc\"\n" +" ..." -msgid "This call will print in the standard output the information returned by :func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:`get_config_vars`." +msgid "" +"This call will print in the standard output the information returned by " +":func:`get_platform`, :func:`get_python_version`, :func:`get_path` and " +":func:`get_config_vars`." msgstr "" +"این فراخوانی اطلاعات برگردانده‌شده توسط :func:`get_platform`، " +":func:`get_python_version`، :func:`get_path` و :func:`get_config_vars` را در" +" خروجی استاندارد چاپ خواهد کرد." msgid "configuration information" -msgstr "" +msgstr "اطلاعات پیکربندی" diff --git a/library/syslog.po b/library/syslog.po index c4a0ce5ea..06c0e44a5 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -25,88 +25,215 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!syslog` --- Unix syslog library routines" -msgstr "" +msgstr ":mod:`!syslog` --- روال‌های کتابخانه‌ای syslog یونیکس" -msgid "This module provides an interface to the Unix ``syslog`` library routines. Refer to the Unix manual pages for a detailed description of the ``syslog`` facility." +msgid "" +"This module provides an interface to the Unix ``syslog`` library routines. " +"Refer to the Unix manual pages for a detailed description of the ``syslog`` " +"facility." msgstr "" +"این ماژول رابطی به روتین‌های کتابخانه ``syslog`` در Unix فراهم می‌کند. برای " +"شرحی دقیق از قابلیت ``syslog`` به صفحات راهنمای Unix مراجعه کنید." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module wraps the system ``syslog`` family of routines. A pure Python library that can speak to a syslog server is available in the :mod:`logging.handlers` module as :class:`~logging.handlers.SysLogHandler`." -msgstr "" +msgid "" +"This module wraps the system ``syslog`` family of routines. A pure Python " +"library that can speak to a syslog server is available in the " +":mod:`logging.handlers` module as :class:`~logging.handlers.SysLogHandler`." +msgstr "" +"این ماژول، خانواده‌ای از روال‌های سیستمی ``syslog`` را پوشش می‌دهد. یک " +"کتابخانه‌ی پایتون خالص که می‌تواند با یک سرور syslog ارتباط برقرار کند، در " +"ماژول :mod:`logging.handlers` به‌عنوان " +":class:`~logging.handlers.SysLogHandler` در دسترس است." msgid "The module defines the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را تعریف می‌کند:" -msgid "Send the string *message* to the system logger. A trailing newline is added if necessary. Each message is tagged with a priority composed of a *facility* and a *level*. The optional *priority* argument, which defaults to :const:`LOG_INFO`, determines the message priority. If the facility is not encoded in *priority* using logical-or (``LOG_INFO | LOG_USER``), the value given in the :func:`openlog` call is used." -msgstr "" +msgid "" +"Send the string *message* to the system logger. A trailing newline is added" +" if necessary. Each message is tagged with a priority composed of a " +"*facility* and a *level*. The optional *priority* argument, which defaults " +"to :const:`LOG_INFO`, determines the message priority. If the facility is " +"not encoded in *priority* using logical-or (``LOG_INFO | LOG_USER``), the " +"value given in the :func:`openlog` call is used." +msgstr "" +"رشته‌ی *message* را به ثبت‌کننده‌ی سیستم ارسال کنید. در صورت لزوم، یک خط جدید " +"به انتها اضافه می‌شود. هر پیام با اولویتی متشکل از امکانات (*facility*) و " +"سطح (*level*) برچسب‌گذاری می‌شود. آرگومان اختیاری *priority*، که پیش‌فرض آن " +":const:`LOG_INFO` است، اولویت پیام را تعیین می‌کند. اگر امکانات با استفاده " +"از یا منطقی (``LOG_INFO | LOG_USER``) در *priority* کدگذاری نشده باشد، از " +"مقدار داده‌شده در فراخوانی :func:`openlog` استفاده می‌شود." -msgid "If :func:`openlog` has not been called prior to the call to :func:`syslog`, :func:`openlog` will be called with no arguments." +msgid "" +"If :func:`openlog` has not been called prior to the call to :func:`syslog`, " +":func:`openlog` will be called with no arguments." msgstr "" +"اگر :func:`openlog` پیش از فراخوانی :func:`syslog` فراخوانی نشده باشد، " +":func:`openlog` بدون آرگومان فراخوانی خواهد شد." -msgid "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments ``priority``, ``message``." +msgid "" +"Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " +"``priority``, ``message``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``syslog.syslog`` را با آرگومان‌های " +"``priority`` و ``message`` پرتاب می‌کند." -msgid "In previous versions, :func:`openlog` would not be called automatically if it wasn't called prior to the call to :func:`syslog`, deferring to the syslog implementation to call ``openlog()``." +msgid "" +"In previous versions, :func:`openlog` would not be called automatically if " +"it wasn't called prior to the call to :func:`syslog`, deferring to the " +"syslog implementation to call ``openlog()``." msgstr "" +"در نسخه‌های پیشین، اگر :func:`openlog` پیش از فراخوانی :func:`syslog` " +"فراخوانی نشده بود، به‌صورت خودکار فراخوانی نمی‌شد و فراخوانی ``openlog()`` " +"به پیاده‌سازی syslog واگذار می‌شد." -msgid "This function is restricted in subinterpreters. (Only code that runs in multiple interpreters is affected and the restriction is not relevant for most users.) :func:`openlog` must be called in the main interpreter before :func:`syslog` may be used in a subinterpreter. Otherwise it will raise :exc:`RuntimeError`." -msgstr "" +msgid "" +"This function is restricted in subinterpreters. (Only code that runs in " +"multiple interpreters is affected and the restriction is not relevant for " +"most users.) :func:`openlog` must be called in the main interpreter before " +":func:`syslog` may be used in a subinterpreter. Otherwise it will raise " +":exc:`RuntimeError`." +msgstr "" +"این تابع در زیرمفسرها محدود است. (تنها کدی که در چندین مفسر اجرا می‌شود تحت" +" تأثیر قرار می‌گیرد و این محدودیت برای بیشتر کاربران مرتبط نیست.) " +":func:`openlog` باید در مفسر اصلی فراخوانی شود، پیش از آنکه بتوان از " +":func:`syslog` در یک زیرمفسر استفاده کرد. در غیر این صورت، " +":exc:`RuntimeError` پرتاب خواهد شد." -msgid "Logging options of subsequent :func:`syslog` calls can be set by calling :func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments if the log is not currently open." +msgid "" +"Logging options of subsequent :func:`syslog` calls can be set by calling " +":func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments" +" if the log is not currently open." msgstr "" +"گزینه‌های گزارش‌گیری برای فراخوانی‌های بعدی :func:`syslog` را می‌توان با " +"فراخوانی :func:`openlog` تنظیم کرد. اگر گزارش در حال حاضر باز نباشد، " +":func:`syslog`، :func:`openlog` را بدون آرگومان فراخوانی می‌کند." -msgid "The optional *ident* keyword argument is a string which is prepended to every message, and defaults to ``sys.argv[0]`` with leading path components stripped. The optional *logoption* keyword argument (default is 0) is a bit field -- see below for possible values to combine. The optional *facility* keyword argument (default is :const:`LOG_USER`) sets the default facility for messages which do not have a facility explicitly encoded." -msgstr "" +msgid "" +"The optional *ident* keyword argument is a string which is prepended to " +"every message, and defaults to ``sys.argv[0]`` with leading path components " +"stripped. The optional *logoption* keyword argument (default is 0) is a bit" +" field -- see below for possible values to combine. The optional *facility*" +" keyword argument (default is :const:`LOG_USER`) sets the default facility " +"for messages which do not have a facility explicitly encoded." +msgstr "" +"آرگومان کلیدواژه‌ای اختیاری *ident* رشته‌ای است که به ابتدای هر پیام اضافه " +"می‌شود و مقدار پیش‌فرض آن ``sys.argv[0]`` است، با حذف اجزای ابتدایی مسیر. " +"آرگومان کلیدواژه‌ای اختیاری *logoption* (مقدار پیش‌فرض آن ۰ است) یک فیلد " +"بیتی است — برای مشاهده‌ی مقادیر قابل ترکیب، به بخش زیر مراجعه کنید. " +"آرگومان کلیدواژه‌ای اختیاری *facility* (مقدار پیش‌فرض آن :const:`LOG_USER` " +"است) مقدار پیش‌فرض facility را برای پیام‌هایی که facility آن‌ها به‌طور " +"صریح کدگذاری نشده است، تعیین می‌کند." -msgid "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments ``ident``, ``logoption``, ``facility``." +msgid "" +"Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments" +" ``ident``, ``logoption``, ``facility``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``syslog.openlog`` را با آرگومان‌های " +"``ident``، ``logoption`` و ``facility`` پرتاب می‌کند." -msgid "In previous versions, keyword arguments were not allowed, and *ident* was required." +msgid "" +"In previous versions, keyword arguments were not allowed, and *ident* was " +"required." msgstr "" +"در نسخه‌های پیشین، آرگومان‌های کلیدواژه‌ای مجاز نبودند و *ident* الزامی بود." -msgid "This function is restricted in subinterpreters. (Only code that runs in multiple interpreters is affected and the restriction is not relevant for most users.) This may only be called in the main interpreter. It will raise :exc:`RuntimeError` if called in a subinterpreter." -msgstr "" +msgid "" +"This function is restricted in subinterpreters. (Only code that runs in " +"multiple interpreters is affected and the restriction is not relevant for " +"most users.) This may only be called in the main interpreter. It will raise " +":exc:`RuntimeError` if called in a subinterpreter." +msgstr "" +"این تابع در زیرمفسرها محدود شده است. (فقط کدی که در چندین مفسر اجرا می‌شود،" +" تحت تأثیر قرار می‌گیرد و این محدودیت برای بیشتر کاربران مرتبط نیست.) این " +"تابع فقط می‌تواند در مفسر اصلی فراخوانی شود. اگر در یک زیرمفسر فراخوانی شود،" +" :exc:`RuntimeError` را پرتاب می‌کند." -msgid "Reset the syslog module values and call the system library ``closelog()``." +msgid "" +"Reset the syslog module values and call the system library ``closelog()``." msgstr "" +"مقادیر ماژول syslog را بازنشانی می‌کند و ``closelog()`` کتابخانه‌ی سیستم را " +"فراخوانی می‌کند." -msgid "This causes the module to behave as it does when initially imported. For example, :func:`openlog` will be called on the first :func:`syslog` call (if :func:`openlog` hasn't already been called), and *ident* and other :func:`openlog` parameters are reset to defaults." -msgstr "" +msgid "" +"This causes the module to behave as it does when initially imported. For " +"example, :func:`openlog` will be called on the first :func:`syslog` call (if" +" :func:`openlog` hasn't already been called), and *ident* and other " +":func:`openlog` parameters are reset to defaults." +msgstr "" +"این باعث می‌شود ماژول همان رفتاری را داشته باشد که هنگام ایمپورت اولیه دارد." +" برای مثال، :func:`openlog` در اولین فراخوانی :func:`syslog` فراخوانی خواهد " +"شد (اگر :func:`openlog` از قبل فراخوانی نشده باشد)، و *ident* و سایر " +"پارامترهای :func:`openlog` به مقادیر پیش‌فرض بازنشانی می‌شوند." -msgid "Raises an :ref:`auditing event ` ``syslog.closelog`` with no arguments." +msgid "" +"Raises an :ref:`auditing event ` ``syslog.closelog`` with no " +"arguments." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``syslog.closelog`` را بدون آرگومان " +"پرتاب می‌کند." -msgid "Set the priority mask to *maskpri* and return the previous mask value. Calls to :func:`syslog` with a priority level not set in *maskpri* are ignored. The default is to log all priorities. The function ``LOG_MASK(pri)`` calculates the mask for the individual priority *pri*. The function ``LOG_UPTO(pri)`` calculates the mask for all priorities up to and including *pri*." -msgstr "" +msgid "" +"Set the priority mask to *maskpri* and return the previous mask value. " +"Calls to :func:`syslog` with a priority level not set in *maskpri* are " +"ignored. The default is to log all priorities. The function " +"``LOG_MASK(pri)`` calculates the mask for the individual priority *pri*. " +"The function ``LOG_UPTO(pri)`` calculates the mask for all priorities up to " +"and including *pri*." +msgstr "" +"ماسک اولویت را روی *maskpri* تنظیم می‌کند و مقدار ماسک پیشین را برمی‌گرداند." +" فراخوانی‌های :func:`syslog` با سطح اولویتی که در *maskpri* تنظیم نشده باشد " +"نادیده گرفته می‌شوند. پیش‌فرض این است که همه اولویت‌ها ثبت شوند. تابع " +"``LOG_MASK(pri)`` ماسک اولویت منفرد *pri* را محاسبه می‌کند. تابع " +"``LOG_UPTO(pri)`` ماسک همه اولویت‌ها تا *pri* و شامل خود آن را محاسبه " +"می‌کند." -msgid "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with argument ``maskpri``." +msgid "" +"Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " +"argument ``maskpri``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``syslog.setlogmask`` را با آرگومان " +"``maskpri`` پرتاب می‌کند." msgid "The module defines the following constants:" -msgstr "" +msgstr "این ماژول ثابت‌های زیر را تعریف می‌کند:" msgid "Priority levels (high to low)." -msgstr "" +msgstr "سطوح اولویت (از بالا به پایین)." -msgid "Facilities, depending on availability in ```` for :const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL` and :const:`LOG_RAS`." +msgid "" +"Facilities, depending on availability in ```` for " +":const:`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, " +":const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL` and :const:`LOG_RAS`." msgstr "" +"امکانات، بسته به دسترس‌پذیری در ```` برای :const:`LOG_AUTHPRIV`،" +" :const:`LOG_FTP`، :const:`LOG_NETINFO`، :const:`LOG_REMOTEAUTH`، " +":const:`LOG_INSTALL` و :const:`LOG_RAS`." -msgid "Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`." +msgid "" +"Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, " +":const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`." msgstr "" +":const:`LOG_FTP`، :const:`LOG_NETINFO`، :const:`LOG_REMOTEAUTH`، " +":const:`LOG_INSTALL`، :const:`LOG_RAS` و :const:`LOG_LAUNCHD` افزوده شدند." -msgid "Log options, depending on availability in ```` for :const:`LOG_ODELAY`, :const:`LOG_NOWAIT` and :const:`LOG_PERROR`." +msgid "" +"Log options, depending on availability in ```` for " +":const:`LOG_ODELAY`, :const:`LOG_NOWAIT` and :const:`LOG_PERROR`." msgstr "" +"گزینه‌های گزارش، بسته به دسترس‌پذیری در ```` برای " +":const:`LOG_ODELAY`، :const:`LOG_NOWAIT` و :const:`LOG_PERROR`." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Simple example" -msgstr "" +msgstr "مثال ساده" msgid "A simple set of examples::" -msgstr "" +msgstr "مجموعه‌ای ساده از مثال‌ها::" msgid "" "import syslog\n" @@ -115,11 +242,24 @@ msgid "" "if error:\n" " syslog.syslog(syslog.LOG_ERR, 'Processing started')" msgstr "" +"import syslog\n" +"\n" +"syslog.syslog('Processing started')\n" +"if error:\n" +" syslog.syslog(syslog.LOG_ERR, 'Processing started')" -msgid "An example of setting some log options, these would include the process ID in logged messages, and write the messages to the destination facility used for mail logging::" +msgid "" +"An example of setting some log options, these would include the process ID " +"in logged messages, and write the messages to the destination facility used " +"for mail logging::" msgstr "" +"نمونه‌ای از تنظیم چند گزینه‌ی گزارش؛ این گزینه‌ها شناسه‌ی فرایند را در پیام‌های " +"گزارش‌شده درج می‌کنند و پیام‌ها را به دسته‌ی گزارش مقصد مورد استفاده برای " +"گزارش ایمیل می‌نویسند::" msgid "" "syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_MAIL)\n" "syslog.syslog('E-mail processing initiated...')" msgstr "" +"syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_MAIL)\n" +"syslog.syslog('E-mail processing initiated...')" diff --git a/library/tabnanny.po b/library/tabnanny.po index cf8716085..871a7f90f 100644 --- a/library/tabnanny.po +++ b/library/tabnanny.po @@ -22,34 +22,72 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tabnanny` --- Detection of ambiguous indentation" -msgstr "" +msgstr ":mod:`!tabnanny` --- تشخیص تورفتگی مبهم" msgid "**Source code:** :source:`Lib/tabnanny.py`" -msgstr "" +msgstr ":source:`Lib/tabnanny.py`" -msgid "For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function :func:`check` described below." +msgid "" +"For the time being this module is intended to be called as a script. However" +" it is possible to import it into an IDE and use the function :func:`check` " +"described below." msgstr "" +"در حال حاضر این ماژول برای فراخوانی به‌عنوان یک اسکریپت در نظر گرفته شده " +"است. با این حال، می‌توانید آن را در یک IDE ایمپورت کنید و از تابع " +":func:`check` که در ادامه توضیح داده شده است استفاده کنید." -msgid "The API provided by this module is likely to change in future releases; such changes may not be backward compatible." +msgid "" +"The API provided by this module is likely to change in future releases; such" +" changes may not be backward compatible." msgstr "" +"API ارائه‌شده توسط این ماژول احتمال دارد در نسخه‌های آینده تغییر کند؛ چنین " +"تغییراتی ممکن است با نسخه‌های پیشین سازگار نباشند." -msgid "If *file_or_dir* is a directory and not a symbolic link, then recursively descend the directory tree named by *file_or_dir*, checking all :file:`.py` files along the way. If *file_or_dir* is an ordinary Python source file, it is checked for whitespace related problems. The diagnostic messages are written to standard output using the :func:`print` function." +msgid "" +"If *file_or_dir* is a directory and not a symbolic link, then recursively " +"descend the directory tree named by *file_or_dir*, checking all :file:`.py` " +"files along the way. If *file_or_dir* is an ordinary Python source file, it" +" is checked for whitespace related problems. The diagnostic messages are " +"written to standard output using the :func:`print` function." msgstr "" +"اگر *file_or_dir* یک پوشه باشد و پیوند نمادین نباشد، درخت پوشه‌ی مشخص‌شده با " +"*file_or_dir* به‌صورت بازگشتی پیمایش می‌شود و همه‌ی فایل‌های :file:`.py` در " +"طول مسیر بررسی می‌شوند. اگر *file_or_dir* یک فایل منبع معمولی پایتون باشد، " +"از نظر مشکلات مربوط به فضای سفید بررسی می‌شود. پیام‌های تشخیصی با استفاده از" +" تابع :func:`print` در خروجی استاندارد نوشته می‌شوند." -msgid "Flag indicating whether to print verbose messages. This is incremented by the ``-v`` option if called as a script." +msgid "" +"Flag indicating whether to print verbose messages. This is incremented by " +"the ``-v`` option if called as a script." msgstr "" +"پرچمی که نشان می‌دهد آیا پیام‌های پرجزئیات چاپ شوند یا خیر. این پرچم در صورت" +" فراخوانی به‌عنوان اسکریپت، با گزینه ``-v`` افزایش می‌یابد." -msgid "Flag indicating whether to print only the filenames of files containing whitespace related problems. This is set to true by the ``-q`` option if called as a script." +msgid "" +"Flag indicating whether to print only the filenames of files containing " +"whitespace related problems. This is set to true by the ``-q`` option if " +"called as a script." msgstr "" +"پرچمی که نشان می‌دهد آیا فقط نام فایل‌های حاوی مشکلات مربوط به فضای سفید چاپ" +" شود یا خیر. اگر به‌عنوان یک اسکریپت فراخوانی شود، این پرچم توسط گزینه " +"``-q`` روی true تنظیم می‌شود." -msgid "Raised by :func:`process_tokens` if detecting an ambiguous indent. Captured and handled in :func:`check`." +msgid "" +"Raised by :func:`process_tokens` if detecting an ambiguous indent. Captured " +"and handled in :func:`check`." msgstr "" +"توسط :func:`process_tokens` در صورت تشخیص تورفتگی مبهم پرتاب می‌شود. در " +":func:`check` گرفته و مدیریت می‌شود." -msgid "This function is used by :func:`check` to process tokens generated by the :mod:`tokenize` module." +msgid "" +"This function is used by :func:`check` to process tokens generated by the " +":mod:`tokenize` module." msgstr "" +"این تابع توسط :func:`check` برای پردازش توکن‌های تولیدشده توسط ماژول " +":mod:`tokenize` استفاده می‌شود." msgid "Module :mod:`tokenize`" -msgstr "" +msgstr "ماژول :mod:`tokenize`" msgid "Lexical scanner for Python source code." -msgstr "" +msgstr "پویشگر واژگانی برای کد منبع پایتون." diff --git a/library/tarfile.po b/library/tarfile.po index 00d01dd62..176c953e8 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -26,929 +26,1815 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tarfile` --- Read and write tar archive files" -msgstr "" +msgstr ":mod:`!tarfile` --- خواندن و نوشتن فایل‌های بایگانی tar" msgid "**Source code:** :source:`Lib/tarfile.py`" -msgstr "" +msgstr ":source:`Lib/tarfile.py`" -msgid "The :mod:`!tarfile` module makes it possible to read and write tar archives, including those using gzip, bz2 and lzma compression. Use the :mod:`zipfile` module to read or write :file:`.zip` files, or the higher-level functions in :ref:`shutil `." +msgid "" +"The :mod:`!tarfile` module makes it possible to read and write tar archives," +" including those using gzip, bz2 and lzma compression. Use the " +":mod:`zipfile` module to read or write :file:`.zip` files, or the higher-" +"level functions in :ref:`shutil `." msgstr "" +"ماژول :mod:`!tarfile` امکان خواندن و نوشتن بایگانی‌های tar، از جمله آن‌هایی " +"که از فشرده‌سازی gzip، bz2 و lzma استفاده می‌کنند، را فراهم می‌کند. برای " +"خواندن یا نوشتن فایل‌های :file:`.zip`، از ماژول :mod:`zipfile` یا توابع سطح " +"بالاتر در :ref:`shutil ` استفاده کنید." msgid "Some facts and figures:" -msgstr "" +msgstr "برخی حقایق و ارقام:" -msgid "reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, and :mod:`lzma` compressed archives if the respective modules are available." +msgid "" +"reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, and " +":mod:`lzma` compressed archives if the respective modules are available." msgstr "" +"اگر ماژول‌های مربوطه در دسترس باشند، بایگانی‌های فشرده‌ی :mod:`gzip`، " +":mod:`bz2`، :mod:`compression.zstd` و :mod:`lzma` را می‌خواند و می‌نویسد." -msgid "If any of these :term:`optional modules ` are missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"If any of these :term:`optional modules ` are missing from " +"your copy of CPython, look for documentation from your distributor (that is," +" whoever provided Python to you). If you are the distributor, see " +":ref:`optional-module-requirements`." msgstr "" +"اگر هر یک از این :term:`ماژول‌های اختیاری ` در نسخه CPython" +" شما وجود نداشته باشد، به دنبال مستندات توزیع‌کننده خود بگردید (یعنی هر کسی " +"که پایتون را در اختیار شما قرار داده است). اگر توزیع‌کننده هستید، " +":ref:`optional-module-requirements` را ببینید." msgid "read/write support for the POSIX.1-1988 (ustar) format." -msgstr "" +msgstr "پشتیبانی از خواندن/نوشتن برای قالب POSIX.1-1988 (ustar)." -msgid "read/write support for the GNU tar format including *longname* and *longlink* extensions, read-only support for all variants of the *sparse* extension including restoration of sparse files." +msgid "" +"read/write support for the GNU tar format including *longname* and " +"*longlink* extensions, read-only support for all variants of the *sparse* " +"extension including restoration of sparse files." msgstr "" +"پشتیبانی از خواندن/نوشتن برای قالب GNU tar شامل افزونه‌های *longname* و " +"*longlink*، پشتیبانی فقط‌خواندنی از تمام انواع افزونه *sparse* از جمله " +"بازیابی فایل‌های پراکنده (sparse)." msgid "read/write support for the POSIX.1-2001 (pax) format." -msgstr "" +msgstr "پشتیبانی از خواندن/نوشتن قالب POSIX.1-2001 (pax)." -msgid "handles directories, regular files, hardlinks, symbolic links, fifos, character devices and block devices and is able to acquire and restore file information like timestamp, access permissions and owner." +msgid "" +"handles directories, regular files, hardlinks, symbolic links, fifos, " +"character devices and block devices and is able to acquire and restore file " +"information like timestamp, access permissions and owner." msgstr "" +"پوشه‌ها، فایل‌های معمولی، پیوندهای سخت، پیوندهای نمادین، FIFOها، دستگاه‌های" +" نویسه‌ای و دستگاه‌های بلوکی را مدیریت می‌کند و قادر است اطلاعات فایل مانند " +"برچسب زمانی، مجوزهای دسترسی و مالک را دریافت و بازیابی کند." msgid "Added support for :mod:`lzma` compression." -msgstr "" +msgstr "پشتیبانی از فشرده‌سازی :mod:`lzma` افزوده شد." -msgid "Archives are extracted using a :ref:`filter `, which makes it possible to either limit surprising/dangerous features, or to acknowledge that they are expected and the archive is fully trusted." +msgid "" +"Archives are extracted using a :ref:`filter `, " +"which makes it possible to either limit surprising/dangerous features, or to" +" acknowledge that they are expected and the archive is fully trusted." msgstr "" +"بایگانی‌ها با استفاده از یک :ref:`فیلتر ` استخراج" +" می‌شوند، که این امکان را به شما می‌دهد که یا ویژگی‌های غافلگیرکننده/خطرناک " +"را محدود کنید، یا تأیید کنید که مورد انتظار هستند و بایگانی کاملاً مورد " +"اعتماد است." -msgid "Set the default extraction filter to :func:`data `, which disallows some dangerous features such as links to absolute paths or paths outside of the destination. Previously, the filter strategy was equivalent to :func:`fully_trusted `." +msgid "" +"Set the default extraction filter to :func:`data `, which " +"disallows some dangerous features such as links to absolute paths or paths " +"outside of the destination. Previously, the filter strategy was equivalent " +"to :func:`fully_trusted `." msgstr "" +"فیلتر استخراج پیش‌فرض روی :func:`data ` تنظیم شد، که برخی " +"قابلیت‌های خطرناک مانند پیوندها به مسیرهای مطلق یا مسیرهای خارج از مقصد " +"را ممنوع می‌کند. پیش‌تر، راهبرد فیلتر معادل :func:`fully_trusted " +"` بود." msgid "Added support for Zstandard compression using :mod:`compression.zstd`." msgstr "" +"پشتیبانی از فشرده‌سازی Zstandard با استفاده از :mod:`compression.zstd` " +"افزوده شد." -msgid "Return a :class:`TarFile` object for the pathname *name*. For detailed information on :class:`TarFile` objects and the keyword arguments that are allowed, see :ref:`tarfile-objects`." +msgid "" +"Return a :class:`TarFile` object for the pathname *name*. For detailed " +"information on :class:`TarFile` objects and the keyword arguments that are " +"allowed, see :ref:`tarfile-objects`." msgstr "" +"یک شیء :class:`TarFile` را برای مسیر *name* بازمی‌گرداند. برای اطلاعات دقیق " +"درباره اشیای :class:`TarFile` و آرگومان‌های کلیدواژه‌ای مجاز، " +":ref:`tarfile-objects` را ببینید." -msgid "*mode* has to be a string of the form ``'filemode[:compression]'``, it defaults to ``'r'``. Here is a full list of mode combinations:" +msgid "" +"*mode* has to be a string of the form ``'filemode[:compression]'``, it " +"defaults to ``'r'``. Here is a full list of mode combinations:" msgstr "" +"*mode* باید رشته‌ای به شکل ``'filemode[:compression]'`` باشد؛ مقدار پیش‌فرض " +"آن ``'r'`` است. در اینجا فهرست کاملی از ترکیب‌های حالت آمده است:" msgid "mode" -msgstr "" +msgstr "حالت" msgid "action" -msgstr "" +msgstr "عملیات" msgid "``'r'`` or ``'r:*'``" -msgstr "" +msgstr "``'r'`` یا ``'r:*'``" msgid "Open for reading with transparent compression (recommended)." -msgstr "" +msgstr "برای خواندن با فشرده‌سازی شفاف باز شود (توصیه‌شده)." msgid "``'r:'``" -msgstr "" +msgstr "``'r:'``" msgid "Open for reading exclusively without compression." -msgstr "" +msgstr "باز کردن برای خواندن به‌صورت انحصاری، بدون فشرده‌سازی." msgid "``'r:gz'``" -msgstr "" +msgstr "``'r:gz'``" msgid "Open for reading with gzip compression." -msgstr "" +msgstr "باز کردن برای خواندن با فشرده‌سازی gzip." msgid "``'r:bz2'``" -msgstr "" +msgstr "``'r:bz2'``" msgid "Open for reading with bzip2 compression." -msgstr "" +msgstr "برای خواندن با فشرده‌سازی bzip2 باز می‌شود." msgid "``'r:xz'``" -msgstr "" +msgstr "``'r:xz'``" msgid "Open for reading with lzma compression." -msgstr "" +msgstr "باز کردن برای خواندن با فشرده‌سازی lzma." msgid "``'r:zst'``" -msgstr "" +msgstr "``'r:zst'``" msgid "Open for reading with Zstandard compression." -msgstr "" +msgstr "باز کردن برای خواندن با فشرده‌سازی Zstandard." msgid "``'x'`` or ``'x:'``" -msgstr "" +msgstr "``'x'`` یا ``'x:'``" -msgid "Create a tarfile exclusively without compression. Raise a :exc:`FileExistsError` exception if it already exists." +msgid "" +"Create a tarfile exclusively without compression. Raise a " +":exc:`FileExistsError` exception if it already exists." msgstr "" +"یک فایل tar را به‌صورت انحصاری و بدون فشرده‌سازی ایجاد می‌کند. اگر از قبل " +"وجود داشته باشد، استثنای :exc:`FileExistsError` پرتاب می‌شود." msgid "``'x:gz'``" -msgstr "" +msgstr "``'x:gz'``" -msgid "Create a tarfile with gzip compression. Raise a :exc:`FileExistsError` exception if it already exists." +msgid "" +"Create a tarfile with gzip compression. Raise a :exc:`FileExistsError` " +"exception if it already exists." msgstr "" +"یک tarfile با فشرده‌سازی gzip ایجاد کنید. اگر از پیش وجود داشته باشد، " +"استثنای :exc:`FileExistsError` را پرتاب کنید." msgid "``'x:bz2'``" -msgstr "" +msgstr "``'x:bz2'``" -msgid "Create a tarfile with bzip2 compression. Raise a :exc:`FileExistsError` exception if it already exists." +msgid "" +"Create a tarfile with bzip2 compression. Raise a :exc:`FileExistsError` " +"exception if it already exists." msgstr "" +"یک فایل tar با فشرده‌سازی bzip2 ایجاد می‌کند. اگر از قبل وجود داشته باشد، " +"استثنای :exc:`FileExistsError` را پرتاب می‌کند." msgid "``'x:xz'``" -msgstr "" +msgstr "``'x:xz'``" -msgid "Create a tarfile with lzma compression. Raise a :exc:`FileExistsError` exception if it already exists." +msgid "" +"Create a tarfile with lzma compression. Raise a :exc:`FileExistsError` " +"exception if it already exists." msgstr "" +"یک فایل tar با فشرده‌سازی lzma ایجاد کنید. اگر از قبل وجود دارد، استثنای " +":exc:`FileExistsError` را پرتاب کنید." msgid "``'x:zst'``" -msgstr "" +msgstr "``'x:zst'``" -msgid "Create a tarfile with Zstandard compression. Raise a :exc:`FileExistsError` exception if it already exists." +msgid "" +"Create a tarfile with Zstandard compression. Raise a :exc:`FileExistsError` " +"exception if it already exists." msgstr "" +"یک فایل tar با فشرده‌سازی Zstandard ایجاد می‌کند. اگر از قبل وجود داشته " +"باشد، استثنای :exc:`FileExistsError` را پرتاب می‌کند." msgid "``'a'`` or ``'a:'``" -msgstr "" +msgstr "``'a'`` یا ``'a:'``" -msgid "Open for appending with no compression. The file is created if it does not exist." +msgid "" +"Open for appending with no compression. The file is created if it does not " +"exist." msgstr "" +"برای الحاق بدون فشرده‌سازی باز می‌شود. اگر فایل موجود نباشد، ایجاد می‌شود." msgid "``'w'`` or ``'w:'``" -msgstr "" +msgstr "``'w'`` یا ``'w:'``" msgid "Open for uncompressed writing." -msgstr "" +msgstr "برای نوشتن فشرده‌نشده باز شود." msgid "``'w:gz'``" -msgstr "" +msgstr "``'w:gz'``" msgid "Open for gzip compressed writing." -msgstr "" +msgstr "برای نوشتن با فشرده‌سازی gzip باز شود." msgid "``'w:bz2'``" -msgstr "" +msgstr "``'w:bz2'``" msgid "Open for bzip2 compressed writing." -msgstr "" +msgstr "برای نوشتن با فشرده‌سازی bzip2 باز می‌شود." msgid "``'w:xz'``" -msgstr "" +msgstr "``'w:xz'``" msgid "Open for lzma compressed writing." -msgstr "" +msgstr "برای نوشتن با فشرده‌سازی lzma باز می‌شود." msgid "``'w:zst'``" -msgstr "" +msgstr "``'w:zst'``" msgid "Open for Zstandard compressed writing." -msgstr "" +msgstr "باز کردن برای نوشتن با فشردگی Zstandard." -msgid "Note that ``'a:gz'``, ``'a:bz2'`` or ``'a:xz'`` is not possible. If *mode* is not suitable to open a certain (compressed) file for reading, :exc:`ReadError` is raised. Use *mode* ``'r'`` to avoid this. If a compression method is not supported, :exc:`CompressionError` is raised." +msgid "" +"Note that ``'a:gz'``, ``'a:bz2'`` or ``'a:xz'`` is not possible. If *mode* " +"is not suitable to open a certain (compressed) file for reading, " +":exc:`ReadError` is raised. Use *mode* ``'r'`` to avoid this. If a " +"compression method is not supported, :exc:`CompressionError` is raised." msgstr "" +"توجه داشته باشید که ``'a:gz'``، ``'a:bz2'`` یا ``'a:xz'`` امکان‌پذیر نیست. " +"اگر *mode* برای باز کردن یک فایل مشخص (فشرده) جهت خواندن مناسب نباشد، " +":exc:`ReadError` پرتاب می‌شود. برای اجتناب از این حالت، از *mode* ``'r'`` " +"استفاده کنید. اگر یک روش فشرده‌سازی پشتیبانی نشود، :exc:`CompressionError` " +"پرتاب می‌شود." -msgid "If *fileobj* is specified, it is used as an alternative to a :term:`file object` opened in binary mode for *name*. It is supposed to be at position 0." +msgid "" +"If *fileobj* is specified, it is used as an alternative to a :term:`file " +"object` opened in binary mode for *name*. It is supposed to be at position " +"0." msgstr "" +"اگر *fileobj* مشخص شده باشد، از آن به‌عنوان جایگزینی برای یک :term:`file " +"object` بازشده در حالت دودویی برای *name* استفاده می‌شود. انتظار می‌رود در " +"موقعیت ۰ قرار داشته باشد." -msgid "For modes ``'w:gz'``, ``'x:gz'``, ``'w|gz'``, ``'w:bz2'``, ``'x:bz2'``, ``'w|bz2'``, :func:`tarfile.open` accepts the keyword argument *compresslevel* (default ``9``) to specify the compression level of the file." +msgid "" +"For modes ``'w:gz'``, ``'x:gz'``, ``'w|gz'``, ``'w:bz2'``, ``'x:bz2'``, " +"``'w|bz2'``, :func:`tarfile.open` accepts the keyword argument " +"*compresslevel* (default ``9``) to specify the compression level of the " +"file." msgstr "" +"برای حالت‌های ``'w:gz'``، ``'x:gz'``، ``'w|gz'``، ``'w:bz2'``، ``'x:bz2'``، " +"``'w|bz2'``، :func:`tarfile.open` آرگومان کلیدواژه‌ای *compresslevel* " +"(پیش‌فرض ``9``) را برای تعیین سطح فشرده‌سازی فایل می‌پذیرد." -msgid "For modes ``'w:xz'``, ``'x:xz'`` and ``'w|xz'``, :func:`tarfile.open` accepts the keyword argument *preset* to specify the compression level of the file." +msgid "" +"For modes ``'w:xz'``, ``'x:xz'`` and ``'w|xz'``, :func:`tarfile.open` " +"accepts the keyword argument *preset* to specify the compression level of " +"the file." msgstr "" +"برای حالت‌های ``'w:xz'``، ``'x:xz'`` و ``'w|xz'``، تابع :func:`tarfile.open`" +" آرگومان کلیدواژه‌ای *preset* را برای مشخص کردن سطح فشرده‌سازی فایل " +"می‌پذیرد." -msgid "For modes ``'w:zst'``, ``'x:zst'`` and ``'w|zst'``, :func:`tarfile.open` accepts the keyword argument *level* to specify the compression level of the file. The keyword argument *options* may also be passed, providing advanced Zstandard compression parameters described by :class:`~compression.zstd.CompressionParameter`. The keyword argument *zstd_dict* can be passed to provide a :class:`~compression.zstd.ZstdDict`, a Zstandard dictionary used to improve compression of smaller amounts of data." -msgstr "" +msgid "" +"For modes ``'w:zst'``, ``'x:zst'`` and ``'w|zst'``, :func:`tarfile.open` " +"accepts the keyword argument *level* to specify the compression level of the" +" file. The keyword argument *options* may also be passed, providing advanced" +" Zstandard compression parameters described by " +":class:`~compression.zstd.CompressionParameter`. The keyword argument " +"*zstd_dict* can be passed to provide a :class:`~compression.zstd.ZstdDict`, " +"a Zstandard dictionary used to improve compression of smaller amounts of " +"data." +msgstr "" +"برای حالت‌های ``'w:zst'``، ``'x:zst'`` و ``'w|zst'``، :func:`tarfile.open` " +"آرگومان کلیدواژه‌ای *level* را برای تعیین سطح فشرده‌سازی فایل می‌پذیرد. " +"آرگومان کلیدواژه‌ای *options* نیز می‌تواند ارسال شود تا پارامترهای پیشرفته " +"فشرده‌سازی Zstandard را که در " +":class:`~compression.zstd.CompressionParameter` توصیف شده‌اند، فراهم کند. " +"آرگومان کلیدواژه‌ای *zstd_dict* می‌تواند ارسال شود تا یک " +":class:`~compression.zstd.ZstdDict`، یک دیکشنری Zstandard که برای بهبود " +"فشرده‌سازی مقادیر کمتری از داده استفاده می‌شود، فراهم کند." -msgid "For special purposes, there is a second format for *mode*: ``'filemode|[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` object that processes its data as a stream of blocks. No random seeking will be done on the file. If given, *fileobj* may be any object that has a :meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` method (depending on the *mode*) that works with bytes. *bufsize* specifies the blocksize and defaults to ``20 * 512`` bytes. Use this variant in combination with e.g. ``sys.stdin.buffer``, a socket :term:`file object` or a tape device. However, such a :class:`TarFile` object is limited in that it does not allow random access, see :ref:`tar-examples`. The currently possible modes:" -msgstr "" +msgid "" +"For special purposes, there is a second format for *mode*: " +"``'filemode|[compression]'``. :func:`tarfile.open` will return a " +":class:`TarFile` object that processes its data as a stream of blocks. No " +"random seeking will be done on the file. If given, *fileobj* may be any " +"object that has a :meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` " +"method (depending on the *mode*) that works with bytes. *bufsize* specifies " +"the blocksize and defaults to ``20 * 512`` bytes. Use this variant in " +"combination with e.g. ``sys.stdin.buffer``, a socket :term:`file object` or " +"a tape device. However, such a :class:`TarFile` object is limited in that it" +" does not allow random access, see :ref:`tar-examples`. The currently " +"possible modes:" +msgstr "" +"برای اهداف خاص، قالب دومی برای *mode* وجود دارد: " +"``'filemode|[compression]'``. :func:`tarfile.open` یک شیء :class:`TarFile` " +"برمی‌گرداند که داده‌های خود را به‌صورت جریانی از بلوک‌ها پردازش می‌کند. هیچ" +" مکان‌یابی تصادفی‌ای روی فایل انجام نخواهد شد. در صورت ارائه، *fileobj* " +"می‌تواند هر شیءای باشد که یک متد :meth:`~io.RawIOBase.read` یا " +":meth:`~io.RawIOBase.write` (بسته به *mode*) داشته باشد که با بایت‌ها کار " +"می‌کند. *bufsize* اندازه‌ی بلوک را مشخص می‌کند و مقدار پیش‌فرض آن ``20 * " +"512`` بایت است. از این حالت در ترکیب با مواردی مانند ``sys.stdin.buffer``، " +"یک :term:`file object` برای سوکت یا یک دستگاه نوار استفاده کنید. با این حال،" +" چنین شیء :class:`TarFile` محدود است، زیرا دسترسی تصادفی را اجازه نمی‌دهد؛ " +":ref:`tar-examples` را ببینید. حالت‌های ممکن کنونی:" msgid "Mode" -msgstr "" +msgstr "حالت" msgid "Action" -msgstr "" +msgstr "عملیات" msgid "``'r|*'``" -msgstr "" +msgstr "``'r|*'``" -msgid "Open a *stream* of tar blocks for reading with transparent compression." -msgstr "" +msgid "" +"Open a *stream* of tar blocks for reading with transparent compression." +msgstr "باز کردن یک *جریان* از بلوک‌های tar برای خواندن با فشرده‌سازی شفاف." msgid "``'r|'``" -msgstr "" +msgstr "``'r|'``" msgid "Open a *stream* of uncompressed tar blocks for reading." -msgstr "" +msgstr "باز کردن یک *جریان* از بلوک‌های tar فشرده‌نشده برای خواندن." msgid "``'r|gz'``" -msgstr "" +msgstr "``'r|gz'``" msgid "Open a gzip compressed *stream* for reading." -msgstr "" +msgstr "باز کردن یک *جریان* فشرده‌شده با gzip برای خواندن." msgid "``'r|bz2'``" -msgstr "" +msgstr "``'r|bz2'``" msgid "Open a bzip2 compressed *stream* for reading." -msgstr "" +msgstr "یک *جریان* فشرده‌شده با bzip2 را برای خواندن باز کنید." msgid "``'r|xz'``" -msgstr "" +msgstr "``'r|xz'``" msgid "Open an lzma compressed *stream* for reading." -msgstr "" +msgstr "باز کردن یک *جریان* فشرده‌شده با lzma برای خواندن." msgid "``'r|zst'``" -msgstr "" +msgstr "``'r|zst'``" msgid "Open a Zstandard compressed *stream* for reading." -msgstr "" +msgstr "یک *جریان* فشرده‌شده با Zstandard را برای خواندن باز کنید." msgid "``'w|'``" -msgstr "" +msgstr "``'w|'``" msgid "Open an uncompressed *stream* for writing." -msgstr "" +msgstr "باز کردن یک *جریان* فشرده‌نشده برای نوشتن." msgid "``'w|gz'``" -msgstr "" +msgstr "``'w|gz'``" msgid "Open a gzip compressed *stream* for writing." -msgstr "" +msgstr "باز کردن یک *جریان* فشرده‌شده با gzip برای نوشتن." msgid "``'w|bz2'``" -msgstr "" +msgstr "``'w|bz2'``" msgid "Open a bzip2 compressed *stream* for writing." -msgstr "" +msgstr "یک *جریان* فشرده‌شده با bzip2 را برای نوشتن باز کنید." msgid "``'w|xz'``" -msgstr "" +msgstr "``'w|xz'``" msgid "Open an lzma compressed *stream* for writing." -msgstr "" +msgstr "یک *جریان* فشرده‌شده با lzma را برای نوشتن باز کنید." msgid "``'w|zst'``" -msgstr "" +msgstr "``'w|zst'``" msgid "Open a Zstandard compressed *stream* for writing." -msgstr "" +msgstr "یک *جریان* فشرده با Zstandard را برای نوشتن باز کنید." msgid "The ``'x'`` (exclusive creation) mode was added." -msgstr "" +msgstr "حالت ``'x'`` (ایجاد انحصاری) افزوده شد." msgid "The *name* parameter accepts a :term:`path-like object`." -msgstr "" +msgstr "پارامتر *name* یک :term:`path-like object` را می‌پذیرد." msgid "The *compresslevel* keyword argument also works for streams." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *compresslevel* برای جریان‌ها نیز کار می‌کند." msgid "The *preset* keyword argument also works for streams." -msgstr "" +msgstr "آرگومان کلیدواژه‌ای *preset* برای جریان‌ها نیز کار می‌کند." -msgid "Class for reading and writing tar archives. Do not use this class directly: use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." +msgid "" +"Class for reading and writing tar archives. Do not use this class directly: " +"use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" +"کلاسی برای خواندن و نوشتن بایگانی‌های tar. از این کلاس به‌طور مستقیم استفاده" +" نکنید: در عوض از :func:`tarfile.open` استفاده کنید. :ref:`tarfile-objects` " +"را ببینید." -msgid "Return :const:`True` if *name* is a tar archive file, that the :mod:`!tarfile` module can read. *name* may be a :class:`str`, file, or file-like object." +msgid "" +"Return :const:`True` if *name* is a tar archive file, that the " +":mod:`!tarfile` module can read. *name* may be a :class:`str`, file, or " +"file-like object." msgstr "" +"اگر *name* یک فایل آرشیو tar باشد که ماژول :mod:`!tarfile` بتواند آن را " +"بخواند، :const:`True` را برمی‌گرداند. *name* می‌تواند یک :class:`str`، فایل " +"یا شیء فایل‌مانند باشد." msgid "Support for file and file-like objects." -msgstr "" +msgstr "پشتیبانی از فایل‌ها و اشیاء شبه‌فایل." msgid "The :mod:`!tarfile` module defines the following exceptions:" -msgstr "" +msgstr "ماژول :mod:`!tarfile` استثناهای زیر را تعریف می‌کند:" msgid "Base class for all :mod:`!tarfile` exceptions." -msgstr "" +msgstr "کلاس پایه برای همه‌ی استثناهای :mod:`!tarfile`." -msgid "Is raised when a tar archive is opened, that either cannot be handled by the :mod:`!tarfile` module or is somehow invalid." +msgid "" +"Is raised when a tar archive is opened, that either cannot be handled by the" +" :mod:`!tarfile` module or is somehow invalid." msgstr "" +"هنگام باز شدن یک بایگانی tar که یا توسط ماژول :mod:`!tarfile` قابل مدیریت " +"نیست یا به‌نحوی نامعتبر است، پرتاب می‌شود." -msgid "Is raised when a compression method is not supported or when the data cannot be decoded properly." +msgid "" +"Is raised when a compression method is not supported or when the data cannot" +" be decoded properly." msgstr "" +"هنگامی پرتاب می‌شود که از یک روش فشرده‌سازی پشتیبانی نشود یا نتوان داده‌ها " +"را به‌درستی کدگشایی کرد." -msgid "Is raised for the limitations that are typical for stream-like :class:`TarFile` objects." +msgid "" +"Is raised for the limitations that are typical for stream-like " +":class:`TarFile` objects." msgstr "" +"برای محدودیت‌های رایج در اشیاء :class:`TarFile` شبیه به جریان، پرتاب می‌شود." -msgid "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but only if :attr:`TarFile.errorlevel`\\ ``== 2``." +msgid "" +"Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " +"only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" +"برای خطاهای *غیرمرگبار* هنگام استفاده از :meth:`TarFile.extract` پرتاب " +"می‌شود، اما تنها در صورتی که :attr:`TarFile.errorlevel`\\ ``== 2`` باشد." msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" +"توسط :meth:`TarInfo.frombuf` در صورتی پرتاب می‌شود که بافر دریافتی آن " +"نامعتبر باشد." -msgid "Base class for members :ref:`refused ` by filters." +msgid "" +"Base class for members :ref:`refused ` by " +"filters." msgstr "" +"کلاس پایه برای اعضای :ref:`ردشده ` توسط فیلترها." -msgid "Information about the member that the filter refused to extract, as :ref:`TarInfo `." +msgid "" +"Information about the member that the filter refused to extract, as " +":ref:`TarInfo `." msgstr "" +"اطلاعات مربوط به عضوی که فیلتر از استخراج آن خودداری کرد، به‌صورت " +":ref:`TarInfo `." msgid "Raised to refuse extracting a member with an absolute path." -msgstr "" +msgstr "برای امتناع از استخراج یک عضو با مسیر مطلق پرتاب می‌شود." -msgid "Raised to refuse extracting a member outside the destination directory." -msgstr "" +msgid "" +"Raised to refuse extracting a member outside the destination directory." +msgstr "برای امتناع از استخراج یک عضو خارج از پوشه مقصد پرتاب می‌شود." msgid "Raised to refuse extracting a special file (e.g. a device or pipe)." msgstr "" +"برای خودداری از استخراج یک فایل خاص (مثلاً یک دستگاه یا پایپ ) پرتاب " +"می‌شود." msgid "Raised to refuse extracting a symbolic link with an absolute path." -msgstr "" +msgstr "برای امتناع از استخراج یک پیوند نمادین با مسیر مطلق، پرتاب می‌شود." -msgid "Raised to refuse extracting a symbolic link pointing outside the destination directory." +msgid "" +"Raised to refuse extracting a symbolic link pointing outside the destination" +" directory." msgstr "" +"پرتاب می‌شود تا از استخراج یک پیوند نمادین که به خارج از پوشه‌ی مقصد اشاره " +"دارد، خودداری شود." -msgid "Raised to refuse emulating a link (hard or symbolic) by extracting another archive member, when that member would be rejected by the filter location. The exception that was raised to reject the replacement member is available as :attr:`!BaseException.__context__`." +msgid "" +"Raised to refuse emulating a link (hard or symbolic) by extracting another " +"archive member, when that member would be rejected by the filter location. " +"The exception that was raised to reject the replacement member is available " +"as :attr:`!BaseException.__context__`." msgstr "" +"پرتاب می‌شود تا شبیه‌سازی یک پیوند (سخت یا نمادین) از طریق استخراج عضوی دیگر" +" از بایگانی را رد کند، در صورتی که آن عضو توسط موقعیت فیلتر رد شود. استثنایی" +" که برای رد عضو جایگزین پرتاب شده است، به‌صورت " +":attr:`!BaseException.__context__` در دسترس است." msgid "The following constants are available at the module level:" -msgstr "" +msgstr "ثابت‌های زیر در سطح ماژول در دسترس هستند:" -msgid "The default character encoding: ``'utf-8'`` on Windows, the value returned by :func:`sys.getfilesystemencoding` otherwise." +msgid "" +"The default character encoding: ``'utf-8'`` on Windows, the value returned " +"by :func:`sys.getfilesystemencoding` otherwise." msgstr "" +"کدگذاری پیش‌فرض نویسه‌ها: در ویندوز ``'utf-8'`` و در غیر این صورت، مقداری که" +" :func:`sys.getfilesystemencoding` برمی‌گرداند." msgid "A regular file :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک فایل معمولی :attr:`~TarInfo.type`." msgid "A link (inside tarfile) :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک پیوند (داخل tarfile) :attr:`~TarInfo.type`." msgid "A symbolic link :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک پیوند نمادین :attr:`~TarInfo.type`." msgid "A character special device :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک دستگاه خاص نویسه‌ای :attr:`~TarInfo.type`." msgid "A block special device :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک دستگاه ویژه‌ی بلوکی (block special device) :attr:`~TarInfo.type`." msgid "A directory :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک :attr:`~TarInfo.type` پوشه." msgid "A FIFO special device :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک دستگاه خاص FIFO :attr:`~TarInfo.type`." msgid "A contiguous file :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک فایل پیوسته :attr:`~TarInfo.type`." msgid "A GNU tar longname :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک :attr:`~TarInfo.type` برای نام بلند GNU tar." msgid "A GNU tar longlink :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک :attr:`~TarInfo.type` برای پیوند بلند (longlink) در GNU tar." msgid "A GNU tar sparse file :attr:`~TarInfo.type`." -msgstr "" +msgstr "یک فایل پراکنده (sparse file) در GNU tar :attr:`~TarInfo.type`." -msgid "Each of the following constants defines a tar archive format that the :mod:`!tarfile` module is able to create. See section :ref:`tar-formats` for details." +msgid "" +"Each of the following constants defines a tar archive format that the " +":mod:`!tarfile` module is able to create. See section :ref:`tar-formats` for" +" details." msgstr "" +"هر یک از ثابت‌های زیر، یک قالب آرشیو tar را تعریف می‌کند که ماژول " +":mod:`!tarfile` می‌تواند آن را ایجاد کند. برای جزئیات، بخش :ref:`tar-" +"formats` را ببینید." msgid "POSIX.1-1988 (ustar) format." -msgstr "" +msgstr "قالب POSIX.1-1988 (ustar)." msgid "GNU tar format." -msgstr "" +msgstr "قالب GNU tar." msgid "POSIX.1-2001 (pax) format." -msgstr "" +msgstr "قالب POSIX.1-2001 (pax)." -msgid "The default format for creating archives. This is currently :const:`PAX_FORMAT`." +msgid "" +"The default format for creating archives. This is currently " +":const:`PAX_FORMAT`." msgstr "" +"قالب پیش‌فرض برای ایجاد بایگانی‌ها. این در حال حاضر :const:`PAX_FORMAT` است." -msgid "The default format for new archives was changed to :const:`PAX_FORMAT` from :const:`GNU_FORMAT`." +msgid "" +"The default format for new archives was changed to :const:`PAX_FORMAT` from " +":const:`GNU_FORMAT`." msgstr "" +"قالب پیش‌فرض برای بایگانی‌های جدید از :const:`GNU_FORMAT ` به " +":const:`PAX_FORMAT ` تغییر کرد." msgid "Module :mod:`zipfile`" -msgstr "" +msgstr "ماژول :mod:`zipfile`" msgid "Documentation of the :mod:`zipfile` standard module." -msgstr "" +msgstr "مستندات ماژول استاندارد :mod:`zipfile`." msgid ":ref:`archiving-operations`" -msgstr "" +msgstr ":ref:`archiving-operations`" -msgid "Documentation of the higher-level archiving facilities provided by the standard :mod:`shutil` module." +msgid "" +"Documentation of the higher-level archiving facilities provided by the " +"standard :mod:`shutil` module." msgstr "" +"مستندات امکانات بایگانی سطح بالاتر ارائه‌شده توسط ماژول استاندارد " +":mod:`shutil`." -msgid "`GNU tar manual, Basic Tar Format `_" +msgid "" +"`GNU tar manual, Basic Tar Format " +"`_" msgstr "" +"راهنمای GNU tar، قالب پایه `Tar" +" `_" msgid "Documentation for tar archive files, including GNU tar extensions." -msgstr "" +msgstr "مستندات فایل‌های آرشیوی tar، شامل افزونه‌های GNU tar." msgid "TarFile Objects" -msgstr "" +msgstr "اشیای TarFile" -msgid "The :class:`TarFile` object provides an interface to a tar archive. A tar archive is a sequence of blocks. An archive member (a stored file) is made up of a header block followed by data blocks. It is possible to store a file in a tar archive several times. Each archive member is represented by a :class:`TarInfo` object, see :ref:`tarinfo-objects` for details." -msgstr "" +msgid "" +"The :class:`TarFile` object provides an interface to a tar archive. A tar " +"archive is a sequence of blocks. An archive member (a stored file) is made " +"up of a header block followed by data blocks. It is possible to store a file" +" in a tar archive several times. Each archive member is represented by a " +":class:`TarInfo` object, see :ref:`tarinfo-objects` for details." +msgstr "" +"شیء :class:`TarFile` رابطی به یک بایگانی tar فراهم می‌کند. یک بایگانی tar " +"دنباله‌ای از بلوک‌ها است. یک عضو بایگانی (یک فایل ذخیره‌شده) از یک بلوک " +"سرآیند و به‌دنبال آن بلوک‌های داده تشکیل شده است. می‌توان یک فایل را چندین " +"بار در یک بایگانی tar ذخیره کرد. هر عضو بایگانی توسط یک شیء :class:`TarInfo`" +" نمایش داده می‌شود، برای جزئیات :ref:`tarinfo-objects` را ببینید." -msgid "A :class:`TarFile` object can be used as a context manager in a :keyword:`with` statement. It will automatically be closed when the block is completed. Please note that in the event of an exception an archive opened for writing will not be finalized; only the internally used file object will be closed. See the :ref:`tar-examples` section for a use case." -msgstr "" +msgid "" +"A :class:`TarFile` object can be used as a context manager in a " +":keyword:`with` statement. It will automatically be closed when the block is" +" completed. Please note that in the event of an exception an archive opened " +"for writing will not be finalized; only the internally used file object will" +" be closed. See the :ref:`tar-examples` section for a use case." +msgstr "" +"می‌توان از یک شیء :class:`TarFile` به‌عنوان مدیر زمینه در یک دستور " +":keyword:`with` استفاده کرد. این شیء هنگامی که بلوک کامل شود به‌طور خودکار " +"بسته می‌شود. لطفاً توجه داشته باشید که در صورت بروز استثنا، بایگانی بازشده " +"برای نوشتن نهایی نخواهد شد؛ تنها شیء فایلی که به‌صورت داخلی استفاده‌شده است " +"بسته خواهد شد. برای دیدن یک نمونه‌ی استفاده، بخش :ref:`tar-examples` را " +"ببینید." msgid "Added support for the context management protocol." -msgstr "" +msgstr "پشتیبانی از پروتکل مدیریت زمینه اضافه شد." -msgid "All following arguments are optional and can be accessed as instance attributes as well." +msgid "" +"All following arguments are optional and can be accessed as instance " +"attributes as well." msgstr "" +"تمام آرگومان‌های بعدی اختیاری هستند و می‌توان به‌عنوان ویژگی‌های نمونه نیز " +"به آن‌ها دسترسی داشت." -msgid "*name* is the pathname of the archive. *name* may be a :term:`path-like object`. It can be omitted if *fileobj* is given. In this case, the file object's :attr:`!name` attribute is used if it exists." +msgid "" +"*name* is the pathname of the archive. *name* may be a :term:`path-like " +"object`. It can be omitted if *fileobj* is given. In this case, the file " +"object's :attr:`!name` attribute is used if it exists." msgstr "" +"*name* نام مسیر بایگانی است. *name* ممکن است یک :term:`path-like object` " +"باشد. اگر *fileobj* داده شود، می‌توان آن را حذف کرد. در این حالت، اگر ویژگی " +":attr:`!name` شیء فایل وجود داشته باشد، از آن استفاده می‌شود." -msgid "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append data to an existing file, ``'w'`` to create a new file overwriting an existing one, or ``'x'`` to create a new file only if it does not already exist." +msgid "" +"*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append" +" data to an existing file, ``'w'`` to create a new file overwriting an " +"existing one, or ``'x'`` to create a new file only if it does not already " +"exist." msgstr "" +"*mode* می‌تواند ``'r'`` برای خواندن از یک بایگانی موجود، ``'a'`` برای افزودن" +" داده‌ها به یک فایل موجود، ``'w'`` برای ایجاد یک فایل جدید و بازنویسی فایل " +"موجود، یا ``'x'`` برای ایجاد یک فایل جدید فقط در صورتی باشد که از قبل وجود " +"نداشته باشد." -msgid "If *fileobj* is given, it is used for reading or writing data. If it can be determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used from position 0." +msgid "" +"If *fileobj* is given, it is used for reading or writing data. If it can be " +"determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used" +" from position 0." msgstr "" +"اگر *fileobj* داده شده باشد، از آن برای خواندن یا نوشتن داده استفاده می‌شود." +" اگر قابل تعیین باشد، *mode* با حالت *fileobj* جایگزین می‌شود. *fileobj* از " +"موقعیت ۰ مورد استفاده قرار خواهد گرفت." msgid "*fileobj* is not closed, when :class:`TarFile` is closed." -msgstr "" +msgstr "هنگامی که :class:`TarFile` بسته می‌شود، *fileobj* بسته نمی‌شود." -msgid "*format* controls the archive format for writing. It must be one of the constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` that are defined at module level. When reading, format will be automatically detected, even if different formats are present in a single archive." +msgid "" +"*format* controls the archive format for writing. It must be one of the " +"constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " +"that are defined at module level. When reading, format will be automatically" +" detected, even if different formats are present in a single archive." msgstr "" +"*format* قالب بایگانی را برای نوشتن کنترل می‌کند. مقدار آن باید یکی از " +"ثابت‌های :const:`USTAR_FORMAT`، :const:`GNU_FORMAT` یا :const:`PAX_FORMAT` " +"باشد که در سطح ماژول تعریف شده‌اند. هنگام خواندن، قالب به‌طور خودکار شناسایی" +" می‌شود، حتی اگر قالب‌های متفاوتی در یک بایگانی واحد وجود داشته باشند." -msgid "The *tarinfo* argument can be used to replace the default :class:`TarInfo` class with a different one." +msgid "" +"The *tarinfo* argument can be used to replace the default :class:`TarInfo` " +"class with a different one." msgstr "" +"می‌توانید از آرگومان *tarinfo* برای جایگزینی کلاس پیش‌فرض :class:`TarInfo` " +"با کلاس دیگری استفاده کنید." -msgid "If *dereference* is :const:`False`, add symbolic and hard links to the archive. If it is :const:`True`, add the content of the target files to the archive. This has no effect on systems that do not support symbolic links." +msgid "" +"If *dereference* is :const:`False`, add symbolic and hard links to the " +"archive. If it is :const:`True`, add the content of the target files to the " +"archive. This has no effect on systems that do not support symbolic links." msgstr "" +"اگر *dereference* برابر :const:`False` باشد، پیوندهای نمادین و سخت به " +"بایگانی افزوده می‌شوند. اگر این مقدار :const:`True` باشد، محتوای فایل‌های " +"هدف به بایگانی افزوده می‌شود. این موضوع در سیستم‌هایی که از پیوندهای نمادین " +"پشتیبانی نمی‌کنند، تأثیری ندارد." -msgid "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the archive. If it is :const:`True`, skip empty (and invalid) blocks and try to get as many members as possible. This is only useful for reading concatenated or damaged archives." +msgid "" +"If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " +"archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " +"get as many members as possible. This is only useful for reading " +"concatenated or damaged archives." msgstr "" +"اگر *ignore_zeros* برابر :const:`False` باشد، یک بلوک خالی به‌عنوان پایان " +"بایگانی در نظر گرفته می‌شود. اگر این مقدار :const:`True` باشد، از بلوک‌های " +"خالی (و نامعتبر) چشم‌پوشی می‌شود و تلاش می‌شود تا حد ممکن اعضا دریافت شوند. " +"این فقط برای خواندن بایگانی‌های به‌هم‌پیوسته یا آسیب‌دیده مفید است." -msgid "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug messages). The messages are written to ``sys.stderr``." +msgid "" +"*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " +"messages). The messages are written to ``sys.stderr``." msgstr "" +"*debug* می‌تواند از ``0`` (بدون پیام‌های اشکال‌زدایی) تا ``3`` (همه پیام‌های" +" اشکال‌زدایی) تنظیم شود. پیام‌ها در ``sys.stderr`` نوشته می‌شوند." -msgid "*errorlevel* controls how extraction errors are handled, see :attr:`the corresponding attribute `." +msgid "" +"*errorlevel* controls how extraction errors are handled, see :attr:`the " +"corresponding attribute `." msgstr "" +"*errorlevel* نحوه‌ی مدیریت خطاهای استخراج را کنترل می‌کند، :attr:`ویژگی " +"متناظر ` را ببینید." -msgid "The *encoding* and *errors* arguments define the character encoding to be used for reading or writing the archive and how conversion errors are going to be handled. The default settings will work for most users. See section :ref:`tar-unicode` for in-depth information." +msgid "" +"The *encoding* and *errors* arguments define the character encoding to be " +"used for reading or writing the archive and how conversion errors are going " +"to be handled. The default settings will work for most users. See section " +":ref:`tar-unicode` for in-depth information." msgstr "" +"آرگومان‌های *encoding* و *errors* کدگذاری نویسه‌ای را که برای خواندن یا " +"نوشتن بایگانی استفاده می‌شود و نحوه‌ی مدیریت خطاهای تبدیل را تعریف می‌کنند. " +"تنظیمات پیش‌فرض برای بیشتر کاربران کارساز خواهد بود. برای اطلاعات جامع‌تر، " +"بخش :ref:`tar-unicode` را ببینید." -msgid "The *pax_headers* argument is an optional dictionary of strings which will be added as a pax global header if *format* is :const:`PAX_FORMAT`." +msgid "" +"The *pax_headers* argument is an optional dictionary of strings which will " +"be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" +"آرگومان *pax_headers* یک دیکشنری اختیاری از رشته‌ها است که اگر *format* " +"برابر :const:`PAX_FORMAT` باشد، به‌عنوان یک سرآیند سراسری pax اضافه خواهد شد." -msgid "If *stream* is set to :const:`True` then while reading the archive info about files in the archive are not cached, saving memory." +msgid "" +"If *stream* is set to :const:`True` then while reading the archive info " +"about files in the archive are not cached, saving memory." msgstr "" +"اگر *stream* روی :const:`True` تنظیم شده باشد، آنگاه هنگام خواندن بایگانی، " +"اطلاعات مربوط به فایل‌های درون بایگانی در نهانگاه ذخیره نمی‌شود و در حافظه " +"صرفه‌جویی می‌شود." msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" +"از ``'surrogateescape'`` به‌عنوان مقدار پیش‌فرض آرگومان *errors* استفاده " +"کنید." msgid "Add the *stream* parameter." -msgstr "" +msgstr "پارامتر *stream* را اضافه کنید." -msgid "Alternative constructor. The :func:`tarfile.open` function is actually a shortcut to this classmethod." +msgid "" +"Alternative constructor. The :func:`tarfile.open` function is actually a " +"shortcut to this classmethod." msgstr "" +"سازنده جایگزین. تابع :func:`tarfile.open` در واقع میان‌بری به این classmethod " +"است." -msgid "Return a :class:`TarInfo` object for member *name*. If *name* can not be found in the archive, :exc:`KeyError` is raised." +msgid "" +"Return a :class:`TarInfo` object for member *name*. If *name* can not be " +"found in the archive, :exc:`KeyError` is raised." msgstr "" +"یک شیء :class:`TarInfo` برای عضو *name* برمی‌گرداند. اگر *name* در بایگانی " +"یافت نشود، :exc:`KeyError` پرتاب می‌شود." -msgid "If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version." +msgid "" +"If a member occurs more than once in the archive, its last occurrence is " +"assumed to be the most up-to-date version." msgstr "" +"اگر عضوی بیش از یک بار در بایگانی وجود داشته باشد، آخرین مورد آن به‌عنوان " +"به‌روزترین نسخه فرض می‌شود." -msgid "Return the members of the archive as a list of :class:`TarInfo` objects. The list has the same order as the members in the archive." +msgid "" +"Return the members of the archive as a list of :class:`TarInfo` objects. The" +" list has the same order as the members in the archive." msgstr "" +"اعضای آرشیو را به‌عنوان فهرستی از اشیای :class:`TarInfo` برمی‌گرداند. " +"فهرست همان ترتیب اعضای آرشیو را دارد." -msgid "Return the members as a list of their names. It has the same order as the list returned by :meth:`getmembers`." +msgid "" +"Return the members as a list of their names. It has the same order as the " +"list returned by :meth:`getmembers`." msgstr "" +"اعضا را به‌صورت فهرستی از نام‌هایشان برمی‌گرداند. ترتیب این فهرست همان ترتیب" +" فهرست برگردانده‌شده توسط :meth:`getmembers` است." -msgid "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, only the names of the members are printed. If it is :const:`True`, output similar to that of :program:`ls -l` is produced. If optional *members* is given, it must be a subset of the list returned by :meth:`getmembers`." +msgid "" +"Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`," +" only the names of the members are printed. If it is :const:`True`, output " +"similar to that of :program:`ls -l` is produced. If optional *members* is " +"given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" +"فهرست محتوا را در ``sys.stdout`` چاپ می‌کند. اگر *verbose* برابر " +":const:`False` باشد، تنها نام اعضا چاپ می‌شود. اگر این مقدار :const:`True` " +"باشد، خروجی مشابه خروجی :program:`ls -l` تولید می‌شود. اگر *members* اختیاری" +" داده شود، باید زیرمجموعه‌ای از فهرستی باشد که :meth:`getmembers` " +"برمی‌گرداند." msgid "Added the *members* parameter." -msgstr "" +msgstr "پارامتر *members* افزوده شد." -msgid "Return the next member of the archive as a :class:`TarInfo` object, when :class:`TarFile` is opened for reading. Return :const:`None` if there is no more available." +msgid "" +"Return the next member of the archive as a :class:`TarInfo` object, when " +":class:`TarFile` is opened for reading. Return :const:`None` if there is no " +"more available." msgstr "" +"هنگامی که :class:`TarFile ` برای خواندن باز شده باشد، عضو بعدی " +"بایگانی را به‌صورت یک شیء :class:`TarInfo ` برمی‌گرداند. اگر عضو " +"دیگری در دسترس نباشد، :const:`None` برمی‌گرداند." -msgid "Extract all members from the archive to the current working directory or directory *path*. If optional *members* is given, it must be a subset of the list returned by :meth:`getmembers`. Directory information like owner, modification time and permissions are set after all members have been extracted. This is done to work around two problems: A directory's modification time is reset each time a file is created in it. And, if a directory's permissions do not allow writing, extracting files to it will fail." -msgstr "" +msgid "" +"Extract all members from the archive to the current working directory or " +"directory *path*. If optional *members* is given, it must be a subset of the" +" list returned by :meth:`getmembers`. Directory information like owner, " +"modification time and permissions are set after all members have been " +"extracted. This is done to work around two problems: A directory's " +"modification time is reset each time a file is created in it. And, if a " +"directory's permissions do not allow writing, extracting files to it will " +"fail." +msgstr "" +"تمام اعضا را از بایگانی به پوشه کاری جاری یا پوشه *path* استخراج کنید. اگر " +"*members* اختیاری داده شود، باید زیرمجموعه‌ای از فهرست برگردانده‌شده توسط " +":meth:`getmembers` باشد. اطلاعات پوشه مانند مالک، زمان تغییر و مجوزها پس از " +"استخراج همه اعضا تنظیم می‌شوند. این کار برای دور زدن دو مشکل انجام می‌شود: " +"زمان تغییر یک پوشه هر بار که فایلی در آن ایجاد می‌شود، بازنشانی می‌شود. و " +"اگر مجوزهای یک پوشه اجازه نوشتن ندهند، استخراج فایل‌ها به آن ناموفق خواهد " +"بود." -msgid "If *numeric_owner* is :const:`True`, the uid and gid numbers from the tarfile are used to set the owner/group for the extracted files. Otherwise, the named values from the tarfile are used." +msgid "" +"If *numeric_owner* is :const:`True`, the uid and gid numbers from the " +"tarfile are used to set the owner/group for the extracted files. Otherwise, " +"the named values from the tarfile are used." msgstr "" +"اگر *numeric_owner* برابر :const:`True` باشد، از شماره‌های uid و gid موجود " +"در tarfile برای تنظیم مالک/گروه فایل‌های استخراج‌شده استفاده می‌شود. در غیر " +"این صورت، از مقادیر نام‌دار موجود در tarfile استفاده می‌شود." -msgid "The *filter* argument specifies how ``members`` are modified or rejected before extraction. See :ref:`tarfile-extraction-filter` for details. It is recommended to set this explicitly only if specific *tar* features are required, or as ``filter='data'`` to support Python versions with a less secure default (3.13 and lower)." -msgstr "" +msgid "" +"The *filter* argument specifies how ``members`` are modified or rejected " +"before extraction. See :ref:`tarfile-extraction-filter` for details. It is " +"recommended to set this explicitly only if specific *tar* features are " +"required, or as ``filter='data'`` to support Python versions with a less " +"secure default (3.13 and lower)." +msgstr "" +"آرگومان *filter* مشخص می‌کند که ``members`` پیش از استخراج چگونه تغییر داده " +"شوند یا رد شوند. برای جزئیات، :ref:`tarfile-extraction-filter` را ببینید. " +"توصیه می‌شود این را فقط در صورت نیاز به ویژگی‌های خاص *tar* به‌صراحت تنظیم " +"کنید، یا برای پشتیبانی از نسخه‌های پایتون با پیش‌فرض کم‌امنیت‌تر (3.13 و " +"پایین‌تر)، آن را به‌صورت ``filter='data'`` تنظیم کنید." -msgid "Never extract archives from untrusted sources without prior inspection." -msgstr "" +msgid "" +"Never extract archives from untrusted sources without prior inspection." +msgstr "هرگز آرشیوها را از منابع نامطمئن بدون بررسی پیشین استخراج نکنید." -msgid "Since Python 3.14, the default (:func:`data `) will prevent the most dangerous security issues. However, it will not prevent *all* unintended or insecure behavior. Read the :ref:`tarfile-extraction-filter` section for details." +msgid "" +"Since Python 3.14, the default (:func:`data `) will prevent the" +" most dangerous security issues. However, it will not prevent *all* " +"unintended or insecure behavior. Read the :ref:`tarfile-extraction-filter` " +"section for details." msgstr "" +"از پایتون 3.14، پیش‌فرض (:func:`data `) از خطرناک‌ترین مسائل " +"امنیتی جلوگیری می‌کند. با این حال، از *همه* رفتارهای ناخواسته یا ناامن " +"جلوگیری نمی‌کند. برای جزئیات، بخش :ref:`tarfile-extraction-filter` را " +"بخوانید." msgid "Added the *numeric_owner* parameter." -msgstr "" +msgstr "پارامتر *numeric_owner* اضافه شد." msgid "The *path* parameter accepts a :term:`path-like object`." -msgstr "" +msgstr "پارامتر *path* یک :term:`path-like object` را می‌پذیرد." msgid "Added the *filter* parameter." -msgstr "" +msgstr "پارامتر *filter* اضافه شد." msgid "The *filter* parameter now defaults to ``'data'``." -msgstr "" +msgstr "پارامتر *filter* اکنون به‌طور پیش‌فرض مقدار ``'data'`` دارد." -msgid "Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. *member* may be a filename or a :class:`TarInfo` object. You can specify a different directory using *path*. *path* may be a :term:`path-like object`. File attributes (owner, mtime, mode) are set unless *set_attrs* is false." -msgstr "" +msgid "" +"Extract a member from the archive to the current working directory, using " +"its full name. Its file information is extracted as accurately as possible. " +"*member* may be a filename or a :class:`TarInfo` object. You can specify a " +"different directory using *path*. *path* may be a :term:`path-like object`. " +"File attributes (owner, mtime, mode) are set unless *set_attrs* is false." +msgstr "" +"یک عضو را از بایگانی با استفاده از نام کامل آن به پوشه کاری فعلی استخراج " +"کنید. اطلاعات فایل آن تا حد امکان به‌دقت استخراج می‌شود. *member* می‌تواند " +"یک نام فایل یا یک شیء :class:`TarInfo` باشد. می‌توانید با استفاده از *path* " +"یک پوشه متفاوت را مشخص کنید. *path* می‌تواند یک :term:`path-like object` " +"باشد. ویژگی‌های فایل (مالک، mtime، حالت) تنظیم می‌شوند، مگر اینکه " +"*set_attrs* نادرست باشد." -msgid "The *numeric_owner* and *filter* arguments are the same as for :meth:`extractall`." +msgid "" +"The *numeric_owner* and *filter* arguments are the same as for " +":meth:`extractall`." msgstr "" +"آرگومان‌های *numeric_owner* و *filter* همانند آرگومان‌های :meth:`extractall`" +" هستند." -msgid "The :meth:`extract` method does not take care of several extraction issues. In most cases you should consider using the :meth:`extractall` method." +msgid "" +"The :meth:`extract` method does not take care of several extraction issues. " +"In most cases you should consider using the :meth:`extractall` method." msgstr "" +"متد :meth:`extract` به چندین مسئله‌ی استخراج رسیدگی نمی‌کند. در بیشتر موارد " +"باید استفاده از متد :meth:`extractall` را در نظر بگیرید." -msgid "Never extract archives from untrusted sources without prior inspection. See the warning for :meth:`extractall` for details." +msgid "" +"Never extract archives from untrusted sources without prior inspection. See " +"the warning for :meth:`extractall` for details." msgstr "" +"هرگز بایگانی‌ها را از منابع نامعتبر بدون بازرسی پیشین استخراج نکنید. برای " +"جزئیات، هشدار مربوط به :meth:`extractall` را ببینید." msgid "Added the *set_attrs* parameter." -msgstr "" +msgstr "پارامتر *set_attrs* اضافه شد." -msgid "Extract a member from the archive as a file object. *member* may be a filename or a :class:`TarInfo` object. If *member* is a regular file or a link, an :class:`io.BufferedReader` object is returned. For all other existing members, :const:`None` is returned. If *member* does not appear in the archive, :exc:`KeyError` is raised." -msgstr "" +msgid "" +"Extract a member from the archive as a file object. *member* may be a " +"filename or a :class:`TarInfo` object. If *member* is a regular file or a " +"link, an :class:`io.BufferedReader` object is returned. For all other " +"existing members, :const:`None` is returned. If *member* does not appear in " +"the archive, :exc:`KeyError` is raised." +msgstr "" +"یک عضو را از آرشیو به‌عنوان یک شیء فایل استخراج می‌کند. *member* ممکن است یک" +" نام فایل یا یک شیء :class:`TarInfo` باشد. اگر *member* یک فایل معمولی یا یک" +" پیوند باشد، یک شیء :class:`io.BufferedReader` بازگردانده می‌شود. برای تمام " +"اعضای موجود دیگر، :const:`None` بازگردانده می‌شود. اگر *member* در آرشیو " +"یافت نشود، :exc:`KeyError` پرتاب می‌شود." msgid "Return an :class:`io.BufferedReader` object." -msgstr "" +msgstr "یک شیء :class:`io.BufferedReader` برمی‌گرداند." -msgid "The returned :class:`io.BufferedReader` object has the :attr:`!mode` attribute which is always equal to ``'rb'``." +msgid "" +"The returned :class:`io.BufferedReader` object has the :attr:`!mode` " +"attribute which is always equal to ``'rb'``." msgstr "" +"شیء برگردانده‌شده‌ی :class:`io.BufferedReader` دارای ویژگی :attr:`!mode` است" +" که همیشه برابر با ``'rb'`` است." -msgid "If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile.extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error messages in the debug output when *debug* is greater than 0. If ``1`` (the default), all *fatal* errors are raised as :exc:`OSError` or :exc:`FilterError` exceptions. If ``2``, all *non-fatal* errors are raised as :exc:`TarError` exceptions as well." -msgstr "" +msgid "" +"If *errorlevel* is ``0``, errors are ignored when using " +":meth:`TarFile.extract` and :meth:`TarFile.extractall`. Nevertheless, they " +"appear as error messages in the debug output when *debug* is greater than 0." +" If ``1`` (the default), all *fatal* errors are raised as :exc:`OSError` or " +":exc:`FilterError` exceptions. If ``2``, all *non-fatal* errors are raised " +"as :exc:`TarError` exceptions as well." +msgstr "" +"اگر *errorlevel* برابر ``0`` باشد، هنگام استفاده از :meth:`TarFile.extract` " +"و :meth:`TarFile.extractall`، خطاها نادیده گرفته می‌شوند. با این حال، " +"هنگامی که *debug* بزرگ‌تر از ۰ باشد، آن‌ها به‌صورت پیام‌های خطا در خروجی " +"اشکال‌زدایی ظاهر می‌شوند. اگر ``1`` (پیش‌فرض) باشد، تمام خطاهای *مهلک* " +"به‌عنوان استثناهای :exc:`OSError` یا :exc:`FilterError` پرتاب می‌شوند. اگر " +"``2`` باشد، تمام خطاهای *غیرمهلک* نیز به‌عنوان استثناهای :exc:`TarError` " +"پرتاب می‌شوند." -msgid "Some exceptions, e.g. ones caused by wrong argument types or data corruption, are always raised." +msgid "" +"Some exceptions, e.g. ones caused by wrong argument types or data " +"corruption, are always raised." msgstr "" +"برخی استثناها، مثلاً آن‌هایی که به‌دلیل نوع اشتباه آرگومان‌ها یا خرابی داده" +" ایجاد می‌شوند، همیشه پرتاب می‌شوند." -msgid "Custom :ref:`extraction filters ` should raise :exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* ones." +msgid "" +"Custom :ref:`extraction filters ` should raise " +":exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-" +"fatal* ones." msgstr "" +":ref:`فیلترهای استخراج ` سفارشی باید برای خطاهای " +"*مهک*، :exc:`FilterError` و برای خطاهای *غیرمهک*، :exc:`ExtractError` را " +"پرتاب کنند." -msgid "Note that when an exception is raised, the archive may be partially extracted. It is the user’s responsibility to clean up." +msgid "" +"Note that when an exception is raised, the archive may be partially " +"extracted. It is the user’s responsibility to clean up." msgstr "" +"توجه داشته باشید که هنگامی که یک استثنا پرتاب می‌شود، ممکن است بایگانی " +"به‌طور ناقص استخراج شود. پاک‌سازی آن بر عهده‌ی کاربر است." -msgid "The :ref:`extraction filter ` used as a default for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile.extractall`." +msgid "" +"The :ref:`extraction filter ` used as a default " +"for the *filter* argument of :meth:`~TarFile.extract` and " +":meth:`~TarFile.extractall`." msgstr "" +":ref:`فیلتر استخراج ` که به‌عنوان پیش‌فرض برای " +"آرگومان *filter* در :meth:`~TarFile.extract` و :meth:`~TarFile.extractall` " +"استفاده می‌شود." -msgid "The attribute may be ``None`` or a callable. String names are not allowed for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." +msgid "" +"The attribute may be ``None`` or a callable. String names are not allowed " +"for this attribute, unlike the *filter* argument to " +":meth:`~TarFile.extract`." msgstr "" +"این ویژگی ممکن است ``None`` یا یک شیء فراخوان‌پذیر (callable) باشد. نام‌های " +"رشته‌ای برای این ویژگی مجاز نیستند، برخلاف آرگومان *filter* در " +":meth:`~TarFile.extract`." -msgid "If ``extraction_filter`` is ``None`` (the default), extraction methods will use the :func:`data ` filter by default." +msgid "" +"If ``extraction_filter`` is ``None`` (the default), extraction methods will " +"use the :func:`data ` filter by default." msgstr "" +"اگر ``extraction_filter`` برابر ``None`` باشد (حالت پیش‌فرض)، متدهای استخراج" +" به‌طور پیش‌فرض از فیلتر :func:`data ` استفاده خواهند کرد." -msgid "The attribute may be set on instances or overridden in subclasses. It also is possible to set it on the ``TarFile`` class itself to set a global default, although, since it affects all uses of *tarfile*, it is best practice to only do so in top-level applications or :mod:`site configuration `. To set a global default this way, a filter function needs to be wrapped in :deco:`staticmethod` to prevent injection of a ``self`` argument." -msgstr "" +msgid "" +"The attribute may be set on instances or overridden in subclasses. It also " +"is possible to set it on the ``TarFile`` class itself to set a global " +"default, although, since it affects all uses of *tarfile*, it is best " +"practice to only do so in top-level applications or :mod:`site configuration" +" `. To set a global default this way, a filter function needs to be " +"wrapped in :deco:`staticmethod` to prevent injection of a ``self`` argument." +msgstr "" +"این ویژگی را می‌توان روی نمونه‌ها تنظیم کرد یا در زیرکلاس‌ها بازنویسی کرد. " +"همچنین می‌توان آن را روی خود کلاس ``TarFile`` تنظیم کرد تا یک پیش‌فرض سراسری" +" تعیین شود، اگرچه، از آنجا که این کار بر تمام استفاده‌ها از *tarfile* تأثیر " +"می‌گذارد، بهترین روش این است که این کار فقط در برنامه‌های سطح‌بالا یا " +":mod:`پیکربندی سایت ` انجام شود. برای تنظیم یک پیش‌فرض سراسری به این " +"روش، یک تابع فیلتر باید با :deco:`staticmethod` پوشانده شود تا از تزریق " +"آرگومان ``self`` جلوگیری شود." -msgid "The default filter is set to :func:`data `, which disallows some dangerous features such as links to absolute paths or paths outside of the destination. Previously, the default was equivalent to :func:`fully_trusted `." +msgid "" +"The default filter is set to :func:`data `, which disallows " +"some dangerous features such as links to absolute paths or paths outside of " +"the destination. Previously, the default was equivalent to " +":func:`fully_trusted `." msgstr "" +"فیلتر پیش‌فرض روی :func:`data ` تنظیم شده است، که برخی " +"قابلیت‌های خطرناک مانند پیوند به مسیرهای مطلق یا مسیرهای خارج از مقصد را " +"غیرمجاز می‌کند. پیش‌تر، مقدار پیش‌فرض معادل :func:`fully_trusted " +"` بود." -msgid "Add the file *name* to the archive. *name* may be any type of file (directory, fifo, symbolic link, etc.). If given, *arcname* specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting *recursive* to :const:`False`. Recursion adds entries in sorted order. If *filter* is given, it should be a function that takes a :class:`TarInfo` object argument and returns the changed :class:`TarInfo` object. If it instead returns :const:`None` the :class:`TarInfo` object will be excluded from the archive. See :ref:`tar-examples` for an example." -msgstr "" +msgid "" +"Add the file *name* to the archive. *name* may be any type of file " +"(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " +"alternative name for the file in the archive. Directories are added " +"recursively by default. This can be avoided by setting *recursive* to " +":const:`False`. Recursion adds entries in sorted order. If *filter* is " +"given, it should be a function that takes a :class:`TarInfo` object argument" +" and returns the changed :class:`TarInfo` object. If it instead returns " +":const:`None` the :class:`TarInfo` object will be excluded from the archive." +" See :ref:`tar-examples` for an example." +msgstr "" +"فایل *name* را به بایگانی اضافه کنید. *name* می‌تواند هر نوع فایلی (پوشه، " +"fifo، پیوند نمادین و غیره) باشد. در صورت ارائه، *arcname* یک نام جایگزین " +"برای فایل در بایگانی مشخص می‌کند. به‌طور پیش‌فرض، پوشه‌ها به‌صورت بازگشتی " +"اضافه می‌شوند. می‌توانید با تنظیم *recursive* به :const:`False` از این کار " +"جلوگیری کنید. پیمایش بازگشتی ورودی‌ها را به ترتیب مرتب‌شده اضافه می‌کند. اگر" +" *filter* ارائه شود، باید تابعی باشد که یک آرگومان شیء :class:`TarInfo` " +"می‌گیرد و شیء :class:`TarInfo` تغییرکرده را برمی‌گرداند. اگر در عوض " +":const:`None` برگرداند، شیء :class:`TarInfo` از بایگانی حذف خواهد شد. برای " +"یک مثال، :ref:`tar-examples` را ببینید." msgid "Recursion adds entries in sorted order." -msgstr "" +msgstr "بازگشت، ورودی‌ها را به ترتیب مرتب‌شده اضافه می‌کند." -msgid "Add the :class:`TarInfo` object *tarinfo* to the archive. If *tarinfo* represents a non zero-size regular file, the *fileobj* argument should be a :term:`binary file`, and ``tarinfo.size`` bytes are read from it and added to the archive. You can create :class:`TarInfo` objects directly, or by using :meth:`gettarinfo`." -msgstr "" +msgid "" +"Add the :class:`TarInfo` object *tarinfo* to the archive. If *tarinfo* " +"represents a non zero-size regular file, the *fileobj* argument should be a " +":term:`binary file`, and ``tarinfo.size`` bytes are read from it and added " +"to the archive. You can create :class:`TarInfo` objects directly, or by " +"using :meth:`gettarinfo`." +msgstr "" +"شیء :class:`TarInfo` با نام *tarinfo* را به بایگانی اضافه کنید. اگر " +"*tarinfo* نشان‌دهنده یک فایل معمولی با اندازه غیرصفر باشد، آرگومان *fileobj*" +" باید یک :term:`binary file` باشد و ``tarinfo.size`` بایت از آن خوانده " +"می‌شود و به بایگانی افزوده می‌شود. می‌توانید اشیای :class:`TarInfo` را " +"مستقیماً یا با استفاده از :meth:`gettarinfo` ایجاد کنید." msgid "*fileobj* must be given for non-zero-sized regular files." -msgstr "" +msgstr "برای فایل‌های عادی با اندازه غیرصفر، باید *fileobj* داده شود." -msgid "Create a :class:`TarInfo` object from the result of :func:`os.stat` or equivalent on an existing file. The file is either named by *name*, or specified as a :term:`file object` *fileobj* with a file descriptor. *name* may be a :term:`path-like object`. If given, *arcname* specifies an alternative name for the file in the archive, otherwise, the name is taken from *fileobj*’s :attr:`~io.FileIO.name` attribute, or the *name* argument. The name should be a text string." -msgstr "" +msgid "" +"Create a :class:`TarInfo` object from the result of :func:`os.stat` or " +"equivalent on an existing file. The file is either named by *name*, or " +"specified as a :term:`file object` *fileobj* with a file descriptor. *name* " +"may be a :term:`path-like object`. If given, *arcname* specifies an " +"alternative name for the file in the archive, otherwise, the name is taken " +"from *fileobj*’s :attr:`~io.FileIO.name` attribute, or the *name* argument." +" The name should be a text string." +msgstr "" +"یک شیء :class:`TarInfo` از نتیجه‌ی :func:`os.stat` یا معادل آن روی یک فایل " +"موجود ایجاد کنید. فایل یا با *name* نام‌گذاری می‌شود، یا به‌عنوان یک " +":term:`file object` یعنی *fileobj* با توصیف‌گر فایل مشخص می‌شود. *name* ممکن " +"است یک :term:`path-like object` باشد. در صورت ارائه، *arcname* نامی جایگزین " +"برای فایل در بایگانی را مشخص می‌کند؛ در غیر این صورت، نام از ویژگی " +":attr:`~io.FileIO.name` متعلق به *fileobj* یا از آرگومان *name* گرفته " +"می‌شود. نام باید یک رشته متنی باشد." -msgid "You can modify some of the :class:`TarInfo`’s attributes before you add it using :meth:`addfile`. If the file object is not an ordinary file object positioned at the beginning of the file, attributes such as :attr:`~TarInfo.size` may need modifying. This is the case for objects such as :class:`~gzip.GzipFile`. The :attr:`~TarInfo.name` may also be modified, in which case *arcname* could be a dummy string." -msgstr "" +msgid "" +"You can modify some of the :class:`TarInfo`’s attributes before you add it " +"using :meth:`addfile`. If the file object is not an ordinary file object " +"positioned at the beginning of the file, attributes such as " +":attr:`~TarInfo.size` may need modifying. This is the case for objects such" +" as :class:`~gzip.GzipFile`. The :attr:`~TarInfo.name` may also be modified," +" in which case *arcname* could be a dummy string." +msgstr "" +"می‌توانید برخی از ویژگی‌های :class:`TarInfo` را پیش از افزودن آن با استفاده " +"از :meth:`addfile` تغییر دهید. اگر شیء فایل، یک شیء فایل معمولی نباشد که در " +"ابتدای فایل قرار گرفته باشد، ممکن است ویژگی‌هایی مانند :attr:`~TarInfo.size`" +" نیاز به تغییر داشته باشند. این حالت برای اشیایی مانند " +":class:`~gzip.GzipFile` صدق می‌کند. همچنین ممکن است :attr:`~TarInfo.name` " +"تغییر کند، که در این صورت *arcname* می‌تواند یک رشته‌ی ساختگی باشد." -msgid "Close the :class:`TarFile`. In write mode, two finishing zero blocks are appended to the archive." +msgid "" +"Close the :class:`TarFile`. In write mode, two finishing zero blocks are " +"appended to the archive." msgstr "" +":class:`TarFile` را ببندید. در حالت نوشتن، دو بلوک صفر پایانی به بایگانی " +"افزوده می‌شوند." msgid "A dictionary containing key-value pairs of pax global headers." -msgstr "" +msgstr "یک دیکشنری حاوی جفت‌های کلید-مقدار از سرآیندهای سراسری pax." msgid "TarInfo Objects" -msgstr "" +msgstr "اشیاء TarInfo" -msgid "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside from storing all required attributes of a file (like file type, size, time, permissions, owner etc.), it provides some useful methods to determine its type. It does *not* contain the file's data itself." +msgid "" +"A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside" +" from storing all required attributes of a file (like file type, size, time," +" permissions, owner etc.), it provides some useful methods to determine its " +"type. It does *not* contain the file's data itself." msgstr "" +"یک شیء :class:`TarInfo` نمایانگر یک عضو در :class:`TarFile` است. جدای از " +"ذخیره کردن همه‌ی ویژگی‌های مورد نیاز یک پرونده (مانند نوع پرونده، اندازه، " +"زمان، دسترسی‌ها، مالک و غیره)، این شیء چند متد مفید برای تعیین نوع آن ارائه " +"می‌دهد. این شیء داده‌های خود پرونده را در بر *نمی‌گیرد*." -msgid ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile.gettarinfo`." +msgid "" +":class:`TarInfo` objects are returned by :class:`TarFile`'s methods " +":meth:`~TarFile.getmember`, :meth:`~TarFile.getmembers` and " +":meth:`~TarFile.gettarinfo`." msgstr "" +"اشیای :class:`TarInfo` توسط متدهای :meth:`~TarFile.getmember`، " +":meth:`~TarFile.getmembers` و :meth:`~TarFile.gettarinfo` از کلاس " +":class:`TarFile` برگردانده می‌شوند." -msgid "Modifying the objects returned by :meth:`~TarFile.getmember` or :meth:`~TarFile.getmembers` will affect all subsequent operations on the archive. For cases where this is unwanted, you can use :mod:`copy.copy() ` or call the :meth:`~TarInfo.replace` method to create a modified copy in one step." -msgstr "" +msgid "" +"Modifying the objects returned by :meth:`~TarFile.getmember` or " +":meth:`~TarFile.getmembers` will affect all subsequent operations on the " +"archive. For cases where this is unwanted, you can use :mod:`copy.copy() " +"` or call the :meth:`~TarInfo.replace` method to create a modified " +"copy in one step." +msgstr "" +"تغییر اشیای برگردانده‌شده توسط :meth:`~TarFile.getmember` یا " +":meth:`~TarFile.getmembers` بر تمام عملیات‌های بعدی روی بایگانی تأثیر خواهد " +"گذاشت. در مواردی که این رفتار نامطلوب است، می‌توانید از :mod:`copy.copy() " +"` استفاده کنید یا متد :meth:`~TarInfo.replace` را فراخوانی کنید تا یک " +"رونوشت تغییریافته را در یک مرحله ایجاد کنید." -msgid "Several attributes can be set to ``None`` to indicate that a piece of metadata is unused or unknown. Different :class:`TarInfo` methods handle ``None`` differently:" +msgid "" +"Several attributes can be set to ``None`` to indicate that a piece of " +"metadata is unused or unknown. Different :class:`TarInfo` methods handle " +"``None`` differently:" msgstr "" +"چندین ویژگی را می‌توان روی ``None`` تنظیم کرد تا نشان داده شود که یک مورد " +"فراداده استفاده‌نشده یا ناشناخته است. متدهای مختلف :class:`TarInfo` با " +"``None`` به‌صورت متفاوتی برخورد می‌کنند:" -msgid "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will ignore the corresponding metadata, leaving it set to a default." +msgid "" +"The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " +"ignore the corresponding metadata, leaving it set to a default." msgstr "" +"متدهای :meth:`~TarFile.extract` یا :meth:`~TarFile.extractall` فراداده‌ی " +"مربوطه را نادیده می‌گیرند و آن را روی یک مقدار پیش‌فرض تنظیم‌شده باقی " +"می‌گذارند." msgid ":meth:`~TarFile.addfile` will fail." -msgstr "" +msgstr ":meth:`~TarFile.addfile` شکست خواهد خورد." msgid ":meth:`~TarFile.list` will print a placeholder string." msgstr "" +":meth:`~TarFile.list` یک رشته‌ی جای‌نگهدار (placeholder) را چاپ خواهد کرد." msgid "Create a :class:`TarInfo` object." -msgstr "" +msgstr "یک شیء :class:`TarInfo` ایجاد کنید." msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" +"یک شیء :class:`TarInfo` را از بافر رشته‌ای *buf* ایجاد می‌کند و برمی‌گرداند." msgid "Raises :exc:`HeaderError` if the buffer is invalid." -msgstr "" +msgstr "اگر بافر نامعتبر باشد، :exc:`HeaderError` پرتاب می‌شود." -msgid "Read the next member from the :class:`TarFile` object *tarfile* and return it as a :class:`TarInfo` object." +msgid "" +"Read the next member from the :class:`TarFile` object *tarfile* and return " +"it as a :class:`TarInfo` object." msgstr "" +"عضو بعدی را از شیء :class:`TarFile` به نام *tarfile* می‌خواند و آن را " +"به‌عنوان یک شیء :class:`TarInfo` برمی‌گرداند." -msgid "Create a string buffer from a :class:`TarInfo` object. For information on the arguments see the constructor of the :class:`TarFile` class." +msgid "" +"Create a string buffer from a :class:`TarInfo` object. For information on " +"the arguments see the constructor of the :class:`TarFile` class." msgstr "" +"یک بافر رشته‌ای از یک شیء :class:`TarInfo` ایجاد کنید. برای اطلاعات درباره " +"آرگومان‌ها، سازنده کلاس :class:`TarFile` را ببینید." msgid "A ``TarInfo`` object has the following public data attributes:" -msgstr "" +msgstr "یک شیء ``TarInfo`` دارای ویژگی‌های داده‌ای عمومی زیر است:" msgid "Name of the archive member." -msgstr "" +msgstr "نام عضو آرشیو." msgid "Size in bytes." -msgstr "" +msgstr "اندازه بر حسب بایت." -msgid "Time of last modification in seconds since the :ref:`epoch `, as in :attr:`os.stat_result.st_mtime`." +msgid "" +"Time of last modification in seconds since the :ref:`epoch `, as in " +":attr:`os.stat_result.st_mtime`." msgstr "" +"زمان آخرین تغییر بر حسب ثانیه از :ref:`epoch `، همان‌طور که در " +":attr:`os.stat_result.st_mtime` آمده است." -msgid "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile.extractall`, causing extraction to skip applying this attribute." +msgid "" +"Can be set to ``None`` for :meth:`~TarFile.extract` and " +":meth:`~TarFile.extractall`, causing extraction to skip applying this " +"attribute." msgstr "" +"می‌توان آن را برای :meth:`~TarFile.extract` و :meth:`~TarFile.extractall` " +"روی ``None`` تنظیم کرد، که باعث می‌شود استخراج از اعمال این ویژگی صرف‌نظر " +"کند." msgid "Permission bits, as for :func:`os.chmod`." -msgstr "" +msgstr "بیت‌های دسترسی، مانند :func:`os.chmod`." -msgid "File type. *type* is usually one of these constants: :const:`REGTYPE`, :const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`, :const:`GNUTYPE_SPARSE`. To determine the type of a :class:`TarInfo` object more conveniently, use the ``is*()`` methods below." -msgstr "" +msgid "" +"File type. *type* is usually one of these constants: :const:`REGTYPE`, " +":const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, " +":const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`, " +":const:`GNUTYPE_SPARSE`. To determine the type of a :class:`TarInfo` object" +" more conveniently, use the ``is*()`` methods below." +msgstr "" +"نوع پرونده. *type* معمولاً یکی از این ثابت‌ها است: :const:`REGTYPE`، " +":const:`AREGTYPE`، :const:`LNKTYPE`، :const:`SYMTYPE`، :const:`DIRTYPE`، " +":const:`FIFOTYPE`، :const:`CONTTYPE`، :const:`CHRTYPE`، :const:`BLKTYPE`، " +":const:`GNUTYPE_SPARSE`. برای تعیین راحت‌تر نوع یک شیء :class:`TarInfo`، از " +"متدهای ``is*()`` زیر استفاده کنید." -msgid "Name of the target file name, which is only present in :class:`TarInfo` objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." +msgid "" +"Name of the target file name, which is only present in :class:`TarInfo` " +"objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" +"نام فایل هدف، که فقط در اشیای :class:`TarInfo` از نوع :const:`LNKTYPE` و " +":const:`SYMTYPE` موجود است." -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." +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 "" +"برای پیوندهای نمادین (``SYMTYPE``)، *linkname* نسبت به پوشه‌ی حاوی پیوند " +"است. برای پیوندهای سخت (``LNKTYPE``)، *linkname* نسبت به ریشه‌ی بایگانی " +"است." msgid "User ID of the user who originally stored this member." -msgstr "" +msgstr "شناسه‌ی کاربری که در ابتدا این عضو را ذخیره کرده است." msgid "Group ID of the user who originally stored this member." -msgstr "" +msgstr "شناسه‌ی گروه کاربری که این عضو را در ابتدا ذخیره کرده است." msgid "User name." -msgstr "" +msgstr "نام کاربری." msgid "Group name." -msgstr "" +msgstr "نام گروه." msgid "Header checksum." -msgstr "" +msgstr "جمع‌آزما سرآیند." msgid "Device major number." -msgstr "" +msgstr "شماره اصلی دستگاه." msgid "Device minor number." -msgstr "" +msgstr "شماره فرعی دستگاه." msgid "The tar header starts here." -msgstr "" +msgstr "سرآیند tar از اینجا شروع می‌شود." msgid "The file's data starts here." -msgstr "" +msgstr "داده‌ی فایل از اینجا شروع می‌شود." msgid "Sparse member information." -msgstr "" +msgstr "اطلاعات عضو تنک." -msgid "A dictionary containing key-value pairs of an associated pax extended header." +msgid "" +"A dictionary containing key-value pairs of an associated pax extended " +"header." msgstr "" +"یک دیکشنری حاوی جفت‌های کلید-مقدار از یک سرآیند توسعه‌یافته‌ی pax مرتبط." -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::" +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 "" +"یک نسخه‌ی *جدید* از شیء :class:`!TarInfo` را با تغییر ویژگی‌های داده‌شده " +"برمی‌گرداند. برای مثال، برای برگرداندن یک ``TarInfo`` با نام گروه تنظیم‌شده " +"روی ``'staff'``، به‌صورت زیر عمل کنید::" msgid "new_tarinfo = old_tarinfo.replace(gname='staff')" -msgstr "" +msgstr "new_tarinfo = old_tarinfo.replace(gname='staff')" -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." +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 "" +"به‌طور پیش‌فرض، یک کپی عمیق ایجاد می‌شود. اگر *deep* نادرست باشد، کپی کم‌عمق" +" است، یعنی ``pax_headers`` و هرگونه ویژگی سفارشی با شیء اصلی ``TarInfo`` به " +"اشتراک گذاشته می‌شوند." msgid "A :class:`TarInfo` object also provides some convenient query methods:" -msgstr "" +msgstr "یک شیء :class:`TarInfo` همچنین چند متد پرس‌وجوی مفید ارائه می‌دهد:" msgid "Return :const:`True` if the :class:`TarInfo` object is a regular file." msgstr "" +"اگر شیء :class:`TarInfo` یک فایل معمولی باشد، :const:`True` را برمی‌گرداند." msgid "Same as :meth:`isfile`." -msgstr "" +msgstr "مشابه :meth:`isfile`." msgid "Return :const:`True` if it is a directory." -msgstr "" +msgstr "اگر پوشه باشد، :const:`True` را برمی‌گرداند." msgid "Return :const:`True` if it is a symbolic link." -msgstr "" +msgstr "اگر پیوند نمادین باشد، :const:`True` را برمی‌گرداند." msgid "Return :const:`True` if it is a hard link." -msgstr "" +msgstr "اگر پیوند سخت باشد، :const:`True` را برمی‌گرداند." msgid "Return :const:`True` if it is a character device." -msgstr "" +msgstr "اگر یک دستگاه نویسه‌ای باشد، :const:`True` را برمی‌گرداند." msgid "Return :const:`True` if it is a block device." msgstr "" +"اگر یک دستگاه بلوکی (block device) باشد، :const:`True` را برمی‌گرداند." msgid "Return :const:`True` if it is a FIFO." -msgstr "" +msgstr "اگر یک FIFO باشد، :const:`True` را برمی‌گرداند." -msgid "Return :const:`True` if it is one of character device, block device or FIFO." +msgid "" +"Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" +"اگر یک دستگاه نویسه‌ای، دستگاه بلوکی یا FIFO باشد، :const:`True` را " +"برمی‌گرداند." msgid "Extraction filters" -msgstr "" +msgstr "فیلترهای استخراج" -msgid "The *tar* format is designed to capture all details of a UNIX-like filesystem, which makes it very powerful. Unfortunately, the features make it easy to create tar files that have unintended -- and possibly malicious -- effects when extracted. For example, extracting a tar file can overwrite arbitrary files in various ways (e.g. by using absolute paths, ``..`` path components, or symlinks that affect later members)." -msgstr "" +msgid "" +"The *tar* format is designed to capture all details of a UNIX-like " +"filesystem, which makes it very powerful. Unfortunately, the features make " +"it easy to create tar files that have unintended -- and possibly malicious " +"-- effects when extracted. For example, extracting a tar file can overwrite " +"arbitrary files in various ways (e.g. by using absolute paths, ``..`` path " +"components, or symlinks that affect later members)." +msgstr "" +"قالب *tar* برای ثبت تمام جزئیات یک فایل‌سیستم شبه‌یونیکس طراحی شده است، که " +"آن را بسیار قدرتمند می‌سازد. متأسفانه، این ویژگی‌ها ایجاد فایل‌های tar با " +"اثراتی ناخواسته — و احتمالاً مخرب — هنگام استخراج را آسان می‌کنند. برای " +"مثال، استخراج یک فایل tar می‌تواند فایل‌های دلخواه را به روش‌های گوناگونی " +"بازنویسی کند (مثلاً با استفاده از مسیرهای مطلق، اجزای مسیر ``..``، یا " +"پیوندهای نمادینی که بر اعضای بعدی اثر می‌گذارند)." -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." +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 "" +"در بیشتر موارد، به تمام قابلیت‌ها نیازی نیست. بنابراین، *tarfile* از " +"فیلترهای استخراج پشتیبانی می‌کند: سازوکاری برای محدود کردن قابلیت‌ها، و در " +"نتیجه کاهش برخی از مشکلات امنیتی." -msgid "None of the available filters blocks *all* dangerous archive features. Never extract archives from untrusted sources without prior inspection. See also :ref:`tarfile-further-verification`." +msgid "" +"None of the available filters blocks *all* dangerous archive features. Never" +" extract archives from untrusted sources without prior inspection. See also " +":ref:`tarfile-further-verification`." msgstr "" +"هیچ‌یک از فیلترهای موجود، *همه‌ی* قابلیت‌های خطرناک آرشیو را مسدود نمی‌کند. " +"هرگز آرشیوها را از منابع نامطمئن بدون بازرسی پیشین استخراج نکنید. همچنین " +":ref:`tarfile-further-verification` را ببینید." msgid ":pep:`706`" -msgstr "" +msgstr ":pep:`706`" msgid "Contains further motivation and rationale behind the design." -msgstr "" +msgstr "شامل انگیزه و دلایل بیشتر پشت طراحی است." -msgid "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile.extractall` can be:" +msgid "" +"The *filter* argument to :meth:`TarFile.extract` or " +":meth:`~TarFile.extractall` can be:" msgstr "" +"آرگومان *filter* برای :meth:`TarFile.extract` یا :meth:`~TarFile.extractall`" +" می‌تواند یکی از موارد زیر باشد:" -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." +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 "" +"رشته‌ی ``'fully_trusted'``: تمام فراداده‌ها را همان‌گونه که در بایگانی مشخص " +"شده است، رعایت کنید. باید زمانی استفاده شود که کاربر به‌طور کامل به بایگانی " +"اعتماد داشته باشد، یا راستی‌آزمایی پیچیده‌ی خودش را پیاده‌سازی کند." -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." +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 "" +"رشته‌ی ``'tar'``: بیشتر ویژگی‌های مخصوص *tar* (یعنی ویژگی‌های فایل‌سیستم‌های" +" شبه‌یونیکس) را رعایت می‌کند، اما ویژگی‌هایی را که به احتمال زیاد " +"غافلگیرکننده یا مخرب هستند مسدود می‌کند. برای جزئیات، :func:`tar_filter` را " +"ببینید." -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." +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 "" +"رشته‌ی ``'data'``: بیشتر ویژگی‌های خاص فایل‌سیستم‌های شبه‌یونیکس را نادیده " +"می‌گیرد یا مسدود می‌کند. برای استخراج بایگانی‌های داده‌ی چندسکویی در نظر " +"گرفته شده است. برای جزئیات، :func:`data_filter` را ببینید." msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" +"``None`` (پیش‌فرض): از :attr:`TarFile.extraction_filter` استفاده می‌شود." -msgid "If that is also ``None`` (the default), the ``'data'`` filter will be used." +msgid "" +"If that is also ``None`` (the default), the ``'data'`` filter will be used." msgstr "" +"اگر آن نیز ``None`` (پیش‌فرض) باشد، از فیلتر ``'data'`` استفاده خواهد شد." -msgid "The default filter is set to :func:`data `. Previously, the default was equivalent to :func:`fully_trusted `." +msgid "" +"The default filter is set to :func:`data `. Previously, the " +"default was equivalent to :func:`fully_trusted `." msgstr "" +"فیلتر پیش‌فرض روی :func:`data ` تنظیم شده است. پیش از این، " +"فیلتر پیش‌فرض معادل :func:`fully_trusted ` بود." -msgid "A callable which will be called for each extracted member with a :ref:`TarInfo ` describing the member and the destination path to where the archive is extracted (i.e. the same path is used for all members)::" +msgid "" +"A callable which will be called for each extracted member with a " +":ref:`TarInfo ` describing the member and the destination " +"path to where the archive is extracted (i.e. the same path is used for all " +"members)::" msgstr "" +"یک شیء فراخوانی‌پذیر که برای هر عضو استخراج‌شده فراخوانی خواهد شد، همراه با " +"یک :ref:`TarInfo ` که آن عضو را توصیف می‌کند و مسیر مقصدی " +"که بایگانی در آن استخراج می‌شود (یعنی برای همه اعضا از یک مسیر یکسان استفاده" +" می‌شود)::" msgid "filter(member: TarInfo, path: str, /) -> TarInfo | None" -msgstr "" +msgstr "filter(member: TarInfo, path: str, /) -> TarInfo | None" -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:" +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 "" +"فراخوان‌پذیر (callable) درست پیش از استخراج هر عضو فراخوانی می‌شود، بنابراین" +" می‌تواند وضعیت فعلی دیسک را در نظر بگیرد. این فراخوان‌پذیر می‌تواند:" -msgid "return a :class:`TarInfo` object which will be used instead of the metadata in the archive, or" +msgid "" +"return a :class:`TarInfo` object which will be used instead of the metadata " +"in the archive, or" msgstr "" +"یک شیء :class:`TarInfo` برگرداند که به‌جای فراداده‌ی موجود در بایگانی استفاده" +" خواهد شد، یا" msgid "return ``None``, in which case the member will be skipped, or" -msgstr "" +msgstr "``None`` را برگرداند، که در این صورت عضو نادیده گرفته می‌شود، یا" -msgid "raise an exception to abort the operation or skip the member, depending on :attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:`~TarFile.extractall` may leave the archive partially extracted. It does not attempt to clean up." +msgid "" +"raise an exception to abort the operation or skip the member, depending on " +":attr:`~TarFile.errorlevel`. Note that when extraction is aborted, " +":meth:`~TarFile.extractall` may leave the archive partially extracted. It " +"does not attempt to clean up." msgstr "" +"پرتاب استثنا برای لغو عملیات یا رد کردن عضو، بسته به " +":attr:`~TarFile.errorlevel`. توجه داشته باشید که هنگامی که استخراج لغو شود، " +":meth:`~TarFile.extractall` ممکن است بایگانی را به‌صورت نیمه‌استخراج‌شده " +"باقی بگذارد. تلاشی برای پاک‌سازی نمی‌کند." msgid "Default named filters" -msgstr "" +msgstr "فیلترهای نام‌دار پیش‌فرض" -msgid "The pre-defined, named filters are available as functions, so they can be reused in custom filters:" +msgid "" +"The pre-defined, named filters are available as functions, so they can be " +"reused in custom filters:" msgstr "" +"فیلترهای نام‌دار و از پیش تعریف‌شده به‌صورت توابع در دسترس هستند، بنابراین " +"می‌توان از آن‌ها در فیلترهای سفارشی دوباره استفاده کرد:" msgid "Return *member* unchanged." -msgstr "" +msgstr "*member* را بدون تغییر بازگردانید." msgid "This implements the ``'fully_trusted'`` filter." -msgstr "" +msgstr "این فیلتر ``'fully_trusted'`` را پیاده‌سازی می‌کند." msgid "Implements the ``'tar'`` filter." -msgstr "" +msgstr "فیلتر ``'tar'`` را پیاده‌سازی می‌کند." msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." -msgstr "" +msgstr "اسلش‌های ابتدایی (``/`` و :data:`os.sep`) را از نام فایل‌ها حذف کنید." -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`." +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 "" +":ref:`امتناع ` از استخراج فایل‌هایی با مسیرهای " +"مطلق (در صورتی که نام حتی پس از حذف اسلش‌ها مطلق باشد، مثلاً ``C:/foo`` در " +"ویندوز). این کار باعث پرتاب :class:`~tarfile.AbsolutePathError` می‌شود." -msgid ":ref:`Refuse ` to extract files whose absolute path (after following symlinks) would end up outside the destination. This raises :class:`~tarfile.OutsideDestinationError`." +msgid "" +":ref:`Refuse ` to extract files whose absolute " +"path (after following symlinks) would end up outside the destination. This " +"raises :class:`~tarfile.OutsideDestinationError`." msgstr "" +":ref:`امتناع ` از استخراج فایل‌هایی که مسیر مطلق " +"آن‌ها (پس از دنبال کردن پیوندهای نمادین) در نهایت خارج از مقصد قرار بگیرد. " +"این باعث پرتاب :class:`~tarfile.OutsideDestinationError` می‌شود." -msgid "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." +msgid "" +"Clear high mode bits (setuid, setgid, sticky) and group/other write bits " +"(:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" +"بیت‌های بالای حالت (setuid، setgid، sticky) و بیت‌های نوشتن گروه/دیگران " +"(:const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`) را پاک کنید." msgid "Return the modified ``TarInfo`` member." -msgstr "" +msgstr "عضو ``TarInfo`` تغییریافته را برمی‌گرداند." -msgid "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" +msgid "" +"Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" +"فیلتر ``'data'`` را پیاده‌سازی می‌کند. علاوه بر آنچه ``tar_filter`` انجام " +"می‌دهد:" -msgid "Normalize link targets (:attr:`TarInfo.linkname`) using :func:`os.path.normpath`. Note that this removes internal ``..`` components, which may change the meaning of the link if the path in :attr:`!TarInfo.linkname` traverses symbolic links." +msgid "" +"Normalize link targets (:attr:`TarInfo.linkname`) using " +":func:`os.path.normpath`. Note that this removes internal ``..`` components," +" which may change the meaning of the link if the path in " +":attr:`!TarInfo.linkname` traverses symbolic links." msgstr "" +"اهداف پیوند (:attr:`TarInfo.linkname`) را با استفاده از " +":func:`os.path.normpath` عادی‌سازی کنید. توجه داشته باشید که این کار " +"کامپوننت‌های ``..`` داخلی را حذف می‌کند، که ممکن است در صورتی معنای پیوند را " +"تغییر دهد که مسیر موجود در :attr:`!TarInfo.linkname` از پیوندهای نمادین " +"عبور کند." -msgid ":ref:`Refuse ` to extract links (hard or soft) that link to absolute paths, or ones that link outside the destination." +msgid "" +":ref:`Refuse ` to extract links (hard or soft) " +"that link to absolute paths, or ones that link outside the destination." msgstr "" +":ref:`امتناع ` از استخراج پیوندهایی (سخت یا نرم) " +"که به مسیرهای مطلق اشاره می‌کنند، یا پیوندهایی که به خارج از مقصد اشاره " +"می‌کنند." -msgid "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile.LinkOutsideDestinationError`." +msgid "" +"This raises :class:`~tarfile.AbsoluteLinkError` or " +":class:`~tarfile.LinkOutsideDestinationError`." msgstr "" +"این :class:`~tarfile.AbsoluteLinkError` یا " +":class:`~tarfile.LinkOutsideDestinationError` را پرتاب می‌کند." -msgid "Note that such files are refused even on platforms that do not support symbolic links." +msgid "" +"Note that such files are refused even on platforms that do not support " +"symbolic links." msgstr "" +"توجه داشته باشید که چنین فایل‌هایی حتی در سکوهایی که از پیوندهای نمادین " +"پشتیبانی نمی‌کنند نیز رد می‌شوند." -msgid ":ref:`Refuse ` to extract device files (including pipes). This raises :class:`~tarfile.SpecialFileError`." +msgid "" +":ref:`Refuse ` to extract device files (including" +" pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" +":ref:`خودداری ` از استخراج فایل‌های دستگاهی (از " +"جمله پایپ‌ها). این کار :class:`~tarfile.SpecialFileError` را پرتاب می‌کند." msgid "For regular files, including hard links:" -msgstr "" +msgstr "برای فایل‌های معمولی، از جمله پیوندهای سخت:" -msgid "Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:`~stat.S_IWUSR`)." +msgid "" +"Set the owner read and write permissions (:const:`~stat.S_IRUSR` | " +":const:`~stat.S_IWUSR`)." msgstr "" +"دسترسی‌های خواندن و نوشتن مالک را تنظیم کنید (:const:`~stat.S_IRUSR` | " +":const:`~stat.S_IWUSR`)." -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`)." +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 "" +"اگر مالک اجازه‌ی اجرا را نداشته باشد (:const:`~stat.S_IXUSR " +"<~stat.S_IXGRP>`)، اجازه‌ی اجرای گروه و دیگران (:const:`~stat.S_IXGRP " +"<~stat.S_IXOTH>` | :const:`~stat.S_IXOTH <~stat.S_IXUSR>`) را حذف کنید." -msgid "For other files (directories), set ``mode`` to ``None``, so that extraction methods skip applying permission bits." +msgid "" +"For other files (directories), set ``mode`` to ``None``, so that extraction " +"methods skip applying permission bits." msgstr "" +"برای سایر فایل‌ها (پوشه‌ها)، ``mode`` را روی ``None`` تنظیم کنید، تا متدهای " +"استخراج از اعمال بیت‌های دسترسی صرف‌نظر کنند." -msgid "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to ``None``, so that extraction methods skip setting it." +msgid "" +"Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " +"``None``, so that extraction methods skip setting it." msgstr "" +"اطلاعات کاربر و گروه (``uid``، ``gid``، ``uname``، ``gname``) را روی " +"``None`` تنظیم کنید، تا متدهای استخراج از تنظیم آن صرف‌نظر کنند." -msgid "Note that this filter does not block *all* dangerous archive features. See :ref:`tarfile-further-verification` for details." +msgid "" +"Note that this filter does not block *all* dangerous archive features. See " +":ref:`tarfile-further-verification` for details." msgstr "" +"توجه داشته باشید که این فیلتر *همه* قابلیت‌های خطرناک بایگانی را مسدود " +"نمی‌کند. برای جزئیات :ref:`tarfile-further-verification` را ببینید." msgid "Link targets are now normalized." -msgstr "" +msgstr "مقاصد پیوند اکنون نرمال‌سازی شده‌اند." msgid "Filter errors" -msgstr "" +msgstr "خطاهای فیلتر" -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 extraction if :attr:`TarFile.errorlevel` is 1 or more. With ``errorlevel=0`` the error will be logged and the member will be skipped, but extraction will continue." -msgstr "" +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 " +"extraction if :attr:`TarFile.errorlevel` is 1 or more. With ``errorlevel=0``" +" the error will be logged and the member will be skipped, but extraction " +"will continue." +msgstr "" +"هنگامی که یک فیلتر از استخراج یک فایل خودداری می‌کند، یک استثنای مناسب پرتاب" +" می‌کند که زیرکلاسی از :class:`~tarfile.FilterError` است. اگر " +":attr:`TarFile.errorlevel` برابر ۱ یا بیشتر باشد، استخراج متوقف می‌شود. با " +"``errorlevel=0``، خطا ثبت می‌شود و عضو نادیده گرفته می‌شود، اما استخراج " +"ادامه می‌یابد." msgid "Hints for further verification" -msgstr "" +msgstr "نکاتی برای تأیید بیشتر" -msgid "Even with ``filter='data'``, *tarfile* is not suited for extracting untrusted files without prior inspection. Among other issues, the pre-defined filters do not prevent denial-of-service attacks. Users should do additional checks." +msgid "" +"Even with ``filter='data'``, *tarfile* is not suited for extracting " +"untrusted files without prior inspection. Among other issues, the pre-" +"defined filters do not prevent denial-of-service attacks. Users should do " +"additional checks." msgstr "" +"حتی با ``filter='data'``، *tarfile* برای استخراج فایل‌های غیرقابل‌اعتماد " +"بدون بازرسی قبلی مناسب نیست. از جمله مشکلات دیگر، فیلترهای از پیش تعریف‌شده " +"از حملات منع سرویس جلوگیری نمی‌کنند. کاربران باید بررسی‌های بیشتری انجام " +"دهند." msgid "Here is an incomplete list of things to consider:" -msgstr "" +msgstr "در اینجا فهرستی ناقص از مواردی که باید در نظر بگیرید آمده است:" -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." +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 "" +"در یک :func:`پوشه موقت جدید ` استخراج کنید تا برای مثال از" +" سوءاستفاده از پیوندهای از پیش موجود جلوگیری شود و پاک‌سازی پس از یک استخراج" +" شکست‌خورده آسان‌تر شود." msgid "Disallow symbolic links if you do not need the functionality." -msgstr "" +msgstr "اگر به این قابلیت نیاز ندارید، پیوندهای نمادین را غیرمجاز کنید." -msgid "When working with untrusted data, use external (e.g. OS-level) limits on disk, memory and CPU usage." +msgid "" +"When working with untrusted data, use external (e.g. OS-level) limits on " +"disk, memory and CPU usage." msgstr "" +"هنگام کار با داده‌های غیرقابل‌اعتماد، از محدودیت‌های خارجی (مثلاً در سطح " +"سیستم‌عامل) بر مصرف دیسک، حافظه و CPU استفاده کنید." -msgid "Check filenames against an allow-list of characters (to filter out control characters, confusables, foreign path separators, and so on)." +msgid "" +"Check filenames against an allow-list of characters (to filter out control " +"characters, confusables, foreign path separators, and so on)." msgstr "" +"نام‌های فایل را با یک فهرست مجاز (allow-list) از نویسه‌ها بررسی کنید (تا " +"نویسه‌های کنترلی، نویسه‌های مشابه (confusables)، جداکننده‌های مسیر بیگانه و " +"غیره را حذف کنید)." -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)." +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 "" +"بررسی کنید که نام‌فایل‌ها دارای پسوندهای موردانتظار باشند (برای جلوگیری از " +"فایل‌هایی که هنگام «کلیک روی آن‌ها» اجرا می‌شوند، یا فایل‌های بدون پسوند " +"مانند نام‌های ویژه دستگاه در ویندوز)." -msgid "Limit the number of extracted files, total size of extracted data, filename length (including symlink length), and size of individual files." +msgid "" +"Limit the number of extracted files, total size of extracted data, filename " +"length (including symlink length), and size of individual files." msgstr "" +"تعداد فایل‌های استخراج‌شده، اندازه کل داده‌های استخراج‌شده، طول نام فایل " +"(شامل طول پیوند نمادین) و اندازه هر فایل را محدود کنید." -msgid "Check for files that would be shadowed on case-insensitive filesystems." +msgid "" +"Check for files that would be shadowed on case-insensitive filesystems." msgstr "" +"فایل‌هایی را که در فایل‌سیستم‌های غیرحساس به بزرگی و کوچکی حروف پوشانده " +"می‌شوند، بررسی کنید." msgid "Also note that:" -msgstr "" +msgstr "همچنین توجه داشته باشید که:" -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." +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 "" +"فایل‌های Tar ممکن است شامل چندین نسخه از یک فایل یکسان باشند. انتظار می‌رود " +"نسخه‌های بعدی هر یک از نسخه‌های قبلی را بازنویسی کنند. این قابلیت برای " +"امکان‌پذیر کردن به‌روزرسانی بایگانی‌های نواری حیاتی است، اما می‌تواند " +"به‌صورت مخربانه مورد سوءاستفاده قرار گیرد." -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." +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 "" +"*tarfile* در برابر مشکلات مربوط به داده‌های «زنده» محافظت نمی‌کند، برای مثال" +" زمانی که مهاجمی پوشه‌ی مقصد (یا مبدأ) را در حالی که استخراج (یا بایگانی) در" +" حال انجام است دستکاری می‌کند." msgid "Supporting older Python versions" -msgstr "" +msgstr "پشتیبانی از نسخه‌های قدیمی‌تر پایتون" -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 e.g. ``hasattr(tarfile, 'data_filter')`` rather than checking the Python version." +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 e.g. ``hasattr(tarfile, 'data_filter')`` rather than checking the Python" +" version." msgstr "" +"فیلترهای استخراج به پایتون 3.12 اضافه شدند، اما ممکن است به‌عنوان " +"به‌روزرسانی‌های امنیتی به نسخه‌های قدیمی‌تر نیز منتقل شوند. برای بررسی در " +"دسترس بودن این قابلیت، برای مثال به‌جای بررسی نسخه پایتون، از " +"``hasattr(tarfile, 'data_filter')`` استفاده کنید." -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." +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 "" +"مثال‌های زیر نشان می‌دهند که چگونه از نسخه‌های پایتون با و بدون این قابلیت " +"پشتیبانی کنید. توجه داشته باشید که تنظیم ``extraction_filter`` بر هر عملیات " +"بعدی تأثیر خواهد گذاشت." msgid "Fully trusted archive::" -msgstr "" +msgstr "بایگانی کاملاً مورد اعتماد::" msgid "" "my_tarfile.extraction_filter = (lambda member, path: member)\n" "my_tarfile.extractall()" msgstr "" +"my_tarfile.extraction_filter = (lambda member, path: member)\n" +"my_tarfile.extractall()" -msgid "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior (``'fully_trusted'``) if this feature is not available::" +msgid "" +"Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " +"(``'fully_trusted'``) if this feature is not available::" msgstr "" +"در صورت موجود بودن، از فیلتر ``'data'`` استفاده کنید، اما اگر این قابلیت در " +"دسترس نبود، به رفتار Python 3.11 (``'fully_trusted'``) بازگردید::" msgid "" "my_tarfile.extraction_filter = getattr(tarfile, 'data_filter',\n" " (lambda member, path: member))\n" "my_tarfile.extractall()" msgstr "" +"my_tarfile.extraction_filter = getattr(tarfile, 'data_filter',\n" +" (lambda member, path: member))\n" +"my_tarfile.extractall()" msgid "Use the ``'data'`` filter; *fail* if it is not available::" -msgstr "" +msgstr "از فیلتر ``'data'`` استفاده کنید؛ اگر در دسترس نباشد، *شکست* بخورد::" msgid "my_tarfile.extractall(filter=tarfile.data_filter)" -msgstr "" +msgstr "my_tarfile.extractall(filter=tarfile.data_filter)" msgid "or::" -msgstr "" +msgstr "یا::" msgid "" "my_tarfile.extraction_filter = tarfile.data_filter\n" "my_tarfile.extractall()" msgstr "" +"my_tarfile.extraction_filter = tarfile.data_filter\n" +"my_tarfile.extractall()" msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" +"از فیلتر ``'data'`` استفاده کنید؛ در صورت در دسترس نبودن، *هشدار* دهید::" msgid "" "if hasattr(tarfile, 'data_filter'):\n" @@ -958,20 +1844,35 @@ msgid "" " warn_the_user('Extracting may be unsafe; consider updating Python')\n" " my_tarfile.extractall()" msgstr "" +"if hasattr(tarfile, 'data_filter'):\n" +" my_tarfile.extractall(filter='data')\n" +"else:\n" +" # remove this when no longer needed\n" +" warn_the_user('Extracting may be unsafe; consider updating Python')\n" +" my_tarfile.extractall()" msgid "Stateful extraction filter example" -msgstr "" +msgstr "مثال فیلتر استخراج حالت‌دار" -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::" +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 "" +"در حالی که متدهای استخراج *tarfile* یک *filter* قابل‌فراخوانی ساده " +"می‌پذیرند، فیلترهای سفارشی ممکن است اشیاء پیچیده‌تری با وضعیت داخلی باشند. " +"نوشتن این‌ها به‌صورت مدیران زمینه ممکن است مفید باشد، تا به این شکل استفاده " +"شوند::" msgid "" "with StatefulFilter() as filter_func:\n" " tar.extractall(path, filter=filter_func)" msgstr "" +"with StatefulFilter() as filter_func:\n" +" tar.extractall(path, filter=filter_func)" msgid "Such a filter can be written as, for example::" -msgstr "" +msgstr "برای مثال، می‌توان چنین فیلتری را به این صورت نوشت::" msgid "" "class StatefulFilter:\n" @@ -988,72 +1889,113 @@ msgid "" " def __exit__(self, *exc_info):\n" " print(f'{self.file_count} files extracted')" msgstr "" +"class StatefulFilter:\n" +" def __init__(self):\n" +" self.file_count = 0\n" +"\n" +" def __enter__(self):\n" +" return self\n" +"\n" +" def __call__(self, member, path):\n" +" self.file_count += 1\n" +" return member\n" +"\n" +" def __exit__(self, *exc_info):\n" +" print(f'{self.file_count} files extracted')" msgid "Command-Line Interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "The :mod:`!tarfile` module provides a simple command-line interface to interact with tar archives." +msgid "" +"The :mod:`!tarfile` module provides a simple command-line interface to " +"interact with tar archives." msgstr "" +"ماژول :mod:`!tarfile` یک رابط خط فرمان ساده برای تعامل با بایگانی‌های tar " +"فراهم می‌کند." -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:" +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 "" +"اگر می‌خواهید یک بایگانی tar جدید ایجاد کنید، نام آن را پس از گزینه‌ی " +":option:`-c` مشخص کنید و سپس نام فایل(ها) را که باید گنجانده شوند فهرست " +"کنید:" msgid "$ python -m tarfile -c monty.tar spam.txt eggs.txt" -msgstr "" +msgstr "$ python -m tarfile -c monty.tar spam.txt eggs.txt" msgid "Passing a directory is also acceptable:" -msgstr "" +msgstr "ارسال یک پوشه نیز قابل قبول است:" msgid "$ python -m tarfile -c monty.tar life-of-brian_1979/" -msgstr "" +msgstr "$ python -m tarfile -c monty.tar life-of-brian_1979/" -msgid "If you want to extract a tar archive into the current directory, use the :option:`-e` option:" +msgid "" +"If you want to extract a tar archive into the current directory, use the " +":option:`-e` option:" msgstr "" +"اگر می‌خواهید یک آرشیو tar را در پوشه جاری استخراج کنید، از گزینه‌ی " +":option:`-e` استفاده کنید:" msgid "$ python -m tarfile -e monty.tar" -msgstr "" +msgstr "$ python -m tarfile -e monty.tar" -msgid "You can also extract a tar archive into a different directory by passing the directory's name:" +msgid "" +"You can also extract a tar archive into a different directory by passing the" +" directory's name:" msgstr "" +"همچنین می‌توانید با ارسال نام پوشه، یک آرشیو tar را در پوشه‌ای دیگر استخراج " +"کنید:" msgid "$ python -m tarfile -e monty.tar other-dir/" -msgstr "" +msgstr "$ python -m tarfile -e monty.tar other-dir/" msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" +"برای فهرست فایل‌های موجود در یک آرشیو tar، از گزینه :option:`-l` استفاده " +"کنید:" msgid "$ python -m tarfile -l monty.tar" -msgstr "" +msgstr "$ python -m tarfile -l monty.tar" msgid "Command-line options" -msgstr "" +msgstr "گزینه‌های خط فرمان" msgid "List files in a tarfile." -msgstr "" +msgstr "فهرست کردن فایل‌ها در یک فایل tar." msgid "Create tarfile from source files." -msgstr "" +msgstr "ایجاد tarfile از فایل‌های منبع." -msgid "Extract tarfile into the current directory if *output_dir* is not specified." +msgid "" +"Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" +"اگر *output_dir* مشخص نشده باشد، tarfile را در پوشه‌ی فعلی استخراج می‌کند." msgid "Test whether the tarfile is valid or not." -msgstr "" +msgstr "بررسی می‌کند که آیا فایل tar معتبر است یا خیر." msgid "Verbose output." -msgstr "" +msgstr "خروجی پرجزئیات." -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``)." +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 "" +"*فیلتر* برای ``--extract`` را مشخص می‌کند. برای جزئیات، :ref:`tarfile-" +"extraction-filter` را ببینید. فقط نام‌های رشته‌ای پذیرفته می‌شوند (یعنی " +"``fully_trusted``، ``tar`` و ``data``)." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Reading examples" -msgstr "" +msgstr "مثال‌های خواندن" -msgid "How to extract an entire tar archive to the current working directory::" -msgstr "" +msgid "" +"How to extract an entire tar archive to the current working directory::" +msgstr "چگونگی استخراج کامل یک آرشیو tar در پوشه کاری فعلی::" msgid "" "import tarfile\n" @@ -1061,9 +2003,17 @@ msgid "" "tar.extractall(filter='data')\n" "tar.close()" msgstr "" +"import tarfile\n" +"tar = tarfile.open(\"sample.tar.gz\")\n" +"tar.extractall(filter='data')\n" +"tar.close()" -msgid "How to extract a subset of a tar archive with :meth:`TarFile.extractall` using a generator function instead of a list::" +msgid "" +"How to extract a subset of a tar archive with :meth:`TarFile.extractall` " +"using a generator function instead of a list::" msgstr "" +"نحوه استخراج زیرمجموعه‌ای از یک آرشیو tar با :meth:`TarFile.extractall`، با " +"استفاده از یک تابع تولیدگر به‌جای فهرست::" msgid "" "import os\n" @@ -1078,9 +2028,23 @@ msgid "" "tar.extractall(members=py_files(tar))\n" "tar.close()" msgstr "" +"import os\n" +"import tarfile\n" +"\n" +"def py_files(members):\n" +" for tarinfo in members:\n" +" if os.path.splitext(tarinfo.name)[1] == \".py\":\n" +" yield tarinfo\n" +"\n" +"tar = tarfile.open(\"sample.tar.gz\")\n" +"tar.extractall(members=py_files(tar))\n" +"tar.close()" -msgid "How to read a gzip compressed tar archive and display some member information::" +msgid "" +"How to read a gzip compressed tar archive and display some member " +"information::" msgstr "" +"چگونگی خواندن یک آرشیو tar فشرده‌شده با gzip و نمایش برخی اطلاعات اعضا::" msgid "" "import tarfile\n" @@ -1095,12 +2059,23 @@ msgid "" " print(\"something else.\")\n" "tar.close()" msgstr "" +"import tarfile\n" +"tar = tarfile.open(\"sample.tar.gz\", \"r:gz\")\n" +"for tarinfo in tar:\n" +" print(tarinfo.name, \"is\", tarinfo.size, \"bytes in size and is \", end=\"\")\n" +" if tarinfo.isreg():\n" +" print(\"a regular file.\")\n" +" elif tarinfo.isdir():\n" +" print(\"a directory.\")\n" +" else:\n" +" print(\"something else.\")\n" +"tar.close()" msgid "Writing examples" -msgstr "" +msgstr "نوشتن مثال‌ها" msgid "How to create an uncompressed tar archive from a list of filenames::" -msgstr "" +msgstr "چگونگی ایجاد یک آرشیو tar فشرده‌نشده از فهرستی از نام فایل‌ها::" msgid "" "import tarfile\n" @@ -1109,9 +2084,14 @@ msgid "" " tar.add(name)\n" "tar.close()" msgstr "" +"import tarfile\n" +"tar = tarfile.open(\"sample.tar\", \"w\")\n" +"for name in [\"foo\", \"bar\", \"quux\"]:\n" +" tar.add(name)\n" +"tar.close()" msgid "The same example using the :keyword:`with` statement::" -msgstr "" +msgstr "همان مثال با استفاده از دستور :keyword:`with`::" msgid "" "import tarfile\n" @@ -1119,9 +2099,18 @@ msgid "" " for name in [\"foo\", \"bar\", \"quux\"]:\n" " tar.add(name)" msgstr "" +"import tarfile\n" +"with tarfile.open(\"sample.tar\", \"w\") as tar:\n" +" for name in [\"foo\", \"bar\", \"quux\"]:\n" +" tar.add(name)" -msgid "How to create and write an archive to stdout using :data:`sys.stdout.buffer ` in the *fileobj* parameter in :meth:`TarFile.add`::" +msgid "" +"How to create and write an archive to stdout using :data:`sys.stdout.buffer " +"` in the *fileobj* parameter in :meth:`TarFile.add`::" msgstr "" +"چگونگی ایجاد یک بایگانی و نوشتن آن در stdout با استفاده از " +":data:`sys.stdout.buffer ` در پارامتر *fileobj* در " +":meth:`TarFile.add`::" msgid "" "import sys\n" @@ -1130,9 +2119,18 @@ msgid "" " for name in [\"foo\", \"bar\", \"quux\"]:\n" " tar.add(name)" msgstr "" +"import sys\n" +"import tarfile\n" +"with tarfile.open(\"sample.tar.gz\", \"w|gz\", fileobj=sys.stdout.buffer) as tar:\n" +" for name in [\"foo\", \"bar\", \"quux\"]:\n" +" tar.add(name)" -msgid "How to create an archive and reset the user information using the *filter* parameter in :meth:`TarFile.add`::" +msgid "" +"How to create an archive and reset the user information using the *filter* " +"parameter in :meth:`TarFile.add`::" msgstr "" +"چگونگی ایجاد یک بایگانی و بازنشانی اطلاعات کاربر با استفاده از پارامتر " +"*filter* در :meth:`TarFile.add`::" msgid "" "import tarfile\n" @@ -1144,48 +2142,173 @@ msgid "" "tar.add(\"foo\", filter=reset)\n" "tar.close()" msgstr "" +"import tarfile\n" +"def reset(tarinfo):\n" +" tarinfo.uid = tarinfo.gid = 0\n" +" tarinfo.uname = tarinfo.gname = \"root\"\n" +" return tarinfo\n" +"tar = tarfile.open(\"sample.tar.gz\", \"w:gz\")\n" +"tar.add(\"foo\", filter=reset)\n" +"tar.close()" msgid "Supported tar formats" -msgstr "" +msgstr "قالب‌های tar پشتیبانی‌شده" -msgid "There are three tar formats that can be created with the :mod:`!tarfile` module:" +msgid "" +"There are three tar formats that can be created with the :mod:`!tarfile` " +"module:" msgstr "" +"سه قالب tar وجود دارد که می‌توان آن‌ها را با ماژول :mod:`!tarfile` ایجاد " +"کرد:" -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. The maximum file size is 8 GiB. This is an old and limited but widely supported format." +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. The maximum file size is 8 GiB. This is an old and limited but " +"widely supported format." msgstr "" +"قالب ustar در POSIX.1-1988 (:const:`USTAR_FORMAT`). این قالب از نام " +"فایل‌هایی با طول حداکثر ۲۵۶ نویسه و نام پیوندهایی تا ۱۰۰ نویسه پشتیبانی " +"می‌کند. حداکثر اندازه فایل ۸ GiB است. این قالب قدیمی و محدود است، اما به‌طور" +" گسترده پشتیبانی می‌شود." -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 standard on GNU/Linux systems. :mod:`!tarfile` fully supports the GNU tar extensions for long names, sparse file support is read-only." +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 " +"standard on GNU/Linux systems. :mod:`!tarfile` fully supports the GNU tar " +"extensions for long names, sparse file support is read-only." msgstr "" +"قالب GNU tar (:const:`GNU_FORMAT`). این قالب از نام‌فایل‌ها و نام‌پیوندهای " +"طولانی، فایل‌های بزرگ‌تر از ۸ GiB و فایل‌های پراکنده پشتیبانی می‌کند. این " +"قالب استاندارد دوفاکتو در سیستم‌های GNU/Linux است. :mod:`!tarfile` به‌طور " +"کامل از افزونه‌های GNU tar برای نام‌های طولانی پشتیبانی می‌کند؛ پشتیبانی از " +"فایل‌های پراکنده فقط‌خواندنی است." -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, large files and stores pathnames in a portable way. Modern tar implementations, including GNU tar, bsdtar/libarchive and star, fully support extended *pax* features; some old or unmaintained libraries may not, but should treat *pax* archives as if they were in the universally supported *ustar* format. It is the current default format for new archives." -msgstr "" +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, " +"large files and stores pathnames in a portable way. Modern tar " +"implementations, including GNU tar, bsdtar/libarchive and star, fully " +"support extended *pax* features; some old or unmaintained libraries may not," +" but should treat *pax* archives as if they were in the universally " +"supported *ustar* format. It is the current default format for new archives." +msgstr "" +"قالب pax POSIX.1-2001 (:const:`PAX_FORMAT`). این قالب انعطاف‌پذیرترین قالب " +"است و عملاً هیچ محدودیتی ندارد. این قالب از نام‌فایل‌های بلند، نام‌پیوندهای " +"بلند و فایل‌های بزرگ پشتیبانی می‌کند و نام‌مسیرها را به‌شکلی قابل‌حمل ذخیره " +"می‌کند. پیاده‌سازی‌های مدرن tar، از جمله GNU tar، bsdtar/libarchive و star، " +"به‌طور کامل از ویژگی‌های گسترش‌یافته‌ی *pax* پشتیبانی می‌کنند؛ برخی " +"کتابخانه‌های قدیمی یا نگهداری‌نشده ممکن است پشتیبانی نکنند، اما باید با " +"بایگانی‌های *pax* به‌گونه‌ای رفتار کنند که گویی آن‌ها در قالب *ustar* با " +"پشتیبانی جهانی قرار دارند. این قالب، قالب پیش‌فرض کنونی برای بایگانی‌های " +"جدید است." -msgid "It extends the existing *ustar* format with extra headers for information that cannot be stored otherwise. There are two flavours of pax headers: Extended headers only affect the subsequent file header, global headers are valid for the complete archive and affect all following files. All the data in a pax header is encoded in *UTF-8* for portability reasons." -msgstr "" +msgid "" +"It extends the existing *ustar* format with extra headers for information " +"that cannot be stored otherwise. There are two flavours of pax headers: " +"Extended headers only affect the subsequent file header, global headers are " +"valid for the complete archive and affect all following files. All the data " +"in a pax header is encoded in *UTF-8* for portability reasons." +msgstr "" +"این قالب، قالب *ustar* موجود را با سرآیندهای اضافی برای اطلاعاتی که نمی‌توان " +"آن‌ها را به شکل دیگری ذخیره کرد، گسترش می‌دهد. دو گونه از سرآیندهای pax وجود " +"دارد: سرآیندهای توسعه‌یافته فقط بر سرآیند فایل بعدی تأثیر می‌گذارند؛ سرآیندهای سراسری" +" برای کل بایگانی معتبر هستند و بر تمام فایل‌های بعدی تأثیر می‌گذارند. تمام " +"داده‌های یک سرآیند pax به دلایل قابلیت حمل، با *UTF-8* کدگذاری شده‌اند." -msgid "There are some more variants of the tar format which can be read, but not created:" +msgid "" +"There are some more variants of the tar format which can be read, but not " +"created:" msgstr "" +"گونه‌های دیگری نیز از قالب tar وجود دارند که می‌توان آن‌ها را خواند، اما " +"نمی‌توان آن‌ها را ایجاد کرد:" -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 longer than 100 characters, there is no user/group name information. Some archives have miscalculated header checksums in case of fields with non-ASCII characters." -msgstr "" +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 " +"longer than 100 characters, there is no user/group name information. Some " +"archives have miscalculated header checksums in case of fields with non-" +"ASCII characters." +msgstr "" +"قالب قدیمی V7. این اولین قالب tar از ویرایش هفتم یونیکس است و فقط فایل‌های " +"عادی و پوشه‌ها را ذخیره می‌کند. نام‌ها نباید بیش از ۱۰۰ نویسه طول داشته " +"باشند و اطلاعات نام کاربر/گروه وجود ندارد. در برخی از بایگانی‌ها، در صورت " +"وجود فیلدهایی با نویسه‌های غیر ASCII، جمع‌آزارهای سرآیند اشتباه " +"محاسبه‌شده‌اند." -msgid "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 pax format, but is not compatible." +msgid "" +"The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " +"pax format, but is not compatible." msgstr "" +"قالب توسعه‌یافته‌ی tar در SunOS. این قالب گونه‌ای از قالب pax در POSIX.1-2001" +" است، اما با آن سازگار نیست." msgid "Unicode issues" -msgstr "" +msgstr "مسائل یونیکد" -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 are commonly used for file distribution and exchanging archives over networks. One problem of the original format (which is the basis of all other formats) is that there is no concept of supporting different character encodings. For example, an ordinary tar archive created on a *UTF-8* system cannot be read correctly on a *Latin-1* system if it contains non-*ASCII* characters. Textual metadata (like filenames, linknames, user/group names) will appear damaged. Unfortunately, there is no way to autodetect the encoding of an archive. The pax format was designed to solve this problem. It stores non-ASCII metadata using the universal character encoding *UTF-8*." -msgstr "" +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 " +"are commonly used for file distribution and exchanging archives over " +"networks. One problem of the original format (which is the basis of all " +"other formats) is that there is no concept of supporting different character" +" encodings. For example, an ordinary tar archive created on a *UTF-8* system" +" cannot be read correctly on a *Latin-1* system if it contains non-*ASCII* " +"characters. Textual metadata (like filenames, linknames, user/group names) " +"will appear damaged. Unfortunately, there is no way to autodetect the " +"encoding of an archive. The pax format was designed to solve this problem. " +"It stores non-ASCII metadata using the universal character encoding *UTF-8*." +msgstr "" +"قالب tar در ابتدا برای پشتیبان‌گیری روی درایوهای نوار با تمرکز اصلی بر حفظ " +"اطلاعات سیستم فایل در نظر گرفته شد. امروزه بایگانی‌های tar معمولاً برای " +"توزیع فایل و تبادل بایگانی‌ها از طریق شبکه‌ها استفاده می‌شوند. یکی از مشکلات" +" قالب اصلی (که پایه‌ی همه‌ی قالب‌های دیگر است) این است که هیچ مفهومی برای " +"پشتیبانی از کدگذاری‌های مختلف نویسه وجود ندارد. برای مثال، یک بایگانی tar " +"معمولی که روی یک سیستم *UTF-8* ایجاد شده است، اگر شامل نویسه‌های غیر *ASCII*" +" باشد، روی یک سیستم *Latin-1* به‌درستی قابل خواندن نیست. فراداده‌ی متنی " +"(مانند نام فایل‌ها، نام پیوندها، نام‌های کاربر/گروه) آسیب‌دیده به نظر خواهد " +"رسید. متأسفانه، هیچ راهی برای تشخیص خودکار کدگذاری یک بایگانی وجود ندارد. " +"قالب pax برای حل این مشکل طراحی شد. این قالب فراداده‌ی غیر ASCII را با " +"استفاده از کدگذاری نویسه‌ی جهانی *UTF-8* ذخیره می‌کند." -msgid "The details of character conversion in :mod:`!tarfile` are controlled by the *encoding* and *errors* keyword arguments of the :class:`TarFile` class." +msgid "" +"The details of character conversion in :mod:`!tarfile` are controlled by the" +" *encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" +"جزئیات تبدیل نویسه‌ها در :mod:`!tarfile` توسط آرگومان‌های کلیدواژه‌ای " +"*encoding* و *errors* کلاس :class:`TarFile` کنترل می‌شود." -msgid "*encoding* defines the character encoding to use for the metadata in the archive. The default value is :func:`sys.getfilesystemencoding` or ``'ascii'`` as a fallback. Depending on whether the archive is read or written, the metadata must be either decoded or encoded. If *encoding* is not set appropriately, this conversion may fail." -msgstr "" +msgid "" +"*encoding* defines the character encoding to use for the metadata in the " +"archive. The default value is :func:`sys.getfilesystemencoding` or " +"``'ascii'`` as a fallback. Depending on whether the archive is read or " +"written, the metadata must be either decoded or encoded. If *encoding* is " +"not set appropriately, this conversion may fail." +msgstr "" +"*encoding* کدگذاری نویسه‌ای مورد استفاده برای فراداده در بایگانی را تعریف " +"می‌کند. مقدار پیش‌فرض، :func:`sys.getfilesystemencoding` یا ``'ascii'`` " +"به‌عنوان جایگزین است. بسته به این‌که بایگانی خوانده شود یا نوشته شود، " +"فراداده باید کدگشایی یا کدگذاری شود. اگر *encoding* به‌درستی تنظیم نشده " +"باشد، این تبدیل ممکن است شکست بخورد." -msgid "The *errors* argument defines how characters are treated that cannot be converted. Possible values are listed in section :ref:`error-handlers`. The default scheme is ``'surrogateescape'`` which Python also uses for its file system calls, see :ref:`os-filenames`." +msgid "" +"The *errors* argument defines how characters are treated that cannot be " +"converted. Possible values are listed in section :ref:`error-handlers`. The " +"default scheme is ``'surrogateescape'`` which Python also uses for its file " +"system calls, see :ref:`os-filenames`." msgstr "" +"آرگومان *errors* تعیین می‌کند که با نویسه‌هایی که قابل تبدیل نیستند چگونه " +"رفتار شود. مقادیر ممکن در بخش :ref:`error-handlers` فهرست شده‌اند. روش " +"پیش‌فرض ``'surrogateescape'`` است که پایتون از آن برای فراخوانی‌های " +"سیستم‌فایل خود نیز استفاده می‌کند، :ref:`os-filenames` را ببینید." -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 used in the rare cases when binary pax headers are decoded or when strings with surrogate characters are stored." -msgstr "" +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 " +"used in the rare cases when binary pax headers are decoded or when strings " +"with surrogate characters are stored." +msgstr "" +"برای بایگانی‌های :const:`PAX_FORMAT` (پیش‌فرض)، معمولاً نیازی به *encoding* " +"نیست، زیرا تمام فراداده‌ها با استفاده از *UTF-8* ذخیره می‌شوند. *encoding* " +"تنها در موارد نادری استفاده می‌شود که سرصفحه‌های pax دودویی کدگشایی می‌شوند " +"یا رشته‌های دارای نویسه‌های جانشین (surrogate) ذخیره می‌شوند." diff --git a/library/telnetlib.po b/library/telnetlib.po index 8a5d4ad1e..38e493669 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -22,13 +22,29 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!telnetlib` --- Telnet client" -msgstr "" +msgstr ":mod:`!telnetlib` --- کارخواه Telnet" -msgid "This module is no longer part of the Python standard library. It was :ref:`removed in Python 3.13 ` after being deprecated in Python 3.11. The removal was decided in :pep:`594`." +msgid "" +"This module is no longer part of the Python standard library. It was " +":ref:`removed in Python 3.13 ` after being deprecated in" +" Python 3.11. The removal was decided in :pep:`594`." msgstr "" +"این ماژول دیگر بخشی از کتابخانه استاندارد پایتون نیست. این ماژول پس از منسوخ" +" شدن در پایتون 3.11، :ref:`در پایتون 3.13 حذف شد `. " +"تصمیم برای حذف آن در :pep:`594` گرفته شد." -msgid "Possible replacements are third-party libraries from PyPI: :pypi:`telnetlib3` or :pypi:`Exscript`. These are not supported or maintained by the Python core team." +msgid "" +"Possible replacements are third-party libraries from PyPI: " +":pypi:`telnetlib3` or :pypi:`Exscript`. These are not supported or " +"maintained by the Python core team." msgstr "" +"جایگزین‌های ممکن، کتابخانه‌های شخص ثالث از PyPI هستند: :pypi:`telnetlib3` یا" +" :pypi:`Exscript`. این کتابخانه‌ها توسط تیم هسته پایتون پشتیبانی یا نگهداری " +"نمی‌شوند." -msgid "The last version of Python that provided the :mod:`!telnetlib` module was `Python 3.12 `_." +msgid "" +"The last version of Python that provided the :mod:`!telnetlib` module was " +"`Python 3.12 `_." msgstr "" +"آخرین نسخه‌ی پایتون که ماژول :mod:`!telnetlib` را ارائه می‌کرد، `Python 3.12" +" `_ بود." diff --git a/library/tempfile.po b/library/tempfile.po index 40d7f7360..dc60a4cef 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:14+0000\n" +"PO-Revision-Date: 2026-09-04 07:21+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,240 +23,634 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!tempfile` --- Generate temporary files and directories" -msgstr "" +msgstr ":mod:`!tempfile` --- تولید فایل‌ها و پوشه‌های موقت" msgid "**Source code:** :source:`Lib/tempfile.py`" -msgstr "" +msgstr "کد منبع: :source:`Lib/tempfile.py`" -msgid "This module creates temporary files and directories. It works on all supported platforms. :class:`TemporaryFile`, :class:`NamedTemporaryFile`, :class:`TemporaryDirectory`, and :class:`SpooledTemporaryFile` are high-level interfaces which provide automatic cleanup and can be used as :term:`context managers `. :func:`mkstemp` and :func:`mkdtemp` are lower-level functions which require manual cleanup." -msgstr "" +msgid "" +"This module creates temporary files and directories. It works on all " +"supported " +"platforms. :class:`TemporaryFile`, :class:`NamedTemporaryFile`, :class:`TemporaryDirectory`, " +"and :class:`SpooledTemporaryFile` are high-level interfaces which provide " +"automatic cleanup and can be used as :term:`context managers `. :func:`mkstemp` and :func:`mkdtemp` are lower-level functions " +"which require manual cleanup." +msgstr "" +"این ماژول فایل‌ها و پوشه‌های موقت ایجاد می‌کند. این ماژول روی همه‌ی پلتفرم‌های " +"پشتیبانی‌شده کار " +"می‌کند. :class:`TemporaryFile`، :class:`NamedTemporaryFile`، :class:`TemporaryDirectory` " +"و :class:`SpooledTemporaryFile` رابط‌های سطح بالایی هستند که پاک‌سازی خودکار را " +"فراهم می‌کنند و می‌توانند به‌عنوان :term:`مدیران زمینه ` " +"استفاده شوند. :func:`mkstemp` و :func:`mkdtemp` توابع سطح پایین‌تری هستند که " +"به پاک‌سازی دستی نیاز دارند." -msgid "All the user-callable functions and constructors take additional arguments which allow direct control over the location and name of temporary files and directories. Files names used by this module include a string of random characters which allows those files to be securely created in shared temporary directories. To maintain backward compatibility, the argument order is somewhat odd; it is recommended to use keyword arguments for clarity." -msgstr "" +msgid "" +"All the user-callable functions and constructors take additional arguments " +"which allow direct control over the location and name of temporary files and " +"directories. Files names used by this module include a string of random " +"characters which allows those files to be securely created in shared " +"temporary directories. To maintain backward compatibility, the argument order " +"is somewhat odd; it is recommended to use keyword arguments for clarity." +msgstr "" +"تمام توابع و سازنده‌های قابل فراخوانی توسط کاربر، آرگومان‌های اضافی می‌گیرند که " +"امکان کنترل مستقیم بر مکان و نام فایل‌ها و پوشه‌های موقت را فراهم می‌کنند. نام " +"فایل‌های استفاده‌شده در این ماژول شامل رشته‌ای از نویسه‌های تصادفی است که امکان " +"ایجاد امن آن فایل‌ها در پوشه‌های موقت مشترک را فراهم می‌کند. برای حفظ سازگاری با " +"نسخه‌های قبلی، ترتیب آرگومان‌ها کمی عجیب است؛ توصیه می‌شود برای وضوح بیشتر از " +"آرگومان‌های کلیدواژه‌ای استفاده کنید." msgid "The module defines the following user-callable items:" -msgstr "" +msgstr "این ماژول آیتم‌های قابل فراخوانی توسط کاربر زیر را تعریف می‌کند:" -msgid "Return a :term:`file-like object` that can be used as a temporary storage area. The file is created securely, using the same rules as :func:`mkstemp`. It will be destroyed as soon as it is closed (including an implicit close when the object is garbage collected). Under Unix, the directory entry for the file is either not created at all or is removed immediately after the file is created. Other platforms do not support this; your code should not rely on a temporary file created using this function having or not having a visible name in the file system." -msgstr "" +msgid "" +"Return a :term:`file-like object` that can be used as a temporary storage " +"area. The file is created securely, using the same rules as :func:`mkstemp`. " +"It will be destroyed as soon as it is closed (including an implicit close " +"when the object is garbage collected). Under Unix, the directory entry for " +"the file is either not created at all or is removed immediately after the " +"file is created. Other platforms do not support this; your code should not " +"rely on a temporary file created using this function having or not having a " +"visible name in the file system." +msgstr "" +"یک :term:`file-like object` برمی‌گرداند که می‌توان از آن به‌عنوان یک فضای " +"ذخیره‌سازی موقت استفاده کرد. این فایل به‌صورت ایمن و با استفاده از همان " +"قوانین :func:`mkstemp` ایجاد می‌شود. این فایل به محض بسته شدن از بین می‌رود (از " +"جمله بستن ضمنی هنگامی که شیء زباله‌روبی می‌شود). در یونیکس، مدخل فایل در پوشه " +"یا اصلاً ایجاد نمی‌شود یا بلافاصله پس از ایجاد فایل حذف می‌شود. سایر سکوها از " +"این قابلیت پشتیبانی نمی‌کنند؛ کد شما نباید به داشتن یا نداشتن نام قابل‌مشاهده " +"در سیستم فایل برای فایل موقتی که با استفاده از این تابع ایجاد شده است، اتکا " +"کند." -msgid "The resulting object can be used as a :term:`context manager` (see :ref:`tempfile-examples`). On completion of the context or destruction of the file object the temporary file will be removed from the filesystem." +msgid "" +"The resulting object can be used as a :term:`context manager` " +"(see :ref:`tempfile-examples`). On completion of the context or destruction " +"of the file object the temporary file will be removed from the filesystem." msgstr "" +"می‌توان از شیء حاصل به‌عنوان یک :term:`مدیر زمینه ` استفاده " +"کرد (به :ref:`tempfile-examples` مراجعه کنید). پس از تکمیل زمینه یا تخریب شیء " +"فایل، فایل موقت از سیستم فایل حذف خواهد شد." -msgid "The *mode* parameter defaults to ``'w+b'`` so that the file created can be read and written without being closed. Binary mode is used so that it behaves consistently on all platforms without regard for the data that is stored. *buffering*, *encoding*, *errors* and *newline* are interpreted as for :func:`open`." -msgstr "" +msgid "" +"The *mode* parameter defaults to ``'w+b'`` so that the file created can be " +"read and written without being closed. Binary mode is used so that it " +"behaves consistently on all platforms without regard for the data that is " +"stored. *buffering*, *encoding*, *errors* and *newline* are interpreted as " +"for :func:`open`." +msgstr "" +"پارامتر *mode* به‌طور پیش‌فرض مقدار ``'w+b'`` دارد تا فایل ایجادشده بدون بسته " +"شدن قابل خواندن و نوشتن باشد. از حالت دودویی استفاده می‌شود تا بدون توجه به " +"داده‌های ذخیره‌شده، در همه‌ی پلتفرم‌ها رفتار یکسانی داشته باشد. *buffering*، " +"*encoding*، *errors* و *newline* همان‌طور تفسیر می‌شوند که برای :func:`open` " +"تفسیر می‌شوند." -msgid "The *dir*, *prefix* and *suffix* parameters have the same meaning and defaults as with :func:`mkstemp`." +msgid "" +"The *dir*, *prefix* and *suffix* parameters have the same meaning and " +"defaults as with :func:`mkstemp`." msgstr "" +"پارامترهای *dir*، *prefix* و *suffix* همان معنا و مقادیر " +"پیش‌فرض :func:`mkstemp` را دارند." -msgid "The returned object is a true file object on POSIX platforms. On other platforms, it is a file-like object whose :attr:`!file` attribute is the underlying true file object." +msgid "" +"The returned object is a true file object on POSIX platforms. On other " +"platforms, it is a file-like object whose :attr:`!file` attribute is the " +"underlying true file object." msgstr "" +"شیء برگردانده‌شده در سکوهای POSIX یک شیء فایل واقعی است. در سکوهای دیگر، یک " +"شیء شبه‌فایل است که ویژگی :attr:`!file` آن، شیء فایل واقعی زیربنایی است." -msgid "The :py:const:`os.O_TMPFILE` flag is used if it is available and works (Linux-specific, requires Linux kernel 3.11 or later)." +msgid "" +"The :py:const:`os.O_TMPFILE` flag is used if it is available and works (Linux-" +"specific, requires Linux kernel 3.11 or later)." msgstr "" +"پرچم :py:const:`os.O_TMPFILE` در صورتی استفاده می‌شود که در دسترس باشد و کار " +"کند (مخصوص لینوکس، نیازمند هسته لینوکس 3.11 یا جدیدتر)." -msgid "On platforms that are neither Posix nor Cygwin, TemporaryFile is an alias for NamedTemporaryFile." +msgid "" +"On platforms that are neither Posix nor Cygwin, TemporaryFile is an alias for " +"NamedTemporaryFile." msgstr "" +"در سکوهایی که نه Posix هستند و نه Cygwin، TemporaryFile نام مستعاری برای " +"NamedTemporaryFile است." -msgid "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with argument ``fullpath``." +msgid "" +"Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with argument " +"``fullpath``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``tempfile.mkstemp`` را با آرگومان " +"``fullpath`` پرتاب می‌کند." msgid "The :py:const:`os.O_TMPFILE` flag is now used if available." msgstr "" +"اکنون در صورت موجود بودن، از پرچم :py:const:`os.O_TMPFILE` استفاده می‌شود." msgid "Added *errors* parameter." -msgstr "" +msgstr "پارامتر *errors* اضافه شد." -msgid "This function operates exactly as :func:`TemporaryFile` does, except the following differences:" +msgid "" +"This function operates exactly as :func:`TemporaryFile` does, except the " +"following differences:" msgstr "" +"این تابع دقیقاً مانند :func:`TemporaryFile` عمل می‌کند، به‌جز تفاوت‌های زیر:" -msgid "This function returns a file that is guaranteed to have a visible name in the file system." +msgid "" +"This function returns a file that is guaranteed to have a visible name in the " +"file system." msgstr "" +"این تابع فایلی را برمی‌گرداند که تضمین می‌شود دارای نام قابل مشاهده‌ای در سیستم " +"فایل است." -msgid "To manage the named file, it extends the parameters of :func:`TemporaryFile` with *delete* and *delete_on_close* parameters that determine whether and how the named file should be automatically deleted." +msgid "" +"To manage the named file, it extends the parameters of :func:`TemporaryFile` " +"with *delete* and *delete_on_close* parameters that determine whether and how " +"the named file should be automatically deleted." msgstr "" +"برای مدیریت فایل نام‌دار، این تابع پارامترهای :func:`TemporaryFile` را با " +"پارامترهای *delete* و *delete_on_close* گسترش می‌دهد که تعیین می‌کنند آیا فایل " +"نام‌دار باید به‌طور خودکار حذف شود یا خیر، و این حذف چگونه انجام شود." -msgid "The returned object is always a :term:`file-like object` whose :attr:`!file` attribute is the underlying true file object. This file-like object can be used in a :keyword:`with` statement, just like a normal file. The name of the temporary file can be retrieved from the :attr:`!name` attribute of the returned file-like object. On Unix, unlike with the :func:`TemporaryFile`, the directory entry does not get unlinked immediately after the file creation." -msgstr "" +msgid "" +"The returned object is always a :term:`file-like object` whose :attr:`!file` " +"attribute is the underlying true file object. This file-like object can be " +"used in a :keyword:`with` statement, just like a normal file. The name of " +"the temporary file can be retrieved from the :attr:`!name` attribute of the " +"returned file-like object. On Unix, unlike with the :func:`TemporaryFile`, " +"the directory entry does not get unlinked immediately after the file creation." +msgstr "" +"شیء برگردانده‌شده همیشه یک :term:`file-like object` است که ویژگی :attr:`!file` " +"آن، شیء فایل واقعی زیرین است. این شیء فایل‌مانند می‌تواند در یک " +"دستور :keyword:`with`، درست مانند یک فایل معمولی استفاده شود. نام فایل موقت " +"را می‌توان از ویژگی :attr:`!name` شیء فایل‌مانند برگردانده‌شده بازیابی کرد. در " +"یونیکس، برخلاف :func:`TemporaryFile`، مدخل پوشه بلافاصله پس از ایجاد فایل حذف " +"نمی‌شود." -msgid "If *delete* is true (the default) and *delete_on_close* is true (the default), the file is deleted as soon as it is closed. If *delete* is true and *delete_on_close* is false, the file is deleted on context manager exit only, or else when the :term:`file-like object` is finalized. Deletion is not always guaranteed in this case (see :meth:`object.__del__`). If *delete* is false, the value of *delete_on_close* is ignored." -msgstr "" +msgid "" +"If *delete* is true (the default) and *delete_on_close* is true (the " +"default), the file is deleted as soon as it is closed. If *delete* is true " +"and *delete_on_close* is false, the file is deleted on context manager exit " +"only, or else when the :term:`file-like object` is finalized. Deletion is not " +"always guaranteed in this case (see :meth:`object.__del__`). If *delete* is " +"false, the value of *delete_on_close* is ignored." +msgstr "" +"اگر *delete* درست باشد (پیش‌فرض) و *delete_on_close* درست باشد (پیش‌فرض)، فایل " +"به محض بسته شدن حذف می‌شود. اگر *delete* درست و *delete_on_close* نادرست باشد، " +"فایل فقط هنگام خروج از مدیر زمینه حذف می‌شود، یا در غیر این صورت " +"وقتی :term:`file-like object` نهایی می‌شود. حذف در این حالت همیشه تضمین نمی‌شود " +"(به :meth:`object.__del__` مراجعه کنید). اگر *delete* نادرست باشد، مقدار " +"*delete_on_close* نادیده گرفته می‌شود." -msgid "Therefore to use the name of the temporary file to reopen the file after closing it, either make sure not to delete the file upon closure (set the *delete* parameter to be false) or, in case the temporary file is created in a :keyword:`with` statement, set the *delete_on_close* parameter to be false. The latter approach is recommended as it provides assistance in automatic cleaning of the temporary file upon the context manager exit." -msgstr "" +msgid "" +"Therefore to use the name of the temporary file to reopen the file after " +"closing it, either make sure not to delete the file upon closure (set the " +"*delete* parameter to be false) or, in case the temporary file is created in " +"a :keyword:`with` statement, set the *delete_on_close* parameter to be false. " +"The latter approach is recommended as it provides assistance in automatic " +"cleaning of the temporary file upon the context manager exit." +msgstr "" +"بنابراین برای استفاده از نام فایل موقت جهت باز کردن مجدد فایل پس از بستن آن، " +"یا اطمینان حاصل کنید که فایل هنگام بسته شدن حذف نشود (پارامتر *delete* را روی " +"false تنظیم کنید) یا، در صورتی که فایل موقت در یک دستور :keyword:`with` ایجاد " +"شده باشد، پارامتر *delete_on_close* را روی false تنظیم کنید. روش دوم توصیه " +"می‌شود، زیرا به پاک‌سازی خودکار فایل موقت هنگام خروج از مدیر زمینه کمک می‌کند." -msgid "Opening the temporary file again by its name while it is still open works as follows:" +msgid "" +"Opening the temporary file again by its name while it is still open works as " +"follows:" msgstr "" +"باز کردن دوباره‌ی فایل موقت با نام آن، در حالی که هنوز باز است، به‌صورت زیر عمل " +"می‌کند:" msgid "On POSIX the file can always be opened again." -msgstr "" +msgstr "در POSIX، همیشه می‌توان پرونده را دوباره باز کرد." -msgid "On Windows, make sure that at least one of the following conditions are fulfilled:" -msgstr "" +msgid "" +"On Windows, make sure that at least one of the following conditions are " +"fulfilled:" +msgstr "در ویندوز، اطمینان حاصل کنید که حداقل یکی از شرایط زیر برقرار باشد:" msgid "*delete* is false" -msgstr "" +msgstr "*delete* نادرست است" -msgid "additional open shares delete access (e.g. by calling :func:`os.open` with the flag ``O_TEMPORARY``)" +msgid "" +"additional open shares delete access (e.g. by calling :func:`os.open` with " +"the flag ``O_TEMPORARY``)" msgstr "" +"باز کردن اضافی، دسترسی حذف را به اشتراک می‌گذارد (برای مثال با " +"فراخوانی :func:`os.open` با پرچم ``O_TEMPORARY``)" -msgid "*delete* is true but *delete_on_close* is false. Note, that in this case the additional opens that do not share delete access (e.g. created via builtin :func:`open`) must be closed before exiting the context manager, else the :func:`os.unlink` call on context manager exit will fail with a :exc:`PermissionError`." -msgstr "" +msgid "" +"*delete* is true but *delete_on_close* is false. Note, that in this case the " +"additional opens that do not share delete access (e.g. created via " +"builtin :func:`open`) must be closed before exiting the context manager, else " +"the :func:`os.unlink` call on context manager exit will fail with " +"a :exc:`PermissionError`." +msgstr "" +"*delete* true است اما *delete_on_close* false است. توجه داشته باشید که در این " +"حالت، باز شدن‌های اضافی که دسترسی حذف را به‌اشتراک نمی‌گذارند (برای مثال " +"ایجادشده از طریق تابع توکار :func:`open`) باید پیش از خروج از مدیر زمینه بسته " +"شوند، در غیر این صورت فراخوانی :func:`os.unlink` هنگام خروج از مدیر زمینه " +"با :exc:`PermissionError` ناموفق خواهد شد." -msgid "On Windows, if *delete_on_close* is false, and the file is created in a directory for which the user lacks delete access, then the :func:`os.unlink` call on exit of the context manager will fail with a :exc:`PermissionError`. This cannot happen when *delete_on_close* is true because delete access is requested by the open, which fails immediately if the requested access is not granted." -msgstr "" +msgid "" +"On Windows, if *delete_on_close* is false, and the file is created in a " +"directory for which the user lacks delete access, then the :func:`os.unlink` " +"call on exit of the context manager will fail with a :exc:`PermissionError`. " +"This cannot happen when *delete_on_close* is true because delete access is " +"requested by the open, which fails immediately if the requested access is not " +"granted." +msgstr "" +"در ویندوز، اگر *delete_on_close* برابر false باشد و فایل در پوشه‌ای ایجاد شود " +"که کاربر دسترسی حذف به آن را ندارد، فراخوانی :func:`os.unlink` هنگام خروج از " +"مدیر زمینه با :exc:`PermissionError` شکست خواهد خورد. هنگامی که " +"*delete_on_close* برابر true باشد، این حالت نمی‌تواند رخ دهد، زیرا دسترسی حذف " +"توسط باز کردن فایل درخواست می‌شود و اگر دسترسی درخواست‌شده اعطا نشود، باز کردن " +"فایل بلافاصله شکست می‌خورد." -msgid "On POSIX (only), a process that is terminated abruptly with SIGKILL cannot automatically delete any NamedTemporaryFiles it created." +msgid "" +"On POSIX (only), a process that is terminated abruptly with SIGKILL cannot " +"automatically delete any NamedTemporaryFiles it created." msgstr "" +"در POSIX (فقط)، فرایندی که به‌طور ناگهانی با SIGKILL خاتمه یافته باشد، " +"نمی‌تواند به‌طور خودکار هیچ‌یک از NamedTemporaryFileهایی را که ایجاد کرده است " +"حذف کند." msgid "Added *delete_on_close* parameter." -msgstr "" +msgstr "پارامتر *delete_on_close* افزوده شد." -msgid "This class operates exactly as :func:`TemporaryFile` does, except that data is spooled in memory until the file size exceeds *max_size*, or until the file's :func:`~io.IOBase.fileno` method is called, at which point the contents are written to disk and operation proceeds as with :func:`TemporaryFile`." -msgstr "" +msgid "" +"This class operates exactly as :func:`TemporaryFile` does, except that data " +"is spooled in memory until the file size exceeds *max_size*, or until the " +"file's :func:`~io.IOBase.fileno` method is called, at which point the " +"contents are written to disk and operation proceeds as " +"with :func:`TemporaryFile`." +msgstr "" +"این کلاس دقیقاً مانند :func:`TemporaryFile` عمل می‌کند، با این تفاوت که داده‌ها " +"به‌صورت اسپول (spooled) در حافظه نگهداری می‌شوند تا زمانی که اندازه فایل از " +"*max_size* فراتر رود، یا تا زمانی که متد :func:`~io.IOBase.fileno` فایل " +"فراخوانی شود؛ در این نقطه محتوا روی دیسک نوشته می‌شود و عملیات " +"مانند :func:`TemporaryFile` ادامه می‌یابد." -msgid "The resulting file has one additional method, :meth:`!rollover`, which causes the file to roll over to an on-disk file regardless of its size." +msgid "" +"The resulting file has one additional method, :meth:`!rollover`, which causes " +"the file to roll over to an on-disk file regardless of its size." msgstr "" +"فایل حاصل یک متد اضافی دارد، :meth:`!rollover`، که باعث می‌شود فایل صرف‌نظر از " +"اندازه‌اش به یک فایل روی دیسک منتقل شود." -msgid "The returned object is a file-like object whose :attr:`!_file` attribute is either an :class:`io.BytesIO` or :class:`io.TextIOWrapper` object (depending on whether binary or text *mode* was specified) or a true file object, depending on whether :meth:`rollover` has been called. This file-like object can be used in a :keyword:`with` statement, just like a normal file." -msgstr "" +msgid "" +"The returned object is a file-like object whose :attr:`!_file` attribute is " +"either an :class:`io.BytesIO` or :class:`io.TextIOWrapper` object (depending " +"on whether binary or text *mode* was specified) or a true file object, " +"depending on whether :meth:`rollover` has been called. This file-like object " +"can be used in a :keyword:`with` statement, just like a normal file." +msgstr "" +"شیء برگردانده‌شده یک شیء فایل‌مانند است که ویژگی :attr:`!_file` آن یا یک " +"شیء :class:`io.BytesIO` یا :class:`io.TextIOWrapper` است (بسته به اینکه " +"*حالت* دودویی یا متنی تعیین شده باشد) یا یک شیء فایل واقعی است، بسته به " +"اینکه :meth:`rollover` فراخوانی شده باشد. می‌توان از این شیء فایل‌مانند در یک " +"دستور :keyword:`with` استفاده کرد، درست مانند یک فایل معمولی." msgid "the truncate method now accepts a *size* argument." -msgstr "" +msgstr "متد truncate اکنون یک آرگومان *size* را می‌پذیرد." -msgid "Fully implements the :class:`io.BufferedIOBase` and :class:`io.TextIOBase` abstract base classes (depending on whether binary or text *mode* was specified)." +msgid "" +"Fully implements the :class:`io.BufferedIOBase` and :class:`io.TextIOBase` " +"abstract base classes (depending on whether binary or text *mode* was " +"specified)." msgstr "" +"به‌طور کامل کلاس‌های پایه انتزاعی :class:`io.BufferedIOBase` " +"و :class:`io.TextIOBase` را پیاده‌سازی می‌کند (بسته به اینکه *حالت* دودویی یا " +"متنی مشخص شده باشد)." -msgid "This class securely creates a temporary directory using the same rules as :func:`mkdtemp`. The resulting object can be used as a :term:`context manager` (see :ref:`tempfile-examples`). On completion of the context or destruction of the temporary directory object, the newly created temporary directory and all its contents are removed from the filesystem." +msgid "" +"This class securely creates a temporary directory using the same rules " +"as :func:`mkdtemp`. The resulting object can be used as a :term:`context " +"manager` (see :ref:`tempfile-examples`). On completion of the context or " +"destruction of the temporary directory object, the newly created temporary " +"directory and all its contents are removed from the filesystem." msgstr "" +"این کلاس با استفاده از همان قواعد :func:`mkdtemp`، یک پوشه موقت را به‌صورت امن " +"ایجاد می‌کند. شیء حاصل می‌تواند به‌عنوان یک :term:`context manager` استفاده شود " +"(به :ref:`tempfile-examples` مراجعه کنید). پس از تکمیل زمینه یا تخریب شیء " +"پوشه موقت، پوشه موقت تازه‌ساخته‌شده و تمام محتویات آن از سیستم فایل حذف می‌شوند." -msgid "The directory name can be retrieved from the :attr:`!name` attribute of the returned object. When the returned object is used as a :term:`context manager`, the :attr:`!name` will be assigned to the target of the :keyword:`!as` clause in the :keyword:`with` statement, if there is one." +msgid "" +"The directory name can be retrieved from the :attr:`!name` attribute of the " +"returned object. When the returned object is used as a :term:`context " +"manager`, the :attr:`!name` will be assigned to the target of the :keyword:`!" +"as` clause in the :keyword:`with` statement, if there is one." msgstr "" +"نام پوشه را می‌توان از ویژگی :attr:`!name` شیء برگردانده‌شده بازیابی کرد. " +"هنگامی که شیء برگردانده‌شده به‌عنوان یک :term:`context manager` استفاده " +"شود، :attr:`!name` به هدف عبارت :keyword:`!as` در دستور :keyword:`with` " +"اختصاص می‌یابد، در صورتی که وجود داشته باشد." -msgid "The directory can be explicitly cleaned up by calling the :meth:`!cleanup` method. If *ignore_cleanup_errors* is true, any unhandled exceptions during explicit or implicit cleanup (such as a :exc:`PermissionError` removing open files on Windows) will be ignored, and the remaining removable items deleted on a \"best-effort\" basis. Otherwise, errors will be raised in whatever context cleanup occurs (the :meth:`!cleanup` call, exiting the context manager, when the object is garbage-collected or during interpreter shutdown)." -msgstr "" +msgid "" +"The directory can be explicitly cleaned up by calling the :meth:`!cleanup` " +"method. If *ignore_cleanup_errors* is true, any unhandled exceptions during " +"explicit or implicit cleanup (such as a :exc:`PermissionError` removing open " +"files on Windows) will be ignored, and the remaining removable items deleted " +"on a \"best-effort\" basis. Otherwise, errors will be raised in whatever " +"context cleanup occurs (the :meth:`!cleanup` call, exiting the context " +"manager, when the object is garbage-collected or during interpreter shutdown)." +msgstr "" +"پوشه را می‌توان با فراخوانی متد :meth:`!cleanup` به‌صورت صریح پاک‌سازی کرد. اگر " +"*ignore_cleanup_errors* درست باشد، تمام استثناهای مدیریت‌نشده در جریان پاک‌سازی " +"صریح یا ضمنی (مانند :exc:`PermissionError` هنگام حذف فایل‌های باز در ویندوز) " +"نادیده گرفته خواهند شد و آیتم‌های قابل‌حذف باقی‌مانده بر پایه‌ی «بهترین تلاش» حذف " +"خواهند شد. در غیر این صورت، خطاها در هر زمینه‌ای که پاک‌سازی در آن رخ دهد پرتاب " +"خواهند شد (فراخوانی :meth:`!cleanup`، خروج از مدیر زمینه، زمانی که شیء " +"زباله‌روبی می‌شود یا هنگام خاموش شدن مفسر)." -msgid "The *delete* parameter can be used to disable cleanup of the directory tree upon exiting the context. While it may seem unusual for a context manager to disable the action taken when exiting the context, it can be useful during debugging or when you need your cleanup behavior to be conditional based on other logic." -msgstr "" +msgid "" +"The *delete* parameter can be used to disable cleanup of the directory tree " +"upon exiting the context. While it may seem unusual for a context manager to " +"disable the action taken when exiting the context, it can be useful during " +"debugging or when you need your cleanup behavior to be conditional based on " +"other logic." +msgstr "" +"می‌توان از پارامتر *delete* برای غیرفعال کردن پاک‌سازی درخت پوشه‌ها هنگام خروج " +"از زمینه استفاده کرد. اگرچه ممکن است غیرعادی به نظر برسد که یک مدیر زمینه " +"عملیات انجام‌شده هنگام خروج از زمینه را غیرفعال کند، اما این کار می‌تواند در " +"حین اشکال‌زدایی یا زمانی که نیاز دارید رفتار پاک‌سازی شما بر اساس منطق دیگری " +"مشروط باشد، مفید باشد." -msgid "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with argument ``fullpath``." +msgid "" +"Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with argument " +"``fullpath``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``tempfile.mkdtemp`` را با آرگومان " +"``fullpath`` پرتاب می‌کند." msgid "Added *ignore_cleanup_errors* parameter." -msgstr "" +msgstr "پارامتر *ignore_cleanup_errors* افزوده شد." msgid "Added the *delete* parameter." -msgstr "" +msgstr "پارامتر *delete* افزوده شد." -msgid "Creates a temporary file in the most secure manner possible. There are no race conditions in the file's creation, assuming that the platform properly implements the :const:`os.O_EXCL` flag for :func:`os.open`. The file is readable and writable only by the creating user ID. If the platform uses permission bits to indicate whether a file is executable, the file is executable by no one." -msgstr "" +msgid "" +"Creates a temporary file in the most secure manner possible. There are no " +"race conditions in the file's creation, assuming that the platform properly " +"implements the :const:`os.O_EXCL` flag for :func:`os.open`. The file is " +"readable and writable only by the creating user ID. If the platform uses " +"permission bits to indicate whether a file is executable, the file is " +"executable by no one." +msgstr "" +"یک فایل موقت را به امن‌ترین شیوه ممکن ایجاد می‌کند. با فرض اینکه پلتفرم " +"پرچم :const:`os.O_EXCL` را برای :func:`os.open` به‌درستی پیاده‌سازی کرده باشد، " +"هیچ‌گونه شرایط رقابتی در ایجاد فایل وجود ندارد. فایل تنها توسط شناسه کاربر " +"ایجادکننده قابل خواندن و نوشتن است. اگر پلتفرم از بیت‌های دسترسی برای نشان " +"دادن اینکه آیا یک فایل قابل اجرا است یا خیر استفاده کند، این فایل توسط هیچ‌کس " +"قابل اجرا نیست." -msgid "The file descriptor is :ref:`not inherited by child processes `." +msgid "" +"The file descriptor is :ref:`not inherited by child processes " +"`." msgstr "" +"توصیف‌گر فایل :ref:`توسط فرآیندهای فرزند به ارث برده نمی‌شود `." -msgid "Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for closing the file descriptor (for example, using :func:`os.close`) and deleting the temporary file (for example, using :func:`os.remove`)." +msgid "" +"Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for " +"closing the file descriptor (for example, using :func:`os.close`) and " +"deleting the temporary file (for example, using :func:`os.remove`)." msgstr "" +"برخلاف :func:`TemporaryFile`، کاربر :func:`mkstemp` مسئول بستن توصیف‌گر فایل " +"(برای مثال، با استفاده از :func:`os.close`) و حذف فایل موقت (برای مثال، با " +"استفاده از :func:`os.remove`) است." -msgid "If *suffix* is not ``None``, the file name will end with that suffix, otherwise there will be no suffix. :func:`mkstemp` does not put a dot between the file name and the suffix; if you need one, put it at the beginning of *suffix*." +msgid "" +"If *suffix* is not ``None``, the file name will end with that suffix, " +"otherwise there will be no suffix. :func:`mkstemp` does not put a dot " +"between the file name and the suffix; if you need one, put it at the " +"beginning of *suffix*." msgstr "" +"اگر *suffix* برابر ``None`` نباشد، نام فایل با آن پسوند پایان می‌یابد، در غیر " +"این صورت پسوندی نخواهد داشت. :func:`mkstemp` بین نام فایل و پسوند نقطه قرار " +"نمی‌دهد؛ اگر به یک نقطه نیاز دارید، آن را در ابتدای *suffix* قرار دهید." -msgid "If *prefix* is not ``None``, the file name will begin with that prefix; otherwise, a default prefix is used. The default is the return value of :func:`gettempprefix` or :func:`gettempprefixb`, as appropriate." +msgid "" +"If *prefix* is not ``None``, the file name will begin with that prefix; " +"otherwise, a default prefix is used. The default is the return value " +"of :func:`gettempprefix` or :func:`gettempprefixb`, as appropriate." msgstr "" +"اگر *prefix* برابر ``None`` نباشد، نام فایل با آن پیشوند آغاز می‌شود؛ در غیر " +"این صورت، از یک پیشوند پیش‌فرض استفاده می‌شود. مقدار پیش‌فرض، بسته به مورد، " +"مقدار بازگشتی :func:`gettempprefix` یا :func:`gettempprefixb` است." -msgid "If *dir* is not ``None``, the file will be created in that directory; otherwise, a default directory is used. The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the *TMPDIR*, *TEMP* or *TMP* environment variables. There is thus no guarantee that the generated filename will have any nice properties, such as not requiring quoting when passed to external commands via ``os.popen()``." -msgstr "" +msgid "" +"If *dir* is not ``None``, the file will be created in that directory; " +"otherwise, a default directory is used. The default directory is chosen from " +"a platform-dependent list, but the user of the application can control the " +"directory location by setting the *TMPDIR*, *TEMP* or *TMP* environment " +"variables. There is thus no guarantee that the generated filename will have " +"any nice properties, such as not requiring quoting when passed to external " +"commands via ``os.popen()``." +msgstr "" +"اگر *dir* برابر ``None`` نباشد، فایل در آن پوشه ایجاد می‌شود؛ در غیر این صورت، " +"از یک پوشه‌ی پیش‌فرض استفاده می‌شود. پوشه‌ی پیش‌فرض از فهرستی وابسته به پلتفرم " +"انتخاب می‌شود، اما کاربر برنامه می‌تواند محل پوشه را با تنظیم متغیرهای محیطی " +"*TMPDIR*، *TEMP* یا *TMP* کنترل کند. بنابراین هیچ تضمینی وجود ندارد که نام " +"فایل تولیدشده دارای ویژگی‌های مناسبی باشد، مانند اینکه هنگام ارسال به فرمان‌های " +"خارجی از طریق ``os.popen()`` نیازی به علامت نقل‌قول نداشته باشد." -msgid "If any of *suffix*, *prefix*, and *dir* are not ``None``, they must be the same type. If they are bytes, the returned name will be bytes instead of str. If you want to force a bytes return value with otherwise default behavior, pass ``suffix=b''``." +msgid "" +"If any of *suffix*, *prefix*, and *dir* are not ``None``, they must be the " +"same type. If they are bytes, the returned name will be bytes instead of str. " +"If you want to force a bytes return value with otherwise default behavior, " +"pass ``suffix=b''``." msgstr "" +"اگر هر یک از *suffix*، *prefix* و *dir* برابر ``None`` نباشند، باید از یک نوع " +"باشند. اگر آن‌ها bytes باشند، نام بازگشتی به جای str از نوع bytes خواهد بود. " +"اگر می‌خواهید با حفظ رفتار پیش‌فرض در سایر موارد، مقدار بازگشتی از نوع bytes را " +"تحمیل کنید، ``suffix=b''`` را ارسال کنید." -msgid "If *text* is specified and true, the file is opened in text mode. Otherwise, (the default) the file is opened in binary mode." +msgid "" +"If *text* is specified and true, the file is opened in text mode. Otherwise, " +"(the default) the file is opened in binary mode." msgstr "" +"اگر *text* مشخص شده و درست باشد، فایل در حالت متنی باز می‌شود. در غیر این " +"صورت، فایل (به‌طور پیش‌فرض) در حالت دودویی باز می‌شود." -msgid ":func:`mkstemp` returns a tuple containing an OS-level handle to an open file (as would be returned by :func:`os.open`) and the absolute pathname of that file, in that order." +msgid "" +":func:`mkstemp` returns a tuple containing an OS-level handle to an open file " +"(as would be returned by :func:`os.open`) and the absolute pathname of that " +"file, in that order." msgstr "" +":func:`mkstemp` یک تاپل شامل یک دسته (handle) در سطح سیستم‌عامل برای یک فایل " +"باز (مانند آنچه توسط :func:`os.open` بازگردانده می‌شود) و نام مسیر مطلق آن " +"فایل را، به همین ترتیب، بازمی‌گرداند." -msgid "*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. *suffix* and *prefix* now accept and default to ``None`` to cause an appropriate default value to be used." +msgid "" +"*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to obtain " +"a bytes return value. Prior to this, only str was allowed. *suffix* and " +"*prefix* now accept and default to ``None`` to cause an appropriate default " +"value to be used." msgstr "" +"اکنون می‌توان *suffix*، *prefix* و *dir* را به‌صورت بایت (bytes) ارائه کرد تا " +"یک مقدار بازگشتی از نوع بایت (bytes) به دست آید. پیش از این، فقط رشته (str) " +"مجاز بود. *suffix* و *prefix* اکنون به‌طور پیش‌فرض ``None`` را می‌پذیرند تا باعث " +"استفاده از یک مقدار پیش‌فرض مناسب شوند." msgid "The *dir* parameter now accepts a :term:`path-like object`." -msgstr "" +msgstr "پارامتر *dir* اکنون :term:`path-like object` را می‌پذیرد." -msgid "Creates a temporary directory in the most secure manner possible. There are no race conditions in the directory's creation. The directory is readable, writable, and searchable only by the creating user ID." +msgid "" +"Creates a temporary directory in the most secure manner possible. There are " +"no race conditions in the directory's creation. The directory is readable, " +"writable, and searchable only by the creating user ID." msgstr "" +"یک پوشه موقت را به امن‌ترین روش ممکن ایجاد می‌کند. در ایجاد پوشه هیچ‌گونه شرایط " +"رقابتی وجود ندارد. این پوشه فقط توسط شناسه کاربری ایجادکننده قابل خواندن، " +"قابل نوشتن و قابل جستجو است." -msgid "The user of :func:`mkdtemp` is responsible for deleting the temporary directory and its contents when done with it." +msgid "" +"The user of :func:`mkdtemp` is responsible for deleting the temporary " +"directory and its contents when done with it." msgstr "" +"کاربر :func:`mkdtemp` مسئول حذف پوشه موقت و محتویات آن پس از اتمام کار با آن " +"است." -msgid "The *prefix*, *suffix*, and *dir* arguments are the same as for :func:`mkstemp`." +msgid "" +"The *prefix*, *suffix*, and *dir* arguments are the same as " +"for :func:`mkstemp`." msgstr "" +"آرگومان‌های *prefix*، *suffix* و *dir* همانند آرگومان‌های :func:`mkstemp` هستند." msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." -msgstr "" +msgstr ":func:`mkdtemp` مسیر مطلق پوشه‌ی جدید را بازمی‌گرداند." -msgid ":func:`mkdtemp` now always returns an absolute path, even if *dir* is relative." +msgid "" +":func:`mkdtemp` now always returns an absolute path, even if *dir* is " +"relative." msgstr "" +":func:`mkdtemp` اکنون همیشه یک مسیر مطلق را بازمی‌گرداند، حتی اگر *dir* نسبی " +"باشد." -msgid "Return the name of the directory used for temporary files. This defines the default value for the *dir* argument to all functions in this module." +msgid "" +"Return the name of the directory used for temporary files. This defines the " +"default value for the *dir* argument to all functions in this module." msgstr "" +"نام پوشه‌ای را که برای فایل‌های موقت استفاده می‌شود، برمی‌گرداند. این، مقدار " +"پیش‌فرض آرگومان *dir* برای همه توابع این ماژول را تعریف می‌کند." -msgid "Python searches a standard list of directories to find one which the calling user can create files in. The list is:" +msgid "" +"Python searches a standard list of directories to find one which the calling " +"user can create files in. The list is:" msgstr "" +"پایتون فهرست استانداردی از پوشه‌ها را جستجو می‌کند تا پوشه‌ای را بیابد که کاربر " +"فراخوان بتواند در آن فایل ایجاد کند. این فهرست عبارت است از:" msgid "The directory named by the :envvar:`TMPDIR` environment variable." -msgstr "" +msgstr "پوشه‌ای که متغیر محیطی :envvar:`TMPDIR` نام آن را تعیین می‌کند." msgid "The directory named by the :envvar:`TEMP` environment variable." -msgstr "" +msgstr "پوشه‌ای که با متغیر محیطی :envvar:`TEMP` نام‌گذاری شده است." msgid "The directory named by the :envvar:`TMP` environment variable." -msgstr "" +msgstr "پوشه‌ای که نام آن با متغیر محیطی :envvar:`TMP` مشخص شده است." msgid "A platform-specific location:" -msgstr "" +msgstr "یک مکان وابسته به سکو:" -msgid "On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\\\TEMP`, and :file:`\\\\TMP`, in that order." +msgid "" +"On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\" +"\\TEMP`, and :file:`\\\\TMP`, in that order." msgstr "" +"در ویندوز، پوشه‌های :file:`C:\\\\TEMP`، :file:`C:\\\\TMP`، :file:`\\\\TEMP`، " +"و :file:`\\\\TMP`، به همین ترتیب." -msgid "On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :file:`/usr/tmp`, in that order." +msgid "" +"On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, " +"and :file:`/usr/tmp`, in that order." msgstr "" +"در تمام سکوهای دیگر، پوشه‌های :file:`/tmp`، :file:`/var/tmp` و :file:`/usr/" +"tmp`، به همین ترتیب." msgid "As a last resort, the current working directory." -msgstr "" +msgstr "به‌عنوان آخرین راه‌حل، پوشه‌ی کاری فعلی." -msgid "The result of this search is cached, see the description of :data:`tempdir` below." +msgid "" +"The result of this search is cached, see the description of :data:`tempdir` " +"below." msgstr "" +"نتیجه‌ی این جستجو در نهانگاه ذخیره می‌شود، شرح :data:`tempdir` را در زیر ببینید." -msgid "Always returns a str. Previously it would return any :data:`tempdir` value regardless of type so long as it was not ``None``." +msgid "" +"Always returns a str. Previously it would return any :data:`tempdir` value " +"regardless of type so long as it was not ``None``." msgstr "" +"همیشه یک str برمی‌گرداند. پیش از این، هر مقدار :data:`tempdir` را صرف‌نظر از " +"نوع آن برمی‌گرداند، تا زمانی که ``None`` نبود." msgid "Same as :func:`gettempdir` but the return value is in bytes." -msgstr "" +msgstr "مانند :func:`gettempdir` است، اما مقدار بازگشتی به‌صورت بایت است." -msgid "Return the filename prefix used to create temporary files. This does not contain the directory component." +msgid "" +"Return the filename prefix used to create temporary files. This does not " +"contain the directory component." msgstr "" +"پیشوند نام فایلی را که برای ایجاد فایل‌های موقت استفاده می‌شود، برمی‌گرداند. این " +"پیشوند شامل کامپوننت پوشه نمی‌شود." msgid "Same as :func:`gettempprefix` but the return value is in bytes." -msgstr "" +msgstr "مشابه :func:`gettempprefix` است، اما مقدار بازگشتی به‌صورت بایت است." -msgid "The module uses a global variable to store the name of the directory used for temporary files returned by :func:`gettempdir`. It can be set directly to override the selection process, but this is discouraged. All functions in this module take a *dir* argument which can be used to specify the directory. This is the recommended approach that does not surprise other unsuspecting code by changing global API behavior." -msgstr "" +msgid "" +"The module uses a global variable to store the name of the directory used for " +"temporary files returned by :func:`gettempdir`. It can be set directly to " +"override the selection process, but this is discouraged. All functions in " +"this module take a *dir* argument which can be used to specify the directory. " +"This is the recommended approach that does not surprise other unsuspecting " +"code by changing global API behavior." +msgstr "" +"این ماژول از یک متغیر سراسری برای ذخیره‌ی نام پوشه‌ی مورد استفاده برای فایل‌های " +"موقت استفاده می‌کند؛ نامی که توسط :func:`gettempdir` بازگردانده می‌شود. می‌توان " +"این متغیر را مستقیماً برای نادیده گرفتن فرآیند انتخاب تنظیم کرد، اما این کار " +"توصیه نمی‌شود. همه‌ی توابع این ماژول یک آرگومان *dir* می‌گیرند که می‌توان از آن " +"برای مشخص کردن پوشه استفاده کرد. این روش توصیه‌شده‌ای است که با تغییر رفتار " +"سراسری API، سایر کدهای بی‌خبر را غافلگیر نمی‌کند." -msgid "When set to a value other than ``None``, this variable defines the default value for the *dir* argument to the functions defined in this module, including its type, bytes or str. It cannot be a :term:`path-like object`." +msgid "" +"When set to a value other than ``None``, this variable defines the default " +"value for the *dir* argument to the functions defined in this module, " +"including its type, bytes or str. It cannot be a :term:`path-like object`." msgstr "" +"هنگامی که به مقداری غیر از ``None`` تنظیم شود، این متغیر مقدار پیش‌فرض آرگومان " +"*dir* برای توابع تعریف‌شده در این ماژول را، از جمله نوع آن (bytes یا str)، " +"تعیین می‌کند. این مقدار نمی‌تواند یک :term:`path-like object` باشد." -msgid "If ``tempdir`` is ``None`` (the default) at any call to any of the above functions except :func:`gettempprefix` it is initialized following the algorithm described in :func:`gettempdir`." +msgid "" +"If ``tempdir`` is ``None`` (the default) at any call to any of the above " +"functions except :func:`gettempprefix` it is initialized following the " +"algorithm described in :func:`gettempdir`." msgstr "" +"اگر ``tempdir`` در هر فراخوانی از هر یک از توابع بالا به " +"جز :func:`gettempprefix` برابر ``None`` باشد (پیش‌فرض)، طبق الگوریتم توصیف‌شده " +"در :func:`gettempdir` مقداردهی اولیه می‌شود." -msgid "Beware that if you set ``tempdir`` to a bytes value, there is a nasty side effect: The global default return type of :func:`mkstemp` and :func:`mkdtemp` changes to bytes when no explicit ``prefix``, ``suffix``, or ``dir`` arguments of type str are supplied. Please do not write code expecting or depending on this. This awkward behavior is maintained for compatibility with the historical implementation." -msgstr "" +msgid "" +"Beware that if you set ``tempdir`` to a bytes value, there is a nasty side " +"effect: The global default return type of :func:`mkstemp` and :func:`mkdtemp` " +"changes to bytes when no explicit ``prefix``, ``suffix``, or ``dir`` " +"arguments of type str are supplied. Please do not write code expecting or " +"depending on this. This awkward behavior is maintained for compatibility with " +"the historical implementation." +msgstr "" +"مراقب باشید که اگر ``tempdir`` را روی مقداری از نوع bytes تنظیم کنید، عارضه " +"جانبی ناخوشایندی وجود دارد: هنگامی که آرگومان‌های صریح ``prefix``، ``suffix`` " +"یا ``dir`` از نوع str ارائه نشده باشند، نوع بازگشتی پیش‌فرض " +"سراسری :func:`mkstemp` و :func:`mkdtemp` به bytes تغییر می‌کند. لطفاً کدی " +"ننویسید که این رفتار را انتظار دارد یا به آن وابسته است. این رفتار ناخوشایند " +"برای سازگاری با پیاده‌سازی تاریخی حفظ شده است." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" msgid "Here are some examples of typical usage of the :mod:`!tempfile` module::" -msgstr "" +msgstr "در اینجا چند نمونه از کاربرد معمول ماژول :mod:`!tempfile` آمده است::" msgid "" ">>> import tempfile\n" @@ -299,21 +693,92 @@ msgid "" ">>>\n" "# directory and contents have been removed" msgstr "" +">>> import tempfile\n" +"\n" +"# create a temporary file and write some data to it\n" +">>> fp = tempfile.TemporaryFile()\n" +">>> fp.write(b'Hello world!')\n" +"# read data from file\n" +">>> fp.seek(0)\n" +">>> fp.read()\n" +"b'Hello world!'\n" +"# close the file, it will be removed\n" +">>> fp.close()\n" +"\n" +"# create a temporary file using a context manager\n" +">>> with tempfile.TemporaryFile() as fp:\n" +"... fp.write(b'Hello world!')\n" +"... fp.seek(0)\n" +"... fp.read()\n" +"b'Hello world!'\n" +">>>\n" +"# file is now closed and removed\n" +"\n" +"# create a temporary file using a context manager\n" +"# close the file, use the name to open the file again\n" +">>> with tempfile.NamedTemporaryFile(delete_on_close=False) as fp:\n" +"... fp.write(b'Hello world!')\n" +"... fp.close()\n" +"... # the file is closed, but not removed\n" +"... # open the file again by using its name\n" +"... with open(fp.name, mode='rb') as f:\n" +"... f.read()\n" +"b'Hello world!'\n" +">>>\n" +"# file is now removed\n" +"\n" +"# create a temporary directory using the context manager\n" +">>> with tempfile.TemporaryDirectory() as tmpdirname:\n" +"... print('created temporary directory', tmpdirname)\n" +">>>\n" +"# directory and contents have been removed" msgid "Deprecated functions and variables" -msgstr "" +msgstr "توابع و متغیرهای منسوخ" -msgid "A historical way to create temporary files was to first generate a file name with the :func:`mktemp` function and then create a file using this name. Unfortunately this is not secure, because a different process may create a file with this name in the time between the call to :func:`mktemp` and the subsequent attempt to create the file by the first process. The solution is to combine the two steps and create the file immediately. This approach is used by :func:`mkstemp` and the other functions described above." -msgstr "" +msgid "" +"A historical way to create temporary files was to first generate a file name " +"with the :func:`mktemp` function and then create a file using this name. " +"Unfortunately this is not secure, because a different process may create a " +"file with this name in the time between the call to :func:`mktemp` and the " +"subsequent attempt to create the file by the first process. The solution is " +"to combine the two steps and create the file immediately. This approach is " +"used by :func:`mkstemp` and the other functions described above." +msgstr "" +"یک روش قدیمی برای ایجاد فایل‌های موقت این بود که ابتدا یک نام فایل با " +"تابع :func:`mktemp` تولید شود و سپس فایلی با استفاده از این نام ایجاد شود. " +"متأسفانه این روش امن نیست، زیرا ممکن است فرایند دیگری در فاصله بین " +"فراخوانی :func:`mktemp` و تلاش بعدی فرایند نخست برای ایجاد فایل، فایلی با " +"همین نام ایجاد کند. راه‌حل این است که این دو مرحله با هم ترکیب شوند و فایل " +"بلافاصله ایجاد شود. این رویکرد در :func:`mkstemp` و سایر تابع‌هایی که در بالا " +"توضیح داده شده‌اند، به کار می‌رود." msgid "Use :func:`mkstemp` instead." -msgstr "" +msgstr "به‌جای آن از :func:`mkstemp` استفاده کنید." -msgid "Return an absolute pathname of a file that did not exist at the time the call is made. The *prefix*, *suffix*, and *dir* arguments are similar to those of :func:`mkstemp`, except that bytes file names, ``suffix=None`` and ``prefix=None`` are not supported." +msgid "" +"Return an absolute pathname of a file that did not exist at the time the call " +"is made. The *prefix*, *suffix*, and *dir* arguments are similar to those " +"of :func:`mkstemp`, except that bytes file names, ``suffix=None`` and " +"``prefix=None`` are not supported." msgstr "" +"مسیر مطلق فایلی را برمی‌گرداند که در زمان انجام فراخوانی وجود نداشت. " +"آرگومان‌های *prefix*، *suffix* و *dir* مشابه آرگومان‌های :func:`mkstemp` هستند، " +"با این تفاوت که از نام فایل‌های بایتی، ``suffix=None`` و ``prefix=None`` " +"پشتیبانی نمی‌شود." -msgid "Use of this function may introduce a security hole in your program. By the time you get around to doing anything with the file name it returns, someone else may have beaten you to the punch. :func:`mktemp` usage can be replaced easily with :func:`NamedTemporaryFile`, passing it the ``delete=False`` parameter::" -msgstr "" +msgid "" +"Use of this function may introduce a security hole in your program. By the " +"time you get around to doing anything with the file name it returns, someone " +"else may have beaten you to the punch. :func:`mktemp` usage can be replaced " +"easily with :func:`NamedTemporaryFile`, passing it the ``delete=False`` " +"parameter::" +msgstr "" +"استفاده از این تابع ممکن است یک حفره‌ی امنیتی در برنامه‌ی شما ایجاد کند. تا " +"بخواهید کاری با نام فایلی که برمی‌گرداند انجام دهید، ممکن است شخص دیگری " +"پیش‌دستی کرده باشد. می‌توان استفاده از :func:`mktemp` را به‌راحتی " +"با :func:`NamedTemporaryFile` جایگزین کرد و پارامتر ``delete=False`` را به آن " +"ارسال کرد::" msgid "" ">>> f = NamedTemporaryFile(delete=False)\n" @@ -326,12 +791,21 @@ msgid "" ">>> os.path.exists(f.name)\n" "False" msgstr "" +">>> f = NamedTemporaryFile(delete=False)\n" +">>> f.name\n" +"'/tmp/tmptjujjt'\n" +">>> f.write(b\"Hello World!\\n\")\n" +"13\n" +">>> f.close()\n" +">>> os.unlink(f.name)\n" +">>> os.path.exists(f.name)\n" +"False" msgid "temporary" -msgstr "" +msgstr "موقت" msgid "file name" -msgstr "" +msgstr "نام فایل" msgid "file" -msgstr "" +msgstr "فایل" diff --git a/library/termios.po b/library/termios.po index 84c0d3cdd..c25289229 100644 --- a/library/termios.po +++ b/library/termios.po @@ -25,67 +25,160 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!termios` --- POSIX style tty control" -msgstr "" +msgstr ":mod:`!termios` --- کنترل tty به سبک POSIX" -msgid "This module provides an interface to the POSIX calls for tty I/O control. For a complete description of these calls, see :manpage:`termios(3)` Unix manual page. It is only available for those Unix versions that support POSIX *termios* style tty I/O control configured during installation." +msgid "" +"This module provides an interface to the POSIX calls for tty I/O control. " +"For a complete description of these calls, see :manpage:`termios(3)` Unix " +"manual page. It is only available for those Unix versions that support " +"POSIX *termios* style tty I/O control configured during installation." msgstr "" +"این ماژول رابطی برای فراخوانی‌های POSIX جهت کنترل ورودی/خروجی tty فراهم " +"می‌کند. برای توضیح کامل این فراخوانی‌ها، صفحه‌ی راهنمای یونیکس " +":manpage:`termios(3)` را ببینید. این ماژول تنها برای نسخه‌هایی از یونیکس در " +"دسترس است که از کنترل ورودی/خروجی tty به‌سبک *termios* POSIX پشتیبانی " +"می‌کنند و در هنگام نصب پیکربندی شده‌اند." msgid "Availability" -msgstr "" +msgstr "دسترسی" -msgid "All functions in this module take a file descriptor *fd* as their first argument. This can be an integer file descriptor, such as returned by ``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself." +msgid "" +"All functions in this module take a file descriptor *fd* as their first " +"argument. This can be an integer file descriptor, such as returned by " +"``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` " +"itself." msgstr "" +"تمام توابع این ماژول یک توصیف‌گر فایل (file descriptor) با نام *fd* را " +"به‌عنوان نخستین آرگومان خود دریافت می‌کنند. این می‌تواند یک توصیف‌گر فایل از" +" نوع عدد صحیح باشد، مانند آنچه ``sys.stdin.fileno()`` بازمی‌گرداند، یا یک " +":term:`file object`، مانند خود ``sys.stdin``." -msgid "This module also defines all the constants needed to work with the functions provided here; these have the same name as their counterparts in C. Please refer to your system documentation for more information on using these terminal control interfaces." +msgid "" +"This module also defines all the constants needed to work with the functions" +" provided here; these have the same name as their counterparts in C. Please" +" refer to your system documentation for more information on using these " +"terminal control interfaces." msgstr "" +"این ماژول همچنین تمام ثابت‌های مورد نیاز برای کار با توابع ارائه‌شده در " +"اینجا را تعریف می‌کند؛ این ثابت‌ها همان نام همتاهایشان در C را دارند. لطفاً " +"برای اطلاعات بیشتر درباره استفاده از این رابط‌های کنترل پایانه، به مستندات " +"سیستم خود مراجعه کنید." msgid "The module defines the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را تعریف می‌کند:" -msgid "Return a list containing the tty attributes for file descriptor *fd*, as follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is a list of the tty special characters (each a string of length 1, except the items with indices :const:`VMIN` and :const:`VTIME`, which are integers when these fields are defined). The interpretation of the flags and the speeds as well as the indexing in the *cc* array must be done using the symbolic constants defined in the :mod:`!termios` module." -msgstr "" +msgid "" +"Return a list containing the tty attributes for file descriptor *fd*, as " +"follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is " +"a list of the tty special characters (each a string of length 1, except the " +"items with indices :const:`VMIN` and :const:`VTIME`, which are integers when" +" these fields are defined). The interpretation of the flags and the speeds " +"as well as the indexing in the *cc* array must be done using the symbolic " +"constants defined in the :mod:`!termios` module." +msgstr "" +"فهرستی حاوی ویژگی‌های tty برای توصیف‌گر فایل *fd* برمی‌گرداند، به این صورت: " +"``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` که در آن *cc* فهرستی از" +" نویسه‌های ویژه tty است (هرکدام رشته‌ای به طول ۱، به‌جز آیتم‌های دارای " +"اندیس‌های :const:`VMIN` و :const:`VTIME`، که وقتی این فیلدها تعریف شده " +"باشند، عدد صحیح هستند). تفسیر پرچم‌ها و سرعت‌ها و همچنین اندیس‌دهی در آرایه‌ی" +" *cc* باید با استفاده از ثابت‌های نمادین تعریف‌شده در ماژول :mod:`!termios` " +"انجام شود." -msgid "Set the tty attributes for file descriptor *fd* from the *attributes*, which is a list like the one returned by :func:`tcgetattr`. The *when* argument determines when the attributes are changed:" +msgid "" +"Set the tty attributes for file descriptor *fd* from the *attributes*, which" +" is a list like the one returned by :func:`tcgetattr`. The *when* argument " +"determines when the attributes are changed:" msgstr "" +"ویژگی‌های tty را برای توصیف‌گر فایل *fd* با استفاده از *attributes* تنظیم " +"کنید، که فهرستی مانند فهرست بازگردانده‌شده توسط :func:`tcgetattr` است. " +"آرگومان *when* تعیین می‌کند که ویژگی‌ها چه زمانی تغییر کنند:" msgid "Change attributes immediately." -msgstr "" +msgstr "ویژگی‌ها را بلافاصله تغییر دهید." msgid "Change attributes after transmitting all queued output." -msgstr "" +msgstr "تغییر ویژگی‌ها پس از ارسال تمام خروجی صف‌شده." -msgid "Change attributes after transmitting all queued output and discarding all queued input." +msgid "" +"Change attributes after transmitting all queued output and discarding all " +"queued input." msgstr "" +"ویژگی‌ها را پس از ارسال تمام خروجی‌های در صف و دور ریختن تمام ورودی‌های در " +"صف تغییر دهید." -msgid "Send a break on file descriptor *fd*. A zero *duration* sends a break for 0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning." +msgid "" +"Send a break on file descriptor *fd*. A zero *duration* sends a break for " +"0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning." msgstr "" +"یک break را روی توصیف‌گر فایل *fd* ارسال کنید. یک *duration* صفر، یک break " +"را برای ۰٫۲۵ تا ۰٫۵ ثانیه ارسال می‌کند؛ یک *duration* غیرصفر معنایی وابسته " +"به سیستم دارد." -msgid "Wait until all output written to file descriptor *fd* has been transmitted." -msgstr "" +msgid "" +"Wait until all output written to file descriptor *fd* has been transmitted." +msgstr "صبر کنید تا تمام خروجی نوشته‌شده در توصیف‌گر فایل *fd* ارسال شود." -msgid "Discard queued data on file descriptor *fd*. The *queue* selector specifies which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for the output queue, or :const:`TCIOFLUSH` for both queues." +msgid "" +"Discard queued data on file descriptor *fd*. The *queue* selector specifies" +" which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for " +"the output queue, or :const:`TCIOFLUSH` for both queues." msgstr "" +"داده‌های در صف روی توصیف‌گر فایل *fd* را دور بریزید. انتخاب‌گر *queue* مشخص " +"می‌کند کدام صف: :const:`TCIFLUSH` برای صف ورودی، :const:`TCOFLUSH` برای صف " +"خروجی، یا :const:`TCIOFLUSH` برای هر دو صف." -msgid "Suspend or resume input or output on file descriptor *fd*. The *action* argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input." +msgid "" +"Suspend or resume input or output on file descriptor *fd*. The *action* " +"argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart" +" output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart " +"input." msgstr "" +"تعلیق یا ازسرگیری ورودی یا خروجی روی توصیف‌گر فایل *fd*. آرگومان *action* " +"می‌تواند برای تعلیق خروجی :const:`TCOOFF`، برای ازسرگیری خروجی " +":const:`TCOON`، برای تعلیق ورودی :const:`TCIOFF`، یا برای ازسرگیری ورودی " +":const:`TCION` باشد." -msgid "Return a tuple ``(ws_row, ws_col)`` containing the tty window size for file descriptor *fd*. Requires :const:`termios.TIOCGWINSZ` or :const:`termios.TIOCGSIZE`." +msgid "" +"Return a tuple ``(ws_row, ws_col)`` containing the tty window size for file " +"descriptor *fd*. Requires :const:`termios.TIOCGWINSZ` or " +":const:`termios.TIOCGSIZE`." msgstr "" +"یک تاپل ``(ws_row, ws_col)`` بازمی‌گرداند که حاوی اندازه‌ی پنجره‌ی tty برای " +"توصیف‌گر فایل *fd* است. نیازمند :const:`termios.TIOCGWINSZ` یا " +":const:`termios.TIOCGSIZE` است." -msgid "Set the tty window size for file descriptor *fd* from *winsize*, which is a two-item tuple ``(ws_row, ws_col)`` like the one returned by :func:`tcgetwinsize`. Requires at least one of the pairs (:const:`termios.TIOCGWINSZ`, :const:`termios.TIOCSWINSZ`); (:const:`termios.TIOCGSIZE`, :const:`termios.TIOCSSIZE`) to be defined." -msgstr "" +msgid "" +"Set the tty window size for file descriptor *fd* from *winsize*, which is a " +"two-item tuple ``(ws_row, ws_col)`` like the one returned by " +":func:`tcgetwinsize`. Requires at least one of the pairs " +"(:const:`termios.TIOCGWINSZ`, :const:`termios.TIOCSWINSZ`); " +"(:const:`termios.TIOCGSIZE`, :const:`termios.TIOCSSIZE`) to be defined." +msgstr "" +"اندازه‌ی پنجره‌ی tty برای توصیف‌گر فایل *fd* را از *winsize* تنظیم می‌کند، " +"که یک تاپلدو آیتمی ``(ws_row, ws_col)`` مانند آنچه توسط " +":func:`tcgetwinsize` برگردانده می‌شود، است. نیاز است حداقل یکی از جفت‌های " +"(:const:`termios.TIOCGWINSZ`، :const:`termios.TIOCSWINSZ`)؛ " +"(:const:`termios.TIOCGSIZE`، :const:`termios.TIOCSSIZE`) تعریف شده باشد." msgid "Module :mod:`tty`" -msgstr "" +msgstr "ماژول :mod:`tty`" msgid "Convenience functions for common terminal control operations." -msgstr "" +msgstr "توابع تسهیل‌کننده برای عملیات رایج کنترل پایانه." msgid "Example" -msgstr "" +msgstr "مثال" -msgid "Here's a function that prompts for a password with echoing turned off. Note the technique using a separate :func:`tcgetattr` call and a :keyword:`try` ... :keyword:`finally` statement to ensure that the old tty attributes are restored exactly no matter what happens::" +msgid "" +"Here's a function that prompts for a password with echoing turned off. Note" +" the technique using a separate :func:`tcgetattr` call and a :keyword:`try` " +"... :keyword:`finally` statement to ensure that the old tty attributes are " +"restored exactly no matter what happens::" msgstr "" +"در اینجا تابعی آمده است که گذرواژه را با بازتاب غیرفعال درخواست می‌کند. به " +"روش استفاده از یک فراخوانی جداگانه :func:`tcgetattr` و یک دستور " +":keyword:`try` ... :keyword:`finally` توجه کنید تا اطمینان حاصل شود که " +"ویژگی‌های قدیمی tty، صرف‌نظر از هر اتفاقی که بیفتد، دقیقاً بازیابی می‌شوند::" msgid "" "def getpass(prompt=\"Password: \"):\n" @@ -101,12 +194,24 @@ msgid "" " termios.tcsetattr(fd, termios.TCSADRAIN, old)\n" " return passwd" msgstr "" +"def getpass(prompt=\"Password: \"):\n" +" import termios, sys\n" +" fd = sys.stdin.fileno()\n" +" old = termios.tcgetattr(fd)\n" +" new = termios.tcgetattr(fd)\n" +" new[3] = new[3] & ~termios.ECHO # lflags\n" +" try:\n" +" termios.tcsetattr(fd, termios.TCSADRAIN, new)\n" +" passwd = input(prompt)\n" +" finally:\n" +" termios.tcsetattr(fd, termios.TCSADRAIN, old)\n" +" return passwd" msgid "POSIX" -msgstr "" +msgstr "POSIX" msgid "I/O control" -msgstr "" +msgstr "کنترل ورودی/خروجی" msgid "tty" -msgstr "" +msgstr "tty" diff --git a/library/test.po b/library/test.po index 5f294c153..c6bf609d5 100644 --- a/library/test.po +++ b/library/test.po @@ -24,37 +24,86 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!test` --- Regression tests package for Python" -msgstr "" +msgstr ":mod:`!test` --- بسته آزمون‌های رگرسیون برای پایتون" -msgid "The :mod:`!test` package is meant for internal use by Python only. It is documented for the benefit of the core developers of Python. Any use of this package outside of Python's standard library is discouraged as code mentioned here can change or be removed without notice between releases of Python." -msgstr "" +msgid "" +"The :mod:`!test` package is meant for internal use by Python only. It is " +"documented for the benefit of the core developers of Python. Any use of this" +" package outside of Python's standard library is discouraged as code " +"mentioned here can change or be removed without notice between releases of " +"Python." +msgstr "" +"بسته‌ی :mod:`!test` فقط برای استفاده‌ی داخلی توسط پایتون در نظر گرفته شده " +"است. این بسته به‌منظور بهره‌مندی توسعه‌دهندگان اصلی پایتون مستند شده است. " +"هرگونه استفاده از این بسته خارج از کتابخانه‌ی استاندارد پایتون توصیه " +"نمی‌شود، زیرا کد ذکرشده در اینجا ممکن است بین نسخه‌های پایتون بدون اطلاع " +"تغییر کند یا حذف شود." -msgid "The :mod:`!test` package contains all regression tests for Python as well as the modules :mod:`test.support` and :mod:`test.regrtest`. :mod:`test.support` is used to enhance your tests while :mod:`test.regrtest` drives the testing suite." +msgid "" +"The :mod:`!test` package contains all regression tests for Python as well as" +" the modules :mod:`test.support` and :mod:`test.regrtest`. " +":mod:`test.support` is used to enhance your tests while :mod:`test.regrtest`" +" drives the testing suite." msgstr "" +"بسته‌ی :mod:`!test` شامل تمام آزمون‌های رگرسیون پایتون و همچنین ماژول‌های " +":mod:`test.support` و :mod:`test.regrtest` است. از :mod:`test.support` برای " +"بهبود آزمون‌های شما استفاده می‌شود، در حالی که :mod:`test.regrtest` مجموعه‌ی" +" آزمون را راهبری می‌کند." -msgid "Each module in the :mod:`!test` package whose name starts with ``test_`` is a testing suite for a specific module or feature. All new tests should be written using the :mod:`unittest` or :mod:`doctest` module. Some older tests are written using a \"traditional\" testing style that compares output printed to ``sys.stdout``; this style of test is considered deprecated." -msgstr "" +msgid "" +"Each module in the :mod:`!test` package whose name starts with ``test_`` is " +"a testing suite for a specific module or feature. All new tests should be " +"written using the :mod:`unittest` or :mod:`doctest` module. Some older " +"tests are written using a \"traditional\" testing style that compares output" +" printed to ``sys.stdout``; this style of test is considered deprecated." +msgstr "" +"هر ماژول در بسته‌ی :mod:`!test` که نام آن با ``test_`` شروع می‌شود، یک " +"مجموعه‌ی آزمون برای یک ماژول یا قابلیت مشخص است. همه‌ی آزمون‌های جدید باید با " +"استفاده از ماژول :mod:`unittest` یا :mod:`doctest` نوشته شوند. برخی آزمون‌های " +"قدیمی‌تر با استفاده از شیوه‌ی آزمون‌نویسی «سنتی» نوشته شده‌اند که خروجی " +"چاپ‌شده در ``sys.stdout`` را مقایسه می‌کند؛ این شیوه از آزمون، منسوخ محسوب " +"می‌شود." msgid "Module :mod:`unittest`" -msgstr "" +msgstr "ماژول :mod:`unittest`" msgid "Writing PyUnit regression tests." -msgstr "" +msgstr "نوشتن آزمون‌های بازگشتی PyUnit." msgid "Module :mod:`doctest`" -msgstr "" +msgstr "ماژول :mod:`doctest`" msgid "Tests embedded in documentation strings." -msgstr "" +msgstr "آزمون‌های نهفته در رشته‌های مستندسازی." msgid "Writing Unit Tests for the :mod:`!test` package" -msgstr "" +msgstr "نوشتن آزمون واحد‌ها برای بسته :mod:`!test`" -msgid "It is preferred that tests that use the :mod:`unittest` module follow a few guidelines. One is to name the test module by starting it with ``test_`` and end it with the name of the module being tested. The test methods in the test module should start with ``test_`` and end with a description of what the method is testing. This is needed so that the methods are recognized by the test driver as test methods. Also, no documentation string for the method should be included. A comment (such as ``# Tests function returns only True or False``) should be used to provide documentation for test methods. This is done because documentation strings get printed out if they exist and thus what test is being run is not stated." -msgstr "" +msgid "" +"It is preferred that tests that use the :mod:`unittest` module follow a few " +"guidelines. One is to name the test module by starting it with ``test_`` and" +" end it with the name of the module being tested. The test methods in the " +"test module should start with ``test_`` and end with a description of what " +"the method is testing. This is needed so that the methods are recognized by " +"the test driver as test methods. Also, no documentation string for the " +"method should be included. A comment (such as ``# Tests function returns " +"only True or False``) should be used to provide documentation for test " +"methods. This is done because documentation strings get printed out if they " +"exist and thus what test is being run is not stated." +msgstr "" +"ترجیح داده می‌شود آزمون‌هایی که از ماژول :mod:`unittest` استفاده می‌کنند، چند " +"دستورالعمل را رعایت کنند. یکی از این دستورالعمل‌ها این است که نام ماژول آزمون " +"با ``test_`` شروع شود و با نام ماژولی که آزمون می‌شود پایان یابد. متدهای آزمون " +"در ماژول آزمون باید با ``test_`` شروع شوند و با توصیفی از آنچه متد آزمون می‌کند " +"پایان یابند. این کار لازم است تا راه‌انداز آزمون متدها را به‌عنوان متدهای آزمون " +"شناسایی کند. همچنین نباید هیچ رشته‌ی مستندسازی برای متد درج شود. برای " +"مستندسازی متدهای آزمون باید از یک کامنت (مانند ``# Tests function returns only" +" True or False``) استفاده شود. این کار به این دلیل انجام می‌شود که رشته‌های " +"مستندسازی در صورت وجود چاپ می‌شوند و بنابراین مشخص نمی‌شود چه آزمونی در حال " +"اجرا است." msgid "A basic boilerplate is often used::" -msgstr "" +msgstr "اغلب از یک کد پیش‌ساخته (boilerplate) ساده استفاده می‌شود::" msgid "" "import unittest\n" @@ -88,39 +137,129 @@ msgid "" "if __name__ == '__main__':\n" " unittest.main()" msgstr "" +"import unittest\n" +"from test import support\n" +"\n" +"class MyTestCase1(unittest.TestCase):\n" +"\n" +" # Only use setUp() and tearDown() if necessary\n" +"\n" +" def setUp(self):\n" +" ... code to execute in preparation for tests ...\n" +"\n" +" def tearDown(self):\n" +" ... code to execute to clean up after tests ...\n" +"\n" +" def test_feature_one(self):\n" +" # Test feature one.\n" +" ... testing code ...\n" +"\n" +" def test_feature_two(self):\n" +" # Test feature two.\n" +" ... testing code ...\n" +"\n" +" ... more test methods ...\n" +"\n" +"class MyTestCase2(unittest.TestCase):\n" +" ... same structure as MyTestCase1 ...\n" +"\n" +"... more test classes ...\n" +"\n" +"if __name__ == '__main__':\n" +" unittest.main()" -msgid "This code pattern allows the testing suite to be run by :mod:`test.regrtest`, on its own as a script that supports the :mod:`unittest` CLI, or via the ``python -m unittest`` CLI." +msgid "" +"This code pattern allows the testing suite to be run by " +":mod:`test.regrtest`, on its own as a script that supports the " +":mod:`unittest` CLI, or via the ``python -m unittest`` CLI." msgstr "" +"این الگوی کد اجازه می‌دهد مجموعه آزمون توسط :mod:`test.regrtest`، به‌تنهایی " +"به‌عنوان اسکریپتی که از رابط خط فرمان :mod:`unittest` پشتیبانی می‌کند، یا از" +" طریق رابط خط فرمان ``python -m unittest`` اجرا شود." -msgid "The goal for regression testing is to try to break code. This leads to a few guidelines to be followed:" +msgid "" +"The goal for regression testing is to try to break code. This leads to a few" +" guidelines to be followed:" msgstr "" +"هدف از آزمون بازگشتی این است که تلاش کنید کد را بشکنید. این امر به چند " +"رهنمود منجر می‌شود که باید رعایت شوند:" -msgid "The testing suite should exercise all classes, functions, and constants. This includes not just the external API that is to be presented to the outside world but also \"private\" code." +msgid "" +"The testing suite should exercise all classes, functions, and constants. " +"This includes not just the external API that is to be presented to the " +"outside world but also \"private\" code." msgstr "" +"مجموعه آزمون باید همه کلاس‌ها، توابع و ثابت‌ها را آزمایش کند. این شامل " +"نه‌تنها API خارجی‌ای است که به دنیای بیرون ارائه می‌شود، بلکه شامل کد " +"«خصوصی» نیز می‌شود." -msgid "Whitebox testing (examining the code being tested when the tests are being written) is preferred. Blackbox testing (testing only the published user interface) is not complete enough to make sure all boundary and edge cases are tested." +msgid "" +"Whitebox testing (examining the code being tested when the tests are being " +"written) is preferred. Blackbox testing (testing only the published user " +"interface) is not complete enough to make sure all boundary and edge cases " +"are tested." msgstr "" +"آزمون جعبه‌سفید (بررسی کدِ تحت آزمون هنگام نوشتن آزمون‌ها) ترجیح داده " +"می‌شود. آزمون جعبه‌سیاه (آزمون تنها رابط کاربری منتشرشده) به اندازه کافی " +"کامل نیست تا اطمینان حاصل شود که همه‌ی موارد مرزی و لبه‌ای آزمایش شده‌اند." -msgid "Make sure all possible values are tested including invalid ones. This makes sure that not only all valid values are acceptable but also that improper values are handled correctly." +msgid "" +"Make sure all possible values are tested including invalid ones. This makes " +"sure that not only all valid values are acceptable but also that improper " +"values are handled correctly." msgstr "" +"اطمینان حاصل کنید که همه‌ی مقادیر ممکن، از جمله مقادیر نامعتبر، آزمایش " +"شده‌اند. این کار تضمین می‌کند که نه‌تنها همه‌ی مقادیر معتبر قابل‌قبول هستند، " +"بلکه مقادیر نامناسب نیز به‌درستی مدیریت می‌شوند." -msgid "Exhaust as many code paths as possible. Test where branching occurs and thus tailor input to make sure as many different paths through the code are taken." +msgid "" +"Exhaust as many code paths as possible. Test where branching occurs and thus" +" tailor input to make sure as many different paths through the code are " +"taken." msgstr "" +"تا حد ممکن مسیرهای کد را پیمایش کنید. محل‌های وقوع شاخه‌بندی را آزمون کنید " +"و بدین‌ترتیب ورودی را به‌گونه‌ای تنظیم کنید که اطمینان حاصل شود تا حد ممکن " +"مسیرهای متفاوتی از کد طی می‌شود." -msgid "Add an explicit test for any bugs discovered for the tested code. This will make sure that the error does not crop up again if the code is changed in the future." +msgid "" +"Add an explicit test for any bugs discovered for the tested code. This will " +"make sure that the error does not crop up again if the code is changed in " +"the future." msgstr "" +"برای هر اشکالی که در کد آزمون‌شده کشف می‌شود، یک آزمون صریح اضافه کنید. این کار " +"اطمینان می‌دهد که اگر کد در آینده تغییر کند، خطا دوباره ظاهر نمی‌شود." -msgid "Make sure to clean up after your tests (such as close and remove all temporary files)." +msgid "" +"Make sure to clean up after your tests (such as close and remove all " +"temporary files)." msgstr "" +"حتماً پس از آزمون‌های خود پاک‌سازی کنید (مانند بستن و حذف همه‌ی فایل‌های " +"موقت)." -msgid "If a test is dependent on a specific condition of the operating system then verify the condition already exists before attempting the test." +msgid "" +"If a test is dependent on a specific condition of the operating system then " +"verify the condition already exists before attempting the test." msgstr "" +"اگر آزمونی به شرط خاصی از سیستم‌عامل وابسته است، پیش از اقدام به اجرای " +"آزمون، تأیید کنید که آن شرط از قبل وجود دارد." -msgid "Import as few modules as possible and do it as soon as possible. This minimizes external dependencies of tests and also minimizes possible anomalous behavior from side-effects of importing a module." +msgid "" +"Import as few modules as possible and do it as soon as possible. This " +"minimizes external dependencies of tests and also minimizes possible " +"anomalous behavior from side-effects of importing a module." msgstr "" +"تا حد امکان ماژول‌های کمتری را ایمپورت کنید و این کار را در اسرع وقت انجام " +"دهید. این کار هم وابستگی‌های خارجی آزمون‌ها و هم رفتار ناهنجار احتمالی ناشی از" +" عوارض جانبی ایمپورت کردن یک ماژول را به حداقل می‌رساند." -msgid "Try to maximize code reuse. On occasion, tests will vary by something as small as what type of input is used. Minimize code duplication by subclassing a basic test class with a class that specifies the input::" +msgid "" +"Try to maximize code reuse. On occasion, tests will vary by something as " +"small as what type of input is used. Minimize code duplication by " +"subclassing a basic test class with a class that specifies the input::" msgstr "" +"سعی کنید بازاستفاده از کد را به حداکثر برسانید. گاهی ممکن است آزمون‌ها تنها به" +" اندازه‌ی نوع ورودی استفاده‌شده متفاوت باشند. با ایجاد زیرکلاسی از یک کلاس " +"آزمون پایه که ورودی را مشخص می‌کند، تکرار کد را به حداقل برسانید::" msgid "" "class TestFuncAcceptsSequencesMixin:\n" @@ -139,207 +278,430 @@ msgid "" "class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n" " arg = (1, 2, 3)" msgstr "" +"class TestFuncAcceptsSequencesMixin:\n" +"\n" +" func = mySuperWhammyFunction\n" +"\n" +" def test_func(self):\n" +" self.func(self.arg)\n" +"\n" +"class AcceptLists(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n" +" arg = [1, 2, 3]\n" +"\n" +"class AcceptStrings(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n" +" arg = 'abc'\n" +"\n" +"class AcceptTuples(TestFuncAcceptsSequencesMixin, unittest.TestCase):\n" +" arg = (1, 2, 3)" -msgid "When using this pattern, remember that all classes that inherit from :class:`unittest.TestCase` are run as tests. The :class:`!TestFuncAcceptsSequencesMixin` class in the example above does not have any data and so can't be run by itself, thus it does not inherit from :class:`unittest.TestCase`." -msgstr "" +msgid "" +"When using this pattern, remember that all classes that inherit from " +":class:`unittest.TestCase` are run as tests. The " +":class:`!TestFuncAcceptsSequencesMixin` class in the example above does not " +"have any data and so can't be run by itself, thus it does not inherit from " +":class:`unittest.TestCase`." +msgstr "" +"هنگام استفاده از این الگو، به یاد داشته باشید که همه کلاس‌هایی که از " +":class:`unittest.TestCase` ارث می‌برند، به‌عنوان آزمون اجرا می‌شوند. کلاس " +":class:`!TestFuncAcceptsSequencesMixin` در مثال بالا هیچ داده‌ای ندارد و " +"بنابراین نمی‌تواند به‌تنهایی اجرا شود، از این رو از " +":class:`unittest.TestCase` ارث نمی‌برد." msgid "Test Driven Development" -msgstr "" +msgstr "توسعه آزمون‌محور" msgid "A book by Kent Beck on writing tests before code." -msgstr "" +msgstr "کتابی از کنت بک درباره‌ی نوشتن آزمون‌ها پیش از کد." msgid "Running tests using the command-line interface" -msgstr "" +msgstr "اجرای آزمون‌ها با استفاده از رابط خط فرمان" -msgid "The :mod:`!test` package can be run as a script to drive Python's regression test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m test.regrtest` used in previous Python versions still works. Running the script by itself automatically starts running all regression tests in the :mod:`!test` package. It does this by finding all modules in the package whose name starts with ``test_``, importing them, and executing the function :func:`test_main` if present or loading the tests via unittest.TestLoader.loadTestsFromModule if ``test_main`` does not exist. The names of tests to execute may also be passed to the script. Specifying a single regression test (:program:`python -m test test_spam`) will minimize output and only print whether the test passed or failed." -msgstr "" +msgid "" +"The :mod:`!test` package can be run as a script to drive Python's regression" +" test suite, thanks to the :option:`-m` option: :program:`python -m test`. " +"Under the hood, it uses :mod:`!test.regrtest`; the call :program:`python -m " +"test.regrtest` used in previous Python versions still works. Running the " +"script by itself automatically starts running all regression tests in the " +":mod:`!test` package. It does this by finding all modules in the package " +"whose name starts with ``test_``, importing them, and executing the function" +" :func:`test_main` if present or loading the tests via " +"unittest.TestLoader.loadTestsFromModule if ``test_main`` does not exist. " +"The names of tests to execute may also be passed to the script. Specifying a" +" single regression test (:program:`python -m test test_spam`) will minimize " +"output and only print whether the test passed or failed." +msgstr "" +"بسته‌ی :mod:`!test` را می‌توان به‌کمک گزینه‌ی :option:`-m` به‌صورت یک اسکریپت " +"برای اجرای مجموعه آزمون‌های رگرسیون پایتون اجرا کرد: :program:`python -m " +"test`. در پشت صحنه، این بسته از :mod:`!test.regrtest` استفاده می‌کند؛ " +"فراخوانی :program:`python -m test.regrtest` که در نسخه‌های پیشین پایتون " +"استفاده می‌شد، همچنان کار می‌کند. اجرای اسکریپت به‌تنهایی به‌طور خودکار " +"اجرای همه‌ی آزمون‌های رگرسیون موجود در بسته‌ی :mod:`!test` را آغاز می‌کند. این" +" کار با یافتن همه‌ی ماژول‌های موجود در بسته که نامشان با ``test_`` شروع " +"می‌شود، ایمپورت کردن آن‌ها، و اجرای تابع :func:`test_main` در صورت وجود، یا " +"بارگذاری آزمون‌ها از طریق unittest.TestLoader.loadTestsFromModule در صورت " +"نبود ``test_main`` انجام می‌شود. نام آزمون‌های مورد نظر برای اجرا نیز " +"می‌تواند به اسکریپت داده شود. مشخص کردن یک آزمون رگرسیون به‌صورت تکی " +"(:program:`python -m test test_spam`) خروجی را به حداقل می‌رساند و فقط چاپ " +"می‌کند که آزمون موفقیت‌آمیز بوده یا شکست خورده است." -msgid "Running :mod:`!test` directly allows what resources are available for tests to use to be set. You do this by using the ``-u`` command-line option. Specifying ``all`` as the value for the ``-u`` option enables all possible resources: :program:`python -m test -uall`. If all but one resource is desired (a more common case), a comma-separated list of resources that are not desired may be listed after ``all``. The command :program:`python -m test -uall,-audio,-largefile` will run :mod:`!test` with all resources except the ``audio`` and ``largefile`` resources. For a list of all resources and more command-line options, run :program:`python -m test -h`." -msgstr "" +msgid "" +"Running :mod:`!test` directly allows what resources are available for tests " +"to use to be set. You do this by using the ``-u`` command-line option. " +"Specifying ``all`` as the value for the ``-u`` option enables all possible " +"resources: :program:`python -m test -uall`. If all but one resource is " +"desired (a more common case), a comma-separated list of resources that are " +"not desired may be listed after ``all``. The command :program:`python -m " +"test -uall,-audio,-largefile` will run :mod:`!test` with all resources " +"except the ``audio`` and ``largefile`` resources. For a list of all " +"resources and more command-line options, run :program:`python -m test -h`." +msgstr "" +"اجرای مستقیم :mod:`!test` به شما امکان می‌دهد تعیین کنید چه منابعی برای " +"استفاده در آزمون‌ها در دسترس باشند. این کار را با استفاده از گزینه ``-u`` خط" +" فرمان انجام می‌دهید. مشخص کردن ``all`` به‌عنوان مقدار گزینه ``-u`` تمام " +"منابع ممکن را فعال می‌کند: :program:`python -m test -uall`. اگر همه منابع " +"به‌جز یک منبع مطلوب باشند (حالت رایج‌تر)، می‌توانید فهرستی جداشده با ویرگول " +"از منابعی که مطلوب نیستند را پس از ``all`` ذکر کنید. فرمان :program:`python " +"-m test -uall,-audio,-largefile`، :mod:`!test` را با همه منابع به‌جز منابع " +"``audio`` و ``largefile`` اجرا می‌کند. برای دریافت فهرستی از همه منابع و " +"گزینه‌های بیشتر خط فرمان، :program:`python -m test -h` را اجرا کنید." -msgid "Some other ways to execute the regression tests depend on what platform the tests are being executed on. On Unix, you can run :program:`make test` at the top-level directory where Python was built. On Windows, executing :program:`rt.bat` from your :file:`PCbuild` directory will run all regression tests." -msgstr "" +msgid "" +"Some other ways to execute the regression tests depend on what platform the " +"tests are being executed on. On Unix, you can run :program:`make test` at " +"the top-level directory where Python was built. On Windows, executing " +":program:`rt.bat` from your :file:`PCbuild` directory will run all " +"regression tests." +msgstr "" +"برخی روش‌های دیگر برای اجرای آزمون‌های رگرسیون، به این بستگی دارند که " +"آزمون‌ها روی کدام سکو اجرا می‌شوند. در یونیکس، می‌توانید :program:`make " +"test` را در پوشه‌ی سطح بالایی که پایتون در آن ساخته شده است اجرا کنید. در " +"ویندوز، اجرای :program:`rt.bat` از پوشه‌ی :file:`PCbuild` خود، تمام " +"آزمون‌های رگرسیون را اجرا خواهد کرد." -msgid "Output is colorized by default and can be :ref:`controlled using environment variables `." +msgid "" +"Output is colorized by default and can be :ref:`controlled using environment" +" variables `." msgstr "" +"خروجی به‌طور پیش‌فرض رنگی است و می‌توان آن را :ref:`با استفاده از متغیرهای " +"محیطی کنترل کرد `." msgid ":mod:`!test.support` --- Utilities for the Python test suite" -msgstr "" +msgstr ":mod:`!test.support` --- ابزارهایی برای مجموعه آزمون پایتون" -msgid "The :mod:`!test.support` module provides support for Python's regression test suite." +msgid "" +"The :mod:`!test.support` module provides support for Python's regression " +"test suite." msgstr "" +"ماژول :mod:`!test.support` از مجموعه آزمون‌های رگرسیون پایتون پشتیبانی " +"می‌کند." -msgid ":mod:`!test.support` is not a public module. It is documented here to help Python developers write tests. The API of this module is subject to change without backwards compatibility concerns between releases." +msgid "" +":mod:`!test.support` is not a public module. It is documented here to help " +"Python developers write tests. The API of this module is subject to change " +"without backwards compatibility concerns between releases." msgstr "" +":mod:`!test.support` یک ماژول عمومی نیست. این ماژول در اینجا مستند شده است " +"تا به توسعه‌دهندگان پایتون در نوشتن آزمون‌ها کمک کند. API این ماژول در معرض " +"تغییر است و ممکن است بین نسخه‌ها بدون ملاحظات سازگاری با نسخه‌های پیشین " +"تغییر کند." msgid "This module defines the following exceptions:" -msgstr "" +msgstr "این ماژول استثناهای زیر را تعریف می‌کند:" -msgid "Exception to be raised when a test fails. This is deprecated in favor of :mod:`unittest`\\ -based tests and :class:`unittest.TestCase`'s assertion methods." +msgid "" +"Exception to be raised when a test fails. This is deprecated in favor of " +":mod:`unittest`\\ -based tests and :class:`unittest.TestCase`'s assertion " +"methods." msgstr "" +"استثنایی که هنگام شکست یک آزمون پرتاب می‌شود. این استثنا به نفع آزمون‌های مبتنی " +"بر :mod:`unittest` و متدهای ادعا (assertion) در :class:`unittest.TestCase` " +"منسوخ شده است." -msgid "Subclass of :exc:`unittest.SkipTest`. Raised when a resource (such as a network connection) is not available. Raised by the :func:`requires` function." +msgid "" +"Subclass of :exc:`unittest.SkipTest`. Raised when a resource (such as a " +"network connection) is not available. Raised by the :func:`requires` " +"function." msgstr "" +"زیرکلاسی از :exc:`unittest.SkipTest`. هنگامی که یک منبع (مانند اتصال شبکه) " +"در دسترس نباشد، پرتاب می‌شود. توسط تابع :func:`requires` پرتاب می‌شود." msgid "The :mod:`!test.support` module defines the following constants:" -msgstr "" +msgstr "ماژول :mod:`!test.support` ثابت‌های زیر را تعریف می‌کند:" -msgid "``True`` when verbose output is enabled. Should be checked when more detailed information is desired about a running test. *verbose* is set by :mod:`test.regrtest`." +msgid "" +"``True`` when verbose output is enabled. Should be checked when more " +"detailed information is desired about a running test. *verbose* is set by " +":mod:`test.regrtest`." msgstr "" +"هنگامی که خروجی پرگو فعال باشد، ``True`` است. اگر اطلاعات دقیق‌تری درباره یک" +" آزمون در حال اجرا مورد نیاز باشد، باید بررسی شود. *verbose* توسط " +":mod:`test.regrtest` تنظیم می‌شود." msgid "``True`` if the running interpreter is Jython." -msgstr "" +msgstr "اگر مفسر در حال اجرا Jython باشد، ``True`` است." msgid "``True`` if ``sys.platform`` is ``android``." -msgstr "" +msgstr "اگر ``sys.platform`` برابر ``android`` باشد، ``True`` است." msgid "``True`` if ``sys.platform`` is ``emscripten``." -msgstr "" +msgstr "``True`` اگر ``sys.platform`` برابر ``emscripten`` باشد." msgid "``True`` if ``sys.platform`` is ``wasi``." -msgstr "" +msgstr "``True`` اگر ``sys.platform`` برابر ``wasi`` باشد." msgid "``True`` if ``sys.platform`` is ``ios``, ``tvos``, or ``watchos``." msgstr "" +"اگر ``sys.platform`` برابر ``ios``، ``tvos`` یا ``watchos`` باشد، ``True`` " +"است." -msgid "``True`` if ``sys.platform`` is ``darwin`` or ``is_apple_mobile`` is ``True``." +msgid "" +"``True`` if ``sys.platform`` is ``darwin`` or ``is_apple_mobile`` is " +"``True``." msgstr "" +"اگر ``sys.platform`` برابر ``darwin`` باشد یا ``is_apple_mobile`` برابر " +"``True`` باشد، ``True`` است." msgid "Path for shell if not on Windows; otherwise ``None``." -msgstr "" +msgstr "مسیر پوسته اگر در ویندوز نباشد؛ در غیر این صورت ``None``." -msgid "Timeout in seconds for tests using a network server listening on the network local loopback interface like ``127.0.0.1``." +msgid "" +"Timeout in seconds for tests using a network server listening on the network" +" local loopback interface like ``127.0.0.1``." msgstr "" +"مهلت به ثانیه برای آزمون‌هایی که از یک سرور شبکه‌ای گوش‌دهنده به رابط حلقه " +"برگشت محلی شبکه مانند ``127.0.0.1`` استفاده می‌کنند." -msgid "The timeout is long enough to prevent test failure: it takes into account that the client and the server can run in different threads or even different processes." +msgid "" +"The timeout is long enough to prevent test failure: it takes into account " +"that the client and the server can run in different threads or even " +"different processes." msgstr "" +"مهلت زمانی به‌اندازه کافی طولانی است تا از شکست آزمون جلوگیری کند: در نظر " +"گرفته شده است که کارخواه و کارساز می‌توانند در نخ‌های مختلف یا حتی " +"فرآیندهای مختلف اجرا شوند." -msgid "The timeout should be long enough for :meth:`~socket.socket.connect`, :meth:`~socket.socket.recv` and :meth:`~socket.socket.send` methods of :class:`socket.socket`." +msgid "" +"The timeout should be long enough for :meth:`~socket.socket.connect`, " +":meth:`~socket.socket.recv` and :meth:`~socket.socket.send` methods of " +":class:`socket.socket`." msgstr "" +"مهلت زمانی باید برای متدهای :meth:`~socket.socket.connect`، " +":meth:`~socket.socket.recv` و :meth:`~socket.socket.send` در " +":class:`socket.socket` به‌اندازه کافی طولانی باشد." msgid "Its default value is 5 seconds." -msgstr "" +msgstr "مقدار پیش‌فرض آن ۵ ثانیه است." msgid "See also :data:`INTERNET_TIMEOUT`." -msgstr "" +msgstr "همچنین :data:`INTERNET_TIMEOUT` را ببینید." msgid "Timeout in seconds for network requests going to the internet." msgstr "" +"مهلت زمانی (timeout) بر حسب ثانیه برای درخواست‌های شبکه‌ای که به سمت اینترنت" +" ارسال می‌شوند." -msgid "The timeout is short enough to prevent a test to wait for too long if the internet request is blocked for whatever reason." +msgid "" +"The timeout is short enough to prevent a test to wait for too long if the " +"internet request is blocked for whatever reason." msgstr "" +"مهلت زمانی به‌اندازه کافی کوتاه است تا از انتظار بیش از حد یک آزمون در صورت " +"مسدود بودن درخواست اینترنتی به هر دلیلی جلوگیری کند." -msgid "Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as failed, but skip the test instead: see :func:`~test.support.socket_helper.transient_internet`." +msgid "" +"Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as " +"failed, but skip the test instead: see " +":func:`~test.support.socket_helper.transient_internet`." msgstr "" +"معمولاً، یک مهلت زمانی (timeout) با استفاده از :data:`INTERNET_TIMEOUT` نباید " +"یک آزمون را به‌عنوان شکست‌خورده علامت‌گذاری کند، بلکه باید در عوض آن آزمون را رد" +" کند: :func:`~test.support.socket_helper.transient_internet` را ببینید." msgid "Its default value is 1 minute." -msgstr "" +msgstr "مقدار پیش‌فرض آن ۱ دقیقه است." msgid "See also :data:`LOOPBACK_TIMEOUT`." -msgstr "" +msgstr "همچنین :data:`LOOPBACK_TIMEOUT` را ببینید." -msgid "Timeout in seconds to mark a test as failed if the test takes \"too long\"." +msgid "" +"Timeout in seconds to mark a test as failed if the test takes \"too long\"." msgstr "" +"مهلت به ثانیه برای علامت‌گذاری یک آزمون به‌عنوان شکست‌خورده، اگر اجرای آن " +"«بیش از حد طولانی» شود." -msgid "The timeout value depends on the regrtest ``--timeout`` command line option." +msgid "" +"The timeout value depends on the regrtest ``--timeout`` command line option." msgstr "" +"مقدار مهلت زمانی به گزینه‌ی خط فرمان ``--timeout`` در regrtest بستگی " +"دارد." -msgid "If a test using :data:`SHORT_TIMEOUT` starts to fail randomly on slow buildbots, use :data:`LONG_TIMEOUT` instead." +msgid "" +"If a test using :data:`SHORT_TIMEOUT` starts to fail randomly on slow " +"buildbots, use :data:`LONG_TIMEOUT` instead." msgstr "" +"اگر آزمونی که از :data:`SHORT_TIMEOUT` استفاده می‌کند، روی بات‌های ساخت کند " +"(buildbots) شروع به شکست‌های تصادفی کرد، به‌جای آن از :data:`LONG_TIMEOUT` " +"استفاده کنید." msgid "Its default value is 30 seconds." -msgstr "" +msgstr "مقدار پیش‌فرض آن ۳۰ ثانیه است." msgid "Timeout in seconds to detect when a test hangs." -msgstr "" +msgstr "مهلت بر حسب ثانیه برای تشخیص زمانی که یک آزمون آویزان می‌شود." -msgid "It is long enough to reduce the risk of test failure on the slowest Python buildbots. It should not be used to mark a test as failed if the test takes \"too long\". The timeout value depends on the regrtest ``--timeout`` command line option." +msgid "" +"It is long enough to reduce the risk of test failure on the slowest Python " +"buildbots. It should not be used to mark a test as failed if the test takes " +"\"too long\". The timeout value depends on the regrtest ``--timeout`` " +"command line option." msgstr "" +"این مقدار به‌اندازه‌ی کافی طولانی است تا خطر شکست آزمون در کندترین بات‌های " +"ساخت پایتون (buildbots) را کاهش دهد. نباید از آن برای علامت‌گذاری یک آزمون " +"به‌عنوان شکست‌خورده استفاده شود، اگر آزمون «بیش از حد» طول بکشد. مقدار مهلت " +"زمانی به گزینه‌ی خط فرمان ``--timeout`` در regrtest بستگی دارد." msgid "Its default value is 5 minutes." -msgstr "" +msgstr "مقدار پیش‌فرض آن ۵ دقیقه است." -msgid "See also :data:`LOOPBACK_TIMEOUT`, :data:`INTERNET_TIMEOUT` and :data:`SHORT_TIMEOUT`." +msgid "" +"See also :data:`LOOPBACK_TIMEOUT`, :data:`INTERNET_TIMEOUT` and " +":data:`SHORT_TIMEOUT`." msgstr "" +"همچنین ببینید :data:`LOOPBACK_TIMEOUT`، :data:`INTERNET_TIMEOUT` و " +":data:`SHORT_TIMEOUT`." msgid "Set when tests can be skipped when they are not useful for PGO." msgstr "" +"زمانی تنظیم می‌شود که بتوان آزمون‌ها را در صورتی که برای PGO مفید نیستند، رد" +" کرد." -msgid "A constant that is likely larger than the underlying OS pipe buffer size, to make writes blocking." +msgid "" +"A constant that is likely larger than the underlying OS pipe buffer size, to" +" make writes blocking." msgstr "" +"ثابتی که احتمالاً از اندازه‌ی بافر پایپ سیستم‌عامل زیرین بزرگ‌تر است، تا " +"نوشتن‌ها مسدودکننده شوند." -msgid "``True`` if Python was built with the :c:macro:`Py_DEBUG` macro defined, that is, if Python was :ref:`built in debug mode `." +msgid "" +"``True`` if Python was built with the :c:macro:`Py_DEBUG` macro defined, " +"that is, if Python was :ref:`built in debug mode `." msgstr "" +"``True`` اگر پایتون با تعریف‌شدن ماکروی :c:macro:`Py_DEBUG` ساخته شده باشد، " +"یعنی اگر پایتون :ref:`در حالت اشکال‌زدایی ساخته شده باشد `." -msgid "A constant that is likely larger than the underlying OS socket buffer size, to make writes blocking." +msgid "" +"A constant that is likely larger than the underlying OS socket buffer size, " +"to make writes blocking." msgstr "" +"ثابتی که احتمالاً از اندازه‌ی بافر سوکت سیستم‌عامل زیرین بزرگ‌تر است، تا " +"نوشتن‌ها مسدودکننده شوند." msgid "Set to the top level directory that contains :mod:`!test.support`." -msgstr "" +msgstr "به پوشه‌ی سطح بالایی که شامل :mod:`!test.support` است، تنظیم می‌شود." msgid "Set to the top level directory for the test package." -msgstr "" +msgstr "به پوشه‌ی سطح بالا برای بسته‌ی آزمون تنظیم شده است." msgid "Set to the ``data`` directory within the test package." -msgstr "" +msgstr "روی پوشه‌ی ``data`` درون بسته‌ی آزمون تنظیم شده است." msgid "Set to :data:`sys.maxsize` for big memory tests." -msgstr "" +msgstr "برای آزمون‌های حافظه‌ی بزرگ، آن را روی :data:`sys.maxsize` تنظیم کنید." -msgid "Set by :func:`set_memlimit` as the memory limit for big memory tests. Limited by :data:`MAX_Py_ssize_t`." +msgid "" +"Set by :func:`set_memlimit` as the memory limit for big memory tests. " +"Limited by :data:`MAX_Py_ssize_t`." msgstr "" +"توسط :func:`set_memlimit` به‌عنوان محدودیت حافظه برای آزمون‌های حافظه‌ی بزرگ " +"تنظیم می‌شود. با :data:`MAX_Py_ssize_t` محدود می‌شود." -msgid "Set by :func:`set_memlimit` as the memory limit for big memory tests. Not limited by :data:`MAX_Py_ssize_t`." +msgid "" +"Set by :func:`set_memlimit` as the memory limit for big memory tests. Not " +"limited by :data:`MAX_Py_ssize_t`." msgstr "" +"توسط :func:`set_memlimit` به‌عنوان محدودیت حافظه برای آزمایش‌های با حافظه‌ی " +"زیاد تنظیم می‌شود. به :data:`MAX_Py_ssize_t` محدود نیست." -msgid "Set to ``True`` if Python is built without docstrings (the :c:macro:`WITH_DOC_STRINGS` macro is not defined). See the :option:`configure --without-doc-strings <--without-doc-strings>` option." +msgid "" +"Set to ``True`` if Python is built without docstrings (the " +":c:macro:`WITH_DOC_STRINGS` macro is not defined). See the " +":option:`configure --without-doc-strings <--without-doc-strings>` option." msgstr "" +"اگر پایتون بدون رشته‌مستندها (docstrings) ساخته شده باشد (ماکروی " +":c:macro:`WITH_DOC_STRINGS` تعریف‌نشده باشد)، روی ``True`` تنظیم می‌شود. " +"گزینه‌ی :option:`configure --without-doc-strings <--without-doc-strings>` را" +" ببینید." msgid "See also the :data:`HAVE_DOCSTRINGS` variable." -msgstr "" +msgstr "همچنین متغیر :data:`HAVE_DOCSTRINGS` را ببینید." -msgid "Set to ``True`` if function docstrings are available. See the :option:`python -OO <-O>` option, which strips docstrings of functions implemented in Python." +msgid "" +"Set to ``True`` if function docstrings are available. See the " +":option:`python -OO <-O>` option, which strips docstrings of functions " +"implemented in Python." msgstr "" +"اگر رشته‌های مستندسازی توابع در دسترس باشند، روی ``True`` تنظیم " +"می‌شود. گزینه‌ی :option:`python -OO <-O>` را ببینید، که رشته‌های مستندسازی " +"توابع پیاده‌سازی‌شده در پایتون را حذف می‌کند." msgid "See also the :data:`MISSING_C_DOCSTRINGS` variable." -msgstr "" +msgstr "همچنین متغیر :data:`MISSING_C_DOCSTRINGS` را ببینید." msgid "Define the URL of a dedicated HTTP server for the network tests." -msgstr "" +msgstr "URL یک سرور HTTP اختصاصی را برای آزمون‌های شبکه تعریف کنید." msgid "Object that is equal to anything. Used to test mixed type comparison." msgstr "" +"شیءای که با هر چیزی برابر است. برای آزمایش مقایسه‌ی نوع‌های مختلط استفاده " +"می‌شود." -msgid "Object that is not equal to anything (even to :data:`ALWAYS_EQ`). Used to test mixed type comparison." +msgid "" +"Object that is not equal to anything (even to :data:`ALWAYS_EQ`). Used to " +"test mixed type comparison." msgstr "" +"شیءای که با هیچ چیزی برابر نیست (حتی با :data:`ALWAYS_EQ`). برای آزمایش " +"مقایسه‌ی نوع‌های مختلط استفاده می‌شود." -msgid "Object that is greater than anything (except itself). Used to test mixed type comparison." +msgid "" +"Object that is greater than anything (except itself). Used to test mixed " +"type comparison." msgstr "" +"شیءای که از هر چیزی (به‌جز خودش) بزرگ‌تر است. برای آزمایش مقایسه‌ی نوع‌های " +"مختلط استفاده می‌شود." -msgid "Object that is less than anything (except itself). Used to test mixed type comparison." +msgid "" +"Object that is less than anything (except itself). Used to test mixed type " +"comparison." msgstr "" +"شیءای که از هر چیزی (به‌جز خودش) کوچک‌تر است. برای آزمایش مقایسه‌ی نوع‌های " +"مختلط استفاده می‌شود." msgid "The :mod:`!test.support` module defines the following functions:" -msgstr "" +msgstr "ماژول :mod:`!test.support` توابع زیر را تعریف می‌کند:" msgid "Run the loop body until ``break`` stops the loop." -msgstr "" +msgstr "بدنه حلقه را تا زمانی اجرا کنید که ``break`` حلقه را متوقف کند." -msgid "After *timeout* seconds, raise an :exc:`AssertionError` if *error* is true, or just stop the loop if *error* is false." +msgid "" +"After *timeout* seconds, raise an :exc:`AssertionError` if *error* is true, " +"or just stop the loop if *error* is false." msgstr "" +"پس از *timeout* ثانیه، اگر *error* درست باشد، استثنای :exc:`AssertionError` " +"پرتاب می‌شود، یا اگر *error* نادرست باشد، فقط حلقه متوقف می‌شود." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" "for _ in support.busy_retry(support.SHORT_TIMEOUT):\n" " if check():\n" " break" msgstr "" +"for _ in support.busy_retry(support.SHORT_TIMEOUT):\n" +" if check():\n" +" break" msgid "Example of error=False usage::" -msgstr "" +msgstr "مثالی از کاربرد error=False::" msgid "" "for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):\n" @@ -348,24 +710,39 @@ msgid "" "else:\n" " raise RuntimeError('my custom error')" msgstr "" +"for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):\n" +" if check():\n" +" break\n" +"else:\n" +" raise RuntimeError('my custom error')" msgid "Wait strategy that applies exponential backoff." msgstr "" +"راهبرد انتظاری که عقب‌نشینی نمایی (exponential backoff) را اعمال می‌کند." -msgid "Run the loop body until ``break`` stops the loop. Sleep at each loop iteration, but not at the first iteration. The sleep delay is doubled at each iteration (up to *max_delay* seconds)." +msgid "" +"Run the loop body until ``break`` stops the loop. Sleep at each loop " +"iteration, but not at the first iteration. The sleep delay is doubled at " +"each iteration (up to *max_delay* seconds)." msgstr "" +"بدنه حلقه را تا زمانی که ``break`` حلقه را متوقف کند، اجرا کنید. در هر تکرار" +" حلقه مکث کنید، اما نه در تکرار نخست. تأخیر مکث در هر تکرار دو برابر می‌شود " +"(حداکثر تا *max_delay* ثانیه)." msgid "See :func:`busy_retry` documentation for the parameters usage." -msgstr "" +msgstr "برای استفاده از پارامترها، مستندات :func:`busy_retry` را ببینید." msgid "Example raising an exception after SHORT_TIMEOUT seconds::" -msgstr "" +msgstr "مثالی از پرتاب استثنا پس از SHORT_TIMEOUT ثانیه::" msgid "" "for _ in support.sleeping_retry(support.SHORT_TIMEOUT):\n" " if check():\n" " break" msgstr "" +"for _ in support.sleeping_retry(support.SHORT_TIMEOUT):\n" +" if check():\n" +" break" msgid "" "for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False):\n" @@ -374,66 +751,143 @@ msgid "" "else:\n" " raise RuntimeError('my custom error')" msgstr "" +"for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False):\n" +" if check():\n" +" break\n" +"else:\n" +" raise RuntimeError('my custom error')" -msgid "Return ``True`` if *resource* is enabled and available. The list of available resources is only set when :mod:`test.regrtest` is executing the tests." +msgid "" +"Return ``True`` if *resource* is enabled and available. The list of " +"available resources is only set when :mod:`test.regrtest` is executing the " +"tests." msgstr "" +"اگر *resource* فعال و در دسترس باشد، ``True`` را برمی‌گرداند. فهرست منابع در" +" دسترس فقط زمانی تنظیم می‌شود که :mod:`test.regrtest` در حال اجرای آزمون‌ها " +"باشد." -msgid "Return the value specified for *resource* (as :samp:`-u {resource}={value}`). Return ``None`` if *resource* is disabled or no value is specified." +msgid "" +"Return the value specified for *resource* (as :samp:`-u " +"{resource}={value}`). Return ``None`` if *resource* is disabled or no value " +"is specified." msgstr "" +"مقدار مشخص‌شده برای *resource* را برمی‌گرداند (به‌صورت :samp:`-u " +"{resource}={value}`). اگر *resource* غیرفعال باشد یا هیچ مقداری مشخص نشده " +"باشد، ``None`` را برمی‌گرداند." msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." msgstr "" +"اگر پایتون با ``-O0`` یا ``-Og`` ساخته نشده باشد، ``True`` را برمی‌گرداند." msgid "Return :const:`_testcapi.WITH_PYMALLOC`." -msgstr "" +msgstr ":const:`_testcapi.WITH_PYMALLOC` را برمی‌گرداند." -msgid "Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the argument to :exc:`ResourceDenied` if it is raised. Always returns ``True`` if called by a function whose ``__name__`` is ``'__main__'``. Used when tests are executed by :mod:`test.regrtest`." +msgid "" +"Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the " +"argument to :exc:`ResourceDenied` if it is raised. Always returns ``True`` " +"if called by a function whose ``__name__`` is ``'__main__'``. Used when " +"tests are executed by :mod:`test.regrtest`." msgstr "" +"اگر *resource* در دسترس نباشد، :exc:`ResourceDenied` را پرتاب می‌کند. اگر " +"این استثنا پرتاب شود، *msg* آرگومان :exc:`ResourceDenied` خواهد بود. اگر " +"توسط تابعی فراخوانی شود که ``__name__`` آن ``'__main__'`` است، همیشه " +"``True`` را برمی‌گرداند. هنگامی که آزمون‌ها توسط :mod:`test.regrtest` اجرا " +"می‌شوند، استفاده می‌شود." msgid "Return a repr of *dict* with keys sorted." -msgstr "" +msgstr "یک بازنمایی (repr) از *dict* با کلیدهای مرتب‌شده برمی‌گرداند." -msgid "Return the path to the file named *filename*. If no match is found *filename* is returned. This does not equal a failure since it could be the path to the file." +msgid "" +"Return the path to the file named *filename*. If no match is found " +"*filename* is returned. This does not equal a failure since it could be the " +"path to the file." msgstr "" +"مسیر فایلی با نام *filename* را برمی‌گرداند. اگر هیچ مورد منطبقی یافت نشد، " +"*filename* برگردانده می‌شود. این معادل شکست نیست، زیرا ممکن است مسیر فایل " +"باشد." -msgid "Setting *subdir* indicates a relative path to use to find the file rather than looking directly in the path directories." +msgid "" +"Setting *subdir* indicates a relative path to use to find the file rather " +"than looking directly in the path directories." msgstr "" +"تنظیم *subdir* یک مسیر نسبی را برای استفاده در یافتن فایل مشخص می‌کند، " +"به‌جای جست‌وجوی مستقیم در پوشه‌های مسیر." msgid "Get size of a page in bytes." -msgstr "" +msgstr "دریافت اندازه‌ی یک صفحه بر حسب بایت." -msgid "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a minimum interval for Android systems to prevent the system from hanging." +msgid "" +"Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " +"minimum interval for Android systems to prevent the system from hanging." msgstr "" +":func:`sys.setswitchinterval` را روی *interval* داده‌شده تنظیم می‌کند. یک " +"بازه‌ی حداقلی برای سیستم‌های اندروید تعریف می‌کند تا از هنگ کردن سیستم " +"جلوگیری شود." -msgid "Use this check to guard CPython's implementation-specific tests or to run them only on the implementations guarded by the arguments. This function returns ``True`` or ``False`` depending on the host platform. Example usage::" +msgid "" +"Use this check to guard CPython's implementation-specific tests or to run " +"them only on the implementations guarded by the arguments. This function " +"returns ``True`` or ``False`` depending on the host platform. Example " +"usage::" msgstr "" +"از این بررسی برای محافظت از آزمون‌های مختص پیاده‌سازی CPython یا برای اجرای " +"آن‌ها فقط روی پیاده‌سازی‌های محافظت‌شده توسط آرگومان‌ها استفاده کنید. این " +"تابع بسته به پلتفرم میزبان، ``True`` یا ``False`` برمی‌گرداند. نمونه " +"کاربرد::" msgid "" "check_impl_detail() # Only on CPython (default).\n" "check_impl_detail(jython=True) # Only on Jython.\n" "check_impl_detail(cpython=False) # Everywhere except CPython." msgstr "" +"check_impl_detail() # فقط در CPython (پیش‌فرض).\n" +"check_impl_detail(jython=True) # فقط در Jython.\n" +"check_impl_detail(cpython=False) # همه‌جا به‌جز CPython." -msgid "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big memory tests." +msgid "" +"Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " +"memory tests." msgstr "" +"مقادیر :data:`max_memuse` و :data:`real_max_memuse` را برای آزمون‌های حافظه " +"بزرگ تنظیم کنید." -msgid "Store the value from *stdout*. It is meant to hold the stdout at the time the regrtest began." +msgid "" +"Store the value from *stdout*. It is meant to hold the stdout at the time " +"the regrtest began." msgstr "" +"مقدار را از *stdout* ذخیره کنید. این برای نگه‌داری stdout در لحظه‌ای که " +"regrtest آغاز شد، در نظر گرفته شده است." -msgid "Return the original stdout set by :func:`record_original_stdout` or ``sys.stdout`` if it's not set." +msgid "" +"Return the original stdout set by :func:`record_original_stdout` or " +"``sys.stdout`` if it's not set." msgstr "" +"stdout اصلی تنظیم‌شده توسط :func:`record_original_stdout` را برمی‌گرداند، یا" +" اگر تنظیم نشده باشد، ``sys.stdout`` را برمی‌گرداند." -msgid "Return a list of command line arguments reproducing the current settings in ``sys.flags`` and ``sys.warnoptions``." +msgid "" +"Return a list of command line arguments reproducing the current settings in " +"``sys.flags`` and ``sys.warnoptions``." msgstr "" +"فهرستی از آرگومان‌های خط فرمان را برمی‌گرداند که تنظیمات فعلی را در " +"``sys.flags`` و ``sys.warnoptions`` بازتولید می‌کنند." -msgid "Return a list of command line arguments reproducing the current optimization settings in ``sys.flags``." +msgid "" +"Return a list of command line arguments reproducing the current optimization" +" settings in ``sys.flags``." msgstr "" +"فهرستی از آرگومان‌های خط فرمان را برمی‌گرداند که تنظیمات بهینه‌سازی فعلی را " +"در ``sys.flags`` بازتولید می‌کنند." -msgid "A context managers that temporarily replaces the named stream with :class:`io.StringIO` object." +msgid "" +"A context managers that temporarily replaces the named stream with " +":class:`io.StringIO` object." msgstr "" +"یک مدیر زمینه که به‌طور موقت جریان نام‌برده‌شده را با یک شیء " +":class:`io.StringIO` جایگزین می‌کند." msgid "Example use with output streams::" -msgstr "" +msgstr "مثال استفاده با جریان‌های خروجی::" msgid "" "with captured_stdout() as stdout, captured_stderr() as stderr:\n" @@ -442,9 +896,14 @@ msgid "" "assert stdout.getvalue() == \"hello\\n\"\n" "assert stderr.getvalue() == \"error\\n\"" msgstr "" +"with captured_stdout() as stdout, captured_stderr() as stderr:\n" +" print(\"hello\")\n" +" print(\"error\", file=sys.stderr)\n" +"assert stdout.getvalue() == \"hello\\n\"\n" +"assert stderr.getvalue() == \"error\\n\"" msgid "Example use with input stream::" -msgstr "" +msgstr "نمونه کاربرد با جریان ورودی::" msgid "" "with captured_stdin() as stdin:\n" @@ -454,166 +913,378 @@ msgid "" " captured = input()\n" "self.assertEqual(captured, \"hello\")" msgstr "" +"with captured_stdin() as stdin:\n" +" stdin.write('hello\\n')\n" +" stdin.seek(0)\n" +" # call test code that consumes from sys.stdin\n" +" captured = input()\n" +"self.assertEqual(captured, \"hello\")" msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" +"یک هندلر زمینه که :mod:`faulthandler` را به‌طور موقت غیرفعال می‌کند." -msgid "Force as many objects as possible to be collected. This is needed because timely deallocation is not guaranteed by the garbage collector. This means that ``__del__`` methods may be called later than expected and weakrefs may remain alive for longer than expected." +msgid "" +"Force as many objects as possible to be collected. This is needed because " +"timely deallocation is not guaranteed by the garbage collector. This means " +"that ``__del__`` methods may be called later than expected and weakrefs may " +"remain alive for longer than expected." msgstr "" +"تا حد امکان، اشیاء را مجبور به جمع‌آوری شدن می‌کند. این کار لازم است، زیرا " +"زباله‌روبی آزادسازی به‌موقع را تضمین نمی‌کند. این بدان معناست که ممکن است " +"متدهای ``__del__`` دیرتر از آنچه انتظار می‌رود فراخوانی شوند و ارجاع‌های " +"ضعیف برای مدت طولانی‌تری از آنچه انتظار می‌رود زنده بمانند." -msgid "A context manager that disables the garbage collector on entry. On exit, the garbage collector is restored to its prior state." +msgid "" +"A context manager that disables the garbage collector on entry. On exit, the" +" garbage collector is restored to its prior state." msgstr "" +"یک مدیر زمینه که در هنگام ورود، زباله‌روبی را غیرفعال می‌کند. در هنگام خروج،" +" زباله‌روبی به حالت پیشین خود بازمی‌گردد." msgid "Context manager to swap out an attribute with a new object." -msgstr "" +msgstr "مدیر زمینه برای جایگزین کردن یک ویژگی با یک شیء جدید." msgid "Usage::" -msgstr "" +msgstr "استفاده::" msgid "" "with swap_attr(obj, \"attr\", 5):\n" " ..." msgstr "" +"with swap_attr(obj, \"attr\", 5):\n" +" ..." -msgid "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, restoring the old value at the end of the block. If ``attr`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block." +msgid "" +"This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " +"restoring the old value at the end of the block. If ``attr`` doesn't exist " +"on ``obj``, it will be created and then deleted at the end of the block." msgstr "" +"این دستور ``obj.attr`` را در طول بلوک ``with`` روی ۵ تنظیم می‌کند و مقدار " +"پیشین را در پایان بلوک بازمی‌گرداند. اگر ``attr`` روی ``obj`` وجود نداشته " +"باشد، ایجاد می‌شود و سپس در پایان بلوک حذف می‌شود." -msgid "The old value (or ``None`` if it doesn't exist) will be assigned to the target of the \"as\" clause, if there is one." +msgid "" +"The old value (or ``None`` if it doesn't exist) will be assigned to the " +"target of the \"as\" clause, if there is one." msgstr "" +"مقدار قبلی (یا ``None`` اگر وجود نداشته باشد) به هدف بند \"as\" انتساب داده " +"می‌شود، اگر این بند وجود داشته باشد." msgid "Context manager to swap out an item with a new object." -msgstr "" +msgstr "مدیر زمینه برای جایگزینی یک آیتم با یک شیء جدید." msgid "" "with swap_item(obj, \"item\", 5):\n" " ..." msgstr "" +"with swap_item(obj, \"item\", 5):\n" +" ..." -msgid "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, restoring the old value at the end of the block. If ``item`` doesn't exist on ``obj``, it will be created and then deleted at the end of the block." +msgid "" +"This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block," +" restoring the old value at the end of the block. If ``item`` doesn't exist " +"on ``obj``, it will be created and then deleted at the end of the block." msgstr "" +"این کار ``obj[\"item\"]`` را در طول مدت بلوک ``with`` روی ۵ تنظیم می‌کند و " +"مقدار پیشین را در پایان بلوک بازمی‌گرداند. اگر ``item`` در ``obj`` وجود " +"نداشته باشد، ایجاد می‌شود و سپس در پایان بلوک حذف می‌شود." -msgid "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys.stderr`. It can be used to make sure that the logs order is consistent before writing into stderr." +msgid "" +"Call the ``flush()`` method on :data:`sys.stdout` and then on " +":data:`sys.stderr`. It can be used to make sure that the logs order is " +"consistent before writing into stderr." msgstr "" +"متد ``flush()`` را روی :data:`sys.stdout` و سپس روی :data:`sys.stderr` " +"فراخوانی کنید. می‌توان از آن برای اطمینان از سازگاری ترتیب گزارش‌ها پیش از " +"نوشتن در stderr استفاده کرد." -msgid "Print a warning into :data:`sys.__stderr__`. Format the message as: ``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add ``\"Warning -- \"`` prefix to each line." +msgid "" +"Print a warning into :data:`sys.__stderr__`. Format the message as: " +"``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " +"``\"Warning -- \"`` prefix to each line." msgstr "" +"هشداری را در :data:`sys.__stderr__` چاپ کنید. پیام را به‌صورت ``f\"Warning " +"-- {msg}\"`` قالب‌بندی کنید. اگر *msg* از چند خط تشکیل شده باشد، پیشوند " +"``\"Warning -- \"`` را به هر خط اضافه کنید." -msgid "Wait until process *pid* completes and check that the process exit code is *exitcode*." +msgid "" +"Wait until process *pid* completes and check that the process exit code is " +"*exitcode*." msgstr "" +"صبر کنید تا فرایند *pid* به پایان برسد و بررسی کنید که کد خروجی فرایند " +"*exitcode* باشد." -msgid "Raise an :exc:`AssertionError` if the process exit code is not equal to *exitcode*." +msgid "" +"Raise an :exc:`AssertionError` if the process exit code is not equal to " +"*exitcode*." msgstr "" +"اگر کد خروجی فرایند با *exitcode* برابر نباشد، یک :exc:`AssertionError` " +"پرتاب می‌شود." -msgid "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by default), kill the process and raise an :exc:`AssertionError`. The timeout feature is not available on Windows." +msgid "" +"If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " +"default), kill the process and raise an :exc:`AssertionError`. The timeout " +"feature is not available on Windows." msgstr "" +"اگر فرایند بیش از *timeout* ثانیه طول بکشد (:data:`SHORT_TIMEOUT` به‌طور " +"پیش‌فرض)، فرایند را خاتمه دهید و یک :exc:`AssertionError` را پرتاب کنید. " +"قابلیت مهلت در ویندوز در دسترس نیست." -msgid "Return the size of the :c:type:`PyObject` whose structure members are defined by *fmt*. The returned value includes the size of the Python object header and alignment." +msgid "" +"Return the size of the :c:type:`PyObject` whose structure members are " +"defined by *fmt*. The returned value includes the size of the Python object " +"header and alignment." msgstr "" +"اندازه‌ی :c:type:`PyObject` که اعضای ساختار آن توسط *fmt* تعریف شده‌اند را " +"برمی‌گرداند. مقدار بازگشتی شامل اندازه‌ی سرآیند شیء پایتون و هم‌ترازی است." -msgid "Return the size of the :c:type:`PyVarObject` whose structure members are defined by *fmt*. The returned value includes the size of the Python object header and alignment." +msgid "" +"Return the size of the :c:type:`PyVarObject` whose structure members are " +"defined by *fmt*. The returned value includes the size of the Python object " +"header and alignment." msgstr "" +"اندازه‌ی :c:type:`PyVarObject` را که اعضای ساختار آن توسط *fmt* تعریف " +"شده‌اند، برمی‌گرداند. مقدار برگردانده‌شده شامل اندازه‌ی سرآیند شیء پایتون و " +"هم‌ترازی است." -msgid "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC header size equals *size*." +msgid "" +"For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " +"header size equals *size*." msgstr "" +"برای مورد آزمون *test*، ادعا کنید که ``sys.getsizeof`` برای *o* به‌همراه " +"اندازه‌ی سرصفحه‌ی GC برابر با *size* است." -msgid "A decorator to conditionally mark tests with :deco:`unittest.expectedFailure`. Any use of this decorator should have an associated comment identifying the relevant tracker issue." +msgid "" +"A decorator to conditionally mark tests with " +":deco:`unittest.expectedFailure`. Any use of this decorator should have an " +"associated comment identifying the relevant tracker issue." msgstr "" +"دکوراتوری برای علامت‌گذاری مشروط آزمون‌ها با :deco:`unittest.expectedFailure`." +" هر استفاده‌ای از این دکوراتور باید دارای یک کامنت همراه باشد که موضوع مرتبط" +" در سامانه پیگیری را مشخص کند." -msgid "A decorator that skips the decorated test on TLS certification validation failures." +msgid "" +"A decorator that skips the decorated test on TLS certification validation " +"failures." msgstr "" +"دکوراتوری که در صورت شکست اعتبارسنجی گواهی TLS، آزمون دکوراته‌شده را رد " +"می‌کند." -msgid "A decorator for running a function in a different locale, correctly resetting it after it has finished. *catstr* is the locale category as a string (for example ``\"LC_ALL\"``). The *locales* passed will be tried sequentially, and the first valid locale will be used." +msgid "" +"A decorator for running a function in a different locale, correctly " +"resetting it after it has finished. *catstr* is the locale category as a " +"string (for example ``\"LC_ALL\"``). The *locales* passed will be tried " +"sequentially, and the first valid locale will be used." msgstr "" +"یک دکوراتور برای اجرای یک تابع در یک locale (locale) متفاوت، که پس از پایان " +"اجرا، locale را به‌درستی بازنشانی می‌کند. *catstr* دسته locale (locale " +"category) به‌صورت یک رشته است (برای مثال ``\"LC_ALL\"``). *locales* " +"ارسال‌شده به‌ترتیب آزمایش می‌شوند و اولین locale معتبر استفاده می‌شود." -msgid "A decorator for running a function in a specific timezone, correctly resetting it after it has finished." +msgid "" +"A decorator for running a function in a specific timezone, correctly " +"resetting it after it has finished." msgstr "" +"دکوراتوری برای اجرای یک تابع در یک منطقه‌ی زمانی مشخص، که پس از پایان آن، " +"منطقه‌ی زمانی را به‌درستی بازنشانی می‌کند." -msgid "Decorator for the minimum version when running test on FreeBSD. If the FreeBSD version is less than the minimum, the test is skipped." +msgid "" +"Decorator for the minimum version when running test on FreeBSD. If the " +"FreeBSD version is less than the minimum, the test is skipped." msgstr "" +"دکوراتور برای حداقل نسخه هنگام اجرای آزمون روی FreeBSD. اگر نسخه FreeBSD کمتر " +"از حداقل باشد، آزمون رد می‌شود." -msgid "Decorator for the minimum version when running test on Linux. If the Linux version is less than the minimum, the test is skipped." +msgid "" +"Decorator for the minimum version when running test on Linux. If the Linux " +"version is less than the minimum, the test is skipped." msgstr "" +"دکوراتور برای حداقل نسخه هنگام اجرای آزمون در لینوکس. اگر نسخه‌ی لینوکس کمتر " +"از حداقل باشد، آزمون رد می‌شود." -msgid "Decorator for the minimum version when running test on macOS. If the macOS version is less than the minimum, the test is skipped." +msgid "" +"Decorator for the minimum version when running test on macOS. If the macOS " +"version is less than the minimum, the test is skipped." msgstr "" +"دکوراتور برای حداقل نسخه هنگام اجرای آزمون روی macOS. اگر نسخه macOS کمتر از" +" حداقل باشد، آزمون رد می‌شود." -msgid "Decorator for skipping tests on the free-threaded build. If the :term:`GIL` is disabled, the test is skipped." +msgid "" +"Decorator for skipping tests on the free-threaded build. If the :term:`GIL`" +" is disabled, the test is skipped." msgstr "" +"دکوراتور برای رد کردن آزمون‌ها در ساخت نخ‌آزاد (free-threaded build). اگر " +":term:`GIL` غیرفعال باشد، آزمون رد می‌شود." msgid "Decorator for skipping tests on non-IEEE 754 platforms." -msgstr "" +msgstr "دکوراتور برای رد کردن آزمون‌ها روی سکوهای غیر IEEE 754." msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" +"دکوراتوری برای رد کردن آزمون‌ها در صورتی که :mod:`zlib` وجود نداشته باشد." msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" +"دکوراتوری برای پرش از آزمون‌ها در صورتی که :mod:`gzip` وجود نداشته باشد." msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" +"دکوراتوری برای رد کردن آزمون‌ها در صورتی که :mod:`bz2` وجود نداشته باشد." msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" +"دکوراتوری برای پرش از آزمون‌ها در صورتی که :mod:`lzma` وجود نداشته باشد." msgid "Decorator for skipping tests if *resource* is not available." -msgstr "" +msgstr "دکوراتوری برای رد کردن آزمون‌ها در صورتی که *resource* در دسترس نباشد." msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." -msgstr "" +msgstr "دکوراتوری برای اجرای آزمون فقط در صورت :data:`HAVE_DOCSTRINGS`." -msgid "Decorator for only running the test if :ref:`Limited C API ` is available." +msgid "" +"Decorator for only running the test if :ref:`Limited C API ` " +"is available." msgstr "" +"دکوراتوری برای اجرای آزمون تنها در صورتی که :ref:`Limited C API ` در دسترس باشد." msgid "Decorator for tests only applicable to CPython." -msgstr "" +msgstr "دکوراتور برای آزمون‌هایی که فقط در CPython کاربرد دارند." -msgid "Decorator for invoking :func:`check_impl_detail` on *guards*. If that returns ``False``, then uses *msg* as the reason for skipping the test." +msgid "" +"Decorator for invoking :func:`check_impl_detail` on *guards*. If that " +"returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" +"دکوراتوری برای فراخوانی :func:`check_impl_detail` روی *guards*. اگر آن " +"``False`` برگرداند، از *msg* به‌عنوان دلیل پرش از آزمون استفاده می‌کند." -msgid "Decorator for marking tests as thread-unsafe. This test always runs in one thread even when invoked with ``--parallel-threads``." +msgid "" +"Decorator for marking tests as thread-unsafe. This test always runs in one " +"thread even when invoked with ``--parallel-threads``." msgstr "" +"دکوراتوری برای علامت‌گذاری آزمون‌ها به‌عنوان ناامن برای نخ‌ها. این آزمون " +"همیشه در یک نخ اجرا می‌شود، حتی زمانی که با ``--parallel-threads`` فراخوانی " +"شود." -msgid "Decorator to temporarily turn off tracing for the duration of the test." -msgstr "" +msgid "" +"Decorator to temporarily turn off tracing for the duration of the test." +msgstr "دکوراتوری برای خاموش کردن موقت ردگیری در طول مدت آزمون." -msgid "Decorator for tests which involve reference counting. The decorator does not run the test if it is not run by CPython. Any trace function is unset for the duration of the test to prevent unexpected refcounts caused by the trace function." +msgid "" +"Decorator for tests which involve reference counting. The decorator does " +"not run the test if it is not run by CPython. Any trace function is unset " +"for the duration of the test to prevent unexpected refcounts caused by the " +"trace function." msgstr "" +"دکوراتوری برای آزمون‌هایی که با شمارش ارجاع سروکار دارند. این دکوراتور آزمون را " +"اجرا نمی‌کند، مگر اینکه توسط CPython اجرا شود. هر تابع ردگیری در طول اجرای " +"آزمون غیرفعال می‌شود تا از شمارش‌های ارجاع غیرمنتظره ناشی از تابع ردگیری " +"جلوگیری شود." msgid "Decorator for bigmem tests." -msgstr "" +msgstr "دکوراتور برای آزمون‌های bigmem." -msgid "*size* is a requested size for the test (in arbitrary, test-interpreted units.) *memuse* is the number of bytes per unit for the test, or a good estimate of it. For example, a test that needs two byte buffers, of 4 GiB each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." +msgid "" +"*size* is a requested size for the test (in arbitrary, test-interpreted " +"units.) *memuse* is the number of bytes per unit for the test, or a good " +"estimate of it. For example, a test that needs two byte buffers, of 4 GiB " +"each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" +"*size* اندازه‌ی درخواستی برای آزمون است (در واحدهای دلخواهی که آزمون آن‌ها " +"را تفسیر می‌کند). *memuse* تعداد بایت‌ها به ازای هر واحد برای آزمون، یا " +"برآورد خوبی از آن است. برای مثال، می‌توان آزمونی را که به دو بافر بایتی، هر" +" یک به اندازه‌ی ۴ GiB نیاز دارد، با ``@bigmemtest(size=_4G, memuse=2)`` " +"آراست." -msgid "The *size* argument is normally passed to the decorated test method as an extra argument. If *dry_run* is ``True``, the value passed to the test method may be less than the requested value. If *dry_run* is ``False``, it means the test doesn't support dummy runs when ``-M`` is not specified." +msgid "" +"The *size* argument is normally passed to the decorated test method as an " +"extra argument. If *dry_run* is ``True``, the value passed to the test " +"method may be less than the requested value. If *dry_run* is ``False``, it " +"means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" +"آرگومان *size* معمولاً به‌عنوان یک آرگومان اضافی به متد آزمون دکوریت‌شده ارسال" +" می‌شود. اگر *dry_run* برابر ``True`` باشد، مقدار ارسال‌شده به متد آزمون ممکن " +"است کمتر از مقدار درخواستی باشد. اگر *dry_run* برابر ``False`` باشد، به این " +"معناست که آزمون وقتی ``-M`` مشخص نشده باشد از اجراهای ساختگی پشتیبانی نمی‌کند." msgid "Decorator for tests that fill the address space." -msgstr "" +msgstr "دکوراتوری برای آزمون‌هایی که فضای آدرس را پر می‌کنند." -msgid "Return ``False`` if there is no evidence the interpreter was compiled with ``musl``, otherwise return a version triple, either ``(0, 0, 0)`` if the version is unknown, or the actual version if it is known. Intended for use in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be compiled with ``musl``; otherwise ``platform.libc_ver`` is checked." -msgstr "" +msgid "" +"Return ``False`` if there is no evidence the interpreter was compiled with " +"``musl``, otherwise return a version triple, either ``(0, 0, 0)`` if the " +"version is unknown, or the actual version if it is known. Intended for use " +"in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be " +"compiled with ``musl``; otherwise ``platform.libc_ver`` is checked." +msgstr "" +"اگر مدرکی مبنی بر کامپایل شدن مفسر با ``musl`` وجود نداشته باشد، ``False`` " +"برمی‌گرداند؛ در غیر این صورت یک سه‌تایی نسخه برمی‌گرداند: اگر نسخه ناشناخته " +"باشد ``(0, 0, 0)`` و اگر نسخه شناخته‌شده باشد، نسخه واقعی را. برای استفاده " +"در دکوراتورهای ``skip`` در نظر گرفته شده است. فرض می‌شود ``emscripten`` و " +"``wasi`` با ``musl`` کامپایل شده باشند؛ در غیر این صورت " +"``platform.libc_ver`` بررسی می‌شود." -msgid "Test for syntax errors in *statement* by attempting to compile *statement*. *testcase* is the :mod:`unittest` instance for the test. *errtext* is the regular expression which should match the string representation of the raised :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the line of the exception. If *offset* is not ``None``, compares to the offset of the exception." -msgstr "" +msgid "" +"Test for syntax errors in *statement* by attempting to compile *statement*. " +"*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " +"regular expression which should match the string representation of the " +"raised :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the " +"line of the exception. If *offset* is not ``None``, compares to the offset " +"of the exception." +msgstr "" +"آزمون خطاهای سینتکسی در *statement* با تلاش برای کامپایل کردن *statement* " +"انجام می‌شود. *testcase* نمونه‌ی :mod:`unittest` برای آزمون است. *errtext* " +"عبارت باقاعده‌ای است که باید با نمایش رشته‌ای :exc:`SyntaxError` پرتاب‌شده " +"مطابقت داشته باشد. اگر *lineno* ``None`` نباشد، با خط استثنا مقایسه می‌شود. " +"اگر *offset* ``None`` نباشد، با آفست استثنا مقایسه می‌شود." msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" +"*url* را باز می‌کند. اگر باز کردن ناموفق باشد، :exc:`TestFailed` را پرتاب " +"می‌کند." -msgid "Use this at the end of ``test_main`` whenever sub-processes are started. This will help ensure that no extra children (zombies) stick around to hog resources and create problems when looking for refleaks." +msgid "" +"Use this at the end of ``test_main`` whenever sub-processes are started. " +"This will help ensure that no extra children (zombies) stick around to hog " +"resources and create problems when looking for refleaks." msgstr "" +"هر زمان که زیرفرایندها آغاز می‌شوند، از این در پایان ``test_main`` استفاده " +"کنید. این کار کمک می‌کند تا اطمینان حاصل شود که هیچ‌کدام از فرزندان اضافی " +"(زامبی‌ها) باقی نمی‌مانند که منابع را اشغال کنند و هنگام جست‌وجو برای " +"نشت‌های مرجع (refleaks) مشکل ایجاد کنند." -msgid "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` is raised." +msgid "" +"Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " +"is raised." msgstr "" +"یک ویژگی را دریافت می‌کند و اگر :exc:`AttributeError ` " +"پرتاب شود، :exc:`unittest.SkipTest ` را پرتاب می‌کند." -msgid "Context manager catching unraisable exception using :func:`sys.unraisablehook`." +msgid "" +"Context manager catching unraisable exception using " +":func:`sys.unraisablehook`." msgstr "" +"مدیر زمینه‌ای که استثنای غیرقابل‌پرتاب را با استفاده از " +":func:`sys.unraisablehook` می‌گیرد." -msgid "Storing the exception value (``cm.unraisable.exc_value``) creates a reference cycle. The reference cycle is broken explicitly when the context manager exits." +msgid "" +"Storing the exception value (``cm.unraisable.exc_value``) creates a " +"reference cycle. The reference cycle is broken explicitly when the context " +"manager exits." msgstr "" +"ذخیره‌سازی مقدار استثنا (``cm.unraisable.exc_value``) یک چرخه‌ی ارجاع ایجاد " +"می‌کند. این چرخه‌ی ارجاع هنگامی که مدیر زمینه خارج می‌شود، به‌صراحت شکسته " +"می‌شود." -msgid "Storing the object (``cm.unraisable.object``) can resurrect it if it is set to an object which is being finalized. Exiting the context manager clears the stored object." +msgid "" +"Storing the object (``cm.unraisable.object``) can resurrect it if it is set " +"to an object which is being finalized. Exiting the context manager clears " +"the stored object." msgstr "" +"ذخیره‌کردن شیء (``cm.unraisable.object``) می‌تواند باعث احیای آن شود، اگر " +"روی شیءای تنظیم شده باشد که در حال نهایی‌سازی است. خروج از مدیر زمینه، شیء " +"ذخیره‌شده را پاک می‌کند." msgid "" "with support.catch_unraisable_exception() as cm:\n" @@ -626,9 +1297,27 @@ msgid "" "# cm.unraisable attribute no longer exists at this point\n" "# (to break a reference cycle)" msgstr "" +"with support.catch_unraisable_exception() as cm:\n" +" # کدی که یک «استثنای غیرقابل‌پرتاب» ایجاد می‌کند\n" +" ...\n" +"\n" +" # استثنای غیرقابل‌پرتاب را بررسی کنید: از cm.unraisable استفاده کنید\n" +" ...\n" +"\n" +"# ویژگی cm.unraisable دیگر در این نقطه وجود ندارد\n" +"# (برای شکستن یک چرخه‌ی ارجاع)" -msgid "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for use in test packages. *pkg_dir* is the root directory of the package; *loader*, *standard_tests*, and *pattern* are the arguments expected by ``load_tests``. In simple cases, the test package's ``__init__.py`` can be the following::" +msgid "" +"Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " +"use in test packages. *pkg_dir* is the root directory of the package; " +"*loader*, *standard_tests*, and *pattern* are the arguments expected by " +"``load_tests``. In simple cases, the test package's ``__init__.py`` can be " +"the following::" msgstr "" +"پیاده‌سازی عام پروتکل ``load_tests`` در :mod:`unittest` برای استفاده در " +"بسته‌های آزمون. *pkg_dir* پوشه‌ی ریشه‌ی بسته است؛ *loader*، *standard_tests* و" +" *pattern* آرگومان‌های مورد انتظار ``load_tests`` هستند. در موارد ساده، فایل" +" ``__init__.py`` بسته‌ی آزمون می‌تواند به‌صورت زیر باشد::" msgid "" "import os\n" @@ -637,60 +1326,195 @@ msgid "" "def load_tests(*args):\n" " return load_package_tests(os.path.dirname(__file__), *args)" msgstr "" +"import os\n" +"from test.support import load_package_tests\n" +"\n" +"def load_tests(*args):\n" +" return load_package_tests(os.path.dirname(__file__), *args)" -msgid "Returns the set of attributes, functions or methods of *ref_api* not found on *other_api*, except for a defined list of items to be ignored in this check specified in *ignore*." +msgid "" +"Returns the set of attributes, functions or methods of *ref_api* not found " +"on *other_api*, except for a defined list of items to be ignored in this " +"check specified in *ignore*." msgstr "" +"مجموعه‌ای از ویژگی‌ها، توابع یا متدهای *ref_api* را برمی‌گرداند که در " +"*other_api* یافت نمی‌شوند، به‌جز فهرست تعریف‌شده‌ای از آیتم‌هایی که باید در " +"این بررسی نادیده گرفته شوند و در *ignore* مشخص شده‌اند." -msgid "By default this skips private attributes beginning with '_' but includes all magic methods, i.e. those starting and ending in '__'." +msgid "" +"By default this skips private attributes beginning with '_' but includes all" +" magic methods, i.e. those starting and ending in '__'." msgstr "" +"به‌طور پیش‌فرض، ویژگی‌های خصوصی‌ای که با '_' آغاز می‌شوند نادیده گرفته " +"می‌شوند، اما همه‌ی متدهای جادویی، یعنی آن‌هایی که با '__' آغاز می‌شوند و به " +"آن ختم می‌شوند، شامل می‌شوند." -msgid "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup procedure to *test_instance* to restore *object_to_patch* for *attr_name*. The *attr_name* should be a valid attribute for *object_to_patch*." +msgid "" +"Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " +"procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " +"The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" +"*object_to_patch.attr_name* را با *new_value* بازنویسی می‌کند. همچنین یک " +"رویه‌ی پاک‌سازی به *test_instance* اضافه می‌کند تا *object_to_patch* را برای " +"*attr_name* به حالت پیشین بازگرداند. *attr_name* باید یک ویژگی معتبر برای " +"*object_to_patch* باشد." -msgid "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:`tracemalloc` is enabled." +msgid "" +"Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if " +":mod:`tracemalloc` is enabled." msgstr "" +"*code* را در زیرمفسر اجرا می‌کند. اگر :mod:`tracemalloc` فعال باشد، " +":exc:`unittest.SkipTest` را پرتاب می‌کند." -msgid "Decorator that runs the decorated test in a fresh interpreter subprocess, in isolation, so that it does not share global or interpreter state with the rest of the test run. It can decorate a test method or a whole :class:`~unittest.TestCase` subclass. Decorated methods must take no extra arguments. A failure, error or skip in the subprocess is reported for the corresponding test, and individual :meth:`subtests ` that fail or are skipped are reported individually. A reported failure or error shows the original subprocess traceback as the cause of the exception." -msgstr "" +msgid "" +"Decorator that runs the decorated test in a fresh interpreter subprocess, in" +" isolation, so that it does not share global or interpreter state with the " +"rest of the test run. It can decorate a test method or a whole " +":class:`~unittest.TestCase` subclass. Decorated methods must take no extra " +"arguments. A failure, error or skip in the subprocess is reported for the " +"corresponding test, and individual :meth:`subtests " +"` that fail or are skipped are reported " +"individually. A reported failure or error shows the original subprocess " +"traceback as the cause of the exception." +msgstr "" +"دکوراتوری که آزمون دکورات‌شده را در یک زیرفرایند تازه‌ی مفسر و به‌صورت ایزوله" +" اجرا می‌کند، تا وضعیت سراسری یا وضعیت مفسر را با بقیه‌ی اجرای آزمون به اشتراک" +" نگذارد. این دکوراتور می‌تواند یک متد آزمون یا یک زیرکلاس کامل از " +":class:`~unittest.TestCase` را دکورات کند. متدهای دکورات‌شده نباید هیچ " +"آرگومان اضافی بگیرند. یک شکست، خطا یا رد شدن در زیرفرایند برای آزمون مربوطه " +"گزارش می‌شود، و هریک از :meth:`subtests ` که " +"شکست بخورند یا رد شوند، به‌صورت جداگانه گزارش می‌شوند. یک شکست یا خطای " +"گزارش‌شده، ردگیری پشته‌ی اصلی زیرفرایند را به‌عنوان علت استثنا نشان می‌دهد." -msgid "When a **method** is decorated, only that method runs in a subprocess; all fixtures (:meth:`~unittest.TestCase.setUp` / :meth:`~unittest.TestCase.tearDown`, :meth:`~unittest.TestCase.setUpClass` / :meth:`~unittest.TestCase.tearDownClass` and ``setUpModule()`` / ``tearDownModule()``) run both in the parent process (as usual) and in the subprocess around the method." -msgstr "" +msgid "" +"When a **method** is decorated, only that method runs in a subprocess; all " +"fixtures (:meth:`~unittest.TestCase.setUp` / " +":meth:`~unittest.TestCase.tearDown`, :meth:`~unittest.TestCase.setUpClass` /" +" :meth:`~unittest.TestCase.tearDownClass` and ``setUpModule()`` / " +"``tearDownModule()``) run both in the parent process (as usual) and in the " +"subprocess around the method." +msgstr "" +"هنگامی که یک **متد** با دکوراتور آراسته شود، تنها همان متد در یک زیرفرایند " +"اجرا می‌شود؛ همه‌ی ثابت‌های آزمایشی (:meth:`~unittest.TestCase.setUp` / " +":meth:`~unittest.TestCase.tearDown`، :meth:`~unittest.TestCase.setUpClass` /" +" :meth:`~unittest.TestCase.tearDownClass` و ``setUpModule()`` / " +"``tearDownModule()``) هم در فرایند والد (مانند معمول) و هم در زیرفرایند، " +"پیرامون متد اجرا می‌شوند." -msgid "When a **class** is decorated, the whole class runs in a single subprocess, and :meth:`~unittest.TestCase.setUpClass`, :meth:`~unittest.TestCase.tearDownClass`, :meth:`~unittest.TestCase.setUp` and :meth:`~unittest.TestCase.tearDown` run once each in the subprocess and are skipped in the parent process. A failure or skip of :meth:`~unittest.TestCase.setUpClass` in the subprocess is reported for the whole class. ``setUpModule()`` cannot be controlled by a class decorator, so it still runs in the parent process too; test it with :data:`runningInSubprocess` if needed." -msgstr "" +msgid "" +"When a **class** is decorated, the whole class runs in a single subprocess, " +"and :meth:`~unittest.TestCase.setUpClass`, " +":meth:`~unittest.TestCase.tearDownClass`, :meth:`~unittest.TestCase.setUp` " +"and :meth:`~unittest.TestCase.tearDown` run once each in the subprocess and " +"are skipped in the parent process. A failure or skip of " +":meth:`~unittest.TestCase.setUpClass` in the subprocess is reported for the " +"whole class. ``setUpModule()`` cannot be controlled by a class decorator, " +"so it still runs in the parent process too; test it with " +":data:`runningInSubprocess` if needed." +msgstr "" +"هنگامی که یک **کلاس** آراسته می‌شود، کل کلاس در یک زیرفرایند واحد اجرا " +"می‌شود، و :meth:`~unittest.TestCase.setUpClass`، " +":meth:`~unittest.TestCase.tearDownClass`، :meth:`~unittest.TestCase.setUp` و" +" :meth:`~unittest.TestCase.tearDown` هرکدام یک بار در زیرفرایند اجرا می‌شوند" +" و در فرایند والد رد می‌شوند. شکست یا رد شدن " +":meth:`~unittest.TestCase.setUpClass` در زیرفرایند، برای کل کلاس گزارش " +"می‌شود. ``setUpModule()`` نمی‌تواند با دکوراتور کلاس کنترل شود، بنابراین " +"همچنان در فرایند والد نیز اجرا می‌شود؛ در صورت نیاز آن را با " +":data:`runningInSubprocess` بیازمایید." -msgid "The subprocess inherits the enabled resources (``-u``), memory limit (``-M``) and verbosity (``-v``) of the parent test run, so that :func:`~test.support.requires_resource`, :func:`~test.support.requires`, :func:`~test.support.bigmemtest` and the like behave consistently in both processes." -msgstr "" +msgid "" +"The subprocess inherits the enabled resources (``-u``), memory limit " +"(``-M``) and verbosity (``-v``) of the parent test run, so that " +":func:`~test.support.requires_resource`, :func:`~test.support.requires`, " +":func:`~test.support.bigmemtest` and the like behave consistently in both " +"processes." +msgstr "" +"زیرفرایند، منابع فعال‌شده (``-u``)، محدودیت حافظه (``-M``) و سطح جزئیات " +"(``-v``) را از اجرای آزمون والد به ارث می‌برد، به‌گونه‌ای که " +":func:`~test.support.requires_resource`، :func:`~test.support.requires`، " +":func:`~test.support.bigmemtest` و موارد مشابه در هر دو فرایند رفتار یکسانی " +"داشته باشند." msgid "The test is skipped on platforms without subprocess support." -msgstr "" +msgstr "این آزمون در سکوهای بدون پشتیبانی از subprocess نادیده گرفته می‌شود." -msgid "``True`` while the code runs in the isolated subprocess spawned by :func:`runInSubprocess`, and ``False`` otherwise (including in the parent process and in a normal, non-isolated test run). Fixtures such as :meth:`~unittest.TestCase.setUp`, :meth:`~unittest.TestCase.tearDown`, :meth:`~unittest.TestCase.setUpClass`, :meth:`~unittest.TestCase.tearDownClass`, ``setUpModule()`` and ``tearDownModule()`` can test it to choose which code to run in the subprocess." -msgstr "" +msgid "" +"``True`` while the code runs in the isolated subprocess spawned by " +":func:`runInSubprocess`, and ``False`` otherwise (including in the parent " +"process and in a normal, non-isolated test run). Fixtures such as " +":meth:`~unittest.TestCase.setUp`, :meth:`~unittest.TestCase.tearDown`, " +":meth:`~unittest.TestCase.setUpClass`, " +":meth:`~unittest.TestCase.tearDownClass`, ``setUpModule()`` and " +"``tearDownModule()`` can test it to choose which code to run in the " +"subprocess." +msgstr "" +"در حین اجرای کد در زیرفرایند ایزوله‌ی ایجادشده توسط :func:`runInSubprocess`، " +"``True`` و در غیر این صورت ``False`` است (از جمله در فرایند والد و در یک " +"اجرای آزمون عادی و غیرایزوله). ثابت‌های آزمایشیی مانند " +":meth:`~unittest.TestCase.setUp`، :meth:`~unittest.TestCase.tearDown`، " +":meth:`~unittest.TestCase.setUpClass`، " +":meth:`~unittest.TestCase.tearDownClass`، ``setUpModule()`` و " +"``tearDownModule()`` می‌توانند آن را آزمایش کنند تا انتخاب کنند کدام کد در " +"زیرفرایند اجرا شود." msgid "Assert instances of *cls* are deallocated after iterating." -msgstr "" +msgstr "ادعا کنید که نمونه‌های *cls* پس از تکرار، آزاد شده‌اند." -msgid "Check for the existence of the compiler executables whose names are listed in *cmd_names* or all the compiler executables when *cmd_names* is empty and return the first missing executable or ``None`` when none is found missing." +msgid "" +"Check for the existence of the compiler executables whose names are listed " +"in *cmd_names* or all the compiler executables when *cmd_names* is empty and" +" return the first missing executable or ``None`` when none is found missing." msgstr "" +"وجود فایل‌های اجرایی کامپایلر با نام‌های فهرست‌شده در *cmd_names*، یا در " +"صورت خالی بودن *cmd_names* وجود همه‌ی فایل‌های اجرایی کامپایلر را بررسی کنید " +"و نخستین فایل اجرایی مفقود را برگردانید؛ اگر هیچ مورد مفقودی یافت نشد، " +"``None`` برگردانید." -msgid "Assert that the ``__all__`` variable of *module* contains all public names." +msgid "" +"Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" +"اطمینان حاصل کنید که متغیر ``__all__`` در *module* شامل تمام نام‌های عمومی " +"است." -msgid "The module's public names (its API) are detected automatically based on whether they match the public name convention and were defined in *module*." +msgid "" +"The module's public names (its API) are detected automatically based on " +"whether they match the public name convention and were defined in *module*." msgstr "" +"نام‌های عمومی ماژول (API آن) به‌صورت خودکار بر اساس این‌که با قرارداد نام " +"عمومی مطابقت داشته باشند و در *module* تعریف شده باشند، تشخیص داده می‌شوند." -msgid "The *name_of_module* argument can specify (as a string or tuple thereof) what module(s) an API could be defined in order to be detected as a public API. One case for this is when *module* imports part of its public API from other modules, possibly a C backend (like ``csv`` and its ``_csv``)." +msgid "" +"The *name_of_module* argument can specify (as a string or tuple thereof) " +"what module(s) an API could be defined in order to be detected as a public " +"API. One case for this is when *module* imports part of its public API from " +"other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" +"آرگومان *name_of_module* می‌تواند (به‌صورت یک رشته یا تاپلی از رشته‌ها) مشخص" +" کند که یک API ممکن است در چه ماژول‌هایی تعریف شده باشد تا به‌عنوان API " +"عمومی تشخیص داده شود. یکی از موارد این حالت وقتی است که *module* بخشی از API" +" عمومی خود را از ماژول‌های دیگر ایمپورت می‌کند، احتمالاً از یک بک‌اند C " +"(مانند ``csv`` و ``_csv`` آن)." -msgid "The *extra* argument can be a set of names that wouldn't otherwise be automatically detected as \"public\", like objects without a proper :attr:`~definition.__module__` attribute. If provided, it will be added to the automatically detected ones." +msgid "" +"The *extra* argument can be a set of names that wouldn't otherwise be " +"automatically detected as \"public\", like objects without a proper " +":attr:`~definition.__module__` attribute. If provided, it will be added to " +"the automatically detected ones." msgstr "" +"آرگومان *extra* می‌تواند مجموعه‌ای از نام‌ها باشد که در غیر این صورت به‌طور " +"خودکار به‌عنوان «عمومی» شناسایی نمی‌شدند، مانند اشیایی که ویژگی " +":attr:`~definition.__module__` مناسب ندارند. در صورت ارائه، به موارد " +"شناسایی‌شده به‌طور خودکار اضافه می‌شود." -msgid "The *not_exported* argument can be a set of names that must not be treated as part of the public API even though their names indicate otherwise." +msgid "" +"The *not_exported* argument can be a set of names that must not be treated " +"as part of the public API even though their names indicate otherwise." msgstr "" +"آرگومان *not_exported* می‌تواند مجموعه‌ای از نام‌ها باشد که نباید به‌عنوان " +"بخشی از API عمومی تلقی شوند، حتی اگر نام‌هایشان خلاف آن را نشان می‌دهند." msgid "Example use::" -msgstr "" +msgstr "نمونه استفاده::" msgid "" "import bar\n" @@ -710,204 +1534,480 @@ msgid "" " support.check__all__(self, bar, ('bar', '_bar'),\n" " extra=extra, not_exported=not_exported)" msgstr "" +"import bar\n" +"import foo\n" +"import unittest\n" +"from test import support\n" +"\n" +"class MiscTestCase(unittest.TestCase):\n" +" def test__all__(self):\n" +" support.check__all__(self, foo)\n" +"\n" +"class OtherTestCase(unittest.TestCase):\n" +" def test__all__(self):\n" +" extra = {'BAR_CONST', 'FOO_CONST'}\n" +" not_exported = {'baz'} # Undocumented name.\n" +" # bar imports part of its API from _bar.\n" +" support.check__all__(self, bar, ('bar', '_bar'),\n" +" extra=extra, not_exported=not_exported)" -msgid "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if there is no available semaphore implementation, or if creating a lock raises an :exc:`OSError`." +msgid "" +"Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " +"there is no available semaphore implementation, or if creating a lock raises" +" an :exc:`OSError`." msgstr "" +"در صورتی که ماژول :mod:`multiprocessing.synchronize` موجود نبود، هیچ " +"پیاده‌سازی سمافور در دسترس نبود، یا ایجاد یک قفل باعث پرتاب :exc:`OSError` " +"شد، از آزمون‌ها صرف‌نظر کنید." msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" +"ادعا کنید که نوع *tp* نمی‌تواند با استفاده از *args* و *kwds* نمونه‌سازی " +"شود." -msgid "This function returns a context manager that will change the global :func:`sys.set_int_max_str_digits` setting for the duration of the context to allow execution of test code that needs a different limit on the number of digits when converting between an integer and string." +msgid "" +"This function returns a context manager that will change the global " +":func:`sys.set_int_max_str_digits` setting for the duration of the context " +"to allow execution of test code that needs a different limit on the number " +"of digits when converting between an integer and string." msgstr "" +"این تابع یک مدیر زمینه برمی‌گرداند که تنظیم سراسری " +":func:`sys.set_int_max_str_digits` را در طول عمر زمینه تغییر می‌دهد تا امکان" +" اجرای کد آزمونی که به محدودیت متفاوتی در تعداد ارقام هنگام تبدیل بین عدد " +"صحیح و رشته نیاز دارد، فراهم شود." msgid "The :mod:`!test.support` module defines the following classes:" -msgstr "" +msgstr "ماژول :mod:`!test.support` کلاس‌های زیر را تعریف می‌کند:" -msgid "A context manager used to try to prevent crash dialog popups on tests that are expected to crash a subprocess." +msgid "" +"A context manager used to try to prevent crash dialog popups on tests that " +"are expected to crash a subprocess." msgstr "" +"یک مدیر زمینه که برای تلاش جهت جلوگیری از نمایش پنجره‌های بازشوی محاوره‌ای " +"خرابی در آزمون‌هایی که انتظار می‌رود یک زیرفرایند را دچار خرابی کنند، به کار" +" می‌رود." -msgid "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode `_." +msgid "" +"On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " +"`_." msgstr "" +"در ویندوز، پنجره‌های محاوره‌ای گزارش خطای ویندوز (Windows Error Reporting) " +"را با استفاده از `SetErrorMode `_ غیرفعال می‌کند." -msgid "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource.RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." +msgid "" +"On UNIX, :func:`resource.setrlimit` is used to set " +":const:`resource.RLIMIT_CORE`'s soft limit to 0 to prevent coredump file " +"creation." msgstr "" +"در UNIX، از :func:`resource.setrlimit` برای تنظیم حد نرم " +":const:`resource.RLIMIT_CORE` بر روی ۰ استفاده می‌شود تا از ایجاد فایل " +"coredump جلوگیری شود." -msgid "On both platforms, the old value is restored by :meth:`~object.__exit__`." +msgid "" +"On both platforms, the old value is restored by :meth:`~object.__exit__`." msgstr "" +"در هر دو سکو، مقدار پیشین توسط :meth:`~object.__exit__` بازیابی می‌شود." -msgid "Class to save and restore signal handlers registered by the Python signal handler." +msgid "" +"Class to save and restore signal handlers registered by the Python signal " +"handler." msgstr "" +"کلاسی برای ذخیره و بازیابی هندلرهای سیگنالی که توسط مدیر سیگنال پایتون ثبت " +"شده‌اند." -msgid "Save the signal handlers to a dictionary mapping signal numbers to the current signal handler." +msgid "" +"Save the signal handlers to a dictionary mapping signal numbers to the " +"current signal handler." msgstr "" +"هندلرهای سیگنال را در دیکشنری‌ای ذخیره کنید که شماره‌های سیگنال را به" +" هندلر فعلی سیگنال نگاشت می‌کند." -msgid "Set the signal numbers from the :meth:`save` dictionary to the saved handler." +msgid "" +"Set the signal numbers from the :meth:`save` dictionary to the saved " +"handler." msgstr "" +"شماره‌های سیگنال موجود در دیکشنری :meth:`save` را به هندلر ذخیره‌شده " +"تنظیم کنید." msgid "Try to match a single dict with the supplied arguments." -msgstr "" +msgstr "تلاش کنید یک دیکشنری را با آرگومان‌های ارائه‌شده تطبیق دهید." msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" +"سعی کنید یک مقدار ذخیره‌شده‌ی منفرد (*dv*) را با یک مقدار ارائه‌شده (*v*) " +"مطابقت دهید." msgid ":mod:`!test.support.socket_helper` --- Utilities for socket tests" -msgstr "" +msgstr ":mod:`!test.support.socket_helper` --- ابزارهایی برای آزمون‌های سوکت" -msgid "The :mod:`!test.support.socket_helper` module provides support for socket tests." +msgid "" +"The :mod:`!test.support.socket_helper` module provides support for socket " +"tests." msgstr "" +"ماژول :mod:`!test.support.socket_helper` برای آزمون‌های سوکت پشتیبانی فراهم " +"می‌کند." msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" +"اگر IPv6 روی این میزبان فعال باشد، روی ``True`` تنظیم می‌شود، در غیر این " +"صورت روی ``False``." -msgid "Returns an unused port that should be suitable for binding. This is achieved by creating a temporary socket with the same family and type as the ``sock`` parameter (default is :const:`~socket.AF_INET`, :const:`~socket.SOCK_STREAM`), and binding it to the specified host address (defaults to ``0.0.0.0``) with the port set to 0, eliciting an unused ephemeral port from the OS. The temporary socket is then closed and deleted, and the ephemeral port is returned." -msgstr "" +msgid "" +"Returns an unused port that should be suitable for binding. This is " +"achieved by creating a temporary socket with the same family and type as the" +" ``sock`` parameter (default is :const:`~socket.AF_INET`, " +":const:`~socket.SOCK_STREAM`), and binding it to the specified host address " +"(defaults to ``0.0.0.0``) with the port set to 0, eliciting an unused " +"ephemeral port from the OS. The temporary socket is then closed and deleted," +" and the ephemeral port is returned." +msgstr "" +"یک پورت استفاده‌نشده برمی‌گرداند که باید برای اتصال مناسب باشد. این کار با " +"ایجاد یک سوکت موقتی با خانواده و نوع مشابه پارامتر ``sock`` (پیش‌فرض " +":const:`~socket.AF_INET`، :const:`~socket.SOCK_STREAM` است) و اتصال آن به " +"نشانی میزبان مشخص‌شده (پیش‌فرض ``0.0.0.0``) در حالی که پورت روی ۰ تنظیم شده " +"است، انجام می‌شود تا یک پورت موقتی استفاده‌نشده از سیستم‌عامل دریافت شود. " +"سپس سوکت موقتی بسته و حذف می‌شود و پورت موقتی برگردانده می‌شود." -msgid "Either this method or :func:`bind_port` should be used for any tests where a server socket needs to be bound to a particular port for the duration of the test. Which one to use depends on whether the calling code is creating a Python socket, or if an unused port needs to be provided in a constructor or passed to an external program (i.e. the ``-accept`` argument to openssl's s_server mode). Always prefer :func:`bind_port` over :func:`find_unused_port` where possible. Using a hard coded port is discouraged since it can make multiple instances of the test impossible to run simultaneously, which is a problem for buildbots." -msgstr "" +msgid "" +"Either this method or :func:`bind_port` should be used for any tests where a" +" server socket needs to be bound to a particular port for the duration of " +"the test. Which one to use depends on whether the calling code is creating a" +" Python socket, or if an unused port needs to be provided in a constructor " +"or passed to an external program (i.e. the ``-accept`` argument to openssl's" +" s_server mode). Always prefer :func:`bind_port` over " +":func:`find_unused_port` where possible. Using a hard coded port is " +"discouraged since it can make multiple instances of the test impossible to " +"run simultaneously, which is a problem for buildbots." +msgstr "" +"برای هر آزمونی که در آن نیاز است یک سوکت سرور در طول آزمون به یک پورت خاص " +"متصل شود، باید از این متد یا :func:`bind_port` استفاده شود. اینکه کدام‌یک " +"استفاده شود، بستگی به این دارد که کد فراخوان در حال ایجاد یک سوکت پایتون " +"است، یا اینکه یک پورت استفاده‌نشده باید در یک سازنده فراهم شود یا به یک " +"برنامه خارجی ارسال شود (یعنی آرگومان ``-accept`` برای حالت s_server در " +"openssl). همیشه در صورت امکان :func:`bind_port` را به " +":func:`find_unused_port` ترجیح دهید. استفاده از یک پورت سخت‌کدشده توصیه " +"نمی‌شود، زیرا می‌تواند اجرای همزمان چندین نمونه از آزمون را غیرممکن کند که " +"این برای بات‌های ساخت (buildbots) مشکل‌ساز است." -msgid "Bind the socket to a free port and return the port number. Relies on ephemeral ports in order to ensure we are using an unbound port. This is important as many tests may be running simultaneously, especially in a buildbot environment. This method raises an exception if the ``sock.family`` is :const:`~socket.AF_INET` and ``sock.type`` is :const:`~socket.SOCK_STREAM`, and the socket has :const:`~socket.SO_REUSEADDR` or :const:`~socket.SO_REUSEPORT` set on it. Tests should never set these socket options for TCP/IP sockets. The only case for setting these options is testing multicasting via multiple UDP sockets." -msgstr "" +msgid "" +"Bind the socket to a free port and return the port number. Relies on " +"ephemeral ports in order to ensure we are using an unbound port. This is " +"important as many tests may be running simultaneously, especially in a " +"buildbot environment. This method raises an exception if the " +"``sock.family`` is :const:`~socket.AF_INET` and ``sock.type`` is " +":const:`~socket.SOCK_STREAM`, and the socket has " +":const:`~socket.SO_REUSEADDR` or :const:`~socket.SO_REUSEPORT` set on it. " +"Tests should never set these socket options for TCP/IP sockets. The only " +"case for setting these options is testing multicasting via multiple UDP " +"sockets." +msgstr "" +"سوکت را به یک پورت آزاد مقید می‌کند و شماره‌ی پورت را برمی‌گرداند. برای " +"اطمینان از اینکه از یک پورت مقیدنشده استفاده می‌شود، به پورت‌های موقتی " +"(ephemeral ports) متکی است. این موضوع مهم است، زیرا ممکن است آزمون‌های بسیاری " +"به‌طور همزمان در حال اجرا باشند، به‌ویژه در محیط buildbot. این متد در صورتی" +" استثنا پرتاب می‌کند که ``sock.family`` برابر :const:`~socket.AF_INET` و " +"``sock.type`` برابر :const:`~socket.SOCK_STREAM` باشد، و گزینه‌ی " +":const:`~socket.SO_REUSEADDR` یا :const:`~socket.SO_REUSEPORT` روی سوکت " +"تنظیم‌شده باشد. آزمون‌ها هرگز نباید این گزینه‌های سوکت را برای سوکت‌های TCP/IP" +" تنظیم کنند. تنها حالت برای تنظیم این گزینه‌ها، آزمون کردن چندپخشی " +"(multicasting) از طریق چند سوکت UDP است." -msgid "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is available (i.e. on Windows), it will be set on the socket. This will prevent anyone else from binding to our host/port for the duration of the test." +msgid "" +"Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " +"available (i.e. on Windows), it will be set on the socket. This will " +"prevent anyone else from binding to our host/port for the duration of the " +"test." msgstr "" +"علاوه بر این، اگر گزینه‌ی سوکت :const:`~socket.SO_EXCLUSIVEADDRUSE` در دسترس " +"باشد (یعنی در ویندوز)، روی سوکت تنظیم می‌شود. این کار از اتصال (binding) هر " +"کس دیگر به میزبان/پورت ما در طول مدت آزمون جلوگیری می‌کند." -msgid "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:`PermissionError` is raised." +msgid "" +"Bind a Unix socket, raising :exc:`unittest.SkipTest` if " +":exc:`PermissionError` is raised." msgstr "" +"یک سوکت یونیکس را مقید کند می‌دهد و در صورت پرتاب :exc:`PermissionError " +"`، :exc:`unittest.SkipTest ` را پرتاب " +"می‌کند." -msgid "A decorator for running tests that require a functional ``bind()`` for Unix sockets." +msgid "" +"A decorator for running tests that require a functional ``bind()`` for Unix " +"sockets." msgstr "" +"دکوراتوری برای اجرای آزمون‌هایی که به یک ``bind()`` کارا برای سوکت‌های Unix " +"نیاز دارند." -msgid "A context manager that raises :exc:`~test.support.ResourceDenied` when various issues with the internet connection manifest themselves as exceptions." +msgid "" +"A context manager that raises :exc:`~test.support.ResourceDenied` when " +"various issues with the internet connection manifest themselves as " +"exceptions." msgstr "" +"یک مدیر زمینه که :exc:`~test.support.ResourceDenied` را هنگامی که مشکلات " +"گوناگون اتصال به اینترنت به‌صورت استثناهایی آشکار می‌شوند، پرتاب می‌کند." -msgid ":mod:`!test.support.script_helper` --- Utilities for the Python execution tests" +msgid "" +":mod:`!test.support.script_helper` --- Utilities for the Python execution " +"tests" msgstr "" +":mod:`!test.support.script_helper` --- ابزارهایی برای آزمون‌های اجرای پایتون" -msgid "The :mod:`!test.support.script_helper` module provides support for Python's script execution tests." +msgid "" +"The :mod:`!test.support.script_helper` module provides support for Python's " +"script execution tests." msgstr "" +"ماژول :mod:`!test.support.script_helper` پشتیبانی برای آزمون‌های اجرای " +"اسکریپت پایتون را فراهم می‌کند." -msgid "Return ``True`` if ``sys.executable interpreter`` requires environment variables in order to be able to run at all." +msgid "" +"Return ``True`` if ``sys.executable interpreter`` requires environment " +"variables in order to be able to run at all." msgstr "" +"اگر ``sys.executable interpreter`` برای اینکه اصلاً بتواند اجرا شود به " +"متغیرهای محیطی نیاز داشته باشد، ``True`` را برمی‌گرداند." -msgid "This is designed to be used with ``@unittest.skipIf()`` to annotate tests that need to use an ``assert_python*()`` function to launch an isolated mode (``-I``) or no environment mode (``-E``) sub-interpreter process." +msgid "" +"This is designed to be used with ``@unittest.skipIf()`` to annotate tests " +"that need to use an ``assert_python*()`` function to launch an isolated mode" +" (``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" +"این برای استفاده با ``@unittest.skipIf()`` طراحی شده است تا آزمون‌هایی را " +"علامت‌گذاری کند که نیاز دارند از یک تابع ``assert_python*()`` برای " +"راه‌اندازی یک فرایند زیرمفسر در حالت ایزوله (``-I``) یا حالت بدون محیط " +"(``-E``) استفاده کنند." -msgid "A normal build & test does not run into this situation but it can happen when trying to run the standard library test suite from an interpreter that doesn't have an obvious home with Python's current home finding logic." +msgid "" +"A normal build & test does not run into this situation but it can happen " +"when trying to run the standard library test suite from an interpreter that " +"doesn't have an obvious home with Python's current home finding logic." msgstr "" +"یک ساخت و آزمون عادی با این موقعیت مواجه نمی‌شود، اما این حالت ممکن است " +"هنگامی رخ دهد که تلاش می‌کنید مجموعه آزمون‌های کتابخانه استاندارد را از " +"مفسری اجرا کنید که با منطق فعلی پایتون در یافتن خانه (home)، خانه‌ی مشخصی " +"ندارد." -msgid "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are other common environment variables that might impact whether or not the interpreter can start." +msgid "" +"Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " +"in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " +"other common environment variables that might impact whether or not the " +"interpreter can start." msgstr "" +"تنظیم :envvar:`PYTHONHOME` یکی از راه‌ها برای اجرای بیشتر مجموعه‌آزمون در آن" +" شرایط است. :envvar:`PYTHONPATH` یا :envvar:`PYTHONUSERSITE` متغیرهای محیطی " +"رایج دیگری هستند که ممکن است بر اینکه مفسر بتواند آغاز شود یا نه تأثیر " +"بگذارند." -msgid "Set up the environment based on *env_vars* for running the interpreter in a subprocess. The values can include ``__isolated``, ``__cleanenv``, ``__cwd``, and ``TERM``." +msgid "" +"Set up the environment based on *env_vars* for running the interpreter in a " +"subprocess. The values can include ``__isolated``, ``__cleanenv``, " +"``__cwd``, and ``TERM``." msgstr "" +"محیط را بر اساس *env_vars* برای اجرای مفسر در یک زیرفرایند (subprocess) " +"تنظیم کنید. مقادیر می‌توانند شامل ``__isolated``، ``__cleanenv``، ``__cwd`` " +"و ``TERM`` باشند." msgid "The function no longer strips whitespaces from *stderr*." -msgstr "" +msgstr "این تابع دیگر نویسه‌های فاصله را از *stderr* حذف نمی‌کند." -msgid "Assert that running the interpreter with *args* and optional environment variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, stdout, stderr)`` tuple." +msgid "" +"Assert that running the interpreter with *args* and optional environment " +"variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " +"stdout, stderr)`` tuple." msgstr "" +"ادعا می‌کند که اجرای مفسر با *args* و متغیرهای محیطی اختیاری *env_vars* با " +"موفقیت انجام می‌شود (``rc == 0``) و یک تاپل ``(return code, stdout, " +"stderr)`` برمی‌گرداند." -msgid "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a fresh environment." +msgid "" +"If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " +"fresh environment." msgstr "" +"اگر پارامتر فقط کلیدواژه‌ای *__cleanenv* تنظیم شده باشد، از *env_vars* " +"به‌عنوان یک محیط تازه استفاده می‌شود." -msgid "Python is started in isolated mode (command line option ``-I``), except if the *__isolated* keyword-only parameter is set to ``False``." +msgid "" +"Python is started in isolated mode (command line option ``-I``), except if " +"the *__isolated* keyword-only parameter is set to ``False``." msgstr "" +"پایتون در حالت ایزوله اجرا می‌شود (گزینه خط فرمان ``-I``)، مگر اینکه پارامتر" +" فقط کلیدواژه‌ای *__isolated* روی ``False`` تنظیم شده باشد." -msgid "Assert that running the interpreter with *args* and optional environment variables *env_vars* fails (``rc != 0``) and return a ``(return code, stdout, stderr)`` tuple." +msgid "" +"Assert that running the interpreter with *args* and optional environment " +"variables *env_vars* fails (``rc != 0``) and return a ``(return code, " +"stdout, stderr)`` tuple." msgstr "" +"ادعا می‌کند که اجرای مفسر با *args* و متغیرهای محیطی اختیاری *env_vars* شکست" +" می‌خورد (``rc != 0``) و یک تاپل ``(return code, stdout, stderr)`` را " +"بازمی‌گرداند." msgid "See :func:`assert_python_ok` for more options." -msgstr "" +msgstr "برای گزینه‌های بیشتر، :func:`assert_python_ok` را ببینید." msgid "Run a Python subprocess with the given arguments." -msgstr "" +msgstr "یک زیرفرایند پایتون را با آرگومان‌های داده‌شده اجرا کنید." -msgid "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :class:`subprocess.Popen` object." +msgid "" +"*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a " +":class:`subprocess.Popen` object." msgstr "" +"*kw* آرگومان‌های کلیدواژه‌ای اضافی برای ارسال به :func:`subprocess.Popen` " +"هستند. یک شیء :class:`subprocess.Popen` بازمی‌گرداند." -msgid "Run the given :class:`subprocess.Popen` process until completion and return stdout." +msgid "" +"Run the given :class:`subprocess.Popen` process until completion and return " +"stdout." msgstr "" +"فرآیند :class:`subprocess.Popen` داده‌شده را تا پایان اجرا می‌کند و stdout " +"را برمی‌گرداند." -msgid "Create script containing *source* in path *script_dir* and *script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the name. Return the full script path." +msgid "" +"Create script containing *source* in path *script_dir* and " +"*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " +"name. Return the full script path." msgstr "" +"اسکریپتی حاوی *source* در مسیر *script_dir* و *script_basename* ایجاد " +"می‌کند. اگر *omit_suffix* برابر ``False`` باشد، ``.py`` به نام افزوده " +"می‌شود. مسیر کامل اسکریپت را برمی‌گرداند." -msgid "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which contains the files in *script_name*. *name_in_zip* is the archive name. Return a tuple containing ``(full path, full path of archive name)``." +msgid "" +"Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which" +" contains the files in *script_name*. *name_in_zip* is the archive name. " +"Return a tuple containing ``(full path, full path of archive name)``." msgstr "" +"یک فایل zip در *zip_dir* و *zip_basename* با پسوند ``zip`` ایجاد می‌کند که " +"شامل فایل‌های موجود در *script_name* است. *name_in_zip* نام آرشیو است. یک " +"تاپل شامل ``(full path, full path of archive name)`` برمی‌گرداند." -msgid "Create a directory named *pkg_dir* containing an ``__init__`` file with *init_source* as its contents." +msgid "" +"Create a directory named *pkg_dir* containing an ``__init__`` file with " +"*init_source* as its contents." msgstr "" +"پوشه‌ای به نام *pkg_dir* ایجاد کنید که شامل یک فایل ``__init__`` با محتوای " +"*init_source* باشد." -msgid "Create a zip package directory with a path of *zip_dir* and *zip_basename* containing an empty ``__init__`` file and a file *script_basename* containing the *source*. If *compiled* is ``True``, both source files will be compiled and added to the zip package. Return a tuple of the full zip path and the archive name for the zip file." -msgstr "" +msgid "" +"Create a zip package directory with a path of *zip_dir* and *zip_basename* " +"containing an empty ``__init__`` file and a file *script_basename* " +"containing the *source*. If *compiled* is ``True``, both source files will " +"be compiled and added to the zip package. Return a tuple of the full zip " +"path and the archive name for the zip file." +msgstr "" +"یک پوشه‌ی بسته‌ی zip با مسیر *zip_dir* و *zip_basename* ایجاد کنید که شامل " +"یک فایل ``__init__`` خالی و یک فایل *script_basename* حاوی *source* باشد. " +"اگر *compiled* برابر ``True`` باشد، هر دو فایل منبع کامپایل می‌شوند و به " +"بسته‌ی zip اضافه می‌شوند. یک تاپل از مسیر کامل zip و نام بایگانی برای فایل " +"zip را برگردانید." -msgid ":mod:`!test.support.bytecode_helper` --- Support tools for testing correct bytecode generation" +msgid "" +":mod:`!test.support.bytecode_helper` --- Support tools for testing correct " +"bytecode generation" msgstr "" +":mod:`!test.support.bytecode_helper` --- ابزارهای پشتیبانی برای آزمون تولید" +" صحیح بایت‌کد" -msgid "The :mod:`!test.support.bytecode_helper` module provides support for testing and inspecting bytecode generation." +msgid "" +"The :mod:`!test.support.bytecode_helper` module provides support for testing" +" and inspecting bytecode generation." msgstr "" +"ماژول :mod:`!test.support.bytecode_helper` پشتیبانی برای آزمون و بازرسی تولید " +"بایت‌کد را فراهم می‌کند." msgid "The module defines the following class:" -msgstr "" +msgstr "این ماژول کلاس زیر را تعریف می‌کند:" msgid "This class has custom assertion methods for inspecting bytecode." -msgstr "" +msgstr "این کلاس دارای متدهای ادعای سفارشی برای بازرسی بایت‌کد است." msgid "Return the disassembly of *co* as string." -msgstr "" +msgstr "واسازی (disassembly) *co* را به‌صورت رشته برمی‌گرداند." -msgid "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." +msgid "" +"Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" +"اگر *opname* یافت شود، instr را برمی‌گرداند، در غیر این صورت " +":exc:`AssertionError` را پرتاب می‌کند." msgid "Throws :exc:`AssertionError` if *opname* is found." -msgstr "" +msgstr "اگر *opname* پیدا شود، :exc:`AssertionError` را پرتاب می‌کند." -msgid ":mod:`!test.support.threading_helper` --- Utilities for threading tests" +msgid "" +":mod:`!test.support.threading_helper` --- Utilities for threading tests" msgstr "" +":mod:`!test.support.threading_helper` --- ابزارهایی برای آزمون‌های نخ‌بندی" -msgid "The :mod:`!test.support.threading_helper` module provides support for threading tests." +msgid "" +"The :mod:`!test.support.threading_helper` module provides support for " +"threading tests." msgstr "" +"ماژول :mod:`!test.support.threading_helper` پشتیبانی از آزمون‌های نخ‌بندی " +"(threading) را فراهم می‌کند." -msgid "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread is still alive after *timeout* seconds." +msgid "" +"Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " +"is still alive after *timeout* seconds." msgstr "" +"به یک *نخ* در بازه‌ی *timeout* ملحق شوید. اگر نخ پس از *timeout* ثانیه هنوز " +"زنده بود، یک :exc:`AssertionError` پرتاب می‌شود." msgid "Decorator to ensure the threads are cleaned up even if the test fails." -msgstr "" +msgstr "دکوراتوری برای اطمینان از پاک‌سازی نخ‌ها حتی در صورت شکست آزمون." -msgid "Context manager to start *threads*, which is a sequence of threads. *unlock* is a function called after the threads are started, even if an exception was raised; an example would be :meth:`threading.Event.set`. ``start_threads`` will attempt to join the started threads upon exit." +msgid "" +"Context manager to start *threads*, which is a sequence of threads. *unlock*" +" is a function called after the threads are started, even if an exception " +"was raised; an example would be :meth:`threading.Event.set`. " +"``start_threads`` will attempt to join the started threads upon exit." msgstr "" +"مدیر زمینه برای شروع *threads*، که دنباله‌ای از نخ‌ها است. *unlock* تابعی " +"است که پس از شروع نخ‌ها فراخوانی می‌شود، حتی اگر استثنایی پرتاب شده باشد؛ یک" +" نمونه :meth:`threading.Event.set` است. ``start_threads`` تلاش می‌کند نخ‌های" +" شروع‌شده را هنگام خروج join کند." -msgid "Cleanup up threads not specified in *original_values*. Designed to emit a warning if a test leaves running threads in the background." +msgid "" +"Cleanup up threads not specified in *original_values*. Designed to emit a " +"warning if a test leaves running threads in the background." msgstr "" +"پاک‌سازی نخ‌هایی که در *original_values* مشخص نشده‌اند. برای صدور هشدار در " +"صورتی طراحی شده است که یک آزمون، نخ‌های در حال اجرا را در پس‌زمینه باقی " +"بگذارد." msgid "Return current thread count and copy of dangling threads." -msgstr "" +msgstr "تعداد نخ‌های فعلی و رونوشتی از نخ‌های معلق را برمی‌گرداند." -msgid "Context manager to wait until all threads created in the ``with`` statement exit." +msgid "" +"Context manager to wait until all threads created in the ``with`` statement " +"exit." msgstr "" +"مدیر زمینه برای انتظار تا خروج همه‌ی نخ‌های ایجادشده در دستور ``with``." -msgid "Context manager catching :class:`threading.Thread` exception using :func:`threading.excepthook`." +msgid "" +"Context manager catching :class:`threading.Thread` exception using " +":func:`threading.excepthook`." msgstr "" +"مدیر زمینه‌ای که استثنای :class:`threading.Thread` را با استفاده از " +":func:`threading.excepthook` می‌گیرد." msgid "Attributes set when an exception is caught:" -msgstr "" +msgstr "ویژگی‌هایی که هنگام گرفته شدن یک استثنا تنظیم می‌شوند:" msgid "``exc_type``" -msgstr "" +msgstr "``exc_type``" msgid "``exc_value``" -msgstr "" +msgstr "``exc_value``" msgid "``exc_traceback``" -msgstr "" +msgstr "``exc_traceback``" msgid "``thread``" -msgstr "" +msgstr "``thread``" msgid "See :func:`threading.excepthook` documentation." -msgstr "" +msgstr "مستندات :func:`threading.excepthook` را ببینید." msgid "These attributes are deleted at the context manager exit." -msgstr "" +msgstr "این ویژگی‌ها در زمان خروج مدیر زمینه حذف می‌شوند." msgid "" "with threading_helper.catch_threading_exception() as cm:\n" @@ -922,138 +2022,318 @@ msgid "" "# exists at this point\n" "# (to avoid reference cycles)" msgstr "" +"with threading_helper.catch_threading_exception() as cm:\n" +" # کدی که نخی را ایجاد می‌کند که استثنایی پرتاب می‌کند\n" +" ...\n" +"\n" +" # برای بررسی استثنای نخ، از ویژگی‌های cm استفاده کنید:\n" +" # exc_type، exc_value، exc_traceback، thread\n" +" ...\n" +"\n" +"# ویژگی‌های exc_type، exc_value، exc_traceback و threadِ cm دیگر در این نقطه وجود ندارند\n" +"# (برای جلوگیری از چرخه‌های ارجاع)" -msgid "Run the worker function concurrently in multiple threads. Re-raises an exception if any thread raises one, after all threads have finished." +msgid "" +"Run the worker function concurrently in multiple threads. Re-raises an " +"exception if any thread raises one, after all threads have finished." msgstr "" +"تابع کارگر را به‌صورت همزمان در چندین نخ اجرا می‌کند. اگر هر نخی استثنا " +"پرتاب کند، پس از پایان همه نخ‌ها، آن استثنا را دوباره پرتاب می‌کند." msgid ":mod:`!test.support.os_helper` --- Utilities for os tests" -msgstr "" +msgstr ":mod:`!test.support.os_helper` --- ابزارهایی برای آزمون‌های os" -msgid "The :mod:`!test.support.os_helper` module provides support for os tests." +msgid "" +"The :mod:`!test.support.os_helper` module provides support for os tests." msgstr "" +"ماژول :mod:`!test.support.os_helper` برای آزمون‌های os پشتیبانی فراهم " +"می‌کند." msgid "A non-ASCII character encodable by :func:`os.fsencode`." -msgstr "" +msgstr "یک نویسه‌ی غیر ASCII قابل کدگذاری با :func:`os.fsencode`." msgid "Set to :func:`os.getcwd`." -msgstr "" +msgstr "روی :func:`os.getcwd` تنظیم شده است." -msgid "Set to a name that is safe to use as the name of a temporary file. Any temporary file that is created should be closed and unlinked (removed)." +msgid "" +"Set to a name that is safe to use as the name of a temporary file. Any " +"temporary file that is created should be closed and unlinked (removed)." msgstr "" +"به نامی تنظیم شود که برای استفاده به‌عنوان نام یک فایل موقت امن باشد. هر " +"فایل موقتی که ایجاد می‌شود، باید بسته و حذف (unlink) شود." -msgid "Set to a filename containing the :data:`FS_NONASCII` character, if it exists. This guarantees that if the filename exists, it can be encoded and decoded with the default filesystem encoding. This allows tests that require a non-ASCII filename to be easily skipped on platforms where they can't work." -msgstr "" +msgid "" +"Set to a filename containing the :data:`FS_NONASCII` character, if it " +"exists. This guarantees that if the filename exists, it can be encoded and " +"decoded with the default filesystem encoding. This allows tests that require" +" a non-ASCII filename to be easily skipped on platforms where they can't " +"work." +msgstr "" +"به یک نام فایل حاوی نویسه‌ی :data:`FS_NONASCII` تنظیم می‌شود، اگر این نویسه " +"وجود داشته باشد. این تضمین می‌کند که اگر نام فایل وجود داشته باشد، می‌توان " +"آن را با کدگذاری پیش‌فرض سیستم فایل کدگذاری و کدگشایی کرد. این امکان را " +"می‌دهد که آزمون‌هایی که به یک نام فایل غیر ASCII نیاز دارند، به‌راحتی روی " +"سکوهایی که امکان اجرای آن‌ها وجود ندارد، رد شوند." -msgid "Set to a filename (str type) that should not be able to be encoded by file system encoding in strict mode. It may be ``None`` if it's not possible to generate such a filename." +msgid "" +"Set to a filename (str type) that should not be able to be encoded by file " +"system encoding in strict mode. It may be ``None`` if it's not possible to " +"generate such a filename." msgstr "" +"به یک نام فایل (از نوع str) تنظیم می‌شود که نباید بتوان آن را با کدگذاری " +"سیستم فایل در حالت سخت‌گیرانه کدگذاری کرد. اگر امکان تولید چنین نام فایلی " +"وجود نداشته باشد، ممکن است ``None`` باشد." -msgid "Set to a filename (bytes type) that should not be able to be decoded by file system encoding in strict mode. It may be ``None`` if it's not possible to generate such a filename." +msgid "" +"Set to a filename (bytes type) that should not be able to be decoded by file" +" system encoding in strict mode. It may be ``None`` if it's not possible to" +" generate such a filename." msgstr "" +"به یک نام فایل (نوع bytes) تنظیم شود که نباید بتوان آن را با کدگذاری سیستم " +"فایل در حالت سخت‌گیرانه کدگشایی کرد. اگر ایجاد چنین نام فایلی ممکن نباشد، " +"ممکن است ``None`` باشد." msgid "Set to a non-ASCII name for a temporary file." -msgstr "" +msgstr "روی نامی غیر ASCII برای یک فایل موقت تنظیم شده است." -msgid "Class used to temporarily set or unset environment variables. Instances can be used as a context manager and have a complete dictionary interface for querying/modifying the underlying ``os.environ``. After exit from the context manager all changes to environment variables done through this instance will be rolled back." +msgid "" +"Class used to temporarily set or unset environment variables. Instances can" +" be used as a context manager and have a complete dictionary interface for " +"querying/modifying the underlying ``os.environ``. After exit from the " +"context manager all changes to environment variables done through this " +"instance will be rolled back." msgstr "" +"کلاسی که برای تنظیم یا لغو تنظیم موقت متغیرهای محیطی به کار می‌رود. نمونه‌ها" +" می‌توانند به‌عنوان یک مدیر زمینه استفاده شوند و یک رابط کامل دیکشنری برای " +"پرس‌وجو/تغییر ``os.environ`` زیربنایی دارند. پس از خروج از مدیر زمینه، تمام " +"تغییرات اعمال‌شده بر متغیرهای محیطی از طریق این نمونه بازگردانده می‌شوند." msgid "Added dictionary interface." -msgstr "" +msgstr "رابط دیکشنری افزوده شد." -msgid "Simple :term:`path-like object`. It implements the :meth:`~os.PathLike.__fspath__` method which just returns the *path* argument. If *path* is an exception, it will be raised in :meth:`!__fspath__`." +msgid "" +"Simple :term:`path-like object`. It implements the " +":meth:`~os.PathLike.__fspath__` method which just returns the *path* " +"argument. If *path* is an exception, it will be raised in " +":meth:`!__fspath__`." msgstr "" +"یک :term:`path-like object` ساده. این شیء متد " +":meth:`~os.PathLike.__fspath__` را پیاده‌سازی می‌کند که فقط آرگومان *path* " +"را بازمی‌گرداند. اگر *path* یک استثنا باشد، در :meth:`!__fspath__` پرتاب " +"می‌شود." -msgid "Temporarily set the environment variable ``envvar`` to the value of ``value``." +msgid "" +"Temporarily set the environment variable ``envvar`` to the value of " +"``value``." msgstr "" +"به‌طور موقت متغیر محیطی ``envvar`` را به مقدار ``value`` تنظیم می‌کند." msgid "Temporarily unset one or more environment variables." -msgstr "" +msgstr "به‌طور موقت یک یا چند متغیر محیطی را حذف کنید." msgid "More than one environment variable can be unset." -msgstr "" +msgstr "می‌توان بیش از یک متغیر محیطی را لغو تنظیم کرد." -msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." +msgid "" +"Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" +"اگر سیستم‌عامل از پیوندهای نمادین پشتیبانی کند، ``True`` و در غیر این صورت " +"``False`` را برمی‌گرداند." msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" +"اگر سیستم‌عامل از xattr پشتیبانی کند، ``True`` و در غیر این صورت ``False`` " +"را برمی‌گرداند." -msgid "A context manager that temporarily changes the current working directory to *path* and yields the directory." +msgid "" +"A context manager that temporarily changes the current working directory to " +"*path* and yields the directory." msgstr "" +"یک مدیر زمینه که پوشه کاری جاری را به‌طور موقت به *path* تغییر می‌دهد و پوشه" +" را برمی‌گرداند." -msgid "If *quiet* is ``False``, the context manager raises an exception on error. Otherwise, it issues only a warning and keeps the current working directory the same." +msgid "" +"If *quiet* is ``False``, the context manager raises an exception on error. " +"Otherwise, it issues only a warning and keeps the current working directory " +"the same." msgstr "" +"اگر *quiet* برابر ``False`` باشد، مدیر زمینه در صورت خطا استثنایی را پرتاب " +"می‌کند. در غیر این صورت، تنها یک هشدار صادر می‌کند و پوشه کاری فعلی را بدون " +"تغییر نگه می‌دارد." -msgid "Create an empty file with *filename*. If it already exists, truncate it." +msgid "" +"Create an empty file with *filename*. If it already exists, truncate it." msgstr "" +"یک فایل خالی با *filename* ایجاد کنید. اگر از قبل وجود دارد، آن را کوتاه " +"کنید ." msgid "Count the number of open file descriptors." -msgstr "" +msgstr "تعداد توصیف‌گرهای فایل باز را بشمارید." -msgid "Return ``True`` if the file system for *directory* is case-insensitive." +msgid "" +"Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" +"اگر سیستم فایل برای *directory* به بزرگی و کوچکی حروف حساس نباشد، ``True`` " +"را برمی‌گرداند." -msgid "Create an invalid file descriptor by opening and closing a temporary file, and returning its descriptor." +msgid "" +"Create an invalid file descriptor by opening and closing a temporary file, " +"and returning its descriptor." msgstr "" +"با باز کردن و بستن یک فایل موقت و برگرداندن توصیف‌گر آن، یک توصیف‌گر فایل " +"نامعتبر ایجاد کنید." -msgid "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped with a wait loop that checks for the existence of the file, which is needed due to antivirus programs that can hold files open and prevent deletion." +msgid "" +"Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " +"with a wait loop that checks for the existence of the file, which is needed " +"due to antivirus programs that can hold files open and prevent deletion." msgstr "" +":func:`os.rmdir` را روی *filename* فراخوانی می‌کند. در پلتفرم‌های ویندوزی، " +"این فراخوانی با یک حلقه انتظار پوشش داده شده است که وجود فایل را بررسی " +"می‌کند؛ این کار به دلیل برنامه‌های ضدویروس لازم است، برنامه‌هایی که " +"می‌توانند فایل‌ها را باز نگه دارند و از حذف آن‌ها جلوگیری کنند." -msgid "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os.rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows platforms this is wrapped with a wait loop that checks for the existence of the files." +msgid "" +"Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and " +":func:`os.rmdir` to remove a path and its contents. As with :func:`rmdir`, " +"on Windows platforms this is wrapped with a wait loop that checks for the " +"existence of the files." msgstr "" +"برای حذف یک مسیر و محتویات آن، :func:`shutil.rmtree` را روی *path* فراخوانی " +"کنید یا :func:`os.lstat` و :func:`os.rmdir` را فراخوانی کنید. مانند " +":func:`rmdir`، در پلتفرم‌های ویندوز این عمل با یک حلقه انتظار که وجود " +"فایل‌ها را بررسی می‌کند، احاطه شده است." msgid "A decorator for running tests that require support for symbolic links." msgstr "" +"یک دکوراتور برای اجرای آزمون‌هایی که به پشتیبانی از پیوندهای نمادین نیاز " +"دارند." msgid "A decorator for running tests that require support for xattr." -msgstr "" +msgstr "دکوراتوری برای اجرای آزمون‌هایی که به پشتیبانی از xattr نیاز دارند." -msgid "A context manager that temporarily creates a new directory and changes the current working directory (CWD)." +msgid "" +"A context manager that temporarily creates a new directory and changes the " +"current working directory (CWD)." msgstr "" +"یک مدیریت‌کننده‌ی زمینه که به‌طور موقت یک پوشه‌ی جدید ایجاد می‌کند و پوشه‌ی " +"کاری جاری (CWD) را تغییر می‌دهد." -msgid "The context manager creates a temporary directory in the current directory with name *name* before temporarily changing the current working directory. If *name* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`." +msgid "" +"The context manager creates a temporary directory in the current directory " +"with name *name* before temporarily changing the current working directory." +" If *name* is ``None``, the temporary directory is created using " +":func:`tempfile.mkdtemp`." msgstr "" +"مدیر زمینه پیش از تغییر موقت پوشه کاری جاری، یک پوشه موقت با نام *name* در " +"پوشه جاری ایجاد می‌کند. اگر *name* برابر ``None`` باشد، پوشه موقت با استفاده" +" از :func:`tempfile.mkdtemp` ایجاد می‌شود." -msgid "If *quiet* is ``False`` and it is not possible to create or change the CWD, an error is raised. Otherwise, only a warning is raised and the original CWD is used." +msgid "" +"If *quiet* is ``False`` and it is not possible to create or change the CWD, " +"an error is raised. Otherwise, only a warning is raised and the original " +"CWD is used." msgstr "" +"اگر *quiet* برابر ``False`` باشد و امکان ایجاد یا تغییر CWD وجود نداشته " +"باشد، خطایی پرتاب می‌شود. در غیر این صورت، تنها هشداری پرتاب می‌شود و از CWD" +" اصلی استفاده می‌شود." -msgid "A context manager that creates a temporary directory at *path* and yields the directory." +msgid "" +"A context manager that creates a temporary directory at *path* and yields " +"the directory." msgstr "" +"یک مدیر زمینه که پوشه‌ای موقت در *path* ایجاد می‌کند و پوشه را برمی‌گرداند." -msgid "If *path* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an exception on error. Otherwise, if *path* is specified and cannot be created, only a warning is issued." +msgid "" +"If *path* is ``None``, the temporary directory is created using " +":func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager " +"raises an exception on error. Otherwise, if *path* is specified and cannot " +"be created, only a warning is issued." msgstr "" +"اگر *path* برابر ``None`` باشد، پوشه‌ی موقت با استفاده از " +":func:`tempfile.mkdtemp` ایجاد می‌شود. اگر *quiet* برابر ``False`` باشد، " +"مدیر زمینه در صورت بروز خطا یک استثنا پرتاب می‌کند. در غیر این صورت، اگر " +"*path* مشخص شده باشد و ایجاد آن ممکن نباشد، فقط یک هشدار صادر می‌شود." msgid "A context manager that temporarily sets the process umask." -msgstr "" +msgstr "یک مدیر زمینه که به‌طور موقت umask فرایند را تنظیم می‌کند." -msgid "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows platforms, this is wrapped with a wait loop that checks for the existence of the file." +msgid "" +"Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " +"platforms, this is wrapped with a wait loop that checks for the existence of" +" the file." msgstr "" +":func:`os.unlink` را روی *filename* فراخوانی کنید. مانند :func:`rmdir`، در " +"پلتفرم‌های ویندوزی، این فراخوانی با یک حلقه انتظار که وجود فایل را بررسی " +"می‌کند، دربرگرفته شده است." msgid ":mod:`!test.support.import_helper` --- Utilities for import tests" msgstr "" +":mod:`!test.support.import_helper` --- ابزارهای کمکی برای آزمون‌های ایمپورت" -msgid "The :mod:`!test.support.import_helper` module provides support for import tests." +msgid "" +"The :mod:`!test.support.import_helper` module provides support for import " +"tests." msgstr "" +"ماژول :mod:`!test.support.import_helper` پشتیبانی برای آزمون‌های ایمپورت را " +"فراهم می‌کند." -msgid "Remove the module named *module_name* from ``sys.modules`` and delete any byte-compiled files of the module." +msgid "" +"Remove the module named *module_name* from ``sys.modules`` and delete any " +"byte-compiled files of the module." msgstr "" +"ماژول با نام *module_name* را از ``sys.modules`` حذف کنید و هرگونه فایل " +"کامپایل‌شده به بایت آن ماژول را پاک کنید." -msgid "This function imports and returns a fresh copy of the named Python module by removing the named module from ``sys.modules`` before doing the import. Note that unlike :func:`reload`, the original module is not affected by this operation." +msgid "" +"This function imports and returns a fresh copy of the named Python module by" +" removing the named module from ``sys.modules`` before doing the import. " +"Note that unlike :func:`reload`, the original module is not affected by this" +" operation." msgstr "" +"این تابع با حذف ماژول نام‌برده‌شده از ``sys.modules`` پیش از انجام ایمپورت، " +"یک نسخه‌ی تازه از ماژول پایتون نام‌برده‌شده را ایمپورت می‌کند و برمی‌گرداند." +" توجه داشته باشید که برخلاف :func:`reload`، ماژول اصلی تحت تأثیر این عملیات " +"قرار نمی‌گیرد." -msgid "*fresh* is an iterable of additional module names that are also removed from the ``sys.modules`` cache before doing the import." +msgid "" +"*fresh* is an iterable of additional module names that are also removed from" +" the ``sys.modules`` cache before doing the import." msgstr "" +"*fresh* یک پیمایش‌پذیر از نام‌های ماژول اضافی است که همچنین پیش از انجام " +"ایمپورت از نهانگاه ``sys.modules`` حذف می‌شوند." -msgid "*blocked* is an iterable of module names that are replaced with ``None`` in the module cache during the import to ensure that attempts to import them raise :exc:`ImportError`." +msgid "" +"*blocked* is an iterable of module names that are replaced with ``None`` in " +"the module cache during the import to ensure that attempts to import them " +"raise :exc:`ImportError`." msgstr "" +"*blocked* یک پیمایش‌پذیر از نام‌های ماژول است که در حین ایمپورت، در نهانگاه " +"ماژول با ``None`` جایگزین می‌شوند تا اطمینان حاصل شود که تلاش‌ها برای " +"ایمپورت آن‌ها باعث پرتاب :exc:`ImportError` می‌شوند." -msgid "The named module and any modules named in the *fresh* and *blocked* parameters are saved before starting the import and then reinserted into ``sys.modules`` when the fresh import is complete." +msgid "" +"The named module and any modules named in the *fresh* and *blocked* " +"parameters are saved before starting the import and then reinserted into " +"``sys.modules`` when the fresh import is complete." msgstr "" +"ماژول نام‌برده‌شده و هر ماژولی که در پارامترهای *fresh* و *blocked* " +"نام‌برده‌شده باشد، پیش از آغاز ایمپورت ذخیره می‌شوند و سپس هنگامی که ایمپورت" +" تازه کامل می‌شود، دوباره در ``sys.modules`` درج می‌شوند." -msgid "Module and package deprecation messages are suppressed during this import if *deprecated* is ``True``." +msgid "" +"Module and package deprecation messages are suppressed during this import if" +" *deprecated* is ``True``." msgstr "" +"اگر *deprecated* برابر ``True`` باشد، پیام‌های منسوخ‌شدن ماژول‌ها و بسته‌ها " +"در جریان این ایمپورت سرکوب می‌شوند." -msgid "This function will raise :exc:`ImportError` if the named module cannot be imported." +msgid "" +"This function will raise :exc:`ImportError` if the named module cannot be " +"imported." msgstr "" +"این تابع در صورتی که ماژول نام‌برده نتواند ایمپورت شود، :exc:`ImportError` " +"را پرتاب می‌کند." msgid "" "# Get copies of the warnings module for testing without affecting the\n" @@ -1063,86 +2343,220 @@ msgid "" "py_warnings = import_fresh_module('warnings', blocked=['_warnings'])\n" "c_warnings = import_fresh_module('warnings', fresh=['_warnings'])" msgstr "" +"# دریافت نسخه‌هایی از ماژول warnings برای آزمون، بدون تأثیر بر نسخه‌ای که\n" +"# توسط بقیه مجموعه آزمون استفاده می‌شود. یک نسخه از پیاده‌سازی C استفاده\n" +"# می‌کند و نسخه دیگر مجبور است از پیاده‌سازی جایگزین پایتون خالص استفاده کند\n" +"py_warnings = import_fresh_module('warnings', blocked=['_warnings'])\n" +"c_warnings = import_fresh_module('warnings', fresh=['_warnings'])" -msgid "This function imports and returns the named module. Unlike a normal import, this function raises :exc:`unittest.SkipTest` if the module cannot be imported." +msgid "" +"This function imports and returns the named module. Unlike a normal import, " +"this function raises :exc:`unittest.SkipTest` if the module cannot be " +"imported." msgstr "" +"این تابع، ماژول نام‌برده‌شده را ایمپورت کرده و برمی‌گرداند. برخلاف ایمپورت " +"معمولی، این تابع در صورتی که ماژول نتواند ایمپورت شود، " +":exc:`unittest.SkipTest` را پرتاب می‌کند." -msgid "Module and package deprecation messages are suppressed during this import if *deprecated* is ``True``. If a module is required on a platform but optional for others, set *required_on* to an iterable of platform prefixes which will be compared against :data:`sys.platform`." +msgid "" +"Module and package deprecation messages are suppressed during this import if" +" *deprecated* is ``True``. If a module is required on a platform but " +"optional for others, set *required_on* to an iterable of platform prefixes " +"which will be compared against :data:`sys.platform`." msgstr "" +"در صورتی که *deprecated* برابر ``True`` باشد، پیام‌های منسوخ‌شدگی ماژول و " +"بسته در جریان این ایمپورت سرکوب می‌شوند. اگر ماژولی در یک پلتفرم ضروری باشد " +"اما در پلتفرم‌های دیگر اختیاری باشد، *required_on* را روی یک پیمایش‌پذیر از " +"پیشوندهای پلتفرم تنظیم کنید که با :data:`sys.platform` مقایسه می‌شوند." msgid "Return a copy of :data:`sys.modules`." -msgstr "" +msgstr "یک کپی از :data:`sys.modules` برمی‌گرداند." -msgid "Remove modules except for *oldmodules* and ``encodings`` in order to preserve internal cache." +msgid "" +"Remove modules except for *oldmodules* and ``encodings`` in order to " +"preserve internal cache." msgstr "" +"ماژول‌ها را به جز *oldmodules* و ``encodings`` حذف کنید تا نهانگاه داخلی حفظ" +" شود." msgid "Delete *name* from ``sys.modules``." -msgstr "" +msgstr "*name* را از ``sys.modules`` حذف می‌کند." -msgid "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file system path to the legacy pyc file. The *source* value is the file system path to the source file. It does not need to exist, however the PEP 3147/488 pyc file must exist." +msgid "" +"Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return" +" the file system path to the legacy pyc file. The *source* value is the " +"file system path to the source file. It does not need to exist, however the" +" PEP 3147/488 pyc file must exist." msgstr "" +"یک فایل pyc مربوط به :pep:`3147`/:pep:`488` را به محل pyc قدیمی آن منتقل " +"می‌کند و مسیر فایل سیستمی برای فایل pyc قدیمی را برمی‌گرداند. مقدار " +"*source*، مسیر فایل سیستمی برای فایل منبع است. لازم نیست فایل منبع وجود " +"داشته باشد، اما فایل pyc مربوط به PEP 3147/488 باید وجود داشته باشد." -msgid "A context manager to force import to return a new module reference. This is useful for testing module-level behaviors, such as the emission of a :exc:`DeprecationWarning` on import. Example usage::" +msgid "" +"A context manager to force import to return a new module reference. This is" +" useful for testing module-level behaviors, such as the emission of a " +":exc:`DeprecationWarning` on import. Example usage::" msgstr "" +"یک مدیریت‌کننده زمینه برای وادار کردن ایمپورت به بازگرداندن مرجع جدیدی از " +"ماژول. این برای آزمایش رفتارهای سطح ماژول، مانند صدور یک " +":exc:`DeprecationWarning` هنگام ایمپورت، مفید است. نمونه کاربرد::" msgid "" "with CleanImport('foo'):\n" " importlib.import_module('foo') # New reference." msgstr "" +"with CleanImport('foo'):\n" +" importlib.import_module('foo') # New reference." msgid "A context manager to temporarily add directories to :data:`sys.path`." -msgstr "" +msgstr "یک مدیریت‌کننده‌ی زمینه برای افزودن موقت پوشه‌ها به :data:`sys.path`." -msgid "This makes a copy of :data:`sys.path`, appends any directories given as positional arguments, then reverts :data:`sys.path` to the copied settings when the context ends." +msgid "" +"This makes a copy of :data:`sys.path`, appends any directories given as " +"positional arguments, then reverts :data:`sys.path` to the copied settings " +"when the context ends." msgstr "" +"این یک رونوشت از :data:`sys.path` می‌سازد، هر پوشه‌ای را که به‌عنوان آرگومان" +" جایگاهی داده شده باشد به آن می‌افزاید، سپس هنگامی که زمینه به پایان می‌رسد،" +" :data:`sys.path` را به تنظیمات رونوشت‌شده بازمی‌گرداند." -msgid "Note that *all* :data:`sys.path` modifications in the body of the context manager, including replacement of the object, will be reverted at the end of the block." +msgid "" +"Note that *all* :data:`sys.path` modifications in the body of the context " +"manager, including replacement of the object, will be reverted at the end of" +" the block." msgstr "" +"توجه داشته باشید که *تمام* تغییرات :data:`sys.path` در بدنه مدیر زمینه، از " +"جمله جایگزینی شیء، در پایان بلوک به حالت پیشین بازگردانده خواهند شد." msgid ":mod:`!test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" +":mod:`!test.support.warnings_helper` --- ابزارهایی برای آزمون‌های هشدارها" -msgid "The :mod:`!test.support.warnings_helper` module provides support for warnings tests." +msgid "" +"The :mod:`!test.support.warnings_helper` module provides support for " +"warnings tests." msgstr "" +"ماژول :mod:`!test.support.warnings_helper` پشتیبانی از آزمون‌های هشدارها را " +"فراهم می‌کند." -msgid "Suppress warnings that are instances of *category*, which must be :exc:`Warning` or a subclass. Roughly equivalent to :func:`warnings.catch_warnings` with :meth:`warnings.simplefilter('ignore', category=category) `. For example::" +msgid "" +"Suppress warnings that are instances of *category*, which must be " +":exc:`Warning` or a subclass. Roughly equivalent to " +":func:`warnings.catch_warnings` with :meth:`warnings.simplefilter('ignore', " +"category=category) `. For example::" msgstr "" +"هشدارهایی را که نمونه‌هایی از *category* هستند، سرکوب می‌کند؛ *category* " +"باید :exc:`Warning` یا زیرکلاسی از آن باشد. تقریباً معادل " +":func:`warnings.catch_warnings` با :meth:`warnings.simplefilter('ignore', " +"category=category) ` است. برای مثال::" msgid "" "@warning_helper.ignore_warnings(category=DeprecationWarning)\n" "def test_suppress_warning():\n" " # do something" msgstr "" +"@warning_helper.ignore_warnings(category=DeprecationWarning)\n" +"def test_suppress_warning():\n" +" # do something" -msgid "Context manager to check that no :exc:`ResourceWarning` was raised. You must remove the object which may emit :exc:`ResourceWarning` before the end of the context manager." +msgid "" +"Context manager to check that no :exc:`ResourceWarning` was raised. You " +"must remove the object which may emit :exc:`ResourceWarning` before the end " +"of the context manager." msgstr "" +"مدیریت‌کننده‌ی زمینه برای بررسی اینکه هیچ :exc:`ResourceWarning` پرتاب نشده " +"باشد. شما باید شیء‌ای را که ممکن است :exc:`ResourceWarning` پرتاب کند، پیش " +"از پایان مدیریت‌کننده‌ی زمینه حذف کنید." -msgid "Test for syntax warning in *statement* by attempting to compile *statement*. Test also that the :exc:`SyntaxWarning` is emitted only once, and that it will be converted to a :exc:`SyntaxError` when turned into error. *testcase* is the :mod:`unittest` instance for the test. *errtext* is the regular expression which should match the string representation of the emitted :exc:`SyntaxWarning` and raised :exc:`SyntaxError`. If *lineno* is not ``None``, compares to the line of the warning and exception. If *offset* is not ``None``, compares to the offset of the exception." -msgstr "" +msgid "" +"Test for syntax warning in *statement* by attempting to compile *statement*." +" Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " +"will be converted to a :exc:`SyntaxError` when turned into error. *testcase*" +" is the :mod:`unittest` instance for the test. *errtext* is the regular " +"expression which should match the string representation of the emitted " +":exc:`SyntaxWarning` and raised :exc:`SyntaxError`. If *lineno* is not " +"``None``, compares to the line of the warning and exception. If *offset* is " +"not ``None``, compares to the offset of the exception." +msgstr "" +"با تلاش برای کامپایل کردن *statement*، وجود هشدار سینتکسی در *statement* را " +"آزمایش می‌کند. همچنین آزمایش می‌کند که :exc:`SyntaxWarning` تنها یک بار صادر" +" می‌شود، و این که در صورت تبدیل شدن به خطا، به یک :exc:`SyntaxError` تبدیل " +"خواهد شد. *testcase* نمونه‌ی :mod:`unittest` برای آزمون است. *errtext* عبارت" +" باقاعده‌ای است که باید با نمایش رشته‌ای :exc:`SyntaxWarning` صادرشده و " +":exc:`SyntaxError` پرتاب‌شده مطابقت کند. اگر *lineno* برابر ``None`` نباشد، " +"با خط هشدار و استثنا مقایسه می‌شود. اگر *offset* برابر ``None`` نباشد، با " +"آفست استثنا مقایسه می‌شود." -msgid "A convenience wrapper for :func:`warnings.catch_warnings` that makes it easier to test that a warning was correctly raised. It is approximately equivalent to calling ``warnings.catch_warnings(record=True)`` with :meth:`warnings.simplefilter` set to ``always`` and with the option to automatically validate the results that are recorded." -msgstr "" +msgid "" +"A convenience wrapper for :func:`warnings.catch_warnings` that makes it " +"easier to test that a warning was correctly raised. It is approximately " +"equivalent to calling ``warnings.catch_warnings(record=True)`` with " +":meth:`warnings.simplefilter` set to ``always`` and with the option to " +"automatically validate the results that are recorded." +msgstr "" +"پوششی مناسب برای :func:`warnings.catch_warnings` که آزمون اینکه یک هشدار " +"به‌درستی پرتاب شده است را آسان‌تر می‌کند. این تقریباً معادل فراخوانی " +"``warnings.catch_warnings(record=True)`` است، با " +":meth:`warnings.simplefilter` که روی ``always`` تنظیم شده است و با گزینه‌ای " +"برای اعتبارسنجی خودکار نتایجی که ثبت می‌شوند." -msgid "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", WarningCategory)`` as positional arguments. If one or more *filters* are provided, or if the optional keyword argument *quiet* is ``False``, it checks to make sure the warnings are as expected: each specified filter must match at least one of the warnings raised by the enclosed code or the test fails, and if any warnings are raised that do not match any of the specified filters the test fails. To disable the first of these checks, set *quiet* to ``True``." -msgstr "" +msgid "" +"``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " +"WarningCategory)`` as positional arguments. If one or more *filters* are " +"provided, or if the optional keyword argument *quiet* is ``False``, it " +"checks to make sure the warnings are as expected: each specified filter " +"must match at least one of the warnings raised by the enclosed code or the " +"test fails, and if any warnings are raised that do not match any of the " +"specified filters the test fails. To disable the first of these checks, set" +" *quiet* to ``True``." +msgstr "" +"``check_warnings`` تاپل‌های دوتایی به شکل ``(\"message regexp\", " +"WarningCategory)`` را به‌عنوان آرگومان‌های جایگاهی می‌پذیرد. اگر یک یا چند " +"*filters* ارائه شود، یا آرگومان کلیدواژه‌ای اختیاری *quiet* برابر ``False`` " +"باشد، بررسی می‌کند تا اطمینان حاصل شود که هشدارها مطابق انتظار هستند: هر " +"فیلتر مشخص‌شده باید با حداقل یکی از هشدارهای صادرشده توسط کد محصورشده " +"مطابقت داشته باشد، در غیر این صورت آزمون شکست می‌خورد، و اگر هشدارهایی صادر " +"شوند که با هیچ‌یک از فیلترهای مشخص‌شده مطابقت نداشته باشند، آزمون شکست " +"می‌خورد. برای غیرفعال کردن اولین مورد از این بررسی‌ها، *quiet* را روی " +"``True`` تنظیم کنید." msgid "If no arguments are specified, it defaults to::" -msgstr "" +msgstr "اگر هیچ آرگومانی مشخص نشده باشد، به‌طور پیش‌فرض برابر است با::" msgid "check_warnings((\"\", Warning), quiet=True)" -msgstr "" +msgstr "check_warnings((\"\", Warning), quiet=True)" msgid "In this case all warnings are caught and no errors are raised." -msgstr "" +msgstr "در این حالت، همه‌ی هشدارها گرفته می‌شوند و هیچ خطایی پرتاب نمی‌شود." -msgid "On entry to the context manager, a :class:`WarningRecorder` instance is returned. The underlying warnings list from :func:`~warnings.catch_warnings` is available via the recorder object's :attr:`warnings` attribute. As a convenience, the attributes of the object representing the most recent warning can also be accessed directly through the recorder object (see example below). If no warning has been raised, then any of the attributes that would otherwise be expected on an object representing a warning will return ``None``." -msgstr "" +msgid "" +"On entry to the context manager, a :class:`WarningRecorder` instance is " +"returned. The underlying warnings list from :func:`~warnings.catch_warnings`" +" is available via the recorder object's :attr:`warnings` attribute. As a " +"convenience, the attributes of the object representing the most recent " +"warning can also be accessed directly through the recorder object (see " +"example below). If no warning has been raised, then any of the attributes " +"that would otherwise be expected on an object representing a warning will " +"return ``None``." +msgstr "" +"در هنگام ورود به مدیر زمینه، یک نمونه از :class:`WarningRecorder` بازگردانده" +" می‌شود. فهرست هشدارهای زیربنایی حاصل از :func:`~warnings.catch_warnings` از" +" طریق ویژگی :attr:`warnings` شیء ضبط‌کننده در دسترس است. برای سهولت، می‌توان" +" به ویژگی‌های شیء نمایانگر آخرین هشدار نیز مستقیماً از طریق شیء ضبط‌کننده " +"دسترسی پیدا کرد (مثال زیر را ببینید). اگر هیچ هشداری پرتاب نشده باشد، هر یک " +"از ویژگی‌هایی که در حالت عادی انتظار می‌رود در شیء نمایانگر هشدار وجود داشته" +" باشد، ``None`` را برمی‌گرداند." -msgid "The recorder object also has a :meth:`reset` method, which clears the warnings list." +msgid "" +"The recorder object also has a :meth:`reset` method, which clears the " +"warnings list." msgstr "" +"شیء ضبط‌کننده همچنین یک متد :meth:`reset` دارد که فهرست هشدارها را پاک " +"می‌کند." msgid "The context manager is designed to be used like this::" -msgstr "" +msgstr "این مدیر زمینه به‌گونه‌ای طراحی شده است که به این شکل استفاده شود::" msgid "" "with check_warnings((\"assertion is always true\", SyntaxWarning),\n" @@ -1150,12 +2564,24 @@ msgid "" " exec('assert(False, \"Hey!\")')\n" " warnings.warn(UserWarning(\"Hide me!\"))" msgstr "" +"with check_warnings((\"assertion is always true\", SyntaxWarning),\n" +" (\"\", UserWarning)):\n" +" exec('assert(False, \"Hey!\")')\n" +" warnings.warn(UserWarning(\"Hide me!\"))" -msgid "In this case if either warning was not raised, or some other warning was raised, :func:`check_warnings` would raise an error." +msgid "" +"In this case if either warning was not raised, or some other warning was " +"raised, :func:`check_warnings` would raise an error." msgstr "" +"در این حالت، اگر هر یک از هشدارها پرتاب نشده باشد، یا هشدار دیگری پرتاب شده " +"باشد، :func:`check_warnings` خطایی پرتاب می‌کند." -msgid "When a test needs to look more deeply into the warnings, rather than just checking whether or not they occurred, code like this can be used::" +msgid "" +"When a test needs to look more deeply into the warnings, rather than just " +"checking whether or not they occurred, code like this can be used::" msgstr "" +"هنگامی که یک آزمون نیاز دارد به‌جای بررسی صرف اینکه هشدارها رخ داده‌اند یا " +"خیر، آن‌ها را عمیق‌تر بررسی کند، می‌توان از کدی مانند این استفاده کرد::" msgid "" "with check_warnings(quiet=True) as w:\n" @@ -1168,12 +2594,29 @@ msgid "" " w.reset()\n" " assert len(w.warnings) == 0" msgstr "" +"with check_warnings(quiet=True) as w:\n" +" warnings.warn(\"foo\")\n" +" assert str(w.args[0]) == \"foo\"\n" +" warnings.warn(\"bar\")\n" +" assert str(w.args[0]) == \"bar\"\n" +" assert str(w.warnings[0].args[0]) == \"foo\"\n" +" assert str(w.warnings[1].args[0]) == \"bar\"\n" +" w.reset()\n" +" assert len(w.warnings) == 0" -msgid "Here all warnings will be caught, and the test code tests the captured warnings directly." +msgid "" +"Here all warnings will be caught, and the test code tests the captured " +"warnings directly." msgstr "" +"در اینجا تمام هشدارها گرفته خواهند شد و کد آزمون، هشدارهای گرفته‌شده را " +"مستقیماً آزمون می‌کند." msgid "New optional arguments *filters* and *quiet*." -msgstr "" +msgstr "آرگومان‌های اختیاری جدید *filters* و *quiet*." -msgid "Class used to record warnings for unit tests. See documentation of :func:`check_warnings` above for more details." +msgid "" +"Class used to record warnings for unit tests. See documentation of " +":func:`check_warnings` above for more details." msgstr "" +"کلاسی که برای ثبت هشدارها در آزمون واحد‌ها استفاده می‌شود. برای جزئیات بیشتر،" +" مستندات :func:`check_warnings` در بالا را ببینید." diff --git a/library/text.po b/library/text.po index 184d8d79b..fb134ab67 100644 --- a/library/text.po +++ b/library/text.po @@ -22,10 +22,20 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Text Processing Services" -msgstr "" +msgstr "خدمات پردازش متن" -msgid "The modules described in this chapter provide a wide range of string manipulation operations and other text processing services." +msgid "" +"The modules described in this chapter provide a wide range of string " +"manipulation operations and other text processing services." msgstr "" +"ماژول‌های توصیف‌شده در این فصل، طیف وسیعی از عملیات دستکاری رشته و سایر " +"خدمات پردازش متن را فراهم می‌کنند." -msgid "The :mod:`codecs` module described under :ref:`binaryservices` is also highly relevant to text processing. In addition, see the documentation for Python's built-in string type in :ref:`textseq`." +msgid "" +"The :mod:`codecs` module described under :ref:`binaryservices` is also " +"highly relevant to text processing. In addition, see the documentation for " +"Python's built-in string type in :ref:`textseq`." msgstr "" +"ماژول :mod:`codecs` که در :ref:`binaryservices` شرح داده‌شده است، همچنین " +"ارتباط زیادی با پردازش متن دارد. علاوه بر این، مستندات نوع رشته‌ی توکار " +"پایتون را در :ref:`textseq` ببینید." diff --git a/library/textwrap.po b/library/textwrap.po index 2d63b1dd3..b502aceb1 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -24,37 +24,79 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!textwrap` --- Text wrapping and filling" -msgstr "" +msgstr ":mod:`!textwrap` --- پیچیدن و پر کردن متن" msgid "**Source code:** :source:`Lib/textwrap.py`" -msgstr "" +msgstr ":source:`Lib/textwrap.py`" -msgid "The :mod:`!textwrap` module provides some convenience functions, as well as :class:`TextWrapper`, the class that does all the work. If you're just wrapping or filling one or two text strings, the convenience functions should be good enough; otherwise, you should use an instance of :class:`TextWrapper` for efficiency." -msgstr "" +msgid "" +"The :mod:`!textwrap` module provides some convenience functions, as well as " +":class:`TextWrapper`, the class that does all the work. If you're just " +"wrapping or filling one or two text strings, the convenience functions " +"should be good enough; otherwise, you should use an instance of " +":class:`TextWrapper` for efficiency." +msgstr "" +"ماژول :mod:`!textwrap` چند تابع سهولت‌بخش و همچنین :class:`TextWrapper`، " +"کلاسی که تمام کارها را انجام می‌دهد، فراهم می‌کند. اگر فقط در حال پیچیدن " +"(wrapping) یا پر کردن (filling) یک یا دو رشته متنی هستید، توابع سهولت‌بخش " +"باید کافی باشند؛ در غیر این صورت، برای کارایی باید از نمونه‌ای از " +":class:`TextWrapper` استفاده کنید." -msgid "Wraps the single paragraph in *text* (a string) so every line is at most *width* characters long. Returns a list of output lines, without final newlines." +msgid "" +"Wraps the single paragraph in *text* (a string) so every line is at most " +"*width* characters long. Returns a list of output lines, without final " +"newlines." msgstr "" +"پاراگراف واحد در *text* (یک رشته) را می‌شکند تا طول هر خط حداکثر *width* " +"نویسه باشد. فهرستی از خطوط خروجی را بدون نویسه‌های خط جدید پایانی " +"برمی‌گرداند." -msgid "Optional keyword arguments correspond to the instance attributes of :class:`TextWrapper`, documented below." +msgid "" +"Optional keyword arguments correspond to the instance attributes of " +":class:`TextWrapper`, documented below." msgstr "" +"آرگومان‌های کلیدواژه‌ای اختیاری متناظر با ویژگی‌های نمونه‌ی " +":class:`TextWrapper` هستند که در زیر مستند شده‌اند." -msgid "See the :meth:`TextWrapper.wrap` method for additional details on how :func:`wrap` behaves." +msgid "" +"See the :meth:`TextWrapper.wrap` method for additional details on how " +":func:`wrap` behaves." msgstr "" +"برای جزئیات بیشتر درباره چگونگی رفتار :func:`wrap`، متد " +":meth:`TextWrapper.wrap` را ببینید." -msgid "Wraps the single paragraph in *text*, and returns a single string containing the wrapped paragraph. :func:`fill` is shorthand for ::" +msgid "" +"Wraps the single paragraph in *text*, and returns a single string containing" +" the wrapped paragraph. :func:`fill` is shorthand for ::" msgstr "" +"بند واحد موجود در *text* را خط‌بندی می‌کند و یک رشته واحد شامل بند " +"خط‌بندی‌شده را برمی‌گرداند. :func:`fill` میان‌بری برای ::" msgid "\"\\n\".join(wrap(text, ...))" -msgstr "" +msgstr "\"\\n\".join(wrap(text, ...))" -msgid "In particular, :func:`fill` accepts exactly the same keyword arguments as :func:`wrap`." +msgid "" +"In particular, :func:`fill` accepts exactly the same keyword arguments as " +":func:`wrap`." msgstr "" +"به‌ویژه، :func:`fill` دقیقاً همان آرگومان‌های کلیدواژه‌ای :func:`wrap` را " +"می‌پذیرد." msgid "Collapse and truncate the given *text* to fit in the given *width*." msgstr "" +"متن *text* داده‌شده را فشرده و کوتاه کنید تا در عرض *width* داده‌شده جای " +"گیرد." -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 *placeholder* fit within *width*::" +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 *placeholder* fit within *width*::" msgstr "" +"ابتدا فضای سفید در *text* فشرده می‌شود (تمام فضای سفید با فاصله‌های تکی " +"جایگزین می‌شود). اگر نتیجه در *width* بگنجد، برگردانده می‌شود. در غیر این " +"صورت، تعداد کافی از واژه‌ها از انتها حذف می‌شوند تا واژه‌های باقی‌مانده " +"به‌همراه *placeholder* در *width* بگنجند::" msgid "" ">>> textwrap.shorten(\"Hello world!\", width=12)\n" @@ -64,24 +106,58 @@ msgid "" ">>> textwrap.shorten(\"Hello world\", width=10, placeholder=\"...\")\n" "'Hello...'" msgstr "" +">>> textwrap.shorten(\"Hello world!\", width=12)\n" +"'Hello world!'\n" +">>> textwrap.shorten(\"Hello world!\", width=11)\n" +"'Hello [...]'\n" +">>> textwrap.shorten(\"Hello world\", width=10, placeholder=\"...\")\n" +"'Hello...'" -msgid "Optional keyword arguments correspond to the instance attributes of :class:`TextWrapper`, documented below. Note that the whitespace is collapsed before the text is passed to the :class:`TextWrapper` :meth:`fill` function, so changing the value of :attr:`.tabsize`, :attr:`.expand_tabs`, :attr:`.drop_whitespace`, and :attr:`.replace_whitespace` will have no effect." -msgstr "" +msgid "" +"Optional keyword arguments correspond to the instance attributes of " +":class:`TextWrapper`, documented below. Note that the whitespace is " +"collapsed before the text is passed to the :class:`TextWrapper` :meth:`fill`" +" function, so changing the value of :attr:`.tabsize`, :attr:`.expand_tabs`, " +":attr:`.drop_whitespace`, and :attr:`.replace_whitespace` will have no " +"effect." +msgstr "" +"آرگومان‌های کلیدواژه‌ای اختیاری متناظر با ویژگی‌های نمونه‌ی " +":class:`TextWrapper` هستند که در ادامه مستند شده‌اند. توجه داشته باشید که " +"فضاهای خالی پیش از آنکه متن به تابع :meth:`fill` کلاس :class:`TextWrapper` " +"ارسال شود، فشرده می‌شوند؛ بنابراین تغییر مقدار :attr:`.tabsize`، " +":attr:`.expand_tabs`، :attr:`.drop_whitespace` و :attr:`.replace_whitespace`" +" اثری نخواهد داشت." msgid "Remove any common leading whitespace from every line in *text*." -msgstr "" +msgstr "هرگونه فضای سفید مشترک را از ابتدای هر خط در *text* حذف می‌کند." -msgid "This can be used to make triple-quoted strings line up with the left edge of the display, while still presenting them in the source code in indented form." +msgid "" +"This can be used to make triple-quoted strings line up with the left edge of" +" the display, while still presenting them in the source code in indented " +"form." msgstr "" +"می‌توان از این قابلیت برای هم‌تراز کردن رشته‌های سه‌نقل‌قولی با لبه‌ی چپ " +"نمایش استفاده کرد، در حالی که همچنان در کد منبع به‌صورت فرورفته ارائه " +"می‌شوند." -msgid "Note that tabs and spaces are both treated as whitespace, but they are not equal: the lines ``\" hello\"`` and ``\"\\thello\"`` are considered to have no common leading whitespace." +msgid "" +"Note that tabs and spaces are both treated as whitespace, but they are not " +"equal: the lines ``\" hello\"`` and ``\"\\thello\"`` are considered to have" +" no common leading whitespace." msgstr "" +"توجه داشته باشید که تب‌ها و فاصله‌ها هر دو به‌عنوان فضای سفید در نظر گرفته " +"می‌شوند، اما برابر نیستند: خطوط ``\" hello\"`` و ``\"\\thello\"`` به‌عنوان " +"خطوطی در نظر گرفته می‌شوند که هیچ فضای سفید پیشرو مشترکی ندارند." -msgid "Lines containing only whitespace are ignored in the input and normalized to a single newline character in the output." +msgid "" +"Lines containing only whitespace are ignored in the input and normalized to " +"a single newline character in the output." msgstr "" +"خط‌هایی که فقط شامل فضای سفید هستند، در ورودی نادیده گرفته می‌شوند و در " +"خروجی به یک نویسه خط جدید نرمال‌سازی می‌شوند." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "def test():\n" @@ -93,27 +169,54 @@ msgid "" " print(repr(s)) # prints ' hello\\n world\\n '\n" " print(repr(dedent(s))) # prints 'hello\\n world\\n'" msgstr "" +"def test():\n" +" # end first line with \\ to avoid the empty line!\n" +" s = '''\\\n" +" hello\n" +" world\n" +" '''\n" +" print(repr(s)) # prints ' hello\\n world\\n '\n" +" print(repr(dedent(s))) # prints 'hello\\n world\\n'" -msgid "The :func:`!dedent` function now correctly normalizes blank lines containing only whitespace characters. Previously, the implementation only normalized blank lines containing tabs and spaces." +msgid "" +"The :func:`!dedent` function now correctly normalizes blank lines containing" +" only whitespace characters. Previously, the implementation only normalized " +"blank lines containing tabs and spaces." msgstr "" +"تابع :func:`!dedent` اکنون خط‌های خالی را که فقط حاوی نویسه‌های فضای خالی " +"هستند، به‌درستی عادی‌سازی می‌کند. پیش‌تر، پیاده‌سازی فقط خط‌های خالی حاوی " +"تب‌ها و فاصله‌ها را عادی‌سازی می‌کرد." msgid "Add *prefix* to the beginning of selected lines in *text*." -msgstr "" +msgstr "*prefix* را به ابتدای خطوط انتخاب‌شده در *text* اضافه کنید." msgid "Lines are separated by calling ``text.splitlines(True)``." -msgstr "" +msgstr "خط‌ها با فراخوانی ``text.splitlines(True)`` جدا می‌شوند." -msgid "By default, *prefix* is added to all lines that do not consist solely of whitespace (including any line endings)." +msgid "" +"By default, *prefix* is added to all lines that do not consist solely of " +"whitespace (including any line endings)." msgstr "" +"به‌طور پیش‌فرض، *prefix* به تمام خطوطی که فقط از فضای خالی (از جمله هرگونه " +"پایان خط) تشکیل نشده‌اند، اضافه می‌شود." msgid "" ">>> s = 'hello\\n\\n \\nworld'\n" ">>> indent(s, ' ')\n" "' hello\\n\\n \\n world'" msgstr "" +">>> s = 'hello\\n\\n \\nworld'\n" +">>> indent(s, ' ')\n" +"' hello\\n\\n \\n world'" -msgid "The optional *predicate* argument can be used to control which lines are indented. For example, it is easy to add *prefix* to even empty and whitespace-only lines::" +msgid "" +"The optional *predicate* argument can be used to control which lines are " +"indented. For example, it is easy to add *prefix* to even empty and " +"whitespace-only lines::" msgstr "" +"آرگومان اختیاری *predicate* می‌تواند برای کنترل اینکه کدام خطوط تورفتگی داده" +" شوند استفاده شود. برای مثال، افزودن *prefix* حتی به خطوط خالی و خطوط فقط " +"دارای فضای سفید آسان است::" msgid "" ">>> print(indent(s, '+ ', lambda line: True))\n" @@ -122,101 +225,269 @@ msgid "" "+\n" "+ world" msgstr "" +">>> print(indent(s, '+ ', lambda line: True))\n" +"+ hello\n" +"+\n" +"+\n" +"+ world" -msgid ":func:`wrap`, :func:`fill` and :func:`shorten` work by creating a :class:`TextWrapper` instance and calling a single method on it. That instance is not reused, so for applications that process many text strings using :func:`wrap` and/or :func:`fill`, it may be more efficient to create your own :class:`TextWrapper` object." -msgstr "" +msgid "" +":func:`wrap`, :func:`fill` and :func:`shorten` work by creating a " +":class:`TextWrapper` instance and calling a single method on it. That " +"instance is not reused, so for applications that process many text strings " +"using :func:`wrap` and/or :func:`fill`, it may be more efficient to create " +"your own :class:`TextWrapper` object." +msgstr "" +":func:`wrap`، :func:`fill` و :func:`shorten` با ایجاد یک نمونه " +":class:`TextWrapper` و فراخوانی یک متد واحد بر روی آن کار می‌کنند. این نمونه" +" دوباره استفاده نمی‌شود، بنابراین برای برنامه‌هایی که رشته‌های متنی بسیاری " +"را با استفاده از :func:`wrap` و/یا :func:`fill` پردازش می‌کنند، ممکن است " +"کارآمدتر باشد که شیء :class:`TextWrapper` خود را ایجاد کنید." -msgid "Text is preferably wrapped on whitespaces and right after the hyphens in hyphenated words; only then will long words be broken if necessary, unless :attr:`TextWrapper.break_long_words` is set to false." +msgid "" +"Text is preferably wrapped on whitespaces and right after the hyphens in " +"hyphenated words; only then will long words be broken if necessary, unless " +":attr:`TextWrapper.break_long_words` is set to false." msgstr "" +"متن ترجیحاً در فضاهای خالی و درست پس از خط‌تیره‌ها در کلمات خط‌تیره‌دار " +"شکسته می‌شود؛ تنها در این صورت است که کلمات طولانی در صورت لزوم شکسته خواهند" +" شد، مگر اینکه :attr:`TextWrapper.break_long_words` روی false تنظیم شده " +"باشد." -msgid "The :class:`TextWrapper` constructor accepts a number of optional keyword arguments. Each keyword argument corresponds to an instance attribute, so for example ::" +msgid "" +"The :class:`TextWrapper` constructor accepts a number of optional keyword " +"arguments. Each keyword argument corresponds to an instance attribute, so " +"for example ::" msgstr "" +"سازنده‌ی :class:`TextWrapper` تعدادی آرگومان کلیدواژه‌ای اختیاری می‌پذیرد. " +"هر آرگومان کلیدواژه‌ای با یک ویژگی نمونه متناظر است، بنابراین برای مثال ::" msgid "wrapper = TextWrapper(initial_indent=\"* \")" -msgstr "" +msgstr "wrapper = TextWrapper(initial_indent=\"* \")" msgid "is the same as ::" -msgstr "" +msgstr "معادل است با ::" msgid "" "wrapper = TextWrapper()\n" "wrapper.initial_indent = \"* \"" msgstr "" +"wrapper = TextWrapper()\n" +"wrapper.initial_indent = \"* \"" -msgid "You can reuse the same :class:`TextWrapper` object many times, and you can change any of its options through direct assignment to instance attributes between uses." +msgid "" +"You can reuse the same :class:`TextWrapper` object many times, and you can " +"change any of its options through direct assignment to instance attributes " +"between uses." msgstr "" +"شما می‌توانید بارها از همان شیء :class:`TextWrapper` استفاده مجدد کنید و " +"می‌توانید هر یک از گزینه‌های آن را بین استفاده‌ها از طریق انتساب مستقیم به " +"ویژگی‌های نمونه تغییر دهید." -msgid "The :class:`TextWrapper` instance attributes (and keyword arguments to the constructor) are as follows:" +msgid "" +"The :class:`TextWrapper` instance attributes (and keyword arguments to the " +"constructor) are as follows:" msgstr "" +"ویژگی‌های نمونه‌ی :class:`TextWrapper` (و آرگومان‌های کلیدواژه‌ای سازنده) به" +" شرح زیر است:" -msgid "(default: ``70``) The maximum length of wrapped lines. As long as there are no individual words in the input text longer than :attr:`width`, :class:`TextWrapper` guarantees that no output line will be longer than :attr:`width` characters." +msgid "" +"(default: ``70``) The maximum length of wrapped lines. As long as there are" +" no individual words in the input text longer than :attr:`width`, " +":class:`TextWrapper` guarantees that no output line will be longer than " +":attr:`width` characters." msgstr "" +"(پیش‌فرض: ``70``) حداکثر طول خطوط شکسته‌شده. تا زمانی که در متن ورودی هیچ " +"کلمه‌ی منفردی طولانی‌تر از :attr:`width` وجود نداشته باشد، " +":class:`TextWrapper` تضمین می‌کند که هیچ خط خروجی‌ای طولانی‌تر از " +":attr:`width` نویسه نخواهد بود." -msgid "(default: ``True``) If true, then all tab characters in *text* will be expanded to spaces using the :meth:`~str.expandtabs` method of *text*." +msgid "" +"(default: ``True``) If true, then all tab characters in *text* will be " +"expanded to spaces using the :meth:`~str.expandtabs` method of *text*." msgstr "" +"(پیش‌فرض: ``True``) اگر درست باشد، همه‌ی نویسه‌های تب در *text* با استفاده از" +" متد :meth:`~str.expandtabs` از *text* به فاصله تبدیل می‌شوند." -msgid "(default: ``8``) If :attr:`expand_tabs` is true, then all tab characters in *text* will be expanded to zero or more spaces, depending on the current column and the given tab size." +msgid "" +"(default: ``8``) If :attr:`expand_tabs` is true, then all tab characters in " +"*text* will be expanded to zero or more spaces, depending on the current " +"column and the given tab size." msgstr "" +"(پیش‌فرض: ``8``) اگر :attr:`expand_tabs` درست باشد، تمام نویسه‌های Tab در " +"*text* بسته به ستون جاری و اندازه‌ی Tab داده‌شده، به صفر یا چند فاصله تبدیل " +"می‌شوند." -msgid "(default: ``True``) If true, after tab expansion but before wrapping, the :meth:`wrap` method will replace each whitespace character with a single space. The whitespace characters replaced are as follows: tab, newline, vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." +msgid "" +"(default: ``True``) If true, after tab expansion but before wrapping, the " +":meth:`wrap` method will replace each whitespace character with a single " +"space. The whitespace characters replaced are as follows: tab, newline, " +"vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." msgstr "" +"(پیش‌فرض: ``True``) اگر True باشد، پس از بسط تب اما پیش از خط‌پیچی " +"(wrapping)، متد :meth:`wrap` هر نویسه فضای خالی را با یک فاصله جایگزین " +"می‌کند. نویسه‌های فضای خالی که جایگزین می‌شوند عبارت‌اند از: تب، خط جدید، تب" +" عمودی، فرم‌فید و بازگشت به ابتدای سطر (``'\\t\\n\\v\\f\\r'``)." -msgid "If :attr:`expand_tabs` is false and :attr:`replace_whitespace` is true, each tab character will be replaced by a single space, which is *not* the same as tab expansion." +msgid "" +"If :attr:`expand_tabs` is false and :attr:`replace_whitespace` is true, each" +" tab character will be replaced by a single space, which is *not* the same " +"as tab expansion." msgstr "" +"اگر :attr:`expand_tabs` نادرست و :attr:`replace_whitespace` درست باشد، هر " +"نویسه‌ی تب با یک فاصله جایگزین می‌شود، که این *با* گسترش تب یکسان نیست." -msgid "If :attr:`replace_whitespace` is false, newlines may appear in the middle of a line and cause strange output. For this reason, text should be split into paragraphs (using :meth:`str.splitlines` or similar) which are wrapped separately." +msgid "" +"If :attr:`replace_whitespace` is false, newlines may appear in the middle of" +" a line and cause strange output. For this reason, text should be split into" +" paragraphs (using :meth:`str.splitlines` or similar) which are wrapped " +"separately." msgstr "" +"اگر :attr:`replace_whitespace` نادرست باشد، ممکن است نویسه‌های خط جدید در " +"میانه‌ی یک خط ظاهر شوند و باعث ایجاد خروجی عجیبی شوند. به همین دلیل، متن باید" +" به پاراگراف‌ها تقسیم شود (با استفاده از :meth:`str.splitlines` یا مشابه آن)" +" که هرکدام به‌صورت جداگانه پیچیده شوند." -msgid "(default: ``True``) If true, whitespace at the beginning and ending of every line (after wrapping but before indenting) is dropped. Whitespace at the beginning of the paragraph, however, is not dropped if non-whitespace follows it. If whitespace being dropped takes up an entire line, the whole line is dropped." +msgid "" +"(default: ``True``) If true, whitespace at the beginning and ending of every" +" line (after wrapping but before indenting) is dropped. Whitespace at the " +"beginning of the paragraph, however, is not dropped if non-whitespace " +"follows it. If whitespace being dropped takes up an entire line, the whole " +"line is dropped." msgstr "" +"(پیش‌فرض: ``True``) اگر درست باشد، فضای سفید در ابتدا و انتهای هر خط (پس از " +"خط‌بندی اما پیش از تورفتگی) حذف می‌شود. با این حال، فضای سفید در ابتدای " +"پاراگراف حذف نمی‌شود، اگر به دنبال آن نویسه‌ای غیر از فضای سفید بیاید. اگر " +"فضای سفیدی که حذف می‌شود یک خط کامل را تشکیل دهد، کل خط حذف می‌شود." -msgid "(default: ``''``) String that will be prepended to the first line of wrapped output. Counts towards the length of the first line. The empty string is not indented." +msgid "" +"(default: ``''``) String that will be prepended to the first line of wrapped" +" output. Counts towards the length of the first line. The empty string is " +"not indented." msgstr "" +"(پیش‌فرض: ``''``) رشته‌ای که به ابتدای اولین خط از خروجی شکسته‌شده اضافه " +"می‌شود. در طول اولین خط لحاظ می‌شود. رشته خالی تورفتگی ایجاد نمی‌کند." -msgid "(default: ``''``) String that will be prepended to all lines of wrapped output except the first. Counts towards the length of each line except the first." +msgid "" +"(default: ``''``) String that will be prepended to all lines of wrapped " +"output except the first. Counts towards the length of each line except the " +"first." msgstr "" +"(پیش‌فرض: ``''``) رشته‌ای که به ابتدای تمام خطوط خروجی خط‌پیچی‌شده به‌جز خط " +"اول اضافه می‌شود. جزء طول هر خط به‌جز خط اول محسوب می‌شود." -msgid "(default: ``False``) If true, :class:`TextWrapper` attempts to detect sentence endings and ensure that sentences are always separated by exactly two spaces. This is generally desired for text in a monospaced font. However, the sentence detection algorithm is imperfect: it assumes that a sentence ending consists of a lowercase letter followed by one of ``'.'``, ``'!'``, or ``'?'``, possibly followed by one of ``'\"'`` or ``\"'\"``, followed by a space. One problem with this algorithm is that it is unable to detect the difference between \"Dr.\" in ::" -msgstr "" +msgid "" +"(default: ``False``) If true, :class:`TextWrapper` attempts to detect " +"sentence endings and ensure that sentences are always separated by exactly " +"two spaces. This is generally desired for text in a monospaced font. " +"However, the sentence detection algorithm is imperfect: it assumes that a " +"sentence ending consists of a lowercase letter followed by one of ``'.'``, " +"``'!'``, or ``'?'``, possibly followed by one of ``'\"'`` or ``\"'\"``, " +"followed by a space. One problem with this algorithm is that it is unable " +"to detect the difference between \"Dr.\" in ::" +msgstr "" +"(پیش‌فرض: ``False``) اگر درست باشد، :class:`TextWrapper` تلاش می‌کند پایان " +"جملات را تشخیص دهد و تضمین کند که جملات همیشه با دقیقاً دو فاصله از هم جدا " +"شوند. این حالت معمولاً برای متن با قلم تک‌فاصله مطلوب است. با این حال، " +"الگوریتم تشخیص جمله کامل نیست: فرض می‌کند که پایان یک جمله از یک حرف کوچک " +"تشکیل شده است که پس از آن یکی از ``'.'``، ``'!'`` یا ``'?'`` می‌آید، ممکن " +"است پس از آن یکی از ``'\"'`` یا ``\"'\"`` و سپس یک فاصله بیاید. یکی از " +"مشکلات این الگوریتم ناتوانی آن در تشخیص تفاوت بین «Dr.» در ::" msgid "[...] Dr. Frankenstein's monster [...]" -msgstr "" +msgstr "[...] هیولای دکتر فرانکنشتاین [...]" msgid "and \"Spot.\" in ::" -msgstr "" +msgstr "و \"Spot.\" در ::" msgid "[...] See Spot. See Spot run [...]" -msgstr "" +msgstr "[...] اسپات را ببینید. اسپات را در حال دویدن ببینید [...]" msgid ":attr:`fix_sentence_endings` is false by default." -msgstr "" +msgstr ":attr:`fix_sentence_endings` به‌طور پیش‌فرض نادرست است." -msgid "Since the sentence detection algorithm relies on ``string.lowercase`` for the definition of \"lowercase letter\", and a convention of using two spaces after a period to separate sentences on the same line, it is specific to English-language texts." +msgid "" +"Since the sentence detection algorithm relies on ``string.lowercase`` for " +"the definition of \"lowercase letter\", and a convention of using two spaces" +" after a period to separate sentences on the same line, it is specific to " +"English-language texts." msgstr "" +"از آنجا که الگوریتم تشخیص جمله برای تعریف «نویسه کوچک» به " +"``string.lowercase`` و به قرارداد استفاده از دو فاصله پس از نقطه برای جدا " +"کردن جمله‌ها در یک خط متکی است، این الگوریتم مختص متن‌های انگلیسی‌زبان است." -msgid "(default: ``True``) If true, then words longer than :attr:`width` will be broken in order to ensure that no lines are longer than :attr:`width`. If it is false, long words will not be broken, and some lines may be longer than :attr:`width`. (Long words will be put on a line by themselves, in order to minimize the amount by which :attr:`width` is exceeded.)" -msgstr "" +msgid "" +"(default: ``True``) If true, then words longer than :attr:`width` will be " +"broken in order to ensure that no lines are longer than :attr:`width`. If " +"it is false, long words will not be broken, and some lines may be longer " +"than :attr:`width`. (Long words will be put on a line by themselves, in " +"order to minimize the amount by which :attr:`width` is exceeded.)" +msgstr "" +"(پیش‌فرض: ``True``) اگر مقدار درست باشد، واژه‌های طولانی‌تر از :attr:`width`" +" شکسته خواهند شد تا اطمینان حاصل شود که هیچ خطی طولانی‌تر از :attr:`width` " +"نباشد. اگر مقدار نادرست باشد، واژه‌های طولانی شکسته نخواهند شد و برخی خط‌ها " +"ممکن است طولانی‌تر از :attr:`width` باشند. (واژه‌های طولانی در خطی جداگانه " +"قرار خواهند گرفت تا میزان فراتر رفتن از :attr:`width` به حداقل برسد.)" -msgid "(default: ``True``) If true, wrapping will occur preferably on whitespaces and right after hyphens in compound words, as it is customary in English. If false, only whitespaces will be considered as potentially good places for line breaks, but you need to set :attr:`break_long_words` to false if you want truly insecable words. Default behaviour in previous versions was to always allow breaking hyphenated words." -msgstr "" +msgid "" +"(default: ``True``) If true, wrapping will occur preferably on whitespaces " +"and right after hyphens in compound words, as it is customary in English. If" +" false, only whitespaces will be considered as potentially good places for " +"line breaks, but you need to set :attr:`break_long_words` to false if you " +"want truly insecable words. Default behaviour in previous versions was to " +"always allow breaking hyphenated words." +msgstr "" +"(پیش‌فرض: ``True``) اگر True باشد، شکستن خطوط ترجیحاً در فضاهای خالی و " +"بلافاصله پس از خط‌تیره‌ها در کلمات مرکب انجام می‌شود، همان‌گونه که در " +"انگلیسی مرسوم است. اگر False باشد، فقط فضاهای خالی به‌عنوان مکان‌های مناسب " +"بالقوه برای شکست خط در نظر گرفته می‌شوند، اما اگر کلماتی واقعاً غیرقابل " +"شکستن می‌خواهید، باید :attr:`break_long_words` را روی False تنظیم کنید. " +"رفتار پیش‌فرض در نسخه‌های پیشین این بود که همیشه اجازه شکستن کلمات " +"خط‌تیره‌دار داده شود." -msgid "(default: ``None``) If not ``None``, then the output will contain at most *max_lines* lines, with *placeholder* appearing at the end of the output." +msgid "" +"(default: ``None``) If not ``None``, then the output will contain at most " +"*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" +"(پیش‌فرض: ``None``) اگر ``None`` نباشد، خروجی شامل حداکثر *max_lines* خط " +"خواهد بود و *placeholder* در انتهای خروجی ظاهر می‌شود." -msgid "(default: ``' [...]'``) String that will appear at the end of the output text if it has been truncated." +msgid "" +"(default: ``' [...]'``) String that will appear at the end of the output " +"text if it has been truncated." msgstr "" +"(پیش‌فرض: ``' [...]'``) رشته‌ای که اگر متن خروجی بریده شده باشد، در انتهای " +"آن ظاهر می‌شود." -msgid ":class:`TextWrapper` also provides some public methods, analogous to the module-level convenience functions:" +msgid "" +":class:`TextWrapper` also provides some public methods, analogous to the " +"module-level convenience functions:" msgstr "" +":class:`TextWrapper` همچنین برخی متدهای عمومی را نیز ارائه می‌دهد، مشابه " +"توابع راحتی سطح ماژول:" -msgid "Wraps the single paragraph in *text* (a string) so every line is at most :attr:`width` characters long. All wrapping options are taken from instance attributes of the :class:`TextWrapper` instance. Returns a list of output lines, without final newlines. If the wrapped output has no content, the returned list is empty." -msgstr "" +msgid "" +"Wraps the single paragraph in *text* (a string) so every line is at most " +":attr:`width` characters long. All wrapping options are taken from instance" +" attributes of the :class:`TextWrapper` instance. Returns a list of output " +"lines, without final newlines. If the wrapped output has no content, the " +"returned list is empty." +msgstr "" +"بند واحد موجود در *text* (یک رشته) را می‌پیچد تا طول هر خط حداکثر " +":attr:`width` نویسه باشد. تمام گزینه‌های پیچیدن (wrapping) از ویژگی‌های " +"نمونه‌ی :class:`TextWrapper` گرفته می‌شوند. فهرستی از خطوط خروجی را " +"برمی‌گرداند، بدون نویسه‌های خط جدید پایانی. اگر خروجی حاصل از پیچیدن محتوایی" +" نداشته باشد، فهرست برگردانده‌شده خالی است." -msgid "Wraps the single paragraph in *text*, and returns a single string containing the wrapped paragraph." +msgid "" +"Wraps the single paragraph in *text*, and returns a single string containing" +" the wrapped paragraph." msgstr "" +"پاراگراف واحد موجود در *text* را می‌پیچد و یک رشته واحد شامل پاراگراف " +"پیچیده‌شده را برمی‌گرداند." msgid "..." -msgstr "" +msgstr "..." msgid "placeholder" -msgstr "" +msgstr "جای‌نگهدار" diff --git a/library/threading.po b/library/threading.po index 43ffbfbc9..a7cf9d652 100644 --- a/library/threading.po +++ b/library/threading.po @@ -24,28 +24,57 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!threading` --- Thread-based parallelism" -msgstr "" +msgstr ":mod:`!threading` --- موازی‌سازی مبتنی بر نخ" msgid "**Source code:** :source:`Lib/threading.py`" -msgstr "" +msgstr ":source:`Lib/threading.py`" -msgid "This module constructs higher-level threading interfaces on top of the lower level :mod:`_thread` module." +msgid "" +"This module constructs higher-level threading interfaces on top of the lower" +" level :mod:`_thread` module." msgstr "" +"این ماژول رابط‌های نخ‌بندی سطح بالاتر را بر روی ماژول سطح پایین‌تر " +":mod:`_thread` ایجاد می‌کند." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "This module does not work or is not available on WebAssembly. See :ref:`wasm-availability` for more information." +msgid "" +"This module does not work or is not available on WebAssembly. See " +":ref:`wasm-availability` for more information." msgstr "" +"این ماژول روی WebAssembly کار نمی‌کند یا در دسترس نیست. برای اطلاعات بیشتر، " +":ref:`wasm-availability` را ببینید." msgid "Introduction" -msgstr "" +msgstr "مقدمه" -msgid "The :mod:`!threading` module provides a way to run multiple `threads `_ (smaller units of a process) concurrently within a single process. It allows for the creation and management of threads, making it possible to execute tasks in parallel, sharing memory space. Threads are particularly useful when tasks are I/O bound, such as file operations or making network requests, where much of the time is spent waiting for external resources." -msgstr "" +msgid "" +"The :mod:`!threading` module provides a way to run multiple `threads " +"`_ (smaller units of a " +"process) concurrently within a single process. It allows for the creation " +"and management of threads, making it possible to execute tasks in parallel, " +"sharing memory space. Threads are particularly useful when tasks are I/O " +"bound, such as file operations or making network requests, where much of the" +" time is spent waiting for external resources." +msgstr "" +"ماژول :mod:`!threading` راهی برای اجرای همزمان چندین `نخ " +"`_ (واحدهای کوچک‌تری از یک" +" فرآیند) در یک فرآیند واحد فراهم می‌کند. این ماژول امکان ایجاد و مدیریت " +"نخ‌ها را فراهم می‌کند و اجرای وظایف را به‌صورت موازی، با اشتراک‌گذاری فضای " +"حافظه، ممکن می‌سازد. نخ‌ها به‌ویژه زمانی مفید هستند که وظایف محدود به I/O " +"باشند، مانند عملیات فایل یا ارسال درخواست‌های شبکه، که بخش زیادی از زمان صرف" +" انتظار برای منابع خارجی می‌شود." -msgid "A typical use case for :mod:`!threading` includes managing a pool of worker threads that can process multiple tasks concurrently. Here's a basic example of creating and starting threads using :class:`~threading.Thread`::" +msgid "" +"A typical use case for :mod:`!threading` includes managing a pool of worker " +"threads that can process multiple tasks concurrently. Here's a basic " +"example of creating and starting threads using :class:`~threading.Thread`::" msgstr "" +"یک مورد استفاده رایج برای :mod:`!threading` شامل مدیریت استخری از نخ‌های " +"کاری است که می‌توانند چندین وظیفه را به‌طور همزمان پردازش کنند. در ادامه یک " +"مثال پایه از ایجاد و شروع نخ‌ها با استفاده از :class:`~threading.Thread` " +"آمده است::" msgid "" "import threading\n" @@ -77,156 +106,405 @@ msgid "" "for t in threads:\n" " t.join()" msgstr "" +"import threading\n" +"import time\n" +"\n" +"def crawl(link, delay=3):\n" +" print(f\"crawl started for {link}\")\n" +" time.sleep(delay) # I/O مسدودکننده (شبیه‌سازی یک درخواست شبکه)\n" +" print(f\"crawl ended for {link}\")\n" +"\n" +"links = [\n" +" \"https://python.org\",\n" +" \"https://docs.python.org\",\n" +" \"https://peps.python.org\",\n" +"]\n" +"\n" +"# آغاز نخ‌ها برای هر پیوند\n" +"threads = []\n" +"for link in links:\n" +" # استفاده از `args` برای انتقال آرگومان‌های جایگاهی و `kwargs` برای آرگومان‌های کلیدواژه‌ای\n" +" t = threading.Thread(target=crawl, args=(link,), kwargs={\"delay\": 2})\n" +" threads.append(t)\n" +"\n" +"# آغاز هر نخ\n" +"for t in threads:\n" +" t.start()\n" +"\n" +"# صبر کنید تا همه نخ‌ها به پایان برسند\n" +"for t in threads:\n" +" t.join()" msgid "This module used to be optional, it is now always available." -msgstr "" +msgstr "این ماژول پیش‌تر اختیاری بود، اما اکنون همیشه در دسترس است." -msgid ":class:`concurrent.futures.ThreadPoolExecutor` offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed." +msgid "" +":class:`concurrent.futures.ThreadPoolExecutor` offers a higher level " +"interface to push tasks to a background thread without blocking execution of" +" the calling thread, while still being able to retrieve their results when " +"needed." msgstr "" +":class:`concurrent.futures.ThreadPoolExecutor` رابط سطح بالاتری را برای " +"فرستادن وظایف به یک نخ پس‌زمینه بدون مسدود شدن اجرای نخ فراخواننده ارائه " +"می‌دهد، در حالی که همچنان می‌توان نتایج آن‌ها را در زمان نیاز بازیابی کرد." -msgid ":mod:`queue` provides a thread-safe interface for exchanging data between running threads." +msgid "" +":mod:`queue` provides a thread-safe interface for exchanging data between " +"running threads." msgstr "" +":mod:`queue` یک رابط ایمن از نظر نخی برای تبادل داده بین نخ‌های در حال اجرا " +"فراهم می‌کند." -msgid ":mod:`asyncio` offers an alternative approach to achieving task level concurrency without requiring the use of multiple operating system threads." +msgid "" +":mod:`asyncio` offers an alternative approach to achieving task level " +"concurrency without requiring the use of multiple operating system threads." msgstr "" +":mod:`asyncio` رویکرد جایگزینی برای دستیابی به همروندی در سطح وظیفه ارائه " +"می‌دهد، بدون نیاز به استفاده از چندین نخ سیستم‌عامل." -msgid "In the Python 2.x series, this module contained ``camelCase`` names for some methods and functions. These are deprecated as of Python 3.10, but they are still supported for compatibility with Python 2.5 and lower." +msgid "" +"In the Python 2.x series, this module contained ``camelCase`` names for some" +" methods and functions. These are deprecated as of Python 3.10, but they are" +" still supported for compatibility with Python 2.5 and lower." msgstr "" +"در سری Python 2.x، این ماژول شامل نام‌های ``camelCase`` برای برخی متدها و " +"توابع بود. این موارد از Python 3.10 منسوخ شده‌اند، اما همچنان برای سازگاری " +"با Python 2.5 و نسخه‌های پایین‌تر پشتیبانی می‌شوند." -msgid "In CPython, due to the :term:`Global Interpreter Lock `, only one thread can execute Python code at once (even though certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational resources of multi-core machines, you are advised to use :mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`. However, threading is still an appropriate model if you want to run multiple I/O-bound tasks simultaneously." -msgstr "" +msgid "" +"In CPython, due to the :term:`Global Interpreter Lock `, only one thread can execute Python code at once (even though certain" +" performance-oriented libraries might overcome this limitation). If you want" +" your application to make better use of the computational resources of " +"multi-core machines, you are advised to use :mod:`multiprocessing` or " +":class:`concurrent.futures.ProcessPoolExecutor`. However, threading is still" +" an appropriate model if you want to run multiple I/O-bound tasks " +"simultaneously." +msgstr "" +"در CPython، به دلیل :term:`قفل مفسر سراسری `، تنها " +"یک نخ می‌تواند کد پایتون را در یک لحظه اجرا کند (هرچند ممکن است برخی " +"کتابخانه‌های کارایی‌محور بر این محدودیت غلبه کنند). اگر می‌خواهید برنامه شما" +" استفاده بهتری از منابع محاسباتی ماشین‌های چندهسته‌ای بکند، توصیه می‌شود از" +" :mod:`multiprocessing` یا :class:`concurrent.futures.ProcessPoolExecutor` " +"استفاده کنید. با این حال، اگر می‌خواهید چندین وظیفه محدود به I/O را به‌طور " +"همزمان اجرا کنید، نخ‌بندی همچنان مدل مناسبی است." msgid "GIL and performance considerations" -msgstr "" +msgstr "ملاحظات GIL و کارایی" -msgid "Unlike the :mod:`multiprocessing` module, which uses separate processes to bypass the :term:`global interpreter lock` (GIL), the threading module operates within a single process, meaning that all threads share the same memory space. However, the GIL limits the performance gains of threading when it comes to CPU-bound tasks, as only one thread can execute Python bytecode at a time. Despite this, threads remain a useful tool for achieving concurrency in many scenarios." -msgstr "" +msgid "" +"Unlike the :mod:`multiprocessing` module, which uses separate processes to " +"bypass the :term:`global interpreter lock` (GIL), the threading module " +"operates within a single process, meaning that all threads share the same " +"memory space. However, the GIL limits the performance gains of threading " +"when it comes to CPU-bound tasks, as only one thread can execute Python " +"bytecode at a time. Despite this, threads remain a useful tool for achieving" +" concurrency in many scenarios." +msgstr "" +"برخلاف ماژول :mod:`multiprocessing`، که از فرآیندهای جداگانه برای دور زدن " +":term:`global interpreter lock` (GIL) استفاده می‌کند، ماژول threading در یک " +"فرآیند واحد کار می‌کند، به این معنا که همه نخ‌ها فضای حافظه یکسانی را به " +"اشتراک می‌گذارند. با این حال، GIL بهبود عملکرد حاصل از نخ‌بندی را در وظایف " +"محدود به CPU محدود می‌کند، زیرا در هر لحظه تنها یک نخ می‌تواند بایت‌کد " +"پایتون را اجرا کند. با وجود این، نخ‌ها همچنان ابزاری مفید برای دستیابی به " +"هم‌روندی در بسیاری از سناریوها هستند." -msgid "As of Python 3.13, :term:`free-threaded ` builds can disable the GIL, enabling true parallel execution of threads, but this feature is not available by default (see :pep:`703`)." +msgid "" +"As of Python 3.13, :term:`free-threaded ` builds can disable" +" the GIL, enabling true parallel execution of threads, but this feature is " +"not available by default (see :pep:`703`)." msgstr "" +"از پایتون 3.13 به بعد، ساخت‌های :term:`free-threaded ` " +"می‌توانند GIL را غیرفعال کنند و امکان اجرای موازی واقعی نخ‌ها را فراهم کنند،" +" اما این قابلیت به‌طور پیش‌فرض در دسترس نیست (به :pep:`703` مراجعه کنید)." msgid "Reference" -msgstr "" +msgstr "مرجع" msgid "This module defines the following functions:" -msgstr "" +msgstr "این ماژول توابع زیر را تعریف می‌کند:" -msgid "Return the number of :class:`Thread` objects currently alive. The returned count is equal to the length of the list returned by :func:`.enumerate`." +msgid "" +"Return the number of :class:`Thread` objects currently alive. The returned " +"count is equal to the length of the list returned by :func:`.enumerate`." msgstr "" +"تعداد اشیای :class:`Thread` را که در حال حاضر زنده‌اند برمی‌گرداند. تعداد " +"برگردانده‌شده برابر با طول فهرست برگردانده‌شده توسط :func:`.enumerate` است." msgid "The function ``activeCount`` is a deprecated alias for this function." -msgstr "" +msgstr "تابع ``activeCount`` یک نام مستعار منسوخ برای این تابع است." -msgid "Return the current :class:`Thread` object, corresponding to the caller's thread of control. If the caller's thread of control was not created through the :mod:`!threading` module, a dummy thread object with limited functionality is returned." +msgid "" +"Return the current :class:`Thread` object, corresponding to the caller's " +"thread of control. If the caller's thread of control was not created " +"through the :mod:`!threading` module, a dummy thread object with limited " +"functionality is returned." msgstr "" +"شیء جاری :class:`Thread` را، که متناظر با نخ کنترل فراخواننده است، " +"برمی‌گرداند. اگر نخ کنترل فراخواننده از طریق ماژول :mod:`!threading` ایجاد " +"نشده باشد، یک شیء نخ ساختگی با کارکرد محدود برگردانده می‌شود." -msgid "The function ``currentThread`` is a deprecated alias for this function." -msgstr "" +msgid "" +"The function ``currentThread`` is a deprecated alias for this function." +msgstr "تابع ``currentThread`` یک نام مستعار منسوخ برای این تابع است." msgid "Handle uncaught exception raised by :func:`Thread.run`." -msgstr "" +msgstr "مدیریت استثنای گرفته‌نشده که توسط :func:`Thread.run` پرتاب می‌شود." msgid "The *args* argument has the following attributes:" -msgstr "" +msgstr "آرگومان *args* دارای ویژگی‌های زیر است:" msgid "*exc_type*: Exception type." -msgstr "" +msgstr "*exc_type*: نوع استثنا." msgid "*exc_value*: Exception value, can be ``None``." -msgstr "" +msgstr "*exc_value*: مقدار استثنا، می‌تواند ``None`` باشد." msgid "*exc_traceback*: Exception traceback, can be ``None``." -msgstr "" +msgstr "*exc_traceback*: ردگیری پشته‌ی استثنا، می‌تواند ``None`` باشد." msgid "*thread*: Thread which raised the exception, can be ``None``." -msgstr "" +msgstr "*thread*: نخی که استثنا را پرتاب کرده است، می‌تواند ``None`` باشد." -msgid "If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. Otherwise, the exception is printed out on :data:`sys.stderr`." +msgid "" +"If *exc_type* is :exc:`SystemExit`, the exception is silently ignored. " +"Otherwise, the exception is printed out on :data:`sys.stderr`." msgstr "" +"اگر *exc_type* :exc:`SystemExit` باشد، استثنا به‌صورت بی‌صدا نادیده گرفته " +"می‌شود. در غیر این صورت، استثنا در :data:`sys.stderr` چاپ می‌شود." -msgid "If this function raises an exception, :func:`sys.excepthook` is called to handle it." +msgid "" +"If this function raises an exception, :func:`sys.excepthook` is called to " +"handle it." msgstr "" +"اگر این تابع استثنایی را پرتاب کند، برای مدیریت آن :func:`sys.excepthook` " +"فراخوانی می‌شود." -msgid ":func:`threading.excepthook` can be overridden to control how uncaught exceptions raised by :func:`Thread.run` are handled." +msgid "" +":func:`threading.excepthook` can be overridden to control how uncaught " +"exceptions raised by :func:`Thread.run` are handled." msgstr "" +"می‌توان :func:`threading.excepthook` را بازنویسی کرد تا چگونگی رسیدگی به " +"استثناهای گرفته‌نشده‌ای که توسط :func:`Thread.run` پرتاب می‌شوند، کنترل شود." -msgid "Storing *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." +msgid "" +"Storing *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 "" +"ذخیره‌سازی *exc_value* با استفاده از یک هوکسفارشی می‌تواند یک چرخه " +"ارجاع ایجاد کند. هنگامی که دیگر به استثنا نیازی نیست، باید آن را به‌صراحت " +"پاک کرد تا چرخه ارجاع شکسته شود." -msgid "Storing *thread* using a custom hook can resurrect it if it is set to an object which is being finalized. Avoid storing *thread* after the custom hook completes to avoid resurrecting objects." +msgid "" +"Storing *thread* using a custom hook can resurrect it if it is set to an " +"object which is being finalized. Avoid storing *thread* after the custom " +"hook completes to avoid resurrecting objects." msgstr "" +"ذخیره‌سازی *thread* با استفاده از یک هوک سفارشی، در صورتی که به شیء‌ای که در" +" حال نهایی‌شدن است تنظیم شده باشد، می‌تواند باعث احیای آن شود. برای جلوگیری " +"از احیای اشیاء، از ذخیره‌سازی *thread* پس از تکمیل هوک سفارشی خودداری کنید." msgid ":func:`sys.excepthook` handles uncaught exceptions." -msgstr "" +msgstr ":func:`sys.excepthook` به استثناهای گرفته‌نشده رسیدگی می‌کند." -msgid "Holds the original value of :func:`threading.excepthook`. It is saved so that the original value can be restored in case they happen to get replaced with broken or alternative objects." +msgid "" +"Holds the original value of :func:`threading.excepthook`. It is saved so " +"that the original value can be restored in case they happen to get replaced " +"with broken or alternative objects." msgstr "" +"مقدار اصلی :func:`threading.excepthook` را نگه می‌دارد. این مقدار ذخیره شده " +"است تا بتوان مقدار اصلی را در صورتی که به‌طور اتفاقی با اشیاء خراب یا " +"جایگزین تعویض شده باشد، بازیابی کرد." -msgid "Return the 'thread identifier' of the current thread. This is a nonzero integer. Its value has no direct meaning; it is intended as a magic cookie to be used e.g. to index a dictionary of thread-specific data. Thread identifiers may be recycled when a thread exits and another thread is created." -msgstr "" +msgid "" +"Return the 'thread identifier' of the current thread. This is a nonzero " +"integer. Its value has no direct meaning; it is intended as a magic cookie " +"to be used e.g. to index a dictionary of thread-specific data. Thread " +"identifiers may be recycled when a thread exits and another thread is " +"created." +msgstr "" +"«شناسه نخ» را برای نخ جاری برمی‌گرداند. این یک عدد صحیح غیرصفر است. مقدار آن" +" معنای مستقیمی ندارد؛ بلکه به‌عنوان یک کوکی جادویی (magic cookie) در نظر " +"گرفته شده است تا مثلاً برای اندیس‌دهی به یک دیکشنری از داده‌های مختص نخ " +"استفاده شود. شناسه‌های نخ ممکن است هنگامی که یک نخ خارج می‌شود و نخ دیگری " +"ایجاد می‌شود، بازیافت شوند." -msgid "Return the native integral Thread ID of the current thread assigned by the kernel. This is a non-negative integer. Its value may be used to uniquely identify this particular thread system-wide (until the thread terminates, after which the value may be recycled by the OS)." +msgid "" +"Return the native integral Thread ID of the current thread assigned by the " +"kernel. This is a non-negative integer. Its value may be used to uniquely " +"identify this particular thread system-wide (until the thread terminates, " +"after which the value may be recycled by the OS)." msgstr "" +"شناسه‌ی نخ (Thread ID) بومی به‌صورت عدد صحیح برای نخ جاری را که توسط کرنل " +"اختصاص داده شده است، برمی‌گرداند. این مقدار، یک عدد صحیح نامنفی است. می‌توان" +" از مقدار آن برای شناسایی یکتای این نخ خاص در سراسر سیستم استفاده کرد (تا " +"زمانی که نخ خاتمه یابد؛ پس از آن ممکن است این مقدار توسط سیستم‌عامل بازیافت " +"شود)." msgid "Added support for GNU/kFreeBSD." -msgstr "" +msgstr "پشتیبانی از GNU/kFreeBSD افزوده شد." -msgid "Return a list of all :class:`Thread` objects currently active. The list includes daemonic threads and dummy thread objects created by :func:`current_thread`. It excludes terminated threads and threads that have not yet been started. However, the main thread is always part of the result, even when terminated." -msgstr "" +msgid "" +"Return a list of all :class:`Thread` objects currently active. The list " +"includes daemonic threads and dummy thread objects created by " +":func:`current_thread`. It excludes terminated threads and threads that " +"have not yet been started. However, the main thread is always part of the " +"result, even when terminated." +msgstr "" +"فهرستی از تمام اشیاء :class:`Thread` که در حال حاضر فعال هستند را " +"برمی‌گرداند. این فهرست شامل نخ‌های daemon و اشیاء نخ ساختگی ایجادشده توسط " +":func:`current_thread` است. این فهرست، نخ‌های خاتمه‌یافته و نخ‌هایی را که " +"هنوز آغاز نشده‌اند مستثنی می‌کند. با این حال، نخ اصلی همیشه بخشی از نتیجه " +"است، حتی زمانی که خاتمه یافته باشد." -msgid "Return the main :class:`Thread` object. In normal conditions, the main thread is the thread from which the Python interpreter was started." +msgid "" +"Return the main :class:`Thread` object. In normal conditions, the main " +"thread is the thread from which the Python interpreter was started." msgstr "" +"شیء اصلی :class:`Thread` را برمی‌گرداند. در شرایط عادی، نخ اصلی، نخی است که " +"مفسر پایتون از آن شروع شده است." -msgid "Set a trace function for all threads started from the :mod:`!threading` module. The *func* will be passed to :func:`sys.settrace` for each thread, before its :meth:`~Thread.run` method is called." +msgid "" +"Set a trace function for all threads started from the :mod:`!threading` " +"module. The *func* will be passed to :func:`sys.settrace` for each thread, " +"before its :meth:`~Thread.run` method is called." msgstr "" +"یک تابع ردگیری برای همه نخ‌هایی که از ماژول :mod:`!threading` آغاز می‌شوند " +"تنظیم کنید. *func* برای هر نخ، پیش از فراخوانی متد :meth:`~Thread.run` آن، " +"به :func:`sys.settrace` ارسال می‌شود." -msgid "Set a trace function for all threads started from the :mod:`!threading` module and all Python threads that are currently executing." +msgid "" +"Set a trace function for all threads started from the :mod:`!threading` " +"module and all Python threads that are currently executing." msgstr "" +"یک تابع ردگیری را برای همه نخ‌های شروع‌شده از ماژول :mod:`!threading` و همه " +"نخ‌های پایتون که در حال حاضر در حال اجرا هستند، تنظیم کنید." -msgid "The *func* will be passed to :func:`sys.settrace` for each thread, before its :meth:`~Thread.run` method is called." +msgid "" +"The *func* will be passed to :func:`sys.settrace` for each thread, before " +"its :meth:`~Thread.run` method is called." msgstr "" +"*func* برای هر نخ، پیش از آنکه متد :meth:`~Thread.run` آن فراخوانی شود، به " +":func:`sys.settrace` ارسال می‌شود." msgid "Get the trace function as set by :func:`settrace`." -msgstr "" +msgstr "تابع ردگیری تنظیم‌شده توسط :func:`settrace` را دریافت کنید." -msgid "Set a profile function for all threads started from the :mod:`!threading` module. The *func* will be passed to :func:`sys.setprofile` for each thread, before its :meth:`~Thread.run` method is called." +msgid "" +"Set a profile function for all threads started from the :mod:`!threading` " +"module. The *func* will be passed to :func:`sys.setprofile` for each " +"thread, before its :meth:`~Thread.run` method is called." msgstr "" +"یک تابع پروفایل برای همه نخ‌های شروع‌شده از ماژول :mod:`!threading` تنظیم " +"کنید. *func* برای هر نخ، پیش از فراخوانی متد :meth:`~Thread.run` آن، به " +":func:`sys.setprofile` ارسال می‌شود." -msgid "Set a profile function for all threads started from the :mod:`!threading` module and all Python threads that are currently executing." +msgid "" +"Set a profile function for all threads started from the :mod:`!threading` " +"module and all Python threads that are currently executing." msgstr "" +"برای همه نخ‌های آغازشده از ماژول :mod:`!threading` و همه نخ‌های پایتون که " +"هم‌اکنون در حال اجرا هستند، یک تابع پروفایل (profile function) تنظیم کنید." -msgid "The *func* will be passed to :func:`sys.setprofile` for each thread, before its :meth:`~Thread.run` method is called." +msgid "" +"The *func* will be passed to :func:`sys.setprofile` for each thread, before" +" its :meth:`~Thread.run` method is called." msgstr "" +"*func* برای هر نخ به :func:`sys.setprofile` ارسال می‌شود، پیش از آنکه متد " +":meth:`~Thread.run` آن فراخوانی شود." msgid "Get the profiler function as set by :func:`setprofile`." -msgstr "" +msgstr "تابع پروفایلر تنظیم‌شده توسط :func:`setprofile` را دریافت کنید." -msgid "Return the thread stack size used when creating new threads. The optional *size* argument specifies the stack size to be used for subsequently created threads, and must be 0 (use platform or configured default) or a positive integer value of at least 32,768 (32 KiB). If *size* is not specified, 0 is used. If changing the thread stack size is unsupported, a :exc:`RuntimeError` is raised. If the specified stack size is invalid, a :exc:`ValueError` is raised and the stack size is unmodified. 32 KiB is currently the minimum supported stack size value to guarantee sufficient stack space for the interpreter itself. Note that some platforms may have particular restrictions on values for the stack size, such as requiring a minimum stack size > 32 KiB or requiring allocation in multiples of the system memory page size - platform documentation should be referred to for more information (4 KiB pages are common; using multiples of 4096 for the stack size is the suggested approach in the absence of more specific information)." -msgstr "" +msgid "" +"Return the thread stack size used when creating new threads. The optional " +"*size* argument specifies the stack size to be used for subsequently created" +" threads, and must be 0 (use platform or configured default) or a positive " +"integer value of at least 32,768 (32 KiB). If *size* is not specified, 0 is " +"used. If changing the thread stack size is unsupported, a " +":exc:`RuntimeError` is raised. If the specified stack size is invalid, a " +":exc:`ValueError` is raised and the stack size is unmodified. 32 KiB is " +"currently the minimum supported stack size value to guarantee sufficient " +"stack space for the interpreter itself. Note that some platforms may have " +"particular restrictions on values for the stack size, such as requiring a " +"minimum stack size > 32 KiB or requiring allocation in multiples of the " +"system memory page size - platform documentation should be referred to for " +"more information (4 KiB pages are common; using multiples of 4096 for the " +"stack size is the suggested approach in the absence of more specific " +"information)." +msgstr "" +"اندازه پشته نخ مورد استفاده هنگام ایجاد نخ‌های جدید را بازمی‌گرداند. آرگومان" +" اختیاری *size* اندازه پشته مورد استفاده برای نخ‌های ایجادشده پس از آن را " +"مشخص می‌کند و باید ۰ (استفاده از پیش‌فرض پلتفرم یا پیش‌فرض پیکربندی‌شده) یا " +"یک مقدار عدد صحیح مثبت حداقل ۳۲٬۷۶۸ (۳۲ KiB) باشد. اگر *size* مشخص نشده " +"باشد، از ۰ استفاده می‌شود. اگر تغییر اندازه پشته نخ پشتیبانی نشود، " +":exc:`RuntimeError` پرتاب می‌شود. اگر اندازه پشته مشخص‌شده نامعتبر باشد، " +":exc:`ValueError` پرتاب می‌شود و اندازه پشته بدون تغییر می‌ماند. ۳۲ KiB در " +"حال حاضر حداقل مقدار پشتیبانی‌شده برای اندازه پشته است تا فضای پشته کافی " +"برای خود مفسر تضمین شود. توجه داشته باشید که برخی پلتفرم‌ها ممکن است " +"محدودیت‌های خاصی برای مقادیر اندازه پشته داشته باشند، مانند الزام به این که " +"حداقل اندازه پشته بزرگ‌تر از ۳۲ KiB باشد یا الزام به تخصیص به‌صورت مضرب‌هایی" +" از اندازه صفحه حافظه سیستم؛ برای اطلاعات بیشتر باید به مستندات پلتفرم " +"مراجعه کنید (صفحه‌های ۴ KiB رایج هستند؛ استفاده از مضرب‌های ۴۰۹۶ برای اندازه" +" پشته، روش پیشنهادی در نبود اطلاعات خاص‌تر است)." msgid "Unix platforms with POSIX threads support." -msgstr "" +msgstr "سکوهای یونیکس با پشتیبانی از نخ‌های POSIX." msgid "This module also defines the following constant:" -msgstr "" +msgstr "این ماژول همچنین ثابت زیر را تعریف می‌کند:" -msgid "The maximum value allowed for the *timeout* parameter of blocking functions (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). Specifying a timeout greater than this value will raise an :exc:`OverflowError`." +msgid "" +"The maximum value allowed for the *timeout* parameter of blocking functions " +"(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.)." +" Specifying a timeout greater than this value will raise an " +":exc:`OverflowError`." msgstr "" +"حداکثر مقدار مجاز برای پارامتر *timeout* توابع مسدودکننده " +"(:meth:`Lock.acquire`، :meth:`RLock.acquire`، :meth:`Condition.wait` و " +"غیره). تعیین timeout بیشتر از این مقدار باعث پرتاب :exc:`OverflowError` " +"می‌شود." -msgid "This module defines a number of classes, which are detailed in the sections below." +msgid "" +"This module defines a number of classes, which are detailed in the sections " +"below." msgstr "" +"این ماژول تعدادی کلاس تعریف می‌کند که در بخش‌های زیر به‌تفصیل شرح داده " +"شده‌اند." -msgid "The design of this module is loosely based on Java's threading model. However, where Java makes locks and condition variables basic behavior of every object, they are separate objects in Python. Python's :class:`Thread` class supports a subset of the behavior of Java's Thread class; currently, there are no priorities, no thread groups, and threads cannot be destroyed, stopped, suspended, resumed, or interrupted. The static methods of Java's Thread class, when implemented, are mapped to module-level functions." -msgstr "" +msgid "" +"The design of this module is loosely based on Java's threading model. " +"However, where Java makes locks and condition variables basic behavior of " +"every object, they are separate objects in Python. Python's :class:`Thread`" +" class supports a subset of the behavior of Java's Thread class; currently, " +"there are no priorities, no thread groups, and threads cannot be destroyed, " +"stopped, suspended, resumed, or interrupted. The static methods of Java's " +"Thread class, when implemented, are mapped to module-level functions." +msgstr "" +"طراحی این ماژول به‌طور تقریبی بر پایه‌ی مدل نخ‌بندی جاوا است. با این حال، در" +" حالی که جاوا قفل‌ها و متغیرهای شرطی را به‌عنوان رفتار پایه‌ی هر شیء قرار " +"می‌دهد، آن‌ها در پایتون اشیای جداگانه‌ای هستند. کلاس :class:`Thread` " +"پایتون از زیرمجموعه‌ای از رفتار کلاس Thread جاوا پشتیبانی می‌کند؛ در حال " +"حاضر، هیچ اولویتی و هیچ گروه نخی وجود ندارد و نخ‌ها نمی‌توانند نابود، متوقف،" +" معلق، از سر گرفته یا قطع شوند. متدهای ایستای کلاس Thread جاوا، در صورت " +"پیاده‌سازی، به توابع سطح ماژول نگاشت می‌شوند." msgid "All of the methods described below are executed atomically." msgstr "" +"همه‌ی متدهایی که در زیر توضیح داده شده‌اند، به‌صورت اتمی اجرا می‌شوند." msgid "Thread-local data" -msgstr "" +msgstr "داده‌های محلی نخ" -msgid "Thread-local data is data whose values are thread specific. If you have data that you want to be local to a thread, create a :class:`local` object and use its attributes::" +msgid "" +"Thread-local data is data whose values are thread specific. If you have data" +" that you want to be local to a thread, create a :class:`local` object and " +"use its attributes::" msgstr "" +"داده محلی به نخ، داده‌ای است که مقادیر آن مختص نخ است. اگر داده‌ای دارید که " +"می‌خواهید محلی به یک نخ باشد، یک شیء :class:`local` ایجاد کنید و از " +"ویژگی‌های آن استفاده کنید::" msgid "" ">>> mydata = local()\n" @@ -234,9 +512,13 @@ msgid "" ">>> mydata.number\n" "42" msgstr "" +">>> mydata = local()\n" +">>> mydata.number = 42\n" +">>> mydata.number\n" +"42" msgid "You can also access the :class:`local`-object's dictionary::" -msgstr "" +msgstr "همچنین می‌توانید به دیکشنری شیء :class:`local` دسترسی پیدا کنید::" msgid "" ">>> mydata.__dict__\n" @@ -246,9 +528,15 @@ msgid "" ">>> mydata.widgets\n" "[]" msgstr "" +">>> mydata.__dict__\n" +"{'number': 42}\n" +">>> mydata.__dict__.setdefault('widgets', [])\n" +"[]\n" +">>> mydata.widgets\n" +"[]" msgid "If we access the data in a different thread::" -msgstr "" +msgstr "اگر به داده‌ها در یک نخ دیگر دسترسی داشته باشیم::" msgid "" ">>> log = []\n" @@ -265,20 +553,52 @@ msgid "" ">>> log\n" "[[], 11]" msgstr "" +">>> log = []\n" +">>> def f():\n" +"... items = sorted(mydata.__dict__.items())\n" +"... log.append(items)\n" +"... mydata.number = 11\n" +"... log.append(mydata.number)\n" +"\n" +">>> import threading\n" +">>> thread = threading.Thread(target=f)\n" +">>> thread.start()\n" +">>> thread.join()\n" +">>> log\n" +"[[], 11]" -msgid "we get different data. Furthermore, changes made in the other thread don't affect data seen in this thread::" +msgid "" +"we get different data. Furthermore, changes made in the other thread don't " +"affect data seen in this thread::" msgstr "" +"ما داده‌های متفاوتی دریافت می‌کنیم. علاوه بر این، تغییرات اعمال‌شده در نخ " +"دیگر بر داده‌های دیده‌شده در این نخ تأثیر نمی‌گذارند::" msgid "" ">>> mydata.number\n" "42" msgstr "" +">>> mydata.number\n" +"42" -msgid "Of course, values you get from a :class:`local` object, including their :attr:`~object.__dict__` attribute, are for whatever thread was current at the time the attribute was read. For that reason, you generally don't want to save these values across threads, as they apply only to the thread they came from." +msgid "" +"Of course, values you get from a :class:`local` object, including their " +":attr:`~object.__dict__` attribute, are for whatever thread was current at " +"the time the attribute was read. For that reason, you generally don't want " +"to save these values across threads, as they apply only to the thread they " +"came from." msgstr "" +"البته، مقدارهایی که از یک شیء :class:`local` به دست می‌آورید، از جمله ویژگی " +":attr:`~object.__dict__` آن‌ها، مربوط به هر نخی هستند که در زمان خوانده شدن " +"ویژگی جاری بوده است. به همین دلیل، معمولاً نباید این مقدارها را بین نخ‌ها " +"ذخیره کنید، زیرا آن‌ها فقط به نخی که از آن آمده‌اند اعمال می‌شوند." -msgid "You can create custom :class:`local` objects by subclassing the :class:`local` class::" +msgid "" +"You can create custom :class:`local` objects by subclassing the " +":class:`local` class::" msgstr "" +"شما می‌توانید با زیرکلاس‌سازی از کلاس :class:`local`، اشیای سفارشی " +":class:`local` ایجاد کنید::" msgid "" ">>> class MyLocal(local):\n" @@ -288,43 +608,64 @@ msgid "" "... def squared(self):\n" "... return self.number ** 2" msgstr "" +">>> class MyLocal(local):\n" +"... number = 2\n" +"... def __init__(self, /, **kw):\n" +"... self.__dict__.update(kw)\n" +"... def squared(self):\n" +"... return self.number ** 2" -msgid "This can be useful to support default values, methods and initialization. Note that if you define an :py:meth:`~object.__init__` method, it will be called each time the :class:`local` object is used in a separate thread. This is necessary to initialize each thread's dictionary." +msgid "" +"This can be useful to support default values, methods and initialization. " +"Note that if you define an :py:meth:`~object.__init__` method, it will be " +"called each time the :class:`local` object is used in a separate thread. " +"This is necessary to initialize each thread's dictionary." msgstr "" +"این می‌تواند برای پشتیبانی از مقادیر پیش‌فرض، متدها و مقداردهی اولیه مفید " +"باشد. توجه داشته باشید که اگر متد :py:meth:`~object.__init__` را تعریف کنید،" +" هر بار که از شیء :class:`local` در یک نخ جداگانه استفاده شود، فراخوانی " +"می‌شود. این برای مقداردهی اولیه دیکشنری هر نخ ضروری است." msgid "Now if we create a :class:`local` object::" -msgstr "" +msgstr "اکنون اگر یک شیء :class:`local` ایجاد کنیم::" msgid ">>> mydata = MyLocal(color='red')" -msgstr "" +msgstr ">>> mydata = MyLocal(color='red')" msgid "we have a default number::" -msgstr "" +msgstr "یک عدد پیش‌فرض داریم::" msgid "" ">>> mydata.number\n" "2" msgstr "" +">>> mydata.number\n" +"2" msgid "an initial color::" -msgstr "" +msgstr "یک رنگ اولیه::" msgid "" ">>> mydata.color\n" "'red'\n" ">>> del mydata.color" msgstr "" +">>> mydata.color\n" +"'red'\n" +">>> del mydata.color" msgid "And a method that operates on the data::" -msgstr "" +msgstr "و متدی که روی داده‌ها عمل می‌کند::" msgid "" ">>> mydata.squared()\n" "4" msgstr "" +">>> mydata.squared()\n" +"4" msgid "As before, we can access the data in a separate thread::" -msgstr "" +msgstr "مانند قبل، می‌توانیم به داده‌ها در یک نخ جداگانه دسترسی داشته باشیم::" msgid "" ">>> log = []\n" @@ -334,9 +675,15 @@ msgid "" ">>> log\n" "[[('color', 'red')], 11]" msgstr "" +">>> log = []\n" +">>> thread = threading.Thread(target=f)\n" +">>> thread.start()\n" +">>> thread.join()\n" +">>> log\n" +"[[('color', 'red')], 11]" msgid "without affecting this thread's data::" -msgstr "" +msgstr "بدون تأثیر بر داده‌های این نخ::" msgid "" ">>> mydata.number\n" @@ -346,9 +693,19 @@ msgid "" "...\n" "AttributeError: 'MyLocal' object has no attribute 'color'" msgstr "" +">>> mydata.number\n" +"2\n" +">>> mydata.color\n" +"Traceback (most recent call last):\n" +"...\n" +"AttributeError: 'MyLocal' object has no attribute 'color'" -msgid "Note that subclasses can define :term:`__slots__`, but they are not thread local. They are shared across threads::" +msgid "" +"Note that subclasses can define :term:`__slots__`, but they are not thread " +"local. They are shared across threads::" msgstr "" +"توجه داشته باشید که زیرکلاس‌ها می‌توانند :term:`__slots__` را تعریف کنند، " +"اما آن‌ها محلی برای نخ نیستند. آن‌ها میان نخ‌ها به اشتراک گذاشته می‌شوند::" msgid "" ">>> class MyLocal(local):\n" @@ -358,122 +715,296 @@ msgid "" ">>> mydata.number = 42\n" ">>> mydata.color = 'red'" msgstr "" +">>> class MyLocal(local):\n" +"... __slots__ = 'number'\n" +"\n" +">>> mydata = MyLocal()\n" +">>> mydata.number = 42\n" +">>> mydata.color = 'red'" msgid "So, the separate thread::" -msgstr "" +msgstr "بنابراین، نخ جداگانه::" msgid "" ">>> thread = threading.Thread(target=f)\n" ">>> thread.start()\n" ">>> thread.join()" msgstr "" +">>> thread = threading.Thread(target=f)\n" +">>> thread.start()\n" +">>> thread.join()" msgid "affects what we see::" -msgstr "" +msgstr "بر آنچه می‌بینیم تأثیر می‌گذارد::" msgid "" ">>> mydata.number\n" "11" msgstr "" +">>> mydata.number\n" +"11" msgid "A class that represents thread-local data." -msgstr "" +msgstr "کلاسی که داده‌های محلی نخ (thread-local) را نشان می‌دهد." msgid "Thread objects" -msgstr "" +msgstr "اشیای نخ" -msgid "The :class:`Thread` class represents an activity that is run in a separate thread of control. There are two ways to specify the activity: by passing a callable object to the constructor, or by overriding the :meth:`~Thread.run` method in a subclass. No other methods (except for the constructor) should be overridden in a subclass. In other words, *only* override the ``__init__()`` and :meth:`~Thread.run` methods of this class." -msgstr "" +msgid "" +"The :class:`Thread` class represents an activity that is run in a separate " +"thread of control. There are two ways to specify the activity: by passing a" +" callable object to the constructor, or by overriding the " +":meth:`~Thread.run` method in a subclass. No other methods (except for the " +"constructor) should be overridden in a subclass. In other words, *only* " +"override the ``__init__()`` and :meth:`~Thread.run` methods of this class." +msgstr "" +"کلاس :class:`Thread` نشان‌دهنده‌ی فعالیتی است که در یک نخ کنترلی جداگانه اجرا" +" می‌شود. دو راه برای مشخص کردن فعالیت وجود دارد: با ارسال یک شیء " +"فراخوانی‌پذیر به سازنده، یا با بازنویسی متد :meth:`~Thread.run` در یک " +"زیرکلاس. هیچ متد دیگری (به‌جز سازنده) نباید در یک زیرکلاس بازنویسی شود. به " +"عبارت دیگر، *فقط* متدهای ``__init__()`` و :meth:`~Thread.run` این کلاس را " +"بازنویسی کنید." -msgid "Once a thread object is created, its activity must be started by calling the thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` method in a separate thread of control." +msgid "" +"Once a thread object is created, its activity must be started by calling the" +" thread's :meth:`~Thread.start` method. This invokes the " +":meth:`~Thread.run` method in a separate thread of control." msgstr "" +"پس از ایجاد یک شیء نخ، فعالیت آن باید با فراخوانی متد :meth:`~Thread.start` " +"نخ آغاز شود. این کار متد :meth:`~Thread.run` را در یک نخ کنترلی جداگانه " +"فراخوانی می‌کند." -msgid "Once the thread's activity is started, the thread is considered 'alive'. It stops being alive when its :meth:`~Thread.run` method terminates -- either normally, or by raising an unhandled exception. The :meth:`~Thread.is_alive` method tests whether the thread is alive." +msgid "" +"Once the thread's activity is started, the thread is considered 'alive'. It " +"stops being alive when its :meth:`~Thread.run` method terminates -- either " +"normally, or by raising an unhandled exception. The " +":meth:`~Thread.is_alive` method tests whether the thread is alive." msgstr "" +"هنگامی که فعالیت نخ آغاز می‌شود، نخ «زنده» در نظر گرفته می‌شود. هنگامی که " +"متد :meth:`~Thread.run` آن پایان می‌یابد، دیگر زنده نیست — چه به‌طور عادی و " +"چه با پرتاب یک استثنای مدیریت‌نشده. متد :meth:`~Thread.is_alive` زنده بودن " +"نخ را بررسی می‌کند." -msgid "Other threads can call a thread's :meth:`~Thread.join` method. This blocks the calling thread until the thread whose :meth:`~Thread.join` method is called is terminated." +msgid "" +"Other threads can call a thread's :meth:`~Thread.join` method. This blocks " +"the calling thread until the thread whose :meth:`~Thread.join` method is " +"called is terminated." msgstr "" +"نخ‌های دیگر می‌توانند متد :meth:`~Thread.join` یک نخ را فراخوانی کنند. این " +"کار نخ فراخواننده را مسدود می‌کند تا زمانی که نخی که متد " +":meth:`~Thread.join` آن فراخوانی شده است، خاتمه یابد." -msgid "A thread has a name. The name can be passed to the constructor, and read or changed through the :attr:`~Thread.name` attribute." +msgid "" +"A thread has a name. The name can be passed to the constructor, and read or" +" changed through the :attr:`~Thread.name` attribute." msgstr "" +"هر نخ دارای یک نام است. این نام را می‌توان به سازنده ارسال کرد و از طریق " +"ویژگی :attr:`~Thread.name` خواند یا تغییر داد." -msgid "If the :meth:`~Thread.run` method raises an exception, :func:`threading.excepthook` is called to handle it. By default, :func:`threading.excepthook` ignores silently :exc:`SystemExit`." +msgid "" +"If the :meth:`~Thread.run` method raises an exception, " +":func:`threading.excepthook` is called to handle it. By default, " +":func:`threading.excepthook` ignores silently :exc:`SystemExit`." msgstr "" +"اگر متد :meth:`~Thread.run` استثنایی پرتاب کند، برای رسیدگی به آن، " +":func:`threading.excepthook` فراخوانی می‌شود. به‌طور پیش‌فرض، " +":func:`threading.excepthook` از :exc:`SystemExit` به‌صورت بی‌صدا چشم‌پوشی " +"می‌کند." -msgid "A thread can be flagged as a \"daemon thread\". The significance of this flag is that the entire Python program exits when only daemon threads are left. The initial value is inherited from the creating thread. The flag can be set through the :attr:`~Thread.daemon` property or the *daemon* constructor argument." -msgstr "" +msgid "" +"A thread can be flagged as a \"daemon thread\". The significance of this " +"flag is that the entire Python program exits when only daemon threads are " +"left. The initial value is inherited from the creating thread. The flag " +"can be set through the :attr:`~Thread.daemon` property or the *daemon* " +"constructor argument." +msgstr "" +"یک نخ می‌تواند به‌عنوان «نخ daemon (daemon thread)» علامت‌گذاری شود. اهمیت " +"این پرچم در این است که وقتی فقط نخ‌های daemon باقی مانده باشند، کل برنامه‌ی " +"Python خارج می‌شود. مقدار اولیه از نخ ایجادکننده به ارث برده می‌شود. این " +"پرچم را می‌توان از طریق ویژگی :attr:`~Thread.daemon` یا آرگومان *daemon* در " +"سازنده تنظیم کرد." -msgid "Daemon threads are abruptly stopped at shutdown. Their resources (such as open files, database transactions, etc.) may not be released properly. If you want your threads to stop gracefully, make them non-daemonic and use a suitable signalling mechanism such as an :class:`Event`." +msgid "" +"Daemon threads are abruptly stopped at shutdown. Their resources (such as " +"open files, database transactions, etc.) may not be released properly. If " +"you want your threads to stop gracefully, make them non-daemonic and use a " +"suitable signalling mechanism such as an :class:`Event`." msgstr "" +"نخ‌های daemon به‌طور ناگهانی در هنگام خاموش شدن متوقف می‌شوند. منابع آن‌ها " +"(مانند فایل‌های باز، تراکنش‌های پایگاه داده، و غیره) ممکن است به‌درستی آزاد " +"نشوند. اگر می‌خواهید نخ‌های شما به‌آرامی متوقف شوند، آن‌ها را غیر daemon " +"کنید و از یک سازوکار سیگنال‌دهی مناسب مانند :class:`Event` استفاده کنید." -msgid "There is a \"main thread\" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread." +msgid "" +"There is a \"main thread\" object; this corresponds to the initial thread of" +" control in the Python program. It is not a daemon thread." msgstr "" +"یک شیء «نخ اصلی» وجود دارد؛ این شیء متناظر با نخ آغازین کنترل در برنامه " +"پایتون است. این یک نخ daemon نیست." -msgid "There is the possibility that \"dummy thread objects\" are created. These are thread objects corresponding to \"alien threads\", which are threads of control started outside the threading module, such as directly from C code. Dummy thread objects have limited functionality; they are always considered alive and daemonic, and cannot be :ref:`joined `. They are never deleted, since it is impossible to detect the termination of alien threads." -msgstr "" +msgid "" +"There is the possibility that \"dummy thread objects\" are created. These " +"are thread objects corresponding to \"alien threads\", which are threads of " +"control started outside the threading module, such as directly from C code." +" Dummy thread objects have limited functionality; they are always " +"considered alive and daemonic, and cannot be :ref:`joined `. They are never deleted, since it is impossible to detect the " +"termination of alien threads." +msgstr "" +"این احتمال وجود دارد که «اشیاء نخ ساختگی (dummy thread objects)» ایجاد شوند." +" این‌ها اشیاء نخ هستند که با «نخ‌های بیگانه (alien threads)» متناظرند؛ " +"نخ‌های کنترلی که خارج از ماژول threading، مثلاً مستقیماً از کد C، آغاز " +"شده‌اند. اشیاء نخ ساختگی قابلیت محدودی دارند؛ آن‌ها همیشه زنده و daemon " +"(daemonic) در نظر گرفته می‌شوند و نمی‌توان آن‌ها را :ref:`join ` کرد. آن‌ها هرگز حذف نمی‌شوند، زیرا تشخیص پایان نخ‌های بیگانه غیرممکن " +"است." -msgid "This constructor should always be called with keyword arguments. Arguments are:" +msgid "" +"This constructor should always be called with keyword arguments. Arguments " +"are:" msgstr "" +"این سازنده باید همیشه با آرگومان‌های کلیدواژه‌ای فراخوانی شود. آرگومان‌ها " +"عبارتند از:" -msgid "*group* must be ``None`` as it is reserved for future extension when a :class:`!ThreadGroup` class is implemented." +msgid "" +"*group* must be ``None`` as it is reserved for future extension when a " +":class:`!ThreadGroup` class is implemented." msgstr "" +"*group* باید ``None`` باشد، زیرا برای گسترش آینده در زمانی که یک کلاس " +":class:`!ThreadGroup` پیاده‌سازی شود، رزرو شده است." -msgid "*target* is the callable object to be invoked by the :meth:`run` method. Defaults to ``None``, meaning nothing is called." +msgid "" +"*target* is the callable object to be invoked by the :meth:`run` method. " +"Defaults to ``None``, meaning nothing is called." msgstr "" +"*target* شیء فراخوان‌پذیری است که توسط متد :meth:`run` فراخوانی می‌شود. " +"مقدار پیش‌فرض آن ``None`` است، یعنی هیچ چیزی فراخوانی نمی‌شود." -msgid "*name* is the thread name. By default, a unique name is constructed of the form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* (target)\" where \"target\" is ``target.__name__`` if the *target* argument is specified." +msgid "" +"*name* is the thread name. By default, a unique name is constructed of the " +"form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* " +"(target)\" where \"target\" is ``target.__name__`` if the *target* argument " +"is specified." msgstr "" +"*name* نام نخ است. به‌طور پیش‌فرض، یک نام یکتا در قالب «Thread-*N*» ساخته " +"می‌شود که در آن *N* یک عدد دهدهی کوچک است، یا «Thread-*N* (target)» که در آن" +" «target» برابر ``target.__name__`` است، در صورتی که آرگومان *target* مشخص " +"شده باشد." -msgid "*args* is a list or tuple of arguments for the target invocation. Defaults to ``()``." +msgid "" +"*args* is a list or tuple of arguments for the target invocation. Defaults " +"to ``()``." msgstr "" +"*args* یک فهرست یا تاپلاز آرگومان‌ها برای فراخوانی هدف است. مقدار " +"پیش‌فرض آن ``()`` است." -msgid "*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to ``{}``." +msgid "" +"*kwargs* is a dictionary of keyword arguments for the target invocation. " +"Defaults to ``{}``." msgstr "" +"*kwargs* یک دیکشنری از آرگومان‌های کلیدواژه‌ای برای فراخوانی هدف است. " +"پیش‌فرض آن ``{}`` است." -msgid "If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If ``None`` (the default), the daemonic property is inherited from the current thread." +msgid "" +"If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If" +" ``None`` (the default), the daemonic property is inherited from the current" +" thread." msgstr "" +"اگر ``None`` نباشد، *daemon* به‌صراحت تعیین می‌کند که آیا نخ daemon است یا " +"خیر. اگر ``None`` باشد (پیش‌فرض)، ویژگی daemon از نخ جاری به ارث می‌رسد." -msgid "*context* is the :class:`~contextvars.Context` value to use when starting the thread. The default value is ``None`` which indicates that the :data:`sys.flags.thread_inherit_context` flag controls the behaviour. If the flag is true, threads will start with a copy of the context of the caller of :meth:`~Thread.start`. If false, they will start with an empty context. To explicitly start with an empty context, pass a new instance of :class:`~contextvars.Context()`. To explicitly start with a copy of the current context, pass the value from :func:`~contextvars.copy_context`. The flag defaults true on free-threaded builds and false otherwise." -msgstr "" +msgid "" +"*context* is the :class:`~contextvars.Context` value to use when starting " +"the thread. The default value is ``None`` which indicates that the " +":data:`sys.flags.thread_inherit_context` flag controls the behaviour. If " +"the flag is true, threads will start with a copy of the context of the " +"caller of :meth:`~Thread.start`. If false, they will start with an empty " +"context. To explicitly start with an empty context, pass a new instance of " +":class:`~contextvars.Context()`. To explicitly start with a copy of the " +"current context, pass the value from :func:`~contextvars.copy_context`. The " +"flag defaults true on free-threaded builds and false otherwise." +msgstr "" +"*context* مقدار :class:`~contextvars.Context` است که هنگام آغاز نخ استفاده " +"می‌شود. مقدار پیش‌فرض ``None`` است، که نشان می‌دهد پرچم " +":data:`sys.flags.thread_inherit_context` رفتار را کنترل می‌کند. اگر پرچم " +"true باشد، نخ‌ها با یک کپی از زمینه‌ی فراخواننده‌ی :meth:`~Thread.start` " +"آغاز می‌شوند. اگر false باشد، آن‌ها با یک زمینه‌ی خالی آغاز می‌شوند. برای " +"آغاز به‌طور صریح با یک زمینه‌ی خالی، یک نمونه‌ی جدید از " +":class:`~contextvars.Context()` را ارسال کنید. برای آغاز به‌طور صریح با یک " +"کپی از زمینه‌ی جاری، مقدار حاصل از :func:`~contextvars.copy_context` را " +"ارسال کنید. مقدار پیش‌فرض این پرچم در ساخت‌های آزادنخبرابر" +" true و در غیر این صورت false است." -msgid "If the subclass overrides the constructor, it must make sure to invoke the base class constructor (``Thread.__init__()``) before doing anything else to the thread." +msgid "" +"If the subclass overrides the constructor, it must make sure to invoke the " +"base class constructor (``Thread.__init__()``) before doing anything else to" +" the thread." msgstr "" +"اگر زیرکلاس سازنده را بازنویسی کند، باید پیش از انجام هر کار دیگری روی نخ، " +"از فراخوانی سازنده‌ی کلاس پایه (``Thread.__init__()``) اطمینان حاصل کند." msgid "Added the *daemon* parameter." -msgstr "" +msgstr "پارامتر *daemon* اضافه شد." msgid "Use the *target* name if *name* argument is omitted." -msgstr "" +msgstr "اگر آرگومان *name* حذف شده باشد، از نام *target* استفاده کنید." msgid "Added the *context* parameter." -msgstr "" +msgstr "پارامتر *context* افزوده شد." msgid "Start the thread's activity." -msgstr "" +msgstr "فعالیت نخ را آغاز می‌کند." -msgid "It must be called at most once per thread object. It arranges for the object's :meth:`~Thread.run` method to be invoked in a separate thread of control." +msgid "" +"It must be called at most once per thread object. It arranges for the " +"object's :meth:`~Thread.run` method to be invoked in a separate thread of " +"control." msgstr "" +"این باید حداکثر یک‌بار به ازای هر شیء نخ فراخوانی شود. این ترتیبی می‌دهد که " +"متد :meth:`~Thread.run` آن شیء در یک نخ کنترل جداگانه فراخوانی شود." -msgid "This method will raise a :exc:`RuntimeError` if called more than once on the same thread object." +msgid "" +"This method will raise a :exc:`RuntimeError` if called more than once on the" +" same thread object." msgstr "" +"این متد در صورت فراخوانی بیش از یک بار روی همان شیء نخ، :exc:`RuntimeError` " +"را پرتاب خواهد کرد." -msgid "If supported, set the operating system thread name to :attr:`threading.Thread.name`. The name can be truncated depending on the operating system thread name limits." +msgid "" +"If supported, set the operating system thread name to " +":attr:`threading.Thread.name`. The name can be truncated depending on the " +"operating system thread name limits." msgstr "" +"در صورت پشتیبانی، نام نخ سیستم‌عامل برابر با :attr:`threading.Thread.name` " +"تنظیم می‌شود. ممکن است نام، بسته به محدودیت‌های نام نخ سیستم‌عامل، کوتاه " +"شود." msgid "Set the operating system thread name." -msgstr "" +msgstr "نام نخ سیستم‌عامل را تنظیم می‌کند." msgid "Method representing the thread's activity." -msgstr "" +msgstr "متدی که فعالیت نخ را نشان می‌دهد." -msgid "You may override this method in a subclass. The standard :meth:`run` method invokes the callable object passed to the object's constructor as the *target* argument, if any, with positional and keyword arguments taken from the *args* and *kwargs* arguments, respectively." +msgid "" +"You may override this method in a subclass. The standard :meth:`run` method" +" invokes the callable object passed to the object's constructor as the " +"*target* argument, if any, with positional and keyword arguments taken from " +"the *args* and *kwargs* arguments, respectively." msgstr "" +"شما می‌توانید این متد را در یک زیرکلاس بازنویسی کنید. متد استاندارد " +":meth:`run` شیء فراخوان‌پذیری را که به سازنده‌ی شیء به‌عنوان آرگومان *target*" +" ارسال‌شده است، در صورت وجود، با آرگومان‌های جایگاهی و کلیدواژه‌ای که " +"به‌ترتیب از آرگومان‌های *args* و *kwargs* گرفته می‌شوند، فراخوانی می‌کند." -msgid "Using list or tuple as the *args* argument which passed to the :class:`Thread` could achieve the same effect." +msgid "" +"Using list or tuple as the *args* argument which passed to the " +":class:`Thread` could achieve the same effect." msgstr "" +"استفاده از فهرست یا تاپل به‌عنوان آرگومان *args* که به :class:`Thread` داده " +"می‌شود، می‌تواند همان اثر را داشته باشد." msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> from threading import Thread\n" @@ -484,213 +1015,588 @@ msgid "" ">>> t.run()\n" "1" msgstr "" +">>> from threading import Thread\n" +">>> t = Thread(target=print, args=[1])\n" +">>> t.run()\n" +"1\n" +">>> t = Thread(target=print, args=(1,))\n" +">>> t.run()\n" +"1" -msgid "Wait until the thread terminates. This blocks the calling thread until the thread whose :meth:`~Thread.join` method is called terminates -- either normally or through an unhandled exception -- or until the optional timeout occurs." +msgid "" +"Wait until the thread terminates. This blocks the calling thread until the " +"thread whose :meth:`~Thread.join` method is called terminates -- either " +"normally or through an unhandled exception -- or until the optional timeout " +"occurs." msgstr "" +"صبر کنید تا نخ پایان یابد. این عمل نخ فراخوان را مسدود می‌کند تا زمانی که " +"نخی که متد :meth:`~Thread.join` آن فراخوانی شده است پایان یابد -- چه به‌صورت" +" عادی و چه از طریق استثنای مدیریت‌نشده -- یا تا زمانی که مهلت زمانی اختیاری " +"رخ دهد." -msgid "When the *timeout* argument is present and not ``None``, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As :meth:`~Thread.join` always returns ``None``, you must call :meth:`~Thread.is_alive` after :meth:`~Thread.join` to decide whether a timeout happened -- if the thread is still alive, the :meth:`~Thread.join` call timed out." -msgstr "" +msgid "" +"When the *timeout* argument is present and not ``None``, it should be a " +"floating-point number specifying a timeout for the operation in seconds (or " +"fractions thereof). As :meth:`~Thread.join` always returns ``None``, you " +"must call :meth:`~Thread.is_alive` after :meth:`~Thread.join` to decide " +"whether a timeout happened -- if the thread is still alive, the " +":meth:`~Thread.join` call timed out." +msgstr "" +"هنگامی که آرگومان *timeout* وجود داشته باشد و ``None`` نباشد، باید یک عدد " +"ممیز شناور باشد که مهلت عملیات را بر حسب ثانیه (یا کسری از ثانیه) مشخص " +"می‌کند. از آن‌جا که :meth:`~Thread.join` همیشه ``None`` را برمی‌گرداند، باید" +" پس از :meth:`~Thread.join`، :meth:`~Thread.is_alive` را فراخوانی کنید تا " +"تعیین کنید که آیا پایان مهلت رخ داده است — اگر نخ هنوز زنده است، فراخوانی " +":meth:`~Thread.join` با پایان مهلت مواجه شده است." -msgid "When the *timeout* argument is not present or ``None``, the operation will block until the thread terminates." +msgid "" +"When the *timeout* argument is not present or ``None``, the operation will " +"block until the thread terminates." msgstr "" +"هنگامی که آرگومان *timeout* وجود ندارد یا ``None`` است، عملیات تا زمانی که " +"نخ پایان یابد مسدود می‌شود." msgid "A thread can be joined many times." -msgstr "" +msgstr "یک نخ را می‌توان چندین بار الحاق (join) کرد." -msgid ":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to :meth:`~Thread.join` a thread before it has been started and attempts to do so raise the same exception." +msgid "" +":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to " +"join the current thread as that would cause a deadlock. It is also an error " +"to :meth:`~Thread.join` a thread before it has been started and attempts to " +"do so raise the same exception." msgstr "" +":meth:`~Thread.join` در صورتی که تلاشی برای فراخوانی آن روی نخ جاری انجام " +"شود، یک :exc:`RuntimeError` پرتاب می‌کند، زیرا این کار باعث بن‌بست می‌شود. " +"فراخوانی :meth:`~Thread.join` روی یک نخ پیش از آنکه شروع شده باشد نیز خطا " +"است و تلاش‌ها برای این کار همان استثنا را پرتاب می‌کنند." -msgid "If an attempt is made to join a running daemonic thread in late stages of :term:`Python finalization ` :meth:`!join` raises a :exc:`PythonFinalizationError`." +msgid "" +"If an attempt is made to join a running daemonic thread in late stages of " +":term:`Python finalization ` :meth:`!join` raises a " +":exc:`PythonFinalizationError`." msgstr "" +"اگر برای join کردن یک نخ daemon در حال اجرا در مراحل پایانی " +":term:`نهایی‌سازی پایتون ` تلاشی صورت گیرد، " +":meth:`!join` یک :exc:`PythonFinalizationError` پرتاب می‌کند." msgid "May raise :exc:`PythonFinalizationError`." -msgstr "" +msgstr "ممکن است :exc:`PythonFinalizationError` را پرتاب کند." -msgid "A string used for identification purposes only. It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor." +msgid "" +"A string used for identification purposes only. It has no semantics. " +"Multiple threads may be given the same name. The initial name is set by the" +" constructor." msgstr "" +"رشته‌ای که فقط برای اهداف شناسایی استفاده می‌شود. این رشته هیچ معنایی ندارد." +" ممکن است به چندین نخ نام یکسانی داده شود. نام اولیه توسط سازنده تنظیم " +"می‌شود." -msgid "On some platforms, the thread name is set at the operating system level when the thread starts, so that it is visible in task managers. This name may be truncated to fit in a system-specific limit (for example, 15 bytes on Linux or 63 bytes on macOS)." +msgid "" +"On some platforms, the thread name is set at the operating system level when" +" the thread starts, so that it is visible in task managers. This name may be" +" truncated to fit in a system-specific limit (for example, 15 bytes on Linux" +" or 63 bytes on macOS)." msgstr "" +"در برخی پلتفرم‌ها، نام نخ در زمان شروع نخ در سطح سیستم‌عامل تنظیم می‌شود تا " +"در مدیران وظیفه قابل مشاهده باشد. این نام ممکن است برای جا شدن در محدودیت " +"خاص سیستم کوتاه شود (برای مثال، ۱۵ بایت در لینوکس یا ۶۳ بایت در macOS)." -msgid "Changes to *name* are only reflected at the OS level when the currently running thread is renamed. (Setting the *name* attribute of a different thread only updates the Python Thread object.)" +msgid "" +"Changes to *name* are only reflected at the OS level when the currently " +"running thread is renamed. (Setting the *name* attribute of a different " +"thread only updates the Python Thread object.)" msgstr "" +"تغییرات *name* تنها زمانی در سطح سیستم‌عامل منعکس می‌شود که نخ در حال اجرا " +"تغییر نام داده شود. (تنظیم ویژگی *name* یک نخ دیگر، فقط شیء Thread پایتون را" +" به‌روزرسانی می‌کند.)" -msgid "Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a property instead." +msgid "" +"Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a " +"property instead." msgstr "" +"API منسوخ برای دریافت‌کننده/تنظیم‌کننده (getter/setter) مربوط به " +":attr:`~Thread.name`؛ به‌جای آن، مستقیماً از آن به‌عنوان یک ویژگی استفاده " +"کنید." -msgid "The 'thread identifier' of this thread or ``None`` if the thread has not been started. This is a nonzero integer. See the :func:`get_ident` function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited." +msgid "" +"The 'thread identifier' of this thread or ``None`` if the thread has not " +"been started. This is a nonzero integer. See the :func:`get_ident` " +"function. Thread identifiers may be recycled when a thread exits and " +"another thread is created. The identifier is available even after the " +"thread has exited." msgstr "" +"«شناسه‌ی نخ» برای این نخ یا ``None`` اگر نخ شروع نشده باشد. این یک عدد صحیح " +"غیرصفر است. تابع :func:`get_ident` را ببینید. ممکن است شناسه‌های نخ زمانی که" +" یک نخ به پایان می‌رسد و نخ دیگری ایجاد می‌شود، دوباره استفاده شوند. شناسه " +"حتی پس از پایان یافتن نخ نیز در دسترس است." -msgid "The Thread ID (``TID``) of this thread, as assigned by the OS (kernel). This is a non-negative integer, or ``None`` if the thread has not been started. See the :func:`get_native_id` function. This value may be used to uniquely identify this particular thread system-wide (until the thread terminates, after which the value may be recycled by the OS)." -msgstr "" +msgid "" +"The Thread ID (``TID``) of this thread, as assigned by the OS (kernel). This" +" is a non-negative integer, or ``None`` if the thread has not been started. " +"See the :func:`get_native_id` function. This value may be used to uniquely " +"identify this particular thread system-wide (until the thread terminates, " +"after which the value may be recycled by the OS)." +msgstr "" +"شناسه نخ (``TID``) این نخ، که توسط سیستم‌عامل (هسته) اختصاص داده شده است. " +"این یک عدد صحیح غیرمنفی است، یا اگر نخ شروع نشده باشد، ``None`` است. تابع " +":func:`get_native_id` را ببینید. می‌توان از این مقدار برای شناسایی یکتای این" +" نخ خاص در سراسر سیستم استفاده کرد (تا زمانی که نخ خاتمه یابد، پس از آن ممکن" +" است این مقدار توسط سیستم‌عامل بازیافت شود)." -msgid "Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-wide) from the time the thread is created until the thread has been terminated." +msgid "" +"Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-" +"wide) from the time the thread is created until the thread has been " +"terminated." msgstr "" +"مانند شناسه‌های فرایند، شناسه‌های نخ تنها از زمان ایجاد نخ تا زمان پایان " +"یافتن آن معتبر هستند (یکتایی آن‌ها در سراسر سیستم تضمین‌شده است)." msgid "Return whether the thread is alive." -msgstr "" +msgstr "زنده بودن نخ را برمی‌گرداند." -msgid "This method returns ``True`` just before the :meth:`~Thread.run` method starts until just after the :meth:`~Thread.run` method terminates. The module function :func:`.enumerate` returns a list of all alive threads." +msgid "" +"This method returns ``True`` just before the :meth:`~Thread.run` method " +"starts until just after the :meth:`~Thread.run` method terminates. The " +"module function :func:`.enumerate` returns a list of all alive threads." msgstr "" +"این متد ``True`` را از درست پیش از آغاز متد :meth:`~Thread.run` تا درست پس " +"از پایان متد :meth:`~Thread.run` بازمی‌گرداند. تابع ماژول :func:`.enumerate`" +" فهرستی از همه نخ‌های زنده را بازمی‌گرداند." -msgid "A boolean value indicating whether this thread is a daemon thread (``True``) or not (``False``). This must be set before :meth:`~Thread.start` is called, otherwise :exc:`RuntimeError` is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to :attr:`~Thread.daemon` = ``False``." -msgstr "" +msgid "" +"A boolean value indicating whether this thread is a daemon thread (``True``)" +" or not (``False``). This must be set before :meth:`~Thread.start` is " +"called, otherwise :exc:`RuntimeError` is raised. Its initial value is " +"inherited from the creating thread; the main thread is not a daemon thread " +"and therefore all threads created in the main thread default to " +":attr:`~Thread.daemon` = ``False``." +msgstr "" +"یک مقدار بولی که نشان می‌دهد این نخ یک نخ daemon است (``True``) یا خیر " +"(``False``). این مقدار باید پیش از فراخوانی :meth:`~Thread.start` تنظیم " +"شود، در غیر این صورت :exc:`RuntimeError` پرتاب می‌شود. مقدار اولیه آن از نخ" +" ایجادکننده به ارث می‌رسد؛ نخ اصلی یک نخ daemon نیست و بنابراین همه نخ‌هایی " +"که در نخ اصلی ایجاد می‌شوند، به‌طور پیش‌فرض :attr:`~Thread.daemon` = " +"``False`` هستند." -msgid "The entire Python program exits when no alive non-daemon threads are left." +msgid "" +"The entire Python program exits when no alive non-daemon threads are left." msgstr "" +"کل برنامه پایتون هنگامی خارج می‌شود که دیگر هیچ نخ زنده غیر daemon (non-" +"daemon) باقی نمانده باشد." -msgid "Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as a property instead." +msgid "" +"Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as " +"a property instead." msgstr "" +"API getter/setter منسوخ‌شده برای :attr:`~Thread.daemon`؛ به‌جای آن مستقیماً " +"از آن به‌عنوان یک ویژگی استفاده کنید." msgid "Lock objects" -msgstr "" +msgstr "اشیای قفل" -msgid "A primitive lock is a synchronization primitive that is not owned by a particular thread when locked. In Python, it is currently the lowest level synchronization primitive available, implemented directly by the :mod:`_thread` extension module." +msgid "" +"A primitive lock is a synchronization primitive that is not owned by a " +"particular thread when locked. In Python, it is currently the lowest level " +"synchronization primitive available, implemented directly by the " +":mod:`_thread` extension module." msgstr "" +"یک قفل اولیه، یک سازوکار همگام‌سازی است که هنگام قفل بودن، متعلق به نخ خاصی " +"نیست. در پایتون، این قفل در حال حاضر پایین‌ترین سطح سازوکار همگام‌سازی در " +"دسترس است که مستقیماً توسط ماژول توسعه‌ی :mod:`_thread` پیاده‌سازی شده است." -msgid "A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is created in the unlocked state. It has two basic methods, :meth:`~Lock.acquire` and :meth:`~Lock.release`. When the state is unlocked, :meth:`~Lock.acquire` changes the state to locked and returns immediately. When the state is locked, :meth:`~Lock.acquire` blocks until a call to :meth:`~Lock.release` in another thread changes it to unlocked, then the :meth:`~Lock.acquire` call resets it to locked and returns. The :meth:`~Lock.release` method should only be called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a :exc:`RuntimeError` will be raised." -msgstr "" +msgid "" +"A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is " +"created in the unlocked state. It has two basic methods, " +":meth:`~Lock.acquire` and :meth:`~Lock.release`. When the state is " +"unlocked, :meth:`~Lock.acquire` changes the state to locked and returns " +"immediately. When the state is locked, :meth:`~Lock.acquire` blocks until a" +" call to :meth:`~Lock.release` in another thread changes it to unlocked, " +"then the :meth:`~Lock.acquire` call resets it to locked and returns. The " +":meth:`~Lock.release` method should only be called in the locked state; it " +"changes the state to unlocked and returns immediately. If an attempt is made" +" to release an unlocked lock, a :exc:`RuntimeError` will be raised." +msgstr "" +"یک قفل اولیه در یکی از دو حالت «قفل‌شده» یا «باز» قرار دارد. این قفل در حالت" +" باز ایجاد می‌شود. دو متد پایه دارد: :meth:`~Lock.acquire` و " +":meth:`~Lock.release`. هنگامی که حالت باز است، :meth:`~Lock.acquire` حالت را" +" به قفل‌شده تغییر می‌دهد و بلافاصله بازمی‌گردد. هنگامی که حالت قفل‌شده است، " +":meth:`~Lock.acquire` مسدود می‌شود تا زمانی که فراخوانی " +":meth:`~Lock.release` در نخی دیگر آن را به حالت باز تغییر دهد، سپس فراخوانی " +":meth:`~Lock.acquire` آن را دوباره به حالت قفل‌شده تنظیم می‌کند و " +"بازمی‌گردد. متد :meth:`~Lock.release` باید فقط در حالت قفل‌شده فراخوانی شود؛" +" این متد حالت را به باز تغییر می‌دهد و بلافاصله بازمی‌گردد. اگر تلاشی برای " +"آزاد کردن یک قفل باز انجام شود، یک :exc:`RuntimeError` پرتاب خواهد شد." -msgid "Locks also support the :ref:`context management protocol `." +msgid "" +"Locks also support the :ref:`context management protocol `." msgstr "" +"قفل‌ها همچنین از :ref:`پروتکل مدیریت زمینه ` پشتیبانی می‌کنند." -msgid "When more than one thread is blocked in :meth:`~Lock.acquire` waiting for the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock.release` call resets the state to unlocked; which one of the waiting threads proceeds is not defined, and may vary across implementations." -msgstr "" +msgid "" +"When more than one thread is blocked in :meth:`~Lock.acquire` waiting for " +"the state to turn to unlocked, only one thread proceeds when a " +":meth:`~Lock.release` call resets the state to unlocked; which one of the " +"waiting threads proceeds is not defined, and may vary across " +"implementations." +msgstr "" +"هنگامی که بیش از یک نخ در :meth:`~Lock.acquire` مسدود شده‌اند و در انتظار " +"هستند تا وضعیت به حالت قفل‌نشده تغییر کند، هرگاه یک فراخوانی " +":meth:`~Lock.release` وضعیت را به حالت قفل‌نشده بازنشانی کند، تنها یک نخ " +"ادامه می‌دهد؛ این‌که کدام‌یک از نخ‌های منتظر ادامه می‌دهد تعریف نشده است و " +"ممکن است در پیاده‌سازی‌های مختلف متفاوت باشد." msgid "All methods are executed atomically." -msgstr "" +msgstr "همه‌ی متدها به‌صورت اتمی اجرا می‌شوند." -msgid "The class implementing primitive lock objects. Once a thread has acquired a lock, subsequent attempts to acquire it block, until it is released; any thread may release it." +msgid "" +"The class implementing primitive lock objects. Once a thread has acquired a" +" lock, subsequent attempts to acquire it block, until it is released; any " +"thread may release it." msgstr "" +"کلاسی که اشیای قفل اولیه را پیاده‌سازی می‌کند. پس از آنکه یک نخ قفلی را کسب " +"کرد، تلاش‌های بعدی برای کسب آن مسدود می‌شوند، تا زمانی که آزاد شود؛ هر نخی " +"می‌تواند آن را آزاد کند." -msgid "``Lock`` is now a class. In earlier Pythons, ``Lock`` was a factory function which returned an instance of the underlying private lock type." +msgid "" +"``Lock`` is now a class. In earlier Pythons, ``Lock`` was a factory function" +" which returned an instance of the underlying private lock type." msgstr "" +"``Lock`` اکنون یک کلاس است. در پایتون‌های پیشین، ``Lock`` یک تابع کارخانه " +"(factory function) بود که نمونه‌ای از نوع قفل خصوصی زیربنایی را برمی‌گرداند." msgid "Acquire a lock, blocking or non-blocking." -msgstr "" +msgstr "یک قفل را به‌صورت مسدودکننده یا غیرمسدودکننده کسب کنید." -msgid "When invoked with the *blocking* argument set to ``True`` (the default), block until the lock is unlocked, then set it to locked and return ``True``." +msgid "" +"When invoked with the *blocking* argument set to ``True`` (the default), " +"block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" +"هنگامی که با آرگومان *blocking* تنظیم‌شده روی ``True`` (پیش‌فرض) فراخوانی " +"شود، تا آزاد شدن قفل مسدود می‌شود، سپس آن را در حالت قفل‌شده قرار می‌دهد و " +"``True`` را برمی‌گرداند." -msgid "When invoked with the *blocking* argument set to ``False``, do not block. If a call with *blocking* set to ``True`` would block, return ``False`` immediately; otherwise, set the lock to locked and return ``True``." +msgid "" +"When invoked with the *blocking* argument set to ``False``, do not block. If" +" a call with *blocking* set to ``True`` would block, return ``False`` " +"immediately; otherwise, set the lock to locked and return ``True``." msgstr "" +"هنگامی که با آرگومان *blocking* تنظیم‌شده روی ``False`` فراخوانی شود، مسدود " +"نمی‌کند. اگر فراخوانی با *blocking* تنظیم‌شده روی ``True`` قرار باشد مسدود " +"شود، بلافاصله ``False`` را برمی‌گرداند؛ در غیر این صورت، قفل را در وضعیت " +"قفل‌شده قرار می‌دهد و ``True`` را برمی‌گرداند." -msgid "When invoked with the floating-point *timeout* argument set to a positive value, block for at most the number of seconds specified by *timeout* and as long as the lock cannot be acquired. A *timeout* argument of ``-1`` specifies an unbounded wait. It is forbidden to specify a *timeout* when *blocking* is ``False``." -msgstr "" +msgid "" +"When invoked with the floating-point *timeout* argument set to a positive " +"value, block for at most the number of seconds specified by *timeout* and as" +" long as the lock cannot be acquired. A *timeout* argument of ``-1`` " +"specifies an unbounded wait. It is forbidden to specify a *timeout* when " +"*blocking* is ``False``." +msgstr "" +"هنگام فراخوانی با آرگومان *timeout* از نوع ممیز شناور که روی مقدار مثبت " +"تنظیم شده باشد، حداکثر به تعداد ثانیه‌های مشخص‌شده توسط *timeout* و تا زمانی" +" که قفل قابل کسب نباشد، مسدود می‌شود. آرگومان *timeout* با مقدار ``-1`` یک " +"انتظار نامحدود را مشخص می‌کند. تعیین *timeout* زمانی که *blocking* برابر " +"``False`` باشد ممنوع است." -msgid "The return value is ``True`` if the lock is acquired successfully, ``False`` if not (for example if the *timeout* expired)." +msgid "" +"The return value is ``True`` if the lock is acquired successfully, ``False``" +" if not (for example if the *timeout* expired)." msgstr "" +"مقدار بازگشتی ``True`` است اگر قفل با موفقیت گرفته شود، در غیر این صورت " +"``False`` است (برای مثال اگر *timeout* منقضی شده باشد)." msgid "The *timeout* parameter is new." -msgstr "" +msgstr "پارامتر *timeout* جدید است." -msgid "Lock acquisition can now be interrupted by signals on POSIX if the underlying threading implementation supports it." +msgid "" +"Lock acquisition can now be interrupted by signals on POSIX if the " +"underlying threading implementation supports it." msgstr "" +"اکنون می‌توان تهیه قفل را در POSIX با سیگنال‌ها قطع کرد، در صورتی که " +"پیاده‌سازی زیربنایی نخ‌بندی (threading) از این قابلیت پشتیبانی کند." msgid "Lock acquisition can now be interrupted by signals on Windows." -msgstr "" +msgstr "اکنون می‌توان کسب قفل را در ویندوز با سیگنال‌ها قطع کرد." -msgid "Release a lock. This can be called from any thread, not only the thread which has acquired the lock." +msgid "" +"Release a lock. This can be called from any thread, not only the thread " +"which has acquired the lock." msgstr "" +"آزاد کردن یک قفل. می‌توان آن را از هر نخی فراخوانی کرد، نه فقط از نخی که قفل" +" را کسب کرده است." -msgid "When the lock is locked, reset it to unlocked, and return. If any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed." +msgid "" +"When the lock is locked, reset it to unlocked, and return. If any other " +"threads are blocked waiting for the lock to become unlocked, allow exactly " +"one of them to proceed." msgstr "" +"هنگامی که قفل، قفل است، آن را به حالت باز بازنشانی کنید و بازگردید. اگر " +"نخ‌های دیگری مسدود شده‌اند و در انتظار باز شدن قفل هستند، دقیقاً به یکی از " +"آن‌ها اجازه‌ی ادامه بدهید." msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." -msgstr "" +msgstr "هنگام فراخوانی روی یک قفل باز، یک :exc:`RuntimeError` پرتاب می‌شود." msgid "There is no return value." -msgstr "" +msgstr "هیچ مقدار بازگشتی وجود ندارد." msgid "Return ``True`` if the lock is acquired." -msgstr "" +msgstr "اگر قفل به‌دست آمده باشد، ``True`` برمی‌گرداند." msgid "RLock objects" -msgstr "" +msgstr "اشیای RLock" -msgid "A reentrant lock is a synchronization primitive that may be acquired multiple times by the same thread. Internally, it uses the concepts of \"owning thread\" and \"recursion level\" in addition to the locked/unlocked state used by primitive locks. In the locked state, some thread owns the lock; in the unlocked state, no thread owns it." -msgstr "" +msgid "" +"A reentrant lock is a synchronization primitive that may be acquired " +"multiple times by the same thread. Internally, it uses the concepts of " +"\"owning thread\" and \"recursion level\" in addition to the locked/unlocked" +" state used by primitive locks. In the locked state, some thread owns the " +"lock; in the unlocked state, no thread owns it." +msgstr "" +"قفل بازورودپذیر (reentrant lock) یک سازوکار اولیه‌ی همگام‌سازی است که یک نخ یکسان" +" می‌تواند آن را چندین بار کسب کند. از نظر داخلی، این قفل علاوه بر وضعیت " +"قفل‌شده/قفل‌نشده‌ی استفاده‌شده در قفل‌های اولیه، از مفاهیم «نخ مالک» و «سطح " +"بازگشت» استفاده می‌کند. در وضعیت قفل‌شده، نخی مالک قفل است؛ در وضعیت " +"قفل‌نشده، هیچ نخی مالک آن نیست." -msgid "Threads call a lock's :meth:`~RLock.acquire` method to lock it, and its :meth:`~Lock.release` method to unlock it." +msgid "" +"Threads call a lock's :meth:`~RLock.acquire` method to lock it, and its " +":meth:`~Lock.release` method to unlock it." msgstr "" +"نخ‌ها برای قفل کردن یک قفل، متد :meth:`~RLock.acquire` آن و برای باز کردن " +"قفل آن، متد :meth:`~Lock.release` آن را فراخوانی می‌کنند." -msgid "Reentrant locks support the :ref:`context management protocol `, so it is recommended to use :keyword:`with` instead of manually calling :meth:`~RLock.acquire` and :meth:`~RLock.release` to handle acquiring and releasing the lock for a block of code." +msgid "" +"Reentrant locks support the :ref:`context management protocol `," +" so it is recommended to use :keyword:`with` instead of manually calling " +":meth:`~RLock.acquire` and :meth:`~RLock.release` to handle acquiring and " +"releasing the lock for a block of code." msgstr "" +"قفل‌های بازورودپذیر از :ref:`پروتکل مدیریت زمینه ` پشتیبانی می‌کنند،" +" بنابراین توصیه می‌شود به‌جای فراخوانی دستی :meth:`~RLock.acquire` و " +":meth:`~RLock.release` برای مدیریت کسب و آزادسازی قفل در یک بلوک کد، از " +":keyword:`with` استفاده کنید." -msgid "RLock's :meth:`~RLock.acquire`/:meth:`~RLock.release` call pairs may be nested, unlike Lock's :meth:`~Lock.acquire`/:meth:`~Lock.release`. Only the final :meth:`~RLock.release` (the :meth:`~Lock.release` of the outermost pair) resets the lock to an unlocked state and allows another thread blocked in :meth:`~RLock.acquire` to proceed." -msgstr "" +msgid "" +"RLock's :meth:`~RLock.acquire`/:meth:`~RLock.release` call pairs may be " +"nested, unlike Lock's :meth:`~Lock.acquire`/:meth:`~Lock.release`. Only the " +"final :meth:`~RLock.release` (the :meth:`~Lock.release` of the outermost " +"pair) resets the lock to an unlocked state and allows another thread blocked" +" in :meth:`~RLock.acquire` to proceed." +msgstr "" +"جفت‌های فراخوانی :meth:`~RLock.acquire`/:meth:`~RLock.release` در RLock " +"می‌توانند تودرتو باشند، برخلاف :meth:`~Lock.acquire`/:meth:`~Lock.release` " +"در Lock. تنها آخرین :meth:`~RLock.release` (یعنی :meth:`~Lock.release` از " +"بیرونی‌ترین جفت) قفل را به وضعیت قفل‌نشده بازنشانی می‌کند و به نخ دیگری که " +"در :meth:`~RLock.acquire` مسدود شده است اجازه می‌دهد ادامه دهد." -msgid ":meth:`~RLock.acquire`/:meth:`~RLock.release` must be used in pairs: each acquire must have a release in the thread that has acquired the lock. Failing to call release as many times the lock has been acquired can lead to deadlock." +msgid "" +":meth:`~RLock.acquire`/:meth:`~RLock.release` must be used in pairs: each " +"acquire must have a release in the thread that has acquired the lock. " +"Failing to call release as many times the lock has been acquired can lead to" +" deadlock." msgstr "" +":meth:`~RLock.acquire`/:meth:`~RLock.release` باید به‌صورت جفت استفاده شوند:" +" هر فراخوانی acquire باید یک فراخوانی release در نخی که قفل را کسب کرده است " +"داشته باشد. عدم فراخوانی release به تعداد دفعاتی که قفل کسب شده است می‌تواند" +" منجر به بن‌بست شود." -msgid "This class implements reentrant lock objects. A reentrant lock must be released by the thread that acquired it. Once a thread has acquired a reentrant lock, the same thread may acquire it again without blocking; the thread must release it once for each time it has acquired it." +msgid "" +"This class implements reentrant lock objects. A reentrant lock must be " +"released by the thread that acquired it. Once a thread has acquired a " +"reentrant lock, the same thread may acquire it again without blocking; the " +"thread must release it once for each time it has acquired it." msgstr "" +"این کلاس اشیای قفل بازورودپذیر (reentrant lock) را پیاده‌سازی می‌کند. یک قفل " +"بازورودپذیر باید توسط نخی که آن را به دست آورده است آزاد شود. هنگامی که نخی یک" +" قفل بازورودپذیر را به دست آورده باشد، همان نخ می‌تواند دوباره آن را بدون " +"مسدود شدن به دست آورد؛ نخ باید به ازای هر باری که آن را به دست آورده است، " +"یک‌بار آن را آزاد کند." -msgid "Note that ``RLock`` is actually a factory function which returns an instance of the most efficient version of the concrete RLock class that is supported by the platform." +msgid "" +"Note that ``RLock`` is actually a factory function which returns an instance" +" of the most efficient version of the concrete RLock class that is supported" +" by the platform." msgstr "" +"توجه داشته باشید که ``RLock`` در واقع یک تابع کارخانه‌ای است که نمونه‌ای از " +"کارآمدترین نسخه‌ی کلاس ملموس RLock را برمی‌گرداند که توسط پلتفرم پشتیبانی " +"می‌شود." msgid ":ref:`Using RLock as a context manager `" -msgstr "" +msgstr ":ref:`استفاده از RLock به‌عنوان مدیر زمینه `" -msgid "Recommended over manual :meth:`!acquire` and :meth:`release` calls whenever practical." +msgid "" +"Recommended over manual :meth:`!acquire` and :meth:`release` calls whenever " +"practical." msgstr "" +"هر زمان که عملی باشد، به جای فراخوانی‌های دستی :meth:`!acquire` و " +":meth:`release` توصیه می‌شود." -msgid "When invoked with the *blocking* argument set to ``True`` (the default):" -msgstr "" +msgid "" +"When invoked with the *blocking* argument set to ``True`` (the default):" +msgstr "هنگامی که با آرگومان *blocking* روی ``True`` (پیش‌فرض) فراخوانی شود:" msgid "If no thread owns the lock, acquire the lock and return immediately." msgstr "" +"اگر هیچ نخی مالک قفل نباشد، قفل را به دست می‌آورد و بلافاصله بازمی‌گردد." -msgid "If another thread owns the lock, block until we are able to acquire lock, or *timeout*, if set to a positive float value." +msgid "" +"If another thread owns the lock, block until we are able to acquire lock, or" +" *timeout*, if set to a positive float value." msgstr "" +"اگر نخ دیگری مالک قفل باشد، مسدود می‌شود تا زمانی که بتوانیم قفل را کسب " +"کنیم، یا تا *timeout*، اگر روی یک مقدار float مثبت تنظیم شده باشد." -msgid "If the same thread owns the lock, acquire the lock again, and return immediately. This is the difference between :class:`Lock` and :class:`!RLock`; :class:`Lock` handles this case the same as the previous, blocking until the lock can be acquired." +msgid "" +"If the same thread owns the lock, acquire the lock again, and return " +"immediately. This is the difference between :class:`Lock` and " +":class:`!RLock`; :class:`Lock` handles this case the same as the previous, " +"blocking until the lock can be acquired." msgstr "" +"اگر همان نخ مالک قفل باشد، قفل را دوباره به دست می‌آورد و بلافاصله " +"بازمی‌گردد. این تفاوت میان :class:`Lock` و :class:`!RLock` است؛ " +":class:`Lock` این حالت را مانند حالت قبلی مدیریت می‌کند و تا زمانی که قفل " +"بتواند به دست آید، مسدود می‌شود." msgid "When invoked with the *blocking* argument set to ``False``:" -msgstr "" +msgstr "هنگامی که با آرگومان *blocking* تنظیم‌شده روی ``False`` فراخوانی شود:" msgid "If another thread owns the lock, return immediately." -msgstr "" +msgstr "اگر نخ دیگری مالک قفل باشد، بلافاصله بازمی‌گردد." -msgid "If the same thread owns the lock, acquire the lock again and return immediately." +msgid "" +"If the same thread owns the lock, acquire the lock again and return " +"immediately." msgstr "" +"اگر همان نخ مالک قفل باشد، قفل را دوباره به دست می‌آورد و بلافاصله " +"بازمی‌گردد." -msgid "In all cases, if the thread was able to acquire the lock, return ``True``. If the thread was unable to acquire the lock (i.e. if not blocking or the timeout was reached) return ``False``." +msgid "" +"In all cases, if the thread was able to acquire the lock, return ``True``. " +"If the thread was unable to acquire the lock (i.e. if not blocking or the " +"timeout was reached) return ``False``." msgstr "" +"در همه‌ی موارد، اگر نخ توانسته باشد قفل را به دست آورد، ``True`` برمی‌گرداند." +" اگر نخ نتوانسته باشد قفل را به دست آورد (یعنی اگر مسدودکننده نباشد یا مهلت " +"به پایان رسیده باشد)، ``False`` برمی‌گرداند." -msgid "If called multiple times, failing to call :meth:`~RLock.release` as many times may lead to deadlock. Consider using :class:`!RLock` as a context manager rather than calling acquire/release directly." +msgid "" +"If called multiple times, failing to call :meth:`~RLock.release` as many " +"times may lead to deadlock. Consider using :class:`!RLock` as a context " +"manager rather than calling acquire/release directly." msgstr "" +"اگر چندین بار فراخوانی شود، فراخوانی نکردن :meth:`~RLock.release` به همان " +"تعداد ممکن است به بن‌بست منجر شود. بهتر است به‌جای فراخوانی مستقیم " +"acquire/release، از :class:`!RLock` به‌عنوان مدیر زمینه استفاده کنید." -msgid "Release a lock, decrementing the recursion level. If after the decrement it is zero, reset the lock to unlocked (not owned by any thread), and if any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. If after the decrement the recursion level is still nonzero, the lock remains locked and owned by the calling thread." -msgstr "" +msgid "" +"Release a lock, decrementing the recursion level. If after the decrement it" +" is zero, reset the lock to unlocked (not owned by any thread), and if any " +"other threads are blocked waiting for the lock to become unlocked, allow " +"exactly one of them to proceed. If after the decrement the recursion level " +"is still nonzero, the lock remains locked and owned by the calling thread." +msgstr "" +"یک قفل را آزاد می‌کند و سطح بازگشت را کاهش می‌دهد. اگر پس از کاهش، سطح " +"بازگشت صفر باشد، قفل به حالت باز (قفل‌نشده) بازنشانی می‌شود (متعلق به هیچ " +"نخی نیست)، و اگر نخ‌های دیگری در انتظار باز شدن قفل مسدود شده باشند، دقیقاً " +"به یکی از آن‌ها اجازه‌ی ادامه داده می‌شود. اگر پس از کاهش، سطح بازگشت هنوز " +"ناصفر باشد، قفل همچنان قفل‌شده و متعلق به نخ فراخوانی‌کننده باقی می‌ماند." -msgid "Only call this method when the calling thread owns the lock. A :exc:`RuntimeError` is raised if this method is called when the lock is not acquired." +msgid "" +"Only call this method when the calling thread owns the lock. A " +":exc:`RuntimeError` is raised if this method is called when the lock is not " +"acquired." msgstr "" +"این متد را تنها زمانی فراخوانی کنید که نخ فراخواننده مالک قفل است. اگر این " +"متد در زمانی که قفل گرفته نشده است فراخوانی شود، یک :exc:`RuntimeError` " +"پرتاب می‌شود." msgid "Return a boolean indicating whether this object is locked right now." msgstr "" +"یک بولی برمی‌گرداند که نشان می‌دهد آیا این شیء در حال حاضر قفل است یا خیر." msgid "Condition objects" -msgstr "" +msgstr "اشیای شرط" -msgid "A condition variable is always associated with some kind of lock; this can be passed in or one will be created by default. Passing one in is useful when several condition variables must share the same lock. The lock is part of the condition object: you don't have to track it separately." +msgid "" +"A condition variable is always associated with some kind of lock; this can " +"be passed in or one will be created by default. Passing one in is useful " +"when several condition variables must share the same lock. The lock is part" +" of the condition object: you don't have to track it separately." msgstr "" +"یک متغیر شرط همیشه با نوعی قفل همراه است؛ می‌توان این قفل را به‌عنوان " +"آرگومان ارسال کرد یا به‌طور پیش‌فرض یکی ایجاد می‌شود. ارسال آن زمانی مفید " +"است که چندین متغیر شرط باید یک قفل مشترک داشته باشند. قفل بخشی از شیء شرط " +"است: نیازی نیست آن را به‌طور جداگانه پیگیری کنید." -msgid "A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the duration of the enclosed block. The :meth:`~Condition.acquire` and :meth:`~Condition.release` methods also call the corresponding methods of the associated lock." +msgid "" +"A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the " +"duration of the enclosed block. The :meth:`~Condition.acquire` and " +":meth:`~Condition.release` methods also call the corresponding methods of " +"the associated lock." msgstr "" +"یک متغیر شرط از :ref:`پروتکل مدیریت زمینه ` پیروی می‌کند: " +"استفاده از دستور ``with``، قفل مرتبط را در طول بلوک محصورشده به دست " +"می‌آورد. متدهای :meth:`~Condition.acquire` و :meth:`~Condition.release` نیز " +"متدهای متناظر قفل مرتبط را فراخوانی می‌کنند." -msgid "Other methods must be called with the associated lock held. The :meth:`~Condition.wait` method releases the lock, and then blocks until another thread awakens it by calling :meth:`~Condition.notify` or :meth:`~Condition.notify_all`. Once awakened, :meth:`~Condition.wait` re-acquires the lock and returns. It is also possible to specify a timeout." -msgstr "" +msgid "" +"Other methods must be called with the associated lock held. The " +":meth:`~Condition.wait` method releases the lock, and then blocks until " +"another thread awakens it by calling :meth:`~Condition.notify` or " +":meth:`~Condition.notify_all`. Once awakened, :meth:`~Condition.wait` re-" +"acquires the lock and returns. It is also possible to specify a timeout." +msgstr "" +"سایر متدها باید در حالی فراخوانی شوند که قفل مرتبط نگه داشته شده باشد. متد " +":meth:`~Condition.wait` قفل را آزاد می‌کند و سپس مسدود می‌شود تا نخ دیگری با" +" فراخوانی :meth:`~Condition.notify` یا :meth:`~Condition.notify_all` آن را " +"بیدار کند. پس از بیدار شدن، :meth:`~Condition.wait` دوباره قفل را به دست " +"می‌آورد و بازمی‌گردد. همچنین می‌توان یک مهلت زمانی (timeout) مشخص کرد." -msgid "The :meth:`~Condition.notify` method wakes up one of the threads waiting for the condition variable, if any are waiting. The :meth:`~Condition.notify_all` method wakes up all threads waiting for the condition variable." +msgid "" +"The :meth:`~Condition.notify` method wakes up one of the threads waiting for" +" the condition variable, if any are waiting. The " +":meth:`~Condition.notify_all` method wakes up all threads waiting for the " +"condition variable." msgstr "" +"متد :meth:`~Condition.notify` یکی از نخ‌های در انتظار متغیر شرطی را، در " +"صورتی که منتظری وجود داشته باشد، بیدار می‌کند. متد " +":meth:`~Condition.notify_all` همه نخ‌های در انتظار متغیر شرطی را بیدار " +"می‌کند." -msgid "Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` methods don't release the lock; this means that the thread or threads awakened will not return from their :meth:`~Condition.wait` call immediately, but only when the thread that called :meth:`~Condition.notify` or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." -msgstr "" +msgid "" +"Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` " +"methods don't release the lock; this means that the thread or threads " +"awakened will not return from their :meth:`~Condition.wait` call " +"immediately, but only when the thread that called :meth:`~Condition.notify` " +"or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." +msgstr "" +"توجه: متدهای :meth:`~Condition.notify` و :meth:`~Condition.notify_all` قفل " +"را آزاد نمی‌کنند؛ این بدان معناست که نخ یا نخ‌های بیدارشده بلافاصله از " +"فراخوانی :meth:`~Condition.wait` خود بازنمی‌گردند، بلکه تنها زمانی " +"بازمی‌گردند که نخی که :meth:`~Condition.notify` یا " +":meth:`~Condition.notify_all` را فراخوانی کرده باشد، سرانجام مالکیت قفل را " +"واگذار کند." -msgid "The typical programming style using condition variables uses the lock to synchronize access to some shared state; threads that are interested in a particular change of state call :meth:`~Condition.wait` repeatedly until they see the desired state, while threads that modify the state call :meth:`~Condition.notify` or :meth:`~Condition.notify_all` when they change the state in such a way that it could possibly be a desired state for one of the waiters. For example, the following code is a generic producer-consumer situation with unlimited buffer capacity::" -msgstr "" +msgid "" +"The typical programming style using condition variables uses the lock to " +"synchronize access to some shared state; threads that are interested in a " +"particular change of state call :meth:`~Condition.wait` repeatedly until " +"they see the desired state, while threads that modify the state call " +":meth:`~Condition.notify` or :meth:`~Condition.notify_all` when they change " +"the state in such a way that it could possibly be a desired state for one of" +" the waiters. For example, the following code is a generic producer-" +"consumer situation with unlimited buffer capacity::" +msgstr "" +"سبک برنامه‌نویسی رایج با استفاده از متغیرهای شرطی، از قفل برای همگام‌سازی " +"دسترسی به یک وضعیت مشترک استفاده می‌کند؛ نخ‌هایی که به تغییر خاصی در وضعیت " +"علاقه‌مند هستند، :meth:`~Condition.wait` را به‌طور مکرر فراخوانی می‌کنند تا " +"وضعیت مطلوب را مشاهده کنند، در حالی که نخ‌هایی که وضعیت را تغییر می‌دهند، " +"هنگامی که وضعیت را به‌گونه‌ای تغییر می‌دهند که ممکن است وضعیت مطلوبی برای " +"یکی از نخ‌های منتظر باشد، :meth:`~Condition.notify` یا " +":meth:`~Condition.notify_all` را فراخوانی می‌کنند. برای مثال، کد زیر یک " +"موقعیت عام تولیدکننده-مصرف‌کننده با ظرفیت نامحدود بافر است::" msgid "" "# Consume one item\n" @@ -704,9 +1610,31 @@ msgid "" " make_an_item_available()\n" " cv.notify()" msgstr "" +"# Consume one item\n" +"with cv:\n" +" while not an_item_is_available():\n" +" cv.wait()\n" +" get_an_available_item()\n" +"\n" +"# Produce one item\n" +"with cv:\n" +" make_an_item_available()\n" +" cv.notify()" -msgid "The ``while`` loop checking for the application's condition is necessary because :meth:`~Condition.wait` can return after an arbitrary long time, and the condition which prompted the :meth:`~Condition.notify` call may no longer hold true. This is inherent to multi-threaded programming. The :meth:`~Condition.wait_for` method can be used to automate the condition checking, and eases the computation of timeouts::" -msgstr "" +msgid "" +"The ``while`` loop checking for the application's condition is necessary " +"because :meth:`~Condition.wait` can return after an arbitrary long time, and" +" the condition which prompted the :meth:`~Condition.notify` call may no " +"longer hold true. This is inherent to multi-threaded programming. The " +":meth:`~Condition.wait_for` method can be used to automate the condition " +"checking, and eases the computation of timeouts::" +msgstr "" +"حلقه‌ی ``while`` که شرط برنامه را بررسی می‌کند، ضروری است، زیرا " +":meth:`~Condition.wait` می‌تواند پس از مدت زمانی دلخواه و طولانی بازگشت کند،" +" و ممکن است شرطی که موجب فراخوانی :meth:`~Condition.notify` شده است دیگر " +"برقرار نباشد. این موضوع ذاتی برنامه‌نویسی چندنخی است. متد " +":meth:`~Condition.wait_for` می‌تواند برای خودکارسازی بررسی شرط به کار رود و " +"محاسبه‌ی مهلت‌های زمانی (timeouts) را آسان‌تر کند::" msgid "" "# Consume an item\n" @@ -714,137 +1642,358 @@ msgid "" " cv.wait_for(an_item_is_available)\n" " get_an_available_item()" msgstr "" +"# Consume an item\n" +"with cv:\n" +" cv.wait_for(an_item_is_available)\n" +" get_an_available_item()" -msgid "To choose between :meth:`~Condition.notify` and :meth:`~Condition.notify_all`, consider whether one state change can be interesting for only one or several waiting threads. E.g. in a typical producer-consumer situation, adding one item to the buffer only needs to wake up one consumer thread." +msgid "" +"To choose between :meth:`~Condition.notify` and " +":meth:`~Condition.notify_all`, consider whether one state change can be " +"interesting for only one or several waiting threads. E.g. in a typical " +"producer-consumer situation, adding one item to the buffer only needs to " +"wake up one consumer thread." msgstr "" +"برای انتخاب بین :meth:`~Condition.notify` و :meth:`~Condition.notify_all`، " +"در نظر بگیرید که آیا یک تغییر وضعیت می‌تواند تنها برای یک یا چند نخ در " +"انتظار مهم باشد. به‌عنوان مثال در یک موقعیت معمول تولیدکننده-مصرف‌کننده، " +"افزودن یک آیتم به بافر تنها نیاز به بیدار کردن یک نخ مصرف‌کننده دارد." -msgid "This class implements condition variable objects. A condition variable allows one or more threads to wait until they are notified by another thread." +msgid "" +"This class implements condition variable objects. A condition variable " +"allows one or more threads to wait until they are notified by another " +"thread." msgstr "" +"این کلاس اشیای متغیر شرطی را پیاده‌سازی می‌کند. یک متغیر شرطی به یک یا چند " +"نخ اجازه می‌دهد تا زمانی که از سوی نخ دیگری مطلع شوند، منتظر بمانند." -msgid "If the *lock* argument is given and not ``None``, it must be a :class:`Lock` or :class:`RLock` object, and it is used as the underlying lock. Otherwise, a new :class:`RLock` object is created and used as the underlying lock." +msgid "" +"If the *lock* argument is given and not ``None``, it must be a :class:`Lock`" +" or :class:`RLock` object, and it is used as the underlying lock. " +"Otherwise, a new :class:`RLock` object is created and used as the underlying" +" lock." msgstr "" +"اگر آرگومان *lock* داده شده باشد و ``None`` نباشد، باید یک شیء :class:`Lock`" +" یا :class:`RLock` باشد و به‌عنوان قفل زیربنایی استفاده می‌شود. در غیر این " +"صورت، یک شیء :class:`RLock` جدید ایجاد می‌شود و به‌عنوان قفل زیربنایی " +"استفاده می‌شود." msgid "changed from a factory function to a class." -msgstr "" +msgstr "از یک تابع کارخانه به یک کلاس تغییر کرده است." -msgid "Acquire the underlying lock. This method calls the corresponding method on the underlying lock; the return value is whatever that method returns." +msgid "" +"Acquire the underlying lock. This method calls the corresponding method on " +"the underlying lock; the return value is whatever that method returns." msgstr "" +"قفل زیربنایی را کسب می‌کند. این متد، متد متناظر را روی قفل زیربنایی فراخوانی" +" می‌کند؛ مقدار بازگشتی، هر مقداری است که آن متد برمی‌گرداند." -msgid "Release the underlying lock. This method calls the corresponding method on the underlying lock; there is no return value." +msgid "" +"Release the underlying lock. This method calls the corresponding method on " +"the underlying lock; there is no return value." msgstr "" +"قفل زیربنایی را آزاد می‌کند. این متد، متد متناظر روی قفل زیربنایی را " +"فراخوانی می‌کند؛ مقدار بازگشتی وجود ندارد." -msgid "Wait until notified or until a timeout occurs. If the calling thread has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised." +msgid "" +"Wait until notified or until a timeout occurs. If the calling thread has not" +" acquired the lock when this method is called, a :exc:`RuntimeError` is " +"raised." msgstr "" +"تا زمانی که اطلاع داده شود یا مهلت زمانی رخ دهد، منتظر بمانید. اگر نخ فراخوان " +"هنگام فراخوانی این متد قفل را کسب نکرده باشد، :exc:`RuntimeError` پرتاب " +"می‌شود." -msgid "This method releases the underlying lock, and then blocks until it is awakened by a :meth:`notify` or :meth:`notify_all` call for the same condition variable in another thread, or until the optional timeout occurs. Once awakened or timed out, it re-acquires the lock and returns." +msgid "" +"This method releases the underlying lock, and then blocks until it is " +"awakened by a :meth:`notify` or :meth:`notify_all` call for the same " +"condition variable in another thread, or until the optional timeout occurs." +" Once awakened or timed out, it re-acquires the lock and returns." msgstr "" +"این متد قفل زیربنایی را آزاد می‌کند و سپس مسدود می‌شود تا با فراخوانی " +":meth:`notify` یا :meth:`notify_all` برای همان متغیر شرطی در یک نخ دیگر " +"بیدار شود، یا تا زمانی که مهلت اختیاری (timeout) به پایان برسد. پس از بیدار " +"شدن یا به پایان رسیدن مهلت، قفل را دوباره به دست می‌آورد و بازمی‌گردد." -msgid "When the *timeout* argument is present and not ``None``, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof)." +msgid "" +"When the *timeout* argument is present and not ``None``, it should be a " +"floating-point number specifying a timeout for the operation in seconds (or " +"fractions thereof)." msgstr "" +"هنگامی که آرگومان *timeout* وجود دارد و ``None`` نیست، باید یک عدد ممیز " +"شناور باشد که وقفه‌ای را برای عملیات بر حسب ثانیه (یا کسرهایی از آن) مشخص " +"می‌کند." -msgid "When the underlying lock is an :class:`RLock`, it is not released using its :meth:`release` method, since this may not actually unlock the lock when it was acquired multiple times recursively. Instead, an internal interface of the :class:`RLock` class is used, which really unlocks it even when it has been recursively acquired several times. Another internal interface is then used to restore the recursion level when the lock is reacquired." -msgstr "" +msgid "" +"When the underlying lock is an :class:`RLock`, it is not released using its " +":meth:`release` method, since this may not actually unlock the lock when it " +"was acquired multiple times recursively. Instead, an internal interface of " +"the :class:`RLock` class is used, which really unlocks it even when it has " +"been recursively acquired several times. Another internal interface is then " +"used to restore the recursion level when the lock is reacquired." +msgstr "" +"هنگامی که قفل زیربنایی یک :class:`RLock` باشد، با استفاده از متد " +":meth:`release` آن آزاد نمی‌شود، زیرا اگر قفل چندین بار به‌صورت بازگشتی کسب " +"شده باشد، این کار ممکن است واقعاً قفل را باز نکند. در عوض، از یک رابط داخلی " +"کلاس :class:`RLock` استفاده می‌شود که حتی اگر قفل چندین بار به‌صورت بازگشتی " +"کسب شده باشد، واقعاً آن را باز می‌کند. سپس از یک رابط داخلی دیگر برای " +"بازگرداندن سطح بازگشت، هنگامی که قفل دوباره کسب می‌شود، استفاده می‌شود." -msgid "The return value is ``True`` unless a given *timeout* expired, in which case it is ``False``." +msgid "" +"The return value is ``True`` unless a given *timeout* expired, in which case" +" it is ``False``." msgstr "" +"مقدار بازگشتی ``True`` است، مگر اینکه *timeout* داده‌شده منقضی‌شده باشد، که " +"در این صورت ``False`` است." msgid "Previously, the method always returned ``None``." -msgstr "" +msgstr "پیش از این، این متد همیشه ``None`` را برمی‌گرداند." -msgid "Wait until a condition evaluates to true. *predicate* should be a callable which result will be interpreted as a boolean value. A *timeout* may be provided giving the maximum time to wait." +msgid "" +"Wait until a condition evaluates to true. *predicate* should be a callable " +"which result will be interpreted as a boolean value. A *timeout* may be " +"provided giving the maximum time to wait." msgstr "" +"تا زمانی که یک شرط به مقدار درست ارزیابی شود، منتظر بمانید. *predicate* باید" +" یک فراخوان‌پذیر باشد که نتیجه‌ی آن به‌عنوان یک مقدار بولی تفسیر می‌شود. " +"می‌توان یک *timeout* برای تعیین حداکثر مهلت زمانی ارائه کرد." -msgid "This utility method may call :meth:`wait` repeatedly until the predicate is satisfied, or until a timeout occurs. The return value is the last return value of the predicate and will evaluate to ``False`` if the method timed out." +msgid "" +"This utility method may call :meth:`wait` repeatedly until the predicate is " +"satisfied, or until a timeout occurs. The return value is the last return " +"value of the predicate and will evaluate to ``False`` if the method timed " +"out." msgstr "" +"این متد کاربردی ممکن است :meth:`wait` را به‌طور مکرر فراخوانی کند تا شرط " +"برقرار شود یا مهلت زمانی‌ای (timeout) رخ دهد. مقدار بازگشتی، آخرین مقدار بازگشتی" +" شرط است و اگر متد دچار مهلت زمانی (timeout) شده باشد، به ``False`` ارزیابی " +"می‌شود." -msgid "Ignoring the timeout feature, calling this method is roughly equivalent to writing::" +msgid "" +"Ignoring the timeout feature, calling this method is roughly equivalent to " +"writing::" msgstr "" +"با چشم‌پوشی از قابلیت مهلت زمانی، فراخوانی این متد تقریباً معادل نوشتن " +"این است::" msgid "" "while not predicate():\n" " cv.wait()" msgstr "" +"while not predicate():\n" +" cv.wait()" -msgid "Therefore, the same rules apply as with :meth:`wait`: The lock must be held when called and is re-acquired on return. The predicate is evaluated with the lock held." +msgid "" +"Therefore, the same rules apply as with :meth:`wait`: The lock must be held " +"when called and is re-acquired on return. The predicate is evaluated with " +"the lock held." msgstr "" +"بنابراین، همان قواعدی که برای :meth:`wait` اعمال می‌شوند، در اینجا نیز اعمال" +" می‌شوند: هنگام فراخوانی باید قفل گرفته‌شده باشد و در زمان بازگشت دوباره " +"گرفته می‌شود. شرط در حالی که قفل گرفته‌شده است، ارزیابی می‌شود." -msgid "By default, wake up one thread waiting on this condition, if any. If the calling thread has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised." +msgid "" +"By default, wake up one thread waiting on this condition, if any. If the " +"calling thread has not acquired the lock when this method is called, a " +":exc:`RuntimeError` is raised." msgstr "" +"به‌طور پیش‌فرض، در صورت وجود، یک نخ منتظر روی این شرط را بیدار می‌کند. اگر " +"نخ فراخواننده هنگام فراخوانی این متد قفل را کسب نکرده باشد، یک " +":exc:`RuntimeError` پرتاب می‌شود." -msgid "This method wakes up at most *n* of the threads waiting for the condition variable; it is a no-op if no threads are waiting." +msgid "" +"This method wakes up at most *n* of the threads waiting for the condition " +"variable; it is a no-op if no threads are waiting." msgstr "" +"این متد حداکثر *n* نخ از نخ‌هایی که در انتظار متغیر شرطی هستند را بیدار " +"می‌کند؛ اگر هیچ نخی در انتظار نباشد، هیچ کاری انجام نمی‌شود." -msgid "The current implementation wakes up exactly *n* threads, if at least *n* threads are waiting. However, it's not safe to rely on this behavior. A future, optimized implementation may occasionally wake up more than *n* threads." +msgid "" +"The current implementation wakes up exactly *n* threads, if at least *n* " +"threads are waiting. However, it's not safe to rely on this behavior. A " +"future, optimized implementation may occasionally wake up more than *n* " +"threads." msgstr "" +"پیاده‌سازی فعلی، اگر حداقل *n* نخ در انتظار باشند، دقیقاً *n* نخ را بیدار " +"می‌کند. با این حال، اتکا به این رفتار ایمن نیست. ممکن است یک پیاده‌سازی " +"بهینه‌شده در آینده گاهی بیش از *n* نخ را بیدار کند." -msgid "Note: an awakened thread does not actually return from its :meth:`wait` call until it can reacquire the lock. Since :meth:`notify` does not release the lock, its caller should." +msgid "" +"Note: an awakened thread does not actually return from its :meth:`wait` call" +" until it can reacquire the lock. Since :meth:`notify` does not release the" +" lock, its caller should." msgstr "" +"توجه: یک نخ بیدارشده در واقع تا زمانی که بتواند قفل را دوباره به دست آورد، " +"از فراخوانی :meth:`wait` خود بازگشت نمی‌کند. از آن‌جا که :meth:`notify` قفل " +"را آزاد نمی‌کند، فراخواننده‌ی آن باید این کار را انجام دهد." -msgid "Wake up all threads waiting on this condition. This method acts like :meth:`notify`, but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised." +msgid "" +"Wake up all threads waiting on this condition. This method acts like " +":meth:`notify`, but wakes up all waiting threads instead of one. If the " +"calling thread has not acquired the lock when this method is called, a " +":exc:`RuntimeError` is raised." msgstr "" +"همه نخ‌های در انتظار این شرط را بیدار می‌کند. این متد مانند :meth:`notify` " +"عمل می‌کند، اما به جای یک نخ، همه نخ‌های در انتظار را بیدار می‌کند. اگر نخ " +"فراخوان هنگام فراخوانی این متد قفل را به دست نیاورده باشد، یک " +":exc:`RuntimeError` پرتاب می‌شود." msgid "The method ``notifyAll`` is a deprecated alias for this method." -msgstr "" +msgstr "متد ``notifyAll`` یک نام مستعار منسوخ برای این متد است." msgid "Semaphore objects" -msgstr "" +msgstr "اشیای سمافور (Semaphore)" -msgid "This is one of the oldest synchronization primitives in the history of computer science, invented by the early Dutch computer scientist Edsger W. Dijkstra (he used the names ``P()`` and ``V()`` instead of :meth:`~Semaphore.acquire` and :meth:`~Semaphore.release`)." +msgid "" +"This is one of the oldest synchronization primitives in the history of " +"computer science, invented by the early Dutch computer scientist Edsger W. " +"Dijkstra (he used the names ``P()`` and ``V()`` instead of " +":meth:`~Semaphore.acquire` and :meth:`~Semaphore.release`)." msgstr "" +"این یکی از قدیمی‌ترین سازوکارهای اولیه‌ی همگام‌سازی در تاریخ علوم کامپیوتر " +"است که توسط Edsger W. Dijkstra، دانشمند پیشگام هلندی در علوم کامپیوتر، ابداع" +" شد (او به‌جای :meth:`~Semaphore.acquire` و :meth:`~Semaphore.release` از " +"نام‌های ``P()`` و ``V()`` استفاده می‌کرد)." -msgid "A semaphore manages an internal counter which is decremented by each :meth:`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` call. The counter can never go below zero; when :meth:`~Semaphore.acquire` finds that it is zero, it blocks, waiting until some other thread calls :meth:`~Semaphore.release`." -msgstr "" +msgid "" +"A semaphore manages an internal counter which is decremented by each " +":meth:`~Semaphore.acquire` call and incremented by each " +":meth:`~Semaphore.release` call. The counter can never go below zero; when " +":meth:`~Semaphore.acquire` finds that it is zero, it blocks, waiting until " +"some other thread calls :meth:`~Semaphore.release`." +msgstr "" +"سمافور یک شمارنده داخلی را مدیریت می‌کند که با هر فراخوانی " +":meth:`~Semaphore.acquire` کاهش می‌یابد و با هر فراخوانی " +":meth:`~Semaphore.release` افزایش می‌یابد. شمارنده هرگز نمی‌تواند به زیر صفر" +" برسد؛ هرگاه :meth:`~Semaphore.acquire` مقدار آن را صفر بیابد، مسدود می‌شود " +"و منتظر می‌ماند تا نخ دیگری :meth:`~Semaphore.release` را فراخوانی کند." -msgid "Semaphores also support the :ref:`context management protocol `." +msgid "" +"Semaphores also support the :ref:`context management protocol `." msgstr "" +"سمافورها همچنین از :ref:`پروتکل مدیریت زمینه ` پشتیبانی می‌کنند." -msgid "This class implements semaphore objects. A semaphore manages an atomic counter representing the number of :meth:`release` calls minus the number of :meth:`acquire` calls, plus an initial value. The :meth:`acquire` method blocks if necessary until it can return without making the counter negative. If not given, *value* defaults to 1." -msgstr "" +msgid "" +"This class implements semaphore objects. A semaphore manages an atomic " +"counter representing the number of :meth:`release` calls minus the number of" +" :meth:`acquire` calls, plus an initial value. The :meth:`acquire` method " +"blocks if necessary until it can return without making the counter negative." +" If not given, *value* defaults to 1." +msgstr "" +"این کلاس اشیای سمافور (semaphore) را پیاده‌سازی می‌کند. یک سمافور یک شمارنده" +" اتمی را مدیریت می‌کند که بیانگر تعداد فراخوانی‌های :meth:`release` منهای " +"تعداد فراخوانی‌های :meth:`acquire`، به‌علاوه یک مقدار اولیه است. متد " +":meth:`acquire` در صورت لزوم مسدود می‌شود تا بتواند بدون منفی کردن شمارنده " +"بازگشت کند. اگر داده نشود، *value* به‌طور پیش‌فرض ۱ است." -msgid "The optional argument gives the initial *value* for the internal counter; it defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is raised." +msgid "" +"The optional argument gives the initial *value* for the internal counter; it" +" defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` " +"is raised." msgstr "" +"آرگومان اختیاری، *مقدار* اولیه برای شمارنده داخلی را مشخص می‌کند؛ پیش‌فرض آن" +" ``1`` است. اگر *مقدار* داده‌شده کمتر از ۰ باشد، :exc:`ValueError` پرتاب " +"می‌شود." msgid "Acquire a semaphore." -msgstr "" +msgstr "یک سمافور را کسب می‌کند." msgid "When invoked without arguments:" -msgstr "" +msgstr "هنگام فراخوانی بدون آرگومان:" -msgid "If the internal counter is larger than zero on entry, decrement it by one and return ``True`` immediately." +msgid "" +"If the internal counter is larger than zero on entry, decrement it by one " +"and return ``True`` immediately." msgstr "" +"اگر شمارنده‌ی داخلی در هنگام ورود بزرگ‌تر از صفر باشد، آن را یک واحد کاهش " +"دهید و بلافاصله ``True`` را برگردانید." -msgid "If the internal counter is zero on entry, block until awoken by a call to :meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), decrement the counter by 1 and return ``True``. Exactly one thread will be awoken by each call to :meth:`~Semaphore.release`. The order in which threads are awoken should not be relied on." -msgstr "" +msgid "" +"If the internal counter is zero on entry, block until awoken by a call to " +":meth:`~Semaphore.release`. Once awoken (and the counter is greater than " +"0), decrement the counter by 1 and return ``True``. Exactly one thread will" +" be awoken by each call to :meth:`~Semaphore.release`. The order in which " +"threads are awoken should not be relied on." +msgstr "" +"اگر شمارنده‌ی داخلی در زمان ورود صفر باشد، تا زمانی که با فراخوانی " +":meth:`~Semaphore.release` بیدار شود، مسدود می‌شود. پس از بیدار شدن (و زمانی" +" که شمارنده بزرگ‌تر از ۰ باشد)، شمارنده را یک واحد کاهش می‌دهد و ``True`` را" +" برمی‌گرداند. با هر فراخوانی :meth:`~Semaphore.release`، دقیقاً یک نخ بیدار " +"خواهد شد. نباید به ترتیبی که نخ‌ها بیدار می‌شوند، اتکا کرد." -msgid "When invoked with *blocking* set to ``False``, do not block. If a call without an argument would block, return ``False`` immediately; otherwise, do the same thing as when called without arguments, and return ``True``." +msgid "" +"When invoked with *blocking* set to ``False``, do not block. If a call " +"without an argument would block, return ``False`` immediately; otherwise, do" +" the same thing as when called without arguments, and return ``True``." msgstr "" +"هنگامی که با *blocking* تنظیم‌شده روی ``False`` فراخوانی شود، مسدود نمی‌شود." +" اگر یک فراخوانی بدون آرگومان قرار باشد مسدود شود، بلافاصله ``False`` را " +"برمی‌گرداند؛ در غیر این صورت، همان کاری را انجام می‌دهد که هنگام فراخوانی " +"بدون آرگومان‌ها انجام می‌شود، و ``True`` را برمی‌گرداند." -msgid "When invoked with a *timeout* other than ``None``, it will block for at most *timeout* seconds. If acquire does not complete successfully in that interval, return ``False``. Return ``True`` otherwise." +msgid "" +"When invoked with a *timeout* other than ``None``, it will block for at most" +" *timeout* seconds. If acquire does not complete successfully in that " +"interval, return ``False``. Return ``True`` otherwise." msgstr "" +"هنگامی که با *timeout* غیر از ``None`` فراخوانی شود، حداکثر به مدت *timeout*" +" ثانیه مسدود می‌شود. اگر acquire در این بازه با موفقیت به پایان نرسد، " +"``False`` را برمی‌گرداند. در غیر این صورت، ``True`` را برمی‌گرداند." -msgid "Release a semaphore, incrementing the internal counter by *n*. When it was zero on entry and other threads are waiting for it to become larger than zero again, wake up *n* of those threads." +msgid "" +"Release a semaphore, incrementing the internal counter by *n*. When it was " +"zero on entry and other threads are waiting for it to become larger than " +"zero again, wake up *n* of those threads." msgstr "" +"یک سمافور (semaphore) را آزاد می‌کند و شمارنده داخلی را به اندازه *n* افزایش" +" می‌دهد. اگر در زمان ورود ۰ بوده باشد و نخ‌های دیگری در انتظار باشند تا " +"دوباره بزرگ‌تر از ۰ شود، *n* نخ از آن نخ‌ها را بیدار می‌کند." msgid "Added the *n* parameter to release multiple waiting threads at once." -msgstr "" +msgstr "پارامتر *n* اضافه شد تا چندین نخ در انتظار به‌صورت همزمان آزاد شوند." -msgid "Class implementing bounded semaphore objects. A bounded semaphore checks to make sure its current value doesn't exceed its initial value. If it does, :exc:`ValueError` is raised. In most situations semaphores are used to guard resources with limited capacity. If the semaphore is released too many times it's a sign of a bug. If not given, *value* defaults to 1." -msgstr "" +msgid "" +"Class implementing bounded semaphore objects. A bounded semaphore checks to" +" make sure its current value doesn't exceed its initial value. If it does, " +":exc:`ValueError` is raised. In most situations semaphores are used to guard" +" resources with limited capacity. If the semaphore is released too many " +"times it's a sign of a bug. If not given, *value* defaults to 1." +msgstr "" +"کلاسی که اشیای سمافور محدود (bounded semaphore) را پیاده‌سازی می‌کند. سمافور" +" محدود بررسی می‌کند که مقدار فعلی‌اش از مقدار اولیه‌اش بیشتر نشود. در این " +"صورت، :exc:`ValueError` پرتاب می‌شود. در بیشتر موارد، از سمافورها برای " +"محافظت از منابع با ظرفیت محدود استفاده می‌شود. اگر سمافور بیش از حد آزاد " +"شود، نشانه‌ای از یک اشکال است. اگر داده نشود، *value* به‌طور پیش‌فرض ۱ است." msgid ":class:`Semaphore` example" -msgstr "" +msgstr "مثال :class:`Semaphore`" -msgid "Semaphores are often used to guard resources with limited capacity, for example, a database server. In any situation where the size of the resource is fixed, you should use a bounded semaphore. Before spawning any worker threads, your main thread would initialize the semaphore::" +msgid "" +"Semaphores are often used to guard resources with limited capacity, for " +"example, a database server. In any situation where the size of the resource" +" is fixed, you should use a bounded semaphore. Before spawning any worker " +"threads, your main thread would initialize the semaphore::" msgstr "" +"از سمافورها اغلب برای محافظت از منابعی با ظرفیت محدود استفاده می‌شود، برای " +"مثال، یک سرور پایگاه‌داده. در هر وضعیتی که اندازه‌ی منبع ثابت است، باید از " +"سمافور محدود (bounded semaphore) استفاده کنید. پیش از ایجاد هر نخ کارگری، نخ" +" اصلی شما سمافور را مقداردهی اولیه می‌کند::" msgid "" "maxconnections = 5\n" "# ...\n" "pool_sema = BoundedSemaphore(value=maxconnections)" msgstr "" +"maxconnections = 5\n" +"# ...\n" +"pool_sema = BoundedSemaphore(value=maxconnections)" -msgid "Once spawned, worker threads call the semaphore's acquire and release methods when they need to connect to the server::" +msgid "" +"Once spawned, worker threads call the semaphore's acquire and release " +"methods when they need to connect to the server::" msgstr "" +"پس از ایجاد، نخ‌های کارگر هنگامی که نیاز به اتصال به سرور دارند، متدهای " +"acquire و release سمافور را فراخوانی می‌کنند::" msgid "" "with pool_sema:\n" @@ -854,51 +2003,126 @@ msgid "" " finally:\n" " conn.close()" msgstr "" +"with pool_sema:\n" +" conn = connectdb()\n" +" try:\n" +" # ... use connection ...\n" +" finally:\n" +" conn.close()" -msgid "The use of a bounded semaphore reduces the chance that a programming error which causes the semaphore to be released more than it's acquired will go undetected." +msgid "" +"The use of a bounded semaphore reduces the chance that a programming error " +"which causes the semaphore to be released more than it's acquired will go " +"undetected." msgstr "" +"استفاده از یک سمافور محدود (bounded semaphore) احتمال بدون تشخیص ماندن یک " +"خطای برنامه‌نویسی را، که باعث می‌شود سمافور بیش از تعداد دفعات کسب‌شده آزاد " +"شود، کاهش می‌دهد." msgid "Event objects" -msgstr "" +msgstr "اشیای رویداد" -msgid "This is one of the simplest mechanisms for communication between threads: one thread signals an event and other threads wait for it." +msgid "" +"This is one of the simplest mechanisms for communication between threads: " +"one thread signals an event and other threads wait for it." msgstr "" +"این یکی از ساده‌ترین سازوکارها برای ارتباط میان نخ‌ها است: یک نخ رویدادی را " +"سیگنال می‌کند و نخ‌های دیگر منتظر آن می‌مانند." -msgid "An event object manages an internal flag that can be set to true with the :meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` method. The :meth:`~Event.wait` method blocks until the flag is true." +msgid "" +"An event object manages an internal flag that can be set to true with the " +":meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " +"method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" +"یک شیء رویداد، یک پرچم داخلی را مدیریت می‌کند که می‌توان آن را با متد " +":meth:`~Event.set` روی true تنظیم کرد و با متد :meth:`~Event.clear` به false" +" بازنشانی کرد. متد :meth:`~Event.wait` تا زمانی که پرچم true شود، مسدود " +"می‌شود." -msgid "Class implementing event objects. An event manages a flag that can be set to true with the :meth:`~Event.set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method blocks until the flag is true. The flag is initially false." +msgid "" +"Class implementing event objects. An event manages a flag that can be set " +"to true with the :meth:`~Event.set` method and reset to false with the " +":meth:`clear` method. The :meth:`wait` method blocks until the flag is " +"true. The flag is initially false." msgstr "" +"کلاسی که اشیای رویداد را پیاده‌سازی می‌کند. یک رویداد پرچمی را مدیریت می‌کند" +" که می‌توان آن را با متد :meth:`~Event.set` روی درست تنظیم کرد و با متد " +":meth:`clear` به نادرست بازنشانی کرد. متد :meth:`wait` تا زمانی که پرچم درست" +" شود، مسدود می‌شود. پرچم در ابتدا نادرست است." msgid "Return ``True`` if and only if the internal flag is true." -msgstr "" +msgstr "فقط و فقط در صورتی ``True`` را برمی‌گرداند که پرچم داخلی true باشد." msgid "The method ``isSet`` is a deprecated alias for this method." -msgstr "" +msgstr "متد ``isSet`` یک نام مستعار منسوخ برای این متد است." -msgid "Set the internal flag to true. All threads waiting for it to become true are awakened. Threads that call :meth:`wait` once the flag is true will not block at all." +msgid "" +"Set the internal flag to true. All threads waiting for it to become true are" +" awakened. Threads that call :meth:`wait` once the flag is true will not " +"block at all." msgstr "" +"پرچم داخلی را روی true قرار دهید. همه نخ‌هایی که منتظر true شدن آن هستند، " +"بیدار می‌شوند. نخ‌هایی که پس از true بودن پرچم، :meth:`wait` را فراخوانی " +"کنند، به‌هیچ‌وجه مسدود نخواهند شد." -msgid "Reset the internal flag to false. Subsequently, threads calling :meth:`wait` will block until :meth:`.set` is called to set the internal flag to true again." +msgid "" +"Reset the internal flag to false. Subsequently, threads calling :meth:`wait`" +" will block until :meth:`.set` is called to set the internal flag to true " +"again." msgstr "" +"پرچم داخلی را روی false بازنشانی می‌کند. پس از آن، نخ‌هایی که :meth:`wait` " +"را فراخوانی می‌کنند، مسدود می‌شوند تا زمانی که :meth:`.set` فراخوانی شود و " +"پرچم داخلی دوباره روی true تنظیم شود." -msgid "Block as long as the internal flag is false and the timeout, if given, has not expired. The return value represents the reason that this blocking method returned; ``True`` if returning because the internal flag is set to true, or ``False`` if a timeout is given and the internal flag did not become true within the given wait time." -msgstr "" +msgid "" +"Block as long as the internal flag is false and the timeout, if given, has " +"not expired. The return value represents the reason that this blocking " +"method returned; ``True`` if returning because the internal flag is set to " +"true, or ``False`` if a timeout is given and the internal flag did not " +"become true within the given wait time." +msgstr "" +"تا زمانی که پرچم داخلی نادرست است و مهلت، در صورت تعیین شدن، منقضی نشده " +"باشد، مسدود می‌کند. مقدار بازگشتی، دلیل بازگشت این متد مسدودکننده را نشان " +"می‌دهد؛ ``True`` اگر بازگشت به این دلیل باشد که پرچم داخلی روی درست تنظیم " +"شده است، یا ``False`` اگر مهلتی تعیین شده باشد و پرچم داخلی در مهلت زمانی " +"تعیین‌شده درست نشده باشد." -msgid "When the timeout argument is present and not ``None``, it should be a floating-point number specifying a timeout for the operation in seconds, or fractions thereof." +msgid "" +"When the timeout argument is present and not ``None``, it should be a " +"floating-point number specifying a timeout for the operation in seconds, or " +"fractions thereof." msgstr "" +"هنگامی که آرگومان timeout وجود دارد و ``None`` نیست، باید یک عدد اعشاری باشد" +" که مهلت زمانی عملیات را بر حسب ثانیه یا کسری از ثانیه مشخص می‌کند." msgid "Timer objects" -msgstr "" +msgstr "اشیای Timer" -msgid "This class represents an action that should be run only after a certain amount of time has passed --- a timer. :class:`Timer` is a subclass of :class:`Thread` and as such also functions as an example of creating custom threads." +msgid "" +"This class represents an action that should be run only after a certain " +"amount of time has passed --- a timer. :class:`Timer` is a subclass of " +":class:`Thread` and as such also functions as an example of creating custom " +"threads." msgstr "" +"این کلاس نشان‌دهنده‌ی عملیاتی است که باید تنها پس از گذشت مدت زمان معینی اجرا" +" شود — یک زمان‌سنج. :class:`Timer` یک زیرکلاس از :class:`Thread` است و از " +"این رو، به‌عنوان نمونه‌ای از ایجاد نخ‌های سفارشی نیز عمل می‌کند." -msgid "Timers are started, as with threads, by calling their :meth:`Timer.start ` method. The timer can be stopped (before its action has begun) by calling the :meth:`~Timer.cancel` method. The interval the timer will wait before executing its action may not be exactly the same as the interval specified by the user." -msgstr "" +msgid "" +"Timers are started, as with threads, by calling their :meth:`Timer.start " +"` method. The timer can be stopped (before its action has " +"begun) by calling the :meth:`~Timer.cancel` method. The interval the timer " +"will wait before executing its action may not be exactly the same as the " +"interval specified by the user." +msgstr "" +"زمان‌سنج‌ها، مانند نخ‌ها، با فراخوانی متد :meth:`Timer.start `" +" خود آغاز می‌شوند. می‌توان زمان‌سنج را (پیش از آغاز عملش) با فراخوانی متد " +":meth:`~Timer.cancel` متوقف کرد. ممکن است بازه زمانی که زمان‌سنج پیش از " +"اجرای عمل خود منتظر می‌ماند، دقیقاً برابر با بازه زمانی که کاربر مشخص کرده " +"است نباشد." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "def hello():\n" @@ -907,24 +2131,58 @@ msgid "" "t = Timer(30.0, hello)\n" "t.start() # after 30 seconds, \"hello, world\" will be printed" msgstr "" +"def hello():\n" +" print(\"hello, world\")\n" +"\n" +"t = Timer(30.0, hello)\n" +"t.start() # پس از ۳۰ ثانیه، \"hello, world\" چاپ خواهد شد" -msgid "Create a timer that will run *function* with arguments *args* and keyword arguments *kwargs*, after *interval* seconds have passed. If *args* is ``None`` (the default) then an empty list will be used. If *kwargs* is ``None`` (the default) then an empty dict will be used." +msgid "" +"Create a timer that will run *function* with arguments *args* and keyword " +"arguments *kwargs*, after *interval* seconds have passed. If *args* is " +"``None`` (the default) then an empty list will be used. If *kwargs* is " +"``None`` (the default) then an empty dict will be used." msgstr "" +"یک زمان‌سنج ایجاد کنید که *function* را با آرگومان‌های *args* و آرگومان‌های " +"کلیدواژه‌ای *kwargs*، پس از گذشت *interval* ثانیه اجرا خواهد کرد. اگر *args*" +" برابر ``None`` باشد (پیش‌فرض)، از یک فهرست خالی استفاده خواهد شد. اگر " +"*kwargs* برابر ``None`` باشد (پیش‌فرض)، از یک دیکشنری خالی استفاده خواهد شد." -msgid "Stop the timer, and cancel the execution of the timer's action. This will only work if the timer is still in its waiting stage." +msgid "" +"Stop the timer, and cancel the execution of the timer's action. This will " +"only work if the timer is still in its waiting stage." msgstr "" +"تایمر را متوقف کنید و اجرای عمل تایمر را لغو کنید. این کار تنها زمانی کار " +"می‌کند که تایمر هنوز در مرحله‌ی انتظار باشد." msgid "Barrier objects" -msgstr "" +msgstr "اشیای سد (Barrier)" -msgid "This class provides a simple synchronization primitive for use by a fixed number of threads that need to wait for each other. Each of the threads tries to pass the barrier by calling the :meth:`~Barrier.wait` method and will block until all of the threads have made their :meth:`~Barrier.wait` calls. At this point, the threads are released simultaneously." -msgstr "" +msgid "" +"This class provides a simple synchronization primitive for use by a fixed " +"number of threads that need to wait for each other. Each of the threads " +"tries to pass the barrier by calling the :meth:`~Barrier.wait` method and " +"will block until all of the threads have made their :meth:`~Barrier.wait` " +"calls. At this point, the threads are released simultaneously." +msgstr "" +"این کلاس یک سازوکار همگام‌سازی ساده برای استفاده‌ی تعداد ثابتی از نخ‌ها " +"فراهم می‌کند که نیاز دارند منتظر یکدیگر بمانند. هر یک از نخ‌ها تلاش می‌کند " +"با فراخوانی متد :meth:`~Barrier.wait` از سد عبور کند و تا زمانی که همه‌ی " +"نخ‌ها فراخوانی‌های :meth:`~Barrier.wait` خود را انجام ندهند، مسدود می‌شود. " +"در این نقطه، نخ‌ها به‌طور همزمان آزاد می‌شوند." -msgid "The barrier can be reused any number of times for the same number of threads." +msgid "" +"The barrier can be reused any number of times for the same number of " +"threads." msgstr "" +"می‌توان از این سد برای همان تعداد نخ، به هر تعداد بار دوباره استفاده کرد." -msgid "As an example, here is a simple way to synchronize a client and server thread::" +msgid "" +"As an example, here is a simple way to synchronize a client and server " +"thread::" msgstr "" +"به‌عنوان مثال، در اینجا یک روش ساده برای همگام‌سازی نخ کارخواه و کارساز آمده" +" است::" msgid "" "b = Barrier(2, timeout=5)\n" @@ -942,15 +2200,51 @@ msgid "" " connection = make_connection()\n" " process_client_connection(connection)" msgstr "" +"b = Barrier(2, timeout=5)\n" +"\n" +"def server():\n" +" start_server()\n" +" b.wait()\n" +" while True:\n" +" connection = accept_connection()\n" +" process_server_connection(connection)\n" +"\n" +"def client():\n" +" b.wait()\n" +" while True:\n" +" connection = make_connection()\n" +" process_client_connection(connection)" -msgid "Create a barrier object for *parties* number of threads. An *action*, when provided, is a callable to be called by one of the threads when they are released. *timeout* is the default timeout value if none is specified for the :meth:`wait` method." +msgid "" +"Create a barrier object for *parties* number of threads. An *action*, when " +"provided, is a callable to be called by one of the threads when they are " +"released. *timeout* is the default timeout value if none is specified for " +"the :meth:`wait` method." msgstr "" +"یک شیء سد (barrier) برای تعداد *parties* نخ ایجاد کنید. اگر *action* " +"ارائه شود، یک شیء قابل فراخوانی است که هنگامی که نخ‌ها آزاد می‌شوند، توسط " +"یکی از آن‌ها فراخوانی می‌شود. *timeout* مقدار پیش‌فرض مهلت است، اگر هیچ " +"مقداری برای متد :meth:`wait` مشخص نشده باشد." -msgid "Pass the barrier. When all the threads party to the barrier have called this function, they are all released simultaneously. If a *timeout* is provided, it is used in preference to any that was supplied to the class constructor." +msgid "" +"Pass the barrier. When all the threads party to the barrier have called " +"this function, they are all released simultaneously. If a *timeout* is " +"provided, it is used in preference to any that was supplied to the class " +"constructor." msgstr "" +"از سد عبور می‌کند. هنگامی که همه نخ‌های شرکت‌کننده در سد این تابع را " +"فراخوانی کرده باشند، همه آن‌ها همزمان آزاد می‌شوند. اگر *timeout* ارائه شده" +" باشد، از این مقدار به جای هر مقداری که به سازنده دیتاکلاس شده باشد استفاده" +" می‌شود." -msgid "The return value is an integer in the range 0 to *parties* -- 1, different for each thread. This can be used to select a thread to do some special housekeeping, e.g.::" +msgid "" +"The return value is an integer in the range 0 to *parties* -- 1, different " +"for each thread. This can be used to select a thread to do some special " +"housekeeping, e.g.::" msgstr "" +"مقدار بازگشتی یک عدد صحیح در بازه‌ی ۰ تا *parties* -- ۱ است و برای هر نخ " +"متفاوت است. می‌توان از این مقدار برای انتخاب یک نخ جهت انجام برخی کارهای " +"نظافتی خاص استفاده کرد، مثلاً::" msgid "" "i = barrier.wait()\n" @@ -958,53 +2252,106 @@ msgid "" " # Only one thread needs to print this\n" " print(\"passed the barrier\")" msgstr "" +"i = barrier.wait()\n" +"if i == 0:\n" +" # Only one thread needs to print this\n" +" print(\"passed the barrier\")" -msgid "If an *action* was provided to the constructor, one of the threads will have called it prior to being released. Should this call raise an error, the barrier is put into the broken state." +msgid "" +"If an *action* was provided to the constructor, one of the threads will have" +" called it prior to being released. Should this call raise an error, the " +"barrier is put into the broken state." msgstr "" +"اگر *action* به سازنده ارائه شده باشد، یکی از نخ‌ها آن را پیش از آزاد شدن " +"فراخوانی خواهد کرد. چنانچه این فراخوانی خطایی را پرتاب کند، سد (barrier) در " +"وضعیت شکسته قرار می‌گیرد." msgid "If the call times out, the barrier is put into the broken state." -msgstr "" +msgstr "اگر مهلت فراخوانی به پایان برسد، سد در حالت شکسته قرار می‌گیرد." -msgid "This method may raise a :class:`BrokenBarrierError` exception if the barrier is broken or reset while a thread is waiting." +msgid "" +"This method may raise a :class:`BrokenBarrierError` exception if the barrier" +" is broken or reset while a thread is waiting." msgstr "" +"این متد ممکن است در صورتی که سد (barrier) در حین انتظار یک نخ شکسته یا " +"بازنشانی شود، استثنای :class:`BrokenBarrierError` را پرتاب کند." -msgid "Return the barrier to the default, empty state. Any threads waiting on it will receive the :class:`BrokenBarrierError` exception." +msgid "" +"Return the barrier to the default, empty state. Any threads waiting on it " +"will receive the :class:`BrokenBarrierError` exception." msgstr "" +"سد (barrier) را به وضعیت پیش‌فرض و خالی بازمی‌گرداند. هر نخی که در انتظار آن" +" باشد، استثنای :class:`BrokenBarrierError` را دریافت خواهد کرد." -msgid "Note that using this function may require some external synchronization if there are other threads whose state is unknown. If a barrier is broken it may be better to just leave it and create a new one." +msgid "" +"Note that using this function may require some external synchronization if " +"there are other threads whose state is unknown. If a barrier is broken it " +"may be better to just leave it and create a new one." msgstr "" +"توجه داشته باشید که استفاده از این تابع ممکن است در صورت وجود نخ‌های دیگری " +"که وضعیت آن‌ها نامشخص است، به کمی همگام‌سازی خارجی نیاز داشته باشد. اگر یک " +"سد (barrier) شکسته شود، ممکن است بهتر باشد صرفاً آن را رها کنید و یک سد " +"جدید ایجاد کنید." -msgid "Put the barrier into a broken state. This causes any active or future calls to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for example if one of the threads needs to abort, to avoid deadlocking the application." +msgid "" +"Put the barrier into a broken state. This causes any active or future calls" +" to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for" +" example if one of the threads needs to abort, to avoid deadlocking the " +"application." msgstr "" +"سد را در وضعیت شکسته قرار دهید. این کار باعث می‌شود هر فراخوانی فعال یا " +"آینده‌ی :meth:`wait` با :class:`BrokenBarrierError` شکست بخورد. برای مثال، " +"اگر یکی از نخ‌ها نیاز به لغو شدن دارد، از این کار استفاده کنید تا از بن‌بست " +"برنامه جلوگیری شود." -msgid "It may be preferable to simply create the barrier with a sensible *timeout* value to automatically guard against one of the threads going awry." +msgid "" +"It may be preferable to simply create the barrier with a sensible *timeout* " +"value to automatically guard against one of the threads going awry." msgstr "" +"ممکن است بهتر باشد صرفاً یک سد (barrier) با مقدار معقول *timeout* ایجاد " +"کنید تا به‌طور خودکار در برابر از مسیر خارج شدن یکی از نخ‌ها محافظت شود." msgid "The number of threads required to pass the barrier." -msgstr "" +msgstr "تعداد نخ‌های لازم برای عبور از سد." msgid "The number of threads currently waiting in the barrier." -msgstr "" +msgstr "تعداد نخ‌هایی که در حال حاضر در سد منتظر هستند." msgid "A boolean that is ``True`` if the barrier is in the broken state." -msgstr "" +msgstr "یک بولی که اگر سد در وضعیت شکسته باشد، ``True`` است." -msgid "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:`Barrier` object is reset or broken." +msgid "" +"This exception, a subclass of :exc:`RuntimeError`, is raised when the " +":class:`Barrier` object is reset or broken." msgstr "" +"این استثنا، که زیرکلاسی از :exc:`RuntimeError` است، زمانی پرتاب می‌شود که " +"شیء :class:`Barrier` بازنشانی یا شکسته شود." -msgid "Using locks, conditions, and semaphores in the :keyword:`!with` statement" -msgstr "" +msgid "" +"Using locks, conditions, and semaphores in the :keyword:`!with` statement" +msgstr "استفاده از قفل‌ها، شرایط و سمافورها در دستور :keyword:`!with`" -msgid "All of the objects provided by this module that have ``acquire`` and ``release`` methods can be used as context managers for a :keyword:`with` statement. The ``acquire`` method will be called when the block is entered, and ``release`` will be called when the block is exited. Hence, the following snippet::" +msgid "" +"All of the objects provided by this module that have ``acquire`` and " +"``release`` methods can be used as context managers for a :keyword:`with` " +"statement. The ``acquire`` method will be called when the block is entered," +" and ``release`` will be called when the block is exited. Hence, the " +"following snippet::" msgstr "" +"همه‌ی اشیاء ارائه‌شده توسط این ماژول که متدهای ``acquire`` و ``release`` " +"دارند، می‌توانند به‌عنوان مدیر زمینه برای دستور :keyword:`with` استفاده " +"شوند. متد ``acquire`` هنگام ورود به بلوک فراخوانی می‌شود و ``release`` هنگام" +" خروج از بلوک فراخوانی خواهد شد. بنابراین، قطعه‌کد زیر::" msgid "" "with some_lock:\n" " # do something..." msgstr "" +"with some_lock:\n" +" # do something..." msgid "is equivalent to::" -msgstr "" +msgstr "معادل است با::" msgid "" "some_lock.acquire()\n" @@ -1013,15 +2360,26 @@ msgid "" "finally:\n" " some_lock.release()" msgstr "" +"some_lock.acquire()\n" +"try:\n" +" # do something...\n" +"finally:\n" +" some_lock.release()" -msgid "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:`with` statement context managers." +msgid "" +"Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, " +":class:`Semaphore`, and :class:`BoundedSemaphore` objects may be used as " +":keyword:`with` statement context managers." msgstr "" +"در حال حاضر، می‌توان از اشیای :class:`Lock`، :class:`RLock`، " +":class:`Condition`، :class:`Semaphore` و :class:`BoundedSemaphore` به‌عنوان " +"مدیران زمینه‌ی دستور :keyword:`with` استفاده کرد." msgid "trace function" -msgstr "" +msgstr "تابع ردگیری" msgid "debugger" -msgstr "" +msgstr "اشکال‌زدا" msgid "profile function" -msgstr "" +msgstr "تابع پروفایل‌گیری" diff --git a/library/threadsafety.po b/library/threadsafety.po index 2845cca95..bff564972 100644 --- a/library/threadsafety.po +++ b/library/threadsafety.po @@ -20,135 +20,315 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" msgid "Thread Safety Guarantees" -msgstr "" +msgstr "تضمین‌های ایمنی نخ" -msgid "This page documents thread-safety guarantees for built-in types in Python's free-threaded build. The guarantees described here apply when using Python with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, most operations are implicitly serialized." +msgid "" +"This page documents thread-safety guarantees for built-in types in Python's " +"free-threaded build. The guarantees described here apply when using Python " +"with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled," +" most operations are implicitly serialized." msgstr "" +"این صفحه تضمین‌های ایمنی نخی برای انواع توکار در ساخت آزادنخی (free-" +"threaded) پایتون را مستند می‌کند. تضمین‌های توصیف‌شده در اینجا زمانی اعمال " +"می‌شوند که از پایتون با :term:`GIL` غیرفعال (حالت آزادنخی) استفاده می‌کنید." +" هنگامی که GIL فعال باشد، بیشتر عملیات‌ها به‌طور ضمنی به‌صورت سریالی اجرا " +"می‌شوند." -msgid "For general guidance on writing thread-safe code in free-threaded Python, see :ref:`freethreading-python-howto`." +msgid "" +"For general guidance on writing thread-safe code in free-threaded Python, " +"see :ref:`freethreading-python-howto`." msgstr "" +"برای راهنمایی کلی درباره نوشتن کد ایمن در برابر نخ‌ها (thread-safe) در " +"پایتون آزادنخ ، به :ref:`freethreading-python-howto` مراجعه " +"کنید." msgid "Thread safety levels" -msgstr "" +msgstr "سطوح ایمنی نخ" -msgid "The C API documentation uses the following levels to describe the thread safety guarantees of each function. The levels are listed from least to most safe." +msgid "" +"The C API documentation uses the following levels to describe the thread " +"safety guarantees of each function. The levels are listed from least to most" +" safe." msgstr "" +"مستندات C API از سطوح زیر برای توصیف تضمین‌های ایمنی نخی هر تابع استفاده " +"می‌کند. این سطوح از کم‌ایمن‌ترین تا ایمن‌ترین فهرست شده‌اند." msgid "Incompatible" -msgstr "" +msgstr "ناسازگار" -msgid "A function or operation that cannot be made safe for concurrent use even with external synchronization. Incompatible code typically accesses global state in an unsynchronized way and must only be called from a single thread throughout the program's lifetime." +msgid "" +"A function or operation that cannot be made safe for concurrent use even " +"with external synchronization. Incompatible code typically accesses global " +"state in an unsynchronized way and must only be called from a single thread " +"throughout the program's lifetime." msgstr "" +"تابع یا عملیاتی که حتی با همگام‌سازی خارجی نیز نمی‌توان آن را برای استفاده " +"همزمان ایمن کرد. کد ناسازگار معمولاً به وضعیت سراسری به‌صورت همگام‌نشده " +"دسترسی پیدا می‌کند و باید در طول عمر برنامه تنها از یک نخ فراخوانی شود." -msgid "Example: a function that modifies process-wide state such as signal handlers or environment variables, where concurrent calls from any threads, even with external locking, can conflict with the runtime or other libraries." +msgid "" +"Example: a function that modifies process-wide state such as signal handlers" +" or environment variables, where concurrent calls from any threads, even " +"with external locking, can conflict with the runtime or other libraries." msgstr "" +"مثال: تابعی که وضعیت سراسریِ فرایند را تغییر می‌دهد، مانند هندلرهای " +"سیگنال یا متغیرهای محیطی، که در آن فراخوانی‌های همزمان از هر نخی، حتی با " +"قفل‌گذاری خارجی، می‌توانند با ران‌تایم یا کتابخانه‌های دیگر تداخل داشته " +"باشند." msgid "Compatible" -msgstr "" +msgstr "سازگار" -msgid "A function or operation that is safe to call from multiple threads *provided* the caller supplies appropriate external synchronization, for example by holding a :term:`lock` for the duration of each call. Without such synchronization, concurrent calls may produce :term:`race conditions ` or :term:`data races `." -msgstr "" +msgid "" +"A function or operation that is safe to call from multiple threads " +"*provided* the caller supplies appropriate external synchronization, for " +"example by holding a :term:`lock` for the duration of each call. Without " +"such synchronization, concurrent calls may produce :term:`race conditions " +"` or :term:`data races `." +msgstr "" +"تابع یا عملیاتی که فراخوانی آن از چندین نخ ایمن است، *مشروط بر اینکه* " +"فراخواننده همگام‌سازی خارجی مناسبی را فراهم کند، برای مثال با نگه‌داشتن یک " +":term:`قفل ` در طول مدت هر فراخوانی. بدون چنین همگام‌سازی‌ای، " +"فراخوانی‌های همزمان ممکن است باعث ایجاد :term:`شرایط رقابتی ` یا :term:`رقابت‌های داده‌ای ` شوند." -msgid "Example: a function that reads from or writes to an object whose internal state is not protected by a lock. Callers must ensure that no two threads access the same object at the same time." +msgid "" +"Example: a function that reads from or writes to an object whose internal " +"state is not protected by a lock. Callers must ensure that no two threads " +"access the same object at the same time." msgstr "" +"مثال: تابعی که از یک شیء می‌خواند یا در آن می‌نویسد، و وضعیت داخلی آن شیء با" +" یک قفل محافظت نمی‌شود. فراخوانی‌کنندگان باید اطمینان حاصل کنند که هیچ دو " +"نخی به‌طور همزمان به همان شیء دسترسی نداشته باشند." msgid "Safe on distinct objects" -msgstr "" +msgstr "ایمن برای اشیاء متمایز" -msgid "A function or operation that is safe to call from multiple threads without external synchronization, as long as each thread operates on a **different** object. Two threads may call the function at the same time, but they must not pass the same object (or objects that share underlying state) as arguments." +msgid "" +"A function or operation that is safe to call from multiple threads without " +"external synchronization, as long as each thread operates on a **different**" +" object. Two threads may call the function at the same time, but they must " +"not pass the same object (or objects that share underlying state) as " +"arguments." msgstr "" +"تابع یا عملیاتی که فراخوانی آن از چند نخ بدون همگام‌سازی خارجی امن است، " +"مشروط بر اینکه هر نخ روی یک شیء **متفاوت** عمل کند. دو نخ می‌توانند تابع را " +"همزمان فراخوانی کنند، اما نباید شیء یکسان (یا اشیایی که وضعیت زیربنایی " +"مشترکی دارند) را به‌عنوان آرگومان ارسال کنند." -msgid "Example: a function that modifies fields of a struct using non-atomic writes. Two threads can each call the function on their own struct instance safely, but concurrent calls on the *same* instance require external synchronization." +msgid "" +"Example: a function that modifies fields of a struct using non-atomic " +"writes. Two threads can each call the function on their own struct instance " +"safely, but concurrent calls on the *same* instance require external " +"synchronization." msgstr "" +"مثال: تابعی که فیلدهای یک ساختار را با استفاده از نوشتن‌های غیراتمی تغییر " +"می‌دهد. دو نخ می‌توانند هر کدام تابع را روی نمونه‌ی ساختار خود به‌صورت ایمن " +"فراخوانی کنند، اما فراخوانی‌های همزمان روی *همان* نمونه به همگام‌سازی خارجی" +" نیاز دارند." msgid "Safe on shared objects" -msgstr "" +msgstr "ایمن روی اشیاء مشترک" -msgid "A function or operation that is safe for concurrent use on the **same** object. The implementation uses internal synchronization (such as :term:`per-object locks ` or :ref:`critical sections `) to protect shared mutable state, so callers do not need to supply their own locking." -msgstr "" +msgid "" +"A function or operation that is safe for concurrent use on the **same** " +"object. The implementation uses internal synchronization (such as " +":term:`per-object locks ` or :ref:`critical sections " +"`) to protect shared mutable state, so callers " +"do not need to supply their own locking." +msgstr "" +"تابع یا عملیاتی که برای استفاده همزمان روی **همان** شیء ایمن است. " +"پیاده‌سازی از همگام‌سازی داخلی (مانند :term:`قفل‌های به‌ازای هر شیء ` یا :ref:`بخش‌های بحرانی `) برای " +"محافظت از وضعیت تغییرپذیر مشترک استفاده می‌کند، بنابراین فراخوان‌کنندگان " +"نیازی به فراهم کردن قفل‌گذاری خودشان ندارند." -msgid "Example: :c:func:`PyList_GetItemRef` can be called from multiple threads on the same :c:type:`PyListObject` - it uses internal synchronization to serialize access." +msgid "" +"Example: :c:func:`PyList_GetItemRef` can be called from multiple threads on " +"the same :c:type:`PyListObject` - it uses internal synchronization to " +"serialize access." msgstr "" +"مثال: می‌توان :c:func:`PyList_GetItemRef` را از چندین نخ روی همان " +":c:type:`PyListObject` فراخوانی کرد - این تابع از همگام‌سازی داخلی برای " +"متوالی‌کردن دسترسی استفاده می‌کند." msgid "Atomic" -msgstr "" +msgstr "اتمی" -msgid "A function or operation that appears :term:`atomic ` with respect to other threads - it executes instantaneously from the perspective of other threads. This is the strongest form of thread safety." +msgid "" +"A function or operation that appears :term:`atomic ` with " +"respect to other threads - it executes instantaneously from the perspective " +"of other threads. This is the strongest form of thread safety." msgstr "" +"تابع یا عملیاتی که نسبت به سایر نخ‌ها به‌صورت :term:`اتمی ` به نظر می‌رسد؛ از دید سایر نخ‌ها به‌صورت آنی اجرا می‌شود. این " +"قوی‌ترین شکل ایمنی نخی است." -msgid "Example: :c:func:`PyMutex_IsLocked` performs an atomic read of the mutex state and can be called from any thread at any time." +msgid "" +"Example: :c:func:`PyMutex_IsLocked` performs an atomic read of the mutex " +"state and can be called from any thread at any time." msgstr "" +"مثال: :c:func:`PyMutex_IsLocked` یک خواندن اتمی از وضعیت قفل متقابل (mutex) " +"انجام می‌دهد و می‌تواند از هر نخی در هر زمانی فراخوانی شود." msgid "Thread safety for list objects" -msgstr "" +msgstr "ایمنی در برابر نخ‌ها برای اشیای فهرست" -msgid "Reading a single element from a :class:`list` is :term:`atomic `:" +msgid "" +"Reading a single element from a :class:`list` is :term:`atomic `:" msgstr "" +"خواندن یک عنصر از یک :class:`list` :term:`اتمی ` است:" msgid "lst[i] # list.__getitem__" -msgstr "" +msgstr "lst[i] # list.__getitem__" -msgid "The following methods traverse the list and use :term:`atomic ` reads of each item to perform their function. That means that they may return results affected by concurrent modifications:" +msgid "" +"The following methods traverse the list and use :term:`atomic ` reads of each item to perform their function. That means that " +"they may return results affected by concurrent modifications:" msgstr "" +"متدهای زیر فهرست را پیمایش می‌کنند و از خواندن‌های :term:`اتمی ` هر آیتم برای انجام وظیفه خود استفاده می‌کنند. این بدان معناست که" +" ممکن است نتایجی برگردانند که تحت تأثیر تغییرات همزمان قرار گرفته‌اند:" msgid "" "item in lst\n" "lst.index(item)\n" "lst.count(item)" msgstr "" +"item in lst\n" +"lst.index(item)\n" +"lst.count(item)" -msgid "All of the above operations avoid acquiring :term:`per-object locks `. They do not block concurrent modifications. Other operations that hold a lock will not block these from observing intermediate states." +msgid "" +"All of the above operations avoid acquiring :term:`per-object locks `. They do not block concurrent modifications. Other operations " +"that hold a lock will not block these from observing intermediate states." msgstr "" +"همه‌ی عملیات‌های بالا از کسب :term:`قفل‌های به‌ازای هر شیء `" +" خودداری می‌کنند. آن‌ها تغییرات همزمان را مسدود نمی‌کنند. سایر عملیات‌هایی " +"که قفلی را در اختیار دارند، این عملیات‌ها را از مشاهده‌ی وضعیت‌های میانی باز " +"نمی‌دارند." -msgid "All other operations from here on block using the :term:`per-object lock`." +msgid "" +"All other operations from here on block using the :term:`per-object lock`." msgstr "" +"از این پس، همه‌ی عملیات‌های دیگر با استفاده از :term:`per-object lock` مسدود " +"می‌شوند." -msgid "Writing a single item via ``lst[i] = x`` is safe to call from multiple threads and will not corrupt the list." +msgid "" +"Writing a single item via ``lst[i] = x`` is safe to call from multiple " +"threads and will not corrupt the list." msgstr "" +"نوشتن یک آیتم واحد از طریق ``lst[i] = x`` برای فراخوانی از چندین نخ ایمن است" +" و فهرست را خراب نمی‌کند." -msgid "The following operations return new objects and appear :term:`atomic ` to other threads:" +msgid "" +"The following operations return new objects and appear :term:`atomic ` to other threads:" msgstr "" +"عملیات زیر اشیای جدیدی را برمی‌گردانند و برای نخ‌های دیگر :term:`اتمی " +"` به نظر می‌رسند:" msgid "" "lst1 + lst2 # concatenates two lists into a new list\n" "x * lst # repeats lst x times into a new list\n" "lst.copy() # returns a shallow copy of the list" msgstr "" +"lst1 + lst2 # دو فهرست را در یک فهرست جدید الحاق می‌کند\n" +"x * lst # lst را x بار در یک فهرست جدید تکرار می‌کند\n" +"lst.copy() # یک کپی سطحی از فهرست برمی‌گرداند" -msgid "The following methods that only operate on a single element with no shifting required are :term:`atomic `:" +msgid "" +"The following methods that only operate on a single element with no shifting" +" required are :term:`atomic `:" msgstr "" +"متدهای زیر که تنها روی یک المان عمل می‌کنند و نیازی به جابه‌جایی ندارند، " +":term:`اتمی ` هستند:" msgid "" "lst.append(x) # append to the end of the list, no shifting required\n" "lst.pop() # pop element from the end of the list, no shifting required" msgstr "" +"lst.append(x) # افزودن به انتهای فهرست، بدون نیاز به جابه‌جایی\n" +"lst.pop() # برداشتن عنصر از انتهای فهرست، بدون نیاز به جابه‌جایی" -msgid "The :meth:`~list.clear` method is also :term:`atomic `. Other threads cannot observe elements being removed." +msgid "" +"The :meth:`~list.clear` method is also :term:`atomic `. " +"Other threads cannot observe elements being removed." msgstr "" +"متد :meth:`~list.clear` نیز :term:`اتمی ` است. سایر نخ‌ها " +"نمی‌توانند حذف شدن عناصر را مشاهده کنند." -msgid "The :meth:`~list.sort` method is not :term:`atomic `. Other threads cannot observe intermediate states during sorting, but the list appears empty for the duration of the sort." +msgid "" +"The :meth:`~list.sort` method is not :term:`atomic `. " +"Other threads cannot observe intermediate states during sorting, but the " +"list appears empty for the duration of the sort." msgstr "" +"متد :meth:`~list.sort` :term:`اتمی ` نیست. سایر نخ‌ها " +"نمی‌توانند وضعیت‌های میانی را در حین مرتب‌سازی مشاهده کنند، اما فهرست در طول" +" مدت مرتب‌سازی خالی به نظر می‌رسد." -msgid "The following operations may allow :term:`lock-free` operations to observe intermediate states since they modify multiple elements in place:" +msgid "" +"The following operations may allow :term:`lock-free` operations to observe " +"intermediate states since they modify multiple elements in place:" msgstr "" +"عملیات‌های زیر ممکن است به عملیات :term:`lock-free` اجازه دهند که وضعیت‌های " +"میانی را مشاهده کنند، زیرا چندین المان را به‌صورت درجا تغییر می‌دهند:" msgid "" "lst.insert(idx, item) # shifts elements\n" "lst.pop(idx) # idx not at the end of the list, shifts elements\n" "lst *= x # copies elements in place" msgstr "" +"lst.insert(idx, item) # عناصر را جابه‌جا می‌کند\n" +"lst.pop(idx) # اگر idx در انتهای فهرست نباشد، عناصر جابه‌جا می‌شوند\n" +"lst *= x # عناصر را درجا کپی می‌کند" -msgid "The :meth:`~list.remove` method may allow concurrent modifications since element comparison may execute arbitrary Python code (via :meth:`~object.__eq__`)." +msgid "" +"The :meth:`~list.remove` method may allow concurrent modifications since " +"element comparison may execute arbitrary Python code (via " +":meth:`~object.__eq__`)." msgstr "" +"متد :meth:`~list.remove` ممکن است اجازه‌ی تغییرات همزمان را بدهد، زیرا " +"مقایسه‌ی عنصر ممکن است کد پایتون دلخواه را اجرا کند (از طریق " +":meth:`~object.__eq__`)." -msgid ":meth:`~list.extend` is safe to call from multiple threads. However, its guarantees depend on the iterable passed to it. If it is a :class:`list`, a :class:`tuple`, a :class:`set`, a :class:`frozenset`, a :class:`dict` or a :ref:`dictionary view object ` (but not their subclasses), the ``extend`` operation is safe from concurrent modifications to the iterable. Otherwise, an iterator is created which can be concurrently modified by another thread. The same applies to inplace concatenation of a list with other iterables when using ``lst += iterable``." -msgstr "" +msgid "" +":meth:`~list.extend` is safe to call from multiple threads. However, its " +"guarantees depend on the iterable passed to it. If it is a :class:`list`, a " +":class:`tuple`, a :class:`set`, a :class:`frozenset`, a :class:`dict` or a " +":ref:`dictionary view object ` (but not their subclasses), the " +"``extend`` operation is safe from concurrent modifications to the iterable. " +"Otherwise, an iterator is created which can be concurrently modified by " +"another thread. The same applies to inplace concatenation of a list with " +"other iterables when using ``lst += iterable``." +msgstr "" +"فراخوانی :meth:`~list.extend` از چندین نخ ایمن است. با این حال، تضمین‌های آن" +" به پیمایش‌پذیری که به آن داده می‌شود بستگی دارد. اگر این پیمایش‌پذیر یک " +":class:`list`، :class:`tuple`، :class:`set`، :class:`frozenset`، " +":class:`dict` یا :ref:`شیء نمای دیکشنری ` باشد (اما نه " +"زیرکلاس‌های آن‌ها)، عملیات ``extend`` در برابر تغییرات همزمان روی پیمایش‌پذیر" +" ایمن است. در غیر این صورت، یک پیمایش‌گر ایجاد می‌شود که ممکن است توسط نخ " +"دیگری به‌طور همزمان تغییر داده شود. همین موضوع برای الحاق درجای یک فهرست با" +" سایر پیمایش‌پذیرها هنگام استفاده از ``lst += iterable`` نیز صدق می‌کند." -msgid "Similarly, assigning to a list slice with ``lst[i:j] = iterable`` is safe to call from multiple threads, but ``iterable`` is only locked when it is also a :class:`list` (but not its subclasses)." +msgid "" +"Similarly, assigning to a list slice with ``lst[i:j] = iterable`` is safe to" +" call from multiple threads, but ``iterable`` is only locked when it is also" +" a :class:`list` (but not its subclasses)." msgstr "" +"به‌طور مشابه، انتساب به یک برش فهرست با ``lst[i:j] = iterable`` برای " +"فراخوانی از چندین نخ امن است، اما ``iterable`` تنها زمانی قفل می‌شود که خود " +"نیز یک :class:`list` باشد (اما نه زیرکلاس‌های آن)." -msgid "Operations that involve multiple accesses, as well as iteration, are never atomic. For example:" +msgid "" +"Operations that involve multiple accesses, as well as iteration, are never " +"atomic. For example:" msgstr "" +"عملیات‌هایی که شامل چندین دسترسی و همچنین تکرار هستند، هرگز اتمی نیستند. " +"برای مثال:" msgid "" "# NOT atomic: read-modify-write\n" @@ -162,18 +342,45 @@ msgid "" "for item in lst:\n" " process(item) # another thread may modify lst" msgstr "" +"# اتمی نیست: خواندن-تغییر-نوشتن\n" +"lst[i] = lst[i] + 1\n" +"\n" +"# اتمی نیست: بررسی-سپس-عمل\n" +"if lst:\n" +" item = lst.pop()\n" +"\n" +"# ایمن در برابر نخ نیست: پیمایش در حین تغییر\n" +"for item in lst:\n" +" process(item) # ممکن است نخ دیگری lst را تغییر دهد" -msgid "Consider external synchronization when sharing :class:`list` instances across threads." +msgid "" +"Consider external synchronization when sharing :class:`list` instances " +"across threads." msgstr "" +"هنگام اشتراک‌گذاری نمونه‌های :class:`list` میان نخ‌ها، همگام‌سازی خارجی را " +"در نظر بگیرید." msgid "Thread safety for dict objects" -msgstr "" +msgstr "ایمنی نخی برای اشیاء دیکشنری" -msgid "Creating a dictionary with the :class:`dict` constructor is atomic when the argument to it is a :class:`dict` or a :class:`tuple`. When using the :meth:`dict.fromkeys` method, dictionary creation is atomic when the argument is a :class:`dict`, :class:`tuple`, :class:`set` or :class:`frozenset`." +msgid "" +"Creating a dictionary with the :class:`dict` constructor is atomic when the " +"argument to it is a :class:`dict` or a :class:`tuple`. When using the " +":meth:`dict.fromkeys` method, dictionary creation is atomic when the " +"argument is a :class:`dict`, :class:`tuple`, :class:`set` or " +":class:`frozenset`." msgstr "" +"ایجاد یک دیکشنری با سازنده‌ی :class:`dict` زمانی اتمی است که آرگومان آن یک " +":class:`dict` یا یک :class:`tuple` باشد. هنگام استفاده از متد " +":meth:`dict.fromkeys`، ایجاد دیکشنری زمانی اتمی است که آرگومان یک " +":class:`dict`، :class:`tuple`، :class:`set` یا :class:`frozenset` باشد." -msgid "The following operations and functions are :term:`lock-free` and :term:`atomic `." +msgid "" +"The following operations and functions are :term:`lock-free` and " +":term:`atomic `." msgstr "" +"عملیات و توابع زیر :term:`بدون قفل ` و :term:`اتمی ` هستند." msgid "" "d[key] # dict.__getitem__\n" @@ -181,12 +388,22 @@ msgid "" "key in d # dict.__contains__\n" "len(d) # dict.__len__" msgstr "" +"d[key] # dict.__getitem__\n" +"d.get(key) # dict.get\n" +"key in d # dict.__contains__\n" +"len(d) # dict.__len__" msgid "All other operations from here on hold the :term:`per-object lock`." msgstr "" +"تمام عملیات‌های دیگر از اینجا به بعد، :term:`per-object lock` را در اختیار " +"دارند." -msgid "Writing or removing a single item is safe to call from multiple threads and will not corrupt the dictionary:" +msgid "" +"Writing or removing a single item is safe to call from multiple threads and " +"will not corrupt the dictionary:" msgstr "" +"نوشتن یا حذف یک آیتم واحد برای فراخوانی از چندین نخ ایمن است و دیکشنری را " +"خراب نمی‌کند:" msgid "" "d[key] = value # write\n" @@ -195,12 +412,33 @@ msgid "" "d.popitem() # remove and return last item\n" "d.setdefault(key, v) # insert if missing" msgstr "" +"d[key] = value # write\n" +"del d[key] # delete\n" +"d.pop(key) # remove and return\n" +"d.popitem() # remove and return last item\n" +"d.setdefault(key, v) # insert if missing" -msgid "These operations may compare keys using :meth:`~object.__eq__`, which can execute arbitrary Python code. During such comparisons, the dictionary may be modified by another thread. For built-in types like :class:`str`, :class:`int`, and :class:`float`, that implement :meth:`~object.__eq__` in C, the underlying lock is not released during comparisons and this is not a concern." -msgstr "" +msgid "" +"These operations may compare keys using :meth:`~object.__eq__`, which can " +"execute arbitrary Python code. During such comparisons, the dictionary may " +"be modified by another thread. For built-in types like :class:`str`, " +":class:`int`, and :class:`float`, that implement :meth:`~object.__eq__` in " +"C, the underlying lock is not released during comparisons and this is not a " +"concern." +msgstr "" +"این عملیات‌ها ممکن است کلیدها را با استفاده از :meth:`~object.__eq__` مقایسه" +" کنند، که می‌تواند کد پایتون دلخواه را اجرا کند. در حین چنین مقایسه‌هایی، " +"ممکن است دیکشنری توسط نخ دیگری تغییر داده شود. برای انواع توکار مانند " +":class:`str`، :class:`int` و :class:`float`، که :meth:`~object.__eq__` را در" +" C پیاده‌سازی می‌کنند، قفل زیربنایی در حین مقایسه‌ها آزاد نمی‌شود و این " +"موضوع جای نگرانی نیست." -msgid "The following operations return new objects and hold the :term:`per-object lock` for the duration of the operation:" +msgid "" +"The following operations return new objects and hold the :term:`per-object " +"lock` for the duration of the operation:" msgstr "" +"عملیات‌های زیر شیءهای جدید را برمی‌گردانند و در طول مدت عملیات، :term:`per-" +"object lock` را نگه می‌دارند:" msgid "" "d.copy() # returns a shallow copy of the dictionary\n" @@ -209,42 +447,88 @@ msgid "" "d.values() # returns a new dict_values view object\n" "d.items() # returns a new dict_items view object" msgstr "" +"d.copy() # یک کپی سطحی از دیکشنری برمی‌گرداند\n" +"d | other # دو دیکشنری را در یک دیکشنری جدید ادغام می‌کند\n" +"d.keys() # یک شیء نمایش (view object) جدید از نوع dict_keys برمی‌گرداند\n" +"d.values() # یک شیء نمایش (view object) جدید از نوع dict_values برمی‌گرداند\n" +"d.items() # یک شیء نمایش (view object) جدید از نوع dict_items برمی‌گرداند" -msgid "The :meth:`~dict.clear` method holds the lock for its duration. Other threads cannot observe elements being removed." +msgid "" +"The :meth:`~dict.clear` method holds the lock for its duration. Other " +"threads cannot observe elements being removed." msgstr "" +"متد :meth:`~dict.clear` قفل را در طول مدت اجرای خود نگه می‌دارد. نخ‌های دیگر" +" نمی‌توانند حذف عناصر را مشاهده کنند." -msgid "The following operations lock both dictionaries. For :meth:`~dict.update` and ``|=``, this applies only when the other operand is a :class:`dict` that uses the standard dict iterator (but not subclasses that override iteration). For equality comparison, this applies to :class:`dict` and its subclasses:" -msgstr "" +msgid "" +"The following operations lock both dictionaries. For :meth:`~dict.update` " +"and ``|=``, this applies only when the other operand is a :class:`dict` that" +" uses the standard dict iterator (but not subclasses that override " +"iteration). For equality comparison, this applies to :class:`dict` and its " +"subclasses:" +msgstr "" +"عملیات زیر هر دو دیکشنری را قفل می‌کنند. برای :meth:`~dict.update` و ``|=``،" +" این موضوع فقط زمانی صدق می‌کند که عملوند دیگر یک :class:`dict` باشد که از " +"پیمایش‌گر استاندارد دیکشنری استفاده می‌کند (اما نه زیرکلاس‌هایی که تکرار را" +" بازنویسی می‌کنند). در مقایسه برابری، این موضوع برای :class:`dict` و " +"زیرکلاس‌های آن صدق می‌کند:" msgid "" "d.update(other_dict) # both locked when other_dict is a dict\n" "d |= other_dict # both locked when other_dict is a dict\n" "d == other_dict # both locked for dict and subclasses" msgstr "" +"d.update(other_dict) # هر دو قفل می‌شوند، هنگامی که other_dict یک dict باشد\n" +"d |= other_dict # هر دو قفل می‌شوند، هنگامی که other_dict یک dict باشد\n" +"d == other_dict # هر دو برای dict و زیرکلاس‌های آن قفل می‌شوند" -msgid "All comparison operations also compare values using :meth:`~object.__eq__`, so for non-built-in types the lock may be released during comparison." +msgid "" +"All comparison operations also compare values using :meth:`~object.__eq__`, " +"so for non-built-in types the lock may be released during comparison." msgstr "" +"تمام عملیات‌های مقایسه نیز مقادیر را با استفاده از :meth:`~object.__eq__` " +"مقایسه می‌کنند، بنابراین برای انواع غیرتوکار ممکن است قفل در حین مقایسه آزاد" +" شود." -msgid ":meth:`~dict.fromkeys` locks both the new dictionary and the iterable when the iterable is exactly a :class:`dict`, :class:`set`, or :class:`frozenset` (not subclasses):" +msgid "" +":meth:`~dict.fromkeys` locks both the new dictionary and the iterable when " +"the iterable is exactly a :class:`dict`, :class:`set`, or :class:`frozenset`" +" (not subclasses):" msgstr "" +":meth:`~dict.fromkeys` هر دو دیکشنری جدید و پیمایش‌پذیر را زمانی که پیمایش‌پذیر " +"دقیقاً یک :class:`dict`، :class:`set` یا :class:`frozenset` باشد (نه " +"زیرکلاس‌ها) قفل می‌کند:" msgid "" "dict.fromkeys(a_dict) # locks both\n" "dict.fromkeys(a_set) # locks both\n" "dict.fromkeys(a_frozenset) # locks both" msgstr "" +"dict.fromkeys(a_dict) # هر دو را قفل می‌کند\n" +"dict.fromkeys(a_set) # هر دو را قفل می‌کند\n" +"dict.fromkeys(a_frozenset) # هر دو را قفل می‌کند" -msgid "When updating from a non-dict iterable, only the target dictionary is locked. The iterable may be concurrently modified by another thread:" +msgid "" +"When updating from a non-dict iterable, only the target dictionary is " +"locked. The iterable may be concurrently modified by another thread:" msgstr "" +"هنگام به‌روزرسانی از یک پیمایش‌پذیر غیر از دیکشنری، فقط دیکشنری هدف قفل " +"می‌شود. ممکن است پیمایش‌پذیر به‌طور همزمان توسط نخ دیگری تغییر داده شود:" msgid "" "d.update(iterable) # iterable is not a dict: only d locked\n" "d |= iterable # iterable is not a dict: only d locked\n" "dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only result locked" msgstr "" +"d.update(iterable) # iterable is not a dict: only d locked\n" +"d |= iterable # iterable is not a dict: only d locked\n" +"dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only result locked" -msgid "Operations that involve multiple accesses, as well as iteration, are never atomic:" +msgid "" +"Operations that involve multiple accesses, as well as iteration, are never " +"atomic:" msgstr "" +"عملیات‌هایی که شامل چندین دسترسی هستند، و همچنین تکرار، هرگز اتمی نیستند:" msgid "" "# NOT atomic: read-modify-write\n" @@ -258,9 +542,23 @@ msgid "" "for key, value in d.items():\n" " process(key) # another thread may modify d" msgstr "" +"# اتمی نیست: خواندن-تغییر-نوشتن\n" +"d[key] = d[key] + 1\n" +"\n" +"# اتمی نیست: بررسی-سپس-عمل (TOCTOU)\n" +"if key in d:\n" +" del d[key]\n" +"\n" +"# ایمن در برابر نخ نیست: پیمایش در حین تغییر\n" +"for key, value in d.items():\n" +" process(key) # ممکن است نخ دیگری d را تغییر دهد" -msgid "To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic operations or handle exceptions:" +msgid "" +"To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic operations" +" or handle exceptions:" msgstr "" +"برای جلوگیری از مشکلات زمان بررسی تا زمان استفاده (TOCTOU)، از عملیات اتمی " +"استفاده کنید یا استثناها را مدیریت کنید:" msgid "" "# Use pop() with default instead of check-then-delete\n" @@ -272,39 +570,80 @@ msgid "" "except KeyError:\n" " pass" msgstr "" +"# به‌جای بررسی-سپس-حذف (check-then-delete)، از pop() با مقدار پیش‌فرض استفاده کنید\n" +"d.pop(key, None)\n" +"\n" +"# یا استثنا را مدیریت کنید\n" +"try:\n" +" del d[key]\n" +"except KeyError:\n" +" pass" -msgid "To safely iterate over a dictionary that may be modified by another thread, iterate over a copy:" +msgid "" +"To safely iterate over a dictionary that may be modified by another thread, " +"iterate over a copy:" msgstr "" +"برای پیمایش ایمن روی دیکشنری‌ای که ممکن است توسط نخ دیگری تغییر داده شود، " +"روی یک نسخه از آن پیمایش کنید:" msgid "" "# Make a copy to iterate safely\n" "for key, value in d.copy().items():\n" " process(key)" msgstr "" +"# برای پیمایش ایمن، یک کپی بسازید\n" +"for key, value in d.copy().items():\n" +" process(key)" -msgid "Consider external synchronization when sharing :class:`dict` instances across threads." +msgid "" +"Consider external synchronization when sharing :class:`dict` instances " +"across threads." msgstr "" +"هنگام اشتراک‌گذاری نمونه‌های :class:`dict` میان نخ‌ها، همگام‌سازی خارجی را " +"در نظر بگیرید." msgid "Thread safety for set objects" -msgstr "" +msgstr "ایمنی نخی برای اشیای مجموعه" -msgid "The :func:`len` function is lock-free and :term:`atomic `." -msgstr "" +msgid "" +"The :func:`len` function is lock-free and :term:`atomic `." +msgstr "تابع :func:`len` بدون قفل و :term:`اتمی ` است." -msgid "The following read operation is lock-free. It does not block concurrent modifications and may observe intermediate states from operations that hold the per-object lock:" +msgid "" +"The following read operation is lock-free. It does not block concurrent " +"modifications and may observe intermediate states from operations that hold " +"the per-object lock:" msgstr "" +"عملیات خواندن زیر بدون قفل است. این عملیات تغییرات همزمان را مسدود نمی‌کند " +"و ممکن است وضعیت‌های میانیِ عملیاتی را که قفل به‌ازای هر شیء را در اختیار " +"دارند، مشاهده کند:" msgid "elem in s # set.__contains__" -msgstr "" +msgstr "elem in s # set.__contains__" -msgid "This operation may compare elements using :meth:`~object.__eq__`, which can execute arbitrary Python code. During such comparisons, the set may be modified by another thread. For built-in types like :class:`str`, :class:`int`, and :class:`float`, :meth:`!__eq__` does not release the underlying lock during comparisons and this is not a concern." -msgstr "" +msgid "" +"This operation may compare elements using :meth:`~object.__eq__`, which can " +"execute arbitrary Python code. During such comparisons, the set may be " +"modified by another thread. For built-in types like :class:`str`, " +":class:`int`, and :class:`float`, :meth:`!__eq__` does not release the " +"underlying lock during comparisons and this is not a concern." +msgstr "" +"این عملیات ممکن است عناصر را با استفاده از :meth:`~object.__eq__`، که " +"می‌تواند کد پایتون دلخواه را اجرا کند، مقایسه کند. در طول چنین مقایسه‌هایی، " +"ممکن است مجموعه توسط نخ دیگری تغییر کند. برای انواع توکار مانند " +":class:`str`، :class:`int` و :class:`float`، :meth:`!__eq__` قفل زیرین را در" +" طول مقایسه‌ها آزاد نمی‌کند و این جای نگرانی نیست." msgid "All other operations from here on hold the per-object lock." msgstr "" +"از این نقطه به بعد، تمام عملیات‌های دیگر قفل به‌ازای هر شیء را نگه می‌دارند." -msgid "Adding or removing a single element is safe to call from multiple threads and will not corrupt the set:" +msgid "" +"Adding or removing a single element is safe to call from multiple threads " +"and will not corrupt the set:" msgstr "" +"افزودن یا حذف یک المان منفرد را می‌توان به‌صورت امن از چند نخ فراخوانی کرد و" +" مجموعه خراب نمی‌شود:" msgid "" "s.add(elem) # add element\n" @@ -312,18 +651,38 @@ msgid "" "s.discard(elem) # remove element if present\n" "s.pop() # remove and return arbitrary element" msgstr "" +"s.add(elem) # افزودن عنصر\n" +"s.remove(elem) # حذف عنصر، در صورت نبودن پرتاب می‌شود\n" +"s.discard(elem) # حذف عنصر در صورت وجود\n" +"s.pop() # حذف و برگرداندن عنصر دلخواه" -msgid "These operations also compare elements, so the same :meth:`~object.__eq__` considerations as above apply." +msgid "" +"These operations also compare elements, so the same :meth:`~object.__eq__` " +"considerations as above apply." msgstr "" +"این عملیات‌ها همچنین عناصر را مقایسه می‌کنند، بنابراین همان ملاحظات " +":meth:`~object.__eq__` بالا اعمال می‌شوند." -msgid "The :meth:`~set.copy` method returns a new object and holds the per-object lock for the duration so that it is always atomic." +msgid "" +"The :meth:`~set.copy` method returns a new object and holds the per-object " +"lock for the duration so that it is always atomic." msgstr "" +"متد :meth:`~set.copy` یک شیء جدید بازمی‌گرداند و قفل به‌ازای هر شیء را در " +"طول این مدت نگه می‌دارد تا همیشه اتمی باشد." -msgid "The :meth:`~set.clear` method holds the lock for its duration. Other threads cannot observe elements being removed." +msgid "" +"The :meth:`~set.clear` method holds the lock for its duration. Other threads" +" cannot observe elements being removed." msgstr "" +"متد :meth:`~set.clear` قفل را در طول مدت اجرای خود نگه می‌دارد. سایر نخ‌ها " +"نمی‌توانند عناصر در حال حذف را مشاهده کنند." -msgid "The following operations only accept :class:`set` or :class:`frozenset` as operands and always lock both objects:" +msgid "" +"The following operations only accept :class:`set` or :class:`frozenset` as " +"operands and always lock both objects:" msgstr "" +"عملیات‌های زیر فقط :class:`set` یا :class:`frozenset` را به‌عنوان عملوند " +"می‌پذیرند و همیشه هر دو شیء را قفل می‌کنند:" msgid "" "s |= other # other must be set/frozenset\n" @@ -335,48 +694,75 @@ msgid "" "s - other # other must be set/frozenset\n" "s ^ other # other must be set/frozenset" msgstr "" +"s |= other # other باید set/frozenset باشد\n" +"s &= other # other باید set/frozenset باشد\n" +"s -= other # other باید set/frozenset باشد\n" +"s ^= other # other باید set/frozenset باشد\n" +"s & other # other باید set/frozenset باشد\n" +"s | other # other باید set/frozenset باشد\n" +"s - other # other باید set/frozenset باشد\n" +"s ^ other # other باید set/frozenset باشد" -msgid ":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` and :meth:`set.difference` can take multiple iterables as arguments. They all iterate through all the passed iterables and do the following:" +msgid "" +":meth:`set.update`, :meth:`set.union`, :meth:`set.intersection` and " +":meth:`set.difference` can take multiple iterables as arguments. They all " +"iterate through all the passed iterables and do the following:" msgstr "" +":meth:`set.update`، :meth:`set.union`، :meth:`set.intersection` و " +":meth:`set.difference` می‌توانند چندین پیمایش‌پذیر را به‌عنوان آرگومان بگیرند." +" همه‌ی آن‌ها تمام پیمایش‌پذیرهای داده‌شده را پیمایش می‌کنند و کار زیر را انجام " +"می‌دهند:" msgid ":meth:`set.update` and :meth:`set.union` lock both objects only when" msgstr "" +":meth:`set.update` و :meth:`set.union` هر دو شیء را فقط زمانی قفل می‌کنند که" -msgid "the other operand is a :class:`set`, :class:`frozenset`, or :class:`dict`." -msgstr "" +msgid "" +"the other operand is a :class:`set`, :class:`frozenset`, or :class:`dict`." +msgstr "عملوند دیگر یک :class:`set`، :class:`frozenset` یا :class:`dict` است." msgid ":meth:`set.intersection` and :meth:`set.difference` always try to lock" msgstr "" +":meth:`set.intersection` و :meth:`set.difference` همیشه سعی می‌کنند قفل کنند" msgid "all objects." -msgstr "" +msgstr "تمام اشیاء." msgid ":meth:`set.symmetric_difference` tries to lock both objects." -msgstr "" +msgstr ":meth:`set.symmetric_difference` تلاش می‌کند هر دو شیء را قفل کند." -msgid "The update variants of the above methods also have some differences between them:" -msgstr "" +msgid "" +"The update variants of the above methods also have some differences between " +"them:" +msgstr "گونه‌های به‌روزرسانی متدهای بالا نیز تفاوت‌هایی با یکدیگر دارند:" msgid ":meth:`set.difference_update` and :meth:`set.intersection_update` try" msgstr "" +":meth:`set.difference_update` و :meth:`set.intersection_update` تلاش می‌کنند" msgid "to lock all objects one-by-one." -msgstr "" +msgstr "برای قفل کردن همه‌ی اشیاء به‌صورت یکی‌یکی." -msgid ":meth:`set.symmetric_difference_update` only locks the arguments if it is" +msgid "" +":meth:`set.symmetric_difference_update` only locks the arguments if it is" msgstr "" +":meth:`set.symmetric_difference_update` آرگومان‌ها را تنها در صورتی قفل " +"می‌کند که" msgid "of type :class:`set`, :class:`frozenset`, or :class:`dict`." -msgstr "" +msgstr "از نوع :class:`set`، :class:`frozenset` یا :class:`dict`." msgid "The following methods always try to lock both objects:" -msgstr "" +msgstr "متدهای زیر همیشه تلاش می‌کنند هر دو شیء را قفل کنند:" msgid "" "s.isdisjoint(other) # both locked\n" "s.issubset(other) # both locked\n" "s.issuperset(other) # both locked" msgstr "" +"s.isdisjoint(other) # both locked\n" +"s.issubset(other) # both locked\n" +"s.issuperset(other) # both locked" msgid "" "# NOT atomic: check-then-act\n" @@ -387,32 +773,57 @@ msgid "" "for elem in s:\n" " process(elem) # another thread may modify s" msgstr "" +"# اتمی نیست: بررسی-سپس-عمل\n" +"if elem in s:\n" +" s.remove(elem)\n" +"\n" +"# ایمن در برابر نخ نیست: پیمایش در حین تغییر\n" +"for elem in s:\n" +" process(elem) # ممکن است نخ دیگری s را تغییر دهد" -msgid "Consider external synchronization when sharing :class:`set` instances across threads. See :ref:`freethreading-python-howto` for more information." +msgid "" +"Consider external synchronization when sharing :class:`set` instances across" +" threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"هنگام اشتراک‌گذاری نمونه‌های :class:`set` بین نخ‌ها، همگام‌سازی خارجی را در " +"نظر بگیرید. برای اطلاعات بیشتر :ref:`freethreading-python-howto` را ببینید." msgid "Thread safety for bytearray objects" -msgstr "" +msgstr "ایمنی نخی برای اشیاء bytearray" -msgid "Concatenation and comparisons use the buffer protocol, which prevents resizing but does not hold the per-object lock. These operations may observe intermediate states from concurrent modifications:" +msgid "" +"Concatenation and comparisons use the buffer protocol, which prevents " +"resizing but does not hold the per-object lock. These operations may observe" +" intermediate states from concurrent modifications:" msgstr "" +"الحاق و مقایسه‌ها از پروتکل بافر (buffer protocol) استفاده می‌کنند، که از " +"تغییر اندازه جلوگیری می‌کند اما قفل به‌ازای هر شیء را نگه نمی‌دارد. این " +"عملیات ممکن است وضعیت‌های میانی ناشی از تغییرات همزمان را مشاهده کنند:" msgid "" "ba + other # may observe concurrent writes\n" "ba == other # may observe concurrent writes\n" "ba < other # may observe concurrent writes" msgstr "" +"ba + other # may observe concurrent writes\n" +"ba == other # may observe concurrent writes\n" +"ba < other # may observe concurrent writes" -msgid "Reading a single element or slice is safe to call from multiple threads:" -msgstr "" +msgid "" +"Reading a single element or slice is safe to call from multiple threads:" +msgstr "خواندن یک عنصر یا برش (slice) برای فراخوانی از چندین نخ امن است:" msgid "" "ba[i] # bytearray.__getitem__\n" "ba[i:j] # slice" msgstr "" +"ba[i] # bytearray.__getitem__\n" +"ba[i:j] # slice" -msgid "The following operations are safe to call from multiple threads and will not corrupt the bytearray:" -msgstr "" +msgid "" +"The following operations are safe to call from multiple threads and will not" +" corrupt the bytearray:" +msgstr "فراخوانی عملیات زیر از چندین نخ ایمن است و bytearray را خراب نمی‌کند:" msgid "" "ba[i] = x # write single byte\n" @@ -426,29 +837,56 @@ msgid "" "ba.reverse() # reverse in place\n" "ba.clear() # remove all bytes" msgstr "" +"ba[i] = x # نوشتن یک بایت\n" +"ba[i:j] = values # نوشتن برش\n" +"ba.append(x) # افزودن یک بایت\n" +"ba.extend(other) # گسترش با یک پیمایش‌پذیر\n" +"ba.insert(i, x) # درج یک بایت\n" +"ba.pop() # حذف و برگرداندن آخرین بایت\n" +"ba.pop(i) # حذف و برگرداندن بایت در اندیس\n" +"ba.remove(x) # حذف اولین رخداد\n" +"ba.reverse() # معکوس کردن درجا\n" +"ba.clear() # حذف همه بایت‌ها" -msgid "Slice assignment locks both objects when *values* is a :class:`bytearray`:" +msgid "" +"Slice assignment locks both objects when *values* is a :class:`bytearray`:" msgstr "" +"انتساب برشی هنگامی که *values* یک :class:`bytearray` باشد، هر دو شیء را قفل " +"می‌کند:" msgid "ba[i:j] = other_bytearray # both locked" -msgstr "" +msgstr "ba[i:j] = other_bytearray # هر دو قفل هستند" -msgid "The following operations return new objects and hold the per-object lock for the duration:" +msgid "" +"The following operations return new objects and hold the per-object lock for" +" the duration:" msgstr "" +"عملیات زیر اشیای جدید را برمی‌گردانند و قفل به‌ازای هر شیء را در طول مدت " +"آن نگه می‌دارند:" msgid "" "ba.copy() # returns a shallow copy\n" "ba * n # repeat into new bytearray" msgstr "" +"ba.copy() # یک کپی کم‌عمق بازمی‌گرداند\n" +"ba * n # تکرار به یک bytearray جدید" msgid "The membership test holds the lock for its duration:" -msgstr "" +msgstr "آزمون عضویت، قفل را در طول مدت خود نگه می‌دارد:" msgid "x in ba # bytearray.__contains__" -msgstr "" +msgstr "x in ba # bytearray.__contains__" -msgid "All other bytearray methods (such as :meth:`~bytearray.find`, :meth:`~bytearray.replace`, :meth:`~bytearray.split`, :meth:`~bytearray.decode`, etc.) hold the per-object lock for their duration." +msgid "" +"All other bytearray methods (such as :meth:`~bytearray.find`, " +":meth:`~bytearray.replace`, :meth:`~bytearray.split`, " +":meth:`~bytearray.decode`, etc.) hold the per-object lock for their " +"duration." msgstr "" +"تمام متدهای دیگر bytearray (مانند :meth:`~bytearray.find`، " +":meth:`~bytearray.replace`، :meth:`~bytearray.split`، " +":meth:`~bytearray.decode` و غیره) در طول اجرای خود، قفل به‌ازای هر شیء را " +"نگه می‌دارند." msgid "" "# NOT atomic: check-then-act\n" @@ -459,36 +897,93 @@ msgid "" "for byte in ba:\n" " process(byte) # another thread may modify ba" msgstr "" +"# غیراتمی: بررسی-سپس-عمل\n" +"if x in ba:\n" +" ba.remove(x)\n" +"\n" +"# غیرایمن در برابر نخ‌ها: پیمایش هنگام تغییر\n" +"for byte in ba:\n" +" process(byte) # ممکن است نخ دیگری ba را تغییر دهد" -msgid "To safely iterate over a bytearray that may be modified by another thread, iterate over a copy:" +msgid "" +"To safely iterate over a bytearray that may be modified by another thread, " +"iterate over a copy:" msgstr "" +"برای پیمایش امن روی bytearray که ممکن است توسط نخ دیگری تغییر کند، روی یک " +"کپی پیمایش کنید:" msgid "" "# Make a copy to iterate safely\n" "for byte in ba.copy():\n" " process(byte)" msgstr "" +"# Make a copy to iterate safely\n" +"for byte in ba.copy():\n" +" process(byte)" -msgid "Consider external synchronization when sharing :class:`bytearray` instances across threads. See :ref:`freethreading-python-howto` for more information." +msgid "" +"Consider external synchronization when sharing :class:`bytearray` instances " +"across threads. See :ref:`freethreading-python-howto` for more information." msgstr "" +"هنگام اشتراک‌گذاری نمونه‌های :class:`bytearray` بین نخ‌ها، همگام‌سازی خارجی " +"را در نظر بگیرید. برای اطلاعات بیشتر :ref:`freethreading-python-howto` را " +"ببینید." msgid "Thread safety for memoryview objects" -msgstr "" +msgstr "ایمنی نخ برای اشیای memoryview" -msgid ":class:`memoryview` objects provide access to the internal data of an underlying object without copying. Thread safety depends on both the memoryview itself and the underlying buffer exporter." +msgid "" +":class:`memoryview` objects provide access to the internal data of an " +"underlying object without copying. Thread safety depends on both the " +"memoryview itself and the underlying buffer exporter." msgstr "" +"اشیای :class:`memoryview` دسترسی به داده‌های داخلی یک شیء زیربنایی را بدون " +"کپی کردن فراهم می‌کنند. ایمنی نخی هم به خود memoryview و هم به صادرکننده‌ی " +"بافر زیربنایی بستگی دارد." -msgid "The memoryview implementation uses atomic operations to track its own exports in the :term:`free-threaded build`. Creating and releasing a memoryview are thread-safe. Attribute access (e.g., :attr:`~memoryview.shape`, :attr:`~memoryview.format`) reads fields that are immutable for the lifetime of the memoryview, so concurrent reads are safe as long as the memoryview has not been released." -msgstr "" +msgid "" +"The memoryview implementation uses atomic operations to track its own " +"exports in the :term:`free-threaded build`. Creating and releasing a " +"memoryview are thread-safe. Attribute access (e.g., " +":attr:`~memoryview.shape`, :attr:`~memoryview.format`) reads fields that are" +" immutable for the lifetime of the memoryview, so concurrent reads are safe " +"as long as the memoryview has not been released." +msgstr "" +"پیاده‌سازی memoryview از عملیات اتمی برای پیگیری برون‌دهی‌های خود در " +":term:`free-threaded build` استفاده می‌کند. ایجاد و آزادسازی یک memoryview " +"ایمن در برابر نخ (thread-safe) هستند. دسترسی به ویژگی‌ها (برای مثال، " +":attr:`~memoryview.shape`، :attr:`~memoryview.format`) فیلدهایی را می‌خواند " +"که در طول عمر memoryview تغییرناپذیر هستند، بنابراین خواندن‌های همزمان تا " +"زمانی که memoryview آزاد نشده باشد، ایمن هستند." -msgid "However, the actual data accessed through the memoryview is owned by the underlying object. Concurrent access to this data is only safe if the underlying object supports it:" +msgid "" +"However, the actual data accessed through the memoryview is owned by the " +"underlying object. Concurrent access to this data is only safe if the " +"underlying object supports it:" msgstr "" +"با این حال، داده‌ی واقعی که از طریق memoryview به آن دسترسی دارید، متعلق به " +"شیء زیربنایی است. دسترسی همزمان به این داده تنها در صورتی امن است که شیء " +"زیربنایی از آن پشتیبانی کند:" -msgid "For immutable objects like :class:`bytes`, concurrent reads through multiple memoryviews are safe." +msgid "" +"For immutable objects like :class:`bytes`, concurrent reads through multiple" +" memoryviews are safe." msgstr "" +"برای اشیاء تغییرناپذیر مانند :class:`bytes`، خواندن‌های همزمان از طریق " +"چندین نمای حافظه (memoryview) ایمن هستند." -msgid "For mutable objects like :class:`bytearray`, reading and writing the same memory region from multiple threads without external synchronization is not safe and may result in data corruption. Note that even read-only memoryviews of mutable objects do not prevent data races if the underlying object is modified from another thread." -msgstr "" +msgid "" +"For mutable objects like :class:`bytearray`, reading and writing the same " +"memory region from multiple threads without external synchronization is not " +"safe and may result in data corruption. Note that even read-only memoryviews" +" of mutable objects do not prevent data races if the underlying object is " +"modified from another thread." +msgstr "" +"برای اشیاء تغییرپذیر مانند :class:`bytearray`، خواندن و نوشتن یک ناحیه‌ی " +"حافظه‌ی یکسان توسط چند نخ بدون همگام‌سازی خارجی ایمن نیست و ممکن است به خرابی" +" داده منجر شود. توجه داشته باشید که حتی memoryviewهای فقط‌خواندنی از اشیاء " +"تغییرپذیر نیز در صورتی که شیء زیرین توسط نخ دیگری تغییر کند، از رقابت‌های " +"داده‌ای جلوگیری نمی‌کنند." msgid "" "# NOT safe: concurrent writes to the same buffer\n" @@ -497,6 +992,11 @@ msgid "" "# Thread 1: view[0:500] = b'x' * 500\n" "# Thread 2: view[0:500] = b'y' * 500" msgstr "" +"# ایمن نیست: نوشتن‌های همزمان در یک بافر یکسان\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"# نخ ۱: view[0:500] = b'x' * 500\n" +"# نخ ۲: view[0:500] = b'y' * 500" msgid "" "# Safe: use a lock for concurrent access\n" @@ -508,6 +1008,20 @@ msgid "" "with lock:\n" " view[0:500] = b'x' * 500" msgstr "" +"# Safe: use a lock for concurrent access\n" +"import threading\n" +"lock = threading.Lock()\n" +"data = bytearray(1000)\n" +"view = memoryview(data)\n" +"\n" +"with lock:\n" +" view[0:500] = b'x' * 500" -msgid "Resizing or reallocating the underlying object (such as calling :meth:`bytearray.resize`) while a memoryview is exported raises :exc:`BufferError`. This is enforced regardless of threading." +msgid "" +"Resizing or reallocating the underlying object (such as calling " +":meth:`bytearray.resize`) while a memoryview is exported raises " +":exc:`BufferError`. This is enforced regardless of threading." msgstr "" +"تغییر اندازه یا تخصیص مجدد شیء زیرین (مانند فراخوانی " +":meth:`bytearray.resize`) در حالی که یک memoryview صادر شده باشد، " +":exc:`BufferError` را پرتاب می‌کند. این امر صرف‌نظر از نخ‌بندی اعمال می‌شود." diff --git a/library/time.po b/library/time.po index f28886b9b..aa82e7c28 100644 --- a/library/time.po +++ b/library/time.po @@ -16,7 +16,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:15+0000\n" +"PO-Revision-Date: 2026-08-28 11:34+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -24,711 +24,1308 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!time` --- Time access and conversions" -msgstr "" +msgstr ":mod:`!time` --- دسترسی به زمان و تبدیل‌ها" -msgid "This module provides various time-related functions. For related functionality, see also the :mod:`datetime` and :mod:`calendar` modules." +msgid "" +"This module provides various time-related functions. For related " +"functionality, see also the :mod:`datetime` and :mod:`calendar` modules." msgstr "" +"این ماژول توابع مختلفی مرتبط با زمان را فراهم می‌کند. برای قابلیت‌های مرتبط، " +"ماژول‌های :mod:`datetime` و :mod:`calendar` را نیز ببینید." -msgid "Although this module is always available, not all functions are available on all platforms. Most of the functions defined in this module call platform C library functions with the same name. It may sometimes be helpful to consult the platform documentation, because the semantics of these functions varies among platforms." +msgid "" +"Although this module is always available, not all functions are available on " +"all platforms. Most of the functions defined in this module call platform C " +"library functions with the same name. It may sometimes be helpful to consult " +"the platform documentation, because the semantics of these functions varies " +"among platforms." msgstr "" +"اگرچه این ماژول همیشه در دسترس است، اما همه‌ی توابع در همه‌ی پلتفرم‌ها در دسترس " +"نیستند. بیشتر توابع تعریف‌شده در این ماژول، توابع کتابخانه‌ی C پلتفرم را با همان " +"نام فراخوانی می‌کنند. ممکن است گاهی مراجعه به مستندات پلتفرم مفید باشد، زیرا " +"معناشناسی این توابع در پلتفرم‌های مختلف متفاوت است." msgid "An explanation of some terminology and conventions is in order." -msgstr "" +msgstr "توضیحی درباره‌ی برخی اصطلاحات و قراردادها به‌جاست." -msgid "The :dfn:`epoch` is the point where the time starts, the return value of ``time.gmtime(0)``. It is January 1, 1970, 00:00:00 (UTC) on all platforms." +msgid "" +"The :dfn:`epoch` is the point where the time starts, the return value of " +"``time.gmtime(0)``. It is January 1, 1970, 00:00:00 (UTC) on all platforms." msgstr "" +":dfn:`epoch` نقطه‌ای است که زمان از آن آغاز می‌شود، یعنی مقدار بازگشتی " +"``time.gmtime(0)``. این زمان در همه‌ی پلتفرم‌ها ۱ ژانویه‌ی ۱۹۷۰، ۰۰:۰۰:۰۰ (UTC) است." -msgid "The term :dfn:`seconds since the epoch` refers to the total number of elapsed seconds since the epoch, typically excluding `leap seconds`_. Leap seconds are excluded from this total on all POSIX-compliant platforms." +msgid "" +"The term :dfn:`seconds since the epoch` refers to the total number of elapsed " +"seconds since the epoch, typically excluding `leap seconds`_. Leap seconds " +"are excluded from this total on all POSIX-compliant platforms." msgstr "" +"اصطلاح :dfn:`ثانیه‌های سپری‌شده از مبدأ زمانی ` به " +"تعداد کل ثانیه‌های سپری‌شده از مبدأ زمانی اشاره دارد، معمولاً به استثنای `leap " +"seconds`_. ثانیه‌های کبیسه در تمام پلتفرم‌های سازگار با POSIX از این مجموع حذف " +"می‌شوند." -msgid "The functions in this module may not handle dates and times before the epoch_ or far in the future. The cut-off point in the future is determined by the C library; for 32-bit systems, it is typically in 2038." +msgid "" +"The functions in this module may not handle dates and times before the epoch_ " +"or far in the future. The cut-off point in the future is determined by the C " +"library; for 32-bit systems, it is typically in 2038." msgstr "" +"توابع این ماژول ممکن است تاریخ‌ها و زمان‌های پیش از epoch_ یا آینده‌ی بسیار دور را " +"مدیریت نکنند. نقطه‌ی قطع در آینده توسط کتابخانه‌ی C تعیین می‌شود؛ برای سیستم‌های " +"۳۲‌بیتی، معمولاً در سال ۲۰۳۸ است." -msgid "Function :func:`strptime` can parse 2-digit years when given ``%y`` format code. When 2-digit years are parsed, they are converted according to the POSIX and ISO C standards: values 69--99 are mapped to 1969--1999, and values 0--68 are mapped to 2000--2068." +msgid "" +"Function :func:`strptime` can parse 2-digit years when given ``%y`` format " +"code. When 2-digit years are parsed, they are converted according to the POSIX " +"and ISO C standards: values 69--99 are mapped to 1969--1999, and values 0--68 " +"are mapped to 2000--2068." msgstr "" +"تابع :func:`strptime` می‌تواند سال‌های دو رقمی را در صورت دریافت کد پیش‌ساخته ``%y`` " +"تجزیه کند. هنگامی که سال‌های دو رقمی تجزیه می‌شوند، آن‌ها مطابق استانداردهای " +"POSIX و ISO C تبدیل می‌شوند: مقادیر ۶۹--۹۹ به ۱۹۶۹--۱۹۹۹ نگاشت داده می‌شوند، و " +"مقادیر ۰--۶۸ به ۲۰۰۰--۲۰۶۸ نگاشت داده می‌شوند." -msgid "UTC is `Coordinated Universal Time`_ and superseded `Greenwich Mean Time`_ or GMT as the basis of international timekeeping. The acronym UTC is not a mistake but conforms to an earlier, language-agnostic naming scheme for time standards such as UT0, UT1, and UT2." +msgid "" +"UTC is `Coordinated Universal Time`_ and superseded `Greenwich Mean Time`_ or " +"GMT as the basis of international timekeeping. The acronym UTC is not a " +"mistake but conforms to an earlier, language-agnostic naming scheme for time " +"standards such as UT0, UT1, and UT2." msgstr "" +"UTC همان `Coordinated Universal Time`_ است و جایگزین `Greenwich Mean Time`_ یا " +"GMT به‌عنوان مبنای زمان‌بندی بین‌المللی شده است. سرواژه UTC اشتباه نیست، بلکه از " +"یک طرح‌واره نام‌گذاری پیشین و مستقل از زبان برای استانداردهای زمان مانند UT0، UT1 و " +"UT2 پیروی می‌کند." -msgid "DST is Daylight Saving Time, an adjustment of the timezone by (usually) one hour during part of the year. DST rules are magic (determined by local law) and can change from year to year. The C library has a table containing the local rules (often it is read from a system file for flexibility) and is the only source of True Wisdom in this respect." -msgstr "" +msgid "" +"DST is Daylight Saving Time, an adjustment of the timezone by (usually) one " +"hour during part of the year. DST rules are magic (determined by local law) " +"and can change from year to year. The C library has a table containing the " +"local rules (often it is read from a system file for flexibility) and is the " +"only source of True Wisdom in this respect." +msgstr "" +"DST زمان تابستانی (Daylight Saving Time) است، تنظیمی در منطقه زمانی به میزان " +"(معمولاً) یک ساعت در بخشی از سال. قواعد DST جادویی هستند (توسط قانون محلی تعیین " +"می‌شوند) و می‌توانند از سالی به سال دیگر تغییر کنند. کتابخانه C جدولی شامل قواعد " +"محلی دارد (که اغلب برای انعطاف‌پذیری از یک فایل سیستمی خوانده می‌شود) و تنها " +"منبع خرد واقعی در این زمینه است." -msgid "The precision of the various real-time functions may be less than suggested by the units in which their value or argument is expressed. E.g. on most Unix systems, the clock \"ticks\" only 50 or 100 times a second." +msgid "" +"The precision of the various real-time functions may be less than suggested by " +"the units in which their value or argument is expressed. E.g. on most Unix " +"systems, the clock \"ticks\" only 50 or 100 times a second." msgstr "" +"دقت تابع‌های مختلف زمان واقعی ممکن است کمتر از میزانی باشد که واحدهای بیان‌کننده‌ی " +"مقدار یا آرگومان آن‌ها پیشنهاد می‌دهند. برای مثال، در بیشتر سیستم‌های Unix، ساعت " +"تنها ۵۰ یا ۱۰۰ بار در ثانیه «تیک» می‌خورد." -msgid "On the other hand, the precision of :func:`.time` and :func:`sleep` is better than their Unix equivalents: times are expressed as floating-point numbers, :func:`.time` returns the most accurate time available (using Unix :c:func:`!gettimeofday` where available), and :func:`sleep` will accept a time with a nonzero fraction (Unix :c:func:`!select` is used to implement this, where available)." -msgstr "" +msgid "" +"On the other hand, the precision of :func:`.time` and :func:`sleep` is better " +"than their Unix equivalents: times are expressed as floating-point " +"numbers, :func:`.time` returns the most accurate time available (using " +"Unix :c:func:`!gettimeofday` where available), and :func:`sleep` will accept a " +"time with a nonzero fraction (Unix :c:func:`!select` is used to implement " +"this, where available)." +msgstr "" +"از سوی دیگر، دقت :func:`.time` و :func:`sleep` بهتر از معادل‌های آن‌ها در یونیکس " +"است: زمان‌ها به‌صورت اعداد ممیز شناور بیان می‌شوند، :func:`.time` دقیق‌ترین زمان " +"در دسترس را برمی‌گرداند (در صورت در دسترس بودن، از :c:func:`!gettimeofday` " +"یونیکس استفاده می‌شود) و :func:`sleep` زمانی با بخش کسری غیرصفر را می‌پذیرد " +"(برای پیاده‌سازی این امکان، در صورت در دسترس بودن، از :c:func:`!select` یونیکس " +"استفاده می‌شود)." -msgid "The time value as returned by :func:`gmtime`, :func:`localtime`, and :func:`strptime`, and accepted by :func:`asctime`, :func:`mktime` and :func:`strftime`, is a sequence of 9 integers. The return values of :func:`gmtime`, :func:`localtime`, and :func:`strptime` also offer attribute names for individual fields." -msgstr "" +msgid "" +"The time value as returned by :func:`gmtime`, :func:`localtime`, " +"and :func:`strptime`, and accepted by :func:`asctime`, :func:`mktime` " +"and :func:`strftime`, is a sequence of 9 integers. The return values " +"of :func:`gmtime`, :func:`localtime`, and :func:`strptime` also offer " +"attribute names for individual fields." +msgstr "" +"مقدار زمان که توسط :func:`gmtime`، :func:`localtime` و :func:`strptime` " +"بازگردانده می‌شود و توسط :func:`asctime`، :func:`mktime` و :func:`strftime` " +"پذیرفته می‌شود، دنباله‌ای از ۹ عدد صحیح است. مقادیر " +"بازگشتی :func:`gmtime`، :func:`localtime` و :func:`strptime` همچنین نام " +"ویژگی‌هایی را برای فیلدهای جداگانه ارائه می‌دهند." msgid "See :class:`struct_time` for a description of these objects." -msgstr "" +msgstr "برای شرح این اشیاء، :class:`struct_time` را ببینید." -msgid "The :class:`struct_time` type was extended to provide the :attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when platform supports corresponding ``struct tm`` members." +msgid "" +"The :class:`struct_time` type was extended to provide " +"the :attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes " +"when platform supports corresponding ``struct tm`` members." msgstr "" +"نوع :class:`struct_time` گسترش یافت تا ویژگی‌های :attr:`~struct_time.tm_gmtoff` " +"و :attr:`~struct_time.tm_zone` را در صورتی که پلتفرم از اعضای متناظر ``struct " +"tm`` پشتیبانی کند، فراهم کند." -msgid "The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` are now available on all platforms." +msgid "" +"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` " +"and :attr:`~struct_time.tm_zone` are now available on all platforms." msgstr "" +"ویژگی‌های :attr:`~struct_time.tm_gmtoff` و :attr:`~struct_time.tm_zone` از " +"کلاس :class:`struct_time` اکنون در همه‌ی سکوها در دسترس هستند." msgid "Use the following functions to convert between time representations:" -msgstr "" +msgstr "برای تبدیل بین بازنمایی‌های زمان از توابع زیر استفاده کنید:" msgid "From" -msgstr "" +msgstr "از" msgid "To" -msgstr "" +msgstr "به" msgid "Use" -msgstr "" +msgstr "استفاده" msgid "seconds since the epoch" -msgstr "" +msgstr "ثانیه‌های سپری‌شده از مبدأ زمان" msgid ":class:`struct_time` in UTC" -msgstr "" +msgstr ":class:`struct_time` در UTC" msgid ":func:`gmtime`" -msgstr "" +msgstr ":func:`gmtime`" msgid ":class:`struct_time` in local time" -msgstr "" +msgstr ":class:`struct_time` در زمان محلی" msgid ":func:`localtime`" -msgstr "" +msgstr ":func:`localtime`" msgid ":func:`calendar.timegm`" -msgstr "" +msgstr ":func:`calendar.timegm`" msgid ":func:`mktime`" -msgstr "" +msgstr ":func:`mktime`" msgid "Functions" -msgstr "" +msgstr "توابع" -msgid "Convert a tuple or :class:`struct_time` representing a time as returned by :func:`gmtime` or :func:`localtime` to a string of the following form: ``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long and is space padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." -msgstr "" +msgid "" +"Convert a tuple or :class:`struct_time` representing a time as returned " +"by :func:`gmtime` or :func:`localtime` to a string of the following form: " +"``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long and is " +"space padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 " +"1993'``." +msgstr "" +"یک تاپل یا :class:`struct_time` را که نشان‌دهنده‌ی زمانی است که " +"توسط :func:`gmtime` یا :func:`localtime` برگردانده می‌شود، به رشته‌ای با قالب " +"زیر تبدیل می‌کند: ``'Sun Jun 20 23:21:05 1993'``. فیلد روز دو نویسه طول دارد و " +"اگر روز یک رقم باشد، با فاصله پر می‌شود، برای مثال: ``'Wed Jun 9 04:26:40 " +"1993'``." -msgid "If *t* is not provided, the current time as returned by :func:`localtime` is used. Locale information is not used by :func:`asctime`." +msgid "" +"If *t* is not provided, the current time as returned by :func:`localtime` is " +"used. Locale information is not used by :func:`asctime`." msgstr "" +"اگر *t* ارائه نشده باشد، از زمان جاری که توسط :func:`localtime` برگردانده شده " +"است استفاده می‌شود. :func:`asctime` از اطلاعات Locale استفاده نمی‌کند." -msgid "Unlike the C function of the same name, :func:`asctime` does not add a trailing newline." +msgid "" +"Unlike the C function of the same name, :func:`asctime` does not add a " +"trailing newline." msgstr "" +"برخلاف تابع C با همین نام، :func:`asctime` یک نویسه خط جدید پایانی اضافه " +"نمی‌کند." -msgid "Return the *clk_id* of the thread-specific CPU-time clock for the specified *thread_id*." +msgid "" +"Return the *clk_id* of the thread-specific CPU-time clock for the specified " +"*thread_id*." msgstr "" +"*clk_id* ساعت زمان پردازنده‌ی مختص به نخ برای *thread_id* مشخص‌شده را برمی‌گرداند." -msgid "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` attribute of :class:`threading.Thread` objects to get a suitable value for *thread_id*." +msgid "" +"Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " +"attribute of :class:`threading.Thread` objects to get a suitable value for " +"*thread_id*." msgstr "" +"برای به دست آوردن یک مقدار مناسب برای *thread_id*، " +"از :func:`threading.get_ident` یا ویژگی :attr:`~threading.Thread.ident` " +"اشیای :class:`threading.Thread` استفاده کنید." -msgid "Passing an invalid or expired *thread_id* may result in undefined behavior, such as segmentation fault." +msgid "" +"Passing an invalid or expired *thread_id* may result in undefined behavior, " +"such as segmentation fault." msgstr "" +"ارسال یک *thread_id* نامعتبر یا منقضی‌شده ممکن است منجر به رفتار تعریف‌نشده شود، " +"مانند خطای قطعه‌بندی (segmentation fault)." msgid "Availability" -msgstr "" +msgstr "دسترس‌پذیری" -msgid "See the man page for :manpage:`pthread_getcpuclockid(3)` for further information." +msgid "" +"See the man page for :manpage:`pthread_getcpuclockid(3)` for further " +"information." msgstr "" +"برای اطلاعات بیشتر، صفحه man مربوط به :manpage:`pthread_getcpuclockid(3)` را " +"ببینید." -msgid "Return the resolution (precision) of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." +msgid "" +"Return the resolution (precision) of the specified clock *clk_id*. Refer " +"to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." msgstr "" +"دقت (precision) ساعت مشخص‌شده با *clk_id* را برمی‌گرداند. برای فهرستی از مقادیر " +"پذیرفته‌شده برای *clk_id* به :ref:`time-clock-id-constants` مراجعه کنید." -msgid "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." +msgid "" +"Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-id-" +"constants` for a list of accepted values for *clk_id*." msgstr "" +"زمان ساعت مشخص‌شده با *clk_id* را برمی‌گرداند. برای فهرستی از مقادیر پذیرفته‌شده " +"برای *clk_id* به :ref:`time-clock-id-constants` مراجعه کنید." -msgid "Use :func:`clock_gettime_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`clock_gettime_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، " +"از :func:`clock_gettime_ns` استفاده کنید." msgid "Similar to :func:`clock_gettime` but return time as nanoseconds." msgstr "" +"مشابه :func:`clock_gettime` است، اما زمان را به‌صورت نانوثانیه برمی‌گرداند." -msgid "Set the time of the specified clock *clk_id*. Currently, :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*." +msgid "" +"Set the time of the specified clock *clk_id*. " +"Currently, :data:`CLOCK_REALTIME` is the only accepted value for *clk_id*." msgstr "" +"زمان ساعت مشخص‌شده با *clk_id* را تنظیم کنید. در حال " +"حاضر، :data:`CLOCK_REALTIME` تنها مقدار پذیرفته‌شده برای *clk_id* است." -msgid "Use :func:`clock_settime_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`clock_settime_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای اجتناب از کاهش دقت ناشی از نوع :class:`float`، " +"از :func:`clock_settime_ns` استفاده کنید." msgid "Similar to :func:`clock_settime` but set time with nanoseconds." -msgstr "" +msgstr "مشابه :func:`clock_settime` است، اما زمان را با نانوثانیه تنظیم می‌کند." -msgid "Convert a time expressed in seconds since the epoch_ to a string of a form: ``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field is two characters long and is space padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." +msgid "" +"Convert a time expressed in seconds since the epoch_ to a string of a form: " +"``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field is two " +"characters long and is space padded if the day is a single digit, e.g.: ``'Wed " +"Jun 9 04:26:40 1993'``." msgstr "" +"زمانی را که بر حسب ثانیه‌های سپری‌شده از epoch_ بیان شده است، به رشته‌ای با قالب " +"``'Sun Jun 20 23:21:05 1993'`` تبدیل می‌کند که زمان محلی را نشان می‌دهد. طول " +"فیلد روز دو نویسه است و اگر روز تک‌رقمی باشد، با فضا پر می‌شود، برای مثال: " +"``'Wed Jun 9 04:26:40 1993'``." -msgid "If *secs* is not provided or :const:`None`, the current time as returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to ``asctime(localtime(secs))``. Locale information is not used by :func:`ctime`." +msgid "" +"If *secs* is not provided or :const:`None`, the current time as returned " +"by :func:`.time` is used. ``ctime(secs)`` is equivalent to " +"``asctime(localtime(secs))``. Locale information is not used by :func:`ctime`." msgstr "" +"اگر *secs* ارائه‌نشده باشد یا :const:`None` باشد، از زمان جاری برگردانده‌شده " +"توسط :func:`.time` استفاده می‌شود. ``ctime(secs)`` معادل " +"``asctime(localtime(secs))`` است. اطلاعات locale (Locale) توسط :func:`ctime` " +"استفاده نمی‌شود." -msgid "Get information on the specified clock as a namespace object. Supported clock names and the corresponding functions to read their value are:" +msgid "" +"Get information on the specified clock as a namespace object. Supported clock " +"names and the corresponding functions to read their value are:" msgstr "" +"اطلاعات مربوط به ساعت مشخص‌شده را به‌عنوان یک شیء فضای نام دریافت کنید. نام‌های " +"ساعت پشتیبانی‌شده و توابع متناظر برای خواندن مقدار آن‌ها عبارتند از:" msgid "``'monotonic'``: :func:`time.monotonic`" -msgstr "" +msgstr "``'monotonic'``: :func:`time.monotonic`" msgid "``'perf_counter'``: :func:`time.perf_counter`" -msgstr "" +msgstr "``'perf_counter'``: :func:`time.perf_counter`" msgid "``'process_time'``: :func:`time.process_time`" -msgstr "" +msgstr "``'process_time'``: :func:`time.process_time`" msgid "``'thread_time'``: :func:`time.thread_time`" -msgstr "" +msgstr "``'thread_time'``: :func:`time.thread_time`" msgid "``'time'``: :func:`time.time`" -msgstr "" +msgstr "``'time'``: :func:`time.time`" msgid "The result has the following attributes:" -msgstr "" +msgstr "نتیجه دارای ویژگی‌های زیر است:" -msgid "*adjustable*: ``True`` if the clock can be set to jump forward or backward in time, ``False`` otherwise. Does not refer to gradual NTP rate adjustments." +msgid "" +"*adjustable*: ``True`` if the clock can be set to jump forward or backward in " +"time, ``False`` otherwise. Does not refer to gradual NTP rate adjustments." msgstr "" +"*adjustable*: اگر بتوان ساعت را به‌گونه‌ای تنظیم کرد که در زمان به جلو یا عقب " +"بپرد، ``True`` و در غیر این صورت ``False`` است. به تنظیم‌های تدریجی نرخ NTP " +"اشاره نمی‌کند." -msgid "*implementation*: The name of the underlying C function used to get the clock value. Refer to :ref:`time-clock-id-constants` for possible values." +msgid "" +"*implementation*: The name of the underlying C function used to get the clock " +"value. Refer to :ref:`time-clock-id-constants` for possible values." msgstr "" +"*implementation*: نام تابع C زیربنایی که برای گرفتن مقدار ساعت استفاده می‌شود. " +"برای مقادیر ممکن، به :ref:`time-clock-id-constants` مراجعه کنید." -msgid "*monotonic*: ``True`` if the clock cannot go backward, ``False`` otherwise" +msgid "" +"*monotonic*: ``True`` if the clock cannot go backward, ``False`` otherwise" msgstr "" +"*monotonic*: ``True`` اگر ساعت نتواند به عقب برود، در غیر این صورت ``False``" msgid "*resolution*: The resolution of the clock in seconds (:class:`float`)" -msgstr "" +msgstr "*resolution*: دقت ساعت بر حسب ثانیه (:class:`float`)" -msgid "Convert a time expressed in seconds since the epoch_ to a :class:`struct_time` in UTC in which the dst flag is always zero. If *secs* is not provided or :const:`None`, the current time as returned by :func:`.time` is used. Fractions of a second are ignored. See above for a description of the :class:`struct_time` object. See :func:`calendar.timegm` for the inverse of this function." -msgstr "" +msgid "" +"Convert a time expressed in seconds since the epoch_ to a :class:`struct_time` " +"in UTC in which the dst flag is always zero. If *secs* is not provided " +"or :const:`None`, the current time as returned by :func:`.time` is used. " +"Fractions of a second are ignored. See above for a description of " +"the :class:`struct_time` object. See :func:`calendar.timegm` for the inverse " +"of this function." +msgstr "" +"زمانی را که به‌صورت ثانیه‌های سپری‌شده از epoch_ بیان شده است، به " +"یک :class:`struct_time` در UTC تبدیل می‌کند که در آن پرچم dst همیشه صفر است. " +"اگر *secs* ارائه نشود یا :const:`None` باشد، از زمان جاری که :func:`.time` " +"برمی‌گرداند، استفاده می‌شود. کسرهای ثانیه نادیده گرفته می‌شوند. برای شرح " +"شیء :class:`struct_time`، به بالا مراجعه کنید. برای معکوس این " +"تابع، :func:`calendar.timegm` را ببینید." -msgid "Like :func:`gmtime` but converts to local time. If *secs* is not provided or :const:`None`, the current time as returned by :func:`.time` is used. The dst flag is set to ``1`` when DST applies to the given time." +msgid "" +"Like :func:`gmtime` but converts to local time. If *secs* is not provided " +"or :const:`None`, the current time as returned by :func:`.time` is used. The " +"dst flag is set to ``1`` when DST applies to the given time." msgstr "" +"مانند :func:`gmtime` است، اما زمان را به زمان محلی تبدیل می‌کند. اگر *secs* " +"ارائه نشده باشد یا :const:`None` باشد، از زمان فعلی که توسط :func:`.time` " +"برگردانده می‌شود استفاده می‌شود. پرچم dst زمانی که DST برای زمان داده‌شده اعمال " +"می‌شود، روی ``1`` تنظیم می‌شود." -msgid ":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is outside the range of values supported by the platform C :c:func:`localtime` or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :c:func:`gmtime` failure. It's common for this to be restricted to years between 1970 and 2038." -msgstr "" +msgid "" +":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is outside " +"the range of values supported by the platform C :c:func:`localtime` " +"or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` " +"or :c:func:`gmtime` failure. It's common for this to be restricted to years " +"between 1970 and 2038." +msgstr "" +":func:`localtime` ممکن است در صورتی که برچسب زمانی (timestamp) خارج از محدوده " +"مقادیر پشتیبانی‌شده توسط توابع C سکو یعنی :c:func:`localtime` " +"یا :c:func:`gmtime` باشد، :exc:`OverflowError` را پرتاب کند، و در صورت " +"شکست :c:func:`localtime` یا :c:func:`gmtime` نیز :exc:`OSError` را پرتاب کند. " +"معمولاً این محدوده به سال‌های بین ۱۹۷۰ تا ۲۰۳۸ محدود است." -msgid "This is the inverse function of :func:`localtime`. Its argument is the :class:`struct_time` or full 9-tuple (since the dst flag is needed; use ``-1`` as the dst flag if it is unknown) which expresses the time in *local* time, not UTC. It returns a floating-point number, for compatibility with :func:`.time`. If the input value cannot be represented as a valid time, either :exc:`OverflowError` or :exc:`ValueError` will be raised (which depends on whether the invalid value is caught by Python or the underlying C libraries). The earliest date for which it can generate a time is platform-dependent." -msgstr "" +msgid "" +"This is the inverse function of :func:`localtime`. Its argument is " +"the :class:`struct_time` or full 9-tuple (since the dst flag is needed; use " +"``-1`` as the dst flag if it is unknown) which expresses the time in *local* " +"time, not UTC. It returns a floating-point number, for compatibility " +"with :func:`.time`. If the input value cannot be represented as a valid time, " +"either :exc:`OverflowError` or :exc:`ValueError` will be raised (which depends " +"on whether the invalid value is caught by Python or the underlying C " +"libraries). The earliest date for which it can generate a time is platform-" +"dependent." +msgstr "" +"این تابع معکوس :func:`localtime` است. آرگومان آن یک :class:`struct_time` یا ۹-" +"تایی کامل است (زیرا به پرچم dst نیاز است؛ اگر ناشناخته است، از ``-1`` به‌عنوان " +"پرچم dst استفاده کنید) که زمان را به‌وقت *محلی* بیان می‌کند، نه UTC. این تابع یک " +"عدد اعشاری برمی‌گرداند تا با :func:`.time` سازگار باشد. اگر مقدار ورودی نتواند " +"به‌عنوان یک زمان معتبر بازنمایی شود، یکی از :exc:`OverflowError` " +"یا :exc:`ValueError` پرتاب خواهد شد (که بستگی دارد به اینکه مقدار نامعتبر توسط " +"پایتون تشخیص داده شود یا توسط کتابخانه‌های C زیرین). زودترین تاریخی که می‌تواند " +"برای آن یک زمان تولید کند، به پلتفرم وابسته است." -msgid "Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid." +msgid "" +"Return the value (in fractional seconds) of a monotonic clock, i.e. a clock " +"that cannot go backwards. The clock is not affected by system clock updates. " +"The reference point of the returned value is undefined, so that only the " +"difference between the results of two calls is valid." msgstr "" +"مقدار (بر حسب ثانیه‌های کسری) یک ساعت یکنواخت (monotonic clock) را برمی‌گرداند، " +"یعنی ساعتی که نمی‌تواند به عقب برگردد. این ساعت تحت تأثیر به‌روزرسانی‌های ساعت " +"سیستم قرار نمی‌گیرد. نقطه مرجع مقدار برگردانده‌شده تعریف‌نشده است، بنابراین تنها " +"اختلاف میان نتایج دو فراخوانی معتبر است." msgid "Clock:" -msgstr "" +msgstr "ساعت:" -msgid "On Windows, call ``QueryPerformanceCounter()`` and ``QueryPerformanceFrequency()``." +msgid "" +"On Windows, call ``QueryPerformanceCounter()`` and " +"``QueryPerformanceFrequency()``." msgstr "" +"در ویندوز، ``QueryPerformanceCounter()`` و ``QueryPerformanceFrequency()`` را " +"فراخوانی کنید." msgid "On macOS, call ``mach_absolute_time()`` and ``mach_timebase_info()``." msgstr "" +"در macOS، ``mach_absolute_time()`` و ``mach_timebase_info()`` را فراخوانی کنید." msgid "On HP-UX, call ``gethrtime()``." -msgstr "" +msgstr "در HP-UX، ``gethrtime()`` را فراخوانی کنید." msgid "Call ``clock_gettime(CLOCK_HIGHRES)`` if available." msgstr "" +"در صورت در دسترس بودن، ``clock_gettime(CLOCK_HIGHRES)`` را فراخوانی می‌کند." msgid "Otherwise, call ``clock_gettime(CLOCK_MONOTONIC)``." -msgstr "" +msgstr "در غیر این صورت، ``clock_gettime(CLOCK_MONOTONIC)`` را فراخوانی کنید." -msgid "Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`monotonic_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، از :func:`monotonic_ns` " +"استفاده کنید." -msgid "The function is now always available and the clock is now the same for all processes." +msgid "" +"The function is now always available and the clock is now the same for all " +"processes." msgstr "" +"این تابع اکنون همیشه در دسترس است و ساعت اکنون برای همه فرایندها یکسان است." msgid "On macOS, the clock is now the same for all processes." -msgstr "" +msgstr "در macOS، اکنون ساعت برای همه‌ی فرایندها یکسان است." msgid "Similar to :func:`monotonic`, but return time as nanoseconds." -msgstr "" +msgstr "مشابه :func:`monotonic`، اما زمان را به‌صورت نانوثانیه برمی‌گرداند." -msgid "Return the value (in fractional seconds) of a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep. The clock is the same for all processes. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid." -msgstr "" +msgid "" +"Return the value (in fractional seconds) of a performance counter, i.e. a " +"clock with the highest available resolution to measure a short duration. It " +"does include time elapsed during sleep. The clock is the same for all " +"processes. The reference point of the returned value is undefined, so that " +"only the difference between the results of two calls is valid." +msgstr "" +"مقدار (بر حسب ثانیه‌های کسری) یک شمارنده کارایی (performance counter) را " +"برمی‌گرداند، یعنی ساعتی با بالاترین تفکیک‌پذیری در دسترس برای اندازه‌گیری یک " +"مدت‌زمان کوتاه. این شامل زمان سپری‌شده در حالت توقف نیز می‌شود. این ساعت برای همه " +"فرآیندها یکسان است. نقطه مرجع مقدار برگردانده‌شده تعریف‌نشده است، بنابراین تنها " +"تفاوت بین نتایج دو فراخوانی معتبر است." -msgid "On CPython, use the same clock as :func:`time.monotonic` and is a monotonic clock, i.e. a clock that cannot go backwards." +msgid "" +"On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " +"clock, i.e. a clock that cannot go backwards." msgstr "" +"در CPython، از همان ساعت :func:`time.monotonic` استفاده می‌کند و یک ساعت " +"یکنواخت است، یعنی ساعتی که نمی‌تواند به عقب بازگردد." -msgid "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`perf_counter_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، " +"از :func:`perf_counter_ns` استفاده کنید." msgid "On Windows, the clock is now the same for all processes." -msgstr "" +msgstr "در ویندوز، ساعت اکنون برای همه فرایندها یکسان است." msgid "Use the same clock as :func:`time.monotonic`." msgstr "" +"از همان ساعتی استفاده می‌کند که :func:`time.monotonic` از آن استفاده می‌کند." msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." -msgstr "" +msgstr "مشابه :func:`perf_counter`، اما زمان را به‌صورت نانوثانیه بازمی‌گرداند." -msgid "Return the value (in fractional seconds) of the sum of the system and user CPU time of the current process. It does not include time elapsed during sleep. It is process-wide by definition. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid." +msgid "" +"Return the value (in fractional seconds) of the sum of the system and user CPU " +"time of the current process. It does not include time elapsed during sleep. " +"It is process-wide by definition. The reference point of the returned value " +"is undefined, so that only the difference between the results of two calls is " +"valid." msgstr "" +"مقدار (بر حسب ثانیه‌های کسری) مجموع زمان CPU سیستم و کاربر برای فرایند جاری را " +"برمی‌گرداند. این شامل زمان سپری‌شده در حالت توقف نمی‌شود. طبق تعریف، این زمان در سطح " +"کل فرایند است. نقطه مرجع مقدار بازگشتی تعریف‌نشده است، بنابراین تنها تفاوت میان " +"نتایج دو فراخوانی معتبر است." -msgid "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`process_time_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، " +"از :func:`process_time_ns` استفاده کنید." msgid "Similar to :func:`process_time` but return time as nanoseconds." -msgstr "" +msgstr "مشابه :func:`process_time` اما زمان را به‌صورت نانوثانیه برمی‌گرداند." -msgid "Suspend execution of the calling thread for the given number of seconds. The argument may be a floating-point number to indicate a more precise sleep time." +msgid "" +"Suspend execution of the calling thread for the given number of seconds. The " +"argument may be a floating-point number to indicate a more precise sleep time." msgstr "" +"اجرای نخ فراخواننده را برای تعداد ثانیه‌های داده‌شده به حالت تعلیق درمی‌آورد. " +"آرگومان می‌تواند یک عدد ممیز شناور باشد تا زمان توقف دقیق‌تری را مشخص کند." -msgid "If the sleep is interrupted by a signal and no exception is raised by the signal handler, the sleep is restarted with a recomputed timeout." +msgid "" +"If the sleep is interrupted by a signal and no exception is raised by the " +"signal handler, the sleep is restarted with a recomputed timeout." msgstr "" +"اگر sleep بر اثر یک سیگنال دچار وقفه شود و مدیر سیگنال استثنایی پرتاب نکند، " +"sleep با مهلت زمانی بازمحاسبه‌شده دوباره آغاز می‌شود." -msgid "The suspension time may be longer than requested by an arbitrary amount, because of the scheduling of other activity in the system." +msgid "" +"The suspension time may be longer than requested by an arbitrary amount, " +"because of the scheduling of other activity in the system." msgstr "" +"ممکن است زمان تعلیق، به دلیل زمان‌بندی سایر فعالیت‌ها در سیستم، به مقدار دلخواهی " +"بیشتر از زمان درخواست‌شده باشد." msgid "Windows implementation" -msgstr "" +msgstr "پیاده‌سازی ویندوز" -msgid "On Windows, if *secs* is zero, the thread relinquishes the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready to run, the function returns immediately, and the thread continues execution. On Windows 10 and newer the implementation uses a `high-resolution timer `_ which provides resolution of 100 nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." -msgstr "" +msgid "" +"On Windows, if *secs* is zero, the thread relinquishes the remainder of its " +"time slice to any other thread that is ready to run. If there are no other " +"threads ready to run, the function returns immediately, and the thread " +"continues execution. On Windows 10 and newer the implementation uses a `high-" +"resolution timer `_ which provides resolution of 100 " +"nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." +msgstr "" +"در ویندوز، اگر *secs* صفر باشد، نخ باقی‌مانده‌ی برش زمانی خود را به هر نخ دیگری " +"که آماده‌ی اجرا باشد واگذار می‌کند. اگر هیچ نخ دیگری آماده‌ی اجرا نباشد، تابع " +"بلافاصله بازمی‌گردد و نخ به اجرا ادامه می‌دهد. در ویندوز 10 و نسخه‌های جدیدتر، " +"پیاده‌سازی از یک `زمان‌سنج با دقت بالا `_ استفاده می‌کند که دقت " +"۱۰۰ نانوثانیه‌ای فراهم می‌کند. اگر *secs* صفر باشد، از ``Sleep(0)`` استفاده " +"می‌شود." msgid "Unix implementation" -msgstr "" +msgstr "پیاده‌سازی یونیکس" msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" +"اگر ``clock_nanosleep()`` در دسترس است، از آن استفاده کنید (دقت: ۱ نانوثانیه)؛" msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" +"یا در صورت در دسترس بودن از ``nanosleep()`` استفاده کنید (دقت: ۱ نانوثانیه)؛" msgid "Or use ``select()`` (resolution: 1 microsecond)." -msgstr "" +msgstr "یا از ``select()`` استفاده کنید (دقت: ۱ میکروثانیه)." msgid "To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." msgstr "" +"برای شبیه‌سازی یک «عملیات بی‌اثر» (no-op)، به جای ``time.sleep(0)`` " +"از :keyword:`pass` استفاده کنید." -msgid "To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling policy ` and use :func:`os.sched_yield` instead." +msgid "" +"To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling policy " +"` and use :func:`os.sched_yield` instead." msgstr "" +"برای رها کردن داوطلبانه‌ی CPU، یک :ref:`سیاست زمان‌بندی بلادرنگ ` مشخص کنید و در عوض از :func:`os.sched_yield` استفاده کنید." -msgid "Raises an :ref:`auditing event ` ``time.sleep`` with argument ``secs``." +msgid "" +"Raises an :ref:`auditing event ` ``time.sleep`` with argument " +"``secs``." msgstr "" +"یک :ref:`رویداد حسابرسی ` ``time.sleep`` را با آرگومان ``secs`` " +"پرتاب می‌کند." -msgid "The function now sleeps at least *secs* even if the sleep is interrupted by a signal, except if the signal handler raises an exception (see :pep:`475` for the rationale)." +msgid "" +"The function now sleeps at least *secs* even if the sleep is interrupted by a " +"signal, except if the signal handler raises an exception (see :pep:`475` for " +"the rationale)." msgstr "" +"این تابع اکنون حداقل به مدت *secs* متوقف میشود حتی اگر این توقف با یک سیگنال قطع " +"شود، مگر در صورتی که هندلر سیگنال استثنایی پرتاب کند (برای آگاهی از " +"دلیل، :pep:`475` را ببینید)." -msgid "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now used if available. On Windows, a waitable timer is now used." +msgid "" +"On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now used " +"if available. On Windows, a waitable timer is now used." msgstr "" +"در یونیکس، اکنون در صورت در دسترس بودن، از تابع‌های ``clock_nanosleep()`` و " +"``nanosleep()`` استفاده می‌شود. در ویندوز، اکنون از یک زمان‌سنج انتظارپذیر " +"(waitable timer) استفاده می‌شود." msgid "Raises an auditing event." -msgstr "" +msgstr "یک رویداد حسابرسی را پرتاب می‌کند." -msgid "Convert a tuple or :class:`struct_time` representing a time as returned by :func:`gmtime` or :func:`localtime` to a string as specified by the *format* argument. If *t* is not provided, the current time as returned by :func:`localtime` is used. *format* must be a string. :exc:`ValueError` is raised if any field in *t* is outside of the allowed range." -msgstr "" +msgid "" +"Convert a tuple or :class:`struct_time` representing a time as returned " +"by :func:`gmtime` or :func:`localtime` to a string as specified by the " +"*format* argument. If *t* is not provided, the current time as returned " +"by :func:`localtime` is used. *format* must be a string. :exc:`ValueError` " +"is raised if any field in *t* is outside of the allowed range." +msgstr "" +"یک تاپل یا :class:`struct_time` را که نشان‌دهنده‌ی زمانی برگردانده‌شده " +"توسط :func:`gmtime` یا :func:`localtime` است، به رشته‌ای مطابق آنچه آرگومان " +"*format* مشخص می‌کند تبدیل می‌کند. اگر *t* ارائه نشود، زمان فعلی برگردانده‌شده " +"توسط :func:`localtime` استفاده می‌شود. *format* باید یک رشته باشد. اگر هر یک از " +"فیلدهای *t* خارج از محدوده‌ی مجاز باشد، :exc:`ValueError` پرتاب می‌شود." -msgid "0 is a legal argument for any position in the time tuple; if it is normally illegal the value is forced to a correct one." +msgid "" +"0 is a legal argument for any position in the time tuple; if it is normally " +"illegal the value is forced to a correct one." msgstr "" +"۰ یک آرگومان مجاز برای هر جایگاهی از تاپل زمانی است؛ اگر در حالت عادی غیرمجاز " +"باشد، مقدار به‌اجبار به مقداری درست تغییر می‌یابد." -msgid "The following directives can be embedded in the *format* string. They are shown without the optional field width and precision specification, and are replaced by the indicated characters in the :func:`strftime` result:" +msgid "" +"The following directives can be embedded in the *format* string. They are " +"shown without the optional field width and precision specification, and are " +"replaced by the indicated characters in the :func:`strftime` result:" msgstr "" +"می‌توان دایرکتیوهای زیر را در رشته‌ی *format* گنجاند. آن‌ها بدون مشخصه‌ی اختیاری عرض " +"فیلد و دقت نمایش داده شده‌اند و در نتیجه‌ی :func:`strftime` با نویسه‌های مشخص‌شده " +"جایگزین می‌شوند:" msgid "Directive" -msgstr "" +msgstr "دایرکتیو" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Notes" -msgstr "" +msgstr "یادداشت‌ها" msgid "``%a``" -msgstr "" +msgstr "``%a``" msgid "Locale's abbreviated weekday name." -msgstr "" +msgstr "نام کوتاه‌شده‌ی روز هفته بر اساس locale." msgid "``%A``" -msgstr "" +msgstr "``%A``" msgid "Locale's full weekday name." -msgstr "" +msgstr "نام کامل روز هفته بر اساس locale." msgid "``%b``" -msgstr "" +msgstr "``%b``" msgid "Locale's abbreviated month name." -msgstr "" +msgstr "نام کوتاه‌شده‌ی ماه در locale (Locale)." msgid "``%B``" -msgstr "" +msgstr "``%B``" msgid "Locale's full month name." -msgstr "" +msgstr "نام کامل ماهِ تنظیمات locale (Locale)." msgid "``%c``" -msgstr "" +msgstr "``%c``" msgid "Locale's appropriate date and time representation." -msgstr "" +msgstr "نمایش مناسب تاریخ و زمان متناسب با تنظیمات locale (Locale)." msgid "``%d``" -msgstr "" +msgstr "``%d``" msgid "Day of the month as a decimal number [01,31]." -msgstr "" +msgstr "روز ماه به‌صورت عدد دهدهی [01,31]." msgid "``%f``" -msgstr "" +msgstr "``%f``" msgid "Microseconds as a decimal number" -msgstr "" +msgstr "میکروثانیه به‌صورت عدد اعشاری" msgid "[000000,999999]." -msgstr "" +msgstr "[000000,999999]." msgid "\\(1)" -msgstr "" +msgstr "\\(1)" msgid "``%H``" -msgstr "" +msgstr "``%H``" msgid "Hour (24-hour clock) as a decimal number [00,23]." -msgstr "" +msgstr "ساعت (بر اساس ساعت ۲۴ساعته) به‌صورت عدد ده‌دهی [00,23]." msgid "``%I``" -msgstr "" +msgstr "``%I``" msgid "Hour (12-hour clock) as a decimal number [01,12]." -msgstr "" +msgstr "ساعت (ساعت ۱۲ ساعته) به‌صورت عدد دهدهی [01,12]." msgid "``%j``" -msgstr "" +msgstr "``%j``" msgid "Day of the year as a decimal number [001,366]." -msgstr "" +msgstr "روز سال به‌صورت عدد دهدهی [001,366]." msgid "``%m``" -msgstr "" +msgstr "``%m``" msgid "Month as a decimal number [01,12]." -msgstr "" +msgstr "ماه به‌صورت عدد دهدهی [01,12]." msgid "``%M``" -msgstr "" +msgstr "``%M``" msgid "Minute as a decimal number [00,59]." -msgstr "" +msgstr "دقیقه به‌صورت عدد دهدهی [00,59]." msgid "``%p``" -msgstr "" +msgstr "``%p``" msgid "Locale's equivalent of either AM or PM." -msgstr "" +msgstr "معادل locale (locale) برای AM یا PM." msgid "\\(2)" -msgstr "" +msgstr "\\(2)" msgid "``%S``" -msgstr "" +msgstr "``%S``" msgid "Second as a decimal number [00,61]." -msgstr "" +msgstr "ثانیه به‌صورت عدد دهدهی [00,61]." msgid "\\(3)" -msgstr "" +msgstr "\\(3)" msgid "``%U``" -msgstr "" +msgstr "``%U``" -msgid "Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0." +msgid "" +"Week number of the year (Sunday as the first day of the week) as a decimal " +"number [00,53]. All days in a new year preceding the first Sunday are " +"considered to be in week 0." msgstr "" +"شماره‌ی هفته‌ی سال (یکشنبه به‌عنوان اولین روز هفته) به‌صورت عدد اعشاری [۰۰،۵۳]. همه‌ی " +"روزهای سال جدید پیش از اولین یکشنبه، در هفته‌ی ۰ محسوب می‌شوند." msgid "\\(4)" -msgstr "" +msgstr "\\(4)" msgid "``%u``" -msgstr "" +msgstr "``%u``" msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." -msgstr "" +msgstr "روز هفته (دوشنبه ۱ است؛ یکشنبه ۷ است) به‌صورت عدد دهدهی [۱، ۷]." msgid "``%w``" -msgstr "" +msgstr "``%w``" msgid "Weekday as a decimal number [0(Sunday),6]." -msgstr "" +msgstr "روز هفته به‌صورت عدد ده‌دهی [0(یکشنبه),6]." msgid "``%W``" -msgstr "" +msgstr "``%W``" -msgid "Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0." +msgid "" +"Week number of the year (Monday as the first day of the week) as a decimal " +"number [00,53]. All days in a new year preceding the first Monday are " +"considered to be in week 0." msgstr "" +"شماره‌ی هفته‌ی سال (دوشنبه به‌عنوان اولین روز هفته) به‌صورت عدد دهدهی [00,53]. همه‌ی " +"روزهای سال جدید پیش از اولین دوشنبه، در هفته‌ی ۰ در نظر گرفته می‌شوند." msgid "``%x``" -msgstr "" +msgstr "``%x``" msgid "Locale's appropriate date representation." -msgstr "" +msgstr "نمایش تاریخ مناسب با تنظیمات locale (locale)." msgid "``%X``" -msgstr "" +msgstr "``%X``" msgid "Locale's appropriate time representation." -msgstr "" +msgstr "نمایش زمان مناسب برای تنظیمات locale (locale)." msgid "``%y``" -msgstr "" +msgstr "``%y``" msgid "Year without century as a decimal number [00,99]." -msgstr "" +msgstr "سال بدون قرن به‌صورت عدد دهدهی [00,99]." msgid "``%Y``" -msgstr "" +msgstr "``%Y``" msgid "Year with century as a decimal number." -msgstr "" +msgstr "سال همراه با قرن به‌صورت عدد دهدهی." msgid "``%z``" -msgstr "" +msgstr "``%z``" -msgid "Time zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal minute digits [-23:59, +23:59]. [1]_" +msgid "" +"Time zone offset indicating a positive or negative time difference from UTC/" +"GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " +"represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" +"آفست منطقه زمانی که نشان‌دهنده‌ی اختلاف زمانی مثبت یا منفی نسبت به UTC/GMT به‌شکل " +"+HHMM یا -HHMM است، که در آن H نشان‌دهنده‌ی ارقام دهدهی ساعت و M نشان‌دهنده‌ی ارقام " +"دهدهی دقیقه است [-23:59, +23:59]. [1]_" msgid "``%Z``" -msgstr "" +msgstr "``%Z``" msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" +"نام منطقه‌ی زمانی (اگر منطقه‌ی زمانی وجود نداشته باشد، بدون نویسه). منسوخ. [1]_" msgid "``%G``" -msgstr "" +msgstr "``%G``" -msgid "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 calendar year). The year starts with the week that contains the first Thursday of the calendar year." +msgid "" +"ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " +"calendar year). The year starts with the week that contains the first Thursday " +"of the calendar year." msgstr "" +"سال ISO 8601 (مشابه ``%Y``، اما از قواعد سال گاه‌شماریی ISO 8601 پیروی می‌کند). سال " +"با هفته‌ای آغاز می‌شود که شامل اولین پنجشنبه‌ی سال گاه‌شماریی است." msgid "``%V``" -msgstr "" +msgstr "``%V``" -msgid "ISO 8601 week number (as a decimal number [01,53]). The first week of the year is the one that contains the first Thursday of the year. Weeks start on Monday." +msgid "" +"ISO 8601 week number (as a decimal number [01,53]). The first week of the year " +"is the one that contains the first Thursday of the year. Weeks start on Monday." msgstr "" +"شماره هفته ISO 8601 (به‌صورت عدد دهدهی [01,53]). نخستین هفته سال، هفته‌ای است که " +"نخستین پنجشنبه سال در آن قرار دارد. هفته‌ها از دوشنبه آغاز می‌شوند." msgid "``%%``" -msgstr "" +msgstr "``%%``" msgid "A literal ``'%'`` character." -msgstr "" +msgstr "یک نویسه‌ی تحت‌اللفظی ``'%'``." msgid "Notes:" -msgstr "" +msgstr "یادداشت‌ها:" -msgid "The ``%f`` format directive only applies to :func:`strptime`, not to :func:`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:`datetime.datetime.strftime` where the ``%f`` format directive :ref:`applies to microseconds `." +msgid "" +"The ``%f`` format directive only applies to :func:`strptime`, not " +"to :func:`strftime`. However, see also :meth:`datetime.datetime.strptime` " +"and :meth:`datetime.datetime.strftime` where the ``%f`` format " +"directive :ref:`applies to microseconds `." msgstr "" +"دایرکتیو قالب ``%f`` فقط در :func:`strptime` کاربرد دارد، نه در :func:`strftime`. " +"با این حال، :meth:`datetime.datetime.strptime` " +"و :meth:`datetime.datetime.strftime` را نیز ببینید که در آن‌ها دایرکتیو قالب " +"``%f`` :ref:`برای میکروثانیه‌ها کاربرد دارد `." -msgid "When used with the :func:`strptime` function, the ``%p`` directive only affects the output hour field if the ``%I`` directive is used to parse the hour." +msgid "" +"When used with the :func:`strptime` function, the ``%p`` directive only " +"affects the output hour field if the ``%I`` directive is used to parse the " +"hour." msgstr "" +"هنگامی که همراه با تابع :func:`strptime` استفاده شود، دایرکتیو ``%p`` تنها در " +"صورتی بر فیلد ساعت خروجی اثر می‌گذارد که از دایرکتیو ``%I`` برای تجزیه ساعت " +"استفاده شود." -msgid "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps representing `leap seconds`_ and value ``61`` is supported for historical reasons." +msgid "" +"The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " +"representing `leap seconds`_ and value ``61`` is supported for historical " +"reasons." msgstr "" +"بازه واقعاً از ``0`` تا ``61`` است؛ مقدار ``60`` در مهرهای زمانی که نمایانگر " +"`leap seconds`_ هستند معتبر است و مقدار ``61`` به دلایل تاریخی پشتیبانی می‌شود." -msgid "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only used in calculations when the day of the week and the year are specified." +msgid "" +"When used with the :func:`strptime` function, ``%U`` and ``%W`` are only used " +"in calculations when the day of the week and the year are specified." msgstr "" +"هنگامی که همراه با تابع :func:`strptime` استفاده شوند، ``%U`` و ``%W`` فقط " +"زمانی در محاسبات استفاده می‌شوند که روز هفته و سال تعیین شده باشند." -msgid "Here is an example, a format for dates compatible with that specified in the :rfc:`5322` Internet email standard. [1]_ ::" +msgid "" +"Here is an example, a format for dates compatible with that specified in " +"the :rfc:`5322` Internet email standard. [1]_ ::" msgstr "" +"در اینجا مثالی آورده شده است، قالبی برای تاریخ‌ها که با قالب تعیین‌شده در " +"استاندارد ایمیل اینترنتی :rfc:`5322` سازگار است. [1]_ ::" msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" msgstr "" +">>> from time import gmtime, strftime\n" +">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" +"'Thu, 28 Jun 2001 14:17:15 +0000'" -msgid "Additional directives may be supported on certain platforms, but only the ones listed here have a meaning standardized by ANSI C. To see the full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation." +msgid "" +"Additional directives may be supported on certain platforms, but only the ones " +"listed here have a meaning standardized by ANSI C. To see the full set of " +"format codes supported on your platform, consult the :manpage:`strftime(3)` " +"documentation." msgstr "" +"ممکن است دایرکتیوهای اضافی در برخی پلتفرم‌های خاص پشتیبانی شوند، اما تنها " +"موارد فهرست‌شده در اینجا دارای معنای استانداردشده توسط ANSI C هستند. برای " +"مشاهده مجموعه کامل کدهای قالب‌بندی پشتیبانی‌شده در پلتفرم شما، به " +"مستندات :manpage:`strftime(3)` مراجعه کنید." -msgid "On some platforms, an optional field width and precision specification can immediately follow the initial ``'%'`` of a directive in the following order; this is also not portable. The field width is normally 2 except for ``%j`` where it is 3." +msgid "" +"On some platforms, an optional field width and precision specification can " +"immediately follow the initial ``'%'`` of a directive in the following order; " +"this is also not portable. The field width is normally 2 except for ``%j`` " +"where it is 3." msgstr "" +"در برخی سکوها، می‌توان بلافاصله پس از ``'%'`` ابتدایی یک دایرکتیو، مشخصه‌ی اختیاری " +"عرض فیلد و دقت را با ترتیب زیر آورد؛ این مورد نیز غیرقابل حمل است. عرض فیلد " +"معمولاً ۲ است، به‌جز ``%j`` که ۳ است." -msgid "Parse a string representing a time according to a format. The return value is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." +msgid "" +"Parse a string representing a time according to a format. The return value is " +"a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" +"رشته‌ای را که نشان‌دهنده‌ی یک زمان است، بر اساس یک قالب تجزیه می‌کند. مقدار بازگشتی " +"یک :class:`struct_time` است، مانند مقداری که توسط :func:`gmtime` " +"یا :func:`localtime` بازگردانده می‌شود." -msgid "The *format* parameter uses the same directives as those used by :func:`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the formatting returned by :func:`ctime`. If *string* cannot be parsed according to *format*, or if it has excess data after parsing, :exc:`ValueError` is raised. The default values used to fill in any missing data when more accurate values cannot be inferred are ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``. Both *string* and *format* must be strings." -msgstr "" +msgid "" +"The *format* parameter uses the same directives as those used " +"by :func:`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches " +"the formatting returned by :func:`ctime`. If *string* cannot be parsed " +"according to *format*, or if it has excess data after " +"parsing, :exc:`ValueError` is raised. The default values used to fill in any " +"missing data when more accurate values cannot be inferred are ``(1900, 1, 1, " +"0, 0, 0, 0, 1, -1)``. Both *string* and *format* must be strings." +msgstr "" +"پارامتر *format* از همان دایرکتیوهایی استفاده می‌کند که در :func:`strftime` " +"به کار می‌روند؛ مقدار پیش‌فرض آن ``\"%a %b %d %H:%M:%S %Y\"`` است که با قالب‌بندی " +"برگردانده‌شده توسط :func:`ctime` مطابقت دارد. اگر *string* نتواند طبق *format* " +"تجزیه شود، یا اگر پس از تجزیه داده اضافی داشته باشد، :exc:`ValueError` پرتاب " +"می‌شود. مقادیر پیش‌فرضی که برای پر کردن هرگونه داده مفقود استفاده می‌شوند، در " +"صورتی که نتوان مقادیر دقیق‌تری را استنتاج کرد، ``(1900, 1, 1, 0, 0, 0, 0, 1, " +"-1)`` هستند. هر دو *string* و *format* باید رشته باشند." msgid "For example:" -msgstr "" +msgstr "برای مثال:" -msgid "Support for the ``%Z`` directive is based on the values contained in ``tzname`` and whether ``daylight`` is true. Because of this, it is platform-specific except for recognizing UTC and GMT which are always known (and are considered to be non-daylight savings timezones)." +msgid "" +"Support for the ``%Z`` directive is based on the values contained in " +"``tzname`` and whether ``daylight`` is true. Because of this, it is platform-" +"specific except for recognizing UTC and GMT which are always known (and are " +"considered to be non-daylight savings timezones)." msgstr "" +"پشتیبانی از دایرکتیو ``%Z`` بر پایه‌ی مقادیر موجود در ``tzname`` و این‌که " +"``daylight`` درست باشد، است. به همین دلیل، این پشتیبانی وابسته به پلتفرم است، " +"به‌جز برای شناسایی UTC و GMT که همیشه شناخته‌شده هستند (و به‌عنوان مناطق زمانی " +"بدون ساعت تابستانی در نظر گرفته می‌شوند)." -msgid "Only the directives specified in the documentation are supported. Because ``strftime()`` is implemented per platform it can sometimes offer more directives than those listed. But ``strptime()`` is independent of any platform and thus does not necessarily support all directives available that are not documented as supported." -msgstr "" +msgid "" +"Only the directives specified in the documentation are supported. Because " +"``strftime()`` is implemented per platform it can sometimes offer more " +"directives than those listed. But ``strptime()`` is independent of any " +"platform and thus does not necessarily support all directives available that " +"are not documented as supported." +msgstr "" +"فقط دایرکتیوهای مشخص‌شده در مستندات پشتیبانی می‌شوند. از آن‌جا که " +"``strftime()`` به ازای هر پلتفرم پیاده‌سازی شده است، گاهی می‌تواند دایرکتیوهای " +"بیشتری نسبت به موارد فهرست‌شده ارائه دهد. اما ``strptime()`` مستقل از هر پلتفرم " +"است و بنابراین لزوماً از همه دایرکتیوهای موجودی که به‌عنوان پشتیبانی‌شده مستند " +"نشده‌اند، پشتیبانی نمی‌کند." -msgid "The type of the time value sequence returned by :func:`gmtime`, :func:`localtime`, and :func:`strptime`. It is an object with a :term:`named tuple` interface: values can be accessed by index and by attribute name. The following values are present:" +msgid "" +"The type of the time value sequence returned " +"by :func:`gmtime`, :func:`localtime`, and :func:`strptime`. It is an object " +"with a :term:`named tuple` interface: values can be accessed by index and by " +"attribute name. The following values are present:" msgstr "" +"نوع دنباله‌ی مقادیر زمانی که توسط :func:`gmtime`، :func:`localtime` " +"و :func:`strptime` برگردانده می‌شود. این، شیءای با رابط :term:`named tuple` است: " +"می‌توان به مقادیر از طریق اندیس و نام ویژگی دسترسی داشت. مقادیر زیر موجود هستند:" msgid "Index" -msgstr "" +msgstr "اندیس" msgid "Attribute" -msgstr "" +msgstr "ویژگی" msgid "Values" -msgstr "" +msgstr "مقادیر" msgid "0" -msgstr "" +msgstr "0" msgid "(for example, 1993)" -msgstr "" +msgstr "(برای مثال، ۱۹۹۳)" msgid "1" -msgstr "" +msgstr "1" msgid "range [1, 12]" -msgstr "" +msgstr "بازه [1, 12]" msgid "2" -msgstr "" +msgstr "۲" msgid "range [1, 31]" -msgstr "" +msgstr "بازه [۱، ۳۱]" msgid "3" -msgstr "" +msgstr "3" msgid "range [0, 23]" -msgstr "" +msgstr "بازه [۰، ۲۳]" msgid "4" -msgstr "" +msgstr "4" msgid "range [0, 59]" -msgstr "" +msgstr "بازه [۰، ۵۹]" msgid "5" -msgstr "" +msgstr "5" msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" +"بازه [۰، ۶۱]؛ :ref:`یادداشت (۲) ` در :func:`strftime` را ببینید" msgid "6" -msgstr "" +msgstr "۶" msgid "range [0, 6]; Monday is 0" -msgstr "" +msgstr "بازه [۰، ۶]؛ دوشنبه ۰ است" msgid "7" -msgstr "" +msgstr "7" msgid "range [1, 366]" -msgstr "" +msgstr "بازه [1, 366]" msgid "8" -msgstr "" +msgstr "8" msgid "0, 1 or -1; see below" -msgstr "" +msgstr "۰، ۱ یا -۱؛ در زیر ببینید" msgid "N/A" -msgstr "" +msgstr "ناموجود" msgid "abbreviation of timezone name" -msgstr "" +msgstr "مخفف نام منطقه زمانی" msgid "offset east of UTC in seconds" -msgstr "" +msgstr "آفست شرقی از UTC به ثانیه" -msgid "Note that unlike the C structure, the month value is a range of [1, 12], not [0, 11]." +msgid "" +"Note that unlike the C structure, the month value is a range of [1, 12], not " +"[0, 11]." msgstr "" +"توجه داشته باشید که برخلاف ساختار C، مقدار ماه در بازه‌ی [۱، ۱۲] است، نه [۰، " +"۱۱]." -msgid "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight savings time is in effect, and 0 when it is not. A value of -1 indicates that this is not known, and will usually result in the correct state being filled in." +msgid "" +"In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " +"savings time is in effect, and 0 when it is not. A value of -1 indicates that " +"this is not known, and will usually result in the correct state being filled " +"in." msgstr "" +"در فراخوانی‌های :func:`mktime`، هرگاه ساعت تابستانی برقرار باشد، " +"می‌توان :attr:`tm_isdst` را روی ۱ تنظیم کرد و هرگاه برقرار نباشد، روی ۰. مقدار " +"-۱ نشان می‌دهد که این موضوع نامشخص است و معمولاً منجر به درج وضعیت صحیح می‌شود." -msgid "When a tuple with an incorrect length is passed to a function expecting a :class:`struct_time`, or having elements of the wrong type, a :exc:`TypeError` is raised." +msgid "" +"When a tuple with an incorrect length is passed to a function expecting " +"a :class:`struct_time`, or having elements of the wrong type, " +"a :exc:`TypeError` is raised." msgstr "" +"هنگامی که تاپلی با طول نادرست یا دارای عناصری از نوع اشتباه به تابعی که انتظار " +"یک :class:`struct_time` را دارد پاس داده شود، یک :exc:`TypeError` پرتاب می‌شود." -msgid "Return the time in seconds since the epoch_ as a floating-point number. The handling of `leap seconds`_ is platform dependent. On Windows and most Unix systems, the leap seconds are not counted towards the time in seconds since the epoch_. This is commonly referred to as `Unix time `_." -msgstr "" +msgid "" +"Return the time in seconds since the epoch_ as a floating-point number. The " +"handling of `leap seconds`_ is platform dependent. On Windows and most Unix " +"systems, the leap seconds are not counted towards the time in seconds since " +"the epoch_. This is commonly referred to as `Unix time `_." +msgstr "" +"زمان سپری‌شده از مبدأ زمانی (epoch_) را بر حسب ثانیه به‌صورت یک عدد اعشاری " +"برمی‌گرداند. نحوه‌ی مدیریت `ثانیه‌های کبیسه`_ به پلتفرم بستگی دارد. در ویندوز و " +"بیشتر سیستم‌های یونیکسی، ثانیه‌های کبیسه در شمار ثانیه‌های سپری‌شده از مبدأ زمانی " +"(epoch_) لحاظ نمی‌شوند. این معمولاً به‌عنوان `زمان یونیکس `_ شناخته می‌شود." -msgid "Note that even though the time is always returned as a floating-point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls." -msgstr "" +msgid "" +"Note that even though the time is always returned as a floating-point number, " +"not all systems provide time with a better precision than 1 second. While this " +"function normally returns non-decreasing values, it can return a lower value " +"than a previous call if the system clock has been set back between the two " +"calls." +msgstr "" +"توجه داشته باشید که با وجود اینکه زمان همیشه به‌صورت یک عدد ممیز شناور " +"برگردانده می‌شود، همه‌ی سیستم‌ها زمان را با دقتی بهتر از ۱ ثانیه ارائه نمی‌کنند. در " +"حالی که این تابع به‌طور معمول مقادیر غیرکاهشی برمی‌گرداند، اگر ساعت سیستم بین دو " +"فراخوانی به عقب تنظیم شده باشد، ممکن است مقداری کمتر از مقدار برگردانده‌شده در " +"یک فراخوانی قبلی برگرداند." -msgid "The number returned by :func:`.time` may be converted into a more common time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :func:`gmtime` function or in local time by passing it to the :func:`localtime` function. In both cases a :class:`struct_time` object is returned, from which the components of the calendar date may be accessed as attributes." -msgstr "" +msgid "" +"The number returned by :func:`.time` may be converted into a more common time " +"format (i.e. year, month, day, hour, etc...) in UTC by passing it " +"to :func:`gmtime` function or in local time by passing it to " +"the :func:`localtime` function. In both cases a :class:`struct_time` object is " +"returned, from which the components of the calendar date may be accessed as " +"attributes." +msgstr "" +"عدد برگردانده‌شده توسط :func:`.time` می‌تواند به یک قالب زمان رایج‌تر (یعنی سال، " +"ماه، روز، ساعت و غیره...) در UTC با ارسال آن به تابع :func:`gmtime`، یا در " +"زمان محلی با ارسال آن به تابع :func:`localtime` تبدیل شود. در هر دو حالت یک " +"شیء :class:`struct_time` برگردانده می‌شود که کامپوننت‌های تاریخ گاه‌شماریی به‌عنوان " +"ویژگی‌های آن قابل دسترسی هستند." msgid "On Windows, call ``GetSystemTimePreciseAsFileTime()``." -msgstr "" +msgstr "در ویندوز، ``GetSystemTimePreciseAsFileTime()`` را فراخوانی کنید." msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." -msgstr "" +msgstr "در صورت موجود بودن، ``clock_gettime(CLOCK_REALTIME)`` را فراخوانی کنید." msgid "Otherwise, call ``gettimeofday()``." -msgstr "" +msgstr "در غیر این صورت، ``gettimeofday()`` را فراخوانی کنید." -msgid "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " +"type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، از :func:`time_ns` " +"استفاده کنید." -msgid "On Windows, calls ``GetSystemTimePreciseAsFileTime()`` instead of ``GetSystemTimeAsFileTime()``." +msgid "" +"On Windows, calls ``GetSystemTimePreciseAsFileTime()`` instead of " +"``GetSystemTimeAsFileTime()``." msgstr "" +"در ویندوز، ``GetSystemTimePreciseAsFileTime()`` را به‌جای " +"``GetSystemTimeAsFileTime()`` فراخوانی می‌کند." -msgid "Similar to :func:`~time.time` but returns time as an integer number of nanoseconds since the epoch_." +msgid "" +"Similar to :func:`~time.time` but returns time as an integer number of " +"nanoseconds since the epoch_." msgstr "" +"مشابه :func:`~time.time` است، اما زمان را به‌صورت عدد صحیحی از نانوثانیه‌ها از " +"epoch_ برمی‌گرداند." -msgid "Return the value (in fractional seconds) of the sum of the system and user CPU time of the current thread. It does not include time elapsed during sleep. It is thread-specific by definition. The reference point of the returned value is undefined, so that only the difference between the results of two calls in the same thread is valid." +msgid "" +"Return the value (in fractional seconds) of the sum of the system and user CPU " +"time of the current thread. It does not include time elapsed during sleep. " +"It is thread-specific by definition. The reference point of the returned " +"value is undefined, so that only the difference between the results of two " +"calls in the same thread is valid." msgstr "" +"مقدار مجموع زمان CPU سیستم و کاربر برای نخ فعلی را (بر حسب ثانیه‌های کسری) " +"برمی‌گرداند. این مقدار شامل زمان سپری‌شده در طول توقف نمی‌شود. این مقدار طبق " +"تعریف مختص نخ است. نقطه مرجع مقدار برگردانده‌شده تعریف‌نشده است، بنابراین تنها " +"تفاوت میان نتایج دو فراخوانی در یک نخ معتبر است." -msgid "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:`float` type." +msgid "" +"Use :func:`thread_time_ns` to avoid the precision loss caused by " +"the :class:`float` type." msgstr "" +"برای جلوگیری از کاهش دقت ناشی از نوع :class:`float`، از :func:`thread_time_ns` " +"استفاده کنید." msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." -msgstr "" +msgstr "سیستم‌های یونیکسی که از ``CLOCK_THREAD_CPUTIME_ID`` پشتیبانی می‌کنند." msgid "Similar to :func:`thread_time` but return time as nanoseconds." -msgstr "" +msgstr "مشابه :func:`thread_time` است، اما زمان را به‌صورت نانوثانیه بازمی‌گرداند." -msgid "Reset the time conversion rules used by the library routines. The environment variable :envvar:`TZ` specifies how this is done. It will also set the variables ``tzname`` (from the :envvar:`TZ` environment variable), ``timezone`` (non-DST seconds West of UTC), ``altzone`` (DST seconds west of UTC) and ``daylight`` (to 0 if this timezone does not have any daylight saving time rules, or to nonzero if there is a time, past, present or future when daylight saving time applies)." -msgstr "" +msgid "" +"Reset the time conversion rules used by the library routines. The environment " +"variable :envvar:`TZ` specifies how this is done. It will also set the " +"variables ``tzname`` (from the :envvar:`TZ` environment variable), " +"``timezone`` (non-DST seconds West of UTC), ``altzone`` (DST seconds west of " +"UTC) and ``daylight`` (to 0 if this timezone does not have any daylight saving " +"time rules, or to nonzero if there is a time, past, present or future when " +"daylight saving time applies)." +msgstr "" +"قواعد تبدیل زمان مورد استفاده توسط روتین‌های کتابخانه را بازنشانی می‌کند. متغیر " +"محیطی :envvar:`TZ` نحوه انجام این کار را مشخص می‌کند. همچنین متغیرهای " +"``tzname`` (از متغیر محیطی :envvar:`TZ`)، ``timezone`` (ثانیه‌های غیر DST در " +"غرب UTC)، ``altzone`` (ثانیه‌های DST در غرب UTC) و ``daylight`` (به ۰ اگر این " +"منطقه زمانی هیچ قاعده‌ای برای ساعت تابستانی نداشته باشد، یا به مقداری غیرصفر " +"اگر زمانی در گذشته، حال یا آینده وجود داشته باشد که ساعت تابستانی اعمال شود) " +"را نیز تنظیم خواهد کرد." -msgid "Although in many cases, changing the :envvar:`TZ` environment variable may affect the output of functions like :func:`localtime` without calling :func:`tzset`, this behavior should not be relied on." +msgid "" +"Although in many cases, changing the :envvar:`TZ` environment variable may " +"affect the output of functions like :func:`localtime` without " +"calling :func:`tzset`, this behavior should not be relied on." msgstr "" +"اگرچه در بسیاری از موارد، تغییر متغیر محیطی :envvar:`TZ` ممکن است بدون " +"فراخوانی :func:`tzset ` بر خروجی توابعی مانند :func:`localtime " +"` تأثیر بگذارد، اما نباید به این رفتار اتکا کرد." msgid "The :envvar:`TZ` environment variable should contain no whitespace." -msgstr "" +msgstr "متغیر محیطی :envvar:`TZ` نباید شامل هیچ‌گونه فضای خالی باشد." -msgid "The standard format of the :envvar:`TZ` environment variable is (whitespace added for clarity)::" +msgid "" +"The standard format of the :envvar:`TZ` environment variable is (whitespace " +"added for clarity)::" msgstr "" +"قالب استاندارد متغیر محیطی :envvar:`TZ` به این صورت است (فضای سفید برای " +"خوانایی اضافه شده است)::" msgid "std offset [dst [offset [,start[/time], end[/time]]]]" -msgstr "" +msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" msgid "Where the components are:" -msgstr "" +msgstr "که در آن کامپوننت‌ها عبارتند از:" msgid "``std`` and ``dst``" -msgstr "" +msgstr "``std`` و ``dst``" -msgid "Three or more alphanumerics giving the timezone abbreviations. These will be propagated into time.tzname" +msgid "" +"Three or more alphanumerics giving the timezone abbreviations. These will be " +"propagated into time.tzname" msgstr "" +"۳ یا چند نویسه‌ی الفبایی‌عددی که مخفف‌های منطقه‌ی زمانی را مشخص می‌کنند. این مقادیر " +"به time.tzname منتقل می‌شوند" msgid "``offset``" -msgstr "" +msgstr "``offset``" -msgid "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added the local time to arrive at UTC. If preceded by a '-', the timezone is east of the Prime Meridian; otherwise, it is west. If no offset follows dst, summer time is assumed to be one hour ahead of standard time." +msgid "" +"The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " +"the local time to arrive at UTC. If preceded by a '-', the timezone is east " +"of the Prime Meridian; otherwise, it is west. If no offset follows dst, summer " +"time is assumed to be one hour ahead of standard time." msgstr "" +"آفست (offset) به شکل ``± hh[:mm[:ss]]`` است. این، مقداری است که به زمان محلی " +"افزوده می‌شود تا UTC به دست آید. اگر پیش از آن یک '-' بیاید، منطقه‌ی زمانی در شرق " +"نصف‌النهار مبدأ است؛ در غیر این صورت، در غرب آن است. اگر پس از dst آفستی نیاید، " +"فرض می‌شود ساعت تابستانی یک ساعت جلوتر از زمان استاندارد است." msgid "``start[/time], end[/time]``" -msgstr "" +msgstr "``start[/time], end[/time]``" -msgid "Indicates when to change to and back from DST. The format of the start and end dates are one of the following:" +msgid "" +"Indicates when to change to and back from DST. The format of the start and end " +"dates are one of the following:" msgstr "" +"مشخص می‌کند که چه زمانی باید به ساعت تابستانی (DST) تغییر کرد و از آن بازگشت. " +"قالب تاریخ‌های شروع و پایان یکی از موارد زیر است:" msgid ":samp:`J{n}`" -msgstr "" +msgstr ":samp:`J{n}`" -msgid "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all years February 28 is day 59 and March 1 is day 60." +msgid "" +"The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " +"years February 28 is day 59 and March 1 is day 60." msgstr "" +"روز ژولینی *n* (۱ <= *n* <= ۳۶۵). روزهای کبیسه شمارش نمی‌شوند، بنابراین در همه " +"سال‌ها، ۲۸ فوریه روز ۵۹ و ۱ مارس روز ۶۰ است." msgid ":samp:`{n}`" -msgstr "" +msgstr ":samp:`{n}`" -msgid "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it is possible to refer to February 29." +msgid "" +"The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it is " +"possible to refer to February 29." msgstr "" +"روز ژولینی مبتنی بر صفر (۰ <= *n* <= ۳۶۵). روزهای کبیسه شمرده می‌شوند، و می‌توان " +"به ۲۹ فوریه اشاره کرد." msgid ":samp:`M{m}.{n}.{d}`" -msgstr "" +msgstr ":samp:`M{m}.{n}.{d}`" -msgid "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= *n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month *m*\" which may occur in either the fourth or the fifth week). Week 1 is the first week in which the *d*'th day occurs. Day zero is a Sunday." +msgid "" +"The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= *n* " +"<= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month *m*\" " +"which may occur in either the fourth or the fifth week). Week 1 is the first " +"week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" +"*d* امین روز (۰ <= *d* <= ۶) از هفته‌ی *n* از ماه *m* از سال (۱ <= *n* <= ۵، ۱ <= " +"*m* <= ۱۲، که هفته‌ی ۵ به معنای «آخرین روز *d* در ماه *m*» است؛ این روز ممکن است " +"در هفته‌ی چهارم یا پنجم رخ دهد). هفته‌ی ۱ نخستین هفته‌ای است که *d* امین روز در آن " +"رخ می‌دهد. روز صفر، یکشنبه است." -msgid "``time`` has the same format as ``offset`` except that no leading sign ('-' or '+') is allowed. The default, if time is not given, is 02:00:00." +msgid "" +"``time`` has the same format as ``offset`` except that no leading sign ('-' or " +"'+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" +"``time`` همان قالب ``offset`` را دارد، با این تفاوت که علامت پیش‌رو ('-' یا " +"'+') مجاز نیست. مقدار پیش‌فرض، اگر time داده نشود، 02:00:00 است." msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" @@ -740,9 +1337,31 @@ msgid "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" msgstr "" +">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" +">>> time.tzset()\n" +">>> time.strftime('%X %x %Z')\n" +"'02:07:36 05/08/03 EDT'\n" +">>> os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'\n" +">>> time.tzset()\n" +">>> time.strftime('%X %x %Z')\n" +"'16:08:12 05/08/03 AEST'" -msgid "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) database to specify the timezone rules. To do this, set the :envvar:`TZ` environment variable to the path of the required timezone datafile, relative to the root of the systems 'zoneinfo' timezone database, usually located at :file:`/usr/share/zoneinfo`. For example, ``'US/Eastern'``, ``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" -msgstr "" +msgid "" +"On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " +"more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) database " +"to specify the timezone rules. To do this, set the :envvar:`TZ` environment " +"variable to the path of the required timezone datafile, relative to the root " +"of the systems 'zoneinfo' timezone database, usually located at :file:`/usr/" +"share/zoneinfo`. For example, ``'US/Eastern'``, ``'Australia/Melbourne'``, " +"``'Egypt'`` or ``'Europe/Amsterdam'``. ::" +msgstr "" +"در بسیاری از سیستم‌های یونیکسی (شامل \\*BSD، Linux، Solaris و Darwin)، استفاده " +"از پایگاه داده‌ی zoneinfo سیستم (:manpage:`tzfile(5)`) برای مشخص کردن قوانین " +"منطقه زمانی راحت‌تر است. برای این کار، متغیر محیطی :envvar:`TZ` را روی مسیر " +"فایل داده‌ی منطقه زمانی مورد نیاز، نسبت به ریشه‌ی پایگاه داده‌ی منطقه زمانی " +"'zoneinfo' سیستم، که معمولاً در :file:`/usr/share/zoneinfo` قرار دارد، تنظیم " +"کنید. برای مثال، ``'US/Eastern'``، ``'Australia/Melbourne'``، ``'Egypt'`` یا " +"``'Europe/Amsterdam'``. ::" msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" @@ -754,132 +1373,261 @@ msgid "" ">>> time.tzname\n" "('EET', 'EEST')" msgstr "" +">>> os.environ['TZ'] = 'US/Eastern'\n" +">>> time.tzset()\n" +">>> time.tzname\n" +"('EST', 'EDT')\n" +">>> os.environ['TZ'] = 'Egypt'\n" +">>> time.tzset()\n" +">>> time.tzname\n" +"('EET', 'EEST')" msgid "Clock ID Constants" -msgstr "" +msgstr "ثابت‌های شناسه‌ی ساعت" -msgid "These constants are used as parameters for :func:`clock_getres` and :func:`clock_gettime`." +msgid "" +"These constants are used as parameters for :func:`clock_getres` " +"and :func:`clock_gettime`." msgstr "" +"این ثابت‌ها به‌عنوان پارامترهایی برای :func:`clock_getres` " +"و :func:`clock_gettime` استفاده می‌شوند." -msgid "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that the system is suspended." +msgid "" +"Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " +"the system is suspended." msgstr "" +"یکسان با :data:`CLOCK_MONOTONIC`، با این تفاوت که هر زمانی را که سیستم در حالت " +"تعلیق است نیز شامل می‌شود." -msgid "This allows applications to get a suspend-aware monotonic clock without having to deal with the complications of :data:`CLOCK_REALTIME`, which may have discontinuities if the time is changed using ``settimeofday()`` or similar." +msgid "" +"This allows applications to get a suspend-aware monotonic clock without " +"having to deal with the complications of :data:`CLOCK_REALTIME`, which may " +"have discontinuities if the time is changed using ``settimeofday()`` or " +"similar." msgstr "" +"این به برنامه‌ها امکان می‌دهد یک ساعت یکنواخت آگاه از تعلیق دریافت کنند، بدون " +"اینکه مجبور باشند با پیچیدگی‌های :data:`CLOCK_REALTIME` سروکار داشته باشند، که " +"ممکن است در صورت تغییر زمان با استفاده از ``settimeofday()`` یا موارد مشابه، " +"ناپیوستگی‌هایی داشته باشد." -msgid "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal hardware source, and may give close to nanosecond resolution. ``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." +msgid "" +"The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " +"hardware source, and may give close to nanosecond resolution. " +"``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" +"سیستم‌عامل Solaris دارای یک زمان‌سنج ``CLOCK_HIGHRES`` است که تلاش می‌کند از یک " +"منبع سخت‌افزاری بهینه استفاده کند و ممکن است دقتی نزدیک به نانوثانیه ارائه دهد. " +"``CLOCK_HIGHRES`` ساعت غیرقابل‌تنظیم و با دقت بالا است." -msgid "Clock that cannot be set and represents monotonic time since some unspecified starting point." +msgid "" +"Clock that cannot be set and represents monotonic time since some unspecified " +"starting point." msgstr "" +"ساعتی که نمی‌توان آن را تنظیم کرد و زمان یکنواخت را از یک نقطه‌ی آغاز نامشخص " +"نشان می‌دهد." -msgid "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-based time that is not subject to NTP adjustments." +msgid "" +"Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" +"based time that is not subject to NTP adjustments." msgstr "" +"مشابه :data:`CLOCK_MONOTONIC`، اما دسترسی به زمان خام مبتنی بر سخت‌افزار را " +"فراهم می‌کند که مشمول تنظیم‌های NTP نمی‌شود." -msgid "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the system at context switch and hence has less accuracy." +msgid "" +"Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the system " +"at context switch and hence has less accuracy." msgstr "" +"مشابه :data:`CLOCK_MONOTONIC_RAW`، اما مقداری را می‌خواند که سیستم آن را هنگام " +"تعویض زمینه در نهانگاه ذخیره کرده است و بنابراین دقت کمتری دارد." msgid "High-resolution per-process timer from the CPU." -msgstr "" +msgstr "زمان‌سنج با دقت بالا به‌ازای هر فرایند از CPU." -msgid "`International Atomic Time `_" +msgid "" +"`International Atomic Time `_" msgstr "" +"`زمان اتمی بین‌المللی `_" -msgid "The system must have a current leap second table in order for this to give the correct answer. PTP or NTP software can maintain a leap second table." +msgid "" +"The system must have a current leap second table in order for this to give the " +"correct answer. PTP or NTP software can maintain a leap second table." msgstr "" +"سیستم باید یک جدول به‌روز از ثانیه‌های کبیسه داشته باشد تا این مورد پاسخ صحیح " +"بدهد. نرم‌افزار PTP یا NTP می‌تواند جدول ثانیه‌های کبیسه را نگه‌داری کند." msgid "Thread-specific CPU-time clock." -msgstr "" +msgstr "ساعت زمان CPU مختص به نخ." -msgid "Time whose absolute value is the time the system has been running and not suspended, providing accurate uptime measurement, both absolute and interval." +msgid "" +"Time whose absolute value is the time the system has been running and not " +"suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" +"زمانی که مقدار مطلق آن، مدت زمانی است که سیستم در حال اجرا بوده و تعلیق نشده " +"است و اندازه‌گیری دقیق زمان کارکرد (uptime) را هم به‌صورت مطلق و هم به‌صورت " +"بازه‌ای فراهم می‌کند." -msgid "Clock that increments monotonically, tracking the time since an arbitrary point, unaffected by frequency or time adjustments and not incremented while the system is asleep." +msgid "" +"Clock that increments monotonically, tracking the time since an arbitrary " +"point, unaffected by frequency or time adjustments and not incremented while " +"the system is asleep." msgstr "" +"ساعتی که به‌صورت یکنواخت افزایش می‌یابد، زمان را از یک نقطه دلخواه پیگیری می‌کند، " +"تحت تأثیر تنظیمات فرکانس یا زمان قرار نمی‌گیرد و در حالی که سیستم متوقف " +"است افزایش نمی‌یابد." -msgid "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at context switches and therefore has less accuracy." +msgid "" +"Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " +"context switches and therefore has less accuracy." msgstr "" +"مانند :data:`CLOCK_UPTIME_RAW`، اما مقدار در تعویض‌های زمینه توسط سیستم در " +"نهانگاه ذخیره می‌شود و بنابراین دقت کمتری دارد." -msgid "The following constant is the only parameter that can be sent to :func:`clock_settime`." -msgstr "" +msgid "" +"The following constant is the only parameter that can be sent " +"to :func:`clock_settime`." +msgstr "ثابت زیر تنها پارامتری است که می‌توان به :func:`clock_settime` ارسال کرد." -msgid "Real-time clock. Setting this clock requires appropriate privileges. The clock is the same for all processes." +msgid "" +"Real-time clock. Setting this clock requires appropriate privileges. The " +"clock is the same for all processes." msgstr "" +"ساعت بلادرنگ. تنظیم این ساعت نیازمند دسترسی‌های مناسب است. این ساعت برای تمام " +"فرآیندها یکسان است." msgid "Timezone Constants" -msgstr "" +msgstr "ثابت‌های منطقه زمانی" -msgid "The offset of the local DST timezone, in seconds west of UTC, if one is defined. This is negative if the local DST timezone is east of UTC (as in Western Europe, including the UK). Only use this if ``daylight`` is nonzero. See note below." +msgid "" +"The offset of the local DST timezone, in seconds west of UTC, if one is " +"defined. This is negative if the local DST timezone is east of UTC (as in " +"Western Europe, including the UK). Only use this if ``daylight`` is nonzero. " +"See note below." msgstr "" +"اختلاف منطقه زمانی محلی DST، بر حسب ثانیه در غرب UTC، در صورتی که تعریف شده " +"باشد. اگر منطقه زمانی محلی DST در شرق UTC باشد (مانند اروپای غربی، از جمله " +"بریتانیا)، این مقدار منفی است. تنها در صورتی از این استفاده کنید که " +"``daylight`` ناصفر باشد. یادداشت زیر را ببینید." msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" +"در صورتی که یک منطقه‌ی زمانی DST تعریف شده باشد، غیرصفر است. یادداشت زیر را " +"ببینید." -msgid "The offset of the local (non-DST) timezone, in seconds west of UTC (negative in most of Western Europe, positive in the US, zero in the UK). See note below." +msgid "" +"The offset of the local (non-DST) timezone, in seconds west of UTC (negative " +"in most of Western Europe, positive in the US, zero in the UK). See note " +"below." msgstr "" +"آفست (offset) منطقه زمانی محلی (غیر DST)، بر حسب ثانیه در غرب UTC (در بیشتر " +"اروپای غربی منفی، در ایالات متحده مثبت، در بریتانیا صفر). یادداشت زیر را " +"ببینید." -msgid "A tuple of two strings: the first is the name of the local non-DST timezone, the second is the name of the local DST timezone. If no DST timezone is defined, the second string should not be used. See note below." +msgid "" +"A tuple of two strings: the first is the name of the local non-DST timezone, " +"the second is the name of the local DST timezone. If no DST timezone is " +"defined, the second string should not be used. See note below." msgstr "" +"تاپلی از دو رشته: اولی نام منطقه زمانی محلی بدون ساعت تابستانی است و دومی نام " +"منطقه زمانی محلی با ساعت تابستانی است. اگر منطقه زمانی ساعت تابستانی تعریف‌نشده " +"باشد، نباید از رشته دوم استفاده شود. به یادداشت زیر مراجعه کنید." -msgid "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:`timezone`, and :data:`tzname`), the value is determined by the timezone rules in effect at module load time or the last time :func:`tzset` is called and may be incorrect for times in the past. It is recommended to use the :attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :func:`localtime` to obtain timezone information." -msgstr "" +msgid "" +"For the above Timezone constants " +"(:data:`altzone`, :data:`daylight`, :data:`timezone`, and :data:`tzname`), the " +"value is determined by the timezone rules in effect at module load time or the " +"last time :func:`tzset` is called and may be incorrect for times in the past. " +"It is recommended to use the :attr:`~struct_time.tm_gmtoff` " +"and :attr:`~struct_time.tm_zone` results from :func:`localtime` to obtain " +"timezone information." +msgstr "" +"برای ثابت‌های منطقه زمانی بالا " +"(:data:`altzone`، :data:`daylight`، :data:`timezone` و :data:`tzname`)، مقدار " +"آن‌ها بر اساس قواعد منطقه زمانی حاکم در زمان بارگذاری ماژول یا آخرین باری " +"که :func:`tzset` فراخوانی شده است تعیین می‌شود و ممکن است برای زمان‌های گذشته " +"نادرست باشد. توصیه می‌شود برای دریافت اطلاعات منطقه زمانی از " +"نتایج :attr:`~struct_time.tm_gmtoff` و :attr:`~struct_time.tm_zone` حاصل " +"از :func:`localtime` استفاده کنید." msgid "Module :mod:`datetime`" -msgstr "" +msgstr "ماژول :mod:`datetime`" msgid "More object-oriented interface to dates and times." -msgstr "" +msgstr "رابط شیءگراتر برای تاریخ‌ها و زمان‌ها." msgid "Module :mod:`locale`" -msgstr "" +msgstr "ماژول :mod:`locale`" -msgid "Internationalization services. The locale setting affects the interpretation of many format specifiers in :func:`strftime` and :func:`strptime`." +msgid "" +"Internationalization services. The locale setting affects the interpretation " +"of many format specifiers in :func:`strftime` and :func:`strptime`." msgstr "" +"خدمات بین‌المللی‌سازی. تنظیمات locale بر تفسیر بسیاری از مشخص‌کننده‌های قالب " +"در :func:`strftime` و :func:`strptime` تأثیر می‌گذارد." msgid "Module :mod:`calendar`" -msgstr "" +msgstr "ماژول :mod:`calendar`" -msgid "General calendar-related functions. :func:`~calendar.timegm` is the inverse of :func:`gmtime` from this module." +msgid "" +"General calendar-related functions. :func:`~calendar.timegm` is the inverse " +"of :func:`gmtime` from this module." msgstr "" +"توابع عمومی مرتبط با گاه‌شماری. :func:`~calendar.timegm` معکوس :func:`gmtime` از " +"این ماژول است." msgid "Footnotes" -msgstr "" +msgstr "پانویس‌ها" -msgid "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to the preferred hour/minute offset is not supported by all ANSI C libraries. Also, a strict reading of the original 1982 :rfc:`822` standard calls for a two-digit year (``%y`` rather than ``%Y``), but practice moved to 4-digit years long before the year 2000. After that, :rfc:`822` became obsolete and the 4-digit year has been first recommended by :rfc:`1123` and then mandated by :rfc:`2822`, with :rfc:`5322` continuing this requirement." -msgstr "" +msgid "" +"The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to the " +"preferred hour/minute offset is not supported by all ANSI C libraries. Also, a " +"strict reading of the original 1982 :rfc:`822` standard calls for a two-digit " +"year (``%y`` rather than ``%Y``), but practice moved to 4-digit years long " +"before the year 2000. After that, :rfc:`822` became obsolete and the 4-digit " +"year has been first recommended by :rfc:`1123` and then mandated " +"by :rfc:`2822`, with :rfc:`5322` continuing this requirement." +msgstr "" +"استفاده از ``%Z`` اکنون منسوخ شده است، اما دنباله‌ی خنثی‌سازی ``%z`` که به آفست " +"ساعت/دقیقه‌ی ترجیحی گسترش می‌یابد، در همه‌ی کتابخانه‌های ANSI C پشتیبانی نمی‌شود. " +"همچنین، خوانش دقیق از استاندارد اصلی سال ۱۹۸۲ یعنی :rfc:`822`، سال دورقمی " +"(``%y`` به جای ``%Y``) را می‌طلبد، اما رویه بسیار پیش از سال ۲۰۰۰ به سال‌های " +"۴‌رقمی تغییر یافت. پس از آن، :rfc:`822` منسوخ شد و سال ۴‌رقمی ابتدا " +"توسط :rfc:`1123` توصیه شد و سپس توسط :rfc:`2822` الزامی شد، و :rfc:`5322` نیز " +"این الزام را ادامه داده است." msgid "epoch" -msgstr "" +msgstr "مبدأ زمان (epoch)" msgid "Year 2038" -msgstr "" +msgstr "سال ۲۰۳۸" msgid "2-digit years" -msgstr "" +msgstr "سال‌های ۲ رقمی" msgid "UTC" -msgstr "" +msgstr "UTC" msgid "Coordinated Universal Time" -msgstr "" +msgstr "زمان هماهنگ جهانی" msgid "Greenwich Mean Time" -msgstr "" +msgstr "زمان میانگین گرینویچ" msgid "Daylight Saving Time" -msgstr "" +msgstr "زمان تابستانی" msgid "benchmarking" -msgstr "" +msgstr "محک‌زنی (benchmarking)" msgid "CPU time" -msgstr "" +msgstr "زمان CPU" msgid "processor time" -msgstr "" +msgstr "زمان پردازنده" msgid "% (percent)" -msgstr "" +msgstr "% (درصد)" msgid "datetime format" -msgstr "" +msgstr "قالب datetime" diff --git a/library/timeit.po b/library/timeit.po index c4a23dcbd..231811a42 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -25,19 +25,34 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!timeit` --- Measure execution time of small code snippets" -msgstr "" +msgstr ":mod:`!timeit` --- اندازه‌گیری زمان اجرای قطعه‌کدهای کوچک" msgid "**Source code:** :source:`Lib/timeit.py`" -msgstr "" +msgstr ":source:`Lib/timeit.py`" -msgid "This module provides a simple way to time small bits of Python code. It has both a :ref:`timeit-command-line-interface` as well as a :ref:`callable ` one. It avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the \"Algorithms\" chapter in the second edition of *Python Cookbook*, published by O'Reilly." -msgstr "" +msgid "" +"This module provides a simple way to time small bits of Python code. It has " +"both a :ref:`timeit-command-line-interface` as well as a :ref:`callable " +"` one. It avoids a number of common traps for measuring " +"execution times. See also Tim Peters' introduction to the \"Algorithms\" " +"chapter in the second edition of *Python Cookbook*, published by O'Reilly." +msgstr "" +"این ماژول روش ساده‌ای برای زمان‌سنجی قطعه‌های کوچک کد پایتون فراهم می‌کند. " +"این ماژول هم یک :ref:`timeit-command-line-interface` و هم یک رابط " +":ref:`فراخوان‌پذیر ` دارد و از شماری از دام‌های رایج در " +"اندازه‌گیری زمان‌های اجرا پرهیز می‌کند. همچنین به مقدمه‌ی Tim Peters بر فصل " +"«Algorithms» در ویرایش دوم *Python Cookbook*، که توسط O'Reilly منتشر شده " +"است، مراجعه کنید." msgid "Basic Examples" -msgstr "" +msgstr "مثال‌های پایه" -msgid "The following example shows how the :ref:`timeit-command-line-interface` can be used to compare three different expressions:" +msgid "" +"The following example shows how the :ref:`timeit-command-line-interface` can" +" be used to compare three different expressions:" msgstr "" +"مثال زیر نشان می‌دهد که چگونه می‌توان از :ref:`timeit-command-line-" +"interface` برای مقایسه‌ی سه عبارت متفاوت استفاده کرد:" msgid "" "$ python -m timeit \"'-'.join(str(n) for n in range(100))\"\n" @@ -47,9 +62,15 @@ msgid "" "$ python -m timeit \"'-'.join(map(str, range(100)))\"\n" "10000 loops, best of 5: 23.2 usec per loop" msgstr "" +"$ python -m timeit \"'-'.join(str(n) for n in range(100))\"\n" +"10000 loops, best of 5: 30.2 usec per loop\n" +"$ python -m timeit \"'-'.join([str(n) for n in range(100)])\"\n" +"10000 loops, best of 5: 27.5 usec per loop\n" +"$ python -m timeit \"'-'.join(map(str, range(100)))\"\n" +"10000 loops, best of 5: 23.2 usec per loop" msgid "This can be achieved from the :ref:`python-interface` with::" -msgstr "" +msgstr "این کار را می‌توان از :ref:`python-interface` به این صورت انجام داد::" msgid "" ">>> import timeit\n" @@ -60,89 +81,218 @@ msgid "" ">>> timeit.timeit('\"-\".join(map(str, range(100)))', number=10000)\n" "0.23702679807320237" msgstr "" +">>> import timeit\n" +">>> timeit.timeit('\"-\".join(str(n) for n in range(100))', number=10000)\n" +"0.3018611848820001\n" +">>> timeit.timeit('\"-\".join([str(n) for n in range(100)])', number=10000)\n" +"0.2727368790656328\n" +">>> timeit.timeit('\"-\".join(map(str, range(100)))', number=10000)\n" +"0.23702679807320237" msgid "A callable can also be passed from the :ref:`python-interface`::" msgstr "" +"همچنین می‌توان یک شیء فراخوان‌پذیر را از :ref:`python-interface` ارسال کرد::" msgid "" ">>> timeit.timeit(lambda: \"-\".join(map(str, range(100))), number=10000)\n" "0.19665591977536678" msgstr "" +">>> timeit.timeit(lambda: \"-\".join(map(str, range(100))), number=10000)\n" +"0.19665591977536678" -msgid "Note however that :func:`.timeit` will automatically determine the number of repetitions only when the command-line interface is used. In the :ref:`timeit-examples` section you can find more advanced examples." +msgid "" +"Note however that :func:`.timeit` will automatically determine the number of" +" repetitions only when the command-line interface is used. In the " +":ref:`timeit-examples` section you can find more advanced examples." msgstr "" +"با این حال توجه داشته باشید که :func:`.timeit` تعداد تکرارها را فقط زمانی که" +" از رابط خط فرمان استفاده شود، به‌طور خودکار تعیین می‌کند. در بخش " +":ref:`timeit-examples` می‌توانید مثال‌های پیشرفته‌تری پیدا کنید." msgid "Python Interface" -msgstr "" +msgstr "رابط پایتون" msgid "The module defines three convenience functions and a public class:" -msgstr "" +msgstr "این ماژول ۳ تابع کمکی و یک کلاس عمومی را تعریف می‌کند:" -msgid "Create a :class:`Timer` instance with the given statement, *setup* code and *timer* function and run its :meth:`.timeit` method with *number* executions. The optional *globals* argument specifies a namespace in which to execute the code." +msgid "" +"Create a :class:`Timer` instance with the given statement, *setup* code and " +"*timer* function and run its :meth:`.timeit` method with *number* " +"executions. The optional *globals* argument specifies a namespace in which " +"to execute the code." msgstr "" +"یک نمونه :class:`Timer` با دستور داده‌شده، کد *setup* و تابع *timer* ایجاد " +"کنید و متد :meth:`.timeit` آن را به تعداد *number* اجرا کنید. آرگومان " +"اختیاری *globals* فضای نامی را مشخص می‌کند که کد در آن اجرا می‌شود." msgid "The optional *globals* parameter was added." -msgstr "" +msgstr "پارامتر اختیاری *globals* افزوده شد." -msgid "Create a :class:`Timer` instance with the given statement, *setup* code and *timer* function and run its :meth:`.repeat` method with the given *repeat* count and *number* executions. The optional *globals* argument specifies a namespace in which to execute the code." +msgid "" +"Create a :class:`Timer` instance with the given statement, *setup* code and " +"*timer* function and run its :meth:`.repeat` method with the given *repeat* " +"count and *number* executions. The optional *globals* argument specifies a " +"namespace in which to execute the code." msgstr "" +"یک نمونه :class:`Timer` با دستور، کد *setup* و تابع *timer* داده‌شده ایجاد " +"کنید و متد :meth:`.repeat` آن را با تعداد *repeat* و تعداد اجرای داده‌شده " +"توسط *number* اجرا کنید. آرگومان اختیاری *globals* فضای نامی را مشخص می‌کند " +"که کد در آن اجرا می‌شود." msgid "Default value of *repeat* changed from 3 to 5." -msgstr "" +msgstr "مقدار پیش‌فرض *repeat* از ۳ به ۵ تغییر کرد." -msgid "The default timer, which is always time.perf_counter(), returns float seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." +msgid "" +"The default timer, which is always time.perf_counter(), returns float " +"seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." msgstr "" +"زمان‌سنج پیش‌فرض، که همیشه time.perf_counter() است، ثانیه‌ها را به‌صورت " +"شناور برمی‌گرداند. یک جایگزین، time.perf_counter_ns، نانوثانیه‌ها را به‌صورت" +" عدد صحیح برمی‌گرداند." msgid ":func:`time.perf_counter` is now the default timer." -msgstr "" +msgstr ":func:`time.perf_counter` اکنون زمان‌سنج پیش‌فرض است." msgid "Class for timing execution speed of small code snippets." -msgstr "" +msgstr "کلاسی برای زمان‌سنجی سرعت اجرای قطعه‌کدهای کوچک." -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 timer function is platform-dependent (see the module doc string). *stmt* and *setup* may also contain multiple statements separated by ``;`` or newlines, as long as they don't contain multi-line string literals. The statement will by default be executed within timeit's namespace; this behavior can be controlled by passing a namespace to *globals*." -msgstr "" +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" +" timer function is platform-dependent (see the module doc string). *stmt* " +"and *setup* may also contain multiple statements separated by ``;`` or " +"newlines, as long as they don't contain multi-line string literals. The " +"statement will by default be executed within timeit's namespace; this " +"behavior can be controlled by passing a namespace to *globals*." +msgstr "" +"سازنده یک دستور برای زمان‌سنجی، یک دستور اضافی برای راه‌اندازی و یک تابع " +"زمان‌سنج را دریافت می‌کند. هر دو دستور به‌طور پیش‌فرض ``'pass'`` هستند؛ تابع" +" زمان‌سنج وابسته به سکو است (رشته‌ی مستند ماژول را ببینید). *stmt* و *setup* " +"همچنین می‌توانند شامل چندین دستور باشند که با ``;`` یا خط جدید جدا شده‌اند، " +"تا زمانی که شامل رشته‌های چندخطی نباشند. دستور به‌طور پیش‌فرض در فضای نام " +"timeit اجرا می‌شود؛ این رفتار را می‌توان با ارسال یک فضای نام به *globals* " +"کنترل کرد." -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." +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 "" +"برای اندازه‌گیری زمان اجرای نخستین دستور، از متد :meth:`.timeit` استفاده " +"کنید. متدهای :meth:`.repeat` و :meth:`.autorange` متدهای سهولت‌بخشی هستند که" +" :meth:`.timeit` را چندین بار فراخوانی می‌کنند." -msgid "The execution time of *setup* is excluded from the overall timed execution run." -msgstr "" +msgid "" +"The execution time of *setup* is excluded from the overall timed execution " +"run." +msgstr "زمان اجرای *setup* از اجرای زمان‌سنجی‌شده‌ی کلی مستثنی است." -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 will then be executed by :meth:`.timeit`. Note that the timing overhead is a little larger in this case because of the extra function calls." +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 " +"will then be executed by :meth:`.timeit`. Note that the timing overhead is " +"a little larger in this case because of the extra function calls." msgstr "" +"پارامترهای *stmt* و *setup* همچنین می‌توانند اشیایی را بپذیرند که بدون " +"آرگومان قابل فراخوانی هستند. این کار فراخوانی‌های آن‌ها را در یک تابع " +"زمان‌سنج جاسازی می‌کند که سپس توسط :meth:`.timeit` اجرا می‌شود. توجه داشته " +"باشید که در این حالت، سربار زمان‌سنجی به دلیل فراخوانی‌های اضافی تابع کمی " +"بیشتر است." -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. 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 "" +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. 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 "" +"زمان اجرای دستور اصلی به تعداد *number* را اندازه‌گیری می‌کند. این متد، " +"دستور آماده‌سازی را یک‌بار اجرا می‌کند و سپس زمانی را که طول می‌کشد تا دستور" +" اصلی به تعداد مشخص اجرا شود برمی‌گرداند. زمان‌سنج پیش‌فرض، ثانیه‌ها را " +"به‌صورت یک عدد اعشاری برمی‌گرداند. آرگومان، تعداد دفعات پیمایش حلقه است که " +"مقدار پیش‌فرض آن یک میلیون است. دستور اصلی، دستور آماده‌سازی و تابع زمان‌سنج" +" مورد استفاده به سازنده پاس داده می‌شوند." -msgid "By default, :meth:`.timeit` temporarily turns off :term:`garbage collection` during the timing. The advantage of this approach is that it makes independent timings more comparable. The disadvantage is that GC may be an important component of the performance of the function being measured. If so, GC can be re-enabled as the first statement in the *setup* string. For example::" -msgstr "" +msgid "" +"By default, :meth:`.timeit` temporarily turns off :term:`garbage collection`" +" during the timing. The advantage of this approach is that it makes " +"independent timings more comparable. The disadvantage is that GC may be an " +"important component of the performance of the function being measured. If " +"so, GC can be re-enabled as the first statement in the *setup* string. For " +"example::" +msgstr "" +"به‌طور پیش‌فرض، :meth:`.timeit` به‌طور موقت :term:`زباله‌روبی ` را در طول زمان‌سنجی غیرفعال می‌کند. مزیت این روش آن است که " +"زمان‌سنجی‌های مستقل را قابل‌مقایسه‌تر می‌کند. عیب آن این است که GC ممکن است " +"کامپوننت مهمی از عملکرد تابع در حال اندازه‌گیری باشد. در این صورت، می‌توان " +"GC را به‌عنوان اولین دستور در رشته‌ی *setup* دوباره فعال کرد. برای مثال::" msgid "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()" -msgstr "" +msgstr "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()" msgid "Automatically determine how many times to call :meth:`.timeit`." -msgstr "" +msgstr "به‌طور خودکار تعیین می‌کند که چند بار :meth:`.timeit` فراخوانی شود." -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 taken for that number of loops). It calls :meth:`.timeit` with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2 seconds." -msgstr "" +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" +" taken for that number of loops). It calls :meth:`.timeit` with increasing " +"numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " +"at least 0.2 seconds." +msgstr "" +"این یک تابع کمکی است که :meth:`.timeit` را به‌طور مکرر فراخوانی می‌کند تا " +"زمان کل >= ۰٫۲ ثانیه شود و در نهایت (تعداد حلقه‌ها، زمان صرف‌شده برای آن " +"تعداد حلقه) را برمی‌گرداند. این تابع :meth:`.timeit` را با اعداد فزاینده از " +"دنباله‌ی ۱، ۲، ۵، ۱۰، ۲۰، ۵۰، ... فراخوانی می‌کند تا زمانی که زمان صرف‌شده " +"حداقل ۰٫۲ ثانیه باشد." -msgid "If *callback* is given and is not ``None``, it will be called after each trial with two arguments: ``callback(number, time_taken)``." +msgid "" +"If *callback* is given and is not ``None``, it will be called after each " +"trial with two arguments: ``callback(number, time_taken)``." msgstr "" +"اگر *callback* ارائه‌شده باشد و ``None`` نباشد، پس از هر آزمایش با دو " +"آرگومان فراخوانی می‌شود: ``callback(number, time_taken)``." msgid "Call :meth:`.timeit` a few times." -msgstr "" +msgstr ":meth:`.timeit` را چند بار فراخوانی کنید." -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 call :meth:`.timeit`. The second argument specifies the *number* argument for :meth:`.timeit`." +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" +" call :meth:`.timeit`. The second argument specifies the *number* argument " +"for :meth:`.timeit`." msgstr "" +"این تابعی کمکی است که :meth:`.timeit` را به‌طور مکرر فراخوانی می‌کند و " +"فهرستی از نتایج را برمی‌گرداند. آرگومان اول مشخص می‌کند که :meth:`.timeit` " +"چند بار فراخوانی شود. آرگومان دوم، آرگومان *number* برای :meth:`.timeit` را " +"مشخص می‌کند." -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 case, the lowest value gives a lower bound for how fast your machine can run the given code snippet; higher values in the result vector are typically not caused by variability in Python's speed, but by other processes interfering with your timing accuracy. So the :func:`min` of the result is probably the only number you should be interested in. After that, you should look at the entire vector and apply common sense rather than statistics." -msgstr "" +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 " +"case, the lowest value gives a lower bound for how fast your machine can run" +" the given code snippet; higher values in the result vector are typically " +"not caused by variability in Python's speed, but by other processes " +"interfering with your timing accuracy. So the :func:`min` of the result is " +"probably the only number you should be interested in. After that, you " +"should look at the entire vector and apply common sense rather than " +"statistics." +msgstr "" +"ممکن است وسوسه شوید که میانگین و انحراف معیار را از بردار نتیجه محاسبه کنید " +"و این مقادیر را گزارش دهید. با این حال، این کار چندان مفید نیست. در حالت " +"معمول، کم‌ترین مقدار، کران پایینی برای سرعت اجرای قطعه‌کد داده‌شده روی ماشین" +" شما است؛ مقادیر بالاتر در بردار نتیجه معمولاً ناشی از تغییرات سرعت پایتون " +"نیستند، بلکه ناشی از فرایندهای دیگری هستند که در دقت زمان‌سنجی شما اختلال " +"ایجاد می‌کنند. بنابراین، :func:`min` نتیجه احتمالاً تنها عددی است که باید " +"مورد توجه شما باشد. پس از آن، باید کل بردار را بررسی کنید و به‌جای آمار، عقل" +" سلیم را به کار ببرید." msgid "Helper to print a traceback from the timed code." -msgstr "" +msgstr "کمکی برای چاپ ردگیری پشته از کد زمان‌سنجی‌شده." msgid "Typical use::" -msgstr "" +msgstr "استفاده معمول::" msgid "" "t = Timer(...) # outside the try/except\n" @@ -151,60 +301,121 @@ msgid "" "except Exception:\n" " t.print_exc()" msgstr "" +"t = Timer(...) # outside the try/except\n" +"try:\n" +" t.timeit(...) # or t.repeat(...)\n" +"except Exception:\n" +" t.print_exc()" -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`." +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 "" +"مزیت آن نسبت به ردگیری پشته استاندارد این است که ردیفهای منبع در قالب " +"کامپایل‌شده نمایش داده خواهند شد. آرگومان اختیاری *file* مشخص می‌کند که " +"ردگیری پشته به کجا ارسال می‌شود؛ پیش‌فرض آن :data:`sys.stderr` است." msgid "Command-Line Interface" -msgstr "" +msgstr "رابط خط فرمان" -msgid "When called as a program from the command line, the following form is used::" +msgid "" +"When called as a program from the command line, the following form is used::" msgstr "" +"هنگامی که به‌عنوان یک برنامه از خط فرمان فراخوانی شود، از قالب زیر استفاده " +"می‌شود::" -msgid "python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement ...]" +msgid "" +"python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement ...]" msgstr "" +"python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement ...]" msgid "Where the following options are understood:" -msgstr "" +msgstr "در مواردی که گزینه‌های زیر قابل فهم هستند:" msgid "how many times to execute 'statement'" -msgstr "" +msgstr "تعداد دفعاتی که «دستور» اجرا می‌شود" msgid "how many times to repeat the timer (default 5)" -msgstr "" +msgstr "تعداد دفعات تکرار زمان‌سنج (پیش‌فرض ۵)" msgid "statement to be executed once initially (default ``pass``)" -msgstr "" +msgstr "دستوری که یک بار در ابتدا اجرا می‌شود (پیش‌فرض ``pass``)" -msgid "measure process time, not wallclock time, using :func:`time.process_time` instead of :func:`time.perf_counter`, which is the default" +msgid "" +"measure process time, not wallclock time, using :func:`time.process_time` " +"instead of :func:`time.perf_counter`, which is the default" msgstr "" +"اندازه‌گیری زمان فرایند، نه زمان دیواری، با استفاده از " +":func:`time.process_time` به‌جای :func:`time.perf_counter` که پیش‌فرض است" -msgid "specify a time unit for timer output; can select ``nsec``, ``usec``, ``msec``, or ``sec``" +msgid "" +"specify a time unit for timer output; can select ``nsec``, ``usec``, " +"``msec``, or ``sec``" msgstr "" +"یک واحد زمانی برای خروجی زمان‌سنج مشخص کنید؛ می‌توانید ``nsec``، ``usec``، " +"``msec`` یا ``sec`` را انتخاب کنید" msgid "print raw timing results; repeat for more digits precision" -msgstr "" +msgstr "چاپ نتایج خام زمان‌سنجی؛ برای دقت بیشتر در ارقام تکرار کنید" msgid "print a short usage message and exit" -msgstr "" +msgstr "یک پیام کوتاه کاربرد را چاپ کرده و خارج می‌شود" -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 quotes and using leading spaces. Multiple :option:`-s` options are treated similarly." +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 " +"quotes and using leading spaces. Multiple :option:`-s` options are treated " +"similarly." msgstr "" +"یک دستور چندخطی می‌تواند با مشخص کردن هر خط به‌عنوان یک آرگومان دستور " +"جداگانه داده شود؛ خطوط دارای تورفتگی با قرار دادن آرگومان در علامت‌های " +"نقل‌قول و استفاده از فاصله‌های ابتدایی امکان‌پذیر است. گزینه‌های متعدد " +":option:`-s` نیز به‌طور مشابه رفتار می‌شوند." -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." +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 "" +"اگر :option:`-n` داده نشده باشد، تعداد مناسبی برای حلقه‌ها با امتحان کردن " +"اعداد فزاینده از دنباله‌ی ۱، ۲، ۵، ۱۰، ۲۰، ۵۰، ... محاسبه می‌شود، تا زمانی " +"که زمان کل حداقل ۰.۲ ثانیه شود." -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 necessary is to repeat the timing a few times and use the best time. The :option:`-r` option is good for this; the default of 5 repetitions is probably enough in most cases. You can use :func:`time.process_time` to measure CPU time." -msgstr "" +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 " +"necessary is to repeat the timing a few times and use the best time. The " +":option:`-r` option is good for this; the default of 5 repetitions is " +"probably enough in most cases. You can use :func:`time.process_time` to " +"measure CPU time." +msgstr "" +"اندازه‌گیری‌های :func:`default_timer` می‌توانند تحت تأثیر سایر برنامه‌های در" +" حال اجرا روی همان ماشین قرار بگیرند، بنابراین بهترین کار هنگامی که " +"زمان‌سنجی دقیق ضروری است این است که زمان‌سنجی را چند بار تکرار کنید و از " +"بهترین زمان استفاده کنید. گزینه‌ی :option:`-r` برای این کار مناسب است؛ مقدار " +"پیش‌فرض ۵ تکرار احتمالاً در بیشتر موارد کافی است. می‌توانید از " +":func:`time.process_time` برای اندازه‌گیری زمان CPU استفاده کنید." -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 it. The baseline overhead can be measured by invoking the program without arguments, and it might differ between Python versions." +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 " +"it. The baseline overhead can be measured by invoking the program without " +"arguments, and it might differ between Python versions." msgstr "" +"اجرای دستور pass با مقدار مشخصی سربار پایه همراه است. این کد سعی نمی‌کند آن " +"را پنهان کند، اما شما باید از آن آگاه باشید. سربار پایه را می‌توان با " +"فراخوانی برنامه بدون آرگومان اندازه‌گیری کرد، و ممکن است بین نسخه‌های پایتون" +" متفاوت باشد." msgid "Examples" -msgstr "" +msgstr "مثال‌ها" -msgid "It is possible to provide a setup statement that is executed only once at the beginning:" +msgid "" +"It is possible to provide a setup statement that is executed only once at " +"the beginning:" msgstr "" +"می‌توان یک دستور راه‌اندازی ارائه کرد که تنها یک بار در ابتدا اجرا می‌شود:" msgid "" "$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"char in text\"\n" @@ -212,9 +423,24 @@ msgid "" "$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"text.find(char)\"\n" "1000000 loops, best of 5: 0.342 usec per loop" msgstr "" +"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"char in text\"\n" +"5000000 loops, best of 5: 0.0877 usec per loop\n" +"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"text.find(char)\"\n" +"1000000 loops, best of 5: 0.342 usec per loop" -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 repetition count ('best of 5') which tells you how many times the timing loop was repeated, and finally the time the statement body took on average within the best repetition of the timing loop. That is, the time the fastest repetition took divided by the loop count." -msgstr "" +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 " +"repetition count ('best of 5') which tells you how many times the timing " +"loop was repeated, and finally the time the statement body took on average " +"within the best repetition of the timing loop. That is, the time the fastest" +" repetition took divided by the loop count." +msgstr "" +"در خروجی، سه فیلد وجود دارد. تعداد حلقه، که به شما می‌گوید بدنه دستور در هر " +"تکرار حلقه زمان‌سنجی چند بار اجرا شده است. تعداد تکرار («بهترین از ۵») که به" +" شما می‌گوید حلقه زمان‌سنجی چند بار تکرار شده است، و در نهایت زمانی که بدنه " +"دستور به‌طور میانگین در بهترین تکرار حلقه زمان‌سنجی طول کشیده است. یعنی " +"زمانی که سریع‌ترین تکرار طول کشیده است، تقسیم بر تعداد حلقه." msgid "" ">>> import timeit\n" @@ -223,9 +449,16 @@ msgid "" ">>> timeit.timeit('text.find(char)', setup='text = \"sample string\"; char = \"g\"')\n" "1.7246671520006203" msgstr "" +">>> import timeit\n" +">>> timeit.timeit('char in text', setup='text = \"sample string\"; char = \"g\"')\n" +"0.41440500499993504\n" +">>> timeit.timeit('text.find(char)', setup='text = \"sample string\"; char = \"g\"')\n" +"1.7246671520006203" msgid "The same can be done using the :class:`Timer` class and its methods::" msgstr "" +"همین کار را می‌توان با استفاده از کلاس :class:`Timer` و متدهای آن انجام " +"داد::" msgid "" ">>> import timeit\n" @@ -235,9 +468,23 @@ msgid "" ">>> t.repeat()\n" "[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, 0.3712595970846668, 0.37866875250654886]" msgstr "" +">>> import timeit\n" +">>> t = timeit.Timer('char in text', setup='text = \"sample string\"; char = \"g\"')\n" +">>> t.timeit()\n" +"0.3955516149999312\n" +">>> t.repeat()\n" +"[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, 0.3712595970846668, 0.37866875250654886]" -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:" +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 "" +"مثال‌های زیر نشان می‌دهند که چگونه عبارت‌هایی را که شامل چند خط هستند " +"زمان‌سنجی کنیم. در اینجا هزینه‌ی استفاده از :func:`hasattr` در مقایسه با " +":keyword:`try`/:keyword:`except` را برای بررسی نبودن یا وجود داشتن ویژگی‌های" +" شیء مقایسه می‌کنیم:" msgid "" "$ python -m timeit \"try:\" \" str.__bool__\" \"except AttributeError:\" \" pass\"\n" @@ -250,6 +497,15 @@ msgid "" "$ python -m timeit \"if hasattr(int, '__bool__'): pass\"\n" "100000 loops, best of 5: 2.23 usec per loop" msgstr "" +"$ python -m timeit \"try:\" \" str.__bool__\" \"except AttributeError:\" \" pass\"\n" +"20000 loops, best of 5: 15.7 usec per loop\n" +"$ python -m timeit \"if hasattr(str, '__bool__'): pass\"\n" +"50000 loops, best of 5: 4.26 usec per loop\n" +"\n" +"$ python -m timeit \"try:\" \" int.__bool__\" \"except AttributeError:\" \" pass\"\n" +"200000 loops, best of 5: 1.43 usec per loop\n" +"$ python -m timeit \"if hasattr(int, '__bool__'): pass\"\n" +"100000 loops, best of 5: 2.23 usec per loop" msgid "" ">>> import timeit\n" @@ -279,9 +535,39 @@ msgid "" ">>> timeit.timeit(stmt=s, number=100000)\n" "0.08588060699912603" msgstr "" +">>> import timeit\n" +">>> # attribute is missing\n" +">>> s = \"\"\"\\\n" +"... try:\n" +"... str.__bool__\n" +"... except AttributeError:\n" +"... pass\n" +"... \"\"\"\n" +">>> timeit.timeit(stmt=s, number=100000)\n" +"0.9138244460009446\n" +">>> s = \"if hasattr(str, '__bool__'): pass\"\n" +">>> timeit.timeit(stmt=s, number=100000)\n" +"0.5829014980008651\n" +">>>\n" +">>> # attribute is present\n" +">>> s = \"\"\"\\\n" +"... try:\n" +"... int.__bool__\n" +"... except AttributeError:\n" +"... pass\n" +"... \"\"\"\n" +">>> timeit.timeit(stmt=s, number=100000)\n" +"0.04215312199994514\n" +">>> s = \"if hasattr(int, '__bool__'): pass\"\n" +">>> timeit.timeit(stmt=s, number=100000)\n" +"0.08588060699912603" -msgid "To give the :mod:`!timeit` module access to functions you define, you can pass a *setup* parameter which contains an import statement::" +msgid "" +"To give the :mod:`!timeit` module access to functions you define, you can " +"pass a *setup* parameter which contains an import statement::" msgstr "" +"برای دادن دسترسی ماژول :mod:`!timeit` به توابعی که تعریف می‌کنید، می‌توانید " +"یک پارامتر *setup* که شامل یک دستور ایمپورت است ارسال کنید::" msgid "" "def test():\n" @@ -292,9 +578,22 @@ msgid "" " import timeit\n" " print(timeit.timeit(\"test()\", setup=\"from __main__ import test\"))" msgstr "" +"def test():\n" +" \"\"\"Stupid test function\"\"\"\n" +" L = [i for i in range(100)]\n" +"\n" +"if __name__ == '__main__':\n" +" import timeit\n" +" print(timeit.timeit(\"test()\", setup=\"from __main__ import test\"))" -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. This can be more convenient than individually specifying imports::" +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. " +"This can be more convenient than individually specifying imports::" msgstr "" +"گزینه‌ی دیگر، ارسال :func:`globals` به پارامتر *globals* است که باعث می‌شود " +"کد در فضای نام سراسری کنونی شما اجرا شود. این کار می‌تواند راحت‌تر از مشخص " +"کردن ایمپورت‌ها به‌صورت جداگانه باشد::" msgid "" "def f(x):\n" @@ -307,9 +606,18 @@ msgid "" "import timeit\n" "print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))" msgstr "" +"def f(x):\n" +" return x**2\n" +"def g(x):\n" +" return x**4\n" +"def h(x):\n" +" return x**8\n" +"\n" +"import timeit\n" +"print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))" msgid "Benchmarking" -msgstr "" +msgstr "محک‌زنی (Benchmarking)" msgid "Performance" -msgstr "" +msgstr "کارایی" diff --git a/library/tk.po b/library/tk.po index d01183bc9..cde637299 100644 --- a/library/tk.po +++ b/library/tk.po @@ -24,25 +24,58 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Graphical user interfaces with Tk" -msgstr "" +msgstr "رابط‌های کاربری گرافیکی با Tk" -msgid "Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.ttk` module." +msgid "" +"Tk/Tcl has long been an integral part of Python. It provides a robust and " +"platform independent windowing toolkit, that is available to Python " +"programmers using the :mod:`tkinter` package, and its extension, the " +":mod:`tkinter.ttk` module." msgstr "" +"Tk/Tcl مدت‌هاست که بخشی جدایی‌ناپذیر از پایتون بوده است. این ابزار یک " +"جعبه‌ابزار پنجره‌بندی قدرتمند و مستقل از پلتفرم فراهم می‌کند که " +"برنامه‌نویسان پایتون با استفاده از بسته‌ی :mod:`tkinter` و افزونه‌ی آن، " +"ماژول :mod:`tkinter.ttk`، به آن دسترسی دارند." -msgid "The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To use :mod:`tkinter`, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally the Tcl documentation. :mod:`tkinter` is a set of wrappers that implement the Tk widgets as Python classes." +msgid "" +"The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk." +" To use :mod:`tkinter`, you don't need to write Tcl code, but you will need " +"to consult the Tk documentation, and occasionally the Tcl documentation. " +":mod:`tkinter` is a set of wrappers that implement the Tk widgets as Python " +"classes." msgstr "" +"بسته‌ی :mod:`tkinter` یک لایه‌ی شیء‌گرای نازک بر روی Tcl/Tk است. برای " +"استفاده از :mod:`tkinter`، نیازی به نوشتن کد Tcl ندارید، اما لازم است به " +"مستندات Tk و گاهی به مستندات Tcl مراجعه کنید. :mod:`tkinter` مجموعه‌ای از " +"دربرگیرنده‌ها است که ابزارک‌های Tk را به‌عنوان کلاس‌های پایتون پیاده‌سازی " +"می‌کنند." -msgid ":mod:`tkinter`'s chief virtues are that it is fast, and that it usually comes bundled with Python. Although its standard documentation is weak, good material is available, which includes: references, tutorials, a book and others. :mod:`tkinter` is also famous for having an outdated look and feel, which has been vastly improved in Tk 8.5. Nevertheless, there are many other GUI libraries that you could be interested in. The Python wiki lists several alternative `GUI frameworks and tools `_." +msgid "" +":mod:`tkinter`'s chief virtues are that it is fast, and that it usually " +"comes bundled with Python. Although its standard documentation is weak, good" +" material is available, which includes: references, tutorials, a book and " +"others. :mod:`tkinter` is also famous for having an outdated look and feel, " +"which has been vastly improved in Tk 8.5. Nevertheless, there are many other" +" GUI libraries that you could be interested in. The Python wiki lists " +"several alternative `GUI frameworks and tools " +"`_." msgstr "" +"مزایای اصلی :mod:`tkinter` این است که سریع است و معمولاً به‌همراه Python " +"ارائه می‌شود. اگرچه مستندات استاندارد آن ضعیف است، محتوای خوبی در دسترس است " +"که شامل مراجع، آموزش‌ها، یک کتاب و موارد دیگر می‌شود. :mod:`tkinter` همچنین " +"به داشتن ظاهر و حسی قدیمی شهرت دارد که در Tk 8.5 بسیار بهبود یافته است. با " +"این حال، کتابخانه‌های GUI بسیاری وجود دارند که ممکن است به آن‌ها علاقه‌مند " +"باشید. ویکی Python چندین `چارچوب و ابزار GUI " +"`_ جایگزین را فهرست کرده است." msgid "GUI" -msgstr "" +msgstr "رابط کاربری گرافیکی (GUI)" msgid "Graphical User Interface" -msgstr "" +msgstr "رابط کاربری گرافیکی" msgid "Tkinter" -msgstr "" +msgstr "Tkinter" msgid "Tk" -msgstr "" +msgstr "Tk" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index a172ef6e5..1708ebc95 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -22,25 +22,55 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tkinter.colorchooser` --- Color choosing dialog" -msgstr "" +msgstr ":mod:`!tkinter.colorchooser` --- پنجره‌ی انتخاب رنگ" msgid "**Source code:** :source:`Lib/tkinter/colorchooser.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/colorchooser.py`" -msgid "The :mod:`!tkinter.colorchooser` module provides the :class:`Chooser` class as an interface to the native color picker dialog. ``Chooser`` implements a modal color choosing dialog window. The ``Chooser`` class inherits from the :class:`~tkinter.commondialog.Dialog` class." +msgid "" +"The :mod:`!tkinter.colorchooser` module provides the :class:`Chooser` class " +"as an interface to the native color picker dialog. ``Chooser`` implements a " +"modal color choosing dialog window. The ``Chooser`` class inherits from the " +":class:`~tkinter.commondialog.Dialog` class." msgstr "" +"ماژول :mod:`!tkinter.colorchooser` کلاس :class:`Chooser` را به‌عنوان رابطی " +"برای پنجره محاوره‌ی انتخاب رنگ بومی فراهم می‌کند. ``Chooser`` یک پنجره " +"محاوره‌ای مودال برای انتخاب رنگ پیاده‌سازی می‌کند. کلاس ``Chooser`` از کلاس " +":class:`~tkinter.commondialog.Dialog` ارث می‌برد." -msgid "The class implementing the modal color-choosing dialog. Most applications use the :func:`askcolor` convenience function rather than instantiating this class directly." +msgid "" +"The class implementing the modal color-choosing dialog. Most applications " +"use the :func:`askcolor` convenience function rather than instantiating this" +" class directly." msgstr "" +"کلاسی که پنجره محاوره‌ای مودال (modal) برای انتخاب رنگ را پیاده‌سازی می‌کند." +" بیشتر برنامه‌ها به‌جای نمونه‌سازی مستقیم این کلاس، از تابع تسهیل‌کننده " +":func:`askcolor` استفاده می‌کنند." -msgid "Show a modal color-choosing dialog and return the chosen color. *color* is the color selected when the dialog opens. The return value is a tuple ``((r, g, b), hexstr)``, where ``r``, ``g`` and ``b`` are the red, green and blue components as integers in the range 0–255 and *hexstr* is the equivalent Tk color string, such as ``'#ff8000'``. If the user cancels the dialog, ``(None, None)`` is returned." +msgid "" +"Show a modal color-choosing dialog and return the chosen color. *color* is " +"the color selected when the dialog opens. The return value is a tuple ``((r," +" g, b), hexstr)``, where ``r``, ``g`` and ``b`` are the red, green and blue " +"components as integers in the range 0–255 and *hexstr* is the equivalent Tk " +"color string, such as ``'#ff8000'``. If the user cancels the dialog, " +"``(None, None)`` is returned." msgstr "" +"یک پنجره‌ی محاوره‌ای مودال برای انتخاب رنگ نمایش می‌دهد و رنگ انتخاب‌شده را " +"برمی‌گرداند. *color* رنگی است که هنگام باز شدن پنجره‌ی محاوره‌ای انتخاب شده " +"است. مقدار بازگشتی یک تاپل ``((r, g, b), hexstr)`` است، که در آن ``r``، " +"``g`` و ``b`` کامپوننت‌های قرمز، سبز و آبی به‌صورت اعداد صحیح در بازه‌ی ۰ تا" +" ۲۵۵ هستند و *hexstr* رشته‌ی رنگ معادل در Tk است، مانند ``'#ff8000'``. اگر " +"کاربر پنجره‌ی محاوره‌ای را لغو کند، ``(None, None)`` برگردانده می‌شود." -msgid "The RGB values in the returned color are now integers in the range 0–255 instead of floats." +msgid "" +"The RGB values in the returned color are now integers in the range 0–255 " +"instead of floats." msgstr "" +"مقادیر RGB در رنگ برگردانده‌شده اکنون به‌جای مقادیر شناور، اعداد صحیح در " +"بازه‌ی ۰ تا ۲۵۵ هستند." msgid "Module :mod:`tkinter.commondialog`" -msgstr "" +msgstr "ماژول :mod:`tkinter.commondialog`" msgid "Tkinter standard dialog module" -msgstr "" +msgstr "ماژول پنجره محاوره‌ای استاندارد Tkinter" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 1b71b331e..2e7d719f4 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -22,61 +22,99 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tkinter.dnd` --- Drag and drop support" -msgstr "" +msgstr ":mod:`!tkinter.dnd` --- پشتیبانی از کشیدن و رها کردن" msgid "**Source code:** :source:`Lib/tkinter/dnd.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/dnd.py`" -msgid "This is experimental and due to be deprecated when it is replaced with the Tk DND." -msgstr "" +msgid "" +"This is experimental and due to be deprecated when it is replaced with the " +"Tk DND." +msgstr "این آزمایشی است و قرار است زمانی که با Tk DND جایگزین شود، منسوخ شود." -msgid "The :mod:`!tkinter.dnd` module provides drag-and-drop support for objects within a single application, within the same window or between windows. To enable an object to be dragged, you must create an event binding for it that starts the drag-and-drop process. Typically, you bind a ButtonPress event to a callback function that you write (see :ref:`Bindings-and-Events`). The function should call :func:`dnd_start`, where *source* is the object to be dragged, and *event* is the event that invoked the call (the argument to your callback function)." -msgstr "" +msgid "" +"The :mod:`!tkinter.dnd` module provides drag-and-drop support for objects " +"within a single application, within the same window or between windows. To " +"enable an object to be dragged, you must create an event binding for it that" +" starts the drag-and-drop process. Typically, you bind a ButtonPress event " +"to a callback function that you write (see :ref:`Bindings-and-Events`). The " +"function should call :func:`dnd_start`, where *source* is the object to be " +"dragged, and *event* is the event that invoked the call (the argument to " +"your callback function)." +msgstr "" +"ماژول :mod:`!tkinter.dnd` پشتیبانی از کشیدن و رها کردن اشیاء درون یک برنامه " +"واحد، درون همان پنجره یا بین پنجره‌ها را فراهم می‌کند. برای فعال کردن امکان " +"کشیدن یک شیء، باید برای آن یک پیوند رویداد ایجاد کنید که فرآیند کشیدن و رها " +"کردن را آغاز می‌کند. معمولاً یک رویداد ButtonPress را به یک تابع کال‌بک که " +"خودتان می‌نویسید مقید میکنید (به :ref:`Bindings-and-Events` مراجعه کنید). " +"این تابع باید :func:`dnd_start` را فراخوانی کند، که در آن *source* شیءای است " +"که باید کشیده شود، و *event* رویدادی است که این فراخوانی را ایجاد کرده است " +"(آرگومان تابع کال‌بک شما)." msgid "Selection of a target object occurs as follows:" -msgstr "" +msgstr "انتخاب یک شیء هدف به صورت زیر انجام می‌شود:" msgid "Top-down search of the area under the mouse for a target widget:" -msgstr "" +msgstr "جستجوی بالا به پایین در ناحیه‌ی زیر ماوس برای یک ابزارک هدف (widget):" msgid "the target widget should have a callable *dnd_accept* attribute;" -msgstr "" +msgstr "ابزارک هدف باید یک ویژگی *dnd_accept* قابل فراخوانی داشته باشد؛" -msgid "if *dnd_accept* is not present or returns ``None``, the search moves to the parent widget;" +msgid "" +"if *dnd_accept* is not present or returns ``None``, the search moves to the " +"parent widget;" msgstr "" +"اگر *dnd_accept* وجود نداشته باشد یا ``None`` را برگرداند، جستجو به ابزارک " +"والد منتقل می‌شود؛" msgid "if no target widget is found, the target object is ``None``." -msgstr "" +msgstr "اگر هیچ ابزارک هدفی یافت نشود، شیء هدف ``None`` خواهد بود." msgid "Call to ``.dnd_leave(source, event)``." -msgstr "" +msgstr "فراخوانی ``.dnd_leave(source, event)``." msgid "Call to ``.dnd_enter(source, event)``." -msgstr "" +msgstr "فراخوانی ``.dnd_enter(source, event)``." msgid "Call to ``.dnd_commit(source, event)`` to notify of the drop." msgstr "" +"فراخوانی ``.dnd_commit(source, event)`` برای آگاه‌سازی از رها شدن." -msgid "Call to ``.dnd_end(target, event)`` to signal the end of drag-and-drop." +msgid "" +"Call to ``.dnd_end(target, event)`` to signal the end of drag-and-" +"drop." msgstr "" +"برای اعلام پایان عملیات کشیدن و رها کردن، ``.dnd_end(target, " +"event)`` را فراخوانی کنید." -msgid "The *DndHandler* class handles drag-and-drop events tracking Motion and ButtonRelease events on the root of the event widget." +msgid "" +"The *DndHandler* class handles drag-and-drop events tracking Motion and " +"ButtonRelease events on the root of the event widget." msgstr "" +"کلاس *DndHandler* رویدادهای کشیدن و رها کردن را با پیگیری رویدادهای Motion و" +" ButtonRelease روی ریشه‌ی ابزارک رویداد مدیریت می‌کند." msgid "Cancel the drag-and-drop process." -msgstr "" +msgstr "فرآیند کشیدن و رها کردن را لغو کنید." msgid "Execute end of drag-and-drop functions." -msgstr "" +msgstr "توابع پایانِ کشیدن و رها کردن را اجرا کنید." msgid "Inspect area below mouse for target objects while a drag is performed." -msgstr "" +msgstr "در حین کشیدن، ناحیه زیر ماوس را برای اشیاء هدف بررسی کنید." msgid "Signal end of drag when the release pattern is triggered." msgstr "" +"هنگامی که الگوی رها کردن فعال می‌شود، سیگنال پایان کشیدن را ارسال کنید." -msgid "Factory function for the drag-and-drop process. Return the :class:`DndHandler` instance managing the drag, or ``None`` if a drag could not be started." +msgid "" +"Factory function for the drag-and-drop process. Return the " +":class:`DndHandler` instance managing the drag, or ``None`` if a drag could " +"not be started." msgstr "" +"تابع کارخانه‌ای برای فرآیند کشیدن و رها کردن. نمونه‌ی :class:`DndHandler` را که " +"عملیات کشیدن را مدیریت می‌کند برمی‌گرداند، یا اگر امکان آغاز عملیات کشیدن " +"وجود نداشت، ``None`` برمی‌گرداند." msgid ":ref:`Bindings-and-Events`" -msgstr "" +msgstr ":ref:`Bindings-and-Events`" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 700c070b7..e22a4bd3e 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -22,112 +22,176 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tkinter.font` --- Tkinter font wrapper" -msgstr "" +msgstr ":mod:`!tkinter.font` --- پوششی برای فونت Tkinter" msgid "**Source code:** :source:`Lib/tkinter/font.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/font.py`" -msgid "The :mod:`!tkinter.font` module provides the :class:`Font` class for creating and using named fonts." +msgid "" +"The :mod:`!tkinter.font` module provides the :class:`Font` class for " +"creating and using named fonts." msgstr "" +"ماژول :mod:`!tkinter.font` کلاس :class:`Font` را برای ایجاد و استفاده از " +"فونت‌های نام‌گذاری‌شده فراهم می‌کند." msgid "The different font weights and slants are:" -msgstr "" +msgstr "وزن‌ها و شیب‌های مختلف فونت عبارتند از:" -msgid "The :class:`Font` class represents a named font. *Font* instances are given unique names and can be specified by their family, size, and style configuration. Named fonts are Tk's method of creating and identifying fonts as a single object, rather than specifying a font by its attributes with each occurrence." -msgstr "" +msgid "" +"The :class:`Font` class represents a named font. *Font* instances are given " +"unique names and can be specified by their family, size, and style " +"configuration. Named fonts are Tk's method of creating and identifying fonts" +" as a single object, rather than specifying a font by its attributes with " +"each occurrence." +msgstr "" +"کلاس :class:`Font` نشان‌دهنده یک فونت نام‌گذاری‌شده است. نمونه‌های *Font* " +"نام‌های یکتا دریافت می‌کنند و می‌توانند با پیکربندی خانواده، اندازه و سبکشان" +" مشخص شوند. فونت‌های نام‌گذاری‌شده روش Tk برای ایجاد و شناسایی فونت‌ها " +"به‌عنوان یک شیء واحد هستند، به‌جای آنکه هر بار یک فونت با ویژگی‌هایش مشخص " +"شود." -msgid "Two fonts now compare equal (``==``) only when both are :class:`Font` instances with the same name belonging to the same Tcl interpreter." +msgid "" +"Two fonts now compare equal (``==``) only when both are :class:`Font` " +"instances with the same name belonging to the same Tcl interpreter." msgstr "" +"دو فونت اکنون تنها زمانی برابر (``==``) مقایسه می‌شوند که هر دو نمونه‌هایی " +"از :class:`Font` با نام یکسان و متعلق به یک مفسر Tcl باشند." msgid "arguments:" -msgstr "" +msgstr "آرگومان‌ها:" msgid "*font* - font specifier tuple (family, size, options)" -msgstr "" +msgstr "*font* - تاپل مشخص‌کننده فونت (خانواده، اندازه، گزینه‌ها)" msgid "*name* - unique font name" -msgstr "" +msgstr "*name* - نام یکتای فونت" msgid "*exists* - self points to existing named font if true" msgstr "" +"*exists* - اگر true باشد، self به فونت نام‌گذاری‌شده‌ی موجود اشاره می‌کند" msgid "additional keyword options (ignored if *font* is specified):" msgstr "" +"گزینه‌های کلیدواژه‌ای اضافی (اگر *font* مشخص شده باشد، نادیده گرفته " +"می‌شوند):" msgid "*family* - font family, for example, Courier, Times" -msgstr "" +msgstr "*family* - خانواده قلم، برای مثال Courier، Times" msgid "*size* - font size" -msgstr "" +msgstr "*size* - اندازه‌ی قلم" msgid "If *size* is positive it is interpreted as size in points." -msgstr "" +msgstr "اگر *size* مثبت باشد، به‌عنوان اندازه بر حسب نقطه تفسیر می‌شود." msgid "If *size* is a negative number its absolute value is treated" -msgstr "" +msgstr "اگر *size* عددی منفی باشد، مقدار مطلق آن در نظر گرفته می‌شود" msgid "as size in pixels." -msgstr "" +msgstr "به‌عنوان اندازه به پیکسل." msgid "*weight* - font emphasis (NORMAL, BOLD)" -msgstr "" +msgstr "*weight* - تأکید قلم (NORMAL, BOLD)" msgid "*slant* - ROMAN, ITALIC" -msgstr "" +msgstr "*slant* - ROMAN, ITALIC" msgid "*underline* - font underlining (0 - none, 1 - underline)" -msgstr "" +msgstr "*underline* - زیرخط قلم (۰ - بدون زیرخط، ۱ - زیرخط)" msgid "*overstrike* - font strikeout (0 - none, 1 - strikeout)" -msgstr "" +msgstr "*overstrike* - خط‌خوردگی قلم (۰ - بدون، ۱ - خط‌خورده)" -msgid "Return the actual attributes of the font, which may differ from the requested ones because of platform limitations. With no *option*, return a dictionary of all the attributes; if *option* is given, return the value of that single attribute. The attributes are resolved on the display of the *displayof* widget, or the main application window if it is not specified." -msgstr "" +msgid "" +"Return the actual attributes of the font, which may differ from the " +"requested ones because of platform limitations. With no *option*, return a " +"dictionary of all the attributes; if *option* is given, return the value of " +"that single attribute. The attributes are resolved on the display of the " +"*displayof* widget, or the main application window if it is not specified." +msgstr "" +"ویژگی‌های واقعی قلم را برمی‌گرداند، که ممکن است به دلیل محدودیت‌های سکو با " +"ویژگی‌های درخواست‌شده متفاوت باشند. بدون *option*، یک دیکشنری از تمام " +"ویژگی‌ها را برمی‌گرداند؛ اگر *option* داده شود، مقدار همان ویژگی واحد را " +"برمی‌گرداند. ویژگی‌ها بر روی نمایشگرِ ابزارک *displayof* تعیین می‌شوند، یا " +"در صورت مشخص نبودن، بر روی پنجره‌ی اصلی برنامه." msgid "Retrieve an attribute of the font." -msgstr "" +msgstr "ویژگی‌ای از فونت را بازیابی می‌کند." -msgid "Modify one or more attributes of the font. With no arguments, return a dictionary of the current attributes." +msgid "" +"Modify one or more attributes of the font. With no arguments, return a " +"dictionary of the current attributes." msgstr "" +"یک یا چند ویژگی قلم را تغییر می‌دهد. بدون آرگومان، یک دیکشنری از ویژگی‌های " +"فعلی را برمی‌گرداند." msgid ":meth:`config` is an alias of :meth:`!configure`." -msgstr "" +msgstr ":meth:`config` نام مستعار :meth:`!configure` است." -msgid "Return a distinct copy of the current font: a new named font with the same attributes but a different name, which can be reconfigured independently of the original. If the current font wraps a font description, the copy is instead a named font with its resolved attributes." +msgid "" +"Return a distinct copy of the current font: a new named font with the same " +"attributes but a different name, which can be reconfigured independently of " +"the original. If the current font wraps a font description, the copy is " +"instead a named font with its resolved attributes." msgstr "" +"یک کپی متمایز از فونت جاری برمی‌گرداند: یک فونت نام‌گذاری‌شده‌ی جدید با همان " +"ویژگی‌ها اما با نامی متفاوت، که می‌توان آن را به‌طور مستقل از فونت اصلی " +"پیکربندی مجدد کرد. اگر فونت جاری دربرگیرنده‌ی یک توصیف فونت باشد، در عوض کپی " +"یک فونت نام‌گذاری‌شده با ویژگی‌های تعیین‌شده‌ی آن است." -msgid "Return amount of space the text would occupy on the specified display when formatted in the current font, as an integer number of pixels. If no display is specified then the main application window is assumed." +msgid "" +"Return amount of space the text would occupy on the specified display when " +"formatted in the current font, as an integer number of pixels. If no display" +" is specified then the main application window is assumed." msgstr "" +"میزان فضایی را که متن در نمایشگر مشخص‌شده هنگام قالب‌بندی با فونت جاری اشغال" +" خواهد کرد، به‌صورت عدد صحیحی از پیکسل برمی‌گرداند. اگر نمایشگری مشخص‌نشده " +"باشد، پنجره‌ی اصلی برنامه در نظر گرفته می‌شود." -msgid "Return font-specific data. With no options, return a dictionary mapping each metric name to its integer value; if one option name is given, return that metric's value as an integer. Options include:" +msgid "" +"Return font-specific data. With no options, return a dictionary mapping each" +" metric name to its integer value; if one option name is given, return that " +"metric's value as an integer. Options include:" msgstr "" +"داده‌های خاص قلم را برمی‌گرداند. بدون هیچ گزینه‌ای، دیکشنری‌ای را " +"برمی‌گرداند که هر نام معیار را به مقدار عدد صحیح آن نگاشت می‌کند؛ اگر نام یک" +" گزینه داده شود، مقدار آن معیار را به‌صورت عدد صحیح برمی‌گرداند. گزینه‌ها " +"شامل:" msgid "*ascent* - distance between baseline and highest point that a" -msgstr "" +msgstr "*ascent* - فاصله بین خط کرسی و بالاترین نقطه‌ای که یک" msgid "character of the font can occupy" -msgstr "" +msgstr "نویسه‌ای از فونت می‌تواند اشغال کند" msgid "*descent* - distance between baseline and lowest point that a" -msgstr "" +msgstr "*descent* - فاصله بین خط پایه و پایین‌ترین نقطه‌ای که یک" msgid "*linespace* - minimum vertical separation necessary between any two" -msgstr "" +msgstr "*linespace* - حداقل فاصله‌ی عمودی مورد نیاز بین هر دو" msgid "characters of the font that ensures no vertical overlap between lines." msgstr "" +"نویسه‌های قلمی که تضمین می‌کند هیچ هم‌پوشانی عمودی بین خطوط وجود نداشته " +"باشد." msgid "*fixed* - 1 if font is fixed-width else 0" -msgstr "" +msgstr "*fixed* - ۱ اگر فونت عرض‌ثابت باشد، در غیر این صورت ۰" msgid "Return a tuple of the names of the available font families." -msgstr "" +msgstr "یک تاپل از نام‌های خانواده‌های فونت موجود را برمی‌گرداند." msgid "Return a tuple of the names of all the defined fonts." -msgstr "" +msgstr "یک تاپل از نام‌های تمام قلم‌های تعریف‌شده را برمی‌گرداند." -msgid "Return a :class:`Font` representation of the existing named font *name*. *root* is the widget whose Tcl interpreter owns the font; if omitted, the default root window is used." +msgid "" +"Return a :class:`Font` representation of the existing named font *name*. " +"*root* is the widget whose Tcl interpreter owns the font; if omitted, the " +"default root window is used." msgstr "" +"بازنمایی :class:`Font` از فونت نام‌دار موجود *name* را برمی‌گرداند. *root* " +"ابزارکی است که مفسر Tcl آن مالک فونت است؛ اگر حذف شود، از پنجره‌ی ریشه‌ی پیش‌فرض" +" استفاده می‌شود." msgid "The *root* parameter was added." -msgstr "" +msgstr "پارامتر *root* افزوده شد." diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 9aed0be72..3aca2e20e 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -22,130 +22,247 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tkinter.messagebox` --- Tkinter message prompts" -msgstr "" +msgstr ":mod:`!tkinter.messagebox` --- اعلان‌های پیام Tkinter" msgid "**Source code:** :source:`Lib/tkinter/messagebox.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/messagebox.py`" -msgid "The :mod:`!tkinter.messagebox` module provides a template base class as well as a variety of convenience methods for commonly used configurations. The message boxes are modal: each blocks until the user responds, then returns a value that depends on the function. The ``show*`` functions and :meth:`Message.show` return the symbolic name of the button the user pressed, as a string (such as :data:`OK` or :data:`YES`). Common message box styles and layouts include but are not limited to:" -msgstr "" +msgid "" +"The :mod:`!tkinter.messagebox` module provides a template base class as well" +" as a variety of convenience methods for commonly used configurations. The " +"message boxes are modal: each blocks until the user responds, then returns a" +" value that depends on the function. The ``show*`` functions and " +":meth:`Message.show` return the symbolic name of the button the user " +"pressed, as a string (such as :data:`OK` or :data:`YES`). Common message box" +" styles and layouts include but are not limited to:" +msgstr "" +"ماژول :mod:`!tkinter.messagebox` یک کلاس پایه‌ی الگویی و همچنین مجموعه‌ای از" +" متدهای سهولت‌بخش برای پیکربندی‌های رایج را فراهم می‌کند. جعبه‌های پیام " +"مودال (modal) هستند: هر کدام تا زمانی که کاربر پاسخ دهد مسدود می‌شود، سپس " +"مقداری را برمی‌گرداند که به تابع بستگی دارد. توابع ``show*`` و " +":meth:`Message.show` نام نمادین دکمه‌ای را که کاربر فشار داده است، به‌صورت " +"یک رشته برمی‌گردانند (مانند :data:`OK` یا :data:`YES`). سبک‌ها و چیدمان‌های " +"رایج جعبه‌های پیام شامل موارد زیر هستند، اما به آن‌ها محدود نمی‌شوند:" -msgid "Create a message window with an application-specified message, an icon and a set of buttons. Each of the buttons in the message window is identified by a unique symbolic name (see the *type* options)." +msgid "" +"Create a message window with an application-specified message, an icon and a" +" set of buttons. Each of the buttons in the message window is identified by " +"a unique symbolic name (see the *type* options)." msgstr "" +"ایجاد یک پنجره پیام با پیام تعیین‌شده توسط برنامه، یک آیکون و مجموعه‌ای از " +"دکمه‌ها. هر یک از دکمه‌های موجود در پنجره پیام با یک نام نمادین یکتا شناسایی" +" می‌شود (گزینه‌های *type* را ببینید)." msgid "The following options are supported:" -msgstr "" +msgstr "از گزینه‌های زیر پشتیبانی می‌شود:" msgid "*command*" -msgstr "" +msgstr "*فرمان*" -msgid "Specifies the function to invoke when the user closes the dialog. The name of the button clicked by the user to close the dialog is passed as argument. This is only available on macOS." +msgid "" +"Specifies the function to invoke when the user closes the dialog. The name " +"of the button clicked by the user to close the dialog is passed as argument." +" This is only available on macOS." msgstr "" +"تابعی را که هنگام بستن دیالوگ توسط کاربر فراخوانی می‌شود، مشخص می‌کند. نام " +"دکمه‌ای که کاربر برای بستن دیالوگ روی آن کلیک کرده است، به‌عنوان آرگومان " +"ارسال می‌شود. این مورد فقط در macOS در دسترس است." msgid "*default*" -msgstr "" +msgstr "*پیش‌فرض*" -msgid "Gives the :ref:`symbolic name ` of the default button for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this option is not specified, the first button in the dialog will be made the default." +msgid "" +"Gives the :ref:`symbolic name ` of the default button " +"for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this " +"option is not specified, the first button in the dialog will be made the " +"default." msgstr "" +":ref:`نام نمادین ` دکمه پیش‌فرض این پنجره پیام را می‌دهد" +" (:data:`OK`، :data:`CANCEL`، و غیره). اگر این گزینه تعیین‌نشده باشد، اولین " +"دکمه در محاوره به‌عنوان پیش‌فرض قرار می‌گیرد." msgid "*detail*" -msgstr "" +msgstr "*جزئیات*" -msgid "Specifies an auxiliary message to the main message given by the *message* option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message." +msgid "" +"Specifies an auxiliary message to the main message given by the *message* " +"option. The message detail will be presented beneath the main message and, " +"where supported by the OS, in a less emphasized font than the main message." msgstr "" +"یک پیام کمکی برای پیام اصلی داده‌شده با گزینه *message* مشخص می‌کند. جزئیات " +"پیام زیر پیام اصلی نمایش داده می‌شود و، در صورت پشتیبانی سیستم‌عامل، با قلمی" +" با تأکید کمتر از پیام اصلی." msgid "*icon*" -msgstr "" +msgstr "*آیکون*" -msgid "Specifies an :ref:`icon ` to display. If this option is not specified, then the :data:`INFO` icon will be displayed." +msgid "" +"Specifies an :ref:`icon ` to display. If this option is " +"not specified, then the :data:`INFO` icon will be displayed." msgstr "" +"یک :ref:`آیکون ` را برای نمایش مشخص می‌کند. اگر این گزینه " +"مشخص نشده باشد، آیکون :data:`INFO` نمایش داده می‌شود." msgid "*message*" -msgstr "" +msgstr "*پیام*" -msgid "Specifies the message to display in this message box. The default value is an empty string." +msgid "" +"Specifies the message to display in this message box. The default value is " +"an empty string." msgstr "" +"پیامی را که باید در این جعبه پیام نمایش داده شود، مشخص می‌کند. مقدار پیش‌فرض" +" یک رشته خالی است." msgid "*parent*" -msgstr "" +msgstr "*والد*" -msgid "Makes the specified window the logical parent of the message box. The message box is displayed on top of its parent window." +msgid "" +"Makes the specified window the logical parent of the message box. The " +"message box is displayed on top of its parent window." msgstr "" +"پنجره‌ی مشخص‌شده را به‌عنوان والد منطقی جعبه پیام قرار می‌دهد. جعبه پیام روی " +"پنجره‌ی والد خود نمایش داده می‌شود." msgid "*title*" -msgstr "" +msgstr "*عنوان*" -msgid "Specifies a string to display as the title of the message box. This option is ignored on macOS, where platform guidelines forbid the use of a title on this kind of dialog." +msgid "" +"Specifies a string to display as the title of the message box. This option " +"is ignored on macOS, where platform guidelines forbid the use of a title on " +"this kind of dialog." msgstr "" +"رشته‌ای را برای نمایش به‌عنوان عنوان جعبه‌ی پیام مشخص می‌کند. این گزینه در " +"macOS نادیده گرفته می‌شود، زیرا دستورالعمل‌های پلتفرم استفاده از عنوان را " +"برای این نوع پنجره‌ی محاوره‌ای ممنوع می‌کنند." msgid "*type*" -msgstr "" +msgstr "*نوع*" -msgid "Arranges for a :ref:`predefined set of buttons ` to be displayed." +msgid "" +"Arranges for a :ref:`predefined set of buttons ` to be " +"displayed." msgstr "" +"ترتیبی می‌دهد که :ref:`مجموعه‌ای از دکمه‌های از پیش تعریف‌شده ` نمایش داده شود." msgid "Tk 8.6 added the *command* option." -msgstr "" +msgstr "Tk 8.6 گزینه‌ی *command* را افزود." -msgid "Display a message window and wait for the user to select one of the buttons. Then return the symbolic name of the selected button. Keyword arguments can override options specified in the constructor." +msgid "" +"Display a message window and wait for the user to select one of the buttons." +" Then return the symbolic name of the selected button. Keyword arguments can" +" override options specified in the constructor." msgstr "" +"یک پنجره‌ی پیام نمایش می‌دهد و منتظر می‌ماند تا کاربر یکی از دکمه‌ها را " +"انتخاب کند. سپس نام نمادین دکمه‌ی انتخاب‌شده را برمی‌گرداند. آرگومان‌های " +"کلیدواژه‌ای می‌توانند گزینه‌های تعیین‌شده در سازنده را بازنویسی کنند." msgid "**Information message box**" -msgstr "" +msgstr "جعبه پیام اطلاعات" -msgid "Creates and displays an information message box with the specified title and message." -msgstr "" +msgid "" +"Creates and displays an information message box with the specified title and" +" message." +msgstr "یک جعبه پیام اطلاعاتی با عنوان و پیام مشخص‌شده ایجاد و نمایش می‌دهد." msgid "**Warning message boxes**" -msgstr "" +msgstr "جعبه‌های پیام هشدار" -msgid "Creates and displays a warning message box with the specified title and message." -msgstr "" +msgid "" +"Creates and displays a warning message box with the specified title and " +"message." +msgstr "یک جعبه پیام هشدار با عنوان و پیام مشخص‌شده ایجاد و نمایش می‌دهد." -msgid "Creates and displays an error message box with the specified title and message." -msgstr "" +msgid "" +"Creates and displays an error message box with the specified title and " +"message." +msgstr "یک جعبه پیام خطا با عنوان و پیام مشخص‌شده ایجاد و نمایش می‌دهد." msgid "**Question message boxes**" -msgstr "" +msgstr "جعبه‌های پیام پرسشی" -msgid "Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns the symbolic name of the selected button." +msgid "" +"Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns" +" the symbolic name of the selected button." msgstr "" +"یک سؤال می‌پرسد. به‌طور پیش‌فرض دکمه‌های :data:`YES` و :data:`NO` را نمایش " +"می‌دهد. نام نمادین دکمه انتخاب‌شده را برمی‌گرداند." -msgid "Ask if operation should proceed. Shows buttons :data:`OK` and :data:`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise." +msgid "" +"Ask if operation should proceed. Shows buttons :data:`OK` and " +":data:`CANCEL`. Returns ``True`` if the answer is ok and ``False`` " +"otherwise." msgstr "" +"می‌پرسد که آیا عملیات باید ادامه یابد. دکمه‌های :data:`OK` و :data:`CANCEL` " +"را نمایش می‌دهد. اگر پاسخ تأیید باشد، ``True`` و در غیر این صورت ``False`` " +"برمی‌گرداند." -msgid "Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:`CANCEL`. Return ``True`` if the answer is retry and ``False`` otherwise." +msgid "" +"Ask if operation should be retried. Shows buttons :data:`RETRY` and " +":data:`CANCEL`. Return ``True`` if the answer is retry and ``False`` " +"otherwise." msgstr "" +"می‌پرسد که آیا عملیات باید دوباره انجام شود. دکمه‌های :data:`RETRY` و " +":data:`CANCEL` را نمایش می‌دهد. اگر پاسخ، تلاش مجدد باشد ``True`` و در غیر " +"این صورت ``False`` برمی‌گرداند." -msgid "Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` if the answer is yes and ``False`` otherwise." +msgid "" +"Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` " +"if the answer is yes and ``False`` otherwise." msgstr "" +"پرسشی می‌پرسد. دکمه‌های :data:`YES` و :data:`NO` را نمایش می‌دهد. اگر پاسخ " +"«بله» باشد ``True`` و در غیر این صورت ``False`` برمی‌گرداند." -msgid "Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` otherwise." +msgid "" +"Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. " +"Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` " +"otherwise." msgstr "" +"یک پرسش می‌پرسد. دکمه‌های :data:`YES`، :data:`NO` و :data:`CANCEL` را نمایش " +"می‌دهد. اگر پاسخ بله باشد ``True``، اگر لغو شده باشد ``None``، و در غیر این " +"صورت ``False`` را برمی‌گرداند." msgid "Symbolic names of buttons:" -msgstr "" +msgstr "نام‌های نمادین دکمه‌ها:" msgid "Predefined sets of buttons:" -msgstr "" +msgstr "مجموعه‌های از پیش تعریف‌شده از دکمه‌ها:" -msgid "Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` and :data:`IGNORE`." +msgid "" +"Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY`" +" and :data:`IGNORE`." msgstr "" +"سه دکمه با نام‌های نمادین :data:`ABORT`، :data:`RETRY` و :data:`IGNORE` " +"نمایش می‌دهد." msgid "Displays one button whose symbolic name is :data:`OK`." -msgstr "" +msgstr "یک دکمه را نمایش می‌دهد که نام نمادین آن :data:`OK` است." -msgid "Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." +msgid "" +"Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." msgstr "" +"دو دکمه را نمایش می‌دهد که نام‌های نمادین آن‌ها :data:`OK` و :data:`CANCEL` " +"هستند." -msgid "Displays two buttons whose symbolic names are :data:`RETRY` and :data:`CANCEL`." +msgid "" +"Displays two buttons whose symbolic names are :data:`RETRY` and " +":data:`CANCEL`." msgstr "" +"دو دکمه را نمایش می‌دهد که نام‌های نمادین آن‌ها :data:`RETRY` و " +":data:`CANCEL` هستند." -msgid "Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." +msgid "" +"Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." msgstr "" +"دو دکمه را نمایش می‌دهد که نام‌های نمادین آن‌ها :data:`YES` و :data:`NO` " +"هستند." -msgid "Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :data:`CANCEL`." +msgid "" +"Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and " +":data:`CANCEL`." msgstr "" +"سه دکمه را نمایش می‌دهد که نام‌های نمادین آن‌ها :data:`YES`، :data:`NO` و " +":data:`CANCEL` هستند." msgid "Icon images:" -msgstr "" +msgstr "تصاویر آیکون:" diff --git a/library/tkinter.po b/library/tkinter.po index 70b41a61b..5ea794e6c 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:15+0000\n" +"PO-Revision-Date: 2026-08-28 10:40+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,233 +23,414 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!tkinter` --- Python interface to Tcl/Tk" -msgstr "" +msgstr ":mod:`!tkinter` --- رابط پایتون به Tcl/Tk" msgid "**Source code:** :source:`Lib/tkinter/__init__.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/__init__.py`" -msgid "The :mod:`!tkinter` package (\"Tk interface\") is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and :mod:`!tkinter` are available on most Unix platforms, including macOS, as well as on Windows systems." +msgid "" +"The :mod:`!tkinter` package (\"Tk interface\") is the standard Python interface to " +"the Tcl/Tk GUI toolkit. Both Tk and :mod:`!tkinter` are available on most Unix " +"platforms, including macOS, as well as on Windows systems." msgstr "" +"بسته‌ی :mod:`!tkinter` («رابط Tk») رابط استاندارد پایتون برای جعبه‌ابزار رابط کاربری " +"گرافیکی Tcl/Tk است. Tk و :mod:`!tkinter` هر دو در بیشتر پلتفرم‌های یونیکس، از جمله " +"macOS، و همچنین در سیستم‌های ویندوز در دسترس هستند." -msgid "Running ``python -m tkinter`` from the command line should open a window demonstrating a simple Tk interface, letting you know that :mod:`!tkinter` is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version." +msgid "" +"Running ``python -m tkinter`` from the command line should open a window " +"demonstrating a simple Tk interface, letting you know that :mod:`!tkinter` is " +"properly installed on your system, and also showing what version of Tcl/Tk is " +"installed, so you can read the Tcl/Tk documentation specific to that version." msgstr "" +"اجرای ``python -m tkinter`` از خط فرمان باید پنجره‌ای را باز کند که یک رابط ساده Tk " +"را نمایش می‌دهد، به شما اطلاع می‌دهد که :mod:`!tkinter` به‌درستی روی سیستم شما نصب شده " +"است، و همچنین نشان می‌دهد چه نسخه‌ای از Tcl/Tk نصب شده است، تا بتوانید مستندات Tcl/Tk " +"مخصوص همان نسخه را بخوانید." -msgid "Tkinter supports a range of Tcl/Tk versions, built either with or without thread support. Tcl/Tk 8.5.12 is the minimum supported version; the official Python binary release bundles Tcl/Tk 8.6. See the source code for the :mod:`_tkinter` module for more information about supported versions." +msgid "" +"Tkinter supports a range of Tcl/Tk versions, built either with or without thread " +"support. Tcl/Tk 8.5.12 is the minimum supported version; the official Python binary " +"release bundles Tcl/Tk 8.6. See the source code for the :mod:`_tkinter` module for " +"more information about supported versions." msgstr "" +"Tkinter از محدوده‌ای از نسخه‌های Tcl/Tk پشتیبانی می‌کند، که با یا بدون پشتیبانی از نخ " +"ساخته شده‌اند. Tcl/Tk 8.5.12 حداقل نسخه پشتیبانی‌شده است؛ نسخه دودویی رسمی پایتون شامل " +"Tcl/Tk 8.6 می‌شود. برای اطلاعات بیشتر درباره نسخه‌های پشتیبانی‌شده، کد منبع " +"ماژول :mod:`_tkinter` را ببینید." msgid "Support for Tcl/Tk versions older than 8.5.12 was removed." -msgstr "" +msgstr "پشتیبانی از نسخه‌های قدیمی‌تر از 8.5.12 Tcl/Tk حذف شد." -msgid "Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make the experience more pythonic. This documentation will concentrate on these additions and changes, and refer to the official Tcl/Tk documentation for details that are unchanged." +msgid "" +"Tkinter is not a thin wrapper, but adds a fair amount of its own logic to make the " +"experience more pythonic. This documentation will concentrate on these additions and " +"changes, and refer to the official Tcl/Tk documentation for details that are " +"unchanged." msgstr "" +"Tkinter پوششی نازک نیست، بلکه مقدار قابل‌توجهی از منطق خود را اضافه می‌کند تا تجربه را " +"پایتونی‌تر کند. این مستندات بر این افزودنی‌ها و تغییرات تمرکز خواهد کرد و برای جزئیاتی " +"که بدون تغییر هستند، به مستندات رسمی Tcl/Tk ارجاع می‌دهد." -msgid "Tcl/Tk 8.5 (2007) introduced a modern set of themed user interface components along with a new API to use them (see :mod:`tkinter.ttk`). Both old and new APIs are still available. Most documentation you will find online still uses the old API and can be woefully outdated." +msgid "" +"Tcl/Tk 8.5 (2007) introduced a modern set of themed user interface components along " +"with a new API to use them (see :mod:`tkinter.ttk`). Both old and new APIs are still " +"available. Most documentation you will find online still uses the old API and can be " +"woefully outdated." msgstr "" +"Tcl/Tk 8.5 (2007) مجموعه‌ای مدرن از کامپوننت‌های رابط کاربری دارای تم را به همراه یک " +"API جدید برای استفاده از آن‌ها معرفی کرد (به :mod:`tkinter.ttk` مراجعه کنید). هر دو " +"API قدیمی و جدید همچنان در دسترس هستند. بیشتر مستنداتی که در اینترنت پیدا می‌کنید، " +"همچنان از API قدیمی استفاده می‌کنند و ممکن است به‌طرز تأسف‌باری قدیمی باشند." -msgid "This is an :term:`optional module`. If it is missing from your copy of CPython, look for documentation from your distributor (that is, whoever provided Python to you). If you are the distributor, see :ref:`optional-module-requirements`." +msgid "" +"This is an :term:`optional module`. If it is missing from your copy of CPython, look " +"for documentation from your distributor (that is, whoever provided Python to you). " +"If you are the distributor, see :ref:`optional-module-requirements`." msgstr "" +"این یک :term:`ماژول اختیاری ` است. اگر در نسخه CPython شما وجود " +"ندارد، به مستندات توزیع‌کننده خود مراجعه کنید (یعنی هر کسی که پایتون را در اختیار شما " +"قرار داده است). اگر شما توزیع‌کننده هستید، :ref:`optional-module-requirements` را " +"ببینید." msgid "`TkDocs `_" -msgstr "" +msgstr "`TkDocs `_" -msgid "Extensive tutorial on creating user interfaces with Tkinter. Explains key concepts, and illustrates recommended approaches using the modern API." +msgid "" +"Extensive tutorial on creating user interfaces with Tkinter. Explains key concepts, " +"and illustrates recommended approaches using the modern API." msgstr "" +"آموزش جامعی درباره‌ی ایجاد رابط‌های کاربری با Tkinter. مفاهیم کلیدی را توضیح می‌دهد و " +"رویکردهای توصیه‌شده را با استفاده از API مدرن نشان می‌دهد." msgid "`Tkinter 8.5 reference: a GUI for Python `_" msgstr "" +"مرجع Tkinter 8.5: یک رابط کاربری گرافیکی برای `پایتون `_" -msgid "Reference documentation for Tkinter 8.5 detailing available classes, methods, and options." +msgid "" +"Reference documentation for Tkinter 8.5 detailing available classes, methods, and " +"options." msgstr "" +"مستندات مرجع برای Tkinter 8.5 که کلاس‌ها، متدها و گزینه‌های موجود را با جزئیات شرح " +"می‌دهد." msgid "Tcl/Tk Resources:" -msgstr "" +msgstr "منابع Tcl/Tk:" msgid "`Tk commands `_" -msgstr "" +msgstr "دستورات `Tk `_" -msgid "Comprehensive reference to each of the underlying Tcl/Tk commands used by Tkinter." +msgid "" +"Comprehensive reference to each of the underlying Tcl/Tk commands used by Tkinter." msgstr "" +"مرجع جامع برای هر یک از دستورات زیربنایی Tcl/Tk که Tkinter از آن‌ها استفاده می‌کند." msgid "`Tcl/Tk Home Page `_" -msgstr "" +msgstr "`صفحه‌ی اصلی Tcl/Tk `_" msgid "Additional documentation, and links to Tcl/Tk core development." -msgstr "" +msgstr "مستندات بیشتر، و پیوندهایی به توسعه‌ی هسته‌ی Tcl/Tk." msgid "Books:" -msgstr "" +msgstr "کتاب‌ها:" msgid "`Modern Tkinter for Busy Python Developers `_" msgstr "" +"`Tkinter مدرن برای توسعه‌دهندگان پرمشغله پایتون `_" msgid "By Mark Roseman. (ISBN 978-1999149567)" -msgstr "" +msgstr "اثر مارک رزمن. (ISBN 978-1999149567)" -msgid "`Python GUI programming with Tkinter `_" +msgid "" +"`Python GUI programming with `Tkinter `_" msgstr "" +"برنامه‌نویسی GUI پایتون با `Tkinter `_" msgid "By Alan D. Moore. (ISBN 978-1788835886)" -msgstr "" +msgstr "اثر آلن دی. مور. (ISBN 978-1788835886)" msgid "`Programming Python `_" -msgstr "" +msgstr "`برنامه‌نویسی پایتون `_" msgid "By Mark Lutz; has excellent coverage of Tkinter. (ISBN 978-0596158101)" -msgstr "" +msgstr "اثر مارک لوتز؛ پوشش بسیار خوبی از Tkinter دارد. (ISBN 978-0596158101)" -msgid "`Tcl and the Tk Toolkit (2nd edition) `_" +msgid "" +"`Tcl and the Tk Toolkit (2nd edition) `_" msgstr "" +"`Tcl and the Tk Toolkit (ویرایش دوم) `_" -msgid "By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover Tkinter. (ISBN 978-0321336330)" +msgid "" +"By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover Tkinter. (ISBN " +"978-0321336330)" msgstr "" +"نوشته‌ی جان اوسترهاوت، خالق Tcl/Tk، و کن جونز؛ Tkinter را پوشش نمی‌دهد. (ISBN " +"978-0321336330)" msgid "Architecture" -msgstr "" +msgstr "معماری" -msgid "Tcl/Tk is not a single library but rather consists of a few distinct modules, each with separate functionality and its own official documentation. Python's binary releases also ship an add-on module together with it." +msgid "" +"Tcl/Tk is not a single library but rather consists of a few distinct modules, each " +"with separate functionality and its own official documentation. Python's binary " +"releases also ship an add-on module together with it." msgstr "" +"Tcl/Tk یک کتابخانه واحد نیست، بلکه شامل چند ماژول مجزا است که هر کدام عملکرد جداگانه " +"و مستندات رسمی خود را دارند. نسخه‌های دودویی پایتون نیز یک ماژول افزودنی را همراه با " +"آن عرضه می‌کنند." msgid "Tcl" -msgstr "" +msgstr "Tcl" -msgid "Tcl is a dynamic interpreted programming language, just like Python. Though it can be used on its own as a general-purpose programming language, it is most commonly embedded into C applications as a scripting engine or an interface to the Tk toolkit. The Tcl library has a C interface to create and manage one or more instances of a Tcl interpreter, run Tcl commands and scripts in those instances, and add custom commands implemented in either Tcl or C. Each interpreter has an event queue, and there are facilities to send events to it and process them. Unlike Python, Tcl's execution model is designed around cooperative multitasking, and Tkinter bridges this difference (see `Threading model`_ for details)." -msgstr "" +msgid "" +"Tcl is a dynamic interpreted programming language, just like Python. Though it can " +"be used on its own as a general-purpose programming language, it is most commonly " +"embedded into C applications as a scripting engine or an interface to the Tk " +"toolkit. The Tcl library has a C interface to create and manage one or more " +"instances of a Tcl interpreter, run Tcl commands and scripts in those instances, and " +"add custom commands implemented in either Tcl or C. Each interpreter has an event " +"queue, and there are facilities to send events to it and process them. Unlike " +"Python, Tcl's execution model is designed around cooperative multitasking, and " +"Tkinter bridges this difference (see `Threading model`_ for details)." +msgstr "" +"Tcl یک زبان برنامه‌نویسی پویا و تفسیری است، درست مانند پایتون. اگرچه می‌توان از آن " +"به‌تنهایی به‌عنوان یک زبان برنامه‌نویسی همه‌منظوره استفاده کرد، اما معمولاً به‌صورت " +"جاسازی‌شده در برنامه‌های C به‌عنوان یک موتور اسکریپت‌نویسی یا رابطی برای جعبه‌ابزار Tk به " +"کار می‌رود. کتابخانه Tcl یک رابط C برای ایجاد و مدیریت یک یا چند نمونه از مفسر Tcl، " +"اجرای دستورهای Tcl و اسکریپت‌های Tcl در آن نمونه‌ها، و افزودن دستورهای سفارشی " +"پیاده‌سازی‌شده با Tcl یا C دارد. هر مفسر یک صف رویداد دارد، و امکاناتی برای ارسال " +"رویدادها به آن و پردازش آن‌ها وجود دارد. برخلاف پایتون، مدل اجرای Tcl بر پایه " +"چندوظیفه‌ای مشارکتی (cooperative multitasking) طراحی شده است، و Tkinter این تفاوت را " +"پر می‌کند (برای جزئیات، `Threading model`_ را ببینید)." msgid "Tk" -msgstr "" +msgstr "Tk" -msgid "Tk is a `Tcl package `_ implemented in C that adds custom commands to create and manipulate GUI widgets. Each :class:`Tk` object embeds its own Tcl interpreter instance with Tk loaded into it. Tk's widgets are very customizable, though at the cost of a dated appearance. Tk uses Tcl's event queue to generate and process GUI events." -msgstr "" +msgid "" +"Tk is a `Tcl package `_ implemented in C that adds " +"custom commands to create and manipulate GUI widgets. Each :class:`Tk` object embeds " +"its own Tcl interpreter instance with Tk loaded into it. Tk's widgets are very " +"customizable, though at the cost of a dated appearance. Tk uses Tcl's event queue to " +"generate and process GUI events." +msgstr "" +"Tk یک `بسته Tcl `_ است که به زبان C پیاده‌سازی شده " +"است و دستورهای سفارشی برای ایجاد و دستکاری ویدجت‌های GUI اضافه می‌کند. هر " +"شیء :class:`Tk` یک نمونه مفسر Tcl مخصوص به خود را تعبیه می‌کند که Tk در آن بارگذاری " +"شده است. ویدجت‌های Tk بسیار قابل سفارشی‌سازی هستند، هرچند به بهای ظاهری قدیمی. Tk از " +"صف رویداد Tcl برای تولید و پردازش رویدادهای GUI استفاده می‌کند." msgid "Ttk" -msgstr "" +msgstr "Ttk" -msgid "Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better appearance on different platforms than many of the classic Tk widgets. Ttk is distributed as part of Tk, starting with Tk version 8.5. Python bindings are provided in a separate module, :mod:`tkinter.ttk`." +msgid "" +"Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better " +"appearance on different platforms than many of the classic Tk widgets. Ttk is " +"distributed as part of Tk, starting with Tk version 8.5. Python bindings are " +"provided in a separate module, :mod:`tkinter.ttk`." msgstr "" +"Themed Tk (Ttk) خانواده‌ای جدیدتر از ابزارک‌های Tk است که در پلتفرم‌های مختلف، ظاهر بسیار " +"بهتری نسبت به بسیاری از ابزارک‌های کلاسیک Tk دارد. Ttk از نسخه 8.5 Tk به بعد، به‌عنوان " +"بخشی از Tk توزیع می‌شود. پیوندهای پایتون در یک ماژول جداگانه، :mod:`tkinter.ttk`، " +"ارائه شده‌اند." -msgid "Internally, Tk and Ttk use facilities of the underlying operating system, that is, Xlib on Unix/X11, Cocoa on macOS, GDI on Windows." +msgid "" +"Internally, Tk and Ttk use facilities of the underlying operating system, that is, " +"Xlib on Unix/X11, Cocoa on macOS, GDI on Windows." msgstr "" +"در سطح داخلی، Tk و Ttk از امکانات سیستم‌عامل زیربنایی استفاده می‌کنند، یعنی Xlib در " +"Unix/X11، Cocoa در macOS و GDI در Windows." -msgid "When your Python application uses a class in Tkinter, for example, to create a widget, the :mod:`!tkinter` module first assembles a Tcl/Tk command string. It passes that Tcl command string to an internal :mod:`_tkinter` binary module, which then calls the Tcl interpreter to evaluate it. The Tcl interpreter will then call into the Tk and/or Ttk packages, which will in turn make calls to Xlib, Cocoa, or GDI." -msgstr "" +msgid "" +"When your Python application uses a class in Tkinter, for example, to create a " +"widget, the :mod:`!tkinter` module first assembles a Tcl/Tk command string. It " +"passes that Tcl command string to an internal :mod:`_tkinter` binary module, which " +"then calls the Tcl interpreter to evaluate it. The Tcl interpreter will then call " +"into the Tk and/or Ttk packages, which will in turn make calls to Xlib, Cocoa, or " +"GDI." +msgstr "" +"هنگامی که برنامه پایتون شما، برای مثال برای ایجاد یک ابزارک، از یک کلاس در Tkinter " +"استفاده می‌کند، ماژول :mod:`!tkinter` ابتدا یک رشته فرمان Tcl/Tk را می‌سازد. این رشته " +"فرمان Tcl را به یک ماژول دودویی داخلی :mod:`_tkinter` ارسال می‌کند، که سپس مفسر Tcl " +"را برای ارزیابی آن فراخوانی می‌کند. سپس مفسر Tcl بسته‌های Tk و/یا Ttk را فراخوانی " +"می‌کند، که آن‌ها نیز به نوبه خود Xlib، Cocoa یا GDI را فراخوانی می‌کنند." msgid "Tkinter modules" -msgstr "" +msgstr "ماژول‌های Tkinter" -msgid "Support for Tkinter is spread across several modules. Most applications will need the main :mod:`!tkinter` module, as well as the :mod:`tkinter.ttk` module, which provides the modern themed widget set and API::" +msgid "" +"Support for Tkinter is spread across several modules. Most applications will need " +"the main :mod:`!tkinter` module, as well as the :mod:`tkinter.ttk` module, which " +"provides the modern themed widget set and API::" msgstr "" +"پشتیبانی از Tkinter در چندین ماژول پخش شده است. بیشتر برنامه‌ها به ماژول اصلی :mod:`!" +"tkinter` و همچنین ماژول :mod:`tkinter.ttk` نیاز خواهند داشت، که مجموعه ابزارک‌های تم‌دار " +"مدرن و API را ارائه می‌دهد::" msgid "" "from tkinter import *\n" "from tkinter import ttk" msgstr "" +"from tkinter import *\n" +"from tkinter import ttk" msgid "The modules that provide Tk support include:" -msgstr "" +msgstr "ماژول‌هایی که پشتیبانی از Tk را فراهم می‌کنند عبارتند از:" msgid ":mod:`!tkinter`" -msgstr "" +msgstr ":mod:`!tkinter`" msgid "Main Tkinter module." -msgstr "" +msgstr "ماژول اصلی Tkinter." msgid ":mod:`tkinter.colorchooser`" -msgstr "" +msgstr ":mod:`tkinter.colorchooser`" msgid "Dialog to let the user choose a color." -msgstr "" +msgstr "پنجره‌ی محاوره‌ای که به کاربر امکان انتخاب یک رنگ را می‌دهد." msgid ":mod:`tkinter.commondialog`" -msgstr "" +msgstr ":mod:`tkinter.commondialog`" msgid "Base class for the dialogs defined in the other modules listed here." -msgstr "" +msgstr "کلاس پایه برای محاوره‌های تعریف‌شده در دیگر ماژول‌های فهرست‌شده در اینجا." msgid ":mod:`tkinter.filedialog`" -msgstr "" +msgstr ":mod:`tkinter.filedialog`" msgid "Common dialogs to allow the user to specify a file to open or save." msgstr "" +"محاوره‌های رایج برای اینکه به کاربر اجازه دهند فایلی را برای باز کردن یا ذخیره مشخص " +"کند." msgid ":mod:`tkinter.font`" -msgstr "" +msgstr ":mod:`tkinter.font`" msgid "Utilities to help work with fonts." -msgstr "" +msgstr "ابزارهای کمکی برای کار با قلم‌ها." msgid ":mod:`tkinter.messagebox`" -msgstr "" +msgstr ":mod:`tkinter.messagebox`" msgid "Access to standard Tk dialog boxes." -msgstr "" +msgstr "دسترسی به جعبه‌های محاوره‌ی استاندارد Tk." msgid ":mod:`tkinter.scrolledtext`" -msgstr "" +msgstr ":mod:`tkinter.scrolledtext`" msgid "Text widget with a vertical scroll bar built in." -msgstr "" +msgstr "ابزارک Text با یک نوار پیمایش عمودی توکار." msgid ":mod:`tkinter.simpledialog`" -msgstr "" +msgstr ":mod:`tkinter.simpledialog`" msgid "Basic dialogs and convenience functions." -msgstr "" +msgstr "محاوره‌های پایه و توابع سهولت‌بخش." msgid ":mod:`tkinter.ttk`" -msgstr "" +msgstr ":mod:`tkinter.ttk`" -msgid "Themed widget set introduced in Tk 8.5, providing modern alternatives for many of the classic widgets in the main :mod:`!tkinter` module." +msgid "" +"Themed widget set introduced in Tk 8.5, providing modern alternatives for many of " +"the classic widgets in the main :mod:`!tkinter` module." msgstr "" +"مجموعه ابزارک‌های پوسته‌دار که در Tk 8.5 معرفی شد، جایگزین‌های مدرنی برای بسیاری از " +"ابزارک‌های کلاسیک در ماژول اصلی :mod:`!tkinter` فراهم می‌کند." msgid "Additional modules:" -msgstr "" +msgstr "ماژول‌های اضافی:" msgid ":mod:`_tkinter`" -msgstr "" +msgstr ":mod:`_tkinter`" -msgid "A binary module that contains the low-level interface to Tcl/Tk. It is automatically imported by the main :mod:`!tkinter` module, and should never be used directly by application programmers. It is usually a shared library (or DLL), but might in some cases be statically linked with the Python interpreter." +msgid "" +"A binary module that contains the low-level interface to Tcl/Tk. It is automatically " +"imported by the main :mod:`!tkinter` module, and should never be used directly by " +"application programmers. It is usually a shared library (or DLL), but might in some " +"cases be statically linked with the Python interpreter." msgstr "" +"یک ماژول دودویی که شامل رابط سطح پایین برای Tcl/Tk است. این ماژول به‌طور خودکار توسط " +"ماژول اصلی :mod:`!tkinter` ایمپورت می‌شود و هرگز نباید مستقیماً توسط برنامه‌نویسان " +"برنامه‌های کاربردی استفاده شود. این ماژول معمولاً یک کتابخانه اشتراکی (یا DLL) است، " +"اما ممکن است در برخی موارد به‌صورت ایستا با مفسر پایتون پیوند خورده باشد." msgid ":mod:`idlelib`" -msgstr "" +msgstr ":mod:`idlelib`" -msgid "Python's Integrated Development and Learning Environment (IDLE). Based on :mod:`!tkinter`." -msgstr "" +msgid "" +"Python's Integrated Development and Learning Environment (IDLE). Based on :mod:`!" +"tkinter`." +msgstr "محیط توسعه و یادگیری یکپارچه‌ی پایتون (IDLE). مبتنی بر :mod:`!tkinter`." msgid ":mod:`!tkinter.constants`" -msgstr "" +msgstr ":mod:`!tkinter.constants`" -msgid "Symbolic constants that can be used in place of strings when passing various parameters to Tkinter calls. Automatically imported by the main :mod:`!tkinter` module." +msgid "" +"Symbolic constants that can be used in place of strings when passing various " +"parameters to Tkinter calls. Automatically imported by the main :mod:`!tkinter` " +"module." msgstr "" +"ثابت‌های نمادینی که می‌توانند به‌جای رشته‌ها هنگام ارسال پارامترهای مختلف به فراخوانی‌های " +"Tkinter استفاده شوند. به‌طور خودکار توسط ماژول اصلی :mod:`!tkinter` ایمپورت می‌شوند." msgid ":mod:`tkinter.dnd`" -msgstr "" +msgstr ":mod:`tkinter.dnd`" -msgid "(experimental) Drag-and-drop support for :mod:`!tkinter`. This will become deprecated when it is replaced with the Tk DND." +msgid "" +"(experimental) Drag-and-drop support for :mod:`!tkinter`. This will become " +"deprecated when it is replaced with the Tk DND." msgstr "" +"(آزمایشی) پشتیبانی از کشیدن و رها کردن برای :mod:`!tkinter`. این قابلیت زمانی که با " +"Tk DND جایگزین شود، منسوخ خواهد شد." msgid ":mod:`turtle`" -msgstr "" +msgstr ":mod:`turtle`" msgid "Turtle graphics in a Tk window." -msgstr "" +msgstr "گرافیک Turtle در یک پنجره Tk." msgid "Tkinter life preserver" -msgstr "" +msgstr "حلقه نجات Tkinter" -msgid "This section is not designed to be an exhaustive tutorial on either Tk or Tkinter. For that, refer to one of the external resources noted earlier. Instead, this section provides a very quick orientation to what a Tkinter application looks like, identifies foundational Tk concepts, and explains how the Tkinter wrapper is structured." +msgid "" +"This section is not designed to be an exhaustive tutorial on either Tk or Tkinter. " +"For that, refer to one of the external resources noted earlier. Instead, this " +"section provides a very quick orientation to what a Tkinter application looks like, " +"identifies foundational Tk concepts, and explains how the Tkinter wrapper is " +"structured." msgstr "" +"این بخش به‌گونه‌ای طراحی نشده است که آموزشی جامع برای Tk یا Tkinter باشد. برای این " +"منظور، به یکی از منابع خارجی که پیش‌تر ذکر شد مراجعه کنید. در عوض، این بخش آشنایی " +"بسیار سریعی با شکل یک برنامه Tkinter فراهم می‌کند، مفاهیم بنیادین Tk را معرفی می‌کند و " +"توضیح می‌دهد که دربرگیرنده‌ی Tkinter چگونه ساختار یافته است." -msgid "The remainder of this section will help you to identify the classes, methods, and options you'll need in your Tkinter application, and where to find more detailed documentation on them, including in the official Tcl/Tk reference manual." +msgid "" +"The remainder of this section will help you to identify the classes, methods, and " +"options you'll need in your Tkinter application, and where to find more detailed " +"documentation on them, including in the official Tcl/Tk reference manual." msgstr "" +"باقی‌مانده این بخش به شما کمک می‌کند تا کلاس‌ها، متدها و گزینه‌هایی را که در برنامه " +"Tkinter خود به آن‌ها نیاز خواهید داشت، شناسایی کنید و بدانید مستندات دقیق‌تر درباره " +"آن‌ها، از جمله در راهنمای مرجع رسمی Tcl/Tk، کجا یافت می‌شود." msgid "A Hello World program" -msgstr "" +msgstr "یک برنامه‌ی Hello World" -msgid "We'll start by walking through a \"Hello World\" application in Tkinter. This isn't the smallest one we could write, but has enough to illustrate some key concepts you'll need to know." +msgid "" +"We'll start by walking through a \"Hello World\" application in Tkinter. This isn't " +"the smallest one we could write, but has enough to illustrate some key concepts " +"you'll need to know." msgstr "" +"با بررسی گام‌به‌گام یک برنامه‌ی «Hello World» در Tkinter شروع می‌کنیم. این کوچک‌ترین " +"برنامه‌ای نیست که می‌توانستیم بنویسیم، اما به اندازه کافی برای نشان دادن برخی مفاهیم " +"کلیدی که لازم است بدانید، دارد." msgid "" "from tkinter import *\n" @@ -261,69 +442,148 @@ msgid "" "ttk.Button(frm, text=\"Quit\", command=root.destroy).grid(column=1, row=0)\n" "root.mainloop()" msgstr "" +"from tkinter import *\n" +"from tkinter import ttk\n" +"root = Tk()\n" +"frm = ttk.Frame(root, padding=10)\n" +"frm.grid()\n" +"ttk.Label(frm, text=\"Hello World!\").grid(column=0, row=0)\n" +"ttk.Button(frm, text=\"Quit\", command=root.destroy).grid(column=1, row=0)\n" +"root.mainloop()" -msgid "After the imports, the next line creates an instance of the :class:`Tk` class, which initializes Tk and creates its associated Tcl interpreter. It also creates a toplevel window, known as the root window, which serves as the main window of the application." +msgid "" +"After the imports, the next line creates an instance of the :class:`Tk` class, which " +"initializes Tk and creates its associated Tcl interpreter. It also creates a " +"toplevel window, known as the root window, which serves as the main window of the " +"application." msgstr "" +"پس از ایمپورت‌ها، خط بعدی نمونه‌ای از کلاس :class:`Tk` ایجاد می‌کند، که Tk را مقداردهی " +"اولیه می‌کند و مفسر Tcl مرتبط با آن را می‌سازد. همچنین یک پنجره سطح بالا ایجاد می‌کند " +"که به‌عنوان پنجره ریشه شناخته می‌شود و به‌عنوان پنجره اصلی برنامه عمل می‌کند." -msgid "The following line creates a frame widget, which in this case will contain a label and a button we'll create next. The frame is fit inside the root window." +msgid "" +"The following line creates a frame widget, which in this case will contain a label " +"and a button we'll create next. The frame is fit inside the root window." msgstr "" +"خط زیر یک ابزارک فریمایجاد می‌کند که در این حالت شامل یک برچسب و یک دکمه خواهد " +"بود که در ادامه ایجاد خواهیم کرد. این فریم درون پنجره ریشه جای می‌گیرد." -msgid "The next line creates a label widget holding a static text string. The :meth:`~Grid.grid` method is used to specify the relative layout (position) of the label within its containing frame widget, similar to how tables in HTML work." +msgid "" +"The next line creates a label widget holding a static text string. " +"The :meth:`~Grid.grid` method is used to specify the relative layout (position) of " +"the label within its containing frame widget, similar to how tables in HTML work." msgstr "" +"خط بعدی یک ابزارک برچسب (label widget) ایجاد می‌کند که حاوی یک رشته‌ی متن ثابت است. از " +"متد :meth:`~Grid.grid` برای مشخص کردن چیدمان نسبی (موقعیت) برچسب درون ابزارک فریم " +"(frame widget) حاوی آن استفاده می‌شود، مشابه نحوه‌ی کار جدول‌ها در HTML." -msgid "A button widget is then created, and placed to the right of the label. When pressed, it will call the :meth:`~Misc.destroy` method of the root window." +msgid "" +"A button widget is then created, and placed to the right of the label. When pressed, " +"it will call the :meth:`~Misc.destroy` method of the root window." msgstr "" +"سپس یک ابزارک دکمه ایجاد می‌شود و در سمت راست برچسب قرار می‌گیرد. هنگام فشرده‌شدن، " +"متد :meth:`~Misc.destroy` پنجره ریشه را فراخوانی می‌کند." -msgid "Finally, the :meth:`mainloop` method puts everything on the display, and responds to user input until the program terminates." +msgid "" +"Finally, the :meth:`mainloop` method puts everything on the display, and responds to " +"user input until the program terminates." msgstr "" +"در نهایت، متد :meth:`mainloop` همه‌چیز را روی صفحه‌نمایش قرار می‌دهد و تا زمانی که " +"برنامه خاتمه یابد، به ورودی کاربر پاسخ می‌دهد." msgid "Important Tk concepts" -msgstr "" +msgstr "مفاهیم مهم Tk" msgid "Even this simple program illustrates the following key Tk concepts:" -msgstr "" +msgstr "حتی این برنامه‌ی ساده، مفاهیم کلیدی زیر از Tk را نشان می‌دهد:" msgid "widgets" -msgstr "" +msgstr "ابزارک‌ها" -msgid "A Tkinter user interface is made up of individual *widgets*. Each widget is represented as a Python object, instantiated from classes like :class:`ttk.Frame`, :class:`ttk.Label`, and :class:`ttk.Button`." +msgid "" +"A Tkinter user interface is made up of individual *widgets*. Each widget is " +"represented as a Python object, instantiated from classes " +"like :class:`ttk.Frame`, :class:`ttk.Label`, and :class:`ttk.Button`." msgstr "" +"رابط کاربری Tkinter از *ابزارک‌های* مجزا تشکیل شده است. هر ابزارک به‌صورت یک شیء " +"پایتون نمایش داده می‌شود که از کلاس‌هایی مانند :class:`ttk.Frame`، :class:`ttk.Label` " +"و :class:`ttk.Button` نمونه‌سازی شده است." msgid "widget hierarchy" -msgstr "" +msgstr "سلسله‌مراتب ابزارک‌ها" -msgid "Widgets are arranged in a *hierarchy*. The label and button were contained within a frame, which in turn was contained within the root window. When creating each *child* widget, its *parent* widget is passed as the first argument to the widget constructor." +msgid "" +"Widgets are arranged in a *hierarchy*. The label and button were contained within a " +"frame, which in turn was contained within the root window. When creating each " +"*child* widget, its *parent* widget is passed as the first argument to the widget " +"constructor." msgstr "" +"ابزارک‌ها در یک *سلسله‌مراتب* چیده شده‌اند. برچسب و دکمه درون یک فریم قرار داشتند که آن " +"فریم نیز به نوبه خود درون پنجره ریشه قرار داشت. هنگام ایجاد هر ابزارک *فرزند*، ابزارک " +"*والد* آن به‌عنوان اولین آرگومان به سازنده ابزارک ارسال می‌شود." msgid "configuration options" -msgstr "" +msgstr "گزینه‌های پیکربندی" -msgid "Widgets have *configuration options*, which modify their appearance and behavior, such as the text to display in a label or button. Different classes of widgets will have different sets of options." +msgid "" +"Widgets have *configuration options*, which modify their appearance and behavior, " +"such as the text to display in a label or button. Different classes of widgets will " +"have different sets of options." msgstr "" +"ابزارک‌ها *گزینه‌های پیکربندی* دارند که ظاهر و رفتار آن‌ها را تغییر می‌دهند، مانند متنی " +"که در یک برچسب یا دکمه نمایش داده می‌شود. کلاس‌های مختلف ابزارک‌ها مجموعه‌های متفاوتی از " +"گزینه‌ها خواهند داشت." msgid "geometry management" -msgstr "" +msgstr "مدیریت هندسه (geometry management)" -msgid "Widgets aren't automatically added to the user interface when they are created. A *geometry manager* like ``grid`` controls where in the user interface they are placed." +msgid "" +"Widgets aren't automatically added to the user interface when they are created. A " +"*geometry manager* like ``grid`` controls where in the user interface they are " +"placed." msgstr "" +"ابزارک‌ها به‌طور خودکار هنگامی که ایجاد می‌شوند به رابط کاربری اضافه نمی‌شوند. یک *مدیر " +"چیدمان* مانند ``grid`` کنترل می‌کند که آن‌ها در کجای رابط کاربری قرار بگیرند." msgid "event loop" -msgstr "" +msgstr "حلقه رویداد" -msgid "Tkinter reacts to user input, changes from your program, and even refreshes the display only when actively running an *event loop*. If your program isn't running the event loop, your user interface won't update." +msgid "" +"Tkinter reacts to user input, changes from your program, and even refreshes the " +"display only when actively running an *event loop*. If your program isn't running " +"the event loop, your user interface won't update." msgstr "" +"Tkinter تنها زمانی به ورودی کاربر و تغییرات ناشی از برنامه شما واکنش نشان می‌دهد و " +"حتی نمایش را به‌روزرسانی می‌کند که یک *حلقه رویداد* به‌طور فعال در حال اجرا باشد. اگر " +"برنامه شما حلقه رویداد را اجرا نکند، رابط کاربری شما به‌روزرسانی نخواهد شد." msgid "Understanding how Tkinter wraps Tcl/Tk" -msgstr "" +msgstr "درک این‌که Tkinter چگونه Tcl/Tk را می‌پوشاند" -msgid "When your application uses Tkinter's classes and methods, internally Tkinter is assembling strings representing Tcl/Tk commands, and executing those commands in the Tcl interpreter attached to your application's :class:`Tk` instance." +msgid "" +"When your application uses Tkinter's classes and methods, internally Tkinter is " +"assembling strings representing Tcl/Tk commands, and executing those commands in the " +"Tcl interpreter attached to your application's :class:`Tk` instance." msgstr "" +"هنگامی که برنامه شما از کلاس‌ها و متدهای Tkinter استفاده می‌کند، Tkinter به‌صورت داخلی " +"رشته‌هایی را که نشان‌دهنده دستورات Tcl/Tk هستند، می‌سازد و آن دستورات را در مفسر Tcl " +"متصل به نمونه :class:`Tk` برنامه شما اجرا می‌کند." -msgid "Whether it's trying to navigate reference documentation, trying to find the right method or option, adapting some existing code, or debugging your Tkinter application, there are times that it will be useful to understand what those underlying Tcl/Tk commands look like." +msgid "" +"Whether it's trying to navigate reference documentation, trying to find the right " +"method or option, adapting some existing code, or debugging your Tkinter " +"application, there are times that it will be useful to understand what those " +"underlying Tcl/Tk commands look like." msgstr "" +"چه بخواهید در مستندات مرجع پیمایش کنید، چه بخواهید متد یا گزینه مناسب را پیدا کنید، " +"چه بخواهید برخی کدهای موجود را تطبیق دهید، یا چه بخواهید برنامه Tkinter خود را " +"اشکال‌زدایی کنید، گاهی اوقات درک اینکه آن دستورات زیربنایی Tcl/Tk چه شکلی هستند، مفید " +"خواهد بود." -msgid "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter script above." -msgstr "" +msgid "" +"To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter script " +"above." +msgstr "برای روشن‌سازی، در اینجا معادل Tcl/Tk بخش اصلی اسکریپت Tkinter بالا آمده است." msgid "" "ttk::frame .frm -padding 10\n" @@ -331,305 +591,701 @@ msgid "" "grid [ttk::label .frm.lbl -text \"Hello World!\"] -column 0 -row 0\n" "grid [ttk::button .frm.btn -text \"Quit\" -command \"destroy .\"] -column 1 -row 0" msgstr "" +"ttk::frame .frm -padding 10\n" +"grid .frm\n" +"grid [ttk::label .frm.lbl -text \"Hello World!\"] -column 0 -row 0\n" +"grid [ttk::button .frm.btn -text \"Quit\" -command \"destroy .\"] -column 1 -row 0" -msgid "Tcl's syntax is similar to many shell languages, where the first word is the command to be executed, with arguments to that command following it, separated by spaces. Without getting into too many details, notice the following:" +msgid "" +"Tcl's syntax is similar to many shell languages, where the first word is the command " +"to be executed, with arguments to that command following it, separated by spaces. " +"Without getting into too many details, notice the following:" msgstr "" +"نحو Tcl شبیه بسیاری از زبان‌های پوسته است؛ در این زبان‌ها، اولین کلمه فرمانی است که " +"اجرا می‌شود و آرگومان‌های آن فرمان پس از آن با فاصله جدا می‌شوند. بدون ورود به جزئیات " +"زیاد، به موارد زیر توجه کنید:" -msgid "The commands used to create widgets (like ``ttk::frame``) correspond to widget classes in Tkinter." +msgid "" +"The commands used to create widgets (like ``ttk::frame``) correspond to widget " +"classes in Tkinter." msgstr "" +"دستوراتی که برای ایجاد ابزارک‌ها به کار می‌روند (مانند ``ttk::frame``) معادل کلاس‌های " +"ابزارک در Tkinter هستند." msgid "Tcl widget options (like ``-text``) correspond to keyword arguments in Tkinter." msgstr "" +"گزینه‌های ابزارک Tcl (مانند ``-text``) با آرگومان‌های کلیدواژه‌ای در Tkinter متناظر " +"هستند." -msgid "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas Tkinter doesn't use names but object references." +msgid "" +"Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas Tkinter " +"doesn't use names but object references." msgstr "" +"در Tcl، ابزارک‌ها با یک *pathname* (مانند ``.frm.btn``) ارجاع داده می‌شوند، در حالی که " +"Tkinter از نام‌ها استفاده نمی‌کند، بلکه از ارجاع‌های شیء استفاده می‌کند." -msgid "A widget's place in the widget hierarchy is encoded in its (hierarchical) pathname, which uses a ``.`` (dot) as a path separator. The pathname for the root window is just ``.`` (dot). In Tkinter, the hierarchy is defined not by pathname but by specifying the parent widget when creating each child widget." +msgid "" +"A widget's place in the widget hierarchy is encoded in its (hierarchical) pathname, " +"which uses a ``.`` (dot) as a path separator. The pathname for the root window is " +"just ``.`` (dot). In Tkinter, the hierarchy is defined not by pathname but by " +"specifying the parent widget when creating each child widget." msgstr "" +"جایگاه یک ابزارک در سلسله‌مراتب ابزارک‌ها، در مسیر سلسله‌مراتبی آن کدگذاری شده است؛ در این " +"مسیر از ``.`` (نقطه) به‌عنوان جداکننده‌ی مسیر استفاده می‌شود. مسیر پنجره‌ی ریشه فقط ``.`` " +"(نقطه) است. در Tkinter، سلسله‌مراتب نه با مسیر، بلکه با مشخص کردن ابزارک والد هنگام " +"ایجاد هر ابزارک فرزند تعریف می‌شود." -msgid "Operations which are implemented as separate *commands* in Tcl (like ``grid`` or ``destroy``) are represented as *methods* on Tkinter widget objects. As you'll see shortly, at other times Tcl uses what appear to be method calls on widget objects, which more closely mirror what is used in Tkinter." +msgid "" +"Operations which are implemented as separate *commands* in Tcl (like ``grid`` or " +"``destroy``) are represented as *methods* on Tkinter widget objects. As you'll see " +"shortly, at other times Tcl uses what appear to be method calls on widget objects, " +"which more closely mirror what is used in Tkinter." msgstr "" +"عملیاتی که به‌صورت *دستورهای* جداگانه در Tcl پیاده‌سازی شده‌اند (مانند ``grid`` یا " +"``destroy``)، به‌صورت *متدهایی* روی اشیای ابزارک Tkinter ارائه می‌شوند. همان‌طور که " +"به‌زودی خواهید دید، در موارد دیگر Tcl از مواردی استفاده می‌کند که به نظر می‌رسد " +"فراخوانی متد روی اشیای ابزارک باشند و شباهت بیشتری به آنچه در Tkinter استفاده می‌شود " +"دارند." msgid "How do I...? What option does...?" -msgstr "" +msgstr "چگونه ...؟ چه گزینه‌ای ...؟" -msgid "If you're not sure how to do something in Tkinter, and you can't immediately find it in the tutorial or reference documentation you're using, there are a few strategies that can be helpful." +msgid "" +"If you're not sure how to do something in Tkinter, and you can't immediately find it " +"in the tutorial or reference documentation you're using, there are a few strategies " +"that can be helpful." msgstr "" +"اگر مطمئن نیستید که چگونه کاری را در Tkinter انجام دهید، و نمی‌توانید بلافاصله آن را " +"در آموزش یا مستندات مرجعی که استفاده می‌کنید پیدا کنید، چند راهکار وجود دارد که " +"می‌تواند مفید باشد." -msgid "First, remember that the details of how individual widgets work may vary across different versions of both Tkinter and Tcl/Tk. If you're searching documentation, make sure it corresponds to the Python and Tcl/Tk versions installed on your system." +msgid "" +"First, remember that the details of how individual widgets work may vary across " +"different versions of both Tkinter and Tcl/Tk. If you're searching documentation, " +"make sure it corresponds to the Python and Tcl/Tk versions installed on your system." msgstr "" +"نخست، به یاد داشته باشید که جزئیات چگونگی کارکرد هر ابزارک ممکن است در نسخه‌های مختلف " +"Tkinter و Tcl/Tk متفاوت باشد. اگر در حال جست‌وجوی مستندات هستید، اطمینان حاصل کنید که " +"با نسخه‌های پایتون و Tcl/Tk نصب‌شده بر روی سیستم شما مطابقت دارد." -msgid "When searching for how to use an API, it helps to know the exact name of the class, option, or method that you're using. Introspection, either in an interactive Python shell or with :func:`print`, can help you identify what you need." +msgid "" +"When searching for how to use an API, it helps to know the exact name of the class, " +"option, or method that you're using. Introspection, either in an interactive Python " +"shell or with :func:`print`, can help you identify what you need." msgstr "" +"هنگام جست‌وجو درباره نحوه استفاده از یک API، دانستن نام دقیق کلاس، گزینه یا متدی که " +"استفاده می‌کنید مفید است. درون‌نگری (introspection)، چه در پوسته تعاملی پایتون و چه " +"با :func:`print`، می‌تواند به شما کمک کند تا آنچه را که نیاز دارید شناسایی کنید." -msgid "To find out what configuration options are available on any widget, call its :meth:`~Misc.configure` method, which returns a dictionary containing a variety of information about each object, including its default and current values. Use :meth:`~Misc.keys` to get just the names of each option." +msgid "" +"To find out what configuration options are available on any widget, call " +"its :meth:`~Misc.configure` method, which returns a dictionary containing a variety " +"of information about each object, including its default and current values. " +"Use :meth:`~Misc.keys` to get just the names of each option." msgstr "" +"برای اطلاع از گزینه‌های پیکربندی در دسترس برای هر ویدجت، متد :meth:`~Misc.configure` " +"آن را فراخوانی کنید، که یک دیکشنری حاوی اطلاعات گوناگونی درباره هر شیء، از جمله " +"مقادیر پیش‌فرض و فعلی آن برمی‌گرداند. برای دریافت فقط نام‌های هر گزینه " +"از :meth:`~Misc.keys` استفاده کنید." msgid "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" msgstr "" +"btn = ttk.Button(frm, ...)\n" +"print(btn.configure().keys())" -msgid "As most widgets have many configuration options in common, it can be useful to find out which are specific to a particular widget class. Comparing the list of options to that of a simpler widget, like a frame, is one way to do that." +msgid "" +"As most widgets have many configuration options in common, it can be useful to find " +"out which are specific to a particular widget class. Comparing the list of options " +"to that of a simpler widget, like a frame, is one way to do that." msgstr "" +"از آن‌جا که بیشتر ویدجت‌ها (widgets) گزینه‌های پیکربندی مشترک زیادی دارند، می‌تواند مفید " +"باشد که دریابید کدام‌یک از آن‌ها مختص یک کلاس ابزارک خاص هستند. مقایسه فهرست گزینه‌ها با " +"فهرست گزینه‌های یک ابزارک ساده‌تر، مانند فریم ، یکی از راه‌های انجام این کار است." msgid "print(set(btn.configure().keys()) - set(frm.configure().keys()))" -msgstr "" +msgstr "print(set(btn.configure().keys()) - set(frm.configure().keys()))" -msgid "Similarly, you can find the available methods for a widget object using the standard :func:`dir` function. If you try it, you'll see there are over 200 common widget methods, so again identifying those specific to a widget class is helpful." +msgid "" +"Similarly, you can find the available methods for a widget object using the " +"standard :func:`dir` function. If you try it, you'll see there are over 200 common " +"widget methods, so again identifying those specific to a widget class is helpful." msgstr "" +"به همین ترتیب، می‌توانید متدهای در دسترس برای یک شیء ابزارک را با استفاده از تابع " +"استاندارد :func:`dir` پیدا کنید. اگر آن را امتحان کنید، خواهید دید که بیش از ۲۰۰ متد " +"مشترک ابزارک وجود دارد، بنابراین باز هم شناسایی آن‌هایی که مختص یک کلاس ابزارک هستند، " +"مفید است." msgid "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" msgstr "" +"print(dir(btn))\n" +"print(set(dir(btn)) - set(dir(frm)))" msgid "Navigating the Tcl/Tk reference manual" -msgstr "" +msgstr "پیمایش راهنمای مرجع Tcl/Tk" -msgid "As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate description of what specific operations on widgets do. Even when you know the name of the option or method that you need, you may still have a few places to look." +msgid "" +"As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate description of " +"what specific operations on widgets do. Even when you know the name of the option or " +"method that you need, you may still have a few places to look." msgstr "" +"همان‌طور که اشاره شد، مرجع رسمی `Tk commands `_ (صفحات man) اغلب دقیق‌ترین توصیف را از عملکرد عملیات خاص روی " +"ابزارک‌ها ارائه می‌دهد. حتی وقتی نام گزینه یا متدی را که نیاز دارید می‌دانید، ممکن است " +"همچنان لازم باشد به چند جا مراجعه کنید." -msgid "While all operations in Tkinter are implemented as method calls on widget objects, you've seen that many Tcl/Tk operations appear as commands that take a widget pathname as its first parameter, followed by optional parameters, for example" +msgid "" +"While all operations in Tkinter are implemented as method calls on widget objects, " +"you've seen that many Tcl/Tk operations appear as commands that take a widget " +"pathname as its first parameter, followed by optional parameters, for example" msgstr "" +"در حالی که تمام عملیات‌ها در Tkinter به‌صورت فراخوانی متد روی اشیاء ابزارک پیاده‌سازی " +"شده‌اند، دیده‌اید که بسیاری از عملیات‌های Tcl/Tk به‌صورت دستورهایی ظاهر می‌شوند که مسیر " +"نام ابزارک را به‌عنوان نخستین پارامتر خود می‌گیرند و پس از آن پارامترهای اختیاری قرار " +"دارند، برای مثال" msgid "" "destroy .\n" "grid .frm.btn -column 0 -row 0" msgstr "" +"destroy .\n" +"grid .frm.btn -column 0 -row 0" -msgid "Others, however, look more like methods called on a widget object (in fact, when you create a widget in Tcl/Tk, it creates a Tcl command with the name of the widget pathname, with the first parameter to that command being the name of a method to call)." +msgid "" +"Others, however, look more like methods called on a widget object (in fact, when you " +"create a widget in Tcl/Tk, it creates a Tcl command with the name of the widget " +"pathname, with the first parameter to that command being the name of a method to " +"call)." msgstr "" +"با این حال، برخی دیگر بیشتر شبیه متدهایی هستند که روی یک شیء ابزارک فراخوانی می‌شوند " +"(در واقع، هنگامی که یک ابزارک در Tcl/Tk ایجاد می‌کنید، یک فرمان Tcl با نام مسیر ابزارک " +"ایجاد می‌شود که اولین پارامتر آن فرمان، نام متدی است که باید فراخوانی شود)." msgid "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" msgstr "" +".frm.btn invoke\n" +".frm.lbl configure -text \"Goodbye\"" -msgid "In the official Tcl/Tk reference documentation, you'll find most operations that look like method calls on the man page for a specific widget (for example, you'll find the :meth:`~tkinter.ttk.Button.invoke` method on the `ttk::button `_ man page), while functions that take a widget as a parameter often have their own man page (for example, `grid `_)." -msgstr "" +msgid "" +"In the official Tcl/Tk reference documentation, you'll find most operations that " +"look like method calls on the man page for a specific widget (for example, you'll " +"find the :meth:`~tkinter.ttk.Button.invoke` method on the `ttk::button `_ man page), while functions that " +"take a widget as a parameter often have their own man page (for example, `grid " +"`_)." +msgstr "" +"در مستندات مرجع رسمی Tcl/Tk، بیشتر عملیاتی را که شبیه فراخوانی متد هستند، در صفحه‌ی " +"man مربوط به یک ابزارک مشخص خواهید یافت (برای مثال، " +"متد :meth:`~tkinter.ttk.Button.invoke` را در صفحه‌ی man `ttk::button `_ خواهید یافت)، در حالی که توابعی که یک " +"ابزارک را به‌عنوان پارامتر می‌گیرند، اغلب صفحه‌ی man مخصوص به خود را دارند (برای مثال، " +"`grid `_)." -msgid "You'll find many common options and methods in the `options `_ or `ttk::widget `_ man pages, while others are found in the man page for a specific widget class." +msgid "" +"You'll find many common options and methods in the `options `_ or `ttk::widget `_ man pages, while others are found in the man " +"page for a specific widget class." msgstr "" +"بسیاری از گزینه‌ها و متدهای رایج را در صفحه‌های man مربوط به `options `_ یا `ttk::widget `_ خواهید یافت، در حالی که سایر موارد در صفحه man " +"مربوط به یک کلاس ابزارک خاص یافت می‌شوند." -msgid "You'll also find that many Tkinter methods have compound names, for example, :meth:`~Misc.winfo_x`, :meth:`~Misc.winfo_height`, :meth:`~Misc.winfo_viewable`. You'd find documentation for all of these in the `winfo `_ man page." +msgid "" +"You'll also find that many Tkinter methods have compound names, for " +"example, :meth:`~Misc.winfo_x`, :meth:`~Misc.winfo_height`, :meth:`~Misc.winfo_viewable`. " +"You'd find documentation for all of these in the `winfo `_ man page." msgstr "" +"همچنین خواهید دید که بسیاری از متدهای Tkinter نام‌های ترکیبی دارند، برای " +"مثال، :meth:`~Misc.winfo_x`، :meth:`~Misc.winfo_height`، :meth:`~Misc.winfo_viewable`. " +"مستندات همه‌ی این‌ها را در صفحه‌ی راهنمای `winfo `_ خواهید یافت." -msgid "Somewhat confusingly, there are also methods on all Tkinter widgets that don't actually operate on the widget, but operate at a global scope, independent of any widget. Examples are methods for accessing the clipboard or the system bell. (They happen to be implemented as methods in the base :class:`Widget` class that all Tkinter widgets inherit from)." -msgstr "" +msgid "" +"Somewhat confusingly, there are also methods on all Tkinter widgets that don't " +"actually operate on the widget, but operate at a global scope, independent of any " +"widget. Examples are methods for accessing the clipboard or the system bell. (They " +"happen to be implemented as methods in the base :class:`Widget` class that all " +"Tkinter widgets inherit from)." +msgstr "" +"کمی گیج‌کننده است که همه‌ی ویدجت‌های Tkinter همچنین دارای متدهایی هستند که در واقع روی " +"خود ابزارک عمل نمی‌کنند، بلکه در محدوده‌ی سراسری و مستقل از هر ویدجتی عمل می‌کنند. " +"نمونه‌هایی از آن‌ها متدهایی برای دسترسی به کلیپ‌بورد یا زنگ سیستم هستند. (این‌ها به‌صورت " +"متدهایی در کلاس پایه‌ی :class:`Widget` پیاده‌سازی شده‌اند که همه‌ی ویدجت‌های Tkinter از " +"آن ارث می‌برند)." msgid "Threading model" -msgstr "" +msgstr "مدل نخ‌بندی" -msgid "Python and Tcl/Tk have very different threading models, which :mod:`!tkinter` tries to bridge. If you use threads, you may need to be aware of this." +msgid "" +"Python and Tcl/Tk have very different threading models, which :mod:`!tkinter` tries " +"to bridge. If you use threads, you may need to be aware of this." msgstr "" +"پایتون و Tcl/Tk مدل‌های نخ‌بندی بسیار متفاوتی دارند، که :mod:`!tkinter` تلاش می‌کند " +"آن‌ها را به هم متصل کند. اگر از نخ‌ها استفاده می‌کنید، ممکن است لازم باشد از این موضوع " +"آگاه باشید." -msgid "A Python interpreter may have many threads associated with it. In Tcl, multiple threads can be created, but each thread has a separate Tcl interpreter instance associated with it. Threads can also create more than one interpreter instance, though each interpreter instance can be used only by the one thread that created it." +msgid "" +"A Python interpreter may have many threads associated with it. In Tcl, multiple " +"threads can be created, but each thread has a separate Tcl interpreter instance " +"associated with it. Threads can also create more than one interpreter instance, " +"though each interpreter instance can be used only by the one thread that created it." msgstr "" +"یک مفسر پایتون ممکن است نخ‌های زیادی مرتبط با خود داشته باشد. در Tcl، می‌توان چندین نخ " +"ایجاد کرد، اما هر نخ یک نمونه مفسر Tcl جداگانه مرتبط با خود دارد. نخ‌ها همچنین " +"می‌توانند بیش از یک نمونه مفسر ایجاد کنند، اگرچه از هر نمونه مفسر فقط همان نخی که آن " +"را ایجاد کرده است می‌تواند استفاده کند." -msgid "Each :class:`Tk` object created by :mod:`!tkinter` contains a Tcl interpreter. It also keeps track of which thread created that interpreter. Calls to :mod:`!tkinter` can be made from any Python thread. Internally, if a call comes from a thread other than the one that created the :class:`Tk` object, an event is posted to the interpreter's event queue, and when executed, the result is returned to the calling Python thread." -msgstr "" +msgid "" +"Each :class:`Tk` object created by :mod:`!tkinter` contains a Tcl interpreter. It " +"also keeps track of which thread created that interpreter. Calls to :mod:`!tkinter` " +"can be made from any Python thread. Internally, if a call comes from a thread other " +"than the one that created the :class:`Tk` object, an event is posted to the " +"interpreter's event queue, and when executed, the result is returned to the calling " +"Python thread." +msgstr "" +"هر شیء :class:`Tk` ایجادشده به‌وسیله‌ی :mod:`!tkinter`، شامل یک مفسر Tcl است. این شیء " +"همچنین پیگیری می‌کند که کدام نخ آن مفسر را ایجاد کرده است. فراخوانی‌های :mod:`!" +"tkinter` را می‌توان از هر نخ پایتون انجام داد. به‌صورت داخلی، اگر فراخوانی از نخی غیر " +"از نخی که شیء :class:`Tk` را ایجاد کرده است بیاید، رویدادی به صف رویدادهای مفسر " +"ارسال می‌شود و هنگامی که اجرا شود، نتیجه به نخ پایتون فراخوان بازگردانده می‌شود." -msgid "Tcl/Tk applications are normally event-driven, meaning that after initialization, the interpreter runs an event loop (that is, :meth:`Tk.mainloop `) and responds to events. Because it is single-threaded, event handlers must respond quickly, otherwise they will block other events from being processed. To avoid this, any long-running computations should not run in an event handler, but are either broken into smaller pieces using timers, or run in another thread. This is different from many GUI toolkits where the GUI runs in a completely separate thread from all application code including event handlers." -msgstr "" +msgid "" +"Tcl/Tk applications are normally event-driven, meaning that after initialization, " +"the interpreter runs an event loop (that is, :meth:`Tk.mainloop `) " +"and responds to events. Because it is single-threaded, event handlers must respond " +"quickly, otherwise they will block other events from being processed. To avoid this, " +"any long-running computations should not run in an event handler, but are either " +"broken into smaller pieces using timers, or run in another thread. This is different " +"from many GUI toolkits where the GUI runs in a completely separate thread from all " +"application code including event handlers." +msgstr "" +"برنامه‌های Tcl/Tk معمولاً رویدادمحور هستند، به این معنا که پس از راه‌اندازی، مفسر یک " +"حلقه رویداد (یعنی :meth:`Tk.mainloop `) را اجرا می‌کند و به رویدادها " +"پاسخ می‌دهد. از آن‌جا که Tcl/Tk تک‌نخی است، هندلرهای رویداد باید به‌سرعت پاسخ " +"دهند، در غیر این صورت مانع از پردازش سایر رویدادها می‌شوند. برای اجتناب از این موضوع، " +"محاسبات طولانی‌مدت نباید در یک هندلر رویداد اجرا شوند، بلکه باید یا با استفاده " +"از زمان‌سنج‌ها به بخش‌های کوچک‌تر تقسیم شوند یا در نخ دیگری اجرا شوند. این موضوع با " +"بسیاری از تولکیت‌های GUI متفاوت است، جایی که GUI در یک نخ کاملاً جداگانه از تمام کد " +"برنامه، از جمله هندلرهای رویداد، اجرا می‌شود." -msgid "If the Tcl interpreter is not running the event loop and processing events, any :mod:`!tkinter` calls made from threads other than the one running the Tcl interpreter will fail." +msgid "" +"If the Tcl interpreter is not running the event loop and processing events, " +"any :mod:`!tkinter` calls made from threads other than the one running the Tcl " +"interpreter will fail." msgstr "" +"اگر مفسر Tcl در حال اجرای حلقه رویداد و پردازش رویدادها نباشد، هر فراخوانی :mod:`!" +"tkinter` که از نخ‌هایی غیر از نخی که مفسر Tcl را اجرا می‌کند انجام شود، شکست خواهد " +"خورد." msgid "A number of special cases exist:" -msgstr "" +msgstr "تعدادی حالت خاص وجود دارد:" -msgid "Tcl/Tk libraries built without thread support are now rare: the bundled Tcl/Tk 8.6 is built with thread support, so this case only arises with some older non-threaded builds. When the library is not thread-aware, :mod:`!tkinter` calls the library from the originating Python thread, even if this is different than the thread that created the Tcl interpreter. A global lock ensures only one call occurs at a time." -msgstr "" +msgid "" +"Tcl/Tk libraries built without thread support are now rare: the bundled Tcl/Tk 8.6 " +"is built with thread support, so this case only arises with some older non-threaded " +"builds. When the library is not thread-aware, :mod:`!tkinter` calls the library from " +"the originating Python thread, even if this is different than the thread that " +"created the Tcl interpreter. A global lock ensures only one call occurs at a time." +msgstr "" +"کتابخانه‌های Tcl/Tk که بدون پشتیبانی از نخ ساخته شده‌اند، امروزه نادر هستند: نسخه‌ی " +"همراه Tcl/Tk 8.6 با پشتیبانی از نخ ساخته شده است، بنابراین این حالت تنها در برخی " +"ساخت‌های قدیمی‌تر بدون نخ پیش می‌آید. وقتی کتابخانه آگاه از نخ نباشد، :mod:`!tkinter` " +"کتابخانه را از نخ پایتونی مبدأ فراخوانی می‌کند، حتی اگر این نخ با نخی که مفسر Tcl را " +"ایجاد کرده است متفاوت باشد. یک قفل سراسری تضمین می‌کند که در هر زمان تنها یک فراخوانی " +"انجام شود." -msgid "While :mod:`!tkinter` allows you to create more than one instance of a :class:`Tk` object (with its own interpreter), all interpreters that are part of the same thread share a common event queue, which gets ugly fast. In practice, don't create more than one instance of :class:`Tk` at a time. Otherwise, it's best to create them in separate threads and ensure you're running a thread-aware Tcl/Tk build." -msgstr "" +msgid "" +"While :mod:`!tkinter` allows you to create more than one instance of a :class:`Tk` " +"object (with its own interpreter), all interpreters that are part of the same thread " +"share a common event queue, which gets ugly fast. In practice, don't create more " +"than one instance of :class:`Tk` at a time. Otherwise, it's best to create them in " +"separate threads and ensure you're running a thread-aware Tcl/Tk build." +msgstr "" +"در حالی که :mod:`!tkinter` به شما امکان می‌دهد بیش از یک نمونه از شیء :class:`Tk` (با " +"مفسر مخصوص خود) ایجاد کنید، تمام مفسرهایی که بخشی از یک نخ هستند، یک صف رویداد مشترک " +"دارند که به‌سرعت مشکل‌ساز می‌شود. در عمل، در یک زمان بیش از یک نمونه از :class:`Tk` " +"ایجاد نکنید. در غیر این صورت، بهتر است آن‌ها را در نخ‌های جداگانه ایجاد کنید و اطمینان " +"حاصل کنید که در حال اجرای نسخه‌ای از Tcl/Tk با پشتیبانی از نخ هستید." -msgid "Blocking event handlers are not the only way to prevent the Tcl interpreter from reentering the event loop. It is even possible to run multiple nested event loops or abandon the event loop entirely. If you're doing anything tricky when it comes to events or threads, be aware of these possibilities." +msgid "" +"Blocking event handlers are not the only way to prevent the Tcl interpreter from " +"reentering the event loop. It is even possible to run multiple nested event loops or " +"abandon the event loop entirely. If you're doing anything tricky when it comes to " +"events or threads, be aware of these possibilities." msgstr "" +"هندلرهای رویداد مسدودکننده تنها راه جلوگیری از ورود مجدد مفسر Tcl به حلقه رویداد " +"نیستند. حتی امکان اجرای چندین حلقه رویداد تودرتو یا رها کردن کامل حلقه رویداد نیز " +"وجود دارد. اگر در زمینه رویدادها یا نخ‌ها کار پیچیده‌ای انجام می‌دهید، از این احتمالات " +"آگاه باشید." -msgid "There are a few select :mod:`!tkinter` functions that presently work only when called from the thread that created the Tcl interpreter." +msgid "" +"There are a few select :mod:`!tkinter` functions that presently work only when " +"called from the thread that created the Tcl interpreter." msgstr "" +"چند تابع منتخب :mod:`!tkinter` وجود دارند که در حال حاضر فقط زمانی کار می‌کنند که از " +"نخی که مفسر Tcl را ایجاد کرده است فراخوانی شوند." msgid "Handy reference" -msgstr "" +msgstr "مرجع دم‌دستی" msgid "Setting options" -msgstr "" +msgstr "تنظیم گزینه‌ها" -msgid "Options control things like the color and border width of a widget. Options can be set in three ways:" +msgid "" +"Options control things like the color and border width of a widget. Options can be " +"set in three ways:" msgstr "" +"گزینه‌ها مواردی مانند رنگ و پهنای حاشیه‌ی یک ابزارک را کنترل می‌کنند. گزینه‌ها را می‌توان به " +"سه روش تنظیم کرد:" msgid "At object creation time, using keyword arguments" -msgstr "" +msgstr "در زمان ایجاد شیء، با استفاده از آرگومان‌های کلیدواژه‌ای" msgid "fred = Button(self, fg=\"red\", bg=\"blue\")" -msgstr "" +msgstr "fred = Button(self, fg=\"red\", bg=\"blue\")" msgid "After object creation, treating the option name like a dictionary index" -msgstr "" +msgstr "پس از ایجاد شیء، رفتار با نام گزینه مانند یک اندیس دیکشنری" msgid "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" msgstr "" +"fred[\"fg\"] = \"red\"\n" +"fred[\"bg\"] = \"blue\"" msgid "Use the config() method to update multiple attrs subsequent to object creation" -msgstr "" +msgstr "برای به‌روزرسانی چندین ویژگی پس از ایجاد شیء، از متد config() استفاده کنید" msgid "fred.config(fg=\"red\", bg=\"blue\")" -msgstr "" +msgstr "fred.config(fg=\"red\", bg=\"blue\")" -msgid "The ``fg`` and ``bg`` options used here, and other options that control a widget's appearance, belong to the classic :mod:`!tkinter` widgets. The themed :mod:`tkinter.ttk` widgets recommended in the introduction do not accept them; style a themed widget through the :class:`ttk.Style ` class instead. The three ways of setting an option shown above apply to both widget sets." -msgstr "" +msgid "" +"The ``fg`` and ``bg`` options used here, and other options that control a widget's " +"appearance, belong to the classic :mod:`!tkinter` widgets. The " +"themed :mod:`tkinter.ttk` widgets recommended in the introduction do not accept " +"them; style a themed widget through the :class:`ttk.Style ` class " +"instead. The three ways of setting an option shown above apply to both widget sets." +msgstr "" +"گزینه‌های ``fg`` و ``bg`` استفاده‌شده در اینجا، و سایر گزینه‌هایی که ظاهر یک ابزارک را " +"کنترل می‌کنند، به ابزارک‌های کلاسیک :mod:`!tkinter` تعلق دارند. ابزارک‌های دارای " +"تم :mod:`tkinter.ttk` که در مقدمه توصیه شده‌اند، آن‌ها را نمی‌پذیرند؛ در عوض، از " +"کلاس :class:`ttk.Style ` برای سبک‌دهی به یک ابزارک دارای تم " +"استفاده کنید. ۳ روش تنظیم یک گزینه که در بالا نشان داده شد، به هر دو مجموعه‌ی ابزارک " +"اعمال می‌شوند." -msgid "For a complete explanation of a given option and its behavior, see the Tk man pages for the widget in question." +msgid "" +"For a complete explanation of a given option and its behavior, see the Tk man pages " +"for the widget in question." msgstr "" +"برای توضیح کامل یک گزینه مشخص و رفتار آن، به صفحات man مربوط به Tk برای ابزارک " +"موردنظر مراجعه کنید." -msgid "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC OPTIONS\" for each widget. The former is a list of options that are common to many widgets, the latter are the options that are idiosyncratic to that particular widget. The Standard Options are documented on the :manpage:`options(3)` man page." +msgid "" +"Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC OPTIONS\" " +"for each widget. The former is a list of options that are common to many widgets, " +"the latter are the options that are idiosyncratic to that particular widget. The " +"Standard Options are documented on the :manpage:`options(3)` man page." msgstr "" +"توجه داشته باشید که صفحه‌های man برای هر ابزارک (widget)، «STANDARD OPTIONS» و " +"«WIDGET SPECIFIC OPTIONS» را فهرست می‌کنند. مورد اول فهرستی از گزینه‌هایی است که بین " +"بسیاری از ابزارک‌ها مشترک هستند؛ مورد دوم گزینه‌هایی هستند که مخصوص همان ابزارک " +"خاص‌اند. گزینه‌های استاندارد در صفحه‌ی man :manpage:`options(3)` مستند شده‌اند." -msgid "No distinction between standard and widget-specific options is made in this document. Some options don't apply to some kinds of widgets. Whether a given widget responds to a particular option depends on the class of the widget; buttons have a ``command`` option, labels do not." +msgid "" +"No distinction between standard and widget-specific options is made in this " +"document. Some options don't apply to some kinds of widgets. Whether a given widget " +"responds to a particular option depends on the class of the widget; buttons have a " +"``command`` option, labels do not." msgstr "" +"در این سند هیچ تمایزی بین گزینه‌های استاندارد و گزینه‌های مختص ابزارک قائل نشده است. " +"برخی گزینه‌ها برای برخی انواع ویدجت‌ها کاربرد ندارند. این‌که یک ابزارک مشخص به یک گزینه‌ی " +"خاص پاسخ دهد یا نه، به کلاس آن ابزارک بستگی دارد؛ دکمه‌ها گزینه‌ی ``command`` دارند، " +"اما برچسب‌ها ندارند." -msgid "The options supported by a given widget are listed in that widget's man page, or can be queried at runtime by calling the :meth:`~Misc.config` method without arguments, or by calling the :meth:`~Misc.keys` method on that widget. The return value of these calls is a dictionary whose key is the name of the option as a string (for example, ``'relief'``) and whose values are 5-tuples." -msgstr "" +msgid "" +"The options supported by a given widget are listed in that widget's man page, or can " +"be queried at runtime by calling the :meth:`~Misc.config` method without arguments, " +"or by calling the :meth:`~Misc.keys` method on that widget. The return value of " +"these calls is a dictionary whose key is the name of the option as a string (for " +"example, ``'relief'``) and whose values are 5-tuples." +msgstr "" +"گزینه‌های پشتیبانی‌شده توسط یک ابزارک (widget) مشخص، در صفحه‌ی man همان ابزارک فهرست " +"شده‌اند، یا می‌توان آن‌ها را در ران‌تایم با فراخوانی متد :meth:`~Misc.config` بدون " +"آرگومان، یا با فراخوانی متد :meth:`~Misc.keys` روی آن ابزارک پرس‌وجو کرد. مقدار " +"بازگشتی این فراخوانی‌ها یک دیکشنری است که کلید آن نام گزینه به‌صورت یک رشته (برای " +"مثال، ``'relief'``) است و مقادیر آن تاپل‌های ۵تایی هستند." -msgid "Some options, like ``bg``, are synonyms for common options with long names (``bg`` is shorthand for \"background\")." +msgid "" +"Some options, like ``bg``, are synonyms for common options with long names (``bg`` " +"is shorthand for \"background\")." msgstr "" +"برخی گزینه‌ها، مانند ``bg``، مترادف گزینه‌های رایج با نام‌های طولانی هستند (``bg`` شکل " +"کوتاهی از \"background\" است)." msgid "Index" -msgstr "" +msgstr "اندیس" msgid "Meaning" -msgstr "" +msgstr "معنی" msgid "Example" -msgstr "" +msgstr "مثال" msgid "0" -msgstr "" +msgstr "0" msgid "option name" -msgstr "" +msgstr "نام گزینه" msgid "``'relief'``" -msgstr "" +msgstr "``'relief'``" msgid "1" -msgstr "" +msgstr "1" msgid "option name for database lookup" -msgstr "" +msgstr "نام گزینه برای جست‌وجو در پایگاه داده" msgid "2" -msgstr "" +msgstr "2" msgid "option class for database lookup" -msgstr "" +msgstr "کلاس گزینه برای جست‌وجوی پایگاه داده" msgid "``'Relief'``" -msgstr "" +msgstr "``'Relief'``" msgid "3" -msgstr "" +msgstr "3" msgid "default value" -msgstr "" +msgstr "مقدار پیش‌فرض" msgid "``'raised'``" -msgstr "" +msgstr "``'raised'``" msgid "4" -msgstr "" +msgstr "4" msgid "current value" -msgstr "" +msgstr "مقدار فعلی" msgid "``'groove'``" -msgstr "" +msgstr "``'groove'``" msgid "Example::" -msgstr "" +msgstr "مثال::" msgid "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" msgstr "" +">>> print(fred.config())\n" +"{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" -msgid "Of course, the dictionary printed will include all the options available and their values. This is meant only as an example." +msgid "" +"Of course, the dictionary printed will include all the options available and their " +"values. This is meant only as an example." msgstr "" +"البته، دیکشنری چاپ‌شده شامل همه گزینه‌های در دسترس و مقدارهای آن‌ها خواهد بود. این فقط " +"به‌عنوان یک مثال در نظر گرفته شده است." msgid "Geometry management" -msgstr "" +msgstr "مدیریت هندسه" -msgid "Creating a widget does not display it. A widget appears only after it has been handed to a *geometry manager*, which works out its size and position inside its container and keeps the layout up to date as the container is resized or its content changes. Forgetting to call a geometry manager is a common early mistake: the widget is created, but nothing shows up." -msgstr "" +msgid "" +"Creating a widget does not display it. A widget appears only after it has been " +"handed to a *geometry manager*, which works out its size and position inside its " +"container and keeps the layout up to date as the container is resized or its content " +"changes. Forgetting to call a geometry manager is a common early mistake: the widget " +"is created, but nothing shows up." +msgstr "" +"ایجاد یک ابزارک، آن را نمایش نمی‌دهد. یک ابزارک تنها پس از آنکه به یک *مدیر چیدمان* " +"سپرده شود، ظاهر می‌شود؛ مدیری که اندازه و موقعیت آن را درون ظرف حاوی آن تعیین می‌کند و " +"با تغییر اندازه‌ی ظرف یا تغییر محتوای آن، چیدمان را به‌روز نگه می‌دارد. فراموش کردن " +"فراخوانی یک مدیر چیدمان، اشتباهی رایج در مراحل اولیه است: ابزارک ایجاد می‌شود، اما " +"هیچ چیز نمایش داده نمی‌شود." -msgid "Tk provides three geometry managers. Each is inherited by every widget, so any widget can be managed by any of them (but see the warning below about the incompatibility of grid and pack). The choice depends on the kind of layout you want." +msgid "" +"Tk provides three geometry managers. Each is inherited by every widget, so any " +"widget can be managed by any of them (but see the warning below about the " +"incompatibility of grid and pack). The choice depends on the kind of layout you want." msgstr "" +"Tk سه مدیر چیدمان ارائه می‌دهد. هر یک از این مدیران توسط همه ابزارک‌ها به ارث برده " +"می‌شود، بنابراین هر ابزارکی می‌تواند توسط هر کدام از آن‌ها مدیریت شود (اما هشدار زیر را " +"درباره ناسازگاری grid و pack ببینید). انتخاب به نوع چیدمانی بستگی دارد که شما " +"می‌خواهید." msgid ":meth:`grid `" -msgstr "" +msgstr ":meth:`grid `" -msgid "Arranges widgets in a two-dimensional table of rows and columns. It is the most flexible manager and the one to reach for by default: layouts that would otherwise need several nested frames can often be expressed as a single grid, and rows and columns can be told how to absorb extra space." +msgid "" +"Arranges widgets in a two-dimensional table of rows and columns. It is the most " +"flexible manager and the one to reach for by default: layouts that would otherwise " +"need several nested frames can often be expressed as a single grid, and rows and " +"columns can be told how to absorb extra space." msgstr "" +"ابزارک‌ها را در یک جدول دوبعدی از ردیفها و ستون‌ها قرار می‌دهد. این، انعطاف‌پذیرترین مدیر " +"است و گزینه‌ای است که به‌طور پیش‌فرض باید به آن رجوع کرد: اغلب می‌توان چیدمان‌هایی را که " +"در غیر این صورت به چندین فریم تودرتو نیاز دارند، به‌صورت یک شبکه واحد بیان کرد، و " +"می‌توان مشخص کرد که ردیفها و ستون‌ها چگونه فضای اضافی را جذب کنند." msgid "" "ttk.Label(frm, text=\"Name:\").grid(column=0, row=0, sticky=\"w\")\n" "ttk.Entry(frm).grid(column=1, row=0)\n" "ttk.Button(frm, text=\"OK\").grid(column=1, row=1, sticky=\"e\")" msgstr "" +"ttk.Label(frm, text=\"Name:\").grid(column=0, row=0, sticky=\"w\")\n" +"ttk.Entry(frm).grid(column=1, row=0)\n" +"ttk.Button(frm, text=\"OK\").grid(column=1, row=1, sticky=\"e\")" msgid ":meth:`pack `" -msgstr "" +msgstr ":meth:`pack `" -msgid "Stacks widgets against one side of their container -- ``\"top\"`` (the default), ``\"bottom\"``, ``\"left\"`` or ``\"right\"`` -- and can make them fill or expand into the space that is left. It is convenient for simple arrangements, such as a single row or column of widgets or a content area framed by a toolbar and a status bar." -msgstr "" +msgid "" +"Stacks widgets against one side of their container -- ``\"top\"`` (the default), " +"``\"bottom\"``, ``\"left\"`` or ``\"right\"`` -- and can make them fill or expand " +"into the space that is left. It is convenient for simple arrangements, such as a " +"single row or column of widgets or a content area framed by a toolbar and a status " +"bar." +msgstr "" +"ابزارک‌ها را در یکی از سمت‌های ظرفشان روی هم می‌چیند -- ``\"top\"`` (پیش‌فرض)، " +"``\"bottom\"``، ``\"left\"`` یا ``\"right\"`` -- و می‌تواند باعث شود که آن‌ها فضای " +"باقی‌مانده را پر کنند یا در آن گسترش یابند. این برای چیدمان‌های ساده مناسب است، مانند " +"یک ردیف یا ستون واحد از ابزارک‌ها یا یک ناحیه‌ی محتوا که میان یک نوار ابزار و یک نوار " +"وضعیت محصور شده است." msgid "" "toolbar.pack(side=\"top\", fill=\"x\")\n" "status.pack(side=\"bottom\", fill=\"x\")\n" "body.pack(side=\"left\", expand=True, fill=\"both\")" msgstr "" +"toolbar.pack(side=\"top\", fill=\"x\")\n" +"status.pack(side=\"bottom\", fill=\"x\")\n" +"body.pack(side=\"left\", expand=True, fill=\"both\")" msgid ":meth:`place `" -msgstr "" +msgstr ":meth:`place `" -msgid "Positions each widget at an explicit spot, given either as absolute screen distances or as a fraction of the container's size. It offers the most control but the least automatic behavior, and is used the least; it suits special cases such as overlapping widgets or precise custom layouts." +msgid "" +"Positions each widget at an explicit spot, given either as absolute screen distances " +"or as a fraction of the container's size. It offers the most control but the least " +"automatic behavior, and is used the least; it suits special cases such as " +"overlapping widgets or precise custom layouts." msgstr "" +"هر ابزارک را در یک مکان مشخص قرار می‌دهد؛ این مکان یا به‌صورت فاصله‌های مطلق صفحه‌نمایش " +"یا به‌صورت کسری از اندازه‌ی ظرف داده می‌شود. این روش بیشترین کنترل را فراهم می‌کند، اما " +"کمترین رفتار خودکار را دارد و کمتر از همه استفاده می‌شود؛ این روش برای موارد خاصی " +"مانند ابزارک‌های هم‌پوشان یا چیدمان‌های سفارشی دقیق مناسب است." msgid "" "background.place(x=0, y=0, relwidth=1.0, relheight=1.0)\n" "badge.place(relx=1.0, rely=0.0, anchor=\"ne\")" msgstr "" +"background.place(x=0, y=0, relwidth=1.0, relheight=1.0)\n" +"badge.place(relx=1.0, rely=0.0, anchor=\"ne\")" -msgid "Layouts are built up by nesting: grid or pack widgets, including frames, inside a frame or toplevel. Toplevels are managed by the OS window manager. Classic and themed :mod:`tkinter.ttk` widgets can be managed interchangeably." +msgid "" +"Layouts are built up by nesting: grid or pack widgets, including frames, inside a " +"frame or toplevel. Toplevels are managed by the OS window manager. Classic and " +"themed :mod:`tkinter.ttk` widgets can be managed interchangeably." msgstr "" +"چیدمان‌ها با تودرتو کردن ساخته می‌شوند: ابزارک‌ها، از جمله فریم‌ها، را با grid یا pack " +"درون یک فریم یا پنجره‌ی سطح بالا (toplevel) قرار دهید. پنجره‌های سطح بالا توسط مدیر " +"پنجره‌ی سیستم‌عامل مدیریت می‌شوند. ابزارک‌های کلاسیک و ابزارک‌های تم‌دار :mod:`tkinter.ttk` را " +"می‌توان به‌جای یکدیگر مدیریت کرد." -msgid "Do not apply :meth:`!pack` and :meth:`!grid` to two widgets that share the same container. The two managers negotiate sizes in incompatible ways, and the application can hang as they repeatedly resize the container against each other. To combine them, keep each manager's widgets in a separate frame." +msgid "" +"Do not apply :meth:`!pack` and :meth:`!grid` to two widgets that share the same " +"container. The two managers negotiate sizes in incompatible ways, and the " +"application can hang as they repeatedly resize the container against each other. To " +"combine them, keep each manager's widgets in a separate frame." msgstr "" +":meth:`!pack` و :meth:`!grid` را برای دو ابزارکی که یک ظرف مشترک دارند اعمال نکنید. " +"این دو مدیر بر سر اندازه‌ها به روش‌هایی ناسازگار با یکدیگر مذاکره می‌کنند و ممکن است " +"برنامه آویزان شود، زیرا آن‌ها به‌طور مکرر ظرف را در تقابل با یکدیگر تغییر اندازه " +"می‌دهند. برای ترکیب این دو، ابزارک‌های هر مدیر را در یک فریمجداگانه نگه دارید." -msgid "The full set of options accepted by each manager, with their values and defaults, is documented under :meth:`Grid.grid_configure`, :meth:`Pack.pack_configure` and :meth:`Place.place_configure`; see also the :manpage:`grid(3tk)`, :manpage:`pack(3tk)` and :manpage:`place(3tk)` man pages." +msgid "" +"The full set of options accepted by each manager, with their values and defaults, is " +"documented under :meth:`Grid.grid_configure`, :meth:`Pack.pack_configure` " +"and :meth:`Place.place_configure`; see also " +"the :manpage:`grid(3tk)`, :manpage:`pack(3tk)` and :manpage:`place(3tk)` man pages." msgstr "" +"مجموعه کامل گزینه‌های پذیرفته‌شده توسط هر مدیر، به همراه مقادیر و پیش‌فرض‌های آن‌ها، " +"در :meth:`Grid.grid_configure`، :meth:`Pack.pack_configure` " +"و :meth:`Place.place_configure` مستند شده است؛ همچنین صفحه‌های " +"راهنمای :manpage:`grid(3tk)`، :manpage:`pack(3tk)` و :manpage:`place(3tk)` را ببینید." msgid "Coupling widget variables" -msgstr "" +msgstr "جفت‌سازی متغیرهای ابزارک" -msgid "Some widgets can tie their current value directly to a program variable, so that the two stay in sync. Options such as ``variable``, ``textvariable``, ``value``, ``onvalue`` and ``offvalue`` set up this connection: when the user changes the widget the variable is updated, and when the variable is set the widget redraws to match." -msgstr "" +msgid "" +"Some widgets can tie their current value directly to a program variable, so that the " +"two stay in sync. Options such as ``variable``, ``textvariable``, ``value``, " +"``onvalue`` and ``offvalue`` set up this connection: when the user changes the " +"widget the variable is updated, and when the variable is set the widget redraws to " +"match." +msgstr "" +"برخی ابزارک‌ها می‌توانند مقدار جاری خود را مستقیماً به یک متغیر برنامه متصل کنند، تا " +"این دو با هم همگام بمانند. گزینه‌هایی مانند ``variable``، ``textvariable``، " +"``value``، ``onvalue`` و ``offvalue`` این اتصال را برقرار می‌کنند: هنگامی که کاربر " +"ابزارک را تغییر می‌دهد، متغیر به‌روزرسانی می‌شود، و هنگامی که متغیر تنظیم می‌شود، ابزارک " +"بازترسیم می‌شود تا با آن هماهنگ شود." -msgid "A widget can be linked only to a :class:`Variable` object, not to an ordinary Python variable. This is not a limitation of :mod:`!tkinter` but a consequence of how the two languages differ: the link relies on Tcl being notified every time the value changes, and Python offers no way to react when a plain variable is reassigned. A :class:`Variable` sidesteps this by keeping its value inside the Tcl interpreter and exposing it through explicit :meth:`~Variable.get` and :meth:`~Variable.set` methods." -msgstr "" +msgid "" +"A widget can be linked only to a :class:`Variable` object, not to an ordinary Python " +"variable. This is not a limitation of :mod:`!tkinter` but a consequence of how the " +"two languages differ: the link relies on Tcl being notified every time the value " +"changes, and Python offers no way to react when a plain variable is reassigned. " +"A :class:`Variable` sidesteps this by keeping its value inside the Tcl interpreter " +"and exposing it through explicit :meth:`~Variable.get` and :meth:`~Variable.set` " +"methods." +msgstr "" +"یک ابزارک تنها می‌تواند به یک شیء :class:`Variable` پیوند داده شود، نه به یک متغیر " +"معمولی پایتون. این محدودیتی برای :mod:`!tkinter` نیست، بلکه پیامد چگونگی تفاوت این " +"دو زبان است: این پیوند به این موضوع متکی است که هر بار که مقدار تغییر می‌کند، به Tcl " +"اطلاع داده شود، و پایتون هیچ راهی برای واکنش نشان دادن هنگامی که یک متغیر ساده " +"دوباره مقداردهی می‌شود فراهم نمی‌کند. یک :class:`Variable` با نگه داشتن مقدار خود درون " +"مفسر Tcl و در دسترس قرار دادن آن از طریق متدهای صریح :meth:`~Variable.get` " +"و :meth:`~Variable.set` از این مسئله اجتناب می‌کند." -msgid "Ready-made subclasses cover the common types: :class:`StringVar`, :class:`IntVar`, :class:`DoubleVar` and :class:`BooleanVar`. Pass one as a widget's ``textvariable`` (or ``variable``) option, then read and update it with :meth:`~Variable.get` and :meth:`~Variable.set`; the widget tracks it with no further work on your part." -msgstr "" +msgid "" +"Ready-made subclasses cover the common " +"types: :class:`StringVar`, :class:`IntVar`, :class:`DoubleVar` " +"and :class:`BooleanVar`. Pass one as a widget's ``textvariable`` (or ``variable``) " +"option, then read and update it with :meth:`~Variable.get` " +"and :meth:`~Variable.set`; the widget tracks it with no further work on your part." +msgstr "" +"زیرکلاس‌های آماده انواع رایج را پوشش " +"می‌دهند: :class:`StringVar`، :class:`IntVar`، :class:`DoubleVar` " +"و :class:`BooleanVar`. یکی را به‌عنوان گزینه‌ی ``textvariable`` (یا ``variable``) یک " +"ابزارک ارسال کنید، سپس آن را با :meth:`~Variable.get` و :meth:`~Variable.set` بخوانید " +"و به‌روزرسانی کنید؛ ابزارک آن را بدون هیچ کار بیشتری از سوی شما پیگیری می‌کند." -msgid "Keep a reference to the variable for as long as the widget uses it -- for example by storing it as an attribute. A :class:`Variable` that is garbage collected removes its underlying Tcl variable, breaking the connection to the widget (see :class:`Variable`)." +msgid "" +"Keep a reference to the variable for as long as the widget uses it -- for example by " +"storing it as an attribute. A :class:`Variable` that is garbage collected removes " +"its underlying Tcl variable, breaking the connection to the widget " +"(see :class:`Variable`)." msgstr "" +"ارجاعی به متغیر را تا زمانی که ابزارک از آن استفاده می‌کند، نگه دارید — برای مثال با " +"ذخیره‌کردن آن به‌عنوان یک ویژگی. یک :class:`Variable` که زباله‌روبی می‌شود، متغیر Tcl " +"زیربنایی خود را حذف می‌کند و اتصال به ابزارک را قطع می‌کند (به :class:`Variable` مراجعه " +"کنید)." msgid "For example::" -msgstr "" +msgstr "برای مثال::" msgid "" "import tkinter as tk\n" @@ -659,15 +1315,61 @@ msgid "" "\n" "root.mainloop()" msgstr "" +"import tkinter as tk\n" +"from tkinter import ttk\n" +"\n" +"root = tk.Tk()\n" +"\n" +"# متغیر برنامه را ایجاد کنید و یک مقدار اولیه به آن بدهید.\n" +"contents = tk.StringVar(value=\"this is a variable\")\n" +"\n" +"# به ابزارک ورودی بگویید که متغیر را پیگیری کند.\n" +"entry = ttk.Entry(root, textvariable=contents)\n" +"entry.pack()\n" +"\n" +"# هر زمان که کاربر کلید Return را فشار داد، مقدار فعلی را چاپ کنید.\n" +"def print_contents(event):\n" +" print(\"The current entry content is:\", contents.get())\n" +"\n" +"entry.bind(\"\", print_contents)\n" +"\n" +"# تنظیم متغیر از برنامه، ورودی را از طریق همان پیوند به‌روزرسانی\n" +"# می‌کند.\n" +"def clear():\n" +" contents.set(\"\")\n" +"\n" +"ttk.Button(root, text=\"Clear\", command=clear).pack()\n" +"\n" +"root.mainloop()" msgid "The window manager" -msgstr "" +msgstr "مدیر پنجره" -msgid "The *window manager* is the part of the desktop responsible for the title bar, border and controls drawn around each top-level window, and for such things as its title, position, size and icon. Tk gives access to these through the :class:`Wm` mixin, which is inherited by the :class:`Tk` root window and by every :class:`Toplevel`. You therefore call the window-manager methods directly on a top-level window. Each has a short name and an equivalent ``wm_``-prefixed name, for example :meth:`~Wm.title` and :meth:`~Wm.wm_title`." -msgstr "" +msgid "" +"The *window manager* is the part of the desktop responsible for the title bar, " +"border and controls drawn around each top-level window, and for such things as its " +"title, position, size and icon. Tk gives access to these through the :class:`Wm` " +"mixin, which is inherited by the :class:`Tk` root window and by " +"every :class:`Toplevel`. You therefore call the window-manager methods directly on a " +"top-level window. Each has a short name and an equivalent ``wm_``-prefixed name, for " +"example :meth:`~Wm.title` and :meth:`~Wm.wm_title`." +msgstr "" +"*مدیر پنجره* بخشی از میزکار است که مسئول نوار عنوان، فریم و کنترل‌هایی که اطراف هر " +"پنجره‌ی سطح بالا ترسیم می‌شوند، و همچنین مواردی مانند عنوان، موقعیت، اندازه و نماد آن " +"است. Tk دسترسی به این موارد را از طریق میکسین :class:`Wm` فراهم می‌کند، که " +"پنجره‌ی ریشه‌ی :class:`Tk` و هر :class:`Toplevel` از آن ارث می‌برند. بنابراین شما " +"متدهای مدیر پنجره را مستقیماً روی یک پنجره‌ی سطح بالا فراخوانی می‌کنید. هر متد یک نام " +"کوتاه و یک نام معادل با پیشوند ``wm_`` دارد، برای مثال :meth:`~Wm.title` " +"و :meth:`~Wm.wm_title`." -msgid "These methods act on the top-level window whether its content is built from the classic widgets or the themed :mod:`tkinter.ttk` widgets. To reach the top-level window containing an arbitrary widget, call its :meth:`~Misc.winfo_toplevel` method." +msgid "" +"These methods act on the top-level window whether its content is built from the " +"classic widgets or the themed :mod:`tkinter.ttk` widgets. To reach the top-level " +"window containing an arbitrary widget, call its :meth:`~Misc.winfo_toplevel` method." msgstr "" +"این متدها بر پنجره‌ی سطح بالا عمل می‌کنند، چه محتوای آن از ویدجت‌های کلاسیک ساخته شده " +"باشد و چه از ویدجت‌های طرح‌دارِ :mod:`tkinter.ttk`. برای دسترسی به پنجره‌ی سطح بالایی که " +"حاوی یک ابزارک دلخواه است، متد :meth:`~Misc.winfo_toplevel` آن را فراخوانی کنید." msgid "" "import tkinter as tk\n" @@ -682,135 +1384,261 @@ msgid "" "\n" "root.mainloop()" msgstr "" - -msgid "See :class:`Wm` for the full set of window-manager methods." -msgstr "" - +"import tkinter as tk\n" +"from tkinter import ttk\n" +"\n" +"root = tk.Tk()\n" +"root.title(\"My Application\")\n" +"root.geometry(\"640x480\")\n" +"root.minsize(320, 240)\n" +"\n" +"ttk.Label(root, text=\"Hello\").pack(padx=20, pady=20)\n" +"\n" +"root.mainloop()" + +msgid "See :class:`Wm` for the full set of window-manager methods." +msgstr "برای مجموعه کامل متدهای مدیر پنجره، :class:`Wm` را ببینید." + msgid "Tk option data types" -msgstr "" +msgstr "انواع داده‌ی گزینه‌های Tk" -msgid "Many widget options documented in the reference accept values of a small number of common types, described here." +msgid "" +"Many widget options documented in the reference accept values of a small number of " +"common types, described here." msgstr "" +"بسیاری از گزینه‌های ابزارک که در مرجع مستند شده‌اند، مقادیری از تعداد اندکی از انواع " +"رایج را می‌پذیرند که در اینجا توضیح داده شده‌اند." msgid "anchor" -msgstr "" +msgstr "لنگر (anchor)" -msgid "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, ``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also ``\"center\"``." +msgid "" +"Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " +"``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also ``\"center\"``." msgstr "" +"مقادیر مجاز، جهت‌های قطب‌نما هستند: ``\"n\"``، ``\"ne\"``، ``\"e\"``، ``\"se\"``، " +"``\"s\"``، ``\"sw\"``، ``\"w\"``، ``\"nw\"`` و همچنین ``\"center\"``." msgid "bitmap" -msgstr "" +msgstr "بیت‌مپ" -msgid "There are ten built-in, named bitmaps: ``'error'``, ``'gray12'``, ``'gray25'``, ``'gray50'``, ``'gray75'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, ``'warning'``. To specify an X bitmap filename, give the full path to the file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." +msgid "" +"There are ten built-in, named bitmaps: ``'error'``, ``'gray12'``, ``'gray25'``, " +"``'gray50'``, ``'gray75'``, ``'hourglass'``, ``'info'``, ``'questhead'``, " +"``'question'``, ``'warning'``. To specify an X bitmap filename, give the full path " +"to the file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" +"ده بیت‌مپ توکار نام‌دار وجود دارد: ``'error'``، ``'gray12'``، ``'gray25'``، " +"``'gray50'``، ``'gray75'``، ``'hourglass'``، ``'info'``، ``'questhead'``، " +"``'question'``، ``'warning'``. برای مشخص کردن نام فایل یک بیت‌مپ X، مسیر کامل فایل " +"را با یک ``@`` پیش از آن وارد کنید، مانند ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgid "boolean" -msgstr "" +msgstr "بولی" msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." -msgstr "" +msgstr "می‌توانید اعداد صحیح 0 یا 1 یا رشته‌های ``\"yes\"`` یا ``\"no\"`` را ارسال کنید." msgid "callback" -msgstr "" +msgstr "کال‌بک" msgid "This is any Python function that takes no arguments. For example::" -msgstr "" +msgstr "این هر تابع پایتونی است که هیچ آرگومانی نمی‌گیرد. برای مثال::" msgid "" "def print_it():\n" " print(\"hi there\")\n" "fred[\"command\"] = print_it" msgstr "" +"def print_it():\n" +" print(\"hi there\")\n" +"fred[\"command\"] = print_it" msgid "color" -msgstr "" +msgstr "رنگ" -msgid "Colors can be given as the names of X colors in the rgb.txt file, or as strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: ``\"#RRGGBB\"``, 12 bit: ``\"#RRRGGGBBB\"``, or 16 bit: ``\"#RRRRGGGGBBBB\"`` ranges, where R,G,B here represent any legal hex digit. See the :manpage:`colors(3tk)` man page for the list of named colors." -msgstr "" +msgid "" +"Colors can be given as the names of X colors in the rgb.txt file, or as strings " +"representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: ``\"#RRGGBB\"``, 12 bit: " +"``\"#RRRGGGBBB\"``, or 16 bit: ``\"#RRRRGGGGBBBB\"`` ranges, where R,G,B here " +"represent any legal hex digit. See the :manpage:`colors(3tk)` man page for the list " +"of named colors." +msgstr "" +"می‌توان رنگ‌ها را به‌صورت نام رنگ‌های X در پرونده rgb.txt، یا به‌صورت رشته‌هایی که " +"نشان‌دهنده مقادیر RGB در بازه‌های ۴ بیتی: ``\"#RGB\"``، ۸ بیتی: ``\"#RRGGBB\"``، ۱۲ " +"بیتی: ``\"#RRRGGGBBB\"`` یا ۱۶ بیتی: ``\"#RRRRGGGGBBBB\"`` هستند، مشخص کرد؛ در اینجا " +"R، G و B نماینده هر رقم مبنای شانزده معتبر هستند. برای فهرست رنگ‌های نام‌گذاری‌شده، " +"صفحه راهنمای :manpage:`colors(3tk)` را ببینید." msgid "cursor" -msgstr "" +msgstr "نشانگر" -msgid "The name of the mouse cursor to display while the pointer is over the widget. Tk provides a portable set of cursor names available on all platforms (for example ``\"arrow\"``, ``\"watch\"``, ``\"cross\"``, or ``\"hand2\"``); the standard X cursor names from :file:`cursorfont.h` may also be used, without the ``XC_`` prefix (so ``XC_hand2`` becomes ``\"hand2\"``). The full list of names, including the platform-specific ones, is given in the :manpage:`cursors(3tk)` manual page. You can also specify a bitmap and mask file of your own. On Windows a cursor file (:file:`.cur` or :file:`.ani`) may be used directly, giving its path preceded with an ``@``, as in ``\"@C:/cursors/bart.ani\"``." -msgstr "" +msgid "" +"The name of the mouse cursor to display while the pointer is over the widget. Tk " +"provides a portable set of cursor names available on all platforms (for example " +"``\"arrow\"``, ``\"watch\"``, ``\"cross\"``, or ``\"hand2\"``); the standard X " +"cursor names from :file:`cursorfont.h` may also be used, without the ``XC_`` prefix " +"(so ``XC_hand2`` becomes ``\"hand2\"``). The full list of names, including the " +"platform-specific ones, is given in the :manpage:`cursors(3tk)` manual page. You can " +"also specify a bitmap and mask file of your own. On Windows a cursor file " +"(:file:`.cur` or :file:`.ani`) may be used directly, giving its path preceded with " +"an ``@``, as in ``\"@C:/cursors/bart.ani\"``." +msgstr "" +"نام نشانگر ماوسی که هنگام قرار داشتن اشاره‌گر روی ابزارک نمایش داده می‌شود. Tk " +"مجموعه‌ای قابل‌حمل از نام‌های نشانگر را فراهم می‌کند که در همه‌ی سکوها در دسترس است (برای " +"مثال ``\"arrow\"``، ``\"watch\"``، ``\"cross\"`` یا ``\"hand2\"``)؛ همچنین می‌توان از " +"نام‌های استاندارد نشانگر X در :file:`cursorfont.h` بدون پیشوند ``XC_`` استفاده کرد " +"(بنابراین ``XC_hand2`` به ``\"hand2\"`` تبدیل می‌شود). فهرست کامل نام‌ها، از جمله " +"نام‌های مختص سکو، در صفحه‌ی راهنمای :manpage:`cursors(3tk)` آمده است. شما همچنین " +"می‌توانید یک فایل بیت‌مپ و ماسک دلخواه خودتان را مشخص کنید. در ویندوز می‌توان مستقیماً " +"از یک فایل نشانگر (:file:`.cur` یا :file:`.ani`) استفاده کرد، به این صورت که مسیر آن " +"با پیشوند ``@`` داده شود، مانند ``\"@C:/cursors/bart.ani\"``." msgid "distance" -msgstr "" +msgstr "فاصله" -msgid "Screen distances can be specified in either pixels or absolute distances. Pixels are given as numbers and absolute distances as strings, with the trailing character denoting units: ``c`` for centimetres, ``i`` for inches, ``m`` for millimetres, ``p`` for printer's points. For example, 3.5 inches is expressed as ``\"3.5i\"``." +msgid "" +"Screen distances can be specified in either pixels or absolute distances. Pixels are " +"given as numbers and absolute distances as strings, with the trailing character " +"denoting units: ``c`` for centimetres, ``i`` for inches, ``m`` for millimetres, " +"``p`` for printer's points. For example, 3.5 inches is expressed as ``\"3.5i\"``." msgstr "" +"فاصله‌های صفحه را می‌توان به‌صورت پیکسل یا فاصله‌های مطلق مشخص کرد. پیکسل‌ها به‌صورت عدد و " +"فاصله‌های مطلق به‌صورت رشته داده می‌شوند، به‌گونه‌ای که نویسه پایانی نشان‌دهنده یکا است: " +"``c`` برای سانتی‌متر، ``i`` برای اینچ، ``m`` برای میلی‌متر، ``p`` برای نقطه‌های چاپگر. " +"برای مثال، ۳٫۵ اینچ به‌صورت ``\"3.5i\"`` بیان می‌شود." msgid "font" -msgstr "" +msgstr "قلم" -msgid "Tk uses a font description such as ``{courier 10 bold}``; in :mod:`!tkinter` this is most naturally passed as a tuple of ``(family, size, *styles)`` (or as the equivalent string ``\"Courier 10 bold\"``). Font sizes with positive numbers are measured in points; sizes with negative numbers are measured in pixels." +msgid "" +"Tk uses a font description such as ``{courier 10 bold}``; in :mod:`!tkinter` this is " +"most naturally passed as a tuple of ``(family, size, *styles)`` (or as the " +"equivalent string ``\"Courier 10 bold\"``). Font sizes with positive numbers are " +"measured in points; sizes with negative numbers are measured in pixels." msgstr "" +"Tk از یک توصیف قلم مانند ``{courier 10 bold}`` استفاده می‌کند؛ در :mod:`!tkinter` این " +"مورد به‌طور طبیعی به‌صورت تاپلی از ``(family, size, *styles)`` (یا به‌صورت رشته‌ی معادل " +"``\"Courier 10 bold\"``) ارسال می‌شود. اندازه‌های قلم با اعداد مثبت بر حسب نقطه " +"اندازه‌گیری می‌شوند؛ اندازه‌ها با اعداد منفی بر حسب پیکسل اندازه‌گیری می‌شوند." msgid "geometry" -msgstr "" +msgstr "هندسه" -msgid "This is a string of the form ``widthxheight``, where width and height are measured in pixels for most widgets (in characters for widgets displaying text). For example: ``fred[\"geometry\"] = \"200x100\"``." +msgid "" +"This is a string of the form ``widthxheight``, where width and height are measured " +"in pixels for most widgets (in characters for widgets displaying text). For example: " +"``fred[\"geometry\"] = \"200x100\"``." msgstr "" +"این یک رشته به شکل ``widthxheight`` است، که در آن عرض و ارتفاع برای بیشتر ابزارک‌ها " +"بر حسب پیکسل اندازه‌گیری می‌شوند (برای ابزارک‌هایی که متن نمایش می‌دهند، بر حسب نویسه). " +"برای مثال: ``fred[\"geometry\"] = \"200x100\"``." msgid "justify" -msgstr "" +msgstr "تراز کردن" msgid "Legal values are the strings: ``\"left\"``, ``\"center\"``, and ``\"right\"``." -msgstr "" +msgstr "مقادیر مجاز، رشته‌های زیر هستند: ``\"left\"``، ``\"center\"`` و ``\"right\"``." msgid "region" -msgstr "" +msgstr "ناحیه" -msgid "This is a string with four space-delimited elements, each of which is a legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i 2i\"`` and ``\"3c 2c 4c 10.43c\"`` are all legal regions." +msgid "" +"This is a string with four space-delimited elements, each of which is a legal " +"distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i 2i\"`` and " +"``\"3c 2c 4c 10.43c\"`` are all legal regions." msgstr "" +"این یک رشته با چهار عنصر جداشده با فاصله است که هر کدام یک فاصله‌ی معتبر است (بالا را " +"ببینید). برای مثال: ``\"2 3 4 5\"`` و ``\"3i 2i 4.5i 2i\"`` و ``\"3c 2c 4c " +"10.43c\"`` همگی ناحیه‌های معتبر هستند." msgid "relief" -msgstr "" +msgstr "وظیفهین" -msgid "Determines what the border style of a widget will be. Legal values are: ``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, ``\"ridge\"``, and ``\"solid\"``." +msgid "" +"Determines what the border style of a widget will be. Legal values are: " +"``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, ``\"ridge\"``, and " +"``\"solid\"``." msgstr "" +"مشخص می‌کند که سبک حاشیه یک ابزارک چه خواهد بود. مقادیر مجاز عبارت‌اند از: " +"``\"raised\"``، ``\"sunken\"``، ``\"flat\"``، ``\"groove\"``، ``\"ridge\"`` و " +"``\"solid\"``." msgid "scrollcommand" -msgstr "" +msgstr "scrollcommand" -msgid "This is almost always the :meth:`!set` method of some scrollbar widget, but can be any widget method that takes a single argument." +msgid "" +"This is almost always the :meth:`!set` method of some scrollbar widget, but can be " +"any widget method that takes a single argument." msgstr "" +"این تقریباً همیشه متد :meth:`!set`\\ یک ابزارک نوار پیمایش است، اما می‌تواند هر متدی از " +"یک ابزارک باشد که یک آرگومان می‌پذیرد." msgid "wrap" -msgstr "" +msgstr "دربرگرفتن" msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." -msgstr "" +msgstr "باید یکی از موارد زیر باشد: ``\"none\"``، ``\"char\"`` یا ``\"word\"``." msgid "Bindings and events" -msgstr "" +msgstr "اتصال‌ها و رویدادها" -msgid "The bind method from the widget command allows you to watch for certain events and to have a callback function trigger when that event type occurs. The form of the bind method is::" +msgid "" +"The bind method from the widget command allows you to watch for certain events and " +"to have a callback function trigger when that event type occurs. The form of the " +"bind method is::" msgstr "" +"متد bind از دستور ابزارک (widget command) به شما امکان می‌دهد رویدادهای خاصی را زیر " +"نظر بگیرید و کاری کنید که یک تابع کال‌بک هنگام وقوع آن نوع رویداد فعال شود. قالب متد " +"bind به این صورت است::" msgid "def bind(self, sequence, func, add=''):" -msgstr "" +msgstr "def bind(self, sequence, func, add=''):" msgid "where:" -msgstr "" +msgstr "که در آن:" msgid "sequence" -msgstr "" +msgstr "دنباله" -msgid "is a string that denotes the target kind of event. Physical events use the ```` form (for example ``\"\"`` or ``\"\"``); application-defined virtual events use double angle brackets, as in ``\"<>\"``. (See the :manpage:`bind(3tk)` man page for details.)" -msgstr "" +msgid "" +"is a string that denotes the target kind of event. Physical events use the " +"```` form (for example ``\"\"`` or " +"``\"\"``); application-defined virtual events use double angle " +"brackets, as in ``\"<>\"``. (See the :manpage:`bind(3tk)` man page for " +"details.)" +msgstr "" +"رشته‌ای است که نوع رویداد هدف را نشان می‌دهد. رویدادهای فیزیکی از قالب ```` استفاده می‌کنند (برای مثال ``\"\"`` یا ``\"\"``)؛ رویدادهای مجازی تعریف‌شده توسط برنامه از علامت‌های زاویه‌ای دوتایی " +"استفاده می‌کنند، مانند ``\"<>\"``. (برای جزئیات، صفحه " +"راهنمای :manpage:`bind(3tk)` را ببینید.)" msgid "func" -msgstr "" +msgstr "تابع" -msgid "is a Python function, taking one argument, to be invoked when the event occurs. An Event instance will be passed as the argument. (Functions deployed this way are commonly known as *callbacks*.)" +msgid "" +"is a Python function, taking one argument, to be invoked when the event occurs. An " +"Event instance will be passed as the argument. (Functions deployed this way are " +"commonly known as *callbacks*.)" msgstr "" +"یک تابع پایتون است که یک آرگومان دریافت می‌کند و هنگام وقوع رویداد فراخوانی می‌شود. یک " +"نمونه از Event به‌عنوان آرگومان ارسال خواهد شد. (توابعی که به این شکل به‌کار گرفته " +"می‌شوند، معمولاً با نام *کال‌بک‌ها* شناخته می‌شوند.)" msgid "add" -msgstr "" +msgstr "افزودن" -msgid "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that this binding is to replace any other bindings that this event is associated with. Passing a ``'+'`` means that this function is to be added to the list of functions bound to this event type." +msgid "" +"is optional, either ``''`` or ``'+'``. Passing an empty string denotes that this " +"binding is to replace any other bindings that this event is associated with. " +"Passing a ``'+'`` means that this function is to be added to the list of functions " +"bound to this event type." msgstr "" +"اختیاری است و می‌تواند ``''`` یا ``'+'`` باشد. ارسال یک رشته خالی نشان می‌دهد که این " +"اتصال جایگزین تمام اتصال‌های دیگری می‌شود که این رویداد با آن‌ها مرتبط است. ارسال " +"``'+'`` به این معناست که این تابع به فهرست توابعی اضافه می‌شود که به این نوع رویداد " +"متصل هستند." msgid "" "def turn_red(self, event):\n" @@ -818,2891 +1646,7069 @@ msgid "" "\n" "self.button.bind(\"\", self.turn_red)" msgstr "" +"def turn_red(self, event):\n" +" event.widget[\"activeforeground\"] = \"red\"\n" +"\n" +"self.button.bind(\"\", self.turn_red)" -msgid "Notice how the widget field of the event is being accessed in the ``turn_red()`` callback. This field contains the widget that caught the X event. The following table lists the other event fields you can access, and how they are denoted in Tk, which can be useful when referring to the Tk man pages." +msgid "" +"Notice how the widget field of the event is being accessed in the ``turn_red()`` " +"callback. This field contains the widget that caught the X event. The following " +"table lists the other event fields you can access, and how they are denoted in Tk, " +"which can be useful when referring to the Tk man pages." msgstr "" +"توجه کنید که چگونه در کال‌بک ``turn_red()`` به فیلد ابزارک (widget) رویداد دسترسی " +"پیدا می‌شود. این فیلد حاوی ابزارکی است که رویداد X را گرفته است. جدول زیر سایر " +"فیلدهای رویداد را که می‌توانید به آن‌ها دسترسی داشته باشید، و نحوه‌ی نمایش آن‌ها در Tk " +"فهرست می‌کند، که می‌تواند هنگام مراجعه به صفحات راهنمای Tk مفید باشد." msgid "Tkinter Event Field" -msgstr "" +msgstr "فیلد رویداد Tkinter" msgid "%f" -msgstr "" +msgstr "%f" msgid "focus" -msgstr "" +msgstr "فوکوس" msgid "%A" -msgstr "" +msgstr "%A" msgid "char" -msgstr "" +msgstr "نویسه" msgid "%h" -msgstr "" +msgstr "%h" msgid "height" -msgstr "" +msgstr "ارتفاع" msgid "%E" -msgstr "" +msgstr "%E" msgid "send_event" -msgstr "" +msgstr "send_event" msgid "%k" -msgstr "" +msgstr "%k" msgid "keycode" -msgstr "" +msgstr "کد کلید (keycode)" msgid "%K" -msgstr "" +msgstr "%K" msgid "keysym" -msgstr "" +msgstr "keysym" msgid "%s" -msgstr "" +msgstr "%s" msgid "state" -msgstr "" +msgstr "وضعیت" msgid "%N" -msgstr "" +msgstr "%N" msgid "keysym_num" -msgstr "" +msgstr "keysym_num" msgid "%t" -msgstr "" +msgstr "%t" msgid "time" -msgstr "" +msgstr "زمان" msgid "%T" -msgstr "" +msgstr "%T" msgid "type" -msgstr "" +msgstr "نوع" msgid "%w" -msgstr "" +msgstr "%w" msgid "width" -msgstr "" +msgstr "عرض" msgid "%W" -msgstr "" +msgstr "%W" msgid "widget" -msgstr "" +msgstr "ابزارک" msgid "%x" -msgstr "" +msgstr "%x" msgid "x" -msgstr "" +msgstr "x" msgid "%X" -msgstr "" +msgstr "%X" msgid "x_root" -msgstr "" +msgstr "x_root" msgid "%y" -msgstr "" +msgstr "%y" msgid "y" -msgstr "" +msgstr "y" msgid "%Y" -msgstr "" +msgstr "%Y" msgid "y_root" -msgstr "" +msgstr "y_root" msgid "%#" -msgstr "" +msgstr "%#" msgid "serial" -msgstr "" +msgstr "سریالی" msgid "%b" -msgstr "" +msgstr "%b" msgid "num" -msgstr "" +msgstr "شماره" msgid "%d" -msgstr "" +msgstr "%d" msgid "detail" -msgstr "" +msgstr "جزئیات" msgid "%D" -msgstr "" +msgstr "%D" msgid "delta" -msgstr "" +msgstr "دلتا" -msgid "The ``add`` parameter above only affects the bindings you make yourself. Every widget also inherits *class bindings* that implement its standard behavior -- for example a :class:`Text` widget binds :kbd:`Control-t` to transpose two characters. These are described in the bindings section of the widget's Tk man page (such as :manpage:`text(3tk)` or :manpage:`entry(3tk)`)." -msgstr "" +msgid "" +"The ``add`` parameter above only affects the bindings you make yourself. Every " +"widget also inherits *class bindings* that implement its standard behavior -- for " +"example a :class:`Text` widget binds :kbd:`Control-t` to transpose two characters. " +"These are described in the bindings section of the widget's Tk man page (such " +"as :manpage:`text(3tk)` or :manpage:`entry(3tk)`)." +msgstr "" +"پارامتر ``add`` در بالا فقط بر مقیدسازی‌هایی که خودتان ایجاد می‌کنید تأثیر می‌گذارد. هر " +"ابزارک همچنین *مقیدسازی‌های کلاس* را به ارث می‌برد که رفتار استاندارد آن را پیاده‌سازی " +"می‌کنند — برای مثال، یک ابزارک :class:`Text`، :kbd:`Control-t` را به جابه‌جایی دو " +"نویسه متصل می‌کند. این اتصال‌ها در بخش مقیدسازی‌های صفحه راهنمای Tk مربوط به ابزارک " +"(مانند :manpage:`text(3tk)` یا :manpage:`entry(3tk)`) توضیح داده شده‌اند." -msgid "Class bindings are processed separately from your own, so binding an event yourself does not replace the default; both run. To suppress an unwanted default binding, bind the event on the widget and return the string ``\"break\"`` from your callback." +msgid "" +"Class bindings are processed separately from your own, so binding an event yourself " +"does not replace the default; both run. To suppress an unwanted default binding, " +"bind the event on the widget and return the string ``\"break\"`` from your callback." msgstr "" +"مقیدسازی‌های کلاس جداگانه از مقیدسازی‌های خودتان پردازش می‌شوند، بنابراین اگر خودتان رویدادی " +"را متصل کنید، جایگزین اتصال پیش‌فرض نمی‌شود؛ هر دو اجرا می‌شوند. برای جلوگیری از یک " +"اتصال پیش‌فرض ناخواسته، رویداد را روی ابزارک متصل کنید و رشته ``\"break\"`` را از " +"کال‌بک خود برگردانید." msgid "The index parameter" -msgstr "" +msgstr "پارامتر اندیس" -msgid "A number of widgets require \"index\" parameters to be passed. These are used to point at a specific place in a Text widget, or to particular characters in an Entry widget, or to particular menu items in a Menu widget." +msgid "" +"A number of widgets require \"index\" parameters to be passed. These are used to " +"point at a specific place in a Text widget, or to particular characters in an Entry " +"widget, or to particular menu items in a Menu widget." msgstr "" +"تعدادی از ابزارک‌ها نیازمند ارسال پارامترهای «اندیس» هستند. این پارامترها برای اشاره " +"به مکانی مشخص در یک ابزارک Text، یا نویسه‌هایی خاص در یک ابزارک Entry، یا آیتم‌های " +"منوی خاصی در یک ابزارک Menu استفاده می‌شوند." msgid "Entry widget indexes (index, view index, etc.)" -msgstr "" +msgstr "اندیس‌های ابزارک Entry (index، view index و غیره)" -msgid "Entry widgets have methods and options that refer to character positions in the text being displayed. Anytime an index is needed, you may pass in:" +msgid "" +"Entry widgets have methods and options that refer to character positions in the text " +"being displayed. Anytime an index is needed, you may pass in:" msgstr "" +"ابزارک‌های Entry دارای متدها و گزینه‌هایی هستند که به موقعیت‌های نویسه در متن " +"نمایش‌داده‌شده اشاره می‌کنند. هر زمان که به یک اندیس نیاز باشد، می‌توانید موارد زیر را " +"وارد کنید:" -msgid "an integer which refers to the numeric position of a character, counted from the beginning of the text, starting with 0;" +msgid "" +"an integer which refers to the numeric position of a character, counted from the " +"beginning of the text, starting with 0;" msgstr "" +"عدد صحیحی که به موقعیت عددی یک نویسه اشاره دارد و از ابتدای متن، با شروع از ۰ شمرده " +"می‌شود؛" -msgid "the string ``\"anchor\"``, which refers to the anchor point of the selection, set with the widget's selection methods;" +msgid "" +"the string ``\"anchor\"``, which refers to the anchor point of the selection, set " +"with the widget's selection methods;" msgstr "" +"رشته‌ی ``\"anchor\"``، که به نقطه‌ی لنگر انتخاب اشاره دارد؛ این نقطه با متدهای انتخاب " +"ابزارک (widget) تنظیم می‌شود؛" -msgid "the string ``\"end\"``, which refers to the position just after the last character;" -msgstr "" +msgid "" +"the string ``\"end\"``, which refers to the position just after the last character;" +msgstr "رشته ``\"end\"``، که به موقعیت درست پس از آخرین نویسه اشاره دارد؛" -msgid "the string ``\"insert\"``, which refers to the character just after the insertion cursor;" -msgstr "" +msgid "" +"the string ``\"insert\"``, which refers to the character just after the insertion " +"cursor;" +msgstr "رشته‌ی ``\"insert\"``، که به نویسه‌ی درست پس از مکان‌نمای درج اشاره دارد؛" -msgid "the strings ``\"sel.first\"`` and ``\"sel.last\"``, which refer to the first character in the selection and the position just after the last (it is an error to use these if there is no selection);" +msgid "" +"the strings ``\"sel.first\"`` and ``\"sel.last\"``, which refer to the first " +"character in the selection and the position just after the last (it is an error to " +"use these if there is no selection);" msgstr "" +"رشته‌های ``\"sel.first\"`` و ``\"sel.last\"``، که به اولین نویسه‌ی انتخاب و موقعیت درست " +"پس از آخرین نویسه اشاره دارند (اگر انتخابی وجود نداشته باشد، استفاده از این‌ها خطا " +"است)؛" -msgid "a string consisting of ``@`` followed by an integer, as in ``\"@6\"``, where the integer is interpreted as an x pixel coordinate in the entry's coordinate system, selecting the character spanning that point." +msgid "" +"a string consisting of ``@`` followed by an integer, as in ``\"@6\"``, where the " +"integer is interpreted as an x pixel coordinate in the entry's coordinate system, " +"selecting the character spanning that point." msgstr "" +"رشته‌ای متشکل از ``@`` که پس از آن یک عدد صحیح آمده است، مانند ``\"@6\"``، که در آن " +"عدد صحیح به‌عنوان مختصات پیکسلی x در دستگاه مختصات ورودی تفسیر می‌شود و نویسه‌ای را " +"انتخاب می‌کند که آن نقطه را در بر می‌گیرد." msgid "Text widget indexes" -msgstr "" +msgstr "اندیس‌های ابزارک Text" -msgid "The index notation for Text widgets is very rich and is best described in the Tk man pages." +msgid "" +"The index notation for Text widgets is very rich and is best described in the Tk man " +"pages." msgstr "" +"نمادگذاری اندیس برای ویدجت‌های Text بسیار غنی است و بهترین توصیف آن در صفحات راهنمای " +"Tk آمده است." msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" -msgstr "" +msgstr "اندیس‌های منو (menu.invoke()، menu.entryconfig() و غیره)" -msgid "Some options and methods for menus manipulate specific menu entries. Anytime a menu index is needed for an option or a parameter, you may pass in:" +msgid "" +"Some options and methods for menus manipulate specific menu entries. Anytime a menu " +"index is needed for an option or a parameter, you may pass in:" msgstr "" +"برخی گزینه‌ها و متدهای مربوط به منوها، آیتم‌های خاصی از منو را دستکاری می‌کنند. هر زمان " +"که برای یک گزینه یا پارامتر به اندیس منو نیاز باشد، می‌توانید موارد زیر را وارد کنید:" -msgid "an integer which refers to the numeric position of the entry in the widget, counted from the top, starting with 0;" +msgid "" +"an integer which refers to the numeric position of the entry in the widget, counted " +"from the top, starting with 0;" msgstr "" +"عدد صحیحی که به موقعیت عددی ورودی در ابزارک (widget) اشاره دارد، از بالا شمرده می‌شود " +"و از ۰ آغاز می‌شود؛" -msgid "the string ``\"active\"``, which refers to the menu position that is currently under the cursor;" +msgid "" +"the string ``\"active\"``, which refers to the menu position that is currently under " +"the cursor;" msgstr "" +"رشته ``\"active\"``، که به موقعیتی از منو اشاره می‌کند که در حال حاضر زیر نشانگر قرار " +"دارد؛" msgid "the string ``\"last\"`` which refers to the last menu item;" -msgstr "" +msgstr "رشته‌ی ``\"last\"`` که به آخرین آیتم منو اشاره می‌کند؛" -msgid "a string consisting of ``@`` followed by an integer, as in ``\"@6\"``, where the integer is interpreted as a y pixel coordinate in the menu's coordinate system;" +msgid "" +"a string consisting of ``@`` followed by an integer, as in ``\"@6\"``, where the " +"integer is interpreted as a y pixel coordinate in the menu's coordinate system;" msgstr "" +"رشته‌ای متشکل از ``@`` و به‌دنبال آن یک عدد صحیح، مانند ``\"@6\"``، که در آن عدد صحیح " +"به‌عنوان مختصات پیکسلی y در دستگاه مختصات منو تفسیر می‌شود؛" -msgid "the string ``\"none\"``, which indicates no menu entry at all, most often used with menu.activate() to deactivate all entries, and finally," +msgid "" +"the string ``\"none\"``, which indicates no menu entry at all, most often used with " +"menu.activate() to deactivate all entries, and finally," msgstr "" +"رشته ``\"none\"``، که نشان‌دهنده‌ی نبود هیچ ورودی منو است، بیشتر همراه با " +"menu.activate() برای غیرفعال کردن همه‌ی ورودی‌ها استفاده می‌شود، و در نهایت،" -msgid "a text string that is pattern matched against the label of the menu entry, as scanned from the top of the menu to the bottom. Note that this index type is considered after all the others, which means that matches for menu items labelled ``last``, ``active``, or ``none`` may be interpreted as the above literals, instead." +msgid "" +"a text string that is pattern matched against the label of the menu entry, as " +"scanned from the top of the menu to the bottom. Note that this index type is " +"considered after all the others, which means that matches for menu items labelled " +"``last``, ``active``, or ``none`` may be interpreted as the above literals, instead." msgstr "" +"یک رشته‌ی متنی که با پیمایش منو از بالا به پایین، به‌عنوان الگو با برچسب آیتم منو تطبیق " +"داده می‌شود. توجه داشته باشید که این نوع اندیس پس از همه‌ی انواع دیگر در نظر گرفته " +"می‌شود، به این معنا که تطابق‌ها برای آیتم‌های منو با برچسب‌های ``last``، ``active`` یا " +"``none`` ممکن است در عوض به‌عنوان مقادیر لفظی بالا تفسیر شوند." msgid "Images" -msgstr "" +msgstr "تصاویر" -msgid "Images of different formats can be created through the corresponding subclass of :class:`tkinter.Image`:" +msgid "" +"Images of different formats can be created through the corresponding subclass " +"of :class:`tkinter.Image`:" msgstr "" +"تصاویری در قالب‌های مختلف را می‌توان از طریق زیرکلاس متناظرِ :class:`tkinter.Image` " +"ایجاد کرد:" msgid ":class:`BitmapImage` for images in XBM format." -msgstr "" +msgstr ":class:`BitmapImage` برای تصاویر در قالب XBM." -msgid ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter is supported starting with Tk 8.6." +msgid "" +":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter is " +"supported starting with Tk 8.6." msgstr "" +":class:`PhotoImage` برای تصاویر در قالب‌های PGM، PPM، GIF و PNG. قالب آخر از Tk 8.6 " +"پشتیبانی می‌شود." -msgid "Either type of image is created through either the ``file`` or the ``data`` option (other options are available as well)." +msgid "" +"Either type of image is created through either the ``file`` or the ``data`` option " +"(other options are available as well)." msgstr "" +"هر نوع تصویری از طریق گزینه ``file`` یا ``data`` ایجاد می‌شود (گزینه‌های دیگری نیز در " +"دسترس است)." -msgid "Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region from one image to other image, possibly with pixel zooming and/or subsampling. Add *from_coords* parameter to :class:`!PhotoImage` methods :meth:`!copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* parameters to :class:`!PhotoImage` method :meth:`!copy`." -msgstr "" +msgid "" +"Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region from " +"one image to other image, possibly with pixel zooming and/or subsampling. Add " +"*from_coords* parameter to :class:`!PhotoImage` methods :meth:`!copy`, :meth:`!zoom` " +"and :meth:`!subsample`. Add *zoom* and *subsample* parameters to :class:`!" +"PhotoImage` method :meth:`!copy`." +msgstr "" +"متد :meth:`!copy_replace` به کلاس :class:`!PhotoImage` افزوده شد تا یک ناحیه را از " +"یک تصویر به تصویر دیگر کپی کند، با امکان بزرگ‌نمایی پیکسلی و/یا زیرنمونه‌برداری. " +"پارامتر *from_coords* به متدهای :meth:`!copy`، :meth:`!zoom` و :meth:`!subsample` " +"کلاس :class:`!PhotoImage` افزوده شد. پارامترهای *zoom* و *subsample* به متد :meth:`!" +"copy` کلاس :class:`!PhotoImage` افزوده شد." -msgid "The image object can then be used wherever an ``image`` option is supported by some widget (for example, labels, buttons, menus). In these cases, Tk will not keep a reference to the image. When the last Python reference to the image object is deleted, the image data is deleted as well, and Tk will display an empty box wherever the image was used." +msgid "" +"The image object can then be used wherever an ``image`` option is supported by some " +"widget (for example, labels, buttons, menus). In these cases, Tk will not keep a " +"reference to the image. When the last Python reference to the image object is " +"deleted, the image data is deleted as well, and Tk will display an empty box " +"wherever the image was used." msgstr "" +"سپس می‌توان از شیء تصویر در هر جایی که گزینه‌ی ``image`` در برخی ویدجت‌ها پشتیبانی شود " +"استفاده کرد (برای مثال، برچسب‌ها، دکمه‌ها و منوها). در این موارد، Tk مرجعی به تصویر " +"نگه نمی‌دارد. وقتی آخرین مرجع پایتون به شیء تصویر حذف شود، داده‌ی تصویر نیز حذف می‌شود و " +"Tk هر جا که از تصویر استفاده شده باشد یک جعبه‌ی خالی نمایش می‌دهد." -msgid "The `Pillow `_ package adds support for formats such as BMP, JPEG, TIFF, and WebP, among others." +msgid "" +"The `Pillow `_ package adds support for formats such as " +"BMP, JPEG, TIFF, and WebP, among others." msgstr "" +"بسته‌ی `Pillow `_ پشتیبانی از قالب‌هایی مانند BMP، JPEG، " +"TIFF و WebP را در کنار سایر قالب‌ها اضافه می‌کند." msgid "Reference" -msgstr "" +msgstr "مرجع" -msgid "This section documents the classes, methods, functions and constants of the :mod:`!tkinter` module. Most of them wrap Tcl/Tk commands; consult the official Tcl/Tk manual pages for the full list of widget options and further details." +msgid "" +"This section documents the classes, methods, functions and constants of the :mod:`!" +"tkinter` module. Most of them wrap Tcl/Tk commands; consult the official Tcl/Tk " +"manual pages for the full list of widget options and further details." msgstr "" +"این بخش مستندات کلاس‌ها، متدها، توابع و ثابت‌های ماژول :mod:`!tkinter` را ارائه می‌دهد. " +"بیشتر آن‌ها پوششی برای دستورات Tcl/Tk هستند؛ برای فهرست کامل گزینه‌های ابزارک و جزئیات " +"بیشتر، به صفحه‌های راهنمای رسمی Tcl/Tk مراجعه کنید." -msgid "The exception raised when a call into the Tcl interpreter fails, for example when a widget is given an unknown option or an invalid value." +msgid "" +"The exception raised when a call into the Tcl interpreter fails, for example when a " +"widget is given an unknown option or an invalid value." msgstr "" +"استثنایی که هنگام شکست یک فراخوانی به مفسر Tcl پرتاب می‌شود، برای مثال هنگامی که به " +"یک ابزارک گزینه‌ای ناشناخته یا مقداری نامعتبر داده شود." msgid "Base and mixin classes" -msgstr "" +msgstr "کلاس‌های پایه و میکسین " -msgid "The :class:`!Misc` class is a mix-in inherited by :class:`Tk` and, through :class:`BaseWidget`, by every widget. It provides the large set of methods common to all Tk objects: querying window information, managing event bindings and the event loop, controlling the keyboard focus and pointer grabs, accessing the selection, clipboard and option database, and assorted utility and introspection services. Because they are inherited, these methods are available on every widget and on the :class:`Tk` application object, and are documented here once rather than repeated for each widget." -msgstr "" +msgid "" +"The :class:`!Misc` class is a mix-in inherited by :class:`Tk` and, " +"through :class:`BaseWidget`, by every widget. It provides the large set of methods " +"common to all Tk objects: querying window information, managing event bindings and " +"the event loop, controlling the keyboard focus and pointer grabs, accessing the " +"selection, clipboard and option database, and assorted utility and introspection " +"services. Because they are inherited, these methods are available on every widget " +"and on the :class:`Tk` application object, and are documented here once rather than " +"repeated for each widget." +msgstr "" +"کلاس :class:`!Misc` یک کلاس میکس‌ایناست که :class:`Tk` آن را به ارث می‌برد و " +"هر ابزارک (widget) نیز از طریق :class:`BaseWidget` آن را به ارث می‌برد. این کلاس " +"مجموعه بزرگی از متدهای مشترک میان همه‌ی اشیای Tk را فراهم می‌کند: پرس‌وجوی اطلاعات " +"پنجره، مدیریت اتصال‌های رویداد و حلقه‌ی رویداد، کنترل تمرکز صفحه‌کلید و گرفتن اشاره‌گر، " +"دسترسی به گزینش، بریده‌دان و پایگاه داده‌ی گزینه‌ها، و خدمات گوناگون سودمندی و درون‌نگری. " +"از آن‌جا که این متدها به ارث برده می‌شوند، برای هر ابزارک و برای شیء برنامه‌ی :class:`Tk` " +"در دسترس هستند و به جای تکرار برای هر ویدجت، در این‌جا یک بار مستند شده‌اند." -msgid "Return the current value of the configuration option named *key* for this widget, as a string. The expression ``widget[key]`` is equivalent and may be used instead." +msgid "" +"Return the current value of the configuration option named *key* for this widget, as " +"a string. The expression ``widget[key]`` is equivalent and may be used instead." msgstr "" +"مقدار فعلی گزینه‌ی پیکربندی با نام *key* برای این ابزارک را به‌صورت یک رشته برمی‌گرداند. " +"عبارت ``widget[key]`` معادل است و می‌توانید به‌جای آن از این عبارت استفاده کنید." -msgid "Query or modify the configuration options of the widget. With no arguments, return a dictionary mapping every available option name to a tuple describing it (its name, X resource name, X resource class, default value and current value). If a single option name is given as a string, return the tuple for just that option. If one or more keyword arguments are given, or a dictionary is passed as *cnf*, set each named option to the corresponding value; the expression ``widget[key] = value`` sets a single option in the same way." -msgstr "" +msgid "" +"Query or modify the configuration options of the widget. With no arguments, return a " +"dictionary mapping every available option name to a tuple describing it (its name, X " +"resource name, X resource class, default value and current value). If a single " +"option name is given as a string, return the tuple for just that option. If one or " +"more keyword arguments are given, or a dictionary is passed as *cnf*, set each named " +"option to the corresponding value; the expression ``widget[key] = value`` sets a " +"single option in the same way." +msgstr "" +"گزینه‌های پیکربندی ابزارک را پرس‌وجو یا اصلاح می‌کند. بدون آرگومان، یک دیکشنری " +"برمی‌گرداند که هر نام گزینه‌ی موجود را به یک تاپل توصیف‌کننده‌ی آن (نام آن، نام منبع X، " +"کلاس منبع X، مقدار پیش‌فرض و مقدار فعلی) نگاشت می‌کند. اگر یک نام گزینه به‌صورت یک رشته " +"داده شود، فقط تاپل همان گزینه را برمی‌گرداند. اگر یک یا چند آرگومان کلیدواژه‌ای داده " +"شود، یا یک دیکشنری به‌عنوان *cnf* ارسال شود، هر گزینه‌ی نام‌برده را به مقدار متناظر " +"تنظیم می‌کند؛ عبارت ``widget[key] = value`` یک گزینه را به همین روش تنظیم می‌کند." msgid ":meth:`config` is an alias of :meth:`!configure`." -msgstr "" +msgstr ":meth:`config` نام مستعار :meth:`!configure` است." msgid "Return a list of the names of all configuration options of this widget." -msgstr "" +msgstr "فهرستی از نام‌های تمام گزینه‌های پیکربندی این ابزارک (widget) را برمی‌گرداند." -msgid "Interpret the string *s* as a Tcl boolean and return the corresponding :class:`bool`. Tcl accepts values such as ``'1'``, ``'0'``, ``'yes'``, ``'no'``, ``'true'`` and ``'false'``. Raise :exc:`ValueError` if *s* is not a valid boolean." +msgid "" +"Interpret the string *s* as a Tcl boolean and return the " +"corresponding :class:`bool`. Tcl accepts values such as ``'1'``, ``'0'``, ``'yes'``, " +"``'no'``, ``'true'`` and ``'false'``. Raise :exc:`ValueError` if *s* is not a valid " +"boolean." msgstr "" +"رشته *s* را به‌عنوان یک بولی Tcl تفسیر می‌کند و :class:`bool` متناظر را برمی‌گرداند. " +"Tcl مقادیری مانند ``'1'``، ``'0'``، ``'yes'``، ``'no'``، ``'true'`` و ``'false'`` را " +"می‌پذیرد. اگر *s* یک بولی معتبر نباشد، :exc:`ValueError` را پرتاب می‌کند." -msgid "Interpret the string *s* as a Tcl floating-point number and return it as a :class:`float`. Raise :exc:`ValueError` if *s* is not a valid number." +msgid "" +"Interpret the string *s* as a Tcl floating-point number and return it as " +"a :class:`float`. Raise :exc:`ValueError` if *s* is not a valid number." msgstr "" +"رشته‌ی *s* را به‌عنوان یک عدد ممیز شناور Tcl تفسیر می‌کند و آن را به‌صورت " +"یک :class:`float` برمی‌گرداند. اگر *s* یک عدد معتبر نباشد، :exc:`ValueError` پرتاب " +"می‌شود." -msgid "Interpret the string *s* as a Tcl integer and return it as an :class:`int`. Raise :exc:`ValueError` if *s* is not a valid integer." +msgid "" +"Interpret the string *s* as a Tcl integer and return it as an :class:`int`. " +"Raise :exc:`ValueError` if *s* is not a valid integer." msgstr "" +"رشته *s* را به‌عنوان یک عدد صحیح Tcl تفسیر می‌کند و آن را به‌صورت یک :class:`int` " +"برمی‌گرداند. اگر *s* یک عدد صحیح معتبر نباشد، :exc:`ValueError` پرتاب می‌شود." msgid "Return the value of the Tcl global variable named *name*." -msgstr "" +msgstr "مقدار متغیر سراسری Tcl به نام *name* را برمی‌گرداند." msgid "Set the Tcl global variable named *name* to *value*." -msgstr "" +msgstr "متغیر سراسری Tcl به نام *name* را برابر با *value* قرار دهید." -msgid "The :meth:`!getvar` and :meth:`!setvar` methods give direct access to Tcl variables. In most code you will instead use a :class:`Variable` subclass such as :class:`StringVar` or :class:`IntVar`, which wraps a Tcl variable and converts its value to and from a Python type." +msgid "" +"The :meth:`!getvar` and :meth:`!setvar` methods give direct access to Tcl variables. " +"In most code you will instead use a :class:`Variable` subclass such " +"as :class:`StringVar` or :class:`IntVar`, which wraps a Tcl variable and converts " +"its value to and from a Python type." msgstr "" +"متدهای :meth:`!getvar` و :meth:`!setvar` دسترسی مستقیم به متغیرهای Tcl را فراهم " +"می‌کنند. در بیشتر کدها، به‌جای آن از زیرکلاسی از :class:`Variable` " +"مانند :class:`StringVar` یا :class:`IntVar` استفاده خواهید کرد، که یک متغیر Tcl را " +"دربر می‌گیرد و مقدار آن را به یک نوع پایتون و بالعکس تبدیل می‌کند." -msgid "Register the Python callable *func* as a Tcl command and return the name of the new command as a string. Whenever Tcl invokes that command, *func* is called; if *subst* is given, it is applied to the command's arguments first. This is the mechanism used internally to turn Python callbacks into the command names passed to Tk options such as *command*. Unless *needcleanup* is false, the command is deleted automatically when the widget is destroyed." -msgstr "" +msgid "" +"Register the Python callable *func* as a Tcl command and return the name of the new " +"command as a string. Whenever Tcl invokes that command, *func* is called; if *subst* " +"is given, it is applied to the command's arguments first. This is the mechanism used " +"internally to turn Python callbacks into the command names passed to Tk options such " +"as *command*. Unless *needcleanup* is false, the command is deleted automatically " +"when the widget is destroyed." +msgstr "" +"شیء قابل فراخوانی پایتون *func* را به‌عنوان یک فرمان Tcl ثبت می‌کند و نام فرمان جدید " +"را به‌صورت یک رشته برمی‌گرداند. هر زمان که Tcl آن فرمان را فراخوانی کند، *func* " +"فراخوانی می‌شود؛ اگر *subst* داده شده باشد، ابتدا روی آرگومان‌های فرمان اعمال می‌شود. " +"این سازوکاری است که به‌صورت داخلی برای تبدیل کال‌بک‌های پایتون به نام‌های فرمانی که به " +"گزینه‌های Tk مانند *command* داده می‌شوند، استفاده می‌شود. مگر اینکه *needcleanup* " +"برابر false باشد، فرمان به‌طور خودکار هنگام نابود شدن ابزارک حذف می‌شود." msgid "The arguments passed to *func* are no longer converted to strings." -msgstr "" +msgstr "آرگومان‌های ارسال‌شده به *func* دیگر به رشته تبدیل نمی‌شوند." -msgid "Delete the Tcl command named *name*, such as one previously returned by :meth:`register`." +msgid "" +"Delete the Tcl command named *name*, such as one previously returned " +"by :meth:`register`." msgstr "" +"فرمان Tcl با نام *name* را حذف می‌کند، مانند فرمانی که پیش‌تر توسط :meth:`register` " +"برگردانده شده است." msgid "Return the widget instance corresponding to the Tk pathname *name*." -msgstr "" +msgstr "نمونه‌ی ابزارک متناظر با نام مسیر Tk به‌نام *name* را برمی‌گرداند." -msgid "Send the Tcl command *cmd*, with the given *args*, to the Tcl interpreter registered under the name *interp*, and return its result. This is not available on all platforms." +msgid "" +"Send the Tcl command *cmd*, with the given *args*, to the Tcl interpreter registered " +"under the name *interp*, and return its result. This is not available on all " +"platforms." msgstr "" +"فرمان Tcl *cmd* را، به همراه *args* داده‌شده، به مفسر Tcl ثبت‌شده با نام *interp* " +"ارسال کنید و نتیجه‌ی آن را برگردانید. این قابلیت در همه‌ی سکوها در دسترس نیست." -msgid "Destroy this widget and all of its descendant widgets, and delete the Tcl commands associated with them." +msgid "" +"Destroy this widget and all of its descendant widgets, and delete the Tcl commands " +"associated with them." msgstr "" +"این ابزارک و همه‌ی ابزارک‌های زیرمجموعه‌ی آن را نابود کنید و دستورات Tcl مرتبط با آن‌ها را " +"حذف کنید." -msgid "Raise this widget in the stacking order so that it is drawn on top of its siblings. If *aboveThis* is given, the widget is moved to be just above it in the stacking order instead." +msgid "" +"Raise this widget in the stacking order so that it is drawn on top of its siblings. " +"If *aboveThis* is given, the widget is moved to be just above it in the stacking " +"order instead." msgstr "" +"این ابزارک را در ترتیب پشته بالا بیاورید تا روی ابزارک‌های هم‌سطح خود رسم شود. اگر " +"*aboveThis* داده شود، در عوض ابزارک درست بالای آن در ترتیب پشته جابه‌جا می‌شود." msgid ":meth:`lift` is an alias of :meth:`!tkraise`." -msgstr "" +msgstr ":meth:`lift` نام مستعاری از :meth:`!tkraise` است." -msgid "Lower this widget in the stacking order so that it is drawn beneath its siblings. If *belowThis* is given, the widget is moved to be just below it in the stacking order instead." +msgid "" +"Lower this widget in the stacking order so that it is drawn beneath its siblings. If " +"*belowThis* is given, the widget is moved to be just below it in the stacking order " +"instead." msgstr "" +"این ابزارک را در ترتیب پشته‌ای (stacking order) پایین ببرید تا زیر هم‌سطح‌های خود ترسیم " +"شود. اگر *belowThis* داده شده باشد، در عوض ابزارک دقیقاً زیر آن در ترتیب پشته‌ای " +"جابه‌جا می‌شود." -msgid ":meth:`tkraise`/:meth:`lift` and :meth:`lower` are overridden by the :class:`Canvas` widget, where they restack canvas items instead." +msgid "" +":meth:`tkraise`/:meth:`lift` and :meth:`lower` are overridden by the :class:`Canvas` " +"widget, where they restack canvas items instead." msgstr "" +":meth:`tkraise`/:meth:`lift` و :meth:`lower` توسط ابزارک :class:`Canvas` بازنویسی " +"شده‌اند؛ در این ابزارک، آن‌ها به‌جای آن، آیتم‌های Canvas را دوباره پشته‌بندی می‌کنند." msgid "Return the names of all images that currently exist in the Tcl interpreter." -msgstr "" +msgstr "نام همه‌ی تصاویری را که در حال حاضر در مفسر Tcl وجود دارند، برمی‌گرداند." -msgid "This is overridden by the :class:`Text` widget, where :meth:`!image_names` returns the names of its embedded images instead." +msgid "" +"This is overridden by the :class:`Text` widget, where :meth:`!image_names` returns " +"the names of its embedded images instead." msgstr "" +"این مورد توسط ابزارک :class:`Text` بازنویسی می‌شود، که در آن :meth:`!image_names` در " +"عوض نام تصاویر جاسازی‌شده‌ی آن را برمی‌گرداند." msgid "Return the available image types, such as ``'photo'`` and ``'bitmap'``." -msgstr "" +msgstr "انواع تصویر در دسترس را برمی‌گرداند، مانند ``'photo'`` و ``'bitmap'``." -msgid "Set the anchor that controls where the grid is placed inside this container when the container is larger than the grid and no row or column has a non-zero weight. *anchor* is one of the usual anchor strings, such as ``'nw'`` (the default) or ``'center'``. Called with no argument, this method has no effect." +msgid "" +"Set the anchor that controls where the grid is placed inside this container when the " +"container is larger than the grid and no row or column has a non-zero weight. " +"*anchor* is one of the usual anchor strings, such as ``'nw'`` (the default) or " +"``'center'``. Called with no argument, this method has no effect." msgstr "" +"لنگر (anchor) را تنظیم کنید؛ این لنگر تعیین می‌کند که وقتی ظرف بزرگ‌تر از شبکه است و " +"هیچ ردیف یا ستونی وزن غیرصفر ندارد، شبکه در کجای این ظرف قرار گیرد. *anchor* یکی از " +"رشته‌های لنگر معمول است، مانند ``'nw'`` (پیش‌فرض) یا ``'center'``. اگر این متد بدون " +"آرگومان فراخوانی شود، هیچ تأثیری ندارد." msgid ":meth:`anchor` is an alias of :meth:`!grid_anchor`." -msgstr "" +msgstr ":meth:`anchor` نام مستعار :meth:`!grid_anchor` است." -msgid "Return the bounding box, in pixels, of a region of the grid laid out in this container, as a 4-tuple ``(xoffset, yoffset, width, height)``. With no arguments the bounding box of the whole grid is returned. If *column* and *row* are given, the box spans from the cell at row and column 0 to that cell; if *col2* and *row2* are also given, it spans from the cell (*column*, *row*) to the cell (*col2*, *row2*)." -msgstr "" +msgid "" +"Return the bounding box, in pixels, of a region of the grid laid out in this " +"container, as a 4-tuple ``(xoffset, yoffset, width, height)``. With no arguments the " +"bounding box of the whole grid is returned. If *column* and *row* are given, the box " +"spans from the cell at row and column 0 to that cell; if *col2* and *row2* are also " +"given, it spans from the cell (*column*, *row*) to the cell (*col2*, *row2*)." +msgstr "" +"جعبه‌ی محدودکننده یک ناحیه از شبکه‌ی چیده‌شده در این محفظه را بر حسب پیکسل، به‌صورت یک ۴تایی " +"``(xoffset, yoffset, width, height)`` برمی‌گرداند. بدون آرگومان، جعبه‌ی محدودکننده کل شبکه " +"برگردانده می‌شود. اگر *column* و *row* داده شده باشند، جعبه از سلول در ردیف ۰ و ستون ۰ " +"تا آن سلول امتداد دارد؛ اگر *col2* و *row2* نیز داده شده باشند، از سلول (*column*، " +"*row*) تا سلول (*col2*، *row2*) امتداد دارد." -msgid ":meth:`bbox` is an alias of :meth:`!grid_bbox`, except on :class:`Canvas`, :class:`Listbox`, :class:`Spinbox`, :class:`Text`, :class:`ttk.Entry ` and :class:`ttk.Treeview `, which provide their own :meth:`!bbox` method." +msgid "" +":meth:`bbox` is an alias of :meth:`!grid_bbox`, except " +"on :class:`Canvas`, :class:`Listbox`, :class:`Spinbox`, :class:`Text`, :class:`ttk.Entry " +"` and :class:`ttk.Treeview `, which provide " +"their own :meth:`!bbox` method." msgstr "" +":meth:`bbox` نام مستعار :meth:`!grid_bbox` است، به‌جز " +"در :class:`Canvas`، :class:`Listbox`، :class:`Spinbox`، :class:`Text`، :class:`ttk.Entry " +"` و :class:`ttk.Treeview `، که متد :meth:`!" +"bbox` خود را فراهم می‌کنند." -msgid "Query or set the properties of the column (or columns) *index* of the grid managed by this container. *index* may be a column number; when setting options it may also be a list of column numbers, the string ``'all'`` to affect every column, or a child widget whose occupied columns are affected. The supported options are:" +msgid "" +"Query or set the properties of the column (or columns) *index* of the grid managed " +"by this container. *index* may be a column number; when setting options it may also " +"be a list of column numbers, the string ``'all'`` to affect every column, or a child " +"widget whose occupied columns are affected. The supported options are:" msgstr "" +"ویژگی‌های ستون (یا ستون‌های) *index* از شبکه‌ی مدیریت‌شده توسط این ظرف را بپرسید یا تنظیم " +"کنید. *index* می‌تواند یک شماره ستون باشد؛ هنگام تنظیم گزینه‌ها، همچنین می‌تواند فهرستی " +"از شماره‌های ستون، رشته‌ی ``'all'`` برای تأثیر بر همه‌ی ستون‌ها، یا یک ابزارک فرزند باشد " +"که ستون‌های اشغال‌شده‌ی آن تحت تأثیر قرار می‌گیرند. گزینه‌های پشتیبانی‌شده عبارتند از:" msgid "*minsize*" -msgstr "" +msgstr "*minsize*" msgid "The column's minimum size, in pixels." -msgstr "" +msgstr "حداقل اندازه‌ی ستون، بر حسب پیکسل." msgid "*weight*" -msgstr "" +msgstr "*وزن*" -msgid "An integer setting how much of any extra space is apportioned to the column. A weight of ``0`` keeps the column at its requested size, and a column of weight two grows twice as fast as a column of weight one." +msgid "" +"An integer setting how much of any extra space is apportioned to the column. A " +"weight of ``0`` keeps the column at its requested size, and a column of weight two " +"grows twice as fast as a column of weight one." msgstr "" +"یک عدد صحیح که تعیین می‌کند چه مقدار از فضای اضافی به ستون اختصاص داده شود. وزن ``0`` " +"ستون را در اندازه درخواستی خود نگه می‌دارد، و ستونی با وزن ۲ دو برابر سریع‌تر از ستونی " +"با وزن ۱ رشد می‌کند." msgid "*uniform*" -msgstr "" +msgstr "*یکنواخت*" -msgid "The name of a uniform group. Columns sharing a non-empty group name are kept in sizes that are strictly proportional to their weights." +msgid "" +"The name of a uniform group. Columns sharing a non-empty group name are kept in " +"sizes that are strictly proportional to their weights." msgstr "" +"نام یک گروه یکنواخت (uniform group). ستون‌هایی که یک نام گروه غیرخالی مشترک دارند، در " +"اندازه‌هایی نگه داشته می‌شوند که دقیقاً متناسب با وزن‌هایشان است." msgid "*pad*" -msgstr "" +msgstr "*پد (pad)*" -msgid "Extra space, in pixels, added to the largest widget in the column when computing the column's size." +msgid "" +"Extra space, in pixels, added to the largest widget in the column when computing the " +"column's size." msgstr "" +"فضای اضافی، بر حسب پیکسل، که هنگام محاسبه‌ی اندازه‌ی ستون، به بزرگ‌ترین ابزارک موجود در " +"ستون افزوده می‌شود." -msgid "With a single option name, return that option's value; with no options, return a dictionary of all of them." +msgid "" +"With a single option name, return that option's value; with no options, return a " +"dictionary of all of them." msgstr "" +"با یک نام گزینه، مقدار آن گزینه را برمی‌گرداند؛ بدون هیچ گزینه‌ای، یک دیکشنری از همه‌ی " +"آن‌ها را برمی‌گرداند." msgid ":meth:`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." -msgstr "" +msgstr ":meth:`columnconfigure` نام مستعاری از :meth:`!grid_columnconfigure` است." -msgid "Query or set the properties of the row (or rows) *index* of the grid managed by this container. *index* is interpreted as for :meth:`grid_columnconfigure`, and the supported options (*minsize*, *weight*, *uniform* and *pad*) are the same, applied to a row instead of a column." +msgid "" +"Query or set the properties of the row (or rows) *index* of the grid managed by this " +"container. *index* is interpreted as for :meth:`grid_columnconfigure`, and the " +"supported options (*minsize*, *weight*, *uniform* and *pad*) are the same, applied " +"to a row instead of a column." msgstr "" +"ویژگی‌های ردیف (یا ردیف‌های) *index* از شبکه مدیریت‌شده توسط این ظرف را پرس‌وجو یا تنظیم " +"کنید. تفسیر *index* همانند :meth:`grid_columnconfigure` است و گزینه‌های پشتیبانی‌شده " +"(*minsize*، *weight*، *uniform* و *pad*) یکسان هستند، با این تفاوت که به‌جای ستون، بر " +"ردیف اعمال می‌شوند." msgid ":meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." -msgstr "" +msgstr ":meth:`rowconfigure` نام مستعاری از :meth:`!grid_rowconfigure` است." -msgid "Return the ``(column, row)`` of the grid cell that contains the pixel at position (*x*, *y*), given in pixels relative to this container. For locations above or to the left of the grid, ``-1`` is returned for the corresponding coordinate." +msgid "" +"Return the ``(column, row)`` of the grid cell that contains the pixel at position " +"(*x*, *y*), given in pixels relative to this container. For locations above or to " +"the left of the grid, ``-1`` is returned for the corresponding coordinate." msgstr "" +"``(column, row)`` مربوط به سلول شبکه‌ای که پیکسلی در موقعیت (*x*, *y*) را در بر دارد، " +"برمی‌گرداند؛ این موقعیت بر حسب پیکسل نسبت به این ظرف داده شده است. برای موقعیت‌های " +"بالاتر از شبکه یا سمت چپ آن، برای مختصات متناظر ``-1`` برگردانده می‌شود." -msgid "Enable or disable geometry propagation for this container when it manages its children with the grid geometry manager. When *flag* is true, the container resizes itself to fit the requested sizes of its children; when it is false, its size is left under your control. Called with no argument, return the current setting as a boolean." -msgstr "" +msgid "" +"Enable or disable geometry propagation for this container when it manages its " +"children with the grid geometry manager. When *flag* is true, the container resizes " +"itself to fit the requested sizes of its children; when it is false, its size is " +"left under your control. Called with no argument, return the current setting as a " +"boolean." +msgstr "" +"انتشار هندسه (geometry propagation) را برای این ظرف، وقتی فرزندان خود را با مدیر " +"هندسه‌ی grid مدیریت می‌کند، فعال یا غیرفعال کنید. وقتی *flag* درست باشد، ظرف اندازه‌ی خود " +"را تغییر می‌دهد تا با اندازه‌های درخواست‌شده‌ی فرزندان خود متناسب شود؛ وقتی نادرست باشد، " +"اندازه‌ی آن تحت کنترل شما باقی می‌ماند. اگر بدون آرگومان فراخوانی شود، تنظیم فعلی را " +"به‌صورت یک مقدار بولی برمی‌گرداند." -msgid "Return the size of the grid managed by this container as a ``(columns, rows)`` tuple." +msgid "" +"Return the size of the grid managed by this container as a ``(columns, rows)`` tuple." msgstr "" +"اندازه‌ی شبکه‌ی مدیریت‌شده توسط این ظرف را به‌صورت یک تاپل ``(columns, rows)`` " +"برمی‌گرداند." -msgid ":meth:`size` is an alias of :meth:`!grid_size`, except on the :class:`Listbox` widget, which provides its own :meth:`!size` method." +msgid "" +":meth:`size` is an alias of :meth:`!grid_size`, except on the :class:`Listbox` " +"widget, which provides its own :meth:`!size` method." msgstr "" +":meth:`size` نام مستعاری از :meth:`!grid_size` است، به‌جز در ابزارک :class:`Listbox`، " +"که متد :meth:`!size` خود را ارائه می‌دهد." -msgid "Return a list of the child widgets managed in this container's grid, most recently managed first. If *row* or *column* is given, only the children in that row or column are returned." +msgid "" +"Return a list of the child widgets managed in this container's grid, most recently " +"managed first. If *row* or *column* is given, only the children in that row or " +"column are returned." msgstr "" +"فهرستی از ابزارک‌های فرزند مدیریت‌شده در شبکه‌ی این محفظه را برمی‌گرداند، به‌طوری که آخرین " +"ابزارک مدیریت‌شده در ابتدا قرار دارد. اگر *row* یا *column* داده شود، فقط ابزارک‌های " +"فرزند موجود در آن ردیف یا ستون برگردانده می‌شوند." -msgid "Enable or disable geometry propagation for this container when it manages its children with the pack geometry manager. When *flag* is true, the container resizes itself to fit the requested sizes of its children; when it is false, its size is left under your control. Called with no argument, return the current setting as a boolean." -msgstr "" +msgid "" +"Enable or disable geometry propagation for this container when it manages its " +"children with the pack geometry manager. When *flag* is true, the container resizes " +"itself to fit the requested sizes of its children; when it is false, its size is " +"left under your control. Called with no argument, return the current setting as a " +"boolean." +msgstr "" +"فعال یا غیرفعال کردن انتشار هندسه (geometry propagation) برای این ظرف (container) " +"هنگامی که فرزندان خود را با مدیر هندسه‌ی pack مدیریت می‌کند. وقتی *flag* درست باشد، " +"ظرف اندازه‌ی خود را متناسب با اندازه‌های درخواستی فرزندان تغییر می‌دهد؛ وقتی نادرست " +"باشد، اندازه‌ی آن تحت کنترل شما باقی می‌ماند. در صورت فراخوانی بدون آرگومان، تنظیم " +"فعلی را به‌صورت یک مقدار بولی برمی‌گرداند." msgid ":meth:`propagate` is an alias of :meth:`!pack_propagate`." -msgstr "" +msgstr ":meth:`propagate` نام مستعاری از :meth:`!pack_propagate` است." -msgid "Return a list of the child widgets managed by this container with the pack geometry manager, in packing order." +msgid "" +"Return a list of the child widgets managed by this container with the pack geometry " +"manager, in packing order." msgstr "" +"فهرستی از ابزارک‌های فرزند مدیریت‌شده توسط این ظرف با مدیر چیدمان pack را به ترتیب " +"چیدمان pack برمی‌گرداند." msgid ":meth:`slaves` is an alias of :meth:`!pack_slaves`." -msgstr "" +msgstr ":meth:`slaves` نام مستعار :meth:`!pack_slaves` است." -msgid "Return a list of the child widgets managed by this container with the place geometry manager." +msgid "" +"Return a list of the child widgets managed by this container with the place geometry " +"manager." msgstr "" +"فهرستی از ابزارک‌های فرزند این ظرف را که با مدیر چیدمان place مدیریت می‌شوند، " +"برمی‌گرداند." msgid "Bind the event pattern *sequence* on this widget to the callable *func*." msgstr "" +"الگوی رویداد *sequence* را در این ابزارک به شیء قابل فراخوانی *func* متصل کنید." -msgid "*sequence* is an event pattern, such as ``''`` (a mouse click) or ``''``, optionally a concatenation of several such patterns that must occur shortly after one another. When the event occurs, *func* is called with an :class:`Event` instance describing it as its only argument; if *func* returns the string ``'break'``, no further bindings for the event are invoked." -msgstr "" +msgid "" +"*sequence* is an event pattern, such as ``''`` (a mouse click) or " +"``''``, optionally a concatenation of several such patterns that must " +"occur shortly after one another. When the event occurs, *func* is called with " +"an :class:`Event` instance describing it as its only argument; if *func* returns the " +"string ``'break'``, no further bindings for the event are invoked." +msgstr "" +"*sequence* یک الگوی رویداد است، مانند ``''`` (یک کلیک ماوس) یا " +"``''``، و به‌صورت اختیاری می‌تواند الحاقی از چندین الگوی مشابه باشد که " +"باید با فاصله‌ای کوتاه پس از یکدیگر رخ دهند. هنگامی که رویداد رخ می‌دهد، *func* با یک " +"نمونه از :class:`Event` که رویداد را توصیف می‌کند، به‌عنوان تنها آرگومان فراخوانی " +"می‌شود؛ اگر *func* رشته‌ی ``'break'`` را برگرداند، هیچ پیوند دیگری برای رویداد فراخوانی " +"نمی‌شود." -msgid "If *add* is true, *func* is added to any functions already bound to *sequence*; otherwise it replaces them. The binding applies only to this widget." +msgid "" +"If *add* is true, *func* is added to any functions already bound to *sequence*; " +"otherwise it replaces them. The binding applies only to this widget." msgstr "" +"اگر *add* درست باشد، *func* به توابعی که از قبل به *sequence* متصل شده‌اند اضافه " +"می‌شود؛ در غیر این صورت، جایگزین آن‌ها می‌شود. این اتصال تنها برای این ابزارک اعمال می‌شود." -msgid ":meth:`!bind` returns a string identifier (a *funcid*) that can later be passed to :meth:`unbind` to remove the binding without leaking the associated Tcl command." +msgid "" +":meth:`!bind` returns a string identifier (a *funcid*) that can later be passed " +"to :meth:`unbind` to remove the binding without leaking the associated Tcl command." msgstr "" +":meth:`!bind` یک شناسه‌ی رشته‌ای (یک *funcid*) برمی‌گرداند که بعداً می‌توان آن را " +"به :meth:`unbind` فرستاد تا اتصال را بدون نشت دستور Tcl مرتبط حذف کرد." -msgid "If *func* is omitted, return the binding currently associated with *sequence*; if *sequence* is also omitted, return a list of all the sequences for which bindings exist on this widget." +msgid "" +"If *func* is omitted, return the binding currently associated with *sequence*; if " +"*sequence* is also omitted, return a list of all the sequences for which bindings " +"exist on this widget." msgstr "" +"اگر *func* حذف شود، مقیدسازی‌های کنونی مرتبط با *sequence* را برمی‌گرداند؛ اگر *sequence* " +"نیز حذف شود، فهرستی از همه توالی‌هایی را که برای آن‌ها مقیدسازی‌هایی روی این ابزارک وجود " +"دارد برمی‌گرداند." -msgid "Like :meth:`bind`, but bind *func* to the binding tag *className* rather than to a single widget, so that the binding applies to every widget having that tag. *className* is usually the name of a widget class, such as ``'Button'``, in which case the binding affects all widgets of that class. The set of binding tags for a widget can be inspected and changed with :meth:`bindtags`." -msgstr "" +msgid "" +"Like :meth:`bind`, but bind *func* to the binding tag *className* rather than to a " +"single widget, so that the binding applies to every widget having that tag. " +"*className* is usually the name of a widget class, such as ``'Button'``, in which " +"case the binding affects all widgets of that class. The set of binding tags for a " +"widget can be inspected and changed with :meth:`bindtags`." +msgstr "" +"مانند :meth:`bind`، اما *func* را به برچسب مقیدسازی *className* متصل می‌کند، نه به یک " +"ابزارک واحد، تا مقیدسازی به هر ابزارکی که آن برچسب را دارد اعمال شود. *className* " +"معمولاً نام یک کلاس ابزارک است، مانند ``'Button'``، که در این صورت مقیدسازی بر همه " +"ابزارک‌های آن کلاس اثر می‌گذارد. مجموعه برچسب‌های مقیدسازی برای یک ابزارک را می‌توان " +"با :meth:`bindtags` بررسی و تغییر داد." msgid "The remaining arguments and the return value are as for :meth:`bind`." -msgstr "" +msgstr "آرگومان‌های باقی‌مانده و مقدار بازگشتی همانند :meth:`bind` هستند." -msgid "Like :meth:`bind`, but bind *func* to the special binding tag ``'all'``, so that the binding applies to every widget in the application." +msgid "" +"Like :meth:`bind`, but bind *func* to the special binding tag ``'all'``, so that the " +"binding applies to every widget in the application." msgstr "" +"مانند :meth:`bind`، اما *func* را به برچسب مقیدسازی ویژه‌ی ``'all'`` متصل می‌کند، تا این " +"مقیدسازی به تمام ابزارک‌های برنامه اعمال شود." msgid "Remove bindings for the event pattern *sequence* on this widget." -msgstr "" +msgstr "مقیدسازی‌های مربوط به الگوی رویداد *sequence* را روی این ابزارک حذف می‌کند." -msgid "If *funcid* is given, only the function identified by it (a value returned from a previous call to :meth:`bind`) is removed, and its associated Tcl command is deleted. Otherwise all bindings for *sequence* are destroyed, leaving it unbound." +msgid "" +"If *funcid* is given, only the function identified by it (a value returned from a " +"previous call to :meth:`bind`) is removed, and its associated Tcl command is " +"deleted. Otherwise all bindings for *sequence* are destroyed, leaving it unbound." msgstr "" +"اگر *funcid* داده شود، فقط تابع شناسایی‌شده توسط آن (مقداری که از فراخوانی " +"قبلی :meth:`bind` بازگشته است) حذف می‌شود و دستور Tcl مرتبط با آن حذف می‌گردد. در غیر " +"این صورت، تمام پیوندهای *sequence* از بین می‌روند و آن را بی‌پیوند باقی می‌گذارند." -msgid "If *funcid* is given, only that callback is unbound; other callbacks bound to *sequence* are kept." +msgid "" +"If *funcid* is given, only that callback is unbound; other callbacks bound to " +"*sequence* are kept." msgstr "" +"اگر *funcid* داده شود، فقط همان کال‌بک از حالت مقید خارج می‌شود؛ سایر کال‌بک‌های مقید به " +"*sequence* حفظ می‌شوند." -msgid "Remove all bindings for the event pattern *sequence* from the binding tag *className*. See :meth:`bind_class`." +msgid "" +"Remove all bindings for the event pattern *sequence* from the binding tag " +"*className*. See :meth:`bind_class`." msgstr "" +"تمام اتصال‌های الگوی رویداد *sequence* را از برچسب اتصال *className* حذف " +"می‌کند. :meth:`bind_class` را ببینید." -msgid "Remove all bindings for the event pattern *sequence* from the special binding tag ``'all'``. See :meth:`bind_all`." +msgid "" +"Remove all bindings for the event pattern *sequence* from the special binding tag " +"``'all'``. See :meth:`bind_all`." msgstr "" +"تمام اتصال‌های الگوی رویداد *sequence* را از برچسب اتصال ویژه ``'all'`` حذف " +"کنید. :meth:`bind_all` را ببینید." -msgid "If *tagList* is omitted, return a tuple of the binding tags associated with this widget. When an event occurs in a widget, it is applied to each of the widget's binding tags in order, and for each tag the most specific matching binding is executed. By default a widget has four binding tags: its own pathname, its widget class, the pathname of its nearest toplevel ancestor, and ``'all'``, in that order." -msgstr "" +msgid "" +"If *tagList* is omitted, return a tuple of the binding tags associated with this " +"widget. When an event occurs in a widget, it is applied to each of the widget's " +"binding tags in order, and for each tag the most specific matching binding is " +"executed. By default a widget has four binding tags: its own pathname, its widget " +"class, the pathname of its nearest toplevel ancestor, and ``'all'``, in that order." +msgstr "" +"اگر *tagList* حذف شود، یک چندتایی از برچسب‌های اتصال مرتبط با این ابزارک برمی‌گرداند. " +"هنگامی که یک رویداد در یک ابزارک رخ می‌دهد، آن رویداد به‌ترتیب به هر یک از برچسب‌های " +"اتصال ابزارک اعمال می‌شود، و برای هر برچسب، خاص‌ترین اتصال منطبق اجرا می‌شود. به‌طور " +"پیش‌فرض، یک ابزارک دارای چهار برچسب اتصال است: نام مسیر خود، کلاس ابزارک آن، نام مسیر " +"نزدیک‌ترین نیاک سطح بالای آن، و ``'all'``، به همین ترتیب." -msgid "If *tagList* is given, it must be a sequence of strings; the widget's binding tags are set to its elements, which determines the order in which bindings are evaluated." +msgid "" +"If *tagList* is given, it must be a sequence of strings; the widget's binding tags " +"are set to its elements, which determines the order in which bindings are evaluated." msgstr "" +"اگر *tagList* داده شود، باید دنباله‌ای از رشته‌ها باشد؛ برچسب‌های اتصال ابزارک به عناصر " +"آن تنظیم می‌شوند که ترتیب ارزیابی اتصال‌ها را تعیین می‌کند." -msgid "The methods with the ``event_`` prefix define virtual events and generate events programmatically." +msgid "" +"The methods with the ``event_`` prefix define virtual events and generate events " +"programmatically." msgstr "" +"متدهای دارای پیشوند ``event_``، رویدادهای مجازی را تعریف می‌کنند و رویدادها را به‌صورت " +"برنامه‌ای تولید می‌کنند." -msgid "Associate the virtual event *virtual*, whose name has the form ``'<>'``, with each of the physical event patterns given by *sequences*, so that the virtual event triggers whenever any of them occurs. If *virtual* is already defined, the new sequences are added to its existing ones." +msgid "" +"Associate the virtual event *virtual*, whose name has the form ``'<>'``, with " +"each of the physical event patterns given by *sequences*, so that the virtual event " +"triggers whenever any of them occurs. If *virtual* is already defined, the new " +"sequences are added to its existing ones." msgstr "" +"رویداد مجازی *virtual* را، که نام آن به شکل ``'<>'`` است، با هر یک از الگوهای " +"رویداد فیزیکی داده‌شده توسط *sequences* مرتبط کنید، تا هر زمان که هر یک از آن‌ها رخ " +"دهد، رویداد مجازی فعال شود. اگر *virtual* از قبل تعریف شده باشد، دنباله‌های جدید به " +"دنباله‌های موجود آن افزوده می‌شوند." -msgid "Remove each of *sequences* from those associated with the virtual event *virtual*. Sequences that are not currently associated with *virtual* are ignored. If no *sequences* are given, all physical event sequences are removed, so that *virtual* no longer triggers." +msgid "" +"Remove each of *sequences* from those associated with the virtual event *virtual*. " +"Sequences that are not currently associated with *virtual* are ignored. If no " +"*sequences* are given, all physical event sequences are removed, so that *virtual* " +"no longer triggers." msgstr "" +"هر یک از *sequences* را از آن‌هایی که با رویداد مجازی *virtual* مرتبط هستند، حذف " +"می‌کند. دنباله‌هایی که در حال حاضر با *virtual* مرتبط نیستند، نادیده گرفته می‌شوند. اگر " +"هیچ *sequences* داده نشود، همه‌ی دنباله‌های رویداد فیزیکی حذف می‌شوند، به‌طوری که " +"*virtual* دیگر راه‌اندازی نمی‌شود." -msgid "Generate the event *sequence* on this widget and arrange for it to be processed just as if it had come from the window system. *sequence* must be a single event pattern, such as ``''`` or ``'<>'``, not a concatenation of several. Keyword arguments specify additional fields of the event, for example *x* and *y* for the pointer position, or *when* to control when the event is processed; refer to the Tk ``event`` manual page for the full list." -msgstr "" +msgid "" +"Generate the event *sequence* on this widget and arrange for it to be processed just " +"as if it had come from the window system. *sequence* must be a single event pattern, " +"such as ``''`` or ``'<>'``, not a concatenation of several. Keyword " +"arguments specify additional fields of the event, for example *x* and *y* for the " +"pointer position, or *when* to control when the event is processed; refer to the Tk " +"``event`` manual page for the full list." +msgstr "" +"دنباله‌ی رویداد *sequence* را روی این ابزارک تولید کنید و ترتیبی دهید که درست همان‌طور " +"پردازش شود که گویی از سامانه‌ی پنجره‌ای آمده است. *sequence* باید یک الگوی رویداد واحد " +"باشد، مانند ``''`` یا ``'<>'``، نه الحاق چندین الگو. آرگومان‌های " +"کلیدواژه‌ای فیلدهای اضافی رویداد را مشخص می‌کنند، برای مثال *x* و *y* برای موقعیت " +"اشاره‌گر، یا *when* برای کنترل زمان پردازش رویداد؛ برای فهرست کامل به صفحه‌ی راهنمای " +"``event`` در Tk مراجعه کنید." -msgid "If *virtual* is omitted, return a tuple of all the virtual events that are currently defined. If *virtual* is given, return a tuple of the physical event sequences currently associated with it, or an empty tuple if it is not defined." +msgid "" +"If *virtual* is omitted, return a tuple of all the virtual events that are currently " +"defined. If *virtual* is given, return a tuple of the physical event sequences " +"currently associated with it, or an empty tuple if it is not defined." msgstr "" +"اگر *virtual* حذف شود، یک تاپل از تمام رویدادهای مجازی که در حال حاضر تعریف شده‌اند " +"را برمی‌گرداند. اگر *virtual* داده شود، یک تاپل از دنباله‌های رویداد فیزیکی که در حال " +"حاضر با آن مرتبط هستند را برمی‌گرداند، یا اگر تعریف نشده باشد، یک تاپل خالی " +"برمی‌گرداند." -msgid "The methods with the ``after`` prefix schedule callbacks to run after a delay or when the application is idle." +msgid "" +"The methods with the ``after`` prefix schedule callbacks to run after a delay or " +"when the application is idle." msgstr "" +"متدهای دارای پیشوند ``after``، کال‌بک‌ها را برای اجرا پس از یک تأخیر یا زمانی که " +"برنامه بی‌کار است زمان‌بندی می‌کنند." -msgid "Schedule the callable *func* to be called after *ms* milliseconds, with *args* and *kw* passed to it as positional and keyword arguments. Return an identifier that can be passed to :meth:`after_cancel` to cancel the call." +msgid "" +"Schedule the callable *func* to be called after *ms* milliseconds, with *args* and " +"*kw* passed to it as positional and keyword arguments. Return an identifier that can " +"be passed to :meth:`after_cancel` to cancel the call." msgstr "" +"شیء قابل فراخوانی *func* را زمان‌بندی می‌کند تا پس از *ms* میلی‌ثانیه فراخوانی شود، " +"به‌طوری که *args* و *kw* به‌عنوان آرگومان‌های جایگاهی و کلیدواژه‌ای به آن ارسال شوند. " +"شناسه‌ای برمی‌گرداند که می‌توان آن را به :meth:`after_cancel` ارسال کرد تا فراخوانی لغو " +"شود." -msgid "If *func* is omitted, sleep for *ms* milliseconds instead, processing no events during that time, and return ``None``." +msgid "" +"If *func* is omitted, sleep for *ms* milliseconds instead, processing no events " +"during that time, and return ``None``." msgstr "" +"اگر *func* حذف شود، در عوض به مدت *ms* میلی‌ثانیه متوقف میشود در آن مدت هیچ رویدادی را " +"پردازش نمی‌کند و ``None`` را برمی‌گرداند." msgid "*func* can now be any callable object, not only a function." -msgstr "" +msgstr "*func* اکنون می‌تواند هر شیء قابل فراخوانی باشد، نه فقط یک تابع." msgid "Keyword arguments are now passed to *func*." -msgstr "" +msgstr "آرگومان‌های کلیدواژه‌ای اکنون به *func* ارسال می‌شوند." -msgid "Cancel a callback previously scheduled with :meth:`after` or :meth:`after_idle`. *id* must be an identifier returned by one of those methods; passing a value that is not such an identifier raises :exc:`ValueError`. If the callback has already run or been cancelled, this has no effect." +msgid "" +"Cancel a callback previously scheduled with :meth:`after` or :meth:`after_idle`. " +"*id* must be an identifier returned by one of those methods; passing a value that is " +"not such an identifier raises :exc:`ValueError`. If the callback has already run or " +"been cancelled, this has no effect." msgstr "" +"کال‌بکی را که قبلاً با :meth:`after` یا :meth:`after_idle` زمان‌بندی شده است، لغو " +"می‌کند. *id* باید شناسه‌ای باشد که توسط یکی از آن متدها برگردانده شده است؛ ارسال " +"مقداری که چنین شناسه‌ای نباشد، باعث پرتاب :exc:`ValueError` می‌شود. اگر کال‌بک قبلاً " +"اجرا یا لغو شده باشد، این کار اثری ندارد." msgid "Passing ``None`` (or any false value) as *id* now raises :exc:`ValueError`." msgstr "" +"ارسال ``None`` (یا هر مقدار کاذب) به‌عنوان *id* اکنون باعث پرتاب :exc:`ValueError` " +"می‌شود." -msgid "Schedule the callable *func* to be called, with *args* and *kw* passed to it, when the Tk main loop next becomes idle, that is, when it has no other events to process. Return an identifier that can be passed to :meth:`after_cancel` to cancel the call." +msgid "" +"Schedule the callable *func* to be called, with *args* and *kw* passed to it, when " +"the Tk main loop next becomes idle, that is, when it has no other events to process. " +"Return an identifier that can be passed to :meth:`after_cancel` to cancel the call." msgstr "" +"زمان‌بندی می‌کند که شیء قابل فراخوانی *func*، همراه با *args* و *kw* که به آن ارسال " +"می‌شوند، در دفعه‌ی بعدی که حلقه‌ی اصلی Tk بی‌کار شود فراخوانی شود، یعنی زمانی که رویداد " +"دیگری برای پردازش نداشته باشد. یک شناسه برمی‌گرداند که می‌توان آن را " +"به :meth:`after_cancel` ارسال کرد تا فراخوانی لغو شود." -msgid "If *id* is omitted, return a tuple of the identifiers of all callbacks currently scheduled with :meth:`after` and :meth:`after_idle` for this interpreter." +msgid "" +"If *id* is omitted, return a tuple of the identifiers of all callbacks currently " +"scheduled with :meth:`after` and :meth:`after_idle` for this interpreter." msgstr "" +"اگر *id* ذکر نشود، یک تاپل از شناسه‌های تمام کال‌بک‌هایی را که در حال حاضر " +"با :meth:`after` و :meth:`after_idle` برای این مفسر زمان‌بندی شده‌اند، برمی‌گرداند." -msgid "If *id* is given, it must identify a callback that has not yet run or been cancelled, and the return value is a tuple ``(script, type)``, where *script* refers to the function to be called and *type* is either ``'idle'`` or ``'timer'``. A :exc:`TclError` is raised if *id* does not exist." +msgid "" +"If *id* is given, it must identify a callback that has not yet run or been " +"cancelled, and the return value is a tuple ``(script, type)``, where *script* refers " +"to the function to be called and *type* is either ``'idle'`` or ``'timer'``. " +"A :exc:`TclError` is raised if *id* does not exist." msgstr "" +"اگر *id* داده شده باشد، باید کال‌بکی را شناسایی کند که هنوز اجرا یا لغو نشده باشد، و " +"مقدار بازگشتی یک تاپل ``(script, type)`` است، که در آن *script* به تابعی اشاره می‌کند " +"که قرار است فراخوانی شود و *type* یا ``'idle'`` است یا ``'timer'``. اگر *id* وجود " +"نداشته باشد، :exc:`TclError` پرتاب می‌شود." -msgid "Enter the Tk event loop, which processes events until all windows are destroyed. This is normally called once, on the root window, to run the application." +msgid "" +"Enter the Tk event loop, which processes events until all windows are destroyed. " +"This is normally called once, on the root window, to run the application." msgstr "" +"وارد حلقه‌ی رویداد Tk شوید، که رویدادها را پردازش می‌کند تا همه‌ی پنجره‌ها از بین بروند. " +"این معمولاً یک بار، روی پنجره‌ی ریشه، برای اجرای برنامه فراخوانی می‌شود." msgid "Quit the Tcl interpreter, causing :meth:`mainloop` to return." -msgstr "" +msgstr "از مفسر Tcl خارج شوید، که باعث می‌شود :meth:`mainloop` بازگشت کند." -msgid "Enter the event loop until all pending events, including idle callbacks, have been processed. This brings the display up to date and handles any events that are already queued, then returns." +msgid "" +"Enter the event loop until all pending events, including idle callbacks, have been " +"processed. This brings the display up to date and handles any events that are " +"already queued, then returns." msgstr "" +"وارد حلقه رویداد می‌شود تا همه رویدادهای در انتظار، از جمله کال‌بک‌های بی‌کار، پردازش " +"شوند. این کار نمایش را به‌روز می‌کند و هر رویدادی را که از قبل در صف قرار دارد، مدیریت " +"می‌کند، سپس بازمی‌گردد." -msgid "Enter the event loop until all pending idle callbacks have been called. This updates the display of windows, for example after geometry changes, but does not process events caused by the user." +msgid "" +"Enter the event loop until all pending idle callbacks have been called. This updates " +"the display of windows, for example after geometry changes, but does not process " +"events caused by the user." msgstr "" +"وارد حلقه رویداد می‌شود تا همه کال‌بک‌های بیکارِ در انتظار فراخوانی شوند. این کار نمایش " +"پنجره‌ها را به‌روزرسانی می‌کند، برای مثال پس از تغییرات هندسی، اما رویدادهای ناشی از " +"کاربر را پردازش نمی‌کند." -msgid "Wait until the Tcl variable *name* is modified, continuing to process events in the meantime so that the application stays responsive. *name* is usually a :class:`Variable` instance, such as an :class:`IntVar` or :class:`StringVar`." +msgid "" +"Wait until the Tcl variable *name* is modified, continuing to process events in the " +"meantime so that the application stays responsive. *name* is usually " +"a :class:`Variable` instance, such as an :class:`IntVar` or :class:`StringVar`." msgstr "" +"منتظر بمانید تا متغیر Tcl با نام *name* تغییر کند؛ در این میان به پردازش رویدادها " +"ادامه دهید تا برنامه پاسخگو بماند. *name* معمولاً نمونه‌ای از :class:`Variable` است، " +"مانند :class:`IntVar` یا :class:`StringVar`." msgid ":meth:`waitvar` is an alias of :meth:`!wait_variable`." -msgstr "" +msgstr ":meth:`waitvar` نام مستعاری از :meth:`!wait_variable` است." -msgid "Wait until *window* is destroyed, continuing to process events in the meantime. If *window* is omitted, this widget is used. This is typically used to wait for the user to finish interacting with a dialog box." +msgid "" +"Wait until *window* is destroyed, continuing to process events in the meantime. If " +"*window* is omitted, this widget is used. This is typically used to wait for the " +"user to finish interacting with a dialog box." msgstr "" +"صبر کنید تا *window* تخریب شود، در این میان به پردازش رویدادها ادامه دهید. اگر " +"*window* حذف شود، از این ابزارک استفاده می‌شود. این معمولاً برای صبر کردن تا پایان " +"تعامل کاربر با یک جعبه‌ی محاوره استفاده می‌شود." -msgid "Wait until the visibility state of *window* changes, for example when it first appears on the screen, continuing to process events in the meantime. If *window* is omitted, this widget is used. This is typically used to wait for a newly created window to become visible before acting on it." +msgid "" +"Wait until the visibility state of *window* changes, for example when it first " +"appears on the screen, continuing to process events in the meantime. If *window* is " +"omitted, this widget is used. This is typically used to wait for a newly created " +"window to become visible before acting on it." msgstr "" +"صبر کنید تا وضعیت نمایان بودن *window* تغییر کند، برای مثال هنگامی که برای نخستین " +"بار روی صفحه ظاهر می‌شود؛ در این میان به پردازش رویدادها ادامه دهید. اگر *window* " +"داده نشود، از این ابزارک استفاده می‌شود. این به‌طور معمول برای صبر کردن تا نمایان شدن " +"پنجره‌ای که به‌تازگی ایجاد شده، پیش از انجام عملیات روی آن استفاده می‌شود." msgid "The methods with the ``focus_`` prefix manage the keyboard focus." -msgstr "" +msgstr "متدهای دارای پیشوند ``focus_``، فوکوس صفحه‌کلید را مدیریت می‌کنند." -msgid "Direct the keyboard input focus for this widget's display to this widget. If the application does not currently have the input focus on this widget's display, the widget is remembered as the focus window for its top level, and the focus will be redirected to it the next time the window manager gives the focus to the top level. :meth:`focus` is an alias of :meth:`!focus_set`, except on the :class:`Canvas` and :class:`ttk.Treeview ` widgets, which provide their own :meth:`!focus` method." -msgstr "" +msgid "" +"Direct the keyboard input focus for this widget's display to this widget. If the " +"application does not currently have the input focus on this widget's display, the " +"widget is remembered as the focus window for its top level, and the focus will be " +"redirected to it the next time the window manager gives the focus to the top " +"level. :meth:`focus` is an alias of :meth:`!focus_set`, except on " +"the :class:`Canvas` and :class:`ttk.Treeview ` widgets, which " +"provide their own :meth:`!focus` method." +msgstr "" +"تمرکز ورودی صفحه‌کلید برای نمایشگر این ابزارک را به این ابزارک هدایت می‌کند. اگر " +"برنامه در حال حاضر تمرکز ورودی را در نمایشگر این ابزارک نداشته باشد، این ابزارک " +"به‌عنوان پنجره دارای تمرکز برای سطح بالای خود به خاطر سپرده می‌شود، و دفعه بعدی که " +"مدیر پنجره تمرکز را به سطح بالا بدهد، تمرکز به آن هدایت مجدد می‌شود. :meth:`focus` " +"نام مستعاری از :meth:`!focus_set` است، به‌جز برای ابزارک‌های :class:`Canvas` " +"و :class:`ttk.Treeview `، که متد :meth:`!focus` خودشان را " +"ارائه می‌دهند." -msgid "Direct the keyboard input focus to this widget even if the application does not currently have the input focus for the widget's display. This method should be used sparingly, if at all; normally an application should wait for the window manager to give it the focus rather than claiming it." +msgid "" +"Direct the keyboard input focus to this widget even if the application does not " +"currently have the input focus for the widget's display. This method should be used " +"sparingly, if at all; normally an application should wait for the window manager to " +"give it the focus rather than claiming it." msgstr "" +"تمرکز ورودی صفحه‌کلید را به این ابزارک (widget) هدایت کنید، حتی اگر برنامه در حال " +"حاضر تمرکز ورودی برای نمایشگر آن ابزارک را نداشته باشد. این متد باید به‌ندرت، اگر " +"اصلاً، استفاده شود؛ به‌طور معمول یک برنامه باید منتظر بماند تا مدیر پنجره تمرکز را به " +"آن بدهد، نه اینکه آن را تصاحب کند." -msgid "Return the widget that currently has the keyboard focus in the application, or ``None`` if no widget in the application has the focus. Use :meth:`focus_displayof` to work correctly with several displays." +msgid "" +"Return the widget that currently has the keyboard focus in the application, or " +"``None`` if no widget in the application has the focus. Use :meth:`focus_displayof` " +"to work correctly with several displays." msgstr "" +"ابزارکی را برمی‌گرداند که در حال حاضر تمرکز صفحه‌کلید را در برنامه دارد، یا اگر هیچ " +"ابزارکی در برنامه تمرکز ندارد، ``None`` برمی‌گرداند. برای کارکرد صحیح با چندین " +"نمایشگر، از :meth:`focus_displayof` استفاده کنید." -msgid "Return the widget that currently has the keyboard focus on the display where this widget is located, or ``None`` if no widget in the application has the focus on that display." +msgid "" +"Return the widget that currently has the keyboard focus on the display where this " +"widget is located, or ``None`` if no widget in the application has the focus on that " +"display." msgstr "" +"ابزارکی را که در حال حاضر فوکوس صفحه‌کلید را روی نمایشگری که این ابزارک در آن قرار " +"دارد دارد، برمی‌گرداند، یا اگر هیچ ابزارکی در برنامه فوکوس را روی آن نمایشگر نداشته " +"باشد، ``None`` برمی‌گرداند." -msgid "Return the most recent widget to have had the keyboard focus among all the widgets in the same top level as this widget; this is the widget that will receive the focus the next time the window manager gives the focus to the top level. If no widget in that top level has ever had the focus, or if the most recent focus widget has been deleted, the top level itself is returned." -msgstr "" +msgid "" +"Return the most recent widget to have had the keyboard focus among all the widgets " +"in the same top level as this widget; this is the widget that will receive the focus " +"the next time the window manager gives the focus to the top level. If no widget in " +"that top level has ever had the focus, or if the most recent focus widget has been " +"deleted, the top level itself is returned." +msgstr "" +"آخرین ابزارکی را که در میان تمام ابزارک‌های موجود در همان سطح بالای این ابزارک، تمرکز " +"صفحه‌کلید را داشته است، برمی‌گرداند؛ این ابزارک، همان ابزارکی است که دفعه‌ی بعدی که مدیر " +"پنجره تمرکز را به سطح بالا بدهد، تمرکز را دریافت خواهد کرد. اگر هیچ ابزارکی در آن سطح " +"بالا هرگز تمرکز را نداشته باشد، یا آخرین ابزارک دارای تمرکز حذف شده باشد، خود سطح بالا " +"برگردانده می‌شود." -msgid "Reconfigure Tk to use an implicit focus model in which the focus is set to a widget whenever the mouse pointer enters it. This cannot easily be disabled once enabled." +msgid "" +"Reconfigure Tk to use an implicit focus model in which the focus is set to a widget " +"whenever the mouse pointer enters it. This cannot easily be disabled once enabled." msgstr "" +"Tk را بازپیکربندی کنید تا از یک مدل فوکوس ضمنی استفاده کند که در آن هرگاه نشانگر " +"ماوس وارد یک ابزارک شود، فوکوس روی آن قرار می‌گیرد. پس از فعال‌سازی، نمی‌توان آن را " +"به‌آسانی غیرفعال کرد." -msgid "Return the next widget after this one in the keyboard traversal order, or ``None`` if there is none. The traversal order goes first to the next child, then recursively to the children of that child, and then to the next sibling higher in the stacking order. A widget is skipped if its ``takefocus`` option is set to ``0``. This method is used in the default bindings for the :kbd:`Tab` key." -msgstr "" +msgid "" +"Return the next widget after this one in the keyboard traversal order, or ``None`` " +"if there is none. The traversal order goes first to the next child, then recursively " +"to the children of that child, and then to the next sibling higher in the stacking " +"order. A widget is skipped if its ``takefocus`` option is set to ``0``. This method " +"is used in the default bindings for the :kbd:`Tab` key." +msgstr "" +"ابزارک بعدی پس از این ابزارک را در ترتیب پیمایش با صفحه‌کلید برمی‌گرداند، یا اگر وجود " +"نداشته باشد، ``None`` را برمی‌گرداند. ترتیب پیمایش ابتدا به فرزند بعدی می‌رود، سپس " +"به‌صورت بازگشتی به فرزندان آن فرزند، و سپس به هم‌نیای بعدی که در ترتیب پشته‌بندی بالاتر " +"است می‌رود. اگر گزینه‌ی ``takefocus`` یک ابزارک روی ``0`` تنظیم شده باشد، از آن ابزارک " +"صرف‌نظر می‌شود. این متد در اتصال‌های پیش‌فرض برای کلید :kbd:`Tab` استفاده می‌شود." -msgid "Return the previous widget before this one in the keyboard traversal order, or ``None`` if there is none. See :meth:`tk_focusNext` for how the order is defined. This method is used in the default bindings for the :kbd:`Shift-Tab` key." +msgid "" +"Return the previous widget before this one in the keyboard traversal order, or " +"``None`` if there is none. See :meth:`tk_focusNext` for how the order is defined. " +"This method is used in the default bindings for the :kbd:`Shift-Tab` key." msgstr "" +"ابزارک قبلی را که پیش از این ابزارک در ترتیب پیمایش صفحه‌کلید قرار دارد، برمی‌گرداند، " +"یا اگر موردی وجود نداشته باشد ``None`` را برمی‌گرداند. برای چگونگی تعریف این " +"ترتیب، :meth:`tk_focusNext` را ببینید. این متد در اتصال‌های پیش‌فرض برای " +"کلید :kbd:`Shift-Tab` استفاده می‌شود." -msgid "The methods with the ``grab_`` prefix set and query the input grab, which directs all input events to a single widget." +msgid "" +"The methods with the ``grab_`` prefix set and query the input grab, which directs " +"all input events to a single widget." msgstr "" +"متدهای دارای پیشوند ``grab_``، گرفتن ورودی (input grab) را که تمام رویدادهای ورودی " +"را به یک ابزارک هدایت می‌کند، تنظیم و پرس‌وجو می‌کنند." -msgid "Set a local grab on this widget. A grab confines pointer events to this widget and its descendants: while the pointer is outside the widget's subtree, button presses and releases and pointer motion are reported to the grab widget, and windows outside the subtree become insensitive until the grab is released. A local grab affects only the grabbing application. Any grab previously set by this application on the widget's display is automatically released. Setting a grab is the usual way to make a dialog modal: while the grab is in effect the user cannot interact with the other windows of the application." -msgstr "" +msgid "" +"Set a local grab on this widget. A grab confines pointer events to this widget and " +"its descendants: while the pointer is outside the widget's subtree, button presses " +"and releases and pointer motion are reported to the grab widget, and windows outside " +"the subtree become insensitive until the grab is released. A local grab affects only " +"the grabbing application. Any grab previously set by this application on the " +"widget's display is automatically released. Setting a grab is the usual way to make " +"a dialog modal: while the grab is in effect the user cannot interact with the other " +"windows of the application." +msgstr "" +"یک تصرف محلی (grab) روی این ابزارک تنظیم کنید. یک تصرف، رویدادهای اشاره‌گر را به این " +"ابزارک و زیرمجموعه‌های آن محدود می‌کند: هنگامی که اشاره‌گر خارج از زیردرخت ابزارک باشد، " +"فشار و رها شدن دکمه و حرکت اشاره‌گر به ابزارک متصرف گزارش داده می‌شوند و پنجره‌های خارج " +"از زیردرخت تا زمانی که تصرف آزاد نشده است غیرفعال می‌شوند. یک تصرف محلی فقط بر " +"برنامه‌ای که تصرف را انجام داده است اثر می‌گذارد. هر تصرفی که این برنامه پیش‌تر روی " +"نمایشگر ابزارک تنظیم کرده باشد، به‌طور خودکار آزاد می‌شود. تنظیم یک تصرف، روش معمول " +"برای مودال (modal) کردن یک پنجره‌ی محاوره‌ای است: تا زمانی که تصرف برقرار است، کاربر " +"نمی‌تواند با پنجره‌های دیگر برنامه تعامل کند." -msgid "Set a global grab on this widget. A global grab is like the local grab set by :meth:`grab_set`, but it locks out all other applications on the screen, so that only this widget's subtree is sensitive to pointer events, and it also grabs the keyboard. Use with caution: it is easy to render a display unusable with a global grab, since other applications stop receiving events until it is released." -msgstr "" +msgid "" +"Set a global grab on this widget. A global grab is like the local grab set " +"by :meth:`grab_set`, but it locks out all other applications on the screen, so that " +"only this widget's subtree is sensitive to pointer events, and it also grabs the " +"keyboard. Use with caution: it is easy to render a display unusable with a global " +"grab, since other applications stop receiving events until it is released." +msgstr "" +"یک گرفتن سراسری (global grab) روی این ابزارک تنظیم کنید. گرفتن سراسری مانند گرفتن " +"محلی (local grab) تنظیم‌شده توسط :meth:`grab_set` است، اما دسترسی تمام برنامه‌های دیگر " +"روی صفحه را مسدود می‌کند، به‌طوری‌که تنها زیردرخت این ابزارک به رویدادهای اشاره‌گر حساس " +"است و صفحه‌کلید را نیز می‌گیرد. با احتیاط استفاده کنید: از آن‌جا که برنامه‌های دیگر تا " +"زمانی که آزاد نشود، رویدادها را دریافت نمی‌کنند، به‌سادگی ممکن است با یک گرفتن سراسری، " +"نمایشگر غیرقابل‌استفاده شود." msgid "Release the grab on this widget if there is one; otherwise do nothing." msgstr "" +"اگر گرفتن (grab) روی این ابزارک وجود دارد، آن را آزاد کنید؛ در غیر این صورت هیچ کاری " +"انجام ندهید." -msgid "Return the widget that currently holds the grab in this application for this widget's display, or ``None`` if there is no such widget." +msgid "" +"Return the widget that currently holds the grab in this application for this " +"widget's display, or ``None`` if there is no such widget." msgstr "" +"ابزارکی را که هم‌اکنون گرفتن (grab) را در این برنامه برای نمایشگر این ابزارک در " +"اختیار دارد، برگردانید، یا اگر چنین ابزارکی وجود ندارد، ``None`` را برگردانید." -msgid "Return ``None`` if no grab is currently set on this widget, ``\"local\"`` if a local grab is set, or ``\"global\"`` if a global grab is set." +msgid "" +"Return ``None`` if no grab is currently set on this widget, ``\"local\"`` if a local " +"grab is set, or ``\"global\"`` if a global grab is set." msgstr "" +"اگر در حال حاضر هیچ تصرفی (grab) روی این ابزارک تنظیم نشده باشد، ``None`` را " +"برمی‌گرداند؛ در صورت تنظیم تصرف محلی، ``\"local\"`` یا در صورت تنظیم تصرف سراسری، " +"``\"global\"`` را برمی‌گرداند." msgid "The methods with the ``selection_`` prefix retrieve and manage the X selection." -msgstr "" +msgstr "متدهایی با پیشوند ``selection_``، انتخاب X را بازیابی و مدیریت می‌کنند." -msgid "Clear the X selection, so that no window owns it anymore. The selection to clear is given by the keyword argument *selection*, an atom name such as ``'PRIMARY'`` or ``'CLIPBOARD'``; it defaults to ``PRIMARY``. The *displayof* keyword argument names a widget that determines the display on which to operate, and defaults to this widget." -msgstr "" +msgid "" +"Clear the X selection, so that no window owns it anymore. The selection to clear is " +"given by the keyword argument *selection*, an atom name such as ``'PRIMARY'`` or " +"``'CLIPBOARD'``; it defaults to ``PRIMARY``. The *displayof* keyword argument names " +"a widget that determines the display on which to operate, and defaults to this " +"widget." +msgstr "" +"گزینش X را پاک می‌کند، به‌طوری که دیگر هیچ پنجره‌ای مالک آن نباشد. گزینشی که باید پاک " +"شود با آرگومان کلیدواژه‌ای *selection* مشخص می‌شود؛ این آرگومان یک نام اتم مانند " +"``'PRIMARY'`` یا ``'CLIPBOARD'`` است و پیش‌فرض آن ``PRIMARY`` است. آرگومان کلیدواژه‌ای " +"*displayof* نام ابزارکی را مشخص می‌کند که نمایشگر مورد عمل را تعیین می‌کند، و پیش‌فرض " +"آن همین ابزارک است." -msgid "This is overridden by the :class:`Entry`, :class:`Listbox` and :class:`Spinbox` widgets, where :meth:`!selection_clear` clears the widget's own selection instead." +msgid "" +"This is overridden by the :class:`Entry`, :class:`Listbox` and :class:`Spinbox` " +"widgets, where :meth:`!selection_clear` clears the widget's own selection instead." msgstr "" +"این رفتار در ابزارک‌های :class:`Entry`، :class:`Listbox` و :class:`Spinbox` لغو می‌شود؛ " +"در این ابزارک‌ها، :meth:`!selection_clear` به‌جای آن، انتخاب خود ابزارک را پاک می‌کند." -msgid "Return the contents of the current X selection. The keyword argument *selection* names the selection and defaults to ``PRIMARY``. The keyword argument *type* specifies the form in which the data is to be returned (the desired conversion target), an atom name such as ``'STRING'`` or ``'FILE_NAME'``; it defaults to ``STRING``, except on X11, where ``UTF8_STRING`` is tried first and ``STRING`` is used as a fallback. The *displayof* keyword argument names a widget that determines the display from which to retrieve the selection, and defaults to this widget." -msgstr "" +msgid "" +"Return the contents of the current X selection. The keyword argument *selection* " +"names the selection and defaults to ``PRIMARY``. The keyword argument *type* " +"specifies the form in which the data is to be returned (the desired conversion " +"target), an atom name such as ``'STRING'`` or ``'FILE_NAME'``; it defaults to " +"``STRING``, except on X11, where ``UTF8_STRING`` is tried first and ``STRING`` is " +"used as a fallback. The *displayof* keyword argument names a widget that determines " +"the display from which to retrieve the selection, and defaults to this widget." +msgstr "" +"محتوای گزینش جاری X را برمی‌گرداند. آرگومان کلیدواژه‌ای *selection* نام گزینش را مشخص " +"می‌کند و مقدار پیش‌فرض آن ``PRIMARY`` است. آرگومان کلیدواژه‌ای *type* قالبی را که داده " +"باید در آن برگردانده شود (هدف تبدیل دلخواه) مشخص می‌کند: یک نام اتم (atom) مانند " +"``'STRING'`` یا ``'FILE_NAME'``؛ مقدار پیش‌فرض آن ``STRING`` است، مگر در X11، که " +"ابتدا ``UTF8_STRING`` امتحان می‌شود و ``STRING`` به‌عنوان جایگزین استفاده می‌شود. " +"آرگومان کلیدواژه‌ای *displayof* نام ابزارکی را مشخص می‌کند که نمایشگر را برای واکشی " +"گزینش تعیین می‌کند، و پیش‌فرض آن همین ابزارک است." -msgid "Register *command* as a handler to supply the X selection owned by this widget when another application requests it. When the selection is retrieved, *command* is called with two arguments, the starting character offset and the maximum number of characters to return, and must return at most that many characters of the selection starting at that offset; for very long selections it is called repeatedly with increasing offsets. The keyword argument *selection* names the selection (default ``PRIMARY``) and the keyword argument *type* gives the form of the selection that the handler supplies (such as ``'STRING'`` or ``'FILE_NAME'``, default ``STRING``)." -msgstr "" +msgid "" +"Register *command* as a handler to supply the X selection owned by this widget when " +"another application requests it. When the selection is retrieved, *command* is " +"called with two arguments, the starting character offset and the maximum number of " +"characters to return, and must return at most that many characters of the selection " +"starting at that offset; for very long selections it is called repeatedly with " +"increasing offsets. The keyword argument *selection* names the selection (default " +"``PRIMARY``) and the keyword argument *type* gives the form of the selection that " +"the handler supplies (such as ``'STRING'`` or ``'FILE_NAME'``, default ``STRING``)." +msgstr "" +"*command* را به‌عنوان یک مدیر ثبت کنید تا گزینش X را که این ابزارک مالک آن است، " +"هنگامی که برنامه‌ی دیگری آن را درخواست می‌کند، تأمین کند. هنگامی که گزینش بازیابی " +"می‌شود، *command* با دو آرگومان فراخوانی می‌شود: آفست نویسه‌ی آغازین و حداکثر تعداد " +"نویسه‌های قابل بازگرداندن، و باید حداکثر همان تعداد نویسه از گزینش را که از آن آفست " +"شروع می‌شود، بازگرداند؛ برای گزینش‌های بسیار طولانی، این فرمان به‌طور مکرر با آفست‌های " +"فزاینده فراخوانی می‌شود. آرگومان کلیدواژه‌ای *selection* نام گزینش را مشخص می‌کند " +"(پیش‌فرض ``PRIMARY``) و آرگومان کلیدواژه‌ای *type* قالب گزینشی را که مدیر تأمین می‌کند، " +"مشخص می‌کند (مانند ``'STRING'`` یا ``'FILE_NAME'``، پیش‌فرض ``STRING``)." -msgid "Make this widget the owner of the X selection on its display. The previous owner, if any, is notified that it has lost the selection. The keyword argument *selection* names the selection and defaults to ``PRIMARY``." +msgid "" +"Make this widget the owner of the X selection on its display. The previous owner, if " +"any, is notified that it has lost the selection. The keyword argument *selection* " +"names the selection and defaults to ``PRIMARY``." msgstr "" +"این ابزارک را مالک گزینش X در نمایشگر آن می‌کند. به مالک پیشین، در صورت وجود، اطلاع " +"داده می‌شود که گزینش را از دست داده است. آرگومان کلیدواژه‌ای *selection* نام گزینش را " +"مشخص می‌کند و مقدار پیش‌فرض آن ``PRIMARY`` است." -msgid "Return the widget in this application that owns the X selection on the display containing this widget, or ``None`` if no widget in this application owns the selection. The keyword argument *selection* names the selection and defaults to ``PRIMARY``. The *displayof* keyword argument names a widget that determines the display to query, and defaults to this widget." -msgstr "" +msgid "" +"Return the widget in this application that owns the X selection on the display " +"containing this widget, or ``None`` if no widget in this application owns the " +"selection. The keyword argument *selection* names the selection and defaults to " +"``PRIMARY``. The *displayof* keyword argument names a widget that determines the " +"display to query, and defaults to this widget." +msgstr "" +"ابزارکی در این برنامه را برمی‌گرداند که مالک گزینش X در نمایشگر حاوی این ابزارک است، " +"یا اگر هیچ ابزارکی در این برنامه مالک گزینش نباشد، ``None`` برمی‌گرداند. آرگومان " +"کلیدواژه‌ای *selection* نام گزینش را تعیین می‌کند و مقدار پیش‌فرض آن ``PRIMARY`` است. " +"آرگومان کلیدواژه‌ای *displayof* ابزارکی را تعیین می‌کند که نمایشگر مورد پرس‌وجو را مشخص " +"می‌کند، و مقدار پیش‌فرض آن این ابزارک است." msgid "The methods with the ``clipboard_`` prefix manage the clipboard." -msgstr "" +msgstr "متدهایی که پیشوند ``clipboard_`` دارند، کلیپ‌بورد را مدیریت می‌کنند." -msgid "Append *string* to the Tk clipboard and claim ownership of the clipboard on this widget's display. Before appending, the clipboard should be emptied with :meth:`clipboard_clear`; all appends should be completed before returning to the event loop so that the clipboard is updated atomically. The keyword argument *type* specifies the form of the data, an atom name such as ``'STRING'`` or ``'FILE_NAME'`` (default ``STRING``), and the keyword argument *format* specifies the representation used to transmit it (default ``STRING``). The *displayof* keyword argument names a widget that determines the target display, and defaults to this widget. The contents can be retrieved with :meth:`clipboard_get` or :meth:`selection_get`." -msgstr "" +msgid "" +"Append *string* to the Tk clipboard and claim ownership of the clipboard on this " +"widget's display. Before appending, the clipboard should be emptied " +"with :meth:`clipboard_clear`; all appends should be completed before returning to " +"the event loop so that the clipboard is updated atomically. The keyword argument " +"*type* specifies the form of the data, an atom name such as ``'STRING'`` or " +"``'FILE_NAME'`` (default ``STRING``), and the keyword argument *format* specifies " +"the representation used to transmit it (default ``STRING``). The *displayof* keyword " +"argument names a widget that determines the target display, and defaults to this " +"widget. The contents can be retrieved with :meth:`clipboard_get` " +"or :meth:`selection_get`." +msgstr "" +"*string* را به کلیپ‌بورد Tk اضافه کنید و مالکیت کلیپ‌بورد را در نمایش این ابزارک کسب " +"کنید. پیش از افزودن، کلیپ‌بورد باید با :meth:`clipboard_clear` خالی شود؛ همه افزودن‌ها " +"باید پیش از بازگشت به حلقه رویداد کامل شوند تا کلیپ‌بورد به‌صورت اتمی به‌روزرسانی شود. " +"آرگومان کلیدواژه‌ای *type* قالب داده را مشخص می‌کند، یعنی یک نام اتم (atom) مانند " +"``'STRING'`` یا ``'FILE_NAME'`` (پیش‌فرض ``STRING``)، و آرگومان کلیدواژه‌ای *format* " +"بازنمایی را مشخص می‌کند که برای انتقال آن استفاده می‌شود (پیش‌فرض ``STRING``). آرگومان " +"کلیدواژه‌ای *displayof* ابزارکی را مشخص می‌کند که نمایش هدف را تعیین می‌کند، و پیش‌فرض آن " +"این ابزارک است. محتویات را می‌توان با :meth:`clipboard_get` یا :meth:`selection_get` " +"بازیابی کرد." -msgid "Claim ownership of the clipboard on this widget's display and remove any previous contents. The *displayof* keyword argument names a widget that determines the target display, and defaults to this widget." +msgid "" +"Claim ownership of the clipboard on this widget's display and remove any previous " +"contents. The *displayof* keyword argument names a widget that determines the target " +"display, and defaults to this widget." msgstr "" +"مالکیت کلیپ‌بورد را در نمایشگر این ابزارک به دست بگیرید و هرگونه محتوای پیشین را حذف " +"کنید. آرگومان کلیدواژه‌ای *displayof* ابزارکی را مشخص می‌کند که نمایشگر هدف را تعیین " +"می‌کند، و مقدار پیش‌فرض آن همین ابزارک است." -msgid "Retrieve data from the clipboard on this widget's display. The keyword argument *type* specifies the form in which the data is to be returned, an atom name such as ``'STRING'`` or ``'FILE_NAME'``; it defaults to ``STRING``, except on X11, where ``UTF8_STRING`` is tried first and ``STRING`` is used as a fallback. The *displayof* keyword argument names a widget that determines the display, and defaults to the root window of the application. This is equivalent to ``selection_get(selection='CLIPBOARD')``." -msgstr "" +msgid "" +"Retrieve data from the clipboard on this widget's display. The keyword argument " +"*type* specifies the form in which the data is to be returned, an atom name such as " +"``'STRING'`` or ``'FILE_NAME'``; it defaults to ``STRING``, except on X11, where " +"``UTF8_STRING`` is tried first and ``STRING`` is used as a fallback. The *displayof* " +"keyword argument names a widget that determines the display, and defaults to the " +"root window of the application. This is equivalent to " +"``selection_get(selection='CLIPBOARD')``." +msgstr "" +"داده‌ها را از کلیپ‌بورد در نمایش این ابزارک بازیابی می‌کند. آرگومان کلیدواژه‌ای *type* " +"قالبی را مشخص می‌کند که داده در آن بازگردانده می‌شود؛ این قالب یک نام اتم مانند " +"``'STRING'`` یا ``'FILE_NAME'`` است. مقدار پیش‌فرض آن ``STRING`` است، به‌جز در X11، که " +"ابتدا ``UTF8_STRING`` امتحان می‌شود و از ``STRING`` به‌عنوان جایگزین استفاده می‌شود. " +"آرگومان کلیدواژه‌ای *displayof* نام ویدجتی است که نمایش را تعیین می‌کند، و پیش‌فرض آن " +"پنجره ریشه برنامه است. این معادل ``selection_get(selection='CLIPBOARD')`` است." -msgid "The methods with the ``option_`` prefix query and modify the Tk option database." +msgid "" +"The methods with the ``option_`` prefix query and modify the Tk option database." msgstr "" +"متدهایی که پیشوند ``option_`` دارند، پایگاه داده‌ی گزینه‌های Tk را پرس‌وجو و تغییر " +"می‌دهند." -msgid "Add an option to the Tk option database that associates *value* with *pattern*. *pattern* consists of names and/or classes separated by asterisks or dots, in the usual X format. *priority* is an integer between 0 and 100, or one of the symbolic names ``'widgetDefault'`` (20), ``'startupFile'`` (40), ``'userDefault'`` (60), or ``'interactive'`` (80); it defaults to ``interactive``." -msgstr "" +msgid "" +"Add an option to the Tk option database that associates *value* with *pattern*. " +"*pattern* consists of names and/or classes separated by asterisks or dots, in the " +"usual X format. *priority* is an integer between 0 and 100, or one of the symbolic " +"names ``'widgetDefault'`` (20), ``'startupFile'`` (40), ``'userDefault'`` (60), or " +"``'interactive'`` (80); it defaults to ``interactive``." +msgstr "" +"یک گزینه به پایگاه داده‌ی گزینه‌های Tk اضافه کنید که *value* را با *pattern* مرتبط " +"می‌سازد. *pattern* در قالب معمول X از نام‌ها و/یا کلاس‌هایی تشکیل شده است که با ستاره " +"یا نقطه از هم جدا شده‌اند. *priority* یک عدد صحیح بین ۰ تا ۱۰۰ است، یا یکی از نام‌های " +"نمادین ``'widgetDefault'`` (۲۰)، ``'startupFile'`` (۴۰)، ``'userDefault'`` (۶۰) یا " +"``'interactive'`` (۸۰)؛ پیش‌فرض آن ``interactive`` است." -msgid "Clear the Tk option database. Default options from the :envvar:`!RESOURCE_MANAGER` property or the :file:`.Xdefaults` file are reloaded automatically the next time an option is added to or removed from the database." +msgid "" +"Clear the Tk option database. Default options from the :envvar:`!RESOURCE_MANAGER` " +"property or the :file:`.Xdefaults` file are reloaded automatically the next time an " +"option is added to or removed from the database." msgstr "" +"پایگاه داده‌ی گزینه‌های Tk را پاک می‌کند. گزینه‌های پیش‌فرض از ویژگی :envvar:`!" +"RESOURCE_MANAGER` یا فایل :file:`.Xdefaults`، بار بعدی که گزینه‌ای به پایگاه داده " +"افزوده شود یا از آن حذف شود، به‌طور خودکار دوباره بارگذاری می‌شوند." -msgid "Return the value of the option matching this widget under *name* and *className* from the Tk option database, or an empty string if there is no matching entry. When several entries match, the one with the highest priority is returned, and among entries of equal priority the most recently added one." +msgid "" +"Return the value of the option matching this widget under *name* and *className* " +"from the Tk option database, or an empty string if there is no matching entry. When " +"several entries match, the one with the highest priority is returned, and among " +"entries of equal priority the most recently added one." msgstr "" +"مقدار گزینه‌ای را که در پایگاه داده‌ی گزینه‌های Tk، با این ابزارک تحت *name* و " +"*className* مطابقت دارد، برمی‌گرداند؛ اگر هیچ ورودی مطابقی وجود نداشته باشد، یک رشته " +"خالی برمی‌گرداند. هنگامی که چند ورودی مطابقت داشته باشند، ورودی با بالاترین اولویت " +"برگردانده می‌شود و در میان ورودی‌های با اولویت برابر، آخرین ورودی اضافه‌شده برگردانده " +"می‌شود." -msgid "Read the file named *fileName*, which should have the standard format for an X resource database such as :file:`.Xdefaults`, and add all the options it specifies to the Tk option database. *priority* is interpreted as for :meth:`option_add` and defaults to ``interactive``." +msgid "" +"Read the file named *fileName*, which should have the standard format for an X " +"resource database such as :file:`.Xdefaults`, and add all the options it specifies " +"to the Tk option database. *priority* is interpreted as for :meth:`option_add` and " +"defaults to ``interactive``." msgstr "" +"فایلی به نام *fileName* را بخوانید، که باید قالب استاندارد یک پایگاه داده منابع X " +"مانند :file:`.Xdefaults` را داشته باشد، و همه گزینه‌های مشخص‌شده در آن را به پایگاه " +"داده گزینه‌های Tk اضافه کنید. *priority* مانند :meth:`option_add` تفسیر می‌شود و به‌طور " +"پیش‌فرض ``interactive`` است." -msgid "Ring the bell on the display for this widget, using the display's current bell-related settings, and reset the screen saver for the screen. If *displayof* is given as a widget, the bell is rung on that widget's display instead." +msgid "" +"Ring the bell on the display for this widget, using the display's current bell-" +"related settings, and reset the screen saver for the screen. If *displayof* is given " +"as a widget, the bell is rung on that widget's display instead." msgstr "" +"زنگ را روی نمایشگر این ابزارک، با استفاده از تنظیمات فعلی مربوط به زنگِ نمایشگر، به صدا " +"درآورید و نگهبان صفحه را برای صفحه بازنشانی کنید. اگر *displayof* به‌عنوان یک ابزارک " +"داده شود، در عوض زنگ در نمایشگر آن ابزارک به صدا درمی‌آید." -msgid "Set a new color scheme for all Tk widget elements. Existing widgets are updated and the option database is changed so that future widgets use the new colors. A single color argument is taken as the normal background color, from which a complete palette is computed. Alternatively, the arguments may be given as keyword *name*/*value* pairs naming individual options in the option database. The recognized option names are ``activeBackground``, ``activeForeground``, ``background``, ``disabledForeground``, ``foreground``, ``highlightBackground``, ``highlightColor``, ``insertBackground``, ``selectColor``, ``selectBackground``, ``selectForeground``, and ``troughColor``; reasonable defaults are computed for any that are not specified." -msgstr "" +msgid "" +"Set a new color scheme for all Tk widget elements. Existing widgets are updated and " +"the option database is changed so that future widgets use the new colors. A single " +"color argument is taken as the normal background color, from which a complete " +"palette is computed. Alternatively, the arguments may be given as keyword *name*/" +"*value* pairs naming individual options in the option database. The recognized " +"option names are ``activeBackground``, ``activeForeground``, ``background``, " +"``disabledForeground``, ``foreground``, ``highlightBackground``, ``highlightColor``, " +"``insertBackground``, ``selectColor``, ``selectBackground``, ``selectForeground``, " +"and ``troughColor``; reasonable defaults are computed for any that are not specified." +msgstr "" +"طرح‌واره رنگ جدیدی را برای تمام عناصر ابزارک Tk تنظیم می‌کند. ابزارک‌های موجود به‌روزرسانی " +"می‌شوند و پایگاه داده‌ی گزینه‌ها تغییر می‌کند تا ابزارک‌های بعدی از رنگ‌های جدید استفاده " +"کنند. یک آرگومان رنگ واحد به‌عنوان رنگ پس‌زمینه معمول تلقی می‌شود و پالت کاملی از آن " +"محاسبه می‌شود. به‌عنوان جایگزین، می‌توان آرگومان‌ها را به‌صورت جفت‌های کلیدواژه‌ای *name*/" +"*value* نیز وارد کرد که نام گزینه‌های منفرد در پایگاه داده‌ی گزینه‌ها را تعیین می‌کنند. " +"نام گزینه‌های شناخته‌شده عبارت‌اند از ``activeBackground``، ``activeForeground``، " +"``background``، ``disabledForeground``، ``foreground``، ``highlightBackground``، " +"``highlightColor``، ``insertBackground``، ``selectColor``، ``selectBackground``، " +"``selectForeground`` و ``troughColor``؛ برای هر گزینه‌ای که مشخص نشده باشد، پیش‌فرض‌های " +"معقولی محاسبه می‌شوند." -msgid "Restore the application's colors to the light brown (bisque) color scheme used in Tk 3.6 and earlier versions. Provided for backward compatibility." +msgid "" +"Restore the application's colors to the light brown (bisque) color scheme used in Tk " +"3.6 and earlier versions. Provided for backward compatibility." msgstr "" +"رنگ‌های برنامه را به طرح‌واره رنگی قهوه‌ای روشن (bisque) که در Tk 3.6 و نسخه‌های پیشین " +"استفاده می‌شد، بازمی‌گرداند. برای سازگاری با نسخه‌های قدیمی‌تر ارائه شده است." -msgid "Query or set whether Tk's look and feel should strictly adhere to Motif. A true *boolean* value enables strict Motif compliance (for example, no color change when the mouse passes over a slider). Return the resulting setting." +msgid "" +"Query or set whether Tk's look and feel should strictly adhere to Motif. A true " +"*boolean* value enables strict Motif compliance (for example, no color change when " +"the mouse passes over a slider). Return the resulting setting." msgstr "" +"بپرسید یا تنظیم کنید که آیا ظاهر و رفتار Tk باید به‌طور سخت‌گیرانه از Motif پیروی کند. " +"یک مقدار *بولی* درست، انطباق سخت‌گیرانه با Motif را فعال می‌کند (برای مثال، تغییر " +"نکردن رنگ هنگام عبور ماوس از روی یک لغزنده). تنظیم حاصل را برمی‌گرداند." -msgid "The methods with the ``busy_`` prefix manage the busy state of a window, which shows a busy cursor and ignores user input." +msgid "" +"The methods with the ``busy_`` prefix manage the busy state of a window, which shows " +"a busy cursor and ignores user input." msgstr "" +"متدهایی که پیشوند ``busy_`` دارند، وضعیت مشغول بودن یک پنجره را مدیریت می‌کنند؛ این " +"وضعیت یک نشانگر مشغول نمایش می‌دهد و ورودی کاربر را نادیده می‌گیرد." -msgid "Make this widget appear busy. A transparent window is placed in front of the widget, so that it and all of its descendants in the widget hierarchy are blocked from pointer events and display a busy cursor. Normally :meth:`update` should be called immediately afterwards to ensure that the hold operation is in effect before the application starts its processing." -msgstr "" +msgid "" +"Make this widget appear busy. A transparent window is placed in front of the widget, " +"so that it and all of its descendants in the widget hierarchy are blocked from " +"pointer events and display a busy cursor. Normally :meth:`update` should be called " +"immediately afterwards to ensure that the hold operation is in effect before the " +"application starts its processing." +msgstr "" +"این ابزارک را مشغول نشان دهید. پنجره‌ای شفاف در جلوی ابزارک قرار می‌گیرد، به‌طوری که آن " +"و همه‌ی زیرمجموعه‌های آن در سلسله‌مراتب ابزارک از دریافت رویدادهای اشاره‌گر مسدود می‌شوند " +"و یک نشانگر مشغول نمایش می‌دهند. معمولاً باید بلافاصله پس از آن، :meth:`update` " +"فراخوانی شود تا اطمینان حاصل شود که عملیات نگه‌داشت (hold) پیش از آنکه برنامه پردازش " +"خود را آغاز کند، اعمال شده است." -msgid "The only supported configuration option is *cursor*, the cursor to be displayed while the widget is busy; it may have any of the values accepted by :meth:`!configure`." +msgid "" +"The only supported configuration option is *cursor*, the cursor to be displayed " +"while the widget is busy; it may have any of the values accepted by :meth:`!" +"configure`." msgstr "" +"تنها گزینه‌ی پیکربندی پشتیبانی‌شده *cursor* است، یعنی نشانگری که هنگام مشغول بودن ابزارک " +"نمایش داده می‌شود؛ این گزینه می‌تواند هر یک از مقادیر پذیرفته‌شده توسط :meth:`!" +"configure` را داشته باشد." -msgid ":meth:`busy_hold`, :meth:`busy` and :meth:`tk_busy` are aliases of :meth:`!tk_busy_hold`." +msgid "" +":meth:`busy_hold`, :meth:`busy` and :meth:`tk_busy` are aliases of :meth:`!" +"tk_busy_hold`." msgstr "" +":meth:`busy_hold`، :meth:`busy` و :meth:`tk_busy` نام‌های مستعار :meth:`!" +"tk_busy_hold` هستند." -msgid "Query or modify the configuration options of the busy window. The widget must have been previously made busy by :meth:`tk_busy_hold`. With no arguments, return a dictionary describing all of the available options; if *cnf* is the name of an option, return a tuple describing that one option. Otherwise set the given options to the given values. Options may have any of the values accepted by :meth:`tk_busy_hold`." -msgstr "" +msgid "" +"Query or modify the configuration options of the busy window. The widget must have " +"been previously made busy by :meth:`tk_busy_hold`. With no arguments, return a " +"dictionary describing all of the available options; if *cnf* is the name of an " +"option, return a tuple describing that one option. Otherwise set the given options " +"to the given values. Options may have any of the values accepted " +"by :meth:`tk_busy_hold`." +msgstr "" +"گزینه‌های پیکربندی پنجره مشغول را بازیابی یا تغییر می‌دهد. ابزارک باید پیش‌تر " +"با :meth:`tk_busy_hold` مشغول شده باشد. بدون آرگومان، یک دیکشنری برمی‌گرداند که همه " +"گزینه‌های موجود را توصیف می‌کند؛ اگر *cnf* نام یک گزینه باشد، یک تاپل برمی‌گرداند که " +"همان گزینه را توصیف می‌کند. در غیر این صورت، گزینه‌های داده‌شده را به مقادیر داده‌شده " +"تنظیم می‌کند. گزینه‌ها می‌توانند هر یک از مقادیر پذیرفته‌شده توسط :meth:`tk_busy_hold` " +"را داشته باشند." -msgid "The option database is referenced through the widget name or class. For example, if a :class:`Frame` widget named ``frame`` is to be made busy, the busy cursor can be specified for it by either of the calls::" +msgid "" +"The option database is referenced through the widget name or class. For example, if " +"a :class:`Frame` widget named ``frame`` is to be made busy, the busy cursor can be " +"specified for it by either of the calls::" msgstr "" +"به پایگاه داده‌ی گزینه‌ها از طریق نام یا کلاس ابزارک ارجاع داده می‌شود. برای مثال، اگر " +"قرار باشد یک ابزارک :class:`Frame` با نام ``frame`` مشغول شود، می‌توان نشانگر مشغول را " +"با هر یک از فراخوانی‌های زیر برای آن مشخص کرد::" msgid "" "w.option_add('*frame.busyCursor', 'gumby')\n" "w.option_add('*Frame.BusyCursor', 'gumby')" msgstr "" +"w.option_add('*frame.busyCursor', 'gumby')\n" +"w.option_add('*Frame.BusyCursor', 'gumby')" -msgid ":meth:`busy_configure`, :meth:`busy_config` and :meth:`tk_busy_config` are aliases of :meth:`!tk_busy_configure`." +msgid "" +":meth:`busy_configure`, :meth:`busy_config` and :meth:`tk_busy_config` are aliases " +"of :meth:`!tk_busy_configure`." msgstr "" +":meth:`busy_configure`، :meth:`busy_config` و :meth:`tk_busy_config` نام‌های " +"مستعار :meth:`!tk_busy_configure` هستند." -msgid "Return the current value of the busy configuration *option*. The widget must have been previously made busy by :meth:`tk_busy_hold`, and *option* may have any of the values accepted by that method." +msgid "" +"Return the current value of the busy configuration *option*. The widget must have " +"been previously made busy by :meth:`tk_busy_hold`, and *option* may have any of the " +"values accepted by that method." msgstr "" +"مقدار فعلی *option* پیکربندی busy را برمی‌گرداند. ابزارک باید پیش‌تر " +"توسط :meth:`tk_busy_hold` مشغول شده باشد، و *option* می‌تواند هر یک از مقادیر " +"پذیرفته‌شده توسط آن متد را داشته باشد." msgid ":meth:`busy_cget` is an alias of :meth:`!tk_busy_cget`." -msgstr "" +msgstr ":meth:`busy_cget` نام مستعار :meth:`!tk_busy_cget` است." -msgid "Make this widget no longer busy, releasing the resources (including the transparent window) allocated when it was made busy. User events will again be received by the widget. These resources are also released when the widget is destroyed." +msgid "" +"Make this widget no longer busy, releasing the resources (including the transparent " +"window) allocated when it was made busy. User events will again be received by the " +"widget. These resources are also released when the widget is destroyed." msgstr "" +"این ابزارک را از حالت مشغول خارج کنید تا منابعی (از جمله پنجره شفاف) که هنگام " +"مشغول‌شدن آن اختصاص‌یافته‌اند، آزاد شوند. ابزارک دوباره رویدادهای کاربر را دریافت خواهد " +"کرد. این منابع نیز هنگامی که ابزارک نابود شود، آزاد می‌شوند." msgid ":meth:`busy_forget` is an alias of :meth:`!tk_busy_forget`." -msgstr "" +msgstr ":meth:`busy_forget` یک نام مستعار از :meth:`!tk_busy_forget` است." msgid "Return ``True`` if the widget is currently busy, ``False`` otherwise." msgstr "" +"اگر ابزارک (widget) در حال حاضر مشغول باشد، ``True`` برمی‌گرداند، در غیر این صورت " +"``False`` برمی‌گرداند." msgid ":meth:`busy_status` is an alias of :meth:`!tk_busy_status`." -msgstr "" +msgstr ":meth:`busy_status` نام مستعاری از :meth:`!tk_busy_status` است." -msgid "Return a list of widgets that are currently busy. If *pattern* is given, only busy widgets whose path names match the pattern are returned." +msgid "" +"Return a list of widgets that are currently busy. If *pattern* is given, only busy " +"widgets whose path names match the pattern are returned." msgstr "" +"فهرستی از ابزارک‌هایی را که در حال حاضر مشغول هستند برمی‌گرداند. اگر *pattern* داده " +"شود، تنها ابزارک‌های مشغولی که نام مسیرشان با الگو مطابقت دارد برگردانده می‌شوند." msgid ":meth:`busy_current` is an alias of :meth:`!tk_busy_current`." -msgstr "" +msgstr ":meth:`busy_current` نام مستعاری برای :meth:`!tk_busy_current` است." -msgid "The methods with the ``winfo_`` prefix retrieve information about windows managed by Tk." +msgid "" +"The methods with the ``winfo_`` prefix retrieve information about windows managed by " +"Tk." msgstr "" +"متدهایی که پیشوند ``winfo_`` دارند، اطلاعات مربوط به پنجره‌های مدیریت‌شده توسط Tk را " +"دریافت می‌کنند." -msgid "Return the integer identifier for the atom whose name is *name*, creating a new atom if none exists. If *displayof* is given, the atom is looked up on the display of that window; otherwise it is looked up on the display of the application's main window." +msgid "" +"Return the integer identifier for the atom whose name is *name*, creating a new atom " +"if none exists. If *displayof* is given, the atom is looked up on the display of " +"that window; otherwise it is looked up on the display of the application's main " +"window." msgstr "" +"شناسه عدد صحیح برای اتمی که نام آن *name* است را برمی‌گرداند و در صورتی که اتمی وجود " +"نداشته باشد، یک اتم جدید ایجاد می‌کند. اگر *displayof* داده شده باشد، اتم در نمایش آن " +"پنجره جستجو می‌شود؛ در غیر این صورت در نمایش پنجره اصلی برنامه جستجو می‌شود." -msgid "Return the textual name for the atom whose integer identifier is *id*. This is the inverse of :meth:`winfo_atom`. If *displayof* is given, the identifier is looked up on the display of that window; otherwise it is looked up on the display of the application's main window." +msgid "" +"Return the textual name for the atom whose integer identifier is *id*. This is the " +"inverse of :meth:`winfo_atom`. If *displayof* is given, the identifier is looked up " +"on the display of that window; otherwise it is looked up on the display of the " +"application's main window." msgstr "" +"نام متنی اتمی که شناسه‌ی عدد صحیح آن *id* است را برمی‌گرداند. این، " +"معکوس :meth:`winfo_atom` است. اگر *displayof* داده شود، شناسه در نمایش آن پنجره " +"جست‌وجو می‌شود؛ در غیر این صورت، در نمایش پنجره‌ی اصلی برنامه جست‌وجو می‌شود." msgid "Return the number of cells in the colormap for the widget." -msgstr "" +msgstr "تعداد سلول‌های نقشه رنگ (colormap) برای ابزارک (widget) را برمی‌گرداند." -msgid "Return a list containing the widgets that are children of the widget, in stacking order from lowest to highest. Toplevel windows are returned as children of their logical parents." +msgid "" +"Return a list containing the widgets that are children of the widget, in stacking " +"order from lowest to highest. Toplevel windows are returned as children of their " +"logical parents." msgstr "" +"فهرستی حاوی ابزارک‌هایی که فرزند این ابزارک هستند را برمی‌گرداند، به ترتیب پشته‌بندی از " +"پایین‌ترین به بالاترین. پنجره‌های Toplevel به‌عنوان فرزند والد منطقی خود برگردانده " +"می‌شوند." msgid "Return the class name of the widget." -msgstr "" +msgstr "نام کلاس ابزارک را برمی‌گرداند." -msgid "Return ``True`` if the colormap for the widget is known to be full, ``False`` otherwise." +msgid "" +"Return ``True`` if the colormap for the widget is known to be full, ``False`` " +"otherwise." msgstr "" +"اگر مشخص باشد که نقشه رنگ (colormap) برای ابزارک (widget) پر است، ``True`` را " +"برمی‌گرداند، در غیر این صورت ``False`` را برمی‌گرداند." -msgid "Return the widget containing the point given by *rootX* and *rootY*, or ``None`` if no window in this application contains the point. The coordinates are in screen units in the coordinate system of the root window. If *displayof* is given, the coordinates refer to the screen containing that window; otherwise they refer to the screen of the application's main window." +msgid "" +"Return the widget containing the point given by *rootX* and *rootY*, or ``None`` if " +"no window in this application contains the point. The coordinates are in screen " +"units in the coordinate system of the root window. If *displayof* is given, the " +"coordinates refer to the screen containing that window; otherwise they refer to the " +"screen of the application's main window." msgstr "" +"ابزارک شامل نقطه‌ی مشخص‌شده با *rootX* و *rootY* را برمی‌گرداند، یا اگر هیچ پنجره‌ای در " +"این برنامه شامل آن نقطه نباشد، ``None`` را برمی‌گرداند. مختصات در دستگاه مختصات پنجره‌ی " +"ریشه و بر حسب واحدهای صفحه هستند. اگر *displayof* داده شود، مختصات به صفحه‌ی شامل آن " +"پنجره اشاره می‌کنند؛ در غیر این صورت به صفحه‌ی پنجره‌ی اصلی برنامه اشاره می‌کنند." msgid "Return the depth of the widget, that is, the number of bits per pixel." -msgstr "" +msgstr "عمق ابزارک را برمی‌گرداند، یعنی تعداد بیت‌ها در هر پیکسل." msgid "Return true if the widget exists, false otherwise." msgstr "" +"اگر ابزارک وجود داشته باشد، مقدار true و در غیر این صورت مقدار false را برمی‌گرداند." -msgid "Return a floating-point value giving the number of pixels in the widget corresponding to the screen distance *number* (for example, ``\"2.0c\"`` or ``\"1i\"``). The result may be fractional; for a rounded integer value use :meth:`winfo_pixels`." +msgid "" +"Return a floating-point value giving the number of pixels in the widget " +"corresponding to the screen distance *number* (for example, ``\"2.0c\"`` or " +"``\"1i\"``). The result may be fractional; for a rounded integer value " +"use :meth:`winfo_pixels`." msgstr "" +"یک مقدار ممیز شناور برمی‌گرداند که تعداد پیکسل‌های ابزارک معادل فاصله‌ی صفحه‌نمایش " +"*number* را نشان می‌دهد (برای مثال، ``\"2.0c\"`` یا ``\"1i\"``). نتیجه ممکن است کسری " +"باشد؛ برای یک مقدار عدد صحیح گرد شده از :meth:`winfo_pixels` استفاده کنید." -msgid "Return the geometry of the widget, in the form ``widthxheight+x+y``. All dimensions are in pixels. An offset can be negative; see :meth:`~Wm.geometry`." +msgid "" +"Return the geometry of the widget, in the form ``widthxheight+x+y``. All dimensions " +"are in pixels. An offset can be negative; see :meth:`~Wm.geometry`." msgstr "" +"هندسه‌ی ابزارک را به‌صورت ``widthxheight+x+y`` برمی‌گرداند. تمام ابعاد بر حسب پیکسل " +"هستند. یک جابه‌جایی می‌تواند منفی باشد؛ به :meth:`~Wm.geometry` مراجعه کنید." -msgid "Return the height of the widget in pixels. When a window is first created its height is 1 pixel; it is eventually changed by a geometry manager. See also :meth:`winfo_reqheight`." +msgid "" +"Return the height of the widget in pixels. When a window is first created its height " +"is 1 pixel; it is eventually changed by a geometry manager. See " +"also :meth:`winfo_reqheight`." msgstr "" +"ارتفاع ابزارک را بر حسب پیکسل برمی‌گرداند. هنگامی که یک پنجره برای نخستین بار ایجاد " +"می‌شود، ارتفاع آن ۱ پیکسل است؛ این مقدار در نهایت توسط یک مدیر چیدمان تغییر می‌کند. " +"همچنین :meth:`winfo_reqheight` را ببینید." -msgid "Return a low-level platform-specific identifier for the widget. On Unix this is the X window identifier, and on Windows it is the window handle." +msgid "" +"Return a low-level platform-specific identifier for the widget. On Unix this is the " +"X window identifier, and on Windows it is the window handle." msgstr "" +"یک شناسه‌ی سطح پایین ویژه‌ی سکو برای ابزارک برمی‌گرداند. در یونیکس، این شناسه‌ی پنجره‌ی X است " +"و در ویندوز، دسته پنجره (window handle) است." -msgid "Return a tuple of the names of all Tcl interpreters currently registered for a particular display. If *displayof* is given, the return value refers to the display of that window; otherwise it refers to the display of the application's main window." +msgid "" +"Return a tuple of the names of all Tcl interpreters currently registered for a " +"particular display. If *displayof* is given, the return value refers to the display " +"of that window; otherwise it refers to the display of the application's main window." msgstr "" +"یک تاپل از نام‌های تمام مفسرهای Tcl که در حال حاضر برای یک نمایش خاص ثبت شده‌اند، " +"برمی‌گرداند. اگر *displayof* داده شده باشد، مقدار بازگشتی به نمایش آن پنجره اشاره " +"می‌کند؛ در غیر این صورت، به نمایش پنجره‌ی اصلی برنامه اشاره می‌کند." msgid "Return true if the widget is currently mapped, false otherwise." msgstr "" +"اگر ابزارک در حال حاضر نگاشت‌شده (mapped) باشد، مقدار true بازمی‌گرداند، در غیر این صورت " +"مقدار false بازمی‌گرداند." -msgid "Return the name of the geometry manager currently responsible for the widget, or an empty string if it is not managed by any geometry manager." +msgid "" +"Return the name of the geometry manager currently responsible for the widget, or an " +"empty string if it is not managed by any geometry manager." msgstr "" +"نام مدیر چیدمان (geometry manager) مسئول فعلی ابزارک را برمی‌گرداند، یا اگر تحت مدیریت " +"هیچ مدیر چیدمانی نباشد، یک رشته خالی برمی‌گرداند." msgid "Return the widget's name within its parent, as opposed to its full path name." -msgstr "" +msgstr "نام ابزارک را در والد خود برمی‌گرداند، برخلاف نام مسیر کامل آن." -msgid "Return the path name of the widget's parent, or an empty string if the widget is the main window of the application." +msgid "" +"Return the path name of the widget's parent, or an empty string if the widget is the " +"main window of the application." msgstr "" +"نام مسیر والد ابزارک را برمی‌گرداند، یا اگر ابزارک پنجره‌ی اصلی برنامه باشد، یک رشته " +"خالی برمی‌گرداند." -msgid "Return the path name of the window whose identifier is *id*. If *displayof* is given, the identifier is looked up on the display of that window; otherwise it is looked up on the display of the application's main window." +msgid "" +"Return the path name of the window whose identifier is *id*. If *displayof* is " +"given, the identifier is looked up on the display of that window; otherwise it is " +"looked up on the display of the application's main window." msgstr "" +"نام مسیر پنجره‌ای که شناسه‌ی آن *id* است را برمی‌گرداند. اگر *displayof* داده شده باشد، " +"شناسه در نمایشگر آن پنجره جستجو می‌شود؛ در غیر این صورت، در نمایشگر پنجره‌ی اصلی برنامه " +"جستجو می‌شود." -msgid "Return the number of pixels in the widget corresponding to the screen distance *number* (for example, ``\"2.0c\"`` or ``\"1i\"``). The result is rounded to the nearest integer; for a fractional result use :meth:`winfo_fpixels`." +msgid "" +"Return the number of pixels in the widget corresponding to the screen distance " +"*number* (for example, ``\"2.0c\"`` or ``\"1i\"``). The result is rounded to the " +"nearest integer; for a fractional result use :meth:`winfo_fpixels`." msgstr "" +"تعداد پیکسل‌های موجود در ابزارک را که با فاصله صفحه‌ای *number* متناظر است برمی‌گرداند " +"(برای مثال، ``\"2.0c\"`` یا ``\"1i\"``). نتیجه به نزدیک‌ترین عدد صحیح گرد می‌شود؛ برای " +"نتیجه کسری از :meth:`winfo_fpixels` استفاده کنید." -msgid "Return the pointer's *x* coordinate, in pixels, relative to the screen's root window (or virtual root, if one is in use). Return ``-1`` if the pointer is not on the same screen as the widget." +msgid "" +"Return the pointer's *x* coordinate, in pixels, relative to the screen's root window " +"(or virtual root, if one is in use). Return ``-1`` if the pointer is not on the same " +"screen as the widget." msgstr "" +"مختصات *x* نشانگر را بر حسب پیکسل، نسبت به پنجره‌ی ریشه‌ی صفحه نمایش (یا ریشه‌ی مجازی، در " +"صورت استفاده) برمی‌گرداند. اگر نشانگر در همان صفحه نمایش ابزارک نباشد، ``-1`` را " +"برمی‌گرداند." -msgid "Return the pointer's coordinates as an ``(x, y)`` tuple, in pixels, relative to the screen's root window (or virtual root, if one is in use). Both coordinates are ``-1`` if the pointer is not on the same screen as the widget." +msgid "" +"Return the pointer's coordinates as an ``(x, y)`` tuple, in pixels, relative to the " +"screen's root window (or virtual root, if one is in use). Both coordinates are " +"``-1`` if the pointer is not on the same screen as the widget." msgstr "" +"مختصات اشاره‌گر را به‌صورت یک تاپل ``(x, y)``، بر حسب پیکسل و نسبت به پنجره‌ی ریشه‌ی " +"صفحه‌نمایش (یا ریشه‌ی مجازی، در صورت استفاده) برمی‌گرداند. اگر اشاره‌گر روی همان " +"صفحه‌نمایش ابزارک نباشد، هر دو مختصات ``-1`` خواهند بود." -msgid "Return the pointer's *y* coordinate, in pixels, relative to the screen's root window (or virtual root, if one is in use). Return ``-1`` if the pointer is not on the same screen as the widget." +msgid "" +"Return the pointer's *y* coordinate, in pixels, relative to the screen's root window " +"(or virtual root, if one is in use). Return ``-1`` if the pointer is not on the same " +"screen as the widget." msgstr "" +"مختصات *y* اشاره‌گر را بر حسب پیکسل، نسبت به پنجره‌ی ریشه‌ی صفحه‌نمایش (یا ریشه‌ی مجازی، در " +"صورت استفاده) برمی‌گرداند. اگر اشاره‌گر در همان صفحه‌نمایشی که ابزارک قرار دارد نباشد، " +"``-1`` برمی‌گرداند." -msgid "Return the widget's requested height in pixels. This is the value used by the widget's geometry manager to compute its geometry." +msgid "" +"Return the widget's requested height in pixels. This is the value used by the " +"widget's geometry manager to compute its geometry." msgstr "" +"ارتفاع درخواستی ابزارک را بر حسب پیکسل برمی‌گرداند. این همان مقداری است که توسط مدیر " +"هندسه‌ی ابزارک برای محاسبه‌ی هندسه‌ی آن استفاده می‌شود." -msgid "Return the widget's requested width in pixels. This is the value used by the widget's geometry manager to compute its geometry." +msgid "" +"Return the widget's requested width in pixels. This is the value used by the " +"widget's geometry manager to compute its geometry." msgstr "" +"عرض درخواستی ابزارک را بر حسب پیکسل برمی‌گرداند. این مقداری است که مدیر هندسی ابزارک " +"برای محاسبه هندسه آن استفاده می‌کند." -msgid "Return an ``(r, g, b)`` tuple of the red, green, and blue intensities, in the range 0 to 65535, that correspond to *color* in the widget. *color* may be specified in any of the forms acceptable for a color option." +msgid "" +"Return an ``(r, g, b)`` tuple of the red, green, and blue intensities, in the range " +"0 to 65535, that correspond to *color* in the widget. *color* may be specified in " +"any of the forms acceptable for a color option." msgstr "" +"یک تاپل ``(r, g, b)`` از شدت‌های قرمز، سبز و آبی، در بازه‌ی ۰ تا ۶۵۵۳۵، برمی‌گرداند که " +"در ابزارک با *color* مطابقت دارند. *color* را می‌توان در هر یک از قالب‌های قابل‌قبول " +"برای یک گزینه‌ی رنگ مشخص کرد." -msgid "Return the *x* coordinate, in the root window of the screen, of the upper-left corner of the widget's border (or of the widget itself if it has no border)." +msgid "" +"Return the *x* coordinate, in the root window of the screen, of the upper-left " +"corner of the widget's border (or of the widget itself if it has no border)." msgstr "" +"مختصات *x* گوشه‌ی بالا سمت چپ حاشیه‌ی ابزارک (یا خود ابزارک اگر حاشیه ندارد) را در پنجره‌ی " +"ریشه‌ی صفحه برمی‌گرداند." -msgid "Return the *y* coordinate, in the root window of the screen, of the upper-left corner of the widget's border (or of the widget itself if it has no border)." +msgid "" +"Return the *y* coordinate, in the root window of the screen, of the upper-left " +"corner of the widget's border (or of the widget itself if it has no border)." msgstr "" +"مختصات *y* گوشه‌ی بالا سمت چپ حاشیه‌ی ابزارک (یا خود ابزارک اگر حاشیه ندارد) را در پنجره‌ی " +"ریشه‌ی صفحه برمی‌گرداند." -msgid "Return the name of the screen associated with the widget, in the form ``displayName.screenIndex``." -msgstr "" +msgid "" +"Return the name of the screen associated with the widget, in the form " +"``displayName.screenIndex``." +msgstr "نام صفحه‌ی مرتبط با ابزارک را در قالب ``displayName.screenIndex`` برمی‌گرداند." msgid "Return the number of cells in the default colormap for the widget's screen." -msgstr "" +msgstr "تعداد سلول‌ها در نقشه‌ی رنگ پیش‌فرض برای صفحه‌ی ابزارک را برمی‌گرداند." -msgid "Return the depth of the root window of the widget's screen, that is, the number of bits per pixel." +msgid "" +"Return the depth of the root window of the widget's screen, that is, the number of " +"bits per pixel." msgstr "" +"عمق پنجره‌ی ریشه‌ی صفحه‌ی ابزارک (widget) را برمی‌گرداند، یعنی تعداد بیت‌ها به ازای هر " +"پیکسل." msgid "Return the height of the widget's screen in pixels." -msgstr "" +msgstr "ارتفاع صفحه‌ی ابزارک را بر حسب پیکسل برمی‌گرداند." msgid "Return the height of the widget's screen in millimeters." -msgstr "" +msgstr "ارتفاع صفحه‌ی نمایش ابزارک (widget) را بر حسب میلی‌متر برمی‌گرداند." msgid "Return the width of the widget's screen in millimeters." -msgstr "" +msgstr "عرض صفحه‌ی نمایش ابزارک را بر حسب میلی‌متر برمی‌گرداند." -msgid "Return the default visual class for the widget's screen, one of ``\"directcolor\"``, ``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, ``\"staticgray\"``, or ``\"truecolor\"``." +msgid "" +"Return the default visual class for the widget's screen, one of ``\"directcolor\"``, " +"``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, ``\"staticgray\"``, or " +"``\"truecolor\"``." msgstr "" +"کلاس بصری پیش‌فرض صفحه‌ی ابزارک را برمی‌گرداند؛ یکی از ``\"directcolor\"``، " +"``\"grayscale\"``، ``\"pseudocolor\"``، ``\"staticcolor\"``، ``\"staticgray\"`` یا " +"``\"truecolor\"`` است." msgid "Return the width of the widget's screen in pixels." -msgstr "" +msgstr "عرض صفحه‌ی نمایش ابزارک (widget) را بر حسب پیکسل برمی‌گرداند." -msgid "Return a string containing information about the server for the widget's display. The exact format of this string may vary from platform to platform." +msgid "" +"Return a string containing information about the server for the widget's display. " +"The exact format of this string may vary from platform to platform." msgstr "" +"رشته‌ای حاوی اطلاعات درباره‌ی سرورِ نمایش ابزارک برمی‌گرداند. قالب دقیق این رشته ممکن است " +"از یک سکو به سکوی دیگر متفاوت باشد." -msgid "Return the top-of-hierarchy window containing the widget. In standard Tk this is always a :class:`Toplevel` widget." +msgid "" +"Return the top-of-hierarchy window containing the widget. In standard Tk this is " +"always a :class:`Toplevel` widget." msgstr "" +"پنجره‌ی بالای سلسله‌مراتبِ حاوی ابزارک را برمی‌گرداند. در Tk استاندارد، این همیشه یک " +"ابزارک :class:`Toplevel` است." -msgid "Return true if the widget and all of its ancestors up through the nearest toplevel window are mapped, false otherwise." +msgid "" +"Return true if the widget and all of its ancestors up through the nearest toplevel " +"window are mapped, false otherwise." msgstr "" +"اگر ابزارک و تمام نیاکان آن تا نزدیک‌ترین پنجره‌ی سطح بالا نگاشت‌شده باشند، true و در غیر " +"این صورت false را برمی‌گرداند." -msgid "Return the visual class for the widget, one of ``\"directcolor\"``, ``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, ``\"staticgray\"``, or ``\"truecolor\"``." +msgid "" +"Return the visual class for the widget, one of ``\"directcolor\"``, " +"``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, ``\"staticgray\"``, or " +"``\"truecolor\"``." msgstr "" +"کلاس بصری ابزارک را برمی‌گرداند؛ یکی از ``\"directcolor\"``، ``\"grayscale\"``، " +"``\"pseudocolor\"``، ``\"staticcolor\"``، ``\"staticgray\"`` یا ``\"truecolor\"``." msgid "Return the X identifier for the visual for the widget." -msgstr "" +msgstr "شناسه‌ی X برای بصری (visual) مربوط به ابزارک (widget) را برمی‌گرداند." -msgid "Return a list describing the visuals available for the widget's screen. Each item consists of a visual class (see :meth:`winfo_visual`) followed by an integer depth. If *includeids* is true, the X identifier for the visual is also included." +msgid "" +"Return a list describing the visuals available for the widget's screen. Each item " +"consists of a visual class (see :meth:`winfo_visual`) followed by an integer depth. " +"If *includeids* is true, the X identifier for the visual is also included." msgstr "" +"فهرستی برمی‌گرداند که visualهای در دسترس برای صفحه‌ی ابزارک را توصیف می‌کند. هر آیتم شامل " +"یک کلاس visual (به :meth:`winfo_visual` مراجعه کنید) و به دنبال آن، عمقی از نوع عدد " +"صحیح است. اگر *includeids* درست باشد، شناسه‌ی X مربوط به visual نیز گنجانده می‌شود." -msgid "Return the height of the virtual root window associated with the widget if there is one; otherwise return the height of the widget's screen." +msgid "" +"Return the height of the virtual root window associated with the widget if there is " +"one; otherwise return the height of the widget's screen." msgstr "" +"اگر پنجره ریشه مجازی مرتبط با ابزارک وجود داشته باشد، ارتفاع آن را برمی‌گرداند؛ در غیر " +"این صورت ارتفاع صفحه ابزارک را برمی‌گرداند." -msgid "Return the width of the virtual root window associated with the widget if there is one; otherwise return the width of the widget's screen." +msgid "" +"Return the width of the virtual root window associated with the widget if there is " +"one; otherwise return the width of the widget's screen." msgstr "" +"عرض پنجره‌ی ریشه‌ی مجازی مرتبط با ابزارک را در صورت وجود برمی‌گرداند؛ در غیر این صورت، " +"عرض صفحه‌ی نمایش ابزارک را برمی‌گرداند." -msgid "Return the *x* offset of the virtual root window associated with the widget, relative to the root window of its screen. This is normally zero or negative, and is ``0`` if there is no virtual root window." +msgid "" +"Return the *x* offset of the virtual root window associated with the widget, " +"relative to the root window of its screen. This is normally zero or negative, and is " +"``0`` if there is no virtual root window." msgstr "" +"آفست *x* پنجره ریشه مجازی مرتبط با ابزارک را نسبت به پنجره ریشه صفحه آن برمی‌گرداند. " +"این مقدار معمولاً صفر یا منفی است، و اگر پنجره ریشه مجازی وجود نداشته باشد، ``0`` است." -msgid "Return the *y* offset of the virtual root window associated with the widget, relative to the root window of its screen. This is normally zero or negative, and is ``0`` if there is no virtual root window." +msgid "" +"Return the *y* offset of the virtual root window associated with the widget, " +"relative to the root window of its screen. This is normally zero or negative, and is " +"``0`` if there is no virtual root window." msgstr "" +"آفست *y* پنجره ریشه مجازی مرتبط با ابزارک را نسبت به پنجره ریشه صفحه‌نمایش آن " +"برمی‌گرداند. این مقدار معمولاً صفر یا منفی است، و اگر پنجره ریشه مجازی وجود نداشته " +"باشد، ``0`` است." -msgid "Return the width of the widget in pixels. When a window is first created its width is 1 pixel; it is eventually changed by a geometry manager. See also :meth:`winfo_reqwidth`." +msgid "" +"Return the width of the widget in pixels. When a window is first created its width " +"is 1 pixel; it is eventually changed by a geometry manager. See " +"also :meth:`winfo_reqwidth`." msgstr "" +"عرض ابزارک را بر حسب پیکسل برمی‌گرداند. هنگامی که یک پنجره برای نخستین بار ایجاد می‌شود، " +"عرض آن ۱ پیکسل است؛ این عرض در نهایت توسط مدیر چیدمان تغییر می‌کند. همچنین " +"ببینید :meth:`winfo_reqwidth`." -msgid "Return the *x* coordinate, in the widget's parent, of the upper-left corner of the widget's border (or of the widget itself if it has no border)." +msgid "" +"Return the *x* coordinate, in the widget's parent, of the upper-left corner of the " +"widget's border (or of the widget itself if it has no border)." msgstr "" +"مختصات *x* گوشه‌ی بالا-چپ حاشیه‌ی ابزارک (یا خود ابزارک، اگر حاشیه‌ای نداشته باشد) را در " +"والد ابزارک برمی‌گرداند." -msgid "Return the *y* coordinate, in the widget's parent, of the upper-left corner of the widget's border (or of the widget itself if it has no border)." +msgid "" +"Return the *y* coordinate, in the widget's parent, of the upper-left corner of the " +"widget's border (or of the widget itself if it has no border)." msgstr "" +"مختصات *y* گوشه‌ی بالا سمت چپ حاشیه‌ی ابزارک (widget) را در والد ابزارک برمی‌گرداند (یا " +"خود ابزارک اگر حاشیه ندارد)." -msgid "Return the Tcl/Tk patch level as a named tuple with the same five fields as :data:`sys.version_info`: *major*, *minor*, *micro*, *releaselevel* and *serial*. *releaselevel* is ``'alpha'``, ``'beta'`` or ``'final'``. Converting it to a string gives the version in the usual Tcl/Tk notation, for example ``'9.0.3'`` for a final release or ``'9.1b2'`` for a pre-release." -msgstr "" +msgid "" +"Return the Tcl/Tk patch level as a named tuple with the same five fields " +"as :data:`sys.version_info`: *major*, *minor*, *micro*, *releaselevel* and *serial*. " +"*releaselevel* is ``'alpha'``, ``'beta'`` or ``'final'``. Converting it to a string " +"gives the version in the usual Tcl/Tk notation, for example ``'9.0.3'`` for a final " +"release or ``'9.1b2'`` for a pre-release." +msgstr "" +"سطح وصله‌ی Tcl/Tk را به‌صورت یک تاپل نام‌دار (named tuple) با همان پنج " +"فیلدِ :data:`sys.version_info` برمی‌گرداند: *major*، *minor*، *micro*، *releaselevel* " +"و *serial*. *releaselevel* یکی از ``'alpha'``، ``'beta'`` یا ``'final'`` است. تبدیل " +"آن به یک رشته، نسخه را در نمادگذاری معمول Tcl/Tk می‌دهد؛ برای مثال ``'9.0.3'`` برای " +"یک انتشار نهایی یا ``'9.1b2'`` برای یک پیش‌انتشار." -msgid "The :class:`!Wm` mixin provides access to the window manager, allowing an application to control such things as the title, geometry and icon of a top-level window, the way it is resized, and how it responds to window manager protocols. It is mixed into :class:`Tk` and :class:`Toplevel`, so its methods are available on every top-level window. Each method has two equivalent spellings: a short name and a ``wm_``-prefixed name (for example, :meth:`title` and :meth:`wm_title`). See also :ref:`tkinter-window-manager`." -msgstr "" +msgid "" +"The :class:`!Wm` mixin provides access to the window manager, allowing an " +"application to control such things as the title, geometry and icon of a top-level " +"window, the way it is resized, and how it responds to window manager protocols. It " +"is mixed into :class:`Tk` and :class:`Toplevel`, so its methods are available on " +"every top-level window. Each method has two equivalent spellings: a short name and a " +"``wm_``-prefixed name (for example, :meth:`title` and :meth:`wm_title`). See " +"also :ref:`tkinter-window-manager`." +msgstr "" +"میکسین :class:`!Wm` دسترسی به مدیر پنجره را فراهم می‌کند و به برنامه اجازه می‌دهد " +"مواردی مانند عنوان، هندسه و نماد یک پنجره‌ی سطح بالا، نحوه‌ی تغییر اندازه‌ی آن و چگونگی " +"پاسخ آن به پروتکل‌های مدیر پنجره را کنترل کند. این میکسین در :class:`Tk` " +"و :class:`Toplevel` ادغام شده است، بنابراین متدهای آن در هر پنجره‌ی سطح بالا در دسترس " +"هستند. هر متد دو نوشتار معادل دارد: یک نام کوتاه و یک نام با پیشوند ``wm_`` (برای " +"مثال، :meth:`title` و :meth:`wm_title`). همچنین ببینید :ref:`tkinter-window-manager`." -msgid "Constrain the aspect ratio (the ratio of width to height) of the window. If all four arguments are given, the window manager keeps the ratio between ``minNumer/minDenom`` and ``maxNumer/maxDenom``; passing empty strings removes any existing restriction. With no arguments, return a tuple of the four current values, or ``None`` if no aspect restriction is in effect. :meth:`wm_aspect` is an alias of :meth:`!aspect`." -msgstr "" +msgid "" +"Constrain the aspect ratio (the ratio of width to height) of the window. If all four " +"arguments are given, the window manager keeps the ratio between ``minNumer/" +"minDenom`` and ``maxNumer/maxDenom``; passing empty strings removes any existing " +"restriction. With no arguments, return a tuple of the four current values, or " +"``None`` if no aspect restriction is in effect. :meth:`wm_aspect` is an alias " +"of :meth:`!aspect`." +msgstr "" +"نسبت ابعاد (نسبت عرض به ارتفاع) پنجره را محدود می‌کند. اگر هر چهار آرگومان داده شوند، " +"مدیر پنجره این نسبت را بین ``minNumer/minDenom`` و ``maxNumer/maxDenom`` حفظ می‌کند؛ " +"دادن رشته‌های خالی هرگونه محدودیت موجود را حذف می‌کند. بدون آرگومان، یک تاپل " +"از چهار مقدار فعلی، یا اگر هیچ محدودیت نسبت ابعادی فعال نباشد، ``None`` " +"برمی‌گرداند. :meth:`wm_aspect` نام مستعاری از :meth:`!aspect` است." -msgid "Query or set platform-specific attributes of the window. With no arguments, return the platform-specific flags and their values; pass *return_python_dict* as true to get them as a dictionary. A single option name such as ``'alpha'`` returns the value of that option, and options are set using keyword arguments (``alpha=0.5``)." +msgid "" +"Query or set platform-specific attributes of the window. With no arguments, return " +"the platform-specific flags and their values; pass *return_python_dict* as true to " +"get them as a dictionary. A single option name such as ``'alpha'`` returns the value " +"of that option, and options are set using keyword arguments (``alpha=0.5``)." msgstr "" +"ویژگی‌های مختص پلتفرم پنجره را پرس‌وجو یا تنظیم کنید. بدون آرگومان، پرچم‌های مختص " +"پلتفرم و مقادیر آن‌ها برمی‌گردانده می‌شوند؛ برای دریافت آن‌ها به‌صورت یک دیکشنری، " +"*return_python_dict* را با مقدار true ارسال کنید. یک نام گزینه تکی مانند ``'alpha'`` " +"مقدار آن گزینه را برمی‌گرداند و گزینه‌ها با استفاده از آرگومان‌های کلیدواژه‌ای تنظیم " +"می‌شوند (``alpha=0.5``)." msgid "The available attributes differ by platform. All platforms support:" msgstr "" +"ویژگی‌های در دسترس بسته به پلتفرم متفاوت است. تمام پلتفرم‌ها از موارد زیر پشتیبانی " +"می‌کنند:" msgid "*alpha*" -msgstr "" +msgstr "*آلفا*" -msgid "The window's opacity, from ``0.0`` (fully transparent) to ``1.0`` (opaque). Where transparency is unsupported the value stays at ``1.0``." +msgid "" +"The window's opacity, from ``0.0`` (fully transparent) to ``1.0`` (opaque). Where " +"transparency is unsupported the value stays at ``1.0``." msgstr "" +"کدری پنجره، از ``0.0`` (کاملاً شفاف) تا ``1.0`` (کدر). هر جا شفافیت پشتیبانی نشود، " +"مقدار روی ``1.0`` باقی می‌ماند." msgid "*appearance*" -msgstr "" +msgstr "*ظاهر*" -msgid "Whether the window is rendered in dark mode on Windows and macOS: ``'auto'``, ``'light'`` or ``'dark'`` (this has no effect on X11)." +msgid "" +"Whether the window is rendered in dark mode on Windows and macOS: ``'auto'``, " +"``'light'`` or ``'dark'`` (this has no effect on X11)." msgstr "" +"اینکه پنجره در ویندوز و مک‌اواس در حالت تاریک رندر می‌شود: ``'auto'``، ``'light'`` یا " +"``'dark'`` (این مورد در X11 تأثیری ندارد)." msgid "*fullscreen*" -msgstr "" +msgstr "*تمام‌صفحه*" msgid "Whether the window takes up the entire screen and has no borders." -msgstr "" +msgstr "اینکه پنجره تمام صفحه را اشغال می‌کند و حاشیه ندارد." msgid "*topmost*" -msgstr "" +msgstr "*بالاترین*" msgid "Whether the window is displayed above all other windows." -msgstr "" +msgstr "اینکه پنجره بالای همه‌ی پنجره‌های دیگر نمایش داده می‌شود." msgid "Windows additionally supports:" -msgstr "" +msgstr "ویندوز علاوه بر این پشتیبانی می‌کند:" msgid "*disabled*" -msgstr "" +msgstr "*غیرفعال*" msgid "Whether the window is in a disabled state." -msgstr "" +msgstr "اینکه پنجره در وضعیت غیرفعال قرار دارد." msgid "*toolwindow*" -msgstr "" +msgstr "*toolwindow*" msgid "Whether the window uses the tool window style." -msgstr "" +msgstr "اینکه پنجره از سبک پنجره ابزار استفاده می‌کند." msgid "*transparentcolor*" -msgstr "" +msgstr "*transparentcolor*" msgid "The color that is made fully transparent, or an empty string for none." -msgstr "" +msgstr "رنگی که کاملاً شفاف می‌شود، یا یک رشته‌ی خالی برای هیچ‌کدام." msgid "macOS additionally supports:" -msgstr "" +msgstr "macOS همچنین پشتیبانی می‌کند:" msgid "*class*" -msgstr "" +msgstr "*کلاس*" -msgid "Whether the underlying Aqua window is an ``nswindow`` or an ``nspanel``; this can only be set before the window is created." +msgid "" +"Whether the underlying Aqua window is an ``nswindow`` or an ``nspanel``; this can " +"only be set before the window is created." msgstr "" +"اینکه پنجره‌ی زیربنایی Aqua یک ``nswindow`` است یا یک ``nspanel``؛ این مورد فقط پیش از " +"ایجاد پنجره قابل تنظیم است." msgid "*modified*" -msgstr "" +msgstr "*تغییریافته*" msgid "The modification state shown by the window's close button and proxy icon." msgstr "" +"وضعیت تغییری که توسط دکمه‌ی بستن پنجره و نماد پراکسی (proxy icon) نمایش داده می‌شود." msgid "*notify*" -msgstr "" +msgstr "*اطلاع‌رسانی*" msgid "Whether the application's dock icon bounces to request attention." -msgstr "" +msgstr "اینکه آیا آیکون داک برنامه برای جلب توجه جهش می‌کند." msgid "*stylemask*" -msgstr "" +msgstr "*stylemask*" -msgid "The style mask of the underlying Aqua window, given as a list of bit names such as ``titled`` or ``resizable``." +msgid "" +"The style mask of the underlying Aqua window, given as a list of bit names such as " +"``titled`` or ``resizable``." msgstr "" +"ماسک سبک (style mask) پنجره‌ی زیربنایی Aqua، که به‌صورت فهرستی از نام‌های بیت مانند " +"``titled`` یا ``resizable`` ارائه می‌شود." msgid "*tabbingid*" -msgstr "" +msgstr "*tabbingid*" msgid "The identifier of the tab group that the window belongs to." -msgstr "" +msgstr "شناسه‌ی گروه زبانه‌ای که پنجره به آن تعلق دارد." msgid "*tabbingmode*" -msgstr "" +msgstr "*tabbingmode*" -msgid "Whether the window may be opened as a tab: ``'auto'``, ``'preferred'`` or ``'disallowed'``." +msgid "" +"Whether the window may be opened as a tab: ``'auto'``, ``'preferred'`` or " +"``'disallowed'``." msgstr "" +"اینکه آیا پنجره می‌تواند به‌عنوان زبانه باز شود: ``'auto'``، ``'preferred'`` یا " +"``'disallowed'``." msgid "*titlepath*" -msgstr "" +msgstr "*titlepath*" msgid "The path of the file represented by the window's proxy icon." -msgstr "" +msgstr "مسیر فایلی که نماد پراکسی (proxy icon) پنجره آن را نشان می‌دهد." msgid "*transparent*" -msgstr "" +msgstr "*شفاف*" msgid "Whether the content area is transparent and the window shadow is turned off." -msgstr "" +msgstr "اینکه ناحیه‌ی محتوا شفاف باشد و سایه‌ی پنجره خاموش باشد." msgid "X11 additionally supports:" -msgstr "" +msgstr "X11 علاوه بر این پشتیبانی می‌کند:" msgid "*type*" -msgstr "" +msgstr "*نوع*" -msgid "The window type, or a list of types in order of preference, that the window manager should use to interpret the window, such as ``'dialog'`` or ``'splash'``." +msgid "" +"The window type, or a list of types in order of preference, that the window manager " +"should use to interpret the window, such as ``'dialog'`` or ``'splash'``." msgstr "" +"نوع پنجره، یا فهرستی از انواع به‌ترتیب اولویت، که مدیر پنجره باید برای تفسیر پنجره از " +"آن‌ها استفاده کند، مانند ``'dialog'`` یا ``'splash'``." msgid "*zoomed*" -msgstr "" +msgstr "*بزرگ‌نمایی‌شده*" msgid "Whether the window is maximized." -msgstr "" +msgstr "اینکه آیا پنجره بیشینه‌شده است." -msgid "Tk 8.6 added the *type* attribute, and Tk 9.0 added the *appearance*, *class*, *stylemask*, *tabbingid* and *tabbingmode* attributes." +msgid "" +"Tk 8.6 added the *type* attribute, and Tk 9.0 added the *appearance*, *class*, " +"*stylemask*, *tabbingid* and *tabbingmode* attributes." msgstr "" +"Tk 8.6 ویژگی *type* را افزود و Tk 9.0 ویژگی‌های *appearance*، *class*، *stylemask*، " +"*tabbingid* و *tabbingmode* را افزود." -msgid "On X11 changes are applied asynchronously, so a queried value may not yet reflect the most recent request. :meth:`wm_attributes` is an alias of :meth:`!attributes`." +msgid "" +"On X11 changes are applied asynchronously, so a queried value may not yet reflect " +"the most recent request. :meth:`wm_attributes` is an alias of :meth:`!attributes`." msgstr "" +"در X11، تغییرات به‌صورت ناهمگام اعمال می‌شوند، بنابراین مقدار پرس‌وجوشده ممکن است هنوز " +"بازتاب‌دهنده آخرین درخواست نباشد. :meth:`wm_attributes` نام مستعار :meth:`!" +"attributes` است." -msgid "A single attribute may now be queried by name without the leading ``-``, and attributes may be set using keyword arguments. The *return_python_dict* parameter was added." +msgid "" +"A single attribute may now be queried by name without the leading ``-``, and " +"attributes may be set using keyword arguments. The *return_python_dict* parameter " +"was added." msgstr "" +"اکنون می‌توان یک ویژگی را با نام، بدون ``-`` آغازین، پرس‌وجو کرد و ویژگی‌ها را می‌توان " +"با آرگومان‌های کلیدواژه‌ای تنظیم کرد. پارامتر *return_python_dict* افزوده شد." -msgid "Setting an attribute by passing the option name (with a leading ``-``) and its value as two positional arguments, as in ``w.attributes('-alpha', 0.5)``, is deprecated; use keyword arguments instead." +msgid "" +"Setting an attribute by passing the option name (with a leading ``-``) and its value " +"as two positional arguments, as in ``w.attributes('-alpha', 0.5)``, is deprecated; " +"use keyword arguments instead." msgstr "" +"تنظیم یک ویژگی با ارسال نام گزینه (با یک ``-`` در ابتدا) و مقدار آن به‌عنوان دو " +"آرگومان جایگاهی، مانند ``w.attributes('-alpha', 0.5)``، منسوخ شده است؛ در عوض از " +"آرگومان‌های کلیدواژه‌ای استفاده کنید." -msgid "Store *name*, which should be the name of the host on which the application is running, in the window's ``WM_CLIENT_MACHINE`` property for use by the window or session manager. An empty string deletes the property. With no argument, return the last name set, or an empty string. :meth:`wm_client` is an alias of :meth:`!client`." +msgid "" +"Store *name*, which should be the name of the host on which the application is " +"running, in the window's ``WM_CLIENT_MACHINE`` property for use by the window or " +"session manager. An empty string deletes the property. With no argument, return the " +"last name set, or an empty string. :meth:`wm_client` is an alias of :meth:`!client`." msgstr "" +"*name* را که باید نام میزبانی باشد که برنامه روی آن اجرا می‌شود، در ویژگی " +"``WM_CLIENT_MACHINE`` پنجره ذخیره می‌کند تا مدیر پنجره یا نشست از آن استفاده کند. یک " +"رشته خالی ویژگی را حذف می‌کند. بدون آرگومان، آخرین نام تنظیم‌شده را برمی‌گرداند، یا یک " +"رشته خالی. :meth:`wm_client` نام مستعار :meth:`!client` است." -msgid "Manipulate the ``WM_COLORMAP_WINDOWS`` property, which tells the window manager about windows that have private colormaps. If *wlist* is given, overwrite the property with those windows (their order is a priority order for installing colormaps). With no arguments, return the list of windows currently named in the property. :meth:`wm_colormapwindows` is an alias of :meth:`!colormapwindows`." -msgstr "" +msgid "" +"Manipulate the ``WM_COLORMAP_WINDOWS`` property, which tells the window manager " +"about windows that have private colormaps. If *wlist* is given, overwrite the " +"property with those windows (their order is a priority order for installing " +"colormaps). With no arguments, return the list of windows currently named in the " +"property. :meth:`wm_colormapwindows` is an alias of :meth:`!colormapwindows`." +msgstr "" +"ویژگی ``WM_COLORMAP_WINDOWS`` را دستکاری می‌کند، که به مدیر پنجره درباره پنجره‌هایی که " +"نقشه‌رنگ‌های خصوصی دارند اطلاع می‌دهد. اگر *wlist* داده شود، ویژگی را با آن پنجره‌ها " +"بازنویسی می‌کند (ترتیب آن‌ها یک ترتیب اولویت برای نصب نقشه‌رنگ‌ها است). بدون آرگومان، " +"فهرست پنجره‌هایی که در حال حاضر در این ویژگی آمده‌اند را " +"برمی‌گرداند. :meth:`wm_colormapwindows` نام مستعار :meth:`!colormapwindows` است." -msgid "Store *value* in the window's ``WM_COMMAND`` property for use by the window or session manager; it should be a list giving the words of the command used to invoke the application. An empty string deletes the property. With no argument, return the last value set, or an empty string. :meth:`wm_command` is an alias of :meth:`!command`." -msgstr "" +msgid "" +"Store *value* in the window's ``WM_COMMAND`` property for use by the window or " +"session manager; it should be a list giving the words of the command used to invoke " +"the application. An empty string deletes the property. With no argument, return the " +"last value set, or an empty string. :meth:`wm_command` is an alias of :meth:`!" +"command`." +msgstr "" +"مقدار *value* را در ویژگی ``WM_COMMAND`` پنجره ذخیره می‌کند تا توسط مدیر پنجره یا " +"مدیر نشست استفاده شود؛ این مقدار باید فهرستی باشد که کلمات فرمان استفاده‌شده برای " +"فراخوانی برنامه را ارائه می‌دهد. یک رشته خالی ویژگی را حذف می‌کند. بدون آرگومان، آخرین " +"مقدار تنظیم‌شده یا یک رشته خالی را برمی‌گرداند. :meth:`wm_command` نام مستعار :meth:`!" +"command` است." -msgid "Display the window in normal (non-iconified) form by mapping it. If the window has never been mapped, this ensures it appears de-iconified when it is first mapped. On Windows the window is also raised and given the focus. :meth:`wm_deiconify` is an alias of :meth:`!deiconify`." +msgid "" +"Display the window in normal (non-iconified) form by mapping it. If the window has " +"never been mapped, this ensures it appears de-iconified when it is first mapped. On " +"Windows the window is also raised and given the focus. :meth:`wm_deiconify` is an " +"alias of :meth:`!deiconify`." msgstr "" +"پنجره را با نگاشت (mapping) آن در حالت عادی (غیرآیکنی) نمایش می‌دهد. اگر پنجره هرگز " +"نگاشت نشده باشد، این کار تضمین می‌کند که هنگام نخستین نگاشت، به‌صورت غیرآیکنی ظاهر " +"شود. در ویندوز، پنجره همچنین بالا آورده می‌شود و فوکوس (focus) را دریافت " +"می‌کند. :meth:`wm_deiconify` نام مستعاری از :meth:`!deiconify` است." -msgid "Set or query the focus model for the window. *model* is either ``'active'`` (the window claims the input focus for itself or its descendants, even when the focus is in another application) or ``'passive'`` (the window relies on the window manager to give it the focus). With no argument, return the current model. The default is ``'passive'``, which is what the :meth:`!focus` command assumes. :meth:`wm_focusmodel` is an alias of :meth:`!focusmodel`." -msgstr "" +msgid "" +"Set or query the focus model for the window. *model* is either ``'active'`` (the " +"window claims the input focus for itself or its descendants, even when the focus is " +"in another application) or ``'passive'`` (the window relies on the window manager to " +"give it the focus). With no argument, return the current model. The default is " +"``'passive'``, which is what the :meth:`!focus` command " +"assumes. :meth:`wm_focusmodel` is an alias of :meth:`!focusmodel`." +msgstr "" +"مدل فوکوس پنجره را تنظیم یا پرس‌وجو می‌کند. *model* یا ``'active'`` است (پنجره فوکوس " +"ورودی را برای خود یا زیرمجموعه‌هایش مطالبه می‌کند، حتی زمانی که فوکوس در برنامه‌ای دیگر " +"است) یا ``'passive'`` است (پنجره به مدیر پنجره اتکا می‌کند تا فوکوس را به آن بدهد). " +"بدون آرگومان، مدل جاری را برمی‌گرداند. مقدار پیش‌فرض ``'passive'`` است، که " +"دستور :meth:`!focus` آن را فرض می‌کند. :meth:`wm_focusmodel` نام مستعار :meth:`!" +"focusmodel` است." -msgid "Unmap *window* from the screen so that it is no longer managed by the window manager. A :class:`Toplevel` is then treated like a :class:`Frame`, although its ``-menu`` configuration is remembered and the menu reappears if the widget is managed again. :meth:`wm_forget` is an alias of :meth:`!forget`." +msgid "" +"Unmap *window* from the screen so that it is no longer managed by the window " +"manager. A :class:`Toplevel` is then treated like a :class:`Frame`, although its ``-" +"menu`` configuration is remembered and the menu reappears if the widget is managed " +"again. :meth:`wm_forget` is an alias of :meth:`!forget`." msgstr "" +"*window* را از صفحه‌ی نمایش خارج کنید (unmap) تا دیگر توسط مدیر پنجره مدیریت نشود. در " +"این صورت با یک :class:`Toplevel` مانند یک :class:`Frame` رفتار می‌شود، اگرچه پیکربندی " +"``-menu`` آن به خاطر سپرده می‌شود و اگر ابزارک دوباره مدیریت شود، منو دوباره ظاهر " +"می‌شود. :meth:`wm_forget` یک نام مستعار از :meth:`!forget` است." msgid "Not to be confused with :meth:`Pack.forget`." -msgstr "" +msgstr "با :meth:`Pack.forget` اشتباه گرفته نشود." -msgid "Return the platform-specific window identifier for the outermost decorative frame containing the window, if the window manager has reparented it into such a frame; otherwise return the identifier of the window itself. :meth:`wm_frame` is an alias of :meth:`!frame`." +msgid "" +"Return the platform-specific window identifier for the outermost decorative frame " +"containing the window, if the window manager has reparented it into such a frame; " +"otherwise return the identifier of the window itself. :meth:`wm_frame` is an alias " +"of :meth:`!frame`." msgstr "" +"اگر مدیر پنجره آن را در چنین فریمی تغییر والد داده باشد، شناسه‌ی پنجره‌ی خاصِ سکو برای " +"بیرونی‌ترین فریم تزئینی حاوی پنجره را برمی‌گرداند؛ در غیر این صورت شناسه‌ی خود پنجره را " +"برمی‌گرداند. :meth:`wm_frame` نام مستعار :meth:`!frame` است." -msgid "Set or query the geometry of the window. *newGeometry* has the form ``=widthxheight+x+y``, where any of ``=``, ``widthxheight`` and the ``+x+y`` position may be omitted. *width* and *height* are in pixels (or grid units for a gridded window); a position preceded by ``+`` is measured from the left or top edge of the screen and one preceded by ``-`` from the right or bottom edge. An offset can be negative, as in ``'200x100+-9+-8'``, when the window edge is positioned beyond the corresponding screen edge. An empty string cancels any user-specified geometry, letting the window revert to its natural size. With no argument, return the current geometry as a string of the form ``'200x200+10+10'``. :meth:`wm_geometry` is an alias of :meth:`!geometry`." -msgstr "" +msgid "" +"Set or query the geometry of the window. *newGeometry* has the form " +"``=widthxheight+x+y``, where any of ``=``, ``widthxheight`` and the ``+x+y`` " +"position may be omitted. *width* and *height* are in pixels (or grid units for a " +"gridded window); a position preceded by ``+`` is measured from the left or top edge " +"of the screen and one preceded by ``-`` from the right or bottom edge. An offset can " +"be negative, as in ``'200x100+-9+-8'``, when the window edge is positioned beyond " +"the corresponding screen edge. An empty string cancels any user-specified geometry, " +"letting the window revert to its natural size. With no argument, return the current " +"geometry as a string of the form ``'200x200+10+10'``. :meth:`wm_geometry` is an " +"alias of :meth:`!geometry`." +msgstr "" +"هندسه پنجره را تنظیم یا پرس‌وجو می‌کند. *newGeometry* به شکل ``=widthxheight+x+y`` " +"است، که در آن می‌توان هر یک از ``=``، ``widthxheight`` و موقعیت ``+x+y`` را حذف کرد. " +"*width* و *height* بر حسب پیکسل هستند (یا واحدهای شبکه برای یک پنجره شبکه‌بندی‌شده)؛ " +"موقعیت با پیشوند ``+`` از لبه چپ یا بالای صفحه‌نمایش اندازه‌گیری می‌شود و موقعیت با " +"پیشوند ``-`` از لبه راست یا پایین صفحه‌نمایش اندازه‌گیری می‌شود. جابجایی می‌تواند منفی " +"باشد، مانند ``'200x100+-9+-8'``، هنگامی که لبه پنجره فراتر از لبه متناظر صفحه‌نمایش " +"قرار گرفته باشد. یک رشته خالی هر هندسه تعیین‌شده توسط کاربر را لغو می‌کند و به پنجره " +"اجازه می‌دهد تا به اندازه طبیعی خود بازگردد. بدون آرگومان، هندسه کنونی را به صورت " +"رشته‌ای به شکل ``'200x200+10+10'`` برمی‌گرداند. :meth:`wm_geometry` نام مستعاری " +"از :meth:`!geometry` است." -msgid "Manage the window as a gridded window and define the relationship between grid units and pixels. *baseWidth* and *baseHeight* are the numbers of grid units for the window's internally requested size, and *widthInc* and *heightInc* are the pixel sizes of a horizontal and vertical grid unit. Empty strings turn off gridded management. With no arguments, return a tuple of the four current values, or ``None`` if the window is not gridded. :meth:`wm_grid` is an alias of :meth:`!grid`." -msgstr "" +msgid "" +"Manage the window as a gridded window and define the relationship between grid units " +"and pixels. *baseWidth* and *baseHeight* are the numbers of grid units for the " +"window's internally requested size, and *widthInc* and *heightInc* are the pixel " +"sizes of a horizontal and vertical grid unit. Empty strings turn off gridded " +"management. With no arguments, return a tuple of the four current values, or " +"``None`` if the window is not gridded. :meth:`wm_grid` is an alias of :meth:`!grid`." +msgstr "" +"پنجره را به‌عنوان یک پنجره شبکه‌بندی‌شده مدیریت می‌کند و رابطه بین واحدهای شبکه و " +"پیکسل‌ها را تعریف می‌کند. *baseWidth* و *baseHeight* تعداد واحدهای شبکه برای اندازه " +"درخواستی داخلی پنجره هستند، و *widthInc* و *heightInc* اندازه‌های پیکسلی یک واحد شبکه " +"افقی و یک واحد شبکه عمودی هستند. رشته‌های خالی مدیریت شبکه‌بندی‌شده را غیرفعال می‌کنند. " +"بدون آرگومان، یک تاپل از چهار مقدار فعلی را برمی‌گرداند، یا اگر پنجره شبکه‌بندی‌نشده " +"باشد ``None`` را برمی‌گرداند. :meth:`wm_grid` نام مستعاری از :meth:`!grid` است." msgid "Not to be confused with the grid geometry manager :meth:`Grid.grid`." -msgstr "" +msgstr "با مدیر هندسی grid :meth:`Grid.grid` اشتباه گرفته نشود." -msgid "Set or query the leader of a group of related windows. *pathName* gives the path name of the group leader; the window manager may, for example, unmap all windows in the group when the leader is iconified. An empty string removes the window from any group. With no argument, return the path name of the current group leader, or an empty string. :meth:`wm_group` is an alias of :meth:`!group`." -msgstr "" +msgid "" +"Set or query the leader of a group of related windows. *pathName* gives the path " +"name of the group leader; the window manager may, for example, unmap all windows in " +"the group when the leader is iconified. An empty string removes the window from any " +"group. With no argument, return the path name of the current group leader, or an " +"empty string. :meth:`wm_group` is an alias of :meth:`!group`." +msgstr "" +"رهبر یک گروه از پنجره‌های مرتبط را تنظیم یا پرس‌وجو کنید. *pathName* نام مسیر رهبر " +"گروه را مشخص می‌کند؛ برای مثال، مدیر پنجره ممکن است هنگامی که رهبر گروه به آیکون " +"تبدیل می‌شود (iconified)، تمام پنجره‌های گروه را از نگاشت خارج کند (unmap). یک رشته " +"خالی پنجره را از هر گروه حذف می‌کند. بدون آرگومان، نام مسیر رهبر گروه فعلی یا یک رشته " +"خالی را برمی‌گرداند. :meth:`wm_group` نام مستعاری از :meth:`!group` است." -msgid "Set or query the bitmap used by the window manager for the window's icon. *bitmap* names a bitmap in one of the standard forms accepted by Tk; an empty string cancels the current icon bitmap. With no argument, return the name of the current icon bitmap, or an empty string. On Windows the *default* argument names an icon (for example an ``.ico`` file) applied to all top-level windows that have no icon of their own. :meth:`wm_iconbitmap` is an alias of :meth:`!iconbitmap`." -msgstr "" +msgid "" +"Set or query the bitmap used by the window manager for the window's icon. *bitmap* " +"names a bitmap in one of the standard forms accepted by Tk; an empty string cancels " +"the current icon bitmap. With no argument, return the name of the current icon " +"bitmap, or an empty string. On Windows the *default* argument names an icon (for " +"example an ``.ico`` file) applied to all top-level windows that have no icon of " +"their own. :meth:`wm_iconbitmap` is an alias of :meth:`!iconbitmap`." +msgstr "" +"بیت‌مپ (bitmap) استفاده‌شده توسط مدیر پنجره برای آیکون پنجره را تنظیم یا پرس‌وجو می‌کند. " +"*bitmap* یک بیت‌مپ را در یکی از قالب‌های استاندارد پذیرفته‌شده توسط Tk مشخص می‌کند؛ یک " +"رشته خالی بیت‌مپ آیکون فعلی را لغو می‌کند. بدون آرگومان، نام بیت‌مپ آیکون فعلی یا یک " +"رشته خالی را برمی‌گرداند. در ویندوز، آرگومان *default* یک آیکون را مشخص می‌کند (برای " +"مثال یک فایل ``.ico``) که به تمام پنجره‌های سطح بالایی که آیکون خودشان را ندارند " +"اعمال می‌شود. :meth:`wm_iconbitmap` نام مستعار :meth:`!iconbitmap` است." -msgid "Iconify the window. If the window has not yet been mapped for the first time, arrange for it to appear in the iconified state when it is eventually mapped. :meth:`wm_iconify` is an alias of :meth:`!iconify`." +msgid "" +"Iconify the window. If the window has not yet been mapped for the first time, " +"arrange for it to appear in the iconified state when it is eventually " +"mapped. :meth:`wm_iconify` is an alias of :meth:`!iconify`." msgstr "" +"پنجره را به حالت آیکون‌شده درآورید. اگر پنجره هنوز برای نخستین بار نگاشت (map) نشده " +"است، ترتیبی دهید که هنگامی که در نهایت نگاشت می‌شود، در حالت آیکون‌شده ظاهر " +"شود. :meth:`wm_iconify` نام مستعار :meth:`!iconify` است." -msgid "Set or query the bitmap used as a mask for the icon (see :meth:`iconbitmap`). Where the mask is zero no icon is displayed; where it is one, the corresponding bits of the icon bitmap are shown. An empty string cancels the current mask. With no argument, return the name of the current icon mask, or an empty string. :meth:`wm_iconmask` is an alias of :meth:`!iconmask`." -msgstr "" +msgid "" +"Set or query the bitmap used as a mask for the icon (see :meth:`iconbitmap`). Where " +"the mask is zero no icon is displayed; where it is one, the corresponding bits of " +"the icon bitmap are shown. An empty string cancels the current mask. With no " +"argument, return the name of the current icon mask, or an empty " +"string. :meth:`wm_iconmask` is an alias of :meth:`!iconmask`." +msgstr "" +"بیت‌مپی را که به‌عنوان ماسک برای آیکون استفاده می‌شود، تنظیم یا پرس‌وجو کنید " +"(به :meth:`iconbitmap` مراجعه کنید). هر جا که ماسک ۰ باشد، هیچ آیکونی نمایش داده " +"نمی‌شود؛ هر جا که مقدار آن ۱ باشد، بیت‌های متناظر بیت‌مپ آیکون نمایش داده می‌شوند. یک " +"رشته خالی ماسک فعلی را لغو می‌کند. بدون آرگومان، نام ماسک فعلی آیکون یا یک رشته خالی " +"را برمی‌گرداند. :meth:`wm_iconmask` نام مستعاری از :meth:`!iconmask` است." -msgid "Set or query the name displayed by the window manager inside the window's icon. With no argument, return the current icon name, or an empty string if none has been set (in which case the window manager normally displays the window's title). :meth:`wm_iconname` is an alias of :meth:`!iconname`." +msgid "" +"Set or query the name displayed by the window manager inside the window's icon. With " +"no argument, return the current icon name, or an empty string if none has been set " +"(in which case the window manager normally displays the window's " +"title). :meth:`wm_iconname` is an alias of :meth:`!iconname`." msgstr "" +"نامی را که مدیر پنجره در داخل آیکون پنجره نمایش می‌دهد، تنظیم یا پرس‌وجو می‌کند. بدون " +"آرگومان، نام فعلی آیکون را برمی‌گرداند، یا اگر هیچ نامی تنظیم نشده باشد، یک رشته‌ی خالی " +"برمی‌گرداند (در این حالت، مدیر پنجره معمولاً عنوان پنجره را نمایش " +"می‌دهد). :meth:`wm_iconname` یک نام مستعار برای :meth:`!iconname` است." -msgid "Set the titlebar icon for the window from one or more :class:`PhotoImage` objects given in *images*. Several images of different sizes (for example 16x16 and 32x32) may be supplied so that the window manager can choose an appropriate one. The image data is taken as a snapshot at the time of the call; later changes to the images are not reflected. If *default* is true, the icon is also applied to all top-level windows created in the future. On macOS only the first image is used. :meth:`wm_iconphoto` is an alias of :meth:`!iconphoto`." -msgstr "" +msgid "" +"Set the titlebar icon for the window from one or more :class:`PhotoImage` objects " +"given in *images*. Several images of different sizes (for example 16x16 and 32x32) " +"may be supplied so that the window manager can choose an appropriate one. The image " +"data is taken as a snapshot at the time of the call; later changes to the images are " +"not reflected. If *default* is true, the icon is also applied to all top-level " +"windows created in the future. On macOS only the first image is " +"used. :meth:`wm_iconphoto` is an alias of :meth:`!iconphoto`." +msgstr "" +"آیکون نوار عنوان پنجره را از یک یا چند شیء :class:`PhotoImage` ارائه‌شده در *images* " +"تنظیم می‌کند. می‌توان چندین تصویر با اندازه‌های مختلف (برای مثال ۱۶x۱۶ و ۳۲x۳۲) ارائه " +"کرد تا مدیر پنجره بتواند تصویر مناسبی را انتخاب کند. داده‌های تصویر در زمان فراخوانی " +"به‌عنوان یک تصویر لحظه‌ای گرفته می‌شوند؛ تغییرات بعدی در تصاویر منعکس نمی‌شوند. اگر " +"*default* درست باشد، آیکون همچنین برای همه پنجره‌های سطح بالا که در آینده ایجاد " +"می‌شوند اعمال می‌شود. در macOS فقط از اولین تصویر استفاده می‌شود. :meth:`wm_iconphoto` " +"نام مستعاری از :meth:`!iconphoto` است." -msgid "Set or query a hint to the window manager about where the window's icon should be positioned. Empty strings cancel an existing hint. With no arguments, return a tuple of the two current values, or ``None`` if no hint is in effect. :meth:`wm_iconposition` is an alias of :meth:`!iconposition`." +msgid "" +"Set or query a hint to the window manager about where the window's icon should be " +"positioned. Empty strings cancel an existing hint. With no arguments, return a tuple " +"of the two current values, or ``None`` if no hint is in " +"effect. :meth:`wm_iconposition` is an alias of :meth:`!iconposition`." msgstr "" +"راهنمایی‌ای برای مدیر پنجره درباره‌ی محل قرارگیری نماد پنجره تنظیم یا دریافت کنید. " +"رشته‌های خالی، راهنمایی موجود را لغو می‌کنند. بدون آرگومان، یک تاپل از دو مقدار فعلی " +"را برمی‌گرداند، یا اگر هیچ راهنمایی‌ای فعال نباشد، ``None`` را " +"برمی‌گرداند. :meth:`wm_iconposition` نام مستعاری از :meth:`!iconposition` است." -msgid "Set or query the window used as the icon for the window. When the window is iconified, *pathName* is mapped to serve as its icon and unmapped again when it is de-iconified. An empty string cancels the association. With no argument, return the path name of the current icon window, or an empty string. Not all window managers support icon windows, and the concept is meaningless on non-X11 platforms. :meth:`wm_iconwindow` is an alias of :meth:`!iconwindow`." -msgstr "" +msgid "" +"Set or query the window used as the icon for the window. When the window is " +"iconified, *pathName* is mapped to serve as its icon and unmapped again when it is " +"de-iconified. An empty string cancels the association. With no argument, return the " +"path name of the current icon window, or an empty string. Not all window managers " +"support icon windows, and the concept is meaningless on non-X11 " +"platforms. :meth:`wm_iconwindow` is an alias of :meth:`!iconwindow`." +msgstr "" +"پنجره‌ای را که به‌عنوان آیکون برای پنجره استفاده می‌شود، تنظیم یا پرس‌وجو کنید. هنگامی " +"که پنجره به حالت آیکون درمی‌آید، *pathName* نگاشت می‌شود تا به‌عنوان آیکون آن عمل کند و " +"هنگامی که از حالت آیکون خارج می‌شود، دوباره از نگاشت خارج می‌شود. یک رشته‌ی خالی این " +"ارتباط را لغو می‌کند. بدون آرگومان، نام مسیر پنجره‌ی آیکون کنونی یا یک رشته‌ی خالی " +"برگردانده می‌شود. همه‌ی مدیران پنجره از پنجره‌های آیکون پشتیبانی نمی‌کنند، و این مفهوم " +"در سکوهای غیر X11 بی‌معنا است. :meth:`wm_iconwindow` نام مستعار :meth:`!iconwindow` " +"است." -msgid "Make *widget* a stand-alone top-level window, decorated by the window manager with a title bar and so on. Only :class:`Frame`, :class:`LabelFrame` and :class:`Toplevel` widgets may be used (the :mod:`tkinter.ttk` versions are **not** accepted); passing any other widget type raises an error. :meth:`wm_manage` is an alias of :meth:`!manage`." -msgstr "" +msgid "" +"Make *widget* a stand-alone top-level window, decorated by the window manager with a " +"title bar and so on. Only :class:`Frame`, :class:`LabelFrame` and :class:`Toplevel` " +"widgets may be used (the :mod:`tkinter.ttk` versions are **not** accepted); passing " +"any other widget type raises an error. :meth:`wm_manage` is an alias of :meth:`!" +"manage`." +msgstr "" +"*widget* را به یک پنجره‌ی سطح بالای مستقل تبدیل می‌کند که توسط مدیر پنجره با نوار " +"عنوان و غیره آراسته می‌شود. تنها می‌توان از " +"ویدجت‌های :class:`Frame`، :class:`LabelFrame` و :class:`Toplevel` استفاده کرد " +"(نسخه‌های :mod:`tkinter.ttk` پذیرفته **نمی‌شوند**)؛ ارسال هر نوع ابزارک دیگری خطایی " +"پرتاب می‌کند. :meth:`wm_manage` نام مستعاری برای :meth:`!manage` است." -msgid "Set or query the maximum permissible dimensions of the window, in pixels (or grid units for a gridded window). The window manager restricts the window to be no larger than *width* and *height*. With no arguments, return a tuple of the current maximum width and height. The maximum size defaults to the size of the screen. :meth:`wm_maxsize` is an alias of :meth:`!maxsize`." -msgstr "" +msgid "" +"Set or query the maximum permissible dimensions of the window, in pixels (or grid " +"units for a gridded window). The window manager restricts the window to be no larger " +"than *width* and *height*. With no arguments, return a tuple of the current maximum " +"width and height. The maximum size defaults to the size of the " +"screen. :meth:`wm_maxsize` is an alias of :meth:`!maxsize`." +msgstr "" +"حداکثر ابعاد مجاز پنجره را بر حسب پیکسل (یا واحدهای شبکه برای پنجره شبکه‌بندی‌شده) " +"تنظیم یا پرس‌وجو می‌کند. مدیر پنجره، پنجره را محدود می‌کند تا بزرگ‌تر از *width* و " +"*height* نباشد. بدون آرگومان، یک تاپل از حداکثر عرض و ارتفاع فعلی برمی‌گرداند. حداکثر " +"اندازه به‌طور پیش‌فرض برابر با اندازه صفحه است. :meth:`wm_maxsize` نام مستعاری " +"از :meth:`!maxsize` است." -msgid "Set or query the minimum permissible dimensions of the window, in pixels (or grid units for a gridded window). The window manager restricts the window to be no smaller than *width* and *height*. With no arguments, return a tuple of the current minimum width and height. The minimum size defaults to one pixel in each dimension. :meth:`wm_minsize` is an alias of :meth:`!minsize`." -msgstr "" +msgid "" +"Set or query the minimum permissible dimensions of the window, in pixels (or grid " +"units for a gridded window). The window manager restricts the window to be no " +"smaller than *width* and *height*. With no arguments, return a tuple of the current " +"minimum width and height. The minimum size defaults to one pixel in each " +"dimension. :meth:`wm_minsize` is an alias of :meth:`!minsize`." +msgstr "" +"حداقل ابعاد مجاز پنجره را، بر حسب پیکسل (یا واحدهای شبکه برای پنجره شبکه‌بندی‌شده)، " +"تنظیم یا دریافت کنید. مدیر پنجره، پنجره را محدود می‌کند که از *width* و *height* " +"کوچک‌تر نباشد. بدون آرگومان، یک تاپل از حداقل عرض و ارتفاع کنونی برمی‌گرداند. حداقل " +"اندازه به‌طور پیش‌فرض در هر بُعد یک پیکسل است. :meth:`wm_minsize` نام مستعاری " +"از :meth:`!minsize` است." -msgid "Set or query the override-redirect flag for the window. When this flag is set, the window is ignored by the window manager: it is not reparented into a decorative frame and the user cannot manipulate it through the usual window manager controls. With no argument, return a boolean indicating whether the flag is set, or ``None`` if it has not been set. The flag is reliably honored only when the window is first mapped or remapped from the withdrawn state. :meth:`wm_overrideredirect` is an alias of :meth:`!overrideredirect`." -msgstr "" +msgid "" +"Set or query the override-redirect flag for the window. When this flag is set, the " +"window is ignored by the window manager: it is not reparented into a decorative " +"frame and the user cannot manipulate it through the usual window manager controls. " +"With no argument, return a boolean indicating whether the flag is set, or ``None`` " +"if it has not been set. The flag is reliably honored only when the window is first " +"mapped or remapped from the withdrawn state. :meth:`wm_overrideredirect` is an alias " +"of :meth:`!overrideredirect`." +msgstr "" +"پرچم override-redirect را برای پنجره تنظیم یا پرس‌وجو می‌کند. هنگامی که این پرچم تنظیم " +"شده باشد، مدیر پنجره پنجره را نادیده می‌گیرد: در یک فریم تزئینی قرار نمی‌گیرد " +"(reparented) و کاربر نمی‌تواند از طریق کنترل‌های معمول مدیر پنجره با آن تعامل کند. " +"بدون آرگومان، یک مقدار بولی برمی‌گرداند که نشان می‌دهد پرچم تنظیم شده است یا خیر، یا " +"اگر تنظیم‌نشده باشد، ``None`` برمی‌گرداند. این پرچم تنها زمانی به‌طور قابل‌اتکا رعایت " +"می‌شود که پنجره برای نخستین بار به نگاشت درآید (mapped) یا از حالت withdrawn دوباره " +"به نگاشت درآید (remapped). :meth:`wm_overrideredirect` یک نام مستعار برای :meth:`!" +"overrideredirect` است." -msgid "Set or query the source of the window's current position. *who* is either ``'program'`` or ``'user'`` and indicates whether the position was requested by the program or by the user; an empty string cancels the current source. With no argument, return the current source, or an empty string if none has been set. Tk automatically sets the source to ``'user'`` when :meth:`geometry` is called, unless it has been set explicitly to ``'program'``. :meth:`wm_positionfrom` is an alias of :meth:`!positionfrom`." -msgstr "" +msgid "" +"Set or query the source of the window's current position. *who* is either " +"``'program'`` or ``'user'`` and indicates whether the position was requested by the " +"program or by the user; an empty string cancels the current source. With no " +"argument, return the current source, or an empty string if none has been set. Tk " +"automatically sets the source to ``'user'`` when :meth:`geometry` is called, unless " +"it has been set explicitly to ``'program'``. :meth:`wm_positionfrom` is an alias " +"of :meth:`!positionfrom`." +msgstr "" +"منشأ موقعیت فعلی پنجره را تنظیم یا پرس‌وجو می‌کند. *who* یا ``'program'`` است یا " +"``'user'`` و نشان می‌دهد که موقعیت را برنامه درخواست کرده است یا کاربر؛ یک رشته‌ی خالی " +"منشأ فعلی را لغو می‌کند. بدون آرگومان، منشأ فعلی را برمی‌گرداند، یا اگر هیچ منشأی " +"تنظیم نشده باشد، یک رشته‌ی خالی برمی‌گرداند. Tk به‌طور خودکار، هنگامی " +"که :meth:`geometry` فراخوانی می‌شود، منشأ را روی ``'user'`` تنظیم می‌کند، مگر اینکه " +"به‌طور صریح روی ``'program'`` تنظیم شده باشد. :meth:`wm_positionfrom` نام مستعاری " +"از :meth:`!positionfrom` است." -msgid "Register *func* as the handler for the window manager protocol *name*, an atom such as ``'WM_DELETE_WINDOW'``, ``'WM_SAVE_YOURSELF'`` or ``'WM_TAKE_FOCUS'``; *func* is then called whenever the window manager sends a message of that protocol. Tk installs a default ``WM_DELETE_WINDOW`` handler that destroys the window, which this method can replace. If *func* is an empty string, the handler is removed. With only *name*, return the name of its registered handler command, or an empty string if none is set (the default ``WM_DELETE_WINDOW`` handler is not reported); with no arguments, return a tuple of the protocols that currently have handlers. :meth:`wm_protocol` is an alias of :meth:`!protocol`." -msgstr "" +msgid "" +"Register *func* as the handler for the window manager protocol *name*, an atom such " +"as ``'WM_DELETE_WINDOW'``, ``'WM_SAVE_YOURSELF'`` or ``'WM_TAKE_FOCUS'``; *func* is " +"then called whenever the window manager sends a message of that protocol. Tk " +"installs a default ``WM_DELETE_WINDOW`` handler that destroys the window, which this " +"method can replace. If *func* is an empty string, the handler is removed. With only " +"*name*, return the name of its registered handler command, or an empty string if " +"none is set (the default ``WM_DELETE_WINDOW`` handler is not reported); with no " +"arguments, return a tuple of the protocols that currently have " +"handlers. :meth:`wm_protocol` is an alias of :meth:`!protocol`." +msgstr "" +"*func* به‌عنوان هندلر پروتکل *name* مدیر پنجره ثبت می‌شود؛ *name* یک اتم (atom) " +"مانند ``'WM_DELETE_WINDOW'``، ``'WM_SAVE_YOURSELF'`` یا ``'WM_TAKE_FOCUS'`` است. سپس " +"هرگاه مدیر پنجره پیامی از آن پروتکل ارسال کند، *func* فراخوانی می‌شود. Tk یک " +"هندلر پیش‌فرض ``WM_DELETE_WINDOW`` نصب می‌کند که پنجره را نابود می‌کند؛ این متد " +"می‌تواند آن را جایگزین کند. اگر *func* یک رشته‌ی خالی باشد، هندلر حذف می‌شود. در " +"صورت ارائه‌ی فقط *name*، نام فرمان هندلر ثبت‌شده‌ی آن برگردانده می‌شود، یا اگر هیچ " +"هندلرای تنظیم نشده باشد، یک رشته‌ی خالی برگردانده می‌شود (هندلر پیش‌فرض " +"``WM_DELETE_WINDOW`` گزارش نمی‌شود)؛ بدون آرگومان، یک تاپل از پروتکل‌هایی که در حال " +"حاضر هندلر دارند برگردانده می‌شود. :meth:`wm_protocol` نام مستعار :meth:`!" +"protocol` است." -msgid "Control whether the user may interactively resize the window. *width* and *height* are boolean values that determine whether the window's width and height may be changed. With no arguments, return a tuple of two ``0``/``1`` values indicating whether each dimension is currently resizable. By default a window is resizable in both dimensions. :meth:`wm_resizable` is an alias of :meth:`!resizable`." -msgstr "" +msgid "" +"Control whether the user may interactively resize the window. *width* and *height* " +"are boolean values that determine whether the window's width and height may be " +"changed. With no arguments, return a tuple of two ``0``/``1`` values indicating " +"whether each dimension is currently resizable. By default a window is resizable in " +"both dimensions. :meth:`wm_resizable` is an alias of :meth:`!resizable`." +msgstr "" +"کنترل می‌کند که آیا کاربر مجاز است به‌صورت تعاملی اندازه‌ی پنجره را تغییر دهد یا خیر. " +"*width* و *height* مقادیر بولی هستند که تعیین می‌کنند آیا عرض و ارتفاع پنجره قابل " +"تغییر هستند یا خیر. بدون آرگومان، یک تاپل از دو مقدار ``0``/``1`` برمی‌گرداند که نشان " +"می‌دهد هر بُعد در حال حاضر قابل تغییر اندازه است یا خیر. به‌طور پیش‌فرض، یک پنجره در هر " +"دو بُعد قابل تغییر اندازه است. :meth:`wm_resizable` نام مستعاری برای :meth:`!" +"resizable` است." -msgid "Set or query the source of the window's current size. *who* is either ``'program'`` or ``'user'`` and indicates whether the size was requested by the program or by the user; an empty string cancels the current source. With no argument, return the current source, or an empty string if none has been set. :meth:`wm_sizefrom` is an alias of :meth:`!sizefrom`." -msgstr "" +msgid "" +"Set or query the source of the window's current size. *who* is either ``'program'`` " +"or ``'user'`` and indicates whether the size was requested by the program or by the " +"user; an empty string cancels the current source. With no argument, return the " +"current source, or an empty string if none has been set. :meth:`wm_sizefrom` is an " +"alias of :meth:`!sizefrom`." +msgstr "" +"منبع اندازه‌ی فعلی پنجره را تنظیم یا پرس‌وجو می‌کند. *who* می‌تواند ``'program'`` یا " +"``'user'`` باشد و نشان می‌دهد که اندازه توسط برنامه درخواست شده است یا توسط کاربر؛ یک " +"رشته خالی منبع فعلی را لغو می‌کند. بدون آرگومان، منبع فعلی را برمی‌گرداند، یا اگر هیچ " +"منبعی تنظیم نشده باشد، یک رشته خالی را برمی‌گرداند. :meth:`wm_sizefrom` یک نام مستعار " +"برای :meth:`!sizefrom` است." -msgid "Set or query the state of the window. With no argument, return the current state: one of ``'normal'``, ``'iconic'``, ``'withdrawn'``, ``'icon'`` or, on Windows and macOS only, ``'zoomed'``. ``'iconic'`` refers to a window that has been iconified, while ``'icon'`` refers to a window serving as the icon for another window (see :meth:`iconwindow`); the ``'icon'`` state cannot be set. :meth:`wm_state` is an alias of :meth:`!state`." -msgstr "" +msgid "" +"Set or query the state of the window. With no argument, return the current state: " +"one of ``'normal'``, ``'iconic'``, ``'withdrawn'``, ``'icon'`` or, on Windows and " +"macOS only, ``'zoomed'``. ``'iconic'`` refers to a window that has been iconified, " +"while ``'icon'`` refers to a window serving as the icon for another window " +"(see :meth:`iconwindow`); the ``'icon'`` state cannot be set. :meth:`wm_state` is an " +"alias of :meth:`!state`." +msgstr "" +"وضعیت پنجره را تنظیم یا پرس‌وجو می‌کند. بدون آرگومان، وضعیت فعلی را برمی‌گرداند: یکی از " +"``'normal'``، ``'iconic'``، ``'withdrawn'``، ``'icon'`` یا ``'zoomed'`` (فقط در " +"Windows و macOS). ``'iconic'`` به پنجره‌ای اشاره دارد که به آیکون تبدیل شده است، در " +"حالی که ``'icon'`` به پنجره‌ای اشاره دارد که به‌عنوان آیکون برای پنجره‌ای دیگر عمل " +"می‌کند (به :meth:`iconwindow` مراجعه کنید)؛ نمی‌توان وضعیت ``'icon'`` را تنظیم " +"کرد. :meth:`wm_state` نام مستعاری از :meth:`!state` است." msgid "Not to be confused with :meth:`ttk.Widget.state `." -msgstr "" +msgstr "با :meth:`ttk.Widget.state ` اشتباه گرفته نشود." -msgid "Set or query the title for the window, which the window manager should display in the window's title bar. With no argument, return the current title. The title defaults to the window's name. :meth:`wm_title` is an alias of :meth:`!title`." +msgid "" +"Set or query the title for the window, which the window manager should display in " +"the window's title bar. With no argument, return the current title. The title " +"defaults to the window's name. :meth:`wm_title` is an alias of :meth:`!title`." msgstr "" +"عنوان پنجره را تنظیم یا دریافت کنید، که مدیر پنجره باید آن را در نوار عنوان پنجره " +"نمایش دهد. بدون آرگومان، عنوان فعلی را برمی‌گرداند. عنوان به‌طور پیش‌فرض نام پنجره " +"است. :meth:`wm_title` یک نام مستعار از :meth:`!title` است." -msgid "Mark the window as a transient window (such as a pull-down menu or dialog) working on behalf of *master*, the path name of another top-level window. An empty string clears the transient status. With no argument, return the path name of the current master, or an empty string. A transient window mirrors state changes in its master and may be decorated differently by the window manager; it is an error to make a window a transient of itself. :meth:`wm_transient` is an alias of :meth:`!transient`." -msgstr "" +msgid "" +"Mark the window as a transient window (such as a pull-down menu or dialog) working " +"on behalf of *master*, the path name of another top-level window. An empty string " +"clears the transient status. With no argument, return the path name of the current " +"master, or an empty string. A transient window mirrors state changes in its master " +"and may be decorated differently by the window manager; it is an error to make a " +"window a transient of itself. :meth:`wm_transient` is an alias of :meth:`!transient`." +msgstr "" +"پنجره را به‌عنوان یک پنجره گذرا (مانند یک منوی بازشو یا جعبه محاوره‌ای) علامت‌گذاری " +"می‌کند که از طرف *master*، نام مسیر یک پنجره سطح بالای دیگر، عمل می‌کند. یک رشته خالی " +"وضعیت گذرا را پاک می‌کند. بدون آرگومان، نام مسیر master جاری یا یک رشته خالی را " +"برمی‌گرداند. یک پنجره گذرا تغییرات وضعیت master خود را منعکس می‌کند و ممکن است توسط " +"مدیر پنجره به‌شکل متفاوتی آراسته شود؛ تبدیل یک پنجره به پنجره گذرای خودش خطا " +"است. :meth:`wm_transient` نام مستعاری از :meth:`!transient` است." -msgid "Withdraw the window from the screen, unmapping it and causing the window manager to forget about it. If the window has never been mapped, it is instead mapped in the withdrawn state. It is sometimes necessary to withdraw a window and then re-map it (for example with :meth:`deiconify`) to make some window managers notice changes to window attributes. :meth:`wm_withdraw` is an alias of :meth:`!withdraw`." -msgstr "" +msgid "" +"Withdraw the window from the screen, unmapping it and causing the window manager to " +"forget about it. If the window has never been mapped, it is instead mapped in the " +"withdrawn state. It is sometimes necessary to withdraw a window and then re-map it " +"(for example with :meth:`deiconify`) to make some window managers notice changes to " +"window attributes. :meth:`wm_withdraw` is an alias of :meth:`!withdraw`." +msgstr "" +"پنجره را از صفحه‌نمایش خارج می‌کند، آن را از نگاشت خارج کرده و باعث می‌شود مدیر پنجره " +"آن را فراموش کند. اگر پنجره هرگز نگاشت نشده باشد، در عوض در حالت خارج‌شده (withdrawn) " +"نگاشت می‌شود. گاهی لازم است پنجره‌ای را خارج کنید و سپس دوباره آن را نگاشت کنید (برای " +"مثال با :meth:`deiconify`) تا برخی مدیرهای پنجره متوجه تغییرات ویژگی‌های پنجره " +"شوند. :meth:`wm_withdraw` یک نام مستعار برای :meth:`!withdraw` است." -msgid "Geometry manager that arranges widgets by packing them against the sides of their container. The :class:`!Pack` mix-in is inherited by all widgets (through :class:`Widget`) and provides the methods for managing a widget with the *pack* geometry manager. See also :ref:`tkinter-geometry-management`." +msgid "" +"Geometry manager that arranges widgets by packing them against the sides of their " +"container. The :class:`!Pack` mix-in is inherited by all widgets " +"(through :class:`Widget`) and provides the methods for managing a widget with the " +"*pack* geometry manager. See also :ref:`tkinter-geometry-management`." msgstr "" +"مدیر چیدمانی که ویدجت‌ها را با چسباندن آن‌ها به کناره‌های ظرفشان مرتب می‌کند. کلاس " +"میکس‌این :class:`!Pack` توسط همه ویدجت‌ها (از طریق :class:`Widget`) به ارث " +"برده می‌شود و متدهایی را برای مدیریت یک ابزارک با مدیر چیدمان *pack* فراهم می‌کند. " +"همچنین :ref:`tkinter-geometry-management` را ببینید." -msgid ":class:`Pack`, :class:`Place` and :class:`Grid` all define the short method names :meth:`!forget`, :meth:`!info`, :meth:`!slaves`, :meth:`!content` and :meth:`!propagate`. On a widget the bare names resolve to the *pack* manager's versions, since :class:`Pack` and :class:`Misc` precede :class:`Place` and :class:`Grid` in the method resolution order, whatever manager actually manages the widget; and :meth:`!configure`/:meth:`!config` configure the widget's options, not its geometry. Use the explicit ``pack_*``, ``grid_*`` and ``place_*`` methods (and ``pack``, ``grid``, ``place`` for geometry configuration) to act on a specific geometry manager." -msgstr "" +msgid "" +":class:`Pack`, :class:`Place` and :class:`Grid` all define the short method " +"names :meth:`!forget`, :meth:`!info`, :meth:`!slaves`, :meth:`!content` and :meth:`!" +"propagate`. On a widget the bare names resolve to the *pack* manager's versions, " +"since :class:`Pack` and :class:`Misc` precede :class:`Place` and :class:`Grid` in " +"the method resolution order, whatever manager actually manages the widget; " +"and :meth:`!configure`/:meth:`!config` configure the widget's options, not its " +"geometry. Use the explicit ``pack_*``, ``grid_*`` and ``place_*`` methods (and " +"``pack``, ``grid``, ``place`` for geometry configuration) to act on a specific " +"geometry manager." +msgstr "" +":class:`Pack`، :class:`Place` و :class:`Grid` همگی نام‌های کوتاه متد :meth:`!" +"forget`، :meth:`!info`، :meth:`!slaves`، :meth:`!content` و :meth:`!propagate` را " +"تعریف می‌کنند. در یک ابزارک، این نام‌های بدون پیشوند به نسخه‌های مربوط به مدیر *pack* " +"حل می‌شوند، زیرا :class:`Pack` و :class:`Misc` در ترتیب حل متد، پیش از :class:`Place` " +"و :class:`Grid` قرار دارند، صرف‌نظر از این‌که کدام مدیر واقعاً ابزارک را مدیریت می‌کند؛ " +"و :meth:`!configure`/:meth:`!config` گزینه‌های ابزارک را پیکربندی می‌کنند، نه هندسه‌ی " +"آن. برای عمل بر یک مدیر هندسه‌ی خاص، از متدهای صریح ``pack_*``، ``grid_*`` و " +"``place_*`` استفاده کنید (و برای پیکربندی هندسه از ``pack``، ``grid`` و ``place``)." -msgid "Pack the widget inside its container, positioning it relative to the siblings already packed there. The supported options are:" +msgid "" +"Pack the widget inside its container, positioning it relative to the siblings " +"already packed there. The supported options are:" msgstr "" +"ابزارک را درون ظرف خود بسته‌بندی کنید و آن را نسبت به ابزارک‌های هم‌سطحی که از قبل در آنجا " +"بسته‌بندی شده‌اند، موقعیت‌دهی کنید. گزینه‌های پشتیبانی‌شده عبارتند از:" msgid "*side*" -msgstr "" +msgstr "*سمت*" -msgid "Which side of the container to pack the widget against: ``'top'`` (the default), ``'bottom'``, ``'left'`` or ``'right'``." +msgid "" +"Which side of the container to pack the widget against: ``'top'`` (the default), " +"``'bottom'``, ``'left'`` or ``'right'``." msgstr "" +"اینکه در برابر کدام سمت از ظرف، ابزارک چیده شود: ``'top'`` (پیش‌فرض)، ``'bottom'``، " +"``'left'`` یا ``'right'``." msgid "*fill*" -msgstr "" +msgstr "*پر کردن*" -msgid "Whether to stretch the widget to fill its parcel: ``'none'`` (the default), ``'x'``, ``'y'`` or ``'both'``." +msgid "" +"Whether to stretch the widget to fill its parcel: ``'none'`` (the default), ``'x'``, " +"``'y'`` or ``'both'``." msgstr "" +"اینکه ابزارک برای پر کردن ناحیه‌ی خود کشیده شود یا خیر: ``'none'`` (پیش‌فرض)، ``'x'``، " +"``'y'`` یا ``'both'``." msgid "*expand*" -msgstr "" +msgstr "*گسترش*" -msgid "Whether the widget should expand to consume any extra space in its container (a boolean, default false)." +msgid "" +"Whether the widget should expand to consume any extra space in its container (a " +"boolean, default false)." msgstr "" +"اینکه ابزارک باید گسترش یابد تا هر فضای اضافی در ظرف خود را اشغال کند (یک بولی، پیش‌فرض " +"false)." msgid "*anchor*" -msgstr "" +msgstr "*لنگر*" -msgid "Where to position the widget in its parcel when the parcel is larger than the widget: an anchor such as ``'n'`` or ``'sw'`` (default ``'center'``)." +msgid "" +"Where to position the widget in its parcel when the parcel is larger than the " +"widget: an anchor such as ``'n'`` or ``'sw'`` (default ``'center'``)." msgstr "" +"محل قرارگیری ابزارک در قطعه‌ی خود (parcel)، هنگامی که قطعه از ابزارک بزرگ‌تر باشد: " +"لنگری (anchor) مانند ``'n'`` یا ``'sw'`` (پیش‌فرض ``'center'``)." msgid "*ipadx*, *ipady*" -msgstr "" +msgstr "*ipadx*, *ipady*" -msgid "Internal padding added on the left and right (*ipadx*) or top and bottom (*ipady*) of the widget, as a screen distance (default ``0``)." +msgid "" +"Internal padding added on the left and right (*ipadx*) or top and bottom (*ipady*) " +"of the widget, as a screen distance (default ``0``)." msgstr "" +"فاصله‌ی داخلی افزوده‌شده در سمت چپ و راست (*ipadx*) یا بالا و پایین (*ipady*) ابزارک، " +"به‌عنوان یک فاصله‌ی صفحه‌ای (پیش‌فرض ``0``)." msgid "*padx*, *pady*" -msgstr "" +msgstr "*padx*, *pady*" -msgid "External padding left on the left and right (*padx*) or top and bottom (*pady*) of the widget, as a screen distance or a pair of two distances for the two sides (default ``0``)." +msgid "" +"External padding left on the left and right (*padx*) or top and bottom (*pady*) of " +"the widget, as a screen distance or a pair of two distances for the two sides " +"(default ``0``)." msgstr "" +"فاصله‌گذاری بیرونی در سمت چپ و راست (*padx*) یا بالا و پایین (*pady*) ابزارک، به‌صورت " +"یک فاصله‌ی صفحه‌ای یا جفتی از دو فاصله برای دو طرف (پیش‌فرض ``0``)." msgid "*after*" -msgstr "" +msgstr "*بعد*" -msgid "Pack the widget after the given widget in the packing order, using the same container." -msgstr "" +msgid "" +"Pack the widget after the given widget in the packing order, using the same " +"container." +msgstr "ابزارک را پس از ابزارک داده‌شده در ترتیب چیدمان، با استفاده از همان ظرف بچینید." msgid "*before*" -msgstr "" +msgstr "*قبل*" -msgid "Pack the widget before the given widget in the packing order, using the same container." -msgstr "" +msgid "" +"Pack the widget before the given widget in the packing order, using the same " +"container." +msgstr "ابزارک را پیش از ابزارک داده‌شده در ترتیب چیدمان، با استفاده از همان ظرف بچینید." msgid "*in_*" -msgstr "" +msgstr "*in_*" msgid "The container in which to pack the widget; it defaults to the parent widget." -msgstr "" +msgstr "ظرفی که ابزارک در آن بسته‌بندی (pack) می‌شود؛ مقدار پیش‌فرض آن ابزارک والد است." -msgid ":meth:`pack`, :meth:`configure` and :meth:`config` are aliases of :meth:`!pack_configure`." +msgid "" +":meth:`pack`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"pack_configure`." msgstr "" +":meth:`pack`، :meth:`configure` و :meth:`config` نام‌های مستعار :meth:`!" +"pack_configure` هستند." -msgid "Unmap the widget and remove it from the packing order, forgetting its packing options. It can be packed again later with :meth:`pack_configure`. :meth:`forget` is an alias of :meth:`!pack_forget`, except on :class:`PanedWindow`, :class:`ttk.Notebook ` and :class:`ttk.PanedWindow `, which provide their own :meth:`!forget` method." -msgstr "" +msgid "" +"Unmap the widget and remove it from the packing order, forgetting its packing " +"options. It can be packed again later with :meth:`pack_configure`. :meth:`forget` is " +"an alias of :meth:`!pack_forget`, except " +"on :class:`PanedWindow`, :class:`ttk.Notebook ` " +"and :class:`ttk.PanedWindow `, which provide their " +"own :meth:`!forget` method." +msgstr "" +"ابزارک را از نمایش برمی‌دارد و آن را از ترتیب pack حذف می‌کند و گزینه‌های pack آن را " +"فراموش می‌کند. بعداً می‌توان آن را دوباره با :meth:`pack_configure` pack " +"کرد. :meth:`forget` نام مستعار :meth:`!pack_forget` است، به جز " +"در :class:`PanedWindow`، :class:`ttk.Notebook ` " +"و :class:`ttk.PanedWindow ` که متد :meth:`!forget` خود را " +"ارائه می‌دهند." msgid "Not to be confused with :meth:`Wm.forget`." -msgstr "" +msgstr "با :meth:`Wm.forget` اشتباه گرفته نشود." -msgid "Return a dictionary of the widget's current packing options. :meth:`info` is an alias of :meth:`!pack_info`." +msgid "" +"Return a dictionary of the widget's current packing options. :meth:`info` is an " +"alias of :meth:`!pack_info`." msgstr "" +"یک دیکشنری از گزینه‌های فعلی بسته‌بندی (packing) ابزارک (widget) " +"برمی‌گرداند. :meth:`info` یک نام مستعار برای :meth:`!pack_info` است." -msgid "Same as :meth:`Misc.pack_propagate`, treating this widget as a container: enable or disable geometry propagation. :meth:`propagate` is an alias of :meth:`!pack_propagate`." +msgid "" +"Same as :meth:`Misc.pack_propagate`, treating this widget as a container: enable or " +"disable geometry propagation. :meth:`propagate` is an alias of :meth:`!" +"pack_propagate`." msgstr "" +"مانند :meth:`Misc.pack_propagate`، با در نظر گرفتن این ابزارک به‌عنوان یک ظرف: فعال " +"یا غیرفعال کردن انتشار هندسه. :meth:`propagate` نام مستعاری از :meth:`!" +"pack_propagate` است." -msgid "Same as :meth:`Misc.pack_slaves`: return the list of widgets packed in this widget. :meth:`slaves` is an alias of :meth:`!pack_slaves`." +msgid "" +"Same as :meth:`Misc.pack_slaves`: return the list of widgets packed in this " +"widget. :meth:`slaves` is an alias of :meth:`!pack_slaves`." msgstr "" +"مشابه :meth:`Misc.pack_slaves`: فهرست ابزارک‌های جاسازی‌شده در این ابزارک را " +"برمی‌گرداند. :meth:`slaves` نام مستعاری از :meth:`!pack_slaves` است." -msgid "Geometry manager that places widgets at explicit positions and sizes within their container. The :class:`!Place` mix-in is inherited by all widgets (through :class:`Widget`). See also :ref:`tkinter-geometry-management`." +msgid "" +"Geometry manager that places widgets at explicit positions and sizes within their " +"container. The :class:`!Place` mix-in is inherited by all widgets " +"(through :class:`Widget`). See also :ref:`tkinter-geometry-management`." msgstr "" +"مدیر چیدمانی که ابزارک‌ها را در موقعیت‌ها و اندازه‌های مشخص درون ظرفشان قرار می‌دهد. همه " +"ابزارک‌ها (از طریق :class:`Widget `) از کلاس میکس‌این :class:`!Place " +"` ارث می‌برند. همچنین ببینید :ref:`tkinter-geometry-management`." -msgid "Place the widget inside its container at an absolute or relative position. The supported options are:" +msgid "" +"Place the widget inside its container at an absolute or relative position. The " +"supported options are:" msgstr "" +"ابزارک را درون ظرف خود در یک موقعیت مطلق یا نسبی قرار دهید. گزینه‌های پشتیبانی‌شده " +"عبارتند از:" msgid "*x*, *y*" -msgstr "" +msgstr "*x*, *y*" -msgid "The absolute horizontal and vertical position of the widget's anchor point, as a screen distance (default ``0``)." -msgstr "" +msgid "" +"The absolute horizontal and vertical position of the widget's anchor point, as a " +"screen distance (default ``0``)." +msgstr "موقعیت مطلق افقی و عمودی نقطه‌ی لنگر ابزارک، به‌صورت فاصله‌ی صفحه (پیش‌فرض ``0``)." msgid "*relx*, *rely*" -msgstr "" +msgstr "*relx*, *rely*" -msgid "The horizontal and vertical position of the widget's anchor point as a fraction of the container's width and height, where ``0.0`` is the left or top edge and ``1.0`` is the right or bottom edge. If both the absolute and the relative option are given, their values are summed." +msgid "" +"The horizontal and vertical position of the widget's anchor point as a fraction of " +"the container's width and height, where ``0.0`` is the left or top edge and ``1.0`` " +"is the right or bottom edge. If both the absolute and the relative option are given, " +"their values are summed." msgstr "" +"موقعیت افقی و عمودی نقطه‌ی لنگر ابزارک به‌صورت کسری از عرض و ارتفاع ظرف، که در آن ``0.0`` " +"لبه‌ی چپ یا بالا و ``1.0`` لبه‌ی راست یا پایین است. اگر هر دو گزینه‌ی مطلق و نسبی داده " +"شوند، مقادیر آن‌ها با هم جمع می‌شوند." -msgid "Which point of the widget is placed at the given position: an anchor such as ``'n'`` or ``'se'`` (default ``'nw'``)." +msgid "" +"Which point of the widget is placed at the given position: an anchor such as ``'n'`` " +"or ``'se'`` (default ``'nw'``)." msgstr "" +"اینکه کدام نقطه از ابزارک (widget) در موقعیت داده‌شده قرار می‌گیرد: یک لنگر (anchor) " +"مانند ``'n'`` یا ``'se'`` (پیش‌فرض ``'nw'``)." msgid "*width*, *height*" -msgstr "" +msgstr "*عرض*، *ارتفاع*" -msgid "The absolute width and height of the widget, as a screen distance. By default the widget's requested size is used." +msgid "" +"The absolute width and height of the widget, as a screen distance. By default the " +"widget's requested size is used." msgstr "" +"عرض و ارتفاع مطلق ابزارک، به‌صورت فاصله‌ای روی صفحه. به‌طور پیش‌فرض، از اندازه درخواستی " +"ابزارک استفاده می‌شود." msgid "*relwidth*, *relheight*" -msgstr "" +msgstr "*relwidth*, *relheight*" -msgid "The width and height of the widget as a fraction of the container's width and height. If both the absolute and the relative option are given, their values are summed." +msgid "" +"The width and height of the widget as a fraction of the container's width and " +"height. If both the absolute and the relative option are given, their values are " +"summed." msgstr "" +"عرض و ارتفاع ابزارک به‌صورت کسری از عرض و ارتفاع ظرف. اگر هر دو گزینه‌ی مطلق و نسبی " +"داده شوند، مقادیر آن‌ها با هم جمع می‌شوند." msgid "*bordermode*" -msgstr "" +msgstr "*bordermode*" -msgid "How the container's border affects placement: ``'inside'`` (the default) measures the area inside the border, ``'outside'`` measures the area including the border, and ``'ignore'`` uses the official X area." +msgid "" +"How the container's border affects placement: ``'inside'`` (the default) measures " +"the area inside the border, ``'outside'`` measures the area including the border, " +"and ``'ignore'`` uses the official X area." msgstr "" +"چگونگی تأثیر حاشیه‌ی محفظه بر جای‌گذاری: ``'inside'`` (پیش‌فرض) ناحیه‌ی درون حاشیه را " +"اندازه‌گیری می‌کند، ``'outside'`` ناحیه‌ی شامل حاشیه را اندازه‌گیری می‌کند، و ``'ignore'`` " +"از ناحیه‌ی رسمی X استفاده می‌کند." -msgid "The container relative to which the widget is placed; it must be the widget's parent or a descendant of the parent, and defaults to the parent." +msgid "" +"The container relative to which the widget is placed; it must be the widget's parent " +"or a descendant of the parent, and defaults to the parent." msgstr "" +"ظرف (container) که ابزارک (widget) نسبت به آن جای‌گذاری می‌شود؛ باید والد ابزارک یا یکی از " +"نوادگان والد باشد و مقدار پیش‌فرض آن والد است." -msgid ":meth:`place`, :meth:`configure` and :meth:`config` are aliases of :meth:`!place_configure`." +msgid "" +":meth:`place`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"place_configure`." msgstr "" +":meth:`place`، :meth:`configure` و :meth:`config` نام‌های مستعار :meth:`!" +"place_configure` هستند." -msgid "Unmap the widget and remove it from the placement, forgetting its place options." +msgid "" +"Unmap the widget and remove it from the placement, forgetting its place options." msgstr "" +"ابزارک را از نگاشت خارج می‌کند و آن را از جای‌گذاری حذف می‌کند، به‌طوری‌که گزینه‌های " +"جای‌گذاری آن فراموش می‌شوند." msgid "Return a dictionary of the widget's current place options." -msgstr "" +msgstr "یک دیکشنری از گزینه‌های جاری place ابزارک برمی‌گرداند." -msgid "Same as :meth:`Misc.place_slaves`: return the list of widgets placed in this widget." +msgid "" +"Same as :meth:`Misc.place_slaves`: return the list of widgets placed in this widget." msgstr "" +"مشابه :meth:`Misc.place_slaves`: فهرست ابزارک‌های قرار گرفته در این ابزارک را برمی‌گرداند." -msgid "Geometry manager that arranges widgets in a two-dimensional grid of rows and columns within their container. The :class:`!Grid` mix-in is inherited by all widgets (through :class:`Widget`). See also :ref:`tkinter-geometry-management`." +msgid "" +"Geometry manager that arranges widgets in a two-dimensional grid of rows and columns " +"within their container. The :class:`!Grid` mix-in is inherited by all widgets " +"(through :class:`Widget`). See also :ref:`tkinter-geometry-management`." msgstr "" +"مدیر چیدمانی که ابزارک‌ها را در یک شبکه‌ی دوبعدی از ردیف‌ها و ستون‌ها درون ظرف آن‌ها " +"می‌چیند. همه‌ی ابزارک‌ها میکس‌این :class:`!Grid` را (از طریق :class:`Widget`) " +"به ارث می‌برند. همچنین :ref:`tkinter-geometry-management` را ببینید." msgid "Position the widget in a cell of its container's grid." -msgstr "" +msgstr "ابزارک را در یک خانه از شبکه‌ی ظرف خود قرار می‌دهد." msgid "Not to be confused with :meth:`Wm.grid`." -msgstr "" +msgstr "با :meth:`Wm.grid` اشتباه گرفته نشود." msgid "The supported options are:" -msgstr "" +msgstr "گزینه‌های پشتیبانی‌شده عبارتند از:" msgid "*row*, *column*" -msgstr "" +msgstr "*ردیف*، *ستون*" -msgid "The row and column of the cell to place the widget in, counting from ``0``. *column* defaults to the column after the previous widget placed in the same :meth:`!grid_configure` call (or ``0``), and *row* defaults to the next empty row." +msgid "" +"The row and column of the cell to place the widget in, counting from ``0``. *column* " +"defaults to the column after the previous widget placed in the same :meth:`!" +"grid_configure` call (or ``0``), and *row* defaults to the next empty row." msgstr "" +"ردیف و ستون سلولی که ابزارک (widget) در آن قرار می‌گیرد، از ``0`` شمرده می‌شود. *column* " +"به‌طور پیش‌فرض برابر با ستون پس از ابزارک قبلی قرار داده‌شده در همان فراخوانی :meth:`!" +"grid_configure` (یا ``0``) است، و *row* به‌طور پیش‌فرض برابر با ردیف خالی بعدی است." msgid "*rowspan*, *columnspan*" -msgstr "" +msgstr "*rowspan*, *columnspan*" msgid "The number of rows and columns the widget should span (default ``1``)." -msgstr "" +msgstr "تعداد ردیف‌ها و ستون‌هایی که ابزارک باید در بر بگیرد (پیش‌فرض ``1``)." msgid "*sticky*" -msgstr "" +msgstr "*چسبنده*" -msgid "How to position or stretch the widget when its cell is larger than the widget: a string containing zero or more of the characters ``'n'``, ``'s'``, ``'e'`` and ``'w'``, naming the cell sides the widget sticks to. Specifying both ``'n'`` and ``'s'`` (or ``'e'`` and ``'w'``) stretches the widget to fill the height (or width) of the cell. The default is ``''``, which centers the widget at its requested size." -msgstr "" +msgid "" +"How to position or stretch the widget when its cell is larger than the widget: a " +"string containing zero or more of the characters ``'n'``, ``'s'``, ``'e'`` and " +"``'w'``, naming the cell sides the widget sticks to. Specifying both ``'n'`` and " +"``'s'`` (or ``'e'`` and ``'w'``) stretches the widget to fill the height (or width) " +"of the cell. The default is ``''``, which centers the widget at its requested size." +msgstr "" +"نحوه‌ی قرار دادن یا کشیدن ابزارک هنگامی که سلول آن بزرگ‌تر از ابزارک است: رشته‌ای شامل " +"صفر یا چند تا از نویسه‌های ``'n'``، ``'s'``، ``'e'`` و ``'w'`` که اضلاع سلول را که " +"ابزارک به آن‌ها می‌چسبد مشخص می‌کند. مشخص کردن هر دو ``'n'`` و ``'s'`` (یا ``'e'`` و " +"``'w'``) باعث می‌شود ابزارک کشیده شود تا ارتفاع (یا عرض) سلول را پر کند. مقدار پیش‌فرض " +"``''`` است که ابزارک را در اندازه‌ی درخواستی آن در مرکز قرار می‌دهد." -msgid "The container in whose grid to place the widget; it defaults to the parent widget." +msgid "" +"The container in whose grid to place the widget; it defaults to the parent widget." msgstr "" +"ظرف (container) که ابزارک (widget) در شبکه‌ی آن قرار می‌گیرد؛ به‌طور پیش‌فرض، ابزارک والد است." -msgid ":meth:`grid`, :meth:`configure` and :meth:`config` are aliases of :meth:`!grid_configure`." +msgid "" +":meth:`grid`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"grid_configure`." msgstr "" +":meth:`grid`، :meth:`configure` و :meth:`config` نام‌های مستعار :meth:`!" +"grid_configure` هستند." msgid "Unmap the widget and remove it from the grid, forgetting its grid options." msgstr "" +"ابزارک را از نگاشت خارج کرده و آن را از شبکه حذف می‌کند، گزینه‌های شبکه آن را نیز " +"فراموش می‌کند." -msgid "Unmap the widget and remove it from the grid, but remember its grid options so that it is restored to the same cell if it is gridded again." +msgid "" +"Unmap the widget and remove it from the grid, but remember its grid options so that " +"it is restored to the same cell if it is gridded again." msgstr "" +"نگاشت ابزارک را لغو کرده و آن را از شبکه حذف می‌کند، اما گزینه‌های شبکه‌ی آن را به خاطر " +"می‌سپارد تا در صورت قرارگیری مجدد در شبکه، به همان سلول بازگردانده شود." msgid "Return a dictionary of the widget's current grid options." -msgstr "" +msgstr "یک دیکشنری از گزینه‌های فعلی شبکه‌بندی (grid) ابزارک برمی‌گرداند." -msgid "Same as :meth:`Misc.grid_bbox`. :meth:`bbox` is an alias of :meth:`!grid_bbox`, except on :class:`Canvas`, :class:`Listbox`, :class:`Spinbox`, :class:`Text`, :class:`ttk.Entry ` and :class:`ttk.Treeview `, which provide their own :meth:`!bbox` method." -msgstr "" +msgid "" +"Same as :meth:`Misc.grid_bbox`. :meth:`bbox` is an alias of :meth:`!grid_bbox`, " +"except " +"on :class:`Canvas`, :class:`Listbox`, :class:`Spinbox`, :class:`Text`, :class:`ttk.Entry " +"` and :class:`ttk.Treeview `, which provide " +"their own :meth:`!bbox` method." +msgstr "" +"مشابه :meth:`Misc.grid_bbox`. :meth:`bbox` نام مستعاری از :meth:`!grid_bbox` است، " +"به‌جز " +"در :class:`Canvas`، :class:`Listbox`، :class:`Spinbox`، :class:`Text`، :class:`ttk.Entry " +"` و :class:`ttk.Treeview `، که متد :meth:`!" +"bbox` خود را ارائه می‌دهند." -msgid "Same as :meth:`Misc.grid_columnconfigure`: query or set the options (such as *weight*, *minsize*, *pad* and *uniform*) of a grid column. :meth:`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." +msgid "" +"Same as :meth:`Misc.grid_columnconfigure`: query or set the options (such as " +"*weight*, *minsize*, *pad* and *uniform*) of a grid column. :meth:`columnconfigure` " +"is an alias of :meth:`!grid_columnconfigure`." msgstr "" +"همانند :meth:`Misc.grid_columnconfigure`: گزینه‌های یک ستون شبکه (مانند *weight*، " +"*minsize*، *pad* و *uniform*) را پرس‌وجو یا تنظیم می‌کند. :meth:`columnconfigure` نام " +"مستعاری از :meth:`!grid_columnconfigure` است." -msgid "Same as :meth:`Misc.grid_rowconfigure`: query or set the options of a grid row. :meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." +msgid "" +"Same as :meth:`Misc.grid_rowconfigure`: query or set the options of a grid " +"row. :meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." msgstr "" +"مشابه :meth:`Misc.grid_rowconfigure`: گزینه‌های یک ردیف شبکه را پرس‌وجو یا تنظیم " +"می‌کند. :meth:`rowconfigure` نام مستعاری از :meth:`!grid_rowconfigure` است." -msgid "Same as :meth:`Misc.grid_location`: return the ``(column, row)`` of the cell that covers the pixel at *x*, *y*. :meth:`location` is an alias of :meth:`!grid_location`." +msgid "" +"Same as :meth:`Misc.grid_location`: return the ``(column, row)`` of the cell that " +"covers the pixel at *x*, *y*. :meth:`location` is an alias of :meth:`!grid_location`." msgstr "" +"مشابه :meth:`Misc.grid_location`: ``(column, row)`` سلولی را که پیکسل در *x*، *y* را " +"می‌پوشاند برمی‌گرداند. :meth:`location` نام مستعاری از :meth:`!grid_location` است." -msgid "Same as :meth:`Misc.grid_size`: return a ``(columns, rows)`` tuple giving the size of the grid. :meth:`size` is an alias of :meth:`!grid_size`, except on the :class:`Listbox` widget, which provides its own :meth:`!size` method." +msgid "" +"Same as :meth:`Misc.grid_size`: return a ``(columns, rows)`` tuple giving the size " +"of the grid. :meth:`size` is an alias of :meth:`!grid_size`, except on " +"the :class:`Listbox` widget, which provides its own :meth:`!size` method." msgstr "" +"مانند :meth:`Misc.grid_size`: یک تاپل ``(columns, rows)`` برمی‌گرداند که اندازه‌ی شبکه " +"را نشان می‌دهد. :meth:`size` یک نام مستعار برای :meth:`!grid_size` است، به‌جز در " +"ابزارک :class:`Listbox`، که متد :meth:`!size` خود را ارائه می‌دهد." msgid "Same as :meth:`Misc.grid_propagate`." -msgstr "" +msgstr "همان :meth:`Misc.grid_propagate` است." -msgid "Same as :meth:`Misc.grid_slaves`: return the widgets managed in the grid, optionally restricted to a *row* and/or *column*." +msgid "" +"Same as :meth:`Misc.grid_slaves`: return the widgets managed in the grid, optionally " +"restricted to a *row* and/or *column*." msgstr "" +"همانند :meth:`Misc.grid_slaves`: ابزارک‌های مدیریت‌شده در شبکه را بازمی‌گرداند، که " +"به‌صورت اختیاری به یک *ردیف* و/یا *ستون* محدود شده‌اند." -msgid "Mix-in providing the horizontal-scrolling interface shared by widgets such as :class:`Entry`, :class:`Canvas`, :class:`Listbox`, :class:`Text` and :class:`Spinbox`. A widget's :meth:`xview` method is registered as the *command* of a horizontal :class:`Scrollbar`." +msgid "" +"Mix-in providing the horizontal-scrolling interface shared by widgets such " +"as :class:`Entry`, :class:`Canvas`, :class:`Listbox`, :class:`Text` " +"and :class:`Spinbox`. A widget's :meth:`xview` method is registered as the *command* " +"of a horizontal :class:`Scrollbar`." msgstr "" +"میکس‌اینکه رابط پیمایش افقی مشترک میان ابزارک‌هایی " +"مانند :class:`Entry`، :class:`Canvas`، :class:`Listbox`، :class:`Text` " +"و :class:`Spinbox` را فراهم می‌کند. متد :meth:`xview` یک ابزارک به‌عنوان *command* " +"یک :class:`Scrollbar` افقی ثبت می‌شود." -msgid "Query or change the horizontal position of the view. With no arguments, return a tuple ``(first, last)`` of two fractions between 0 and 1 giving the portion of the document that is currently visible. Otherwise the arguments are passed to the Tk ``xview`` widget command and are usually generated by a scrollbar; :meth:`xview_moveto` and :meth:`xview_scroll` provide a more convenient interface." -msgstr "" +msgid "" +"Query or change the horizontal position of the view. With no arguments, return a " +"tuple ``(first, last)`` of two fractions between 0 and 1 giving the portion of the " +"document that is currently visible. Otherwise the arguments are passed to the Tk " +"``xview`` widget command and are usually generated by a " +"scrollbar; :meth:`xview_moveto` and :meth:`xview_scroll` provide a more convenient " +"interface." +msgstr "" +"موقعیت افقی نما را دریافت یا تغییر می‌دهد. بدون آرگومان، یک تاپل ``(first, last)`` از " +"دو کسر بین ۰ و ۱ برمی‌گرداند که بخشی از سند را که در حال حاضر قابل مشاهده است، نشان " +"می‌دهند. در غیر این صورت، آرگومان‌ها به فرمان ابزارک ``xview`` در Tk ارسال می‌شوند و " +"معمولاً توسط یک نوار پیمایش تولید می‌شوند؛ :meth:`xview_moveto` و :meth:`xview_scroll` " +"رابط آسان‌تری فراهم می‌کنند." -msgid "Adjust the view so that *fraction* of the total width of the document is off-screen to the left. *fraction* is a number between 0 and 1." +msgid "" +"Adjust the view so that *fraction* of the total width of the document is off-screen " +"to the left. *fraction* is a number between 0 and 1." msgstr "" +"نما را به‌گونه‌ای تنظیم کنید که *fraction* از عرض کل سند در سمت چپ، خارج از صفحه قرار " +"گیرد. *fraction* عددی بین ۰ و ۱ است." -msgid "Shift the view left or right by *number* units. *what* is either ``'units'`` or ``'pages'``; a negative *number* scrolls left and a positive one scrolls right." +msgid "" +"Shift the view left or right by *number* units. *what* is either ``'units'`` or " +"``'pages'``; a negative *number* scrolls left and a positive one scrolls right." msgstr "" +"نما را به اندازه‌ی *number* واحد به چپ یا راست جابه‌جا کنید. *what* می‌تواند ``'units'`` " +"یا ``'pages'`` باشد؛ *number* منفی باعث پیمایش به چپ و *number* مثبت باعث پیمایش به " +"راست می‌شود." -msgid "Mix-in providing the vertical-scrolling interface shared by widgets such as :class:`Canvas`, :class:`Listbox` and :class:`Text`. A widget's :meth:`yview` method is registered as the *command* of a vertical :class:`Scrollbar`." +msgid "" +"Mix-in providing the vertical-scrolling interface shared by widgets such " +"as :class:`Canvas`, :class:`Listbox` and :class:`Text`. A widget's :meth:`yview` " +"method is registered as the *command* of a vertical :class:`Scrollbar`." msgstr "" +"میکس‌اینرابط پیمایش عمودی مشترک میان ابزارک‌هایی " +"مانند :class:`Canvas`، :class:`Listbox` و :class:`Text` را فراهم می‌کند. " +"متد :meth:`yview` یک ابزارک به‌عنوان *فرمان* یک :class:`Scrollbar` عمودی ثبت می‌شود." -msgid "Query or change the vertical position of the view. With no arguments, return a tuple ``(first, last)`` of two fractions between 0 and 1 giving the portion of the document that is currently visible. Otherwise the arguments are passed to the Tk ``yview`` widget command, usually generated by a scrollbar; :meth:`yview_moveto` and :meth:`yview_scroll` provide a more convenient interface." -msgstr "" +msgid "" +"Query or change the vertical position of the view. With no arguments, return a tuple " +"``(first, last)`` of two fractions between 0 and 1 giving the portion of the " +"document that is currently visible. Otherwise the arguments are passed to the Tk " +"``yview`` widget command, usually generated by a scrollbar; :meth:`yview_moveto` " +"and :meth:`yview_scroll` provide a more convenient interface." +msgstr "" +"موقعیت عمودی نما را پرس‌وجو می‌کند یا تغییر می‌دهد. بدون آرگومان، یک تاپل ``(first, " +"last)`` از دو کسر بین ۰ و ۱ برمی‌گرداند که نشان‌دهنده‌ی بخشی از سند است که در حال حاضر " +"قابل مشاهده است. در غیر این صورت، آرگومان‌ها، که معمولاً توسط نوار لغزش تولید می‌شوند، " +"به فرمان ``yview`` ابزارک Tk ارسال می‌شوند؛ :meth:`yview_moveto` و :meth:`yview_scroll` " +"رابط آسان‌تری فراهم می‌کنند." -msgid "Adjust the view so that *fraction* of the total height of the document is off-screen above the top. *fraction* is a number between 0 and 1." +msgid "" +"Adjust the view so that *fraction* of the total height of the document is off-screen " +"above the top. *fraction* is a number between 0 and 1." msgstr "" +"نما را طوری تنظیم کنید که *fraction* از ارتفاع کل سند در بالای صفحه خارج از دید " +"باشد. *fraction* عددی بین ۰ و ۱ است." -msgid "Shift the view up or down by *number* units. *what* is either ``'units'`` or ``'pages'``; a negative *number* scrolls up and a positive one scrolls down." +msgid "" +"Shift the view up or down by *number* units. *what* is either ``'units'`` or " +"``'pages'``; a negative *number* scrolls up and a positive one scrolls down." msgstr "" +"نما را به اندازه‌ی *number* واحد به بالا یا پایین جابه‌جا کنید. *what* یکی از " +"``'units'`` یا ``'pages'`` است؛ *number* منفی به بالا پیمایش می‌کند و مقدار مثبت به " +"پایین پیمایش می‌کند." -msgid "Internal base class for all widgets. It inherits from :class:`Misc` and adds the machinery that creates the underlying Tk widget; application code normally uses :class:`Widget` or a concrete widget class rather than instantiating :class:`!BaseWidget` directly." +msgid "" +"Internal base class for all widgets. It inherits from :class:`Misc` and adds the " +"machinery that creates the underlying Tk widget; application code normally " +"uses :class:`Widget` or a concrete widget class rather than instantiating :class:`!" +"BaseWidget` directly." msgstr "" +"کلاس پایه‌ی داخلی برای همه‌ی ویدجت‌ها. این کلاس از :class:`Misc` ارث‌بری می‌کند و سازوکار " +"ایجاد ابزارک Tk زیربنایی را می‌افزاید؛ کد برنامه معمولاً به‌جای نمونه‌سازی " +"مستقیم :class:`!BaseWidget ` از :class:`Widget ` یا یک کلاس " +"ابزارک مشخص استفاده می‌کند." -msgid "Destroy this widget and all of its children, removing the corresponding Tk widgets and deleting the associated Tcl commands." +msgid "" +"Destroy this widget and all of its children, removing the corresponding Tk widgets " +"and deleting the associated Tcl commands." msgstr "" +"این ابزارک و تمام فرزندان آن را نابود می‌کند، ابزارک‌های Tk مربوطه را حذف می‌کند و دستورات " +"Tcl مرتبط را حذف می‌کند." -msgid "Internal base class for the standard widgets. It combines :class:`BaseWidget` with the geometry-manager mix-ins :class:`Pack`, :class:`Place` and :class:`Grid`, so that every widget can be managed by any of the three geometry managers. The concrete widget classes (:class:`Button`, :class:`Label`, and so on) derive from :class:`!Widget`." -msgstr "" +msgid "" +"Internal base class for the standard widgets. It combines :class:`BaseWidget` with " +"the geometry-manager mix-ins :class:`Pack`, :class:`Place` and :class:`Grid`, so " +"that every widget can be managed by any of the three geometry managers. The concrete " +"widget classes (:class:`Button`, :class:`Label`, and so on) derive from :class:`!" +"Widget`." +msgstr "" +"کلاس پایه داخلی برای ابزارک‌های استاندارد. این کلاس، :class:`BaseWidget` را با " +"کلاس‌های میکس‌این مدیر چیدمانیعنی :class:`Pack`، :class:`Place` " +"و :class:`Grid` ترکیب می‌کند تا هر ابزارک بتواند توسط هر یک از سه مدیر چیدمان مدیریت " +"شود. کلاس‌های ابزارک عینی (:class:`Button`، :class:`Label` و غیره) از :class:`!" +"Widget` مشتق می‌شوند." msgid "Toplevel widgets" -msgstr "" +msgstr "ابزارک‌های Toplevel" -msgid "Construct a toplevel Tk widget, which is usually the main window of an application, and initialize a Tcl interpreter for this widget. Each instance has its own associated Tcl interpreter. Inherits from :class:`Misc` and :class:`Wm`." +msgid "" +"Construct a toplevel Tk widget, which is usually the main window of an application, " +"and initialize a Tcl interpreter for this widget. Each instance has its own " +"associated Tcl interpreter. Inherits from :class:`Misc` and :class:`Wm`." msgstr "" +"یک ابزارک Tk سطح بالا می‌سازد، که معمولاً پنجره‌ی اصلی یک برنامه است، و یک مفسر Tcl " +"برای این ابزارک راه‌اندازی می‌کند. هر نمونه، مفسر Tcl مرتبط با خود را دارد. " +"از :class:`Misc` و :class:`Wm` ارث می‌برد." -msgid "To create a Tcl interpreter without initializing the Tk subsystem, use the :func:`Tcl` factory function instead." +msgid "" +"To create a Tcl interpreter without initializing the Tk subsystem, use " +"the :func:`Tcl` factory function instead." msgstr "" +"برای ایجاد یک مفسر Tcl بدون مقداردهی اولیه‌ی زیرسیستم Tk، به‌جای آن از تابع " +"کارخانه‌ی :func:`Tcl` استفاده کنید." -msgid "The :class:`Tk` class is typically instantiated using all default values. However, the following keyword arguments are currently recognized:" +msgid "" +"The :class:`Tk` class is typically instantiated using all default values. However, " +"the following keyword arguments are currently recognized:" msgstr "" +"کلاس :class:`Tk` معمولاً با استفاده از تمام مقادیر پیش‌فرض نمونه‌سازی می‌شود. با این " +"حال، آرگومان‌های کلیدواژه‌ای زیر در حال حاضر شناسایی می‌شوند:" msgid "*screenName*" -msgstr "" +msgstr "*screenName*" -msgid "When given (as a string), sets the :envvar:`DISPLAY` environment variable. (X11 only)" +msgid "" +"When given (as a string), sets the :envvar:`DISPLAY` environment variable. (X11 only)" msgstr "" +"هنگامی که (به‌صورت یک رشته) داده شود، متغیر محیطی :envvar:`DISPLAY` را تنظیم می‌کند. " +"(فقط X11)" msgid "*baseName*" -msgstr "" +msgstr "*baseName*" -msgid "Name of the profile file. By default, *baseName* is derived from the program name (``sys.argv[0]``)." +msgid "" +"Name of the profile file. By default, *baseName* is derived from the program name " +"(``sys.argv[0]``)." msgstr "" +"نام فایل پروفایل. به‌طور پیش‌فرض، *baseName* از نام برنامه (``sys.argv[0]``) گرفته " +"می‌شود." msgid "*className*" -msgstr "" +msgstr "*className*" -msgid "Name of the widget class. Used as a profile file and also as the name with which Tcl is invoked (*argv0* in *interp*)." +msgid "" +"Name of the widget class. Used as a profile file and also as the name with which " +"Tcl is invoked (*argv0* in *interp*)." msgstr "" +"نام کلاس ابزارک. به‌عنوان فایل پروفایل و همچنین به‌عنوان نامی که Tcl با آن فراخوانی " +"می‌شود (*argv0* در *interp*) استفاده می‌شود." msgid "*useTk*" -msgstr "" +msgstr "*useTk*" -msgid "If ``True``, initialize the Tk subsystem. The :func:`tkinter.Tcl() ` function sets this to ``False``." +msgid "" +"If ``True``, initialize the Tk subsystem. The :func:`tkinter.Tcl() ` function " +"sets this to ``False``." msgstr "" +"اگر ``True`` باشد، زیرسیستم Tk را راه‌اندازی می‌کند. تابع :func:`tkinter.Tcl() ` " +"این را روی ``False`` قرار می‌دهد." msgid "*sync*" -msgstr "" +msgstr "*همگام*" -msgid "If ``True``, execute all X server commands synchronously, so that errors are reported immediately. Can be used for debugging. (X11 only)" +msgid "" +"If ``True``, execute all X server commands synchronously, so that errors are " +"reported immediately. Can be used for debugging. (X11 only)" msgstr "" +"اگر ``True`` باشد، تمام دستورات کارساز X به‌صورت همگام اجرا می‌شوند، به‌طوری که خطاها " +"بلافاصله گزارش می‌شوند. می‌توان از آن برای اشکال‌زدایی استفاده کرد. (فقط X11)" msgid "*use*" -msgstr "" +msgstr "*استفاده*" -msgid "Specifies the *id* of the window in which to embed the application, instead of it being created as an independent toplevel window. *id* must be specified in the same way as the value for the -use option for toplevel widgets (that is, it has a form like that returned by :meth:`~Misc.winfo_id`)." +msgid "" +"Specifies the *id* of the window in which to embed the application, instead of it " +"being created as an independent toplevel window. *id* must be specified in the same " +"way as the value for the -use option for toplevel widgets (that is, it has a form " +"like that returned by :meth:`~Misc.winfo_id`)." msgstr "" +"*id* پنجره‌ای را مشخص می‌کند که برنامه باید به جای ایجاد شدن به‌عنوان یک پنجره سطح " +"بالای مستقل، در آن جاسازی شود. *id* باید به همان شیوه‌ای مشخص شود که مقدار گزینه -use " +"برای ابزارک‌های سطح بالا مشخص می‌شود (یعنی شکلی مانند شکلی دارد که " +"توسط :meth:`~Misc.winfo_id` برگردانده می‌شود)." -msgid "Note that on some platforms this will only work correctly if *id* refers to a Tk frame or toplevel that has its -container option enabled." +msgid "" +"Note that on some platforms this will only work correctly if *id* refers to a Tk " +"frame or toplevel that has its -container option enabled." msgstr "" +"توجه داشته باشید که در برخی سکوها، این مورد تنها در صورتی به‌درستی کار می‌کند که *id* " +"به یک frame یا toplevel از Tk اشاره کند که گزینه‌ی -container آن فعال باشد." -msgid ":class:`Tk` reads and interprets profile files, named :file:`.{className}.tcl` and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:`exec` on the contents of :file:`.{className}.py` and :file:`.{baseName}.py`. The path for the profile files is the :envvar:`HOME` environment variable or, if that isn't defined, then :data:`os.curdir`." +msgid "" +":class:`Tk` reads and interprets profile files, named :file:`.{className}.tcl` " +"and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:`exec` on the " +"contents of :file:`.{className}.py` and :file:`.{baseName}.py`. The path for the " +"profile files is the :envvar:`HOME` environment variable or, if that isn't defined, " +"then :data:`os.curdir`." msgstr "" +":class:`Tk` فایل‌های پروفایل با نام‌های :file:`.{className}.tcl` و :file:`." +"{baseName}.tcl` را می‌خواند و آن‌ها را در مفسر Tcl تفسیر می‌کند و :func:`exec` را روی " +"محتوای :file:`.{className}.py` و :file:`.{baseName}.py` فراخوانی می‌کند. مسیر فایل‌های " +"پروفایل، متغیر محیطی :envvar:`HOME` است یا اگر تعریف‌نشده باشد، :data:`os.curdir` است." -msgid "On Windows, creating a Tcl interpreter (by instantiating :class:`Tk` or calling :func:`Tcl`) sets the :envvar:`HOME` environment variable for the process, if it is not already set, to ``%HOMEDRIVE%%HOMEPATH%`` (or :envvar:`USERPROFILE`, or ``c:\\``). This is done by Tcl and can affect other code that reads :envvar:`HOME`." +msgid "" +"On Windows, creating a Tcl interpreter (by instantiating :class:`Tk` or " +"calling :func:`Tcl`) sets the :envvar:`HOME` environment variable for the process, " +"if it is not already set, to ``%HOMEDRIVE%%HOMEPATH%`` (or :envvar:`USERPROFILE`, or " +"``c:\\``). This is done by Tcl and can affect other code that reads :envvar:`HOME`." msgstr "" +"در ویندوز، ایجاد یک مفسر Tcl (با ایجاد نمونه‌ای از :class:`Tk` یا " +"فراخوانی :func:`Tcl`) متغیر محیطی :envvar:`HOME` را برای فرایند، اگر از قبل تنظیم " +"نشده باشد، به ``%HOMEDRIVE%%HOMEPATH%`` (یا :envvar:`USERPROFILE`، یا ``c:\\``) " +"تنظیم می‌کند. این کار توسط Tcl انجام می‌شود و می‌تواند بر سایر کدهایی که :envvar:`HOME` " +"را می‌خوانند تأثیر بگذارد." -msgid "The Tk application object created by instantiating :class:`Tk`. This provides access to the Tcl interpreter. Each widget that is attached the same instance of :class:`Tk` has the same value for its :attr:`tk` attribute." +msgid "" +"The Tk application object created by instantiating :class:`Tk`. This provides " +"access to the Tcl interpreter. Each widget that is attached the same instance " +"of :class:`Tk` has the same value for its :attr:`tk` attribute." msgstr "" +"شیء برنامه‌ی Tk که با نمونه‌سازی از :class:`Tk` ایجاد شده است. این شیء دسترسی به مفسر " +"Tcl را فراهم می‌کند. هر ویدجتی که به همان نمونه از :class:`Tk` متصل باشد، مقدار " +"یکسانی برای ویژگی :attr:`tk` خود دارد." -msgid "The widget object that contains this widget. For :class:`Tk`, the :attr:`!master` is :const:`None` because it is the main window. The terms *master* and *parent* are similar and sometimes used interchangeably as argument names; however, calling :meth:`~Misc.winfo_parent` returns a string of the widget name whereas :attr:`!master` returns the object. *parent*/*child* reflects the tree-like relationship while *master* (or *container*)/*content* reflects the container structure." -msgstr "" +msgid "" +"The widget object that contains this widget. For :class:`Tk`, the :attr:`!master` " +"is :const:`None` because it is the main window. The terms *master* and *parent* are " +"similar and sometimes used interchangeably as argument names; however, " +"calling :meth:`~Misc.winfo_parent` returns a string of the widget name " +"whereas :attr:`!master` returns the object. *parent*/*child* reflects the tree-like " +"relationship while *master* (or *container*)/*content* reflects the container " +"structure." +msgstr "" +"شیء ابزارکی که این ابزارک را در بر می‌گیرد. برای :class:`Tk`، :attr:`!master` " +"برابر :const:`None` است، زیرا پنجره‌ی اصلی است. اصطلاحات *master* و *parent* مشابه‌اند " +"و گاهی به‌جای یکدیگر به‌عنوان نام آرگومان استفاده می‌شوند؛ با این حال، " +"فراخوانی :meth:`~Misc.winfo_parent` رشته‌ای از نام ابزارک را برمی‌گرداند، در حالی " +"که :attr:`!master` شیء را برمی‌گرداند. *parent*/*child* رابطه‌ی درخت‌مانند را بازتاب " +"می‌دهد، در حالی که *master* (یا *container*)/*content* ساختار ظرف را بازتاب می‌دهد." -msgid "The immediate descendants of this widget as a :class:`dict` with the child widget names as the keys and the child instance objects as the values." +msgid "" +"The immediate descendants of this widget as a :class:`dict` with the child widget " +"names as the keys and the child instance objects as the values." msgstr "" +"فرزندان مستقیم این ابزارک به‌صورت یک :class:`dict` با نام ابزارک‌های فرزند به‌عنوان کلیدها " +"و اشیای نمونه‌ی فرزند به‌عنوان مقدارها." -msgid "Destroy this and all descendant widgets and, for the main window, end the connection to the underlying Tcl interpreter." +msgid "" +"Destroy this and all descendant widgets and, for the main window, end the connection " +"to the underlying Tcl interpreter." msgstr "" +"این ابزارک و همه ابزارک‌های زیرمجموعه آن را نابود می‌کند و برای پنجره اصلی، اتصال به مفسر " +"Tcl زیرین را پایان می‌دهد." -msgid "Finish loading and initializing the Tk subsystem. This is needed only when the interpreter was created without Tk (for example through :func:`Tcl`); it is called automatically when *useTk* is true." +msgid "" +"Finish loading and initializing the Tk subsystem. This is needed only when the " +"interpreter was created without Tk (for example through :func:`Tcl`); it is called " +"automatically when *useTk* is true." msgstr "" +"بارگذاری و مقداردهی اولیه‌ی زیرسیستم Tk را به پایان می‌رساند. این متد تنها زمانی لازم " +"است که مفسر بدون Tk ایجاد شده باشد (برای مثال از طریق :func:`Tcl`)؛ وقتی *useTk* " +"برابر true باشد، به‌صورت خودکار فراخوانی می‌شود." -msgid "Read and source the user's profile files :file:`.{className}.tcl` and :file:`.{baseName}.tcl` into the Tcl interpreter, and execute the corresponding :file:`.{className}.py` and :file:`.{baseName}.py` files. This is called during initialization; see the description of the constructor above." +msgid "" +"Read and source the user's profile files :file:`.{className}.tcl` and :file:`." +"{baseName}.tcl` into the Tcl interpreter, and execute the corresponding :file:`." +"{className}.py` and :file:`.{baseName}.py` files. This is called during " +"initialization; see the description of the constructor above." msgstr "" +"فایل‌های پروفایل کاربر :file:`.{className}.tcl` و :file:`.{baseName}.tcl` را می‌خواند " +"و در مفسر Tcl بارگذاری (source) می‌کند و فایل‌های متناظر :file:`.{className}.py` " +"و :file:`.{baseName}.py` را اجرا می‌کند. این کار در هنگام مقداردهی اولیه فراخوانی " +"می‌شود؛ توضیح سازنده را در بالا ببینید." -msgid "Report a callback exception. This is called when an exception propagates out of a Tkinter callback; *exc*, *val* and *tb* are the exception type, value and traceback as returned by :func:`sys.exc_info`. The default implementation prints a traceback to :data:`sys.stderr`. It can be overridden to customize error handling, for example to display the traceback in a dialog." -msgstr "" +msgid "" +"Report a callback exception. This is called when an exception propagates out of a " +"Tkinter callback; *exc*, *val* and *tb* are the exception type, value and traceback " +"as returned by :func:`sys.exc_info`. The default implementation prints a traceback " +"to :data:`sys.stderr`. It can be overridden to customize error handling, for example " +"to display the traceback in a dialog." +msgstr "" +"یک استثنای کال‌بک را گزارش می‌دهد. این هنگامی فراخوانی می‌شود که یک استثنا از یک کال‌بک " +"Tkinter به بیرون منتشر شود؛ *exc*، *val* و *tb* نوع استثنا، مقدار و ردگیری پشته " +"هستند، همان‌گونه که :func:`sys.exc_info` برمی‌گرداند. پیاده‌سازی پیش‌فرض یک ردگیری پشته " +"را در :data:`sys.stderr` چاپ می‌کند. می‌توان آن را برای سفارشی‌سازی مدیریت خطا بازنویسی " +"کرد، برای مثال برای نمایش ردگیری پشته در یک پنجره‌ی محاوره‌ای." -msgid "A :class:`!Toplevel` widget is a top-level window, similar to a :class:`Frame` except that its X parent is the root window of a screen rather than its logical parent. Its primary purpose is to serve as a container for dialog boxes and other collections of widgets; its only visible features are its background and an optional 3-D border. Notable options include *menu*, which installs a :class:`Menu` as the window's menubar. Inherits from :class:`BaseWidget` and :class:`Wm`, so a toplevel is managed by the window manager. Refer to the Tk ``toplevel`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Toplevel` widget is a top-level window, similar to a :class:`Frame` " +"except that its X parent is the root window of a screen rather than its logical " +"parent. Its primary purpose is to serve as a container for dialog boxes and other " +"collections of widgets; its only visible features are its background and an optional " +"3-D border. Notable options include *menu*, which installs a :class:`Menu` as the " +"window's menubar. Inherits from :class:`BaseWidget` and :class:`Wm`, so a toplevel " +"is managed by the window manager. Refer to the Tk ``toplevel`` manual page for the " +"full list of options." +msgstr "" +"یک ابزارک :class:`!Toplevel` یک پنجره سطح‌بالا است، مشابه یک :class:`Frame` با این " +"تفاوت که والد X آن پنجره ریشه یک صفحه‌نمایش است، نه والد منطقی آن. هدف اصلی آن این " +"است که به‌عنوان ظرفی برای جعبه‌های محاوره و سایر مجموعه‌های ویدجت‌ها عمل کند؛ تنها " +"ویژگی‌های قابل مشاهده آن پس‌زمینه و یک حاشیه سه‌بعدی اختیاری است. از گزینه‌های قابل‌توجه " +"می‌توان به *menu* اشاره کرد که یک :class:`Menu` را به‌عنوان نوار منوی پنجره نصب می‌کند. " +"این ابزارک از :class:`BaseWidget` و :class:`Wm` ارث می‌برد، بنابراین یک پنجره سطح‌بالا " +"توسط مدیر پنجره مدیریت می‌شود. برای فهرست کامل گزینه‌ها، به صفحه راهنمای ``toplevel`` " +"در Tk مراجعه کنید." msgid "Widget classes" -msgstr "" +msgstr "کلاس‌های ابزارک" -msgid "A :class:`!Button` widget displays a textual string, bitmap or image and invokes a command when the user presses it (by clicking mouse button 1 over the button or, when the button has focus, by pressing the space key). Inherits from :class:`Widget`. In addition to the standard widget options, a button accepts the options documented in the Tk ``button`` manual page, such as *command* (the callback invoked when the button is pressed), *textvariable*, *state* and *default*." -msgstr "" +msgid "" +"A :class:`!Button` widget displays a textual string, bitmap or image and invokes a " +"command when the user presses it (by clicking mouse button 1 over the button or, " +"when the button has focus, by pressing the space key). Inherits " +"from :class:`Widget`. In addition to the standard widget options, a button accepts " +"the options documented in the Tk ``button`` manual page, such as *command* (the " +"callback invoked when the button is pressed), *textvariable*, *state* and *default*." +msgstr "" +"یک ابزارک :class:`!Button` یک رشته متنی، بیت‌مپ یا تصویر را نمایش می‌دهد و هنگامی که " +"کاربر آن را فشار دهد (با کلیک دکمه ۱ ماوس روی دکمه یا، هنگامی که دکمه تمرکز دارد، با " +"فشار دادن کلید فاصله)، یک فرمان را فراخوانی می‌کند. این ابزارک از :class:`Widget` ارث " +"می‌برد. علاوه بر گزینه‌های استاندارد ابزارک، یک دکمه گزینه‌هایی را می‌پذیرد که در صفحه " +"راهنمای ``button`` در Tk مستند شده‌اند، مانند *command* (کال‌بکی که هنگام فشار دادن " +"دکمه فراخوانی می‌شود)، *textvariable*، *state* و *default*." -msgid "Invoke the command associated with the button, if there is one, and return its result, or an empty string if no command is associated with the button. This is ignored if the button's state is ``disabled``." +msgid "" +"Invoke the command associated with the button, if there is one, and return its " +"result, or an empty string if no command is associated with the button. This is " +"ignored if the button's state is ``disabled``." msgstr "" +"فرمان مرتبط با دکمه را، در صورت وجود، فراخوانی کنید و نتیجه آن را برگردانید، یا اگر " +"فرمانی با دکمه مرتبط نباشد، یک رشته خالی برگردانید. اگر وضعیت دکمه ``disabled`` " +"باشد، این عمل نادیده گرفته می‌شود." -msgid "Flash the button by redisplaying it several times, alternating between the active and normal colors. At the end of the flash the button is left in the same normal or active state as when the method was called. This is ignored if the button's state is ``disabled``." +msgid "" +"Flash the button by redisplaying it several times, alternating between the active " +"and normal colors. At the end of the flash the button is left in the same normal or " +"active state as when the method was called. This is ignored if the button's state is " +"``disabled``." msgstr "" +"دکمه را با چند بار نمایش مجدد، بین رنگ‌های فعال و عادی به‌صورت متناوب چشمک بزنید. در " +"پایان چشمک، دکمه در همان وضعیت عادی یا فعالی باقی می‌ماند که هنگام فراخوانی متد داشت. " +"اگر وضعیت دکمه ``disabled`` باشد، این عمل نادیده گرفته می‌شود." -msgid "A :class:`!Canvas` widget implements structured graphics. It displays any number of *items*, such as arcs, lines, ovals, polygons, rectangles, text, bitmaps, images and embedded windows, which may be drawn, moved, re-colored and bound to events. Inherits from :class:`Widget`, :class:`XView` and :class:`YView`, so the view can be scrolled horizontally and vertically with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``canvas`` manual page for the full list of widget and item options." -msgstr "" +msgid "" +"A :class:`!Canvas` widget implements structured graphics. It displays any number of " +"*items*, such as arcs, lines, ovals, polygons, rectangles, text, bitmaps, images and " +"embedded windows, which may be drawn, moved, re-colored and bound to events. " +"Inherits from :class:`Widget`, :class:`XView` and :class:`YView`, so the view can be " +"scrolled horizontally and vertically with :meth:`~XView.xview` " +"and :meth:`~YView.yview`. Refer to the Tk ``canvas`` manual page for the full list " +"of widget and item options." +msgstr "" +"ابزارک :class:`!Canvas` گرافیک ساختاریافته را پیاده‌سازی می‌کند. این ابزارک هر تعداد " +"*آیتم* را نمایش می‌دهد، مانند کمان‌ها، خطوط، بیضی‌ها، چندضلعی‌ها، مستطیل‌ها، متن، " +"بیت‌مپ‌ها، تصاویر و پنجره‌های تعبیه‌شده، که می‌توان آن‌ها را ترسیم کرد، جابه‌جا کرد، تغییر " +"رنگ داد و به رویدادها متصل کرد. این ابزارک از :class:`Widget`، :class:`XView` " +"و :class:`YView` ارث می‌برد، بنابراین می‌توان نما را به‌صورت افقی و عمودی " +"با :meth:`~XView.xview` و :meth:`~YView.yview` پیمایش کرد. برای فهرست کامل گزینه‌های " +"ابزارک و آیتم، به صفحه راهنمای ``canvas`` در Tk مراجعه کنید." -msgid "Each item has a unique integer *id*, assigned when it is created, and zero or more string *tags*. A tag is an arbitrary string that does not have the form of an integer; the same tag may be shared by many items, which makes tags convenient for grouping items. The special tag ``'all'`` matches every item in the canvas, and ``'current'`` matches the topmost item under the mouse pointer. Most methods take a *tagOrId* argument that may be an integer id naming a single item, or a tag naming zero or more items; as described in the Tk ``canvas`` manual page, a tag may also be a logical expression of tags combined with the operators ``&&``, ``||``, ``^``, ``!`` and parentheses. When a method that operates on a single item is given a *tagOrId* matching several items, it normally uses the lowest matching item in the display list." -msgstr "" +msgid "" +"Each item has a unique integer *id*, assigned when it is created, and zero or more " +"string *tags*. A tag is an arbitrary string that does not have the form of an " +"integer; the same tag may be shared by many items, which makes tags convenient for " +"grouping items. The special tag ``'all'`` matches every item in the canvas, and " +"``'current'`` matches the topmost item under the mouse pointer. Most methods take a " +"*tagOrId* argument that may be an integer id naming a single item, or a tag naming " +"zero or more items; as described in the Tk ``canvas`` manual page, a tag may also be " +"a logical expression of tags combined with the operators ``&&``, ``||``, ``^``, ``!" +"`` and parentheses. When a method that operates on a single item is given a " +"*tagOrId* matching several items, it normally uses the lowest matching item in the " +"display list." +msgstr "" +"هر آیتم دارای یک *شناسه* عدد صحیح یکتا، که هنگام ایجاد اختصاص داده می‌شود، و صفر یا " +"چند *برچسب* رشته‌ای است. برچسب یک رشته دلخواه است که به شکل عدد صحیح نیست؛ ممکن است " +"یک برچسب یکسان بین بسیاری از آیتم‌ها مشترک باشد، که این امر برچسب‌ها را برای گروه‌بندی " +"آیتم‌ها مناسب می‌سازد. برچسب ویژه ``'all'`` با همه آیتم‌های بوم مطابقت دارد، و " +"``'current'`` با بالاترین آیتم زیر نشانگر ماوس مطابقت دارد. بیشتر متدها یک آرگومان " +"*tagOrId* می‌گیرند که ممکن است یک شناسه عدد صحیح باشد که یک آیتم واحد را مشخص می‌کند، " +"یا برچسبی باشد که صفر یا چند آیتم را مشخص می‌کند؛ همان‌طور که در صفحه راهنمای " +"``canvas`` Tk توضیح داده شده است، یک برچسب همچنین می‌تواند یک عبارت منطقی از برچسب‌ها " +"باشد که با عملگرهای ``&&``، ``||``، ``^``، ``!`` و پرانتز ترکیب شده است. هنگامی که " +"به متدی که روی یک آیتم واحد عمل می‌کند، یک *tagOrId* داده شود که با چند آیتم مطابقت " +"دارد، معمولاً از پایین‌ترین آیتم منطبق در فهرست نمایش استفاده می‌کند." -msgid "The items are kept in a *display list* that determines drawing order: items later in the list are drawn on top of earlier ones. A newly created item is placed at the top of the list; the order can be changed with :meth:`tag_raise` and :meth:`tag_lower`." +msgid "" +"The items are kept in a *display list* that determines drawing order: items later in " +"the list are drawn on top of earlier ones. A newly created item is placed at the top " +"of the list; the order can be changed with :meth:`tag_raise` and :meth:`tag_lower`." msgstr "" +"آیتم‌ها در یک *فهرست نمایش* نگهداری می‌شوند که ترتیب ترسیم را تعیین می‌کند: آیتم‌هایی که " +"در فهرست دیرتر می‌آیند، روی آیتم‌های پیشین ترسیم می‌شوند. یک آیتم تازه ایجادشده در " +"بالای فهرست قرار می‌گیرد؛ ترتیب را می‌توان با :meth:`tag_raise` و :meth:`tag_lower` " +"تغییر داد." -msgid "Create a new item of the corresponding type and return its integer id. Each method is called as ``create_TYPE(coord..., **options)``: the leading positional arguments give the coordinates that define the item (as separate numbers, as a single sequence of numbers, or as coordinate pairs), and the keyword arguments set item-specific options. Coordinates and screen distances may be given as numbers (interpreted as pixels) or as strings with a unit suffix (``'m'``, ``'c'``, ``'i'`` or ``'p'`` for millimetres, centimetres, inches or printer's points), but are always stored and returned in pixels." -msgstr "" +msgid "" +"Create a new item of the corresponding type and return its integer id. Each method " +"is called as ``create_TYPE(coord..., **options)``: the leading positional arguments " +"give the coordinates that define the item (as separate numbers, as a single sequence " +"of numbers, or as coordinate pairs), and the keyword arguments set item-specific " +"options. Coordinates and screen distances may be given as numbers (interpreted as " +"pixels) or as strings with a unit suffix (``'m'``, ``'c'``, ``'i'`` or ``'p'`` for " +"millimetres, centimetres, inches or printer's points), but are always stored and " +"returned in pixels." +msgstr "" +"یک آیتم جدید از نوع متناظر ایجاد می‌شود و شناسه‌ی عدد صحیح آن را برمی‌گرداند. هر متد " +"به‌صورت ``create_TYPE(coord..., **options)`` فراخوانی می‌شود: آرگومان‌های جایگاهی " +"ابتدایی مختصاتی را ارائه می‌دهند که آیتم را تعریف می‌کنند (به‌صورت اعداد جداگانه، " +"به‌صورت یک دنباله از اعداد، یا به‌صورت جفت‌های مختصات)، و آرگومان‌های کلیدواژه‌ای " +"گزینه‌های مختص آیتم را تنظیم می‌کنند. مختصات و فاصله‌های صفحه می‌توانند به‌صورت اعداد (که " +"به‌عنوان پیکسل تفسیر می‌شوند) یا به‌صورت رشته‌هایی با پسوند واحد (``'m'``، ``'c'``، " +"``'i'`` یا ``'p'`` برای میلی‌متر، سانتی‌متر، اینچ یا نقاط چاپگر) داده شوند، اما همیشه " +"بر حسب پیکسل ذخیره و برگردانده می‌شوند." -msgid "The item types are: ``arc`` (an arc-shaped region that is a section of an oval, defined by two diagonally opposite corners ``x1, y1, x2, y2`` of the enclosing rectangle); ``bitmap`` (a two-color bitmap positioned at a point ``x, y``); ``image`` (a Tk image positioned at a point ``x, y``); ``line`` (a line or curve through the points ``x1, y1, ..., xn, yn``); ``oval`` (a circle or ellipse inscribed in the rectangle ``x1, y1, x2, y2``); ``polygon`` (a closed polygon through the points ``x1, y1, ..., xn, yn``); ``rectangle`` (a rectangle with corners ``x1, y1, x2, y2``); ``text`` (a string of text positioned at a point ``x, y``); and ``window`` (a child widget embedded in the canvas at a point ``x, y``, specified with the *window* option)." -msgstr "" +msgid "" +"The item types are: ``arc`` (an arc-shaped region that is a section of an oval, " +"defined by two diagonally opposite corners ``x1, y1, x2, y2`` of the enclosing " +"rectangle); ``bitmap`` (a two-color bitmap positioned at a point ``x, y``); " +"``image`` (a Tk image positioned at a point ``x, y``); ``line`` (a line or curve " +"through the points ``x1, y1, ..., xn, yn``); ``oval`` (a circle or ellipse inscribed " +"in the rectangle ``x1, y1, x2, y2``); ``polygon`` (a closed polygon through the " +"points ``x1, y1, ..., xn, yn``); ``rectangle`` (a rectangle with corners ``x1, y1, " +"x2, y2``); ``text`` (a string of text positioned at a point ``x, y``); and " +"``window`` (a child widget embedded in the canvas at a point ``x, y``, specified " +"with the *window* option)." +msgstr "" +"انواع آیتم‌ها عبارتند از: ``arc`` (ناحیه‌ای کمان‌شکل که بخشی از یک بیضی است و با دو " +"گوشه مقابل به‌صورت مورب ``x1, y1, x2, y2`` از مستطیل دربرگیرنده تعریف می‌شود)؛ " +"``bitmap`` (یک بیت‌مپ دو رنگ که در نقطه ``x, y`` قرار دارد)؛ ``image`` (یک تصویر Tk " +"که در نقطه ``x, y`` قرار دارد)؛ ``line`` (یک خط یا منحنی که از نقاط ``x1, y1, ..., " +"xn, yn`` می‌گذرد)؛ ``oval`` (یک دایره یا بیضی محاط‌شده در مستطیل ``x1, y1, x2, y2``)؛ " +"``polygon`` (یک چندضلعی بسته که از نقاط ``x1, y1, ..., xn, yn`` می‌گذرد)؛ " +"``rectangle`` (یک مستطیل با گوشه‌های ``x1, y1, x2, y2``)؛ ``text`` (یک رشته متن که در " +"نقطه ``x, y`` قرار دارد)؛ و ``window`` (یک ابزارک فرزند جاسازی‌شده در بوم در نقطه ``x, " +"y`` که با گزینه *window* مشخص می‌شود)." -msgid "Most item types accept a common set of *standard item options*, plus a few options specific to each type. Option names are passed as keyword arguments, without the leading hyphen." +msgid "" +"Most item types accept a common set of *standard item options*, plus a few options " +"specific to each type. Option names are passed as keyword arguments, without the " +"leading hyphen." msgstr "" +"بیشتر انواع آیتم، مجموعه‌ی مشترکی از *گزینه‌های استاندارد آیتم* و چند گزینه‌ی مختص هر نوع " +"را می‌پذیرند. نام گزینه‌ها به‌عنوان آرگومان‌های کلیدواژه‌ای، بدون خط تیره‌ی آغازین ارسال " +"می‌شوند." msgid "The standard item options are:" -msgstr "" +msgstr "گزینه‌های استاندارد آیتم عبارتند از:" -msgid "The color used to fill the item's interior, or to draw a *line* item or the characters of a *text* item. An empty string (the default for all types except *line* and *text*) leaves the item unfilled." +msgid "" +"The color used to fill the item's interior, or to draw a *line* item or the " +"characters of a *text* item. An empty string (the default for all types except " +"*line* and *text*) leaves the item unfilled." msgstr "" +"رنگی که برای پر کردن درون آیتم، یا برای ترسیم یک آیتم از نوع *خط* یا نویسه‌های یک " +"آیتم از نوع *متن* استفاده می‌شود. رشته خالی (پیش‌فرض برای همه‌ی انواع به‌جز *خط* و *متن*) " +"آیتم را بدون پر شدن باقی می‌گذارد." msgid "*outline*" -msgstr "" +msgstr "*طرح کلی*" msgid "The color used to draw the item's outline. An empty string draws no outline." msgstr "" +"رنگی که برای رسم خط دور آیتم استفاده می‌شود. یک رشته‌ی خالی هیچ خط دوری رسم نمی‌کند." msgid "*width*" -msgstr "" +msgstr "*عرض*" -msgid "The width of the outline, defaulting to ``1.0``. Has no effect if *outline* is empty." +msgid "" +"The width of the outline, defaulting to ``1.0``. Has no effect if *outline* is empty." msgstr "" +"پهنای خط دور، با مقدار پیش‌فرض ``1.0``. اگر *outline* خالی باشد، هیچ تأثیری ندارد." msgid "*dash*" -msgstr "" +msgstr "*خط تیره*" -msgid "A dash pattern for the outline, given either as a sequence of segment lengths in pixels or as a string of the characters ``'.'``, ``','``, ``'-'``, ``'_'`` and space. An empty pattern (the default) draws a solid outline." +msgid "" +"A dash pattern for the outline, given either as a sequence of segment lengths in " +"pixels or as a string of the characters ``'.'``, ``','``, ``'-'``, ``'_'`` and " +"space. An empty pattern (the default) draws a solid outline." msgstr "" +"الگوی خط‌چین برای خط دور، که یا به‌صورت دنباله‌ای از طول قطعه‌ها بر حسب پیکسل داده می‌شود " +"یا به‌صورت رشته‌ای از نویسه‌های ``'.'``، ``','``، ``'-'``، ``'_'`` و فاصله. الگوی خالی " +"(پیش‌فرض) یک خط دور توپر رسم می‌کند." msgid "*dashoffset*" -msgstr "" +msgstr "*dashoffset*" -msgid "The starting offset in pixels into the *dash* pattern. Ignored if there is no *dash* pattern." +msgid "" +"The starting offset in pixels into the *dash* pattern. Ignored if there is no *dash* " +"pattern." msgstr "" +"آفست شروع بر حسب پیکسل در الگوی *dash*. اگر الگوی *dash* وجود نداشته باشد، نادیده " +"گرفته می‌شود." msgid "*stipple*" -msgstr "" +msgstr "*stipple*" -msgid "A bitmap used as a stipple pattern when filling the item. Only well supported on X11." +msgid "" +"A bitmap used as a stipple pattern when filling the item. Only well supported on X11." msgstr "" +"یک بیت‌مپ (bitmap) که به‌عنوان الگوی نقطه‌نگاری (stipple pattern) هنگام پر کردن آیتم " +"استفاده می‌شود. تنها در X11 به‌خوبی پشتیبانی می‌شود." msgid "*outlinestipple*" -msgstr "" +msgstr "*outlinestipple*" -msgid "A bitmap used as a stipple pattern when drawing the outline. Has no effect if *outline* is empty." +msgid "" +"A bitmap used as a stipple pattern when drawing the outline. Has no effect if " +"*outline* is empty." msgstr "" +"یک بیت‌مپ (bitmap) که به‌عنوان الگوی stipple (stipple pattern) هنگام رسم خط دور " +"استفاده می‌شود. اگر *outline* خالی باشد، هیچ تأثیری ندارد." msgid "*offset*, *outlineoffset*" -msgstr "" +msgstr "*offset*, *outlineoffset*" -msgid "The offset of the fill and outline stipple patterns, given as ``'x,y'`` or as a side such as ``'n'``, ``'se'`` or ``'center'``. Stipple offsets are only supported on X11." +msgid "" +"The offset of the fill and outline stipple patterns, given as ``'x,y'`` or as a side " +"such as ``'n'``, ``'se'`` or ``'center'``. Stipple offsets are only supported on X11." msgstr "" +"آفست (offset) الگوهای نقطه‌نگاری (stipple) برای پر کردن و خط دور، که به‌صورت ``'x,y'`` " +"یا به‌عنوان یک سمت مانند ``'n'``، ``'se'`` یا ``'center'`` داده می‌شود. آفست‌های " +"نقطه‌نگاری فقط در X11 پشتیبانی می‌شوند." msgid "*state*" -msgstr "" +msgstr "*وضعیت*" -msgid "Overrides the canvas state for this item; one of ``'normal'``, ``'disabled'`` or ``'hidden'``." +msgid "" +"Overrides the canvas state for this item; one of ``'normal'``, ``'disabled'`` or " +"``'hidden'``." msgstr "" +"وضعیت بوم را برای این آیتم بازنویسی می‌کند؛ یکی از ``'normal'``، ``'disabled'`` یا " +"``'hidden'``." msgid "*tags*" -msgstr "" +msgstr "*برچسب‌ها*" -msgid "A single tag or a sequence of tags to associate with the item, replacing any existing tags." +msgid "" +"A single tag or a sequence of tags to associate with the item, replacing any " +"existing tags." msgstr "" +"یک برچسب یا دنباله‌ای از برچسب‌ها برای انتساب به آیتم، که جایگزین برچسب‌های موجود می‌شود." -msgid "Many of these options have *active...* and *disabled...* variants (such as *activefill*, *disabledfill*, *activewidth*, *disableddash*, *activeoutline*, *disabledstipple*) that override the base option when the item is the active item (under the mouse pointer) or is in the disabled state." +msgid "" +"Many of these options have *active...* and *disabled...* variants (such as " +"*activefill*, *disabledfill*, *activewidth*, *disableddash*, *activeoutline*, " +"*disabledstipple*) that override the base option when the item is the active item " +"(under the mouse pointer) or is in the disabled state." msgstr "" +"بسیاری از این گزینه‌ها دارای گونه‌های *active...* و *disabled...* هستند (مانند " +"*activefill*، *disabledfill*، *activewidth*، *disableddash*، *activeoutline*، " +"*disabledstipple*) که هنگام فعال بودن آیتم (قرار داشتن زیر نشانگر ماوس) یا در وضعیت " +"غیرفعال بودن آن، جایگزین گزینه‌ی پایه می‌شوند." msgid "The following item types support additional options." -msgstr "" +msgstr "انواع آیتم زیر از گزینه‌های اضافی پشتیبانی می‌کنند." msgid "For ``arc`` items:" -msgstr "" +msgstr "برای آیتم‌های ``arc``:" msgid "*start*" -msgstr "" +msgstr "*شروع*" -msgid "The start of the arc's angular range, in degrees measured counter-clockwise from the 3-o'clock position." +msgid "" +"The start of the arc's angular range, in degrees measured counter-clockwise from the " +"3-o'clock position." msgstr "" +"آغاز محدوده‌ی زاویه‌ای کمان، بر حسب درجه که خلاف جهت عقربه‌های ساعت از موقعیت ساعت ۳ " +"اندازه‌گیری می‌شود." msgid "*extent*" -msgstr "" +msgstr "*میزان*" msgid "The size of the angular range, in degrees counter-clockwise from *start*." -msgstr "" +msgstr "اندازه‌ی بازه‌ی زاویه‌ای، بر حسب درجه، در خلاف جهت عقربه‌های ساعت از *start*." msgid "*style*" -msgstr "" +msgstr "*سبک*" msgid "How the arc is drawn: ``'pieslice'`` (the default), ``'chord'`` or ``'arc'``." -msgstr "" +msgstr "نحوه ترسیم کمان: ``'pieslice'`` (پیش‌فرض)، ``'chord'`` یا ``'arc'``." msgid "For ``line`` items:" -msgstr "" +msgstr "برای آیتم‌های ``line``:" msgid "*arrow*" -msgstr "" +msgstr "*پیکان*" -msgid "Where to draw arrowheads: ``'none'`` (the default), ``'first'``, ``'last'`` or ``'both'``." -msgstr "" +msgid "" +"Where to draw arrowheads: ``'none'`` (the default), ``'first'``, ``'last'`` or " +"``'both'``." +msgstr "محل رسم سرپیکان‌ها: ``'none'`` (پیش‌فرض)، ``'first'``، ``'last'`` یا ``'both'``." msgid "*arrowshape*" -msgstr "" +msgstr "*arrowshape*" msgid "A sequence of three distances describing the shape of the arrowheads." -msgstr "" +msgstr "دنباله‌ای از سه فاصله که شکل نوک پیکان‌ها را توصیف می‌کند." msgid "*capstyle*" -msgstr "" +msgstr "*capstyle*" -msgid "How line ends are drawn: ``'butt'`` (the default), ``'projecting'`` or ``'round'``." -msgstr "" +msgid "" +"How line ends are drawn: ``'butt'`` (the default), ``'projecting'`` or ``'round'``." +msgstr "نحوه رسم انتهای خطوط: ``'butt'`` (پیش‌فرض)، ``'projecting'`` یا ``'round'``." msgid "*joinstyle*" -msgstr "" +msgstr "*joinstyle*" -msgid "How line vertices are drawn: ``'round'`` (the default), ``'bevel'`` or ``'miter'``." -msgstr "" +msgid "" +"How line vertices are drawn: ``'round'`` (the default), ``'bevel'`` or ``'miter'``." +msgstr "نحوه‌ی رسم رئوس خط: ``'round'`` (پیش‌فرض)، ``'bevel'`` یا ``'miter'``." msgid "*smooth*" -msgstr "" +msgstr "*صاف*" -msgid "The smoothing method: a false value (the default) for no smoothing, or ``'true'``/``'bezier'`` or ``'raw'`` to draw the line as a curve." +msgid "" +"The smoothing method: a false value (the default) for no smoothing, or ``'true'``/" +"``'bezier'`` or ``'raw'`` to draw the line as a curve." msgstr "" +"روش هموارسازی: یک مقدار نادرست (پیش‌فرض) برای حالت بدون هموارسازی، یا ``'true'``/" +"``'bezier'`` یا ``'raw'`` برای رسم خط به‌صورت منحنی." msgid "*splinesteps*" -msgstr "" +msgstr "*splinesteps*" msgid "The number of line segments approximating each spline when *smooth* is enabled." msgstr "" +"تعداد پاره‌خط‌هایی که هر اسپلاین (spline) را هنگام فعال بودن *smooth* تقریب می‌زنند." msgid "For ``polygon`` items:" -msgstr "" +msgstr "برای آیتم‌های ``polygon``:" msgid "*joinstyle*, *smooth*, *splinesteps*" -msgstr "" +msgstr "*joinstyle*, *smooth*, *splinesteps*" msgid "As for ``line`` items, applied to the polygon's outline." -msgstr "" +msgstr "در مورد آیتم‌های ``line``، بر خط پیرامونی چندضلعی اعمال می‌شود." msgid "For ``text`` items:" -msgstr "" +msgstr "برای آیتم‌های ``text``:" msgid "*text*" -msgstr "" +msgstr "*متن*" msgid "The string to display; newline characters start new lines." -msgstr "" +msgstr "رشته‌ای برای نمایش؛ نویسه‌های خط جدید، خطوط جدید را آغاز می‌کنند." msgid "*font*" -msgstr "" +msgstr "*قلم*" msgid "The font used for the text." -msgstr "" +msgstr "قلم استفاده‌شده برای متن." msgid "*justify*" -msgstr "" +msgstr "*هم‌تراز کردن*" msgid "How lines are justified: ``'left'`` (the default), ``'right'`` or ``'center'``." -msgstr "" +msgstr "چگونگی تراز خطوط: ``'left'`` (پیش‌فرض)، ``'right'`` یا ``'center'``." msgid "How the text is positioned relative to its point, defaulting to ``'center'``." -msgstr "" +msgstr "چگونگی قرارگیری متن نسبت به نقطه‌ی آن، که مقدار پیش‌فرض آن ``'center'`` است." msgid "The maximum line length; if non-zero, lines are wrapped at spaces." -msgstr "" +msgstr "حداکثر طول خط؛ اگر غیرصفر باشد، خطوط در فاصله‌ها شکسته می‌شوند." msgid "*angle*" -msgstr "" +msgstr "*زاویه*" -msgid "How many degrees to rotate the text counter-clockwise about its positioning point, from ``0.0`` to ``360.0`` (default ``0.0``)." +msgid "" +"How many degrees to rotate the text counter-clockwise about its positioning point, " +"from ``0.0`` to ``360.0`` (default ``0.0``)." msgstr "" +"میزان چرخش متن در خلاف جهت عقربه‌های ساعت حول نقطه موقعیت‌دهی آن، از ``0.0`` تا " +"``360.0`` (پیش‌فرض ``0.0``)." msgid "*underline*" -msgstr "" +msgstr "*زیرخط*" msgid "The index of a character to underline, or ``-1`` for none." -msgstr "" +msgstr "اندیس نویسه‌ای که باید زیر آن خط کشیده شود، یا ``-1`` برای هیچ‌کدام." msgid "For ``bitmap`` items:" -msgstr "" +msgstr "برای آیتم‌های ``bitmap``:" msgid "*bitmap*" -msgstr "" +msgstr "*بیت‌مپ*" msgid "The bitmap to display." -msgstr "" +msgstr "بیت‌مپ برای نمایش." msgid "How the bitmap is positioned relative to its point." -msgstr "" +msgstr "نحوه‌ی قرارگیری بیت‌مپ (bitmap) نسبت به نقطه‌ی آن." msgid "*background*, *foreground*" -msgstr "" +msgstr "*پس‌زمینه*، *پیش‌زمینه*" -msgid "The colors used for the bitmap's ``0`` and ``1`` pixels; an empty *background* makes the ``0`` pixels transparent. Both have *active...* and *disabled...* variants, and *bitmap* has *activebitmap* and *disabledbitmap* variants." +msgid "" +"The colors used for the bitmap's ``0`` and ``1`` pixels; an empty *background* makes " +"the ``0`` pixels transparent. Both have *active...* and *disabled...* variants, and " +"*bitmap* has *activebitmap* and *disabledbitmap* variants." msgstr "" +"رنگ‌های استفاده‌شده برای پیکسل‌های ``0`` و ``1`` بیت‌مپ؛ یک *background* خالی، پیکسل‌های " +"``0`` را شفاف می‌کند. هر دو دارای گونه‌های *active...* و *disabled...* هستند و " +"*bitmap* دارای گونه‌های *activebitmap* و *disabledbitmap* است." msgid "For ``image`` items:" -msgstr "" +msgstr "برای آیتم‌های ``image``:" msgid "*image*" -msgstr "" +msgstr "*تصویر*" msgid "The Tk image to display, previously created with the image protocols." -msgstr "" +msgstr "تصویر Tk برای نمایش، که پیش‌تر با پروتکل‌های تصویر ایجاد شده است." msgid "How the image is positioned relative to its point." -msgstr "" +msgstr "چگونگی قرارگیری تصویر نسبت به نقطه‌ی آن." -msgid "Both options have *active...* and *disabled...* variants (*activeimage*, *disabledimage*) used in the active and disabled states." +msgid "" +"Both options have *active...* and *disabled...* variants (*activeimage*, " +"*disabledimage*) used in the active and disabled states." msgstr "" +"هر دو گزینه دارای گونه‌های *active...* و *disabled...* (*activeimage*، " +"*disabledimage*) هستند که در وضعیت‌های فعال و غیرفعال استفاده می‌شوند." msgid "For ``window`` items:" -msgstr "" +msgstr "برای آیتم‌های ``window``:" msgid "*window*" -msgstr "" +msgstr "*پنجره*" -msgid "The widget to embed; it must be a child of the canvas or of one of its ancestors, and may not be a top-level window." +msgid "" +"The widget to embed; it must be a child of the canvas or of one of its ancestors, " +"and may not be a top-level window." msgstr "" +"ابزارکی که باید جاسازی شود؛ این ابزارک باید فرزند بوم یا فرزند یکی از نیاکان آن باشد " +"و نباید یک پنجره سطح بالا باشد." msgid "How the window is positioned relative to its point." -msgstr "" +msgstr "چگونگی قرارگیری پنجره نسبت به نقطه‌ی آن." -msgid "The size to assign to the window; if zero (the default), the window is given its requested size." +msgid "" +"The size to assign to the window; if zero (the default), the window is given its " +"requested size." msgstr "" +"اندازه‌ای که باید به پنجره اختصاص داده شود؛ اگر صفر باشد (پیش‌فرض)، اندازه‌ی درخواستی " +"به پنجره داده می‌شود." -msgid "``oval`` and ``rectangle`` items have no type-specific options; they use only the standard item options." +msgid "" +"``oval`` and ``rectangle`` items have no type-specific options; they use only the " +"standard item options." msgstr "" +"آیتم‌های ``oval`` و ``rectangle`` گزینه‌های مختص نوع ندارند؛ آن‌ها فقط از گزینه‌های " +"استاندارد آیتم استفاده می‌کنند." -msgid "Tk 8.6 added the *angle* option and Tk 9.0 added the *underline* option for ``text`` items." +msgid "" +"Tk 8.6 added the *angle* option and Tk 9.0 added the *underline* option for ``text`` " +"items." msgstr "" +"گزینه‌ی *angle* در Tk 8.6 و گزینه‌ی *underline* در Tk 9.0 برای آیتم‌های ``text`` افزوده " +"شدند." -msgid "Query or modify the coordinates of an item. With only *tagOrId*, return a list of the floating-point coordinates of the item given by *tagOrId* (the first matching item if it matches several). Given new coordinates, replace the coordinates of that item with them; like the ``create_*`` methods, the coordinates may be given as separate numbers, as a single sequence, or as coordinate pairs. The returned coordinates are always in pixels, regardless of the units used to specify them; for rectangles, ovals and arcs they are ordered left, top, right, bottom." -msgstr "" +msgid "" +"Query or modify the coordinates of an item. With only *tagOrId*, return a list of " +"the floating-point coordinates of the item given by *tagOrId* (the first matching " +"item if it matches several). Given new coordinates, replace the coordinates of that " +"item with them; like the ``create_*`` methods, the coordinates may be given as " +"separate numbers, as a single sequence, or as coordinate pairs. The returned " +"coordinates are always in pixels, regardless of the units used to specify them; for " +"rectangles, ovals and arcs they are ordered left, top, right, bottom." +msgstr "" +"مختصات یک آیتم را بازیابی یا تغییر دهید. اگر تنها *tagOrId* داده شود، فهرستی از " +"مختصات ممیز شناور آیتم مشخص‌شده با *tagOrId* برمی‌گرداند (اولین آیتم منطبق، اگر چندین " +"آیتم منطبق وجود داشته باشد). اگر مختصات جدید داده شود، مختصات آن آیتم با آن‌ها " +"جایگزین می‌شود؛ مانند متدهای ``create_*``، می‌توان مختصات را به‌صورت اعداد جداگانه، " +"به‌صورت یک دنباله واحد، یا به‌صورت جفت‌های مختصات داد. مختصات برگردانده‌شده همیشه بر حسب " +"پیکسل هستند، صرف‌نظر از واحدهای استفاده‌شده برای مشخص کردن آن‌ها؛ برای مستطیل‌ها، بیضی‌ها " +"و کمان‌ها، به ترتیب چپ، بالا، راست، پایین مرتب شده‌اند." -msgid "The arguments are now flattened: the coordinates may be given as separate arguments, as a single sequence, or grouped in pairs, like the ``create_*`` methods." +msgid "" +"The arguments are now flattened: the coordinates may be given as separate arguments, " +"as a single sequence, or grouped in pairs, like the ``create_*`` methods." msgstr "" +"آرگومان‌ها اکنون مسطح شده‌اند: مختصات می‌توانند به‌صورت آرگومان‌های جداگانه، به‌صورت یک " +"دنباله واحد، یا به‌صورت جفت‌ها گروه‌بندی‌شده داده شوند، مانند متدهای ``create_*``." -msgid "Move each of the items given by *tagOrId* in the canvas coordinate space by adding *xAmount* to every x-coordinate and *yAmount* to every y-coordinate of the item." +msgid "" +"Move each of the items given by *tagOrId* in the canvas coordinate space by adding " +"*xAmount* to every x-coordinate and *yAmount* to every y-coordinate of the item." msgstr "" +"هر یک از آیتم‌های مشخص‌شده با *tagOrId* را در فضای مختصات بوم (canvas) با افزودن " +"*xAmount* به هر یک از مختصات‌های x و *yAmount* به هر یک از مختصات‌های y آن آیتم جابه‌جا " +"می‌کند." -msgid "Move the items given by *tagOrId* so that the first coordinate pair (the upper-left corner of the bounding box) of the lowest matching item is at position (*x*, *y*). *x* or *y* may be an empty string, in which case the corresponding coordinate is unchanged. All matching items keep their positions relative to each other." +msgid "" +"Move the items given by *tagOrId* so that the first coordinate pair (the upper-left " +"corner of the bounding box) of the lowest matching item is at position (*x*, *y*). " +"*x* or *y* may be an empty string, in which case the corresponding coordinate is " +"unchanged. All matching items keep their positions relative to each other." msgstr "" +"آیتم‌های مشخص‌شده با *tagOrId* را به‌گونه‌ای جابه‌جا کنید که اولین جفت مختصات پایین‌ترین " +"آیتم منطبق (گوشه‌ی بالا سمت چپ جعبه‌ی محدودکننده) در موقعیت (*x*, *y) قرار گیرد. *x* یا *y* " +"می‌تواند رشته‌ای خالی باشد، که در این صورت مختصات متناظر بدون تغییر می‌ماند. همه‌ی " +"آیتم‌های منطبق موقعیت‌های خود را نسبت به یکدیگر حفظ می‌کنند." -msgid "Rescale the coordinates of all items given by *tagOrId* in canvas coordinate space. Each x-coordinate is adjusted so that its distance from *xOrigin* changes by a factor of *xScale*, and each y-coordinate so that its distance from *yOrigin* changes by a factor of *yScale* (a factor of ``1.0`` leaves the coordinate unchanged)." +msgid "" +"Rescale the coordinates of all items given by *tagOrId* in canvas coordinate space. " +"Each x-coordinate is adjusted so that its distance from *xOrigin* changes by a " +"factor of *xScale*, and each y-coordinate so that its distance from *yOrigin* " +"changes by a factor of *yScale* (a factor of ``1.0`` leaves the coordinate " +"unchanged)." msgstr "" +"مقیاس‌دهی مجدد مختصات تمام آیتم‌های داده‌شده توسط *tagOrId* در فضای مختصات بوم. هر " +"مختصات x به‌گونه‌ای تنظیم می‌شود که فاصله‌ی آن از *xOrigin* با ضریب *xScale* تغییر کند، و " +"هر مختصات y به‌گونه‌ای که فاصله‌ی آن از *yOrigin* با ضریب *yScale* تغییر کند (ضریب " +"``1.0`` مختصات را بدون تغییر باقی می‌گذارد)." msgid "Delete each of the items given by the *tagOrIds* arguments." -msgstr "" +msgstr "هر یک از آیتم‌های داده‌شده توسط آرگومان‌های *tagOrIds* را حذف می‌کند." -msgid "Delete from each of the items given by *tagOrId* the characters (for text items) or coordinates (for line and polygon items) in the range from *first* to *last* inclusive; *last* defaults to *first*. Items that do not support indexing ignore this operation." +msgid "" +"Delete from each of the items given by *tagOrId* the characters (for text items) or " +"coordinates (for line and polygon items) in the range from *first* to *last* " +"inclusive; *last* defaults to *first*. Items that do not support indexing ignore " +"this operation." msgstr "" +"از هر یک از آیتم‌های داده‌شده توسط *tagOrId*، نویسه‌ها (برای آیتم‌های متنی) یا مختصات " +"(برای آیتم‌های خط و چندضلعی) را در بازه‌ی *first* تا *last* (شامل هر دو) حذف می‌کند؛ " +"مقدار پیش‌فرض *last* برابر *first* است. آیتم‌هایی که از اندیس‌دهی پشتیبانی نمی‌کنند، این " +"عملیات را نادیده می‌گیرند." -msgid "Insert *string* into each of the items given by *tagOrId* just before the character or coordinate whose index is *beforeThis*. For line and polygon items *string* must be a valid sequence of coordinates." +msgid "" +"Insert *string* into each of the items given by *tagOrId* just before the character " +"or coordinate whose index is *beforeThis*. For line and polygon items *string* must " +"be a valid sequence of coordinates." msgstr "" +"*string* را در هر یک از آیتم‌های مشخص‌شده با *tagOrId*، درست پیش از نویسه یا مختصاتی " +"که اندیس آن *beforeThis* است، درج کنید. برای آیتم‌های خط و چندضلعی، *string* باید " +"دنباله‌ای معتبر از مختصات باشد." -msgid "Return the current value of the configuration option *option* for the item given by *tagOrId* (the lowest matching item if it matches several). This is like :meth:`~Misc.cget` but applies to an individual item." +msgid "" +"Return the current value of the configuration option *option* for the item given by " +"*tagOrId* (the lowest matching item if it matches several). This is " +"like :meth:`~Misc.cget` but applies to an individual item." msgstr "" +"مقدار فعلی گزینه پیکربندی *option* را برای آیتم مشخص‌شده با *tagOrId* برمی‌گرداند (اگر " +"با چندین آیتم مطابقت داشته باشد، پایین‌ترین آیتم منطبق). این مانند :meth:`~Misc.cget` " +"است، اما برای یک آیتم منفرد اعمال می‌شود." -msgid "Query or modify the configuration options of the items given by *tagOrId*. This mirrors :meth:`~Misc.configure`, except that it applies to individual items rather than to the canvas as a whole. With no options, it returns a dictionary describing the current options of the first matching item; otherwise it sets the given options on every matching item. The legal options are those accepted by the corresponding ``create_*`` method. :meth:`itemconfig` is an alias of :meth:`!itemconfigure`." -msgstr "" +msgid "" +"Query or modify the configuration options of the items given by *tagOrId*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to individual items rather " +"than to the canvas as a whole. With no options, it returns a dictionary describing " +"the current options of the first matching item; otherwise it sets the given options " +"on every matching item. The legal options are those accepted by the corresponding " +"``create_*`` method. :meth:`itemconfig` is an alias of :meth:`!itemconfigure`." +msgstr "" +"گزینه‌های پیکربندی آیتم‌های مشخص‌شده با *tagOrId* را بپرسید یا تغییر دهید. این متد " +"همانند :meth:`~Misc.configure` است، با این تفاوت که به‌جای کل بوم (canvas)، به " +"آیتم‌های جداگانه اعمال می‌شود. بدون هیچ گزینه‌ای، یک دیکشنری برمی‌گرداند که گزینه‌های " +"جاری اولین آیتم منطبق را توصیف می‌کند؛ در غیر این صورت، گزینه‌های داده‌شده را روی همه " +"آیتم‌های منطبق تنظیم می‌کند. گزینه‌های مجاز، گزینه‌هایی هستند که متد ``create_*`` متناظر " +"آن‌ها را می‌پذیرد. :meth:`itemconfig` نام مستعاری برای :meth:`!itemconfigure` است." -msgid "Return the type of the item given by *tagOrId* (the first matching item if it matches several), such as ``'rectangle'`` or ``'text'``, or ``None`` if *tagOrId* does not match any item." +msgid "" +"Return the type of the item given by *tagOrId* (the first matching item if it " +"matches several), such as ``'rectangle'`` or ``'text'``, or ``None`` if *tagOrId* " +"does not match any item." msgstr "" +"نوع آیتم داده‌شده توسط *tagOrId* را برمی‌گرداند (اولین آیتم منطبق در صورتی که با چندین " +"آیتم مطابقت داشته باشد)، مانند ``'rectangle'`` یا ``'text'``، یا اگر *tagOrId* با " +"هیچ آیتمی مطابقت نداشته باشد ``None`` را برمی‌گرداند." -msgid "Return a tuple of the tags associated with the item given by *tagOrId* (the first matching item in display-list order if it matches several). Return an empty tuple if no item matches or the item has no tags." +msgid "" +"Return a tuple of the tags associated with the item given by *tagOrId* (the first " +"matching item in display-list order if it matches several). Return an empty tuple if " +"no item matches or the item has no tags." msgstr "" +"یک تاپل از برچسب‌های مرتبط با آیتم مشخص‌شده توسط *tagOrId* برمی‌گرداند (در صورت تطابق " +"با چندین آیتم، اولین آیتم منطبق در ترتیب فهرست نمایش). اگر هیچ آیتمی منطبق نباشد یا " +"آیتم برچسبی نداشته باشد، یک تاپل خالی برمی‌گرداند." -msgid "Remove the tag *tagToDelete* (which defaults to *tagOrId*) from each of the items given by *tagOrId*. Items that do not have that tag are unaffected." +msgid "" +"Remove the tag *tagToDelete* (which defaults to *tagOrId*) from each of the items " +"given by *tagOrId*. Items that do not have that tag are unaffected." msgstr "" +"برچسب *tagToDelete* (که به‌طور پیش‌فرض *tagOrId* است) را از هر یک از آیتم‌های داده‌شده " +"توسط *tagOrId* حذف می‌کند. آیتم‌هایی که آن برچسب را ندارند، بدون تغییر می‌مانند." -msgid "Add the tag *newtag* to each item selected by the search specification *searchSpec* (and any further *args*). *searchSpec* is one of ``'above'``, ``'all'``, ``'below'``, ``'closest'``, ``'enclosed'``, ``'overlapping'`` or ``'withtag'``; the ``addtag_*`` methods below are convenient wrappers that supply each of these forms." +msgid "" +"Add the tag *newtag* to each item selected by the search specification *searchSpec* " +"(and any further *args*). *searchSpec* is one of ``'above'``, ``'all'``, " +"``'below'``, ``'closest'``, ``'enclosed'``, ``'overlapping'`` or ``'withtag'``; the " +"``addtag_*`` methods below are convenient wrappers that supply each of these forms." msgstr "" +"برچسب *newtag* را به هر آیتمی که توسط مشخصه جستجوی *searchSpec* (و هر *args* بیشتر) " +"انتخاب‌شده است، اضافه می‌کند. *searchSpec* یکی از ``'above'``، ``'all'``، ``'below'``، " +"``'closest'``، ``'enclosed'``، ``'overlapping'`` یا ``'withtag'`` است؛ متدهای " +"``addtag_*`` زیر، متدهای پوششی مناسبی هستند که هر یک از این قالب‌ها را فراهم می‌کنند." -msgid "Add the tag *newtag* to the item just above (after) *tagOrId* in the display list." +msgid "" +"Add the tag *newtag* to the item just above (after) *tagOrId* in the display list." msgstr "" +"برچسب *newtag* را به آیتم بلافاصله بالای (پس از) *tagOrId* در فهرست نمایش اضافه کنید." msgid "Add the tag *newtag* to all items in the canvas." -msgstr "" +msgstr "برچسب *newtag* را به تمام آیتم‌های بوم اضافه کنید." -msgid "Add the tag *newtag* to the item just below (before) *tagOrId* in the display list." +msgid "" +"Add the tag *newtag* to the item just below (before) *tagOrId* in the display list." msgstr "" +"برچسب *newtag* را به آیتم درست پایین (قبل از) *tagOrId* در فهرست نمایش اضافه کنید." -msgid "Add the tag *newtag* to the item closest to the point (*x*, *y*). If *halo* is given, any item within that distance of the point is treated as overlapping it. If *start* is given (a tag or id), select the topmost closest item that lies below *start* in the display list, which can be used to step through all the closest items." +msgid "" +"Add the tag *newtag* to the item closest to the point (*x*, *y*). If *halo* is " +"given, any item within that distance of the point is treated as overlapping it. If " +"*start* is given (a tag or id), select the topmost closest item that lies below " +"*start* in the display list, which can be used to step through all the closest items." msgstr "" +"برچسب *newtag* را به نزدیک‌ترین آیتم به نقطه‌ی (*x*، *y*) اضافه می‌کند. اگر *halo* داده " +"شده باشد، هر آیتمی که در آن فاصله از نقطه قرار داشته باشد، هم‌پوشان با آن در نظر " +"گرفته می‌شود. اگر *start* داده شده باشد (یک برچسب یا شناسه)، بالاترین آیتم نزدیک که " +"پایین‌تر از *start* در فهرست نمایش قرار دارد انتخاب می‌شود؛ این قابلیت می‌تواند برای " +"پیمایش همه‌ی نزدیک‌ترین آیتم‌ها استفاده شود." -msgid "Add the tag *newtag* to every item completely enclosed within the rectangle (*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." +msgid "" +"Add the tag *newtag* to every item completely enclosed within the rectangle (*x1*, " +"*y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." msgstr "" +"برچسب *newtag* را به هر آیتمی که به‌طور کامل درون مستطیل (*x1*، *y1*، *x2*، *y2*) " +"محصور شده است، اضافه کنید، که در آن *x1* <= *x2* و *y1* <= *y2* است." -msgid "Add the tag *newtag* to every item that overlaps or is enclosed within the rectangle (*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." +msgid "" +"Add the tag *newtag* to every item that overlaps or is enclosed within the rectangle " +"(*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." msgstr "" +"برچسب *newtag* را به هر آیتمی که با مستطیل (*x1*, *y1*, *x2*, *y2*) هم‌پوشانی دارد یا " +"درون آن محصور شده است، اضافه کنید، که در آن *x1* <= *x2* و *y1* <= *y2* است." msgid "Add the tag *newtag* to every item given by *tagOrId*." -msgstr "" +msgstr "برچسب *newtag* را به هر آیتم داده‌شده توسط *tagOrId* اضافه کنید." -msgid "Return a tuple of the ids of all items selected by the search specification *searchSpec* (and any further *args*), in stacking order with the lowest item first. The search specification has any of the forms accepted by :meth:`addtag`. The ``find_*`` methods below are more convenient wrappers around it." +msgid "" +"Return a tuple of the ids of all items selected by the search specification " +"*searchSpec* (and any further *args*), in stacking order with the lowest item first. " +"The search specification has any of the forms accepted by :meth:`addtag`. The " +"``find_*`` methods below are more convenient wrappers around it." msgstr "" +"تاپلی از شناسه‌های همه آیتم‌های انتخاب‌شده توسط مشخصه جستجوی *searchSpec* (و هر آرگومان " +"بعدی در *args*) را برمی‌گرداند، به ترتیب پشته‌بندی و با پایین‌ترین آیتم در ابتدا. مشخصه " +"جستجو می‌تواند هر یک از قالب‌های پذیرفته‌شده توسط :meth:`addtag` را داشته باشد. متدهای " +"``find_*`` زیر، متدهای پوششی آسان‌تری حول آن هستند." -msgid "Return a tuple containing the id of the item just above *tagOrId* in the display list." -msgstr "" +msgid "" +"Return a tuple containing the id of the item just above *tagOrId* in the display " +"list." +msgstr "یک تاپل شامل شناسه‌ی آیتم درست بالای *tagOrId* در فهرست نمایش را برمی‌گرداند." msgid "Return a tuple of the ids of all items in the canvas, in stacking order." -msgstr "" +msgstr "یک تاپل از شناسه‌های تمام آیتم‌های موجود در بوم را به ترتیب پشته‌بندی برمی‌گرداند." -msgid "Return a tuple containing the id of the item just below *tagOrId* in the display list." +msgid "" +"Return a tuple containing the id of the item just below *tagOrId* in the display " +"list." msgstr "" +"یک تاپل شامل شناسه‌ی آیتمی که درست زیر *tagOrId* در فهرست نمایش قرار دارد برمی‌گرداند." -msgid "Return a tuple containing the id of the item closest to the point (*x*, *y*). *halo* and *start* are interpreted as for :meth:`addtag_closest`." +msgid "" +"Return a tuple containing the id of the item closest to the point (*x*, *y*). *halo* " +"and *start* are interpreted as for :meth:`addtag_closest`." msgstr "" +"یک تاپل شامل شناسه‌ی نزدیک‌ترین آیتم به نقطه‌ی (*x*، *y*) برمی‌گرداند. *halo* و *start* " +"مانند :meth:`addtag_closest` تفسیر می‌شوند." -msgid "Return a tuple of the ids of all items completely enclosed within the rectangle (*x1*, *y1*, *x2*, *y2*)." +msgid "" +"Return a tuple of the ids of all items completely enclosed within the rectangle " +"(*x1*, *y1*, *x2*, *y2*)." msgstr "" +"یک تاپل از شناسه‌های تمام آیتم‌هایی که کاملاً درون مستطیل (*x1*, *y1*, *x2*, *y2*) " +"محصور شده‌اند، برمی‌گرداند." -msgid "Return a tuple of the ids of all items that overlap or are enclosed within the rectangle (*x1*, *y1*, *x2*, *y2*)." +msgid "" +"Return a tuple of the ids of all items that overlap or are enclosed within the " +"rectangle (*x1*, *y1*, *x2*, *y2*)." msgstr "" +"یک تاپل از شناسه‌های تمام آیتم‌هایی که با مستطیل (*x1*, *y1*, *x2*, *y2*) هم‌پوشانی " +"دارند یا درون آن محصور شده‌اند را برمی‌گرداند." msgid "Return a tuple of the ids of all items given by *tagOrId*." -msgstr "" +msgstr "یک تاپل از شناسه‌های تمام آیتم‌های مشخص‌شده با *tagOrId* را برمی‌گرداند." -msgid "Move all items given by *tagOrId* to a new position in the display list just above the item given by *aboveThis*, or to the top of the display list if *aboveThis* is omitted. When several items are moved their relative order is preserved. This has no effect on embedded window items, whose stacking order is controlled by :meth:`Misc.tkraise` and :meth:`Misc.lower` instead. :meth:`lift` and :meth:`tkraise` are aliases of :meth:`!tag_raise`." -msgstr "" +msgid "" +"Move all items given by *tagOrId* to a new position in the display list just above " +"the item given by *aboveThis*, or to the top of the display list if *aboveThis* is " +"omitted. When several items are moved their relative order is preserved. This has no " +"effect on embedded window items, whose stacking order is controlled " +"by :meth:`Misc.tkraise` and :meth:`Misc.lower` instead. :meth:`lift` " +"and :meth:`tkraise` are aliases of :meth:`!tag_raise`." +msgstr "" +"تمام آیتم‌های مشخص‌شده توسط *tagOrId* را به موقعیت جدیدی در فهرست نمایش، دقیقاً بالاتر " +"از آیتم مشخص‌شده توسط *aboveThis*، یا به بالای فهرست نمایش اگر *aboveThis* ذکر نشود، " +"منتقل می‌کند. هنگامی که چند آیتم منتقل می‌شوند، ترتیب نسبی آن‌ها حفظ می‌شود. این کار " +"تأثیری بر آیتم‌های پنجره‌ی جاسازی‌شده ندارد؛ در عوض، ترتیب پشته‌ای آن‌ها " +"توسط :meth:`Misc.tkraise` و :meth:`Misc.lower` کنترل می‌شود. :meth:`lift` " +"و :meth:`tkraise` نام‌های مستعار :meth:`!tag_raise` هستند." -msgid "Move all items given by *tagOrId* to a new position in the display list just below the item given by *belowThis*, or to the bottom of the display list if *belowThis* is omitted. When several items are moved their relative order is preserved. This has no effect on embedded window items. :meth:`lower` is an alias of :meth:`!tag_lower`." +msgid "" +"Move all items given by *tagOrId* to a new position in the display list just below " +"the item given by *belowThis*, or to the bottom of the display list if *belowThis* " +"is omitted. When several items are moved their relative order is preserved. This has " +"no effect on embedded window items. :meth:`lower` is an alias of :meth:`!tag_lower`." msgstr "" +"تمام آیتم‌های مشخص‌شده با *tagOrId* را به موقعیت جدیدی در فهرست نمایش، درست زیر آیتم " +"مشخص‌شده با *belowThis*، یا در صورت حذف *belowThis* به انتهای فهرست نمایش منتقل " +"می‌کند. هنگامی که چندین آیتم جابه‌جا می‌شوند، ترتیب نسبی آن‌ها حفظ می‌شود. این کار تأثیری " +"بر آیتم‌های پنجره‌ی تعبیه‌شده ندارد. :meth:`lower` نام مستعاری برای :meth:`!tag_lower` " +"است." -msgid "On a :class:`Canvas`, :meth:`tkraise`/:meth:`lift` and :meth:`lower` restack canvas items, shadowing the inherited :meth:`Misc.tkraise`/:meth:`Misc.lift` and :meth:`Misc.lower` methods that restack the widget itself, which are therefore not available." +msgid "" +"On a :class:`Canvas`, :meth:`tkraise`/:meth:`lift` and :meth:`lower` restack canvas " +"items, shadowing the inherited :meth:`Misc.tkraise`/:meth:`Misc.lift` " +"and :meth:`Misc.lower` methods that restack the widget itself, which are therefore " +"not available." msgstr "" +"در یک :class:`Canvas`، :meth:`tkraise`/:meth:`lift` و :meth:`lower` آیتم‌های بوم را " +"دوباره در پشته می‌چینند و متدهای به‌ارث‌برده‌شده‌ی :meth:`Misc.tkraise`/:meth:`Misc.lift` " +"و :meth:`Misc.lower` را می‌پوشانند؛ متدهایی که خود ابزارک را دوباره در پشته می‌چینند و " +"بنابراین در دسترس نیستند." -msgid "Bind the callback *func* to the event *sequence* for all items given by *tagOrId*, so that *func* is invoked whenever that event occurs for one of the items. This is like :meth:`Widget.bind ` but operates on canvas items rather than on whole widgets; only mouse, keyboard and virtual events may be bound. Mouse events are directed to the current item and keyboard events to the focus item (see :meth:`focus`). If *add* is true the new binding is added to any existing bindings for the same sequence, rather than replacing them. Return the identifier of the bound function, which can be passed to :meth:`tag_unbind`." -msgstr "" +msgid "" +"Bind the callback *func* to the event *sequence* for all items given by *tagOrId*, " +"so that *func* is invoked whenever that event occurs for one of the items. This is " +"like :meth:`Widget.bind ` but operates on canvas items rather than on " +"whole widgets; only mouse, keyboard and virtual events may be bound. Mouse events " +"are directed to the current item and keyboard events to the focus item " +"(see :meth:`focus`). If *add* is true the new binding is added to any existing " +"bindings for the same sequence, rather than replacing them. Return the identifier of " +"the bound function, which can be passed to :meth:`tag_unbind`." +msgstr "" +"کال‌بک *func* را برای تمام آیتم‌های مشخص‌شده با *tagOrId* به دنباله رویداد *sequence* " +"متصل می‌کند، به‌گونه‌ای که هرگاه آن رویداد برای یکی از آیتم‌ها رخ دهد، *func* فراخوانی " +"شود. این مانند :meth:`Widget.bind ` است، اما روی آیتم‌های بوم به‌جای " +"ابزارک‌های کامل عمل می‌کند؛ فقط رویدادهای ماوس، صفحه‌کلید و مجازی را می‌توان متصل کرد. " +"رویدادهای ماوس به آیتم جاری و رویدادهای صفحه‌کلید به آیتم دارای فوکوس هدایت می‌شوند " +"(به :meth:`focus` مراجعه کنید). اگر *add* درست باشد، اتصال جدید به هرگونه اتصال " +"موجود برای همان دنباله افزوده می‌شود، نه اینکه آن‌ها را جایگزین کند. شناسه تابع " +"متصل‌شده را برمی‌گرداند؛ می‌توان این شناسه را به :meth:`tag_unbind` داد." -msgid "Remove for all items given by *tagOrId* the binding for the event *sequence*. If *funcid* is given, only that callback (as returned by :meth:`tag_bind`) is unbound and deregistered." +msgid "" +"Remove for all items given by *tagOrId* the binding for the event *sequence*. If " +"*funcid* is given, only that callback (as returned by :meth:`tag_bind`) is unbound " +"and deregistered." msgstr "" +"اتصال رویداد *sequence* را برای همه آیتم‌های مشخص‌شده با *tagOrId* حذف می‌کند. اگر " +"*funcid* داده شود، فقط همان کال‌بک (که توسط :meth:`tag_bind` برگردانده‌شده است) لغو " +"اتصال می‌شود و از ثبت خارج می‌گردد." msgid "If *funcid* is given, only that callback is unbound." -msgstr "" +msgstr "اگر *funcid* داده شده باشد، فقط همان کال‌بک از اتصال خارج می‌شود." -msgid "Return a 4-tuple ``(x1, y1, x2, y2)`` giving an approximate bounding box, in pixels, that encloses all the items given by *tagOrId* and any further *tagOrIds*. The result may overestimate the true bounding box by a few pixels. Return ``None`` if no item matches or the matching items have nothing to display." +msgid "" +"Return a 4-tuple ``(x1, y1, x2, y2)`` giving an approximate bounding box, in pixels, " +"that encloses all the items given by *tagOrId* and any further *tagOrIds*. The " +"result may overestimate the true bounding box by a few pixels. Return ``None`` if no " +"item matches or the matching items have nothing to display." msgstr "" +"یک ۴-تایی ``(x1, y1, x2, y2)`` برگردانید که یک جعبه‌ی محدودکننده (bounding box) تقریبی را " +"بر حسب پیکسل ارائه می‌دهد، جعبه‌ای که همه آیتم‌های مشخص‌شده با *tagOrId* و هر *tagOrIds* " +"دیگری را در بر می‌گیرد. ممکن است نتیجه، جعبه‌ی محدودکننده واقعی را به اندازه چند پیکسل " +"بیش‌برآورد کند. اگر هیچ آیتمی مطابقت نداشته باشد یا آیتم‌های منطبق چیزی برای نمایش " +"نداشته باشند، ``None`` را برگردانید." -msgid "This shadows the inherited :meth:`!Misc.bbox`; use :meth:`~Misc.grid_bbox` for the grid bounding box." +msgid "" +"This shadows the inherited :meth:`!Misc.bbox`; use :meth:`~Misc.grid_bbox` for the " +"grid bounding box." msgstr "" +"این، :meth:`!Misc.bbox` موروثی را می‌پوشاند؛ برای جعبه‌ی محدودکننده شبکه " +"از :meth:`~Misc.grid_bbox` استفاده کنید." -msgid "Given a window x-coordinate *screenx*, return the canvas x-coordinate displayed at that location. If *gridspacing* is given, the result is rounded to the nearest multiple of *gridspacing* units." +msgid "" +"Given a window x-coordinate *screenx*, return the canvas x-coordinate displayed at " +"that location. If *gridspacing* is given, the result is rounded to the nearest " +"multiple of *gridspacing* units." msgstr "" +"با داشتن مختصات x پنجره *screenx*، مختصات x بوم نمایش‌داده‌شده در آن موقعیت را " +"برمی‌گرداند. اگر *gridspacing* داده شده باشد، نتیجه به نزدیک‌ترین مضرب از واحدهای " +"*gridspacing* گرد می‌شود." -msgid "Given a window y-coordinate *screeny*, return the canvas y-coordinate displayed at that location. If *gridspacing* is given, the result is rounded to the nearest multiple of *gridspacing* units." +msgid "" +"Given a window y-coordinate *screeny*, return the canvas y-coordinate displayed at " +"that location. If *gridspacing* is given, the result is rounded to the nearest " +"multiple of *gridspacing* units." msgstr "" +"با فرض مختصات y پنجره *screeny*، مختصات y بوم نمایش‌داده‌شده در آن موقعیت را " +"برمی‌گرداند. اگر *gridspacing* داده شود، نتیجه به نزدیک‌ترین مضرب از واحدهای " +"*gridspacing* گرد می‌شود." -msgid "With *tagOrId*, set the keyboard focus for the canvas to the first item given by *tagOrId* that supports the insertion cursor; the focus is left unchanged if no such item exists. If *tagOrId* is an empty string, reset the focus so that no item has it. With no argument, return the id of the item that currently has the focus, or an empty string if none does. An item only displays the insertion cursor when both it is the focus item and its canvas has the input focus." -msgstr "" +msgid "" +"With *tagOrId*, set the keyboard focus for the canvas to the first item given by " +"*tagOrId* that supports the insertion cursor; the focus is left unchanged if no such " +"item exists. If *tagOrId* is an empty string, reset the focus so that no item has " +"it. With no argument, return the id of the item that currently has the focus, or an " +"empty string if none does. An item only displays the insertion cursor when both it " +"is the focus item and its canvas has the input focus." +msgstr "" +"با *tagOrId*، فوکوس صفحه‌کلید برای بوم را روی اولین آیتم مشخص‌شده توسط *tagOrId* که از " +"مکان‌نمای درج پشتیبانی می‌کند، تنظیم می‌کند؛ اگر چنین آیتمی وجود نداشته باشد، فوکوس " +"بدون تغییر باقی می‌ماند. اگر *tagOrId* یک رشته خالی باشد، فوکوس را بازنشانی می‌کند تا " +"هیچ آیتمی آن را نداشته باشد. بدون آرگومان، شناسه آیتمی را که در حال حاضر فوکوس را " +"دارد برمی‌گرداند، یا اگر هیچ آیتمی آن را نداشته باشد، یک رشته خالی برمی‌گرداند. یک " +"آیتم تنها زمانی مکان‌نمای درج را نمایش می‌دهد که هم خود آن آیتم دارای فوکوس باشد و هم " +"بوم آن فوکوس ورودی را داشته باشد." -msgid "This shadows the inherited :meth:`!Misc.focus`; use :meth:`~Misc.focus_set` to focus the widget itself." +msgid "" +"This shadows the inherited :meth:`!Misc.focus`; use :meth:`~Misc.focus_set` to focus " +"the widget itself." msgstr "" +"این، :meth:`!Misc.focus` موروثی را می‌پوشاند؛ برای فوکوس کردن خود ابزارک " +"از :meth:`~Misc.focus_set` استفاده کنید." -msgid "Set the insertion cursor of the items given by *tagOrId* to just before the character given by *index*. Items that do not support an insertion cursor are unaffected. The cursor is only displayed when the item has the focus, but its position may be set at any time." +msgid "" +"Set the insertion cursor of the items given by *tagOrId* to just before the " +"character given by *index*. Items that do not support an insertion cursor are " +"unaffected. The cursor is only displayed when the item has the focus, but its " +"position may be set at any time." msgstr "" +"مکان‌نمای درج آیتم‌های مشخص‌شده با *tagOrId* را دقیقاً پیش از نویسه‌ی مشخص‌شده با *index* " +"قرار دهید. آیتم‌هایی که از مکان‌نمای درج پشتیبانی نمی‌کنند، تحت تأثیر قرار نمی‌گیرند. " +"مکان‌نما تنها زمانی نمایش داده می‌شود که آیتم فوکوس داشته باشد، اما می‌توان موقعیت آن " +"را در هر زمانی تنظیم کرد." -msgid "Return as an integer the numerical index within *tagOrId* corresponding to *index*, which is a textual description of a position (for text items an index into the characters, for line and polygon items an index into the coordinates). If *tagOrId* matches several items, the first one that supports indexing is used." +msgid "" +"Return as an integer the numerical index within *tagOrId* corresponding to *index*, " +"which is a textual description of a position (for text items an index into the " +"characters, for line and polygon items an index into the coordinates). If *tagOrId* " +"matches several items, the first one that supports indexing is used." msgstr "" +"اندیس عددی در *tagOrId* را که متناظر با *index* است، به‌صورت یک عدد صحیح برمی‌گرداند؛ " +"*index* توصیفی متنی از یک موقعیت است (برای آیتم‌های متنی، اندیسی در نویسه‌ها، و برای " +"آیتم‌های خط و چندضلعی، اندیسی در مختصات). اگر *tagOrId* با چند آیتم مطابقت داشته " +"باشد، از نخستین آیتمی که از اندیس‌دهی پشتیبانی کند استفاده می‌شود." -msgid "Adjust the end of the selection in *tagOrId* nearest to *index* so that it is at *index*, and make the other end the anchor point for future :meth:`select_to` calls. If the selection is not currently in *tagOrId*, this behaves like :meth:`select_to`." +msgid "" +"Adjust the end of the selection in *tagOrId* nearest to *index* so that it is at " +"*index*, and make the other end the anchor point for future :meth:`select_to` calls. " +"If the selection is not currently in *tagOrId*, this behaves like :meth:`select_to`." msgstr "" +"انتهای انتخاب در *tagOrId* را که به *index* نزدیک‌تر است، طوری تنظیم می‌کند که در " +"*index* قرار گیرد، و انتهای دیگر را نقطه‌ی لنگر برای فراخوانی‌های " +"بعدی :meth:`select_to` قرار می‌دهد. اگر انتخاب در حال حاضر در *tagOrId* نباشد، " +"مانند :meth:`select_to` رفتار می‌کند." msgid "Clear the selection if it is in this canvas; otherwise do nothing." msgstr "" +"اگر انتخاب در این بوم است، آن را پاک کنید؛ در غیر این صورت، هیچ کاری انجام ندهید." -msgid "Set the selection anchor point to just before the character given by *index* in the item given by *tagOrId*. This does not change the selection itself; it sets the fixed end for future :meth:`select_to` calls." +msgid "" +"Set the selection anchor point to just before the character given by *index* in the " +"item given by *tagOrId*. This does not change the selection itself; it sets the " +"fixed end for future :meth:`select_to` calls." msgstr "" +"نقطه‌ی لنگر انتخاب را درست پیش از نویسه‌ی مشخص‌شده با *index* در آیتم مشخص‌شده با " +"*tagOrId* تنظیم کنید. این کار خود انتخاب را تغییر نمی‌دهد؛ بلکه پایان ثابتی را برای " +"فراخوانی‌های بعدی :meth:`select_to` تعیین می‌کند." -msgid "Return the id of the item that holds the selection, or ``None`` if the selection is not in this canvas. Unlike :meth:`find` and the ``find_*`` methods, this returns the id as a string rather than an integer." +msgid "" +"Return the id of the item that holds the selection, or ``None`` if the selection is " +"not in this canvas. Unlike :meth:`find` and the ``find_*`` methods, this returns the " +"id as a string rather than an integer." msgstr "" +"شناسه آیتمی که انتخاب را در بر دارد برگردانید، یا اگر انتخاب در این بوم نباشد " +"``None`` برگردانید. برخلاف :meth:`find` و متدهای ``find_*``، این متد شناسه را به‌جای " +"عدد صحیح به‌صورت رشته برمی‌گرداند." -msgid "Set the selection to the characters of *tagOrId* between the selection anchor point and *index*, inclusive of *index*. The anchor point is the one set by the most recent :meth:`select_adjust` or :meth:`select_from` call." +msgid "" +"Set the selection to the characters of *tagOrId* between the selection anchor point " +"and *index*, inclusive of *index*. The anchor point is the one set by the most " +"recent :meth:`select_adjust` or :meth:`select_from` call." msgstr "" +"انتخاب را روی نویسه‌های *tagOrId* بین نقطه‌ی لنگر انتخاب و *index*، شامل خود *index*، " +"تنظیم می‌کند. نقطه‌ی لنگر همان نقطه‌ای است که توسط آخرین فراخوانی :meth:`select_adjust` " +"یا :meth:`select_from` تنظیم شده است." -msgid "Record *x*, *y* and the current view, for use with later :meth:`scan_dragto` calls. This is typically bound to a mouse button press in the widget." +msgid "" +"Record *x*, *y* and the current view, for use with later :meth:`scan_dragto` calls. " +"This is typically bound to a mouse button press in the widget." msgstr "" +"*x*، *y* و نمای فعلی را برای استفاده در فراخوانی‌های بعدی :meth:`scan_dragto` ثبت " +"کنید. این کار معمولاً به فشار دکمه ماوس در ابزارک متصل می‌شود." -msgid "Scroll the canvas by *gain* times the difference between *x*, *y* and the coordinates passed to the last :meth:`scan_mark` call. This is typically bound to mouse motion events in the widget, producing the effect of dragging the canvas at high speed through its window." +msgid "" +"Scroll the canvas by *gain* times the difference between *x*, *y* and the " +"coordinates passed to the last :meth:`scan_mark` call. This is typically bound to " +"mouse motion events in the widget, producing the effect of dragging the canvas at " +"high speed through its window." msgstr "" +"بوم را به اندازه‌ی *gain* برابرِ اختلاف میان *x*، *y* و مختصات ارسال‌شده به آخرین " +"فراخوانی :meth:`scan_mark` پیمایش کنید. این معمولاً به رویدادهای حرکت ماوس در ابزارک " +"متصل می‌شود و جلوه‌ی کشیدن بوم با سرعت بالا در پنجره‌ی خود را ایجاد می‌کند." -msgid "Generate a PostScript (Encapsulated PostScript, version 3.0) representation of part or all of the canvas. If the *file* or *channel* option is given, the PostScript is written there and an empty string is returned; otherwise it is returned as a string. By default only the area currently visible in the window is generated, so it is usually necessary either to call :meth:`~Misc.update` first or to use the *width* and *height* options. Supported options include *colormap*, *colormode*, *file*, *fontmap*, *height*, *pageanchor*, *pageheight*, *pagewidth*, *pagex*, *pagey*, *rotate*, *width*, *x* and *y*." -msgstr "" +msgid "" +"Generate a PostScript (Encapsulated PostScript, version 3.0) representation of part " +"or all of the canvas. If the *file* or *channel* option is given, the PostScript is " +"written there and an empty string is returned; otherwise it is returned as a string. " +"By default only the area currently visible in the window is generated, so it is " +"usually necessary either to call :meth:`~Misc.update` first or to use the *width* " +"and *height* options. Supported options include *colormap*, *colormode*, *file*, " +"*fontmap*, *height*, *pageanchor*, *pageheight*, *pagewidth*, *pagex*, *pagey*, " +"*rotate*, *width*, *x* and *y*." +msgstr "" +"یک بازنمایی PostScript (Encapsulated PostScript، نسخه‌ی 3.0) از بخشی یا کل بوم تولید " +"می‌کند. اگر گزینه‌ی *file* یا *channel* داده شود، PostScript در آن‌جا نوشته می‌شود و یک " +"رشته‌ی خالی برگردانده می‌شود؛ در غیر این صورت به‌صورت یک رشته برگردانده می‌شود. به‌طور " +"پیش‌فرض، فقط ناحیه‌ای که در حال حاضر در پنجره قابل‌مشاهده است، تولید می‌شود؛ بنابراین " +"معمولاً لازم است یا ابتدا :meth:`~Misc.update` فراخوانی شود یا از گزینه‌های *width* و " +"*height* استفاده شود. گزینه‌های پشتیبانی‌شده شامل *colormap*، *colormode*، *file*، " +"*fontmap*، *height*، *pageanchor*، *pageheight*، *pagewidth*، *pagex*، *pagey*، " +"*rotate*، *width*، *x* و *y* می‌شوند." -msgid "A :class:`!Checkbutton` widget displays a textual string, bitmap or image together with a square indicator, and toggles a boolean selection when pressed. It has all the behavior of a simple button and, in addition, can be selected: when selected the indicator is drawn with a check mark and the associated variable is set to the ``onvalue``, and when deselected the indicator is drawn empty and the variable is set to the ``offvalue``. Inherits from :class:`Widget`. In addition to the standard widget options, a checkbutton accepts the options documented in the Tk ``checkbutton`` manual page, such as *variable*, *onvalue*, *offvalue* and *command*." -msgstr "" +msgid "" +"A :class:`!Checkbutton` widget displays a textual string, bitmap or image together " +"with a square indicator, and toggles a boolean selection when pressed. It has all " +"the behavior of a simple button and, in addition, can be selected: when selected the " +"indicator is drawn with a check mark and the associated variable is set to the " +"``onvalue``, and when deselected the indicator is drawn empty and the variable is " +"set to the ``offvalue``. Inherits from :class:`Widget`. In addition to the standard " +"widget options, a checkbutton accepts the options documented in the Tk " +"``checkbutton`` manual page, such as *variable*, *onvalue*, *offvalue* and *command*." +msgstr "" +"ابزارک :class:`!Checkbutton` یک رشته متنی، بیت‌مپ یا تصویر را به‌همراه یک نشانگر مربعی " +"نمایش می‌دهد و هنگام فشرده شدن، باعث تغییر وضعیت یک انتخاب بولی می‌شود. این ابزارک " +"تمام رفتار یک دکمه ساده را دارد و علاوه بر این، قابل انتخاب است: هنگام انتخاب، " +"نشانگر با یک علامت تیک ترسیم می‌شود و متغیر مرتبط به ``onvalue`` تنظیم می‌شود، و هنگام " +"لغو انتخاب، نشانگر خالی ترسیم می‌شود و متغیر به ``offvalue`` تنظیم می‌شود. این ابزارک " +"از :class:`Widget` ارث می‌برد. علاوه بر گزینه‌های استاندارد ابزارک، ابزارک Checkbutton " +"گزینه‌هایی را می‌پذیرد که در صفحه راهنمای ``checkbutton`` در Tk مستند شده‌اند، مانند " +"*variable*، *onvalue*، *offvalue* و *command*." -msgid "Do just what would happen if the user pressed the checkbutton with the mouse: toggle the selection state of the button and invoke the associated command, if there is one. Return the result of the command, or an empty string if no command is associated with the checkbutton. This is ignored if the checkbutton's state is ``disabled``." -msgstr "" +msgid "" +"Do just what would happen if the user pressed the checkbutton with the mouse: toggle " +"the selection state of the button and invoke the associated command, if there is " +"one. Return the result of the command, or an empty string if no command is " +"associated with the checkbutton. This is ignored if the checkbutton's state is " +"``disabled``." +msgstr "" +"دقیقاً همان کاری را انجام می‌دهد که اگر کاربر دکمه‌ی انتخابی (checkbutton) را با ماوس " +"فشار می‌داد، رخ می‌داد: وضعیت انتخاب دکمه را معکوس می‌کند و فرمان مرتبط را، در صورت " +"وجود، فراخوانی می‌کند. نتیجه‌ی فرمان را برمی‌گرداند، یا اگر فرمانی به دکمه‌ی انتخابی " +"مرتبط نباشد، یک رشته‌ی خالی برمی‌گرداند. اگر وضعیت دکمه‌ی انتخابی ``disabled`` باشد، " +"این عمل نادیده گرفته می‌شود." msgid "Select the checkbutton and set the associated variable to its ``onvalue``." msgstr "" +"دکمه‌ی انتخابی (checkbutton) را انتخاب کنید و متغیر مرتبط با آن را روی ``onvalue`` آن " +"تنظیم کنید." msgid "Deselect the checkbutton and set the associated variable to its ``offvalue``." msgstr "" +"دکمه‌ی انتخابی (checkbutton) را از حالت انتخاب خارج کنید و متغیر مرتبط را روی " +"``offvalue`` آن تنظیم کنید." -msgid "Toggle the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state." +msgid "" +"Toggle the selection state of the button, redisplaying it and modifying its " +"associated variable to reflect the new state." msgstr "" +"وضعیت انتخاب دکمه را تغییر می‌دهد، آن را دوباره نمایش می‌دهد و متغیر مرتبط با آن را " +"تغییر می‌دهد تا وضعیت جدید را منعکس کند." -msgid "Flash the checkbutton by redisplaying it several times, alternating between the active and normal colors. At the end of the flash the checkbutton is left in the same normal or active state as when the method was called. This is ignored if the checkbutton's state is ``disabled``." +msgid "" +"Flash the checkbutton by redisplaying it several times, alternating between the " +"active and normal colors. At the end of the flash the checkbutton is left in the " +"same normal or active state as when the method was called. This is ignored if the " +"checkbutton's state is ``disabled``." msgstr "" +"دکمه‌ی انتخابی (checkbutton) را با نمایش دوباره‌ی آن چندین بار و جابه‌جایی متناوب بین " +"رنگ‌های فعال و عادی، به‌صورت چشمک درآورید. در پایان چشمک، دکمه‌ی انتخابی در همان وضعیت " +"عادی یا فعالی که در زمان فراخوانی متد داشت باقی می‌ماند. اگر وضعیت دکمه‌ی انتخابی " +"``disabled`` باشد، این عمل نادیده گرفته می‌شود." -msgid "An :class:`!Entry` widget displays a single line of text and lets the user edit it. Inherits from :class:`Widget` and :class:`XView`; since entries can hold strings too long to fit in the window, they support horizontal scrolling through :meth:`~XView.xview`." +msgid "" +"An :class:`!Entry` widget displays a single line of text and lets the user edit it. " +"Inherits from :class:`Widget` and :class:`XView`; since entries can hold strings too " +"long to fit in the window, they support horizontal scrolling " +"through :meth:`~XView.xview`." msgstr "" +"یک ابزارک :class:`!Entry` یک خط از متن را نمایش می‌دهد و به کاربر اجازه می‌دهد آن را " +"ویرایش کند. این ابزارک از :class:`Widget` و :class:`XView` ارث می‌برد؛ از آن‌جا که " +"ورودی‌ها می‌توانند رشته‌هایی را در خود نگه دارند که برای جا شدن در پنجره بیش از حد " +"طولانی هستند، از پیمایش افقی از طریق :meth:`~XView.xview` پشتیبانی می‌کنند." -msgid "In addition to the standard widget options, an entry accepts the options documented in the Tk ``entry`` manual page. Notable ones are *textvariable* (the name of a variable kept in sync with the entry's contents), *show* (if set, each character is displayed as the given character rather than its true value, useful for password entry), *validate* and *validatecommand* (which together let a callback accept or reject edits), and *state* (one of ``'normal'``, ``'disabled'`` or ``'readonly'``)." -msgstr "" +msgid "" +"In addition to the standard widget options, an entry accepts the options documented " +"in the Tk ``entry`` manual page. Notable ones are *textvariable* (the name of a " +"variable kept in sync with the entry's contents), *show* (if set, each character is " +"displayed as the given character rather than its true value, useful for password " +"entry), *validate* and *validatecommand* (which together let a callback accept or " +"reject edits), and *state* (one of ``'normal'``, ``'disabled'`` or ``'readonly'``)." +msgstr "" +"علاوه بر گزینه‌های استاندارد ابزارک، یک ورودی گزینه‌های مستندشده در صفحه‌ی راهنمای " +"``entry`` در Tk را می‌پذیرد. گزینه‌های قابل‌توجه عبارت‌اند از *textvariable* (نام متغیری " +"که با محتوای ورودی همگام نگه داشته می‌شود)، *show* (در صورت تنظیم، هر نویسه به‌جای " +"مقدار واقعی‌اش به‌صورت نویسه‌ی داده‌شده نمایش داده می‌شود؛ برای ورود گذرواژه مفید است)، " +"*validate* و *validatecommand* (که با هم به یک کال‌بک امکان می‌دهند ویرایش‌ها را بپذیرد " +"یا رد کند)، و *state* (یکی از ``'normal'``، ``'disabled'`` یا ``'readonly'``)." -msgid "Many of the methods below take an *index* argument that selects a character in the entry's string. As described in the Tk ``entry`` manual page, *index* may be a number (counting from 0), ``'insert'`` (the character just after the insertion cursor), ``'end'`` (just after the last character), ``'anchor'`` (the selection anchor point), ``'sel.first'`` and ``'sel.last'`` (the ends of the selection), or ``@x`` (the character covering pixel x-coordinate *x* in the window). Out-of-range indices are rounded to the nearest legal value." -msgstr "" +msgid "" +"Many of the methods below take an *index* argument that selects a character in the " +"entry's string. As described in the Tk ``entry`` manual page, *index* may be a " +"number (counting from 0), ``'insert'`` (the character just after the insertion " +"cursor), ``'end'`` (just after the last character), ``'anchor'`` (the selection " +"anchor point), ``'sel.first'`` and ``'sel.last'`` (the ends of the selection), or " +"``@x`` (the character covering pixel x-coordinate *x* in the window). Out-of-range " +"indices are rounded to the nearest legal value." +msgstr "" +"بسیاری از متدهای زیر یک آرگومان *اندیس* می‌گیرند که نویسه‌ای را در رشته‌ی ورودی انتخاب " +"می‌کند. همان‌طور که در صفحه‌ی راهنمای ``entry`` در Tk توضیح داده شده است، *اندیس* " +"می‌تواند عددی باشد (با شمارش از ۰)، ``'insert'`` (نویسه‌ی درست پس از مکان‌نمای درج)، " +"``'end'`` (درست پس از آخرین نویسه)، ``'anchor'`` (نقطه‌ی لنگر انتخاب)، ``'sel.first'`` " +"و ``'sel.last'`` (دو سر انتخاب)، یا ``@x`` (نویسه‌ای که پیکسلی با مختصات x برابر *x* " +"در پنجره را می‌پوشاند). اندیس‌های خارج از محدوده به نزدیک‌ترین مقدار مجاز گرد می‌شوند." -msgid "Delete the characters from index *first* up to but not including index *last*. If *last* is omitted, only the single character at *first* is deleted." +msgid "" +"Delete the characters from index *first* up to but not including index *last*. If " +"*last* is omitted, only the single character at *first* is deleted." msgstr "" +"نویسه‌ها را از اندیس *first* تا پیش از اندیس *last* حذف می‌کند. اگر *last* ذکر نشود، " +"تنها یک نویسه در اندیس *first* حذف می‌شود." msgid "Return the entry's current string." -msgstr "" +msgstr "رشته‌ی فعلی ورودی را برمی‌گرداند." msgid "Insert *string* just before the character given by *index*." -msgstr "" +msgstr "*string* را درست پیش از نویسه‌ای که با *index* مشخص‌شده است درج کنید." -msgid "Arrange for the insertion cursor to be displayed just before the character given by *index*." +msgid "" +"Arrange for the insertion cursor to be displayed just before the character given by " +"*index*." msgstr "" +"ترتیبی دهید که مکان‌نمای درج درست پیش از نویسه‌ی مشخص‌شده توسط *index* نمایش داده شود." msgid "Return the numerical index corresponding to *index*." -msgstr "" +msgstr "اندیس عددی متناظر با *index* را برمی‌گرداند." -msgid "Locate the end of the selection nearest to the character given by *index*, and adjust that end to be at *index* (including but not going beyond it); the other end becomes the anchor point for future :meth:`selection_to` calls. If there is no selection in the entry, a new one is created between *index* and the most recent anchor point, inclusive. :meth:`select_adjust` is an alias of :meth:`!selection_adjust`." -msgstr "" +msgid "" +"Locate the end of the selection nearest to the character given by *index*, and " +"adjust that end to be at *index* (including but not going beyond it); the other end " +"becomes the anchor point for future :meth:`selection_to` calls. If there is no " +"selection in the entry, a new one is created between *index* and the most recent " +"anchor point, inclusive. :meth:`select_adjust` is an alias of :meth:`!" +"selection_adjust`." +msgstr "" +"انتهای انتخاب را که به نویسه‌ی مشخص‌شده با *index* نزدیک‌تر است پیدا کنید و آن انتها را " +"طوری تنظیم کنید که در *index* قرار گیرد (شامل آن، اما بدون عبور از آن)؛ انتهای دیگر " +"به نقطه‌ی لنگر برای فراخوانی‌های آینده‌ی :meth:`selection_to` تبدیل می‌شود. اگر انتخابی " +"در ورودی وجود نداشته باشد، انتخاب جدیدی بین *index* و آخرین نقطه‌ی لنگر، به‌صورت شامل، " +"ایجاد می‌شود. :meth:`select_adjust` نام مستعار :meth:`!selection_adjust` است." -msgid "Clear the selection if it is currently in this widget. If the selection is not in this widget the method has no effect. :meth:`select_clear` is an alias of :meth:`!selection_clear`." +msgid "" +"Clear the selection if it is currently in this widget. If the selection is not in " +"this widget the method has no effect. :meth:`select_clear` is an alias of :meth:`!" +"selection_clear`." msgstr "" +"اگر انتخاب در حال حاضر در این ابزارک قرار دارد، آن را پاک می‌کند. اگر انتخاب در این " +"ابزارک نباشد، این متد هیچ تأثیری ندارد. :meth:`select_clear` نام مستعاری از :meth:`!" +"selection_clear` است." -msgid "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X selection; that method is not available on an :class:`Entry`." +msgid "" +"This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " +"selection; that method is not available on an :class:`Entry`." msgstr "" +"این، متد به‌ارث‌رسیده‌ی :meth:`Misc.selection_clear` را می‌پوشاند، که انتخاب X را پاک " +"می‌کند؛ آن متد روی یک :class:`Entry` در دسترس نیست." -msgid "Set the selection anchor point to just before the character given by *index*, without changing the selection. :meth:`select_from` is an alias of :meth:`!selection_from`." +msgid "" +"Set the selection anchor point to just before the character given by *index*, " +"without changing the selection. :meth:`select_from` is an alias of :meth:`!" +"selection_from`." msgstr "" +"نقطه‌ی لنگر انتخاب را درست پیش از نویسه‌ی مشخص‌شده با *index*، بدون تغییر انتخاب، قرار " +"می‌دهد. :meth:`select_from` نام مستعاری برای :meth:`!selection_from` است." -msgid "Return ``True`` if there are characters selected in the entry, ``False`` otherwise. :meth:`select_present` is an alias of :meth:`!selection_present`." +msgid "" +"Return ``True`` if there are characters selected in the entry, ``False`` " +"otherwise. :meth:`select_present` is an alias of :meth:`!selection_present`." msgstr "" +"اگر نویسه‌هایی در ورودی انتخاب شده باشند، ``True`` را برمی‌گرداند، در غیر این صورت " +"``False`` را برمی‌گرداند. :meth:`select_present` نام مستعاری برای :meth:`!" +"selection_present` است." -msgid "Set the selection to include the characters starting with the one indexed by *start* and ending with the one just before *end*. If *end* refers to the same character as *start* or an earlier one, the selection is cleared. :meth:`select_range` is an alias of :meth:`!selection_range`." +msgid "" +"Set the selection to include the characters starting with the one indexed by *start* " +"and ending with the one just before *end*. If *end* refers to the same character as " +"*start* or an earlier one, the selection is cleared. :meth:`select_range` is an " +"alias of :meth:`!selection_range`." msgstr "" +"انتخاب را طوری تنظیم کنید که شامل نویسه‌هایی باشد که از نویسه‌ی با اندیس *start* شروع " +"می‌شود و به نویسه‌ی درست پیش از *end* ختم می‌شود. اگر *end* به همان نویسه‌ی *start* یا به " +"نویسه‌ای پیش‌تر از آن اشاره کند، انتخاب پاک می‌شود. :meth:`select_range` نام مستعاری " +"برای :meth:`!selection_range` است." -msgid "Set the selection between the anchor point and *index*: if *index* is before the anchor point, the selection runs from *index* up to but not including the anchor; if *index* is after it, from the anchor up to but not including *index*; if they coincide, nothing happens. The anchor point is the one set by the most recent :meth:`selection_from` or :meth:`selection_adjust` call. If there is no selection in the entry, a new one is created using the most recent anchor point. :meth:`select_to` is an alias of :meth:`!selection_to`." -msgstr "" +msgid "" +"Set the selection between the anchor point and *index*: if *index* is before the " +"anchor point, the selection runs from *index* up to but not including the anchor; if " +"*index* is after it, from the anchor up to but not including *index*; if they " +"coincide, nothing happens. The anchor point is the one set by the most " +"recent :meth:`selection_from` or :meth:`selection_adjust` call. If there is no " +"selection in the entry, a new one is created using the most recent anchor " +"point. :meth:`select_to` is an alias of :meth:`!selection_to`." +msgstr "" +"انتخاب بین نقطه‌ی لنگر و *index* را تنظیم می‌کند: اگر *index* پیش از نقطه‌ی لنگر باشد، " +"انتخاب از *index* تا نقطه‌ی لنگر ادامه دارد، بدون اینکه نقطه‌ی لنگر را شامل شود؛ اگر " +"*index* پس از آن باشد، از نقطه‌ی لنگر تا *index* ادامه دارد، بدون اینکه *index* را " +"شامل شود؛ اگر این دو بر هم منطبق باشند، اتفاقی رخ نمی‌دهد. نقطه‌ی لنگر همان نقطه‌ای است " +"که آخرین فراخوانی :meth:`selection_from` یا :meth:`selection_adjust` آن را تنظیم " +"کرده است. اگر انتخابی در ورودی وجود نداشته باشد، انتخاب جدیدی با استفاده از آخرین " +"نقطه‌ی لنگر ایجاد می‌شود. :meth:`select_to` نام مستعاری از :meth:`!selection_to` است." -msgid "Record *x* and the current view in the entry window, for use with later :meth:`scan_dragto` calls. Typically associated with a mouse button press in the widget." +msgid "" +"Record *x* and the current view in the entry window, for use with " +"later :meth:`scan_dragto` calls. Typically associated with a mouse button press in " +"the widget." msgstr "" +"*x* و نمای فعلی را در پنجره‌ی ورودی ثبت می‌کند، برای استفاده در فراخوانی‌های " +"بعدی :meth:`scan_dragto`. معمولاً با فشار دکمه‌ی ماوس در ابزارک مرتبط است." -msgid "Compute the difference between *x* and the *x* given to the last :meth:`scan_mark` call, and adjust the view left or right by 10 times that difference. Typically associated with mouse motion events, to produce the effect of dragging the entry at high speed through the window." +msgid "" +"Compute the difference between *x* and the *x* given to the last :meth:`scan_mark` " +"call, and adjust the view left or right by 10 times that difference. Typically " +"associated with mouse motion events, to produce the effect of dragging the entry at " +"high speed through the window." msgstr "" +"تفاوت میان *x* و *x* داده‌شده به آخرین فراخوانی :meth:`scan_mark` را محاسبه می‌کند و " +"نما را به میزان ۱۰ برابر آن تفاوت به چپ یا راست تنظیم می‌کند. معمولاً با رویدادهای " +"حرکت ماوس مرتبط است تا اثر کشیدن ورودی با سرعت بالا در پنجره را ایجاد کند." -msgid "A :class:`!Frame` widget is a simple container. Its primary purpose is to act as a spacer or container for complex window layouts; its only features are its background and an optional 3-D border to make the frame appear raised or sunken. Inherits from :class:`Widget`. Refer to the Tk ``frame`` manual page for the full list of options." +msgid "" +"A :class:`!Frame` widget is a simple container. Its primary purpose is to act as a " +"spacer or container for complex window layouts; its only features are its background " +"and an optional 3-D border to make the frame appear raised or sunken. Inherits " +"from :class:`Widget`. Refer to the Tk ``frame`` manual page for the full list of " +"options." msgstr "" +"ابزارک :class:`!Frame` یک محفظه ساده است. هدف اصلی آن این است که به‌عنوان فاصله‌گذار یا " +"محفظه‌ای برای چیدمان‌های پیچیده پنجره عمل کند؛ تنها ویژگی‌های آن، پس‌زمینه و یک حاشیه " +"سه‌بعدی اختیاری برای برجسته یا فرورفته نشان دادن فریم است. از :class:`Widget` ارث " +"می‌برد. برای فهرست کامل گزینه‌ها به صفحه راهنمای ``frame`` در Tk مراجعه کنید." -msgid "A :class:`!Label` widget displays a non-interactive textual string, bitmap or image. The displayed text is set with the *text* option or linked to a variable through *textvariable*, and an image can be shown using the *image* option. Text must all be in a single font but may occupy multiple lines, and one character may be underlined with the *underline* option. Inherits from :class:`Widget`. Refer to the Tk ``label`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Label` widget displays a non-interactive textual string, bitmap or image. " +"The displayed text is set with the *text* option or linked to a variable through " +"*textvariable*, and an image can be shown using the *image* option. Text must all be " +"in a single font but may occupy multiple lines, and one character may be underlined " +"with the *underline* option. Inherits from :class:`Widget`. Refer to the Tk " +"``label`` manual page for the full list of options." +msgstr "" +"ابزارک :class:`!Label` یک رشته متنی، بیت‌مپ یا تصویر را به‌صورت غیرتعاملی نمایش می‌دهد. " +"متن نمایش‌داده‌شده با گزینه *text* تنظیم می‌شود یا از طریق *textvariable* به یک متغیر " +"پیوند داده می‌شود، و می‌توان یک تصویر را با گزینه *image* نمایش داد. تمام متن باید با " +"یک قلم واحد باشد اما می‌تواند چند خط را اشغال کند، و می‌توان یک نویسه را با گزینه " +"*underline* زیرخط‌دار کرد. از :class:`Widget` ارث می‌برد. برای فهرست کامل گزینه‌ها، به " +"صفحه‌ی راهنمای ``label`` در Tk مراجعه کنید." -msgid "A :class:`!LabelFrame` widget is a container that has the features of a :class:`Frame` plus the ability to display a label. The label text is set with the *text* option and positioned with *labelanchor*, or an arbitrary widget may be used as the label by giving it as the *labelwidget* option. Inherits from :class:`Widget`. Refer to the Tk ``labelframe`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!LabelFrame` widget is a container that has the features of " +"a :class:`Frame` plus the ability to display a label. The label text is set with the " +"*text* option and positioned with *labelanchor*, or an arbitrary widget may be used " +"as the label by giving it as the *labelwidget* option. Inherits " +"from :class:`Widget`. Refer to the Tk ``labelframe`` manual page for the full list " +"of options." +msgstr "" +"ابزارک :class:`!LabelFrame` یک محفظه است که قابلیت‌های :class:`Frame` به‌علاوه‌ی توانایی " +"نمایش یک برچسب را دارد. متن برچسب با گزینه‌ی *text* تنظیم می‌شود و موقعیت آن با " +"*labelanchor* تعیین می‌شود، یا می‌توان از یک ابزارک دلخواه به‌عنوان برچسب استفاده کرد، " +"با مشخص کردن آن به‌عنوان گزینه‌ی *labelwidget*. از :class:`Widget` ارث می‌برد. برای " +"فهرست کامل گزینه‌ها، به صفحه‌ی راهنمای ``labelframe`` در Tk مراجعه کنید." -msgid "A :class:`!Listbox` widget displays a list of single-line text items, one per line, of which the user can select one or more. The way the selection behaves is governed by the *selectmode* option, which is one of ``browse`` (the default; at most one item, which may be dragged with the mouse), ``single`` (at most one item), ``multiple`` (any number of items, toggled individually), or ``extended`` (any number of items, including discontiguous ranges, selected by clicking and dragging). Inherits from :class:`Widget`, :class:`XView` and :class:`YView`, so the view can be scrolled horizontally and vertically with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``listbox`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Listbox` widget displays a list of single-line text items, one per line, " +"of which the user can select one or more. The way the selection behaves is governed " +"by the *selectmode* option, which is one of ``browse`` (the default; at most one " +"item, which may be dragged with the mouse), ``single`` (at most one item), " +"``multiple`` (any number of items, toggled individually), or ``extended`` (any " +"number of items, including discontiguous ranges, selected by clicking and dragging). " +"Inherits from :class:`Widget`, :class:`XView` and :class:`YView`, so the view can be " +"scrolled horizontally and vertically with :meth:`~XView.xview` " +"and :meth:`~YView.yview`. Refer to the Tk ``listbox`` manual page for the full list " +"of options." +msgstr "" +"ابزارک :class:`!Listbox` فهرستی از آیتم‌های متنی تک‌خطی، یکی در هر خط، نمایش می‌دهد که " +"کاربر می‌تواند یک یا چند آیتم از آن‌ها را انتخاب کند. نحوه‌ی رفتار انتخاب توسط گزینه‌ی " +"*selectmode* تعیین می‌شود، که یکی از ``browse`` (پیش‌فرض؛ حداکثر یک آیتم، که می‌توان آن " +"را با ماوس کشید)، ``single`` (حداکثر یک آیتم)، ``multiple`` (هر تعداد آیتم، که " +"هرکدام به‌صورت جداگانه تغییر وضعیت می‌یابند)، یا ``extended`` (هر تعداد آیتم، شامل " +"بازه‌های ناپیوسته، که با کلیک و کشیدن انتخاب می‌شوند) است. این ابزارک " +"از :class:`Widget`، :class:`XView` و :class:`YView` ارث می‌برد، بنابراین می‌توان نما " +"را به‌صورت افقی و عمودی با :meth:`~XView.xview` و :meth:`~YView.yview` پیمایش کرد. " +"برای فهرست کامل گزینه‌ها، به صفحه‌ی راهنمای ``listbox`` در Tk مراجعه کنید." -msgid "Many of the methods take an *index* argument identifying a particular item. As described in the Tk ``listbox`` manual page, *index* may be a numeric index (counting from 0 at the top), ``'active'`` (the item with the location cursor, set with :meth:`activate`), ``'anchor'`` (the selection anchor, set with :meth:`selection_anchor`), ``'end'`` (the last item, or for :meth:`index` and :meth:`insert` the position just after it), or ``@x,y`` (the item covering pixel coordinates *x*, *y* in the listbox window). Arguments named *first* and *last* are indices of the same forms." -msgstr "" +msgid "" +"Many of the methods take an *index* argument identifying a particular item. As " +"described in the Tk ``listbox`` manual page, *index* may be a numeric index " +"(counting from 0 at the top), ``'active'`` (the item with the location cursor, set " +"with :meth:`activate`), ``'anchor'`` (the selection anchor, set " +"with :meth:`selection_anchor`), ``'end'`` (the last item, or for :meth:`index` " +"and :meth:`insert` the position just after it), or ``@x,y`` (the item covering pixel " +"coordinates *x*, *y* in the listbox window). Arguments named *first* and *last* are " +"indices of the same forms." +msgstr "" +"بسیاری از متدها یک آرگومان *index* می‌گیرند که یک آیتم خاص را مشخص می‌کند. همان‌طور که " +"در صفحه‌ی راهنمای ``listbox`` در Tk توضیح داده شده است، *index* می‌تواند یک اندیس عددی " +"باشد (با شمارش از ۰ در بالا)، ``'active'`` (آیتم دارای مکان‌نمای موقعیت، که " +"با :meth:`activate` تنظیم می‌شود)، ``'anchor'`` (لنگر انتخاب، که " +"با :meth:`selection_anchor` تنظیم می‌شود)، ``'end'`` (آخرین آیتم، یا " +"برای :meth:`index` و :meth:`insert` موقعیت درست پس از آن)، یا ``@x,y`` (آیتمی که " +"مختصات پیکسلی *x*، *y* را در پنجره‌ی listbox پوشش می‌دهد). آرگومان‌هایی به نام‌های " +"*first* و *last* نیز اندیس‌هایی با همان قالب‌ها هستند." -msgid "Insert the given *elements* as new items just before the item given by *index*. If *index* is ``'end'``, the new items are appended to the end of the list." +msgid "" +"Insert the given *elements* as new items just before the item given by *index*. If " +"*index* is ``'end'``, the new items are appended to the end of the list." msgstr "" +"*المان‌های* داده‌شده را به‌عنوان آیتم‌های جدید، درست پیش از آیتم مشخص‌شده با *index* درج " +"کنید. اگر *index* برابر ``'end'`` باشد، آیتم‌های جدید به انتهای فهرست افزوده می‌شوند." -msgid "Delete the items in the range from *first* to *last* inclusive. If *last* is omitted, it defaults to *first*, so that a single item is deleted." +msgid "" +"Delete the items in the range from *first* to *last* inclusive. If *last* is " +"omitted, it defaults to *first*, so that a single item is deleted." msgstr "" +"آیتم‌های بازه‌ی *first* تا *last*، شامل هر دو، را حذف کنید. اگر *last* ذکر نشود، مقدار " +"پیش‌فرض آن *first* است، بنابراین یک آیتم واحد حذف می‌شود." -msgid "If *last* is omitted, return the contents of the item given by *first*, or an empty string if *first* refers to a non-existent item. If *last* is given, return a tuple of all the items in the range from *first* to *last* inclusive." +msgid "" +"If *last* is omitted, return the contents of the item given by *first*, or an empty " +"string if *first* refers to a non-existent item. If *last* is given, return a tuple " +"of all the items in the range from *first* to *last* inclusive." msgstr "" +"اگر *last* حذف شود، محتوای آیتم مشخص‌شده با *first* را برمی‌گرداند، یا اگر *first* به " +"آیتمی ناموجود اشاره کند، یک رشته خالی را برمی‌گرداند. اگر *last* داده شده باشد، یک " +"تاپل از همه‌ی آیتم‌های بازه‌ی *first* تا *last* را به‌صورت شامل هر دو برمی‌گرداند." msgid "Return the total number of items in the listbox." -msgstr "" +msgstr "تعداد کل آیتم‌های موجود در جعبه‌فهرست را برمی‌گرداند." -msgid "This shadows the inherited :meth:`!Misc.size`; use :meth:`~Misc.grid_size` for the grid size." +msgid "" +"This shadows the inherited :meth:`!Misc.size`; use :meth:`~Misc.grid_size` for the " +"grid size." msgstr "" +"این، :meth:`!Misc.size` موروثی را می‌پوشاند؛ برای اندازه‌ی شبکه " +"از :meth:`~Misc.grid_size` استفاده کنید." -msgid "Return the integer index value corresponding to *index*, or ``None`` if *index* is out of range. If *index* is ``'end'``, the result is a count of the number of items in the listbox (not the index of the last item)." +msgid "" +"Return the integer index value corresponding to *index*, or ``None`` if *index* is " +"out of range. If *index* is ``'end'``, the result is a count of the number of items " +"in the listbox (not the index of the last item)." msgstr "" +"مقدار اندیس متناظر با *index* را به‌صورت عدد صحیح برمی‌گرداند، یا اگر *index* خارج از " +"محدوده باشد، ``None`` را برمی‌گرداند. اگر *index* برابر ``'end'`` باشد، نتیجه تعداد " +"آیتم‌های جعبه‌فهرست (listbox) است (نه اندیس آخرین آیتم)." -msgid "Return a tuple ``(x, y, width, height)`` describing the bounding box, in pixels relative to the widget, of the text of the item given by *index*. Return ``None`` if no part of that item is visible on the screen, or if *index* refers to a non-existent item; if the item is only partly visible, the result still gives the full area of the item, including the parts that are not visible." -msgstr "" +msgid "" +"Return a tuple ``(x, y, width, height)`` describing the bounding box, in pixels " +"relative to the widget, of the text of the item given by *index*. Return ``None`` if " +"no part of that item is visible on the screen, or if *index* refers to a non-" +"existent item; if the item is only partly visible, the result still gives the full " +"area of the item, including the parts that are not visible." +msgstr "" +"یک تاپل ``(x, y, width, height)`` را برمی‌گرداند که جعبه‌ی محدودکننده‌ی متنِ آیتم مشخص‌شده " +"با *index* را بر حسب پیکسل، نسبت به ابزارک، توصیف می‌کند. اگر هیچ بخشی از آن آیتم روی " +"صفحه‌نمایش نمایان نباشد، یا اگر *index* به یک آیتم ناموجود اشاره کند، ``None`` را " +"برمی‌گرداند؛ اگر آیتم فقط تا حدی نمایان باشد، نتیجه همچنان ناحیه‌ی کامل آیتم را، شامل " +"بخش‌هایی که نمایان نیستند، می‌دهد." -msgid "Given a y-coordinate within the listbox window, return the index of the visible item nearest to that y-coordinate." +msgid "" +"Given a y-coordinate within the listbox window, return the index of the visible item " +"nearest to that y-coordinate." msgstr "" +"با داشتن یک مختصات y درون پنجره‌ی listbox، اندیس نزدیک‌ترین آیتم قابل مشاهده به آن " +"مختصات y را برمی‌گرداند." -msgid "Adjust the view so that the item given by *index* is visible. If the item is already visible the method has no effect; if it is near an edge of the window the listbox scrolls just enough to bring it into view at that edge, otherwise the listbox scrolls to center the item." +msgid "" +"Adjust the view so that the item given by *index* is visible. If the item is already " +"visible the method has no effect; if it is near an edge of the window the listbox " +"scrolls just enough to bring it into view at that edge, otherwise the listbox " +"scrolls to center the item." msgstr "" +"نما را طوری تنظیم کنید که آیتم مشخص‌شده با *index* قابل مشاهده باشد. اگر آیتم از قبل " +"قابل مشاهده باشد، این متد هیچ تأثیری ندارد؛ اگر به لبه‌ای از پنجره نزدیک باشد، " +"جعبه‌فهرست (listbox) فقط به اندازه‌ای پیمایش می‌شود تا آن را در همان لبه نمایان کند، در " +"غیر این صورت جعبه‌فهرست پیمایش می‌شود تا آیتم را در مرکز قرار دهد." -msgid "Set the active item to the one given by *index*. If *index* is outside the range of items, the closest item is activated instead. The active item is drawn as specified by the *activestyle* option when the widget has the input focus, and its index may be retrieved with the ``'active'`` index." +msgid "" +"Set the active item to the one given by *index*. If *index* is outside the range of " +"items, the closest item is activated instead. The active item is drawn as specified " +"by the *activestyle* option when the widget has the input focus, and its index may " +"be retrieved with the ``'active'`` index." msgstr "" +"آیتم فعال را به آیتمی که *index* آن را مشخص می‌کند، تنظیم کنید. اگر *index* خارج از " +"بازه آیتم‌ها باشد، در عوض نزدیک‌ترین آیتم فعال می‌شود. آیتم فعال، زمانی که ابزارک فوکوس " +"ورودی دارد، مطابق گزینه *activestyle* ترسیم می‌شود و می‌توان اندیس آن را با اندیس " +"``'active'`` بازیابی کرد." -msgid "Return a tuple containing the numerical indices of all of the items that are currently selected, or an empty tuple if no items are selected." +msgid "" +"Return a tuple containing the numerical indices of all of the items that are " +"currently selected, or an empty tuple if no items are selected." msgstr "" +"یک تاپل شامل اندیس‌های عددی تمام آیتم‌هایی که در حال حاضر انتخاب شده‌اند برمی‌گرداند، یا " +"اگر هیچ آیتمی انتخاب نشده باشد، یک تاپل خالی برمی‌گرداند." -msgid "Set the selection anchor to the item given by *index*. If *index* refers to a non-existent item, the closest item is used. The selection anchor is the end of the selection that is fixed while dragging out a selection with the mouse, and may afterwards be referred to with the ``'anchor'`` index. :meth:`select_anchor` is an alias of :meth:`!selection_anchor`." -msgstr "" +msgid "" +"Set the selection anchor to the item given by *index*. If *index* refers to a non-" +"existent item, the closest item is used. The selection anchor is the end of the " +"selection that is fixed while dragging out a selection with the mouse, and may " +"afterwards be referred to with the ``'anchor'`` index. :meth:`select_anchor` is an " +"alias of :meth:`!selection_anchor`." +msgstr "" +"لنگر انتخاب را روی آیتم مشخص‌شده توسط *index* تنظیم کنید. اگر *index* به آیتمی اشاره " +"کند که وجود ندارد، از نزدیک‌ترین آیتم استفاده می‌شود. لنگر انتخاب، انتهای انتخابی است " +"که هنگام کشیدن ماوس برای ایجاد یک انتخاب ثابت می‌ماند، و بعداً می‌توان با اندیس " +"``'anchor'`` به آن ارجاع داد. :meth:`select_anchor` یک نام مستعار برای :meth:`!" +"selection_anchor` است." -msgid "Deselect any of the items in the range from *first* to *last* inclusive that are selected. The selection state of items outside this range is not changed. :meth:`select_clear` is an alias of :meth:`!selection_clear`." +msgid "" +"Deselect any of the items in the range from *first* to *last* inclusive that are " +"selected. The selection state of items outside this range is not " +"changed. :meth:`select_clear` is an alias of :meth:`!selection_clear`." msgstr "" +"انتخاب هر یک از آیتم‌های انتخاب‌شده در بازه‌ی *first* تا *last* (شامل هر دو) را لغو " +"می‌کند. وضعیت انتخاب آیتم‌های خارج از این بازه تغییر نمی‌کند. :meth:`select_clear` نام " +"مستعاری از :meth:`!selection_clear` است." -msgid "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X selection; that method is not available on a :class:`Listbox`." +msgid "" +"This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " +"selection; that method is not available on a :class:`Listbox`." msgstr "" +"این، متد موروثی :meth:`Misc.selection_clear` را می‌پوشاند، که گزینش X را پاک می‌کند؛ " +"آن متد در :class:`Listbox` در دسترس نیست." -msgid "Return ``True`` if the item given by *index* is currently selected, ``False`` otherwise. :meth:`select_includes` is an alias of :meth:`!selection_includes`." +msgid "" +"Return ``True`` if the item given by *index* is currently selected, ``False`` " +"otherwise. :meth:`select_includes` is an alias of :meth:`!selection_includes`." msgstr "" +"اگر آیتم مشخص‌شده با *index* در حال حاضر انتخاب‌شده باشد، ``True`` برمی‌گرداند، در غیر " +"این صورت ``False``. :meth:`select_includes` نام مستعاری از :meth:`!" +"selection_includes` است." -msgid "Select all of the items in the range from *first* to *last* inclusive, without affecting the selection state of items outside that range. :meth:`select_set` is an alias of :meth:`!selection_set`." +msgid "" +"Select all of the items in the range from *first* to *last* inclusive, without " +"affecting the selection state of items outside that range. :meth:`select_set` is an " +"alias of :meth:`!selection_set`." msgstr "" +"تمام آیتم‌های بازه‌ی *first* تا *last* را به‌صورت شامل ابتدا و انتها انتخاب می‌کند، بدون " +"آنکه بر وضعیت انتخاب آیتم‌های خارج از آن بازه تأثیر بگذارد. :meth:`select_set` نام " +"مستعاری از :meth:`!selection_set` است." -msgid "Return the current value of the configuration option *option* for the item given by *index*." +msgid "" +"Return the current value of the configuration option *option* for the item given by " +"*index*." msgstr "" +"مقدار فعلی گزینه پیکربندی *option* را برای آیتم داده‌شده توسط *index* برمی‌گرداند." -msgid "Query or modify the configuration options of the item given by *index*. This mirrors :meth:`~Misc.configure`, except that it applies to an individual item rather than to the listbox as a whole. With no options, it returns a dictionary describing the current options of the item; otherwise it sets the given options. The supported item options are *background*, *foreground*, *selectbackground* and *selectforeground*. :meth:`itemconfig` is an alias of :meth:`!itemconfigure`." -msgstr "" +msgid "" +"Query or modify the configuration options of the item given by *index*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to an individual item rather " +"than to the listbox as a whole. With no options, it returns a dictionary describing " +"the current options of the item; otherwise it sets the given options. The supported " +"item options are *background*, *foreground*, *selectbackground* and " +"*selectforeground*. :meth:`itemconfig` is an alias of :meth:`!itemconfigure`." +msgstr "" +"گزینه‌های پیکربندی آیتم مشخص‌شده با *index* را بازیابی یا تغییر دهید. این " +"مشابه :meth:`~Misc.configure` است، با این تفاوت که به‌جای کل جعبه‌فهرست، بر یک آیتم " +"منفرد اعمال می‌شود. بدون هیچ گزینه‌ای، یک دیکشنری که گزینه‌های فعلی آیتم را توصیف می‌کند " +"برمی‌گرداند؛ در غیر این صورت، گزینه‌های داده‌شده را تنظیم می‌کند. گزینه‌های پشتیبانی‌شده " +"برای آیتم عبارت‌اند از *background*، *foreground*، *selectbackground* و " +"*selectforeground*. :meth:`itemconfig` یک نام مستعار برای :meth:`!itemconfigure` است." -msgid "Scroll the listbox by 10 times the difference between *x*, *y* and the coordinates passed to the last :meth:`scan_mark` call. This is typically bound to mouse motion events in the widget, producing the effect of dragging the list at high speed through the window." +msgid "" +"Scroll the listbox by 10 times the difference between *x*, *y* and the coordinates " +"passed to the last :meth:`scan_mark` call. This is typically bound to mouse motion " +"events in the widget, producing the effect of dragging the list at high speed " +"through the window." msgstr "" +"جعبه‌فهرست را به اندازه‌ی ۱۰ برابر اختلاف بین *x*، *y* و مختصات ارسال‌شده به آخرین " +"فراخوانی :meth:`scan_mark` پیمایش می‌کند. این معمولاً به رویدادهای حرکت ماوس در ابزارک " +"متصل می‌شود و اثر کشیده‌شدن فهرست با سرعت بالا درون پنجره را ایجاد می‌کند." -msgid "A :class:`!Menu` widget displays a column of entries, each of which may be a command, a checkbutton, a radiobutton, a cascade (which posts an associated submenu) or a separator. Menus are used as the menubar of a toplevel window, as pulldown menus posted from a cascade entry or menubutton, and as popup menus. Inherits from :class:`Widget`." -msgstr "" +msgid "" +"A :class:`!Menu` widget displays a column of entries, each of which may be a " +"command, a checkbutton, a radiobutton, a cascade (which posts an associated submenu) " +"or a separator. Menus are used as the menubar of a toplevel window, as pulldown " +"menus posted from a cascade entry or menubutton, and as popup menus. Inherits " +"from :class:`Widget`." +msgstr "" +"ابزارک :class:`!Menu` ستونی از آیتم‌ها را نمایش می‌دهد که هر کدام می‌توانند یک فرمان، یک " +"دکمه علامت‌زنی، یک دکمه رادیویی، یک آیتم آبشاری (که یک زیرمنوی مرتبط را نمایش می‌دهد) " +"یا یک جداکننده باشند. منوها به‌عنوان نوار منوی یک پنجره سطح بالا، به‌عنوان منوهای " +"کشویی که از یک آیتم آبشاری یا دکمه منو نمایش داده می‌شوند، و به‌عنوان منوهای بالاپر " +"استفاده می‌شوند. از :class:`Widget` ارث می‌برد." -msgid "Many of the entry methods take an *index* argument that selects which entry to operate on. As described in the Tk ``menu`` manual page, *index* may be a numeric index (counting from 0 at the top), ``'active'`` (the currently active entry), ``'end'`` or ``'last'`` (the bottommost entry), ``'none'`` (no entry at all, written ``{}`` in Tcl), ``@y`` (the entry covering pixel y-coordinate *y* in the menu window), or a pattern matched against the labels of the entries from the top down." -msgstr "" +msgid "" +"Many of the entry methods take an *index* argument that selects which entry to " +"operate on. As described in the Tk ``menu`` manual page, *index* may be a numeric " +"index (counting from 0 at the top), ``'active'`` (the currently active entry), " +"``'end'`` or ``'last'`` (the bottommost entry), ``'none'`` (no entry at all, written " +"``{}`` in Tcl), ``@y`` (the entry covering pixel y-coordinate *y* in the menu " +"window), or a pattern matched against the labels of the entries from the top down." +msgstr "" +"بسیاری از متدهای مربوط به ورودی‌ها یک آرگومان *اندیس* دریافت می‌کنند که مشخص می‌کند روی " +"کدام ورودی عمل شود. همان‌طور که در صفحه راهنمای ``menu`` در Tk توضیح داده شده است، " +"*اندیس* می‌تواند یک اندیس عددی (با شمارش از ۰ از بالا)، ``'active'`` (ورودی فعال " +"فعلی)، ``'end'`` یا ``'last'`` (پایین‌ترین ورودی)، ``'none'`` (بدون هیچ ورودی‌ای، که " +"در Tcl به‌صورت ``{}`` نوشته می‌شود)، ``@y`` (ورودی‌ای که پیکسل با مختصات y برابر *y* در " +"پنجره منو را می‌پوشاند)، یا الگویی که با برچسب‌های ورودی‌ها از بالا به پایین تطبیق داده " +"می‌شود، باشد." -msgid "Add a new entry to the bottom of the menu. *itemType* is one of ``'command'``, ``'cascade'``, ``'checkbutton'``, ``'radiobutton'`` or ``'separator'`` and determines the type of the new entry; the remaining options configure it. The :meth:`!add_command`, :meth:`!add_cascade`, :meth:`!add_checkbutton`, :meth:`!add_radiobutton` and :meth:`!add_separator` convenience methods call this method with the corresponding *itemType*." -msgstr "" +msgid "" +"Add a new entry to the bottom of the menu. *itemType* is one of ``'command'``, " +"``'cascade'``, ``'checkbutton'``, ``'radiobutton'`` or ``'separator'`` and " +"determines the type of the new entry; the remaining options configure it. " +"The :meth:`!add_command`, :meth:`!add_cascade`, :meth:`!add_checkbutton`, :meth:`!" +"add_radiobutton` and :meth:`!add_separator` convenience methods call this method " +"with the corresponding *itemType*." +msgstr "" +"یک آیتم جدید به انتهای منو اضافه می‌کند. *itemType* یکی از ``'command'``، " +"``'cascade'``، ``'checkbutton'``، ``'radiobutton'`` یا ``'separator'`` است و نوع " +"آیتم جدید را تعیین می‌کند؛ گزینه‌های باقی‌مانده آن را پیکربندی می‌کنند. متدهای " +"کمکی :meth:`!add_command`، :meth:`!add_cascade`، :meth:`!add_checkbutton`، :meth:`!" +"add_radiobutton` و :meth:`!add_separator` این متد را با *itemType* متناظر فراخوانی " +"می‌کنند." -msgid "The entry is configured by the following options, although not every option applies to every entry type (a separator accepts none of them):" +msgid "" +"The entry is configured by the following options, although not every option applies " +"to every entry type (a separator accepts none of them):" msgstr "" +"این مدخل با گزینه‌های زیر پیکربندی می‌شود، اگرچه هر گزینه‌ای برای هر نوع مدخل صدق " +"نمی‌کند (یک جداکننده هیچ‌کدام از آن‌ها را نمی‌پذیرد):" msgid "*label*" -msgstr "" +msgstr "*برچسب*" msgid "The text to display in the entry." -msgstr "" +msgstr "متن برای نمایش در ورودی." msgid "*command*" -msgstr "" +msgstr "*فرمان*" -msgid "The function to call when the entry is invoked (command, checkbutton and radiobutton entries)." +msgid "" +"The function to call when the entry is invoked (command, checkbutton and radiobutton " +"entries)." msgstr "" +"تابعی که هنگام فراخوانی آیتم فراخوانی می‌شود (آیتم‌های command، checkbutton و " +"radiobutton)." msgid "*accelerator*" -msgstr "" +msgstr "*شتاب‌دهنده*" -msgid "A string displayed at the right of the entry to advertise an accelerator keystroke; it does not itself create the binding." +msgid "" +"A string displayed at the right of the entry to advertise an accelerator keystroke; " +"it does not itself create the binding." msgstr "" +"رشته‌ای که در سمت راست آیتم نمایش داده می‌شود تا کلید شتاب‌دهنده (accelerator " +"keystroke) را نشان دهد؛ این رشته به‌تنهایی اتصال را ایجاد نمی‌کند." msgid "The index of a character in the label to underline for keyboard traversal." -msgstr "" +msgstr "اندیس نویسه‌ای در برچسب که برای پیمایش با صفحه‌کلید زیرخط می‌شود." msgid "One of ``'normal'``, ``'active'`` or ``'disabled'``." -msgstr "" +msgstr "یکی از ``'normal'``، ``'active'`` یا ``'disabled'``." msgid "An image to display instead of, or together with, the text label." -msgstr "" +msgstr "تصویری برای نمایش به‌جای برچسب متنی، یا همراه با آن." msgid "*compound*" -msgstr "" +msgstr "*مرکب*" -msgid "Where to show the image relative to the text: ``'none'`` (the default), ``'text'``, ``'image'``, ``'top'``, ``'bottom'``, ``'left'`` or ``'right'``." +msgid "" +"Where to show the image relative to the text: ``'none'`` (the default), ``'text'``, " +"``'image'``, ``'top'``, ``'bottom'``, ``'left'`` or ``'right'``." msgstr "" +"محل نمایش تصویر نسبت به متن: ``'none'`` (پیش‌فرض)، ``'text'``، ``'image'``، " +"``'top'``، ``'bottom'``، ``'left'`` یا ``'right'``." msgid "A bitmap to display instead of the text label." -msgstr "" +msgstr "یک بیت‌مپ (bitmap) برای نمایش به‌جای برچسب متنی." msgid "The font to use for the text." -msgstr "" +msgstr "قلمی که برای متن استفاده می‌شود." -msgid "The entry's background and foreground colors in its normal state (ignored on macOS)." +msgid "" +"The entry's background and foreground colors in its normal state (ignored on macOS)." msgstr "" +"رنگ‌های پس‌زمینه و پیش‌زمینه‌ی ورودی در حالت عادی خود (در macOS نادیده گرفته می‌شود)." msgid "*activebackground*, *activeforeground*" -msgstr "" +msgstr "*activebackground*, *activeforeground*" -msgid "The background and foreground colors used when the entry is active (ignored on macOS)." +msgid "" +"The background and foreground colors used when the entry is active (ignored on " +"macOS)." msgstr "" +"رنگ‌های پس‌زمینه و پیش‌زمینه‌ای که هنگام فعال بودن ورودی استفاده می‌شوند (در macOS نادیده " +"گرفته می‌شوند)." msgid "*columnbreak*" -msgstr "" +msgstr "*columnbreak*" -msgid "If true, the entry starts a new column instead of being placed below the previous entry." +msgid "" +"If true, the entry starts a new column instead of being placed below the previous " +"entry." msgstr "" +"اگر درست باشد، ورودی به‌جای قرار گرفتن زیر ورودی قبلی، ستون جدیدی را آغاز می‌کند." msgid "*hidemargin*" -msgstr "" +msgstr "*hidemargin*" -msgid "If true, the standard margin around the entry is omitted, which is useful when a menu is used as a palette." +msgid "" +"If true, the standard margin around the entry is omitted, which is useful when a " +"menu is used as a palette." msgstr "" +"اگر مقدار true باشد، حاشیه استاندارد اطراف ورودی حذف می‌شود که زمانی مفید است که یک " +"منو به‌عنوان پالت استفاده شود." msgid "*menu*" -msgstr "" +msgstr "*منو*" msgid "The submenu posted by a cascade entry; it must be a child of this menu." -msgstr "" +msgstr "زیرمنویی که توسط یک آیتم آبشاری نمایش داده می‌شود؛ باید فرزند این منو باشد." msgid "*variable*" -msgstr "" +msgstr "*متغیر*" msgid "The variable associated with a checkbutton or radiobutton entry." -msgstr "" +msgstr "متغیر مرتبط با ورودی دکمه‌ی علامتی یا دکمه‌ی رادیویی." msgid "*onvalue*, *offvalue*" -msgstr "" +msgstr "*onvalue*, *offvalue*" -msgid "The values stored in *variable* when a checkbutton entry is selected or cleared." +msgid "" +"The values stored in *variable* when a checkbutton entry is selected or cleared." msgstr "" +"مقادیری که در *variable* ذخیره می‌شوند، هنگامی که یک آیتم دکمه‌ی انتخابی (checkbutton) " +"انتخاب یا پاک می‌شود." msgid "*value*" -msgstr "" +msgstr "*مقدار*" msgid "The value stored in *variable* when a radiobutton entry is selected." -msgstr "" +msgstr "مقدار ذخیره‌شده در *variable* هنگامی که یک آیتم دکمه رادیویی انتخاب می‌شود." msgid "*indicatoron*" -msgstr "" +msgstr "*indicatoron*" msgid "Whether to display the indicator of a checkbutton or radiobutton entry." msgstr "" +"اینکه آیا نشانگر یک آیتم دکمه‌ی انتخابی (checkbutton) یا دکمه‌ی رادیویی (radiobutton) " +"نمایش داده شود یا خیر." msgid "*selectcolor*" -msgstr "" +msgstr "*selectcolor*" -msgid "The color of the indicator of a checkbutton or radiobutton entry when it is selected." +msgid "" +"The color of the indicator of a checkbutton or radiobutton entry when it is selected." msgstr "" +"رنگ نشانگر آیتم دکمه‌ی انتخابی (checkbutton) یا دکمه‌ی رادیویی (radiobutton) هنگامی که " +"انتخاب‌شده است." msgid "*selectimage*" -msgstr "" +msgstr "*selectimage*" -msgid "The image displayed when a checkbutton or radiobutton entry is selected and *image* is also given." +msgid "" +"The image displayed when a checkbutton or radiobutton entry is selected and *image* " +"is also given." msgstr "" +"تصویری که هنگام انتخاب یک آیتم checkbutton یا radiobutton و در صورتی که *image* نیز " +"داده شده باشد، نمایش داده می‌شود." -msgid "Add a new cascade entry to the bottom of the menu. A cascade entry has an associated submenu, given by its *menu* option, which must be a child of this menu; posting the entry posts the submenu next to it." +msgid "" +"Add a new cascade entry to the bottom of the menu. A cascade entry has an associated " +"submenu, given by its *menu* option, which must be a child of this menu; posting the " +"entry posts the submenu next to it." msgstr "" +"یک آیتم آبشاری جدید به انتهای منو اضافه کنید. یک آیتم آبشاری دارای یک زیرمنوی مرتبط " +"است که با گزینه *menu* آن مشخص می‌شود و باید فرزند این منو باشد؛ نمایش آیتم، زیرمنو " +"را در کنار آن نمایش می‌دهد." -msgid "Add a new checkbutton entry to the bottom of the menu. When invoked, a checkbutton entry toggles between its *onvalue* and *offvalue*, storing the result in its associated *variable*, and displays an indicator showing whether it is selected." +msgid "" +"Add a new checkbutton entry to the bottom of the menu. When invoked, a checkbutton " +"entry toggles between its *onvalue* and *offvalue*, storing the result in its " +"associated *variable*, and displays an indicator showing whether it is selected." msgstr "" +"یک آیتم دکمه‌ی انتخابی (checkbutton) جدید به انتهای منو اضافه کنید. هنگام فراخوانی، " +"یک آیتم دکمه‌ی انتخابی بین *onvalue* و *offvalue* خود جابه‌جا می‌شود، نتیجه را در " +"*variable* مرتبط با خود ذخیره می‌کند و نشانگری نمایش می‌دهد که نشان می‌دهد آیا انتخاب " +"شده است یا خیر." -msgid "Add a new command entry to the bottom of the menu. A command entry behaves much like a button: when it is invoked, the callback given by its *command* option is called." +msgid "" +"Add a new command entry to the bottom of the menu. A command entry behaves much like " +"a button: when it is invoked, the callback given by its *command* option is called." msgstr "" +"یک ورودی فرمان جدید به انتهای منو اضافه کنید. یک ورودی فرمان بسیار شبیه به یک دکمه " +"رفتار می‌کند: هنگامی که فراخوانی می‌شود، کال‌بک داده‌شده توسط گزینه *command* آن " +"فراخوانی می‌شود." -msgid "Add a new radiobutton entry to the bottom of the menu. Radiobutton entries sharing the same *variable* form a group of which only one may be selected at a time; selecting an entry stores its *value* in the variable." +msgid "" +"Add a new radiobutton entry to the bottom of the menu. Radiobutton entries sharing " +"the same *variable* form a group of which only one may be selected at a time; " +"selecting an entry stores its *value* in the variable." msgstr "" +"یک آیتم دکمه رادیویی جدید به انتهای فهرست اضافه کنید. آیتم‌های دکمه رادیویی که " +"*متغیر* یکسانی دارند، گروهی را تشکیل می‌دهند که در هر زمان فقط یکی از آن‌ها قابل " +"انتخاب است؛ انتخاب یک آیتم، *مقدار* آن را در متغیر ذخیره می‌کند." -msgid "Add a separator to the bottom of the menu. A separator is displayed as a horizontal dividing line and cannot be activated or invoked." +msgid "" +"Add a separator to the bottom of the menu. A separator is displayed as a horizontal " +"dividing line and cannot be activated or invoked." msgstr "" +"یک جداکننده به پایین منو اضافه کنید. جداکننده به‌صورت یک خط جداکننده‌ی افقی نمایش داده " +"می‌شود و نمی‌توان آن را فعال یا فراخوانی کرد." -msgid "Same as :meth:`add`, except that the new entry is inserted just before the entry given by *index* instead of being appended to the end of the menu. *itemType* is one of ``'command'``, ``'cascade'``, ``'checkbutton'``, ``'radiobutton'`` or ``'separator'``. The :meth:`!insert_command`, :meth:`!insert_cascade`, :meth:`!insert_checkbutton`, :meth:`!insert_radiobutton` and :meth:`!insert_separator` convenience methods call this method with the corresponding *itemType*." -msgstr "" +msgid "" +"Same as :meth:`add`, except that the new entry is inserted just before the entry " +"given by *index* instead of being appended to the end of the menu. *itemType* is one " +"of ``'command'``, ``'cascade'``, ``'checkbutton'``, ``'radiobutton'`` or " +"``'separator'``. The :meth:`!insert_command`, :meth:`!insert_cascade`, :meth:`!" +"insert_checkbutton`, :meth:`!insert_radiobutton` and :meth:`!insert_separator` " +"convenience methods call this method with the corresponding *itemType*." +msgstr "" +"مشابه :meth:`add`، با این تفاوت که آیتم جدید درست پیش از آیتم مشخص‌شده با *index* درج " +"می‌شود، نه اینکه به انتهای منو افزوده شود. *itemType* یکی از ``'command'``، " +"``'cascade'``، ``'checkbutton'``، ``'radiobutton'`` یا ``'separator'`` است. متدهای " +"کمکی :meth:`!insert_command`، :meth:`!insert_cascade`، :meth:`!" +"insert_checkbutton`، :meth:`!insert_radiobutton` و :meth:`!insert_separator` این متد " +"را با *itemType* متناظر فراخوانی می‌کنند." -msgid "Insert a new cascade entry before the entry given by *index* (see :meth:`add_cascade`)." +msgid "" +"Insert a new cascade entry before the entry given by *index* " +"(see :meth:`add_cascade`)." msgstr "" +"یک آیتم آبشاری (cascade) جدید پیش از آیتم مشخص‌شده با *index* درج کنید " +"(به :meth:`add_cascade` مراجعه کنید)." -msgid "Insert a new checkbutton entry before the entry given by *index* (see :meth:`add_checkbutton`)." +msgid "" +"Insert a new checkbutton entry before the entry given by *index* " +"(see :meth:`add_checkbutton`)." msgstr "" +"یک آیتم checkbutton جدید پیش از آیتم مشخص‌شده با *index* درج کنید " +"(به :meth:`add_checkbutton` مراجعه کنید)." -msgid "Insert a new command entry before the entry given by *index* (see :meth:`add_command`)." +msgid "" +"Insert a new command entry before the entry given by *index* " +"(see :meth:`add_command`)." msgstr "" +"یک آیتم فرمان جدید پیش از آیتم مشخص‌شده با *index* درج کنید (به :meth:`add_command` " +"مراجعه کنید)." -msgid "Insert a new radiobutton entry before the entry given by *index* (see :meth:`add_radiobutton`)." +msgid "" +"Insert a new radiobutton entry before the entry given by *index* " +"(see :meth:`add_radiobutton`)." msgstr "" +"یک آیتم دکمه رادیویی جدید را پیش از آیتم مشخص‌شده با *index* درج کنید " +"(به :meth:`add_radiobutton` مراجعه کنید)." -msgid "Insert a separator before the entry given by *index* (see :meth:`add_separator`)." +msgid "" +"Insert a separator before the entry given by *index* (see :meth:`add_separator`)." msgstr "" +"یک جداکننده پیش از آیتم مشخص‌شده با *index* درج کنید (به :meth:`add_separator` مراجعه " +"کنید)." -msgid "Delete all of the menu entries between *index1* and *index2* inclusive. If *index2* is omitted, it defaults to *index1*, so that a single entry is deleted. Attempts to delete a tear-off entry are ignored; remove it by changing the *tearoff* option instead." +msgid "" +"Delete all of the menu entries between *index1* and *index2* inclusive. If *index2* " +"is omitted, it defaults to *index1*, so that a single entry is deleted. Attempts to " +"delete a tear-off entry are ignored; remove it by changing the *tearoff* option " +"instead." msgstr "" +"تمام آیتم‌های منو از *index1* تا *index2* (شامل هر دو) را حذف کنید. اگر *index2* ذکر " +"نشود، مقدار پیش‌فرض آن *index1* خواهد بود، بنابراین یک آیتم واحد حذف می‌شود. تلاش‌ها " +"برای حذف یک آیتم جداشدنی (tear-off) نادیده گرفته می‌شوند؛ در عوض، با تغییر گزینه‌ی " +"*tearoff* آن را حذف کنید." -msgid "Return the current value of the configuration option *option* for the entry given by *index*." -msgstr "" +msgid "" +"Return the current value of the configuration option *option* for the entry given by " +"*index*." +msgstr "مقدار فعلی گزینه‌ی پیکربندی *option* را برای مدخل داده‌شده با *index* برمی‌گرداند." -msgid "Query or modify the configuration options of the entry given by *index*. This mirrors :meth:`~Misc.configure`, except that it applies to an individual entry rather than to the menu as a whole. With no options, it returns a dictionary describing the current options of the entry; otherwise it sets the given options. The supported options are those accepted by :meth:`add` for the entry's type. :meth:`entryconfig` is an alias of :meth:`!entryconfigure`." -msgstr "" +msgid "" +"Query or modify the configuration options of the entry given by *index*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to an individual entry " +"rather than to the menu as a whole. With no options, it returns a dictionary " +"describing the current options of the entry; otherwise it sets the given options. " +"The supported options are those accepted by :meth:`add` for the entry's " +"type. :meth:`entryconfig` is an alias of :meth:`!entryconfigure`." +msgstr "" +"گزینه‌های پیکربندی آیتم مشخص‌شده با *index* را بپرسید یا تغییر دهید. این " +"همانند :meth:`~Misc.configure` است، با این تفاوت که به یک آیتم منفرد اعمال می‌شود، نه " +"به کل منو. بدون هیچ گزینه‌ای، دیکشنری‌ای را برمی‌گرداند که گزینه‌های فعلی آیتم را توصیف " +"می‌کند؛ در غیر این صورت گزینه‌های داده‌شده را تنظیم می‌کند. گزینه‌های پشتیبانی‌شده " +"همان‌هایی هستند که :meth:`add` برای نوع آیتم می‌پذیرد. :meth:`entryconfig` نام مستعاری " +"از :meth:`!entryconfigure` است." -msgid "Return the numerical index corresponding to *index*, or ``None`` if *index* selects no entry." +msgid "" +"Return the numerical index corresponding to *index*, or ``None`` if *index* selects " +"no entry." msgstr "" +"اندیس عددی متناظر با *index* را برمی‌گرداند، یا اگر *index* هیچ آیتمی را انتخاب نکند، " +"``None`` را برمی‌گرداند." -msgid "Return the type of the entry given by *index*: one of ``'command'``, ``'cascade'``, ``'checkbutton'``, ``'radiobutton'``, ``'separator'`` or ``'tearoff'`` (for the tear-off entry)." +msgid "" +"Return the type of the entry given by *index*: one of ``'command'``, ``'cascade'``, " +"``'checkbutton'``, ``'radiobutton'``, ``'separator'`` or ``'tearoff'`` (for the tear-" +"off entry)." msgstr "" +"نوع آیتم مشخص‌شده با *index* را برمی‌گرداند: یکی از ``'command'``، ``'cascade'``، " +"``'checkbutton'``، ``'radiobutton'``، ``'separator'`` یا ``'tearoff'`` (برای آیتم " +"tear-off)." -msgid "Make the entry given by *index* the active entry, redisplaying it with its active colors, and deactivate any previously active entry. If *index* selects no entry, or the selected entry is disabled, the menu ends up with no active entry." +msgid "" +"Make the entry given by *index* the active entry, redisplaying it with its active " +"colors, and deactivate any previously active entry. If *index* selects no entry, or " +"the selected entry is disabled, the menu ends up with no active entry." msgstr "" +"آیتم مشخص‌شده توسط *index* را به‌عنوان آیتم فعال قرار می‌دهد، آن را با رنگ‌های فعالش " +"دوباره نمایش می‌دهد و هر آیتم فعال پیشین را غیرفعال می‌کند. اگر *index* هیچ آیتمی را " +"انتخاب نکند، یا آیتم انتخاب‌شده غیرفعال باشد، منو بدون آیتم فعال باقی می‌ماند." -msgid "Invoke the action of the entry given by *index*, as if it had been clicked. Nothing happens if the entry is disabled. If the entry has a *command* associated with it, the result of that command is returned; otherwise the result is an empty string." +msgid "" +"Invoke the action of the entry given by *index*, as if it had been clicked. Nothing " +"happens if the entry is disabled. If the entry has a *command* associated with it, " +"the result of that command is returned; otherwise the result is an empty string." msgstr "" +"عملکرد ورودی مشخص‌شده با *index* را فراخوانی کنید، گویی که روی آن کلیک شده است. اگر " +"ورودی غیرفعال باشد، اتفاقی نمی‌افتد. اگر ورودی دارای یک *command* مرتبط با آن باشد، " +"نتیجه آن command برگردانده می‌شود؛ در غیر این صورت نتیجه یک رشته خالی است." -msgid "Display the menu on the screen at the root-window coordinates *x* and *y*, adjusting them if necessary so that the whole menu is visible. If the *postcommand* option has been specified, it is evaluated before the menu is posted." +msgid "" +"Display the menu on the screen at the root-window coordinates *x* and *y*, adjusting " +"them if necessary so that the whole menu is visible. If the *postcommand* option has " +"been specified, it is evaluated before the menu is posted." msgstr "" +"منو را بر روی صفحه در مختصات *x* و *y* پنجره‌ی ریشه نمایش می‌دهد و در صورت لزوم آن‌ها " +"را تنظیم می‌کند تا کل منو نمایان باشد. اگر گزینه‌ی *postcommand* مشخص شده باشد، پیش از " +"نمایش منو ارزیابی می‌شود." -msgid "Post the menu as a popup at the root-window coordinates *x* and *y*. If *entry* is given, the menu is positioned so that this entry is displayed under the pointer." +msgid "" +"Post the menu as a popup at the root-window coordinates *x* and *y*. If *entry* is " +"given, the menu is positioned so that this entry is displayed under the pointer." msgstr "" +"منو را به‌صورت یک منوی بازشو در مختصات *x* و *y* پنجره‌ی ریشه نمایش دهید. اگر *entry* " +"داده شود، منو طوری قرار می‌گیرد که این آیتم زیر اشاره‌گر نمایش داده شود." -msgid "Unmap the menu so that it is no longer displayed, also unposting any posted lower-level cascaded submenu. This has no effect on Windows and macOS, which manage the unposting of menus themselves." +msgid "" +"Unmap the menu so that it is no longer displayed, also unposting any posted lower-" +"level cascaded submenu. This has no effect on Windows and macOS, which manage the " +"unposting of menus themselves." msgstr "" +"منو را از حالت نمایش خارج می‌کند تا دیگر نمایش داده نشود، همچنین هر زیرمنوی آبشاری " +"سطح پایین‌تری را که نمایش داده شده است می‌بندد. این کار روی Windows و macOS تأثیری " +"ندارد، زیرا این سیستم‌عامل‌ها خودشان مدیریت بستن منوها را بر عهده دارند." -msgid "Return the x-coordinate, within the menu window, of the leftmost pixel of the entry given by *index*." -msgstr "" +msgid "" +"Return the x-coordinate, within the menu window, of the leftmost pixel of the entry " +"given by *index*." +msgstr "مختصات x چپ‌ترین پیکسلِ آیتم داده‌شده توسط *index* را در پنجره‌ی منو برمی‌گرداند." -msgid "Return the y-coordinate, within the menu window, of the topmost pixel of the entry given by *index*." -msgstr "" +msgid "" +"Return the y-coordinate, within the menu window, of the topmost pixel of the entry " +"given by *index*." +msgstr "مختصات y بالاترین پیکسلِ آیتم مشخص‌شده با *index* را در پنجره‌ی منو برمی‌گرداند." -msgid "A :class:`!Menubutton` widget displays a textual string, bitmap or image and posts an associated :class:`Menu`, given by its *menu* option, when the user presses it. Like a :class:`Label` it can show *text*, a *textvariable*, or an *image*, and the *direction* option controls where the menu appears relative to the button. Inherits from :class:`Widget`. Refer to the Tk ``menubutton`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Menubutton` widget displays a textual string, bitmap or image and posts " +"an associated :class:`Menu`, given by its *menu* option, when the user presses it. " +"Like a :class:`Label` it can show *text*, a *textvariable*, or an *image*, and the " +"*direction* option controls where the menu appears relative to the button. Inherits " +"from :class:`Widget`. Refer to the Tk ``menubutton`` manual page for the full list " +"of options." +msgstr "" +"ابزارک :class:`!Menubutton` یک رشته متنی، بیت‌مپ یا تصویر را نمایش می‌دهد و هنگامی که " +"کاربر آن را فشار می‌دهد، یک :class:`Menu` مرتبط را که با گزینه *menu* آن مشخص شده " +"است، باز می‌کند. مانند :class:`Label` می‌تواند *text*، *textvariable* یا *image* را " +"نمایش دهد و گزینه *direction* کنترل می‌کند که منو نسبت به دکمه کجا ظاهر شود. " +"از :class:`Widget` ارث می‌برد. برای فهرست کامل گزینه‌ها به صفحه راهنمای ``menubutton`` " +"در Tk مراجعه کنید." -msgid "A :class:`!Message` widget displays a non-interactive textual string, given by the *text* option or linked to a variable through *textvariable*. Unlike a :class:`Label`, it breaks the string into multiple lines in order to produce a given aspect ratio, choosing line breaks at word boundaries, and it can justify the text left, centered or right. Inherits from :class:`Widget`. Refer to the Tk ``message`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Message` widget displays a non-interactive textual string, given by the " +"*text* option or linked to a variable through *textvariable*. Unlike " +"a :class:`Label`, it breaks the string into multiple lines in order to produce a " +"given aspect ratio, choosing line breaks at word boundaries, and it can justify the " +"text left, centered or right. Inherits from :class:`Widget`. Refer to the Tk " +"``message`` manual page for the full list of options." +msgstr "" +"ابزارک :class:`!Message` یک رشته متنی غیرتعاملی را نمایش می‌دهد که با گزینه *text* داده " +"شده یا از طریق *textvariable* به یک متغیر پیوند داده شده است. برخلاف :class:`Label`، " +"این ابزارک رشته را به چند خط می‌شکند تا نسبت ابعادی مشخصی به دست آید؛ شکست خطوط را در " +"مرز واژه‌ها انتخاب می‌کند و می‌تواند متن را چپ، وسط یا راست تراز کند. " +"از :class:`Widget` ارث‌بری می‌کند. برای فهرست کامل گزینه‌ها به صفحه‌ی راهنمای ``message`` " +"در Tk مراجعه کنید." -msgid "A helper subclass of :class:`Menubutton` that displays a pop-up menu of mutually exclusive choices. *variable* is a :class:`Variable` kept in sync with the selection, *value* is the initial choice, and *values* are the remaining menu entries. The keyword argument *command* may be given a callback that is invoked with the selected value, and the keyword argument *name* sets the Tk widget name." -msgstr "" +msgid "" +"A helper subclass of :class:`Menubutton` that displays a pop-up menu of mutually " +"exclusive choices. *variable* is a :class:`Variable` kept in sync with the " +"selection, *value* is the initial choice, and *values* are the remaining menu " +"entries. The keyword argument *command* may be given a callback that is invoked with " +"the selected value, and the keyword argument *name* sets the Tk widget name." +msgstr "" +"یک زیرکلاس کمکی از :class:`Menubutton` که یک منوی بازشو از گزینه‌های انحصاری متقابل " +"را نمایش می‌دهد. *variable* یک :class:`Variable` است که با انتخاب همگام نگه داشته " +"می‌شود، *value* انتخاب اولیه است، و *values* سایر ورودی‌های منو هستند. می‌توان برای " +"آرگومان کلیدواژه‌ای *command* یک کال‌بک تعیین کرد که با مقدار انتخاب‌شده فراخوانی " +"می‌شود، و آرگومان کلیدواژه‌ای *name* نام ابزارک Tk را تنظیم می‌کند." msgid "Destroy the widget, also cleaning up the associated pop-up menu." -msgstr "" +msgstr "ابزارک را نابود می‌کند و منوی بازشوی مرتبط را نیز پاک‌سازی می‌کند." msgid "Added support for the *name* keyword argument." -msgstr "" +msgstr "پشتیبانی از آرگومان کلیدواژه‌ای *name* افزوده شد." -msgid "A :class:`!PanedWindow` is a geometry-manager widget that arranges any number of child *panes* in a row (when *orient* is ``'horizontal'``) or a column (when *orient* is ``'vertical'``). Each pane holds one widget, and each pair of adjacent panes is separated by a movable *sash* that the user can drag with the mouse to resize the widgets on either side of it. Inherits from :class:`Widget`." -msgstr "" +msgid "" +"A :class:`!PanedWindow` is a geometry-manager widget that arranges any number of " +"child *panes* in a row (when *orient* is ``'horizontal'``) or a column (when " +"*orient* is ``'vertical'``). Each pane holds one widget, and each pair of adjacent " +"panes is separated by a movable *sash* that the user can drag with the mouse to " +"resize the widgets on either side of it. Inherits from :class:`Widget`." +msgstr "" +"یک :class:`!PanedWindow` ابزارک مدیریت چیدمان است که هر تعداد از *فریم‌های* فرزند (pane) " +"را در یک ردیف (هنگامی که *orient* برابر ``'horizontal'`` باشد) یا یک ستون (هنگامی که " +"*orient* برابر ``'vertical'`` باشد) می‌چیند. هر فریم یک ابزارک را در خود نگه می‌دارد، و " +"هر جفت فریم مجاور با یک *نوار جداکننده‌ی* متحرک (sash) از هم جدا می‌شود که کاربر می‌تواند " +"آن را با ماوس بکشد تا اندازه‌ی ابزارک‌های دو طرف آن تغییر کند. از :class:`Widget` ارث " +"می‌برد." -msgid "The *orient* option selects the layout direction, *sashwidth* sets the width of each sash and *sashrelief* its relief. When *showhandle* is true a small handle is drawn on each sash that the user can grab to drag it. Refer to the Tk ``panedwindow`` manual page for the full list of options." +msgid "" +"The *orient* option selects the layout direction, *sashwidth* sets the width of each " +"sash and *sashrelief* its relief. When *showhandle* is true a small handle is drawn " +"on each sash that the user can grab to drag it. Refer to the Tk ``panedwindow`` " +"manual page for the full list of options." msgstr "" +"گزینه‌ی *orient* جهت چیدمان را مشخص می‌کند، *sashwidth* عرض هر نوار جداکننده (sash) را تنظیم " +"می‌کند و *sashrelief* برجستگی آن را تعیین می‌کند. هنگامی که *showhandle* true باشد، " +"دسته‌ی کوچکی روی هر نوار جداکننده رسم می‌شود که کاربر می‌تواند با گرفتن آن، نوار جداکننده را بکشد. " +"برای فهرست کامل گزینه‌ها به صفحه‌ی راهنمای ``panedwindow`` در Tk مراجعه کنید." -msgid "Add *child* to the panedwindow as a new pane, placed after any existing panes. The keyword arguments specify per-pane management options for *child*; they may be any of the options accepted by :meth:`paneconfigure`." +msgid "" +"Add *child* to the panedwindow as a new pane, placed after any existing panes. The " +"keyword arguments specify per-pane management options for *child*; they may be any " +"of the options accepted by :meth:`paneconfigure`." msgstr "" +"*child* را به panedwindow به‌عنوان یک بخش (pane) جدید اضافه کنید، که پس از بخش‌های " +"موجود قرار می‌گیرد. آرگومان‌های کلیدواژه‌ای گزینه‌های مدیریتی به‌ازای هر بخش را برای " +"*child* مشخص می‌کنند؛ این آرگومان‌ها می‌توانند هر یک از گزینه‌های پذیرفته‌شده " +"توسط :meth:`paneconfigure` باشند." -msgid "Remove the pane containing *child* from the panedwindow. All geometry management options for *child* are forgotten. :meth:`forget` is an alias of :meth:`!remove`. This shadows the inherited geometry-manager :meth:`!forget`; use :meth:`~Pack.pack_forget`, :meth:`~Grid.grid_forget` or :meth:`~Place.place_forget` to remove the widget itself from its manager." -msgstr "" +msgid "" +"Remove the pane containing *child* from the panedwindow. All geometry management " +"options for *child* are forgotten. :meth:`forget` is an alias of :meth:`!remove`. " +"This shadows the inherited geometry-manager :meth:`!forget`; " +"use :meth:`~Pack.pack_forget`, :meth:`~Grid.grid_forget` " +"or :meth:`~Place.place_forget` to remove the widget itself from its manager." +msgstr "" +"صفحه‌ی حاوی *child* را از panedwindow حذف می‌کند. همه‌ی گزینه‌های مدیریت هندسی برای " +"*child* فراموش می‌شوند. :meth:`forget` نام مستعار :meth:`!remove` است. این " +"کار :meth:`!forget` ارث‌بری‌شده از مدیر هندسی را می‌پوشاند؛ برای حذف خود ابزارک از مدیرش، " +"از :meth:`~Pack.pack_forget`، :meth:`~Grid.grid_forget` " +"یا :meth:`~Place.place_forget` استفاده کنید." -msgid "Return a tuple of the widgets managed by the panedwindow, one per pane, in order." +msgid "" +"Return a tuple of the widgets managed by the panedwindow, one per pane, in order." msgstr "" +"یک تاپل از ابزارک‌های مدیریت‌شده توسط panedwindow را، یکی به‌ازای هر بخش (pane)، به ترتیب " +"برمی‌گرداند." -msgid "Return the current value of the management option *option* for the pane containing *child*. *option* may be any value allowed by :meth:`paneconfigure`." +msgid "" +"Return the current value of the management option *option* for the pane containing " +"*child*. *option* may be any value allowed by :meth:`paneconfigure`." msgstr "" +"مقدار فعلی گزینه‌ی مدیریت *option* برای پنجرکِ شامل *child* را برمی‌گرداند. *option* " +"می‌تواند هر مقداری باشد که :meth:`paneconfigure` مجاز می‌داند." -msgid "Query or modify the management options of the pane containing the widget *tagOrId*. With no options, it returns a dictionary describing all of the available options for the pane; given a single option name as a string, it returns a description of that one option; otherwise it sets the given options. The supported options include *after* and *before* (insert the pane after or before another managed window), *height* and *width* (the outer dimensions of the window, including any border), *minsize* (the minimum size in the paned dimension), *padx* and *pady* (extra space to leave on each side of the window), *sticky* (position or stretch the window within an oversized pane, using a string of the characters ``n``, ``s``, ``e`` and ``w``), *hide* (hide the pane while keeping it in the list of panes) and *stretch* (how extra space is allocated to the pane: one of ``'always'``, ``'first'``, ``'last'``, ``'middle'`` or ``'never'``). :meth:`paneconfig` is an alias of :meth:`!paneconfigure`." -msgstr "" +msgid "" +"Query or modify the management options of the pane containing the widget *tagOrId*. " +"With no options, it returns a dictionary describing all of the available options for " +"the pane; given a single option name as a string, it returns a description of that " +"one option; otherwise it sets the given options. The supported options include " +"*after* and *before* (insert the pane after or before another managed window), " +"*height* and *width* (the outer dimensions of the window, including any border), " +"*minsize* (the minimum size in the paned dimension), *padx* and *pady* (extra space " +"to leave on each side of the window), *sticky* (position or stretch the window " +"within an oversized pane, using a string of the characters ``n``, ``s``, ``e`` and " +"``w``), *hide* (hide the pane while keeping it in the list of panes) and *stretch* " +"(how extra space is allocated to the pane: one of ``'always'``, ``'first'``, " +"``'last'``, ``'middle'`` or ``'never'``). :meth:`paneconfig` is an alias of :meth:`!" +"paneconfigure`." +msgstr "" +"گزینه‌های مدیریت پنجرک حاوی ابزارک *tagOrId* را بخوانید یا تغییر دهید. بدون هیچ " +"گزینه‌ای، یک دیکشنری برمی‌گرداند که همه گزینه‌های در دسترس برای پنجرک را توصیف می‌کند؛ " +"اگر یک نام گزینه به‌صورت یک رشته داده شود، توصیف همان گزینه را برمی‌گرداند؛ در غیر این " +"صورت، گزینه‌های داده‌شده را تنظیم می‌کند. گزینه‌های پشتیبانی‌شده شامل *after* و *before* " +"(درج پنجرک بعد از یا قبل از یک پنجره مدیریت‌شده دیگر)، *height* و *width* (ابعاد " +"بیرونی پنجره، شامل هرگونه حاشیه)، *minsize* (حداقل اندازه در بعد پنجرک‌بندی)، *padx* " +"و *pady* (فضای اضافی که در هر طرف پنجره باقی می‌ماند)، *sticky* (جای‌دهی یا کشش پنجره " +"درون پنجرکی بیش‌ازاندازه، با استفاده از رشته‌ای از نویسه‌های ``n``، ``s``، ``e`` و " +"``w``)، *hide* (پنهان کردن پنجرک ضمن نگه‌داشتن آن در فهرست پنجرک‌ها) و *stretch* (نحوه " +"تخصیص فضای اضافی به پنجرک: یکی از ``'always'``، ``'first'``، ``'last'``، " +"``'middle'`` یا ``'never'``) می‌شوند. :meth:`paneconfig` نام مستعاری از :meth:`!" +"paneconfigure` است." -msgid "Identify the panedwindow component underneath the point given by *x* and *y*, in window coordinates. If the point is over a sash or a sash handle, the result is a two-element tuple containing the index of the sash or handle and a word indicating whether it is over a sash or a handle, such as ``(0, 'sash')`` or ``(2, 'handle')``. If the point is over any other part of the panedwindow, the result is an empty string." -msgstr "" +msgid "" +"Identify the panedwindow component underneath the point given by *x* and *y*, in " +"window coordinates. If the point is over a sash or a sash handle, the result is a " +"two-element tuple containing the index of the sash or handle and a word indicating " +"whether it is over a sash or a handle, such as ``(0, 'sash')`` or ``(2, 'handle')``. " +"If the point is over any other part of the panedwindow, the result is an empty " +"string." +msgstr "" +"کامپوننت panedwindow زیر نقطه‌ی داده‌شده با *x* و *y* در مختصات پنجره را شناسایی " +"می‌کند. اگر نقطه روی یک نوار جداکننده (sash) یا دسته‌ی نوار جداکننده (sash handle) " +"باشد، نتیجه یک تاپل دو عنصری است که شامل اندیس نوار جداکننده یا دسته و واژه‌ای است " +"که نشان می‌دهد نقطه روی یک نوار جداکننده است یا یک دسته، مانند ``(0, 'sash')`` یا " +"``(2, 'handle')``. اگر نقطه روی هر بخش دیگری از panedwindow باشد، نتیجه یک رشته خالی " +"است." -msgid "Query or change the position of the sashes in the panedwindow. This is a thin wrapper around the Tk ``sash`` subcommand; the convenience methods :meth:`sash_coord`, :meth:`sash_mark` and :meth:`sash_place` should normally be used instead." +msgid "" +"Query or change the position of the sashes in the panedwindow. This is a thin " +"wrapper around the Tk ``sash`` subcommand; the convenience " +"methods :meth:`sash_coord`, :meth:`sash_mark` and :meth:`sash_place` should normally " +"be used instead." msgstr "" +"موقعیت نوارهای جداکننده را در panedwindow دریافت یا تغییر دهید. این یک پوشش نازک حول زیردستور " +"``sash`` در Tk است؛ به‌طور معمول به‌جای آن باید از متدهای " +"راحتی :meth:`sash_coord`، :meth:`sash_mark` و :meth:`sash_place` استفاده شود." -msgid "Return the current x and y coordinate pair for the sash given by *index*, which must be an integer between 0 and one less than the number of panes in the panedwindow. The coordinates returned are those of the top left corner of the region containing the sash." +msgid "" +"Return the current x and y coordinate pair for the sash given by *index*, which must " +"be an integer between 0 and one less than the number of panes in the panedwindow. " +"The coordinates returned are those of the top left corner of the region containing " +"the sash." msgstr "" +"جفت مختصات x و y فعلی برای نوار جداکننده (sash) مشخص‌شده با *index* را برمی‌گرداند، که باید یک " +"عدد صحیح بین ۰ و یک واحد کمتر از تعداد فریم‌های موجود در panedwindow باشد. مختصات " +"برگردانده‌شده، مختصات گوشه بالا سمت چپ ناحیه‌ای است که نوار جداکننده (sash) را در بر دارد." -msgid "Record the current mouse position for the sash given by *index*, for use together with later sash-drag operations to move the sash." +msgid "" +"Record the current mouse position for the sash given by *index*, for use together " +"with later sash-drag operations to move the sash." msgstr "" +"موقعیت فعلی ماوس را برای نوار جداکننده (sash) مشخص‌شده با *index* ثبت می‌کند، تا همراه " +"با عملیات‌های بعدی کشیدن sash برای جابه‌جایی sash استفاده شود." msgid "Place the sash given by *index* at the coordinates *x* and *y*." -msgstr "" +msgstr "نوار جداکننده (sash) مشخص‌شده با *index* را در مختصات *x* و *y* قرار دهید." -msgid "Query or change the position of the sash proxy, the \"ghost\" sash shown while a sash is being dragged with non-opaque resizing. This is a thin wrapper around the Tk ``proxy`` subcommand; the convenience methods :meth:`proxy_coord`, :meth:`proxy_forget` and :meth:`proxy_place` should normally be used instead." +msgid "" +"Query or change the position of the sash proxy, the \"ghost\" sash shown while a " +"sash is being dragged with non-opaque resizing. This is a thin wrapper around the Tk " +"``proxy`` subcommand; the convenience " +"methods :meth:`proxy_coord`, :meth:`proxy_forget` and :meth:`proxy_place` should " +"normally be used instead." msgstr "" +"موقعیت پراکسی نوار جداکننده (sash proxy) را بخوانید یا تغییر دهید؛ همان نوار جداکننده‌ی «شبح» که هنگام " +"کشیده‌شدن یک تیغه با تغییر اندازه‌ی غیرشفاف نمایش داده می‌شود. این پوششی نازک بر " +"زیردستور ``proxy`` Tk است؛ معمولاً باید به‌جای آن از متدهای " +"سهولت‌بخش :meth:`proxy_coord`، :meth:`proxy_forget` و :meth:`proxy_place` استفاده شود." -msgid "Return a tuple containing the x and y coordinates of the most recent proxy location." -msgstr "" +msgid "" +"Return a tuple containing the x and y coordinates of the most recent proxy location." +msgstr "یک تاپل شامل مختصات x و y آخرین موقعیت پراکسی را برمی‌گرداند." msgid "Remove the proxy from the display." -msgstr "" +msgstr "پراکسیرا از نمایشگر حذف کنید." msgid "Place the proxy at the coordinates *x* and *y*." -msgstr "" +msgstr "پراکسی را در مختصات *x* و *y* قرار دهید." -msgid "A :class:`!Radiobutton` widget displays a textual string, bitmap or image together with a diamond or circular indicator, and selects one choice out of several. It has all the behavior of a simple button and, in addition, can be selected: typically several radiobuttons share a single *variable*, and selecting one sets that variable to the radiobutton's *value*; each radiobutton also monitors the variable and automatically selects or deselects itself when the variable changes. Inherits from :class:`Widget`. In addition to the standard widget options, a radiobutton accepts the options documented in the Tk ``radiobutton`` manual page, such as *variable*, *value* and *command*." -msgstr "" +msgid "" +"A :class:`!Radiobutton` widget displays a textual string, bitmap or image together " +"with a diamond or circular indicator, and selects one choice out of several. It has " +"all the behavior of a simple button and, in addition, can be selected: typically " +"several radiobuttons share a single *variable*, and selecting one sets that variable " +"to the radiobutton's *value*; each radiobutton also monitors the variable and " +"automatically selects or deselects itself when the variable changes. Inherits " +"from :class:`Widget`. In addition to the standard widget options, a radiobutton " +"accepts the options documented in the Tk ``radiobutton`` manual page, such as " +"*variable*, *value* and *command*." +msgstr "" +"ابزارک :class:`!Radiobutton` یک رشته‌ی متنی، بیت‌مپ یا تصویر را به‌همراه یک نشانگر لوزی " +"یا دایره‌ای نمایش می‌دهد و یکی از چند گزینه را انتخاب می‌کند. این ابزارک همه‌ی رفتار یک " +"دکمه‌ی ساده را دارد و علاوه بر این، قابل انتخاب است: معمولاً چند دکمه‌ی رادیویی یک " +"*variable* مشترک دارند و انتخاب یکی، آن *variable* را روی *value* آن دکمه‌ی رادیویی " +"تنظیم می‌کند؛ هر دکمه‌ی رادیویی همچنین *variable* را پایش می‌کند و هنگام تغییر " +"*variable*، به‌طور خودکار خود را انتخاب یا لغو انتخاب می‌کند. از :class:`Widget` ارث " +"می‌برد. علاوه بر گزینه‌های استاندارد ابزارک، یک دکمه‌ی رادیویی گزینه‌های مستندشده در صفحه‌ی " +"راهنمای ``radiobutton`` در Tk را می‌پذیرد، از جمله *variable*، *value* و *command*." -msgid "Do just what would happen if the user pressed the radiobutton with the mouse: select the button and invoke the associated command, if there is one. Return the result of the command, or an empty string if no command is associated with the radiobutton. This is ignored if the radiobutton's state is ``disabled``." +msgid "" +"Do just what would happen if the user pressed the radiobutton with the mouse: select " +"the button and invoke the associated command, if there is one. Return the result of " +"the command, or an empty string if no command is associated with the radiobutton. " +"This is ignored if the radiobutton's state is ``disabled``." msgstr "" +"دقیقاً همان کاری را انجام می‌دهد که اگر کاربر دکمه‌ی رادیویی را با ماوس فشار می‌داد، رخ " +"می‌داد: دکمه را انتخاب می‌کند و فرمان مرتبط را، در صورت وجود، فراخوانی می‌کند. نتیجه‌ی " +"فرمان را برمی‌گرداند، یا اگر فرمانی به دکمه‌ی رادیویی مرتبط نباشد، یک رشته‌ی خالی " +"برمی‌گرداند. اگر وضعیت دکمه‌ی رادیویی ``disabled`` باشد، این نادیده گرفته می‌شود." -msgid "Select the radiobutton and set the associated variable to the value corresponding to this widget." +msgid "" +"Select the radiobutton and set the associated variable to the value corresponding to " +"this widget." msgstr "" +"دکمه رادیویی را انتخاب کنید و متغیر مرتبط را روی مقدار متناظر با این ابزارک تنظیم " +"کنید." -msgid "Deselect the radiobutton and set the associated variable to an empty string. If this radiobutton was not currently selected, this has no effect." +msgid "" +"Deselect the radiobutton and set the associated variable to an empty string. If this " +"radiobutton was not currently selected, this has no effect." msgstr "" +"دکمه رادیویی را از حالت انتخاب خارج کنید و متغیر مرتبط را به یک رشته خالی تنظیم " +"کنید. اگر این دکمه رادیویی در حال حاضر انتخاب نشده باشد، این عمل تأثیری ندارد." -msgid "Flash the radiobutton by redisplaying it several times, alternating between the active and normal colors. At the end of the flash the radiobutton is left in the same normal or active state as when the method was called. This is ignored if the radiobutton's state is ``disabled``." +msgid "" +"Flash the radiobutton by redisplaying it several times, alternating between the " +"active and normal colors. At the end of the flash the radiobutton is left in the " +"same normal or active state as when the method was called. This is ignored if the " +"radiobutton's state is ``disabled``." msgstr "" +"دکمه رادیویی را با نمایش مجدد چندباره، به‌صورت متناوب بین رنگ‌های فعال و عادی، به حالت " +"چشمک‌زن درمی‌آورد. در پایان چشمک، دکمه رادیویی در همان وضعیت عادی یا فعالی که در زمان " +"فراخوانی متد داشت باقی می‌ماند. اگر وضعیت دکمه رادیویی ``disabled`` باشد، این عمل " +"نادیده گرفته می‌شود." -msgid "A :class:`!Scale` widget lets the user select a numerical value by moving a slider along a trough. It can be oriented vertically or horizontally and can optionally display a label and the current value. Inherits from :class:`Widget`." +msgid "" +"A :class:`!Scale` widget lets the user select a numerical value by moving a slider " +"along a trough. It can be oriented vertically or horizontally and can optionally " +"display a label and the current value. Inherits from :class:`Widget`." msgstr "" +"ابزارک :class:`!Scale` به کاربر اجازه می‌دهد با جابه‌جا کردن یک لغزنده در طول یک شیار، " +"یک مقدار عددی را انتخاب کند. این ابزارک می‌تواند به‌صورت عمودی یا افقی جهت‌دهی شود و " +"به‌صورت اختیاری یک برچسب و مقدار فعلی را نمایش دهد. از :class:`Widget` ارث می‌برد." -msgid "In addition to the standard widget options, a scale accepts the options documented in the Tk ``scale`` manual page, such as *from_*, *to*, *resolution*, *orient*, *tickinterval*, *variable* and *command*. As elsewhere in :mod:`!tkinter`, the leading ``-`` of the Tk option name is dropped; *from* is spelled ``from_`` because :keyword:`from` is a Python keyword." -msgstr "" +msgid "" +"In addition to the standard widget options, a scale accepts the options documented " +"in the Tk ``scale`` manual page, such as *from_*, *to*, *resolution*, *orient*, " +"*tickinterval*, *variable* and *command*. As elsewhere in :mod:`!tkinter`, the " +"leading ``-`` of the Tk option name is dropped; *from* is spelled ``from_`` " +"because :keyword:`from` is a Python keyword." +msgstr "" +"علاوه بر گزینه‌های استاندارد ابزارک، یک مقیاس (scale) گزینه‌های مستندشده در صفحه‌ی راهنمای " +"``scale`` در Tk را می‌پذیرد، مانند *from_*، *to*، *resolution*، *orient*، " +"*tickinterval*، *variable* و *command*. مانند سایر بخش‌های :mod:`!tkinter`، ``-`` " +"ابتدای نام گزینه‌ی Tk حذف می‌شود؛ *from* به‌صورت ``from_`` نوشته می‌شود، " +"زیرا :keyword:`from` یک کلیدواژه‌ی پایتون است." -msgid "With a non-integer *resolution*, see :ref:`numeric values and the locale `." +msgid "" +"With a non-integer *resolution*, see :ref:`numeric values and the locale `." msgstr "" +"برای *resolution* غیر از عدد صحیح، :ref:`مقادیر عددی و locale ` را ببینید." -msgid "Return the current value of the scale. The result is an integer if the scale's *resolution* yields whole numbers, and a float otherwise." +msgid "" +"Return the current value of the scale. The result is an integer if the scale's " +"*resolution* yields whole numbers, and a float otherwise." msgstr "" +"مقدار فعلی مقیاس را برمی‌گرداند. اگر *resolution* مقیاس اعداد صحیح تولید کند، نتیجه " +"یک عدد صحیح است و در غیر این صورت یک float است." -msgid "Set the scale to *value*, moving the slider accordingly. This has no effect if the scale is disabled." +msgid "" +"Set the scale to *value*, moving the slider accordingly. This has no effect if the " +"scale is disabled." msgstr "" +"مقیاس را روی *value* تنظیم می‌کند و لغزنده را متناسب با آن جابه‌جا می‌کند. اگر مقیاس " +"غیرفعال باشد، این عمل تأثیری ندارد." -msgid "Return a tuple ``(x, y)`` giving the pixel coordinates, relative to the widget, of the point on the centerline of the trough that corresponds to *value*. If *value* is omitted, the scale's current value is used." +msgid "" +"Return a tuple ``(x, y)`` giving the pixel coordinates, relative to the widget, of " +"the point on the centerline of the trough that corresponds to *value*. If *value* is " +"omitted, the scale's current value is used." msgstr "" +"یک تاپل ``(x, y)`` برمی‌گرداند که مختصات پیکسلی نقطه‌ای روی خط مرکزی شیار را نسبت به " +"ابزارک می‌دهد؛ این نقطه با *value* متناظر است. اگر *value* حذف شود، از مقدار فعلی مقیاس " +"استفاده می‌شود." -msgid "Return a string describing the part of the scale at the pixel coordinates *x*, *y*: ``'slider'``, ``'trough1'`` (the part of the trough above or to the left of the slider), ``'trough2'`` (below or to the right of the slider), or an empty string if the point is not over any of these elements." +msgid "" +"Return a string describing the part of the scale at the pixel coordinates *x*, *y*: " +"``'slider'``, ``'trough1'`` (the part of the trough above or to the left of the " +"slider), ``'trough2'`` (below or to the right of the slider), or an empty string if " +"the point is not over any of these elements." msgstr "" +"رشته‌ای را برمی‌گرداند که بخشی از مقیاس را در مختصات پیکسلی *x* و *y* توصیف می‌کند: " +"``'slider'``، ``'trough1'`` (بخشی از شیار که بالای لغزنده یا سمت چپ آن قرار دارد)، " +"``'trough2'`` (بخشی از شیار که پایین یا سمت راست لغزنده قرار دارد)، یا یک رشته خالی " +"اگر نقطه بر روی هیچ‌یک از این عناصر قرار نداشته باشد." -msgid "A :class:`!Scrollbar` widget displays a slider and two arrows that let the user scroll an associated widget, such as a :class:`Listbox`, :class:`Text`, :class:`Canvas` or :class:`Entry`. It is connected to the scrolled widget by setting that widget's *xscrollcommand* or *yscrollcommand* option to the scrollbar's :meth:`set` method, and the scrollbar's *command* option to the scrolled widget's :meth:`~XView.xview` or :meth:`~YView.yview` method. Inherits from :class:`Widget`." -msgstr "" +msgid "" +"A :class:`!Scrollbar` widget displays a slider and two arrows that let the user " +"scroll an associated widget, such as " +"a :class:`Listbox`, :class:`Text`, :class:`Canvas` or :class:`Entry`. It is " +"connected to the scrolled widget by setting that widget's *xscrollcommand* or " +"*yscrollcommand* option to the scrollbar's :meth:`set` method, and the scrollbar's " +"*command* option to the scrolled widget's :meth:`~XView.xview` " +"or :meth:`~YView.yview` method. Inherits from :class:`Widget`." +msgstr "" +"ابزارک :class:`!Scrollbar` یک لغزنده و دو پیکان را نمایش می‌دهد که به کاربر امکان " +"پیمایش یک ابزارک مرتبط را می‌دهند، " +"مانند :class:`Listbox`، :class:`Text`، :class:`Canvas` یا :class:`Entry`. این ابزارک " +"با تنظیم گزینه‌ی *xscrollcommand* یا *yscrollcommand* ابزارک پیمایش‌شده روی " +"متد :meth:`set` نوار پیمایش، و گزینه‌ی *command* نوار پیمایش روی " +"متد :meth:`~XView.xview` یا :meth:`~YView.yview` همان ابزارک، به آن متصل می‌شود. " +"از :class:`Widget` ارث‌بری می‌کند." -msgid "Return the current scrollbar settings as a tuple ``(first, last)`` of two fractions between 0 and 1, describing the portion of the document that is currently visible, as last passed to :meth:`set`." +msgid "" +"Return the current scrollbar settings as a tuple ``(first, last)`` of two fractions " +"between 0 and 1, describing the portion of the document that is currently visible, " +"as last passed to :meth:`set`." msgstr "" +"تنظیمات فعلی نوار پیمایش را به‌صورت یک تاپل ``(first, last)`` از دو کسر بین ۰ و ۱ " +"برمی‌گرداند که توصیف‌کننده بخشی از سند است که در حال حاضر قابل مشاهده است، همان‌گونه که " +"آخرین بار به :meth:`set` ارسال شده است." -msgid "Set the scrollbar. *first* and *last* are fractions between 0 and 1 giving the positions of the start and end of the visible portion of the associated document. This method is normally registered as the scrolled widget's *xscrollcommand* or *yscrollcommand* and called by that widget." +msgid "" +"Set the scrollbar. *first* and *last* are fractions between 0 and 1 giving the " +"positions of the start and end of the visible portion of the associated document. " +"This method is normally registered as the scrolled widget's *xscrollcommand* or " +"*yscrollcommand* and called by that widget." msgstr "" +"نوار پیمایش را تنظیم می‌کند. *first* و *last* مقادیر کسری بین ۰ و ۱ هستند که موقعیت " +"آغاز و پایان بخش نمایان سند مرتبط را مشخص می‌کنند. این متد معمولاً به‌عنوان " +"*xscrollcommand* یا *yscrollcommand* ابزارک پیمایش‌شده ثبت می‌شود و توسط آن ابزارک " +"فراخوانی می‌شود." -msgid "Mark the element *index* (one of ``'arrow1'``, ``'slider'`` or ``'arrow2'``) as active, displaying it according to the *activebackground* and *activerelief* options. If *index* is omitted, return the name of the currently active element, or ``None`` if no element is active." +msgid "" +"Mark the element *index* (one of ``'arrow1'``, ``'slider'`` or ``'arrow2'``) as " +"active, displaying it according to the *activebackground* and *activerelief* " +"options. If *index* is omitted, return the name of the currently active element, or " +"``None`` if no element is active." msgstr "" +"المان *index* (یکی از ``'arrow1'``، ``'slider'`` یا ``'arrow2'``) را به‌عنوان فعال " +"علامت‌گذاری می‌کند و آن را مطابق گزینه‌های *activebackground* و *activerelief* نمایش " +"می‌دهد. اگر *index* حذف شود، نام المان فعال کنونی را برمی‌گرداند، یا اگر هیچ المانی " +"فعال نباشد ``None`` را برمی‌گرداند." msgid "The *index* argument is now optional." -msgstr "" +msgstr "آرگومان *index* اکنون اختیاری شده است." -msgid "Return a float indicating the fractional change in the scrollbar setting that corresponds to moving the slider by *deltax* pixels horizontally (for horizontal scrollbars) or *deltay* pixels vertically (for vertical scrollbars)." +msgid "" +"Return a float indicating the fractional change in the scrollbar setting that " +"corresponds to moving the slider by *deltax* pixels horizontally (for horizontal " +"scrollbars) or *deltay* pixels vertically (for vertical scrollbars)." msgstr "" +"یک عدد اعشاری (float) برمی‌گرداند که نشان‌دهنده‌ی تغییر کسری در تنظیم نوار پیمایش است و " +"متناظر با جابه‌جایی لغزنده به اندازه‌ی *deltax* پیکسل به‌صورت افقی (برای نوارهای پیمایش " +"افقی) یا *deltay* پیکسل به‌صورت عمودی (برای نوارهای پیمایش عمودی) است." -msgid "Return a float between 0 and 1 indicating where the point at pixel coordinates *x*, *y* lies in the trough: 0 corresponds to the top or left of the trough and 1 to the bottom or right." +msgid "" +"Return a float between 0 and 1 indicating where the point at pixel coordinates *x*, " +"*y* lies in the trough: 0 corresponds to the top or left of the trough and 1 to the " +"bottom or right." msgstr "" +"یک float بین ۰ و ۱ برمی‌گرداند که نشان می‌دهد نقطه‌ای با مختصات پیکسلی *x*، *y* در کجای " +"شیار (trough) قرار دارد: ۰ متناظر با بالا یا چپ شیار و ۱ متناظر با پایین یا راست آن " +"است." -msgid "Return the name of the element under the pixel coordinates *x*, *y* (such as ``'arrow1'``), or an empty string if the point does not lie in any element of the scrollbar." +msgid "" +"Return the name of the element under the pixel coordinates *x*, *y* (such as " +"``'arrow1'``), or an empty string if the point does not lie in any element of the " +"scrollbar." msgstr "" +"نام عنصر واقع در مختصات پیکسلی *x*، *y* (مانند ``'arrow1'``) را برمی‌گرداند، یا اگر " +"نقطه در هیچ عنصری از نوار پیمایش قرار نداشته باشد، یک رشته خالی برمی‌گرداند." -msgid "A :class:`!Spinbox` widget is an :class:`Entry`-like widget with a pair of up/down arrow buttons that let the user step through a range of values in addition to editing the value directly. The set of values may be a numeric range given by the *from_*, *to* and *increment* options, or an explicit list of strings given by the *values* option (which takes precedence over the range). Each time an arrow is invoked the *command* callback, if any, is called; the *wrap* option controls whether stepping past either end of the range wraps around to the other end; the *format* option specifies how numeric values are formatted; and the *validate* option enables validation of the entered text. Inherits from :class:`Widget` and :class:`XView`." -msgstr "" +msgid "" +"A :class:`!Spinbox` widget is an :class:`Entry`-like widget with a pair of up/down " +"arrow buttons that let the user step through a range of values in addition to " +"editing the value directly. The set of values may be a numeric range given by the " +"*from_*, *to* and *increment* options, or an explicit list of strings given by the " +"*values* option (which takes precedence over the range). Each time an arrow is " +"invoked the *command* callback, if any, is called; the *wrap* option controls " +"whether stepping past either end of the range wraps around to the other end; the " +"*format* option specifies how numeric values are formatted; and the *validate* " +"option enables validation of the entered text. Inherits from :class:`Widget` " +"and :class:`XView`." +msgstr "" +"ابزارک :class:`!Spinbox` یک ابزارک شبیه :class:`Entry` با یک جفت دکمه‌ی پیکان بالا/" +"پایین است که به کاربر امکان می‌دهد علاوه بر ویرایش مستقیم مقدار، یک بازه از مقادیر را " +"گام‌به‌گام بپیماید. مجموعه‌ی مقادیر ممکن است یک بازه عددی تعیین‌شده با گزینه‌های *from_*، " +"*to* و *increment* یا فهرست صریحی از رشته‌ها تعیین‌شده با گزینه *values* باشد (که بر " +"بازه مقدم است). هر بار که یکی از پیکان‌ها فراخوانی شود، کال‌بک *command*، در صورت " +"وجود، فراخوانی می‌شود؛ گزینه *wrap* کنترل می‌کند که آیا با گام برداشتن از فراتر از هر " +"یک از دو سر بازه، مقدار به سر دیگر می‌پیچد یا خیر؛ گزینه *format* مشخص می‌کند که " +"مقادیر عددی چگونه قالب‌بندی می‌شوند؛ و گزینه *validate* اعتبارسنجی متن واردشده را فعال " +"می‌کند. این ابزارک از :class:`Widget` و :class:`XView` ارث می‌برد." -msgid "With a non-integer *increment*, see :ref:`numeric values and the locale `." +msgid "" +"With a non-integer *increment*, see :ref:`numeric values and the locale `." msgstr "" +"در صورت غیر عدد صحیح بودن *increment*، :ref:`numeric values and the locale ` را ببینید." -msgid "Many of the methods take an *index* argument identifying a character in the spinbox's string. As described in the Tk ``spinbox`` manual page, *index* may be a numeric index (counting from 0), ``'anchor'`` (the selection anchor point), ``'end'`` (just after the last character), ``'insert'`` (the character just after the insertion cursor), ``'sel.first'`` or ``'sel.last'`` (the ends of the selection), or ``@x`` (the character covering pixel x-coordinate *x* in the window)." -msgstr "" +msgid "" +"Many of the methods take an *index* argument identifying a character in the " +"spinbox's string. As described in the Tk ``spinbox`` manual page, *index* may be a " +"numeric index (counting from 0), ``'anchor'`` (the selection anchor point), " +"``'end'`` (just after the last character), ``'insert'`` (the character just after " +"the insertion cursor), ``'sel.first'`` or ``'sel.last'`` (the ends of the " +"selection), or ``@x`` (the character covering pixel x-coordinate *x* in the window)." +msgstr "" +"بسیاری از متدها یک آرگومان *index* می‌پذیرند که یک نویسه در رشته‌ی spinbox را مشخص " +"می‌کند. همان‌طور که در صفحه‌ی راهنمای ``spinbox`` در Tk توضیح داده شده است، *index* " +"می‌تواند یک اندیس عددی (شمارش از ۰)، ``'anchor'`` (نقطه‌ی لنگر انتخاب)، ``'end'`` " +"(درست پس از آخرین نویسه)، ``'insert'`` (نویسه‌ی درست پس از مکان‌نمای درج)، " +"``'sel.first'`` یا ``'sel.last'`` (دو سر انتخاب)، یا ``@x`` (نویسه‌ای که مختصات x " +"پیکسل *x* در پنجره را پوشش می‌دهد) باشد." msgid "Return the spinbox's string." -msgstr "" +msgstr "رشته‌ی اسپین‌باکس (spinbox) را برمی‌گرداند." -msgid "Insert the characters of the string *s* just before the character given by *index*." -msgstr "" +msgid "" +"Insert the characters of the string *s* just before the character given by *index*." +msgstr "نویسه‌های رشته‌ی *s* را درست پیش از نویسه‌ی مشخص‌شده با *index* درج کنید." -msgid "Delete one or more characters of the spinbox. *first* is the index of the first character to delete, and *last* is the index of the character just after the last one to delete. If *last* is omitted, a single character at *first* is deleted." +msgid "" +"Delete one or more characters of the spinbox. *first* is the index of the first " +"character to delete, and *last* is the index of the character just after the last " +"one to delete. If *last* is omitted, a single character at *first* is deleted." msgstr "" +"حذف یک یا چند نویسه از اسپین‌باکس (spinbox). *first* اندیس اولین نویسه برای حذف است، " +"و *last* اندیس نویسه‌ای است که درست پس از آخرین نویسه برای حذف قرار دارد. اگر *last* " +"ذکر نشود، تنها یک نویسه در *first* حذف می‌شود." msgid "Return the numerical index corresponding to *index*, as a string." -msgstr "" +msgstr "اندیس عددی متناظر با *index* را به‌صورت یک رشته برمی‌گرداند." -msgid "Return a tuple of four integers ``(x, y, width, height)`` describing the bounding box of the character given by *index*. *x* and *y* are the pixel coordinates of the upper-left corner of the character relative to the widget, and *width* and *height* are its size in pixels. The bounding box may refer to a region outside the visible area of the window." +msgid "" +"Return a tuple of four integers ``(x, y, width, height)`` describing the bounding " +"box of the character given by *index*. *x* and *y* are the pixel coordinates of the " +"upper-left corner of the character relative to the widget, and *width* and *height* " +"are its size in pixels. The bounding box may refer to a region outside the visible " +"area of the window." msgstr "" +"یک تاپل از چهار عدد صحیح ``(x, y, width, height)`` برمی‌گرداند که جعبه‌ی محدودکننده نویسه‌ی " +"متناظر با *index* را توصیف می‌کند. *x* و *y* مختصات پیکسلی گوشه‌ی بالا-چپ نویسه نسبت به " +"ابزارک هستند و *width* و *height* اندازه‌های آن بر حسب پیکسل هستند. جعبه‌ی محدودکننده ممکن است " +"به ناحیه‌ای خارج از ناحیه‌ی قابل‌مشاهده‌ی پنجره اشاره داشته باشد." -msgid "Return the name of the window element at the pixel coordinates *x*, *y*: one of ``'buttondown'``, ``'buttonup'``, ``'entry'`` or ``'none'``." +msgid "" +"Return the name of the window element at the pixel coordinates *x*, *y*: one of " +"``'buttondown'``, ``'buttonup'``, ``'entry'`` or ``'none'``." msgstr "" +"نام المان پنجره را در مختصات پیکسلی *x*، *y* برمی‌گرداند: یکی از ``'buttondown'``، " +"``'buttonup'``، ``'entry'`` یا ``'none'``." -msgid "Invoke the spin button given by *element*, either ``'buttonup'`` or ``'buttondown'``, triggering the action associated with it." +msgid "" +"Invoke the spin button given by *element*, either ``'buttonup'`` or " +"``'buttondown'``, triggering the action associated with it." msgstr "" +"دکمه چرخشی (spin button) داده‌شده توسط *element* را، که یا ``'buttonup'`` است یا " +"``'buttondown'``، فراخوانی کنید تا عمل مرتبط با آن راه‌اندازی شود." -msgid "A thin wrapper around the Tk ``scan`` widget subcommand, used to implement fast dragging of the view: ``scan('mark', x)`` records *x* and the current view, and ``scan('dragto', x)`` adjusts the view relative to that mark. The :meth:`scan_mark` and :meth:`scan_dragto` methods wrap the two forms." +msgid "" +"A thin wrapper around the Tk ``scan`` widget subcommand, used to implement fast " +"dragging of the view: ``scan('mark', x)`` records *x* and the current view, and " +"``scan('dragto', x)`` adjusts the view relative to that mark. The :meth:`scan_mark` " +"and :meth:`scan_dragto` methods wrap the two forms." msgstr "" +"یک پوشش نازک حول زیردستور ``scan`` ابزارک Tk، که برای پیاده‌سازی کشیدن سریع نما به کار " +"می‌رود: ``scan('mark', x)`` *x* و نمای فعلی را ثبت می‌کند، و ``scan('dragto', x)`` نما " +"را نسبت به آن نشان تنظیم می‌کند. متدهای :meth:`scan_mark` و :meth:`scan_dragto` این " +"دو شکل را پوشش می‌دهند." -msgid "Record *x* and the current view in the spinbox window, for use with a later :meth:`scan_dragto` call. This is typically associated with a mouse button press in the widget." +msgid "" +"Record *x* and the current view in the spinbox window, for use with a " +"later :meth:`scan_dragto` call. This is typically associated with a mouse button " +"press in the widget." msgstr "" +"*x* و نمای فعلی را در پنجره‌ی اسپین‌باکس (spinbox) ثبت کنید تا در یک فراخوانی " +"بعدی :meth:`scan_dragto` استفاده شود. این معمولاً با فشرده‌شدن یک دکمه‌ی ماوس در ابزارک " +"(widget) مرتبط است." -msgid "Adjust the view by 10 times the difference between *x* and the *x* passed to the last :meth:`scan_mark` call. This is typically associated with mouse motion events, producing the effect of dragging the spinbox at high speed through the window." +msgid "" +"Adjust the view by 10 times the difference between *x* and the *x* passed to the " +"last :meth:`scan_mark` call. This is typically associated with mouse motion events, " +"producing the effect of dragging the spinbox at high speed through the window." msgstr "" +"نما را به اندازه‌ی ۱۰ برابر اختلاف بین *x* و *x* ارسال‌شده به آخرین " +"فراخوانی :meth:`scan_mark` تنظیم می‌کند. این معمولاً با رویدادهای حرکت ماوس مرتبط است " +"و اثر کشیدن اسپین‌باکس (spinbox) با سرعت بالا از میان پنجره را ایجاد می‌کند." -msgid "A thin wrapper around the Tk ``selection`` widget subcommand, used to adjust the selection within the spinbox. It has several forms depending on the first argument, such as ``selection('adjust', index)``, ``selection('clear')``, ``selection('element', ?elem?)``, ``selection('from', index)``, ``selection('present')``, ``selection('range', start, end)`` and ``selection('to', index)``. The :meth:`selection_adjust`, :meth:`selection_clear`, :meth:`selection_element`, :meth:`selection_from`, :meth:`selection_present`, :meth:`selection_range` and :meth:`selection_to` methods wrap these forms." -msgstr "" +msgid "" +"A thin wrapper around the Tk ``selection`` widget subcommand, used to adjust the " +"selection within the spinbox. It has several forms depending on the first argument, " +"such as ``selection('adjust', index)``, ``selection('clear')``, " +"``selection('element', ?elem?)``, ``selection('from', index)``, " +"``selection('present')``, ``selection('range', start, end)`` and ``selection('to', " +"index)``. " +"The :meth:`selection_adjust`, :meth:`selection_clear`, :meth:`selection_element`, :meth:`selection_from`, :meth:`selection_present`, :meth:`selection_range` " +"and :meth:`selection_to` methods wrap these forms." +msgstr "" +"پوششی نازک پیرامون زیردستور ``selection`` ابزارک Tk، که برای تنظیم انتخاب درون " +"اسپین‌باکس (spinbox) به کار می‌رود. این دستور بسته به اولین آرگومان، چندین شکل دارد، مانند " +"``selection('adjust', index)``، ``selection('clear')``، ``selection('element', ?" +"elem?)``، ``selection('from', index)``، ``selection('present')``، " +"``selection('range', start, end)`` و ``selection('to', index)``. " +"متدهای :meth:`selection_adjust`، :meth:`selection_clear`، :meth:`selection_element`، :meth:`selection_from`، :meth:`selection_present`، :meth:`selection_range` " +"و :meth:`selection_to` این شکل‌ها را پوشش می‌دهند." -msgid "Locate the end of the selection nearest to the character given by *index* and adjust that end of the selection to be at *index* (including but not going beyond *index*). The other end becomes the anchor point for future :meth:`selection_to` calls. If the selection is not currently in the spinbox, a new selection is created to include the characters between *index* and the most recent anchor point, inclusive." -msgstr "" +msgid "" +"Locate the end of the selection nearest to the character given by *index* and adjust " +"that end of the selection to be at *index* (including but not going beyond *index*). " +"The other end becomes the anchor point for future :meth:`selection_to` calls. If the " +"selection is not currently in the spinbox, a new selection is created to include the " +"characters between *index* and the most recent anchor point, inclusive." +msgstr "" +"نزدیک‌ترین انتهای انتخاب به نویسه‌ی مشخص‌شده با *index* را پیدا می‌کند و آن انتهای انتخاب " +"را طوری تنظیم می‌کند که در *index* باشد (شامل خود *index*، اما نه فراتر از آن). " +"انتهای دیگر به نقطه‌ی لنگر برای فراخوانی‌های آینده‌ی :meth:`selection_to` تبدیل می‌شود. " +"اگر انتخاب در حال حاضر در اسپین‌باکس (spinbox) وجود نداشته باشد، انتخاب جدیدی ایجاد " +"می‌شود که نویسه‌های بین *index* و آخرین نقطه‌ی لنگر را به‌صورت فراگیر در بر گیرد." -msgid "Clear the selection if it is currently in this widget. If the selection is not in this widget, the method has no effect." +msgid "" +"Clear the selection if it is currently in this widget. If the selection is not in " +"this widget, the method has no effect." msgstr "" +"اگر انتخاب در حال حاضر در این ابزارک باشد، آن را پاک می‌کند. اگر انتخاب در این ابزارک " +"نباشد، این متد هیچ اثری ندارد." -msgid "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X selection; that method is not available on a :class:`Spinbox`." +msgid "" +"This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " +"selection; that method is not available on a :class:`Spinbox`." msgstr "" +"این، متد موروثی :meth:`Misc.selection_clear` را می‌پوشاند، که گزینش X را پاک می‌کند؛ " +"آن متد در :class:`Spinbox` در دسترس نیست." -msgid "Set or get the currently selected element. If *element* (one of ``'buttonup'``, ``'buttondown'`` or ``'none'``) is given, that spin button is selected and displayed depressed; otherwise the name of the currently selected element is returned." +msgid "" +"Set or get the currently selected element. If *element* (one of ``'buttonup'``, " +"``'buttondown'`` or ``'none'``) is given, that spin button is selected and displayed " +"depressed; otherwise the name of the currently selected element is returned." msgstr "" +"المان انتخاب‌شده‌ی کنونی را تنظیم یا دریافت کنید. اگر *element* (یکی از ``'buttonup'``، " +"``'buttondown'`` یا ``'none'``) داده شود، آن دکمه چرخشی (spin button) انتخاب می‌شود و " +"به‌صورت فشرده نمایش داده می‌شود؛ در غیر این صورت، نام المان انتخاب‌شده‌ی کنونی برگردانده " +"می‌شود." -msgid "Set the selection anchor point to just before the character given by *index*, without changing the selection itself." +msgid "" +"Set the selection anchor point to just before the character given by *index*, " +"without changing the selection itself." msgstr "" +"نقطه‌ی لنگر انتخاب را درست پیش از نویسه‌ی مشخص‌شده با *index* تنظیم کنید، بدون آن‌که خود " +"انتخاب تغییر کند." -msgid "Return ``True`` if there are characters selected in the spinbox, ``False`` otherwise." +msgid "" +"Return ``True`` if there are characters selected in the spinbox, ``False`` otherwise." msgstr "" +"اگر نویسه‌هایی در اسپین‌باکس (spinbox) انتخاب شده باشند، ``True`` برمی‌گرداند، در غیر " +"این صورت ``False``." -msgid "Set the selection to include the characters starting with the one indexed by *start* and ending with the one just before *end*. If *end* refers to the same character as *start* or an earlier one, the selection is cleared." +msgid "" +"Set the selection to include the characters starting with the one indexed by *start* " +"and ending with the one just before *end*. If *end* refers to the same character as " +"*start* or an earlier one, the selection is cleared." msgstr "" +"انتخاب را طوری تنظیم کنید که شامل نویسه‌هایی باشد که از نویسه‌ای با اندیس *start* شروع " +"می‌شود و با نویسه‌ای درست پیش از *end* پایان می‌یابد. اگر *end* به همان نویسه‌ی *start* " +"یا نویسه‌ای پیش از آن اشاره کند، انتخاب پاک می‌شود." -msgid "Set the selection between *index* and the anchor point. If *index* is before the anchor point, the selection runs from *index* up to but not including the anchor point; if it is after, the selection runs from the anchor point up to but not including *index*; if it is the same, nothing happens. The anchor point is the one set by the most recent :meth:`selection_from` or :meth:`selection_adjust` call. If the selection is not in this widget, a new selection is created using the most recent anchor point." -msgstr "" +msgid "" +"Set the selection between *index* and the anchor point. If *index* is before the " +"anchor point, the selection runs from *index* up to but not including the anchor " +"point; if it is after, the selection runs from the anchor point up to but not " +"including *index*; if it is the same, nothing happens. The anchor point is the one " +"set by the most recent :meth:`selection_from` or :meth:`selection_adjust` call. If " +"the selection is not in this widget, a new selection is created using the most " +"recent anchor point." +msgstr "" +"انتخاب را بین *index* و نقطه‌ی لنگر تنظیم می‌کند. اگر *index* پیش از نقطه‌ی لنگر باشد، " +"انتخاب از *index* شروع می‌شود و تا نقطه‌ی لنگر ادامه می‌یابد، اما نقطه‌ی لنگر را شامل " +"نمی‌شود؛ اگر پس از آن باشد، انتخاب از نقطه‌ی لنگر شروع می‌شود و تا *index* ادامه " +"می‌یابد، اما *index* را شامل نمی‌شود؛ اگر یکسان باشد، هیچ اتفاقی نمی‌افتد. نقطه‌ی لنگر " +"همان نقطه‌ای است که توسط آخرین فراخوانی :meth:`selection_from` " +"یا :meth:`selection_adjust` تنظیم شده است. اگر انتخاب در این ابزارک وجود نداشته " +"باشد، انتخاب جدیدی با استفاده از آخرین نقطه‌ی لنگر ایجاد می‌شود." -msgid "A :class:`!Text` widget displays and edits multi-line text. Portions of the text may be styled with **tags**, particular positions may be annotated with floating **marks**, and arbitrary images and other widgets may be embedded in the text. The widget also provides an unlimited undo/redo mechanism and supports peer widgets that share the same underlying data. Inherits from :class:`Widget`, :class:`XView` and :class:`YView`, so the view can be scrolled horizontally and vertically with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``text`` manual page for the full list of options." -msgstr "" +msgid "" +"A :class:`!Text` widget displays and edits multi-line text. Portions of the text may " +"be styled with **tags**, particular positions may be annotated with floating " +"**marks**, and arbitrary images and other widgets may be embedded in the text. The " +"widget also provides an unlimited undo/redo mechanism and supports peer widgets that " +"share the same underlying data. Inherits from :class:`Widget`, :class:`XView` " +"and :class:`YView`, so the view can be scrolled horizontally and vertically " +"with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``text`` manual " +"page for the full list of options." +msgstr "" +"ابزارک :class:`!Text` متن چندخطی را نمایش و ویرایش می‌کند. بخش‌هایی از متن را می‌توان با " +"**برچسب‌ها** سبک‌دهی کرد، موقعیت‌های خاصی را می‌توان با **نشان‌های شناور** حاشیه‌نویسی " +"کرد، و تصاویر دلخواه و ابزارک‌های دیگر را می‌توان در متن جاسازی کرد. این ابزارک همچنین " +"سازوکار نامحدود واگرد/ازنو را ارائه می‌دهد و از ابزارک‌های همتایی پشتیبانی می‌کند که " +"داده‌های زیربنایی یکسانی را به اشتراک می‌گذارند. از :class:`Widget`، :class:`XView` " +"و :class:`YView` ارث می‌برد، بنابراین می‌توان نما را به‌صورت افقی و عمودی " +"با :meth:`~XView.xview` و :meth:`~YView.yview` پیمایش کرد. برای فهرست کامل گزینه‌ها " +"به صفحه راهنمای ``text`` Tk مراجعه کنید." -msgid "Most of the methods take one or more *index* arguments that identify a position within the text. As described in the Tk ``text`` manual page, an index is a string consisting of a base, optionally followed by one or more modifiers. The base may be ``'line.char'`` (line *line*, character *char*, where lines are counted from 1 and characters within a line from 0; ``'line.end'`` refers to the newline ending the line), ``'end'`` (the position just after the last newline), the name of a mark, ``'tag.first'`` or ``'tag.last'`` (the first character tagged with *tag*, or the position just after the last such character), the name of an embedded image or window, or ``@x,y`` (the character covering pixel coordinates *x*, *y* in the widget). A modifier such as ``'+5 chars'``, ``'-3 lines'``, ``'linestart'``, ``'lineend'``, ``'wordstart'`` or ``'wordend'`` adjusts the index relative to its base; several modifiers may be combined and are applied from left to right, for example ``'insert wordstart - 1 c'``." -msgstr "" +msgid "" +"Most of the methods take one or more *index* arguments that identify a position " +"within the text. As described in the Tk ``text`` manual page, an index is a string " +"consisting of a base, optionally followed by one or more modifiers. The base may be " +"``'line.char'`` (line *line*, character *char*, where lines are counted from 1 and " +"characters within a line from 0; ``'line.end'`` refers to the newline ending the " +"line), ``'end'`` (the position just after the last newline), the name of a mark, " +"``'tag.first'`` or ``'tag.last'`` (the first character tagged with *tag*, or the " +"position just after the last such character), the name of an embedded image or " +"window, or ``@x,y`` (the character covering pixel coordinates *x*, *y* in the " +"widget). A modifier such as ``'+5 chars'``, ``'-3 lines'``, ``'linestart'``, " +"``'lineend'``, ``'wordstart'`` or ``'wordend'`` adjusts the index relative to its " +"base; several modifiers may be combined and are applied from left to right, for " +"example ``'insert wordstart - 1 c'``." +msgstr "" +"بیشتر متدها یک یا چند آرگومان *اندیس* می‌گیرند که موقعیتی را در متن مشخص می‌کنند. " +"همان‌طور که در صفحه‌ی راهنمای ``text`` Tk توضیح داده شده است، اندیس رشته‌ای است که از یک " +"پایه تشکیل شده و به‌صورت اختیاری یک یا چند اصلاح‌کننده در ادامه‌ی آن می‌آید. پایه می‌تواند " +"``'line.char'`` (خط *line*، نویسه *char*، که خط‌ها از ۱ و نویسه‌های درون یک خط از ۰ " +"شمارش می‌شوند؛ ``'line.end'`` به نویسه‌ی خط جدید در پایان خط اشاره دارد)، ``'end'`` " +"(موقعیت درست پس از آخرین خط جدید)، نام یک نشان (mark)، ``'tag.first'`` یا " +"``'tag.last'`` (اولین نویسه‌ی برچسب‌گذاری‌شده با *tag*، یا موقعیت درست پس از آخرین نویسه‌ی " +"این‌چنینی)، نام یک تصویر یا پنجره‌ی جاسازی‌شده، یا ``@x,y`` (نویسه‌ای که مختصات پیکسلی " +"*x*، *y* در ابزارک را پوشش می‌دهد) باشد. اصلاح‌کننده‌ای مانند ``'+5 chars'``، ``'-3 " +"lines'``، ``'linestart'``، ``'lineend'``، ``'wordstart'`` یا ``'wordend'`` اندیس را " +"نسبت به پایه‌ی خود تنظیم می‌کند؛ چندین اصلاح‌کننده می‌توانند ترکیب شوند و از چپ به راست " +"اعمال می‌شوند، برای مثال ``'insert wordstart - 1 c'``." -msgid "Insert the string *chars* just before the character at *index* (if *index* is ``'end'``, just before the final newline). By default the new text inherits any tags present on both sides of the insertion point. If *args* is given, it consists of alternating *tagList*, *chars* values: the preceding *chars* receives exactly the tags listed (a tag list may be a single tag name or a sequence of names), overriding the surrounding tags." -msgstr "" +msgid "" +"Insert the string *chars* just before the character at *index* (if *index* is " +"``'end'``, just before the final newline). By default the new text inherits any tags " +"present on both sides of the insertion point. If *args* is given, it consists of " +"alternating *tagList*, *chars* values: the preceding *chars* receives exactly the " +"tags listed (a tag list may be a single tag name or a sequence of names), overriding " +"the surrounding tags." +msgstr "" +"رشته‌ی *chars* را درست پیش از نویسه‌ی موجود در *index* درج کنید (اگر *index* برابر " +"``'end'`` باشد، درست پیش از نویسه‌ی خط جدید پایانی). به‌طور پیش‌فرض، متن جدید هر برچسب " +"موجود در هر دو طرف نقطه‌ی درج را به ارث می‌برد. اگر *args* داده شود، شامل مقادیر متناوب " +"*tagList* و *chars* است: مقدار *chars* پیشین دقیقاً برچسب‌های فهرست‌شده را دریافت می‌کند " +"(فهرست برچسب می‌تواند یک نام برچسب منفرد یا دنباله‌ای از نام‌ها باشد) و برچسب‌های اطراف " +"را نادیده می‌گیرد." -msgid "Delete the range of characters from *index1* up to but not including *index2*. If *index2* is omitted, the single character at *index1* is deleted. The widget always keeps a newline as its last character, so a deletion that would remove it is adjusted accordingly." +msgid "" +"Delete the range of characters from *index1* up to but not including *index2*. If " +"*index2* is omitted, the single character at *index1* is deleted. The widget always " +"keeps a newline as its last character, so a deletion that would remove it is " +"adjusted accordingly." msgstr "" +"بازه‌ای از نویسه‌ها را از *index1* تا *index2* حذف می‌کند، بدون این‌که *index2* را شامل " +"شود. اگر *index2* ذکر نشود، نویسه‌ی منفرد واقع در *index1* حذف می‌شود. ابزارک همیشه یک " +"نویسه‌ی خط جدید را به‌عنوان آخرین نویسه‌ی خود نگه می‌دارد، بنابراین حذفی که باعث حذف آن " +"شود، متناسب با آن تنظیم می‌شود." -msgid "Replace the range of characters from *index1* up to but not including *index2* with *chars*. This is equivalent to a :meth:`delete` followed by an :meth:`insert` at *index1*; *args* is interpreted as for :meth:`insert`." +msgid "" +"Replace the range of characters from *index1* up to but not including *index2* with " +"*chars*. This is equivalent to a :meth:`delete` followed by an :meth:`insert` at " +"*index1*; *args* is interpreted as for :meth:`insert`." msgstr "" +"بازه‌ای از نویسه‌ها از *index1* تا *index2*، بدون شامل شدن *index2*، را با *chars* " +"جایگزین می‌کند. این معادل یک :meth:`delete` و به دنبال آن یک :meth:`insert` در " +"*index1* است؛ *args* مانند :meth:`insert` تفسیر می‌شود." -msgid "Return the text from *index1* up to but not including *index2* as a string. If *index2* is omitted, return the single character at *index1*. Embedded images and windows are omitted from the result." +msgid "" +"Return the text from *index1* up to but not including *index2* as a string. If " +"*index2* is omitted, return the single character at *index1*. Embedded images and " +"windows are omitted from the result." msgstr "" +"متن را از *index1* تا *index2*، اما بدون شامل شدن *index2*، به صورت یک رشته " +"برمی‌گرداند. اگر *index2* حذف شده باشد، نویسه‌ی منفرد در *index1* را برمی‌گرداند. تصاویر " +"و پنجره‌های جاسازی‌شده از نتیجه حذف می‌شوند." -msgid "Return the position corresponding to *index* in the canonical ``'line.char'`` form." -msgstr "" +msgid "" +"Return the position corresponding to *index* in the canonical ``'line.char'`` form." +msgstr "موقعیت متناظر با *index* را در قالب متعارف ``'line.char'`` برمی‌گرداند." -msgid "Compare the positions of *index1* and *index2* using the relational operator *op*, which must be one of ``'<'``, ``'<='``, ``'=='``, ``'>='``, ``'>'`` or ``'!='``, and return the boolean result." +msgid "" +"Compare the positions of *index1* and *index2* using the relational operator *op*, " +"which must be one of ``'<'``, ``'<='``, ``'=='``, ``'>='``, ``'>'`` or ``'!='``, and " +"return the boolean result." msgstr "" +"موقعیت‌های *index1* و *index2* را با استفاده از عملگر رابطه‌ای *op* مقایسه می‌کند، که " +"باید یکی از ``'<'``، ``'<='``، ``'=='``، ``'>='``، ``'>'`` یا ``'!='`` باشد، و نتیجه " +"بولی را برمی‌گرداند." -msgid "Count the number of items of the requested kinds between *index1* and *index2*; the count is negative if *index1* is after *index2*. Each of *options* names a kind of item to count: ``'chars'``, ``'displaychars'``, ``'displayindices'``, ``'displaylines'``, ``'indices'``, ``'lines'``, ``'xpixels'`` or ``'ypixels'`` (the default, used when no option is given, is ``'indices'``). The pseudo-option ``'update'`` forces any out-of-date layout information to be recalculated before the following options are evaluated. When *return_ints* is true and a single counting option is given, return a plain integer; otherwise return a tuple with one integer per counting option (or ``None`` if the result is empty)." -msgstr "" +msgid "" +"Count the number of items of the requested kinds between *index1* and *index2*; the " +"count is negative if *index1* is after *index2*. Each of *options* names a kind of " +"item to count: ``'chars'``, ``'displaychars'``, ``'displayindices'``, " +"``'displaylines'``, ``'indices'``, ``'lines'``, ``'xpixels'`` or ``'ypixels'`` (the " +"default, used when no option is given, is ``'indices'``). The pseudo-option " +"``'update'`` forces any out-of-date layout information to be recalculated before the " +"following options are evaluated. When *return_ints* is true and a single counting " +"option is given, return a plain integer; otherwise return a tuple with one integer " +"per counting option (or ``None`` if the result is empty)." +msgstr "" +"تعداد آیتم‌های انواع درخواستی بین *index1* و *index2* را می‌شمارد؛ اگر *index1* بعد از " +"*index2* باشد، شمارش منفی است. هر یک از *options* نوعی از آیتم را برای شمارش مشخص " +"می‌کند: ``'chars'``، ``'displaychars'``، ``'displayindices'``، ``'displaylines'``، " +"``'indices'``، ``'lines'``، ``'xpixels'`` یا ``'ypixels'`` (پیش‌فرض، که وقتی گزینه‌ای " +"داده نشود استفاده می‌شود، ``'indices'`` است). شبه‌گزینه ``'update'`` باعث می‌شود هرگونه " +"اطلاعات چیدمان قدیمی پیش از ارزیابی گزینه‌های بعدی دوباره محاسبه شود. هنگامی که " +"*return_ints* درست باشد و تنها یک گزینه شمارش داده شود، یک عدد صحیح ساده برمی‌گرداند؛ " +"در غیر این صورت یک تاپل با یک عدد صحیح به ازای هر گزینه شمارش برمی‌گرداند (یا اگر " +"نتیجه خالی باشد، ``None``)." msgid "Added the *return_ints* parameter." -msgstr "" +msgstr "پارامتر *return_ints* اضافه شد." -msgid "Adjust the view so that the character given by *index* is visible. If it is already visible the method has no effect; if it is a short distance out of view the widget scrolls just enough to bring it to the nearest edge, otherwise it scrolls to center *index* in the window." +msgid "" +"Adjust the view so that the character given by *index* is visible. If it is already " +"visible the method has no effect; if it is a short distance out of view the widget " +"scrolls just enough to bring it to the nearest edge, otherwise it scrolls to center " +"*index* in the window." msgstr "" +"نما را طوری تنظیم می‌کند که نویسه‌ی مشخص‌شده با *index* قابل مشاهده باشد. اگر از قبل " +"قابل مشاهده باشد، این متد هیچ تأثیری ندارد؛ اگر در فاصله‌ی کمی خارج از دید باشد، " +"ابزارک فقط به اندازه‌ای پیمایش می‌کند که آن را به نزدیک‌ترین لبه برساند، در غیر این " +"صورت پیمایش می‌کند تا *index* را در وسط پنجره قرار دهد." -msgid "Return a tuple ``(x, y, width, height)`` giving the bounding box, in pixels, of the visible part of the character at *index*, or ``None`` if that character is not visible on the screen." +msgid "" +"Return a tuple ``(x, y, width, height)`` giving the bounding box, in pixels, of the " +"visible part of the character at *index*, or ``None`` if that character is not " +"visible on the screen." msgstr "" +"یک تاپل ``(x, y, width, height)`` برمی‌گرداند که جعبه‌ی محدودکننده بخش قابل‌مشاهده‌ی نویسه در " +"اندیس *index* را بر حسب پیکسل مشخص می‌کند، یا اگر آن نویسه روی صفحه‌نمایش قابل‌مشاهده " +"نباشد ``None`` برمی‌گرداند." -msgid "Return a tuple ``(x, y, width, height, baseline)`` describing the display line that contains *index*: the first four values give the bounding box of the line in pixels and *baseline* gives the offset of the baseline measured down from the top of the area. Return ``None`` if that display line is not visible on the screen." +msgid "" +"Return a tuple ``(x, y, width, height, baseline)`` describing the display line that " +"contains *index*: the first four values give the bounding box of the line in pixels " +"and *baseline* gives the offset of the baseline measured down from the top of the " +"area. Return ``None`` if that display line is not visible on the screen." msgstr "" +"یک تاپل ``(x, y, width, height, baseline)`` برمی‌گرداند که خط نمایشی حاوی *index* را " +"توصیف می‌کند: چهار مقدار اول جعبه‌ی محدودکننده‌ی خط را بر حسب پیکسل می‌دهند و *baseline* " +"فاصله‌ی خط کرسی را که از بالای ناحیه به سمت پایین اندازه‌گیری می‌شود، می‌دهد. اگر آن خط " +"نمایش روی صفحه قابل مشاهده نباشد، ``None`` برمی‌گرداند." -msgid "Set the mark named *markName* to the position just before the character at *index*, creating the mark if it does not already exist. A mark created this way has right gravity by default." +msgid "" +"Set the mark named *markName* to the position just before the character at *index*, " +"creating the mark if it does not already exist. A mark created this way has right " +"gravity by default." msgstr "" +"نشان (mark) با نام *markName* را در موقعیتی درست پیش از نویسه‌ای که در *index* قرار " +"دارد تنظیم می‌کند و در صورتی که این نشان از پیش وجود نداشته باشد، آن را ایجاد می‌کند. " +"نشانی که به این روش ایجاد شود، به‌طور پیش‌فرض دارای گرانش راست (right gravity) است." -msgid "Remove each of the marks named in *markNames*. The special ``insert`` and ``current`` marks may not be removed." +msgid "" +"Remove each of the marks named in *markNames*. The special ``insert`` and " +"``current`` marks may not be removed." msgstr "" +"هر یک از نشان‌های نام‌برده‌شده در *markNames* را حذف کنید. نشان‌های ویژه‌ی ``insert`` و " +"``current`` قابل حذف نیستند." msgid "Return a tuple of the names of all marks currently set in the widget." msgstr "" +"یک تاپلاز نام‌های تمام نشان‌هایی که در حال حاضر در ابزارک تنظیم شده‌اند " +"برمی‌گرداند." -msgid "If *direction* is omitted, return the gravity of mark *markName*, either ``'left'`` or ``'right'``. Otherwise set its gravity to *direction*. The gravity determines on which side of the mark text inserted at the mark's position appears: a mark with right gravity (the default) stays to the right of such text." +msgid "" +"If *direction* is omitted, return the gravity of mark *markName*, either ``'left'`` " +"or ``'right'``. Otherwise set its gravity to *direction*. The gravity determines on " +"which side of the mark text inserted at the mark's position appears: a mark with " +"right gravity (the default) stays to the right of such text." msgstr "" +"اگر *direction* حذف شود، گرانی (gravity) نشان *markName* را برمی‌گرداند؛ این مقدار یا " +"``'left'`` است یا ``'right'``. در غیر این صورت، گرانی آن را روی *direction* تنظیم " +"می‌کند. گرانی مشخص می‌کند که متن درج‌شده در موقعیت نشان، در کدام سمت نشان ظاهر می‌شود: " +"نشانی با گرانی راست (پیش‌فرض) در سمت راست چنین متنی باقی می‌ماند." -msgid "Return the name of the first mark at or after *index*, or ``None`` if there is none. When *index* is the name of a mark, the search starts just after that mark." +msgid "" +"Return the name of the first mark at or after *index*, or ``None`` if there is none. " +"When *index* is the name of a mark, the search starts just after that mark." msgstr "" +"نام اولین نشان در *index* یا پس از آن را برمی‌گرداند، یا اگر هیچ نشانی وجود نداشته " +"باشد، ``None`` را برمی‌گرداند. هنگامی که *index* نام یک نشان باشد، جستجو درست پس از " +"آن نشان شروع می‌شود." -msgid "Return the name of the last mark at or before *index*, or ``None`` if there is none. When *index* is the name of a mark, the search starts just before that mark." +msgid "" +"Return the name of the last mark at or before *index*, or ``None`` if there is none. " +"When *index* is the name of a mark, the search starts just before that mark." msgstr "" +"نام آخرین نشان در *index* یا پیش از آن برگردانده می‌شود، یا اگر نشانی وجود نداشته " +"باشد، ``None`` برگردانده می‌شود. هنگامی که *index* نام یک نشان باشد، جستجو درست پیش " +"از آن نشان آغاز می‌شود." -msgid "Add the tag *tagName* to the range of characters from *index1* up to but not including the next index in *args*. Further pairs of indices may follow in *args* to tag additional ranges; a trailing single index tags just the character at that index." +msgid "" +"Add the tag *tagName* to the range of characters from *index1* up to but not " +"including the next index in *args*. Further pairs of indices may follow in *args* to " +"tag additional ranges; a trailing single index tags just the character at that index." msgstr "" +"برچسب *tagName* را به بازه‌ی نویسه‌ها از *index1* تا اندیس بعدی در *args*، اما بدون " +"شامل شدن آن اندیس، اضافه کنید. ممکن است جفت‌های بیشتری از اندیس‌ها در *args* بیایند تا " +"بازه‌های بیشتری برچسب‌گذاری شوند؛ یک اندیس واحد پایانی، فقط نویسه‌ی همان اندیس را " +"برچسب‌گذاری می‌کند." -msgid "Remove the tag *tagName* from the characters from *index1* up to but not including *index2* (or from the single character at *index1* if *index2* is omitted). The tag itself continues to exist even if no characters carry it." +msgid "" +"Remove the tag *tagName* from the characters from *index1* up to but not including " +"*index2* (or from the single character at *index1* if *index2* is omitted). The tag " +"itself continues to exist even if no characters carry it." msgstr "" +"برچسب *tagName* را از نویسه‌ها، از *index1* تا *index2*، اما بدون شامل شدن *index2*، " +"حذف می‌کند (یا اگر *index2* حذف شده باشد، از نویسه‌ی واحد در *index1*). خود برچسب حتی " +"اگر هیچ نویسه‌ای آن را نداشته باشد، همچنان وجود دارد." -msgid "Delete each of the tags named in *tagNames*, removing them from all characters and discarding their options and bindings." +msgid "" +"Delete each of the tags named in *tagNames*, removing them from all characters and " +"discarding their options and bindings." msgstr "" +"هر یک از برچسب‌های نام‌برده‌شده در *tagNames* را حذف کنید، آن‌ها را از تمام نویسه‌ها " +"بردارید و گزینه‌ها و انتساب‌های آن‌ها را دور بیندازید." -msgid "Query or modify the configuration options of the tag *tagName*. This mirrors :meth:`~Misc.configure`, except that it applies to a tag rather than to the widget as a whole: with no options it returns a dictionary describing the current options, otherwise it sets the given options. Defining a tag this way also gives it a priority higher than any existing tag." -msgstr "" +msgid "" +"Query or modify the configuration options of the tag *tagName*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to a tag rather than to the " +"widget as a whole: with no options it returns a dictionary describing the current " +"options, otherwise it sets the given options. Defining a tag this way also gives it " +"a priority higher than any existing tag." +msgstr "" +"گزینه‌های پیکربندی برچسب *tagName* را بخوانید یا تغییر دهید. این روش " +"مشابه :meth:`~Misc.configure` است، با این تفاوت که به‌جای کل ابزارک، به یک برچسب اعمال " +"می‌شود: بدون هیچ گزینه‌ای، دیکشنری‌ای که گزینه‌های فعلی را توصیف می‌کند برمی‌گرداند، در " +"غیر این صورت گزینه‌های داده‌شده را تنظیم می‌کند. تعریف یک برچسب به این روش همچنین به آن " +"اولویتی بالاتر از هر برچسب موجود می‌دهد." -msgid "The supported tag options, all controlling the appearance of the tagged text, are:" +msgid "" +"The supported tag options, all controlling the appearance of the tagged text, are:" msgstr "" +"گزینه‌های برچسب پشتیبانی‌شده، که همگی ظاهر متن برچسب‌گذاری‌شده را کنترل می‌کنند، عبارتند " +"از:" msgid "*foreground*" -msgstr "" +msgstr "*پیش‌زمینه*" msgid "The color to use for the text." -msgstr "" +msgstr "رنگ مورد استفاده برای متن." msgid "*background*" -msgstr "" +msgstr "*پس‌زمینه*" msgid "The color to use for the area behind the text." -msgstr "" +msgstr "رنگی که برای ناحیه پشت متن استفاده می‌شود." msgid "*fgstipple*, *bgstipple*" -msgstr "" +msgstr "*fgstipple*, *bgstipple*" -msgid "Bitmaps used to stipple the foreground (text) and the background; only well supported on X11." +msgid "" +"Bitmaps used to stipple the foreground (text) and the background; only well " +"supported on X11." msgstr "" +"بیت‌مپ‌هایی که برای نقطه‌نگاری کردن (stipple) پیش‌زمینه (متن) و پس‌زمینه استفاده می‌شوند؛ " +"فقط در X11 به‌خوبی پشتیبانی می‌شوند." msgid "*borderwidth*" -msgstr "" +msgstr "*borderwidth*" -msgid "The width of the border drawn around the text according to *relief* (default ``0``)." -msgstr "" +msgid "" +"The width of the border drawn around the text according to *relief* (default ``0``)." +msgstr "پهنای حاشیه‌ای که اطراف متن بر اساس *relief* ترسیم می‌شود (پیش‌فرض ``0``)." msgid "*relief*" -msgstr "" +msgstr "*برجستگی (relief)*" -msgid "The 3-D appearance of the text's border: ``'flat'`` (the default), ``'raised'``, ``'sunken'``, ``'ridge'``, ``'groove'`` or ``'solid'``." +msgid "" +"The 3-D appearance of the text's border: ``'flat'`` (the default), ``'raised'``, " +"``'sunken'``, ``'ridge'``, ``'groove'`` or ``'solid'``." msgstr "" +"نمای سه‌بعدی حاشیه‌ی متن: ``'flat'`` (پیش‌فرض)، ``'raised'``، ``'sunken'``، ``'ridge'``، " +"``'groove'`` یا ``'solid'``." msgid "*offset*" -msgstr "" +msgstr "*آفست (offset)*" -msgid "How far the text is raised above (or, if negative, lowered below) the baseline, for superscripts and subscripts." +msgid "" +"How far the text is raised above (or, if negative, lowered below) the baseline, for " +"superscripts and subscripts." msgstr "" +"میزانی که متن بالاتر از خط کرسی (یا، اگر منفی باشد، پایین‌تر از آن) قرار می‌گیرد، برای " +"بالانویس‌ها و زیرنویس‌ها." msgid "Whether to underline the text." -msgstr "" +msgstr "اینکه آیا متن زیرخط‌دار شود یا خیر." msgid "*underlinefg*" -msgstr "" +msgstr "*underlinefg*" msgid "The color of the underline; it defaults to the text color." -msgstr "" +msgstr "رنگ زیرخط؛ به‌طور پیش‌فرض برابر با رنگ متن است." msgid "*overstrike*" -msgstr "" +msgstr "*خط‌خورده*" msgid "Whether to draw a line through the middle of the text." -msgstr "" +msgstr "اینکه آیا خطی از میان متن کشیده شود یا خیر." msgid "*overstrikefg*" -msgstr "" +msgstr "*overstrikefg*" msgid "The color of the overstrike line; it defaults to the text color." -msgstr "" +msgstr "رنگ خط خط‌خوردگی؛ به‌طور پیش‌فرض برابر با رنگ متن است." msgid "*elide*" -msgstr "" +msgstr "*حذف کردن*" msgid "Whether the text is elided (hidden)." -msgstr "" +msgstr "اینکه متن حذف‌شده (پنهان) است." -msgid "How to justify the first character of a display line: ``'left'`` (the default), ``'right'`` or ``'center'``." +msgid "" +"How to justify the first character of a display line: ``'left'`` (the default), " +"``'right'`` or ``'center'``." msgstr "" +"نحوه‌ی تراز کردن نخستین نویسه‌ی یک خط نمایشی: ``'left'`` (پیش‌فرض)، ``'right'`` یا " +"``'center'``." msgid "*wrap*" -msgstr "" +msgstr "*دربرگرفتن*" msgid "How to wrap lines that are too long: ``'char'``, ``'word'`` or ``'none'``." msgstr "" +"چگونگی شکستن خطوطی که بیش از حد طولانی هستند: ``'char'``، ``'word'`` یا ``'none'``." msgid "*lmargin1*, *lmargin2*" -msgstr "" +msgstr "*lmargin1*, *lmargin2*" -msgid "The indentation, in pixels, of the first display line of a logical line and of the remaining display lines." +msgid "" +"The indentation, in pixels, of the first display line of a logical line and of the " +"remaining display lines." msgstr "" +"میزان تورفتگی، بر حسب پیکسل، برای اولین خط نمایشیِ یک خط منطقی و برای سایر خطوط " +"نمایشی." msgid "*lmargincolor*" -msgstr "" +msgstr "*lmargincolor*" msgid "The color of the left margin area." -msgstr "" +msgstr "رنگ ناحیه‌ی حاشیه‌ی چپ." msgid "*rmargin*" -msgstr "" +msgstr "*rmargin*" msgid "The right-hand margin, in pixels." -msgstr "" +msgstr "حاشیه سمت راست، بر حسب پیکسل." msgid "*rmargincolor*" -msgstr "" +msgstr "*rmargincolor*" msgid "The color of the right margin area." -msgstr "" +msgstr "رنگ ناحیه‌ی حاشیه‌ی راست." msgid "*spacing1*, *spacing2*, *spacing3*" -msgstr "" +msgstr "*spacing1*, *spacing2*, *spacing3*" -msgid "Extra space, in pixels, above the first display line of a logical line, between its display lines, and below its last display line." +msgid "" +"Extra space, in pixels, above the first display line of a logical line, between its " +"display lines, and below its last display line." msgstr "" +"فضای اضافی، بر حسب پیکسل، بالای اولین خط نمایشی از یک خط منطقی، بین خط‌های نمایشی آن، " +"و پایین آخرین خط نمایشی آن." msgid "*tabs*" -msgstr "" +msgstr "*تب‌ها*" msgid "The set of tab stops, in the same form as the widget's *tabs* option." -msgstr "" +msgstr "مجموعه‌ی نقاط توقف تب، در همان قالب گزینه‌ی *tabs* ابزارک." msgid "*tabstyle*" -msgstr "" +msgstr "*tabstyle*" msgid "How tab stops are interpreted: ``'tabular'`` or ``'wordprocessor'``." -msgstr "" +msgstr "چگونگی تفسیر ایستگاه‌های تب (tab stops): ``'tabular'`` یا ``'wordprocessor'``." msgid "*selectbackground*, *selectforeground*" -msgstr "" +msgstr "*selectbackground*, *selectforeground*" msgid "The background and foreground colors used for the text while it is selected." -msgstr "" +msgstr "رنگ‌های پس‌زمینه و پیش‌زمینه‌ای که برای متن در حالت انتخاب‌شده استفاده می‌شوند." -msgid "Tk 8.6 added the *lmargincolor*, *overstrikefg*, *rmargincolor*, *selectbackground*, *selectforeground* and *underlinefg* options." +msgid "" +"Tk 8.6 added the *lmargincolor*, *overstrikefg*, *rmargincolor*, *selectbackground*, " +"*selectforeground* and *underlinefg* options." msgstr "" +"Tk 8.6 گزینه‌های *lmargincolor*، *overstrikefg*، *rmargincolor*، *selectbackground*، " +"*selectforeground* و *underlinefg* را افزود." msgid ":meth:`tag_config` is an alias of :meth:`!tag_configure`." -msgstr "" +msgstr ":meth:`tag_config` نام مستعاری از :meth:`!tag_configure` است." -msgid "Return the current value of the configuration option *option* for the tag *tagName*." -msgstr "" +msgid "" +"Return the current value of the configuration option *option* for the tag *tagName*." +msgstr "مقدار فعلی گزینه‌ی پیکربندی *option* برای برچسب *tagName* را برمی‌گرداند." -msgid "If *index* is omitted, return a tuple of the names of all tags defined in the widget; otherwise return only the names of the tags applied to the character at *index*. The names are ordered from lowest to highest priority." +msgid "" +"If *index* is omitted, return a tuple of the names of all tags defined in the " +"widget; otherwise return only the names of the tags applied to the character at " +"*index*. The names are ordered from lowest to highest priority." msgstr "" +"اگر *index* حذف شود، تاپلی از نام‌های همه‌ی برچسب‌های تعریف‌شده در ابزارک برمی‌گرداند؛ در " +"غیر این صورت، فقط نام‌های برچسب‌های اعمال‌شده بر نویسه‌ی موجود در *index* را برمی‌گرداند. " +"نام‌ها از کمترین اولویت به بیشترین اولویت مرتب شده‌اند." -msgid "Return a tuple of indices describing all ranges of text tagged with *tagName*. The result alternates start and end indices, so that elements ``2*i`` and ``2*i+1`` bound the *i*-th range." +msgid "" +"Return a tuple of indices describing all ranges of text tagged with *tagName*. The " +"result alternates start and end indices, so that elements ``2*i`` and ``2*i+1`` " +"bound the *i*-th range." msgstr "" +"یک تاپلاز اندیس‌ها برمی‌گرداند که همه‌ی بازه‌های متن برچسب‌گذاری‌شده با *tagName* " +"را توصیف می‌کند. نتیجه اندیس‌های شروع و پایان را به‌صورت یک‌درمیان شامل می‌شود، به‌طوری که " +"عناصر ``2*i`` و ``2*i+1`` کران‌های بازه‌ی *i*-ام هستند." -msgid "Search forward from *index1* (up to *index2* if given) for the first range of characters tagged with *tagName*, and return a two-element tuple of its start and end indices, or an empty tuple if there is no such range." +msgid "" +"Search forward from *index1* (up to *index2* if given) for the first range of " +"characters tagged with *tagName*, and return a two-element tuple of its start and " +"end indices, or an empty tuple if there is no such range." msgstr "" +"از *index1* به جلو (تا *index2* در صورت داده شدن) جستجو می‌کند تا اولین محدوده از " +"نویسه‌های برچسب‌گذاری‌شده با *tagName* را بیابد، و یک تاپل دو عنصری از اندیس‌های شروع و " +"پایان آن برمی‌گرداند، یا اگر چنین محدوده‌ای وجود نداشته باشد، یک تاپل خالی برمی‌گرداند." -msgid "Search backward from *index1* (down to *index2* if given) for the nearest preceding range of characters tagged with *tagName*, and return a two-element tuple of its start and end indices, or an empty tuple if there is no such range." +msgid "" +"Search backward from *index1* (down to *index2* if given) for the nearest preceding " +"range of characters tagged with *tagName*, and return a two-element tuple of its " +"start and end indices, or an empty tuple if there is no such range." msgstr "" +"از *index1* به عقب (تا *index2* در صورت ارائه شدن) نزدیک‌ترین بازه پیشین از نویسه‌های " +"برچسب‌گذاری‌شده با *tagName* را جستجو می‌کند و یک تاپل دو عنصری از اندیس‌های آغاز و " +"پایان آن برمی‌گرداند، یا اگر چنین بازه‌ای وجود نداشته باشد یک تاپل خالی برمی‌گرداند." -msgid "Raise the priority of tag *tagName* so that it is just above the priority of *aboveThis*, or to the highest priority of all tags if *aboveThis* is omitted. When the display options of overlapping tags conflict, the higher-priority tag wins." +msgid "" +"Raise the priority of tag *tagName* so that it is just above the priority of " +"*aboveThis*, or to the highest priority of all tags if *aboveThis* is omitted. When " +"the display options of overlapping tags conflict, the higher-priority tag wins." msgstr "" +"اولویت برچسب *tagName* را بالا می‌برد تا درست بالاتر از اولویت *aboveThis* قرار گیرد، " +"یا اگر *aboveThis* حذف شود، آن را به بالاترین اولویت در میان تمام برچسب‌ها می‌رساند. " +"هنگامی که گزینه‌های نمایش برچسب‌های هم‌پوشان با یکدیگر تعارض داشته باشند، برچسب با " +"اولویت بالاتر برنده می‌شود." -msgid "Lower the priority of tag *tagName* so that it is just below the priority of *belowThis*, or to the lowest priority of all tags if *belowThis* is omitted." +msgid "" +"Lower the priority of tag *tagName* so that it is just below the priority of " +"*belowThis*, or to the lowest priority of all tags if *belowThis* is omitted." msgstr "" +"اولویت برچسب *tagName* را کاهش دهید، به‌گونه‌ای که دقیقاً پایین‌تر از اولویت *belowThis* " +"قرار گیرد، یا اگر *belowThis* ذکر نشود، به پایین‌ترین اولویت همه برچسب‌ها برسد." -msgid "Bind the event *sequence* on characters tagged with *tagName* to the callback *func*, so that *func* is invoked when that event occurs over such a character. If *add* is true the binding is added alongside any existing bindings for *sequence*, otherwise it replaces them. Works like :meth:`~Misc.bind` and returns the identifier of the new binding." -msgstr "" +msgid "" +"Bind the event *sequence* on characters tagged with *tagName* to the callback " +"*func*, so that *func* is invoked when that event occurs over such a character. If " +"*add* is true the binding is added alongside any existing bindings for *sequence*, " +"otherwise it replaces them. Works like :meth:`~Misc.bind` and returns the identifier " +"of the new binding." +msgstr "" +"رویداد *sequence* را برای نویسه‌هایی که با *tagName* برچسب‌گذاری شده‌اند، به کال‌بک " +"*func* متصل می‌کند، به‌طوری‌که *func* هنگام وقوع آن رویداد روی چنین نویسه‌ای فراخوانی " +"می‌شود. اگر *add* درست باشد، اتصال در کنار هرگونه اتصال موجود برای *sequence* اضافه " +"می‌شود، در غیر این صورت آن‌ها را جایگزین می‌کند. مانند :meth:`~Misc.bind` کار می‌کند و " +"شناسه اتصال جدید را برمی‌گرداند." -msgid "Remove the bindings of the event *sequence* on characters tagged with *tagName*. If *funcid* is given, only that binding (as returned by :meth:`tag_bind`) is removed and its callback is unregistered." +msgid "" +"Remove the bindings of the event *sequence* on characters tagged with *tagName*. If " +"*funcid* is given, only that binding (as returned by :meth:`tag_bind`) is removed " +"and its callback is unregistered." msgstr "" +"اتصال‌های رویداد *sequence* را برای نویسه‌های برچسب‌گذاری‌شده با *tagName* حذف می‌کند. " +"اگر *funcid* داده شود، فقط همان اتصال (که توسط :meth:`tag_bind` برگردانده شده است) " +"حذف می‌شود و کال‌بک آن از ثبت خارج می‌شود." -msgid "Embed an image at *index* and return the name assigned to this image instance, which may then be used as an index or passed to the other ``image_*`` methods. The options, given in *cnf* and *kw*, include *image* (the Tk image to display), *name* (a base name for the instance), *align*, *padx* and *pady*." +msgid "" +"Embed an image at *index* and return the name assigned to this image instance, which " +"may then be used as an index or passed to the other ``image_*`` methods. The " +"options, given in *cnf* and *kw*, include *image* (the Tk image to display), *name* " +"(a base name for the instance), *align*, *padx* and *pady*." msgstr "" +"تصویری را در *index* جاسازی می‌کند و نام اختصاص‌داده‌شده به این نمونه تصویر را " +"برمی‌گرداند؛ سپس می‌توان از آن به‌عنوان اندیس استفاده کرد یا آن را به سایر متدهای " +"``image_*`` ارسال کرد. گزینه‌های داده‌شده در *cnf* و *kw* شامل *image* (تصویر Tk برای " +"نمایش)، *name* (نام پایه برای نمونه)، *align*، *padx* و *pady* هستند." -msgid "Return the current value of the configuration option *option* for the embedded image at *index*." +msgid "" +"Return the current value of the configuration option *option* for the embedded image " +"at *index*." msgstr "" +"مقدار فعلی گزینه‌ی پیکربندی *option* برای تصویر جاسازی‌شده در اندیس *index* را " +"برمی‌گرداند." -msgid "Query or modify the configuration options of the embedded image at *index*, like :meth:`~Misc.configure` but applied to that image." +msgid "" +"Query or modify the configuration options of the embedded image at *index*, " +"like :meth:`~Misc.configure` but applied to that image." msgstr "" +"گزینه‌های پیکربندی تصویر جاسازی‌شده در *index* را دریافت یا تغییر دهید؛ " +"مانند :meth:`~Misc.configure` اما بر آن تصویر اعمال می‌شود." msgid "Return a tuple of the names of all images embedded in the widget." -msgstr "" +msgstr "یک تاپل از نام‌های همه‌ی تصاویر تعبیه‌شده در ابزارک را بازمی‌گرداند." -msgid "This shadows the inherited :meth:`Misc.image_names`, which returns the names of all images in the Tcl interpreter; that method is not available on a :class:`Text`." +msgid "" +"This shadows the inherited :meth:`Misc.image_names`, which returns the names of all " +"images in the Tcl interpreter; that method is not available on a :class:`Text`." msgstr "" +"این، متد موروثی :meth:`Misc.image_names` را می‌پوشاند، که نام تمام تصاویر در مفسر Tcl " +"را برمی‌گرداند؛ آن متد برای یک :class:`Text` در دسترس نیست." -msgid "Embed a window (any widget) at *index*. The options, given in *cnf* and *kw*, include *window* (the widget to embed), *create* (a callback that creates the widget on demand), *align*, *stretch*, *padx* and *pady*. The embedded widget must be a descendant of the text widget's parent." +msgid "" +"Embed a window (any widget) at *index*. The options, given in *cnf* and *kw*, " +"include *window* (the widget to embed), *create* (a callback that creates the widget " +"on demand), *align*, *stretch*, *padx* and *pady*. The embedded widget must be a " +"descendant of the text widget's parent." msgstr "" +"یک پنجره (هر ابزارکی) را در *index* جاسازی کنید. گزینه‌های داده‌شده در *cnf* و *kw* " +"شامل *window* (ابزارکی که باید جاسازی شود)، *create* (یک کال‌بک که ابزارک را در صورت " +"نیاز ایجاد می‌کند)، *align*، *stretch*، *padx* و *pady* می‌شوند. ابزارک جاسازی‌شده باید " +"زیرمجموعه‌ای از والد ابزارک متنی باشد." -msgid "Return the current value of the configuration option *option* for the embedded window at *index*." +msgid "" +"Return the current value of the configuration option *option* for the embedded " +"window at *index*." msgstr "" +"مقدار فعلی گزینه‌ی پیکربندی *option* را برای پنجره‌ی جاسازی‌شده در اندیس *index* " +"برمی‌گرداند." -msgid "Query or modify the configuration options of the embedded window at *index*, like :meth:`~Misc.configure` but applied to that window." +msgid "" +"Query or modify the configuration options of the embedded window at *index*, " +"like :meth:`~Misc.configure` but applied to that window." msgstr "" +"گزینه‌های پیکربندی پنجره‌ی جاسازی‌شده در *index* را بخوانید یا تغییر دهید، " +"مانند :meth:`~Misc.configure` اما برای آن پنجره اعمال می‌شود." msgid ":meth:`window_config` is an alias of :meth:`!window_configure`." -msgstr "" +msgstr ":meth:`window_config` نام مستعاری از :meth:`!window_configure` است." msgid "Return a tuple of the names of all windows embedded in the widget." -msgstr "" +msgstr "تاپلی از نام تمام پنجره‌های تعبیه‌شده در ابزارک برمی‌گرداند." -msgid "Low-level wrapper around the Tk ``edit`` widget command that controls the undo/redo mechanism and the modified flag; *args* is the ``edit`` subcommand and its arguments. The :meth:`!edit_\\*` methods below are thin wrappers around it and are usually more convenient." +msgid "" +"Low-level wrapper around the Tk ``edit`` widget command that controls the undo/redo " +"mechanism and the modified flag; *args* is the ``edit`` subcommand and its " +"arguments. The :meth:`!edit_\\*` methods below are thin wrappers around it and are " +"usually more convenient." msgstr "" +"پوششی سطح پایین حول فرمان ابزارک ``edit`` در Tk که سازوکار undo/redo و پرچم modified " +"را کنترل می‌کند؛ *args* زیرفرمان ``edit`` و آرگومان‌های آن است. متدهای :meth:`!" +"edit_\\*` در زیر، پوششی‌های نازکی حول آن هستند و معمولاً راحت‌تر هستند." -msgid "If *arg* is omitted, return the current state of the modified flag as true or false; the flag is set automatically whenever the text is inserted or deleted. Otherwise set the flag to the boolean *arg*." +msgid "" +"If *arg* is omitted, return the current state of the modified flag as true or false; " +"the flag is set automatically whenever the text is inserted or deleted. Otherwise " +"set the flag to the boolean *arg*." msgstr "" +"اگر *arg* حذف شود، وضعیت فعلی پرچم تغییر را به‌صورت درست یا نادرست برمی‌گرداند؛ این " +"پرچم هر زمان که متن درج یا حذف شود، به‌طور خودکار تنظیم می‌شود. در غیر این صورت، پرچم " +"را به مقدار بولی *arg* تنظیم می‌کند." -msgid "Undo the most recent edit action, that is, all the inserts and deletes recorded on the undo stack since the previous separator, and move it to the redo stack. Raises :exc:`TclError` if the undo stack is empty. Has no effect unless the *undo* option is true. Since Tk 9.0, returns a tuple of indices delimiting the ranges of text that were changed." -msgstr "" +msgid "" +"Undo the most recent edit action, that is, all the inserts and deletes recorded on " +"the undo stack since the previous separator, and move it to the redo stack. " +"Raises :exc:`TclError` if the undo stack is empty. Has no effect unless the *undo* " +"option is true. Since Tk 9.0, returns a tuple of indices delimiting the ranges of " +"text that were changed." +msgstr "" +"آخرین عملیات ویرایش را واگرد می‌کند؛ یعنی همه‌ی درج‌ها و حذف‌هایی را که از جداکننده‌ی " +"پیشین در پشته‌ی واگرد ثبت‌شده‌اند واگرد می‌کند و آن را به پشته‌ی بازانجام منتقل می‌کند. " +"اگر پشته‌ی واگرد خالی باشد، :exc:`TclError` را پرتاب می‌کند. اگر گزینه‌ی *undo* مقدار " +"true نداشته باشد، هیچ اثری ندارد. از Tk 9.0، یک تاپل از اندیس‌ها برمی‌گرداند که مرزهای " +"بازه‌های متنی را که تغییر کرده‌اند مشخص می‌کنند." -msgid "Reapply the most recently undone edit action, provided no further edits have been made since, and move it back to the undo stack. Raises :exc:`TclError` if the redo stack is empty. Has no effect unless the *undo* option is true. Since Tk 9.0, returns a tuple of indices delimiting the ranges of text that were changed." +msgid "" +"Reapply the most recently undone edit action, provided no further edits have been " +"made since, and move it back to the undo stack. Raises :exc:`TclError` if the redo " +"stack is empty. Has no effect unless the *undo* option is true. Since Tk 9.0, " +"returns a tuple of indices delimiting the ranges of text that were changed." msgstr "" +"آخرین عمل ویرایشی واگردشده را دوباره اعمال می‌کند، مشروط بر اینکه از آن زمان ویرایش " +"دیگری انجام نشده باشد، و آن را به پشته‌ی واگرد بازمی‌گرداند. اگر پشته‌ی بازاجرا خالی " +"باشد، :exc:`TclError` را پرتاب می‌کند. هیچ تأثیری ندارد، مگر اینکه گزینه‌ی *undo* درست " +"باشد. از Tk 9.0، یک تاپل از اندیس‌ها برمی‌گرداند که محدوده‌های متن تغییرکرده را مشخص " +"می‌کنند." msgid "Clear the undo and redo stacks." -msgstr "" +msgstr "پشته‌های واگرد و بازگرد را پاک کنید." -msgid "Push a separator onto the undo stack, marking a boundary between edit actions for undo and redo. Has no effect unless the *undo* option is true. Separators are inserted automatically when the *autoseparators* option is true." +msgid "" +"Push a separator onto the undo stack, marking a boundary between edit actions for " +"undo and redo. Has no effect unless the *undo* option is true. Separators are " +"inserted automatically when the *autoseparators* option is true." msgstr "" +"یک جداکننده را روی پشته‌ی واگرد (undo) قرار می‌دهد و مرزی میان اقدام‌های ویرایشی برای " +"واگرد و بازانجام (redo) مشخص می‌کند. این کار هیچ تأثیری ندارد، مگر اینکه گزینه‌ی *undo* " +"درست باشد. هنگامی که گزینه‌ی *autoseparators* درست باشد، جداکننده‌ها به‌صورت خودکار درج " +"می‌شوند." -msgid "Search for *pattern* starting at *index* and return the index of the first character of the first match, or an empty string if there is no match. Searching stops at *stopindex* if given; otherwise it wraps around the ends of the text until the starting position is reached again. The following boolean keyword flags control the search: *forwards* or *backwards* select the direction (forward is the default); *exact* (the default) or *regexp* select literal or regular-expression matching; *nocase* makes the match case-insensitive; and *elide* causes hidden text to be searched as well. If *count* is a :class:`Variable`, the number of index positions in the match is stored in it." -msgstr "" +msgid "" +"Search for *pattern* starting at *index* and return the index of the first character " +"of the first match, or an empty string if there is no match. Searching stops at " +"*stopindex* if given; otherwise it wraps around the ends of the text until the " +"starting position is reached again. The following boolean keyword flags control the " +"search: *forwards* or *backwards* select the direction (forward is the default); " +"*exact* (the default) or *regexp* select literal or regular-expression matching; " +"*nocase* makes the match case-insensitive; and *elide* causes hidden text to be " +"searched as well. If *count* is a :class:`Variable`, the number of index positions " +"in the match is stored in it." +msgstr "" +"*pattern* را از *index* جست‌وجو می‌کند و اندیس نخستین نویسه‌ی اولین تطابق را برمی‌گرداند، " +"یا در صورت نبود تطابق، یک رشته خالی برمی‌گرداند. در صورت ارائه *stopindex*، جست‌وجو در " +"*stopindex* متوقف می‌شود؛ در غیر این صورت، جست‌وجو به‌صورت چرخشی میان دو انتهای متن " +"ادامه می‌یابد تا دوباره به موقعیت شروع برسد. پرچم‌های کلیدواژه‌ای بولی زیر، جست‌وجو را " +"کنترل می‌کنند: *forwards* یا *backwards* جهت را انتخاب می‌کنند (پیش‌فرض رو به جلو است)؛ " +"*exact* (پیش‌فرض) یا *regexp* تطبیق تحت‌اللفظی یا تطبیق با عبارت باقاعده را انتخاب " +"می‌کنند؛ *nocase* تطابق را غیرحساس به بزرگی و کوچکی حروف می‌کند؛ و *elide* باعث می‌شود " +"متن پنهان نیز جست‌وجو شود. اگر *count* یک :class:`Variable` باشد، تعداد موقعیت‌های " +"اندیس در تطابق، در آن ذخیره می‌شود." -msgid "Scroll the widget by 10 times the difference between *x*, *y* and the coordinates passed to the last :meth:`scan_mark` call. This is typically bound to mouse motion events, producing the effect of dragging the text at high speed through the window." +msgid "" +"Scroll the widget by 10 times the difference between *x*, *y* and the coordinates " +"passed to the last :meth:`scan_mark` call. This is typically bound to mouse motion " +"events, producing the effect of dragging the text at high speed through the window." msgstr "" +"ابزارک را به اندازه‌ی ۱۰ برابر اختلاف بین *x*، *y* و مختصات ارسال‌شده به آخرین " +"فراخوانی :meth:`scan_mark` پیمایش می‌کند. این عمل معمولاً به رویدادهای حرکت ماوس متصل " +"می‌شود و اثر کشیده‌شدن متن با سرعت بالا در پنجره را ایجاد می‌کند." -msgid "If *boolean* is omitted, return whether internal consistency checks of the B-tree data structure are enabled. Otherwise enable or disable them. The setting is shared by all text widgets and may noticeably slow down widgets holding large amounts of text." +msgid "" +"If *boolean* is omitted, return whether internal consistency checks of the B-tree " +"data structure are enabled. Otherwise enable or disable them. The setting is shared " +"by all text widgets and may noticeably slow down widgets holding large amounts of " +"text." msgstr "" +"اگر *boolean* حذف شده باشد، برمی‌گرداند که آیا بررسی‌های سازگاری درونی ساختار داده‌ای B-" +"tree فعال هستند یا خیر. در غیر این صورت، آن‌ها را فعال یا غیرفعال می‌کند. این تنظیم " +"میان تمام ابزارک‌های متنی مشترک است و ممکن است ابزارک‌هایی را که مقادیر زیادی متن دارند " +"به‌طور محسوسی کند کند." -msgid "Return the contents of the widget from *index1* up to but not including *index2* (or just the segment at *index1* if *index2* is omitted), including text and information about marks, tags, images and windows. The result is a list of ``(key, value, index)`` triples, where *key* is one of ``'text'``, ``'mark'``, ``'tagon'``, ``'tagoff'``, ``'image'`` or ``'window'``. By default all kinds are reported; passing any of the keyword arguments *all*, *text*, *mark*, *tag*, *image* or *window* as true restricts the dump to the selected kinds. If *command* is given, it is called once per triple with the three values as arguments and nothing is returned." -msgstr "" +msgid "" +"Return the contents of the widget from *index1* up to but not including *index2* (or " +"just the segment at *index1* if *index2* is omitted), including text and information " +"about marks, tags, images and windows. The result is a list of ``(key, value, " +"index)`` triples, where *key* is one of ``'text'``, ``'mark'``, ``'tagon'``, " +"``'tagoff'``, ``'image'`` or ``'window'``. By default all kinds are reported; " +"passing any of the keyword arguments *all*, *text*, *mark*, *tag*, *image* or " +"*window* as true restricts the dump to the selected kinds. If *command* is given, it " +"is called once per triple with the three values as arguments and nothing is returned." +msgstr "" +"محتویات ابزارک را از *index1* تا *index2*، بدون اینکه *index2* را شامل شود، برمی‌گرداند " +"(یا اگر *index2* حذف شده باشد، فقط بخش مربوط به *index1* را برمی‌گرداند)، از جمله متن " +"و اطلاعاتی درباره‌ی نشانه‌ها، برچسب‌ها، تصاویر و پنجره‌ها. نتیجه فهرستی از سه‌تایی‌های " +"``(key, value, index)`` است، که در آن *key* یکی از ``'text'``، ``'mark'``، " +"``'tagon'``، ``'tagoff'``، ``'image'`` یا ``'window'`` است. به‌طور پیش‌فرض همه‌ی انواع " +"گزارش می‌شوند؛ ارسال هر یک از آرگومان‌های کلیدواژه‌ای *all*، *text*، *mark*، *tag*، " +"*image* یا *window* به‌عنوان true، خروجی را به انواع انتخاب‌شده محدود می‌کند. اگر " +"*command* داده شود، یک بار به‌ازای هر سه‌تایی با سه مقدار به‌عنوان آرگومان فراخوانی " +"می‌شود و چیزی برگردانده نمی‌شود." -msgid "Create a peer text widget with the path name *newPathName* that shares this widget's underlying data (text, marks, tags, images and the undo stack). Changes made through any peer are reflected in all of them. By default the peer covers the same lines as this widget; standard text options, including *startline* and *endline*, may be given to override this." -msgstr "" +msgid "" +"Create a peer text widget with the path name *newPathName* that shares this widget's " +"underlying data (text, marks, tags, images and the undo stack). Changes made through " +"any peer are reflected in all of them. By default the peer covers the same lines as " +"this widget; standard text options, including *startline* and *endline*, may be " +"given to override this." +msgstr "" +"یک ابزارک متنی همتا با نام مسیر *newPathName* ایجاد کنید که داده‌های زیربنایی این " +"ابزارک (متن، نشانه‌ها، برچسب‌ها، تصاویر و پشته‌ی واگرد) را به اشتراک می‌گذارد. تغییراتی " +"که از طریق هر همتا اعمال شوند، در همه‌ی آن‌ها منعکس می‌شوند. به‌طور پیش‌فرض، همتا همان " +"خط‌هایی را پوشش می‌دهد که این ابزارک پوشش می‌دهد؛ می‌توان گزینه‌های استاندارد متنی، از " +"جمله *startline* و *endline* را برای تغییر این رفتار ارائه کرد." -msgid "Return a tuple of the path names of this widget's peers, not including the widget itself." +msgid "" +"Return a tuple of the path names of this widget's peers, not including the widget " +"itself." msgstr "" +"یک تاپل از نام‌های مسیر همتاهای این ابزارک را برمی‌گرداند، بدون این‌که خود ابزارک را شامل " +"شود." -msgid "Adjust the view so that the location given by *what* is visible. This is an obsolete equivalent of :meth:`see`, which should be used instead." +msgid "" +"Adjust the view so that the location given by *what* is visible. This is an obsolete " +"equivalent of :meth:`see`, which should be used instead." msgstr "" +"نما را طوری تنظیم کنید که موقعیت داده‌شده توسط *what* قابل مشاهده باشد. این یک معادل " +"منسوخ از :meth:`see` است که باید به‌جای آن استفاده شود." msgid "Variable classes" -msgstr "" +msgstr "کلاس‌های متغیر" -msgid "The base class for the Tk variable wrappers. A Tk variable is a value stored in the Tcl interpreter that can be linked to widgets through their *variable* or *textvariable* options (see :ref:`coupling-widget-variables`), so that changes propagate both ways: updating the variable updates every widget bound to it, and a user editing such a widget updates the variable." -msgstr "" +msgid "" +"The base class for the Tk variable wrappers. A Tk variable is a value stored in the " +"Tcl interpreter that can be linked to widgets through their *variable* or " +"*textvariable* options (see :ref:`coupling-widget-variables`), so that changes " +"propagate both ways: updating the variable updates every widget bound to it, and a " +"user editing such a widget updates the variable." +msgstr "" +"کلاس پایه برای دربرگیرنده‌های متغیر Tk. یک متغیر Tk مقداری است که در مفسر Tcl ذخیره " +"می‌شود و می‌تواند از طریق گزینه‌های *variable* یا *textvariable* به ابزارک‌ها پیوند داده " +"شود (به :ref:`coupling-widget-variables` مراجعه کنید)، به‌طوری که تغییرات در هر دو " +"جهت منتشر شوند: به‌روزرسانی متغیر، هر ابزارک متصل به آن را به‌روزرسانی می‌کند و ویرایش " +"چنین ابزارکی توسط کاربر، متغیر را به‌روزرسانی می‌کند." -msgid "*master* is the widget whose Tcl interpreter owns the variable; if omitted, the default root window is used. *value* is the initial value; if omitted, a type-specific default is used. *name* is the name of the variable in the Tcl interpreter; if omitted, a unique name of the form ``'PY_VARnum'`` is generated. If *name* matches an existing variable and *value* is omitted, the existing value is retained." -msgstr "" +msgid "" +"*master* is the widget whose Tcl interpreter owns the variable; if omitted, the " +"default root window is used. *value* is the initial value; if omitted, a type-" +"specific default is used. *name* is the name of the variable in the Tcl interpreter; " +"if omitted, a unique name of the form ``'PY_VARnum'`` is generated. If *name* " +"matches an existing variable and *value* is omitted, the existing value is retained." +msgstr "" +"*master* ابزارکی است که مفسر Tcl آن مالک متغیر است؛ اگر حذف شود، از پنجره ریشه " +"پیش‌فرض استفاده می‌شود. *value* مقدار اولیه است؛ اگر حذف شود، از پیش‌فرضی متناسب با نوع " +"استفاده می‌شود. *name* نام متغیر در مفسر Tcl است؛ اگر حذف شود، نام یکتایی به شکل " +"``'PY_VARnum'`` تولید می‌شود. اگر *name* با یک متغیر موجود مطابقت داشته باشد و " +"*value* حذف شود، مقدار موجود حفظ می‌شود." -msgid "In most cases you should use one of the typed subclasses below -- :class:`StringVar`, :class:`IntVar`, :class:`DoubleVar` or :class:`BooleanVar` -- rather than :class:`!Variable` directly." +msgid "" +"In most cases you should use one of the typed subclasses below " +"-- :class:`StringVar`, :class:`IntVar`, :class:`DoubleVar` or :class:`BooleanVar` -- " +"rather than :class:`!Variable` directly." msgstr "" +"در بیشتر موارد باید از یکی از زیرکلاس‌های نوع‌دار زیر " +"-- :class:`StringVar`، :class:`IntVar`، :class:`DoubleVar` یا :class:`BooleanVar` -- " +"به جای استفاده‌ی مستقیم از :class:`!Variable` استفاده کنید." -msgid "When a :class:`!Variable` is garbage collected, its Tcl variable is unset. Keep a reference to it for as long as a widget is linked to it, for example by storing it as an attribute rather than in a local variable. Otherwise Tk recreates the Tcl variable to keep the widget working, but it is never unset again, leaking one Tcl variable per dropped wrapper." -msgstr "" +msgid "" +"When a :class:`!Variable` is garbage collected, its Tcl variable is unset. Keep a " +"reference to it for as long as a widget is linked to it, for example by storing it " +"as an attribute rather than in a local variable. Otherwise Tk recreates the Tcl " +"variable to keep the widget working, but it is never unset again, leaking one Tcl " +"variable per dropped wrapper." +msgstr "" +"هنگامی که یک :class:`!Variable` زباله‌روبی می‌شود، متغیر Tcl آن حذف می‌شود. تا زمانی که " +"یک ابزارک به آن پیوند دارد، ارجاعی به آن نگه دارید، برای مثال با ذخیره کردن آن به‌عنوان " +"یک ویژگی به‌جای یک متغیر محلی. در غیر این صورت، Tk متغیر Tcl را دوباره ایجاد می‌کند تا " +"ابزارک را در حال کار نگه دارد، اما این متغیر هرگز دوباره حذف نمی‌شود و باعث نشت یک " +"متغیر Tcl به‌ازای رها شدن هر دربرگیرنده می‌شود." -msgid "Two variables now compare equal (``==``) only when they have the same name, are of the same class, and belong to the same Tcl interpreter." +msgid "" +"Two variables now compare equal (``==``) only when they have the same name, are of " +"the same class, and belong to the same Tcl interpreter." msgstr "" +"اکنون دو متغیر تنها زمانی با هم برابر (``==``) مقایسه می‌شوند که نام یکسانی داشته " +"باشند، از یک کلاس باشند و به یک مفسر Tcl تعلق داشته باشند." -msgid "Return the current value of the variable. For the base class the value is returned as a string; the typed subclasses convert it to the appropriate Python type." +msgid "" +"Return the current value of the variable. For the base class the value is returned " +"as a string; the typed subclasses convert it to the appropriate Python type." msgstr "" +"مقدار فعلی متغیر را برمی‌گرداند. در کلاس پایه، مقدار به‌صورت یک رشته برگردانده می‌شود؛ " +"زیرکلاس‌های نوع‌دار آن را به نوع مناسب پایتون تبدیل می‌کنند." msgid "Set the variable to *value*. :meth:`initialize` is an alias of :meth:`!set`." msgstr "" +"متغیر را روی *value* تنظیم کنید. :meth:`initialize` نام مستعار :meth:`!set` است." msgid "The *initialize* spelling." -msgstr "" +msgstr "املای *initialize*." -msgid "Register *callback* to be called when the variable is accessed according to *mode*. *mode* is one of the strings ``'array'``, ``'read'``, ``'write'`` or ``'unset'``, or a list or tuple of such strings." +msgid "" +"Register *callback* to be called when the variable is accessed according to *mode*. " +"*mode* is one of the strings ``'array'``, ``'read'``, ``'write'`` or ``'unset'``, or " +"a list or tuple of such strings." msgstr "" +"*callback* را ثبت کنید تا هرگاه متغیر مطابق *mode* مورد دسترسی قرار گرفت، فراخوانی " +"شود. *mode* یکی از رشته‌های ``'array'``، ``'read'``، ``'write'`` یا ``'unset'`` است، " +"یا فهرستی یا تاپلی از چنین رشته‌هایی." -msgid "When triggered, *callback* is called with three arguments: the name of the Tcl variable, an index (or an empty string if the variable is not an element of an array), and the *mode* that triggered the call." +msgid "" +"When triggered, *callback* is called with three arguments: the name of the Tcl " +"variable, an index (or an empty string if the variable is not an element of an " +"array), and the *mode* that triggered the call." msgstr "" +"هنگامی که فعال شود، *کال‌بک* با سه آرگومان فراخوانی می‌شود: نام متغیر Tcl، یک اندیس " +"(یا یک رشته خالی اگر متغیر عنصری از یک آرایه نباشد)، و *حالت* که فراخوانی را فعال " +"کرده است." -msgid "Return the internal name of the registered callback, which can be passed to :meth:`trace_remove`." +msgid "" +"Return the internal name of the registered callback, which can be passed " +"to :meth:`trace_remove`." msgstr "" +"نام داخلی کال‌بک ثبت‌شده را برمی‌گرداند، که می‌توان آن را به :meth:`trace_remove` ارسال " +"کرد." -msgid "Remove a trace callback from the variable. *mode* must match the *mode* that was passed to :meth:`trace_add`, and *cbname* is the callback name returned by :meth:`trace_add`." +msgid "" +"Remove a trace callback from the variable. *mode* must match the *mode* that was " +"passed to :meth:`trace_add`, and *cbname* is the callback name returned " +"by :meth:`trace_add`." msgstr "" +"یک کال‌بک ردگیری را از متغیر حذف کنید. *mode* باید با *mode* ارسال‌شده " +"به :meth:`trace_add` مطابقت داشته باشد، " +"و *cbname* نام کال‌بکی است که توسط :meth:`trace_add` بازگردانده شده است." -msgid "Return a list of ``(modes, cbname)`` pairs describing all traces currently set on the variable, where *modes* is a tuple of mode strings and *cbname* is the internal callback name." +msgid "" +"Return a list of ``(modes, cbname)`` pairs describing all traces currently set on " +"the variable, where *modes* is a tuple of mode strings and *cbname* is the internal " +"callback name." msgstr "" +"فهرستی از جفت‌های ``(modes, cbname)`` برمی‌گرداند که توصیف‌کننده‌ی همه‌ی ردگیری‌هایی هستند " +"که در حال حاضر روی متغیر تنظیم‌شده‌اند؛ در اینجا *modes* تاپلی از رشته‌های حالت و " +"*cbname* نام کال‌بک داخلی است." -msgid "Register *callback* to be called when the variable is accessed according to *mode*. *mode* is one of the strings ``'r'``, ``'w'`` or ``'u'``, for read, write or unset. Return the internal name of the registered callback. :meth:`trace` is an alias of :meth:`!trace_variable`." +msgid "" +"Register *callback* to be called when the variable is accessed according to *mode*. " +"*mode* is one of the strings ``'r'``, ``'w'`` or ``'u'``, for read, write or unset. " +"Return the internal name of the registered callback. :meth:`trace` is an alias " +"of :meth:`!trace_variable`." msgstr "" +"*callback* را ثبت کنید تا هنگامی که متغیر مطابق *mode* مورد دسترسی قرار می‌گیرد، " +"فراخوانی شود. *mode* یکی از رشته‌های ``'r'``، ``'w'`` یا ``'u'`` برای خواندن، نوشتن " +"یا حذف است. نام داخلی کال‌بک ثبت‌شده را برمی‌گرداند. :meth:`trace` یک نام مستعار " +"برای :meth:`!trace_variable` است." -msgid "Use :meth:`trace_add` instead. This method wraps a Tcl feature that was removed in Tcl 9.0." +msgid "" +"Use :meth:`trace_add` instead. This method wraps a Tcl feature that was removed in " +"Tcl 9.0." msgstr "" +"به‌جای آن از :meth:`trace_add` استفاده کنید. این متد یک ویژگی Tcl را پوشش می‌دهد که " +"در Tcl 9.0 حذف شده است." -msgid "Remove the trace callback named *cbname* registered for *mode* with :meth:`trace_variable`." +msgid "" +"Remove the trace callback named *cbname* registered for *mode* " +"with :meth:`trace_variable`." msgstr "" +"کال‌بک ردگیری به نام *cbname* را که برای *mode* با :meth:`trace_variable` ثبت شده " +"است، حذف کنید." -msgid "Use :meth:`trace_remove` instead. This method wraps a Tcl feature that was removed in Tcl 9.0." +msgid "" +"Use :meth:`trace_remove` instead. This method wraps a Tcl feature that was removed " +"in Tcl 9.0." msgstr "" +"به‌جای آن از :meth:`trace_remove` استفاده کنید. این متد پوششی برای یک قابلیت Tcl است " +"که در Tcl 9.0 حذف شده است." -msgid "Return a list of ``(mode, cbname)`` pairs for all traces set on the variable with :meth:`trace_variable`." +msgid "" +"Return a list of ``(mode, cbname)`` pairs for all traces set on the variable " +"with :meth:`trace_variable`." msgstr "" +"فهرستی از جفت‌های ``(mode, cbname)`` را برای تمام ردگیری‌های تنظیم‌شده روی متغیر " +"با :meth:`trace_variable` برمی‌گرداند." -msgid "Use :meth:`trace_info` instead. This method wraps a Tcl feature that was removed in Tcl 9.0." +msgid "" +"Use :meth:`trace_info` instead. This method wraps a Tcl feature that was removed in " +"Tcl 9.0." msgstr "" +"به‌جای آن از :meth:`trace_info` استفاده کنید. این متد پوششی برای یک قابلیت Tcl است که " +"در Tcl 9.0 حذف شده است." msgid "A :class:`Variable` subclass that holds a string. The default value is ``''``." msgstr "" +"زیرکلاسی از :class:`Variable` که یک رشته را نگه می‌دارد. مقدار پیش‌فرض ``''`` است." msgid "Return the value of the variable as a :class:`str`." -msgstr "" +msgstr "مقدار متغیر را به‌عنوان :class:`str` برمی‌گرداند." msgid "A :class:`Variable` subclass that holds an integer. The default value is ``0``." msgstr "" +"یک زیرکلاس از :class:`Variable` که یک عدد صحیح را نگه می‌دارد. مقدار پیش‌فرض ``0`` است." msgid "Return the value of the variable as an :class:`int`." -msgstr "" +msgstr "مقدار متغیر را به‌صورت یک :class:`int` برمی‌گرداند." msgid "A :class:`Variable` subclass that holds a float. The default value is ``0.0``." msgstr "" +"زیرکلاسی از :class:`Variable` که یک عدد اعشاری (float) را نگه می‌دارد. مقدار پیش‌فرض " +"``0.0`` است." msgid "Return the value of the variable as a :class:`float`." -msgstr "" +msgstr "مقدار متغیر را به‌عنوان :class:`float` برمی‌گرداند." -msgid "A floating-point value is always parsed with a period (``.``) as the decimal separator, but :class:`Spinbox`, :class:`Scale` and :class:`ttk.Spinbox ` format it according to the ``LC_NUMERIC`` locale. Under a locale that uses a comma they produce a value that :meth:`get` cannot read, raising :exc:`TclError`. Set ``LC_NUMERIC`` to a locale that uses a period (such as ``'C'``) to avoid this." -msgstr "" +msgid "" +"A floating-point value is always parsed with a period (``.``) as the decimal " +"separator, but :class:`Spinbox`, :class:`Scale` and :class:`ttk.Spinbox " +"` format it according to the ``LC_NUMERIC`` locale. Under a " +"locale that uses a comma they produce a value that :meth:`get` cannot read, " +"raising :exc:`TclError`. Set ``LC_NUMERIC`` to a locale that uses a period (such as " +"``'C'``) to avoid this." +msgstr "" +"یک مقدار ممیز شناور همیشه با یک نقطه (``.``) به‌عنوان جداکننده اعشاری تجزیه می‌شود، " +"اما :class:`Spinbox`، :class:`Scale` و :class:`ttk.Spinbox ` آن " +"را مطابق locale ``LC_NUMERIC`` قالب‌بندی می‌کنند. در localeای که از کاما استفاده می‌کند، " +"آن‌ها مقداری تولید می‌کنند که :meth:`get` نمی‌تواند آن را بخواند و :exc:`TclError` " +"پرتاب می‌شود. برای اجتناب از این مورد، ``LC_NUMERIC`` را روی localeای تنظیم کنید که از " +"نقطه استفاده می‌کند (مانند ``'C'``)." -msgid "A :class:`Variable` subclass that holds a boolean. The default value is ``False``." +msgid "" +"A :class:`Variable` subclass that holds a boolean. The default value is ``False``." msgstr "" +"یک زیرکلاس از :class:`Variable` که یک مقدار بولی نگه می‌دارد. مقدار پیش‌فرض ``False`` " +"است." -msgid "Return the value of the variable as a :class:`bool`. Raise a :exc:`ValueError` if the value cannot be interpreted as a boolean." +msgid "" +"Return the value of the variable as a :class:`bool`. Raise a :exc:`ValueError` if " +"the value cannot be interpreted as a boolean." msgstr "" +"مقدار متغیر را به‌عنوان :class:`bool` برمی‌گرداند. اگر مقدار نتواند به‌عنوان یک بولی " +"تفسیر شود، یک :exc:`ValueError` پرتاب می‌کند." -msgid "Set the variable to *value*, converting it to a boolean. :meth:`initialize` is an alias of :meth:`!set`." +msgid "" +"Set the variable to *value*, converting it to a boolean. :meth:`initialize` is an " +"alias of :meth:`!set`." msgstr "" +"متغیر را روی *value* تنظیم می‌کند و آن را به بولی تبدیل می‌کند. :meth:`initialize` نام " +"مستعاری از :meth:`!set` است." msgid "Image classes" -msgstr "" +msgstr "کلاس‌های تصویر" -msgid "Base class for Tk images. *imgtype* is the Tk image type, one of ``'photo'`` or ``'bitmap'``. An image is a named object that can be displayed by widgets through their *image* option; deleting all references to the :class:`!Image` object deletes the underlying Tk image. Usually you create a :class:`PhotoImage` or :class:`BitmapImage` rather than an :class:`!Image` directly." -msgstr "" +msgid "" +"Base class for Tk images. *imgtype* is the Tk image type, one of ``'photo'`` or " +"``'bitmap'``. An image is a named object that can be displayed by widgets through " +"their *image* option; deleting all references to the :class:`!Image` object deletes " +"the underlying Tk image. Usually you create a :class:`PhotoImage` " +"or :class:`BitmapImage` rather than an :class:`!Image` directly." +msgstr "" +"کلاس پایه برای تصاویر Tk. *imgtype* نوع تصویر Tk است، یکی از ``'photo'`` یا " +"``'bitmap'``. تصویر یک شیء دارای نام است که ابزارک‌ها می‌توانند آن را از طریق گزینه‌ی " +"*image* خود نمایش دهند؛ حذف همه‌ی ارجاع‌ها به شیء :class:`!Image`، تصویر زیربنایی Tk " +"را حذف می‌کند. معمولاً به‌جای ایجاد مستقیم یک :class:`!Image`، یک :class:`PhotoImage` " +"یا :class:`BitmapImage` ایجاد می‌کنید." -msgid "The image's configuration options are given by *cnf* and *kw* and may be queried and changed later with the mapping protocol (using ``image[key]``) or with the :meth:`configure` method." +msgid "" +"The image's configuration options are given by *cnf* and *kw* and may be queried and " +"changed later with the mapping protocol (using ``image[key]``) or with " +"the :meth:`configure` method." msgstr "" +"گزینه‌های پیکربندی تصویر با *cnf* و *kw* مشخص می‌شوند و بعداً می‌توان آن‌ها را با پروتکل " +"نگاشت (با استفاده از ``image[key]``) یا با متد :meth:`configure` پرس‌وجو و تغییر داد." -msgid "Modify one or more configuration options of the image. The valid options depend on the image type; see :class:`PhotoImage` and :class:`BitmapImage`. :meth:`config` is an alias of :meth:`!configure`." +msgid "" +"Modify one or more configuration options of the image. The valid options depend on " +"the image type; see :class:`PhotoImage` and :class:`BitmapImage`. :meth:`config` is " +"an alias of :meth:`!configure`." msgstr "" +"یک یا چند گزینه‌ی پیکربندی تصویر را تغییر دهید. گزینه‌های معتبر به نوع تصویر بستگی " +"دارند؛ به :class:`PhotoImage` و :class:`BitmapImage` مراجعه کنید. :meth:`config` نام " +"مستعاری از :meth:`!configure` است." msgid "Return the height of the image, in pixels." -msgstr "" +msgstr "ارتفاع تصویر را بر حسب پیکسل برمی‌گرداند." msgid "Return the width of the image, in pixels." -msgstr "" +msgstr "عرض تصویر را بر حسب پیکسل برمی‌گرداند." -msgid "Return the type of the image, that is the value of *imgtype* with which it was created (for example ``'photo'`` or ``'bitmap'``)." +msgid "" +"Return the type of the image, that is the value of *imgtype* with which it was " +"created (for example ``'photo'`` or ``'bitmap'``)." msgstr "" +"نوع تصویر را برمی‌گرداند، یعنی مقدار *imgtype* که با آن ایجاد شده است (برای مثال " +"``'photo'`` یا ``'bitmap'``)." -msgid "A full-color image (the Tk ``photo`` image type), stored internally with a varying degree of transparency per pixel. It can read and write GIF, PPM/PGM and (in Tk 8.6 and later) PNG files, read SVG files (in Tk 9.0 and later), and be drawn in widgets. Inherits from :class:`Image`." +msgid "" +"A full-color image (the Tk ``photo`` image type), stored internally with a varying " +"degree of transparency per pixel. It can read and write GIF, PPM/PGM and (in Tk 8.6 " +"and later) PNG files, read SVG files (in Tk 9.0 and later), and be drawn in widgets. " +"Inherits from :class:`Image`." msgstr "" +"یک تصویر تمام‌رنگی (نوع تصویر ``photo`` در Tk)، که به‌صورت داخلی با درجه‌ای متغیر از " +"شفافیت برای هر پیکسل ذخیره می‌شود. این تصویر می‌تواند فایل‌های GIF، PPM/PGM و (در Tk " +"8.6 و بعد از آن) PNG را بخواند و بنویسد، فایل‌های SVG را (در Tk 9.0 و بعد از آن) " +"بخواند، و در ابزارک‌ها ترسیم شود. از :class:`Image` ارث می‌برد." -msgid "The configuration options include *data* (the image contents as a string), *file* (the name of a file to read the contents from), *format* (the name of the file format handler), *width* and *height* (the size of the image, used when building it up piece by piece), *gamma* and *palette*." +msgid "" +"The configuration options include *data* (the image contents as a string), *file* " +"(the name of a file to read the contents from), *format* (the name of the file " +"format handler), *width* and *height* (the size of the image, used when building it " +"up piece by piece), *gamma* and *palette*." msgstr "" +"گزینه‌های پیکربندی شامل *data* (محتوای تصویر به‌صورت یک رشته)، *file* (نام فایلی که " +"محتوا از آن خوانده می‌شود)، *format* (نام هندلر قالب فایل)، *width* و *height* " +"(اندازه‌ی تصویر، که هنگام ساخت آن به‌صورت تکه‌تکه استفاده می‌شود)، *gamma* و *palette* " +"هستند." -msgid "Blank the image; that is, set the entire image to have no data, so that it is displayed as transparent and the background of whatever window it is displayed in shows through." +msgid "" +"Blank the image; that is, set the entire image to have no data, so that it is " +"displayed as transparent and the background of whatever window it is displayed in " +"shows through." msgstr "" +"تصویر را خالی کنید؛ یعنی کل تصویر را طوری تنظیم کنید که هیچ داده‌ای نداشته باشد، " +"به‌گونه‌ای که به‌صورت شفاف نمایش داده شود و پس‌زمینه‌ی هر پنجره‌ای که در آن نمایش داده " +"می‌شود، از پشت آن نمایان باشد." msgid "Return the current value of the configuration option *option*." -msgstr "" +msgstr "مقدار فعلی گزینه‌ی پیکربندی *option* را برمی‌گرداند." msgid "Return a new :class:`PhotoImage` with a copy of this image." -msgstr "" +msgstr "یک :class:`PhotoImage` جدید با یک کپی از این تصویر برمی‌گرداند." -msgid "*from_coords* specifies a rectangular sub-region of the source image to be copied. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. ``(x1, y1)`` and ``(x2, y2)`` specify diagonally opposite corners of the rectangle. If *x2* and *y2* are not specified, they default to the bottom-right corner of the source image. The pixels copied include the left and top edges of the rectangle but not the bottom or right edges. If *from_coords* is not given, the whole source image is copied." -msgstr "" +msgid "" +"*from_coords* specifies a rectangular sub-region of the source image to be copied. " +"It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. ``(x1, y1)`` " +"and ``(x2, y2)`` specify diagonally opposite corners of the rectangle. If *x2* and " +"*y2* are not specified, they default to the bottom-right corner of the source image. " +"The pixels copied include the left and top edges of the rectangle but not the bottom " +"or right edges. If *from_coords* is not given, the whole source image is copied." +msgstr "" +"*from_coords* ناحیه‌ی فرعی مستطیلی از تصویر مبدأ را مشخص می‌کند که باید کپی شود. این " +"مقدار باید یک تاپل یا فهرستی از ۱ تا ۴ عدد صحیح ``(x1, y1, x2, y2)`` باشد. ``(x1, " +"y1)`` و ``(x2, y2)`` دو گوشه‌ی مقابل به‌صورت مورب از مستطیل را مشخص می‌کنند. اگر *x2* و " +"*y2* مشخص نشده باشند، به‌طور پیش‌فرض برابر با گوشه‌ی پایین سمت راست تصویر مبدأ خواهند " +"بود. پیکسل‌های کپی‌شده شامل لبه‌های چپ و بالای مستطیل می‌شوند، اما لبه‌های پایین یا راست " +"را شامل نمی‌شوند. اگر *from_coords* داده نشود، کل تصویر مبدأ کپی می‌شود." -msgid "If *zoom* or *subsample* are specified, the image is transformed as in the :meth:`zoom` or :meth:`subsample` methods. The value must be a single integer or a pair of integers." +msgid "" +"If *zoom* or *subsample* are specified, the image is transformed as in " +"the :meth:`zoom` or :meth:`subsample` methods. The value must be a single integer or " +"a pair of integers." msgstr "" +"اگر *zoom* یا *subsample* مشخص شده باشند، تصویر مانند متدهای :meth:`zoom` " +"یا :meth:`subsample` تبدیل می‌شود. مقدار باید یک عدد صحیح یا جفتی از اعداد صحیح باشد." msgid "Added the *from_coords*, *zoom* and *subsample* parameters." -msgstr "" +msgstr "پارامترهای *from_coords*، *zoom* و *subsample* افزوده شدند." -msgid "Copy a region from *sourceImage* (which must be a :class:`PhotoImage`) into this image, possibly with pixel zooming and/or subsampling. If no options are specified, the whole of *sourceImage* is copied into this image, starting at coordinates ``(0, 0)``." +msgid "" +"Copy a region from *sourceImage* (which must be a :class:`PhotoImage`) into this " +"image, possibly with pixel zooming and/or subsampling. If no options are specified, " +"the whole of *sourceImage* is copied into this image, starting at coordinates ``(0, " +"0)``." msgstr "" +"یک ناحیه را از *sourceImage* (که باید یک :class:`PhotoImage` باشد) به این تصویر کپی " +"می‌کند، احتمالاً با بزرگ‌نمایی پیکسلی و/یا زیرنمونه‌برداری. اگر هیچ گزینه‌ای تعیین نشده " +"باشد، کل *sourceImage* به این تصویر کپی می‌شود و از مختصات ``(0, 0)`` شروع می‌شود." -msgid "*from_coords* specifies a rectangular sub-region of the source image to be copied, as in the :meth:`copy` method." +msgid "" +"*from_coords* specifies a rectangular sub-region of the source image to be copied, " +"as in the :meth:`copy` method." msgstr "" +"*from_coords* زیرناحیه‌ی مستطیلی از تصویر مبدأ را برای کپی‌شدن مشخص می‌کند، همان‌طور که " +"در متد :meth:`copy` آمده است." -msgid "*to* specifies a rectangular sub-region of the destination image to be affected. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If *x2* and *y2* are not specified, they default to ``(x1, y1)`` plus the size of the source region (after subsampling and zooming, if specified). If *x2* and *y2* are specified, the source region is replicated if necessary to fill the destination region in a tiled fashion." -msgstr "" +msgid "" +"*to* specifies a rectangular sub-region of the destination image to be affected. It " +"must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If *x2* and *y2* " +"are not specified, they default to ``(x1, y1)`` plus the size of the source region " +"(after subsampling and zooming, if specified). If *x2* and *y2* are specified, the " +"source region is replicated if necessary to fill the destination region in a tiled " +"fashion." +msgstr "" +"*to* یک زیرناحیه‌ی مستطیلی از تصویر مقصد را که تحت تأثیر قرار می‌گیرد مشخص می‌کند. این " +"مقدار باید یک تاپل یا فهرستی از ۱ تا ۴ عدد صحیح ``(x1, y1, x2, y2)`` باشد. اگر *x2* " +"و *y2* مشخص نشده باشند، مقدار پیش‌فرض آن‌ها ``(x1, y1)`` به‌اضافه‌ی اندازه‌ی ناحیه‌ی مبدأ (پس " +"از زیرنمونه‌برداری و بزرگ‌نمایی، در صورت مشخص شدن) خواهد بود. اگر *x2* و *y2* مشخص شده " +"باشند، ناحیه‌ی مبدأ در صورت نیاز تکرار می‌شود تا ناحیه‌ی مقصد را به‌صورت کاشی‌کاری‌شده پر " +"کند." -msgid "If *shrink* is true, the size of the destination image is reduced, if necessary, so that the region being copied into is at the bottom-right corner of the image." +msgid "" +"If *shrink* is true, the size of the destination image is reduced, if necessary, so " +"that the region being copied into is at the bottom-right corner of the image." msgstr "" +"اگر *shrink* درست باشد، اندازه‌ی تصویر مقصد، در صورت لزوم، کاهش می‌یابد تا ناحیه‌ای که " +"در آن کپی می‌شود، در گوشه‌ی پایین سمت راست تصویر قرار گیرد." -msgid "*compositingrule* specifies how transparent pixels in the source image are combined with the destination image. With ``'overlay'`` (the default), the old contents of the destination image remain visible, as if the source image were printed on a piece of transparent film and placed over the top of the destination. With ``'set'``, the old contents of the destination image are discarded and the source image is used as-is." -msgstr "" +msgid "" +"*compositingrule* specifies how transparent pixels in the source image are combined " +"with the destination image. With ``'overlay'`` (the default), the old contents of " +"the destination image remain visible, as if the source image were printed on a piece " +"of transparent film and placed over the top of the destination. With ``'set'``, the " +"old contents of the destination image are discarded and the source image is used as-" +"is." +msgstr "" +"*compositingrule* مشخص می‌کند که پیکسل‌های شفاف تصویر مبدأ چگونه با تصویر مقصد ترکیب " +"می‌شوند. با ``'overlay'`` (پیش‌فرض)، محتوای قدیمی تصویر مقصد قابل‌مشاهده باقی می‌ماند، " +"گویی تصویر مبدأ بر روی یک قطعه فیلم شفاف چاپ شده و بر روی تصویر مقصد قرار گرفته " +"باشد. با ``'set'``، محتوای قدیمی تصویر مقصد دور انداخته می‌شود و از تصویر مبدأ " +"همان‌طور که هست استفاده می‌شود." msgid "Return the image data." -msgstr "" +msgstr "داده‌های تصویر را برمی‌گرداند." -msgid "*format* specifies the name of the image file format handler to use. If it is not given, the data is returned as a tuple (one element per row) of strings containing space-separated (one element per pixel/column) colors in ``#RRGGBB`` format." +msgid "" +"*format* specifies the name of the image file format handler to use. If it is not " +"given, the data is returned as a tuple (one element per row) of strings containing " +"space-separated (one element per pixel/column) colors in ``#RRGGBB`` format." msgstr "" +"*format* نام هندلر قالب فایل تصویری مورد استفاده را مشخص می‌کند. اگر داده نشود، " +"داده به‌صورت یک تاپل (یک عنصر به ازای هر ردیف) از رشته‌هایی برگردانده می‌شود که حاوی " +"رنگ‌های جداشده با فاصله (یک عنصر به ازای هر پیکسل/ستون) در قالب ``#RRGGBB`` هستند." -msgid "*from_coords* specifies a rectangular region of the image to be returned. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are specified, the region extends from ``(x1, y1)`` to the bottom-right corner of the image. If all four coordinates are given, they specify diagonally opposite corners of the region, including ``(x1, y1)`` and excluding ``(x2, y2)``. If *from_coords* is not given, the whole image is returned." -msgstr "" +msgid "" +"*from_coords* specifies a rectangular region of the image to be returned. It must be " +"a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are " +"specified, the region extends from ``(x1, y1)`` to the bottom-right corner of the " +"image. If all four coordinates are given, they specify diagonally opposite corners " +"of the region, including ``(x1, y1)`` and excluding ``(x2, y2)``. If *from_coords* " +"is not given, the whole image is returned." +msgstr "" +"*from_coords* یک ناحیه‌ی مستطیلی از تصویر را که بازگردانده خواهد شد مشخص می‌کند. این " +"مقدار باید یک تاپلیا فهرستی شامل ۱ تا ۴ عدد صحیح به‌صورت ``(x1, y1, x2, " +"y2)`` باشد. اگر فقط *x1* و *y1* تعیین شده باشند، ناحیه از ``(x1, y1)`` تا گوشه‌ی " +"پایین-راست تصویر گسترش می‌یابد. اگر هر چهار مختصات داده شوند، آن‌ها گوشه‌های مورب مقابل " +"ناحیه را مشخص می‌کنند؛ ``(x1, y1)`` جزو ناحیه است و ``(x2, y2)`` جزو ناحیه نیست. اگر " +"*from_coords* داده نشود، کل تصویر بازگردانده می‌شود." -msgid "If *background* is specified, the data does not contain any transparency information; in all transparent pixels the color is replaced by the specified color." +msgid "" +"If *background* is specified, the data does not contain any transparency " +"information; in all transparent pixels the color is replaced by the specified color." msgstr "" +"اگر *background* مشخص شده باشد، داده حاوی هیچ‌گونه اطلاعات شفافیت نیست؛ در تمام " +"پیکسل‌های شفاف، رنگ با رنگ مشخص‌شده جایگزین می‌شود." -msgid "If *grayscale* is true, the data does not contain color information; all pixel data is transformed into grayscale." +msgid "" +"If *grayscale* is true, the data does not contain color information; all pixel data " +"is transformed into grayscale." msgstr "" +"اگر *grayscale* درست باشد، داده‌ها حاوی اطلاعات رنگ نیستند؛ تمام داده‌های پیکسل به " +"مقیاس خاکستری تبدیل می‌شوند." -msgid "Return the color of the pixel at coordinates (*x*, *y*) as an ``(r, g, b)`` tuple of three integers between 0 and 255, representing the red, green and blue components respectively." +msgid "" +"Return the color of the pixel at coordinates (*x*, *y*) as an ``(r, g, b)`` tuple of " +"three integers between 0 and 255, representing the red, green and blue components " +"respectively." msgstr "" +"رنگ پیکسل در مختصات (*x*, *y*) را به‌صورت یک تاپل ``(r, g, b)`` از سه عدد صحیح بین ۰ " +"و ۲۵۵ برمی‌گرداند، که به‌ترتیب نشان‌دهنده‌ی کامپوننت‌های قرمز، سبز و آبی هستند." -msgid "Set pixels of the image to the colors given in *data*, which must be a string or a nested sequence of horizontal rows of pixel colors (for example ``\"{red green} {blue yellow}\"``)." +msgid "" +"Set pixels of the image to the colors given in *data*, which must be a string or a " +"nested sequence of horizontal rows of pixel colors (for example ``\"{red green} " +"{blue yellow}\"``)." msgstr "" +"پیکسل‌های تصویر را به رنگ‌های داده‌شده در *data* تنظیم کنید، که باید یک رشته یا یک " +"دنباله تودرتو از ردیفهای افقی رنگ‌های پیکسل باشد (برای مثال ``\"{red green} {blue " +"yellow}\"``)." -msgid "*to* specifies the coordinates of the region of the image into which the data are copied. It must be a tuple or a list of 2 or 4 integers ``(x1, y1)`` or ``(x1, y1, x2, y2)`` giving the top-left corner, and optionally the bottom-right corner, of the region. The default position is ``(0, 0)``." +msgid "" +"*to* specifies the coordinates of the region of the image into which the data are " +"copied. It must be a tuple or a list of 2 or 4 integers ``(x1, y1)`` or ``(x1, y1, " +"x2, y2)`` giving the top-left corner, and optionally the bottom-right corner, of the " +"region. The default position is ``(0, 0)``." msgstr "" +"*to* مختصات ناحیه‌ای از تصویر را مشخص می‌کند که داده‌ها به آن کپی می‌شوند. این باید یک " +"تاپل یا فهرستی از ۲ یا ۴ عدد صحیح به‌صورت ``(x1, y1)`` یا ``(x1, y1, x2, y2)`` باشد " +"که گوشه‌ی بالا-چپ و به‌اختیار گوشه‌ی پایین-راست ناحیه را مشخص می‌کند. موقعیت پیش‌فرض " +"``(0, 0)`` است." msgid "Read image data from the file named *filename* into the image." -msgstr "" +msgstr "داده‌های تصویر را از فایلی با نام *filename* در تصویر بخوانید." msgid "*format* specifies the format of the image data in the file." -msgstr "" +msgstr "*format* قالب داده‌های تصویر در فایل را مشخص می‌کند." -msgid "*from_coords* specifies a rectangular sub-region of the image file data to be copied to the destination image. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are specified, the region extends from ``(x1, y1)`` to the bottom-right corner of the image in the file. If all four coordinates are given, they specify diagonally opposite corners of the region. If *from_coords* is not given, the whole of the image in the file is read." -msgstr "" +msgid "" +"*from_coords* specifies a rectangular sub-region of the image file data to be copied " +"to the destination image. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, " +"x2, y2)``. If only *x1* and *y1* are specified, the region extends from ``(x1, y1)`` " +"to the bottom-right corner of the image in the file. If all four coordinates are " +"given, they specify diagonally opposite corners of the region. If *from_coords* is " +"not given, the whole of the image in the file is read." +msgstr "" +"*from_coords* زیرناحیه‌ای مستطیلی از داده‌های فایل تصویر را مشخص می‌کند که باید به " +"تصویر مقصد کپی شود. این باید یک تاپل یا فهرستی از ۱ تا ۴ عدد صحیح به‌صورت ``(x1, y1, " +"x2, y2)`` باشد. اگر فقط *x1* و *y1* مشخص شوند، ناحیه از ``(x1, y1)`` تا گوشه پایین " +"سمت راست تصویر موجود در فایل ادامه دارد. اگر هر ۴ مختصات داده شوند، آن‌ها گوشه‌های " +"مقابل مورب ناحیه را مشخص می‌کنند. اگر *from_coords* داده نشود، کل تصویر موجود در فایل " +"خوانده می‌شود." -msgid "*to* specifies the coordinates of the top-left corner of the region of the image into which the data are read. The default is ``(0, 0)``." +msgid "" +"*to* specifies the coordinates of the top-left corner of the region of the image " +"into which the data are read. The default is ``(0, 0)``." msgstr "" +"*to* مختصات گوشه‌ی بالا سمت چپِ ناحیه‌ای از تصویر را مشخص می‌کند که داده‌ها در آن خوانده " +"می‌شوند. مقدار پیش‌فرض ``(0, 0)`` است." -msgid "If *shrink* is true, the size of the image is reduced, if necessary, so that the region into which the file data are read is at the bottom-right corner of the image." +msgid "" +"If *shrink* is true, the size of the image is reduced, if necessary, so that the " +"region into which the file data are read is at the bottom-right corner of the image." msgstr "" +"اگر *shrink* برابر با true باشد، اندازه تصویر در صورت لزوم کاهش می‌یابد، به‌طوری که " +"ناحیه‌ای که داده‌های فایل در آن خوانده می‌شوند، در گوشه‌ی پایین سمت راست تصویر قرار گیرد." -msgid "Return a new :class:`PhotoImage` based on this image but using only every *x*-th pixel in the X direction and every *y*-th pixel in the Y direction. If *y* is not given, it defaults to the same value as *x*." +msgid "" +"Return a new :class:`PhotoImage` based on this image but using only every *x*-th " +"pixel in the X direction and every *y*-th pixel in the Y direction. If *y* is not " +"given, it defaults to the same value as *x*." msgstr "" +"یک :class:`PhotoImage` جدید بر پایه این تصویر برمی‌گرداند، اما فقط از هر *x*مین پیکسل " +"در راستای X و هر *y*مین پیکسل در راستای Y استفاده می‌کند. اگر *y* داده نشود، مقدار " +"پیش‌فرض آن همان مقدار *x* خواهد بود." msgid "Added the *from_coords* parameter." -msgstr "" +msgstr "پارامتر *from_coords* اضافه شد." -msgid "Return ``True`` if the pixel at coordinates (*x*, *y*) is fully transparent, ``False`` otherwise." +msgid "" +"Return ``True`` if the pixel at coordinates (*x*, *y*) is fully transparent, " +"``False`` otherwise." msgstr "" +"اگر پیکسل در مختصات (*x*، *y*) کاملاً شفاف باشد، ``True`` و در غیر این صورت ``False`` " +"را برمی‌گرداند." -msgid "Make the pixel at coordinates (*x*, *y*) fully transparent if *boolean* is true, fully opaque otherwise." +msgid "" +"Make the pixel at coordinates (*x*, *y*) fully transparent if *boolean* is true, " +"fully opaque otherwise." msgstr "" +"پیکسل در مختصات (*x*، *y*) را اگر *boolean* درست باشد، کاملاً شفاف و در غیر این صورت " +"کاملاً کدر کنید." msgid "Write image data from the image to the file named *filename*." -msgstr "" +msgstr "داده‌های تصویر را از تصویر به فایلی با نام *filename* می‌نویسد." -msgid "*format* specifies the name of the image file format handler to use. If it is not given, the format is guessed from the file extension." +msgid "" +"*format* specifies the name of the image file format handler to use. If it is not " +"given, the format is guessed from the file extension." msgstr "" +"*format* نام هندلری قالب فایل تصویری مورد استفاده را مشخص می‌کند. اگر داده نشود، " +"قالب از پسوند فایل حدس زده می‌شود." -msgid "*from_coords* specifies a rectangular region of the image to be written. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are specified, the region extends from ``(x1, y1)`` to the bottom-right corner of the image. If all four coordinates are given, they specify diagonally opposite corners of the region. If *from_coords* is not given, the whole image is written." -msgstr "" +msgid "" +"*from_coords* specifies a rectangular region of the image to be written. It must be " +"a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are " +"specified, the region extends from ``(x1, y1)`` to the bottom-right corner of the " +"image. If all four coordinates are given, they specify diagonally opposite corners " +"of the region. If *from_coords* is not given, the whole image is written." +msgstr "" +"*from_coords* ناحیه‌ی مستطیلی از تصویر را برای نوشته شدن مشخص می‌کند. این مقدار باید یک " +"تاپل یا فهرستی از ۱ تا ۴ عدد صحیح ``(x1, y1, x2, y2)`` باشد. اگر فقط *x1* و *y1* " +"مشخص شده باشند، ناحیه از ``(x1, y1)`` تا گوشه‌ی پایین سمت راست تصویر گسترش می‌یابد. اگر " +"هر چهار مختصات داده شوند، آن‌ها دو گوشه‌ی مقابل به‌صورت موربِ ناحیه را مشخص می‌کنند. اگر " +"*from_coords* داده نشود، کل تصویر نوشته می‌شود." msgid "Added the *background* and *grayscale* parameters." -msgstr "" +msgstr "پارامترهای *background* و *grayscale* افزوده شدند." -msgid "Return a new :class:`PhotoImage` with this image magnified by a factor of *x* in the X direction and *y* in the Y direction. If *y* is not given, it defaults to the same value as *x*." +msgid "" +"Return a new :class:`PhotoImage` with this image magnified by a factor of *x* in the " +"X direction and *y* in the Y direction. If *y* is not given, it defaults to the same " +"value as *x*." msgstr "" +"یک :class:`PhotoImage` جدید برمی‌گرداند که در آن این تصویر با ضریب *x* در جهت X و " +"ضریب *y* در جهت Y بزرگ‌نمایی شده است. اگر *y* داده نشود، به‌طور پیش‌فرض همان مقدار *x* " +"را خواهد داشت." -msgid "A two-color image (the Tk ``bitmap`` image type) created from an X11 bitmap. Each pixel displays a foreground color, a background color, or nothing (producing a transparent effect). Inherits from :class:`Image`." +msgid "" +"A two-color image (the Tk ``bitmap`` image type) created from an X11 bitmap. Each " +"pixel displays a foreground color, a background color, or nothing (producing a " +"transparent effect). Inherits from :class:`Image`." msgstr "" +"یک تصویر دورنگ (نوع تصویر ``bitmap`` در Tk) که از یک بیت‌مپ X11 ایجاد شده است. هر " +"پیکسل رنگ پیش‌زمینه، رنگ پس‌زمینه، یا هیچ‌چیز را نمایش می‌دهد (که اثری شفاف ایجاد " +"می‌کند). از :class:`Image` ارث می‌برد." -msgid "The configuration options are *data* or *file* (the source bitmap, given as a string in X11 bitmap format or as the name of a file in that format), *maskdata* or *maskfile* (the mask bitmap, in the same forms), and *foreground* and *background* (the two colors). For pixels where the mask is zero the image displays nothing; for other pixels it displays the foreground color where the source is one and the background color where the source is zero. If *background* is set to an empty string, the background pixels are transparent." -msgstr "" +msgid "" +"The configuration options are *data* or *file* (the source bitmap, given as a string " +"in X11 bitmap format or as the name of a file in that format), *maskdata* or " +"*maskfile* (the mask bitmap, in the same forms), and *foreground* and *background* " +"(the two colors). For pixels where the mask is zero the image displays nothing; for " +"other pixels it displays the foreground color where the source is one and the " +"background color where the source is zero. If *background* is set to an empty " +"string, the background pixels are transparent." +msgstr "" +"گزینه‌های پیکربندی عبارت‌اند از *data* یا *file* (بیت‌مپ منبع، که به‌صورت یک رشته در " +"قالب بیت‌مپ X11 یا به‌صورت نام یک فایل در همان قالب داده می‌شود)، *maskdata* یا " +"*maskfile* (بیت‌مپ ماسک، به همان شکل‌ها)، و *foreground* و *background* (دو رنگ). برای " +"پیکسل‌هایی که ماسک آن‌ها صفر است، تصویر هیچ چیزی را نمایش نمی‌دهد؛ برای سایر پیکسل‌ها، " +"در نقاطی که منبع یک است رنگ پیش‌زمینه و در نقاطی که منبع صفر است رنگ پس‌زمینه را نمایش " +"می‌دهد. اگر *background* به یک رشته خالی تنظیم شود، پیکسل‌های پس‌زمینه شفاف خواهند بود." -msgid ":class:`!BitmapImage` has no methods of its own beyond those inherited from :class:`Image`." +msgid "" +":class:`!BitmapImage` has no methods of its own beyond those inherited " +"from :class:`Image`." msgstr "" +":class:`!BitmapImage` هیچ متدی از خود ندارد، به‌جز متدهایی که از :class:`Image` به " +"ارث برده است." msgid "Other classes" -msgstr "" +msgstr "کلاس‌های دیگر" -msgid "A container for the attributes of an event passed to a callback bound with :meth:`Misc.bind`. An :class:`!Event` instance has the following attributes, each corresponding to a field of the underlying Tk event; depending on the event type, some attributes may be set to the string ``'??'`` to indicate that they are not meaningful. See :ref:`bindings-and-events`." -msgstr "" +msgid "" +"A container for the attributes of an event passed to a callback bound " +"with :meth:`Misc.bind`. An :class:`!Event` instance has the following attributes, " +"each corresponding to a field of the underlying Tk event; depending on the event " +"type, some attributes may be set to the string ``'??'`` to indicate that they are " +"not meaningful. See :ref:`bindings-and-events`." +msgstr "" +"ظرفی برای ویژگی‌های رویدادی که به کال‌بک متصل‌شده با :meth:`Misc.bind` ارسال می‌شود. یک " +"نمونه از :class:`!Event` دارای ویژگی‌های زیر است که هر کدام با یکی از فیلدهای رویداد " +"Tk زیربنایی متناظر است؛ بسته به نوع رویداد، ممکن است برخی از ویژگی‌ها روی رشته " +"``'??'`` تنظیم شوند تا نشان داده شود که معنادار نیستند. :ref:`bindings-and-events` " +"را ببینید." msgid "The serial number of the event." -msgstr "" +msgstr "شماره سریال رویداد." msgid "The mouse button that was pressed or released (for button events)." -msgstr "" +msgstr "دکمه‌ی ماوسی که فشرده یا رها شده است (برای رویدادهای دکمه)." msgid "Whether the window has the focus (for ``Enter`` and ``Leave`` events)." -msgstr "" +msgstr "اینکه آیا پنجره فوکوس را دارد یا خیر (برای رویدادهای ``Enter`` و ``Leave``)." -msgid "The new height and width of the window (for ``Configure`` and ``Expose`` events)." -msgstr "" +msgid "" +"The new height and width of the window (for ``Configure`` and ``Expose`` events)." +msgstr "ارتفاع و عرض جدید پنجره (برای رویدادهای ``Configure`` و ``Expose``)." msgid "The keycode of the key that was pressed or released." -msgstr "" +msgstr "کد کلید (keycode) برای کلیدی که فشرده یا رها شده است." -msgid "The state of the event, as a number (for most events) or a string (for ``Visibility`` events)." +msgid "" +"The state of the event, as a number (for most events) or a string (for " +"``Visibility`` events)." msgstr "" +"وضعیت رویداد، به‌صورت یک عدد (برای بیشتر رویدادها) یا یک رشته (برای رویدادهای " +"``Visibility``)." msgid "The timestamp of the event, in milliseconds." -msgstr "" +msgstr "برچسب زمانی رویداد، بر حسب میلی‌ثانیه." msgid "The pointer position relative to the widget, in pixels." -msgstr "" +msgstr "موقعیت اشاره‌گر نسبت به ابزارک (widget)، بر حسب پیکسل." msgid "The pointer position relative to the top-left corner of the screen, in pixels." -msgstr "" +msgstr "موقعیت اشاره‌گر نسبت به گوشه‌ی بالا-چپ صفحه‌نمایش، بر حسب پیکسل." msgid "The character typed, as a string (for key events)." -msgstr "" +msgstr "نویسه‌ی تایپ‌شده، به‌صورت یک رشته (برای رویدادهای کلید)." msgid "``True`` if the event was sent by another application." -msgstr "" +msgstr "``True`` اگر رویداد از سوی برنامه‌ی دیگری ارسال شده باشد." msgid "The symbolic name of the key that was pressed or released." -msgstr "" +msgstr "نام نمادین کلیدی که فشرده یا رها شده است." msgid "The numeric value of :attr:`keysym`." -msgstr "" +msgstr "مقدار عددی :attr:`keysym`." msgid "The :class:`EventType` of the event." -msgstr "" +msgstr ":class:`EventType` رویداد." msgid "The widget on which the event occurred." -msgstr "" +msgstr "ابزارکی که رویداد بر آن رخ داده است." msgid "The amount the mouse wheel was rotated (for ``MouseWheel`` events)." -msgstr "" +msgstr "میزان چرخش چرخ ماوس (برای رویدادهای ``MouseWheel``)." -msgid "An :class:`enum.StrEnum` enumerating the Tk event types, used as the value of :attr:`Event.type`. Its members include, among others, ``KeyPress``, ``KeyRelease``, ``ButtonPress``, ``ButtonRelease``, ``Motion``, ``Enter``, ``Leave``, ``FocusIn``, ``FocusOut``, ``Configure``, ``Map``, ``Unmap``, ``Expose``, ``Destroy`` and ``MouseWheel``." -msgstr "" +msgid "" +"An :class:`enum.StrEnum` enumerating the Tk event types, used as the value " +"of :attr:`Event.type`. Its members include, among others, ``KeyPress``, " +"``KeyRelease``, ``ButtonPress``, ``ButtonRelease``, ``Motion``, ``Enter``, " +"``Leave``, ``FocusIn``, ``FocusOut``, ``Configure``, ``Map``, ``Unmap``, ``Expose``, " +"``Destroy`` and ``MouseWheel``." +msgstr "" +"یک :class:`enum.StrEnum` که انواع رویداد Tk را برمی‌شمارد و به‌عنوان " +"مقدار :attr:`Event.type` استفاده می‌شود. اعضای آن، از میان سایر موارد، شامل " +"``KeyPress``، ``KeyRelease``، ``ButtonPress``، ``ButtonRelease``، ``Motion``، " +"``Enter``، ``Leave``، ``FocusIn``، ``FocusOut``، ``Configure``، ``Map``، ``Unmap``، " +"``Expose``، ``Destroy`` و ``MouseWheel`` هستند." -msgid "Internal helper that wraps a Python callback so that it can be invoked from Tcl. *func* is the Python function, *subst* is an optional function that pre-processes the Tcl arguments, and *widget* is the widget used for error reporting. Instances are created automatically by :meth:`Misc.register`; this class is not normally used directly." -msgstr "" +msgid "" +"Internal helper that wraps a Python callback so that it can be invoked from Tcl. " +"*func* is the Python function, *subst* is an optional function that pre-processes " +"the Tcl arguments, and *widget* is the widget used for error reporting. Instances " +"are created automatically by :meth:`Misc.register`; this class is not normally used " +"directly." +msgstr "" +"کمکی داخلی که یک کال‌بک پایتون را می‌پوشاند تا بتوان آن را از Tcl فراخوانی کرد. *func* " +"تابع پایتون است، *subst* یک تابع اختیاری است که آرگومان‌های Tcl را پیش‌پردازش می‌کند، و " +"*widget* ابزارکی است که برای گزارش خطا استفاده می‌شود. نمونه‌ها به‌صورت خودکار " +"توسط :meth:`Misc.register` ایجاد می‌شوند؛ این کلاس معمولاً به‌صورت مستقیم استفاده " +"نمی‌شود." msgid "Module-level functions" -msgstr "" +msgstr "توابع سطح ماژول" -msgid "The :func:`Tcl` function is a factory function which creates an object much like that created by the :class:`Tk` class, except that it does not initialize the Tk subsystem. This is most often useful when driving the Tcl interpreter in an environment where one doesn't want to create extraneous toplevel windows, or where one cannot (such as Unix/Linux systems without an X server). An object created by the :func:`Tcl` object can have a Toplevel window created (and the Tk subsystem initialized) by calling its :meth:`~Tk.loadtk` method." -msgstr "" +msgid "" +"The :func:`Tcl` function is a factory function which creates an object much like " +"that created by the :class:`Tk` class, except that it does not initialize the Tk " +"subsystem. This is most often useful when driving the Tcl interpreter in an " +"environment where one doesn't want to create extraneous toplevel windows, or where " +"one cannot (such as Unix/Linux systems without an X server). An object created by " +"the :func:`Tcl` object can have a Toplevel window created (and the Tk subsystem " +"initialized) by calling its :meth:`~Tk.loadtk` method." +msgstr "" +"تابع :func:`Tcl` یک تابع کارخانه‌ای است که شیءای بسیار شبیه به شیء ایجادشده توسط " +"کلاس :class:`Tk` را ایجاد می‌کند، با این تفاوت که زیرسیستم Tk را راه‌اندازی نمی‌کند. " +"این تابع بیشتر زمانی مفید است که مفسر Tcl را در محیطی هدایت می‌کنید که نمی‌خواهید " +"پنجره‌های Toplevel اضافی ایجاد کنید، یا نمی‌توانید این کار را انجام دهید (مانند " +"سیستم‌های Unix/Linux بدون سرور X). برای شیء ایجادشده توسط شیء :func:`Tcl`، می‌توان با " +"فراخوانی متد :meth:`~Tk.loadtk` آن، یک پنجره‌ی Toplevel ایجاد کرد (و زیرسیستم Tk را " +"راه‌اندازی کرد)." -msgid "Inhibit the creation of an implicit default root window. Afterwards :mod:`!tkinter` no longer creates a shared default root automatically, and operations that rely on one --- such as constructing a widget without an explicit *master* --- raise a :exc:`RuntimeError`. Call this early in larger applications to make the root window explicit." -msgstr "" +msgid "" +"Inhibit the creation of an implicit default root window. Afterwards :mod:`!tkinter` " +"no longer creates a shared default root automatically, and operations that rely on " +"one --- such as constructing a widget without an explicit *master* --- raise " +"a :exc:`RuntimeError`. Call this early in larger applications to make the root " +"window explicit." +msgstr "" +"از ایجاد یک پنجره‌ی ریشه‌ی پیش‌فرض ضمنی جلوگیری می‌کند. پس از آن :mod:`!tkinter` دیگر " +"به‌طور خودکار یک ریشه‌ی پیش‌فرض مشترک ایجاد نمی‌کند، و عملیاتی که به آن وابسته‌اند --- " +"مانند ساخت یک ابزارک بدون *master* صریح --- استثنای :exc:`RuntimeError` را پرتاب " +"می‌کنند. در برنامه‌های بزرگ‌تر، این را در مراحل اولیه فراخوانی کنید تا پنجره‌ی ریشه " +"به‌صورت صریح تعیین شود." -msgid "Run the Tk main event loop on the default root window until all windows are destroyed. Equivalent to calling :meth:`Misc.mainloop` on the default root." +msgid "" +"Run the Tk main event loop on the default root window until all windows are " +"destroyed. Equivalent to calling :meth:`Misc.mainloop` on the default root." msgstr "" +"حلقه اصلی رویداد Tk را روی پنجره ریشه پیش‌فرض اجرا کنید تا همه پنجره‌ها نابود شوند. " +"معادل فراخوانی :meth:`Misc.mainloop` روی ریشه پیش‌فرض است." -msgid "Convert the Tcl boolean string *s* (one of ``'1'``, ``'true'``, ``'yes'``, ``'on'`` and similar, or their false counterparts) to a Python :class:`bool`. Raise :exc:`TclError` for an invalid value." +msgid "" +"Convert the Tcl boolean string *s* (one of ``'1'``, ``'true'``, ``'yes'``, ``'on'`` " +"and similar, or their false counterparts) to a Python :class:`bool`. " +"Raise :exc:`TclError` for an invalid value." msgstr "" +"رشته‌ی بولی Tcl *s* (یکی از ``'1'``، ``'true'``، ``'yes'``، ``'on'`` و مشابه آن‌ها، یا " +"معادل‌های نادرست آن‌ها) را به :class:`bool` پایتون تبدیل می‌کند. برای یک مقدار " +"نامعتبر، :exc:`TclError` را پرتاب می‌کند." msgid "Convert *s* to a floating-point number. This is the built-in :class:`float`." -msgstr "" +msgstr "*s* را به یک عدد ممیز شناور تبدیل می‌کند. این همان :class:`float` توکار است." msgid "Convert *s* to an integer. This is the built-in :class:`int`." -msgstr "" +msgstr "*s* را به یک عدد صحیح تبدیل می‌کند. این، :class:`int` توکار است." msgid "Return the names of all existing images in the default root's interpreter." -msgstr "" +msgstr "نام‌های تمام تصاویر موجود در مفسر ریشه‌ی پیش‌فرض را برمی‌گرداند." -msgid "Return the available image types (such as ``'photo'`` and ``'bitmap'``) in the default root's interpreter." +msgid "" +"Return the available image types (such as ``'photo'`` and ``'bitmap'``) in the " +"default root's interpreter." msgstr "" +"انواع تصویر در دسترس (مانند ``'photo'`` و ``'bitmap'``) را در مفسر ریشه‌ی پیش‌فرض " +"برمی‌گرداند." msgid "File handlers" -msgstr "" +msgstr "هندلرهای فایل" -msgid "Tk allows you to register and unregister a callback function which will be called from the Tk mainloop when I/O is possible on a file descriptor. Only one handler may be registered per file descriptor. Example code::" +msgid "" +"Tk allows you to register and unregister a callback function which will be called " +"from the Tk mainloop when I/O is possible on a file descriptor. Only one handler may " +"be registered per file descriptor. Example code::" msgstr "" +"Tk به شما امکان می‌دهد یک تابع کال‌بک را ثبت و لغو ثبت کنید؛ این تابع هنگامی که ورودی/" +"خروجی روی یک توصیف‌گر فایل امکان‌پذیر باشد، از mainloop Tk فراخوانی می‌شود. برای هر " +"توصیف‌گر فایل فقط می‌توان یک هندلر (handler) ثبت کرد. نمونه کد::" msgid "" "import tkinter\n" @@ -3712,108 +8718,194 @@ msgid "" "...\n" "widget.tk.deletefilehandler(file)" msgstr "" +"import tkinter\n" +"widget = tkinter.Tk()\n" +"mask = tkinter.READABLE | tkinter.WRITABLE\n" +"widget.tk.createfilehandler(file, mask, callback)\n" +"...\n" +"widget.tk.deletefilehandler(file)" msgid "This feature is not available on Windows." -msgstr "" +msgstr "این قابلیت در ویندوز در دسترس نیست." -msgid "Since you don't know how many bytes are available for reading, you may not want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:`~io.BufferedIOBase.read` or :meth:`~io.IOBase.readline` methods, since these will insist on reading a predefined number of bytes. For sockets, the :meth:`~socket.socket.recv` or :meth:`~socket.socket.recvfrom` methods will work fine; for other files, use raw reads or ``os.read(file.fileno(), maxbytecount)``." -msgstr "" +msgid "" +"Since you don't know how many bytes are available for reading, you may not want to " +"use the :class:`~io.BufferedIOBase` " +"or :class:`~io.TextIOBase` :meth:`~io.BufferedIOBase.read` " +"or :meth:`~io.IOBase.readline` methods, since these will insist on reading a " +"predefined number of bytes. For sockets, the :meth:`~socket.socket.recv` " +"or :meth:`~socket.socket.recvfrom` methods will work fine; for other files, use raw " +"reads or ``os.read(file.fileno(), maxbytecount)``." +msgstr "" +"از آن‌جا که نمی‌دانید چند بایت برای خواندن در دسترس است، ممکن است نخواهید از " +"متدهای :meth:`~io.BufferedIOBase.read` یا :meth:`~io.IOBase.readline` در " +"کلاس‌های :class:`~io.BufferedIOBase` یا :class:`~io.TextIOBase` استفاده کنید، زیرا " +"این متدها بر خواندن تعداد از پیش تعیین‌شده‌ای از بایت‌ها اصرار دارند. برای سوکت‌ها، " +"متدهای :meth:`~socket.socket.recv` یا :meth:`~socket.socket.recvfrom` به‌خوبی کار " +"می‌کنند؛ برای سایر فایل‌ها، از خواندن‌های خام یا ``os.read(file.fileno(), " +"maxbytecount)`` استفاده کنید." -msgid "Registers the file handler callback function *func*. The *file* argument may either be an object with a :meth:`~io.IOBase.fileno` method (such as a file or socket object), or an integer file descriptor. The *mask* argument is an ORed combination of any of the three constants below. The callback is called as follows::" +msgid "" +"Registers the file handler callback function *func*. The *file* argument may either " +"be an object with a :meth:`~io.IOBase.fileno` method (such as a file or socket " +"object), or an integer file descriptor. The *mask* argument is an ORed combination " +"of any of the three constants below. The callback is called as follows::" msgstr "" +"تابع کال‌بک مدیریت فایل *func* را ثبت می‌کند. آرگومان *file* می‌تواند یا یک شیء دارای " +"متد :meth:`~io.IOBase.fileno` (مانند یک شیء فایل یا سوکت) باشد، یا یک توصیف‌گر فایل " +"از نوع عدد صحیح. آرگومان *mask* ترکیبی از هر یک از سه ثابت زیر با عملگر OR است. " +"کال‌بک به صورت زیر فراخوانی می‌شود::" msgid "callback(file, mask)" -msgstr "" +msgstr "callback(file, mask)" msgid "Unregisters a file handler." -msgstr "" +msgstr "یک هندلر فایل (file handler) را از ثبت خارج می‌کند." msgid "Constants used in the *mask* arguments." -msgstr "" +msgstr "ثابت‌های به‌کاررفته در آرگومان‌های *mask*." msgid "Constants" -msgstr "" +msgstr "ثوابت" -msgid "The following symbolic constants are available in both the :mod:`!tkinter` and :mod:`!tkinter.constants` namespaces." +msgid "" +"The following symbolic constants are available in both the :mod:`!tkinter` " +"and :mod:`!tkinter.constants` namespaces." msgstr "" +"ثابت‌های نمادین زیر در هر دو فضای نام :mod:`!tkinter` و :mod:`!tkinter.constants` در " +"دسترس هستند." msgid "Truthy values, all equal to the integer ``1``." -msgstr "" +msgstr "مقادیر درست (Truthy)، همگی برابر با عدد صحیح ``1``." msgid "Falsy values, all equal to the integer ``0``." -msgstr "" +msgstr "مقادیر دروغین (falsy)، همگی برابر با عدد صحیح ``0`` هستند." -msgid "Compass directions (``'n'``, ``'s'``, ``'e'``, ``'w'`` and the diagonals and edges) plus ``CENTER`` (``'center'``), used as values for the *anchor* and *sticky* options and by methods such as :meth:`Misc.grid_anchor`." +msgid "" +"Compass directions (``'n'``, ``'s'``, ``'e'``, ``'w'`` and the diagonals and edges) " +"plus ``CENTER`` (``'center'``), used as values for the *anchor* and *sticky* options " +"and by methods such as :meth:`Misc.grid_anchor`." msgstr "" +"جهت‌های قطب‌نما (``'n'``، ``'s'``، ``'e'``، ``'w'`` و قطرها و لبه‌ها) به‌همراه " +"``CENTER`` (``'center'``)، که به‌عنوان مقدارهایی برای گزینه‌های *anchor* و *sticky* و " +"همچنین توسط متدهایی مانند :meth:`Misc.grid_anchor` استفاده می‌شوند." msgid "Sides for the *side* option of the packer (see :meth:`Pack.pack_configure`)." msgstr "" +"طرف‌های گزینه‌ی *side* برای بسته‌بند (packer) (به :meth:`Pack.pack_configure` مراجعه " +"کنید)." -msgid "Values for the *fill* option of the packer: ``'x'``, ``'y'``, ``'both'`` or ``'none'``." +msgid "" +"Values for the *fill* option of the packer: ``'x'``, ``'y'``, ``'both'`` or " +"``'none'``." msgstr "" +"مقادیر گزینه‌ی *fill* در بسته‌بند (packer): ``'x'``، ``'y'``، ``'both'`` یا ``'none'``." msgid "Values for the *relief* option, which controls a widget's 3-D border." -msgstr "" +msgstr "مقادیر گزینه‌ی *relief*، که حاشیه‌ی سه‌بعدی یک ابزارک را کنترل می‌کند." -msgid "Values for the *orient* option of widgets such as :class:`Scale`, :class:`Scrollbar` and :class:`PanedWindow`." +msgid "" +"Values for the *orient* option of widgets such as :class:`Scale`, :class:`Scrollbar` " +"and :class:`PanedWindow`." msgstr "" +"مقادیر برای گزینه‌ی *orient* در ابزارک‌هایی مانند :class:`Scale`، :class:`Scrollbar` " +"و :class:`PanedWindow`." -msgid "Values for the *wrap* option of the :class:`Text` widget, selecting line wrapping on character or word boundaries." +msgid "" +"Values for the *wrap* option of the :class:`Text` widget, selecting line wrapping on " +"character or word boundaries." msgstr "" +"مقادیر گزینه‌ی *wrap* در ابزارک :class:`Text`، برای انتخاب پیچیدن خط بر روی مرزهای " +"نویسه یا واژه." msgid "The text-alignment value ``'baseline'``." -msgstr "" +msgstr "مقدار هم‌ترازی متن ``'baseline'``." -msgid "Values for the *bordermode* option of the placer (see :meth:`Place.place_configure`)." +msgid "" +"Values for the *bordermode* option of the placer (see :meth:`Place.place_configure`)." msgstr "" +"مقادیر برای گزینه‌ی *bordermode* در جای‌دهنده (به :meth:`Place.place_configure` مراجعه " +"کنید)." -msgid "Symbolic indices used by the :class:`Text`, :class:`Entry`, :class:`Listbox` and :class:`Canvas` widgets, such as ``'insert'`` (the insertion cursor), ``'current'``, ``'end'``, ``'anchor'`` and the bounds of the selection (``'sel.first'`` and ``'sel.last'``)." +msgid "" +"Symbolic indices used by the :class:`Text`, :class:`Entry`, :class:`Listbox` " +"and :class:`Canvas` widgets, such as ``'insert'`` (the insertion cursor), " +"``'current'``, ``'end'``, ``'anchor'`` and the bounds of the selection " +"(``'sel.first'`` and ``'sel.last'``)." msgstr "" +"اندیس‌های نمادین مورد استفاده در " +"ابزارک‌های :class:`Text`، :class:`Entry`، :class:`Listbox` و :class:`Canvas`، مانند " +"``'insert'`` (مکان‌نمای درج)، ``'current'``، ``'end'``، ``'anchor'`` و کرانه‌های " +"انتخاب (``'sel.first'`` و ``'sel.last'``)." -msgid "The special tag ``'all'``, which matches every item of a :class:`Canvas` or every character of a :class:`Text` (for example ``canvas.delete(ALL)``)." +msgid "" +"The special tag ``'all'``, which matches every item of a :class:`Canvas` or every " +"character of a :class:`Text` (for example ``canvas.delete(ALL)``)." msgstr "" +"برچسب ویژه ``'all'``، که با هر آیتم از یک :class:`Canvas` یا هر نویسه از " +"یک :class:`Text` مطابقت دارد (برای مثال ``canvas.delete(ALL)``)." msgid "Values for the *state* option of various widgets and items." -msgstr "" +msgstr "مقادیر گزینه‌ی *state* برای ویدجت‌ها و آیتم‌های مختلف." -msgid "Menu entry types, used as the *itemType* argument of :meth:`Menu.add` and :meth:`Menu.insert`." +msgid "" +"Menu entry types, used as the *itemType* argument of :meth:`Menu.add` " +"and :meth:`Menu.insert`." msgstr "" +"انواع آیتم‌های منو، که به‌عنوان آرگومان *itemType* در :meth:`Menu.add` " +"و :meth:`Menu.insert` استفاده می‌شوند." msgid "Values for the *selectmode* option of the :class:`Listbox` widget." -msgstr "" +msgstr "مقدارهای گزینه‌ی *selectmode* برای ابزارک :class:`Listbox`." msgid "Values for the *style* option of :class:`Canvas` arc items." -msgstr "" +msgstr "مقادیر گزینه‌ی *style* برای آیتم‌های کمانِ :class:`Canvas`." -msgid "Values for the *capstyle* (``'butt'``, ``'projecting'``, ``'round'``) and *joinstyle* (``'round'``, ``'bevel'``, ``'miter'``) options of :class:`Canvas` line items." +msgid "" +"Values for the *capstyle* (``'butt'``, ``'projecting'``, ``'round'``) and " +"*joinstyle* (``'round'``, ``'bevel'``, ``'miter'``) options of :class:`Canvas` line " +"items." msgstr "" +"مقادیر گزینه‌های *capstyle* (``'butt'``، ``'projecting'``، ``'round'``) و *joinstyle* " +"(``'round'``، ``'bevel'``، ``'miter'``) برای آیتم‌های خط در :class:`Canvas`." -msgid "Values for the *arrow* option of :class:`Canvas` line items, indicating which ends have arrowheads." +msgid "" +"Values for the *arrow* option of :class:`Canvas` line items, indicating which ends " +"have arrowheads." msgstr "" +"مقادیر گزینه‌ی *arrow* برای آیتم‌های خط :class:`Canvas`، که نشان می‌دهد کدام انتهاها " +"سرپیکان دارند." -msgid "The first argument passed by a :class:`Scrollbar` to the :meth:`XView.xview` or :meth:`YView.yview` method of the scrolled widget." +msgid "" +"The first argument passed by a :class:`Scrollbar` to the :meth:`XView.xview` " +"or :meth:`YView.yview` method of the scrolled widget." msgstr "" +"اولین آرگومانی که یک :class:`Scrollbar` به متد :meth:`XView.xview` " +"یا :meth:`YView.yview` مربوط به ابزارک پیمایش‌شده می‌فرستد." -msgid "Values for the *what* argument of :meth:`XView.xview_scroll` and :meth:`YView.yview_scroll`." +msgid "" +"Values for the *what* argument of :meth:`XView.xview_scroll` " +"and :meth:`YView.yview_scroll`." msgstr "" +"مقادیر آرگومان *what* برای :meth:`XView.xview_scroll` و :meth:`YView.yview_scroll`." msgid "Other option values: ``'underline'``, ``'numeric'`` and ``'dotbox'``." -msgstr "" +msgstr "سایر مقادیر گزینه: ``'underline'``، ``'numeric'`` و ``'dotbox'``." msgid "geometry management (widgets)" -msgstr "" +msgstr "مدیریت هندسی (widgets)" msgid "packing (widgets)" -msgstr "" +msgstr "بسته‌بندی (ابزارک‌ها)" msgid "window manager (widgets)" -msgstr "" +msgstr "مدیر پنجره (ابزارک‌ها)" msgid "Tk Option Data Types" -msgstr "" +msgstr "انواع داده‌ی گزینه‌های Tk" msgid "bind (widgets)" -msgstr "" +msgstr "اتصال (ابزارک‌ها)" msgid "events (widgets)" -msgstr "" +msgstr "رویدادها (ابزارک‌ها)" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index 0e63983b6..f07e34314 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -22,22 +22,44 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid ":mod:`!tkinter.scrolledtext` --- Scrolled text widget" -msgstr "" +msgstr ":mod:`!tkinter.scrolledtext` --- ابزارک متن پیمایش‌شده" msgid "**Source code:** :source:`Lib/tkinter/scrolledtext.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/scrolledtext.py`" -msgid "The :mod:`!tkinter.scrolledtext` module provides a class of the same name which implements a basic text widget which has a vertical scroll bar configured to do the \"right thing.\" Using the :class:`ScrolledText` class is a lot easier than setting up a text widget and scroll bar directly." +msgid "" +"The :mod:`!tkinter.scrolledtext` module provides a class of the same name " +"which implements a basic text widget which has a vertical scroll bar " +"configured to do the \"right thing.\" Using the :class:`ScrolledText` class" +" is a lot easier than setting up a text widget and scroll bar directly." msgstr "" +"ماژول :mod:`!tkinter.scrolledtext` کلاسی با همان نام فراهم می‌کند که یک " +"ابزارک متنی پایه را پیاده‌سازی می‌کند؛ این ابزارک دارای یک نوار پیمایش عمودی" +" است که برای انجام «کار درست» پیکربندی شده است. استفاده از کلاس " +":class:`ScrolledText` بسیار آسان‌تر از راه‌اندازی مستقیم یک ابزارک متنی و " +"نوار پیمایش است." -msgid "The text widget and scrollbar are packed together in a :class:`~tkinter.Frame`, and the methods of the :class:`~tkinter.Pack`, :class:`~tkinter.Grid` and :class:`~tkinter.Place` geometry managers are acquired from the :class:`~tkinter.Frame` object. This allows the :class:`ScrolledText` widget to be used directly to achieve most normal geometry management behavior." +msgid "" +"The text widget and scrollbar are packed together in a " +":class:`~tkinter.Frame`, and the methods of the :class:`~tkinter.Pack`, " +":class:`~tkinter.Grid` and :class:`~tkinter.Place` geometry managers are " +"acquired from the :class:`~tkinter.Frame` object. This allows the " +":class:`ScrolledText` widget to be used directly to achieve most normal " +"geometry management behavior." msgstr "" +"ابزارک متنی و نوار پیمایش با هم در یک :class:`~tkinter.Frame` چیده می‌شوند و" +" متدهای مدیران چیدمان :class:`~tkinter.Pack`، :class:`~tkinter.Grid` و " +":class:`~tkinter.Place` از شیء :class:`~tkinter.Frame` کسب می‌شوند. این امر " +"امکان می‌دهد که ابزارک :class:`ScrolledText` مستقیماً برای دستیابی به بیشتر " +"رفتار معمول مدیریت چیدمان استفاده شود." -msgid "Should more specific control be necessary, the following attributes are available:" -msgstr "" +msgid "" +"Should more specific control be necessary, the following attributes are " +"available:" +msgstr "در صورت نیاز به کنترل دقیق‌تر، ویژگی‌های زیر در دسترس هستند:" msgid "The frame which surrounds the text and scroll bar widgets." -msgstr "" +msgstr "فریم که ابزارک‌های متن و نوار پیمایش را احاطه می‌کند." msgid "The scroll bar widget." -msgstr "" +msgstr "ابزارک نوار پیمایش." diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 1956dbbfc..f74ca6f9c 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-08-26 03:59+0000\n" -"PO-Revision-Date: 2021-06-28 01:15+0000\n" +"PO-Revision-Date: 2026-08-28 11:26+0330\n" "Last-Translator: Sepehr Rasouli , 2026\n" "Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n" "Language: fa\n" @@ -23,73 +23,137 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.6\n" msgid ":mod:`!tkinter.ttk` --- Tk themed widgets" -msgstr "" +msgstr ":mod:`!tkinter.ttk` --- ابزارک‌های دارای پوسته‌ی Tk" msgid "**Source code:** :source:`Lib/tkinter/ttk.py`" -msgstr "" +msgstr ":source:`Lib/tkinter/ttk.py`" -msgid "The :mod:`!tkinter.ttk` module provides access to the Tk themed widget set, introduced in Tk 8.5. Its widgets adapt their appearance to the platform's native theme, giving an application a better and more consistent look and feel than the classic :mod:`tkinter` widgets, whose appearance is fixed." +msgid "" +"The :mod:`!tkinter.ttk` module provides access to the Tk themed widget set, " +"introduced in Tk 8.5. Its widgets adapt their appearance to the platform's native " +"theme, giving an application a better and more consistent look and feel than the " +"classic :mod:`tkinter` widgets, whose appearance is fixed." msgstr "" +"ماژول :mod:`!tkinter.ttk` دسترسی به مجموعه ابزارک‌های پوسته‌دار Tk را فراهم می‌کند که در " +"Tk 8.5 معرفی شد. ابزارک‌های این ماژول ظاهر خود را با پوسته‌ی بومی سکو تطبیق می‌دهند و به " +"برنامه ظاهر و حسی بهتر و یکدست‌تر از ابزارک‌های کلاسیک :mod:`tkinter` می‌بخشند که ظاهر " +"آن‌ها ثابت است." -msgid "The basic idea for :mod:`!tkinter.ttk` is to separate, to the extent possible, the code implementing a widget's behavior from the code implementing its appearance." +msgid "" +"The basic idea for :mod:`!tkinter.ttk` is to separate, to the extent possible, the " +"code implementing a widget's behavior from the code implementing its appearance." msgstr "" +"ایده‌ی اصلی برای :mod:`!tkinter.ttk` این است که، تا حد امکان، کد پیاده‌سازی رفتار یک " +"ابزارک از کد پیاده‌سازی ظاهر آن جدا شود." -msgid "Ttk widgets are used just like the classic :mod:`tkinter` widgets and share the same machinery: the widget hierarchy, the geometry managers, variable coupling and event binding. Those foundational concepts are covered in the :mod:`tkinter` documentation and are not repeated here." +msgid "" +"Ttk widgets are used just like the classic :mod:`tkinter` widgets and share the " +"same machinery: the widget hierarchy, the geometry managers, variable coupling and " +"event binding. Those foundational concepts are covered in the :mod:`tkinter` " +"documentation and are not repeated here." msgstr "" +"ابزارک‌های Ttk دقیقاً مانند ابزارک‌های کلاسیک :mod:`tkinter` استفاده می‌شوند و از همان " +"سازوکار بهره می‌برند: سلسله‌مراتب ابزارک، مدیران هندسه، جفت‌سازی متغیر و اتصال رویداد. " +"آن مفاهیم بنیادی در مستندات :mod:`tkinter` پوشش داده شده‌اند و در اینجا تکرار " +"نشده‌اند." msgid "`Tk Widget Styling Support (TIP #48) `_" msgstr "" +"`پشتیبانی از سبک‌دهی ابزارک‌های Tk (TIP #48) `_" msgid "The Tcl Improvement Proposal that introduced the themed widget styling engine." -msgstr "" +msgstr "پیشنهاد بهبود Tcl که موتور سبک‌دهی ابزارک‌های پوسته‌دار را معرفی کرد." msgid "Using Ttk" -msgstr "" +msgstr "استفاده از Ttk" msgid "To start using Ttk, import its module::" -msgstr "" +msgstr "برای شروع استفاده از Ttk، ماژول آن را ایمپورت کنید::" msgid "from tkinter import ttk" -msgstr "" +msgstr "from tkinter import ttk" msgid "To override the basic Tk widgets, the import should follow the Tk import::" -msgstr "" +msgstr "برای بازنویسی ابزارک‌های پایه‌ی Tk، ایمپورت باید پس از ایمپورت Tk انجام شود::" msgid "" "from tkinter import *\n" "from tkinter.ttk import *" msgstr "" +"from tkinter import *\n" +"from tkinter.ttk import *" -msgid "That code causes several :mod:`!tkinter.ttk` widgets (:class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`OptionMenu`, :class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale`, :class:`Scrollbar` and :class:`Spinbox`) to automatically replace the Tk widgets." +msgid "" +"That code causes several :mod:`!tkinter.ttk` widgets " +"(:class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`OptionMenu`, :class:`PanedWindow`, :class:`Radiobutton`, :class:`Scale`, :class:`Scrollbar` " +"and :class:`Spinbox`) to automatically replace the Tk widgets." msgstr "" +"آن کد باعث می‌شود چندین ابزارک :mod:`!tkinter.ttk` " +"(:class:`Button`، :class:`Checkbutton`، :class:`Entry`، :class:`Frame`، :class:`Label`، :class:`LabelFrame`، :class:`Menubutton`، :class:`OptionMenu`، :class:`PanedWindow`، :class:`Radiobutton`، :class:`Scale`، :class:`Scrollbar` " +"و :class:`Spinbox`) به‌طور خودکار جایگزین ابزارک‌های Tk شوند." -msgid "Overriding the classic widgets with ``from tkinter.ttk import *`` is convenient for adapting existing code, but new code is usually clearer if it imports the module as ``from tkinter import ttk`` and refers to the themed widgets explicitly, such as ``ttk.Button``." +msgid "" +"Overriding the classic widgets with ``from tkinter.ttk import *`` is convenient for " +"adapting existing code, but new code is usually clearer if it imports the module as " +"``from tkinter import ttk`` and refers to the themed widgets explicitly, such as " +"``ttk.Button``." msgstr "" +"جایگزینی ابزارک‌های کلاسیک با ``from tkinter.ttk import *`` برای سازگار کردن کد " +"موجود مناسب است، اما کد جدید معمولاً زمانی واضح‌تر است که ماژول را به‌صورت ``from " +"tkinter import ttk`` ایمپورت کند و به ابزارک‌های پوسته‌دار به‌صورت صریح ارجاع دهد، " +"مانند ``ttk.Button``." -msgid "This has the direct benefit of using the new widgets which gives a better look and feel across platforms; however, the replacement widgets are not completely compatible. The main difference is that widget options such as ``fg``, ``bg`` and others related to widget styling are no longer present in Ttk widgets. Instead, use the :class:`ttk.Style